403Webshell
Server IP : 146.59.209.152  /  Your IP : 216.73.216.46
Web Server : Apache
System : Linux webm005.cluster131.gra.hosting.ovh.net 5.15.167-ovh-vps-grsec-zfs-classid #1 SMP Tue Sep 17 08:14:20 UTC 2024 x86_64
User : infrafs ( 43850)
PHP Version : 8.2.29
Disable Function : _dyuweyrj4,_dyuweyrj4r,dl
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /home/i/n/f/infrafs/INFRABIKEIT/wp-content/plugins/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /home/i/n/f/infrafs/INFRABIKEIT/wp-content/plugins/packages.tar
woocommerce-blocks/vendor/composer/autoload_real.php000064400000003467151335517640017032 0ustar00<?php

// autoload_real.php @generated by Composer

class ComposerAutoloaderInitb78ca910fe07339d6189615f1734a3e3
{
    private static $loader;

    public static function loadClassLoader($class)
    {
        if ('Composer\Autoload\ClassLoader' === $class) {
            require __DIR__ . '/ClassLoader.php';
        }
    }

    /**
     * @return \Composer\Autoload\ClassLoader
     */
    public static function getLoader()
    {
        if (null !== self::$loader) {
            return self::$loader;
        }

        spl_autoload_register(array('ComposerAutoloaderInitb78ca910fe07339d6189615f1734a3e3', 'loadClassLoader'), true, true);
        self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(\dirname(__FILE__)));
        spl_autoload_unregister(array('ComposerAutoloaderInitb78ca910fe07339d6189615f1734a3e3', 'loadClassLoader'));

        $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
        if ($useStaticLoader) {
            require __DIR__ . '/autoload_static.php';

            call_user_func(\Composer\Autoload\ComposerStaticInitb78ca910fe07339d6189615f1734a3e3::getInitializer($loader));
        } else {
            $map = require __DIR__ . '/autoload_namespaces.php';
            foreach ($map as $namespace => $path) {
                $loader->set($namespace, $path);
            }

            $map = require __DIR__ . '/autoload_psr4.php';
            foreach ($map as $namespace => $path) {
                $loader->setPsr4($namespace, $path);
            }

            $classMap = require __DIR__ . '/autoload_classmap.php';
            if ($classMap) {
                $loader->addClassMap($classMap);
            }
        }

        $loader->register(true);

        return $loader;
    }
}
woocommerce-blocks/vendor/composer/installed.json000064400000016073151335517640016355 0ustar00{
    "packages": [
        {
            "name": "automattic/jetpack-autoloader",
            "version": "v2.10.4",
            "version_normalized": "2.10.4.0",
            "source": {
                "type": "git",
                "url": "https://github.com/Automattic/jetpack-autoloader.git",
                "reference": "70cb300a7a215ae87c671f600f77093518f87bac"
            },
            "dist": {
                "type": "zip",
                "url": "https://api.github.com/repos/Automattic/jetpack-autoloader/zipball/70cb300a7a215ae87c671f600f77093518f87bac",
                "reference": "70cb300a7a215ae87c671f600f77093518f87bac",
                "shasum": ""
            },
            "require": {
                "composer-plugin-api": "^1.1 || ^2.0"
            },
            "require-dev": {
                "automattic/jetpack-changelogger": "^1.2",
                "yoast/phpunit-polyfills": "0.2.0"
            },
            "time": "2021-08-10T06:44:08+00:00",
            "type": "composer-plugin",
            "extra": {
                "autotagger": true,
                "class": "Automattic\\Jetpack\\Autoloader\\CustomAutoloaderPlugin",
                "mirror-repo": "Automattic/jetpack-autoloader",
                "changelogger": {
                    "link-template": "https://github.com/Automattic/jetpack-autoloader/compare/v${old}...v${new}"
                },
                "branch-alias": {
                    "dev-master": "2.10.x-dev"
                }
            },
            "installation-source": "dist",
            "autoload": {
                "classmap": [
                    "src/AutoloadGenerator.php"
                ],
                "psr-4": {
                    "Automattic\\Jetpack\\Autoloader\\": "src"
                }
            },
            "notification-url": "https://packagist.org/downloads/",
            "license": [
                "GPL-2.0-or-later"
            ],
            "description": "Creates a custom autoloader for a plugin or theme.",
            "support": {
                "source": "https://github.com/Automattic/jetpack-autoloader/tree/v2.10.4"
            },
            "install-path": "../automattic/jetpack-autoloader"
        },
        {
            "name": "composer/installers",
            "version": "v1.11.0",
            "version_normalized": "1.11.0.0",
            "source": {
                "type": "git",
                "url": "https://github.com/composer/installers.git",
                "reference": "ae03311f45dfe194412081526be2e003960df74b"
            },
            "dist": {
                "type": "zip",
                "url": "https://api.github.com/repos/composer/installers/zipball/ae03311f45dfe194412081526be2e003960df74b",
                "reference": "ae03311f45dfe194412081526be2e003960df74b",
                "shasum": ""
            },
            "require": {
                "composer-plugin-api": "^1.0 || ^2.0"
            },
            "replace": {
                "roundcube/plugin-installer": "*",
                "shama/baton": "*"
            },
            "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": "^4.2 || ^5",
                "symfony/process": "^2.3"
            },
            "time": "2021-04-28T06:42:17+00:00",
            "type": "composer-plugin",
            "extra": {
                "class": "Composer\\Installers\\Plugin",
                "branch-alias": {
                    "dev-main": "1.x-dev"
                }
            },
            "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": [
                "Craft",
                "Dolibarr",
                "Eliasis",
                "Hurad",
                "ImageCMS",
                "Kanboard",
                "Lan Management System",
                "MODX Evo",
                "MantisBT",
                "Mautic",
                "Maya",
                "OXID",
                "Plentymarkets",
                "Porto",
                "RadPHP",
                "SMF",
                "Starbug",
                "Thelia",
                "Whmcs",
                "WolfCMS",
                "agl",
                "aimeos",
                "annotatecms",
                "attogram",
                "bitrix",
                "cakephp",
                "chef",
                "cockpit",
                "codeigniter",
                "concrete5",
                "croogo",
                "dokuwiki",
                "drupal",
                "eZ Platform",
                "elgg",
                "expressionengine",
                "fuelphp",
                "grav",
                "installer",
                "itop",
                "joomla",
                "known",
                "kohana",
                "laravel",
                "lavalite",
                "lithium",
                "magento",
                "majima",
                "mako",
                "mediawiki",
                "miaoxing",
                "modulework",
                "modx",
                "moodle",
                "osclass",
                "phpbb",
                "piwik",
                "ppi",
                "processwire",
                "puppet",
                "pxcms",
                "reindex",
                "roundcube",
                "shopware",
                "silverstripe",
                "sydes",
                "sylius",
                "symfony",
                "tastyigniter",
                "typo3",
                "wordpress",
                "yawik",
                "zend",
                "zikula"
            ],
            "support": {
                "issues": "https://github.com/composer/installers/issues",
                "source": "https://github.com/composer/installers/tree/v1.11.0"
            },
            "funding": [
                {
                    "url": "https://packagist.com",
                    "type": "custom"
                },
                {
                    "url": "https://github.com/composer",
                    "type": "github"
                },
                {
                    "url": "https://tidelift.com/funding/github/packagist/composer/composer",
                    "type": "tidelift"
                }
            ],
            "install-path": "./installers"
        }
    ],
    "dev": false,
    "dev-package-names": []
}
woocommerce-blocks/vendor/composer/InstalledVersions.php000064400000033147151335517640017665 0ustar00<?php

/*
 * This file is part of Composer.
 *
 * (c) Nils Adermann <naderman@naderman.de>
 *     Jordi Boggiano <j.boggiano@seld.be>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Composer;

use Composer\Autoload\ClassLoader;
use Composer\Semver\VersionParser;

/**
 * This class is copied in every Composer installed project and available to all
 *
 * See also https://getcomposer.org/doc/07-runtime.md#installed-versions
 *
 * To require it's presence, you can require `composer-runtime-api ^2.0`
 */
class InstalledVersions
{
    private static $installed;
    private static $canGetVendors;
    private static $installedByVendor = array();

    /**
     * Returns a list of all package names which are present, either by being installed, replaced or provided
     *
     * @return string[]
     * @psalm-return list<string>
     */
    public static function getInstalledPackages()
    {
        $packages = array();
        foreach (self::getInstalled() as $installed) {
            $packages[] = array_keys($installed['versions']);
        }

        if (1 === \count($packages)) {
            return $packages[0];
        }

        return array_keys(array_flip(\call_user_func_array('array_merge', $packages)));
    }

    /**
     * Returns a list of all package names with a specific type e.g. 'library'
     *
     * @param  string   $type
     * @return string[]
     * @psalm-return list<string>
     */
    public static function getInstalledPackagesByType($type)
    {
        $packagesByType = array();

        foreach (self::getInstalled() as $installed) {
            foreach ($installed['versions'] as $name => $package) {
                if (isset($package['type']) && $package['type'] === $type) {
                    $packagesByType[] = $name;
                }
            }
        }

        return $packagesByType;
    }

    /**
     * Checks whether the given package is installed
     *
     * This also returns true if the package name is provided or replaced by another package
     *
     * @param  string $packageName
     * @param  bool   $includeDevRequirements
     * @return bool
     */
    public static function isInstalled($packageName, $includeDevRequirements = true)
    {
        foreach (self::getInstalled() as $installed) {
            if (isset($installed['versions'][$packageName])) {
                return $includeDevRequirements || empty($installed['versions'][$packageName]['dev_requirement']);
            }
        }

        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($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, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string}
     */
    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, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string}>}
     */
    public static function getRawData()
    {
        @trigger_error('getRawData only returns the first dataset loaded, which may not be what you expect. Use getAllRawData() instead which returns all datasets for all autoloaders present in the process.', E_USER_DEPRECATED);

        if (null === self::$installed) {
            // only require the installed.php file if this file is loaded from its dumped location,
            // and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937
            if (substr(__DIR__, -8, 1) !== 'C') {
                self::$installed = include __DIR__ . '/installed.php';
            } else {
                self::$installed = array();
            }
        }

        return self::$installed;
    }

    /**
     * Returns the raw data of all installed.php which are currently loaded for custom implementations
     *
     * @return array[]
     * @psalm-return list<array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string}>}>
     */
    public static function getAllRawData()
    {
        return self::getInstalled();
    }

    /**
     * Lets you reload the static array from another file
     *
     * This is only useful for complex integrations in which a project needs to use
     * this class but then also needs to execute another project's autoloader in process,
     * and wants to ensure both projects have access to their version of installed.php.
     *
     * A typical case would be PHPUnit, where it would need to make sure it reads all
     * the data it needs from this class, then call reload() with
     * `require $CWD/vendor/composer/installed.php` (or similar) as input to make sure
     * the project in which it runs can then also use this class safely, without
     * interference between PHPUnit's dependencies and the project's dependencies.
     *
     * @param  array[] $data A vendor/composer/installed.php data set
     * @return void
     *
     * @psalm-param array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string}>} $data
     */
    public static function reload($data)
    {
        self::$installed = $data;
        self::$installedByVendor = array();
    }

    /**
     * @return array[]
     * @psalm-return list<array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string}>}>
     */
    private static function getInstalled()
    {
        if (null === self::$canGetVendors) {
            self::$canGetVendors = method_exists('Composer\Autoload\ClassLoader', 'getRegisteredLoaders');
        }

        $installed = array();

        if (self::$canGetVendors) {
            foreach (ClassLoader::getRegisteredLoaders() as $vendorDir => $loader) {
                if (isset(self::$installedByVendor[$vendorDir])) {
                    $installed[] = self::$installedByVendor[$vendorDir];
                } elseif (is_file($vendorDir.'/composer/installed.php')) {
                    $installed[] = self::$installedByVendor[$vendorDir] = require $vendorDir.'/composer/installed.php';
                    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') {
                self::$installed = require __DIR__ . '/installed.php';
            } else {
                self::$installed = array();
            }
        }
        $installed[] = self::$installed;

        return $installed;
    }
}
woocommerce-blocks/vendor/composer/autoload_namespaces.php000064400000000225151335517640020213 0ustar00<?php

// autoload_namespaces.php @generated by Composer

$vendorDir = dirname(dirname(__FILE__));
$baseDir = dirname($vendorDir);

return array(
);
woocommerce-blocks/vendor/composer/autoload_classmap.php000064400000000555151335517640017705 0ustar00<?php

// autoload_classmap.php @generated by Composer

$vendorDir = dirname(dirname(__FILE__));
$baseDir = dirname($vendorDir);

return array(
    'Automattic\\Jetpack\\Autoloader\\AutoloadGenerator' => $vendorDir . '/automattic/jetpack-autoloader/src/AutoloadGenerator.php',
    'Composer\\InstalledVersions' => $vendorDir . '/composer/InstalledVersions.php',
);
woocommerce-blocks/vendor/composer/installers/phpstan.neon.dist000064400000000325151335517640021154 0ustar00parameters:
    level: 5
    paths:
        - src
        - tests
    excludes_analyse:
        - tests/Composer/Installers/Test/PolyfillTestCase.php

includes:
    - vendor/phpstan/phpstan-phpunit/extension.neon
woocommerce-blocks/vendor/composer/installers/src/Composer/Installers/WHMCSInstaller.php000064400000001506151335517640025624 0ustar00<?php

namespace Composer\Installers;

class WHMCSInstaller extends BaseInstaller
{
    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}/'
    );
}
woocommerce-blocks/vendor/composer/installers/src/Composer/Installers/MajimaInstaller.php000064400000001502151335517640026135 0ustar00<?php
namespace Composer\Installers;

/**
 * Plugin/theme installer for majima
 * @author David Neustadt
 */
class MajimaInstaller extends BaseInstaller
{
    protected $locations = array(
        'plugin' => 'plugins/{$name}/',
    );

    /**
     * Transforms the names
     * @param  array $vars
     * @return array
     */
    public function inflectPackageVars($vars)
    {
        return $this->correctPluginName($vars);
    }

    /**
     * Change hyphenated names to camelcase
     * @param  array $vars
     * @return array
     */
    private function correctPluginName($vars)
    {
        $camelCasedName = preg_replace_callback('/(-[a-z])/', function ($matches) {
            return strtoupper($matches[0][1]);
        }, $vars['name']);
        $vars['name'] = ucfirst($camelCasedName);
        return $vars;
    }
}
woocommerce-blocks/vendor/composer/installers/src/Composer/Installers/CakePHPInstaller.php000064400000003362151335517640026160 0ustar00<?php
namespace Composer\Installers;

use Composer\DependencyResolver\Pool;
use Composer\Semver\Constraint\Constraint;

class CakePHPInstaller extends BaseInstaller
{
    protected $locations = array(
        'plugin' => 'Plugin/{$name}/',
    );

    /**
     * Format package name to CamelCase
     */
    public function inflectPackageVars($vars)
    {
        if ($this->matchesCakeVersion('>=', '3.0.0')) {
            return $vars;
        }

        $nameParts = explode('/', $vars['name']);
        foreach ($nameParts as &$value) {
            $value = strtolower(preg_replace('/(?<=\\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()
    {
        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
     *
     * @param string $matcher
     * @param string $version
     * @return bool
     */
    protected function matchesCakeVersion($matcher, $version)
    {
        $repositoryManager = $this->composer->getRepositoryManager();
        if (! $repositoryManager) {
            return false;
        }

        $repos = $repositoryManager->getLocalRepository();
        if (!$repos) {
            return false;
        }

        return $repos->findPackage('cakephp/cakephp', new Constraint($matcher, $version)) !== null;
    }
}
woocommerce-blocks/vendor/composer/installers/src/Composer/Installers/CockpitInstaller.php000064400000001231151335517640026332 0ustar00<?php
namespace Composer\Installers;

class CockpitInstaller extends BaseInstaller
{
    protected $locations = array(
        'module' => 'cockpit/modules/addons/{$name}/',
    );

    /**
     * Format module name.
     *
     * Strip `module-` prefix from package name.
     *
     * {@inheritDoc}
     */
    public function inflectPackageVars($vars)
    {
        if ($vars['type'] == 'cockpit-module') {
            return $this->inflectModuleVars($vars);
        }

        return $vars;
    }

    public function inflectModuleVars($vars)
    {
        $vars['name'] = ucfirst(preg_replace('/cockpit-/i', '', $vars['name']));

        return $vars;
    }
}
woocommerce-blocks/vendor/composer/installers/src/Composer/Installers/MoodleInstaller.php000064400000006054151335517640026165 0ustar00<?php
namespace Composer\Installers;

class MoodleInstaller extends BaseInstaller
{
    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}/',
        '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}/',
        'fileconverter'      => 'files/converter/{$name}/',
        'format'             => 'course/format/{$name}/',
        'coursereport'       => 'course/report/{$name}/',
        'customcertelement'  => 'mod/customcert/element/{$name}/',
        'datafield'          => 'mod/data/field/{$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}/',
        'message'            => 'message/output/{$name}/',
        'mnetservice'        => 'mnet/service/{$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}/'
    );
}
woocommerce-blocks/vendor/composer/installers/src/Composer/Installers/MauticInstaller.php000064400000002225151335517640026164 0ustar00<?php
namespace Composer\Installers;

use Composer\Package\PackageInterface;

class MauticInstaller extends BaseInstaller
{
    protected $locations = array(
        'plugin'           => 'plugins/{$name}/',
        'theme'            => 'themes/{$name}/',
        'core'             => 'app/',
    );

    private function getDirectoryName()
    {
        $extra = $this->package->getExtra();
        if (!empty($extra['install-directory-name'])) {
            return $extra['install-directory-name'];
        }

        return $this->toCamelCase($this->package->getPrettyName());
    }

    /**
     * @param string $packageName
     *
     * @return string
     */
    private function toCamelCase($packageName)
    {
        return str_replace(' ', '', ucwords(str_replace('-', ' ', basename($packageName))));
    }

    /**
     * Format package name of mautic-plugins to CamelCase
     */
    public function inflectPackageVars($vars)
    {

        if ($vars['type'] == 'mautic-plugin' || $vars['type'] == 'mautic-theme') {
            $directoryName = $this->getDirectoryName();
            $vars['name'] = $directoryName;
        }

        return $vars;
    }

}
woocommerce-blocks/vendor/composer/installers/src/Composer/Installers/CroogoInstaller.php000064400000000767151335517640026203 0ustar00<?php
namespace Composer\Installers;

class CroogoInstaller extends BaseInstaller
{
    protected $locations = array(
        'plugin' => 'Plugin/{$name}/',
        'theme' => 'View/Themed/{$name}/',
    );

    /**
     * Format package name to CamelCase
     */
    public function inflectPackageVars($vars)
    {
        $vars['name'] = strtolower(str_replace(array('-', '_'), ' ', $vars['name']));
        $vars['name'] = str_replace(' ', '', ucwords($vars['name']));

        return $vars;
    }
}
woocommerce-blocks/vendor/composer/installers/src/Composer/Installers/KnownInstaller.php000064400000000411151335517640026031 0ustar00<?php
namespace Composer\Installers;

class KnownInstaller extends BaseInstaller
{
    protected $locations = array(
        'plugin'    => 'IdnoPlugins/{$name}/',
        'theme'     => 'Themes/{$name}/',
        'console'   => 'ConsolePlugins/{$name}/',
    );
}
woocommerce-blocks/vendor/composer/installers/src/Composer/Installers/OxidInstaller.php000064400000002652151335517640025651 0ustar00<?php
namespace Composer\Installers;

use Composer\Package\PackageInterface;

class OxidInstaller extends BaseInstaller
{
	const VENDOR_PATTERN = '/^modules\/(?P<vendor>.+)\/.+/';

    protected $locations = array(
        'module'    => 'modules/{$name}/',
        'theme'  => 'application/views/{$name}/',
        'out'    => 'out/{$name}/',
    );

	/**
	 * getInstallPath
	 *
	 * @param PackageInterface $package
	 * @param string $frameworkType
	 * @return string
	 */
	public function getInstallPath(PackageInterface $package, $frameworkType = '')
	{
		$installPath = parent::getInstallPath($package, $frameworkType);
		$type = $this->package->getType();
		if ($type === 'oxid-module') {
			$this->prepareVendorDirectory($installPath);
		}
		return $installPath;
	}

	/**
	 * prepareVendorDirectory
	 *
	 * Makes sure there is a vendormetadata.php file inside
	 * the vendor folder if there is a vendor folder.
	 *
	 * @param string $installPath
	 * @return void
	 */
	protected function prepareVendorDirectory($installPath)
	{
		$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);
	}
}
woocommerce-blocks/vendor/composer/installers/src/Composer/Installers/WordPressInstaller.php000064400000000524151335517640026672 0ustar00<?php
namespace Composer\Installers;

class WordPressInstaller extends BaseInstaller
{
    protected $locations = array(
        'plugin'    => 'wp-content/plugins/{$name}/',
        'theme'     => 'wp-content/themes/{$name}/',
        'muplugin'  => 'wp-content/mu-plugins/{$name}/',
        'dropin'    => 'wp-content/{$name}/',
    );
}
woocommerce-blocks/vendor/composer/installers/src/Composer/Installers/ExpressionEngineInstaller.php000064400000001334151335517640030227 0ustar00<?php
namespace Composer\Installers;

use Composer\Package\PackageInterface;

class ExpressionEngineInstaller extends BaseInstaller
{

    protected $locations = array();

    private $ee2Locations = array(
        'addon'   => 'system/expressionengine/third_party/{$name}/',
        'theme'   => 'themes/third_party/{$name}/',
    );

    private $ee3Locations = array(
        'addon'   => 'system/user/addons/{$name}/',
        'theme'   => 'themes/user/{$name}/',
    );

    public function getInstallPath(PackageInterface $package, $frameworkType = '')
    {

        $version = "{$frameworkType}Locations";
        $this->locations = $this->$version;

        return parent::getInstallPath($package, $frameworkType);
    }
}
woocommerce-blocks/vendor/composer/installers/src/Composer/Installers/HuradInstaller.php000064400000001276151335517640026012 0ustar00<?php
namespace Composer\Installers;

class HuradInstaller extends BaseInstaller
{
    protected $locations = array(
        'plugin' => 'plugins/{$name}/',
        'theme' => 'plugins/{$name}/',
    );

    /**
     * Format package name to CamelCase
     */
    public function inflectPackageVars($vars)
    {
        $nameParts = explode('/', $vars['name']);
        foreach ($nameParts as &$value) {
            $value = strtolower(preg_replace('/(?<=\\w)([A-Z])/', '_\\1', $value));
            $value = str_replace(array('-', '_'), ' ', $value);
            $value = str_replace(' ', '', ucwords($value));
        }
        $vars['name'] = implode('/', $nameParts);
        return $vars;
    }
}
vendor/composer/installers/src/Composer/Installers/LanManagementSystemInstaller.php000064400000001326151335517640030600 0ustar00woocommerce-blocks<?php

namespace Composer\Installers;

class LanManagementSystemInstaller extends BaseInstaller
{

    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($vars)
    {
        $vars['name'] = strtolower(preg_replace('/(?<=\\w)([A-Z])/', '_\\1', $vars['name']));
        $vars['name'] = str_replace(array('-', '_'), ' ', $vars['name']);
        $vars['name'] = str_replace(' ', '', ucwords($vars['name']));

        return $vars;
    }

}
woocommerce-blocks/vendor/composer/installers/src/Composer/Installers/Plugin.php000064400000001214151335517640024317 0ustar00<?php

namespace Composer\Installers;

use Composer\Composer;
use Composer\IO\IOInterface;
use Composer\Plugin\PluginInterface;

class Plugin implements PluginInterface
{
    private $installer;

    public function activate(Composer $composer, IOInterface $io)
    {
        $this->installer = new Installer($io, $composer);
        $composer->getInstallationManager()->addInstaller($this->installer);
    }

    public function deactivate(Composer $composer, IOInterface $io)
    {
        $composer->getInstallationManager()->removeInstaller($this->installer);
    }

    public function uninstall(Composer $composer, IOInterface $io)
    {
    }
}
woocommerce-blocks/vendor/composer/installers/src/Composer/Installers/MODULEWorkInstaller.php000064400000000256151335517640026574 0ustar00<?php
namespace Composer\Installers;

class MODULEWorkInstaller extends BaseInstaller
{
    protected $locations = array(
        'module'    => 'modules/{$name}/',
    );
}
woocommerce-blocks/vendor/composer/installers/src/Composer/Installers/UserFrostingInstaller.php000064400000000265151335517640027376 0ustar00<?php
namespace Composer\Installers;

class UserFrostingInstaller extends BaseInstaller
{
    protected $locations = array(
        'sprinkle' => 'app/sprinkles/{$name}/',
    );
}
woocommerce-blocks/vendor/composer/installers/src/Composer/Installers/ZendInstaller.php000064400000000376151335517640025647 0ustar00<?php
namespace Composer\Installers;

class ZendInstaller extends BaseInstaller
{
    protected $locations = array(
        'library' => 'library/{$name}/',
        'extra'   => 'extras/library/{$name}/',
        'module'  => 'module/{$name}/',
    );
}
woocommerce-blocks/vendor/composer/installers/src/Composer/Installers/VanillaInstaller.php000064400000000325151335517640026327 0ustar00<?php
namespace Composer\Installers;

class VanillaInstaller extends BaseInstaller
{
    protected $locations = array(
        'plugin'    => 'plugins/{$name}/',
        'theme'     => 'themes/{$name}/',
    );
}
woocommerce-blocks/vendor/composer/installers/src/Composer/Installers/KirbyInstaller.php000064400000000405151335517640026020 0ustar00<?php
namespace Composer\Installers;

class KirbyInstaller extends BaseInstaller
{
    protected $locations = array(
        'plugin'    => 'site/plugins/{$name}/',
        'field'    => 'site/fields/{$name}/',
        'tag'    => 'site/tags/{$name}/'
    );
}
woocommerce-blocks/vendor/composer/installers/src/Composer/Installers/PiwikInstaller.php000064400000001271151335517640026025 0ustar00<?php
namespace Composer\Installers;

/**
 * Class PiwikInstaller
 *
 * @package Composer\Installers
 */
class PiwikInstaller extends BaseInstaller
{
    /**
     * @var array
     */
    protected $locations = array(
        'plugin' => 'plugins/{$name}/',
    );

    /**
     * Format package name to CamelCase
     * @param array $vars
     *
     * @return array
     */
    public function inflectPackageVars($vars)
    {
        $vars['name'] = strtolower(preg_replace('/(?<=\\w)([A-Z])/', '_\\1', $vars['name']));
        $vars['name'] = str_replace(array('-', '_'), ' ', $vars['name']);
        $vars['name'] = str_replace(' ', '', ucwords($vars['name']));

        return $vars;
    }
}
woocommerce-blocks/vendor/composer/installers/src/Composer/Installers/DecibelInstaller.php000064400000000272151335517640026271 0ustar00<?php
namespace Composer\Installers;

class DecibelInstaller extends BaseInstaller
{
    /** @var array */
    protected $locations = array(
        'app'    => 'app/{$name}/',
    );
}
woocommerce-blocks/vendor/composer/installers/src/Composer/Installers/PimcoreInstaller.php000064400000001040151335517640026332 0ustar00<?php
namespace Composer\Installers;

class PimcoreInstaller extends BaseInstaller
{
    protected $locations = array(
        'plugin' => 'plugins/{$name}/',
    );

    /**
     * Format package name to CamelCase
     */
    public function inflectPackageVars($vars)
    {
        $vars['name'] = strtolower(preg_replace('/(?<=\\w)([A-Z])/', '_\\1', $vars['name']));
        $vars['name'] = str_replace(array('-', '_'), ' ', $vars['name']);
        $vars['name'] = str_replace(' ', '', ucwords($vars['name']));

        return $vars;
    }
}
woocommerce-blocks/vendor/composer/installers/src/Composer/Installers/WolfCMSInstaller.php000064400000000255151335517640026215 0ustar00<?php
namespace Composer\Installers;

class WolfCMSInstaller extends BaseInstaller
{
    protected $locations = array(
        'plugin' => 'wolf/plugins/{$name}/',
    );
}
woocommerce-blocks/vendor/composer/installers/src/Composer/Installers/OntoWikiInstaller.php000064400000001324151335517640026504 0ustar00<?php
namespace Composer\Installers;

class OntoWikiInstaller extends BaseInstaller
{
    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($vars)
    {
        $vars['name'] = strtolower($vars['name']);
        $vars['name'] = preg_replace('/.ontowiki$/', '', $vars['name']);
        $vars['name'] = preg_replace('/-theme$/', '', $vars['name']);
        $vars['name'] = preg_replace('/-translation$/', '', $vars['name']);

        return $vars;
    }
}
woocommerce-blocks/vendor/composer/installers/src/Composer/Installers/MakoInstaller.php000064400000000253151335517640025630 0ustar00<?php
namespace Composer\Installers;

class MakoInstaller extends BaseInstaller
{
    protected $locations = array(
        'package' => 'app/packages/{$name}/',
    );
}
woocommerce-blocks/vendor/composer/installers/src/Composer/Installers/CodeIgniterInstaller.php000064400000000465151335517640027142 0ustar00<?php
namespace Composer\Installers;

class CodeIgniterInstaller extends BaseInstaller
{
    protected $locations = array(
        'library'     => 'application/libraries/{$name}/',
        'third-party' => 'application/third_party/{$name}/',
        'module'      => 'application/modules/{$name}/',
    );
}
woocommerce-blocks/vendor/composer/installers/src/Composer/Installers/CraftInstaller.php000064400000001446151335517640026005 0ustar00<?php
namespace Composer\Installers;

/**
 * Installer for Craft Plugins
 */
class CraftInstaller extends BaseInstaller
{
    const NAME_PREFIX = 'craft';
    const NAME_SUFFIX = 'plugin';

    protected $locations = array(
        'plugin' => 'craft/plugins/{$name}/',
    );

    /**
     * Strip `craft-` prefix and/or `-plugin` suffix from package names
     *
     * @param  array $vars
     *
     * @return array
     */
    final public function inflectPackageVars($vars)
    {
        return $this->inflectPluginVars($vars);
    }

    private function inflectPluginVars($vars)
    {
        $vars['name'] = preg_replace('/-' . self::NAME_SUFFIX . '$/i', '', $vars['name']);
        $vars['name'] = preg_replace('/^' . self::NAME_PREFIX . '-/i', '', $vars['name']);

        return $vars;
    }
}
woocommerce-blocks/vendor/composer/installers/src/Composer/Installers/TYPO3FlowInstaller.php000064400000002300151335517640026442 0ustar00<?php
namespace Composer\Installers;

/**
 * An installer to handle TYPO3 Flow specifics when installing packages.
 */
class TYPO3FlowInstaller extends BaseInstaller
{
    protected $locations = array(
        'package'       => 'Packages/Application/{$name}/',
        'framework'     => 'Packages/Framework/{$name}/',
        'plugin'        => 'Packages/Plugins/{$name}/',
        'site'          => 'Packages/Sites/{$name}/',
        'boilerplate'   => 'Packages/Boilerplates/{$name}/',
        'build'         => 'Build/{$name}/',
    );

    /**
     * Modify the package name to be a TYPO3 Flow style key.
     *
     * @param  array $vars
     * @return array
     */
    public function inflectPackageVars($vars)
    {
        $autoload = $this->package->getAutoload();
        if (isset($autoload['psr-0']) && is_array($autoload['psr-0'])) {
            $namespace = key($autoload['psr-0']);
            $vars['name'] = str_replace('\\', '.', $namespace);
        }
        if (isset($autoload['psr-4']) && is_array($autoload['psr-4'])) {
            $namespace = key($autoload['psr-4']);
            $vars['name'] = rtrim(str_replace('\\', '.', $namespace), '.');
        }

        return $vars;
    }
}
woocommerce-blocks/vendor/composer/installers/src/Composer/Installers/PortoInstaller.php000064400000000260151335517640026042 0ustar00<?php
namespace Composer\Installers;

class PortoInstaller extends BaseInstaller
{
    protected $locations = array(
        'container' => 'app/Containers/{$name}/',
    );
}
woocommerce-blocks/vendor/composer/installers/src/Composer/Installers/WinterInstaller.php000064400000002676151335517640026224 0ustar00<?php
namespace Composer\Installers;

class WinterInstaller extends BaseInstaller
{
    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($vars)
    {
        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;
    }
    
    protected function inflectModuleVars($vars)
    {
        $vars['name'] = preg_replace('/^wn-|-module$/', '', $vars['name']);

        return $vars;
    }

    protected function inflectPluginVars($vars)
    {
        $vars['name'] = preg_replace('/^wn-|-plugin$/', '', $vars['name']);
        $vars['vendor'] = preg_replace('/[^a-z0-9_]/i', '', $vars['vendor']);

        return $vars;
    }

    protected function inflectThemeVars($vars)
    {
        $vars['name'] = preg_replace('/^wn-|-theme$/', '', $vars['name']);

        return $vars;
    }
}
woocommerce-blocks/vendor/composer/installers/src/Composer/Installers/JoomlaInstaller.php000064400000000640151335517640026162 0ustar00<?php
namespace Composer\Installers;

class JoomlaInstaller extends BaseInstaller
{
    protected $locations = array(
        'component'    => 'components/{$name}/',
        'module'       => 'modules/{$name}/',
        'template'     => 'templates/{$name}/',
        'plugin'       => 'plugins/{$name}/',
        'library'      => 'libraries/{$name}/',
    );

    // TODO: Add inflector for mod_ and com_ names
}
woocommerce-blocks/vendor/composer/installers/src/Composer/Installers/KodiCMSInstaller.php000064400000000333151335517640026171 0ustar00<?php
namespace Composer\Installers;

class KodiCMSInstaller extends BaseInstaller
{
    protected $locations = array(
        'plugin' => 'cms/plugins/{$name}/',
        'media'  => 'cms/media/vendor/{$name}/'
    );
}woocommerce-blocks/vendor/composer/installers/src/Composer/Installers/BitrixInstaller.php000064400000010251151335517640026201 0ustar00<?php

namespace Composer\Installers;

use Composer\Util\Filesystem;

/**
 * Installer for Bitrix Framework. Supported types of extensions:
 * - `bitrix-d7-module` — copy the module to directory `bitrix/modules/<vendor>.<name>`.
 * - `bitrix-d7-component` — copy the component to directory `bitrix/components/<vendor>/<name>`.
 * - `bitrix-d7-template` — copy the template to directory `bitrix/templates/<vendor>_<name>`.
 * 
 * You can set custom path to directory with Bitrix kernel in `composer.json`:
 * 
 * ```json
 * {
 *      "extra": {
 *          "bitrix-dir": "s1/bitrix"
 *      }
 * }
 * ```
 *
 * @author Nik Samokhvalov <nik@samokhvalov.info>
 * @author Denis Kulichkin <onexhovia@gmail.com>
 */
class BitrixInstaller extends BaseInstaller
{
    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 array Storage for informations about duplicates at all the time of installation packages.
     */
    private static $checkedDuplicates = array();

    /**
     * {@inheritdoc}
     */
    public function inflectPackageVars($vars)
    {
        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($path, array $vars = array())
    {
        $templatePath = parent::templatePath($path, $vars);
        $this->checkDuplicates($templatePath, $vars);

        return $templatePath;
    }

    /**
     * Duplicates search packages.
     *
     * @param string $path
     * @param array $vars
     */
    protected function checkDuplicates($path, array $vars = array())
    {
        $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 && $this->io->isInteractive()) {

            $this->io->writeError('    <error>Duplication of packages:</error>');
            $this->io->writeError('    <info>Package ' . $oldPath . ' will be called instead package ' . $path . '</info>');

            while (true) {
                switch ($this->io->ask('    <info>Delete ' . $oldPath . ' [y,n,?]?</info> ', '?')) {
                    case 'y':
                        $fs = new Filesystem();
                        $fs->removeDirectory($oldPath);
                        break 2;

                    case 'n':
                        break 2;

                    case '?':
                    default:
                        $this->io->writeError(array(
                            '    y - delete package ' . $oldPath . ' and to continue with the installation',
                            '    n - don\'t delete and to continue with the installation',
                        ));
                        $this->io->writeError('    ? - print help');
                        break;
                }
            }
        }

        static::$checkedDuplicates[] = $oldPath;
    }
}
woocommerce-blocks/vendor/composer/installers/src/Composer/Installers/PPIInstaller.php000064400000000244151335517640025371 0ustar00<?php
namespace Composer\Installers;

class PPIInstaller extends BaseInstaller
{
    protected $locations = array(
        'module' => 'modules/{$name}/',
    );
}
woocommerce-blocks/vendor/composer/installers/src/Composer/Installers/SyDESInstaller.php000064400000002264151335517640025674 0ustar00<?php
namespace Composer\Installers;

class SyDESInstaller extends BaseInstaller
{
    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.
     *
     * {@inerhitDoc}
     */
    public function inflectPackageVars($vars)
    {
        if ($vars['type'] == 'sydes-module') {
            return $this->inflectModuleVars($vars);
        }

        if ($vars['type'] === 'sydes-theme') {
            return $this->inflectThemeVars($vars);
        }

        return $vars;
    }

    public function inflectModuleVars($vars)
    {
        $vars['name'] = preg_replace('/(^sydes-|-module$)/i', '', $vars['name']);
        $vars['name'] = str_replace(array('-', '_'), ' ', $vars['name']);
        $vars['name'] = str_replace(' ', '', ucwords($vars['name']));

        return $vars;
    }

    protected function inflectThemeVars($vars)
    {
        $vars['name'] = preg_replace('/(^sydes-|-theme$)/', '', $vars['name']);
        $vars['name'] = strtolower($vars['name']);

        return $vars;
    }
}
woocommerce-blocks/vendor/composer/installers/src/Composer/Installers/PhpBBInstaller.php000064400000000405151335517640025673 0ustar00<?php
namespace Composer\Installers;

class PhpBBInstaller extends BaseInstaller
{
    protected $locations = array(
        'extension' => 'ext/{$vendor}/{$name}/',
        'language'  => 'language/{$name}/',
        'style'     => 'styles/{$name}/',
    );
}
woocommerce-blocks/vendor/composer/installers/src/Composer/Installers/SMFInstaller.php000064400000000312151335517640025362 0ustar00<?php
namespace Composer\Installers;

class SMFInstaller extends BaseInstaller
{
    protected $locations = array(
        'module' => 'Sources/{$name}/',
        'theme' => 'Themes/{$name}/',
    );
}
woocommerce-blocks/vendor/composer/installers/src/Composer/Installers/Installer.php000064400000024313151335517640025023 0ustar00<?php

namespace Composer\Installers;

use Composer\Composer;
use Composer\Installer\BinaryInstaller;
use Composer\Installer\LibraryInstaller;
use Composer\IO\IOInterface;
use Composer\Package\PackageInterface;
use Composer\Repository\InstalledRepositoryInterface;
use Composer\Util\Filesystem;
use React\Promise\PromiseInterface;

class Installer extends LibraryInstaller
{

    /**
     * Package types to installer class map
     *
     * @var array
     */
    private $supportedTypes = array(
        'aimeos'       => 'AimeosInstaller',
        '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',
        'craft'        => 'CraftInstaller',
        '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',
        'joomla'       => 'JoomlaInstaller',
        'kanboard'     => 'KanboardInstaller',
        'kirby'        => 'KirbyInstaller',
        'known'	       => 'KnownInstaller',
        'kodicms'      => 'KodiCMSInstaller',
        'kohana'       => 'KohanaInstaller',
        'lms'      => 'LanManagementSystemInstaller',
        'laravel'      => 'LaravelInstaller',
        'lavalite'     => 'LavaLiteInstaller',
        'lithium'      => 'LithiumInstaller',
        'magento'      => 'MagentoInstaller',
        'majima'       => 'MajimaInstaller',
        'mantisbt'     => 'MantisBTInstaller',
        'mako'         => 'MakoInstaller',
        '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',
        'pimcore'      => 'PimcoreInstaller',
        'piwik'        => 'PiwikInstaller',
        'plentymarkets'=> 'PlentymarketsInstaller',
        'ppi'          => 'PPIInstaller',
        'puppet'       => 'PuppetInstaller',
        'radphp'       => 'RadPHPInstaller',
        'phifty'       => 'PhiftyInstaller',
        'porto'        => 'PortoInstaller',
        'processwire'  => 'ProcessWireInstaller',
        'redaxo'       => 'RedaxoInstaller',
        'redaxo5'      => 'Redaxo5Installer',
        'reindex'      => 'ReIndexInstaller',
        'roundcube'    => 'RoundcubeInstaller',
        'shopware'     => 'ShopwareInstaller',
        'sitedirect'   => 'SiteDirectInstaller',
        'silverstripe' => 'SilverStripeInstaller',
        'smf'          => 'SMFInstaller',
        'starbug'      => 'StarbugInstaller',
        'sydes'        => 'SyDESInstaller',
        'sylius'       => 'SyliusInstaller',
        'symfony1'     => 'Symfony1Installer',
        'tao'          => 'TaoInstaller',
        'thelia'       => 'TheliaInstaller',
        'tusk'         => 'TuskInstaller',
        'typo3-cms'    => 'TYPO3CmsInstaller',
        'typo3-flow'   => 'TYPO3FlowInstaller',
        'userfrosting' => 'UserFrostingInstaller',
        'vanilla'      => 'VanillaInstaller',
        'whmcs'        => 'WHMCSInstaller',
        'winter'       => 'WinterInstaller',
        'wolfcms'      => 'WolfCMSInstaller',
        'wordpress'    => 'WordPressInstaller',
        'yawik'        => 'YawikInstaller',
        'zend'         => 'ZendInstaller',
        'zikula'       => 'ZikulaInstaller',
        'prestashop'   => 'PrestashopInstaller'
    );

    /**
     * Installer constructor.
     *
     * Disables installers specified in main composer extra installer-disable
     * list
     *
     * @param IOInterface          $io
     * @param Composer             $composer
     * @param string               $type
     * @param Filesystem|null      $filesystem
     * @param BinaryInstaller|null $binaryInstaller
     */
    public function __construct(
        IOInterface $io,
        Composer $composer,
        $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());

        return $installer->getInstallPath($package, $frameworkType);
    }

    public function uninstall(InstalledRepositoryInterface $repo, PackageInterface $package)
    {
        $installPath = $this->getPackageBasePath($package);
        $io = $this->io;
        $outputStatus = function () use ($io, $installPath) {
            $io->write(sprintf('Deleting %s - %s', $installPath, !file_exists($installPath) ? '<comment>deleted</comment>' : '<error>not deleted</error>'));
        };

        $promise = parent::uninstall($repo, $package);

        // Composer v2 might return a promise here
        if ($promise instanceof PromiseInterface) {
            return $promise->then($outputStatus);
        }

        // If not, execute the code right away as parent::uninstall executed synchronously (composer v1, or v2 without async)
        $outputStatus();

        return null;
    }

    /**
     * {@inheritDoc}
     */
    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
     *
     * @param  string       $type
     * @return string|false
     */
    protected function findFrameworkType($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
     *
     * @param  string $frameworkType
     * @return string
     */
    protected function getLocationPattern($frameworkType)
    {
        $pattern = false;
        if (!empty($this->supportedTypes[$frameworkType])) {
            $frameworkClass = 'Composer\\Installers\\' . $this->supportedTypes[$frameworkType];
            /** @var BaseInstaller $framework */
            $framework = new $frameworkClass(null, $this->composer, $this->getIO());
            $locations = array_keys($framework->getLocations());
            $pattern = $locations ? '(' . implode('|', $locations) . ')' : false;
        }

        return $pattern ? : '(\w+)';
    }

    /**
     * Get I/O object
     *
     * @return IOInterface
     */
    private function getIO()
    {
        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)
     *
     * @return void
     */
    protected function removeDisabledInstallers()
    {
        $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();
        } else {
            // Disable specified installers
            foreach ($disable as $key => $installer) {
                if (is_string($installer) && key_exists($installer, $this->supportedTypes)) {
                    unset($this->supportedTypes[$installer]);
                }
            }
        }
    }
}
woocommerce-blocks/vendor/composer/installers/src/Composer/Installers/SyliusInstaller.php000064400000000245151335517640026232 0ustar00<?php
namespace Composer\Installers;

class SyliusInstaller extends BaseInstaller
{
    protected $locations = array(
        'theme' => 'themes/{$name}/',
    );
}
woocommerce-blocks/vendor/composer/installers/src/Composer/Installers/BonefishInstaller.php000064400000000267151335517640026503 0ustar00<?php
namespace Composer\Installers;

class BonefishInstaller extends BaseInstaller
{
    protected $locations = array(
        'package'    => 'Packages/{$vendor}/{$name}/'
    );
}
woocommerce-blocks/vendor/composer/installers/src/Composer/Installers/VgmcpInstaller.php000064400000002457151335517640026025 0ustar00<?php
namespace Composer\Installers;

class VgmcpInstaller extends BaseInstaller
{
    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($vars)
    {
        if ($vars['type'] === 'vgmcp-bundle') {
            return $this->inflectPluginVars($vars);
        }

        if ($vars['type'] === 'vgmcp-theme') {
            return $this->inflectThemeVars($vars);
        }

        return $vars;
    }

    protected function inflectPluginVars($vars)
    {
        $vars['name'] = preg_replace('/-bundle$/', '', $vars['name']);
        $vars['name'] = str_replace(array('-', '_'), ' ', $vars['name']);
        $vars['name'] = str_replace(' ', '', ucwords($vars['name']));

        return $vars;
    }

    protected function inflectThemeVars($vars)
    {
        $vars['name'] = preg_replace('/-theme$/', '', $vars['name']);
        $vars['name'] = str_replace(array('-', '_'), ' ', $vars['name']);
        $vars['name'] = str_replace(' ', '', ucwords($vars['name']));

        return $vars;
    }
}
woocommerce-blocks/vendor/composer/installers/src/Composer/Installers/TaoInstaller.php000064400000001423151335517640025464 0ustar00<?php
namespace Composer\Installers;

/**
 * An installer to handle TAO extensions.
 */
class TaoInstaller extends BaseInstaller
{
    const EXTRA_TAO_EXTENSION_NAME = 'tao-extension-name';

    protected $locations = array(
        'extension' => '{$name}'
    );
    
    public function inflectPackageVars($vars)
    {
        $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;
    }
}
woocommerce-blocks/vendor/composer/installers/src/Composer/Installers/FuelphpInstaller.php000064400000000257151335517640026350 0ustar00<?php
namespace Composer\Installers;

class FuelphpInstaller extends BaseInstaller
{
    protected $locations = array(
        'component'  => 'components/{$name}/',
    );
}
woocommerce-blocks/vendor/composer/installers/src/Composer/Installers/ReIndexInstaller.php000064400000000324151335517640026276 0ustar00<?php
namespace Composer\Installers;

class ReIndexInstaller extends BaseInstaller
{
    protected $locations = array(
        'theme'     => 'themes/{$name}/',
        'plugin'    => 'plugins/{$name}/'
    );
}
woocommerce-blocks/vendor/composer/installers/src/Composer/Installers/ZikulaInstaller.php000064400000000341151335517640026176 0ustar00<?php
namespace Composer\Installers;

class ZikulaInstaller extends BaseInstaller
{
    protected $locations = array(
        'module' => 'modules/{$vendor}-{$name}/',
        'theme'  => 'themes/{$vendor}-{$name}/'
    );
}
woocommerce-blocks/vendor/composer/installers/src/Composer/Installers/YawikInstaller.php000064400000001246151335517640026030 0ustar00<?php
/**
 * Created by PhpStorm.
 * User: cbleek
 * Date: 25.03.16
 * Time: 20:55
 */

namespace Composer\Installers;


class YawikInstaller extends BaseInstaller
{
    protected $locations = array(
        'module'  => 'module/{$name}/',
    );

    /**
     * Format package name to CamelCase
     * @param array $vars
     *
     * @return array
     */
    public function inflectPackageVars($vars)
    {
        $vars['name'] = strtolower(preg_replace('/(?<=\\w)([A-Z])/', '_\\1', $vars['name']));
        $vars['name'] = str_replace(array('-', '_'), ' ', $vars['name']);
        $vars['name'] = str_replace(' ', '', ucwords($vars['name']));

        return $vars;
    }
}woocommerce-blocks/vendor/composer/installers/src/Composer/Installers/TYPO3CmsInstaller.php000064400000000575151335517640026271 0ustar00<?php
namespace Composer\Installers;

/**
 * Extension installer for TYPO3 CMS
 *
 * @deprecated since 1.0.25, use https://packagist.org/packages/typo3/cms-composer-installers instead
 *
 * @author Sascha Egerer <sascha.egerer@dkd.de>
 */
class TYPO3CmsInstaller extends BaseInstaller
{
    protected $locations = array(
        'extension'   => 'typo3conf/ext/{$name}/',
    );
}
woocommerce-blocks/vendor/composer/installers/src/Composer/Installers/Concrete5Installer.php000064400000000556151335517640026576 0ustar00<?php
namespace Composer\Installers;

class Concrete5Installer extends BaseInstaller
{
    protected $locations = array(
        'core'       => 'concrete/',
        'block'      => 'application/blocks/{$name}/',
        'package'    => 'packages/{$name}/',
        'theme'      => 'application/themes/{$name}/',
        'update'     => 'updates/{$name}/',
    );
}
woocommerce-blocks/vendor/composer/installers/src/Composer/Installers/TastyIgniterInstaller.php000064400000001553151335517640027373 0ustar00<?php

namespace Composer\Installers;

class TastyIgniterInstaller extends BaseInstaller
{
    protected $locations = array(
        '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($vars)
    {
        if ($vars['type'] === 'tastyigniter-extension') {
            $vars['vendor'] = preg_replace('/[^a-z0-9_]/i', '', $vars['vendor']);
            $vars['name'] = preg_replace('/^ti-ext-/', '', $vars['name']);
        }

        if ($vars['type'] === 'tastyigniter-theme') {
            $vars['name'] = preg_replace('/^ti-theme-/', '', $vars['name']);
        }

        return $vars;
    }
}woocommerce-blocks/vendor/composer/installers/src/Composer/Installers/FuelInstaller.php000064400000000417151335517640025636 0ustar00<?php
namespace Composer\Installers;

class FuelInstaller extends BaseInstaller
{
    protected $locations = array(
        'module'  => 'fuel/app/modules/{$name}/',
        'package' => 'fuel/packages/{$name}/',
        'theme'   => 'fuel/app/themes/{$name}/',
    );
}
woocommerce-blocks/vendor/composer/installers/src/Composer/Installers/DframeInstaller.php000064400000000263151335517640026140 0ustar00<?php

namespace Composer\Installers;

class DframeInstaller extends BaseInstaller
{
    protected $locations = array(
        'module'  => 'modules/{$vendor}/{$name}/',
    );
}
woocommerce-blocks/vendor/composer/installers/src/Composer/Installers/ProcessWireInstaller.php000064400000001053151335517640027205 0ustar00<?php

namespace Composer\Installers;

class ProcessWireInstaller extends BaseInstaller
{
    protected $locations = array(
        'module'  => 'site/modules/{$name}/',
    );

    /**
     * Format package name to CamelCase
     */
    public function inflectPackageVars($vars)
    {
        $vars['name'] = strtolower(preg_replace('/(?<=\\w)([A-Z])/', '_\\1', $vars['name']));
        $vars['name'] = str_replace(array('-', '_'), ' ', $vars['name']);
        $vars['name'] = str_replace(' ', '', ucwords($vars['name']));

        return $vars;
    }
}
woocommerce-blocks/vendor/composer/installers/src/Composer/Installers/DokuWikiInstaller.php000064400000002354151335517640026473 0ustar00<?php
namespace Composer\Installers;

class DokuWikiInstaller extends BaseInstaller
{
    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($vars)
    {

        if ($vars['type'] === 'dokuwiki-plugin') {
            return $this->inflectPluginVars($vars);
        }

        if ($vars['type'] === 'dokuwiki-template') {
            return $this->inflectTemplateVars($vars);
        }

        return $vars;
    }

    protected function inflectPluginVars($vars)
    {
        $vars['name'] = preg_replace('/-plugin$/', '', $vars['name']);
        $vars['name'] = preg_replace('/^dokuwiki_?-?/', '', $vars['name']);

        return $vars;
    }

    protected function inflectTemplateVars($vars)
    {
        $vars['name'] = preg_replace('/-template$/', '', $vars['name']);
        $vars['name'] = preg_replace('/^dokuwiki_?-?/', '', $vars['name']);

        return $vars;
    }

}
woocommerce-blocks/vendor/composer/installers/src/Composer/Installers/AsgardInstaller.php000064400000002456151335517640026151 0ustar00<?php
namespace Composer\Installers;

class AsgardInstaller extends BaseInstaller
{
    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($vars)
    {
        if ($vars['type'] === 'asgard-module') {
            return $this->inflectPluginVars($vars);
        }

        if ($vars['type'] === 'asgard-theme') {
            return $this->inflectThemeVars($vars);
        }

        return $vars;
    }

    protected function inflectPluginVars($vars)
    {
        $vars['name'] = preg_replace('/-module$/', '', $vars['name']);
        $vars['name'] = str_replace(array('-', '_'), ' ', $vars['name']);
        $vars['name'] = str_replace(' ', '', ucwords($vars['name']));

        return $vars;
    }

    protected function inflectThemeVars($vars)
    {
        $vars['name'] = preg_replace('/-theme$/', '', $vars['name']);
        $vars['name'] = str_replace(array('-', '_'), ' ', $vars['name']);
        $vars['name'] = str_replace(' ', '', ucwords($vars['name']));

        return $vars;
    }
}
woocommerce-blocks/vendor/composer/installers/src/Composer/Installers/Symfony1Installer.php000064400000001066151335517640026471 0ustar00<?php
namespace Composer\Installers;

/**
 * Plugin installer for symfony 1.x
 *
 * @author Jérôme Tamarelle <jerome@tamarelle.net>
 */
class Symfony1Installer extends BaseInstaller
{
    protected $locations = array(
        'plugin'    => 'plugins/{$name}/',
    );

    /**
     * Format package name to CamelCase
     */
    public function inflectPackageVars($vars)
    {
        $vars['name'] = preg_replace_callback('/(-[a-z])/', function ($matches) {
            return strtoupper($matches[0][1]);
        }, $vars['name']);

        return $vars;
    }
}
woocommerce-blocks/vendor/composer/installers/src/Composer/Installers/AglInstaller.php000064400000000711151335517640025443 0ustar00<?php
namespace Composer\Installers;

class AglInstaller extends BaseInstaller
{
    protected $locations = array(
        'module' => 'More/{$name}/',
    );

    /**
     * Format package name to CamelCase
     */
    public function inflectPackageVars($vars)
    {
        $vars['name'] = preg_replace_callback('/(?:^|_|-)(.?)/', function ($matches) {
            return strtoupper($matches[1]);
        }, $vars['name']);

        return $vars;
    }
}
woocommerce-blocks/vendor/composer/installers/src/Composer/Installers/DolibarrInstaller.php000064400000000542151335517640026500 0ustar00<?php
namespace Composer\Installers;

/**
 * Class DolibarrInstaller
 *
 * @package Composer\Installers
 * @author  Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
 */
class DolibarrInstaller extends BaseInstaller
{
    //TODO: Add support for scripts and themes
    protected $locations = array(
        'module' => 'htdocs/custom/{$name}/',
    );
}
woocommerce-blocks/vendor/composer/installers/src/Composer/Installers/TheliaInstaller.php000064400000000604151335517640026147 0ustar00<?php
namespace Composer\Installers;

class TheliaInstaller extends BaseInstaller
{
    protected $locations = array(
        'module'                => 'local/modules/{$name}/',
        'frontoffice-template'  => 'templates/frontOffice/{$name}/',
        'backoffice-template'   => 'templates/backOffice/{$name}/',
        'email-template'        => 'templates/email/{$name}/',
    );
}
woocommerce-blocks/vendor/composer/installers/src/Composer/Installers/OctoberInstaller.php000064400000002377151335517640026347 0ustar00<?php
namespace Composer\Installers;

class OctoberInstaller extends BaseInstaller
{
    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($vars)
    {
        if ($vars['type'] === 'october-plugin') {
            return $this->inflectPluginVars($vars);
        }

        if ($vars['type'] === 'october-theme') {
            return $this->inflectThemeVars($vars);
        }

        return $vars;
    }

    protected function inflectPluginVars($vars)
    {
        $vars['name'] = preg_replace('/^oc-|-plugin$/', '', $vars['name']);
        $vars['vendor'] = preg_replace('/[^a-z0-9_]/i', '', $vars['vendor']);

        return $vars;
    }

    protected function inflectThemeVars($vars)
    {
        $vars['name'] = preg_replace('/^oc-|-theme$/', '', $vars['name']);
        $vars['vendor'] = preg_replace('/[^a-z0-9_]/i', '', $vars['vendor']);

        return $vars;
    }
}
woocommerce-blocks/vendor/composer/installers/src/Composer/Installers/StarbugInstaller.php000064400000000461151335517640026351 0ustar00<?php
namespace Composer\Installers;

class StarbugInstaller extends BaseInstaller
{
    protected $locations = array(
        'module' => 'modules/{$name}/',
        'theme' => 'themes/{$name}/',
        'custom-module' => 'app/modules/{$name}/',
        'custom-theme' => 'app/themes/{$name}/'
    );
}
woocommerce-blocks/vendor/composer/installers/src/Composer/Installers/MODXEvoInstaller.php000064400000000741151335517640026164 0ustar00<?php
namespace Composer\Installers;

/**
 * An installer to handle MODX Evolution specifics when installing packages.
 */
class MODXEvoInstaller extends BaseInstaller
{
    protected $locations = array(
        'snippet'       => 'assets/snippets/{$name}/',
        'plugin'        => 'assets/plugins/{$name}/',
        'module'        => 'assets/modules/{$name}/',
        'template'      => 'assets/templates/{$name}/',
        'lib'           => 'assets/lib/{$name}/'
    );
}
woocommerce-blocks/vendor/composer/installers/src/Composer/Installers/MagentoInstaller.php000064400000000421151335517640026330 0ustar00<?php
namespace Composer\Installers;

class MagentoInstaller extends BaseInstaller
{
    protected $locations = array(
        'theme'   => 'app/design/frontend/{$name}/',
        'skin'    => 'skin/frontend/default/{$name}/',
        'library' => 'lib/{$name}/',
    );
}
woocommerce-blocks/vendor/composer/installers/src/Composer/Installers/EzPlatformInstaller.php000064400000000354151335517640027026 0ustar00<?php
namespace Composer\Installers;

class EzPlatformInstaller extends BaseInstaller
{
    protected $locations = array(
        'meta-assets' => 'web/assets/ezplatform/',
        'assets' => 'web/assets/ezplatform/{$name}/',
    );
}
woocommerce-blocks/vendor/composer/installers/src/Composer/Installers/EliasisInstaller.php000064400000000461151335517640026333 0ustar00<?php
namespace Composer\Installers;

class EliasisInstaller extends BaseInstaller
{
    protected $locations = array(
        'component' => 'components/{$name}/',
        'module'    => 'modules/{$name}/',
        'plugin'    => 'plugins/{$name}/',
        'template'  => 'templates/{$name}/',
    );
}
woocommerce-blocks/vendor/composer/installers/src/Composer/Installers/PxcmsInstaller.php000064400000003734151335517640026042 0ustar00<?php
namespace Composer\Installers;

class PxcmsInstaller extends BaseInstaller
{
    protected $locations = array(
        'module' => 'app/Modules/{$name}/',
        'theme' => 'themes/{$name}/',
    );

    /**
     * Format package name.
     *
     * @param array $vars
     *
     * @return array
     */
    public function inflectPackageVars($vars)
    {
        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.
     *
     * return string
     */
    protected function inflectModuleVars($vars)
    {
        $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'] = preg_replace('/-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.
     *
     * return string
     */
    protected function inflectThemeVars($vars)
    {
        $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'] = preg_replace('/-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;
    }
}
woocommerce-blocks/vendor/composer/installers/src/Composer/Installers/TuskInstaller.php000064400000000640151335517640025667 0ustar00<?php
    namespace Composer\Installers;
    /**
     * Composer installer for 3rd party Tusk utilities
     * @author Drew Ewing <drew@phenocode.com>
     */
    class TuskInstaller extends BaseInstaller
    {
        protected $locations = array(
            'task'    => '.tusk/tasks/{$name}/',
            'command' => '.tusk/commands/{$name}/',
            'asset'   => 'assets/tusk/{$name}/',
        );
    }
woocommerce-blocks/vendor/composer/installers/src/Composer/Installers/PhiftyInstaller.php000064400000000400151335517640026176 0ustar00<?php
namespace Composer\Installers;

class PhiftyInstaller extends BaseInstaller
{
    protected $locations = array(
        'bundle' => 'bundles/{$name}/',
        'library' => 'libraries/{$name}/',
        'framework' => 'frameworks/{$name}/',
    );
}
woocommerce-blocks/vendor/composer/installers/src/Composer/Installers/ModxInstaller.php000064400000000364151335517640025653 0ustar00<?php
namespace Composer\Installers;

/**
 * An installer to handle MODX specifics when installing packages.
 */
class ModxInstaller extends BaseInstaller
{
    protected $locations = array(
        'extra' => 'core/packages/{$name}/'
    );
}
woocommerce-blocks/vendor/composer/installers/src/Composer/Installers/SilverStripeInstaller.php000064400000002127151335517640027376 0ustar00<?php
namespace Composer\Installers;

use Composer\Package\PackageInterface;

class SilverStripeInstaller extends BaseInstaller
{
    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
     *
     * @param  PackageInterface $package
     * @param  string           $frameworkType
     * @return string
     */
    public function getInstallPath(PackageInterface $package, $frameworkType = '')
    {
        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);
    }
}
woocommerce-blocks/vendor/composer/installers/src/Composer/Installers/DrupalInstaller.php000064400000001543151335517640026173 0ustar00<?php
namespace Composer\Installers;

class DrupalInstaller extends BaseInstaller
{
    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/',
    );
}
woocommerce-blocks/vendor/composer/installers/src/Composer/Installers/AttogramInstaller.php000064400000000251151335517640026515 0ustar00<?php
namespace Composer\Installers;

class AttogramInstaller extends BaseInstaller
{
    protected $locations = array(
        'module' => 'modules/{$name}/',
    );
}
woocommerce-blocks/vendor/composer/installers/src/Composer/Installers/PrestashopInstaller.php000064400000000322151335517640027066 0ustar00<?php
namespace Composer\Installers;

class PrestashopInstaller extends BaseInstaller
{
    protected $locations = array(
        'module' => 'modules/{$name}/',
        'theme'  => 'themes/{$name}/',
    );
}
woocommerce-blocks/vendor/composer/installers/src/Composer/Installers/ShopwareInstaller.php000064400000003156151335517640026536 0ustar00<?php
namespace Composer\Installers;

/**
 * Plugin/theme installer for shopware
 * @author Benjamin Boit
 */
class ShopwareInstaller extends BaseInstaller
{
    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
     * @param  array $vars
     * @return array
     */
    public function inflectPackageVars($vars)
    {
        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($vars)
    {
        $camelCasedName = preg_replace_callback('/(-[a-z])/', function ($matches) {
            return strtoupper($matches[0][1]);
        }, $vars['name']);

        $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($vars)
    {
        $vars['name'] = str_replace('-', '_', $vars['name']);

        return $vars;
    }
}
woocommerce-blocks/vendor/composer/installers/src/Composer/Installers/SiteDirectInstaller.php000064400000001216151335517640027000 0ustar00<?php

namespace Composer\Installers;

class SiteDirectInstaller extends BaseInstaller
{
    protected $locations = array(
        'module' => 'modules/{$vendor}/{$name}/',
        'plugin' => 'plugins/{$vendor}/{$name}/'
    );

    public function inflectPackageVars($vars)
    {
        return $this->parseVars($vars);
    }

    protected function parseVars($vars)
    {
        $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;
    }
}
woocommerce-blocks/vendor/composer/installers/src/Composer/Installers/RadPHPInstaller.php000064400000001223151335517640026015 0ustar00<?php
namespace Composer\Installers;

class RadPHPInstaller extends BaseInstaller
{
    protected $locations = array(
        'bundle' => 'src/{$name}/'
    );

    /**
     * Format package name to CamelCase
     */
    public function inflectPackageVars($vars)
    {
        $nameParts = explode('/', $vars['name']);
        foreach ($nameParts as &$value) {
            $value = strtolower(preg_replace('/(?<=\\w)([A-Z])/', '_\\1', $value));
            $value = str_replace(array('-', '_'), ' ', $value);
            $value = str_replace(' ', '', ucwords($value));
        }
        $vars['name'] = implode('/', $nameParts);
        return $vars;
    }
}
woocommerce-blocks/vendor/composer/installers/src/Composer/Installers/MayaInstaller.php000064400000001427151335517640025634 0ustar00<?php
namespace Composer\Installers;

class MayaInstaller extends BaseInstaller
{
    protected $locations = array(
        'module' => 'modules/{$name}/',
    );

    /**
     * Format package name.
     *
     * For package type maya-module, cut off a trailing '-module' if present.
     *
     */
    public function inflectPackageVars($vars)
    {
        if ($vars['type'] === 'maya-module') {
            return $this->inflectModuleVars($vars);
        }

        return $vars;
    }

    protected function inflectModuleVars($vars)
    {
        $vars['name'] = preg_replace('/-module$/', '', $vars['name']);
        $vars['name'] = str_replace(array('-', '_'), ' ', $vars['name']);
        $vars['name'] = str_replace(' ', '', ucwords($vars['name']));

        return $vars;
    }
}
woocommerce-blocks/vendor/composer/installers/src/Composer/Installers/Redaxo5Installer.php000064400000000404151335517640026246 0ustar00<?php
namespace Composer\Installers;

class Redaxo5Installer extends BaseInstaller
{
    protected $locations = array(
        'addon'          => 'redaxo/src/addons/{$name}/',
        'bestyle-plugin' => 'redaxo/src/addons/be_style/plugins/{$name}/'
    );
}
woocommerce-blocks/vendor/composer/installers/src/Composer/Installers/ChefInstaller.php000064400000000336151335517640025610 0ustar00<?php
namespace Composer\Installers;

class ChefInstaller extends BaseInstaller
{
    protected $locations = array(
        'cookbook'  => 'Chef/{$vendor}/{$name}/',
        'role'      => 'Chef/roles/{$name}/',
    );
}

woocommerce-blocks/vendor/composer/installers/src/Composer/Installers/ClanCatsFrameworkInstaller.php000064400000000326151335517640030310 0ustar00<?php
namespace Composer\Installers;

class ClanCatsFrameworkInstaller extends BaseInstaller
{
	protected $locations = array(
		'ship'      => 'CCF/orbit/{$name}/',
		'theme'     => 'CCF/app/themes/{$name}/',
	);
}woocommerce-blocks/vendor/composer/installers/src/Composer/Installers/MantisBTInstaller.php000064400000001110151335517640026413 0ustar00<?php
namespace Composer\Installers;

use Composer\DependencyResolver\Pool;

class MantisBTInstaller extends BaseInstaller
{
    protected $locations = array(
        'plugin' => 'plugins/{$name}/',
    );

    /**
     * Format package name to CamelCase
     */
    public function inflectPackageVars($vars)
    {
        $vars['name'] = strtolower(preg_replace('/(?<=\\w)([A-Z])/', '_\\1', $vars['name']));
        $vars['name'] = str_replace(array('-', '_'), ' ', $vars['name']);
        $vars['name'] = str_replace(' ', '', ucwords($vars['name']));

        return $vars;
    }
}
woocommerce-blocks/vendor/composer/installers/src/Composer/Installers/AimeosInstaller.php000064400000000250151335517640026153 0ustar00<?php
namespace Composer\Installers;

class AimeosInstaller extends BaseInstaller
{
    protected $locations = array(
        'extension'   => 'ext/{$name}/',
    );
}
woocommerce-blocks/vendor/composer/installers/src/Composer/Installers/LaravelInstaller.php000064400000000253151335517640026327 0ustar00<?php
namespace Composer\Installers;

class LaravelInstaller extends BaseInstaller
{
    protected $locations = array(
        'library' => 'libraries/{$name}/',
    );
}
woocommerce-blocks/vendor/composer/installers/src/Composer/Installers/LavaLiteInstaller.php000064400000000344151335517640026443 0ustar00<?php
namespace Composer\Installers;

class LavaLiteInstaller extends BaseInstaller
{
    protected $locations = array(
        'package' => 'packages/{$vendor}/{$name}/',
        'theme'   => 'public/themes/{$name}/',
    );
}
woocommerce-blocks/vendor/composer/installers/src/Composer/Installers/PlentymarketsInstaller.php000064400000001311151335517640027577 0ustar00<?php
namespace Composer\Installers;

class PlentymarketsInstaller extends BaseInstaller
{
    protected $locations = array(
        'plugin'   => '{$name}/'
    );

    /**
     * Remove hyphen, "plugin" and format to camelcase
     * @param array $vars
     *
     * @return array
     */
    public function inflectPackageVars($vars)
    {
        $vars['name'] = explode("-", $vars['name']);
        foreach ($vars['name'] as $key => $name) {
            $vars['name'][$key] = ucfirst($vars['name'][$key]);
            if (strcasecmp($name, "Plugin") == 0) {
                unset($vars['name'][$key]);
            }
        }
        $vars['name'] = implode("",$vars['name']);

        return $vars;
    }
}
woocommerce-blocks/vendor/composer/installers/src/Composer/Installers/ElggInstaller.php000064400000000241151335517640025614 0ustar00<?php
namespace Composer\Installers;

class ElggInstaller extends BaseInstaller
{
    protected $locations = array(
        'plugin' => 'mod/{$name}/',
    );
}
woocommerce-blocks/vendor/composer/installers/src/Composer/Installers/KohanaInstaller.php000064400000000247151335517640026145 0ustar00<?php
namespace Composer\Installers;

class KohanaInstaller extends BaseInstaller
{
    protected $locations = array(
        'module' => 'modules/{$name}/',
    );
}
woocommerce-blocks/vendor/composer/installers/src/Composer/Installers/PuppetInstaller.php000064400000000251151335517640026214 0ustar00<?php

namespace Composer\Installers;

class PuppetInstaller extends BaseInstaller
{

    protected $locations = array(
        'module' => 'modules/{$name}/',
    );
}
woocommerce-blocks/vendor/composer/installers/src/Composer/Installers/AnnotateCmsInstaller.php000064400000000436151335517640027160 0ustar00<?php
namespace Composer\Installers;

class AnnotateCmsInstaller extends BaseInstaller
{
    protected $locations = array(
        'module'    => 'addons/modules/{$name}/',
        'component' => 'addons/components/{$name}/',
        'service'   => 'addons/services/{$name}/',
    );
}
woocommerce-blocks/vendor/composer/installers/src/Composer/Installers/MicroweberInstaller.php000064400000010340151335517640027035 0ustar00<?php
namespace Composer\Installers;

class MicroweberInstaller extends BaseInstaller
{
    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($vars)
    {


        if ($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;
    }

    protected function inflectTemplateVars($vars)
    {
        $vars['install_item_dir'] = preg_replace('/-template$/', '', $vars['install_item_dir']);
        $vars['install_item_dir'] = preg_replace('/template-$/', '', $vars['install_item_dir']);

        return $vars;
    }

    protected function inflectTemplatesVars($vars)
    {
        $vars['install_item_dir'] = preg_replace('/-templates$/', '', $vars['install_item_dir']);
        $vars['install_item_dir'] = preg_replace('/templates-$/', '', $vars['install_item_dir']);

        return $vars;
    }

    protected function inflectCoreVars($vars)
    {
        $vars['install_item_dir'] = preg_replace('/-providers$/', '', $vars['install_item_dir']);
        $vars['install_item_dir'] = preg_replace('/-provider$/', '', $vars['install_item_dir']);
        $vars['install_item_dir'] = preg_replace('/-adapter$/', '', $vars['install_item_dir']);

        return $vars;
    }

    protected function inflectModuleVars($vars)
    {
        $vars['install_item_dir'] = preg_replace('/-module$/', '', $vars['install_item_dir']);
        $vars['install_item_dir'] = preg_replace('/module-$/', '', $vars['install_item_dir']);

        return $vars;
    }

    protected function inflectModulesVars($vars)
    {
        $vars['install_item_dir'] = preg_replace('/-modules$/', '', $vars['install_item_dir']);
        $vars['install_item_dir'] = preg_replace('/modules-$/', '', $vars['install_item_dir']);

        return $vars;
    }

    protected function inflectSkinVars($vars)
    {
        $vars['install_item_dir'] = preg_replace('/-skin$/', '', $vars['install_item_dir']);
        $vars['install_item_dir'] = preg_replace('/skin-$/', '', $vars['install_item_dir']);

        return $vars;
    }

    protected function inflectElementVars($vars)
    {
        $vars['install_item_dir'] = preg_replace('/-elements$/', '', $vars['install_item_dir']);
        $vars['install_item_dir'] = preg_replace('/elements-$/', '', $vars['install_item_dir']);
        $vars['install_item_dir'] = preg_replace('/-element$/', '', $vars['install_item_dir']);
        $vars['install_item_dir'] = preg_replace('/element-$/', '', $vars['install_item_dir']);

        return $vars;
    }
}
woocommerce-blocks/vendor/composer/installers/src/Composer/Installers/RoundcubeInstaller.php000064400000000711151335517640026666 0ustar00<?php
namespace Composer\Installers;

class RoundcubeInstaller extends BaseInstaller
{
    protected $locations = array(
        'plugin' => 'plugins/{$name}/',
    );

    /**
     * Lowercase name and changes the name to a underscores
     *
     * @param  array $vars
     * @return array
     */
    public function inflectPackageVars($vars)
    {
        $vars['name'] = strtolower(str_replace('-', '_', $vars['name']));

        return $vars;
    }
}
woocommerce-blocks/vendor/composer/installers/src/Composer/Installers/CiviCrmInstaller.php000064400000000243151335517640026274 0ustar00<?php
namespace Composer\Installers;

class CiviCrmInstaller extends BaseInstaller
{
    protected $locations = array(
        'ext'    => 'ext/{$name}/'
    );
}
woocommerce-blocks/vendor/composer/installers/src/Composer/Installers/ImageCMSInstaller.php000064400000000444151335517640026330 0ustar00<?php
namespace Composer\Installers;

class ImageCMSInstaller extends BaseInstaller
{
    protected $locations = array(
        'template'    => 'templates/{$name}/',
        'module'      => 'application/modules/{$name}/',
        'library'     => 'application/libraries/{$name}/',
    );
}
woocommerce-blocks/vendor/composer/installers/src/Composer/Installers/ItopInstaller.php000064400000000256151335517640025657 0ustar00<?php
namespace Composer\Installers;

class ItopInstaller extends BaseInstaller
{
    protected $locations = array(
        'extension'    => 'extensions/{$name}/',
    );
}
woocommerce-blocks/vendor/composer/installers/src/Composer/Installers/MediaWikiInstaller.php000064400000002422151335517640026604 0ustar00<?php
namespace Composer\Installers;

class MediaWikiInstaller extends BaseInstaller
{
    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($vars)
    {

        if ($vars['type'] === 'mediawiki-extension') {
            return $this->inflectExtensionVars($vars);
        }

        if ($vars['type'] === 'mediawiki-skin') {
            return $this->inflectSkinVars($vars);
        }

        return $vars;
    }

    protected function inflectExtensionVars($vars)
    {
        $vars['name'] = preg_replace('/-extension$/', '', $vars['name']);
        $vars['name'] = str_replace('-', ' ', $vars['name']);
        $vars['name'] = str_replace(' ', '', ucwords($vars['name']));

        return $vars;
    }

    protected function inflectSkinVars($vars)
    {
        $vars['name'] = preg_replace('/-skin$/', '', $vars['name']);

        return $vars;
    }

}
woocommerce-blocks/vendor/composer/installers/src/Composer/Installers/BaseInstaller.php000064400000007753151335517640025627 0ustar00<?php
namespace Composer\Installers;

use Composer\IO\IOInterface;
use Composer\Composer;
use Composer\Package\PackageInterface;

abstract class BaseInstaller
{
    protected $locations = array();
    protected $composer;
    protected $package;
    protected $io;

    /**
     * Initializes base installer.
     *
     * @param PackageInterface $package
     * @param Composer         $composer
     * @param IOInterface      $io
     */
    public function __construct(PackageInterface $package = null, Composer $composer = null, IOInterface $io = null)
    {
        $this->composer = $composer;
        $this->package = $package;
        $this->io = $io;
    }

    /**
     * Return the install path based on package type.
     *
     * @param  PackageInterface $package
     * @param  string           $frameworkType
     * @return string
     */
    public function getInstallPath(PackageInterface $package, $frameworkType = '')
    {
        $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'];
        }

        if ($this->composer->getPackage()) {
            $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();
        if (!isset($locations[$packageType])) {
            throw new \InvalidArgumentException(sprintf('Package type "%s" is not supported', $type));
        }

        return $this->templatePath($locations[$packageType], $availableVars);
    }

    /**
     * For an installer to override to modify the vars per installer.
     *
     * @param  array<string, string> $vars This will normally receive array{name: string, vendor: string, type: string}
     * @return array<string, string>
     */
    public function inflectPackageVars($vars)
    {
        return $vars;
    }

    /**
     * Gets the installer's locations
     *
     * @return array<string, string> map of package types => install path
     */
    public function getLocations()
    {
        return $this->locations;
    }

    /**
     * Replace vars in a path
     *
     * @param  string                $path
     * @param  array<string, string> $vars
     * @return string
     */
    protected function templatePath($path, array $vars = array())
    {
        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
     * @param  string $name
     * @param  string $type
     * @param  string $vendor = NULL
     * @return string|false
     */
    protected function mapCustomInstallPaths(array $paths, $name, $type, $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;
    }
}
woocommerce-blocks/vendor/composer/installers/src/Composer/Installers/GravInstaller.php000064400000001274151335517640025644 0ustar00<?php
namespace Composer\Installers;

class GravInstaller extends BaseInstaller
{
    protected $locations = array(
        'plugin' => 'user/plugins/{$name}/',
        'theme'  => 'user/themes/{$name}/',
    );

    /**
     * Format package name
     *
     * @param array $vars
     *
     * @return array
     */
    public function inflectPackageVars($vars)
    {
        $restrictedWords = implode('|', array_keys($this->locations));

        $vars['name'] = strtolower($vars['name']);
        $vars['name'] = preg_replace('/^(?:grav-)?(?:(?:'.$restrictedWords.')-)?(.*?)(?:-(?:'.$restrictedWords.'))?$/ui',
            '$1',
            $vars['name']
        );

        return $vars;
    }
}
woocommerce-blocks/vendor/composer/installers/src/Composer/Installers/OsclassInstaller.php000064400000000447151335517640026355 0ustar00<?php
namespace Composer\Installers;


class OsclassInstaller extends BaseInstaller 
{
    
    protected $locations = array(
        'plugin' => 'oc-content/plugins/{$name}/',
        'theme' => 'oc-content/themes/{$name}/',
        'language' => 'oc-content/languages/{$name}/',
    );
    
}
woocommerce-blocks/vendor/composer/installers/src/Composer/Installers/LithiumInstaller.php000064400000000336151335517640026356 0ustar00<?php
namespace Composer\Installers;

class LithiumInstaller extends BaseInstaller
{
    protected $locations = array(
        'library' => 'libraries/{$name}/',
        'source'  => 'libraries/_source/{$name}/',
    );
}
woocommerce-blocks/vendor/composer/installers/src/Composer/Installers/MiaoxingInstaller.php000064400000000252151335517640026513 0ustar00<?php

namespace Composer\Installers;

class MiaoxingInstaller extends BaseInstaller
{
    protected $locations = array(
        'plugin' => 'plugins/{$name}/',
    );
}
woocommerce-blocks/vendor/composer/installers/src/Composer/Installers/RedaxoInstaller.php000064400000000413151335517640026161 0ustar00<?php
namespace Composer\Installers;

class RedaxoInstaller extends BaseInstaller
{
    protected $locations = array(
        'addon'          => 'redaxo/include/addons/{$name}/',
        'bestyle-plugin' => 'redaxo/include/addons/be_style/plugins/{$name}/'
    );
}
woocommerce-blocks/vendor/composer/installers/src/Composer/Installers/KanboardInstaller.php000064400000000450151335517640026461 0ustar00<?php
namespace Composer\Installers;

/**
 *
 * Installer for kanboard plugins
 *
 * kanboard.net
 *
 * Class KanboardInstaller
 * @package Composer\Installers
 */
class KanboardInstaller extends BaseInstaller
{
    protected $locations = array(
        'plugin'  => 'plugins/{$name}/',
    );
}
woocommerce-blocks/vendor/composer/installers/src/bootstrap.php000064400000000724151335517640021174 0ustar00<?php
function includeIfExists($file)
{
    if (file_exists($file)) {
        return include $file;
    }
}
if ((!$loader = includeIfExists(__DIR__ . '/../vendor/autoload.php')) && (!$loader = includeIfExists(__DIR__ . '/../../../autoload.php'))) {
    die('You must set up the project dependencies, run the following commands:'.PHP_EOL.
        'curl -s http://getcomposer.org/installer | php'.PHP_EOL.
        'php composer.phar install'.PHP_EOL);
}
return $loader;
woocommerce-blocks/vendor/composer/installers/LICENSE000064400000002046151335517640016663 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.woocommerce-blocks/vendor/composer/jetpack_autoload_psr4.php000064400000001343151335517640020467 0ustar00<?php

// This file `jetpack_autoload_psr4.php` was auto generated by automattic/jetpack-autoloader.

$vendorDir = dirname(__DIR__);
$baseDir   = dirname($vendorDir);

return array(
	'Composer\\Installers\\' => array(
		'version' => '1.11.0.0',
		'path'    => array( $vendorDir . '/composer/installers/src/Composer/Installers' )
	),
	'Automattic\\WooCommerce\\Blocks\\Tests\\' => array(
		'version' => '6.1.0.0',
		'path'    => array( $baseDir . '/tests/php' )
	),
	'Automattic\\WooCommerce\\Blocks\\' => array(
		'version' => '6.1.0.0',
		'path'    => array( $baseDir . '/src' )
	),
	'Automattic\\Jetpack\\Autoloader\\' => array(
		'version' => '2.10.4.0',
		'path'    => array( $vendorDir . '/automattic/jetpack-autoloader/src' )
	),
);
woocommerce-blocks/vendor/composer/autoload_psr4.php000064400000000635151335517640016771 0ustar00<?php

// autoload_psr4.php @generated by Composer

$vendorDir = dirname(dirname(__FILE__));
$baseDir = dirname($vendorDir);

return array(
    'Composer\\Installers\\' => array($vendorDir . '/composer/installers/src/Composer/Installers'),
    'Automattic\\WooCommerce\\Blocks\\' => array($baseDir . '/src'),
    'Automattic\\Jetpack\\Autoloader\\' => array($vendorDir . '/automattic/jetpack-autoloader/src'),
);
woocommerce-blocks/vendor/composer/jetpack_autoload_classmap.php000064400000000563151335517640021405 0ustar00<?php

// This file `jetpack_autoload_classmap.php` was auto generated by automattic/jetpack-autoloader.

$vendorDir = dirname(__DIR__);
$baseDir   = dirname($vendorDir);

return array(
	'Automattic\\Jetpack\\Autoloader\\AutoloadGenerator' => array(
		'version' => '2.10.4.0',
		'path'    => $vendorDir . '/automattic/jetpack-autoloader/src/AutoloadGenerator.php'
	),
);
woocommerce-blocks/vendor/composer/ClassLoader.php000064400000034065151335517640016411 0ustar00<?php

/*
 * This file is part of Composer.
 *
 * (c) Nils Adermann <naderman@naderman.de>
 *     Jordi Boggiano <j.boggiano@seld.be>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Composer\Autoload;

/**
 * ClassLoader implements a PSR-0, PSR-4 and classmap class loader.
 *
 *     $loader = new \Composer\Autoload\ClassLoader();
 *
 *     // register classes with namespaces
 *     $loader->add('Symfony\Component', __DIR__.'/component');
 *     $loader->add('Symfony',           __DIR__.'/framework');
 *
 *     // activate the autoloader
 *     $loader->register();
 *
 *     // to enable searching the include path (eg. for PEAR packages)
 *     $loader->setUseIncludePath(true);
 *
 * In this example, if you try to use a class in the Symfony\Component
 * namespace or one of its children (Symfony\Component\Console for instance),
 * the autoloader will first look for the class under the component/
 * directory, and it will then fallback to the framework/ directory if not
 * found before giving up.
 *
 * This class is loosely based on the Symfony UniversalClassLoader.
 *
 * @author Fabien Potencier <fabien@symfony.com>
 * @author Jordi Boggiano <j.boggiano@seld.be>
 * @see    https://www.php-fig.org/psr/psr-0/
 * @see    https://www.php-fig.org/psr/psr-4/
 */
class ClassLoader
{
    private $vendorDir;

    // PSR-4
    private $prefixLengthsPsr4 = array();
    private $prefixDirsPsr4 = array();
    private $fallbackDirsPsr4 = array();

    // PSR-0
    private $prefixesPsr0 = array();
    private $fallbackDirsPsr0 = array();

    private $useIncludePath = false;
    private $classMap = array();
    private $classMapAuthoritative = false;
    private $missingClasses = array();
    private $apcuPrefix;

    private static $registeredLoaders = array();

    public function __construct($vendorDir = null)
    {
        $this->vendorDir = $vendorDir;
    }

    public function getPrefixes()
    {
        if (!empty($this->prefixesPsr0)) {
            return call_user_func_array('array_merge', array_values($this->prefixesPsr0));
        }

        return array();
    }

    public function getPrefixesPsr4()
    {
        return $this->prefixDirsPsr4;
    }

    public function getFallbackDirs()
    {
        return $this->fallbackDirsPsr0;
    }

    public function getFallbackDirsPsr4()
    {
        return $this->fallbackDirsPsr4;
    }

    public function getClassMap()
    {
        return $this->classMap;
    }

    /**
     * @param array $classMap Class to filename map
     */
    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 array|string $paths   The PSR-0 root directories
     * @param bool         $prepend Whether to prepend the directories
     */
    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 array|string $paths   The PSR-4 base directories
     * @param bool         $prepend Whether to prepend the directories
     *
     * @throws \InvalidArgumentException
     */
    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 array|string $paths  The PSR-0 base directories
     */
    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 array|string $paths  The PSR-4 base directories
     *
     * @throws \InvalidArgumentException
     */
    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
     */
    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
     */
    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
     */
    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
     */
    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.
     */
    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($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;
    }

    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;
    }
}

/**
 * Scope isolated include.
 *
 * Prevents access to $this/self from included files.
 */
function includeFile($file)
{
    include $file;
}
woocommerce-blocks/vendor/composer/installed.php000064400000003562151335517640016172 0ustar00<?php return array(
    'root' => array(
        'pretty_version' => 'dev-trunk',
        'version' => 'dev-trunk',
        'type' => 'wordpress-plugin',
        'install_path' => __DIR__ . '/../../',
        'aliases' => array(),
        'reference' => '8967acb720260debeb0b3991589cc3d3f1403d86',
        'name' => 'woocommerce/woocommerce-blocks',
        'dev' => false,
    ),
    'versions' => array(
        'automattic/jetpack-autoloader' => array(
            'pretty_version' => 'v2.10.4',
            'version' => '2.10.4.0',
            'type' => 'composer-plugin',
            'install_path' => __DIR__ . '/../automattic/jetpack-autoloader',
            'aliases' => array(),
            'reference' => '70cb300a7a215ae87c671f600f77093518f87bac',
            'dev_requirement' => false,
        ),
        'composer/installers' => array(
            'pretty_version' => 'v1.11.0',
            'version' => '1.11.0.0',
            'type' => 'composer-plugin',
            'install_path' => __DIR__ . '/./installers',
            'aliases' => array(),
            'reference' => 'ae03311f45dfe194412081526be2e003960df74b',
            'dev_requirement' => false,
        ),
        'roundcube/plugin-installer' => array(
            'dev_requirement' => false,
            'replaced' => array(
                0 => '*',
            ),
        ),
        'shama/baton' => array(
            'dev_requirement' => false,
            'replaced' => array(
                0 => '*',
            ),
        ),
        'woocommerce/woocommerce-blocks' => array(
            'pretty_version' => 'dev-trunk',
            'version' => 'dev-trunk',
            'type' => 'wordpress-plugin',
            'install_path' => __DIR__ . '/../../',
            'aliases' => array(),
            'reference' => '8967acb720260debeb0b3991589cc3d3f1403d86',
            'dev_requirement' => false,
        ),
    ),
);
woocommerce-blocks/vendor/composer/LICENSE000064400000002056151335517640014504 0ustar00
Copyright (c) Nils Adermann, Jordi Boggiano

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is furnished
to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

woocommerce-blocks/vendor/composer/autoload_static.php000064400000003215151335517640017365 0ustar00<?php

// autoload_static.php @generated by Composer

namespace Composer\Autoload;

class ComposerStaticInitb78ca910fe07339d6189615f1734a3e3
{
    public static $prefixLengthsPsr4 = array (
        'C' => 
        array (
            'Composer\\Installers\\' => 20,
        ),
        'A' => 
        array (
            'Automattic\\WooCommerce\\Blocks\\' => 30,
            'Automattic\\Jetpack\\Autoloader\\' => 30,
        ),
    );

    public static $prefixDirsPsr4 = array (
        'Composer\\Installers\\' => 
        array (
            0 => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers',
        ),
        'Automattic\\WooCommerce\\Blocks\\' => 
        array (
            0 => __DIR__ . '/../..' . '/src',
        ),
        'Automattic\\Jetpack\\Autoloader\\' => 
        array (
            0 => __DIR__ . '/..' . '/automattic/jetpack-autoloader/src',
        ),
    );

    public static $classMap = array (
        'Automattic\\Jetpack\\Autoloader\\AutoloadGenerator' => __DIR__ . '/..' . '/automattic/jetpack-autoloader/src/AutoloadGenerator.php',
        'Composer\\InstalledVersions' => __DIR__ . '/..' . '/composer/InstalledVersions.php',
    );

    public static function getInitializer(ClassLoader $loader)
    {
        return \Closure::bind(function () use ($loader) {
            $loader->prefixLengthsPsr4 = ComposerStaticInitb78ca910fe07339d6189615f1734a3e3::$prefixLengthsPsr4;
            $loader->prefixDirsPsr4 = ComposerStaticInitb78ca910fe07339d6189615f1734a3e3::$prefixDirsPsr4;
            $loader->classMap = ComposerStaticInitb78ca910fe07339d6189615f1734a3e3::$classMap;

        }, null, ClassLoader::class);
    }
}
woocommerce-blocks/vendor/automattic/jetpack-autoloader/src/class-path-processor.php000064400000012557151335517640025163 0ustar00<?php
/* HEADER */ // phpcs:ignore

/**
 * This class handles dealing with paths for the autoloader.
 */
class Path_Processor {
	/**
	 * Given a path this will replace any of the path constants with a token to represent it.
	 *
	 * @param string $path The path we want to process.
	 *
	 * @return string The tokenized path.
	 */
	public function tokenize_path_constants( $path ) {
		$path = wp_normalize_path( $path );

		$constants = $this->get_normalized_constants();
		foreach ( $constants as $constant => $constant_path ) {
			$len = strlen( $constant_path );
			if ( substr( $path, 0, $len ) !== $constant_path ) {
				continue;
			}

			return substr_replace( $path, '{{' . $constant . '}}', 0, $len );
		}

		return $path;
	}

	/**
	 * Given a path this will replace any of the path constant tokens with the expanded path.
	 *
	 * @param string $tokenized_path The path we want to process.
	 *
	 * @return string The expanded path.
	 */
	public function untokenize_path_constants( $tokenized_path ) {
		$tokenized_path = wp_normalize_path( $tokenized_path );

		$constants = $this->get_normalized_constants();
		foreach ( $constants as $constant => $constant_path ) {
			$constant = '{{' . $constant . '}}';

			$len = strlen( $constant );
			if ( substr( $tokenized_path, 0, $len ) !== $constant ) {
				continue;
			}

			return $this->get_real_path( substr_replace( $tokenized_path, $constant_path, 0, $len ) );
		}

		return $tokenized_path;
	}

	/**
	 * Given a file and an array of places it might be, this will find the absolute path and return it.
	 *
	 * @param string $file The plugin or theme file to resolve.
	 * @param array  $directories_to_check The directories we should check for the file if it isn't an absolute path.
	 *
	 * @return string|false Returns the absolute path to the directory, otherwise false.
	 */
	public function find_directory_with_autoloader( $file, $directories_to_check ) {
		$file = wp_normalize_path( $file );

		if ( ! $this->is_absolute_path( $file ) ) {
			$file = $this->find_absolute_plugin_path( $file, $directories_to_check );
			if ( ! isset( $file ) ) {
				return false;
			}
		}

		// We need the real path for consistency with __DIR__ paths.
		$file = $this->get_real_path( $file );

		// phpcs:disable WordPress.PHP.NoSilencedErrors.Discouraged
		$directory = @is_file( $file ) ? dirname( $file ) : $file;
		if ( ! @is_file( $directory . '/vendor/composer/jetpack_autoload_classmap.php' ) ) {
			return false;
		}
		// phpcs:enable WordPress.PHP.NoSilencedErrors.Discouraged

		return $directory;
	}

	/**
	 * Fetches an array of normalized paths keyed by the constant they came from.
	 *
	 * @return string[] The normalized paths keyed by the constant.
	 */
	private function get_normalized_constants() {
		$raw_constants = array(
			// Order the constants from most-specific to least-specific.
			'WP_PLUGIN_DIR',
			'WPMU_PLUGIN_DIR',
			'WP_CONTENT_DIR',
			'ABSPATH',
		);

		$constants = array();
		foreach ( $raw_constants as $raw ) {
			if ( ! defined( $raw ) ) {
				continue;
			}

			$path = wp_normalize_path( constant( $raw ) );
			if ( isset( $path ) ) {
				$constants[ $raw ] = $path;
			}
		}

		return $constants;
	}

	/**
	 * Indicates whether or not a path is absolute.
	 *
	 * @param string $path The path to check.
	 *
	 * @return bool True if the path is absolute, otherwise false.
	 */
	private function is_absolute_path( $path ) {
		if ( 0 === strlen( $path ) || '.' === $path[0] ) {
			return false;
		}

		// Absolute paths on Windows may begin with a drive letter.
		if ( preg_match( '/^[a-zA-Z]:[\/\\\\]/', $path ) ) {
			return true;
		}

		// A path starting with / or \ is absolute; anything else is relative.
		return ( '/' === $path[0] || '\\' === $path[0] );
	}

	/**
	 * Given a file and a list of directories to check, this method will try to figure out
	 * the absolute path to the file in question.
	 *
	 * @param string $normalized_path The normalized path to the plugin or theme file to resolve.
	 * @param array  $directories_to_check The directories we should check for the file if it isn't an absolute path.
	 *
	 * @return string|null The absolute path to the plugin file, otherwise null.
	 */
	private function find_absolute_plugin_path( $normalized_path, $directories_to_check ) {
		// We're only able to find the absolute path for plugin/theme PHP files.
		if ( ! is_string( $normalized_path ) || '.php' !== substr( $normalized_path, -4 ) ) {
			return null;
		}

		foreach ( $directories_to_check as $directory ) {
			$normalized_check = wp_normalize_path( trailingslashit( $directory ) ) . $normalized_path;
			// phpcs:ignore WordPress.PHP.NoSilencedErrors.Discouraged
			if ( @is_file( $normalized_check ) ) {
				return $normalized_check;
			}
		}

		return null;
	}

	/**
	 * Given a path this will figure out the real path that we should be using.
	 *
	 * @param string $path The path to resolve.
	 *
	 * @return string The resolved path.
	 */
	private function get_real_path( $path ) {
		// We want to resolve symbolic links for consistency with __DIR__ paths.
		// phpcs:ignore WordPress.PHP.NoSilencedErrors.Discouraged
		$real_path = @realpath( $path );
		if ( false === $real_path ) {
			// Let the autoloader deal with paths that don't exist.
			$real_path = $path;
		}

		// Using realpath will make it platform-specific so we must normalize it after.
		if ( $path !== $real_path ) {
			$real_path = wp_normalize_path( $real_path );
		}

		return $real_path;
	}
}
woocommerce-blocks/vendor/automattic/jetpack-autoloader/src/class-plugins-handler.php000064400000013071151335517640025276 0ustar00<?php
/* HEADER */ // phpcs:ignore

/**
 * This class handles locating and caching all of the active plugins.
 */
class Plugins_Handler {
	/**
	 * The transient key for plugin paths.
	 */
	const TRANSIENT_KEY = 'jetpack_autoloader_plugin_paths';

	/**
	 * The locator for finding plugins in different locations.
	 *
	 * @var Plugin_Locator
	 */
	private $plugin_locator;

	/**
	 * The processor for transforming cached paths.
	 *
	 * @var Path_Processor
	 */
	private $path_processor;

	/**
	 * The constructor.
	 *
	 * @param Plugin_Locator $plugin_locator The locator for finding active plugins.
	 * @param Path_Processor $path_processor The processor for transforming cached paths.
	 */
	public function __construct( $plugin_locator, $path_processor ) {
		$this->plugin_locator = $plugin_locator;
		$this->path_processor = $path_processor;
	}

	/**
	 * Gets all of the active plugins we can find.
	 *
	 * @param bool $include_deactivating When true, plugins deactivating this request will be considered active.
	 * @param bool $record_unknown When true, the current plugin will be marked as active and recorded when unknown.
	 *
	 * @return string[]
	 */
	public function get_active_plugins( $include_deactivating, $record_unknown ) {
		global $jetpack_autoloader_activating_plugins_paths;

		// We're going to build a unique list of plugins from a few different sources
		// to find all of our "active" plugins. While we need to return an integer
		// array, we're going to use an associative array internally to reduce
		// the amount of time that we're going to spend checking uniqueness
		// and merging different arrays together to form the output.
		$active_plugins = array();

		// Make sure that plugins which have activated this request are considered as "active" even though
		// they probably won't be present in any option.
		if ( is_array( $jetpack_autoloader_activating_plugins_paths ) ) {
			foreach ( $jetpack_autoloader_activating_plugins_paths as $path ) {
				$active_plugins[ $path ] = $path;
			}
		}

		// This option contains all of the plugins that have been activated.
		$plugins = $this->plugin_locator->find_using_option( 'active_plugins' );
		foreach ( $plugins as $path ) {
			$active_plugins[ $path ] = $path;
		}

		// This option contains all of the multisite plugins that have been activated.
		if ( is_multisite() ) {
			$plugins = $this->plugin_locator->find_using_option( 'active_sitewide_plugins', true );
			foreach ( $plugins as $path ) {
				$active_plugins[ $path ] = $path;
			}
		}

		// These actions contain plugins that are being activated/deactivated during this request.
		$plugins = $this->plugin_locator->find_using_request_action( array( 'activate', 'activate-selected', 'deactivate', 'deactivate-selected' ) );
		foreach ( $plugins as $path ) {
			$active_plugins[ $path ] = $path;
		}

		// When the current plugin isn't considered "active" there's a problem.
		// Since we're here, the plugin is active and currently being loaded.
		// We can support this case (mu-plugins and non-standard activation)
		// by adding the current plugin to the active list and marking it
		// as an unknown (activating) plugin. This also has the benefit
		// of causing a reset because the active plugins list has
		// been changed since it was saved in the global.
		$current_plugin = $this->plugin_locator->find_current_plugin();
		if ( $record_unknown && ! in_array( $current_plugin, $active_plugins, true ) ) {
			$active_plugins[ $current_plugin ]             = $current_plugin;
			$jetpack_autoloader_activating_plugins_paths[] = $current_plugin;
		}

		// When deactivating plugins aren't desired we should entirely remove them from the active list.
		if ( ! $include_deactivating ) {
			// These actions contain plugins that are being deactivated during this request.
			$plugins = $this->plugin_locator->find_using_request_action( array( 'deactivate', 'deactivate-selected' ) );
			foreach ( $plugins as $path ) {
				unset( $active_plugins[ $path ] );
			}
		}

		// Transform the array so that we don't have to worry about the keys interacting with other array types later.
		return array_values( $active_plugins );
	}

	/**
	 * Gets all of the cached plugins if there are any.
	 *
	 * @return string[]
	 */
	public function get_cached_plugins() {
		$cached = get_transient( self::TRANSIENT_KEY );
		if ( ! is_array( $cached ) || empty( $cached ) ) {
			return array();
		}

		// We need to expand the tokens to an absolute path for this webserver.
		return array_map( array( $this->path_processor, 'untokenize_path_constants' ), $cached );
	}

	/**
	 * Saves the plugin list to the cache.
	 *
	 * @param array $plugins The plugin list to save to the cache.
	 */
	public function cache_plugins( $plugins ) {
		// We store the paths in a tokenized form so that that webservers with different absolute paths don't break.
		$plugins = array_map( array( $this->path_processor, 'tokenize_path_constants' ), $plugins );

		set_transient( self::TRANSIENT_KEY, $plugins );
	}

	/**
	 * Checks to see whether or not the plugin list given has changed when compared to the
	 * shared `$jetpack_autoloader_cached_plugin_paths` global. This allows us to deal
	 * with cases where the active list may change due to filtering..
	 *
	 * @param string[] $plugins The plugins list to check against the global cache.
	 *
	 * @return bool True if the plugins have changed, otherwise false.
	 */
	public function have_plugins_changed( $plugins ) {
		global $jetpack_autoloader_cached_plugin_paths;

		if ( $jetpack_autoloader_cached_plugin_paths !== $plugins ) {
			$jetpack_autoloader_cached_plugin_paths = $plugins;
			return true;
		}

		return false;
	}
}
woocommerce-blocks/vendor/automattic/jetpack-autoloader/src/class-shutdown-handler.php000064400000005203151335517640025466 0ustar00<?php
/* HEADER */ // phpcs:ignore

/**
 * This class handles the shutdown of the autoloader.
 */
class Shutdown_Handler {

	/**
	 * The Plugins_Handler instance.
	 *
	 * @var Plugins_Handler
	 */
	private $plugins_handler;

	/**
	 * The plugins cached by this autoloader.
	 *
	 * @var string[]
	 */
	private $cached_plugins;

	/**
	 * Indicates whether or not this autoloader was included by another.
	 *
	 * @var bool
	 */
	private $was_included_by_autoloader;

	/**
	 * Constructor.
	 *
	 * @param Plugins_Handler $plugins_handler The Plugins_Handler instance to use.
	 * @param string[]        $cached_plugins The plugins cached by the autoloaer.
	 * @param bool            $was_included_by_autoloader Indicates whether or not the autoloader was included by another.
	 */
	public function __construct( $plugins_handler, $cached_plugins, $was_included_by_autoloader ) {
		$this->plugins_handler            = $plugins_handler;
		$this->cached_plugins             = $cached_plugins;
		$this->was_included_by_autoloader = $was_included_by_autoloader;
	}

	/**
	 * Handles the shutdown of the autoloader.
	 */
	public function __invoke() {
		// Don't save a broken cache if an error happens during some plugin's initialization.
		if ( ! did_action( 'plugins_loaded' ) ) {
			// Ensure that the cache is emptied to prevent consecutive failures if the cache is to blame.
			if ( ! empty( $this->cached_plugins ) ) {
				$this->plugins_handler->cache_plugins( array() );
			}

			return;
		}

		// Load the active plugins fresh since the list we pulled earlier might not contain
		// plugins that were activated but did not reset the autoloader. This happens
		// when a plugin is in the cache but not "active" when the autoloader loads.
		// We also want to make sure that plugins which are deactivating are not
		// considered "active" so that they will be removed from the cache now.
		try {
			$active_plugins = $this->plugins_handler->get_active_plugins( false, ! $this->was_included_by_autoloader );
		} catch ( \Exception $ex ) {
			// When the package is deleted before shutdown it will throw an exception.
			// In the event this happens we should erase the cache.
			if ( ! empty( $this->cached_plugins ) ) {
				$this->plugins_handler->cache_plugins( array() );
			}
			return;
		}

		// The paths should be sorted for easy comparisons with those loaded from the cache.
		// Note we don't need to sort the cached entries because they're already sorted.
		sort( $active_plugins );

		// We don't want to waste time saving a cache that hasn't changed.
		if ( $this->cached_plugins === $active_plugins ) {
			return;
		}

		$this->plugins_handler->cache_plugins( $active_plugins );
	}
}
woocommerce-blocks/vendor/automattic/jetpack-autoloader/src/ManifestGenerator.php000064400000007132151335517640024515 0ustar00<?php // phpcs:ignore WordPress.Files.FileName
/**
 * Manifest Generator.
 *
 * @package automattic/jetpack-autoloader
 */

// phpcs:disable WordPress.Files.FileName.InvalidClassFileName
// phpcs:disable WordPress.NamingConventions.ValidFunctionName.MethodNameInvalid
// phpcs:disable WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase
// phpcs:disable WordPress.NamingConventions.ValidVariableName.InterpolatedVariableNotSnakeCase
// phpcs:disable WordPress.NamingConventions.ValidVariableName.VariableNotSnakeCase
// phpcs:disable WordPress.NamingConventions.ValidVariableName.PropertyNotSnakeCase
// phpcs:disable WordPress.PHP.DevelopmentFunctions.error_log_var_export

namespace Automattic\Jetpack\Autoloader;

/**
 * Class ManifestGenerator.
 */
class ManifestGenerator {

	/**
	 * Builds a manifest file for the given autoloader type.
	 *
	 * @param string $autoloaderType The type of autoloader to build a manifest for.
	 * @param string $fileName The filename of the manifest.
	 * @param array  $content The manifest content to generate using.
	 *
	 * @return string|null $manifestFile
	 * @throws \InvalidArgumentException When an invalid autoloader type is given.
	 */
	public static function buildManifest( $autoloaderType, $fileName, $content ) {
		if ( empty( $content ) ) {
			return null;
		}

		switch ( $autoloaderType ) {
			case 'classmap':
			case 'files':
				return self::buildStandardManifest( $fileName, $content );
			case 'psr-4':
				return self::buildPsr4Manifest( $fileName, $content );
		}

		throw new \InvalidArgumentException( 'An invalid manifest type of ' . $autoloaderType . ' was passed!' );
	}

	/**
	 * Builds the contents for the standard manifest file.
	 *
	 * @param string $fileName The filename we are building.
	 * @param array  $manifestData The formatted data for the manifest.
	 *
	 * @return string|null $manifestFile
	 */
	private static function buildStandardManifest( $fileName, $manifestData ) {
		$fileContent = PHP_EOL;
		foreach ( $manifestData as $key => $data ) {
			$key          = var_export( $key, true );
			$versionCode  = var_export( $data['version'], true );
			$fileContent .= <<<MANIFEST_CODE
	$key => array(
		'version' => $versionCode,
		'path'    => {$data['path']}
	),
MANIFEST_CODE;
			$fileContent .= PHP_EOL;
		}

		return self::buildFile( $fileName, $fileContent );
	}

	/**
	 * Builds the contents for the PSR-4 manifest file.
	 *
	 * @param string $fileName The filename we are building.
	 * @param array  $namespaces The formatted PSR-4 data for the manifest.
	 *
	 * @return string|null $manifestFile
	 */
	private static function buildPsr4Manifest( $fileName, $namespaces ) {
		$fileContent = PHP_EOL;
		foreach ( $namespaces as $namespace => $data ) {
			$namespaceCode = var_export( $namespace, true );
			$versionCode   = var_export( $data['version'], true );
			$pathCode      = 'array( ' . implode( ', ', $data['path'] ) . ' )';
			$fileContent  .= <<<MANIFEST_CODE
	$namespaceCode => array(
		'version' => $versionCode,
		'path'    => $pathCode
	),
MANIFEST_CODE;
			$fileContent  .= PHP_EOL;
		}

		return self::buildFile( $fileName, $fileContent );
	}

	/**
	 * Generate the PHP that will be used in the file.
	 *
	 * @param string $fileName The filename we are building.
	 * @param string $content The content to be written into the file.
	 *
	 * @return string $fileContent
	 */
	private static function buildFile( $fileName, $content ) {
		return <<<INCLUDE_FILE
<?php

// This file `$fileName` was auto generated by automattic/jetpack-autoloader.

\$vendorDir = dirname(__DIR__);
\$baseDir   = dirname(\$vendorDir);

return array($content);

INCLUDE_FILE;
	}
}
woocommerce-blocks/vendor/automattic/jetpack-autoloader/src/class-version-loader.php000064400000007664151335517640025146 0ustar00<?php
/* HEADER */ // phpcs:ignore

/**
 * This class loads other classes based on given parameters.
 */
class Version_Loader {

	/**
	 * The Version_Selector object.
	 *
	 * @var Version_Selector
	 */
	private $version_selector;

	/**
	 * A map of available classes and their version and file path.
	 *
	 * @var array
	 */
	private $classmap;

	/**
	 * A map of PSR-4 namespaces and their version and directory path.
	 *
	 * @var array
	 */
	private $psr4_map;

	/**
	 * A map of all the files that we should load.
	 *
	 * @var array
	 */
	private $filemap;

	/**
	 * The constructor.
	 *
	 * @param Version_Selector $version_selector The Version_Selector object.
	 * @param array            $classmap The verioned classmap to load using.
	 * @param array            $psr4_map The versioned PSR-4 map to load using.
	 * @param array            $filemap The versioned filemap to load.
	 */
	public function __construct( $version_selector, $classmap, $psr4_map, $filemap ) {
		$this->version_selector = $version_selector;
		$this->classmap         = $classmap;
		$this->psr4_map         = $psr4_map;
		$this->filemap          = $filemap;
	}

	/**
	 * Finds the file path for the given class.
	 *
	 * @param string $class_name The class to find.
	 *
	 * @return string|null $file_path The path to the file if found, null if no class was found.
	 */
	public function find_class_file( $class_name ) {
		$data = $this->select_newest_file(
			isset( $this->classmap[ $class_name ] ) ? $this->classmap[ $class_name ] : null,
			$this->find_psr4_file( $class_name )
		);
		if ( ! isset( $data ) ) {
			return null;
		}

		return $data['path'];
	}

	/**
	 * Load all of the files in the filemap.
	 */
	public function load_filemap() {
		if ( empty( $this->filemap ) ) {
			return;
		}

		foreach ( $this->filemap as $file_identifier => $file_data ) {
			if ( empty( $GLOBALS['__composer_autoload_files'][ $file_identifier ] ) ) {
				require_once $file_data['path'];

				$GLOBALS['__composer_autoload_files'][ $file_identifier ] = true;
			}
		}
	}

	/**
	 * Compares different class sources and returns the newest.
	 *
	 * @param array|null $classmap_data The classmap class data.
	 * @param array|null $psr4_data The PSR-4 class data.
	 *
	 * @return array|null $data
	 */
	private function select_newest_file( $classmap_data, $psr4_data ) {
		if ( ! isset( $classmap_data ) ) {
			return $psr4_data;
		} elseif ( ! isset( $psr4_data ) ) {
			return $classmap_data;
		}

		if ( $this->version_selector->is_version_update_required( $classmap_data['version'], $psr4_data['version'] ) ) {
			return $psr4_data;
		}

		return $classmap_data;
	}

	/**
	 * Finds the file for a given class in a PSR-4 namespace.
	 *
	 * @param string $class_name The class to find.
	 *
	 * @return array|null $data The version and path path to the file if found, null otherwise.
	 */
	private function find_psr4_file( $class_name ) {
		if ( ! isset( $this->psr4_map ) ) {
			return null;
		}

		// Don't bother with classes that have no namespace.
		$class_index = strrpos( $class_name, '\\' );
		if ( ! $class_index ) {
			return null;
		}
		$class_for_path = str_replace( '\\', '/', $class_name );

		// Search for the namespace by iteratively cutting off the last segment until
		// we find a match. This allows us to check the most-specific namespaces
		// first as well as minimize the amount of time spent looking.
		for (
			$class_namespace = substr( $class_name, 0, $class_index );
			! empty( $class_namespace );
			$class_namespace = substr( $class_namespace, 0, strrpos( $class_namespace, '\\' ) )
		) {
			$namespace = $class_namespace . '\\';
			if ( ! isset( $this->psr4_map[ $namespace ] ) ) {
				continue;
			}
			$data = $this->psr4_map[ $namespace ];

			foreach ( $data['path'] as $path ) {
				$path .= '/' . substr( $class_for_path, strlen( $namespace ) ) . '.php';
				if ( file_exists( $path ) ) {
					return array(
						'version' => $data['version'],
						'path'    => $path,
					);
				}
			}
		}

		return null;
	}
}
woocommerce-blocks/vendor/automattic/jetpack-autoloader/src/CustomAutoloaderPlugin.php000064400000014057151335517640025555 0ustar00<?php //phpcs:ignore WordPress.Files.FileName.NotHyphenatedLowercase
/**
 * Custom Autoloader Composer Plugin, hooks into composer events to generate the custom autoloader.
 *
 * @package automattic/jetpack-autoloader
 */

// phpcs:disable PHPCompatibility.Keywords.NewKeywords.t_useFound
// phpcs:disable PHPCompatibility.LanguageConstructs.NewLanguageConstructs.t_ns_separatorFound
// phpcs:disable PHPCompatibility.Keywords.NewKeywords.t_namespaceFound
// phpcs:disable WordPress.Files.FileName.NotHyphenatedLowercase
// phpcs:disable WordPress.Files.FileName.InvalidClassFileName
// phpcs:disable WordPress.NamingConventions.ValidVariableName.VariableNotSnakeCase

namespace Automattic\Jetpack\Autoloader;

use Composer\Composer;
use Composer\EventDispatcher\EventSubscriberInterface;
use Composer\IO\IOInterface;
use Composer\Plugin\PluginInterface;
use Composer\Script\Event;
use Composer\Script\ScriptEvents;

/**
 * Class CustomAutoloaderPlugin.
 *
 * @package automattic/jetpack-autoloader
 */
class CustomAutoloaderPlugin implements PluginInterface, EventSubscriberInterface {

	/**
	 * IO object.
	 *
	 * @var IOInterface IO object.
	 */
	private $io;

	/**
	 * Composer object.
	 *
	 * @var Composer Composer object.
	 */
	private $composer;

	/**
	 * Do nothing.
	 *
	 * @param Composer    $composer Composer object.
	 * @param IOInterface $io IO object.
	 */
	public function activate( Composer $composer, IOInterface $io ) { // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable
		$this->composer = $composer;
		$this->io       = $io;
	}

	/**
	 * Do nothing.
	 * phpcs:disable VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable
	 *
	 * @param Composer    $composer Composer object.
	 * @param IOInterface $io IO object.
	 */
	public function deactivate( Composer $composer, IOInterface $io ) {
		/*
		 * Intentionally left empty. This is a PluginInterface method.
		 * phpcs:enable VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable
		 */
	}

	/**
	 * Do nothing.
	 * phpcs:disable VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable
	 *
	 * @param Composer    $composer Composer object.
	 * @param IOInterface $io IO object.
	 */
	public function uninstall( Composer $composer, IOInterface $io ) {
		/*
		 * Intentionally left empty. This is a PluginInterface method.
		 * phpcs:enable VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable
		 */
	}

	/**
	 * Tell composer to listen for events and do something with them.
	 *
	 * @return array List of subscribed events.
	 */
	public static function getSubscribedEvents() {
		return array(
			ScriptEvents::POST_AUTOLOAD_DUMP => 'postAutoloadDump',
		);
	}

	/**
	 * Generate the custom autolaoder.
	 *
	 * @param Event $event Script event object.
	 */
	public function postAutoloadDump( Event $event ) {
		// When the autoloader is not required by the root package we don't want to execute it.
		// This prevents unwanted transitive execution that generates unused autoloaders or
		// at worst throws fatal executions.
		if ( ! $this->isRequiredByRoot() ) {
			return;
		}

		$config = $this->composer->getConfig();

		if ( 'vendor' !== $config->raw()['config']['vendor-dir'] ) {
			$this->io->writeError( "\n<error>An error occurred while generating the autoloader files:", true );
			$this->io->writeError( 'The project\'s composer.json or composer environment set a non-default vendor directory.', true );
			$this->io->writeError( 'The default composer vendor directory must be used.</error>', true );
			exit();
		}

		$installationManager = $this->composer->getInstallationManager();
		$repoManager         = $this->composer->getRepositoryManager();
		$localRepo           = $repoManager->getLocalRepository();
		$package             = $this->composer->getPackage();
		$optimize            = $event->getFlags()['optimize'];
		$suffix              = $this->determineSuffix();

		$generator = new AutoloadGenerator( $this->io );
		$generator->dump( $this->composer, $config, $localRepo, $package, $installationManager, 'composer', $optimize, $suffix );
		$this->generated = true;
	}

	/**
	 * Determine the suffix for the autoloader class.
	 *
	 * Reuses an existing suffix from vendor/autoload_packages.php or vendor/autoload.php if possible.
	 *
	 * @return string Suffix.
	 */
	private function determineSuffix() {
		$config     = $this->composer->getConfig();
		$vendorPath = $config->get( 'vendor-dir' );

		// Command line.
		$suffix = $config->get( 'autoloader-suffix' );
		if ( $suffix ) {
			return $suffix;
		}

		// Reuse our own suffix, if any.
		if ( is_readable( $vendorPath . '/autoload_packages.php' ) ) {
			// phpcs:ignore WordPress.WP.AlternativeFunctions.file_get_contents_file_get_contents
			$content = file_get_contents( $vendorPath . '/autoload_packages.php' );
			if ( preg_match( '/^namespace Automattic\\\\Jetpack\\\\Autoloader\\\\jp([^;\s]+);/m', $content, $match ) ) {
				return $match[1];
			}
		}

		// Reuse Composer's suffix, if any.
		if ( is_readable( $vendorPath . '/autoload.php' ) ) {
			// phpcs:ignore WordPress.WP.AlternativeFunctions.file_get_contents_file_get_contents
			$content = file_get_contents( $vendorPath . '/autoload.php' );
			if ( preg_match( '{ComposerAutoloaderInit([^:\s]+)::}', $content, $match ) ) {
				return $match[1];
			}
		}

		// Generate a random suffix.
		return md5( uniqid( '', true ) );
	}

	/**
	 * Checks to see whether or not the root package is the one that required the autoloader.
	 *
	 * @return bool
	 */
	private function isRequiredByRoot() {
		$package  = $this->composer->getPackage();
		$requires = $package->getRequires();
		if ( ! is_array( $requires ) ) {
			$requires = array();
		}
		$devRequires = $package->getDevRequires();
		if ( ! is_array( $devRequires ) ) {
			$devRequires = array();
		}
		$requires = array_merge( $requires, $devRequires );

		if ( empty( $requires ) ) {
			$this->io->writeError( "\n<error>The package is not required and this should never happen?</error>", true );
			exit();
		}

		foreach ( $requires as $require ) {
			if ( 'automattic/jetpack-autoloader' === $require->getTarget() ) {
				return true;
			}
		}

		return false;
	}
}
woocommerce-blocks/vendor/automattic/jetpack-autoloader/src/class-latest-autoloader-guard.php000064400000005062151335517640026734 0ustar00<?php
/* HEADER */ // phpcs:ignore

/**
 * This class ensures that we're only executing the latest autoloader.
 */
class Latest_Autoloader_Guard {

	/**
	 * The Plugins_Handler instance.
	 *
	 * @var Plugins_Handler
	 */
	private $plugins_handler;

	/**
	 * The Autoloader_Handler instance.
	 *
	 * @var Autoloader_Handler
	 */
	private $autoloader_handler;

	/**
	 * The Autoloader_locator instance.
	 *
	 * @var Autoloader_Locator
	 */
	private $autoloader_locator;

	/**
	 * The constructor.
	 *
	 * @param Plugins_Handler    $plugins_handler    The Plugins_Handler instance.
	 * @param Autoloader_Handler $autoloader_handler The Autoloader_Handler instance.
	 * @param Autoloader_Locator $autoloader_locator The Autoloader_Locator instance.
	 */
	public function __construct( $plugins_handler, $autoloader_handler, $autoloader_locator ) {
		$this->plugins_handler    = $plugins_handler;
		$this->autoloader_handler = $autoloader_handler;
		$this->autoloader_locator = $autoloader_locator;
	}

	/**
	 * Indicates whether or not the autoloader should be initialized. Note that this function
	 * has the side-effect of actually loading the latest autoloader in the event that this
	 * is not it.
	 *
	 * @param string   $current_plugin             The current plugin we're checking.
	 * @param string[] $plugins                    The active plugins to check for autoloaders in.
	 * @param bool     $was_included_by_autoloader Indicates whether or not this autoloader was included by another.
	 *
	 * @return bool True if we should stop initialization, otherwise false.
	 */
	public function should_stop_init( $current_plugin, $plugins, $was_included_by_autoloader ) {
		global $jetpack_autoloader_latest_version;

		// We need to reset the autoloader when the plugins change because
		// that means the autoloader was generated with a different list.
		if ( $this->plugins_handler->have_plugins_changed( $plugins ) ) {
			$this->autoloader_handler->reset_autoloader();
		}

		// When the latest autoloader has already been found we don't need to search for it again.
		// We should take care however because this will also trigger if the autoloader has been
		// included by an older one.
		if ( isset( $jetpack_autoloader_latest_version ) && ! $was_included_by_autoloader ) {
			return true;
		}

		$latest_plugin = $this->autoloader_locator->find_latest_autoloader( $plugins, $jetpack_autoloader_latest_version );
		if ( isset( $latest_plugin ) && $latest_plugin !== $current_plugin ) {
			require $this->autoloader_locator->get_autoloader_path( $latest_plugin );
			return true;
		}

		return false;
	}
}
woocommerce-blocks/vendor/automattic/jetpack-autoloader/src/class-container.php000064400000011157151335517640024167 0ustar00<?php
/* HEADER */ // phpcs:ignore

/**
 * This class manages the files and dependencies of the autoloader.
 */
class Container {

	/**
	 * Since each autoloader's class files exist within their own namespace we need a map to
	 * convert between the local class and a shared key. Note that no version checking is
	 * performed on these dependencies and the first autoloader to register will be the
	 * one that is utilized.
	 */
	const SHARED_DEPENDENCY_KEYS = array(
		Hook_Manager::class => 'Hook_Manager',
	);

	/**
	 * A map of all the dependencies we've registered with the container and created.
	 *
	 * @var array
	 */
	protected $dependencies;

	/**
	 * The constructor.
	 */
	public function __construct() {
		$this->dependencies = array();

		$this->register_shared_dependencies();
		$this->register_dependencies();
		$this->initialize_globals();
	}

	/**
	 * Gets a dependency out of the container.
	 *
	 * @param string $class The class to fetch.
	 *
	 * @return mixed
	 * @throws \InvalidArgumentException When a class that isn't registered with the container is fetched.
	 */
	public function get( $class ) {
		if ( ! isset( $this->dependencies[ $class ] ) ) {
			throw new \InvalidArgumentException( "Class '$class' is not registered with the container." );
		}

		return $this->dependencies[ $class ];
	}

	/**
	 * Registers all of the dependencies that are shared between all instances of the autoloader.
	 */
	private function register_shared_dependencies() {
		global $jetpack_autoloader_container_shared;
		if ( ! isset( $jetpack_autoloader_container_shared ) ) {
			$jetpack_autoloader_container_shared = array();
		}

		$key = self::SHARED_DEPENDENCY_KEYS[ Hook_Manager::class ];
		if ( ! isset( $jetpack_autoloader_container_shared[ $key ] ) ) {
			require_once __DIR__ . '/class-hook-manager.php';
			$jetpack_autoloader_container_shared[ $key ] = new Hook_Manager();
		}
		$this->dependencies[ Hook_Manager::class ] = &$jetpack_autoloader_container_shared[ $key ];
	}

	/**
	 * Registers all of the dependencies with the container.
	 */
	private function register_dependencies() {
		require_once __DIR__ . '/class-path-processor.php';
		$this->dependencies[ Path_Processor::class ] = new Path_Processor();

		require_once __DIR__ . '/class-plugin-locator.php';
		$this->dependencies[ Plugin_Locator::class ] = new Plugin_Locator(
			$this->get( Path_Processor::class )
		);

		require_once __DIR__ . '/class-version-selector.php';
		$this->dependencies[ Version_Selector::class ] = new Version_Selector();

		require_once __DIR__ . '/class-autoloader-locator.php';
		$this->dependencies[ Autoloader_Locator::class ] = new Autoloader_Locator(
			$this->get( Version_Selector::class )
		);

		require_once __DIR__ . '/class-php-autoloader.php';
		$this->dependencies[ PHP_Autoloader::class ] = new PHP_Autoloader();

		require_once __DIR__ . '/class-manifest-reader.php';
		$this->dependencies[ Manifest_Reader::class ] = new Manifest_Reader(
			$this->get( Version_Selector::class )
		);

		require_once __DIR__ . '/class-plugins-handler.php';
		$this->dependencies[ Plugins_Handler::class ] = new Plugins_Handler(
			$this->get( Plugin_Locator::class ),
			$this->get( Path_Processor::class )
		);

		require_once __DIR__ . '/class-autoloader-handler.php';
		$this->dependencies[ Autoloader_Handler::class ] = new Autoloader_Handler(
			$this->get( PHP_Autoloader::class ),
			$this->get( Hook_Manager::class ),
			$this->get( Manifest_Reader::class ),
			$this->get( Version_Selector::class )
		);

		require_once __DIR__ . '/class-latest-autoloader-guard.php';
		$this->dependencies[ Latest_Autoloader_Guard::class ] = new Latest_Autoloader_Guard(
			$this->get( Plugins_Handler::class ),
			$this->get( Autoloader_Handler::class ),
			$this->get( Autoloader_Locator::class )
		);

		// Register any classes that we will use elsewhere.
		require_once __DIR__ . '/class-version-loader.php';
		require_once __DIR__ . '/class-shutdown-handler.php';
	}

	/**
	 * Initializes any of the globals needed by the autoloader.
	 */
	private function initialize_globals() {
		/*
		 * This global was retired in version 2.9. The value is set to 'false' to maintain
		 * compatibility with older versions of the autoloader.
		 */
		global $jetpack_autoloader_including_latest;
		$jetpack_autoloader_including_latest = false;

		// Not all plugins can be found using the locator. In cases where a plugin loads the autoloader
		// but was not discoverable, we will record them in this array to track them as "active".
		global $jetpack_autoloader_activating_plugins_paths;
		if ( ! isset( $jetpack_autoloader_activating_plugins_paths ) ) {
			$jetpack_autoloader_activating_plugins_paths = array();
		}
	}
}
woocommerce-blocks/vendor/automattic/jetpack-autoloader/src/class-plugin-locator.php000064400000010174151335517640025142 0ustar00<?php
/* HEADER */ // phpcs:ignore

/**
 * This class scans the WordPress installation to find active plugins.
 */
class Plugin_Locator {

	/**
	 * The path processor for finding plugin paths.
	 *
	 * @var Path_Processor
	 */
	private $path_processor;

	/**
	 * The constructor.
	 *
	 * @param Path_Processor $path_processor The Path_Processor instance.
	 */
	public function __construct( $path_processor ) {
		$this->path_processor = $path_processor;
	}

	/**
	 * Finds the path to the current plugin.
	 *
	 * @return string $path The path to the current plugin.
	 *
	 * @throws \RuntimeException If the current plugin does not have an autoloader.
	 */
	public function find_current_plugin() {
		// Escape from `vendor/__DIR__` to root plugin directory.
		$plugin_directory = dirname( dirname( __DIR__ ) );

		// Use the path processor to ensure that this is an autoloader we're referencing.
		$path = $this->path_processor->find_directory_with_autoloader( $plugin_directory, array() );
		if ( false === $path ) {
			throw new \RuntimeException( 'Failed to locate plugin ' . $plugin_directory );
		}

		return $path;
	}

	/**
	 * Checks a given option for plugin paths.
	 *
	 * @param string $option_name  The option that we want to check for plugin information.
	 * @param bool   $site_option  Indicates whether or not we want to check the site option.
	 *
	 * @return array $plugin_paths The list of absolute paths we've found.
	 */
	public function find_using_option( $option_name, $site_option = false ) {
		$raw = $site_option ? get_site_option( $option_name ) : get_option( $option_name );
		if ( false === $raw ) {
			return array();
		}

		return $this->convert_plugins_to_paths( $raw );
	}

	/**
	 * Checks for plugins in the `action` request parameter.
	 *
	 * @param string[] $allowed_actions The actions that we're allowed to return plugins for.
	 *
	 * @return array $plugin_paths The list of absolute paths we've found.
	 */
	public function find_using_request_action( $allowed_actions ) {
		// phpcs:disable WordPress.Security.NonceVerification.Recommended

		/**
		 * Note: we're not actually checking the nonce here because it's too early
		 * in the execution. The pluggable functions are not yet loaded to give
		 * plugins a chance to plug their versions. Therefore we're doing the bare
		 * minimum: checking whether the nonce exists and it's in the right place.
		 * The request will fail later if the nonce doesn't pass the check.
		 */
		if ( empty( $_REQUEST['_wpnonce'] ) ) {
			return array();
		}

		$action = isset( $_REQUEST['action'] ) ? wp_unslash( $_REQUEST['action'] ) : false;
		if ( ! in_array( $action, $allowed_actions, true ) ) {
			return array();
		}

		$plugin_slugs = array();
		switch ( $action ) {
			case 'activate':
			case 'deactivate':
				if ( empty( $_REQUEST['plugin'] ) ) {
					break;
				}

				$plugin_slugs[] = wp_unslash( $_REQUEST['plugin'] );
				break;

			case 'activate-selected':
			case 'deactivate-selected':
				if ( empty( $_REQUEST['checked'] ) ) {
					break;
				}

				$plugin_slugs = wp_unslash( $_REQUEST['checked'] );
				break;
		}

		// phpcs:enable WordPress.Security.NonceVerification.Recommended
		return $this->convert_plugins_to_paths( $plugin_slugs );
	}

	/**
	 * Given an array of plugin slugs or paths, this will convert them to absolute paths and filter
	 * out the plugins that are not directory plugins. Note that array keys will also be included
	 * if they are plugin paths!
	 *
	 * @param string[] $plugins Plugin paths or slugs to filter.
	 *
	 * @return string[]
	 */
	private function convert_plugins_to_paths( $plugins ) {
		if ( ! is_array( $plugins ) || empty( $plugins ) ) {
			return array();
		}

		// We're going to look for plugins in the standard directories.
		$path_constants = array( WP_PLUGIN_DIR, WPMU_PLUGIN_DIR );

		$plugin_paths = array();
		foreach ( $plugins as $key => $value ) {
			$path = $this->path_processor->find_directory_with_autoloader( $key, $path_constants );
			if ( $path ) {
				$plugin_paths[] = $path;
			}

			$path = $this->path_processor->find_directory_with_autoloader( $value, $path_constants );
			if ( $path ) {
				$plugin_paths[] = $path;
			}
		}

		return $plugin_paths;
	}
}
woocommerce-blocks/vendor/automattic/jetpack-autoloader/src/autoload.php000064400000000173151335517640022706 0ustar00<?php
/* HEADER */ // phpcs:ignore

require_once __DIR__ . '/jetpack-autoloader/class-autoloader.php';
Autoloader::init();
woocommerce-blocks/vendor/automattic/jetpack-autoloader/src/AutoloadFileWriter.php000064400000006211151335517640024642 0ustar00<?php // phpcs:ignore WordPress.Files.FileName
/**
 * Autoloader file writer.
 *
 * @package automattic/jetpack-autoloader
 */

// phpcs:disable WordPress.Files.FileName.InvalidClassFileName
// phpcs:disable WordPress.NamingConventions.ValidFunctionName.MethodNameInvalid
// phpcs:disable WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase
// phpcs:disable WordPress.NamingConventions.ValidVariableName.InterpolatedVariableNotSnakeCase
// phpcs:disable WordPress.NamingConventions.ValidVariableName.VariableNotSnakeCase
// phpcs:disable WordPress.NamingConventions.ValidVariableName.PropertyNotSnakeCase
// phpcs:disable WordPress.PHP.DevelopmentFunctions.error_log_var_export
// phpcs:disable WordPress.WP.AlternativeFunctions.file_system_read_file_put_contents
// phpcs:disable WordPress.WP.AlternativeFunctions.file_system_read_fopen
// phpcs:disable WordPress.WP.AlternativeFunctions.file_system_read_fwrite

namespace Automattic\Jetpack\Autoloader;

/**
 * Class AutoloadFileWriter.
 */
class AutoloadFileWriter {

	/**
	 * The file comment to use.
	 */
	const COMMENT = <<<AUTOLOADER_COMMENT
/**
 * This file was automatically generated by automattic/jetpack-autoloader.
 *
 * @package automattic/jetpack-autoloader
 */

AUTOLOADER_COMMENT;

	/**
	 * Copies autoloader files and replaces any placeholders in them.
	 *
	 * @param IOInterface|null $io An IO for writing to.
	 * @param string           $outDir The directory to place the autoloader files in.
	 * @param string           $suffix The suffix to use in the autoloader's namespace.
	 */
	public static function copyAutoloaderFiles( $io, $outDir, $suffix ) {
		$renameList = array(
			'autoload.php' => '../autoload_packages.php',
		);
		$ignoreList = array(
			'AutoloadGenerator.php',
			'AutoloadProcessor.php',
			'CustomAutoloaderPlugin.php',
			'ManifestGenerator.php',
			'AutoloadFileWriter.php',
		);

		// Copy all of the autoloader files.
		$files = scandir( __DIR__ );
		foreach ( $files as $file ) {
			// Only PHP files will be copied.
			if ( substr( $file, -4 ) !== '.php' ) {
				continue;
			}

			if ( in_array( $file, $ignoreList, true ) ) {
				continue;
			}

			$newFile = isset( $renameList[ $file ] ) ? $renameList[ $file ] : $file;
			$content = self::prepareAutoloaderFile( $file, $suffix );

			$written = file_put_contents( $outDir . '/' . $newFile, $content );
			if ( $io ) {
				if ( $written ) {
					$io->writeError( "  <info>Generated: $newFile</info>" );
				} else {
					$io->writeError( "  <error>Error: $newFile</error>" );
				}
			}
		}
	}

	/**
	 * Prepares an autoloader file to be written to the destination.
	 *
	 * @param String $filename a file to prepare.
	 * @param String $suffix   Unique suffix used in the namespace.
	 *
	 * @return string
	 */
	private static function prepareAutoloaderFile( $filename, $suffix ) {
		$header  = self::COMMENT;
		$header .= PHP_EOL;
		$header .= 'namespace Automattic\Jetpack\Autoloader\jp' . $suffix . ';';
		$header .= PHP_EOL . PHP_EOL;

		$sourceLoader  = fopen( __DIR__ . '/' . $filename, 'r' );
		$file_contents = stream_get_contents( $sourceLoader );
		return str_replace(
			'/* HEADER */',
			$header,
			$file_contents
		);
	}
}
woocommerce-blocks/vendor/automattic/jetpack-autoloader/src/class-version-selector.php000064400000003165151335517640025510 0ustar00<?php
/* HEADER */ // phpcs:ignore

/**
 * Used to select package versions.
 */
class Version_Selector {

	/**
	 * Checks whether the selected package version should be updated. Composer development
	 * package versions ('9999999-dev' or versions that start with 'dev-') are favored
	 * when the JETPACK_AUTOLOAD_DEV constant is set to true.
	 *
	 * @param String $selected_version The currently selected package version.
	 * @param String $compare_version The package version that is being evaluated to
	 *                                determine if the version needs to be updated.
	 *
	 * @return bool Returns true if the selected package version should be updated,
	 *                 else false.
	 */
	public function is_version_update_required( $selected_version, $compare_version ) {
		$use_dev_versions = defined( 'JETPACK_AUTOLOAD_DEV' ) && JETPACK_AUTOLOAD_DEV;

		if ( is_null( $selected_version ) ) {
			return true;
		}

		if ( $use_dev_versions && $this->is_dev_version( $selected_version ) ) {
			return false;
		}

		if ( $this->is_dev_version( $compare_version ) ) {
			if ( $use_dev_versions ) {
				return true;
			} else {
				return false;
			}
		}

		if ( version_compare( $selected_version, $compare_version, '<' ) ) {
			return true;
		}

		return false;
	}

	/**
	 * Checks whether the given package version is a development version.
	 *
	 * @param String $version The package version.
	 *
	 * @return bool True if the version is a dev version, else false.
	 */
	public function is_dev_version( $version ) {
		if ( 'dev-' === substr( $version, 0, 4 ) || '9999999-dev' === $version ) {
			return true;
		}

		return false;
	}
}
woocommerce-blocks/vendor/automattic/jetpack-autoloader/src/class-autoloader.php000064400000007573151335517640024353 0ustar00<?php
/* HEADER */ // phpcs:ignore

/**
 * This class handles management of the actual PHP autoloader.
 */
class Autoloader {

	/**
	 * Checks to see whether or not the autoloader should be initialized and then initializes it if so.
	 *
	 * @param Container|null $container The container we want to use for autoloader initialization. If none is given
	 *                                  then a container will be created automatically.
	 */
	public static function init( $container = null ) {
		// The container holds and manages the lifecycle of our dependencies
		// to make them easier to work with and increase flexibility.
		if ( ! isset( $container ) ) {
			require_once __DIR__ . '/class-container.php';
			$container = new Container();
		}

		// phpcs:disable Generic.Commenting.DocComment.MissingShort

		/** @var Autoloader_Handler $autoloader_handler */
		$autoloader_handler = $container->get( Autoloader_Handler::class );

		// If the autoloader is already initializing it means that it has included us as the latest.
		$was_included_by_autoloader = $autoloader_handler->is_initializing();

		/** @var Plugin_Locator $plugin_locator */
		$plugin_locator = $container->get( Plugin_Locator::class );

		/** @var Plugins_Handler $plugins_handler */
		$plugins_handler = $container->get( Plugins_Handler::class );

		// The current plugin is the one that we are attempting to initialize here.
		$current_plugin = $plugin_locator->find_current_plugin();

		// The active plugins are those that we were able to discover on the site. This list will not
		// include mu-plugins, those activated by code, or those who are hidden by filtering. We also
		// want to take care to not consider the current plugin unknown if it was included by an
		// autoloader. This avoids the case where a plugin will be marked "active" while deactivated
		// due to it having the latest autoloader.
		$active_plugins = $plugins_handler->get_active_plugins( true, ! $was_included_by_autoloader );

		// The cached plugins are all of those that were active or discovered by the autoloader during a previous request.
		// Note that it's possible this list will include plugins that have since been deactivated, but after a request
		// the cache should be updated and the deactivated plugins will be removed.
		$cached_plugins = $plugins_handler->get_cached_plugins();

		// We combine the active list and cached list to preemptively load classes for plugins that are
		// presently unknown but will be loaded during the request. While this may result in us considering packages in
		// deactivated plugins there shouldn't be any problems as a result and the eventual consistency is sufficient.
		$all_plugins = array_merge( $active_plugins, $cached_plugins );

		// In particular we also include the current plugin to address the case where it is the latest autoloader
		// but also unknown (and not cached). We don't want it in the active list because we don't know that it
		// is active but we need it in the all plugins list so that it is considered by the autoloader.
		$all_plugins[] = $current_plugin;

		// We require uniqueness in the array to avoid processing the same plugin more than once.
		$all_plugins = array_values( array_unique( $all_plugins ) );

		/** @var Latest_Autoloader_Guard $guard */
		$guard = $container->get( Latest_Autoloader_Guard::class );
		if ( $guard->should_stop_init( $current_plugin, $all_plugins, $was_included_by_autoloader ) ) {
			return;
		}

		// Initialize the autoloader using the handler now that we're ready.
		$autoloader_handler->activate_autoloader( $all_plugins );

		/** @var Hook_Manager $hook_manager */
		$hook_manager = $container->get( Hook_Manager::class );

		// Register a shutdown handler to clean up the autoloader.
		$hook_manager->add_action( 'shutdown', new Shutdown_Handler( $plugins_handler, $cached_plugins, $was_included_by_autoloader ) );

		// phpcs:enable Generic.Commenting.DocComment.MissingShort
	}
}
woocommerce-blocks/vendor/automattic/jetpack-autoloader/src/class-php-autoloader.php000064400000005071151335517640025127 0ustar00<?php
/* HEADER */ // phpcs:ignore

/**
 * This class handles management of the actual PHP autoloader.
 */
class PHP_Autoloader {

	/**
	 * Registers the autoloader with PHP so that it can begin autoloading classes.
	 *
	 * @param Version_Loader $version_loader The class loader to use in the autoloader.
	 */
	public function register_autoloader( $version_loader ) {
		// Make sure no other autoloaders are registered.
		$this->unregister_autoloader();

		// Set the global so that it can be used to load classes.
		global $jetpack_autoloader_loader;
		$jetpack_autoloader_loader = $version_loader;

		// Ensure that the autoloader is first to avoid contention with others.
		spl_autoload_register( array( self::class, 'load_class' ), true, true );
	}

	/**
	 * Unregisters the active autoloader so that it will no longer autoload classes.
	 */
	public function unregister_autoloader() {
		// Remove any v2 autoloader that we've already registered.
		$autoload_chain = spl_autoload_functions();
		foreach ( $autoload_chain as $autoloader ) {
			// We can identify a v2 autoloader using the namespace.
			$namespace_check = null;

			// Functions are recorded as strings.
			if ( is_string( $autoloader ) ) {
				$namespace_check = $autoloader;
			} elseif ( is_array( $autoloader ) && is_string( $autoloader[0] ) ) {
				// Static method calls have the class as the first array element.
				$namespace_check = $autoloader[0];
			} else {
				// Since the autoloader has only ever been a function or a static method we don't currently need to check anything else.
				continue;
			}

			// Check for the namespace without the generated suffix.
			if ( 'Automattic\\Jetpack\\Autoloader\\jp' === substr( $namespace_check, 0, 32 ) ) {
				spl_autoload_unregister( $autoloader );
			}
		}

		// Clear the global now that the autoloader has been unregistered.
		global $jetpack_autoloader_loader;
		$jetpack_autoloader_loader = null;
	}

	/**
	 * Loads a class file if one could be found.
	 *
	 * Note: This function is static so that the autoloader can be easily unregistered. If
	 * it was a class method we would have to unwrap the object to check the namespace.
	 *
	 * @param string $class_name The name of the class to autoload.
	 *
	 * @return bool Indicates whether or not a class file was loaded.
	 */
	public static function load_class( $class_name ) {
		global $jetpack_autoloader_loader;
		if ( ! isset( $jetpack_autoloader_loader ) ) {
			return;
		}

		$file = $jetpack_autoloader_loader->find_class_file( $class_name );
		if ( ! isset( $file ) ) {
			return false;
		}

		require $file;
		return true;
	}
}
woocommerce-blocks/vendor/automattic/jetpack-autoloader/src/class-manifest-reader.php000064400000004673151335517640025260 0ustar00<?php
/* HEADER */ // phpcs:ignore

/**
 * This class reads autoloader manifest files.
 */
class Manifest_Reader {

	/**
	 * The Version_Selector object.
	 *
	 * @var Version_Selector
	 */
	private $version_selector;

	/**
	 * The constructor.
	 *
	 * @param Version_Selector $version_selector The Version_Selector object.
	 */
	public function __construct( $version_selector ) {
		$this->version_selector = $version_selector;
	}

	/**
	 * Reads all of the manifests in the given plugin paths.
	 *
	 * @param array  $plugin_paths  The paths to the plugins we're loading the manifest in.
	 * @param string $manifest_path The path that we're loading the manifest from in each plugin.
	 * @param array  $path_map The path map to add the contents of the manifests to.
	 *
	 * @return array $path_map The path map we've built using the manifests in each plugin.
	 */
	public function read_manifests( $plugin_paths, $manifest_path, &$path_map ) {
		$file_paths = array_map(
			function ( $path ) use ( $manifest_path ) {
				return trailingslashit( $path ) . $manifest_path;
			},
			$plugin_paths
		);

		foreach ( $file_paths as $path ) {
			$this->register_manifest( $path, $path_map );
		}

		return $path_map;
	}

	/**
	 * Registers a plugin's manifest file with the path map.
	 *
	 * @param string $manifest_path The absolute path to the manifest that we're loading.
	 * @param array  $path_map The path map to add the contents of the manifest to.
	 */
	protected function register_manifest( $manifest_path, &$path_map ) {
		if ( ! is_readable( $manifest_path ) ) {
			return;
		}

		$manifest = require $manifest_path;
		if ( ! is_array( $manifest ) ) {
			return;
		}

		foreach ( $manifest as $key => $data ) {
			$this->register_record( $key, $data, $path_map );
		}
	}

	/**
	 * Registers an entry from the manifest in the path map.
	 *
	 * @param string $key The identifier for the entry we're registering.
	 * @param array  $data The data for the entry we're registering.
	 * @param array  $path_map The path map to add the contents of the manifest to.
	 */
	protected function register_record( $key, $data, &$path_map ) {
		if ( isset( $path_map[ $key ]['version'] ) ) {
			$selected_version = $path_map[ $key ]['version'];
		} else {
			$selected_version = null;
		}

		if ( $this->version_selector->is_version_update_required( $selected_version, $data['version'] ) ) {
			$path_map[ $key ] = array(
				'version' => $data['version'],
				'path'    => $data['path'],
			);
		}
	}
}
woocommerce-blocks/vendor/automattic/jetpack-autoloader/src/class-autoloader-locator.php000064400000003616151335517640026006 0ustar00<?php
/* HEADER */ // phpcs:ignore

use Automattic\Jetpack\Autoloader\AutoloadGenerator;

/**
 * This class locates autoloaders.
 */
class Autoloader_Locator {

	/**
	 * The object for comparing autoloader versions.
	 *
	 * @var Version_Selector
	 */
	private $version_selector;

	/**
	 * The constructor.
	 *
	 * @param Version_Selector $version_selector The version selector object.
	 */
	public function __construct( $version_selector ) {
		$this->version_selector = $version_selector;
	}

	/**
	 * Finds the path to the plugin with the latest autoloader.
	 *
	 * @param array  $plugin_paths An array of plugin paths.
	 * @param string $latest_version The latest version reference.
	 *
	 * @return string|null
	 */
	public function find_latest_autoloader( $plugin_paths, &$latest_version ) {
		$latest_plugin = null;

		foreach ( $plugin_paths as $plugin_path ) {
			$version = $this->get_autoloader_version( $plugin_path );
			if ( ! $this->version_selector->is_version_update_required( $latest_version, $version ) ) {
				continue;
			}

			$latest_version = $version;
			$latest_plugin  = $plugin_path;
		}

		return $latest_plugin;
	}

	/**
	 * Gets the path to the autoloader.
	 *
	 * @param string $plugin_path The path to the plugin.
	 *
	 * @return string
	 */
	public function get_autoloader_path( $plugin_path ) {
		return trailingslashit( $plugin_path ) . 'vendor/autoload_packages.php';
	}

	/**
	 * Gets the version for the autoloader.
	 *
	 * @param string $plugin_path The path to the plugin.
	 *
	 * @return string|null
	 */
	public function get_autoloader_version( $plugin_path ) {
		$classmap = trailingslashit( $plugin_path ) . 'vendor/composer/jetpack_autoload_classmap.php';
		if ( ! file_exists( $classmap ) ) {
			return null;
		}

		$classmap = require $classmap;
		if ( isset( $classmap[ AutoloadGenerator::class ] ) ) {
			return $classmap[ AutoloadGenerator::class ]['version'];
		}

		return null;
	}
}
woocommerce-blocks/vendor/automattic/jetpack-autoloader/src/AutoloadProcessor.php000064400000012357151335517640024555 0ustar00<?php // phpcs:ignore WordPress.Files.FileName
/**
 * Autoload Processor.
 *
 * @package automattic/jetpack-autoloader
 */

// phpcs:disable WordPress.Files.FileName.InvalidClassFileName
// phpcs:disable WordPress.NamingConventions.ValidFunctionName.MethodNameInvalid
// phpcs:disable WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase
// phpcs:disable WordPress.NamingConventions.ValidVariableName.InterpolatedVariableNotSnakeCase
// phpcs:disable WordPress.NamingConventions.ValidVariableName.VariableNotSnakeCase
// phpcs:disable WordPress.NamingConventions.ValidVariableName.PropertyNotSnakeCase

namespace Automattic\Jetpack\Autoloader;

/**
 * Class AutoloadProcessor.
 */
class AutoloadProcessor {

	/**
	 * A callable for scanning a directory for all of its classes.
	 *
	 * @var callable
	 */
	private $classmapScanner;

	/**
	 * A callable for transforming a path into one to be used in code.
	 *
	 * @var callable
	 */
	private $pathCodeTransformer;

	/**
	 * The constructor.
	 *
	 * @param callable $classmapScanner A callable for scanning a directory for all of its classes.
	 * @param callable $pathCodeTransformer A callable for transforming a path into one to be used in code.
	 */
	public function __construct( $classmapScanner, $pathCodeTransformer ) {
		$this->classmapScanner     = $classmapScanner;
		$this->pathCodeTransformer = $pathCodeTransformer;
	}

	/**
	 * Processes the classmap autoloads into a relative path format including the version for each file.
	 *
	 * @param array $autoloads The autoloads we are processing.
	 * @param bool  $scanPsrPackages Whether or not PSR packages should be converted to a classmap.
	 *
	 * @return array $processed
	 */
	public function processClassmap( $autoloads, $scanPsrPackages ) {
		// We can't scan PSR packages if we don't actually have any.
		if ( empty( $autoloads['psr-4'] ) ) {
			$scanPsrPackages = false;
		}

		if ( empty( $autoloads['classmap'] ) && ! $scanPsrPackages ) {
			return null;
		}

		$excludedClasses = null;
		if ( ! empty( $autoloads['exclude-from-classmap'] ) ) {
			$excludedClasses = '{(' . implode( '|', $autoloads['exclude-from-classmap'] ) . ')}';
		}

		$processed = array();

		if ( $scanPsrPackages ) {
			foreach ( $autoloads['psr-4'] as $namespace => $sources ) {
				$namespace = empty( $namespace ) ? null : $namespace;

				foreach ( $sources as $source ) {
					$classmap = call_user_func( $this->classmapScanner, $source['path'], $excludedClasses, $namespace );

					foreach ( $classmap as $class => $path ) {
						$processed[ $class ] = array(
							'version' => $source['version'],
							'path'    => call_user_func( $this->pathCodeTransformer, $path ),
						);
					}
				}
			}
		}

		/*
		 * PSR-0 namespaces are converted to classmaps for both optimized and unoptimized autoloaders because any new
		 * development should use classmap or PSR-4 autoloading.
		 */
		if ( ! empty( $autoloads['psr-0'] ) ) {
			foreach ( $autoloads['psr-0'] as $namespace => $sources ) {
				$namespace = empty( $namespace ) ? null : $namespace;

				foreach ( $sources as $source ) {
					$classmap = call_user_func( $this->classmapScanner, $source['path'], $excludedClasses, $namespace );
					foreach ( $classmap as $class => $path ) {
						$processed[ $class ] = array(
							'version' => $source['version'],
							'path'    => call_user_func( $this->pathCodeTransformer, $path ),
						);
					}
				}
			}
		}

		if ( ! empty( $autoloads['classmap'] ) ) {
			foreach ( $autoloads['classmap'] as $package ) {
				$classmap = call_user_func( $this->classmapScanner, $package['path'], $excludedClasses, null );

				foreach ( $classmap as $class => $path ) {
					$processed[ $class ] = array(
						'version' => $package['version'],
						'path'    => call_user_func( $this->pathCodeTransformer, $path ),
					);
				}
			}
		}

		return $processed;
	}

	/**
	 * Processes the PSR-4 autoloads into a relative path format including the version for each file.
	 *
	 * @param array $autoloads The autoloads we are processing.
	 * @param bool  $scanPsrPackages Whether or not PSR packages should be converted to a classmap.
	 *
	 * @return array $processed
	 */
	public function processPsr4Packages( $autoloads, $scanPsrPackages ) {
		if ( $scanPsrPackages || empty( $autoloads['psr-4'] ) ) {
			return null;
		}

		$processed = array();

		foreach ( $autoloads['psr-4'] as $namespace => $packages ) {
			$namespace = empty( $namespace ) ? null : $namespace;
			$paths     = array();

			foreach ( $packages as $package ) {
				$paths[] = call_user_func( $this->pathCodeTransformer, $package['path'] );
			}

			$processed[ $namespace ] = array(
				'version' => $package['version'],
				'path'    => $paths,
			);
		}

		return $processed;
	}

	/**
	 * Processes the file autoloads into a relative format including the version for each file.
	 *
	 * @param array $autoloads The autoloads we are processing.
	 *
	 * @return array|null $processed
	 */
	public function processFiles( $autoloads ) {
		if ( empty( $autoloads['files'] ) ) {
			return null;
		}

		$processed = array();

		foreach ( $autoloads['files'] as $file_id => $package ) {
			$processed[ $file_id ] = array(
				'version' => $package['version'],
				'path'    => call_user_func( $this->pathCodeTransformer, $package['path'] ),
			);
		}

		return $processed;
	}
}
woocommerce-blocks/vendor/automattic/jetpack-autoloader/src/class-hook-manager.php000064400000003643151335517640024556 0ustar00<?php
/* HEADER */ // phpcs:ignore

/**
 * Allows the latest autoloader to register hooks that can be removed when the autoloader is reset.
 */
class Hook_Manager {

	/**
	 * An array containing all of the hooks that we've registered.
	 *
	 * @var array
	 */
	private $registered_hooks;

	/**
	 * The constructor.
	 */
	public function __construct() {
		$this->registered_hooks = array();
	}

	/**
	 * Adds an action to WordPress and registers it internally.
	 *
	 * @param string   $tag           The name of the action which is hooked.
	 * @param callable $callable      The function to call.
	 * @param int      $priority      Used to specify the priority of the action.
	 * @param int      $accepted_args Used to specify the number of arguments the callable accepts.
	 */
	public function add_action( $tag, $callable, $priority = 10, $accepted_args = 1 ) {
		$this->registered_hooks[ $tag ][] = array(
			'priority' => $priority,
			'callable' => $callable,
		);

		add_action( $tag, $callable, $priority, $accepted_args );
	}

	/**
	 * Adds a filter to WordPress and registers it internally.
	 *
	 * @param string   $tag           The name of the filter which is hooked.
	 * @param callable $callable      The function to call.
	 * @param int      $priority      Used to specify the priority of the filter.
	 * @param int      $accepted_args Used to specify the number of arguments the callable accepts.
	 */
	public function add_filter( $tag, $callable, $priority = 10, $accepted_args = 1 ) {
		$this->registered_hooks[ $tag ][] = array(
			'priority' => $priority,
			'callable' => $callable,
		);

		add_filter( $tag, $callable, $priority, $accepted_args );
	}

	/**
	 * Removes all of the registered hooks.
	 */
	public function reset() {
		foreach ( $this->registered_hooks as $tag => $hooks ) {
			foreach ( $hooks as $hook ) {
				remove_filter( $tag, $hook['callable'], $hook['priority'] );
			}
		}
		$this->registered_hooks = array();
	}
}
woocommerce-blocks/vendor/automattic/jetpack-autoloader/src/class-autoloader-handler.php000064400000010465151335517640025760 0ustar00<?php
/* HEADER */ // phpcs:ignore

use Automattic\Jetpack\Autoloader\AutoloadGenerator;

/**
 * This class selects the package version for the autoloader.
 */
class Autoloader_Handler {

	/**
	 * The PHP_Autoloader instance.
	 *
	 * @var PHP_Autoloader
	 */
	private $php_autoloader;

	/**
	 * The Hook_Manager instance.
	 *
	 * @var Hook_Manager
	 */
	private $hook_manager;

	/**
	 * The Manifest_Reader instance.
	 *
	 * @var Manifest_Reader
	 */
	private $manifest_reader;

	/**
	 * The Version_Selector instance.
	 *
	 * @var Version_Selector
	 */
	private $version_selector;

	/**
	 * The constructor.
	 *
	 * @param PHP_Autoloader   $php_autoloader The PHP_Autoloader instance.
	 * @param Hook_Manager     $hook_manager The Hook_Manager instance.
	 * @param Manifest_Reader  $manifest_reader The Manifest_Reader instance.
	 * @param Version_Selector $version_selector The Version_Selector instance.
	 */
	public function __construct( $php_autoloader, $hook_manager, $manifest_reader, $version_selector ) {
		$this->php_autoloader   = $php_autoloader;
		$this->hook_manager     = $hook_manager;
		$this->manifest_reader  = $manifest_reader;
		$this->version_selector = $version_selector;
	}

	/**
	 * Checks to see whether or not an autoloader is currently in the process of initializing.
	 *
	 * @return bool
	 */
	public function is_initializing() {
		// If no version has been set it means that no autoloader has started initializing yet.
		global $jetpack_autoloader_latest_version;
		if ( ! isset( $jetpack_autoloader_latest_version ) ) {
			return false;
		}

		// When the version is set but the classmap is not it ALWAYS means that this is the
		// latest autoloader and is being included by an older one.
		global $jetpack_packages_classmap;
		if ( empty( $jetpack_packages_classmap ) ) {
			return true;
		}

		// Version 2.4.0 added a new global and altered the reset semantics. We need to check
		// the other global as well since it may also point at initialization.
		// Note: We don't need to check for the class first because every autoloader that
		// will set the latest version global requires this class in the classmap.
		$replacing_version = $jetpack_packages_classmap[ AutoloadGenerator::class ]['version'];
		if ( $this->version_selector->is_dev_version( $replacing_version ) || version_compare( $replacing_version, '2.4.0.0', '>=' ) ) {
			global $jetpack_autoloader_loader;
			if ( ! isset( $jetpack_autoloader_loader ) ) {
				return true;
			}
		}

		return false;
	}

	/**
	 * Activates an autoloader using the given plugins and activates it.
	 *
	 * @param string[] $plugins The plugins to initialize the autoloader for.
	 */
	public function activate_autoloader( $plugins ) {
		global $jetpack_packages_psr4;
		$jetpack_packages_psr4 = array();
		$this->manifest_reader->read_manifests( $plugins, 'vendor/composer/jetpack_autoload_psr4.php', $jetpack_packages_psr4 );

		global $jetpack_packages_classmap;
		$jetpack_packages_classmap = array();
		$this->manifest_reader->read_manifests( $plugins, 'vendor/composer/jetpack_autoload_classmap.php', $jetpack_packages_classmap );

		global $jetpack_packages_filemap;
		$jetpack_packages_filemap = array();
		$this->manifest_reader->read_manifests( $plugins, 'vendor/composer/jetpack_autoload_filemap.php', $jetpack_packages_filemap );

		$loader = new Version_Loader(
			$this->version_selector,
			$jetpack_packages_classmap,
			$jetpack_packages_psr4,
			$jetpack_packages_filemap
		);

		$this->php_autoloader->register_autoloader( $loader );

		// Now that the autoloader is active we can load the filemap.
		$loader->load_filemap();
	}

	/**
	 * Resets the active autoloader and all related global state.
	 */
	public function reset_autoloader() {
		$this->php_autoloader->unregister_autoloader();
		$this->hook_manager->reset();

		// Clear all of the autoloader globals so that older autoloaders don't do anything strange.
		global $jetpack_autoloader_latest_version;
		$jetpack_autoloader_latest_version = null;

		global $jetpack_packages_classmap;
		$jetpack_packages_classmap = array(); // Must be array to avoid exceptions in old autoloaders!

		global $jetpack_packages_psr4;
		$jetpack_packages_psr4 = array(); // Must be array to avoid exceptions in old autoloaders!

		global $jetpack_packages_filemap;
		$jetpack_packages_filemap = array(); // Must be array to avoid exceptions in old autoloaders!
	}
}
woocommerce-blocks/vendor/automattic/jetpack-autoloader/src/AutoloadGenerator.php000064400000033623151335517640024523 0ustar00<?php // phpcs:ignore WordPress.Files.FileName
/**
 * Autoloader Generator.
 *
 * @package automattic/jetpack-autoloader
 */

// phpcs:disable PHPCompatibility.Keywords.NewKeywords.t_useFound
// phpcs:disable PHPCompatibility.LanguageConstructs.NewLanguageConstructs.t_ns_separatorFound
// phpcs:disable PHPCompatibility.FunctionDeclarations.NewClosure.Found
// phpcs:disable PHPCompatibility.Keywords.NewKeywords.t_namespaceFound
// phpcs:disable PHPCompatibility.Keywords.NewKeywords.t_dirFound
// phpcs:disable WordPress.Files.FileName.InvalidClassFileName
// phpcs:disable WordPress.PHP.DevelopmentFunctions.error_log_var_export
// phpcs:disable WordPress.WP.AlternativeFunctions.file_system_read_file_put_contents
// phpcs:disable WordPress.WP.AlternativeFunctions.file_system_read_fopen
// phpcs:disable WordPress.WP.AlternativeFunctions.file_system_read_fwrite
// phpcs:disable WordPress.NamingConventions.ValidFunctionName.MethodNameInvalid
// phpcs:disable WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase
// phpcs:disable WordPress.NamingConventions.ValidVariableName.InterpolatedVariableNotSnakeCase
// phpcs:disable WordPress.NamingConventions.ValidVariableName.VariableNotSnakeCase
// phpcs:disable WordPress.NamingConventions.ValidVariableName.PropertyNotSnakeCase

namespace Automattic\Jetpack\Autoloader;

use Composer\Autoload\ClassMapGenerator;
use Composer\Composer;
use Composer\Config;
use Composer\Installer\InstallationManager;
use Composer\IO\IOInterface;
use Composer\Package\PackageInterface;
use Composer\Repository\InstalledRepositoryInterface;
use Composer\Util\Filesystem;
use Composer\Util\PackageSorter;

/**
 * Class AutoloadGenerator.
 */
class AutoloadGenerator {

	/**
	 * The filesystem utility.
	 *
	 * @var Filesystem
	 */
	private $filesystem;

	/**
	 * Instantiate an AutoloadGenerator object.
	 *
	 * @param IOInterface $io IO object.
	 */
	public function __construct( IOInterface $io = null ) {
		$this->io         = $io;
		$this->filesystem = new Filesystem();
	}

	/**
	 * Dump the Jetpack autoloader files.
	 *
	 * @param Composer                     $composer The Composer object.
	 * @param Config                       $config Config object.
	 * @param InstalledRepositoryInterface $localRepo Installed Repository object.
	 * @param PackageInterface             $mainPackage Main Package object.
	 * @param InstallationManager          $installationManager Manager for installing packages.
	 * @param string                       $targetDir Path to the current target directory.
	 * @param bool                         $scanPsrPackages Whether or not PSR packages should be converted to a classmap.
	 * @param string                       $suffix The autoloader suffix.
	 */
	public function dump(
		Composer $composer,
		Config $config,
		InstalledRepositoryInterface $localRepo,
		PackageInterface $mainPackage,
		InstallationManager $installationManager,
		$targetDir,
		$scanPsrPackages = false,
		$suffix = null
	) {
		$this->filesystem->ensureDirectoryExists( $config->get( 'vendor-dir' ) );

		$packageMap = $composer->getAutoloadGenerator()->buildPackageMap( $installationManager, $mainPackage, $localRepo->getCanonicalPackages() );
		$autoloads  = $this->parseAutoloads( $packageMap, $mainPackage );

		// Convert the autoloads into a format that the manifest generator can consume more easily.
		$basePath           = $this->filesystem->normalizePath( realpath( getcwd() ) );
		$vendorPath         = $this->filesystem->normalizePath( realpath( $config->get( 'vendor-dir' ) ) );
		$processedAutoloads = $this->processAutoloads( $autoloads, $scanPsrPackages, $vendorPath, $basePath );
		unset( $packageMap, $autoloads );

		// Make sure none of the legacy files remain that can lead to problems with the autoloader.
		$this->removeLegacyFiles( $vendorPath );

		// Write all of the files now that we're done.
		$this->writeAutoloaderFiles( $vendorPath . '/jetpack-autoloader/', $suffix );
		$this->writeManifests( $vendorPath . '/' . $targetDir, $processedAutoloads );

		if ( ! $scanPsrPackages ) {
			$this->io->writeError( '<warning>You are generating an unoptimized autoloader. If this is a production build, consider using the -o option.</warning>' );
		}
	}

	/**
	 * Compiles an ordered list of namespace => path mappings
	 *
	 * @param  array            $packageMap  Array of array(package, installDir-relative-to-composer.json).
	 * @param  PackageInterface $mainPackage Main package instance.
	 *
	 * @return array The list of path mappings.
	 */
	public function parseAutoloads( array $packageMap, PackageInterface $mainPackage ) {
		$rootPackageMap = array_shift( $packageMap );

		$sortedPackageMap   = $this->sortPackageMap( $packageMap );
		$sortedPackageMap[] = $rootPackageMap;
		array_unshift( $packageMap, $rootPackageMap );

		$psr0     = $this->parseAutoloadsType( $packageMap, 'psr-0', $mainPackage );
		$psr4     = $this->parseAutoloadsType( $packageMap, 'psr-4', $mainPackage );
		$classmap = $this->parseAutoloadsType( array_reverse( $sortedPackageMap ), 'classmap', $mainPackage );
		$files    = $this->parseAutoloadsType( $sortedPackageMap, 'files', $mainPackage );

		krsort( $psr0 );
		krsort( $psr4 );

		return array(
			'psr-0'    => $psr0,
			'psr-4'    => $psr4,
			'classmap' => $classmap,
			'files'    => $files,
		);
	}

	/**
	 * Sorts packages by dependency weight
	 *
	 * Packages of equal weight retain the original order
	 *
	 * @param  array $packageMap The package map.
	 *
	 * @return array
	 */
	protected function sortPackageMap( array $packageMap ) {
		$packages = array();
		$paths    = array();

		foreach ( $packageMap as $item ) {
			list( $package, $path ) = $item;
			$name                   = $package->getName();
			$packages[ $name ]      = $package;
			$paths[ $name ]         = $path;
		}

		$sortedPackages = PackageSorter::sortPackages( $packages );

		$sortedPackageMap = array();

		foreach ( $sortedPackages as $package ) {
			$name               = $package->getName();
			$sortedPackageMap[] = array( $packages[ $name ], $paths[ $name ] );
		}

		return $sortedPackageMap;
	}

	/**
	 * Returns the file identifier.
	 *
	 * @param PackageInterface $package The package instance.
	 * @param string           $path The path.
	 */
	protected function getFileIdentifier( PackageInterface $package, $path ) {
		return md5( $package->getName() . ':' . $path );
	}

	/**
	 * Returns the path code for the given path.
	 *
	 * @param Filesystem $filesystem The filesystem instance.
	 * @param string     $basePath The base path.
	 * @param string     $vendorPath The vendor path.
	 * @param string     $path The path.
	 *
	 * @return string The path code.
	 */
	protected function getPathCode( Filesystem $filesystem, $basePath, $vendorPath, $path ) {
		if ( ! $filesystem->isAbsolutePath( $path ) ) {
			$path = $basePath . '/' . $path;
		}
		$path = $filesystem->normalizePath( $path );

		$baseDir = '';
		if ( 0 === strpos( $path . '/', $vendorPath . '/' ) ) {
			$path    = substr( $path, strlen( $vendorPath ) );
			$baseDir = '$vendorDir';

			if ( false !== $path ) {
				$baseDir .= ' . ';
			}
		} else {
			$path = $filesystem->normalizePath( $filesystem->findShortestPath( $basePath, $path, true ) );
			if ( ! $filesystem->isAbsolutePath( $path ) ) {
				$baseDir = '$baseDir . ';
				$path    = '/' . $path;
			}
		}

		if ( strpos( $path, '.phar' ) !== false ) {
			$baseDir = "'phar://' . " . $baseDir;
		}

		return $baseDir . ( ( false !== $path ) ? var_export( $path, true ) : '' );
	}

	/**
	 * This function differs from the composer parseAutoloadsType in that beside returning the path.
	 * It also return the path and the version of a package.
	 *
	 * Supports PSR-4, PSR-0, and classmap parsing.
	 *
	 * @param array            $packageMap Map of all the packages.
	 * @param string           $type Type of autoloader to use.
	 * @param PackageInterface $mainPackage Instance of the Package Object.
	 *
	 * @return array
	 */
	protected function parseAutoloadsType( array $packageMap, $type, PackageInterface $mainPackage ) {
		$autoloads = array();

		foreach ( $packageMap as $item ) {
			list($package, $installPath) = $item;
			$autoload                    = $package->getAutoload();

			if ( $package === $mainPackage ) {
				$autoload = array_merge_recursive( $autoload, $package->getDevAutoload() );
			}

			if ( null !== $package->getTargetDir() && $package !== $mainPackage ) {
				$installPath = substr( $installPath, 0, -strlen( '/' . $package->getTargetDir() ) );
			}

			if ( in_array( $type, array( 'psr-4', 'psr-0' ), true ) && isset( $autoload[ $type ] ) && is_array( $autoload[ $type ] ) ) {
				foreach ( $autoload[ $type ] as $namespace => $paths ) {
					$paths = is_array( $paths ) ? $paths : array( $paths );
					foreach ( $paths as $path ) {
						$relativePath              = empty( $installPath ) ? ( empty( $path ) ? '.' : $path ) : $installPath . '/' . $path;
						$autoloads[ $namespace ][] = array(
							'path'    => $relativePath,
							'version' => $package->getVersion(), // Version of the class comes from the package - should we try to parse it?
						);
					}
				}
			}

			if ( 'classmap' === $type && isset( $autoload['classmap'] ) && is_array( $autoload['classmap'] ) ) {
				foreach ( $autoload['classmap'] as $paths ) {
					$paths = is_array( $paths ) ? $paths : array( $paths );
					foreach ( $paths as $path ) {
						$relativePath = empty( $installPath ) ? ( empty( $path ) ? '.' : $path ) : $installPath . '/' . $path;
						$autoloads[]  = array(
							'path'    => $relativePath,
							'version' => $package->getVersion(), // Version of the class comes from the package - should we try to parse it?
						);
					}
				}
			}
			if ( 'files' === $type && isset( $autoload['files'] ) && is_array( $autoload['files'] ) ) {
				foreach ( $autoload['files'] as $paths ) {
					$paths = is_array( $paths ) ? $paths : array( $paths );
					foreach ( $paths as $path ) {
						$relativePath = empty( $installPath ) ? ( empty( $path ) ? '.' : $path ) : $installPath . '/' . $path;
						$autoloads[ $this->getFileIdentifier( $package, $path ) ] = array(
							'path'    => $relativePath,
							'version' => $package->getVersion(), // Version of the file comes from the package - should we try to parse it?
						);
					}
				}
			}
		}

		return $autoloads;
	}

	/**
	 * Given Composer's autoloads this will convert them to a version that we can use to generate the manifests.
	 *
	 * When the $scanPsrPackages argument is true, PSR-4 namespaces are converted to classmaps. When $scanPsrPackages
	 * is false, PSR-4 namespaces are not converted to classmaps.
	 *
	 * PSR-0 namespaces are always converted to classmaps.
	 *
	 * @param array  $autoloads The autoloads we want to process.
	 * @param bool   $scanPsrPackages Whether or not PSR-4 packages should be converted to a classmap.
	 * @param string $vendorPath The path to the vendor directory.
	 * @param string $basePath The path to the current directory.
	 *
	 * @return array $processedAutoloads
	 */
	private function processAutoloads( $autoloads, $scanPsrPackages, $vendorPath, $basePath ) {
		$processor = new AutoloadProcessor(
			function ( $path, $excludedClasses, $namespace ) use ( $basePath ) {
				$dir = $this->filesystem->normalizePath(
					$this->filesystem->isAbsolutePath( $path ) ? $path : $basePath . '/' . $path
				);
				return ClassMapGenerator::createMap(
					$dir,
					$excludedClasses,
					null, // Don't pass the IOInterface since the normal autoload generation will have reported already.
					empty( $namespace ) ? null : $namespace
				);
			},
			function ( $path ) use ( $basePath, $vendorPath ) {
				return $this->getPathCode( $this->filesystem, $basePath, $vendorPath, $path );
			}
		);

		return array(
			'psr-4'    => $processor->processPsr4Packages( $autoloads, $scanPsrPackages ),
			'classmap' => $processor->processClassmap( $autoloads, $scanPsrPackages ),
			'files'    => $processor->processFiles( $autoloads ),
		);
	}

	/**
	 * Removes all of the legacy autoloader files so they don't cause any problems.
	 *
	 * @param string $outDir The directory legacy files are written to.
	 */
	private function removeLegacyFiles( $outDir ) {
		$files = array(
			'autoload_functions.php',
			'class-autoloader-handler.php',
			'class-classes-handler.php',
			'class-files-handler.php',
			'class-plugins-handler.php',
			'class-version-selector.php',
		);
		foreach ( $files as $file ) {
			$this->filesystem->remove( $outDir . '/' . $file );
		}
	}

	/**
	 * Writes all of the autoloader files to disk.
	 *
	 * @param string $outDir The directory to write to.
	 * @param string $suffix The unique autoloader suffix.
	 */
	private function writeAutoloaderFiles( $outDir, $suffix ) {
		$this->io->writeError( "<info>Generating jetpack autoloader ($outDir)</info>" );

		// We will remove all autoloader files to generate this again.
		$this->filesystem->emptyDirectory( $outDir );

		// Write the autoloader files.
		AutoloadFileWriter::copyAutoloaderFiles( $this->io, $outDir, $suffix );
	}

	/**
	 * Writes all of the manifest files to disk.
	 *
	 * @param string $outDir The directory to write to.
	 * @param array  $processedAutoloads The processed autoloads.
	 */
	private function writeManifests( $outDir, $processedAutoloads ) {
		$this->io->writeError( "<info>Generating jetpack autoloader manifests ($outDir)</info>" );

		$manifestFiles = array(
			'classmap' => 'jetpack_autoload_classmap.php',
			'psr-4'    => 'jetpack_autoload_psr4.php',
			'files'    => 'jetpack_autoload_filemap.php',
		);

		foreach ( $manifestFiles as $key => $file ) {
			// Make sure the file doesn't exist so it isn't there if we don't write it.
			$this->filesystem->remove( $outDir . '/' . $file );
			if ( empty( $processedAutoloads[ $key ] ) ) {
				continue;
			}

			$content = ManifestGenerator::buildManifest( $key, $file, $processedAutoloads[ $key ] );
			if ( empty( $content ) ) {
				continue;
			}

			if ( file_put_contents( $outDir . '/' . $file, $content ) ) {
				$this->io->writeError( "  <info>Generated: $file</info>" );
			} else {
				$this->io->writeError( "  <error>Error: $file</error>" );
			}
		}
	}
}
woocommerce-blocks/vendor/automattic/jetpack-autoloader/LICENSE.txt000064400000043760151335517640021432 0ustar00This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA


===================================


GNU GENERAL PUBLIC LICENSE
   Version 2, June 1991

Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.

		Preamble

The licenses for most software are designed to take away your
freedom to share and change it.  By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users.  This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it.  (Some other Free Software Foundation software is covered by
the GNU Lesser General Public License instead.)  You can apply it to
your programs, too.

When we speak of free software, we are referring to freedom, not
price.  Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.

To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.

For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have.  You must make sure that they, too, receive or can get the
source code.  And you must show them these terms so they know their
rights.

We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.

Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software.  If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.

Finally, any free program is threatened constantly by software
patents.  We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary.  To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.

The precise terms and conditions for copying, distribution and
modification follow.

GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION

0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License.  The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language.  (Hereinafter, translation is included without limitation in
the term "modification".)  Each licensee is addressed as "you".

Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope.  The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.

1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.

You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.

2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:

a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.

b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.

c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License.  (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)

These requirements apply to the modified work as a whole.  If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works.  But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.

Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.

In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.

3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:

a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,

b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,

c) Accompany it with the information you received as to the offer
to distribute corresponding source code.  (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)

The source code for a work means the preferred form of the work for
making modifications to it.  For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable.  However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.

If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.

4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License.  Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.

5. You are not required to accept this License, since you have not
signed it.  However, nothing else grants you permission to modify or
distribute the Program or its derivative works.  These actions are
prohibited by law if you do not accept this License.  Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.

6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions.  You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.

7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License.  If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all.  For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.

If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.

It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices.  Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.

This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.

8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded.  In such case, this License incorporates
the limitation as if written in the body of this License.

9. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time.  Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.

Each version is given a distinguishing version number.  If the Program
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation.  If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.

10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission.  For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this.  Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.

		NO WARRANTY

11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.

12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.

 END OF TERMS AND CONDITIONS

How to Apply These Terms to Your New Programs

If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.

To do so, attach the following notices to the program.  It is safest
to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.

<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year>  <name of author>

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.

Also add information on how to contact you by electronic and paper mail.

If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:

Gnomovision version 69, Copyright (C) year name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.

The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License.  Of course, the commands you use may
be called something other than `show w' and `show c'; they could even be
mouse-clicks or menu items--whatever suits your program.

You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary.  Here is a sample; alter the names:

Yoyodyne, Inc., hereby disclaims all copyright interest in the program
`Gnomovision' (which makes passes at compilers) written by James Hacker.

<signature of Ty Coon>, 1 April 1989
Ty Coon, President of Vice

This General Public License does not permit incorporating your program into
proprietary programs.  If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library.  If this is what you want to do, use the GNU Lesser General
Public License instead of this License.
woocommerce-blocks/vendor/autoload_packages.php000064400000000475151335517640016032 0ustar00<?php
/**
 * This file was automatically generated by automattic/jetpack-autoloader.
 *
 * @package automattic/jetpack-autoloader
 */

namespace Automattic\Jetpack\Autoloader\jpb78ca910fe07339d6189615f1734a3e3;

 // phpcs:ignore

require_once __DIR__ . '/jetpack-autoloader/class-autoloader.php';
Autoloader::init();
woocommerce-blocks/vendor/jetpack-autoloader/class-container.php000064400000011461151335517640021224 0ustar00<?php
/**
 * This file was automatically generated by automattic/jetpack-autoloader.
 *
 * @package automattic/jetpack-autoloader
 */

namespace Automattic\Jetpack\Autoloader\jpb78ca910fe07339d6189615f1734a3e3;

 // phpcs:ignore

/**
 * This class manages the files and dependencies of the autoloader.
 */
class Container {

	/**
	 * Since each autoloader's class files exist within their own namespace we need a map to
	 * convert between the local class and a shared key. Note that no version checking is
	 * performed on these dependencies and the first autoloader to register will be the
	 * one that is utilized.
	 */
	const SHARED_DEPENDENCY_KEYS = array(
		Hook_Manager::class => 'Hook_Manager',
	);

	/**
	 * A map of all the dependencies we've registered with the container and created.
	 *
	 * @var array
	 */
	protected $dependencies;

	/**
	 * The constructor.
	 */
	public function __construct() {
		$this->dependencies = array();

		$this->register_shared_dependencies();
		$this->register_dependencies();
		$this->initialize_globals();
	}

	/**
	 * Gets a dependency out of the container.
	 *
	 * @param string $class The class to fetch.
	 *
	 * @return mixed
	 * @throws \InvalidArgumentException When a class that isn't registered with the container is fetched.
	 */
	public function get( $class ) {
		if ( ! isset( $this->dependencies[ $class ] ) ) {
			throw new \InvalidArgumentException( "Class '$class' is not registered with the container." );
		}

		return $this->dependencies[ $class ];
	}

	/**
	 * Registers all of the dependencies that are shared between all instances of the autoloader.
	 */
	private function register_shared_dependencies() {
		global $jetpack_autoloader_container_shared;
		if ( ! isset( $jetpack_autoloader_container_shared ) ) {
			$jetpack_autoloader_container_shared = array();
		}

		$key = self::SHARED_DEPENDENCY_KEYS[ Hook_Manager::class ];
		if ( ! isset( $jetpack_autoloader_container_shared[ $key ] ) ) {
			require_once __DIR__ . '/class-hook-manager.php';
			$jetpack_autoloader_container_shared[ $key ] = new Hook_Manager();
		}
		$this->dependencies[ Hook_Manager::class ] = &$jetpack_autoloader_container_shared[ $key ];
	}

	/**
	 * Registers all of the dependencies with the container.
	 */
	private function register_dependencies() {
		require_once __DIR__ . '/class-path-processor.php';
		$this->dependencies[ Path_Processor::class ] = new Path_Processor();

		require_once __DIR__ . '/class-plugin-locator.php';
		$this->dependencies[ Plugin_Locator::class ] = new Plugin_Locator(
			$this->get( Path_Processor::class )
		);

		require_once __DIR__ . '/class-version-selector.php';
		$this->dependencies[ Version_Selector::class ] = new Version_Selector();

		require_once __DIR__ . '/class-autoloader-locator.php';
		$this->dependencies[ Autoloader_Locator::class ] = new Autoloader_Locator(
			$this->get( Version_Selector::class )
		);

		require_once __DIR__ . '/class-php-autoloader.php';
		$this->dependencies[ PHP_Autoloader::class ] = new PHP_Autoloader();

		require_once __DIR__ . '/class-manifest-reader.php';
		$this->dependencies[ Manifest_Reader::class ] = new Manifest_Reader(
			$this->get( Version_Selector::class )
		);

		require_once __DIR__ . '/class-plugins-handler.php';
		$this->dependencies[ Plugins_Handler::class ] = new Plugins_Handler(
			$this->get( Plugin_Locator::class ),
			$this->get( Path_Processor::class )
		);

		require_once __DIR__ . '/class-autoloader-handler.php';
		$this->dependencies[ Autoloader_Handler::class ] = new Autoloader_Handler(
			$this->get( PHP_Autoloader::class ),
			$this->get( Hook_Manager::class ),
			$this->get( Manifest_Reader::class ),
			$this->get( Version_Selector::class )
		);

		require_once __DIR__ . '/class-latest-autoloader-guard.php';
		$this->dependencies[ Latest_Autoloader_Guard::class ] = new Latest_Autoloader_Guard(
			$this->get( Plugins_Handler::class ),
			$this->get( Autoloader_Handler::class ),
			$this->get( Autoloader_Locator::class )
		);

		// Register any classes that we will use elsewhere.
		require_once __DIR__ . '/class-version-loader.php';
		require_once __DIR__ . '/class-shutdown-handler.php';
	}

	/**
	 * Initializes any of the globals needed by the autoloader.
	 */
	private function initialize_globals() {
		/*
		 * This global was retired in version 2.9. The value is set to 'false' to maintain
		 * compatibility with older versions of the autoloader.
		 */
		global $jetpack_autoloader_including_latest;
		$jetpack_autoloader_including_latest = false;

		// Not all plugins can be found using the locator. In cases where a plugin loads the autoloader
		// but was not discoverable, we will record them in this array to track them as "active".
		global $jetpack_autoloader_activating_plugins_paths;
		if ( ! isset( $jetpack_autoloader_activating_plugins_paths ) ) {
			$jetpack_autoloader_activating_plugins_paths = array();
		}
	}
}
woocommerce-blocks/vendor/jetpack-autoloader/class-latest-autoloader-guard.php000064400000005364151335517640024000 0ustar00<?php
/**
 * This file was automatically generated by automattic/jetpack-autoloader.
 *
 * @package automattic/jetpack-autoloader
 */

namespace Automattic\Jetpack\Autoloader\jpb78ca910fe07339d6189615f1734a3e3;

 // phpcs:ignore

/**
 * This class ensures that we're only executing the latest autoloader.
 */
class Latest_Autoloader_Guard {

	/**
	 * The Plugins_Handler instance.
	 *
	 * @var Plugins_Handler
	 */
	private $plugins_handler;

	/**
	 * The Autoloader_Handler instance.
	 *
	 * @var Autoloader_Handler
	 */
	private $autoloader_handler;

	/**
	 * The Autoloader_locator instance.
	 *
	 * @var Autoloader_Locator
	 */
	private $autoloader_locator;

	/**
	 * The constructor.
	 *
	 * @param Plugins_Handler    $plugins_handler    The Plugins_Handler instance.
	 * @param Autoloader_Handler $autoloader_handler The Autoloader_Handler instance.
	 * @param Autoloader_Locator $autoloader_locator The Autoloader_Locator instance.
	 */
	public function __construct( $plugins_handler, $autoloader_handler, $autoloader_locator ) {
		$this->plugins_handler    = $plugins_handler;
		$this->autoloader_handler = $autoloader_handler;
		$this->autoloader_locator = $autoloader_locator;
	}

	/**
	 * Indicates whether or not the autoloader should be initialized. Note that this function
	 * has the side-effect of actually loading the latest autoloader in the event that this
	 * is not it.
	 *
	 * @param string   $current_plugin             The current plugin we're checking.
	 * @param string[] $plugins                    The active plugins to check for autoloaders in.
	 * @param bool     $was_included_by_autoloader Indicates whether or not this autoloader was included by another.
	 *
	 * @return bool True if we should stop initialization, otherwise false.
	 */
	public function should_stop_init( $current_plugin, $plugins, $was_included_by_autoloader ) {
		global $jetpack_autoloader_latest_version;

		// We need to reset the autoloader when the plugins change because
		// that means the autoloader was generated with a different list.
		if ( $this->plugins_handler->have_plugins_changed( $plugins ) ) {
			$this->autoloader_handler->reset_autoloader();
		}

		// When the latest autoloader has already been found we don't need to search for it again.
		// We should take care however because this will also trigger if the autoloader has been
		// included by an older one.
		if ( isset( $jetpack_autoloader_latest_version ) && ! $was_included_by_autoloader ) {
			return true;
		}

		$latest_plugin = $this->autoloader_locator->find_latest_autoloader( $plugins, $jetpack_autoloader_latest_version );
		if ( isset( $latest_plugin ) && $latest_plugin !== $current_plugin ) {
			require $this->autoloader_locator->get_autoloader_path( $latest_plugin );
			return true;
		}

		return false;
	}
}
woocommerce-blocks/vendor/jetpack-autoloader/class-autoloader.php000064400000010075151335517640021401 0ustar00<?php
/**
 * This file was automatically generated by automattic/jetpack-autoloader.
 *
 * @package automattic/jetpack-autoloader
 */

namespace Automattic\Jetpack\Autoloader\jpb78ca910fe07339d6189615f1734a3e3;

 // phpcs:ignore

/**
 * This class handles management of the actual PHP autoloader.
 */
class Autoloader {

	/**
	 * Checks to see whether or not the autoloader should be initialized and then initializes it if so.
	 *
	 * @param Container|null $container The container we want to use for autoloader initialization. If none is given
	 *                                  then a container will be created automatically.
	 */
	public static function init( $container = null ) {
		// The container holds and manages the lifecycle of our dependencies
		// to make them easier to work with and increase flexibility.
		if ( ! isset( $container ) ) {
			require_once __DIR__ . '/class-container.php';
			$container = new Container();
		}

		// phpcs:disable Generic.Commenting.DocComment.MissingShort

		/** @var Autoloader_Handler $autoloader_handler */
		$autoloader_handler = $container->get( Autoloader_Handler::class );

		// If the autoloader is already initializing it means that it has included us as the latest.
		$was_included_by_autoloader = $autoloader_handler->is_initializing();

		/** @var Plugin_Locator $plugin_locator */
		$plugin_locator = $container->get( Plugin_Locator::class );

		/** @var Plugins_Handler $plugins_handler */
		$plugins_handler = $container->get( Plugins_Handler::class );

		// The current plugin is the one that we are attempting to initialize here.
		$current_plugin = $plugin_locator->find_current_plugin();

		// The active plugins are those that we were able to discover on the site. This list will not
		// include mu-plugins, those activated by code, or those who are hidden by filtering. We also
		// want to take care to not consider the current plugin unknown if it was included by an
		// autoloader. This avoids the case where a plugin will be marked "active" while deactivated
		// due to it having the latest autoloader.
		$active_plugins = $plugins_handler->get_active_plugins( true, ! $was_included_by_autoloader );

		// The cached plugins are all of those that were active or discovered by the autoloader during a previous request.
		// Note that it's possible this list will include plugins that have since been deactivated, but after a request
		// the cache should be updated and the deactivated plugins will be removed.
		$cached_plugins = $plugins_handler->get_cached_plugins();

		// We combine the active list and cached list to preemptively load classes for plugins that are
		// presently unknown but will be loaded during the request. While this may result in us considering packages in
		// deactivated plugins there shouldn't be any problems as a result and the eventual consistency is sufficient.
		$all_plugins = array_merge( $active_plugins, $cached_plugins );

		// In particular we also include the current plugin to address the case where it is the latest autoloader
		// but also unknown (and not cached). We don't want it in the active list because we don't know that it
		// is active but we need it in the all plugins list so that it is considered by the autoloader.
		$all_plugins[] = $current_plugin;

		// We require uniqueness in the array to avoid processing the same plugin more than once.
		$all_plugins = array_values( array_unique( $all_plugins ) );

		/** @var Latest_Autoloader_Guard $guard */
		$guard = $container->get( Latest_Autoloader_Guard::class );
		if ( $guard->should_stop_init( $current_plugin, $all_plugins, $was_included_by_autoloader ) ) {
			return;
		}

		// Initialize the autoloader using the handler now that we're ready.
		$autoloader_handler->activate_autoloader( $all_plugins );

		/** @var Hook_Manager $hook_manager */
		$hook_manager = $container->get( Hook_Manager::class );

		// Register a shutdown handler to clean up the autoloader.
		$hook_manager->add_action( 'shutdown', new Shutdown_Handler( $plugins_handler, $cached_plugins, $was_included_by_autoloader ) );

		// phpcs:enable Generic.Commenting.DocComment.MissingShort
	}
}
woocommerce-blocks/vendor/jetpack-autoloader/class-php-autoloader.php000064400000005373151335517640022173 0ustar00<?php
/**
 * This file was automatically generated by automattic/jetpack-autoloader.
 *
 * @package automattic/jetpack-autoloader
 */

namespace Automattic\Jetpack\Autoloader\jpb78ca910fe07339d6189615f1734a3e3;

 // phpcs:ignore

/**
 * This class handles management of the actual PHP autoloader.
 */
class PHP_Autoloader {

	/**
	 * Registers the autoloader with PHP so that it can begin autoloading classes.
	 *
	 * @param Version_Loader $version_loader The class loader to use in the autoloader.
	 */
	public function register_autoloader( $version_loader ) {
		// Make sure no other autoloaders are registered.
		$this->unregister_autoloader();

		// Set the global so that it can be used to load classes.
		global $jetpack_autoloader_loader;
		$jetpack_autoloader_loader = $version_loader;

		// Ensure that the autoloader is first to avoid contention with others.
		spl_autoload_register( array( self::class, 'load_class' ), true, true );
	}

	/**
	 * Unregisters the active autoloader so that it will no longer autoload classes.
	 */
	public function unregister_autoloader() {
		// Remove any v2 autoloader that we've already registered.
		$autoload_chain = spl_autoload_functions();
		foreach ( $autoload_chain as $autoloader ) {
			// We can identify a v2 autoloader using the namespace.
			$namespace_check = null;

			// Functions are recorded as strings.
			if ( is_string( $autoloader ) ) {
				$namespace_check = $autoloader;
			} elseif ( is_array( $autoloader ) && is_string( $autoloader[0] ) ) {
				// Static method calls have the class as the first array element.
				$namespace_check = $autoloader[0];
			} else {
				// Since the autoloader has only ever been a function or a static method we don't currently need to check anything else.
				continue;
			}

			// Check for the namespace without the generated suffix.
			if ( 'Automattic\\Jetpack\\Autoloader\\jp' === substr( $namespace_check, 0, 32 ) ) {
				spl_autoload_unregister( $autoloader );
			}
		}

		// Clear the global now that the autoloader has been unregistered.
		global $jetpack_autoloader_loader;
		$jetpack_autoloader_loader = null;
	}

	/**
	 * Loads a class file if one could be found.
	 *
	 * Note: This function is static so that the autoloader can be easily unregistered. If
	 * it was a class method we would have to unwrap the object to check the namespace.
	 *
	 * @param string $class_name The name of the class to autoload.
	 *
	 * @return bool Indicates whether or not a class file was loaded.
	 */
	public static function load_class( $class_name ) {
		global $jetpack_autoloader_loader;
		if ( ! isset( $jetpack_autoloader_loader ) ) {
			return;
		}

		$file = $jetpack_autoloader_loader->find_class_file( $class_name );
		if ( ! isset( $file ) ) {
			return false;
		}

		require $file;
		return true;
	}
}
woocommerce-blocks/vendor/jetpack-autoloader/class-plugins-handler.php000064400000013373151335517640022342 0ustar00<?php
/**
 * This file was automatically generated by automattic/jetpack-autoloader.
 *
 * @package automattic/jetpack-autoloader
 */

namespace Automattic\Jetpack\Autoloader\jpb78ca910fe07339d6189615f1734a3e3;

 // phpcs:ignore

/**
 * This class handles locating and caching all of the active plugins.
 */
class Plugins_Handler {
	/**
	 * The transient key for plugin paths.
	 */
	const TRANSIENT_KEY = 'jetpack_autoloader_plugin_paths';

	/**
	 * The locator for finding plugins in different locations.
	 *
	 * @var Plugin_Locator
	 */
	private $plugin_locator;

	/**
	 * The processor for transforming cached paths.
	 *
	 * @var Path_Processor
	 */
	private $path_processor;

	/**
	 * The constructor.
	 *
	 * @param Plugin_Locator $plugin_locator The locator for finding active plugins.
	 * @param Path_Processor $path_processor The processor for transforming cached paths.
	 */
	public function __construct( $plugin_locator, $path_processor ) {
		$this->plugin_locator = $plugin_locator;
		$this->path_processor = $path_processor;
	}

	/**
	 * Gets all of the active plugins we can find.
	 *
	 * @param bool $include_deactivating When true, plugins deactivating this request will be considered active.
	 * @param bool $record_unknown When true, the current plugin will be marked as active and recorded when unknown.
	 *
	 * @return string[]
	 */
	public function get_active_plugins( $include_deactivating, $record_unknown ) {
		global $jetpack_autoloader_activating_plugins_paths;

		// We're going to build a unique list of plugins from a few different sources
		// to find all of our "active" plugins. While we need to return an integer
		// array, we're going to use an associative array internally to reduce
		// the amount of time that we're going to spend checking uniqueness
		// and merging different arrays together to form the output.
		$active_plugins = array();

		// Make sure that plugins which have activated this request are considered as "active" even though
		// they probably won't be present in any option.
		if ( is_array( $jetpack_autoloader_activating_plugins_paths ) ) {
			foreach ( $jetpack_autoloader_activating_plugins_paths as $path ) {
				$active_plugins[ $path ] = $path;
			}
		}

		// This option contains all of the plugins that have been activated.
		$plugins = $this->plugin_locator->find_using_option( 'active_plugins' );
		foreach ( $plugins as $path ) {
			$active_plugins[ $path ] = $path;
		}

		// This option contains all of the multisite plugins that have been activated.
		if ( is_multisite() ) {
			$plugins = $this->plugin_locator->find_using_option( 'active_sitewide_plugins', true );
			foreach ( $plugins as $path ) {
				$active_plugins[ $path ] = $path;
			}
		}

		// These actions contain plugins that are being activated/deactivated during this request.
		$plugins = $this->plugin_locator->find_using_request_action( array( 'activate', 'activate-selected', 'deactivate', 'deactivate-selected' ) );
		foreach ( $plugins as $path ) {
			$active_plugins[ $path ] = $path;
		}

		// When the current plugin isn't considered "active" there's a problem.
		// Since we're here, the plugin is active and currently being loaded.
		// We can support this case (mu-plugins and non-standard activation)
		// by adding the current plugin to the active list and marking it
		// as an unknown (activating) plugin. This also has the benefit
		// of causing a reset because the active plugins list has
		// been changed since it was saved in the global.
		$current_plugin = $this->plugin_locator->find_current_plugin();
		if ( $record_unknown && ! in_array( $current_plugin, $active_plugins, true ) ) {
			$active_plugins[ $current_plugin ]             = $current_plugin;
			$jetpack_autoloader_activating_plugins_paths[] = $current_plugin;
		}

		// When deactivating plugins aren't desired we should entirely remove them from the active list.
		if ( ! $include_deactivating ) {
			// These actions contain plugins that are being deactivated during this request.
			$plugins = $this->plugin_locator->find_using_request_action( array( 'deactivate', 'deactivate-selected' ) );
			foreach ( $plugins as $path ) {
				unset( $active_plugins[ $path ] );
			}
		}

		// Transform the array so that we don't have to worry about the keys interacting with other array types later.
		return array_values( $active_plugins );
	}

	/**
	 * Gets all of the cached plugins if there are any.
	 *
	 * @return string[]
	 */
	public function get_cached_plugins() {
		$cached = get_transient( self::TRANSIENT_KEY );
		if ( ! is_array( $cached ) || empty( $cached ) ) {
			return array();
		}

		// We need to expand the tokens to an absolute path for this webserver.
		return array_map( array( $this->path_processor, 'untokenize_path_constants' ), $cached );
	}

	/**
	 * Saves the plugin list to the cache.
	 *
	 * @param array $plugins The plugin list to save to the cache.
	 */
	public function cache_plugins( $plugins ) {
		// We store the paths in a tokenized form so that that webservers with different absolute paths don't break.
		$plugins = array_map( array( $this->path_processor, 'tokenize_path_constants' ), $plugins );

		set_transient( self::TRANSIENT_KEY, $plugins );
	}

	/**
	 * Checks to see whether or not the plugin list given has changed when compared to the
	 * shared `$jetpack_autoloader_cached_plugin_paths` global. This allows us to deal
	 * with cases where the active list may change due to filtering..
	 *
	 * @param string[] $plugins The plugins list to check against the global cache.
	 *
	 * @return bool True if the plugins have changed, otherwise false.
	 */
	public function have_plugins_changed( $plugins ) {
		global $jetpack_autoloader_cached_plugin_paths;

		if ( $jetpack_autoloader_cached_plugin_paths !== $plugins ) {
			$jetpack_autoloader_cached_plugin_paths = $plugins;
			return true;
		}

		return false;
	}
}
woocommerce-blocks/vendor/jetpack-autoloader/class-version-loader.php000064400000010166151335517640022174 0ustar00<?php
/**
 * This file was automatically generated by automattic/jetpack-autoloader.
 *
 * @package automattic/jetpack-autoloader
 */

namespace Automattic\Jetpack\Autoloader\jpb78ca910fe07339d6189615f1734a3e3;

 // phpcs:ignore

/**
 * This class loads other classes based on given parameters.
 */
class Version_Loader {

	/**
	 * The Version_Selector object.
	 *
	 * @var Version_Selector
	 */
	private $version_selector;

	/**
	 * A map of available classes and their version and file path.
	 *
	 * @var array
	 */
	private $classmap;

	/**
	 * A map of PSR-4 namespaces and their version and directory path.
	 *
	 * @var array
	 */
	private $psr4_map;

	/**
	 * A map of all the files that we should load.
	 *
	 * @var array
	 */
	private $filemap;

	/**
	 * The constructor.
	 *
	 * @param Version_Selector $version_selector The Version_Selector object.
	 * @param array            $classmap The verioned classmap to load using.
	 * @param array            $psr4_map The versioned PSR-4 map to load using.
	 * @param array            $filemap The versioned filemap to load.
	 */
	public function __construct( $version_selector, $classmap, $psr4_map, $filemap ) {
		$this->version_selector = $version_selector;
		$this->classmap         = $classmap;
		$this->psr4_map         = $psr4_map;
		$this->filemap          = $filemap;
	}

	/**
	 * Finds the file path for the given class.
	 *
	 * @param string $class_name The class to find.
	 *
	 * @return string|null $file_path The path to the file if found, null if no class was found.
	 */
	public function find_class_file( $class_name ) {
		$data = $this->select_newest_file(
			isset( $this->classmap[ $class_name ] ) ? $this->classmap[ $class_name ] : null,
			$this->find_psr4_file( $class_name )
		);
		if ( ! isset( $data ) ) {
			return null;
		}

		return $data['path'];
	}

	/**
	 * Load all of the files in the filemap.
	 */
	public function load_filemap() {
		if ( empty( $this->filemap ) ) {
			return;
		}

		foreach ( $this->filemap as $file_identifier => $file_data ) {
			if ( empty( $GLOBALS['__composer_autoload_files'][ $file_identifier ] ) ) {
				require_once $file_data['path'];

				$GLOBALS['__composer_autoload_files'][ $file_identifier ] = true;
			}
		}
	}

	/**
	 * Compares different class sources and returns the newest.
	 *
	 * @param array|null $classmap_data The classmap class data.
	 * @param array|null $psr4_data The PSR-4 class data.
	 *
	 * @return array|null $data
	 */
	private function select_newest_file( $classmap_data, $psr4_data ) {
		if ( ! isset( $classmap_data ) ) {
			return $psr4_data;
		} elseif ( ! isset( $psr4_data ) ) {
			return $classmap_data;
		}

		if ( $this->version_selector->is_version_update_required( $classmap_data['version'], $psr4_data['version'] ) ) {
			return $psr4_data;
		}

		return $classmap_data;
	}

	/**
	 * Finds the file for a given class in a PSR-4 namespace.
	 *
	 * @param string $class_name The class to find.
	 *
	 * @return array|null $data The version and path path to the file if found, null otherwise.
	 */
	private function find_psr4_file( $class_name ) {
		if ( ! isset( $this->psr4_map ) ) {
			return null;
		}

		// Don't bother with classes that have no namespace.
		$class_index = strrpos( $class_name, '\\' );
		if ( ! $class_index ) {
			return null;
		}
		$class_for_path = str_replace( '\\', '/', $class_name );

		// Search for the namespace by iteratively cutting off the last segment until
		// we find a match. This allows us to check the most-specific namespaces
		// first as well as minimize the amount of time spent looking.
		for (
			$class_namespace = substr( $class_name, 0, $class_index );
			! empty( $class_namespace );
			$class_namespace = substr( $class_namespace, 0, strrpos( $class_namespace, '\\' ) )
		) {
			$namespace = $class_namespace . '\\';
			if ( ! isset( $this->psr4_map[ $namespace ] ) ) {
				continue;
			}
			$data = $this->psr4_map[ $namespace ];

			foreach ( $data['path'] as $path ) {
				$path .= '/' . substr( $class_for_path, strlen( $namespace ) ) . '.php';
				if ( file_exists( $path ) ) {
					return array(
						'version' => $data['version'],
						'path'    => $path,
					);
				}
			}
		}

		return null;
	}
}
woocommerce-blocks/vendor/jetpack-autoloader/class-autoloader-locator.php000064400000004120151335517640023034 0ustar00<?php
/**
 * This file was automatically generated by automattic/jetpack-autoloader.
 *
 * @package automattic/jetpack-autoloader
 */

namespace Automattic\Jetpack\Autoloader\jpb78ca910fe07339d6189615f1734a3e3;

 // phpcs:ignore

use Automattic\Jetpack\Autoloader\AutoloadGenerator;

/**
 * This class locates autoloaders.
 */
class Autoloader_Locator {

	/**
	 * The object for comparing autoloader versions.
	 *
	 * @var Version_Selector
	 */
	private $version_selector;

	/**
	 * The constructor.
	 *
	 * @param Version_Selector $version_selector The version selector object.
	 */
	public function __construct( $version_selector ) {
		$this->version_selector = $version_selector;
	}

	/**
	 * Finds the path to the plugin with the latest autoloader.
	 *
	 * @param array  $plugin_paths An array of plugin paths.
	 * @param string $latest_version The latest version reference.
	 *
	 * @return string|null
	 */
	public function find_latest_autoloader( $plugin_paths, &$latest_version ) {
		$latest_plugin = null;

		foreach ( $plugin_paths as $plugin_path ) {
			$version = $this->get_autoloader_version( $plugin_path );
			if ( ! $this->version_selector->is_version_update_required( $latest_version, $version ) ) {
				continue;
			}

			$latest_version = $version;
			$latest_plugin  = $plugin_path;
		}

		return $latest_plugin;
	}

	/**
	 * Gets the path to the autoloader.
	 *
	 * @param string $plugin_path The path to the plugin.
	 *
	 * @return string
	 */
	public function get_autoloader_path( $plugin_path ) {
		return trailingslashit( $plugin_path ) . 'vendor/autoload_packages.php';
	}

	/**
	 * Gets the version for the autoloader.
	 *
	 * @param string $plugin_path The path to the plugin.
	 *
	 * @return string|null
	 */
	public function get_autoloader_version( $plugin_path ) {
		$classmap = trailingslashit( $plugin_path ) . 'vendor/composer/jetpack_autoload_classmap.php';
		if ( ! file_exists( $classmap ) ) {
			return null;
		}

		$classmap = require $classmap;
		if ( isset( $classmap[ AutoloadGenerator::class ] ) ) {
			return $classmap[ AutoloadGenerator::class ]['version'];
		}

		return null;
	}
}
woocommerce-blocks/vendor/jetpack-autoloader/class-shutdown-handler.php000064400000005505151335517640022532 0ustar00<?php
/**
 * This file was automatically generated by automattic/jetpack-autoloader.
 *
 * @package automattic/jetpack-autoloader
 */

namespace Automattic\Jetpack\Autoloader\jpb78ca910fe07339d6189615f1734a3e3;

 // phpcs:ignore

/**
 * This class handles the shutdown of the autoloader.
 */
class Shutdown_Handler {

	/**
	 * The Plugins_Handler instance.
	 *
	 * @var Plugins_Handler
	 */
	private $plugins_handler;

	/**
	 * The plugins cached by this autoloader.
	 *
	 * @var string[]
	 */
	private $cached_plugins;

	/**
	 * Indicates whether or not this autoloader was included by another.
	 *
	 * @var bool
	 */
	private $was_included_by_autoloader;

	/**
	 * Constructor.
	 *
	 * @param Plugins_Handler $plugins_handler The Plugins_Handler instance to use.
	 * @param string[]        $cached_plugins The plugins cached by the autoloaer.
	 * @param bool            $was_included_by_autoloader Indicates whether or not the autoloader was included by another.
	 */
	public function __construct( $plugins_handler, $cached_plugins, $was_included_by_autoloader ) {
		$this->plugins_handler            = $plugins_handler;
		$this->cached_plugins             = $cached_plugins;
		$this->was_included_by_autoloader = $was_included_by_autoloader;
	}

	/**
	 * Handles the shutdown of the autoloader.
	 */
	public function __invoke() {
		// Don't save a broken cache if an error happens during some plugin's initialization.
		if ( ! did_action( 'plugins_loaded' ) ) {
			// Ensure that the cache is emptied to prevent consecutive failures if the cache is to blame.
			if ( ! empty( $this->cached_plugins ) ) {
				$this->plugins_handler->cache_plugins( array() );
			}

			return;
		}

		// Load the active plugins fresh since the list we pulled earlier might not contain
		// plugins that were activated but did not reset the autoloader. This happens
		// when a plugin is in the cache but not "active" when the autoloader loads.
		// We also want to make sure that plugins which are deactivating are not
		// considered "active" so that they will be removed from the cache now.
		try {
			$active_plugins = $this->plugins_handler->get_active_plugins( false, ! $this->was_included_by_autoloader );
		} catch ( \Exception $ex ) {
			// When the package is deleted before shutdown it will throw an exception.
			// In the event this happens we should erase the cache.
			if ( ! empty( $this->cached_plugins ) ) {
				$this->plugins_handler->cache_plugins( array() );
			}
			return;
		}

		// The paths should be sorted for easy comparisons with those loaded from the cache.
		// Note we don't need to sort the cached entries because they're already sorted.
		sort( $active_plugins );

		// We don't want to waste time saving a cache that hasn't changed.
		if ( $this->cached_plugins === $active_plugins ) {
			return;
		}

		$this->plugins_handler->cache_plugins( $active_plugins );
	}
}
woocommerce-blocks/vendor/jetpack-autoloader/class-manifest-reader.php000064400000005175151335517640022315 0ustar00<?php
/**
 * This file was automatically generated by automattic/jetpack-autoloader.
 *
 * @package automattic/jetpack-autoloader
 */

namespace Automattic\Jetpack\Autoloader\jpb78ca910fe07339d6189615f1734a3e3;

 // phpcs:ignore

/**
 * This class reads autoloader manifest files.
 */
class Manifest_Reader {

	/**
	 * The Version_Selector object.
	 *
	 * @var Version_Selector
	 */
	private $version_selector;

	/**
	 * The constructor.
	 *
	 * @param Version_Selector $version_selector The Version_Selector object.
	 */
	public function __construct( $version_selector ) {
		$this->version_selector = $version_selector;
	}

	/**
	 * Reads all of the manifests in the given plugin paths.
	 *
	 * @param array  $plugin_paths  The paths to the plugins we're loading the manifest in.
	 * @param string $manifest_path The path that we're loading the manifest from in each plugin.
	 * @param array  $path_map The path map to add the contents of the manifests to.
	 *
	 * @return array $path_map The path map we've built using the manifests in each plugin.
	 */
	public function read_manifests( $plugin_paths, $manifest_path, &$path_map ) {
		$file_paths = array_map(
			function ( $path ) use ( $manifest_path ) {
				return trailingslashit( $path ) . $manifest_path;
			},
			$plugin_paths
		);

		foreach ( $file_paths as $path ) {
			$this->register_manifest( $path, $path_map );
		}

		return $path_map;
	}

	/**
	 * Registers a plugin's manifest file with the path map.
	 *
	 * @param string $manifest_path The absolute path to the manifest that we're loading.
	 * @param array  $path_map The path map to add the contents of the manifest to.
	 */
	protected function register_manifest( $manifest_path, &$path_map ) {
		if ( ! is_readable( $manifest_path ) ) {
			return;
		}

		$manifest = require $manifest_path;
		if ( ! is_array( $manifest ) ) {
			return;
		}

		foreach ( $manifest as $key => $data ) {
			$this->register_record( $key, $data, $path_map );
		}
	}

	/**
	 * Registers an entry from the manifest in the path map.
	 *
	 * @param string $key The identifier for the entry we're registering.
	 * @param array  $data The data for the entry we're registering.
	 * @param array  $path_map The path map to add the contents of the manifest to.
	 */
	protected function register_record( $key, $data, &$path_map ) {
		if ( isset( $path_map[ $key ]['version'] ) ) {
			$selected_version = $path_map[ $key ]['version'];
		} else {
			$selected_version = null;
		}

		if ( $this->version_selector->is_version_update_required( $selected_version, $data['version'] ) ) {
			$path_map[ $key ] = array(
				'version' => $data['version'],
				'path'    => $data['path'],
			);
		}
	}
}
woocommerce-blocks/vendor/jetpack-autoloader/class-path-processor.php000064400000013061151335517640022211 0ustar00<?php
/**
 * This file was automatically generated by automattic/jetpack-autoloader.
 *
 * @package automattic/jetpack-autoloader
 */

namespace Automattic\Jetpack\Autoloader\jpb78ca910fe07339d6189615f1734a3e3;

 // phpcs:ignore

/**
 * This class handles dealing with paths for the autoloader.
 */
class Path_Processor {
	/**
	 * Given a path this will replace any of the path constants with a token to represent it.
	 *
	 * @param string $path The path we want to process.
	 *
	 * @return string The tokenized path.
	 */
	public function tokenize_path_constants( $path ) {
		$path = wp_normalize_path( $path );

		$constants = $this->get_normalized_constants();
		foreach ( $constants as $constant => $constant_path ) {
			$len = strlen( $constant_path );
			if ( substr( $path, 0, $len ) !== $constant_path ) {
				continue;
			}

			return substr_replace( $path, '{{' . $constant . '}}', 0, $len );
		}

		return $path;
	}

	/**
	 * Given a path this will replace any of the path constant tokens with the expanded path.
	 *
	 * @param string $tokenized_path The path we want to process.
	 *
	 * @return string The expanded path.
	 */
	public function untokenize_path_constants( $tokenized_path ) {
		$tokenized_path = wp_normalize_path( $tokenized_path );

		$constants = $this->get_normalized_constants();
		foreach ( $constants as $constant => $constant_path ) {
			$constant = '{{' . $constant . '}}';

			$len = strlen( $constant );
			if ( substr( $tokenized_path, 0, $len ) !== $constant ) {
				continue;
			}

			return $this->get_real_path( substr_replace( $tokenized_path, $constant_path, 0, $len ) );
		}

		return $tokenized_path;
	}

	/**
	 * Given a file and an array of places it might be, this will find the absolute path and return it.
	 *
	 * @param string $file The plugin or theme file to resolve.
	 * @param array  $directories_to_check The directories we should check for the file if it isn't an absolute path.
	 *
	 * @return string|false Returns the absolute path to the directory, otherwise false.
	 */
	public function find_directory_with_autoloader( $file, $directories_to_check ) {
		$file = wp_normalize_path( $file );

		if ( ! $this->is_absolute_path( $file ) ) {
			$file = $this->find_absolute_plugin_path( $file, $directories_to_check );
			if ( ! isset( $file ) ) {
				return false;
			}
		}

		// We need the real path for consistency with __DIR__ paths.
		$file = $this->get_real_path( $file );

		// phpcs:disable WordPress.PHP.NoSilencedErrors.Discouraged
		$directory = @is_file( $file ) ? dirname( $file ) : $file;
		if ( ! @is_file( $directory . '/vendor/composer/jetpack_autoload_classmap.php' ) ) {
			return false;
		}
		// phpcs:enable WordPress.PHP.NoSilencedErrors.Discouraged

		return $directory;
	}

	/**
	 * Fetches an array of normalized paths keyed by the constant they came from.
	 *
	 * @return string[] The normalized paths keyed by the constant.
	 */
	private function get_normalized_constants() {
		$raw_constants = array(
			// Order the constants from most-specific to least-specific.
			'WP_PLUGIN_DIR',
			'WPMU_PLUGIN_DIR',
			'WP_CONTENT_DIR',
			'ABSPATH',
		);

		$constants = array();
		foreach ( $raw_constants as $raw ) {
			if ( ! defined( $raw ) ) {
				continue;
			}

			$path = wp_normalize_path( constant( $raw ) );
			if ( isset( $path ) ) {
				$constants[ $raw ] = $path;
			}
		}

		return $constants;
	}

	/**
	 * Indicates whether or not a path is absolute.
	 *
	 * @param string $path The path to check.
	 *
	 * @return bool True if the path is absolute, otherwise false.
	 */
	private function is_absolute_path( $path ) {
		if ( 0 === strlen( $path ) || '.' === $path[0] ) {
			return false;
		}

		// Absolute paths on Windows may begin with a drive letter.
		if ( preg_match( '/^[a-zA-Z]:[\/\\\\]/', $path ) ) {
			return true;
		}

		// A path starting with / or \ is absolute; anything else is relative.
		return ( '/' === $path[0] || '\\' === $path[0] );
	}

	/**
	 * Given a file and a list of directories to check, this method will try to figure out
	 * the absolute path to the file in question.
	 *
	 * @param string $normalized_path The normalized path to the plugin or theme file to resolve.
	 * @param array  $directories_to_check The directories we should check for the file if it isn't an absolute path.
	 *
	 * @return string|null The absolute path to the plugin file, otherwise null.
	 */
	private function find_absolute_plugin_path( $normalized_path, $directories_to_check ) {
		// We're only able to find the absolute path for plugin/theme PHP files.
		if ( ! is_string( $normalized_path ) || '.php' !== substr( $normalized_path, -4 ) ) {
			return null;
		}

		foreach ( $directories_to_check as $directory ) {
			$normalized_check = wp_normalize_path( trailingslashit( $directory ) ) . $normalized_path;
			// phpcs:ignore WordPress.PHP.NoSilencedErrors.Discouraged
			if ( @is_file( $normalized_check ) ) {
				return $normalized_check;
			}
		}

		return null;
	}

	/**
	 * Given a path this will figure out the real path that we should be using.
	 *
	 * @param string $path The path to resolve.
	 *
	 * @return string The resolved path.
	 */
	private function get_real_path( $path ) {
		// We want to resolve symbolic links for consistency with __DIR__ paths.
		// phpcs:ignore WordPress.PHP.NoSilencedErrors.Discouraged
		$real_path = @realpath( $path );
		if ( false === $real_path ) {
			// Let the autoloader deal with paths that don't exist.
			$real_path = $path;
		}

		// Using realpath will make it platform-specific so we must normalize it after.
		if ( $path !== $real_path ) {
			$real_path = wp_normalize_path( $real_path );
		}

		return $real_path;
	}
}
woocommerce-blocks/vendor/jetpack-autoloader/class-hook-manager.php000064400000004145151335517640021613 0ustar00<?php
/**
 * This file was automatically generated by automattic/jetpack-autoloader.
 *
 * @package automattic/jetpack-autoloader
 */

namespace Automattic\Jetpack\Autoloader\jpb78ca910fe07339d6189615f1734a3e3;

 // phpcs:ignore

/**
 * Allows the latest autoloader to register hooks that can be removed when the autoloader is reset.
 */
class Hook_Manager {

	/**
	 * An array containing all of the hooks that we've registered.
	 *
	 * @var array
	 */
	private $registered_hooks;

	/**
	 * The constructor.
	 */
	public function __construct() {
		$this->registered_hooks = array();
	}

	/**
	 * Adds an action to WordPress and registers it internally.
	 *
	 * @param string   $tag           The name of the action which is hooked.
	 * @param callable $callable      The function to call.
	 * @param int      $priority      Used to specify the priority of the action.
	 * @param int      $accepted_args Used to specify the number of arguments the callable accepts.
	 */
	public function add_action( $tag, $callable, $priority = 10, $accepted_args = 1 ) {
		$this->registered_hooks[ $tag ][] = array(
			'priority' => $priority,
			'callable' => $callable,
		);

		add_action( $tag, $callable, $priority, $accepted_args );
	}

	/**
	 * Adds a filter to WordPress and registers it internally.
	 *
	 * @param string   $tag           The name of the filter which is hooked.
	 * @param callable $callable      The function to call.
	 * @param int      $priority      Used to specify the priority of the filter.
	 * @param int      $accepted_args Used to specify the number of arguments the callable accepts.
	 */
	public function add_filter( $tag, $callable, $priority = 10, $accepted_args = 1 ) {
		$this->registered_hooks[ $tag ][] = array(
			'priority' => $priority,
			'callable' => $callable,
		);

		add_filter( $tag, $callable, $priority, $accepted_args );
	}

	/**
	 * Removes all of the registered hooks.
	 */
	public function reset() {
		foreach ( $this->registered_hooks as $tag => $hooks ) {
			foreach ( $hooks as $hook ) {
				remove_filter( $tag, $hook['callable'], $hook['priority'] );
			}
		}
		$this->registered_hooks = array();
	}
}
woocommerce-blocks/vendor/jetpack-autoloader/class-version-selector.php000064400000003467151335517640022554 0ustar00<?php
/**
 * This file was automatically generated by automattic/jetpack-autoloader.
 *
 * @package automattic/jetpack-autoloader
 */

namespace Automattic\Jetpack\Autoloader\jpb78ca910fe07339d6189615f1734a3e3;

 // phpcs:ignore

/**
 * Used to select package versions.
 */
class Version_Selector {

	/**
	 * Checks whether the selected package version should be updated. Composer development
	 * package versions ('9999999-dev' or versions that start with 'dev-') are favored
	 * when the JETPACK_AUTOLOAD_DEV constant is set to true.
	 *
	 * @param String $selected_version The currently selected package version.
	 * @param String $compare_version The package version that is being evaluated to
	 *                                determine if the version needs to be updated.
	 *
	 * @return bool Returns true if the selected package version should be updated,
	 *                 else false.
	 */
	public function is_version_update_required( $selected_version, $compare_version ) {
		$use_dev_versions = defined( 'JETPACK_AUTOLOAD_DEV' ) && JETPACK_AUTOLOAD_DEV;

		if ( is_null( $selected_version ) ) {
			return true;
		}

		if ( $use_dev_versions && $this->is_dev_version( $selected_version ) ) {
			return false;
		}

		if ( $this->is_dev_version( $compare_version ) ) {
			if ( $use_dev_versions ) {
				return true;
			} else {
				return false;
			}
		}

		if ( version_compare( $selected_version, $compare_version, '<' ) ) {
			return true;
		}

		return false;
	}

	/**
	 * Checks whether the given package version is a development version.
	 *
	 * @param String $version The package version.
	 *
	 * @return bool True if the version is a dev version, else false.
	 */
	public function is_dev_version( $version ) {
		if ( 'dev-' === substr( $version, 0, 4 ) || '9999999-dev' === $version ) {
			return true;
		}

		return false;
	}
}
woocommerce-blocks/vendor/jetpack-autoloader/class-plugin-locator.php000064400000010476151335517640022206 0ustar00<?php
/**
 * This file was automatically generated by automattic/jetpack-autoloader.
 *
 * @package automattic/jetpack-autoloader
 */

namespace Automattic\Jetpack\Autoloader\jpb78ca910fe07339d6189615f1734a3e3;

 // phpcs:ignore

/**
 * This class scans the WordPress installation to find active plugins.
 */
class Plugin_Locator {

	/**
	 * The path processor for finding plugin paths.
	 *
	 * @var Path_Processor
	 */
	private $path_processor;

	/**
	 * The constructor.
	 *
	 * @param Path_Processor $path_processor The Path_Processor instance.
	 */
	public function __construct( $path_processor ) {
		$this->path_processor = $path_processor;
	}

	/**
	 * Finds the path to the current plugin.
	 *
	 * @return string $path The path to the current plugin.
	 *
	 * @throws \RuntimeException If the current plugin does not have an autoloader.
	 */
	public function find_current_plugin() {
		// Escape from `vendor/__DIR__` to root plugin directory.
		$plugin_directory = dirname( dirname( __DIR__ ) );

		// Use the path processor to ensure that this is an autoloader we're referencing.
		$path = $this->path_processor->find_directory_with_autoloader( $plugin_directory, array() );
		if ( false === $path ) {
			throw new \RuntimeException( 'Failed to locate plugin ' . $plugin_directory );
		}

		return $path;
	}

	/**
	 * Checks a given option for plugin paths.
	 *
	 * @param string $option_name  The option that we want to check for plugin information.
	 * @param bool   $site_option  Indicates whether or not we want to check the site option.
	 *
	 * @return array $plugin_paths The list of absolute paths we've found.
	 */
	public function find_using_option( $option_name, $site_option = false ) {
		$raw = $site_option ? get_site_option( $option_name ) : get_option( $option_name );
		if ( false === $raw ) {
			return array();
		}

		return $this->convert_plugins_to_paths( $raw );
	}

	/**
	 * Checks for plugins in the `action` request parameter.
	 *
	 * @param string[] $allowed_actions The actions that we're allowed to return plugins for.
	 *
	 * @return array $plugin_paths The list of absolute paths we've found.
	 */
	public function find_using_request_action( $allowed_actions ) {
		// phpcs:disable WordPress.Security.NonceVerification.Recommended

		/**
		 * Note: we're not actually checking the nonce here because it's too early
		 * in the execution. The pluggable functions are not yet loaded to give
		 * plugins a chance to plug their versions. Therefore we're doing the bare
		 * minimum: checking whether the nonce exists and it's in the right place.
		 * The request will fail later if the nonce doesn't pass the check.
		 */
		if ( empty( $_REQUEST['_wpnonce'] ) ) {
			return array();
		}

		$action = isset( $_REQUEST['action'] ) ? wp_unslash( $_REQUEST['action'] ) : false;
		if ( ! in_array( $action, $allowed_actions, true ) ) {
			return array();
		}

		$plugin_slugs = array();
		switch ( $action ) {
			case 'activate':
			case 'deactivate':
				if ( empty( $_REQUEST['plugin'] ) ) {
					break;
				}

				$plugin_slugs[] = wp_unslash( $_REQUEST['plugin'] );
				break;

			case 'activate-selected':
			case 'deactivate-selected':
				if ( empty( $_REQUEST['checked'] ) ) {
					break;
				}

				$plugin_slugs = wp_unslash( $_REQUEST['checked'] );
				break;
		}

		// phpcs:enable WordPress.Security.NonceVerification.Recommended
		return $this->convert_plugins_to_paths( $plugin_slugs );
	}

	/**
	 * Given an array of plugin slugs or paths, this will convert them to absolute paths and filter
	 * out the plugins that are not directory plugins. Note that array keys will also be included
	 * if they are plugin paths!
	 *
	 * @param string[] $plugins Plugin paths or slugs to filter.
	 *
	 * @return string[]
	 */
	private function convert_plugins_to_paths( $plugins ) {
		if ( ! is_array( $plugins ) || empty( $plugins ) ) {
			return array();
		}

		// We're going to look for plugins in the standard directories.
		$path_constants = array( WP_PLUGIN_DIR, WPMU_PLUGIN_DIR );

		$plugin_paths = array();
		foreach ( $plugins as $key => $value ) {
			$path = $this->path_processor->find_directory_with_autoloader( $key, $path_constants );
			if ( $path ) {
				$plugin_paths[] = $path;
			}

			$path = $this->path_processor->find_directory_with_autoloader( $value, $path_constants );
			if ( $path ) {
				$plugin_paths[] = $path;
			}
		}

		return $plugin_paths;
	}
}
woocommerce-blocks/vendor/jetpack-autoloader/class-autoloader-handler.php000064400000010767151335517640023024 0ustar00<?php
/**
 * This file was automatically generated by automattic/jetpack-autoloader.
 *
 * @package automattic/jetpack-autoloader
 */

namespace Automattic\Jetpack\Autoloader\jpb78ca910fe07339d6189615f1734a3e3;

 // phpcs:ignore

use Automattic\Jetpack\Autoloader\AutoloadGenerator;

/**
 * This class selects the package version for the autoloader.
 */
class Autoloader_Handler {

	/**
	 * The PHP_Autoloader instance.
	 *
	 * @var PHP_Autoloader
	 */
	private $php_autoloader;

	/**
	 * The Hook_Manager instance.
	 *
	 * @var Hook_Manager
	 */
	private $hook_manager;

	/**
	 * The Manifest_Reader instance.
	 *
	 * @var Manifest_Reader
	 */
	private $manifest_reader;

	/**
	 * The Version_Selector instance.
	 *
	 * @var Version_Selector
	 */
	private $version_selector;

	/**
	 * The constructor.
	 *
	 * @param PHP_Autoloader   $php_autoloader The PHP_Autoloader instance.
	 * @param Hook_Manager     $hook_manager The Hook_Manager instance.
	 * @param Manifest_Reader  $manifest_reader The Manifest_Reader instance.
	 * @param Version_Selector $version_selector The Version_Selector instance.
	 */
	public function __construct( $php_autoloader, $hook_manager, $manifest_reader, $version_selector ) {
		$this->php_autoloader   = $php_autoloader;
		$this->hook_manager     = $hook_manager;
		$this->manifest_reader  = $manifest_reader;
		$this->version_selector = $version_selector;
	}

	/**
	 * Checks to see whether or not an autoloader is currently in the process of initializing.
	 *
	 * @return bool
	 */
	public function is_initializing() {
		// If no version has been set it means that no autoloader has started initializing yet.
		global $jetpack_autoloader_latest_version;
		if ( ! isset( $jetpack_autoloader_latest_version ) ) {
			return false;
		}

		// When the version is set but the classmap is not it ALWAYS means that this is the
		// latest autoloader and is being included by an older one.
		global $jetpack_packages_classmap;
		if ( empty( $jetpack_packages_classmap ) ) {
			return true;
		}

		// Version 2.4.0 added a new global and altered the reset semantics. We need to check
		// the other global as well since it may also point at initialization.
		// Note: We don't need to check for the class first because every autoloader that
		// will set the latest version global requires this class in the classmap.
		$replacing_version = $jetpack_packages_classmap[ AutoloadGenerator::class ]['version'];
		if ( $this->version_selector->is_dev_version( $replacing_version ) || version_compare( $replacing_version, '2.4.0.0', '>=' ) ) {
			global $jetpack_autoloader_loader;
			if ( ! isset( $jetpack_autoloader_loader ) ) {
				return true;
			}
		}

		return false;
	}

	/**
	 * Activates an autoloader using the given plugins and activates it.
	 *
	 * @param string[] $plugins The plugins to initialize the autoloader for.
	 */
	public function activate_autoloader( $plugins ) {
		global $jetpack_packages_psr4;
		$jetpack_packages_psr4 = array();
		$this->manifest_reader->read_manifests( $plugins, 'vendor/composer/jetpack_autoload_psr4.php', $jetpack_packages_psr4 );

		global $jetpack_packages_classmap;
		$jetpack_packages_classmap = array();
		$this->manifest_reader->read_manifests( $plugins, 'vendor/composer/jetpack_autoload_classmap.php', $jetpack_packages_classmap );

		global $jetpack_packages_filemap;
		$jetpack_packages_filemap = array();
		$this->manifest_reader->read_manifests( $plugins, 'vendor/composer/jetpack_autoload_filemap.php', $jetpack_packages_filemap );

		$loader = new Version_Loader(
			$this->version_selector,
			$jetpack_packages_classmap,
			$jetpack_packages_psr4,
			$jetpack_packages_filemap
		);

		$this->php_autoloader->register_autoloader( $loader );

		// Now that the autoloader is active we can load the filemap.
		$loader->load_filemap();
	}

	/**
	 * Resets the active autoloader and all related global state.
	 */
	public function reset_autoloader() {
		$this->php_autoloader->unregister_autoloader();
		$this->hook_manager->reset();

		// Clear all of the autoloader globals so that older autoloaders don't do anything strange.
		global $jetpack_autoloader_latest_version;
		$jetpack_autoloader_latest_version = null;

		global $jetpack_packages_classmap;
		$jetpack_packages_classmap = array(); // Must be array to avoid exceptions in old autoloaders!

		global $jetpack_packages_psr4;
		$jetpack_packages_psr4 = array(); // Must be array to avoid exceptions in old autoloaders!

		global $jetpack_packages_filemap;
		$jetpack_packages_filemap = array(); // Must be array to avoid exceptions in old autoloaders!
	}
}
woocommerce-blocks/vendor/autoload.php000064400000000262151335517640014166 0ustar00<?php

// autoload.php @generated by Composer

require_once __DIR__ . '/composer/autoload_real.php';

return ComposerAutoloaderInitb78ca910fe07339d6189615f1734a3e3::getLoader();
woocommerce-blocks/packages/checkout/style.scss000064400000000030151335517640015761 0ustar00/* stylelint-disable */
woocommerce-blocks/packages/checkout/totals/index.js000064400000000304151335517640016703 0ustar00export { default as TotalsItem } from './item';
export { default as Subtotal } from './subtotal';
export { default as TotalsTaxes } from './taxes';
export { default as TotalsFees } from './fees';
woocommerce-blocks/packages/checkout/totals/item/style.scss000064400000000610151335517640020231 0ustar00.wc-block-components-totals-item {
	display: flex;
	flex-wrap: wrap;
	margin: em($gap-small) 0 0;
	width: 100%;

	&:first-child {
		margin-top: 0;
	}
}

.wc-block-components-totals-item__label {
	flex-grow: 1;
}

.wc-block-components-totals-item__value {
	font-weight: bold;
	white-space: nowrap;
}

.wc-block-components-totals-item__description {
	@include font-size(small);
	width: 100%;
}
woocommerce-blocks/packages/checkout/totals/item/index.tsx000064400000003044151335517640020047 0ustar00/**
 * External dependencies
 */
import classnames from 'classnames';
import { isValidElement } from '@wordpress/element';
import FormattedMonetaryAmount from '@woocommerce/base-components/formatted-monetary-amount';
import type { ReactElement, ReactNode } from 'react';
import type { Currency } from '@woocommerce/price-format';

/**
 * Internal dependencies
 */
import './style.scss';

interface TotalsItemProps {
	className?: string;
	currency: Currency;
	label: string;
	// Value may be a number, or react node. Numbers are passed to FormattedMonetaryAmount.
	value: number | ReactNode;
	description?: ReactNode;
}

const TotalsItemValue = ( {
	value,
	currency,
}: Partial< TotalsItemProps > ): ReactElement | null => {
	if ( isValidElement( value ) ) {
		return (
			<div className="wc-block-components-totals-item__value">
				{ value }
			</div>
		);
	}

	return Number.isFinite( value ) ? (
		<FormattedMonetaryAmount
			className="wc-block-components-totals-item__value"
			currency={ currency || {} }
			value={ value as number }
		/>
	) : null;
};

const TotalsItem = ( {
	className,
	currency,
	label,
	value,
	description,
}: TotalsItemProps ): ReactElement => {
	return (
		<div
			className={ classnames(
				'wc-block-components-totals-item',
				className
			) }
		>
			<span className="wc-block-components-totals-item__label">
				{ label }
			</span>
			<TotalsItemValue value={ value } currency={ currency } />
			<div className="wc-block-components-totals-item__description">
				{ description }
			</div>
		</div>
	);
};

export default TotalsItem;
woocommerce-blocks/packages/checkout/totals/item/stories/index.js000064400000001253151335517640021335 0ustar00/**
 * External dependencies
 */
import { text } from '@storybook/addon-knobs';
import { currencyKnob } from '@woocommerce/knobs';

/**
 * Internal dependencies
 */
import TotalsItem from '../';

export default {
	title: 'WooCommerce Blocks/@blocks-checkout/TotalsItem',
	component: TotalsItem,
};

export const Default = () => {
	const currency = currencyKnob();
	const description = text(
		'Description',
		'This is the amount that will be charged to your card.'
	);
	const label = text( 'Label', 'Amount' );
	const value = text( 'Value', '1000' );

	return (
		<TotalsItem
			currency={ currency }
			description={ description }
			label={ label }
			value={ value }
		/>
	);
};
woocommerce-blocks/packages/checkout/totals/subtotal/index.tsx000064400000002032151335517640020742 0ustar00/**
 * External dependencies
 */
import { __ } from '@wordpress/i18n';
import type { Currency } from '@woocommerce/price-format';
import type { ReactElement } from 'react';
import { getSetting } from '@woocommerce/settings';

/**
 * Internal dependencies
 */
import TotalsItem from '../item';

interface Values {
	total_items: string;
	total_items_tax: string;
}

interface SubtotalProps {
	className?: string;
	currency: Currency;
	values: Values | Record< string, never >;
}

const Subtotal = ( {
	currency,
	values,
	className,
}: SubtotalProps ): ReactElement => {
	const { total_items: totalItems, total_items_tax: totalItemsTax } = values;
	const itemsValue = parseInt( totalItems, 10 );
	const itemsTaxValue = parseInt( totalItemsTax, 10 );

	return (
		<TotalsItem
			className={ className }
			currency={ currency }
			label={ __( 'Subtotal', 'woo-gutenberg-products-block' ) }
			value={
				getSetting( 'displayCartPricesIncludingTax', false )
					? itemsValue + itemsTaxValue
					: itemsValue
			}
		/>
	);
};

export default Subtotal;
woocommerce-blocks/packages/checkout/totals/subtotal/stories/index.js000064400000001144151335517640022233 0ustar00/**
 * External dependencies
 */
import { text } from '@storybook/addon-knobs';
import { currencyKnob } from '@woocommerce/knobs';

/**
 * Internal dependencies
 */
import Subtotal from '../';

export default {
	title: 'WooCommerce Blocks/@blocks-checkout/Subtotal',
	component: Subtotal,
};

export const Default = () => {
	const currency = currencyKnob();
	const totalItems = text( 'Total items', '1000' );
	const totalItemsTax = text( 'Total items tax', '200' );

	return (
		<Subtotal
			currency={ currency }
			values={ {
				total_items: totalItems,
				total_items_tax: totalItemsTax,
			} }
		/>
	);
};
woocommerce-blocks/packages/checkout/totals/fees/index.tsx000064400000002443151335517640020035 0ustar00/**
 * External dependencies
 */
import classnames from 'classnames';
import { __ } from '@wordpress/i18n';
import { getSetting } from '@woocommerce/settings';
import type { Currency } from '@woocommerce/price-format';
import type { CartFeeItem } from '@woocommerce/type-defs/cart';
import type { ReactElement } from 'react';

/**
 * Internal dependencies
 */
import TotalsItem from '../item';

interface TotalsFeesProps {
	currency: Currency;
	cartFees: CartFeeItem[];
	className?: string;
}

const TotalsFees = ( {
	currency,
	cartFees,
	className,
}: TotalsFeesProps ): ReactElement | null => {
	return (
		<>
			{ cartFees.map( ( { id, name, totals }, index ) => {
				const feesValue = parseInt( totals.total, 10 );

				if ( ! feesValue ) {
					return null;
				}

				const feesTaxValue = parseInt( totals.total_tax, 10 );

				return (
					<TotalsItem
						key={ id || `${ index }-${ name }` }
						className={ classnames(
							'wc-block-components-totals-fees',
							className
						) }
						currency={ currency }
						label={
							name || __( 'Fee', 'woo-gutenberg-products-block' )
						}
						value={
							getSetting( 'displayCartPricesIncludingTax', false )
								? feesValue + feesTaxValue
								: feesValue
						}
					/>
				);
			} ) }
		</>
	);
};

export default TotalsFees;
woocommerce-blocks/packages/checkout/totals/fees/stories/index.js000064400000001244151335517640021321 0ustar00/**
 * External dependencies
 */
import { text } from '@storybook/addon-knobs';
import { currencyKnob } from '@woocommerce/knobs';

/**
 * Internal dependencies
 */
import TotalsFees from '../';

export default {
	title: 'WooCommerce Blocks/@blocks-checkout/TotalsFees',
	component: TotalsFees,
};

export const Default = () => {
	const currency = currencyKnob();
	const totalFees = text( 'Total fee', '1000' );
	const totalFeesTax = text( 'Total fee tax', '200' );

	return (
		<TotalsFees
			currency={ currency }
			cartFees={ [
				{
					id: 'fee',
					name: 'Fee',
					totals: {
						total: totalFees,
						total_tax: totalFeesTax,
					},
				},
			] }
		/>
	);
};
woocommerce-blocks/packages/checkout/totals/taxes/style.scss000064400000000273151335517640020424 0ustar00.wc-block-components-totals-item.wc-block-components-totals-taxes__grouped-rate {
	margin: $gap-smallest 0;
	&:first-child {
		margin-top: 0;
	}

	&:last-child {
		margin-bottom: 0;
	}
}
woocommerce-blocks/packages/checkout/totals/taxes/stories/index.js000064400000001021151335517640021514 0ustar00/**
 * External dependencies
 */
import { text } from '@storybook/addon-knobs';
import { currencyKnob } from '@woocommerce/knobs';

/**
 * Internal dependencies
 */
import TotalsTaxes from '../';

export default {
	title: 'WooCommerce Blocks/@blocks-checkout/TotalsTaxes',
	component: TotalsTaxes,
};

export const Default = () => {
	const currency = currencyKnob();
	const totalTaxes = text( 'Total taxes', '1000' );

	return (
		<TotalsTaxes
			currency={ currency }
			values={ {
				total_tax: totalTaxes,
			} }
		/>
	);
};
woocommerce-blocks/packages/checkout/totals/taxes/index.tsx000064400000003744151335517640020244 0ustar00/**
 * External dependencies
 */
import classnames from 'classnames';
import { __ } from '@wordpress/i18n';
import { getSetting } from '@woocommerce/settings';
import type { Currency } from '@woocommerce/price-format';
import type { CartTotalsTaxLineItem } from '@woocommerce/type-defs/cart';
import { ReactElement } from 'react';

/**
 * Internal dependencies
 */
import TotalsItem from '../item';
import './style.scss';

interface Values {
	tax_lines: CartTotalsTaxLineItem[];
	total_tax: string;
}

interface TotalsTaxesProps {
	className?: string;
	currency: Currency;
	showRateAfterTaxName: boolean;
	values: Values | Record< string, never >;
}

const TotalsTaxes = ( {
	currency,
	values,
	className,
	showRateAfterTaxName,
}: TotalsTaxesProps ): ReactElement | null => {
	const { total_tax: totalTax, tax_lines: taxLines } = values;

	if (
		! getSetting( 'taxesEnabled', true ) &&
		parseInt( totalTax, 10 ) <= 0
	) {
		return null;
	}

	const showItemisedTaxes = getSetting(
		'displayItemizedTaxes',
		false
	) as boolean;

	const itemisedTaxItems: ReactElement | null =
		showItemisedTaxes && taxLines.length > 0 ? (
			<div
				className={ classnames(
					'wc-block-components-totals-taxes',
					className
				) }
			>
				{ taxLines.map( ( { name, rate, price }, i ) => {
					const label = `${ name }${
						showRateAfterTaxName ? ` ${ rate }` : ''
					}`;
					return (
						<TotalsItem
							key={ `tax-line-${ i }` }
							className="wc-block-components-totals-taxes__grouped-rate"
							currency={ currency }
							label={ label }
							value={ parseInt( price, 10 ) }
						/>
					);
				} ) }{ ' ' }
			</div>
		) : null;

	return showItemisedTaxes ? (
		itemisedTaxItems
	) : (
		<>
			<TotalsItem
				className={ classnames(
					'wc-block-components-totals-taxes',
					className
				) }
				currency={ currency }
				label={ __( 'Taxes', 'woo-gutenberg-products-block' ) }
				value={ parseInt( totalTax, 10 ) }
				description={ null }
			/>
		</>
	);
};

export default TotalsTaxes;
woocommerce-blocks/packages/checkout/order-shipping-packages/index.js000064400000001721151335517640022107 0ustar00/**
 * External dependencies
 */
import classnames from 'classnames';

/**
 * Internal dependencies
 */
import { createSlotFill, useSlot } from '../slot';

const slotName = '__experimentalOrderShippingPackages';
const {
	Fill: ExperimentalOrderShippingPackages,
	Slot: OrderShippingPackagesSlot,
} = createSlotFill( slotName );

const Slot = ( {
	className,
	collapsible,
	noResultsMessage,
	renderOption,
	extensions,
	cart,
	components,
} ) => {
	const { fills } = useSlot( slotName );
	const hasMultiplePackages = fills.length > 1;
	return (
		<OrderShippingPackagesSlot
			className={ classnames(
				'wc-block-components-shipping-rates-control',
				className
			) }
			fillProps={ {
				collapsible,
				collapse: hasMultiplePackages,
				showItems: hasMultiplePackages,
				noResultsMessage,
				renderOption,
				extensions,
				cart,
				components,
			} }
		/>
	);
};

ExperimentalOrderShippingPackages.Slot = Slot;

export default ExperimentalOrderShippingPackages;
woocommerce-blocks/packages/checkout/discounts-meta/index.js000064400000001461151335517640020341 0ustar00/**
 * External dependencies
 */
import classnames from 'classnames';

/**
 * Internal dependencies
 */
import { createSlotFill, hasValidFills, useSlot } from '../slot';
import TotalsWrapper from '../wrapper';

const slotName = '__experimentalDiscountsMeta';

const {
	Fill: ExperimentalDiscountsMeta,
	Slot: DiscountsMetaSlot,
} = createSlotFill( slotName );

const Slot = ( { className, extensions, cart } ) => {
	const { fills } = useSlot( slotName );
	return (
		hasValidFills( fills ) && (
			<TotalsWrapper slotWrapper={ true }>
				<DiscountsMetaSlot
					className={ classnames(
						className,
						'wc-block-components-discounts-meta'
					) }
					fillProps={ { extensions, cart } }
				/>
			</TotalsWrapper>
		)
	);
};

ExperimentalDiscountsMeta.Slot = Slot;

export default ExperimentalDiscountsMeta;
woocommerce-blocks/packages/checkout/panel/style.scss000064400000003156151335517640017074 0ustar00.wc-block-components-panel.has-border {
	@include with-translucent-border(1px 0);

	+ .wc-block-components-panel.has-border::after {
		border-top-width: 0;
	}
}

.wc-block-components-panel.has-border.no-top-border {
	@include with-translucent-border(1px 0);
	&::after {
		border-top-width: 0;
	}
}

.wc-block-components-panel__button {
	@include reset-box();
	height: auto;
	line-height: 1;
	margin-top: em(6px);
	padding-right: #{24px + $gap-smaller};
	padding-top: em($gap-small - 6px);
	position: relative;
	text-align: left;
	width: 100%;
	word-break: break-word;

	&[aria-expanded="true"] {
		padding-bottom: em($gap-small - 6px);
		margin-bottom: em(6px);
	}

	&,
	&:hover,
	&:focus,
	&:active {
		@include reset-typography();
		background: transparent;
		box-shadow: none;
	}

	> .wc-block-components-panel__button-icon {
		fill: currentColor;
		position: absolute;
		right: 0;
		top: 50%;
		transform: translateY(-50%);
		width: auto;
	}
}

.wc-block-components-panel__content {
	padding-bottom: em($gap);

	// Ensures the panel contents are not visible for any theme that tweaked the
	// `display` property of div elements.
	&[hidden] {
		display: none;
	}
}

// Extra classes for specificity.
.theme-twentytwentyone.theme-twentytwentyone.theme-twentytwentyone .wc-block-components-panel__button {
	background-color: inherit;
	color: inherit;
}

.theme-twentytwenty .wc-block-components-panel__button,
.theme-twentyseventeen .wc-block-components-panel__button {
	background: none transparent;
	color: inherit;

	&.wc-block-components-panel__button:hover,
	&.wc-block-components-panel__button:focus {
		background: none transparent;
	}
}
woocommerce-blocks/packages/checkout/panel/index.tsx000064400000002462151335517640016705 0ustar00/**
 * External dependencies
 */
import { useState } from '@wordpress/element';
import type { ReactNode, ReactElement } from 'react';
import classNames from 'classnames';
import { Icon, chevronUp, chevronDown } from '@woocommerce/icons';

/**
 * Internal dependencies
 */
import './style.scss';

interface PanelProps {
	children?: ReactNode;
	className?: string;
	initialOpen?: boolean;
	hasBorder?: boolean;
	title?: ReactNode;
	titleTag?: keyof JSX.IntrinsicElements;
}

const Panel = ( {
	children,
	className,
	initialOpen = false,
	hasBorder = false,
	title,
	titleTag: TitleTag = 'div',
}: PanelProps ): ReactElement => {
	const [ isOpen, setIsOpen ] = useState< boolean >( initialOpen );

	return (
		<div
			className={ classNames( className, 'wc-block-components-panel', {
				'has-border': hasBorder,
			} ) }
		>
			<TitleTag>
				<button
					aria-expanded={ isOpen }
					className="wc-block-components-panel__button"
					onClick={ () => setIsOpen( ! isOpen ) }
				>
					<Icon
						aria-hidden="true"
						className="wc-block-components-panel__button-icon"
						srcElement={ isOpen ? chevronUp : chevronDown }
					/>
					{ title }
				</button>
			</TitleTag>
			{ isOpen && (
				<div className="wc-block-components-panel__content">
					{ children }
				</div>
			) }
		</div>
	);
};

export default Panel;
woocommerce-blocks/packages/checkout/wrapper/style.scss000064400000000770151335517640017454 0ustar00.wc-block-components-totals-wrapper {
	@include with-translucent-border(1px 0 0);
	padding: $gap 0;

	&.has-bottom-border {
		&::after {
			border-bottom-width: 1px;
		}
	}

	&.slot-wrapper {
		padding: 0;

		> * > * {
			@include with-translucent-border(0 0 1px);
			padding: $gap 0;

			&:last-child::after {
				border-bottom-width: 0;
			}
		}
	}
}

.wc-block-components-discounts-meta {
	.wc-block-components-totals-wrapper {
		&:first-child {
			@include with-translucent-border(1px 0 0);
		}
	}
}
woocommerce-blocks/packages/checkout/wrapper/index.tsx000064400000001132151335517640017257 0ustar00/**
 * External dependencies
 */
import { Children, ReactNode } from 'react';

/**
 * Internal dependencies
 */
import './style.scss';

interface TotalsWrapperProps {
	children: ReactNode;
	/* If this TotalsWrapper is being used to wrap a Slot */
	slotWrapper?: boolean;
}

const TotalsWrapper = ( {
	children,
	slotWrapper = false,
}: TotalsWrapperProps ): JSX.Element | null => {
	return Children.count( children ) ? (
		<div
			className={ `wc-block-components-totals-wrapper${
				slotWrapper ? ' slot-wrapper' : ''
			}` }
		>
			{ children }
		</div>
	) : null;
};

export default TotalsWrapper;
woocommerce-blocks/packages/checkout/button/index.ts000064400000000163151335517640016725 0ustar00/**
 * External dependencies
 */
import Button from '@woocommerce/base-components/button';

export default Button;
woocommerce-blocks/packages/checkout/error-boundary/index.js000064400000001540151335517640020352 0ustar00/**
 * External dependencies
 */
import { Component } from 'react';

class CheckoutSlotErrorBoundary extends Component {
	state = { errorMessage: '', hasError: false };

	static getDerivedStateFromError( error ) {
		if (
			typeof error.statusText !== 'undefined' &&
			typeof error.status !== 'undefined'
		) {
			return {
				errorMessage: (
					<>
						<strong>{ error.status }</strong>
						{ ': ' + error.statusText }
					</>
				),
				hasError: true,
			};
		}

		return { errorMessage: error.message, hasError: true };
	}

	render() {
		const { renderError } = this.props;
		const { errorMessage, hasError } = this.state;

		if ( hasError ) {
			if ( typeof renderError === 'function' ) {
				return renderError( errorMessage );
			}
			return <p>{ errorMessage }</p>;
		}

		return this.props.children;
	}
}

export default CheckoutSlotErrorBoundary;
woocommerce-blocks/packages/checkout/blocks-registry/utils.ts000064400000006543151335517640020576 0ustar00/**
 * External dependencies
 */
import { isObject } from '@woocommerce/types';

/**
 * Internal dependencies
 */
import { hasInnerBlocks } from './get-registered-blocks';

/**
 * Asserts that an option is of the given type. Otherwise, throws an error.
 *
 * @throws Will throw an error if the type of the option doesn't match the expected type.
 */
export const assertType = (
	optionName: string,
	option: unknown,
	expectedType: unknown
): void => {
	const actualType = typeof option;
	if ( actualType !== expectedType ) {
		throw new Error(
			`Incorrect value for the ${ optionName } argument when registering a checkout block. It was a ${ actualType }, but must be a ${ expectedType }.`
		);
	}
};

/**
 * Validate the block name.
 *
 * @throws Will throw an error if the block name is invalid.
 */
export const assertBlockName = ( blockName: string ): void => {
	assertType( 'blockName', blockName, 'string' );

	if ( ! blockName ) {
		throw new Error(
			`Value for the blockName argument must not be empty.`
		);
	}
};

/**
 * Validate the block parent.
 *
 * @throws Will throw an error if the block name is invalid.
 */
export const assertBlockParent = ( blockParent: string | string[] ): void => {
	if ( typeof blockParent !== 'string' && ! Array.isArray( blockParent ) ) {
		throw new Error(
			`Incorrect value for the parent argument when registering a checkout block. It was a ${ typeof blockParent }, but must be a string or array of strings.`
		);
	}

	if ( typeof blockParent === 'string' && ! hasInnerBlocks( blockParent ) ) {
		throw new Error(
			`When registering a checkout block, the parent must be a valid inner block area.`
		);
	}

	if (
		Array.isArray( blockParent ) &&
		! blockParent.some( ( parent ) => hasInnerBlocks( parent ) )
	) {
		throw new Error(
			`When registering a checkout block, the parent must be a valid inner block area.`
		);
	}
};

/**
 * Asserts that an option is of the given type. Otherwise, throws an error.
 *
 * @throws Will throw an error if the type of the option doesn't match the expected type.
 * @param {Object} options      Object containing the option to validate.
 * @param {string} optionName   Name of the option to validate.
 * @param {string} expectedType Type expected for the option.
 */
export const assertOption = (
	options: unknown,
	optionName: string,
	expectedType: string
): void => {
	if ( ! isObject( options ) ) {
		return;
	}
	const actualType = typeof options[ optionName ];
	if ( actualType !== expectedType ) {
		throw new Error(
			`Incorrect value for the ${ optionName } argument when registering a block component. It was a ${ actualType }, but must be a ${ expectedType }.`
		);
	}
};

/**
 * Asserts that an option is a valid react element or lazy callback. Otherwise, throws an error.
 *
 * @throws Will throw an error if the type of the option doesn't match the expected type.
 */
export const assertBlockComponent = (
	options: Record< string, unknown >,
	optionName: string
): void => {
	const optionValue = options[ optionName ];

	if ( optionValue ) {
		if ( typeof optionValue === 'function' ) {
			return;
		}
		if (
			isObject( optionValue ) &&
			optionValue.$$typeof &&
			optionValue.$$typeof === Symbol.for( 'react.lazy' )
		) {
			return;
		}
	}
	throw new Error(
		`Incorrect value for the ${ optionName } argument when registering a block component. Component must be a valid React Element or Lazy callback.`
	);
};
woocommerce-blocks/packages/checkout/blocks-registry/register-checkout-block.ts000064400000002210151335517640024140 0ustar00/**
 * External dependencies
 */
import { registerBlockComponent } from '@woocommerce/blocks-registry';

/**
 * Internal dependencies
 */
import type { CheckoutBlockOptions } from './types';
import {
	assertBlockName,
	assertBlockParent,
	assertOption,
	assertBlockComponent,
} from './utils';
import { registeredBlocks } from './registered-blocks';

/**
 * Main API for registering a new checkout block within areas.
 */
export const registerCheckoutBlock = (
	options: CheckoutBlockOptions
): void => {
	assertOption( options, 'metadata', 'object' );
	assertBlockName( options.metadata.name );
	assertBlockParent( options.metadata.parent );
	assertBlockComponent( options, 'component' );

	/**
	 * This ensures the frontend component for the checkout block is available.
	 */
	registerBlockComponent( {
		blockName: options.metadata.name as string,
		component: options.component,
	} );

	/**
	 * Store block metadata for later lookup.
	 */
	registeredBlocks[ options.metadata.name ] = {
		blockName: options.metadata.name,
		metadata: options.metadata,
		component: options.component,
		force: !! options.metadata?.attributes?.lock?.default?.remove,
	};
};
woocommerce-blocks/packages/checkout/blocks-registry/test/index.js000064400000004072151335517640021505 0ustar00/**
 * Internal dependencies
 */
import {
	getRegisteredBlocks,
	registerCheckoutBlock,
	innerBlockAreas,
} from '../index';

describe( 'checkout blocks registry', () => {
	const component = () => {
		return null;
	};

	describe( 'registerCheckoutBlock', () => {
		const invokeTest = ( blockName, options ) => () => {
			return registerCheckoutBlock( blockName, options );
		};
		it( 'throws an error when registered block is missing `blockName`', () => {
			expect(
				invokeTest( {
					metadata: {
						name: null,
						parent: innerBlockAreas.CHECKOUT_FIELDS,
					},
					component,
				} )
			).toThrowError( /blockName/ );
			expect(
				invokeTest( {
					metadata: {
						name: '',
						parent: innerBlockAreas.CHECKOUT_FIELDS,
					},
					component,
				} )
			).toThrowError( /blockName/ );
		} );
		it( 'throws an error when registered block is missing a valid parent', () => {
			expect(
				invokeTest( {
					metadata: {
						name: 'test/block-name',
						parent: [],
					},
					component,
				} )
			).toThrowError( /parent/ );
			expect(
				invokeTest( {
					metadata: {
						name: 'test/block-name',
						parent: 'invalid-parent',
					},
					component,
				} )
			).toThrowError( /parent/ );
			expect(
				invokeTest( {
					metadata: {
						name: 'test/block-name',
						parent: [
							'invalid-parent',
							innerBlockAreas.CHECKOUT_FIELDS,
						],
					},
					component,
				} )
			).not.toThrowError( /parent/ );
		} );
		it( 'throws an error when registered block is missing `component`', () => {
			expect(
				invokeTest( {
					metadata: {
						name: 'test/block-name',
						parent: innerBlockAreas.CHECKOUT_FIELDS,
					},
				} )
			).toThrowError( /component/ );
		} );
	} );

	describe( 'getRegisteredBlocks', () => {
		it( 'gets an empty array when checkout area has no registered blocks', () => {
			expect(
				getRegisteredBlocks( innerBlockAreas.CONTACT_INFORMATION )
			).toEqual( [] );
		} );
		it( 'gets an empty array when the area is not defined', () => {
			expect( getRegisteredBlocks( 'not-defined' ) ).toEqual( [] );
		} );
	} );
} );
woocommerce-blocks/packages/checkout/blocks-registry/types.ts000064400000002716151335517640020600 0ustar00/**
 * External dependencies
 */
import type { LazyExoticComponent } from 'react';
import type { BlockConfiguration } from '@wordpress/blocks';

export enum innerBlockAreas {
	CHECKOUT = 'woocommerce/checkout',
	CHECKOUT_FIELDS = 'woocommerce/checkout-fields-block',
	CHECKOUT_TOTALS = 'woocommerce/checkout-totals-block',
	CONTACT_INFORMATION = 'woocommerce/checkout-contact-information-block',
	SHIPPING_ADDRESS = 'woocommerce/checkout-shipping-address-block',
	BILLING_ADDRESS = 'woocommerce/checkout-billing-address-block',
	SHIPPING_METHODS = 'woocommerce/checkout-shipping-methods-block',
	PAYMENT_METHODS = 'woocommerce/checkout-payment-methods-block',
	CART = 'woocommerce/cart-i2',
	EMPTY_CART = 'woocommerce/empty-cart-block',
	FILLED_CART = 'woocommerce/filled-cart-block',
	CART_ITEMS = 'woocommerce/cart-items-block',
	CART_TOTALS = 'woocommerce/cart-totals-block',
}

interface CheckoutBlockOptionsMetadata extends Partial< BlockConfiguration > {
	name: string;
	parent: string[];
}

export type RegisteredBlock = {
	blockName: string;
	metadata: CheckoutBlockOptionsMetadata;
	component:
		| LazyExoticComponent< React.ComponentType< unknown > >
		| ( () => JSX.Element | null )
		| null;
	force: boolean;
};

export type RegisteredBlocks = Record< string, RegisteredBlock >;

export type CheckoutBlockOptions = {
	metadata: CheckoutBlockOptionsMetadata;
	component:
		| LazyExoticComponent< React.ComponentType< unknown > >
		| ( () => JSX.Element | null )
		| null;
};
woocommerce-blocks/packages/checkout/blocks-registry/registered-blocks.ts000064400000000240151335517640023032 0ustar00/**
 * Internal dependencies
 */
import type { RegisteredBlocks } from './types';

const registeredBlocks: RegisteredBlocks = {};

export { registeredBlocks };
woocommerce-blocks/packages/checkout/blocks-registry/get-registered-blocks.ts000064400000001226151335517640023614 0ustar00/**
 * Internal dependencies
 */
import { innerBlockAreas, RegisteredBlock } from './types';
import { registeredBlocks } from './registered-blocks';

/**
 * Check area is valid.
 */
export const hasInnerBlocks = ( block: string ): block is innerBlockAreas => {
	return Object.values( innerBlockAreas ).includes(
		block as innerBlockAreas
	);
};

/**
 * Get a list of blocks available within a specific area.
 */
export const getRegisteredBlocks = (
	block: string
): Array< RegisteredBlock > => {
	return hasInnerBlocks( block )
		? Object.values( registeredBlocks ).filter( ( { metadata } ) =>
				( metadata?.parent || [] ).includes( block )
		  )
		: [];
};
woocommerce-blocks/packages/checkout/blocks-registry/index.ts000064400000000155151335517640020536 0ustar00export * from './get-registered-blocks';
export * from './register-checkout-block';
export * from './types';
woocommerce-blocks/packages/checkout/order-meta/index.js000064400000001423151335517640017437 0ustar00/**
 * External dependencies
 */
import classnames from 'classnames';

/**
 * Internal dependencies
 */
import { createSlotFill, hasValidFills, useSlot } from '../slot';
import TotalsWrapper from '../wrapper';

const slotName = '__experimentalOrderMeta';

const { Fill: ExperimentalOrderMeta, Slot: OrderMetaSlot } = createSlotFill(
	slotName
);

const Slot = ( { className, extensions, cart } ) => {
	const { fills } = useSlot( slotName );
	return (
		hasValidFills( fills ) && (
			<TotalsWrapper slotWrapper={ true }>
				<OrderMetaSlot
					className={ classnames(
						className,
						'wc-block-components-order-meta'
					) }
					fillProps={ { extensions, cart } }
				/>
			</TotalsWrapper>
		)
	);
};

ExperimentalOrderMeta.Slot = Slot;

export default ExperimentalOrderMeta;
woocommerce-blocks/packages/checkout/slot/index.js000064400000007043151335517640016365 0ustar00/**
 * External dependencies
 */
import deprecated from '@wordpress/deprecated';
import {
	createSlotFill as baseCreateSlotFill,
	__experimentalUseSlot,
	useSlot as __useSlot,
} from 'wordpress-components';
import { CURRENT_USER_IS_ADMIN } from '@woocommerce/settings';
import { Children, cloneElement } from '@wordpress/element';

/**
 * Internal dependencies
 */
import BlockErrorBoundary from '../error-boundary';

/**
 * This function is used in case __experimentalUseSlot is removed and useSlot is not released, it tries to mock
 * the return value of that slot.
 *
 * @return {Object} The hook mocked return, currently:
 *                  fills, a null array of length 2.
 */
const mockedUseSlot = () => {
	/**
	 * If we're here, it means useSlot was never graduated and __experimentalUseSlot is removed, so we should change our code.
	 *
	 */
	deprecated( '__experimentalUseSlot', {
		plugin: 'woocommerce-gutenberg-products-block',
	} );
	// We're going to mock its value
	return {
		fills: new Array( 2 ),
	};
};

/**
 * Checks if this slot has any valid fills. A valid fill is one that isn't falsy.
 *
 * @param {Array} fills The list of fills to check for a valid one in.
 * @return {boolean} True if this slot contains any valid fills.
 */
export const hasValidFills = ( fills ) =>
	Array.isArray( fills ) && fills.filter( Boolean ).length > 0;

/**
 * A hook that is used inside a slotFillProvider to return information on the a slot.
 *
 * @param {string} slotName The slot name to be hooked into.
 * @return {Object} slot data.
 */
let useSlot;

if ( typeof __useSlot === 'function' ) {
	useSlot = __useSlot;
} else if ( typeof __experimentalUseSlot === 'function' ) {
	useSlot = __experimentalUseSlot;
} else {
	useSlot = mockedUseSlot;
}

export { useSlot };

/**
 * Abstracts @wordpress/components createSlotFill, wraps Fill in an error boundary and passes down fillProps.
 *
 * @param {string} slotName The generated slotName, based down to createSlotFill.
 * @param {null|function(Element):Element} [onError] Returns an element to display the error if the current use is an admin.
 *
 * @return {Object} Returns a newly wrapped Fill and Slot.
 */
export const createSlotFill = ( slotName, onError = null ) => {
	const { Fill: BaseFill, Slot: BaseSlot } = baseCreateSlotFill( slotName );

	/**
	 * A Fill that will get rendered inside associate slot.
	 * If the code inside has a error, it would be caught ad removed.
	 * The error is only visible to admins.
	 *
	 * @param {Object} props Items props.
	 * @param {Array}  props.children Children to be rendered.
	 */
	const Fill = ( { children } ) => (
		<BaseFill>
			{ ( fillProps ) =>
				Children.map( children, ( fill ) => (
					<BlockErrorBoundary
						/* Returning null would trigger the default error display.
						 * Returning () => null would render nothing.
						 */
						renderError={
							CURRENT_USER_IS_ADMIN ? onError : () => null
						}
					>
						{ cloneElement( fill, fillProps ) }
					</BlockErrorBoundary>
				) )
			}
		</BaseFill>
	);

	/**
	 * A Slot that will get rendered inside our tree.
	 * This forces Slot to use the Portal implementation that allows events to be bubbled to react tree instead of dom tree.
	 *
	 * @param {Object}         [props] Slot props.
	 * @param {string}         props.className Class name to be used on slot.
	 * @param {Object}         props.fillProps Props to be passed to fills.
	 * @param {Element|string} props.as Element used to render the slot, defaults to div.
	 *
	 */
	const Slot = ( props ) => <BaseSlot { ...props } bubblesVirtually />;

	return {
		Fill,
		Slot,
	};
};
woocommerce-blocks/packages/checkout/index.js000064400000001143151335517640015377 0ustar00export * from './totals';
export * from './utils';
export * from './slot';
export * from './registry';
export { default as TotalsWrapper } from './wrapper';
export * from './blocks-registry';
export { default as ExperimentalOrderMeta } from './order-meta';
export { default as ExperimentalDiscountsMeta } from './discounts-meta';
export { default as ExperimentalOrderShippingPackages } from './order-shipping-packages';
export { default as Panel } from './panel';
export { SlotFillProvider } from 'wordpress-components';
export { default as Button } from './button';
export { default as Label } from './label';
woocommerce-blocks/packages/checkout/label/index.ts000064400000000160151335517640016466 0ustar00/**
 * External dependencies
 */
import Label from '@woocommerce/base-components/label';

export default Label;
woocommerce-blocks/packages/checkout/registry/index.ts000064400000007667151335517640017302 0ustar00/**
 * External dependencies
 */
import { useMemo } from '@wordpress/element';
import { __, sprintf } from '@wordpress/i18n';
import { CURRENT_USER_IS_ADMIN } from '@woocommerce/settings';
import deprecated from '@wordpress/deprecated';

/**
 * Internal dependencies
 */
import { returnTrue } from '../utils';

type CheckoutFilterFunction = < T >(
	value: T,
	extensions: Record< string, unknown >,
	args?: CheckoutFilterArguments
) => T;

type CheckoutFilterArguments =
	| ( Record< string, unknown > & {
			context?: string;
	  } )
	| null;

let checkoutFilters: Record<
	string,
	Record< string, CheckoutFilterFunction >
> = {};

/**
 * Register filters for a specific extension.
 */
export const __experimentalRegisterCheckoutFilters = (
	namespace: string,
	filters: Record< string, CheckoutFilterFunction >
): void => {
	/**
	 * Let developers know snackbarNotices is no longer available as a filter.
	 *
	 * See: https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/4417
	 */
	if ( Object.keys( filters ).includes( 'couponName' ) ) {
		deprecated( 'snackbarNotices', {
			alternative: 'snackbarNoticeVisibility',
			plugin: 'WooCommerce Blocks',
			link:
				'https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/4417',
		} );
	}

	/**
	 * Let the user know couponName is no longer available as a filter.
	 *
	 * See https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/4312
	 */
	if ( Object.keys( filters ).includes( 'couponName' ) ) {
		deprecated( 'couponName', {
			alternative: 'coupons',
			plugin: 'WooCommerce Blocks',
			link:
				'https://github.com/woocommerce/woocommerce-gutenberg-products-block/blob/bb921d21f42e21f38df2b1c87b48e07aa4cb0538/docs/extensibility/available-filters.md#coupons',
		} );
	}

	checkoutFilters = {
		...checkoutFilters,
		[ namespace ]: filters,
	};
};

/**
 * Get all filters with a specific name.
 *
 * @param {string} filterName   Name of the filter to search for.
 * @return {Function[]} Array of functions that are registered for that filter
 *                      name.
 */
const getCheckoutFilters = ( filterName: string ): CheckoutFilterFunction[] => {
	const namespaces = Object.keys( checkoutFilters );
	const filters = namespaces
		.map( ( namespace ) => checkoutFilters[ namespace ][ filterName ] )
		.filter( Boolean );
	return filters;
};

/**
 * Apply a filter.
 */
export const __experimentalApplyCheckoutFilter = < T >( {
	filterName,
	defaultValue,
	extensions = null,
	arg = null,
	validation = returnTrue,
}: {
	/** Name of the filter to apply. */
	filterName: string;
	/** Default value to filter. */
	defaultValue: T;
	/** Values extend to REST API response. */
	extensions?: Record< string, unknown > | null;
	/** Object containing arguments for the filter function. */
	arg?: CheckoutFilterArguments;
	/** Function that needs to return true when the filtered value is passed in order for the filter to be applied. */
	validation?: ( value: T ) => true | Error;
} ): T => {
	return useMemo( () => {
		const filters = getCheckoutFilters( filterName );

		let value = defaultValue;
		filters.forEach( ( filter ) => {
			try {
				const newValue = filter( value, extensions || {}, arg );
				if ( typeof newValue !== typeof value ) {
					throw new Error(
						sprintf(
							/* translators: %1$s is the type of the variable passed to the filter function, %2$s is the type of the value returned by the filter function. */
							__(
								'The type returned by checkout filters must be the same as the type they receive. The function received %1$s but returned %2$s.',
								'woo-gutenberg-products-block'
							),
							typeof value,
							typeof newValue
						)
					);
				}
				value = validation( newValue ) ? newValue : value;
			} catch ( e ) {
				if ( CURRENT_USER_IS_ADMIN ) {
					throw e;
				} else {
					// eslint-disable-next-line no-console
					console.error( e );
				}
			}
		} );
		return value;
	}, [ filterName, defaultValue, extensions, arg, validation ] );
};
woocommerce-blocks/packages/checkout/registry/test/index.js000064400000004240151335517640020227 0ustar00/**
 * External dependencies
 */
import { renderHook } from '@testing-library/react-hooks';
/**
 * Internal dependencies
 */
import {
	__experimentalRegisterCheckoutFilters,
	__experimentalApplyCheckoutFilter,
} from '../';

describe( 'Checkout registry', () => {
	const filterName = 'loremIpsum';

	test( 'should return default value if there are no filters', () => {
		const value = 'Hello World';
		const { result: newValue } = renderHook( () =>
			__experimentalApplyCheckoutFilter( {
				filterName,
				defaultValue: value,
			} )
		);
		expect( newValue.current ).toBe( value );
	} );

	test( 'should return filtered value when a filter is registered', () => {
		const value = 'Hello World';
		__experimentalRegisterCheckoutFilters( filterName, {
			[ filterName ]: ( val, extensions, args ) =>
				val.toUpperCase() + args.punctuationSign,
		} );
		const { result: newValue } = renderHook( () =>
			__experimentalApplyCheckoutFilter( {
				filterName,
				defaultValue: value,
				arg: {
					punctuationSign: '!',
				},
			} )
		);

		expect( newValue.current ).toBe( 'HELLO WORLD!' );
	} );

	test( 'should not return filtered value if validation failed', () => {
		const value = 'Hello World';
		__experimentalRegisterCheckoutFilters( filterName, {
			[ filterName ]: ( val ) => val.toUpperCase(),
		} );
		const { result: newValue } = renderHook( () =>
			__experimentalApplyCheckoutFilter( {
				filterName,
				defaultValue: value,
				validation: ( val ) => ! val.includes( 'HELLO' ),
			} )
		);

		expect( newValue.current ).toBe( value );
	} );

	test( 'should catch filter errors if user is not an admin', () => {
		const spy = {};
		spy.console = jest
			.spyOn( console, 'error' )
			.mockImplementation( () => {} );

		const error = new Error( 'test error' );
		const value = 'Hello World';
		__experimentalRegisterCheckoutFilters( filterName, {
			[ filterName ]: () => {
				throw error;
			},
		} );
		const { result: newValue } = renderHook( () =>
			__experimentalApplyCheckoutFilter( {
				filterName,
				defaultValue: value,
			} )
		);

		expect( spy.console ).toHaveBeenCalledWith( error );
		expect( newValue.current ).toBe( value );
		spy.console.mockRestore();
	} );
} );
woocommerce-blocks/packages/checkout/registry/test/admin.js000064400000002767151335517640020224 0ustar00/**
 * External dependencies
 */
import { renderHook } from '@testing-library/react-hooks';
/**
 * Internal dependencies
 */
import {
	__experimentalRegisterCheckoutFilters,
	__experimentalApplyCheckoutFilter,
} from '../';

jest.mock( '@woocommerce/settings', () => {
	const originalModule = jest.requireActual( '@woocommerce/settings' );
	return {
		// @ts-ignore We know @woocommerce/settings is an object.
		...originalModule,
		CURRENT_USER_IS_ADMIN: true,
	};
} );

describe( 'Checkout registry (as admin user)', () => {
	test( 'should throw if the filter throws and user is an admin', () => {
		const filterName = 'ErrorTestFilter';
		const value = 'Hello World';
		__experimentalRegisterCheckoutFilters( filterName, {
			[ filterName ]: () => {
				throw new Error( 'test error' );
			},
		} );

		const { result } = renderHook( () =>
			__experimentalApplyCheckoutFilter( {
				filterName,
				defaultValue: value,
			} )
		);
		expect( result.error ).toEqual( Error( 'test error' ) );
	} );

	test( 'should throw if validation throws and user is an admin', () => {
		const filterName = 'ValidationTestFilter';
		const value = 'Hello World';
		__experimentalRegisterCheckoutFilters( filterName, {
			[ filterName ]: ( val ) => val,
		} );
		const { result } = renderHook( () =>
			__experimentalApplyCheckoutFilter( {
				filterName,
				defaultValue: value,
				validation: () => {
					throw Error( 'validation error' );
				},
			} )
		);
		expect( result.error ).toEqual( Error( 'validation error' ) );
	} );
} );
woocommerce-blocks/packages/checkout/utils/extension-cart-update.ts000064400000001451151335517640021667 0ustar00/**
 * External dependencies
 */
import { dispatch } from '@wordpress/data';
import { CartResponse } from '@woocommerce/type-defs/cart-response';
import { ExtensionCartUpdateArgs } from '@woocommerce/types';

/**
 * Internal dependencies
 */
import { STORE_KEY } from '../../../assets/js/data/cart/constants';

/**
 * When executed, this will call the cart/extensions endpoint.
 * The args contains a namespace, so if that extension has registered an update
 * callback, it will be executed server-side and the new cart will be returned.
 * The new cart is then received into the client-side store.
 */
export const extensionCartUpdate = (
	args: ExtensionCartUpdateArgs
): Promise< CartResponse > => {
	const { applyExtensionCartUpdate } = dispatch( STORE_KEY );
	return applyExtensionCartUpdate( args );
};
woocommerce-blocks/packages/checkout/utils/index.js000064400000000135151335517640016537 0ustar00export * from './validation';
export { extensionCartUpdate } from './extension-cart-update';
woocommerce-blocks/packages/checkout/utils/validation/index.ts000064400000001324151335517640020704 0ustar00/**
 * External dependencies
 */
import { __, sprintf } from '@wordpress/i18n';

/**
 * Checks if value passed contain passed label.
 */
export const mustContain = ( value: string, label: string ): true | Error => {
	if ( ! value.includes( label ) ) {
		throw Error(
			sprintf(
				/* translators: %1$s value passed to filter, %2$s : value that must be included. */
				__(
					'Returned value must include %1$s, you passed "%2$s"',
					'woo-gutenberg-products-block'
				),
				value,
				label
			)
		);
	}
	return true;
};

/**
 * A function that always return true.
 * We need to have a single instance of this function so it doesn't
 * invalidate our memo comparison.
 */
export const returnTrue = (): true => true;
woocommerce-blocks/packages/prices/utils/index.js000064400000000031151335517640016212 0ustar00export * from './price';
woocommerce-blocks/packages/prices/utils/price.ts000064400000006747151335517640016243 0ustar00/**
 * External dependencies
 */
import { CURRENCY } from '@woocommerce/settings';
import type {
	Currency,
	CurrencyResponse,
	CartShippingPackageShippingRate,
	SymbolPosition,
} from '@woocommerce/types';

/**
 * Get currency prefix.
 */
const getPrefix = (
	// Currency symbol.
	symbol: string,
	// Position of currency symbol from settings.
	symbolPosition: SymbolPosition
): string => {
	const prefixes = {
		left: symbol,
		left_space: ' ' + symbol,
		right: '',
		right_space: '',
	};
	return prefixes[ symbolPosition ] || '';
};

/**
 * Get currency suffix.
 */
const getSuffix = (
	// Currency symbol.
	symbol: string,
	// Position of currency symbol from settings.
	symbolPosition: SymbolPosition
): string => {
	const suffixes = {
		left: '',
		left_space: '',
		right: symbol,
		right_space: ' ' + symbol,
	};
	return suffixes[ symbolPosition ] || '';
};

/**
 * Currency information in normalized format from server settings.
 */
const siteCurrencySettings: Currency = {
	code: CURRENCY.code,
	symbol: CURRENCY.symbol,
	thousandSeparator: CURRENCY.thousandSeparator,
	decimalSeparator: CURRENCY.decimalSeparator,
	minorUnit: CURRENCY.precision,
	prefix: getPrefix(
		CURRENCY.symbol,
		CURRENCY.symbolPosition as SymbolPosition
	),
	suffix: getSuffix(
		CURRENCY.symbol,
		CURRENCY.symbolPosition as SymbolPosition
	),
};

/**
 * Gets currency information in normalized format from an API response or the server.
 */
export const getCurrencyFromPriceResponse = (
	// Currency data object, for example an API response containing currency formatting data.
	currencyData:
		| CurrencyResponse
		| Record< string, never >
		| CartShippingPackageShippingRate
): Currency => {
	if ( ! currencyData || typeof currencyData !== 'object' ) {
		return siteCurrencySettings;
	}

	const {
		currency_code: code,
		currency_symbol: symbol,
		currency_thousand_separator: thousandSeparator,
		currency_decimal_separator: decimalSeparator,
		currency_minor_unit: minorUnit,
		currency_prefix: prefix,
		currency_suffix: suffix,
	} = currencyData;

	return {
		code: code || 'USD',
		symbol: symbol || '$',
		thousandSeparator:
			typeof thousandSeparator === 'string' ? thousandSeparator : ',',
		decimalSeparator:
			typeof decimalSeparator === 'string' ? decimalSeparator : '.',
		minorUnit: Number.isFinite( minorUnit ) ? minorUnit : 2,
		prefix: typeof prefix === 'string' ? prefix : '$',
		suffix: typeof suffix === 'string' ? suffix : '',
	};
};

/**
 * Gets currency information in normalized format, allowing overrides.
 */
export const getCurrency = (
	currencyData: Partial< Currency > = {}
): Currency => {
	return {
		...siteCurrencySettings,
		...currencyData,
	};
};

/**
 * Format a price, provided using the smallest unit of the currency, as a
 * decimal complete with currency symbols using current store settings.
 */
export const formatPrice = (
	// Price in minor unit, e.g. cents.
	price: number | string,
	currencyData?: Currency
): string => {
	if ( price === '' || price === undefined ) {
		return '';
	}

	const priceInt: number =
		typeof price === 'number' ? price : parseInt( price, 10 );

	if ( ! Number.isFinite( priceInt ) ) {
		return '';
	}

	const currency: Currency = getCurrency( currencyData );
	const formattedPrice: number = priceInt / 10 ** currency.minorUnit;
	const formattedValue: string =
		currency.prefix + formattedPrice + currency.suffix;

	// This uses a textarea to magically decode HTML currency symbols.
	const txt = document.createElement( 'textarea' );
	txt.innerHTML = formattedValue;
	return txt.value;
};
woocommerce-blocks/packages/prices/utils/test/price.js000064400000002371151335517640017175 0ustar00/**
 * Internal dependencies
 */
import { formatPrice, getCurrency } from '../price';

describe( 'formatPrice', () => {
	test.each`
		value          | prefix   | suffix   | expected
		${ 1000 }      | ${ '€' } | ${ '' }  | ${ '€10' }
		${ 1000 }      | ${ '' }  | ${ '€' } | ${ '10€' }
		${ 1000 }      | ${ '' }  | ${ '$' } | ${ '10$' }
		${ '1000' }    | ${ '€' } | ${ '' }  | ${ '€10' }
		${ 0 }         | ${ '€' } | ${ '' }  | ${ '€0' }
		${ '' }        | ${ '€' } | ${ '' }  | ${ '' }
		${ null }      | ${ '€' } | ${ '' }  | ${ '' }
		${ undefined } | ${ '€' } | ${ '' }  | ${ '' }
	`(
		'correctly formats price given "$value", "$prefix" prefix, and "$suffix" suffix',
		( { value, prefix, suffix, expected } ) => {
			const formattedPrice = formatPrice(
				value,
				getCurrency( { prefix, suffix } )
			);

			expect( formattedPrice ).toEqual( expected );
		}
	);

	test.each`
		value          | expected
		${ 1000 }      | ${ '$10' }
		${ 0 }         | ${ '$0' }
		${ '' }        | ${ '' }
		${ null }      | ${ '' }
		${ undefined } | ${ '' }
	`(
		'correctly formats price given "$value" only',
		( { value, expected } ) => {
			const formattedPrice = formatPrice( value );

			expect( formattedPrice ).toEqual( expected );
		}
	);
} );
woocommerce-blocks/packages/prices/index.js000064400000000031151335517640015052 0ustar00export * from './utils';
woocommerce-blocks/woocommerce-gutenberg-products-block.php000064400000021520151335517640020311 0ustar00<?php
/**
 * Plugin Name: WooCommerce Blocks
 * Plugin URI: https://github.com/woocommerce/woocommerce-gutenberg-products-block
 * Description: WooCommerce blocks for the Gutenberg editor.
 * Version: 6.1.0
 * Author: Automattic
 * Author URI: https://woocommerce.com
 * Text Domain:  woo-gutenberg-products-block
 * Requires at least: 5.8
 * Requires PHP: 7.0
 * WC requires at least: 5.7
 * WC tested up to: 5.7
 *
 * @package WooCommerce\Blocks
 * @internal This file is only used when running as a feature plugin.
 */

defined( 'ABSPATH' ) || exit;

$minimum_wp_version = '5.8';

if ( ! defined( 'WC_BLOCKS_IS_FEATURE_PLUGIN' ) ) {
	define( 'WC_BLOCKS_IS_FEATURE_PLUGIN', true );
}
/**
 * Whether notices must be displayed in the current page (plugins and WooCommerce pages).
 *
 * @since 2.5.0
 */
function should_display_compatibility_notices() {
	$current_screen = get_current_screen();

	if ( ! isset( $current_screen ) ) {
		return false;
	}

	$is_plugins_page     =
		property_exists( $current_screen, 'id' ) &&
		'plugins' === $current_screen->id;
	$is_woocommerce_page =
		property_exists( $current_screen, 'parent_base' ) &&
		'woocommerce' === $current_screen->parent_base;

	return $is_plugins_page || $is_woocommerce_page;
}

if ( version_compare( $GLOBALS['wp_version'], $minimum_wp_version, '<' ) ) {
	/**
	 * Outputs for an admin notice about running WooCommerce Blocks on outdated WordPress.
	 *
	 * @since 2.5.0
	 */
	function woocommerce_blocks_admin_unsupported_wp_notice() {
		if ( should_display_compatibility_notices() ) {
			?>
			<div class="notice notice-error">
				<p><?php esc_html_e( 'The WooCommerce Blocks feature plugin requires a more recent version of WordPress and has been paused. Please update WordPress to continue enjoying WooCommerce Blocks.', 'woocommerce' ); ?></p>
			</div>
			<?php
		}
	}
	add_action( 'admin_notices', 'woocommerce_blocks_admin_unsupported_wp_notice' );
	return;
}

/**
 * Returns whether the current version is a development version
 * Note this relies on composer.json version, not plugin version.
 * Development installs of the plugin don't have a version defined in
 * composer json.
 *
 * @return bool True means the current version is a development version.
 */
function woocommerce_blocks_is_development_version() {
	$composer_file = __DIR__ . '/composer.json';
	if ( ! is_readable( $composer_file ) ) {
		return false;
	}
	// phpcs:ignore WordPress.WP.AlternativeFunctions.file_get_contents_file_get_contents -- including local file
	$composer_config = json_decode( file_get_contents( $composer_file ), true );
	return ! isset( $composer_config['version'] );
}

/**
 * If development version is detected and the Jetpack constant is not defined, show a notice.
 */
if ( woocommerce_blocks_is_development_version() && ! defined( 'JETPACK_AUTOLOAD_DEV' ) ) {
	add_action(
		'admin_notices',
		function() {
			echo '<div class="error"><p>';
			printf(
				/* translators: %1$s is referring to a php constant name, %2$s is referring to the wp-config.php file. */
				esc_html__( 'WooCommerce Blocks development mode requires the %1$s constant to be defined and true in your %2$s file. Otherwise you are loading the blocks package from WooCommerce core.', 'woocommerce' ),
				'JETPACK_AUTOLOAD_DEV',
				'wp-config.php'
			);
			echo '</p></div>';
		}
	);
}


/**
 * Autoload packages.
 *
 * The package autoloader includes version information which prevents classes in this feature plugin
 * conflicting with WooCommerce core.
 *
 * We want to fail gracefully if `composer install` has not been executed yet, so we are checking for the autoloader.
 * If the autoloader is not present, let's log the failure and display a nice admin notice.
 */
$autoloader = __DIR__ . '/vendor/autoload_packages.php';
if ( is_readable( $autoloader ) ) {
	require $autoloader;
} else {
	if ( defined( 'WP_DEBUG' ) && WP_DEBUG ) {
		error_log(  // phpcs:ignore
			sprintf(
				/* translators: 1: composer command. 2: plugin directory */
				esc_html__( 'Your installation of the WooCommerce Blocks feature plugin is incomplete. Please run %1$s within the %2$s directory.', 'woocommerce' ),
				'`composer install`',
				'`' . esc_html( str_replace( ABSPATH, '', __DIR__ ) ) . '`'
			)
		);
	}
	/**
	 * Outputs an admin notice if composer install has not been ran.
	 */
	add_action(
		'admin_notices',
		function() {
			?>
			<div class="notice notice-error">
				<p>
					<?php
					printf(
						/* translators: 1: composer command. 2: plugin directory */
						esc_html__( 'Your installation of the WooCommerce Blocks feature plugin is incomplete. Please run %1$s within the %2$s directory.', 'woocommerce' ),
						'<code>composer install</code>',
						'<code>' . esc_html( str_replace( ABSPATH, '', __DIR__ ) ) . '</code>'
					);
					?>
				</p>
			</div>
			<?php
		}
	);
	return;
}

add_action( 'plugins_loaded', array( '\Automattic\WooCommerce\Blocks\Package', 'init' ) );

/**
 * Pre-filters script translations for the given file, script handle and text domain.
 *
 * @param string|false|null $translations JSON-encoded translation data. Default null.
 * @param string|false      $file         Path to the translation file to load. False if there isn't one.
 * @param string            $handle       Name of the script to register a translation domain to.
 * @param string            $domain       The text domain.
 * @return string JSON translations.
 */
function woocommerce_blocks_get_i18n_data_json( $translations, $file, $handle, $domain ) {
	if ( 'woo-gutenberg-products-block' !== $domain ) {
		return $translations;
	}

	global $wp_scripts;

	if ( ! isset( $wp_scripts->registered[ $handle ], $wp_scripts->registered[ $handle ]->src ) ) {
		return $translations;
	}

	$handle_filename = basename( $wp_scripts->registered[ $handle ]->src );
	$locale          = determine_locale();
	$lang_dir        = WP_LANG_DIR . '/plugins';

	// Translations are always based on the unminified filename.
	if ( substr( $handle_filename, -7 ) === '.min.js' ) {
		$handle_filename = substr( $handle_filename, 0, -7 ) . '.js';
	}

	// WordPress 5.0 uses md5 hashes of file paths to associate translation
	// JSON files with the file they should be included for. This is an md5
	// of 'packages/woocommerce-blocks/build/FILENAME.js'.
	$core_path_md5     = md5( 'packages/woocommerce-blocks/build/' . $handle_filename );
	$core_json_file    = $lang_dir . '/woocommerce-' . $locale . '-' . $core_path_md5 . '.json';
	$json_translations = is_file( $core_json_file ) && is_readable( $core_json_file ) ? file_get_contents( $core_json_file ) : false; // phpcs:ignore

	if ( ! $json_translations ) {
		return $translations;
	}

	// Rather than short circuit pre_load_script_translations, we will output
	// core translations using an inline script. This will allow us to continue
	// to load feature-plugin translations which may exist as well.
	$output = <<<JS
	( function( domain, translations ) {
		var localeData = translations.locale_data[ domain ] || translations.locale_data.messages;
		localeData[""].domain = domain;
		wp.i18n.setLocaleData( localeData, domain );
	} )( "{$domain}", {$json_translations} );
JS;

	printf( "<script type='text/javascript'>\n%s\n</script>\n", $output ); // phpcs:ignore

	// Finally, short circuit the pre_load_script_translations hook by returning
	// the translation JSON from the feature plugin, if it exists so this hook
	// does not run again for the current handle.
	$path_md5     = md5( 'build/' . $handle_filename );
	$json_file    = $lang_dir . '/' . $domain . '-' . $locale . '-' . $path_md5 . '.json';
	$translations = is_file( $json_file ) && is_readable( $json_file ) ? file_get_contents( $json_file ) : false; // phpcs:ignore

	if ( $translations ) {
		return $translations;
	}

	// Return valid empty Jed locale.
	return '{ "locale_data": { "messages": { "": {} } } }';
}

add_filter( 'pre_load_script_translations', 'woocommerce_blocks_get_i18n_data_json', 10, 4 );

/**
 * Filter translations so we can retrieve translations from Core when the original and the translated
 * texts are the same (which happens when translations are missing).
 *
 * @param string $translation Translated text based on WC Blocks translations.
 * @param string $text        Text to translate.
 * @param string $domain      The text domain.
 * @return string WC Blocks translation. In case it's the same as $text, Core translation.
 */
function woocommerce_blocks_get_php_translation_from_core( $translation, $text, $domain ) {
	if ( 'woo-gutenberg-products-block' !== $domain ) {
		return $translation;
	}

	// When translation is the same, that could mean the string is not translated.
	// In that case, load it from core.
	if ( $translation === $text ) {
		return translate( $text, 'woocommerce' ); // phpcs:ignore WordPress.WP.I18n.LowLevelTranslationFunction, WordPress.WP.I18n.NonSingularStringLiteralText, WordPress.WP.I18n.TextDomainMismatch
	}
	return $translation;
}

add_filter( 'gettext', 'woocommerce_blocks_get_php_translation_from_core', 10, 3 );
woocommerce-blocks/src/InboxNotifications.php000064400000011665151335517640015472 0ustar00<?php
namespace Automattic\WooCommerce\Blocks;

use Automattic\WooCommerce\Admin\Notes\Note;
use Automattic\WooCommerce\Admin\Notes\Notes;

/**
 * A class used to display inbox messages to merchants in the WooCommerce Admin dashboard.
 *
 * @package Automattic\WooCommerce\Blocks
 * @since x.x.x
 */
class InboxNotifications {

	const SURFACE_CART_CHECKOUT_NOTE_NAME          = 'surface_cart_checkout';
	const SURFACE_CART_CHECKOUT_PROBABILITY_OPTION = 'wc_blocks_surface_cart_checkout_probability';
	const PERCENT_USERS_TO_TARGET                  = 50;
	const INELIGIBLE_EXTENSIONS                    = [
		'automatewoo',
		'mailchimp-for-woocommerce',
		'mailpoet',
		'klarna-payments-for-woocommerce',
		'klarna-checkout-for-woocommerce',
		'woocommerce-gutenberg-products-block', // Disallow the notification if the store is using the feature plugin already.
		'woocommerce-all-products-for-subscriptions',
		'woocommerce-bookings',
		'woocommerce-box-office',
		'woocommerce-cart-add-ons',
		'woocommerce-checkout-add-ons',
		'woocommerce-checkout-field-editor',
		'woocommerce-conditional-shipping-and-payments',
		'woocommerce-dynamic-pricing',
		'woocommerce-eu-vat-number',
		'woocommerce-follow-up-emails',
		'woocommerce-gateway-amazon-payments-advanced',
		'woocommerce-gateway-authorize-net-cim',
		'woocommerce-google-analytics-pro',
		'woocommerce-memberships',
		'woocommerce-paypal-payments',
		'woocommerce-pre-orders',
		'woocommerce-product-bundles',
		'woocommerce-shipping-fedex',
		'woocommerce-smart-coupons',
	];
	const ELIGIBLE_COUNTRIES                       = [
		'GB',
		'US',
	];


	/**
	 * Deletes the note.
	 */
	public static function delete_surface_cart_checkout_blocks_notification() {
		Notes::delete_notes_with_name( self::SURFACE_CART_CHECKOUT_NOTE_NAME );
	}

	/**
	 * Creates a notification letting merchants know about the Cart and Checkout Blocks.
	 */
	public static function create_surface_cart_checkout_blocks_notification() {

		// If this is the feature plugin, then we don't need to do this. This should only show when Blocks is bundled
		// with WooCommerce Core.
		if ( Package::feature()->is_feature_plugin_build() ) {
			return;
		}

		if ( ! class_exists( 'Automattic\WooCommerce\Admin\Notes\WC_Admin_Notes' ) ) {
			return;
		}

		if ( ! class_exists( 'WC_Data_Store' ) ) {
			return;
		}

		$data_store = \WC_Data_Store::load( 'admin-note' );
		$note_ids   = $data_store->get_notes_with_name( self::SURFACE_CART_CHECKOUT_NOTE_NAME );

		// Calculate store's eligibility to be shown the notice, starting with whether they have any plugins we know to
		// be incompatible with Blocks. This check is done before checking if the note exists already because we want to
		// delete the note if the merchant activates an ineligible plugin.
		foreach ( self::INELIGIBLE_EXTENSIONS as $extension ) {
			if ( is_plugin_active( $extension . '/' . $extension . '.php' ) ) {

				// Delete the notification here, we shouldn't show it if it's not going to work with the merchant's site.
				self::delete_surface_cart_checkout_blocks_notification();
				return;
			}
		}

		foreach ( (array) $note_ids as $note_id ) {
			$note = Notes::get_note( $note_id );

			// Return now because the note already exists.
			if ( $note->get_name() === self::SURFACE_CART_CHECKOUT_NOTE_NAME ) {
				return;
			}
		}

		// Next check the store is located in one of the eligible countries.
		$raw_country = get_option( 'woocommerce_default_country' );
		$country     = explode( ':', $raw_country )[0];
		if ( ! in_array( $country, self::ELIGIBLE_COUNTRIES, true ) ) {
			return;
		}

		// Pick a random number between 1 and 100 and add this to the wp_options table. This can then be used to target
		// a percentage of users. We do this here so we target a truer percentage of eligible users than if we did it
		// before checking plugins/country.
		$existing_probability = get_option( self::SURFACE_CART_CHECKOUT_PROBABILITY_OPTION );
		if ( false === $existing_probability ) {
			$existing_probability = wp_rand( 0, 100 );
			add_option( self::SURFACE_CART_CHECKOUT_PROBABILITY_OPTION, $existing_probability );
		}

		// Finally, check if the store's generated % chance is below the % of users we want to surface this to.
		if ( $existing_probability > self::PERCENT_USERS_TO_TARGET ) {
			return;
		}

		// At this point, the store meets all the criteria to be shown the notice! Woo!
		$note = new Note();
		$note->set_title(
			__(
				'Introducing the Cart and Checkout blocks!',
				'woocommerce'
			)
		);
		$note->set_content(
			__(
				"Increase your store's revenue with the conversion optimized Cart & Checkout WooCommerce blocks available in the WooCommerce Blocks extension.",
				'woocommerce'
			)
		);
		$note->set_type( Note::E_WC_ADMIN_NOTE_INFORMATIONAL );
		$note->set_source( 'woo-gutenberg-products-block' );
		$note->set_name( self::SURFACE_CART_CHECKOUT_NOTE_NAME );
		$note->add_action(
			'learn_more',
			'Learn More',
			'https://woocommerce.com/checkout-blocks/'
		);
		$note->save();

	}
}
woocommerce-blocks/src/Payments/Integrations/PayPal.php000064400000004071151335517640017306 0ustar00<?php
namespace Automattic\WooCommerce\Blocks\Payments\Integrations;

use WC_Gateway_Paypal;
use Automattic\WooCommerce\Blocks\Assets\Api;

/**
 * PayPal Standard payment method integration
 *
 * @since 2.6.0
 */
final class PayPal extends AbstractPaymentMethodType {
	/**
	 * Payment method name defined by payment methods extending this class.
	 *
	 * @var string
	 */
	protected $name = 'paypal';

	/**
	 * An instance of the Asset Api
	 *
	 * @var Api
	 */
	private $asset_api;

	/**
	 * Constructor
	 *
	 * @param Api $asset_api An instance of Api.
	 */
	public function __construct( Api $asset_api ) {
		$this->asset_api = $asset_api;
	}

	/**
	 * Initializes the payment method type.
	 */
	public function initialize() {
		$this->settings = get_option( 'woocommerce_paypal_settings', [] );
	}

	/**
	 * Returns if this payment method should be active. If false, the scripts will not be enqueued.
	 *
	 * @return boolean
	 */
	public function is_active() {
		return filter_var( $this->get_setting( 'enabled', false ), FILTER_VALIDATE_BOOLEAN );
	}

	/**
	 * Returns an array of scripts/handles to be registered for this payment method.
	 *
	 * @return array
	 */
	public function get_payment_method_script_handles() {
		$this->asset_api->register_script(
			'wc-payment-method-paypal',
			'build/wc-payment-method-paypal.js'
		);
		return [ 'wc-payment-method-paypal' ];
	}

	/**
	 * Returns an array of key=>value pairs of data made available to the payment methods script.
	 *
	 * @return array
	 */
	public function get_payment_method_data() {
		return [
			'title'       => $this->get_setting( 'title' ),
			'description' => $this->get_setting( 'description' ),
			'supports'    => $this->get_supported_features(),
		];
	}

	/**
	 * Returns an array of supported features.
	 *
	 * @return string[]
	 */
	public function get_supported_features() {
		$gateway  = new WC_Gateway_Paypal();
		$features = array_filter( $gateway->supports, array( $gateway, 'supports' ) );
		return apply_filters( '__experimental_woocommerce_blocks_payment_gateway_features_list', $features, $this->get_name() );
	}
}
woocommerce-blocks/src/Payments/Integrations/BankTransfer.php000064400000003261151335517640020500 0ustar00<?php
namespace Automattic\WooCommerce\Blocks\Payments\Integrations;

use Automattic\WooCommerce\Blocks\Assets\Api;

/**
 * Bank Transfer (BACS) payment method integration
 *
 * @since 3.0.0
 */
final class BankTransfer extends AbstractPaymentMethodType {
	/**
	 * Payment method name/id/slug (matches id in WC_Gateway_BACS in core).
	 *
	 * @var string
	 */
	protected $name = 'bacs';

	/**
	 * An instance of the Asset Api
	 *
	 * @var Api
	 */
	private $asset_api;

	/**
	 * Constructor
	 *
	 * @param Api $asset_api An instance of Api.
	 */
	public function __construct( Api $asset_api ) {
		$this->asset_api = $asset_api;
	}

	/**
	 * Initializes the payment method type.
	 */
	public function initialize() {
		$this->settings = get_option( 'woocommerce_bacs_settings', [] );
	}

	/**
	 * Returns if this payment method should be active. If false, the scripts will not be enqueued.
	 *
	 * @return boolean
	 */
	public function is_active() {
		return filter_var( $this->get_setting( 'enabled', false ), FILTER_VALIDATE_BOOLEAN );
	}

	/**
	 * Returns an array of scripts/handles to be registered for this payment method.
	 *
	 * @return array
	 */
	public function get_payment_method_script_handles() {
		$this->asset_api->register_script(
			'wc-payment-method-bacs',
			'build/wc-payment-method-bacs.js'
		);
		return [ 'wc-payment-method-bacs' ];
	}

	/**
	 * Returns an array of key=>value pairs of data made available to the payment methods script.
	 *
	 * @return array
	 */
	public function get_payment_method_data() {
		return [
			'title'       => $this->get_setting( 'title' ),
			'description' => $this->get_setting( 'description' ),
			'supports'    => $this->get_supported_features(),
		];
	}
}
woocommerce-blocks/src/Payments/Integrations/AbstractPaymentMethodType.php000064400000005425151335517640023230 0ustar00<?php
namespace Automattic\WooCommerce\Blocks\Payments\Integrations;

use Automattic\WooCommerce\Blocks\Payments\PaymentMethodTypeInterface;

/**
 * AbstractPaymentMethodType class.
 *
 * @since 2.6.0
 */
abstract class AbstractPaymentMethodType implements PaymentMethodTypeInterface {
	/**
	 * Payment method name defined by payment methods extending this class.
	 *
	 * @var string
	 */
	protected $name = '';

	/**
	 * Settings from the WP options table
	 *
	 * @var array
	 */
	protected $settings = [];

	/**
	 * Get a setting from the settings array if set.
	 *
	 * @param string $name Setting name.
	 * @param mixed  $default Value that is returned if the setting does not exist.
	 * @return mixed
	 */
	protected function get_setting( $name, $default = '' ) {
		return isset( $this->settings[ $name ] ) ? $this->settings[ $name ] : $default;
	}

	/**
	 * Returns the name of the payment method.
	 */
	public function get_name() {
		return $this->name;
	}

	/**
	 * Returns if this payment method should be active. If false, the scripts will not be enqueued.
	 *
	 * @return boolean
	 */
	public function is_active() {
		return true;
	}

	/**
	 * Returns an array of script handles to enqueue for this payment method in
	 * the frontend context
	 *
	 * @return string[]
	 */
	public function get_payment_method_script_handles() {
		return [];
	}

	/**
	 * Returns an array of script handles to enqueue for this payment method in
	 * the admin context
	 *
	 * @return string[]
	 */
	public function get_payment_method_script_handles_for_admin() {
		return $this->get_payment_method_script_handles();
	}

	/**
	 * Returns an array of supported features.
	 *
	 * @return string[]
	 */
	public function get_supported_features() {
		return [ 'products' ];
	}

	/**
	 * An array of key, value pairs of data made available to payment methods
	 * client side.
	 *
	 * @return array
	 */
	public function get_payment_method_data() {
		return [];
	}

	/**
	 * Returns an array of script handles to enqueue in the frontend context.
	 *
	 * Alias of get_payment_method_script_handles. Defined by IntegrationInterface.
	 *
	 * @return string[]
	 */
	public function get_script_handles() {
		return $this->get_payment_method_script_handles();
	}

	/**
	 * Returns an array of script handles to enqueue in the admin context.
	 *
	 * Alias of get_payment_method_script_handles_for_admin. Defined by IntegrationInterface.
	 *
	 * @return string[]
	 */
	public function get_editor_script_handles() {
		return $this->get_payment_method_script_handles_for_admin();
	}

	/**
	 * An array of key, value pairs of data made available to the block on the client side.
	 *
	 * Alias of get_payment_method_data. Defined by IntegrationInterface.
	 *
	 * @return array
	 */
	public function get_script_data() {
		return $this->get_payment_method_data();
	}
}
woocommerce-blocks/src/Payments/Integrations/CashOnDelivery.php000064400000004756151335517640021011 0ustar00<?php
namespace Automattic\WooCommerce\Blocks\Payments\Integrations;

use Automattic\WooCommerce\Blocks\Assets\Api;

/**
 * Cash on Delivery (COD) payment method integration
 *
 * @since 3.0.0
 */
final class CashOnDelivery extends AbstractPaymentMethodType {
	/**
	 * Payment method name/id/slug (matches id in WC_Gateway_COD in core).
	 *
	 * @var string
	 */
	protected $name = 'cod';

	/**
	 * An instance of the Asset Api
	 *
	 * @var Api
	 */
	private $asset_api;

	/**
	 * Constructor
	 *
	 * @param Api $asset_api An instance of Api.
	 */
	public function __construct( Api $asset_api ) {
		$this->asset_api = $asset_api;
	}

	/**
	 * Initializes the payment method type.
	 */
	public function initialize() {
		$this->settings = get_option( 'woocommerce_cod_settings', [] );
	}

	/**
	 * Returns if this payment method should be active. If false, the scripts will not be enqueued.
	 *
	 * @return boolean
	 */
	public function is_active() {
		return filter_var( $this->get_setting( 'enabled', false ), FILTER_VALIDATE_BOOLEAN );
	}

	/**
	 * Return enable_for_virtual option.
	 *
	 * @return boolean True if store allows COD payment for orders containing only virtual products.
	 */
	private function get_enable_for_virtual() {
		return filter_var( $this->get_setting( 'enable_for_virtual', false ), FILTER_VALIDATE_BOOLEAN );
	}

	/**
	 * Return enable_for_methods option.
	 *
	 * @return array Array of shipping methods (string ids) that allow COD. (If empty, all support COD.)
	 */
	private function get_enable_for_methods() {
		$enable_for_methods = $this->get_setting( 'enable_for_methods', [] );
		if ( '' === $enable_for_methods ) {
			return [];
		}
		return $enable_for_methods;
	}


	/**
	 * Returns an array of scripts/handles to be registered for this payment method.
	 *
	 * @return array
	 */
	public function get_payment_method_script_handles() {
		$this->asset_api->register_script(
			'wc-payment-method-cod',
			'build/wc-payment-method-cod.js'
		);
		return [ 'wc-payment-method-cod' ];
	}

	/**
	 * Returns an array of key=>value pairs of data made available to the payment methods script.
	 *
	 * @return array
	 */
	public function get_payment_method_data() {
		return [
			'title'                    => $this->get_setting( 'title' ),
			'description'              => $this->get_setting( 'description' ),
			'enableForVirtual'         => $this->get_enable_for_virtual(),
			'enableForShippingMethods' => $this->get_enable_for_methods(),
			'supports'                 => $this->get_supported_features(),
		];
	}
}
woocommerce-blocks/src/Payments/Integrations/Stripe.php000064400000026470151335517640017375 0ustar00<?php
namespace Automattic\WooCommerce\Blocks\Payments\Integrations;

use Exception;
use WC_Stripe_Payment_Request;
use WC_Stripe_Helper;
use WC_Gateway_Stripe;
use Automattic\WooCommerce\Blocks\Assets\Api;
use Automattic\WooCommerce\Blocks\Payments\PaymentContext;
use Automattic\WooCommerce\Blocks\Payments\PaymentResult;

/**
 * Stripe payment method integration
 *
 * Temporary integration of the stripe payment method for the new cart and
 * checkout blocks. Once the api is demonstrated to be stable, this integration
 * will be moved to the Stripe extension
 *
 * @since 2.6.0
 */
final class Stripe extends AbstractPaymentMethodType {
	/**
	 * Payment method name defined by payment methods extending this class.
	 *
	 * @var string
	 */
	protected $name = 'stripe';

	/**
	 * An instance of the Asset Api
	 *
	 * @var Api
	 */
	private $asset_api;

	/**
	 * Constructor
	 *
	 * @param Api $asset_api An instance of Api.
	 */
	public function __construct( Api $asset_api ) {
		$this->asset_api = $asset_api;
		add_action( 'woocommerce_rest_checkout_process_payment_with_context', [ $this, 'add_payment_request_order_meta' ], 8, 2 );
		add_action( 'woocommerce_rest_checkout_process_payment_with_context', [ $this, 'add_stripe_intents' ], 9999, 2 );
	}

	/**
	 * Initializes the payment method type.
	 */
	public function initialize() {
		$this->settings = get_option( 'woocommerce_stripe_settings', [] );
	}

	/**
	 * Returns if this payment method should be active. If false, the scripts will not be enqueued.
	 *
	 * @return boolean
	 */
	public function is_active() {
		return ! empty( $this->settings['enabled'] ) && 'yes' === $this->settings['enabled'];
	}

	/**
	 * Returns an array of scripts/handles to be registered for this payment method.
	 *
	 * @return array
	 */
	public function get_payment_method_script_handles() {
		$this->asset_api->register_script(
			'wc-payment-method-stripe',
			'build/wc-payment-method-stripe.js',
			[]
		);

		return [ 'wc-payment-method-stripe' ];
	}

	/**
	 * Returns an array of key=>value pairs of data made available to the payment methods script.
	 *
	 * @return array
	 */
	public function get_payment_method_data() {
		return [
			'stripeTotalLabel'    => $this->get_total_label(),
			'publicKey'           => $this->get_publishable_key(),
			'allowPrepaidCard'    => $this->get_allow_prepaid_card(),
			'title'               => $this->get_title(),
			'button'              => [
				'type'   => $this->get_button_type(),
				'theme'  => $this->get_button_theme(),
				'height' => $this->get_button_height(),
				'locale' => $this->get_button_locale(),
			],
			'inline_cc_form'      => $this->get_inline_cc_form(),
			'icons'               => $this->get_icons(),
			'showSavedCards'      => $this->get_show_saved_cards(),
			'allowPaymentRequest' => $this->get_allow_payment_request(),
			'showSaveOption'      => $this->get_show_save_option(),
			'supports'            => $this->get_supported_features(),
		];
	}

	/**
	 * Determine if store allows cards to be saved during checkout.
	 *
	 * @return bool True if merchant allows shopper to save card (payment method) during checkout).
	 */
	private function get_show_saved_cards() {
		return isset( $this->settings['saved_cards'] ) ? 'yes' === $this->settings['saved_cards'] : false;
	}

	/**
	 * Determine if the checkbox to enable the user to save their payment method should be shown.
	 *
	 * @return bool True if the save payment checkbox should be displayed to the user.
	 */
	private function get_show_save_option() {
		$saved_cards = $this->get_show_saved_cards();
		// This assumes that Stripe supports `tokenization` - currently this is true, based on
		// https://github.com/woocommerce/woocommerce-gateway-stripe/blob/master/includes/class-wc-gateway-stripe.php#L95 .
		// See https://github.com/woocommerce/woocommerce-gateway-stripe/blob/ad19168b63df86176cbe35c3e95203a245687640/includes/class-wc-gateway-stripe.php#L271 and
		// https://github.com/woocommerce/woocommerce/wiki/Payment-Token-API .
		return apply_filters( 'wc_stripe_display_save_payment_method_checkbox', filter_var( $saved_cards, FILTER_VALIDATE_BOOLEAN ) );
	}

	/**
	 * Returns the label to use accompanying the total in the stripe statement.
	 *
	 * @return string Statement descriptor.
	 */
	private function get_total_label() {
		return ! empty( $this->settings['statement_descriptor'] ) ? WC_Stripe_Helper::clean_statement_descriptor( $this->settings['statement_descriptor'] ) : '';
	}

	/**
	 * Returns the publishable api key for the Stripe service.
	 *
	 * @return string Public api key.
	 */
	private function get_publishable_key() {
		$test_mode   = ( ! empty( $this->settings['testmode'] ) && 'yes' === $this->settings['testmode'] );
		$setting_key = $test_mode ? 'test_publishable_key' : 'publishable_key';
		return ! empty( $this->settings[ $setting_key ] ) ? $this->settings[ $setting_key ] : '';
	}

	/**
	 * Returns whether to allow prepaid cards for payments.
	 *
	 * @return bool True means to allow prepaid card (default).
	 */
	private function get_allow_prepaid_card() {
		return apply_filters( 'wc_stripe_allow_prepaid_card', true );
	}

	/**
	 * Returns the title string to use in the UI (customisable via admin settings screen).
	 *
	 * @return string Title / label string
	 */
	private function get_title() {
		return isset( $this->settings['title'] ) ? $this->settings['title'] : __( 'Credit / Debit Card', 'woocommerce' );
	}

	/**
	 * Determine if store allows Payment Request buttons - e.g. Apple Pay / Chrome Pay.
	 *
	 * @return bool True if merchant has opted into payment request.
	 */
	private function get_allow_payment_request() {
		$option = isset( $this->settings['payment_request'] ) ? $this->settings['payment_request'] : false;
		return filter_var( $option, FILTER_VALIDATE_BOOLEAN );
	}

	/**
	 * Return the button type for the payment button.
	 *
	 * @return string Defaults to 'default'.
	 */
	private function get_button_type() {
		return isset( $this->settings['payment_request_button_type'] ) ? $this->settings['payment_request_button_type'] : 'default';
	}

	/**
	 * Return the theme to use for the payment button.
	 *
	 * @return string Defaults to 'dark'.
	 */
	private function get_button_theme() {
		return isset( $this->settings['payment_request_button_theme'] ) ? $this->settings['payment_request_button_theme'] : 'dark';
	}

	/**
	 * Return the height for the payment button.
	 *
	 * @return string A pixel value for the height (defaults to '64').
	 */
	private function get_button_height() {
		return isset( $this->settings['payment_request_button_height'] ) ? str_replace( 'px', '', $this->settings['payment_request_button_height'] ) : '64';
	}

	/**
	 * Return the inline cc option.
	 *
	 * @return boolean True if the inline CC form option is enabled.
	 */
	private function get_inline_cc_form() {
		return isset( $this->settings['inline_cc_form'] ) && 'yes' === $this->settings['inline_cc_form'];
	}

	/**
	 * Return the locale for the payment button.
	 *
	 * @return string Defaults to en_US.
	 */
	private function get_button_locale() {
		return apply_filters( 'wc_stripe_payment_request_button_locale', substr( get_locale(), 0, 2 ) );
	}

	/**
	 * Return the icons urls.
	 *
	 * @return array Arrays of icons metadata.
	 */
	private function get_icons() {
		$icons_src = [
			'visa'       => [
				'src' => WC_STRIPE_PLUGIN_URL . '/assets/images/visa.svg',
				'alt' => __( 'Visa', 'woocommerce' ),
			],
			'amex'       => [
				'src' => WC_STRIPE_PLUGIN_URL . '/assets/images/amex.svg',
				'alt' => __( 'American Express', 'woocommerce' ),
			],
			'mastercard' => [
				'src' => WC_STRIPE_PLUGIN_URL . '/assets/images/mastercard.svg',
				'alt' => __( 'Mastercard', 'woocommerce' ),
			],
		];

		if ( 'USD' === get_woocommerce_currency() ) {
			$icons_src['discover'] = [
				'src' => WC_STRIPE_PLUGIN_URL . '/assets/images/discover.svg',
				'alt' => __( 'Discover', 'woocommerce' ),
			];
			$icons_src['jcb']      = [
				'src' => WC_STRIPE_PLUGIN_URL . '/assets/images/jcb.svg',
				'alt' => __( 'JCB', 'woocommerce' ),
			];
			$icons_src['diners']   = [
				'src' => WC_STRIPE_PLUGIN_URL . '/assets/images/diners.svg',
				'alt' => __( 'Diners', 'woocommerce' ),
			];
		}
		return $icons_src;
	}

	/**
	 * Add payment request data to the order meta as hooked on the
	 * woocommerce_rest_checkout_process_payment_with_context action.
	 *
	 * @param PaymentContext $context Holds context for the payment.
	 * @param PaymentResult  $result  Result object for the payment.
	 */
	public function add_payment_request_order_meta( PaymentContext $context, PaymentResult &$result ) {
		$data = $context->payment_data;
		if ( ! empty( $data['payment_request_type'] ) && 'stripe' === $context->payment_method ) {
			// phpcs:ignore WordPress.Security.NonceVerification
			$post_data = $_POST;
			$_POST     = $context->payment_data;
			$this->add_order_meta( $context->order, $data['payment_request_type'] );
			$_POST = $post_data;
		}

		// hook into stripe error processing so that we can capture the error to
		// payment details (which is added to notices and thus not helpful for
		// this context).
		if ( 'stripe' === $context->payment_method ) {
			add_action(
				'wc_gateway_stripe_process_payment_error',
				function( $error ) use ( &$result ) {
					$payment_details                 = $result->payment_details;
					$payment_details['errorMessage'] = wp_strip_all_tags( $error->getLocalizedMessage() );
					$result->set_payment_details( $payment_details );
				}
			);
		}
	}

	/**
	 * Handles any potential stripe intents on the order that need handled.
	 *
	 * This is configured to execute after legacy payment processing has
	 * happened on the woocommerce_rest_checkout_process_payment_with_context
	 * action hook.
	 *
	 * @param PaymentContext $context Holds context for the payment.
	 * @param PaymentResult  $result  Result object for the payment.
	 */
	public function add_stripe_intents( PaymentContext $context, PaymentResult &$result ) {
		if ( 'stripe' === $context->payment_method
			&& (
				! empty( $result->payment_details['payment_intent_secret'] )
				|| ! empty( $result->payment_details['setup_intent_secret'] )
			)
		) {
			$payment_details                          = $result->payment_details;
			$payment_details['verification_endpoint'] = add_query_arg(
				[
					'order'       => $context->order->get_id(),
					'nonce'       => wp_create_nonce( 'wc_stripe_confirm_pi' ),
					'redirect_to' => rawurlencode( $result->redirect_url ),
				],
				home_url() . \WC_Ajax::get_endpoint( 'wc_stripe_verify_intent' )
			);
			$result->set_payment_details( $payment_details );
			$result->set_status( 'success' );
		}
	}

	/**
	 * Handles adding information about the payment request type used to the order meta.
	 *
	 * @param \WC_Order $order The order being processed.
	 * @param string    $payment_request_type The payment request type used for payment.
	 */
	private function add_order_meta( \WC_Order $order, string $payment_request_type ) {
		if ( 'apple_pay' === $payment_request_type ) {
			$order->set_payment_method_title( 'Apple Pay (Stripe)' );
			$order->save();
		}

		if ( 'payment_request_api' === $payment_request_type ) {
			$order->set_payment_method_title( 'Chrome Payment Request (Stripe)' );
			$order->save();
		}
	}

	/**
	 * Returns an array of supported features.
	 *
	 * @return string[]
	 */
	public function get_supported_features() {
		$gateway = new WC_Gateway_Stripe();
		return array_filter( $gateway->supports, array( $gateway, 'supports' ) );
	}
}
woocommerce-blocks/src/Payments/Integrations/Cheque.php000064400000003266151335517640017337 0ustar00<?php
namespace Automattic\WooCommerce\Blocks\Payments\Integrations;

use Exception;
use Automattic\WooCommerce\Blocks\Assets\Api;

/**
 * Cheque payment method integration
 *
 * @since 2.6.0
 */
final class Cheque extends AbstractPaymentMethodType {
	/**
	 * Payment method name defined by payment methods extending this class.
	 *
	 * @var string
	 */
	protected $name = 'cheque';

	/**
	 * An instance of the Asset Api
	 *
	 * @var Api
	 */
	private $asset_api;

	/**
	 * Constructor
	 *
	 * @param Api $asset_api An instance of Api.
	 */
	public function __construct( Api $asset_api ) {
		$this->asset_api = $asset_api;
	}

	/**
	 * Initializes the payment method type.
	 */
	public function initialize() {
		$this->settings = get_option( 'woocommerce_cheque_settings', [] );
	}

	/**
	 * Returns if this payment method should be active. If false, the scripts will not be enqueued.
	 *
	 * @return boolean
	 */
	public function is_active() {
		return filter_var( $this->get_setting( 'enabled', false ), FILTER_VALIDATE_BOOLEAN );
	}

	/**
	 * Returns an array of scripts/handles to be registered for this payment method.
	 *
	 * @return array
	 */
	public function get_payment_method_script_handles() {
		$this->asset_api->register_script(
			'wc-payment-method-cheque',
			'build/wc-payment-method-cheque.js'
		);
		return [ 'wc-payment-method-cheque' ];
	}

	/**
	 * Returns an array of key=>value pairs of data made available to the payment methods script.
	 *
	 * @return array
	 */
	public function get_payment_method_data() {
		return [
			'title'       => $this->get_setting( 'title' ),
			'description' => $this->get_setting( 'description' ),
			'supports'    => $this->get_supported_features(),
		];
	}
}
woocommerce-blocks/src/Payments/PaymentContext.php000064400000003471151335517640016437 0ustar00<?php
namespace Automattic\WooCommerce\Blocks\Payments;

/**
 * PaymentContext class.
 */
class PaymentContext {
	/**
	 * Payment method ID.
	 *
	 * @var string
	 */
	protected $payment_method = '';

	/**
	 * Order object for the order being paid.
	 *
	 * @var \WC_Order
	 */
	protected $order;

	/**
	 * Holds data to send to the payment gateway to support payment.
	 *
	 * @var array Key value pairs.
	 */
	protected $payment_data = [];

	/**
	 * Magic getter for protected properties.
	 *
	 * @param string $name Property name.
	 */
	public function __get( $name ) {
		if ( in_array( $name, [ 'payment_method', 'order', 'payment_data' ], true ) ) {
			return $this->$name;
		}
		return null;
	}

	/**
	 * Set the chosen payment method ID context.
	 *
	 * @param string $payment_method Payment method ID.
	 */
	public function set_payment_method( $payment_method ) {
		$this->payment_method = (string) $payment_method;
	}

	/**
	 * Retrieve the payment method instance for the current set payment method.
	 *
	 * @return {\WC_Payment_Gateway|null} An instance of the payment gateway if it exists.
	 */
	public function get_payment_method_instance() {
		$available_gateways = WC()->payment_gateways->get_available_payment_gateways();
		if ( ! isset( $available_gateways[ $this->payment_method ] ) ) {
			return;
		}
		return $available_gateways[ $this->payment_method ];
	}

	/**
	 * Set the order context.
	 *
	 * @param \WC_Order $order Order object.
	 */
	public function set_order( \WC_Order $order ) {
		$this->order = $order;
	}

	/**
	 * Set payment data context.
	 *
	 * @param array $payment_data Array of key value pairs of data.
	 */
	public function set_payment_data( $payment_data = [] ) {
		$this->payment_data = [];

		foreach ( $payment_data as $key => $value ) {
			$this->payment_data[ (string) $key ] = (string) $value;
		}
	}
}
woocommerce-blocks/src/Payments/PaymentMethodRegistry.php000064400000003520151335517640017757 0ustar00<?php
namespace Automattic\WooCommerce\Blocks\Payments;

use Automattic\WooCommerce\Blocks\Integrations\IntegrationRegistry;

/**
 * Class used for interacting with payment method types.
 *
 * @since 2.6.0
 */
final class PaymentMethodRegistry extends IntegrationRegistry {
	/**
	 * Integration identifier is used to construct hook names and is given when the integration registry is initialized.
	 *
	 * @var string
	 */
	protected $registry_identifier = 'payment_method_type';

	/**
	 * Retrieves all registered payment methods that are also active.
	 *
	 * @return PaymentMethodTypeInterface[]
	 */
	public function get_all_active_registered() {
		return array_filter(
			$this->get_all_registered(),
			function( $payment_method ) {
				return $payment_method->is_active();
			}
		);
	}

	/**
	 * Gets an array of all registered payment method script handles, but only for active payment methods.
	 *
	 * @return string[]
	 */
	public function get_all_active_payment_method_script_dependencies() {
		$script_handles  = [];
		$payment_methods = $this->get_all_active_registered();

		foreach ( $payment_methods as $payment_method ) {
			$script_handles = array_merge(
				$script_handles,
				is_admin() ? $payment_method->get_payment_method_script_handles_for_admin() : $payment_method->get_payment_method_script_handles()
			);
		}

		return array_unique( array_filter( $script_handles ) );
	}

	/**
	 * Gets an array of all registered payment method script data, but only for active payment methods.
	 *
	 * @return array
	 */
	public function get_all_registered_script_data() {
		$script_data     = [];
		$payment_methods = $this->get_all_active_registered();

		foreach ( $payment_methods as $payment_method ) {
			$script_data[ $payment_method->get_name() . '_data' ] = $payment_method->get_payment_method_data();
		}

		return array_filter( $script_data );
	}
}
woocommerce-blocks/src/Payments/PaymentMethodTypeInterface.php000064400000002012151335517640020704 0ustar00<?php
namespace Automattic\WooCommerce\Blocks\Payments;

use Automattic\WooCommerce\Blocks\Integrations\IntegrationInterface;

interface PaymentMethodTypeInterface extends IntegrationInterface {
	/**
	 * Returns if this payment method should be active. If false, the scripts will not be enqueued.
	 *
	 * @return boolean
	 */
	public function is_active();

	/**
	 * Returns an array of script handles to enqueue for this payment method in
	 * the frontend context
	 *
	 * @return string[]
	 */
	public function get_payment_method_script_handles();

	/**
	 * Returns an array of script handles to enqueue for this payment method in
	 * the admin context
	 *
	 * @return string[]
	 */
	public function get_payment_method_script_handles_for_admin();

	/**
	 * An array of key, value pairs of data made available to payment methods
	 * client side.
	 *
	 * @return array
	 */
	public function get_payment_method_data();

	/**
	 * Get array of supported features.
	 *
	 * @return string[]
	 */
	public function get_supported_features();
}
woocommerce-blocks/src/Payments/Api.php000064400000022062151335517640014163 0ustar00<?php
namespace Automattic\WooCommerce\Blocks\Payments;

use Automattic\WooCommerce\Blocks\Package;
use Automattic\WooCommerce\Blocks\Assets\AssetDataRegistry;
use Automattic\WooCommerce\Blocks\StoreApi\Utilities\NoticeHandler;
use Automattic\WooCommerce\Blocks\Payments\Integrations\Stripe;
use Automattic\WooCommerce\Blocks\Payments\Integrations\Cheque;
use Automattic\WooCommerce\Blocks\Payments\Integrations\PayPal;
use Automattic\WooCommerce\Blocks\Payments\Integrations\BankTransfer;
use Automattic\WooCommerce\Blocks\Payments\Integrations\CashOnDelivery;

/**
 *  The Api class provides an interface to payment method registration.
 *
 * @since 2.6.0
 */
class Api {
	/**
	 * Reference to the PaymentMethodRegistry instance.
	 *
	 * @var PaymentMethodRegistry
	 */
	private $payment_method_registry;

	/**
	 * Reference to the AssetDataRegistry instance.
	 *
	 * @var AssetDataRegistry
	 */
	private $asset_registry;

	/**
	 * Constructor
	 *
	 * @param PaymentMethodRegistry $payment_method_registry An instance of Payment Method Registry.
	 * @param AssetDataRegistry     $asset_registry  Used for registering data to pass along to the request.
	 */
	public function __construct( PaymentMethodRegistry $payment_method_registry, AssetDataRegistry $asset_registry ) {
		$this->payment_method_registry = $payment_method_registry;
		$this->asset_registry          = $asset_registry;
		$this->init();
	}

	/**
	 * Initialize class features.
	 */
	protected function init() {
		add_action( 'init', array( $this->payment_method_registry, 'initialize' ), 5 );
		add_filter( 'woocommerce_blocks_register_script_dependencies', array( $this, 'add_payment_method_script_dependencies' ), 10, 2 );
		add_action( 'woocommerce_blocks_checkout_enqueue_data', array( $this, 'add_payment_method_script_data' ) );
		add_action( 'woocommerce_blocks_cart_enqueue_data', array( $this, 'add_payment_method_script_data' ) );
		add_action( 'woocommerce_blocks_payment_method_type_registration', array( $this, 'register_payment_method_integrations' ) );
		add_action( 'woocommerce_rest_checkout_process_payment_with_context', array( $this, 'process_legacy_payment' ), 999, 2 );
		add_action( 'wp_print_scripts', array( $this, 'verify_payment_methods_dependencies' ), 1 );
	}

	/**
	 * Add payment method script handles as script dependencies.
	 *
	 * @param array  $dependencies Array of script dependencies.
	 * @param string $handle Script handle.
	 * @return array
	 */
	public function add_payment_method_script_dependencies( $dependencies, $handle ) {
		if ( ! in_array( $handle, [ 'wc-checkout-block', 'wc-checkout-block-frontend', 'wc-cart-block', 'wc-cart-block-frontend', 'wc-cart-i2-block', 'wc-cart-i2-block-frontend' ], true ) ) {
			return $dependencies;
		}
		return array_merge( $dependencies, $this->payment_method_registry->get_all_active_payment_method_script_dependencies() );
	}

	/**
	 * Returns true if the payment gateway is enabled.
	 *
	 * @param object $gateway Payment gateway.
	 * @return boolean
	 */
	private function is_payment_gateway_enabled( $gateway ) {
		return filter_var( $gateway->enabled, FILTER_VALIDATE_BOOLEAN );
	}

	/**
	 * Add payment method data to Asset Registry.
	 */
	public function add_payment_method_script_data() {
		// Enqueue the order of enabled gateways as `paymentGatewaySortOrder`.
		if ( ! $this->asset_registry->exists( 'paymentGatewaySortOrder' ) ) {
			$payment_gateways = WC()->payment_gateways->payment_gateways();
			$enabled_gateways = array_filter( $payment_gateways, array( $this, 'is_payment_gateway_enabled' ) );
			$this->asset_registry->add( 'paymentGatewaySortOrder', array_keys( $enabled_gateways ) );
		}

		// Enqueue all registered gateway data (settings/config etc).
		$script_data = $this->payment_method_registry->get_all_registered_script_data();
		foreach ( $script_data as $asset_data_key => $asset_data_value ) {
			if ( ! $this->asset_registry->exists( $asset_data_key ) ) {
				$this->asset_registry->add( $asset_data_key, $asset_data_value );
			}
		}
	}

	/**
	 * Register payment method integrations bundled with blocks.
	 *
	 * @param PaymentMethodRegistry $payment_method_registry Payment method registry instance.
	 */
	public function register_payment_method_integrations( PaymentMethodRegistry $payment_method_registry ) {
		// This is temporarily registering Stripe until it's moved to the extension.
		if ( class_exists( '\WC_Stripe', false ) && ! $payment_method_registry->is_registered( 'stripe' ) ) {
			$payment_method_registry->register(
				Package::container()->get( Stripe::class )
			);
		}
		$payment_method_registry->register(
			Package::container()->get( Cheque::class )
		);
		$payment_method_registry->register(
			Package::container()->get( PayPal::class )
		);
		$payment_method_registry->register(
			Package::container()->get( BankTransfer::class )
		);
		$payment_method_registry->register(
			Package::container()->get( CashOnDelivery::class )
		);
	}

	/**
	 * Attempt to process a payment for the checkout API if no payment methods support the
	 * woocommerce_rest_checkout_process_payment_with_context action.
	 *
	 * @param PaymentContext $context Holds context for the payment.
	 * @param PaymentResult  $result  Result of the payment.
	 */
	public function process_legacy_payment( PaymentContext $context, PaymentResult &$result ) {
		if ( $result->status ) {
			return;
		}

		// phpcs:ignore WordPress.Security.NonceVerification
		$post_data = $_POST;

		// Set constants.
		wc_maybe_define_constant( 'WOOCOMMERCE_CHECKOUT', true );

		// Add the payment data from the API to the POST global.
		$_POST = $context->payment_data;

		// Call the process payment method of the chosen gateway.
		$payment_method_object = $context->get_payment_method_instance();

		if ( ! $payment_method_object instanceof \WC_Payment_Gateway ) {
			return;
		}

		$payment_method_object->validate_fields();

		// If errors were thrown, we need to abort.
		NoticeHandler::convert_notices_to_exceptions( 'woocommerce_rest_payment_error' );

		// Process Payment.
		$gateway_result = $payment_method_object->process_payment( $context->order->get_id() );

		// Restore $_POST data.
		$_POST = $post_data;

		// If `process_payment` added notices, clear them. Notices are not displayed from the API -- payment should fail,
		// and a generic notice will be shown instead if payment failed.
		wc_clear_notices();

		// Handle result.
		$result->set_status( isset( $gateway_result['result'] ) && 'success' === $gateway_result['result'] ? 'success' : 'failure' );

		// set payment_details from result.
		$result->set_payment_details( array_merge( $result->payment_details, $gateway_result ) );
		$result->set_redirect_url( $gateway_result['redirect'] );
	}

	/**
	 * Verify all dependencies of registered payment methods have been registered.
	 * If not, remove that payment method script from the list of dependencies
	 * of Cart and Checkout block scripts so it doesn't break the blocks and show
	 * an error in the admin.
	 */
	public function verify_payment_methods_dependencies() {
		$wp_scripts             = wp_scripts();
		$payment_method_scripts = $this->payment_method_registry->get_all_active_payment_method_script_dependencies();

		foreach ( $payment_method_scripts as $payment_method_script ) {
			if (
				! array_key_exists( $payment_method_script, $wp_scripts->registered ) ||
				! property_exists( $wp_scripts->registered[ $payment_method_script ], 'deps' )
			) {
				continue;
			}
			$deps = $wp_scripts->registered[ $payment_method_script ]->deps;
			foreach ( $deps as $dep ) {
				if ( ! wp_script_is( $dep, 'registered' ) ) {
					$error_handle  = $dep . '-dependency-error';
					$error_message = sprintf(
						'Payment gateway with handle \'%1$s\' has been deactivated in Cart and Checkout blocks because its dependency \'%2$s\' is not registered. Read the docs about registering assets for payment methods: https://github.com/woocommerce/woocommerce-gutenberg-products-block/blob/trunk/docs/extensibility/payment-method-integration.md#registering-assets',
						esc_html( $payment_method_script ),
						esc_html( $dep )
					);

					// phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_error_log
					error_log( $error_message );

					// phpcs:ignore WordPress.WP.EnqueuedResourceParameters.NotInFooter,WordPress.WP.EnqueuedResourceParameters.MissingVersion
					wp_register_script( $error_handle, '' );
					wp_enqueue_script( $error_handle );
					wp_add_inline_script(
						$error_handle,
						sprintf( 'console.error( "%s" );', $error_message )
					);

					$cart_checkout_scripts = [ 'wc-cart-block', 'wc-cart-block-frontend', 'wc-checkout-block', 'wc-checkout-block-frontend', 'wc-cart-i2-block', 'wc-cart-i2-block-frontend' ];
					foreach ( $cart_checkout_scripts as $script_handle ) {
						if (
							! array_key_exists( $script_handle, $wp_scripts->registered ) ||
							! property_exists( $wp_scripts->registered[ $script_handle ], 'deps' )
						) {
							continue;
						}
						// Remove payment method script from dependencies.
						$wp_scripts->registered[ $script_handle ]->deps = array_diff(
							$wp_scripts->registered[ $script_handle ]->deps,
							[ $payment_method_script ]
						);
					}
				}
			}
		}
	}
}
woocommerce-blocks/src/Payments/PaymentResult.php000064400000003726151335517640016274 0ustar00<?php
namespace Automattic\WooCommerce\Blocks\Payments;

/**
 * PaymentResult class.
 */
class PaymentResult {
	/**
	 * List of valid payment statuses.
	 *
	 * @var array
	 */
	protected $valid_statuses = [ 'success', 'failure', 'pending', 'error' ];

	/**
	 * Current payment status.
	 *
	 * @var string
	 */
	protected $status = '';

	/**
	 * Array of details about the payment.
	 *
	 * @var string
	 */
	protected $payment_details = [];

	/**
	 * Redirect URL for checkout.
	 *
	 * @var string
	 */
	protected $redirect_url = '';

	/**
	 * Constructor.
	 *
	 * @param string $status Sets the payment status for the result.
	 */
	public function __construct( $status = '' ) {
		if ( $status ) {
			$this->set_status( $status );
		}
	}

	/**
	 * Magic getter for protected properties.
	 *
	 * @param string $name Property name.
	 */
	public function __get( $name ) {
		if ( in_array( $name, [ 'status', 'payment_details', 'redirect_url' ], true ) ) {
			return $this->$name;
		}
		return null;
	}

	/**
	 * Set payment status.
	 *
	 * @throws \Exception When an invalid status is provided.
	 *
	 * @param string $payment_status Status to set.
	 */
	public function set_status( $payment_status ) {
		if ( ! in_array( $payment_status, $this->valid_statuses, true ) ) {
			throw new \Exception( sprintf( 'Invalid payment status %s. Use one of %s', $payment_status, implode( ', ', $this->valid_statuses ) ) );
		}
		$this->status = $payment_status;
	}

	/**
	 * Set payment details.
	 *
	 * @param array $payment_details Array of key value pairs of data.
	 */
	public function set_payment_details( $payment_details = [] ) {
		$this->payment_details = [];

		foreach ( $payment_details as $key => $value ) {
			$this->payment_details[ (string) $key ] = (string) $value;
		}
	}

	/**
	 * Set redirect URL.
	 *
	 * @param array $redirect_url URL to redirect the customer to after checkout.
	 */
	public function set_redirect_url( $redirect_url = [] ) {
		$this->redirect_url = esc_url_raw( $redirect_url );
	}
}
woocommerce-blocks/src/RestApi.php000064400000005725151335517640013230 0ustar00<?php
namespace Automattic\WooCommerce\Blocks;

use Automattic\WooCommerce\Blocks\StoreApi\RoutesController;
use Automattic\WooCommerce\Blocks\StoreApi\SchemaController;
use Automattic\WooCommerce\Blocks\Domain\Services\ExtendRestApi;


/**
 * RestApi class.
 * Registers controllers in the blocks REST API namespace.
 *
 * @internal This API is used internally by Blocks--it is still in flux and may be subject to revisions.
 */
class RestApi {
	/**
	 * Stores Rest Routes instance
	 *
	 * @var RoutesController
	 */
	private $routes;

	/**
	 * Constructor
	 *
	 * @param RoutesController $routes Rest Routes instance.
	 */
	public function __construct( RoutesController $routes ) {
		$this->routes = $routes;
		$this->init();
	}

	/**
	 * Initialize class features.
	 */
	protected function init() {
		add_action( 'rest_api_init', array( $this, 'register_rest_routes' ), 10 );
		add_filter( 'rest_authentication_errors', array( $this, 'store_api_authentication' ) );
		add_action( 'set_logged_in_cookie', array( $this, 'store_api_logged_in_cookie' ) );
	}

	/**
	 * Register REST API routes.
	 */
	public function register_rest_routes() {
		$this->routes->register_routes();
	}

	/**
	 * Get routes for a namespace.
	 *
	 * @param string $namespace Namespace to retrieve.
	 * @return array|null
	 */
	public function get_routes_from_namespace( $namespace ) {
		$rest_server     = rest_get_server();
		$namespace_index = $rest_server->get_namespace_index(
			[
				'namespace' => $namespace,
				'context'   => 'view',
			]
		);

		$response_data = $namespace_index->get_data();

		return isset( $response_data['routes'] ) ? $response_data['routes'] : null;
	}

	/**
	 * The Store API does not require authentication.
	 *
	 * @param \WP_Error|mixed $result Error from another authentication handler, null if we should handle it, or another value if not.
	 * @return \WP_Error|null|bool
	 */
	public function store_api_authentication( $result ) {
		// Pass through errors from other authentication methods used before this one.
		if ( ! empty( $result ) || ! self::is_request_to_store_api() ) {
			return $result;
		}
		return true;
	}

	/**
	 * When the login cookies are set, they are not available until the next page reload. For the Store API, specifically
	 * for returning updated nonces, we need this to be available immediately.
	 *
	 * @param string $logged_in_cookie The value for the logged in cookie.
	 */
	public function store_api_logged_in_cookie( $logged_in_cookie ) {
		if ( ! defined( 'LOGGED_IN_COOKIE' ) || ! self::is_request_to_store_api() ) {
			return;
		}
		$_COOKIE[ LOGGED_IN_COOKIE ] = $logged_in_cookie;
	}

	/**
	 * Check if is request to the Store API.
	 *
	 * @return bool
	 */
	protected function is_request_to_store_api() {
		if ( empty( $_SERVER['REQUEST_URI'] ) ) {
			return false;
		}

		$rest_prefix = trailingslashit( rest_get_url_prefix() );
		$request_uri = esc_url_raw( wp_unslash( $_SERVER['REQUEST_URI'] ) );

		return false !== strpos( $request_uri, $rest_prefix . 'wc/store' );
	}
}
woocommerce-blocks/src/Assets/Api.php000064400000016050151335517640013625 0ustar00<?php
namespace Automattic\WooCommerce\Blocks\Assets;

use Automattic\WooCommerce\Blocks\Domain\Package;
use Exception;
/**
 * The Api class provides an interface to various asset registration helpers.
 *
 * Contains asset api methods
 *
 * @since 2.5.0
 */
class Api {
	/**
	 * Stores inline scripts already enqueued.
	 *
	 * @var array
	 */
	private $inline_scripts = [];

	/**
	 * Reference to the Package instance
	 *
	 * @var Package
	 */
	private $package;

	/**
	 * Constructor for class
	 *
	 * @param Package $package An instance of Package.
	 */
	public function __construct( Package $package ) {
		$this->package = $package;
	}

	/**
	 * Get the file modified time as a cache buster if we're in dev mode.
	 *
	 * @param string $file Local path to the file (relative to the plugin
	 *                     directory).
	 * @return string The cache buster value to use for the given file.
	 */
	protected function get_file_version( $file ) {
		if ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG && file_exists( $this->package->get_path() . $file ) ) {
			return filemtime( $this->package->get_path( trim( $file, '/' ) ) );
		}
		return $this->package->get_version();
	}

	/**
	 * Retrieve the url to an asset for this plugin.
	 *
	 * @param string $relative_path An optional relative path appended to the
	 *                              returned url.
	 *
	 * @return string
	 */
	protected function get_asset_url( $relative_path = '' ) {
		return $this->package->get_url( $relative_path );
	}

	/**
	 * Get src, version and dependencies given a script relative src.
	 *
	 * @param string $relative_src Relative src to the script.
	 * @param array  $dependencies Optional. An array of registered script handles this script depends on. Default empty array.
	 *
	 * @return array src, version and dependencies of the script.
	 */
	public function get_script_data( $relative_src, $dependencies = [] ) {
		$src     = '';
		$version = '1';

		if ( $relative_src ) {
			$src        = $this->get_asset_url( $relative_src );
			$asset_path = $this->package->get_path(
				str_replace( '.js', '.asset.php', $relative_src )
			);

			if ( file_exists( $asset_path ) ) {
				$asset        = require $asset_path;
				$dependencies = isset( $asset['dependencies'] ) ? array_merge( $asset['dependencies'], $dependencies ) : $dependencies;
				$version      = ! empty( $asset['version'] ) ? $asset['version'] : $this->get_file_version( $relative_src );
			} else {
				$version = $this->get_file_version( $relative_src );
			}
		}

		return array(
			'src'          => $src,
			'version'      => $version,
			'dependencies' => $dependencies,
		);
	}

	/**
	 * Registers a script according to `wp_register_script`, adding the correct prefix, and additionally loading translations.
	 *
	 * When creating script assets, the following rules should be followed:
	 *   1. All asset handles should have a `wc-` prefix.
	 *   2. If the asset handle is for a Block (in editor context) use the `-block` suffix.
	 *   3. If the asset handle is for a Block (in frontend context) use the `-block-frontend` suffix.
	 *   4. If the asset is for any other script being consumed or enqueued by the blocks plugin, use the `wc-blocks-` prefix.
	 *
	 * @since 2.5.0
	 * @throws Exception If the registered script has a dependency on itself.
	 *
	 * @param string $handle        Unique name of the script.
	 * @param string $relative_src  Relative url for the script to the path from plugin root.
	 * @param array  $dependencies  Optional. An array of registered script handles this script depends on. Default empty array.
	 * @param bool   $has_i18n      Optional. Whether to add a script translation call to this file. Default: true.
	 */
	public function register_script( $handle, $relative_src, $dependencies = [], $has_i18n = true ) {
		$script_data = $this->get_script_data( $relative_src, $dependencies );

		if ( in_array( $handle, $script_data['dependencies'], true ) ) {
			if ( $this->package->feature()->is_development_environment() ) {
				$dependencies = array_diff( $script_data['dependencies'], [ $handle ] );
					add_action(
						'admin_notices',
						function() use ( $handle ) {
								echo '<div class="error"><p>';
								/* translators: %s file handle name. */
								printf( esc_html__( 'Script with handle %s had a dependency on itself which has been removed. This is an indicator that your JS code has a circular dependency that can cause bugs.', 'woocommerce' ), esc_html( $handle ) );
								echo '</p></div>';
						}
					);
			} else {
				throw new Exception( sprintf( 'Script with handle %s had a dependency on itself. This is an indicator that your JS code has a circular dependency that can cause bugs.', $handle ) );
			}
		}

		wp_register_script( $handle, $script_data['src'], apply_filters( 'woocommerce_blocks_register_script_dependencies', $script_data['dependencies'], $handle ), $script_data['version'], true );

		if ( $has_i18n && function_exists( 'wp_set_script_translations' ) ) {
			wp_set_script_translations( $handle, 'woocommerce', $this->package->get_path( 'languages' ) );
		}
	}

	/**
	 * Registers a style according to `wp_register_style`.
	 *
	 * @since 2.5.0
	 * @since 2.6.0 Change src to be relative source.
	 *
	 * @param string $handle       Name of the stylesheet. Should be unique.
	 * @param string $relative_src Relative source of the stylesheet to the plugin path.
	 * @param array  $deps         Optional. An array of registered stylesheet handles this stylesheet depends on. Default empty array.
	 * @param string $media        Optional. The media for which this stylesheet has been defined. Default 'all'. Accepts media types like
	 *                             'all', 'print' and 'screen', or media queries like '(orientation: portrait)' and '(max-width: 640px)'.
	 */
	public function register_style( $handle, $relative_src, $deps = [], $media = 'all' ) {
		$filename = str_replace( plugins_url( '/', __DIR__ ), '', $relative_src );
		$src      = $this->get_asset_url( $relative_src );
		$ver      = $this->get_file_version( $filename );
		wp_register_style( $handle, $src, $deps, $ver, $media );
	}

	/**
	 * Returns the appropriate asset path for loading either legacy builds or
	 * current builds.
	 *
	 * @param   string $filename  Filename for asset path (without extension).
	 * @param   string $type      File type (.css or .js).
	 *
	 * @return  string             The generated path.
	 */
	public function get_block_asset_build_path( $filename, $type = 'js' ) {
		global $wp_version;
		$suffix = version_compare( $wp_version, '5.3', '>=' )
			? ''
			: '-legacy';
		return "build/$filename$suffix.$type";
	}

	/**
	 * Adds an inline script, once.
	 *
	 * @param string $handle Script handle.
	 * @param string $script Script contents.
	 */
	public function add_inline_script( $handle, $script ) {
		if ( ! empty( $this->inline_scripts[ $handle ] ) && in_array( $script, $this->inline_scripts[ $handle ], true ) ) {
			return;
		}

		wp_add_inline_script( $handle, $script );

		if ( isset( $this->inline_scripts[ $handle ] ) ) {
			$this->inline_scripts[ $handle ][] = $script;
		} else {
			$this->inline_scripts[ $handle ] = array( $script );
		}
	}
}
woocommerce-blocks/src/Assets/AssetDataRegistry.php000064400000026120151335517640016515 0ustar00<?php
namespace Automattic\WooCommerce\Blocks\Assets;

use Automattic\WooCommerce\Blocks\Package;

use Exception;
use InvalidArgumentException;

/**
 * Class instance for registering data used on the current view session by
 * assets.
 *
 * Holds data registered for output on the current view session when
 * `wc-settings` is enqueued( directly or via dependency )
 *
 * @since 2.5.0
 */
class AssetDataRegistry {
	/**
	 * Contains registered data.
	 *
	 * @var array
	 */
	private $data = [];

	/**
	 * Lazy data is an array of closures that will be invoked just before
	 * asset data is generated for the enqueued script.
	 *
	 * @var array
	 */
	private $lazy_data = [];

	/**
	 * Asset handle for registered data.
	 *
	 * @var string
	 */
	private $handle = 'wc-settings';

	/**
	 * Asset API interface for various asset registration.
	 *
	 * @var API
	 */
	private $api;

	/**
	 * Constructor
	 *
	 * @param Api $asset_api  Asset API interface for various asset registration.
	 */
	public function __construct( Api $asset_api ) {
		$this->api = $asset_api;
		$this->init();
	}

	/**
	 * Hook into WP asset registration for enqueueing asset data.
	 */
	protected function init() {
		add_action( 'init', array( $this, 'register_data_script' ) );
		add_action( 'wp_print_footer_scripts', array( $this, 'enqueue_asset_data' ), 1 );
		add_action( 'admin_print_footer_scripts', array( $this, 'enqueue_asset_data' ), 1 );
	}

	/**
	 * Exposes core data via the wcSettings global. This data is shared throughout the client.
	 *
	 * Settings that are used by various components or multiple blocks should be added here. Note, that settings here are
	 * global so be sure not to add anything heavy if possible.
	 *
	 * @return array  An array containing core data.
	 */
	protected function get_core_data() {
		return [
			'adminUrl'           => admin_url(),
			'countries'          => WC()->countries->get_countries(),
			'currency'           => $this->get_currency_data(),
			'currentUserIsAdmin' => current_user_can( 'manage_woocommerce' ),
			'homeUrl'            => esc_url( home_url( '/' ) ),
			'locale'             => $this->get_locale_data(),
			'orderStatuses'      => $this->get_order_statuses(),
			'placeholderImgSrc'  => wc_placeholder_img_src(),
			'siteTitle'          => get_bloginfo( 'name' ),
			'storePages'         => $this->get_store_pages(),
			'wcAssetUrl'         => plugins_url( 'assets/', WC_PLUGIN_FILE ),
			'wcVersion'          => defined( 'WC_VERSION' ) ? WC_VERSION : '',
			'wpLoginUrl'         => wp_login_url(),
			'wpVersion'          => get_bloginfo( 'version' ),
		];
	}

	/**
	 * Get currency data to include in settings.
	 *
	 * @return array
	 */
	protected function get_currency_data() {
		$currency = get_woocommerce_currency();

		return [
			'code'              => $currency,
			'precision'         => wc_get_price_decimals(),
			'symbol'            => html_entity_decode( get_woocommerce_currency_symbol( $currency ) ),
			'symbolPosition'    => get_option( 'woocommerce_currency_pos' ),
			'decimalSeparator'  => wc_get_price_decimal_separator(),
			'thousandSeparator' => wc_get_price_thousand_separator(),
			'priceFormat'       => html_entity_decode( get_woocommerce_price_format() ),
		];
	}

	/**
	 * Get locale data to include in settings.
	 *
	 * @return array
	 */
	protected function get_locale_data() {
		global $wp_locale;

		return [
			'siteLocale'    => get_locale(),
			'userLocale'    => get_user_locale(),
			'weekdaysShort' => array_values( $wp_locale->weekday_abbrev ),
		];
	}

	/**
	 * Get store pages to include in settings.
	 *
	 * @return array
	 */
	protected function get_store_pages() {
		return array_map(
			[ $this, 'format_page_resource' ],
			[
				'myaccount' => wc_get_page_id( 'myaccount' ),
				'shop'      => wc_get_page_id( 'shop' ),
				'cart'      => wc_get_page_id( 'cart' ),
				'checkout'  => wc_get_page_id( 'checkout' ),
				'privacy'   => wc_privacy_policy_page_id(),
				'terms'     => wc_terms_and_conditions_page_id(),
			]
		);
	}

	/**
	 * Format a page object into a standard array of data.
	 *
	 * @param WP_Post|int $page Page object or ID.
	 * @return array
	 */
	protected function format_page_resource( $page ) {
		if ( is_numeric( $page ) && $page > 0 ) {
			$page = get_post( $page );
		}
		if ( ! is_a( $page, '\WP_Post' ) || 'publish' !== $page->post_status ) {
			return [
				'id'        => 0,
				'title'     => '',
				'permalink' => false,
			];
		}
		return [
			'id'        => $page->ID,
			'title'     => $page->post_title,
			'permalink' => get_permalink( $page->ID ),
		];
	}

	/**
	 * Returns block-related data for enqueued wc-settings script.
	 * Format order statuses by removing a leading 'wc-' if present.
	 *
	 * @return array formatted statuses.
	 */
	protected function get_order_statuses() {
		$formatted_statuses = array();
		foreach ( wc_get_order_statuses() as $key => $value ) {
			$formatted_key                        = preg_replace( '/^wc-/', '', $key );
			$formatted_statuses[ $formatted_key ] = $value;
		}
		return $formatted_statuses;
	}

	/**
	 * Used for on demand initialization of asset data and registering it with
	 * the internal data registry.
	 *
	 * Note: core data will overwrite any externally registered data via the api.
	 */
	protected function initialize_core_data() {
		/**
		 * Low level hook for registration of new data late in the cycle. This is deprecated.
		 * Instead, use the data api:
		 * Automattic\WooCommerce\Blocks\Package::container()
		 *     ->get( Automattic\WooCommerce\Blocks\Assets\AssetDataRegistry::class )
		 *     ->add( $key, $value )
		 */
		$settings = apply_filters( 'woocommerce_shared_settings', $this->data );

		// Surface a deprecation warning in the error console.
		if ( has_filter( 'woocommerce_shared_settings' ) ) {
			$error_handle  = 'deprecated-shared-settings-error';
			$error_message = '`woocommerce_shared_settings` filter in Blocks is deprecated. See https://github.com/woocommerce/woocommerce-gutenberg-products-block/blob/trunk/docs/contributors/block-assets.md';
			// phpcs:ignore WordPress.WP.EnqueuedResourceParameters.NotInFooter,WordPress.WP.EnqueuedResourceParameters.MissingVersion
			wp_register_script( $error_handle, '' );
			wp_enqueue_script( $error_handle );
			wp_add_inline_script(
				$error_handle,
				sprintf( 'console.warn( "%s" );', $error_message )
			);
		}

		// note this WILL wipe any data already registered to these keys because they are protected.
		$this->data = array_replace_recursive( $settings, $this->get_core_data() );
	}

	/**
	 * Loops through each registered lazy data callback and adds the returned
	 * value to the data array.
	 *
	 * This method is executed right before preparing the data for printing to
	 * the rendered screen.
	 *
	 * @return void
	 */
	protected function execute_lazy_data() {
		foreach ( $this->lazy_data as $key => $callback ) {
			$this->data[ $key ] = $callback();
		}
	}

	/**
	 * Exposes private registered data to child classes.
	 *
	 * @return array  The registered data on the private data property
	 */
	protected function get() {
		return $this->data;
	}

	/**
	 * Allows checking whether a key exists.
	 *
	 * @param string $key  The key to check if exists.
	 * @return bool  Whether the key exists in the current data registry.
	 */
	public function exists( $key ) {
		return array_key_exists( $key, $this->data );
	}

	/**
	 * Interface for adding data to the registry.
	 *
	 * You can only register data that is not already in the registry identified by the given key. If there is a
	 * duplicate found, unless $ignore_duplicates is true, an exception will be thrown.
	 *
	 * @param string  $key               The key used to reference the data being registered.
	 * @param mixed   $data              If not a function, registered to the registry as is. If a function, then the
	 *                                   callback is invoked right before output to the screen.
	 * @param boolean $check_key_exists If set to true, duplicate data will be ignored if the key exists.
	 *                                  If false, duplicate data will cause an exception.
	 *
	 * @throws InvalidArgumentException  Only throws when site is in debug mode. Always logs the error.
	 */
	public function add( $key, $data, $check_key_exists = false ) {
		if ( $check_key_exists && $this->exists( $key ) ) {
			return;
		}
		try {
			$this->add_data( $key, $data );
		} catch ( Exception $e ) {
			if ( $this->debug() ) {
				// bubble up.
				throw $e;
			}
			wc_caught_exception( $e, __METHOD__, [ $key, $data ] );
		}
	}

	/**
	 * Hydrate from API.
	 *
	 * @param string $path REST API path to preload.
	 */
	public function hydrate_api_request( $path ) {
		if ( ! isset( $this->data['preloadedApiRequests'] ) ) {
			$this->data['preloadedApiRequests'] = [];
		}
		if ( ! isset( $this->data['preloadedApiRequests'][ $path ] ) ) {
			$this->data['preloadedApiRequests'] = rest_preload_api_request( $this->data['preloadedApiRequests'], $path );
		}
	}

	/**
	 * Adds a page permalink to the data registry.
	 *
	 * @param integer $page_id Page ID to add to the registry.
	 */
	public function register_page_id( $page_id ) {
		$permalink = $page_id ? get_permalink( $page_id ) : false;

		if ( $permalink ) {
			$this->data[ 'page-' . $page_id ] = $permalink;
		}
	}

	/**
	 * Callback for registering the data script via WordPress API.
	 *
	 * @return void
	 */
	public function register_data_script() {
		$this->api->register_script(
			$this->handle,
			'build/wc-settings.js',
			[],
			true
		);
	}

	/**
	 * Callback for enqueuing asset data via the WP api.
	 *
	 * Note: while this is hooked into print/admin_print_scripts, it still only
	 * happens if the script attached to `wc-settings` handle is enqueued. This
	 * is done to allow for any potentially expensive data generation to only
	 * happen for routes that need it.
	 */
	public function enqueue_asset_data() {
		if ( wp_script_is( $this->handle, 'enqueued' ) ) {
			$this->initialize_core_data();
			$this->execute_lazy_data();
			$data = rawurlencode( wp_json_encode( $this->data ) );
			wp_add_inline_script(
				$this->handle,
				"var wcSettings = wcSettings || JSON.parse( decodeURIComponent( '"
					. esc_js( $data )
					. "' ) );",
				'before'
			);
		}
	}

	/**
	 * See self::add() for docs.
	 *
	 * @param   string $key   Key for the data.
	 * @param   mixed  $data  Value for the data.
	 *
	 * @throws InvalidArgumentException  If key is not a string or already
	 *                                   exists in internal data cache.
	 */
	protected function add_data( $key, $data ) {
		if ( ! is_string( $key ) ) {
			if ( $this->debug() ) {
				throw new InvalidArgumentException(
					'Key for the data being registered must be a string'
				);
			}
		}
		if ( isset( $this->data[ $key ] ) ) {
			if ( $this->debug() ) {
				throw new InvalidArgumentException(
					'Overriding existing data with an already registered key is not allowed'
				);
			}
			return;
		}
		if ( \is_callable( $data ) ) {
			$this->lazy_data[ $key ] = $data;
			return;
		}
		$this->data[ $key ] = $data;
	}

	/**
	 * Exposes whether the current site is in debug mode or not.
	 *
	 * @return boolean  True means the site is in debug mode.
	 */
	protected function debug() {
		return defined( 'WP_DEBUG' ) && WP_DEBUG;
	}
}
woocommerce-blocks/src/Registry/SharedType.php000064400000001344151335517640015532 0ustar00<?php
namespace Automattic\WooCommerce\Blocks\Registry;

/**
 * A definition for the SharedType dependency type.
 *
 * @since 2.5.0
 */
class SharedType extends AbstractDependencyType {

	/**
	 * Holds a cached instance of the value stored (or returned) internally.
	 *
	 * @var mixed
	 */
	private $shared_instance;

	/**
	 * Returns the internal stored and shared value after initial generation.
	 *
	 * @param Container $container An instance of the dependency injection
	 *                             container.
	 *
	 * @return mixed
	 */
	public function get( Container $container ) {
		if ( empty( $this->shared_instance ) ) {
			$this->shared_instance = $this->resolve_value( $container );
		}
		return $this->shared_instance;
	}
}
woocommerce-blocks/src/Registry/Container.php000064400000006025151335517640015405 0ustar00<?php
namespace Automattic\WooCommerce\Blocks\Registry;

use Closure;
use Exception;

/**
 * A simple Dependency Injection Container
 *
 * This is used to manage dependencies used throughout the plugin.
 *
 * @since 2.5.0
 */
class Container {

	/**
	 * A map of Dependency Type objects used to resolve dependencies.
	 *
	 * @var AbstractDependencyType[]
	 */
	private $registry = [];

	/**
	 * Public api for adding a factory to the container.
	 *
	 * Factory dependencies will have the instantiation callback invoked
	 * every time the dependency is requested.
	 *
	 * Typical Usage:
	 *
	 * ```
	 * $container->register( MyClass::class, $container->factory( $mycallback ) );
	 * ```
	 *
	 * @param Closure $instantiation_callback  This will be invoked when the
	 *                                         dependency is required.  It will
	 *                                         receive an instance of this
	 *                                         container so the callback can
	 *                                         retrieve dependencies from the
	 *                                         container.
	 *
	 * @return FactoryType  An instance of the FactoryType dependency.
	 */
	public function factory( Closure $instantiation_callback ) {
		return new FactoryType( $instantiation_callback );
	}

	/**
	 * Interface for registering a new dependency with the container.
	 *
	 * By default, the $value will be added as a shared dependency.  This means
	 * that it will be a single instance shared among any other classes having
	 * that dependency.
	 *
	 * If you want a new instance every time it's required, then wrap the value
	 * in a call to the factory method (@see Container::factory for example)
	 *
	 * Note: Currently if the provided id already is registered in the container,
	 * the provided value is ignored.
	 *
	 * @param string $id    A unique string identifier for the provided value.
	 *                      Typically it's the fully qualified name for the
	 *                      dependency.
	 * @param mixed  $value The value for the dependency. Typically, this is a
	 *                      closure that will create the class instance needed.
	 */
	public function register( $id, $value ) {
		if ( empty( $this->registry[ $id ] ) ) {
			if ( ! $value instanceof FactoryType ) {
				$value = new SharedType( $value );
			}
			$this->registry[ $id ] = $value;
		}
	}

	/**
	 * Interface for retrieving the dependency stored in the container for the
	 * given identifier.
	 *
	 * @param string $id  The identifier for the dependency being retrieved.
	 * @throws Exception  If there is no dependency for the given identifier in
	 *                    the container.
	 *
	 * @return mixed  Typically a class instance.
	 */
	public function get( $id ) {
		if ( ! isset( $this->registry[ $id ] ) ) {
			// this is a developer facing exception, hence it is not localized.
			throw new Exception(
				sprintf(
					'Cannot construct an instance of %s because it has not been registered.',
					$id
				)
			);
		}
		return $this->registry[ $id ]->get( $this );
	}
}
woocommerce-blocks/src/Registry/AbstractDependencyType.php000064400000002362151335517640020067 0ustar00<?php
namespace Automattic\WooCommerce\Blocks\Registry;

/**
 * An abstract class for dependency types.
 *
 * Dependency types are instances of a dependency used by the
 * Dependency Injection Container for storing dependencies to invoke as they
 * are needed.
 *
 * @since 2.5.0
 */
abstract class AbstractDependencyType {

	/**
	 * Holds a callable or value provided for this type.
	 *
	 * @var mixed
	 */
	private $callable_or_value;

	/**
	 * Constructor
	 *
	 * @param mixed $callable_or_value  A callable or value for the dependency
	 *                                  type instance.
	 */
	public function __construct( $callable_or_value ) {
		$this->callable_or_value = $callable_or_value;
	}

	/**
	 * Resolver for the internal dependency value.
	 *
	 * @param Container $container  The Dependency Injection Container.
	 *
	 * @return mixed
	 */
	protected function resolve_value( Container $container ) {
		$callback = $this->callable_or_value;
		return \is_callable( $callback )
			? $callback( $container )
			: $callback;
	}

	/**
	 * Retrieves the value stored internally for this DependencyType
	 *
	 * @param Container $container  The Dependency Injection Container.
	 *
	 * @return void
	 */
	abstract public function get( Container $container );
}
woocommerce-blocks/src/Registry/FactoryType.php000064400000000771151335517640015736 0ustar00<?php
namespace Automattic\WooCommerce\Blocks\Registry;

/**
 * Definition for the FactoryType dependency type.
 *
 * @since 2.5.0
 */
class FactoryType extends AbstractDependencyType {
	/**
	 * Invokes and returns the value from the stored internal callback.
	 *
	 * @param Container $container  An instance of the dependency injection
	 *                              container.
	 *
	 * @return mixed
	 */
	public function get( Container $container ) {
		return $this->resolve_value( $container );
	}
}
woocommerce-blocks/src/AssetsController.php000064400000013161151335517640015160 0ustar00<?php
namespace Automattic\WooCommerce\Blocks;

use Automattic\WooCommerce\Blocks\Package;
use Automattic\WooCommerce\Blocks\Assets\Api as AssetApi;
use Automattic\WooCommerce\Blocks\Assets\AssetDataRegistry as AssetDataRegistry;

/**
 * AssetsController class.
 *
 * @since 5.0.0
 * @internal
 */
final class AssetsController {

	/**
	 * Asset API interface for various asset registration.
	 *
	 * @var AssetApi
	 */
	private $api;

	/**
	 * Constructor.
	 *
	 * @param AssetApi $asset_api  Asset API interface for various asset registration.
	 */
	public function __construct( AssetApi $asset_api ) {
		$this->api = $asset_api;
		$this->init();
	}

	/**
	 * Initialize class features.
	 */
	protected function init() {
		add_action( 'init', array( $this, 'register_assets' ) );
		add_action( 'body_class', array( $this, 'add_theme_body_class' ), 1 );
		add_action( 'admin_body_class', array( $this, 'add_theme_body_class' ), 1 );
		add_action( 'admin_enqueue_scripts', array( $this, 'update_block_style_dependencies' ), 20 );
	}

	/**
	 * Register block scripts & styles.
	 */
	public function register_assets() {
		$this->register_style( 'wc-blocks-vendors-style', plugins_url( $this->api->get_block_asset_build_path( 'wc-blocks-vendors-style', 'css' ), __DIR__ ) );
		$this->register_style( 'wc-blocks-editor-style', plugins_url( $this->api->get_block_asset_build_path( 'wc-blocks-editor-style', 'css' ), __DIR__ ), [ 'wp-edit-blocks' ], 'all', true );
		$this->register_style( 'wc-blocks-style', plugins_url( $this->api->get_block_asset_build_path( 'wc-blocks-style', 'css' ), __DIR__ ), [ 'wc-blocks-vendors-style' ], 'all', true );

		$this->api->register_script( 'wc-blocks-middleware', 'build/wc-blocks-middleware.js', [], false );
		$this->api->register_script( 'wc-blocks-data-store', 'build/wc-blocks-data.js', [ 'wc-blocks-middleware' ] );
		$this->api->register_script( 'wc-blocks-vendors', $this->api->get_block_asset_build_path( 'wc-blocks-vendors' ), [], false );
		$this->api->register_script( 'wc-blocks-registry', 'build/wc-blocks-registry.js', [], false );
		$this->api->register_script( 'wc-blocks', $this->api->get_block_asset_build_path( 'wc-blocks' ), [ 'wc-blocks-vendors' ], false );
		$this->api->register_script( 'wc-blocks-shared-context', 'build/wc-blocks-shared-context.js', [] );
		$this->api->register_script( 'wc-blocks-shared-hocs', 'build/wc-blocks-shared-hocs.js', [], false );

		// The price package is shared externally so has no blocks prefix.
		$this->api->register_script( 'wc-price-format', 'build/price-format.js', [], false );

		if ( Package::feature()->is_feature_plugin_build() ) {
			$this->api->register_script( 'wc-blocks-checkout', 'build/blocks-checkout.js', [] );
		}

		wp_add_inline_script(
			'wc-blocks-middleware',
			"
			var wcBlocksMiddlewareConfig = {
				storeApiNonce: '" . esc_js( wp_create_nonce( 'wc_store_api' ) ) . "',
				wcStoreApiNonceTimestamp: '" . esc_js( time() ) . "'
			};
			",
			'before'
		);
	}

	/**
	 * Add body classes to the frontend and within admin.
	 *
	 * @param string|array $classes Array or string of CSS classnames.
	 * @return string|array Modified classnames.
	 */
	public function add_theme_body_class( $classes ) {
		$class = 'theme-' . get_template();

		if ( is_array( $classes ) ) {
			$classes[] = $class;
		} else {
			$classes .= ' ' . $class . ' ';
		}

		return $classes;
	}

	/**
	 * Get the file modified time as a cache buster if we're in dev mode.
	 *
	 * @param string $file Local path to the file.
	 * @return string The cache buster value to use for the given file.
	 */
	protected function get_file_version( $file ) {
		if ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG && file_exists( \Automattic\WooCommerce\Blocks\Package::get_path() . $file ) ) {
			return filemtime( \Automattic\WooCommerce\Blocks\Package::get_path() . $file );
		}
		return \Automattic\WooCommerce\Blocks\Package::get_version();
	}

	/**
	 * Registers a style according to `wp_register_style`.
	 *
	 * @param string  $handle Name of the stylesheet. Should be unique.
	 * @param string  $src    Full URL of the stylesheet, or path of the stylesheet relative to the WordPress root directory.
	 * @param array   $deps   Optional. An array of registered stylesheet handles this stylesheet depends on. Default empty array.
	 * @param string  $media  Optional. The media for which this stylesheet has been defined. Default 'all'. Accepts media types like
	 *                        'all', 'print' and 'screen', or media queries like '(orientation: portrait)' and '(max-width: 640px)'.
	 * @param boolean $rtl   Optional. Whether or not to register RTL styles.
	 */
	protected function register_style( $handle, $src, $deps = [], $media = 'all', $rtl = false ) {
		$filename = str_replace( plugins_url( '/', __DIR__ ), '', $src );
		$ver      = self::get_file_version( $filename );

		wp_register_style( $handle, $src, $deps, $ver, $media );

		if ( $rtl ) {
			wp_style_add_data( $handle, 'rtl', 'replace' );
		}
	}

	/**
	 * Update block style dependencies after they have been registered.
	 */
	public function update_block_style_dependencies() {
		$wp_styles = wp_styles();
		$style     = $wp_styles->query( 'wc-blocks-style', 'registered' );

		if ( ! $style ) {
			return;
		}

		// In WC < 5.5, `woocommerce-general` is not registered in block editor
		// screens, so we don't add it as a dependency if it's not registered.
		// In WC >= 5.5, `woocommerce-general` is registered on `admin_enqueue_scripts`,
		// so we need to check if it's registered here instead of on `init`.
		if (
			wp_style_is( 'woocommerce-general', 'registered' ) &&
			! in_array( 'woocommerce-general', $style->deps, true )
		) {
			$style->deps[] = 'woocommerce-general';
		}
	}
}
woocommerce-blocks/src/Installer.php000064400000006347151335517640013617 0ustar00<?php
namespace Automattic\WooCommerce\Blocks;

/**
 * Installer class.
 * Handles installation of Blocks plugin dependencies.
 *
 * @internal
 */
class Installer {
	/**
	 * Constructor
	 */
	public function __construct() {
		$this->init();
	}

	/**
	 * Installation tasks ran on admin_init callback.
	 */
	public function install() {
		$this->maybe_create_tables();
	}

	/**
	 * Initialize class features.
	 */
	protected function init() {
		add_action( 'admin_init', array( $this, 'install' ) );
	}

	/**
	 * Set up the database tables which the plugin needs to function.
	 */
	public function maybe_create_tables() {
		global $wpdb;

		$schema_version    = 260;
		$db_schema_version = (int) get_option( 'wc_blocks_db_schema_version', 0 );

		if ( $db_schema_version >= $schema_version && 0 !== $db_schema_version ) {
			return;
		}

		$show_errors = $wpdb->hide_errors();
		$table_name  = $wpdb->prefix . 'wc_reserved_stock';
		$collate     = $wpdb->has_cap( 'collation' ) ? $wpdb->get_charset_collate() : '';
		$exists      = $this->maybe_create_table(
			$wpdb->prefix . 'wc_reserved_stock',
			"
			CREATE TABLE {$wpdb->prefix}wc_reserved_stock (
				`order_id` bigint(20) NOT NULL,
				`product_id` bigint(20) NOT NULL,
				`stock_quantity` double NOT NULL DEFAULT 0,
				`timestamp` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
				`expires` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
				PRIMARY KEY  (`order_id`, `product_id`)
			) $collate;
			"
		);

		if ( $show_errors ) {
			$wpdb->show_errors();
		}

		if ( ! $exists ) {
			return $this->add_create_table_notice( $table_name );
		}

		// Update succeeded. This is only updated when successful and validated.
		// $schema_version should be incremented when changes to schema are made within this method.
		update_option( 'wc_blocks_db_schema_version', $schema_version );
	}

	/**
	 * Create database table, if it doesn't already exist.
	 *
	 * Based on admin/install-helper.php maybe_create_table function.
	 *
	 * @param string $table_name Database table name.
	 * @param string $create_sql Create database table SQL.
	 * @return bool False on error, true if already exists or success.
	 */
	protected function maybe_create_table( $table_name, $create_sql ) {
		global $wpdb;

		if ( in_array( $table_name, $wpdb->get_col( $wpdb->prepare( 'SHOW TABLES LIKE %s', $table_name ), 0 ), true ) ) {
			return true;
		}

		$wpdb->query( $create_sql ); // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared

		return in_array( $table_name, $wpdb->get_col( $wpdb->prepare( 'SHOW TABLES LIKE %s', $table_name ), 0 ), true );
	}

	/**
	 * Add a notice if table creation fails.
	 *
	 * @param string $table_name Name of the missing table.
	 */
	protected function add_create_table_notice( $table_name ) {
		add_action(
			'admin_notices',
			function() use ( $table_name ) {
				echo '<div class="error"><p>';
				printf(
					/* translators: %1$s table name, %2$s database user, %3$s database name. */
					esc_html__( 'WooCommerce %1$s table creation failed. Does the %2$s user have CREATE privileges on the %3$s database?', 'woocommerce' ),
					'<code>' . esc_html( $table_name ) . '</code>',
					'<code>' . esc_html( DB_USER ) . '</code>',
					'<code>' . esc_html( DB_NAME ) . '</code>'
				);
				echo '</p></div>';
			}
		);
	}
}
woocommerce-blocks/src/Integrations/IntegrationInterface.php000064400000001563151335517640020427 0ustar00<?php
namespace Automattic\WooCommerce\Blocks\Integrations;

/**
 * Integration.Interface
 *
 * Integrations must use this interface when registering themselves with blocks,
 */
interface IntegrationInterface {
	/**
	 * The name of the integration.
	 *
	 * @return string
	 */
	public function get_name();

	/**
	 * When called invokes any initialization/setup for the integration.
	 */
	public function initialize();

	/**
	 * Returns an array of script handles to enqueue in the frontend context.
	 *
	 * @return string[]
	 */
	public function get_script_handles();

	/**
	 * Returns an array of script handles to enqueue in the editor context.
	 *
	 * @return string[]
	 */
	public function get_editor_script_handles();

	/**
	 * An array of key, value pairs of data made available to the block on the client side.
	 *
	 * @return array
	 */
	public function get_script_data();
}
woocommerce-blocks/src/Integrations/IntegrationRegistry.php000064400000012411151335517640020331 0ustar00<?php
namespace Automattic\WooCommerce\Blocks\Integrations;

/**
 * Class used for tracking registered integrations with various Block types.
 */
class IntegrationRegistry {
	/**
	 * Integration identifier is used to construct hook names and is given when the integration registry is initialized.
	 *
	 * @var string
	 */
	protected $registry_identifier = '';

	/**
	 * Registered integrations, as `$name => $instance` pairs.
	 *
	 * @var IntegrationInterface[]
	 */
	protected $registered_integrations = [];

	/**
	 * Initializes all registered integrations.
	 *
	 * Integration identifier is used to construct hook names and is given when the integration registry is initialized.
	 *
	 * @param string $registry_identifier Identifier for this registry.
	 */
	public function initialize( $registry_identifier = '' ) {
		if ( $registry_identifier ) {
			$this->registry_identifier = $registry_identifier;
		}

		if ( empty( $this->registry_identifier ) ) {
			_doing_it_wrong( __METHOD__, esc_html( __( 'Integration registry requires an identifier.', 'woocommerce' ) ) );
			return false;
		}

		/**
		 * Hook: integration_registration.
		 *
		 * Runs before integrations are initialized allowing new integration to be registered for use. This should be
		 * used as the primary hook for integrations to include their scripts, styles, and other code extending the
		 * blocks.
		 *
		 * @param IntegrationRegistry $this Instance of the IntegrationRegistry class which exposes the IntegrationRegistry::register() method.
		 */
		do_action( 'woocommerce_blocks_' . $this->registry_identifier . '_registration', $this );

		foreach ( $this->get_all_registered() as $registered_integration ) {
			$registered_integration->initialize();
		}
	}

	/**
	 * Registers an integration.
	 *
	 * @param IntegrationInterface $integration An instance of IntegrationInterface.
	 *
	 * @return boolean True means registered successfully.
	 */
	public function register( IntegrationInterface $integration ) {
		$name = $integration->get_name();

		if ( $this->is_registered( $name ) ) {
			/* translators: %s: Integration name. */
			_doing_it_wrong( __METHOD__, esc_html( sprintf( __( '"%s" is already registered.', 'woocommerce' ), $name ) ) );
			return false;
		}

		$this->registered_integrations[ $name ] = $integration;
		return true;
	}

	/**
	 * Checks if an integration is already registered.
	 *
	 * @param string $name Integration name.
	 * @return bool True if the integration is registered, false otherwise.
	 */
	public function is_registered( $name ) {
		return isset( $this->registered_integrations[ $name ] );
	}

	/**
	 * Un-register an integration.
	 *
	 * @param string|IntegrationInterface $name Integration name, or alternatively a IntegrationInterface instance.
	 * @return boolean|IntegrationInterface Returns the unregistered integration instance if unregistered successfully.
	 */
	public function unregister( $name ) {
		if ( $name instanceof IntegrationInterface ) {
			$name = $name->get_name();
		}

		if ( ! $this->is_registered( $name ) ) {
			/* translators: %s: Integration name. */
			_doing_it_wrong( __METHOD__, esc_html( sprintf( __( 'Integration "%s" is not registered.', 'woocommerce' ), $name ) ) );
			return false;
		}

		$unregistered = $this->registered_integrations[ $name ];
		unset( $this->registered_integrations[ $name ] );
		return $unregistered;
	}

	/**
	 * Retrieves a registered Integration by name.
	 *
	 * @param string $name Integration name.
	 * @return IntegrationInterface|null The registered integration, or null if it is not registered.
	 */
	public function get_registered( $name ) {
		return $this->is_registered( $name ) ? $this->registered_integrations[ $name ] : null;
	}

	/**
	 * Retrieves all registered integrations.
	 *
	 * @return IntegrationInterface[]
	 */
	public function get_all_registered() {
		return $this->registered_integrations;
	}

	/**
	 * Gets an array of all registered integration's script handles for the editor.
	 *
	 * @return string[]
	 */
	public function get_all_registered_editor_script_handles() {
		$script_handles          = [];
		$registered_integrations = $this->get_all_registered();

		foreach ( $registered_integrations as $registered_integration ) {
			$script_handles = array_merge(
				$script_handles,
				$registered_integration->get_editor_script_handles()
			);
		}

		return array_unique( array_filter( $script_handles ) );
	}

	/**
	 * Gets an array of all registered integration's script handles.
	 *
	 * @return string[]
	 */
	public function get_all_registered_script_handles() {
		$script_handles          = [];
		$registered_integrations = $this->get_all_registered();

		foreach ( $registered_integrations as $registered_integration ) {
			$script_handles = array_merge(
				$script_handles,
				$registered_integration->get_script_handles()
			);
		}

		return array_unique( array_filter( $script_handles ) );
	}

	/**
	 * Gets an array of all registered integration's script data.
	 *
	 * @return array
	 */
	public function get_all_registered_script_data() {
		$script_data             = [];
		$registered_integrations = $this->get_all_registered();

		foreach ( $registered_integrations as $registered_integration ) {
			$script_data[ $registered_integration->get_name() . '_data' ] = $registered_integration->get_script_data();
		}

		return array_filter( $script_data );
	}
}
woocommerce-blocks/src/BlockTypes/PriceFilter.php000064400000000335151335517640016140 0ustar00<?php
namespace Automattic\WooCommerce\Blocks\BlockTypes;

/**
 * PriceFilter class.
 */
class PriceFilter extends AbstractBlock {

	/**
	 * Block name.
	 *
	 * @var string
	 */
	protected $block_name = 'price-filter';
}
woocommerce-blocks/src/BlockTypes/FeaturedCategory.php000064400000012411151335517640017163 0ustar00<?php
namespace Automattic\WooCommerce\Blocks\BlockTypes;

/**
 * FeaturedCategory class.
 */
class FeaturedCategory extends AbstractDynamicBlock {
	/**
	 * Block name.
	 *
	 * @var string
	 */
	protected $block_name = 'featured-category';

	/**
	 * Default attribute values, should match what's set in JS `registerBlockType`.
	 *
	 * @var array
	 */
	protected $defaults = array(
		'align'        => 'none',
		'contentAlign' => 'center',
		'dimRatio'     => 50,
		'focalPoint'   => false,
		'height'       => false,
		'mediaId'      => 0,
		'mediaSrc'     => '',
		'showDesc'     => true,
	);

	/**
	 * Render the Featured Category block.
	 *
	 * @param array  $attributes Block attributes.
	 * @param string $content    Block content.
	 * @return string Rendered block type output.
	 */
	protected function render( $attributes, $content ) {
		$id       = absint( isset( $attributes['categoryId'] ) ? $attributes['categoryId'] : 0 );
		$category = get_term( $id, 'product_cat' );

		if ( ! $category || is_wp_error( $category ) ) {
			return '';
		}

		$attributes = wp_parse_args( $attributes, $this->defaults );

		$attributes['height'] = $attributes['height'] ? $attributes['height'] : wc_get_theme_support( 'featured_block::default_height', 500 );

		$title = sprintf(
			'<h2 class="wc-block-featured-category__title">%s</h2>',
			wp_kses_post( $category->name )
		);

		$desc_str = sprintf(
			'<div class="wc-block-featured-category__description">%s</div>',
			wc_format_content( wp_kses_post( $category->description ) )
		);

		$output  = sprintf( '<div class="%1$s" style="%2$s">', esc_attr( $this->get_classes( $attributes ) ), esc_attr( $this->get_styles( $attributes, $category ) ) );
		$output .= '<div class="wc-block-featured-category__wrapper">';
		$output .= $title;
		if ( $attributes['showDesc'] ) {
			$output .= $desc_str;
		}
		$output .= '<div class="wc-block-featured-category__link">' . $content . '</div>';
		$output .= '</div>';
		$output .= '</div>';
		return $output;
	}

	/**
	 * Get the styles for the wrapper element (background image, color).
	 *
	 * @param array    $attributes Block attributes. Default empty array.
	 * @param \WP_Term $category Term object.
	 * @return string
	 */
	public function get_styles( $attributes, $category ) {
		$style      = '';
		$image_size = 'large';
		if ( 'none' !== $attributes['align'] || $attributes['height'] > 800 ) {
			$image_size = 'full';
		}

		if ( $attributes['mediaId'] ) {
			$image = wp_get_attachment_image_url( $attributes['mediaId'], $image_size );
		} else {
			$image = $this->get_image( $category, $image_size );
		}

		if ( ! empty( $image ) ) {
			$style .= sprintf( 'background-image:url(%s);', esc_url( $image ) );
		}

		if ( isset( $attributes['customOverlayColor'] ) ) {
			$style .= sprintf( 'background-color:%s;', esc_attr( $attributes['customOverlayColor'] ) );
		}

		if ( isset( $attributes['height'] ) ) {
			$style .= sprintf( 'min-height:%dpx;', intval( $attributes['height'] ) );
		}

		if ( is_array( $attributes['focalPoint'] ) && 2 === count( $attributes['focalPoint'] ) ) {
			$style .= sprintf(
				'background-position: %s%% %s%%',
				$attributes['focalPoint']['x'] * 100,
				$attributes['focalPoint']['y'] * 100
			);
		}

		return $style;
	}

	/**
	 * Get class names for the block container.
	 *
	 * @param array $attributes Block attributes. Default empty array.
	 * @return string
	 */
	public function get_classes( $attributes ) {
		$classes = array( 'wc-block-' . $this->block_name );

		if ( isset( $attributes['align'] ) ) {
			$classes[] = "align{$attributes['align']}";
		}

		if ( isset( $attributes['dimRatio'] ) && ( 0 !== $attributes['dimRatio'] ) ) {
			$classes[] = 'has-background-dim';

			if ( 50 !== $attributes['dimRatio'] ) {
				$classes[] = 'has-background-dim-' . 10 * round( $attributes['dimRatio'] / 10 );
			}
		}

		if ( isset( $attributes['contentAlign'] ) && 'center' !== $attributes['contentAlign'] ) {
			$classes[] = "has-{$attributes['contentAlign']}-content";
		}

		if ( isset( $attributes['overlayColor'] ) ) {
			$classes[] = "has-{$attributes['overlayColor']}-background-color";
		}

		if ( isset( $attributes['className'] ) ) {
			$classes[] = $attributes['className'];
		}

		return implode( ' ', $classes );
	}

	/**
	 * Returns the main product image URL.
	 *
	 * @param \WP_Term $category Term object.
	 * @param string   $size    Image size, defaults to 'full'.
	 * @return string
	 */
	public function get_image( $category, $size = 'full' ) {
		$image    = '';
		$image_id = get_term_meta( $category->term_id, 'thumbnail_id', true );

		if ( $image_id ) {
			$image = wp_get_attachment_image_url( $image_id, $size );
		}

		return $image;
	}

	/**
	 * Extra data passed through from server to client for block.
	 *
	 * @param array $attributes  Any attributes that currently are available from the block.
	 *                           Note, this will be empty in the editor context when the block is
	 *                           not in the post content on editor load.
	 */
	protected function enqueue_data( array $attributes = [] ) {
		parent::enqueue_data( $attributes );
		$this->asset_data_registry->add( 'min_height', wc_get_theme_support( 'featured_block::min_height', 500 ), true );
		$this->asset_data_registry->add( 'default_height', wc_get_theme_support( 'featured_block::default_height', 500 ), true );
	}
}
woocommerce-blocks/src/BlockTypes/ProductCategories.php000064400000026124151335517640017362 0ustar00<?php
namespace Automattic\WooCommerce\Blocks\BlockTypes;

/**
 * ProductCategories class.
 */
class ProductCategories extends AbstractDynamicBlock {

	/**
	 * Block name.
	 *
	 * @var string
	 */
	protected $block_name = 'product-categories';

	/**
	 * Default attribute values, should match what's set in JS `registerBlockType`.
	 *
	 * @var array
	 */
	protected $defaults = array(
		'hasCount'       => true,
		'hasImage'       => false,
		'hasEmpty'       => false,
		'isDropdown'     => false,
		'isHierarchical' => true,
	);

	/**
	 * Get block attributes.
	 *
	 * @return array
	 */
	protected function get_block_type_attributes() {
		return array_merge(
			parent::get_block_type_attributes(),
			array(
				'align'          => $this->get_schema_align(),
				'className'      => $this->get_schema_string(),
				'hasCount'       => $this->get_schema_boolean( true ),
				'hasImage'       => $this->get_schema_boolean( false ),
				'hasEmpty'       => $this->get_schema_boolean( false ),
				'isDropdown'     => $this->get_schema_boolean( false ),
				'isHierarchical' => $this->get_schema_boolean( true ),
			)
		);
	}

	/**
	 * Render the Product Categories List block.
	 *
	 * @param array  $attributes Block attributes.
	 * @param string $content    Block content.
	 * @return string Rendered block type output.
	 */
	protected function render( $attributes, $content ) {
		$uid        = uniqid( 'product-categories-' );
		$categories = $this->get_categories( $attributes );

		if ( empty( $categories ) ) {
			return '';
		}

		if ( ! empty( $content ) ) {
			// Deal with legacy attributes (before this was an SSR block) that differ from defaults.
			if ( strstr( $content, 'data-has-count="false"' ) ) {
				$attributes['hasCount'] = false;
			}
			if ( strstr( $content, 'data-is-dropdown="true"' ) ) {
				$attributes['isDropdown'] = true;
			}
			if ( strstr( $content, 'data-is-hierarchical="false"' ) ) {
				$attributes['isHierarchical'] = false;
			}
			if ( strstr( $content, 'data-has-empty="true"' ) ) {
				$attributes['hasEmpty'] = true;
			}
		}

		$classes = $this->get_container_classes( $attributes );

		$output  = '<div class="' . esc_attr( $classes ) . '">';
		$output .= ! empty( $attributes['isDropdown'] ) ? $this->renderDropdown( $categories, $attributes, $uid ) : $this->renderList( $categories, $attributes, $uid );
		$output .= '</div>';

		return $output;
	}

	/**
	 * Get the list of classes to apply to this block.
	 *
	 * @param array $attributes Block attributes. Default empty array.
	 * @return string space-separated list of classes.
	 */
	protected function get_container_classes( $attributes = array() ) {
		$classes = array( 'wc-block-product-categories' );

		if ( isset( $attributes['align'] ) ) {
			$classes[] = "align{$attributes['align']}";
		}

		if ( ! empty( $attributes['className'] ) ) {
			$classes[] = $attributes['className'];
		}

		if ( $attributes['isDropdown'] ) {
			$classes[] = 'is-dropdown';
		} else {
			$classes[] = 'is-list';
		}

		return implode( ' ', $classes );
	}

	/**
	 * Get categories (terms) from the db.
	 *
	 * @param array $attributes Block attributes. Default empty array.
	 * @return array
	 */
	protected function get_categories( $attributes ) {
		$hierarchical = wc_string_to_bool( $attributes['isHierarchical'] );
		$categories   = get_terms(
			'product_cat',
			[
				'hide_empty'   => ! $attributes['hasEmpty'],
				'pad_counts'   => true,
				'hierarchical' => true,
			]
		);

		if ( ! is_array( $categories ) || empty( $categories ) ) {
			return [];
		}

		// This ensures that no categories with a product count of 0 is rendered.
		if ( ! $attributes['hasEmpty'] ) {
			$categories = array_filter(
				$categories,
				function( $category ) {
					return 0 !== $category->count;
				}
			);
		}

		return $hierarchical ? $this->build_category_tree( $categories ) : $categories;
	}

	/**
	 * Build hierarchical tree of categories.
	 *
	 * @param array $categories List of terms.
	 * @return array
	 */
	protected function build_category_tree( $categories ) {
		$categories_by_parent = [];

		foreach ( $categories as $category ) {
			if ( ! isset( $categories_by_parent[ 'cat-' . $category->parent ] ) ) {
				$categories_by_parent[ 'cat-' . $category->parent ] = [];
			}
			$categories_by_parent[ 'cat-' . $category->parent ][] = $category;
		}

		$tree = $categories_by_parent['cat-0'];
		unset( $categories_by_parent['cat-0'] );

		foreach ( $tree as $category ) {
			if ( ! empty( $categories_by_parent[ 'cat-' . $category->term_id ] ) ) {
				$category->children = $this->fill_category_children( $categories_by_parent[ 'cat-' . $category->term_id ], $categories_by_parent );
			}
		}

		return $tree;
	}

	/**
	 * Build hierarchical tree of categories by appending children in the tree.
	 *
	 * @param array $categories List of terms.
	 * @param array $categories_by_parent List of terms grouped by parent.
	 * @return array
	 */
	protected function fill_category_children( $categories, $categories_by_parent ) {
		foreach ( $categories as $category ) {
			if ( ! empty( $categories_by_parent[ 'cat-' . $category->term_id ] ) ) {
				$category->children = $this->fill_category_children( $categories_by_parent[ 'cat-' . $category->term_id ], $categories_by_parent );
			}
		}
		return $categories;
	}

	/**
	 * Render the category list as a dropdown.
	 *
	 * @param array $categories List of terms.
	 * @param array $attributes Block attributes. Default empty array.
	 * @param int   $uid Unique ID for the rendered block, used for HTML IDs.
	 * @return string Rendered output.
	 */
	protected function renderDropdown( $categories, $attributes, $uid ) {
		$aria_label = empty( $attributes['hasCount'] ) ?
			__( 'List of categories', 'woocommerce' ) :
			__( 'List of categories with their product counts', 'woocommerce' );

		$output = '
			<div class="wc-block-product-categories__dropdown">
				<label
				class="screen-reader-text"
					for="' . esc_attr( $uid ) . '-select"
				>
					' . esc_html__( 'Select a category', 'woocommerce' ) . '
				</label>
				<select aria-label="' . esc_attr( $aria_label ) . '" id="' . esc_attr( $uid ) . '-select">
					<option value="false" hidden>
						' . esc_html__( 'Select a category', 'woocommerce' ) . '
					</option>
					' . $this->renderDropdownOptions( $categories, $attributes, $uid ) . '
				</select>
			</div>
			<button
				type="button"
				class="wc-block-product-categories__button"
				aria-label="' . esc_html__( 'Go to category', 'woocommerce' ) . '"
				onclick="const url = document.getElementById( \'' . esc_attr( $uid ) . '-select\' ).value; if ( \'false\' !== url ) document.location.href = url;"
			>
				<svg
					aria-hidden="true"
					role="img"
					focusable="false"
					class="dashicon dashicons-arrow-right-alt2"
					xmlns="http://www.w3.org/2000/svg"
					width="20"
					height="20"
					viewBox="0 0 20 20"
				>
					<path d="M6 15l5-5-5-5 1-2 7 7-7 7z" />
				</svg>
			</button>
		';
		return $output;
	}

	/**
	 * Render dropdown options list.
	 *
	 * @param array $categories List of terms.
	 * @param array $attributes Block attributes. Default empty array.
	 * @param int   $uid Unique ID for the rendered block, used for HTML IDs.
	 * @param int   $depth Current depth.
	 * @return string Rendered output.
	 */
	protected function renderDropdownOptions( $categories, $attributes, $uid, $depth = 0 ) {
		$output = '';

		foreach ( $categories as $category ) {
			$output .= '
				<option value="' . esc_attr( get_term_link( $category->term_id, 'product_cat' ) ) . '">
					' . str_repeat( '&minus;', $depth ) . '
					' . esc_html( $category->name ) . '
					' . $this->getCount( $category, $attributes ) . '
				</option>
				' . ( ! empty( $category->children ) ? $this->renderDropdownOptions( $category->children, $attributes, $uid, $depth + 1 ) : '' ) . '
			';
		}

		return $output;
	}

	/**
	 * Render the category list as a list.
	 *
	 * @param array $categories List of terms.
	 * @param array $attributes Block attributes. Default empty array.
	 * @param int   $uid Unique ID for the rendered block, used for HTML IDs.
	 * @param int   $depth Current depth.
	 * @return string Rendered output.
	 */
	protected function renderList( $categories, $attributes, $uid, $depth = 0 ) {
		$classes = [
			'wc-block-product-categories-list',
			'wc-block-product-categories-list--depth-' . absint( $depth ),
		];
		if ( ! empty( $attributes['hasImage'] ) ) {
			$classes[] = 'wc-block-product-categories-list--has-images';
		}
		$output = '<ul class="' . esc_attr( implode( ' ', $classes ) ) . '">' . $this->renderListItems( $categories, $attributes, $uid, $depth ) . '</ul>';

		return $output;
	}

	/**
	 * Render a list of terms.
	 *
	 * @param array $categories List of terms.
	 * @param array $attributes Block attributes. Default empty array.
	 * @param int   $uid Unique ID for the rendered block, used for HTML IDs.
	 * @param int   $depth Current depth.
	 * @return string Rendered output.
	 */
	protected function renderListItems( $categories, $attributes, $uid, $depth = 0 ) {
		$output = '';

		foreach ( $categories as $category ) {
			$output .= '
				<li class="wc-block-product-categories-list-item">
					<a href="' . esc_attr( get_term_link( $category->term_id, 'product_cat' ) ) . '">' . $this->get_image_html( $category, $attributes ) . esc_html( $category->name ) . '</a>
					' . $this->getCount( $category, $attributes ) . '
					' . ( ! empty( $category->children ) ? $this->renderList( $category->children, $attributes, $uid, $depth + 1 ) : '' ) . '
				</li>
			';
		}

		return preg_replace( '/\r|\n/', '', $output );
	}

	/**
	 * Returns the category image html
	 *
	 * @param \WP_Term $category Term object.
	 * @param array    $attributes Block attributes. Default empty array.
	 * @param string   $size Image size, defaults to 'woocommerce_thumbnail'.
	 * @return string
	 */
	public function get_image_html( $category, $attributes, $size = 'woocommerce_thumbnail' ) {
		if ( empty( $attributes['hasImage'] ) ) {
			return '';
		}

		$image_id = get_term_meta( $category->term_id, 'thumbnail_id', true );

		if ( ! $image_id ) {
			return '<span class="wc-block-product-categories-list-item__image wc-block-product-categories-list-item__image--placeholder">' . wc_placeholder_img( 'woocommerce_thumbnail' ) . '</span>';
		}

		return '<span class="wc-block-product-categories-list-item__image">' . wp_get_attachment_image( $image_id, 'woocommerce_thumbnail' ) . '</span>';
	}

	/**
	 * Get the count, if displaying.
	 *
	 * @param object $category Term object.
	 * @param array  $attributes Block attributes. Default empty array.
	 * @return string
	 */
	protected function getCount( $category, $attributes ) {
		if ( empty( $attributes['hasCount'] ) ) {
			return '';
		}

		if ( $attributes['isDropdown'] ) {
			return '(' . absint( $category->count ) . ')';
		}

		$screen_reader_text = sprintf(
			/* translators: %s number of products in cart. */
			_n( '%d product', '%d products', absint( $category->count ), 'woocommerce' ),
			absint( $category->count )
		);

		return '<span class="wc-block-product-categories-list-item-count">'
			. '<span aria-hidden="true">' . absint( $category->count ) . '</span>'
			. '<span class="screen-reader-text">' . esc_html( $screen_reader_text ) . '</span>'
		. '</span>';
	}
}
woocommerce-blocks/src/BlockTypes/ProductCategory.php000064400000001335151335517640017047 0ustar00<?php
namespace Automattic\WooCommerce\Blocks\BlockTypes;

/**
 * ProductCategory class.
 */
class ProductCategory extends AbstractProductGrid {
	/**
	 * Block name.
	 *
	 * @var string
	 */
	protected $block_name = 'product-category';

	/**
	 * Set args specific to this block
	 *
	 * @param array $query_args Query args.
	 */
	protected function set_block_query_args( &$query_args ) {}

	/**
	 * Get block attributes.
	 *
	 * @return array
	 */
	protected function get_block_type_attributes() {
		return array_merge(
			parent::get_block_type_attributes(),
			array(
				'className' => $this->get_schema_string(),
				'orderby'   => $this->get_schema_orderby(),
				'editMode'  => $this->get_schema_boolean( true ),
			)
		);
	}
}
woocommerce-blocks/src/BlockTypes/ProductSearch.php000064400000006665151335517640016512 0ustar00<?php
namespace Automattic\WooCommerce\Blocks\BlockTypes;

/**
 * ProductSearch class.
 */
class ProductSearch extends AbstractBlock {

	/**
	 * Block name.
	 *
	 * @var string
	 */
	protected $block_name = 'product-search';

	/**
	 * Get the frontend script handle for this block type.
	 *
	 * @param string $key Data to get, or default to everything.
	 * @return null
	 */
	protected function get_block_type_script( $key = null ) {
		return null;
	}

	/**
	 * Render the block.
	 *
	 * @param array  $attributes Block attributes.
	 * @param string $content    Block content.
	 * @return string Rendered block type output.
	 */
	protected function render( $attributes, $content ) {
		static $instance_id = 0;

		$attributes = wp_parse_args(
			$attributes,
			array(
				'hasLabel'    => true,
				'align'       => '',
				'className'   => '',
				'label'       => __( 'Search', 'woocommerce' ),
				'placeholder' => __( 'Search products…', 'woocommerce' ),
			)
		);

		/**
		 * Product Search event.
		 *
		 * Listens for product search form submission, and on submission fires a WP Hook named
		 * `experimental__woocommerce_blocks-product-search`. This can be used by tracking extensions such as Google
		 * Analytics to track searches.
		 */
		$this->asset_api->add_inline_script(
			'wp-hooks',
			"
			window.addEventListener( 'DOMContentLoaded', () => {
				const forms = document.querySelectorAll( '.wc-block-product-search form' );

				for ( const form of forms ) {
					form.addEventListener( 'submit', ( event ) => {
						const field = form.querySelector( '.wc-block-product-search__field' );

						if ( field && field.value ) {
							wp.hooks.doAction( 'experimental__woocommerce_blocks-product-search', { event: event, searchTerm: field.value } );
						}
					} );
				}
			} );
			",
			'after'
		);

		$input_id           = 'wc-block-search__input-' . ( ++$instance_id );
		$wrapper_attributes = get_block_wrapper_attributes(
			array(
				'class' => implode(
					' ',
					array_filter(
						[
							'wc-block-product-search',
							$attributes['align'] ? 'align' . $attributes['align'] : '',
						]
					)
				),
			)
		);

		$label_markup = $attributes['hasLabel'] ? sprintf(
			'<label for="%s" class="wc-block-product-search__label">%s</label>',
			esc_attr( $input_id ),
			esc_html( $attributes['label'] )
		) : sprintf(
			'<label for="%s" class="wc-block-product-search__label screen-reader-text">%s</label>',
			esc_attr( $input_id ),
			esc_html( $attributes['label'] )
		);

		$input_markup  = sprintf(
			'<input type="search" id="%s" class="wc-block-product-search__field" placeholder="%s" name="s" />',
			esc_attr( $input_id ),
			esc_attr( $attributes['placeholder'] )
		);
		$button_markup = sprintf(
			'<button type="submit" class="wc-block-product-search__button" aria-label="%s">
				<svg aria-hidden="true" role="img" focusable="false" class="dashicon dashicons-arrow-right-alt2" xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20">
					<path d="M6 15l5-5-5-5 1-2 7 7-7 7z" />
				</svg>
			</button>',
			esc_attr__( 'Search', 'woocommerce' )
		);

		$field_markup = '
			<div class="wc-block-product-search__fields">
				' . $input_markup . $button_markup . '
				<input type="hidden" name="post_type" value="product" />
			</div>
		';

		return sprintf(
			'<div %s><form role="search" method="get" action="%s">%s</form></div>',
			$wrapper_attributes,
			esc_url( home_url( '/' ) ),
			$label_markup . $field_markup
		);
	}
}
woocommerce-blocks/src/BlockTypes/CartI2.php000064400000013167151335517640015023 0ustar00<?php
namespace Automattic\WooCommerce\Blocks\BlockTypes;

use Automattic\WooCommerce\Blocks\Package;
use Automattic\WooCommerce\Blocks\Assets;
use Automattic\WooCommerce\Blocks\Assets\AssetDataRegistry;

/**
 * Cart class.
 *
 * @internal
 */
class CartI2 extends AbstractBlock {
	/**
	 * Block name.
	 *
	 * @var string
	 */
	protected $block_name = 'cart-i2';

	/**
	 * Get the editor script handle for this block type.
	 *
	 * @param string $key Data to get, or default to everything.
	 * @return array|string;
	 */
	protected function get_block_type_editor_script( $key = null ) {
		$script = [
			'handle'       => 'wc-' . $this->block_name . '-block',
			'path'         => $this->asset_api->get_block_asset_build_path( $this->block_name ),
			'dependencies' => [ 'wc-blocks' ],
		];
		return $key ? $script[ $key ] : $script;
	}

	/**
	 * Get the frontend script handle for this block type.
	 *
	 * @see $this->register_block_type()
	 * @param string $key Data to get, or default to everything.
	 * @return array|string
	 */
	protected function get_block_type_script( $key = null ) {
		$script = [
			'handle'       => 'wc-' . $this->block_name . '-block-frontend',
			'path'         => $this->asset_api->get_block_asset_build_path( $this->block_name . '-frontend' ),
			'dependencies' => [],
		];
		return $key ? $script[ $key ] : $script;
	}

	/**
	 * Enqueue frontend assets for this block, just in time for rendering.
	 *
	 * @param array $attributes  Any attributes that currently are available from the block.
	 */
	protected function enqueue_assets( array $attributes ) {
		do_action( 'woocommerce_blocks_enqueue_cart_block_scripts_before' );
		parent::enqueue_assets( $attributes );
		do_action( 'woocommerce_blocks_enqueue_cart_block_scripts_after' );
	}

	/**
	 * Append frontend scripts when rendering the Cart block.
	 *
	 * @param array  $attributes Block attributes.
	 * @param string $content    Block content.
	 * @return string Rendered block type output.
	 */
	protected function render( $attributes, $content ) {
		// Deregister core cart scripts and styles.
		wp_dequeue_script( 'wc-cart' );
		wp_dequeue_script( 'wc-password-strength-meter' );
		wp_dequeue_script( 'selectWoo' );
		wp_dequeue_style( 'select2' );

		return $this->inject_html_data_attributes( $content, $attributes );
	}

	/**
	 * Extra data passed through from server to client for block.
	 *
	 * @param array $attributes  Any attributes that currently are available from the block.
	 *                           Note, this will be empty in the editor context when the block is
	 *                           not in the post content on editor load.
	 */
	protected function enqueue_data( array $attributes = [] ) {
		parent::enqueue_data( $attributes );

		$this->asset_data_registry->add(
			'shippingCountries',
			function() {
				return $this->deep_sort_with_accents( WC()->countries->get_shipping_countries() );
			},
			true
		);
		$this->asset_data_registry->add(
			'shippingStates',
			function() {
				return $this->deep_sort_with_accents( WC()->countries->get_shipping_country_states() );
			},
			true
		);
		$this->asset_data_registry->add(
			'countryLocale',
			function() {
				// Merge country and state data to work around https://github.com/woocommerce/woocommerce/issues/28944.
				$country_locale = wc()->countries->get_country_locale();
				$states         = wc()->countries->get_states();

				foreach ( $states as $country => $states ) {
					if ( empty( $states ) ) {
						$country_locale[ $country ]['state']['required'] = false;
						$country_locale[ $country ]['state']['hidden']   = true;
					}
				}
				return $country_locale;
			},
			true
		);
		$this->asset_data_registry->add( 'baseLocation', wc_get_base_location(), true );
		$this->asset_data_registry->add( 'isShippingCalculatorEnabled', filter_var( get_option( 'woocommerce_enable_shipping_calc' ), FILTER_VALIDATE_BOOLEAN ), true );
		$this->asset_data_registry->add( 'displayItemizedTaxes', 'itemized' === get_option( 'woocommerce_tax_total_display' ), true );
		$this->asset_data_registry->add( 'displayCartPricesIncludingTax', 'incl' === get_option( 'woocommerce_tax_display_cart' ), true );
		$this->asset_data_registry->add( 'taxesEnabled', wc_tax_enabled(), true );
		$this->asset_data_registry->add( 'couponsEnabled', wc_coupons_enabled(), true );
		$this->asset_data_registry->add( 'shippingEnabled', wc_shipping_enabled(), true );
		$this->asset_data_registry->add( 'hasDarkEditorStyleSupport', current_theme_supports( 'dark-editor-style' ), true );
		$this->asset_data_registry->register_page_id( isset( $attributes['checkoutPageId'] ) ? $attributes['checkoutPageId'] : 0 );

		// Hydrate the following data depending on admin or frontend context.
		if ( ! is_admin() && ! WC()->is_rest_api_request() ) {
			$this->hydrate_from_api();
		}

		do_action( 'woocommerce_blocks_cart_enqueue_data' );
	}

	/**
	 * Removes accents from an array of values, sorts by the values, then returns the original array values sorted.
	 *
	 * @param array $array Array of values to sort.
	 * @return array Sorted array.
	 */
	protected function deep_sort_with_accents( $array ) {
		if ( ! is_array( $array ) || empty( $array ) ) {
			return $array;
		}

		if ( is_array( reset( $array ) ) ) {
			return array_map( [ $this, 'deep_sort_with_accents' ], $array );
		}

		$array_without_accents = array_map( 'remove_accents', array_map( 'wc_strtolower', array_map( 'html_entity_decode', $array ) ) );
		asort( $array_without_accents );
		return array_replace( $array_without_accents, $array );
	}

	/**
	 * Hydrate the cart block with data from the API.
	 */
	protected function hydrate_from_api() {
		$this->asset_data_registry->hydrate_api_request( '/wc/store/cart' );
	}
}
woocommerce-blocks/src/BlockTypes/AbstractDynamicBlock.php000064400000003544151335517640017760 0ustar00<?php
namespace Automattic\WooCommerce\Blocks\BlockTypes;

/**
 * AbstractDynamicBlock class.
 */
abstract class AbstractDynamicBlock extends AbstractBlock {
	/**
	 * Get the frontend script handle for this block type.
	 *
	 * @param string $key Data to get, or default to everything.
	 * @return null
	 */
	protected function get_block_type_script( $key = null ) {
		return null;
	}

	/**
	 * Get block attributes.
	 *
	 * @return array
	 */
	protected function get_block_type_attributes() {
		return array();
	}

	/**
	 * Get the schema for the alignment property.
	 *
	 * @return array Property definition for align.
	 */
	protected function get_schema_align() {
		return array(
			'type' => 'string',
			'enum' => array( 'left', 'center', 'right', 'wide', 'full' ),
		);
	}

	/**
	 * Get the schema for a list of IDs.
	 *
	 * @return array Property definition for a list of numeric ids.
	 */
	protected function get_schema_list_ids() {
		return array(
			'type'    => 'array',
			'items'   => array(
				'type' => 'number',
			),
			'default' => array(),
		);
	}

	/**
	 * Get the schema for a boolean value.
	 *
	 * @param  string $default  The default value.
	 * @return array Property definition.
	 */
	protected function get_schema_boolean( $default = true ) {
		return array(
			'type'    => 'boolean',
			'default' => $default,
		);
	}

	/**
	 * Get the schema for a numeric value.
	 *
	 * @param  string $default  The default value.
	 * @return array Property definition.
	 */
	protected function get_schema_number( $default ) {
		return array(
			'type'    => 'number',
			'default' => $default,
		);
	}

	/**
	 * Get the schema for a string value.
	 *
	 * @param  string $default  The default value.
	 * @return array Property definition.
	 */
	protected function get_schema_string( $default = '' ) {
		return array(
			'type'    => 'string',
			'default' => $default,
		);
	}
}
woocommerce-blocks/src/BlockTypes/MiniCart.php000064400000023227151335517640015443 0ustar00<?php
namespace Automattic\WooCommerce\Blocks\BlockTypes;

use Automattic\WooCommerce\Blocks\Package;
use Automattic\WooCommerce\Blocks\Assets;
use Automattic\WooCommerce\Blocks\Assets\AssetDataRegistry;
use Automattic\WooCommerce\Blocks\StoreApi\Utilities\CartController;

/**
 * Mini Cart class.
 *
 * @internal
 */
class MiniCart extends AbstractBlock {
	/**
	 * Block name.
	 *
	 * @var string
	 */
	protected $block_name = 'mini-cart';

	/**
	 * Array of scripts that will be lazy loaded when interacting with the block.
	 *
	 * @var string[]
	 */
	protected $scripts_to_lazy_load = array();

	/**
	 * Get the editor script handle for this block type.
	 *
	 * @param string $key Data to get, or default to everything.
	 * @return array|string;
	 */
	protected function get_block_type_editor_script( $key = null ) {
		$script = [
			'handle'       => 'wc-' . $this->block_name . '-block',
			'path'         => $this->asset_api->get_block_asset_build_path( $this->block_name ),
			'dependencies' => [ 'wc-blocks' ],
		];
		return $key ? $script[ $key ] : $script;
	}

	/**
	 * Get the frontend script handle for this block type.
	 *
	 * @see $this->register_block_type()
	 * @param string $key Data to get, or default to everything.
	 * @return array|string
	 */
	protected function get_block_type_script( $key = null ) {
		if ( is_cart() || is_checkout() ) {
			return;
		}

		$script = [
			'handle'       => 'wc-' . $this->block_name . '-block-frontend',
			'path'         => $this->asset_api->get_block_asset_build_path( $this->block_name . '-frontend' ),
			'dependencies' => [],
		];
		return $key ? $script[ $key ] : $script;
	}

	/**
	 * Extra data passed through from server to client for block.
	 *
	 * @param array $attributes  Any attributes that currently are available from the block.
	 *                           Note, this will be empty in the editor context when the block is
	 *                           not in the post content on editor load.
	 */
	protected function enqueue_data( array $attributes = [] ) {
		if ( is_cart() || is_checkout() ) {
			return;
		}

		parent::enqueue_data( $attributes );

		// Hydrate the following data depending on admin or frontend context.
		if ( ! is_admin() && ! WC()->is_rest_api_request() ) {
			$this->hydrate_from_api();
		}

		$script_data = $this->asset_api->get_script_data( 'build/mini-cart-component-frontend.js' );

		$num_dependencies = count( $script_data['dependencies'] );
		$wp_scripts       = wp_scripts();

		for ( $i = 0; $i < $num_dependencies; $i++ ) {
			$dependency = $script_data['dependencies'][ $i ];

			foreach ( $wp_scripts->registered as $script ) {
				if ( $script->handle === $dependency ) {
					$this->append_script_and_deps_src( $script );
					break;
				}
			}
		}

		$this->scripts_to_lazy_load['wc-block-mini-cart-component-frontend'] = array(
			'src'     => $script_data['src'],
			'version' => $script_data['version'],
		);

		$this->asset_data_registry->add(
			'mini_cart_block_frontend_dependencies',
			$this->scripts_to_lazy_load,
			true
		);

		$this->asset_data_registry->add(
			'displayCartPricesIncludingTax',
			'incl' === get_option( 'woocommerce_tax_display_cart' ),
			true
		);

		do_action( 'woocommerce_blocks_cart_enqueue_data' );
	}

	/**
	 * Hydrate the cart block with data from the API.
	 */
	protected function hydrate_from_api() {
		$this->asset_data_registry->hydrate_api_request( '/wc/store/cart' );
	}

	/**
	 * Returns the script data given its handle.
	 *
	 * @param string $handle Handle of the script.
	 *
	 * @return array Array containing the script data.
	 */
	protected function get_script_from_handle( $handle ) {
		$wp_scripts = wp_scripts();
		foreach ( $wp_scripts->registered as $script ) {
			if ( $script->handle === $handle ) {
				return $script;
			}
		}

		return '';
	}

	/**
	 * Recursively appends a scripts and its dependencies into the
	 * scripts_to_lazy_load array.
	 *
	 * @param string $script Array containing script data.
	 */
	protected function append_script_and_deps_src( $script ) {
		$wp_scripts = wp_scripts();
		// This script and its dependencies have already been appended.
		if ( array_key_exists( $script->handle, $this->scripts_to_lazy_load ) ) {
			return;
		}

		if ( count( $script->deps ) > 0 ) {
			foreach ( $script->deps as $dep ) {
				if ( ! array_key_exists( $dep, $this->scripts_to_lazy_load ) ) {
					$dep_script = $this->get_script_from_handle( $dep );
					$this->append_script_and_deps_src( $dep_script );
				}
			}
		}
		$this->scripts_to_lazy_load[ $script->handle ] = array(
			'src'          => $script->src,
			'version'      => $script->ver,
			'before'       => $wp_scripts->print_inline_script( $script->handle, 'before', false ),
			'after'        => $wp_scripts->print_inline_script( $script->handle, 'after', false ),
			'translations' => $wp_scripts->print_translations( $script->handle, false ),
		);
	}

	/**
	 * Append frontend scripts when rendering the Mini Cart block.
	 *
	 * @param array  $attributes Block attributes.
	 * @param string $content    Block content.
	 *
	 * @return string Rendered block type output.
	 */
	protected function render( $attributes, $content ) {
		return $this->inject_html_data_attributes( $content . $this->get_markup(), $attributes );
	}

	/**
	 * Render the markup for the Mini Cart block.
	 *
	 * @return string The HTML markup.
	 */
	protected function get_markup() {
		if ( is_admin() || WC()->is_rest_api_request() ) {
			// In the editor we will display the placeholder, so no need to load
			// real cart data and to print the markup.
			return '';
		}
		$cart_controller     = new CartController();
		$cart                = $cart_controller->get_cart_instance();
		$cart_contents_count = $cart->get_cart_contents_count();
		$cart_contents       = $cart->get_cart();
		$cart_contents_total = $cart->get_subtotal();

		if ( $cart->display_prices_including_tax() ) {
			$cart_contents_total += $cart->get_subtotal_tax();
		}

		$button_text = sprintf(
			/* translators: %d is the number of products in the cart. */
			_n(
				'%d item',
				'%d items',
				$cart_contents_count,
				'woocommerce'
			),
			$cart_contents_count
		);
		$aria_label = sprintf(
			/* translators: %1$d is the number of products in the cart. %2$s is the cart total */
			_n(
				'%1$d item in cart, total price of %2$s',
				'%1$d items in cart, total price of %2$s',
				$cart_contents_count,
				'woocommerce'
			),
			$cart_contents_count,
			wp_strip_all_tags( wc_price( $cart_contents_total ) )
		);
		$title = sprintf(
			/* translators: %d is the count of items in the cart. */
			_n(
				'Your cart (%d item)',
				'Your cart (%d items)',
				$cart_contents_count,
				'woocommerce'
			),
			$cart_contents_count
		);

		if ( is_cart() || is_checkout() ) {
			return '<div class="wc-block-mini-cart">
				<button class="wc-block-mini-cart__button" aria-label="' . $aria_label . '" disabled>' . $button_text . '</button>
			</div>';
		}

		return '<div class="wc-block-mini-cart">
			<button class="wc-block-mini-cart__button" aria-label="' . $aria_label . '">' . $button_text . '</button>
			<div class="wc-block-mini-cart__drawer is-loading is-mobile wc-block-components-drawer__screen-overlay wc-block-components-drawer__screen-overlay--is-hidden" aria-hidden="true">
				<div class="components-modal__frame wc-block-components-drawer">
					<div class="components-modal__content">
						<div class="components-modal__header">
							<div class="components-modal__header-heading-container">
								<h1 id="components-modal-header-1" class="components-modal__header-heading">' . $title . '</h1>
							</div>
						</div>'
						. $this->get_cart_contents_markup( $cart_contents ) .
					'</div>
				</div>
			</div>
		</div>';
	}

	/**
	 * Render the markup of the Cart contents.
	 *
	 * @param array $cart_contents Array of contents in the cart.
	 *
	 * @return string The HTML markup.
	 */
	protected function get_cart_contents_markup( $cart_contents ) {
		// Force mobile styles.
		return '<table class="wc-block-cart-items">
			<thead>
				<tr class="wc-block-cart-items__header">
					<th class="wc-block-cart-items__header-image"><span /></th>
					<th class="wc-block-cart-items__header-product"><span /></th>
					<th class="wc-block-cart-items__header-total"><span /></th>
				</tr>
			</thead>
			<tbody>' . implode( array_map( array( $this, 'get_cart_item_markup' ), $cart_contents ) ) . '</tbody>
		</table>';
	}

	/**
	 * Render the skeleton of a Cart item.
	 *
	 * @return string The skeleton HTML markup.
	 */
	protected function get_cart_item_markup() {
		return '<tr class="wc-block-cart-items__row">
			<td class="wc-block-cart-item__image">
				<a href=""><img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNk+A8AAQUBAScY42YAAAAASUVORK5CYII=" width="1" height="1" /></a>
			</td>
			<td class="wc-block-cart-item__product">
				<div class="wc-block-components-product-name"></div>
				<div class="wc-block-components-product-price"></div>
				<div class="wc-block-components-product-metadata"></div>
				<div class="wc-block-cart-item__quantity">
					<div class="wc-block-components-quantity-selector">
						<input class="wc-block-components-quantity-selector__input" type="number" step="1" min="0" value="1" />
						<button class="wc-block-components-quantity-selector__button wc-block-components-quantity-selector__button--minus">-</button>
						<button class="wc-block-components-quantity-selector__button wc-block-components-quantity-selector__button--plus">+</button>
					</div>
					<button class="wc-block-cart-item__remove-link"></button>
				</div>
			</td>
			<td class="wc-block-cart-item__total">
				<div class="wc-block-cart-item__total-price-and-sale-badge-wrapper">
					<div class="wc-block-components-product-price"></div>
				</div>
			</td>
		</tr>';
	}
}
woocommerce-blocks/src/BlockTypes/ProductNew.php000064400000000700151335517640016016 0ustar00<?php
namespace Automattic\WooCommerce\Blocks\BlockTypes;

/**
 * ProductNew class.
 */
class ProductNew extends AbstractProductGrid {

	/**
	 * Block name.
	 *
	 * @var string
	 */
	protected $block_name = 'product-new';

	/**
	 * Set args specific to this block
	 *
	 * @param array $query_args Query args.
	 */
	protected function set_block_query_args( &$query_args ) {
		$query_args['orderby'] = 'date';
		$query_args['order']   = 'DESC';
	}
}
woocommerce-blocks/src/BlockTypes/ProductTopRated.php000064400000000650151335517640017013 0ustar00<?php
namespace Automattic\WooCommerce\Blocks\BlockTypes;

/**
 * ProductTopRated class.
 */
class ProductTopRated extends AbstractProductGrid {

	/**
	 * Block name.
	 *
	 * @var string
	 */
	protected $block_name = 'product-top-rated';

	/**
	 * Force orderby to rating.
	 *
	 * @param array $query_args Query args.
	 */
	protected function set_block_query_args( &$query_args ) {
		$query_args['orderby'] = 'rating';
	}
}
woocommerce-blocks/src/BlockTypes/SingleProduct.php000064400000001773151335517640016521 0ustar00<?php
namespace Automattic\WooCommerce\Blocks\BlockTypes;

/**
 * SingleProduct class.
 */
class SingleProduct extends AbstractBlock {
	/**
	 * Block name.
	 *
	 * @var string
	 */
	protected $block_name = 'single-product';

	/**
	 * Get the editor script handle for this block type.
	 *
	 * @param string $key Data to get, or default to everything.
	 * @return array|string;
	 */
	protected function get_block_type_editor_script( $key = null ) {
		$script = [
			'handle'       => 'wc-' . $this->block_name . '-block',
			'path'         => $this->asset_api->get_block_asset_build_path( $this->block_name ),
			'dependencies' => [ 'wc-blocks' ],
		];
		return $key ? $script[ $key ] : $script;
	}

	/**
	 * Render the block on the frontend.
	 *
	 * @param array  $attributes Block attributes.
	 * @param string $content    Block content.
	 * @return string Rendered block type output.
	 */
	protected function render( $attributes, $content ) {
		return $this->inject_html_data_attributes( $content, $attributes );
	}
}
woocommerce-blocks/src/BlockTypes/Cart.php000064400000023634151335517640014630 0ustar00<?php
namespace Automattic\WooCommerce\Blocks\BlockTypes;

use Automattic\WooCommerce\Blocks\Package;
use Automattic\WooCommerce\Blocks\Assets;
use Automattic\WooCommerce\Blocks\Assets\AssetDataRegistry;

/**
 * Cart class.
 *
 * @internal
 */
class Cart extends AbstractBlock {
	/**
	 * Block name.
	 *
	 * @var string
	 */
	protected $block_name = 'cart';

	/**
	 * Get the editor script handle for this block type.
	 *
	 * @param string $key Data to get, or default to everything.
	 * @return array|string;
	 */
	protected function get_block_type_editor_script( $key = null ) {
		$script = [
			'handle'       => 'wc-' . $this->block_name . '-block',
			'path'         => $this->asset_api->get_block_asset_build_path( $this->block_name ),
			'dependencies' => [ 'wc-blocks' ],
		];
		return $key ? $script[ $key ] : $script;
	}

	/**
	 * Get the frontend script handle for this block type.
	 *
	 * @see $this->register_block_type()
	 * @param string $key Data to get, or default to everything.
	 * @return array|string
	 */
	protected function get_block_type_script( $key = null ) {
		$script = [
			'handle'       => 'wc-' . $this->block_name . '-block-frontend',
			'path'         => $this->asset_api->get_block_asset_build_path( $this->block_name . '-frontend' ),
			'dependencies' => [],
		];
		return $key ? $script[ $key ] : $script;
	}

	/**
	 * Enqueue frontend assets for this block, just in time for rendering.
	 *
	 * @param array $attributes  Any attributes that currently are available from the block.
	 */
	protected function enqueue_assets( array $attributes ) {
		do_action( 'woocommerce_blocks_enqueue_cart_block_scripts_before' );
		parent::enqueue_assets( $attributes );
		do_action( 'woocommerce_blocks_enqueue_cart_block_scripts_after' );
	}

	/**
	 * Append frontend scripts when rendering the Cart block.
	 *
	 * @param array  $attributes Block attributes.
	 * @param string $content    Block content.
	 * @return string Rendered block type output.
	 */
	protected function render( $attributes, $content ) {
		// Deregister core cart scripts and styles.
		wp_dequeue_script( 'wc-cart' );
		wp_dequeue_script( 'wc-password-strength-meter' );
		wp_dequeue_script( 'selectWoo' );
		wp_dequeue_style( 'select2' );

		return $this->inject_html_data_attributes( $content . $this->get_skeleton(), $attributes );
	}

	/**
	 * Extra data passed through from server to client for block.
	 *
	 * @param array $attributes  Any attributes that currently are available from the block.
	 *                           Note, this will be empty in the editor context when the block is
	 *                           not in the post content on editor load.
	 */
	protected function enqueue_data( array $attributes = [] ) {
		parent::enqueue_data( $attributes );

		$this->asset_data_registry->add(
			'shippingCountries',
			function() {
				return $this->deep_sort_with_accents( WC()->countries->get_shipping_countries() );
			},
			true
		);
		$this->asset_data_registry->add(
			'shippingStates',
			function() {
				return $this->deep_sort_with_accents( WC()->countries->get_shipping_country_states() );
			},
			true
		);
		$this->asset_data_registry->add(
			'countryLocale',
			function() {
				// Merge country and state data to work around https://github.com/woocommerce/woocommerce/issues/28944.
				$country_locale = wc()->countries->get_country_locale();
				$states         = wc()->countries->get_states();

				foreach ( $states as $country => $states ) {
					if ( empty( $states ) ) {
						$country_locale[ $country ]['state']['required'] = false;
						$country_locale[ $country ]['state']['hidden']   = true;
					}
				}
				return $country_locale;
			},
			true
		);
		$this->asset_data_registry->add( 'baseLocation', wc_get_base_location(), true );
		$this->asset_data_registry->add( 'isShippingCalculatorEnabled', filter_var( get_option( 'woocommerce_enable_shipping_calc' ), FILTER_VALIDATE_BOOLEAN ), true );
		$this->asset_data_registry->add( 'displayItemizedTaxes', 'itemized' === get_option( 'woocommerce_tax_total_display' ), true );
		$this->asset_data_registry->add( 'displayCartPricesIncludingTax', 'incl' === get_option( 'woocommerce_tax_display_cart' ), true );
		$this->asset_data_registry->add( 'taxesEnabled', wc_tax_enabled(), true );
		$this->asset_data_registry->add( 'couponsEnabled', wc_coupons_enabled(), true );
		$this->asset_data_registry->add( 'shippingEnabled', wc_shipping_enabled(), true );
		$this->asset_data_registry->add( 'hasDarkEditorStyleSupport', current_theme_supports( 'dark-editor-style' ), true );
		$this->asset_data_registry->register_page_id( isset( $attributes['checkoutPageId'] ) ? $attributes['checkoutPageId'] : 0 );

		// Hydrate the following data depending on admin or frontend context.
		if ( ! is_admin() && ! WC()->is_rest_api_request() ) {
			$this->hydrate_from_api();
		}

		do_action( 'woocommerce_blocks_cart_enqueue_data' );
	}

	/**
	 * Removes accents from an array of values, sorts by the values, then returns the original array values sorted.
	 *
	 * @param array $array Array of values to sort.
	 * @return array Sorted array.
	 */
	protected function deep_sort_with_accents( $array ) {
		if ( ! is_array( $array ) || empty( $array ) ) {
			return $array;
		}

		if ( is_array( reset( $array ) ) ) {
			return array_map( [ $this, 'deep_sort_with_accents' ], $array );
		}

		$array_without_accents = array_map( 'remove_accents', array_map( 'wc_strtolower', array_map( 'html_entity_decode', $array ) ) );
		asort( $array_without_accents );
		return array_replace( $array_without_accents, $array );
	}

	/**
	 * Hydrate the cart block with data from the API.
	 */
	protected function hydrate_from_api() {
		$this->asset_data_registry->hydrate_api_request( '/wc/store/cart' );
	}

	/**
	 * Render skeleton markup for the cart block.
	 */
	protected function get_skeleton() {
		return '
			<div class="wc-block-skeleton wc-block-components-sidebar-layout wc-block-cart wc-block-cart--is-loading wc-block-cart--skeleton hidden" aria-hidden="true">
				<div class="wc-block-components-main wc-block-cart__main">
					<h2 class="wc-block-components-title"><span></span></h2>
					<table class="wc-block-cart-items">
						<thead>
							<tr class="wc-block-cart-items__header">
								<th class="wc-block-cart-items__header-image"><span /></th>
								<th class="wc-block-cart-items__header-product"><span /></th>
								<th class="wc-block-cart-items__header-total"><span /></th>
							</tr>
						</thead>
						<tbody>
							<tr class="wc-block-cart-items__row">
								<td class="wc-block-cart-item__image">
									<a href=""><img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNk+A8AAQUBAScY42YAAAAASUVORK5CYII=" width="1" height="1" /></a>
								</td>
								<td class="wc-block-cart-item__product">
									<div class="wc-block-components-product-name"></div>
									<div class="wc-block-components-product-price"></div>
									<div class="wc-block-components-product-metadata"></div>
									<div class="wc-block-components-quantity-selector">
										<input class="wc-block-components-quantity-selector__input" type="number" step="1" min="0" value="1" />
										<button class="wc-block-components-quantity-selector__button wc-block-components-quantity-selector__button--minus">-</button>
										<button class="wc-block-components-quantity-selector__button wc-block-components-quantity-selector__button--plus">+</button>
									</div>
								</td>
								<td class="wc-block-cart-item__total">
									<div class="wc-block-components-product-price"></div>
								</td>
							</tr>
							<tr class="wc-block-cart-items__row">
								<td class="wc-block-cart-item__image">
									<a href=""><img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNk+A8AAQUBAScY42YAAAAASUVORK5CYII=" width="1" height="1" /></a>
								</td>
								<td class="wc-block-cart-item__product">
									<div class="wc-block-components-product-name"></div>
									<div class="wc-block-components-product-price"></div>
									<div class="wc-block-components-product-metadata"></div>
									<div class="wc-block-components-quantity-selector">
										<input class="wc-block-components-quantity-selector__input" type="number" step="1" min="0" value="1" />
										<button class="wc-block-components-quantity-selector__button wc-block-components-quantity-selector__button--minus">-</button>
										<button class="wc-block-components-quantity-selector__button wc-block-components-quantity-selector__button--plus">+</button>
									</div>
								</td>
								<td class="wc-block-cart-item__total">
									<div class="wc-block-components-product-price"></div>
								</td>
							</tr>
							<tr class="wc-block-cart-items__row">
								<td class="wc-block-cart-item__image">
									<a href=""><img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNk+A8AAQUBAScY42YAAAAASUVORK5CYII=" width="1" height="1" /></a>
								</td>
								<td class="wc-block-cart-item__product">
									<div class="wc-block-components-product-name"></div>
									<div class="wc-block-components-product-price"></div>
									<div class="wc-block-components-product-metadata"></div>
									<div class="wc-block-components-quantity-selector">
										<input class="wc-block-components-quantity-selector__input" type="number" step="1" min="0" value="1" />
										<button class="wc-block-components-quantity-selector__button wc-block-components-quantity-selector__button--minus">-</button>
										<button class="wc-block-components-quantity-selector__button wc-block-components-quantity-selector__button--plus">+</button>
									</div>
								</td>
								<td class="wc-block-cart-item__total">
									<div class="wc-block-components-product-price"></div>
								</td>
							</tr>
						</tbody>
					</table>
				</div>
				<div class="wc-block-components-sidebar wc-block-cart__sidebar">
					<div class="components-card"></div>
				</div>
			</div>
		' . $this->get_skeleton_inline_script();
	}
}
woocommerce-blocks/src/BlockTypes/AttributeFilter.php000064400000001404151335517640017037 0ustar00<?php
namespace Automattic\WooCommerce\Blocks\BlockTypes;

/**
 * AttributeFilter class.
 */
class AttributeFilter extends AbstractBlock {
	/**
	 * Block name.
	 *
	 * @var string
	 */
	protected $block_name = 'attribute-filter';

	/**
	 * Extra data passed through from server to client for block.
	 *
	 * @param array $attributes  Any attributes that currently are available from the block.
	 *                           Note, this will be empty in the editor context when the block is
	 *                           not in the post content on editor load.
	 */
	protected function enqueue_data( array $attributes = [] ) {
		parent::enqueue_data( $attributes );
		$this->asset_data_registry->add( 'attributes', array_values( wc_get_attribute_taxonomies() ), true );
	}
}
woocommerce-blocks/src/BlockTypes/AbstractProductGrid.php000064400000036645151335517640017657 0ustar00<?php
namespace Automattic\WooCommerce\Blocks\BlockTypes;

use Automattic\WooCommerce\Blocks\Utils\BlocksWpQuery;
use Automattic\WooCommerce\Blocks\StoreApi\SchemaController;
use Automattic\WooCommerce\Blocks\Package;

/**
 * AbstractProductGrid class.
 */
abstract class AbstractProductGrid extends AbstractDynamicBlock {

	/**
	 * Attributes.
	 *
	 * @var array
	 */
	protected $attributes = array();

	/**
	 * InnerBlocks content.
	 *
	 * @var string
	 */
	protected $content = '';

	/**
	 * Query args.
	 *
	 * @var array
	 */
	protected $query_args = array();

	/**
	 * Get a set of attributes shared across most of the grid blocks.
	 *
	 * @return array List of block attributes with type and defaults.
	 */
	protected function get_block_type_attributes() {
		return array(
			'className'         => $this->get_schema_string(),
			'columns'           => $this->get_schema_number( wc_get_theme_support( 'product_blocks::default_columns', 3 ) ),
			'rows'              => $this->get_schema_number( wc_get_theme_support( 'product_blocks::default_rows', 3 ) ),
			'categories'        => $this->get_schema_list_ids(),
			'catOperator'       => array(
				'type'    => 'string',
				'default' => 'any',
			),
			'contentVisibility' => $this->get_schema_content_visibility(),
			'align'             => $this->get_schema_align(),
			'alignButtons'      => $this->get_schema_boolean( false ),
			'isPreview'         => $this->get_schema_boolean( false ),
		);
	}

	/**
	 * Include and render the dynamic block.
	 *
	 * @param array  $attributes Block attributes. Default empty array.
	 * @param string $content    Block content. Default empty string.
	 * @return string Rendered block type output.
	 */
	protected function render( $attributes = array(), $content = '' ) {
		$this->attributes = $this->parse_attributes( $attributes );
		$this->content    = $content;
		$this->query_args = $this->parse_query_args();
		$products         = array_filter( array_map( 'wc_get_product', $this->get_products() ) );

		if ( ! $products ) {
			return '';
		}

		/**
		 * Product List Render event.
		 *
		 * Fires a WP Hook named `experimental__woocommerce_blocks-product-list-render` on render so that the client
		 * can add event handling when certain products are displayed. This can be used by tracking extensions such
		 * as Google Analytics to track impressions.
		 *
		 * Provides the list of product data (shaped like the Store API responses) and the block name.
		 */
		$this->asset_api->add_inline_script(
			'wp-hooks',
			'
			window.addEventListener( "DOMContentLoaded", () => {
				wp.hooks.doAction(
					"experimental__woocommerce_blocks-product-list-render",
					{
						products: JSON.parse( decodeURIComponent( "' . esc_js(
				rawurlencode(
					wp_json_encode(
						array_map(
							[ Package::container()->get( SchemaController::class )->get( 'product' ), 'get_item_response' ],
							$products
						)
					)
				)
			) . '" ) ),
						listName: "' . esc_js( $this->block_name ) . '"
					}
				);
			} );
			',
			'after'
		);

		return sprintf(
			'<div class="%s"><ul class="wc-block-grid__products">%s</ul></div>',
			esc_attr( $this->get_container_classes() ),
			implode( '', array_map( array( $this, 'render_product' ), $products ) )
		);
	}

	/**
	 * Get the schema for the contentVisibility attribute
	 *
	 * @return array List of block attributes with type and defaults.
	 */
	protected function get_schema_content_visibility() {
		return array(
			'type'       => 'object',
			'properties' => array(
				'title'  => $this->get_schema_boolean( true ),
				'price'  => $this->get_schema_boolean( true ),
				'rating' => $this->get_schema_boolean( true ),
				'button' => $this->get_schema_boolean( true ),
			),
		);
	}

	/**
	 * Get the schema for the orderby attribute.
	 *
	 * @return array Property definition of `orderby` attribute.
	 */
	protected function get_schema_orderby() {
		return array(
			'type'    => 'string',
			'enum'    => array( 'date', 'popularity', 'price_asc', 'price_desc', 'rating', 'title', 'menu_order' ),
			'default' => 'date',
		);
	}

	/**
	 * Get the block's attributes.
	 *
	 * @param array $attributes Block attributes. Default empty array.
	 * @return array  Block attributes merged with defaults.
	 */
	protected function parse_attributes( $attributes ) {
		// These should match what's set in JS `registerBlockType`.
		$defaults = array(
			'columns'           => wc_get_theme_support( 'product_blocks::default_columns', 3 ),
			'rows'              => wc_get_theme_support( 'product_blocks::default_rows', 3 ),
			'alignButtons'      => false,
			'categories'        => array(),
			'catOperator'       => 'any',
			'contentVisibility' => array(
				'title'  => true,
				'price'  => true,
				'rating' => true,
				'button' => true,
			),
		);

		return wp_parse_args( $attributes, $defaults );
	}

	/**
	 * Parse query args.
	 *
	 * @return array
	 */
	protected function parse_query_args() {
		$query_args = array(
			'post_type'           => 'product',
			'post_status'         => 'publish',
			'fields'              => 'ids',
			'ignore_sticky_posts' => true,
			'no_found_rows'       => false,
			'orderby'             => '',
			'order'               => '',
			'meta_query'          => WC()->query->get_meta_query(), // phpcs:ignore WordPress.DB.SlowDBQuery
			'tax_query'           => array(), // phpcs:ignore WordPress.DB.SlowDBQuery
			'posts_per_page'      => $this->get_products_limit(),
		);

		$this->set_block_query_args( $query_args );
		$this->set_ordering_query_args( $query_args );
		$this->set_categories_query_args( $query_args );
		$this->set_visibility_query_args( $query_args );

		return $query_args;
	}

	/**
	 * Parse query args.
	 *
	 * @param array $query_args Query args.
	 */
	protected function set_ordering_query_args( &$query_args ) {
		if ( isset( $this->attributes['orderby'] ) ) {
			if ( 'price_desc' === $this->attributes['orderby'] ) {
				$query_args['orderby'] = 'price';
				$query_args['order']   = 'DESC';
			} elseif ( 'price_asc' === $this->attributes['orderby'] ) {
				$query_args['orderby'] = 'price';
				$query_args['order']   = 'ASC';
			} elseif ( 'date' === $this->attributes['orderby'] ) {
				$query_args['orderby'] = 'date';
				$query_args['order']   = 'DESC';
			} else {
				$query_args['orderby'] = $this->attributes['orderby'];
			}
		}

		$query_args = array_merge(
			$query_args,
			WC()->query->get_catalog_ordering_args( $query_args['orderby'], $query_args['order'] )
		);
	}

	/**
	 * Set args specific to this block
	 *
	 * @param array $query_args Query args.
	 */
	abstract protected function set_block_query_args( &$query_args );

	/**
	 * Set categories query args.
	 *
	 * @param array $query_args Query args.
	 */
	protected function set_categories_query_args( &$query_args ) {
		if ( ! empty( $this->attributes['categories'] ) ) {
			$categories = array_map( 'absint', $this->attributes['categories'] );

			$query_args['tax_query'][] = array(
				'taxonomy'         => 'product_cat',
				'terms'            => $categories,
				'field'            => 'term_id',
				'operator'         => 'all' === $this->attributes['catOperator'] ? 'AND' : 'IN',

				/*
				 * When cat_operator is AND, the children categories should be excluded,
				 * as only products belonging to all the children categories would be selected.
				 */
				'include_children' => 'all' === $this->attributes['catOperator'] ? false : true,
			);
		}
	}

	/**
	 * Set visibility query args.
	 *
	 * @param array $query_args Query args.
	 */
	protected function set_visibility_query_args( &$query_args ) {
		$product_visibility_terms  = wc_get_product_visibility_term_ids();
		$product_visibility_not_in = array( $product_visibility_terms['exclude-from-catalog'] );

		if ( 'yes' === get_option( 'woocommerce_hide_out_of_stock_items' ) ) {
			$product_visibility_not_in[] = $product_visibility_terms['outofstock'];
		}

		$query_args['tax_query'][] = array(
			'taxonomy' => 'product_visibility',
			'field'    => 'term_taxonomy_id',
			'terms'    => $product_visibility_not_in,
			'operator' => 'NOT IN',
		);
	}

	/**
	 * Works out the item limit based on rows and columns, or returns default.
	 *
	 * @return int
	 */
	protected function get_products_limit() {
		if ( isset( $this->attributes['rows'], $this->attributes['columns'] ) && ! empty( $this->attributes['rows'] ) ) {
			$this->attributes['limit'] = intval( $this->attributes['columns'] ) * intval( $this->attributes['rows'] );
		}
		return intval( $this->attributes['limit'] );
	}

	/**
	 * Run the query and return an array of product IDs
	 *
	 * @return array List of product IDs
	 */
	protected function get_products() {
		$is_cacheable      = (bool) apply_filters( 'woocommerce_blocks_product_grid_is_cacheable', true, $this->query_args );
		$transient_version = \WC_Cache_Helper::get_transient_version( 'product_query' );

		$query   = new BlocksWpQuery( $this->query_args );
		$results = wp_parse_id_list( $is_cacheable ? $query->get_cached_posts( $transient_version ) : $query->get_posts() );

		// Remove ordering query arguments which may have been added by get_catalog_ordering_args.
		WC()->query->remove_ordering_args();

		// Prime caches to reduce future queries.
		if ( is_callable( '_prime_post_caches' ) ) {
			_prime_post_caches( $results );
		}

		return $results;
	}

	/**
	 * Get the list of classes to apply to this block.
	 *
	 * @return string space-separated list of classes.
	 */
	protected function get_container_classes() {
		$classes = array(
			'wc-block-grid',
			"wp-block-{$this->block_name}",
			"wc-block-{$this->block_name}",
			"has-{$this->attributes['columns']}-columns",
		);

		if ( $this->attributes['rows'] > 1 ) {
			$classes[] = 'has-multiple-rows';
		}

		if ( isset( $this->attributes['align'] ) ) {
			$classes[] = "align{$this->attributes['align']}";
		}

		if ( ! empty( $this->attributes['alignButtons'] ) ) {
			$classes[] = 'has-aligned-buttons';
		}

		if ( ! empty( $this->attributes['className'] ) ) {
			$classes[] = $this->attributes['className'];
		}

		return implode( ' ', $classes );
	}

	/**
	 * Render a single products.
	 *
	 * @param \WC_Product $product Product object.
	 * @return string Rendered product output.
	 */
	protected function render_product( $product ) {
		$data = (object) array(
			'permalink' => esc_url( $product->get_permalink() ),
			'image'     => $this->get_image_html( $product ),
			'title'     => $this->get_title_html( $product ),
			'rating'    => $this->get_rating_html( $product ),
			'price'     => $this->get_price_html( $product ),
			'badge'     => $this->get_sale_badge_html( $product ),
			'button'    => $this->get_button_html( $product ),
		);

		return apply_filters(
			'woocommerce_blocks_product_grid_item_html',
			"<li class=\"wc-block-grid__product\">
				<a href=\"{$data->permalink}\" class=\"wc-block-grid__product-link\">
					{$data->image}
					{$data->title}
				</a>
				{$data->badge}
				{$data->price}
				{$data->rating}
				{$data->button}
			</li>",
			$data,
			$product
		);
	}

	/**
	 * Get the product image.
	 *
	 * @param \WC_Product $product Product.
	 * @return string
	 */
	protected function get_image_html( $product ) {
		return '<div class="wc-block-grid__product-image">' . $product->get_image( 'woocommerce_thumbnail' ) . '</div>'; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
	}

	/**
	 * Get the product title.
	 *
	 * @param \WC_Product $product Product.
	 * @return string
	 */
	protected function get_title_html( $product ) {
		if ( empty( $this->attributes['contentVisibility']['title'] ) ) {
			return '';
		}
		return '<div class="wc-block-grid__product-title">' . wp_kses_post( $product->get_title() ) . '</div>';
	}

	/**
	 * Render the rating icons.
	 *
	 * @param WC_Product $product Product.
	 * @return string Rendered product output.
	 */
	protected function get_rating_html( $product ) {
		if ( empty( $this->attributes['contentVisibility']['rating'] ) ) {
			return '';
		}
		$rating_count = $product->get_rating_count();
		$review_count = $product->get_review_count();
		$average      = $product->get_average_rating();

		if ( $rating_count > 0 ) {
			return sprintf(
				'<div class="wc-block-grid__product-rating">%s</div>',
				wc_get_rating_html( $average, $rating_count ) // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
			);
		}
		return '';
	}

	/**
	 * Get the price.
	 *
	 * @param \WC_Product $product Product.
	 * @return string Rendered product output.
	 */
	protected function get_price_html( $product ) {
		if ( empty( $this->attributes['contentVisibility']['price'] ) ) {
			return '';
		}
		return sprintf(
			'<div class="wc-block-grid__product-price price">%s</div>',
			wp_kses_post( $product->get_price_html() )
		);
	}

	/**
	 * Get the sale badge.
	 *
	 * @param \WC_Product $product Product.
	 * @return string Rendered product output.
	 */
	protected function get_sale_badge_html( $product ) {
		if ( empty( $this->attributes['contentVisibility']['price'] ) ) {
			return '';
		}

		if ( ! $product->is_on_sale() ) {
			return;
		}

		return '<div class="wc-block-grid__product-onsale">
			<span aria-hidden="true">' . esc_html__( 'Sale', 'woocommerce' ) . '</span>
			<span class="screen-reader-text">' . esc_html__( 'Product on sale', 'woocommerce' ) . '</span>
		</div>';
	}

	/**
	 * Get the button.
	 *
	 * @param \WC_Product $product Product.
	 * @return string Rendered product output.
	 */
	protected function get_button_html( $product ) {
		if ( empty( $this->attributes['contentVisibility']['button'] ) ) {
			return '';
		}
		return '<div class="wp-block-button wc-block-grid__product-add-to-cart">' . $this->get_add_to_cart( $product ) . '</div>';
	}

	/**
	 * Get the "add to cart" button.
	 *
	 * @param \WC_Product $product Product.
	 * @return string Rendered product output.
	 */
	protected function get_add_to_cart( $product ) {
		$attributes = array(
			'aria-label'       => $product->add_to_cart_description(),
			'data-quantity'    => '1',
			'data-product_id'  => $product->get_id(),
			'data-product_sku' => $product->get_sku(),
			'rel'              => 'nofollow',
			'class'            => 'wp-block-button__link add_to_cart_button',
		);

		if (
			$product->supports( 'ajax_add_to_cart' ) &&
			$product->is_purchasable() &&
			( $product->is_in_stock() || $product->backorders_allowed() )
		) {
			$attributes['class'] .= ' ajax_add_to_cart';
		}

		return sprintf(
			'<a href="%s" %s>%s</a>',
			esc_url( $product->add_to_cart_url() ),
			wc_implode_html_attributes( $attributes ),
			esc_html( $product->add_to_cart_text() )
		);
	}

	/**
	 * Extra data passed through from server to client for block.
	 *
	 * @param array $attributes  Any attributes that currently are available from the block.
	 *                           Note, this will be empty in the editor context when the block is
	 *                           not in the post content on editor load.
	 */
	protected function enqueue_data( array $attributes = [] ) {
		parent::enqueue_data( $attributes );
		$this->asset_data_registry->add( 'min_columns', wc_get_theme_support( 'product_blocks::min_columns', 1 ), true );
		$this->asset_data_registry->add( 'max_columns', wc_get_theme_support( 'product_blocks::max_columns', 6 ), true );
		$this->asset_data_registry->add( 'default_columns', wc_get_theme_support( 'product_blocks::default_columns', 3 ), true );
		$this->asset_data_registry->add( 'min_rows', wc_get_theme_support( 'product_blocks::min_rows', 1 ), true );
		$this->asset_data_registry->add( 'max_rows', wc_get_theme_support( 'product_blocks::max_rows', 6 ), true );
		$this->asset_data_registry->add( 'default_rows', wc_get_theme_support( 'product_blocks::default_rows', 3 ), true );
	}
}
woocommerce-blocks/src/BlockTypes/AtomicBlock.php000064400000003155151335517640016122 0ustar00<?php
namespace Automattic\WooCommerce\Blocks\BlockTypes;

/**
 * AtomicBlock class.
 *
 * @internal
 */
class AtomicBlock extends AbstractBlock {
	/**
	 * Inject attributes and block name.
	 *
	 * @param array  $attributes Block attributes.
	 * @param string $content    Block content.
	 * @return string Rendered block type output.
	 */
	protected function render( $attributes, $content ) {
		return $this->inject_html_data_attributes( $content, $attributes );
	}

	/**
	 * Get the editor script data for this block type.
	 *
	 * @param string $key Data to get, or default to everything.
	 * @return null
	 */
	protected function get_block_type_editor_script( $key = null ) {
		return null;
	}

	/**
	 * Get the editor style handle for this block type.
	 *
	 * @return null
	 */
	protected function get_block_type_editor_style() {
		return null;
	}

	/**
	 * Get the frontend script handle for this block type.
	 *
	 * @param string $key Data to get, or default to everything.
	 * @return null
	 */
	protected function get_block_type_script( $key = null ) {
		return null;
	}

	/**
	 * Get the frontend style handle for this block type.
	 *
	 * @return null
	 */
	protected function get_block_type_style() {
		return null;
	}

	/**
	 * Converts block attributes to HTML data attributes.
	 *
	 * @param array $attributes Key value pairs of attributes.
	 * @return string Rendered HTML attributes.
	 */
	protected function get_html_data_attributes( array $attributes ) {
		$data = parent::get_html_data_attributes( $attributes );
		return trim( $data . ' data-block-name="' . esc_attr( $this->namespace . '/' . $this->block_name ) . '"' );
	}
}
woocommerce-blocks/src/BlockTypes/Checkout.php000064400000027405151335517640015504 0ustar00<?php
namespace Automattic\WooCommerce\Blocks\BlockTypes;

/**
 * Checkout class.
 *
 * @internal
 */
class Checkout extends AbstractBlock {
	/**
	 * Block name.
	 *
	 * @var string
	 */
	protected $block_name = 'checkout';

	/**
	 * Get the editor script handle for this block type.
	 *
	 * @param string $key Data to get, or default to everything.
	 * @return array|string;
	 */
	protected function get_block_type_editor_script( $key = null ) {
		$script = [
			'handle'       => 'wc-' . $this->block_name . '-block',
			'path'         => $this->asset_api->get_block_asset_build_path( $this->block_name ),
			'dependencies' => [ 'wc-blocks' ],
		];
		return $key ? $script[ $key ] : $script;
	}

	/**
	 * Get the frontend script handle for this block type.
	 *
	 * @see $this->register_block_type()
	 * @param string $key Data to get, or default to everything.
	 * @return array|string
	 */
	protected function get_block_type_script( $key = null ) {
		$script = [
			'handle'       => 'wc-' . $this->block_name . '-block-frontend',
			'path'         => $this->asset_api->get_block_asset_build_path( $this->block_name . '-frontend' ),
			'dependencies' => [],
		];
		return $key ? $script[ $key ] : $script;
	}

	/**
	 * Enqueue frontend assets for this block, just in time for rendering.
	 *
	 * @param array $attributes  Any attributes that currently are available from the block.
	 */
	protected function enqueue_assets( array $attributes ) {
		do_action( 'woocommerce_blocks_enqueue_checkout_block_scripts_before' );
		parent::enqueue_assets( $attributes );
		do_action( 'woocommerce_blocks_enqueue_checkout_block_scripts_after' );
	}

	/**
	 * Append frontend scripts when rendering the block.
	 *
	 * @param array  $attributes Block attributes.
	 * @param string $content    Block content.
	 * @return string Rendered block type output.
	 */
	protected function render( $attributes, $content ) {
		if ( $this->is_checkout_endpoint() ) {
			// Note: Currently the block only takes care of the main checkout form -- if an endpoint is set, refer to the
			// legacy shortcode instead and do not render block.
			return '[woocommerce_checkout]';
		}

		// Deregister core checkout scripts and styles.
		wp_dequeue_script( 'wc-checkout' );
		wp_dequeue_script( 'wc-password-strength-meter' );
		wp_dequeue_script( 'selectWoo' );
		wp_dequeue_style( 'select2' );

		// If the content is empty, we may have transformed from an older checkout block. Insert the default list of blocks.
		$regex_for_empty_block = '/<div class="[a-zA-Z0-9_\- ]*wp-block-woocommerce-checkout[a-zA-Z0-9_\- ]*"><\/div>/mi';

		$is_empty = preg_match( $regex_for_empty_block, $content );

		if ( $is_empty ) {
			$inner_blocks_html = '<div data-block-name="woocommerce/checkout-fields-block" class="wp-block-woocommerce-checkout-fields-block"></div><div data-block-name="woocommerce/checkout-totals-block" class="wp-block-woocommerce-checkout-totals-block"></div>';

			$content = str_replace( '</div>', $inner_blocks_html . '</div>', $content );
		}

		return $this->inject_html_data_attributes( $content, $attributes );
	}

	/**
	 * Check if we're viewing a checkout page endpoint, rather than the main checkout page itself.
	 *
	 * @return boolean
	 */
	protected function is_checkout_endpoint() {
		return is_wc_endpoint_url( 'order-pay' ) || is_wc_endpoint_url( 'order-received' );
	}

	/**
	 * Extra data passed through from server to client for block.
	 *
	 * @param array $attributes  Any attributes that currently are available from the block.
	 *                           Note, this will be empty in the editor context when the block is
	 *                           not in the post content on editor load.
	 */
	protected function enqueue_data( array $attributes = [] ) {
		parent::enqueue_data( $attributes );

		$this->asset_data_registry->add(
			'allowedCountries',
			function() {
				return $this->deep_sort_with_accents( WC()->countries->get_allowed_countries() );
			},
			true
		);
		$this->asset_data_registry->add(
			'allowedStates',
			function() {
				return $this->deep_sort_with_accents( WC()->countries->get_allowed_country_states() );
			},
			true
		);
		$this->asset_data_registry->add(
			'shippingCountries',
			function() {
				return $this->deep_sort_with_accents( WC()->countries->get_shipping_countries() );
			},
			true
		);
		$this->asset_data_registry->add(
			'shippingStates',
			function() {
				return $this->deep_sort_with_accents( WC()->countries->get_shipping_country_states() );
			},
			true
		);
		$this->asset_data_registry->add(
			'countryLocale',
			function() {
				// Merge country and state data to work around https://github.com/woocommerce/woocommerce/issues/28944.
				$country_locale = wc()->countries->get_country_locale();
				$states         = wc()->countries->get_states();

				foreach ( $states as $country => $states ) {
					if ( empty( $states ) ) {
						$country_locale[ $country ]['state']['required'] = false;
						$country_locale[ $country ]['state']['hidden']   = true;
					}
				}
				return $country_locale;
			},
			true
		);
		$this->asset_data_registry->add( 'baseLocation', wc_get_base_location(), true );
		$this->asset_data_registry->add(
			'checkoutAllowsGuest',
			false === filter_var(
				WC()->checkout()->is_registration_required(),
				FILTER_VALIDATE_BOOLEAN
			),
			true
		);
		$this->asset_data_registry->add(
			'checkoutAllowsSignup',
			filter_var(
				WC()->checkout()->is_registration_enabled(),
				FILTER_VALIDATE_BOOLEAN
			),
			true
		);
		$this->asset_data_registry->add( 'checkoutShowLoginReminder', filter_var( get_option( 'woocommerce_enable_checkout_login_reminder' ), FILTER_VALIDATE_BOOLEAN ), true );
		$this->asset_data_registry->add( 'displayCartPricesIncludingTax', 'incl' === get_option( 'woocommerce_tax_display_cart' ), true );
		$this->asset_data_registry->add( 'displayItemizedTaxes', 'itemized' === get_option( 'woocommerce_tax_total_display' ), true );
		$this->asset_data_registry->add( 'taxesEnabled', wc_tax_enabled(), true );
		$this->asset_data_registry->add( 'couponsEnabled', wc_coupons_enabled(), true );
		$this->asset_data_registry->add( 'shippingEnabled', wc_shipping_enabled(), true );
		$this->asset_data_registry->add( 'hasDarkEditorStyleSupport', current_theme_supports( 'dark-editor-style' ), true );
		$this->asset_data_registry->register_page_id( isset( $attributes['cartPageId'] ) ? $attributes['cartPageId'] : 0 );

		$is_block_editor = $this->is_block_editor();

		// Hydrate the following data depending on admin or frontend context.
		if ( $is_block_editor && ! $this->asset_data_registry->exists( 'shippingMethodsExist' ) ) {
			$methods_exist = wc_get_shipping_method_count( false, true ) > 0;
			$this->asset_data_registry->add( 'shippingMethodsExist', $methods_exist );
		}

		if ( $is_block_editor && ! $this->asset_data_registry->exists( 'globalShippingMethods' ) ) {
			$shipping_methods           = WC()->shipping()->get_shipping_methods();
			$formatted_shipping_methods = array_reduce(
				$shipping_methods,
				function( $acc, $method ) {
					if ( $method->supports( 'settings' ) ) {
						$acc[] = [
							'id'          => $method->id,
							'title'       => $method->method_title,
							'description' => $method->method_description,
						];
					}
					return $acc;
				},
				[]
			);
			$this->asset_data_registry->add( 'globalShippingMethods', $formatted_shipping_methods );
		}

		if ( $is_block_editor && ! $this->asset_data_registry->exists( 'activeShippingZones' ) && class_exists( '\WC_Shipping_Zones' ) ) {
			$shipping_zones             = \WC_Shipping_Zones::get_zones();
			$formatted_shipping_zones   = array_reduce(
				$shipping_zones,
				function( $acc, $zone ) {
					$acc[] = [
						'id'          => $zone['id'],
						'title'       => $zone['zone_name'],
						'description' => $zone['formatted_zone_location'],
					];
					return $acc;
				},
				[]
			);
			$formatted_shipping_zones[] = [
				'id'          => 0,
				'title'       => __( 'International', 'woocommerce' ),
				'description' => __( 'Locations outside all other zones', 'woocommerce' ),
			];
			$this->asset_data_registry->add( 'activeShippingZones', $formatted_shipping_zones );
		}

		if ( $is_block_editor && ! $this->asset_data_registry->exists( 'globalPaymentMethods' ) ) {
			$payment_methods           = WC()->payment_gateways->payment_gateways();
			$formatted_payment_methods = array_reduce(
				$payment_methods,
				function( $acc, $method ) {
					if ( 'yes' === $method->enabled ) {
						$acc[] = [
							'id'          => $method->id,
							'title'       => $method->method_title,
							'description' => $method->method_description,
						];
					}
					return $acc;
				},
				[]
			);
			$this->asset_data_registry->add( 'globalPaymentMethods', $formatted_payment_methods );
		}

		if ( ! is_admin() && ! WC()->is_rest_api_request() ) {
			$this->hydrate_from_api();
			$this->hydrate_customer_payment_methods();
		}

		do_action( 'woocommerce_blocks_checkout_enqueue_data' );
	}

	/**
	 * Are we currently on the admin block editor screen?
	 */
	protected function is_block_editor() {
		if ( ! is_admin() || ! function_exists( 'get_current_screen' ) ) {
			return false;
		}
		$screen = get_current_screen();

		return $screen && $screen->is_block_editor();
	}

	/**
	 * Removes accents from an array of values, sorts by the values, then returns the original array values sorted.
	 *
	 * @param array $array Array of values to sort.
	 * @return array Sorted array.
	 */
	protected function deep_sort_with_accents( $array ) {
		if ( ! is_array( $array ) || empty( $array ) ) {
			return $array;
		}

		if ( is_array( reset( $array ) ) ) {
			return array_map( [ $this, 'deep_sort_with_accents' ], $array );
		}

		$array_without_accents = array_map( 'remove_accents', array_map( 'wc_strtolower', array_map( 'html_entity_decode', $array ) ) );
		asort( $array_without_accents );
		return array_replace( $array_without_accents, $array );
	}

	/**
	 * Get customer payment methods for use in checkout.
	 */
	protected function hydrate_customer_payment_methods() {
		if ( ! is_user_logged_in() || $this->asset_data_registry->exists( 'customerPaymentMethods' ) ) {
			return;
		}
		add_filter( 'woocommerce_payment_methods_list_item', [ $this, 'include_token_id_with_payment_methods' ], 10, 2 );
		$this->asset_data_registry->add(
			'customerPaymentMethods',
			wc_get_customer_saved_methods_list( get_current_user_id() )
		);
		remove_filter( 'woocommerce_payment_methods_list_item', [ $this, 'include_token_id_with_payment_methods' ], 10, 2 );
	}

	/**
	 * Hydrate the checkout block with data from the API.
	 */
	protected function hydrate_from_api() {
		// Print existing notices now, otherwise they are caught by the Cart
		// Controller and converted to exceptions.
		wc_print_notices();

		add_filter( 'woocommerce_store_api_disable_nonce_check', '__return_true' );
		$this->asset_data_registry->hydrate_api_request( '/wc/store/cart' );
		$this->asset_data_registry->hydrate_api_request( '/wc/store/checkout' );
		remove_filter( 'woocommerce_store_api_disable_nonce_check', '__return_true' );
	}

	/**
	 * Callback for woocommerce_payment_methods_list_item filter to add token id
	 * to the generated list.
	 *
	 * @param array     $list_item The current list item for the saved payment method.
	 * @param \WC_Token $token     The token for the current list item.
	 *
	 * @return array The list item with the token id added.
	 */
	public static function include_token_id_with_payment_methods( $list_item, $token ) {
		$list_item['tokenId'] = $token->get_id();
		$brand                = ! empty( $list_item['method']['brand'] ) ?
			strtolower( $list_item['method']['brand'] ) :
			'';
		// phpcs:ignore WordPress.WP.I18n.TextDomainMismatch -- need to match on translated value from core.
		if ( ! empty( $brand ) && esc_html__( 'Credit card', 'woocommerce' ) !== $brand ) {
			$list_item['method']['brand'] = wc_get_credit_card_type_label( $brand );
		}
		return $list_item;
	}
}
woocommerce-blocks/src/BlockTypes/AllReviews.php000064400000002461151335517640016007 0ustar00<?php
namespace Automattic\WooCommerce\Blocks\BlockTypes;

/**
 * AllReviews class.
 */
class AllReviews extends AbstractBlock {
	/**
	 * Block name.
	 *
	 * @var string
	 */
	protected $block_name = 'all-reviews';

	/**
	 * Get the frontend script handle for this block type.
	 *
	 * @see $this->register_block_type()
	 * @param string $key Data to get, or default to everything.
	 * @return array|string
	 */
	protected function get_block_type_script( $key = null ) {
		$script = [
			'handle'       => 'wc-reviews-block-frontend',
			'path'         => $this->asset_api->get_block_asset_build_path( 'reviews-frontend' ),
			'dependencies' => [],
		];
		return $key ? $script[ $key ] : $script;
	}

	/**
	 * Extra data passed through from server to client for block.
	 *
	 * @param array $attributes  Any attributes that currently are available from the block.
	 *                           Note, this will be empty in the editor context when the block is
	 *                           not in the post content on editor load.
	 */
	protected function enqueue_data( array $attributes = [] ) {
		parent::enqueue_data( $attributes );
		$this->asset_data_registry->add( 'reviewRatingsEnabled', wc_review_ratings_enabled(), true );
		$this->asset_data_registry->add( 'showAvatars', '1' === get_option( 'show_avatars' ), true );
	}
}
woocommerce-blocks/src/BlockTypes/AllProducts.php000064400000004121151335517640016161 0ustar00<?php
namespace Automattic\WooCommerce\Blocks\BlockTypes;

/**
 * AllProducts class.
 */
class AllProducts extends AbstractBlock {
	/**
	 * Block name.
	 *
	 * @var string
	 */
	protected $block_name = 'all-products';

	/**
	 * Extra data passed through from server to client for block.
	 *
	 * @param array $attributes  Any attributes that currently are available from the block.
	 *                           Note, this will be empty in the editor context when the block is
	 *                           not in the post content on editor load.
	 */
	protected function enqueue_data( array $attributes = [] ) {
		parent::enqueue_data( $attributes );
		$this->asset_data_registry->add( 'min_columns', wc_get_theme_support( 'product_blocks::min_columns', 1 ), true );
		$this->asset_data_registry->add( 'max_columns', wc_get_theme_support( 'product_blocks::max_columns', 6 ), true );
		$this->asset_data_registry->add( 'default_columns', wc_get_theme_support( 'product_blocks::default_columns', 3 ), true );
		$this->asset_data_registry->add( 'min_rows', wc_get_theme_support( 'product_blocks::min_rows', 1 ), true );
		$this->asset_data_registry->add( 'max_rows', wc_get_theme_support( 'product_blocks::max_rows', 6 ), true );
		$this->asset_data_registry->add( 'default_rows', wc_get_theme_support( 'product_blocks::default_rows', 3 ), true );
	}

	/**
	 * Register script and style assets for the block type before it is registered.
	 *
	 * This registers the scripts; it does not enqueue them.
	 */
	protected function register_block_type_assets() {
		parent::register_block_type_assets();
		$this->register_chunk_translations(
			[
				'atomic-block-components/price',
				'atomic-block-components/image',
				'atomic-block-components/title',
				'atomic-block-components/rating',
				'atomic-block-components/button',
				'atomic-block-components/summary',
				'atomic-block-components/sale-badge',
				'atomic-block-components/sku',
				'atomic-block-components/category-list',
				'atomic-block-components/tag-list',
				'atomic-block-components/stock-indicator',
				'atomic-block-components/add-to-cart',
			]
		);
	}
}
woocommerce-blocks/src/BlockTypes/ProductTag.php000064400000004244151335517640016007 0ustar00<?php
namespace Automattic\WooCommerce\Blocks\BlockTypes;

/**
 * ProductTag class.
 */
class ProductTag extends AbstractProductGrid {
	/**
	 * Block name.
	 *
	 * @var string
	 */
	protected $block_name = 'product-tag';

	/**
	 * Set args specific to this block.
	 *
	 * @param array $query_args Query args.
	 */
	protected function set_block_query_args( &$query_args ) {
		if ( ! empty( $this->attributes['tags'] ) ) {
			$query_args['tax_query'][] = array(
				'taxonomy' => 'product_tag',
				'terms'    => array_map( 'absint', $this->attributes['tags'] ),
				'field'    => 'id',
				'operator' => isset( $this->attributes['tagOperator'] ) && 'any' === $this->attributes['tagOperator'] ? 'IN' : 'AND',
			);
		}
	}

	/**
	 * Get block attributes.
	 *
	 * @return array
	 */
	protected function get_block_type_attributes() {
		return array(
			'className'         => $this->get_schema_string(),
			'columns'           => $this->get_schema_number( wc_get_theme_support( 'product_blocks::default_columns', 3 ) ),
			'rows'              => $this->get_schema_number( wc_get_theme_support( 'product_blocks::default_rows', 3 ) ),
			'contentVisibility' => $this->get_schema_content_visibility(),
			'align'             => $this->get_schema_align(),
			'alignButtons'      => $this->get_schema_boolean( false ),
			'orderby'           => $this->get_schema_orderby(),
			'tags'              => $this->get_schema_list_ids(),
			'tagOperator'       => array(
				'type'    => 'string',
				'default' => 'any',
			),
			'isPreview'         => $this->get_schema_boolean( false ),
		);
	}

	/**
	 * Extra data passed through from server to client for block.
	 *
	 * @param array $attributes  Any attributes that currently are available from the block.
	 *                           Note, this will be empty in the editor context when the block is
	 *                           not in the post content on editor load.
	 */
	protected function enqueue_data( array $attributes = [] ) {
		parent::enqueue_data( $attributes );

		$tag_count = wp_count_terms( 'product_tag' );

		$this->asset_data_registry->add( 'hasTags', $tag_count > 0, true );
		$this->asset_data_registry->add( 'limitTags', $tag_count > 100, true );
	}
}
woocommerce-blocks/src/BlockTypes/StockFilter.php000064400000001616151335517640016164 0ustar00<?php
namespace Automattic\WooCommerce\Blocks\BlockTypes;

/**
 * AttributeFilter class.
 */
class StockFilter extends AbstractBlock {
	/**
	 * Block name.
	 *
	 * @var string
	 */
	protected $block_name = 'stock-filter';

	/**
	 * Extra data passed through from server to client for block.
	 *
	 * @param array $stock_statuses  Any stock statuses that currently are available from the block.
	 *                           Note, this will be empty in the editor context when the block is
	 *                           not in the post content on editor load.
	 */
	protected function enqueue_data( array $stock_statuses = [] ) {
		parent::enqueue_data( $stock_statuses );
		$this->asset_data_registry->add( 'stockStatusOptions', wc_get_product_stock_status_options(), true );
		$this->asset_data_registry->add( 'hideOutOfStockItems', 'yes' === get_option( 'woocommerce_hide_out_of_stock_items' ), true );

	}
}
woocommerce-blocks/src/BlockTypes/HandpickedProducts.php000064400000003471151335517640017512 0ustar00<?php
namespace Automattic\WooCommerce\Blocks\BlockTypes;

/**
 * HandpickedProducts class.
 */
class HandpickedProducts extends AbstractProductGrid {
	/**
	 * Block name.
	 *
	 * @var string
	 */
	protected $block_name = 'handpicked-products';

	/**
	 * Set args specific to this block
	 *
	 * @param array $query_args Query args.
	 */
	protected function set_block_query_args( &$query_args ) {
		$ids = array_map( 'absint', $this->attributes['products'] );

		$query_args['post__in']       = $ids;
		$query_args['posts_per_page'] = count( $ids );
	}

	/**
	 * Set visibility query args. Handpicked products will show hidden products if chosen.
	 *
	 * @param array $query_args Query args.
	 */
	protected function set_visibility_query_args( &$query_args ) {
		if ( 'yes' === get_option( 'woocommerce_hide_out_of_stock_items' ) ) {
			$product_visibility_terms  = wc_get_product_visibility_term_ids();
			$query_args['tax_query'][] = array(
				'taxonomy' => 'product_visibility',
				'field'    => 'term_taxonomy_id',
				'terms'    => array( $product_visibility_terms['outofstock'] ),
				'operator' => 'NOT IN',
			);
		}
	}

	/**
	 * Get block attributes.
	 *
	 * @return array
	 */
	protected function get_block_type_attributes() {
		return array(
			'align'             => $this->get_schema_align(),
			'alignButtons'      => $this->get_schema_boolean( false ),
			'className'         => $this->get_schema_string(),
			'columns'           => $this->get_schema_number( wc_get_theme_support( 'product_blocks::default_columns', 3 ) ),
			'editMode'          => $this->get_schema_boolean( true ),
			'orderby'           => $this->get_schema_orderby(),
			'products'          => $this->get_schema_list_ids(),
			'contentVisibility' => $this->get_schema_content_visibility(),
			'isPreview'         => $this->get_schema_boolean( false ),
		);
	}
}
woocommerce-blocks/src/BlockTypes/ReviewsByProduct.php000064400000002504151335517640017210 0ustar00<?php
namespace Automattic\WooCommerce\Blocks\BlockTypes;

/**
 * ReviewsByProduct class.
 */
class ReviewsByProduct extends AbstractBlock {
	/**
	 * Block name.
	 *
	 * @var string
	 */
	protected $block_name = 'reviews-by-product';

	/**
	 * Get the frontend script handle for this block type.
	 *
	 * @see $this->register_block_type()
	 * @param string $key Data to get, or default to everything.
	 * @return array|string
	 */
	protected function get_block_type_script( $key = null ) {
		$script = [
			'handle'       => 'wc-reviews-block-frontend',
			'path'         => $this->asset_api->get_block_asset_build_path( 'reviews-frontend' ),
			'dependencies' => [],
		];
		return $key ? $script[ $key ] : $script;
	}

	/**
	 * Extra data passed through from server to client for block.
	 *
	 * @param array $attributes  Any attributes that currently are available from the block.
	 *                           Note, this will be empty in the editor context when the block is
	 *                           not in the post content on editor load.
	 */
	protected function enqueue_data( array $attributes = [] ) {
		parent::enqueue_data( $attributes );
		$this->asset_data_registry->add( 'reviewRatingsEnabled', wc_review_ratings_enabled(), true );
		$this->asset_data_registry->add( 'showAvatars', '1' === get_option( 'show_avatars' ), true );
	}
}
woocommerce-blocks/src/BlockTypes/AbstractBlock.php000064400000031620151335517640016447 0ustar00<?php
namespace Automattic\WooCommerce\Blocks\BlockTypes;

use WP_Block;
use Automattic\WooCommerce\Blocks\Package;
use Automattic\WooCommerce\Blocks\Assets\AssetDataRegistry;
use Automattic\WooCommerce\Blocks\Assets\Api as AssetApi;
use Automattic\WooCommerce\Blocks\Integrations\IntegrationRegistry;
use Automattic\WooCommerce\Blocks\RestApi;

/**
 * AbstractBlock class.
 */
abstract class AbstractBlock {

	/**
	 * Block namespace.
	 *
	 * @var string
	 */
	protected $namespace = 'woocommerce';

	/**
	 * Block name within this namespace.
	 *
	 * @var string
	 */
	protected $block_name = '';

	/**
	 * Tracks if assets have been enqueued.
	 *
	 * @var boolean
	 */
	protected $enqueued_assets = false;

	/**
	 * Instance of the asset API.
	 *
	 * @var AssetApi
	 */
	protected $asset_api;

	/**
	 * Instance of the asset data registry.
	 *
	 * @var AssetDataRegistry
	 */
	protected $asset_data_registry;

	/**
	 * Instance of the integration registry.
	 *
	 * @var IntegrationRegistry
	 */
	protected $integration_registry;

	/**
	 * Constructor.
	 *
	 * @param AssetApi            $asset_api Instance of the asset API.
	 * @param AssetDataRegistry   $asset_data_registry Instance of the asset data registry.
	 * @param IntegrationRegistry $integration_registry Instance of the integration registry.
	 * @param string              $block_name Optionally set block name during construct.
	 */
	public function __construct( AssetApi $asset_api, AssetDataRegistry $asset_data_registry, IntegrationRegistry $integration_registry, $block_name = '' ) {
		$this->asset_api            = $asset_api;
		$this->asset_data_registry  = $asset_data_registry;
		$this->integration_registry = $integration_registry;
		$this->block_name           = $block_name ? $block_name : $this->block_name;
		$this->initialize();
	}

	/**
	 * The default render_callback for all blocks. This will ensure assets are enqueued just in time, then render
	 * the block (if applicable).
	 *
	 * @param array|WP_Block $attributes Block attributes, or an instance of a WP_Block. Defaults to an empty array.
	 * @param string         $content    Block content. Default empty string.
	 * @return string Rendered block type output.
	 */
	public function render_callback( $attributes = [], $content = '' ) {
		$render_callback_attributes = $this->parse_render_callback_attributes( $attributes );
		if ( ! is_admin() ) {
			$this->enqueue_assets( $render_callback_attributes );
		}
		return $this->render( $render_callback_attributes, $content );
	}

	/**
	 * Enqueue assets used for rendering the block in editor context.
	 *
	 * This is needed if a block is not yet within the post content--`render` and `enqueue_assets` may not have ran.
	 */
	public function enqueue_editor_assets() {
		if ( $this->enqueued_assets ) {
			return;
		}
		$this->enqueue_data();
	}

	/**
	 * Initialize this block type.
	 *
	 * - Hook into WP lifecycle.
	 * - Register the block with WordPress.
	 */
	protected function initialize() {
		if ( empty( $this->block_name ) ) {
			_doing_it_wrong( __METHOD__, esc_html( __( 'Block name is required.', 'woocommerce' ) ), '4.5.0' );
			return false;
		}
		$this->integration_registry->initialize( $this->block_name . '_block' );
		$this->register_block_type_assets();
		$this->register_block_type();
		add_action( 'enqueue_block_editor_assets', [ $this, 'enqueue_editor_assets' ] );
	}

	/**
	 * Register script and style assets for the block type before it is registered.
	 *
	 * This registers the scripts; it does not enqueue them.
	 */
	protected function register_block_type_assets() {
		if ( null !== $this->get_block_type_editor_script() ) {
			$data     = $this->asset_api->get_script_data( $this->get_block_type_editor_script( 'path' ) );
			$has_i18n = in_array( 'wp-i18n', $data['dependencies'], true );

			$this->asset_api->register_script(
				$this->get_block_type_editor_script( 'handle' ),
				$this->get_block_type_editor_script( 'path' ),
				array_merge(
					$this->get_block_type_editor_script( 'dependencies' ),
					$this->integration_registry->get_all_registered_editor_script_handles()
				),
				$has_i18n
			);
		}
		if ( null !== $this->get_block_type_script() ) {
			$data     = $this->asset_api->get_script_data( $this->get_block_type_script( 'path' ) );
			$has_i18n = in_array( 'wp-i18n', $data['dependencies'], true );

			$this->asset_api->register_script(
				$this->get_block_type_script( 'handle' ),
				$this->get_block_type_script( 'path' ),
				array_merge(
					$this->get_block_type_script( 'dependencies' ),
					$this->integration_registry->get_all_registered_script_handles()
				),
				$has_i18n
			);
		}
	}

	/**
	 * Injects Chunk Translations into the page so translations work for lazy loaded components.
	 *
	 * The chunk names are defined when creating lazy loaded components using webpackChunkName.
	 *
	 * @param string[] $chunks Array of chunk names.
	 */
	protected function register_chunk_translations( $chunks ) {
		foreach ( $chunks as $chunk ) {
			$handle = 'wc-blocks-' . $chunk . '-chunk';
			$this->asset_api->register_script( $handle, $this->asset_api->get_block_asset_build_path( $chunk ), [], true );
			wp_add_inline_script(
				$this->get_block_type_script( 'handle' ),
				wp_scripts()->print_translations( $handle, false ),
				'before'
			);
			wp_deregister_script( $handle );
		}
	}

	/**
	 * Registers the block type with WordPress.
	 */
	protected function register_block_type() {
		register_block_type(
			$this->get_block_type(),
			array(
				'render_callback' => $this->get_block_type_render_callback(),
				'editor_script'   => $this->get_block_type_editor_script( 'handle' ),
				'editor_style'    => $this->get_block_type_editor_style(),
				'style'           => $this->get_block_type_style(),
				'attributes'      => $this->get_block_type_attributes(),
				'supports'        => $this->get_block_type_supports(),
			)
		);
	}

	/**
	 * Get the block type.
	 *
	 * @return string
	 */
	protected function get_block_type() {
		return $this->namespace . '/' . $this->block_name;
	}

	/**
	 * Get the render callback for this block type.
	 *
	 * Dynamic blocks should return a callback, for example, `return [ $this, 'render' ];`
	 *
	 * @see $this->register_block_type()
	 * @return callable|null;
	 */
	protected function get_block_type_render_callback() {
		return [ $this, 'render_callback' ];
	}

	/**
	 * Get the editor script data for this block type.
	 *
	 * @see $this->register_block_type()
	 * @param string $key Data to get, or default to everything.
	 * @return array|string
	 */
	protected function get_block_type_editor_script( $key = null ) {
		$script = [
			'handle'       => 'wc-' . $this->block_name . '-block',
			'path'         => $this->asset_api->get_block_asset_build_path( $this->block_name ),
			'dependencies' => [ 'wc-blocks' ],
		];
		return $key ? $script[ $key ] : $script;
	}

	/**
	 * Get the editor style handle for this block type.
	 *
	 * @see $this->register_block_type()
	 * @return string|null
	 */
	protected function get_block_type_editor_style() {
		return 'wc-blocks-editor-style';
	}

	/**
	 * Get the frontend script handle for this block type.
	 *
	 * @see $this->register_block_type()
	 * @param string $key Data to get, or default to everything.
	 * @return array|string
	 */
	protected function get_block_type_script( $key = null ) {
		$script = [
			'handle'       => 'wc-' . $this->block_name . '-block-frontend',
			'path'         => $this->asset_api->get_block_asset_build_path( $this->block_name . '-frontend' ),
			'dependencies' => [],
		];
		return $key ? $script[ $key ] : $script;
	}

	/**
	 * Get the frontend style handle for this block type.
	 *
	 * @see $this->register_block_type()
	 * @return string|null
	 */
	protected function get_block_type_style() {
		return 'wc-blocks-style';
	}

	/**
	 * Get the supports array for this block type.
	 *
	 * @see $this->register_block_type()
	 * @return string;
	 */
	protected function get_block_type_supports() {
		return [];
	}

	/**
	 * Get block attributes.
	 *
	 * @return array;
	 */
	protected function get_block_type_attributes() {
		return [];
	}

	/**
	 * Parses block attributes from the render_callback.
	 *
	 * @param array|WP_Block $attributes Block attributes, or an instance of a WP_Block. Defaults to an empty array.
	 * @return array
	 */
	protected function parse_render_callback_attributes( $attributes ) {
		return is_a( $attributes, 'WP_Block' ) ? $attributes->attributes : $attributes;
	}

	/**
	 * Render the block. Extended by children.
	 *
	 * @param array  $attributes Block attributes.
	 * @param string $content    Block content.
	 * @return string Rendered block type output.
	 */
	protected function render( $attributes, $content ) {
		return $content;
	}

	/**
	 * Enqueue frontend assets for this block, just in time for rendering.
	 *
	 * @internal This prevents the block script being enqueued on all pages. It is only enqueued as needed. Note that
	 * we intentionally do not pass 'script' to register_block_type.
	 *
	 * @param array $attributes  Any attributes that currently are available from the block.
	 */
	protected function enqueue_assets( array $attributes ) {
		if ( $this->enqueued_assets ) {
			return;
		}
		$this->enqueue_data( $attributes );
		$this->enqueue_scripts( $attributes );
		$this->enqueued_assets = true;
	}

	/**
	 * Injects block attributes into the block.
	 *
	 * @param string $content HTML content to inject into.
	 * @param array  $attributes Key value pairs of attributes.
	 * @return string Rendered block with data attributes.
	 */
	protected function inject_html_data_attributes( $content, array $attributes ) {
		return preg_replace( '/<div /', '<div ' . $this->get_html_data_attributes( $attributes ) . ' ', $content, 1 );
	}

	/**
	 * Converts block attributes to HTML data attributes.
	 *
	 * @param array $attributes Key value pairs of attributes.
	 * @return string Rendered HTML attributes.
	 */
	protected function get_html_data_attributes( array $attributes ) {
		$data = [];

		foreach ( $attributes as $key => $value ) {
			if ( is_bool( $value ) ) {
				$value = $value ? 'true' : 'false';
			}
			if ( ! is_scalar( $value ) ) {
				$value = wp_json_encode( $value );
			}
			$data[] = 'data-' . esc_attr( strtolower( preg_replace( '/(?<!\ )[A-Z]/', '-$0', $key ) ) ) . '="' . esc_attr( $value ) . '"';
		}

		return implode( ' ', $data );
	}

	/**
	 * Data passed through from server to client for block.
	 *
	 * @param array $attributes  Any attributes that currently are available from the block.
	 *                           Note, this will be empty in the editor context when the block is
	 *                           not in the post content on editor load.
	 */
	protected function enqueue_data( array $attributes = [] ) {
		$registered_script_data = $this->integration_registry->get_all_registered_script_data();

		foreach ( $registered_script_data as $asset_data_key => $asset_data_value ) {
			if ( ! $this->asset_data_registry->exists( $asset_data_key ) ) {
				$this->asset_data_registry->add( $asset_data_key, $asset_data_value );
			}
		}

		if ( ! $this->asset_data_registry->exists( 'wcBlocksConfig' ) ) {
			$this->asset_data_registry->add(
				'wcBlocksConfig',
				[
					'buildPhase'    => Package::feature()->get_flag(),
					'pluginUrl'     => plugins_url( '/', dirname( __DIR__ ) ),
					'productCount'  => array_sum( (array) wp_count_posts( 'product' ) ),
					'restApiRoutes' => [
						'/wc/store' => array_keys( Package::container()->get( RestApi::class )->get_routes_from_namespace( 'wc/store' ) ),
					],
					'defaultAvatar' => get_avatar_url( 0, [ 'force_default' => true ] ),

					/*
					 * translators: If your word count is based on single characters (e.g. East Asian characters),
					 * enter 'characters_excluding_spaces' or 'characters_including_spaces'. Otherwise, enter 'words'.
					 * Do not translate into your own language.
					 */
					'wordCountType' => _x( 'words', 'Word count type. Do not translate!', 'woocommerce' ),
				]
			);
		}
	}

	/**
	 * Register/enqueue scripts used for this block on the frontend, during render.
	 *
	 * @param array $attributes Any attributes that currently are available from the block.
	 */
	protected function enqueue_scripts( array $attributes = [] ) {
		if ( null !== $this->get_block_type_script() ) {
			wp_enqueue_script( $this->get_block_type_script( 'handle' ) );
		}
	}

	/**
	 * Script to append the correct sizing class to a block skeleton.
	 *
	 * @return string
	 */
	protected function get_skeleton_inline_script() {
		return "<script>
			var containers = document.querySelectorAll( 'div.wc-block-skeleton' );

			if ( containers.length ) {
				Array.prototype.forEach.call( containers, function( el, i ) {
					var w = el.offsetWidth;
					var classname = '';

					if ( w > 700 )
						classname = 'is-large';
					else if ( w > 520 )
						classname = 'is-medium';
					else if ( w > 400 )
						classname = 'is-small';
					else
						classname = 'is-mobile';

					if ( ! el.classList.contains( classname ) )  {
						el.classList.add( classname );
					}

					el.classList.remove( 'hidden' );
				} );
			}
		</script>";
	}
}
woocommerce-blocks/src/BlockTypes/ProductBestSellers.php000064400000000674151335517640017526 0ustar00<?php
namespace Automattic\WooCommerce\Blocks\BlockTypes;

/**
 * ProductBestSellers class.
 */
class ProductBestSellers extends AbstractProductGrid {

	/**
	 * Block name.
	 *
	 * @var string
	 */
	protected $block_name = 'product-best-sellers';

	/**
	 * Set args specific to this block
	 *
	 * @param array $query_args Query args.
	 */
	protected function set_block_query_args( &$query_args ) {
		$query_args['orderby'] = 'popularity';
	}
}
woocommerce-blocks/src/BlockTypes/ProductOnSale.php000064400000001371151335517640016453 0ustar00<?php
namespace Automattic\WooCommerce\Blocks\BlockTypes;

/**
 * ProductOnSale class.
 */
class ProductOnSale extends AbstractProductGrid {

	/**
	 * Block name.
	 *
	 * @var string
	 */
	protected $block_name = 'product-on-sale';

	/**
	 * Set args specific to this block
	 *
	 * @param array $query_args Query args.
	 */
	protected function set_block_query_args( &$query_args ) {
		$query_args['post__in'] = array_merge( array( 0 ), wc_get_product_ids_on_sale() );
	}
	/**
	 * Get block attributes.
	 *
	 * @return array
	 */
	protected function get_block_type_attributes() {
		return array_merge(
			parent::get_block_type_attributes(),
			array(
				'className' => $this->get_schema_string(),
				'orderby'   => $this->get_schema_orderby(),
			)
		);
	}
}
woocommerce-blocks/src/BlockTypes/ActiveFilters.php000064400000000342151335517640016472 0ustar00<?php
namespace Automattic\WooCommerce\Blocks\BlockTypes;

/**
 * ActiveFilters class.
 */
class ActiveFilters extends AbstractBlock {
	/**
	 * Block name.
	 *
	 * @var string
	 */
	protected $block_name = 'active-filters';
}
woocommerce-blocks/src/BlockTypes/FeaturedProduct.php000064400000013677151335517640017045 0ustar00<?php
namespace Automattic\WooCommerce\Blocks\BlockTypes;

/**
 * FeaturedProduct class.
 */
class FeaturedProduct extends AbstractDynamicBlock {
	/**
	 * Block name.
	 *
	 * @var string
	 */
	protected $block_name = 'featured-product';

	/**
	 * Default attribute values, should match what's set in JS `registerBlockType`.
	 *
	 * @var array
	 */
	protected $defaults = array(
		'align'        => 'none',
		'contentAlign' => 'center',
		'dimRatio'     => 50,
		'focalPoint'   => false,
		'height'       => false,
		'mediaId'      => 0,
		'mediaSrc'     => '',
		'showDesc'     => true,
		'showPrice'    => true,
	);

	/**
	 * Render the Featured Product block.
	 *
	 * @param array  $attributes Block attributes.
	 * @param string $content    Block content.
	 * @return string Rendered block type output.
	 */
	protected function render( $attributes, $content ) {
		$id      = absint( isset( $attributes['productId'] ) ? $attributes['productId'] : 0 );
		$product = wc_get_product( $id );
		if ( ! $product ) {
			return '';
		}
		$attributes = wp_parse_args( $attributes, $this->defaults );

		$attributes['height'] = $attributes['height'] ? $attributes['height'] : wc_get_theme_support( 'featured_block::default_height', 500 );

		$title = sprintf(
			'<h2 class="wc-block-featured-product__title">%s</h2>',
			wp_kses_post( $product->get_title() )
		);

		if ( $product->is_type( 'variation' ) ) {
			$title .= sprintf(
				'<h3 class="wc-block-featured-product__variation">%s</h3>',
				wp_kses_post( wc_get_formatted_variation( $product, true, true, false ) )
			);
		}

		$desc_str = sprintf(
			'<div class="wc-block-featured-product__description">%s</div>',
			wc_format_content( wp_kses_post( $product->get_short_description() ? $product->get_short_description() : wc_trim_string( $product->get_description(), 400 ) ) )
		);

		$price_str = sprintf(
			'<div class="wc-block-featured-product__price">%s</div>',
			wp_kses_post( $product->get_price_html() )
		);

		$output  = sprintf( '<div class="%1$s" style="%2$s">', esc_attr( $this->get_classes( $attributes ) ), esc_attr( $this->get_styles( $attributes, $product ) ) );
		$output .= '<div class="wc-block-featured-product__wrapper">';
		$output .= $title;
		if ( $attributes['showDesc'] ) {
			$output .= $desc_str;
		}
		if ( $attributes['showPrice'] ) {
			$output .= $price_str;
		}
		$output .= '<div class="wc-block-featured-product__link">' . $content . '</div>';
		$output .= '</div>';
		$output .= '</div>';

		return $output;
	}

	/**
	 * Get the styles for the wrapper element (background image, color).
	 *
	 * @param array       $attributes Block attributes. Default empty array.
	 * @param \WC_Product $product Product object.
	 * @return string
	 */
	public function get_styles( $attributes, $product ) {
		$style      = '';
		$image_size = 'large';
		if ( 'none' !== $attributes['align'] || $attributes['height'] > 800 ) {
			$image_size = 'full';
		}

		if ( $attributes['mediaId'] ) {
			$image = wp_get_attachment_image_url( $attributes['mediaId'], $image_size );
		} else {
			$image = $this->get_image( $product, $image_size );
		}

		if ( ! empty( $image ) ) {
			$style .= sprintf( 'background-image:url(%s);', esc_url( $image ) );
		}

		if ( isset( $attributes['customOverlayColor'] ) ) {
			$style .= sprintf( 'background-color:%s;', esc_attr( $attributes['customOverlayColor'] ) );
		}

		if ( isset( $attributes['height'] ) ) {
			$style .= sprintf( 'min-height:%dpx;', intval( $attributes['height'] ) );
		}

		if ( is_array( $attributes['focalPoint'] ) && 2 === count( $attributes['focalPoint'] ) ) {
			$style .= sprintf(
				'background-position: %s%% %s%%',
				$attributes['focalPoint']['x'] * 100,
				$attributes['focalPoint']['y'] * 100
			);
		}

		return $style;
	}

	/**
	 * Get class names for the block container.
	 *
	 * @param array $attributes Block attributes. Default empty array.
	 * @return string
	 */
	public function get_classes( $attributes ) {
		$classes = array( 'wc-block-' . $this->block_name );

		if ( isset( $attributes['align'] ) ) {
			$classes[] = "align{$attributes['align']}";
		}

		if ( isset( $attributes['dimRatio'] ) && ( 0 !== $attributes['dimRatio'] ) ) {
			$classes[] = 'has-background-dim';

			if ( 50 !== $attributes['dimRatio'] ) {
				$classes[] = 'has-background-dim-' . 10 * round( $attributes['dimRatio'] / 10 );
			}
		}

		if ( isset( $attributes['contentAlign'] ) && 'center' !== $attributes['contentAlign'] ) {
			$classes[] = "has-{$attributes['contentAlign']}-content";
		}

		if ( isset( $attributes['overlayColor'] ) ) {
			$classes[] = "has-{$attributes['overlayColor']}-background-color";
		}

		if ( isset( $attributes['className'] ) ) {
			$classes[] = $attributes['className'];
		}

		return implode( ' ', $classes );
	}

	/**
	 * Returns the main product image URL.
	 *
	 * @param \WC_Product $product Product object.
	 * @param string      $size    Image size, defaults to 'full'.
	 * @return string
	 */
	public function get_image( $product, $size = 'full' ) {
		$image = '';
		if ( $product->get_image_id() ) {
			$image = wp_get_attachment_image_url( $product->get_image_id(), $size );
		} elseif ( $product->get_parent_id() ) {
			$parent_product = wc_get_product( $product->get_parent_id() );
			if ( $parent_product ) {
				$image = wp_get_attachment_image_url( $parent_product->get_image_id(), $size );
			}
		}

		return $image;
	}

	/**
	 * Extra data passed through from server to client for block.
	 *
	 * @param array $attributes  Any attributes that currently are available from the block.
	 *                           Note, this will be empty in the editor context when the block is
	 *                           not in the post content on editor load.
	 */
	protected function enqueue_data( array $attributes = [] ) {
		parent::enqueue_data( $attributes );
		$this->asset_data_registry->add( 'min_height', wc_get_theme_support( 'featured_block::min_height', 500 ), true );
		$this->asset_data_registry->add( 'default_height', wc_get_theme_support( 'featured_block::default_height', 500 ), true );
	}
}
woocommerce-blocks/src/BlockTypes/ReviewsByCategory.php000064400000002507151335517640017350 0ustar00<?php
namespace Automattic\WooCommerce\Blocks\BlockTypes;

/**
 * ReviewsByCategory class.
 */
class ReviewsByCategory extends AbstractBlock {
	/**
	 * Block name.
	 *
	 * @var string
	 */
	protected $block_name = 'reviews-by-category';

	/**
	 * Get the frontend script handle for this block type.
	 *
	 * @see $this->register_block_type()
	 * @param string $key Data to get, or default to everything.
	 * @return array|string
	 */
	protected function get_block_type_script( $key = null ) {
		$script = [
			'handle'       => 'wc-reviews-block-frontend',
			'path'         => $this->asset_api->get_block_asset_build_path( 'reviews-frontend' ),
			'dependencies' => [],
		];
		return $key ? $script[ $key ] : $script;
	}

	/**
	 * Extra data passed through from server to client for block.
	 *
	 * @param array $attributes  Any attributes that currently are available from the block.
	 *                           Note, this will be empty in the editor context when the block is
	 *                           not in the post content on editor load.
	 */
	protected function enqueue_data( array $attributes = [] ) {
		parent::enqueue_data( $attributes );
		$this->asset_data_registry->add( 'reviewRatingsEnabled', wc_review_ratings_enabled(), true );
		$this->asset_data_registry->add( 'showAvatars', '1' === get_option( 'show_avatars' ), true );
	}
}
woocommerce-blocks/src/BlockTypes/ProductsByAttribute.php000064400000003756151335517640017724 0ustar00<?php
namespace Automattic\WooCommerce\Blocks\BlockTypes;

/**
 * ProductsByAttribute class.
 */
class ProductsByAttribute extends AbstractProductGrid {

	/**
	 * Block name.
	 *
	 * @var string
	 */
	protected $block_name = 'products-by-attribute';

	/**
	 * Set args specific to this block
	 *
	 * @param array $query_args Query args.
	 */
	protected function set_block_query_args( &$query_args ) {
		if ( ! empty( $this->attributes['attributes'] ) ) {
			$taxonomy = sanitize_title( $this->attributes['attributes'][0]['attr_slug'] );
			$terms    = wp_list_pluck( $this->attributes['attributes'], 'id' );

			$query_args['tax_query'][] = array(
				'taxonomy' => $taxonomy,
				'terms'    => array_map( 'absint', $terms ),
				'field'    => 'term_id',
				'operator' => 'all' === $this->attributes['attrOperator'] ? 'AND' : 'IN',
			);
		}
	}

	/**
	 * Get block attributes.
	 *
	 * @return array
	 */
	protected function get_block_type_attributes() {
		return array(
			'align'             => $this->get_schema_align(),
			'alignButtons'      => $this->get_schema_boolean( false ),
			'attributes'        => array(
				'type'    => 'array',
				'items'   => array(
					'type'       => 'object',
					'properties' => array(
						'id'        => array(
							'type' => 'number',
						),
						'attr_slug' => array(
							'type' => 'string',
						),
					),
				),
				'default' => array(),
			),
			'attrOperator'      => array(
				'type'    => 'string',
				'default' => 'any',
			),
			'className'         => $this->get_schema_string(),
			'columns'           => $this->get_schema_number( wc_get_theme_support( 'product_blocks::default_columns', 3 ) ),
			'contentVisibility' => $this->get_schema_content_visibility(),
			'editMode'          => $this->get_schema_boolean( true ),
			'orderby'           => $this->get_schema_orderby(),
			'rows'              => $this->get_schema_number( wc_get_theme_support( 'product_blocks::default_rows', 3 ) ),
			'isPreview'         => $this->get_schema_boolean( false ),
		);
	}
}
woocommerce-blocks/src/Utils/BlocksWpQuery.php000064400000004124151335517640015523 0ustar00<?php
namespace Automattic\WooCommerce\Blocks\Utils;

use WP_Query;

/**
 * BlocksWpQuery query.
 *
 * Wrapper for WP Query with additonal helper methods.
 * Allows query args to be set and parsed without doing running it, so that a cache can be used.
 *
 * @deprecated 2.5.0
 */
class BlocksWpQuery extends WP_Query {
	/**
	 * Constructor.
	 *
	 * Sets up the WordPress query, if parameter is not empty.
	 *
	 * Unlike the constructor in WP_Query, this does not RUN the query.
	 *
	 * @param string|array $query URL query string or array of vars.
	 */
	public function __construct( $query = '' ) {
		if ( ! empty( $query ) ) {
			$this->init();
			$this->query      = wp_parse_args( $query );
			$this->query_vars = $this->query;
			$this->parse_query_vars();
		}
	}

	/**
	 * Get cached posts, if a cache exists.
	 *
	 * A hash is generated using the array of query_vars. If doing custom queries via filters such as posts_where
	 * (where the SQL query is manipulated directly) you can still ensure there is a unique hash by injecting custom
	 * query vars via the parse_query filter. For example:
	 *
	 *      add_filter( 'parse_query', function( $wp_query ) {
	 *           $wp_query->query_vars['my_custom_query_var'] = true;
	 *      } );
	 *
	 * Doing so won't have any negative effect on the query itself, and it will cause the hash to change.
	 *
	 * @param string $transient_version Transient version to allow for invalidation.
	 * @return WP_Post[]|int[] Array of post objects or post IDs.
	 */
	public function get_cached_posts( $transient_version = '' ) {
		$hash            = md5( wp_json_encode( $this->query_vars ) );
		$transient_name  = 'wc_blocks_query_' . $hash;
		$transient_value = get_transient( $transient_name );

		if ( isset( $transient_value, $transient_value['version'], $transient_value['value'] ) && $transient_value['version'] === $transient_version ) {
			return $transient_value['value'];
		}

		$results = $this->get_posts();

		set_transient(
			$transient_name,
			array(
				'version' => $transient_version,
				'value'   => $results,
			),
			DAY_IN_SECONDS * 30
		);

		return $results;
	}
}
woocommerce-blocks/src/Utils/ArrayUtils.php000064400000002024151335517640015045 0ustar00<?php
namespace Automattic\WooCommerce\Blocks\Utils;

/**
 * ArrayUtils class used for custom functions to operate on arrays
 */
class ArrayUtils {
	/**
	 * Join a string with a natural language conjunction at the end.
	 *
	 * @param array $array  The array to join together with the natural language conjunction.
	 * @param bool  $enclose_items_with_quotes Whether each item in the array should be enclosed within quotation marks.
	 *
	 * @return string a string containing a list of items and a natural language conjuction.
	 */
	public static function natural_language_join( $array, $enclose_items_with_quotes = false ) {
		if ( true === $enclose_items_with_quotes ) {
			$array = array_map(
				function( $item ) {
					return '"' . $item . '"';
				},
				$array
			);
		}
		$last = array_pop( $array );
		if ( $array ) {
			return sprintf(
				/* translators: 1: The first n-1 items of a list 2: the last item in the list. */
				__( '%1$s and %2$s', 'woocommerce' ),
				implode( ', ', $array ),
				$last
			);
		}
		return $last;
	}
}
woocommerce-blocks/src/Package.php000064400000006054151335517640013210 0ustar00<?php
namespace Automattic\WooCommerce\Blocks;

use Automattic\WooCommerce\Blocks\Domain\Package as NewPackage;
use Automattic\WooCommerce\Blocks\Domain\Bootstrap;
use Automattic\WooCommerce\Blocks\Registry\Container;
use Automattic\WooCommerce\Blocks\Domain\Services\FeatureGating;

/**
 * Main package class.
 *
 * Returns information about the package and handles init.
 *
 * In the context of this plugin, it handles init and is called from the main
 * plugin file (woocommerce-gutenberg-products-block.php).
 *
 * In the context of WooCommere core, it handles init and is called from
 * WooCommerce's package loader. The main plugin file is _not_ loaded.
 *
 * @since 2.5.0
 */
class Package {

	/**
	 * For back compat this is provided. Ideally, you should register your
	 * class with Automattic\Woocommerce\Blocks\Container and make Package a
	 * dependency.
	 *
	 * @since 2.5.0
	 * @return Package  The Package instance class
	 */
	protected static function get_package() {
		return self::container()->get( NewPackage::class );
	}

	/**
	 * Init the package - load the blocks library and define constants.
	 *
	 * @since 2.5.0 Handled by new NewPackage.
	 */
	public static function init() {
		self::container()->get( Bootstrap::class );
	}

	/**
	 * Return the version of the package.
	 *
	 * @return string
	 */
	public static function get_version() {
		return self::get_package()->get_version();
	}

	/**
	 * Return the path to the package.
	 *
	 * @return string
	 */
	public static function get_path() {
		return self::get_package()->get_path();
	}

	/**
	 * Returns an instance of the the FeatureGating class.
	 *
	 * @return FeatureGating
	 */
	public static function feature() {
		return self::get_package()->feature();
	}

	/**
	 * Checks if we're executing the code in an experimental build mode.
	 *
	 * @return boolean
	 */
	public static function is_experimental_build() {
		return self::get_package()->is_experimental_build();
	}

	/**
	 * Checks if we're executing the code in an feature plugin or experimental build mode.
	 *
	 * @return boolean
	 */
	public static function is_feature_plugin_build() {
		return self::get_package()->is_feature_plugin_build();
	}

	/**
	 * Loads the dependency injection container for woocommerce blocks.
	 *
	 * @param boolean $reset Used to reset the container to a fresh instance.
	 *                       Note: this means all dependencies will be
	 *                       reconstructed.
	 */
	public static function container( $reset = false ) {
		static $container;
		if (
				! $container instanceof Container
				|| $reset
			) {
			$container = new Container();
			// register Package.
			$container->register(
				NewPackage::class,
				function ( $container ) {
					// leave for automated version bumping.
					$version = '6.1.0';
					return new NewPackage(
						$version,
						dirname( __DIR__ ),
						new FeatureGating()
					);
				}
			);
			// register Bootstrap.
			$container->register(
				Bootstrap::class,
				function ( $container ) {
					return new Bootstrap(
						$container
					);
				}
			);
		}
		return $container;
	}
}
woocommerce-blocks/src/Domain/Bootstrap.php000064400000024215151335517640015040 0ustar00<?php
namespace Automattic\WooCommerce\Blocks\Domain;

use Automattic\WooCommerce\Blocks\AssetsController as AssetsController;
use Automattic\WooCommerce\Blocks\Assets\Api as AssetApi;
use Automattic\WooCommerce\Blocks\Assets\AssetDataRegistry;
use Automattic\WooCommerce\Blocks\BlockTypesController;
use Automattic\WooCommerce\Blocks\InboxNotifications;
use Automattic\WooCommerce\Blocks\Installer;
use Automattic\WooCommerce\Blocks\Registry\Container;
use Automattic\WooCommerce\Blocks\RestApi;
use Automattic\WooCommerce\Blocks\Payments\Api as PaymentsApi;
use Automattic\WooCommerce\Blocks\Payments\PaymentMethodRegistry;
use Automattic\WooCommerce\Blocks\Payments\Integrations\Stripe;
use Automattic\WooCommerce\Blocks\Payments\Integrations\Cheque;
use Automattic\WooCommerce\Blocks\Payments\Integrations\PayPal;
use Automattic\WooCommerce\Blocks\Payments\Integrations\BankTransfer;
use Automattic\WooCommerce\Blocks\Payments\Integrations\CashOnDelivery;
use Automattic\WooCommerce\Blocks\Domain\Services\FeatureGating;
use Automattic\WooCommerce\Blocks\Domain\Services\DraftOrders;
use Automattic\WooCommerce\Blocks\Domain\Services\CreateAccount;
use Automattic\WooCommerce\Blocks\Domain\Services\ExtendRestApi;
use Automattic\WooCommerce\Blocks\Domain\Services\Email\CustomerNewAccount;
use Automattic\WooCommerce\Blocks\StoreApi\Formatters;
use Automattic\WooCommerce\Blocks\StoreApi\Formatters\MoneyFormatter;
use Automattic\WooCommerce\Blocks\StoreApi\Formatters\HtmlFormatter;
use Automattic\WooCommerce\Blocks\StoreApi\Formatters\CurrencyFormatter;
use Automattic\WooCommerce\Blocks\StoreApi\RoutesController;
use Automattic\WooCommerce\Blocks\StoreApi\SchemaController;
use Automattic\WooCommerce\Blocks\Domain\Services\GoogleAnalytics;

/**
 * Takes care of bootstrapping the plugin.
 *
 * @since 2.5.0
 */
class Bootstrap {

	/**
	 * Holds the Dependency Injection Container
	 *
	 * @var Container
	 */
	private $container;

	/**
	 * Holds the Package instance
	 *
	 * @var Package
	 */
	private $package;

	/**
	 * Constructor
	 *
	 * @param Container $container  The Dependency Injection Container.
	 */
	public function __construct( Container $container ) {
		$this->container = $container;
		$this->package   = $container->get( Package::class );
		if ( $this->has_core_dependencies() ) {
			$this->init();
			/**
			 * Usable as a safe event hook for when the plugin has been loaded.
			 */
			do_action( 'woocommerce_blocks_loaded' );
		}
	}

	/**
	 * Init the package - load the blocks library and define constants.
	 */
	protected function init() {
		$this->register_dependencies();
		$this->register_payment_methods();

		add_action(
			'admin_init',
			function() {
				InboxNotifications::create_surface_cart_checkout_blocks_notification();
			},
			10,
			0
		);

		$is_rest = wc()->is_rest_api_request();

		// Load assets in admin and on the frontend.
		if ( ! $is_rest ) {
			$this->add_build_notice();
			$this->container->get( AssetDataRegistry::class );
			$this->container->get( Installer::class );
			$this->container->get( AssetsController::class );
		}
		$this->container->get( DraftOrders::class )->init();
		$this->container->get( CreateAccount::class )->init();
		$this->container->get( ExtendRestApi::class );
		$this->container->get( RestApi::class );
		$this->container->get( GoogleAnalytics::class );
		$this->container->get( BlockTypesController::class );
		if ( $this->package->feature()->is_feature_plugin_build() ) {
			$this->container->get( PaymentsApi::class );
		}
	}

	/**
	 * Check core dependencies exist.
	 *
	 * @return boolean
	 */
	protected function has_core_dependencies() {
		$has_needed_dependencies = class_exists( 'WooCommerce', false );
		if ( $has_needed_dependencies ) {
			$plugin_data = \get_file_data(
				$this->package->get_path( 'woocommerce-gutenberg-products-block.php' ),
				[
					'RequiredWCVersion' => 'WC requires at least',
				]
			);
			if ( isset( $plugin_data['RequiredWCVersion'] ) && version_compare( \WC()->version, $plugin_data['RequiredWCVersion'], '<' ) ) {
				$has_needed_dependencies = false;
				add_action(
					'admin_notices',
					function() {
						if ( should_display_compatibility_notices() ) {
							?>
							<div class="notice notice-error">
								<p><?php esc_html_e( 'The WooCommerce Blocks feature plugin requires a more recent version of WooCommerce and has been paused. Please update WooCommerce to the latest version to continue enjoying WooCommerce Blocks.', 'woocommerce' ); ?></p>
							</div>
							<?php
						}
					}
				);
			}
		}
		return $has_needed_dependencies;
	}

	/**
	 * See if files have been built or not.
	 *
	 * @return bool
	 */
	protected function is_built() {
		return file_exists(
			$this->package->get_path( 'build/featured-product.js' )
		);
	}

	/**
	 * Add a notice stating that the build has not been done yet.
	 */
	protected function add_build_notice() {
		if ( $this->is_built() ) {
			return;
		}
		add_action(
			'admin_notices',
			function() {
				echo '<div class="error"><p>';
				printf(
					/* translators: %1$s is the install command, %2$s is the build command, %3$s is the watch command. */
					esc_html__( 'WooCommerce Blocks development mode requires files to be built. From the plugin directory, run %1$s to install dependencies, %2$s to build the files or %3$s to build the files and watch for changes.', 'woocommerce' ),
					'<code>npm install</code>',
					'<code>npm run build</code>',
					'<code>npm start</code>'
				);
				echo '</p></div>';
			}
		);
	}

	/**
	 * Register core dependencies with the container.
	 */
	protected function register_dependencies() {
		$this->container->register(
			FeatureGating::class,
			function ( Container $container ) {
				return new FeatureGating();
			}
		);
		$this->container->register(
			AssetApi::class,
			function ( Container $container ) {
				return new AssetApi( $container->get( Package::class ) );
			}
		);
		$this->container->register(
			AssetDataRegistry::class,
			function( Container $container ) {
				return new AssetDataRegistry( $container->get( AssetApi::class ) );
			}
		);
		$this->container->register(
			AssetsController::class,
			function( Container $container ) {
				return new AssetsController( $container->get( AssetApi::class ) );
			}
		);
		$this->container->register(
			PaymentMethodRegistry::class,
			function( Container $container ) {
				return new PaymentMethodRegistry();
			}
		);
		$this->container->register(
			RestApi::class,
			function ( Container $container ) {
				return new RestApi( $container->get( RoutesController::class ) );
			}
		);
		$this->container->register(
			Installer::class,
			function ( Container $container ) {
				return new Installer();
			}
		);
		$this->container->register(
			BlockTypesController::class,
			function ( Container $container ) {
				$asset_api           = $container->get( AssetApi::class );
				$asset_data_registry = $container->get( AssetDataRegistry::class );
				return new BlockTypesController( $asset_api, $asset_data_registry );
			}
		);
		$this->container->register(
			DraftOrders::class,
			function( Container $container ) {
				return new DraftOrders( $container->get( Package::class ) );
			}
		);
		$this->container->register(
			CreateAccount::class,
			function( Container $container ) {
				return new CreateAccount( $container->get( Package::class ) );
			}
		);
		$this->container->register(
			Formatters::class,
			function( Container $container ) {
				$formatters = new Formatters();
				$formatters->register( 'money', MoneyFormatter::class );
				$formatters->register( 'html', HtmlFormatter::class );
				$formatters->register( 'currency', CurrencyFormatter::class );
				return $formatters;
			}
		);
		$this->container->register(
			SchemaController::class,
			function( Container $container ) {
				return new SchemaController( $container->get( ExtendRestApi::class ) );
			}
		);
		$this->container->register(
			RoutesController::class,
			function( Container $container ) {
				return new RoutesController( $container->get( SchemaController::class ) );
			}
		);
		$this->container->register(
			ExtendRestApi::class,
			function( Container $container ) {
				return new ExtendRestApi( $container->get( Package::class ), $container->get( Formatters::class ) );
			}
		);
		$this->container->register(
			GoogleAnalytics::class,
			function( Container $container ) {
				// Require Google Analytics Integration to be activated.
				if ( ! class_exists( 'WC_Google_Analytics_Integration', false ) ) {
					return;
				}
				$asset_api = $container->get( AssetApi::class );
				return new GoogleAnalytics( $asset_api );
			}
		);
		if ( $this->package->feature()->is_feature_plugin_build() ) {
			$this->container->register(
				PaymentsApi::class,
				function ( Container $container ) {
					$payment_method_registry = $container->get( PaymentMethodRegistry::class );
					$asset_data_registry     = $container->get( AssetDataRegistry::class );
					return new PaymentsApi( $payment_method_registry, $asset_data_registry );
				}
			);
		}
	}

	/**
	 * Register payment method integrations with the container.
	 *
	 * @internal Stripe is a temporary method that is used for setting up payment method integrations with Cart and
	 *           Checkout blocks. This logic should get moved to the payment gateway extensions.
	 */
	protected function register_payment_methods() {
		$this->container->register(
			Stripe::class,
			function( Container $container ) {
				$asset_api = $container->get( AssetApi::class );
				return new Stripe( $asset_api );
			}
		);
		$this->container->register(
			Cheque::class,
			function( Container $container ) {
				$asset_api = $container->get( AssetApi::class );
				return new Cheque( $asset_api );
			}
		);
		$this->container->register(
			PayPal::class,
			function( Container $container ) {
				$asset_api = $container->get( AssetApi::class );
				return new PayPal( $asset_api );
			}
		);
		$this->container->register(
			BankTransfer::class,
			function( Container $container ) {
				$asset_api = $container->get( AssetApi::class );
				return new BankTransfer( $asset_api );
			}
		);
		$this->container->register(
			CashOnDelivery::class,
			function( Container $container ) {
				$asset_api = $container->get( AssetApi::class );
				return new CashOnDelivery( $asset_api );
			}
		);
	}
}
woocommerce-blocks/src/Domain/Package.php000064400000004746151335517640014425 0ustar00<?php
namespace Automattic\WooCommerce\Blocks\Domain;

use Automattic\WooCommerce\Blocks\Package as NewPackage;
use Automattic\WooCommerce\Blocks\Domain\Services\FeatureGating;

/**
 * Main package class.
 *
 * Returns information about the package and handles init.
 *
 * @since 2.5.0
 */
class Package {

	/**
	 * Holds the current version of the blocks plugin.
	 *
	 * @var string
	 */
	private $version;

	/**
	 * Holds the main path to the blocks plugin directory.
	 *
	 * @var string
	 */
	private $path;

	/**
	 * Holds the feature gating class instance.
	 *
	 * @var FeatureGating
	 */
	private $feature_gating;

	/**
	 * Constructor
	 *
	 * @param string        $version        Version of the plugin.
	 * @param string        $plugin_path    Path to the main plugin file.
	 * @param FeatureGating $feature_gating Feature gating class instance.
	 */
	public function __construct( $version, $plugin_path, FeatureGating $feature_gating ) {
		$this->version        = $version;
		$this->path           = $plugin_path;
		$this->feature_gating = $feature_gating;
	}

	/**
	 * Returns the version of the plugin.
	 *
	 * @return string
	 */
	public function get_version() {
		return $this->version;
	}

	/**
	 * Returns the path to the plugin directory.
	 *
	 * @param string $relative_path  If provided, the relative path will be
	 *                               appended to the plugin path.
	 *
	 * @return string
	 */
	public function get_path( $relative_path = '' ) {
		return trailingslashit( $this->path ) . $relative_path;
	}

	/**
	 * Returns the url to the blocks plugin directory.
	 *
	 * @param string $relative_url If provided, the relative url will be
	 *                             appended to the plugin url.
	 *
	 * @return string
	 */
	public function get_url( $relative_url = '' ) {
		// Append index.php so WP does not return the parent directory.
		return plugin_dir_url( $this->path . '/index.php' ) . $relative_url;
	}

	/**
	 * Returns an instance of the the FeatureGating class.
	 *
	 * @return FeatureGating
	 */
	public function feature() {
		return $this->feature_gating;
	}

	/**
	 * Checks if we're executing the code in an experimental build mode.
	 *
	 * @return boolean
	 */
	public function is_experimental_build() {
		return $this->feature()->is_experimental_build();
	}

	/**
	 * Checks if we're executing the code in an feature plugin or experimental build mode.
	 *
	 * @return boolean
	 */
	public function is_feature_plugin_build() {
		return $this->feature()->is_feature_plugin_build();
	}
}
woocommerce-blocks/src/Domain/Services/CreateAccount.php000064400000020776151335517640017376 0ustar00<?php
namespace Automattic\WooCommerce\Blocks\Domain\Services;

use \WP_REST_Request;
use \WC_Order;
use Automattic\WooCommerce\Blocks\Domain\Package;
use Automattic\WooCommerce\Blocks\Domain\Services\Email\CustomerNewAccount;

/**
 * Service class implementing new create account behaviour for order processing.
 */
class CreateAccount {
	/**
	 * Reference to the Package instance
	 *
	 * @var Package
	 */
	private $package;

	/**
	 * Constructor.
	 *
	 * @param Package $package An instance of (Woo Blocks) Package.
	 */
	public function __construct( Package $package ) {
		$this->package = $package;
	}

	/**
	 * Single method for feature gating logic. Used to gate all non-private methods.
	 *
	 * @return True if Checkout sign-up feature should be made available.
	 */
	private function is_feature_enabled() {
		// Checkout signup is feature gated to WooCommerce 4.7 and newer;
		// uses updated my-account/lost-password screen from 4.7+ for
		// setting initial password.
		// This service is feature gated to plugin only, to match the
		// availability of the Checkout block (feature plugin only).
		return $this->package->feature()->is_feature_plugin_build() && defined( 'WC_VERSION' ) && version_compare( WC_VERSION, '4.7', '>=' );
	}

	/**
	 * Init - register handlers for WooCommerce core email hooks.
	 */
	public function init() {
		if ( ! self::is_feature_enabled() ) {
			return;
		}

		// Override core email handlers to add our new improved "new account" email.
		add_action(
			'woocommerce_email',
			function ( $wc_emails_instance ) {
				// Remove core "new account" handler; we are going to replace it.
				remove_action( 'woocommerce_created_customer_notification', array( $wc_emails_instance, 'customer_new_account' ), 10, 3 );

				// Add custom "new account" handler.
				add_action(
					'woocommerce_created_customer_notification',
					function( $customer_id, $new_customer_data = array(), $password_generated = false ) use ( $wc_emails_instance ) {
						// If this is a block-based signup, send a new email
						// with password reset link (no password in email).
						if ( isset( $new_customer_data['is_checkout_block_customer_signup'] ) ) {
							$this->customer_new_account( $customer_id, $new_customer_data );
							return;
						}

						// Otherwise, trigger the existing legacy email (with new password inline).
						$wc_emails_instance->customer_new_account( $customer_id, $new_customer_data, $password_generated );
					},
					10,
					3
				);
			}
		);
	}

	/**
	 * Trigger new account email.
	 * This is intended as a replacement to WC_Emails::customer_new_account(),
	 * with a set password link instead of emailing the new password in email
	 * content.
	 *
	 * @param int   $customer_id       The ID of the new customer account.
	 * @param array $new_customer_data Assoc array of data for the new account.
	 */
	public function customer_new_account( $customer_id = 0, array $new_customer_data = array() ) {
		if ( ! self::is_feature_enabled() ) {
			return;
		}

		if ( ! $customer_id ) {
			return;
		}

		$new_account_email = new CustomerNewAccount( $this->package );
		$new_account_email->trigger( $customer_id, $new_customer_data );
	}

	/**
	 * Create a user account for specified request (if necessary).
	 * If a new account is created:
	 * - The user is logged in.
	 *
	 * @param \WP_REST_Request $request The current request object being handled.
	 *
	 * @throws Exception On error.
	 * @return int The new user id, or 0 if no user was created.
	 */
	public function from_order_request( \WP_REST_Request $request ) {
		if ( ! self::is_feature_enabled() || ! $this->should_create_customer_account( $request ) ) {
			return 0;
		}

		$customer_id = $this->create_customer_account(
			$request['billing_address']['email'],
			$request['billing_address']['first_name'],
			$request['billing_address']['last_name']
		);
		// Log the customer in and associate with the order.
		wc_set_customer_auth_cookie( $customer_id );

		return $customer_id;
	}

	/**
	 * Check request options and store (shop) config to determine if a user account
	 * should be created as part of order processing.
	 *
	 * @param \WP_REST_Request $request The current request object being handled.
	 *
	 * @return boolean True if a new user account should be created.
	 */
	protected function should_create_customer_account( \WP_REST_Request $request ) {
		if ( is_user_logged_in() ) {
			// User is already logged in - no need to create an account.
			return false;
		}

		// From here we know that the shopper is not logged in.
		// check for whether account creation is enabled at the global level.
		$checkout = WC()->checkout();
		if ( ! $checkout instanceof \WC_Checkout ) {
			// If checkout class is not available, we have major problems, don't create account.
			return false;
		}

		if ( false === filter_var( $checkout->is_registration_enabled(), FILTER_VALIDATE_BOOLEAN ) ) {
			// Registration is not enabled for the store, so return false.
			return false;
		}

		if ( true === filter_var( $checkout->is_registration_required(), FILTER_VALIDATE_BOOLEAN ) ) {
			// Store requires an account for all checkouts (purchases).
			// Create an account independent of shopper option in $request.
			// Note - checkbox is not displayed to shopper in this case.
			return true;
		}

		// From here we know that the store allows guest checkout;
		// shopper can choose whether they sign up (`should_create_account`).

		if ( true === filter_var( $request['should_create_account'], FILTER_VALIDATE_BOOLEAN ) ) {
			// User has requested an account as part of checkout processing.
			return true;
		}

		return false;
	}

	/**
	 * Convert an account creation error to an exception.
	 *
	 * @param \WP_Error $error An error object.
	 *
	 * @return Exception.
	 */
	private function map_create_account_error( \WP_Error $error ) {
		switch ( $error->get_error_code() ) {
			// WordPress core error codes.
			case 'empty_username':
			case 'invalid_username':
			case 'empty_email':
			case 'invalid_email':
			case 'email_exists':
			case 'registerfail':
				return new \Exception( 'woocommerce_rest_checkout_create_account_failure' );
		}

		return new \Exception( 'woocommerce_rest_checkout_create_account_failure' );
	}

	/**
	 * Create a new account for a customer (using a new blocks-specific PHP API).
	 *
	 * The account is created with a generated username. The customer is sent
	 * an email notifying them about the account and containing a link to set
	 * their (initial) password.
	 *
	 * Intended as a replacement for wc_create_new_customer in WC core.
	 *
	 * @throws \Exception If an error is encountered when creating the user account.
	 *
	 * @param string $user_email The email address to use for the new account.
	 * @param string $first_name The first name to use for the new account.
	 * @param string $last_name  The last name to use for the new account.
	 *
	 * @return int User id if successful
	 */
	private function create_customer_account( $user_email, $first_name, $last_name ) {
		if ( empty( $user_email ) || ! is_email( $user_email ) ) {
			throw new \Exception( 'registration-error-invalid-email' );
		}

		if ( email_exists( $user_email ) ) {
			throw new \Exception( 'registration-error-email-exists' );
		}

		$username = wc_create_new_customer_username( $user_email );

		// Handle password creation.
		$password           = wp_generate_password();
		$password_generated = true;

		// Use WP_Error to handle registration errors.
		$errors = new \WP_Error();

		do_action( 'woocommerce_register_post', $username, $user_email, $errors );

		$errors = apply_filters( 'woocommerce_registration_errors', $errors, $username, $user_email );

		if ( $errors->get_error_code() ) {
			throw new \Exception( $errors->get_error_code() );
		}

		$new_customer_data = apply_filters(
			'woocommerce_new_customer_data',
			array(
				'is_checkout_block_customer_signup' => true,
				'user_login'                        => $username,
				'user_pass'                         => $password,
				'user_email'                        => $user_email,
				'first_name'                        => $first_name,
				'last_name'                         => $last_name,
				'role'                              => 'customer',
			)
		);

		$customer_id = wp_insert_user( $new_customer_data );

		if ( is_wp_error( $customer_id ) ) {
			throw $this->map_create_account_error( $customer_id );
		}

		// Set account flag to remind customer to update generated password.
		update_user_option( $customer_id, 'default_password_nag', true, true );

		do_action( 'woocommerce_created_customer', $customer_id, $new_customer_data, $password_generated );

		return $customer_id;
	}
}
woocommerce-blocks/src/Domain/Services/DraftOrders.php000064400000017724151335517640017074 0ustar00<?php
namespace Automattic\WooCommerce\Blocks\Domain\Services;

use Automattic\WooCommerce\Blocks\Domain\Package;
use Exception;
use WC_Order;

/**
 * Service class for adding DraftOrder functionality to WooCommerce core.
 *
 * Sets up all logic related to the Checkout Draft Orders service
 *
 * @internal
 */
class DraftOrders {

	const DB_STATUS = 'wc-checkout-draft';
	const STATUS    = 'checkout-draft';

	/**
	 * Holds the Package instance
	 *
	 * @var Package
	 */
	private $package;

	/**
	 * Constructor
	 *
	 * @param Package $package An instance of the package class.
	 */
	public function __construct( Package $package ) {
		$this->package = $package;
	}

	/**
	 * Set all hooks related to adding Checkout Draft order functionality to Woo Core.
	 */
	public function init() {
		if ( $this->package->feature()->is_feature_plugin_build() ) {
			add_filter( 'wc_order_statuses', [ $this, 'register_draft_order_status' ] );
			add_filter( 'woocommerce_register_shop_order_post_statuses', [ $this, 'register_draft_order_post_status' ] );
			add_filter( 'woocommerce_analytics_excluded_order_statuses', [ $this, 'append_draft_order_post_status' ] );
			add_filter( 'woocommerce_valid_order_statuses_for_payment', [ $this, 'append_draft_order_post_status' ] );
			add_filter( 'woocommerce_valid_order_statuses_for_payment_complete', [ $this, 'append_draft_order_post_status' ] );
			// Hook into the query to retrieve My Account orders so draft status is excluded.
			add_action( 'woocommerce_my_account_my_orders_query', [ $this, 'delete_draft_order_post_status_from_args' ] );
			add_action( 'woocommerce_cleanup_draft_orders', [ $this, 'delete_expired_draft_orders' ] );
			add_action( 'admin_init', [ $this, 'install' ] );
		} else {
			// Maybe remove existing cronjob if present because it shouldn't be needed in the environment.
			add_action( 'admin_init', [ $this, 'uninstall' ] );
		}
	}

	/**
	 * Installation related logic for Draft order functionality.
	 *
	 * @internal
	 */
	public function install() {
		$this->maybe_create_cronjobs();
	}

	/**
	 * Remove cronjobs if they exist (but only from admin).
	 *
	 * @internal
	 */
	public function uninstall() {
		$this->maybe_remove_cronjobs();
	}

	/**
	 * Maybe create cron events.
	 */
	protected function maybe_create_cronjobs() {
		if ( function_exists( 'as_next_scheduled_action' ) && false === as_next_scheduled_action( 'woocommerce_cleanup_draft_orders' ) ) {
			as_schedule_recurring_action( strtotime( 'midnight tonight' ), DAY_IN_SECONDS, 'woocommerce_cleanup_draft_orders' );
		}
	}

	/**
	 * Unschedule cron jobs that are present.
	 */
	protected function maybe_remove_cronjobs() {
		if ( function_exists( 'as_next_scheduled_action' ) && as_next_scheduled_action( 'woocommerce_cleanup_draft_orders' ) ) {
			as_unschedule_all_actions( 'woocommerce_cleanup_draft_orders' );
		}
	}

	/**
	 * Register custom order status for orders created via the API during checkout.
	 *
	 * Draft order status is used before payment is attempted, during checkout, when a cart is converted to an order.
	 *
	 * @param array $statuses Array of statuses.
	 * @internal
	 * @return array
	 */
	public function register_draft_order_status( array $statuses ) {
		$statuses[ self::DB_STATUS ] = _x( 'Draft', 'Order status', 'woocommerce' );
		return $statuses;
	}

	/**
	 * Register custom order post status for orders created via the API during checkout.
	 *
	 * @param array $statuses Array of statuses.
	 * @internal

	 * @return array
	 */
	public function register_draft_order_post_status( array $statuses ) {
		$statuses[ self::DB_STATUS ] = $this->get_post_status_properties();
		return $statuses;
	}

	/**
	 * Returns the properties of this post status for registration.
	 *
	 * @return array
	 */
	private function get_post_status_properties() {
		return [
			'label'                     => _x( 'Draft', 'Order status', 'woocommerce' ),
			'public'                    => false,
			'exclude_from_search'       => false,
			'show_in_admin_all_list'    => false,
			'show_in_admin_status_list' => true,
			/* translators: %s: number of orders */
			'label_count'               => _n_noop( 'Drafts <span class="count">(%s)</span>', 'Drafts <span class="count">(%s)</span>', 'woocommerce' ),
		];
	}

	/**
	 * Remove draft status from the 'status' argument of an $args array.
	 *
	 * @param array $args Array of arguments containing statuses in the status key.
	 * @internal
	 * @return array
	 */
	public function delete_draft_order_post_status_from_args( $args ) {
		if ( ! array_key_exists( 'status', $args ) ) {
			$statuses = [];
			foreach ( wc_get_order_statuses() as $key => $label ) {
				if ( self::DB_STATUS !== $key ) {
					$statuses[] = str_replace( 'wc-', '', $key );
				}
			}
			$args['status'] = $statuses;
		} elseif ( self::DB_STATUS === $args['status'] ) {
			$args['status'] = '';
		} elseif ( is_array( $args['status'] ) ) {
			$args['status'] = array_diff_key( $args['status'], array( self::STATUS => null ) );
		}

		return $args;
	}

	/**
	 * Append draft status to a list of statuses.
	 *
	 * @param array $statuses Array of statuses.
	 * @internal

	 * @return array
	 */
	public function append_draft_order_post_status( $statuses ) {
		$statuses[] = self::STATUS;
		return $statuses;
	}

	/**
	 * Delete draft orders older than a day in batches of 20.
	 *
	 * Ran on a daily cron schedule.
	 *
	 * @internal
	 */
	public function delete_expired_draft_orders() {
		$count      = 0;
		$batch_size = 20;
		$this->ensure_draft_status_registered();
		$orders = wc_get_orders(
			[
				'date_modified' => '<=' . strtotime( '-1 DAY' ),
				'limit'         => $batch_size,
				'status'        => self::DB_STATUS,
				'type'          => 'shop_order',
			]
		);

		// do we bail because the query results are unexpected?
		try {
			$this->assert_order_results( $orders, $batch_size );
			if ( $orders ) {
				foreach ( $orders as $order ) {
					$order->delete( true );
					$count ++;
				}
			}
			if ( $batch_size === $count && function_exists( 'as_enqueue_async_action' ) ) {
				as_enqueue_async_action( 'woocommerce_cleanup_draft_orders' );
			}
		} catch ( Exception $error ) {
			wc_caught_exception( $error, __METHOD__ );
		}
	}

	/**
	 * Since it's possible for third party code to clobber the `$wp_post_statuses` global,
	 * we need to do a final check here to make sure the draft post status is
	 * registered with the global so that it is not removed by WP_Query status
	 * validation checks.
	 */
	private function ensure_draft_status_registered() {
		$is_registered = get_post_stati( [ 'name' => self::DB_STATUS ] );
		if ( empty( $is_registered ) ) {
			register_post_status(
				self::DB_STATUS,
				$this->get_post_status_properties()
			);
		}
	}

	/**
	 * Asserts whether incoming order results are expected given the query
	 * this service class executes.
	 *
	 * @param WC_Order[] $order_results The order results being asserted.
	 * @param int        $expected_batch_size The expected batch size for the results.
	 * @throws Exception If any assertions fail, an exception is thrown.
	 */
	private function assert_order_results( $order_results, $expected_batch_size ) {
		// if not an array, then just return because it won't get handled
		// anyways.
		if ( ! is_array( $order_results ) ) {
			return;
		}

		$suffix = ' This is an indicator that something is filtering WooCommerce or WordPress queries and modifying the query parameters.';

		// if count is greater than our expected batch size, then that's a problem.
		if ( count( $order_results ) > 20 ) {
			throw new Exception( 'There are an unexpected number of results returned from the query.' . $suffix );
		}

		// if any of the returned orders are not draft (or not a WC_Order), then that's a problem.
		foreach ( $order_results as $order ) {
			if ( ! ( $order instanceof WC_Order ) ) {
				throw new Exception( 'The returned results contain a value that is not a WC_Order.' . $suffix );
			}
			if ( ! $order->has_status( self::STATUS ) ) {
				throw new Exception( 'The results contain an order that is not a `wc-checkout-draft` status in the results.' . $suffix );
			}
		}
	}
}
woocommerce-blocks/src/Domain/Services/GoogleAnalytics.php000064400000005563151335517640017737 0ustar00<?php
namespace Automattic\WooCommerce\Blocks\Domain\Services;

use Automattic\WooCommerce\Blocks\Package;
use Automattic\WooCommerce\Blocks\Assets\Api as AssetApi;

/**
 * Service class to integrate Blocks with the Google Analytics extension,
 */
class GoogleAnalytics {
	/**
	 * Instance of the asset API.
	 *
	 * @var AssetApi
	 */
	protected $asset_api;

	/**
	 * Constructor.
	 *
	 * @param AssetApi $asset_api Instance of the asset API.
	 */
	public function __construct( AssetApi $asset_api ) {
		$this->asset_api = $asset_api;
		$this->init();
	}

	/**
	 * Hook into WP.
	 */
	protected function init() {
		add_action( 'init', array( $this, 'register_assets' ) );
		add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_scripts' ) );
		add_filter( 'script_loader_tag', array( $this, 'async_script_loader_tags' ), 10, 3 );
	}

	/**
	 * Register scripts.
	 */
	public function register_assets() {
		$this->asset_api->register_script( 'wc-blocks-google-analytics', 'build/wc-blocks-google-analytics.js', [ 'google-tag-manager' ] );
	}

	/**
	 * Enqueue the Google Tag Manager script if prerequisites are met.
	 */
	public function enqueue_scripts() {
		$settings = $this->get_google_analytics_settings();

		// Require tracking to be enabled with a valid GA ID.
		if ( ! stristr( $settings['ga_id'], 'G-' ) || apply_filters( 'woocommerce_ga_disable_tracking', ! wc_string_to_bool( $settings['ga_event_tracking_enabled'] ) ) ) {
			return;
		}

		if ( ! wp_script_is( 'google-tag-manager', 'registered' ) ) {
			// phpcs:ignore WordPress.WP.EnqueuedResourceParameters.MissingVersion
			wp_register_script( 'google-tag-manager', 'https://www.googletagmanager.com/gtag/js?id=' . $settings['ga_id'], [], null, false );
			wp_add_inline_script(
				'google-tag-manager',
				"
	window.dataLayer = window.dataLayer || [];
	function gtag(){dataLayer.push(arguments);}
	gtag('js', new Date());
	gtag('config', '" . esc_js( $settings['ga_id'] ) . "', { 'send_page_view': false });"
			);
		}
		wp_enqueue_script( 'wc-blocks-google-analytics' );
	}

	/**
	 * Get settings from the GA integration extension.
	 *
	 * @return array
	 */
	private function get_google_analytics_settings() {
		return wp_parse_args(
			get_option( 'woocommerce_google_analytics_settings' ),
			[
				'ga_id'                     => '',
				'ga_event_tracking_enabled' => 'no',
			]
		);
	}

	/**
	 * Add async to script tags with defined handles.
	 *
	 * @param string $tag HTML for the script tag.
	 * @param string $handle Handle of script.
	 * @param string $src Src of script.
	 * @return string
	 */
	public function async_script_loader_tags( $tag, $handle, $src ) {
		if ( ! in_array( $handle, array( 'google-tag-manager' ), true ) ) {
			return $tag;
		}
		// If script was output manually in wp_head, abort.
		if ( did_action( 'woocommerce_gtag_snippet' ) ) {
			return '';
		}
		return str_replace( '<script src', '<script async src', $tag );
	}
}
woocommerce-blocks/src/Domain/Services/Email/CustomerNewAccount.php000064400000011133151335517640021460 0ustar00<?php
namespace Automattic\WooCommerce\Blocks\Domain\Services\Email;

use \WP_User;
use \WC_Email;
use Automattic\WooCommerce\Blocks\Domain\Package;

/**
 * Customer New Account.
 *
 * An email sent to the customer when they create an account.
 * This is intended as a replacement to WC_Email_Customer_New_Account(),
 * with a set password link instead of emailing the new password in email
 * content.
 *
 * @extends     WC_Email
 */
class CustomerNewAccount extends \WC_Email {

	/**
	 * User login name.
	 *
	 * @var string
	 */
	public $user_login;

	/**
	 * User email.
	 *
	 * @var string
	 */
	public $user_email;

	/**
	 * Magic link to set initial password.
	 *
	 * @var string
	 */
	public $set_password_url;

	/**
	 * Override (force) default template path
	 *
	 * @var string
	 */
	public $default_template_path;

	/**
	 * Constructor.
	 *
	 * @param Package $package An instance of (Woo Blocks) Package.
	 */
	public function __construct( Package $package ) {
		// Note - we're using the same ID as the real email.
		// This ensures that any merchant tweaks (Settings > Emails)
		// apply to this email (consistent with the core email).
		$this->id                    = 'customer_new_account';
		$this->customer_email        = true;
		$this->title                 = __( 'New account', 'woocommerce' );
		$this->description           = __( 'Customer "new account" emails are sent to the customer when a customer signs up via checkout or account blocks.', 'woocommerce' );
		$this->template_html         = 'emails/customer-new-account-blocks.php';
		$this->template_plain        = 'emails/plain/customer-new-account-blocks.php';
		$this->default_template_path = $package->get_path( '/templates/' );

		// Call parent constructor.
		parent::__construct();
	}

	/**
	 * Get email subject.
	 *
	 * @since  3.1.0
	 * @return string
	 */
	public function get_default_subject() {
		return __( 'Your {site_title} account has been created!', 'woocommerce' );
	}

	/**
	 * Get email heading.
	 *
	 * @since  3.1.0
	 * @return string
	 */
	public function get_default_heading() {
		return __( 'Welcome to {site_title}', 'woocommerce' );
	}

	/**
	 * Trigger.
	 *
	 * @param int    $user_id User ID.
	 * @param string $user_pass User password.
	 * @param bool   $password_generated Whether the password was generated automatically or not.
	 */
	public function trigger( $user_id, $user_pass = '', $password_generated = false ) {
		$this->setup_locale();

		if ( $user_id ) {
			$this->object = new \WP_User( $user_id );

			// Generate a magic link so user can set initial password.
			$key = get_password_reset_key( $this->object );
			if ( ! is_wp_error( $key ) ) {
				$action                 = 'newaccount';
				$this->set_password_url = wc_get_account_endpoint_url( 'lost-password' ) . "?action=$action&key=$key&login=" . rawurlencode( $this->object->user_login );
			}

			$this->user_login = stripslashes( $this->object->user_login );
			$this->user_email = stripslashes( $this->object->user_email );
			$this->recipient  = $this->user_email;
		}

		if ( $this->is_enabled() && $this->get_recipient() ) {
			$this->send( $this->get_recipient(), $this->get_subject(), $this->get_content(), $this->get_headers(), $this->get_attachments(), $this->set_password_url );
		}

		$this->restore_locale();
	}

	/**
	 * Get content html.
	 *
	 * @return string
	 */
	public function get_content_html() {
		return wc_get_template_html(
			$this->template_html,
			array(
				'email_heading'      => $this->get_heading(),
				'additional_content' => $this->get_additional_content(),
				'user_login'         => $this->user_login,
				'blogname'           => $this->get_blogname(),
				'set_password_url'   => $this->set_password_url,
				'sent_to_admin'      => false,
				'plain_text'         => false,
				'email'              => $this,
			),
			'',
			$this->default_template_path
		);
	}

	/**
	 * Get content plain.
	 *
	 * @return string
	 */
	public function get_content_plain() {
		return wc_get_template_html(
			$this->template_plain,
			array(
				'email_heading'      => $this->get_heading(),
				'additional_content' => $this->get_additional_content(),
				'user_login'         => $this->user_login,
				'blogname'           => $this->get_blogname(),
				'set_password_url'   => $this->set_password_url,
				'sent_to_admin'      => false,
				'plain_text'         => true,
				'email'              => $this,
			),
			'',
			$this->default_template_path
		);
	}

	/**
	 * Default content to show below main email content.
	 *
	 * @since 3.7.0
	 * @return string
	 */
	public function get_default_additional_content() {
		return __( 'We look forward to seeing you soon.', 'woocommerce' );
	}
}
woocommerce-blocks/src/Domain/Services/FeatureGating.php000064400000006777151335517640017410 0ustar00<?php
namespace Automattic\WooCommerce\Blocks\Domain\Services;

/**
 * Service class that handles the feature flags.
 *
 * @internal
 */
class FeatureGating {

	/**
	 * Current flag value.
	 *
	 * @var int
	 */
	private $flag;

	const EXPERIMENTAL_FLAG   = 3;
	const FEATURE_PLUGIN_FLAG = 2;
	const CORE_FLAG           = 1;

	/**
	 * Current environment
	 *
	 * @var string
	 */
	private $environment;

	const PRODUCTION_ENVIRONMENT  = 'production';
	const DEVELOPMENT_ENVIRONMENT = 'development';
	const TEST_ENVIRONMENT        = 'test';

	/**
	 * Constructor
	 *
	 * @param int    $flag        Hardcoded flag value. Useful for tests.
	 * @param string $environment Hardcoded environment value. Useful for tests.
	 */
	public function __construct( $flag = 0, $environment = 'unset' ) {
		$this->flag        = $flag;
		$this->environment = $environment;
		$this->load_flag();
		$this->load_environment();
	}

	/**
	 * Set correct flag.
	 */
	public function load_flag() {
		if ( 0 === $this->flag ) {
			$default_flag = defined( 'WC_BLOCKS_IS_FEATURE_PLUGIN' ) ? self::FEATURE_PLUGIN_FLAG : self::CORE_FLAG;

			if ( file_exists( __DIR__ . '/../../../blocks.ini' ) ) {
				$allowed_flags = [ self::EXPERIMENTAL_FLAG, self::FEATURE_PLUGIN_FLAG, self::CORE_FLAG ];
				$woo_options   = parse_ini_file( __DIR__ . '/../../../blocks.ini' );
				$this->flag    = is_array( $woo_options ) && in_array( intval( $woo_options['woocommerce_blocks_phase'] ), $allowed_flags, true ) ? $woo_options['woocommerce_blocks_phase'] : $default_flag;
			} else {
				$this->flag = $default_flag;
			}
		}
	}

		/**
		 * Set correct environment.
		 */
	public function load_environment() {
		if ( 'unset' === $this->environment ) {
			if ( file_exists( __DIR__ . '/../../../blocks.ini' ) ) {
				$allowed_environments = [ self::PRODUCTION_ENVIRONMENT, self::DEVELOPMENT_ENVIRONMENT, self::TEST_ENVIRONMENT ];
				$woo_options          = parse_ini_file( __DIR__ . '/../../../blocks.ini' );
				$this->environment    = is_array( $woo_options ) && in_array( $woo_options['woocommerce_blocks_env'], $allowed_environments, true ) ? $woo_options['woocommerce_blocks_env'] : self::PRODUCTION_ENVIRONMENT;
			} else {
				$this->environment = self::PRODUCTION_ENVIRONMENT;
			}
		}
	}

	/**
	 * Returns the current flag value.
	 *
	 * @return int
	 */
	public function get_flag() {
		return $this->flag;
	}

	/**
	 * Checks if we're executing the code in an experimental build mode.
	 *
	 * @return boolean
	 */
	public function is_experimental_build() {
		return $this->flag >= self::EXPERIMENTAL_FLAG;
	}

	/**
	 * Checks if we're executing the code in an feature plugin or experimental build mode.
	 *
	 * @return boolean
	 */
	public function is_feature_plugin_build() {
		return $this->flag >= self::FEATURE_PLUGIN_FLAG;
	}

		/**
		 * Returns the current environment value.
		 *
		 * @return string
		 */
	public function get_environment() {
		return $this->environment;
	}

	/**
	 * Checks if we're executing the code in an development environment.
	 *
	 * @return boolean
	 */
	public function is_development_environment() {
		return self::DEVELOPMENT_ENVIRONMENT === $this->environment;
	}

	/**
	 * Checks if we're executing the code in a production environment.
	 *
	 * @return boolean
	 */
	public function is_production_environment() {
		return self::PRODUCTION_ENVIRONMENT === $this->environment;
	}

	/**
	 * Checks if we're executing the code in a test environment.
	 *
	 * @return boolean
	 */
	public function is_test_environment() {
		return self::TEST_ENVIRONMENT === $this->environment;
	}
}
woocommerce-blocks/src/Domain/Services/ExtendRestApi.php000064400000026270151335517640017370 0ustar00<?php
namespace Automattic\WooCommerce\Blocks\Domain\Services;

use Automattic\WooCommerce\Blocks\Domain\Package;
use Automattic\WooCommerce\Blocks\StoreApi\Routes\RouteException;
use Automattic\WooCommerce\Blocks\StoreApi\Formatters;
use Throwable;
use Exception;

/**
 * Service class to provide utility functions to extend REST API.
 */
final class ExtendRestApi {
	/**
	 * List of Store API schema that is allowed to be extended by extensions.
	 *
	 * @var array
	 */
	private $endpoints = [
		\Automattic\WooCommerce\Blocks\StoreApi\Schemas\CartItemSchema::IDENTIFIER,
		\Automattic\WooCommerce\Blocks\StoreApi\Schemas\CartSchema::IDENTIFIER,
		\Automattic\WooCommerce\Blocks\StoreApi\Schemas\CheckoutSchema::IDENTIFIER,
	];

	/**
	 * Holds the Package instance
	 *
	 * @var Package
	 */
	private $package;

	/**
	 * Holds the formatters class instance.
	 *
	 * @var Formatters
	 */
	private $formatters;

	/**
	 * Constructor
	 *
	 * @param Package    $package An instance of the package class.
	 * @param Formatters $formatters An instance of the formatters class.
	 */
	public function __construct( Package $package, Formatters $formatters ) {
		$this->package    = $package;
		$this->formatters = $formatters;
	}

	/**
	 * Returns a formatter instance.
	 *
	 * @param string $name Formatter name.
	 * @return FormatterInterface
	 */
	public function get_formatter( $name ) {
		return $this->formatters->$name;
	}

	/**
	 * Data to be extended
	 *
	 * @var array
	 */
	private $extend_data = [];

	/**
	 * Data to be extended
	 *
	 * @var array
	 */
	private $callback_methods = [];

	/**
	 * Array of payment requirements
	 *
	 * @var array
	 */
	private $payment_requirements = [];

	/**
	 * An endpoint that validates registration method call
	 *
	 * @param array $args {
	 *     An array of elements that make up a post to update or insert.
	 *
	 *     @type string   $endpoint The endpoint to extend.
	 *     @type string   $namespace Plugin namespace.
	 *     @type callable $schema_callback Callback executed to add schema data.
	 *     @type callable $data_callback Callback executed to add endpoint data.
	 *     @type string   $schema_type The type of data, object or array.
	 * }
	 *
	 * @throws Exception On failure to register.
	 * @return boolean True on success.
	 */
	public function register_endpoint_data( $args ) {
		if ( ! is_string( $args['namespace'] ) ) {
			$this->throw_exception( 'You must provide a plugin namespace when extending a Store REST endpoint.' );
		}

		if ( ! is_string( $args['endpoint'] ) || ! in_array( $args['endpoint'], $this->endpoints, true ) ) {
			$this->throw_exception(
				sprintf( 'You must provide a valid Store REST endpoint to extend, valid endpoints are: %1$s. You provided %2$s.', implode( ', ', $this->endpoints ), $args['endpoint'] )
			);
		}

		if ( isset( $args['schema_callback'] ) && ! is_callable( $args['schema_callback'] ) ) {
			$this->throw_exception( '$schema_callback must be a callable function.' );
		}

		if ( isset( $args['data_callback'] ) && ! is_callable( $args['data_callback'] ) ) {
			$this->throw_exception( '$data_callback must be a callable function.' );
		}

		if ( isset( $args['schema_type'] ) && ! in_array( $args['schema_type'], [ ARRAY_N, ARRAY_A ], true ) ) {
			$this->throw_exception(
				sprintf( 'Data type must be either ARRAY_N for a numeric array or ARRAY_A for an object like array. You provided %1$s.', $args['schema_type'] )
			);
		}

		$this->extend_data[ $args['endpoint'] ][ $args['namespace'] ] = [
			'schema_callback' => isset( $args['schema_callback'] ) ? $args['schema_callback'] : null,
			'data_callback'   => isset( $args['data_callback'] ) ? $args['data_callback'] : null,
			'schema_type'     => isset( $args['schema_type'] ) ? $args['schema_type'] : ARRAY_A,
		];

		return true;
	}

	/**
	 * Add callback functions that can be executed by the cart/extensions endpoint.
	 *
	 * @param array $args {
	 *     An array of elements that make up the callback configuration.
	 *
	 *     @type string   $endpoint The endpoint to extend.
	 *     @type string   $namespace Plugin namespace.
	 *     @type callable $callback The function/callable to execute.
	 * }
	 *
	 * @throws RouteException On failure to register.
	 * @returns boolean True on success.
	 */
	public function register_update_callback( $args ) {
		if ( ! array_key_exists( 'namespace', $args ) || ! is_string( $args['namespace'] ) ) {
			throw new RouteException(
				'woocommerce_rest_cart_extensions_error',
				'You must provide a plugin namespace when extending a Store REST endpoint.',
				400
			);
		}

		if ( ! array_key_exists( 'callback', $args ) || ! is_callable( $args['callback'] ) ) {
			throw new RouteException(
				'woocommerce_rest_cart_extensions_error',
				'There is no valid callback supplied to register_update_callback.',
				400
			);
		}

		$this->callback_methods[ $args['namespace'] ] = [
			'callback' => $args['callback'],
		];
		return true;
	}

	/**
	 * Get callback for a specific endpoint and namespace.
	 *
	 * @param string $namespace The namespace to get callbacks for.
	 *
	 * @return callable The callback registered by the extension.
	 * @throws RouteException When callback is not callable or parameters are incorrect.
	 */
	public function get_update_callback( $namespace ) {
		$method = null;
		if ( ! is_string( $namespace ) ) {
			throw new RouteException(
				'woocommerce_rest_cart_extensions_error',
				'You must provide a plugin namespace when extending a Store REST endpoint.',
				400
			);
		}

		if ( ! array_key_exists( $namespace, $this->callback_methods ) ) {
			throw new RouteException(
				'woocommerce_rest_cart_extensions_error',
				sprintf( 'There is no such namespace registered: %1$s.', $namespace ),
				400
			);
		}

		if ( ! array_key_exists( 'callback', $this->callback_methods[ $namespace ] ) || ! is_callable( $this->callback_methods[ $namespace ]['callback'] ) ) {
			throw new RouteException(
				'woocommerce_rest_cart_extensions_error',
				sprintf( 'There is no valid callback registered for: %1$s.', $namespace ),
				400
			);
		}
		return $this->callback_methods[ $namespace ]['callback'];
	}

	/**
	 * Returns the registered endpoint data
	 *
	 * @param string $endpoint    A valid identifier.
	 * @param array  $passed_args Passed arguments from the Schema class.
	 * @return object Returns an casted object with registered endpoint data.
	 * @throws Exception If a registered callback throws an error, or silently logs it.
	 */
	public function get_endpoint_data( $endpoint, array $passed_args = [] ) {
		$registered_data = [];
		if ( ! isset( $this->extend_data[ $endpoint ] ) ) {
			return (object) $registered_data;
		}
		foreach ( $this->extend_data[ $endpoint ] as $namespace => $callbacks ) {
			$data = [];

			if ( is_null( $callbacks['data_callback'] ) ) {
				continue;
			}

			try {
				$data = $callbacks['data_callback']( ...$passed_args );

				if ( ! is_array( $data ) ) {
					throw new Exception( '$data_callback must return an array.' );
				}
			} catch ( Throwable $e ) {
				$this->throw_exception( $e );
				continue;
			}

			$registered_data[ $namespace ] = $data;
		}
		return (object) $registered_data;
	}

	/**
	 * Returns the registered endpoint schema
	 *
	 * @param string $endpoint    A valid identifier.
	 * @param array  $passed_args Passed arguments from the Schema class.
	 * @return array Returns an array with registered schema data.
	 * @throws Exception If a registered callback throws an error, or silently logs it.
	 */
	public function get_endpoint_schema( $endpoint, array $passed_args = [] ) {
		$registered_schema = [];
		if ( ! isset( $this->extend_data[ $endpoint ] ) ) {
			return (object) $registered_schema;
		}

		foreach ( $this->extend_data[ $endpoint ] as $namespace => $callbacks ) {
			$schema = [];

			if ( is_null( $callbacks['schema_callback'] ) ) {
				continue;
			}

			try {
				$schema = $callbacks['schema_callback']( ...$passed_args );

				if ( ! is_array( $schema ) ) {
					throw new Exception( '$schema_callback must return an array.' );
				}
			} catch ( Throwable $e ) {
				$this->throw_exception( $e );
				continue;
			}

			$schema = $this->format_extensions_properties( $namespace, $schema, $callbacks['schema_type'] );

			$registered_schema[ $namespace ] = $schema;
		}
		return (object) $registered_schema;
	}

	/**
	 * Registers and validates payment requirements callbacks.
	 *
	 * @param array $args {
	 *     Array of registration data.
	 *
	 *     @type callable $data_callback Callback executed to add payment requirements data.
	 * }
	 *
	 * @throws Exception On failure to register.
	 * @return boolean True on success.
	 */
	public function register_payment_requirements( $args ) {
		if ( ! is_callable( $args['data_callback'] ) ) {
			$this->throw_exception( '$data_callback must be a callable function.' );
		}

		$this->payment_requirements[] = $args['data_callback'];

		return true;
	}

	/**
	 * Returns the additional payment requirements.
	 *
	 * @param array $initial_requirements list of requirements that should be added to the collected requirements.
	 * @return array Returns a list of payment requirements.
	 * @throws Exception If a registered callback throws an error, or silently logs it.
	 */
	public function get_payment_requirements( array $initial_requirements = [ 'products' ] ) {
		$requirements = $initial_requirements;
		if ( empty( $this->payment_requirements ) ) {
			return $initial_requirements;
		}

		foreach ( $this->payment_requirements as $callback ) {
			$data = [];

			try {
				$data = $callback();

				if ( ! is_array( $data ) ) {
					throw new Exception( '$data_callback must return an array.' );
				}
			} catch ( Throwable $e ) {
				$this->throw_exception( $e );
				continue;
			}
			$requirements = array_merge( $requirements, $data );
		}

		return array_unique( $requirements );
	}

	/**
	 * Throws error and/or silently logs it.
	 *
	 * @param string|Throwable $exception_or_error Error message or Exception.
	 * @throws Exception An error to throw if we have debug enabled and user is admin.
	 */
	private function throw_exception( $exception_or_error ) {
		if ( is_string( $exception_or_error ) ) {
			$exception = new Exception( $exception_or_error );
		} else {
			$exception = $exception_or_error;
		}
		// Always log an error.
		wc_caught_exception( $exception );
		if ( defined( 'WP_DEBUG' ) && WP_DEBUG && current_user_can( 'manage_woocommerce' ) ) {
			throw $exception;
		}
	}

	/**
	 * Format schema for an extension.
	 *
	 * @param string $namespace Error message or Exception.
	 * @param array  $schema An error to throw if we have debug enabled and user is admin.
	 * @param string $schema_type How should data be shaped.
	 *
	 * @return array Formatted schema.
	 */
	private function format_extensions_properties( $namespace, $schema, $schema_type ) {
		if ( ARRAY_N === $schema_type ) {
			return [
				/* translators: %s: extension namespace */
				'description' => sprintf( __( 'Extension data registered by %s', 'woocommerce' ), $namespace ),
				'type'        => 'array',
				'context'     => [ 'view', 'edit' ],
				'items'       => $schema,
			];
		}
		return [
			/* translators: %s: extension namespace */
			'description' => sprintf( __( 'Extension data registered by %s', 'woocommerce' ), $namespace ),
			'type'        => 'object',
			'context'     => [ 'view', 'edit' ],
			'properties'  => $schema,
		];
	}
}
woocommerce-blocks/src/Assets.php000064400000005427151335517640013122 0ustar00<?php
namespace Automattic\WooCommerce\Blocks;

use Automattic\WooCommerce\Blocks\Package;
use Automattic\WooCommerce\Blocks\Assets\Api as AssetApi;

/**
 * Assets class.
 *
 * @deprecated 5.0.0 This class will be removed in a future release. This has been replaced by AssetsController.
 * @internal
 */
class Assets {

	/**
	 * Initialize class features on init.
	 *
	 * @since 2.5.0
	 * @deprecated 5.0.0
	 */
	public static function init() {
		_deprecated_function( 'Assets::init', '5.0.0' );
	}

	/**
	 * Register block scripts & styles.
	 *
	 * @since 2.5.0
	 * @deprecated 5.0.0
	 */
	public static function register_assets() {
		_deprecated_function( 'Assets::register_assets', '5.0.0' );
	}

	/**
	 * Register the vendors style file. We need to do it after the other files
	 * because we need to check if `wp-edit-post` has been enqueued.
	 *
	 * @deprecated 5.0.0
	 */
	public static function enqueue_scripts() {
		_deprecated_function( 'Assets::enqueue_scripts', '5.0.0' );
	}

	/**
	 * Add body classes.
	 *
	 * @deprecated 5.0.0
	 * @param array $classes Array of CSS classnames.
	 * @return array Modified array of CSS classnames.
	 */
	public static function add_theme_body_class( $classes = [] ) {
		_deprecated_function( 'Assets::add_theme_body_class', '5.0.0' );
		return $classes;
	}

	/**
	 * Add theme class to admin body.
	 *
	 * @deprecated 5.0.0
	 * @param array $classes String with the CSS classnames.
	 * @return array Modified string of CSS classnames.
	 */
	public static function add_theme_admin_body_class( $classes = '' ) {
		_deprecated_function( 'Assets::add_theme_admin_body_class', '5.0.0' );
		return $classes;
	}

	/**
	 * Adds a redirect field to the login form so blocks can redirect users after login.
	 *
	 * @deprecated 5.0.0
	 */
	public static function redirect_to_field() {
		_deprecated_function( 'Assets::redirect_to_field', '5.0.0' );
	}

	/**
	 * Queues a block script in the frontend.
	 *
	 * @since 2.3.0
	 * @since 2.6.0 Changed $name to $script_name and added $handle argument.
	 * @since 2.9.0 Made it so scripts are not loaded in admin pages.
	 * @deprecated 4.5.0 Block types register the scripts themselves.
	 *
	 * @param string $script_name  Name of the script used to identify the file inside build folder.
	 * @param string $handle       Optional. Provided if the handle should be different than the script name. `wc-` prefix automatically added.
	 * @param array  $dependencies Optional. An array of registered script handles this script depends on. Default empty array.
	 */
	public static function register_block_script( $script_name, $handle = '', $dependencies = [] ) {
		_deprecated_function( 'register_block_script', '4.5.0' );
		$asset_api = Package::container()->get( AssetApi::class );
		$asset_api->register_block_script( $script_name, $handle, $dependencies );
	}
}
woocommerce-blocks/src/BlockTypesController.php000064400000014740151335517640016001 0ustar00<?php
namespace Automattic\WooCommerce\Blocks;

use Automattic\WooCommerce\Blocks\BlockTypes\AtomicBlock;
use Automattic\WooCommerce\Blocks\Package;
use Automattic\WooCommerce\Blocks\Assets\AssetDataRegistry;
use Automattic\WooCommerce\Blocks\Assets\Api as AssetApi;
use Automattic\WooCommerce\Blocks\Integrations\IntegrationRegistry;

/**
 * BlockTypesController class.
 *
 * @since 5.0.0
 * @internal
 */
final class BlockTypesController {

	/**
	 * Instance of the asset API.
	 *
	 * @var AssetApi
	 */
	protected $asset_api;

	/**
	 * Instance of the asset data registry.
	 *
	 * @var AssetDataRegistry
	 */
	protected $asset_data_registry;

	/**
	 * Constructor.
	 *
	 * @param AssetApi          $asset_api Instance of the asset API.
	 * @param AssetDataRegistry $asset_data_registry Instance of the asset data registry.
	 */
	public function __construct( AssetApi $asset_api, AssetDataRegistry $asset_data_registry ) {
		$this->asset_api           = $asset_api;
		$this->asset_data_registry = $asset_data_registry;
		$this->init();
	}

	/**
	 * Initialize class features.
	 */
	protected function init() {
		add_action( 'init', array( $this, 'register_blocks' ) );
		add_filter( 'render_block', array( $this, 'add_data_attributes' ), 10, 2 );
		add_action( 'woocommerce_login_form_end', array( $this, 'redirect_to_field' ) );
		add_filter( 'widget_types_to_hide_from_legacy_widget_block', array( $this, 'hide_legacy_widgets_with_block_equivalent' ) );
	}

	/**
	 * Register blocks, hooking up assets and render functions as needed.
	 */
	public function register_blocks() {
		$block_types = $this->get_block_types();

		foreach ( $block_types as $block_type ) {
			$block_type_class    = __NAMESPACE__ . '\\BlockTypes\\' . $block_type;
			$block_type_instance = new $block_type_class( $this->asset_api, $this->asset_data_registry, new IntegrationRegistry() );
		}

		foreach ( self::get_atomic_blocks() as $block_type ) {
			$block_type_instance = new AtomicBlock( $this->asset_api, $this->asset_data_registry, new IntegrationRegistry(), $block_type );
		}
	}

	/**
	 * Add data- attributes to blocks when rendered if the block is under the woocommerce/ namespace.
	 *
	 * @param string $content Block content.
	 * @param array  $block Parsed block data.
	 * @return string
	 */
	public function add_data_attributes( $content, $block ) {
		$block_name      = $block['blockName'];
		$block_namespace = strtok( $block_name, '/' );

		/**
		 * WooCommerce Blocks Namespaces
		 *
		 * This hook defines which block namespaces should have block name and attribute data- attributes appended on render.
		 *
		 * @param array $allowed_namespaces List of namespaces.
		 */
		$allowed_namespaces = array_merge( [ 'woocommerce', 'woocommerce-checkout' ], (array) apply_filters( '__experimental_woocommerce_blocks_add_data_attributes_to_namespace', [] ) );

		/**
		 * WooCommerce Blocks Block Names
		 *
		 * This hook defines which block names should have block name and attribute data- attributes appended on render.
		 *
		 * @param array $allowed_namespaces List of namespaces.
		 */
		$allowed_blocks = (array) apply_filters( '__experimental_woocommerce_blocks_add_data_attributes_to_block', [] );

		if ( ! in_array( $block_namespace, $allowed_namespaces, true ) && ! in_array( $block_name, $allowed_blocks, true ) ) {
			return $content;
		}

		$attributes              = (array) $block['attrs'];
		$escaped_data_attributes = [
			'data-block-name="' . esc_attr( $block['blockName'] ) . '"',
		];

		foreach ( $attributes as $key => $value ) {
			if ( is_bool( $value ) ) {
				$value = $value ? 'true' : 'false';
			}
			if ( ! is_scalar( $value ) ) {
				$value = wp_json_encode( $value );
			}
			$escaped_data_attributes[] = 'data-' . esc_attr( strtolower( preg_replace( '/(?<!\ )[A-Z]/', '-$0', $key ) ) ) . '="' . esc_attr( $value ) . '"';
		}

		return preg_replace( '/^<div /', '<div ' . implode( ' ', $escaped_data_attributes ) . ' ', trim( $content ) );
	}

	/**
	 * Adds a redirect field to the login form so blocks can redirect users after login.
	 */
	public function redirect_to_field() {
		// phpcs:ignore WordPress.Security.NonceVerification
		if ( empty( $_GET['redirect_to'] ) ) {
			return;
		}
		echo '<input type="hidden" name="redirect" value="' . esc_attr( esc_url_raw( wp_unslash( $_GET['redirect_to'] ) ) ) . '" />'; // phpcs:ignore WordPress.Security.NonceVerification
	}

	/**
	 * Hide legacy widgets with a feature complete block equivalent in the inserter
	 * and prevent them from showing as an option in the Legacy Widget block.
	 *
	 * @param array $widget_types An array of widgets hidden in core.
	 * @return array $widget_types An array inluding the WooCommerce widgets to hide.
	 */
	public function hide_legacy_widgets_with_block_equivalent( $widget_types ) {
		array_push( $widget_types, 'woocommerce_product_search', 'woocommerce_product_categories', 'woocommerce_recent_reviews' );
		return $widget_types;
	}

	/**
	 * Get list of block types.
	 *
	 * @return array
	 */
	protected function get_block_types() {
		global $wp_version, $pagenow;

		$block_types = [
			'AllReviews',
			'FeaturedCategory',
			'FeaturedProduct',
			'HandpickedProducts',
			'ProductBestSellers',
			'ProductCategories',
			'ProductCategory',
			'ProductNew',
			'ProductOnSale',
			'ProductsByAttribute',
			'ProductTopRated',
			'ReviewsByProduct',
			'ReviewsByCategory',
			'ProductSearch',
			'ProductTag',
			'AllProducts',
			'PriceFilter',
			'AttributeFilter',
			'StockFilter',
			'ActiveFilters',
		];

		if ( Package::feature()->is_feature_plugin_build() ) {
			$block_types[] = 'Checkout';
			$block_types[] = 'Cart';
		}

		if ( Package::feature()->is_experimental_build() ) {
			$block_types[] = 'SingleProduct';
			$block_types[] = 'CartI2';
			$block_types[] = 'MiniCart';
		}

		/**
		 * This disables specific blocks in Widget Areas by not registering them.
		 */
		if ( in_array( $pagenow, [ 'widgets.php', 'themes.php', 'customize.php' ], true ) ) {
			$block_types = array_diff(
				$block_types,
				[
					'AllProducts',
					'PriceFilter',
					'AttributeFilter',
					'StockFilter',
					'ActiveFilters',
					'Cart',
					'Checkout',
				]
			);
		}

		return $block_types;
	}

	/**
	 * Get atomic blocks types.
	 *
	 * @return array
	 */
	protected function get_atomic_blocks() {
		return [
			'product-title',
			'product-button',
			'product-image',
			'product-price',
			'product-rating',
			'product-sale-badge',
			'product-summary',
			'product-sku',
			'product-category-list',
			'product-tag-list',
			'product-stock-indicator',
			'product-add-to-cart',
		];
	}
}
woocommerce-blocks/src/Library.php000064400000002076151335517640013261 0ustar00<?php
namespace Automattic\WooCommerce\Blocks;

use Automattic\WooCommerce\Blocks\BlockTypes\AtomicBlock;
use Automattic\WooCommerce\Blocks\Package;
use Automattic\WooCommerce\Blocks\Assets\AssetDataRegistry;
use Automattic\WooCommerce\Blocks\Assets\Api as AssetApi;
use Automattic\WooCommerce\Blocks\Integrations\IntegrationRegistry;

/**
 * Library class.
 *
 * @deprecated 5.0.0 This class will be removed in a future release. This has been replaced by BlockTypesController.
 * @internal
 */
class Library {

	/**
	 * Initialize block library features.
	 *
	 * @deprecated 5.0.0
	 */
	public static function init() {
		_deprecated_function( 'Library::init', '5.0.0' );
	}

	/**
	 * Register custom tables within $wpdb object.
	 *
	 * @deprecated 5.0.0
	 */
	public static function define_tables() {
		_deprecated_function( 'Library::define_tables', '5.0.0' );
	}

	/**
	 * Register blocks, hooking up assets and render functions as needed.
	 *
	 * @deprecated 5.0.0
	 */
	public static function register_blocks() {
		_deprecated_function( 'Library::register_blocks', '5.0.0' );
	}
}
woocommerce-blocks/src/StoreApi/SchemaController.php000064400000011364151335517640016647 0ustar00<?php
namespace Automattic\WooCommerce\Blocks\StoreApi;

use Exception;
use Automattic\WooCommerce\Blocks\StoreApi\Schemas\AbstractSchema;
use Automattic\WooCommerce\Blocks\StoreApi\Schemas\BillingAddressSchema;
use Automattic\WooCommerce\Blocks\StoreApi\Schemas\ShippingAddressSchema;
use Automattic\WooCommerce\Blocks\StoreApi\Schemas\CartShippingRateSchema;
use Automattic\WooCommerce\Blocks\StoreApi\Schemas\CartSchema;
use Automattic\WooCommerce\Blocks\StoreApi\Schemas\CartItemSchema;
use Automattic\WooCommerce\Blocks\StoreApi\Schemas\CartCouponSchema;
use Automattic\WooCommerce\Blocks\StoreApi\Schemas\CartExtensionsSchema;
use Automattic\WooCommerce\Blocks\StoreApi\Schemas\CartFeeSchema;
use Automattic\WooCommerce\Blocks\StoreApi\Schemas\ErrorSchema;
use Automattic\WooCommerce\Blocks\StoreApi\Schemas\CheckoutSchema;
use Automattic\WooCommerce\Blocks\StoreApi\Schemas\ProductSchema;
use Automattic\WooCommerce\Blocks\StoreApi\Schemas\ImageAttachmentSchema;
use Automattic\WooCommerce\Blocks\StoreApi\Schemas\ProductAttributeSchema;
use Automattic\WooCommerce\Blocks\StoreApi\Schemas\ProductCategorySchema;
use Automattic\WooCommerce\Blocks\StoreApi\Schemas\ProductCollectionDataSchema;
use Automattic\WooCommerce\Blocks\StoreApi\Schemas\ProductReviewSchema;
use Automattic\WooCommerce\Blocks\StoreApi\Schemas\TermSchema;
use Automattic\WooCommerce\Blocks\Domain\Services\ExtendRestApi;


/**
 * SchemaController class.
 *
 * @internal This API is used internally by Blocks--it is still in flux and may be subject to revisions.
 */
class SchemaController {

	/**
	 * Stores schema class instances.
	 *
	 * @var AbstractSchema[]
	 */
	protected $schemas = [];

	/**
	 * Stores Rest Extending instance
	 *
	 * @var ExtendRestApi
	 */
	private $extend;

	/**
	 * Constructor.
	 *
	 * @param ExtendRestApi $extend Rest Extending instance.
	 */
	public function __construct( ExtendRestApi $extend ) {
		$this->extend = $extend;
		$this->initialize();
	}

	/**
	 * Get a schema class instance.
	 *
	 * @throws Exception If the schema does not exist.
	 *
	 * @param string $name Name of schema.
	 * @return AbstractSchema
	 */
	public function get( $name ) {
		if ( ! isset( $this->schemas[ $name ] ) ) {
			throw new Exception( $name . ' schema does not exist' );
		}
		return $this->schemas[ $name ];
	}

	/**
	 * Load schema class instances.
	 */
	protected function initialize() {
		$this->schemas                                       = [];
		$this->schemas[ ErrorSchema::IDENTIFIER ]            = new ErrorSchema( $this->extend );
		$this->schemas[ ImageAttachmentSchema::IDENTIFIER ]  = new ImageAttachmentSchema( $this->extend );
		$this->schemas[ TermSchema::IDENTIFIER ]             = new TermSchema( $this->extend );
		$this->schemas[ BillingAddressSchema::IDENTIFIER ]   = new BillingAddressSchema( $this->extend );
		$this->schemas[ ShippingAddressSchema::IDENTIFIER ]  = new ShippingAddressSchema( $this->extend );
		$this->schemas[ CartShippingRateSchema::IDENTIFIER ] = new CartShippingRateSchema( $this->extend );
		$this->schemas[ CartCouponSchema::IDENTIFIER ]       = new CartCouponSchema( $this->extend );
		$this->schemas[ CartFeeSchema::IDENTIFIER ]          = new CartFeeSchema( $this->extend );
		$this->schemas[ CartItemSchema::IDENTIFIER ]         = new CartItemSchema(
			$this->extend,
			$this->schemas[ ImageAttachmentSchema::IDENTIFIER ]
		);
		$this->schemas[ CartSchema::IDENTIFIER ]             = new CartSchema(
			$this->extend,
			$this->schemas[ CartItemSchema::IDENTIFIER ],
			$this->schemas[ CartCouponSchema::IDENTIFIER ],
			$this->schemas[ CartFeeSchema::IDENTIFIER ],
			$this->schemas[ CartShippingRateSchema::IDENTIFIER ],
			$this->schemas[ ShippingAddressSchema::IDENTIFIER ],
			$this->schemas[ BillingAddressSchema::IDENTIFIER ],
			$this->schemas[ ErrorSchema::IDENTIFIER ]
		);
		$this->schemas[ CartExtensionsSchema::IDENTIFIER ]   = new CartExtensionsSchema(
			$this->extend
		);
		$this->schemas[ CheckoutSchema::IDENTIFIER ]         = new CheckoutSchema(
			$this->extend,
			$this->schemas[ BillingAddressSchema::IDENTIFIER ],
			$this->schemas[ ShippingAddressSchema::IDENTIFIER ]
		);
		$this->schemas[ ProductSchema::IDENTIFIER ]          = new ProductSchema(
			$this->extend,
			$this->schemas[ ImageAttachmentSchema::IDENTIFIER ]
		);
		$this->schemas[ ProductAttributeSchema::IDENTIFIER ] = new ProductAttributeSchema( $this->extend );
		$this->schemas[ ProductCategorySchema::IDENTIFIER ]  = new ProductCategorySchema(
			$this->extend,
			$this->schemas[ ImageAttachmentSchema::IDENTIFIER ]
		);
		$this->schemas[ ProductCollectionDataSchema::IDENTIFIER ] = new ProductCollectionDataSchema( $this->extend );
		$this->schemas[ ProductReviewSchema::IDENTIFIER ]         = new ProductReviewSchema(
			$this->extend,
			$this->schemas[ ImageAttachmentSchema::IDENTIFIER ]
		);
	}
}
woocommerce-blocks/src/StoreApi/Formatters.php000064400000002346151335517640015531 0ustar00<?php
namespace Automattic\WooCommerce\Blocks\StoreApi;

use \Exception;
use Automattic\WooCommerce\Blocks\StoreApi\Formatters\DefaultFormatter;

/**
 * Formatters class.
 *
 * Allows formatter classes to be registered. Formatters are exposed to extensions via the ExtendRestApi class.
 */
class Formatters {
	/**
	 * Holds an array of formatter class instances.
	 *
	 * @var array
	 */
	private $formatters = [];

	/**
	 * Get a new instance of a formatter class.
	 *
	 * @throws Exception An Exception is thrown if a non-existing formatter is used and the user is admin.
	 *
	 * @param string $name Name of the formatter.
	 * @return FormatterInterface Formatter class instance.
	 */
	public function __get( $name ) {
		if ( ! isset( $this->formatters[ $name ] ) ) {
			if ( defined( 'WP_DEBUG' ) && WP_DEBUG && current_user_can( 'manage_woocommerce' ) ) {
				throw new Exception( $name . ' formatter does not exist' );
			}
			return new DefaultFormatter();
		}
		return $this->formatters[ $name ];
	}

	/**
	 * Register a formatter class for usage.
	 *
	 * @param string $name Name of the formatter.
	 * @param string $class A formatter class name.
	 */
	public function register( $name, $class ) {
		$this->formatters[ $name ] = new $class();
	}
}
woocommerce-blocks/src/StoreApi/Utilities/PartialOutOfStockException.php000064400000000542151335517640022606 0ustar00<?php
namespace Automattic\WooCommerce\Blocks\StoreApi\Utilities;

/**
 * PartialOutOfStockException class.
 *
 * @internal This API is used internally by Blocks, this exception is thrown when an item in a draft order has a
 * quantity greater than what is available in stock.
 */
class PartialOutOfStockException extends StockAvailabilityException {

}
woocommerce-blocks/src/StoreApi/Utilities/NotPurchasableException.php000064400000000474151335517640022147 0ustar00<?php
namespace Automattic\WooCommerce\Blocks\StoreApi\Utilities;

/**
 * NotPurchasableException class.
 *
 * @internal This API is used internally by Blocks, this exception is thrown when an item in the cart is not able to be
 * purchased.
 */
class NotPurchasableException extends StockAvailabilityException {

}
woocommerce-blocks/src/StoreApi/Utilities/Pagination.php000064400000004254151335517640017447 0ustar00<?php
namespace Automattic\WooCommerce\Blocks\StoreApi\Utilities;

/**
 * Pagination class.
 *
 * @internal This API is used internally by Blocks--it is still in flux and may be subject to revisions.
 * @since 2.5.0
 */
class Pagination {

	/**
	 * Add pagination headers to a response object.
	 *
	 * @param \WP_REST_Response $response Reference to the response object.
	 * @param \WP_REST_Request  $request The request object.
	 * @param int               $total_items Total items found.
	 * @param int               $total_pages Total pages found.
	 * @return \WP_REST_Response
	 */
	public function add_headers( $response, $request, $total_items, $total_pages ) {
		$response->header( 'X-WP-Total', $total_items );
		$response->header( 'X-WP-TotalPages', $total_pages );

		$current_page = $this->get_current_page( $request );
		$link_base    = $this->get_link_base( $request );

		if ( $current_page > 1 ) {
			$previous_page = $current_page - 1;
			if ( $previous_page > $total_pages ) {
				$previous_page = $total_pages;
			}
			$this->add_page_link( $response, 'prev', $previous_page, $link_base );
		}

		if ( $total_pages > $current_page ) {
			$this->add_page_link( $response, 'next', ( $current_page + 1 ), $link_base );
		}

		return $response;
	}

	/**
	 * Get current page.
	 *
	 * @param \WP_REST_Request $request The request object.
	 * @return int Get the page from the request object.
	 */
	protected function get_current_page( $request ) {
		return (int) $request->get_param( 'page' );
	}

	/**
	 * Get base for links from the request object.
	 *
	 * @param \WP_REST_Request $request The request object.
	 * @return string
	 */
	protected function get_link_base( $request ) {
		return add_query_arg( $request->get_query_params(), rest_url( $request->get_route() ) );
	}

	/**
	 * Add a page link.
	 *
	 * @param \WP_REST_Response $response Reference to the response object.
	 * @param string            $name Page link name. e.g. prev.
	 * @param int               $page Page number.
	 * @param string            $link_base Base URL.
	 */
	protected function add_page_link( &$response, $name, $page, $link_base ) {
		$response->link_header( $name, add_query_arg( 'page', $page, $link_base ) );
	}
}
woocommerce-blocks/src/StoreApi/Utilities/ProductQueryFilters.php000064400000020107151335517640021350 0ustar00<?php
namespace Automattic\WooCommerce\Blocks\StoreApi\Utilities;

use Automattic\WooCommerce\Blocks\StoreApi\Utilities\ProductQuery;

/**
 * Product Query filters class.
 *
 * @internal This API is used internally by Blocks--it is still in flux and may be subject to revisions.
 * @since 2.5.0
 */
class ProductQueryFilters {
	/**
	 * Get filtered min price for current products.
	 *
	 * @param \WP_REST_Request $request The request object.
	 * @return array
	 */
	public function get_filtered_price( $request ) {
		global $wpdb;

		// Regenerate the products query without min/max price request params.
		unset( $request['min_price'], $request['max_price'] );

		// Grab the request from the WP Query object, and remove SQL_CALC_FOUND_ROWS and Limits so we get a list of all products.
		$product_query = new ProductQuery();

		add_filter( 'posts_clauses', array( $product_query, 'add_query_clauses' ), 10, 2 );
		add_filter( 'posts_pre_query', '__return_empty_array' );

		$query_args                   = $product_query->prepare_objects_query( $request );
		$query_args['no_found_rows']  = true;
		$query_args['posts_per_page'] = -1;
		$query                        = new \WP_Query();
		$result                       = $query->query( $query_args );
		$product_query_sql            = $query->request;

		remove_filter( 'posts_clauses', array( $product_query, 'add_query_clauses' ), 10 );
		remove_filter( 'posts_pre_query', '__return_empty_array' );

		$price_filter_sql = "
			SELECT min( min_price ) as min_price, MAX( max_price ) as max_price
			FROM {$wpdb->wc_product_meta_lookup}
			WHERE product_id IN ( {$product_query_sql} )
		";

		return $wpdb->get_row( $price_filter_sql ); // phpcs:ignore
	}

	/**
	 * Get stock status counts for the current products.
	 *
	 * @param \WP_REST_Request $request The request object.
	 * @return array status=>count pairs.
	 */
	public function get_stock_status_counts( $request ) {
		global $wpdb;
		$product_query         = new ProductQuery();
		$stock_status_options  = array_map( 'esc_sql', array_keys( wc_get_product_stock_status_options() ) );
		$hide_outofstock_items = get_option( 'woocommerce_hide_out_of_stock_items' );
		if ( 'yes' === $hide_outofstock_items ) {
			unset( $stock_status_options['outofstock'] );
		}

		add_filter( 'posts_clauses', array( $product_query, 'add_query_clauses' ), 10, 2 );
		add_filter( 'posts_pre_query', '__return_empty_array' );

		$query_args = $product_query->prepare_objects_query( $request );
		unset( $query_args['stock_status'] );
		$query_args['no_found_rows']  = true;
		$query_args['posts_per_page'] = -1;
		$query                        = new \WP_Query();
		$result                       = $query->query( $query_args );
		$product_query_sql            = $query->request;

		remove_filter( 'posts_clauses', array( $product_query, 'add_query_clauses' ), 10 );
		remove_filter( 'posts_pre_query', '__return_empty_array' );

		$stock_status_counts = array();

		foreach ( $stock_status_options as $status ) {
			$stock_status_count_sql = $this->generate_stock_status_count_query( $status, $product_query_sql, $stock_status_options );

			$result = $wpdb->get_row( $stock_status_count_sql ); // phpcs:ignore
			$stock_status_counts[ $status ] = $result->status_count;
		}

		return $stock_status_counts;
	}

	/**
	 * Generate calculate query by stock status.
	 *
	 * @param string $status status to calculate.
	 * @param string $product_query_sql product query for current filter state.
	 * @param array  $stock_status_options available stock status options.
	 *
	 * @return false|string
	 */
	private function generate_stock_status_count_query( $status, $product_query_sql, $stock_status_options ) {
		if ( ! in_array( $status, $stock_status_options, true ) ) {
			return false;
		}
		global $wpdb;
		$status = esc_sql( $status );
		return "
			SELECT COUNT( DISTINCT posts.ID ) as status_count
			FROM {$wpdb->posts} as posts
			INNER JOIN {$wpdb->postmeta} as postmeta ON posts.ID = postmeta.post_id
            AND postmeta.meta_key = '_stock_status'
            AND postmeta.meta_value = '{$status}'
			WHERE posts.ID IN ( {$product_query_sql} )
		";
	}

	/**
	 * Get attribute counts for the current products.
	 *
	 * @param \WP_REST_Request $request The request object.
	 * @param array            $attributes Attributes to count, either names or ids.
	 * @return array termId=>count pairs.
	 */
	public function get_attribute_counts( $request, $attributes = [] ) {
		global $wpdb;

		// Remove paging and sorting params from the request.
		$request->set_param( 'page', null );
		$request->set_param( 'per_page', null );
		$request->set_param( 'order', null );
		$request->set_param( 'orderby', null );

		// Grab the request from the WP Query object, and remove SQL_CALC_FOUND_ROWS and Limits so we get a list of all products.
		$product_query = new ProductQuery();

		add_filter( 'posts_clauses', array( $product_query, 'add_query_clauses' ), 10, 2 );
		add_filter( 'posts_pre_query', '__return_empty_array' );

		$query_args                   = $product_query->prepare_objects_query( $request );
		$query_args['no_found_rows']  = true;
		$query_args['posts_per_page'] = -1;
		$query                        = new \WP_Query();
		$result                       = $query->query( $query_args );
		$product_query_sql            = $query->request;

		remove_filter( 'posts_clauses', array( $product_query, 'add_query_clauses' ), 10 );
		remove_filter( 'posts_pre_query', '__return_empty_array' );

		if ( count( $attributes ) === count( array_filter( $attributes, 'is_numeric' ) ) ) {
			$attributes = array_map( 'wc_attribute_taxonomy_name_by_id', wp_parse_id_list( $attributes ) );
		}

		$attributes_to_count     = array_map(
			function( $attribute ) {
				$attribute = wc_sanitize_taxonomy_name( $attribute );
				return esc_sql( $attribute );
			},
			$attributes
		);
		$attributes_to_count_sql = 'AND term_taxonomy.taxonomy IN ("' . implode( '","', $attributes_to_count ) . '")';
		$attribute_count_sql     = "
			SELECT COUNT( DISTINCT posts.ID ) as term_count, terms.term_id as term_count_id
			FROM {$wpdb->posts} AS posts
			INNER JOIN {$wpdb->term_relationships} AS term_relationships ON posts.ID = term_relationships.object_id
			INNER JOIN {$wpdb->term_taxonomy} AS term_taxonomy USING( term_taxonomy_id )
			INNER JOIN {$wpdb->terms} AS terms USING( term_id )
			WHERE posts.ID IN ( {$product_query_sql} )
			{$attributes_to_count_sql}
			GROUP BY terms.term_id
		";

		$results = $wpdb->get_results( $attribute_count_sql ); // phpcs:ignore

		return array_map( 'absint', wp_list_pluck( $results, 'term_count', 'term_count_id' ) );
	}

	/**
	 * Get rating counts for the current products.
	 *
	 * @param \WP_REST_Request $request The request object.
	 * @return array rating=>count pairs.
	 */
	public function get_rating_counts( $request ) {
		global $wpdb;

		// Regenerate the products query without rating request params.
		unset( $request['rating'] );

		// Grab the request from the WP Query object, and remove SQL_CALC_FOUND_ROWS and Limits so we get a list of all products.
		$product_query = new ProductQuery();

		add_filter( 'posts_clauses', array( $product_query, 'add_query_clauses' ), 10, 2 );
		add_filter( 'posts_pre_query', '__return_empty_array' );

		$query_args                   = $product_query->prepare_objects_query( $request );
		$query_args['no_found_rows']  = true;
		$query_args['posts_per_page'] = -1;
		$query                        = new \WP_Query();
		$result                       = $query->query( $query_args );
		$product_query_sql            = $query->request;

		remove_filter( 'posts_clauses', array( $product_query, 'add_query_clauses' ), 10 );
		remove_filter( 'posts_pre_query', '__return_empty_array' );

		$rating_count_sql = "
			SELECT COUNT( DISTINCT product_id ) as product_count, ROUND( average_rating, 0 ) as rounded_average_rating
			FROM {$wpdb->wc_product_meta_lookup}
			WHERE product_id IN ( {$product_query_sql} )
			AND average_rating > 0
			GROUP BY rounded_average_rating
			ORDER BY rounded_average_rating ASC
		";

		$results = $wpdb->get_results( $rating_count_sql ); // phpcs:ignore

		return array_map( 'absint', wp_list_pluck( $results, 'product_count', 'rounded_average_rating' ) );
	}
}
woocommerce-blocks/src/StoreApi/Utilities/ProductQuery.php000064400000037572151335517640020035 0ustar00<?php
namespace Automattic\WooCommerce\Blocks\StoreApi\Utilities;

use WC_Tax;

/**
 * Product Query class.
 * Helper class to handle product queries for the API.
 *
 * @internal This API is used internally by Blocks--it is still in flux and may be subject to revisions.
 * @since 2.5.0
 */
class ProductQuery {
	/**
	 * Prepare query args to pass to WP_Query for a REST API request.
	 *
	 * @param \WP_REST_Request $request Request data.
	 * @return array
	 */
	public function prepare_objects_query( $request ) {
		$args = [
			'offset'              => $request['offset'],
			'order'               => $request['order'],
			'orderby'             => $request['orderby'],
			'paged'               => $request['page'],
			'post__in'            => $request['include'],
			'post__not_in'        => $request['exclude'],
			'posts_per_page'      => $request['per_page'] ? $request['per_page'] : -1,
			'post_parent__in'     => $request['parent'],
			'post_parent__not_in' => $request['parent_exclude'],
			'search'              => $request['search'], // This uses search rather than s intentionally to handle searches internally.
			'fields'              => 'ids',
			'ignore_sticky_posts' => true,
			'post_status'         => 'publish',
			'date_query'          => [],
			'post_type'           => 'product',
		];

		// If searching for a specific SKU, allow any post type.
		if ( ! empty( $request['sku'] ) ) {
			$args['post_type'] = [ 'product', 'product_variation' ];
		}

		// Taxonomy query to filter products by type, category, tag, shipping class, and attribute.
		$tax_query = [];

		// Filter product type by slug.
		if ( ! empty( $request['type'] ) ) {
			if ( 'variation' === $request['type'] ) {
				$args['post_type'] = 'product_variation';
			} else {
				$args['post_type'] = 'product';
				$tax_query[]       = [
					'taxonomy' => 'product_type',
					'field'    => 'slug',
					'terms'    => $request['type'],
				];
			}
		}

		if ( 'date' === $args['orderby'] ) {
			$args['orderby'] = 'date ID';
		}

		// Set before into date query. Date query must be specified as an array of an array.
		if ( isset( $request['before'] ) ) {
			$args['date_query'][0]['before'] = $request['before'];
		}

		// Set after into date query. Date query must be specified as an array of an array.
		if ( isset( $request['after'] ) ) {
			$args['date_query'][0]['after'] = $request['after'];
		}

		// Set date query column. Defaults to post_date.
		if ( isset( $request['date_column'] ) && ! empty( $args['date_query'][0] ) ) {
			$args['date_query'][0]['column'] = 'post_' . $request['date_column'];
		}

		// Set custom args to handle later during clauses.
		$custom_keys = [
			'sku',
			'min_price',
			'max_price',
			'stock_status',
		];

		foreach ( $custom_keys as $key ) {
			if ( ! empty( $request[ $key ] ) ) {
				$args[ $key ] = $request[ $key ];
			}
		}

		$operator_mapping = [
			'in'     => 'IN',
			'not_in' => 'NOT IN',
			'and'    => 'AND',
		];

		// Map between taxonomy name and arg key.
		$taxonomies = [
			'product_cat' => 'category',
			'product_tag' => 'tag',
		];

		// Set tax_query for each passed arg.
		foreach ( $taxonomies as $taxonomy => $key ) {
			if ( ! empty( $request[ $key ] ) ) {
				$operator    = $request->get_param( $key . '_operator' ) && isset( $operator_mapping[ $request->get_param( $key . '_operator' ) ] ) ? $operator_mapping[ $request->get_param( $key . '_operator' ) ] : 'IN';
				$tax_query[] = [
					'taxonomy' => $taxonomy,
					'field'    => 'term_id',
					'terms'    => $request[ $key ],
					'operator' => $operator,
				];
			}
		}

		// Filter by attributes.
		if ( ! empty( $request['attributes'] ) ) {
			$att_queries = [];

			foreach ( $request['attributes'] as $attribute ) {
				if ( empty( $attribute['term_id'] ) && empty( $attribute['slug'] ) ) {
					continue;
				}
				if ( in_array( $attribute['attribute'], wc_get_attribute_taxonomy_names(), true ) ) {
					$operator      = isset( $attribute['operator'], $operator_mapping[ $attribute['operator'] ] ) ? $operator_mapping[ $attribute['operator'] ] : 'IN';
					$att_queries[] = [
						'taxonomy' => $attribute['attribute'],
						'field'    => ! empty( $attribute['term_id'] ) ? 'term_id' : 'slug',
						'terms'    => ! empty( $attribute['term_id'] ) ? $attribute['term_id'] : $attribute['slug'],
						'operator' => $operator,
					];
				}
			}

			if ( 1 < count( $att_queries ) ) {
				// Add relation arg when using multiple attributes.
				$relation    = $request->get_param( 'attribute_relation' ) && isset( $operator_mapping[ $request->get_param( 'attribute_relation' ) ] ) ? $operator_mapping[ $request->get_param( 'attribute_relation' ) ] : 'IN';
				$tax_query[] = [
					'relation' => $relation,
					$att_queries,
				];
			} else {
				$tax_query = array_merge( $tax_query, $att_queries );
			}
		}

		// Build tax_query if taxonomies are set.
		if ( ! empty( $tax_query ) ) {
			if ( ! empty( $args['tax_query'] ) ) {
				$args['tax_query'] = array_merge( $tax_query, $args['tax_query'] ); // phpcs:ignore
			} else {
				$args['tax_query'] = $tax_query; // phpcs:ignore
			}
		}

		// Filter featured.
		if ( is_bool( $request['featured'] ) ) {
			$args['tax_query'][] = [
				'taxonomy' => 'product_visibility',
				'field'    => 'name',
				'terms'    => 'featured',
				'operator' => true === $request['featured'] ? 'IN' : 'NOT IN',
			];
		}

		// Filter by on sale products.
		if ( is_bool( $request['on_sale'] ) ) {
			$on_sale_key = $request['on_sale'] ? 'post__in' : 'post__not_in';
			$on_sale_ids = wc_get_product_ids_on_sale();

			// Use 0 when there's no on sale products to avoid return all products.
			$on_sale_ids = empty( $on_sale_ids ) ? [ 0 ] : $on_sale_ids;

			$args[ $on_sale_key ] += $on_sale_ids;
		}

		$catalog_visibility = $request->get_param( 'catalog_visibility' );
		$rating             = $request->get_param( 'rating' );
		$visibility_options = wc_get_product_visibility_options();

		if ( in_array( $catalog_visibility, array_keys( $visibility_options ), true ) ) {
			$exclude_from_catalog = 'search' === $catalog_visibility ? '' : 'exclude-from-catalog';
			$exclude_from_search  = 'catalog' === $catalog_visibility ? '' : 'exclude-from-search';

			$args['tax_query'][] = [
				'taxonomy'      => 'product_visibility',
				'field'         => 'name',
				'terms'         => [ $exclude_from_catalog, $exclude_from_search ],
				'operator'      => 'hidden' === $catalog_visibility ? 'AND' : 'NOT IN',
				'rating_filter' => true,
			];
		}

		if ( $rating ) {
			$rating_terms = [];
			foreach ( $rating as $value ) {
				$rating_terms[] = 'rated-' . $value;
			}
			$args['tax_query'][] = [
				'taxonomy' => 'product_visibility',
				'field'    => 'name',
				'terms'    => $rating_terms,
			];
		}

		$orderby = $request->get_param( 'orderby' );
		$order   = $request->get_param( 'order' );

		$ordering_args   = wc()->query->get_catalog_ordering_args( $orderby, $order );
		$args['orderby'] = $ordering_args['orderby'];
		$args['order']   = $ordering_args['order'];

		if ( 'include' === $orderby ) {
			$args['orderby'] = 'post__in';
		} elseif ( 'id' === $orderby ) {
			$args['orderby'] = 'ID'; // ID must be capitalized.
		} elseif ( 'slug' === $orderby ) {
			$args['orderby'] = 'name';
		}

		if ( $ordering_args['meta_key'] ) {
			$args['meta_key'] = $ordering_args['meta_key']; // phpcs:ignore
		}

		return $args;
	}

	/**
	 * Get results of query.
	 *
	 * @param \WP_REST_Request $request Request data.
	 * @return array
	 */
	public function get_results( $request ) {
		$query_args = $this->prepare_objects_query( $request );

		add_filter( 'posts_clauses', [ $this, 'add_query_clauses' ], 10, 2 );

		$query       = new \WP_Query();
		$results     = $query->query( $query_args );
		$total_posts = $query->found_posts;

		// Out-of-bounds, run the query again without LIMIT for total count.
		if ( $total_posts < 1 && $query_args['paged'] > 1 ) {
			unset( $query_args['paged'] );
			$count_query = new \WP_Query();
			$count_query->query( $query_args );
			$total_posts = $count_query->found_posts;
		}

		remove_filter( 'posts_clauses', [ $this, 'add_query_clauses' ], 10 );

		return [
			'results' => $results,
			'total'   => (int) $total_posts,
			'pages'   => $query->query_vars['posts_per_page'] > 0 ? (int) ceil( $total_posts / (int) $query->query_vars['posts_per_page'] ) : 1,
		];
	}

	/**
	 * Get objects.
	 *
	 * @param \WP_REST_Request $request Request data.
	 * @return array
	 */
	public function get_objects( $request ) {
		$results = $this->get_results( $request );

		return [
			'objects' => array_map( 'wc_get_product', $results['results'] ),
			'total'   => $results['total'],
			'pages'   => $results['pages'],
		];
	}

	/**
	 * Get last modified date for all products.
	 *
	 * @return int timestamp.
	 */
	public function get_last_modified() {
		global $wpdb;

		return strtotime( $wpdb->get_var( "SELECT MAX( post_modified_gmt ) FROM {$wpdb->posts} WHERE post_type IN ( 'product', 'product_variation' );" ) );
	}

	/**
	 * Add in conditional search filters for products.
	 *
	 * @param array     $args Query args.
	 * @param \WC_Query $wp_query WC_Query object.
	 * @return array
	 */
	public function add_query_clauses( $args, $wp_query ) {
		global $wpdb;

		if ( $wp_query->get( 'search' ) ) {
			$search         = '%' . $wpdb->esc_like( $wp_query->get( 'search' ) ) . '%';
			$search_query   = wc_product_sku_enabled()
				? $wpdb->prepare( " AND ( $wpdb->posts.post_title LIKE %s OR wc_product_meta_lookup.sku LIKE %s ) ", $search, $search )
				: $wpdb->prepare( " AND $wpdb->posts.post_title LIKE %s ", $search );
			$args['where'] .= $search_query;
			$args['join']   = $this->append_product_sorting_table_join( $args['join'] );
		}

		if ( $wp_query->get( 'sku' ) ) {
			$skus = explode( ',', $wp_query->get( 'sku' ) );
			// Include the current string as a SKU too.
			if ( 1 < count( $skus ) ) {
				$skus[] = $wp_query->get( 'sku' );
			}
			$args['join']   = $this->append_product_sorting_table_join( $args['join'] );
			$args['where'] .= ' AND wc_product_meta_lookup.sku IN ("' . implode( '","', array_map( 'esc_sql', $skus ) ) . '")';
		}

		if ( $wp_query->get( 'stock_status' ) ) {
			$args['join']   = $this->append_product_sorting_table_join( $args['join'] );
			$args['where'] .= ' AND wc_product_meta_lookup.stock_status IN ("' . implode( '","', array_map( 'esc_sql', $wp_query->get( 'stock_status' ) ) ) . '")';
		} elseif ( 'yes' === get_option( 'woocommerce_hide_out_of_stock_items' ) ) {
			$args['join']   = $this->append_product_sorting_table_join( $args['join'] );
			$args['where'] .= ' AND wc_product_meta_lookup.stock_status NOT IN ("outofstock")';
		}

		if ( $wp_query->get( 'min_price' ) || $wp_query->get( 'max_price' ) ) {
			$args = $this->add_price_filter_clauses( $args, $wp_query );
		}

		return $args;
	}

	/**
	 * Add in conditional price filters.
	 *
	 * @param array     $args Query args.
	 * @param \WC_Query $wp_query WC_Query object.
	 * @return array
	 */
	protected function add_price_filter_clauses( $args, $wp_query ) {
		global $wpdb;

		$adjust_for_taxes = $this->adjust_price_filters_for_displayed_taxes();
		$args['join']     = $this->append_product_sorting_table_join( $args['join'] );

		if ( $wp_query->get( 'min_price' ) ) {
			$min_price_filter = $this->prepare_price_filter( $wp_query->get( 'min_price' ) );

			if ( $adjust_for_taxes ) {
				$args['where'] .= $this->get_price_filter_query_for_displayed_taxes( $min_price_filter, 'min_price', '>=' );
			} else {
				$args['where'] .= $wpdb->prepare( ' AND wc_product_meta_lookup.min_price >= %f ', $min_price_filter );
			}
		}

		if ( $wp_query->get( 'max_price' ) ) {
			$max_price_filter = $this->prepare_price_filter( $wp_query->get( 'max_price' ) );

			if ( $adjust_for_taxes ) {
				$args['where'] .= $this->get_price_filter_query_for_displayed_taxes( $max_price_filter, 'max_price', '<=' );
			} else {
				$args['where'] .= $wpdb->prepare( ' AND wc_product_meta_lookup.max_price <= %f ', $max_price_filter );
			}
		}

		return $args;
	}

	/**
	 * Get query for price filters when dealing with displayed taxes.
	 *
	 * @param float  $price_filter Price filter to apply.
	 * @param string $column Price being filtered (min or max).
	 * @param string $operator Comparison operator for column.
	 * @return string Constructed query.
	 */
	protected function get_price_filter_query_for_displayed_taxes( $price_filter, $column = 'min_price', $operator = '>=' ) {
		global $wpdb;

		// Select only used tax classes to avoid unwanted calculations.
		$product_tax_classes = $wpdb->get_col( "SELECT DISTINCT tax_class FROM {$wpdb->wc_product_meta_lookup};" );

		if ( empty( $product_tax_classes ) ) {
			return '';
		}

		$or_queries = [];

		// We need to adjust the filter for each possible tax class and combine the queries into one.
		foreach ( $product_tax_classes as $tax_class ) {
			$adjusted_price_filter = $this->adjust_price_filter_for_tax_class( $price_filter, $tax_class );
			$or_queries[]          = $wpdb->prepare(
				'( wc_product_meta_lookup.tax_class = %s AND wc_product_meta_lookup.`' . esc_sql( $column ) . '` ' . esc_sql( $operator ) . ' %f )',
				$tax_class,
				$adjusted_price_filter
			);
		}

		// phpcs:disable WordPress.DB.PreparedSQL.InterpolatedNotPrepared, WordPress.DB.PreparedSQL.NotPrepared
		return $wpdb->prepare(
			' AND (
				wc_product_meta_lookup.tax_status = "taxable" AND ( 0=1 OR ' . implode( ' OR ', $or_queries ) . ')
				OR ( wc_product_meta_lookup.tax_status != "taxable" AND wc_product_meta_lookup.`' . esc_sql( $column ) . '` ' . esc_sql( $operator ) . ' %f )
			) ',
			$price_filter
		);
		// phpcs:enable WordPress.DB.PreparedSQL.InterpolatedNotPrepared, WordPress.DB.PreparedSQL.NotPrepared
	}

	/**
	 * If price filters need adjustment to work with displayed taxes, this returns true.
	 *
	 * This logic is used when prices are stored in the database differently to how they are being displayed, with regards
	 * to taxes.
	 *
	 * @return boolean
	 */
	protected function adjust_price_filters_for_displayed_taxes() {
		$display  = get_option( 'woocommerce_tax_display_shop' );
		$database = wc_prices_include_tax() ? 'incl' : 'excl';

		return $display !== $database;
	}

	/**
	 * Converts price filter from subunits to decimal.
	 *
	 * @param string|int $price_filter Raw price filter in subunit format.
	 * @return float Price filter in decimal format.
	 */
	protected function prepare_price_filter( $price_filter ) {
		return floatval( $price_filter / ( 10 ** wc_get_price_decimals() ) );
	}

	/**
	 * Adjusts a price filter based on a tax class and whether or not the amount includes or excludes taxes.
	 *
	 * This calculation logic is based on `wc_get_price_excluding_tax` and `wc_get_price_including_tax` in core.
	 *
	 * @param float  $price_filter Price filter amount as entered.
	 * @param string $tax_class Tax class for adjustment.
	 * @return float
	 */
	protected function adjust_price_filter_for_tax_class( $price_filter, $tax_class ) {
		$tax_display    = get_option( 'woocommerce_tax_display_shop' );
		$tax_rates      = WC_Tax::get_rates( $tax_class );
		$base_tax_rates = WC_Tax::get_base_tax_rates( $tax_class );

		// If prices are shown incl. tax, we want to remove the taxes from the filter amount to match prices stored excl. tax.
		if ( 'incl' === $tax_display ) {
			$taxes = apply_filters( 'woocommerce_adjust_non_base_location_prices', true ) ? WC_Tax::calc_tax( $price_filter, $base_tax_rates, true ) : WC_Tax::calc_tax( $price_filter, $tax_rates, true );
			return $price_filter - array_sum( $taxes );
		}

		// If prices are shown excl. tax, add taxes to match the prices stored in the DB.
		$taxes = WC_Tax::calc_tax( $price_filter, $tax_rates, false );

		return $price_filter + array_sum( $taxes );
	}

	/**
	 * Join wc_product_meta_lookup to posts if not already joined.
	 *
	 * @param string $sql SQL join.
	 * @return string
	 */
	protected function append_product_sorting_table_join( $sql ) {
		global $wpdb;

		if ( ! strstr( $sql, 'wc_product_meta_lookup' ) ) {
			$sql .= " LEFT JOIN {$wpdb->wc_product_meta_lookup} wc_product_meta_lookup ON $wpdb->posts.ID = wc_product_meta_lookup.product_id ";
		}
		return $sql;
	}
}
woocommerce-blocks/src/StoreApi/Utilities/OutOfStockException.php000064400000000470151335517640021271 0ustar00<?php
namespace Automattic\WooCommerce\Blocks\StoreApi\Utilities;

/**
 * OutOfStockException class.
 *
 * @internal This API is used internally by Blocks, this exception is thrown when an item in a draft order is out
 * of stock completely.
 */
class OutOfStockException extends StockAvailabilityException {

}
woocommerce-blocks/src/StoreApi/Utilities/InvalidStockLevelsInCartException.php000064400000003134151335517640024077 0ustar00<?php
namespace Automattic\WooCommerce\Blocks\StoreApi\Utilities;

use WP_Error;

/**
 * InvalidStockLevelsInCartException class.
 *
 * @internal This API is used internally by Blocks, this exception is thrown if any items are out of stock
 * after each product on a draft order has been stock checked.
 */
class InvalidStockLevelsInCartException extends \Exception {
	/**
	 * Sanitized error code.
	 *
	 * @var string
	 */
	public $error_code;

	/**
	 * Additional error data.
	 *
	 * @var array
	 */
	public $additional_data = [];

	/**
	 * All errors to display to the user.
	 *
	 * @var WP_Error
	 */
	public $error;

	/**
	 * Setup exception.
	 *
	 * @param string   $error_code      Machine-readable error code, e.g `woocommerce_invalid_product_id`.
	 * @param WP_Error $error           The WP_Error object containing all errors relating to stock availability.
	 * @param array    $additional_data Extra data (key value pairs) to expose in the error response.
	 */
	public function __construct( $error_code, $error, $additional_data = [] ) {
		$this->error_code      = $error_code;
		$this->error           = $error;
		$this->additional_data = array_filter( (array) $additional_data );
		parent::__construct( '', 409 );
	}

	/**
	 * Returns the error code.
	 *
	 * @return string
	 */
	public function getErrorCode() {
		return $this->error_code;
	}

	/**
	 * Returns the list of messages.
	 *
	 * @return WP_Error
	 */
	public function getError() {
		return $this->error;
	}

	/**
	 * Returns additional error data.
	 *
	 * @return array
	 */
	public function getAdditionalData() {
		return $this->additional_data;
	}

}
woocommerce-blocks/src/StoreApi/Utilities/StockAvailabilityException.php000064400000003136151335517640022651 0ustar00<?php
namespace Automattic\WooCommerce\Blocks\StoreApi\Utilities;

/**
 * StockAvailabilityException class.
 *
 * @internal This API is used internally by Blocks, this exception is thrown when more than one of a product that
 * can only be purchased individually is in a cart.
 */
class StockAvailabilityException extends \Exception {
	/**
	 * Sanitized error code.
	 *
	 * @var string
	 */
	public $error_code;

	/**
	 * The name of the product that can only be purchased individually.
	 *
	 * @var string
	 */
	public $product_name;

	/**
	 * Additional error data.
	 *
	 * @var array
	 */
	public $additional_data = [];

	/**
	 * Setup exception.
	 *
	 * @param string $error_code       Machine-readable error code, e.g `woocommerce_invalid_product_id`.
	 * @param string $product_name     The name of the product that can only be purchased individually.
	 * @param array  $additional_data  Extra data (key value pairs) to expose in the error response.
	 */
	public function __construct( $error_code, $product_name, $additional_data = [] ) {
		$this->error_code      = $error_code;
		$this->product_name    = $product_name;
		$this->additional_data = array_filter( (array) $additional_data );
		parent::__construct();
	}

	/**
	 * Returns the error code.
	 *
	 * @return string
	 */
	public function getErrorCode() {
		return $this->error_code;
	}

	/**
	 * Returns additional error data.
	 *
	 * @return array
	 */
	public function getAdditionalData() {
		return $this->additional_data;
	}

	/**
	 * Returns the product name.
	 *
	 * @return string
	 */
	public function getProductName() {
		return $this->product_name;
	}

}
woocommerce-blocks/src/StoreApi/Utilities/OrderController.php000064400000044447151335517640020505 0ustar00<?php
namespace Automattic\WooCommerce\Blocks\StoreApi\Utilities;

use \Exception;
use Automattic\WooCommerce\Blocks\StoreApi\Routes\RouteException;

/**
 * OrderController class.
 * Helper class which creates and syncs orders with the cart.
 *
 * @internal This API is used internally by Blocks--it is still in flux and may be subject to revisions.
 */
class OrderController {

	/**
	 * Create order and set props based on global settings.
	 *
	 * @throws RouteException Exception if invalid data is detected.
	 *
	 * @return \WC_Order A new order object.
	 */
	public function create_order_from_cart() {
		if ( wc()->cart->is_empty() ) {
			throw new RouteException(
				'woocommerce_rest_cart_empty',
				__( 'Cannot create order from empty cart.', 'woocommerce' ),
				400
			);
		}

		add_filter( 'woocommerce_default_order_status', array( $this, 'default_order_status' ) );

		$order = new \WC_Order();
		$order->set_status( 'checkout-draft' );
		$order->set_created_via( 'store-api' );
		$this->update_order_from_cart( $order );

		remove_filter( 'woocommerce_default_order_status', array( $this, 'default_order_status' ) );

		return $order;
	}

	/**
	 * Update an order using data from the current cart.
	 *
	 * @param \WC_Order $order The order object to update.
	 */
	public function update_order_from_cart( \WC_Order $order ) {
		// Ensure cart is current.
		wc()->cart->calculate_shipping();
		wc()->cart->calculate_totals();

		// Update the current order to match the current cart.
		$this->update_line_items_from_cart( $order );
		$this->update_addresses_from_cart( $order );
		$order->set_currency( get_woocommerce_currency() );
		$order->set_prices_include_tax( 'yes' === get_option( 'woocommerce_prices_include_tax' ) );
		$order->set_customer_id( get_current_user_id() );
		$order->set_customer_ip_address( \WC_Geolocation::get_ip_address() );
		$order->set_customer_user_agent( wc_get_user_agent() );
		$order->update_meta_data( 'is_vat_exempt', wc()->cart->get_customer()->get_is_vat_exempt() ? 'yes' : 'no' );
		$order->calculate_totals();
	}

	/**
	 * Copies order data to customer object (not the session), so values persist for future checkouts.
	 *
	 * @param \WC_Order $order Order object.
	 */
	public function sync_customer_data_with_order( \WC_Order $order ) {
		if ( $order->get_customer_id() ) {
			$customer = new \WC_Customer( $order->get_customer_id() );
			$customer->set_props(
				[
					'billing_first_name'  => $order->get_billing_first_name(),
					'billing_last_name'   => $order->get_billing_last_name(),
					'billing_company'     => $order->get_billing_company(),
					'billing_address_1'   => $order->get_billing_address_1(),
					'billing_address_2'   => $order->get_billing_address_2(),
					'billing_city'        => $order->get_billing_city(),
					'billing_state'       => $order->get_billing_state(),
					'billing_postcode'    => $order->get_billing_postcode(),
					'billing_country'     => $order->get_billing_country(),
					'billing_email'       => $order->get_billing_email(),
					'billing_phone'       => $order->get_billing_phone(),
					'shipping_first_name' => $order->get_shipping_first_name(),
					'shipping_last_name'  => $order->get_shipping_last_name(),
					'shipping_company'    => $order->get_shipping_company(),
					'shipping_address_1'  => $order->get_shipping_address_1(),
					'shipping_address_2'  => $order->get_shipping_address_2(),
					'shipping_city'       => $order->get_shipping_city(),
					'shipping_state'      => $order->get_shipping_state(),
					'shipping_postcode'   => $order->get_shipping_postcode(),
					'shipping_country'    => $order->get_shipping_country(),
				]
			);

			$shipping_phone_value = is_callable( [ $order, 'get_shipping_phone' ] ) ? $order->get_shipping_phone() : $order->get_meta( '_shipping_phone', true );

			if ( is_callable( [ $customer, 'set_shipping_phone' ] ) ) {
				$customer->set_shipping_phone( $shipping_phone_value );
			} else {
				$customer->update_meta_data( 'shipping_phone', $shipping_phone_value );
			}

			$customer->save();
		};
	}

	/**
	 * Final validation ran before payment is taken.
	 *
	 * By this point we have an order populated with customer data and items.
	 *
	 * @throws RouteException Exception if invalid data is detected.
	 * @param \WC_Order $order Order object.
	 */
	public function validate_order_before_payment( \WC_Order $order ) {
		$needs_shipping          = wc()->cart->needs_shipping();
		$chosen_shipping_methods = wc()->session->get( 'chosen_shipping_methods' );

		$this->validate_coupons( $order );
		$this->validate_email( $order );
		$this->validate_selected_shipping_methods( $needs_shipping, $chosen_shipping_methods );
		$this->validate_addresses( $order );
	}

	/**
	 * Convert a coupon code to a coupon object.
	 *
	 * @param string $coupon_code Coupon code.
	 * @return \WC_Coupon Coupon object.
	 */
	protected function get_coupon( $coupon_code ) {
		return new \WC_Coupon( $coupon_code );
	}

	/**
	 * Validate coupons applied to the order and remove those that are not valid.
	 *
	 * @throws RouteException Exception if invalid data is detected.
	 * @param \WC_Order $order Order object.
	 */
	protected function validate_coupons( \WC_Order $order ) {
		$coupon_codes  = $order->get_coupon_codes();
		$coupons       = array_filter( array_map( [ $this, 'get_coupon' ], $coupon_codes ) );
		$validators    = [ 'validate_coupon_email_restriction', 'validate_coupon_usage_limit' ];
		$coupon_errors = [];

		foreach ( $coupons as $coupon ) {
			try {
				array_walk(
					$validators,
					function( $validator, $index, $params ) {
						call_user_func_array( [ $this, $validator ], $params );
					},
					[ $coupon, $order ]
				);
			} catch ( Exception $error ) {
				$coupon_errors[ $coupon->get_code() ] = $error->getMessage();
			}
		}

		if ( $coupon_errors ) {
			// Remove all coupons that were not valid.
			foreach ( $coupon_errors as $coupon_code => $message ) {
				wc()->cart->remove_coupon( $coupon_code );
			}

			// Recalculate totals.
			wc()->cart->calculate_totals();

			// Re-sync order with cart.
			$this->update_order_from_cart( $order );

			// Return exception so customer can review before payment.
			throw new RouteException(
				'woocommerce_rest_cart_coupon_errors',
				sprintf(
					/* translators: %s Coupon codes. */
					__( 'Invalid coupons were removed from the cart: "%s"', 'woocommerce' ),
					implode( '", "', array_keys( $coupon_errors ) )
				),
				409,
				[
					'removed_coupons' => $coupon_errors,
				]
			);
		}
	}

	/**
	 * Validates the customer email. This is a required field.
	 *
	 * @throws RouteException Exception if invalid data is detected.
	 * @param \WC_Order $order Order object.
	 */
	protected function validate_email( \WC_Order $order ) {
		$email = $order->get_billing_email();

		if ( empty( $email ) ) {
			throw new RouteException(
				'woocommerce_rest_missing_email_address',
				__( 'A valid email address is required', 'woocommerce' ),
				400
			);
		}

		if ( ! is_email( $email ) ) {
			throw new RouteException(
				'woocommerce_rest_invalid_email_address',
				sprintf(
					/* translators: %s provided email. */
					__( 'The provided email address (%s) is not valid—please provide a valid email address', 'woocommerce' ),
					esc_html( $email )
				),
				400
			);
		}
	}

	/**
	 * Validates customer address data based on the locale to ensure required fields are set.
	 *
	 * @throws RouteException Exception if invalid data is detected.
	 * @param \WC_Order $order Order object.
	 */
	protected function validate_addresses( \WC_Order $order ) {
		$errors           = new \WP_Error();
		$needs_shipping   = wc()->cart->needs_shipping();
		$billing_address  = $order->get_address( 'billing' );
		$shipping_address = $order->get_address( 'shipping' );

		if ( $needs_shipping && ! $this->validate_allowed_country( $shipping_address['country'], (array) wc()->countries->get_shipping_countries() ) ) {
			throw new RouteException(
				'woocommerce_rest_invalid_address_country',
				sprintf(
					/* translators: %s country code. */
					__( 'Sorry, we do not ship orders to the provided country (%s)', 'woocommerce' ),
					$shipping_address['country']
				),
				400,
				[
					'allowed_countries' => array_keys( wc()->countries->get_shipping_countries() ),
				]
			);
		}

		if ( ! $this->validate_allowed_country( $billing_address['country'], (array) wc()->countries->get_allowed_countries() ) ) {
			throw new RouteException(
				'woocommerce_rest_invalid_address_country',
				sprintf(
					/* translators: %s country code. */
					__( 'Sorry, we do not allow orders from the provided country (%s)', 'woocommerce' ),
					$billing_address['country']
				),
				400,
				[
					'allowed_countries' => array_keys( wc()->countries->get_allowed_countries() ),
				]
			);
		}

		if ( $needs_shipping ) {
			$this->validate_address_fields( $shipping_address, 'shipping', $errors );
		}
		$this->validate_address_fields( $billing_address, 'billing', $errors );

		if ( ! $errors->has_errors() ) {
			return;
		}

		$errors_by_code = [];
		$error_codes    = $errors->get_error_codes();
		foreach ( $error_codes as $code ) {
			$errors_by_code[ $code ] = $errors->get_error_messages( $code );
		}

		// Surface errors from first code.
		foreach ( $errors_by_code as $code => $error_messages ) {
			throw new RouteException(
				'woocommerce_rest_invalid_address',
				sprintf(
					/* translators: %s Address type. */
					__( 'There was a problem with the provided %s:', 'woocommerce' ) . ' ' . implode( ', ', $error_messages ),
					'shipping' === $code ? __( 'shipping address', 'woocommerce' ) : __( 'billing address', 'woocommerce' )
				),
				400,
				[
					'errors' => $errors_by_code,
				]
			);
		}
	}

	/**
	 * Check all required address fields are set and return errors if not.
	 *
	 * @param string $country Country code.
	 * @param array  $allowed_countries List of valid country codes.
	 * @return boolean True if valid.
	 */
	protected function validate_allowed_country( $country, array $allowed_countries ) {
		return array_key_exists( $country, $allowed_countries );
	}

	/**
	 * Check all required address fields are set and return errors if not.
	 *
	 * @param array     $address Address array.
	 * @param string    $address_type billing or shipping address, used in error messages.
	 * @param \WP_Error $errors Error object.
	 */
	protected function validate_address_fields( $address, $address_type, \WP_Error $errors ) {
		$all_locales    = wc()->countries->get_country_locale();
		$current_locale = isset( $all_locales[ $address['country'] ] ) ? $all_locales[ $address['country'] ] : [];

		/**
		 * We are not using wc()->counties->get_default_address_fields() here because that is filtered. Instead, this array
		 * is based on assets/js/base/components/cart-checkout/address-form/default-address-fields.js
		 */
		$address_fields = [
			'first_name' => [
				'label'    => __( 'First name', 'woocommerce' ),
				'required' => true,
			],
			'last_name'  => [
				'label'    => __( 'Last name', 'woocommerce' ),
				'required' => true,
			],
			'company'    => [
				'label'    => __( 'Company', 'woocommerce' ),
				'required' => false,
			],
			'address_1'  => [
				'label'    => __( 'Address', 'woocommerce' ),
				'required' => true,
			],
			'address_2'  => [
				'label'    => __( 'Apartment, suite, etc.', 'woocommerce' ),
				'required' => false,
			],
			'country'    => [
				'label'    => __( 'Country/Region', 'woocommerce' ),
				'required' => true,
			],
			'city'       => [
				'label'    => __( 'City', 'woocommerce' ),
				'required' => true,
			],
			'state'      => [
				'label'    => __( 'State/County', 'woocommerce' ),
				'required' => true,
			],
			'postcode'   => [
				'label'    => __( 'Postal code', 'woocommerce' ),
				'required' => true,
			],
		];

		if ( $current_locale ) {
			foreach ( $current_locale as $key => $field ) {
				if ( isset( $address_fields[ $key ] ) ) {
					$address_fields[ $key ]['label']    = isset( $field['label'] ) ? $field['label'] : $address_fields[ $key ]['label'];
					$address_fields[ $key ]['required'] = isset( $field['required'] ) ? $field['required'] : $address_fields[ $key ]['required'];
				}
			}
		}

		foreach ( $address_fields as $address_field_key => $address_field ) {
			if ( empty( $address[ $address_field_key ] ) && $address_field['required'] ) {
				/* translators: %s Field label. */
				$errors->add( $address_type, sprintf( __( '%s is required', 'woocommerce' ), $address_field['label'] ), $address_field_key );
			}
		}
	}

	/**
	 * Check email restrictions of a coupon against the order.
	 *
	 * @throws Exception Exception if invalid data is detected.
	 * @param \WC_Coupon $coupon Coupon object applied to the cart.
	 * @param \WC_Order  $order Order object.
	 */
	protected function validate_coupon_email_restriction( \WC_Coupon $coupon, \WC_Order $order ) {
		$restrictions = $coupon->get_email_restrictions();

		if ( ! empty( $restrictions ) && $order->get_billing_email() && ! wc()->cart->is_coupon_emails_allowed( [ $order->get_billing_email() ], $restrictions ) ) {
			throw new Exception( $coupon->get_coupon_error( \WC_Coupon::E_WC_COUPON_NOT_YOURS_REMOVED ) );
		}
	}

	/**
	 * Check usage restrictions of a coupon against the order.
	 *
	 * @throws Exception Exception if invalid data is detected.
	 * @param \WC_Coupon $coupon Coupon object applied to the cart.
	 * @param \WC_Order  $order Order object.
	 */
	protected function validate_coupon_usage_limit( \WC_Coupon $coupon, \WC_Order $order ) {
		$coupon_usage_limit = $coupon->get_usage_limit_per_user();

		if ( $coupon_usage_limit > 0 ) {
			$data_store  = $coupon->get_data_store();
			$usage_count = $order->get_customer_id() ? $data_store->get_usage_by_user_id( $coupon, $order->get_customer_id() ) : $data_store->get_usage_by_email( $coupon, $order->get_billing_email() );

			if ( $usage_count >= $coupon_usage_limit ) {
				throw new Exception( $coupon->get_coupon_error( \WC_Coupon::E_WC_COUPON_USAGE_LIMIT_REACHED ) );
			}
		}
	}

	/**
	 * Check there is a shipping method if it requires shipping.
	 *
	 * @throws RouteException Exception if invalid data is detected.
	 * @param boolean $needs_shipping Current order needs shipping.
	 * @param array   $chosen_shipping_methods Array of shipping methods.
	 */
	public function validate_selected_shipping_methods( $needs_shipping, $chosen_shipping_methods = array() ) {
		if ( ! $needs_shipping || ! is_array( $chosen_shipping_methods ) ) {
			return;
		}

		foreach ( $chosen_shipping_methods as $chosen_shipping_method ) {
			if ( false === $chosen_shipping_method ) {
				throw new RouteException(
					'woocommerce_rest_invalid_shipping_option',
					__( 'Sorry, this order requires a shipping option.', 'woocommerce' ),
					400,
					[]
				);
			}
		}
	}

	/**
	 * Changes default order status to draft for orders created via this API.
	 *
	 * @return string
	 */
	public function default_order_status() {
		return 'checkout-draft';
	}

	/**
	 * Create order line items.
	 *
	 * @param \WC_Order $order The order object to update.
	 */
	protected function update_line_items_from_cart( \WC_Order $order ) {
		$cart_controller = new CartController();
		$cart            = $cart_controller->get_cart_instance();
		$cart_hashes     = $cart_controller->get_cart_hashes();

		if ( $order->get_cart_hash() !== $cart_hashes['line_items'] ) {
			$order->set_cart_hash( $cart_hashes['line_items'] );
			$order->remove_order_items( 'line_item' );
			wc()->checkout->create_order_line_items( $order, $cart );
		}

		if ( $order->get_meta_data( '_shipping_hash' ) !== $cart_hashes['shipping'] ) {
			$order->update_meta_data( '_shipping_hash', $cart_hashes['shipping'] );
			$order->remove_order_items( 'shipping' );
			wc()->checkout->create_order_shipping_lines( $order, wc()->session->get( 'chosen_shipping_methods' ), wc()->shipping()->get_packages() );
		}

		if ( $order->get_meta_data( '_coupons_hash' ) !== $cart_hashes['coupons'] ) {
			$order->remove_order_items( 'coupon' );
			$order->update_meta_data( '_coupons_hash', $cart_hashes['coupons'] );
			wc()->checkout->create_order_coupon_lines( $order, $cart );
		}

		if ( $order->get_meta_data( '_fees_hash' ) !== $cart_hashes['fees'] ) {
			$order->update_meta_data( '_fees_hash', $cart_hashes['fees'] );
			$order->remove_order_items( 'fee' );
			wc()->checkout->create_order_fee_lines( $order, $cart );
		}

		if ( $order->get_meta_data( '_taxes_hash' ) !== $cart_hashes['taxes'] ) {
			$order->update_meta_data( '_taxes_hash', $cart_hashes['taxes'] );
			$order->remove_order_items( 'tax' );
			wc()->checkout->create_order_tax_lines( $order, $cart );
		}
	}

	/**
	 * Update address data from cart and/or customer session data.
	 *
	 * @param \WC_Order $order The order object to update.
	 */
	protected function update_addresses_from_cart( \WC_Order $order ) {
		$order->set_props(
			[
				'billing_first_name'  => wc()->customer->get_billing_first_name(),
				'billing_last_name'   => wc()->customer->get_billing_last_name(),
				'billing_company'     => wc()->customer->get_billing_company(),
				'billing_address_1'   => wc()->customer->get_billing_address_1(),
				'billing_address_2'   => wc()->customer->get_billing_address_2(),
				'billing_city'        => wc()->customer->get_billing_city(),
				'billing_state'       => wc()->customer->get_billing_state(),
				'billing_postcode'    => wc()->customer->get_billing_postcode(),
				'billing_country'     => wc()->customer->get_billing_country(),
				'billing_email'       => wc()->customer->get_billing_email(),
				'billing_phone'       => wc()->customer->get_billing_phone(),
				'shipping_first_name' => wc()->customer->get_shipping_first_name(),
				'shipping_last_name'  => wc()->customer->get_shipping_last_name(),
				'shipping_company'    => wc()->customer->get_shipping_company(),
				'shipping_address_1'  => wc()->customer->get_shipping_address_1(),
				'shipping_address_2'  => wc()->customer->get_shipping_address_2(),
				'shipping_city'       => wc()->customer->get_shipping_city(),
				'shipping_state'      => wc()->customer->get_shipping_state(),
				'shipping_postcode'   => wc()->customer->get_shipping_postcode(),
				'shipping_country'    => wc()->customer->get_shipping_country(),
			]
		);

		$shipping_phone_value = is_callable( [ wc()->customer, 'get_shipping_phone' ] ) ? wc()->customer->get_shipping_phone() : wc()->customer->get_meta( 'shipping_phone', true );

		if ( is_callable( [ $order, 'set_shipping_phone' ] ) ) {
			$order->set_shipping_phone( $shipping_phone_value );
		} else {
			$order->update_meta_data( '_shipping_phone', $shipping_phone_value );
		}
	}
}
woocommerce-blocks/src/StoreApi/Utilities/NoticeHandler.php000064400000002430151335517640020067 0ustar00<?php
namespace Automattic\WooCommerce\Blocks\StoreApi\Utilities;

use Automattic\WooCommerce\Blocks\StoreApi\Routes\RouteException;

/**
 * NoticeHandler class.
 * Helper class to convert notices to exceptions.
 *
 * @internal This API is used internally by Blocks--it is still in flux and may be subject to revisions.
 */
class NoticeHandler {

	/**
	 * Convert queued error notices into an exception.
	 *
	 * For example, Payment methods may add error notices during validate_fields call to prevent checkout.
	 * Since we're not rendering notices at all, we need to convert them to exceptions.
	 *
	 * This method will find the first error message and thrown an exception instead. Discards notices once complete.
	 *
	 * @throws RouteException If an error notice is detected, Exception is thrown.
	 *
	 * @param string $error_code Error code for the thrown exceptions.
	 */
	public static function convert_notices_to_exceptions( $error_code = 'unknown_server_error' ) {
		if ( 0 === wc_notice_count( 'error' ) ) {
			return;
		}

		$error_notices = wc_get_notices( 'error' );

		// Prevent notices from being output later on.
		wc_clear_notices();

		foreach ( $error_notices as $error_notice ) {
			throw new RouteException( $error_code, wp_strip_all_tags( $error_notice['notice'] ), 400 );
		}
	}
}
woocommerce-blocks/src/StoreApi/Utilities/CartController.php000064400000114631151335517640020314 0ustar00<?php
namespace Automattic\WooCommerce\Blocks\StoreApi\Utilities;

use Automattic\WooCommerce\Blocks\StoreApi\Routes\RouteException;
use Automattic\WooCommerce\Blocks\StoreApi\Utilities\NoticeHandler;
use Automattic\WooCommerce\Blocks\Utils\ArrayUtils;
use Automattic\WooCommerce\Checkout\Helpers\ReserveStock;
use WP_Error;

/**
 * Woo Cart Controller class.
 * Helper class to bridge the gap between the cart API and Woo core.
 *
 * @internal This API is used internally by Blocks--it is still in flux and may be subject to revisions.
 * @since 2.5.0
 */
class CartController {
	/**
	 * Makes the cart and sessions available to a route by loading them from core.
	 */
	public function load_cart() {
		if ( ! did_action( 'woocommerce_load_cart_from_session' ) && function_exists( 'wc_load_cart' ) ) {
			include_once WC_ABSPATH . 'includes/wc-cart-functions.php';
			include_once WC_ABSPATH . 'includes/wc-notice-functions.php';
			wc_load_cart();
		}
	}

	/**
	 * Based on the core cart class but returns errors rather than rendering notices directly.
	 *
	 * @todo Overriding the core add_to_cart method was necessary because core outputs notices when an item is added to
	 * the cart. For us this would cause notices to build up and output on the store, out of context. Core would need
	 * refactoring to split notices out from other cart actions.
	 *
	 * @throws RouteException Exception if invalid data is detected.
	 *
	 * @param array $request Add to cart request params.
	 * @return string|Error
	 */
	public function add_to_cart( $request ) {
		$cart    = $this->get_cart_instance();
		$request = wp_parse_args(
			$request,
			[
				'id'             => 0,
				'quantity'       => 1,
				'variation'      => [],
				'cart_item_data' => [],
			]
		);

		$request = $this->filter_request_data( $this->parse_variation_data( $request ) );
		$product = $this->get_product_for_cart( $request );
		$cart_id = $cart->generate_cart_id(
			$this->get_product_id( $product ),
			$this->get_variation_id( $product ),
			$request['variation'],
			$request['cart_item_data']
		);

		$this->validate_add_to_cart( $product, $request );

		$existing_cart_id = $cart->find_product_in_cart( $cart_id );

		if ( $existing_cart_id ) {
			if ( $product->is_sold_individually() ) {
				throw new RouteException(
					'woocommerce_rest_cart_product_sold_individually',
					sprintf(
						/* translators: %s: product name */
						__( 'You cannot add another "%s" to your cart.', 'woocommerce' ),
						$product->get_name()
					),
					400
				);
			}
			$cart->set_quantity( $existing_cart_id, $request['quantity'] + $cart->cart_contents[ $existing_cart_id ]['quantity'], true );

			return $existing_cart_id;
		}

		$cart->cart_contents[ $cart_id ] = apply_filters(
			'woocommerce_add_cart_item',
			array_merge(
				$request['cart_item_data'],
				array(
					'key'          => $cart_id,
					'product_id'   => $this->get_product_id( $product ),
					'variation_id' => $this->get_variation_id( $product ),
					'variation'    => $request['variation'],
					'quantity'     => $request['quantity'],
					'data'         => $product,
					'data_hash'    => wc_get_cart_item_data_hash( $product ),
				)
			),
			$cart_id
		);

		$cart->cart_contents = apply_filters( 'woocommerce_cart_contents_changed', $cart->cart_contents );

		do_action(
			'woocommerce_add_to_cart',
			$cart_id,
			$this->get_product_id( $product ),
			$request['quantity'],
			$this->get_variation_id( $product ),
			$request['variation'],
			$request['cart_item_data']
		);

		return $cart_id;
	}

	/**
	 * Based on core `set_quantity` method, but validates if an item is sold individually first.
	 *
	 * @throws RouteException Exception if invalid data is detected.
	 *
	 * @param string  $item_id Cart item id.
	 * @param integer $quantity Cart quantity.
	 */
	public function set_cart_item_quantity( $item_id, $quantity = 1 ) {
		$cart_item = $this->get_cart_item( $item_id );

		if ( empty( $cart_item ) ) {
			throw new RouteException( 'woocommerce_rest_cart_invalid_key', __( 'Cart item does not exist.', 'woocommerce' ), 404 );
		}

		$product = $cart_item['data'];

		if ( ! $product instanceof \WC_Product ) {
			throw new RouteException( 'woocommerce_rest_cart_invalid_product', __( 'Cart item is invalid.', 'woocommerce' ), 404 );
		}

		if ( $product->is_sold_individually() && $quantity > 1 ) {
			throw new RouteException(
				'woocommerce_rest_cart_product_sold_individually',
				sprintf(
					/* translators: %s: product name */
					__( 'You cannot add another "%s" to your cart.', 'woocommerce' ),
					$product->get_name()
				),
				400
			);
		}
		$cart = $this->get_cart_instance();
		$cart->set_quantity( $item_id, $quantity );
	}

	/**
	 * Validate all items in the cart and check for errors.
	 *
	 * @throws RouteException Exception if invalid data is detected.
	 *
	 * @param \WC_Product $product Product object associated with the cart item.
	 * @param array       $request Add to cart request params.
	 */
	public function validate_add_to_cart( \WC_Product $product, $request ) {
		if ( ! $product->is_purchasable() ) {
			$this->throw_default_product_exception( $product );
		}

		if ( ! $product->is_in_stock() ) {
			throw new RouteException(
				'woocommerce_rest_cart_product_no_stock',
				sprintf(
					/* translators: %s: product name */
					__( 'You cannot add &quot;%s&quot; to the cart because the product is out of stock.', 'woocommerce' ),
					$product->get_name()
				),
				400
			);
		}

		if ( $product->managing_stock() && ! $product->backorders_allowed() ) {
			$qty_remaining = $this->get_remaining_stock_for_product( $product );
			$qty_in_cart   = $this->get_product_quantity_in_cart( $product );

			if ( $qty_remaining < $qty_in_cart + $request['quantity'] ) {
				throw new RouteException(
					'woocommerce_rest_cart_product_no_stock',
					sprintf(
						/* translators: 1: product name 2: quantity in stock */
						__( 'You cannot add that amount of &quot;%1$s&quot; to the cart because there is not enough stock (%2$s remaining).', 'woocommerce' ),
						$product->get_name(),
						wc_format_stock_quantity_for_display( $qty_remaining, $product )
					),
					400
				);
			}
		}

		/**
		 * Hook: woocommerce_add_to_cart_validation (legacy).
		 *
		 * Allow 3rd parties to validate if an item can be added to the cart. This is a legacy hook from Woo core.
		 * This filter will be deprecated because it encourages usage of wc_add_notice. For the API we need to capture
		 * notices and convert to exceptions instead.
		 */
		$passed_validation = apply_filters(
			'woocommerce_add_to_cart_validation',
			true,
			$this->get_product_id( $product ),
			$request['quantity'],
			$this->get_variation_id( $product ),
			$request['variation']
		);

		if ( ! $passed_validation ) {
			// Validation did not pass - see if an error notice was thrown.
			NoticeHandler::convert_notices_to_exceptions( 'woocommerce_rest_add_to_cart_error' );

			// If no notice was thrown, throw the default notice instead.
			$this->throw_default_product_exception( $product );
		}

		/**
		 * Fire action to validate add to cart. Functions hooking into this should throw an \Exception to prevent
		 * add to cart from occuring.
		 *
		 * @param \WC_Product $product Product object being added to the cart.
		 * @param array       $request Add to cart request params including id, quantity, and variation attributes.
		 */
		do_action( 'wooocommerce_store_api_validate_add_to_cart', $product, $request );
	}

	/**
	 * Generates the error message for out of stock products and adds product names to it.
	 *
	 * @param string $singular The message to use when only one product is in the list.
	 * @param string $plural The message to use when more than one product is in the list.
	 * @param array  $items The list of cart items whose names should be inserted into the message.
	 * @returns string The translated and correctly pluralised message.
	 */
	private function add_product_names_to_message( $singular, $plural, $items ) {
		$product_names = wc_list_pluck( $items, 'getProductName' );
		$message       = ( count( $items ) > 1 ) ? $plural : $singular;
		return sprintf(
			$message,
			ArrayUtils::natural_language_join( $product_names, true )
		);
	}

	/**
	 * Takes a string describing the type of stock extension, whether there is a single product or multiple products
	 * causing this exception and returns an appropriate error message.
	 *
	 * @param string $exception_type     The type of exception encountered.
	 * @param string $singular_or_plural Whether to get the error message for a single product or multiple.
	 *
	 * @return string
	 */
	private function get_error_message_for_stock_exception_type( $exception_type, $singular_or_plural ) {
		$stock_error_messages = [
			'out_of_stock'         => [
				/* translators: %s: product name. */
				'singular' => __(
					'%s is out of stock and cannot be purchased. Please remove it from your cart.',
					'woocommerce'
				),
				/* translators: %s: product names. */
				'plural'   => __(
					'%s are out of stock and cannot be purchased. Please remove them from your cart.',
					'woocommerce'
				),
			],
			'not_purchasable'      => [
				/* translators: %s: product name. */
				'singular' => __(
					'%s cannot be purchased. Please remove it from your cart.',
					'woocommerce'
				),
				/* translators: %s: product names. */
				'plural'   => __(
					'%s cannot be purchased. Please remove them from your cart.',
					'woocommerce'
				),
			],
			'too_many_in_cart'     => [
				/* translators: %s: product names. */
				'singular' => __(
					'There are too many %s in the cart. Only 1 can be purchased. Please reduce the quantity in your cart.',
					'woocommerce'
				),
				/* translators: %s: product names. */
				'plural'   => __(
					'There are too many %s in the cart. Only 1 of each can be purchased. Please reduce the quantities in your cart.',
					'woocommerce'
				),
			],
			'partial_out_of_stock' => [
				/* translators: %s: product names. */
				'singular' => __(
					'There is not enough %s in stock. Please reduce the quantity in your cart.',
					'woocommerce'
				),
				/* translators: %s: product names. */
				'plural'   => __(
					'There are not enough %s in stock. Please reduce the quantities in your cart.',
					'woocommerce'
				),
			],
		];

		if (
			isset( $stock_error_messages[ $exception_type ] ) &&
			isset( $stock_error_messages[ $exception_type ][ $singular_or_plural ] )
		) {
			return $stock_error_messages[ $exception_type ][ $singular_or_plural ];
		}

		return __( 'There was an error with an item in your cart.', 'woocommerce' );
	}

	/**
	 * Validate all items in the cart and check for errors.
	 *
	 * @throws InvalidStockLevelsInCartException Exception if invalid data is detected due to insufficient stock levels.
	 */
	public function validate_cart_items() {
		$cart       = $this->get_cart_instance();
		$cart_items = $this->get_cart_items();

		$out_of_stock_products         = [];
		$too_many_in_cart_products     = [];
		$partial_out_of_stock_products = [];
		$not_purchasable_products      = [];

		foreach ( $cart_items as $cart_item_key => $cart_item ) {
			try {
				$this->validate_cart_item( $cart_item );
			} catch ( TooManyInCartException $error ) {
				$too_many_in_cart_products[] = $error;
			} catch ( NotPurchasableException $error ) {
				$not_purchasable_products[] = $error;
			} catch ( PartialOutOfStockException $error ) {
				$partial_out_of_stock_products[] = $error;
			} catch ( OutOfStockException $error ) {
				$out_of_stock_products[] = $error;
			}
		}

		$error = new WP_Error();

		if ( count( $out_of_stock_products ) > 0 ) {
			$singular_error = $this->get_error_message_for_stock_exception_type( 'out_of_stock', 'singular' );
			$plural_error   = $this->get_error_message_for_stock_exception_type( 'out_of_stock', 'plural' );

			$error->add(
				409,
				$this->add_product_names_to_message( $singular_error, $plural_error, $out_of_stock_products )
			);
		}

		if ( count( $not_purchasable_products ) > 0 ) {
			$singular_error = $this->get_error_message_for_stock_exception_type( 'not_purchasable', 'singular' );
			$plural_error   = $this->get_error_message_for_stock_exception_type( 'not_purchasable', 'plural' );

			$error->add(
				409,
				$this->add_product_names_to_message( $singular_error, $plural_error, $not_purchasable_products )
			);
		}

		if ( count( $too_many_in_cart_products ) > 0 ) {
			$singular_error = $this->get_error_message_for_stock_exception_type( 'too_many_in_cart', 'singular' );
			$plural_error   = $this->get_error_message_for_stock_exception_type( 'too_many_in_cart', 'plural' );

			$error->add(
				409,
				$this->add_product_names_to_message( $singular_error, $plural_error, $too_many_in_cart_products )
			);
		}

		if ( count( $partial_out_of_stock_products ) > 0 ) {
			$singular_error = $this->get_error_message_for_stock_exception_type( 'partial_out_of_stock', 'singular' );
			$plural_error   = $this->get_error_message_for_stock_exception_type( 'partial_out_of_stock', 'plural' );

			$error->add(
				409,
				$this->add_product_names_to_message( $singular_error, $plural_error, $partial_out_of_stock_products )
			);
		}

		if ( $error->has_errors() ) {
			throw new InvalidStockLevelsInCartException(
				'woocommerce_stock_availability_error',
				$error
			);
		}

		// Before running the woocommerce_check_cart_items hook, unhook validation from the core cart.
		remove_action( 'woocommerce_check_cart_items', array( $cart, 'check_cart_items' ), 1 );
		remove_action( 'woocommerce_check_cart_items', array( $cart, 'check_cart_coupons' ), 1 );

		/**
		 * Hook: woocommerce_check_cart_items
		 *
		 * Allow 3rd parties to validate cart items. This is a legacy hook from Woo core.
		 * This filter will be deprecated because it encourages usage of wc_add_notice. For the API we need to capture
		 * notices and convert to exceptions instead.
		 */
		do_action( 'woocommerce_check_cart_items' );
		NoticeHandler::convert_notices_to_exceptions( 'woocommerce_rest_cart_item_error' );
	}

	/**
	 * This method will take arrays of exceptions relating to stock, and will convert them to a WP_Error object.
	 *
	 * @param TooManyInCartException[]     $too_many_in_cart_products         Array of TooManyInCartExceptions.
	 * @param NotPurchasableException[]    $not_purchasable_products         Array of NotPurchasableExceptions.
	 * @param PartialOutOfStockException[] $partial_out_of_stock_products Array of PartialOutOfStockExceptions.
	 * @param OutOfStockException[]        $out_of_stock_products                Array of OutOfStockExceptions.
	 *
	 * @return WP_Error[] The WP_Error object returned. Will have errors if any exceptions were in the args. It will be empty if they do not.
	 */
	private function stock_exceptions_to_wp_errors( $too_many_in_cart_products, $not_purchasable_products, $partial_out_of_stock_products, $out_of_stock_products ) {
		$too_many_in_cart_error     = new WP_Error();
		$out_of_stock_error         = new WP_Error();
		$partial_out_of_stock_error = new WP_Error();
		$not_purchasable_error      = new WP_Error();

		if ( count( $out_of_stock_products ) > 0 ) {

			$singular_error = $this->get_error_message_for_stock_exception_type( 'out_of_stock', 'singular' );
			$plural_error   = $this->get_error_message_for_stock_exception_type( 'out_of_stock', 'plural' );

			$out_of_stock_error->add(
				'woocommerce-blocks-product-out-of-stock',
				$this->add_product_names_to_message( $singular_error, $plural_error, $out_of_stock_products )
			);
		}

		if ( count( $not_purchasable_products ) > 0 ) {
			$singular_error = $this->get_error_message_for_stock_exception_type( 'not_purchasable', 'singular' );
			$plural_error   = $this->get_error_message_for_stock_exception_type( 'not_purchasable', 'plural' );

			$not_purchasable_error->add(
				'woocommerce-blocks-product-not-purchasable',
				$this->add_product_names_to_message( $singular_error, $plural_error, $not_purchasable_products )
			);
		}

		if ( count( $too_many_in_cart_products ) > 0 ) {
			$singular_error = $this->get_error_message_for_stock_exception_type( 'too_many_in_cart', 'singular' );
			$plural_error   = $this->get_error_message_for_stock_exception_type( 'too_many_in_cart', 'plural' );

			$too_many_in_cart_error->add(
				'woocommerce-blocks-too-many-of-product-in-cart',
				$this->add_product_names_to_message( $singular_error, $plural_error, $too_many_in_cart_products )
			);
		}

		if ( count( $partial_out_of_stock_products ) > 0 ) {
			$singular_error = $this->get_error_message_for_stock_exception_type( 'partial_out_of_stock', 'singular' );
			$plural_error   = $this->get_error_message_for_stock_exception_type( 'partial_out_of_stock', 'plural' );

			$partial_out_of_stock_error->add(
				'woocommerce-blocks-product-partially-out-of-stock',
				$this->add_product_names_to_message( $singular_error, $plural_error, $partial_out_of_stock_products )
			);
		}

		return array_filter(
			[
				$too_many_in_cart_error,
				$partial_out_of_stock_error,
				$out_of_stock_error,
				$not_purchasable_error,
			],
			function( $error ) {
				return $error->has_errors();
			}
		);
	}

	/**
	 * Validates an existing cart item and returns any errors.
	 *
	 * @throws TooManyInCartException Exception if more than one product that can only be purchased individually is in
	 * the cart.
	 * @throws PartialOutOfStockException Exception if an item has a quantity greater than what is available in stock.
	 * @throws OutOfStockException Exception thrown when an item is entirely out of stock.
	 * @throws NotPurchasableException Exception thrown when an item is not purchasable.
	 * @param array $cart_item Cart item array.
	 */
	public function validate_cart_item( $cart_item ) {
		$product = $cart_item['data'];

		if ( ! $product instanceof \WC_Product ) {
			return;
		}

		if ( ! $product->is_purchasable() ) {
			throw new NotPurchasableException(
				'woocommerce_rest_cart_product_not_purchasable',
				$product->get_name()
			);
		}

		if ( $product->is_sold_individually() && $cart_item['quantity'] > 1 ) {
			throw new TooManyInCartException(
				'woocommerce_rest_cart_product_sold_individually',
				$product->get_name()
			);
		}

		if ( ! $product->is_in_stock() ) {
			throw new OutOfStockException(
				'woocommerce_rest_cart_product_no_stock',
				$product->get_name()
			);
		}

		if ( $product->managing_stock() && ! $product->backorders_allowed() ) {
			$qty_remaining = $this->get_remaining_stock_for_product( $product );
			$qty_in_cart   = $this->get_product_quantity_in_cart( $product );

			if ( $qty_remaining < $qty_in_cart ) {
				throw new PartialOutOfStockException(
					'woocommerce_rest_cart_product_partially_no_stock',
					$product->get_name()
				);
			}
		}

		/**
		 * Fire action to validate add to cart. Functions hooking into this should throw an \Exception to prevent
		 * add to cart from occurring.
		 *
		 * @param \WC_Product $product Product object being added to the cart.
		 * @param array       $cart_item Cart item array.
		 */
		do_action( 'wooocommerce_store_api_validate_cart_item', $product, $cart_item );
	}

	/**
	 * Validate all coupons in the cart and check for errors.
	 *
	 * @throws RouteException Exception if invalid data is detected.
	 */
	public function validate_cart_coupons() {
		$cart_coupons = $this->get_cart_coupons();

		foreach ( $cart_coupons as $code ) {
			$coupon = new \WC_Coupon( $code );
			$this->validate_cart_coupon( $coupon );
		}
	}

	/**
	 * Validate all items in the cart and get a list of errors.
	 *
	 * @return WP_Error[] An array of WP_Errors describing the cart's error state.
	 */
	public function get_cart_item_errors() {
		$errors     = [];
		$cart_items = $this->get_cart_items();

		$too_many_in_cart_exceptions     = [];
		$not_purchasable_exceptions      = [];
		$partial_out_of_stock_exceptions = [];
		$out_of_stock_exceptions         = [];

		foreach ( $cart_items as $cart_item_key => $cart_item ) {
			try {
				$this->validate_cart_item( $cart_item );
			} catch ( RouteException $error ) {
				$errors[] = new WP_Error( $error->getErrorCode(), $error->getMessage() );
			} catch ( TooManyInCartException $error ) {
				$too_many_in_cart_exceptions[] = $error;
			} catch ( NotPurchasableException $error ) {
				$not_purchasable_exceptions[] = $error;
			} catch ( PartialOutOfStockException $error ) {
				$partial_out_of_stock_exceptions[] = $error;
			} catch ( OutOfStockException $error ) {
				$out_of_stock_exceptions[] = $error;
			}
		}

		if ( count( $errors ) > 0 ) {
			return $errors;
		}

		return $this->stock_exceptions_to_wp_errors( $too_many_in_cart_exceptions, $not_purchasable_exceptions, $partial_out_of_stock_exceptions, $out_of_stock_exceptions );
	}

	/**
	 * Validate all items in the cart and get a list of errors.
	 *
	 * @throws RouteException Exception if invalid data is detected.
	 */
	public function get_cart_coupon_errors() {
		$errors       = [];
		$cart_coupons = $this->get_cart_coupons();

		foreach ( $cart_coupons as $code ) {
			try {
				$coupon = new \WC_Coupon( $code );
				$this->validate_cart_coupon( $coupon );
			} catch ( RouteException $error ) {
				$errors[] = new \WP_Error( $error->getErrorCode(), $error->getMessage() );
			}
		}

		return $errors;
	}

	/**
	 * Get main instance of cart class.
	 *
	 * @throws RouteException When cart cannot be loaded.
	 * @return \WC_Cart
	 */
	public function get_cart_instance() {
		$cart = wc()->cart;

		if ( ! $cart || ! $cart instanceof \WC_Cart ) {
			throw new RouteException( 'woocommerce_rest_cart_error', __( 'Unable to retrieve cart.', 'woocommerce' ), 500 );
		}

		return $cart;
	}

	/**
	 * Return a cart item from the woo core cart class.
	 *
	 * @param string $item_id Cart item id.
	 * @return array
	 */
	public function get_cart_item( $item_id ) {
		$cart = $this->get_cart_instance();
		return isset( $cart->cart_contents[ $item_id ] ) ? $cart->cart_contents[ $item_id ] : [];
	}

	/**
	 * Returns all cart items.
	 *
	 * @param callable $callback Optional callback to apply to the array filter.
	 * @return array
	 */
	public function get_cart_items( $callback = null ) {
		$cart = $this->get_cart_instance();
		return $callback ? array_filter( $cart->get_cart(), $callback ) : array_filter( $cart->get_cart() );
	}

	/**
	 * Get hashes for items in the current cart. Useful for tracking changes.
	 *
	 * @return array
	 */
	public function get_cart_hashes() {
		$cart = $this->get_cart_instance();
		return [
			'line_items' => $cart->get_cart_hash(),
			'shipping'   => md5( wp_json_encode( $cart->shipping_methods ) ),
			'fees'       => md5( wp_json_encode( $cart->get_fees() ) ),
			'coupons'    => md5( wp_json_encode( $cart->get_applied_coupons() ) ),
			'taxes'      => md5( wp_json_encode( $cart->get_taxes() ) ),
		];
	}

	/**
	 * Empty cart contents.
	 */
	public function empty_cart() {
		$cart = $this->get_cart_instance();
		$cart->empty_cart();
	}

	/**
	 * See if cart has applied coupon by code.
	 *
	 * @param string $coupon_code Cart coupon code.
	 * @return bool
	 */
	public function has_coupon( $coupon_code ) {
		$cart = $this->get_cart_instance();
		return $cart->has_discount( $coupon_code );
	}

	/**
	 * Returns all applied coupons.
	 *
	 * @param callable $callback Optional callback to apply to the array filter.
	 * @return array
	 */
	public function get_cart_coupons( $callback = null ) {
		$cart = $this->get_cart_instance();
		return $callback ? array_filter( $cart->get_applied_coupons(), $callback ) : array_filter( $cart->get_applied_coupons() );
	}

	/**
	 * Get shipping packages from the cart with calculated shipping rates.
	 *
	 * @todo this can be refactored once https://github.com/woocommerce/woocommerce/pull/26101 lands.
	 *
	 * @param bool $calculate_rates Should rates for the packages also be returned.
	 * @return array
	 */
	public function get_shipping_packages( $calculate_rates = true ) {
		$cart = $this->get_cart_instance();

		// See if we need to calculate anything.
		if ( ! $cart->needs_shipping() ) {
			return [];
		}

		$packages = $cart->get_shipping_packages();

		// Add extra package data to array.
		if ( count( $packages ) ) {
			$packages = array_map(
				function( $key, $package, $index ) {
					$package['package_id']   = isset( $package['package_id'] ) ? $package['package_id'] : $key;
					$package['package_name'] = isset( $package['package_name'] ) ? $package['package_name'] : $this->get_package_name( $package, $index );
					return $package;
				},
				array_keys( $packages ),
				$packages,
				range( 1, count( $packages ) )
			);
		}

		return $calculate_rates ? wc()->shipping()->calculate_shipping( $packages ) : $packages;
	}

	/**
	 * Creates a name for a package.
	 *
	 * @param array $package Shipping package from WooCommerce.
	 * @param int   $index Package number.
	 * @return string
	 */
	protected function get_package_name( $package, $index ) {
		return apply_filters(
			'woocommerce_shipping_package_name',
			$index > 1 ?
				sprintf(
					/* translators: %d: shipping package number */
					_x( 'Shipping method %d', 'shipping packages', 'woocommerce' ),
					$index
				) :
				_x( 'Shipping method', 'shipping packages', 'woocommerce' ),
			$package['package_id'],
			$package
		);
	}

	/**
	 * Selects a shipping rate.
	 *
	 * @param int|string $package_id ID of the package to choose a rate for.
	 * @param string     $rate_id ID of the rate being chosen.
	 */
	public function select_shipping_rate( $package_id, $rate_id ) {
		$cart                        = $this->get_cart_instance();
		$session_data                = wc()->session->get( 'chosen_shipping_methods' ) ? wc()->session->get( 'chosen_shipping_methods' ) : [];
		$session_data[ $package_id ] = $rate_id;

		wc()->session->set( 'chosen_shipping_methods', $session_data );
	}

	/**
	 * Based on the core cart class but returns errors rather than rendering notices directly.
	 *
	 * @todo Overriding the core apply_coupon method was necessary because core outputs notices when a coupon gets
	 * applied. For us this would cause notices to build up and output on the store, out of context. Core would need
	 * refactoring to split notices out from other cart actions.
	 *
	 * @throws RouteException Exception if invalid data is detected.
	 *
	 * @param string $coupon_code Coupon code.
	 */
	public function apply_coupon( $coupon_code ) {
		$cart            = $this->get_cart_instance();
		$applied_coupons = $this->get_cart_coupons();
		$coupon          = new \WC_Coupon( $coupon_code );

		if ( $coupon->get_code() !== $coupon_code ) {
			throw new RouteException(
				'woocommerce_rest_cart_coupon_error',
				sprintf(
					/* translators: %s coupon code */
					__( '"%s" is an invalid coupon code.', 'woocommerce' ),
					esc_html( $coupon_code )
				),
				400
			);
		}

		if ( $this->has_coupon( $coupon_code ) ) {
			throw new RouteException(
				'woocommerce_rest_cart_coupon_error',
				sprintf(
					/* translators: %s coupon code */
					__( 'Coupon code "%s" has already been applied.', 'woocommerce' ),
					esc_html( $coupon_code )
				),
				400
			);
		}

		if ( ! $coupon->is_valid() ) {
			throw new RouteException(
				'woocommerce_rest_cart_coupon_error',
				wp_strip_all_tags( $coupon->get_error_message() ),
				400
			);
		}

		// Prevents new coupons being added if individual use coupons are already in the cart.
		$individual_use_coupons = $this->get_cart_coupons(
			function( $code ) {
				$coupon = new \WC_Coupon( $code );
				return $coupon->get_individual_use();
			}
		);

		foreach ( $individual_use_coupons as $code ) {
			$individual_use_coupon = new \WC_Coupon( $code );

			if ( false === apply_filters( 'woocommerce_apply_with_individual_use_coupon', false, $coupon, $individual_use_coupon, $applied_coupons ) ) {
				throw new RouteException(
					'woocommerce_rest_cart_coupon_error',
					sprintf(
						/* translators: %s: coupon code */
						__( '"%s" has already been applied and cannot be used in conjunction with other coupons.', 'woocommerce' ),
						$code
					),
					400
				);
			}
		}

		if ( $coupon->get_individual_use() ) {
			$coupons_to_remove = array_diff( $applied_coupons, apply_filters( 'woocommerce_apply_individual_use_coupon', array(), $coupon, $applied_coupons ) );

			foreach ( $coupons_to_remove as $code ) {
				$cart->remove_coupon( $code );
			}

			$applied_coupons = array_diff( $applied_coupons, $coupons_to_remove );
		}

		$applied_coupons[] = $coupon_code;
		$cart->set_applied_coupons( $applied_coupons );

		do_action( 'woocommerce_applied_coupon', $coupon_code );
	}

	/**
	 * Validates an existing cart coupon and returns any errors.
	 *
	 * @throws RouteException Exception if invalid data is detected.
	 *
	 * @param \WC_Coupon $coupon Coupon object applied to the cart.
	 */
	protected function validate_cart_coupon( \WC_Coupon $coupon ) {
		if ( ! $coupon->is_valid() ) {
			$cart = $this->get_cart_instance();
			$cart->remove_coupon( $coupon->get_code() );
			$cart->calculate_totals();
			throw new RouteException(
				'woocommerce_rest_cart_coupon_error',
				sprintf(
					/* translators: %1$s coupon code, %2$s reason. */
					__( 'The "%1$s" coupon has been removed from your cart: %2$s', 'woocommerce' ),
					$coupon->get_code(),
					wp_strip_all_tags( $coupon->get_error_message() )
				),
				409
			);
		}
	}

	/**
	 * Gets the qty of a product across line items.
	 *
	 * @param \WC_Product $product Product object.
	 * @return int
	 */
	protected function get_product_quantity_in_cart( $product ) {
		$cart               = $this->get_cart_instance();
		$product_quantities = $cart->get_cart_item_quantities();
		$product_id         = $product->get_stock_managed_by_id();

		return isset( $product_quantities[ $product_id ] ) ? $product_quantities[ $product_id ] : 0;
	}

	/**
	 * Gets remaining stock for a product.
	 *
	 * @param \WC_Product $product Product object.
	 * @return int
	 */
	protected function get_remaining_stock_for_product( $product ) {
		$reserve_stock = new ReserveStock();
		$draft_order   = wc()->session->get( 'store_api_draft_order', 0 );
		$qty_reserved  = $reserve_stock->get_reserved_stock( $product, $draft_order );

		return $product->get_stock_quantity() - $qty_reserved;
	}

	/**
	 * Get a product object to be added to the cart.
	 *
	 * @throws RouteException Exception if invalid data is detected.
	 *
	 * @param array $request Add to cart request params.
	 * @return \WC_Product|Error Returns a product object if purchasable.
	 */
	protected function get_product_for_cart( $request ) {
		$product = wc_get_product( $request['id'] );

		if ( ! $product || 'trash' === $product->get_status() ) {
			throw new RouteException(
				'woocommerce_rest_cart_invalid_product',
				__( 'This product cannot be added to the cart.', 'woocommerce' ),
				400
			);
		}

		return $product;
	}

	/**
	 * For a given product, get the product ID.
	 *
	 * @param \WC_Product $product Product object associated with the cart item.
	 * @return int
	 */
	protected function get_product_id( \WC_Product $product ) {
		return $product->is_type( 'variation' ) ? $product->get_parent_id() : $product->get_id();
	}

	/**
	 * For a given product, get the variation ID.
	 *
	 * @param \WC_Product $product Product object associated with the cart item.
	 * @return int
	 */
	protected function get_variation_id( \WC_Product $product ) {
		return $product->is_type( 'variation' ) ? $product->get_id() : 0;
	}

	/**
	 * Default exception thrown when an item cannot be added to the cart.
	 *
	 * @throws RouteException Exception with code woocommerce_rest_cart_product_is_not_purchasable.
	 *
	 * @param \WC_Product $product Product object associated with the cart item.
	 */
	protected function throw_default_product_exception( \WC_Product $product ) {
		throw new RouteException(
			'woocommerce_rest_cart_product_is_not_purchasable',
			sprintf(
				/* translators: %s: product name */
				__( '&quot;%s&quot; is not available for purchase.', 'woocommerce' ),
				$product->get_name()
			),
			400
		);
	}

	/**
	 * Filter data for add to cart requests.
	 *
	 * @param array $request Add to cart request params.
	 * @return array Updated request array.
	 */
	protected function filter_request_data( $request ) {
		$product_id   = $request['id'];
		$variation_id = 0;
		$product      = wc_get_product( $product_id );

		if ( $product->is_type( 'variation' ) ) {
			$product_id   = $product->get_parent_id();
			$variation_id = $product->get_id();
		}

		$request['cart_item_data'] = (array) apply_filters(
			'woocommerce_add_cart_item_data',
			$request['cart_item_data'],
			$product_id,
			$variation_id,
			$request['quantity']
		);

		if ( $product->is_sold_individually() ) {
			$request['quantity'] = apply_filters( 'woocommerce_add_to_cart_sold_individually_quantity', 1, $request['quantity'], $product_id, $variation_id, $request['cart_item_data'] );
		}

		return $request;
	}

	/**
	 * If variations are set, validate and format the values ready to add to the cart.
	 *
	 * @throws RouteException Exception if invalid data is detected.
	 *
	 * @param array $request Add to cart request params.
	 * @return array Updated request array.
	 */
	protected function parse_variation_data( $request ) {
		$product = $this->get_product_for_cart( $request );

		// Remove variation request if not needed.
		if ( ! $product->is_type( array( 'variation', 'variable' ) ) ) {
			$request['variation'] = [];
			return $request;
		}

		// Flatten data and format posted values.
		$variable_product_attributes = $this->get_variable_product_attributes( $product );
		$request['variation']        = $this->sanitize_variation_data( wp_list_pluck( $request['variation'], 'value', 'attribute' ), $variable_product_attributes );

		// If we have a parent product, find the variation ID.
		if ( $product->is_type( 'variable' ) ) {
			$request['id'] = $this->get_variation_id_from_variation_data( $request, $product );
		}

		// Now we have a variation ID, get the valid set of attributes for this variation. They will have an attribute_ prefix since they are from meta.
		$expected_attributes = wc_get_product_variation_attributes( $request['id'] );
		$missing_attributes  = [];

		foreach ( $variable_product_attributes as $attribute ) {
			if ( ! $attribute['is_variation'] ) {
				continue;
			}

			$prefixed_attribute_name = 'attribute_' . sanitize_title( $attribute['name'] );
			$expected_value          = isset( $expected_attributes[ $prefixed_attribute_name ] ) ? $expected_attributes[ $prefixed_attribute_name ] : '';
			$attribute_label         = wc_attribute_label( $attribute['name'] );

			if ( isset( $request['variation'][ wc_variation_attribute_name( $attribute['name'] ) ] ) ) {
				$given_value = $request['variation'][ wc_variation_attribute_name( $attribute['name'] ) ];

				if ( $expected_value === $given_value ) {
					continue;
				}

				// If valid values are empty, this is an 'any' variation so get all possible values.
				if ( '' === $expected_value && in_array( $given_value, $attribute->get_slugs(), true ) ) {
					continue;
				}

				throw new RouteException(
					'woocommerce_rest_invalid_variation_data',
					/* translators: %1$s: Attribute name, %2$s: Allowed values. */
					sprintf( __( 'Invalid value posted for %1$s. Allowed values: %2$s', 'woocommerce' ), $attribute_label, implode( ', ', $attribute->get_slugs() ) ),
					400
				);
			}

			// If no attribute was posted, only error if the variation has an 'any' attribute which requires a value.
			if ( '' === $expected_value ) {
				$missing_attributes[] = $attribute_label;
			}
		}

		if ( ! empty( $missing_attributes ) ) {
			throw new RouteException(
				'woocommerce_rest_missing_variation_data',
				/* translators: %s: Attribute name. */
				__( 'Missing variation data for variable product.', 'woocommerce' ) . ' ' . sprintf( _n( '%s is a required field', '%s are required fields', count( $missing_attributes ), 'woocommerce' ), wc_format_list_of_items( $missing_attributes ) ),
				400
			);
		}

		return $request;
	}

	/**
	 * Try to match request data to a variation ID and return the ID.
	 *
	 * @throws RouteException Exception if variation cannot be found.
	 *
	 * @param array       $request Add to cart request params.
	 * @param \WC_Product $product Product being added to the cart.
	 * @return int Matching variation ID.
	 */
	protected function get_variation_id_from_variation_data( $request, $product ) {
		$data_store       = \WC_Data_Store::load( 'product' );
		$match_attributes = $request['variation'];
		$variation_id     = $data_store->find_matching_product_variation( $product, $match_attributes );

		if ( empty( $variation_id ) ) {
			throw new RouteException(
				'woocommerce_rest_variation_id_from_variation_data',
				__( 'No matching variation found.', 'woocommerce' ),
				400
			);
		}

		return $variation_id;
	}

	/**
	 * Format and sanitize variation data posted to the API.
	 *
	 * Labels are converted to names (e.g. Size to pa_size), and values are cleaned.
	 *
	 * @throws RouteException Exception if variation cannot be found.
	 *
	 * @param array $variation_data Key value pairs of attributes and values.
	 * @param array $variable_product_attributes Product attributes we're expecting.
	 * @return array
	 */
	protected function sanitize_variation_data( $variation_data, $variable_product_attributes ) {
		$return = [];

		foreach ( $variable_product_attributes as $attribute ) {
			if ( ! $attribute['is_variation'] ) {
				continue;
			}
			$attribute_label          = wc_attribute_label( $attribute['name'] );
			$variation_attribute_name = wc_variation_attribute_name( $attribute['name'] );

			// Attribute labels e.g. Size.
			if ( isset( $variation_data[ $attribute_label ] ) ) {
				$return[ $variation_attribute_name ] =
					$attribute['is_taxonomy']
						?
						sanitize_title( $variation_data[ $attribute_label ] )
						:
						html_entity_decode(
							wc_clean( $variation_data[ $attribute_label ] ),
							ENT_QUOTES,
							get_bloginfo( 'charset' )
						);
				continue;
			}

			// Attribute slugs e.g. pa_size.
			if ( isset( $variation_data[ $attribute['name'] ] ) ) {
				$return[ $variation_attribute_name ] =
					$attribute['is_taxonomy']
						?
						sanitize_title( $variation_data[ $attribute['name'] ] )
						:
						html_entity_decode(
							wc_clean( $variation_data[ $attribute['name'] ] ),
							ENT_QUOTES,
							get_bloginfo( 'charset' )
						);
			}
		}
		return $return;
	}

	/**
	 * Get product attributes from the variable product (which may be the parent if the product object is a variation).
	 *
	 * @throws RouteException Exception if product is invalid.
	 *
	 * @param \WC_Product $product Product being added to the cart.
	 * @return array
	 */
	protected function get_variable_product_attributes( $product ) {
		if ( $product->is_type( 'variation' ) ) {
			$product = wc_get_product( $product->get_parent_id() );
		}

		if ( ! $product || 'trash' === $product->get_status() ) {
			throw new RouteException(
				'woocommerce_rest_cart_invalid_parent_product',
				__( 'This product cannot be added to the cart.', 'woocommerce' ),
				400
			);
		}

		return $product->get_attributes();
	}
}
woocommerce-blocks/src/StoreApi/Utilities/TooManyInCartException.php000064400000000532151335517640021717 0ustar00<?php
namespace Automattic\WooCommerce\Blocks\StoreApi\Utilities;

/**
 * TooManyInCartException class.
 *
 * @internal This API is used internally by Blocks, this exception is thrown when more than one of a product that
 * can only be purchased individually is in a cart.
 */
class TooManyInCartException extends StockAvailabilityException {

}
woocommerce-blocks/src/StoreApi/Routes/Products.php000064400000031674151335517640016475 0ustar00<?php
namespace Automattic\WooCommerce\Blocks\StoreApi\Routes;

use Automattic\WooCommerce\Blocks\StoreApi\Utilities\Pagination;
use Automattic\WooCommerce\Blocks\StoreApi\Utilities\ProductQuery;

/**
 * Products class.
 *
 * @internal This API is used internally by Blocks--it is still in flux and may be subject to revisions.
 */
class Products extends AbstractRoute {
	/**
	 * Get the path of this REST route.
	 *
	 * @return string
	 */
	public function get_path() {
		return '/products';
	}

	/**
	 * Get method arguments for this REST route.
	 *
	 * @return array An array of endpoints.
	 */
	public function get_args() {
		return [
			[
				'methods'             => \WP_REST_Server::READABLE,
				'callback'            => [ $this, 'get_response' ],
				'permission_callback' => '__return_true',
				'args'                => $this->get_collection_params(),
			],
			'schema' => [ $this->schema, 'get_public_item_schema' ],
		];
	}

	/**
	 * Get a collection of posts and add the post title filter option to \WP_Query.
	 *
	 * @throws RouteException On error.
	 * @param \WP_REST_Request $request Request object.
	 * @return \WP_REST_Response
	 */
	protected function get_route_response( \WP_REST_Request $request ) {
		$response      = new \WP_REST_Response();
		$product_query = new ProductQuery();

		// Only get objects during GET requests.
		if ( \WP_REST_Server::READABLE === $request->get_method() ) {
			$query_results    = $product_query->get_objects( $request );
			$response_objects = [];

			foreach ( $query_results['objects'] as $object ) {
				$data               = rest_ensure_response( $this->schema->get_item_response( $object ) );
				$response_objects[] = $this->prepare_response_for_collection( $data );
			}

			$response->set_data( $response_objects );
		} else {
			$query_results = $product_query->get_results( $request );
		}

		$response = ( new Pagination() )->add_headers( $response, $request, $query_results['total'], $query_results['pages'] );
		$response->header( 'Last-Modified', $product_query->get_last_modified() );

		return $response;
	}

	/**
	 * Prepare links for the request.
	 *
	 * @param \WC_Product      $item Product object.
	 * @param \WP_REST_Request $request Request object.
	 * @return array
	 */
	protected function prepare_links( $item, $request ) {
		$links = array(
			'self'       => array(
				'href' => rest_url( $this->get_namespace() . $this->get_path() . '/' . $item->get_id() ),
			),
			'collection' => array(
				'href' => rest_url( $this->get_namespace() . $this->get_path() ),
			),
		);

		if ( $item->get_parent_id() ) {
			$links['up'] = array(
				'href' => rest_url( $this->get_namespace() . $this->get_path() . '/' . $item->get_parent_id() ),
			);
		}

		return $links;
	}

	/**
	 * Get the query params for collections of products.
	 *
	 * @return array
	 */
	public function get_collection_params() {
		$params                       = [];
		$params['context']            = $this->get_context_param();
		$params['context']['default'] = 'view';

		$params['page'] = array(
			'description'       => __( 'Current page of the collection.', 'woocommerce' ),
			'type'              => 'integer',
			'default'           => 1,
			'sanitize_callback' => 'absint',
			'validate_callback' => 'rest_validate_request_arg',
			'minimum'           => 1,
		);

		$params['per_page'] = array(
			'description'       => __( 'Maximum number of items to be returned in result set. Defaults to no limit if left blank.', 'woocommerce' ),
			'type'              => 'integer',
			'default'           => 10,
			'minimum'           => 0,
			'maximum'           => 100,
			'sanitize_callback' => 'absint',
			'validate_callback' => 'rest_validate_request_arg',
		);

		$params['search'] = array(
			'description'       => __( 'Limit results to those matching a string.', 'woocommerce' ),
			'type'              => 'string',
			'sanitize_callback' => 'sanitize_text_field',
			'validate_callback' => 'rest_validate_request_arg',
		);

		$params['after'] = array(
			'description'       => __( 'Limit response to resources created after a given ISO8601 compliant date.', 'woocommerce' ),
			'type'              => 'string',
			'format'            => 'date-time',
			'validate_callback' => 'rest_validate_request_arg',
		);

		$params['before'] = array(
			'description'       => __( 'Limit response to resources created before a given ISO8601 compliant date.', 'woocommerce' ),
			'type'              => 'string',
			'format'            => 'date-time',
			'validate_callback' => 'rest_validate_request_arg',
		);

		$params['date_column'] = array(
			'description'       => __( 'When limiting response using after/before, which date column to compare against.', 'woocommerce' ),
			'type'              => 'string',
			'default'           => 'date',
			'enum'              => array(
				'date',
				'date_gmt',
				'modified',
				'modified_gmt',
			),
			'validate_callback' => 'rest_validate_request_arg',
		);

		$params['exclude'] = array(
			'description'       => __( 'Ensure result set excludes specific IDs.', 'woocommerce' ),
			'type'              => 'array',
			'items'             => array(
				'type' => 'integer',
			),
			'default'           => [],
			'sanitize_callback' => 'wp_parse_id_list',
		);

		$params['include'] = array(
			'description'       => __( 'Limit result set to specific ids.', 'woocommerce' ),
			'type'              => 'array',
			'items'             => array(
				'type' => 'integer',
			),
			'default'           => [],
			'sanitize_callback' => 'wp_parse_id_list',
		);

		$params['offset'] = array(
			'description'       => __( 'Offset the result set by a specific number of items.', 'woocommerce' ),
			'type'              => 'integer',
			'sanitize_callback' => 'absint',
			'validate_callback' => 'rest_validate_request_arg',
		);

		$params['order'] = array(
			'description'       => __( 'Order sort attribute ascending or descending.', 'woocommerce' ),
			'type'              => 'string',
			'default'           => 'desc',
			'enum'              => array( 'asc', 'desc' ),
			'validate_callback' => 'rest_validate_request_arg',
		);

		$params['orderby'] = array(
			'description'       => __( 'Sort collection by object attribute.', 'woocommerce' ),
			'type'              => 'string',
			'default'           => 'date',
			'enum'              => array(
				'date',
				'modified',
				'id',
				'include',
				'title',
				'slug',
				'price',
				'popularity',
				'rating',
				'menu_order',
				'comment_count',
			),
			'validate_callback' => 'rest_validate_request_arg',
		);

		$params['parent'] = array(
			'description'       => __( 'Limit result set to those of particular parent IDs.', 'woocommerce' ),
			'type'              => 'array',
			'items'             => array(
				'type' => 'integer',
			),
			'default'           => [],
			'sanitize_callback' => 'wp_parse_id_list',
		);

		$params['parent_exclude'] = array(
			'description'       => __( 'Limit result set to all items except those of a particular parent ID.', 'woocommerce' ),
			'type'              => 'array',
			'items'             => array(
				'type' => 'integer',
			),
			'sanitize_callback' => 'wp_parse_id_list',
			'default'           => [],
		);

		$params['type'] = array(
			'description'       => __( 'Limit result set to products assigned a specific type.', 'woocommerce' ),
			'type'              => 'string',
			'enum'              => array_merge( array_keys( wc_get_product_types() ), [ 'variation' ] ),
			'sanitize_callback' => 'sanitize_key',
			'validate_callback' => 'rest_validate_request_arg',
		);

		$params['sku'] = array(
			'description'       => __( 'Limit result set to products with specific SKU(s). Use commas to separate.', 'woocommerce' ),
			'type'              => 'string',
			'sanitize_callback' => 'sanitize_text_field',
			'validate_callback' => 'rest_validate_request_arg',
		);

		$params['featured'] = array(
			'description'       => __( 'Limit result set to featured products.', 'woocommerce' ),
			'type'              => 'boolean',
			'sanitize_callback' => 'wc_string_to_bool',
			'validate_callback' => 'rest_validate_request_arg',
		);

		$params['category'] = array(
			'description'       => __( 'Limit result set to products assigned a specific category ID.', 'woocommerce' ),
			'type'              => 'string',
			'sanitize_callback' => 'wp_parse_id_list',
			'validate_callback' => 'rest_validate_request_arg',
		);

		$params['category_operator'] = array(
			'description'       => __( 'Operator to compare product category terms.', 'woocommerce' ),
			'type'              => 'string',
			'enum'              => [ 'in', 'not in', 'and' ],
			'default'           => 'in',
			'sanitize_callback' => 'sanitize_key',
			'validate_callback' => 'rest_validate_request_arg',
		);

		$params['tag'] = array(
			'description'       => __( 'Limit result set to products assigned a specific tag ID.', 'woocommerce' ),
			'type'              => 'string',
			'sanitize_callback' => 'wp_parse_id_list',
			'validate_callback' => 'rest_validate_request_arg',
		);

		$params['tag_operator'] = array(
			'description'       => __( 'Operator to compare product tags.', 'woocommerce' ),
			'type'              => 'string',
			'enum'              => [ 'in', 'not in', 'and' ],
			'default'           => 'in',
			'sanitize_callback' => 'sanitize_key',
			'validate_callback' => 'rest_validate_request_arg',
		);

		$params['on_sale'] = array(
			'description'       => __( 'Limit result set to products on sale.', 'woocommerce' ),
			'type'              => 'boolean',
			'sanitize_callback' => 'wc_string_to_bool',
			'validate_callback' => 'rest_validate_request_arg',
		);

		$params['min_price'] = array(
			'description'       => __( 'Limit result set to products based on a minimum price, provided using the smallest unit of the currency.', 'woocommerce' ),
			'type'              => 'string',
			'sanitize_callback' => 'sanitize_text_field',
			'validate_callback' => 'rest_validate_request_arg',
		);

		$params['max_price'] = array(
			'description'       => __( 'Limit result set to products based on a maximum price, provided using the smallest unit of the currency.', 'woocommerce' ),
			'type'              => 'string',
			'sanitize_callback' => 'sanitize_text_field',
			'validate_callback' => 'rest_validate_request_arg',
		);

		$params['stock_status'] = array(
			'description' => __( 'Limit result set to products with specified stock status.', 'woocommerce' ),
			'type'        => 'array',
			'items'       => array(
				'type'              => 'string',
				'enum'              => array_keys( wc_get_product_stock_status_options() ),
				'sanitize_callback' => 'sanitize_text_field',
				'validate_callback' => 'rest_validate_request_arg',
			),
			'default'     => [],
		);

		$params['attributes'] = array(
			'description' => __( 'Limit result set to products with selected global attributes.', 'woocommerce' ),
			'type'        => 'array',
			'items'       => array(
				'type'       => 'object',
				'properties' => array(
					'attribute' => array(
						'description'       => __( 'Attribute taxonomy name.', 'woocommerce' ),
						'type'              => 'string',
						'sanitize_callback' => 'wc_sanitize_taxonomy_name',
					),
					'term_id'   => array(
						'description'       => __( 'List of attribute term IDs.', 'woocommerce' ),
						'type'              => 'array',
						'items'             => [
							'type' => 'integer',
						],
						'sanitize_callback' => 'wp_parse_id_list',
					),
					'slug'      => array(
						'description'       => __( 'List of attribute slug(s). If a term ID is provided, this will be ignored.', 'woocommerce' ),
						'type'              => 'array',
						'items'             => [
							'type' => 'string',
						],
						'sanitize_callback' => 'wp_parse_slug_list',
					),
					'operator'  => array(
						'description' => __( 'Operator to compare product attribute terms.', 'woocommerce' ),
						'type'        => 'string',
						'enum'        => [ 'in', 'not in', 'and' ],
					),
				),
			),
			'default'     => [],
		);

		$params['attribute_relation'] = array(
			'description'       => __( 'The logical relationship between attributes when filtering across multiple at once.', 'woocommerce' ),
			'type'              => 'string',
			'enum'              => [ 'in', 'and' ],
			'default'           => 'and',
			'sanitize_callback' => 'sanitize_key',
			'validate_callback' => 'rest_validate_request_arg',
		);

		$params['catalog_visibility'] = array(
			'description'       => __( 'Determines if hidden or visible catalog products are shown.', 'woocommerce' ),
			'type'              => 'string',
			'enum'              => array( 'any', 'visible', 'catalog', 'search', 'hidden' ),
			'sanitize_callback' => 'sanitize_key',
			'validate_callback' => 'rest_validate_request_arg',
		);

		$params['rating'] = array(
			'description'       => __( 'Limit result set to products with a certain average rating.', 'woocommerce' ),
			'type'              => 'array',
			'items'             => array(
				'type' => 'integer',
				'enum' => range( 1, 5 ),
			),
			'default'           => [],
			'sanitize_callback' => 'wp_parse_id_list',
		);

		return $params;
	}
}
woocommerce-blocks/src/StoreApi/Routes/Batch.php000064400000006257151335517640015712 0ustar00<?php
namespace Automattic\WooCommerce\Blocks\StoreApi\Routes;

use WP_Error;
use WP_REST_Request;
use WP_REST_Response;

/**
 * Batch Route class.
 *
 * @internal This API is used internally by Blocks--it is still in flux and may be subject to revisions.
 */
class Batch extends AbstractRoute implements RouteInterface {
	/**
	 * Get the path of this REST route.
	 *
	 * @return string
	 */
	public function get_path() {
		return '/batch';
	}

	/**
	 * Constructor.
	 */
	public function __construct() {}

	/**
	 * Get arguments for this REST route.
	 *
	 * @return array An array of endpoints.
	 */
	public function get_args() {
		return array(
			'callback'            => [ $this, 'get_response' ],
			'methods'             => 'POST',
			'permission_callback' => '__return_true',
			'args'                => array(
				'validation' => array(
					'type'    => 'string',
					'enum'    => array( 'require-all-validate', 'normal' ),
					'default' => 'normal',
				),
				'requests'   => array(
					'required' => true,
					'type'     => 'array',
					'maxItems' => 25,
					'items'    => array(
						'type'       => 'object',
						'properties' => array(
							'method'  => array(
								'type'    => 'string',
								'enum'    => array( 'POST', 'PUT', 'PATCH', 'DELETE' ),
								'default' => 'POST',
							),
							'path'    => array(
								'type'     => 'string',
								'required' => true,
							),
							'body'    => array(
								'type'                 => 'object',
								'properties'           => array(),
								'additionalProperties' => true,
							),
							'headers' => array(
								'type'                 => 'object',
								'properties'           => array(),
								'additionalProperties' => array(
									'type'  => array( 'string', 'array' ),
									'items' => array(
										'type' => 'string',
									),
								),
							),
						),
					),
				),
			),
		);
	}

	/**
	 * Get the route response.
	 *
	 * @see WP_REST_Server::serve_batch_request_v1
	 * https://developer.wordpress.org/reference/classes/wp_rest_server/serve_batch_request_v1/
	 *
	 * @throws RouteException On error.
	 *
	 * @param WP_REST_Request $request Request object.
	 * @return WP_REST_Response
	 */
	public function get_response( WP_REST_Request $request ) {
		try {
			foreach ( $request['requests'] as $args ) {
				if ( ! stristr( $args['path'], 'wc/store' ) ) {
					throw new RouteException( 'woocommerce_rest_invalid_path', __( 'Invalid path provided.', 'woocommerce' ), 400 );
				}
			}
			$response = rest_get_server()->serve_batch_request_v1( $request );
		} catch ( RouteException $error ) {
			$response = $this->get_route_error_response( $error->getErrorCode(), $error->getMessage(), $error->getCode(), $error->getAdditionalData() );
		} catch ( \Exception $error ) {
			$response = $this->get_route_error_response( 'unknown_server_error', $error->getMessage(), 500 );
		}

		if ( is_wp_error( $response ) ) {
			$response = $this->error_to_response( $response );
		}

		$response->header( 'X-WC-Store-API-Nonce', wp_create_nonce( 'wc_store_api' ) );
		$response->header( 'X-WC-Store-API-Nonce-Timestamp', time() );
		$response->header( 'X-WC-Store-API-User', get_current_user_id() );

		return $response;
	}
}
woocommerce-blocks/src/StoreApi/Routes/ProductAttributeTerms.php000064400000003134151335517640021177 0ustar00<?php
namespace Automattic\WooCommerce\Blocks\StoreApi\Routes;

/**
 * ProductAttributeTerms class.
 *
 * @internal This API is used internally by Blocks--it is still in flux and may be subject to revisions.
 */
class ProductAttributeTerms extends AbstractTermsRoute {
	/**
	 * Get the path of this REST route.
	 *
	 * @return string
	 */
	public function get_path() {
		return '/products/attributes/(?P<attribute_id>[\d]+)/terms';
	}

	/**
	 * Get method arguments for this REST route.
	 *
	 * @return array An array of endpoints.
	 */
	public function get_args() {
		return [
			'args'   => array(
				'attribute_id' => array(
					'description' => __( 'Unique identifier for the attribute.', 'woocommerce' ),
					'type'        => 'integer',
				),
			),
			[
				'methods'             => \WP_REST_Server::READABLE,
				'callback'            => [ $this, 'get_response' ],
				'permission_callback' => '__return_true',
				'args'                => $this->get_collection_params(),
			],
			'schema' => [ $this->schema, 'get_public_item_schema' ],
		];
	}

	/**
	 * Get a collection of attribute terms.
	 *
	 * @throws RouteException On error.
	 * @param \WP_REST_Request $request Request object.
	 * @return \WP_REST_Response
	 */
	protected function get_route_response( \WP_REST_Request $request ) {
		$attribute = wc_get_attribute( $request['attribute_id'] );

		if ( ! $attribute || ! taxonomy_exists( $attribute->slug ) ) {
			throw new RouteException( 'woocommerce_rest_taxonomy_invalid', __( 'Attribute does not exist.', 'woocommerce' ), 404 );
		}

		return $this->get_terms_response( $attribute->slug, $request );
	}
}
woocommerce-blocks/src/StoreApi/Routes/CartItems.php000064400000007052151335517640016556 0ustar00<?php
namespace Automattic\WooCommerce\Blocks\StoreApi\Routes;

/**
 * CartItems class.
 *
 * @internal This API is used internally by Blocks--it is still in flux and may be subject to revisions.
 */
class CartItems extends AbstractCartRoute {
	/**
	 * Get the path of this REST route.
	 *
	 * @return string
	 */
	public function get_path() {
		return '/cart/items';
	}

	/**
	 * Get method arguments for this REST route.
	 *
	 * @return array An array of endpoints.
	 */
	public function get_args() {
		return [
			[
				'methods'             => \WP_REST_Server::READABLE,
				'callback'            => [ $this, 'get_response' ],
				'permission_callback' => '__return_true',
				'args'                => [
					'context' => $this->get_context_param( [ 'default' => 'view' ] ),
				],
			],
			[
				'methods'             => \WP_REST_Server::CREATABLE,
				'callback'            => array( $this, 'get_response' ),
				'permission_callback' => '__return_true',
				'args'                => $this->schema->get_endpoint_args_for_item_schema( \WP_REST_Server::CREATABLE ),
			],
			[
				'methods'             => \WP_REST_Server::DELETABLE,
				'callback'            => [ $this, 'get_response' ],
				'permission_callback' => '__return_true',
			],
			'schema'      => [ $this->schema, 'get_public_item_schema' ],
			'allow_batch' => [ 'v1' => true ],
		];
	}

	/**
	 * Get a collection of cart items.
	 *
	 * @throws RouteException On error.
	 * @param \WP_REST_Request $request Request object.
	 * @return \WP_REST_Response
	 */
	protected function get_route_response( \WP_REST_Request $request ) {
		$cart_items = $this->cart_controller->get_cart_items();
		$items      = [];

		foreach ( $cart_items as $cart_item ) {
			$data    = $this->prepare_item_for_response( $cart_item, $request );
			$items[] = $this->prepare_response_for_collection( $data );
		}

		$response = rest_ensure_response( $items );

		return $response;
	}

	/**
	 * Creates one item from the collection.
	 *
	 * @throws RouteException On error.
	 * @param \WP_REST_Request $request Request object.
	 * @return \WP_REST_Response
	 */
	protected function get_route_post_response( \WP_REST_Request $request ) {
		// Do not allow key to be specified during creation.
		if ( ! empty( $request['key'] ) ) {
			throw new RouteException( 'woocommerce_rest_cart_item_exists', __( 'Cannot create an existing cart item.', 'woocommerce' ), 400 );
		}

		$result = $this->cart_controller->add_to_cart(
			[
				'id'        => $request['id'],
				'quantity'  => $request['quantity'],
				'variation' => $request['variation'],
			]
		);

		$response = rest_ensure_response( $this->prepare_item_for_response( $this->cart_controller->get_cart_item( $result ), $request ) );
		$response->set_status( 201 );
		return $response;
	}

	/**
	 * Deletes all items in the cart.
	 *
	 * @throws RouteException On error.
	 * @param \WP_REST_Request $request Request object.
	 * @return \WP_REST_Response
	 */
	protected function get_route_delete_response( \WP_REST_Request $request ) {
		$this->cart_controller->empty_cart();
		return new \WP_REST_Response( [], 200 );
	}

	/**
	 * Prepare links for the request.
	 *
	 * @param array            $cart_item Object to prepare.
	 * @param \WP_REST_Request $request Request object.
	 * @return array
	 */
	protected function prepare_links( $cart_item, $request ) {
		$base  = $this->get_namespace() . $this->get_path();
		$links = array(
			'self'       => array(
				'href' => rest_url( trailingslashit( $base ) . $cart_item['key'] ),
			),
			'collection' => array(
				'href' => rest_url( $base ),
			),
		);
		return $links;
	}
}
woocommerce-blocks/src/StoreApi/Routes/ProductAttributesById.php000064400000003244151335517640021121 0ustar00<?php
namespace Automattic\WooCommerce\Blocks\StoreApi\Routes;

/**
 * ProductAttributesById class.
 *
 * @internal This API is used internally by Blocks--it is still in flux and may be subject to revisions.
 */
class ProductAttributesById extends AbstractRoute {
	/**
	 * Get the path of this REST route.
	 *
	 * @return string
	 */
	public function get_path() {
		return '/products/attributes/(?P<id>[\d]+)';
	}

	/**
	 * Get method arguments for this REST route.
	 *
	 * @return array An array of endpoints.
	 */
	public function get_args() {
		return [
			'args'   => array(
				'id' => array(
					'description' => __( 'Unique identifier for the resource.', 'woocommerce' ),
					'type'        => 'integer',
				),
			),
			[
				'methods'             => \WP_REST_Server::READABLE,
				'callback'            => [ $this, 'get_response' ],
				'permission_callback' => '__return_true',
				'args'                => array(
					'context' => $this->get_context_param(
						array(
							'default' => 'view',
						)
					),
				),
			],
			'schema' => [ $this->schema, 'get_public_item_schema' ],
		];
	}

	/**
	 * Get a single item.
	 *
	 * @throws RouteException On error.
	 * @param \WP_REST_Request $request Request object.
	 * @return \WP_REST_Response
	 */
	protected function get_route_response( \WP_REST_Request $request ) {
		$object = wc_get_attribute( (int) $request['id'] );

		if ( ! $object || 0 === $object->id ) {
			throw new RouteException( 'woocommerce_rest_attribute_invalid_id', __( 'Invalid attribute ID.', 'woocommerce' ), 404 );
		}

		$data     = $this->prepare_item_for_response( $object, $request );
		$response = rest_ensure_response( $data );

		return $response;
	}
}
woocommerce-blocks/src/StoreApi/Routes/CartItemsByKey.php000064400000007454151335517640017530 0ustar00<?php
namespace Automattic\WooCommerce\Blocks\StoreApi\Routes;

/**
 * CartItemsByKey class.
 *
 * @internal This API is used internally by Blocks--it is still in flux and may be subject to revisions.
 */
class CartItemsByKey extends AbstractCartRoute {
	/**
	 * Get the path of this REST route.
	 *
	 * @return string
	 */
	public function get_path() {
		return '/cart/items/(?P<key>[\w-]{32})';
	}

	/**
	 * Get method arguments for this REST route.
	 *
	 * @return array An array of endpoints.
	 */
	public function get_args() {
		return [
			'args'        => [
				'key' => [
					'description' => __( 'Unique identifier for the item within the cart.', 'woocommerce' ),
					'type'        => 'string',
				],
			],
			[
				'methods'             => \WP_REST_Server::READABLE,
				'callback'            => [ $this, 'get_response' ],
				'permission_callback' => '__return_true',
				'args'                => [
					'context' => $this->get_context_param( [ 'default' => 'view' ] ),
				],
			],
			[
				'methods'             => \WP_REST_Server::EDITABLE,
				'callback'            => array( $this, 'get_response' ),
				'permission_callback' => '__return_true',
				'args'                => $this->schema->get_endpoint_args_for_item_schema( \WP_REST_Server::EDITABLE ),
			],
			[
				'methods'             => \WP_REST_Server::DELETABLE,
				'callback'            => [ $this, 'get_response' ],
				'permission_callback' => '__return_true',
			],
			'schema'      => [ $this->schema, 'get_public_item_schema' ],
			'allow_batch' => [ 'v1' => true ],
		];
	}

	/**
	 * Get a single cart items.
	 *
	 * @throws RouteException On error.
	 * @param \WP_REST_Request $request Request object.
	 * @return \WP_REST_Response
	 */
	protected function get_route_response( \WP_REST_Request $request ) {
		$cart_item = $this->cart_controller->get_cart_item( $request['key'] );

		if ( empty( $cart_item ) ) {
			throw new RouteException( 'woocommerce_rest_cart_invalid_key', __( 'Cart item does not exist.', 'woocommerce' ), 404 );
		}

		$data     = $this->prepare_item_for_response( $cart_item, $request );
		$response = rest_ensure_response( $data );

		return $response;
	}

	/**
	 * Update a single cart item.
	 *
	 * @throws RouteException On error.
	 * @param \WP_REST_Request $request Request object.
	 * @return \WP_REST_Response
	 */
	protected function get_route_update_response( \WP_REST_Request $request ) {
		$cart = $this->cart_controller->get_cart_instance();

		if ( isset( $request['quantity'] ) ) {
			$this->cart_controller->set_cart_item_quantity( $request['key'], $request['quantity'] );
		}

		return rest_ensure_response( $this->prepare_item_for_response( $this->cart_controller->get_cart_item( $request['key'] ), $request ) );
	}

	/**
	 * Delete a single cart item.
	 *
	 * @throws RouteException On error.
	 * @param \WP_REST_Request $request Request object.
	 * @return \WP_REST_Response
	 */
	protected function get_route_delete_response( \WP_REST_Request $request ) {
		$cart      = $this->cart_controller->get_cart_instance();
		$cart_item = $this->cart_controller->get_cart_item( $request['key'] );

		if ( empty( $cart_item ) ) {
			throw new RouteException( 'woocommerce_rest_cart_invalid_key', __( 'Cart item does not exist.', 'woocommerce' ), 404 );
		}

		$cart->remove_cart_item( $request['key'] );

		return new \WP_REST_Response( null, 204 );
	}

	/**
	 * Prepare links for the request.
	 *
	 * @param array            $cart_item Object to prepare.
	 * @param \WP_REST_Request $request Request object.
	 * @return array
	 */
	protected function prepare_links( $cart_item, $request ) {
		$base  = $this->get_namespace() . $this->get_path();
		$links = array(
			'self'       => array(
				'href' => rest_url( trailingslashit( $base ) . $cart_item['key'] ),
			),
			'collection' => array(
				'href' => rest_url( $base ),
			),
		);
		return $links;
	}
}
woocommerce-blocks/src/StoreApi/Routes/ProductReviews.php000064400000015020151335517640017642 0ustar00<?php
namespace Automattic\WooCommerce\Blocks\StoreApi\Routes;

use WP_Comment_Query;
use Automattic\WooCommerce\Blocks\StoreApi\Utilities\Pagination;

/**
 * ProductReviews class.
 *
 * @internal This API is used internally by Blocks--it is still in flux and may be subject to revisions.
 */
class ProductReviews extends AbstractRoute {
	/**
	 * Get the path of this REST route.
	 *
	 * @return string
	 */
	public function get_path() {
		return '/products/reviews';
	}

	/**
	 * Get method arguments for this REST route.
	 *
	 * @return array An array of endpoints.
	 */
	public function get_args() {
		return [
			[
				'methods'             => \WP_REST_Server::READABLE,
				'callback'            => [ $this, 'get_response' ],
				'permission_callback' => '__return_true',
				'args'                => $this->get_collection_params(),
			],
			'schema' => [ $this->schema, 'get_public_item_schema' ],
		];
	}

	/**
	 * Get a collection of reviews.
	 *
	 * @throws RouteException On error.
	 * @param \WP_REST_Request $request Request object.
	 * @return \WP_REST_Response
	 */
	protected function get_route_response( \WP_REST_Request $request ) {
		$prepared_args = array(
			'type'          => 'review',
			'status'        => 'approve',
			'no_found_rows' => false,
			'offset'        => $request['offset'],
			'order'         => $request['order'],
			'number'        => $request['per_page'],
			'post__in'      => $request['product_id'],
		);

		/**
		 * Map category id to list of product ids.
		 */
		if ( ! empty( $request['category_id'] ) ) {
			$category_ids = $request['category_id'];
			$child_ids    = [];
			foreach ( $category_ids as $category_id ) {
				$child_ids = array_merge( $child_ids, get_term_children( $category_id, 'product_cat' ) );
			}
			$category_ids              = array_unique( array_merge( $category_ids, $child_ids ) );
			$product_ids               = get_objects_in_term( $category_ids, 'product_cat' );
			$prepared_args['post__in'] = isset( $prepared_args['post__in'] ) ? array_merge( $prepared_args['post__in'], $product_ids ) : $product_ids;
		}

		if ( 'rating' === $request['orderby'] ) {
			$prepared_args['meta_query'] = array( // phpcs:ignore
				'relation' => 'OR',
				array(
					'key'     => 'rating',
					'compare' => 'EXISTS',
				),
				array(
					'key'     => 'rating',
					'compare' => 'NOT EXISTS',
				),
			);
		}
		$prepared_args['orderby'] = $this->normalize_query_param( $request['orderby'] );

		if ( empty( $request['offset'] ) ) {
			$prepared_args['offset'] = $prepared_args['number'] * ( absint( $request['page'] ) - 1 );
		}

		$query            = new WP_Comment_Query();
		$query_result     = $query->query( $prepared_args );
		$response_objects = array();

		foreach ( $query_result as $review ) {
			$data               = $this->prepare_item_for_response( $review, $request );
			$response_objects[] = $this->prepare_response_for_collection( $data );
		}

		$total_reviews = (int) $query->found_comments;
		$max_pages     = (int) $query->max_num_pages;

		if ( $total_reviews < 1 ) {
			// Out-of-bounds, run the query again without LIMIT for total count.
			unset( $prepared_args['number'], $prepared_args['offset'] );

			$query                  = new WP_Comment_Query();
			$prepared_args['count'] = true;

			$total_reviews = $query->query( $prepared_args );
			$max_pages     = $request['per_page'] ? ceil( $total_reviews / $request['per_page'] ) : 1;
		}

		$response = rest_ensure_response( $response_objects );
		$response = ( new Pagination() )->add_headers( $response, $request, $total_reviews, $max_pages );

		return $response;
	}

	/**
	 * Prepends internal property prefix to query parameters to match our response fields.
	 *
	 * @param string $query_param Query parameter.
	 * @return string
	 */
	protected function normalize_query_param( $query_param ) {
		$prefix = 'comment_';

		switch ( $query_param ) {
			case 'id':
				$normalized = $prefix . 'ID';
				break;
			case 'product':
				$normalized = $prefix . 'post_ID';
				break;
			case 'rating':
				$normalized = 'meta_value_num';
				break;
			default:
				$normalized = $prefix . $query_param;
				break;
		}

		return $normalized;
	}

	/**
	 * Get the query params for collections of products.
	 *
	 * @return array
	 */
	public function get_collection_params() {
		$params                       = array();
		$params['context']            = $this->get_context_param();
		$params['context']['default'] = 'view';

		$params['page'] = array(
			'description'       => __( 'Current page of the collection.', 'woocommerce' ),
			'type'              => 'integer',
			'default'           => 1,
			'sanitize_callback' => 'absint',
			'validate_callback' => 'rest_validate_request_arg',
			'minimum'           => 1,
		);

		$params['per_page'] = array(
			'description'       => __( 'Maximum number of items to be returned in result set. Defaults to no limit if left blank.', 'woocommerce' ),
			'type'              => 'integer',
			'default'           => 10,
			'minimum'           => 0,
			'maximum'           => 100,
			'sanitize_callback' => 'absint',
			'validate_callback' => 'rest_validate_request_arg',
		);

		$params['offset'] = array(
			'description'       => __( 'Offset the result set by a specific number of items.', 'woocommerce' ),
			'type'              => 'integer',
			'sanitize_callback' => 'absint',
			'validate_callback' => 'rest_validate_request_arg',
		);

		$params['order'] = array(
			'description'       => __( 'Order sort attribute ascending or descending.', 'woocommerce' ),
			'type'              => 'string',
			'default'           => 'desc',
			'enum'              => array( 'asc', 'desc' ),
			'validate_callback' => 'rest_validate_request_arg',
		);

		$params['orderby'] = array(
			'description'       => __( 'Sort collection by object attribute.', 'woocommerce' ),
			'type'              => 'string',
			'default'           => 'date',
			'enum'              => array(
				'date',
				'date_gmt',
				'id',
				'rating',
				'product',
			),
			'validate_callback' => 'rest_validate_request_arg',
		);

		$params['category_id'] = array(
			'description'       => __( 'Limit result set to reviews from specific category IDs.', 'woocommerce' ),
			'type'              => 'string',
			'sanitize_callback' => 'wp_parse_id_list',
			'validate_callback' => 'rest_validate_request_arg',
		);

		$params['product_id'] = array(
			'description'       => __( 'Limit result set to reviews from specific product IDs.', 'woocommerce' ),
			'type'              => 'string',
			'sanitize_callback' => 'wp_parse_id_list',
			'validate_callback' => 'rest_validate_request_arg',
		);

		return $params;
	}
}
woocommerce-blocks/src/StoreApi/Routes/CartCouponsByCode.php000064400000004621151335517640020210 0ustar00<?php
namespace Automattic\WooCommerce\Blocks\StoreApi\Routes;

/**
 * CartCouponsByCode class.
 *
 * @internal This API is used internally by Blocks--it is still in flux and may be subject to revisions.
 */
class CartCouponsByCode extends AbstractCartRoute {
	/**
	 * Get the path of this REST route.
	 *
	 * @return string
	 */
	public function get_path() {
		return '/cart/coupons/(?P<code>[\w-]+)';
	}

	/**
	 * Get method arguments for this REST route.
	 *
	 * @return array An array of endpoints.
	 */
	public function get_args() {
		return [
			'args'        => [
				'code' => [
					'description' => __( 'Unique identifier for the coupon within the cart.', 'woocommerce' ),
					'type'        => 'string',
				],
			],
			[
				'methods'             => \WP_REST_Server::READABLE,
				'callback'            => [ $this, 'get_response' ],
				'permission_callback' => '__return_true',
				'args'                => [
					'context' => $this->get_context_param( [ 'default' => 'view' ] ),
				],
			],
			[
				'methods'             => \WP_REST_Server::DELETABLE,
				'callback'            => [ $this, 'get_response' ],
				'permission_callback' => '__return_true',
			],
			'schema'      => [ $this->schema, 'get_public_item_schema' ],
			'allow_batch' => [ 'v1' => true ],
		];
	}

	/**
	 * Get a single cart coupon.
	 *
	 * @throws RouteException On error.
	 * @param \WP_REST_Request $request Request object.
	 * @return \WP_REST_Response
	 */
	protected function get_route_response( \WP_REST_Request $request ) {
		if ( ! $this->cart_controller->has_coupon( $request['code'] ) ) {
			throw new RouteException( 'woocommerce_rest_cart_coupon_invalid_code', __( 'Coupon does not exist in the cart.', 'woocommerce' ), 404 );
		}

		return $this->prepare_item_for_response( $request['code'], $request );
	}

	/**
	 * Delete a single cart coupon.
	 *
	 * @throws RouteException On error.
	 * @param \WP_REST_Request $request Request object.
	 * @return \WP_REST_Response
	 */
	protected function get_route_delete_response( \WP_REST_Request $request ) {
		if ( ! $this->cart_controller->has_coupon( $request['code'] ) ) {
			throw new RouteException( 'woocommerce_rest_cart_coupon_invalid_code', __( 'Coupon does not exist in the cart.', 'woocommerce' ), 404 );
		}

		$cart = $this->cart_controller->get_cart_instance();

		$cart->remove_coupon( $request['code'] );
		$cart->calculate_totals();

		return new \WP_REST_Response( null, 204 );
	}
}
woocommerce-blocks/src/StoreApi/Routes/ProductCategories.php000064400000002166151335517640020312 0ustar00<?php
namespace Automattic\WooCommerce\Blocks\StoreApi\Routes;

/**
 * ProductCategories class.
 *
 * @internal This API is used internally by Blocks--it is still in flux and may be subject to revisions.
 */
class ProductCategories extends AbstractTermsRoute {
	/**
	 * Get the path of this REST route.
	 *
	 * @return string
	 */
	public function get_path() {
		return '/products/categories';
	}

	/**
	 * Get method arguments for this REST route.
	 *
	 * @return array An array of endpoints.
	 */
	public function get_args() {
		return [
			[
				'methods'             => \WP_REST_Server::READABLE,
				'callback'            => [ $this, 'get_response' ],
				'permission_callback' => '__return_true',
				'args'                => $this->get_collection_params(),
			],
			'schema' => [ $this->schema, 'get_public_item_schema' ],
		];
	}

	/**
	 * Get a collection of terms.
	 *
	 * @throws RouteException On error.
	 * @param \WP_REST_Request $request Request object.
	 * @return \WP_REST_Response
	 */
	protected function get_route_response( \WP_REST_Request $request ) {
		return $this->get_terms_response( 'product_cat', $request );
	}
}
woocommerce-blocks/src/StoreApi/Routes/CartCoupons.php000064400000007221151335517640017121 0ustar00<?php
namespace Automattic\WooCommerce\Blocks\StoreApi\Routes;

/**
 * CartCoupons class.
 *
 * @internal This API is used internally by Blocks--it is still in flux and may be subject to revisions.
 */
class CartCoupons extends AbstractCartRoute {
	/**
	 * Get the path of this REST route.
	 *
	 * @return string
	 */
	public function get_path() {
		return '/cart/coupons';
	}

	/**
	 * Get method arguments for this REST route.
	 *
	 * @return array An array of endpoints.
	 */
	public function get_args() {
		return [
			[
				'methods'             => \WP_REST_Server::READABLE,
				'callback'            => [ $this, 'get_response' ],
				'permission_callback' => '__return_true',
				'args'                => [
					'context' => $this->get_context_param( [ 'default' => 'view' ] ),
				],
			],
			[
				'methods'             => \WP_REST_Server::CREATABLE,
				'callback'            => [ $this, 'get_response' ],
				'permission_callback' => '__return_true',
				'args'                => $this->schema->get_endpoint_args_for_item_schema( \WP_REST_Server::CREATABLE ),
			],
			[
				'methods'             => \WP_REST_Server::DELETABLE,
				'permission_callback' => '__return_true',
				'callback'            => [ $this, 'get_response' ],
			],
			'schema'      => [ $this->schema, 'get_public_item_schema' ],
			'allow_batch' => [ 'v1' => true ],
		];
	}

	/**
	 * Get a collection of cart coupons.
	 *
	 * @throws RouteException On error.
	 * @param \WP_REST_Request $request Request object.
	 * @return \WP_REST_Response
	 */
	protected function get_route_response( \WP_REST_Request $request ) {
		$cart_coupons = $this->cart_controller->get_cart_coupons();
		$items        = [];

		foreach ( $cart_coupons as $coupon_code ) {
			$response = rest_ensure_response( $this->schema->get_item_response( $coupon_code ) );
			$response->add_links( $this->prepare_links( $coupon_code, $request ) );

			$response = $this->prepare_response_for_collection( $response );
			$items[]  = $response;
		}

		$response = rest_ensure_response( $items );

		return $response;
	}

	/**
	 * Add a coupon to the cart and return the result.
	 *
	 * @throws RouteException On error.
	 * @param \WP_REST_Request $request Request object.
	 * @return \WP_REST_Response
	 */
	protected function get_route_post_response( \WP_REST_Request $request ) {
		if ( ! wc_coupons_enabled() ) {
			throw new RouteException( 'woocommerce_rest_cart_coupon_disabled', __( 'Coupons are disabled.', 'woocommerce' ), 404 );
		}

		try {
			$this->cart_controller->apply_coupon( $request['code'] );
		} catch ( \WC_REST_Exception $e ) {
			throw new RouteException( $e->getErrorCode(), $e->getMessage(), $e->getCode() );
		}

		$response = $this->prepare_item_for_response( $request['code'], $request );
		$response->set_status( 201 );

		return $response;
	}

	/**
	 * Deletes all coupons in the cart.
	 *
	 * @throws RouteException On error.
	 * @param \WP_REST_Request $request Request object.
	 * @return \WP_REST_Response
	 */
	protected function get_route_delete_response( \WP_REST_Request $request ) {
		$cart = $this->cart_controller->get_cart_instance();

		$cart->remove_coupons();
		$cart->calculate_totals();

		return new \WP_REST_Response( [], 200 );
	}

	/**
	 * Prepare links for the request.
	 *
	 * @param string           $coupon_code Coupon code.
	 * @param \WP_REST_Request $request Request object.
	 * @return array
	 */
	protected function prepare_links( $coupon_code, $request ) {
		$base  = $this->get_namespace() . $this->get_path();
		$links = array(
			'self'       => array(
				'href' => rest_url( trailingslashit( $base ) . $coupon_code ),
			),
			'collection' => array(
				'href' => rest_url( $base ),
			),
		);
		return $links;
	}
}
woocommerce-blocks/src/StoreApi/Routes/CartApplyCoupon.php000064400000003503151335517640017743 0ustar00<?php
namespace Automattic\WooCommerce\Blocks\StoreApi\Routes;

/**
 * CartApplyCoupon class.
 *
 * @internal This API is used internally by Blocks--it is still in flux and may be subject to revisions.
 */
class CartApplyCoupon extends AbstractCartRoute {
	/**
	 * Get the path of this REST route.
	 *
	 * @return string
	 */
	public function get_path() {
		return '/cart/apply-coupon';
	}

	/**
	 * Get method arguments for this REST route.
	 *
	 * @return array An array of endpoints.
	 */
	public function get_args() {
		return [
			[
				'methods'             => \WP_REST_Server::CREATABLE,
				'callback'            => [ $this, 'get_response' ],
				'permission_callback' => '__return_true',
				'args'                => [
					'code' => [
						'description' => __( 'Unique identifier for the coupon within the cart.', 'woocommerce' ),
						'type'        => 'string',
					],
				],
			],
			'schema'      => [ $this->schema, 'get_public_item_schema' ],
			'allow_batch' => [ 'v1' => true ],
		];
	}

	/**
	 * Handle the request and return a valid response for this endpoint.
	 *
	 * @throws RouteException On error.
	 * @param \WP_REST_Request $request Request object.
	 * @return \WP_REST_Response
	 */
	protected function get_route_post_response( \WP_REST_Request $request ) {
		if ( ! wc_coupons_enabled() ) {
			throw new RouteException( 'woocommerce_rest_cart_coupon_disabled', __( 'Coupons are disabled.', 'woocommerce' ), 404 );
		}

		$cart        = $this->cart_controller->get_cart_instance();
		$coupon_code = wc_format_coupon_code( wp_unslash( $request['code'] ) );

		try {
			$this->cart_controller->apply_coupon( $coupon_code );
		} catch ( \WC_REST_Exception $e ) {
			throw new RouteException( $e->getErrorCode(), $e->getMessage(), $e->getCode() );
		}

		return rest_ensure_response( $this->schema->get_item_response( $cart ) );
	}
}
woocommerce-blocks/src/StoreApi/Routes/ProductCollectionData.php000064400000014124151335517640021107 0ustar00<?php
namespace Automattic\WooCommerce\Blocks\StoreApi\Routes;

use Automattic\WooCommerce\Blocks\StoreApi\Utilities\ProductQueryFilters;

/**
 * ProductCollectionData route.
 * Get aggregate data from a collection of products.
 *
 * Supports the same parameters as /products, but returns a different response.
 *
 * @internal This API is used internally by Blocks--it is still in flux and may be subject to revisions.
 */
class ProductCollectionData extends AbstractRoute {
	/**
	 * Get the path of this REST route.
	 *
	 * @return string
	 */
	public function get_path() {
		return '/products/collection-data';
	}

	/**
	 * Get method arguments for this REST route.
	 *
	 * @return array An array of endpoints.
	 */
	public function get_args() {
		return [
			[
				'methods'             => \WP_REST_Server::READABLE,
				'callback'            => [ $this, 'get_response' ],
				'permission_callback' => '__return_true',
				'args'                => $this->get_collection_params(),
			],
			'schema' => [ $this->schema, 'get_public_item_schema' ],
		];
	}

	/**
	 * Get a collection of posts and add the post title filter option to \WP_Query.
	 *
	 * @throws RouteException On error.
	 * @param \WP_REST_Request $request Request object.
	 * @return \WP_REST_Response
	 */
	protected function get_route_response( \WP_REST_Request $request ) {
		$data    = [
			'min_price'           => null,
			'max_price'           => null,
			'attribute_counts'    => null,
			'stock_status_counts' => null,
			'rating_counts'       => null,
		];
		$filters = new ProductQueryFilters();

		if ( ! empty( $request['calculate_price_range'] ) ) {
			$filter_request = clone $request;
			$filter_request->set_param( 'min_price', null );
			$filter_request->set_param( 'max_price', null );

			$price_results     = $filters->get_filtered_price( $filter_request );
			$data['min_price'] = $price_results->min_price;
			$data['max_price'] = $price_results->max_price;
		}

		if ( ! empty( $request['calculate_stock_status_counts'] ) ) {
			$filter_request = clone $request;
			$counts         = $filters->get_stock_status_counts( $filter_request );

			$data['stock_status_counts'] = [];

			foreach ( $counts as $key => $value ) {
				$data['stock_status_counts'][] = (object) [
					'status' => $key,
					'count'  => $value,
				];
			}
		}

		if ( ! empty( $request['calculate_attribute_counts'] ) ) {
			$taxonomy__or_queries  = [];
			$taxonomy__and_queries = [];

			foreach ( $request['calculate_attribute_counts'] as $attributes_to_count ) {
				if ( ! empty( $attributes_to_count['taxonomy'] ) ) {
					if ( empty( $attributes_to_count['query_type'] ) || 'or' === $attributes_to_count['query_type'] ) {
						$taxonomy__or_queries[] = $attributes_to_count['taxonomy'];
					} else {
						$taxonomy__and_queries[] = $attributes_to_count['taxonomy'];
					}
				}
			}

			$data['attribute_counts'] = [];
			// Or type queries need special handling because the attribute, if set, needs removing from the query first otherwise counts would not be correct.
			if ( $taxonomy__or_queries ) {
				foreach ( $taxonomy__or_queries as $taxonomy ) {
					$filter_request    = clone $request;
					$filter_attributes = $filter_request->get_param( 'attributes' );

					if ( ! empty( $filter_attributes ) ) {
						$filter_attributes = array_filter(
							$filter_attributes,
							function( $query ) use ( $taxonomy ) {
								return $query['attribute'] !== $taxonomy;
							}
						);
					}

					$filter_request->set_param( 'attributes', $filter_attributes );
					$counts = $filters->get_attribute_counts( $filter_request, [ $taxonomy ] );

					foreach ( $counts as $key => $value ) {
						$data['attribute_counts'][] = (object) [
							'term'  => $key,
							'count' => $value,
						];
					}
				}
			}

			if ( $taxonomy__and_queries ) {
				$counts = $filters->get_attribute_counts( $request, $taxonomy__and_queries );

				foreach ( $counts as $key => $value ) {
					$data['attribute_counts'][] = (object) [
						'term'  => $key,
						'count' => $value,
					];
				}
			}
		}

		if ( ! empty( $request['calculate_rating_counts'] ) ) {
			$filter_request        = clone $request;
			$counts                = $filters->get_rating_counts( $filter_request );
			$data['rating_counts'] = [];

			foreach ( $counts as $key => $value ) {
				$data['rating_counts'][] = (object) [
					'rating' => $key,
					'count'  => $value,
				];
			}
		}

		return rest_ensure_response( $this->schema->get_item_response( $data ) );
	}

	/**
	 * Get the query params for collections of products.
	 *
	 * @return array
	 */
	public function get_collection_params() {
		$params = ( new Products( $this->schema ) )->get_collection_params();

		$params['calculate_price_range'] = [
			'description' => __( 'If true, calculates the minimum and maximum product prices for the collection.', 'woocommerce' ),
			'type'        => 'boolean',
			'default'     => false,
		];

		$params['calculate_stock_status_counts'] = [
			'description' => __( 'If true, calculates stock counts for products in the collection.', 'woocommerce' ),
			'type'        => 'boolean',
			'default'     => false,
		];

		$params['calculate_attribute_counts'] = [
			'description' => __( 'If requested, calculates attribute term counts for products in the collection.', 'woocommerce' ),
			'type'        => 'array',
			'items'       => [
				'type'       => 'object',
				'properties' => [
					'taxonomy'   => [
						'description' => __( 'Taxonomy name.', 'woocommerce' ),
						'type'        => 'string',
						'context'     => [ 'view', 'edit' ],
						'readonly'    => true,
					],
					'query_type' => [
						'description' => __( 'Query type being performed which may affect counts. Valid values include "and" and "or".', 'woocommerce' ),
						'type'        => 'string',
						'enum'        => [ 'and', 'or' ],
						'context'     => [ 'view', 'edit' ],
						'readonly'    => true,
					],
				],
			],
			'default'     => [],
		];

		$params['calculate_rating_counts'] = [
			'description' => __( 'If true, calculates rating counts for products in the collection.', 'woocommerce' ),
			'type'        => 'boolean',
			'default'     => false,
		];

		return $params;
	}
}
woocommerce-blocks/src/StoreApi/Routes/CartRemoveItem.php000064400000003321151335517640017544 0ustar00<?php
namespace Automattic\WooCommerce\Blocks\StoreApi\Routes;

/**
 * CartRemoveItem class.
 *
 * @internal This API is used internally by Blocks--it is still in flux and may be subject to revisions.
 */
class CartRemoveItem extends AbstractCartRoute {
	/**
	 * Get the path of this REST route.
	 *
	 * @return string
	 */
	public function get_path() {
		return '/cart/remove-item';
	}

	/**
	 * Get method arguments for this REST route.
	 *
	 * @return array An array of endpoints.
	 */
	public function get_args() {
		return [
			[
				'methods'             => \WP_REST_Server::CREATABLE,
				'callback'            => [ $this, 'get_response' ],
				'permission_callback' => '__return_true',
				'args'                => [
					'key' => [
						'description' => __( 'Unique identifier (key) for the cart item.', 'woocommerce' ),
						'type'        => 'string',
					],
				],
			],
			'schema'      => [ $this->schema, 'get_public_item_schema' ],
			'allow_batch' => [ 'v1' => true ],
		];
	}

	/**
	 * Handle the request and return a valid response for this endpoint.
	 *
	 * @throws RouteException On error.
	 * @param \WP_REST_Request $request Request object.
	 * @return \WP_REST_Response
	 */
	protected function get_route_post_response( \WP_REST_Request $request ) {
		$cart      = $this->cart_controller->get_cart_instance();
		$cart_item = $this->cart_controller->get_cart_item( $request['key'] );

		if ( empty( $cart_item ) ) {
			throw new RouteException( 'woocommerce_rest_cart_invalid_key', __( 'Cart item no longer exists or is invalid.', 'woocommerce' ), 409 );
		}

		$cart->remove_cart_item( $request['key'] );
		$this->maybe_release_stock();

		return rest_ensure_response( $this->schema->get_item_response( $cart ) );
	}
}
woocommerce-blocks/src/StoreApi/Routes/Checkout.php000064400000052136151335517640016433 0ustar00<?php
namespace Automattic\WooCommerce\Blocks\StoreApi\Routes;

use Automattic\WooCommerce\Blocks\StoreApi\Utilities\InvalidStockLevelsInCartException;
use Automattic\WooCommerce\Blocks\Package;
use Automattic\WooCommerce\Blocks\Domain\Services\CreateAccount;
use Automattic\WooCommerce\Blocks\StoreApi\Schemas\AbstractSchema;
use Automattic\WooCommerce\Blocks\StoreApi\Schemas\CartSchema;
use Automattic\WooCommerce\Blocks\StoreApi\Utilities\CartController;
use Automattic\WooCommerce\Blocks\StoreApi\Utilities\OrderController;
use Automattic\WooCommerce\Checkout\Helpers\ReserveStock;
use Automattic\WooCommerce\Checkout\Helpers\ReserveStockException;
use Automattic\WooCommerce\Blocks\Payments\PaymentResult;
use Automattic\WooCommerce\Blocks\Payments\PaymentContext;

/**
 * Checkout class.
 *
 * @internal This API is used internally by Blocks--it is still in flux and may be subject to revisions.
 */
class Checkout extends AbstractCartRoute {
	/**
	 * Holds the current order being processed.
	 *
	 * @var \WC_Order
	 */
	private $order = null;

	/**
	 * Order controller class instance.
	 *
	 * @var OrderController
	 */
	protected $order_controller;

	/**
	 * Constructor accepts two types of schema; one for the item being returned, and one for the cart as a whole. These
	 * may be the same depending on the route.
	 *
	 * @param CartSchema      $cart_schema Schema class for the cart.
	 * @param AbstractSchema  $item_schema Schema class for this route's items if it differs from the cart schema.
	 * @param CartController  $cart_controller Cart controller class.
	 * @param OrderController $order_controller Order controller class.
	 */
	public function __construct( CartSchema $cart_schema, AbstractSchema $item_schema = null, CartController $cart_controller, OrderController $order_controller ) {
		$this->schema           = is_null( $item_schema ) ? $cart_schema : $item_schema;
		$this->cart_schema      = $cart_schema;
		$this->cart_controller  = $cart_controller;
		$this->order_controller = $order_controller;
	}

	/**
	 * Get the path of this REST route.
	 *
	 * @return string
	 */
	public function get_path() {
		return '/checkout';
	}

	/**
	 * Checks if a nonce is required for the route.
	 *
	 * @param \WP_REST_Request $request Request.
	 * @return bool
	 */
	protected function requires_nonce( \WP_REST_Request $request ) {
		return true;
	}

	/**
	 * Get method arguments for this REST route.
	 *
	 * @return array An array of endpoints.
	 */
	public function get_args() {
		return [
			[
				'methods'             => \WP_REST_Server::READABLE,
				'callback'            => [ $this, 'get_response' ],
				'permission_callback' => '__return_true',
				'args'                => [
					'context' => $this->get_context_param( [ 'default' => 'view' ] ),
				],
			],
			[
				'methods'             => \WP_REST_Server::CREATABLE,
				'callback'            => [ $this, 'get_response' ],
				'permission_callback' => '__return_true',
				'args'                => array_merge(
					[
						'payment_data' => [
							'description' => __( 'Data to pass through to the payment method when processing payment.', 'woocommerce' ),
							'type'        => 'array',
							'items'       => [
								'type'       => 'object',
								'properties' => [
									'key'   => [
										'type' => 'string',
									],
									'value' => [
										'type' => [ 'string', 'boolean' ],
									],
								],
							],
						],
					],
					$this->schema->get_endpoint_args_for_item_schema( \WP_REST_Server::CREATABLE )
				),
			],
			[
				'methods'             => \WP_REST_Server::EDITABLE,
				'callback'            => array( $this, 'get_response' ),
				'permission_callback' => '__return_true',
				'args'                => $this->schema->get_endpoint_args_for_item_schema( \WP_REST_Server::EDITABLE ),
			],
			'schema'      => [ $this->schema, 'get_public_item_schema' ],
			'allow_batch' => [ 'v1' => true ],
		];
	}

	/**
	 * Prepare a single item for response. Handles setting the status based on the payment result.
	 *
	 * @param mixed            $item Item to format to schema.
	 * @param \WP_REST_Request $request Request object.
	 * @return \WP_REST_Response $response Response data.
	 */
	public function prepare_item_for_response( $item, \WP_REST_Request $request ) {
		$response     = parent::prepare_item_for_response( $item, $request );
		$status_codes = [
			'success' => 200,
			'pending' => 202,
			'failure' => 400,
			'error'   => 500,
		];

		if ( isset( $item->payment_result ) && $item->payment_result instanceof PaymentResult ) {
			$response->set_status( $status_codes[ $item->payment_result->status ] ?? 200 );
		}

		return $response;
	}

	/**
	 * Convert the cart into a new draft order, or update an existing draft order, and return an updated cart response.
	 *
	 * @throws RouteException On error.
	 * @param \WP_REST_Request $request Request object.
	 * @return \WP_REST_Response
	 */
	protected function get_route_response( \WP_REST_Request $request ) {
		$this->create_or_update_draft_order();

		return $this->prepare_item_for_response(
			(object) [
				'order'          => $this->order,
				'payment_result' => new PaymentResult(),
			],
			$request
		);
	}

	/**
	 * Update the current order.
	 *
	 * @internal Customer data is updated first so OrderController::update_addresses_from_cart uses up to date data.
	 *
	 * @throws RouteException On error.
	 * @param \WP_REST_Request $request Request object.
	 * @return \WP_REST_Response
	 */
	protected function get_route_update_response( \WP_REST_Request $request ) {
		$this->update_customer_from_request( $request );
		$this->create_or_update_draft_order();
		$this->update_order_from_request( $request );

		return $this->prepare_item_for_response(
			(object) [
				'order'          => $this->order,
				'payment_result' => new PaymentResult(),
			],
			$request
		);
	}

	/**
	 * Update and process an order.
	 *
	 * 1. Obtain Draft Order
	 * 2. Process Request
	 * 3. Process Customer
	 * 4. Validate Order
	 * 5. Process Payment
	 *
	 * @throws RouteException On error.
	 * @throws InvalidStockLevelsInCartException On error.
	 *
	 * @param \WP_REST_Request $request Request object.
	 *
	 * @return \WP_REST_Response
	 */
	protected function get_route_post_response( \WP_REST_Request $request ) {
		/**
		 * Validate items etc are allowed in the order before the order is processed. This will fix violations and tell
		 * the customer.
		 */
		$this->cart_controller->validate_cart_items();
		$this->cart_controller->validate_cart_coupons();

		/**
		 * Obtain Draft Order and process request data.
		 *
		 * Note: Customer data is persisted from the request first so that OrderController::update_addresses_from_cart
		 * uses the up to date customer address.
		 */
		$this->update_customer_from_request( $request );
		$this->create_or_update_draft_order();
		$this->update_order_from_request( $request );

		/**
		 * Process customer data.
		 *
		 * Update order with customer details, and sign up a user account as necessary.
		 */
		$this->process_customer( $request );

		/**
		 * Validate order.
		 *
		 * This logic ensures the order is valid before payment is attempted.
		 */
		$this->order_controller->validate_order_before_payment( $this->order );

		/**
		 * WooCommerce Blocks Checkout Order Processed (experimental).
		 *
		 * This hook informs extensions that $order has completed processing and is ready for payment.
		 *
		 * This is similar to existing core hook woocommerce_checkout_order_processed. We're using a new action:
		 * - To keep the interface focused (only pass $order, not passing request data).
		 * - This also explicitly indicates these orders are from checkout block/StoreAPI.
		 *
		 * @see https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/3238
		 * @internal This Hook is experimental and may change or be removed.
		 *
		 * @param \WC_Order $order Order object.
		 */
		do_action( '__experimental_woocommerce_blocks_checkout_order_processed', $this->order );

		/**
		 * Process the payment and return the results.
		 */
		$payment_result = new PaymentResult();

		if ( $this->order->needs_payment() ) {
			$this->process_payment( $request, $payment_result );
		} else {
			$this->process_without_payment( $request, $payment_result );
		}

		return $this->prepare_item_for_response(
			(object) [
				'order'          => wc_get_order( $this->order ),
				'payment_result' => $payment_result,
			],
			$request
		);
	}

	/**
	 * Get route response when something went wrong.
	 *
	 * @param string $error_code String based error code.
	 * @param string $error_message User facing error message.
	 * @param int    $http_status_code HTTP status. Defaults to 500.
	 * @param array  $additional_data  Extra data (key value pairs) to expose in the error response.
	 * @return \WP_Error WP Error object.
	 */
	protected function get_route_error_response( $error_code, $error_message, $http_status_code = 500, $additional_data = [] ) {
		$error_from_message = new \WP_Error(
			$error_code,
			$error_message
		);
		// 409 is when there was a conflict, so we return the cart so the client can resolve it.
		if ( 409 === $http_status_code ) {
			return $this->add_data_to_error_object( $error_from_message, $additional_data, $http_status_code, true );
		}
		return $this->add_data_to_error_object( $error_from_message, $additional_data, $http_status_code );
	}

	/**
	 * Get route response when something went wrong.
	 *
	 * @param \WP_Error $error_object User facing error message.
	 * @param int       $http_status_code HTTP status. Defaults to 500.
	 * @param array     $additional_data  Extra data (key value pairs) to expose in the error response.
	 * @return \WP_Error WP Error object.
	 */
	protected function get_route_error_response_from_object( $error_object, $http_status_code = 500, $additional_data = [] ) {
		// 409 is when there was a conflict, so we return the cart so the client can resolve it.
		if ( 409 === $http_status_code ) {
			return $this->add_data_to_error_object( $error_object, $additional_data, $http_status_code, true );
		}
		return $this->add_data_to_error_object( $error_object, $additional_data, $http_status_code );
	}

	/**
	 * Adds additional data to the \WP_Error object.
	 *
	 * @param \WP_Error $error The error object to add the cart to.
	 * @param array     $data The data to add to the error object.
	 * @param int       $http_status_code The HTTP status code this error should return.
	 * @param bool      $include_cart Whether the cart should be included in the error data.
	 * @returns \WP_Error The \WP_Error with the cart added.
	 */
	private function add_data_to_error_object( $error, $data, $http_status_code, bool $include_cart = false ) {
		$data = array_merge( $data, [ 'status' => $http_status_code ] );
		if ( $include_cart ) {
			$data = array_merge( $data, [ 'cart' => wc()->api->get_endpoint_data( '/wc/store/cart' ) ] );
		}
		$error->add_data( $data );
		return $error;
	}

	/**
	 * Gets draft order data from the customer session.
	 *
	 * @return array
	 */
	private function get_draft_order_id() {
		return wc()->session->get( 'store_api_draft_order', 0 );
	}

	/**
	 * Updates draft order data in the customer session.
	 *
	 * @param integer $order_id Draft order ID.
	 */
	private function set_draft_order_id( $order_id ) {
		wc()->session->set( 'store_api_draft_order', $order_id );
	}

	/**
	 * Whether the passed argument is a draft order or an order that is
	 * pending/failed and the cart hasn't changed.
	 *
	 * @param \WC_Order $order_object Order object to check.
	 * @return boolean Whether the order is valid as a draft order.
	 */
	private function is_valid_draft_order( $order_object ) {
		if ( ! $order_object instanceof \WC_Order ) {
			return false;
		}

		// Draft orders are okay.
		if ( $order_object->has_status( 'checkout-draft' ) ) {
			return true;
		}

		// Pending and failed orders can be retried if the cart hasn't changed.
		if ( $order_object->needs_payment() && $order_object->has_cart_hash( wc()->cart->get_cart_hash() ) ) {
			return true;
		}

		return false;
	}

	/**
	 * Create or update a draft order based on the cart.
	 *
	 * @throws RouteException On error.
	 */
	private function create_or_update_draft_order() {
		$this->order = $this->get_draft_order_id() ? wc_get_order( $this->get_draft_order_id() ) : null;

		if ( ! $this->is_valid_draft_order( $this->order ) ) {
			$this->order = $this->order_controller->create_order_from_cart();
		} else {
			$this->order_controller->update_order_from_cart( $this->order );
		}

		/**
		 * WooCommerce Blocks Checkout Update Order Meta (experimental).
		 *
		 * This hook gives extensions the chance to add or update meta data on the $order.
		 *
		 * This is similar to existing core hook woocommerce_checkout_update_order_meta.
		 * We're using a new action:
		 * - To keep the interface focused (only pass $order, not passing request data).
		 * - This also explicitly indicates these orders are from checkout block/StoreAPI.
		 *
		 * @see https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/3686
		 * @internal This Hook is experimental and may change or be removed.
		 *
		 * @param \WC_Order $order Order object.
		 */
		do_action( '__experimental_woocommerce_blocks_checkout_update_order_meta', $this->order );

		// Confirm order is valid before proceeding further.
		if ( ! $this->order instanceof \WC_Order ) {
			throw new RouteException(
				'woocommerce_rest_checkout_missing_order',
				__( 'Unable to create order', 'woocommerce' ),
				500
			);
		}

		// Store order ID to session.
		$this->set_draft_order_id( $this->order->get_id() );

		// Try to reserve stock for 10 mins, if available.
		try {
			$reserve_stock = new ReserveStock();
			$reserve_stock->reserve_stock_for_order( $this->order, 10 );
		} catch ( ReserveStockException $e ) {
			$error_data = $e->getErrorData();
			throw new RouteException(
				$e->getErrorCode(),
				$e->getMessage(),
				$e->getCode()
			);
		}
	}

	/**
	 * Updates the current customer session using data from the request (e.g. address data).
	 *
	 * Address session data is synced to the order itself later on by OrderController::update_order_from_cart()
	 *
	 * @param \WP_REST_Request $request Full details about the request.
	 */
	private function update_customer_from_request( \WP_REST_Request $request ) {
		$customer = wc()->customer;

		if ( isset( $request['billing_address'] ) ) {
			foreach ( $request['billing_address'] as $key => $value ) {
				if ( is_callable( [ $customer, "set_billing_$key" ] ) ) {
					$customer->{"set_billing_$key"}( $value );
				}
			}
		}

		if ( isset( $request['shipping_address'] ) ) {
			foreach ( $request['shipping_address'] as $key => $value ) {
				if ( is_callable( [ $customer, "set_shipping_$key" ] ) ) {
					$customer->{"set_shipping_$key"}( $value );
				} elseif ( 'phone' === $key ) {
					$customer->update_meta_data( 'shipping_phone', $value );
				}
			}
		}

		$customer->save();
	}

	/**
	 * Update the current order using the posted values from the request.
	 *
	 * @param \WP_REST_Request $request Full details about the request.
	 */
	private function update_order_from_request( \WP_REST_Request $request ) {
		$this->order->set_customer_note( $request['customer_note'] ?? '' );
		$this->order->set_payment_method( $this->get_request_payment_method( $request ) );

		/**
		 * WooCommerce Blocks Checkout Update Order From Request (experimental).
		 *
		 * This hook gives extensions the chance to update orders based on the data in the request. This can be used in
		 * conjunction with the ExtendRestAPI class to post custom data and then process it.
		 *
		 * @internal This Hook is experimental and may change or be removed.
		 *
		 * @param \WC_Order $order Order object.
		 * @param \WP_REST_Request $request Full details about the request.
		 */
		do_action( '__experimental_woocommerce_blocks_checkout_update_order_from_request', $this->order, $request );

		$this->order->save();
	}

	/**
	 * For orders which do not require payment, just update status.
	 *
	 * @param \WP_REST_Request $request Request object.
	 * @param PaymentResult    $payment_result Payment result object.
	 */
	private function process_without_payment( \WP_REST_Request $request, PaymentResult $payment_result ) {
		// Transition the order to pending, and then completed. This ensures transactional emails fire for pending_to_complete events.
		$this->order->update_status( 'pending' );
		$this->order->payment_complete();

		// Mark the payment as successful.
		$payment_result->set_status( 'success' );
		$payment_result->set_redirect_url( $this->order->get_checkout_order_received_url() );
	}

	/**
	 * Fires an action hook instructing active payment gateways to process the payment for an order and provide a result.
	 *
	 * @throws RouteException On error.
	 *
	 * @param \WP_REST_Request $request Request object.
	 * @param PaymentResult    $payment_result Payment result object.
	 */
	private function process_payment( \WP_REST_Request $request, PaymentResult $payment_result ) {
		try {
			// Transition the order to pending before making payment.
			$this->order->update_status( 'pending' );

			// Prepare the payment context object to pass through payment hooks.
			$context = new PaymentContext();
			$context->set_payment_method( $this->get_request_payment_method_id( $request ) );
			$context->set_payment_data( $this->get_request_payment_data( $request ) );
			$context->set_order( $this->order );

			/**
			 * Process payment with context.
			 *
			 * @hook woocommerce_rest_checkout_process_payment_with_context
			 *
			 * @throws \Exception If there is an error taking payment, an \Exception object can be thrown with an error message.
			 *
			 * @param PaymentContext $context        Holds context for the payment, including order ID and payment method.
			 * @param PaymentResult  $payment_result Result object for the transaction.
			 */
			do_action_ref_array( 'woocommerce_rest_checkout_process_payment_with_context', [ $context, &$payment_result ] );

			if ( ! $payment_result instanceof PaymentResult ) {
				throw new RouteException( 'woocommerce_rest_checkout_invalid_payment_result', __( 'Invalid payment result received from payment method.', 'woocommerce' ), 500 );
			}
		} catch ( \Exception $e ) {
			throw new RouteException( 'woocommerce_rest_checkout_process_payment_error', $e->getMessage(), 400 );
		}
	}

	/**
	 * Gets the chosen payment method ID from the request.
	 *
	 * @throws RouteException On error.
	 * @param \WP_REST_Request $request Request object.
	 * @return string
	 */
	private function get_request_payment_method_id( \WP_REST_Request $request ) {
		$payment_method_id = wc_clean( wp_unslash( $request['payment_method'] ?? '' ) );

		if ( empty( $payment_method_id ) ) {
			throw new RouteException(
				'woocommerce_rest_checkout_missing_payment_method',
				__( 'No payment method provided.', 'woocommerce' ),
				400
			);
		}

		return $payment_method_id;
	}

	/**
	 * Gets the chosen payment method from the request.
	 *
	 * @throws RouteException On error.
	 * @param \WP_REST_Request $request Request object.
	 * @return \WC_Payment_Gateway
	 */
	private function get_request_payment_method( \WP_REST_Request $request ) {
		$payment_method_id  = $this->get_request_payment_method_id( $request );
		$available_gateways = WC()->payment_gateways->get_available_payment_gateways();

		if ( ! isset( $available_gateways[ $payment_method_id ] ) ) {
			throw new RouteException(
				'woocommerce_rest_checkout_payment_method_disabled',
				__( 'This payment gateway is not available.', 'woocommerce' ),
				400
			);
		}

		return $available_gateways[ $payment_method_id ];
	}

	/**
	 * Gets and formats payment request data.
	 *
	 * @param \WP_REST_Request $request Request object.
	 * @return array
	 */
	private function get_request_payment_data( \WP_REST_Request $request ) {
		static $payment_data = [];
		if ( ! empty( $payment_data ) ) {
			return $payment_data;
		}
		if ( ! empty( $request['payment_data'] ) ) {
			foreach ( $request['payment_data'] as $data ) {
				$payment_data[ sanitize_key( $data['key'] ) ] = wc_clean( $data['value'] );
			}
		}

		return $payment_data;
	}

	/**
	 * Order processing relating to customer account.
	 *
	 * Creates a customer account as needed (based on request & store settings) and  updates the order with the new customer ID.
	 * Updates the order with user details (e.g. address).
	 *
	 * @throws RouteException API error object with error details.
	 * @param \WP_REST_Request $request Request object.
	 */
	private function process_customer( \WP_REST_Request $request ) {
		try {
			$create_account = Package::container()->get( CreateAccount::class );
			$create_account->from_order_request( $request );
			$this->order->set_customer_id( get_current_user_id() );
			$this->order->save();
		} catch ( \Exception $error ) {
			switch ( $error->getMessage() ) {
				case 'registration-error-invalid-email':
					throw new RouteException(
						'registration-error-invalid-email',
						__( 'Please provide a valid email address.', 'woocommerce' ),
						400
					);
				case 'registration-error-email-exists':
					throw new RouteException(
						'registration-error-email-exists',
						__( 'An account is already registered with your email address. Please log in before proceeding.', 'woocommerce' ),
						400
					);
			}
		}

		// Persist customer address data to account.
		$this->order_controller->sync_customer_data_with_order( $this->order );
	}
}
woocommerce-blocks/src/StoreApi/Routes/CartUpdateItem.php000064400000003262151335517640017535 0ustar00<?php
namespace Automattic\WooCommerce\Blocks\StoreApi\Routes;

/**
 * CartUpdateItem class.
 *
 * @internal This API is used internally by Blocks--it is still in flux and may be subject to revisions.
 */
class CartUpdateItem extends AbstractCartRoute {
	/**
	 * Get the path of this REST route.
	 *
	 * @return string
	 */
	public function get_path() {
		return '/cart/update-item';
	}

	/**
	 * Get method arguments for this REST route.
	 *
	 * @return array An array of endpoints.
	 */
	public function get_args() {
		return [
			[
				'methods'             => \WP_REST_Server::CREATABLE,
				'callback'            => [ $this, 'get_response' ],
				'permission_callback' => '__return_true',
				'args'                => [
					'key'      => [
						'description' => __( 'Unique identifier (key) for the cart item to update.', 'woocommerce' ),
						'type'        => 'string',
					],
					'quantity' => [
						'description' => __( 'New quantity of the item in the cart.', 'woocommerce' ),
						'type'        => 'integer',
					],
				],
			],
			'schema'      => [ $this->schema, 'get_public_item_schema' ],
			'allow_batch' => [ 'v1' => true ],
		];
	}

	/**
	 * Handle the request and return a valid response for this endpoint.
	 *
	 * @throws RouteException On error.
	 * @param \WP_REST_Request $request Request object.
	 * @return \WP_REST_Response
	 */
	protected function get_route_post_response( \WP_REST_Request $request ) {
		$cart = $this->cart_controller->get_cart_instance();

		if ( isset( $request['quantity'] ) ) {
			$this->cart_controller->set_cart_item_quantity( $request['key'], $request['quantity'] );
		}

		return rest_ensure_response( $this->schema->get_item_response( $cart ) );
	}
}
woocommerce-blocks/src/StoreApi/Routes/CartAddItem.php000064400000005604151335517640017005 0ustar00<?php
namespace Automattic\WooCommerce\Blocks\StoreApi\Routes;

/**
 * CartAddItem class.
 *
 * @internal This API is used internally by Blocks--it is still in flux and may be subject to revisions.
 */
class CartAddItem extends AbstractCartRoute {
	/**
	 * Get the path of this REST route.
	 *
	 * @return string
	 */
	public function get_path() {
		return '/cart/add-item';
	}

	/**
	 * Get method arguments for this REST route.
	 *
	 * @return array An array of endpoints.
	 */
	public function get_args() {
		return [
			[
				'methods'             => \WP_REST_Server::CREATABLE,
				'callback'            => [ $this, 'get_response' ],
				'permission_callback' => '__return_true',
				'args'                => [
					'id'        => [
						'description' => __( 'The cart item product or variation ID.', 'woocommerce' ),
						'type'        => 'integer',
						'context'     => [ 'view', 'edit' ],
						'arg_options' => [
							'sanitize_callback' => 'absint',
						],
					],
					'quantity'  => [
						'description' => __( 'Quantity of this item in the cart.', 'woocommerce' ),
						'type'        => 'integer',
						'context'     => [ 'view', 'edit' ],
						'arg_options' => [
							'sanitize_callback' => 'wc_stock_amount',
						],
					],
					'variation' => [
						'description' => __( 'Chosen attributes (for variations).', 'woocommerce' ),
						'type'        => 'array',
						'context'     => [ 'view', 'edit' ],
						'items'       => [
							'type'       => 'object',
							'properties' => [
								'attribute' => [
									'description' => __( 'Variation attribute name.', 'woocommerce' ),
									'type'        => 'string',
									'context'     => [ 'view', 'edit' ],
								],
								'value'     => [
									'description' => __( 'Variation attribute value.', 'woocommerce' ),
									'type'        => 'string',
									'context'     => [ 'view', 'edit' ],
								],
							],
						],
					],
				],
			],
			'schema'      => [ $this->schema, 'get_public_item_schema' ],
			'allow_batch' => [ 'v1' => true ],
		];
	}

	/**
	 * Handle the request and return a valid response for this endpoint.
	 *
	 * @throws RouteException On error.
	 * @param \WP_REST_Request $request Request object.
	 * @return \WP_REST_Response
	 */
	protected function get_route_post_response( \WP_REST_Request $request ) {
		// Do not allow key to be specified during creation.
		if ( ! empty( $request['key'] ) ) {
			throw new RouteException( 'woocommerce_rest_cart_item_exists', __( 'Cannot create an existing cart item.', 'woocommerce' ), 400 );
		}

		$cart   = $this->cart_controller->get_cart_instance();
		$result = $this->cart_controller->add_to_cart(
			[
				'id'        => $request['id'],
				'quantity'  => $request['quantity'],
				'variation' => $request['variation'],
			]
		);

		$response = rest_ensure_response( $this->schema->get_item_response( $cart ) );
		$response->set_status( 201 );
		return $response;
	}
}
woocommerce-blocks/src/StoreApi/Routes/ProductCategoriesById.php000064400000003213151335517640021054 0ustar00<?php
namespace Automattic\WooCommerce\Blocks\StoreApi\Routes;

/**
 * ProductCategoriesById class.
 *
 * @internal This API is used internally by Blocks--it is still in flux and may be subject to revisions.
 */
class ProductCategoriesById extends AbstractRoute {
	/**
	 * Get the path of this REST route.
	 *
	 * @return string
	 */
	public function get_path() {
		return '/products/categories/(?P<id>[\d]+)';
	}

	/**
	 * Get method arguments for this REST route.
	 *
	 * @return array An array of endpoints.
	 */
	public function get_args() {
		return [
			'args'   => array(
				'id' => array(
					'description' => __( 'Unique identifier for the resource.', 'woocommerce' ),
					'type'        => 'integer',
				),
			),
			[
				'methods'             => \WP_REST_Server::READABLE,
				'callback'            => [ $this, 'get_response' ],
				'permission_callback' => '__return_true',
				'args'                => array(
					'context' => $this->get_context_param(
						array(
							'default' => 'view',
						)
					),
				),
			],
			'schema' => [ $this->schema, 'get_public_item_schema' ],
		];
	}

	/**
	 * Get a single item.
	 *
	 * @throws RouteException On error.
	 * @param \WP_REST_Request $request Request object.
	 * @return \WP_REST_Response
	 */
	protected function get_route_response( \WP_REST_Request $request ) {
		$object = get_term( (int) $request['id'], 'product_cat' );

		if ( ! $object || 0 === $object->id ) {
			throw new RouteException( 'woocommerce_rest_category_invalid_id', __( 'Invalid category ID.', 'woocommerce' ), 404 );
		}

		$data = $this->prepare_item_for_response( $object, $request );
		return rest_ensure_response( $data );
	}
}
woocommerce-blocks/src/StoreApi/Routes/AbstractCartRoute.php000064400000013270151335517640020256 0ustar00<?php
namespace Automattic\WooCommerce\Blocks\StoreApi\Routes;

use Automattic\WooCommerce\Blocks\StoreApi\Utilities\CartController;
use Automattic\WooCommerce\Blocks\StoreApi\Schemas\AbstractSchema;
use Automattic\WooCommerce\Blocks\StoreApi\Schemas\CartSchema;

/**
 * Abstract Cart Route
 *
 * @internal This API is used internally by Blocks--it is still in flux and may be subject to revisions.
 */
abstract class AbstractCartRoute extends AbstractRoute {
	/**
	 * Schema class for this route's response.
	 *
	 * @var AbstractSchema|CartSchema
	 */
	protected $schema;

	/**
	 * Schema class for the cart.
	 *
	 * @var CartSchema
	 */
	protected $cart_schema;

	/**
	 * Cart controller class instance.
	 *
	 * @var CartController
	 */
	protected $cart_controller;

	/**
	 * Constructor accepts two types of schema; one for the item being returned, and one for the cart as a whole. These
	 * may be the same depending on the route.
	 *
	 * @param CartSchema     $cart_schema Schema class for the cart.
	 * @param AbstractSchema $item_schema Schema class for this route's items if it differs from the cart schema.
	 * @param CartController $cart_controller Cart controller class.
	 */
	public function __construct( CartSchema $cart_schema, AbstractSchema $item_schema = null, CartController $cart_controller ) {
		$this->schema          = is_null( $item_schema ) ? $cart_schema : $item_schema;
		$this->cart_schema     = $cart_schema;
		$this->cart_controller = $cart_controller;
	}

	/**
	 * Get the route response based on the type of request.
	 *
	 * @param \WP_REST_Request $request Request object.
	 * @return \WP_Error|\WP_REST_Response
	 */
	public function get_response( \WP_REST_Request $request ) {
		$this->cart_controller->load_cart();
		$this->calculate_totals();

		if ( $this->requires_nonce( $request ) ) {
			$nonce_check = $this->check_nonce( $request );

			if ( is_wp_error( $nonce_check ) ) {
				return $this->add_nonce_headers( $this->error_to_response( $nonce_check ) );
			}
		}

		try {
			$response = parent::get_response( $request );
		} catch ( RouteException $error ) {
			$response = $this->get_route_error_response( $error->getErrorCode(), $error->getMessage(), $error->getCode(), $error->getAdditionalData() );
		} catch ( \Exception $error ) {
			$response = $this->get_route_error_response( 'unknown_server_error', $error->getMessage(), 500 );
		}

		if ( is_wp_error( $response ) ) {
			$response = $this->error_to_response( $response );
		}

		return $this->add_nonce_headers( $response );
	}

	/**
	 * Add nonce headers to a response object.
	 *
	 * @param \WP_REST_Response $response The response object.
	 * @return \WP_REST_Response
	 */
	protected function add_nonce_headers( \WP_REST_Response $response ) {
		$response->header( 'X-WC-Store-API-Nonce', wp_create_nonce( 'wc_store_api' ) );
		$response->header( 'X-WC-Store-API-Nonce-Timestamp', time() );
		$response->header( 'X-WC-Store-API-User', get_current_user_id() );
		return $response;
	}

	/**
	 * Checks if a nonce is required for the route.
	 *
	 * @param \WP_REST_Request $request Request.
	 * @return bool
	 */
	protected function requires_nonce( \WP_REST_Request $request ) {
		return 'GET' !== $request->get_method();
	}

	/**
	 * Ensures the cart totals are calculated before an API response is generated.
	 */
	protected function calculate_totals() {
		wc()->cart->get_cart();
		wc()->cart->calculate_fees();
		wc()->cart->calculate_shipping();
		wc()->cart->calculate_totals();
	}

	/**
	 * If there is a draft order, releases stock.
	 *
	 * @return void
	 */
	protected function maybe_release_stock() {
		$draft_order = wc()->session->get( 'store_api_draft_order', 0 );

		if ( ! $draft_order ) {
			return;
		}

		wc_release_stock_for_order( $draft_order );
	}

	/**
	 * For non-GET endpoints, require and validate a nonce to prevent CSRF attacks.
	 *
	 * Nonces will mismatch if the logged in session cookie is different! If using a client to test, set this cookie
	 * to match the logged in cookie in your browser.
	 *
	 * @param \WP_REST_Request $request Request object.
	 * @return \WP_Error|boolean
	 */
	protected function check_nonce( \WP_REST_Request $request ) {
		$nonce = $request->get_header( 'X-WC-Store-API-Nonce' );

		if ( apply_filters( 'woocommerce_store_api_disable_nonce_check', false ) ) {
			return true;
		}

		if ( null === $nonce ) {
			return $this->get_route_error_response( 'woocommerce_rest_missing_nonce', __( 'Missing the X-WC-Store-API-Nonce header. This endpoint requires a valid nonce.', 'woocommerce' ), 401 );
		}

		if ( ! wp_verify_nonce( $nonce, 'wc_store_api' ) ) {
			return $this->get_route_error_response( 'woocommerce_rest_invalid_nonce', __( 'X-WC-Store-API-Nonce is invalid.', 'woocommerce' ), 403 );
		}

		return true;
	}

	/**
	 * Get route response when something went wrong.
	 *
	 * @param string $error_code String based error code.
	 * @param string $error_message User facing error message.
	 * @param int    $http_status_code HTTP status. Defaults to 500.
	 * @param array  $additional_data  Extra data (key value pairs) to expose in the error response.
	 * @return \WP_Error WP Error object.
	 */
	protected function get_route_error_response( $error_code, $error_message, $http_status_code = 500, $additional_data = [] ) {
		switch ( $http_status_code ) {
			case 409:
				// If there was a conflict, return the cart so the client can resolve it.
				$cart = $this->cart_controller->get_cart_instance();

				return new \WP_Error(
					$error_code,
					$error_message,
					array_merge(
						$additional_data,
						[
							'status' => $http_status_code,
							'cart'   => $this->cart_schema->get_item_response( $cart ),
						]
					)
				);
		}
		return new \WP_Error( $error_code, $error_message, [ 'status' => $http_status_code ] );
	}
}
woocommerce-blocks/src/StoreApi/Routes/ProductAttributes.php000064400000002556151335517640020356 0ustar00<?php
namespace Automattic\WooCommerce\Blocks\StoreApi\Routes;

/**
 * ProductAttributes class.
 *
 * @internal This API is used internally by Blocks--it is still in flux and may be subject to revisions.
 */
class ProductAttributes extends AbstractRoute {
	/**
	 * Get the path of this REST route.
	 *
	 * @return string
	 */
	public function get_path() {
		return '/products/attributes';
	}

	/**
	 * Get method arguments for this REST route.
	 *
	 * @return array An array of endpoints.
	 */
	public function get_args() {
		return [
			[
				'methods'             => \WP_REST_Server::READABLE,
				'callback'            => [ $this, 'get_response' ],
				'permission_callback' => '__return_true',
				'args'                => $this->get_collection_params(),
			],
			'schema' => [ $this->schema, 'get_public_item_schema' ],
		];
	}

	/**
	 * Get a collection of attributes.
	 *
	 * @throws RouteException On error.
	 * @param \WP_REST_Request $request Request object.
	 * @return \WP_REST_Response
	 */
	protected function get_route_response( \WP_REST_Request $request ) {
		$ids    = wc_get_attribute_taxonomy_ids();
		$return = [];

		foreach ( $ids as $id ) {
			$object   = wc_get_attribute( $id );
			$data     = $this->prepare_item_for_response( $object, $request );
			$return[] = $this->prepare_response_for_collection( $data );
		}

		return rest_ensure_response( $return );
	}
}
woocommerce-blocks/src/StoreApi/Routes/CartRemoveCoupon.php000064400000004341151335517640020114 0ustar00<?php
namespace Automattic\WooCommerce\Blocks\StoreApi\Routes;

/**
 * CartRemoveCoupon class.
 *
 * @internal This API is used internally by Blocks--it is still in flux and may be subject to revisions.
 */
class CartRemoveCoupon extends AbstractCartRoute {
	/**
	 * Get the path of this REST route.
	 *
	 * @return string
	 */
	public function get_path() {
		return '/cart/remove-coupon';
	}

	/**
	 * Get method arguments for this REST route.
	 *
	 * @return array An array of endpoints.
	 */
	public function get_args() {
		return [
			[
				'methods'             => \WP_REST_Server::CREATABLE,
				'callback'            => [ $this, 'get_response' ],
				'permission_callback' => '__return_true',
				'args'                => [
					'code' => [
						'description' => __( 'Unique identifier for the coupon within the cart.', 'woocommerce' ),
						'type'        => 'string',
					],
				],
			],
			'schema'      => [ $this->schema, 'get_public_item_schema' ],
			'allow_batch' => [ 'v1' => true ],
		];
	}

	/**
	 * Handle the request and return a valid response for this endpoint.
	 *
	 * @throws RouteException On error.
	 * @param \WP_REST_Request $request Request object.
	 * @return \WP_REST_Response
	 */
	protected function get_route_post_response( \WP_REST_Request $request ) {
		if ( ! wc_coupons_enabled() ) {
			throw new RouteException( 'woocommerce_rest_cart_coupon_disabled', __( 'Coupons are disabled.', 'woocommerce' ), 404 );
		}

		$cart        = $this->cart_controller->get_cart_instance();
		$coupon_code = wc_format_coupon_code( $request['code'] );
		$coupon      = new \WC_Coupon( $coupon_code );

		if ( $coupon->get_code() !== $coupon_code || ! $coupon->is_valid() ) {
			throw new RouteException( 'woocommerce_rest_cart_coupon_error', __( 'Invalid coupon code.', 'woocommerce' ), 400 );
		}

		if ( ! $this->cart_controller->has_coupon( $coupon_code ) ) {
			throw new RouteException( 'woocommerce_rest_cart_coupon_invalid_code', __( 'Coupon cannot be removed because it is not already applied to the cart.', 'woocommerce' ), 409 );
		}

		$cart = $this->cart_controller->get_cart_instance();
		$cart->remove_coupon( $coupon_code );
		$cart->calculate_totals();

		return rest_ensure_response( $this->schema->get_item_response( $cart ) );
	}
}
woocommerce-blocks/src/StoreApi/Routes/RouteInterface.php000064400000001055151335517640017577 0ustar00<?php
namespace Automattic\WooCommerce\Blocks\StoreApi\Routes;

/**
 * RouteInterface.
 *
 * @internal This API is used internally by Blocks--it is still in flux and may be subject to revisions.
 */
interface RouteInterface {
	/**
	 * Get the namespace for this route.
	 *
	 * @return string
	 */
	public function get_namespace();

	/**
	 * Get the path of this REST route.
	 *
	 * @return string
	 */
	public function get_path();

	/**
	 * Get arguments for this REST route.
	 *
	 * @return array An array of endpoints.
	 */
	public function get_args();
}
woocommerce-blocks/src/StoreApi/Routes/ProductTags.php000064400000002144151335517640017117 0ustar00<?php
namespace Automattic\WooCommerce\Blocks\StoreApi\Routes;

/**
 * ProductTags class.
 *
 * @internal This API is used internally by Blocks--it is still in flux and may be subject to revisions.
 */
class ProductTags extends AbstractTermsRoute {
	/**
	 * Get the path of this REST route.
	 *
	 * @return string
	 */
	public function get_path() {
		return '/products/tags';
	}

	/**
	 * Get method arguments for this REST route.
	 *
	 * @return array An array of endpoints.
	 */
	public function get_args() {
		return [
			[
				'methods'             => \WP_REST_Server::READABLE,
				'callback'            => [ $this, 'get_response' ],
				'permission_callback' => '__return_true',
				'args'                => $this->get_collection_params(),
			],
			'schema' => [ $this->schema, 'get_public_item_schema' ],
		];
	}

	/**
	 * Get a collection of terms.
	 *
	 * @throws RouteException On error.
	 * @param \WP_REST_Request $request Request object.
	 * @return \WP_REST_Response
	 */
	protected function get_route_response( \WP_REST_Request $request ) {
		return $this->get_terms_response( 'product_tag', $request );
	}
}
woocommerce-blocks/src/StoreApi/Routes/AbstractRoute.php000064400000021101151335517640017434 0ustar00<?php
namespace Automattic\WooCommerce\Blocks\StoreApi\Routes;

use Automattic\WooCommerce\Blocks\StoreApi\Schemas\AbstractSchema;
use Automattic\WooCommerce\Blocks\StoreApi\Utilities\InvalidStockLevelsInCartException;
use WP_Error;

/**
 * AbstractRoute class.
 *
 * @internal This API is used internally by Blocks--it is still in flux and may be subject to revisions.
 */
abstract class AbstractRoute implements RouteInterface {
	/**
	 * Schema class instance.
	 *
	 * @var AbstractSchema
	 */
	protected $schema;

	/**
	 * Constructor.
	 *
	 * @param AbstractSchema $schema Schema class for this route.
	 */
	public function __construct( AbstractSchema $schema ) {
		$this->schema = $schema;
	}

	/**
	 * Get the namespace for this route.
	 *
	 * @return string
	 */
	public function get_namespace() {
		return 'wc/store';
	}

	/**
	 * Get item schema properties.
	 *
	 * @return array
	 */
	public function get_item_schema() {
		return $this->schema->get_item_schema();
	}

	/**
	 * Get the route response based on the type of request.
	 *
	 * @param \WP_REST_Request $request Request object.
	 * @return \WP_REST_Response
	 */
	public function get_response( \WP_REST_Request $request ) {
		$response = null;
		try {
			switch ( $request->get_method() ) {
				case 'POST':
					$response = $this->get_route_post_response( $request );
					break;
				case 'PUT':
				case 'PATCH':
					$response = $this->get_route_update_response( $request );
					break;
				case 'DELETE':
					$response = $this->get_route_delete_response( $request );
					break;
				default:
					$response = $this->get_route_response( $request );
					break;
			}
		} catch ( RouteException $error ) {
			$response = $this->get_route_error_response( $error->getErrorCode(), $error->getMessage(), $error->getCode(), $error->getAdditionalData() );
		} catch ( InvalidStockLevelsInCartException $error ) {
			$response = $this->get_route_error_response_from_object( $error->getError(), $error->getCode(), $error->getAdditionalData() );
		} catch ( \Exception $error ) {
			$response = $this->get_route_error_response( 'unknown_server_error', $error->getMessage(), 500 );
		}

		if ( is_wp_error( $response ) ) {
			$response = $this->error_to_response( $response );
		}

		return $response;
	}

	/**
	 * Converts an error to a response object. Based on \WP_REST_Server.
	 *
	 * @param WP_Error $error WP_Error instance.
	 * @return WP_REST_Response List of associative arrays with code and message keys.
	 */
	protected function error_to_response( $error ) {
		$error_data = $error->get_error_data();
		$status     = isset( $error_data, $error_data['status'] ) ? $error_data['status'] : 500;
		$errors     = [];

		foreach ( (array) $error->errors as $code => $messages ) {
			foreach ( (array) $messages as $message ) {
				$errors[] = array(
					'code'    => $code,
					'message' => $message,
					'data'    => $error->get_error_data( $code ),
				);
			}
		}

		$data = array_shift( $errors );

		if ( count( $errors ) ) {
			$data['additional_errors'] = $errors;
		}

		return new \WP_REST_Response( $data, $status );
	}

	/**
	 * Get route response for GET requests.
	 *
	 * When implemented, should return a \WP_REST_Response.
	 *
	 * @throws RouteException On error.
	 * @param \WP_REST_Request $request Request object.
	 */
	protected function get_route_response( \WP_REST_Request $request ) {
		throw new RouteException( 'woocommerce_rest_invalid_endpoint', __( 'Method not implemented', 'woocommerce' ), 404 );
	}

	/**
	 * Get route response for POST requests.
	 *
	 * When implemented, should return a \WP_REST_Response.
	 *
	 * @throws RouteException On error.
	 * @param \WP_REST_Request $request Request object.
	 */
	protected function get_route_post_response( \WP_REST_Request $request ) {
		throw new RouteException( 'woocommerce_rest_invalid_endpoint', __( 'Method not implemented', 'woocommerce' ), 404 );
	}

	/**
	 * Get route response for PUT requests.
	 *
	 * When implemented, should return a \WP_REST_Response.
	 *
	 * @throws RouteException On error.
	 * @param \WP_REST_Request $request Request object.
	 */
	protected function get_route_update_response( \WP_REST_Request $request ) {
		throw new RouteException( 'woocommerce_rest_invalid_endpoint', __( 'Method not implemented', 'woocommerce' ), 404 );
	}

	/**
	 * Get route response for DELETE requests.
	 *
	 * When implemented, should return a \WP_REST_Response.
	 *
	 * @throws RouteException On error.
	 * @param \WP_REST_Request $request Request object.
	 */
	protected function get_route_delete_response( \WP_REST_Request $request ) {
		throw new RouteException( 'woocommerce_rest_invalid_endpoint', __( 'Method not implemented', 'woocommerce' ), 404 );
	}

	/**
	 * Get route response when something went wrong.
	 *
	 * @param string $error_code String based error code.
	 * @param string $error_message User facing error message.
	 * @param int    $http_status_code HTTP status. Defaults to 500.
	 * @param array  $additional_data  Extra data (key value pairs) to expose in the error response.
	 * @return \WP_Error WP Error object.
	 */
	protected function get_route_error_response( $error_code, $error_message, $http_status_code = 500, $additional_data = [] ) {
		return new \WP_Error( $error_code, $error_message, array_merge( $additional_data, [ 'status' => $http_status_code ] ) );
	}

	/**
	 * Get route response when something went wrong and the supplied error is a WP_Error. This currently only happens
	 * when an item in the cart is out of stock, partially out of stock, can only be bought individually, or when the
	 * item is not purchasable.
	 *
	 * @param WP_Error $error_object The WP_Error object containing the error.
	 * @param int      $http_status_code HTTP status. Defaults to 500.
	 * @param array    $additional_data  Extra data (key value pairs) to expose in the error response.
	 * @return WP_Error WP Error object.
	 */
	protected function get_route_error_response_from_object( $error_object, $http_status_code = 500, $additional_data = [] ) {
		$error_object->add_data( array_merge( $additional_data, [ 'status' => $http_status_code ] ) );
		return $error_object;
	}

	/**
	 * Prepare a single item for response.
	 *
	 * @param mixed            $item Item to format to schema.
	 * @param \WP_REST_Request $request Request object.
	 * @return \WP_REST_Response $response Response data.
	 */
	public function prepare_item_for_response( $item, \WP_REST_Request $request ) {
		$response = rest_ensure_response( $this->schema->get_item_response( $item ) );
		$response->add_links( $this->prepare_links( $item, $request ) );

		return $response;
	}

	/**
	 * Retrieves the context param.
	 *
	 * Ensures consistent descriptions between endpoints, and populates enum from schema.
	 *
	 * @param array $args Optional. Additional arguments for context parameter. Default empty array.
	 * @return array Context parameter details.
	 */
	protected function get_context_param( $args = array() ) {
		$param_details = array(
			'description'       => __( 'Scope under which the request is made; determines fields present in response.', 'woocommerce' ),
			'type'              => 'string',
			'sanitize_callback' => 'sanitize_key',
			'validate_callback' => 'rest_validate_request_arg',
		);

		$schema = $this->get_item_schema();

		if ( empty( $schema['properties'] ) ) {
			return array_merge( $param_details, $args );
		}

		$contexts = array();

		foreach ( $schema['properties'] as $attributes ) {
			if ( ! empty( $attributes['context'] ) ) {
				$contexts = array_merge( $contexts, $attributes['context'] );
			}
		}

		if ( ! empty( $contexts ) ) {
			$param_details['enum'] = array_unique( $contexts );
			rsort( $param_details['enum'] );
		}

		return array_merge( $param_details, $args );
	}

	/**
	 * Prepares a response for insertion into a collection.
	 *
	 * @param \WP_REST_Response $response Response object.
	 * @return array|mixed Response data, ready for insertion into collection data.
	 */
	protected function prepare_response_for_collection( \WP_REST_Response $response ) {
		$data   = (array) $response->get_data();
		$server = rest_get_server();
		$links  = $server::get_compact_response_links( $response );

		if ( ! empty( $links ) ) {
			$data['_links'] = $links;
		}

		return $data;
	}

	/**
	 * Prepare links for the request.
	 *
	 * @param mixed            $item Item to prepare.
	 * @param \WP_REST_Request $request Request object.
	 * @return array
	 */
	protected function prepare_links( $item, $request ) {
		return [];
	}

	/**
	 * Retrieves the query params for the collections.
	 *
	 * @return array Query parameters for the collection.
	 */
	public function get_collection_params() {
		return array(
			'context' => $this->get_context_param(),
		);
	}
}
woocommerce-blocks/src/StoreApi/Routes/RouteException.php000064400000002575151335517640017645 0ustar00<?php
namespace Automattic\WooCommerce\Blocks\StoreApi\Routes;

/**
 * ReserveStockRouteExceptionException class.
 *
 * @internal This API is used internally by Blocks--it is still in flux and may be subject to revisions.
 */
class RouteException extends \Exception {
	/**
	 * Sanitized error code.
	 *
	 * @var string
	 */
	public $error_code;

	/**
	 * Additional error data.
	 *
	 * @var array
	 */
	public $additional_data = [];

	/**
	 * Setup exception.
	 *
	 * @param string $error_code       Machine-readable error code, e.g `woocommerce_invalid_product_id`.
	 * @param string $message          User-friendly translated error message, e.g. 'Product ID is invalid'.
	 * @param int    $http_status_code Proper HTTP status code to respond with, e.g. 400.
	 * @param array  $additional_data  Extra data (key value pairs) to expose in the error response.
	 */
	public function __construct( $error_code, $message, $http_status_code = 400, $additional_data = [] ) {
		$this->error_code      = $error_code;
		$this->additional_data = array_filter( (array) $additional_data );
		parent::__construct( $message, $http_status_code );
	}

	/**
	 * Returns the error code.
	 *
	 * @return string
	 */
	public function getErrorCode() {
		return $this->error_code;
	}

	/**
	 * Returns additional error data.
	 *
	 * @return array
	 */
	public function getAdditionalData() {
		return $this->additional_data;
	}
}
woocommerce-blocks/src/StoreApi/Routes/Cart.php000064400000002326151335517640015553 0ustar00<?php
namespace Automattic\WooCommerce\Blocks\StoreApi\Routes;

/**
 * Cart class.
 *
 * @internal This API is used internally by Blocks--it is still in flux and may be subject to revisions.
 */
class Cart extends AbstractCartRoute {
	/**
	 * Get the path of this REST route.
	 *
	 * @return string
	 */
	public function get_path() {
		return '/cart';
	}

	/**
	 * Get method arguments for this REST route.
	 *
	 * @return array An array of endpoints.
	 */
	public function get_args() {
		return [
			[
				'methods'             => \WP_REST_Server::READABLE,
				'callback'            => [ $this, 'get_response' ],
				'permission_callback' => '__return_true',
				'args'                => [
					'context' => $this->get_context_param( [ 'default' => 'view' ] ),
				],
			],
			'schema' => [ $this->schema, 'get_public_item_schema' ],
		];
	}

	/**
	 * Handle the request and return a valid response for this endpoint.
	 *
	 * @throws RouteException On error.
	 * @param \WP_REST_Request $request Request object.
	 * @return \WP_REST_Response
	 */
	protected function get_route_response( \WP_REST_Request $request ) {
		return rest_ensure_response( $this->schema->get_item_response( $this->cart_controller->get_cart_instance() ) );
	}
}
woocommerce-blocks/src/StoreApi/Routes/CartSelectShippingRate.php000064400000004543151335517640021234 0ustar00<?php
namespace Automattic\WooCommerce\Blocks\StoreApi\Routes;

/**
 * CartSelectShippingRate class.
 *
 * @internal This API is used internally by Blocks--it is still in flux and may be subject to revisions.
 */
class CartSelectShippingRate extends AbstractCartRoute {
	/**
	 * Get the path of this REST route.
	 *
	 * @return string
	 */
	public function get_path() {
		return '/cart/select-shipping-rate';
	}

	/**
	 * Get method arguments for this REST route.
	 *
	 * @return array An array of endpoints.
	 */
	public function get_args() {
		return [
			[
				'methods'             => \WP_REST_Server::CREATABLE,
				'callback'            => [ $this, 'get_response' ],
				'permission_callback' => '__return_true',
				'args'                => [
					'package_id' => array(
						'description' => __( 'The ID of the package being shipped.', 'woocommerce' ),
						'type'        => [ 'integer', 'string' ],
						'required'    => true,
					),
					'rate_id'    => [
						'description' => __( 'The chosen rate ID for the package.', 'woocommerce' ),
						'type'        => 'string',
						'required'    => true,
					],
				],
			],
			'schema'      => [ $this->schema, 'get_public_item_schema' ],
			'allow_batch' => [ 'v1' => true ],
		];
	}

	/**
	 * Handle the request and return a valid response for this endpoint.
	 *
	 * @throws RouteException On error.
	 * @param \WP_REST_Request $request Request object.
	 * @return \WP_REST_Response
	 */
	protected function get_route_post_response( \WP_REST_Request $request ) {
		if ( ! wc_shipping_enabled() ) {
			throw new RouteException( 'woocommerce_rest_shipping_disabled', __( 'Shipping is disabled.', 'woocommerce' ), 404 );
		}

		if ( ! isset( $request['package_id'] ) ) {
			throw new RouteException( 'woocommerce_rest_cart_missing_package_id', __( 'Invalid Package ID.', 'woocommerce' ), 400 );
		}

		$cart       = $this->cart_controller->get_cart_instance();
		$package_id = wc_clean( wp_unslash( $request['package_id'] ) );
		$rate_id    = wc_clean( wp_unslash( $request['rate_id'] ) );

		try {
			$this->cart_controller->select_shipping_rate( $package_id, $rate_id );
		} catch ( \WC_Rest_Exception $e ) {
			throw new RouteException( $e->getErrorCode(), $e->getMessage(), $e->getCode() );
		}

		$cart->calculate_shipping();
		$cart->calculate_totals();

		return rest_ensure_response( $this->schema->get_item_response( $cart ) );
	}
}
woocommerce-blocks/src/StoreApi/Routes/AbstractTermsRoute.php000064400000011352151335517640020456 0ustar00<?php
namespace Automattic\WooCommerce\Blocks\StoreApi\Routes;

use Automattic\WooCommerce\Blocks\StoreApi\Utilities\Pagination;
use WP_Term_Query;

/**
 * AbstractTermsRoute class.
 *
 * @internal This API is used internally by Blocks--it is still in flux and may be subject to revisions.
 */
abstract class AbstractTermsRoute extends AbstractRoute {
	/**
	 * Get the query params for collections of attributes.
	 *
	 * @return array
	 */
	public function get_collection_params() {
		$params                       = array();
		$params['context']            = $this->get_context_param();
		$params['context']['default'] = 'view';

		$params['page'] = array(
			'description'       => __( 'Current page of the collection.', 'woocommerce' ),
			'type'              => 'integer',
			'default'           => 1,
			'sanitize_callback' => 'absint',
			'validate_callback' => 'rest_validate_request_arg',
			'minimum'           => 1,
		);

		$params['per_page'] = array(
			'description'       => __( 'Maximum number of items to be returned in result set. Defaults to no limit if left blank.', 'woocommerce' ),
			'type'              => 'integer',
			'minimum'           => 0,
			'maximum'           => 100,
			'sanitize_callback' => 'absint',
			'validate_callback' => 'rest_validate_request_arg',
		);

		$params['search'] = array(
			'description'       => __( 'Limit results to those matching a string.', 'woocommerce' ),
			'type'              => 'string',
			'sanitize_callback' => 'sanitize_text_field',
			'validate_callback' => 'rest_validate_request_arg',
		);

		$params['exclude'] = array(
			'description'       => __( 'Ensure result set excludes specific IDs.', 'woocommerce' ),
			'type'              => 'array',
			'items'             => array(
				'type' => 'integer',
			),
			'default'           => array(),
			'sanitize_callback' => 'wp_parse_id_list',
		);

		$params['include'] = array(
			'description'       => __( 'Limit result set to specific ids.', 'woocommerce' ),
			'type'              => 'array',
			'items'             => array(
				'type' => 'integer',
			),
			'default'           => array(),
			'sanitize_callback' => 'wp_parse_id_list',
		);

		$params['order'] = array(
			'description'       => __( 'Sort ascending or descending.', 'woocommerce' ),
			'type'              => 'string',
			'default'           => 'asc',
			'enum'              => array( 'asc', 'desc' ),
			'validate_callback' => 'rest_validate_request_arg',
		);

		$params['orderby'] = array(
			'description'       => __( 'Sort by term property.', 'woocommerce' ),
			'type'              => 'string',
			'default'           => 'name',
			'enum'              => array(
				'name',
				'slug',
				'count',
			),
			'validate_callback' => 'rest_validate_request_arg',
		);

		$params['hide_empty'] = array(
			'description' => __( 'If true, empty terms will not be returned.', 'woocommerce' ),
			'type'        => 'boolean',
			'default'     => true,
		);

		return $params;
	}

	/**
	 * Get terms matching passed in args.
	 *
	 * @param string           $taxonomy Taxonomy to get terms from.
	 * @param \WP_REST_Request $request Request object.
	 *
	 * @return \WP_REST_Response
	 */
	protected function get_terms_response( $taxonomy, $request ) {
		$page          = (int) $request['page'];
		$per_page      = $request['per_page'] ? (int) $request['per_page'] : 0;
		$prepared_args = array(
			'taxonomy'   => $taxonomy,
			'exclude'    => $request['exclude'],
			'include'    => $request['include'],
			'order'      => $request['order'],
			'orderby'    => $request['orderby'],
			'hide_empty' => (bool) $request['hide_empty'],
			'number'     => $per_page,
			'offset'     => $per_page > 0 ? ( $page - 1 ) * $per_page : 0,
			'search'     => $request['search'],
		);

		$term_query = new WP_Term_Query();
		$objects    = $term_query->query( $prepared_args );
		$return     = [];

		foreach ( $objects as $object ) {
			$data     = $this->prepare_item_for_response( $object, $request );
			$return[] = $this->prepare_response_for_collection( $data );
		}

		$response = rest_ensure_response( $return );

		// See if pagination is needed before calculating.
		if ( $per_page > 0 && ( count( $objects ) === $per_page || $page > 1 ) ) {
			$term_count = $this->get_term_count( $taxonomy, $prepared_args );
			$response   = ( new Pagination() )->add_headers( $response, $request, $term_count, ceil( $term_count / $per_page ) );
		}

		return $response;
	}

	/**
	 * Get count of terms for current query.
	 *
	 * @param string $taxonomy Taxonomy to get terms from.
	 * @param array  $args Array of args to pass to wp_count_terms.
	 * @return int
	 */
	protected function get_term_count( $taxonomy, $args ) {
		$count_args = $args;
		unset( $count_args['number'], $count_args['offset'] );
		return (int) wp_count_terms( $taxonomy, $count_args );
	}
}
woocommerce-blocks/src/StoreApi/Routes/CartExtensions.php000064400000003221151335517640017626 0ustar00<?php
namespace Automattic\WooCommerce\Blocks\StoreApi\Routes;

/**
 * CartExtensions class.
 *
 * @internal This API is used internally by Blocks--it is still in flux and may be subject to revisions.
 */
class CartExtensions extends AbstractCartRoute {
	/**
	 * Get the path of this REST route.
	 *
	 * @return string
	 */
	public function get_path() {
		return '/cart/extensions';
	}

	/**
	 * Get method arguments for this REST route.
	 *
	 * @return array An array of endpoints.
	 */
	public function get_args() {
		return [
			[
				'methods'             => \WP_REST_Server::CREATABLE,
				'callback'            => [ $this, 'get_response' ],
				'permission_callback' => '__return_true',
				'args'                => [
					'namespace' => [
						'description' => __( 'Extension\'s name - this will be used to ensure the data in the request is routed appropriately.', 'woocommerce' ),
						'type'        => 'string',
					],
					'data'      => [
						'description' => __( 'Additional data to pass to the extension', 'woocommerce' ),
						'type'        => 'object',
					],
				],
			],
			'schema'      => [ $this->schema, 'get_public_item_schema' ],
			'allow_batch' => [ 'v1' => true ],
		];
	}

	/**
	 * Handle the request and return a valid response for this endpoint.
	 *
	 * @throws RouteException On error.
	 * @param \WP_REST_Request $request Request object.
	 * @return \WP_REST_Response
	 */
	protected function get_route_post_response( \WP_REST_Request $request ) {
		try {
			return $this->schema->get_item_response( $request );
		} catch ( \WC_REST_Exception $e ) {
			throw new RouteException( $e->getErrorCode(), $e->getMessage(), $e->getCode() );
		}
	}
}
woocommerce-blocks/src/StoreApi/Routes/ProductsById.php000064400000003116151335517640017233 0ustar00<?php
namespace Automattic\WooCommerce\Blocks\StoreApi\Routes;

/**
 * ProductsById class.
 *
 * @internal This API is used internally by Blocks--it is still in flux and may be subject to revisions.
 */
class ProductsById extends AbstractRoute {
	/**
	 * Get the path of this REST route.
	 *
	 * @return string
	 */
	public function get_path() {
		return '/products/(?P<id>[\d]+)';
	}

	/**
	 * Get method arguments for this REST route.
	 *
	 * @return array An array of endpoints.
	 */
	public function get_args() {
		return [
			'args'   => array(
				'id' => array(
					'description' => __( 'Unique identifier for the resource.', 'woocommerce' ),
					'type'        => 'integer',
				),
			),
			[
				'methods'             => \WP_REST_Server::READABLE,
				'callback'            => [ $this, 'get_response' ],
				'permission_callback' => '__return_true',
				'args'                => array(
					'context' => $this->get_context_param(
						array(
							'default' => 'view',
						)
					),
				),
			],
			'schema' => [ $this->schema, 'get_public_item_schema' ],
		];
	}

	/**
	 * Get a single item.
	 *
	 * @throws RouteException On error.
	 * @param \WP_REST_Request $request Request object.
	 * @return \WP_REST_Response
	 */
	protected function get_route_response( \WP_REST_Request $request ) {
		$object = wc_get_product( (int) $request['id'] );

		if ( ! $object || 0 === $object->get_id() ) {
			throw new RouteException( 'woocommerce_rest_product_invalid_id', __( 'Invalid product ID.', 'woocommerce' ), 404 );
		}

		return rest_ensure_response( $this->schema->get_item_response( $object ) );
	}
}
woocommerce-blocks/src/StoreApi/Routes/CartUpdateCustomer.php000064400000020143151335517640020435 0ustar00<?php
namespace Automattic\WooCommerce\Blocks\StoreApi\Routes;

use Automattic\WooCommerce\Blocks\StoreApi\Schemas\CartSchema;
use Automattic\WooCommerce\Blocks\StoreApi\Schemas\BillingAddressSchema;
use Automattic\WooCommerce\Blocks\StoreApi\Schemas\ShippingAddressSchema;

/**
 * CartUpdateCustomer class.
 *
 * Updates the customer billing and shipping address and returns an updated cart--things such as taxes may be recalculated.
 *
 * @internal This API is used internally by Blocks--it is still in flux and may be subject to revisions.
 */
class CartUpdateCustomer extends AbstractCartRoute {
	/**
	 * Get the namespace for this route.
	 *
	 * @return string
	 */
	public function get_namespace() {
		return 'wc/store';
	}

	/**
	 * Get the path of this REST route.
	 *
	 * @return string
	 */
	public function get_path() {
		return '/cart/update-customer';
	}

	/**
	 * Get method arguments for this REST route.
	 *
	 * @return array An array of endpoints.
	 */
	public function get_args() {
		return [
			[
				'methods'             => \WP_REST_Server::CREATABLE,
				'callback'            => [ $this, 'get_response' ],
				'permission_callback' => '__return_true',
				'args'                => [
					'billing_address'  => [
						'description'       => __( 'Billing address.', 'woocommerce' ),
						'type'              => 'object',
						'context'           => [ 'view', 'edit' ],
						'properties'        => $this->schema->billing_address_schema->get_properties(),
						'sanitize_callback' => [ $this->schema->billing_address_schema, 'sanitize_callback' ],
						'validate_callback' => [ $this->schema->billing_address_schema, 'validate_callback' ],
					],
					'shipping_address' => [
						'description'       => __( 'Shipping address.', 'woocommerce' ),
						'type'              => 'object',
						'context'           => [ 'view', 'edit' ],
						'properties'        => $this->schema->shipping_address_schema->get_properties(),
						'sanitize_callback' => [ $this->schema->shipping_address_schema, 'sanitize_callback' ],
						'validate_callback' => [ $this->schema->shipping_address_schema, 'validate_callback' ],
					],
				],
			],
			'schema'      => [ $this->schema, 'get_public_item_schema' ],
			'allow_batch' => [ 'v1' => true ],
		];
	}

	/**
	 * Handle the request and return a valid response for this endpoint.
	 *
	 * @throws RouteException On error.
	 * @param \WP_REST_Request $request Request object.
	 * @return \WP_REST_Response
	 */
	protected function get_route_post_response( \WP_REST_Request $request ) {
		$cart     = $this->cart_controller->get_cart_instance();
		$billing  = isset( $request['billing_address'] ) ? $request['billing_address'] : [];
		$shipping = isset( $request['shipping_address'] ) ? $request['shipping_address'] : [];

		// If the cart does not need shipping, shipping address is forced to match billing address unless defined.
		if ( ! $cart->needs_shipping() && ! isset( $request['shipping_address'] ) ) {
			$shipping = isset( $request['billing_address'] ) ? $request['billing_address'] : [
				'first_name' => wc()->customer->get_billing_first_name(),
				'last_name'  => wc()->customer->get_billing_last_name(),
				'company'    => wc()->customer->get_billing_company(),
				'address_1'  => wc()->customer->get_billing_address_1(),
				'address_2'  => wc()->customer->get_billing_address_2(),
				'city'       => wc()->customer->get_billing_city(),
				'state'      => wc()->customer->get_billing_state(),
				'postcode'   => wc()->customer->get_billing_postcode(),
				'country'    => wc()->customer->get_billing_country(),
				'phone'      => wc()->customer->get_billing_phone(),
			];
		}
		wc()->customer->set_props(
			array(
				'billing_first_name'  => isset( $billing['first_name'] ) ? $billing['first_name'] : null,
				'billing_last_name'   => isset( $billing['last_name'] ) ? $billing['last_name'] : null,
				'billing_company'     => isset( $billing['company'] ) ? $billing['company'] : null,
				'billing_address_1'   => isset( $billing['address_1'] ) ? $billing['address_1'] : null,
				'billing_address_2'   => isset( $billing['address_2'] ) ? $billing['address_2'] : null,
				'billing_city'        => isset( $billing['city'] ) ? $billing['city'] : null,
				'billing_state'       => isset( $billing['state'] ) ? $billing['state'] : null,
				'billing_postcode'    => isset( $billing['postcode'] ) ? $billing['postcode'] : null,
				'billing_country'     => isset( $billing['country'] ) ? $billing['country'] : null,
				'billing_phone'       => isset( $billing['phone'] ) ? $billing['phone'] : null,
				'billing_email'       => isset( $request['billing_address'], $request['billing_address']['email'] ) ? $request['billing_address']['email'] : null,
				'shipping_first_name' => isset( $shipping['first_name'] ) ? $shipping['first_name'] : null,
				'shipping_last_name'  => isset( $shipping['last_name'] ) ? $shipping['last_name'] : null,
				'shipping_company'    => isset( $shipping['company'] ) ? $shipping['company'] : null,
				'shipping_address_1'  => isset( $shipping['address_1'] ) ? $shipping['address_1'] : null,
				'shipping_address_2'  => isset( $shipping['address_2'] ) ? $shipping['address_2'] : null,
				'shipping_city'       => isset( $shipping['city'] ) ? $shipping['city'] : null,
				'shipping_state'      => isset( $shipping['state'] ) ? $shipping['state'] : null,
				'shipping_postcode'   => isset( $shipping['postcode'] ) ? $shipping['postcode'] : null,
				'shipping_country'    => isset( $shipping['country'] ) ? $shipping['country'] : null,
			)
		);

		$shipping_phone_value = isset( $shipping['phone'] ) ? $shipping['phone'] : null;

		// @todo Remove custom shipping_phone handling (requires WC 5.6+)
		if ( is_callable( [ wc()->customer, 'set_shipping_phone' ] ) ) {
			wc()->customer->set_shipping_phone( $shipping_phone_value );
		} else {
			wc()->customer->update_meta_data( 'shipping_phone', $shipping_phone_value );
		}

		wc()->customer->save();

		$this->calculate_totals();
		$this->maybe_update_order();

		return rest_ensure_response( $this->schema->get_item_response( $cart ) );
	}

	/**
	 * If there is a draft order, update customer data there also.
	 *
	 * @return void
	 */
	protected function maybe_update_order() {
		$draft_order_id = wc()->session->get( 'store_api_draft_order', 0 );
		$draft_order    = $draft_order_id ? wc_get_order( $draft_order_id ) : false;

		if ( ! $draft_order ) {
			return;
		}

		$draft_order->set_props(
			[
				'billing_first_name'  => wc()->customer->get_billing_first_name(),
				'billing_last_name'   => wc()->customer->get_billing_last_name(),
				'billing_company'     => wc()->customer->get_billing_company(),
				'billing_address_1'   => wc()->customer->get_billing_address_1(),
				'billing_address_2'   => wc()->customer->get_billing_address_2(),
				'billing_city'        => wc()->customer->get_billing_city(),
				'billing_state'       => wc()->customer->get_billing_state(),
				'billing_postcode'    => wc()->customer->get_billing_postcode(),
				'billing_country'     => wc()->customer->get_billing_country(),
				'billing_email'       => wc()->customer->get_billing_email(),
				'billing_phone'       => wc()->customer->get_billing_phone(),
				'shipping_first_name' => wc()->customer->get_shipping_first_name(),
				'shipping_last_name'  => wc()->customer->get_shipping_last_name(),
				'shipping_company'    => wc()->customer->get_shipping_company(),
				'shipping_address_1'  => wc()->customer->get_shipping_address_1(),
				'shipping_address_2'  => wc()->customer->get_shipping_address_2(),
				'shipping_city'       => wc()->customer->get_shipping_city(),
				'shipping_state'      => wc()->customer->get_shipping_state(),
				'shipping_postcode'   => wc()->customer->get_shipping_postcode(),
				'shipping_country'    => wc()->customer->get_shipping_country(),
			]
		);

		$shipping_phone_value = is_callable( [ wc()->customer, 'get_shipping_phone' ] ) ? wc()->customer->get_shipping_phone() : wc()->customer->get_meta( 'shipping_phone', true );

		if ( is_callable( [ $draft_order, 'set_shipping_phone' ] ) ) {
			$draft_order->set_shipping_phone( $shipping_phone_value );
		} else {
			$draft_order->update_meta_data( '_shipping_phone', $shipping_phone_value );
		}

		$draft_order->save();
	}
}
woocommerce-blocks/src/StoreApi/Formatters/FormatterInterface.php000064400000000742151335517640021313 0ustar00<?php
namespace Automattic\WooCommerce\Blocks\StoreApi\Formatters;

/**
 * FormatterInterface.
 *
 * @internal This API is used internally by Blocks--it is still in flux and may be subject to revisions.
 */
interface FormatterInterface {
	/**
	 * Format a given value and return the result.
	 *
	 * @param mixed $value Value to format.
	 * @param array $options Options that influence the formatting.
	 * @return mixed
	 */
	public function format( $value, array $options = [] );
}
woocommerce-blocks/src/StoreApi/Formatters/DefaultFormatter.php000064400000001016151335517640020772 0ustar00<?php
namespace Automattic\WooCommerce\Blocks\StoreApi\Formatters;

/**
 * Default Formatter.
 *
 * @internal This API is used internally by Blocks--it is still in flux and may be subject to revisions.
 */
class DefaultFormatter implements FormatterInterface {
	/**
	 * Format a given value and return the result.
	 *
	 * @param mixed $value Value to format.
	 * @param array $options Options that influence the formatting.
	 * @return mixed
	 */
	public function format( $value, array $options = [] ) {
		return $value;
	}
}
woocommerce-blocks/src/StoreApi/Formatters/CurrencyFormatter.php000064400000002671151335517640021210 0ustar00<?php
namespace Automattic\WooCommerce\Blocks\StoreApi\Formatters;

/**
 * Currency Formatter.
 *
 * Formats an array of monetary values by inserting currency data.
 *
 * @internal This API is used internally by Blocks--it is still in flux and may be subject to revisions.
 */
class CurrencyFormatter implements FormatterInterface {
	/**
	 * Format a given value and return the result.
	 *
	 * @param array $value Value to format.
	 * @param array $options Options that influence the formatting.
	 * @return array
	 */
	public function format( $value, array $options = [] ) {
		$position = get_option( 'woocommerce_currency_pos' );
		$symbol   = html_entity_decode( get_woocommerce_currency_symbol() );
		$prefix   = '';
		$suffix   = '';

		switch ( $position ) {
			case 'left_space':
				$prefix = $symbol . ' ';
				break;
			case 'left':
				$prefix = $symbol;
				break;
			case 'right_space':
				$suffix = ' ' . $symbol;
				break;
			case 'right':
				$suffix = $symbol;
				break;
		}

		return array_merge(
			(array) $value,
			[
				'currency_code'               => get_woocommerce_currency(),
				'currency_symbol'             => $symbol,
				'currency_minor_unit'         => wc_get_price_decimals(),
				'currency_decimal_separator'  => wc_get_price_decimal_separator(),
				'currency_thousand_separator' => wc_get_price_thousand_separator(),
				'currency_prefix'             => $prefix,
				'currency_suffix'             => $suffix,
			]
		);
	}
}
woocommerce-blocks/src/StoreApi/Formatters/HtmlFormatter.php000064400000001611151335517640020313 0ustar00<?php
namespace Automattic\WooCommerce\Blocks\StoreApi\Formatters;

/**
 * Html Formatter.
 *
 * Formats HTML in API responses.
 *
 * @internal This API is used internally by Blocks--it is still in flux and may be subject to revisions.
 */
class HtmlFormatter implements FormatterInterface {
	/**
	 * Format a given value and return the result.
	 *
	 * The wptexturize, convert_chars, and trim functions are also used in the `the_title` filter.
	 * The function wp_kses_post removes disallowed HTML tags.
	 *
	 * @param string|array $value Value to format.
	 * @param array        $options Options that influence the formatting.
	 * @return string
	 */
	public function format( $value, array $options = [] ) {
		if ( is_array( $value ) ) {
			return array_map( [ $this, 'format' ], $value );
		}
		return is_scalar( $value ) ? wp_kses_post( trim( convert_chars( wptexturize( $value ) ) ) ) : $value;
	}
}
woocommerce-blocks/src/StoreApi/Formatters/MoneyFormatter.php000064400000001565151335517640020506 0ustar00<?php
namespace Automattic\WooCommerce\Blocks\StoreApi\Formatters;

/**
 * Money Formatter.
 *
 * Formats monetary values using store settings.
 *
 * @internal This API is used internally by Blocks--it is still in flux and may be subject to revisions.
 */
class MoneyFormatter implements FormatterInterface {
	/**
	 * Format a given value and return the result.
	 *
	 * @param mixed $value Value to format.
	 * @param array $options Options that influence the formatting.
	 * @return mixed
	 */
	public function format( $value, array $options = [] ) {
		$options = wp_parse_args(
			$options,
			[
				'decimals'      => wc_get_price_decimals(),
				'rounding_mode' => PHP_ROUND_HALF_UP,
			]
		);

		return (string) intval(
			round(
				( (float) wc_format_decimal( $value ) ) * ( 10 ** absint( $options['decimals'] ) ),
				0,
				absint( $options['rounding_mode'] )
			)
		);
	}
}
woocommerce-blocks/src/StoreApi/RoutesController.php000064400000011044151335517640016723 0ustar00<?php
namespace Automattic\WooCommerce\Blocks\StoreApi;

use Routes\AbstractRoute;
use Automattic\WooCommerce\Blocks\StoreApi\Utilities\CartController;
use Automattic\WooCommerce\Blocks\StoreApi\Utilities\OrderController;

/**
 * RoutesController class.
 *
 * @internal This API is used internally by Blocks--it is still in flux and may be subject to revisions.
 */
class RoutesController {

	/**
	 * Stores schemas.
	 *
	 * @var SchemaController
	 */
	protected $schemas;

	/**
	 * Stores routes.
	 *
	 * @var AbstractRoute[]
	 */
	protected $routes = [];

	/**
	 * Constructor.
	 *
	 * @param SchemaController $schemas Schema controller class passed to each route.
	 */
	public function __construct( SchemaController $schemas ) {
		$this->schemas = $schemas;
		$this->initialize();
	}

	/**
	 * Get a route class instance.
	 *
	 * @throws Exception If the schema does not exist.
	 *
	 * @param string $name Name of schema.
	 * @return AbstractRoute
	 */
	public function get( $name ) {
		if ( ! isset( $this->routes[ $name ] ) ) {
			throw new Exception( $name . ' route does not exist' );
		}
		return $this->routes[ $name ];
	}

	/**
	 * Register defined list of routes with WordPress.
	 */
	public function register_routes() {
		foreach ( $this->routes as $route ) {
			register_rest_route(
				$route->get_namespace(),
				$route->get_path(),
				$route->get_args()
			);
		}
	}

	/**
	 * Load route class instances.
	 */
	protected function initialize() {
		global $wp_version;

		$cart_controller  = new CartController();
		$order_controller = new OrderController();

		$this->routes = [
			'cart'                      => new Routes\Cart( $this->schemas->get( 'cart' ), null, $cart_controller ),
			'cart-add-item'             => new Routes\CartAddItem( $this->schemas->get( 'cart' ), null, $cart_controller ),
			'cart-apply-coupon'         => new Routes\CartApplyCoupon( $this->schemas->get( 'cart' ), null, $cart_controller ),
			'cart-coupons'              => new Routes\CartCoupons( $this->schemas->get( 'cart' ), $this->schemas->get( 'cart-coupon' ), $cart_controller ),
			'cart-coupons-by-code'      => new Routes\CartCouponsByCode( $this->schemas->get( 'cart' ), $this->schemas->get( 'cart-coupon' ), $cart_controller ),
			'cart-extensions'           => new Routes\CartExtensions( $this->schemas->get( 'cart' ), $this->schemas->get( 'cart-extensions' ), $cart_controller ),
			'cart-items'                => new Routes\CartItems( $this->schemas->get( 'cart' ), $this->schemas->get( 'cart-item' ), $cart_controller ),
			'cart-items-by-key'         => new Routes\CartItemsByKey( $this->schemas->get( 'cart' ), $this->schemas->get( 'cart-item' ), $cart_controller ),
			'cart-remove-coupon'        => new Routes\CartRemoveCoupon( $this->schemas->get( 'cart' ), null, $cart_controller ),
			'cart-remove-item'          => new Routes\CartRemoveItem( $this->schemas->get( 'cart' ), null, $cart_controller ),
			'cart-select-shipping-rate' => new Routes\CartSelectShippingRate( $this->schemas->get( 'cart' ), null, $cart_controller ),
			'cart-update-item'          => new Routes\CartUpdateItem( $this->schemas->get( 'cart' ), null, $cart_controller ),
			'cart-update-customer'      => new Routes\CartUpdateCustomer( $this->schemas->get( 'cart' ), null, $cart_controller ),
			'checkout'                  => new Routes\Checkout( $this->schemas->get( 'cart' ), $this->schemas->get( 'checkout' ), $cart_controller, $order_controller ),
			'product-attributes'        => new Routes\ProductAttributes( $this->schemas->get( 'product-attribute' ) ),
			'product-attributes-by-id'  => new Routes\ProductAttributesById( $this->schemas->get( 'product-attribute' ) ),
			'product-attribute-terms'   => new Routes\ProductAttributeTerms( $this->schemas->get( 'term' ) ),
			'product-categories'        => new Routes\ProductCategories( $this->schemas->get( 'product-category' ) ),
			'product-categories-by-id'  => new Routes\ProductCategoriesById( $this->schemas->get( 'product-category' ) ),
			'product-collection-data'   => new Routes\ProductCollectionData( $this->schemas->get( 'product-collection-data' ) ),
			'product-reviews'           => new Routes\ProductReviews( $this->schemas->get( 'product-review' ) ),
			'product-tags'              => new Routes\ProductTags( $this->schemas->get( 'term' ) ),
			'products'                  => new Routes\Products( $this->schemas->get( 'product' ) ),
			'products-by-id'            => new Routes\ProductsById( $this->schemas->get( 'product' ) ),
		];

		// Batching requires WP 5.6.
		if ( version_compare( $wp_version, '5.6', '>=' ) ) {
			$this->routes['batch'] = new Routes\Batch();
		}
	}
}
woocommerce-blocks/src/StoreApi/Schemas/CartExtensionsSchema.php000064400000002441151335517640021054 0ustar00<?php
namespace Automattic\WooCommerce\Blocks\StoreApi\Schemas;

use AutomateWoo\Exception;
use Automattic\WooCommerce\Blocks\StoreApi\Routes\RouteException;

/**
 * Class CartExtensionsSchema
 *
 * @internal This API is used internally by Blocks--it is still in flux and may be subject to revisions.
 */
class CartExtensionsSchema extends AbstractSchema {
	/**
	 * The schema item name.
	 *
	 * @var string
	 */
	protected $title = 'cart-extensions';

	/**
	 * The schema item identifier.
	 *
	 * @var string
	 */
	const IDENTIFIER = 'cart-extensions';

	/**
	 * Cart extensions schema properties.
	 *
	 * @return array
	 */
	public function get_properties() {
		return [];
	}

	/**
	 * Handle the request and return a valid response for this endpoint.
	 *
	 * @param \WP_REST_Request $request Request containing data for the extension callback.
	 * @throws RouteException When callback is not callable or parameters are incorrect.
	 *
	 * @return array
	 */
	public function get_item_response( $request = null ) {
		try {
			$callback = $this->extend->get_update_callback( $request['namespace'] );
		} catch ( RouteException $e ) {
			throw $e;
		}
		if ( is_callable( $callback ) ) {
			$callback( $request['data'] );
		}
		return rest_ensure_response( wc()->api->get_endpoint_data( '/wc/store/cart' ) );
	}
}
woocommerce-blocks/src/StoreApi/Schemas/BillingAddressSchema.php000064400000007024151335517640020773 0ustar00<?php
namespace Automattic\WooCommerce\Blocks\StoreApi\Schemas;

use Automattic\WooCommerce\Blocks\RestApi\Routes;


/**
 * BillingAddressSchema class.
 *
 * Provides a generic billing address schema for composition in other schemas.
 *
 * @internal This API is used internally by Blocks--it is still in flux and may be subject to revisions.
 */
class BillingAddressSchema extends AbstractAddressSchema {
	/**
	 * The schema item name.
	 *
	 * @var string
	 */
	protected $title = 'billing_address';

	/**
	 * The schema item identifier.
	 *
	 * @var string
	 */
	const IDENTIFIER = 'billing-address';

	/**
	 * Term properties.
	 *
	 * @return array
	 */
	public function get_properties() {
		$properties = parent::get_properties();
		return array_merge(
			$properties,
			[
				'email' => [
					'description' => __( 'Email', 'woocommerce' ),
					'type'        => 'string',
					'context'     => [ 'view', 'edit' ],
					'required'    => true,
				],
			]
		);
	}

	/**
	 * Sanitize and format the given address object.
	 *
	 * @param array            $address Value being sanitized.
	 * @param \WP_REST_Request $request The Request.
	 * @param string           $param The param being sanitized.
	 * @return array
	 */
	public function sanitize_callback( $address, $request, $param ) {
		$address          = parent::sanitize_callback( $address, $request, $param );
		$address['email'] = wc_clean( wp_unslash( $address['email'] ) );
		return $address;
	}

	/**
	 * Validate the given address object.
	 *
	 * @param array            $address Value being sanitized.
	 * @param \WP_REST_Request $request The Request.
	 * @param string           $param The param being sanitized.
	 * @return true|\WP_Error
	 */
	public function validate_callback( $address, $request, $param ) {
		$errors  = parent::validate_callback( $address, $request, $param );
		$address = $this->sanitize_callback( $address, $request, $param );
		$errors  = is_wp_error( $errors ) ? $errors : new \WP_Error();

		if ( ! empty( $address['email'] ) && ! is_email( $address['email'] ) ) {
			$errors->add(
				'invalid_email',
				__( 'The provided email address is not valid', 'woocommerce' )
			);
		}

		return $errors->has_errors( $errors ) ? $errors : true;
	}

	/**
	 * Convert a term object into an object suitable for the response.
	 *
	 * @param \WC_Order|\WC_Customer $address An object with billing address.
	 *
	 * @throws RouteException When the invalid object types are provided.
	 * @return stdClass
	 */
	public function get_item_response( $address ) {
		if ( ( $address instanceof \WC_Customer || $address instanceof \WC_Order ) ) {
			return (object) $this->prepare_html_response(
				[
					'first_name' => $address->get_billing_first_name(),
					'last_name'  => $address->get_billing_last_name(),
					'company'    => $address->get_billing_company(),
					'address_1'  => $address->get_billing_address_1(),
					'address_2'  => $address->get_billing_address_2(),
					'city'       => $address->get_billing_city(),
					'state'      => $address->get_billing_state(),
					'postcode'   => $address->get_billing_postcode(),
					'country'    => $address->get_billing_country(),
					'email'      => $address->get_billing_email(),
					'phone'      => $address->get_billing_phone(),
				]
			);
		}
		throw new RouteException(
			'invalid_object_type',
			sprintf(
				/* translators: Placeholders are class and method names */
				__( '%1$s requires an instance of %2$s or %3$s for the address', 'woocommerce' ),
				'BillingAddressSchema::get_item_response',
				'WC_Customer',
				'WC_Order'
			),
			500
		);
	}
}
woocommerce-blocks/src/StoreApi/Schemas/ProductReviewSchema.php000064400000014567151335517640020721 0ustar00<?php
namespace Automattic\WooCommerce\Blocks\StoreApi\Schemas;

use Automattic\WooCommerce\Blocks\Domain\Services\ExtendRestApi;


/**
 * ProductReviewSchema class.
 *
 * @internal This API is used internally by Blocks--it is still in flux and may be subject to revisions.
 */
class ProductReviewSchema extends AbstractSchema {
	/**
	 * The schema item name.
	 *
	 * @var string
	 */
	protected $title = 'product_review';

	/**
	 * The schema item identifier.
	 *
	 * @var string
	 */
	const IDENTIFIER = 'product-review';

	/**
	 * Image attachment schema instance.
	 *
	 * @var ImageAttachmentSchema
	 */
	protected $image_attachment_schema;

	/**
	 * Constructor.
	 *
	 * @param ExtendRestApi         $extend Rest Extending instance.
	 * @param ImageAttachmentSchema $image_attachment_schema Image attachment schema instance.
	 */
	public function __construct( ExtendRestApi $extend, ImageAttachmentSchema $image_attachment_schema ) {
		$this->image_attachment_schema = $image_attachment_schema;
		parent::__construct( $extend );
	}

	/**
	 * Product review schema properties.
	 *
	 * @return array
	 */
	public function get_properties() {
		$properties = [
			'id'                     => [
				'description' => __( 'Unique identifier for the resource.', 'woocommerce' ),
				'type'        => 'integer',
				'context'     => [ 'view', 'edit' ],
				'readonly'    => true,
			],
			'date_created'           => [
				'description' => __( "The date the review was created, in the site's timezone.", 'woocommerce' ),
				'type'        => 'string',
				'format'      => 'date-time',
				'context'     => [ 'view', 'edit' ],
				'readonly'    => true,
			],
			'formatted_date_created' => [
				'description' => __( "The date the review was created, in the site's timezone in human-readable format.", 'woocommerce' ),
				'type'        => 'string',
				'context'     => [ 'view', 'edit' ],
				'readonly'    => true,
			],
			'date_created_gmt'       => [
				'description' => __( 'The date the review was created, as GMT.', 'woocommerce' ),
				'type'        => 'string',
				'format'      => 'date-time',
				'context'     => [ 'view', 'edit' ],
				'readonly'    => true,
			],
			'product_id'             => [
				'description' => __( 'Unique identifier for the product that the review belongs to.', 'woocommerce' ),
				'type'        => 'integer',
				'context'     => [ 'view', 'edit' ],
				'readonly'    => true,
			],
			'product_name'           => [
				'description' => __( 'Name of the product that the review belongs to.', 'woocommerce' ),
				'type'        => 'string',
				'context'     => [ 'view', 'edit' ],
				'readonly'    => true,
			],
			'product_permalink'      => [
				'description' => __( 'Permalink of the product that the review belongs to.', 'woocommerce' ),
				'type'        => 'string',
				'context'     => [ 'view', 'edit' ],
				'readonly'    => true,
			],
			'product_image'          => [
				'description' => __( 'Image of the product that the review belongs to.', 'woocommerce' ),
				'type'        => 'object',
				'context'     => [ 'view', 'edit' ],
				'readonly'    => true,
				'properties'  => $this->image_attachment_schema->get_properties(),
			],
			'reviewer'               => [
				'description' => __( 'Reviewer name.', 'woocommerce' ),
				'type'        => 'string',
				'context'     => [ 'view', 'edit' ],
				'readonly'    => true,
			],
			'review'                 => [
				'description' => __( 'The content of the review.', 'woocommerce' ),
				'type'        => 'string',
				'context'     => [ 'view', 'edit' ],
				'arg_options' => [
					'sanitize_callback' => 'wp_filter_post_kses',
				],
				'readonly'    => true,
			],
			'rating'                 => [
				'description' => __( 'Review rating (0 to 5).', 'woocommerce' ),
				'type'        => 'integer',
				'context'     => [ 'view', 'edit' ],
				'readonly'    => true,
			],
			'verified'               => [
				'description' => __( 'Shows if the reviewer bought the product or not.', 'woocommerce' ),
				'type'        => 'boolean',
				'context'     => [ 'view', 'edit' ],
				'readonly'    => true,
			],
		];

		if ( get_option( 'show_avatars' ) ) {
			$avatar_properties = array();
			$avatar_sizes      = rest_get_avatar_sizes();

			foreach ( $avatar_sizes as $size ) {
				$avatar_properties[ $size ] = array(
					/* translators: %d: avatar image size in pixels */
					'description' => sprintf( __( 'Avatar URL with image size of %d pixels.', 'woocommerce' ), $size ),
					'type'        => 'string',
					'format'      => 'uri',
					'context'     => array( 'embed', 'view', 'edit' ),
				);
			}
			$properties['reviewer_avatar_urls'] = array(
				'description' => __( 'Avatar URLs for the object reviewer.', 'woocommerce' ),
				'type'        => 'object',
				'context'     => array( 'view', 'edit' ),
				'readonly'    => true,
				'properties'  => $avatar_properties,
			);
		}

		return $properties;
	}

	/**
	 * Convert a WooCommerce product into an object suitable for the response.
	 *
	 * @param \WP_Comment $review Product review object.
	 * @return array
	 */
	public function get_item_response( \WP_Comment $review ) {
		$context = ! empty( $request['context'] ) ? $request['context'] : 'view';
		$rating  = get_comment_meta( $review->comment_ID, 'rating', true ) === '' ? null : (int) get_comment_meta( $review->comment_ID, 'rating', true );
		$data    = [
			'id'                     => (int) $review->comment_ID,
			'date_created'           => wc_rest_prepare_date_response( $review->comment_date ),
			'formatted_date_created' => get_comment_date( 'F j, Y', $review->comment_ID ),
			'date_created_gmt'       => wc_rest_prepare_date_response( $review->comment_date_gmt ),
			'product_id'             => (int) $review->comment_post_ID,
			'product_name'           => get_the_title( (int) $review->comment_post_ID ),
			'product_permalink'      => get_permalink( (int) $review->comment_post_ID ),
			'product_image'          => $this->image_attachment_schema->get_item_response( get_post_thumbnail_id( (int) $review->comment_post_ID ) ),
			'reviewer'               => $review->comment_author,
			'review'                 => $review->comment_content,
			'rating'                 => $rating,
			'verified'               => wc_review_is_from_verified_owner( $review->comment_ID ),
			'reviewer_avatar_urls'   => rest_get_avatar_urls( $review->comment_author_email ),
		];

		if ( 'view' === $context ) {
			$data['review'] = wpautop( $data['review'] );
		}

		return $data;
	}
}
woocommerce-blocks/src/StoreApi/Schemas/TermSchema.php000064400000004435151335517640017017 0ustar00<?php
namespace Automattic\WooCommerce\Blocks\StoreApi\Schemas;

/**
 * TermSchema class.
 *
 * @internal This API is used internally by Blocks--it is still in flux and may be subject to revisions.
 * @since 2.5.0
 */
class TermSchema extends AbstractSchema {
	/**
	 * The schema item name.
	 *
	 * @var string
	 */
	protected $title = 'term';

	/**
	 * The schema item identifier.
	 *
	 * @var string
	 */
	const IDENTIFIER = 'term';

	/**
	 * Term properties.
	 *
	 * @return array
	 */
	public function get_properties() {
		return [
			'id'          => array(
				'description' => __( 'Unique identifier for the resource.', 'woocommerce' ),
				'type'        => 'integer',
				'context'     => array( 'view', 'edit' ),
				'readonly'    => true,
			),
			'name'        => array(
				'description' => __( 'Term name.', 'woocommerce' ),
				'type'        => 'string',
				'context'     => array( 'view', 'edit' ),
				'readonly'    => true,
			),
			'slug'        => array(
				'description' => __( 'String based identifier for the term.', 'woocommerce' ),
				'type'        => 'string',
				'context'     => array( 'view', 'edit' ),
				'readonly'    => true,
			),
			'description' => array(
				'description' => __( 'Term description.', 'woocommerce' ),
				'type'        => 'string',
				'context'     => array( 'view', 'edit' ),
				'readonly'    => true,
			),
			'parent'      => array(
				'description' => __( 'Parent term ID, if applicable.', 'woocommerce' ),
				'type'        => 'integer',
				'context'     => array( 'view', 'edit' ),
				'readonly'    => true,
			),
			'count'       => array(
				'description' => __( 'Number of objects (posts of any type) assigned to the term.', 'woocommerce' ),
				'type'        => 'integer',
				'context'     => array( 'view', 'edit' ),
				'readonly'    => true,
			),
		];
	}

	/**
	 * Convert a term object into an object suitable for the response.
	 *
	 * @param \WP_Term $term Term object.
	 * @return array
	 */
	public function get_item_response( $term ) {
		return [
			'id'          => (int) $term->term_id,
			'name'        => $this->prepare_html_response( $term->name ),
			'slug'        => $term->slug,
			'description' => $this->prepare_html_response( $term->description ),
			'parent'      => (int) $term->parent,
			'count'       => (int) $term->count,
		];
	}
}
woocommerce-blocks/src/StoreApi/Schemas/AbstractSchema.php000064400000027033151335517640017652 0ustar00<?php
namespace Automattic\WooCommerce\Blocks\StoreApi\Schemas;

use Automattic\WooCommerce\Blocks\Package;
use Automattic\WooCommerce\Blocks\Domain\Services\ExtendRestApi;
/**
 * AbstractSchema class.
 *
 * For REST Route Schemas
 *
 * @internal This API is used internally by Blocks--it is still in flux and may be subject to revisions.
 * @since 2.5.0
 */
abstract class AbstractSchema {
	/**
	 * The schema item name.
	 *
	 * @var string
	 */
	protected $title = 'Schema';

	/**
	 * Rest extend instance
	 *
	 * @var ExtendRestApi
	 */
	protected $extend;

	/**
	 * Extending key that gets added to endpoint.
	 *
	 * @var string
	 */
	const EXTENDING_KEY = 'extensions';

	/**
	 * Constructor.
	 *
	 * @param ExtendRestApi $extend Rest Extending instance.
	 */
	public function __construct( ExtendRestApi $extend ) {
		$this->extend = $extend;
	}

	/**
	 * Returns the full item schema.
	 *
	 * @return array
	 */
	public function get_item_schema() {
		return array(
			'$schema'    => 'http://json-schema.org/draft-04/schema#',
			'title'      => $this->title,
			'type'       => 'object',
			'properties' => $this->get_properties(),
		);
	}

	/**
	 * Recursive removal of arg_options.
	 *
	 * @param array $properties Schema properties.
	 */
	protected function remove_arg_options( $properties ) {
		return array_map(
			function( $property ) {
				if ( isset( $property['properties'] ) ) {
					$property['properties'] = $this->remove_arg_options( $property['properties'] );
				} elseif ( isset( $property['items']['properties'] ) ) {
					$property['items']['properties'] = $this->remove_arg_options( $property['items']['properties'] );
				}
				unset( $property['arg_options'] );
				return $property;
			},
			(array) $properties
		);
	}

	/**
	 * Returns the public schema.
	 *
	 * @return array
	 */
	public function get_public_item_schema() {
		$schema = $this->get_item_schema();

		if ( isset( $schema['properties'] ) ) {
			$schema['properties'] = $this->remove_arg_options( $schema['properties'] );
		}

		return $schema;
	}

	/**
	 * Returns extended data for a specific endpoint.
	 *
	 * @param string $endpoint The endpoint identifer.
	 * @param array  ...$passed_args An array of arguments to be passed to callbacks.
	 * @return object the data that will get added.
	 */
	protected function get_extended_data( $endpoint, ...$passed_args ) {
		return $this->extend->get_endpoint_data( $endpoint, $passed_args );
	}

	/**
	 * Gets an array of schema defaults recursively.
	 *
	 * @param array $properties Schema property data.
	 * @return array Array of defaults, pulled from arg_options
	 */
	protected function get_recursive_schema_property_defaults( $properties ) {
		$defaults = [];

		foreach ( $properties as $property_key => $property_value ) {
			if ( isset( $property_value['arg_options']['default'] ) ) {
				$defaults[ $property_key ] = $property_value['arg_options']['default'];
			} elseif ( isset( $property_value['properties'] ) ) {
				$defaults[ $property_key ] = $this->get_recursive_schema_property_defaults( $property_value['properties'] );
			}
		}

		return $defaults;
	}

	/**
	 * Gets a function that validates recursively.
	 *
	 * @param array $properties Schema property data.
	 * @return function Anonymous validation callback.
	 */
	protected function get_recursive_validate_callback( $properties ) {
		/**
		 * Validate a request argument based on details registered to the route.
		 *
		 * @param mixed            $values
		 * @param \WP_REST_Request $request
		 * @param string           $param
		 * @return true|\WP_Error
		 */
		return function ( $values, $request, $param ) use ( $properties ) {
			foreach ( $properties as $property_key => $property_value ) {
				$current_value = isset( $values[ $property_key ] ) ? $values[ $property_key ] : null;

				if ( isset( $property_value['arg_options']['validate_callback'] ) ) {
					$callback = $property_value['arg_options']['validate_callback'];
					$result   = is_callable( $callback ) ? $callback( $current_value, $request, $param ) : false;
				} else {
					$result = rest_validate_value_from_schema( $current_value, $property_value, $param . ' > ' . $property_key );
				}

				if ( ! $result || is_wp_error( $result ) ) {
					return $result;
				}

				if ( isset( $property_value['properties'] ) ) {
					$validate_callback = $this->get_recursive_validate_callback( $property_value['properties'] );
					return $validate_callback( $current_value, $request, $param . ' > ' . $property_key );
				}
			}

			return true;
		};
	}

	/**
	 * Gets a function that sanitizes recursively.
	 *
	 * @param array $properties Schema property data.
	 * @return function Anonymous validation callback.
	 */
	protected function get_recursive_sanitize_callback( $properties ) {
		/**
		 * Validate a request argument based on details registered to the route.
		 *
		 * @param mixed            $values
		 * @param \WP_REST_Request $request
		 * @param string           $param
		 * @return true|\WP_Error
		 */
		return function ( $values, $request, $param ) use ( $properties ) {
			foreach ( $properties as $property_key => $property_value ) {
				$current_value = isset( $values[ $property_key ] ) ? $values[ $property_key ] : null;

				if ( isset( $property_value['arg_options']['sanitize_callback'] ) ) {
					$callback      = $property_value['arg_options']['sanitize_callback'];
					$current_value = is_callable( $callback ) ? $callback( $current_value, $request, $param ) : $current_value;
				} else {
					$current_value = rest_sanitize_value_from_schema( $current_value, $property_value, $param . ' > ' . $property_key );
				}

				if ( is_wp_error( $current_value ) ) {
					return $current_value;
				}

				if ( isset( $property_value['properties'] ) ) {
					$sanitize_callback = $this->get_recursive_sanitize_callback( $property_value['properties'] );
					return $sanitize_callback( $current_value, $request, $param . ' > ' . $property_key );
				}
			}

			return true;
		};
	}

	/**
	 * Returns extended schema for a specific endpoint.
	 *
	 * @param string $endpoint The endpoint identifer.
	 * @param array  ...$passed_args An array of arguments to be passed to callbacks.
	 * @return array the data that will get added.
	 */
	protected function get_extended_schema( $endpoint, ...$passed_args ) {
		$extended_schema = $this->extend->get_endpoint_schema( $endpoint, $passed_args );
		$defaults        = $this->get_recursive_schema_property_defaults( $extended_schema );

		return [
			'type'        => 'object',
			'context'     => [ 'view', 'edit' ],
			'arg_options' => [
				'default'           => $defaults,
				'validate_callback' => $this->get_recursive_validate_callback( $extended_schema ),
				'sanitize_callback' => $this->get_recursive_sanitize_callback( $extended_schema ),
			],
			'properties'  => $extended_schema,
		];
	}

	/**
	 * Apply a schema get_item_response callback to an array of items and return the result.
	 *
	 * @param AbstractSchema $schema Schema class instance.
	 * @param array          $items Array of items.
	 * @return array Array of values from the callback function.
	 */
	protected function get_item_responses_from_schema( AbstractSchema $schema, $items ) {
		$items = array_filter( $items );

		if ( empty( $items ) ) {
			return [];
		}

		return array_values( array_map( [ $schema, 'get_item_response' ], $items ) );
	}

	/**
	 * Retrieves an array of endpoint arguments from the item schema for the controller.
	 *
	 * @uses rest_get_endpoint_args_for_schema()
	 * @param string $method Optional. HTTP method of the request.
	 * @return array Endpoint arguments.
	 */
	public function get_endpoint_args_for_item_schema( $method = \WP_REST_Server::CREATABLE ) {
		$schema        = $this->get_item_schema();
		$endpoint_args = rest_get_endpoint_args_for_schema( $schema, $method );
		$endpoint_args = $this->remove_arg_options( $endpoint_args );
		return $endpoint_args;
	}


	/**
	 * Force all schema properties to be readonly.
	 *
	 * @param array $properties Schema.
	 * @return array Updated schema.
	 */
	protected function force_schema_readonly( $properties ) {
		return array_map(
			function( $property ) {
				$property['readonly'] = true;
				if ( isset( $property['items']['properties'] ) ) {
					$property['items']['properties'] = $this->force_schema_readonly( $property['items']['properties'] );
				}
				return $property;
			},
			(array) $properties
		);
	}

	/**
	 * Returns consistent currency schema used across endpoints for prices.
	 *
	 * @return array
	 */
	protected function get_store_currency_properties() {
		return [
			'currency_code'               => [
				'description' => __( 'Currency code (in ISO format) for returned prices.', 'woocommerce' ),
				'type'        => 'string',
				'context'     => [ 'view', 'edit' ],
				'readonly'    => true,
			],
			'currency_symbol'             => [
				'description' => __( 'Currency symbol for the currency which can be used to format returned prices.', 'woocommerce' ),
				'type'        => 'string',
				'context'     => [ 'view', 'edit' ],
				'readonly'    => true,
			],
			'currency_minor_unit'         => [
				'description' => __( 'Currency minor unit (number of digits after the decimal separator) for returned prices.', 'woocommerce' ),
				'type'        => 'integer',
				'context'     => [ 'view', 'edit' ],
				'readonly'    => true,
			],
			'currency_decimal_separator'  => array(
				'description' => __( 'Decimal separator for the currency which can be used to format returned prices.', 'woocommerce' ),
				'type'        => 'string',
				'context'     => array( 'view', 'edit' ),
				'readonly'    => true,
			),
			'currency_thousand_separator' => array(
				'description' => __( 'Thousand separator for the currency which can be used to format returned prices.', 'woocommerce' ),
				'type'        => 'string',
				'context'     => array( 'view', 'edit' ),
				'readonly'    => true,
			),
			'currency_prefix'             => array(
				'description' => __( 'Price prefix for the currency which can be used to format returned prices.', 'woocommerce' ),
				'type'        => 'string',
				'context'     => array( 'view', 'edit' ),
				'readonly'    => true,
			),
			'currency_suffix'             => array(
				'description' => __( 'Price prefix for the currency which can be used to format returned prices.', 'woocommerce' ),
				'type'        => 'string',
				'context'     => array( 'view', 'edit' ),
				'readonly'    => true,
			),
		];
	}

	/**
	 * Adds currency data to an array of monetary values.
	 *
	 * @param array $values Monetary amounts.
	 * @return array Monetary amounts with currency data appended.
	 */
	protected function prepare_currency_response( $values ) {
		return $this->extend->get_formatter( 'currency' )->format( $values );
	}

	/**
	 * Convert monetary values from WooCommerce to string based integers, using
	 * the smallest unit of a currency.
	 *
	 * @param string|float $amount Monetary amount with decimals.
	 * @param int          $decimals Number of decimals the amount is formatted with.
	 * @param int          $rounding_mode Defaults to the PHP_ROUND_HALF_UP constant.
	 * @return string      The new amount.
	 */
	protected function prepare_money_response( $amount, $decimals = 2, $rounding_mode = PHP_ROUND_HALF_UP ) {
		return $this->extend->get_formatter( 'money' )->format(
			$amount,
			[
				'decimals'      => $decimals,
				'rounding_mode' => $rounding_mode,
			]
		);
	}

	/**
	 * Prepares HTML based content, such as post titles and content, for the API response.
	 *
	 * @param string|array $response Data to format.
	 * @return string|array Formatted data.
	 */
	protected function prepare_html_response( $response ) {
		return $this->extend->get_formatter( 'html' )->format( $response );
	}
}
woocommerce-blocks/src/StoreApi/Schemas/ShippingAddressSchema.php000064400000004221151335517640021170 0ustar00<?php
namespace Automattic\WooCommerce\Blocks\StoreApi\Schemas;

use Automattic\WooCommerce\Blocks\RestApi\Routes;

/**
 * ShippingAddressSchema class.
 *
 * Provides a generic shipping address schema for composition in other schemas.
 *
 * @internal This API is used internally by Blocks--it is still in flux and may be subject to revisions.
 * @since 2.5.0
 */
class ShippingAddressSchema extends AbstractAddressSchema {
	/**
	 * The schema item name.
	 *
	 * @var string
	 */
	protected $title = 'shipping_address';

	/**
	 * The schema item identifier.
	 *
	 * @var string
	 */
	const IDENTIFIER = 'shipping-address';

	/**
	 * Convert a term object into an object suitable for the response.
	 *
	 * @param \WC_Order|\WC_Customer $address An object with shipping address.
	 *
	 * @throws RouteException When the invalid object types are provided.
	 * @return stdClass
	 */
	public function get_item_response( $address ) {
		if ( ( $address instanceof \WC_Customer || $address instanceof \WC_Order ) ) {
			if ( is_callable( [ $address, 'get_shipping_phone' ] ) ) {
				$shipping_phone = $address->get_shipping_phone();
			} else {
				$shipping_phone = $address->get_meta( $address instanceof \WC_Customer ? 'shipping_phone' : '_shipping_phone', true );
			}

			return (object) $this->prepare_html_response(
				[
					'first_name' => $address->get_shipping_first_name(),
					'last_name'  => $address->get_shipping_last_name(),
					'company'    => $address->get_shipping_company(),
					'address_1'  => $address->get_shipping_address_1(),
					'address_2'  => $address->get_shipping_address_2(),
					'city'       => $address->get_shipping_city(),
					'state'      => $address->get_shipping_state(),
					'postcode'   => $address->get_shipping_postcode(),
					'country'    => $address->get_shipping_country(),
					'phone'      => $shipping_phone,
				]
			);
		}
		throw new RouteException(
			'invalid_object_type',
			sprintf(
				/* translators: Placeholders are class and method names */
				__( '%1$s requires an instance of %2$s or %3$s for the address', 'woocommerce' ),
				'ShippingAddressSchema::get_item_response',
				'WC_Customer',
				'WC_Order'
			),
			500
		);
	}
}
woocommerce-blocks/src/StoreApi/Schemas/OrderCouponSchema.php000064400000004221151335517640020340 0ustar00<?php
namespace Automattic\WooCommerce\Blocks\StoreApi\Schemas;

/**
 * OrderCouponSchema class.
 *
 * @internal This API is used internally by Blocks--it is still in flux and may be subject to revisions.
 */
class OrderCouponSchema extends AbstractSchema {
	/**
	 * The schema item name.
	 *
	 * @var string
	 */
	protected $title = 'order_coupon';

	/**
	 * The schema item identifier.
	 *
	 * @var string
	 */
	const IDENTIFIER = 'order-coupon';

	/**
	 * Cart schema properties.
	 *
	 * @return array
	 */
	public function get_properties() {
		return [
			'code'   => [
				'description' => __( 'The coupons unique code.', 'woocommerce' ),
				'type'        => 'string',
				'context'     => [ 'view', 'edit' ],
				'readonly'    => true,
			],
			'totals' => [
				'description' => __( 'Total amounts provided using the smallest unit of the currency.', 'woocommerce' ),
				'type'        => 'object',
				'context'     => [ 'view', 'edit' ],
				'readonly'    => true,
				'properties'  => array_merge(
					$this->get_store_currency_properties(),
					[
						'total_discount'     => [
							'description' => __( 'Total discount applied by this coupon.', 'woocommerce' ),
							'type'        => 'string',
							'context'     => [ 'view', 'edit' ],
							'readonly'    => true,
						],
						'total_discount_tax' => [
							'description' => __( 'Total tax removed due to discount applied by this coupon.', 'woocommerce' ),
							'type'        => 'string',
							'context'     => [ 'view', 'edit' ],
							'readonly'    => true,
						],
					]
				),
			],
		];
	}

	/**
	 * Convert an order coupon to an object suitable for the response.
	 *
	 * @param \WC_Order_Item_Coupon $coupon Order coupon array.
	 * @return array
	 */
	public function get_item_response( \WC_Order_Item_Coupon $coupon ) {
		return [
			'code'   => $coupon->get_code(),
			'totals' => (object) $this->prepare_currency_response(
				[
					'total_discount'     => $this->prepare_money_response( $coupon->get_discount(), wc_get_price_decimals() ),
					'total_discount_tax' => $this->prepare_money_response( $coupon->get_discount_tax(), wc_get_price_decimals(), PHP_ROUND_HALF_DOWN ),
				]
			),
		];
	}
}
woocommerce-blocks/src/StoreApi/Schemas/CartSchema.php000064400000036701151335517640017002 0ustar00<?php
namespace Automattic\WooCommerce\Blocks\StoreApi\Schemas;

use Automattic\WooCommerce\Blocks\StoreApi\Utilities\CartController;
use Automattic\WooCommerce\Blocks\Domain\Services\ExtendRestApi;
use WC_Tax;
use WP_Error;


/**
 * CartSchema class.
 *
 * @internal This API is used internally by Blocks--it is still in flux and may be subject to revisions.
 * @since 2.5.0
 */
class CartSchema extends AbstractSchema {
	/**
	 * The schema item name.
	 *
	 * @var string
	 */
	protected $title = 'cart';

	/**
	 * The schema item identifier.
	 *
	 * @var string
	 */
	const IDENTIFIER = 'cart';

	/**
	 * Item schema instance.
	 *
	 * @var CartItemSchema
	 */
	public $item_schema;

	/**
	 * Coupon schema instance.
	 *
	 * @var CartCouponSchema
	 */
	public $coupon_schema;

	/**
	 * Fee schema instance.
	 *
	 * @var CartFeeSchema
	 */
	public $fee_schema;

	/**
	 * Shipping rates schema instance.
	 *
	 * @var CartShippingRateSchema
	 */
	public $shipping_rate_schema;

	/**
	 * Shipping address schema instance.
	 *
	 * @var ShippingAddressSchema
	 */
	public $shipping_address_schema;

	/**
	 * Billing address schema instance.
	 *
	 * @var BillingAddressSchema
	 */
	public $billing_address_schema;

	/**
	 * Error schema instance.
	 *
	 * @var ErrorSchema
	 */
	public $error_schema;

	/**
	 * Constructor.
	 *
	 * @param ExtendRestApi          $extend Rest Extending instance.
	 * @param CartItemSchema         $item_schema Item schema instance.
	 * @param CartCouponSchema       $coupon_schema Coupon schema instance.
	 * @param CartFeeSchema          $fee_schema Fee schema instance.
	 * @param CartShippingRateSchema $shipping_rate_schema Shipping rates schema instance.
	 * @param ShippingAddressSchema  $shipping_address_schema Shipping address schema instance.
	 * @param BillingAddressSchema   $billing_address_schema Billing address schema instance.
	 * @param ErrorSchema            $error_schema Error schema instance.
	 */
	public function __construct(
		ExtendRestApi $extend,
		CartItemSchema $item_schema,
		CartCouponSchema $coupon_schema,
		CartFeeSchema $fee_schema,
		CartShippingRateSchema $shipping_rate_schema,
		ShippingAddressSchema $shipping_address_schema,
		BillingAddressSchema $billing_address_schema,
		ErrorSchema $error_schema
	) {
		$this->item_schema             = $item_schema;
		$this->coupon_schema           = $coupon_schema;
		$this->fee_schema              = $fee_schema;
		$this->shipping_rate_schema    = $shipping_rate_schema;
		$this->shipping_address_schema = $shipping_address_schema;
		$this->billing_address_schema  = $billing_address_schema;
		$this->error_schema            = $error_schema;
		parent::__construct( $extend );
	}

	/**
	 * Cart schema properties.
	 *
	 * @return array
	 */
	public function get_properties() {
		return [
			'coupons'                 => [
				'description' => __( 'List of applied cart coupons.', 'woocommerce' ),
				'type'        => 'array',
				'context'     => [ 'view', 'edit' ],
				'readonly'    => true,
				'items'       => [
					'type'       => 'object',
					'properties' => $this->force_schema_readonly( $this->coupon_schema->get_properties() ),
				],
			],
			'shipping_rates'          => [
				'description' => __( 'List of available shipping rates for the cart.', 'woocommerce' ),
				'type'        => 'array',
				'context'     => [ 'view', 'edit' ],
				'readonly'    => true,
				'items'       => [
					'type'       => 'object',
					'properties' => $this->force_schema_readonly( $this->shipping_rate_schema->get_properties() ),
				],
			],
			'shipping_address'        => [
				'description' => __( 'Current set shipping address for the customer.', 'woocommerce' ),
				'type'        => 'object',
				'context'     => [ 'view', 'edit' ],
				'readonly'    => true,
				'properties'  => $this->force_schema_readonly( $this->shipping_address_schema->get_properties() ),
			],
			'billing_address'         => [
				'description' => __( 'Current set billing address for the customer.', 'woocommerce' ),
				'type'        => 'object',
				'context'     => [ 'view', 'edit' ],
				'readonly'    => true,
				'properties'  => $this->force_schema_readonly( $this->billing_address_schema->get_properties() ),
			],
			'items'                   => [
				'description' => __( 'List of cart items.', 'woocommerce' ),
				'type'        => 'array',
				'context'     => [ 'view', 'edit' ],
				'readonly'    => true,
				'items'       => [
					'type'       => 'object',
					'properties' => $this->force_schema_readonly( $this->item_schema->get_properties() ),
				],
			],
			'items_count'             => [
				'description' => __( 'Number of items in the cart.', 'woocommerce' ),
				'type'        => 'integer',
				'context'     => [ 'view', 'edit' ],
				'readonly'    => true,
			],
			'items_weight'            => [
				'description' => __( 'Total weight (in grams) of all products in the cart.', 'woocommerce' ),
				'type'        => 'number',
				'context'     => [ 'view', 'edit' ],
				'readonly'    => true,
			],
			'needs_payment'           => [
				'description' => __( 'True if the cart needs payment. False for carts with only free products and no shipping costs.', 'woocommerce' ),
				'type'        => 'boolean',
				'context'     => [ 'view', 'edit' ],
				'readonly'    => true,
			],
			'needs_shipping'          => [
				'description' => __( 'True if the cart needs shipping. False for carts with only digital goods or stores with no shipping methods set-up.', 'woocommerce' ),
				'type'        => 'boolean',
				'context'     => [ 'view', 'edit' ],
				'readonly'    => true,
			],
			'has_calculated_shipping' => [
				'description' => __( 'True if the cart meets the criteria for showing shipping costs, and rates have been calculated and included in the totals.', 'woocommerce' ),
				'type'        => 'boolean',
				'context'     => [ 'view', 'edit' ],
				'readonly'    => true,
			],
			'fees'                    => [
				'description' => __( 'List of cart fees.', 'woocommerce' ),
				'type'        => 'array',
				'context'     => [ 'view', 'edit' ],
				'readonly'    => true,
				'items'       => [
					'type'       => 'object',
					'properties' => $this->force_schema_readonly( $this->fee_schema->get_properties() ),
				],
			],
			'totals'                  => [
				'description' => __( 'Cart total amounts provided using the smallest unit of the currency.', 'woocommerce' ),
				'type'        => 'object',
				'context'     => [ 'view', 'edit' ],
				'readonly'    => true,
				'properties'  => array_merge(
					$this->get_store_currency_properties(),
					[
						'total_items'        => [
							'description' => __( 'Total price of items in the cart.', 'woocommerce' ),
							'type'        => 'string',
							'context'     => [ 'view', 'edit' ],
							'readonly'    => true,
						],
						'total_items_tax'    => [
							'description' => __( 'Total tax on items in the cart.', 'woocommerce' ),
							'type'        => 'string',
							'context'     => [ 'view', 'edit' ],
							'readonly'    => true,
						],
						'total_fees'         => [
							'description' => __( 'Total price of any applied fees.', 'woocommerce' ),
							'type'        => 'string',
							'context'     => [ 'view', 'edit' ],
							'readonly'    => true,
						],
						'total_fees_tax'     => [
							'description' => __( 'Total tax on fees.', 'woocommerce' ),
							'type'        => 'string',
							'context'     => [ 'view', 'edit' ],
							'readonly'    => true,
						],
						'total_discount'     => [
							'description' => __( 'Total discount from applied coupons.', 'woocommerce' ),
							'type'        => 'string',
							'context'     => [ 'view', 'edit' ],
							'readonly'    => true,
						],
						'total_discount_tax' => [
							'description' => __( 'Total tax removed due to discount from applied coupons.', 'woocommerce' ),
							'type'        => 'string',
							'context'     => [ 'view', 'edit' ],
							'readonly'    => true,
						],
						'total_shipping'     => [
							'description' => __( 'Total price of shipping. If shipping has not been calculated, a null response will be sent.', 'woocommerce' ),
							'type'        => [ 'string', 'null' ],
							'context'     => [ 'view', 'edit' ],
							'readonly'    => true,
						],
						'total_shipping_tax' => [
							'description' => __( 'Total tax on shipping. If shipping has not been calculated, a null response will be sent.', 'woocommerce' ),
							'type'        => [ 'string', 'null' ],
							'context'     => [ 'view', 'edit' ],
							'readonly'    => true,
						],
						'total_price'        => [
							'description' => __( 'Total price the customer will pay.', 'woocommerce' ),
							'type'        => 'string',
							'context'     => [ 'view', 'edit' ],
							'readonly'    => true,
						],
						'total_tax'          => [
							'description' => __( 'Total tax applied to items and shipping.', 'woocommerce' ),
							'type'        => 'string',
							'context'     => [ 'view', 'edit' ],
							'readonly'    => true,
						],
						'tax_lines'          => [
							'description' => __( 'Lines of taxes applied to items and shipping.', 'woocommerce' ),
							'type'        => 'array',
							'context'     => [ 'view', 'edit' ],
							'readonly'    => true,
							'items'       => [
								'type'       => 'object',
								'properties' => [
									'name'  => [
										'description' => __( 'The name of the tax.', 'woocommerce' ),
										'type'        => 'string',
										'context'     => [ 'view', 'edit' ],
										'readonly'    => true,
									],
									'price' => [
										'description' => __( 'The amount of tax charged.', 'woocommerce' ),
										'type'        => 'string',
										'context'     => [ 'view', 'edit' ],
										'readonly'    => true,
									],
									'rate'  => [
										'description' => __( 'The rate at which tax is applied.', 'woocommerce' ),
										'type'        => 'string',
										'context'     => [ 'view', 'edit' ],
										'readonly'    => true,
									],
								],
							],
						],
					]
				),
			],
			'errors'                  => [
				'description' => __( 'List of cart item errors, for example, items in the cart which are out of stock.', 'woocommerce' ),
				'type'        => 'array',
				'context'     => [ 'view', 'edit' ],
				'readonly'    => true,
				'items'       => [
					'type'       => 'object',
					'properties' => $this->force_schema_readonly( $this->error_schema->get_properties() ),
				],
			],
			'payment_requirements'    => [
				'description' => __( 'List of required payment gateway features to process the order.', 'woocommerce' ),
				'type'        => 'array',
				'context'     => [ 'view', 'edit' ],
				'readonly'    => true,
			],
			'generated_timestamp'     => [
				'description' => __( 'The time at which this cart data was prepared', 'woocommerce' ),
				'type'        => 'number',
				'context'     => [ 'view', 'edit' ],
				'readonly'    => true,
			],
			self::EXTENDING_KEY       => $this->get_extended_schema( self::IDENTIFIER ),
		];
	}

	/**
	 * Convert a woo cart into an object suitable for the response.
	 *
	 * @param \WC_Cart $cart Cart class instance.
	 * @return array
	 */
	public function get_item_response( $cart ) {
		$controller = new CartController();

		// Get cart errors first so if recalculations are performed, it's reflected in the response.
		$cart_errors = $this->get_cart_errors( $cart );

		// The core cart class will not include shipping in the cart totals if `show_shipping()` returns false. This can
		// happen if an address is required, or through the use of hooks. This tracks if shipping has actually been
		// calculated so we can avoid returning costs and rates prematurely.
		$has_calculated_shipping = $cart->show_shipping();

		// Get shipping packages to return in the response from the cart.
		$shipping_packages = $has_calculated_shipping ? $controller->get_shipping_packages() : [];

		return [
			'coupons'                 => $this->get_item_responses_from_schema( $this->coupon_schema, $cart->get_applied_coupons() ),
			'shipping_rates'          => $this->get_item_responses_from_schema( $this->shipping_rate_schema, $shipping_packages ),
			'shipping_address'        => $this->shipping_address_schema->get_item_response( wc()->customer ),
			'billing_address'         => $this->billing_address_schema->get_item_response( wc()->customer ),
			'items'                   => $this->get_item_responses_from_schema( $this->item_schema, $cart->get_cart() ),
			'items_count'             => $cart->get_cart_contents_count(),
			'items_weight'            => wc_get_weight( $cart->get_cart_contents_weight(), 'g' ),
			'needs_payment'           => $cart->needs_payment(),
			'needs_shipping'          => $cart->needs_shipping(),
			'has_calculated_shipping' => $has_calculated_shipping,
			'fees'                    => $this->get_item_responses_from_schema( $this->fee_schema, $cart->get_fees() ),
			'totals'                  => (object) $this->prepare_currency_response(
				[
					'total_items'        => $this->prepare_money_response( $cart->get_subtotal(), wc_get_price_decimals() ),
					'total_items_tax'    => $this->prepare_money_response( $cart->get_subtotal_tax(), wc_get_price_decimals() ),
					'total_fees'         => $this->prepare_money_response( $cart->get_fee_total(), wc_get_price_decimals() ),
					'total_fees_tax'     => $this->prepare_money_response( $cart->get_fee_tax(), wc_get_price_decimals() ),
					'total_discount'     => $this->prepare_money_response( $cart->get_discount_total(), wc_get_price_decimals() ),
					'total_discount_tax' => $this->prepare_money_response( $cart->get_discount_tax(), wc_get_price_decimals() ),
					'total_shipping'     => $has_calculated_shipping ? $this->prepare_money_response( $cart->get_shipping_total(), wc_get_price_decimals() ) : null,
					'total_shipping_tax' => $has_calculated_shipping ? $this->prepare_money_response( $cart->get_shipping_tax(), wc_get_price_decimals() ) : null,

					// Explicitly request context='edit'; default ('view') will render total as markup.
					'total_price'        => $this->prepare_money_response( $cart->get_total( 'edit' ), wc_get_price_decimals() ),
					'total_tax'          => $this->prepare_money_response( $cart->get_total_tax(), wc_get_price_decimals() ),
					'tax_lines'          => $this->get_tax_lines( $cart ),
				]
			),
			'errors'                  => $cart_errors,
			'payment_requirements'    => $this->extend->get_payment_requirements(),
			'generated_timestamp'     => time(),
			self::EXTENDING_KEY       => $this->get_extended_data( self::IDENTIFIER ),
		];
	}

	/**
	 * Get tax lines from the cart and format to match schema.
	 *
	 * @param \WC_Cart $cart Cart class instance.
	 * @return array
	 */
	protected function get_tax_lines( $cart ) {
		$cart_tax_totals = $cart->get_tax_totals();
		$tax_lines       = [];

		foreach ( $cart_tax_totals as $cart_tax_total ) {
			$tax_lines[] = array(
				'name'  => $cart_tax_total->label,
				'price' => $this->prepare_money_response( $cart_tax_total->amount, wc_get_price_decimals() ),
				'rate'  => WC_Tax::get_rate_percent( $cart_tax_total->tax_rate_id ),
			);
		}

		return $tax_lines;
	}

	/**
	 * Get cart validation errors.
	 *
	 * @param \WC_Cart $cart Cart class instance.
	 * @return array
	 */
	protected function get_cart_errors( $cart ) {
		$controller    = new CartController();
		$item_errors   = array_filter(
			$controller->get_cart_item_errors(),
			function ( WP_Error $error ) {
				return $error->has_errors();
			}
		);
		$coupon_errors = $controller->get_cart_coupon_errors();

		return array_values( array_map( [ $this->error_schema, 'get_item_response' ], array_merge( $item_errors, $coupon_errors ) ) );
	}
}
woocommerce-blocks/src/StoreApi/Schemas/CartItemSchema.php000064400000040464151335517640017622 0ustar00<?php
namespace Automattic\WooCommerce\Blocks\StoreApi\Schemas;

use Automattic\WooCommerce\Checkout\Helpers\ReserveStock;

/**
 * CartItemSchema class.
 *
 * @internal This API is used internally by Blocks--it is still in flux and may be subject to revisions.
 * @since 2.5.0
 */
class CartItemSchema extends ProductSchema {
	/**
	 * The schema item name.
	 *
	 * @var string
	 */
	protected $title = 'cart_item';

	/**
	 * The schema item identifier.
	 *
	 * @var string
	 */
	const IDENTIFIER = 'cart-item';

	/**
	 * Cart schema properties.
	 *
	 * @return array
	 */
	public function get_properties() {
		return [
			'key'                  => [
				'description' => __( 'Unique identifier for the item within the cart.', 'woocommerce' ),
				'type'        => 'string',
				'context'     => [ 'view', 'edit' ],
				'readonly'    => true,
			],
			'id'                   => [
				'description' => __( 'The cart item product or variation ID.', 'woocommerce' ),
				'type'        => 'integer',
				'context'     => [ 'view', 'edit' ],
				'readonly'    => true,
			],
			'quantity'             => [
				'description' => __( 'Quantity of this item in the cart.', 'woocommerce' ),
				'type'        => 'integer',
				'context'     => [ 'view', 'edit' ],
				'readonly'    => true,
			],
			'quantity_limit'       => [
				'description' => __( 'The maximum quantity than can be added to the cart at once.', 'woocommerce' ),
				'type'        => 'integer',
				'context'     => [ 'view', 'edit' ],
				'readonly'    => true,
			],
			'name'                 => [
				'description' => __( 'Product name.', 'woocommerce' ),
				'type'        => 'string',
				'context'     => [ 'view', 'edit' ],
				'readonly'    => true,
			],
			'short_description'    => [
				'description' => __( 'Product short description in HTML format.', 'woocommerce' ),
				'type'        => 'string',
				'context'     => [ 'view', 'edit' ],
				'readonly'    => true,
			],
			'description'          => [
				'description' => __( 'Product full description in HTML format.', 'woocommerce' ),
				'type'        => 'string',
				'context'     => [ 'view', 'edit' ],
				'readonly'    => true,
			],
			'sku'                  => [
				'description' => __( 'Stock keeping unit, if applicable.', 'woocommerce' ),
				'type'        => 'string',
				'context'     => [ 'view', 'edit' ],
				'readonly'    => true,
			],
			'low_stock_remaining'  => [
				'description' => __( 'Quantity left in stock if stock is low, or null if not applicable.', 'woocommerce' ),
				'type'        => [ 'integer', 'null' ],
				'context'     => [ 'view', 'edit' ],
				'readonly'    => true,
			],
			'backorders_allowed'   => [
				'description' => __( 'True if backorders are allowed past stock availability.', 'woocommerce' ),
				'type'        => [ 'boolean' ],
				'context'     => [ 'view', 'edit' ],
				'readonly'    => true,
			],
			'show_backorder_badge' => [
				'description' => __( 'True if the product is on backorder.', 'woocommerce' ),
				'type'        => [ 'boolean' ],
				'context'     => [ 'view', 'edit' ],
				'readonly'    => true,
			],
			'sold_individually'    => [
				'description' => __( 'If true, only one item of this product is allowed for purchase in a single order.', 'woocommerce' ),
				'type'        => 'boolean',
				'context'     => [ 'view', 'edit' ],
				'readonly'    => true,
			],
			'permalink'            => [
				'description' => __( 'Product URL.', 'woocommerce' ),
				'type'        => 'string',
				'format'      => 'uri',
				'context'     => [ 'view', 'edit' ],
				'readonly'    => true,
			],
			'images'               => [
				'description' => __( 'List of images.', 'woocommerce' ),
				'type'        => 'array',
				'context'     => [ 'view', 'edit' ],
				'readonly'    => true,
				'items'       => [
					'type'       => 'object',
					'properties' => $this->image_attachment_schema->get_properties(),
				],
			],
			'variation'            => [
				'description' => __( 'Chosen attributes (for variations).', 'woocommerce' ),
				'type'        => 'array',
				'context'     => [ 'view', 'edit' ],
				'readonly'    => true,
				'items'       => [
					'type'       => 'object',
					'properties' => [
						'attribute' => [
							'description' => __( 'Variation attribute name.', 'woocommerce' ),
							'type'        => 'string',
							'context'     => [ 'view', 'edit' ],
							'readonly'    => true,
						],
						'value'     => [
							'description' => __( 'Variation attribute value.', 'woocommerce' ),
							'type'        => 'string',
							'context'     => [ 'view', 'edit' ],
							'readonly'    => true,
						],
					],
				],
			],
			'item_data'            => [
				'description' => __( 'Metadata related to the cart item', 'woocommerce' ),
				'type'        => 'array',
				'context'     => [ 'view', 'edit' ],
				'readonly'    => true,
				'items'       => [
					'type'       => 'object',
					'properties' => [
						'name'    => [
							'description' => __( 'Name of the metadata.', 'woocommerce' ),
							'type'        => 'string',
							'context'     => [ 'view', 'edit' ],
							'readonly'    => true,
						],
						'value'   => [
							'description' => __( 'Value of the metadata.', 'woocommerce' ),
							'type'        => 'string',
							'context'     => [ 'view', 'edit' ],
							'readonly'    => true,
						],
						'display' => [
							'description' => __( 'Optionally, how the metadata value should be displayed to the user.', 'woocommerce' ),
							'type'        => 'string',
							'context'     => [ 'view', 'edit' ],
							'readonly'    => true,
						],
					],
				],
			],
			'prices'               => [
				'description' => __( 'Price data for the product in the current line item, including or excluding taxes based on the "display prices during cart and checkout" setting. Provided using the smallest unit of the currency.', 'woocommerce' ),
				'type'        => 'object',
				'context'     => [ 'view', 'edit' ],
				'readonly'    => true,
				'properties'  => array_merge(
					$this->get_store_currency_properties(),
					[
						'price'         => [
							'description' => __( 'Current product price.', 'woocommerce' ),
							'type'        => 'string',
							'context'     => [ 'view', 'edit' ],
							'readonly'    => true,
						],
						'regular_price' => [
							'description' => __( 'Regular product price.', 'woocommerce' ),
							'type'        => 'string',
							'context'     => [ 'view', 'edit' ],
							'readonly'    => true,
						],
						'sale_price'    => [
							'description' => __( 'Sale product price, if applicable.', 'woocommerce' ),
							'type'        => 'string',
							'context'     => [ 'view', 'edit' ],
							'readonly'    => true,
						],
						'price_range'   => [
							'description' => __( 'Price range, if applicable.', 'woocommerce' ),
							'type'        => [ 'object', 'null' ],
							'context'     => [ 'view', 'edit' ],
							'readonly'    => true,
							'properties'  => [
								'min_amount' => [
									'description' => __( 'Price amount.', 'woocommerce' ),
									'type'        => 'string',
									'context'     => [ 'view', 'edit' ],
									'readonly'    => true,
								],
								'max_amount' => [
									'description' => __( 'Price amount.', 'woocommerce' ),
									'type'        => 'string',
									'context'     => [ 'view', 'edit' ],
									'readonly'    => true,
								],
							],
						],
						'raw_prices'    => [
							'description' => __( 'Raw unrounded product prices used in calculations. Provided using a higher unit of precision than the currency.', 'woocommerce' ),
							'type'        => [ 'object', 'null' ],
							'context'     => [ 'view', 'edit' ],
							'readonly'    => true,
							'properties'  => [
								'precision'     => [
									'description' => __( 'Decimal precision of the returned prices.', 'woocommerce' ),
									'type'        => 'integer',
									'context'     => [ 'view', 'edit' ],
									'readonly'    => true,
								],
								'price'         => [
									'description' => __( 'Current product price.', 'woocommerce' ),
									'type'        => 'string',
									'context'     => [ 'view', 'edit' ],
									'readonly'    => true,
								],
								'regular_price' => [
									'description' => __( 'Regular product price.', 'woocommerce' ),
									'type'        => 'string',
									'context'     => [ 'view', 'edit' ],
									'readonly'    => true,
								],
								'sale_price'    => [
									'description' => __( 'Sale product price, if applicable.', 'woocommerce' ),
									'type'        => 'string',
									'context'     => [ 'view', 'edit' ],
									'readonly'    => true,
								],
							],
						],
					]
				),
			],
			'totals'               => [
				'description' => __( 'Item total amounts provided using the smallest unit of the currency.', 'woocommerce' ),
				'type'        => 'object',
				'context'     => [ 'view', 'edit' ],
				'readonly'    => true,
				'properties'  => array_merge(
					$this->get_store_currency_properties(),
					[
						'line_subtotal'     => [
							'description' => __( 'Line subtotal (the price of the product before coupon discounts have been applied).', 'woocommerce' ),
							'type'        => 'string',
							'context'     => [ 'view', 'edit' ],
							'readonly'    => true,
						],
						'line_subtotal_tax' => [
							'description' => __( 'Line subtotal tax.', 'woocommerce' ),
							'type'        => 'string',
							'context'     => [ 'view', 'edit' ],
							'readonly'    => true,
						],
						'line_total'        => [
							'description' => __( 'Line total (the price of the product after coupon discounts have been applied).', 'woocommerce' ),
							'type'        => 'string',
							'context'     => [ 'view', 'edit' ],
							'readonly'    => true,
						],
						'line_total_tax'    => [
							'description' => __( 'Line total tax.', 'woocommerce' ),
							'type'        => 'string',
							'context'     => [ 'view', 'edit' ],
							'readonly'    => true,
						],
					]
				),
			],
			'catalog_visibility'   => [
				'description' => __( 'Whether the product is visible in the catalog', 'woocommerce' ),
				'type'        => 'string',
				'context'     => [ 'view', 'edit' ],
				'readonly'    => true,
			],
			self::EXTENDING_KEY    => $this->get_extended_schema( self::IDENTIFIER ),
		];
	}

	/**
	 * Convert a WooCommerce cart item to an object suitable for the response.
	 *
	 * @param array $cart_item Cart item array.
	 * @return array
	 */
	public function get_item_response( $cart_item ) {
		$product = $cart_item['data'];

		return [
			'key'                  => $cart_item['key'],
			'id'                   => $product->get_id(),
			'quantity'             => wc_stock_amount( $cart_item['quantity'] ),
			'quantity_limit'       => $this->get_product_quantity_limit( $product ),
			'name'                 => $this->prepare_html_response( $product->get_title() ),
			'short_description'    => $this->prepare_html_response( wc_format_content( wp_kses_post( $product->get_short_description() ) ) ),
			'description'          => $this->prepare_html_response( wc_format_content( wp_kses_post( $product->get_description() ) ) ),
			'sku'                  => $this->prepare_html_response( $product->get_sku() ),
			'low_stock_remaining'  => $this->get_low_stock_remaining( $product ),
			'backorders_allowed'   => (bool) $product->backorders_allowed(),
			'show_backorder_badge' => (bool) $product->backorders_require_notification() && $product->is_on_backorder( $cart_item['quantity'] ),
			'sold_individually'    => $product->is_sold_individually(),
			'permalink'            => $product->get_permalink(),
			'images'               => $this->get_images( $product ),
			'variation'            => $this->format_variation_data( $cart_item['variation'], $product ),
			'item_data'            => $this->get_item_data( $cart_item ),
			'prices'               => (object) $this->prepare_product_price_response( $product, get_option( 'woocommerce_tax_display_cart' ) ),
			'totals'               => (object) $this->prepare_currency_response(
				[
					'line_subtotal'     => $this->prepare_money_response( $cart_item['line_subtotal'], wc_get_price_decimals() ),
					'line_subtotal_tax' => $this->prepare_money_response( $cart_item['line_subtotal_tax'], wc_get_price_decimals() ),
					'line_total'        => $this->prepare_money_response( $cart_item['line_total'], wc_get_price_decimals() ),
					'line_total_tax'    => $this->prepare_money_response( $cart_item['line_tax'], wc_get_price_decimals() ),
				]
			),
			'catalog_visibility'   => $product->get_catalog_visibility(),
			self::EXTENDING_KEY    => $this->get_extended_data( self::IDENTIFIER, $cart_item ),
		];
	}

	/**
	 * Get an array of pricing data.
	 *
	 * @param \WC_Product $product Product instance.
	 * @param string      $tax_display_mode If returned prices are incl or excl of tax.
	 * @return array
	 */
	protected function prepare_product_price_response( \WC_Product $product, $tax_display_mode = '' ) {
		$tax_display_mode = $this->get_tax_display_mode( $tax_display_mode );
		$price_function   = $this->get_price_function_from_tax_display_mode( $tax_display_mode );
		$prices           = parent::prepare_product_price_response( $product, $tax_display_mode );

		// Add raw prices (prices with greater precision).
		$prices['raw_prices'] = [
			'precision'     => wc_get_rounding_precision(),
			'price'         => $this->prepare_money_response( $price_function( $product ), wc_get_rounding_precision() ),
			'regular_price' => $this->prepare_money_response( $price_function( $product, [ 'price' => $product->get_regular_price() ] ), wc_get_rounding_precision() ),
			'sale_price'    => $this->prepare_money_response( $price_function( $product, [ 'price' => $product->get_sale_price() ] ), wc_get_rounding_precision() ),
		];

		return $prices;
	}

	/**
	 * Returns the remaining stock for a product if it has stock.
	 *
	 * This also factors in draft orders.
	 *
	 * @param \WC_Product $product Product instance.
	 * @return integer|null
	 */
	protected function get_remaining_stock( \WC_Product $product ) {
		if ( is_null( $product->get_stock_quantity() ) ) {
			return null;
		}

		$draft_order    = wc()->session->get( 'store_api_draft_order', 0 );
		$reserve_stock  = new ReserveStock();
		$reserved_stock = $reserve_stock->get_reserved_stock( $product, $draft_order );

		return $product->get_stock_quantity() - $reserved_stock;
	}

	/**
	 * Format variation data, for example convert slugs such as attribute_pa_size to Size.
	 *
	 * @param array       $variation_data Array of data from the cart.
	 * @param \WC_Product $product Product data.
	 * @return array
	 */
	protected function format_variation_data( $variation_data, $product ) {
		$return = [];

		if ( ! is_iterable( $variation_data ) ) {
			return $return;
		}

		foreach ( $variation_data as $key => $value ) {
			$taxonomy = wc_attribute_taxonomy_name( str_replace( 'attribute_pa_', '', urldecode( $key ) ) );

			if ( taxonomy_exists( $taxonomy ) ) {
				// If this is a term slug, get the term's nice name.
				$term = get_term_by( 'slug', $value, $taxonomy );
				if ( ! is_wp_error( $term ) && $term && $term->name ) {
					$value = $term->name;
				}
				$label = wc_attribute_label( $taxonomy );
			} else {
				// If this is a custom option slug, get the options name.
				$value = apply_filters( 'woocommerce_variation_option_name', $value, null, $taxonomy, $product );
				$label = wc_attribute_label( str_replace( 'attribute_', '', $key ), $product );
			}

			$return[] = [
				'attribute' => $this->prepare_html_response( $label ),
				'value'     => $this->prepare_html_response( $value ),
			];
		}

		return $return;
	}

	/**
	 * Format cart item data removing any HTML tag.
	 *
	 * @param array $cart_item Cart item array.
	 * @return array
	 */
	protected function get_item_data( $cart_item ) {
		$item_data = apply_filters( 'woocommerce_get_item_data', array(), $cart_item );
		return array_map( [ $this, 'format_item_data_element' ], $item_data );
	}

	/**
	 * Remove HTML tags from cart item data and set the `hidden` property to
	 * `__experimental_woocommerce_blocks_hidden`.
	 *
	 * @param array $item_data_element Individual element of a cart item data.
	 * @return array
	 */
	protected function format_item_data_element( $item_data_element ) {
		if ( array_key_exists( '__experimental_woocommerce_blocks_hidden', $item_data_element ) ) {
			$item_data_element['hidden'] = $item_data_element['__experimental_woocommerce_blocks_hidden'];
		}
		return array_map( 'wp_strip_all_tags', $item_data_element );
	}
}
woocommerce-blocks/src/StoreApi/Schemas/ProductSchema.php000064400000066750151335517640017540 0ustar00<?php
namespace Automattic\WooCommerce\Blocks\StoreApi\Schemas;

use Automattic\WooCommerce\Blocks\Domain\Services\ExtendRestApi;


/**
 * ProductSchema class.
 *
 * @internal This API is used internally by Blocks--it is still in flux and may be subject to revisions.
 * @since 2.5.0
 */
class ProductSchema extends AbstractSchema {
	/**
	 * The schema item name.
	 *
	 * @var string
	 */
	protected $title = 'product';

	/**
	 * The schema item identifier.
	 *
	 * @var string
	 */
	const IDENTIFIER = 'product';

	/**
	 * Image attachment schema instance.
	 *
	 * @var ImageAttachmentSchema
	 */
	protected $image_attachment_schema;

	/**
	 * Constructor.
	 *
	 * @param ExtendRestApi         $extend Rest Extending instance.
	 * @param ImageAttachmentSchema $image_attachment_schema Image attachment schema instance.
	 */
	public function __construct( ExtendRestApi $extend, ImageAttachmentSchema $image_attachment_schema ) {
		$this->image_attachment_schema = $image_attachment_schema;
		parent::__construct( $extend );
	}

	/**
	 * Product schema properties.
	 *
	 * @return array
	 */
	public function get_properties() {
		return [
			'id'                  => [
				'description' => __( 'Unique identifier for the resource.', 'woocommerce' ),
				'type'        => 'integer',
				'context'     => [ 'view', 'edit' ],
				'readonly'    => true,
			],
			'name'                => [
				'description' => __( 'Product name.', 'woocommerce' ),
				'type'        => 'string',
				'context'     => [ 'view', 'edit' ],
			],
			'parent'              => [
				'description' => __( 'ID of the parent product, if applicable.', 'woocommerce' ),
				'type'        => 'integer',
				'context'     => [ 'view', 'edit' ],
				'readonly'    => true,
			],
			'type'                => [
				'description' => __( 'Product type.', 'woocommerce' ),
				'type'        => 'string',
				'context'     => [ 'view', 'edit' ],
				'readonly'    => true,
			],
			'variation'           => [
				'description' => __( 'Product variation attributes, if applicable.', 'woocommerce' ),
				'type'        => 'string',
				'context'     => [ 'view', 'edit' ],
			],
			'permalink'           => [
				'description' => __( 'Product URL.', 'woocommerce' ),
				'type'        => 'string',
				'format'      => 'uri',
				'context'     => [ 'view', 'edit' ],
				'readonly'    => true,
			],
			'short_description'   => [
				'description' => __( 'Product short description in HTML format.', 'woocommerce' ),
				'type'        => 'string',
				'context'     => [ 'view', 'edit' ],
			],
			'description'         => [
				'description' => __( 'Product full description in HTML format.', 'woocommerce' ),
				'type'        => 'string',
				'context'     => [ 'view', 'edit' ],
			],
			'on_sale'             => [
				'description' => __( 'Is the product on sale?', 'woocommerce' ),
				'type'        => 'boolean',
				'context'     => [ 'view', 'edit' ],
				'readonly'    => true,
			],
			'sku'                 => [
				'description' => __( 'Unique identifier.', 'woocommerce' ),
				'type'        => 'string',
				'context'     => [ 'view', 'edit' ],
			],
			'prices'              => [
				'description' => __( 'Price data provided using the smallest unit of the currency.', 'woocommerce' ),
				'type'        => 'object',
				'context'     => [ 'view', 'edit' ],
				'readonly'    => true,
				'properties'  => array_merge(
					$this->get_store_currency_properties(),
					[
						'price'         => [
							'description' => __( 'Current product price.', 'woocommerce' ),
							'type'        => 'string',
							'context'     => [ 'view', 'edit' ],
							'readonly'    => true,
						],
						'regular_price' => [
							'description' => __( 'Regular product price.', 'woocommerce' ),
							'type'        => 'string',
							'context'     => [ 'view', 'edit' ],
							'readonly'    => true,
						],
						'sale_price'    => [
							'description' => __( 'Sale product price, if applicable.', 'woocommerce' ),
							'type'        => 'string',
							'context'     => [ 'view', 'edit' ],
							'readonly'    => true,
						],
						'price_range'   => [
							'description' => __( 'Price range, if applicable.', 'woocommerce' ),
							'type'        => [ 'object', 'null' ],
							'context'     => [ 'view', 'edit' ],
							'readonly'    => true,
							'properties'  => [
								'min_amount' => [
									'description' => __( 'Price amount.', 'woocommerce' ),
									'type'        => 'string',
									'context'     => [ 'view', 'edit' ],
									'readonly'    => true,
								],
								'max_amount' => [
									'description' => __( 'Price amount.', 'woocommerce' ),
									'type'        => 'string',
									'context'     => [ 'view', 'edit' ],
									'readonly'    => true,
								],
							],
						],
					]
				),
			],
			'price_html'          => array(
				'description' => __( 'Price string formatted as HTML.', 'woocommerce' ),
				'type'        => 'string',
				'context'     => array( 'view', 'edit' ),
				'readonly'    => true,
			),
			'average_rating'      => [
				'description' => __( 'Reviews average rating.', 'woocommerce' ),
				'type'        => 'string',
				'context'     => [ 'view', 'edit' ],
				'readonly'    => true,
			],
			'review_count'        => [
				'description' => __( 'Amount of reviews that the product has.', 'woocommerce' ),
				'type'        => 'integer',
				'context'     => [ 'view', 'edit' ],
				'readonly'    => true,
			],
			'images'              => [
				'description' => __( 'List of images.', 'woocommerce' ),
				'type'        => 'array',
				'context'     => [ 'view', 'edit' ],
				'items'       => [
					'type'       => 'object',
					'properties' => $this->image_attachment_schema->get_properties(),
				],
			],
			'categories'          => [
				'description' => __( 'List of categories, if applicable.', 'woocommerce' ),
				'type'        => 'array',
				'context'     => [ 'view', 'edit' ],
				'items'       => [
					'type'       => 'object',
					'properties' => [
						'id'   => [
							'description' => __( 'Category ID', 'woocommerce' ),
							'type'        => 'number',
							'context'     => [ 'view', 'edit' ],
							'readonly'    => true,
						],
						'name' => [
							'description' => __( 'Category name', 'woocommerce' ),
							'type'        => 'string',
							'context'     => [ 'view', 'edit' ],
							'readonly'    => true,
						],
						'slug' => [
							'description' => __( 'Category slug', 'woocommerce' ),
							'type'        => 'string',
							'context'     => [ 'view', 'edit' ],
							'readonly'    => true,
						],
						'link' => [
							'description' => __( 'Category link', 'woocommerce' ),
							'type'        => 'string',
							'context'     => [ 'view', 'edit' ],
							'readonly'    => true,
						],
					],
				],
			],
			'tags'                => [
				'description' => __( 'List of tags, if applicable.', 'woocommerce' ),
				'type'        => 'array',
				'context'     => [ 'view', 'edit' ],
				'items'       => [
					'type'       => 'object',
					'properties' => [
						'id'   => [
							'description' => __( 'Tag ID', 'woocommerce' ),
							'type'        => 'number',
							'context'     => [ 'view', 'edit' ],
							'readonly'    => true,
						],
						'name' => [
							'description' => __( 'Tag name', 'woocommerce' ),
							'type'        => 'string',
							'context'     => [ 'view', 'edit' ],
							'readonly'    => true,
						],
						'slug' => [
							'description' => __( 'Tag slug', 'woocommerce' ),
							'type'        => 'string',
							'context'     => [ 'view', 'edit' ],
							'readonly'    => true,
						],
						'link' => [
							'description' => __( 'Tag link', 'woocommerce' ),
							'type'        => 'string',
							'context'     => [ 'view', 'edit' ],
							'readonly'    => true,
						],
					],
				],
			],
			'attributes'          => [
				'description' => __( 'List of attributes assigned to the product/variation that are visible or used for variations.', 'woocommerce' ),
				'type'        => 'array',
				'context'     => [ 'view', 'edit' ],
				'items'       => [
					'type'       => 'object',
					'properties' => [
						'id'             => [
							'description' => __( 'The attribute ID, or 0 if the attribute is not taxonomy based.', 'woocommerce' ),
							'type'        => 'integer',
							'context'     => [ 'view', 'edit' ],
							'readonly'    => true,
						],
						'name'           => [
							'description' => __( 'The attribute name.', 'woocommerce' ),
							'type'        => 'string',
							'context'     => [ 'view', 'edit' ],
							'readonly'    => true,
						],
						'taxonomy'       => [
							'description' => __( 'The attribute taxonomy, or null if the attribute is not taxonomy based.', 'woocommerce' ),
							'type'        => 'string',
							'context'     => [ 'view', 'edit' ],
							'readonly'    => true,
						],
						'has_variations' => [
							'description' => __( 'True if this attribute is used by product variations.', 'woocommerce' ),
							'type'        => 'boolean',
							'context'     => [ 'view', 'edit' ],
							'readonly'    => true,
						],
						'terms'          => [
							'description' => __( 'List of assigned attribute terms.', 'woocommerce' ),
							'type'        => 'array',
							'context'     => [ 'view', 'edit' ],
							'items'       => [
								'type'       => 'object',
								'properties' => [
									'id'      => [
										'description' => __( 'The term ID, or 0 if the attribute is not a global attribute.', 'woocommerce' ),
										'type'        => 'integer',
										'context'     => [ 'view', 'edit' ],
										'readonly'    => true,
									],
									'name'    => [
										'description' => __( 'The term name.', 'woocommerce' ),
										'type'        => 'string',
										'context'     => [ 'view', 'edit' ],
										'readonly'    => true,
									],
									'slug'    => [
										'description' => __( 'The term slug.', 'woocommerce' ),
										'type'        => 'string',
										'context'     => [ 'view', 'edit' ],
										'readonly'    => true,
									],
									'default' => [
										'description' => __( 'If this is a default attribute', 'woocommerce' ),
										'type'        => 'boolean',
										'context'     => [ 'view', 'edit' ],
										'readonly'    => true,
									],
								],
							],
						],
					],
				],
			],
			'variations'          => [
				'description' => __( 'List of variation IDs, if applicable.', 'woocommerce' ),
				'type'        => 'array',
				'context'     => [ 'view', 'edit' ],
				'items'       => [
					'type'       => 'object',
					'properties' => [
						'id'         => [
							'description' => __( 'The attribute ID, or 0 if the attribute is not taxonomy based.', 'woocommerce' ),
							'type'        => 'integer',
							'context'     => [ 'view', 'edit' ],
							'readonly'    => true,
						],
						'attributes' => [
							'description' => __( 'List of variation attributes.', 'woocommerce' ),
							'type'        => 'array',
							'context'     => [ 'view', 'edit' ],
							'items'       => [
								'type'       => 'object',
								'properties' => [
									'name'  => [
										'description' => __( 'The attribute name.', 'woocommerce' ),
										'type'        => 'string',
										'context'     => [ 'view', 'edit' ],
										'readonly'    => true,
									],
									'value' => [
										'description' => __( 'The assigned attribute.', 'woocommerce' ),
										'type'        => 'string',
										'context'     => [ 'view', 'edit' ],
										'readonly'    => true,
									],
								],
							],
						],
					],
				],
			],
			'has_options'         => [
				'description' => __( 'Does the product have additional options before it can be added to the cart?', 'woocommerce' ),
				'type'        => 'boolean',
				'context'     => [ 'view', 'edit' ],
				'readonly'    => true,
			],
			'is_purchasable'      => [
				'description' => __( 'Is the product purchasable?', 'woocommerce' ),
				'type'        => 'boolean',
				'context'     => [ 'view', 'edit' ],
				'readonly'    => true,
			],
			'is_in_stock'         => [
				'description' => __( 'Is the product in stock?', 'woocommerce' ),
				'type'        => 'boolean',
				'context'     => [ 'view', 'edit' ],
				'readonly'    => true,
			],
			'is_on_backorder'     => [
				'description' => __( 'Is the product stock backordered? This will also return false if backorder notifications are turned off.', 'woocommerce' ),
				'type'        => 'boolean',
				'context'     => [ 'view', 'edit' ],
				'readonly'    => true,
			],
			'low_stock_remaining' => [
				'description' => __( 'Quantity left in stock if stock is low, or null if not applicable.', 'woocommerce' ),
				'type'        => [ 'integer', 'null' ],
				'context'     => [ 'view', 'edit' ],
				'readonly'    => true,
			],
			'sold_individually'   => [
				'description' => __( 'If true, only one item of this product is allowed for purchase in a single order.', 'woocommerce' ),
				'type'        => 'boolean',
				'context'     => [ 'view', 'edit' ],
				'readonly'    => true,
			],
			'quantity_limit'      => [
				'description' => __( 'The maximum quantity than can be added to the cart at once.', 'woocommerce' ),
				'type'        => 'integer',
				'context'     => [ 'view', 'edit' ],
				'readonly'    => true,
			],
			'add_to_cart'         => [
				'description' => __( 'Add to cart button parameters.', 'woocommerce' ),
				'type'        => 'object',
				'context'     => [ 'view', 'edit' ],
				'readonly'    => true,
				'properties'  => [
					'text'        => [
						'description' => __( 'Button text.', 'woocommerce' ),
						'type'        => 'string',
						'context'     => [ 'view', 'edit' ],
						'readonly'    => true,
					],
					'description' => [
						'description' => __( 'Button description.', 'woocommerce' ),
						'type'        => 'string',
						'context'     => [ 'view', 'edit' ],
						'readonly'    => true,
					],
					'url'         => [
						'description' => __( 'Add to cart URL.', 'woocommerce' ),
						'type'        => 'string',
						'context'     => [ 'view', 'edit' ],
						'readonly'    => true,
					],
				],
			],
		];
	}

	/**
	 * Convert a WooCommerce product into an object suitable for the response.
	 *
	 * @param \WC_Product $product Product instance.
	 * @return array
	 */
	public function get_item_response( $product ) {
		return [
			'id'                  => $product->get_id(),
			'name'                => $this->prepare_html_response( $product->get_title() ),
			'parent'              => $product->get_parent_id(),
			'type'                => $product->get_type(),
			'variation'           => $this->prepare_html_response( $product->is_type( 'variation' ) ? wc_get_formatted_variation( $product, true, true, false ) : '' ),
			'permalink'           => $product->get_permalink(),
			'sku'                 => $this->prepare_html_response( $product->get_sku() ),
			'short_description'   => $this->prepare_html_response( wc_format_content( wp_kses_post( $product->get_short_description() ) ) ),
			'description'         => $this->prepare_html_response( wc_format_content( wp_kses_post( $product->get_description() ) ) ),
			'on_sale'             => $product->is_on_sale(),
			'prices'              => (object) $this->prepare_product_price_response( $product ),
			'price_html'          => $this->prepare_html_response( $product->get_price_html() ),
			'average_rating'      => (string) $product->get_average_rating(),
			'review_count'        => $product->get_review_count(),
			'images'              => $this->get_images( $product ),
			'categories'          => $this->get_term_list( $product, 'product_cat' ),
			'tags'                => $this->get_term_list( $product, 'product_tag' ),
			'attributes'          => $this->get_attributes( $product ),
			'variations'          => $this->get_variations( $product ),
			'has_options'         => $product->has_options(),
			'is_purchasable'      => $product->is_purchasable(),
			'is_in_stock'         => $product->is_in_stock(),
			'is_on_backorder'     => 'onbackorder' === $product->get_stock_status(),
			'low_stock_remaining' => $this->get_low_stock_remaining( $product ),
			'sold_individually'   => $product->is_sold_individually(),
			'quantity_limit'      => $this->get_product_quantity_limit( $product ),
			'add_to_cart'         => (object) $this->prepare_html_response(
				[
					'text'        => $product->add_to_cart_text(),
					'description' => $product->add_to_cart_description(),
					'url'         => $product->add_to_cart_url(),
				]
			),
		];
	}

	/**
	 * Get list of product images.
	 *
	 * @param \WC_Product $product Product instance.
	 * @return array
	 */
	protected function get_images( \WC_Product $product ) {
		$attachment_ids = array_merge( [ $product->get_image_id() ], $product->get_gallery_image_ids() );

		return array_filter( array_map( [ $this->image_attachment_schema, 'get_item_response' ], $attachment_ids ) );
	}

	/**
	 * Gets remaining stock amount for a product.
	 *
	 * @param \WC_Product $product Product instance.
	 * @return integer|null
	 */
	protected function get_remaining_stock( \WC_Product $product ) {
		if ( is_null( $product->get_stock_quantity() ) ) {
			return null;
		}
		return $product->get_stock_quantity();
	}

	/**
	 * If a product has low stock, return the remaining stock amount for display.
	 *
	 * @param \WC_Product $product Product instance.
	 * @return integer|null
	 */
	protected function get_low_stock_remaining( \WC_Product $product ) {
		$remaining_stock = $this->get_remaining_stock( $product );

		if ( ! is_null( $remaining_stock ) && $remaining_stock <= wc_get_low_stock_amount( $product ) ) {
			return max( $remaining_stock, 0 );
		}

		return null;
	}

	/**
	 * Get the quantity limit for an item in the cart.
	 *
	 * @param \WC_Product $product Product instance.
	 * @return int
	 */
	protected function get_product_quantity_limit( \WC_Product $product ) {
		$limits = [ 99 ];

		if ( $product->is_sold_individually() ) {
			$limits[] = 1;
		} elseif ( ! $product->backorders_allowed() ) {
			$limits[] = $this->get_remaining_stock( $product );
		}

		return apply_filters( 'woocommerce_store_api_product_quantity_limit', max( min( array_filter( $limits ) ), 1 ), $product );
	}

	/**
	 * Returns true if the given attribute is valid.
	 *
	 * @param mixed $attribute Object or variable to check.
	 * @return boolean
	 */
	protected function filter_valid_attribute( $attribute ) {
		return is_a( $attribute, '\WC_Product_Attribute' );
	}

	/**
	 * Returns true if the given attribute is valid and used for variations.
	 *
	 * @param mixed $attribute Object or variable to check.
	 * @return boolean
	 */
	protected function filter_variation_attribute( $attribute ) {
		return $this->filter_valid_attribute( $attribute ) && $attribute->get_variation();
	}

	/**
	 * Get variation IDs and attributes from the DB.
	 *
	 * @param \WC_Product $product Product instance.
	 * @returns array
	 */
	protected function get_variations( \WC_Product $product ) {
		if ( ! $product->is_type( 'variable' ) ) {
			return [];
		}
		global $wpdb;

		$variation_ids = $product->get_visible_children();

		if ( ! count( $variation_ids ) ) {
			return [];
		}

		$attributes                  = array_filter( $product->get_attributes(), [ $this, 'filter_variation_attribute' ] );
		$default_variation_meta_data = array_reduce(
			$attributes,
			function( $defaults, $attribute ) use ( $product ) {
				$meta_key              = wc_variation_attribute_name( $attribute->get_name() );
				$defaults[ $meta_key ] = [
					'name'  => wc_attribute_label( $attribute->get_name(), $product ),
					'value' => null,
				];
				return $defaults;
			},
			[]
		);

		// phpcs:disable WordPress.DB.PreparedSQL.NotPrepared
		$variation_meta_data = $wpdb->get_results(
			"
			SELECT post_id as variation_id, meta_key as attribute_key, meta_value as attribute_value
			FROM {$wpdb->postmeta}
			WHERE post_id IN (" . implode( ',', array_map( 'esc_sql', $variation_ids ) ) . ")
			AND meta_key IN ('" . implode( "','", array_map( 'esc_sql', array_keys( $default_variation_meta_data ) ) ) . "')
		"
		);
		// phpcs:enable

		$attributes_by_variation = array_reduce(
			$variation_meta_data,
			function( $values, $data ) {
				$values[ $data->variation_id ][ $data->attribute_key ] = $data->attribute_value;
				return $values;
			},
			array_fill_keys( $variation_ids, [] )
		);

		$variations = [];

		foreach ( $variation_ids as $variation_id ) {
			$attribute_data = $default_variation_meta_data;

			foreach ( $attributes_by_variation[ $variation_id ] as $meta_key => $meta_value ) {
				if ( '' !== $meta_value ) {
					$attribute_data[ $meta_key ]['value'] = $meta_value;
				}
			}

			$variations[] = (object) [
				'id'         => $variation_id,
				'attributes' => array_values( $attribute_data ),
			];
		}

		return $variations;
	}

	/**
	 * Get list of product attributes and attribute terms.
	 *
	 * @param \WC_Product $product Product instance.
	 * @return array
	 */
	protected function get_attributes( \WC_Product $product ) {
		$attributes         = array_filter( $product->get_attributes(), [ $this, 'filter_valid_attribute' ] );
		$default_attributes = $product->get_default_attributes();
		$return             = [];

		foreach ( $attributes as $attribute_slug => $attribute ) {
			// Only visible and variation attributes will be exposed by this API.
			if ( ! $attribute->get_visible() || ! $attribute->get_variation() ) {
				continue;
			}

			$terms = $attribute->is_taxonomy() ? array_map( [ $this, 'prepare_product_attribute_taxonomy_value' ], $attribute->get_terms() ) : array_map( [ $this, 'prepare_product_attribute_value' ], $attribute->get_options() );
			// Custom attribute names are sanitized to be the array keys.
			// So when we do the array_key_exists check below we also need to sanitize the attribute names.
			$sanitized_attribute_name = sanitize_key( $attribute->get_name() );

			if ( array_key_exists( $sanitized_attribute_name, $default_attributes ) ) {
				foreach ( $terms as $term ) {
					$term->default = $term->slug === $default_attributes[ $sanitized_attribute_name ];
				}
			}

			$return[] = (object) [
				'id'             => $attribute->get_id(),
				'name'           => wc_attribute_label( $attribute->get_name(), $product ),
				'taxonomy'       => $attribute->is_taxonomy() ? $attribute->get_name() : null,
				'has_variations' => true === $attribute->get_variation(),
				'terms'          => $terms,
			];
		}

		return $return;
	}

	/**
	 * Prepare an attribute term for the response.
	 *
	 * @param \WP_Term $term Term object.
	 * @return object
	 */
	protected function prepare_product_attribute_taxonomy_value( \WP_Term $term ) {
		return $this->prepare_product_attribute_value( $term->name, $term->term_id, $term->slug );
	}

	/**
	 * Prepare an attribute term for the response.
	 *
	 * @param string $name Attribute term name.
	 * @param int    $id Attribute term ID.
	 * @param string $slug Attribute term slug.
	 * @return object
	 */
	protected function prepare_product_attribute_value( $name, $id = 0, $slug = '' ) {
		return (object) [
			'id'   => (int) $id,
			'name' => $name,
			'slug' => $slug ? $slug : $name,
		];
	}

	/**
	 * Get an array of pricing data.
	 *
	 * @param \WC_Product $product Product instance.
	 * @param string      $tax_display_mode If returned prices are incl or excl of tax.
	 * @return array
	 */
	protected function prepare_product_price_response( \WC_Product $product, $tax_display_mode = '' ) {
		$prices           = [];
		$tax_display_mode = $this->get_tax_display_mode( $tax_display_mode );
		$price_function   = $this->get_price_function_from_tax_display_mode( $tax_display_mode );

		// If we have a variable product, get the price from the variations (this will use the min value).
		if ( $product->is_type( 'variable' ) ) {
			$regular_price = $product->get_variation_regular_price();
			$sale_price    = $product->get_variation_sale_price();
		} else {
			$regular_price = $product->get_regular_price();
			$sale_price    = $product->get_sale_price();
		}

		$prices['price']         = $this->prepare_money_response( $price_function( $product ), wc_get_price_decimals() );
		$prices['regular_price'] = $this->prepare_money_response( $price_function( $product, [ 'price' => $regular_price ] ), wc_get_price_decimals() );
		$prices['sale_price']    = $this->prepare_money_response( $price_function( $product, [ 'price' => $sale_price ] ), wc_get_price_decimals() );
		$prices['price_range']   = $this->get_price_range( $product, $tax_display_mode );

		return $this->prepare_currency_response( $prices );
	}

	/**
	 * WooCommerce can return prices including or excluding tax; choose the correct method based on tax display mode.
	 *
	 * @param string $tax_display_mode Provided tax display mode.
	 * @return string Valid tax display mode.
	 */
	protected function get_tax_display_mode( $tax_display_mode = '' ) {
		return in_array( $tax_display_mode, [ 'incl', 'excl' ], true ) ? $tax_display_mode : get_option( 'woocommerce_tax_display_shop' );
	}

	/**
	 * WooCommerce can return prices including or excluding tax; choose the correct method based on tax display mode.
	 *
	 * @param string $tax_display_mode If returned prices are incl or excl of tax.
	 * @return string Function name.
	 */
	protected function get_price_function_from_tax_display_mode( $tax_display_mode ) {
		return 'incl' === $tax_display_mode ? 'wc_get_price_including_tax' : 'wc_get_price_excluding_tax';
	}

	/**
	 * Get price range from certain product types.
	 *
	 * @param \WC_Product $product Product instance.
	 * @param string      $tax_display_mode If returned prices are incl or excl of tax.
	 * @return object|null
	 */
	protected function get_price_range( \WC_Product $product, $tax_display_mode = '' ) {
		$tax_display_mode = $this->get_tax_display_mode( $tax_display_mode );

		if ( $product->is_type( 'variable' ) ) {
			$prices = $product->get_variation_prices( true );

			if ( ! empty( $prices['price'] ) && ( min( $prices['price'] ) !== max( $prices['price'] ) ) ) {
				return (object) [
					'min_amount' => $this->prepare_money_response( min( $prices['price'] ), wc_get_price_decimals() ),
					'max_amount' => $this->prepare_money_response( max( $prices['price'] ), wc_get_price_decimals() ),
				];
			}
		}

		if ( $product->is_type( 'grouped' ) ) {
			$children       = array_filter( array_map( 'wc_get_product', $product->get_children() ), 'wc_products_array_filter_visible_grouped' );
			$price_function = 'incl' === $tax_display_mode ? 'wc_get_price_including_tax' : 'wc_get_price_excluding_tax';

			foreach ( $children as $child ) {
				if ( '' !== $child->get_price() ) {
					$child_prices[] = $price_function( $child );
				}
			}

			if ( ! empty( $child_prices ) ) {
				return (object) [
					'min_amount' => $this->prepare_money_response( min( $child_prices ), wc_get_price_decimals() ),
					'max_amount' => $this->prepare_money_response( max( $child_prices ), wc_get_price_decimals() ),
				];
			}
		}

		return null;
	}

	/**
	 * Returns a list of terms assigned to the product.
	 *
	 * @param \WC_Product $product Product object.
	 * @param string      $taxonomy Taxonomy name.
	 * @return array Array of terms (id, name, slug).
	 */
	protected function get_term_list( \WC_Product $product, $taxonomy = '' ) {
		if ( ! $taxonomy ) {
			return [];
		}

		$terms = get_the_terms( $product->get_id(), $taxonomy );

		if ( ! $terms || is_wp_error( $terms ) ) {
			return [];
		}

		$return           = [];
		$default_category = (int) get_option( 'default_product_cat', 0 );

		foreach ( $terms as $term ) {
			$link = get_term_link( $term, $taxonomy );

			if ( is_wp_error( $link ) ) {
				continue;
			}

			if ( $term->term_id === $default_category ) {
				continue;
			}

			$return[] = (object) [
				'id'   => $term->term_id,
				'name' => $term->name,
				'slug' => $term->slug,
				'link' => $link,
			];
		}

		return $return;
	}
}
woocommerce-blocks/src/StoreApi/Schemas/CartCouponSchema.php000064400000006600151335517640020161 0ustar00<?php
namespace Automattic\WooCommerce\Blocks\StoreApi\Schemas;

use Automattic\WooCommerce\Blocks\StoreApi\Utilities\CartController;

/**
 * CartCouponSchema class.
 *
 * @internal This API is used internally by Blocks--it is still in flux and may be subject to revisions.
 * @since 2.5.0
 * @since 3.9.0 Coupon type (`discount_type`) added.
 */
class CartCouponSchema extends AbstractSchema {
	/**
	 * The schema item name.
	 *
	 * @var string
	 */
	protected $title = 'cart_coupon';

	/**
	 * The schema item identifier.
	 *
	 * @var string
	 */
	const IDENTIFIER = 'cart-coupon';

	/**
	 * Cart schema properties.
	 *
	 * @return array
	 */
	public function get_properties() {
		return [
			'code'          => [
				'description' => __( 'The coupon\'s unique code.', 'woocommerce' ),
				'type'        => 'string',
				'context'     => [ 'view', 'edit' ],
				'arg_options' => [
					'sanitize_callback' => 'wc_format_coupon_code',
					'validate_callback' => [ $this, 'coupon_exists' ],
				],
			],
			'discount_type' => [
				'description' => __( 'The discount type for the coupon (e.g. percentage or fixed amount)', 'woocommerce' ),
				'type'        => 'string',
				'context'     => [ 'view', 'edit' ],
				'arg_options' => [
					'validate_callback' => [ $this, 'coupon_exists' ],
				],
			],
			'totals'        => [
				'description' => __( 'Total amounts provided using the smallest unit of the currency.', 'woocommerce' ),
				'type'        => 'object',
				'context'     => [ 'view', 'edit' ],
				'readonly'    => true,
				'properties'  => array_merge(
					$this->get_store_currency_properties(),
					[
						'total_discount'     => [
							'description' => __( 'Total discount applied by this coupon.', 'woocommerce' ),
							'type'        => 'string',
							'context'     => [ 'view', 'edit' ],
							'readonly'    => true,
						],
						'total_discount_tax' => [
							'description' => __( 'Total tax removed due to discount applied by this coupon.', 'woocommerce' ),
							'type'        => 'string',
							'context'     => [ 'view', 'edit' ],
							'readonly'    => true,
						],
					]
				),
			],
		];
	}

	/**
	 * Check given coupon exists.
	 *
	 * @param string $coupon_code Coupon code.
	 * @return bool
	 */
	public function coupon_exists( $coupon_code ) {
		$coupon = new \WC_Coupon( $coupon_code );
		return (bool) $coupon->get_id() || $coupon->get_virtual();
	}

	/**
	 * Generate a response from passed coupon code.
	 *
	 * @param string $coupon_code Coupon code from the cart.
	 * @return array
	 */
	public function get_item_response( $coupon_code ) {
		$controller           = new CartController();
		$cart                 = $controller->get_cart_instance();
		$total_discounts      = $cart->get_coupon_discount_totals();
		$total_discount_taxes = $cart->get_coupon_discount_tax_totals();
		$coupon               = new \WC_Coupon( $coupon_code );
		return [
			'code'          => $coupon_code,
			'discount_type' => $coupon->get_discount_type(),
			'totals'        => (object) $this->prepare_currency_response(
				[
					'total_discount'     => $this->prepare_money_response( isset( $total_discounts[ $coupon_code ] ) ? $total_discounts[ $coupon_code ] : 0, wc_get_price_decimals() ),
					'total_discount_tax' => $this->prepare_money_response( isset( $total_discount_taxes[ $coupon_code ] ) ? $total_discount_taxes[ $coupon_code ] : 0, wc_get_price_decimals(), PHP_ROUND_HALF_DOWN ),
				]
			),
		];
	}
}
woocommerce-blocks/src/StoreApi/Schemas/AbstractAddressSchema.php000064400000014645151335517640021165 0ustar00<?php
namespace Automattic\WooCommerce\Blocks\StoreApi\Schemas;

use Automattic\WooCommerce\Blocks\RestApi\Routes;

/**
 * AddressSchema class.
 *
 * Provides a generic address schema for composition in other schemas.
 *
 * @internal This API is used internally by Blocks--it is still in flux and may be subject to revisions.
 * @since 4.1.0
 */
abstract class AbstractAddressSchema extends AbstractSchema {
	/**
	 * Term properties.
	 *
	 * @internal Note that required properties don't require values, just that they are included in the request.
	 * @return array
	 */
	public function get_properties() {
		return [
			'first_name' => [
				'description' => __( 'First name', 'woocommerce' ),
				'type'        => 'string',
				'context'     => [ 'view', 'edit' ],
				'required'    => true,
			],
			'last_name'  => [
				'description' => __( 'Last name', 'woocommerce' ),
				'type'        => 'string',
				'context'     => [ 'view', 'edit' ],
				'required'    => true,
			],
			'company'    => [
				'description' => __( 'Company', 'woocommerce' ),
				'type'        => 'string',
				'context'     => [ 'view', 'edit' ],
				'required'    => true,
			],
			'address_1'  => [
				'description' => __( 'Address', 'woocommerce' ),
				'type'        => 'string',
				'context'     => [ 'view', 'edit' ],
				'required'    => true,
			],
			'address_2'  => [
				'description' => __( 'Apartment, suite, etc.', 'woocommerce' ),
				'type'        => 'string',
				'context'     => [ 'view', 'edit' ],
				'required'    => true,
			],
			'city'       => [
				'description' => __( 'City', 'woocommerce' ),
				'type'        => 'string',
				'context'     => [ 'view', 'edit' ],
				'required'    => true,
			],
			'state'      => [
				'description' => __( 'State/County code, or name of the state, county, province, or district.', 'woocommerce' ),
				'type'        => 'string',
				'context'     => [ 'view', 'edit' ],
				'required'    => true,
			],
			'postcode'   => [
				'description' => __( 'Postal code', 'woocommerce' ),
				'type'        => 'string',
				'context'     => [ 'view', 'edit' ],
				'required'    => true,
			],
			'country'    => [
				'description' => __( 'Country/Region code in ISO 3166-1 alpha-2 format.', 'woocommerce' ),
				'type'        => 'string',
				'context'     => [ 'view', 'edit' ],
				'required'    => true,
			],
			'phone'      => [
				'description' => __( 'Phone', 'woocommerce' ),
				'type'        => 'string',
				'context'     => [ 'view', 'edit' ],
				'required'    => true,
			],
		];
	}

	/**
	 * Sanitize and format the given address object.
	 *
	 * @param array            $address Value being sanitized.
	 * @param \WP_REST_Request $request The Request.
	 * @param string           $param The param being sanitized.
	 * @return array
	 */
	public function sanitize_callback( $address, $request, $param ) {
		$address               = array_merge( array_fill_keys( array_keys( $this->get_properties() ), '' ), (array) $address );
		$address['country']    = wc_strtoupper( wc_clean( wp_unslash( $address['country'] ) ) );
		$address['first_name'] = wc_clean( wp_unslash( $address['first_name'] ) );
		$address['last_name']  = wc_clean( wp_unslash( $address['last_name'] ) );
		$address['company']    = wc_clean( wp_unslash( $address['company'] ) );
		$address['address_1']  = wc_clean( wp_unslash( $address['address_1'] ) );
		$address['address_2']  = wc_clean( wp_unslash( $address['address_2'] ) );
		$address['city']       = wc_clean( wp_unslash( $address['city'] ) );
		$address['state']      = $this->format_state( wc_clean( wp_unslash( $address['state'] ) ), $address['country'] );
		$address['postcode']   = $address['postcode'] ? wc_format_postcode( wc_clean( wp_unslash( $address['postcode'] ) ), $address['country'] ) : '';
		$address['phone']      = wc_clean( wp_unslash( $address['phone'] ) );
		return $address;
	}

	/**
	 * Format a state based on the country. If country has defined states, will return an upper case state code.
	 *
	 * @param string $state State name or code (sanitized).
	 * @param string $country Country code.
	 * @return string
	 */
	protected function format_state( $state, $country ) {
		$states = $country ? array_filter( (array) wc()->countries->get_states( $country ) ) : [];

		if ( count( $states ) ) {
			$state        = wc_strtoupper( $state );
			$state_values = array_map( 'wc_strtoupper', array_flip( array_map( 'wc_strtoupper', $states ) ) );

			if ( isset( $state_values[ $state ] ) ) {
				// Convert to state code if a state name was provided.
				return $state_values[ $state ];
			}
		}

		return $state;
	}

	/**
	 * Validate the given address object.
	 *
	 * @see rest_validate_value_from_schema
	 *
	 * @param array            $address Value being sanitized.
	 * @param \WP_REST_Request $request The Request.
	 * @param string           $param The param being sanitized.
	 * @return true|\WP_Error
	 */
	public function validate_callback( $address, $request, $param ) {
		$errors  = new \WP_Error();
		$address = $this->sanitize_callback( $address, $request, $param );

		if ( empty( $address['country'] ) ) {
			$errors->add(
				'missing_country',
				__( 'Country is required', 'woocommerce' )
			);
			return $errors;
		}

		if ( ! in_array( $address['country'], array_keys( wc()->countries->get_countries() ), true ) ) {
			$errors->add(
				'invalid_country',
				sprintf(
					/* translators: %s valid country codes */
					__( 'Invalid country code provided. Must be one of: %s', 'woocommerce' ),
					implode( ', ', array_keys( wc()->countries->get_countries() ) )
				)
			);
			return $errors;
		}

		$states = array_filter( array_keys( (array) wc()->countries->get_states( $address['country'] ) ) );

		if ( ! empty( $address['state'] ) && count( $states ) && ! in_array( $address['state'], $states, true ) ) {
			$errors->add(
				'invalid_state',
				sprintf(
					/* translators: %s valid states */
					__( 'The provided state is not valid. Must be one of: %s', 'woocommerce' ),
					implode( ', ', $states )
				)
			);
		}

		if ( ! empty( $address['postcode'] ) && ! \WC_Validation::is_postcode( $address['postcode'], $address['country'] ) ) {
			$errors->add(
				'invalid_postcode',
				__( 'The provided postcode / ZIP is not valid', 'woocommerce' )
			);
		}

		if ( ! empty( $address['phone'] ) && ! \WC_Validation::is_phone( $address['phone'] ) ) {
			$errors->add(
				'invalid_phone',
				__( 'The provided phone number is not valid', 'woocommerce' )
			);
		}

		return $errors->has_errors( $errors ) ? $errors : true;
	}
}
woocommerce-blocks/src/StoreApi/Schemas/CartFeeSchema.php000064400000004453151335517640017421 0ustar00<?php
namespace Automattic\WooCommerce\Blocks\StoreApi\Schemas;

use Automattic\WooCommerce\Blocks\Domain\Services\ExtendRestApi;

/**
 * CartFeeSchema class.
 *
 * @internal This API is used internally by Blocks--it is still in flux and may be subject to revisions.
 */
class CartFeeSchema extends AbstractSchema {
	/**
	 * The schema item name.
	 *
	 * @var string
	 */
	protected $title = 'cart_fee';

	/**
	 * The schema item identifier.
	 *
	 * @var string
	 */
	const IDENTIFIER = 'cart-fee';

	/**
	 * Cart schema properties.
	 *
	 * @return array
	 */
	public function get_properties() {
		return [
			'id'     => [
				'description' => __( 'Unique identifier for the fee within the cart.', 'woocommerce' ),
				'type'        => 'string',
				'context'     => [ 'view', 'edit' ],
				'readonly'    => true,
			],
			'name'   => [
				'description' => __( 'Fee name.', 'woocommerce' ),
				'type'        => 'string',
				'context'     => [ 'view', 'edit' ],
				'readonly'    => true,
			],
			'totals' => [
				'description' => __( 'Fee total amounts provided using the smallest unit of the currency.', 'woocommerce' ),
				'type'        => 'object',
				'context'     => [ 'view', 'edit' ],
				'readonly'    => true,
				'properties'  => array_merge(
					$this->get_store_currency_properties(),
					[
						'total'     => [
							'description' => __( 'Total amount for this fee.', 'woocommerce' ),
							'type'        => 'string',
							'context'     => [ 'view', 'edit' ],
							'readonly'    => true,
						],
						'total_tax' => [
							'description' => __( 'Total tax amount for this fee.', 'woocommerce' ),
							'type'        => 'string',
							'context'     => [ 'view', 'edit' ],
							'readonly'    => true,
						],
					]
				),
			],
		];
	}

	/**
	 * Convert a WooCommerce cart fee to an object suitable for the response.
	 *
	 * @param array $fee Cart fee data.
	 * @return array
	 */
	public function get_item_response( $fee ) {
		return [
			'key'    => $fee->id,
			'name'   => $this->prepare_html_response( $fee->name ),
			'totals' => (object) $this->prepare_currency_response(
				[
					'total'     => $this->prepare_money_response( $fee->total, wc_get_price_decimals() ),
					'total_tax' => $this->prepare_money_response( $fee->tax, wc_get_price_decimals(), PHP_ROUND_HALF_DOWN ),
				]
			),
		];
	}
}
woocommerce-blocks/src/StoreApi/Schemas/ProductCollectionDataSchema.php000064400000010471151335517640022333 0ustar00<?php
namespace Automattic\WooCommerce\Blocks\StoreApi\Schemas;

/**
 * ProductCollectionDataSchema class.
 *
 * @internal This API is used internally by Blocks--it is still in flux and may be subject to revisions.
 * @since 2.5.0
 */
class ProductCollectionDataSchema extends AbstractSchema {
	/**
	 * The schema item name.
	 *
	 * @var string
	 */
	protected $title = 'product-collection-data';

	/**
	 * The schema item identifier.
	 *
	 * @var string
	 */
	const IDENTIFIER = 'product-collection-data';

	/**
	 * Product collection data schema properties.
	 *
	 * @return array
	 */
	public function get_properties() {
		return [
			'price_range'         => [
				'description' => __( 'Min and max prices found in collection of products, provided using the smallest unit of the currency.', 'woocommerce' ),
				'type'        => [ 'object', 'null' ],
				'context'     => [ 'view', 'edit' ],
				'readonly'    => true,
				'properties'  => array_merge(
					$this->get_store_currency_properties(),
					[
						'min_price' => [
							'description' => __( 'Min price found in collection of products.', 'woocommerce' ),
							'type'        => 'string',
							'context'     => [ 'view', 'edit' ],
							'readonly'    => true,
						],
						'max_price' => [
							'description' => __( 'Max price found in collection of products.', 'woocommerce' ),
							'type'        => 'string',
							'context'     => [ 'view', 'edit' ],
							'readonly'    => true,
						],
					]
				),
			],
			'attribute_counts'    => [
				'description' => __( 'Returns number of products within attribute terms.', 'woocommerce' ),
				'type'        => [ 'array', 'null' ],
				'context'     => [ 'view', 'edit' ],
				'readonly'    => true,
				'items'       => [
					'type'       => 'object',
					'properties' => [
						'term'  => [
							'description' => __( 'Term ID', 'woocommerce' ),
							'type'        => 'integer',
							'context'     => [ 'view', 'edit' ],
							'readonly'    => true,
						],
						'count' => [
							'description' => __( 'Number of products.', 'woocommerce' ),
							'type'        => 'integer',
							'context'     => [ 'view', 'edit' ],
							'readonly'    => true,
						],
					],
				],
			],
			'rating_counts'       => [
				'description' => __( 'Returns number of products with each average rating.', 'woocommerce' ),
				'type'        => [ 'array', 'null' ],
				'context'     => [ 'view', 'edit' ],
				'readonly'    => true,
				'items'       => [
					'type'       => 'object',
					'properties' => [
						'rating' => [
							'description' => __( 'Average rating', 'woocommerce' ),
							'type'        => 'integer',
							'context'     => [ 'view', 'edit' ],
							'readonly'    => true,
						],
						'count'  => [
							'description' => __( 'Number of products.', 'woocommerce' ),
							'type'        => 'integer',
							'context'     => [ 'view', 'edit' ],
							'readonly'    => true,
						],
					],
				],
			],
			'stock_status_counts' => [
				'description' => __( 'Returns number of products with each stock status.', 'woocommerce' ),
				'type'        => [ 'array', 'null' ],
				'context'     => [ 'view', 'edit' ],
				'readonly'    => true,
				'items'       => [
					'type'       => 'object',
					'properties' => [
						'status' => [
							'description' => __( 'Status', 'woocommerce' ),
							'type'        => 'string',
							'context'     => [ 'view', 'edit' ],
							'readonly'    => true,
						],
						'count'  => [
							'description' => __( 'Number of products.', 'woocommerce' ),
							'type'        => 'integer',
							'context'     => [ 'view', 'edit' ],
							'readonly'    => true,
						],
					],
				],
			],
		];
	}

	/**
	 * Format data.
	 *
	 * @param array $data Collection data to format and return.
	 * @return array
	 */
	public function get_item_response( $data ) {
		return [
			'price_range'         => ! is_null( $data['min_price'] ) && ! is_null( $data['max_price'] ) ? (object) $this->prepare_currency_response(
				[
					'min_price' => $this->prepare_money_response( $data['min_price'], wc_get_price_decimals() ),
					'max_price' => $this->prepare_money_response( $data['max_price'], wc_get_price_decimals() ),
				]
			) : null,
			'attribute_counts'    => $data['attribute_counts'],
			'rating_counts'       => $data['rating_counts'],
			'stock_status_counts' => $data['stock_status_counts'],
		];
	}
}
woocommerce-blocks/src/StoreApi/Schemas/ErrorSchema.php000064400000002411151335517640017171 0ustar00<?php
namespace Automattic\WooCommerce\Blocks\StoreApi\Schemas;

/**
 * ErrorSchema class.
 *
 * @internal This API is used internally by Blocks--it is still in flux and may be subject to revisions.
 * @since 2.5.0
 */
class ErrorSchema extends AbstractSchema {
	/**
	 * The schema item name.
	 *
	 * @var string
	 */
	protected $title = 'error';

	/**
	 * The schema item identifier.
	 *
	 * @var string
	 */
	const IDENTIFIER = 'error';

	/**
	 * Product schema properties.
	 *
	 * @return array
	 */
	public function get_properties() {
		return [
			'code'    => [
				'description' => __( 'Error code', 'woocommerce' ),
				'type'        => 'string',
				'context'     => [ 'view', 'edit' ],
				'readonly'    => true,
			],
			'message' => [
				'description' => __( 'Error message', 'woocommerce' ),
				'type'        => 'string',
				'context'     => [ 'view', 'edit' ],
				'readonly'    => true,
			],
		];
	}

	/**
	 * Convert a WP_Error into an object suitable for the response.
	 *
	 * @param \WP_Error $error Error object.
	 * @return array
	 */
	public function get_item_response( \WP_Error $error ) {
		return [
			'code'    => $this->prepare_html_response( $error->get_error_code() ),
			'message' => $this->prepare_html_response( $error->get_error_message() ),
		];
	}

}
woocommerce-blocks/src/StoreApi/Schemas/ImageAttachmentSchema.php000064400000005234151335517640021141 0ustar00<?php
namespace Automattic\WooCommerce\Blocks\StoreApi\Schemas;

/**
 * ImageAttachmentSchema class.
 *
 * @internal This API is used internally by Blocks--it is still in flux and may be subject to revisions.
 */
class ImageAttachmentSchema extends AbstractSchema {
	/**
	 * The schema item name.
	 *
	 * @var string
	 */
	protected $title = 'image';

	/**
	 * The schema item identifier.
	 *
	 * @var string
	 */
	const IDENTIFIER = 'image';

	/**
	 * Product schema properties.
	 *
	 * @return array
	 */
	public function get_properties() {
		return [
			'id'        => [
				'description' => __( 'Image ID.', 'woocommerce' ),
				'type'        => 'integer',
				'context'     => [ 'view', 'edit' ],
			],
			'src'       => [
				'description' => __( 'Full size image URL.', 'woocommerce' ),
				'type'        => 'string',
				'format'      => 'uri',
				'context'     => [ 'view', 'edit' ],
			],
			'thumbnail' => [
				'description' => __( 'Thumbnail URL.', 'woocommerce' ),
				'type'        => 'string',
				'format'      => 'uri',
				'context'     => [ 'view', 'edit' ],
			],
			'srcset'    => [
				'description' => __( 'Thumbnail srcset for responsive images.', 'woocommerce' ),
				'type'        => 'string',
				'context'     => [ 'view', 'edit' ],
			],
			'sizes'     => [
				'description' => __( 'Thumbnail sizes for responsive images.', 'woocommerce' ),
				'type'        => 'string',
				'context'     => [ 'view', 'edit' ],
			],
			'name'      => [
				'description' => __( 'Image name.', 'woocommerce' ),
				'type'        => 'string',
				'context'     => [ 'view', 'edit' ],
			],
			'alt'       => [
				'description' => __( 'Image alternative text.', 'woocommerce' ),
				'type'        => 'string',
				'context'     => [ 'view', 'edit' ],
			],
		];
	}

	/**
	 * Convert a WooCommerce product into an object suitable for the response.
	 *
	 * @param int $attachment_id Image attachment ID.
	 * @return array|null
	 */
	public function get_item_response( $attachment_id ) {
		if ( ! $attachment_id ) {
			return null;
		}

		$attachment = wp_get_attachment_image_src( $attachment_id, 'full' );

		if ( ! is_array( $attachment ) ) {
			return [];
		}

		$thumbnail = wp_get_attachment_image_src( $attachment_id, 'woocommerce_thumbnail' );

		return [
			'id'        => (int) $attachment_id,
			'src'       => current( $attachment ),
			'thumbnail' => current( $thumbnail ),
			'srcset'    => (string) wp_get_attachment_image_srcset( $attachment_id, 'full' ),
			'sizes'     => (string) wp_get_attachment_image_sizes( $attachment_id, 'full' ),
			'name'      => get_the_title( $attachment_id ),
			'alt'       => get_post_meta( $attachment_id, '_wp_attachment_image_alt', true ),
		];
	}

}
woocommerce-blocks/src/StoreApi/Schemas/CartShippingRateSchema.php000064400000026476151335517640021330 0ustar00<?php
namespace Automattic\WooCommerce\Blocks\StoreApi\Schemas;

use WC_Shipping_Rate as ShippingRate;

/**
 * CartShippingRateSchema class.
 *
 * @internal This API is used internally by Blocks--it is still in flux and may be subject to revisions.
 */
class CartShippingRateSchema extends AbstractSchema {
	/**
	 * The schema item name.
	 *
	 * @var string
	 */
	protected $title = 'cart-shipping-rate';

	/**
	 * The schema item identifier.
	 *
	 * @var string
	 */
	const IDENTIFIER = 'cart-shipping-rate';

	/**
	 * Cart schema properties.
	 *
	 * @return array
	 */
	public function get_properties() {
		return [
			'package_id'     => [
				'description' => __( 'The ID of the package the shipping rates belong to.', 'woocommerce' ),
				'type'        => [ 'integer', 'string' ],
				'context'     => [ 'view', 'edit' ],
				'readonly'    => true,
			],
			'name'           => [
				'description' => __( 'Name of the package.', 'woocommerce' ),
				'type'        => 'string',
				'context'     => [ 'view', 'edit' ],
				'readonly'    => true,
			],
			'destination'    => [
				'description' => __( 'Shipping destination address.', 'woocommerce' ),
				'type'        => 'object',
				'context'     => [ 'view', 'edit' ],
				'readonly'    => true,
				'properties'  => [
					'address_1' => [
						'description' => __( 'First line of the address being shipped to.', 'woocommerce' ),
						'type'        => 'string',
						'context'     => [ 'view', 'edit' ],
						'readonly'    => true,
					],
					'address_2' => [
						'description' => __( 'Second line of the address being shipped to.', 'woocommerce' ),
						'type'        => 'string',
						'context'     => [ 'view', 'edit' ],
						'readonly'    => true,
					],
					'city'      => [
						'description' => __( 'City of the address being shipped to.', 'woocommerce' ),
						'type'        => 'string',
						'context'     => [ 'view', 'edit' ],
						'readonly'    => true,
					],
					'state'     => [
						'description' => __( 'ISO code, or name, for the state, province, or district of the address being shipped to.', 'woocommerce' ),
						'type'        => 'string',
						'context'     => [ 'view', 'edit' ],
						'readonly'    => true,
					],
					'postcode'  => [
						'description' => __( 'Zip or Postcode of the address being shipped to.', 'woocommerce' ),
						'type'        => 'string',
						'context'     => [ 'view', 'edit' ],
						'readonly'    => true,
					],
					'country'   => [
						'description' => __( 'ISO code for the country of the address being shipped to.', 'woocommerce' ),
						'type'        => 'string',
						'context'     => [ 'view', 'edit' ],
						'readonly'    => true,
					],
				],
			],
			'items'          => [
				'description' => __( 'List of cart items the returned shipping rates apply to.', 'woocommerce' ),
				'type'        => 'array',
				'context'     => [ 'view', 'edit' ],
				'readonly'    => true,
				'items'       => [
					'type'       => 'object',
					'properties' => [
						'key'      => [
							'description' => __( 'Unique identifier for the item within the cart.', 'woocommerce' ),
							'type'        => 'string',
							'context'     => [ 'view', 'edit' ],
							'readonly'    => true,
						],
						'name'     => [
							'description' => __( 'Name of the item.', 'woocommerce' ),
							'type'        => 'string',
							'context'     => [ 'view', 'edit' ],
							'readonly'    => true,
						],
						'quantity' => [
							'description' => __( 'Quantity of the item in the current package.', 'woocommerce' ),
							'type'        => 'number',
							'context'     => [ 'view', 'edit' ],
							'readonly'    => true,
						],
					],
				],
			],
			'shipping_rates' => [
				'description' => __( 'List of shipping rates.', 'woocommerce' ),
				'type'        => 'array',
				'context'     => [ 'view', 'edit' ],
				'readonly'    => true,
				'items'       => [
					'type'       => 'object',
					'properties' => $this->get_rate_properties(),
				],
			],
		];
	}

	/**
	 * Schema for a single rate.
	 *
	 * @return array
	 */
	protected function get_rate_properties() {
		return array_merge(
			[
				'rate_id'       => [
					'description' => __( 'ID of the shipping rate.', 'woocommerce' ),
					'type'        => 'string',
					'context'     => [ 'view', 'edit' ],
					'readonly'    => true,
				],
				'name'          => [
					'description' => __( 'Name of the shipping rate, e.g. Express shipping.', 'woocommerce' ),
					'type'        => 'string',
					'context'     => [ 'view', 'edit' ],
					'readonly'    => true,
				],
				'description'   => [
					'description' => __( 'Description of the shipping rate, e.g. Dispatched via USPS.', 'woocommerce' ),
					'type'        => 'string',
					'context'     => [ 'view', 'edit' ],
					'readonly'    => true,
				],
				'delivery_time' => [
					'description' => __( 'Delivery time estimate text, e.g. 3-5 business days.', 'woocommerce' ),
					'type'        => 'string',
					'context'     => [ 'view', 'edit' ],
					'readonly'    => true,
				],
				'price'         => [
					'description' => __( 'Price of this shipping rate using the smallest unit of the currency.', 'woocommerce' ),
					'type'        => 'string',
					'context'     => [ 'view', 'edit' ],
					'readonly'    => true,
				],
				'taxes'         => [
					'description' => __( 'Taxes applied to this shipping rate using the smallest unit of the currency.', 'woocommerce' ),
					'type'        => 'string',
					'context'     => [ 'view', 'edit' ],
					'readonly'    => true,
				],
				'method_id'     => [
					'description' => __( 'ID of the shipping method that provided the rate.', 'woocommerce' ),
					'type'        => 'string',
					'context'     => [ 'view', 'edit' ],
					'readonly'    => true,
				],
				'instance_id'   => [
					'description' => __( 'Instance ID of the shipping method that provided the rate.', 'woocommerce' ),
					'type'        => 'integer',
					'context'     => [ 'view', 'edit' ],
					'readonly'    => true,
				],
				'meta_data'     => [
					'description' => __( 'Meta data attached to the shipping rate.', 'woocommerce' ),
					'type'        => 'array',
					'context'     => [ 'view', 'edit' ],
					'items'       => [
						'type'       => 'object',
						'properties' => [
							'key'   => [
								'description' => __( 'Meta key.', 'woocommerce' ),
								'type'        => 'string',
								'context'     => [ 'view', 'edit' ],
								'readonly'    => true,
							],
							'value' => [
								'description' => __( 'Meta value.', 'woocommerce' ),
								'type'        => 'string',
								'context'     => [ 'view', 'edit' ],
								'readonly'    => true,
							],
						],
					],
				],
				'selected'      => [
					'description' => __( 'True if this is the rate currently selected by the customer for the cart.', 'woocommerce' ),
					'type'        => 'boolean',
					'context'     => [ 'view', 'edit' ],
					'readonly'    => true,
				],
			],
			$this->get_store_currency_properties()
		);
	}

	/**
	 * Convert a shipping rate from WooCommerce into a valid response.
	 *
	 * @param array $package Shipping package complete with rates from WooCommerce.
	 * @return array
	 */
	public function get_item_response( $package ) {
		return [
			'package_id'     => $package['package_id'],
			'name'           => $package['package_name'],
			'destination'    => $this->prepare_package_destination_response( $package ),
			'items'          => $this->prepare_package_items_response( $package ),
			'shipping_rates' => $this->prepare_package_shipping_rates_response( $package ),
		];
	}

	/**
	 * Gets and formats the destination address of a package.
	 *
	 * @param array $package Shipping package complete with rates from WooCommerce.
	 * @return object
	 */
	protected function prepare_package_destination_response( $package ) {
		return (object) $this->prepare_html_response(
			[
				'address_1' => $package['destination']['address_1'],
				'address_2' => $package['destination']['address_2'],
				'city'      => $package['destination']['city'],
				'state'     => $package['destination']['state'],
				'postcode'  => $package['destination']['postcode'],
				'country'   => $package['destination']['country'],
			]
		);
	}

	/**
	 * Gets items from a package and creates an array of strings containing product names and quantities.
	 *
	 * @param array $package Shipping package complete with rates from WooCommerce.
	 * @return array
	 */
	protected function prepare_package_items_response( $package ) {
		$items = array();
		foreach ( $package['contents'] as $item_id => $values ) {
			$items[] = [
				'key'      => $item_id,
				'name'     => $values['data']->get_name(),
				'quantity' => $values['quantity'],
			];
		}
		return $items;
	}

	/**
	 * Prepare an array of rates from a package for the response.
	 *
	 * @param array $package Shipping package complete with rates from WooCommerce.
	 * @return array
	 */
	protected function prepare_package_shipping_rates_response( $package ) {
		$rates          = $package['rates'];
		$selected_rates = wc()->session->get( 'chosen_shipping_methods', array() );
		$selected_rate  = isset( $selected_rates[ $package['package_id'] ] ) ? $selected_rates[ $package['package_id'] ] : '';

		if ( empty( $selected_rate ) && ! empty( $package['rates'] ) ) {
			$selected_rate = wc_get_chosen_shipping_method_for_package( $package['package_id'], $package );
		}

		$response = [];

		foreach ( $package['rates'] as $rate ) {
			$response[] = $this->get_rate_response( $rate, $selected_rate );
		}

		return $response;
	}

	/**
	 * Response for a single rate.
	 *
	 * @param WC_Shipping_Rate $rate Rate object.
	 * @param string           $selected_rate Selected rate.
	 * @return array
	 */
	protected function get_rate_response( $rate, $selected_rate = '' ) {
		return $this->prepare_currency_response(
			[
				'rate_id'       => $this->get_rate_prop( $rate, 'id' ),
				'name'          => $this->prepare_html_response( $this->get_rate_prop( $rate, 'label' ) ),
				'description'   => $this->prepare_html_response( $this->get_rate_prop( $rate, 'description' ) ),
				'delivery_time' => $this->prepare_html_response( $this->get_rate_prop( $rate, 'delivery_time' ) ),
				'price'         => $this->prepare_money_response( $this->get_rate_prop( $rate, 'cost' ), wc_get_price_decimals() ),
				'taxes'         => $this->prepare_money_response( array_sum( $this->get_rate_prop( $rate, 'taxes' ) ), wc_get_price_decimals() ),
				'instance_id'   => $this->get_rate_prop( $rate, 'instance_id' ),
				'method_id'     => $this->get_rate_prop( $rate, 'method_id' ),
				'meta_data'     => $this->get_rate_meta_data( $rate ),
				'selected'      => $selected_rate === $this->get_rate_prop( $rate, 'id' ),
			]
		);
	}

	/**
	 * Gets a prop of the rate object, if callable.
	 *
	 * @param WC_Shipping_Rate $rate Rate object.
	 * @param string           $prop Prop name.
	 * @return string
	 */
	protected function get_rate_prop( $rate, $prop ) {
		$getter = 'get_' . $prop;
		return \is_callable( array( $rate, $getter ) ) ? $rate->$getter() : '';
	}

	/**
	 * Converts rate meta data into a suitable response object.
	 *
	 * @param WC_Shipping_Rate $rate Rate object.
	 * @return array
	 */
	protected function get_rate_meta_data( $rate ) {
		$meta_data = $rate->get_meta_data();

		return array_reduce(
			array_keys( $meta_data ),
			function( $return, $key ) use ( $meta_data ) {
				$return[] = [
					'key'   => $key,
					'value' => $meta_data[ $key ],
				];
				return $return;
			},
			[]
		);
	}
}
woocommerce-blocks/src/StoreApi/Schemas/ProductCategorySchema.php000064400000007302151335517640021222 0ustar00<?php
namespace Automattic\WooCommerce\Blocks\StoreApi\Schemas;

use Automattic\WooCommerce\Blocks\Domain\Services\ExtendRestApi;


/**
 * ProductCategorySchema class.
 *
 * @internal This API is used internally by Blocks--it is still in flux and may be subject to revisions.
 */
class ProductCategorySchema extends TermSchema {
	/**
	 * The schema item name.
	 *
	 * @var string
	 */
	protected $title = 'product-category';

	/**
	 * The schema item identifier.
	 *
	 * @var string
	 */
	const IDENTIFIER = 'product-category';

	/**
	 * Image attachment schema instance.
	 *
	 * @var ImageAttachmentSchema
	 */
	protected $image_attachment_schema;

	/**
	 * Constructor.
	 *
	 * @param ExtendRestApi         $extend Rest Extending instance.
	 * @param ImageAttachmentSchema $image_attachment_schema Image attachment schema instance.
	 */
	public function __construct( ExtendRestApi $extend, ImageAttachmentSchema $image_attachment_schema ) {
		$this->image_attachment_schema = $image_attachment_schema;
		parent::__construct( $extend );
	}

	/**
	 * Term properties.
	 *
	 * @return array
	 */
	public function get_properties() {
		$schema                 = parent::get_properties();
		$schema['image']        = [
			'description' => __( 'Category image.', 'woocommerce' ),
			'type'        => 'object',
			'context'     => [ 'view', 'edit', 'embed' ],
			'readonly'    => true,
			'properties'  => $this->image_attachment_schema->get_properties(),
		];
		$schema['review_count'] = [
			'description' => __( 'Number of reviews for products in this category.', 'woocommerce' ),
			'type'        => 'integer',
			'context'     => [ 'view', 'edit' ],
			'readonly'    => true,
		];
		$schema['permalink']    = [
			'description' => __( 'Category URL.', 'woocommerce' ),
			'type'        => 'string',
			'format'      => 'uri',
			'context'     => [ 'view', 'edit', 'embed' ],
			'readonly'    => true,
		];
		return $schema;
	}

	/**
	 * Convert a term object into an object suitable for the response.
	 *
	 * @param \WP_Term $term Term object.
	 * @return array
	 */
	public function get_item_response( $term ) {
		$response = parent::get_item_response( $term );
		$count    = get_term_meta( $term->term_id, 'product_count_product_cat', true );

		if ( $count ) {
			$response['count'] = (int) $count;
		}

		$response['image']        = $this->image_attachment_schema->get_item_response( get_term_meta( $term->term_id, 'thumbnail_id', true ) );
		$response['review_count'] = $this->get_category_review_count( $term );
		$response['permalink']    = get_term_link( $term->term_id, 'product_cat' );

		return $response;
	}

	/**
	 * Get total number of reviews for products in a category.
	 *
	 * @param \WP_Term $term Term object.
	 * @return int
	 */
	protected function get_category_review_count( $term ) {
		global $wpdb;

		$children = get_term_children( $term->term_id, 'product_cat' );

		if ( ! $children || is_wp_error( $children ) ) {
			$terms_to_count_str = absint( $term->term_id );
		} else {
			$terms_to_count     = array_unique( array_map( 'absint', array_merge( array( $term->term_id ), $children ) ) );
			$terms_to_count_str = implode( ',', $terms_to_count );
		}

		// phpcs:disable WordPress.DB.PreparedSQL.InterpolatedNotPrepared
		$products_of_category_sql = $wpdb->prepare(
			"SELECT SUM(comment_count) as review_count
			FROM {$wpdb->posts} AS posts
			INNER JOIN {$wpdb->term_relationships} AS term_relationships ON posts.ID = term_relationships.object_id
			WHERE term_relationships.term_taxonomy_id IN ({$terms_to_count_str})"
		);
		// phpcs:enable WordPress.DB.PreparedSQL.InterpolatedNotPrepared

		$review_count = $wpdb->get_var( $products_of_category_sql ); // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared

		return (int) $review_count;
	}
}
woocommerce-blocks/src/StoreApi/Schemas/ProductAttributeSchema.php000064400000005173151335517640021414 0ustar00<?php
namespace Automattic\WooCommerce\Blocks\StoreApi\Schemas;

/**
 * ProductAttributeSchema class.
 *
 * @internal This API is used internally by Blocks--it is still in flux and may be subject to revisions.
 * @since 2.5.0
 */
class ProductAttributeSchema extends AbstractSchema {
	/**
	 * The schema item name.
	 *
	 * @var string
	 */
	protected $title = 'product_attribute';

	/**
	 * The schema item identifier.
	 *
	 * @var string
	 */
	const IDENTIFIER = 'product-attribute';

	/**
	 * Term properties.
	 *
	 * @return array
	 */
	public function get_properties() {
		return [
			'id'           => array(
				'description' => __( 'Unique identifier for the resource.', 'woocommerce' ),
				'type'        => 'integer',
				'context'     => array( 'view', 'edit' ),
				'readonly'    => true,
			),
			'name'         => array(
				'description' => __( 'Attribute name.', 'woocommerce' ),
				'type'        => 'string',
				'context'     => array( 'view', 'edit' ),
				'readonly'    => true,
			),
			'taxonomy'     => array(
				'description' => __( 'The attribute taxonomy name.', 'woocommerce' ),
				'type'        => 'string',
				'context'     => array( 'view', 'edit' ),
				'readonly'    => true,
			),
			'type'         => array(
				'description' => __( 'Attribute type.', 'woocommerce' ),
				'type'        => 'string',
				'context'     => array( 'view', 'edit' ),
				'readonly'    => true,
			),
			'order'        => array(
				'description' => __( 'How terms in this attribute are sorted by default.', 'woocommerce' ),
				'type'        => 'string',
				'context'     => array( 'view', 'edit' ),
				'readonly'    => true,
			),
			'has_archives' => array(
				'description' => __( 'If this attribute has term archive pages.', 'woocommerce' ),
				'type'        => 'boolean',
				'context'     => array( 'view', 'edit' ),
				'readonly'    => true,
			),
			'count'        => array(
				'description' => __( 'Number of terms in the attribute taxonomy.', 'woocommerce' ),
				'type'        => 'integer',
				'context'     => array( 'view', 'edit' ),
				'readonly'    => true,
			),
		];
	}

	/**
	 * Convert an attribute object into an object suitable for the response.
	 *
	 * @param object $attribute Attribute object.
	 * @return array
	 */
	public function get_item_response( $attribute ) {
		return [
			'id'           => (int) $attribute->id,
			'name'         => $this->prepare_html_response( $attribute->name ),
			'taxonomy'     => $attribute->slug,
			'type'         => $attribute->type,
			'order'        => $attribute->order_by,
			'has_archives' => $attribute->has_archives,
			'count'        => (int) \wp_count_terms( $attribute->slug ),
		];
	}
}
woocommerce-blocks/src/StoreApi/Schemas/CheckoutSchema.php000064400000016331151335517640017653 0ustar00<?php
namespace Automattic\WooCommerce\Blocks\StoreApi\Schemas;

use Automattic\WooCommerce\Blocks\Payments\PaymentResult;
use Automattic\WooCommerce\Blocks\Domain\Services\ExtendRestApi;


/**
 * CheckoutSchema class.
 *
 * @internal This API is used internally by Blocks--it is still in flux and may be subject to revisions.
 */
class CheckoutSchema extends AbstractSchema {
	/**
	 * The schema item name.
	 *
	 * @var string
	 */
	protected $title = 'checkout';

	/**
	 * The schema item identifier.
	 *
	 * @var string
	 */
	const IDENTIFIER = 'checkout';

	/**
	 * Billing address schema instance.
	 *
	 * @var BillingAddressSchema
	 */
	protected $billing_address_schema;

	/**
	 * Shipping address schema instance.
	 *
	 * @var ShippingAddressSchema
	 */
	protected $shipping_address_schema;

	/**
	 * Constructor.
	 *
	 * @param ExtendRestApi         $extend Rest Extending instance.
	 * @param BillingAddressSchema  $billing_address_schema Billing address schema instance.
	 * @param ShippingAddressSchema $shipping_address_schema Shipping address schema instance.
	 */
	public function __construct( ExtendRestApi $extend, BillingAddressSchema $billing_address_schema, ShippingAddressSchema $shipping_address_schema ) {
		$this->billing_address_schema  = $billing_address_schema;
		$this->shipping_address_schema = $shipping_address_schema;
		parent::__construct( $extend );
	}

	/**
	 * Checkout schema properties.
	 *
	 * @return array
	 */
	public function get_properties() {
		return [
			'order_id'          => [
				'description' => __( 'The order ID to process during checkout.', 'woocommerce' ),
				'type'        => 'integer',
				'context'     => [ 'view', 'edit' ],
				'readonly'    => true,
			],
			'status'            => [
				'description' => __( 'Order status. Payment providers will update this value after payment.', 'woocommerce' ),
				'type'        => 'string',
				'context'     => [ 'view', 'edit' ],
				'readonly'    => true,
			],
			'order_key'         => [
				'description' => __( 'Order key used to check validity or protect access to certain order data.', 'woocommerce' ),
				'type'        => 'string',
				'context'     => [ 'view', 'edit' ],
				'readonly'    => true,
			],
			'customer_note'     => [
				'description' => __( 'Note added to the order by the customer during checkout.', 'woocommerce' ),
				'type'        => 'string',
				'context'     => [ 'view', 'edit' ],
			],
			'customer_id'       => [
				'description' => __( 'Customer ID if registered. Will return 0 for guests.', 'woocommerce' ),
				'type'        => 'integer',
				'context'     => [ 'view', 'edit' ],
				'readonly'    => true,
			],
			'billing_address'   => [
				'description' => __( 'Billing address.', 'woocommerce' ),
				'type'        => 'object',
				'context'     => [ 'view', 'edit' ],
				'properties'  => $this->billing_address_schema->get_properties(),
				'arg_options' => [
					'sanitize_callback' => [ $this->billing_address_schema, 'sanitize_callback' ],
					'validate_callback' => [ $this->billing_address_schema, 'validate_callback' ],
				],
				'required'    => true,
			],
			'shipping_address'  => [
				'description' => __( 'Shipping address.', 'woocommerce' ),
				'type'        => 'object',
				'context'     => [ 'view', 'edit' ],
				'properties'  => $this->shipping_address_schema->get_properties(),
				'arg_options' => [
					'sanitize_callback' => [ $this->shipping_address_schema, 'sanitize_callback' ],
					'validate_callback' => [ $this->shipping_address_schema, 'validate_callback' ],
				],
				'required'    => true,
			],
			'payment_method'    => [
				'description' => __( 'The ID of the payment method being used to process the payment.', 'woocommerce' ),
				'type'        => 'string',
				'context'     => [ 'view', 'edit' ],
				'enum'        => wc()->payment_gateways->get_payment_gateway_ids(),
			],
			'create_account'    => [
				'description' => __( 'Whether to create a new user account as part of order processing.', 'woocommerce' ),
				'type'        => 'boolean',
				'context'     => [ 'view', 'edit' ],
			],
			'payment_result'    => [
				'description' => __( 'Result of payment processing, or false if not yet processed.', 'woocommerce' ),
				'type'        => 'object',
				'context'     => [ 'view', 'edit' ],
				'readonly'    => true,
				'properties'  => [
					'payment_status'  => [
						'description' => __( 'Status of the payment returned by the gateway. One of success, pending, failure, error.', 'woocommerce' ),
						'readonly'    => true,
						'type'        => 'string',
					],
					'payment_details' => [
						'description' => __( 'An array of data being returned from the payment gateway.', 'woocommerce' ),
						'readonly'    => true,
						'type'        => 'array',
						'items'       => [
							'type'       => 'object',
							'properties' => [
								'key'   => [
									'type' => 'string',
								],
								'value' => [
									'type' => 'string',
								],
							],
						],
					],
					'redirect_url'    => [
						'description' => __( 'A URL to redirect the customer after checkout. This could be, for example, a link to the payment processors website.', 'woocommerce' ),
						'readonly'    => true,
						'type'        => 'string',
					],
				],
			],
			self::EXTENDING_KEY => $this->get_extended_schema( self::IDENTIFIER ),
		];
	}

	/**
	 * Return the response for checkout.
	 *
	 * @param object $item Results from checkout action.
	 * @return array
	 */
	public function get_item_response( $item ) {
		return $this->get_checkout_response( $item->order, $item->payment_result );
	}

	/**
	 * Get the checkout response based on the current order and any payments.
	 *
	 * @param \WC_Order     $order Order object.
	 * @param PaymentResult $payment_result Payment result object.
	 * @return array
	 */
	protected function get_checkout_response( \WC_Order $order, PaymentResult $payment_result = null ) {
		return [
			'order_id'          => $order->get_id(),
			'status'            => $order->get_status(),
			'order_key'         => $order->get_order_key(),
			'customer_note'     => $order->get_customer_note(),
			'customer_id'       => $order->get_customer_id(),
			'billing_address'   => $this->billing_address_schema->get_item_response( $order ),
			'shipping_address'  => $this->shipping_address_schema->get_item_response( $order ),
			'payment_method'    => $order->get_payment_method(),
			'payment_result'    => [
				'payment_status'  => $payment_result->status,
				'payment_details' => $this->prepare_payment_details_for_response( $payment_result->payment_details ),
				'redirect_url'    => $payment_result->redirect_url,
			],
			self::EXTENDING_KEY => $this->get_extended_data( self::IDENTIFIER ),
		];
	}

	/**
	 * This prepares the payment details for the response so it's following the
	 * schema where it's an array of objects.
	 *
	 * @param array $payment_details An array of payment details from the processed payment.
	 *
	 * @return array An array of objects where each object has the key and value
	 *               as distinct properties.
	 */
	protected function prepare_payment_details_for_response( array $payment_details ) {
		return array_map(
			function( $key, $value ) {
				return (object) [
					'key'   => $key,
					'value' => $value,
				];
			},
			array_keys( $payment_details ),
			$payment_details
		);
	}
}
woocommerce-blocks/global.d.ts000064400000000171151335517640012401 0ustar00// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
declare let __webpack_public_path__: string;
woocommerce-blocks/LICENSE000064400000104515151335517640011363 0ustar00                    GNU GENERAL PUBLIC LICENSE
                       Version 3, 29 June 2007

 Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
 Everyone is permitted to copy and distribute verbatim copies
 of this license document, but changing it is not allowed.

                            Preamble

  The GNU General Public License is a free, copyleft license for
software and other kinds of works.

  The licenses for most software and other practical works are designed
to take away your freedom to share and change the works.  By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users.  We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors.  You can apply it to
your programs, too.

  When we speak of free software, we are referring to freedom, not
price.  Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.

  To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights.  Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.

  For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received.  You must make sure that they, too, receive
or can get the source code.  And you must show them these terms so they
know their rights.

  Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.

  For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software.  For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.

  Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so.  This is fundamentally incompatible with the aim of
protecting users' freedom to change the software.  The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable.  Therefore, we
have designed this version of the GPL to prohibit the practice for those
products.  If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.

  Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary.  To prevent this, the GPL assures that
patents cannot be used to render the program non-free.

  The precise terms and conditions for copying, distribution and
modification follow.

                       TERMS AND CONDITIONS

  0. Definitions.

  "This License" refers to version 3 of the GNU General Public License.

  "Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.

  "The Program" refers to any copyrightable work licensed under this
License.  Each licensee is addressed as "you".  "Licensees" and
"recipients" may be individuals or organizations.

  To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy.  The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.

  A "covered work" means either the unmodified Program or a work based
on the Program.

  To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy.  Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.

  To "convey" a work means any kind of propagation that enables other
parties to make or receive copies.  Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.

  An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License.  If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.

  1. Source Code.

  The "source code" for a work means the preferred form of the work
for making modifications to it.  "Object code" means any non-source
form of a work.

  A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.

  The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form.  A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.

  The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities.  However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work.  For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.

  The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.

  The Corresponding Source for a work in source code form is that
same work.

  2. Basic Permissions.

  All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met.  This License explicitly affirms your unlimited
permission to run the unmodified Program.  The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work.  This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.

  You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force.  You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright.  Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.

  Conveying under any other circumstances is permitted solely under
the conditions stated below.  Sublicensing is not allowed; section 10
makes it unnecessary.

  3. Protecting Users' Legal Rights From Anti-Circumvention Law.

  No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.

  When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.

  4. Conveying Verbatim Copies.

  You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.

  You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.

  5. Conveying Modified Source Versions.

  You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:

    a) The work must carry prominent notices stating that you modified
    it, and giving a relevant date.

    b) The work must carry prominent notices stating that it is
    released under this License and any conditions added under section
    7.  This requirement modifies the requirement in section 4 to
    "keep intact all notices".

    c) You must license the entire work, as a whole, under this
    License to anyone who comes into possession of a copy.  This
    License will therefore apply, along with any applicable section 7
    additional terms, to the whole of the work, and all its parts,
    regardless of how they are packaged.  This License gives no
    permission to license the work in any other way, but it does not
    invalidate such permission if you have separately received it.

    d) If the work has interactive user interfaces, each must display
    Appropriate Legal Notices; however, if the Program has interactive
    interfaces that do not display Appropriate Legal Notices, your
    work need not make them do so.

  A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit.  Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.

  6. Conveying Non-Source Forms.

  You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:

    a) Convey the object code in, or embodied in, a physical product
    (including a physical distribution medium), accompanied by the
    Corresponding Source fixed on a durable physical medium
    customarily used for software interchange.

    b) Convey the object code in, or embodied in, a physical product
    (including a physical distribution medium), accompanied by a
    written offer, valid for at least three years and valid for as
    long as you offer spare parts or customer support for that product
    model, to give anyone who possesses the object code either (1) a
    copy of the Corresponding Source for all the software in the
    product that is covered by this License, on a durable physical
    medium customarily used for software interchange, for a price no
    more than your reasonable cost of physically performing this
    conveying of source, or (2) access to copy the
    Corresponding Source from a network server at no charge.

    c) Convey individual copies of the object code with a copy of the
    written offer to provide the Corresponding Source.  This
    alternative is allowed only occasionally and noncommercially, and
    only if you received the object code with such an offer, in accord
    with subsection 6b.

    d) Convey the object code by offering access from a designated
    place (gratis or for a charge), and offer equivalent access to the
    Corresponding Source in the same way through the same place at no
    further charge.  You need not require recipients to copy the
    Corresponding Source along with the object code.  If the place to
    copy the object code is a network server, the Corresponding Source
    may be on a different server (operated by you or a third party)
    that supports equivalent copying facilities, provided you maintain
    clear directions next to the object code saying where to find the
    Corresponding Source.  Regardless of what server hosts the
    Corresponding Source, you remain obligated to ensure that it is
    available for as long as needed to satisfy these requirements.

    e) Convey the object code using peer-to-peer transmission, provided
    you inform other peers where the object code and Corresponding
    Source of the work are being offered to the general public at no
    charge under subsection 6d.

  A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.

  A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling.  In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage.  For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product.  A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.

  "Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source.  The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.

  If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information.  But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).

  The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed.  Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.

  Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.

  7. Additional Terms.

  "Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law.  If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.

  When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it.  (Additional permissions may be written to require their own
removal in certain cases when you modify the work.)  You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.

  Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:

    a) Disclaiming warranty or limiting liability differently from the
    terms of sections 15 and 16 of this License; or

    b) Requiring preservation of specified reasonable legal notices or
    author attributions in that material or in the Appropriate Legal
    Notices displayed by works containing it; or

    c) Prohibiting misrepresentation of the origin of that material, or
    requiring that modified versions of such material be marked in
    reasonable ways as different from the original version; or

    d) Limiting the use for publicity purposes of names of licensors or
    authors of the material; or

    e) Declining to grant rights under trademark law for use of some
    trade names, trademarks, or service marks; or

    f) Requiring indemnification of licensors and authors of that
    material by anyone who conveys the material (or modified versions of
    it) with contractual assumptions of liability to the recipient, for
    any liability that these contractual assumptions directly impose on
    those licensors and authors.

  All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10.  If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term.  If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.

  If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.

  Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.

  8. Termination.

  You may not propagate or modify a covered work except as expressly
provided under this License.  Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).

  However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.

  Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.

  Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License.  If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.

  9. Acceptance Not Required for Having Copies.

  You are not required to accept this License in order to receive or
run a copy of the Program.  Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance.  However,
nothing other than this License grants you permission to propagate or
modify any covered work.  These actions infringe copyright if you do
not accept this License.  Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.

  10. Automatic Licensing of Downstream Recipients.

  Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License.  You are not responsible
for enforcing compliance by third parties with this License.

  An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations.  If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.

  You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License.  For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.

  11. Patents.

  A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based.  The
work thus licensed is called the contributor's "contributor version".

  A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version.  For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.

  Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.

  In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement).  To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.

  If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients.  "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.

  If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.

  A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License.  You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.

  Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.

  12. No Surrender of Others' Freedom.

  If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License.  If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all.  For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.

  13. Use with the GNU Affero General Public License.

  Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work.  The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.

  14. Revised Versions of this License.

  The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time.  Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.

  Each version is given a distinguishing version number.  If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation.  If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.

  If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.

  Later license versions may give you additional or different
permissions.  However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.

  15. Disclaimer of Warranty.

  THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW.  EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU.  SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.

  16. Limitation of Liability.

  IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.

  17. Interpretation of Sections 15 and 16.

  If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.

                     END OF TERMS AND CONDITIONS

            How to Apply These Terms to Your New Programs

  If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.

  To do so, attach the following notices to the program.  It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.

    <one line to give the program's name and a brief idea of what it does.>
    Copyright (C) <year>  <name of author>

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <https://www.gnu.org/licenses/>.

Also add information on how to contact you by electronic and paper mail.

  If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:

    <program>  Copyright (C) <year>  <name of author>
    This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
    This is free software, and you are welcome to redistribute it
    under certain conditions; type `show c' for details.

The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License.  Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".

  You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<https://www.gnu.org/licenses/>.

  The GNU General Public License does not permit incorporating your program
into proprietary programs.  If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library.  If this is what you want to do, use the GNU Lesser General
Public License instead of this License.  But first, please read
<https://www.gnu.org/licenses/why-not-lgpl.html>.
woocommerce-blocks/images/payment-methods/unionpay.svg000064400000000754151335517640017324 0ustar00<svg xmlns="http://www.w3.org/2000/svg" fill="none" aria-hidden="true" viewBox="0 0 42 16">
  <path fill="#E21836" d="M13.8 1h5.8c.8 0 1.3.7 1 1.5L18 14a2 2 0 01-1.8 1.5h-5.8c-.8 0-1.3-.6-1.1-1.5L12 2.5A2 2 0 0113.8 1z"/>
  <path fill="#00447C" d="M19 1h6.7c.8 0 .5.7.3 1.5L23.3 14c-.2.9-.1 1.5-1 1.5h-6.6c-.8 0-1.3-.6-1.1-1.5l2.7-11.5A2 2 0 0119 1z"/>
  <path fill="#007B84" d="M25.5 1h5.8c.8 0 1.3.7 1 1.5L29.8 14a2 2 0 01-1.8 1.5H22c-.8 0-1.3-.6-1.1-1.5l2.7-11.5A2 2 0 0125.5 1z"/>
</svg>
woocommerce-blocks/images/payment-methods/alipay.svg000064400000012431151335517640016734 0ustar00<svg xmlns="http://www.w3.org/2000/svg" id="Layer_1" data-name="Layer 1" preserveAspectRatio="xMidYMid meet" viewBox="0 0 750 374">
  <defs/>
  <path d="M325.8 287.4l-7.3 1.4-7.3 2.8-5.6 4.2a10.2 10.2 0 00-2.1 5.6l1.7 4.5c1.4 2.1 4.6 2.1 4.6 2.1l5.9-1.7 2-3.9-1.3-7.7 3.8-2 5.6-.8 6.7 1.8 3.4 3.8 1.4 3.9.7 3.1v5.6l-12.2 4.2L314 318l-5.2 2.5-4.2 3.1a16.4 16.4 0 00-3.1 4.6l-1 6.2c0 6.3 4.8 10.5 4.8 10.5a19.8 19.8 0 0011.9 4.2l8.7-1.4 2.8-1 9.4-6.3a9.7 9.7 0 004.2 6c2.8 2.4 8 2.4 8 2.4l5.3-.7 5.2-1.8V343h-4.2l-3.1-1-2.8-2.1-1-3.8.7-29.3-1.8-9.5-5.2-5.9-7.4-3.1-10-.7zM338 315l-.3 20.6-6 4.9-6 2h-2.4a10.3 10.3 0 01-7-2.4c-2.8-2.4-2.8-7.3-2.8-7.3a13.2 13.2 0 011.8-6.3l5.2-4.9 7.7-3.5 9.8-3.1zm23-25.8h29.3v4.2l-4.5.7s-2.8.6-2.8 1.7l.3 1 16.1 35 15.4-34.3-2.8-2.7-5.9-1.8v-3.8H430v3.8l-4.9 1.7a13.6 13.6 0 00-4.9 5.3l-13.6 29.7-16.8 32.8-6.2 7.3-5.3 3.5-5.2.7s-4.5 0-7.7-2.4a6.3 6.3 0 01-2.8-5l1.4-4.5a7.7 7.7 0 015-2l3.4.6 2.4 1.8 3.9 4.9 8-8s6.6-10.2 4.2-18.2l-19.2-41.9-4.6-4.2-6-2.1V289m-99.8-1.4l-8.4 2.2-8.4 5.9h-.7v-6.6l-1-.7-21.7 1.4v3.8l4.2.7 3.2 1 2.4 2.5 1 3.5v62.1l-.7 3.5-2.8 2.1-3.5.7H221v4.2h36v-4.2l-9.4-1.4-2.5-2-1.4-3.6v-17.4h.7l6.3 2.4 9.4 1.4h1l10.5-2 9.4-6.7 7-9.4 2.5-13-2.1-12.2a33 33 0 00-6.3-9.8 27.5 27.5 0 00-8.4-6.3l-10.7-2zm-.4 8.8h.4a20 20 0 0113.3 7.3c4.1 5.6 3.8 14 3.8 14a25.6 25.6 0 01-4.5 14.3c-4.6 6.7-12.6 7.7-12.6 7.7-7.7.7-17.5-4.5-17.5-4.5v-34.6a42.5 42.5 0 0117.1-4.2zM95 262.3l-30.4 70.5-2.8 4.9-4.2 3.5-4.2 1.7-4.2.4v4.2h35v-4.2l-9.1-1.4c-4.6-1.4-4.6-3.9-4.6-3.9l.4-2.4 6.3-17.5h32.4l7.7 19.2.4 1.4v1.4c0 1.4-3.2 1.8-3.2 1.8l-8.3 1.4v4.2h38.4v-4.2l-3.9-.4-4.2-1.4-3.1-3.1a6.7 6.7 0 01-2.4-3.5l-30.7-72.6zm-1.8 18.5h.4l13.6 32.4H79.6zm101.3 0a8 8 0 01-5.6-2.5 7.8 7.8 0 01-2.4-5.6 9.3 9.3 0 012.4-5.5 8.9 8.9 0 015.6-2.5 9.9 9.9 0 016.3 2.5l2.1 5.2-2 6a9.5 9.5 0 01-6.4 2.4m11.5 8.7V337l1 3.5 2.8 1.7 6 1.4v3.9h-31v-3.9l5.5-.7 2.8-1.7 1-3.5v-36l-1-3.8-2.8-2.5-3.5-1-4.2-.7v-3.9l22.7-1.4.7 1M166 255.7l-22.7 1.4-1.4.3v3.5h1.4l3.5.7 4.2 1.4 2.8 2.8 1 4.2v67.8l-1 3.5-2.8 1.7-6 .7v3.8h31.5v-3.8l-3.2-.3-2.8-1-2.8-1.8-.7-3.5v-80.3l-1-1m424.3 34.2l21.6-1.4 1 1v8h.4l3.8-3.4 4.6-3.2a22.8 22.8 0 015.5-2.4l7.4-.7 10.8 2.8 6.6 7.3 3.9-3.5 4.9-3.1a23.7 23.7 0 015.6-2.8l7.6-.7s8.4 0 13 4.9c0 0 4.9 4.8 4.9 14.6V337l.6 3.5 2.5 2 3.1.8 3.5.3v3.9h-31.4v-3.9l5.6-.7 2.8-1.7.7-3.5v-30s0-6.3-2.8-9.8a11.9 11.9 0 00-7.6-3.1l-6.3.7-5.3 2.4-3.1 2.8-1.8 2.8V337l.7 3.5 2.8 2 2.8.8 3.2.3v3.9H631v-3.9l5.2-.7 2.8-1.7.7-3.5v-30s0-6.3-2.8-9.8a10.8 10.8 0 00-7.6-3.1l-6 .7-5.2 2.4-3.1 3.1-2.1 2.5V337l.7 3.5 2.8 1.7 2.8 1 3.1.4v3.8h-31v-3.8l5.9-.7 2.8-1.8.7-3.4v-36.3l-1-3.5-2.5-2.5-3.2-1-3.9-.7v-3.8m-125.6 30.7s0 11.8 5.9 18.8c0 0 5.6 7.4 15 7.4l11.5-3.2 8.7-8.7 4.2 2.8a37.3 37.3 0 01-11.8 11.5 36 36 0 01-16 4.2s-14.7 0-23.5-8.7a35.4 35.4 0 01-8.7-23.8 35 35 0 012.4-11.8 35.8 35.8 0 016.7-10.5 38.5 38.5 0 0110.5-7 40 40 0 0113.6-2.8s10.1 0 16.8 4.2c0 0 6.2 4.9 6.2 11.9l-1.7 5.6-5.2 2-6.7-1.7s-2.4-1.4-2.4-3.8l1-5.6 1.1-4.5-3.9-2.5-5.5-.7-6.3 1-6 5-4.2 8.3a43.8 43.8 0 00-1.7 12.6m84.8-31.8a39.8 39.8 0 00-24.4 9c-9.1 9.1-9.1 23.5-9.1 23.5a37 37 0 002.4 13.6l7.4 10.5a38.7 38.7 0 0010.8 6.2l12.6 2.1h.3l14.4-2.4a34.1 34.1 0 0010.8-7.3l7-10.5 2-12.9a33.4 33.4 0 00-9.4-23c-9.4-8.8-24.1-8.8-24.1-8.8h-.7zm-.2 4.9h.6l9 2 6 6.4 3.1 8.7 1 10.1c0 13-4.9 20.6-4.9 20.6a19 19 0 01-14.3 7.7h-.3l-8.8-2.4-5.9-6.3-3.5-9.1a61.3 61.3 0 01-1-11.2l.7-9.4 3.1-8.4a26 26 0 016.7-6.6 20.6 20.6 0 018.5-2.1zm-118.2 55.5a5.2 5.2 0 005.3-5.6s0-5.2-5.3-5.2c0 0-5.6 0-5.6 5.2 0 0 0 5.6 5.6 5.6" class="cls-1"/>
  <path d="M700.5 0v2.4h6v15.8h2V2.4h6V0zM717 0v18.2h2.5v-15l5.2 15h2.1l4.9-14.7v14.7h2.5V0h-3.2l-5.2 15.4L720.4 0z"/>
  <path d="M585.6 0l-9 .7S567 2.7 567 7v14l-40.8 1.4v-7.7h-18.9s-18.8 1.4-18.8 7v51H567v34.9H513v14h54.1v80l40.2-4.2v-75.9h57.6v-14h-57.6V72.6H675v-7h1.8s5.2 0 8.3-8.3l3.2-23S688 17.4 670 17.4l-62.8 2V0zm62.2 32.1a5.6 5.6 0 016 5.6L650.8 59H526.3V36l40.8-1v.3l40.2-1.7z" class="cls-2"/>
  <path d="M341.5 107.6l13 15 15 13.2s4.1 4.2 8.3 0l14.7-13.2 13-15s4.5-3.9 0-8.8l-13-14.6-14.6-13s-4.2-4.2-8.4 0l-14.7 13-13.3 14.6s-3.8 5 0 8.8m335.3 46a5.7 5.7 0 000-6.6l-10.1-11.2-11.2-9.7a4.7 4.7 0 00-6.7 0l-11.1 9.7-9.8 11.2s-2.8 3.5 0 6.6l9.8 11.2 11.1 9.8s3.5 3.5 6.7 0l11.1-9.8 10.2-11.2" class="cls-1"/>
  <path d="M77.9 90.8h119.8a166.4 166.4 0 01-12.3 30.7s-15 29.4-38 51.4c0 0-43.3 40.5-71.3 40.5 0 0-20.6 0-33.8-7.7 0 0-16.5-10.1-16.5-31 0 0 0-27.7 42.3-35.7 0 0-27.2-1.8-41.6 12.6 0 0-13.2 12.5-13.2 34.5 0 0 0 21 19.2 33.6A78.6 78.6 0 0074 230.8l5.6.4S127 228.7 171 192c0 0 37.7-31.5 56.6-76.5a187.8 187.8 0 009-28l2.1-10.8v.4h-64.6V46.4h81.4V32.9h-81.3V1.1H153l-9 .7s-9.6 2-9.6 6.2v24.8H56v13.7h78.5v30.7H78v13.6M346.4 0l-.7 6.6-4.5 16.4A94.5 94.5 0 01329 43v157.5l-40.2-4.9v-125s-15 7.7-27.9 12.6l-5.2-8.4A238.3 238.3 0 00282.9 52s26.9-26.9 26.9-45c0 0 0-4.2 9.4-6.3l9-.7h18.2" class="cls-2"/>
  <path d="M335.3 60.4h75.4v145.3l40.1.7v-146h21v-14h-21V0h-21.6l-9 .7s-9.5 2-9.5 6.3v39.5h-75.4v14" class="cls-2"/>
  <path d="M152.6 145s-51-22.4-82.4-23.5c0 0-25.8-1.4-47.1 13.6 0 0-22.4 15.8-23 39.2 0 0 0 27.2 21.6 42.6 0 0 20 14.3 52 14.3h3.2l-5.3-.4s-23.4 0-39.8-11.5c0 0-18.2-13-18.2-34.2 0 0 0-23 16.1-35 0 0 13.6-9.7 35.6-10l31.1 3.4 24.1 9.5 57.6 29.3s39.5 20.6 77.2 33.2c0 0 131.3 43.6 425 15l15.7-3.2s5.6-2.4 10.1-9.7c0 0 3.9-6 30-29.4 0 0 18.9-17 12.6-22.7l-9 1.4s-96 21.7-242.5 27.6c0 0-164.4 6.7-245.8-16.7 0 0-56.2-16.1-98.8-32.9" class="cls-1"/>
</svg>
woocommerce-blocks/images/payment-methods/wechat.svg000064400000005550151335517640016734 0ustar00<svg xmlns="http://www.w3.org/2000/svg" id="Layer_1" data-name="Layer 1" preserveAspectRatio="xMidYMid meet" viewBox="0 0 750 212">
  <defs>
    <style>
      .cls-1{fill:#2e3233}.cls-2{fill:#9de60b}
    </style>
  </defs>
  <path d="M492.4 67.2c16.2-4 36-.3 46.7 13.6a46.8 46.8 0 018.1 19.2l-21.5.1c-3-15.4-24.2-21.6-35.5-11-7.9 8.6-9.3 21.4-7.7 32.6 1.8 8.5 5.2 18.5 14 22 12.6 4.7 27.5-3.7 29.2-17.2l22 .1c-1.6 13-7.9 26.7-20.7 32-19.8 8.6-48.2 6-59.7-14.5 1.9-8.3 4-17 2-25.6-1-6.3-4.3-11.9-6.3-17.9 0-16.3 14-30.2 29.4-33.4z" class="cls-1"/>
  <path d="M274 69.6l23.6-.1c4.7 20.5 7.3 41.6 13 62 5.6-16.9 8.3-34.6 13.1-51.7 1.5-5.2 5.5-10.7 11.5-10.3 6.4-.8 10.8 5.2 12.1 10.9 4.7 16.8 7.7 34 12.9 50.7 6-20.2 9.2-41 13.5-61.5h23c-6.4 25.8-13.7 51.4-20.2 77.1-1.6 6.4-4.5 13.7-11.3 16.1-7.8 1.8-14.8-4.4-16.7-11.6-4.9-15.5-8.4-31.3-13.1-46.8-3.9 15.4-7.8 30.7-12 46-1.6 6.9-7.6 14-15.3 12.5-7.5-.8-11.1-8.2-12.8-14.6l-21.2-78.7z" class="cls-2"/>
  <path d="M552.4 69.5h21.1c0 7.8-.1 15.5.5 23.2 11.3.8 23.7-2.4 34.1 3.3 9 4.8 14.2 15 14.1 25v42l-20.5.1c-.1-13.4.2-26.8 0-40.3.2-4.5-3-9.3-7.7-9.8-6.8-.8-13.7-.4-20.5-.3v50.4h-21.1V69.7zm161.6 0h20v21h16v15.6h-16.2c.4 11.9-1 23.9.7 35.7 3.5 4.4 9.9 3.8 15 5.2l-.1 16c-11.5.2-27.2 1.7-33-10.8-5.1-14.7-1.3-30.8-2.5-46l-15.4-.1V90.7l15.6-.1-.1-21z" class="cls-1"/>
  <path d="M462.4 131.7c.3-13.4-2.6-28.6-14.5-36.6-15.6-10-40.5-8.6-51 8.1-8.7 14.7-9.2 35.6 2.7 48.9 11.4 12.8 31.5 13.5 46.4 7 8.2-3.3 12.7-11.3 15.8-19q-9.8-.4-19.6-.2a20 20 0 01-24.1 5.4c-5.2-2.5-6.3-8.6-7.9-13.5 17.4-.2 34.8 0 52.2-.1zm-52.7-14c2.3-7.2 8.2-13.4 16.4-12.1 8.1-1.3 13.6 5.2 15.9 12.1q-16.1.5-32.3 0z" class="cls-2"/>
  <path d="M695 114c-.4-12.4-11.4-22.3-23.4-23.5s-25.3-1.3-35 6.6c-5.3 3.8-7 10.3-8.3 16.2 6.1.2 12.3.2 18.4.1 3.5-10.4 17.1-11.7 25.3-6.3 3 2.6 2.8 7 3.7 10.5-12.8.5-27-2-38.3 5.4-10.8 6.4-12.8 22-6.5 32.2 4.4 6.6 13 7.8 20.3 7.8h44c-.2-16.3.3-32.7-.2-49zm-47 30c-1-3.7 1-7 2.3-10.1 8.1-1.9 16.5-2.1 24.8-2v17.2c-9-.6-20.1 2.2-27.1-5.2z" class="cls-1"/>
  <path d="M145 13.2a107.7 107.7 0 00-88.3-6.8 89.9 89.9 0 00-46.2 36.4A68.3 68.3 0 002 95a80.1 80.1 0 0034.7 47c-3 9-6.2 18-9 27.2 10.4-5.4 20.7-11 31.2-16.6a115.9 115.9 0 0039 5.5 67 67 0 01-2.7-31.4 67 67 0 0121.3-37.9 92 92 0 0169.1-22.7 80.7 80.7 0 00-40.6-53zM73.8 54.4c-1.8 9-13.8 13.2-20.7 7.2C45 56 47.2 41.8 56.7 39c9.3-3.6 19.9 5.8 17.1 15.4zm64.5-2.6c0 10.3-13.6 16.7-21.2 9.7-8-5.7-5.7-19.5 3.6-22.4 8.3-3.3 18.2 3.7 17.6 12.7z" class="cls-2"/>
  <path d="M250.6 114a70.4 70.4 0 00-32.9-33.5 90.6 90.6 0 00-81.2.3 67.5 67.5 0 00-36 44.3 57 57 0 007.2 42.2 77.6 77.6 0 0053 34.5 97.4 97.4 0 0046.1-3c9 3.5 17 9.1 25.7 13.3q-3.4-11.3-7.2-22.4c9.7-7 18.6-15.6 23.9-26.4a57.2 57.2 0 001.4-49.3zm-87.2 5.6c-2.2 7-12.3 9-17.2 3.7-5.4-4.8-3.3-15 3.8-17.2 7.8-3.3 16.8 5.7 13.4 13.5zm51 1c-2.7 6.3-12 7.7-16.6 2.9-2.3-2-2.8-5.1-3.7-7.8 1.2-4.9 4.4-10 10-10.2 7.6-1 14.3 8.2 10.3 15z" class="cls-1"/>
</svg>
woocommerce-blocks/images/payment-methods/ideal.svg000064400000001621151335517640016532 0ustar00<svg xmlns="http://www.w3.org/2000/svg" data-name="Layer 1" viewBox="0 0 750 661.2">
  <path fill="#fff" d="M0 0v661.2h385.5c254.2 0 364.5-142.4 364.5-331.3C750 142 639.7 0 385.5 0z"/>
  <path d="M41.7 41.7h343.8c233.4 0 322.8 127.5 322.8 288.2 0 192.8-124.9 289.5-322.8 289.5H41.7zM75 75v511.1h310.5C573 586.1 675 498.8 675 330 675 156.4 564.4 75 385.5 75H75z"/>
  <path d="M116.7 367.5H216v177h-99.4z"/>
  <circle cx="166.3" cy="278.4" r="61.8"/>
  <path fill="#d50072" d="M424.5 307.3v28.6h-70.8V221h68.6v28.6h-40v13.3h37.8v28.6h-37.8v15.8zm12.4 28.6l34.7-115h40.7L547 336H517l-6.5-22.2h-37.4l-6.5 22.2zm44.7-50.8h20.7l-9.5-32.5h-1.7l-9.5 32.5zm79.8-64.2H590v86.4h42.4c-11.6-156.7-134.8-190.6-246.9-190.6H266.1V221h17.7c32.2 0 52.2 21.8 52.2 57 0 36.3-19.5 58-52.2 58H266v208.5h119.4c182.1 0 245.5-84.6 247.7-208.6h-71.8V221zM266 249.6v57.7h17.7c12.3 0 23.6-3.6 23.6-29.3 0-25.2-12.6-28.4-23.6-28.4z"/>
</svg>
woocommerce-blocks/images/payment-methods/mastercard.svg000064400000005613151335517640017606 0ustar00<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 750 471">
  <g fill="none" fill-rule="evenodd">
    <rect width="750" height="471" fill="#f4f4f4" rx="40"/>
    <path fill="#000" d="M618.6 422.1c-1.2 0-2.2.5-3 1.2a4 4 0 000 5.9 4.2 4.2 0 006 0 4 4 0 000-5.8 4.2 4.2 0 00-3-1.3zm0 7.4a3.2 3.2 0 110-6.4 3.2 3.2 0 010 6.4zm.2-5.2h-1.7v3.9h.8v-1.5h.3l1.2 1.5h1l-1.3-1.5c.4 0 .7-.2 1-.4.1-.2.3-.4.3-.7 0-.4-.2-.7-.4-1-.3-.2-.7-.3-1.2-.3zm0 .7c.2 0 .4 0 .5.2a.4.4 0 01.2.4.4.4 0 01-.2.3l-.5.2h-1v-1zm-458.6 2.8h-8.7v-41h8.5v5s7.6-6 12-6c8.8.2 14 7.6 14 7.6s4.2-7.6 13.7-7.6c14 0 16.1 13 16.1 13v28.8h-8.4v-25.4s0-7.8-9-7.8c-9.5 0-10.4 7.8-10.4 7.8v25.4h-8.7V402s-.9-8-8.8-8c-10.3 0-10.5 8.2-10.5 8.2zm266.3-42c-4.5 0-12 6-12 6v-5h-8.6v41h8.7l-.2-25.6s.2-8.3 10.5-8.3c2 0 3.4.5 4.6 1.2l2.8-8c-1.7-.7-3.6-1.2-5.8-1.3zm123.3 0c-4.5 0-12 6-12 6v-5h-8.6v41h8.7l-.1-25.6s.2-8.3 10.4-8.3c2 0 3.4.5 4.6 1.2l2.9-8c-1.8-.7-3.7-1.2-6-1.3zm-305.7-.1c-13 0-20 11.7-20 21.6 0 10 7.9 21.7 20.4 21.7 7.3 0 13.3-5.4 13.3-5.4v4.2h8.6v-41h-8.6v5.2s-5.7-6.3-13.7-6.3zm1.7 8.3c7 0 12.8 6.1 12.8 13.7 0 7.5-5.7 13.6-12.8 13.6-7 0-12.7-6-12.7-13.6s5.7-13.7 12.7-13.7zm249.7-8.3c-13.1 0-20 11.7-20.1 21.6 0 10 7.9 21.7 20.4 21.7 7.3 0 13.4-5.4 13.4-5.4v4.2h8.6v-41H509v5.2s-5.6-6.3-13.6-6.3zm1.6 8.3c7 0 12.8 6.1 12.8 13.7 0 7.5-5.7 13.6-12.8 13.6-7 0-12.7-6-12.7-13.6s5.7-13.7 12.7-13.7zm81.1-8.3c-13.1 0-20 11.7-20 21.6-.1 10 7.8 21.7 20.4 21.7 7.3 0 13.3-5.4 13.3-5.4v4.2h8.6v-57.1H592V392s-5.7-6.3-13.7-6.3zm1.7 8.3c7 0 12.7 6.1 12.7 13.7 0 7.5-5.7 13.6-12.7 13.6s-12.7-6-12.7-13.6 5.6-13.7 12.7-13.7zm-287.2 35.1c-8.9 0-17.1-5.5-17.1-5.5l3.7-5.8s7.8 3.6 13.4 3.6c3.7 0 9.7-1.2 9.8-4.8.1-3.9-10.2-5-10.2-5s-15.4-.2-15.4-12.9c0-8 7.7-13 17.6-13 5.6 0 16.3 5 16.3 5l-4.3 6.6s-8.2-3.2-12.6-3.4c-3.6-.1-8 1.6-8 4.8 0 8.7 25.5-.7 25.5 16.9 0 11.4-10.4 13.5-18.7 13.5zm33-54v11.8H318v8.6h7.7v20.6S325 430 339.9 430c4.2 0 12.2-3 12.2-3l-3.4-9s-3.2 2.7-6.9 2.6c-6.9-.1-6.7-4.6-6.7-4.6v-20.5h14.3v-8.6H335V375h-9.4zm51.8 11c-14 0-21 11.6-21 21.7 0 10.3 6.4 22 21.9 22 6.6 0 15.9-5.8 15.9-5.8l-4-7s-6.4 4.5-12 4.5c-11.1 0-11.8-11-11.8-11h29.9s2.2-24.3-18.9-24.3zm-1.3 8.1h1c10.6 0 10.5 10 10.5 10h-21.2s-.5-9.4 9.7-10zm90.2 22.7l4 8s-6.4 4.1-13.5 4.1c-14.7 0-23-11-23-21.6C434 391 447 386 456 386c8 0 14.8 4.7 14.8 4.7l-4.4 8s-2.8-4.3-10.7-4.3c-8 0-12.2 6.9-12.2 13.4 0 7.3 5 13.5 12.3 13.5 5.8 0 10.7-4.4 10.7-4.4z"/>
    <path fill="#f79f1a" d="M624.5 278.6v-5.5h-1.4l-1.7 3.8-1.6-3.8h-1.5v5.5h1v-4.1l1.6 3.6h1l1.6-3.6v4.1zm-9.1 0v-4.5h1.8v-1h-4.7v1h1.9v4.5zm9.4-82c0 85.4-69 154.6-154.3 154.6-85.2 0-154.3-69.2-154.3-154.6S385.3 41.9 470.5 41.9c85.2 0 154.3 69.2 154.3 154.7z"/>
    <path fill="#ea001b" d="M434.5 196.6c0 85.4-69.1 154.6-154.3 154.6-85.2 0-154.3-69.2-154.3-154.6s69-154.7 154.3-154.7c85.2 0 154.3 69.2 154.3 154.7z"/>
    <path fill="#ff5f01" d="M375.3 74.8c-36 28.3-59 72.3-59 121.7s23 93.5 59 121.8c36-28.3 59.1-72.3 59.1-121.8s-23-93.4-59-121.7z"/>
  </g>
</svg>
woocommerce-blocks/images/payment-methods/laser.svg000064400000005703151335517640016567 0ustar00<svg xmlns="http://www.w3.org/2000/svg" id="Layer_1" viewBox="-45 62.3 750 471">
  <path id="Rectangle-1" d="M-5 62.3h670a40 40 0 0140 40v391a40 40 0 01-40 40H-5a40 40 0 01-40-40v-391a40 40 0 0140-40z" class="st0"/>
  <path d="M160.2 477.3h340v-359h-340z" class="st0"/>
  <path d="M500.3 127.6l-10.1 17.1-330.5-7.6v-1.7zm-11.2 19.3l-10.4 17-313.2-7.9-.8-1.2zm-11.7 19.4l-10.2 16.9-290.2-7.9-.7-1.1zm-11.7 19.3l-9.9 17-266.6-7.9-.8-1.2zm-11.2 19.2l-10.1 17.1-243.7-7.9-.8-1.3zm-11.7 19.5l-10.1 16.9-220-7.9-.7-1.1zm-11.5 19.2l-10.1 17.1-196.1-7.9-.8-1.3zm-11.4 19.3l-10.2 17.1-173.1-7.9-.8-1.3zm-11.3 19.3l-10.5 17-150-7.9-.8-1.1zM397 301.5l-10.2 17-126.5-8-.8-1.1zm-11.5 19.3l-10.3 17-102.9-7.9-.8-1.2zM374 340l-10.3 17.1-79.4-7.9-.8-1.3zm-11.5 19.5l-10.2 16.8-56.3-7.8-.8-1.2zm-11.4 19.2l-10.4 17.1-33.2-7.9-.8-1.3zm-12 19.9l-10.4 17.7-11.1-9.2-.3-1.2zm-179.4 7.9h340.6-340.6z" class="st1"/>
  <path d="M159.7 406.5h340.6" class="st2"/>
  <path d="M159.7 387.2h340.6-340.6z" class="st1"/>
  <path d="M159.7 387.2h340.6" class="st2"/>
  <path d="M159.7 368h340.6-340.6z" class="st1"/>
  <path d="M159.7 368h340.6" class="st2"/>
  <path d="M159.7 348.6h340.6-340.6z" class="st1"/>
  <path d="M159.7 348.6h340.6" class="st2"/>
  <path d="M159.7 329.3h340.6-340.6z" class="st1"/>
  <path d="M159.7 329.3h340.6" class="st2"/>
  <path d="M159.7 310h340.6-340.6z" class="st1"/>
  <path d="M159.7 310h340.6" class="st2"/>
  <path d="M159.7 290.8h340.6-340.6z" class="st1"/>
  <path d="M159.7 290.8h340.6" class="st2"/>
  <path d="M159.7 271.3h340.6-340.6z" class="st1"/>
  <path d="M159.7 271.3h340.6" class="st2"/>
  <path d="M159.7 252.1h340.6-340.6z" class="st1"/>
  <path d="M159.7 252.1h340.6" class="st2"/>
  <path d="M159.7 232.8h340.6-340.6z" class="st1"/>
  <path d="M159.7 232.8h340.6" class="st2"/>
  <path d="M159.7 213.5h340.6-340.6z" class="st1"/>
  <path d="M159.7 213.5h340.6" class="st2"/>
  <path d="M159.7 194.1h340.6-340.6z" class="st1"/>
  <path d="M159.7 194.1h340.6" class="st2"/>
  <path d="M159.7 174.8h340.6-340.6z" class="st1"/>
  <path d="M159.7 174.8h340.6" class="st2"/>
  <path d="M159.7 155.6h340.6-340.6z" class="st1"/>
  <path d="M159.7 155.6h340.6" class="st2"/>
  <path fill="#fff" d="M364.5 427.4v37.4h25.4l3.2-7.1c-4.6.2-7.9.3-12.6.3h-5.4v-9.3h.6l8.8.3 3.2-7.3c-1.6.2-1.9.2-4.1.2-3.9.2-4.9.2-8.5.2v-7.7h1.3l12.8.3 3-7.3h-27.7zm-97.1 0l2.7 4-14.4 33.5h10.4l2.4-5.7h14.8l2.4 5.7h10.9l-16.4-37.4-12.8-.1zm12.9 24.9h-9l4.4-10.7 4.6 10.7zM221.4 425h-10.6v39.8h25.6l3-7.1c-3.3.2-7.6.3-12.2.3h-5.8v-33zm118.5 4.3a26.3 26.3 0 00-11.4-2.7c-8.1 0-13.6 4.4-13.6 10.7 0 4 1.7 6.6 6.3 9.6l5.4 3.6c2.5 1.7 3.5 3 3.5 4.9 0 2.4-2.2 3.8-5.5 3.8-2.8 0-4.6-.8-7.7-3.3l-2.8 6.6c4.7 2.5 7.1 3.2 11.2 3.2 9.3 0 15.2-4.6 15.2-11.7 0-4.1-1.9-6.8-6.6-10.1l-5.5-4c-2.4-1.6-3-2.4-3-3.6 0-2.1 1.6-3.3 4.3-3.3 2.4 0 4.4.8 7.6 2.8l2.6-6.5zm75.6-1.9v37.4h10.6v-30.5h2.3c4.7 0 7.3 1.9 7.3 5.4 0 3.6-3 6-7.7 6l-1.6-.2 12.8 19.3h11.7l-10.6-15.5c4.6-2.7 6.5-5.7 6.5-10.3 0-7.9-5.5-11.7-16.7-11.7l-14.6.1z"/>
</svg>
woocommerce-blocks/images/payment-methods/discover.svg000064400000002670151335517640017277 0ustar00<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 780 501">
  <g fill="none" fill-rule="evenodd">
    <path fill="#4d4d4d" d="M55 0A55 55 0 000 55v391a55 55 0 0055 55h670a55 55 0 0055-55V55a55 55 0 00-55-55z"/>
    <path fill="#fff" d="M415.1 161.2c31 0 56 23.6 56 52.7 0 29.2-25 52.8-56 52.8s-56-23.6-56-52.7c0-29.2 25-52.8 56-52.8zm-88 .7a55 55 0 0125.3 6v22.8a35.4 35.4 0 00-25.7-11.1 34 34 0 00-34.5 34c0 20.1 14.7 34.2 35.4 34.2 9.3 0 16.6-3 24.8-10.8v22.7c-9.3 4.2-16.9 5.8-25.7 5.8-31.3 0-55.6-22.6-55.6-51.7 0-28.9 25-52 56-52zm-97 .6c11.5 0 22 3.7 30.9 11l-10.8 13.3c-5.3-5.7-10.4-8-16.5-8-8.9 0-15.3 4.7-15.3 11 0 5.3 3.6 8.1 16 12.4 23.3 8 30.2 15.2 30.2 31 0 19.1-15 32.5-36.3 32.5-15.6 0-27-5.8-36.5-18.9l13.3-12a24.5 24.5 0 0022.4 13.2c9.2 0 16-6 16-14 0-4.1-2-7.7-6.2-10.2-2-1.2-6.2-3-14.2-5.7-19.3-6.5-26-13.5-26-27.2 0-16.2 14.3-28.4 33-28.4zm234.7 1.7h22.4l28 66.6 28.5-66.6H566L520.5 266h-11zm-397.4.2h30.2c33.3 0 56.5 20.4 56.5 49.6 0 14.6-7.1 28.7-19.1 38.1a57 57 0 01-37.6 11.4h-30zm96.1 0h20.6v99.1h-20.6zm411.8 0h58.2v16.8h-37.7v22h36.3V220h-36.3v26.8h37.7v16.7h-58.2v-99.1zm71.8 0h30.5c23.7 0 37.3 10.7 37.3 29.3 0 15.2-8.6 25.1-24 28l33.1 41.8h-25.2l-28.5-39.8h-2.6v39.8H647zm20.6 15.6v30h6c13 0 20-5.3 20-15.3 0-9.6-7-14.7-19.7-14.7zm-579.8 1.2v65.6h5.6c13.2 0 21.6-2.4 28-8a32.5 32.5 0 000-49.7c-6.7-5.7-14.8-7.9-28-7.9z"/>
    <path fill="#f47216" d="M780 288.4C754 306.7 558.9 437.7 221.2 501H725a55 55 0 0055-55z"/>
  </g>
</svg>
woocommerce-blocks/images/payment-methods/maestro.svg000064400000010450151335517640017126 0ustar00<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 750 471">
  <g fill="none" fill-rule="evenodd">
    <rect width="750" height="471" fill="#000" rx="40"/>
    <path fill="#d9222a" d="M675 235.5a179.5 179.5 0 11-359 0 179.5 179.5 0 01359 0"/>
    <path fill="#0097d0" d="M356.9 349.5a178 178 0 01-13.7-19h63.6a178.6 178.6 0 0010.4-19h-84.3a178.4 178.4 0 01-7.6-19h99.4a179.3 179.3 0 005.2-95H320.1a178.2 178.2 0 015.2-19h99.4a181.5 181.5 0 00-7.6-19H333a181 181 0 0110.3-19h63.6a181.4 181.4 0 00-13.7-19H357a181.1 181.1 0 0118.1-19 179.5 179.5 0 100 266 180.4 180.4 0 0018.1-19z"/>
    <path fill="#000" d="M651 335.5a5.8 5.8 0 115.9 5.8 5.8 5.8 0 01-5.8-5.8zm5.9 4.5a4.4 4.4 0 004.4-4.5 4.4 4.4 0 00-4.4-4.4 4.4 4.4 0 00-4.4 4.4 4.4 4.4 0 004.4 4.5zm-.8-2h-1.2v-5h2.2c.4 0 .9 0 1.3.3.4.2.6.7.6 1.2 0 .6-.3 1.1-.9 1.3l1 2.3h-1.4l-.7-2h-1zm0-2.8h1.4a.7.7 0 00.3-.7.7.7 0 00-.3-.5c-.2-.1-.6 0-.8 0h-.6zM372.4 284c-7.6 2-15 3-22.9 3-25 0-38-11.4-38-33.2 0-25.4 16.6-44.2 39-44.2 18.5 0 30.2 10.5 30.2 27a70 70 0 01-2.7 18.3h-44.5c-1.6 10.6 6.2 15.3 19.4 15.3 8 0 15.1-1.4 23-4.6zm-12-44.1c0-1.7 2.6-13-10.3-13.3-7.1 0-12.2 4.7-14.3 13.3zm27.1-5c0 9.4 5.3 15.9 17.3 20.7 9.2 3.8 10.7 4.9 10.7 8.2 0 4.7-4 6.8-13.1 6.8-6.8 0-13-.9-20.3-3l-3.2 17.2c6.5 1.5 15.6 2 23.7 2.2 24 0 35-7.9 35-24.9 0-10.2-4.5-16.2-16-20.7-9.5-3.8-10.6-4.6-10.6-8 0-4.1 3.8-6.1 11.1-6.1 4.5 0 10.6.4 16.4 1l3.3-17.2c-6-.8-15-1.5-20.1-1.5-25.5 0-34.3 11.5-34.2 25.3m-88.2 50.9h-18.7l.5-7.8c-5.7 6.1-13.3 9-23.6 9-12.2 0-20.5-8.3-20.5-20.3 0-18.2 14.5-28.7 39.4-28.7 2.6 0 5.8.2 9.2.6.7-2.5.9-3.5.9-4.8 0-5-4-6.8-14.5-6.8a86.1 86.1 0 00-23.8 3.3l3.2-16.7a102 102 0 0126.9-4c19.3 0 29.5 7.6 29.5 21.8.1 3.8-1.2 11.4-1.9 14.8-.7 4.8-6 33-6.6 39.6zm-16.4-33.2l-5-.3c-12.7 0-19.2 3.8-19.2 11.2 0 4.7 3.1 7.7 8 7.7 9.2 0 15.8-7.7 16.2-18.6zm194.1 32a58 58 0 01-16 2.4c-11.5 0-17.7-5.8-17.7-16.2-.4-2.9 2.4-16 3-19.8l10.6-57.5H479l-3.4 17.8h11.4l-3 18.2h-11.5s-6.3 31.5-6.3 34c0 3.8 2.3 5.4 7.6 5.4 2.6 0 4.5-.2 6-.7l-2.9 16.4m99.2-75c-16.2 0-29 6.7-36.3 18l6.4-16.7c-11.8-4.3-19.5 1.9-26.4 10.7l-2.3 2.8v-13h-20.8c-2.8 23-7.8 46.3-11.7 69.4l-1 5h22.5c2-11.7 3.8-21.2 5.6-28.8 4.7-20.8 12.8-27.1 24.8-24.3-2.8 6-4.3 12.9-4.3 20.5 0 18.6 10 33.8 35.1 33.8 25.3 0 43.6-13.5 43.6-44.3 0-18.6-12.2-33-35.2-33zm-6.5 59.3c-7.9.2-12.7-6.5-12.7-16.4 0-11.8 7-25.1 18.3-25.1 9 0 12.2 7.2 12.2 14.8 0 16.8-7 26.7-17.8 26.7zm-343.2 16.9h-22.3l13.3-70-30.6 70h-20.4l-3.7-69.6-13.3 69.6h-20.3l17.3-91h34.9l2.9 50.7 22.1-50.7h37.7l-17.6 91"/>
    <path fill="#fff" d="M613.1 274.4a5.8 5.8 0 015.8-5.8c3.3 0 5.8 2.6 5.8 5.8a5.8 5.8 0 11-11.5 0zm5.8 4.4a4.4 4.4 0 004.5-4.4 4.4 4.4 0 00-4.5-4.4 4.4 4.4 0 00-4.4 4.4 4.4 4.4 0 004.4 4.4zm-.7-1.9H617v-5h2.1c.5 0 1 0 1.3.2.4.3.7.8.7 1.3s-.4 1-1 1.3l1 2.2h-1.3l-.8-2h-.8zm0-2.9H619.5a.7.7 0 00.3-.6.6.6 0 00-.2-.6h-1.4zM378 278.4c-7.7 2-15.1 3-23 3-25 0-38-11.4-38-33.2 0-25.4 16.6-44.2 39-44.2 18.5 0 30.3 10.5 30.3 27 0 5.4-.8 10.7-2.8 18.3h-44.5c-1.6 10.6 6.2 15.3 19.4 15.3 8 0 15.1-1.5 23-4.6zm-12-44.2c0-1.6 2.5-13-10.4-13.2-7.1 0-12.2 4.7-14.3 13.2h24.7zm27-5c0 9.5 5.3 16 17.4 20.8 9.2 3.8 10.6 4.9 10.6 8.2 0 4.7-4 6.8-13 6.8-6.9 0-13-1-20.3-3l-3.3 17.2a128 128 0 0023.7 2.2c24 0 35-7.9 35-24.9 0-10.2-4.5-16.2-16-20.7-9.5-3.8-10.6-4.6-10.6-8 0-4.1 3.8-6.2 11.1-6.2 4.5 0 10.6.5 16.4 1.2l3.3-17.3c-6-.8-14.9-1.5-20-1.5-25.5 0-34.3 11.5-34.3 25.3M305 280.2h-18.7l.5-7.8c-5.7 6.1-13.3 9-23.6 9-12.2 0-20.5-8.3-20.5-20.3 0-18.2 14.5-28.7 39.4-28.7 2.6 0 5.8.2 9.2.6.7-2.5.9-3.5.9-4.8 0-5-4-6.8-14.4-6.8a86.3 86.3 0 00-23.8 3.3L257 208c11.2-2.9 18.6-4 26.9-4 19.3 0 29.5 7.6 29.5 21.8.1 3.8-1.2 11.4-1.8 14.8-.8 4.8-6.2 33-6.7 39.6zM288.5 247c-2.4-.3-3.4-.3-5-.3-12.7 0-19.2 3.8-19.2 11.2 0 4.7 3.2 7.7 8 7.7 9.2 0 15.8-7.7 16.2-18.6zm194.1 32a58.1 58.1 0 01-16 2.4c-11.5 0-17.7-5.8-17.7-16.2-.4-2.9 2.4-16.1 3-19.8l10.6-57.5h22.2l-3.4 17.8h11.4l-3 18.2h-11.5s-6.3 31.5-6.3 34c0 3.8 2.3 5.4 7.6 5.4 2.6 0 4.6-.2 6-.7zm110.5-42.4c0 16.8-6.9 26.7-17.8 26.7-7.9.2-12.7-6.5-12.7-16.4 0-11.8 7-25.1 18.3-25.1 9 0 12.2 7.2 12.2 14.8zm24 .5c0-18.6-12.3-33-35.2-33-26.5 0-43.6 17.5-43.6 43.5 0 18.6 10.1 33.8 35.2 33.8 25.2 0 43.6-13.5 43.6-44.3zm-114.7-31.4c-2.8 23-7.8 46.4-11.7 69.5l-1 5h22.5c8-44.6 10.8-57.3 27.7-52.8l8.2-21c-11.9-4.4-19.5 1.8-26.4 10.6.7-4 1.8-7.8 1.6-11.3zM232 280.2h-22.3l13.3-70-30.6 70h-20.4l-3.7-69.6-13.3 69.6h-20.3l17.3-91H187l1.8 56.3 24.6-56.3h36.3z"/>
  </g>
</svg>
woocommerce-blocks/images/payment-methods/amex.svg000064400000006210151335517640016405 0ustar00<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 752 471">
  <g fill="none" fill-rule="evenodd">
    <rect width="750" height="471" x="1" fill="#2557d6" rx="40"/>
    <path fill="#fff" d="M1 221.2h36l8.2-19.5h18.1l8.1 19.5h71v-15l6.2 15h36.8l6.4-15.2v15.2h176.1v-32h3.3c2.4 0 3.1.3 3.1 4.2v27.8h91.1v-7.5c7.4 4 18.8 7.5 33.9 7.5h38.3l8.2-19.5H564l8 19.5h73.8v-18.5l11.2 18.5h59.2V98.7h-58.6V113l-8.2-14.4h-60V113l-7.6-14.4h-81.2a73.2 73.2 0 00-35.2 7.1v-7.1h-56v7.1c-6.1-5.4-14.5-7.1-23.8-7.1H180.9l-13.7 31.6L153 98.7H88.6V113l-7-14.4h-55L1 156.9v64.3zm227.4-17.7h-21.6l-.1-68.8-30.6 68.8h-18.5L127 134.7v68.8H84L76 184H32L24 203.5H1l37.8-87.8H70l35.8 83.1v-83.1h34.5l27.5 59.6 25.4-59.6h35.1v87.8zM68.8 165.7l-14.5-35-14.3 35zm245.6 37.8H244v-87.8h70.4V134h-49.3v15.8h48.1v18h-48.1v17.5h49.3v18.2zm99.3-64.2c0 14-9.4 21.3-14.9 23.4 4.6 1.8 8.6 4.9 10.4 7.4 3 4.4 3.5 8.3 3.5 16.2v17.2h-21.2l-.1-11c0-5.3.5-13-3.3-17.2-3.1-3-7.8-3.7-15.4-3.7h-22.6v32H329v-88h48.5c10.8 0 18.7.4 25.5 4.3 6.7 4 10.7 9.6 10.7 19.4zm-26.7 13c-2.9 1.8-6.3 1.9-10.4 1.9H351v-19.5h26c3.6 0 7.5.1 10 1.6 2.7 1.2 4.4 4 4.4 7.7 0 3.9-1.6 7-4.4 8.4zm60.5 51.2H426v-87.8h21.5zm249.7 0h-29.9l-40-66v66h-42.9l-8.2-19.6h-43.8l-8 19.6h-24.6c-10.2 0-23.2-2.2-30.6-9.7-7.4-7.5-11.2-17.6-11.2-33.5 0-13 2.3-25 11.3-34.4 6.9-7 17.5-10.2 32-10.2h20.5v18.8h-20c-7.7 0-12 1.1-16.2 5.2-3.6 3.7-6.1 10.7-6.1 19.9 0 9.4 1.9 16.2 5.8 20.6 3.2 3.5 9.1 4.6 14.7 4.6h9.5l29.7-69.1h31.6l35.7 83v-83h32l37.1 61.2v-61.2h21.6v87.8zm-128.1-37.8l-14.6-35-14.5 35h29zm181.9 178c-5.2 7.5-15.1 11.3-28.7 11.3h-40.7v-18.8h40.6c4 0 6.8-.6 8.5-2.2a7.7 7.7 0 002.5-5.7c0-2.6-1-4.6-2.6-5.8-1.5-1.4-3.7-2-7.4-2-19.8-.7-44.5.6-44.5-27.2 0-12.7 8.1-26.1 30.3-26.1h42v-17.5h-39a44.1 44.1 0 00-26.5 7.1v-7.1h-57.7c-9.2 0-20 2.2-25.2 7.1v-7.1h-103v7.1a55 55 0 00-28.5-7.1h-68v7.1c-6.4-6.2-20.9-7.1-29.7-7.1h-76L280 268.4l-16.4-18.7H150v122.6h111.5l18-19.1 16.8 19 68.8.1v-28.8h6.7a72 72 0 0029.4-4.3v33H458v-31.9h2.7c3.5 0 3.9.1 3.9 3.6v28.4h172.2c11 0 22.4-2.8 28.7-7.9v7.9H720c11.4 0 22.5-1.6 31-5.7zm-341.5-47c0 24.3-18.3 29.4-36.8 29.4h-26.3v29.4h-41l-26-29-26.9 29H169v-87.8h84.8l26 28.8 26.7-28.8H374c16.8 0 35.6 4.6 35.6 29zM241.8 337H190v-17.4h46.3v-18H190v-16h52.8l23.1 25.7zm83.6 10.1L293 311.3l32.4-34.6zm47.8-39H346v-22.4h27.5c7.6 0 12.9 3 12.9 10.7 0 7.6-5 11.6-13.2 11.6zM516 267.6h70.3v18.1H537v16H585v18H537v17.4l49.3.1v18.2H516v-87.8zm-27 47a23 23 0 0110.2 7.4c3 4.3 3.5 8.3 3.5 16v17.4h-21.1v-11c0-5.3.5-13-3.4-17.2-3.1-3.1-7.8-3.9-15.5-3.9h-22.5v32.1H419v-87.8h48.7c10.6 0 18.4.4 25.3 4.1 6.7 4 10.9 9.5 10.9 19.5 0 14-9.4 21.2-15 23.4zm-12-11.1c-2.8 1.7-6.3 1.8-10.4 1.8H441v-19.7h26c3.7 0 7.4 0 10 1.6 2.7 1.4 4.4 4.1 4.4 7.9 0 3.7-1.7 6.7-4.4 8.4zm190.3 5.6c4.1 4.2 6.3 9.6 6.3 18.6 0 18.9-11.8 27.7-33 27.7h-41.1v-18.8h40.9c4 0 6.8-.5 8.6-2.2a7.8 7.8 0 002.5-5.7c0-2.6-1.2-4.6-2.6-5.8-1.6-1.4-3.9-2-7.5-2-19.7-.7-44.4.6-44.4-27.2 0-12.7 8-26.1 30.1-26.1h42.3v18.7h-38.7c-3.8 0-6.3.1-8.4 1.6-2.4 1.4-3.2 3.5-3.2 6.3 0 3.3 2 5.5 4.6 6.5 2.2.8 4.6 1 8.2 1l11.4.3c11.4.3 19.3 2.3 24 7zm83.7-23.5h-38.4c-3.9 0-6.4.1-8.6 1.6-2.2 1.4-3 3.5-3 6.3 0 3.3 1.8 5.5 4.6 6.5 2.2.8 4.6 1 8.1 1l11.4.3c11.6.3 19.3 2.3 24 7 .8.8 1.3 1.5 1.9 2.3z"/>
  </g>
</svg>
woocommerce-blocks/images/payment-methods/diners.svg000064400000001127151335517640016741 0ustar00<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 750 471">
  <g fill="none" fill-rule="evenodd">
    <rect width="750" height="471" fill="#0079BE" rx="40"/>
    <path fill="#FFF" d="M585 238c0-99.5-83-168.2-174-168.2h-78.2c-92 0-167.7 68.8-167.7 168.1 0 91 75.7 165.7 167.7 165.3H411c91 .4 174-74.3 174-165.3z"/>
    <path fill="#0079BE" d="M333.3 84c-84 0-152.2 68.2-152.2 152.5S249.2 389 333.3 389.1c84 0 152.2-68.3 152.2-152.6S417.4 84 333.3 84z"/>
    <path fill="#FFF" d="M237 236.1a96.9 96.9 0 0162-90.3v180.5a96.8 96.8 0 01-62-90.2zm131 90.3V145.8a96.8 96.8 0 010 180.6z"/>
  </g>
</svg>
woocommerce-blocks/images/payment-methods/giropay.svg000064400000003615151335517640017133 0ustar00<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 740 318.1">
  <path fill="#000268" d="M0 57A57.3 57.3 0 0157.4 0h625.2A57.3 57.3 0 01740 57v204a57.2 57.2 0 01-57.4 57H57.4A57.1 57.1 0 010 261.2z" data-name="92653320"/>
  <path fill="#fff" d="M23.6 59v200.2a35.7 35.7 0 0035.8 35.7h327.5V23.4H59.4A35.7 35.7 0 0023.6 59zm448 99.1c0 12.8-6.3 21.5-16.7 21.5-9.2 0-16.9-8.8-16.9-20.5 0-12 6.8-20.9 17-20.9 10.6.1 16.6 9.3 16.6 20zm-61.3 73.1H438v-43.4h.3c5.3 9.5 15.7 13 25.3 13 23.8 0 36.5-19.7 36.5-43.3 0-19.4-12-40.3-34.2-40.3-12.6 0-24.2 5-29.8 16.2h-.4V119h-25.5v112.2zm127.6-57.6c0-7.7 7.3-10.6 16.7-10.6 4.1 0 8 .2 11.7.4 0 9.3-6.6 18.9-17 18.9-6.5 0-11.4-3.1-11.4-8.7zm55.8 25.4a96.1 96.1 0 01-1.6-18.9v-29.8c0-24.4-17.6-33.2-38-33.2a82.2 82.2 0 00-32 5.7l.5 18.7c7.7-4.3 16.6-6 25.5-6 10 0 18.2 3 18.3 13.9a84.7 84.7 0 00-12.8-1.1c-14.7 0-41.3 2.9-41.3 27.3 0 17.4 14.1 25.1 29.9 25.1 11.4 0 19-4.4 25.3-14.4h.3c0 4.2.5 8.3.6 12.6h25.2zm12.3 32.2a78.8 78.8 0 0017.2 1.9c25.3 0 31.3-19.6 39.2-39.6l29.3-74.5h-27.6l-16.5 52.2h-.2L630.2 119h-29.8l32.4 81.9c-2 7-7.2 11-14 11a35.1 35.1 0 01-11-1.7l-1.8 21z" data-name="92186184"/>
  <path fill="#ff0007" d="M91 158.3c0-11 5.4-20 15.7-20 12.5 0 17.7 10 17.7 18.9 0 12.2-7.9 20.5-17.7 20.5-8.3 0-15.7-7-15.7-19.5zm60.1-39.3h-25v14.4h-.3a31.2 31.2 0 00-27.1-16.3c-25 0-36.1 17.8-36.1 41.6 0 23.7 13.7 40.3 35.6 40.3 11 0 20.3-4.4 26.9-13.7h.3v4.3c0 15.6-8.6 23.2-24.6 23.2a54.7 54.7 0 01-27-6.7L72.3 228a92.4 92.4 0 0030.6 5c32.2 0 48.2-10.5 48.2-43.3zm46.7-33.4h-27.7V106h27.7V85.6zM170.1 199h27.7v-80h-27.7zm104.6-81a64.1 64.1 0 00-9.3-1c-12 0-18.9 6.5-23.7 16.7h-.3V119h-25.1v80h27.6v-33.7c0-15.7 7.3-25 20.1-25a31.8 31.8 0 019.4.9l1.3-23.2zm47.7 63.4c-12.8 0-18-10.6-18-22.4 0-12 5.1-22.5 18-22.5s17.9 10.6 17.9 22.5c0 11.8-5.3 22.4-18 22.4zm0 19.4c26.3 0 46.5-15.4 46.5-41.8 0-26.6-20.2-42-46.5-42s-46.6 15.5-46.6 42c0 26.4 20 41.8 46.6 41.8z" data-name="47303032"/>
</svg>
woocommerce-blocks/images/payment-methods/sofort.svg000064400000023632151335517640016776 0ustar00<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 750 232.5">
  <path fill="#ee7f00" d="M248 0a69 69 0 00-29.6 6.8 92.5 92.5 0 00-35.3 30.8A133.8 133.8 0 00167 69c-8.1 22.2-8 40.2.3 52.1 4.7 6.7 14.4 14.8 34.3 14.8h.1c36.2 0 63.2-23.8 80.3-70.6 4.6-12.3 10.5-35.4-.4-51C275 4.8 263.7 0 248 0zm218.5 0a69 69 0 00-29.6 6.8 92.4 92.4 0 00-35.3 30.8A133.4 133.4 0 00385.4 69c-8.1 22.2-8 40.2.3 52.1 4.7 6.7 14.4 14.8 34.3 14.8 36.3 0 63.3-23.8 80.4-70.6 4.6-12.4 10.5-35.5-.4-51C493.4 4.7 482.2 0 466.5 0zM131.8 1.9c-12 0-23.5 0-33.9 5.2S78.4 23 71.3 44A42.1 42.1 0 0069 55.8a17.8 17.8 0 001.8 8.8A25.7 25.7 0 0078 73a36.3 36.3 0 0011.3 5.7l5 1.4 7.6 2.2a16 16 0 013.6 1.5 7.2 7.2 0 012.8 2.9 6.2 6.2 0 01.6 2.7 9 9 0 01-.5 3.1 8.6 8.6 0 01-5.2 5.9A38 38 0 0190 99.9H12.3L0 133.7h83.2c7.9 0 22.2 0 36-5.9s27-17.5 32.5-40.9c2-8.8 1.4-16-2-21.6S140 55.6 130.9 53l-4.4-1.3-6.6-1.9a8.7 8.7 0 01-5.2-3.7 7.3 7.3 0 01-.7-5.9 8.6 8.6 0 014.3-5.2 17.5 17.5 0 018.4-1.9h48.4l1-1.5a107 107 0 0131.2-29.7zm217.4 0a45.3 45.3 0 00-45 31.3l-36.7 100.5h40.1L326.4 82h35.4l10-27.7h-35.2l5.7-16a8.5 8.5 0 018.1-5.1h41.8l1-1.6a112.2 112.2 0 0133-29.7zm186 .1l-48 131.8h40.7l17.4-46.4c.9 2 11.1 46.4 11.1 46.4h42.9s-7.8-32.7-13.5-45.9a73.2 73.2 0 00-5.1-10.4c12.1-4.5 29.6-14.1 37-33.7 4.4-12 4.1-21.7-.9-28.9-6-8.7-18.2-12.9-37.3-12.9zm83.5 0a32.6 32.6 0 016.7 7c4.7 6.8 6.5 15 5.4 24.3h24.3l-36.6 100.5h36.6l36.6-100.6h47L750 2zM562 29.2h6.7c12.3 0 17 3.6 12.7 14.8-3.9 10.5-10.9 17-24.2 17h-7L562 29.2zm-323.5.6c12.5 0 15.4 7.3 4.4 37.4-11.3 30.9-19.5 38.6-31.9 38.6-12 0-16.2-7.6-5-38.3 8.4-23 19.3-37.7 32.5-37.7zm218.4 0c12.5 0 15.4 7.3 4.4 37.4-11.3 30.9-19.5 38.6-31.8 38.6-12 0-16.2-7.6-5-38.3 8.4-23 19.3-37.7 32.4-37.7z"/>
  <path fill="#383a41" d="M39.6 147.6A9.9 9.9 0 0034 149a10.4 10.4 0 00-3.3 5c-.8 2.3-1 3.9-.4 4.8s2.2 1.4 4.8 1.4 4.5-.5 5.8-1.5a10.4 10.4 0 003.2-5c.8-2.2 1-3.8.4-4.7s-2.1-1.4-4.8-1.4zm22.1 0c-2.6 0-4.5.5-5.8 1.4a10.4 10.4 0 00-3.2 5c-.8 2.3-1 3.9-.4 4.8s2.2 1.4 4.8 1.4 4.5-.5 5.8-1.5a10.5 10.5 0 003.2-5c.8-2.2 1-3.8.4-4.7s-2.2-1.4-4.8-1.4zm412.5 17.2a35.5 35.5 0 00-9 1.1 30.3 30.3 0 00-8.2 3.5 29 29 0 00-6.9 6 26.9 26.9 0 00-4.7 8.2 18.3 18.3 0 00-1.4 7 11.8 11.8 0 001.3 5 12 12 0 003.1 3.8 28 28 0 004.1 2.7l4.3 2.3a19 19 0 013.6 2.4 6.9 6.9 0 012.1 2.8 5.3 5.3 0 01-.2 3.8 12.2 12.2 0 01-2 3.5 12 12 0 01-3 2.6 14.5 14.5 0 01-3.8 1.7 17.2 17.2 0 01-4.6.6 19.6 19.6 0 01-6.2-.9 20.3 20.3 0 01-6.8-3.7 3 3 0 00-1.7-.8 1.9 1.9 0 00-1 .3 3 3 0 00-1 1 10.1 10.1 0 00-.9 1.6c-.3.7-.7 1.6-1 2.7a18.7 18.7 0 00-1 3.5 2.8 2.8 0 00.2 2 6.2 6.2 0 001.6 1.4 14.8 14.8 0 003.1 1.7 27.1 27.1 0 004.7 1.3 30.6 30.6 0 006 .6 38 38 0 0010-1.3 34.3 34.3 0 009-4 31.8 31.8 0 007.6-6.5 29 29 0 005.2-9 17.5 17.5 0 001.3-6.8 11.6 11.6 0 00-1.3-5.1 12 12 0 00-3.2-3.7 32 32 0 00-4.1-2.8 154 154 0 00-4.4-2.3 20.5 20.5 0 01-3.6-2.3 6.7 6.7 0 01-2.2-2.8 5.4 5.4 0 01.2-3.8 10.7 10.7 0 011.5-2.8 9.6 9.6 0 012.5-2.2 12.4 12.4 0 013.2-1.5 14.4 14.4 0 014-.5 15.5 15.5 0 014.9.7 18 18 0 013.5 1.5 22.6 22.6 0 012.4 1.5 3 3 0 001.5.7 1.6 1.6 0 001-.3 3.2 3.2 0 00.9-1 13.4 13.4 0 00.8-1.6 51.1 51.1 0 001.8-4.7 10.1 10.1 0 00.4-1.5 3.8 3.8 0 000-1 2.1 2.1 0 00-.4-.8 5 5 0 00-1.6-1.2 17.4 17.4 0 00-3.1-1.4 25.7 25.7 0 00-4-1 28 28 0 00-4.5-.3zm210 0a46.8 46.8 0 00-14.9 2.3A47.4 47.4 0 00656 174a52 52 0 00-10.8 10.9 56.7 56.7 0 00-7.7 14.4 40.4 40.4 0 00-2.8 14 19 19 0 002.8 10.3 17.2 17.2 0 008.1 6.6 34.2 34.2 0 0013.2 2.2 58.4 58.4 0 0016.4-2.2l4.6-1.4a6.5 6.5 0 002.8-1.8 8.8 8.8 0 001.5-2.6l9.5-26a6 6 0 00.4-1.8 2.6 2.6 0 00-.2-1.4 1.8 1.8 0 00-.8-.8 2.8 2.8 0 00-1.4-.3h-22a1.7 1.7 0 00-1 .3 3.8 3.8 0 00-.9.9 9.1 9.1 0 00-1 1.5 22.5 22.5 0 00-1 2.4 10.8 10.8 0 00-.9 3.8c.1.8.5 1.2 1 1.2h12.4l-5.5 15.2a23 23 0 01-4.6 1.5 22.3 22.3 0 01-4.6.5 18.9 18.9 0 01-7.8-1.5 10.3 10.3 0 01-4.8-4.3 13.8 13.8 0 01-1.6-7.2 30.7 30.7 0 012.1-9.9 39 39 0 014.9-9.3 34.9 34.9 0 016.8-7.2 30.4 30.4 0 018.3-4.7 28.5 28.5 0 0116.7-.7 29.4 29.4 0 015 2 21 21 0 013.2 2 3.4 3.4 0 001.8.9 1.8 1.8 0 00.9-.3 3.5 3.5 0 00.8-.8 11.7 11.7 0 001-1.7 23 23 0 001-2.6 19.3 19.3 0 001.1-3.8 3 3 0 00-.2-2 6.4 6.4 0 00-1.8-1.7 16.4 16.4 0 00-3.7-1.8 33.8 33.8 0 00-5.6-1.4 43.2 43.2 0 00-7.5-.6zm-413.3.8l-4.1.1a5 5 0 00-2.3.7 2.8 2.8 0 00-1.2 1.6 15.7 15.7 0 00-.5 2.8l-6 57.2a5.5 5.5 0 000 2 1.7 1.7 0 001.2 1 8.5 8.5 0 002.6.5l4.6.1h4.5a11.5 11.5 0 002.9-.6 4.7 4.7 0 001.8-1.2 9.5 9.5 0 001.5-1.9l25-41.4-4.6 41.5a4.8 4.8 0 000 2 1.7 1.7 0 001 1.1 8.5 8.5 0 002.6.5l4.6.1h4.3a13.3 13.3 0 002.9-.6 5.3 5.3 0 002-1.1 9 9 0 001.5-2l35.8-57a27.8 27.8 0 001.6-3 1.8 1.8 0 00.1-1.6 2 2 0 00-1.5-.7 33 33 0 00-3.4-.2c-1.6 0-2.9 0-3.8.2a8.3 8.3 0 00-2.2.4 3 3 0 00-1.3 1 11.6 11.6 0 00-.9 1.3l-29.6 50h-.1l5.8-49.7a5 5 0 000-1.7 1.4 1.4 0 00-.9-.9 6.1 6.1 0 00-2-.4l-3.9-.1-3.6.1a9.5 9.5 0 00-2.4.5 3.6 3.6 0 00-1.4.9 9.1 9.1 0 00-1.1 1.6l-30 49.7 6.7-50a4.5 4.5 0 00.1-1.6 1 1 0 00-.6-.8 5.7 5.7 0 00-2-.3l-3.8-.1zm157.8 0a29.5 29.5 0 00-3.3.1 14.6 14.6 0 00-2.2.4 3.7 3.7 0 00-1.3.7 2.2 2.2 0 00-.7.9l-22.5 61.8a1.1 1.1 0 000 .9 1.3 1.3 0 00.9.6 8 8 0 001.8.5 27.1 27.1 0 003.2.1 30 30 0 003.3-.1 11.4 11.4 0 002.2-.5 3.5 3.5 0 001.3-.6 2.2 2.2 0 00.7-1l22.4-61.7a1.1 1.1 0 000-1 1.4 1.4 0 00-.8-.6 8.9 8.9 0 00-1.9-.4 27 27 0 00-3.2-.1zm-404.5 0a29.9 29.9 0 00-3.3.1 14.5 14.5 0 00-2.2.4 3.4 3.4 0 00-1.3.7 2.3 2.3 0 00-.7.9L2.2 207.5a31 31 0 00-2.2 11 13.5 13.5 0 002.4 7.8 13.2 13.2 0 006.5 4.7 31.5 31.5 0 0010.5 1.5 42.3 42.3 0 0012.3-1.7 35.1 35.1 0 0018.4-13 42.6 42.6 0 005.7-10.8l14.3-39.2a1.2 1.2 0 000-1 1.3 1.3 0 00-.8-.6 8.7 8.7 0 00-1.8-.4 25.3 25.3 0 00-3.2-.2 29.9 29.9 0 00-3.2.2 14 14 0 00-2.2.4 3.4 3.4 0 00-1.3.7 2.2 2.2 0 00-.6.9L42.6 207a26.2 26.2 0 01-3.1 6.2 20.6 20.6 0 01-4.4 4.5 18 18 0 01-5.2 2.8 18.3 18.3 0 01-6 1 13.3 13.3 0 01-5.2-1 7 7 0 01-3.2-2.7 8.7 8.7 0 01-1-4.8 21.9 21.9 0 011.5-6.7l14-38.7a1.2 1.2 0 000-.9 1.4 1.4 0 00-.8-.6 9.1 9.1 0 00-2-.4 26.3 26.3 0 00-3-.2zm490.5 0a29.7 29.7 0 00-3.3.1 12.4 12.4 0 00-2.2.4 3.5 3.5 0 00-1.3.7 2.3 2.3 0 00-.7.9l-14.4 39.8a30.8 30.8 0 00-2.2 11 13.4 13.4 0 002.3 7.7 13.3 13.3 0 006.6 4.7 31.4 31.4 0 0010.5 1.6 42.4 42.4 0 0012.3-1.7 35.1 35.1 0 0018.4-13 42.5 42.5 0 005.6-10.8l14.3-39.2a1.1 1.1 0 00-.8-1.6 7.8 7.8 0 00-1.8-.4 25.5 25.5 0 00-3.1-.2 29.9 29.9 0 00-3.3.2 12.2 12.2 0 00-2.2.4 3.4 3.4 0 00-1.3.7 2.3 2.3 0 00-.6.9l-14.3 39.4a26.6 26.6 0 01-3.2 6.1 21 21 0 01-4.3 4.5 17.6 17.6 0 01-5.3 2.8 18.4 18.4 0 01-6 1 13.2 13.2 0 01-5.2-.9 6.9 6.9 0 01-3.3-2.8 8.5 8.5 0 01-1-4.7 21.8 21.8 0 011.5-6.8l14-38.6a1.1 1.1 0 000-1 1.4 1.4 0 00-.8-.6 8 8 0 00-1.8-.4 26.1 26.1 0 00-3.2-.1zm113.7 0c-1.2 0-2.3 0-3 .2a8.5 8.5 0 00-2 .4 4 4 0 00-1.4.8 2.2 2.2 0 00-.6 1l-11.2 30.6-2.6 7.3-2.5 7.4c0-1.3-.2-2.7-.4-4l-.4-4.1-.6-4.2-.7-4.3-4-23.9a18.8 18.8 0 00-.6-3.3 5.2 5.2 0 00-1.2-2.1 4.3 4.3 0 00-2-1.1 12 12 0 00-3.1-.3H585a7 7 0 00-3.9 1.2 6.9 6.9 0 00-2.7 3.5L557 229.5a1.5 1.5 0 000 .9 1.2 1.2 0 00.6.7 5.8 5.8 0 001.6.4 24.2 24.2 0 003 .1 28.3 28.3 0 003-.1 9.9 9.9 0 002-.4 3.4 3.4 0 001.1-.7 2.4 2.4 0 00.6-1l12.5-34.2a344 344 0 005-14.7c0 2 .2 4 .4 6.2l.8 5.9 5.1 30.6a35.1 35.1 0 00.8 4 7.2 7.2 0 001.2 2.6 3.9 3.9 0 001.9 1.3 10.1 10.1 0 003 .3h5.6a7.5 7.5 0 002-.2 6.6 6.6 0 002-1 8 8 0 001.5-1.4 7.2 7.2 0 001.2-2.1l21.4-58.8a1.4 1.4 0 000-1 1.2 1.2 0 00-.5-.6 4.3 4.3 0 00-1.7-.5 26.7 26.7 0 00-2.8 0zm-472 .3a5.7 5.7 0 00-3.2 1 6.3 6.3 0 00-2.3 3.2L130 227c-.5 1.5-.5 2.6 0 3.2a3 3 0 002.5 1h32.8a2 2 0 001-.3 3.5 3.5 0 001-.9 9 9 0 001-1.6 23.7 23.7 0 001-2.4 23 23 0 00.7-2.5 6.2 6.2 0 00.2-1.6 1.3 1.3 0 00-.3-.8 1 1 0 00-.7-.3h-23.7l6.7-18.5H172a2 2 0 001-.2 3.2 3.2 0 001-.9 7.7 7.7 0 00.9-1.5 22.9 22.9 0 001-2.4 20 20 0 00.7-2.4 5.2 5.2 0 00.2-1.6 1.2 1.2 0 00-.3-.8 1 1 0 00-.8-.3H156l5.8-16h23.4a1.7 1.7 0 00.9-.3 3.7 3.7 0 001-.9 10 10 0 00.9-1.6 23.1 23.1 0 001-2.4 21.7 21.7 0 00.8-2.5 6.3 6.3 0 00.2-1.6 1.3 1.3 0 00-.3-.9 1 1 0 00-.7-.2zm54.8 0a5.6 5.6 0 00-3.1 1 6.2 6.2 0 00-2.3 3.2L184 229.5a1.3 1.3 0 000 1 1.3 1.3 0 00.9.6 8.3 8.3 0 001.9.4 26.4 26.4 0 003.1.1 29.7 29.7 0 003.3-.1 12.7 12.7 0 002.2-.4 3.8 3.8 0 001.3-.7 2.2 2.2 0 00.7-.9l9-25h4.2a8.2 8.2 0 013.5.7 5 5 0 012.1 2 9.2 9.2 0 011.1 3.2 43.2 43.2 0 01.5 4.4l.5 14.6a3 3 0 00.2 1 1.3 1.3 0 00.7.7 6 6 0 001.9.4l3.4.1 4-.1a11.3 11.3 0 002.3-.4 2.6 2.6 0 001.2-.6 2.9 2.9 0 00.5-1 5.7 5.7 0 00.3-1.3 27.5 27.5 0 000-2.8l-.9-12.9a34 34 0 00-.5-4.1 15.4 15.4 0 00-1-3.3 8.2 8.2 0 00-1.5-2.5 8.5 8.5 0 00-2.1-1.7 32.2 32.2 0 006.3-2.5 27.4 27.4 0 005.4-3.7 25.3 25.3 0 004.2-4.8 27.8 27.8 0 003-6 19.5 19.5 0 001.3-7 10 10 0 00-1.4-5.1 10.1 10.1 0 00-4.1-3.6 20.3 20.3 0 00-6.4-2 59.6 59.6 0 00-7.2-.3zm159.8 0a5.7 5.7 0 00-3.2 1 6.3 6.3 0 00-2.3 3.2l-20.8 57c-.5 1.5-.5 2.6 0 3.2a3 3 0 002.5 1h32.9a2 2 0 00.9-.3 3.3 3.3 0 001-.9 8 8 0 001-1.6 21.5 21.5 0 001-2.4 23 23 0 00.7-2.5 5.7 5.7 0 00.2-1.6 1.2 1.2 0 00-.3-.8 1 1 0 00-.7-.3h-23.7l6.7-18.5h19.8a2 2 0 00.9-.2 3.1 3.1 0 001-.9 8.2 8.2 0 00.9-1.5 22.9 22.9 0 001-2.4 21.8 21.8 0 00.7-2.4 5.2 5.2 0 00.2-1.6 1.3 1.3 0 00-.3-.8 1 1 0 00-.7-.3h-19.8l5.8-16h23.4a1.8 1.8 0 00.9-.3 3.7 3.7 0 00.9-.9 8.1 8.1 0 001-1.6 22.8 22.8 0 001-2.4 23 23 0 00.7-2.5 6 6 0 00.2-1.6 1.3 1.3 0 00-.3-.9 1 1 0 00-.7-.2zm-277.4 0a5.7 5.7 0 00-3.1 1 6.3 6.3 0 00-2.3 3.2l-20.8 57c-.5 1.5-.6 2.5 0 3.2a3 3 0 002.4 1h17.4a52.2 52.2 0 007.4-.5 41.4 41.4 0 006.6-1.5 36.7 36.7 0 006-2.5 29.6 29.6 0 005.5-3.8 29.1 29.1 0 004.5-5 27 27 0 003.2-6.3 17.2 17.2 0 001.2-6 10.5 10.5 0 00-1-4.7 8.5 8.5 0 00-3-3.2 12.2 12.2 0 00-4.6-1.8 22.8 22.8 0 004.7-2.1 22.2 22.2 0 004-3 23.1 23.1 0 003.1-3.8 22.6 22.6 0 002.2-4.5 16.3 16.3 0 001.2-7.4 8.3 8.3 0 00-2.5-5.2 13.1 13.1 0 00-5.9-3 38.9 38.9 0 00-9.8-1zm5.5 10h6.7a15.5 15.5 0 014.8.5 5.3 5.3 0 012.4 1.6 4.1 4.1 0 01.9 2.6 10 10 0 01-.7 3.5 13.8 13.8 0 01-1.8 3.4 12.8 12.8 0 01-2.7 2.8 12.3 12.3 0 01-3.5 1.8 15.1 15.1 0 01-4.9.7h-7.5zm117.8.2h6a30.9 30.9 0 013.5.1 14.8 14.8 0 012.2.4c2 .7 3.2 1.7 3.6 3.2a8.8 8.8 0 01-.5 5.4 14.2 14.2 0 01-2.1 3.9 13.3 13.3 0 01-3.2 3 15.2 15.2 0 01-4.4 1.9 18.5 18.5 0 01-5.2.7H210zM89.3 202.6h7.9a19.6 19.6 0 015.7.6 6.6 6.6 0 013 1.9 5 5 0 011.1 3 10.1 10.1 0 01-.7 4 13 13 0 01-2.1 4 13.6 13.6 0 01-3.3 2.8 14.2 14.2 0 01-3.9 1.7 18.3 18.3 0 01-4.9.6h-9.6z"/>
</svg>
woocommerce-blocks/images/payment-methods/jcb.svg000064400000004007151335517640016213 0ustar00<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 750 471">
  <defs>
    <linearGradient id="a" x1="0%" x2="100%" y1="50%" y2="50%">
      <stop offset="0%" stop-color="#007B40"/>
      <stop offset="100%" stop-color="#55B330"/>
    </linearGradient>
    <linearGradient id="b" x1=".5%" x2="100%" y1="50%" y2="50%">
      <stop offset="0%" stop-color="#1D2970"/>
      <stop offset="100%" stop-color="#006DBA"/>
    </linearGradient>
    <linearGradient id="c" x1=".1%" x2="100%" y1="50%" y2="50%">
      <stop offset="0%" stop-color="#6E2B2F"/>
      <stop offset="100%" stop-color="#E30138"/>
    </linearGradient>
  </defs>
  <g fill="none" fill-rule="evenodd">
    <rect width="750" height="471" fill="#0E4C96" rx="40"/>
    <path fill="#FFF" d="M617.2 346.8A75.4 75.4 0 01542 422H132.8V124.2A75.4 75.4 0 01208 49h409.1v297.9z"/>
    <path fill="url(#a)" d="M483.9 242c11.6.3 23.4-.5 35 .4 11.8 2.2 14.7 20 4.2 26-7.1 3.8-15.6 1.4-23.4 2H484V242zm41.8-32.1c2.6 9.2-6.2 17.4-15 16.1h-26.8c.1-8.6-.4-18 .2-26.2 10.8.3 21.6-.6 32.2.5 4.6 1.2 8.5 5 9.4 9.6zM590 74c.5 17.5 0 36 .2 53.8v217.8a54 54 0 01-51.6 51.4h-81.2V287.3c29.5-.2 59 .3 88.5-.3 13.6-.8 28.6-9.9 29.2-24.9 1.6-15.1-12.6-25.5-26.1-27.2-5.2-.1-5-1.5 0-2.1 12.9-2.8 23-16.1 19.2-29.5-3.2-14-18.8-19.5-31.7-19.5-26.4-.2-52.7 0-79 0 .1-20.5-.4-41 .2-61.5A54 54 0 01511.3 74H590z"/>
    <path fill="url(#b)" d="M159.7 125a54 54 0 0152-51h80.8c-.1 90.9.1 181.8-.2 272.7a54 54 0 01-51.6 50.3h-81V283.6c26.2 6.1 53.7 8.8 80.4 4.7 16-2.6 33.5-10.5 39-27 4-14.2 1.7-29.2 2.3-43.7v-33.9H235c-.2 22.4.4 44.8-.4 67.2-1.2 13.7-14.8 22.4-27.8 22-16 .1-47.9-11.7-47.9-11.7 0-41.9.5-94.4.7-136.2z"/>
    <path fill="url(#c)" d="M309.7 197.4c-2.4.5-.5-8.3-1-11.7 0-21.1-.4-42.3.2-63.4A54 54 0 01362.6 74h78.8c0 90.9.1 181.8-.1 272.7a54 54 0 01-51.7 50.3h-81V272.7c18.4 15.1 43.5 17.5 66.5 17.5a223 223 0 0051.3-6.6v-22.8c-19 9.4-41.2 15.4-62.2 10a33.9 33.9 0 01-25-33c-1.8-15.7 7.5-32.3 23-37 19.1-6 40-1.4 58 6.5 3.9 2 7.8 4.5 6.2-2v-17.9c-30-7.1-62-9.8-92.3-2a67.7 67.7 0 00-24.4 12z"/>
  </g>
</svg>
woocommerce-blocks/images/payment-methods/sepa.svg000064400000005476151335517640016420 0ustar00<svg xmlns="http://www.w3.org/2000/svg" id="svg10908" x="0" y="0" version="1.1" viewBox="0 0 750 205" xml:space="preserve">
  <path id="path5689" d="M166.6 65.4h-51.3c0-8.4-1-14.1-3-17-3-4.3-11.4-6.4-25.2-6.4-13.4 0-22.3 1.2-26.6 3.7S54 53.6 54 61.8c0 7.5 1.9 12.4 5.7 14.7 3.4 1.8 7.1 2.8 10.9 2.9l10.4.8c22.2 1.5 36 2.5 41.6 3.1 17.5 1.8 30.3 6.4 38.1 14a37.2 37.2 0 0111.1 23.1 156 156 0 011 19.3 103 103 0 01-4.7 36.2c-5.7 14.1-18.5 22.9-38.5 26.6-8.3 1.6-21.1 2.4-38.3 2.4-28.7 0-48.8-1.7-60.1-5.1a39.4 39.4 0 01-27.5-25.6c-2.5-7.1-3.7-19-3.7-35.7h51.3v4.3c0 8.9 2.6 14.6 7.7 17.2 4 1.9 8.4 2.8 12.8 2.8h18.9c9.6 0 15.8-.5 18.4-1.5 4.7-1.9 7.8-4.9 9.3-9 .9-3.2 1.3-6.5 1.2-9.9 0-9-3.3-14.5-9.9-16.5-2.5-.8-13.9-1.9-34.3-3.2a421.8 421.8 0 01-34.2-3.4c-16.8-3.1-28-9.6-33.6-19.4C2.7 91.5.2 78.9.2 62c0-12.8 1.3-23.1 4-30.9S11.1 17.5 17 13.5A64.8 64.8 0 0150.2 2.6c11.2-1 23.7-1.5 37.3-1.5 21.5 0 36.9 1.2 46 3.7 22.3 6 33.5 22.8 33.5 50.4.1 2.3-.1 5.7-.4 10.2" class="st0"/>
  <path id="path5693" d="M392.3 205V0h102.8c14.1 0 24.8 1.1 32.2 3.5a50 50 0 0134 32.5c3 8.6 4.5 21.5 4.5 38.8 0 20.8-1.7 35.7-5 44.8-6.6 18-20.1 28.3-40.6 31-2.4.4-12.7.8-30.8 1.1l-9.2.3h-32.8v53h-55.1zm55.2-100.5h34.4a62.5 62.5 0 0019.9-2.5c3.2-1.8 5.5-5.4 6.5-10.8.8-5.3 1.2-10.6 1-16 0-8.7-.7-15.1-2.1-19.3-2-5.9-6.8-9.5-14.2-10.8-1.5-.2-5.1-.3-10.7-.3h-34.8v59.7z" class="st0"/>
  <path id="path5697" d="M683.6 169.5h-73.8l-9.9 35.5h-57.1L604.5 0h83.2L750 205h-55.9l-10.5-35.5zm-11-39.9l-25.8-88.9-25.1 88.9h50.9z" class="st0"/>
  <path id="path5701" fill="#ffbe00" d="M316.2 28.8c21.9 0 42.6 9.9 56.4 26.9l11.9-25.5a104.5 104.5 0 00-71.9-28.4c-43.5 0-80.6 26.2-95.9 63.4h-23.2l-13.7 29.3h29.8c-.2 2.7-.4 5.4-.4 8.2 0 3.3.2 6.7.5 10h-15L181 142.1h36.3a103.5 103.5 0 0095.2 61.7c20.7 0 40.9-6 58.1-17.5v-36a72.5 72.5 0 01-115.4-8.2h76l13.7-29.4H244.2a78.5 78.5 0 01-.4-18.2h109.8l13.7-29.3h-114a72.7 72.7 0 0162.9-36.4"/>
  <path id="path5705" d="M316.2 29.7c21.6 0 42.1 9.8 55.7 26.6l.9 1.1.6-1.3 11.9-25.5.3-.6-.5-.4a106 106 0 00-131.5-10.7 102.7 102.7 0 00-37.7 46l.8-.6H193l-.2.5-13.7 29.4-.6 1.3h31.2l-.9-1c-.2 3-.4 5.8-.4 8.3 0 3.4.2 6.7.5 10.1l.9-1h-15.5l-.2.5-13.7 29.4-.6 1.2h37.7l-.8-.5c16.4 37.8 54 62.2 96 62.2a105 105 0 0058.6-17.6l.4-.3V148l-1.5 1.8a71.7 71.7 0 01-114-8.1l-.7 1.4h76.6l.2-.5 13.7-29.4.6-1.2H244.2l.9.8a76 76 0 01-.4-18l-.9.8h110.4l.2-.5L368 65.6l.6-1.3H253.2l.8 1.3a72.2 72.2 0 0162.2-35.9m-63 36.4h114l-.8-1.2-13.7 29.4.8-.5H242.9l-.1.8c-.2 2.5-.4 5-.4 7.5 0 3.7.3 7.4.8 11l.1.8H345l-.8-1.3-13.7 29.4.8-.5h-77.7l.9 1.4a73.5 73.5 0 00116.9 8.2l-1.5-.6v36l.4-.7a105.4 105.4 0 01-57.7 17.2c-41.2 0-78.3-24-94.4-61.1l-.2-.5h-36.9l.8 1.3 13.7-29.4-.8.5h16l-.1-1a111.2 111.2 0 01-.1-18.1l.1-1h-30.8l.8 1.2 13.7-29.3-.8.5h23.8l.2-.5a100.5 100.5 0 0137.1-45.2c40.3-27 93.9-22.6 129.2 10.5l-.2-1-11.9 25.5 1.5-.2a73.5 73.5 0 00-120.8 9.6l-.8 1.3h1.5z" class="st0"/>
</svg>
woocommerce-blocks/images/payment-methods/eps.svg000064400000010452151335517640016245 0ustar00<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" id="Layer_1" x="0" y="0" version="1.1" viewBox="0 0 750 576.8" xml:space="preserve">
  <symbol id="EPS-Logo" viewBox="-385 -236.3 770 472.8">
    <path id="XMLID_367_" d="M219 0h-61.3c-6.8 0-12.4 5.4-12.4 12.2S150.9 25 157.7 25H251v46h-93.3a59.1 59.1 0 010-118h60.4c6.8 0 12.4-5.4 12.4-12.2 0-6.8-5.5-11.8-12.4-11.8H88.6c-11-21-21.7-39-43.4-48H219a59.5 59.5 0 010 119z" class="st0"/>
    <path id="XMLID_201_" d="M-15.8 71A94.6 94.6 0 01-110-23.8V-221h47v102h47.1a95 95 0 0194 95.4c0 52.2-42 94.6-93.9 94.6zm0-142H-63v47.4c0 26.5 21.1 48 47.2 48a47.8 47.8 0 000-95.4z" class="st0"/>
    <g id="XMLID_196_">
      <g id="XMLID_198_">
        <path id="XMLID_200_" d="M-258.8-119a95.6 95.6 0 00-91.9 73s-2.9 13.7-2.9 22.7 2.8 22.8 2.8 22.8a94.8 94.8 0 00186.9-22.6V-46h-138.6c8.2-16 24.7-25 43.8-25h124.6l.2 135.3a36.8 36.8 0 01-36.7 36.7h-176.6c-20.2 0-36.7-16-36.7-36.2v-176.6a37.2 37.2 0 0136.7-37.2h176.6c18.1 0 33.2 13 36.1 30h-124.3z" class="st2"/>
        <path id="XMLID_199_" d="M-259 26.6A51 51 0 01-302.8 0h87.6A51 51 0 01-259 26.6z" class="st2"/>
      </g>
      <path id="XMLID_197_" d="M-179 158.4a79 79 0 01-80 78.1 79.1 79.1 0 01-80-75.9v-24c0-2.8 2.3-5.6 5.2-5.6h29.4c2.9 0 5.4 2.8 5.4 5.6v21.9c0 21.5 17.9 39 40 39s40-17.5 40-39v-21.9c0-2.8 2.3-5.6 5.2-5.6h29.4c2.9 0 5.3 2.8 5.3 5.6v21.8h.1z" class="st2"/>
    </g>
    <g id="XMLID_13_">
      <path id="XMLID_192_" d="M36.9-180l-4.3-24.1c-2.1-12.2-10.1-17.8-20.9-17.8-9.2 0-16.3 6-14.2 17.7L1.8-180h6.6l-4.3-24.1c-1.3-7.5 2.1-11.8 8.5-11.8 6.6 0 12.2 3.9 13.5 11.8l4.3 24.1h6.5zm-25.7 7.5c0-2 1.5-3 3.2-3 2.1 0 4.3 1.5 4.3 4.3 0 1.9-1.3 3-3 3-2.2 0-4.5-1.4-4.5-4.3zm14.1.1c0-2.1 1.6-3 3.3-3 1.8 0 4.3 1.5 4.3 4.2 0 1.9-1.4 3-3 3-2.1 0-4.6-1.4-4.6-4.2z" class="st0"/>
      <path id="XMLID_189_" d="M52.8-180l-3-16.7a15 15 0 0011.2 5.2c7.3 0 12.4-4.3 12.4-12.3 0-11.3-7.9-18.1-17.9-18.1-3.9 0-7.2 1.4-9.2 5.1l-1.1-4.3h-5.7l7.3 41h6zm-4.6-28.1c-.2-4.8 2.9-8 7.4-8 5.7 0 11.3 4.4 11.6 11.2.2 4.9-3 7.8-7.4 7.8-5.6 0-11.3-4.6-11.6-11z" class="st0"/>
      <path id="XMLID_186_" d="M85.4-209c-.2-4 2.9-7.3 8.2-7.3 3 0 6.9 1.2 9 3.2l3.3-3.8c-3.6-3.3-8.9-5-13.4-5-8.4 0-13.3 5-13.3 12.7 0 10.2 8 17.8 18.3 17.8 9.4 0 14.7-5.7 11.5-17.7H85.4zm18.7 5c.5 5-2.5 7-7.4 7-4.4 0-8.5-2-10.3-7h17.7z" class="st0"/>
      <path id="XMLID_184_" d="M125.3-192l-.3-3.9a11 11 0 009.4 4.5c2.8 0 5.4-1 6.7-2.5l-3.7-5.3a6.3 6.3 0 01-4.8 1.8 9.2 9.2 0 01-9.3-7.9l-2.8-15.7h-6.1l5.1 29h5.8z" class="st0"/>
      <path id="XMLID_182_" d="M170.5-192l3.1-22.9 11.1 22.9h6.8l-15.3-29H169l-2.9 19.1-4.7-9.5-5.1-9.6h-7.1l-5.1 29h6.9l3-22.9 11.2 22.9h5.3z" class="st0"/>
      <path id="XMLID_179_" d="M199.3-209c-.2-4 2.9-7.3 8.2-7.3 3 0 6.9 1.2 9 3.2l3.3-3.8c-3.6-3.3-8.9-5-13.4-5-8.4 0-13.3 5-13.3 12.7 0 10.2 8 17.8 18.3 17.8 9.4 0 14.7-5.7 11.5-17.7h-23.6zm18.6 5c.5 5-2.5 7-7.4 7-4.4 0-8.5-2-10.3-7h17.7z" class="st0"/>
      <path id="XMLID_168_" d="M239.6-192l-5.1-29h-6.1l5.1 29h6.1zm-5.4 7.9c0-2.1 1.5-3.1 3.2-3.1 2.4 0 4.6 1.5 4.6 4.4a3 3 0 01-3.1 3.1c-2.2 0-4.7-1.4-4.7-4.4z" class="st0"/>
      <path id="XMLID_60_" d="M266.6-199.2c-1.9 2.1-4.3 2.7-7.2 2.7-4 0-6.9-1.4-6.9-3.9 0-2.1 2.3-3 5.7-3.3 5.3-.5 12.1-2.2 10.7-9.8-1-5.4-6.4-8.6-14-8.6-4.7 0-9.3 1.1-12.4 5.4l4 4.3c2.2-3 6-4.3 9.5-4.3 2.9 0 6.3 1.1 6.9 3.8.5 2.6-1.8 3.6-6 4-5 .5-10.4 2.3-10.4 7.8 0 7.3 7.9 9.8 13.8 9.8 4.5 0 7.8-1 10.5-3.9l-4.2-4z" class="st0"/>
      <path id="XMLID_57_" d="M285.8-192l-2.8-15.6c-.9-5 1.4-8.4 6.4-8.4 4.8 0 8.9 4 9.7 8.8l2.7 15.2h6.1l-5.1-29h-5.5l.4 4.2a15 15 0 00-10.9-4.8c-7.2 0-11.4 5.1-9.9 13.9l2.8 15.6h6.1z" class="st0"/>
      <path id="XMLID_55_" d="M334.7-221l2.8 15.5c.9 5-.8 8.4-6.4 8.4-4.8 0-8.9-3.9-9.8-8.7l-2.7-15.2h-6.1l5.1 29h5.6l-.4-4.2c3.4 3.1 6.9 4.7 10.6 4.7 7.1 0 11.7-4.9 10.1-13.9l-2.8-15.6h-6z" class="st0"/>
      <path id="XMLID_15_" d="M355.3-225c-.4-4 2.7-5.6 7.8-5.6 4.5 0 9.3 2.5 10.5 8.9l.9 5a14 14 0 00-11.1-5.2c-7.5 0-12.7 4.4-12.7 12.5 0 11.5 8.5 18.1 18.1 18.1 4.1 0 7.7-1.9 9-5.2l1 4.6h5.9l-5.1-29.9c-1.9-11.1-10.1-14.5-17.6-14.5-9 0-14 4.3-12.7 11.3h6zm1.7 16.7c0-5 3.3-8 7.9-8 12.6 0 16 19.3 3.4 19.3a11 11 0 01-11.3-11.3z" class="st0"/>
    </g>
  </symbol>
  <use id="XMLID_202_" width="770" height="472.8" x="-385" y="-236.3" overflow="visible" transform="matrix(.9728 0 0 -.9728 375.5 285.5)" xlink:href="#EPS-Logo"/>
</svg>
woocommerce-blocks/images/payment-methods/multibanco.svg000064400000012056151335517640017615 0ustar00<svg xmlns="http://www.w3.org/2000/svg" id="Layer_1" data-name="Layer 1" preserveAspectRatio="xMidYMid meet" viewBox="0 0 750 885.9">
  <defs/>
  <g id="g14">
    <g id="g20">
      <path id="path22" fill="#2c6cae" d="M371.2 713.9h307c70.2 0 70.9-74.5 63.8-111.3-4-24.8-46-24.6-50.6 0v28.7a24 24 0 01-23.9 23.8H78.7A24 24 0 0155 631.3v-28.7c-4.6-24.6-46.7-24.8-50.6 0C-2.8 639.4-2 713.9 68 713.9h303.2zM154 0h473.6C660.9 0 688 28.8 688 64v30.6c0 43.3-58.6 43-58.6.3V78.2A19.4 19.4 0 00610 58.9H135.6a19.4 19.4 0 00-19.3 19.3v16.4c0 43-55.8 42.7-55.8.9V64c0-35.2 27.2-64 60.5-64z"/>
    </g>
    <g id="g24">
      <path id="path26" d="M676.1 351.7a93.6 93.6 0 0155.5 83.8c0 51.6-45 93.7-100 93.7H477.3c-14.4 0-26.2-11-26.2-24.5V211.3a25.8 25.8 0 0125.7-25.8h128.5c54 0 98.3 44.2 98.3 98.2a97.8 97.8 0 01-27.5 68m-115.1-24h49v-.5a46.7 46.7 0 0039.5-46 46.7 46.7 0 00-46.6-46.5h-98.6V478h125a48 48 0 100-96.2H561a27 27 0 110-54.1" class="cls-2"/>
    </g>
    <g id="g28">
      <path id="path30" d="M173.6 804a8.3 8.3 0 0116.6 0v44.7a37.2 37.2 0 01-37.2 37.1 37.2 37.2 0 01-37.1-37V804a8.3 8.3 0 0116.5 0v44.8a20.7 20.7 0 0020.6 20.5 20.7 20.7 0 0020.6-20.6z" class="cls-2"/>
    </g>
    <g id="g32">
      <path id="path34" d="M251.8 869.3a8.3 8.3 0 110 16.6h-22.9a31.1 31.1 0 01-31-31V804a8.3 8.3 0 1116.5 0v50.8a14.7 14.7 0 0014.6 14.6h22.8z" class="cls-2"/>
    </g>
    <g id="g36">
      <path id="path38" d="M426.6 500a31 31 0 11-61.6 6.5L339.7 273l-89.8 228.2-.1.2-.3.6-.2.5v.1l-.2.5-.1.3-.2.4-.1.2-.3.5v.2a30.7 30.7 0 01-6.4 8.2h-.1l-.5.5a30.5 30.5 0 01-5.3 3.8h-.1l-.6.4-.6.3h-.2l-.4.2-.3.2-.4.2-.3.1-.4.2-.3.1-.3.1h-.1l-.3.2-.4.1-.3.1a31 31 0 01-9 1.7h-2.3a30.8 30.8 0 01-10.1-2l-.4-.2h-.1l-.5-.2-.4-.2-.3-.1-.3-.2-.4-.2h-.2l-.6-.4-.5-.2-.3-.2a31 31 0 01-4.7-3.3h-.1l-1-1-.8-.7-.8-.8-.9-1v-.1a30.9 30.9 0 01-3.4-4.7l-.1-.3-.3-.5-.3-.6v-.2l-.2-.4-.2-.3-.2-.4-.1-.4-.2-.4-.2-.5-90-228.6-25.4 233.4a31 31 0 11-61.5-6.6l29.9-275v-.2a51.5 51.5 0 0144.2-45.2l1.8-.2a52.5 52.5 0 017.8-.3h.1a52.7 52.7 0 019.4 1.3 50.8 50.8 0 0136 31L221 405.7l76.5-194.4a50.8 50.8 0 0136-31 52.4 52.4 0 019.4-1.3h.1a52.6 52.6 0 017.8.2l1.7.2a51.3 51.3 0 0138.5 26.7 52.1 52.1 0 013.8 9 50.7 50.7 0 012 9.5v.2z" class="cls-2"/>
    </g>
    <g id="g40">
      <path id="path42" d="M112.8 876.6a8.3 8.3 0 11-16.4 2L89.3 819 64 877.6a8.3 8.3 0 01-15.2 0L23.6 819l-7.1 59.5A8.3 8.3 0 110 876.6l8.2-69.1a13.3 13.3 0 017.2-10.3 15.5 15.5 0 011.6-.7l.7-.2a15.3 15.3 0 012.4-.6h.1a14.3 14.3 0 0111.6 3.7 13.6 13.6 0 012.6 3.5 6.6 6.6 0 01.5.9l21.4 49.7 21.4-49.7a13.6 13.6 0 019.7-7.8 15 15 0 012.4-.3 15.6 15.6 0 011.8 0h.7a14 14 0 0110.4 6.6 13.2 13.2 0 011 2.4 12 12 0 01.5 1.6 8 8 0 01.2 1v.2z" class="cls-2"/>
    </g>
    <g id="g44">
      <path id="path46" d="M287.9 877.6a8.3 8.3 0 01-16.5 0v-65.4h-23.6a8.3 8.3 0 010-16.5h63.6a8.3 8.3 0 010 16.6H288z" class="cls-2"/>
    </g>
    <g id="g48">
      <path id="path50" d="M339.5 877.6a8.3 8.3 0 01-16.6 0V804a8.3 8.3 0 1116.6 0z" class="cls-2"/>
    </g>
    <g id="g52">
      <path id="path54" d="M509.1 876.6a8.3 8.3 0 11-16.4 2l-2.9-23.4h-28.7a8.3 8.3 0 110-16.5h26.6l-.7-6v-.1-.6a32 32 0 00-1-4.2 27.7 27.7 0 00-1.7-4.4c-3.3-6.6-9.2-11.2-16.7-11.2h-.1a17.8 17.8 0 00-4.2.5 16.9 16.9 0 00-3.7 1.4 23.1 23.1 0 00-11.5 18.4l-5.1 46a8.3 8.3 0 11-16.5-1.8l5.2-46c1.5-13.5 9-25.5 20.5-31.3a33.3 33.3 0 017.3-2.7 34.5 34.5 0 018-1c14.4 0 25.5 8.4 31.5 20.3a43.8 43.8 0 012.8 7 46.8 46.8 0 011.4 6.8 6.7 6.7 0 01.2.8z" class="cls-2"/>
    </g>
    <g id="g56">
      <path id="path58" d="M534.4 877.6a8.3 8.3 0 01-16.5 0v-68.4a8 8 0 01.1-1.4 11.3 11.3 0 01.7-2.7 14.3 14.3 0 01.6-1.5 11.6 11.6 0 016.5-5.4 9.7 9.7 0 011.1-.3l1-.2a13.2 13.2 0 012 0h.2a11.6 11.6 0 018.7 4.4l44 56.1V804a8.3 8.3 0 1116.6 0v68a11.6 11.6 0 01-4.3 9.1 12 12 0 01-1.7 1.2l-1 .5h-.1a7 7 0 01-.7.3 11.6 11.6 0 01-8.9-.5 7.1 7.1 0 01-1-.6 11.7 11.7 0 01-1.7-1.2 10.3 10.3 0 01-1-1.1l-.2-.3-.1-.2-44-56z" class="cls-2"/>
    </g>
    <g id="g60">
      <path id="path62" d="M663.6 869.3a8.3 8.3 0 110 16.6h-24.4a32.7 32.7 0 01-32.6-32.6v-25a32.6 32.6 0 0132.6-32.5h24.4a8.3 8.3 0 110 16.5h-24.4a16.2 16.2 0 00-16 16.1v25a16.2 16.2 0 0016 16h24.4z" class="cls-2"/>
    </g>
    <g id="g64">
      <path id="path66" d="M711.5 812.2a22.6 22.6 0 00-15.7 6.3 20.3 20.3 0 00-6.4 14.6v15.4a20.3 20.3 0 006.4 14.6 22.6 22.6 0 0015.7 6.3A22.5 22.5 0 00727 863a20.2 20.2 0 006.4-14.6V833a20.2 20.2 0 00-6.4-14.6 22.6 22.6 0 00-15.7-6.3m0-16.5a39.1 39.1 0 0127.2 10.8 36.7 36.7 0 0111.4 26.6v15.4a36.7 36.7 0 01-11.5 26.5 39 39 0 01-27 10.8 39.1 39.1 0 01-27.2-10.8 36.7 36.7 0 01-11.4-26.5v-15.4a36.7 36.7 0 0111.4-26.5 39 39 0 0127.1-10.8z" class="cls-2"/>
    </g>
    <g id="g68">
      <path id="path70" d="M363 812.2v57.1h32a10.5 10.5 0 0010.4-10.4 10.3 10.3 0 00-2.8-7l-.3-.3a10.3 10.3 0 00-7.3-3.1h-11a8.3 8.3 0 110-16.5h3.8a10 10 0 006.2-3 9.9 9.9 0 002.9-7 10 10 0 00-9.9-9.8h-24zm-16.5 28v-35.9a8.3 8.3 0 01.6-3.3 8.4 8.4 0 011.9-2.8h.1a8.5 8.5 0 015.4-2.5 2.7 2.7 0 01.5 0h32a26.4 26.4 0 0126.3 26.4 26.3 26.3 0 01-4 14 27.4 27.4 0 014.6 3.8l.5.5a26.9 26.9 0 017.4 18.4 27 27 0 01-26.9 27h-40.2a8.3 8.3 0 01-8.3-8.3z" class="cls-2"/>
    </g>
  </g>
</svg>
woocommerce-blocks/images/payment-methods/visa.svg000064400000001706151335517640016422 0ustar00<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 750 471">
  <g fill="none" fill-rule="evenodd">
    <rect width="750" height="471" fill="#0e4595" rx="40"/>
    <path fill="#fff" d="M278.2 334.2l33.4-195.7h53.3l-33.4 195.7zm246.1-191.5c-10.6-4-27.1-8.2-47.8-8.2-52.7 0-89.9 26.5-90.2 64.6-.3 28.1 26.5 43.8 46.8 53.2 20.7 9.5 27.7 15.7 27.6 24.2-.1 13.2-16.6 19.2-32 19.2-21.3 0-32.6-3-50.1-10.3l-7-3.1-7.4 43.8a169 169 0 0059.4 10.4c56.1 0 92.5-26.2 93-66.8.2-22.3-14-39.3-44.8-53.2-18.7-9-30.1-15.1-30-24.3 0-8.1 9.7-16.8 30.6-16.8 17.4-.3 30 3.5 39.9 7.5l4.8 2.2 7.2-42.4m137.3-4.2h-41.2c-12.8 0-22.3 3.5-28 16.2l-79.2 179.4h56l11.3-29.4h68.3a3753 3753 0 016.5 29.4h49.5zm-65.4 126.4l21.3-54.8c-.4.6 4.3-11.3 7-18.6l3.6 16.8 12.4 56.6zM232.9 138.5L180.7 272l-5.6-27.2c-9.7-31.2-40-65.1-73.9-82L149 333.8h56.4l84-195.4z"/>
    <path fill="#f2ae14" d="M132 138.5H45.8l-.7 4c67 16.2 111.2 55.4 129.6 102.5l-18.7-90c-3.2-12.4-12.6-16.1-24.2-16.5"/>
  </g>
</svg>
woocommerce-blocks/images/payment-methods/p24.svg000064400000005335151335517640016067 0ustar00<svg xmlns="http://www.w3.org/2000/svg" id="Layer_1" data-name="Layer 1" preserveAspectRatio="xMidYMid meet" viewBox="0 0 750 256.9">
  <defs/>
  <path d="M0 223.3l19-106.9h48.9c12 0 19.8 2.3 23.4 7s4.2 13.4 1.9 26.1c-2.2 12.2-6 20.6-11.3 25s-14.4 6.6-26.9 6.6H19.3L12 223.4zM21.3 171h28.6c11.9 0 19.8-1.2 23.6-3.7s6.5-8.1 8-16.9c1.8-10.3 1.8-16.8 0-19.6s-7-4-15.4-4l-4.6-.1H29.1zM104 148.5h11l-2.6 8.6.2.2c5.6-7 13.3-10.6 23.3-10.6q20.7 0 17 21.3l-1 5.2h-11l.6-1.8 1-4c1.3-7.7-2.1-11.5-10.5-11.5-12.2 0-19.6 7.5-22.3 22.6l-8 44.8h-11zM162.3 148.5h54l-2 10.6-54.3 55.1h44.6l-1.6 9h-57.7L147 213l54.6-55.4h-41zM270.1 200.6h11.3l-.4 2.8c-1.4 7.8-4.7 13.2-10 16.3s-13.8 4.7-25.7 4.7c-13.8 0-22.4-2.5-25.8-7.6s-3.7-15.6-.8-31.7c2.7-15 6.6-25 11.9-30s14.1-7.7 26.7-7.7c13.8 0 22.4 2.3 26 6.7s3.9 13.7 1.4 28l-1 5.8h-53.8c-2.2 11.8-2.2 19.3-.2 22.5s7.5 4.9 16.8 4.9q13.2 0 17.6-2.3t5.7-10zm3.8-21.2l.6-3.5c1.5-8.1 1-13.3-1.2-15.8s-7.8-3.6-16.6-3.6-14.9 1.4-18 4.3-5.5 9-7.3 18.7H274zM320.1 116.5l-19 106.8h-11l19-106.9zM372.1 200.6h11.2l-.3 2.8c-1.4 7.8-4.7 13.2-10 16.3s-13.9 4.7-25.7 4.7c-13.8 0-22.4-2.5-25.8-7.6s-3.7-15.6-.8-31.7c2.7-15 6.5-25 11.8-30s14.2-7.7 26.8-7.7c13.8 0 22.4 2.3 26 6.7s4 13.7 1.4 28l-1 5.8h-53.9c-2 11.8-2.1 19.3-.2 22.5s7.6 4.9 16.9 4.9q13.2 0 17.6-2.3t5.7-10zm3.8-21.2l.6-3.5c1.4-8.1 1-13.3-1.2-15.8s-7.8-3.6-16.6-3.6-14.9 1.4-18 4.3-5.6 9-7.3 18.7h42.5zM501.3 148.5l-34.2 74.8h-16.3l-2.6-41.6-.8-12.7-.3-6.3-.4-6.3h-.2l-2.6 6.3-2.6 6.3-5.3 12.7-17.5 41.6H402l-7-74.8h11.5l3.2 41.4 1 13 .4 6.5.3 6.5h.4l2.6-6.5 2.7-6.5 5.4-13 17.6-41.5h16l2.8 41.6.8 13 .4 6.4.3 6.5h.2l2.8-6.5 2.8-6.5 5.6-13 17.9-41.4h11.7zM556.5 148.5l-14.3 33.3-7.2 16.6-3.4 8.4-3.6 8.2h-.3l-1.4-8.2-1.3-8.4-2.9-16.6-5.6-33.3H505l15 81.3-1.8 3.7c-4.6 9.9-9.9 14.6-15.7 14.3a25.3 25.3 0 01-3.7-.5l-1.6 9a28.8 28.8 0 005.2.6c6.7 0 12.3-2.1 16.6-6.3s9-11.8 14-23l35.3-79.1z" class="cls-1"/>
  <path d="M638.3 213.8l-1.8 10h-75l3.4-20q3-16.7 10.3-21.9c4.9-3.4 15.5-6.1 31.9-8q19.6-2.2 24.3-6c3.1-2.4 5.6-8.9 7.4-19.3 1.6-9 1.1-15-1.4-17.7s-8.8-4-18.8-4c-12.5 0-20.6 1-24.3 3.3s-6.2 7.4-7.7 15.8l-1.2 8h-11.5l1-5.5c2.2-12.7 6.3-21.1 12.3-25.3s17-6.3 32.8-6.3c14 0 23 2.3 27.2 6.8s4.9 13.5 2.5 26.6q-3.3 19-11.2 25.4t-31 8.7c-13.4 1.4-21.6 3.2-24.6 5.6s-5.4 9.1-7.4 20.3l-.6 3.6h63.4zM737.2 118l-12.5 71.4h15.5l-1.7 10h-15.6l-4.3 24.5h-11.8l4.3-24.5h-58.4l2.5-14L719 118zM713 189.3l11.2-63.8h-.3l-59.6 63.8zM248 84a386.4 386.4 0 0173.2-33l-4.7-26.3a516.1 516.1 0 00-94 40zM538 69.7l90.4-49.2A491 491 0 00483.7 0h-.6l-20.7 41.3a254.3 254.3 0 0175.7 28.4zM199.5 78.2c-39.7 24.7-60.5 45.6-60.5 45.6h50.3c12.2-9.5 24.3-18 36-25.8zM453.9.6a547.1 547.1 0 00-117.5 18.3l3.5 26.8c37.8-9.9 72-11.2 101.7-7.7zM676.5 39.6l-117 43.8A148.6 148.6 0 01576 97h174s-19.7-30.5-73.5-57.3z" class="cls-2"/>
</svg>
woocommerce-blocks/images/payment-methods/bancontact.svg000064400000014026151335517640017573 0ustar00<svg xmlns="http://www.w3.org/2000/svg" id="Layer_1" data-name="Layer 1" preserveAspectRatio="xMidYMid meet" viewBox="0 0 750 530.1">
  <defs/>
  <path fill="#fff" d="M750 484.6a45.6 45.6 0 01-45.5 45.5H45.8A45.6 45.6 0 01.2 484.6v-439A45.6 45.6 0 0145.8 0h658.7A45.6 45.6 0 01750 45.5v439z"/>
  <path d="M602.6 148.1H422.5L404 168.8l-59.3 67-18.4 20.6H148.8l18-20.9 8.4-9.9 18-21h-81.6c-15 0-27.2 12.7-27.2 28v58.8a27.5 27.5 0 0027.1 27.8h313.3c15 0 35.4-9.2 45.3-20.7l47.4-53.8z" class="cls-2"/>
  <path fill="#ffd800" d="M638.7 85.3c15 0 27.1 12.7 27.1 27.9v58.6a27.5 27.5 0 01-27.1 27.8h-81.4l18.1-20.7 9-10.3 18.2-20.7H422.5l-96 108.1H148L276 111l4.8-5.4a70.3 70.3 0 0145.6-20.7h312.3z"/>
  <path d="M665.8 442.5V434c0-1.1-.7-1.8-2.3-1.8H658c-1.6 0-2.8-.3-3-1-.5-.6-.5-2-.5-4.3v-32.2h9a2.4 2.4 0 002.3-2.3v-9a2.4 2.4 0 00-2.3-2.3h-9v-11.7a2 2 0 00-.4-1.4 3.3 3.3 0 00-1.4-.5h-.2l-13.4 2.3a11.2 11.2 0 00-1.6.7 2 2 0 00-.7 1.4v9h-9a2.4 2.4 0 00-2.3 2.3v7.4a1.4 1.4 0 00.7 1.3 3.7 3.7 0 001.6 1l9 1.3v32.2a37 37 0 001.2 9.7 15.3 15.3 0 003.4 5.8 12.2 12.2 0 005.8 2.7 42 42 0 008 .7 26.4 26.4 0 004.3-.2c1.2-.3 2.8-.5 4.4-.7a1.7 1.7 0 001.9-1.9m-47.8-1.1v-10a1.4 1.4 0 00-.7-1.3 3.3 3.3 0 00-1.4-.5h-.2a56.6 56.6 0 01-6 .5 69.5 69.5 0 01-7.6.2 8.4 8.4 0 01-3.4-.7 8.8 8.8 0 01-3-2 8.8 8.8 0 01-1.9-4 23.1 23.1 0 01-.7-6.2v-9.2a23.1 23.1 0 01.7-6.2 12.4 12.4 0 011.9-3.9 8.8 8.8 0 013-2 9.2 9.2 0 013.4-.7 69.5 69.5 0 017.6.2l6 .4h.2a2 2 0 001.4-.4 1.4 1.4 0 00.7-1.4v-9.9a2.2 2.2 0 00-.5-1.6 6.7 6.7 0 00-1.8-1c-1.6-.4-3.5-.6-6-1a50 50 0 00-8.7-.5c-7.9 0-14 2.3-18.9 7.1a29.1 29.1 0 00-7.1 21v9.1c0 9 2.3 16.1 7.1 21a25 25 0 0018.9 7c3.2 0 6.2-.1 8.7-.4a55.9 55.9 0 006-1.1 3.5 3.5 0 001.8-1c.5-.2.5-.9.5-1.5m-72-11.8a24.5 24.5 0 01-4.4 1.6 17.5 17.5 0 01-4.8.7c-2.3 0-4.1-.2-5.3-.9s-1.6-2-1.6-4.6v-1a14 14 0 01.5-3.4 6 6 0 011.6-2.5 6 6 0 013-1.4 24.4 24.4 0 014.8-.4h6.2v12zm17.5-26.9a26.9 26.9 0 00-1.9-10.3 19.2 19.2 0 00-5-7 18.8 18.8 0 00-8-3.8 39.7 39.7 0 00-10.9-1.4 82.6 82.6 0 00-10.8.7 48 48 0 00-8.3 1.6c-1.3.4-2 1.1-2 2.5v9a3.3 3.3 0 00.4 1.6 3.3 3.3 0 001.4.5h.5c.9 0 2-.3 3.2-.3l4.4-.2 5.2-.2h5.3a11 11 0 016 1.4c1.4.9 2.3 3 2.3 6.2v3.9h-6c-9.4 0-16.6 1.4-20.7 4.4-4.4 3-6.4 7.8-6.4 14.2v1c0 3.6.4 6.6 1.6 9a16.8 16.8 0 004.3 6 18.8 18.8 0 006 3.2 24.3 24.3 0 007.2.9 23.6 23.6 0 008.5-1.4 33.6 33.6 0 006.9-3.7v1.9a2.4 2.4 0 002.3 2.3h12.4a2.4 2.4 0 002.3-2.3v-39.7zm-59.1 39.8V434c0-1.1-.7-1.8-2.3-1.8h-5.6c-1.6 0-2.7-.3-3-1-.4-.6-.4-2-.4-4.3v-32.2h9a2.4 2.4 0 002.3-2.3v-9a2.4 2.4 0 00-2.3-2.3h-9v-11.7a2 2 0 00-.5-1.4 3.3 3.3 0 00-1.3-.5h-.3l-13.3 2.3a11.2 11.2 0 00-1.6.7 2 2 0 00-.7 1.4v9h-9.2a2.4 2.4 0 00-2.3 2.3v7.4a1.4 1.4 0 00.7 1.3 3.7 3.7 0 001.6 1l9 1.3v32.2a37 37 0 001.1 9.7 15.3 15.3 0 003.5 5.8 12.2 12.2 0 005.7 2.7 42 42 0 008 .7 26.4 26.4 0 004.4-.2c1.2-.3 2.8-.5 4.4-.7 1.4 0 2-.7 2-1.9m-48.2-.2v-36.8a46.5 46.5 0 00-1-9.9 22.5 22.5 0 00-3-8 13.4 13.4 0 00-6-5.3 20.4 20.4 0 00-9.8-2 30.1 30.1 0 00-9.5 1.3 32.3 32.3 0 00-8.7 4.6v-2.8a2.4 2.4 0 00-2.3-2.3h-12.4a2.4 2.4 0 00-2.3 2.3v59a2.4 2.4 0 002.3 2.2h13.3a2.4 2.4 0 002.3-2.3v-43.5a58.8 58.8 0 015.6-2.5 13.1 13.1 0 015-1 20.6 20.6 0 014.2.5 4.8 4.8 0 012.5 1.6 6.7 6.7 0 011.1 3.2 30.9 30.9 0 01.3 4.9v36.8a2.4 2.4 0 002.3 2.3h13.3a2 2 0 001.6-.7 1.8 1.8 0 001.2-1.6m-83.7-25.6c0 9-3.3 13.6-10 13.6-3.2 0-5.7-1.1-7.3-3.4s-2.5-5.8-2.5-10.2V409c0-4.6.9-7.8 2.5-10.1s4.1-3.5 7.4-3.5c6.4 0 9.9 4.7 9.9 13.6zm17.9-7.8a38.4 38.4 0 00-1.9-12 25 25 0 00-5.2-9 23.2 23.2 0 00-8.8-5.7 35.6 35.6 0 00-23.9 0 23.2 23.2 0 00-8.7 5.7 25 25 0 00-5.3 9 38.4 38.4 0 00-1.9 12v7.8a38.4 38.4 0 001.9 12 25 25 0 005.3 9 23.2 23.2 0 008.7 5.8 35.6 35.6 0 0024 0 23.2 23.2 0 008.7-5.8 25 25 0 005.2-9 38.4 38.4 0 001.9-12zm-61.4 32.5v-10a1.4 1.4 0 00-.7-1.3 3.3 3.3 0 00-1.6-.5h-.2a56.6 56.6 0 01-6 .5 69.5 69.5 0 01-7.6.2 8.4 8.4 0 01-3.5-.7 8.8 8.8 0 01-3-2 8.8 8.8 0 01-1.8-4 23.1 23.1 0 01-.7-6.2v-9.2a23.1 23.1 0 01.7-6.2 12.4 12.4 0 011.8-3.9 8.8 8.8 0 013-2 9.2 9.2 0 013.5-.7 69.5 69.5 0 017.6.2l6 .4h.2a3.3 3.3 0 001.6-.4 1.4 1.4 0 00.7-1.4v-9.9a2.2 2.2 0 00-.5-1.6 6.7 6.7 0 00-1.8-1c-1.6-.4-3.5-.6-6-1a50 50 0 00-8.8-.5c-7.8 0-14 2.3-18.8 7.1a29.1 29.1 0 00-7.1 21v9.1c0 9 2.3 16.1 7 21a25 25 0 0019 7c3.2 0 6.2-.1 8.7-.4 2.5-.4 4.4-.7 6-1.1a3.5 3.5 0 001.8-1 2.7 2.7 0 00.5-1.5m-54.5.9v-36.8a46.5 46.5 0 00-1-10 22.5 22.5 0 00-3-8 13.4 13.4 0 00-6-5.3 20.4 20.4 0 00-9.8-2 30.1 30.1 0 00-9.5 1.4 32.3 32.3 0 00-8.7 4.6v-2.8a2.4 2.4 0 00-2.3-2.3h-12.4a2.4 2.4 0 00-2.3 2.3v58.9a2.4 2.4 0 002.3 2.3h13.4a2.4 2.4 0 002.3-2.3v-43.5a58.8 58.8 0 015.5-2.5 13.1 13.1 0 015-1 20.6 20.6 0 014.2.5 4.8 4.8 0 012.5 1.6 6.7 6.7 0 011.2 3.2 30.9 30.9 0 01.2 4.9v36.8a2.4 2.4 0 002.3 2.3h13.3a2 2 0 001.6-.7 1.8 1.8 0 001.2-1.6m-85.6-12.7a24.5 24.5 0 01-4.4 1.6 17.5 17.5 0 01-4.8.7c-2.3 0-4.1-.2-5.3-.9s-1.6-2-1.6-4.6v-1a14 14 0 01.5-3.4 6 6 0 011.6-2.5 6 6 0 013-1.4 24.4 24.4 0 014.8-.4h6.2zm17.7-26.9a26.9 26.9 0 00-1.8-10.3 19.2 19.2 0 00-5-7 18.8 18.8 0 00-8-3.8 39.7 39.7 0 00-10.9-1.4 82.6 82.6 0 00-10.8.7 48 48 0 00-8.3 1.6c-1.3.4-2 1.1-2 2.5v9a3.3 3.3 0 00.4 1.6 3.3 3.3 0 001.4.5h.5c.9 0 2-.3 3.2-.3l4.6-.2 5.3-.2h5.3a11 11 0 016 1.4c1.3.9 2.3 3 2.3 6.2v3.9h-6c-9.5 0-16.6 1.4-20.7 4.3-4.4 3-6.5 7.9-6.5 14.3v1c0 3.6.5 6.6 1.6 9a16.8 16.8 0 004.4 6 18.8 18.8 0 006 3.1 24.3 24.3 0 007.1 1 23.6 23.6 0 008.5-1.4 33.6 33.6 0 007-3.7v1.8a2.4 2.4 0 002.2 2.3h12.5a2.4 2.4 0 002.3-2.3v-39.6zm-79 17.5a8.8 8.8 0 01-3.3 7.1c-2 1.6-6.2 2.6-11.7 2.6h-9.2v-20.7h12.4c4.4 0 7.6.9 9.2 3a11.1 11.1 0 012.5 6.9zm-.5-32.9a17.8 17.8 0 01-.5 3.5 6 6 0 01-1.8 2.7 12.2 12.2 0 01-3.4 1.8 18 18 0 01-5.6.7h-12.4v-19h8.5c5.7 0 9.6.7 12 2a7.3 7.3 0 013.4 6.7l-.2 1.6zm18.8 31.7a17.2 17.2 0 00-2.8-9.9 17.5 17.5 0 00-7-6.4 15.6 15.6 0 006.8-6.5 20.2 20.2 0 002.6-9.6v-2.1a23 23 0 00-2.6-11 19.3 19.3 0 00-7.1-7.1 34.6 34.6 0 00-11-4 89.5 89.5 0 00-14.3-1H105l-5.5.1a34.5 34.5 0 00-5 .5c-1.7.2-2.8.2-3.7.5-2.1.4-3.7.9-4.6 2-1 1-1.4 2.8-1.4 5.3v67.4c0 2.5.4 4.1 1.4 5.3a9.5 9.5 0 004.6 2 20.3 20.3 0 003.9.5c1.6.2 3.2.2 5 .5a44.3 44.3 0 005.5.2h5.8a83 83 0 0013.6-1.1 33.1 33.1 0 0011-4 21.8 21.8 0 007.6-7.5 24.5 24.5 0 002.7-12.2V419z" class="cls-2"/>
  <path fill="none" d="M0 0h749.8v530.1H0z"/>
</svg>
woocommerce-blocks/images/previews/beanie.jpg000064400000130473151335517640015416 0ustar00���JFIFHH��@ExifMM*�i� � ��8Photoshop 3.08BIM8BIM%��ُ��	��B~��  "��	
���}!1AQa"q2���#B��R��$3br�	
%&'()*456789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz������������������������������������������������������������������������	
���w!1AQaq"2�B����	#3R�br�
$4�%�&'()*56789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz�����������������������������������������������������������������������C��C��2��?��<�o�TtQ^��6Š(�.Š(�.Š(�.Š(�.Š(�.Š(�.Š(�.Š(�.Š(�.Š(�.Š(�.Š(�.Š(�.Š(�.Š(�.Š(�.Š(�.Š(�.Š(�.Š(�.Š(�.Š(�.Š(�.Š(�.Š(�.Š(�.Š(�.Š(�.Š(�.Š(�.Š(�.Š(�.Š(�.Š(�.Š(�.Š(�.Š(�.Š(�.Š(�.Š(�.Š(�.Š(�.Š(�.Š(�.Š(�.Š(�.Š(�.Š(�.¤�=���Q�@&���(����QE
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(������(����QE
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(������(����QE
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(������(����QE
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(������(����QE
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(������(����QE
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(������(����QE
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(������(����QE
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(������(����QE
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(������(����QE
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(������(����QE
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(������(����QE
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
+?Uմ�N���J�G�t�2�]]H�C���*��I�9�y����j|:�o�;����ZӜ�$zl��1�G�g
�<wÚNIn�g��Ҋ+Ꮓ_�R��7���zO�ڛ��4�v�-�Ԏ�
��w�K!c�ا5�s�(9�@}
5�ζ%��(((��(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��(���?���(����QE
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(�z��a��^ꚭ�:f�����\�:�Q�,���*��$� 2h�p��(�6�?�{�|V�����h�ږ�w����2fE,q‚I��������|`���ğ�����6�u-Cg�|X֗>Ә���0��ݖM�>T.�v�G����_n?�>/���(�M��������kk��!�}�P�<�׃���?�
;����f��u���*�_wO���>0������u�_����?m���'�~���L�N2�SD�^��ء���>[�O������_>�K��6�<��C�\i��N�F�Lt���B���|=i�_�~
�
�%	��m� �ȕCVl��֟��c��S��d�R%~����H�W�a8^^�nO�E����2�
�Rti(Euz��|�~$���	��x�Ay�a�ٿ?j�n��ĺMΦ�v924M-́I�Y8��|9��Ȟ�m4{/��—Vփ	%��^N}�k�6W'՘���(֯�K�������˹��;0+�[���<U�7ҿg��G�j_��mt�-p�G������Xv��\|��xQ�����t]YSM�]��+�w����y�!P�f��,R�'k$�ճ��������_h��7�/�8��o����o�[D7��ki`�k��n"n;��/�E��>0��O_��>$��d��n��?�c���3T�ېa�|�mm�e}ʭ�20��oث�9����y�
$�3����x����.2]�;���D'$��Y�k����b{�?4ox��N|�mo�:��."!͓�8\�g!d��+����\�ȴV�uf��{_M������U������w�m(_N[^�������G��+��Jm<W��V�!ѣ��U�5��sܫ;Ox���UρW��|m����L�[nR�=Ս��Y"��1ӝ��y�ݫ����h�?j����#֡M���mƺA_*[MR�*�b�wK��ܝP׳�z0�f%J�W�G��U5V�j��{����+x���B�+Qvk��s��Oc�<�+~�zmͮ��M���f�یqw��F�>le_�N�$����J�	�D��?i�8�~��׮�6s�>�H���`���ؚ�D�Ҡ��쯭#���^�d���X �E|��G�	�$�\�}SY�S�5�9:�����w�)���DMy���iU��~���}�e5ˈ���y}��'��kum}m��ukr��2YOB�V+���-������ws����O���WH��ϓ<j&�,`X��ƿK<���>\Zh?���u⿃ep�x���7�$#�>X���hș�C��� ���S|�֫�G�Y/���*˛�����s�,��$��"��?i{i>~�^�-��tۍB;
D�
�鷻`�U���ݥ��X�Gym/+$LOЂA����Q@Q@Q@Q@Q@Q@Q@Q@Q@Q@Q@Q@Q@Q@Q@Q@Q@Q@Q@Q@Q@����(����QE
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
+�?�s����?c����h��V<-�[�/u{2��E����c�����X������'�o�X.5X<%��_���~��`Q�|SjĆw|���d�
�,s�a��+O�ҏ4���#�0̰�JN�&j1�����?�'�O�e����>|/2�՟���#Z�'�2��Ep��?2+m��ƢI�L`s_��:�m����[��g�X��CR��G�O-��eMF�s�O+#σ�#�}#�:~����ɧ���Û?j�p��5���Ԯ���RfR�QvǞ�+��[t�G�Z�	��&\ϲ��՟�f�$׫x`a��ˤ�q�>x�����|5k�/�j/&���6���ǖ�GbY�r]��5��*m�z��
p*ߚ���$�Q��]��M��m�=�տ�&�}�gq}?��vS���_/����7s\H6T�q�9�v_�[(��A�=�۲����$��k����'�~,���Mt	x.�K��A�Tui$br�w�S	EB>�z��fX�VJ�5w�����ۛ�����;G���'ǯ��?�~
�"_6I.�*�pю����S�q���Ė_�Ω�M�u�B�Q+/��WzZy�Yw�mζ�7R9����*��~�?<w�F|O���>8�F�U�E��
<6�Xif�2g�Vm������x�v�m�6�5k���F䌜��# w�xb=���5��7��e՝up~�P����uȟh��+�������u��fz��YT�A�Tq�OS]
�W
c�N��{���TM`�5�*�r�oS�4#r�h?����/��_a������}Ia����o�KN���Pp'�������=w}��j~���9�o	ߦ��X��i�)�[{�#{�dv9���O�6�ψ��95o
���}7P��e%��������{W�g��P��`����z���3Ŀ�yx{��@�^r	��(��ʝW>���or���e��3���{	{����?���YM�lc�s����#g��&�H[k�؃�5���t�|��K���*Q�5%J��x�X� �>��}��Kam�N?��3��,��p1^�se{4||�y�x�S�)t�7.�O��t�Yv��;�����TXݭuM�(��&2~��W<1wh7\Z=���K)#޻!���g\�q~�>h���:|f����_�-�u*.��H��?ݹ�ʝ�o�%ݧ�˙|S�~��e���{e�ե�Ӄ������E�F֙�' ��G���y�cQ�R{W����~b2k�̰j��4�?�s��\��_���_s�>
�o�w�
�-ƾ���f]������\f�2 ��Z�Rn��N�H�_���}�����|`����O����DW~��i&�a��W�eM���#�Ǻ��f˧�����O�������:|zo�φ:?�k_�/�[���r��?���LW��Ыo)j���3�l��
Ѵq��x��t�����=�7�]/|>����_��p�۷�X���A5_�&ſ�����7���=��hKC���z%�G1\A#<�[�v�<u��_i�Ϳ�V���&xc�j����cM�^���~���� 	��Y�-�R��`P��<�b_����x�/��u����?H�x��]aj{��-%�k�g�QEG�Os�"��*�FApA
I\'�QEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQE[����(����QE
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(�׷�zm�ޣ���a��D��<�8�@Y�وUUPI$�ɠ5�Q�b�h�;��x��k��~O�Z~�6��s�dxsF�1Gk˵e��Jre`R�t���W|{���x��_c��O���m���7����'PL�:"��%>R�P:�idH�c�վ��=�6���?����<+o'�wq!�_π��CO)����ƪ�W���1��H-�%�g�qW����IU{F�y����1���w�S��'��W�4����d���v���Ԫ�!���H�|��xO�t����N�tLT�|#�F���3ڿH�ai�������~��q��#W��g�/�.�tE8�X� `�*���dG�S8�VՈ
�3I� G#6u��k
���ڜp���LƯ�g'l������Ey�ĭkʲ�Ž=���V�
���j�ANi^��7+�xm��ޡy=��o��s#�I�=�+�������ú4�����г�XH6zs��5�2����q�3�C�/�>|<��\�O
�N�S�=	HP���ܭ�Aݘ
�G�	�������?hψ:y����^�Rx��2	��Nr��֣vD���:mu��2��q�-���
��v^�9rH{Tƽ���r�n��^S�7�w�t�#[�}$��(@HcU]���p@
��+۶�\���˥�V�d��F��>�rzz5t�
��rV��+����(����K��
��g"�4]�0_�5�:���^����Vj]���m
o�\�r�lm'�s�Y$Q4��܂B��
q�N9�VP`�Q:q������RQo���;=ʡ��AC�z�~^3ϭ7�Jm�ٙs �y�:��1ȲE"y��x��ʼ���
ʨ?�+h=N:��xB#;a�F��WaF_���M���Uح� ��5��hqBج���`^s銽�I\��R�s�Y9�:U�ޟ���-־{���#�����_�K�c���닸����PDw6��n"'*Â2�
��+B�q�����`�3Z)FQp��}����U�&��Mt?9?b�[�W��c�c�Rx�R񣮟��ڐ�c��z�����K�co�����X��9��f�e��*�y�t5����W��<�5�O�:��\>T��Ya�s�9˞���FA ��������V�	��gx��
>W?�|{�1H�K؏K�Gb�2p��[(���`��{�}U������W�v��ܸ7���"�b4�).�Ϻ�����EW�}�QEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQE
n���(����QE
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��̨��I<s_�o�k�c�V���x���웩�|>��<���+�tD�6�P�.����� �&T���7ҟ�U���G��~��^�Ⱦ(o�Q��l'����?�rdT/�7�,���#BpRO��>|�w���	����{�Tx�
.n�����\\?�琣�*��G��e_{Jq���~��q�G,�ڝ�i�+��f�/3��O�|/��a���V�	�y�K��3N�d��Ė�y�f�iX�wb��[�Ã�ܷ�D@�s�V^8���a�N*Ւ?��9֜�V�4�����m�}kJ,��f��@�kگ����kIj��h�����B�>�*��
��+�L���C6ᠵ�I�%[x���}I���_�C{�jWPNg�i�#Q����W��O������n�\��嶮G�k�x�L�t�[_�/��IЭ漼���#�2H䞁QI?J�2�:9�糬F��O�ۛY�h���`�ܺ�^+�?�E�������~�"��^Wc_���>X�]�Ц���|%�D0�cM��0��?�>�*j?�l�؛��:�@�\���{8����'"�9��?�V�mf�&��鄓9�wcQ�G�'�qӟ��{��+o�k�=
�j�0���y�z��~�N�Ix��X������<��S��`�m:�f�ɜdr*_NqYPK�jٗ���*Z*2�X,;�0�Y6O�Y�9�����rO>������7c���p{S��Vl39Ͻ[Y���Vr�ΈUV)�O�cO�c<�g?6[�Vd����:�aZI�j���kC`=�T-���ִx���)��29�=��D����;A�0s���ΙTD���JЫ
մA�{ ?t��%S9k�@Aq_~؟�g��k����pm+]��7��-���_���$,}=+/�W0��-�Y�$v������W��Ru)T�j/�QwM]����|A��u��G��A����U��MA�<I���7ѱ �p������2�g��_ȿ��/����������E�.�G� �~��@X�X̊36!y0�^�>w.?��أ���c�s~�~�����h�+�èiӐn4�J-՜�.~S�x�$+���5˥��鿇���u?��_>�a�U~��K��'���WQE�FQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQE[����(����QE
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
�����~�Z��2x�∁5ϊ&�h>����ʑP|�
�i��W`��k�
oZ�|7�j�"׵��@�����v0@�I$v<*")f=���W�>.��������^�i?�����xw�w�o����(�֥���";$�Ģ�0I��Bu�F�?�Nޝ����c�ahT�V�`���%�ވ�b_���_�����5�|_�T~ѷ�Y�;���2%��x�.�M�)���oi��XN��gAl��I����,�+��E~���C
F4i����3����]�/��y#`��$UI� �5h�.3�Q�� ���ބgn�ܑ���ݪ��5Vp8�XTT��F�ш�X3Vw�xb+�h�pXV6;�Ec�_�������Y�D���I���?�~@�H<_��%�/ܴ>��<Ek��FC���VW���ذ
�}��'�=V�n�;�z#�o���wo������|_���xoI����T���^�����$�-��R~_�=�e74i-�h����-��yme<l�WT�����r��3�����xٴ����O��/�6����r��;�k�y��穯%�F?^��k��B�#�~���מ=k�+ϕ+%�ї�Z\���VG$�9�U���q��y�b�xj����Q�.S7���A�j����ƹ�n6�q�ZK  ߍD�m
��v����{��@3���1I���D��SJ9O�s�j�n����y��j\��h�`�͞�����Ҩ�<c��sV��#�i�������]��`���LrW��}����NE�z�zR2g���퓞1S��9��6:��I��4�q�)@�|S�q��k��[J7|��:X�#�ⵆ1�x�.[j��rw:j���O��_�_|c����X��[E��?n��գl���<TN�g��!��$�.��[�~ȴ��k��i��ߴ�����g�xs�v�!:�e��O���~���낧�k�4�}f���[??�{��/��e�^�]�U�����(�"$���9ee9��ӫ�[��R���
|w���Z��w�*�������5]�j(O�"�B���@��jk�mvj������]��>��QE
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(������(����QE
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(�K,pG$�H�C
�wc��rI'��h���A�����|(�������Fs$*���I�E0cyO�s��o��o�'����:-6̷Y6�3c̞Rҹ��1���	x��m�۟����uݺ��o�ד�)�C�c
[B�/uq�C���'�n��ҽ2�*�1�n����<T���z/���׉����R�BZAsIy�/̽�P�8��P@����p6:c�Z!��yT?<��C�cmm�ǁLQ�<`t���{���NL�z�����)�zU���KR��j.uF�ET�rkS�h��
����-�
��'�3ֺ9�~�����|��4����m˓�8T��Új=�l��%.�R��͙��_�=k��ػ�+/��
�#x����zW�-�H]����
	���k'�FBr@�k��%�Sk>!|R���������|(g�'��)��8�_A���÷4����)�^8L]N��������
�����w]��fu푅�+��|/l��xa����dKl������k���9sM����W����c�����N��IS��z����9�X�L��U�+�>��\����`��8��L����-�)9���� �M�r?
B
�=*�f�Yy��WݎG�Ҩ�T[U�&q�VRZ���~�v��Q�����R]�N�p}ja66�Oz�,�J��J����җ-�=�[�w�8����9�Gx��3޵ ����cjX�N�X��!p�V`���}i����g�F���	�=��x�>���\��z֌.0s�gs@����E`r:�� g�
8��.u;3����Ɵ����*/�=2k�U���_��U�ڞ��&����V9��K#5�M�/�>���x����Z���i���e�ts��F��"�GFW嗎����K��n�����caq�j6�r�[ܣG"���ǚ�;���ğ<I�	]�Y��ƿ�����ë���k�+�"���hҫmue(8����5Z;K_�?����Ҝ��z�U����?�J(��x�Т�(��(��(��(��(��(��(��(��(��(��(��(��(��(��(���(����QE
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
�������������	I$~>����@1H�z�h�Ej'�1����_��≼G��8�f�"��\���n�XxQ�ն�Q�����8����Rpr�c���&u�I:��:���m�?�����	| ���d�O��m~𜤺��N�.��� <�����}���
��M>d�i2�V,I�rMv�uE~�
Q�Na�U��
���q1U~)����-�1ő��=i�G�I�U܎J�b
�?J��T�F���U�#��Ҫ̧<���Vm��,	�v���p8P})�s��0�3�*	�ۜt�rV	\e�zW�|l���t�&X��6tc����Ԃsۀk�$��<�J��3B�6�o2��ɴ��(�a�N�v��O5����B�g�|y�G/�$��o�Ys��-�`��3^/��Э��B���?&�g5�������W�Չ {��k0�?�G�	x��h��`�ŭ%�Z��vi��~���:z(T�� S����OVc^�*W����\��0P�_/�U���G��H� �QơUGE�?
Ƽq��V���:��r��Ȃ=��(H��� �֘ܓ�Jr��]�u�-	�T��F���;�JF9'"�f��\�ȩ��?Ω3�r=(I
�⫓BUC^Jg�Ҭy�ׁ޳�q�jl��+6��2�v�'�8➲�͐=j�O��*���I�����MgI!�9��$	��Z3���Ue6��$�簭X.1��5��G �V�89✕�6��r�#�?��Y���d�8#cps�Kr�Kk<p�J�v��Oưq��Smh;�j�7��z{WI���u�_pS�=3_$j~:k{�"b>C�=�]���ZM�Ak>�:��P��37��*���9�٤EϦ��Q�L9�x��ϵX�����!�r��~;�K�|����Si/�&߲Ljm��v��×�yS�)�cV��9��p�"�cXu�Z�o���
<}��0������h���#���,?�L�S؀k��U�Γ뷓�L���	�14�1�/_5�|����Ǟ���/�K�V����� iV�Ηt�%���f��ؔq��
v5����^���b_�W�|h��|Au�ɠ���h��)��;�i"��q��
���U��@�&���z�G�QE�QEQEQEQEQEQEQEQEQEQEQEQEQEQE[����(����QE
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
�M�kr/���_��6�rj���>Mv�;k��"6��k��<�8����H?b�����w��Q�j-Z�5�>"��4��v�e�M�d���#�W����:jx�G�v��G�q�wOR^M|��M���PaGp���Ԫ|�sQڡ���t�N:��s��}*vZ��qH�n�@4#��sJFF�T�ٲ�BŲ4J��zԛ�8�8m@3�QC�W���Ì��f
�5�w�zUAjMw������J�%ZAw��W"ky��>b���s�W�M'Ҽ������2��DH\����w�׾�x����#���t��������b�~���<�E�0��>t���b��>�K�|+�H�y;e�\t�a�y_���l�a��@��I��_��0)�u���ql�g8���З����*�N��yS_���F��[:��3�y�VQ�
�g��M������Fk
e�Z�s�z�09'��Q�S���]2��ԟ�rF2*`��Ơ�0��B荤��x�<�rF8�4F"�'5�0�a��S$�c'�I���F*�ٚ%%�q[�z���FG�gǟ��
O����l�'t
�Ҫ0�@���8�}*)b��L�#6B�|��J��x�g���Ef��Fzw5�cuvrԖ��2	��]N�+��B;Jٷ�����ՕHR�s㟍��𮸷��į\/$C9epA�q�}}���wmy����FS��=1_M�}Ӡ�|3�\:qkw���ۆ=ʏʾN�퍵�m���`j{J+�s��*N�%����MRMc@�9�&������#5ө�+^7�{Y��,�ݍ��n!��S��~U�k۞+�qT�f�v�=8�Ȑ�ɪSŹH����3Pȸ�O�]s�fv�7?'��[�.���~�����X|3����o��;!�H>�,���i���X\�k����{��
o_���]�?4��|*ִ���Z),�14�A6��%�8��H?����_�?�|^��'��o���w(r^��3�
��#������.}��}�?���v5V˩��ۃ�j���
(���邊(��(��(��(��(��(��(��(��(��(��(��(��(��(�ks���(����QE
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(�� ���������m�m#ie��Q,I<�5�����֭��ߍ'_2/�?�E��9�Y��?���W�_x�?�����)�/��!�Mv�)dU�+�,���h�|����xK�	����+��^k2�bo�n%Rz�2���}E�S}��4|/���B=e5�&��~��DŽ�Z���E6$�Q׽=�Fs_n��a�H���9��Old�'?��Ul�>�����f[g�	�JB��Y��'&�%�9�v��&NҒ;@���q��O=@��9�W��M�9���}k�>%�?c��|ӫD���;�W��C�?�s>6��×'�-���x>����=D��M��|���躗��c/�#I�؛��>��TY,�����7ҽ/�񅯉?g��{UӔ�Z�xgF�`�^c�E�Fï8�`�����?��eᛛT���:U�G ʰ���;���_�$��ou��Vq�9�>kZ��������U�b�����k�k��8��O+��*�������l��ZØg98��sU:����ɧLH��
�dd{U�-�q#��4��g[��h���p��G�����?ZЂ
���5s��:Vdkj1���k�$t5�#;G��e@r1���Sf���>�3�qW!�.>\*��o V�1���ڹL��ʂ�H)�Z�8'�kqc�(?QPH��VJ�����
�w�gx�SS�.c5?2�y�/��F�+�_z�b��0)�B�r*�M��<��R�tӅ�K�P��9���1��&Q�7q\��`1�'�)���F*���5n9��Te�@ �5w�'���;|s�ɭxv����[�̪z���=��|����s�������Z\�\�&��ץx�b��œ�+�	U�.':��ԏN�)�
Z�Q�3���ç��}���Z������j	��l��g���99�\�^m�Y��EG�d}�y9�?L�"��CJ��j�a�x������g�?��c���HHÄ
%�E,x;/'����#���	��gLԮ�֫�P�)p�F,�%�Ϧ�y�U�
�9��lnն����L`÷�|����m����mfΉ�|wׅ�J��%W����|���(˺k�g�M{<T;8��~��
EW͟�Q@Q@Q@Q@Q@Q@Q@Q@Q@Q@Q@Q@Q@Q@����(����QE
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��?)��^-���������4�-
�j������
x�����>xM�ȳ�t�=���m�V���e��T����a���m����_�B�	�=��.�]���z�����	�^���X鶰�?�H���/Nӫ?%���j�55�O��J�<
G\OCڬ"t�)YH�k�����\���Q���	�ۃު��y��V����"��\���T��
�p3T�'��۽Q���D���2����L�H��N�`GD����A�Ku(�
� �Q)N	����4��N(���>+yu��HH��r?W��d߇߳F��
|97��5�߈���a0�{����@���Rz���k�&�3yRc�Aǯ5�M�i�Z�:�k��"7������elҝ8?vV��m��p~Ӯ�n.��[!6��ߑۦq^��s�Z0�Egm�\�c<��������5���ɱC���$.1VR08&�B��դ`���{�rz�HG�hϯ�6>~3�W�@@U�zϔ�稥�Wȧ���ޯA�O��#�8+F��V�f4�41��1�*��2z���;��3�j��=��1�잩�7jNqީua���%\����E�OZ�ڞ|�]���ݚ������GN���JJ��ڳ�4��؞F
zļ98�Wbg�;�]������m�sw�b9"�f?w�ە9`�#�V�wz+�3˔u%��B�g�xn����ۻ����j�	±�[�i��z�ƥKltR���xkF�FY[�K�v�v�s]�dO��\�'��w�X%�+��mݞ��I-��<{��2j�m�:�U�ǧ_ֹ$�z�wF}�|���k��!�����H���xC@�Z�@�~15żEv���s�8ˡLg����3����_�E��3�f�Z�L|��M4�u$^�pډ ���/~y�_7�å�3�<��W����(��?R
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(������(����QE
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��?��9:	��>�W}���%xr���0���ƾ����]iZmջ	-�m�7^�]Az�j��L���	��p?姊t �"�k഍/�O�r�>o������_[Ú)��~r?-��gM�r_�,�	���#9�F88��'Wџr	['�*��%�Z�#��2pr3[Gc�z�>aU���;V�E���A����0�2�C��� sڮ��ǥV��c��H�r�F� �wR1�ҧ����zmcSv�Hz�X�R޵X9�N�P�prx66u4+Nq�;s��|�j���9�=}�Qf�9��mpV�<ӖS���I�>�JBS��95�W9���dn{Z��wݪrq��|w���#��j���Lc��֌��g����H�ҋ碊��mIjZ����j��UiC%�Y�\���oLpG_J:v��F>r{б��ms����F��:洶coJ� ��R��䶥C�~*��O�[�����d<�ֶ�LjL�*�9�9�1��5+e���N�}��"�p;�,
��mھW����")S�OZӵ8p:�Y��m���[�\cqYe��
��
�<�3W;c&��8�ւ�f��ʼ���ֶ%zs�\���ў�{���v�Ͽ�$��i?�T��*��|��t
F�,��o ��������"�@n�
���	�4�ൟ�r��h��e��*�߿N
��������<qM�y~R>����Տ�;�TO�B�(��?Y
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(������(����QE
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��?���O��x��	o�A]%ȃ����H$��{`c�Ry�����׉?f�����,7�ǂtI�U�k3�ƾ������?�Lo�OOg1�^	����x��LX5����x|[�~�:�141��}*V���^�H�"����7Rq�_����Ɲ)��w����2�94��r)��rq�4�G��������9��֭��T����>��L��c>8�
G���%��9$u�!:b��<�}���U��T���U%����4e'q���w����JZ�Ʉ����'q��<у��P�<6x�B{\��O&� ���N��#ҕ}@�}ks���O/�;��p�S����dn'9���FH��sJ3*�=49�!+�P�rrkF���+��戯�x�WBw8\Zf���cZ�>�_C�X�����Z���dVSGU&Ѣ[`v	;F2;��UX�-�8Zخf������ޘc+�d�U�@*~��H)\�L� ��Ҩʀ�9�ѧ�mS�,:��Ufe8����89沘�ߚ�.#;Xc��+��z���*�Q"��&���m�OZK5+UJ�4�7��)�C(�.F:Ո���QXq�?���9�C�~�܈!
J��Ƙ�Φ�v��$�g�T9#X�4�s�kYT����;t�����+�l�(�B��ʷ�����c��4�}3��м:�RM2Y1`
�{������ֿ>���s�?�����V����	:�����w��k�ߣ>������R?�(��8�d(��(��(��(��(��(��(��(��(��(��(��(��(��(���?���(����QE
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��>&�����j_�O�s��E��U��n�~���H��2ݺ�ҿ�Z������M%��{i~���@}HP���)-��?��
��m�)��td�ZLr����z��z�R��?�ze����t���"sk�9
�:����<;M5�K�q?5㪩Ŧ�p�UC�,ps���=	5
�Z}�n���e�$,��z
�xZĨ�o.���7����k��NR�Q�ĪB*���7<�"�:�z׍j_
��	c�$��G�ұ��u?^+��4��nu����X�d�r}�����y��j�G��O�E*�Q�5��Ə�w��r�.G���<|q�jDѳZ���W#��ps�+��.���K=��[�YM�a�j�)!p3�_%�|f�]ضSx�mnX����#��==�&�⏊n'��u�b(R��(Ǣ��#�Zʪ=�0�}E^�>ȏ�U�j�!a��_E�'�Ir.��pҩ�e~�~�+n����J7���X�qn�����SyMN�
9�j��Y����UvNp�_���7�I5޵q3?.@���tz�?ZB���fH�mQ*���$��R�f��}I�Y�XHV0�V��?`�#�*2�p�w}9�𯓵?��3�]�����
>�>Z�����wQnr�X����+He�kW��L�wQ��F9��2�A��t��H]����2x�<
��_�r�VZ�Պ3�
�+(,3�p�z�u��)��q�;g,s����9$���\M[�_S��,�U[�Y��m�r~�5\�Y�΍�!��WI��|�s��0C)꽽�Yw�Wj�C���$g=r{涎N�����i���?�ы-�b����;�d����G^:ֆ��"0N9����_��N��iRM��}5��O*O%�\��A�k�MwW�H������P�dr��2N+:�COIhkG�!ma����x�R)h]ePJ���ێ��~VS_E�=r��h��9�b�;�7*# J��ľ!��y,�{�I%»G#�t�8���7����QV��. ��&G�.�e�L���d�Z��ӼO�Y�k�_�5U�Jgc�f�V���=k�c���i 0�Z�'ݖ4;��ۙ���Vu�z�k����q%)'��낪�Ê�"�p+�Y�4x�!���#��#�'=�b��[�����n�Z���,�b��F0t����l�F}A-g�7hq<c���'h�o�b�%O����R�G~�\����i�x������@~5��K����b��5��J����#l��k�_�Mo"���Ap;����>��ڶ��&�g�G;�;��g�U6�c�{�O��A�:ԩ1�(S_��Őۭ���q��v�����Z�o�j@�]����{cw�3�޲�S>�:�>�Ǣ�*d�����B/x�Fyn4�^{Yf]�d��s��Ҳ-�u��kTծE��b�V�9��Y<�R�SZ8��Ud�#yC�2}����c��/�qq�̙�
r2I�����7��i鐳e�ܓ��י�º{����[ecZ�85���O���?�V���w��Zo���+4�F�JCgg���xq_9��@������p幹��ƒX\�j�x�U�dc�=0�i��_!��tכv���g4�����ҕQ_ ~�QEQEQEQEQEQEQEQEQEQEQEQEQEQE[����(����QE
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��>'��_�~ٟ?b�3�x���m6�Z�}1bk]������fky����PS�[�E���)֡��	~���<'��'�}�n,����i?��l�c��?�
J�W������3�>�L���-2�<k�s^G}4��9�6��s��|:���?���|#.�a�	��x�㟇|,��{7�|;h���J��gb�戉�9&��!t�+M]���-ym���~?�n�2u)a鶓��􏺦����w�~��7�0rB����ޱ;��ɯ�	��_ī��5�[�2��8k˙5;��1��l}1���Q��Ѧ���
�xv���k�-+���02IlKx!�Z�Ǜ��P����#�����ܟ�K���yAV0�5�s���J��������.	�S����C�aP6�����́�kn�	E�LLO��I���������N=�7�ԋ���f��	�����3�#�K�v
T'V8�s7̻���^��_�E�<`�?h۟��(?�����>4'�y�_�{sT�-�,O2K7�ω� ������mON�}1ZÈ+���|���rU��X�|��\_�}��>`	��p
]��.��C_8�!��,��R�`�\�<0�Q��E��I9���CЄ�"��0?�ߩ���V����W����ǂ�lg�͟Wǡ��n��4�M�a6C�$�_.�"���F������ݾ�g�7���Z2I��(ů޳n?k��T.{n�\E�z�q
w��?�	.
�%�1���}=�����2�8�����^~�v�c��
q�����~l�o�����Y��*$a�7�0!��=���5���[������d���3��O��4��S����x����|�����h�V�^�l)]M|ۧ�a�F���s|]������,�s������M�S����<C�]{↤�C��f�R�Nwm�ka�� �l�4��S~��e�I��co�b��?�)/��]W������e������0�B������\=���7/g}�Ch��kU��A�x�u?�5�-c�������M�s$c�֭3�q�i$v$��>��i��G�u�C
���.��uڠ�r�夅َ{�On���q�KA�O�D�ʢ�z��_�?2��(/�7*������幏��#��۫�����'��H�b��o�7~�v������nB�ߊՋ�_��
���zcE����e���$D�l�d��Q��O������-��ߴ����N6Y���BO�E���
O�)��a�A�x�]�ģ�h��;/�<u����~
[����߄��^��d�>� ��z����E��[��6����T�2����ۯ��.�O��UNo�ߊ������)��ғ=�~��3�E���A��X?��5�x+�0�����#�Q��]�d����`�I||޸�ڢ�
 F/��y�8����{�_(��f��t÷�7�$<��G���_�&��"��z�*!�2�_���Ÿ�&���Rp>x��5�\�Y\	|�Tq7�$���5��Љ]�K0Q����߮?J�U�=��Ύ	;,$�)��G����Hw�����ە6�+x��2��f�k��(�����;��\�\�I�\�m-1
�]�^=���{ձ��P��	X*d�#$�=sB�b#�w���o���¯���r�
C��-u�~ȟ�4�~ig��ި�7}��z�'�3�|�[���kfQ�$�	�����&�Cj�Go.��1�}|w�Y��`E��P�*�3Ҳ��~���u�?�����*g���o�D<y�X�9�D��m�̐�4�Ke����]5���2<�:խ�>�>�x}q��_��۹��wK6Ё���1Ӂ��{��N�]�?J��\�il�b~��Mj��俉�n��H�/)mތץE��3��
��� ��&��Q�ݜ}~O�Ks�Y�%�Nm�|���~�Α���};?�_��|6�i�{|8�$�Ķ��W��[i�����鶐�U��Dh�8*��
ᫍǷ�X�H�������+J~��(�6����-�6�����uu!�u#i�|l1���3�eLV\^&����*�?c_	F|�W����{���&i~�g�NjT'#$�5
�!�u�.T����xL]�aao�s����?�����O������MʙuQ�9�F+ܴ���s��&բ���K	c�F��I%�o�S�O��=��۰y��&�s��pU�Χ�Zo�I�J������g�f��e��W>躌_?�v_a���v��K�tʡ�+A_���6�z��3�
O��˿�o�������<i���{�X�k�\�Զ��ͬ����nI�p�_��*v��u���h_����
��<5�ᶙ��9T�]ŋ�s��.Sl�0�G���d+�*��ne��[����cG')a�������^���5�ĺF��j�����—6w�R���� ����I�ʲ��Z�������_����k�	����>$�A��b?��
_Wɚ;9dh�#�#���̷yT��M��4�e�m?T~�J�jB!��kѫ�QH���(��(��(��(��(��(��(��(��(��(��(��(��(���(����QE
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
�+?h�٫����
��b�u�?B�+�hzJh���q�wh�2� nrz��_���+_�G��Z�����M69H�m���4A��b@}v��2�<j��S��oo�>��0�n"�)Y��[�$�P�!�����nt/�ZG�58ر�<L�p����.1����[�'Lд�]#D���M&�B�iiCc�c�*(�
��X��5�Cc���u0��◢��Z��7'���X�W;T'9�隟 ��+߾jPs�zW!��a<���J������Q�U�8��8�9�A)rG9⨻�c�<�K��͒\G&���*�-����Gz�y��
����N2�s����q�z�gMrs�zUif�EP{��Pj�L�]�X�m��Щ�9؆�O�h-��Êrv&1rlp}+O��;T�C�{g��=�h�O�c)�er��Tz��Y���U����i�������z���OCRF�Р���
ZUP��Nd(��:�tS�S�;�����i	�ֳ4J�ŵ`8'��F��z��l��I�Q��O4�{���s�OS�U��*Ā�zu��7�[�mY��"�>���A9ϵ8)l�Jk��u�ѳ]��t�T��<VC�~�kN�����8;r3ڷ��"`�ɫ��'9<�)m���G-�[m�%cf�S�5�������U��޵��#��s�Gmo �����q�P��<*ꑻ'�W3=H=	���q�q�FN@�Ӂ��qYX�%Y�s�}k��"�\ǥz��q�ҖG	���}k�-Q����π�î�����+�5ܓ�x�yx'bJYܾ��ȇ' ��'Pq�oj�����S�����P�ڇI��o	�*��>�r{�26�
���&k�tJ�MG��V*�=z�]d�3�?*��xzM��]�.�EV'pQEQEQEQEQEQEQEQEQEQEQEQEQE
n���(����QE
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
�E?gTm�
q�o𖣛}[P񵖱,ykk�/eW_U�q>��]u���F�W�g�
	���x��fPp#i�Տb\{�l��E���3�x�<�N&>K�g�F��Pq�q�Wam(ہ��B��x�V�r�=~�Y]�	;#�I9��ޥ
��w �����v�k�ñ�B�/d�Vc�g��H��U%�� ��1�S��9ߜ�95�,�	�Ջ��Z�$s�O���*Ϡ�~n7�	ۊ�$�r1UV$`�޶P9�[�bxp�����隌#@�[hB�䚦�^�4m!$�
o‹�8�^*��_.:c�V������S��Lv�=�]@��LH�+��(+�
��ҭK"��c���6����iR��,0¥ݘ�^I$�I5�3�k��0��z����o��h?��e���-��o��L�I�’��5�zԨǚ��W�Ņ�_7=7&�t�{/���	����֠�t�>��/m�/���ܒ7��Ś���YZ��N��(�D�2H�TĄw����+��<>�S��_>
j*�V�)���p<��y
��8�0�0Np>{	�N!�G[{=�+���:��S�4��ޱ{|��S���J�(/��:*����c��2����S�S�a�=cH���=W0�:�}q�kퟃ�������K�����\���[Ă��
��R{e0{f��x�<��Q?F���k�qt��Q�W�Z�l}<y��/@T�22dQ�\*�a��t$q:��8�8��\�P�er9
صO0����Jn��|�rF�Tc��e=I ��Ȅ�'��W�"W�H��u:z�����J�mA �t�k� �W�i#�/����	S�3Vrx�R�ev=}�r;@8n+[ߥ'T���#�����c�U����a�N*T��nN0	�u2�)X���Te��EQ�3��U�°�d�B���9a�*N���	<��ev���;)Xl�G@G9�8�ƹc���$�n���s��+�*G4�I<������-�g������x������/���<z�xn[Y:���;_���O��S������)�f���{���{����CN[[������H�X�B�yp%����{�z��/�&��U��Oo���V�xJ��a_;R�^��i.��Ě���'�~Us�^����
(�����(��(��(��(��(��(��(��(��(��(��(��(��(���(����QE
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
�Q�j`|=������߂P������� ��k�8��濙O�(Dž�#����>"[�*X|W�a�xrY�t�yp��	sҽ�V�Q�_��qT9��J�����#�k�ǿ�f8�pqZN��6�_��Z�δ��9S�ڮC!���*�H�:��$Y,�8�D�Sh^�4|�~oJ�=�^إ'
�Vt���(�Q՛H�=�cڲ%���>�q��#�����J�O:�� pxl�ڎ01�0a�=*ʡb�qT֤GmP��s[���횡�B���(H�Ӛ¤��<
h*�=*��A��24\A�E4��8�s������z��_�;�3�������_�cºH�s���yN#�����m^����8o����U�|3��ī������.�j�/uK�>X`8 �)c^NIUo�f������_�����&X�<�G�T���nR��NU��ԣs���Q�R���������Op\;����5Y|0���w���9��!����#�~ϟ���X�����>!���a�!���m[�P���>d��s�ߙk�#���C�d�������xwK�3�k%�̽湹p�O3w3q�@�2YĪ�…P���:`Tom��$���g<E��luv�ޔӴW��7�Ihw�
�.40TRky5����[��:d��	������dչ!�X�Y�ha�Df%W��:/�Z�m�d�[q�����*�[,y�^-���|B���xO�_is,�S�,�K���^Y�rO5�O��"�����&�?�/�W:��&�]˥BX���Z�8�f0>l�늢������.��0���lL�.�r_�����B�ykQ���OO��k�Q�����Ǐ����
��/�9�CEF�G�ψs����U�� �q�i�`rC��o���T��������P���>i."����iS���DI#}�!10��>k�-��}k��#�b��P�D�/��M;�����JR�ј`���e'���_�p�W9�$��/�R��k�d�4�g�U�.Q���z5:5�ϯ����MX��b��������5��`���FRU��A�+��ϙA�㯄_�W�UO�S�h�'��!���ɬxj�f��6 "�����2FH�������π<9�3��m�s�۬��Ds[�v�p�Z���e��ᕙY���/�\���q��/}�O�~�֖?����|ˇ��27�����^g��
�
�h�	��ե�c4H2s��}R����49�a�}��u�� ��8�f����V6;�|V�8�;2��/�/��<m4�	'�( c�j�X���AlS� ���Z��O5 P1�3I���@"���F1��S�;`J3�z�9*cH�*N1Q��cwӊ���c�MӷZ9�K�JU�Nz�~@�hu7���|S��/>�}��:6�k��n�����|��W�4�$�H�~>�V����~
��n��B��$fx�m������x�9��*��*�ٯ�C���:��a�-������3�/��_
��-��<�;I���--��h<�.�^�@Q_�$~��QE(��(��(��(��(��(��(��(��(��(��(��(��(���?���(����QE
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
�@����v�����r�MK�.|5�p	���<�H�h�˚�����-�Y|-���{��7���#����ф��������h)akE���&zm�G�5q�mbG�Y�����I e)��&�?�)�u��c��7s�j��q�RF�|�|���]��4���͗�'��s>rGt�,۾_^�Ahe^W3�P��Uf�����8��<���1ΗS5!y��� �
>o��NH�<.	��K~3���v4�J�֌z�Mo�n��C�hƄ�/5�R��P���)�z�<}�xž$񯋵X�O
�N�}KQ���!��F�W=>�)8�zW��B�<����?|K�������7��j��2�%'����b��ޢLb���3�
WSh+����e�\���XZ{ͥ����M����Q_�CƟ�S�#I�U�a�Zm#�#�[�Gf�_<
��	
��仜�i���4�IϹ��?e��>���|9�#�V��ipX��v�������1�ld�y$䟣�8�O��~*�j��c[0�>e'�ߤzi��p�G�Kr�j��z�a����1��EH�53w�jz���+޼�mI��`��d�)
�9�W���犯.�����V)T��)��1��>��~��X�7�F��� |��5���>����Y�sj7�NG�2^���;��Mo$ۆoЏ�*��O��~�_���d���l_'���b�X[Hb���r��F��0� �E~���?�M����<�ȼ[�O�6i�|g�/�5Vv����ڴ��m��.�s�'�����U��zm�z_���K�ߡ�i��ԅ�������o��^o�W�U���>5x{]��<A�!j�a7�#:���{n�o�X�Ku�3w��o�A�_���^6�{�?���P�����%ʹ�Nd��RT��3�<
}{��{��_�o��G�x���#"�|Z��LQ��-��4{XA�6��[o�"��1�o����w����#~6���}o�N�KAym��`Ei�˲"gex�����ԯ�V��WP��o�m�[�m���x{���ƞ2���yۯ��Aic}ޟ�XC��Z�/mukr�,SC *�Ȏ
�:��� �j>(�g�+�
C�xL���s�������b�F���*��K$s!��H�DX��`.w�T�e�Gc�
~Q��h�g��h��v�"�ş�?���>�n��=��;�_A_�x!ǵ�<��j5d�.�z'�o�l���N�m�ե%y�6��7����#!�{�G�^���k��&'�|�����[�3W�����f��A/�����-������ī0��<�e u���d�QN�����z��I����⬣�;�k���֜�z�:VSu'����p�.#�0;
�|��UN�4�i�˟Ƙ��Լ�n·J�O*���#�z��1�Z�G�p�.1��)GןZ8��n�8�z���5ry�y�J8'��B�r2�S��SqhQ������_�����	��l]_G��[h	��l~�+H�Xد�Z�m�9Gl�W���>!��bo
���O�E�X�ѿH�x�$=\�������K���{�&��җEw�5������+�O�Š(��(��(��(��(��(��(��(��(��(��(��(��(��(�ks���(����QE
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
��������{�	W�N܋���:����
���Q�u�Z�>���_���Ės��g`/
3��I�s�;�v
t.�:��=k�.�6"�̿4x�C[���ߒV��Y������sҵKdt���=���z��uc���:���%#����ҭ��z����@��cc{"�������U0K�=�쑱=&���8�ms�Qw�X �=�uPs�H0�o4�ڹ#�(�r[rX���8�n[(�X>㓌�[��0eP�ôٮ�q��[�p@�G��g9�g��#ָj>���R嶂Čc$��Gů����~ɟZ�4/�s�W|Am ";i�$�BR�p��ɒ:8�@O놢vAp��c8���W��cs�+�
��[��qq�4	�5��l�|��ȑ�eG�@o`:��1f�	��tp���t�5�W?U�w*�':�9o�oW�d��~�Z�"9?�x���J|��~j~9��?x3O�m�m�5��Ā�����y�+�0,�T=������A~�?�k/�*��
�'��J�.���.<W���y�6��JTvҬ��C*�V5�|p�
�G��r�)��v�E~���S3�8�
�n˶�_�8K/��
I�a���3�8�����>ϧ���t��̧�^b�2Ď�rKtrO�6��A�{n$��O�w�u��'ʋJFE�a�8�M~�F��$��%
�����G��oF���^q�7+�	/#�`�udߓ������ߵ������Ɵ�'��~�?��<qk�-��:�����/�TT�d��2H
"d���A�����������>񅸞�����2���),O�F^���n��jZ.����h�ͼ��v�(%�xfR�G"0*��He#+�ك�	�<���&|A�
�	���([��φ�Ԟ�F��'�����z� (i$��|��H�|���a��5N�ە{�^j��]֏k�էQ%.h����(~ٿ'�C��s}
C�>��(�R~V����'�zr��ֿ�/j#�<�
W��Bk�-�4���.�C�no#��X�$�*��5�3�?��~#�v�S���n&���e�z/�+��C��F�Z����(�I�����K�
��?��>���i�����x/�3&�smz�l�[���l���i�%U;KKx3ĸ|^QO
��JK��/����ֶ?'�ܦ�d�o	꟯O��c���"���~�_������%�a��j���-��Xt�t)b�ݼ0�1:�/!N]�obr���_�q��kg��Ӵ'��^��/���a.`�E����-��������_��û
K�*��<���W7ZՄ�X��f���{
�t<w�3��Z����
G���s~�"MI�WW���v��>^V��y��x�?�e�*���^�����<�-���Ӆ:v��n����w��o��v�rچ�cao
���,q������~��<)��������Ƒ�)�˸ۣCuE �U�zN���'�Ue�y������I�o�����|�=�����\��~
�\5����ׇ�^p��Fp@2����_���t�����)I�o��c�F�r3�Csϭ~��n�>���p�WS/�ԗX����*y�&�zI������T�8�h��.3T�0��5�Cc檱�fOAH�*��iI�G��c��<}j�i=	�L�]���Ҩ���V��I��-�QU��77$Ә�s�Le�:��H��nc���q��Gj���$���V��ө�-�=.7s���ٞ�
s��
݈[�������|��Kt\z1Y��c_��
s�����x�5�8��w�_h���DRm��؃׹���j]��ϯ�\��G�n��=�E���EPEPEPEPEPEPEPEPEPEPEPEPEPEP5����(����QE
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
�a৞
������>�n�m�׾k�{�[���>��OU���P����
���؝?��0�� �E���9��]�_��/�G�G���g�_�%����}6A�䌁]M��Ҹk	D#�W]lK�f�V���fw���s�¦(O���^$�rj�$�+���53Z����h��OZG��K��K��$xs�YRgv;V���X���n��ňDH��z���QW�F9�kb�EM�����D�t���pG�w����`dzW
X��9hAv��L��ڿ2?a��I�૟
��.��A>A��C<�/��A��Ɋ�C�ֿ~!�?�q�������Ӥ���(V4ԭ���r�t��l���~I�~W<O
⽞�J��?[�[3��9�=>j��g�#
8�sV�228�00dG�UkI8��΃N	��Z�|�r>^��W�==	���?l�^����_�#���<A%Ž�����K$֯�M	*�t���]�B��S�_Cy�k�Cڵ���*���uk���Ŧi����P���u"�Y@9?����d9#'�N/��a�<�k�����_��?����?�/�n��I
�^�i��,Cj}�����Q#�}�
��-��M-��N�&Te�hM�]�i��s�ι*F������	��^�Xo�ڇ�
�n[]WY��؞>�k4{�tbA�
~��=�q�O���|���o���!K-/I�-��rvƀ�9f9f<�&�_����>�ƾ�������j�cg�.��JD6�����v%Q�죚������_���S�p\����R��g�O�F�Ş��	�V���i���wp�-���QNU��yR�2�(�Rr�8kyI�O��ݎI��a�*Q�R�d�t?}�z�y�8!�?�_x�zW�X�3�^)�(�M�u�\?a�O3�x��k�ԯM�;��~���� .��n�s��:�8�W��2/9�~'���[����O�;PO��|s�Ʊ�9\�XH�K�E)�"�im�_-y��W��´%O+�F{�F�q�oq~&53�c�ӞK���.�$���AT��9|գ���5ZNy�����NF@�֢�rpy(�|��h�I\��9�jҌ�֪)��/n�T�jD�2Tq��L+���Fv�SYs���R�����#	�n'0�)��ȧ�V���"���a�2k�g��ws�o�(��� �N> Ӵ�_��{��?�FN+�v��a������k��G�_��}g�%�7W�˺ �“����^J���[�>ρ �&����w���Q_~�QEQEQEQEQEQEQEQEQEQEQEQEQEQE[����(����QE
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
�l�z!�W�w�Kۣ�o�_Y�'
yQu}se>��q�5�'W�Q�P�}���4�$�D���b�pI�I)�lק��<]��~�9��q�1-+�t�O�l# F1��u��x�͚����Q����2G=k�
�s��	�ž8�U�1�򪑟��
O��ۊ�=�����G#��!y�<U)[j�>�o�X'+hU�|LV<����\>r��e�׆��<ڲ�������(I�r
QDcׯNkBm�r��)#j��dZ(A#�fCʑ�ִ���4z�+�3�k�S�
��>����⋯�/�;��}ᧆ2nZ�HWyb����ZWE�t����Y9�t�H� �!�9��c�pzj���ቡSQi$���1��bib��������c/�KA���f���tIW�����#6ڝ��`aإ¹\�B��}I,�n��gw�=����l�����e�4��G������G'��u���\i31��%n����f$@30�7���S_�p�l�2����m��/o�g��E�w9����c(�II+���_�e��ο�]��||�з����F�u[=z0jM�|����eh��uvG�Q�d�)��G��w�w�|e�j��P�!�1i��<r��=����V�(,��x��{��)'�_���_��N�f��Xּ���Q�%u�V��s��������ɍ}ͥ~�_	?i/����Ǐٯ�z��s������ZE��$wPn� �r��>7F�9�߸g��^�V�3���$����o�mu���m��嘮Zr��.�U�^N��y�¿�-��h �Gʼn~x���H���ʃ�W�4����g�TWђ��K���Q�O��0Y�w���������'��w�I��9��`�]�|I����٭�yr�B�'ϕn������)��k�9�GQ��~�'�?�x_���*�I��M�[f���dwA���B}�+󬻂rIc*��k4�$���[�ݿN���S��ۂ�:9U�bi�P���w��e������S���-xR����f��O��S����~�t��qn�������8YF\��o��o�+����������پ����,c�Qt��)X)�^X�(��~��;�����W~h����fM�5���.!DGbrk�3������S��� ������Ox>'�e��cKԁM�$��{h.Â��޽^Ἳ��4p���rs����I����W�P�d����9M=�n�oI9%d�U�n�?D>
�)�f�^.������%�������kg�n5��}���ڡ�[�j�R� ���"�۸f���vz��1������Ŭ�7k
�O��V��<k�邶��q�)=E|�����Dm�T��>�Z/��jp�1���F�[;�m�������U�q����[�7|�w���7�X6�ះ�TV��̑��$�����#4�Չ���G�(R¬��3z��R���s�˪N��UN�/՞���c�������s�
��<y��Je���C��4X��mP2ݴkԔ�.@�N�g������	�ngK[h�w!UG�'��Z��g�!���]k�[��?��F-"4̖מ%��fW?�ܤ����A$�{�	Tγ�>+܋R��Z��o��ǼSK'�+�j?{����������~/����/�c7>�-�/1�{�_2�j�� ��_\���t�\
�����$��$�Z�������g��s��l{�qR�a앾�⣈�J��7��o��t���1��0s��*�\*c�\�>Q���\����9�5��m8�}M]���,sY��3:���
�SF��+Q���{S�q�qZ����*Y��� �����d*9&�3���Yr3w!��-D��y�T�ơpW��G֮Ȅه}.�#oF��_�n����|�}j��y�j5�M��_�X��)�Ҿ�Բ�_�q_'����?nx��aO�z��������w�k��hQ]����5lK}6D�QE|q��QEQEQEQEQEQEQEQEQEQEQEQEQEQE
n���(����QE
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
�Z>6�O��y~=�1%4?�ZD{#\Z�
�5R�����0^i��_��;1�x��F�u-��>�xP~����تO�����|����薔D9��s]M�ь�J�|^[�ӎ��[��W}+��w�w�M4m#m�ՠ��3X�9s����3��5��sҧP���J8�
��2�y�Jk�
�2{�W.T�G:�ą犞+Rpq�h�W#����ƣ��8�s��.�Q��:����h�Ej(��{�$U*x�V\�:��H��9��u���p0��۹�89�J㋱x6;��R�s׊`�������Tz�奏��o�ÿ�7��[��k�:]�z���ݧv�����rP��Rb�)���2ʵ��O/�(g��I�I�a��N�~~�aKk+��k�X���S����]�a�p2��%�P�u<W�_�o�C��֟��� ��|c���R��V�X2�d�`3�##���%�q6�q�%�=��F�F���*�=�p����~���_�t�]�9�x�A"H0�A�=A�Y�m�/ ҡ���E~��8��l����kW�ź��h�"�涔�۵��.�Y�p�F���؎<��O�_�Q����v��O�
[�O��S�m��`�-��r#��f 
�U�C����y<#����_�2�y�3���[nV�PӥK�Y��k)+�@8x����_�nk�θG���.�_�gug����?��n[�a�5RW]ן�����G_K�?`߂P�Ӊd�N�gr�r��t�H�v���"��ۓ�t�������$:Ή�S��W��:@-��k1���V@����BH���qw�J���f���/�ڄw6r�Y �;#t|���C�� �����@L���if��V}[�W�v��;��w�,�!���.ӷ�S��]�3���,eI�k��^�m�����y�-������x��U�[�_0A�El�� 1�����&�
���������f�+P��~$��_.�h�<3�����*�yM��K�|�1�c�h��$�dO�>վ)���$����ʹPŢ̞[�Z24oJ�n�iDQm���E�̌�|�wKJ�h���f�-=�mTU�{'e�z|W�u����N������u�����%�Wz-�i���
xD���<7c�M�U��v�z�5U�WU����1ּO�_�����u?�|yc���Z��޾g�[ �q38���c��)������F���O�C�c��57��W���+S�����!�u�n�&O�4C"�[��33�+,>]I˼�»�����8��Ж#UE-�W䗙��T��(h�i�`o��B���-^&�s&���~̳̬߭V;��8
� 4���ٿb��+Ÿ�'��|#�痨k�k��\>����;�l���Tu�U���`���8�{����uּ[��]V���p_��ʏ���5}�o����:��C<.���XYAK�������[��+��C�N+��v]���/��%�id���on��;՘���*��<��s���p�E��O�5���\t�F5$ң0��Y����l��'<�`�����6���[�mS���I�8u!O��8�������L�s+�r��O��ZUep;
L��ظ&=:�N
���Z�G<b��Xg�H�I���}(��$�"������oUso�x�d�7R��9xH������rx��To��z����}��v��΍H^v��c��3���
V�C�4�cMdK�6�9�2�fU�����d�ɟ�Ly[���U_�,���0,��G�Z7�E��>��*���7�89��<Y'z�_�?I��
ط}}����?��(��\�$(��(��(��(��(��(��(��(��(��(��(��(��(��(���?���(����QE
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
�U�i��m��&��6�
S��C��kN䯨�}+�����o�|)����4~7���^0�Լ�1R�v�,�7��@�ס�K��g�)Sr�T��/����R����W[k#��s�ɮ:��wۆ�]5��~V�_�VW?�p�����q���`~UϽ�
�`���}�I��ι�6����R��5X;�=�rpߏ�n�y/��kk{ky/.��dqD�����䟥sʛ;�V��Ys�{zU�q�|�2�����W<�a��b�{U���{�t�R�GO�8��j��)����G���U��8�ަ4�'�IL��4>Ӝc��Y�p�z�֮,���X�T���`�gڟ�>���8��?#%��M��U�s���.k=��dU�p���$��t�C�j��a(�h�9�w�|5�MR𿋴?xwX��wa
�o2�7�>��_��8��rj�	�s�?���OO�ğ��#�\�_�m[��) ��\�G]�*�(`�W�D�:��o`WVZ��^�f1P�ЍE�z�G�[���������V�h?�?�Vm㦣�Lh��uO�gO��V�GÃl�[��6,��L�P�f�H��(����~y�~>�5mW���Q��_���� �¾�٧�Nwx���O�v��zdW��5�.[n1X:���=pB5��Y�(/ �}��w�V��W��)��T�HE'�vK�z4�Ҳ/�_���:�Ӗ�2�So���[�G���O����mG�<���y��u�X-�
[N7��?��r��9��)=0G���ۋ�
��[\ɧ~˟�%���F�x�	�=�9����i'�t�qm�_鷑jZo���:�߅���(��+}��L�5��ʿ9��gʱ׍�Ts�������t�dz5����h{�o�$�~]x'�	��x�Ƕ_�o��w߶�;4_�iwj����n�=#U���߭~�x{L�����������p�
,qƊ
��*����+ 3��;���t�Te�h"�z�8{�a���RQ�쒿���]�?
θ���^#U���z/�;;8UTn�޶QWo�a�K�#�mG"�<�g5��5�bp޸�F��g�n^��w��N1R�V�^}N*���g<��J�})��'1�ܚ��>�=d#�1��nN�=MIL��)� s��֬��c��zb��|�b�?wZ�!RF9���>j��d�	1�)�A9�R�@���PIt6�͟�RD:�ܧ�\�1�� �H~u
ݗ��{Wɿ�޿�����b�%ӿh?�:6��r�&�ܽ�X_�Mߟ�z�ژۜ��־#��o�>(��w�/x���"����;M�'��[N�w!�.2�ua��_����J�z��}�x���M+���ߩ�0QE���!EPEPEPEPEPEPEPEPEPEPEPEPEPEP5����(����QE
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
�s���/+�7��U�
�~Ϳ�kۉ�[�`�i㋈�����¾g���f_~ؿ�Gſ�����t�m�	��I�n	����r����i��]�s:�aQr�c�V��	�����D�2���)d��[�A��gڛĿ�o���G�
~>�[�A0Ҽ1��I^-'_���ZJ�n���U�
�eGS��i�=*���]R�����K���y��CA��{�S�SU)�U�y3�o7�����F�_���F���8U�e	畏������]5}.�źV�{t7G
���(<�H��܎+��|a��I~)�ad8�mZ�~y�׊諈�MZRW8�`+Wk�.ތ�O{%�%}j����*��RӮ��uC����:yR9�o~�����u[����9e��u�Y�VNV(d�Y?Š�ڿ>�U�������,<!s�/���nb��Ѵ�y&p�NМ1�nP}�Ξy�ZNi_�)�b��T���վg�E޹w��Ϫj�_�ݝ�M3�v>�jX�G;��ǫ�)/���ؾ�1~3��Y��A�SC'�f[)
�;U��ڣ�
o�O
��'|W�J�4��7�l���k-��-�fǥe�������F_�n�C4W�餺�(�͟�K~�9o�}���9�q_������ۯ�u����4й��{�b2(��:鬬;�	���/��^��$�ğ-��ݾ}��8�s��,�����\+�����8�G������W���
��&��p��Cofh-?��"����=3�����"����^,����H�i1F�%>!Ծ��>X���Ԃ�XT�0i��,����9�ZR�ɣ���^�?4��j3�'>H���^��j��?����?�Jo��
�U�Cj������@d'�+����B�8>-~���4Đ����=�`|�܀O8N+hf�6����k�G-^���ߣO�l��돿��)�Fz0�޿��_�5ڗO��8��f�>cV�O�(��	O���b̓�y�i��cù������_���}��U%�7$��}�y��o~�o���~0�
w�����L�*�.O�Ǿk���E���fg����U��D���;��4��g���8�.����{�[VO���;c����5�e���-�s�*�`���|-s�c��\E�c�eԒ���n�����"?�b=��������?xO>e���?���u��l/w�?�'�ޏ��o85^H��)�-�L���'K�3�3 b��-~Ĺ��t˵\��N*����(��������T�R��&G�x}O���q&����x4������0�:��s���
yo�W��}��}��G�!��I�]kGׁǤ2�鷇�v���_��X>�=�
���/|'���gĖ%�k/xfky� �D�@��ƺVy��֪_��y�8G3�������?Z`�P����$���q�*�����Z�ǩ<=�n۬�z�"��^I�cԟ�=k����~�"��_�����U?-7-�j�Y������m��'���c�^�z�h7���Z�����ƀ���H�U#��BGp���%
G#q���Y?���k���R��+��
�=��^��?z���O���M|F>o˜uc�޼�����
�C��4�K�3�牮2˧i���#�Twڍ�F��r�N����)�i�����<��RV~����O�?���O�e�@ҿkk�]3��=Is�z����k�?�>����~8.?�U�?]���_�������(��'�����$
c�nʲ�����sK
/�����.���H�H1��k��B�cZ����k(1��1�J>��2����_�g�?�S5��~0�_�jpb�u[[�?��-�WT9%��?��Vua~zm[�k�>���@�����u��5Ů����Γ���d1�3P�wy&BZ�!oE8�U�+<ڙ�:Yu�ۀ��uC��x�1m�\���s�+N��z��\�!V�k_g��mRN�Fe�ķ�-�yd;F+��#?��?�T���մ-PҼe���
����l�����������
~ş��[�u����;����}��z�|��~���$��c�a�>����<C�'��~ h�i_iMj�Ǻ���϶�ȬB֑��q����"��q��:t �wu��~��OZ����VRJ+���~��E��EPEPEPEPEPEPEPEPEPEPEPEPEPEP5����(����QE
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��>y���e����D�h��W�
��n/�+qj�0d����Ŵ��(�I�r8��;�6�	�<�Ma�|L��f��V־ �ʅODO2�G�;ofoS_Е�P=tg�'���ܟ�&N�m,Z���[��[?j�5��(����1ߕϽu����K��Y�α8���A�?��l��^�5�y�d��?
����~��ﴟ�×wZc+Fu)o5%y㻺�'��G�~�xg�ßAak��h����ZǦX�j����EP8@�ڊ��-�2���@�0)�Ri#Y#�K�CRQUr,QEQE�w�����J���!��,J��)s�ִ���[������>�`�p���t��~�>���7]�6EݙzV���P5�������w�"HT�\ 5�E�QEQEGP�4�Z٬�]>
N�O��k"z�
^��<�]�E���Xx�ᇇ|Ea2�x/��k��G@VH�H��y�~��[���e߇M#uc�3?�K_EQI�2��s�4��~�o|�w�&+����env�f8�j�=;�~�Ԯ��?KV9"��8��*+�����dQ�Y��H���h����,QM�4k,R2��#Ѓ�>��K��-�|~�����1x'�?kVF���m��Cu���;��<�$S�s_�>.��x?��(��Ӿ�~���M�뚄M�O��μv�n蠉SOV~����O�*d��u��g+%��f��Јr+��@O��6
o�{�U�����;�XM~�QM7ܗBx��{R��&�*k��3�g~�^[h���4i�c�+=����0�����=[R��5���㶵wv���]f/1�2�$�⿢z)�M���(��c�H�l����߱�������g�?�/�#F@�e��{��a�e;��[y1�eS��(�a;�+s_�@p���E-��
(����(��(��(��(��(��(��(��(��(��(��(��(��(��(�ks���(����QE
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(������(����QE
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(������(����QE
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(������(����QE
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(������(����QE
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(������(����QE
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(������(����QE
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(������(����QE
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(������(����QE
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(������(����QE
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(������(����QE
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(������(�<���u�L(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(�����@$��woocommerce-blocks/images/previews/cap.jpg000064400000111453151335517640014733 0ustar00���JFIFHH���																																																													��!!"��	
����)�\�@q>��ۙ�m�u7��X;Ox������<�����/7Y��n��7d�0�O;�mO�~����XJ��\ꟷ�=���ھ�|����'��@�i*�O��l�ҩ�N��=X��6��~�e�z�g�_�J�u��N��ͣ�K�};�,�o����M'��˩k�������~��?inv�*/8���Rz�	f�k�i���&C[Zk�=� _-[%��3�LV��!
r➮������jS�t����[�Ѳ��$�h���;H���ƚ���J�К����JW�Mz�;���WY���q�]w��myU
��a4d�T��d�x�}�_���<���φ�y�����o�@�}rE����Oq^?��o@W���.�ܠbΡv�Z�V�
t���!,"��i��4��j��L�f���5�4��`O/������}X��Yiӭ4��W��&S�Zx�ɡ����Q��?1��P�g�|�J�g�V8]�F�9�������^�ԩI.
���hKki��D�
>^�_���5�v�1�~�gJ���J�z�9��Z4����;�Im�F`
egs\U�sRv���������aA%��P�$���M8��/�Rѷ��x���=�ēU�<1KY{^�ꔩAJTcVj�m������y;	���أ� d�O��*\MN�9��o�+�����iԒ1�Z��@�����3��Y�4���ݠ�ҥV��eXV�Y�̣�"IkB(��K#-�Z�J�'�t��� t6�}%��2�Ɯ|�z��yf�AuZJ�HW�V�(B�lì��!��H�|��
�W����������,璅���hҕ�%��4&���.�ݴ��23���P�i%�Tao�i�����oJ{��IoF�Z��…U.��.~洵�4��Pم�%�=Yc	y�~�]��Zm�^���B�HԮ�ڊ��<y��u�dm�Vۆ�p�F��d����$#�}?�-�g��֗Te��T��FN���:��M�}�#[�t!�|?���~�.i.繚Icq��?�]��K�:��y��o-�P��乪9O�˨B���8a>��Č��OsuQ$��kv?�j6Te���N���ڑ���1��M.!a�l�v�M��K�о��M{sV�HV�I�^��K
4��<g��Q��ڗ=�!WZ8��9���f����35��
�}�
%dqԌ�u-(Mqu==X�Vβ�ڬ�#c�|gݏkr�Ki��~���n�֩�[*��WT]#�g/)��v��@�yr�Yo*F�9�og��ѧ��0���Lk׆@�;!9	f���i�-��.jϻ���|~��
�v�u�Ѵ�=Y�e�����[{��(�_G�ď<�Q��؟������)H��:�S{��Q�=�r�?�~�ڗ,�׶�x��Z��m�|�<��_��x�cW
wxq��9���_1&�7�l��؅)f��x-�Lnծ���R<��m��6�)���Ej��>�e�y�ڽ={t��_}���0�K��j\җI[������仢�Ce�������n���=%�f�Y�zs�=�e��a��e��>S�6�p��̔���H-t�<:�}�i�
���N�|�ݩR��[�ބ����Mro�{_���~��8�B ��NmW�n"�F�G�yo����+o\.�r�=m4��;����r�q��zG�7������7p�[=��;�.��/��X��������'����@R�
}��y�Խ�����wa�'W�:�j�N]�Ps��-��^C�4q�.ɯZ�Pys��ͳy�sL��̰�Op��sq<$�J־��t��[��w��O�Ý3m�m���+a��=�v ����������[zT��1�}��ge6}�Ѣ���l�#Vd��e�K�7�D��=w�Lvle��T(~�ۀɷR�]w$wW.�	0��%_x;9�xF��_(|�"J��l�K'�����
Ϋ�MnQ&<�Q9C������>:���̳�Pz�Vs��j�lxz;8<���=��!E�>e'��36n���y�F�:�����?˸�G������(�Fʢ��MwOm�z�����{�ʚ��{'3��~���T�_����vo��:;�O&O���uq�;i#��XZr���G�鉶0�LعF=U���U�#�m�C%��hmL��0ҽr��^����x����vwТv|�;�8�k#��\_Zv�XY�-?�x�Y}ݏ�MӅx���m��)>fH�T�Woׇw��y��*<���}�����v����C�ɫw��
u�=��@ᨴ
~a2��љ������g�������[sO2�@	��=�<��u
�^'J�|�tYbᴍK�j�{S���J��l^r�`�#���;�U��ex����(w��8U@G��5�s�g�3+����@g�5�b��SL{�MDO2=K�������Q�Pj�s���X��K�Q�����݋��ƭ&D���ŏe�]��{�sIY4�9�������E��U�@R�9����'��/.($��U{��׀��x��N��l��>�ŋ�\Pꬹ�2;�G��].�<�վl�e�U�/�y�7��\����s&O���i�X1��m@�}��j��]�^��sWXE�_�,�mg�D}�5F�Uq��-�$�Rnu���փ�~��A�Ԡ}��%t}��~
�{}r�]��������~ӫl��ᥗ͵O��:Ɵ�>��ҤR`�]�j����-v����=!1 "#0P$234@`%5ABT&6CDE�QRq�����14�j��{�I���,�%$O6WI��|:�S�w��ݴY���~�r�m�'���V��b��|̇^�c��ïZ1��"Зg;�I�"��s���z�y�h�tu���y����.[���ہ#��)=���uH�z�쏇Q������pi^vDd�9�2�8��&	�'�}z����[�=�7u��}=9vJ�bA�~��9�5��̚�.e
���K"�
��)��N�������i�c21_��W��:?M
a0��ˢ�-�W�Q�������siф��w1�*�`)F�n�"ހ;m�v�O4�P��B��j�\Z�jIe�V䕬�w���?i2�7�"��(Ų\�ҹ��"
��d;�$��"��̞xE���c	�ϴW
�����i�U��ח��g?35G�U�l��l��q��3���� �6C�c��XG�g��mZ��*#�b��\<�ۑ��ں�6peE�,�]���V"�v5��)r!9�FLR�D����Cr;�W�r�bgF��hR�+��6h����E����8�Wf��9t�*�:PȢ�!���v_UśqJ�p%���D�/!�`B�=��Ajy����������W8r�����)���E疆�����Hũ����2)VdZ���s��p���
���_Ȓ�"m��	q��vX�VM^p�k��-�[�a��5w��:�&��if%8O<�ف�vMb�˘�c*��u�0�$���#kh�ɬ��bM#%Ȭ��`�ːU�Z��l�H�֙��	�����,#{V�5��%�2>\���"%}�v�!`���Mq	���j��kpXx��{nq��ޅ5�90�v��]Q���4DD��^&~�&f�-������K_s��^{�v;t���rF�vfO��F����,C��6��j1�	��R��Ȱ��Qz<�k��d��S��R3��*cj�u�6��Kx���g�d��,{%bI����1
�e��7ɋ�/0_�.sX�{�d�����u.-�++F���4	��R�F��Bd��h��� h�7��TB��!���o_��|��"#'��=��k�Z�5��L��^���p~�YN�J�_���^�Fo��}�lmW�vI�;9%���AT(�E��ߩ�#��9��QN(�0m۶�t��?��ơ{��F��@5F��N��w�N7ԁ�;�K�����a��V�Ot/���M`LX�k�$��T�[k�;^䍪�yV�cg'�9TbG�W&��LdkX�������]�Aw^�'�m=�b�w�~�uk-l����q�sa�_����ї>�C�y��>H�?M�SEw^�]��^FC���{��إ�d6
�_?�^<g"� ��]�1�y�xת�۷����Z�Wzj�����mG�Fo��㷲�}�ڴ�����p�y,�:r�	��gj�*�Q1U_=dU�|���V���CM�Z�MG~�#�Kz�D��sg�	�G��O0��Wv�N��#t^�iWd�t����]y��3o��Z�Q�š���6Q㕞_5X��+�4��["F�5)��e��ϭf�'O�W��`@�F"lϑ�&��Z�Dv*k��n�_+3���(?R[��q���g�ڦ#5��6��߬M3�����b���-;�y�����rEo�JC��d�=��?�I��p���\~c�m�LF�m��<	�~�3:�n(������h\$?� �H����ގ����Q$� ��w�t��2�����B�ka]�b��h+�|�~B�[�a�,����Q?S��`{x��k���?BX�����ސ�s>��ٕ�����_���/���M�P�E���>��������t���$Iq�ܞ�����O��ydl1:g�aMs�$����C�P����L1����v��y�>U\j4�3
岠�8�y1�F�R�jy�[63�Ɖry�	�V@�bx�;��Lg������_����sK|���www�9��u����:����o��V�W� i~�x/[NH��Z��?����������li4�5�v��K=Z���&�M�Q������U>�RGb��0$�����O���e��,��"��;Z�l"�U�ұ|����g�cj�(6x�~&7n۪����J���ս�u,�_�ӳ�4��!b���Gu�k֓-���'
"m�cX��1��]�T��:�,�)�/��^���&�A�G�[(�r���~Zx/e��ܢ�վJ������M���d*Vƒ��J�(�%P��9���J|����ɧ�d[�������Y��ٔ��M瑬�9~8*𼦹]��lS�ɱ2QP���C�l$265vX�k�I��L��o�����]��)�op��r�Y�����ѷ5P�'���Vw��Q��L��Y����t���l����D;Q���������/�����O�I�ZX�K󞺋Ƣ�Q��8�~RG���G�xd{[�.��o�I��8�1gS��P���Ȥ�6���ն�sk�l��/H�����7����.����'�U|X�H�W�S䮟+X�{�|�y%p���k��$ȟ̻�B�;Nk!�=�����&���,���M�A_����qqku]X��UG�:f�M���i+���5��szv&��������FGi*����&�3	��&8g)Ux1Ijh���KZ�*���Ȁ��q��g�= ";'}� �r��9%�KQ?1�D���-��J��i[
�;wMn��5Ě�M+�~e[� My�8,�(Tm�z �p�A�b1�:�ڵ��n�6�E�%�Ͻ~W&*���zp#Hګ���J؛.j�ʧ�S���Ž%Fe~D����
9c��r*5�i�Nsw�hW�k�z�kj�Y!��ŋc�1�ǩq\vX�7	jl:�H�1�*�ޘŒ��)�0�������ݍ~.b.�޲Ӌ#��k��b���1ɒ��|L�h���������(��H��Y���%�/�qi�t�oˋbslf���E��[��R���E�¹5�C]V\5|ix=��gc�#i9P��M%},\���o�+�ڈ���5���m@'*01(Rn��E8�F�7���p�F>qolm�%>�E���a�-y�	2�g(�.���ŭ%m�<����qfϺ����U]��b�nh�n.b�������妮h+�!�56u�5�W6�B�<ћ�]D�N�����Y�)����'.�ab�`q�>�V��{2\x����7��|t��}L1p�8�Z���Q���{��%8
���K=�-2��kt�X�	��lor�N��*C�����{��e,�lK��ƪ4a��䓩�sΕ�dLH�Dk{?����� ����]��������t:���:'�
t��^��Zz˒�7��`y�:c�K*��Lr��:�'���X�qȽ�U�7"!�?��K�#��g�1�16�/i�=s�e�/_1�����e�(�~�u�otI�ޱ�K���]�K�N���
E٣��3j���EQ� K�G������s=���	L%ͭ�����]G���a��cd�ꁼPh�B�����դ��-ԙ��P=����JyiwD�Q�7�\1�L�I^����+�w��L��7ĝWVv�ӈ��5��>%�� ���4��i�2&,��eʔ�(���1��r�JZdruDv�썼ɜ�iYk�#��:陆�[�Q���)؁��5��#p��'��2���+�o��M?�,��o��f�Sk���Yc�W~b��͎dP_��ۗ?ҳ��Y��^�\�����d�;819���n��m�ʸ1��]�Qճ�H�E�T� ��^¦�(D�C/�P��ca��{�b�;J
��b�-�&�E,DD١^&]�6��0Wr��Rg�Vr
��c�r�s �M��.R3�p6 ���V��.ț�����1j1�p����wS�:u]\�K���6�2�#N"vZ�L?<��5'_�
��cdq1"���(��J-�~�]dr1Hxc�����	R���@1�&v\��^�Ҟ� 9V)���t�
u�~����gc8�)��stV\SW\��٘b�GIKp-�{��>��Ȏ�$]�[��/�];����1���jlV��8���O����zn�RXc$:�o0z̪���2r�\ֽ�Ǧ�+
�d��Z�f��Z@�G��+�[�r�����-5��7���;kH�v^�~g�8}�X��ջ��q��pFV���\j�����Nf�sPиg����9��Jv#]�g��!H�߈ge��0u6$m���U��1k;���0��8X�D��W�e}��d
�Ս)�M�x*.�ı�V,r�I�\$iju)�����?Is������������?!�>�\xU�u��Ҥ��*5�V97I���qU
����������.���/� Yu$�FS�^�otE� ������cs�^*ɏ�Ȇ��f�����)mK4Cij��com}�q�r���+�]�7yH�;#(�;�jO5n	K��<��ZUp*�{8ز��S �<DWA4%@�
�>�Ĉ�$o��|�9~(S�A�O��p񈛼)���-�+�|�n�<„
�{=��nD#����K�j�$�Ӗ`b�
�di#=S:�x�ӟw�n�@Q���ۅ�,J��\=j\�q�&$q�Z�����o���TvC2�7��5�-�M\^I8�x�U�e��U�`T
��Ƒ��KsF�L�sJ�l��S�)=���5�oh�j&��v���[;n$�VW�;=�<,�ܑG4k�G4�ZʚwXb2p�^Zr�mP�.q�n���ܙ����\��,"�)�H�3mm��Q�WƳ+cjo����T0k1ښ�sF�y{-r2grc���bQ�Gz�?�7��!��di>2F�����"��,e�^��7�oh�]]XT��ϯ[�U�Cɰ��&�wOi�]x�	a�#;^���c�t'�9��	��vvÔH���7���S�Ύ���9��:4��5a�=6D�;
<:��dH��[�����nzJ hD�Oڮk^���v@D:�����,bOݹ:"�g'|S�dY�T��
�A58��6�+w9�kX�&�bª��.M�M��a�ջ��Kt:\��ݻ��Bfx��?���W=7a����h�C̻C#_�[�VRḚ��B��9|�B�|w��:|b?n�MSa���N��W.�.��^��	�*�JRg~�q��ϙ$�EPaAÍ���cW��G


!1A "2BQaq�0PRbr����#3@CS`����4���$Dc���
?�q�VJ���ի�Z0N��Êv��]p��u����ɩ���]�mPa>f�4�y��6پ���:��Ⅽ�u����M�p�0��6<"o�U��Oc�>�mi��;[���#y�h���̩C�;O�����Zmv�!�YC��C��P�l7���iY�c}��c���it�=˟߅�+fF�g�5��U\;�`O��u�.��;��\,ؤ����ڀ���)`�&+�,�8�
�<�ȍ����ac1�ˢgj�K��9��s]A�%����@�Y6��U�/�/7B�1�̇i;T10�oi_NjK�C�(�;�ٝ��P�M�&�B}\��P��w��R�_1��jnT7�ߨ(_����M.�R��<�)i�tY`�..3�B�W62��P�VO;
�1C��+p��h�Ҥ���hO�:0�{�r���'}	��>"
'Bd��V����j�-��f|Y����i��P���k5�5���[J�:h��M<�H8�6�5�_AQ�,�4
I��:T�nsʇ�)�<'�S��Y4����gU��̦�h:�LXN��B�S's�O7K�!],���)*��\S�M���_Dh��M���g�B�]�>�?�C�Ҁ�!o��k��x>��Cb}(�1��10��Q�����v�c����^��n���ӡ�#w��U��
&����`���B�!��FtƁ����9z5ӝ7����VD)@ק��N����<D��(�`����M�)G����b���Il��%g����I�o0�
�Gb>�5�:¥"��� ����p�M��"�pu�����x���'�9��ǥ^޶pR���f�Xw�ܴ���~�&a��q��x�<En�W�X2x�y؜'��9ܣN�-�qO�鶡'�;[B�[���z����Y�Y/�
�"0�@���S���&��qpo�ݏ�g��ˇ
�2����[m1�#M�����9���M�$�g���#5ۍjD�uJ���Q�ۧ�r̝��<O)�3���4w{���kiFLF��¼���B'o�冉ʕ�|N1��7x�	��j>�T�2�?Xݭ�"ٝ���?����I��ۍI�9�~�)�"o��_OUx2�����G+ƕ3�t3ڽ$�
�����y�T a��*;�A�y��kC�\�D�����+Q[?ߕ�W:L�O�қ�hp�k2���):�d�Tx�W����!����k�V���G�O}K�b�g?{��i*��֍\&W���g�F���Pψg��fZ���'W��L�O䀚y��ʰe-�w'"+�B���6��1�¾;�ob�vY�w�/uhT|��`_2.#?+��h]2\�-沺�s�Lv�d>4!�ҵ}�LEb<to]'�[T�	�����Y(s/j�#N�
���S�Q�Pr��s݌��wFwb�$s{ܾ\�����+�IC��P3��v,�
͎�a�ZuDr���H��t��:�P��C;+Q>�x��Oޫ0��~�ڀ�
P���Gk���۝%e�f���\��4�̂'�Zb�|�8�CH�d~q|����48gq(PX�:�(����8�P7�y��y�ɏ�niu]+�\-�U��1�b9L�+�:���2���}���r�r����i܏ƍ��맒6���el�%��+D���]�c��†k���}��u���Ƿ%�5A}�(���f�:N�c��̿�;4X�Q�'�?u	��No�
��q�P
�Vk��w�����m�:�ҋ�Z�ŧ��F��D�;��M�X047�s��y�tc��A��-��V�&��Mެ��M��4#�5L�Ek<�@�"��{�P�LZ/f_��I��w�JM�(�z��t1B�_+M�i�4Ǔ�ɩ�:��9�(yp�XL�Yh*!6j�͆2�Q���L1���'@F�-�p�.
�\��cz-�l�0��+_�ڏ„fhW�����(Q6aك�.a3�;&3r
��"(tD�k�̤y]�)r5p���+YRw�s�=�fmp��Je
��N֝Qq��D!�y��N�,����L��?[T<���M��`��Z�u��S`���bRn;"r���d�7Y�t�֌�*�$^��@]me�W(�V�3V���:Ѱ���!�
�C���-f���TFڍc�trSb���&�
�3G��r�־c�wS��d�l_.%�֢[Y�~��pB�o�D��}�����!ۗ:���jޛeȘ����(��s5�����❒��C@��vap���v䍨T�+<�r��m�5���hй���-����VDmЪ+r�5�n��`��g��f�+E�hL�F�4��(�~�n��J�E���*��fˍ��l� ��r�>���NCK lY��d\�z�uN��҉�w�TF�v���eGhU��K��mc6&�����ҍ�|���\�n�f…^�k�Bm�&iq܇����ZKS�'U�N%�_�F�ɟ�v+C��F�#�5`L�w.:�Q��g䝈Pa��8,Ȋܦ��L1���`
%|�t+b?ݷs�d=��:��}�C���g��f�[M:��/��ᰬ��)�Q�`�]����Z�{fG�I�Gj��]�r�/���9O5��X���7!��v�
�did�
�}3�|���(g��j�u����p��K��+��O�F�����)]g}�Y�u��p>+G
�nBƉ��k��,!1AQaq�� ����P�0��`@���?2���"UUH�!��`%G�0{M�6�u��1�s ��#��@���l2Dg;T+x�@tD)�ۦ��a�Sp��A�(A�7VCp$&�YY88�~0WJS�E�n3;�!��̉<y��mj��$`~���:���Q�,��&
�W�@�A>��8@r��T@�����*2`����������,Jz[2l��"I��y���(�O\��'��uU�h��Pl��% �繸#�&6h� �<et����a��*;�;�9:��.�L2�`?��Іf
�mH(�
��6��DU3�q��;C��8��6��fs�	�L�A�&\�<�*@�*g�u��I��		sOh� �a��Rc������g�v<�=l��+F�
��M��LH%C!-h��B^�$Fõ/c��3i�B�q3(�`!��Ġ�G1��Jf���2���`�hϒdo��"B$�*]Do2�����W�H�8��p1��t��ǵ�"kJ��	R�>�
�_L��r�#$���76��L"%�{%�k����4V��70�d}�1�����!��'B~�7F�(�&���=F荲A�Z&
��	�����7(DV�b8��~��yBG�Q����qG����>��1��	�e$�A� ��a�1Q.��djo�`�#9>�z��(�0z��
z��*�:=?h~�]�@��B�H�#������Q��S��|�rP�
����IC�F�f��I�c��)ۉ����f���0oʦ4�;s:J��etX9�lsN�q��P�t,��K�<"H��ꀦ�i1�ødR���A,��5:�BFU��d14n��S���4���P ��uK.?h��M�1�)�m�j��QC w��{?�6��jo��/}�3@(p�RK �� �P��7���?�HD�7Iᯰ�����C��P���Xl����ŏ���.\��
�b��; �ʇ��7;��ڬp9�2�wI����@RP�AE�Ph���O�	9FSjgq��<@ 8��F�
�< ���s�s7���?�P8���T��7��BR"
0��M�p��Y�	:�^�ĵ(0!�o���P��2�G�!Ml��K�&��N�Z��u?6	j�6�%����fH�C�ܵ@\y�Q+�MXϢ;=�$��8�Ό`��l��6�M�L.U,O��ʟA�A����8Õ�O��a���5R����J ��} �aPb>d�:����)���D���9
�28K����_�y��8�
�fL�#6�'� �q��ű����>fSg�`˼/Y�8�t�"as�����k?�M�;�w脸�(U��6/�9�o��#���J`&�A"'U��<]?�#�$E�k&dې8���G���Ǝ��`(r�#���PbM��!������Q2�
8GZ"�ۮDr=��>a��u>h��=���nB �`f��_�	���<�� ��nQ`#��J�j�d:�.q�`w|����uM����~A�B�#�>��0�Y����!`�GTk0Z�n�4��w���4��Qc�1Cnr� q�9�,��<O#�7�ЊգV9	�F��g��3%�<v����'��J��ϽBa"
���H蠤lh��v@�}��~2���20
�TzW�]g�x��) M$���a�W�s��l6��@�P6� �8�R`*����$!
1�� ����	���~X7tF$����]��@
5�� �
���(Ф��fG�=�=0n�G�H�ސu4�
sE{�.��L)a�,�~hҁ	�Um]��2���.�1S�򮂃=*xO`ߔs��o;h�g�sG�&��Hא��ڛaH�A����C8���C����)�yB�>rαB�n�e��Ŗ�,OX<���bz5� 0>,�N�0�tFs
~L��}�4�,��5f%ƓIe�TXN�^S&�&�> 7�
�0�ݒ�n�AR�"�vWS��p���.B�WE��(� A#�,�*q
� �Q*	h��Q�b��ѓ껐K(}���I����X���"z���%� ��-���b4�Wb�p:%:~X~5�d�#����10��&�
N@Jl)��~����&�te!�6P�-
�-��&�wWK�Bec(I�+芏�q�T�_����c��=��Q؆d`5)�QL{::�6���7��6\ע8`��R����#>���u3���
�½��Y0���W��!Ő
�Pft���چ���1�a�1Dˈ�Pm/�ܛ�jqW�D642;p��t6�؅�A�OL��5�J������L�?̬� �!a�͔B�|0�r�_��H(aP Ұ�`XM����`���]32���8����%bǐ׾He����'PB���*�^�O�N�O��x�G�l
4N:@���1'�P��Քtko�ȣ1�A�n�CI�AB%���4TF�b�VzD.*[��P9e���ERl(��]�npQ�FPV�at=	�((
QI��R���K^�3GD�T8 �d�L_@�5o�<��D��'�Щm:�L
��!�5��!Ҟ����ԝ�y.���d�.¥���E��+��
��L�Qh���h%Bo�ь�h�;�X���K2��I��LD&����QW���#��	왰8��O`D��Ȋ��nu���q@�_���R���E��߸ol�RWt�9J"��"A����[�-���бd�]�l�¦�̔!A�`%N�k��h�?ߜOQ��J9d�B�V��������ǞaG2Dž�Q�X��L#�h��S;w�}��ѻ΃n(в�sn�P<��M�}(IBr��v.6�UIe�܇;'w"������g"�S��!��ً�Lg�E~)�
U���f��Θj�c;�$J�D�+�`���&_T�t
����xG`"J����_b�M��aqo8�@�Q��(	&�>Wl�������%�� �V��'N�D��f��+���p����;h�q*��L��"|�4+��2d&TF`�I}bɅ]�o���#�F�f_rH
z�Rɇ�4�Xmb�E����~3�!�1V����Ve,tN�?
�Ȃ�S�Qj��Ξ12Ű0�AHh���`�@1	���|`���P�
���t�y&�>��0�E����ɨ�eT�J�N1'�ܧN�F�$�"Pբ��&���r�MX`9�N� K௔�R�Wǭ�A������,�y�����2m�=0|S����ab��D�z}�[ ��4�ӡ�	�1i�wn���=�"�O�H`�GL��(POBf!���;+�
�B�0�� ����A��9�i��Fyi�і>��"{f��u��?�\�P���a�Ő���N�@	�=k���I��h6G����r�Gn�M�0��3����Q��9��9�P.�E6����ޕ�*]��t?H��s�{(�i�5�	�H�TO��;E,k�~0 EjB`�������7)��A��'bq˓뿸�w�#�ϲf�!�F�A�t��~���ڳ��r]����lf	��Ui���$�o}� x�a(�`����(r��qUb��i�X� �z1�(��Nꖜ	G�!\nʪ7�0�F�����:z��eK�4<(� �&
��ܑ�*~|�
�
�H(�4vlYJ5��c�t��k�8#��S�o�0O��'�3��>4F���8��v@$8V%�as��smXݜ��ؚ�^��#b
��F�:6J���I�b�K@D�Bt����+�@���cv]
��m>���>�R��Y�#ص:��E1��a�
7޶k���Ȁ ���PA9 �`��x�����t�t�d�4� IR�*�B6�R@3Go����,!1AQaq����P`�� ��0@��?!���!V߱����c5S� պS�3�j]��p��؀��u��:|�@%�RvYX��Xp�7(�5c�?����s�2[��M|(l�cJ;'�sQJr�p�+��,�^A�	,��m��
F��S�y�C��I����B��EcPrw����-evA5�c��Ah�f��g%��F5s��p�#�.�G�g,�(�qH��ɉ�#hx�y��h�G��L��<�wh�2��ANq�G����o�NT��͇���s����(���vr���:��Cc��*TH�2o>00��TD��@���zGWc	�=�����������,l	Tb+f���G�D�cݻLv��)��i��Oٮ���X���~�R�.=�6�߮`�K���
!eZ�ݍb�|�����0��z��_�^?.��A���L;�XeC[�E�-����C	.�g�q�b��e_��R��o]}K��G�L����#OrA�V�w�'`�Z4��E�H�iYf�:%}��>!�haͨ��٘�~��}O��pB�%Tu�Jn�j��d1\	bq���	T;��z4�����۪_?C�5�"d�z���-	�G `�:
�:�"O9`��<���S!��hO**
��R��p4�	I��̎�q���[�\���0�,Gd܋N�*v�>8f��߆���53<�*��l��GlFo[�>�8�
���B:���jQÖ+pMn.*��kk�Y���6
Vp�e=����L�!��hL������T����!��TLw8S�x�n�J��Z���-�Q,fD��	�:�%�����v0��
�2;�73�_n�N���[���ތu�eL���
Ux�6jT	m�ϐ7�������?a�-�d퇅\~�|�6�=��,ot��ɺ��T�Xi���Ң�M��*�0o��D���p(�/�J��3�+Z��ﳹ	��vF'��M>6|�W,���D���
:�&�5�*F�W��ִ>q4���E��z()^ưMD�d��`#�����V������+�J����#��������~k�����D0��x<�gN(�q� h�����q���Q���Ի�N��U��v�ٗ3-�]���`IQ+S�����Dh\՞��6�w2�/��.���L����v�����Gd����j��Dv,�r����*���˺�\�Bd��t0�U���{y��w�ѱԋo��.�@b��Һ\��\�7��1�b\��!��[�{/�ծ66��/|*���1�ۍ@m�كp^�T�H`;�x
�����p�\��W[�M�U��n�1�)4��؎�Ύ��N�?��:Q)%�#�2��I�����3�����y�]Uj�>3ӱ�w�X�}NI?�O1�(r��׮8�9�.�n��+�/L�̏m㡈��f\Aq��n���Ja�?å�\ti�2���:L�^���x�miӳ�K�ۤ��M^��e��el�hCD��AfG��X�3��ɯ�oe_��,1%J34�/T��{aH1;_�>�i�l�i��[��1�Ir�@'Q��cC�li`_��1�i����=���'��r�qɃ�����J�S?��}t�Ľ��5�wj6�\4����+�g�w?��qzhD����E�{�6ˏ@��ـp��'�Ǡ���}�Zw~O���B��%� _Ȍ[����H�Gq�����1m����bJ�x����!����BRbfv�ۣc���?��E��c{��
�v��z	v)ە��~?[e���5d2�A5j٬�w\�*SPf9h��b��iuc�?���w��6��8��o3,�J�!�c�W'�
La�BD��"�	�~ C�l9#��=�����O��b�މ�y,+*8�J�Y���&��
�((���h��0�k�q��!��L�Z�wO�V�ix��R���T����x�.w*��mV�ȹ���oi�̞�_m�:L��
�`3���X�e�Q�gBS�Y�vf.�~�=
u�u���&��F<:��Q���4��cU�q����3�X���_��7�2��|���P"uŋyڸ��=U�@?3T��f��#ӻʦ&f��r�:-�T߭�%�(lF�����W\s}�a�4�g^�a����ь���X�h��nR�����Zoi/�!�Fi���:.<%���K�妽Jzݢ�8��|��SW�yi�.U�5*�+������CߜS�h�[�Ү[�VV1�`I�h�>!�)L�k�CLK�"�e����E�^�H
���gg�
B�gm~^�.4�$���5��u���?WG\�}�(��gs�I���í�4R��U��X�K��8��X˃p��oC�Ѫ:�X�5��`�EV��-���r���α�K5���(�d��y\��~��o菝��G��QRWҧ���@�ۣ���׎����é��A�T�.&���D	�G@���G�QZĚXPz]B��~N������N�e�A9�E�B�d�h�c&�]T�ż-��_ҧ�ճ1�����н��;��8�u&eN�`���h(���ߞ�H���H=5��h�u��̢��ɋ��CBM��Ps.�zh��K0(��DvW/�(�0�á�������h�����}s��6�6"ӾP%n�E�QS���I�X���;�f6��-�T1�l�l���b���h�uN�z8���|EP�a��5��<-�B�V�c�a��5���h�g�Y����aM�*���!�ޗ�G0�M��tJ�{��'o}@��ݚ����|��ޤ=��p׮��f�jU)xj��N��A�A�Ue&��?VU�f���L{t&%Vg~BN�.C�<E2��O��w�p6���gd��Q:6&o�8�K�1�c6WC�O�9�NYK��Z7�ҁ	���7���B]����8̫:/5�sĺz�^p}f�+��{h{��w���

}>@�qܫ����,����+�5�ڦ�U{�0�G��[�MM��ڻS�<̓��6\��A���z(��fZ+B��w2�'�?ͼ��G�R���2.�7SA�Z�?�`H��#��c�CMz.��tx(�>�S���n��ـAk��R��O>�A
����h�	<B���1���tYpܸ>�wK���*����s�T�־..H!G�(���H��	�K�PCGݓ���y"�Z'�J%�:0SA�	K�aϡ��5�=t���4\Qy���׭H�̡����rR�0���գ���\f�2?$'!��?���f���Q�*�#��'��M�y�c��J��v��	V��_,^&��-��U�3_�]Y�<?��kH-�G���*��(]�s����M,]Eܳ��V`��UG���VW�Ն���M1�����{��*�^��#���~e�x�5���|�խ_����t���L����SB]ኡM�v����O$=�w��ޣ8��m�0;�|UB&��?��^�cj�0�	f�;�d	�xȭ_���.��E��h�I��>�����X@�9{�7W(:WFj��5M�7����#��MvQ�]΅���T�RO��F��w�}q���p@<��f���F�u-��+�hĆW�������+�F�Ҫ��cV+ s�x�܃�G�y4�.I�?�5Cې�5�.ň�FL�=�A�(�0$+�D"��X�Ed%��]�{�˃�e��
C@�)��Nj����v���%�7l���y#)� ;�`GFdAkCÃ8:\5��j��b{�x�ya����U�U2�p�}j8ק��B����
�a�Mх@
���6DY�ݢ�o���Z�� Ηc�E��:M~ᯰl��?�DC!ك	�
�z��N7��l�e�&>����0��"�>����;�!� ���;��՞L��Q���M�����i�	�Vj6˵EB�|��2�L-ެ?�g�6&7-�h#J��ue�c�=��,�W�O�^}�X�B���Bʿr��0��5�[�i�b*d�a)d�	_逺��ñ>!�hJxr�3:�䩪y�b8F/���3F�]����r{&���k�}:%���6��S~�Y��p�t�tz�	d���_��C�ar[TW�e.Z��'Zt��^��}�A|��EJ�ۈ����ry���&���ک����F�x�KنuUU�Lz\�݋Ģga��{�Z�?��~����2��[�IР>����-��x�	V�b�|2��0�%���š�ߛ90AR�X5m4=��j�^�Yt�R��'�mԭz?��F̻;S]c�=�K���C�4��#�0���;C�o�CG��u<�Ĝ����2��l.
k�N[Aily9q�/�s}Pc������iW�S�ҙ?8��u���AC<6�k+@G���91J�S��ߢhLm�vj^��
��4��A��K��W`F�;�l�!f����ʭ�ո����7WT
381,��$O���=�j~)�+VCؠ#ɴk�^U�-v��_�,� �S�Zx�L�B�^Z���P���;�L&�
��!i}����{�
X�5�&
��vH}��R�O{�&��=��c��)��a���ܔ�P��N�sO���}���3�p_�WQԮ��3������geˎ�Ȝ-�e*��y���+�i������������o�T�1z23����^�ff7��*hy
H%�P�8GT�a�kZ^�䈯�dB��?7�o2WTe7\��oP`(�T��)Es���aO5� D���m����e�`�t�ˣ���ec��4cx��N$�|��[y�
�� 1c��@�d�[�}�'��ӷǃm�=�̀=�f&�	SŞ�L$�M�64���V�jMm�Ul�
*�Z�9��&K#6d�B=�.�:��񕑪�;�g�x�`���R#�x�>!r�s�����j��+��f��@rwMm��2��J�\��9	n�L$��iq▌۬�Y�5<o�7��Bd��z+�����۫YVɻ\p��X���Pax٪Ŋ�b�`��v���e�`�8F��%�:]n��
@�Ő��=hrxq᝙L�lN�2�?��rt���v��;�
%���e����^�ɪ.3�<��@,���S5�ҍ�ߓSypa��!g��4w�zlI�t��CSy��|���2��O�.�w�O�VS�1-�P3���
p[�Tc� Wt'8�yh�)�����Z#���h�"�hc�˪����/��Y�z�|�}��N�4��a#ʳC�E<Zp��Z=�8�wekb=�A�G�2V�+��]��F,�����q��ډ���,�|�\
V��Xv�
�Q�wU�@e�
���ij�P�ݯmSO���f��R��a��D����l�����a�?w��/��	���;���ر�[�p�6�5��Q�N�a�3Nv�
�*^`�N����π�}�}�}ʘgG'�[����w|�1�x��cXA+߀�L$��w�x�e��Yj��\�}�06X���1l��o�!6"��u-�װZW��6�_��w������8QIT
b��Z��a�iAW�}�߰�6��h�L3�E�K�,�I��C�B�-��4^Zy-у�4�~٠u�C�װE��n��]�@c�y)�T쑇��o���@�QJ�I�h��TPX�滨�,�f�3��$�w~��������M�|Bؐ&��8H��m����f�X��o�f,�Z���w_�F���,!1AQaq�P��`��0Ѱ� @���?��WF9�5_�{��l~�j�_�:��)r����h����@`�P�(G٧Ex)�!o"�>���z�I�g�&I�u,D�`E�,܊ �aXb�A�
%�����`���@]�敟5_��$��/�v�4�f�a��>
� T�H U����<X.��Q.�B��и�b�J�!{NH��E��l\�?�"��m
�V�P���ݣ���+N3��8��Yar�{��^E8A�guS�G�9��b�]�	B΄^IS��̘
�J�;�;�5�A2ʩʭ�@��Ph��*��_�
�
�WЕȚP�p6�"�%��[\��}a-1[=�9��G�@*�$Eq6��D�q&K�4V�]�����	T-����ݥJ�V,ू�kncp%�%8��
wp�D�/��6�A���.YY�q�.'�J�����l� p8}��f�����
�K�A�BYt-�jp��!��YO�:��.��x#�b����J�MVMaKT��V{>�ʺ���V%EI�=��v-���=(j�l3
@v����",��c����W�x�r�2A���5�)�:��I�g�“Y�'���݉��ګX-�P����_N�,ZA��+(Q/
K �	)�Q~�@09B4)�W��U�W5T_,��L�`K,PD=���M��-���m@�k�P���fp]��en"鑽�C�.��ϵ��?��MF����0|E���f�IK��
@(�D,
��f)p`u"BU�6jO`�A�����j�~f�r l�}�h�b�ܐR1wm��b��}�V��4��JC�Ub�.hQA]ʵ��%��X���C�_50H�"xHz&�>�18��l�gTs�j�pd�6���l@Z��9@"�!v)h���5�t@��7�v�sȇ�J�ª�_̋=D֓.�r�>��:2�Ӹ�"�}G�Q�;t��,��&P"]�%{��-�h;g4��i�E��ט4Q
F�m	A�A�{Q�x�+�WB�̴,�2�W����S*{,ZLMV���AS�UueR&99cE���Q���v��H��F����x 1�A�.P'���Z��KA��-wj1��V�s7xJ�j�Z&��Qk*}0���hA�\g,EKu^g��ݫd`�X�A��࣏(��D`ݚcF4l��V��dV
[Ae�(
�13�P�f�d�_�j�l�\aI�58n�H)��b�(��<`}�2�"��_�Ղl\@E#�C��+ՒD���eb�J�W��>F����ܜ��	���5/H�=>�,��!���xUZ
`2���`�����
��iP����Jԑ���тa��xJB��yGϔ�Ua��F�����7f	U-��њb�Ao̲JV�r��Lc�@G���#t�<�rcH�!���p�2��8\u�Z�6���*!�x�f�����%OdL@���R��V:^5�O��49c��
!���`3H�N*��:��]H����f�שj�#W��1~:����e���.�mʥiT7y�,�FP��Y�Ĕ��m=$J-�~ ���"V��/2ž�������9�
خ%ґT!�ƿ6M�`k$�WT~��&�vJ�'��������^B��lU���[���Ce��B�����,R+��ЛW��,�T��U���7��Jn�Jz�;a��Wޢ�B�>'���S5�4�Z�r��Z. \�� �<KY��w"^�up��g�-\ʮ�E�'y�8�0
�IpE���쉽�P(��g�
���� P�g�|@
b�sE9�@�(
)�ΣMI��U'D-!��. U��4ђ�q2����V��-ʙ�"Pr�����pB� �I��(�$-
u�E��۹��??���v���>_1�-3�t }\
������NL�'���
������?�H��h)<}M�Sv���
��U�P� M�|d��,�4��`��Q�g�4L8D8��Up't��<c�l]5p�h+������?�:�1�Gɔ�4�Gܬe3��{�Dܜ�U|��{��0i�Y�����v��X??�s��}��P�Lk�l0�Y��a$�Jh\���񏛚ס�伙��f�%��4FE�h�ͺX�����>�e~q�`��h.�GK�[��vP�^�G!_(\$-)���O,{�=H9T~�`L�o	/�ǬM�W2���elO�TV��WP�y��˘Χ(e(*�,t��Yh��W�a>o2Rv��{�%��h'�����,=�s�K��� /�w��O+�a�g(��	G���QV+i.}�F�Z��E�*���r�	�Y��E�X|6z�(����1,3"�Q���D���q@�B�ԯj��̻��4�b;�V&ۅѵ�7,�2��T�/�4�p
��D^��du��9XިPGeb�e`
V��]�s�bt��2\�W�W�?�Hon��:+<�?;j��J����[,�(�
�
@�”^�8B-��
�"#�1ζ�8��5�e�
T�
��+�nE1v�[��c����·e8Al���j.��"�߉�P����]{���_����?0"&��,��TW����l& :��k��dFf9�l>��L�{L.�$�}F"T[3���������Z^�ZN�ӟ�}�AXZ�n��Q�PG�T@�^I�LI��x�#�Jk��8���(��?��*c�vg,��w�Q(?�HV����Ar�/{�Cm�0Z S{W�`��V��J��₏̱i��@�Dy���RJ����ӂ4=�l��NT_�*�bj�e@���"VB!ʊ��+3�yf)�m��E5s���<�aȔ�16�X���x`sĴ*pV4ԩ���R4M��8S�K!a��Iה�v��ӑ���U\r��O>!H�o�=�
����~b���$�Q)�9�i+Ų�!����1�Χ3�s7	q�&/���5�9�A9��vkڀ�y��K��ب��QNJ�YC�.9�A����."��1w0Z�uY�1����G_)G�,M�*�f��A����7���U���n���(�'wdRB;��p�GO���T����<�J.�ʎ���jN%:��(�V���}K*��yjHO�1�~��x������j�1��A�[]EY
~�M��\������P�4��$1<E����"+R��ʔ5�"�:��5+HO��{H���}k�s)�~"�ױ�_�[��\��܆�-]
��Xw�2�6�œ��A�G��̢��x��	a[�H="(*tϯ��:�ܫ���uf`��AO��q9��1W��T��>Qƫ��	y��+x �SF��Y��4'b:N��h-+���:\�V?pzy���'O���x�Uc����]l�UE#c�s��j����[w�aqQ蛄��x��Enq(���	V����_�8���y�.��>���a%_d'��)�dG�����P��ɸ��Ś�5��D�nT�u�W���f������:����sjд��\��4����[�.G6*�������ݗ����U(j��s��R�|]:������T	�ptu�P�r�h�߃�s.�� j�3TԆf�R�Q0�8�����Fɀ�����E@�t��0�WL�>��<Mjq,;T�1j�ܺ[]Ku�c+(-C«�
Y�Qv(Au�D���d��D�,�zgG��Ӓ�E�ìS�Up����/�����'3u
=I9�߲oPB���� �%���ET�[j�R6ic�����)n3`����=O���#��A��]%�`�!��2�Z1gU�f�a���l)����{�i�G}Bȼ�3��8أ�㋊]	�*��J5�5z �*��;�ۖ
k��Q>��(�
0_s��!��D�|CK���EI��e���8�
��KȺ/��H��
-�I�����fK�Ӕ�M�#�"�y��,.1īW�GcrP̀6�Zˋ�JVsr�.���18��r���s�������/�38`��
4 -;q�Q��z�5G��^�/>��Q���w�EVw�5�b5�(�P�yʫ�ˌt�ʥ�_��+ n�k�]��-u^a�@I��*�G�kc��GWMy��OPa�)>�J�;�ho@=�g:�ݱHA��8
8��mo�P��/�z�^s-�yb6%-��]୦C�� /�mr*nS=�b�R��x�F���T��j��n��B��wp��r����qF��49�@Vy�P�@
�}�5kA#����Q��	\���r�^#Q�����ዱ����~�8^��y�9�:tDc��������N����"�K��Aנ{w~Q�v���*���IH�{���U����Դ�h�e�ѡ}�
�d�v�
p�{(Fk
j�u&8-��ؑz��Iл})���J���q�J�#(B�|Ev"�`���9*p
6R�XKl��rO�F%-���,SP�^]��^Z�pU�	u�c��R�a�%�o�Q�{���k��T4l�>�
5
RU&ycdO��r�s�G
��<T�8P��WS
�sus��]�w_C�s/l�x*c�{N\�:���"@����ˮ^���ǃ�P��|�O���	֠�<�0��]��"�2�ͫq��u���+���r��@k�Ʀ�T�s���b�KX-15��Z�G�Y16]���׻Z5�]�4�D�Rk҅=�e�Z�?w8����Y��(���Pg�#��]��SO>f���%�!�b=�?�9e�lv���ӛ�|�#K�ߩNIEX�:�>/p`���N�F�-���}K��{=ȭC2�u^��y�@�,�<����Y��Y\ڶ6�������r�
��.
c�7$�&������[��Ǔ��zꈪۜ�
:-_��IS���9��Cf%�5�u{ŋс�@�w�;K�	�E_���FJa�ȱ�����B���2^��mW$N����o/�rzR��X��������þ���\OGu�����Q�F��� ��%T7b�앦��)s���D1�w��A�'���E��n��ʰ�x�����A��ܳ�D~a����2�V�L�A!c�٩�\��J��#�����<��]DR�ܖ����6�h^�1]Z������[�F�,��UYc��l_f�>Up@�PrT(��ʜ���J�^��Q��	X5�Wi�A��s0�mPC�Wukc��4�������2���G�`����+H���`=+6�����B�,�2��
�/��g�5WJ8�	ע&�Q�fY��;��
�Ž��AH��+�����[��Z���*a�/~�c*�^���j���e�k�I`��`�U�*A��r�4�_���[f��זgP��+���̪��Y���BSbiiA(7,��X�,�.Jk	����lСa�w�W)-�V�LF(�on�X��u>�f�:�S���]�ؽ�j���6�K�jq.�Ҥ�=fΊ/ mhX9�rR	��*5ܾ�p�?H��(Ѯ���
�"�������" �\���q}�kK�v,�,
<�?*:]��t�G�dҮ�SW�.+>�{�m���l&�}��
Ih�π@�ĥGU��9UC'0Ӫ�zEw�Q`U�Ÿ'S2�oOyiY�
tO(?`|����azuf� �.�����lU�LmR�������a[�j��f�zQ��=��R ��b��60
z~��@^�b-ɰ�~�j+��X�H/�_;A; z>
��_ĭ���|T���M����w�$���0T���%���5��?���3α�y-Qp{"G��=��_J�Pn4����z���c��<����E��
�مX�#��"rF�����E�Q5"ح���'�戴�8�,������ކ�A �`"f�ₒ:��/�u��R��������R��AV��`0IJ�twtRG���Y栯 ��Y3� 
e�X�05K�x�)���7�
sXP�5��Z���o�\ynFʸ#.�,+��@M�Inr�mK�d���ܡkš��d5���6Qn4�k�.MӁ��(���P��JZj�=N�i��s0ѪU���kPc�J����<�YrŘv��LL�a��,mfE�X �$i�ƾM��+�[�̠׊��e���	��`2�J]���?�NoK5�oe(�ݤ�t������N�
	�H�H���Q�gH�hd%�r���q.�2�_& �8.�w�J��7��X�w���-�U�
�G놙|fV��M�Q5WQ4{�R�� ���+����U���ɐ��l�`斺� D���Z
�p# ��Eɡ��K7��S�V��+��3g|�&���)W �$-�Y�Y���
@&�]���2Z�\��\�Qe�&]��h���
��c�`�<#^b���9��b�
�g�f���0_y���kS|��m(r��.���g�L�J�VxL�&���8:��lit�Ar��̆j%
9��i�	������_qL0�|�Z"W��:U�(,�;Œ��������C7�<��†{ț)@X�q����j�Z�,y;����Pe"#�PV�
�	ׄ�|S��U��QI��j����U�-[�ӣb�Dq{�e+�i��@�/1`~��lA���Z
N
���n���M�"V|2�! ��Qb�e��y;n�%./t1�	2��T�c����q�Z����g�ʶkQ5v@R�Kz��²�x�@�%�PE�WE��@Tߴ;ubƜ��u�S�����e�tE��5~��&%����A'<�����'L%k�S��p�ys 2M�E-@P��""X�b'	̵�n�SVLy����F/׈��i}�KȞS�ф��f���u�4�
:�]��Gj�� �>��7�
<hr�:�6k�!�&š�����qjՋxRbG�x�F��"������F
�z;?�"�5
�Wg�W�<Ԙ��YA�(�u^c`_0s�v��UT�~=KM.�4%�4��KJ� �\-X����������A���f��Ө	����.9	��Y@d 
Q���pAD��:BB����=Xp���
0�� ֪
�܅���9"Mg��XZ&���j�	b��q+��I,
��uetV���� Ɯ�^8nW^ޱ��X�2�ڇuk��x�P�Z��U���*�%&*U���0Q���|��
�x���Y1C�q�Y���
�p���1�K3��H&rھ[+$�`��.g����k�~�4�[c���ȷ�hR@�(���g3��M��vV����Ǝ� \�HT�
��
z���']�B�m⨭��	4�z�$��i�e)(�QX�ˡ*DHڷR���`0�clS�ݎ�4M���nzA�x;PO
1=�a9w�>2U�쫪��DL���[��|�s*�L�*;����V�xPI�F��Yq��l��]� ����k m��\�h�l���.�f�V
~"_�ږm]c���Q���򰶖�!Ij������4�Xj�R�p��.O��B<���fJ*�P�L�EU
�+�c�0��$��.�ql�5+)8���R�v�j��$�=tfkv��d�:*���0� DE)nN0C�
��\`^b�P�"$��)_ͽ��W��En��[���u��8�բ��+B�B�E�5_���:���p��%�A([�2S�J���%��lYn��IC�:KZ�h-W�To�� �%'0x	v/oD��lL���17!]�+��#Q,����3݅3*������Jh�x����
}��K�(j�T�� �(��l�ڧ�d}[�e�D�(M�6�Z�6�&� 9�P,x�)����B�E��U����K>gh�FU��X�
�#T
-J�\�i���pk�z¾�{t ��(
Һ��������(GNb{�l�Lj�ֿ?h]�D���7�x ��aAe��#_��/!1@A"#P $�4Q���b���b?X��&�?&�JD�<�CsP�G�y|�)(��.�U��d7}���f0�縹4({v��m/���s>��V��W��*}C����ۂ��ܴ���["����X�����,z���h�l��ۃ���o�����Ԕ���h��D�
�F�3��Ī�ˈ�)z�{Y�굔qa7M+�G�D��s����#whޫ>�ۣ�]Z�w!ޯ[Sw�2�!B<�U�e^�DF+\f8�x���D�:P�{]I�����k|ֲ�l�^�߾�>���z��%P��W	���{�Y��*b��d=c��R���@� ���ƽy�q��-�x��x���ąV�'&"/}�9�3"�o�յs0�R-��yCP���N�fOd��D|m��׈З#�͠h��{����9
ӗ����|�_�öQ�Q�L�R&)�OI�	�l�o�^���ԍ�,�BB*O�vx+O�">�Q"���.CK���ƫ�%�O��w�И'�Ac�Hx�Rn�Z\g�n.Q|��h�u���8	����VWH��P�ѐX'�������
2y���y�gn�Ĵ�^L�OSx�Չ�ԧ�10i�W�N�rDŅ�D맹/s�Y��K�$��d���)�i
��^�l��@����Z��s�|���JP�|i��L�ˑ��<ꨘ��W�[ �9�_�k����9�c�N�
@��&��:h>xlc�}+�gi�9��D<�4�����Ln��g��0���:���Yύa[\�i���d�E���$~���*�*�T8��	?8ԗ�Cﮘ�Jxf����c4��|V��4ɒuu	}��Ւ~G:Q�ˍn�d7,�[s�3�޿4��}_�!�/�
B_�P}@y�5(�����1�U�ɱrt董	΢�u�O�+���b8Վ�96r*���{�s���W��s6�������v�lC��E2��X�n�__�'e3>5u���F����E2\��,�tL&W;4y���IQ�J�����f1�*���Z���_g?��Y�V ;E\M����ކg�0y�՟4v����y�>���[�:���:m�4��~F���X��<��� ��Ɋbt몀����1��y>���ba�$���#Ψc�\[b�~�_�<��X�˫E�X��=����ǹ�m�T�n7~�2X��J� �9<y�Wx�ta�t"|^5�ݨ7���rJa�mw e��D�v�fݧF��ث�J�R��"&E��<	(�Π��AksS���+W�)j�j���k���%zÇG6;j�R�3�X���З�r�����ݬi�ocr����Mך���.5�b�*cz�t{�_��\�e��R�l��?]����!O���4�ż��+Җ>��35����ʼK+��CM���=jV(�2�u��y ^Ȣ��x�O�ū�S	���0�2�\Lk�ֱ/N���[�p�m�V�BQ�n�S�֑9͕w#�A0���ݥ����-���)�#ԇ��M�O(�m:8�vT�ܖ*��X�]&j�lcmF�Yzv}��u��s	^��D]�*��/�Ovz�A�lĘ�ٳ3վ�9�޺��;��2�s5�:mjԢ�+^���r�:�#ú��c^^�iLLʟh��t�y:l
b�?[��uo@�ۻ�֨ȱi\��71$˺1j�ChY�`K��s7y�-���a��5��ױy�ަ���|xx�F�oK�Y�����'(��D�s7a">�����}1��Y_'��E�nU�D����8�ؖr0��ʱ��m͗o)0N��1��n�_�ezS����j���#X.��A�^�����=1!AQaq���� "2R��0@Br�Pb����C�3���	?��!8�טH;GtR
�	X�Q�!N,�E(s�r����
�DV_!���(I$�����}�;OZ���o-���Z�e?*���DR���,���x���kd���T0P~qJ�X��rzӽ�
��ϙ�@D(��[�đ�YR��@ET��~D��>�twD����~�̀L�Ě�lZ�+JO�0QQ�Ԛ�<ʂ���Tf���;�8Ј�#h�݁��+n��6�&Y�0~�v�Y��������H�nl��z��+�,	�����I��pK�ؓ^0X;�p����+�"C�äi�A$;�"�cmc$�sY:�'e	�y�M��L�"��$�$"�Ű�=���;����]��
�C�}r�q�إ#��	bH�5v�\� ��]�ԣ5*��&���b�JJyMC!W�I�\��j�n��$���^v1�A���?��9~2*��Fp:>:Z1�]G�����x/�/x�1��j���\��UX���!N���χR�U
�Hg�=�vU��B�H�J�&��1��4�}���'���S��<���(%�"	{dZ]N���*3�:&����q}���*,:��Z2}��f/>Ӽ������p�S)94��0֣�{�y �vqh��c?rO�Z}��>F�����S���;�����Ȫ��n��H�LH��jk��X��	��.�jUn�M'���֓��=����(�ʆR��C^�(�J���R�u�m����qJG�c��	5��w��Q'༲<ǾY�9z�ֶQ"�W4���c�u2(�j�iy�r��c�`"xE
?HQޭ�[0�{ <K&�P�XE3��<��
Vj���saQ#sE��0�F�ǣ�e��%��'���x���8��D(o�>P~���9&g
��,|J�+�$��R�I<�U��'��OR�M~"��$8�a%_��MC|S��ч�lը
D�<kR����S�ڥ�ă�>Т�"�
����)*�l
�RD��"�/2�}�ƮC����ú�h5�0y��3�Q�;G}A��>�e_)cqYjI{R�3g�(Җ�N6��ar�Tj�Ҍ��L��[I�'$Uy.��*R���[!��x�RtKש��lCCA
lY��o'N��j:�
ɲfvq�� q��!�O��b�����b��@��͛S���֞�߲ܡJ6 �(��JҝY�Ʉl�������s��mG�Pׄ��l�b�F�:�ґ^E���R=]�&�,#Ԍ��Xf5��/؋;�5���Gm���Z2�q�`1RDɐ�	�%��j$\�`��8
������ꁳF$�-o8�1�G��!i��棭�� ���<#��k	a�33���'�:�	�@�hY�Zu��z)HM;��ȥ�
�[��뢥
�3׫����D 
޵5��HP��
�{�'�&c�q./`��T�YG�oLe G�W��:�,�$�>Bgy�G���j�/r���	��"�ٔ�Y58#��
��s���E���s~�k�����3�Y��d	��liBJH��ZB��*}���6"$C���i�zh
1a���o�6��qD����w�d�mg�㲑i�Y�W�#Q�Vٻ�	�W,I�;T�ݗ���C*�Q��,~-���hj!{jQI�@�ٷ��+ק�	!��Ox �0�|Ύ�p���v(���'3i�5 �t�9/\��|��+l��x?�#��0!1"#@QAP 23�$B���bsf��č}�eꡒ�9!r�i��.Bs?�����8H�=:��W�%�M��ծ������88�*T��Z[��4+YWȳ�y��&��#8w���e�&v�_a=�%�>X�pk���\�A���)�m��y-�r4Lrf%�,����1����s�!���
{f"O؀�����o�m��iH�^��l�P�q��!��qS�9�R��^G�~`t\��ܴ=�s��Q�.*X�u�ۓm��/�vF�{�^�qƖ�X�j7�
�<r�3J��
$�A5$�����"S25�Y
E ��Vh�>���yʟ��^�X�%�"$2��qZ����(�)"��i� f���ToS���>֓4g�[����Ԋ�ռ�4�}m��V�х��&Y+��n��ryLG�-ȣ�1R>*�T�+R'x�5��CJ��X�F#䈃F�9�,f6���`��	���G�?�3~��Z�yy�FLj%�i����B��W0Ϻ��iNk��\��s�w[���t��Qr@����K5�=Ӿi#�,=��s�"(��4��q�H��v#�(8�4���v)�r��\ʠ�����L>�mi��8���G���ᷴ�B��>Pc���q^���Lg=�%@5uD�
@nyM��Z�,����=��d��N�F�%,�V�p�YyĭQ�{1/Y�T�@*$PS����Q{v� �BOZ^�#���e��Z�mZ����ҔQ�]{�Nب��q�ח3�t��GdPpN)��
i�9�=�,�{9
椴TB��'!����#��=7[x�.}D���.���+�L{�Rw���ū>%v]rP���o�9��Y?JD9ɶ���XbC������ۘ��+<�[ؔ�\K��O��:��θ���saǿ�qԺS�qX�Gi��[�N�(���@��#�u�!��rb�g�I��?���x@X��\܂�8�t�f�(���
�!L�s$G�a�M=%��%.v�H��4K�On+a�dqJ��FO�V1MEI}l���ͻB�j�V��W��DSZ��avc��j,��)�<��Y��K���8m�,ҟ�rD��e9CaϹY| =.�d>:67Jy#ܷ�j{r�����H��m�X�c4�@�I�=N���9�IF[�Qg
���mS�6��ȞI���E
�F����`e�:��0�YPAs3��p�;�FD�������u{��[��6,�Lϊ[B�2C����,����-��}��gӦ��{�<eȫ�6��}]���&e��g����]'p�f>���\�7)���X�Z>��/ÔFޯ�9|��06󉸏�Ίc������v]8Z�4q�㍦y:���Q{շT��ך����O�e�Mns��<�J��x��k~m��
���b��l5i��)�n�n,�(a�ub`�z�|�1[�Fm㰷���5dJ3�~��	�[�2\�8�Ͽ�h{�Ǩ��VaP
����(�f$��9S��wsC���Q��y#ڃ�.��1`�H,�:MS^��Mj��o�_� ��#��w��]8��3�<����A�	fg<������9!1AQaq������� "0@2P�BRSbr��‚���	?����#�0	�VYϲL��lzl21�)�T\n��x��r�<��<��L���D��	�Z�c��CB�A�g��p�p�>�?�5]^
z��ap�je�>�*�@�+�ŧG�.<���Cu��:�
�y�z�Ԍ9)��$��M�h�!!�����I���ݤP����n�Ů̎h��^N�m�j�Wt�Qd�<�!�(21:՞�Ő@�t�oJI�`�U-t�S1�;i�œ��WX�[2�H{7U‹�~� �Gg�a�ĸ�{tz��fr�)�"`'�V�Ɉ��C”8�����_�k�v�M��,���Y49�8ǿ��|����q�ݑ{'�R�9��@��]�6D��yyLUg��ٺ��@p;��H�t|�A���Uy�aȨ����w�H��#�<}���Lqj2�-^\H���ɼ�$(����,@���/�K�_5Sht:�0^��h�W���#�u^#MqwG&^m$�E��Nxx��D�мwM�����{�裮�R���	���T%��j	�� 38�C"�v
�*���
�g��4�!�Em��M��!��޼0MA��Y�ST���ˁ�2]q�?�u�$$l�V&8���x�"�=T�
��$�/���4T�\�i��\7&�Bx�8��s(>��$w�a�;�c� �&����h
^�5��"><�0zhj�I�͛��x~4�a4ۅ�%�5q9&�p�&.�$jPi��x��5'�ǭ#
��QED�
J^k<�k���2�MVu�Z��M^�ZP}�,�F:�H��0t�9�4h=��Z��5��W������Z�25�b�����M�,2�Y���F�Hd�k5^�w�2uv�B�&�J�yW�J�z�����E��!�T*?Vt��-E�`s-E�M�^��8�5�=��ӓe��0//U��%PR�:�pPc���P�2
�c
gu���}��#��n�!4Hã�r�5R<>�\��8/
7������woocommerce-blocks/images/previews/collection.jpg000064400000421203151335517640016320 0ustar00���JFIFHH��@ExifMM*�i� ���8Photoshop 3.08BIM8BIM%��ُ��	��B~�� "��	
���}!1AQa"q2���#B��R��$3br�	
%&'()*456789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz������������������������������������������������������������������������	
���w!1AQaq"2�B����	#3R�br�
$4�%�&'()*56789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz�����������������������������������������������������������������������C��C��2��?��(���(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��(�=h��PjaC��?Z��	pE|֊�M(��d4S���PCV
(��Q@?�oO�S(�h���(���(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��(�&�������^���|9�-Ѥ2�[���G`�1 ����x��=g�o���5;�7K�����i�V{�h:��l����-YlB�y�q�%�+F�Pod~��_����\�ض��{��?�2���
��5 ��D�ı�fF.�U'
\�\��y��q�Is�c[��6
�dj�M"}�|b�"V��B|�i3^�#�:�������	��[�6���lo��XB��sh��>d�@�ƨ�#8�O�[w��/������|8���k��K���	$nW��H8<ԧ}�N֊(�EPEPEP�O�AR���SaEP@QEQE
n���(���(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��Ƌ
 ��(QEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQ_�������_쭩�^��������W��^
��5`�6�̺M�m Ug��B�k�W�+���lq�{O�'�W��������ޯ����umeU�)��xm0��چ�0�J���FO�^�dy��m��ßQEt���n������s�2_ţ|j���xG�W4�iK#]�H��m��i�3UA%[u��?�?��>���,��_�h/=�]f����帺��$����B
�w���t��>�
��#�SC��Fb˵���Fk���@߅_���,���t��8n���-���~k�x�'
+��"���\��?��e��_�eO�$�Ge��I�IU�<�uv�²tV?�Ib7�'�M�6�О>�mC�W��o�O)$��ڂ�r��X,Zr�|�ݨ.J���-_r-�PF޼T���q��i�8/��շ�l|�#�sZ�Z����/����?��<E�����Z�Ho�Y}u�<j�E��h�`�Br��,Oں7��m&�;
+I���!۲x�(�b�\"�j���Uؤ�#�j���;=��a���,s���e4!�҂^�Ǘ_V���Ur}�lښ��$y�"�A�/��������w�K����Bҭ���̻�%b�F�����rH�~'�޶�1�ʇ����P?B}M~a|`����ƍ�w�b�-�/|S�K����h��ݨ\Fs�M�Y�
FzԨ’S��w亞#V�t������@|I�~	�sZ׾0���v�]��͵�ۘ!&AWL2�e�0�������Ŀ��W����ex3�~�u��*<qq%���uhRP6����,�[dD�F�k��?�W���
|D���gw�Dx�·=���-<?d�q�ب�2̘��P8A_��!��4g�> ���M�is��ڧ���f6��wtۃ�F8���Q�T;h������z|;��/��R��;���0�['���7k>�N��]���4����6��|����^(d��fM�\����x�z0s�g-�?��n��k6���}��� ��p� �) ��_�'�e��\��m>�R��mG����P���K�=1�1&c3Z�LD�#�Y�ƿ����O�~�>"���B�.>��IN�n��.��+��U���FW��xN������W�U�v�O��;,�2�12�f�iK���^���9E~k��_�To��˼��vO�w����Z�g����x#"OnK|��O��O�E||���Տ�)V�Ҕ$���(���@��Bp	��徔�(�����(QEQE
n���(���(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��(�3MwH�s���������
_�~:�E���9�@��ג�PD��.�Oe\�8@6�ަs��NǥUK�B�K���R��N��R�Mp�j���(I'���_�[�/�"��A���#q�V|PӦq��ڄrY�{O�<)��v�M�HvD�b�v]˴��i��Ko�����)/�y�?��j�M{q���Ri���u���.�[���y;��Ϙ�iNNщ�l}j�����U�'���/�<a�VxV}R�$��t���K��FQUl�l��@�c�9��'���?�0��'��Ksb�26��vmDJ>k������,���;�?���"���q𵶧hd������ﱚ���p1�Up�W�'�����
�]�@��66�N��_+��Pm€1�WZ���&�6\EB�Pl�~��N�`���o�ߴ���u�.�P�|ʒ.V�B7���}�":0t�nV�|�*�v������h{��	�9�2�M���m.�\M��{S�"��<�����o��&�O�?�"���_�{�S�/�\�uq����r�<�T*�H�H\�M�1���O[]y�\֍[G�~{ӈ��!��>��l~+�,�x�l]l|C�\)K�/Q
��0pI��J��@��~};�:�z��h(��d�Q@Q@Q@Q@Q@Q@Q@Q@Q@Q@Q@W!���/�g�|G��'�l��	[5楩��"����� R@�����z������i����ˬqC`�������I��!��
���>
���k���4P�nF���>�o��6��@���I1�'����>-|A�����^񝶳��%�Ӵ_�<�3x�6 ũ�-C:i� C����Gޯ��?�=/�z&���P�~��YXZ �!\�8�
�2ps�k�2n�{U�����_俤~y�|yO|>ӫ�}#�o�eױ�_�|3�-a�Y�F{��s�sĺ���gW�s�&����{張!(c�(��QW��qE�����=sW����_{N�)�S������U�Tu�r��(�t���kF�csU?w5�go�{�+"i�Wб
�H0h�Ȩ��n�o�����g��Kx�8��pI��r�;��](�ݜ�}g���y{(�(�#ԑ���I�\�S�ꚝ��;UyY�;c�4f��T*�N���Ʊj���+4�d;D��Y��:g9�W宱�-��������f
\D�%�u�<𒺱Y�]���3��Z00s^�Z�ڼ��]�C”>�6��8�/�v�.��/k:�į�O���~k��
g��uoX�Gs��,�zS�a�L���SֿK>��?�	xV��~
�|3��Xۂ�iPe�Vf�i(��ś�$ש�!�U��O�Z&��Zh��V�^�j�a���/oS�^�������'&�>����>��JPP��5�{�z]��V)�[[Y��{Ku��:"5�+"�r.Q���>�*�V7�j⚱����7�	࠿���:1i�>���kk�5�7���
�HP���������q����¾-������[��
\�����^#����Z4PO�UR�J� �!e�~��ӿ�e�=Ma�t�lБ��9�u�{���הf>�NZ)?�_��&u�*�j�*����f�'�H��R�k���A���U�پëڸR1���9��bT㠯���3�
?��U�5�A�Qo6��<+�i�NеHA���"-����R\���)�y�ۉa�=��T��<d㯨5�/�s��h����c�?�wR]��_B�D��v�a�OF�J�8�(c��v}�Ͽ�G�n3'���5=�_o��F��[�[�wi:]Zܠ�9#`���!��#�GZ�������k_؆��H�WX��gR�?��K��񎚻Q�^�O
�Ŝ[W6��@3�������l�����m�~��5��
oJ�9-��˗]�M��:���`�c_��u\,��egӳ�g��G��s^�
;�[5꿤}ULs�=i���ҸOboA�QE!EPEPEP5����(���(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��i~���&�b�uf 
~@�{W�|�ֿ�k��>�	�����zG�W�G����}&��b5����n
4��~q(
6�Z�b۲��^4��'d}�n��W���*~�?�߄��i/���<:G��2�XY�9eY5K��DI�J�XF��Fj��¿�M����t/��T��x��:{F�_
|7(�@�H�Irb�s�H�#E���K��?�_�(�	�� x7����f�I�
R�>�},���\m)mPpNI�fp�pr�9_¾��轫����c��)*+�v"�{�x������:�_۠H�t[H�bs���Wy�,�%�$��ڛQ����4�98���+FIݍ�֯EF8�Z��B0�Q��1Uj;�W7m.2��KmtN��\��c#'��]���oU�.#E�략�Vk�;p��Vr&�:��ݒ s��p:}zU{;�c2�������r?�U�Ւ[�Nڟ��1�?��K�ڗQ���~������c���t`#i;�j�¨a7	F�UÆ}��C�4����S�o����׼��-B�e*YVE� Vp�D�I'k+�Ԭmu+��u��ԡ��x�ed�U*��ꬤ�;濞M��p�����������y����o�����<��4vB�:�`w-�)U�#'���=����3e�j=z>�5E|��~�?�m��zgĿ�> ��Bj�̑OI�
oy
918��J��ӌf�V�̠�@���J($(��(��(��(��(��(��(��(��(��(����5�'�z.��-{P�I��io/.�`��*^I�Q�{_���߈� ����JmkZ��A��>�[�A��H�!M�1�Q�0t�i#`�ybݰ�A��]?hW�w���_��&�����]x�O�������� YSV����o�8=W��/�hzF��i6Q���l�Ӵ�XT$v���#�$PTD@�9L����_��N﷢�ƜV����_�]�_Nھ��+haX-����ā@Q
�����c�?�ڶ��Pv��Kq�k�eV��Ge��<v�q�1Nk@�#;­�?Z҉w���:�r�I=X�������8<�J���Ȫ�.с����{��%Qun
Ŷ�Ҿ`���i5MJ�N��Kaf�So �'#�N
�~)���šو����H~�_�c�L�S_�_���o�k�O�_
.����it�;�e��v�s��1KP@S�FQ�^���y���|�<l��T�����d�w�KS����~��o���V�q��*�#x��&A�K�K�ZH�WΖ2ԁ��خ3_���x{��|-��z=���%�A���G�� x�$��I�y�9���Í7�zF���6�̌����%�n%<�I<���'�}��(#�R
�:gVm7���/%���BK��q�{����};-�t����'��rI�$��m!8����\�k�{��ր�j��@�<R��n�dt)F<��9��3�}�a�v8�㚛�qRݍ��wSF�M��U�A��+õ������|��$�����Ǧ+�����5�\#1�''�~�ن���<�u�F�B���1��0	(�
|��W���7I��?e���k����y+}2�&��ې����g˺]�HW�C��W�����B)�g�Xn�J�x�UWO��yv"��ka��%�Y�^Gw��L�!�Z���Gi������pˠjr$V���4i7��o3!+o5�A�O�m=_f���GӼm���&,u��mWOpw	-/#x_��s^���ؿ�|T�`����v���o��?��[�����f$o1��m`�ȁ�n�_�g$�;��'�g�/���j.Z�]���?��~��E�^QEQEQE[����(���(��(��(��(��(��(��(��(��(��(��(��(��(��(��*9fH���H�cRW�_�O���S�|1��|B��?�f��<dK^�׌Dh"��c�g
y8PMI{�5���{�
�yx��g�<�5��w	�~�_���O�,��-��ı\߮�*<L11 �0�Z��b�~�?����_�5��5���5[�J�R	�ܷ�bBNd�I��a�كⷊ~+x����Z�A|K��3��E�<�����y��<�(U
����녯�<y3x�GI"wFV���ȧ24y˃��W��a�W������Y�6u%�a���H�^��pބ��W7ryq&X�s���gH�
�z���[�Z}�bH���&I�2�R��{WY�6�,0�U1��5��y���6ǝ�x)�U{���E�ƺ|+ak >kɂ���Uy��'�'G'����:!���جY����*�8��߀��A݊S��&ݎ�F�FA�r
?׊Q���NCri-V�9Xc��q�*���đ>ɗ�A��Ҵ�]�j��FMTt2n�����%
���oğ�/�Bk���Ɵ;j:�zT��Z�Q��>�����$���N�%OJ��������c����;��xW\�}��?��c�;�
���R�;I�r㑆�]%Nwt��z�Ͽ������A��|9���Q;鷎��]�F�ھr��[=pq�^~+.��K�=̻:��}Ws�9x�h\K�YNA��u=��Oo�����ѿ�߷'���U�(
��_�:��[��v�1��C��.Uy+V��j��!�<��E�[�>�KE%�
(�����(��(��(��(��(��(��(��(����9�?�k�)��w��<��<Ү5�YD�2C:[���L˲4��q^�_���S����L~���o����/���R�L��s�ze�u�u���x���9<�u�I�q�wn�&?*V��M�^�9~��{��|M���<����jK�զ%��7B¶��:�P�Z��8Up+�B}�xک�%���/������V��`��~��*Q�N;#��Zu�J�M��# b�]6p�.9�=;���rps���ֆtJKd�<b�a"�rj�P{�
/�1���NN�Ӎ��e���u;��-纜���6���FN:�Ԓ^��Kdw��ג�Z�*�^��8ij�
b��}�R;c�Ps�]�l^.0�������5=[^�55Ӽ;�+ȲNDq�o,�Ĝ(
�����|k�xV��g�������,w�ǂ-��{m�]�>߻���p��P����5�OR�>�WP��������|�b#K����7�$���yk�_�{�i�x#¾�K�:�c��A� �KP�'$ױ����W��)�>��3��Rt���V�('��-=]Op�t��e�#��>�yo�'�j&� ��9�ի�H��srI��"���T�-���Ч� ����I�:�rJ���-���~���ҩ��Pn>^sUĭ��泼�|��oZ�9C�Xr[���t0�<�޴>Ҡg ��Uq���зe�=+'H�"��Jrݸ�>�Y �9��_n��i[F2���J�\�Ri��H���`��m�� �8�F	%�#��T�\�t�C��H��|?�_�+��x��.�����cU����fHo��Y~a�;��@`��+�?%O��gX�VF`�H��(U���U%c��j�z���v�]���Exg�����|v��8��usm}�wn�>]�N��0����Q�~��.�W�
�����c;�Q���H?<�HN����o	#k�S���H���O�?���%Jr�-��z�Ҹl14)�)�$����QE��QEQE[����(���(��(��(��(��(��(��(��(��(��(��(��(��(��(<Q^o�s����_�Q�W�Njl��_��y}{ �#R�W<��R,ǀ	�'��k_���w�|m���Ek��v�gi�EK�R�#4Vv�r^i�c�v��ҿ�������|[���������;�O5焴�HgQ�t_�M�x���۬1?��.N���W�Y~؟�Y_�����J��g��W������$Zl:�l_��O��D��((*w`��|?��Lx�z���?ۿ⾿�L|b֡k�WJ���Э��ab�$�!��3�0Q	�����+��[m�z�q���G�S�{j���^��5��k?ਫ਼#������/<B��-�)�4j���r�+G��2|�>�%����,�{҄�
~$��F�%xl�[/��.Ty���G<�H�]�J�*�B��Q�۴>O��D**�J�e!*�*C.FH9~f׉�N��V~�/����7�G�I����ٴ��%h�4e�'1��E���O��ۙ(���Z<_��vr_q�_��	>���X���k�����������7�<�Dfha�dG�Ϟk��~��h�b]Iu����(�–-�!e�G��I_d�+DH��8�6��<?`����-��!��4�L�Z����H�G��0�v�1�+��k�)��c������,~6x/G�1q�߇�fQ?,�63<�ybO+�����S.�=e5����iUvU���7�{���]+���w�k��l��qh�C]G�!p��F�|��q o���Iu�|
�Ŧ��W��ˌ�O��]�O"fM����X��σ��O��a�x�Z�O��~Dv~'�n"6�<����GYa�$���O�U���_�mu�|=�ME�K����m�"�ѳ2��f�nm�T:׳���_3���	��#R��[��7�
��FU�#�F�=�^a6f!�DFʳ��7��W�|s࿈���_��i�7𾢡�
*t���Ou�2�A�s�Q^S�K�T���7h��ŏ�>��"k�>�X���\D��r(# �W���4��]K�����g�k��js��$!��$eSr29�	|��sԎ���n4g�mz������2j5-���~�-���eˁ�~�߰v���b	������Tu�q��yRIL��?h]���G?J|3����:>"4V7��ᖶ�a��>D�S�f��c?�w��K�&��*��=LM־����p��5]��8⼇���+�=�w_	>1xk�D3��cF�m�Y�cv�G,�r2T+�[ ��qߵn��8�M���GP{UW�z���V���E4�N	�NۙJ:�ό�m���?���g�G�c{/�E�/	�V�ywf����1�YG�/���$�����{�,~���l/�n�tmn�I�5=91o���&D�0Kd,U�E����s�w��*g��o�G�G��*�m)�~&�1�,to�6��m��	i�qxUV"�r�����s:��b�O�ȱ�����{_�?��8 �+�🉴�W�~1�z���Wao�Y\��H��5�'V2�0 ��zg�p4}���ER$(��(��(��(��(��(��(���_|!�?| �����m��ZEα~э����T^�퍪��N+�;�1�w㓧|C��>2‰���Շ�5���c��`���������c��^�k���|P���0~��)��~<u㛘Ռ�^�'G�i!���3m(`r���ܴ�{+h`��-m�P�ƃ
�@�8�7���^]4_=���?4���
z_-��w�E��*���^W�H�nkA�)��{Vl�gp=�8�������B$�B	����Tx���Pd��֬�˹�$��U�I�P�1�UY�%q�ڜV�s����Y����ھy��,z���/��*�#9$��s��XiW�AN�R�<g��~y~ԟl�	����1U'�4K�K��>�pDV��	l̫���O�a䠝Ymx��r�㇆�i,��n�4~�?~%�-u�߃��|<Ф�
n�-Ƥ���#��j��ҬWD��*,0��! c$u$z�_�����q�k���%���Ĩy���JӶI�Tf�$�t�.�?1�	�ӟ"S��O���#�q��'O�Q^��7��ʻ�-�<�7wg�RHN�{���"&㞀~��dqɶ�Qz6w��W!`V�U�����)@03�y��I���z՛u<�a�'�MkB�Fq�Ȭ���賓c�=Z�{g���|��8�4�pN:ϕ��R,��V�M�#�
Ž^�9#��M�i��e��Ѻ9"�h�rEC�?Z�N W<�����\w�a�F
���J����8a��t���uc����_��6���l�ܾ��~Ξ4�Mm�P���ĩin�p�3�_l�S#!����,�-�+MB�A5��K4N:2�py�~�ӟ�5|���qύ�+����셡o�X|��<���	]������:x��S��0�[[�;����,��O3��!1*����U�丫�h�K�_���c�
��a�����Z�w?B(���s�p��(��(���(���(��(��(��(��(��(��(��(��(��(��(��(��(��>�W�s�)�T���+|N�}�4xs�LJg-S�mf��{M/V�&���odRG�#
�V#h�ο"?��/ů��c����|B�s�O��j��n��6��FVǘo��H�MEX]	Z��'�~��xK�5��~���k�l-�<=mp�ҵ�"A��E���)��n;k�?R��T�7����AR� �c���+o���j}_���t��?��Xšx��ml-n���dC3�1�A���A�c�ύ��t����5��~!1���kw�e���
���G���K����w���SJ55�O/&~[�pˮ���>���o�?Po#�\��/_A��&�q�J�}7O�>�a��+�?xkP]������ZΙ#trD���:�q��@V�s�T���_aKNI3�lFUR
��徙@\�c��Sa�gF��9�'W����mm�9w��}+T�x��[I(�>[g�z���S{�gV���{�|4�"��_�[4�6�J������x��6���'��w��I�oTՓ��/���c�5�	,�__KP��Jm���0%s��
��8%�v��$� �����:D�ı�\VYF���=}���ٴ~uh_?��IJ�k��?�P�Z4N ��E�׭mІ3\�y3\�S;PK($Npk�_�_�Z�س���������/5��{��M���[$lC*y��H�#=�k�QL��9��3�q�cҼ��W���_"��<7�k�Y.uk��g@��*�@b�1^5n�w�?���>�
�Tݖ&��h~��K�_�ψۼ�[�~.�����R��L	B�A �]�n2+����*�͟-���ž33�=�My�[���ܱ�e�qbۣel�y��]_�	E�k�����T�k���Xn�7��Z�W=V�A�D�O��6.�\��No�_
��f�)Wğ��>��1��4��2¯p��cd�mL��t��g�G�03�y}Q�'��!��W���5��g�Z�W�U���v..Z ��.Tn�w����n��7nG�/�(��S��7�]+�߃m��Ae�-PU��̟d�<�u�4i��?�K���>���9�eh���n�/�}�����GQ�GS����،���м7�ڇ�+'��o����/�f�}CK�m[G��vc�'vK��2��ϩ��>(��=��uW*����Ϸ<����n��k[Ko�&��W�< ���h��NZ6��ʣ�;��_f�W��wn�~��.�x"d�,X<�.�b~Li���^[���׿o� ��+�`|C��nm�����
M>H�%��]�i��;:�Ĝ����6H�qs�xM็$Cy�dE�m�#
#)��t9�V�����L�o^I�G�|Q�o����Ma���n��L���^FVX�#��8�n��~�G~��	Z��s�x��w�i�0���ʹ8*V��*p@=���O�߲7�����_�	+�}�Zi�uχ^0{��5��GKk)�l0�#I<��?�Q_�������Gƛ�~��7O���L/�����۠�M��gx�G-�{��!�K	ޜ�l�p�Zq���ϰ��_���b�x�7s��li<��+��)��i?���P��ѷ���.�*�V�����|;��<'����-��D��x���X��O�Y�6�m*��R_0J�ʶ֛il_�J������#�Gּƹ[�c�p�禧�Z(���QEQEQEQEQEQER$�K_;~�?���ǟ����&���+�_$�	R���PӴ�V%�79#4�&m��W?
~
��~��P_ۃ���U��O�nl~xZ�q��Iג�ύ�U��<���e�d���X~W���M���c��V����|qj�+֥���^�.n�B�-�7M�
�W�9�<q_��irQ�|���~��}�*�Fﭾ�?�z�i�=�M'�	�&�>I�x��#ɫ"��OR�D��wU�U��$UB���Ҷ��R�
�H=}�bFs銰9��Z�=�zi�Li��O�Qy~�|�"����n��<G�*|!�	qm���w֮�l�襝�H�e�is��	����m��t;�u92��{�5���K�m���i��?ηx3�F��@�q���ʌ���VI��UYy-]qnt];n��u��
H*X�Y�r�Mz�_�����xv�U�)��R�T�8��r~���Ny�q��6��M;���[pz��]����tV���8��~�)��a�sV�I c;{U��Ny�-��qQ9�m��q��
�ķ5v�&Gs�橀�3W)�h�D�qZ�>T|�w�k#c�}�xd*G&��}QQv6G>��?�I���A�c$�dR�H��YjZ\W�U�'5,���eG\���Knq '��G*����w���n��j���z�Wo9\�G�+I.s��I�=x�#��z�T���Ɔl�Oz܇;y={�<�c������0�8��o�$Mݿ�?~���{���Ǐ��4H�C��{x�q����ˈ���(J��eXu��>�?�z}��K;_�[�Ŝ�A�P���ͱ00�-&f(�8��$C�q��_���i���<s��Z��W�~�QE�G�EPEP5����(���(��(��(��(��(��(��(��(��(��(��(��(��(��)C�#to֖�~ac��;����k߆Zυ~5�"Yi��|�c[\�ܬNḍ���Z>����?jO��^��c�۴������F^K��-�[����e���2H�d����c�D�m���]k71����-�rʍ,qİ��3ƿ3��;�rF@���|��|i�;�	3����-�ѿi�3�6�����V[�*����X����E��ތ��B�瓒v�-|��^�#'k�<���]#���I��?���ω>!���'��.om��K���5q$L-�gb��P�c27��UHj�ތw�	9��޿!�l˿
��K��~��~_�/����[_�X�D�qi�h���EP��ʛ�LdlpJ�_r~��>��T~�_	�9�Z]x�MS�[� �Ⱦ��w11P0VU'T�#�Ҿ�*��=����x�'�֬�g�3�(�H��[:V�y�y���r�C X�<��9����@��r+�v{�^�9�gN�U�%��iA�����4�<=wk�,Dd���Ӛ����'8��eѴR����'�tS���pW�*��ϛ��p��<��Dza���U��LJtˠ�֊��N3�V���f?�r5���\n_�+�ȞeL�V��Hn	��IĹ���g��^�q�(�S����8'�T�<�dlݹv�Q�q��� s<�����;B�
�z�y��jp�u;(5�;Vx�@3��`q�j�9��<�\uVG��Xw�ԭ�f�fS�ߘ~���{X�Y2�
�ϑ|A�(��)�F�/���i�ke�mrz��cjn�n���o$s'����Hf�Շ�������^�N�f���Ļ����q������Vv��c��N)<5/�D��ߞ_�ɗ�Z���M�x��o�>���[�Q�-�(�-��#�"K1b���I9�̯�c�#���pO��G��ᯊ�<��ky�ҧ�!��h3ѝ����@�fp''��?ֽ��6,=�dF��?��^g�����}nA���(�~���s�;��ÿ述NJ"�/����M�i���.5��)uot��jf��X#�\��\a� ^��H��c⿂�a��&7�M��g���zy�w����4K3�K�.&e�
�LU��e����|��źo�J��9|+�˛�l�51�TҴm*3�7P7k�����A~������_��������|I����KA$$�e�/(���i�?4F%(�$`�~��2�oC����/���g �4TqH���r��� ��zc����
(��Q@Q@Q@Q@Q@~#��r|iw���#�+���ko��?���p�r�ۿ.Bq�ɍ�8;����+�⿙߈�)��������\�[{φ߱'�[H��C.���%dI��$YRE_�p?�]�/��]4��뿑�qg�jKv�����g�F�i����V��$ڡF``�b�FrH9昀(��������?
���� �UBGq�U�	��5�$�1�O�V�ZM�L�I��,�x"�rTs֘��V�e"����4���NNjH�o�5Mhg��t�dd�C��W��N�y�#�#���]�I���=��}8'���	I=Ua/x� �m4�L6���'sw�� �>@���R*�+�N3[&��RJ�[v�@?�:�S�@��mYG�R�|�-�6�FD�f���B���Se��{�x��[NVFJ�n��cisY�lT�Z�n�ְ'#q���U��d��59��TQ.[?J��g��*�m�Ca������|��о��;V�wb3ZF	����z�2dq��O��=c+�7$�s��h�HXFx���i��z�s��;�� �w.s��UB��H��#�p�)����[�P��1۬�˃��x�Z�H���|�;_��ĚT2I Yd����#���}�� 펵˚a��NS�ȱ~ڗ;�'�W��o����s�	��x�5��^7�|,hļ:��,qF�!Z3<*�Xn�J�?� z��Զ���!�[[�|W������B�`HK�������j�������ڼ��;̗ߧ�NtSP�DoP\�����(��(���?���(���(��(��(��(��(��(��(��(��(���EPEPF	�G���fk:֍��:�X��k��zg���!�$�wr��1�c�@�4�kʭ�;|�[�->0�b�4ˇ��)�Z�*xԻ���ndo�Ik�O�
_�h�����^x)���Ӆ�!�*��d%Y�Hԗq�"��R亱�7�>�<s�J:�5�gw����aY���6����-��s,pݵ�`��O�ϱ@����±n+�><�u�eO

�;�Z�����5�C/m��{�1HS���EԯhI2@�o!Q���[u4te�������Cg�(�,Y�K�P~�h|7��?L�EƟۤ&��FY-�s"�q!:ǽ���%��&|#��nb���|#���--����2]Ⱦn	I$s�s���e_�/����_�)?�߀��$xJᕭ��q��$�9�U�����o��I'��eh�r�g�s�펆�r�t�����V����t>#$��GO�*o�����8k;�����<>���\-�$R�v&�sd1���%񿃼W�����|v�]��|T��n��Z�Zνul�\'�nn�����o�k�r�b;�K����(�.�'�O�����Y��^,�6׺}�I4Lp�dWP�V����Mo�$��/�f��n����J_��ͦX�Ouq���#}�}�#<�Iۜ .�oF�N�����U׃��U������τ>$�O�9��-<Y�Z�݆�c �	�~��������0$d�5��iw���+��W�_����j>�4u��!kw*H
̫��T�#q"@2�6�܏�?|�g���/�>+��|Q�,5->A,2�H8#�V]NX@ ����q���Ks���t'��{?���H��v�P�t�Y0O�8H�?)��]McWԟ
���Ҳ�5��\��ڳ�;x'o�z�y�E�u��jz������X�uV��g�@�71[�سȨ_���U=�3�m���X��뚧$͑�+��k���o�=.mo�t�H���W\]A~H!w�i:3|���B���p|N�����=��]�C�֩�~��lnK�.�q�nu!I%R������ՙ�	a�S3���G!�T�'�b0���l
� pI��1H-�pq��6�cO�̝7�
-�.��fd�'���t]	($�.~ev��o.8�2y���|ˏٿ�
�n�6��J|[�?b/�:�n|/�@�:Ԩ���K�#H�|���S!��y��A��T���%߫>���?mo�C�?���<��ֵ�V��>ݩ�""�@�����e�HUAt����s�
y�NMm���_�ܿ	��4ֱ���;|��|�lLj��ٷM��o-�}��9�4�a��r�Xh��eO:��.ώU��ik��}�8gx�r�n?v�?i�+��Q�:�<>���?�)&6�o�����,���o�2ٓr�
��rb1���I���S��e4�iJo�>>�|^g�����7�R�E����[=3H����wi<���ڊř�	j�/�-F��&��?����=irk߷w�
sC��>�W֚<.�w�y��n`�TI��U�G����,�����i��ck�����F��]l,�(63�m�B\4WQJ��9U�0�G��C�����b[�K��:�`�ݮ�����en�@<�����\��1',F��U!%�N7][�}v_������~��F��z7��N��X~Ӹ*�;`/��(;��p;q�ԥ'9=��T��=B�(� ��(��(��(��(���iO�w�����_���J�𘾶�!� ������EB�,�1�ڊN5�/?�.��O�(����?��-��[���b��M�K9��7>.�6��H�D��)�t�$��q�
:Ӎ*8�Ɩ������y�����M�ý[WӰ�0��Z�L�nO�p�H�"���6��u�:W�e�|-����ᯍ<c��]3�7�_x�^�yV{��V��YU�dkhF�*q����V�����dRCu�o�'���-bX`{o\N���{B#�!���!�0N���-g�	��r5�ܟ4mb]��Q����71	-��5�2�YPyi�k�4��^���l�c�sř��S�Y8��}����Ӣ>��⏈l�+th�X6�dL��9�����ƑﲂF����r1��Νc�r����!no�1�#���[?hmbӖD>u����Ç�;d6ri�U�\�Wn�W��~$�o��b7�G��gEm�,�y_����?;s�8�T�Ьf�^A�ͭ>��_3��㶣QO�7�I7�L�Y��n��Zjd֧��2�S�A]v�����iڲI#
�[����W��>9|���
[��}�v�N�Gt��G�����c�%݁�s��+��K�6t�3C$dH�8>�>��*X
5c�J_s�<*پ&��+��V��4�Q(�D�ǁ_i�U�G�J��۶ɇ�$�^��|r0���,ѻ'iQ�A�s�ʪ�mN�y�	��C`��ֹm�Z�iַ�A$�)�G����X>Onk�Q�ў�:�Q�w��F*���q����=j�&[ }h��I��砪��1��Z[	���]҅�=�H�ل��ǭ���B��+).y)��kF_h�N��ʵ�Fp�rͽ�O�5���<�P@�������96uӍ�V嶧=��	3����Zֺ�v�A=�;n{pkzq�S����˃�#�{���q�Œ��h��A& t��MH���^�3�#�s��u�J�c�t��p{���?�t�G5����rI�^��c~�F�<� g;���
�+y�$�oY���*��0�y�=}���
eQI�f-��p�qtŋŶ.��"�f���A��+�t�'ھk�9��Ԯ�Ŵs���2N��ڷ=]w�p�<�3�zW��)g����i�,��t-idS���z����s��)�q���_��{w���*�%������K�O�7�N�g�pf����L:L)�8��nC�5�fZa��_�>�'���u����H���5x���<?�K[Ie���!xՊ�B��R@�H���'`�W�|5��"�}�
!]��8�F���WA_���Q@Q@����(���(��(��(��(��(��(��(���^�
z�u@Y�j������ɟ�o/��v'�_�;¾
�HE����&�h���;o�!�#�HRin�Poc�lQ��k�3�7����X���^8׾3j6��2A�m"�`KI�L-�h�8�YY��;~z���ඟ��ǭQ��؛�	��[ڬ�v��7krPa6D�	%��Ie�m,���W��ʯ-=O�?�$Rc<t#�4:u����E����������n�W��(�+d������UeU��!Ѹ��^���>i����J%�ݺF�f�������ln1[F�Ij��Z��<t������xO–��'�F���[H��Yo�b�D�1�٤eW#'���?�c�_�~; ��7�'��%ZL�I���Rt�4��+,*ȧo��!�I6|Ec�"��<Ou��B�o���Cx��%��u��T�=��v����˒��`��?���W�/��Z���
|�<$�j����O)Fݺ[����d�ύ��.:!����<���%�u?3�e�p��S�m�7\����3�~�
��־$��5h��[hDRH�\e!��B���*��/�5�J�d��_~�2����[��*-$�3_j6��I#Io1J�#9Fg+��u�ǵ})u]V��v��Ko����������G�#5���f�dߋ��g/�⦽�ܐ#\�DLL��6KD�	ݒY�)��JWL�g�9J1�Z|�C����QQx���8d)�܍�ZCז���w���+�	|=m}��̾]7J.��>'���s��Yn'�v�B�
��q��I�I��c^�K���
k_�:�����eƫ��ms<vs�'YmdF�'ʹ�T�@#9���+X��q�zJVG�x�k��_|P�O����1�}!���m��"�@I�i^1!���VB@}���ٷ��+�WS�E�k�_�-nM�sh��I+��Pv�|�A
� +���_�B������$���(@��5i�e�X�Y���?RĒI�9��-�
�]�(����|�m�̣�%��#["��+�42do<}����?���NUtU_�C����>��
�o�&��އ�:4��Үbp�[wn�#���~Th�?��NM9�������¢UҼs�ݵ�t��n�?�7H"��}�q�ɯ�~�e�fx����}�?���wt��K���I�#Z�].�3��]�c��~�Z_�_��{cy���2Ȍu`H#�V�
����"a9S�g���=����>)�_|P��/�Sq�H�ͳ��Ī�d����(�{g�5�����d��'��߂��+���>�k��R��QA�1`m������������[�j��-��xSǗ�Ҭ�:���J�>F�_,I(^��@8
����6��<Qy/�~�m�˿�	��u_
_L-��
�'{i���uRH�{qE�Z�)/���oF���/���O����猼i�7j������<}�s��׫ct|����ձn��Ͱ�(p��%�������_�f_��|@��t�i�m���]I&���T�6.c�K*D������X����w�����[��A��EඖY����乹�w��E~c��ͯ���������˺���n;���S�j�j�+)�;ݤF��ό�ܙ�pο�jp���wC�Iөf���?�
\�5�3M�tMB
gG�`�����A,SE(��2���G��9�{���1����j�$��'���Yi�
�����5K��ˉt�,���n'i@~�?���MWQ�1$-m�q��>���}�2�V��s�|~K_Y�iۣ�8b�I�P�>���p�A~�Ƒh>�ѯ>)|v��)�_�����8�B�1���lσ�I⼳����~'�g���"�34�3�>#�!���_�L�e�e���7}��[�H�!
�A!�/�v����{��Q��[����[Aq�O�]n�]\X�@���Kq(1�ȑ�V����o6�_�z�.�,��~�w���	|g���~�vVG��m����F�V;�}c��2[o*�a��e1o܂#�
���~��@��_'���
�t�1Ґ���>?��a��V���YI����,27:��-6���L��y~�>4��!���o5��Jҡ�ec
�4�0��8�
�����k-���g_�߲ݼ�ږ�v׷�`��g
�~@ѓa�����M9�/C�)�cE]S�=w�OJ�K�	���j��|Y�
h%iw[�����h#ܐ/������'���'����?<!�?��0)������U��n
-�mwX�g��Ic�1'�Q�]�䷹O�����3Ⱥ2���Vӟ1�8�do ��I/\���o�~)��>��?i�~�><�S-弗�d��8���5?;*2+9���_b��*��4�R���>3��mb��:���z���N�Sҥ6�C�-�ת΄��*�Q�&6�/�I_�-~$��g�nxE��|���9>�;��Ʋ�}��ЄU��2�V�XC_n�7�C�r��?i������+;t��t�X��D�y�L�1o���NI��KwF��s����]5rʖ��T��W�:zwg��?������/�����HX��MSW��59�,`����M#�+���󎡼���k�"����{����e���K�}�h�2��M��6^�\<�����ګ(�Y���k��y�F~̟�L��77Oo�MZ|I�ә���m���i�5�N��8Q�<F��|
��;�:D:��/i��cl�8��
��:
�k�ʥ���ϲ˯�����t8��qڊ)6u�(��B
(��
(��
(��
(��
(��<��7�}7��_�?�w�=;�y����"���&���Xՙ@.xPrx���></����⇊D���U��ε5��p_P�����iM�$F�n@�����._��~š��_���ih��)"�ɨܧ�<�?3�<�ͷ�Yv�#���xW�>�,����^��N��6�.h�4L�X*��_[�x�T��ʲ���g����Q�'�7'�_�zn�j#	��Ձϵs�r*	5�����񯩭���V�Ig�2D�h�)�f�N�{���<�����k$�uԙ���'��o�U�_�]�_�w�{�{��q���l��z��r��3���Z��e|J�mqq�~��V��m?v�|5�%msK;3���bRX*��?��N2>�Ue`��A�ֈ�`�4U��h��b*c�IrN\��/y}��׾5~�Ub���f-cÚ-�A?���oF����W΁�|l�Q��#����?>|c�>#�#������̃�I�|K��.�x"�_VE�q��?�|u�	���:O���τ��aif�����^��^u��`y��*��0y��Y�.��S^z?�i�M|�/��+�������/����:�E�x�X�.b��H�Yr���،��_:꿲?��*B��0�~Zh|9����pC�yH�HCIw19X�ʨ����W����mI���s࿊�g+�dX��uc�h�W]ȉ�Z+��H:"�� ��^�<�����xu�_M�ad�/�{�v�ܚ�?X��1��jn4�g��
~���4����h⾟�*�Z~NI-��|�c�'�k$�����qL�[;�]�ҡ����	 ��ᑑ[:�K�����:qמ��<%��o�g-\�G����X�
�X��)��e�e�����A�1To"ݑ��?�O��A|i��ֱ6&w/8`zv�:��i�:�i�ۮ2_�0NI��z�ⱞQR:��襟њ��G�s[���5�l��5�z7���o��F��r�f���A,8�+�#��V�Vs��CI+�yB~�9\�a�?��S�ǎO�C@b�c�?�W���#s2K}�y�D�#��!� ��ˆ�Ư�S�cXv��=*H{�W���4��涆���Ђ�R�s�s�ż�pW�kM.�@��Qe�?.��&�2��dPE�q�n�ᣨ�4�9�Ct?�z׵E8�A���W��w��U�J���Vc�'���o��|�`�L��ޯbx�z��s���]9T=y��r�>��b�$c����ۗC���P��~����+�O�,e�؄�IZ�ѝ?{0��܈>YB�W��+6:���_�=u��
��]B��������sFY�16�G6�C��p���X�N
xy�^\4������#�Usm�#y}�O����h
:�Z(��?h
(��
(������(���(��(��(��(��(��_A��FEQ�5]3C�ou}cP�J���̷7.��/�gv *�Ԓ1_������4|Kտf�%��H�<x��{=K�}Ę�9�/��+��?{���
��{�)��?d�2�y�5�=�B���%i
<-c�n�k��l)�
,�����"�/?�:��u��?�	�x�����.K�m�I�[kJ�����a��Yk��g�z�#k���(�Ɲw���d���ܑxz���p�<���f$���wÞ���=+�>��3�
�����`�cU4UUF�vQ�M�����cuN7?���[�
y�z�y���?�������|^	�R�e��UX�Y��+0����-#+�?՟?���8��y�|}�����7�L팰7ѩUET!>@	s;7�_����?�N/N�����:Kx���*�x����KC���Oõ�?��|9�E�(��e��#���&$��Y�@ņ�{�Eڃ�c�8�T�c���/Q�uEF:(���7yJ�i�g*H�	����md�8�A
�wr
+@���v3�
h��ޯ�6c�4D�r�{�Rm[@��԰�|�d`���LW�����#�`�$,#�E��n�F�Q
ɻ(�����љ��vcPΫ���<��5�C�we�o��U����jxk�?͵��H��9�7,���x�O=L�UY�*v����O	�:��?xB``��FV\�c58O�mzP� dWSj��#ѕ2s�u�N�JU~��(�
�x��_٧�?�5�;��p�c�|B�'��f���K�Q0��ᕥ����FA�W���|n���oƏ��3־6~�����=�%�Y�8�E3}
���eeVq.�۾��J�U3�8�/�'��5�O�>3�m�+!�xKǚeƓ��B��\���2���dt5�[���;0��/v_	��O�^6�<g�{��o
���
F��"
���� ֹ�s�5�����/�?�L��x�L���U��L��^(�A�I,m,Q����nu�>��Q��Zџ2��ʽ(�Z;�F��o��J�L�I�����g�
��||�M�����n��	��
J��ma��9X�6x�Y�m�5�w��������~�zq���d�f����Mh��Б�x����3"M�+`Ul�c�Mg�p���T��>|1�B�E��o����X�I�s��?w)�$P�D��~r����1���,z~g����-��c���~�?�gO������O�>5���X��60C�˭8YKH���o�]�#`6�/��_�?����<%⟉��'��8�Rg��SӼ�_�z����RGp�?/ώ���B�&޿�
>�
6����%���%�$Q���8�����pNXc�N>�֛�!d��q,�Mt������|=���?���<euj%ג�⵴ԝ1�H�(���;�|n�G�0p����	���G��	��1>)��F���1u�YI�\X���!�G���[{��ˉB��w!�ٞg� �����ڿ<�>>���O/ڻ��9��xVm6P��O�6��+�ؐvd���BSH�ns�i��5�Jo���
�9~Ŀ
_�u��?�I�S�m�^����Kin7 E�h���^�I!H�b�
��Þ?���u��~8�|y�]3�W�E�Wp;#p�Dԩ�8 ��H<I�$|����!��>.|���;�{��a�K�H\jj���ē�YfY����9	��W믍��4]cP�����?��._n�
�K����H��*F���W��A<�U��_�1��ҭg{_�~��@��P���=m��3���ֿe��y� ��^�����J���h���؈�#�yd+�<�o1�����O�3���\���ƣ�%�e�'[mOA�4P��6�W*��+u�|�r�>u�|�N�{��y��u�'8�]Ŧ�2�{�Ƨ����?*�/�՟�F�j�����ګ�Fhu�&]ʻ��`���lp����K�����ο
<φ�����jo$v��߆�{�yo��di�SQ�7�Vft�\����z���4`ӹ�_�I�+�_�R�*G��B�������}"Y���z|sL
�LOH�c�#�R7G��c�~E��?b��ǟ���X��~5|t���o��g�e-ªEh�nf*4CVGpk�Ҿr�;��S��t
(���(��(��(��(��(��(���|?�7S�b����ƿ$3�ᯁ�Ծ(jP�UQq$�`�r�>do"ʒ���7�9��,��h�w�3>��?��~0Y��a�)t��� �� ��9��a{r���8coWЪ�eG�&AO��Wyk�~��\o����E} �W��b��Z�v\s�:�c��{U��(S^Ģ|�94Ήgx#�5�q0�:����B���9��>ƕ1��R$����x���5��k�R��uM�r�=sU^��9���h�Bg�⚦���l�����Aq�Y�=��c�g( �:,�A�A
�r+^��c�j����˷�ֲ�E��(��s�O��?c��}�Ŀ���e�*yk{��t��Rr�d�h7��rk��	m�xxI�������
�6������Xۏ"����20b�՝xg8��_/` pj��um��R�2��u����<Ʋ�$�u���t~*j�
���j�
�g�[�k^mVе�0]�ky��b��bEi$ʞ���?j��w�^��i��Ͼ<a�i>9��L`
���ͨ��B�Y���3�>ϓ�۞k��G��#�"M��|c�LC5��m��C�ʮ��c����Q��i��]������ֿ=W�:~��K��]!��M�/,�G�аtt�XdG �^��x��I��QF��;w�d���?��'�5���~��ş�V�s"�4~�2i�6��,�~t2�S�!"%a8�0׾~�
�n.|)�o	~�.�,ukS�����ɠ�mut㏘[D�p9�}�˫V��Z����[��a��Gx��?�1�^����-��ִ漑x3F@b�<�z��W�h_��Kami���^�)��S�=�k�^��[��Q��g���!���[U�Zf�(n��,�S,J����`׮�4����h�W�W�;G񘷘(:u�<�*ᱳ;ï�8�ڜ!���9�]���"s�p��ZW�{]�KO��eBj��pC�
���<Ig�ǭG�A��6H��$�8�W���[��.-L�U��ОFs�+�y}X�Z�O8��7淩�jq�8�Z�G֝i��V�Me�"�uB�|�s�=zv�ާ!Y�0A����$�aZQ����ڳ�<�[2��?5n����4�)q�G�3�	��6��Z��Q�2��t��N6�*e$�)�ƕ�e�=?�u��RsVP�`���>�+���z�]���[�7w׳{;�i��X�f�^_�Y��NJ>~п�6�M����;�>�HYA�4�
�����il�+K@��3�|'�
�
��_���{�
��/���|=����=���o�2H�̆5�dV�5�C�,|�g����o��c��=�H�l3�p���#�����I^�It�=�~��ݭ�kv��Z���(��h�(��(���?���(���(��(��(��(��+�?h���G�����~$i��/�0Iy \�s�m���R;cRB�ǀk�n�����'�����;�O�B��#�߃,eښ�ĮV�wX���.ª�-�?�����A�?������S�s�KĄj
~��'�</cr���ڲ��D�[�r��|��yIB*습�Nsz#��R����:�������'�:t}H�M�	e��gm�3��1�ڼeSh;� Ɂ_�������k�`�we��_��>�"�i.>�lY�Y�#|��#4��p�b@{��1GPB��B�R8�"(�V�*8������Y�X�mJ��E�ȇ�P���24��3NR	��ts;��)8�����R���žp0=�T��J=�|�1G�ZBI�Nf�`f�ؒHwtȠ�Q�i��J��$��vSh�E%�v�|���Z�0F8�0���=�]�O-ϖ?m�?��߲O��~-��^���Zql^�H�Q*JH�)wX,�Q��o���s|��~jڮ.<g��t��i�Ԙ�~v�|��	�8Ͻx?�;�z����<+\x���͖��
-Νg"I4fF�T��튶W8#8�_�?��|8���h�K6��=&�F�y�dh��HQ����T�\����;�yh%�ߡ�Oq�R�8稨�#�֓�����Ql�'˞��BpH���~q�)��q�@��
�G��;������M��F@��֝ص@�c;��"\�����O`<��������񯏿e��'
�x3��
'�����wV�o�i�Q��O��Il�Y��6�ۅ-����
���
�`�t[���m�8|��0b%��Ʌ�J�����t$�A9��e�_�l�i��N���.?eo���KŶ��ԼA���ӞE��5���l#,�ܰ!+�Z�T�zX,-��Ke��6�
�h6����7���V�ޯ�)F������R�0?h��VH��bSn�/ �f!�����`߆�G��)��<L%�ž<�#ݩ�73��Hd��ID*�vFd��d��?��.���xs�?��Z�7�>�E
��2?��#�IdbY��r�^T8=��ZPè��1�&�v��.���o�(�9�wJ~�r;�SW�q]��N�,y��#�+���}wm�&���þ �΁i�K��V�vr�6
�������?�$
�rH=j�@����w�O��?<O�T���|C�iz5�s$���wRۖ$������f��S^�Z�Mօ����)3i�9������c�W�^(��I0[�7O��l
Y�y�Y�r���(#�����ff���k����RZ�?�����K���`���u��O�	_�ۣ�����[��mγ�`AlLJ�/\g���m�)�f���8ðFA���}k�/۞O�'>��xN����>+�]/F��$
�%�_ޘ�E�
��r����;[���^1�w�t��@ZZY|m�?��6�trCo��f�K���	#V*	˒���A��̨�)k{y�O��	7�F�>%��n���;�1�qe{�귦�����B�s��|�Fc+_.�E�?�f���ߴ��e��������Đ��.��e�m!�9nR�B�|��h��q�	���Y����.K����M�ګ�_n�s����d%�u���P�D1�nM�I!���?e�������=x�C�������yw�߉�
�	����Gq�VV
I^8��d�9B͞���9*��qG�����7�����o��4:��1s�+4,J�-��Tgnq_@�;��-�|C�?�?�W��a��� :o�F�2k�u��ӧ��������bV1�f2ɸ>]�M\��?�W$���]狼^�J(�����(��(��(��(��(���k?�#ÿ����#�^�
�S�SO��:P�dڦ�����߆f��m�ƪ�rs���6��?�(O�+_����!�]=߂�g{���\��>��a�Sr��u���h�
���l
�L4�T�8�v<��1�S?���}�o���W�m�c�,�:��4�!�-��4�Z���}IJ���S�U�rJ��6��5������Z�W����_�*j	B;-��֝YJ��m���QIa�{Ւ@�8�C�gC��i��=��*]�s���bܳ�����'��3�Z�����drTM���rry�
�F����-�j��܎	�6c
l�������ex�I�EW��c�Et��^FI�z�jt==�|Q�zV`�'�T�H���Š篵�#?�X(s3�sQZ�..����e���p+�/������m+�G���;W�h6W��)u�(�2��Ӟ�5�%�����f���tZ9YC_X��F6�[���?�=\r9�u��v�D��Fp��*�jtd�u��~��}�4�'��yׁ�(x������/��)��u�w
PYl$���6�Q�E H�+Gk��W�ܟ�߁S�hT�~cޫ]��֛�v��I
��)�x�eN�Xn=�x���4��>�f��������xO�p�H��Y4�B5�D��(ꍸ�Q��9��f��sީs���j�8�i����iB\����v?�C�2~��՝��ϊ1~О
�$�ߌ��|#RqZj1H©���dv�Rp+��to	j�����x��v���,����i2ʭ���}
�<#��E�<d���|ܒ9����%�Ν�?Y�}�43AwJ��0����:�ҍz�ݩJ�OU��O�e��Э�zi������q������s�z=���
�k/xv�"+�6t����e$A�=k���Z���(o[deK)9��o�y���&o��w_�u�W�����T_����g��j����j��*��$Fl}ᓟ��I����s��sHҿlYa>��F��)8['��D�-#K����N�n���v�Z��_s�<:�;%�`�'��{��+���:O�!�/�i��=8��e����?��{{��8DW��H�\��ҿ�~�<[��KV�L�
<sr��)�M2�l�!��eV|�%	�cG�����	sm0&9``���YI}
j�z�����w9���þLM&�U��`�zR�$�����_����9���u�]�L�\t#��z^��_�f��E}`��
�<��Sq�^���
|X�k��4�Q�ݙ�V��q���]�C�r*��}m�٥ݱ&92G<U]{V�д�GW�$�&�K�ߦ#�K���Ey��>�6�>ִ�ڗ�
/�8~�zt�x�m��_��z�fXY�ё[�D����ѷ �G�_���E�	�*�o����,���q�K�GHn������O�9�?=���|�HQ�jk�lv'�V�N���3�܏/����]��_�|��(�S�
(��
(������(���(��(��(��#8�4��ů��o��(�������/�<q{��{–r��;��$j��x��ﴀ�<U����Y�|����6��}fO�xg��D5ޥ�Jˍ ����*���O�����?�l��_�P˃���G�h�^�̊��Úl�2�A���c�`�$�&F$iBo�'7�c�·����}�O����������~��]��g�-R�	�,o��RS��ri���~5:�F�Ž�� Ps����S�"�|�"���ʣߧac��q�<f�Ԃ�+{��j��vq�{�d�
���<��Q�+���t�i7�������U�M=��Ă(��:����<�E	=���W:��>VuR}O��8
�U=F¿����a>'�b�NJ|����5�چ��R��*���z1����A�Dl�#�Wcr�T�?�?�����
���|��Oⷉ#�_�d��
1	��_"�u��(�R*�C0��"���iJ�I;=c�!�݀0jE]�r1�������~*|�ŧ�k�����2�(̅Y$T�6
�u"�b#�������$�T���BB��m7ǥ e���C�P�'����"gn���~^;���M:�P��m��"y���TH����¨$�
�(�W�o�_�:���>7�~�3LR����Cj�!w�>!1n¿�?��??ॾ&���?�Z����U��/�pMmaic��[A�<�������D��\������A�^�·�e�Q����M�O�g���ك�A��ž�hL֚�M��}�i,/"ɾ0H��8��.[��B�A_;~����/��7��|9��F�_���[����=���HN�,��nB�8P+�<	����1k��>0�|u�d��J�;��He�*���)�設wb��rw��Dv�b�ڕ[��ޢU�<��F]rx5�rsh9O<���m�H�i��;i�x5��PH�i�;���>��z��|�8��f���cO�4K���!]�U]Ƨ���F��1�x�Q:�)��:!M�J����j�]�?k���W�/_~ǟ�M_�j�V�O�iz牍�0������	'd
�W�7����?�wC���I� ��z�ߎ5��X�p.݅�H
�*n������X~ş�D��	���O�W�Dں
򶥫�S�s ��R�8b����p#'�y�+�6��߄����OxkL�]�c����H�EL�ɕ;’g���k�_���z���c����ހt�H��+���i6�k�I�ʲ�<p2ǓO�l���U䜌�F���~�o>2xC���u�|j�6��oN<5��g���.!$���P�s
��4܍)Pu$���_�T����Σ���>9����h^�5���Y��_���eV�2+�S�+�3������z���(}�z�����KѢ�<�a�[��<�N��;�q^���,|%�o~�^7�]��5�~�	5�Y<g����x���ȑ��lv�!����l����φ��%�x�G�t߇��P����ۥ�+��8P2Ř�c�I$�Myt�λr����Iԧ�\��>��?�s��~�˿��S�V���?Z$�TKw8U�N@��E.�8^���"�8
p�f�
N�3���NH��6*2�GSJ*�9����~~�?��d����~�M���[y<Ey$�*�Uڋlqgﲯ�z(}0O�jS�{�֫Bc)$��'�����~�	u��-~�z��Z��bQ�o�9K�97#$�@�����~j|���ho�&��	~ʟ�R9��=~g�~|_�>�%ꬊ����T�D��9d.��U�~�ȹH����k�����ſ~+�f��^���[�3�`B�8&�'rH�`G�sb�~�އ�z9vj�=a�gX_��V���y�����OI�C+��u���	��~*�~2i���Y��x�����5����&YY�4o�y1oea��(VL&Q�-\�<G�X�Z���jq��\[��7G�+/PA�y)�����q�R��f��pz�J`QEQEQEQEG,�A��"�*Yݎ��$�����~���'ſگ�Ɂe���񤫠�2�o�4A���ݼ�PH�Q\���T����b�ï�;��]*|b���W�~��3�
�n�'FO.[=5nn��!���y�{ᾝ��ǁ�h�y�o��m29J�2��`07J��c�1���<5YWkH�/W��?.�;5�O��ߢ����_w�8�U�z�ZͲ��;WC8Q����z��эя&�1����#3�][��BKm���	�Uh=�H=�ϽN!
�����p�P�&X��+K��䳳%��';rsڶ�Ӈ�z�~��-�c���ҡa�Q�\�*3ѡ�EH��E�@4\H��@9�	���Z��h/�+M�w�?���/~��f�N𵜣0�Cw{;nU�!��P�_Q�f9�&�/.ZpM��#��uqU��pѼ�쑙�@~�^��*?���c�����;1uk�_�����E��DA�w�w(�D~��n��3N��iύv?���..
���:��[�m�-���w�
l������|/_�3�|G�$�}�^����y1/.�����$'v�k�m�v⿈8�Ǽ�2���46M|R]�{|����c.ˡ
��{Z���G�ß�1��w~�?�\�_�f������u�F���ϴ3=�ߚ䐪0�T(8�u�G��^4���|W�#]��q#�֑�YT��!Aܨ�A�@8�r a�gҫc��5�ݙa��:�)O��o���T����/k+}���O�$���
�����K�{��'⾙�Xlٯ|9x��M�sL�	�B����Ey_�5��ٷ]�<�p�
�<!��\Cio��Ao�?*3yf�ԁ��6�b�GU��($���s~,�G��u��W�^3�퟊�-��a�ӵV{y�'�n
���ך�s�|r�<����{z��ⷔ����O�8���9R���t�t��������(�|[��#�ηm�U�͵���f�d=�D,�=�5�YFp�j����*|Q��}x�S���cK[�~��Wm�|D�^�}�[�&	����gxT�4�(����3���>xW���L�~�}�����6�)�3l�']I�����Y�~�����(?�/��g�O�.7������m/�'���9�q�{R�}J�}j,ʣ���1�{���V>6���6�~cX�R�8������s�s\���8^s��]#��k���ɨм�O^*ً�!�O���#�B��G�8��ğ�~9i3h���4���������Y�ّCs�q�|c���'>�e�~�G�����ѵ��,сTrY\3�%�8[!�$���;bsל��E�8�>���p��{���=�:�#�;v�}�~��b��(��T�?�j��d��	��+G�274�5��3�)��
�������?S������U��%	'���\��#�
%��L�0�4F۞O�p����#8�㉭ju�|����h�a0�e�V�_�R�_�
K�L���k��f?��'�~�cҵDZ��r�gz@~A
���H1�{��l+�࡚����������x��M������Сa>�{B�o
bEܹV#>���C��?hm"�|G��C�i���4?�wm���˻v�k�9ܬ
��ך����'����ώ�f��~�	�G���I��R9���XSI�E �{��$���x��78�V�u�գ���&���m�e�},�O]m��i�;����¿|��xo�>
������11E�
���rk��:f���Zu����j�N�
\Z�[:��H���u%]H*��Aȫ����AEPEPEP5����(���(��(��=s_>~�������~<�[�N��[���7Ms<���)�y&��@3��
{7��M��+��<S�C��k�sj����kt2K#�8
����v<9���
�Xi_�7�l��	�>_��u�]��m�[��F��ռ����2���`P�r\��M$e��Ps�_�"���%�Կ��
e�x��q�G��W��L�l4]h����q��a�ʫ���g���
6�I�y�[��p�kq(DEU���*�1n׵J��D���VnSc��u������i�iq��	�pf\q��['-��&��nOlP<
\����2C"C+'2m���m?m+/��P��ſ`=?���oٯ��`����LP�^��{XRlHYeH�?ʭ��6��I����ġN3�M|�K�g�O���†��Ɵ�f���=뤉nѮ+\ x���{"l�#[S�����r׬�������)���~�]�ÐxS��������@�a�$��ݲI5��z.��S�ߊt{O�w\���lu�{y�n�$N�H�9��k&@�89��Pyd�d�O>��8��%�o#�)��6��F��c��߰��5?ۇ�	�h~��j~���e�:Bl���C	�U����c9�O��Q�/����S���i����%���ш�-��m�A(��n1�X����n�(���سM��t�
K���ĉΟ��,$���T�t�ۻ��c3�U�j����~��~
|P���/��7���~��ĺń�X��h��jJ�ShD�07���SV*>M�y����*�'5�.��3�z��Ml�f���k���߶?�X�:/��m�V�~ٯX���"ʒ�feC��`��������a�T�#�amX���b�/g��;�W
�Ty��g�#r@?)��x'⧊&���i_�_���7�~7�0��A��^A���k#!i��rˌ�$m��N5��8���Ub�M��b��?gM&�_3��C�7�~'����W��Ƚҥi!�u��t�����,�iHb#x���_�q�~����;�-��?�>[���[[Kt$�f���;�嘜׮x��^��<A�kp�g�^�{�J���8m��y�
Ԛ�o~x3�K�?�?�����~֞��A�8�A�T�xٌK� ����2&��N��B�ug-\D�:��Qo�(��?�$�4�x�Z����Զ˪�������d�=̛-��P�5�ۄ�
�?�{����Wᖛ�{�w�b�w���{�#Gy$���Ud��I��"�$�AѴ_�ZO��7�A��:	kggj�8�� Q@1]��ȋ��W�OG�N���
�g*�労z/��#��N&�/>��
Xd/�}N�=��n�qL)b{�|��g�Ċf�]��k��f�����\>	~ͺ-������8�x�������,�F�K�#�9l?hώ
��~
�C���X�7��ۉ�k�D1�]�N����\H"�I9���d�*�m�"�����=��_���jޫ��rKxח���M=�������!�e��o�����W���yINk{[�?���ۛ��=��X�A�g�!�x�l�.�&��,vΨ<��-[�Pē�����e��vnY�'��~E��"�d�|�G���׍#��ǟ�F�x���UmV;�%Ū�i�e�g�h	
�6����=1]XH�9=�όo�[-�������o�4��$�ȡ��/sҵR��F�r<���B|J�W�����D��_5߉�?����a,����Io!̋mt"�4)�A���܂��%��5��x��_�y���w�K�e�|%�𽯉|)~b��MZ�̘J��so2�yrF�!�:�s �ǭ�O-�g&��/������g�;��M����;[Ě�S,Wwq$��,�̂�Wi�6�PI�'�W�����|A��&��4�����.b�u{�����3y/�����WinZ,��8#9�?�ua�'�]'	�'���}�pz�Qq�O�ﻊٜnM�����D�>�EL�q�2{��	�t�/������8�*���$
�,���kG�n�,�g�5��c�X�sȧ������[Z�1����>�>|`�>���kjD�z�)(V ��"���@�d��^ƿ<I�����>��b?j�?c�8�׉��3�qwl15���bTJ�a���J��Ga�˚$�$��!=��RX��ARk*�xՋ{I`����\�>�����/�����O�	�/�	���I�0+-��|�[L���&U��-&�L��+�?��k|v��f���V~%�7į����<E�]$�v�uz��%sDF�f2F����n6�Y���מ��8�x1}�O�)w
(���(��(��+����G�O����A"E��I��g�c�ѳ���U.@PO4����?�h/�q~ҿ�R_���P�q��GC����_jͺ��8Xn��x���4wv�W�Zu�(�c��=��zv��|O�*��ƿ������S�������m�`@2ڤQ�у�7$�_��aZ1��8���잇��S]^���q�oֳ:Ӿ�|��:~wf�� H#+\
�I=k>�9�=*����k��rAY �y���YpaYw�=�j#EJ�"���{w�m�o\��R?��zv���Ѻ�z#�y%��j�A�g�Ʋ?&ݦ�c+��
�{�m�/x��~�o��Pg��-k.���wil�,�0	�"F�$�b�C���]�IּW�z|Iӊ|A��o��l��Ҽ'lH�L ��.�l��\1�,z���$�%�����u�������dg�mn/#��H�`9�Idb�\f�Y�=�i��t�F��N��Kh��-��aP�ƃ�"(U�W��O�*Q�C(���u��W��/NdOxÔ�fu�]��~?q��_�/ᗆ5�B�U���'��k�GR�m�$�rX��s_G�]��v=�Ś���i-P���q� �(����~DV,�,��Mt?b�#����>|N���1�_��
���?�g��)����W�us�E��v�W�Q|�@��cŸ
G`��,K�Z�
嘷"�o(�{�;>^�W��`�ӊ��)5�ZIyj��܏�yʼ��l���������gÏ�+����t��ZL#��E���$��;B��A��8=+�n��_�	��o�s�{���B�^�It��4?ؗ�W-oy��m �-��ci�v�_A��?�v��^~Ξ��l�o�}0����6@�-��f\�ʀ(ؑ0*��S�R���'('f���w��tӶ�?���V������v��՞ ���].�Y�&�g���K�^�L��D�d��+""������)��,���~Ҟ#��|w�O�+���t%ݾ���RHv�����h��+�~l0C�w��/���I�m_��/ū۟��?��͆���V�ϊ]V�K��/?k��TXـ.�T�������/�i�
�c�5�7X�φ`����;a��.d1MI�y	�]\;1�N���<X���MƤ���^}���۟�q���*xx�1���
�,��$�̡�ІV�# ���
?ho�����?i���Om�5|n֣�❅��ѯ�&	o�[/� �I�+rNS,	e�?S|=�_�`ڣÿ����K���4��O��|�Z#�9��G�V̓(�u�	�*�;�~���������G�=��=Ӧӯme.�E��6YV
������i�Y�q=	J}U�jSn������U���vQ��>KV��u$�{�K]���|9�]Y��[��yiuM�:��ȡ��ԕte!�� ���u&5*+�'�	3�G_���)[h>)�SU�>
���ʠ��dZ��O�r���[��foӖ93�_�&�Ӆe��y�v��U��a��3�9��Ҳ~��q��It��H�?*�������tgdy(]���0{��U)-pF�u�B#�P�H���c����eH��lV��3��UX6���gZ��к0i����S/C��t^�&�H�r�)^��
������|��a�F���G��q<�(��F��DD�	��C��R
��Q�,m�����C����h�~����)��[x��ޯF[{2͖X4Y�B�kh̎�p"RJ�02���5I�ڲ�z#�&�e��ѥ�R~I;�ޟ3��	�a�m3����|b/��
��~1p	�rw��\a��>ݬ�F�<;�i>�l�OѴ+h��-�X��F�=�:��*�#�N��)�(��(���?���(���(��*+�ᵂk������K�#�UFKp�MHq���@�{�����'~��ٿ���ox��I���6�O��7V>|*����[%���ԟd7d���>-j��U��+U��~�Z_�C���P����-��x��DLt�P��������¸P2a�!�/x��_��KxW¶�X���+{xP$q��
�៲����B�-��_	����#Ϻ��y�/�T�EԬNK��`}3T�M{8Z��ݟ#��y�հ�m8�h$��N=�O<��S����L֩���!�II��C�|Mu�Xxo��/�7r�Z�V7�%��
ʎLr)l`�:�>-����n�/������M�x�L���G��p���J�$�g�xÙ
�͵X�����B�g�-~�~
�7�����4-+^�\K����%�3T{�����n��9Щ���D�:~4�0��ʂ䑎2���[�D+�;��X��-�Ҵ���2����w��A����V���ʴb���.��I\F�>��3����4�ط�e��+�as�Y�Ѽ3k�?X��_��Br�ǹ���9�[����h_�6����;�>:~�LV��f���L�K�,�
Q��w�_������^����>:��_�1:]xoᾗ��
 
���%�7#*��P$���f�'N�ע;p��J��_���J�'%��E�lOڂ�����ɪk:��I��a�s$pY)\B�O0���P���~~)k��<�&����}��ߵߌ,|2��vY���yѨ,�����T��TUP��zL{W�P\'ƿ�/_���_����ߪ��"��e
ϻ�t�@�W,��p&��&��>���$��_�����~�/����>�mt�xb���#
Bd��vp;q�z(;�#��LS���ɯ2���w�?>�A����It�	|<ҧ��'`HT�I�bK`�����YG��ֻ��
��S�ߴg�/���K��WcԾ+�^!�����{��7�d�*�Gq9�+�	!W ��x/Ÿ|�����C�O���t�2�<�;xj),K1�9,I'$����3៍�|[���3Z4?m-l�坁	�
�fb-�L��N0�����r����P}s�we�W��e����x���a�3������iH^��½v�K��E(��݉=k�������q�\�\Oֺ��s�8���Ի�F�v���'2��5�$���Jg�NPs�2Er7dzQ��{�����"�x�n�3�.r1�Q�t*z��Y��O��S�9�G�'�'����*����ye[t��<�pJyO�9��;��0�����S��H��>�?����u<�#�Q��`��K1H�Ewۄ,UN�z��IDZ�h�����5���!�
����w�J�]�E�,�V!#Fc�x<U��;z-����<�Z����O�t�/����h6�Y��[��(`�BG*������>��#�<w�?�~'j�Z���7��R���+~��ȱ�iZ4�Zq�6�Z�Ur����m�[��
�j��=�	!�{�p�#��"0m��bW�$��E����#2�ܷ��1�k����o������z{�~ܻ��_�����<,�3|f��Px��VYa���wk���|�8�X2��2��n�A�����ea��x{Z��{�?�w7?g�K�Ռ�`��nx�hJ�W|�O`x�*������욹�a��6�i;z�������t�k�+�
��ꟶ�=/S�_}��h����?k@��6�9��
�'*0Nv�� ���c�^�i�/x������{�2�;�yG2K::��1�%��W�Ԃ�l�g�J�����&���^�'�_��/��\���~�H�i�Own��$���t�|�)�È��Gs�/�7�6վ$�K��4��<�m۸��_"-+V��T�ȳ�&h�s[i$m7��ʾ���?�_����~ο�o�a��i��a�Gy�mҲ�O7iܿ+�q�/�eG����[~�m�x?�o��OA�~"xkȆ��n!�i��͒%�ed��y`�(1�+ʩ)�ׯ��Z��\�~k���ˌ��}i�����D���?�����������U~�ߵ��=��^ A6�gy'\����;H�`�ʙ�P0d`��:�{ףJ�5�]�#�P����h,�w�2Ew�i*ا� ���9�4(H��rx�����?7 T��0y$�r2�u��T�R~��aL;�;}+�C������S���3��E��o��d>����#��$�m��*�ϴ0���wg5Y�F������_�?���
x�~,x�����"k�F�@�Ƥ��Yݙ�*�,Ā~x����pռA��b��\����Y.>(��$z��c�
�XB^9p�+�@�V�o���K/����4o�[�
��CS���
}��›9�h�,-�E�����5��y	b��~�LJ������-�3�_
�Gg��q�6��D6�q"����\���GT�)/wW��/������~��P��~"�6�4����hԯ ���S��;�d�Œ�J��`��d~�ߵ����?��7�'�n��i�4��}ILz���1�c�Wfo0�w僜�O5���C$2���k��C�x#�+����~�U��m����E�b���>;���i�Oᆕ��e���IB���yo�N@�Hbp�>h/Tw�ٜ�T�����x<c�����N� ����g�G�_Z��¾ �	�̖w %��ʏ�1�WE8����$��4QE�Q@~1�s<e���_�9+�s�K��E�-�v�k6g�y ��F�˓ P	�v���*���?n�'��<I��O���շ���0���u$� S�/��2�Ճ��*�ݾ�+;�:8Z�W�M���;�K��l��Jt�Z�alX��,j[
�.[�z=��c����/�$�y$�Z�Ļ\f�^���˸z�YKvt�M�'����5�Yϸ��ߥu�e��=�jǯBwE+����VL�H�H*�&MÑ�t6hp�:RS���G���ڶ3����W��)����1��`���չu,ڨP�Qڭ��.�s��=�Ұ��Kc��c�O�8�� _��g,ʩ�ϴ�A��l*�ʇ�����z�+��
Aa%��O�_L�mk�_���Kuq���j	k,�!>Tx[�1�ZRQ�H�~����17�o2���#*F{��=�}��g�2�O<��[:z|��������J�[���W5�
���s@|�:>:����:~��g��|p���'��~&��^
�0iW����tm���l���I&��ya*nE���������[��5���?�^���xZF&�G�`;'���y{�1�F���s������TW�4��˙]]��z�5��8�u�N�_����L��+��<	�j>(�<1�/�~5�K�Zk(�&��5زɰ
�����O$�룙H�Ҥ��z�5��j�Sѝ��ml|!���~#~ۿ�����H����K�<{����6��x��X.�V��K(x�e�d��m�����)��n-[����~x�/��^m�̰�"���i�Hg�*"���9�;����~~�~)�����?�>|m�=�Yi7�f�&��[Z�fh�r4.]��:3FMxU����?��+�'����f�������"[u?$^Dȩ��q�,�J������r�`����F�Nɴ�V�ٟ�����y��Y�O��~���
�i��*��o
x
����O���Q�۞b�|I����Z��0^c�y9��ۛc�<��S��������a�cx7�n��m��ϫj��5ƥ��A���|�<�I$����?��
����0�c֦H-<��]���dF�(c�G@2Q�5~1�I�W�Y���3x�pi>XS]m}/k��{�p�exOe'��'�m~VG����������ެ�~���s�7�e�]�Ba���f�|����C��c?�]��7���v��<�3�_ۛO�ؾ���@�JW�x�|���䒊����c�n�W���aF��1K�?����q�����F��s�ޙ�O?�E+�:n�hlg��{-ic�+jh*o8�)|���j��)#�W��q�Eb���^N:S�1�4�<S��Qs_f��A��G,�S���8���Do^��2����?���m#��O⟉:���ﴴX4�&6�6��L�-��ᙥ���P���_Z��.�eMc�s�	?��$ʺ����&�<[����p�����մ�i�=ʞH�?7<=�h��G>|(�"�
�����_�ʟ^�O�4H��[ICI$D���n�Q�(_��k[���������?[�l��¼EE�����{��EW�}�QEQEQE
n���(���(?��E~r��R�ly�b��/ſ|3p��k�3G�@c�|�b�_�,����;������2���E�m��5X��4`Mj/�,�%�񷌋�Y�:G�'�J�aK�)�AC"!�)��M����~/�>�=���4w�%�
�2^j���i�	�>\Yƒ�[,|��	��X~�?-o|U���C�O�����[�ծ����A�n�6X��DL'��W��ø�y��s�o�����#V09��z��i�i|��;��pI<�]�l���84�1�FI�h�z�ߋ_|�O�nj>,|G� �߂|	a&�}ur�O����|G�Y�	"�Nڲ��#�+{s���߱����%׈h_�k��V��i�д�̼��(�QI��1�'M�b�t�?M��ŦA�mȉB��~*��4�|C��~3|O���~����Ÿ�H�g�HH�:�n��	�T�j�P1`6��ۧ`ߏ&�����f+Ek��@ʓ�n#��G�p�~ �ۿ���ω���?�?�N}J���#R�G�d��tݒoUv�n�
�7/ʉ�|�%�3T]Ir�L~���T���������/�_?���#��'�iX��\���YUʳ��q���h��,��Q�������;'쭥�L�"��Z��5Ն�/�q*�+��\8$ľ[ʩ���$_�O�C�	Y��'���I-����E�5���m��I�0@�A9$�\�m̓��A�#��On��֭9m+E��S��%����g���G�-g���J�������	����mƥ4�>剛q�;��ܟ���#� g4`���$	�=+(��#�rm��-���kŸ�|C���N
+�4��;�n$���i��7K!X�g%���9���i��^-��4��K��B��o?i7��6��e�ˊ)$�{�h�=��ʊq����Y����/��d��''�u#gy�Ox�u/�0#��zG���@H�WD(�%q�k�O��<)�o�^��>�^�o�����ki�'���}��O�nOe����ak�~GZH�Z�~����k��'����t��O�/��W�K[�g�t�>�d�l.Q@P/��|��U�'��ۏ�����k�2�K��ƺ����_#Fӷ��R�e���!�;��X��L��[�
�jߴWƹ��$��j�/�~+�%,d�!g����a��H��J�U'���};;Z��K��z��?A�mE𮅣�W�:d:'��9k�����T$q�(
��+����r<A�-�9���,�w�-��k�4-.
&�b�9��|�y9ݫ���P�*>S�uj9KcQF�
`T��Ã�}i݂�J	@9�?�x�D��k��m9:�:���3���Ԩś���g)jl�I�s���+�݀9ϧ��sOM�0� X���}+�C�
�N�eּs��'��v,�h�����ڠ��ys\��D[�rB`�
,��3u<5	֪�����jW�iS[�?�+�
�u�����/�a�D��|�U��C�cP�inn<�Id���@�U�V;�����&�1|Q_�'����ߴ��
\�����xwH$�6�v�<�6�+j���߳_�?�T�w��7�J�!ߪ�SFQ�%ggyn�6�fb���}ǤYEk��bB��W�~5�sLD�yt�(��g��mO	������[G�A��K�i���ml<��\�T��$�`�Z��FӀ=���´�UT�=GP{��R�s���ճ�h�P~��1d�p��q������W�;~�::ƿ����$Y`�mqk��S8T��	�$�Z��h9㞕D�sp1^|��j�
�Z�3�8ԏ-H]?C������#��~ҟ	uo��q�qe�/5g�,%�CO���@�o�G4al����W��?j������_t��vZ�Ff�����!
v��c(K���	hž$N^��麽�ޝ�i�j�e�f+�k�Y"� ����u��������3��w�a�Q��~=E�6��C46W��o%�W���.���'$�Ix}�\&q
6�_��OS�>,�����iv?~U���v	^�~��?��?a��W�(�|]�簿�f:'��ͩ��W����/�B��*F�a��
?�#�/��o�,���k?�߶w����!��d��Y��e�#rP4��P2��?jC:��#�?���e��8\Ƃ���4Y�a�W�V�u����!�|)�=�j�;�`���OڇƟ
�6~o�m�-I��?xD�Hfvc�P;��o�"g��Օ�>��%9\�v�ק
1��<��9^D/���])��:�ߪ��L9�� V�0{�y�I��U��P'<RG<p��s ��2I#**��I�Ml��u'{�_�R�r�>�G�i�4q��g�%���J��yw+���D����|ͅ�5��8��O���u����|X���*��"�n��{���(_O��˴QA����s�p��ؓH������/���e�/��f=`�/ᶝq;I�{	-ݲ���7X�q��+cq������j?�z���K�8�ٺ��Ǩ�&)�i���=�쳒��:'��Ṳ���NSn�W�z��•��Y���<��܅'w��*Ls��+���mO�(/�&��᭗Ǐ���h�|��!"k�Zߐ�`#�g��_�_�_��o���x���b3i���c��U�VFYR ڝD�ݙ�JV\�wO��'%y?���^Y��6�V��ye}E4���GYYNU��9����j91��+Y#�%s���������ԿkO�[���؏⌫���RM<�7��M��O�\J��`�RJ1Te��R��>��
-~'|�շ���=F�K%ޟr�����d��8��&���WBw*�|��;������o�k~�^9��f�^�������t:7�eo� ��,oa�s�)1�4̀�6��Q�r3�t״��O,�y��S~����+Ⱦ�d����S�o�8>���ZkV�y�\��f���}Ѿ@!��3^�\�isڒ�(������Z��~��?���m����+k=[�׉�DM$:�m���Y&�b���di�������g�{��|;�<�t�SO��I��a�T�VUԆRR��ZT���4����"�J>&��wӯ`�{�ix'P����d2��R1Vn/�29=�yW��?��������2���� Z������z�mrܴ���3m���ϋ�m�پ�#��c��vq?��N�ŰW\�.�([�$S��@5#;NB��fVu����c�_���6�+N+����_K�V��M(pW=���o�_O�]�XX[�{}x�QG�bO���_#xg��<qo"E��K�m�@��:ɣM���^G���wMѩ�*����^.���|B�|o�jq�ֲ�װ�y�����e�����Z�;���~��br�f	���K�ߡ���T��
��$��}�`pG���z׷�YGa�^Mg�ym�L�8<��u���S�USm	��nv�b��UUf�:�</�@��إ݅o�z����X�#f'Q�\g?�zˉ��բ�=C�6�Ϟj����{�3�K�hWV�oٲv\����r*�*�)5�c����M�w
�����֑�/Ŗ'��j�Lkn����*,�FP�!I5�W�����1��j��N��vO�2	�������&�am���mՒi|��aR鐮�������3\�8�*�\;����[�����vg,!ڝ{Y������=O�O�"��G⿍����~ښ]����gK_�KSq�d�\���\��|��
|B��~��?d��|�?g�c��oO��Z9�i58�/l�lb#v�Ɍ�5�g�\�s�į�g�~>�_x�k�dKlPʆ��K�n��	q"��|�s_���J����ᖿs<����՟�����\�j2��Vw��H�Y��$S��¼s,NE,�qNpji4��>�.W~�g�?�y��g���56�׽�V��w̽V�T���<m�O�ߵ���s�?��!���N�~\�kW�qx�{�:�\����HN+Ӥ���|: ��ƍ�*|l�5mR�[i����R��tH�U,VGR�69�������ߵ_�O�J|R�އ.��'��m�����t��Myf��:��wq�:�|�n�˧xWS���Z�Dž.�g�;-{Y�tx���� ���Z�sn�^H����XcvW�L&���3��
�=.�۸�%�Sޯ�l>�V�N4��,d���*w����^�4�l�ٿ�
�g�~ɟ��y������Ä�yB��w�	d�_����O�
�E||��|C�<�A����/��z�UԞMEu-B��̏�_5����	����B�|�ſ�Q�C〱�Q��=�7ſ��9ݥC��GK�ӴM�Ԯ&��|�L�PX��PF�c�/F����67�Ծ<����ux��K�cT�k��R8���鸒Wp�I�Qp�y֖ו�|��~)�fX�]Ni�4�ek����Nтk�
��3�W����O�]	��#�����!�B�Ϙ>���gw2�\?�)�K���{�����ĝ~��~��<����>\)����H��+��:�m��?�ۏ�.�q���h�B�|\\h>�Ɋ�Ԫ
�H�pĠl����x�o�R�8~���u�[��c�|[�*YNOV
_��� ���H�B�"������%���QF�F@〸ڴ&}�9Bє'��)�1$=k�
i\�S�H�'�Ls��5#6P�U�I�ZF71����5���ʌp;
�WڠZƮ��%�r?>i7o��JϚb�:��1#9'5�*����k�ho������~-��&�Ҽ��~�[�yddD�X�gf#��m����G5���c÷�g����(Ӣk�?
'��g��j�V�$��l�I����'��y 5r��>Ɣ�u[z��[�x�D(-��ӯ�/3��	Q�<�?f+/|Ho�|n���	��E��˜���
��B6�p۰q�?Ljkk{;x--![k[TX�UTQ��`SW��$���ESQEQEQE
n���(���N2��5��K�?���^&��?`?
�J��D7}ƹ:2�n#oݥ�s�̄��W��_�>����?��$�t�:-�v#�����7R�j�FX����"���_|��]x���~ٞ;��$��>t�^�+���2�$r��Wv�`KN){J���'[�Q�O��0��yu-ԭ��bX��:ղ�ps���l�W��=+�$�NwՒ���C�p;�A`8��Kw�Y%���Q�pFE~
�Fu�ڿ����ַ�~k�|s�*�qHu
*�Q4v�D̉"�Wm�o%~nN?x��(Iec�c�9���/���b��k���
{l��,��G�.��ϧi�b7�$(���p3�+�c�VVR��/ǡ���iV���M���5�V��"�b�T�v
��i��i���9/��=|Y�HC��u�0�D6��A�B`'5�?��J�O�,Ma�ᾞ��i�D��^��[�o4��Rߴl|��;�g�q�������	w��x�Y����U�ŏڟ��lzu�K�3B�TX㷎ܩ�3�a�.T䳒�׶���
)kS��xZ|h���఺����u���"�t����xE�����fz��6�7�|�A�?������z��~�Y�w���SV�U�۵�kr-Υy6̓|�,h2UB�������m,���@X�P��1�*�y����l5�^�{h��M��`��?��W�W����k�V����=��P�(�$x`wUiH" �@.x\�ҽ�Q���~Ȓ�~�?�U��W������߀�E���72`�X�n�y������~�q��h����~+������5��.�߉~;��N��}�k�8���Ù�L�Ke
d� ~��OJ��ڕ��|�oS���m�lا���g]s����u�<J|1kf-SQM��癲�A4[N�Õ��eŊ�eX�/`�@`:
�#Y��f�:���t�zZ���x��N�I�KH�ң����滅$��_���E�>U��u-��׭��]

�t�x`d�t���}�������T���p��:���qޚ����-jk�I�����W�K��xV�}F��w���l�I#6� %� ���������?j��(�l&��?����t��x�V��l�";[������P�'9?w��,/�/|#��s��^ ��i���4�_�Ur�j�p�͹X�$.�\����ȭ�����_�a�����gxw�-!�M��b��cf�iLg��W��;�%������>_4���O�|�cW���W�}
L�3|���Ѩx���0�I�};ÞrCs��q H��s���^1�Px[���_����a����
���a��	m���W�%|��+%~F�j���?�#�o�#o~۟|W�Q|b�n|��BMJ���b��$
�yFB\��~�P���M��k���ӵ��~}��2�W��;����۽����A�����"��eu������׵t�=�_�>:����zN��	�����͠���{7�F�q42�AP!?u���0~�_�����G�m�,��мc�8��oĸ��ӼK3:�qoHR���Va݅a����i��k�r����?��|��g	ڴ-�����py���F𖃪x�ĺ����/�F�^�z���� %�I�+(PX�a�	�
'�x_�_��|J��~��6����0.�9�L�猚�Y��?f_��(����l?j?
�cM3Vf��}0���i�܁�G,��U��c����|:����JSp��Z����<��QSI97�����K����Zx/O��|96�x��c2D^F
��!����IŶ�������+�\M��F�r���� �؎Z�ߊ_�J��&ߍ���=W�|�w���m���:m58�g��{yH�d�D�*[ymQ��߈����_�i:��?i�⟈�𵅦�� Ү.T�Ÿܩ��8㕕�Hا��<]�|
'��U�w�z���'&��y�u����e��H�b?i�i��j��9��~
�5�	x��Z�km�����r�����`a�����d~�V߶����Z���į�|;�Yc�b�S�u���*��1\
�D�A�r�{����O�S?�U�(������:�tψq[+,qCwr-��B��n�Pv!.�/��t�z���+��\n�����,*a#�������I��ץX�9�oZ�s�ܚ���5�����l�� `9L�1L^�6��S>2�{�e�b:y4EXE)#�J�������QO�����g��r���Α��c���_��[PG��Ȼ�`k�"��#�_�?�_�Kw�7|����x���Ľ'L��I�(���Y|���D��d��el�r�M�;M9��}���w�9���|}�x�Ķ��f'uvz�����2��q�_mE��̰I���=�Jf�z����Z�J���#TB�F�x��'�/x�����J�<+��;Ȟ��-��.򪜐)lbr�Z�#F�����Φ"��
�R��t/随�|M�Z�����-myc}
Oo<R$�@QчH��e��^�?k�x�º�����]��G��2y֤th�F�Ɩ�f$�?�K#G �3��4����G����+�|��m+�%�Cox��L���#��(m!�����p�k�/Twd��	�9l�>��h�"�X�I��A$m�2#��N{S�?*�Z�g��Q��mf������%��=~ƥ,W]�Y'�YѤr-'J� h�1�	xʰf������rq^}:�k���q�/�4����O�2�/�g�����
J��b��!`m�aʍ�n��*y+�f%P�z�J����||�¿���f��	'�?�_�о�gpE�:Ys%IJ@��%����)��UZQ�$��2�*���G���_��&��]-���6_�z��K�o�,.'Y#eH��<��Ah�%��p��5����:��?g�ڇ�,7�
�)^�w2[�̭q��S�)��8Icm��|�o�޾~�¯��u�'`��+S��(� A���~ϟ>*�
��σ>�ռq“k]�܂(_�H����������>*�?���=`|	��ϊ��][—w]�7RcF!�E��(����0H?�TR���Z�=������H�ڣ�tW�7����V}����"S�ncvZ9�V\r bUs�|���?������c�m~�#�v���1�Y����*�_�*�;�&��Rq_՝1�IT��$C،����"��e�g��K)��nyJ���h�
�w?�������*���⾓�
F�Ʒy�a���_��I�D� � ���+�)�H��h�%�!�Gݝw���x� ���~fѵ+y�����b�r$�7`zW�.��P~�?��u/����<S�%{_|G�B�XP���.¬�,���Wb9!GA�x�Ҭ>k������ڽ4凫'�ޗ菣����|�t]�@�����'��/��%������[Z��<a���7�o�/wp���U�4RI"�-�_w�1�u�(�
V��,e
�5��,d�ʒ98�}&�*˚���v�<e,F\��8�=�Ofz��(^0j�<Y���E�<;�}&-s���/m}i:��hd]0 �\�A�;MN��N*��"���*e�
�k�/T~|v������gi��g��s�I�t�j�$ڏ�|-5�,m�-�M69��N`-�F@��?�����I�~�.�+���A�=&�H���qi ���RWeZ"Ww�0���G��g�t�D�8!��>��nk��?��MҾ"j�e�E�5�V4�P�uM�W���[|�\�yO6�Y�P�`2~�>e���eq�S����V�{�|�?��!�Vc�:���EU���v�'uu;����z7��������ūo�>"��5���C5��IJ"�R(�F+�C)�_��O���:����~M�펗/��x;W�Z{]*fYQ�K*��Yѣ+���x����
���'�?�:K��-���v�!O'�\�
3�B��x?�W�*������Y�$Z�߉$��&$����J(�󝑍���9��"�������U��+_���n��o�ɳ\$}�*�:i�8�ݵ�3m�-�Ik��?fl4�+NHR��5�aDH��hῴ�U�[�Y�.�㟋�5���.֖/2���Ul6�s$ҹ!T*��Ԋ���|�,�٧Io����>�ߑ#�|8ѱ<A�o���r�0��.������6~�/�:G�?^��������g����)�k�v�a�9Ȍ�IS�;���o���џ8�(K2�P�敺�&~%ğH<��e�J�������h����>:���Ix>�������?���wk#umIBG#e]�P?�m�_�:M�G(�<���s��۵k���x��[XF0>^r}k�/�8o�`���Ö~�o�?�8��1��1�1���Ev_֥�R���W�8����g��N�q��z�s�++2�����Q�dg�NiK6�{U�|��޴�s�KɚP��g��{N0:�S`^3�T�oZ�l�t)�{���SĘ��=Tq�&���OLR�G�ƞ�{�x���z/��!e.��^Lv�PB������>x�T�u�_����������$�,ln`d�OЭ����9$���\�����9�����־0j�a�H���ڗĶ�ڴ�H�YhsG%��1��[�
nDž$��d�t?�gþ�Ξ�O��)c����0��[F�E�ʈ�G����,U�+e�����3��˒��R��?��ݢ�+�O�B�(��(��(��(�ks���(��
(�8�^�<s����?�'?ğYI�x��V��xSG�P��nn/!�Ƭ�u�p3�x%v���o���/�߳��߅�D�𮙦:ȡ_|6ѫ�#���z����jr~�_�Uد�?���A/ğ۴���aF��\C���)(�?�.�f9��k�/��9�C��*����X�������	<���f�|�Uz��^�ϞP�&z�S\�=�b���Pɍ�o�/Z��T�?;੿�|��9������6�������A7�5?�u��ZKev�h+�H�~`���_�w��i�k/� �)=��?6WU�E��K�dv�)�ʄ��퍃�?�-��A�����/�'��ۥ���Ƌ�|M��O�L�9MČĵ�S;�d�=O����:G�>x�6^�D��ga�j�`ĩ�m,�m# �q�kȩ���얇�a��:�g��???b�&O����\|,�|��j 5O�2��W� �l��,�7�Ux�~��v�Q �8�q�^�PmD��zRөZ�%dua�հ4QE`u7p��(W����/����+��Bh ���Y7\��w�x�YV2��꯴���>��W��?�^�����'��"���Sj�M�[����O�It��V+�1��>�3Z���>�q�p����p~�66w6w�!����K����K2� 
�H�$����9��tr�����3����O�R�t�x+N���h�X��A*�xx�5��W��z�9`������)w#bB�:�|��s��#�7s�%x=�uF"2H�'���A'����N��ԮbQ�jgL�x4����Z�l�!�¨����Ne��Mr@O�~��z���?�/��O_����,�Um���IJ�܍�@*[��+���h��j��<k��a�a���!��oN������8��o�պm�M#i�ى�1)Y4��V�s����3����|[u��#�m��k���M,�O7{�dR�%�W9l?��}�)}%0�u�U-�������b���"s鳵��U%/=5��q����J��������\��%��pl��L�mb
�5�@ņЯ�X�_�bO�Ÿ���?t���]���P7�m�[�.��t	.YU�v2��;��Nm�ף��2q�ܝ�g��,\*U��I]�l[8����?��>���^�q���7T�X�߉,Q^�N���,7
��6A![�U#�x%Rr��sZ�Sy�W����R��[[��4f��>h���j��dϋ�`�.5x��w4z��q�sv-��
3,K��W�BU>b���q��A����`���,�A���׿�~#���$76��dd�k��X�_�p�8�D��<�OA�ׯğ�O�7Ə�G������~ş�~֭[O����F�#�U�و��(��VD�K�BU�6�4��e𛍨�����Щ�o{���i�O�U)+�=c�+�o�(_�/�-�<1�.���($��� ��Ҵ�	��x�&��cw����E?�r�#	����K���]|?<H��F}̮���}����-^��?�/�{�	��W�~&O��:
�#P��cp���K��	k��$uP�8��[��^���׿>-^�1��c���7�^�5M^գ�ė-����*�ΑR���ʼnPi�/�`�u)�|�J���]i���Mz���%Z��)F�:[����p��|7�~*/�	B�K�\;}�ȌK�@��n��3�8��?��V�����I�~-�I �]�Y�`��n��&3�������qñE۵@�c�8��_��O�k��y{�迲��äx�x�.��P���Ṓ6[�e����3_�~a���_k�1�o���i�'�%���G����g 7o�%���W�l@�A_�-�N}��q�T~��� �L1�
\�z�R��:v���_�.n�mO�$F�!����7wIj
F���G1!��ܬ�\ �8���\��
>?�W�_'���CkѴq}��7�һ6���fɺd�����X���
���oK�]��c�[�����������-��G�w�Ϩ�w�E���	���yƼuj�'�	C�!�|O�����~��zx��ר����uC$��m%e��l�|�9/�
�U0A����,����k?�;�%��u?ڷ�ְj��9��1�x����eh�\�&�}���S��Ԧ��84�5'���5�<��^>�׋������et��;�Yu8�sM:}�g_��}��&�4�K�`���C�����4z�W+����(@��Տ��^�*�q��*�Q��n��/������~�,��$1b ^b$�s&>Ҁ�
2K��������pq�_��޿)?b�ؿ���?����}+Z���V���z�Mك��K	�{�d����K7�UY*���>��?
m|s㈧�'��Qrt�
xsNķ����)��!���B�O%)r��>��s�)�[%��~��o��'��įC/�|Y�̺o��5`T�j�1�s�`B�� `����S�_�~G��
�G�j�t�-��	m4+)��gl���e�a��.w�%��ٗ�-���7��}�CgK�w��~�ZygM���	���].�[r�,����>$����_�w�d��_�sǺn�y����
��5���*1�[<� V��5)W���^}�9bm�����~��[��� /�_|3���<M��#���j0���,\%���n�+3I$RF��P����*���g���O�gN�[;
閺e�Q�2G
�I
 ,K��I$Mz-x���h��iM�݅QRPQEQEQEQEQE���π�(�v��|!���×�VKMF�?�J�CQ�c�\0�W�7��t��C�"�U�o�w�"�lv�
��40�mwm6�IG�C���_��SM��vfu)Bi�qM>�����
����{�k��~��</j�m�?���B=�$��Ȟ�#H�r`���>(�<^Z�Z��~4��K�����H��J.��{xA���d}��W�E{3�]==�2�W�w>S��emU.G�����9�l���6���࿉�'Š��T��KY]�7*�9c���T���0����֯��=~�߲�93_|p���7�m�YN�-��~��B�PyS�#^dvQ�_./�D|1��o������G��{�wrk�t����r_Q�v�,p\$JFvrk��ZvU�o5�_�O��|2����7��~ߑ�6��W(�N8�ieb�t�b�������~;|Լ�[���u
F��XXFz�p��Z��5m_Ӭu��މ���oyi"���!ea�
}vN�oNW?/̲lF|��n/ϯ�g�;m&�T���A��3�k����1�v��Wot�G9��{���4��n��N(1("�J��œq����z)���A`k>Q -��L�A�_Vh7��J�R'��茓�_��)�۶�*|��$uS���h���4�F�m���2@8�e,���MhD��{u湥�J���e�؍[sm
9&�e'������"[O�k:n���Y�揷��e�|���rh�c)�d��CT�9ƕ5yI��^�������c��?��
��/��U�9����X(�T���H.�dV�^[�Z��k�_�'����s��������޵�� �/�]ކx��	s3�6OȪ2q��*�3�]ԛ��C`0Q�ҍ앂�(�N���(��(��(��(���)��DžQ�����?��5�����?��Z�Z$�V��L����<q��|��r���z�vM�<�+�~W�(l��F��B?o=pM=��O��mo�c���6`��I�D�W$�w
��#�������ϟ�������2�|[���&�}�9�u�V%��(��rv@<W��Rz׫���$|�k>j��#'���NPU99�@�@#ڤ�u�9t<�`t5vY	Q�o'��S%A���.
����yrH-�f�lLF
��F��)�M9�r���~(����L��G?m�Ե�x�_i�������kp�0�pɾn�'9E��x��޿���=:C��R�cǽ�u�O�:�|���tH^XT췜�@��#2s��<w�K�p�VKm��*�
(��
(��<��|j���/��	�"�d��Ѵ��]�Y�+���m)H� 4������c���O�~;x��_��ㅔ��7�5u.��3(>��E�XE(��Q��(�����v�M�|O�?eo�/��2>��S��������4]=ė��	��&Eb	Q�s�w���x[Þ�m!��XA����#�(UP���ӄ��Q��3��+�ST������$`�#<Ԙ�sP�w+��H#<�Z�ϛR�Hr2��DN�*e����#|�ҒВ=��
v̜)ɤ��2{E$GZQVDJZ�ޟ��
c�v����S)jZ�=1K�2��HA�p�Xw��a��?i�����������լ"̢����L~X�8VxR<W��o�+��'��]:i�/���×q��ѽ���:�-��̤��YG��$N
H�dn>`y�=k���n^�~�_�����Ԧ�;(�E/���8���V?68�Dhr���*7��*�L%<Dz}�����cTj΃�?�O���;�F�si'���#�i:<��e��;�	���P��,�ۙv�-�j_�Io���o�ߎzULJf_�ŏ�x'Ě~ɬ�����"���$"<j��ٰ�,2������<W���?�~+|2�%Ҿ.~ʺ���C�v�Z��K
�ጤF2�6�� ��������O���J���L��� �vR�:�[x���6b�̡��+����xk
��29a+�!�M�Ԏ.�e���\��n����;�}ĺ=��|3���ú�b[k�>h�m�GVIb,��]Z���#�k���?`��?�ޟ��߲�s�_�n��O���hi6�1�+‰.v�0�$;�?d��+����?Xx��'�g?���P���=w��-.Ʉ�~ZZe��y/�)��߅8�{�v.2���{��ճ����T�x�$��w�Zo��?�a�&0��BgIr9�d�1��ֿ�Q�����蟱����=熮�lD�^��Ia���0�u̺�����~&�/5_��L��I}��C~���$R`Zd��"�P_,2��\�{���/�n|���l޾Os�+�߲/��C[�Ŀ�g���\�V�L��O�����N��z�$�E}e��6�i�i60iz^��ooo�Q�¢"����_���k~ߟ���Q�O�s\��w�σ�Z�׈�1�C��>E
�ҳ4�,�"28%�K�����Ze���jiz>�Msup�8��>�T��W��e���Ni%�m�~Ƹe:�Ԅl���c�_����'��ş�wj�xf��]2��@�Q����?�<� ��z��$O����4���P�l�x�9��:��*�m��e��t�w�qy	��U�a@]��ÿ������W��_����'�(_����]���Ƴyw�P��B�j��&����c�*����l�z��}�7���׉į��|�iZ�]�����R�Q~��̘�Gz2UG���)�)���ҿuh���?�M�n<�jP	���63�1I�1�7r$��ο�������Ji71�w�$u�����E1�,�bl�H@���,����s���'��
ho�%w�|a��YZx�뚬7�m��=�i�;���LS��>n+l�)��y}9T��g�?�����!�����:~1x��爾x&
f�ĚŴ"K{�9��LHT�&r�'��M�"(��3���<E�x�K�׼/�?xoVE��Q��'����RH���n���V"��~Ryr�t�f��S�����pF3�ޘۛ�>�=��H�������_�������᧊��e��@O�#���R4���oqc�+�q�Υ"A!��~]�CQR�b�ʣFSv���w�'������3J�.�+~ҿah��m%L�ws�(��7�n�	'�60�u.��?��O�e������6�+���Kna�| �g�/j6�*�T�jf�K���X{�'��O�:�F��~+���`�V�ν<z4�y�����0#JbޤT�*�Z�+׮~Ǧ��i>Rq�I��BU$����:+V�(5O���$�U�_]����Fr���W���	��?�[�'���c�Zo�wV�.��Q�[��M&��%��@%����l57�]�������&ދc�c�������[���N��;����so'�A<_�$�9"��|�#��8n����Nɿ���T6�`��Q�p1E|�?G�KDQE!Q@Q@Q@Q@Q@Q@Q@Q@�S�$3ijC(���A�A������֞.��O�+����[P�>�e�Y�v�����ʻZb���+�ފ�u%�g�c��S�
�R�f���ƾ%��e�}7����uO�r�I��
�m_O�*�v�Ҙ�枑��K,�>V*���w�e��0����idݛe���/��ۭ�V�`�3��A��D�#G"	#q��2������5��&����;xk���U�R6������V�+��y�nz��}�'��6������񙟇�}z�t���W��F����{����N#�ʐ{�8#�V�z���g<�޼���G_|5�5O���wÙ��xƬ� ѥ��~�K����
�ƣ�_1x�G�����w�7_g='���q
<���,��P��d�:}���>h��?wq#5�8n"�Բ�q~z����y��8{�V���s�6~��y�`g�z����q_�_�n��ǚ����#�({����MU�F�:�S e(��0`q�}�a����r8x �ޢ�vq�$ז��Ԝ���փ��5c�1)�zTnN0j�T���1�B�s�d�.�@3�J���{�sr>�CҜ�
0zf�LJ�ӸTn{W�_�7�_���
�|�~;�ܞ2խ�U�*�\̭��	/
�4c$F�'�mF�#�G8�ߍx�췤i���?�V��'���F�C"�������%P�u�~�weجo���#����v�nϳ�<kc�YmN-�ދ�?q�UQ* ���E�G�!EPEPEPEPEP5����8��ҿ����5�?�π���G�7�mM���x�A����!�B�$f�~����9�O�~̿��P�>o�M2/�$B_97,?��2@0��;X}�j�,�(�s�Z����T��T�}>8��6�
*���v�9���LC����*cm�A�U�IS�瑌�W��%†~ƽ�C�I^i�R}�e�-�8ȧ�5�M�F�e�k�t`5���L�X����[�r�r¼�͕�ۥs�-�}S¾(�V�T�n��r�:9�'P��7���䎜֝��a>�����T�A��)a��±PѦk�F��a���V��?c��rڧ�|u�M>����cI��3�ҕ�bu<�i&O�>��@�n�/�(_���K�|nզ}�\g7j2?�|��K����A~���}�_��QE0
(��
:���L��h�O�,~��49w~8��}�{yq$����&�2�- ���
��~!Y.-�� �@bC��qb8����_�$+?�?��S/����C���1�=�R���I3�/��,��g��_�1�ON���\���Y�h�{"�$6y�����M1�$ZR�eI�+��L]ɕ�v��֢o��t�����G�Vm��Ձy�f�:�Sp@�ޑ~`X��1{��=M<.��Zj�[-¯�X���RZ�m����ԥ�9�Z\���ka�ۑ2�濟�,��/�?	|W��
%�I�Ծ'|�U��-�u��]C(
��L�@��YYG�
�1�5���񿇵o
x�C��;���iugr��)���þ�$c���\c�Q��~�4��W�M�����r�Lk�u�����$|#������S��_
��o�ǖ^t.$R�,�,���3ʐA�_Η��
|u�����_�>Ҽ?῀~�o��#[K�]Cs̡UR��)%���rP}_Q��/��ߊ�mgF�|S������4��.�<7�܄'~�|)S����?���~~�_�To�
�ž2��|�i�i�x�����%y��,�|�l��ۃ(�2��⼻��Fe��(�Pqi5�M���i�&{���
��q�v}�����=�5��~~���w��xV�C�HY#(ݨ0���U$��B��f�C�
�ko�.��<?5��Oi�+����u��/>@Jp�K�F�m}ƺ��>$xjHfO�|%�(F�M��#F�X��Z�����~�
u����WH���Z鶱(3\�Ȏ-�/��̠�@�	�c�s�N�э�̞�q��+<�UL�$��e�{���?�_��J�x3�
)�T��4�|@��M_xl��5�Z�"p�IPA�\(;�(�}]g�@~��Tb��������g[/��XV��	T��[+2�ym��D���~f���9���_�ϋ>-�h�J�i��;�[�c&&>m��
��2ɿ�8e p8��'�8�TLצ=�9�������5jC
�"�M�4[۫�?�p���V�K��5kn۲쏌?bس��7����������򡿾�v�YT�@���B��-_
�ھ:�g��Kx+�	��]�	[l�>4k6RF�����3YG2�e��;�,Qy��?�ߵ��>i~��gkX�����K	iR�"+i�����E�ci��V��?����a����[;���O�_Ş'�Ek���UDd弈"0X��}'���������[iI?y鯢����'�(��>�������]|�A�/�|�ᆁ�����-�P��L����vgw<�>���q��4�W���ԇ�v�i$��KC���ɹI�9�
8&�In����O9����>��V�G&�t&�J�w�G���&}��cV��=/W׵�RE����E�{�OS���5�;�"��:�����������ω?f[�;��!��IV����3����}��Fl"�s� �kߍ���S~��i�i�=g�>�n��B�|�K�_*��
�|��������ᇃ~|7�O¿�h����co8&�ہ�����Mxx�Z�����>�(º���/�w�ax��
��>%��/>*x�]C�t���.��G��wyl��o6�.Ah�#
���U�4�h�����6���%���ԋ0��y$w!Q�F9��k�����O�?��	���J�5��>%|�e�ڧ�4��F��$ZN��7�$�
PQĹ��пe���
�}�����$����˥�,�¯
K"���Ą�S	2VH�Ƭ��s,I���<[�tһL����U���Ե�{���#��p���a����Z��ui�Ӝ�dJ-���|�i@P���ط�
��xN�|	���_�7pJ�!�m_W�w�eyf,�*.w���Q���h�>�#O��4Ež��İ�]��F��9,ǩ�G�>��J��Sw��V�]rS����;�&���ڙR�(�cy��?*�e89��T��K�;H��W��^��f�q��S��������kg�1�f5�G<t������֝�v����i���K�t��"�smbe
�2�ٜ���Ӕ�8$���D,�~��a<�B���I~λ���{��x���q�@�M.�	}�?MamW�������d��N�����DQ&Ih��vwQ�������^����8���J+�g�/ ��(QEQEQEQEQEQEQEQEQEQEQE���O�[�u���>����w@����3G��i�C1VA4R�ʬvȤ2�+���/������G�|C�◃�o2_��/攅�w���(��GʨKYW���_��r�ڛ[��5)K����/1�hb��� ���G�?�o�߷ǁ�/C�㗄u��[�k���3�v��Et�Ӱ�$�,���Զ܁ȯ��<Iiyo
ݵ�wVӠh千#��*˕ � �_���g��o����/�:/����o��,�w(ݍ�
�v2�k����H�����k�����/��+�2u�������?i��@v���`(�W�`��m������OY`��۲����֓'.=jU֓��+�jߴ��˥Iy�O~�:���1$3���6������69�N�o��Yd'Ӄ��~Կ���6}C�����@�W����אAlif���f�=��"����?IC4��W�E�џ���+T��V��G��V���|,��>$x�R��t��R��<�mI���i$ٵ�I����K|'�O�?g}K����2�]��uW���ʊPo�>2�
�Ga䤠�y��l�����~����>�_��_�m⯉��C��Jn4�:�rd��`]*�ˆS�f��(a�����X-�P������8W��:�F4���������j�0��]Zuv����q%Q^�!EPEPEPEPEP5�����~���ڬ'�(�w�Ÿ�o�}�;�6��n��ɴɵ�݀R�d �����?��{�f����-�K�7����^��v3A$�+����z�4������6״�/����Fk֨���<��7��ُZ˧�s@Ӧ3-Ņ��
��6��Ua#C>FX����~¹�.A=�*�R�rv�9�9������/��/�3��_���5o�������
�Ό|�`�K��r�%H �_F��;��M�`j�;�0��Loi�D����H��%|̀�[a#� �84�MB�[���C}�F�(��8���Xw�0��߯�2
h�i���x�I����ks�}=�
v�|�x���"�^r⼇�?�CMc�6��x��	���[�7⎉(�?�o��K!Y���L�312�(#m�;]��91E;�5ݧ�~��L�7#��u��G$*����ֿ��_�^�V��x�o��3���m��ڃD�����a�Ȓ���{��?����߃�_�������nl�|5�I�F$Iv���J��_�� �^�R��!�iY�]y3�'�?��,?���.��[xgǺN��x"��s,q	He�V]�ra|7F��Dt�;�׈c��������Š~؟����cP�jT��|��q�,�|`�w_�׵|ˍ�8��l5NjT��ϭQCf�ER����!Y�&��>:|H��R�~�/´�f���Hc�f��O#�D|�15�����xS��~�Rt��_�����YG R�i���$�1�<੻E�Jj�G��|
s�'���D	5��7:����1��[��^pUK��ī�w"�n1��`q^k�ᶋ�o�ß�����>hV:-��۝R��o�a��N:ק��={W���-(�\e_i������5�N{U�F�~��yc�
hc�!0�T�!�~�Y�PsL�x�8��^��µ/B�ȥ ���jj��`U)�X�Sqqҟ��G���ޔ;�Z��I��NYG�օ"F%��dSw{N���ƣ�'��Zj�>^Cv5!`;�g֪�tg�|F�g��^�
��v�)�-�����M�R�����A��s����x�B�� ���M����F�p�r�3�;��[MK�[�A|���,G�O�n0rM5�ܥ��י[*�V�=H+�;p��'�Fm�����_V�Ѿ2�2���/q�x.鵽U���L�d�XB���~�����T�H�����E��k���I��4��+(���7�O�;�1o���"1���4�;W��ҵ}>
WJ�f���f�A��(�؃^	�~�_���5�m{��ǂ��f��;Թ�ѭO:%	�b��hL�`n0+糎	���*
|�]R�ާ��JJUS���n��?��.G��]˧h%�7�gFX�t�vRq��@V�B��c��V�/�C�
�QHnb�ض?|?�X�i����H�ePc�;! -�H��YԦ)fO3�7B�Y���V���>hZ����;x"�����I;FI<���$�UF@dW�7�y�r��7*�Z���}���njY�.�����s�,��rj�~&x������-I�L�Ծ0Zk���(4�r4Z|lX�d0vM�iګ����C9��_ΧX����Uc5���)AS�E��+N��J��b*m��)��b��|����j֚dFI3�@rk^V�FwPM�T�H1("����WwҰ�O��9�=賽�I�x�b�������9g��!!pE|{�l�؟b/��%���"��ZA4Z����u$B�ZD�3�K�	�ϑ~��T��C�Y�]�>4_����l��G����J�qY2�	�%el��`�~lx��_��?���|G�\i�~ɟ�?��b�t�[2I�
FuWT�y^��`�����Ŋ�O�W�d�
Y���sZs�;���?��R?��~%��¿�_�j~�ߵ>�s�j�ö��i�Z5��ȷ4�Ȍ��^A��h��Z�ۦ�O�&���7�W��9�#�g7�#� i#�����¢�9;�O��?>��?t_��|k�?�JDV֠��܂�O!̓J�e�Bǁ��cX©'���G.���=\Ny��F�oS�+�r��G~�?tGK��v?|o�yO������y<ѷ�YR}�A�b\�L���~�Eƈ�F#�0Tt��
�1�@*^�סJ�8-�&�j���(Wq�y��凡��1��Ê`�˂�3T��
��\��y�ƫs��NÒ\�:~��
�v�d����W�����
�9�<Wg������E�ƙ�+~Һ��"��:�U<�b�\�Ю|���A�u��E�&�G��b~ȱX+�7�k�Wq'�'��Iq�,�RI�>_q\O����k�W��]������fQ� 1B#��b�<���$W�� ��|6��o��ּ��'��jRyQ�[WP�K�Y�Qe!��Nr|�w��tG��9pnO��C�ڊ?��GkhQEQEQEQEQEQEQEQEQEW�?m�[�q�S����Þ
z���y�\=�ı�oy���1�����<W�:�����S�o�:��t`ä�[C�/.匌�QM��2@��\�A�P�En�Z+���Z+�N�-_�Qa����:�M�Kl�
i�
�:���{��������0eZ��s���/%R�b�Eԋ�#�l��Ev!C��P���]Q��HN>��Q���l?�W�m���?�*#�����>a��R[`CD����vC��?|q�9�gG�߆_ti�����W��+��cc��,��U��QT���NVW=6�(�0
(���+#�ta� ��ao���εi�_����|o�K;���к��2�ڦiP#�*��1t���Rj�N���ï������?�1�F�Ca���i��@	��fbH�f$�I��)�(��(�$I8�Ms��	Gpm�:r]��71�6�v�����Oh���s��(��(��(��(���?�9_�U��U��?�&�Ϩ�8v+1�t���e<e�<ț���m�ѯ�R��>$�٠�ڟ�OM[�O�����
:����u]@:�{O2)ܤ�E ����n��}<i=�s��a�qj�4��������"�0|��*��vc�U1������~�uq�x?���V���	�R#$�3�6�j��8����_��	i��J��??��¿�,�����"�^[�܇u��3�	��/�-�]�@���|N������]/��?4�D6Mu�
�e<j�^ա��pQ�?xc�?2W�
��K�>NxxRZ��3��ֿh�Ö�s��s�g5��\�VQ�@�)�-8Xb7M���o�?�'�Q]\x�:W��*'m2�+�(��yL�6#�`�W�-�x���4��#�	��J��f�K׷��"R�\�[!�!��]�{�
xs�	-㻍?�����o�'��{Kk�F�c�2	��+�[.�P/ 'J�Rm��RI_��������T�y�7!�2s�ֿ���������p|����R���l8K����`2MtH�e��7�t�J�ׯ�������|c�	�b�'�@�<�!�oě�?O��,�	�YU^Y�#2ơ@��Yby]���(�HI?��ҟ�~����O���(�mC�&��|E�Zg�Ej�[[ơC�w>vɓ%U�'h���pGo�_�o��~%��|u�^~�~<��T׾$j�w����򬧱���H�M+�oB����L�ׯJ�s�Ϫ��T�ƚ{	ES4
(��A�	'�����O�|{�����8f7��\���_�I�qQ[C��URv��v�$b'���ѱ��~�i>!�m�o��h�\|�{�����Cz�H�Ǖ�)���ܙ#l&@8��y�a����>��s��Ͻ��;��'�5r#�\�Y�9�Iȭ4T7S_I-,��i�ܛ%,�<��"�w�x�)n`I�sQ��B�֤�Il8��Ҝ��ۜ�j��N3��J�)9<�M�'A�1�`��OAR���V�Vrz��}�.xoZ	f<�.���@�23�q�p�HU8�r2:T��`�~F�ԋ�[��.�H�8>�N	e�H�
U��s�l�C�N�!‚�A�'�=Ww�$L��#&0A�9�&�ex��@��'Ҭ��"p�B2��=G �Ƞ�m,O�=�!�x;��m'�mQ����ux��%m�2�������ΤcȋY�M�-�i۩o�8�u�M4��#gn���V�/�Y	i73}����������}�_ᮡ�O��:��xqy��r�n��$��P��ipa�P��9O>H��A�ҟeM�㷏�����m"�� 	����S�F��,B�����'��F�ି�	�>��aO�:8d�/�0�&��+�W��lx�@v����c�t�������c�2/��
�3x�W��|5�ͧce�G�LO*E!�8�R�f_���9d���KҴ�K�t=O�L�th#����qEK�4E^Qc8�&�"u�h�=�8*xue���^�����C�Z���m���)<Y�z��4�k��w�^\�$�e23�:|�DX9ۖ;W��`�c�֘�I��@S��zQN��Ѯ"nN�wc�{�y%Fx�7n+�Tg!wƪj��(KBu;�:��M*I��T�|���(��3X>�n$��H{s�4�r}��2��p_©"jȃU�����{�~?�j�]C�B_��<��k׼Os�Y$a��78���c4�����?��S��z�����d��|y�o��)�Kq�~ؾ6�Ӯ�_-c�J�f�k��F;���hZ6)����WJ�?��5�3��M>�M�
�[F#L��(��y��+�M��ӿ�[��H�5_�����'K��M=�k�0�yp�[�)�
����`t�~�k��S�9/O��##���t���
(��OH(��(��(��(��(��(��(�������ٓ�{����ųG���C��DrI�y��c�O1H�*�`�I�j���Z���o�X���Vf�O�����l���>Q��g������'�%��/ŋo�������Q�ڞ����ӊ"4~t����6o(,	k�A���<��f�گ����xk㶿r�4#sk��<Cy;��
;H]#���(�fr�������-�F~�
�`���ߵw���x�����x�왦���]�s\O��\ʲL6,�58h��kk��**T=�.d��\�u�}]�e��G����9�i����?�-|��j^?�u����o),6(��N��!�e��|C�?n_�F���>xS��
/S�
m�V�P���ޫt�%�ÅX9A�k9"��Ԙ\Ev�*89Xd`�oJۊ�09�Zח����+�}hJi�
�m}�߁���d�ٛ�~�s�|>���Z��1[ɨj*uK�c���[��2I%柜�e��+M�3[�Cl�?��*����T�8�\w��+!��i-��sT�[����M��Ts�����p�zlwJ>�������m�p��7#��֪[�0J%�� �p����?>>o�w��KC�n�3Ҭ����z����G4p2��<�\�W�|R�7���x��Ֆ3�X�pQ]<�Ȏ@hϖq����_�o�%���"�s�
���kw[k�}2X�O� �snve���;s��W:jl .{�D��S>�2�{��������k�>����>�@�a�^4���
a��+��F��Kx��T��yLٔ;v)���*b����9�B�獵��*�3�@��g+Gm�\��Z��/��/�v�U�1��H\2���@j�>�-Hf�o�_�/��[YdAv.�I##t�b�o݂�����}��W�x�%�>��
4�ˢq��]�ݩ���=���Ȭ��R21X�7�Y���a�����ge�V�z�?3�4���
me,��O��C�)���H����2	m�ԗ�Y�+"�ĕ��~��S�,2i?�O�ⵞ$;.�^���Hgn�<�%�K�<m"���E����m��~Ͽ����H�Ck�O�Ӥ13�e�n��z(�I�.c6w~��4{�xk��_��*�A�Œ4vz��ڬ��̓��l��r,c�Y��n�F��aW�3&���%��M���9#����i���:����~�|�,�[\��$�H�i�6-�U�(J�3���Z�h�������|}�
��am%��IbR�|����UE-�6�?{��`s��u�@�F]��c*�j��vR���������Ց�\���M��$����㶸��#�r�*N�YS�>0ǜ���o��
r��s7�	���>�l<d�$�K���3#��ӠI�"��_U��g#�Ε-cU�2�Κ\o��+��>g�� ]~���V�3���?�EitbV���/�����y\���g	�q!�,2�F�����؍N��<5�x�i7�RC.���Q����o]�.~�GՍm����K�W�G���_q��
� �O��?7<Y�?�۟�m����R�ښ������>E.�dv��O���]$�[Q�m�|�s����|�6�#��	���ڇ��#Ƒxn�[�5���2�I4쁑�l<��*�$(�L����-�]��?�!�R�7����2����"�H�Ņ"���0_��+��L��[��2��b��KEw{h�u{~���#�j���~0���	�k�O����W��U�W���ۨ��A�kY�Ug�hXn`�e$�XG�_˿�8��׃����>����>M�<�����,�L���΍>Eq�����9��4�{�k��(m���#�%-�ef��m�ɕ����y������kJV�Y�/��hJs��u��Gk��tGݔQEn}�QEQE
n���;q_ο�TAy����^[\D.!дoj�YR?,����A��A�D	eEʌ���PG����y���B����<�My#G�g�5��Ċn��G�C)&ɆC����kۥnx_f�|�=����N�q�[��	}���i��aC����T�9���f���e���&�c��1g �3
K$��s�+?Ku(<`q����]XE}��M���T�WoVC=�w�\D��*�t�C)�A�z�_��5� |h��־)~��v�$��Y$w2�/�4[@��������A��j�zb��bխ��
���5�~"�A��!�������m��eo��[���Jy���d�yݗ*��?�ğ�����M��~;x��_����=�|@���4���^F�"�q-�h�ñU�!*e&����#����-��Z��_٧�L��>,�7JBġw��/�U�<�x1�J��m�W'���B���}�ߏ�'w���G��>|$�q˦�fC�_�\cλ���9g�@��U<�"�'m}�Y�M��������젎#,��}��8q�H��_$�d�?W��z��QL���(8�?�;��J�����I��Xh#D��ȼ?`��x��>�a��<��������7t��Ԓ:�$l�I�9$��1�����,q�|��<Y弶>,����fo���Z"E�
(�Ud.bYYW�p
ʼn��^��5x��p #'�b.B�9�$bs^���0VDLp�֪4�v��j�Y1�t�ۏ�y�#��g�qNᚔǜ��r}
YS�'<��X�oFX��maM�xB�Ni[����jY�@=�+�9;n�
!V^O+QЦ�=�2Lz�A��ѐ:�j.�H<�_�)�\"�=�?s���)#?1�h��� ���y��c�g�<�q�9�ӊb�J�>ќqWd6��v��#p�Әs��q���R�������c^��qN����#�_�*Ꚍm��NpTaTw=�õ
Zk��I7<�c����ƭ�Q�:H%��v�ѻ��������̟~'|u�2�ޝ�M9�#��)��w"8c@�T�H���kԡIB�>sYԫ�a��'�n�F�����s�>���?�%�s}���3G�iJ(��Dʎ�(|U�,��P�d��S�_�?��:����/�׊�OvL����m�����Y��!fTݵŠ���!��9�ï~ڿ���п����Q����x��v��ZB�R5Q�h�������o���U��}v�>�8uM(.���=>\g���qHA=I��r
J�
�ǭC�f�����S��n����H�tӊ�I�	S��i�pG�Q�;riQ���L�2��@�t4�m��H�w�}(#21A���1���U��֭HA��1�v汵}J�J����0�z���z�i�dsר��l������HDߴu��|
����i�;~�>6^���
�dm�4�H� �ێ�`�{���M���s9����v�W�7�/w�%�L��u�f��j_�Sg�O�[�������$a�	�ݹW�V�<T�
]O���x�di��~���?fg��k��a������<m�X���u�[$p�x`��\}�l���dc�T�+].��M��m�bX"�1�Q`�㎕r�$��
�H(��

(��
(��
(��
(��
(��
(��
�X?���l��g-2��f���-K����c��|I*�%��m�[�&Y�P7�`k�3�
�������8���z�@��~-G%������SF�]V�n�X��J�Xr@�D��_�����-���<F��Z)�յ�oT�U�on	���y���0Pc��;���o�~9��l,�Z�Ҷ�l��ٝG�/	�_����>/�C�&��;��G2a�����9�6��+����y{�`��^1�!���/>x��Y$�WX�p�;%V��2Fz�濌a����n<%�T����e���W�J2M�%��+C�Ȗ�WL��9�m�Q�o~ǿ�O�[o�M���~�������kZ<h�|��1��Q�l���#(�[�?�|#���S��E�qWi��)F����_c�1�}�w�g��x�H�<o�,����˪g����˖`g��kJ� ~��v�+��k���O��Nm͖��J�F��I'h����L͸�n$�̉�k�Z��+zOC��<:�ÜU������� �p+I"]��J���
�&Q[�b`�D�$=�sODU1�~�E��3���F�������k�L`v��"�ݎqY�
�-�P��>?0��g<Rg�_�}m���c��{�9�#��҆Ɍyw&ky7�9�H�V�K�F^�H���I �A����+D�S��> ���ؾ��Q�|c��)bmgү"��TR<�H˄����r{�WZ��'��5�;)~�k�X[�G !�,ѫg+�'�H$g8����vח6��9/��Ls|��j5���b�<w#����{�8!���b��9��j��dzT-_�?�%.���ԒxǥFd�J˂zm>�FO~=j��셧�NwUy'8-��h���O�F���$T�̤�)��n�''����w�`�����É���m�OH���,�F�T�(v9B���y����Aȯ����g��<��$7.㚙+���=�i���-3�O�&�Ũ~.~˿
ﮤ��E��I�ji��q��,�Y��y2Hc�<�0ȯP��zH�?ট�����O���	�?�>�aY%��V���F�����8�O;��O#�$|�^�a�M��8�>$��N0�L��c���Cd4�
�
+��QF����������[�|_��eG),�:�ap$�Ic�E�aȬb���%Q�jю�s��޿+�Q]��AEPEP5����+���������?jk�g��Z}��ͺ�+;�"LL��f�P����ҿ�¼+�����_��π�)D�����i^s�o"iP�'\����$�*FW#���'�w<��Z=����Ŗ����i>'�j��>F�l2rr
� ��^��r��ֿ>~ۉ���m��7����j��K��e����5m=�̴�&�9$FX\UgU
T�+��7ƿ�YO�?��wV~���|L���#A��"��
2]ôq�G|��X���}�6�R�睤��3>�Q�%J��^�-ؿ<pOj�I�ο�?�����:O��W��:b�Nn��Wi�Fd�\4@I����]�U�Kj�x����}�)c���62�M��۪�#�6Hx&��g���W �T��&�O�B�v�����į�wE��_�KO�?ً�K?��=[I�[h��l�0����1��W��k���
�d]�~$�K�f�R�E�K��.c����j>dBB�����������(������m4����w�m|'�}*�D��S#�b�g���!����^>g�S�eO��	U�YW�=�.�z�RҞ���lŠ(�AEP�7�:��x��'��M�燴k����Z���G�J*X����v���!uy�ZIa����:桤�2�Z�V�k	�]_l����-}��������n~�>'Җ_��ZDzoVd:���d�q"7l����:��O†��~����<��}�N��^��>�,��),�4�����Yy#�7v�����2M0�#~:���w�o5��A�`2A^�h�Y?#.V�qژ�$9*��9�"�EG�ߩ��+-���"�ь�O522�|��X*2�7#��Y6u/tx`ҥ%��
�0w7�)ă�N(eC���2:�pua�Zf��4����bl�Ԫ�~���Y���ҬT��` o��4FcO��׽1����ޟ2kP~o_Z{@S֚���=�M��Y? 1���jiّ�_ʔv��$m`~u�zhi�ga�j��p�Vw_}�S��d�V�S�\���"�I[��=?���8�d�q�m)u��,�f|������mɯ��?�����'g�[��/���X|S�P�M�N{p~���,��`����6?Xo�GI���e�_n��k�]��Ь��7Z��V������x>3�z����g���K����ꟴ�����Z��%u��$6H��Š��O��s��;n�?+�{9<D�����~�ZXYi�V��geaEQ��QFT�'��1�6�B�w�1�\�]M
i)�v��R�as�i�`�ޕ/pH1��N9oOZh�>�S�� ������ s�T����%@Œ�n�u�kr�z�v�%j]y�w;�$�YSx�JH���K �c�kεmJI�99�:s�p��쥶���ϵz4pW��19���OEԼk4����zc��>�+��|뇘�n�����|���'�<xs��4������8L�wb(P4��9�#��?���w�׊�c����v��y���}O���v�Y��b��d��6�E8��=jգA{�^G%�^��i��?~%xO��/�X���oY=����-��G��R�ʊ=Z�C��0~�~5��⟊?�T?�K�O���E��x'B�bc.��#�`��*�)��Ud��nj�)��s���RMkM����oٳU�]OI����M�ԟj�)�@흱����?�c@�W���WL�F�ׅl�Ӵ�8Fkt�䟕@�|�c���V�W�}�C�T�=_���z(������EP ��(��(��(��B@��9$��_/�s��?e/ٯ@�<I��׆�
e�·׉-�F�Z;HL�2����r�����Y��<�W����<%g#[�A��i�{�m�.�o�/"]��ި�H���U#����uq5"��c�+�u�'B���X�!�l�Vv�f
0��y�3�=��_�6{�k�g������̈���3.��Z<D�'�Q�=�lUB�6W��~y|F�I�e~�Z���G핬^h�����>�8
�f%��)P~�9$�c���k��{��#���g���K�i�O�4��X�dd_�WicRۥ��*�H8�'Y����G��*���I�Ek���ݴ[�����C4����w�<]���+����j�mk�:���΢�UK(U���8�=y W#�ρ�?l�Z���C���'�<c#���VŁ'_C�]eU�p��	8�_���W�u�[~��m�^=��<��E��m7�j�Y`��k����J�t�K"AbOcYF
��bs	S�*������m#�M[Km�e�Ԗ���<'�
h:w��1��xo��4BK�!�tT�UA޾7��|���)�K��|��<k��#*qer������G!iT2�(�2HZ����@�c�~|��I�+�~�/le��>$R�n�{�@
���Y�##~2��G?ԕ,�V���?����>����oxG����o��)v��ěi>����ħ^�o 9@0��q�+$BNN�_s��F��̟�������:��\�,�e���0+%��W*�����o9�)`	,2kퟀt��_>�_ѝ��"hV���c�1�+�y���[S���x��a�T�ټ~W�_�q���8�i8��vd�Ԃ'�ڴWg�i3*Fc��b�g����-o�#`�X�Q�v>��J�i3K�	*Z�i#3f�1Tf�������InypmKQ�0�ޛ�_���ڼi�<S�]i���O���,3���5���s�߱_S�k|0�P�u�vm��n��72<qƁ�pϸ�0�p�Wi�A��?�ڀ�	�r~џ�����ώ��O����n�e5[;N�������9ɖ��>�>|5ZKui}�O�w���*����V���`y�q��t��⯘��StLps�=�f~���,��*3x{u��[�%��Ϟ��A�U��9<�����䀪?*�������!ف�j��O;�>��q���sE��c�|T{{�$Ψ�0*,H�;qЎ��w�&�rG�|�d|D�>~Ϳ�'���-?I�N�5�i�^]��ƅ~c$��F�rInqS'dg��*��N
�$~Y�6o�Q�<��L0���]�s�W�1E��	���Fv"��I5���#}�ۗ�	��f�o.���z����e1?��ظWy		�r���̹H�#��S�	����?eς�����;�v֯a����ԧ{��� d��I&���
�}����O'�	���CK�o�]}�WsC�Z�˅�gsN�9��\��)g5'���O�X�������#�2oQ��*Z�?���(��(�ks���(����i����O�3K񮑻x��mb��[w*ʬ��8&�_~Ϳ����/�?�'�ux���ҭm�F�\)1Ĥ�����c�潪�-�wg/i�o��\j6�ҭ5��̷ZD�<�0�3�\��I'֯���ܬ1��6w	n"�
0]�2�8�T�`�GJ٣$��F4��&���D��w�(X�]�$�NW���b�;������Y���O��X����Cj�ř�o),Yى=X�rI'�����XnM�7p��($(��(���������$O�_�M��sCY|�����֒�VmT�e�d��$m�!��,����į�\_�����"Gin�I��3�,���!H$%@��O��!�*���[��d��B��i��<
���%��|�U\��7�܌�2?�����'�m�Q���S�LHҍ�jH6�%�r������Tt���V�����R��ٟ��a��Merl���9��S� �Fy=9�<�g#TDe��+Ӓ�|�\���Iboe}9X[7*={�3�P�$��NG#��)l`V��g%wq��Sޝ���9=(��Ҁ�?0�Y�k�N7B��;�xi�
9_�	��ք�4%<�r)���T��p['ڥ$��j�&2�����H贻ry4�@*䊌n'�2A8���pE79�>�
Ǩ��jn�9P���GZ$}��c�V�B~f�T��0�x��җ ��>��T�'�"��c9�Q�!��׎*���
�����VI�C�+���?�O�7�M��ς��[R� ����7�f���	���׊���M_ݱ��L������?a��'��(�ѵ�g��Z���m�r��c��N��s�|����w_�>��h- M�["Ơq€�+���1x���U�@~ٟ����+U���]m6���J�6���Qv�Q�����G`pyd�*�dW6|ןs�O��_
�^��G%���
��\Zd��3]-�w7n�9<���.�n����vX��h��Cs�1S,a�$Sp,:U-twԌ�u��Z��k�u
*�O�U�%��$��w=��'������B���K�_�����������5�Dh~�U-v����p���F��2��	��T��z���O�#�}�t��?࠿���lltkW4���:ǧ�+�j�z�����W8��rz�7�Ke��-?����/�	�']T��յ��z�ے|��"^DyW:�1ap���7�/�����b�E��֗�hڧ�ߌ�F���Α�K@�xK2	�������������\3
�m�vG�G������ݟ������>�,�ڇ����2[�����2��\�r�A��),�<�/l[w�_���<�e�C��>�|����i�ZEgi����Y�$�''5��vW3�^��J�$l�ڎ��E&� ��(��(��(��C���k~ƿ�W�_�Z�Wz·n֞�.��5b`V��UY^F�NY#;�#$?��Qۇ�����c_�~��m�1|0����xw�V��V�F���Ot%C��TH_�!V'��u*����i8ƭE+�=ݵv[���$8'�|g��
�������;��N�4�nV��V�̊8a.�8',o'�?�O�߳��;����������s��-a�������o��r'܎|`WK��!���>�v:��$�����R��2
Kqsr$y'V��q'vI''Y�G�獙>N�*�]�����?�#�죴���e�|^���<R�D�-�4�<�ϖHd�xZ$-�
�	���>"���hK2ߴ�����yv��a��.v�6o�q>dk�B����X���
�>(�,�!�M6�Q�8��<�c���a���?Iw��6���V��׼��v�H��W�ũ`w�cr�;Ol�7����+�^ �T��iS_kM=g&��;�~�?����X��?�}���gk��5�}B���+I;9��m�3^�����9�Yu���J�s�!UZk�KX"p�(.�8I��[�_��g�5������k��X�r���&��ڮ�qH����َ+�����'���<us��u���1{m_�w��4 �����1�dW����x��l��q�GRn�e�u%�-�s?uz�/N�9?��O�"�����s�Z�XG�u�W��.vN�j��Q�7/��c$
�ٳ�<_�>%����{Ɨ?hò�W�&K=433<L2.�H�,�+�{{h� ����---Fآ�B"/���@i�(	�}*�5��^cS�-?g	o��%��M<�K���/#֧�@�����?*W`NX�9*Z:��n����
v��~���do��+���#|�_[�k���A,F�`��<�����O�)��ڏ�_���	�|K�Ŕ����������b���U~z9
O��_���>�e̟����H�w��J�[��*[1��G����z.S��W��wz��]�j�N��c�׃��	����e���IA��T{ҟ[�m��I[�!���*��t����$�����$6ۿ�Ɵ6a1,�3	?4���y�c�Š���?W��͂��85��/�f�,`Ս�`JP0)A��ֵfJ(�<`�\V
�rpp
ts���cN2��E
8����|����8�;��w��mn;�_��T�������j�x/�?�W��#u�_�kŖz����q��8�ԭ�m�ΒF�	8�A�A�t?�q�<�|N��>��&���;��C��7q�O��;X�Ҕn�=,�Ua9l������\괝OK���7\�o��4mf�.a`���2�� �5�������񶧬~�6�|Mx.�q�5�Z�ía�m�������a�
#2��I�~�#n��{�NJ�*��ٵ���!��2+>Dl'
[-#���j��G$�\��8��YIYy�V��ߞ})�Č�}�*�B��lUy��ُ8�4�m �=��0�Ì��+.��R����1����+P��/�o��d��>%�sCeds��s����[�cb7�'�\.�_�A%w18�3_��S8L���q$����R�m��FXJ�@PG��r<ϙR,����{,|���ʤ�i7����t�hf���H��~U
�����eֳ��]��P��|%�2��L�
2��Rxf�2�!!���Ӽ��f�s�M2*�����^Q�
Q��৿���Yu�~�>��F
��H��	q����tL�Nc�8�j���k�u�(Yitߢ��JF�AJ�4
��;T�Q]g�rAEP0��(���(���(��(��(��(��(��)G�����SH��-w�5�~�߰��[��;{/x�No
�p�)�I��LE'��Ȓ�ٞpGB��H�?�zO�O�?�/�����'��u�7�v�ש
մR}�V���"Y7	�!��d=Nk�C�
Q�7�*��#�y�9����+�sÇT]2Y��R��0[u�{Di#X-�D�;ƣ��H�a����0�'�x��ޭ�i��,��k~�!�����t[��!dl�#��W����3���%j������B������W�s_��_�V�&<I�&�?����<�lL��:}�~����^GTM�)yW�ex'�c�[���~Ɵ����k�_��~���m'�|H�j�4k��!��,k����]Qħ���S$�W��P0==)�J�Oz �'�;�]f���"��	ЂsRd�6�Ğ��շn�%��8��yX������ئ62})��i<��*��OAR*.2W ��G����V�L|�b���8���0:��ڜ�=�E4���C(>�qJ@^���1ދi�|��}�X��<�Ҙ_#w�Λq���ʈs�)$�G��Q4��zsr���V��c2ʱ14�&GmW@r0j~�c�U���(�9���3�~П��>~�_�G�o����Y�z���u/���iR���Xe8���	7`�~��H�n�~Ÿ�h֫�O�~7��Уu3�_Β����r7I�NITమ+���S��_Ɵ5��U�Z~�K�>#k�'�-�4�)����G�
�d`�.>�^�?3�3��OU{&(ڎ��_�3���f�.���:�i
���C���~�-�{VI%��(������#�f����O�)��g�ǃ��П����M|��>�Gz���j�b�ƍ*�r[%��q�:����<�π�(xV����
�����G�vH0v7ߍ�ѣ*�ֿ�C�������G�Ŧk�a_ܪk�m����A��f�)n�[.�!]�:�T�G��#/��y����?yc�ۯ�}���#>��k��|E���s���5]*F$l�����̙�9��	��q��z�W����7������(���5��ߎ����M;�Wɇk-b!q
C7�
�$�����5����7�㟊���o����|����"��)�[�\�D�|�yC�)Bc��}�ʚ�{K���=G�RNt�꺣�� 9�)�����p�����QHy.[*+��3�jڈ��v��q>=�xO[���/�'�>��u
OR�E1�2Y��S�FK��/��k��|I���k_�–�y�_H��*9,�ƒ����㏃_�g�����/�MG���L_����N�"6�1�	�{{y2��JI�*�p	u<X�j��
dzx�u}���X����j��+_��~�?�O��|5��/$�N��;��Z�Z]���L@��5|�&4-;3��_�k����~
��i.,l$��W����q;�yn%U]�¢�����f�#�~��~~�_
�/�{�ׅ-|%��
�Gq[F��:*�M3�I�.�M{Myi6ܦ�ϤJ0�$�qڊ(� �EPEPEPE��j�^��jַ�A��L/quwu"�1F;��B�*�K1MhW��� ��"5��u/>,�j�I�N�7��5
]�d�\A�-mی�遑�+⏋���%�X�^>�s�e�3�C��.�/�
`��z��S�����0`.�/�3�Q��d/��n�O�>�����m�>$���z���y����ƀ�O5��ޑ�ϒ�0�`oN>�_�]?�zn~
�V�C�x�|}����~�_?fh|m'�.���Y5{�W@�� ��
7� I05��㟆��n��m�P_|��gզ����$�sB��K�Ў*¾��M�������n-oche��C���)�RA�ǟ�������u������{�S��"��Yx^�R�b��iq!��Hx�>M�g�x�u|�J��
cm.��+�yo���#��/�ۯ�	���/�;I���^�/�> �]Kgn,ٌIo}r"1CqTbf��I_�>����6���[�A�m�g������mr�ƣ"{f��e?#G(%$9l�x��ׂ�*x/_���v�0�W�����|ȧ�Q�3�S��e!��R5�q��k�����n�#�&�W���^��j>��ƥ�_=���-�k5Ŕ%\ʄ��Ğ5g:.=t>{���'W	B�q����匼���/�3�	��O��Ə�����儱]�w⛷{;{�m��YDR�/ȅĈ���4�#M�,��/O�MӭF����X�A��Q@U�+��w��|!�x��>&�w���-B��]��	�/U<����ݝ�qIl~e��׭+b$�,��z$[U@�Ȫ�(S�9�+=�Nr}���c9��U�:�����H�g��K��i�����>�����n���8��3T�r8�3�lK�W9$�YI������h5�~ŞI%7^"�ɡ4Q[����Vc�UB���ԮX�W�,��09���&���@��1��u}oŷ�����jG	�л�-�O�۲�KKC�T��eF�.g��ſ��"k�)���6)r6�xA�E�zW�o�����?�(�
�ߎ<s�Z��M�4�&�2	&�>K�v�I�F'�w�Z�:7��a�N��iW��
���_�v�ޜ���I�.M+���̬����	&����X�6Q�b^#�������~��V�T�)�X8�Mx��å ��ZO���@���	��kU��{rP�rI�JW�䯹�s��k���㞕�N���3�f4x$�R�<ʴSe4��02D�}rEj"��ڒH��'�J�r����m�<۷�o�(����!�>)h��H���*�7
ab���Q#q�����5���8����|��?d���o�M�}/Ï�nHV�Uַwn�}-�b��Zʤs��L[v����Y�Z�=l›�����K�u�I���#W"h��DxQ�*�a@�~:V�[s�/F���9�櫤�p�k�c���h�N6*I�H�X�^02
L$<�$e3�g=h!E6N��0πN:�+��֮�[�x��_	t�ka��<A���8e1El�q���]�VW�&�t��#۽~!|r����V!
̋f�
~F���)�}N����� �pB�{�c{�W����U,>"��ӗ�S�
�U��C�Ő�Nn;���"G��<c�~׿�-����o��F�ak4���i:$����� �7���
!$����~3G�[��ϊn�h��3��i{������g�0bOd���/�����������u�4(�mY$UG[�P�˕`��If*IbN2NiCY#�<�~����������QEt��Q@Q@����(���(��(��(��(��(��=k���|9��/���
Et�
xL�յ+��V֑���8D'z��+����P�'�Y�?���_ڧ�Z�4�l�)v-��e��Hib؋�8+>Ҕ��QW?8���_��v����i���w��ڗŷ0�b=Fh����x�ɘ���3+��	��_�o��?����ͪ���į���c���p����;�#(i��d���7�F��>
�+�#�$1Z�7Эt��b).U\ʪz	�I1�7Wd���rW��Ҿ��Aҏ2����1�CR��-/kyz��>�Y�c�aվ~��w���F}���6���b${+����#t�2a�v?�s��������R_أ�?�wƙ]m�M
����Yc�B�$�ve�c�p���wO�.-��WM~>S��Z�!�����+���H*PA�[Gp8�ޤ��� ���d�_��;�M	;�6�Zß�a_��i�Z���	��_�"�u	c֭�x��X+yҽ�Q�&ϝ�\�����/W�d�-/�ߍV�K�ھ�.��";�e�8���F��Gb��ae]��aoj�Ğ�<x��W���Y�Ɓ�2�nx�͝��6@+�|S�%��@?b�e���~���7�
�&�~|E���{`�N�&���w�c3m8=+Ζ�5q&{t�5v����OP�����A�|N����x�	o��N�$:�PBq+$21[���&b��&��ke9u�/�Exwş�'��ot�i��6���Z�(���)���i���_�\��T��F��]��~-逍_�~*ӯ����Y7��r?����~.~�ߵ�~�~<i0�W_d��5�i��e�Y�� �"�51����|t��=c�W�߃�4W��ω���"�Y�[Ȯ���pYV6/�A��7=+ԁ���_����^��A�#�r��c�zHW��9��)Ce�N$Cr̬�w0��F���\��T�ؒ�S_��4����Ί�<+��N���b%��S��7��L1���R@��U�'�ϒ2^���w8�6zS�o����e���e����#��M���s$��1��q�)g�v[�U�e�
�I�9?a��9���+X�KfqԄ�������4��ɦ�q��jz�h�������`�s���=;U�`1���2y����U�6x��z�03���␐1��7O֚��F�^��湏����<���X����u�ڎ�};H��F�ؒ{*����B���uf8ԟoz�`>6~�_��^��/xs���~~��`��'�2��<s��DU��R���ʧr֫˧W��J�2s�+s��G���)��g�~�qM{����Y?��E�M�Y�nP�L4��w|��y �_��A�3.Kq����i:^�ei�hZ|Zf��Ėֶ���Cj����ti�#mک�5�l4iB�V���l���h�2ģ�j�N�O��K�
J&���U���#���H �j��	4�5�����ߌ߱/Ǐ�;�-��?�%����J�^ �3$s��Z�'A�Wgw�`RÏ��?j�������M����o�V_�o/���=_J�.��[���k��]ơ
�ت�/�*�����.�H'?C_�ߵ����7�Z� �G�tKo���V���/-����Q����9L�r;�3�<0 ��2��R���G�e9׿U�{'�g��N�G������_Y��C�+E���N�����k�m�Sl�|����*�*0�n_�)?�oثE���a��_�?�Jx/�zr��]]�|�uA��D�-��`0��_�_�߷��umK�	���Kҗ�
er�z��n�U��#��U�ٸWX��(�g�gW@��
��#��i�x�
��D|g��������jz��{K�_&n��#�s��
�UF6�5�m�B;�.}��Y�[oc���-�l���X���*��sm��K��+_�~U�N�?sv�ǖ�B>�1��ğ1-��S��'���	�/ö~�ƍ��O�� ��EH�Q��]�${2��z�h����fQE 
(��
(��
(�.���������>+x�?���o{}u'-�BF�d�C��噈����w����?
�_�k⏈��<
e-��y7���!T|�H��"���
	 W���o�w���k�~!�t���F��mÖmc�x�&u_7[��hlP�����bI`A<֝�x�
s�U?i��;�w:_���[���ze��Ywj��Q�������ʊ~�s�ymjcU������{�z�qw����2����N�>}���
�Ox�z/���[xk���[X�Y�"���TU���ԒI���:v�!M����Ј�ֵ�?,�O[�VɄ\d.
y��/���?|>�~|\�0�F������H��X�a��2r�� ש�S]�ʞ�M]jv�n-J.��?�:x���?��탪������������uKm+Q��)owo��8Y}���i:����o�hZ�U�Y��-�^<��ȍ�J����_�T�n���7�l�e�C�_��$�d�@e8�#A�25�������uo��_��Vp/����5��cx����es�r1�n�B�J8���S�%o���o4p?�|J����|b���!w�?�]ב��+�El�K6�qtٗUы	YJ�$��+��w��*�?���+_�)�\8�M��0�5��f��/�or�ᑇ'8$
�߁�?�~)��>|L���?�WK�I�/x�|�DŽw����{���nK)S��������Z�U�ŏ�[�߳ŝf������5�>���`Ybc���3�?rk+u�Dž�9m<bPſgY/v{�.���v���s��֊@2��_�H�;��2
~q�_�7ğ����?������N���DY5�$l#i<�|�m��G���d}3�����e����ǚg�m�"�B��#ʫ��|Y!!�`�I���5�1�=k�|�$��I->[�JA6���8���ֹ�	�����C��֚��
)]�X�TT��c-H���$1��I+3[j�4'#���;�x�U���J��#��������Lр\��9Gr%"�0E���};��!R���{����IxsT�>��P~Ԛ���m=����]/B2Z�7��h��t�>v��$���j����9W������_�O�-|+�?|r�-���h>�.�)Gg1�;��ó�!O$b�C�	ǥj^��e�+W�m6��J�1�Y�J�+e�I�yl� ��*g���f{_�'��i�i^���
�ᮛsd [h����K!lW�Ɓ��7��e���X��bA�H�@�<��ϩ�l���?Ci���o�oŷ���~��S�*�I�z�8��ʡ��
���)Y�7g�i$L�㎵
�$�V���z�[��s9ӞZ�$X�V���t�T�GO�Z�T�(�ά�@�XgѴ7�����Fs����ҟ<?�K|
���g�D[[x�ɖ���[��yir�I��T��9���G���p���S��I�j/�n�e�^9S�[r�ŘuV�(U�n
@9�?L#Rq��#������xk����?���%/�OD�T�N���q���Rj&����NT���^��+��C�)8��.6��~t~��R���������w�}��_^>��
_�ml�]�6�mZi"Y���mU����R�أ�z��h���h�p�D��(��f�%�\G��PŔr@��b��y���N\�W�{i��iY�}��u��VmQv����ю=�s��_�w��U���U�m/�W�<u��� ���ցu"��-��(DQu�a�� �q���?�Z��z�T����1��$�/��H#P7�<����~��ȕw���k�+��7�.���m3�"YX�_
������7ҿ+_�
=�}.������?�ؼq��\�a�ǒ�	_1���9p�#���(����D������-���[y�ha��j����p[+����{�3��ښ���~����-{��gkst�z�!}��+��-�{��������������M�XJ�5�7E]X���2�2���WE�]��c��o����o��q�,¶�}��݂���/2yУ��o���l���?7�=�<��_��Kᶻ�Fi:W�<Ow&��Iu5�j7;��b�H�\�[$�5*��L�,��:����+A.W}Ԥ�ed��}��~��Mc����~�>���o�����Y����Z[����$�w�@>]F����������[h�6�ȱƊ0T`;5��@�<�_���R�����G�Mg���>��u�K&���������0���P�ҽm�Z_����˲�8D�J��OV�E�QE��EPEP5����(���(��(��(��(��(��3�W�m��_���Y��#�ђ�ÿ<3�x����QR}�yW1���BH؂V"@���@'�S_���e��w�F����F���G����Qx/�^$�1Oi�;D2O�O2��&�� ���G&����͵�1�J�G
�]��
gR����B�nbY���Ӽ/5υouŹILR����\�#�r?���;�^���X�%���,��I�U�������Vیmߏz�'x��X�o�+����Ha�W�y�;�BG�\�UT���>Ռ�w5�G�+G�N�\J��jpw���Z�-�'p*O�F~�P���G����k��}������7��t�k��k&��F�p�@~�+��_�G��g��^*�O��Oٷ�M����\�m�\��\<%��(n�׭~�˧��<�f���-��y�Z�*U���6o�����������&Ҧ������x�M��Yi�9Ӗ�,K��w�Q���(񍀶r<�P�)��kk�
����~Z�x����)�/���Ȓܹ�
N���u��Ď0�S�����#�p<���VT��4�~8���/�c�
E�[j��.��B������>�5�����dQ
�$��P�c8$d��L�š����(F��_�d��>8x:�K�2�ٲ�����]n2bÂM}3�T��>>��X|Z����'��z-#��)fi�X��uW�9�9o�aړ�R}Fo����>jۍ���C�KD��̓̑��aT(h���5�����G��ϰ��+n?���g������ߍ^�<k�Ǻ_��/�@�v��l�(x���D�AFk�Bn9^u��;���S�!�/�_�'��&���7�~��>�g2e�[@�aӒ``�,��H���I>�F�kυ~�m�?�ֿ���ͬO��V�Mi�D�
��4#�%��I%H�W�xc,�f�v�^7���y�c�&8�"���$���h��|8��C�!4V��k{��D\�J�t��ai�WYa߆�=F~�mÆC�u����R��Շ�\��Ԥ�N�P/\���f�1��ڛO��Z����d#[�Ϩ�����_?�G�_��O���x`�r��Ǟ���}�y��ƌF�"��d!�8o�סRǎk��V�c��~Ԭb�4�b���uV�Uu!�վR�`A��B5t��K:Wq�������n������?�h����ҿ�O_�1������K�h7c1�gߢMpP�,f6���~t�R������|c���x�K��nb�O�i�	6�(܂D̅��*��1_�����g�����}y�o~����Ƌ�oMm���h��r$��Cncx�
0�fe�6��6��G쯥�V�����&|n���,$�~Gysq�k��G�
��2n��!_?-uP�ԥ�=R����c�t�55��l�;l��
Á��M8���g�%�v�O���4�C��|5���U��nc�6�y�F1;n�!w��e�.0Gz��GU��^8��T���tx8���g�#�2Fq�����k_��߱w�mc���:���W��|�OY�H��
O��(��?L꺥����^!�u(<?�Z�]����Cs�#�����~ ��O�l/~��>���ϳN<���0_�q5�p��06+mǏ,&�+��䃄~'�۔`�V�j�{�����3x'Q��{~ÿ�'�+��ӧ�k�VS���=Y�Zq�g��J�I�H�,�4.��u�o�d��.~�Ş�Nj�/~1����?�~�̗�Z�=�Ellx�DdU6�3�:?mQ�_�)7����	��8��yo�?�7�퍕�K�����*7K����8XXZiv6�m���YXF�����
�
�ܩ�Ge��?N��'k=��[��+#�(��(��(��(���*�1¨ɠ_��6�Ï	���^9׭�1�
Yͨj7�m�(-�R�H��Tq_�~������>��?_��ÿ�N��Z�
�e���w�.#��/0��E:<����UwG��o��O�����:�	�F�V����-Z-[○���e��?�Lf U��B��I
�
�k��м+�i>�ޑo��	kigk�1F0���U@��$�����J�U��[W�����坒©.P@����[@c҅
O�ҭB;���ҴK�?0�EGa�6��8ڿ�iNr�����nՋ
(�MT�l��i|�UI�~�-�Π�g��5�%�~������RG�psӮ7c�q�Y����R�<��^��?�w��;�������y��խ���X�-�ҏ27L�����|)w�l��h�X/?mO�;�^{�̉�M.0߼R�0|���he��~�yD���U�-��*e�����Q�S\�W��{���ϔ>~�?�k/�߀��]|�[��|3�Ɖ�Yd��+�K<xl�ܥ�T�~[�����~'�~=�ies�:|d�VM?�>o��w�
�Z�!�X*�P8ݝŋ{'���;⟍��O_~Ͽ���Ci���G���̑ow��]��N��o��{�m��g�
�Ko��,-�o�zB�����.�`R��v
�!B�Ě�h쥁��L������k�� j?�k�دR�|+�b|6��o����A$��[�;��"�ƪ%}��&�l�}�����ÿ�^��<c���Ò��]��,�$_������չ�ѻsa�XE4M��jQF]��4n2?2���W�����<�?~����_��5ַ�v޺��a�6�[�\��U۸ ƥŭV��c2.-7E*5�I?5����#�:�sҰ��w����\�O�~�W�i���ڏ�߲��,}?�Jɧ\��}��Q����s��	��-�Mn(�ү�����H���� � ��g繾]��K�I��}�kF�ӱ�_���+��_�/���N��f�qk��&��}��Agm�(���?E�a���d/���Ӗ������%O��W���0�������
Ge��>�4�����O���t�KF�4�F�ER$�;"��2�y
���H ���&�mkc^p���^
}1WE{�C��ΞS֤����_�?4�#C�[�
y�?x"�������C�:���MKVg��f$�L���2#��?O� t5�������?l���d�O��2)�1��U�#͙�b���.ů�9���>�2�%_��{�Ų	�c��ne'��DŎA�z��Gi<���֪���A�b\`��
�q�R�+�w�	�g���[=��?֨�/lsҞ_r��I�,zQ}4	�EbX��Xʌc�fĻ�#��jw�iך���2�b�w$�`w�=	���Θ~\c9�K���L��u���k�N���,���2��T��d8��4
f�^Ӡԭ[ts��#�#��N2��1�ZN1��?�w��S����x�����=�\��U%���s��?�-���I[�*��p�|����W����]���(~�
�C�Y|��t�X�mQۍz�C<W�J��wH�}�y���m��� �A��K�fo�Gi��yN���0�V�tK>�Q��ٝ�_�aem�N�Me*I>h���yӟ�qS�%�e�������W�,��?�,4�k�1�����Pe{U�=#K��5��V��$��y���h/
�ԟ>|s�iP]���0��/�Y��Z�Z7��+߫t�gJ.WkT5�J:�F��5���
>�ѬZ�4Mj$�0�v0L�����#���7����]�ʹ���
���`��ýV}-��V���F����h�C�����J�$W���>��~$�6�����)�t�=�zE��`$��,��p3�b+��)8�g�{�\�?������Iմ��
�O�Z.�ro.�tKT��I���Q�W��E	XѰ��)�QEQE
n���(���(��(��(��(��(��C^�F~Ο
�j��^0�)��px���0������y��[�1Or��`{׹Q�Qa� G��j_�#���?��
|K��FҮ�|w��c���԰�Aw�|qB�wy��l%H��O�����i�O���e��[Y|��c���0	G��c�`�J���ݥ��mqc{i����::�2�U���?j�"����R|l�������m�C�=�(6����Τ�:$�wJ��Y�Z>��(�Lۄhb[�,��~�ǿY�#eGn���"mJ�p�I���~�V��|d�Y�~؟<)I�x��l!�`����g�&.o<H�	 ���\��_�w�MY[��_�4�V����M?Y���#��v1��$l�=kܡ�P����>;�X�2��4{�O���>�h(�
碾e�h�Q�f��G�������>���<��u/��ZcA�A�(�[�guJ�r	l�z9�j�2[.GY��c������@<��Q�9��MJ��_s���j��Td�Ә	���Yh�ML%E3��4�=_J��u�6�]е%h�lo�I��BVH���<��ǿ�_�O_���(���LZ�������O	_���s����+ww\�B����+����+������9�s�8�5:��_4taqUh;Җ��3�����HxgX�?���LK���6���~��O�U܆���v;d=�������/�?��-�Q��|'�i~ͫo�M�G�n3�h�JL�&����n�ʪNQF�W�k�[S��}.�H�,��&�3�^D�DW����5���	�o_|S���-k����ۗ7W�-�Ě%��v��դ�K0�c�ι�e�;�_���>���r��=c�k�>����B�%�����������֮mZ��1�$�R�B���X�n� �_�	h_���׾
|]�ĝ4EĿ�7�M,)0%�@X�*)�d�u�>3�ce�S�|a��ۛ�݁t]SC"�P�\��G�qF��‡ߎ<�����9|}�=��-�����;����K��L~��S�w���ͅ����c��qVp3�����V��z�j�^�_8����4��0�a>���Yt�Z��q�]������l�V����4�Og�?�t*�h�h�fw��I�O�*sǭ7�o���ĭ�F���o��+/-��O�ƒ�tb$��K��,�R.m�p�A�A�I^Qv���a?vM�z?�X��4_�kT�޹�Zj�Z�-�{��'��du$09t��_��L_���5ړ�	�ya���uoj���O�("TC�º��ws�x��/���U��{�����>
���]��7�i4B��(�1�
Ɠ3G��5o
��������Kf[Ic�@H9F`����+e^����p�"�:Y�������~'�s㗇�h?|����Э|ٵ>ծ|;�凐���,�${1Ϲ����w�U��؟��>+�F����^�λ��S���h����{�:�u#'���)^k�O�~��F��2�&���vG{R��vh�T��GF��du�+m��"��]�|O�������Yk����[��@�/�`c4(T��p�)֦�軧��x<=h(W���-������_`��o���C������7v�h:c���WD�C#�B��=H�_�^;����a�u{H��>~�>�!������L�
Ҹ�t�g�����N����O�|Wa�+�u��'��p�mm��I$���$�l'�P�|�s��H<m�/ۛ���S���!�y0j�v�&���E.�H�kR�)�1I�H�������*�>&u�8a�;�L��=�C�1����n|R��L��|As�H�Y�tŸ�m����e�4@pg$�?zk��s�|*���x'OO����h�e�,�+k8�(�s�fڈI$�>��y�VJ��m�
(����(��(��(��6�?�w�?e��'���S�w�6�8��Ŏ����V��;Wx��޴ȓV_�i,�&�I��c�yq��Q�ە�~ |B�,sD�9���ai�m"G��{c��;����x��f�����%������T�/��c��| �-����V�o�Dy�U�P�+p�O�$LvyG%B����3��
{��ď���߳��u�S�	����Gx<��;���<Cg��i����O��
�p8����U�9���o�/��׍��1���7�(�t{�v�����YO�.Ю�#�+(�{��8�ӛJ\ѓ��龏�kG��>�,22:��&A�8��`Ou�v�{֊G�rfrz�Ud}��x{T-�1׭6ؤ�Ac`���!2�MA!y�֌C��94�!}��m�NW�k2{b?�޺�E�<�Uw�NM6���0��0��ӊ��+DZd���V#�.8��$gKm�&�r�ywş���3�'W�u�O�6~8�V�ڴ������a��'��
{6�
3�+�
����9�<���? /�aO�?�t�x�����m+Kё�o㛩5=�3�;l�c6�)�+1v}3�O��Ǐ���������1r���]�.�p�i��J���ɑ���rH�~��Jw���� ������=S�?�
a�#S���D�����|y��bU��2{>��Ę��.L\y�����%�����1�q�GH/ď�>с����]�<��X)�<�pH�M~fx��'���#�;s����0�Mgw�=Vx��s���yZX�F�^BP�m�����{(��
s���t�6�o��3�cE�W�.�l�ęAj�����A��ki��ƽ#ú��d}�r�'S�*�;���n�cVM��r
��_�G
�����O�oo�yt�k�?�3~���RTվ
|;��g�7���:��3�ʺn��Em&g���DP�_:PJ(��~�߿-�~����Z�S���Ɲ����j#���o6`W��p��W�~����w76^���x���!�-.���º�C�)�uT���M~X��I�+o���'�=�@�yo����|KNQ�J�C��pG�$u�>vۄe$��TSq{��
��V�*�Q�/'ek��I������S���O��፥���A�ݤ��T+�ˤ,ܓ����$��9���a��R��Bvĸ튷+����6JDž_�)��w��̬s�r)
q�F*Ĉ�q��U�4�9-lR0I�Z�-�P3�ʥ1�G뚰��aE��u �;c�q�櫽�	,?�k.=G^����ѽ�\��L��c'�}k�����#|8�πe��*x�I�Ӽ�̻M�M$��k�&����.ta��L�\v?�`y��?5��G�p/�W췪��7��(��~s���L��،2��;�����o���\��n~�$$NH��^���_���^���]ѿn�T��6�aj����`�&��e,Z�c�skp�<n�W8�@���G�U���=�6���\B���0$3����/�N���*P��1���m�)}��ou��4�?B��dߌc��W�|0��W6Qi:���!���9����{�;�G"�����d+�S���~\�(�L�K/���H�i,?a��Pe�I��gh�ח2J?uc}� ���rN��������.��#Ya�&��VVXA_��~xO�_��(�֞u_��O}:�;\��[tm�RDeWF
��?~%xo\���~�Z�~%���9�X����D�<-}
6�|�%͜Cʸ;H\.I$�(�������j����H~1�V�����(��>�(��(��(��(��(���?���(���(��(��(��(��(��(��(���Þ�k៏��M؇����S���=h:��n�k��i�g�ha�3\[�Y௛�A:���Rq�Qv?|]�W���d�Y���n?��{v�LZ/����4{���I5�r�i�ڨ6�J/�|�y�
u��ާ�4�B|(�y~7�i�ha��{��tސ�'̱��<�#��,�� #�� �����*�/�O�<�^UB�� ��S���C�;��6>����.�s�c�"�*�,�ܔU^r���ھӵ�7v��V����A,[��9P��GB��G!� ���o�D�<?cڢ���<M��ʳɫAصx��Bז�+�T\a��8�W�Ʃ�4
�_���l���J
Nm5+Ӫi�S�ُ�1��t	QR0z�ϩ����W�7zU���;��[q@��G"�[�{�}�~{\���#����s�w��/M�F��Z�/����J�\��m$P��\���a'����~п���O���:��S�-F�in�?6FX����TGe���y���|�2�	b�Z���'��#��"�.�^y��~�C?a/�Z����i[O��1KA3�~:��C��N�f��m�1a�#��#8&�˾��1L���h@�=�-�i��sDHR}����U����c2�VZ�����]c�iT`�k�&��\�<RwޥO=;u��RGq�<���=�ƪ��k��-�Oңh���5.AQ�*j�$���R�F���T6��n������S�5��X�S�|E���^�+�e��*�e,Pv�� �^�i@Ϧ*%�+5q�./�2?�)���eMr���?�~�>w��;�	_��\4FKff_&'��1���Lx�����~Ŏ�σ>%�߷��-O6]'Q�^�Yv�I��*P��G�9!��S�+�x�n�m�3��q�z�3���w��eV*��������WO�'��M2����y�_i�v��Ë~�rA[�m�#�٢��2ɵ�`�'��	����R�K�_�t��7��&h,�/Mcr#��[
A�Y�_��$���(��߹� �/��\d*��<b�Ҵ��#��9�W�9��i~��?�R��'��Y�Y��-ŵ����
C�ѐ}��#���_,����#��g��ZI.׺�O4�~�T>h���{�
�����D�6�7�����K?���_��	�� �?���ݯ?�������D���`|5�7s�_c[�]v��H�i��T���'�b��:i����k�O���#~��2�˧�]�F��Tg�d�N����[��-G��s�h��Qo�Va��[}r�>]䕋�4��9��
q��*�S�ůMQ�3-v3M�~�:���p��{Ꮒ~6�>\���f�k]HԴ��R=Fd`���*�mX�#�X���O�$O�W�~͟u���:��G�S�7�|o$�\,R��4����#�J��]��C�.?����
+�_��ſ���?�¾%�Q�/��3��-���]F��3�<1y�<W���‚V2$9�s�<Q�x��?�?h^����M
��C��6�v�2Z�	�U,B<��W�ys��N�׶��a0�;����G;���E6�t0��)(��(��(��+�������Wǿ�(���Jv��f�6o��-h�,�\��6�n�H]��
r<�%��;�����~ʿ�!�x����+�^�{��K���#Q�I<�cA���9��Oس��u��ߴ��l�?����]sP��s������Z6���%�F�]�$�
�*���|A͡��J/➑�~�$޽�~���E�5�o��A�LJ���������+#�V{k�58{mBѿur��Sc�}��D��<��WQb?�'�?ʱu)5(;?��4�k��A�\�G�G�+?�s���t��Rՠ��S�KH���F
��	�{�,��1�8?�S��࿴W������!>?�d���:����fh�4�M��Y�Ibf�pp22|��|r���]|H��?h�E/?hO����j�x�IrL:�����eeD�t	��#߫F�zn�%f�%��yw]�m� �S�z�N�Fy��\�x�Zc�5�G�ʈ<�:�?�^)̸�J)	
�ɩ�S����d��)2n�FA�1�OLT����7���RL��T�ls�V���8�}I�9����7oZ�睥f@r	����x��E�*2�����89��>ɷg8�,,��;
�b��,�Q��Q�τ�s>fC@`1��o��������R���O�_5;7Z��rN�\�� Ò�
���9��E_���U��'ڛ��{���{�m?-�/��.�bi���n�zͼ�=����ѯa��I `�U��P�Up-��?g?�3�?h{���?h�{�����l^#T��K���G�Yg9�M�,��Y��p+��S���q�zW���o�G����_��x����<'�\j����۶bo,� �V�H
x��rA9��.���3,T������wg�W�_Gyx�|p;�l8�k�_�?�T����G���_�>%K�_�4�O��r�]Rxf�ᢗ�b��r9���,?n�(��6��I��ɚ��.vK�'��#|����iR��%R�����x�����zF�����_��5�^"�ui#�����rJ�sH�Y$�TH�C�Y��l#���$�wW�\�υ~�ٕZ?X�UPv�;?��������e���4x��&� ����v���Y�[J�I�\)
�0���vĐ������i�O�"g�?��:�_��~��-�T�5�!s6����[�W�/����'L#c�z&����uh�R����x�~�<Z�����bG���ʞb>"����K��<�2��Uq��z����;�IK���%�o�z�Ua���j�n?
�s��j�����-w����_�ng'�:���`�c���n`vey0#pYWy��i��I~5��2Zh߷o��/��.H�?�B�z#�ǖY�B���I*�	e~�#�;#�d���Ǜ��[�R�g�g�q>Ү�=�I$rr}j�=1_>|���	�}Р����?�t��w[�y��eA�4��"�Xc��y��d��	��z�k�%f�OG����p
R�"y����<�l�g�WsJ��9k�X��X.`[�i��� ܎��9�#��~.h���h���ѯ���#�׾�B�u��j�sJ�N�%�ʹF$�W��~�OQ�׀�п���i���¯�V�.��4S��ڝ�v7v�,��[ˍ���GQ�z�S�{�ƝH�]~�{�O����U�S�4�F�L����� �_dx������_f�X+����1������#x����9���hK�~�squtѤP�MĄ���ڲ��Y¨+&r3���L�o4-N��h��`�s���ޕ9���q.�]c�4�k�m�~����?�{�������:}����7�lb��ۙ,��3�3��o�d��v���E��r��ZM��jN�����zW��R��z��?���^�Ɵ����$�N/4i�&�(d�3“�iU{�G�\3�{]З��~i�#��@ �+���D_�G���b\[\�|F�Ŏ�vlՖ�1��H���#�YNN@�$��բw��(��`QEQEQEQE[����(���(��(��(��(��(��(��(��(��(��(��(�H'�9��e'c䏎��HA$>xo�W�e�o~Ȑ],�}鄱s6yİ<�ɯϩ����9��9���ۨٚ�G�Mq��i"Y��g�Ƒ�������Q�j%M>�*�?
���g��K��?�To�Z���-�|F-�H�!�+Ĥ�������?(��z��ట�k	|w��߷�����/����#�
�eF@fw�ٲGLm��pu~��Zө8;ӛG%|
����O�\�����m����ů��Ug�U�kXpq4�X�o����>l���߳��4�Ӟ\>/i~8��W��:'1_���fX�ؿ�ُʿ_|Q�Ŗ�Z��7���b��h�H挌�pFF�~K~��F��?���/|Gc�;��?�rx��
*�B��R@��h�*I#9�{�sZ�.f��ύ������گ����^��ڧ[��
�ڿn�d��+_찡�	��z��"(���Bt�]��,[��nh5L$��888����U�?��'�����;�_�����N����@��ݷe��Q��l�r85�S�ҕ���|�#(�SM��^[���#9e`c5�^���_iQ��=���Y�w��Gu���DΡ�A#9��5��d�^?�k�Q���U}��Q�g��8'<�ڱ�NT6T�"���%���{3�eI��<O�;o�:F��K�DizW�����v��R�)r�IF=�u�]����ů�*�?|W�~��9��
c��m�0����-�in.B�tkVfV'1�$��]R�)ˡՀ�ʽxQ�ս�#�?�_
������A���$���O_�>�����
	0yJ|��Xn¡
G;��N�c���/��~�~��Xo�F~�ֺ=��I"[F��I�*�$#s��$�W������,��d�^��QE2B�(��(��(���$�
Z�����|o��?؋���=��I��i���-�~�~�iU��I��RA26�n*g++�R�a);%�>��|k?�����@�uU����d�����q
�o�ه��h��K�\��P~U�_p��F.Č�p0=Ҹ�%�W��x?��G����м�i�q̓��y�L伌z�'ڽ:�PH���Y������t�7��H���_���8�3��5�c���ڠ��OC[��6�ia�X��~~~��n�ׄ�k��覟�A|���65�
þ��Ge����|�+�9���z
��==�J'ՏS
Yђ���U�<K�z����C���.x"�7ӼKl�uf$.�y�L�s�g�v��@ �##�H5��KY�����?
Zy_��]��S��!#C�f�#��00���(�Ϊ�Fq��ָ��x���T������`G09u"��+0�����~����%��7��<�'�z�P�����S�=�S����8�5e�F޾�J��O&�|�sA�t&�y
ҫܓ�҉;|�ٰ���E"�-,rZ�e�w�7r�{���Q��,���<����k��c���`�b�#�X^i�,�J����֞��{R`�ʊ~��g�N����
s�;f�=R� V�lq]%��������N_��v����sx����#�~�A����	5ܻ^8-#r��Gے�k<N"�ʥYZ1Wm�]J����x<,o9�/�n|������?ⶱ�$��^$��<=0���+f�J���-�̸�)R���p�w�����0��V�m���zl�4�˚�Ě�f�R��r'�i�$l��FO�[��ˤ��_���e
������
d���{�d�s)�ıأ�_fEzw&��|D���•G,[Q�v�_�.��K����Kï09��!*�'9���y[�di��''דR�##�)��y������H��V�$}��G{�1�kl�:f�
�\�E~]~�_�����؃�.�eo��Ś?��޹�K�h���ʳy�Q�2J�L+��s)�fؕ����ײK�}�2�C�2���u��W��?SdېN08g5�w��s[\B��\)I#�WV!��# �+�];�	y�~�������TkI���}͟��k{b�F�)+�$�:�����r���[�?�L��('��5�ʟ�P
g↝��i�ω��mm�Z��*�ed1�ڹG�T�c��;��{R5i�o�y~|���Q˽�+���e�fů�%_���/�����gƝRW�Ox*�kܟ�4���fx�ʲ�*.Ys�����j��߳'�
�E���#���y���"Yx�I�Q��G��z��~��o�?c/��/�D�a���]���O�*�v�<��WtM�N�Jd�T�L��eφ��w�}k��-<9�H�"ȺҵR ��pU�X_
�F�`׍�#�<9���d�*1|����|��m�{5�s��|6�x��B1�f�
�V���]�e��w
��1�Z+�#��޿(?�_� �z�ğ؟���e�>:���m�{��o�47���IC����ǧ=���![��ҿ��X�X�0�P��4�k�z��1ʫ�q5px��pvט���e�_��qm�I8���s���WVǟ8����]������m�_�_�$�|�(Us���!���S�+,d�ݰ~9�	�Q����P��KO|Z�c�O�ih�l��Ըhp�M��KB��x�A��<��Z�o��|m�;~��>6萵��?l#�G�b�Q��t�"U۶K���݁�BI��z;���c0���8'(?M\}�^~���I��7:-̧�f<���Ot����_Gk]����z�j��N�m-��-���RD>̬A��úT�h��SZNm具+/�ھ��ƴ�ޑmu�	.���7L��Z�K3��kt����c�!������٩����Y���xr�ZFm�|�.-<�o�+P������U����T�����:��L~+�TMse),ҏ�آ�X�@��1��*(�'��_W�Jo�S��
(��:Š(��(��(��(�ks���(���(��(��(��(��(��(��(��(��(��(��(��(��?(��A��4d���֊(@�Я%����!GRs��?�����o㯇5�W����I��V�ϳ�X��d
��+ W�QZF����c<<$�֧����-�O	jR���$��|e�&�����鷒��)�2ɛ;��yX��P8������R�aL��_"��~X��?��Q����i.�^"n'u�T�?9?����y��*A\��+z8���ޟ�È��U��S�_��u��P�`��3>�y���W��R�����=��I$"����D��:��<Z~�qjچ�< ҂����E�2�>RJ���k�?hO��F���.����;B�M�ĭq��l�\�ʕ���듃&�=95�c����?�ƕ(_���ſ��`�ζV�d�&r��eF�Z5�
�W�G<��*_��؞
�?�N?�>���/�����w�>���P��>\6�D��y]��UPI'�~d��'�������7��M<W�\i?
�1f��ii��J$H�G>�e#�#IR+yjC4�.��c��@_�����ࢾ2���Kx�m�.f�$�%x�y�~�R���ʹ����?g����<���Ŵ��5ӓN�G%��K;�Ii$fs�S\���X�G��~g����0rs������;�1�(��禇�z�QH�(��(��+�>7�i��=|.������?��f�w,�|ҕ���A�yX��5嘁CcH�o�;���_�q�?_���x��<A+&���X��N�[H�2HF�諒{g�K�M�c㏇�'�~>~�7r�~՟�����.W�����G�˲�oe�X!��%��
^1������g�G�O���*��o�?�+U�})j�z�#jS"�a�
F��}���P���v���5���=��x�»�3_���i/���pT�xϥu�p�ҪXYm�o#���]4?�V?0�a��p�=�{�z֚0�_hA�����V�Z�CH���$Rqؚ���zU�s�3k�򟌟	|+���g������|-�K�J����2�܍��S��:_$��:~0����	|K��~������s�|���;}�X�@
��~>gF<��v������
q���X<~���8�ԮnU�t�%�H������B�F+)�ԏOMT�R���[���H�I=y4�J�|��\s�V��;��.޽i$������֣�d{�U	�U݆� =N94���rhF��c%���$���Jp�S��qҡ��	��{+�D�#�*�ǎ��Yp��ckK��S�}(c�#�񿉴�	xk]�>�|�n���9��n��t2H����ҿ%`�������O�(������s�o�E�Gq0���0IY�e�D�v�r��)����
~ğ���y��t9�$�������l��Il�F���M����g�2�[�xZ�	���%H�ip��S�H��7���15����:�l��_E��%iw䎯�m/F���W
ү�b3:�}Y�U���`�kn(�FF1Ҫ@8��j�+�濕��"�R?��U�m��v�>��Yb��8�z�pz�����1$zV��76�P�c��n�KѵmU-�ܚu��"%��m�N1�W��C�i?��I���in5�?�5?��3�����n<�{+y
��#�aX�E
� ��u
:
B�����m�bxe�A�t�J��� �W�G���V�t��K���W���7�u=:��47��{*<7��ԗP�?�	����x�O��R��j6�s��g�'�Up����v�#��������&��K��u������K�����jbMp唪���B�$�ڿ5}��xg�'�</��j�k����}vOkr�$R.@8t`y��|o�v��<>�A��
�j����<�.���b��3�郔�)�I�qʕ`}I�s�?��|-�'��[�i�χzl:^���q"�
�P�H����aT�����{��V�D����?�Z
j�M/@���ݝ^�J�G6���W.�l���"�ȁ��s�ң2�-_�����nj��N�h�:�|4�|O�����ܢ[��H����Y�T\�O�8&Ga_�3��<����*����?�J��Φ�ѻz=O�ߎ�zO¯�+���!������u��-ŀ�m�p)�*�H�3�>`��Ym�1�y��~P��F�/��	i����z��2��[X|�##{��~�;a��¿V,�Pw��!���-��2^�m/�����8È�㻄[��K2��u����?-[ �߅B#�9�	��[?�]�*38���lo�����<s��ƙ��)u/jj?}c�ٰ��h!�������Wa�$��l85:8�Gr1Sn�c\5gNq�wG���CU����>3�t��|g��x�NBO�uk	7v�2�H�ld�ھ��G�J%��W`��gey��
�S�G�-?e�ڿM�m����Z\4W��Gg�x� XJX�0u�gX���8$��:�f��EX�r#�5�/�3��%��{j+�r�>�u�w_s�|��i����@<!,��Y�<7�kyc*n!��A4��m�)Fs�Y*6�k������;��@�b��t�|%�{�>x��y�6��W�}�"�~P6	���H ��5�-.��>�*�(Iz}�/�0��+S��(��(��(��(�ks���(���(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��i�i�9�E\..zc�R~�QHAEPEPEPEP]�5gv
�2I�~�1�ޟ�^���Xx��N����4φV�I�G�x��b_�N�-����l������W�o�*G�����5]�j��h+���(���m�����+K}��n��+xǁ�#ᯃ�
���v�g��V�m�w29�Vwv�ݷ1b$�+)j�O��!���Ժ]��E�7.n�IY�l8��kb�T��>��kfX�y�$�������Sۭ;�θJ.Rr}K���@��ֵ�0:�MG
���jsҭ#���I��R=+1ݗ���f`:��L��<�*$�z̹�O}�ӭkF�qX��3[njUE顭	i�(���˿�*��i����)��?���{���I�e��dT�!#_�k�8'#�~g��Q���g��֠ɫ��^61�V��lu���ٻi�s�
��Y��s'_�����Y�~l��<�:��na��JT�ٞdev��7+����ʒ�U��l�Eq�+?��<��d JϺL|��U)\ƬKɼry�I��Ȭ���nI����a]�2Tլ������A^	9��L���:��)������ğ�
��'��3�8r
D�;���[+�O�Y���6�&ԷP�9��=1ך�k���[\���P�f����įk��
l��1��˸*F��|����;���;�*HE�I.�q�w�l68�3������RY�R^�,��u��_Ѷ�5��~/i�ݡ��8��h���ï|M�����׉k����$c���y	 ax�9�ڟ���eO������Z��u���D�uq#,P@$l��f�8'��Ÿ�/�7����s�~��������ůxw���M���c#Koom�U��c.$@0t-��/ɰ�I�q2j�v�y=�i�{i�C��v&nJ�%yZ�Iw�3�/�
��ch���h�
��~	�I%φϋ��X�,�b��qo���"(�!*927��U����T�Z���
���o�_
xiL�\)�Ik"�@G#R�(�����B"����O=&�g��R�N+����nI��-���97���~i~��
��	�*�^���s���/��ke)��wv��x�961�2��)��B��~h�r$Ȯ������=��G�o�?�����k�x��nc�6�G�5�+G��r��ia�����A�z֡��:�y�zX�b�5N�z�(��i�Uk>��	Stj.h��_�?������m>���^���s���-V8���u�֑�@Hyż�I�9$*H�q�U�[���-�O�|<��R���V��� �YQw'�˂��*���3:���O�=yc��_o�x�����B�9�ng-yok�V���'[�R�-��������<}�]~ӟ��G�c���w��]*�M_+e�����H�os�2�K~��Rb�?�_��u
6�F���y�E�9u/j>�F��^�yi`#��ˀ-�0�]ԯ�'��V���������*�4muy^A,�}g�y�fy?6E���Gj��8�gW	�1�n���Y����.���~��`���g�«(.���ZH���
h�}�V��-���i�'ī�L�����o:�Ax��������`@P=+�����I�M��{xV6�|#�x�^�H��B�-
H���Q�B�,�*G��?��?,`c���c/�n���S|��⿤D��^EҜSAP�c8�v"��!q�u�8�@�ֿfg�Fl��9)!�n9�O�����2��j[����<���w¿��O�)�e��Y��
�r��mu?ygt�����RA��0x�|��|d�����.iW�_�j��?�W�v�
j��aQ���xn�r7���1�#+��gc�x���Z]os��B�)+�u���G��W�9�hOك�í5c>'6?ں�̑Ǫi��n�yړ"�9�8���'_�9�~�������r���&7�]��-Z�Dbh�$D�24��_���g�7�.zq_~Ś�?�_�K�g�ng��Q�k�\���֬���Ė1�Ց�m�#|�c���M�+�s��oj����-W�Z��_���E���QEQEQEQE
n���(���(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��*��{;y���[k[T2I#����$�xI���7�y�C������֐[��_�o���y�c|���V��n$x�"MjeGv�8�2�3�*l����ž��m?�?����<xg�%�~�
u�?��ċ��BH�5�,6�U��P��J�P��}���o�N���"� �4~xM2�W�e����K����[x��S���,Q�&�a�W�B),��?�w��w�G��n������Zh��C��8��7W�4�L��	YY�\��[In7�>�6u�M˗�QjҊ]m��mj�������On+^��j@��!&1�]	l)(�awUY&�9��m!�G�T��?�
�:���r}�$�OS�*
��^kJN��F
I�����zb�`d��Q��V��Rj��}(€	�.��0j>*�����an�7��.����G$z<-x�0Q���n��St�D5��4�pp+�W���o�<
�Q�6<]���x;��6�Vk������g���)!a�/4I!?��,��k:���2��X����d��~�,�ܜ��&���8�gYK�][L���$d2��dpj�)�j��#{�Ϸ�9r��8�npGQJH�,��`�\���X䓓Ҡ���t�(�Q�e`����q�x#ީ��u8�aDRA)���v6�l���2�MR�F9�[G�6�T��>*���|�~:��_�xiY�Q{�K}��Q���v$\�e��(��+�g���b��_��.����H���C���$V���{�p�!�v0���^�wM�:�I�� �k�'�E�%��C�Px�)��w����ϊ�js�[$��q�hP��Y���*��$����~�?+��a�R��V��i}��v�H����i�1u2��������_s}��o���П����|7�|��R�l�iY!`�ȌUѺ�9����J���,�0�i���fb5
���B�I$�������)e^ߚ�K�W*))i���e(���)��$q�(��־/���oo�7�]����,~x��PGwmgu��f��$��"dHL��X�.	8P�z��~>�*����i>%���l���~bY��|�޼\^"��)IA����;�хK�3M���Ϡ��y�
Ξ�S'={W������_��=���v��'Oq�jz���Wt.��ȧ�tRʸ��+�����Ŗ��Q�8|;���h�,��Aj�Z
�"E���W�ڣ*�
�z�xZy�`�0yK�֏�N�}�e��}�K��Z�u�l�Ⱦ��a����--�]�$�GR��hz���������ޯ���	��[����L�f��-�����Y��˻hرA`J��|sO��{~�:�nj��~�y�7k-��7�>�3\j��<v:��H��P.In�$�9$+��:���b��G����C�d?������ŬP�,��ʻ��4�w'�Zi$��U
0�����
,\uS�K�8�_�.��N��pqf1��T�������cm����+�o���Oه��5}^�[��y�^���j��ơq��i�-&�$�aNq��,y���		���^��z~�v)�{
W�6W:���)Xu;�na!Ab�"��K�8����M�,��5�Z42���Ʀ�fi|�5�^ݜ�gD|�b�T�U�O˻�/�t]+�Z6���=+F�m�����a"�%���j|f�V!�g��I)%��v�m#�|�`%���[�w�}�V��~'Xj6����e���w?����x�/�M���y�lI9����Ͳm�?�?ҿ�g4����[���0xR�S���4_\]�ŕ�Ku������ȍ���\< ��;��o��t��I[�1v��V���o�N=W�\M��=�����$��d�s���x�팞��~��k�R��������k^W
��#�Ҳ&��2���Q,s��)�v=������GJ�$�'r?J�yӪѪ�1�������_|1��O�:Rj�fi�tF��ir��� ��L0��Q��\�p���B�������������)�IƦ[3l&c:5aZ����Џ��|+����o���g�>&��Ō�#1\�p@<g+�k��	U�|R���`�]�Ak�-Q�m���m!K��4��{ت�� ��,N0k�����G���F��I5�
(���
(��
(��
(������(���(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��+�o��X�-�_|*�~|n�}��<?�C"�\I��	�p�6��Z��\g9W�4Ri=ӱ�����x��6��S���z�|Y���tap���^��iwQ0 \:�"	��@p�W��S�S���?����O�6~.ЮР[�XI�8e��P��Z�X��b��_
���"xK���i �<�5H� Ԭ��yf������"�H9�_�_�0E�~_��^	�i����D�u�1��uΟ�����U����r+����?�|L��,��y%��i[�{�}������	�k�i���K~ĺE���[�xj7b1�O�X��@�7���/��^	����ǿ<Mi��x��n��l�<n�:}�R
�6
� �+��,�3G*o�O��2=�F=����?f��?<[��g���K�<u�^$���5I?�֡�2F"�E��m&B�7RcJkm�����3�X��S��K�]������~�2��w������f�O�������&Ч�9���}k��Ĩ.	RT�X��͈�e���H��
���k�2RZ�l4���j���I ;��O_�ޯG��#ץI��sH���M"c��=�Ŷ���^��������NOӓL��|I�T���9�>~�����x����,��iz��i��6���X�|�"H�'%����?8�o��c�>��:_�7�U��u?�_b���u}3��m6�h ���-�4v�t�tdX�#�)p������Ŀ�?�����(�X������tW6���{gki:,w��#��T0@Y�o�{/���u�?h���Շ�4�5_��Y�En��
�h�.��'815�ƅ�RG`ɮiG�.L��'�>���c�ٯy���˵�����W�����1��=���x?N�A��C�	�����F[�xYp�c3&��n
�Z7�\|9��N��?a�G�Z���&�q���Qa)I���6���S]��?K�s�W��+h���.�f�H�l��et�+�ln/"�r�8�IuL�q��X�s�,m%6�wV�ﮱ�o���O�(��Gj��|Y��|g��&��wۛ8U�� ��
�l�����$�V�
�z�Џc_���f���t���
4�\&�
���}1V/�['��*�Cu<f�h?�W�iv�7��k�?�-"�d1XjSE�[Em�QC��W��v����RKus؏�W��7�Z��*��/����${���4i�`���X�@w&�O���u�����
���u�5�崛P�ȩ(�9
H(��@<
~K7��W�4���^�P��i#�4�M��fZ��,v�1�&U�Q�$k�	~�߳�4KOh߳�SH�wu��O���v��p���3�NH��Oec�G����)��Y}�>gq�_�+����Mo�@�x����`������,�\�+��z�/��U����~.���K`���›y�M��[�t���(�|�D%<��~ϖX�i�ѱ1q,#�d#�؊���G��7|}ԭ��x+��Xok_�mΝ��YwÅ��)u$7�`a�g��r�Ԃ�ov_�-���c��H�-��H� d��+��@���?e��?��_��x�Y���"h��u鄷RbB������ɯ���=EtBW��X�{��w�v4�y=}��?�C�V�j���U��|)�W�wK�x#�h�#�:�E)ǖ�J��09��8=:l��R����)'��Q�R��Z��(���|E�	��W?4�C����E��S�7\��˛T��V�P�m;���`�`I�8������~W��߱����W��?�±���*��|M4y�\��WA����X���b�(W��hK8��\��?ڧ�2
[���.n�վ�f��a�\�rW�X���V�3����^G��/�g���׆^$��h*�ˈ��>����]���>3|�����V�x2S�h��kym&�~�*�L$Yř��9f#�3�������?ᗄ.�?���K�j�v�6�d��$t�F�0>_���_�G��!Ꮘ^��|i�[x��^+���Q��<7J6�:��a�_��(��B���~�_�g�e;�����f���U���"�_0F�X��⯀�C�`����$ogk�{��^��}'��Z�|?�W���G�y���g��E~3��~A�K�W^�����'���qvI,�Yd);+8uʳ"�r75B������^�5㯃:g�-<+�?�w:�Z\1��
�-˅۹Q�R��+��[�f~ş�G�q~��?�/�W8��JY���^�7�9�(™��0�%�\!%Us�xGĚG�t�z�_h��wV�!x�P�{�����q������Oe������{=���׸*W�j�Q��f�l�[��o��~h��#|i�^��Z���ʭ���W�W��#@6"����P��1��G$��ฟ`�7������Y�];ZYm�I0�q���R�	B�-}Q��Q���oۻ�/����Q|����o��D��=Z�Lq���D#�~�g|�3z���s�4���V��O�|Hլ<?gf�Lҵ������DY�ʨ�� )3Z҅XU�|NQ�&�7ܮ��_�N*�+HƝE�^X�O������_�_�_��;C�-Ḵ����V����F[��O�^LTI<�+ZO��?���|�g�ϊ~)����4��V��������d��$j��3�_��𲖒O��V'��;�BL��$�\�,y��+����?�����{~�Oo�G4�����c�i��l�XG%�4EdHpN?�xS[>̩�i�\��Q�������� �Q�pU1���a��G���*>�s�e_�Z‘��S_�|~�Bc�#��&�7v�@�茻UcP�  ��5���ch=����Z.�l��v�k��I�b� �U��ӊ�G��hѧPV�RK��~k�K������!�9�j���瞜�$��Tpy�nku��Uؠ��s��������0N?���m<�J[���H�Q�x�d\p\�_�u���zz��<���Z������֤q�N��e&��I���7��&c�\���>�⏅��?l��zT���?�sV�Q�����[�Ӿ�5^0�]�1�H�� ������|L�W�� �/X���Z���"��2���z����t;m[O���aY��	c=$R��W��,�&��Oǿ�~4ԍ����o|8I\��~�����v����	<�ĕW%G�1�e�~��j���5��G��O_�?n(���D(��(��(���?���(���(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��+��
#�����ߴG�w�l?��-dž�dVz�rY4�T�4�΋��\ln�k�*��E5fEJq�\&���=�g�1�7����/�SV�&�o�E|�]/�~�R�i� a#[|�i$F�RU�3ֻk�.t�Y%����`��_}����M/��>-��_�9�g�ڏ�V�i-��-�fE_.-R�����lg\�x������[�n׼!��
M�z��+�=�vt ��KP!ȍ�=���2ʘ��hbG<�m��<+�Fr��+������_�|z]#Xף����	�t�ҽ�����9Q�z~h��� �|6���7~�τ����k�φ��a������D@U�X�X�s!��0l���_^�kZ%��<�Yx����mo�ْ�)�nU��gGR;�5�k�	���
Oþ-�W�ljm�����-����7��5�џ��\K�����It{�/��6}WS�[��8��sº�摪B���%��Uє�eaЃ��Q�_�O��c�&W��<;����+��~ ]��~�!�a�y�[�@����"��(O��������'�x�K�uخ-��kV�qg}�8�9���[qVR=;�V��_}Ϯ��R��9J�����?'�Kf�kF��K˄<�l���%� ���/|F�/���ז�N1���_�?�l�8�F��e!��!g!W���I�mV�O�I�|��j���qK���e9�?�|�R���g���ζ7#}������q`i0V�=4>�p0�c�ް��-��c�T�)�~Ο�����Z[I$|?i����gw� i��V=ۦg#�
��(�k�+]J��N��\Y_��Mr`}�$U�+D���ݛ���K�Lտa�ڛ�_�׌�1�-��^.�E�:46�a���mܷ�$�pf�%�>O�~�]xg��ْk�k�W��n{�k׿�����c��]�>����o�;���t�Y6��_��сS�N~p��ߵ~��@�|=��_���L�.������)k{��G�N�N2p^��#�>?�eU�i����yK���;�I�|"�p�X�Y#����g?�Y|�U��U˒8�x�~I����5��A�QL��Q�����)?�VrWQ�In2��t��k~��Dž���t�v�S��\���w��5� sO�Q�0�wT�]xs@�/I��FW<�Z�d��,Z|��0���ֽ�	�8�sP�s�C�Ԟf3
�H�g�"�F���^���6.On��;!��Ǒ��M�]�*S��#���0˃���#8��N�*�<�ǩ�ă��:�L�ur6U;�ȯ��i��s�W�>-��h2h_4o'D�~�#Z��s�#h�B�b$�O�&�!�q���
8=�`O�8n�S�E�J�(b*R����%�kF~>X|N���~�v�F����ߟt��	G�U��p�k�7�F� ,��0�A�ߟ�g��4~�=Υ�K�M���[�&�MFݙw������rRU��׽�j�����^U���ֿ>�h�'��C�~4�t��4����ž
t�uq3��#�{'}�6�U�$����/�<�c��?e7��>������H
�h��Q����~'x�_�⟇>9����<ee-����^9���A�.r�0�~
|4���$}���5����{�3Z��M��ǖ�6����yŕ痆�H�͋�P�2�D^���������<m���4�S�!H��zwh�QI�BpX4gj�@+�]��],5�(�>0��r�]�֥o&]�J���5�2$� I)P`]�F��&�N ȪէZ��J{���[4ީ�Ѧ��&�w'�rb�����g��{i��<��{��~��G�M|S�r4�-3O��ݐ��,�<cjB���>j�y�-�_n������|P����/�v��;��V�l1��a��^�\��G*�0f ^����/�|�+���'�z��7�o������$
]p�˞�<���	�<�7�>,��_���W�&�s��Y�[q$�6�E�<��(�(��cm�#nE{�3l��c'����ͯ��J0����o��8x���0Q�%&��Q�v�nMo���mL�����x_�}���+��7�4z��5�}���-�	-��������n�Nyo�ҏ��`�'�.�*?��sxsD��۫��>ө_LIc-��2g����8P+���է_������¨T`v���s��_�pQ�iZ	'�m��z�^n��$�?��E�G��f��+�]�k��K�o�m�#�ǵ����?Z�WT�=k�yX���ypp>S��ZS��8'�@��y�}�3�S�
�8�'=EaNbz�G"��ƹ���ȩ��9+��v$ą��gҳ���+F�J��5@�9�*vg�]6ł6$dt��Yb1��=�"�3װ�؆�8��ۄ�mM��.:��߶��oi�5��~F��o�y6�gd(�ѦU]^Ձ�X�b��]��9����=C}WP��,�J�]\nVR0A�#��D�uc�0��P�
��������q��%�s����z��<�'K�T��0&�L��S(-�h�)"g�W�W��	�hd���g�B�ik�߈_
��;��v	5�<��b��=�y`���c_���+�O�\��8xW��W�����QVw�Q@Q@����(���(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��+��׀��;�Z��> �f���M��:����J�2�̧��A�u�P)E5f~
�]��;j���?�L߉�|Uey����w3�xWU����!����Yѡ©w n<�W��+_���Ë��o���Y���>!��L6�>�zʰ��$�B�۲TۅL��W�1�!~���c��߆z�m,Ra�^J�ol$�
4��+�`�0da�Un��d����|�pV�g�����_�ohZ߇�4k}{�>%�K[�>�CC$22r
���K�>�}��o��U�~x_R���$꒛��
Fd�Q��̒�f��d��`u�g������,�Ou���mٌ�^�:[��J���{�a��V6C�P
k�|c����������l�d'�f�\|�ML��1D|�,��rJ�'��F~=W�,�)B�Js���_gm�%ѭ�7�>��C�dO�X�.��NX�#�ͭ�v7+%������)kyU\Ȍ�
&㹔���&��F��~ �W�O�C�5�Ν���^]_H��c�o�)�F�Q�u
nL��RC�~Ex�eO�)g�/��1O��f�����^'��JռSfγ�i����f�Dt,��
����M#�Z6���N�G�4Kx�m-m�c�(bP������UE6��p7C+�9+�N�I��K��o�5(���>�+��
���T�r~�6�i��_�+B<M��U<[�E3�����Ŵ�-�q�����Q���#
��J�o+4����t����ᾋ���4�&�M�����k����1�s�O*���WҶ���s�_%�ڿ5������z|�n���0o3�W��in�m����ʒ�#ﺍv,���K/�~���z'�<�A�x�w�j��$���n������\v�*y�d�f~�|+S-��z�������S�lTr����tO�O�ԅz��VNJ�F�r�
Ŗ!�q��S<Y���$'�_�D��Z��O�z��j�7��ݹ���q\��H緥�x��)�i��7�f�x�I�Ƽ�)�6u�O�Et�z�`vi\��c����1㌁OV��Y��n�z�Z���zw=X�=������@�|ž1�x�8 ^
�m�x��x�5�>���'�%�H�y$g?^ջ��q�����QR�&�5u�GMV�|e��RF�N�f8x�sޤcЁ�֜q���U((�-�p<��$�wLqM�n�M�m�~���R�[�;`dsYS�y=�_2�x�+>U��߯zI\�.�i�'�N�b)8��*���8�H�^����Gv6Q���تS�=A��L�*g`z(����V�/�����ֱ7�U��ſ�ɬY,�'�s��Ry8���ȸ���$�#��F��W���d�q�~��k���f���_+��� 8lv�0Iy㚸�ѦՏ��n�����X|R�kj������	ʑ�{�0��`̬�}��PE:+������>6蟴��㟇�#��~&hVڙhU�13���C��Rut��=��c��hfA$S!GC�H��W)���τ:?��5�ښ��e�	u
F-]�nⶆ�[;)Y�d;Y�av�+K�3üթT�M��G���~��E���QEQE
n����-W�a�^��s�QL;��Ҝ=();�EP0��(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��#�)�PU�P�=M-PEPEP{�[k�k�+����r� ��0A��u~%x_ǿ�J�XhRY���	���T
{X�{���7�w�ð����Heo�*�W;��	�{�~���Y�ŭ�cŖ3�څ��&��F�D`{21��[����&��~I�4����E�F����Ú�����P�͝�h'�A��9�uaЊ�Wt�_��|A����ا��տf?���j��nY�h�-�O�\L�-!��w��Qq_�h��)BW^g�ٮWS^T'�g�ta(��*��75�ç9�vɫ���R&%�ds��o";�w�+��d��g���=�6<�U;��ROG�^�����Z[P� `V�@'Rg
,6��ge��ַ���5���֌d�9#K��Q���ry�jv�:U5��^*a4m���L��,dw���Ojf@�q���JUXF�g�$I��s�4�� g9���$�̾X��o�\Y7���JWj'�َ�B�
��bp*��*FrZ�i�ښ�s���y`	�p�Ԁ�	���4�}sVԒ�
��J�+@��k5�i>��jUX�8���D��T]H<�c<�(�<�˕���5JF3��jS�9]k;3u@j�0sҪ�!$�Z�H^RgLf��rÜ�x�ҷ�:� �V3�Cg�Ke�����Է��f�`PFq���H�+V�F�[4�q�XW����K~���i�c�7����q
�����U��"���i�$�#,ON=�I���1�׮ƾ�<u��;�v�l��gӯb��Ѿc�����[�,��q4��/�]W��6�v�������^Y^ƳC4LVV`Aub�"?��o����o�c�U����u�.e����A���_9�Xᝈ�dRInX����WW?�p؈U��M�=B�(�nQE[����(����QE��<H;��TTPR�'���Ӄ���P��`�w��CAI�Z(���Q@Q@Q@Q@Q@Q@Q@Q@Q@Q@Q@Q@Q@Q@Q@Q@Q@Q@Q@Q@Q@Q@Q@Q@Q@��G�f�ڏ�c�F�����
��������k2K��[��H����k�������x��e�_��:յ��R�>E�(ȭ4l�?�E~�� ��xX���?�Z@���Ggw�S�����=jS�[[��bVPK9�l61��M��;�a]jkߧ��z���ޠ�
A:��H���*�s�֭;�b9�n~.��2�C��Y����Q��=*e��,8a�T�Ε��F�fN	�P��I"�
�UL@���)�*n�F2:��\���G��J������ Bɴ�=i��#<�U<�0�*��h�i�rі��s�T�0��VjL�g�8��N�F[$t��]9'�&�1��U�����y54�+��+�����=i��R1Z\_F��=s����9 �'�_�+6����+0ˆ9ڡ������u6��ǿ�5���F+��|`�`֊��9�G���h╎���Vw/��޲�[�r'gln�M�t*��$��$t�U_-�y�nkmb��&��#���
To�Rۆ ���[��ÓYi���Z��r�5��B=	L$�q�j��$�ʶ@�`*#���⟩�:Z�����&��8 ��2��i�����9����#�%;�'9��#��y�T�EF�*1���~�/�����g�@�����_i'�~"�	3�۷��mi.m."���u���?t
wI�F����@��S��X�,�"9Ia�C���e �斷e�k:e���YE��Z�Mͼ�$��H�V����	���u���_�'�[�?�0��_�����%�ҥi��;Id_�[N����V0�67Q�����Zx�U�|�U����Т�+c���(���(����QE
(��
(��
(���zp���ʣ����8`{��zpb;�R���	��Ğ���T��$Ţ�(QEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEW����O���W��k��&x�0~��>-���A{�3̎=F�V�o�b�H�a�����Y�7Y�������%���[Kgw���̥$F�eb֦q���?*<�
���>�o��	x��=OK�
S��
)v�w��W|��9���.?c�⿀h��W��j�u�_	]N��
j��[T��&�JZ+)*��*���AȬ�+����X<el+�-��n��c�����J�\�NMb۱89�8�Zѝ���R�T�t 99�R(s����-��R�vI�LU����)υ~�]\�1�D�rv���I$1��<d~S~s�*����Z��'
��9���:���q�����0y.�˂6��8�ORi]��p1Y���v��_9=�Hw^���k��9�ne�Du��sT�^8�kvT��VL�9�)$pצU���^�H����n¢�B��X"|�٧~�a�8��r	�lZ�O�ڣH:|�o~j�a�wc�H�h�i���ڠ/&��'�*��
L�@a�5���.�p'�N*X�$m�HpX��{Ո�g��d���h0�@)s�=�҅�$R[q؂H�a�U��3��Z���)N}(L�ӹ�:��vpU�^X�a<x�u�g�'9����R���+� ���'��[_����G����
�<W��I�'�̯��a�6��g������,
�O�u9v>�-]jpүWZ�Q��a~�?�Dž�k_���9 ��V��z�F��5�\Gf��6�k���0�W���[�ڗ�G�ȱ��M�c�S^����Uf�N��Z��ȡ�SP��J� �ŋg���ium}km{e:]Y�F��,d2�8ʲ���UNM�=���)�pѭO���OO�f�QEY�-���(����QE
(��
(��
(��
(��
(��
(��1��OQ�*��
Rh�0=�j�(b;�R���	�ć��?�8:�RC���QEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQE~�X�'�ߌ?�����{�Z��ߏ%I�
փ�;��]9��g}#\�퍪:׼���,q�R	"�F��d�9�_e�ן��T~�~�RX�|I�䳎x�9Ь�6H8_:5���A�~6~��|Q㏂�Z'�I��,|�o��Č���=f����b�:����5�V�����O+�����8��}���v�֌m�<�=��^�Gz��8�U�����/y�c�4��*�7U뚶��I��ܪ��O�Y�N?,�V�x�orC��t3��C���`�A�~�E.[wS���:�!��YȒn��zV>r�f�uv�;�zցP�⹻6����,����CG���̈I��ZA3ǵl$ �����qԎ��
�[3Bp@\�Ɩ	7dv�5��UG���f�U���#���s�[��c8��V���ׯoʵ��� �iXt0�)%��C�Vc�!<r}+�~4�W������_�;�^�����"��2��I Ԓ��W��{鿴g�h�����'���Y�jW��m=a�om"Ɋ�9Y���?p�r���g�G,�8J�c��v}�����֖��5�@��>x?^���Ķ��W� 7���l��\�I$𪠱'T��q���[:%B[޴6P8�x�޿)�?�����o�A��-�'��S�!ҼAoo׈|Om�cOn.r��QI�]��������`�A���<b�̼�$�m�WwR�U%��#�KD¥#Pc%\7Z�ͽ���-�OJ�m.�s5�_s~g��F܎GBs߭;gQ�1��=[�	��o�ڕ��?c_ڧ�_��!5
?[���E�Y$f�Vh�6m����p���#������E���V��j��SƖZm�W�ʘVՌ�[���wm�ۆƧ��&�R��:�����?Zy���@S�Mx�����&�E�?|m�;R���o�{��~�v�'.FKm�������z�O��b�z]gɤ��ܴ�1ֳ���.2��U�~�M�9*I3h�Ğk*H�'=El�OQX�HA�4��e{_�[Ꮓ�.x�
�}���x����mfVV�ّ�e#��R���:�����o���&׾4~Ⱥ��B^_1�����X6�d�9����|�+���5������s�N'o��v��&��T=���H���7�*�i]�&W
[
��V>��3���=��
��WO�o�����-n��m�m&[�K��X�C�dp
�{�EO[�����(����QE
(��
(��
(��
(��
(��
(��
(��
(��
(��:x�����jMSN��҂�N���OED��?�<:�jRLuQ@Š(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��(����hK�9�P�,x ����7����%��E[mJQ��o�3�����j�D�����%��Q����	��ga����o��e2܎b��F�i����EcYV���2�W�m\[^�U���t��g#���)3�8#�q�k���N�8�S]$e�u��&�q��O���I�5��v��$c܊�#�5�ۇ�fݍ�#�*���9�T�s��>�H'��\�����P1`[����9�>��P{��EZJ�����+n��V\@g9�ӈlq�д:0�ƴD��R��PE�1���6�V�EES�:T�Fq�Z���\��˂���cXF�#�����<��Z��?���|+�"��X�i܄�(��3�4�B���3X��4�O��o�w�.�Y<ijҴ�9<�CT���Agg��g ��\�aT��|Y�'�^��MCߎ��K��F5�Oy��ɕ.d��Q@�$�uڥO��*e-l��8h�{Z��_��_O]�w�����v�kM:}ᆉ2\�>�b��o��;�[H6� ��m��X+��x,�����---T$pġpUp8ڷry��<��+����+Ŀ>!k�xc�^���P��;#�5$�FY��
�1 �+��V�Zl���]�|S���o��U�?�6�4x6ծ�v�`��Qn�G?*"�I5���/�^(���x��ߴ7�#�'����ˏ��5�4�5���ߟ�v݁Y7�hm�,',�vG/����>4��#����?eO
_���F��]H���O[��ʮ����.�	p\|�荴(�?
�{ڽ���V8AޯW��Kϻ���{qkiV�v���Z�H��B"*�UF�N'�1��u}{J�旨k�"խ�=H�����qPƃ,�̀�$���wB������Ɵ���tΒk:�X�,��35+���4m��!��xΒ�[�XZ�]Ӎ���m��a&s�E?-�2A��-+���DZ������r�X�"o���dWf�[������^2����"�4��W9��h����ve�6�ZC��|����ʄ~D����}tG|r�m*�_�����i��$�h��'<�ϵ~~���)׉������_��)��f�Q�p6���o�Sđ�ބ��S��gE��~��
��?nM*�L��I7��)m쑒K���IR9c,syl���K57�����o����>��pI��Y�N��^$���~ܟ��'u�˼�ՠ��9��k
�D�S"H��؝ʨq�;P��~|i��H��?�s%��"e���@&T�+�G���>j9����[��۲�&~��]���8�f�͹gF��#����<d{��_���N]sT |E��>1x�خֵMZ=:݃��%�JM��b-لF뚲?�_>�-����l�IgQ�G%�n[x&X�ya�wG�s�T�+lsO�z:�t[��?@�����#�y��x��+�?���.�)�&��s�]���&f��#v�Ҫ�#�����O�%G��y��C���_�wV�$K%����R\(o
�a�T�rɴeO�����}y�����q���,���x��L���$̊���@!�2���)7��x�𐒔q6i���ɿ����:�Ѿ"���aO�zώi�#|1���W�d�5�=�X1�����0����W����y�~���R����6��^�wß�‘x�‹��]CQ�,�,�(�d�9\ ��nW�1ZQ�q�s�gYU�N�]Ԓy���(����QE
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��:S�����Q@Ԛ&�ڝU��(-T���X��~���O�)��QEQ@Q@Q@Q@Q@Q@Q@Q@Q@Q@Q@Q@Q@Q@|�?�e'ſ��������m^��.4���;(V/��n�Y���J�~%��|w��3�h׶@ۅiA�@c6o�w�x���h9����;x���~�C�mO�oO�
��c�K
n����X�|�$������U������� �d���yL&�����B�\bG��A�Ћg��²��L�U��*�E��9$�����H��n��j=�i�SJ�o'ЌMDL�θ��*x�8���r2Fx�lݫ����AS�Z�H�:sZ�78���Y�Y/��Z�sϫrh"$�׭l����Ō��A�@�Uz�t)h�0���V|���JP��c�4���L�TD2�c��?���~
���kv��-����p�c,�ǀ�I��V��]>���;+;T2�4̩"r���*��x�M���[���|e�)�f�t�؛���뺜�c�N�E1�[�A�M��7L���a���*d���	G��I�տ��}�sվxKU���,�d|UӠ��>i�~i_�����,�k09���_�����5~��&ܒNMW����kXR���DqG�DEP0�
��z�ώ�:���-쿯��g����>�ɖ����j0]��n�F���庒���1 �B�Q..		�.����|���m��������-o��i�_�>�Mt�gM"%uh�5qU���b���#)$��O���xr���<V��]_L�S���]�[����R�'����?�	(��M�-x>�����b����k)K�2�:�

��a,��t���lu��9p�|�jW�y=9|�w�x�:��M^��^Ѣ�=��omh:��U@��~{�����/kڏ��b?�7�u;;���񖧝;��$8Cp.ԢS��Ӗ
ppA���*�:�g�I�|Y�����:u��/4���u��4K&F36����eI	�\F���Һ+�(n��h���a��S�+�쵲ԼE
�oA�44)�n�?rca��
�����ңi;K��|��ʹ��G�蟰o�~1���ǟ�o�f��ym+\XxF3�xWL�+�Kt޷�>$\J�8R5�$���G���zl{�&��4n?r5Q�X��_�2�?�R߈�k?��^�;�^�QO�t}׻og���=�q*�F��U9��;�$�={{m��O�Y��╟�s_��S��I.Kҭ����~v�G��0P��#��q6j��kmqm/��+�3�ğ����%��ߴ�t魜D�5Ky�3��bw 8��p�x����c�
i�7ٛ��ǟ�`�/��-�O��a�,�̡�lr��7d
�
|,�]�|&��浉�F�t�kF�ܫ2oX��vP�!s�5�PZ]��S��1��>���L�'�8;Q�).���	��V6�jz/�s�[�S;.K�����K�(G�W%7B� uc��T��]%�a��6�Q�C��op�ϕ̭��.p�F$l�g�\t�of����F��-;O�F�i�qq���vbTI'��f1���4u�?�������%Z[?��ؚ�‘I���>%jI�[��ن��̹��Ӎ����%k�O�ߴ��������C�W���x��Zi3_��gl5��hט�$R���GM���Q��̾���>4�j�m����Y��qu|qj���L����:��x�1���,�.��~8_�-�yk���n�	�i���F	s�I��)=�:�V�WҏH��T��wI?�i.��yG��Cj�
j��$�՞0��ϩ/�#ֺV�g�5�1�[ǵu��Đ`24r���B��~�_�=���V����O��Sty"�kH��$A��`�뵢<|�q_U���>���e��9�Kɒ�����Q�t�|s�~'�Yi��¯~�Z��Y|3h��޿�B-8�|B`�g�)Yuz�,�:�+�:�k�a��o8��]vZ9'���7O�(G�4�˷�.��G�8'�®ҟ+�����t��[�'��<_��ۧ�����O�z�qm`1i�m㑦*AI����Q�:�����m�w����6�&�����C��bm�t[���$WI�m�C�<������4O|}ռE�Wx�A�+�K���6�i<d��zjH���!Ǚ
c@ȫ�6�G�|�y̟��jC��ya7����7�~#~Ğ!���o��g�~���?A��P�$������:g�t�Ⱋ+���܈�*&#F$�B��X��t
i6���KO�z������c�*��
٭�S�Z����T�Ɲ8�+d���(����QE
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(���Ҟ�ze
;�O����^�UTA��O��4>�@A�KAAEPEPEPEPEPEPEPEPEPEPEPx�Ҩ�[�ymqkp�lHѺ���~ շ<c֢��l�q�`Ƞ�>	|L�=���>|X����ChV��B��O*p��Y#Dc����XF0x��>iq����ࠟ�����7��Ii�GC�F܏k�A��Uw��\�d���1��M}����xⰃ���uK��5ݭ�g���ҫ�֛�u=}����Jf��q�}*��:��2�`pj�~U��k�Ž��eG��N�r��D�F:�&�q��֎q��;T
"�$�qҩ���Q�FT�xG\f��$���Q��iw��?
h�|�y:[ƒ�IT}	�кR���#��������|#�_��,��օ��_k���뙮$c�HՉ�W��!��|I��R�~����>0��Jm.�o��Kk�}U��=�L��vW�`��^��w�"м=��ߴW�n�iO�'pjz�}�M�.X�q��H���v��U��������y�/���i��?={&y���{��d�,5-/P���c���{orP�2�,�Ol��6�e2�H��q���υ�'��oF�|=g�O
xz��Ӭ"Xm�z,h�g��NO5�M!f,��'�z׏�e������<i�{��^ѡ��ndQqtȹ�a$Iq;tH���1R�g�[:�4��ˤW�v��䖇�������x�>����(�~*�>�1�I�~�P�
����2�Iq>�q)�|H\g��q��k�����^	�"~Ⱥ�i/�e�"��W��-!�����p���*���ƃ��׿e�%O�=#J�K������vE�H��@˩\8��g�$�49����x
4�)�wV�h�~K�I��t:��z�xq� ��S�h�#�–��[��u�A6�d��e��Ry�2���+��Px�	|T���C‡���#�~�-��vW�j�[֭�	m!ŵ�I��9l��|މ�5��|G7ğ�����o����yq�?�������I�=>?0�RmFx�����OP:���O��׎�N�:-�V��:��M�������¯�ڔ�/׭�>.|T�!�5/x�S�jc ��fa@�T.��@���zdh��zWN� ��H�#�\yV���+��Tuqs�w���y-e�@8\�})�n��Q�+g`U�3:ƲH�*@���Tu$�U�\�pIhP��n*+�OO�l���o��4�>��,Q��Y�Q��|����v��!�<#�~��.W�xtґ�A[�[cn�f��y^����ޕ�R���_��/���V�r�sg��;G=��m/Z,��7�T2��j\�#�Yw���%򧲵�/H��v]��;o~���5O������>#�7��ES���L͵�zv�"o��ɐ�� ד����]x���i�x�8��w��&�t`H/��nuF�8�b��`�u_� x������0|QӼ7��7��a�**[߈���df\@�>P��Տ��G?��h�9���"�Q���ؼ3�OچA���v�.'��?ivR�h�1���p�f����^���Z��m['��S�����%|I����O����	���C��	���>�X3�$��En�<������b��D>&F/>4���	��"���iO�_ys���K��H���~X.!I�%��+�"�t�3A���E��K�4�R���	QF�*����
�TV~���a�P|�){Yw��o��~L|��1��u/�J>(iZ��I㉗����[���d�;
����a�F ��6T�}F�i��m�XnjCkĜ:(8f�(�#�G�����S���DQEQ�QE
n���(����QE
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
pv��(d���S��AE)�(�C����q�*SC������(��(��(��(��(��(��(��(<s�@9�S(���~$��L�(��i?��ɴ�-�Yo��W�B�a��~�B�N��)�v ��U��2�Ny��⾫����J�ɿ�B�.������n �m��m%�?ro1B+��y���s���_���?��F�|E��a�[D��m�����[�r[�QI9 � ��X��5�o�,�Ύ6+���_��&�f*@�P[˼ǭK&�#$�5|��I��$��{֊I�09�g�E�l�G5y��RuӺH�I�;�*�\5�H8�L��{v/3:�Z,5��������'��u��㷈?h���_��
4���r�ݕ�U��?�ٔ��x��-���¸�_�|���/�g��%ƣ(�I)�q�ޒF�T��ML�{�o��W��h?y�Z����z_��;�x+��/��#�[�w��KKD�oJpT)�2�~�cW�<Cg��5���J���gv�P+�?ڧ����%Ϳ�0���#�x��ɥ[��rΚJqn����?2�Mmx��7�<Sg�G���?�#�m�ƕ��_��ҙw4��/��l��>P��y�T{E�˹�*�^KY?�|��8mS���M�^��~O'�K=����l�u�r%ޕ��&�2��S�a�vt��z�iw�G~ؿc���HSs����R���2+X�J�md뀨��v���w��(g��x�O���e?�~�|�������m��ˋ���@�'���W�z'���O��>*~۟$���C��–�����T��X��������+}�8����i�"��%���d�4���G�
a��O�֚���GLu�S���K_���}�h�k},�79�r\/�^�s�/���|��þ�	okkn�Q�7��k����->��N������%�"P�ƈUUUP��<�U�	[V~q����4��Mm���.�䬬�	\9=)��9��@�>U�^A�s��ρ~���<ek�=&�.�%���V8cW�Fc�
��+D�<�4�9(S�r{%�g�$���k����G��_
�x��7�,���9K�sv�x��I!�)5�<��7�m���<�"��=�k��C⿈*��h�.l���'�Ӡ�ѹ�}�|&�A����O�C�g�����
Α��rj�YN�\���[��X[�(2J�T(��5�D�QR�r�������ov>m���=���O�ב?eo�W~9���ē
#F��e�.�=�G�1�C�p�^��ι�8�?����=>)VI��iC𵳐��i$�	3^mf#��+�߄����3��3k'C�?b߅�܈���M����H��԰�C��31����q�
���	�6��_��=� ��� X�lo<mx����|�æBc��)r� �[���q��6����խ*�8h�{�~r�b��oC�2��~!�����Y��>9�Ni����v�^��K�F.u]Cl0�`�A`8=��/���F��~������um,��������2W�T�s�* ٲ�J�A�?	�7�>д�����5���k��v���B����Qrs������?V�x,˥�0�S���K�z/�G/��x3��g�xOM�W���
*�;[t��J�\s]EV��Q@Q@Q@Q@����(����QE
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
pv�(d�A��ʜ=
AE)�(�Cޜ$���4IE `{��PQEQEQEQES\�}i��q�A2z��(1
�z~���_�ʗ�t�
x����l��ՁK�[4o��ku�r�-nN�N�W��o��$���,��q�o��/՛�^5�/#���m#lqA�ySO.A�d�*�Z]��2��`kPK[]z�W߷���&;W�����[�G��s��Q%C�qm0�,m�$��eea�+ �AȮ��nQ��i�?��w��∀Z�bT��V��m�+*�d0n�n�=9���o2iV�2?q
3�8󬧚=�I$	e�1����^=��G�7�U�_�k�����V}���ڄ��Cgo���ŕ@^#$f�o~��)���~�߳���iR5���D`�&�D�[[�7�LX�����>�Tp���G��}|�ݿO����w����_��I�s~��4�e�v��:N� ?i��d{i=�|�ٛ��c��-�xGþ#���Jx��i_�"x��^�"��"�O%�"�&�d�ð�89ϱ�z��4���4߆>��魭Ub�j
�O<�z�2�H�8��~R|T��~5��7���?b�	M�h�s-��2�W�%���YI#Q�3��]�ڳ���tK5�8J�
6K�i�R�+�U��U�P~�����+�S�-�S�����/��wWO��j�Pr��˴�q����<E�f��j��o��g�g�3���m|A$aUC�j+�*o���@�=_�����+��~9�ş�^#�<k���X���;�n�����p�+�<[�B|�x|�|N�V�I!�N��n�f�#��+xK�ӆˆ���2yR���b8����R�>[�����~��v:/�>���[�Oxy�$6���)4��;���2�I8�k��#�W�׿�G�/���e�|J�!,/'��I��\�Q/f�06?u$q�O�K̲�O���Q��g�>�.S���5��B��Y���c�a�9#9$0�R�>z�S�Ruq3�oV�8�������#A��ڼ��ǯ�?tY5�~;�|#`��5��Y�Lp�X<�E�p~g|Z�>2�{E����4߇Z%���_���m/.�2ZA<�KrҞ��D�J1���o��	��F�Q���o�������w`+|F��n�]Bb�wX0���D3�e~\��v�G�d\#��k�N���j?9��_�
����{����u�_
~�ot}:��>-�����,Zdeo�PN�v_(�����W�?��> i�4���Zo�?����e�"��Z�˴�M���f�fw*�u�>X� ��O���G��l���i_|[yB}�@�����F	f�qnZ��8��>"�K�~�?����i�_��4���pOycj���a!��`�72O�&���ēV���~͒xU��ʜ��
m�J�\�>�*�S��m~Ժ-�Z��=�[V���s{n���7Ŧ��fIm�w��I�?Y�f�G�k��`���W���8ԡ�uk26��ީە��}Ӳe��\
���4�?Q�r�&
�	F0�����m�QZ�QEQEQEQEQEQE
n���(����QE
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
pb;�h�.H$����AE���b;����T��(�zZ

(��
�y�֦s���h3�
(��0�#�_���Y�}�_�>4����}��i�'h.�h�i Ⴑ*q���ފ3����u���������:����x?R���u��+���Z��5�'\�A�%�k�
��
��ρ^,��"�-�|<7��%R���ٮ�~R�6��	n�+¾ ����m^�?��{�R�K�-"�Ӵ�:5�G2y�o�\=��ȇ�i����2|�3�>8�j�q[����o�F]n�I�we��q}oim-���vV��I&`��;�=I"�3<c�ux����G�O��B|f�ׇ���޸��+1D��U�j��,(���R�������I�k�\���-��ҽ����]���b.�K���u��8� �:��u��*�g�&���e�Š-��
Yx?K �ԑ�3]�pLA���Smv�������%����'k���z���+�k��i�?↛�w�_x�IJ���ɿ1&�gu���*�ñ�pH�/����,�B��7�N^;}.�Vܤ�_�dtځ��m�y\�U�~Ş.�� �7��n��~��#𞓿J��1`I,�vk��r[�2�HS��W�x'�7�i�Z_�>�^��#�(�(C(�b,�B��󵙋py5��t>[;�lf�]ʤ���"�d�nފ>L�^��z��/���?�F��x6I�K�7�tMA�hK��P���G�!�+����t���|Y���
��e-G¾��ȷ��LK��.ЀIO�*��9�V����s��|Q��gM�T��i�i�2��7��+9
��FU��I��|����_��n<!�c��m���/��f��PT*�Mm�F`Wm��8�Q�S�f1�P����7|��EE_�o^�����s�Z�Ms�����|X�EW��}/B��<0:������z���/�����/�~�Y}�X�n%��o2�f�B����C���������D�G�c���-�5���k��2Z�~ʞ`%�X�r0��|�~�~͟�F�'�t�_�5/ڋ�^�;�'��y9�h̉��v�-��2|�г'9��+쏼ȼ9����W�t�;|�����G�o�|o�d��0���d�f���#���[�K��Ȕ[�7Wv�
�u<�0~��'�������Z��{�]�[��k�g��M�Hϙ-���n/Q�����Nprr?��-2��O�l���,�X��	h�
�����`
�[����Q�W�J��.�W���ݱ�����?fcվ|��lcx��7�3�k�lח;�.\�����B����;R�Z����$ ��c�
(��AEPEPEPEPEPEPEPEP5����(����QE
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
P�w���� ����SP�Ajl{�q�L��	n�EP ��(����?	�Q�G�~x�C��'�<ce-��cy�a�pC!��� ��?���Q�?��?d/������g���}j�O�ƺ�mc�EI�g	$�JƑ�JY#%YC����:�k񏃼�o�ׇ�"���	"i�ŤwF�e`�Ȭ����H<�d�5i�g�\��	S�h���&��T����[k�
�~~�Wp�t:�h�OaZ�K�Cu,r,���<ៀ����Q�����O�%·�84�'�N�-���4��_�*�Y�Y&Q��"�0+���Q4H�Aq���0��T�����\3�U����El�i~
'�9��w���ٟ�����cp�9���I2�()Y�h���fg�`�*>����U{�Gi}��Qj�)�����`�F�yS�����4�<u��K��w���_T��'���,�A�gĿ�_���"�.�}o����yB9x�ELk������~����Mо�-�|�i��� Urq�/n8�
J	l����� ��IZ;i��`�(�=0��(��(��(��(��(��(��(��(��(��(��(���(�|��?���<�QE
�(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(������Ɓ���woocommerce-blocks/images/previews/pennant.jpg000064400000156663151335517640015647 0ustar00���JFIFHH��@ExifMM*�i� � ��8Photoshop 3.08BIM8BIM%��ُ��	��B~��  "��	
���}!1AQa"q2���#B��R��$3br�	
%&'()*456789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz������������������������������������������������������������������������	
���w!1AQaq"2�B����	#3R�br�
$4�%�&'()*56789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz�����������������������������������������������������������������������C��C��2��?��<�o�TtQ^��6Š(�.Š(�.Š(�.Š(�.Š(�.Š(�.Š(�.Š(�.Š(�.Š(�.Š(�.Š(�.Š(�.Š(�.Š(�.Š(�.Š(�.Š(�.Š(�.Š(�.Š(�.Š(�.Š(�.Š(�.Š(�.Š(�.Š(�.Š(�.Š(�.Š(�.Š(�.Š(�.Š(�.Š(�.Š(�.Š(�.Š(�.Š(�.Š(�.Š(�.Š(�.Š(�.Š(�.Š(�.Š(�.Š(�.Š(�.Š(�.¤�=���Q�@&���(����QE
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(������(����QE
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(������(����QE
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(������(����QE
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(������(����QE
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(������(����QE
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(������(����QE
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(������(����QE
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(������(����QE
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(������(����QE
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(������(����QE
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(������(����QE
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(������(����QE
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(������(����QE
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(������(����QE
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(������(����QE
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(������(����QE
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(������(����QE
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(������(����QE
(��
(��
(���������'x���[Ay�XG�����F'�nA[H�gs��L}���&�.�����4���Yn4O�{��
K�|[�c\o	�
4�E�ډ�-�ܼ�H<�S�"���t�~������:��L���`�=
  o��kg�H2�ؖ1�p7*h��`�S�Ҽ��89r�i����E|�3~�_�O��y�8|_�>'��b��m�oẴ�%ͻg��F���9��j���m[FQE1Q@���O��'ž&�8��<'aq�^H̪h�W9baT�H���?��sO���T�W�A�1k?g��^E�x��kW+��D�Į�»@�W�\����Z�{{��	��f��������&�c"^0T����s�J��RF_�?ȏ�I�?韲7��
�-ņ�����s"��Ir���);e�ޔi�r�N�u�1����ߙ�9|/�����.�)��=��|!=�	7����>�w�^y �c>�:��~�xw�~�~�����z퟉�5���V:��2\[\C �I��$�Ð���?��w�~��s��C�<Q��ˢG�;��H��`b��e���3_r~��G�k�?ٿ�_�	���uO�:G�[�Z��I���Z^O7�R�[}�1rY$���I&����ʗ7���,2��N\��_�?��+�{�jo�/_��s��l�
B��m��@*䲧�bK��.x���0�Yࢺ7�[��Y��<\������8�;&����# ����Ft�8��a��+�[�k������"]��}s��S?M�����_�q�?R!5���rȻ�u���=������s�A���*+����	��V�7F��4
jS��a�Z@���"��ȕ�ׇ�<|�v��Dž>2�S��L�v�Oլ�"?�8�e�i�����%�=^����[��^��Z����T�?�$U���HRUya���duV!�J(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(������(����QE
(��
(��
�[?��R����&����N?
|;�/���E�jz��i����Z�3O+$)��@��	T�5�I��ߴ������wu��qc��r���.-'*TOkqY�����8l�"��Ցt䓻?���u��cԓf�l���A��pGN+��������HRhgB������5����7�㯂~�b��B�M��,<+��En@;b��(�_/��E�RI�~Q|B��O�]�U�����5�x_ç7'�z��V���[��j�e��[�-v��ҷ��S4�M��?���g)<��߲ǎ��㎇)��V�]��fl�K�U!6I�>�����+��D����/�w�??�~	��s�X���~'�Vos��B�8�L���F7C�ɯ�����;�мC≾x���S�~,���#� m26�A���+�I|��y`�lt�xgWM�dH��fSЌ�����ta/z���"�c+R�k+�=�L��~~�?���ieu�7������������w�u�k�\�;��_G��Q�o�&����;��t/_|2ּ�5/<1w%�Yp�2d��z�aҽ����?�`�?go�)���9�����5!��cy�ʁ�*�Ƨ�:c)R��_ѝ��ђ�����h��\�_�Z���Ti�3�Z׸�&1]n��C��w>+\h?��6�3#Y��D��0I
�o��e���+�
}�.�_�����P������ײ�����~R�aկ�щ����0Ϯz��Y�o
��^��R�vJ`)��k�;�
�����|N���~��
~Z�*���j>�V��@��;�$U���O�I�|޿�	<[���:��������8c�"�F2���QZa_�+�ߩǙ8�S�w����Q�	�3���æ����:�D��tE�`��sG��idּ'e�\��obW8��S���ֿ:��؏�*��30_/K�����z�s�	~n��W�t����ǡ�a�N�Wp���v�J����&|�#�����YGIAٹ��$��]GU�?<́��5�Q̆t!_��J������w�4����?���Z4�ԵI���V�]���
:�]$Z�h�N��~�n�WpHg��ed	#�A�Q�E}˯�SW�~A-IEԒm.�v��E���(���_𪚏�_x�#��~ӼA�[�X���@��z��p'(=A���޷c�Pp���뽎�5�g�~>���eo�V�[���|��(C(ӡ��r��U��q_%j��Fo�V���X�;մ8�B�{]b����?��G���W��2
ʿ��?�֫Ȩ�ŀ�yհ�*kR�_�G���qt�+�>�k�?�K�q��e�	�y⟈_�-�2���	�pAG>|2�y[�=+#A��d�q�.�w�_���SO���L˴]I}$���E�~b�t>��!p�S!���R�l'/*�����S��ϚX�ߝ���/��Z?���>����,``�/xr��M� ���@O�t����E�Q����S�w��aa6�=�J22��+eRNK���A0�*'�I���|3�{&��n{0�����b�D��4��)g��e������W�;{(��O�}����N�3�U>���?���V����NO��
�.c��K�=^�0;$+d��Ҿ���$�?�g��/��t*H?��qτ)���^�?�=J(b��2�n?��"����_�LM���S�c��>��]�ݕ���n"P;�����������Ɵ�(h�/6?�4;Ȯ�	�lZ'��V��ȿ�-�?��/t�x+G񥦦1p����`���rq��x���Y���$<Qs�߀>7�w�㫖.׾�e���A���|��H��A�^m~�^���T}Ĝ
Gj���K��
��O��I�Z��5�S�S����h�4�ukq���Y��=y@���׬h?�W��)G�IJ�����?F��%_y�����z�f��(⼪�f&����Z�W>�Ĺ~!ږ"7���[�?��+���q���q�Y�G��~x�x��L�N�r$���-f.��<�Q_G��[�%n� �����Nq���G>�KD��t{����𿁿��Oo���o��l�����y�(f�m�]������r�|H�}{�x�)��Լ3�='�Zu�a�����E,����� �+NG���C����Q�,SƲ�"���){�*J�DŠ(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��(�ks���(����QE
(��
(��
�����g�G—~1��>/�
��x�����\�		mh��nㅊ6>�s_E��o��c�o�S����n?j-���)�G�-�3��r�Y=��Әn
�v�Y�}�!x�f0�*%'u��Te9l�ӏ���q���/�]� ��|G���_"��>(s�� �D(	)�^�&��+ğ�T�.Ɖ��)�|.����s��
�������ME��Ƚ8=k#W��F�i�c�(���X��U��w�JA!R7c�u,�I�<�i6�"����?/>7�Ŀ���K�M[Ɵ�i����#:��zdy?�$��2�r9�|��b��Z��us�\�2��?�E��C$61˽[�%d��zJ
��1�<
�kR���]GU�-�~d��E�5����5�_���vq�w���Z������%.��/Zqq�菩`h�c�o�$d`�_\�����vln�8xen���W�J~��f�ڵ#���g��7��E���ۏ(�$tֵs��cJoU�z!�c8 ��a?t������L�e��^I�
�Z6G
��w,��t(��+��?��������3��$��Fь�H�uO��0,z
�M}�oW���e�#�+B���>*�p;�����b�
���lW�V/�M���E��UEUL�0rW+�9���(���qx��x�������i���,��N]��Z�@�&2��98����0�hz]�R�a��'VS�U�AA���E)ɯ/ԼES�5���|��=������;	\Fז6Ч��s�n��W�g�_����W�`�6�f�R𕎡*��K�'��������8�ʿ�*�ŷ�1W�q,�H� A��n`��~�W�o�nO�U�)5��Z��+�t��cb�,���O�5�\:�VO�����M�Mt��J>���u|m�����y<9��Z.����S͆U���>Y�<�k�S��r����1Xh4��ۼ���ş�y�"��p>���?�6s�~�>��e���W��?������>x��_Տ�5�x{A�6�:��~"����D;��E��
x�OI<[�_e5����>���A��'�?ɟ�߂>î�ଚO��ź�?goڇ������ɻ��P��vuH��7��*�̪s����
��ψ��>&O�W�мq���'Ö�6r����o"� !�yQ�{��y��V�V��?�X_�%εn�Ư��:C��ݓ��b�%��q��S�GR���?�8�/�>*�g�[�@if��͟�P��H��'��r�5���k�������Qy�%~f����O�_q�|G��:�J��p�6�k�e|
���O����]��j��v��M$j�f1�cʶY%�m¾cR���7~��z���A$C�r;_U�Fu�7���j�?�[�.�2�7M��0zu��z��E�]��>js�����.ydc�$�Z���ԳMk�rrUa���1�.�i<=H��Y���S�����u�������۟�'����kq�i�?fD��ݾG!]��ء#vf���ÿ۟������X���d�'����+I�4�{L]��A2�'�$���1����8 _R��)>�G��D?l�(�5�3D����f�T1G���_\�9إd��^X�&H�n�g��8�]�؍��>
M}���%��4��Rm��Eb�z�1��g�9$��{;��]�����2���I{E&�}bڵ�����s�_~|���N����3B��\e��$QF��4�4R�������߲>�v�iм}�h���ƈ
�?������ɟj�|Q�L����>�MK�|��+�fI\Y^^<��!��.�EM�I�(_�A48�2��S�p[��i��!l�"�X�;|��
�+\�=�J����Z�v�kC��83�ê��.f��D��-�ݵ~��l~
�I�c��ŧ�<��K����4�ee��e��X��"Y�TbI�}�o4rOЊ�;������mb�����]J����V�����9��u�ݔ����,�k����M�x�U�=��]>�X�{�kRy�W>����,e�j��4�.9�K��2z2��ר�U�M����98��#���8y�En���{�~^g�LB>7�Љc#�䎂���k�/�/��&V:*���G��м#��RuN�!�I�8�H�pπ�w0����c�%ec7��2��V�;���-AشN�L,1�㬡Ngs�|�wq^�?6�������}���'��n6���Ӽomҿ��~��(���4�HĜr��Z���?�_	�=��:'���O���(�:��t�6\pY��m�z���J��K�?ğ|Q�͏��x�L�ׅ5,�5&�;�v#��`�Nw�o��R��)�qf�M|6��N>��3|K���/r�-�^����Ӳ��z���+�d���e�P�'���g��H:��a_F�q����U3~���mV�O�SRի��8�CHɯ����W����c����-d�$��lRX8�t����>��\�������G����$�y�fW�>A�͙�p>����Z�R�'�W���[Ȝ����W%L���*K��;�縸i�f��u��~�i������|���'�����0x��K;�2v,���F���p���E�����q�H`�������n|3�����T\H���۵~�[D���Z����pV�i�O�i�I��p\I��V��sC�H�W�~oxs�����Y|o��i�Tӵ��c���到�e�xU��G>��z�u�:�M"|Y���4�*�$�W3�+q�
���X�+
�%�Dq����Q��L�6>bu�܃�s\xz�v�&��P��^r���{8��p���-�ZN�����N�;�Ki�9=fXe�A�r�������G��>��?���,ip�e�@�`�1g�N��p�ڿ)|k�K�O�Ky-<���5��v�t�k��s��������3�	'�>�> ����8���{�F�X����4�rZ���g������W�_��i�K�g�_���F�+F�'4�z'�_��������L�b�|�(/�4�so��å���$��n��:�3t�+ۗ����v�K�	A�[�QD���t���>i���K?��J�
�v��?�o�6{��¬_�_���G�cE~
x/�4��skZ��"�^5���a�n�q\�����i9�pz��a�3��}�c�������
^��!���౹��8T����Rk�Ph�i�!-��r�T��KN��!�ҵ5;�
��,����C)*A5v��0��(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��(���(����QE
(��
(��
�B?o��c������i�'�p��O��G�la�_	Z�u�j�����g�����[���p¿�z*'٧f��Vi��	��?���7����/��=> ͭy�P�d'Kӡ-���E����J�G��H�,g�0��4���O�+HTX��5k�bS��q��z�"��**���O�1��~/�������m7�>*_Xj_��˯�_��%Cg��B��f���3J	���#R���>Z����nG�g�2�=��}�)#��#V�5&Fn?xV��^zW�m���3駦�������Ko
[�[�?�g��ڧ����=Ը'<�<�9>峎:Wek����nY������l��}�u�9Vb�=Cq_��R�Q�W��s�~ȟ����N�Z�'���/k6�]���ɴ�m�8���sҴ-A��
G�ѡ����-"HU�������kV���Kw�e���<�1��I��0��ٷ�m4�_,����T�r�?t���޿fO\k?�j�%E��4��?f�8��+�t��*?m ���Y}T_Zg�5��~�7��?��$_遁�k��#�<��Jq~o�G��^u)���5�䩖��6�I���#�t8��_�����3��	xkF�[-3D�1��l�����k�y���I
��i���Xf��}�xJ�9��\��L��w��'s�(���ׇ׽/�*G�e?�~_�D���,|k�~ךA�+��R�b2)b��<�OF+=5��	����ا�I�1VF־�rb������s_��M�爾
��^נI⟅�'��s��Ο;61�`$�_e�7��O�ا�K|2=:��^'_�+�g�xr�d���h������o�,�����"�k�t�[,���l��/�	Y�}R��N����g�7Zn��ٺ�b�~��������_�H��;��|B����?�s[�����3�&����u�]}�g+����3�1�lt�+�
�W���N�7�,&�F_�y�Q�����&?퓥�i,�P�E���X1��x.�o%LP��ЮA�5?cψ6Z��}�����,"�.�ust޶v������u?J����&�د��i�>��
�I���4۔��t��%���Fs�{�iaм��:���B�=����8R|�j���5�f~%�UhP��M/�	?�D�g��vt��'ޣ�'Q�[I�6|I�G�U���-��o�����g������!��qdŢ�[����w��!�*���Sۡ�ۿ�$�#�s����6������H6�Ě���z��#=���]��.����Q|E�}�h��f�i/]��H��lm�?*��T�"���}Z8
���#��N�����?�_�ߎ�;��|"�-��g�'�h�%?�F׈�O�k6��[�}2�'�#2��7��s�G'ҿ��}���<�mÆ���^�m��G���~{��W���Wo������W�L����j>�f��X�-��s�6SI-��u|��	-�V:ew/Z����;+�M~,�XF��n�B-��u�ŭ�7q���T�}?
�`��>���N�cM&���I�>�n���U 
��E�*x��W�?����������O��5��>'��5ۅ"{�:���kf���e.7#JZM�+3c5���xc���9>,x�����w����#Hb�6�,��f��q�gB��R3ZY��Y���X�4��s^/n�M~7>:��<9?�?ट�Hφ��K�����r��4�k:�xD-����J�_~4-���;�	{�M�x��A��4���־�������O��ⷊ�g�]x/Q�o�����]5��Z,��S�$R��%�$�#1���Z�7�E/Ҍr���ɟ������	s������^
���k{��W �Gq�G �M?lO�F���]���7j��G�K�Ox���>(�t��qk��\+Fdi����݉�64E����I����fO�����
���iN�ᇍI�Eծ�
��oQVvw��%�θ���ʬa��x>E�{�	���Y�υ�e�9���M�O9��!��,㎹�z⧋�F�j�:�.�z��k��ldg�Sѵ��k�dq�q-���x,�	>�W�?�o�^�f|O�P||���?��E�O��w����5}�����j���CG�u>R)wWg$���߳W�[��~�N���
iw������D������Z|���Ƌ����|^]�q�_ξ���Ӣ���~�?/�”��1Q����7�ֿ�����M�K����w�O��1F
���1'�hc������k�_|,�����6n���߳��}B�h|O�ƃ���y�2(fo�&>�ў+�֢�?��Eތ���C�<vM��.\E%�?�Vh�~e�ڃ�_�E�/�
���--��.�cp�+�>�0\�s���YK#�U�8��U~�??c�7ğ�=B���Z���1iv�k�1'�,��"���9`$��~8�ލ�6��z>*|9�_����G��W��嵗WM��&v��c�F��,�=�_��@�_�~$h���|]&�p��qb�Med�I
�)m�NFE}��*<�5i�<����w?#�Q�n�0m�wk]mg�~�ױ����ۧ�G��ac�|7���-�I��w��^��{[�
·�>����7Uu���� �8?Z�~5���?�nu���:��As@/�/��r.F�vAn�/P�D��#�����^�[�	?c�)��?���m���[��2Gȸ����~F=����;�����?�>��۷6��K�_�}��+�\�Y$����ɍK����?aOڃ�_��"��0���LJ����A�#�QJduIT*4L������l/�:�ٓ��_]��x�������+F/�Y[
ؕԄ<1��Lm*ԥVH��u??�r��\D0��&�������*��ԋ��d�O�~J~����S��?� �_����g�Z�4�j�}F�������C�$B���d-!�rQ1�}��+����x_P�w�l�n?�^V�Q�|%b�O�,-e�F%��@e��he�X@@&�W�r����o��ڗ�=��O�6���Z�G����ݭ�e�
'����pݮ��ѿQ�|��&��;�	��/���8��B�~�i��2��d�0o��Mz/�\����q�|������#Y/,����}��'�g��J�ѫ���P2:�+�q�Z7��~���ζ|�R�]5O�?$4��%5)�������.�.wM?S7�s`�
��`2&ᒲ;���wi�3���3M�៍^��|��gѼO�����N���/�s�{��R2+�CZ񗆴[�2�[�
��y�;Ge
��p�à�vV��H\������"V�G��k���j_ܳ�m��b��,�Ne�I?��N���x���n��/�_����Z���A�5}?x�L�g򑓌�s_f�ϟ�\o�&��}o�����i�����ky4Y˞�%�Gbx
��'�UHʩd����揍�����B�Kk�ඃ�)��[,7��>[�<�� qĘ�.�
��S�5�G�����ڗ�G��#��K��mr��ukm^Հa%��*�y(H�+N���t�������o�����4�D�H �u�.,�n�{��n���Wwe}��)5�x���o�1��	k�;��e�N<�S
Ĝ�n8��j��"/H�yY������
kޕ�gu�����E2���5�-�����?����4�G�"��\w]�:��#*Oֽ�N�����A��)/���N��M�����ڿdf�+Ϋ�׆�������q
��Z)��?�AWॿ�"�O�4����/��|:�L��^������Mm��I�������k�	��k�~�7�u��Ft�,�±87���!��	>Wih���j�SW�ԗ���~�QX^�G��c�Z����tјotۈ�m��$L���kv�Q@Q@Q@Q@Q@Q@Q@Q@Q@Q@Q@Q@Q@Q@Q@Q@Q@Q@����(����QE
(��
(��
(��
(��
(��
(��
(��?9����L��oG��'� ��䌵������~�z�럳��MMT��ÖQ�?ކ1�	N+������M�7�ֿԮ>̷��t�	Fp����D�`$vq��+�*���D������b'�g�p�����G���7��I����s�J@�p(�p�3����_������b��W�:P���C�(_�R�u������J�u�k9�\|��]s���_��4�m��Ь�5���ZY�X���r{�/'��>�)�/�G�\i�:^r���q���|9������K]�� a6�s�7N3�k�+�	���?b�NH�[�6��^7��um�:M�Ag�X�Z���Iatb�15����Ki?`?��쒉��e��Շ}�|��qq}5�iO�Z����𺴝M7��z��O�,孥����=�B;x�m�m1�`�.��D*X�%����s�D���?�[[�´��<��95j�V=~�&��⺯�8��4o�?���($k}W��oO��S�r$-�8��^C�ľ�ğ�Z_�(��q7�<%�D�\�,%����t-�&��U_�g�_���O�_�T�v�%��ۏ��⧇!�����@�x�B����Eż��;���e���k��ş᜞)��*c�0�q��9��|�Ad+�KO����C�i�-o�|Q����S]��^��Ga�ӭ=[Ji,�+����u(Q������~���� ��c�%~�����ÿ"���m�����5����V�#�kiNJ��xb�<��]�݅�vɯ�_�Ι7��e��:4����L�f޶ӢBG���2�?�����,����1�k� ����7��#��*�b���音��KM*%�7�GĮ<�k�գJz�6:�I�BϏ�~{||�g?�p����J��ľ��b?����G7�-?�:����C��I�$���� �_$1����[F��_=VB�g��P��W��\���/�s):Y[]�o���)���E�m#����~����s�͹ :��4�$Q�w��[џ���8?��u���o��t��^�������Dp{|��jO��ƚ�����|1m>�+�_b��"p�/�x��Hp=�֗�q��f��ӧ�����5͚SJ�H��N��炥;���:
������yXߗ{�'�ڭ�y�	�V>�s�+�S�
#�+ǟ���e�.���Ȓ��k���#�bS�W�'��/�,��Z@�V>7+�� ����o��mK�G��4�x���׈�H�gg�n@P$�pz�ϝ�U�Dy��}��,	h;O��1�a��~7��I�1���L9x촏YOm����w��G���(��~�>ѡ��|�Zi�dM4�3}�at��k���q_�����"@���{:��e`}���'�rY�~�#�o>	�Q>��e�K��q�38sB����?�Ȏ��SO��Է�q�3���W�j^ ���f��N/�+�@�%��u
g������?�v�g��[�-����E��n�_�^g��z��~���V~*�_�Q@
-ψ�?'h1�j��� ��>4`���g���ފ�3��ap��#�D���fX���fx��B�����߲Ŀ�Oǭ[�V?��i>�MU�|7s��G$i"j�][�4�,�P�_�߱��]����ύ���Ң��m7Y�o�[�V�;/,.�p&����
��|��_��b�Q~Y�#�
5n�?�#��Z����^|3����V�f�FY,�u�X�G�,@�����F���ݪ���|��ښ�����uzx�a�H������Z4)<-����l��I_���L�,n�P3$Q��4g�l����9��v���x��%��v�	wt�*����P�X�]�6��WG���n4���	�K�SQ����h�K�F+�ӉB;�Q'��d������$|_��I����.����·6_S�Q��R������h۬$��g/�z��?h���?���?�7�a~��qo���B..��O�Ie�Y�i�~fU�~s���Z�?�o��~�^!�3�_��#��l����[,6�"����9
��L��:66�7�Oy���ﵿ�%��m�F%��Э/����j6s��c�W����[o~�?�E���Ó,���x:�fBs-���[�<Y��v����M|�$���ѳ�O����%=�u�h~��rf�/����v|e�bm㏀��|7}��.�Tyf�x KfgC��nJ��)��~ �_�^���/��ߍpxV��A�I}-�K7��nʹt$��|T�4�|��ụ[�#ž�leY��sk,l<`�`濋_��[j�I_�—Q�䚿��G����-��rr��:�W��֜a��^���>c�p��[VkUQ[�#�W�s���?��7y�/��	�8U�-�q�avÊ�|3���D��7��Ec�
�^�P�g���e�c�&dp �O#矴�&��;�֩�z��=1��>\ʐ9h�iA�m����O?�8���[G��F�e���<~�~9�|�x
F��tmn���6�Hy��D_ek[�dvݔb�B��U7+8�����)bcN\�}�m��m����94��n��
u�X[�$���wQ�X�6����Y�wS*]4���-���T	#g	
�w�?��W�O��
�-�m4���%��'�ڢWh��cbP���Z����?�e�GᾸ���x[���t�g6��a�+����N�W�,���I�K���)���X�
�ʧ<�d��p�.��F]U���g�S�/r�L414�J��RM���].�Џ����
��h~�>%����u_�߳��|	�1��Y�}lA�ō�<a�����U�;Wo���6���<�G��E�,��2�
vGV�9�{tc�L"�}e�	��u_~�:���Q��|R��A����p?
�_�
��Y|Z��b/|l�%�> ���f�mw��.c�K��I2��$�*� |�NH b�W[��j���O��~���ⴌV�K��C�G���>ϩ��_�S����z?����1�qr�#�kiH�W�?�OϏߴ��Əڧ�9����O|Z��om�Z�1�n�gfC�F�,���H��l�>H�<�@���8��/أ�?���[Gw�x�E����tY���@���|��5�w�Y�I���i�����Ak�R���Z薾��/$"��;X쐴�2I#��%�&5�)o��kY�ӱ�YS.���87m-�{�mo{U.�?Ciڧ����/�l�g���Lֺu�����Ȼ� �0Iڸ��U#s��q��_�~��l�/���?ƞ�S��;~��(%z�x��z���r����p�������#��=MӵH�͐���tNapм��k�n
m����&�O�e�#�&�S�f���ῃ��:���m�љQr@��ʊ�3$�y�bcZP�$����M�Ü
����WJrI�e����g����x_�
�	��I��V��{�-RBV]3Y����,:�6�\B�2������K���o���_4�A���Z;Gqn_;|�%X�68,�ƿCo?g��&�{�>��M�]�/�~��Ξ|]�i��jBD%��{�O�+�8<��PտbK�%���y�.��
v��o��
"��do����i��#�5��3F�އ���S�s�����N�O]/�^�&{���N������gu^�$���Cq��-�ɞ�c^A��{�+�b9��þ<�ԫI���M.1�%h��8���خ��w���"�s�O��9�:_�<�Ϫj3*�e�,B.F�c��1�~ex�
�����g�?>	��I�\\�W0I��OoyF|pJ�8�޾��P�hגW�~g�d�����Rk���%��+�uy|g��z���_�#(���5�4�\�k	�לm�Bc���?k_�,���[H�����@<
hWʿ��_
�X';��ų���������č��H��𜖈p��Y�^23o%�J�����������,~�w�׉5k�E�zy�[kǐ�m�<�ܞ�P�y52���&��V�-W�}.:ΰMJ�9i������+��	C�H~���g{��U��Ư�[���\Y9p��0���@~
��D?a��(O�Oڃ��$��q�O~�:�>����@��1q_6��dL�Y�_Q�}k篊_����~��H��O1s'�_L���q���+�$�e q^E~�������������k���J��������F�H�d2��=�:��m�׾Ar����m�_�d�3y��Zv�.��D�1��o7+&��f�g�NG��x�}�[C��[�7���8*�2ЧҮ�@$}8*庖ߜ�j�dX�n��i�����q�[Y]Tq}���5��҅������xR�1��3�ċ�rL��k�md%\��8�VS��9�T�G�{�?�X?k�&���Vd���ԏ�v9�	gT���3�C\50�����ɞ��Qڝh����
�_�_	?�_�L���q�e�Pi>��T�o��E���7��3���n ����?gߊF�i�����F�&�e|��p9'��s�N��E(��(��(��(��(��(��(��(��(��(��(��(��(���?���(����QE
(��
(��
(��
(��
(��
(��
(��?*�z~����,�ltӭ%�����s ��P���0w* ,�v�_�G�Q.��[�an��1�o�������/�&7�a���RC�=F�Y6�̊�<��
��
=yW�9�ݲ��_���G�nz�����;4_�^���?�QIV���	|3o!��ž>Ҭ�=�5~ol��_�Ο���ј-Qb$w*1���?�q�'��_��32?�M0��'vz��,�7�����3��~MDz�¯)�q8o`xc���O�n=DM^�S񥟎��N�gr�-��W4�fw,�u�ͱS�A�lcW�����Þ!������,.!�5��*���+�
є�ó����_h�.�
��G �*�n(A�@pH��~0z���z^-1~��ێ�<�k�����!\��#������@V�4��&xu|o�r��V�hh�%��-<�ș����0r�H+'��}M��b~��M��"Cc�|L�̎�V�f'�5����P���珒�ʶ���sĚŻ�/$8��3��0��x�uJ�[��͟�G*�3��[�|���?{k������8���?#O'K���|B��ӗ{�;k�.ջ��\��@5��W����<���?�-�j��5���S����'��ľ��G�u��=CԖ&T�����5��W�G�)�O�j_��"�9��m}�v�mt7�B;m���U����3a6����D���v��Y~ `����V�c��5*��}շ�?i/�,�.W�¾3�Ԥ2��m��z׻��ҏk��>;��sFV��/���?�o���4���K���i�ź�q�L��4g�������X���6�hL��|KK����̾3��8�e\}E}���iZ���'�g�u#� ����Bϩ\G������W�ZݤW��_�伛��~�K<�_��{r�\+^ڛ}���E�J�]�K~����&�E���|��F[���!�s����ES�F�{W��ƚT�|���y.��?|g����4$;�����ڍ������o-o����c�����#���O�_B��.S��)�����K}@��SN�Kt���ZM`�)u����!⡩�m?d��ݤ��?	|M{s0���W�1�$�sѽ��3�f��<-�_�)�/i�,�d����'g���e�g#q�o�.7����q��L+t줂n�1p�`deI�������/�M���~�T��i��u�O��ҵ+���$LJe�m*��^����̰���W�}D��'+���]���
O[�d�
�7%���l]�8���W���?�?�?�e/�+��/���č~�m�l���q�m��csդ+���kφ�����<�8.|I�o�dPk�)����3h�u9�� �6�j��'d��ho#
^U�)�E|��ϡ�aa�����=_�|�4�:����'�Vo�I���mHF�ˬ�N�Fɦe�+o�
����bߊ׬�%��7�ݶ�,������r�4��\�- �My���i��]�J�-�A���J`����u�J��(�a�����9����U��q{��߶g����
�'x[�i_|q�����{��8=x	����߲6�����鱁m῀vZ~���徰����#`3��{������+������>#��v����؈�"�	����1^^�i?चΧ���;A���y�-��`_ʼƿ�`��	���*��Q�hE}�O��~��_��fx�I�?��M��Ƚ��o�l?:��'������������>|4���T��Ƕ�����H��N�����?@����S|�����w	�`�R�����<w�`��JF��
?�n}�1o`��6�����K�k�Igeh��C����~���[�?�G��S�D�J+�y�����G���	-�%g�����D�,UaK�����:c����h?�U����1���3��g���l�i�����PZI��uE���9��M�ٯ�����s�|D���˿�߲������ZN�m$W� �`�6��DBЋ��̘"B���ㆄ�([�V�U���)^T�_H;�
%�l��>3kK�ٛ�
��o�:���8�͵�Ϳ�iL��7پ��*�|	���?�{�B:�a�j3LOn�����
���]����5���ɚ_�ia��uP�J��i� ���ে���?�ޟ�V�CZ���Y��Ua���B��s����0Ҵq
-��#��#y�-ԯ�BG���E�ğ�*�~ق\�>�-�c�4��*��p	���L�D\~�_�N���j^�����O�"�����k�|ԭ�杨Y�b����2��k�g��Oi���\��~\�%ߋ>~Ӟ4�uk��ȋK�n�6D�;`n`:�4�M>���#�4����t��/�?����F�-�uO�%�����$ ������卧�5�����2OC��>���޿�~~ş�'�+��xO��Ė�nv�Զ�Cl����H����ҵ����Kk�^l�C^�Z3�!�
��
����d
�xV�_揝�&���T��m�H�@��
K��_�_ƿiV��%|m��N�2p"�@=�\O�q�M��C�Q�~ �H���5i��rZ�.=����/
���%o�p�+�WƱr�ޒ�P���UQ�W��d�c������u7ß�"��⏂�K���J���m��x���w��4fB�Y@fPs_7�M�w��ysIC�����<%����>������-�]��
��^@�kcRT��+�_�w�3����/�W��?c��
�������,p���[�\1Y��w�W����<�8�ְx�u��OOF���̹�[[	���z�����G��A˸.~:��[��}L|[����`���
�+����|C���B��d�'Q�����孕�F[�k)��}ܬ�11'��ڻo� ��m�7��Y|CnX�Ŵ�S �m�P��eq��0'ֻ��.���
��O_ڧ�:zK�O���Y������]�b[�[$�[B]�BTw��a5��)l���n��?�'��
\`��u����~�W��N/~˺��ᕻ��<]�A���zE�,+go<
4����/��e�$,�p�r����[���Q�SK���|\�t�"O2x�b��B��Bq��^S�!��|e�^�ʰh�����xc[ӼU�G�K�$FX�-����gUb�"�����
���?�n������f���O��u6��G�����!Ft\��T�2G��a�Y�_'�r��m4��V�.�i�+T��\����4��|�kO;���s�Z΍�_�CH�z��o�ؙ���+\�(���.1�$W��!�Z��bҾ!xf�U�K�G�Q�}��H�{-�"�� 8W�2{����!���������@��
Ǐ5_jp�+$^�[�W^AG��9;�޿O���k�	�V��*Mg���)� ��,�#�yE����5�L\��%�_�=��ʆX�Gy7����c���o��z���U����w�'�9��+og�f7���4�k3y�&0�/���~�~֟�I��'�y�&x����;�N�3�]c���
���j�Z�c�7��{v[)��1�|�gl��#����/���t��6���|A�~&����Ar5�sA$&O29���z�����y��.���׀?g�k�-<?�4�^���Fi�ke�X>ѹbr�%G���r<N�'�w$����[�f5�
��;(I�����S�	]�ſb��4����w��j1y.��f0�,�ܴ�A#s��n��=���|M��	���)�-���:Kh^7���U��!��B�[�.M�	#��W�0"��h��+�
I�4�O���?
�(R�"����)Z�Z�o#��Fy�ke#PE4[�rUI@pH�e�x�Ö:�h7�"���%���l���.
�GN"f�8i1�{�[ԟ��F��F���2O��-��
��s�g�o�Z��V�?�-U�Ԙ%�v����+�#T���������51���T;���!�̟���Ƒ�'|��fi�-.�i��q���d6k��?�.3Oo�0xQb.�;�����D�?X�~u��H���?������:�����5ohq��S��奆�8�`o�i�/�X)ER����
��]x'�߷�(�Z4Iw��K�_��,Ϊ����Ձ���5�„�8*<�ѻ+_՟e��qT�*��{+��w{w������O�c��7
�1�H>3| �\�u
C�b�c���{t®��u�@}��4���(Ή��K孼_�5�8Y&�%��9���sڿ$>=�A�ࣟ�M��~�G��O��t�eԙRݓQ��C�
̰�����[�ޒ1�ܸ��G�#��'�zx{Q���x⯆ Y��
�,�$D�7�����9
͵2@t��hQ˫T�r���]�������5Z����h��WD��Q��+�������c���7�t�{}���{-ac'�e9��T�0X�}o�O���sm��T���||�R�B��c6�$2��;d�\�2��+�}.</5��g�_,&Ӿ*|.�>"ZJ���a�p?ّ�ȇ���<�ҿ�ލF������'�!Ybh�y�����?[��T�c�cH����o�]�N���m�o�3��[�"g�5����$�
�x��]���O���%��N�2���ҹ,��*.;Wg���]O��!��~&�4��<#����	4�^H��X�1�2���_Z��dU������>g�a8�	S�|�����7�������[o�
��/�3�	��ᵮ��ƽ��ZpEt�/-C?|��џ��
��~����)���=�	.��%�5�Ƒ��OXť�$�;�;��׏R咳�V�Ϫ��aVҜ�^M?ɳ�
�j:J�$n$�@YNA��4�p��(��(��(��(��(��(��(��(��(���(����QE
(��
(��
(��
(��
(��
(��
(��>����o?�g�����ᖼX/\I#���7�c�s�/�#�΅����}��a5�<?�����gfAw�COB��_����2L�=�M&��7�e�f�6S�����������x�?5�}C¿mԆ�B����~+i
�unO�J����n��F��⿓��$Z�쯧]\k;���9fU�@,A��=��΁
�����}�
KZ�������7X_I�hϺ����X�L�J�����x��<q�yw�W�W�O�)�z#���O�K�Z��Kel5�2C�H�U�\��N�k�o.g�����W6R�ѷM��p?�㟰|���c�଍it�i�������0h�/f��|��>����g~r���xX��د�������u(��Z��:���]��LH�_q�#>'��&���ϲ�is�xJ
v�FI�.��3��H�;A�C��$���~���)k�	>�x{Ŗ>"����Z(#���/,I�ܳ#g��&���/��O�~	��<5o�_xK��,"=R��$� }� �J�9y�ʢ�j>gU_ǿ�yᛧ����嬣�-�H�x�
^�A�f7?�a��U���߶W�����~�}�k_����=�ѶWr���\��ζy-�fL�ex`e�)�E�z��gԾ6s��N��+a??�_ȇ����]�bֱ�7˽���4�B"3�M��u���_�پ�����߲���-?b?�*���e��_x�༟3��բ�>{��FZ�L�7Zt�t_���u9d��������
�d��S~ȅNq�j@�F�}_	�ڿ�_�&�O��6��E��[�V�)�F�z�`�_���F
����K����ѷ�ׅ�s��\�p��i�̏�������
�tv��zG�lT�'Z�/q���W����/?џC�s_S���T[�Lv����34_�Fσ��EBG�I����8�MK�e��~�6���[W�}�X���;���^�۟��8k����SB�3q�$nDM+܇����k��ٻ����.ɦ^|Zy����h���)��g�Z3:_���+~H����p��o�6C�h���n�hh	:?�=k���J���W�?����{5h-$)��g���
ý���H�UT�������y��m�p�4�t�z��E/��o��)�O��,��ᯅ>�~.����|IicZ��I�,�
�Gj������\=��S_د��/�R�U���~�~0�<Xڇ��,<S�b��q%��I:ے�%�SmIa�H!l��^*�����>0���_��
�Ҵ��&��ϊ�OŸ���K>�ڝ��f�<����$~C"F�p�F#����MwG�t[�V��W���Tp
�H�H �F
y�z��M]Y�M�6��9A��Z�U����J��t��{�x��
a�E��x���K�)d2�����sø�ǹ2eϭzO�����'m���B����x�]��V{�nB��
�����:èh_�/��]9[o|K��P���cK`�
�&�d��EA���S��%-�y�پ�
�l��(�j�������壌����%oOz�̾4�e��_�\[	s���w/�7M!�����I�����L�%�����+dA'�'�5�mί�����j2f[�K�n�';b�N�9�d]����	M�ͫ��V��>*�%�4��I�E��D��ȹ�h�a�f�������y�"��O�J�?I��z��7�>�fX��xśo���ு��~'���ா<���]�xr����^�"��,����w�ͣ~ƞ��`.����o(�Z-f�`�����"h6�~*�����W�3~О#�`1�Q���bMxP�/d�>��>ζY'��.?����L��O[�W�����<K�xb�e�����G;�FP8�_���_��9����
|6�>���|\�6��}CL���H��Y�E�d�΂��%�o�_�zo���C��˓���w�o\H!��-GY��^�j�YRc�Q� )��^�O5�_�����Em�ݷ3�s�._N12���J�K_�=�;�j����7�	�'�Q���㟋~>�G��<<d����,����jm� I��wTXIl)�����
���ޗ
��^��E��@p�æ�J{*+���>|�Ğ�;�B��^X���Wi�]>����$`
�����1���_�6��*�Z���DZ���_GW%�VU$����Y4|+�e���F0������:+j�렀���x��?e���������(�u�~�^(�����;[X��Jlm���l&-+�Wy"4�ߎ<iំ��g�j��>�>�s�j��$������ʈN;��{�*7��Q�ia�(�n�?���gň4I�F5]OÒJ��s=Ԋ��N��ډ yq��u*����i��w^���}�jZ����߇ZU��W�O���ޫ{#���E��ZB_,Me�qǮ+7����˿���m��+�棤�A
� ��e�0����Z�H��?f�߷��㟃1�y�1��>SG�lv�ַp�qgwo�*�2��7��O?�/�������'���>�Ma��w�������3��"D�͖�TnS'�8r���&�%d��ݾ{����
*�����k�m+��O����%����K/��O:�Ʉ����{t��G�e�G���	������<>�wc��O�'KӴU����FҹTya�R8�.�"�d�W���nޯ���&�<+=�m_᷊�E�_[�������10�m¶>�|�_������)�T�1�4hI�J��u����%��R4Ԥ�Wg��_ۓ�w��
��|F��>x�AӾ�j���x��+b��D��'�O,.e%�(���0�Q��>�kk���H����|W.�c�=s_�eYw�b��s]߷D����og��cY�䲵���w������D~�?����Q_�㯊4��^&�ċ��b}^h�-�	Q&���%������o�9��|]ᯄ������l��
|wb�z��#�wium/6� �FU�0@5��~�`�����/<3�����Q��"ѵ&�V?/��D������Nv��]�����ƫ�~Ο�����PC}��]�*�!eh�EW �3`����p�_k%M�v��X�+(��C�BJ�-#u����}<��wN��F�<�[�_����U����V����:�J�A���3�K�'�jO��Y|t�~>�ÿ���"��Xx�f��|?w3ƥ�_:ET�ͷfc�$o��D��|T�O�c�	�>k��?x�����g�/m��x���C��/m�-n-�������B@����?(��y~!�R��h~�ߴ,z�#z����~-��$󣶛P�.�<��W�4�*��p3������;ů���3�\0Y�եiŦ�mS�^���?k��1��߷���hx����?�?�|�˫8���Z�ˎ��_���XW,B�������&����?�h�k?�Gb�w�2�V�������5��7��2��hl�
�k�x[�|-�xOǾ��G�}��0%Ŵ�Hl<nN8� A���;�y��M���]�ſ��>j7D�g��	dՅ��#:��&2��}Nm�9֕UQ$���~y�<j�a��te)+ۗ�]�4<;����> �Qӡ�-���?o��3�F\�K�{h��*���?���_�H�c��~�^�ގ��N�w���FO�ܘ�A4QO%���hg@��s��|��~.�&�ƿ~|4��u��;}CK�,%��c�C$ �#2�C_/�1�/�����~�?g[y<5�*�ᐾ�>�m,�X��A-e���C��c�e���x8��
q��E�^W��}�K���r���ҷF�����E_�?�)~����w�g�V���7����%�{+8�d�$�����Y��T����?��Mw�����/�>�Z�P�^T"]���VW*x8��_���C6o�e/���|N�N1��Y��8�}��+(߰'�h����|v	����p+�p��ԣ;�����}jN�^�=��?>��?�%ែ�>��?�>&��ǿ�~>1�G�4ۻ���[ȭX��q�3D� ������{_������ڣş�gǿ�c�l?\��G�5�>��
�Z٭��b�#�3$��Q
噽C�	���?���f_�ߴ :��J|h��ENj5[X�n��vi�Y�ƶ�4��п͆fW���߳��+�@|g���~־��S�K�Β4
?�ZlB3eam$Gͼ*[|�-c�v���r2��~
�Q�������6�^��N籏Ưg��eʖ�vQw���_e�w�j�����	�5�@�W��^$�ơ>���-퇃��Q�-"�Hd�u�����$g?���U?�?R��?f��o��G��wM�xjG�6�4L��O�6���kǜ���">���~ȿu����~��K�R�,���$�l˖8`�<�|���[�w^���go����=cN��_���V�[�zy�o6��P���s�����K�$�9¥�w�v��E{|�??�?�G�G����<U����@��V���u����꤂9|�G�H�Ld/�<��V�r�1���'���_��R�OX]��R��{�đ�ɵϗ"� ��8���#�_�����Y-�!��E�e�!S[��"�m��(����s�G���?�?�s�
�����#�Ҽ�4u������yg9�鱒�H�\W�*o�J��$ԗ�W��g�{e��x�+A�	y�+%�v�H��c�	�G��rk^9���y�&��}J���U�ɮ-�c��R��2H�
�BIx�%j^��d�{�>!�O�R�4�V�!d	n��	���$�c|�62���k�>+��>"���#~����_��P��^r�%Žя�9H�-k�1��q޿R�����?���~�~�H�������Vdu�d�m4��؞H'$b�8���T���z7��by��mX�褗����'�����|־*|E�O�|���j֚}����׋�EH�̅�l*ZG�%��Db�k�i�'���*o��_�.t�.�|)�j~��Z�I�[+;�.�.^[�\������:=�
��s�Կ��i����n��)�
)<s�^�m=Ŷ��+L�[��V�Fm�Nո|�k��S�Y��`�G�1�Wස/|E�9|w��~)��&��ao�C;*�3���@�eߴ�|]Z���)�i->���_#��>у�J1Nw����{�G-�c����>��?i��x�M�����GB��}��n6�=��r�̫��UJ�vG8+�~п�o�k�L���>#K�|�޻�<%Ꮓ�Z�wy��ż��I3ǀ��yѳ3�D��w���7�՞%����؜~����o�.O���>0�ц�w*�ϳ�'�v�am�FvE~��T�f�z��|�w|9���i���-����f���$�o�[��\��%I#
�GV�0Gۺu��w�z��K��*�TU����6�[��*��9=���!b�C�@m'tVx���G+���x�+�_�_�O��+������W��2_X���j;���V�Wa�yo�u߰�ǿ~ӿ����>>��>�,e��t)�oq,xQ�2Ep"*�q�F	�����#&���Hւm^/]ɟ�ա<=Y(��qm];m��=�	��C��?e��(O�O�:=�f;MMO�_L����
lP0+���m7�7�%����x_�m��ŵ�g��!3�82Ml�1oS��=��s��V����\52\,�������Q�ƒ�k_�E�j�Ŷ��o�՝�x��G���
Oލ�Q�/Y�`n7X�~T�;�d����^���W�	A㵎�B�w�-f�Z��v�v�v���Z�v��	<�e�6P���	P�i��c�/���K�n��x�����1_��>?h[���M���&u'�9���8�ট"I�o؟�ׇ����?l� ��0>�͆�M��i���{�@�?��_�����+�,�����]�|4S�vH�؃=g>���^���/q�p�7�G��#���fx�o���5ۂ���)���9n���e*x;���G�Q�D��ۣî�3���x�O�eX���C����s����|� �M���,��?<���|�Tǫ_iwD/�,�NNr�y��~��H}?�gZ�g�_k�0�����1�lNCyFK��v�d�01ָ�Yi�rU"��g�j�z�wխYFte���_z�k�g�E�<��hO�_G��?�o�3����4����?�	��O)���9L��/-�3�lb����\�+O�v����<9�n�X����e���$�k�m@<���|g�c{=���]ad���w�bW+�[�j�	�~���x�Q��'�t�i��6��D�qs�őd���WI�QEQEQEQE[����(����QE
(��
(��
(��
(��
(��
(��
(��?�ཾ-�����k��t����)���}J�,O`[�Nq_Ͽ�]���­�{i~�ac�V�<�U���*�մ���`�ϸ����#Fuۑ�@�ݷ͑������f�,�5�i:6��@�m�x�~X� �i��r�_������7�
~�+=���&�l79���g������_��p��`���_ɧ�uο�2	���S�����W�������}���X�L����ս%����a-��3s�?b�h��n�l;
ٝ3K�o��^\۪�n�WM�b0q���k�]QB��G����.��P�K��t��:b�sC=�\$����L�(��:�U/њxj䱘��Y�礕�������)	
�9&�,�t�y�=����_�+w��j>�->�0���i�I0Ԥ�m���9��h]o\(�_)~bX��=?�M��7�?��*��>�dѾ6k�<��u�Ǵ�����(��n��>�<�XГi��ַ*iE�G��\�]3Ꮞ��A��;�������5\kO������>�θ����i��N�wgb�@򞞕��|`�e�S�!�;���F��G|c z��I�-���>x����KJ����K�?#�u^:��k(Ƨ�f���xW9�k�JK�&�g����?g߂�>���xS�v�i���X�m��P�1$����M2�o��5�bqՓEQ���cW�<h2��N�����F��	n�s��Mo<�'��/>�Es䑾*����3p˫Iv_�TL��Z��|0���~4$���a_A�v�C�C��$�4���_�������Q����po���M�|8�ag��6����[��A�5��rs���Q.��x���@���i��X���n��c�
����_�E�Tr?��?�m��g��G��@��۷���.���%h��izς��_�\ŝ��Ge7�ˎAm ��_�?���-���-���J�o���P�1�z��F�l$?�U��g�#ӿ�_�s��~��-N�s�,E��̽�\��tp�P���ON_�Y�kK/���oέ�Cf-u?�C�ه2Kuq�[�s3u.��
�����
�K/�:��,n�h���2�x�%V�U�_���7C��x[w#T�7�,�
:�=�c�c�W�
�#Xj߲W�˦k��F�o��ö����l���+�$pr�uB�EE}����*֎)�w~�v��_�	��=j����i��Z��o��8����c��8ϵ~����%?�����].ۯ[��Þ��R�Տ�M����e���~ޖ2����_�(X����v��	�����7��:�5�V�J�}��ܩ��m��U���쿅�K��Em�4.����ߝ~L�D�!�Y����V�01�����;h��e5��Bm�����S��w-��\�ש��
-3��.�_|���x3�
������K���߄4�;[���-��"V<��㹯�/�7�:����<S�ɧk���x�8/��m��ef@s�!������Ӧ���Y������UO�I�莛��"��>,�����ξ��J�!\�Rk�Scp���E�w�C���]Z�~�&���4C��nz-Ԍz�A?�y��&6�'�~|L��d�����s�Ʊ�Y�8�	�ƾu�]ϻ_�8�8�+��������d���ߤy����w�nl}M}?a��i9�I�I�|�����X�����yq}ğ㿹 �Ŭ��z���O��Wں\@�Xg=k�N\��?5��x�MO��������b���8����C�q��L��ZȽ�J�8��Ҷ��{y<���F{��~�<K�+��������?��r�������@P
Ƙ9'�z9�F�>_�<��t���Y�!�|X�>��6�e���K
K㇉�ob�n�k����H�6�9A&�;?ࡺv���	1�෇��Ꮗ��t�$���?���p�1�Y�=k��8�Z�������ms���-BK|���OQ;pu�S��q޸�)��l5��C����
6~{��C�M����dx8������_s�}�f�!��ӄ�;�=b���?�O�j^+��?eMkVo6��:2�;'�R�3_����/��/��o���N���C'�:E~��#/�[�	��#k��\j~
�`�l�%�I�$E�L���ڵ����mu���[Nà�kM%�Ϯ#?�re�}n0��_�g�ĉ�fN�O�F�{��$}M���s�����_.�M�����Ü~+����xz�ſ����ÐL�����E��,�f�–��/�JTо'�S>�˳���ז�NYZ��=N�1���
����?�t����?�W��~6~�>-i��[W���@V�g���'1�m�7��r�n;��3�iBi���8�͜��M-��+-�#��5H�Y[di�1��ߊ���?�H?�*���u���T�
�S���W��E����R9b`O8�b��_��K�m�K��~��%о(��C��.��}���;#}��-���Hz�$B2��_�e�IF��������1�*S��FQ��];|՟���߲����{��>�������{���?j!&��Y�_\�i����� [iay$&��b����C3�)��2�	�}�>xW��0�;�����T]Mwg�_Y�H��I$i`h��6�\g�o��rx�L�����>'�o#����zM��|�u��p:�B;E~|��j~�Ӿ*տc�C�h�M/�
K�W�>��k�r��6���
�2:����j��P�l&;��S�_m�_=w�g�{l,�Rm?f����[]5�?;��^"��o�+���.|Kq�i�h��'{�%�?�N
����#�O��ߊ-�k��<�]c���n��rA��9�r����o_�)���7�_����?�_t��LJ�Я��wh��'�F3+��$�Ʊ!}�d~>����|G�Y?f��{�f�,��_������_}�8/ ��ZE�θ����.p���sX���֊�_K����y\%��2�+�wf��$��{%�$�S�ટ~.|)�3�|N|�?�+��:�_���aq�F��ȟ:��1?B~��_���~~)x^��d��1�]���k�_�����
�W�/Y	9��?�^%����O��|i��M�-�.|\�A�i +5͔�d2�a�C4r��y�@<��>��Ÿ|��~	գ�|�6�UӮ�ee�����R˝��89�ij��;�W���
R��2}��ٯC�{��M�������K�G��?��o����#[���c�C�dQ�$�����z.�⿇��T���9�����
b�A��fXt�y�Am��P��i(r	~�~�_��7IJ�����kெ��rM�k�2�i���PIy��{�?q�i��I5�q��a���w��~ȟ�N��^-���^iZ��cg�>�[E>��#\�5���\3�(ff����+��撝T4�o��[���C_���ڷ��'��)�f�I��|�I����ĺ��ڃ�̗F6�2������3����>����M<I�ؾ��ػ2	a�������`�_��.|��'�9�G�Ľo
k�[jZ��]�~]Ű���p��%f)��S;H�������˩MaiF�ו+��3���NY�z�y]s6���V��}��~`|��8��?�i����Z���A�]Gw��R^�������D1�G��I��k�0�f,�I'9��ښeP3�i���
�◡�'R�R�7'�ϝ~"��?����S����
.���A&��gIF��o?�?d��I�!9ݞy���#�x�m�P|�O���Z|�^�Dq�2��\�����FW	4.�� �2�
��y�:��Fg�l�j������G�/��r�7���g���?�o�s�	�p�����m����b����S�m��+I���$�۠y����(��#(`���������/|1�����4�>	����Ckes
����b�"E��H�]
�Nq_�R�'i�q��p~�iyq=��ß����If�M�wsܳ�$�$חK#�*�t'k�f���}~+�^����{;�/��ѫ����Y�k�OQ�c�+�j�߃|G�H�ڕ���f��nߘ���o�z�BO�����6~�_e_�^�'�ͭ�5�hɖ�l}���_�{��n�g��T*(
�U�_��~X]�A�o| �����5͎��ʱ�tE�_�v�GJ�w�?�X��k�z��t�:��]jG����ZMޠY��!�(�q�F�nk\�,���I�g�%�Ϝ�ج˖hˑv���ݬ~�x�~�����4�y$Y�6p��	�BN���5��i�G��7A�4�mBѠKk;+H� �1�8�*"(P+�m?�|PE���&�Ǐ�7�����RXG���rv�����n���|V��>��.���8a$�:ע��v��"[I�s����k<�ߴ��M�HƗ�uJ�Kͤ����I/��p��О���C��0�~Կ/~:|b����_�ńvku�3�/+ٮ��A>7K�E;�;�v+�|-�'��f~$���_��¿�A�
��'Dk
���Z�
����|��X�
>
|@����W�%�S���2��ĺ��zb��"+;FV�I'����\nN����;/�\�̫�kR~Ҧ'�Vב]����x���m���yѭ�)��q�o�t�[%�����|m�ET�;}<ܲ�i�	�x���?��_	<a4���|R�������۴����M���|��W�o�/�%����^���i��.���ԧVS��m��$�;�g޾���+C����]2�G�-dV���Q"�ʈ����bZ�c�����tÀ0*W��/V����-����|��G�Q7S�ǰ֥:|e}ey,���l�Һ�_�j�h�
��9�7�<p�!�M��N=�{�濨
+�Y�1��߹/�=*|!�G�\_�R������z�K&��O��	k�ث��jWMc����ʌ�8
Y��	+�&��u'�/�(͇�ޒg��2B@$e#����Q��1|z_�M�<v"_i�M~V;�dx[�

?�����	�7+�x"���㟉��H�׾!����l[x�uV'�Z�;� _�f���&Z�0wֵ�s��:�S޿b(�^^����d��$����'R'���л�W�q�_����W�����y������7M+nΥ%���m��b�R(�Ȥ��|=����yx[X�״_���:��1��L
��˙d��ؕ��_o�^��i��N��A�iv�P[ZƱE(ª"����B�["��݅QL���(��(��(��(���(����QE
(��
(��
(��
(��
(��
(��
(��?��8�V�x?����c��'K�^���,a�y����pO���K�T��"�@�࿞6�J������d����zޱ�͝�06�p:��g�k��ص����kl���#��_�ד�ϓ�kSac���w�Qy����CIKv����1�pG#���Rղ�w�������]W�QО)i�M�W\��U ��@�޿�c�����k�
v�����~[�Uy�˙~(}�`q���m������*[Kci��Ư��'bS�62j�)���*6ۓ��1_��L:dW���a����G?�+������\��$�x�q����4*H ��;ry�)}V--��#�ÙAfz�J�z��0��[���c����/��[�A��"p�#������|Q��_����m./<?6�1#2ީ�0�%�q�<4S���:��f5\(NQ��z��%��B����}��>+�ci-�ga��6џ�|�h>�<lO�����Q�3|#�/�������T��;�����(�o�p��2a��k�X�N�}��s��Z^�ur������|E�?g?��,�14>�V���3m-�g��݁ی���ᶙ��"���[×�����\1�$�\n?��%�;W�G�3������ݳ2M�]|�
e*����ڿ�_��i��1�-�N�<%<e00��F���g����U�B_���8��xH>�c���b�e�*� ��C�F�e�����]"�@����/����|>���_��∎b�&�g~�9���s�j��7����R�����$�z�ρu��;X�s�� J�|���'��T߯���|�}h��H�%���<����I~(�-��K���v�#)��NЃ�]_��Z~џ�H�P�+|M�}��Ά���^��)�4�L���|v�$��_��N�z�)4:b�)d=ԛ�s�����~+�W����+~Im7�v����e1������Sj�Y�Z�e*
���sV��U��?�'N���-�?*���t���-���xKL��E����-���k4�P�c��H�v,:�L���y���`�f�������>	�s�W�/�T��#�v[>j��'��W�g�CŖ���f�њ���gF=d�Z'�q����+6���S��9d�������I��"~̾x�mWDZxSM�L�F��O�����@�������T^1�Ġqڿ����÷Q~���H�1 ��zω<$�Z7��@�`Ө����I�l4=2'l���jO� ҧ<�q�W��|uN����/��ߡ�h~ͺ��_�	��F�4�ѯ �Ĉ��,K?���ҿ�?�\��w�1x����<=p��&�nO?�#_���z��+���L�`�����\���2�,���Lg5�9�)/���'�esy'�8��ىh?P+��U�����d2�-�����"���>-��_�Sς�N���_�N���
�?�H�q�Ț��I�-m�O����u�	~x[���|i��1�l�6#��{R�c�@X�$���������W|j����{�3��}oP�|>uX�c��z��%�[�f�����Ƞvo���IKYy�-����XRO�������8zU���}��������+���r���0������O��{g����~����Cx����ϥ������c������'�=3S���O�1�ƥ��ğ�D�?/�����/�}�=_�q�0?�˧\���I�����Y��?P��c�}쯯���_�?�R�Y|R���~�
-�Xu�'������7�?�@��Ȃ�;��A�1��&58�+�[�5��D~3�_\���_)[	�rM~'�F~�/��M>H"�o�q^�f �j������ڙ�N@�j�}����/����h�>��>��n�M���gKe���?r%wr�PfT�`q��f�������#����N�R�o��o>��_�Wx��
���U����[mj���q-��B��
*�[�S�]��0�'�=�S4�$���G+�S�Ȑk�O�ҟo/�,���8� �L�+�>�*6�:������P��I
�r�Ȯ�^�\�ݴ��5�9��6������4�R�5��
��b�.<�s{E0넕��21XdeSVK����C��q0��Ѓ��o�7/���H�	������
7�c��?��=�����y<Y�r���x�Oe��t�OB��J�#�0�~�֮�����u~�_����fߎ_�ϋu�6���4?�M�0��#�_4��[>Ś$�<av�������[�����Y�W���9���i�sGp��H���i#��iJ(v!6��H�*�N��QWw�Kf�6}��xe�hF�\�*�i������L�-����?�V���\-����x�"��d��W�G�޿���E�*��_�h�~�_���C�~˟|{n��#KX>�g~UU7�!R��Yd]�r�$涥�-��-τ?i?�)��<K��}�xj���j9��uh�!�t������/���Һm�um[�q�Z���z��I&�dމ'���ٟ���5�w~ɿ��'�ǿ�z?�$BR.)~ת\>3�+2�ؠE���+����|D��?m����Sox._��	|U����]�"��O��>���ܖ_��!D,�?P���?`��_�<g�٧���t�ѿ�� �k%nT�Ύْ;%l�����~��&�}�n�^��ച�F���pƑ���k��B�⻲>�B�kbR���^�֧��u����')OF�i%����~)~ÿ���S���?�?e��_����=�4��N���Wľv����;EX%A�y�3���ᗽ~���{>#kFKO�_�KO��-�m�3�{٤A�˖K;���{��-��=���z��N��z����K۫�]䕋31�I=Mt�J<�Ш�}��+�2�+�Z)˽ݼ�?5��%�i�lk˻��K��৉���N�-���Koi��"+γ0�X\Z6NB(��?�O��O���-���#�A��%Կ<y9��PC+PYbgt�,�����6���d��ו��Y��|U���-�M�\�j���t̃'��v�3��5VWr]��x�߈�&���J0���V�u�2��
��^#�k�/�V�-�?��=���;$]���R�����ԆV��̝���e��Z~�?t?�����m���&�*	R��_Z������!q5���i��dIz�7.��
۴��y�ֿ�?�/����>'��r	K?
�s��e:[DKv��]Y��|��-��_�<܃�j����E����
_��`^�Zީ�}{�n��8��Ě���s>r���F��q����Ӽ�?�����x7J��!X4�H�"
���W!@��j�CG���|g��,P���a�d���H���m>I�,���5
�s8P;��}?����G����~��%���7�U��s���Ulz�3��k���~��?�
�t>���=%�������v��m#T�/
���?�п<
�����R[�&�P�l�Q�8IfF'=�'ھY�?����)��?�
9�oh7]��˥�?B�dm�m��&z9Z��?�	��+f��s�7S�esy�Z�휨��sAl��%L;rzc���q_3���	�����e�J�����|@���~�?d���?h+/궤���֧#8�h!hI=�x�k��7඾Z�߳��_�kȏI�+َ����'ڿ���߲����v��N�Y�����*�t�"��'�c"D$g�f-�^�0�{W�.!�=�_/�'�O��k┟�/����Q�$ji��c�	��]�.�6�͠I���ȎL.{����ਫ਼3U���G�n�.B��f��2�����ֿ��+)瘷���_�uS�̺;�o�R�3����?�/7������O�_K�HO��7��^Z�����H��9�ס��A|N��U���_~+^K'�q��fD�4���G7)���S+��_ѕ�WZ�nu��+#��eJ)*Tb���{��Oȟ���B��&w�'���_���|����j�ǎZ$[L�g�S�8��O|
�+��K��|!�ǁ�}8�[��]��Q�g*U!�<�A�J��T~F��V���ESQEQEQEQEQEQEQEQEQEQEQEQE
n���(����QE
(��
(��
(��
(��
(��S]�4KK�CZ�mt�1�i�H�A���G����_�
�k�<�R���	�����¯��Xjք�|�O�WC�=R��?�_����o�]~�M�
4�{�
�,<�=���/��;�+7�߆5�D�o���JGP�����h��2��p�K�i�ޑ�$}v<����}�_)X���Y�!k��/��w�Z��6�i�b���<�h�p�0���p��lbT�Px�0o��G���T�?V~f~ڞ\?e��0�<u���ȘnϦ����5���>d���:�Ei��տk�3�w��Ƒ{��9'��D�n��?�5�p�
�S��3_k�k��?���^1ҥ�I�)~����G�j�����|
���*�3�d�P�g�
�
��^K�z�ǂ�a��}+��Ã����+5����
;�W������x��O��o����?�#��Ŀ�U��_��FW�1x�?bO�%�ru���9Ҵ��V�2��_��h���q_ѽ,?�Z]J��g�w�	��2��ˣh��׌5X��Iӗ�������>��WI�v^������g��J�3����N'�6�����5|5��
ᶿ�E���$\tف��R��o�V�����0<U����F���>R��1�v��.>�M]5ٟ$�U-��G���˨߷�ws�)%�6��O��Z{�
|.�( ��:�Ԋ�I?j�
���C��:
ľd�~�GL�,3c�o��¿��-��?��7���\+�*�i6���?��\Ck$���X�n{�+�����?}��#�-�ry��<%�0Eݘ�>�dϢ�e���k�&���&�x;~?�y�_��ְ	Kj��OK_�?�Oْ�ٿ��R����(^����{��%�3�w����ko������>.��B��"��������Tx�B���$V(��d����|%�<���%�+X��tox/H��a���(�m�vK{�x�*�A����8�idXԐ���'�>��N�o�i��2�x(sh�5��k�>p���e߆߱���|�[i���	��q{"�q�_K��^�������I�0��U��H�!������t|!������R񜣍�2F�F29�m=A~��7��ž�F��x��~%�%�<۽CS�����$���va_�L��=�|�g� ��?|@�(��(xLxr�_���5Ś6X_��1�<p�W
]�U%:Чݯ�4���1��n�_{�K�v>���4��8(��̾W�~I|��	.����
��T����$�D�?���H��?0�������7����Y_�~�藾��~)|.��>�ğb���$7~*���TVp�ݧp���QO�?�R/�4���b=GY���^#�ou�+H�KD�<��I.)Wd�	��j��?j���.�o���Ue��<���y^I%�$�o_$������V��a�6�VM]��-Aa(���D����=������O��~#��t���O���Yd��EKKY%%�`rk�����bώ�I�.|c���E�x{���4��[k兤�J��`��Ba1Q�W?0*����j?i����/�����_�>�e�XkxgN�}V��G��`�ư�C�l�"���K�f�:�*�7��ܩw�g����{J�hֻ��'�k5����?S�G���?��;f> ��amw�,�葃#1<��T��L��߳��n�1�@�������j�c�%�5ݵ��S��_-�l�A����u�_�?�>���k��V����~����,�M
�I#�&
��y�g����7��]����z�����k�/B��ӌ�����u���NxQ]���UEū�*-���qd|SG
,R�]�74�ߣW_�����
A��'Ц���k�Py?�QMv����%Ԝr#_�_?��o��4K?���N�꿵o���g���X���M���wt�%hc�J��@�I,j9���I_��V�����?Xx�S��I�I<��1��]���LD��ߞ�7��'�)�=/��X�i֐ڂ��q&B���p���ʼ�}��z��EZ��w�����2�d�?iO���R��#L���Ὥ�>	�'�m����Yd��T��5%W`lɵ�y6.>0������g��+�#��˨�%���#��P�Q�|m-��&��h�<�"[�H#�-�����H�کm���ƹ�%���)p�˛�����&ev⠓�M�.ώg�؃�@��5=_ğ>j��V��e��ui5-I�Y��	�+[w�(�f�=�
��$���
��Ȭ[�%88cXM�0.0ҹ���_K��iR���#�3L��&���T敭}6��{�(pq�א|C�> �G�τ4��1������7q�7*L����@�[�|Ee���~!�,�5d�)�S���0OL���	��7�C�*x>��6���
�݂3�Ŵ����$�� V�*_Ē^��15��)�&t��7�Wzg�>����\\&�e
�����F���ӵw^���Eu[h�{�Ky>f0���%�c�W�>0�����~	�}M��/��m0�g�-2�R�F$����x�^�{o�⇌Y���K��ī48k��'���o�V�ÐI�> �Ar*�ݖ�������ΣUW�տc��{����ҹ+�i�g��	�_i?�*@�����`,x��vzz�z����t�|���|D�>|	�g��_��jW��v�����R=���N
��O���Güʲ�ҋ�.}yo2ʀI���Z5�����[�}�{���Gvw*�Rk�I���T��V�V���i�k�Zm7�z����v>�>м�(H=��O�/�6�w��5��G�����H^	V@����E �v���<q/O~���M^�~�o��U
�)ڴ������G�k�
}�|��H�'�]?����g���՞3�4���.;�.{c"�J�M��G���|q�;�WL�J�t^�RH�D�F��Ԛ��>
��+`�Vv��?f?�qj��j��L�4���w+�/
�6�w�Uu�O��o��4�(-r�����k�Ef�־���K���o��_�����?�m/��#�VI�	A�w��(KK�F�L�����f�h�k��r���|y���/�����'��$>&�B��J��X����?��+��g���ΣK���W>��Ym̨����?�-3���G����O�+�/\��$���6�h0(?y���u�Q��zo�����'N�{��7@������񿈯.^V�Au�k4lt�1���������6߮���p���
>�/�����M����3�,�:kn�ϦGpr~c7�d��_Sx�u������|=h��V�4{;��f����A.�K��QEQ!EPEPEPEPEPEPEPEPEPEPEPEPEPEPEPEPEPEP5����(����QE
(��
(��
�z?���U?ڃ�p��<���?�=�ߊ^'��T�+7�&I�R�~�md����VmŕUr	?н ��T�
�F���յk������f[M2Iy�SS?u����Q>���w�����ܟ�]��Q�x_^��|�G�����H�mf��H��7H���ȭ���s:�����l|n����K�����{=�� ��#p�	��TP}3�{M����^X^��2Hv����Xѯ㺊3�=GC��ߩî����[���>0��2��vn?nO�����n��X��V5������ٿ�W�|}�{���q����	��Y�D��y�ҭ9���]W�^k�@�� zR��?���{͟���+�eE��ܑ�Iemb�w\���
O�%?�{e��UT#�&�8ϯ��_�ZΫ��w�_��ZG�[�4��;*��1��'�uK�}3L�}�^ȱEW����pN��T�S_e�u����)������p�n���տ�߲0�����8x�[�÷&�����C�(�#}&��G�V������0BCK8��>�Oc_ x��
C�'P�]7�V�#��p�-���˴�g�?@sY�P��~��*_7�~w|[����?�����|_�k^Owuo�v�l��!�#P���R�;�q�)�ɭxCE��E���d�h�wC�NGJ�/��~;xg��?g�i�
��é��o��F�m�34^LV�d��b�8=��?�~,�<]���%�#s�=GZ��itk��d�#~�FT�EJ�������f�ӕU��V|���M�oڳ�֝���[hzqqdx�?1��D��{�5��~ֲ}���Y�m[��l~(鲤Æ@]pT��A�t�5�Qi��73�N<�#����x֏�������婅��%�4�Sѥ����?�+��a�~�?�&�wش~�zN��^�H�^�IVGlaȟ?�_�~{<}q�s7��B�_�/��>�>��hn/t�BI!d�b��+,2�r�F��z����/���N�5�;[����l�O]�	4����s������/���ׄ4�#��
B;�.	]ي?�M"�䲡Q��2+�{�/���'��_~x�>%|2�9�-B��^����-��"��&�=�q�� gi���?�O�&'�=^�Ǟ���O�C�o��k:}�s���2����KW�
z����
��{��o���k;Eݷ��b��AVf
3F�d ��0F�d�&-U�h��4�W���O��-�ja�p�r�M-,�$�$����
+�?������W|�'�|i�~_j2�Xxz&��)��2���x�
�
��Ԋ�:�c�mx�L���[�:�(���S6�+�e	�R�Gq޾ʁ����S��n{7ֽ|oӯRS�ڿkvK�}���ھ�hӥʭ����k����n~�?�S�(o����7��NM3�I񙶆�kQy�[�<s�S,Ѯ�n9%Wu~��"�5k�߀�
�x����pxc–����"X��R�0�HC0�O"���N6��Xž��WN-���oKk�~���3��:��l�����ƻ�&��
�?k�&����|Q�1���\�Nh��M�I:�JW|E��
O��?�Q�p�0�Z�g}��[�֒��1��w��v�N2H<���y�-��r�'^V�xng5?&��t�-�5JUn��_����?�E��$׭5�������EXF�=Ι�j���3 �i4��rY���L�?�/�/�oC�o��Ӿ�N)sg�G�I+YX��YX���f�I��9�T�ՠ��kˉ���-$�0DP;�6��nJ��8Y�?~痌ͫ��z���>�e���/
xc�:l���=a��,�#�����*���_��?,_K����iӱy-�8l�f=�aD}�5�W��)O��Wo
�Ŀ�Y<iI��&�|�71jbx�ʧڽk�N��p~����F���qt��|G�~���Z�S޲���V�!�l+�Xjoߨ��.v�2}t��r��/��>���)��B��g8������/�N�K�c���
�䱔��Z}��b7v��jz�G�Sצp)j?�J_�+�Q�|M������c�^4�划0s����+u�"��_[���p&I{I�>������_���¾
6D	���ZZ�g�VIU�{dW�鿷g�]�^O��ߵW�nn��ܧZ�@s��yU_�M}����$���.4�د�S�G�Ӗ���ܙ�>�o���?�MOڵ�����c~���� �=����\�Z��M[՞�8�^�fߢ_�|�ߵ�춰Mu�
#�O�[�y�z�
����+�O��W���[}S���u�؝�h48�u6ܾ�k��{0m�־�ӿ��L6�K����ԃ��sq<ʄ�$���8�=k���/�c��-<�3�3Eo������j� O�bb?9<��g��������K�ӗ��o7�)��s�o�)$�e��C��+�H�\?ؚ�j_�i�Jр9$��һ�ѿ����Z�쫡k<�u�-S�cP�r9�V1�z��������iN�ao��e���Z
�[�ƱD��QP>��kΖy�oYi��i�^	E{��v�=>�+w�M�,���ֱ�O���qĒh>�KTW�>T��c�6l7�^��|^��8~>�Q~-x�M�J��u���@��M���)_�U�_2�5k��oI�m��.�ѓ�*}��+�1G�����''���P���|y��6�u�~�1��-�Nt�j��A��F��4�5lmt���"s��3t�����~�Q^k�n�A	8�T�<k�o�����|�-�o�(����k&a�>g�%w'�bOz�Z(����QE�QEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQE[����(����QE
(��
(��
����h����P[o�Ú�k�I����o���I	}�G$E�\,��XeJ����)J)�2�&������9&WY<M�E�������~��~�W?a�؛�	����/�i��QH�w�m��K�Kca�}E��;��̱��pGftE��~��V���׋d��3]��߷�
��*G�~ң̹�l��8�1�	0�%�`@���f
��n<s��\x��~�	���F�<��q6q�����n?;��c�Vpé�X��d�q��7��e�t7���/�?f�k�׏�Wu��@��������-���XƊI>e���A�+�7`���mO
~�k�xGD����>7�!м'�{��S�A��3����$�!���h�ڃ�Z_��ٻ�f���T|D��N�t�M��
��YT_0)��
�̓
o��$��>?ه�'�������^k��[ҳ[腸�.�r@�d�H��E{:}:�]O.�V^֯^����>(��?��?��#hߴo�3↸5��א�3�n>���6�\�!u�������/��6��n����-~��`+�߃�L��5��Er����F����_��?�Mo���xs�`�U�)$\��I��g="��kq��>���_��
��7��?�=���`�4�{��pV��?Z�**��D�m���C�$ғG����^8���Ѥ��+Ό��I�4{��ܸ�k�Ȯ��$��9�џ�8��=;N���B�QS����5��p���@�v
�F$�W�#ᮧsq�nP�n�wβ��WBT�p:�KY��c��"�v���O��k
*	"��59���▓kǗ��v{�?���Ae>��]�R��#�޿�������������L�����|L��<O�)��[H��&�9��ۺi�#H�l`��h9������	����>�/��6�M�.<3�{�����
�
h唜e�OZ��<���_k-��ż��Т�Cޏ7��w���Z�a��mB��G��k��
o�'Ě�Ѿ����k��E����6{�X�!���lw3�zt�G�����C���ٯ·�0j��i^�C/N_>#��O^���\O����ߒ�~y�*>YQ�]ܢ�[�����s-�]�+T�/m�7K��\W�X�=�ચ���Q��w�`���🁭����҇ z��	}���h��[n<�q�t��p�^w��MJ��/�>��!~!�Quc��"z-��S�C�SZ7�V���,-��-!ؿ����">��|x���|j��h�V��D����NB�wt�5�Y���?�OV�?�J�~ �D�RZ�,�f�������"������E��_�5�_������H���x����g�[�x�㿅|=,@�����
��,��3g�&�F����$W�4����iwFQރ�ˋM1ԓ�7���1���$�k���������������	ꖪ5�K�����9=ϙ�޾�UUP��Tt�y��)�K��E�G���OZ�%7�o�&?�kG�
��&t���?�&r�o� ���A���m�w7�T��$��l<o5� �����@���46��x�>�:����_�5�����I��O��
���t��c��o�&o��ŗ�隗�^�@ӣs���,ێ�<So �a_M�9���!�Ů��e��?�l}\��wZ��DG,�͡g�� }�ߢ�qy��=�����e�4�֯�0V��c��߲���9�cG��G�
l��:.�
��g�zL��H}�ɯw���H���QE(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��(���?���(����QE
(��
(��
�h�Xe�%hE*q�$udu-�8�>�^��	~՟�e?��J�?�uY�M�O�7����KY���n&��y_|�K����'�-���ƿ��6��ᧆ����ئ��'��d���Bd�H
���"�_����߷�§�_����u&��6��
<�:��p�s-��~�%�գ�FI
G����=���sy�f�w��ś�f��Z�݋X+on��h�Rア��TӜ�#�s,F'�%�n���|����_�~��?j�� ����ߵ%���y{Xf�4��?�J�B�\�U�/�k@�Uz$QE
(��>l���d�����C��	�G�g�/���#H.$������#��ex�Uw^�0 �_�����G�������]��z>�.ֱ��7���J��Rdd��C_Յ.z�W<�d��K���z�	~����]C���SX�啺�Mv��=ų���f;ٰ�>�e@^�'�>i1�>�n�����-!��N1�p� �c�utR�5��RR݅QV@QEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQE
n���(����QE
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(������(����QE
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(������(����QE
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(������(����QE
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(������(����QE
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(������(����QE
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(������(����QE
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(������(����QE
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(������(����QE
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(������(����QE
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(������(����QE
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(������(����QE
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(������(����QE
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(������(����QE
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(������(����QE
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(������(����QE
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(������(����QE
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(��
(������(�<���u�L(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(�����@$��woocommerce-blocks/images/block-error.svg000064400000723315151335517640014572 0ustar00<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 217 111"><g fill="none" fill-rule="evenodd"><g fill="#E9F0F5"><path d="M11.191 72.109c-4.723 4.26-.98 7.1 11.228 8.516 20.652-.966 2.092 1.118 5.15 4.868 3.059 3.75 19.504 1.225 25.978 0 6.336-1.199 3.098-4.168 21.772-4.168.513 0 10.998.424 11.424.475 19.884 2.354 13.057 2.585 9.868 3.693-3.19 1.107 6.572 1.578 10.589 1.22 4.017-.36 10.323-2.717 8.296-4.58-2.028-1.862-4.087-2.79-8.296-3.183-2.806-.262-34.81-2.542-96.009-6.841zM125.3 69.519c14.41-3.196 22.06-3.702 22.952-1.519-6.065 2.845-7.727 4.645-4.988 5.4 8.198-1.69 12.933-3.064 14.203-4.12 12.378-3.727 18.454-4.186 18.227-1.378-5.922 2.121-6.596 3.367-2.023 3.737 8.77.388 13.943.095 15.522-.88 8.32-.62 13.548-.405 15.685.646 4.06-1.256 5.142-2.508 3.247-3.753-1.895-1.246-7.75-2.847-17.561-4.802l-11.361-.842-16.314 1.518-36.805-1.361-.784 7.354z"/></g><g fill-rule="nonzero"><g fill="#91CAF2"><path d="M124.24 36.008c.171.06-.26-.266-.352-.421-.203-.388.62-1.192.62-1.192.922-1.249 1.913-2.369 2.957-3.536.48-.523.837-1.93 1.467-1.569.582.334-3.334 4.867-3.733 5.27-.372.38-1.191 1.56-1.161 1.035.126-2.196 4.124-7.726 6.236-8.306.483-.123-.429.927-.753 1.334-.107.12-2.494 2.887-3.012 2.306-.33-.37.525-1.723.66-1.89 1.25-1.731 2.84-3.243 4.517-4.549.682-.537 1.344-1.15 2.024-1.662.34-.255 1.02-1.193.996-.769-.072 1.248-2.928 3.463-3.829 4.313-.423.401-1.034 1.443-1.435 1.02-.518-.581.948-1.248 1.483-1.844 1.443-1.595 2.931-3.087 4.66-4.415.524-.396 1.389-1.072 2.008-1.387.516-.271 1.715-1.53 1.436-1.02-1.252 2.182-5.94 3.566-2.825 1.216 4.502-3.398 8.617-4.414 13.805-5.794 2.976-.806 4.557-3.044 7.961-2.148 1.579.416 3.693.663 5.162 1.248 1.788.704 3.568 2.408 5.49 2.519.324.018-.652.012-.949-.055-.618-.135-1.204-.394-1.74-.65-1.976-.915-4.047-1.485-6.055-2.276-.172-.06-.272-1.794-.173-1.788.325.019.847.95 1.319 1.027 3.044.626 5.046 2.393 7.89 3.884 5.493 2.894 10.047 6.46 14.07 10.974 3.129 3.51 2.122 10.138 3.175 14.055.577 2.161.501 4.786.964 7.192.233 1.19.856 2.979.297 4.424-.203.49-.115 1.145-.485 1.475-.264.235-2.728-.457-3.122-.58-3.05-.951-6.798-.666-9.993-.849-3.32-.19-7.895 1-10.847 2.257-1.489.641-3.877-.072-5.504.36-1.551.412-4.283-.42-5.71-.878-1.426-.457-3.037-.3-4.494-.658-2.294-.608-4.439-1.632-6.887-2.173-4.425-1.006-10.247-.338-14.589.264-1.161.159-2.75.794-3.898.728-1.473-.084-2.963-.295-4.386-.377-.224-.013-2.218.249-2.203 0 .089-1.548 2.858-3.994 3.474-5.561 1.988-4.97 1.56-9.727 6.904-12.525 1.368-.723 4.213-2.288 5.842-1.443 2.481 1.27-1.257 6.639-1.812 7.584-.473.824-1.042 1.568-1.515 2.392-.085.17-1.627 3.037-1.852 3.475-.198.389-.685 1.463-.345 1.207 6.522-4.985 11.93-11.085 19.013-15.386 1.817-1.123 5.159-3.06 7.248-4.117.567-.293 2.143-1.129 1.81-.572-.585 1.043-3.784 3.539-4.071 3.748-4.358 3.506-8.784 6.883-13.35 10.077-.548.394-2.794 2.444-3.694 1.991-.706-.366.511-1.498.95-2.149 1.095-1.64 1.09-1.54 2.11-3.184 2.402-3.894 5.033-7.85 8.323-11.067 1.38-1.373 2.52-2.46 4.064-3.623.367-.28 1.414-1.07 1.262-.603-.336 1.057-2.042 1.986-2.91 2.712-3.659 3.096-5.659 4.784-9.507 7.693a83.475 83.475 0 01-3.003 2.157c-.053.047-1.333.975-1.302.426.035-.599 3.995-4.153 4.63-4.743 5.216-4.934 11.502-9.757 18.309-12.296.946-.346 9.373-3.193 7.59.836-.261.611-.618 1.167-1 1.72-.386.605-.82 1.18-1.277 1.73a78.004 78.004 0 01-4.425 5.105c-.079.07-3.86 3.986-5.105 5.191-3.423 3.36-6.758 6.925-10.347 10.124-.607.541 1.284-1.003 1.866-1.545 1.112-1.038 2.2-2.103 3.334-3.114 4.482-3.925 9.176-7.612 13.961-11.144.654-.488 2.68-2.2 3.993-2.375.581-.092-.489 1.099-.864 1.528-.403.478-.805.93-1.205 1.358-1.304 1.353-3.716 3.668-5.091 4.942-3.964 3.628-7.927 7.232-11.892 10.861-1.824 1.673-1.794 1.6-3.5 3.38-.106.12-.45.425-.297.384 2.146-.303 3.41-2.684 5.045-4.118 5.405-4.748 10.857-9.419 16.707-13.615 1.279-.904 3.782-2.638 5.516-3.615.362-.205 3.74-1.89 2.36.335-.387.63-.844 1.18-1.303 1.754-.538.645-1.1 1.289-1.637 1.91a110.956 110.956 0 01-4.7 5.088c-2.79 2.82-6.476 5.513-8.479 9.004-.278.485 1.006-.518 1.427-.87.868-.726 1.642-1.558 2.463-2.337 3.705-3.469 7.476-6.783 11.672-9.647a35.978 35.978 0 012.856-1.765c.673-.387 2.486-1.435 2.243-.697-.76 2.335-4.04 4.5-5.702 5.983-5.652 5.11-11.414 10.839-17.766 15.057-.572.368.933-.998 1.458-1.419 1.052-.866 2.08-1.759 3.178-2.572 4.188-3.165 8.5-6.299 13.013-9.02 1.166-.684 2.724-1.646 4.13-2.166.513-.196 1.74-.652 1.635-.107-.572 2.972-6.391 7.07-8.19 8.745-1.375 1.274-3.972 2.026-4.08 3.898-.018.324.633-.114.94-.222 1.047-.365 1.101-.437 2.145-1.179 2.555-1.756 4.973-3.746 7.622-5.397.728-.459 1.5-.84 2.275-1.247.258-.135.79-.655.847-.352.291 1.47-3.776 4.717-4.44 5.38-.613.64-1.201 1.283-1.765 1.952-.216.263-.765 1.108-.454.925 1.317-.7 2.215-1.5 3.443-2.406.628-.465 1.232-.956 1.858-1.396.471-.349.918-.724 1.436-1.02 3.81-2.235-1.718 3.758-1.765 4.582-.036.624 1.199-.382 1.694-.73.757-.532 1.928-1.742 3.055-1.301.881.35-.76 2.786-.42 3.381.48.804 2.078-.857 2.36-.54.142.158.124 1.334-.085 1.497-.555.494-1.378-1.306-1.702-1.325"/><path d="M160.47 5.107l.247.04.297.067.296.067.025.001.32.094.32.118.024.002.244.114.244.114.219.113.363.22.288.218.24.189.119.107.073.029.197.061.197.062.196.061.197.061.197.062.197.061.195.086.196.087.17.085.17.085.17.084.171.085.17.085.171.085.317.144.316.168.316.168.291.167.291.167.266.166.266.165.266.166.24.164.484.303.46.277.218.137.217.138.218.138.218.113.17.084.318.144.34.195.339.194.024.027.218.112.293.142.292.142.266.166.266.165.266.166.266.165.266.166.266.165.266.166.266.166.266.165.266.166.266.165.266.166.266.165.266.166.265.165.266.166.266.165.265.19.264.191.265.19.264.19.265.191.265.19.24.19.239.189.24.189.239.189.24.189.239.19.24.188.239.19.24.188.24.19.239.188.238.214.238.214.238.214.238.214.238.214.239.214.238.214.238.214.238.214.238.214.238.214.213.213.214.212.213.213.213.212.213.213.213.213.213.212.212.238.212.237.212.238.211.237.212.238.212.237.212.238.211.237.117.157.14.158.142.159.116.157.116.157.116.157.117.156.116.157.115.182.116.157.116.157.09.18.09.181.09.18.09.18.09.181.089.18.091.156.09.18.09.181.065.18.065.178.064.18.067.153.064.18.065.178.065.18.066.153.065.18.067.153.04.153.066.179.082.305.082.33.08.33.082.33.083.306.057.304.058.304.058.303.058.304.057.304.033.302.033.303.034.277.034.278.034.277.034.277.035.278.034.277.034.278.034.277.045.529.046.503.07.956.025.452.025.427.014.201.013.201.014.201.015.176.014.176.015.177.017.15.016.152.017.151.017.126.018.127.018.126.02.101.018.101.021.077.043.127.06.254.083.305.058.304.057.304.058.304.058.304.033.302.034.277.034.278.034.277.034.278.036.252.035.253.036.252.048.479.071.93.051.429.013.2.014.202.013.201.015.176.015.176.015.177.015.176.017.15.016.152.016.151-.001.025-.003.05.04.178.121.508.083.305.04.177.038.203.038.202.039.203.037.227.037.228.036.252.035.253.034.277.035.278.007.3.008.302.008.3-.01.175-.01.175-.01.175-.01.174-.01.175-.01.175-.01.174-.035.174-.037.198-.036.198-.037.198-.036.199-.061.197-.062.196-.061.197-.034.148-.037.224-.04.248-.036.198-.062.197-.06.197-.064.221-.089.246-.116.269-.115.268-.142.293-.168.316-.194.314-.218.313-.243.312-.293.308-.185.165-.264.235-.263.21h-.025l-.234.161-.235.162-.258.135-.025-.001-.335.156-.334.156-.257.11-.484.148-.405.077-.354.055-.302.032-.301.008-.376.004-.35-.02-.299-.018-.248-.039-.223-.038-.223-.038-.199-.036-.198-.036-.198-.037-.198-.036-.347-.07-.346-.07-.322-.069-.297-.067-.271-.065-.247-.065-.222-.062-.197-.062-.123-.032-.098-.03-.074-.03-.073-.03-.074-.028-.073-.03-.074-.029-.073-.03-.099-.03-.098-.03-.1-.006-.1-.006-.1-.006-.1-.005-.1-.006-.099-.006-.1-.006-.1-.005-.1-.006-.124-.007-.1-.006-.25-.014-.25-.015-.249-.014-.274-.016-.275-.015-.275-.016-.274-.016-.3-.017-.3-.017-.299-.018-.625-.01-.625-.011-.65-.012-.325-.02-.35-.02-.35-.02-.349-.02-.349-.02-.324-.018.025.002-.075-.005-.075-.004-.1-.006-.1-.006-.1-.005-.1-.006-.1-.006-.1-.005-.1-.006-.125.018-.127.017-.126.018-.126.018-.126.018-.126.018-.127.017-.126.018-.126.018-.126.018-.127.018-.126.017-.126.018-.151.017-.151.016-.152.016-.15.017-.152.016-.153.041-.152.042-.153.041-.127.043-.304.057-.305.083-.306.083-.28.084-.28.084-.28.084-.28.084-.281.084-.28.084-.256.086-.255.085-.255.086-.23.087-.231.087-.205.088-.257.11-.18.065-.23.087-.23.087-.229.062-.204.064-.229.062-.202.038-.203.039-.202.038-.203.039-.177.04-.177.014-.176.015-.176.015-.176.015-.176.015-.301.008-.301.008-.276.009-.276.01-.25-.015-.25-.015-.224-.012-.2-.012-.374-.021-.324-.019-.125-.007-.125-.007-.1-.006-.075-.004-.075-.005-.025-.001-.228.062-.228.037-.227.037-.228.037-.202.038-.202.014-.2.013-.202.014-.2.013-.177.015-.176.015-.175-.01-.175-.01-.174-.01-.175-.01-.175-.01-.174-.01-.3-.017-.323-.044-.298-.042-.298-.042-.298-.042-.273-.04-.272-.066-.272-.066-.271-.066-.247-.064-.247-.064-.247-.064-.246-.065-.222-.063-.222-.062-.418-.124-.394-.123-.345-.095-.27-.09-.025-.002-.025-.002-.025-.001-.025-.002-.05-.002-.05-.003-.05-.003-.075-.004-.075-.005-.075-.004-.074-.004-.225-.013-.25-.015-.3-.017-.324-.018-.348-.045-.2-.012-.199-.011-.198-.037-.223-.037-.224-.038-.248-.04-.248-.039-.248-.04-.272-.065-.247-.064-.296-.067-.272-.066-.272-.066-.27-.09-.27-.09-.245-.09-.246-.09-.245-.088-.467-.152-.467-.152-.86-.3-.391-.148-.393-.148-.171-.06-.197-.06-.172-.06-.172-.06-.172-.06-.172-.06-.172-.06-.173-.036-.173-.035-.148-.033-.149-.034-.148-.033-.123-.032-.124-.032-.148-.034-.148-.034-.149-.033.094 3.397-.148-.033-.15-.009-.175-.01-.174-.01-.175-.01-.175-.01-.174-.01-.175-.01-.175-.01-.175-.01-.174-.01-.2-.011-.2-.012-.2-.011-.199-.012-.2-.011-.2-.012-.199-.011-.2-.012-.2.014-.202.013-.201.014-.201.013-.201.014-.201.013-.201.014-.202.013-.2.014-.428.025-.427.026-.427.026-.427.025-.429.05-.428.051-.43.05-.428.051-.428.05-.429.051-.404.052-.403.052-.404.052-.403.052-.38.054-.024-.002-.025-.001-.05-.003-.051.022-.052.022-.177.04-.203.038-.229.062-.254.061-.305.083-.305.082-.178.04-.177.04-.203.039-.202.038-.203.038-.227.038-.228.037-.252.035-.495-3.395-.277.034-.276.01-.301.007-.301.008-.3-.018-.374-.021-.325-.019-.324-.018-.325-.019-.299-.017-.298-.042-.573-.058-5.618-14.245.06-.172.06-.172.06-.172.06-.172.061-.197.062-.196.061-.197.061-.197.062-.197.124-.418.124-.419.251-.887.127-.468.065-.247.064-.247.064-.247.064-.246.09-.246.09-.27.09-.27.091-.27.091-.27.09-.27.116-.27.116-.269.117-.293.117-.294.142-.292.142-.293.142-.292.142-.293.085-.17.083-.145.084-.146.083-.145.084-.146.083-.145.083-.146.084-.145.108-.144.109-.144.108-.144.109-.144.108-.144.109-.144.108-.144.108-.144.109-.144.108-.144.134-.143.133-.143.133-.142.134-.143.133-.142.134-.143.133-.143.001-.025.002-.024.114-.244.113-.22.112-.218.113-.219.113-.219.113-.219.112-.219.138-.217.138-.218.137-.217.138-.218.138-.217.137-.218.138-.217.06-.172.088-.22.086-.196.086-.195.085-.17.085-.17.085-.171.14-.268.14-.242.138-.218.11-.193.112-.194.111-.194.137-.193.19-.264.163-.216.162-.216.163-.216.163-.217.162-.216.162-.19.16-.192.162-.19.161-.192.186-.19.187-.19.186-.189.186-.19.186-.19.186-.189.186-.19.185-.164.185-.165.185-.164.184-.165.185-.165.185-.165.185-.164.184-.165.185-.165.185-.164.184-.165.184-.14.183-.14.183-.14.159-.14.104-.07.079-.07.08-.07.103-.07.236-.187.238-.211.264-.236.051-.022.054-.072.16-.166.16-.166.185-.165.184-.164.027-.024.083-.145.14-.243.164-.24.218-.314.243-.311.215-.263.213-.214.213-.213.21-.188.21-.163.21-.163.21-.164.21-.163.21-.163.26-.186.261-.185.261-.185.261-.186.261-.185.26-.16.26-.16.26-.161.259-.16.26-.16.26-.161.259-.16.26-.161.258-.136.258-.135.258-.135.258-.136.258-.135.258-.136.259-.135.258-.136.257-.11.256-.11.257-.111.257-.11.257-.111.256-.11.257-.11.257-.111.257-.11.255-.086.255-.086.256-.085.255-.086.255-.085.255-.086.256-.085.255-.086.255-.085.256-.086.484-.148.484-.147.484-.148.485-.147.484-.148.484-.147.483-.123.483-.122.94-.247.941-.246.052-.022.05-.022.052-.022.052-.023.05-.022.052-.022.052-.022.051-.022.051-.022.052-.022.051-.022.076-.02.078-.046.076-.021.18-.09.181-.09.206-.088.438-.225.258-.136.284-.134.283-.134.18-.09.154-.066.18-.065.178-.065.18-.09.18-.064.205-.089.204-.063.204-.064.229-.061.229-.062.229-.062.229-.062.229-.062.254-.061.253-.06.253-.036.252-.036.278-.034.277-.034.278-.034.276-.01.276-.009.3-.007.15.008.025.002.361-.18.36-.155.383-.128.381-.103.38-.079.404-.052.402-.027.4-.002.388-.203zm-40.528 25.496l.026-.024-.026.024z"/></g><path fill="#E2F0FD" d="M153.04 20.892l.348.045.322.068.246.064.222.063.22.088.22.088.22.112.242.14.242.139.241.164.24.189.213.212.212.238.212.237.185.261.159.285.159.284.134.284.109.281.085.256.062.229.04.177.04.178.04.177.015.176.015.177.015.176.015.176.015.176.015.176-.01.175-.01.175-.01.174-.01.175-.01.175-.01.174-.035.174-.035.173-.035.173-.035.174-.035.173-.034.148-.033.149-.059.146-.058.147-.059.147-.058.147-.059.147-.058.147-.059.147-.057.122-.059.147-.057.121-.057.122-.057.122-.083.146-.138.217-.14.243-.137.217-.137.218-.163.216-.163.216-.16.19-.162.192-.161.19-.162.192-.16.166-.16.166-.159.166-.16.167-.16.166-.16.166-.158.14-.158.142-.158.141-.159.141-.158.142-.158.14-.159.142-.158.141-.289.234-.289.234-.289.234-.498.397-.446.35-.183.14-.159.14-.132.118-.052.047-.053.047-.106.094-.13.093-.13.093-.131.092-.13.093-.13.068-.129.068-.13.067-.128.068-.154.066-.153.042-.152.04-.153.042-.153.042-.152.04-.151.017-.152.017-.15.016-.152.016-.151.017-.15-.009-.15-.008-.129.067-.23.087-.206.089-.228.062-.23.062-.228.062-.23.062-.252.035-.252.036-.253.035-.25.011-.252.01-.25-.014-.274-.015-.274-.016-.273-.04-.249-.04-.246-.064-.247-.065-.245-.089-.246-.09-.244-.113-.218-.113-.22-.113-.217-.137-.192-.137-.193-.136-.192-.136-.168-.135-.166-.16-.166-.16-.141-.158-.141-.158-.142-.159-.069-.104-.246-.064-.27-.09-.27-.116-.268-.116-.243-.139-.217-.138-.218-.137-.216-.163-.19-.161-.167-.16-.166-.16-.141-.158-.141-.158-.117-.157-.116-.157-.116-.157-.091-.156-.092-.155-.09-.155-.092-.156-.112-.232-.11-.257-.086-.255-.087-.23-.062-.23-.062-.228-.062-.229-.038-.203-.039-.202-.038-.203-.039-.202-.038-.203-.014-.2-.015-.177-.015-.176-.014-.176-.015-.176-.015-.176-.015-.177-.015-.176-.015-.176.01-.175.01-.174.01-.175-.008-.301.017-.3.018-.299.017-.3.015-.274.041-.273.009-.15.033-.148.034-.149.033-.148.035-.173.037-.198.064-.247.12-.344.086-.195.057-.122.057-.122.058-.122.057-.122.082-.12.001-.025.082-.12.082-.121.082-.12.107-.12.107-.119.107-.12.107-.118.106-.094.105-.094.13-.093.131-.093.13-.092.131-.093.13-.068.129-.068.129-.067.129-.068.129-.068.152-.041.153-.041.153-.042.152-.041.153-.041.153-.042.15-.016.152-.016.151-.017.1.006.078-.046.13-.092.13-.093.13-.068.129-.067.129-.068.13-.068.128-.068.13-.067.152-.042.153-.04.152-.042.153-.042.152-.04.152-.017.15-.017.152-.016.151-.016.151-.017.15.009.15.008.15.01.15.008.15.008.147.034.149.033.148.034.148.033.149.034.147.059.146.058.147.059.147.058.147.059.072.054.08-.07.131-.118.132-.118.157-.116.157-.116.182-.115.182-.115.208-.138.233-.137.258-.136.284-.134.308-.132.331-.106.306-.083.278-.06.303-.032.302-.033.326-.006.325.019.349.02.348.045.347.07.345.095.367.146.34.17.315.193.313.218.024.027.15-.017.252-.01.276-.01.3.018zM132.414 32.103l.05.003.05.003.05.003.05.003.024.001.05.003.05.003.05.003.05.003.05.003.025.001.05.003.05.003.048.028.049.027.048.028.049.028.048.028.049.028.048.028.049.027.048.028.049.028.023.026.024.027.023.026.024.027.023.026.024.026.023.027.024.026.023.027.024.026.023.026.024.027.024.026.022.051.022.052.022.051.022.051.022.052.022.051.022.052.022.05.022.052.022.052-.002.05-.003.05-.003.05-.003.05-.003.05-.003.05-.003.049-.004.075-.007.125-.006.1-.033.148-.034.148-.033.148-.034.149-.034.148-.033.148-.059.147-.058.147-.059.147-.058.147-.059.147-.058.147-.059.147-.058.147-.059.146-.058.147-.059.147-.057.122-.082.12-.082.121-.082.12-.082.121-.082.12-.082.121-.082.12-.082.121-.082.12-.082.121-.107.12-.106.093-.054.072-.053.047-.079.071-.079.07-.08.071-.103.07-.104.068-.105.07-.127.042-.128.043-.076.02-.052.023-.05-.003-.05-.003-.024-.001-.05-.003-.05-.003-.05-.003-.025-.001-.05-.003-.025-.002-.025-.001-.05-.003-.025-.001-.05-.003-.025-.002-.051.022-.103.045-.127.042-.128.043-.153.041-.152.042-.102.019-.05-.003-.05-.003-.05-.003-.05-.002-.05-.003-.05-.003-.049-.003-.05-.003-.05-.003-.05-.003-.05-.002-.05-.003-.098-.031-.123-.032-.099-.03-.098-.032-.099-.03-.097-.056-.072-.054-.072-.054-.072-.055-.072-.054-.07-.079-.12-.107-.092-.13-.093-.13-.092-.131-.068-.13-.066-.154-.067-.154-.04-.152-.042-.153-.017-.151-.016-.151.009-.15.008-.15.009-.15.032-.123.032-.123.032-.124.032-.123.057-.122.056-.097.056-.097.055-.097.056-.097.056-.097.054-.072.054-.072.054-.072.055-.072.054-.072.054-.072.054-.072.054-.072.055-.072.132-.118.131-.117.132-.118.132-.117.13-.093.106-.094.106-.094.106-.094.208-.139.157-.116.13-.093.027-.023.026-.024.026-.023.027-.024.026-.023.027-.024.077-.045.209-.139.13-.092.156-.092.155-.09.18-.09.181-.09.103-.045.102-.044.103-.044.103-.044.103-.044.102-.045.128-.042.153-.042.1-.019.102-.02.126-.017zM124.907 46.848l.05.002.05.003.05.003.025.002.05.002.05.003.05.003.073.03.123.032.099.03.098.03.098.032.147.058.146.084.17.085.17.084.17.11.169.11.193.111.194.112.194.111.194.111.193.137.411.249.387.247.386.248.337.244.313.219.264.19.12.082.096.08.096.081.095.08.072.055.049.028.048.028.049.028.023.026.047.053.047.053.047.052.023.052.022.051.022.051.022.052.022.051.022.051.022.052.022.051.022.051.021.077-.004.075-.005.075-.004.074-.004.075-.004.075-.005.075-.004.075-.004.075-.005.075-.028.048-.029.074-.028.048-.027.049-.028.048-.028.049-.028.048-.03.073-.053.072-.028.049-.027.024-.026.023-.001.025-.027.024-.026.023-.027.024-.026.023-.026.024-.027.023-.025-.001-.051.022-.051.022-.052.022-.077.046-.13.067-.076.021-.051.022-.052.022-.05.022-.077.021-.126.018-.127.018-.075-.005-.05-.003-.05-.002-.05-.003-.024-.002-.05-.003-.05-.002-.05-.003-.1-.006-.148-.034-.124-.032-.123-.032-.098-.03-.099-.031-.098-.03-.147-.06-.122-.057-.097-.055-.025-.002-.201.014-.201.013-.201.014-.226.012-.226.012-.225-.013-.25-.014-.25-.014-.249-.015-.25-.014-.124-.007-.125-.007-.125-.008-.124-.007-.125-.007-.125-.007-.123-.032-.124-.032-.123-.032-.124-.033-.123-.032-.123-.032-.124-.032-.123-.032-.123-.032-.124-.032-.123-.032-.123-.033-.122-.057-.122-.057-.122-.057-.122-.057-.122-.057-.122-.057-.122-.057-.122-.057-.12-.082-.12-.082-.121-.082-.12-.082-.12-.107-.119-.107-.12-.107-.118-.107-.094-.106-.046-.078-.047-.052-.046-.078-.045-.078-.046-.078-.045-.077-.046-.078-.046-.078-.045-.078-.046-.077-.044-.103-.044-.103-.018-.126-.018-.126-.018-.126.008-.125.007-.125.007-.125.032-.123.032-.123.057-.122.03-.074.027-.048.028-.049.028-.048.026-.024.028-.048.028-.049.028-.048.026-.024.028-.048.028-.049.028-.048.026-.024.026-.023.027-.024.026-.023.08-.071.13-.093.104-.069.104-.069.103-.044.103-.044.102-.045.103-.044.101-.019.101-.02.102-.018.076-.021.101-.02.178-.04.176-.014.176-.015.176-.015.176-.015.177-.015.15-.016.15.008.15.009.15.009.1.005.026-.023.052-.022.051-.022.051-.023.025.002.052-.022.051-.022.051-.022.025.001.052-.022.05.003.05.003.076-.021.151-.016z"/><path fill="#68B3E8" d="M143.948 49.292l.4-.002.377-.003.376-.004.174.01.175.01.15.009.15-.016.15.008.152-.016.126-.018.151-.016.982-.094.504-.046.503-.047.529-.045.528-.044.528-.045.529-.045.53-.07.53-.07.53-.07.53-.069.53-.07.252-.035.277-.034.278-.035.252-.035.252-.036.253-.035.252-.036.253-.036.252-.035.254-.06.254-.061.254-.06.254-.061.254-.061.254-.06.253-.061.254-.06.254-.061.23-.062.228-.062.229-.062.229-.062.229-.062.229-.062.229-.062.229-.062.204-.064.204-.063.204-.063.204-.064.203-.063.204-.064.18-.065.178-.064.18-.09.18-.065.18-.09.18-.09.208-.113.206-.113.207-.114.207-.113.207-.113.207-.114.207-.113.208-.138.208-.139.208-.138.209-.138.208-.139.208-.138.208-.138.21-.163.21-.164.21-.163.21-.163.209-.163.21-.164.21-.163.209-.163.21-.163.21-.189.212-.188.211-.188.211-.188.211-.188.211-.189.212-.188.21-.188.212-.188.211-.189.211-.188.449-.4.423-.401.424-.402.424-.4.425-.427.874-.827.874-.826.45-.425.45-.425.45-.425.45-.425.448-.4.238-.211.003-.05.028-.049.028-.048.027-.049.03-.073.029-.073.03-.074.028-.073.03-.074.035-.173.036-.198.036-.199.038-.223.038-.223.102-.47.104-.495.04-.273.066-.272.066-.271.067-.297.067-.297.035-.173.034-.148.033-.148.035-.174.059-.147.06-.171.06-.172.06-.172.06-.172.06-.172.058-.147.058-.147.059-.147.058-.146.057-.122.057-.122.083-.12.082-.121.082-.12.082-.121.082-.12.082-.121.082-.12.082-.121.082-.12.107-.12.107-.119.105-.094.107-.12.106-.093.105-.094.132-.118.21-.163.236-.187.235-.162.235-.162.233-.136.233-.137.232-.112.232-.112.231-.112.23-.087.231-.087.229-.062.229-.062.229-.062.227-.037.228-.037.227-.037.228-.037.226-.012.201-.014.201-.013.201-.014.201-.013.201-.014.2.012.2.011.2.012.174.01.2.011.175.01.174.01.174.035.173.035.173.035.173.035.174.035.173.035.173.035.149.034.148.033.148.034.148.033.149.034.148.033.148.034.27.09.271.091.27.09.269.116.17.085.196.087.17.085.17.085.17.11.144.108.144.108.144.109.119.107.119.107.119.107.119.107.19.186.188.211.188.211.163.21.139.208.138.208.138.209.115.181.115.182.115.182.09.18.09.181.089.18.09.181.065.179.064.179.065.179.065.179.065.179.065.179.065.179.065.179.064.179.065.179.106.332.107.331.082.306.083.305.083.305.082.305.06.28.12.507.124.458.039.202.04.178.041.152.043.128.02.076.023.052.084.28.107.307.108.306.108.307.107.307.083.305.082.305.083.305.083.306.082.305.083.305.083.305.082.306.083.305.083.305.08.33.084.305.08.33.083.306.057.329.056.328.056.33.056.328.057.329.056.329.056.328.056.329.057.329.056.329.056.328.057.33.034.276.022.052.02.076.018.126.04.178.039.202.037.228.035.252.034.278.017.151.016.151.015.176.015.177.015.176.013.2.014.202.013.201-.012.225-.013.224-.015.25-.04.273-.041.273-.036.198-.035.174-.035.173-.06.172-.062.197-.057.121-.03.074v.025l-.002.025-.001.025-.033.123-.033.148-.06.172-.061.197-.063.222-.064.247-.091.27-.059.147-.058.147-.059.147-.06.171-.06.172-.06.172-.084.17-.085.17-.087.196-.086.196-.111.194-.111.194-.112.193-.136.193-.136.192-.135.168-.135.168-.108.144-.109.144-.107.119-.107.119-.107.119-.186.19-.186.19-.16.165-.133.143-.107.119-.053.047-.026.024-.056.096-.084.146-.082.12-.083.146-.138.217-.137.218-.137.192-.136.193-.136.192-.161.191-.16.167-.16.166-.16.166-.16.166-.16.166-.16.166-.184.165-.185.165-.184.164-.185.165-.185.165-.21.163-.208.138-.208.138-.208.139-.209.138-.13.093-.13.067-.128.068-.13.068-.128.068-.13.067-.154.067-.154.066-.154.066-.179.065-.179.065-.204.063-.204.064-.202.038-.279.06-.252.035-.253.035-.252.036-.253.036-.252.035-.253.036-.25.01-.252.011-.25.01-.252.011-.25.011-.227.012-.226.012-.226.012-.226.012-.225-.013-.224-.012-.225-.013-.225-.013-.224-.013-.225-.013-.424-.024-.424-.025-.425-.024-.424-.024-.4-.023-.798-.046-.374-.022-.375-.021-.374-.022-.35-.02-.35-.02-.174-.01-.174-.01-.175-.01-.175-.01-.15-.008-.15-.009-.15-.009-.149-.008-.151.016-.151.017-.151.016-.152.016-.15.017-.152.016-.151.016-.126.018-.127.018-.15.016-.884.125-.909.123-.909.123-.908.123-1.819.272-1.818.271-1.844.27-1.843.27-.935.146-.935.147-.935.147-.96.145-.2.014-.202.013-.201.014-.201.013-.201.014-.201.013-.202.014-.2.013-.2-.011-.2-.012-.2-.011-.2-.012-.199-.011-.2-.012-.2-.011-.199-.012-.2-.011-.2-.012-.174-.01-.173-.035-.174-.035-.173-.035-.173-.035-.173-.034-.174-.035-.173-.035-.347-.07-.346-.07-.347-.07-.321-.069-.322-.068-.32-.094-.32-.093-.32-.094-.296-.092-.295-.092-.295-.092-.295-.092-.27-.09-.542-.157-.493-.154-.516-.154-.172-.06-.197-.062-.196-.086-.17-.085-.17-.085-.17-.085-.146-.083-.146-.084-.12-.082-.146-.083-.217-.138-.025-.001-.075-.005-.15-.008-.148-.034-.148-.033-.174-.035-.173-.035-.173-.035-.172-.06-.172-.06-.172-.06-.195-.086-.17-.085-.08.07-.236.187-.26.16-.258.136-.283.134-.281.109-.28.084-.305.058-.302.032-.151.017-.201.013-.226.012-.226.012-.251.011-.275-.016-.274-.015-.298-.043-.297-.067-.322-.068-.295-.092-.197-.062-.172-.06-.17-.084-.17-.085-.17-.085-.171-.085-.17-.11-.168-.11-.17-.11-.142-.133-.142-.134-.143-.133-.118-.132-.142-.133-.116-.157-.118-.132-.116-.157-.092-.156-.09-.155-.116-.182-.135-.258-.134-.283-.109-.282-.086-.255-.085-.256-.062-.228-.062-.23-.037-.227-.037-.227-.039-.203-.04-.153-.04-.177-.04-.203-.036-.227-.037-.228-.017-.15-.016-.152-.016-.151-.017-.151-.015-.177-.013-.2-.014-.202-.01-.25.015-.275.02-.35.046-.348.067-.296.092-.296.118-.318.085-.17.086-.196.112-.194.001-.025.111-.194.11-.169.002-.025.189-.24.187-.214.134-.143.158-.14.158-.142.184-.14.208-.138.207-.113.025.001.232-.112.231-.112.23-.087.205-.063.305-.083.153-.041.152-.041.153-.042.152-.041.153-.041.151-.017.151-.016.152-.016.15-.017.278-.034.278-.034.277-.034.276-.01.251-.01.251-.01.251-.011.251-.011.251-.01.226-.013.225.013z"/><path fill="#91CAF2" d="M124.344 73.904l.15.009.15.008.15.009.15.008.149.009.125.007.124.007.125.007.125.008.123.032.124.032.123.032.123.032.124.032.123.032.247.065.247.064.246.064.222.063.222.063.222.062.221.063.222.063.197.061.394.123.368.121.172.06.172.06.172.06.172.06.148.034.148.033.025.002.025.001.075.005.075.004.075.004.1.006.1.006.1.005.1.006.124.007.125.007.125.007.124.008.275.015.3-.007.302-.008.175.01.174.01.175.01.175.01.174.01.175.01.2.011.198.037.198.036.198.037.199.036.123.032.098.03.099.032.098.03.099.031.098.03.099.031 5.216.3.05.003.1.005.1.006.098.03.123.033.124.032.122.057.122.057.121.057.12.082.121.082.096.08.096.081.094.106.094.106.094.105.069.104.07.104.067.13.043.127.042.128.043.127.043.128.018.126.017.127.018.126-.007.125-.007.124-.009.15-.033.148-.032.124-.032.123-.057.122-.058.122-.057.122-.082.12-.082.121-.08.096-.106.094-.105.094-.106.094-.104.069-.13.068-.128.067-.13.068-.127.043-.128.043-.127.042-.127.018-.1.02-.177.014-.126.018-.127.018-.1.02-.05-.004-.102.02-.151.016-.151.016-.152.017-.126.017-.125-.007-.124-.007-.125-.007-.225-.013-.224-.013-.2-.011-.175-.01-.499-.029-.25-.014-.25-.015-.249-.014-.274-.016-.275-.015-.273-.041-.15-.009-.15-.008-.15-.009-.148-.033-.148-.034-.148-.034-.148-.033-.149-.034-.148-.033-.148-.034-.099-.03-9.909-.569-.15-.009-.15-.008-.122-.032-.124-.032-.122-.057-.122-.058-.122-.057-.12-.082-.12-.082-.121-.082-.096-.08-.094-.106-.094-.105-.094-.106-.047-.053-.026.024-.154.066-.333.131-.335.156-.36.155-.18.09-.205.088-.204.064-.204.063-.204.063-.204.064-.204.063-.128.043-.101.02-.101.018-.127.018-.126.018-.126.018-.126.018-.126.017-.127.018-.126.018-.126.018-.126.018-.127.017-.126.018-.125-.007-.124-.007-.125-.007-.15-.009-.15-.008-.1-.006-.123-.032-.123-.032-.124-.033-.122-.057-.121-.057-.122-.057-.122-.057-.096-.08-.095-.081-.096-.08-.095-.081-.095-.106-.069-.104-.069-.104-.069-.104-.07-.104-.068-.105-.043-.127-.043-.128-.043-.127-.017-.127-.018-.126-.018-.126.007-.125.007-.125.007-.125.034-.148.032-.123.032-.124.032-.123.057-.122.058-.122.055-.097.056-.097.08-.095.081-.096.08-.095.081-.096.106-.094.104-.07.104-.068.104-.07.025.002.103-.044.103-.044.102-.045.052-.022.03-.098.056-.097.057-.122.082-.12.108-.145.135-.167.08-.096.08-.07.08-.07.105-.095.157-.116.13-.093.13-.092.155-.067.179-.065.179-.064.177-.04.178-.04.201-.014.2.012.2.011.173.035.148.034.098.03.124.033.122.057.122.057.122.057.12.082.12.082.048.053.127-.043.18-.065.203-.063.204-.064.204-.063.204-.064.204-.063.128-.043.101-.02.101-.018.127-.018.152-.041.151-.017.152-.016.15-.017.152-.016.151-.016.151-.017.152-.016.15-.016.15.008.046.078zm-5.422 4.597l.05.003-.099-.03.049.027z"/><path fill="#0775C4" d="M130.682 74.032l.1.006.1.006.1.005.1.006.1.006.1.006.1.005.1.006.099.006.098.03.099.031.098.03.074.03.098.03.172.06.172.06.172.06.146.06.147.058.147.058.147.059.147.058.147.059.267.14.268.14.268.116.122.057.122.057.122.058.122.057.049.027.048.028.049.028.048.028.049.028.05.003.05.002.05.003.074.005.075.004.075.004.075.004.075.005.075.004.15.009.15.008.149.009.15.008.15.01.15.008.174.01.326-.007.35-.005.351-.004.175.01.175.01.175.01.174.01.175.01.175.01.174.01.175.01.1.005.1.006.1.006.1.006.1.005.098.031.098.03.074.03.05.003.05.003.05.003.074.004.075.004.075.004.075.005.075.004.174.01.2.012.2.011.1.006.1.005.1.006.1.006.099.006.1.005.1.006.123.032.123.032.124.032.098.031.074.03.048.027.049.028.048.028.049.028.048.028.048.027.049.028.048.028.048.053.047.053.047.052.047.053.047.053.07.08.07.078.047.078.044.103.044.102.02.102.018.1.02.102.019.101-.006.1-.006.1-.004.075-.004.075-.005.075-.004.075-.03.073-.028.074-.03.073-.029.073-.03.074-.028.073-.03.074-.029.073-.03.074-.028.073-.03.074-.029.073-.03.073-.081.12-.084.146-.082.12-.082.121-.082.12-.082.121-.107.12-.107.118-.105.095-.106.094-.105.094-.106.094-.08.095-.105.07-.104.069-.104.069-.053.047-.051.022-.052.022-.05.022-.155.067-.154.066-.154.066-.153.041-.152.042-.153.041-.152.041-.153.042-.153.041-.152.041-.152.017-.15.016-.152.016-.151.017-.151.016-.151.017-.152.016-.15.016-.15-.008-.15-.009-.15-.008-.15-.01-.15-.008-.15-.008-.15-.009-.149-.008-.15-.009-.15-.009-.148-.033-.148-.034-.148-.033-.149-.034-.148-.033-.148-.034-.149-.033-.148-.034-.148-.034-.149-.033-.271-.066-.272-.065-.27-.091-.27-.09-.27-.091-.271-.091-.27-.09-.516-.18-.515-.18-.246-.09-.245-.089-.05-.003-.05-.002-.05-.003-.05-.003-.05-.003-.05-.003-.05-.003-.05-.003-.05-.002-.05-.003-.099-.006-.1-.006-.1-.006-.124-.007-.125-.007-.126.018-.127.018-.126.018-.126.017-.126.018-.127.018-.126.018-.126.018-.126.017-.126.018-.127.018-.126.018-.254.06-.254.06-.254.061-.457.124-.102.02-.1.019-.102.02-.101.018-.102.02-.101.019-.101.019-.102.02-.1.018-.1-.005-.1-.006-.1-.006-.1-.005-.1-.006-.1-.006-.1-.006-.224-.013-.225-.012-.225-.013-.224-.013-.225-.013-.224-.013-.224-.038-.223-.038-.448-.05-.448-.051-.223-.038-.224-.013-.2-.011-.2-.012-.2-.011-.199-.012-.2-.011-.1-.006-.1-.006-.1-.005-.099-.006-.075-.004-.075-.005-.075-.004-.075-.004-.074-.005-.077.021-.101.02-.126.017-.151.017-.177.014-.176.015-.2.014-.202.013-.226.012-.226.013-.225-.013-.25-.015-.249-.014-.25-.014-.249-.015-.25-.014-.25-.014-.249-.015-.25-.014-.249-.014-.25-.015-.248-.039-.223-.038-.125-.007-.125-.007-.123-.032-.098-.03-.099-.032-.098-.03-.098-.03-.099-.032-.098-.03-.099-.03-.098-.032-.098-.03-.099-.031-.098-.03-.099-.031-.097-.056-.097-.056-.097-.055-.072-.055-.047-.052-.047-.053-.047-.053-.045-.078-.046-.077-.02-.077-.021-.076-.021-.076-.02-.077-.021-.076.004-.075.003-.05.003-.05.004-.074.006-.1.03-.099.031-.098.03-.099.03-.073.03-.073.029-.074.029-.073.029-.074.03-.073.029-.074.029-.073.082-.12.082-.121.082-.12.111-.195.03-.073.027-.048.056-.097.056-.097.08-.096.08-.095.081-.096.081-.096.08-.095.081-.096.08-.07.079-.07.079-.071.079-.071.08-.07.078-.071.08-.07.079-.071.079-.07.079-.071.078-.046.077-.046.103-.044.103-.044.078-.046.102-.044.103-.044.103-.044.18-.09.18-.065.178-.065.18-.065.178-.064.333-.132.154-.066.154-.066.154-.066.154-.067.154-.066.077-.02.051-.023.051-.022.052-.022.051-.022.052-.022.05-.022.052-.022.052-.022.05-.023.054-.047.051-.022.053-.047.053-.047.077-.045.078-.046.078-.046.076-.02.076-.021.1.006.1.005.1.006.073.03.074.029.048.028h.025l.102-.018.1-.02.102-.019.103-.044.229-.062.23-.087.229-.062.128-.043.127-.042.128-.043.128-.043.126-.018.126-.017.126-.018.127-.018.074.004.075.005.075.004.075.004.075.004.075.005.075.004.075.004.074.005.075.004.074.03.073.028.124.033.123.032.22.087.22.088.196.086.195.087.196.086.17.085.17.085.293.142.269.116.122.057.122.057.122.057.123.032.123.032.049.028.048.028.049.027.05.003.05.003.05.003.05.003.05.003.05.003.074.004.075.004.075.005.075.004.075.004.074.004.075.005.075.004.075.004.075.005.075.004.1.006.1-.02.102-.019.101-.019.102-.02.101-.019.101-.019.127-.018.126-.017.126-.018.101-.02.102-.019.1-.019.102-.02.101-.018.102-.02.1-.019.1.006.1.006.1.005.1.006.402-.027zm.934 4.236l.15.008.075.004.075.005.075.004.075.004.074.005.075.004.074.03.073.028.074.03.073.029.27.09.27.091.516.18.516.18.27.09.245.09.246.089.245.09.247.063.246.065.247.064.123.032.124.032.123.032.123.032.124.032.123.033.124.032.123.032.123.032.125.007.125.007.125.007.124.008.125.007.125.007.125.007.125.007.124.007.125.008.125.007.125.007.126-.018.126-.018.126-.018.127-.017.126-.018.126-.018.126-.018.127-.018.126-.017.126-.018.126-.018.128-.043.128-.042.127-.043.128-.043.128-.043.102-.044.027-.023.051-.023.053-.047.053-.047.054-.072.079-.07.08-.07.078-.071.08-.096.082-.095.08-.096.08-.096.081-.095.056-.097.056-.097.055-.097.028-.048.028-.049.028-.048.028-.049.027-.048.028-.049.028-.048.028-.049.028-.048.001-.025.002-.025.001-.025.001-.025.002-.025.001-.025.002-.025-.025-.002-.025-.001-.025-.001-.025-.002-.025-.001-.025-.002-.025-.001-.048-.028-.05-.003-.05-.003-.075-.004-.075-.004-.075-.005-.075-.004-.075-.004-.075-.004-.1-.006-.1-.006-.199-.011-.2-.012-.2-.011-.1-.006-.099-.006-.1-.005-.1-.006-.1-.006-.1-.006-.098-.03-.098-.031-.074-.03-.05-.002-.074-.004-.075-.005-.075-.004-.075-.004-.075-.005-.075-.004-.15-.009-.15-.008-.149-.009-.15-.008-.15-.009-.15-.008-.174-.01-.175-.01-.35.004-.351.005-.351.005-.175-.01-.175-.01-.174-.01-.175-.01-.175-.01-.174-.01-.175-.01-.1-.006-.1-.005-.1-.006-.1-.006-.1-.006-.1-.005-.098-.031-.098-.03-.098-.031-.099-.031-.098-.03-.099-.031-.098-.031-.098-.03-.147-.06-.147-.058-.147-.058-.147-.059-.267-.14-.268-.141-.269-.116-.122-.057-.121-.057-.122-.057-.122-.057-.122-.057-.122-.057-.122-.057-.123-.032-.124-.032-.073-.03-.074-.029-.073-.03-.075-.003-.075-.005-.075-.004-.075-.004-.075-.005-.074-.004-.075-.004-.075-.004-.075-.005-.075-.004-.075-.004-.075-.005-.075-.004-.074-.004-.075-.005-.075-.004-.075-.004-.075-.004-.075-.005-.076.02-.076.022-.077.02-.076.02-.126.019-.127.018-.126.017-.126.018-.126.018-.126.018-.127.018-.126.017-.126.018-.101.02-.1-.006-.1-.006-.1-.006-.1-.006-.1-.005-.1-.006-.074-.004-.1-.006-.1-.006-.1-.006-.1-.005-.1-.006-.1-.006-.1-.005-.073-.03-.073-.029-.073-.03-.074-.028-.073-.03-.074-.029-.147-.058-.147-.059-.146-.058-.147-.059-.147-.059-.293-.141-.292-.142-.147-.059-.172-.06-.172-.06-.171-.06-.172-.06-.197-.061-.197-.062-.098-.03-.099-.03-.025-.002-.025-.002-.025-.001-.024-.002-.025-.001-.025-.001-.025-.002-.025-.001-.025-.002-.025-.001-.077.02-.076.021-.076.02-.076.021-.102.02-.101.019-.101.02-.103.043-.229.062-.229.062-.23.087-.128.043-.127.043-.128.043-.128.042-.127.043-.127.018-.126.018-.126.017-.126.018-.075-.004-.075-.004-.025-.002-.051.022-.078.046-.078.046-.078.045-.077.046-.078.045-.078.046-.078.046-.179.065-.179.064-.179.065-.179.065-.179.065-.333.131-.154.066-.154.067-.154.066-.154.066-.154.066-.078.046-.077.046-.078.045-.078.046-.078.046-.077.045-.078.046-.053.047-.053.047-.053.047-.052.047-.053.047-.053.047-.053.047-.052.047-.053.047-.053.047-.053.047-.053.047-.052.048-.053.047-.054.072-.055.072-.054.072-.054.072-.054.072-.054.072-.055.072-.11.194-.057.097-.055.097-.056.097-.028.048-.027.049-.028.048.073.03.074.029.073.029.073.029.074.03.075.004.1.005.1.006.1.006.1.005.222.038.224.038.224.013.225.013.25.014.249.015.25.014.25.014.249.015.25.014.224.013.225.013.224.013.225.012.2-.013.202-.014.176-.015.176-.014.152-.017.126-.018.101-.019.101-.02.102-.018.1-.02.102-.019.1.006.1.006.1.005.1.006.1.006.1.006.099.005.225.013.224.013.225.013.224.013.225.013.225.013.223.038.448.05.448.051.223.038.223.038.225.013.2.011.199.011.2.012.2.011.199.012.1.006.1.005.1.006.1.006.074.004.075.004.075.005.075.004.075.004.076-.02.076-.021.077-.02.076-.021.076-.021.077-.02.076-.021.458-.124.254-.06.253-.061.28-.06.152-.04.153-.042.152-.042.151-.016.152-.016.15-.017.152-.016.151-.016.151-.017.151-.016.152-.017.15-.016.152-.016.15.008.15.009.087-.22z"/><path fill="#91CAF2" d="M164.141 71.605l.125.007.125.007.15.009.1.006.074.004.075.004.05.003.05.003.05.003.048.028.049.027.048.028.049.028.048.028.049.028.048.027.024.027.023.026.022.052.022.051.023.051.022.052.022.051.022.051-.003.05-.003.05-.003.05-.003.05-.002.05-.003.05-.003.05-.028.048-.028.049-.028.048-.028.049-.027.048-.027.024-.026.023-.028.049-.026.023-.027.024-.026.023-.025-.001-.026.023-.027.024-.051.022-.078.046-.076.02-.077.021-.076.02-.101.02-.101.02-.102.018-.1.02-.205.063-.227.037-.203.039-.001.024.022.052-.003.05-.003.05-.003.05-.003.05-.003.05-.002.05-.003.05-.003.05-.003.05-.028.048-.028.048-.028.049-.027.048-.028.049-.028.048-.026.024-.027.023-.026.024-.052.022-.05.022-.052.022-.077.02-.05.023-.077.02-.101.02-.102.019-.101.019-.126.018-.126.018-.152.016-.15.016-.177.015-.176.015-.028.049-.028.048-.028.049-.027.048-.028.049-.028.048-.026.024-.052.022-.053.047-.052.047-.027.023-.026.024-.027.023-.026.024-.026.023-.025-.001-.027.024-.051.022-.025-.002-.025-.001-.025-.002-.025-.001-.05-.003-.05-.003-.025-.001-.025-.002-.05-.003-.024-.001-.025-.001-.025-.002-.025-.001-.025-.002-.025-.001-.025-.002-.025-.001-.025-.001-.049-.028-.073-.03-.074-.029-.073-.029-.072-.054-.047-.053-.047-.053-.047-.053-.047-.052-.047-.053-.025-.002-.201.014-.201.013-.2-.011-.175-.01-.174-.01-.175-.01-.15-.009-.15-.008-.125-.007-.124-.008-.075-.004-.075-.004-.074-.03-.048-.027-.05-.003-.048-.028-.025-.001-.049-.028-.023-.027-.024-.026-.025-.001-.048-.028-.204.063-.23.062-.227.037-.126.018-.101.02-.101.018-.102.02-.101.019-.101.02-.102.018-.1.02-.102.019-.1-.006-.1-.006-.1-.005-.1-.006-.1-.006-.1-.006-.099-.005-.1-.006-.1-.006-.098-.03-.098-.031-.099-.03-.098-.031-.097-.056-.074-.03-.048-.027-.049-.028-.048-.028-.049-.028-.023-.026-.024-.026-.022-.052-.022-.051-.023-.027-.022-.05-.023-.052-.022-.052-.022-.051.003-.05.002-.025.002-.05.003-.05.002-.025.003-.05.002-.05.003-.05.005-.074.004-.075.03-.074.03-.098.03-.098.056-.097.054-.072.055-.072.054-.072.054-.072.054-.072.054-.072.055-.072.054-.072.108-.144.109-.145.108-.144.107-.119.107-.119.053-.047.053-.047.053-.047.052-.047.052-.022.026-.024.026-.023.025.001.027-.023.026-.024.052-.022.076-.02.076-.021.076-.02.077-.021.076-.021.076-.02.077-.021.076-.021.076-.02.077-.021.076-.021.101-.02.027-.023.129-.068.129-.067.129-.068.129-.068.128-.042.102-.045.103-.044.103-.044.102-.044.103-.044.103-.045.102-.044.077-.02.076-.021.076-.02.077-.021.076-.021.076-.02.077-.021.076-.021.076-.02.077-.021.076-.021.075.004.075.005.075.004.15.008.149.009.15.009.15.008.15.009.124.007.123.032.124.032.123.032.124.032.123.033.123.032.124.032.123.032.123.032.124.032.123.032.22.088.22.088.221.088.22.087 1.178.419.226-.013.276-.009.25.015z"/><path fill="#0775C4" d="M159.7 70.023l.224.013.225.013.224.013.225.012.225.013.224.013.225.013.225.013.224.013.225.013.224.013.225.013.225.012.2.012.198.036.198.037.198.036.198.037.199.036.173.035.173.035.173.035.174.035.173.035.148.033.149.034.148.034.148.033.122.057.122.057.074.03.073.029.073.029.049.028.048.028.049.027.048.028.049.028.047.053.047.053.047.052.047.053.047.053.047.053.047.053.022.05.022.052.022.052.023.051.022.051.022.052.022.051-.003.05-.004.075-.003.05-.004.075-.005.075-.001.024-.002.025-.004.075-.03.099-.031.098-.031.099-.054.072-.054.072-.055.072-.054.072-.054.072-.054.072-.054.072-.055.072-.054.072-.054.072-.054.072-.08.07-.079.07-.079.071-.078.046-.079.07-.157.117-.157.116-.156.116-.156.091-.155.092-.156.09-.155.092-.156.091-.155.092-.13.067-.129.068-.129.068-.129.068-.102.044-.103.044-.103.044-.103.044-.076.02-.051.023-.303.033-.277.034-.279.06-.279.058-.279.06-.278.058-.558.119-.558.118-.279.06-.278.058-.28.06-.277.033-.277.035-.151.016-.151.016-.152.017-.15.016-.152.016-.151.017-.151.016-.152.017-.15.016-.152.016-.151.017-.15-.009-.15-.009-.15-.008-.15-.009-.149-.008-.15-.009-.15-.008-.15-.01-.149-.008-.15-.008-.148-.034-.148-.033-.149-.034-.148-.033-.148-.034-.174-.035-.173-.035-.173-.035-.172-.06-.172-.06-.172-.06-.172-.06-.146-.058-.025-.002-.025-.001-.025-.002-.05-.002-.05-.003-.05-.003-.05-.003-.05-.003-.075-.004-.075-.004-.15-.009-.15-.009-.174-.01-.1-.005-.1-.006-.1-.006-.1-.006-.099-.005-.1-.006-.098-.03-.099-.031-.098-.031-.074-.03-.048-.027-.049-.028-.048-.028-.048-.028-.049-.027-.048-.028-.049-.028-.048-.028-.047-.053-.048-.053-.047-.052-.047-.053-.047-.053-.047-.053-.047-.052-.045-.078-.046-.078-.046-.078-.022-.051.002-.025.001-.025.002-.025.001-.025.001-.025.002-.025.001-.025.002-.025.001-.025.002-.025.001-.025.001-.024.002-.025.001-.025.003-.05.03-.074.029-.073.029-.074.03-.073.027-.049.028-.048.028-.049.027-.048.053-.047.08-.07.079-.071.079-.07.078-.046.077-.046.078-.046.078-.045.077-.046.078-.046.078-.045.076-.02.077-.022.127-.042.103-.044.101-.02.077-.02.05-.022.178-.04.178-.04.178-.04.177-.04.203-.038.202-.039.38-.078.356-.08.328-.056.102-.02-.049-.027-.047-.053-.022-.052-.022-.05-.022-.052-.022-.052-.022-.05.004-.076.004-.075.004-.075.005-.074.004-.075.028-.049.028-.048.027-.049.028-.048.028-.049.053-.047.053-.047.052-.047.053-.047.053-.047.053-.047.078-.046.077-.045.078-.046.076-.02.077-.021.076-.02.076-.022.077-.02.076-.02.076-.022.077-.02.076-.02.152-.042.153-.042.178-.04.177-.04.178-.04.177-.04.201-.013.202-.013.2-.014.202-.013.2-.014.202-.013.201-.014.226-.012.226-.012.226-.012.226-.012.226-.012.226-.012.107-.12zm-.436 1.477l-.201.014-.201.013-.201.014-.201.013-.201.014-.202.013-.2.014-.177.015-.176.015-.176.015-.176.015-.176.015-.152.016-.15.016-.152.017-.126.017-.126.018-.128.043-.051.022-.052.022-.051.022-.051.022-.052.022-.051.023-.027.023-.026.024-.026.023-.027.024-.026.023-.026.024-.025-.002-.025-.001-.027.023-.051.022.023.027.047.053.048.052.047.053.022.052.022.05.022.052.022.052.02.076-.004.075-.004.075-.004.075-.005.074-.004.075-.028.049-.028.048-.027.049-.028.048-.028.049-.053.047-.053.047-.052.047-.052.022-.051.022-.051.022-.052.022-.101.02-.126.017-.126.018-.153.041-.329.057-.355.08-.38.078-.178.04-.177.04-.077.02.025.002.1.005.1.006.1.006.098.03.099.031.098.031.049.028.048.028.147.058.122.057.122.057.123.032.124.033.123.032.123.032.124.032.123.032.123.032.124.032.123.032.125.008.125.007.124.007.125.007.125.007.125.007.125.007.124.008.125.007.125.007.125.007.125.007.126-.018.126-.017.126-.018.127-.018.126-.018.126-.018.126-.017.126-.018.127-.018.126-.018.277-.034.278-.034.277-.034.279-.06.279-.058.558-.119.557-.118.28-.06.278-.058.279-.06.279-.058.303-.058.253-.036.051-.022.077-.02.077-.046.103-.044.103-.044.104-.07.129-.067.129-.068.13-.068.128-.068.13-.092.131-.093.13-.093.131-.092.13-.093.131-.093.053-.047.053-.047.053-.047.052-.047.053-.047.053-.047.053-.047.028-.048.001-.025-.098-.031-.099-.03-.123-.033-.124-.032-.123-.032-.148-.034-.149-.033-.148-.034-.173-.035-.173-.035-.174-.035-.173-.035-.173-.035-.198-.036-.2-.012-.2-.011-.2-.011-.2-.012-.199-.011-.2-.012-.2-.011-.224-.013-.224-.013-.225-.013-.225-.013-.224-.013-.225-.013-.225-.013-.224-.012-.225-.013.097.055zM182.053 55.47l.05.004.025.001.025.001.025.002.05.003.025.001.025.002.025.001.023.026.049.028.023.027.024.026.023.026.024.027.023.026.024.027.024.026.023.026.024.027.023.026.024.027.023.026.024.026.023.027.024.026.023.027.024.026-.002.025.024.026-.002.025.024.027-.001.025-.002.025-.001.025-.002.024-.001.025-.002.025-.026.024-.001.025-.027.023-.026.024-.002.025-.026.023-.026.024-.027.023-.026.024-.027.024-.026.023-.026.024-.027.023-.026.024-.027.023-.026.024-.026.023-.027.024-.026.023-.026.024-.027.023-.103.045-.102.044-.103.044-.103.044-.102.044-.103.044-.103.045-.101.019-.101.02-.102.018-.1.02-.102.019-.101.019-.102.02-.1.019-.102.019-.101.019-.102.02-.1-.007-.1-.005-.1-.006-.1-.006-.099-.005-.1-.006-.2-.012-.2-.011-.224-.013-.25-.014-.05-.003-.074-.004-.05-.003-.05-.003-.098-.03-.099-.032-.098-.03-.099-.03-.171-.06-.049-.029-.048-.028-.025-.001-.025-.001-.025-.002-.025-.001-.05-.003-.025-.002-.025-.001-.05-.003-.025-.001-.025-.002-.05-.003-.025-.001-.025-.001-.025-.002-.023-.026-.024-.027-.023-.026-.024-.026-.023-.027-.024-.026-.023-.027-.024-.026-.023-.026-.024-.027-.023-.026-.024-.027-.024-.026-.023-.026-.024-.027-.023-.026-.024-.027-.023-.026.001-.025-.023-.026.001-.025-.023-.027.001-.025.002-.025.001-.024.001-.025.002-.025.001-.025.002-.025.026-.024.002-.025.026-.023.026-.024.027-.023.026-.024.026-.023.027-.024.026-.023.027-.024.026-.024.026-.023.027-.024.026-.023.027-.024.025.002.026-.024.026-.023.027-.024.026-.023.026-.024.025.002.027-.024.025.001.025.002.025.001.025.002.025.001.025.002.05.003h.024l.025.002.025.002.025.001.05.003.1.006.05.003.075.004.05.003.05.003.098.03.099.031.098.03.172.06.073.03.074.03.048.027.05.003.175.01.224.013.175.01.2.011.075.005.075.004.1.006.074.004.075.004.05.003.075.004.075.005.05.003.051-.023.076-.02.052-.022.076-.021.076-.02.052-.023.076-.02.076-.021.077-.02.076-.021.101-.02.077-.02.102-.044.103-.045.103-.044.026-.023.026-.024.025.002.025.001.05.003.025.001.025.002.05.003.025.001-.025-.001.007-.125zM179.95 51.118l.05.003.024.001.025.002.025.001.025.002.025.001.025.002.025.001.025.001.025.002.025.001.025.002.025.001.025.002.024.001.025.001.024.027.023.026.024.027.024.026.023.026.024.027.023.026.024.027.023.026.024.026.023.027.024.026.023.027.024.026-.002.025.024.026.023.027.024.026-.001.025.023.026.024.027-.002.025-.001.025.023.026-.001.025-.002.025.024.026-.002.025-.001.025-.001.025-.002.025-.001.025-.002.025-.026.024-.002.025v.025l-.027.023-.002.025-.026.024-.002.025-.026.023-.001.025-.027.024-.026.023-.027.024-.001.025-.026.023-.027.024-.026.023-.027.024-.026.023-.026.024-.027.023-.026.024-.027.023-.026.024-.026.023-.027.024-.026.023-.026.024-.025-.001-.025-.002-.025-.001-.025-.002-.025-.001-.025-.002-.025-.001-.025-.001-.025-.002-.025-.001-.026.023-.052.022-.051.022-.078.046-.13.093-.18.09-.183.114-.207.114-.102.044-.103.044-.103.044-.102.044-.103.045-.103.044-.127.042-.103.045-.051.022-.052.022-.076.02-.05-.002-.075-.005-.1-.005-.075-.005-.05-.003-.025-.001-.024-.001-.025-.002-.025-.001-.025-.002-.025-.001-.025-.002-.025-.001-.025-.001-.025-.002-.025-.001-.025-.002-.025-.001-.025-.002-.025-.001-.025-.001-.025-.002-.023-.026-.025-.002-.025-.001-.025-.002-.025-.001-.025-.001-.024-.027-.023-.026-.024-.027-.023-.026-.024-.026-.023-.027-.024-.026-.023-.027-.024-.026-.023-.026-.024-.027-.024-.026.002-.025-.024-.026-.023-.027-.024-.026-.023-.027.001-.025-.023-.026-.024-.026-.023-.027.001-.025-.023-.026.001-.025-.024-.026.002-.025.001-.025-.023-.027.001-.025.002-.025.001-.025.002-.025.001-.025.001-.025.002-.024.026-.024.002-.025.001-.025.002-.025.026-.023.001-.025.027-.024.026-.023.002-.025.026-.024.026-.023.027-.024.001-.025.027-.023.026-.024.026-.024.027-.023.026-.024.027-.023.026-.024.026-.023.027-.024.026-.023.026-.024.027-.023.026-.024.027-.023.025.001.025.002.025.001.024.001.025.002.025.001.025.002.025.001.025.002.025.001.025.001.025.002.025.001.025.002.025.001.025.002.025.001.025.001.025.002.025.001.025.002.025.001.025.002.025.001.025.001.025.002.025.001.024.002.052-.022.076-.021.053-.047.078-.046.102-.044.18-.09.181-.09.18-.09.181-.09.078-.045.103-.044.077-.046.078-.045.103-.044.102-.045.077-.02.076-.02.05.002.025.001.025.002.025.001.025.002z"/><path fill="#0775C4" d="M177.241 55.545l.125.007.125.008.124.007.05.003.05.002.05.003.025.002.049.028.023.026.049.028.048.028.049.027.048.028.024.027.023.026.049.028.023.026.024.027.022.051.022.051.022.052.022.051.022.051.022.052.022.051-.002.05-.003.05.022.051-.028.049-.003.05-.003.05-.028.048-.027.049-.028.048-.028.049-.028.048-.028.049-.028.048-.026.024-.026.023-.027.024-.026.023-.051.022-.027.024-.051.022-.052.022-.05.022-.052.022-.052.022-.05-.003-.05-.003-.05-.002-.05-.003-.124-.007-.1-.006-.1-.006-.1-.006-.1-.005-.124-.007-.1-.006-.1-.006-.101.02-.126.017-.102.02-.1.019-.127.017-.101.02-.102.019-.126.018-.227.037-.203.038-.227.037-.228.037-.227.037-.23.062-.228.062-.23.062-.228.062-.229.062-.458.124-.458.124-.229.062-.229.062-.229.062-.228.062-.23.062-.228.062-.23.062-.252.036-.227.037-.228.037-.05-.003-.05-.003-.05-.003-.05-.003-.05-.003-.05-.003-.05-.002-.049-.003-.049-.028-.048-.028-.048-.028-.024-.026-.048-.028-.049-.028-.024-.026-.023-.027-.049-.027-.023-.027-.022-.051-.022-.051-.022-.052-.022-.051-.023-.052-.022-.05-.022-.052.003-.05-.022-.051.003-.05.003-.05.028-.049.002-.05.028-.048.003-.05.028-.049.028-.048.028-.049.027-.048.028-.049.027-.023.026-.024.026-.023.027-.024.051-.022.027-.023.05-.022.052-.022.052-.023.051-.022.051-.022.05.003.228-.037.227-.037.228-.037.227-.037.228-.037.229-.062.229-.062.229-.062.228-.062.23-.062.482-.123.458-.124.229-.061.229-.062.229-.062.229-.062.229-.062.229-.062.227-.037.253-.036.227-.037.228-.037.126-.018.126-.018.126-.018.126-.017.127-.018.126-.018.126-.018.126-.018.127-.017.124.007.125.007.125.007z"/><path fill="#BCE0FA" d="M161.857 7.685l.125.008.125.007.125.007.125.007.123.032.123.032.124.032.123.033.049.027.048.028.073.03.049.027.048.028.049.028.097.056.097.055.047.053.047.053.048.028.047.052.024.027.025.001.05.003.125.007.124.007.125.008.1.005.125.007.123.033.124.032.098.03.123.032.099.031.098.03.124.033.048.028.049.028.073.029.024.026.072.054.024.002.024.026.024.027.024.001.048.053.047.053.047.052.02.077.021.076.02.076-.005.1-.006.1-.03.074-.028.073-.028.048-.028.049-.028.048-.028.049-.025-.002-.054.072-.025-.001-.051.022-.026.024-.027.023-.053.047-.051.022-.078.046-.076.02-.076.021-.077.021-.076.02-.076.021-.077.02-.152.042-.178.04-.152.041-.152.017-.277.034-.228.037-.126.018-.101.02-.126.017-.126.018-.251.01-.025-.001-.105.069-.13.093-.13.092-.052.022.076-.02.05.003.077-.021.074.004.075.005.1.005.099.031.073.03.097.055.072.054.072.054.046.078.045.078.046.078.02.076.024.026.1.006.276-.01.578-.041.276-.01.301-.007.301-.008.301-.008.126-.017.15.008.15.009.15.008.15.009.149.008.15.01.15.008.024.001.1.006.025.001.074.03.073.029.025.001.074.03.047.052.072.054.047.053.045.078.046.078.02.076.021.076.02.077-.003.075-.006.1-.03.098-.03.073-.03.074-.029.073-.025-.001-.027.048-.053.047-.027.024-.05.022-.027.023-.053.047-.026.024-.052.022-.051.022-.078.046-.103.044-.076.02-.051.023-.333.13-.232.113-.205.088-.103.044-.103.044-.103.045-.102.044-.128.043-.128.042-.127.043-.153.041-.355.08-.101.02-.102.019-.227.037-.228.037-.277.034-.279.06-.279.058-.051.022.024.027.024.001.021.076.024.027.02.076-.001.025.022.051.02.077.021.076-.004.075-.03.073-.028.074-.03.073-.025-.001-.029.073-.03.074-.052.047-.053.047-.053.047-.052.047-.078.046-.076.02-.077.02-.076.022-.025-.002-.08.096-.108.119-.107.119-.107.119-.241.286-.244.312-.243.312-.135.167-.133.143-.133.142-.134.143-.133.143-.134.142-.054.072-.054.072-.054.072-.053.047-.053.047-.053.047-.052.047-.078.046-.053.047-.078.046-.077.045-.103.045-.051.022-.077.02-.025-.001-.051.022-.05-.003-.075-.004-.05-.003-.05-.003-.075-.004-.025-.002-.074-.004-.05-.003-.074-.03h-.025l-.098-.031-.025-.002-.098-.03-.024-.027-.072-.054-.024-.026-.047-.053-.023-.027-.047-.052-.024-.027-.047-.052-.047-.053-.045-.078-.046-.078-.02-.076-.021-.076-.021-.077-.02-.076-.021-.076-.021-.077-.02-.076-.021-.076.002-.05-.186.19-.186.19-.105.093-.08.07-.079.071-.104.07-.08.07-.078.07-.053.048-.053.047-.051.022-.078.046-.025-.002-.051.022-.052.022-.025-.001-.05-.003-.05-.003-.024-.001-.05-.003-.05-.003.1.006-.075-.005-.05-.002-.025-.002-.073-.03-.074-.028-.025-.002-.073-.03-.047-.052-.025-.001-.047-.053-.047-.053-.024-.026-.047-.053-.022-.051-.024-.027-.022-.051-.022-.051.002-.025-.021-.077-.024-.026-.02-.076.003-.05-.021-.077.004-.075.003-.05.002-.024-.106.094-.163.216-.08.095-.08.096-.082.095-.08.096-.106.094-.08.096-.106.094-.053.047-.052.047-.053.047-.053.047-.053.047-.053.047-.05.022-.079.046-.025-.002-.05.022-.077.021-.025-.001-.101.019-.1-.006-.025-.001-.075-.005-.1-.005-.073-.03-.074-.029-.073-.03-.047-.052-.047-.053-.047-.052-.048-.053-.047-.053-.022-.051-.045-.078-.021-.076-.02-.077-.021-.076.001-.025.003-.05-.028.049-.055.097-.081.095-.056.097-.052.047-.028.049-.053.047-.053.047-.053.047-.052.047-.053.047-.053.047-.078.046-.102.044-.052.022-.051.022-.027.023-.076.021-.025-.001-.076.02-.05-.003-.075-.004-.075-.004-.075-.004-.05-.003-.05-.003-.05-.003-.073-.03h-.025l-.073-.03-.025-.001-.049-.028-.048-.028-.049-.028-.047-.053-.025-.001-.047-.053-.022-.051-.025-.002-.022-.051-.022-.051-.02-.077-.026-.001-.022-.051-.022-.052-.023-.026-.022-.052.002-.05-.023-.026.004-.075.005-.075.004-.074.004-.075.03-.074.029-.073.029-.074.03-.073.058-.147.033-.148.06-.172.06-.172.12-.344.146-.367.06-.172.059-.147-.154.067-.23.087-.231.086-.23.087-.23.087-.052.022-.16.167-.107.119-.107.119-.107.119-.132.117-.107.12-.132.117-.132.118-.13.092-.13.093-.131.093-.078.045-.053.047-.053.048-.052.047-.078.045-.053.047-.053.047-.077.046-.078.046-.077.02-.076.02-.076.022-.101.019-.102.019-.101.02-.1-.007-.05-.002-.075-.005-.05-.003-.074-.004-.05-.003-.074-.029-.05-.003-.073-.03h-.025l-.049-.028-.048-.028-.024-.027-.048-.027-.049-.028-.023-.027-.047-.052-.047-.053-.024-.027-.022-.05-.022-.052-.023-.027-.023-.051-.022-.051-.023-.027-.022-.051-.022-.051.001-.025-.02-.077-.024-.026.004-.075.003-.05.004-.075-.05-.003-.1-.005-.098-.031-.123-.032-.049-.028-.048-.028-.049-.028-.048-.027-.049-.028-.048-.028-.049-.028-.026.024-.101.019-.077.02-.1.02-.076-.005-.075-.004-.05-.003-.05-.003-.05-.002-.024-.002-.075-.004-.025-.002-.074-.029-.098-.03-.048-.028-.049-.028-.025-.002-.048-.027-.049-.028-.025-.002-.047-.052-.047-.053-.047-.053-.047-.053-.046-.078-.02-.076-.022-.051-.024-.027-.078.046-.102.044-.128.043-.103.044-.076.02-.051.023-.052.022-.076.02-.076.021-.077.021-.1-.006-.1-.005-.1-.006-.074-.004-.05-.003-.05-.003-.073-.03h-.025l-.099-.032-.025-.001-.048-.028-.049-.028-.048-.027-.049-.028-.047-.053-.047-.053-.047-.053-.047-.052-.022-.052-.047-.053-.022-.05-.02-.077-.026-.002-.022-.051-.022-.051-.022-.052.003-.05.003-.05-.104.07-.209.138-.208.138-.441.275-.442.276-.208.138-.233.137-.209.138-.233.137-.233.137-.233.137-.233.136-.105.07-.129.067-.129.068-.129.068-.129.067-.104.07-.13.067-.127.043-.128.043-.127.043-.128.042-.128.043-.127.043-.128.043-.127.042-.128.043-.128.043-.127.043-.052.022-.05-.003-.05-.003-.05-.003-.025-.001-.074-.005-.1-.005-.05-.003-.049-.028-.048-.028-.025-.001-.074-.03-.047-.052-.072-.055-.047-.052-.047-.053-.045-.078-.022-.051-.072-.054-.046-.078-.046-.078-.02-.076-.024-.027-.02-.076-.021-.076-.024-.027.003-.05-.022-.05.003-.05.006-.1.029-.074.004-.075.03-.073.029-.074.029-.073.03-.074.028-.073.028-.049.028-.048.028-.049.028-.048.053-.047.027-.049.053-.047.053-.047.028-.048.053-.047.104-.07.079-.07.104-.07.103-.043.102-.045.103-.044.078-.045.103-.045.102-.044.18-.065.307-.132.154-.066.052-.023.051-.022.051-.022.052-.022.051-.022.051-.022.13-.068.129-.067.129-.068.129-.068.129-.068.129-.067.283-.134.283-.134.283-.134.284-.134.283-.134.283-.134.283-.134.283-.134.283-.134.565-.243.565-.243.051-.022.052-.023.051-.022.051-.022.025.002.232-.112.232-.112.232-.112.232-.112.231-.112.23-.087.231-.087.23-.087.23-.087.231-.087.23-.087.23-.086.052-.023.052-.022.05-.022.102-.019.1.006.1.005.098.031.099.03.072.055.097.056.047.052.045.078.024.027.53-.07 1.212-.181.581-.092.581-.092.103-.044.103-.044.103-.044.102-.044.103-.045.051-.022.052-.022.051-.022.051-.022.102-.02.05.004.1.005.024.002.075.004.05.003.025.001.05.003.073.03.049.027.026-.023.055-.072.054-.072.054-.072.054-.072.054-.072.053-.047.053-.047.053-.047.077-.046.053-.047.053-.047.053-.047.078-.046.052-.047.078-.046.053-.047.129-.067.154-.067.103-.044.029-.073.03-.074.052-.047.028-.048.053-.047.052-.047.053-.047.078-.046.026-.024.052-.022.1-.019.077-.02.077-.021.076-.02.051-.023.126-.018.127-.018.1-.019.152-.016.176-.015.303-.033.302-.033.126-.017.151-.017.127-.017.052-.048.156-.09.155-.092.13-.093.155-.066.129-.068.233-.137.207-.113.078-.046.078-.045.077-.046.104-.069.13-.068.13-.092.13-.093.131-.093.156-.09.13-.094.078-.045.078-.046.077-.045.078-.046.078-.046.101-.019.101-.02.077-.02.051-.022.05.003.1.006.05.003.1.005.024.002.05.003.05.002.025.002.049.028.048.028h.025l.049.029.048.028.047.052.047.053.025.002.047.052.047.053.022.051.023.052.022.051.1-.019.152-.016.126-.018.152-.017.126-.017.15-.017.127-.018.126-.017.152-.017.126-.017.126-.018.126-.018.15.009.125.007.125.007.616.16zm-2.142 6.789l.02.101.021.051.021.077-.003.05.022.051-.005.1-.006.1-.006.1-.006.1-.03.098-.037.198-.038.223-.037.223-.027.024.08-.096.134-.142.109-.144.133-.143.243-.311.243-.312.109-.144-.076.02-.052.023-.076.02-.05-.002-.075-.005-.025-.001-.05-.003-.05-.003-.025-.001-.073-.03-.074-.029-.025-.001-.073-.03-.073-.029-.047-.053-.047-.052-.049-.028zm-5.855-.086l-.129.068-.03.098-.003.05.054-.072.108-.144.027-.023-.027.023zm3.48-.426l-.2.013-.027.024-.13.068-.103.069-.13.068-.077.045.075.005.05.002.1.006.024.002.05.002.05.003.025.002.049.028.048.027.025.002.049.028.048.027.003-.05.03-.073.054-.072.029-.073.053-.047.027-.049-.122-.057zM122.522 73.941l.075.004.1.006.099.03.098.031.098.031.099.03.073.03.074.03.073.029.074.029.072.054.12.082.12.082.096.08.096.081.097.056.072.054.023.027.024.026.073.03.049.027.048.028.025.001.098.03.124.033.123.032.124.032.123.032.222.063.221.063.222.063.444.125.197.062.196.061.052-.022.051-.022.05.003.05.003.05.003.05.002.05.003.05.003.074.004.05.003.124.032.123.033.123.032.099.03.098.031.097.056.049.028.048.027.049.028.023.027.049.027.048.028.024.027.023.026.022.051.022.052.023.051.022.051.022.052.022.051-.003.05.022.051-.003.05-.003.05-.003.05-.002.05-.003.05-.028.048-.028.049-.028.048-.028.049-.027.048-.028.049-.028.048-.028.049-.025-.002-.026.024-.027.023-.026.024-.051.022-.027.024-.051.022-.025-.002-.026.024-.052.022-.051.022-.025-.001-.05-.003-.05-.003-.05-.003-.075-.004-.05-.003-.075-.004-.05-.003-.05-.003-.123-.032-.123-.032-.001.025-.028.048-.028.048-.028.049-.028.048-.028.049-.027.048-.052.023-.026.023-.052.022-.05.022-.052.022-.052.022-.025-.001-.05.022-.052.022-.05-.003-.05-.003-.05-.002-.025-.002-.05-.003-.15-.008-.15-.009-.124-.007-.15-.009-.3.008-.3-.017-.15-.009-.175-.01-.15-.008-.174-.01-.175-.01-.175-.01-.173-.035-.025-.002-.1-.005-.2-.012-.2-.011-.199-.012-.2-.011-.374-.022-.374-.021-.375-.022.175.01-.23.087-.282.11-.179.064-.053.047-.079.07-.104.07-.13.068-.052.047-.053.047-.051.022-.051.022-.052.022-.051.022-.051.022-.077.02-.051.023-.025-.001-.05-.003-.025-.002-.025-.001-.05-.003-.025-.001-.025-.002-.05-.003-.05-.003-.025-.001-.025-.002-.05-.002-.05-.003-.048-.028-.048-.028-.025-.001-.102.019-.152.041-.151.017-.102.019-.076.02-.076.021-.075-.004-.1-.006-.075-.004-.075-.004-.075-.005-.1-.005-.074-.005-.1-.006-.05-.002-.05-.003-.05-.003-.025-.002-.025-.001-.05-.003-.048-.028-.024-.026-.048-.028-.049-.028-.048-.028-.024-.026-.048-.028-.024-.026-.023-.027-.024-.026-.023-.026-.022-.052-.023-.051-.022-.051-.022-.052-.022-.051-.022-.051.003-.05-.022-.052.003-.05.003-.05.002-.05.028-.048.028-.048.003-.05.028-.049.028-.048.027-.049.027-.023.026-.024.027-.023.027-.049.052-.022.026-.023.025.001.027-.024.026-.023.026-.024.052-.022.051-.022.051-.022.103-.044.103-.044.127-.043.204-.063.028-.049.027-.023.026-.024.026-.024.027-.023.026-.024.028-.048.028-.049.026-.023.027-.024.026-.023.053-.047.078-.046.052-.047.053-.047.051-.022.077-.02.129-.068.127-.043.128-.043.128-.043.127-.042.206-.089.179-.065.051-.022.308-.132.206-.089.102-.044.103-.044.103-.044.103-.044.1-.02.052-.022.025.002.002-.025.001-.025.003-.05.001-.025.028-.049.003-.05.001-.024.027-.024.001-.025.028-.048.03-.074.029-.073.054-.072.028-.049.052-.047.053-.047.053-.047.053-.047.052-.047.053-.047.077-.02.076-.021.076-.021.076-.02.05.002.075.004zM162.316 71.266l.125.007.125.007.1.006.05.003.05.003.05.003.05.003.05.002.048.028.048.028.049.028.023.026.049.028.023.027.049.027.023.027.024.026.023.027.024.026.022.051.022.052.022.051.022.051.022.052.022.051.022.051-.003.05.023.052-.003.05-.003.05-.028.048-.003.05-.028.048-.028.049-.002.05-.028.048-.028.049-.028.048-.028.049-.026.023-.026.024-.027.023-.026.024-.027.023-.051.022-.026.024-.052.022-.026.024-.051.022-.052.022-.05-.003-.05-.003-.05-.003-.05-.003-.05-.003-.1-.005-.1-.006-.099-.006-.1-.005-.1-.006-.1-.006-.1-.006-.1-.005-.099-.006-.101.02-.101.018-.102.02-.2.013-.202.014-.202.038-.203.039-.203.038-.202.038-.203.039-.076.02-.026.024-.027.024-.026.023-.051.022-.027.024-.051.022-.052.022-.026.023-.051.023-.052.022-.127.042-.178.04-.202.039-.203.038-.101.02-.126.017-.102.02-.126.017-.101.02-.101.019-1.759.1-.125-.008-.15-.009-.124-.007-.15-.008-.2-.012-.05-.003-.05-.002-.05-.003-.05-.003-.05-.003-.023-.026-.048-.028-.049-.028-.048-.028-.024-.026-.023-.027-.049-.028-.023-.026-.024-.026-.024-.027-.023-.026-.024-.027-.022-.05-.022-.052-.022-.052-.022-.05-.022-.052-.022-.052.003-.05-.022-.05.002-.05.003-.05.028-.05.003-.05.028-.048.028-.048.028-.049.027-.048.028-.049.028-.048.026-.024.027-.023.026-.024.027-.023.026-.024.026-.023.052-.022.026-.024.051-.022.027-.023.051-.023.052-.022.05.003.05.003.05.003.05.003.05.003.049.003.1.005.1.006.1.006.1.005.026-.023.026-.024.027-.023.026-.024.026-.023.052-.022.051-.022.076-.021.077-.02.051-.023.076-.02.052-.023.051-.022.126-.017.126-.018.127-.018.126-.018.151-.016.15.008.15.009.15.009.15.008.3-.008.275.016.1.006.328-.056.43-.076.228-.037.202-.038.228-.037.227-.037.228-.037.227-.037.228-.037.226-.013.126-.017.126-.018.126-.018.102-.02.126-.017.125.007.125.007.124.007z"/><path fill="#0775C4" d="M160.287 5.006l.2.011.2.011.199.012.2.011.2.012.197.036.199.037.198.036.198.036.198.037.199.036.198.037.198.036.198.037.199.036.198.036.197.062.196.061.197.062.197.06.197.062.197.062.196.061.197.061.197.062.197.061.197.062.197.06.196.062.197.062.196.086.195.086.195.087.196.086.195.086.195.087.196.086.195.086.366.172.366.17.366.172.34.17.341.17.341.17.316.168.316.168.316.169.29.166.291.167.097.056.097.056.097.055.097.056.097.056.097.055.097.056.097.056.22.112.22.088.22.088.22.088.245.089.246.089.245.09.245.088.49.179.516.18.516.18.27.09.27.09.27.091.27.116.268.116.27.115.268.116.269.115.147.059.147.058.122.057.146.059.147.058.12.082.146.084.146.083.145.084.146.083.12.082.12.082.218.138.218.138.217.137.218.138.217.138.217.137.193.137.192.136.193.136.193.137.192.136.193.136.192.136.193.137.192.136.191.161.191.161.191.161.191.162.191.16.192.162.19.161.167.16.166.16.166.16.166.16.166.16.166.159.166.16.167.16.166.16.166.159.166.16.166.16.166.16.166.16.166.159.167.16.166.16.14.158.14.183.14.183.14.184.14.183.14.183.14.184.139.183.14.183.14.184.14.183.139.183.14.183.14.184.139.183.14.183.14.184.114.182.115.181.115.182.115.182.114.182.115.182.115.182.115.182.114.182.115.181.115.182.115.182.113.207.113.207.114.207.113.206.113.207.114.207.113.207.113.207.114.207.113.206.089.206.088.205.088.206.089.205.088.205.088.206.089.205.088.206.089.205.088.205.088.206.089.205.088.206.088.205.089.205.088.206.089.205.088.206.088.205.089.205.088.206.088.205.087.23.087.231.15.434.151.435.15.434.15.46.123.457.124.458.124.458.124.458.124.458.124.457.124.458.098.482.099.456.02.101.018.102.02.1.019.102.019.101.02.102.018.1.02.102.019.101.044.103.064.204.064.18.089.205.088.205.089.205.088.206.088.205.177.41.088.206.089.206.087.23.087.23.087.23.087.231.042.128.043.127.043.128.043.128.042.127.043.128.043.128.043.127.042.128.043.128.018.126.018.126.018.126.017.127.017.15.018.127.016.151.016.151.017.152.016.15-.009.15-.008.15-.009.15-.007.125-.038.223-.063.222-.086.195-.111.194-.135.168-.158.14-.182.116-.206.088-.204.063-.226.013-.224-.013-.224-.038-.22-.088-.194-.111-.167-.135-.166-.16-.14-.183-.089-.206-.063-.204-.037-.227-.012-.226.006-.1.004-.075.004-.075.004-.075.005-.074.004-.075.004-.075-.02-.077-.02-.076-.022-.076-.02-.076-.02-.077-.022-.076-.02-.076-.02-.077-.022-.076-.02-.076-.02-.077-.022-.076-.02-.076-.02-.077-.022-.076-.02-.076-.02-.076-.066-.18-.065-.178-.09-.18-.09-.181-.088-.206-.088-.205-.177-.411-.088-.205-.088-.206-.087-.23-.087-.23-.087-.23-.087-.231-.087-.23-.043-.128-.043-.128-.042-.128-.043-.127-.043-.128-.043-.128-.043-.127-.042-.128-.043-.127-.018-.127-.099-.456-.099-.457-.099-.456-.1-.431-.126-.433-.125-.433-.126-.433-.125-.433-.125-.433-.126-.433-.127-.408-.126-.408-.152-.409-.064-.204-.063-.204-.064-.204-.063-.204-.063-.204-.064-.204-.063-.204-.089-.205-.088-.206-.088-.205-.089-.205-.088-.206-.088-.205-.089-.206-.088-.205-.09-.18-.09-.18-.09-.181-.09-.18-.09-.181-.09-.18-.089-.181-.09-.18-.09-.181-.09-.18-.09-.18-.089-.181-.09-.18-.09-.181-.09-.18-.09-.181-.089-.18-.09-.181-.115-.182-.114-.182-.115-.182-.115-.181-.115-.182-.114-.182-.115-.182-.115-.182-.115-.182-.115-.182-.114-.182-.117-.156-.116-.157-.116-.157-.116-.157-.116-.157-.117-.157-.116-.157-.116-.157-.116-.157-.116-.157-.117-.157-.116-.157-.14-.158-.142-.158-.141-.159-.141-.158-.142-.158-.14-.159-.142-.158-.141-.158-.141-.159-.141-.158-.142-.158-.14-.159-.142-.158-.141-.158-.141-.159-.141-.158-.141-.158-.143-.134-.168-.135-.167-.134-.168-.135-.167-.135-.168-.135-.167-.135-.168-.135-.167-.134-.168-.135-.168-.135-.167-.135-.168-.135-.167-.134-.168-.135-.167-.135-.168-.135-.167-.135-.193-.136-.192-.136-.193-.136-.193-.137-.192-.136-.193-.136-.192-.136-.193-.137-.192-.136-.193-.136-.192-.136-.097-.056-.097-.056-.097-.055-.097-.056-.097-.056-.097-.055-.097-.056-.097-.056-.097-.055-.122-.057-.122-.057-.097-.056-.219-.113-.218-.113-.22-.087-.246-.09-.245-.089-.246-.089-.245-.09-.245-.088-.49-.179-.516-.18-.516-.18-.27-.09-.27-.09-.27-.091-.27-.116-.268-.115-.27-.116-.268-.116-.269-.115-.147-.059-.122-.057-.122-.057-.121-.057-.122-.057-.12-.082-.121-.082-.12-.082-.267-.166-.29-.167-.292-.167-.29-.166-.292-.167-.315-.169-.316-.168-.316-.169-.317-.143-.343-.145-.342-.145-.17-.085-.172-.06-.17-.084-.173-.06-.171-.06-.172-.06-.172-.06-.172-.06-.172-.06-.172-.06-.171-.06-.172-.06-.172-.06-.172-.06-.172-.06-.172-.06-.172-.06-.171-.06-.172-.06-.172-.06-.173-.034-.174-.035-.173-.035-.173-.035-.173-.035-.174-.035-.173-.035-.173-.035-.174-.035-.173-.035-.148-.034-.15-.008-.15-.009-.15-.009-.15-.008-.149-.009-.15-.008-.15-.009-.15-.009-.149-.008-.15-.009-.125-.007-.226.012-.226.012-.226.012-.226.012-.226.013-.227.037-.228.037-.227.037-.228.037-.227.037-.228.037-.227.037-.228.037-.227.037-.228.037-.229.062-.229.062-.229.062-.229.062-.228.062-.23.062-.228.062-.23.062-.228.062-.23.062-.228.062-.229.062-.23.087-.23.087-.231.086-.23.087-.23.087-.231.087-.23.087-.23.087-.231.087-.23.087-.23.087-.231.087-.23.087-.438.2-.437.2-.437.2-.437.201-.438.2-.437.2-.437.201-.437.2-.876.426-.876.425-.129.068-.154.066-.154.067-.154.066-.154.066-.154.066-.154.067-.154.066-.153.041-.152.042-.307.107-.307.108-.306.107-.306.083-.305.083-.587.191-.585.167-.28.084-.28.084-.281.084-.28.085-.28.084-.128.042-.128.043-.128.043-.127.043-.128.042-.128.043-.127.043-.128.043-.128.042-.127.043-.128.043-.104.07-.103.043-.104.07-.104.069-.104.069-.104.069-.104.069-.105.07-.104.068-.079.07-.08.072-.078.07-.08.07-.079.071-.079.07-.29.26-.317.282-.607.541-.632.54-.632.54-1.239 1.08-.607.541-.607.541-.315.258-.315.257-.315.258-.292.283-.29.26-.292.283-.292.284-.292.283-.291.284-.292.284-.292.284-.292.283-.291.284-.292.284-.292.284-.267.285-.24.262-.24.261-.24.262-.241.261-.24.262-.24.262-.241.261-.242.287-.242.287-.242.286-.217.288-.216.288-.217.288-.217.289-.217.288-.217.288-.217.288-.217.288-.218.313-.218.313-.218.313-.219.313-.193.314-.193.315-.194.314-.193.315-.193.314-.194.314-.193.315-.193.314-.194.315-.193.314-.168.316-.169.316-.17.34-.17.342-.17.34-.169.341-.17.341-.145.342-.144.343-.145.342-.145.342-.145.342-.145.343-.145.342-.12.344-.12.343-.12.344-.12.344-.12.343-.119.344-.095.345-.095.345-.095.346-.095.345-.095.345-.095.345-.07.346-.034.174-.035.173-.035.173-.035.174-.035.173-.035.173-.035.173-.035.174-.035.173-.035.173-.035.174-.035.173-.035.173-.035.173-.035.174-.06.172-.06.171-.06.172-.06.172-.06.172-.06.172-.06.172-.058.147-.059.146-.058.147-.059.147-.058.147-.059.147-.142.292-.142.293-1.837-3.336.032-.123.032-.124.033-.123.03-.099.031-.098.032-.123.035-.174.036-.198.037-.198.036-.198.037-.199.036-.198.037-.198.036-.198.036-.199.037-.198.096-.37.097-.37.096-.37.096-.37.097-.37.12-.369.122-.369.122-.368.12-.369.122-.368.121-.37.147-.366.146-.368.146-.367.147-.367.146-.367.146-.367.171-.366.172-.366.17-.366.172-.366.171-.365.172-.366.17-.366.196-.34.194-.339.195-.34.195-.339.195-.339.194-.34.195-.339.195-.34.22-.337.22-.338.219-.338.22-.338.22-.338.22-.338.219-.338.218-.313.219-.313.218-.313.243-.312.243-.311.244-.312.243-.311.243-.312.243-.311.244-.312.241-.287.242-.286.242-.287.242-.287.242-.286.241-.287.267-.285.267-.285.267-.285.265-.26.293-.31.293-.308.294-.309.291-.283.292-.284.292-.284.292-.284.316-.282.317-.282.317-.283.316-.282.317-.282.317-.283.316-.282.317-.282.317-.283.632-.54.632-.539 1.239-1.08.607-.542.607-.541.607-.541.29-.259.317-.282.132-.118.131-.118.132-.117.131-.093.13-.093.131-.092.13-.093.131-.093.156-.09.155-.092.156-.091.155-.092.154-.066.154-.066.154-.066.154-.067.154-.066.154-.066.154-.067.154-.066.154-.066.154-.066.155-.067.154-.066.154-.066.154-.067.306-.107.307-.108.307-.107.306-.108.306-.083.587-.191.585-.167.28-.084.28-.084.28-.084.281-.084.255-.086.128-.043.128-.042.127-.043.128-.043.128-.043.127-.042.103-.045.103-.044.103-.044.102-.044.875-.4.875-.426.438-.2.437-.2.437-.201.462-.199.462-.199.462-.199.463-.199.462-.198.23-.087.23-.087.23-.087.231-.087.23-.087.23-.087.231-.087.23-.087.231-.087.23-.087.23-.087.231-.087.23-.087.23-.087.256-.085.255-.086.256-.085.255-.086.254-.06.254-.06.254-.061.254-.06.253-.061.254-.061.254-.06.254-.061.254-.06.254-.061.252-.036.253-.035.252-.036.253-.036.252-.035.253-.036.252-.035.253-.036.252-.036.251-.01.251-.01.276-.01.201-.014.201-.013z"/><g fill="#0775C4"><path d="M159.62 3.334l.35-.005.351-.005.35.02.35.02.348.02.35.02.35.02.349.02.35.02.349.02.349.02.35.02.347.045.348.045.348.045.348.045.348.045.348.045.348.046.348.045.348.045.348.045.347.07.347.07.346.07.347.07.346.07.347.07.346.07.347.07.346.07.346.094.345.095.345.095.345.095.345.095.32.093.32.094.32.093.32.119.318.118.319.119.319.118.318.119.319.118.319.119.319.118.317.143.317.144.317.143.318.144.317.143.317.143.316.169.316.168.291.167.29.167.292.167.29.167.292.167.29.192.289.192.29.192.289.191.29.192.289.192.288.217.263.216.263.215.263.215.144.109.144.108.144.109.119.107.12.107.118.107.12.107.118.107.12.107.118.107.118.132.12.107.117.132.117.132.118.131.118.132.117.132.118.132.118.132.117.132.118.132.117.132.118.132.118.132.117.132.118.132.118.132.117.132.118.132.118.132.117.132.118.132.116.157.118.132.116.156.116.157.091.156.092.155.09.156.092.155.091.156.092.155.09.156.092.155.091.156.091.155.092.156.091.155.091.156.091.155.092.156.091.155.091.156.091.155.023.051.023.027.024.026.023.027.024.026.023.026.022.052.024.026.022.051.023.027.07.104.069.104.094.106.094.105.094.106.12.107.118.107.237.239.26.265.143.133.142.134.141.158.142.159.14.158.142.158.14.184.14.183.069.104.069.104.069.104.069.104.07.105.068.104.07.104.069.104.069.104.069.104.069.104.068.13.067.129.068.129.068.129.044.102.044.103.044.103.045.102.044.103.044.103.044.103.044.102.045.103.044.103.044.102.113.207.114.207.113.207.113.207.139.208.138.208.138.209.139.208.138.208.3.443.3.443.162.235.162.234.162.235.161.235.162.234.162.235.16.26.16.259.136.258.068.13.068.128.067.13.068.129.068.129.068.129.067.129.068.129.066.154.067.154.066.154.065.18.064.178.067.154.066.154.066.154.067.154.066.154.041.153.042.153.04.152.042.153.042.152.04.153.084.305.082.306.083.305.082.305.058.304.058.304.058.303.116.583.117.583.06.279.058.278.06.28.059.278.059.279.059.279.084.28.043.128.043.127.042.128.043.128.043.127.043.128.042.128.043.127.043.128.043.128.042.127.043.128.043.128.066.154.044.102.043.128.044.103.043.127.062.23.06.253.085.28.084.28.082.306.082.33.16.686.185.711.183.737.183.737.08.355.08.355.081.33.081.33.083.306.084.28.086.255.062.23.044.102.02.076.024.027.162.234.137.233.11.257.084.28.034.278.01.276-.041.273-.066.272-.09.27-.14.242-.162.216-.188.215-.21.188-.21.138-.206.114-.23.087-.254.06-.253.036-.25.01-.25-.014-.248-.04h-.025l-.172-.06-.172-.06-.025-.002-.146-.083-.145-.084-.025-.001-.216-.163-.07-.079-.143-.133-.118-.132-.094-.106-.07-.104-.09-.156-.092-.155-.066-.154-.068-.13-.042-.127-.043-.127-.043-.128-.043-.128-.042-.127-.042-.153-.084-.28-.082-.306-.082-.33-.08-.33-.106-.357-.104-.356-.105-.357-.103-.381-.182-.762-.183-.737-.185-.711-.162-.66-.083-.306-.084-.28-.06-.254-.062-.23-.065-.178-.042-.153-.022-.051-.023-.026-.066-.154-.065-.18-.065-.178-.065-.18-.065-.179-.065-.179-.065-.179-.064-.179-.065-.179-.04-.177-.04-.178-.04-.177-.04-.178-.04-.177-.081-.33-.081-.33-.081-.331-.083-.305-.058-.304-.057-.304-.058-.304-.117-.582-.117-.583-.059-.279-.059-.279-.06-.278-.058-.28-.06-.253-.061-.254-.06-.254-.044-.128-.042-.127-.043-.128-.043-.128-.043-.127-.042-.128-.043-.128-.043-.127-.043-.128-.043-.128-.042-.127-.043-.128-.044-.103-.043-.127-.044-.103-.044-.103-.045-.102-.044-.103-.044-.103-.044-.102-.044-.103-.044-.103-.045-.103-.044-.102-.113-.207-.114-.207-.113-.207-.113-.207-.139-.208-.138-.208-.138-.208-.138-.209-.139-.208-.3-.443-.3-.443-.162-.234-.162-.235-.161-.235-.162-.234-.162-.235-.162-.235-.16-.26-.16-.259-.136-.258-.068-.13-.068-.128-.067-.13-.068-.128-.068-.13-.067-.129-.068-.129-.068-.129-.066-.154-.043-.128-.022-.05-.022-.052-.022-.052-.022-.05-.022-.052-.022-.052-.023-.051-.022-.051-.022-.052-.022-.051-.022-.051-.022-.052-.047-.053-.047-.052-.047-.053-.047-.053-.094-.105-.094-.106-.095-.106-.094-.105-.119-.107-.119-.107-.117-.132-.118-.132-.26-.265-.26-.266-.143-.133-.141-.158-.141-.159-.142-.158-.14-.158-.14-.184-.14-.183-.07-.104-.069-.104-.069-.104-.069-.105-.069-.104-.07-.104-.068-.104-.07-.104-.069-.104-.044-.103-.091-.155-.068-.13-.067-.129-.068-.129-.068-.129-.068-.129-.067-.129-.068-.13-.068-.128-.067-.13-.068-.128-.068-.13-.068-.129-.092-.13-.093-.13-.093-.131-.092-.13-.093-.131-.094-.106-.094-.105-.094-.106-.094-.105-.095-.106-.094-.106-.094-.105-.094-.106-.094-.105-.094-.106-.094-.105-.094-.106-.094-.105-.094-.106-.095-.106-.094-.105-.094-.106-.094-.105-.094-.106-.094-.105-.094-.106-.094-.106-.094-.105-.095-.106-.094-.105-.094-.106-.094-.105-.094-.106-.094-.106-.096-.08-.094-.106-.095-.08-.12-.082-.121-.082-.12-.082-.096-.081-.215-.188-.216-.162-.216-.163-.241-.164-.241-.164-.241-.164-.241-.164-.241-.164-.241-.164-.242-.14-.243-.139-.242-.139-.243-.139-.242-.139-.268-.14-.267-.141-.267-.14-.268-.141-.268-.116-.27-.115-.268-.116-.269-.115-.269-.116-.269-.116-.268-.115-.27-.116-.268-.115-.27-.091-.296-.092-.295-.092-.295-.092-.295-.092-.295-.092-.296-.092-.295-.092-.295-.093-.297-.067-.296-.067-.297-.067-.297-.067-.296-.067-.297-.067-.296-.067-.297-.067-.297-.067-.296-.068-.299-.042-.298-.042-.323-.043-.323-.044-.323-.044-.323-.043-.323-.044-.323-.043-.323-.044-.323-.043-.323-.044-.324-.019-.325-.018-.324-.019-.325-.018-.324-.02-.325-.018-.324-.018-.325-.019-.324-.019-.325-.018-.324-.019-.324-.018-.326.006-.326.006-.326.007-.326.006-.326.006-.326.007-.326.006-.326.006-.326.007-.325.006-.326.006-.326.007-.326.006-.327.031-.328.032-.327.03-.303.034-.302.032-.302.033-.303.033-.302.033-.302.032-.303.033-.302.033-.302.033-.303.032-.302.033-.303.033-.302.032-.302.033-.304.058-.304.058-.329.056-.328.056-.33.056-.303.058-.304.058-.304.057-.303.058-.306.083-.305.082-.305.083-.305.083-.28.084-.281.084-.28.084-.28.084-.28.084-.281.084-.28.084-.28.084-.28.084-.258.11-.256.111-.257.11-.257.111-.257.11-.256.111-.257.11-.257.111-.257.11-.256.111-.257.11-.232.113-.232.111-.233.137-.233.137-.233.137-.234.137-.233.137-.233.137-.233.137-.234.136-.233.137-.233.137-.233.137-.208.138-.209.139-.21.163-.21.163-.209.163-.21.164-.21.163-.209.163-.21.163-.21.164-.209.163-.21.163-.21.163-.21.164-.209.163-.21.163-.21.188-.212.189-.21.188-.212.188-.211.188-.186.19-.186.19-.187.19-.186.189-.026.023-.028.049-.057.122-.057.122-.082.12-.138.218-.138.217-.162.216-.163.216-.162.216-.163.216-.163.216-.162.216-.163.216-.188.215-.187.215-.188.214-.186.19-.186.19-.186.19-.187.189-.186.19-.186.19-.186.189-.186.19-.186.19-.187.189-.186.19-.397.377-.397.378-.398.378-.291.284-.055.072-.378.479-.378.479-.378.48-.378.478-.757.983-.783.982-.784 1.007-.404.503-.405.502-.404.503-.405.503-.324.407-.112.219-.142.292-.142.292-.142.293-.142.292-.142.292-.142.293-.26.61-.261.612-.26.611-.262.636-.262.636-.524 1.272-.262.636-.262.636-.262.636-.286.635-.287.634-.144.318-.143.317-.143.317-.144.318-.143.317-.145.342-.113.22-.113.218-.112.219-.113.219-.113.219-.112.219-.113.219-.113.218-3.327-7.477.195-.34.195-.34.193-.314.193-.314.194-.314.193-.315.193-.314.194-.315.193-.314.218-.313.218-.313.219-.313.217-.288.216-.288.217-.288.217-.288.08-.096.166-.266.277-.46.277-.46.277-.46.276-.46.277-.46.277-.46.277-.46.138-.217.137-.217.138-.218.138-.217.137-.218.138-.217.163-.216.162-.216.163-.216.163-.216.11-.17.056-.121.169-.316.168-.316.194-.314.193-.315.193-.314.194-.315.193-.314.193-.315.194-.314.193-.314.218-.313.218-.313.219-.313.218-.313.218-.314.219-.313.243-.311.135-.168.134-.167.135-.168.135-.167.135-.168.135-.167.135-.168.134-.168.135-.167.16-.166.16-.166.16-.166.16-.167.16-.166.159-.166.16-.166.16-.166.16-.166.159-.166.16-.166.16-.167.16-.166.16-.166.159-.166.16-.166.158-.141.158-.141.159-.141.158-.142.158-.14.159-.142.158-.141.396-.353.237-.212.264-.235.264-.235.29-.234.131-.118.132-.117.132-.118.132-.118.132-.117.157-.117.155-.09.156-.092.155-.091.103-.044.078-.046.102-.044.103-.044.103-.045.129-.067.154-.067.204-.063.126-.018.253-.035.025.001.052-.047.211-.188.237-.187.236-.187.236-.187.236-.186.236-.187.236-.187.236-.187.236-.187.236-.186.236-.187.236-.187.237-.187.236-.186.236-.187.26-.186.26-.16.26-.16.26-.16.26-.161.259-.16.26-.16.26-.161.259-.16.26-.161.259-.16.284-.16.285-.158.285-.16.283-.133.283-.134.283-.134.283-.134.283-.134.283-.134.284-.134.283-.134.308-.133.308-.133.307-.107.306-.108.307-.107.307-.108.306-.108.307-.107.307-.108.331-.106.332-.106.332-.106.331-.106.33-.082.33-.08.33-.082.33-.081.356-.08.355-.08.355-.08.356-.08.355-.08.353-.054.354-.055.354-.055.329-.056.328-.056.33-.057.328-.056.329-.056.328-.056.328-.032.327-.031.327-.031.328-.032.327-.03.327-.032.328-.031.327-.032.327-.031.328-.031.327-.032.352-.03.353-.03.352-.03.35-.004.352-.005.35-.005.351-.005.351-.005.351-.005.35-.005.352-.005.35-.004.485.278zm38.612 42.782l-.183.14.235-.162.205-.089-.257.11zm.464-.224l-.13.068.231-.087-.101.02zm.43-.075l.101-.02-.05-.003-.051.023zM139.507 61.026l.326-.006.349.02.324.019.325.018.35.02.324.019.35.02.324.019.324.018.325.019.324.019.325.018.324.019.323.043.323.044.323.043.323.044.323.044.323.043.646.087.671.089.646.087.646.087 1.318.176.646.087.646.087.646.087.646.088.646.087.323.043.323.044.323.043.323.044.325.019.324.018.324.019.325.019.324.018.325.019.324.018.3.018.3.017.299.017.3.017.299.017.3-.007.302-.008.3-.008.302-.008.3-.008.301-.007.301-.008.301-.008.303-.033.302-.032.302-.033.278-.034.277-.034.278-.035.227-.037.228-.037.252-.035.253-.036.252-.035.253-.036.253-.06.254-.061.254-.06.254-.061.533-.12.533-.12.532-.12 1.092-.262.558-.118.557-.119.558-.118.583-.117.279-.059.279-.059.303-.058.304-.057.304-.058.304-.058.304-.057.303-.058.304-.058.302-.033.303-.032.302-.033.303-.033.302-.033.302-.032.303-.033.302-.033.301-.007.301-.008.3-.008.302-.008.3-.008.302-.007.3.017.149.008.15.009.15.009.15.008.149.009.15.008.15.009.15.009.149.008.15.009.15.008.15.009.148.033.148.034.148.034.149.033.148.034.148.033.149.034.148.033.148.034.149.033.148.034.148.034.642.162.642.162 1.332.351.69.19.69.19.715.191.716.192.715.191.74.193.37.096.37.096.37.097.37.096.37.097.372.071.372.071.371.072.372.071.371.072.372.071.371.071.372.072.371.071.372.072.371.07.372.072.371.072.373.046.373.047.373.046.373.047.373.046.348.045.348.045.348.045.348.045.35.02.349.02.35.02.349.02.35.02.324.019.325-.006.15.008.175.01.175.01.15.009.15.008.149.009.151-.016.151-.017.151-.016.152-.017.15-.016.152-.016.151-.017.151-.016.152-.016.15-.017.152-.016.151-.016.151-.017.152-.016.126-.018.15-.016.152-.017.126-.018.127-.017.126-.018.126-.018.151-.016.251-.01.251-.012.251-.01.251-.01.5.003.477.002.224.013.226-.012.226-.012.201-.014.202-.013.1.006.1.005.1-.019.102-.02.101-.018.076-.021.077-.02.076-.021.076-.021.077-.02.076-.021.076-.021.076-.02.077-.021.051-.022.051-.023.052-.022.051-.022.052-.022.05-.022.052-.022.052-.022.05-.022.052-.022.027-.024.026-.023.026-.024.027-.023.026-.024.027-.023.026-.024.028-.048.026-.024.027-.024.026-.023.026-.024.027-.023.026-.024.027-.023.026-.024.026-.023.002-.025.001-.025.002-.025.001-.025.002-.025.001-.025.001-.025.002-.025.001-.025.002-.025.001-.025.002-.025.001-.025.001-.025.002-.025.001-.025.002-.025.001-.025.002-.024-.024-.027-.023-.026-.024-.027-.024-.026-.023-.026-.024-.027-.023-.026-.024-.027-.023-.026-.024-.026-.023-.027-.024-.026-.022-.052-.023-.026-.07-.08-.072-.078-.07-.08-.07-.079-.071-.079-.096-.08-.095-.081-.096-.08-.095-.081-.096-.08-.096-.081-.095-.081-.096-.08-.095-.081-.096-.08-.12-.083-.12-.082-.121-.082-.12-.082-.121-.082-.12-.082-.123-.057-.122-.057-.096-.056-.097-.055-.097-.056-.097-.056-.097-.055-.097-.056-.097-.056-.099-.03-.098-.031-.099-.03-.195-.087-.22-.088-.416-.174-.44-.176-.22-.087-.221-.088-.22-.088-.221-.088-.195-.086-.197-.061-.197-.062-.073-.029-.206.088-.127.043-.154.067-.178.04-.101.019-.228.037-.226.012-.25-.015-.223-.037-.221-.063-.22-.088-.268-.14-.241-.165-.215-.187-.187-.236-.16-.26-.112-.232-.085-.255-.06-.254-.012-.25.015-.25.04-.274.066-.271.114-.244.112-.194.136-.193.001-.025.186-.19.055-.071.079-.07.236-.188.26-.16.281-.11.305-.082.025.002.052-.022.179-.065.102-.044.103-.045.103-.044.128-.043.127-.042.128-.043.151-.016.176-.015.201-.014.201-.013.15.008.125.007.148.034.124.032.173.035.123.032.124.032.123.032.123.033.124.032.245.089.27.09.246.09.245.089.245.089.245.09.246.088.44.176.416.174.195.086.196.087.147.058.147.059.147.058.145.084.17.085.17.085.171.084.17.085.171.085.17.085.17.085.17.11.169.11.169.11.169.11.169.11.169.11.169.11.167.134.168.135.167.135.168.134.168.135.167.135.168.135.142.133.141.159.142.158.14.158.142.159.141.158.14.183.14.184.069.104.07.079.07.079.07.104.07.104.068.104.07.105.044.102.044.103.044.103.044.102.044.103.045.103.044.102.044.103.044.103.044.103.043.127.043.128.044.103.043.127.018.126.017.127.018.126.018.126.018.126.018.127.017.126.018.126-.007.125-.007.125-.007.124-.007.125-.008.125-.007.125-.007.125-.032.123-.034.148-.032.124-.032.123-.032.123-.032.124-.057.122-.057.122-.057.122-.057.121-.057.122-.058.122-.057.122-.082.12-.082.121-.082.12-.082.121-.082.12-.082.121-.082.12-.105.095-.106.094-.106.094-.105.094-.106.094-.105.094-.132.118-.157.116-.157.116-.157.117-.155.09-.156.092-.155.091-.156.092-.154.066-.154.066-.154.066-.154.067-.154.066-.153.041-.152.042-.153.041-.153.041-.152.042-.153.041-.152.041-.152.017-.15.016-.152.016-.151.017-.151.016-.152.016-.15.017-.152.016-.151.017-.151.016-.276.01-.276.008-.276.01-.276.009-.251.01-.5-.003-.477-.003-.224-.012-.226.012-.201.013-.201.014-.075-.005-.1-.005-.075-.005-.075-.004-.075-.004-.076.02-.075-.004-.076.02-.176.016-.177.015-.176.015-.176.015-.176.014-.176.015-.176.015-.176.015-.177.015-.176.015-.176.015-.201.014-.201.013-.201.014-.201.013-.201.014-.2-.012-.2-.011-.2-.012-.2-.011-.375.003-.374-.021-.375-.022-.399-.023-.4-.023-.399-.022-.399-.023-.398-.048-.398-.048-.398-.048-.398-.048-.398-.048-.398-.048-.397-.047-.398-.048-.397-.073-.396-.073-.397-.073-.396-.073-.397-.073-.396-.072-.397-.073-.396-.073-.397-.073-.396-.073-.397-.073-.396-.072-.395-.098-.395-.098-.395-.098-.395-.097-.37-.097-.37-.096-.37-.097-.74-.192-.74-.193-.741-.193-.715-.191-.715-.191-.69-.19-1.333-.352-.642-.162-.616-.16-.124-.033-.123-.032-.123-.032-.124-.032-.123-.032-.124-.032-.123-.032-.123-.033-.125-.007-.125-.007-.125-.007-.124-.007-.125-.007-.125-.008-.125-.007-.125-.007-.124-.007-.125-.007-.125-.007-.125-.008-.125-.007-.124-.007-.125-.007-.125-.007-.25-.014-.25.01-.252.01-.25.011-.252.011-.25.01-.252.011-.25.011-.252.01-.252.036-.253.036-.252.035-.253.036-.252.036-.252.035-.253.036-.277.034-.278.034-.279.06-.278.058-.28.06-.278.059-.279.059-.279.059-.558.118-.557.118-.558.119-.558.118-1.091.263-.558.118-.558.118-.557.118-.28.06-.278.059-.279.059-.279.059-.279.06-.279.058-.278.06-.278.034-.277.034-.278.034-.353.055-.353.03-.352.03-.352.03-.353.03-.352.029-.352.03-.351.005-.35.005-.352.005-.35.005-.351.004-.351.005-.351.005-.351.005-.35-.02-.349-.02-.35-.02-.349-.02-.35-.02-.349-.02-.349-.02-.35-.02-.349-.02-.35-.02-.347-.045-.348-.045-.348-.045-.348-.045-.348-.045-.671-.089-.671-.089-.671-.088-.671-.089-.671-.088-1.317-.176-.646-.087-.647-.087-.646-.087-.646-.088-.323-.043-.323-.044-.323-.043-.323-.044-.298-.042-.298-.042-.3-.017-.299-.018-.3-.017-.299-.017-.3-.017-.299-.017-.3-.018-.299-.017-.3-.017-.3-.017-.324-.019-.299-.017-.324-.018-.326.006-.326.006-.326.007-.326.006-.326.006-.652.013-.652.013-.651.012-.652.013-1.329.024-.676.011-.677.011-.677.012-.677.01-.677.012-.35.005-.351.005-.351.005-.35.005-.352.005-.35.005-.352.005-.349-.02-.35-.02-.349-.02-.35-.02-.349-.02-.35-.02-.348-.02-.35-.02-.35-.02-.349-.021-.35-.02.033-4.48.298.042.3.017.299.017.3.017.324.019.324.018.325.019.324.019.324.018.325.019.324.018.325.02.326-.007.326-.007.326-.006.325-.006.326-.007.326-.006.326-.006.652-.013.652-.013.652-.012.651-.013.677-.011 1.329-.024.676-.011.677-.012.677-.011.677-.011.35-.005.326-.007.326-.006 1.757.376zm63.824-2.523l.133-.142.027-.024-.16.166z"/></g><path fill="#0775C4" d="M123.609 58.993l.423.05.398.047.4.023.199.012.2.011.2.012.199.011.2.012.174.01.175.01.175.01.174.01.176-.015.177-.015.075.004.1.006.427-.026.452-.024.452-.024.452-.024.452-.024.452-.024.452-.025.452-.024.453-.024.452-.024.452-.024.452-.024.452-.024.452-.025.452-.024.451.001h.45l.451.002h.451l.45.001.451.001.451.001h.45l.452.002h.45l.45.001.452.001.449.026.45.026.448.025.45.026.449.026.274.016.275.015.275.016.274.016.275.016.273.04.248.04.248.039.248.04.248.039.249.039.248.04.248.038.248.04.248.039.248.04.247.063.247.065.246.064.222.063.222.063.222.062.222.063.221.063.222.063.222.063.222.062.221.063.444.126.443.125.443.151.442.15.442.151.417.15.86.299.441.15.442.151.442.15.443.151.442.15.443.126.444.126.221.063.222.063.222.063.222.062.222.063.221.063.099.03.098.031.099.031.1.006.1.005.099.006.1.006.1.006.1.005.1.006.1.006.099.006.1.005.1.006.1.006.1.005.1.006.1.006.1-.02.102-.019.1-.019.102-.019.101-.02.102-.018.1-.02.102-.019.101-.02.102-.018.227-.037.228-.037.229-.062.229-.062.229-.062.228-.062.23-.062.228-.062.483-.123.484-.147.254-.061.254-.06.254-.061.254-.06.254-.061.254-.06.355-.08.355-.08.355-.08.355-.08.38-.078.38-.079.38-.078.38-.078.38-.079.381-.078.379-.053.378-.054.379-.053.379-.054.378-.053.379-.053.379-.054.378-.053.38-.054.378-.053.378-.053.38-.054.378-.053.378-.054.38-.053.378-.053.377-.029.377-.028.378-.029.377-.028.377-.029.377-.028.278-.034.3-.008.302-.008.276-.009.276-.01.276-.008.276-.01.274.016.275.016.274.016.275.016.274.015.275.016.274.016.275.016.274.015.274.041.273.04.273.041.273.041.273.04.273.042.273.04.273.041.274.04.273.041.273.041.273.04.52.106.52.105.52.105.52.105 1.014.208.495.104.495.103.495.104.495.103.248.04.248.039.248.039.248.04.248.039.248.039.249.04.248.038.248.04.248.039.248.04.25.014.25.014.249.014.25.015.25.014.224.013.224.013.225.013.225.012.224.013.225.013.225.013.224.013.223.038.224.038.422.049.423.05.423.049.422.074.421.074.82.122.819.122.396.073.397.073.396.073.398.048.398.048.398.047.198.037.2.011.2.012.2.011.199.012.2.011.2.012.199.011.2.012.2.011.199.011.2.012.2.011.199.012.2.011.2.012.199.011.2.012.2-.014.202-.013.2-.014.202-.013.201-.014.201-.013.176-.015.226-.012.102-.02.126-.017.126-.018.126-.018.127-.018.126-.018.126-.017.126-.018.127-.018.126-.018.127-.043.128-.042.103-.044.102-.045.052-.022.051-.022.052-.022.05-.022.052-.022.052-.022.05-.022.027-.024.027-.023.026-.024.027-.023.026-.024.026-.024.027-.023.026-.024.026-.023.027-.024.001-.025.028-.048.028-.049.028-.048.028-.049.027-.048.003-.05.003-.05.003-.05.003-.05.003-.05.003-.05.002-.05.003-.05.003-.05.003-.05.003-.05.003-.049.003-.05.002-.05.003-.05.002-.025.001-.025.002-.025.001-.025.002-.025.001-.025.001-.024.002-.025.001-.025.002-.025.001-.025.002-.025.001-.025.001-.025.002-.025.001-.025.002-.025.001-.025-.023-.026.001-.025.001-.025-.023-.027-.024-.026-.023-.027-.024-.026-.023-.026-.024-.027-.023-.026-.024-.026-.023-.027-.024-.026-.023-.027-.024-.026-.023-.026-.024-.027-.023-.026-.024-.027-.023-.026-.024-.026-.024-.027-.023-.026-.024-.027-.023-.026-.047-.053-.049-.028-.048-.027-.074-.03-.073-.029-.073-.03-.074-.028-.073-.03-.074-.029-.073-.03-.074-.028-.073-.03-.074-.029-.098-.03-.098-.031-.099-.031-.1-.006-.1-.005-.1-.006-.1-.006-.099-.006-.1-.005-.1-.006-.1-.006-.1-.006-.1.02-.102.019-.101.02-.101.018-.102.02-.1.019-.154.041-.1.02-.102.019-.176.015-.201.013-.226.012-.251.01-.276.01-.276.01-.301.007-.301.008-.15-.009-.15-.008-.15-.009-.124-.007-.125-.007-.125-.008-.125-.007-.124-.007-.149-.033-.148-.034-.099-.03-.098-.031-.073-.03-.122-.057-.025-.001-.146-.084-.025-.001-.12-.082-.094-.106-.118-.132-.091-.155-.066-.154-.067-.154-.04-.178-.01-.25.014-.25.064-.247.088-.22.138-.218.16-.19.186-.166.207-.113.23-.087.227-.037.251-.01.249.039.221.063.024.026.05.003.075.004.1.006.1.006.124.007.125.007.25.014.25-.01.252-.011.25-.01.227-.013.176-.015.15-.016.05.003.102-.02.178-.04.177-.04.176-.014.177-.015.176-.015.176-.015.176-.015.176-.015.175.01.175.01.174.01.175.01.175.01.173.035.173.035.174.035.173.035.173.035.172.06.172.06.172.06.172.06.171.06.147.058.146.084.145.083.146.084.145.083.144.109.144.108.12.107.071.054.072.055.072.054.072.054.072.054.072.054.072.055.047.052.046.078.046.078.045.078.046.077.045.078.046.078.046.078.045.077.046.078.046.078.045.078.046.077.045.078.046.078.046.078.045.077.02.077.047.077.02.077.02.076.022.076.02.077.02.1.019.102.019.101.02.102.018.1.02.102.019.101.02.102-.007.1-.005.1-.006.1-.006.099-.006.1-.005.1-.006.1-.006.1-.005.1-.006.099-.006.1-.006.1-.005.1-.006.1-.03.098-.032.098-.03.099-.03.098-.032.098-.03.099-.03.098-.032.099-.03.098-.031.098-.03.099-.033.123-.057.122-.057.122-.057.122-.082.12-.08.096-.081.096-.08.095-.082.096-.08.095-.08.07-.078.071-.08.07-.079.072-.079.07-.08.07-.078.071-.103.044-.103.045-.077.045-.103.044-.103.045-.103.044-.102.044-.103.044-.103.044-.102.045-.103.044-.103.044-.179.065-.179.065-.177.04-.178.04-.178.04-.177.04-.178.04-.177.039-.176.015-.152.016-.15.017-.152.016-.151.016-.151.017-.253.035-.226.012-.226.013-.226.012-.226.012-.226.012-.226.012-.226.012-.226.012-.225-.013-.225-.013-.224-.013-.225-.013-.224-.013-.225-.012-.225-.013-.224-.013-.225-.013-.225-.013-.224-.013-.225-.013-.224-.013-.225-.013-.223-.037-.223-.038-.224-.038-.423-.05-.422-.049-.422-.074-.421-.074-.397-.073-.396-.073-.82-.122-.794-.12-.396-.074-.397-.072-.398-.048-.398-.048-.398-.048-.198-.036-.2-.012-.2-.011-.199-.012-.2-.011-.2-.012-.199-.011-.2-.012-.2-.011-.199-.011-.275-.016-.274-.016-.275-.016-.274-.015-.273-.041-.273-.04-.274-.042-.273-.04-.273-.041-.273-.04-.273-.041-.273-.041-.273-.04-.273-.042-.273-.04-.274-.041-.52-.105-.52-.105-.52-.105-.519-.105-1.015-.208-.495-.104-.494-.103-.495-.104-.495-.103-.248-.04-.249-.039-.248-.04-.248-.039-.248-.039-.248-.04-.248-.038-.248-.04-.249-.039-.248-.04-.248-.038-.248-.04-.25-.014-.25-.014-.249-.015-.25-.014-.249-.014-.25-.015-.25-.014-.249-.014-.25-.015-.25.011-.251.01-.251.011-.251.01-.251.012-.252.01-.25.01-.353.03-.352.03-.352.03-.353.03-.352.03-.352.03-.353.03-.353.055-.354.055-.354.054-.353.055-.354.055-.354.055-.354.055-.353.055-.354.054-.354.055-.354.055-.353.055-.354.055-.354.055-.353.054-.354.055-.354.055-.355.08-.355.08-.355.08-.355.08-.356.079-.355.08-.355.08-.355.08-.229.061-.229.062-.229.062-.229.062-.229.062-.229.062-.484.148-.484.147-.254.06-.254.061-.254.06-.254.061-.254.061-.278.06-.28.058-.278.06-.151.016-.126.018-.127.017-.15.017-.152.016-.151.016-.151.017-.152.016-.15.017-.152.016-.151.016-.151.017-.152.016-.15-.009-.15-.008-.149-.009-.15-.008-.15-.009-.15-.009-.149-.008-.15-.009-.15-.008-.148-.034-.148-.033-.148-.034-.149-.034-.148-.033-.148-.034-.247-.064-.247-.064-.246-.064-.247-.065-.247-.064-.247-.064-.467-.152-.467-.152-.467-.152-.442-.15-.442-.151-.442-.15-.442-.151-.86-.3-.417-.15-.417-.148-.418-.125-.419-.124-.418-.124-.419-.124-.197-.061-.197-.062-.221-.063-.197-.061-.222-.063-.222-.063-.222-.062-.221-.063-.222-.063-.222-.063-.223-.038-.223-.038-.223-.037-.224-.038-.223-.038-.223-.038-.223-.038-.223-.038-.224-.037-.223-.038-.223-.038-.223-.038-.223-.038-.225-.013-.25-.014-.25-.014-.249-.015-.25-.014-.424-.024-.424-.025-.424-.024-.425-.024-.424-.025h-.45l-.451-.001-.451-.001-.45-.001h-.451l-.451-.002h-.45l-.451-.001-.451-.001-.45-.001h-.452l-.45-.002-.452.025-.452.024-.453.024-.452.024-.452.024-.452.024-.452.024-.452.025-.452.024-.452.024-.428.025-.427.026-.427.026-.427.025-.427.026-.102.019-.126.018-.226.012-.226.012-.226.012-.225-.013-.224-.013-.225-.013-.225-.013-.299-.017-.225-.013-.224-.013-.225-.013-.423-.049-.423-.05.021-2.978zm78.765-1.49l-.07-.105-.023-.026.093.13zM149.327 18.4l.174.01.175.01.175.01.174.01.175.01.173.035.174.035.173.035.173.035.174.035.173.035.173.035.173.035.172.06.147.058.147.059.147.058.147.059.147.058.147.059.146.058.147.059.146.083.145.084.146.083.145.084.146.083.145.084.146.083.145.083.145.084.146.083.145.084.144.108.12.107.119.107.119.107.119.107.119.107.119.107.119.107.119.107.119.107.12.107.118.107.12.107.118.107.093.13.093.131.092.13.093.131.093.13.092.131.093.13.093.131.092.131.093.13.093.131.09.155.067.155.067.154.066.154.066.154.066.154.067.154.041.152.041.153.042.153.04.152.042.153.042.153.016.15.016.152.017.151.016.151.016.151.017.152-.009.15-.008.15-.009.149-.009.15-.008.15-.009.15-.008.149-.034.148-.033.149-.034.148-.034.148-.033.149-.034.148-.033.148-.034.148-.058.147-.059.147-.058.147-.059.147-.058.147-.059.147-.058.147-.059.147-.058.146-.059.147-.083.146-.084.145-.083.146-.084.145-.083.146-.084.145-.083.146-.084.145-.083.145-.084.146-.083.145-.084.146-.083.145-.108.144-.109.144-.108.144-.109.144-.108.144-.107.12-.107.119-.109.144-.107.119-.107.119-.107.119-.107.119-.107.119-.107.119-.107.12-.107.118-.106.12-.107.118-.107.12-.107.118-.132.118-.132.118-.132.117-.132.118-.132.118-.24.236-.237.212-.237.212-.263.21-.262.21-.263.21-.26.186-.262.185-.26.186-.262.185-.26.16-.234.162-.235.162-.234.162-.234.137-.233.137-.233.137-.233.136-.232.112-.232.112-.207.114-.102.044-.103.044-.103.044-.103.044-.179.065-.179.065-.179.065-.179.065-.179.065-.179.064-.177.04-.178.04-.177.04-.178.04-.177.04-.178.04-.176.015-.176.015-.177.015-.176.015-.176.014-.176.015-.175-.01-.174-.01-.175-.01-.175-.01-.175-.01-.174-.01-.149-.033-.148-.034-.148-.033-.149-.034-.148-.034-.148-.033-.148-.034-.147-.058-.147-.059-.147-.058-.147-.059-.147-.058-.147-.059-.147-.058-.147-.059-.145-.083-.145-.084-.146-.083-.145-.084-.12-.082-.121-.082-.12-.082-.121-.082-.12-.082-.12-.107-.119-.107-.12-.107-.118-.107-.12-.107-.118-.107-.12-.107-.118-.107-.12-.107-.119-.107-.094-.105-.092-.13-.093-.131-.093-.13-.092-.131-.093-.13-.093-.131-.092-.13-.093-.131-.093-.131-.092-.13-.093-.131-.093-.13-.092-.131-.093-.13-.066-.155-.067-.154-.066-.154-.066-.154-.067-.154-.066-.154-.066-.154-.066-.154-.067-.154-.066-.154-.066-.154-.067-.154-.066-.154-.066-.154-.041-.153-.042-.153-.041-.152-.041-.153-.042-.152-.041-.153-.041-.153-.042-.152-.041-.153-.041-.152-.042-.153-.041-.153-.016-.15-.015-.177-.015-.176-.017-.151-.015-.177-.014-.176-.015-.176-.015-.176-.015-.176-.015-.176-.015-.176-.015-.177.01-.174.01-.175.01-.175.01-.174.01-.175.01-.175.01-.175.01-.174.01-.175.009-.15.035-.173.033-.148.034-.149.033-.148.034-.148.033-.149.034-.148.096-.37.1-.42.1-.445.063-.222.063-.222.064-.246.064-.247.065-.247.064-.246.064-.247.09-.245.088-.246.09-.245.057-.122.057-.122.057-.122.057-.122.057-.122.057-.122.057-.122.057-.121.057-.122.057-.122.056-.097.056-.097.055-.097.056-.097.056-.097.055-.097.056-.097.08-.096.081-.095.08-.096.081-.095.081-.096.08-.095.08-.07.079-.072.08-.07.103-.07.104-.068.104-.07.105-.069.102-.044.052-.022.051-.022.076-.02.077-.021.076-.021.075.004.075.005.075.004.073.03.073.028.074.03.072.054.047.053.047.052.047.053.046.078.02.076.021.077.02.076.021.076-.004.075-.004.075-.005.075-.029.073-.029.074-.03.073-.054.072-.052.047-.053.047-.053.047-.078.046-.076.02-.026.024-.025-.001-.052.022-.026.023-.051.022-.052.022-.051.023-.053.047-.053.047-.052.047-.053.047-.053.047-.053.047-.053.047-.054.072-.054.072-.054.072-.054.072-.055.072-.054.072-.054.072-.054.072-.056.097-.056.097-.055.097-.056.097-.055.097-.031.098-.03.099-.032.098-.03.099-.03.098-.032.098-.087.22-.088.221-.063.222-.063.222-.063.221-.062.222-.063.222-.063.222-.063.221-.063.222-.1.445-.1.42-.096.37-.033.148-.032.124-.033.123-.032.124-.033.148-.032.123-.034.149-.009.15-.008.15-.009.149-.008.15-.009.15-.008.15-.01.149-.008.15-.008.15-.009.15-.008.149.016.151.016.151.017.151.016.152.016.15.017.152.016.151.016.151.017.152.016.15.017.152.016.151.016.151.042.153.041.153.041.152.042.153.04.152.042.153.042.153.042.127.043.128.043.128.043.127.042.128.043.128.043.127.068.13.067.128.068.13.068.129.067.129.068.129.068.129.068.129.067.129.068.13.068.128.067.13.068.128.068.13.07.104.068.104.07.104.069.104.094.106.094.105.094.106.094.105.094.106.094.105.094.106.094.106.094.105.095.106.095.08.096.08.095.081.096.081.095.08.096.081.095.08.096.082.095.08.096.08.096.081.097.056.096.056.097.055.122.057.122.057.122.057.122.058.122.057.122.057.122.057.123.032.124.032.123.032.123.032.124.032.123.033.123.032.124.032.123.032.125.007.125.007.125.007.124.008.125.007.125.007.125.007.125.007.126-.018.126-.017.126-.018.126-.018.127-.018.126-.018.151-.016.151-.016.153-.042.153-.041.152-.041.153-.042.152-.041.153-.041.154-.067.154-.066.154-.066.078-.046.078-.045.102-.045.103-.044.205-.088.207-.113.207-.114.207-.113.207-.114.208-.138.233-.137.233-.137.235-.161.235-.162.234-.162.235-.162.235-.162.236-.186.236-.187.236-.187.236-.187.236-.187.238-.211.237-.212.238-.212.105-.094.107-.119.107-.119.107-.12.107-.118.107-.12.107-.118.107-.12.107-.118.107-.12.107-.119.107-.119.107-.119.107-.119.107-.119.107-.119.107-.119.107-.119.107-.12.107-.118.107-.12.082-.12.082-.12.082-.12.082-.121.082-.12.082-.121.083-.12.082-.121.082-.12.082-.121.082-.12.082-.121.082-.12.082-.121.057-.122.057-.122.057-.122.057-.122.057-.122.057-.122.057-.122.057-.122.057-.122.058-.122.032-.123.032-.123.032-.124.032-.123.032-.123.032-.124.032-.123.033-.123.032-.124.032-.123.007-.125.007-.125.007-.125.007-.124.008-.125.007-.125.007-.125.007-.125.007-.124-.018-.127-.017-.126-.018-.126-.018-.126-.02-.101-.017-.127-.02-.101-.018-.101-.045-.103-.044-.103-.044-.102-.044-.103-.044-.103-.045-.102-.044-.103-.044-.103-.07-.104-.068-.104-.07-.104-.069-.104-.069-.104-.069-.105-.07-.104-.068-.104-.07-.104-.068-.104-.095-.106-.094-.105-.094-.106-.094-.105-.094-.106-.094-.106-.094-.105-.094-.106-.094-.105-.096-.08-.096-.081-.095-.081-.12-.082-.121-.082-.12-.082-.121-.082-.12-.082-.121-.082-.12-.082-.121-.082-.12-.082-.121-.082-.12-.082-.122-.058-.122-.057-.122-.057-.122-.057-.122-.057-.122-.057-.122-.057-.122-.057-.122-.057-.122-.057-.122-.057-.122-.057-.123-.033-.123-.032-.124-.032-.123-.032-.124-.032-.123-.032-.123-.032-.124-.032-.123-.032-.125-.008-.125-.007-.124-.007-.125-.007-.125-.007-.125-.007-.125-.008-.124-.007-.125-.007-.126.018-.127.018-.126.017-.101.02-.101.019-.102.02-.1.018-.102.02-.101.019-.102.02-.101.018-.103.045-.102.044-.103.044-.103.044-.102.044-.103.044-.103.045-.103.044-.102.044-.103.044-.103.044-.102.045-.103.044-.103.044-.207.113-.206.114-.207.113-.207.113-.182.115-.104.07-.104.068-.104.07-.13.092-.131.093-.13.093-.131.092-.053.047-.025-.001-.003.05-.03.073-.029.074-.029.073-.03.074-.053.072-.053.047-.053.047-.053.047-.077.045-.077.021-.076.02-.076.021-.075-.004-.075-.004-.05-.003-.05-.003-.075-.004-.025-.002-.05-.003-.05-.002-.025-.002-.048-.028-.049-.028h-.024l-.049-.029-.047-.053-.048-.027-.048-.053-.047-.053-.022-.051-.022-.052-.022-.051-.022-.051-.022-.052-.022-.051.004-.075.004-.075.002-.025.003-.05.003-.05.001-.025.003-.05.028-.048.001-.025.03-.073.027-.049.03-.073.027-.049.028-.048.054-.072.08-.07.079-.071.079-.071.079-.07.08-.071.078-.07.08-.071.156-.117.157-.116.156-.091.155-.091.13-.068.104-.07.129-.067.206-.113.207-.113.207-.114.232-.112.232-.112.129-.067.129-.068.129-.068.13-.067.127-.043.127-.043.128-.043.128-.043.127-.042.128-.043.128-.043.127-.043.128-.042.128-.043.127-.043.128-.043.128-.042.127-.043.127-.018.126-.018.126-.017.126-.018.176-.015.177-.015.176-.015.176-.015.175.01zM132.012 31.254l.125.007.124.007.125.007.125.008.125.007.123.032.124.032.123.032.123.032.124.032.122.057.121.058.122.057.122.057.122.057.122.057.074.03.048.027.049.028.047.053.047.052.047.053.047.053.047.053.047.052.047.053.047.053.047.053.047.053.047.052.047.053.047.053.047.053.047.052.047.053.048.053.047.053.047.053.045.077.046.078.045.078.021.076.02.076.021.077.021.076.02.076.021.077.021.076.02.076.021.077.021.076.02.076-.004.075-.004.075-.004.075-.004.075-.005.075-.004.074-.004.075-.005.075-.004.075-.004.075-.004.075-.03.073-.029.074-.03.073-.029.074-.029.073-.029.074-.03.073-.029.073-.029.074-.029.073-.03.074-.029.073-.029.074-.083.145-.084.146-.083.145-.084.145-.083.146-.109.144-.108.144-.108.144-.109.144-.108.144-.107.12-.107.118-.132.118-.132.117-.132.118-.132.118-.132.117-.132.118-.132.118-.132.117-.132.118-.132.118-.132.117-.132.118-.132.117-.13.093-.13.093-.131.092-.13.093-.131.093-.13.092-.131.093-.13.093-.13.068-.13.067-.128.068-.13.068-.128.067-.13.068-.129.068-.127.043-.128.042-.128.043-.127.043-.128.043-.126.017-.126.018-.077.02-.05-.002-.15.016-.152.017-.15-.009-.124-.007-.125-.007-.125-.007-.125-.007-.123-.033-.124-.032-.073-.029-.048-.028-.049-.028-.048-.027-.049-.028-.048-.028-.049-.028-.048-.028-.049-.028-.048-.027-.097-.056-.097-.056-.096-.08-.095-.08-.096-.081-.07-.08-.071-.079-.07-.079-.07-.104-.069-.104-.044-.103-.044-.103-.045-.102-.044-.103-.044-.103-.02-.101-.018-.101-.02-.102-.019-.1-.02-.102-.018-.101-.02-.102-.019-.1.006-.1.006-.1.005-.1.006-.1.006-.1.006-.1.005-.1.006-.1.006-.1.006-.1.005-.1.006-.099.03-.098.031-.099.031-.098.03-.099.031-.098.031-.098.03-.099.031-.098.031-.099.03-.098.032-.098.03-.099.03-.098.032-.099.03-.098.031-.098.057-.122.085-.17.086-.196.113-.219.114-.244.14-.242.056-.122.057-.122.058-.122.057-.122.057-.122.057-.122.001-.025.003-.05.003-.05.003-.05.003-.05.027-.048.028-.048.028-.049.028-.048.028-.049.028-.048.027-.049.027-.023.026-.024.08-.07.104-.07.104-.069.104-.069.104-.07.104-.068.104-.07.104-.069.104-.069.105-.069.104-.069.104-.07.104-.068.128-.043.127-.043.128-.043.128-.042.127-.043.128-.043.128-.043.127-.042.128-.043.128-.043.126-.018.126-.018.126-.017.126-.018.127-.018.126-.018.126-.017.126-.018.127-.018.124.007.17.085zm-.21 1.465l-.1-.005-.1-.006-.1.02-.102.018-.101.02-.101.019-.101.02-.102.018-.101.02-.101.019-.102.019-.1.02-.102.018-.101.02-.103.044-.103.044-.102.044-.103.044-.103.045-.078.045-.077.046-.078.046-.078.045-.001.025-.003.05-.028.048-.028.049-.028.048-.027.049-.028.048-.028.049-.026.023-.027.024-.026.024-.027.023-.051.022-.051.022-.052.022-.051.022-.051.023-.055.072-.055.096-.056.097-.056.097-.055.097-.057.122-.057.122-.057.122-.113.22-.113.218-.111.194-.085.17-.059.147-.055.097-.028.049-.03.073-.029.074-.029.073-.03.073-.028.074-.03.073-.029.074-.03.073-.028.074-.03.073-.029.074-.03.073-.028.073-.005.075-.004.075-.004.075-.005.075-.004.075-.004.075-.004.075-.005.075-.004.074-.004.075-.005.075-.004.075-.004.075-.005.075-.004.075-.004.075-.004.074.022.052.022.051.022.051.022.052.022.051.022.051.022.052.022.051.022.052.024.026.024.026.023.027.024.026.023.026.024.027.023.026.024.027.023.026.024.026.048.028.025.002.025.001.025.002.025.001.025.001.025.002.025.001.025.002.025.001.025.002.05.002.05.003.075.005.074.004.075.004.075.005.075.004.1.006.101-.02.025.002.025.001.051-.022.052-.022.076-.02.076-.021.077-.021.077-.046.103-.044.103-.044.103-.044.102-.044.103-.045.104-.069.104-.069.104-.069.104-.07.13-.067.129-.068.129-.067.13-.093.13-.093.131-.092.13-.093.131-.093.13-.092.131-.093.13-.093.131-.092.13-.093.107-.094.107-.12.107-.118.106-.12.107-.118.107-.12.107-.119.107-.119.107-.119.107-.119.083-.12.082-.12.082-.121.082-.12.082-.121.082-.12.055-.098.056-.097.056-.097.027-.048.028-.049.028-.048.028-.049.028-.048.028-.049.027-.048.028-.049.028-.048.003-.05.003-.05.003-.05.003-.05.002-.05.003-.05.003-.05.003-.05.001-.024.002-.025.001-.025.002-.025.001-.025.002-.025.001-.025.001-.025.002-.025.001-.025.002-.025.001-.025.002-.025.001-.025-.024-.026-.022-.052-.022-.05-.022-.052-.022-.052-.022-.051-.024-.026-.023-.027-.024-.026-.023-.027-.024-.026-.023-.026-.024-.027-.023-.026-.024-.026-.023-.027-.024-.026-.023-.027-.024-.026-.023-.026-.024-.027-.023-.026-.024-.027-.023-.026-.024-.026-.024-.027-.023-.026-.024-.027-.023-.026-.074-.03-.073-.028-.073-.03-.074-.029-.073-.03-.074-.028-.073-.03-.074-.029-.073-.03-.074-.029-.074-.004-.075-.004-.075-.004-.1-.006-.1-.006-.1-.006-.1-.005-.238.236zM125.745 45.769l.1.006.1.005.1.006.1.006.098.03.098.031.099.03.098.031.147.059.122.057.122.057.122.057.122.057.122.057.121.057.122.058.122.057.122.057.122.057.097.055.097.056.097.056.097.055.097.056.097.056.097.055.097.056.097.056.097.055.097.056.097.056.097.055.167.135.168.135.143.133.142.134.143.133.142.133.143.134.143.133.285.267.283.292.143.133.166.16.166.16.166.16.167.16.19.16.192.162.19.16.05.029.048.027.048.028.049.028.048.028.049.028.097.055.097.056.097.056.097.055.097.056.121.057.122.057.122.057.122.057.122.057.122.057.27.091.27.09.27.091.271.09.147.06.147.058.147.058.147.059.147.058.146.059.122.057.147.059.122.057.12.082.073.054.072.054.072.054.072.055.097.055.097.056.095.08.096.081.095.08.096.081.095.08.096.081.095.081.095.106.094.105.094.106.094.105.094.106.07.104.046.053.047.053.047.052.047.053.047.053.023.051.022.052.02.076.02.076.022.077.02.076.02.076.022.077.02.076.02.076.022.076-.005.075-.004.075-.004.075-.005.075-.005.1-.031.098-.03.074-.029.073-.029.074-.029.073-.03.073-.027.049-.028.048-.028.049-.028.048-.027.049-.053.047-.053.047-.053.047-.053.047-.052.047-.053.047-.053.047-.053.047-.052.047-.052.022-.051.023-.051.022-.052.022-.051.022-.052.022-.05.022-.052.022-.052.022-.1.02-.127.017-.101.02-.102.019-.1-.006-.1-.006-.1-.006-.099-.005-.1-.006-.1-.006-.098-.03-.098-.031-.099-.03-.098-.031-.099-.031-.098-.03-.098-.032-.099-.03-.098-.03-.099-.032-.098-.03-.098-.031-.196-.086-.195-.087-.196-.086-.195-.086-.17-.085-.341-.17-.17-.085-.146-.083-.147-.059-.122-.057-.122-.057-.048-.028-.049-.028-.048-.028-.05-.002-.025-.002-.05-.003-.074-.029-.073-.03-.073-.028-.074-.03-.073-.029-.074-.03-.073-.028-.074-.03-.073-.029-.074-.03-.073-.028-.073-.03-.074-.029-.073-.03-.12-.081-.121-.082-.12-.082-.121-.082-.12-.082-.096-.081-.096-.08-.191-.162-.191-.161-.191-.161-.096-.08-.095-.081-.096-.081-.095-.08-.097-.056-.097-.056-.097-.056-.097-.055-.049-.028-.048-.028-.049-.028-.048-.028-.049-.027-.048-.028-.049-.028-.048-.028-.122-.057-.123-.032-.124-.032-.123-.032-.123-.032-.124-.033-.123-.032-.124-.032-.123-.032-.123-.032-.124-.032-.124-.007-.125-.007-.125-.008-.125-.007-.125-.007-.124-.007-.125-.007-.125-.007-.125-.008-.15-.008-.124-.007-.275-.016-.276.01-.276.008-.577.017-.3.008-.302.008-.3.008-.302.007-.299-.017-.15-.008-.15-.009-.15-.009-.598-.034-.15-.009-.15-.008-.15-.009-.15-.008-.15-.009-.149-.008-.148-.034-.148-.034-.149-.033-.148-.034-.148-.033-.149-.034-.148-.033-.148-.034-.147-.058-.147-.059-.147-.058-.147-.059-.147-.058-.147-.059-.122-.057-.122-.057-.122-.057-.12-.082-.12-.082-.121-.082-.096-.08-.095-.082-.096-.08-.095-.08-.096-.081-.095-.08-.07-.105-.069-.104-.069-.104-.069-.104-.069-.105-.044-.102-.044-.103-.045-.103-.044-.102-.019-.102-.02-.1-.018-.102-.02-.101.006-.1.006-.1.005-.1.006-.1.03-.098.032-.099.03-.098.031-.098.03-.099.056-.097.056-.097.056-.097.055-.097.056-.097.056-.097.055-.097.08-.095.08-.07.08-.071.078-.07.08-.071.079-.071.079-.07.079-.071.104-.07.104-.069.104-.069.105-.069.104-.069.104-.07.104-.068.103-.044.051-.023.004-.074.03-.074.029-.073.029-.074.03-.073.052-.047.053-.047.053-.047.052-.047.078-.046.076-.02.077-.021.076-.021.075.004.075.005.075.004.073.03.074.028.073.03.073.029.048.053.047.052.025.002.126-.018.076-.02.076-.021.077-.02.075.003.1.006.1.006.1.006.099.005.098.031.075.004.049.028.048.028.049.028.048.028.049.027.073.03.049.027.048.028.049.028.048.028.049.028.05.003.05.002.05.003.05.003.05.003.049.003.05.003.05.003.05.003.05.002.05.003.05.003.05.003.05.003.05.003.05.003.05-.023.052-.022.126-.017.128-.043.127-.043.128-.043.28-.084.128-.043.153-.04.152-.042.153-.041.153-.042.076-.02.076-.021.076-.02.077-.021.076-.021.076-.02.075.004.075.004.1.006.13-.068zm-.16 1.468l-.05-.003-.05-.003-.05-.002-.049-.003-.05-.003-.05-.003-.051.022-.052.022-.1.02-.127.017-.128.043-.127.043-.128.042-.28.084-.153.042-.153.041-.152.041-.153.042-.076.02-.076.021-.077.02-.076.021-.076.021-.077.02-.1-.005-.1-.006-.1-.005-.099-.006-.1-.006-.1-.006-.1-.005-.1-.006-.1-.006-.098-.03-.098-.031-.098-.03-.099-.032-.098-.03-.099-.03-.097-.057-.096-.055-.049-.028-.025-.001-.025-.002-.05-.003-.05-.003-.05-.002-.05-.003-.126.017-.126.018-.126.018-.05-.003-.053.047-.078.046-.076.02-.103.045-.077.045-.078.046-.078.046-.078.045-.077.046-.078.045-.078.046-.078.046-.077.045-.078.046-.053.047-.053.047-.052.047-.053.047-.053.047-.053.047-.053.047-.052.047-.053.047-.028.049-.028.048-.028.049-.027.048-.028.049-.028.048-.028.049-.028.048-.028.049-.002.05-.002.025-.001.025-.002.025-.001.025-.002.024-.001.025-.001.025-.002.025-.001.025-.002.025-.001.025-.002.025.024.027.023.026.024.026.024.027.023.026.024.027.022.05.022.052.047.053.047.053.047.053.047.052.047.053.072.054.072.055.072.054.072.054.097.056.097.055.097.056.097.056.097.055.122.057.123.032.124.033.123.032.123.032.124.032.123.032.123.032.124.032.123.032.123.033.124.032.125.007.124.007.125.007.125.007.125.007.125.008.15.008.15.009.149.008.15.009.274.016.276-.01.276-.009.301-.007.301-.008.577-.017.3-.008.302-.008.3.017.15.009.149.009.15.008.15.009.15.008.149.009.15.009.15.008.15.009.149.008.148.034.149.033.148.034.148.034.148.033.149.034.148.033.148.034.147.058.147.059.147.058.147.059.073.03.074.028.073.03.074.029.073.03.074.028.073.03.074.029.12.082.12.082.121.082.12.082.121.082.12.082.096.08.096.081.19.186.19.162.191.16.096.081.096.081.095.08.097.056.097.056.097.056.097.055.048.028.049.028.048.028.049.028.048.027.049.028.048.028.049.028.048.028.049.028.048.027.049.028.05.003.048.028.074.03.073.028.074.03.073.029.073.03.074.028.147.059.145.083.17.085.171.085.17.085.341.17.17.085.171.085.17.085.17.084.171.085.074.03.073.029.074.03.073.028.074.03.073.029.073.03.074.028.073.03.074.029.075.004.075.005.05.002.05.003.05.003.05.003.05.003.05.003.049.003.025.001.025.001.025.002.025.001.001-.025.002-.025.001-.025.002-.025.001-.025.001-.024.002-.025.001-.025.002-.025.001-.025.002-.025-.024-.027-.023-.026-.024-.026-.024-.027-.023-.026-.024-.027-.023-.026-.024-.026-.045-.078-.046-.078-.07-.079-.071-.08-.07-.078-.071-.08-.07-.079-.071-.079-.072-.054-.072-.054-.072-.055-.072-.054-.072-.054-.072-.054-.072-.054-.048-.053-.048-.028-.048-.028-.049-.028-.097-.055-.097-.056-.097-.056-.097-.055-.122-.057-.122-.057-.122-.057-.122-.058-.122-.057-.121-.057-.27-.09-.27-.091-.271-.09-.269-.116-.147-.059-.147-.058-.147-.059-.147-.058-.146-.059-.147-.058-.147-.059-.146-.083-.12-.082-.12-.082-.121-.082-.072-.055-.072-.054-.072-.054-.072-.054-.072-.054-.047-.053-.215-.188-.215-.187-.19-.162-.192-.16-.166-.16-.166-.16-.166-.16-.166-.16-.284-.292-.285-.266-.143-.134-.142-.133-.118-.132-.144-.109-.119-.107-.144-.108-.144-.108-.144-.109-.072-.054-.072-.054-.072-.055-.072-.054-.072-.054-.072-.054-.072-.054-.072-.055-.072-.054-.072-.054-.097-.056-.097-.055-.097-.056-.097-.056-.097-.055-.097-.056-.097-.056-.097-.055-.097-.056-.122-.057-.122-.057-.122-.057-.122-.057-.122-.057-.05-.003-.025-.002-.024-.001-.025-.001-.025-.002-.025-.001-.025-.002-.025-.001-.05-.003.35-.005zM188.984 41.234l.05.003.05.003.05.002.05.003.05.003.048.028.048.028.049.028.048.028.024.026.023.026.149.034.148.033.123.033.124.032.123.032.073.029.074.03.048.027.049.028.048.028.049.028.048.027.049.028.048.028.049.028.048.028.049.027.095.081.096.08.095.081.07.08.072.079.069.104.069.104.069.104.07.104.043.103.044.103.045.102.044.103.044.103.044.102.044.103.02.101.019.102.02.1.018.102.02.101.019.102.038.202.039.203.038.202.039.203.038.202.039.203.038.202.039.203.019.101.019.102.02.1.018.102.02.101.019.102.02.1.018.102.045.103.044.103.044.102.044.103.044.103.068.129.065.179.09.18.044.103.044.103.044.102.044.103.043.128.043.127.043.128.042.128.043.127.018.126.018.127.02.076-.004.075-.004.075-.004.075-.005.075-.004.074-.004.075-.005.075-.004.075-.004.075-.004.075-.03.073-.029.074-.03.073-.028.074-.03.073-.054.072-.054.072-.054.072-.055.072-.054.072-.079.07-.078.046-.077.046-.078.046-.078.045-.076.02-.052.023-.051.022-.051.022-.052.022-.051.022-.051.022-.075-.004-.05-.003-.075-.004-.075-.004-.05-.003-.075-.005-.05-.002-.05-.003-.05-.003-.05-.003-.05-.003-.05-.003-.048-.028-.098-.03-.099-.03-.096-.057-.097-.055-.097-.056-.097-.056-.097-.055-.097-.056-.097-.055-.096-.081-.095-.08-.096-.081-.07-.08-.096-.08-.07-.08-.071-.078-.07-.08-.071-.079-.071-.079-.07-.08-.071-.078-.07-.08-.07-.104-.069-.104-.07-.104-.068-.104-.07-.104-.069-.104-.069-.104-.069-.104-.069-.105-.07-.104-.114-.182-.115-.181-.09-.18-.09-.181-.09-.18-.064-.18-.066-.154-.067-.154-.02-.076-.02-.077-.022-.076-.02-.076-.02-.076-.022-.077-.019-.101-.019-.101-.02-.102-.018-.1-.02-.102-.019-.101-.02-.102.007-.1.005-.1.006-.1.006-.099.005-.1.006-.1.006-.1.013-.224.013-.225.011-.2.023-.399.023-.4.01-.174.011-.2.003-.05.002-.024.001-.025.003-.05.03-.074.029-.073.029-.074.03-.073.027-.049.028-.048.055-.097.056-.097.028-.048.001-.025.002-.025-.022-.052.002-.05.003-.05.003-.05.003-.05.003-.05.003-.05.003-.05.027-.048.028-.048.028-.049.028-.048.028-.049.028-.048.027-.049.027-.023.026-.024.027-.023.051-.022.051-.022.052-.022.051-.023.051-.022.052-.022.05.003.05.003.05.003.054-.072zm.501 1.731l-.029.074-.03.073v.025l-.002.025-.009.15-.011.2-.048.398-.023.399-.011.2-.012.2-.011.199-.006.1-.006.1-.005.1-.006.1-.006.1-.004.074-.005.075-.004.075-.004.075.02.076.021.076.02.077.022.076.02.076-.001.025-.002.025.022.051.023.052.022.051.022.052.042.127.043.128.068.129.066.154.067.154.09.156.092.155.091.155.046.078.046.078.045.078.046.077.045.078.046.078.046.078.045.077.046.078.07.08.046.077.046.078.07.079.07.08.071.078.072.055.047.052.048.053.047.053.047.053.047.052.047.053.047.053.047.053.048.028.049.027.048.028.049.028.048.028.049.028.05.003.05.002.025.002.025.001.024.002.025.001.025.002.025.001.002-.025.001-.025.002-.025.001-.025.002-.025.001-.025.001-.025.002-.025-.02-.076-.022-.076-.02-.077-.02-.076-.02-.101-.02-.101-.019-.102-.044-.102-.044-.103-.044-.103-.046-.078-.065-.179-.066-.154-.068-.129-.042-.127-.043-.128-.043-.128-.043-.127-.042-.128-.043-.128-.043-.127-.043-.128-.042-.128-.018-.126-.018-.126-.018-.126-.018-.126-.037-.228-.037-.227-.037-.228-.037-.227-.038-.203-.039-.203-.038-.202-.04-.178-.02-.076-.021-.076-.021-.077-.02-.076-.021-.076-.02-.077-.022-.076-.02-.076-.022-.051-.022-.052-.023-.051-.022-.052-.022-.05-.022-.052-.022-.052-.022-.05-.024-.027-.023-.027-.024-.026-.023-.026-.024-.027-.048-.028-.025-.001-.025-.002-.024-.026-.025-.001-.023-.027-.025-.001-.025-.002-.025-.001-.025-.002h-.025l-.025-.002-.025-.002-.073-.03-.074-.028-.025-.002-.047-.053z"/></g><g fill-rule="nonzero"><path fill="#0775C4" d="M89.77 68.572l.357.016.358.015.334.024.168.013.167.012.167.012.167.013.168.012.167.012.167.013.167.012.168.012.176.036.177.035.177.036.177.035.186.059.065.027.177.036.232.04.28.02.287.043.168.013.167.012.177.035.176.036.177.035.177.036.186.058.21.05.186.058.12.031.122.032.13.054.13.055.131.054.14.078.14.077.15.101.182.114.192.138.187.193.104.12.174.226.009.023.08.129.08.13.01.022.09.153.066.161.01.024.076.185.053.194.009.023.053.195.03.204.01.023.029.204.007.213.01.023-.004.19-.026.2-.013.033-.036.177-.035.177-.014.032-.058.187-.068.163-.014.032-.068.164-.091.172-.014.033-.077.14-.101.15-.014.032-.087.117-.11.126-.014.033-.193.187-.12.104-.225.174-.213.141-.198.109-.176.099-.185.076-.162.066-.161.067-.149.034-.148.034-.125.024-.125.025-.125.024-.125.024-.125.025-.126.024-.204.03-.213.007-.214.006-.19-.002-.19-.003-.19-.003-.168-.012-.167-.013-.167-.012-.168-.012-.144-.022-.255-.03-.223-.017-.168-.012-.055-.004-.145-.022-.246-.007-.455-.056-.456-.056-.446-.033-.878-.098-.423-.043-.423-.042-.39-.029-.39-.029-.78-.057-.805-.048-.813-.071-.413-.02-.423-.042-.423-.042-.423-.043-.423-.042-.422-.043-.423-.042-.423-.042-.433-.066-.223-.016-.223-.017-.223-.016-.232-.04-.233-.04-.144-.021-.055-.004-.223-.017-.19-.003-.08.006-.148.034-.158.01-.157.011-.135.002h-.135l-.134.002-.112-.008-.134.001-.2-.026-.2-.026-.2-.026-.2-.026-.177-.035-.427.013-.561.015-.562.015-.562.014-.561.015-.562.015-.561.014-.562.015-.562.014-.548-.018-.548-.018-.548-.017h-.46l-.022.009-.08.005-.124.025-.158.01-.181.02-.125.025-.135.001-.134.002-.158.01-.167-.012-.19-.003-.2-.026-.233-.04-.242-.062-.275-.076-.251-.086-.173-.091-.14-.078-.14-.077-.15-.101-.159-.124-.135-.133-.136-.134-.204.03-.204.03-.204.03-.181.02-.181.02-.18.02-.191-.002-.19-.003-.168-.012-.167-.013-.167-.012-.302-.011-.27.002-.246-.006-.19-.003-.19-.003-.358-.015-.39-.029-.39-.029-.423-.042-.39-.029-.172.043-.171.044-.149.034-.148.034-.125.024-.135.001-.134.002-.214.006-.213.007-.19-.003-.191-.003-.19-.002-.168-.013-.167-.012-.167-.012-.167-.013-.168-.012-.311-.034-.52-.084-.2-.025-.056-.005-.08.006-.59-.055-.599-.078-.6-.078-.6-.077-.599-.078-.6-.078-.609-.101-.609-.101-.609-.101-.61-.101-.608-.101-.61-.101-.055-.004-.302-.011-.423-.043-.413-.019-.414-.02-.413-.018-.413-.02-.414-.019-.413-.02-.414-.018-.413-.02-.413-.019-.414-.02-.413-.018-.033-.014-.023.01-.092.037-.172.044-.194.053-.297.068-.306.044-.292.012-.279-.02-.612.09-.635.098-.635.099-.329.054-.33.054-.328.055-.339.03-.338.032-.339.03-.339.032-.338.031-.339.031-.18.02-.182.02-.18.021-.181.02-.181.02-.19-.002-.191-.003-.19-.003-.023.01-.162.066-.139.057-.139.057-.148.034-.125.025-.125.024-.125.024-.125.025-.126.024-.204.03-.204.03-.213.007-.19-.003-.19-.003-.191-.003-.167-.012-.168-.013-.167-.012-.167-.012-.167-.013-.168-.012-.144-.022-.144-.022-.288-.043-.288-.044-.256-.03-.432-.066-.177-.035-.144-.022-.344-.048-.321-.057-.289-.044-.265-.053-.21-.049-.213.007-.301-.011-.302-.011-.302-.011-.302-.011-.302-.011-.302-.011-.302-.012-.278-.02-.28-.02-.278-.021-.279-.02-.288-.044-.279-.02-.288-.045-.288-.043-.288-.044-.289-.044-.288-.043-.288-.044-.288-.044-.554-.097-.553-.096-1.074-.18-.112-.009-.144-.022-.4-.051-.232-.04-.256-.03-.27.002-.268.003-.27.003-.269.002-.27.003-.268.002-.26.026-.125.024-.125.025-.126.024-.125.025-.125.024-.102.015-.102.015-.102.015-.102.015-.102.015-.102.014-.102.015-.079.006-.078.005-.07.029-.07.028-.069.029-.046.019-.046.019-.046.019-.047.019-.023.01-.023.009-.023.01-.258.16-.268.137-.278.114-.296.068-.306.044-.293.012-.302-.01-.288-.044-.298-.067-.284-.1-.27-.132-.257-.164-.234-.174-.22-.207-.197-.217-.184-.249-.137-.267-.114-.278-.09-.287-.069-.296-.035-.283.011-.302.034-.312.067-.297.1-.284.132-.271.141-.247.174-.234.207-.22.217-.197.249-.184.129-.08.198-.109.199-.108.175-.1.176-.099.185-.076.185-.076.185-.076.185-.076.171-.043.172-.044.17-.043.172-.044.172-.043.171-.043.171-.044.172-.043.171-.044.18-.02.038-.042.193-.188.203-.164.212-.141.245-.128.23-.095.242-.072.25-.049.25-.049.214-.006.213-.007.167.012.177.036.144.022.21.049.153.045.121.031.186.059.154.045.065.027.903.223.033.014.19.003.214-.007.213-.007.483-.009.483-.01.403-.003.427-.013 1.045-.024 1.044-.024 2.066-.038 2.065-.039 1.022-.014 1.02-.014.697-.016.696-.016.706.007.706.007.706.007.705.008.706.007.706.007.706.007.705.007.706.007.706.008.706.007.715.03.715.03.715.03.715.031.716.03.111.009.046-.02.126-.024.125-.024.125-.025.125-.024.158-.01.213-.007.223.016.223.016.2.026.2.026.177.036.176.035.121.032.08-.006.213-.006.213-.007.214-.007.213-.006.339-.032-.01-.023-.071-.24-.01-.024-.03-.204-.03-.204-.006-.213-.01-.023.007-.246.03-.256.04-.232.062-.242.096-.229.118-.238.115-.182.137-.192.147-.168.023-.01.193-.187.226-.174.023-.01.19-.131.198-.109.023-.01.152-.09.162-.066.023-.01.264-.08.116-.048.194-.053.181-.02.181-.02.237-.017.213-.007.19.003.168.013.167.012.144.022.144.022.144.021.145.022.255.03.256.03.232.04.433.065.144.022.111.009.312.034.311.034.288.044.256.03.232.04.21.048.353.071.321.057.144.022.177.036.2.026.233.04.288.043.311.034.535.05.534.051.534.05.535.052.534.05.534.05.535.051.534.051.535.05.524.028.548.018.548.018.548.018.548.018.414.02.348-.009.348-.008.348-.008.325.002.618-.01.292-.013.27-.002.245.007.237-.016.213-.007.08-.006.101-.014.023-.01.302.011.312.034.297.067.285.1.293.122.27.132.258.165.243.197.197.216.183.25.16.258.138.268.09.287.069.296.044.306.013.293-.013.167.39.029.758.067.757.067.748.044.748.044.748.044.357.015.39.028.191.003.2.026.177.036.232.04.154.044.251.086.238.118.206.105.042.037.302.011.334.025.167.012.168.012.167.013.167.012.311.034.312.034.553.097.256.03.223.017.032.013.08-.005.11.008.135-.001.168.012.19.003.2.026.144.022.121.031.144.022.154.045.186.059.219.072.13.054.262.11.032.013.248.141.107.064.192.138.093.096.127.11.585-.024.752-.011.37-.018.372-.017.371-.018.381.006.38.006.382.005zM60.888 34.927l.088.018.033.014.088.017.121.032.065.027.089.018.088.017.098.041.098.041.098.041.098.04.097.042.043.036.042.037.042.037.042.037.084.073.084.074.085.073.117.087.117.087.116.087.117.087.117.088.117.087.117.087.117.087.107.064.108.064.107.064.107.064.108.064.378.196.387.219.798.429.41.21.411.209.41.21.206.104.205.105.206.105.205.105.215.128.205.105.215.128.215.128.214.127.192.138.192.137.191.138.192.137.192.138.191.137.192.138.192.137.168.147.201.16.201.161.202.16.2.161.225.151.224.151.225.152.214.127.215.128.215.128.215.128.215.128.214.128.215.128.215.128.215.128.214.128.238.118.238.119.238.118.238.119.238.118.238.119.238.118.238.118.238.119.466.214.466.213.466.214.467.214.466.214.956.418.955.418.49.204.49.204.466.214.475.237.238.118.238.119.238.118.238.119.238.118.238.118.238.119.238.118.238.119.237.118.238.119.238.118.075.05.107.064.248.142.644.384.388.219.397.242.214.128.215.128.215.128.215.128.214.128.215.128.205.105.206.104.205.105.196.082.172.091.164.068.065.028.065.027.065.027.066.027.065.027.065.028.056.004.032.013.033.014.033.014.079-.006.078-.005.089.018.088.017.089.018.074.05.075.05.075.051.061.083.061.083.038.093.038.092.015.102.015.102-.018.088-.017.089-.018.088-.041.098-.05.075-.05.075-.06.051-.084.061-.083.062-.092.038-.046.019-.07.028-.069.029-.079.005-.102.015-.111-.008-.089-.018-.088-.018-.088-.018-.089-.017-.088-.018-.089-.018-.088-.017-.098-.041-.098-.041-.098-.041-.098-.04-.097-.042-.196-.081-.205-.105-.206-.105-.205-.105-.215-.128-.215-.128-.214-.128-.215-.128-.215-.128-.215-.127-.214-.128-.215-.128-.42-.233-.388-.22-.644-.383-.247-.142-.098-.04-.075-.05-.215-.129-.238-.118-.238-.119-.238-.118-.238-.119-.237-.118-.238-.118-.238-.119-.238-.118-.238-.119-.238-.118-.238-.119-.466-.213-.466-.214-.467-.214-.466-.214-.956-.418-.955-.418-.49-.204-.49-.204-.466-.214-.466-.214-.476-.237-.238-.118-.238-.118-.237-.119-.238-.118-.238-.119-.238-.118-.238-.119-.238-.118-.238-.118-.238-.119-.238-.118-.238-.119-.237-.118-.248-.142-.224-.15-.224-.152-.225-.151-.224-.151-.224-.151-.225-.151-.224-.151-.224-.151-.224-.151-.225-.151-.224-.152-.201-.16-.16-.124-.158-.124-.16-.124-.181-.114-.183-.114-.182-.115-.182-.114-.182-.114-.182-.115-.182-.114-.182-.114-.183-.115-.182-.114-.205-.105-.205-.105-.206-.104-.205-.105-.205-.105-.41-.21-.411-.21-.41-.209-.799-.429-.387-.219-.388-.219-.13-.054-.14-.078-.14-.078-.14-.077-.14-.078-.14-.077-.14-.078-.14-.078-.117-.087-.117-.087-.117-.087-.117-.087-.117-.087-.117-.087-.117-.087-.084-.074-.032-.013-.033-.014-.033-.014-.065-.027-.065-.027-.056-.004-.056-.004-.032-.014-.089-.018-.032-.013-.089-.018-.098-.04-.074-.051-.075-.05-.052-.06-.051-.06-.052-.06-.038-.093-.038-.092-.005-.079-.006-.079-.005-.079.017-.088.018-.088.041-.098.05-.075.05-.075.06-.051.06-.052.083-.061.093-.038.092-.038.08-.006.078-.005z"/><path fill="#0775C4" d="M42.053 46.644l.088.018.089.017.088.018.098.04.098.042.098.04.12.032.122.031.251.086.252.086.26.109.262.109.26.109.49.204.75.313.327.136.326.136.327.137.326.136.326.136.326.136.63.282.63.282.629.282.63.281.629.282.629.282.63.282.629.282.63.282.629.282.326.136.326.136.327.136.326.136.326.136.326.136.555.232.555.231.554.232.555.231.555.232.555.231.531.241.532.241.531.241.532.241.54.264.542.265.54.264.542.264.541.264.541.264.541.264.541.264 1.082.528 1.082.529 1.083.528 1.082.528 1.082.528 2.141 1.066 2.141 1.066 1.082.528 1.082.529 1.082.528 1.083.528 1.072.505.541.264.541.264.541.264.541.265.532.24.541.265.532.24.531.242.532.24.531.242.532.24.531.242.532.24.531.242.555.231.555.232.555.231.554.231.294.123.293.123.294.122.294.123.303.145.303.146.28.155.28.155.28.156.28.155.28.155.28.155.56.31.56.31.551.288.55.287.28.155.28.156.271.132.27.132.271.132.27.132.271.132.27.132.271.132.27.132.271.132.261.109.131.055.163.068.447.167.252.086.261.109.284.1.13.054.131.054.13.055.131.054.13.055.131.054.13.055.131.054.13.054.108.064.108.064.107.064.065.028.042.036.042.037.043.037.042.037.051.06.052.06.052.06.051.059.052.06.019.046.028.07.01.023.047.115.025.125.001.135-.031.121-.032.121-.064.107-.096.094-.097.094-.106.07-.115.048-.126.024-.134.002-.121-.032-.121-.03-.108-.065-.093-.096-.094-.097-.029-.07-.01-.023-.009-.023-.032-.013-.033-.014-.033-.014-.074-.05-.075-.05-.098-.041-.098-.041-.107-.064-.108-.064-.13-.054-.13-.055-.131-.054-.13-.055-.131-.054-.13-.055-.262-.109-.26-.109-.252-.085-.448-.168-.186-.058-.163-.069-.294-.122-.293-.123-.294-.122-.294-.123-.293-.122-.27-.132-.28-.156-.28-.155-.28-.155-.28-.155-.28-.155-.281-.155-.55-.288-.56-.31-.551-.287-.55-.287-.28-.156-.28-.155-.271-.132-.27-.132-.271-.132-.27-.132-.271-.132-.271-.132-.27-.132-.271-.132-.294-.123-.293-.122-.555-.232-.555-.231-.554-.232-.555-.231-.555-.232-.554-.231-.555-.232-.532-.24-.531-.242-.532-.24-.531-.242-.541-.264-.541-.264-.541-.264-.542-.264-.54-.264-.542-.264-.54-.264-1.083-.529-1.082-.528-1.082-.528-1.082-.528-1.082-.528-2.141-1.066-2.142-1.066-1.082-.529-1.082-.528-1.082-.528-1.082-.528-1.073-.505-.54-.264-.542-.265-.54-.264-.542-.264-.541-.264-.532-.24-.531-.242-.532-.24-.531-.242-.532-.24-.531-.242-.532-.24-.531-.242-.532-.24-.555-.232-.554-.232-.555-.231-.555-.232-.326-.136-.326-.136-.327-.136-.326-.136-.326-.137-.326-.136-.63-.282-.63-.281-.629-.282-.63-.282-.629-.282-.629-.282-.63-.282-.629-.281-.63-.282-.629-.282-.326-.136-.326-.136-.327-.137-.326-.136-.326-.136-.326-.136-.75-.313-.49-.204-.261-.11-.261-.108-.252-.086-.228-.095-.22-.073-.097-.04-.098-.041-.088-.018-.066-.027-.065-.028-.032-.013-.112-.008-.121-.032-.13-.054-.108-.064-.094-.097-.07-.106-.07-.106-.048-.116-.025-.125-.001-.134.031-.121.055-.13.064-.108.096-.094.106-.07.116-.048.116-.048.023-.01.102-.014.023-.01.079-.005.055.004.252.086zm-.074 1.463l.079-.005.023-.01-.102.015zM23.486 57.764l.112.008.135-.001.144.021.167.013.177.035.177.036.2.026.176.035.177.035.088.018.089.018.088.018.088.017.089.018.065.027.098.041.088.018.089.018.088.017.088.018.089.018.088.018.089.017.088.018.088.018.112.008.111.008.223.017.223.016.223.017.223.016.223.016.112.009.111.008.112.008.12.031.122.032.12.031.122.031.12.032.122.031.12.031.34.104.34.104.34.103.34.104.34.103.34.104.34.103.34.104.34.103.34.104.67.184.694.174.693.175.693.174.694.175.693.174.694.174 1.377.326 1.377.326.386.085.396.107.396.108.395.107.396.108.396.108.395.107.396.108.396.108.395.107.396.108.396.108.395.107.396.108.768.225.768.225.768.224.778.248.778.248.777.248.778.248.755.257.754.258.755.257.754.258.755.257.764.28.764.281.764.28.764.281.741.29.741.29.74.29.742.29.74.29.742.29.74.29.742.29.74.29.098.042.098.04.22.073.228.095.251.086.252.086.251.086.275.076.274.076.56.176.59.19.592.189.307.09.308.09.307.09.307.09.284.099.284.1.285.099.13.054.13.055.131.054.13.054.131.055.13.054.131.055.13.054.131.055.13.054.131.055.13.054.131.055.108.064.107.064.107.064.108.064.107.063.108.064.107.064.107.064.085.074.084.073.061.083.048.116.047.116.015.102-.008.111-.008.112-.032.12-.04.098-.074.085-.074.084-.083.061-.115.048-.116.047-.102.015-.111-.008-.112-.008-.12-.032-.108-.064-.084-.073-.075-.05-.075-.05-.075-.051-.075-.05-.074-.05-.075-.051-.075-.05-.098-.041-.107-.064-.107-.064-.108-.064-.107-.064-.108-.064-.107-.064-.107-.064-.13-.055-.131-.054-.131-.055-.13-.054-.131-.055-.13-.054-.131-.055-.284-.099-.284-.1-.284-.099-.285-.1-.284-.099-.284-.1-.307-.089-.592-.19-.591-.189-.582-.166-.284-.1-.275-.076-.274-.076-.252-.086-.251-.086-.252-.085-.228-.096-.121-.031-.098-.04-.718-.3-.74-.29-.742-.29-.74-.29-.742-.29-.74-.29-.742-.29-.74-.29-.742-.29-.74-.291-.765-.28-.764-.281-.754-.258-.755-.257-.754-.257-.755-.258-.754-.257-.755-.258-.754-.257-.755-.258-.768-.224-.768-.225-.769-.225-.768-.225-.768-.225-.372-.117-.396-.107-.396-.108-.395-.108-.396-.107-.396-.108-.395-.108-.396-.107-.396-.108-.395-.108-.386-.084-.387-.085-.386-.084-.386-.085-1.377-.325-1.377-.326-.694-.175-.693-.174-.694-.175-.693-.174-.693-.174-.694-.175-.693-.174-.34-.104-.34-.103-.34-.104-.34-.103-.34-.104-.34-.104-.34-.103-.34-.104-.34-.103-.34-.104-.088-.017-.088-.018-.088-.018-.089-.018-.088-.017-.089-.018-.088-.018-.111-.008-.112-.008-.111-.008-.223-.017-.223-.016-.223-.017-.223-.016-.223-.017-.112-.008-.111-.008-.121-.031-.121-.032-.121-.031-.121-.031-.121-.032-.121-.031-.122-.031-.12-.032-.131-.054-.121-.032-.033-.013-.032-.014-.056-.004-.056-.004-.065-.027-.065-.028-.154-.045-.154-.044-.176-.036-.168-.012-.144-.022-.144-.022-.056-.004-.055-.004-.112-.008-.111-.009-.056-.004-.065-.027-.033-.014-.065-.027-.065-.027-.075-.05-.085-.074-.06-.083-.062-.083-.038-.092-.047-.116-.025-.125.008-.112.032-.12.031-.122.064-.107.074-.084.073-.084.083-.062.093-.038.092-.038.102-.015.102-.014.033.013zM72.071 27.086l.056.004.056.004.055.004.066.028.065.027.042.037.042.036.224.151.225.152.257.164.266.188.29.178.299.202.322.192.331.215.696.443.729.458.761.47.397.243.397.242.397.242.397.243.406.265.407.265.406.266.384.275.383.275.383.275.374.251.374.252.192.138.191.137.169.147.168.147.16.124.158.124.16.123.158.124.16.124.158.124.16.124.135.133.043.037.042.037.042.036.019.047.019.046.019.046.019.046.019.047.019.046-.004.056-.004.055-.004.056-.005.056-.004.056-.004.055-.004.056-.027.065-.037.042-.037.043-.036.042-.037.042-.037.042-.037.042-.036.042-.047.02-.046.018-.046.02-.046.018-.047.02-.055-.005-.056-.004-.056-.004-.056-.004-.055-.004-.056-.004-.056-.004-.065-.028-.065-.027-.042-.037-.043-.036-.042-.037-.136-.134-.136-.133-.159-.124-.159-.124-.159-.123-.159-.124-.159-.124-.159-.124-.159-.124-.159-.124-.159-.123-.159-.124-.35-.261-.374-.252-.374-.252-.374-.252-.374-.252-.374-.251-.396-.243-.397-.242-.397-.242-.397-.242-.397-.243-.397-.242-.761-.47-.729-.458-.696-.444-.332-.215-.322-.192-.299-.201-.29-.179-.266-.187-.257-.165-.234-.174-.224-.151-.042-.037-.042-.037-.042-.037-.042-.036-.02-.047-.018-.046-.02-.046-.018-.046-.02-.046-.018-.047.004-.055.004-.056.004-.056.004-.056.004-.055.004-.056.004-.056.028-.065.036-.042.037-.043.037-.042.037-.042.036-.042.037-.042.037-.042.046-.02.046-.018.046-.02.047-.018.046-.02.046-.018.056.004.056.004z"/><path fill="#0775C4" d="M70.137 28.692l.111.009.098.04.098.041.084.074.084.073.061.083.038.093.039.092.014.102.015.102.025.125.024.125.001.135.002.135.001.134.001.135.002.135v.134l.002.135.001.134.002.135.001.135.001.134.002.135-.022.144-.02.279-.045.288-.043.288-.044.289-.044.288-.043.288-.044.288-.044.289-.066.297-.067.298-.067.298-.067.298-.11.586-.12.563-.107.53-.092.497-.04.233-.04.232-.039.233-.026.2-.074.544-.073.544-.084.52-.083.521-.083.52-.083.522-.084.52-.083.521-.093.498-.092.497-.093.498-.093.498-.093.497-.092.498-.093.498-.093.497-.116.507-.116.508-.115.507-.116.507-.116.507-.126.484-.115.507-.126.484-.139.517-.139.517-.139.516-.139.517-.139.517-.162.526-.162.526-.162.526-.059.186-.058.187-.059.186-.058.186-.059.186-.059.187-.058.186-.059.186-.058.186-.05.21-.025.2-.026.2-.026.2-.026.2-.026.2-.026.2-.026.199-.026.2-.052.4-.052.4-.052.4-.052.399-.051.4-.052.4-.052.4-.104.799-.08.79-.105.8-.051.399-.052.4-.052.4-.052.4-.052.399-.052.4-.052.4-.026.2-.026.2-.026.2-.026.199-.026.2-.026.2-.04.232-.048.21-.05.209-.048.21-.05.209-.048.21-.05.209-.049.209-.107.396-.117.372-.118.373-.117.372-.094.363-.058.186-.036.177-.035.177-.036.177-.035.176-.036.177-.035.177-.035.177-.036.177-.035.176-.026.2-.026.2-.026.2-.026.2-.008.111-.041.098-.041.098-.074.084-.073.085-.083.06-.083.062-.093.038-.102.015-.102.015-.111-.009-.121-.03-.098-.042-.107-.064-.085-.073-.06-.083-.062-.083-.038-.093-.038-.092-.015-.102.008-.112.017-.223.016-.223.017-.223.026-.2.026-.2.026-.2.026-.2.049-.208.049-.21.049-.21.049-.209.058-.186.059-.186.059-.186.117-.373.117-.372.117-.373.117-.373.117-.372.059-.186.058-.187.06-.186.048-.21.05-.209.048-.209.05-.21.048-.209.036-.177.035-.176.036-.177.035-.177.036-.177.026-.2.061-.376.061-.377.062-.376.052-.4.052-.4.052-.4.051-.4.081-.79.104-.799.094-.823.052-.4.052-.4.052-.399.052-.4.052-.4.075-.409.075-.409.026-.2.026-.2.026-.2.026-.2.049-.209.049-.21.049-.209.049-.209.049-.21.049-.209.049-.21.05-.208.048-.21.05-.21.048-.209.05-.209.048-.21.059-.186.162-.526.162-.526.149-.494.148-.493.149-.494.148-.493.149-.494.125-.484.125-.484.126-.484.125-.484.126-.484.125-.484.125-.484.103-.474.102-.475.102-.474.102-.475.093-.498.093-.497.093-.498.092-.497.093-.498.093-.498.093-.497.092-.498.084-.52.083-.522.083-.52.083-.521.084-.52.073-.545.04-.232.04-.233.039-.232.053-.265.107-.53.106-.531.12-.563.11-.586.044-.288.044-.288.043-.289.044-.288.044-.288.043-.288.044-.289.044-.288.043-.288.021-.279.03-.256.03-.255.008-.112.009-.111.008-.112.008-.111.008-.112.008-.111.009-.112.008-.111.008-.112.008-.111-.015-.102-.014-.102-.015-.102-.006-.08-.005-.078-.015-.102-.015-.102.008-.111.032-.121.04-.098.064-.108.074-.084.083-.061.083-.061.092-.038.093-.038.102-.015zM83.22 34.018l.087.018.098.04.098.041.085.074.084.073.06.083.01.023.043.037.051.06.061.083.052.06.019.046.029.07.009.023.029.069.009.023.015.102.01.023-.005.056-.004.056.01.023.005.079-.022.144-.012.167-.012.167-.013.168-.012.167-.035.177-.036.176-.035.177-.036.177-.035.177-.036.176-.035.177-.036.177-.035.177-.045.153-.045.154-.13.405-.132.405-.13.405-.131.406-.285.82-.261.81-.131.405-.13.405-.132.405-.13.405-.131.405-.059.187-.049.21-.049.208-.049.21-.05.21-.048.209-.161.66-.16.661-.162.661-.16.66-.184.671-.184.67-.355 1.308L79.848 51l-.354 1.308-.378 1.318-.354 1.308-.354 1.308-.354 1.307-.184.67-.161.662-.161.66-.16.661-.162.66-.16.662-.161.66-.161.661-.161.661-.16.66-.162.662-.16.66-.018.089-.032.12-.072.22-.063.242-.062.242-.086.251-.086.252-.185.535-.176.56-.1.283-.09.308-.09.307-.089.307-.09.307-.09.308-.09.307-.045.154-.045.153-.045.154-.021.144-.022.144-.022.144-.022.144-.022.144-.022.145-.021.144-.022.144-.022.144-.022.144.001.135-.008.111-.008.112-.008.111-.009.112-.008.111-.008.112.015.102.015.102.015.102.015.102.014.102.015.102.02.046.018.046.02.046.018.047.01.023.01.023.009.023.019.046.038.093.015.102-.008.111-.009.112-.04.098-.041.098-.05.074-.074.085-.083.06-.083.062-.093.038-.092.038-.102.015-.112-.008-.111-.009-.098-.04-.098-.041-.075-.05-.084-.074-.061-.083-.061-.083-.038-.093-.02-.046-.028-.07-.028-.069-.029-.069-.028-.07-.029-.069-.028-.07-.029-.068-.024-.126-.034-.148-.034-.148-.001-.135-.011-.157-.001-.135-.002-.135-.001-.134-.001-.135.022-.144.021-.144.022-.144.022-.144.022-.145.022-.144.022-.144.021-.144.022-.144.045-.154.045-.153.045-.154.045-.154.045-.153.045-.154.045-.153.045-.154.08-.33.09-.308.09-.307.09-.307.09-.308.09-.307.09-.307.199-.568.185-.536.086-.252.063-.242.072-.219.072-.218.049-.21.018-.088.017-.089.161-.66.161-.661.16-.66.162-.662.16-.66.161-.661.161-.661.161-.66.16-.662.162-.66.184-.67.184-.67.354-1.309.354-1.308.354-1.308.378-1.317.354-1.308.354-1.308.355-1.308.17-.638.16-.66.171-.638.17-.638.161-.66.161-.661.05-.21.048-.21.05-.209.049-.209.049-.21.049-.209.13-.405.131-.405.131-.405.13-.405.132-.406.261-.81.262-.81.13-.405.131-.405.13-.406.132-.405.031-.12.031-.122.022-.144.022-.144.022-.144.045-.154.035-.177.013-.167.012-.167.012-.167.013-.168.012-.167.022-.144.008-.111-.042-.037-.052-.06-.019-.046-.019-.046-.028-.07-.029-.07-.015-.101-.015-.102.018-.089.018-.088.018-.088.05-.075.05-.075.074-.084.083-.061.083-.061.092-.038.093-.038.046-.02.046-.019.102-.014.154-.415zm.004 1.458l.046-.02.046-.018-.092.038zm.125-.025l.046-.019.023-.01-.07.03zM92.238 57.665l.056.004.055.004.066.027.065.028.065.027.065.027.042.037.043.036.051.06.042.037.052.06.052.06.028.07.029.069.028.069.029.07.005.078.005.079.006.079.005.079-.004.056-.004.055-.004.056-.004.056-.027.065-.041.098-.041.098-.041.098-.05.074-.05.075-.051.075-.05.075-.05.074-.088.117-.087.117-.087.117-.037.042-.037.042-.036.043-.037.042-.014.032-.013.033-.014.033-.013.032-.05.21-.049.209-.049.21-.049.209-.049.21-.049.209-.072.218-.072.22-.072.218-.082.196-.082.196-.082.196-.081.195-.082.196-.163.392-.164.391-.163.392-.164.391-.163.392-.163.391-.164.392-.327.783-.068.163-.068.163-.068.163-.068.163-.045.154-.045.154-.045.153-.045.154-.045.154-.045.153-.045.154-.045.154-.035.176-.035.177-.036.177-.035.177-.071.353-.071.354-.071.353-.071.354-.07.353-.072.354-.128.674-.018.088-.008.112-.053.265-.022.144-.012.167-.036.177-.035.177-.036.177-.017.088-.018.088-.018.089-.018.088-.017.089-.018.088-.018.088-.04.098-.041.098-.041.098-.05.075-.06.051-.06.052-.037.042-.06.052-.023.01-.023.009-.023.01-.024.009-.046.019-.046.019-.023.01-.07.028-.069.028-.07.029-.078.005-.079.006-.056-.004-.055-.005-.066-.027-.065-.027-.065-.027-.065-.027-.043-.037-.042-.037-.042-.037-.052-.06-.051-.06-.029-.069-.028-.07-.029-.068-.028-.07-.006-.079-.005-.079.004-.055.004-.056.004-.056.028-.065.027-.065.027-.066.027-.065.037-.042.037-.042.013-.033.014-.032.004-.056.004-.056.004-.056.004-.055.028-.066.021-.144.022-.144.022-.144.022-.144.022-.144.043-.289.032-.12.008-.112.128-.674.071-.354.071-.354.071-.353.07-.354.072-.353.094-.363.035-.177.036-.177.035-.176.059-.187.058-.186.059-.186.059-.186.058-.187.059-.186.058-.186.059-.186.058-.187.068-.163.069-.163.068-.163.068-.163.327-.783.163-.392.163-.391.164-.392.163-.391.14-.383.14-.382.14-.382.06-.186.081-.196.082-.195.058-.187.06-.186.058-.186.058-.186.059-.187.058-.186.059-.186.059-.186.058-.187.059-.186.049-.21.004-.055.027-.065.04-.098.042-.098.04-.098.051-.075.05-.075.05-.074.051-.075.05-.075.05-.075.088-.117.087-.116.064-.108.037-.042.036-.042-.01-.023-.028-.07-.028-.069-.006-.079.005-.056.004-.055.004-.056.027-.065.027-.066.028-.065.027-.065.036-.042.037-.042.037-.042.06-.052.06-.052.07-.028.068-.029.07-.028.07-.029.078-.005.056.004zM62.093 34.243l.088.017.056.005.065.027.098.04.075.051.075.05.051.06.042.037.02.046.009.023.028.07.029.069.01.023.018.046.02.047.009.023.005.079.01.023-.004.055-.004.056-.018.089-.018.088-.027.065-.027.066-.028.065-.027.065-.027.065-.054.13-.055.131-.054.13-.055.131-.054.13-.078.14-.122.295-.146.303-.068.163-.068.163-.068.163-.045.154-.055.13-.054.13-.055.131-.027.066-.027.065-.027.065-.005.056-.004.056-.004.055-.004.056-.014.033-.013.032-.014.033-.022.144-.021.144-.022.144-.022.144-.034.312-.034.311-.035.312-.043.288-.044.288-.067.298-.067.298-.066.297-.067.298-.067.298-.067.298-.067.297-.066.298-.067.298-.067.298-.067.297-.067.298-.066.298-.167.582-.166.582-.166.582-.166.582-.166.582-.153.549-.319 1.131-.319 1.131-.319 1.131-.318 1.132-.342 1.14-.342 1.141-.342 1.14-.342 1.141-.342 1.141-.342 1.14-.342 1.142-.352 1.117-.351 1.118-.351 1.117-.375 1.127-.375 1.127-.027.066-.027.065-.027.065-.018.089-.036.176-.035.177-.035.177-.026.2-.05.21-.049.208-.088.442-.089.442-.079.465-.04.233-.04.232-.039.233-.04.232-.039.233-.062.242-.063.242-.031.12-.032.122-.031.12-.032.122-.03.12-.042.099-.04.098-.041.098-.041.097-.041.098-.04.098-.042.098-.04.098-.041.098-.041.098-.041.098-.064.107-.064.107-.074.085-.073.084-.074.084-.05.075-.073.084-.083.061-.083.061-.093.039-.102.014-.102.015-.111-.008-.089-.018-.098-.04-.097-.041-.075-.05-.085-.074-.06-.083-.062-.083-.038-.093-.038-.092-.015-.102-.015-.102.009-.112.017-.088.041-.098.041-.098.05-.075.037-.042.037-.042.037-.042.036-.042.028-.065.027-.066.027-.065.027-.065.027-.065.028-.066.027-.065.027-.065.018-.088.018-.089.017-.088.018-.089.04-.097.019-.089.04-.098.018-.088.041-.098.018-.088.049-.21.049-.21.049-.209.05-.209.039-.232.04-.233.039-.232.088-.442.089-.442.089-.442.049-.21.049-.209.049-.21.049-.209.049-.21.059-.185.017-.089.018-.088.018-.088.018-.089.374-1.127.352-1.117.351-1.118.351-1.118.352-1.117.351-1.118.352-1.117.342-1.141.342-1.14.342-1.141.342-1.141.319-1.131.318-1.132.32-1.13.318-1.132.319-1.131.152-.55.167-.581.166-.582.166-.582.166-.582.167-.582.066-.298.067-.297.067-.298.067-.298.067-.298.066-.298.067-.297.067-.298.067-.298.067-.298.066-.297.044-.289.044-.288.043-.288.044-.288.044-.289.043-.288.021-.279.022-.144.022-.144.022-.144.021-.144-.005-.079.018-.088.017-.089.018-.088.018-.089.018-.088.017-.088.018-.089.018-.088.017-.088.045-.154.069-.163.068-.163.068-.164.068-.163.068-.163.068-.163.146-.303.122-.294.055-.13.054-.13.055-.131.04-.098-.038-.093-.038-.092-.015-.102-.014-.102.008-.112.018-.088.04-.098.041-.098.05-.075.074-.084.083-.061.083-.061.093-.038.069-.029.07-.028.078-.006.023-.01.102-.014.023-.01.056.005zM47.233 43.136l.088.017.089.018.075.05.074.05.075.051.052.06.051.06.038.092.038.093.038.092.006.08.005.078-.017.089-.018.088-.018.088-.05.075-.05.075-.051.075-.037.042-.036.042-.037.042-.037.042-.027.065-.05.075-.05.075-.051.075-.05.074-.041.098-.041.098-.041.098-.041.098-.04.098-.042.098-.04.098-.055.13-.054.13-.055.131-.054.13-.11.262-.099.284-.1.284-.099.284-.09.307-.09.308-.09.307-.09.307-.09.308-.08.33-.17.638-.17.637-.17.638-.09.307-.09.307-.09.308-.1.284-.1.284-.076.275-.401 1.192-.393 1.215-.212.601-.203.624-.203.624-.203.624-.203.625-.203.624-.203.624-.18.614-.18.615-.18.614-.18.615-.09.307-.09.307-.09.308-.089.307-.09.307-.09.307-.09.308-.09.307-.09.307-.09.307-.09.308-.057.32-.057.321-.057.321-.058.321-.057.321-.057.321-.057.32-.058.322-.057.32-.057.322-.058.32-.057.321-.057.321-.034.312-.035.311-.034.311-.034.312-.034.311-.034.312-.034.31-.035.312-.034.312-.034.311-.018.088-.017.089-.018.088-.05.075-.05.075-.06.051-.06.052-.084.061-.092.038-.093.038-.101.015-.08.005-.078.006-.089-.018-.088-.018-.088-.017-.075-.05-.075-.051-.052-.06-.051-.06-.061-.083-.038-.092-.038-.093-.015-.102-.006-.079-.005-.078.034-.312.034-.311.034-.312.035-.311.034-.311.034-.312.034-.311.057-.321.058-.32.057-.322.057-.32.058-.322.057-.32.057-.321.057-.321.058-.321.057-.321.057-.32.058-.322.057-.32.057-.322.08-.33.081-.33.08-.33.08-.331.081-.33.08-.33.081-.331.08-.33.081-.331.08-.33.09-.308.09-.307.09-.307.17-.638.17-.638.204-.624.203-.624.203-.624.203-.624.203-.624.203-.624.203-.624.203-.624.202-.624.393-1.215.402-1.193.085-.251.077-.275.076-.275.1-.284.09-.307.09-.307.17-.638.17-.638.17-.637.08-.33.081-.331.08-.33.09-.308.09-.307.09-.307.09-.307.09-.308.1-.284.099-.284.054-.13.055-.131.054-.13.055-.131.054-.13.055-.131.054-.13.055-.131.064-.108.064-.107.064-.107.064-.108.064-.107.064-.107.064-.108.064-.107.073-.085.073-.084.074-.084.073-.084.06-.052.06-.052.093-.038.092-.038.093-.038.078-.005.08-.005zM34.482 50.648l.079-.005.065.027.065.027.066.028.065.027.065.027.042.037.052.06.051.06.052.06.029.069.028.07.029.069.005.078.005.08.006.078.005.08-.017.087-.028.066-.027.065-.027.065-.05.075-.014.033-.027.065-.064.107-.055.13-.077.14-.068.164-.16.336-.145.303-.096.228-.027.066-.014.032-.054.13-.045.154-.045.154-.045.154-.045.153-.045.154-.045.153-.045.154-.076.275-.076.274-.067.298-.067.298-.067.298-.067.297-.066.298-.067.298-.134.596-.124.618-.053.265-.053.265-.053.266-.054.265-.03.255-.03.256-.03.256-.03.255-.03.256-.03.255-.03.256-.03.256-.06.511-.06.511-.05.535-.052.534-.05.534-.05.535-.051.534-.051.535-.03.255-.03.256-.03.255-.02.28-.023.143-.012.168-.035.176-.036.177-.035.177-.036.177-.07.353-.095.363-.094.363-.035.177-.036.177-.035.176-.036.177-.035.177-.035.177-.036.176-.035.177-.013.167-.012.168.005.079.006.078.005.08.006.078.005.08.005.078.006.079.005.079-.004.055-.004.056-.004.056-.004.056-.004.055-.005.056.02.046.019.047.019.046.019.046.019.046.019.047.028.069.005.079.006.079.005.079.006.079-.018.088-.027.065-.028.065-.027.066-.05.074-.06.052-.06.052-.06.051-.07.029-.068.028-.07.029-.079.005-.079.006-.078.005-.08.005-.088-.017-.065-.027-.065-.028-.065-.027-.075-.05-.052-.06-.051-.06-.052-.06-.029-.07-.028-.069-.029-.069-.038-.092-.038-.093-.038-.092-.015-.102-.015-.102-.014-.102-.015-.102-.015-.102-.015-.102-.015-.102-.015-.102-.015-.102-.015-.102-.015-.102.009-.112.008-.111.008-.112.018-.088.008-.112.026-.2.026-.2.026-.2.026-.2.026-.2.026-.2.026-.199.026-.2.025-.2.036-.176.084-.387.095-.363.07-.353.045-.154.045-.153.022-.145.022-.144.022-.144.031-.12.03-.256.03-.256.03-.256.03-.255.051-.535.05-.534.051-.534.05-.535.051-.534.051-.535.05-.534.051-.534.03-.256.03-.256.03-.255.03-.256.03-.256.03-.255.054-.265.053-.265.053-.266.053-.265.054-.265.053-.265.124-.619.133-.595.067-.298.067-.298.067-.297.067-.298.066-.298.067-.298.067-.297.09-.308.045-.153.045-.154.045-.154.045-.153.045-.154.045-.154.045-.153.068-.163.027-.066.04-.097.11-.261.145-.304.16-.335.091-.173.068-.163.078-.14.077-.14.064-.108.027-.065.028-.065.036-.042.05-.075.024-.01.037-.042.036-.042.037-.042.06-.052.07-.028.069-.029.07-.028.078-.006.079-.005z"/><path fill="#68B3E8" d="M75.452 33.535l.112.008.111.008.112.009.111.008.056.004.056.004.065.027.065.027.065.028.066.027.065.027.065.027.065.028.066.027.042.037.075.05.042.037.051.06.01.023.032.013.01.023.01.024.018.046.02.046.009.023.028.07.01.023.019.046.019.046.01.023.028.07.01.023.028.07.01.022.005.08-.004.055.005.079-.004.056.089.017.088.018.098.04.098.042.065.027.042.037.065.027.042.037.043.036.042.037.042.037.042.037.042.036.042.037.02.046.018.047.02.046.018.046.02.046.018.047.02.046.018.046-.004.056-.004.055.01.024-.005.055-.004.056-.013.033-.027.065-.005.056-.027.065-.027.065-.027.066-.028.065-.027.065-.027.065-.027.066-.05.074-.088.117-.11.127-.11.126-.1.15-.125.159-.123.159-.124.159-.124.159-.124.159-.124.159-.124.159-.133.136-.05.074-.004.056-.041.098-.05.075-.051.075-.05.074-.05.075-.06.052-.06.051-.06.052-.06.052-.06.051-.06.052-.06.052-.07.028-.068.029-.047.019-.073.084-.097.094-.096.093-.106.071-.083.061-.06.052-.047.019-.175.099-.176.1-.175.098-.175.1-.176.099-.175.099-.338.166-.337.165-.337.166-.338.166-.36.175-.37.152-.37.152-.37.152-.37.152-.37.152-.37.152-.162.067-.027.065-.027.066-.027.065-.028.065-.036.042-.037.042-.037.042-.037.043-.023.01-.046.018-.046.02-.047.018-.129.08-.115.048-.116.047-.116.048-.115.047-.116.048-.115.047-.116.048-.116.048-.115.047-.116.048-.023.01-.046.018-.116.048-.115.047-.116.048-.116.047-.115.048-.116.047-.125.025-.125.024-.125.024-.102.015-.102.015-.102.015-.102.015-.102.015-.204.03-.204.03-.204.03-.204.03-.08.005-.18.02-.472.167-.703.262-.703.262-.093.038-.115.048-.255.104-.3.124-.347.142-.185.076-.185.076-.185.076-.208.086-.208.085-.208.086-.218.062-.218.063-.217.062-.218.063-.125.024-.102.015-.102.015-.102.015-.102.015-.102.015-.102.015-.102.014-.102.015-.102.015-.102.015-.102.015-.102.015-.102.015-.111-.008-.112-.009-.111-.008-.112-.008-.111-.008-.112-.008-.111-.009-.098-.04-.098-.041-.098-.041-.098-.041-.098-.04-.065-.028-.042-.037-.042-.037-.042-.036-.043-.037-.042-.037-.042-.037-.042-.036-.052-.06-.051-.06-.029-.07-.028-.069-.029-.07-.028-.069-.029-.069-.028-.07-.006-.078-.005-.079-.01-.023-.042-.037-.051-.06-.052-.06-.052-.06-.028-.069-.029-.07-.028-.069-.029-.069-.005-.079-.006-.079.005-.055.004-.056.027-.065.027-.066.027-.065.037-.042.037-.042.037-.042.036-.042.037-.043.037-.042.046-.019.07-.028.046-.02.083-.06.115-.048.139-.057.162-.067.185-.076.383-.184.024-.01.11-.126.133-.136.133-.136.157-.145.156-.146.18-.155.18-.155.18-.155.179-.154.359-.31.359-.31.346-.277.322-.268.502-.423.023-.01.037-.041.037-.042.036-.043.037-.042.037-.042.037-.042.046-.019.06-.052.166-.122.166-.122.166-.123.166-.122.166-.122.165-.122.166-.123.166-.122.166-.122.166-.123.176-.099.175-.099.176-.1.175-.098.176-.1.175-.099.176-.099.129-.08.013-.033.028-.065.027-.065.027-.065.027-.066.037-.042.06-.051.06-.052.06-.052.06-.051.06-.052.06-.052.06-.051.096-.094.096-.094.12-.103.13-.08.129-.08.129-.08.129-.08.13-.08.128-.08.13-.081.138-.057.14-.057.138-.057.139-.057.138-.057.14-.057.138-.057.139-.057.138-.057.139-.057.116-.048.023-.01.139-.057.138-.057.139-.057.139-.057.138-.057.14-.057.138-.057.139-.057.138-.057.14-.057.286-.09.287-.092.287-.09.287-.092.287-.09.287-.092.296-.067.297-.068.296-.068.297-.068.296-.068.57-.126.57-.126.125-.024.125-.025.32-.077.171-.043.172-.044.102-.015.102-.015.102-.015.102-.015.102-.014.102-.015.111.008.093-.038.111.008-.204.03zm.009 3.375l.046-.019.06-.052-.106.071zM51.962 47.274l.065.027.032.013.033.014.033.014.032.013.033.014.033.014.069-.029.023-.01.023-.009.023-.01.047-.019.046-.019.023-.009.023-.01.033.014.032.014.033.013.033.014.032.014.033.013.032.014.033.013.033.014.032.014.033.013.033.014.032.013.033.014.033.014.032.013.033.014.01.023.009.023.019.046.019.047.019.046.019.046.019.046.019.047.019.046.019.046.01.023.018.047.01.023-.014.032-.013.033-.014.033-.014.032-.013.033-.014.032-.013.033-.014.033-.014.032-.013.033-.014.033-.014.032-.013.033-.014.032-.013.033-.014.033-.014.032-.023.01-.023.01-.023.009-.046.019-.093.038-.092.038-.116.047-.29.147-.163.067.01.023.01.023.009.023.01.023.009.023.01.023.009.024.01.023-.014.032-.014.033-.014.033-.013.032-.014.033-.013.032-.014.033-.014.033-.013.032-.014.033-.013.033-.014.032-.014.033-.013.032-.014.033-.014.033-.013.032-.023.01-.023.01-.024.009-.023.01-.023.009-.023.01-.023.009-.023.01-.046.018-.047.02-.023.009-.023.01-.07.028-.092.038-.079.005-.078.006-.08.005-.078.006-.158.01-.158.011-.079.005-.023.01-.115.048-.116.047-.139.057-.138.057-.14.057-.138.057-.139.057-.138.057-.14.057-.138.057-.139.057-.138.057-.139.057-.148.034-.148.034-.149.034-.148.034-.148.034-.148.034-.08.005-.078.006-.08.005-.078.005-.079.006-.079.005-.079.006-.078.005-.08.005-.078.006-.089-.018-.088-.018-.056-.004-.065-.027-.065-.027-.033-.014-.032-.013-.033-.014-.033-.014-.01-.023-.032-.013-.032-.014-.033-.014-.033-.013-.032-.014-.033-.013-.01-.024-.009-.023-.01-.023-.009-.023-.01-.023-.009-.023-.01-.023-.009-.023-.01-.024-.009-.023-.01-.023-.019-.046-.019-.046-.01-.023-.009-.024-.01-.023-.009-.023-.01-.023-.009-.023-.01-.023-.009-.023-.01-.023-.009-.024-.01-.023.014-.032.014-.033.014-.033.013-.032.014-.033.014-.032.013-.033.014-.033.013-.032.014-.033.014-.033.013-.032.014-.033.014-.032.013-.033.014-.033.036-.042.06-.051.06-.052.083-.061.083-.061.046-.02.074-.084.073-.084.083-.061.083-.061.083-.061.083-.062.083-.06.083-.062.093-.038.092-.038.093-.038.092-.038.093-.038.092-.038.093-.038.092-.038.093-.038.092-.038.093-.038.194-.053.195-.053.217-.062.148-.034.024-.01.115-.047.139-.057.139-.057.092-.038.139-.057.185-.076.185-.077.185-.076.185-.076.092-.038.093-.038.092-.038.093-.038.102-.015.102-.014.102-.015.102-.015.102-.015.079-.006.023-.01.023-.009.023-.01.033.015zM86.925 17.06l.055.004.056.005.033.013.055.004.056.004.033.014.032.014.033.013.033.014.032.013.033.014.033.014.032.013.033.014.042.037.084.073.085.074.051.06.094.096.07.106.071.106.07.106.072.107.042.036.032.014.033.013.033.014.032.014.033.013.065.028.033.013.032.014.033.013.01.024.032.013.033.014.032.013.052.06.052.06.051.06.061.083.062.083.038.092.028.07.029.07.028.069.029.069.028.07.029.069.034.148.034.148.033.148.034.149.025.125.024.125.03.204.019.046.01.023.014.102.025.125.024.125.025.126.024.125.024.125.025.125.001.134.001.135.002.135.01.023.029.204.03.204.03.204.006.213.007.214.007.213.006.214.007.213.007.214.006.213.007.214.007.213.006.214-.019.413-.02.414-.018.413-.02.413-.028.39-.003.19-.003.191-.003.19-.003.191-.003.19-.002.19-.003.191.02.181.02.18.02.182.02.18.021.181.02.181.006.08.015.101.005.08.02.045.018.047.038.092.048.116.047.115.048.116.047.116.025.125.072.24.024.125.015.102.015.102.005.08-.004.055.01.023-.004.056-.005.056-.004.055-.004.056-.004.056-.027.065-.027.065-.028.066-.036.042-.037.042-.037.042-.036.042-.037.042-.046.02-.047.018-.046.02-.046.018-.046.02-.056-.005-.056-.004-.056-.004-.055-.004-.056-.004-.056-.004-.065-.027-.065-.028-.043-.036-.042-.037-.042-.037-.042-.037-.042-.036-.042-.037-.02-.046-.018-.047-.01-.023-.01-.023-.009-.023-.019-.046-.037.042-.036.042-.047.02-.046.018-.046.02-.046.018-.047.02-.046.018-.056-.004-.055-.004-.056-.004-.056-.004-.056-.004-.055-.005-.033-.013-.033-.014-.032-.013-.033-.014-.032-.014-.01-.023-.042-.036-.042-.037-.01-.023-.032-.014-.033-.014-.042-.036-.052-.06-.051-.06-.029-.07-.028-.069-.071-.106-.048-.115-.047-.116-.048-.116-.047-.115-.048-.116-.057-.139-.057-.138-.057-.14-.057-.138-.057-.139-.081-.263-.082-.264-.072-.241-.062-.218-.053-.194-.034-.148-.005-.08-.006-.078-.02-.181-.01-.158-.012-.157-.01-.158-.011-.158.012-.167.012-.167.013-.168.012-.167.012-.167.013-.167.012-.168.012-.167.013-.167.012-.167.012-.168.013-.167.035-.177.013-.167-.044-.171-.068-.297-.067-.296-.068-.297-.068-.296-.068-.297-.145-.616-.145-.616-.145-.616-.122-.626-.01-.023-.01-.023.005-.056-.006-.078-.005-.08-.006-.078-.005-.079.018-.088.018-.089.008-.111.008-.112.008-.111.008-.112.032-.12.031-.122.031-.12.032-.122.031-.12.031-.122.032-.12.031-.122.027-.065.028-.065.027-.066.027-.065.027-.065.028-.065.027-.066.05-.074.05-.075.05-.075.06-.052.037-.042.024-.01.023-.009.023-.01.023-.009.023-.01.023-.009.046-.019.047-.019.023-.01.046-.018.046-.02.023-.009.047-.019.055.004.024-.01.055.005.056.004z"/><path fill="#0775C4" d="M82.05 20.064l.233.04.22.072.204.105.169.147.155.18.132.188.085.208.063.218.016.237-.017.223-.04.232-.071.22-.014.032-.091.172-.014.033-.1.15-.024.009-.133.136-.023.01-.166.122-.023.01-.13.08-.023.009-.161.066-.024.01-.115.047-.07.029-.125.024-.125.025-.102.015-.102.015H81.5l-.135.002-.056-.004-.023.01-.092.038-.093.038-.07.028-.152.09-.152.09-.152.09-.176.098-.175.1-.176.099-.175.099-.342.221-.341.222-.342.221-.318.212-.318.212-.318.212-.319.212-.318.212-.318.212-.614.414-.613.415-.614.414-1.25.838-.637.424-.636.424-.637.424-.318.212-.319.212-.318.212-.318.212-.319.212-.318.212-.328.189-.35.198-.352.198-.526.298-.176.099-.198.109-.176.099-.364.23-.365.232-.364.23-.365.232-.364.23-.355.255-.355.254-.356.254-.355.254-.355.254-.733.518-.733.517-.733.518-.734.518-.378.263-.378.264-.378.264-.378.263-.378.264-.379.263-.387.24-.388.241-.388.24-.387.241-.199.109-.199.109-.198.108-.199.109-.83.477-.832.477-.822.5-.821.5-.822.5-.821.5-.822.5-.822.5-.821.5-.822.5-.822.5-.821.5-1.61 1.013-1.611 1.013-1.61 1.014-1.612 1.013-3.22 2.027-1.611 1.014-1.61 1.013-1.612 1.014-1.61 1.013-.563.34-.563.34-.564.34-.563.339-.563.34-.563.34-.563.339-.563.34-1.136.656-1.136.656-1.113.646-1.112.647-1.113.647-.54.33-.54.33-.54.33-.54.33-.54.33-.54.33-.54.33-.54.33-.54.331-.54.33-.54.33-.531.354-.53.353-.531.353-.046.019-.047.019-.036.042-.047.02-.083.06-.083.061-.082.062-.074.084-.073.084-.074.084-.073.085-.074.084-.073.084-.097.094-.097.094-.096.094-.184.21-.38.454-.198.243-.11.127-.11.126-.11.127.11.008.27-.003.292-.012.158-.01.158-.011.158-.011.167.012.167.013.167.012.168.012.167.013.167.012.177.035.088.018.089.018.088.018.088.017.21.05.21.048.208.05.21.049.21.049.209.049.209.049.21.049.209.049.21.049.209.049.209.05.21.048.232.04.232.04.233.039.432.065.433.066.455.056.456.056.455.056.456.056.455.056.456.056.924.08.925.079.934.102.479.047.478.046.479.047.479.046.478.047.456.056.465.079.465.079.232.04.233.04.232.039.233.04.41.074.408.075.41.075.4.052.422.043.423.042.423.042.423.043.423.042.423.043.423.042.422.042.423.043.423.042.423.043.423.042.423.042.446.033.86.052 1.741.095.883.043.859.052.446.033.446.033.446.033.446.033.748.043.748.044.748.044.747.044.748.044.748.044.748.044.748.044.748.044.748.044.748.044.747.044.739.02.738.021.739.021.738.021 1.51.055 1.5.032 1.499.032 1.5.033 3.01.087 1.499.032 1.5.032.85.03.85.028.85.03.85.028.85.03.85.028.849.03.85.028.85.03.85.029.85.029.85.029.85.029.85.029.849.029.85.029.85.029.826.038.827.039.836.061.837.062.836.062.836.061.836.062.837.062.836.061.836.062.837.062.836.061.836.062.836.062.837.061.59.055.59.055.58.031.581.032.604.022.604.022.301.011.302.011.302.011.302.011.302.011.302.012.302.01.302.012.301.01.293-.011.292-.012.293-.013.292-.012.292-.012.293-.012.292-.012.292-.012.293-.012.292-.012.292-.012.102-.015.112.008.111.008.112.009.111.008.112.008.088.018.089.018.176.035.177.035.288.044.121.031.112.009.056.004.032.013.033.014.023-.01.102-.014.237-.017.223.017.232.04.22.072.204.104.169.147.155.18.132.19.085.207.063.218.016.236-.017.223-.04.233-.071.219-.105.205-.147.169-.18.155-.189.131-.208.086-.092.038-.149.034-.148.034-.148.034h-.135l-.134.002-.112-.008-.111-.008-.112-.008-.111-.009-.089-.017-.088-.018-.177-.036-.177-.035-.297-.067-.121-.031-.121-.032-.056-.004-.056-.004-.033-.013-.032-.014-.023.01-.023.009-.024.01-.292.012-.292.012-.293.012-.292.012-.292.012-.293.012-.292.012-.292.012-.302-.01-.302-.012-.302-.011-.302-.011-.302-.011-.302-.011-.302-.011-.301-.011-.302-.011-.302-.011-.302-.011-.302-.011-.604-.023-.613-.045-.613-.045-.613-.045-.614-.045-.59-.055-.836-.062-.836-.061-.837-.062-.836-.062-.836-.061-.836-.062-.837-.062-.836-.061-.836-.062-.836-.062-.837-.061-.836-.062-.827-.039-.826-.038-.827-.039-.827-.038-.827-.039-.826-.038-.827-.039-.827-.038-.827-.039-.85-.029-.85-.029-.85-.029-.85-.03-.85-.028-.849-.03-.85-.028-.85-.03-.85-.028-.85-.03-.85-.028-1.5-.032-1.499-.033-3.01-.087-1.5-.032-1.499-.032-1.51-.055-1.509-.056-.761-.01-.762-.012-.77-.035-.772-.034-.77-.034-.772-.035-.77-.034-.749-.044-.747-.044-.748-.044-.748-.044-.748-.044-.748-.044-.748-.044-.748-.044-.748-.044-.422-.042-.423-.043-.423-.042-.414-.02-.859-.051-.86-.053-1.741-.094-.883-.043-.446-.033-.446-.033-.446-.033-.446-.033-.446-.032-.446-.033-.446-.033-.446-.033-.446-.033-.446-.033-.446-.033-.455-.056-.433-.065-.432-.066-.432-.065-.433-.066-.432-.065-.433-.066-.232-.04-.233-.039-.232-.04-.233-.04-.455-.055-.456-.056-.455-.056-.456-.056-.455-.056-.456-.056-.455-.056-.456-.056-.924-.08-.925-.079-.925-.08-.478-.046-.456-.056-.455-.056-.456-.056-.455-.056-.456-.056-.455-.056-.465-.079-.233-.04-.232-.04-.233-.039-.232-.04-.233-.039-.232-.04-.233-.039-.232-.04-.233-.04-.232-.039-.233-.04-.232-.039-.233-.04-.242-.062-.242-.063-.21-.049-.055-.004-.033-.014-.032-.013-.033-.014-.088-.017-.089-.018-.088-.018-.112-.008-.111-.008-.112-.009-.111-.008-.112-.008-.134.001-.135.002-.27.002-.291.012-.302-.01-.168-.013-.167-.013-.167-.012-.167-.012-.168-.013-.167-.012-.167-.012-.177-.036-.177-.035-.088-.018-.088-.018-.089-.017-.088-.018-.089-.018-.088-.017-.098-.041-.098-.041-.098-.041-.097-.04-.098-.042-.108-.064-.117-.087-.084-.073-.094-.097-.093-.096-.071-.107-.07-.106-.062-.083-.038-.092-.038-.093-.047-.115-.038-.093-.025-.125-.015-.102-.01-.158-.002-.134-.001-.135-.001-.134.008-.112.008-.111.008-.112.008-.111.018-.089.018-.088.04-.098.042-.098.04-.098.041-.098.041-.098.041-.098.04-.097.051-.075.05-.075.051-.075.073-.084.064-.107.088-.117.096-.094.143-.113.097-.094.096-.093.097-.094.096-.094.097-.094.097-.093.096-.094.097-.094.096-.094.184-.21.381-.454.197-.244.11-.126.11-.126.111-.127.11-.126.11-.127.11-.126.134-.136.133-.136.143-.113.143-.112.143-.113.143-.113.083-.061.083-.061.083-.061.083-.062.553-.362.53-.354.531-.353.554-.363.563-.34.563-.339.563-.34.564-.34.563-.339.563-.34.563-.34.563-.339.563-.34.564-.34 1.112-.646 1.113-.646 1.113-.647 1.112-.647 1.113-.646.563-.34.563-.34.564-.34.563-.339.563-.34.54-.33.54-.33.54-.33 1.597-.98 1.587-1.005 1.611-1.013 1.61-1.014 3.222-2.027 1.61-1.013 1.611-1.014 1.61-1.013 1.611-1.014.822-.5.821-.5.822-.5.822-.5.821-.5.822-.5.821-.5.822-.5.822-.5.821-.5.822-.5.831-.476.199-.109.198-.109.199-.108.175-.1.365-.23.364-.231.365-.231.365-.231.364-.231.355-.254.355-.255.355-.254.355-.254.355-.254.734-.517.733-.518.733-.518.733-.518.379-.263.378-.264.378-.263.378-.264.378-.263.378-.264.379-.264.387-.24.388-.24.388-.241.189-.132.198-.109.199-.108.198-.109.328-.189.328-.189.328-.188.328-.19.328-.188.318-.212.318-.212.319-.212.318-.212.318-.212.637-.424.613-.414.614-.415 1.25-.838.637-.424.636-.424.637-.424.318-.212.319-.211.318-.212.318-.212.318-.212.319-.212.341-.222.342-.221.364-.231.199-.109.198-.109.199-.108.199-.109.198-.109.199-.108.198-.109.116-.047.116-.048.115-.047.116-.048.115-.048.14-.057.115-.047.125-.024.125-.025.102-.015.102-.015.102-.015h.135l.055.003.07-.028.217-.063.237-.016-.216.197zm22.003 54.178l-.046.02.046-.02zM80.56 20.84l-.028.065.101-.15-.073.085z"/><path fill="#0775C4" d="M92.37 6.901l.08-.005.088.018.089.017.088.018.088.018.066.027.065.027.075.05.074.051.075.05.075.05.075.051.051.06.052.06.052.06.051.06.052.06.028.069.029.07.028.069.029.069.028.07.006.078.005.08.006.078.005.079.005.079.006.079-.018.088-.018.088-.017.089-.018.088-.018.088-.027.066-.05.074-.05.075-.051.075-.05.075-.05.075-.06.051-.06.052-.06.051-.06.052-.06.052-.06.051-.07.029-.069.028-.07.029-.068.028-.07.029-.046.019-.046.019-.056-.004-.079.005-.102.015-.111-.008-.237.016-.246-.007-.246-.007-.214.007-.079.005-.055-.004-.343.087-.218.062-.217.063-.241.072-.24.072-.126.024-.125.025-.116.047-.115.048-.116.047-.116.048-.115.047-.116.048-.092.038-.093.038-.092.038-.093.038-.092.038-.07.028-.069.029-.07.028-.069.029-.036.042-.024.01-.023.01-.023.009-.023.01-.216.196-.24.207-.253.239-.143.113-.133.136-.133.135-.134.136-.133.136-.133.136-.134.136-.133.136-.133.136-.134.136-.133.136-.133.136-.134.136-.123.159-.124.159-.124.159-.124.159-.124.159-.124.159-.123.159-.124.159-.124.159-.124.159-.124.159-.124.159-.123.159-.115.182-.114.182-.091.173-.092.173-.09.172-.092.173-.091.172-.091.173-.068.163-.05.075-.051.075-.027.065-.028.065-.027.066-.027.065-.027.065-.028.065-.027.066-.027.065-.027.065-.027.065-.028.066-.027.065-.027.065-.027.065-.028.066-.027.065-.027.065-.004.056-.004.056-.004.055-.005.056-.004.056-.004.056-.004.055-.004.056-.004.056-.004.056-.004.055-.004.056-.005.056-.004.056-.004.055-.004.056-.004.056-.004.056.019.046.019.046.019.046.019.047.019.046.019.046.019.046.019.047.029.069.028.07.029.069.028.07.005.078.006.079.005.079.006.079.005.078-.018.089-.017.088-.018.089-.018.088-.018.088-.027.066-.027.065-.05.075-.05.074-.051.075-.05.075-.06.052-.06.051-.06.052-.06.051-.06.052-.06.052-.069.028-.07.029-.069.028-.07.029-.068.028-.08.006-.078.005-.08.006-.078.005-.079.005-.088-.017-.089-.018-.088-.018-.088-.018-.089-.017-.065-.028-.065-.027-.075-.05-.075-.05-.075-.05-.074-.051-.075-.05-.052-.06-.051-.06-.052-.06-.052-.06-.051-.06-.029-.07-.028-.069.152.37-.038-.092-.048-.116-.047-.115-.048-.116-.024-.125-.025-.125-.024-.125-.024-.125L79.97 20l-.024-.125-.025-.125-.024-.125-.024-.125-.002-.135-.001-.134-.001-.135-.002-.135.009-.111.008-.112.008-.111.008-.112.009-.111.008-.112.008-.111.008-.112.008-.111.032-.121.031-.121.031-.121.032-.121.031-.121.031-.121.032-.121.031-.121.032-.121.03-.121.032-.121.032-.121.03-.121.042-.098.04-.098.041-.098.041-.098.041-.098.041-.097.064-.108.105-.205.105-.205.104-.206.128-.214.128-.215.128-.215.128-.215.128-.215.138-.191.137-.192.137-.192.138-.191.137-.192.138-.191.137-.192.138-.192.137-.191.147-.169.147-.169.147-.168.147-.169.147-.168.147-.169.147-.168.147-.169.147-.168.147-.169.156-.145.157-.146.156-.145.157-.145.156-.146.157-.145.133-.136.133-.136.276-.249.277-.248.262-.217.06-.051.06-.052.06-.051.083-.062.129-.08.152-.09.153-.09.152-.089.152-.09.139-.056.139-.057.139-.058.138-.057.139-.057.139-.057.138-.057.14-.057.138-.057.148-.034.148-.034.149-.033.148-.034.264-.082.264-.081.25-.05.25-.048.445-.102.079-.005.102-.015.125-.024.134-.002h.135l.27-.003.268-.003.237-.016.19.003.024-.01.046-.019.079-.005.079-.006-.052-.06zm-.588.08l-.139.057.07-.028.07-.029.078-.005.023-.01-.102.015zM105.066 73.286l.088.017.088.018.089.018.088.017.098.041.098.041.075.05.075.05.074.051.075.05.075.05.051.06.062.084.06.083.062.083.061.083.052.06.06.083.052.06.052.06.075.05.075.05.074.05.075.05.075.051.075.05.074.05.075.051.075.05.075.05.074.051.075.05.075.05.075.051.075.05.074.05.075.051.075.05.098.042.098.04.097.041.098.041.098.04.098.042.098.04.098.041.098.041.098.041.098.041.097.04.098.042.098.04.098.041.098.041.098.041.098.041.12.031.122.032.12.031.122.031.12.032.122.031.12.031.122.032.12.031.122.031.12.032.122.031.12.031.122.032.12.031.112.008.112.009.111.008.112.008.111.008.112.008.255.03.247.007.246.007.246.007.246.007.246.007.246.007.246.007.246.007.237-.016.237-.016.236-.017.237-.016.237-.016.236-.016.26-.026.227-.04.227-.038.227-.04.227-.039.227-.04.228-.039.227-.039.217-.062.218-.063.217-.062.218-.063.218-.062.217-.063.208-.085.209-.086.208-.085.092-.038.093-.038.102-.015.102-.015.102-.015.102-.015.088.018.088.018.089.017.088.018.088.018.098.04.098.041.075.05.075.051.075.05.074.05.075.051.061.083.061.083.061.083.062.083.038.093.038.092.038.093.038.092.015.102.015.102.014.102.015.102.006.079-.018.088-.018.089-.017.088-.018.089-.018.088-.04.098-.042.098-.05.074-.05.075-.05.075-.051.075-.05.074-.083.062-.083.06-.083.062-.083.061-.093.038-.092.038-.232.095-.254.105-.254.104-.264.082-.264.081-.264.082-.264.081-.263.082-.274.058-.273.058-.274.058-.273.059-.273.058-.274.058-.282.036-.283.035-.283.035-.283.035-.283.035-.292.012-.293.013-.292.012-.292.012-.293.012-.292.012-.293.012-.301-.011-.302-.011-.302-.011-.279-.02-.279-.021-.278-.02-.145-.023-.144-.022-.144-.021-.144-.022-.144-.022-.144-.022-.144-.022-.144-.022-.145-.021-.144-.022-.144-.022-.144-.022-.144-.022-.144-.022-.144-.021-.144-.022-.145-.022-.144-.022-.153-.045-.13-.054-.131-.055-.13-.054-.131-.055-.13-.054-.131-.055-.13-.054-.131-.055-.131-.054-.13-.055-.131-.054-.13-.055-.131-.054-.13-.054-.131-.055-.13-.054-.131-.055-.13-.054-.131-.055-.13-.054-.131-.055-.107-.064-.117-.087-.117-.087-.117-.087-.117-.087-.117-.087-.117-.087-.117-.087-.117-.087-.117-.088-.116-.087-.117-.087-.117-.087-.117-.087-.094-.097-.094-.096-.093-.097-.094-.096-.094-.097-.094-.097-.094-.096-.093-.097-.094-.096-.094-.097-.061-.083-.061-.083-.061-.083-.038-.092-.038-.093-.038-.092-.038-.093-.015-.102-.015-.102-.015-.102-.015-.102.018-.088.017-.089.018-.088.018-.088.018-.089.04-.098.041-.097.05-.075.051-.075.05-.075.05-.075.051-.074.06-.052.083-.061.083-.061.083-.061.092-.038.093-.038.092-.038.093-.038.102-.015.102-.015.102-.015.102-.015z"/><path fill="#0775C4" d="M91.831 6.772l.112.008.111.008.056.004.12.032.122.031.154.045.153.045.154.045.153.045.098.04.098.042.098.04.098.041.098.041.075.05.074.051.075.05.075.05.075.051.074.05.075.05.127.111.126.11.136.134.126.11.127.11.103.12.103.12.104.12.103.119.103.12.061.083.061.083.071.106.048.115.047.116.038.092.038.093.038.092.038.093.038.092.038.093.038.092.015.102.015.102.015.102.015.102.03.204.03.204.03.204.03.204.029.204.03.204.006.214.007.213.007.214.006.213.007.214.007.213.006.214.007.213.007.214.004.404.017.37.008.349-.01.302.002.269.012.292.002.27.012.292.003.27.002.268.013.293.012.292.012.293.012.292.012.292.012.293.012.292.012.292.012.293.012.292.035.283.036.283.035.283.035.283.035.282.035.283.036.283.035.283.035.283.035.283.035.283.036.283.035.282.035.283.035.283.058.273.059.274.058.273.058.274.059.273.058.273.058.274.059.273.058.273.058.274.059.273.058.273.058.274.059.273.058.273.081.264.082.264.081.264.082.264.081.264.082.264.081.263.081.264.082.264.081.264.082.264.081.264.082.264.104.254.105.254.104.255.105.254.105.254.104.255.152.37.152.37.152.37.152.37.153.37.129.379.128.38.13.379.128.38.13.379.128.38.13.379.128.38.13.379.128.379.13.38.128.379.13.38.234.768.235.768.235.769.479 1.56.235.768.234.769.235.768.235.768.235.769.129.38.129.379.129.38.129.379.129.38.129.379.129.38.129.379.129.379.129.38.129.379.128.38.13.379.152.37.152.37.152.37.152.37.152.37.152.37.152.37.152.37.152.37.175.36.176.36.175.36.175.361.109.199.108.198.11.2.108.198.109.198.108.199.109.198.109.199.108.199.109.198.132.19.131.188.132.19.132.189.132.189.132.189.131.189.132.189.132.189.132.19.132.188.131.19.132.188.155.18.155.18.155.18.155.179.155.18.155.179.155.18.155.179.155.18.154.18.155.179.155.18.155.179.333.35.333.35.333.349.333.35.333.35.333.349.333.35.333.35.333.349.333.35.68.666.679.667.094.097.093.096.117.087.117.087.117.087.117.088.117.087.117.087.117.087.117.087.266.188.266.188.276.21.276.211.15.101.15.1.149.102.159.123.159.124.159.124.159.124.159.124.136.133.136.133.136.134.145.156.146.157.06.083.062.083.07.106.071.106.07.106.071.106.071.106.048.116.047.115.048.116.024.125.024.125.025.125.024.125.002.135v.135l-.007.111-.009.112-.008.111-.008.112-.04.098-.042.097-.04.098-.041.098-.041.098-.05.075-.028.065-.05.075-.055.13-.064.108-.064.107-.114.182-.05.075-.028.065-.023.01.025.125-.003.19-.026.2-.035.177-.06.186-.09.173-.124.159-.133.136-.143.113-.176.099-.185.076-.194.053-.204.03-.19-.003-.2-.026-.177-.036-.186-.058-.173-.091-.16-.124-.135-.134-.113-.143-.099-.175-.076-.185-.038-.092-.048-.116-.024-.125-.024-.125-.025-.125-.001-.135-.001-.135-.002-.134.009-.112.008-.111.008-.112.031-.12.041-.099.041-.098.04-.097.042-.098.04-.098.05-.075.051-.075.05-.074.065-.108.064-.107.064-.108.073-.084.05-.075-.051-.06-.094-.096-.094-.097-.094-.096-.116-.087-.117-.088-.117-.087-.117-.087-.117-.087-.117-.087-.117-.087-.117-.087-.266-.188-.276-.21-.3-.202-.298-.202-.15-.1-.15-.101-.158-.124-.16-.124-.158-.124-.16-.123-.158-.124-.136-.134-.136-.133-.136-.133-.69-.69-.688-.69-.356-.34-.356-.34-.356-.34-.357-.34-.332-.35-.343-.373-.342-.373-.343-.373-.342-.372-.343-.373-.164-.203-.165-.203-.164-.202-.165-.203-.164-.203-.164-.202-.165-.203-.164-.203-.165-.202-.164-.203-.164-.203-.165-.203-.164-.202-.165-.203-.164-.203-.165-.202-.14-.213-.142-.212-.142-.212-.14-.212-.142-.212-.141-.213-.142-.212-.141-.212-.141-.212-.142-.213-.14-.212-.142-.212-.118-.222-.119-.221-.118-.222-.118-.222-.118-.222-.118-.221-.118-.222-.119-.222-.184-.383-.185-.384-.185-.383-.185-.384-.161-.393-.162-.393-.161-.393-.162-.393-.162-.393-.161-.393-.162-.394-.152-.37-.152-.37-.129-.379-.129-.38-.129-.379-.129-.38-.129-.379-.129-.38-.129-.379-.129-.38-.129-.379-.129-.38-.129-.379-.129-.379-.129-.38-.244-.791-.244-.792-.245-.791-.234-.769-.235-.768-.48-1.56-.234-.768-.235-.769-.235-.768-.129-.38-.129-.38-.129-.379-.129-.38-.129-.379-.129-.379-.129-.38-.129-.379-.128-.38-.13-.379-.128-.38-.13-.379-.128-.38-.152-.37-.153-.37-.152-.37-.152-.37-.152-.369-.114-.278-.114-.277-.114-.277-.114-.278-.114-.277-.114-.278-.091-.287-.091-.287-.091-.287-.091-.287-.091-.287-.09-.287-.092-.287-.09-.287-.092-.287-.09-.287-.092-.287-.09-.287-.068-.296-.068-.296-.068-.297-.068-.296-.068-.297-.068-.296-.067-.297-.068-.296-.068-.297-.068-.296-.068-.297-.067-.296-.068-.297-.045-.306-.035-.283-.035-.282-.036-.283-.035-.283-.035-.283-.035-.283-.035-.283-.036-.283-.035-.283-.035-.282-.035-.283-.035-.283-.036-.283-.035-.283-.012-.292-.012-.293-.012-.292-.012-.292-.012-.293-.012-.292-.012-.292-.012-.293-.012-.292-.013-.293-.012-.292-.012-.292-.012-.293-.012-.292-.012-.292-.012-.293-.012-.292-.012-.292.007-.247-.012-.292.001-.325-.008-.348-.017-.371.003-.19.003-.191.002-.19.003-.19.003-.191-.02-.181-.02-.18-.02-.182-.021-.18-.02-.182-.02-.18-.012-.158-.033-.148-.034-.149-.034-.148-.02-.046-.018-.046-.02-.047-.018-.046-.02-.046-.018-.046-.02-.047-.009-.023-.01-.023-.009-.023-.01-.023-.009-.023-.042-.037-.052-.06-.051-.06-.061-.083-.062-.083-.084-.073-.084-.074-.084-.073-.085-.074-.084-.073-.033-.014-.032-.013-.033-.014-.032-.013-.033-.014-.121-.031-.121-.032-.121-.031-.088-.018-.024.01.033.013-.177-.035-.186-.059-.173-.09-.15-.102-.135-.133-.113-.143-.099-.175-.076-.185-.053-.195-.03-.204.003-.19.026-.2.035-.177.059-.186.091-.173.124-.159.133-.136.143-.112.176-.1.185-.076.194-.053.204-.03.382.14zm-.195 2.945l.112.008-.112-.008z"/><path fill="#0775C4" d="M93.9 7.463l.199.025.186.06.173.09.107.064.13.055.108.064.108.064.116.087.117.087.117.087.117.087.117.087.117.087.117.087.094.097.093.097.094.096.094.097.094.096.093.097.094.097.094.096.094.097.094.096.093.097.094.097.07.106.071.106.071.106.155.18.132.188.132.19.131.189.132.189.132.189.132.189.24.388.231.364.122.166.123.166.122.166.122.166.123.166.112.143.113.143.113.143.216.262.216.263.216.262.216.263.193.272.193.272.193.272.193.272.193.272.193.272.193.272.193.272.193.272.193.273.193.272.193.272.17.281.17.282.169.281.17.282.17.282.17.281.17.282.17.281.169.282.18.305.155.314.157.314.156.314.156.314.156.315.156.314.555 1.15.554 1.151.563 1.174.564 1.174 1.15 2.338.564 1.174.564 1.174.564 1.174.563 1.174.564 1.173.564 1.174.563 1.174.27.592.27.591.271.592.27.592.27.591.27.592.271.592.27.591.27.592.271.592.27.591.27.592.27.592.271.591.247.602.247.6.248.602.247.601.247.601.247.602.247.6.247.602.247.601.248.601.224.611.224.61.224.611.224.611.224.61.224.611.224.611.224.61.2.62.202.621.2.62.201.62.201.62.201.62.235.77.235.768.138.402.116.412.115.413.115.412.116.412.115.412.063.217.062.218.062.218.063.217.062.218.063.217.039.228.04.227.039.227.039.227.04.227.039.227.039.227.04.227.038.227.04.228.04.227.015.236.016.237.017.237.016.236.016.237.016.236.007.214.007.213-.017.223-.016.223-.017.223-.016.223-.017.223-.016.223-.017.223-.04.233-.039.232-.04.233-.039.232-.04.233-.03.12-.032.122-.031.12-.032.122-.031.121-.031.121-.032.121-.031.121-.031.121-.032.121-.04.098-.042.098-.04.098-.041.098-.091.172-.101.15-.133.136-.134.136-.166.122-.175.099-.185.076-.195.053-.18.02-.191-.003-.177-.035-.186-.059-.173-.09-.15-.102-.135-.133-.136-.133-.122-.166-.1-.176-.075-.185-.053-.194-.02-.181.002-.19.036-.177.058-.186.041-.098.027-.066.027-.065.028-.065.027-.065.018-.089.017-.088.018-.088.018-.089.018-.088.017-.089.018-.088.018-.088.017-.089.036-.176.035-.177.036-.177.035-.177.013-.167.012-.167.012-.167.013-.168.012-.167.012-.167.003-.19.003-.191.003-.19.003-.19-.02-.182-.021-.18-.02-.181-.02-.181-.02-.181-.021-.18-.02-.182-.02-.18-.021-.182-.02-.18-.03-.204-.03-.204-.03-.204-.03-.204-.052-.195-.053-.194-.053-.195-.053-.194-.053-.195-.053-.194-.053-.195-.053-.194-.053-.195-.106-.389-.106-.389-.105-.389-.106-.389-.106-.389-.13-.379-.234-.768-.235-.769-.2-.62-.192-.597-.191-.597-.192-.597-.2-.62-.202-.62-.224-.611-.224-.611-.224-.61-.224-.611-.224-.611-.224-.61-.224-.611-.224-.611-.247-.601-.247-.602-.247-.6-.247-.602-.248-.601-.247-.601-.247-.601-.247-.602-.247-.6-.247-.602-.27-.592-.27-.591-.271-.592-.27-.592-.27-.591-.271-.592-.27-.592-.27-.591-.27-.592-.271-.592-.27-.591-.27-.592-.27-.592-.271-.591-.564-1.174-.564-1.174-.563-1.174-.564-1.174-.564-1.174-.563-1.173-.564-1.174-1.15-2.338-.564-1.174-.564-1.174-.563-1.174-.554-1.15-.147-.292-.147-.29-.147-.292-.146-.291-.147-.291-.147-.291-.146-.291-.16-.259-.161-.258-.16-.259-.16-.258-.16-.259-.161-.258-.16-.258-.16-.259-.161-.258-.16-.259-.16-.258-.184-.25-.184-.248-.183-.25-.184-.248-.183-.25-.183-.248-.184-.249-.183-.249-.184-.249-.193-.272-.193-.272-.216-.263-.216-.262-.216-.263-.132-.189-.131-.189-.132-.189-.132-.19-.132-.188-.132-.19-.131-.188-.132-.19-.231-.364-.231-.365-.122-.166-.123-.165-.122-.166-.122-.166-.123-.166-.122-.166-.122-.166-.061-.083-.061-.083-.062-.083-.051-.06-.052-.06-.051-.06-.052-.06-.052-.06-.051-.06-.052-.06-.052-.06-.051-.059-.052-.06-.052-.06-.051-.06-.052-.06-.075-.05-.074-.05-.075-.05-.075-.05-.075-.051-.065-.027-.065-.028-.065-.027-.066-.027-.074-.05-.173-.092-.16-.124-.135-.133-.122-.166-.1-.175-.076-.185-.052-.195-.02-.18.002-.191.026-.2.059-.186.09-.173.092-.172.124-.16.133-.135.166-.123.176-.099.185-.076.194-.053.18-.02zM82.674 21.186l.177.036.154.045.163.068.14.077.15.101.093.097.094.096.08.13.08.129.048.115.047.116.029.07.024.125.025.125.014.102.015.102.015.102.007.213.016.237.003.269.014.562.001.594.012.292.003.27.016.236.015.102.015.102.005.079-.004.056.02.046.009.023.073.375.06.408.05.385.05.385.05.385.05.385.21 1.562.05.385.05.385.05.385.05.385.05.385.074.375.073.375.073.376.073.375.044.171.043.172.043.171.044.171.043.172.044.171.043.172.044.17.043.172.043.172.044.171.043.171.044.172.043.171.044.171.066.162.067.162.066.162.067.162.066.162.067.162.066.161.067.162.066.162.067.162.066.162.176.36.175.36.152.37.152.37.152.37.152.37.152.37.152.37.153.37.152.37.152.37.152.37.129.38.129.38.129.379.129.38.129.379.129.38.129.379.129.38.258.758.257.759.258.759.258.759.258.759.258.759.258.759.258.758.258.76.129.379.129.38.129.379.129.38.129.379.129.38.152.37.152.37.152.369.152.37.152.37.152.37.152.37.153.37.152.37.152.37.175.36.166.338.165.337.166.337.166.338.166.337.165.337.19.328.188.328.189.328.137.268.16.258.16.259.16.258.161.258.16.259.151.235.151.236.15.235.152.235.15.236.151.235.151.235.174.226.174.226.174.226.174.226.174.225.174.226.174.226.174.226.174.226.173.225.174.226.174.226.174.226.174.226.174.226.174.225.197.217.197.216.197.216.197.217.197.216.188.193.187.193.188.194.187.193.188.193.188.193.187.193.188.194.187.193.188.193.187.193.188.193.187.194.211.183.21.184.211.184.408.4.431.39.43.39.432.391.43.39.431.391.454.381.127.11.113.143.09.153.066.162.066.161.044.172.02.18-.012.168-.013.167-.045.154-.068.163-.077.14-.101.15-.11.126-.12.103-.143.113-.152.09-.162.066-.171.044-.181.02-.158.01-.167-.012-.177-.035-.154-.045-.163-.068-.15-.1-.126-.111-.463-.404-.464-.404-.44-.414-.44-.414-.44-.413-.441-.414-.44-.414-.22-.206-.22-.207-.22-.207-.221-.207-.22-.207-.22-.206-.22-.207-.198-.217-.197-.216-.197-.216-.197-.217-.197-.216-.197-.216-.197-.216-.197-.217-.197-.216-.197-.216-.197-.217-.197-.216-.197-.216-.197-.217-.197-.216-.197-.216-.198-.217-.197-.216-.174-.226-.173-.226-.174-.226-.184-.248-.183-.25-.184-.248-.183-.25-.184-.248-.183-.25-.183-.248-.184-.25-.183-.248-.184-.249-.16-.258-.16-.259-.16-.258-.161-.259-.16-.258-.16-.259-.16-.258-.161-.259-.16-.258-.17-.282-.17-.281-.17-.282-.198-.35-.208-.375-.199-.35-.184-.384-.175-.36-.185-.384-.175-.36-.176-.361-.175-.36-.175-.361-.152-.37-.152-.37-.152-.37-.152-.37-.153-.37-.152-.37-.152-.37-.152-.37-.152-.37-.152-.37-.129-.38-.129-.379-.129-.38-.129-.379-.129-.38-.129-.379-.258-.758-.258-.76-.258-.758-.258-.76-.257-.758-.258-.76-.258-.758-.258-.759-.258-.759-.13-.38-.128-.379-.13-.38-.128-.379-.13-.38-.128-.379-.129-.38-.152-.37-.152-.369-.152-.37-.152-.37-.153-.37-.152-.37-.152-.37-.152-.37-.142-.347-.143-.346-.143-.347-.165-.338-.175-.36-.077-.185-.085-.208-.086-.208-.085-.208-.086-.208-.085-.209-.076-.185-.076-.184-.086-.209-.053-.194-.053-.195-.053-.194-.053-.195-.053-.194-.052-.195-.053-.194-.053-.194-.053-.195-.053-.194-.053-.195-.053-.194-.053-.195-.053-.194-.053-.195-.053-.194-.03-.204-.082-.399-.083-.398-.06-.408-.06-.408-.059-.408-.06-.408-.059-.408-.06-.408-.05-.385-.11-.793-.1-.77-.05-.384-.05-.385-.05-.385-.05-.385-.073-.375-.073-.376-.015-.102-.025-.125-.024-.125-.001-.135-.002-.134-.001-.135-.003-.269-.012-.292-.012-.293-.01-.617-.015-.562.007-.246-.007-.213-.01-.158-.01-.023-.01-.023-.02-.181.013-.167.012-.168.035-.177.069-.163.068-.163.1-.15.11-.126.11-.126.144-.113.152-.09.162-.066.171-.044.172-.043.18-.02.17.281zm-1.508 2.053l.071.106-.07-.106-.03-.07.03.07z"/><path fill="#0775C4" d="M105.675 68H105.925l.025.025.025.025.025.025.025.025.025.025.025.025.025.025.025.025.025.025.025.025.025.025.025.025.025.025.025.025.025.025.025.025.025.025v.025l.025.025.025.025.025.025v.025l.025.025v.05l.025.025v.125l-.025.025v.05l-.025.025v.025l-.025.025-.025.025v.025l-.025.025-.025.025-.025.025-.025.025-.025.025-.025.025-.025.025-.025.025-.025.025-.025.025-.025.025-.025.025-.025.025-.025.025-.025.025-.025.025-.025.025-.05.025-.05.025-.05.025-.05.025-.05.025-.05.025-.05.025-.05.05-.05.05-.05.05-.05.05-.05.05-.05.05-.05.05-.05.05-.05.05-.05.05-.05.05-.05.05-.05.05-.05.05-.05.05-.05.05-.025.05-.05.05-.025.05-.05.05-.025.05-.025.05-.025.05-.025.05-.025.05v.025l-.025.05-.025.075-.025.075-.05.175-.05.175-.05.175-.025.125-.025.075v.05l-.025.025v.025l-.025.025-.025.025v.025l-.025.025-.025.025-.025.025-.025.025-.025.025-.025.025-.025.025-.025.025-.025.025-.025.025-.025.025-.025.025-.025.025-.025.025-.025.025-.025.025-.025.025-.025.025H103.175l-.025-.025-.025-.025-.025-.025-.025-.025-.025-.025-.025-.025-.025-.025-.025-.025-.025-.025-.025-.025-.025-.025-.025-.025-.025-.025-.025-.025-.025-.025-.025-.025-.025-.025-.025-.025-.025-.025V71.9l-.025-.025v-.025l-.025-.025V71.8l-.025-.025V71.6l.025-.075.025-.125.025-.15.05-.175.05-.2.05-.2.025-.1.025-.1.025-.1.025-.075.05-.1.05-.1.05-.1.05-.075.05-.075.05-.075.05-.075.05-.075.05-.075.05-.075.05-.075.05-.075.075-.075.05-.075.075-.075.05-.075.075-.075.075-.075.075-.075.05-.075.075-.075.075-.05.075-.05.075-.05.075-.05.1-.05.075-.05.075-.05.075-.05.075-.05.075-.05.075-.025.025-.025H105.675V68zM108.325 70.75H108.575l.025.025.025.025.025.025.025.025.025.025.025.025.025.025.025.025.025.025.025.025.025.025.025.025.025.025.025.025.025.025.025.025.025.025.025.025.025.025v.025l.025.025.025.025v.05l.025.025v.175l-.025.025v.05l-.025.025-.025.025v.025l-.025.025-.025.025-.025.025-.025.025-.025.025-.025.025-.025.025-.025.025-.025.025-.025.025-.025.025-.025.025-.025.025-.025.025-.025.025-.025.025-.025.025-.025.025-.05.025-.05.025-.05.025-.05.025-.125.075-.125.075-.125.1-.125.1-.05.05-.075.05-.075.05-.05.05-.075.05-.05.05-.05.05-.05.05-.05.05-.05.05-.05.05-.05.05-.05.05-.05.05-.025.05-.025.025v.05l.025.05.025.1.025.1.025.1.05.125.025.125.025.075.025.075.025.075v.175l-.025.025V74.525l-.025.025v.025l-.025.025v.025l-.025.025-.025.025-.025.025-.025.025v.025h-.025v.025l-.025.025-.025.025-.025.025-.025.025-.025.025-.025.025-.025.025-.025.025h-.025l-.025.025-.025.025-.025.025-.025.025-.025.025h-.025l-.025.025-.025.025H106.175l-.075-.025h-.175l-.025-.025-.025-.025-.025-.025-.025-.025L105.8 75l-.025-.025-.025-.025-.025-.025-.025-.025-.025-.025-.025-.025-.025-.025-.025-.025-.025-.025-.025-.025-.025-.025-.025-.025v-.025l-.025-.025-.025-.025V74.6l-.025-.025v-.025l-.025-.025V74.325l.025-.025v-.025l.025-.025v-.025l.025-.025.025-.025-.025-.025-.025-.125-.05-.125-.025-.075-.025-.075-.025-.075-.025-.075-.025-.1v-.2l.025-.1v-.075l.025-.05.025-.075.025-.075.05-.1.05-.1.05-.1.05-.075.05-.075.075-.075.05-.075.075-.075.05-.075.075-.075.075-.075.1-.075.075-.075.075-.075.1-.075.075-.075.1-.075.075-.075.1-.075.075-.075.175-.125.175-.1.175-.1.15-.1.075-.05.075-.05.05-.05.05-.025.025-.025h.575v.025zM103.25 65.575H103.525l.025.025.025.025.025.025.025.025.025.025.025.025.025.025.025.025.025.025.025.025.025.025.025.025.025.025.025.025.025.025v.025l.025.025.025.025.025.025v.025l.025.025.025.025v.05l.025.025v.175l-.025.025v.025l-.025.025v.025l-.025.025v.025l-.025.025-.025.025-.025.025-.025.025-.025.025-.025.025-.025.025-.025.025-.025.025-.025.025-.025.025-.05.05-.075.05-.05.05-.075.05-.05.05-.075.05-.075.05-.05.05-.075.05-.05.05-.125.075-.125.075-.125.05-.125.05-.1.05-.1.05-.05.025-.05.025-.05.025-.05.025-.025.025-.05.025-.025.025-.025.025-.05.025-.025.025-.025.025-.025.025-.025.025-.025.025-.025.025-.025.025-.025.025-.025.025-.025.025-.025.05-.025.05-.025.05-.025.1-.025.1-.05.225-.025.125-.025.075-.025.075-.025.075-.025.075-.025.075-.025.075-.05.075-.05.075-.05.075-.05.05-.025.025-.025.025-.025.025-.025.025-.025.025-.025.025-.025.025-.025.025-.025.025-.025.025-.025.025H100.35l-.025-.025-.025-.025-.025-.025-.025-.025-.025-.025-.025-.025-.025-.025-.025-.025-.025-.025-.025-.025-.025-.025-.025-.025-.025-.025-.025-.025-.025-.025-.025-.025-.025-.025v-.025l-.025-.025-.025-.025-.025-.025v-.025l-.025-.025v-.05l-.025-.025V69l.025-.025v-.025l.025-.025V68.9l.025-.025v-.025l.025-.025.025-.025.025-.025.025-.025.025-.025.025-.025.025-.025.025-.025.025-.025h.025V68.6l.025-.025v-.025l.025-.025.025-.025.025-.025.025-.1.05-.225.025-.125.05-.125.025-.075.025-.075.025-.075.05-.075.025-.075.05-.075.05-.075.05-.075.05-.075.05-.075.075-.075.05-.075.075-.075.075-.05.05-.05.075-.05.075-.05.05-.05.075-.05.05-.05.075-.05.05-.05.125-.075.125-.075.125-.05.125-.05.1-.05.1-.05.05-.025.05-.025.05-.025.05-.025.025-.025.05-.025.025-.025.05-.025.025-.025.025-.05.025-.025.025-.025.025-.025.025-.025.025-.025.025-.025.025-.025h.025l.025-.025H103.15zM105 25.75h.225l.05.025.025.025.025.025.05.025.025.025.025.025.025.025.025.025.025.025.025.025.025.025.025.025.025.025.025.025.025.025.025.025.025.025.025.025v.025l.025.025v.025l.025.025v.1l-.025.025v.05l-.025.025v.025l-.025.025v.025l-.025.05-.025.075-.025.075-.075.125-.05.125-.1.15-.175.3-.175.3-.1.15-.05.125-.05.1-.025.05-.025.025-.075.2-.1.2-.075.2-.05.1-.025.1-.05.1-.05.1-.025.1-.025.1-.05.1-.025.1-.025.1-.025.1-.025.1-.025.1-.025.1-.025.1-.025.1-.025.1-.025.1-.025.1-.025.1-.025.1v.1l-.025.1-.025.1V31.475l-.025.05v.1l-.025.05-.025.025-.025.025-.025.025-.025.025-.025.025-.025.025-.025.025-.025.025-.025.025-.025.025-.025.025-.025.025-.025.025-.025.025-.025.025-.05.025-.025.025-.05.025h-.525l-.025-.025-.025-.025-.05-.025-.025-.025-.025-.025-.05-.025-.025-.025-.025-.025-.025-.025-.025-.025-.025-.025-.025-.025-.025-.025-.025-.025-.025-.025-.025-.025-.025-.025-.025-.05v-.05l-.025-.05v-.4l.025-.125V30.9l.025-.125.025-.125.025-.125.025-.125.025-.125.025-.125.025-.125.025-.125.025-.125.025-.125.025-.125.025-.125.05-.125.025-.125.05-.125.025-.125.05-.125.05-.125.05-.125.025-.125.05-.125.05-.125.1-.225.1-.225.1-.225.025-.075.05-.075.05-.15.1-.15.1-.15.175-.3.175-.3.05-.075v-.1l.025-.05V26l.025-.05.025-.025.025-.025.025-.025.025-.025.025-.025.025-.025.025-.025.025-.025.025-.025.025-.025.05-.05.05-.05.025-.025.025-.025.025-.025h.025l.025-.025.05-.025.025-.025.025-.025h.3v.325zM107.025 29.825H107.25l.025.025.025.025.025.025.025.025.025.025.025.025.025.025.025.025.025.025.025.025.025.025.025.025.025.025.025.025.025.025.025.025.025.025.025.025.025.025.025.025.025.025v.025l.025.025V30.625l-.025.025v.075l-.025.1-.025.1-.025.1-.05.1-.075.225-.1.25-.1.275-.125.3-.125.3-.125.3-.125.3-.125.3-.125.275-.1.25-.1.2-.075.175-.05.1-.025.025-.025.025-.025.025-.025.025-.025.025-.025.025-.025.025-.025.025-.025.025-.025.025-.025.025-.025.025-.025.025-.025.025-.025.025-.025.025-.025.025H105.325l-.025-.025-.025-.025-.025-.025-.025-.025-.025-.025-.025-.025-.025-.025-.025-.025-.025-.025-.025-.025-.025-.025-.025-.025-.025-.025-.025-.025-.025-.025-.025-.025-.025-.025-.025-.025-.025-.025-.025-.025v-.025l-.025-.025v-.05l-.025-.025v-.1l.025-.025V34l.025-.025.025-.025v-.025l.025-.025.025-.025.05-.1.075-.15.1-.2.1-.225.1-.275.125-.275.125-.3.125-.3.125-.3.125-.3.1-.275.1-.25.075-.2.025-.075.025-.075.025-.05V30.45l.025-.025.025-.025v-.025l.025-.025.025-.025.025-.025.025-.025.025-.025.025-.025.025-.025.025-.025.025-.025.025-.025.025-.025.025-.025.025-.025.025-.025.025-.025.025-.025.025-.025.025-.025.025-.025H107.075h-.05v-.075zm-.775.775v.05-.05z"/><path fill="#BCE0FA" d="M125.85 85.275h.225l.025.025.05.025.025.025.025.025.025.025.025.025.025.025.025.025.025.025.025.025.025.025.025.025v.025h.025l.35-.075.2-.05.1-.025.1-.025.1-.025.1-.025.1-.025.1-.025.15-.025H128.375l.025.025.025.025.05.025.025.025.025.025.025.025.025.025.025.025.025.025.025.025.025.025.025.025.025.025.025.025.025.025.025.025.025.025.025.05v.025l.025.025v.025l.025.05v.125l-.025.05V86.15l-.025.025-.025.025-.025.025-.025.025-.025.025-.025.025-.025.025-.025.025h-.025l-.025.025-.025.025-.025.025-.025.025-.025.025-.025.025-.025.025-.025.025-.025.025-.05.025-.05.025-.1.05-.1.025-.1.025-.1.025-.1.025-.1.025-.1.025-.225.05-.2.05-.225.05-.05.025h-.025l-.025.025-.025.025-.025.025-.025.025-.05.025-.025.025H126.5l-.35.025-.125.025-.125.025h-.025l-.05.025-.025.025-.025.025-.05.025H125.3l-.175.1-.2.1-.2.1-.125.05-.1.05-.1.05-.125.05-.1.05-.125.05-.125.05-.125.05-.125.05-.1.025-.125.025-.125.025-.125.025H122.975h.1H122.85l-.075-.025-.05-.025h-.025l-.025-.025h-.025l-.025-.025-.05-.025h-.025l-.025-.025-.05-.025-.025-.025-.025-.025-.025-.025-.025-.025-.025-.025-.025-.025-.025-.025-.025-.025-.025-.025-.025-.025-.025-.025-.025-.025-.025-.025-.025-.025-.025-.025h-.025V87.6l-.025-.025-.025-.025v-.025l-.025-.05v-.125l.025-.025V87.3l.025-.025v-.05l.025-.025.025-.025.025-.025.025-.025.025-.025.025-.025.025-.025.025-.025V87l.025-.025.025-.025.025-.025.025-.025.05-.05.05-.05.05-.05.1-.05.1-.05.1-.05.1-.05.1-.05.1-.05.05-.025.05-.025.05-.025.05-.025.1-.05.1-.05.1-.05.1-.05.1-.05.1-.05.1-.025.125-.025.1-.025.125-.025.1-.025.1-.025.125-.025.225-.05.1-.025.025-.025v-.05l.025-.025.025-.05.025-.025.025-.025.025-.025.025-.025.025-.025.025-.025.025-.025.025-.025.025-.025.025-.025.025-.025.025-.025.05-.025h.025l.025-.025.025-.025.025-.025H125.8z"/><path fill="#BCE0FA" d="M127.35 84.25H127.7l.025.025.025.025.025.025.025.025.025.025.025.025.025.025h.025l.025.025.025.025.025.025.025.025.025.025.05.05.05.05.025.025v.025l.025.025.025.075.025.075.025.025v.025l.025.025.025.075.025.1.025.1V85.525l-.025.075-.025.075-.025.075-.025.075-.025.075-.025.075-.025.075-.025.075-.05.075-.025.075-.05.05-.05.05-.025.05-.05.05-.1.1-.1.1-.1.1-.1.1-.1.1-.1.1-.1.1-.1.1-.1.1-.1.075-.1.075-.1.075-.1.075-.1.075-.1.075-.075.05-.075.05-.05.05-.075.1-.1.125-.1.125-.125.175-.175.2-.025.025-.025.025-.025.025-.025.025-.025.025-.025.025-.025.025-.025.025-.025.025-.025.025-.025.025-.025.025H124.825l-.025-.025-.025-.025-.025-.025-.025-.025-.025-.025-.025-.025-.025-.025-.025-.025-.025-.025h-.025l-.075-.025-.075-.025-.025-.025H124.2l-.025-.025-.025-.025-.025-.025-.025-.025-.05-.05-.05-.05-.05-.05-.025-.05-.025-.05v-.025l-.025-.025-.025-.025-.025-.025v-.025l-.025-.025v-.05l-.025-.025V88.1l-.025-.025v-.325l.025-.075.025-.075.025-.1.05-.1.05-.075.05-.075.05-.075.05-.075.05-.075.05-.075.05-.075.05-.075.05-.075.075-.075.05-.075.075-.075.125-.15.075-.075-.025-.075-.025-.05-.025-.025-.025-.025v-.025l-.025-.025-.025-.025-.025-.025v-.025l-.025-.025v-.025l-.025-.025v-.05l-.025-.025V85.575l.025-.025v-.05l.025-.025v-.025l.025-.025V85.4l.025-.025v-.025h.025l.025-.025V85.3l.025-.025.025-.025h.025l.025-.025.025-.025.025-.025.025-.05.05-.05.05-.05.05-.05.075-.05.1-.05.075-.05.1-.05.075-.05.1-.05.1-.05.1-.05.1-.025.1-.025.1-.025.1-.025.1-.025.2-.05.1-.025.1-.025.1-.025.1-.025.1-.025.1-.025.1-.025.1-.025h.25z"/></g><path fill="#91CAF2" fill-rule="nonzero" d="M116.825 58.475h1.1l.175.025.175.025.175.025.15.025.15.025.15.025.125.025.125.025.125.025.075.025.05.025.05.025.05.025.05.025.05.025.075.025.05.025.05.05.05.05.05.05.075.075.025.05.025.025.025.025.025.025.025.05.025.05.025.025.025.05.025.05.025.025.025.05v.05l.025.025v.05l.025.05v.2l-.025.05v.075l-.025.075-.025.025.05.025.05.025.05.05.075.05.05.05.05.05.05.05.05.05.05.05.05.05.05.075.05.075.05.075.025.05.025.025.025.025.025.025.025.025.025.025.025.025.025.025v.025l.025.025.075.075.075.075.025.05.025.05.125.2.05.1.025.025.025.025.1.15.1.15.1.15.1.15.075.15.1.15.075.15.075.15.075.15.075.15.05.15.075.15.05.15.05.15.05.15.05.15.05.15.05.15.05.15.05.15.05.15.05.15.1.3.1.3.1.3.1.3.075.3.175.625.1.3.075.3.1.275.05.1.1.125.1.15.075.15.1.15.075.15.075.15.075.15.05.15.075.15.05.15.025.075.025.075.025.075.025.075.025.075.025.075.025.075.025.075.025.075.025.075.025.075v.075l.025.075V71l-.025.075-.025.075v.05l.025.15.05.275.025.125.025.125.025.125.025.125.025.125.025.125.025.125.025.125V73.025l-.025.075-.025.075-.025.05v.025l-.025.025-.025.025-.025.05-.025.05v.025l-.025.05-.05.05-.05.05-.025.05-.05.025h-.025l-.025.025-.025.025h-.025l-.025.05-.025.025-.025.025-.025.025-.025.025-.025.025-.025.025-.025.025-.025.025-.025.025-.05.05-.05.05-.025.025-.025.025-.025.025h-.025l-.025.025-.05.025h-.525l-.05-.025h-.025l-.05-.025-.05-.025h-.025l-.025-.025-.025-.025-.025-.025-.025-.025-.025-.025-.05-.025-.075-.05-.05-.05-.05-.05-.05-.05-.05-.05-.05-.05-.05-.05-.05-.05-.05-.075-.075-.125-.075-.125-.05-.1h-.625l-.1-.025-.1-.025-.1-.025-.1-.025-.1-.025-.1-.025-.1-.025-.1-.025-.1-.025-.1-.025-.1-.025-.1-.05-.1-.05-.075-.05-.1-.05-.1-.05-.1-.05-.1-.05-.1-.05-.1-.05-.075-.05-.1-.05-.1-.05-.075-.05-.1-.05-.075-.075-.1-.075-.075-.075-.1-.075-.075-.075-.075-.075-.1-.075-.075-.075-.075-.075-.15-.15-.175-.15-.125-.15-.15-.15-.15-.175-.125-.175-.125-.175-.125-.175-.125-.175-.125-.175-.125-.175-.1-.175-.125-.175-.1-.175-.1-.175-.1-.175-.1-.175-.1-.175-.1-.175-.05-.1-.025-.1-.025-.05h-.05l-.125-.025-.125-.05-.125-.05-.125-.05-.1-.05-.125-.05-.1-.05-.1-.05-.05-.025-.05-.025-.05-.025-.05-.05-.05-.05-.05-.05-.125-.1-.125-.125-.175-.15-.175-.175-.1-.1-.1-.1-.1-.1-.1-.1-.1-.1-.1-.125-.1-.125-.1-.125-.1-.125-.1-.125-.1-.125-.1-.125-.1-.125-.075-.125-.05-.075-.025-.075-.05-.075-.025-.075-.05-.075-.025-.075-.025-.075-.025-.075-.025-.075-.025-.075-.025-.075-.025-.075-.025-.075V64.2h-.025l-.1-.1-.125-.1-.1-.1-.1-.1-.1-.1-.1-.1-.1-.1-.075-.1-.1-.1-.025-.05-.05-.05-.025-.05-.025-.05-.025-.05-.05-.05-.025-.05h-.025l-.025-.025-.075-.05-.05-.075-.075-.075-.075-.075-.05-.075-.025-.05-.05-.05-.025-.05-.025-.075-.025-.075-.025-.075v-.05l-.025-.025V62.05L111.1 62v-.025l.025-.025v-.1l.025-.025V61.8l.025-.05.025-.05.025-.025-.025-.025-.125-.025-.1-.025-.075-.025-.075-.025-.1-.025-.075-.025-.1-.025-.1-.05-.075-.05-.05-.05-.05-.05-.05-.025-.025-.025-.025-.025h-.025l-.025-.025-.025-.025h-.025l-.025-.05-.025-.05H110l-.025-.05-.025-.05-.025-.05-.025-.075v-.15l.025-.025v-.075l.025-.1.025-.1.025-.075.05-.075.05-.075.05-.075.05-.075.05-.05.05-.05.05-.05.05-.05.05-.05.075-.05.05-.05.05-.05.05-.025.075-.025.05-.025.075-.025.075-.025.05-.025.075-.025.15-.05.15-.05.175-.05.175-.05.175-.05.175-.05.175-.05.2-.025.175-.025.175-.025.2-.025.2-.025.2-.025.2-.025.2-.025.2-.025.2-.025.2-.025.2-.025.2-.025.2-.025h1.825v-.25zm3.95 12.35l-.05.025-.05.025-.05.025h-.175l.075.05.05.05.075.05.05.05.075.05.05.05.075.05.05.05.075.05.05.05.05.05.05.025.075.025.05.025.025.025-.175-.225-.175-.25-.2-.25-.025-.025-.05-.025.075.05z"/><path fill="#0775C4" fill-rule="nonzero" d="M114.675 57.875h.975l.125.025.125.025.125.025.125.025.125.025.25.025.225.05.225.05.2.05.2.05.175.05h.25l.15-.025.175-.025.175-.025.175-.025.2-.025H119.475l.1.025.1.025.05.025.05.025.05.025.075.025.05.025.075.05.05.05.05.05.125.125.125.125.1.125.125.125.1.125.125.125.1.125.125.125.1.125.1.125.1.125.125.15.1.15.1.15.1.15.1.15.1.15.1.15.1.15.1.15.1.15.1.15.1.15.1.15.1.175.1.175.1.175.1.175.075.175.1.175.075.175.075.175.075.175.075.175.075.175.075.175.05.175.05.175.05.175.05.175.05.175.05.175.05.175.05.175.025.2.05.2.025.2.025.2.025.2.025.2.025.2.025.2.025.2.025.2V67.9l-.025.2v.2l-.025.2-.025.2-.025.2-.025.2-.025.1-.025.1-.025.125-.025.125-.025.125-.025.125-.025.125-.025.125-.05.125-.025.125-.025.125-.05.125-.025.1-.05.1-.025.1-.05.1-.025.1-.05.1-.05.1-.05.1-.05.1-.05.1-.05.1-.05.1-.05.1-.05.1-.05.1-.05.1-.05.075-.05.075-.05.075-.05.075-.05.075-.05.075-.05.075-.05.075-.05.075-.05.075-.075.075-.05.075-.05.075-.075.075-.05.075-.075.05-.05.05-.075.05-.075.05-.075.05-.075.05-.075.05-.075.05-.075.05-.075.05-.075.05-.1.05-.075.05-.075.025-.1.025-.075.025-.1.025-.1.025-.075.025-.1.025-.1.025-.075.025-.1.025-.1.025h-1.075l-.1-.025-.1-.025-.1-.025-.1-.025-.1-.025-.1-.025-.1-.025-.1-.025-.1-.025-.1-.025-.075-.025-.1-.025-.1-.025-.1-.05-.1-.05-.1-.05-.1-.05-.1-.05-.075-.05-.1-.05-.1-.05-.1-.05-.075-.05-.1-.05-.1-.05-.1-.05-.075-.05-.1-.075-.1-.075-.1-.075-.075-.075-.1-.075-.1-.075-.075-.075-.1-.075-.1-.075-.075-.075-.1-.075-.075-.075-.1-.075-.075-.075-.1-.1-.1-.1-.075-.1-.1-.1-.075-.1-.1-.1-.075-.1-.1-.1-.075-.1-.075-.1-.1-.1-.25-.35-.25-.325-.225-.325-.225-.325-.225-.325-.225-.325-.225-.325-.1-.15-.1-.15-.1-.15-.1-.15-.1-.15-.1-.15-.1-.15-.1-.15-.1-.15-.1-.15-.1-.15-.1-.15-.075-.15-.1-.15-.075-.15-.1-.15-.075-.15-.075-.15-.075-.15-.05-.15-.075-.15-.05-.15-.05-.175-.05-.175-.05-.175-.05-.175-.05-.175-.05-.175-.05-.175-.05-.175-.025-.175-.05-.175-.025-.175-.025-.175-.025-.175-.025-.175-.025-.175-.025-.175-.025-.175-.025-.175V61.75l-.05-.025-.05-.025-.05-.025-.05-.025-.05-.05-.05-.05-.05-.05-.025-.05-.025-.05-.025-.05-.025-.05-.025-.05-.025-.075-.025-.075V60.875l.025-.075v-.075l.025-.075.025-.075.025-.075.025-.075.025-.075.025-.075.025-.075.025-.075.025-.075.025-.075.025-.075.05-.075.025-.075.05-.075.025-.075.05-.05.05-.05.05-.05.05-.05.05-.05.05-.05.05-.05.05-.05.05-.05.05-.05.05-.05.05-.05.05-.05.05-.05.05-.05.05-.05.05-.025.05-.025.075-.025.05-.025.075-.025.125-.05.125-.05.125-.05.125-.05.125-.05.15-.05.125-.025.125-.025.15-.025.15-.025.125-.025.15-.025.15-.025H114.675v-.325zm-.275 1.475h-.75l-.1.025-.125.025-.1.025-.125.025-.1.025-.1.025-.1.025-.1.025-.1.025-.1.025-.075.025-.1.025-.025.025-.05.025-.025.025-.025.025-.025.025-.025.025-.05.025.025.05.025.05.025.05.025.05.025.05.025.075.025.075v.075l-.025.075-.025.175-.025.15-.025.15V61l-.025.15v.75l.025.15v.15l.025.15.025.15.025.15.025.15.025.15.025.15.025.15.025.15.05.15.025.15.05.15.05.15.05.15.05.15.05.15.05.15.05.15.05.15.05.15.05.15.075.15.05.15.075.15.075.15.075.15.075.15.1.15.075.15.1.15.075.15.1.15.1.15.1.15.1.15.1.15.1.15.1.15.1.15.2.3.225.3.225.325.225.325.225.325.225.325.25.325.075.1.075.1.075.1.075.1.05.075.075.075.075.075.075.075.075.075.075.075.05.075.075.075.075.075.075.075.075.075.05.075.075.075.075.075.05.05.075.05.075.05.075.05.05.05.075.05.05.05.075.05.075.05.05.05.05.05.075.05.075.05.05.05.05.05.075.025.05.025.05.025.05.025.075.025.05.025.05.025.05.025.05.025.05.025.05.025.05.025.05.025.05.025.05.025H120.225l.05-.025.05-.025.05-.025.05-.025.05-.025.05-.025.05-.025.05-.025.05-.025.05-.025.05-.025.05-.025.05-.025.05-.025.05-.025.05-.025.05-.025.05-.05.05-.05.05-.05.05-.05.05-.05.025-.05.05-.05.05-.05.05-.05.05-.05.05-.05.025-.05.05-.05.05-.05.05-.075.025-.075.05-.075.05-.075.025-.075.05-.075.025-.075.05-.075.025-.075.05-.075.025-.075.05-.075.025-.075.025-.075.025-.1.05-.1.025-.1.025-.1.025-.1.025-.1.025-.1.025-.1.025-.1.025-.1.025-.1.025-.1.025-.1.025-.1.025-.125.025-.075.025-.075.025-.175.025-.15.025-.15.025-.175.025-.175V67.35l-.025-.175V67l-.025-.175-.025-.175-.025-.175-.025-.175-.025-.175-.025-.175-.05-.175-.025-.175-.05-.175-.025-.15-.05-.15-.05-.15-.05-.15-.05-.15-.05-.15-.05-.15-.05-.15-.05-.15-.075-.15-.05-.15-.075-.15-.075-.15-.075-.15-.075-.15-.075-.15-.075-.15-.1-.15-.075-.15-.1-.15-.1-.15-.1-.15-.1-.15-.1-.15-.1-.125-.1-.125-.1-.125-.1-.125-.1-.125-.1-.125-.1-.125-.1-.125-.1-.125-.1-.125-.1-.125-.1-.125-.1-.125-.1-.1-.1-.1-.1-.1-.1-.1-.1-.1h-.4l-.175.025-.175.025-.175.025-.175.025-.175.025H117.1l-.075-.025-.2-.05-.175-.05-.2-.05-.2-.025-.2-.025-.225-.025-.1-.025-.125-.025-.125-.025h-1.25.175v-.15z"/><path fill="#91CAF2" fill-rule="nonzero" d="M125.425 82.4h.15l.05.025.05.025.075.025.05.025.05.025.05.025.1.05.1.05.1.05.175.1.05.05.05.025.05.025h.025l.05.025.175.05.225.075.25.075.15.05.15.05.175.05.175.05.175.075.175.075.175.075.075.05.1.05.075.05.1.05.075.05.1.05.075.05.075.05.075.05.075.05.075.05.075.05.075.05.05.075.075.075.05.075.05.075.05-.025.05-.025.05-.025.05-.025.1-.025.125-.025.125-.025h.725l.125.025.1.025.125.025.125.025.125.025.125.025.1.025.125.025.125.025.225.05.225.05.1.025.05-.025.175-.05.175-.05.175-.05.175-.025.175-.025.175-.025.15-.025.15-.025.125-.025.125-.025.125-.025.125-.025.2-.025.175-.025h.325l.075.025.05.025.05.025.05.025.05.05.05.05.05.05.025.025.05.025.05.05.05.05h.025l.025.05.025.05.025.05.025.05h.025l.025.05.025.05h.025l.025.025.05.025.025.025.025.025.05.025.05.025.025.025.05.025.025.025.05.05.05.05.025.05.025.05.025.05.025.05v.05l.025.05v.05l-.025.05v.05l-.025.05-.025.05-.025.05-.025.05-.05.05-.025.05-.05.05-.025.025-.05.025-.025.025-.05.05-.05.025-.05.025-.05.025-.05.025-.05.025-.05.025-.05.025h-.025l-.025.075-.025.075-.025.075-.025.075-.05.075-.025.075-.05.075-.025.075-.05.05-.05.075-.075.125-.1.125-.1.1-.1.1-.1.1-.1.1-.175.2-.05.05V88l-.025.075-.025.075-.05.075-.025.075-.05.075-.025.075-.05.075-.025.075-.05.075-.05.075-.05.075-.05.075-.05.05-.025.025-.025.025-.025.025-.025.025-.05.025-.025.025-.05.025h-.025l-.05.025-.05.025h-.025l-.05.025h-.375l-.05-.025-.05-.025-.05-.025h-.025l-.05-.025-.05-.025-.05-.025-.05-.05-.05-.05-.025-.05-.05-.05-.025-.05-.025-.05-.025-.05-.025-.05v-.05l-.025-.05v-.125l.025-.075v-.05l.025-.075.025-.075.025-.025-.1.125-.1.125-.075.1-.05.1-.05.075-.05.075-.025.05-.025.025v.05l-.025.025.025.025.05.05.05.05.05.075.05.075.05.075.05.075.05.075.05.075.025.1.05.1.025.1.025.1.025.1v.1l-.025.1.125.05.2.075.2.075.2.075.05.025h.05l.325.05.175.025.175.025.175.025.15.025.175.025.15.05.125.05.1.025.125-.025.1-.025.1-.025h1.025l.125.025.125.025.125.025.125.025.125.025.125.025.125.025.125.025.125.025.125.025.125.025.125.025.1.025.1.025.1.025.1.025.1.025.1.025.075.025.1.05.05.025.05.025h.025l.05.05.05.025.025.025h.025l.025.05.05.05.025.05.025.05.025.075.025.075.025.075V91.925l-.025.05-.025.05-.025.05-.025.05-.025.05-.025.05-.05.05-.05.05-.05.05-.05.05-.05.025-.05.025-.05.025h-.2l-.05.025-.05.025-.05.025-.1.025-.05.025h-.15l-.125.025H137.575l-.3.025h-.575l-.175.025-.2.025-.2.025-.225.025-.125.025-.125.025-.125.025h-1l-.125-.025h-.1l-.225.1-.25.1-.275.1-.275.1-.275.1-.175.05-.15.05-.15.05-.175.05-.175.05-.15.05-.175.05-.175.05-.175.05-.175.05-.15.05-.175.025-.175.025-.175.025-.175.025-.175.025-.175.025-.15.025H128.85l-.075-.025-.1-.025-.075-.025-.075-.025-.075-.025-.075-.025-.075-.025-.05-.025-.075-.025-.075-.025-.075-.05-.05-.05-.075-.05-.05-.05-.075-.05-.05-.05-.05-.05-.05-.075-.05-.075-.05-.075-.05-.075-.05-.075h-.05l-.1.025-.1.025-.1.025-.125.025h-2.075l-.2-.025-.375-.025-.375-.025-.35-.025H122.55l-.2.025-.2.025-.2.025H121.05l-.1-.025-.1-.025-.075-.025-.05-.025-.075-.025-.075-.025-.025-.025-.05-.025-.025-.025h-.025l-.05-.025-.025-.025h-.025l-.025-.05-.05-.05h-.025l-.025-.05-.025-.05v-.025l-.025-.05-.025-.05-.025-.05v-.025l-.025-.05V92.125l.025-.05.025-.05V92l.025-.05.025-.05v-.025l.025-.025.025-.025V91.8l.05-.05.025-.05.05-.05.05-.05.05-.025.05-.05.05-.025.05-.05.05-.025.05-.025.05-.025.1-.025.1-.025.1-.025.125-.025.1-.025.125-.025.125-.025.125-.025.15-.025.275-.05.15-.025.025-.05.025-.05.05-.1.05-.1.05-.1.05-.1.05-.1.075-.1.05-.1.075-.1.075-.1.1-.1.075-.075.075-.1.075-.075.1-.075.075-.075.075-.075.1-.075.075-.075.075-.075.075-.075.075-.05.075-.05.1-.075.1-.075.1-.075.125-.075.15-.075.125-.1.175-.1.175-.1.175-.1.1-.05-.075-.025-.075-.025-.075-.025-.075-.025-.075-.025-.075-.025-.075-.025-.075-.025-.075-.025-.075-.025-.075-.025-.075-.025-.075-.025-.05-.05-.075-.05-.075-.05-.05-.05-.075-.05-.05-.05-.075-.05-.05-.05-.075-.05-.05-.05-.05-.05-.05-.05-.05-.05-.05-.05-.05-.05-.025-.025h-1.05l-.075-.025-.075-.025-.05-.025-.05-.025-.05-.05-.05-.05-.05-.05-.05-.05-.025-.05-.05-.05-.025-.075-.025-.075-.025-.075V86.325l.025-.075.025-.075.025-.075.025-.075.05-.05.05-.05.05-.05.05-.05.05-.05.05-.025.075-.025.05-.025.075-.025H122.8l.05-.025.075-.025.05-.025.05-.025.075-.025.05-.025.15-.05.125-.05.15-.05.15-.05.075-.025-.025-.05v-.075l.025-.075.025-.075.025-.075.025-.075.05-.075.025-.05.05-.05.05-.05.05-.05.05-.05.05-.025.05-.025.05-.025.075-.025H124.8l.125-.025.125-.025.125-.025h.05l.025-.025.075-.075.05-.075.075-.075.075-.075.075-.05.075-.05.075-.05.075-.05.05-.05-.1-.025-.125-.025-.075-.025-.05-.025-.075-.025-.075-.025-.05-.025-.075-.025-.075-.025-.075-.05-.075-.05-.075-.05-.05-.05-.05-.05-.025-.025-.025-.025-.025-.025-.025-.025-.025-.025-.025-.025-.025-.025-.025-.05-.025-.05-.025-.025-.025-.05-.025-.05-.025-.025-.025-.05v-.05l-.025-.025v-.1l-.025-.025v-.1l.025-.025v-.1l.025-.05.025-.05V82.3l.025-.025.025-.05.025-.05.025-.05.025-.05.025-.025.05-.025.05-.05.05-.025.05-.025.05-.025h.025l.05-.025.05-.025.05-.025.05-.025h.2l.075.6zm2.75 7.275l-.275.2-.275.2-.275.2-.3.2-.275.2-.2.15.1-.025.15-.05.175-.05.125-.05.05-.025.05-.05.175-.1.15-.1.15-.1.15-.1.15-.1.225-.175V89.7l-.025-.025v-.025l-.025.025zm-.4-2.975v.075l.025.075v.075h.05l.075.025.05.025.05.025.025-.05.025-.05.05-.05.05-.05.05-.05.025-.025h-.5l.025-.025z"/><path fill="#0775C4" fill-rule="nonzero" d="M135.35 83.025h.25l.1.025.125.025.125.025.125.025.125.025.1.025.1.05.05.025.05.025.05.025.05.025.05.025.05.025.05.025.05.05.05.05.05.05.05.05.05.05.05.05.05.05.05.05.025.05.05.1.05.1.025.1.05.1.025.1.025.1.025.1.025.1.025.1.025.1.025.1.025.1V85.425l-.025.1-.025.075-.025.075-.025.075-.025.075-.025.075-.025.075-.025.075-.025.075-.025.075-.05.075-.05.075-.025.075-.05.075-.05.075-.05.075-.05.075-.05.05-.05.05-.05.05-.05.05-.05.05-.05.05-.05.05-.1.1-.125.1-.125.1-.125.1-.125.075-.125.075-.125.075-.125.075-.125.075-.125.075-.225.15-.225.15-.2.125-.1.075-.1.075-.1.05-.1.05-.075.05-.1.05-.05.05-.05.05-.025.025-.025.025-.025.025-.025.025-.025.025-.025.025-.025.025V89l-.025.025-.025.025h-.025v.05l.025.025v.025l.025.025.025.025.025.025.025.025.025.025.025.025.025.025.025.025.025.025H134.375l.2.025.225.025.275.025.6.025.3.025.35.025.325.025.35.025.175.025.175.025.175.025.175.025.175.025.175.025.175.025.175.025.175.025.175.025.15.025.175.025.15.05.175.05.15.05.125.05.075.025.075.025.075.025.05.025.075.025.05.025.075.025.05.025.075.05.05.05.05.05.05.05.05.05.075.05.05.05.05.05.05.05.05.075.05.075.05.075.05.075.05.075.025.075.025.075.025.1.025.1.025.1v.2l-.025.1-.025.1-.025.075-.025.075-.025.075-.025.075-.025.075-.05.075-.05.075-.05.075-.05.075-.075.1-.075.1-.075.1-.1.1-.075.1-.1.075-.1.075-.1.075-.1.075-.1.075-.1.075-.1.075-.1.05-.1.05-.1.05-.1.05-.1.05-.1.05-.1.05-.1.025-.1.025-.1.025-.1.025-.1.025-.1.025-.1.025-.1.025-.1.025-.1.025-.1.025H134.6l-.65.05-.675.05-.675.05-.675.05-.675.05-.675.05-.675.05-.675.05-.675.05-.675.025-.35.025-.35.025-.325.025H123.375l-.275.025-.3.025-.325.025-.35.025-.175.025H119.775l-.1-.025-.1-.025-.1-.025-.075-.025-.1-.025-.1-.025-.075-.025-.1-.025-.075-.025-.1-.05-.075-.05-.1-.05-.075-.05-.075-.05-.075-.075-.05-.05-.05-.05-.05-.05-.05-.075-.05-.075-.025-.075-.05-.075-.025-.075-.025-.075-.025-.075-.025-.075-.025-.075-.025-.075v-.075l-.025-.075v-.075l.025-.075v-.075l.025-.075.025-.075.025-.075.025-.075.025-.075.025-.075.025-.075.025-.075.05-.05.025-.05.025-.05.05-.05.025-.05.05-.05.05-.05.05-.05.075-.1.1-.1.1-.1.1-.1.1-.1.1-.1.125-.1.1-.1.125-.1.125-.075.125-.075.1-.075.125-.075.125-.075.125-.075.125-.075.125-.075.25-.15.25-.15.225-.15.25-.15.225-.125.45-.25.2-.125.175-.1.075-.05.075-.05.075-.05.05-.05.05-.025.05-.025.025-.025h.025H122.775l-.025-.025-.025-.025-.025-.025-.025-.025-.025-.025-.05-.025-.05-.025-.05-.025-.05-.025-.075-.05-.05-.05-.075-.05-.075-.05-.1-.05-.075-.025-.1-.025-.1-.025-.1-.025-.1-.025-.1-.025-.1-.025-.2-.075-.2-.075-.4-.125-.2-.05-.175-.05-.175-.05-.1-.025-.1-.025-.075-.025-.1-.025-.075-.025-.075-.05-.1-.05-.075-.05-.1-.05-.075-.075-.05-.05-.05-.05-.05-.05-.025-.05-.025-.05-.025-.025-.025-.05v-.025l-.025-.05-.025-.05V87.2l-.025-.05-.025-.05v-.275l.025-.05v-.05l.025-.025v-.05l.025-.05.025-.025.025-.025.025-.025.025-.025.025-.05.025-.025.05-.05.025-.025.05-.05.1-.1.1-.075.1-.075.1-.075.1-.075.1-.075.1-.075.1-.075.1-.075.1-.075.1-.075.1-.075.1-.075.1-.075.1-.075.1-.075.1-.05.1-.05.1-.05.125-.05.1-.05.1-.05.1-.05.125-.05.1-.05.125-.05.1-.05.125-.05.1-.05.125-.05.1-.05.125-.05h.025l-.05-.025-.075-.075-.05-.075-.075-.075-.025-.05-.025-.05-.025-.05-.025-.05-.025-.05-.025-.05-.025-.05-.025-.05v-.05l-.025-.075v-.25l.025-.05.025-.05.025-.05.025-.075.025-.075.025-.05.025-.075.05-.1.05-.075.075-.075.05-.075.05-.05.075-.05.075-.05.075-.05.075-.05.075-.05.075-.05.075-.05.075-.05.075-.025.1-.025.075-.025.1-.025.15-.075.175-.05.175-.05.175-.05.175-.05.175-.05.175-.05.175-.05.3-.075.275-.075.1-.025.1-.025h.525l.1.025.1.025.1.025.1.025.1.025.1.025.1.025.075.025.1.05.1.05.075.05.1.05.075.05.075.05.1.05.15.1.15.1.175.1.15.1.15.1.125.1.15.1.275.2.125.1.125.1.125.1.125.075.125.075.125.075.05.025.05.025.05.025.05.025.05.025.05.025.05.025.025.025.05.025h.475l.175-.025.2-.025.2-.025.2-.025.225-.025.5-.075.25-.05.25-.025.275-.025.275-.025.275-.025.275-.025.25-.025h1l.475-.1zm-9.025-.275h-.05l-.275.075-.3.075-.15.05-.15.05-.15.05-.15.05-.15.05-.125.05-.125.05-.125.05-.05.025-.05.025-.05.025-.05.025-.05.025h-.025.025l.05.05.075.05.1.05.1.05.075.05.05.05.05.05.05.05.05.075.025.075.025.075.025.075h.025l.075.025.075.025.05.05.05.05.05.05.05.05.05.075.025.075.025.075.025.075.025.075.025.075v.075l-.025.075-.025.075-.025.075-.025.075-.025.075-.05.05-.05.05-.05.05-.05.05-.075.05-.05.025-.075.025h-.05l-.075.025-.175.025-.475.075-.275.05-.225.05-.1.025-.1.025H123.475l-.1.025-.1.025-.1.025-.1.025-.1.025-.1.05-.1.05-.1.05-.1.05-.1.05-.1.05-.1.05-.1.05-.1.05-.1.05-.1.05-.075.05-.1.05-.1.05-.1.05-.075.05-.1.05-.05.025.125.025.4.125.2.075.225.075.1.05.125.05.1.05.1.05.125.05.1.05.125.05.1.05.1.05.1.05.1.05.1.05.1.075.1.075.1.075.1.075.05.05.05.05.05.05.05.05.05.05.05.05.025.05.05.05.025.05.05.05.025.05.025.05.025.075.025.075.025.075.025.075.025.075.025.075v.075l.025.075V89.475l-.025.075v.075l-.025.075-.025.075-.025.075-.025.075-.025.075-.025.075-.025.075-.025.05-.05.05-.025.05-.05.05-.05.075-.075.075-.075.075-.075.05-.075.05-.1.05-.1.05-.075.05-.1.05-.1.05-.2.125-.2.125-.45.25-.225.125-.225.125-.225.15-.225.15-.225.15-.1.075-.125.075-.125.075-.1.075-.1.075-.1.075-.1.075-.1.075-.1.075-.1.075-.075.075-.075.075-.075.075-.075.075-.05.075-.05.05-.05.05-.025.025-.025.025-.025.025-.025.025-.025.025-.025.025-.025.025-.025.025v.025l-.025.025v.025h-.025.025v.025h.025l.025.025v.025H122.2l.35-.025.325-.025.3-.025.275-.025H126.95l.325-.025.35-.025.325-.025.65-.025.675-.05.675-.05.675-.05.65-.05.675-.05.675-.05.65-.05.675-.05.675-.05h3.325l.075-.025.075-.025.075-.025.05-.025.075-.025.075-.025.05-.025.05-.025.075-.025.05-.025.05-.025.05-.025.05-.025.05-.025.05-.025.05-.025.05-.025.05-.05.05-.05.05-.05.05-.05.05-.05.05-.05.05-.05.05-.05.05-.05.05-.075.05-.075.025-.025.025-.025.025-.025.025-.025.025-.025v-.025h-.025l-.025-.025-.025-.025-.025-.025-.025-.025-.025-.025-.05-.025-.025-.025-.025-.025-.05-.025-.05-.025-.05-.025-.05-.025-.1-.025-.1-.025-.125-.025-.125-.025-.125-.025-.125-.025-.125-.025-.15-.025-.15-.025-.15-.025-.15-.025-.175-.025-.15-.025-.175-.025-.175-.025-.175-.025-.325-.025-.325-.025-.3-.025-.325-.025-.6-.025-.275-.025-.275-.025-.225-.025h-.125l-.1-.025-.1-.025-.1-.025-.1-.025-.1-.025-.1-.025-.05-.025-.05-.025-.05-.025-.025-.025-.05-.025h-.025l-.05-.025-.025-.025-.025-.025-.1-.075-.05-.075-.05-.075-.05-.075-.05-.075-.05-.075-.05-.075-.05-.075-.05-.075-.025-.075-.05-.075-.025-.075-.025-.075-.025-.075-.025-.075-.025-.075-.025-.075-.025-.075V89.05l.025-.075.025-.075.025-.075.025-.075.025-.075.025-.075.025-.075.05-.075.025-.075.05-.05.025-.05.05-.05.05-.05.05-.05.05-.05.05-.05.05-.05.05-.05.05-.05.1-.075.1-.075.1-.075.1-.075.125-.075.1-.075.125-.075.1-.075.225-.15.225-.15.225-.15.1-.075.1-.075.1-.075.1-.075.1-.075.1-.075.1-.075.075-.075.1-.075.075-.075.025-.025.025-.025.05-.025.025-.025.025-.025.025-.025.025-.025.025-.025.025-.025.025-.025.025-.025.025-.025.025-.025.025-.025V85.7l.025-.025.025-.025.025-.025V85.6l.025-.025v-.025l.025-.025V85.3l-.025-.05v-.05l-.025-.05-.025-.05-.025-.05L136 85l-.025-.05-.025-.05-.025-.05v-.025h-.05l-.05-.025-.025-.025-.05-.025h-1.375l-.225.025-.25.025-.25.025-.25.025-.25.025-.25.025-.225.025-.5.075-.225.025-.225.025-.2.025-.2.025-.2.025H130.325l-.1-.025-.1-.025-.1-.025-.1-.025-.075-.025-.1-.025-.075-.025-.075-.025-.1-.05-.075-.05-.075-.05-.075-.05-.075-.05-.075-.05-.15-.1-.125-.1-.15-.1-.15-.1-.125-.1-.15-.1-.275-.2-.125-.1-.125-.1-.15-.1-.125-.1-.125-.1-.125-.075-.125-.075-.05-.025-.05-.025-.05-.025-.05-.025-.05-.025-.05-.025-.05-.025-.05-.025-.05-.025-.05-.025-.025-.025h-.25v-.15z"/><path fill="#BCE0FA" fill-rule="nonzero" d="M126.575 83.3h.225l.025.025.05.025.025.025h.025l.025.025.025.025.025.025.075.05.05.05.025.025h.05l.025.025.025.025.025.025.075.025.075.025.075.025.075.025.075.025.075.025.075.025.05.025.1.025h.025l.05.025.05.025.05.025.05.025.05.025.025.025.05.025.025.025.025.025.025.025.025.05.025.05.025.05.025.05.025.05.025.05.025.05v.05l.025.025h.05l.15.025.15.025.15.025.15.025.15.025.125.025.075.025.075.025.075.025.05.025.075.025.05.025.075.025.075.025.05.05.075.05.025.025h.575l.075.025.1.025.075.025.075.025.1.025.075.05.1.05.075.05.1.05.075.075.075.075.05.075.05.1.05.1.05.1.025.1.025.1.025.075V86.45l-.025.05-.025.05v.025l-.025.025-.025.025-.025.05-.025.05-.025.025-.025.05-.025.05-.025.025-.025.025-.025.025-.025.025-.025.025-.025.025-.025.025-.025.025-.025.025-.05.05-.075.05-.075.05-.05.025-.075.025-.075.025-.05.025-.05.025-.05.025-.125.025-.1.025-.1.025-.1.025-.125.025-.1.025H130l-.225.025h-.075l.025.025.025.05.025.05.025.05.025.05v.05l.025.05V88l-.025.05v.1l-.025.025v.025l-.025.025-.025.025v.025l-.025.05-.025.05-.025.05-.05.075-.025.05-.05.05-.05.05-.075.075-.1.075-.1.075-.1.075-.1.075-.1.075-.1.075-.1.075-.2.15-.225.15-.225.15-.2.125-.2.125-.05.025h.025l.025.025.025.025.025.025.025.05.025.025.025.05.025.025v.025l.025.025v.025l.025.025v.05l-.025.05v.1l-.025.05-.025.025v.025l-.025.025-.025.025-.025.025-.025.025-.025.025-.025.025-.025.025-.025.025-.025.05-.05.075-.05.075-.05.05-.05.05-.125.125-.125.125-.275.225-.125.1-.125.1-.125.1-.05.05-.05.05-.025.025-.05.025-.05.025-.025.025-.05.025-.05.025-.05.025-.05.025H125.625l-.05-.025-.05-.025-.05-.025-.025-.025-.05-.025-.05-.025-.025-.025-.05-.025-.025-.025-.025-.025-.025-.025-.025-.05-.025-.05-.025-.05-.025-.05-.025-.05-.025-.05-.025-.05v-.25l.025-.05.025-.05.025-.05.025-.05.025-.05.025-.05.025-.05.025-.05.025-.025.05-.025.05-.075.075-.075.125-.125.025-.025-.025-.025-.05-.025-.025-.025-.05-.025-.025-.025-.025-.025-.025-.025-.025-.025-.025-.025-.025-.025-.025-.025-.025-.025-.025-.025-.025-.025-.025-.025v-.05l-.025-.05v-.25l.025-.05.025-.05.025-.05.025-.05V89.6l.025-.05.025-.05.025-.05.025-.025.025-.025.025-.025.025-.05.05-.05.05-.05.05-.05.05-.025.05-.025.1-.05.1-.05.1-.05.175-.1.175-.075.05-.025.05-.025.125-.075.125-.075.15-.1.075-.05h-.225l-.1-.025-.1-.025-.1-.025-.05-.025-.05-.025-.05-.025-.025-.025-.025-.025h-.025l-.05-.025-.025-.025h-.025l-.025-.025-.025-.025-.025-.025h-.025l-.025-.025-.025-.025-.025-.025-.025-.05h-.025l-.025-.025-.025-.025-.025-.025-.025-.025-.025-.05v-.025h-.05l-.125.05-.125.05-.125.05-.125.025-.125.025-.125.025-.125.025-.125.025-.125.025h-.375l-.075-.025-.1-.025-.05-.025-.05-.025-.025-.025h-.025l-.05-.025-.025-.025h-.025l-.025-.025-.025-.025-.025-.025-.025-.025-.025-.025-.025-.025-.025-.025-.025-.025-.025-.025-.025-.025-.025-.025-.025-.025-.025-.025-.025-.025-.025-.025-.025-.025v-.025l-.025-.05-.025-.025-.2-.05-.1-.025-.1-.025-.1-.025-.1-.025-.025-.025-.05-.025-.025-.025h-.025l-.025-.025-.025-.025-.025-.025-.05-.025-.025-.025-.025-.025-.025-.025-.025-.025-.025-.05-.025-.05-.025-.05-.025-.05-.025-.05-.025-.05-.025-.05-.025-.05v-.2l.025-.05v-.05l.025-.05.025-.05.025-.05.025-.05.025-.05.025-.05.025-.025.025-.025.05-.025.025-.025.025-.025.05-.025.025-.025.05-.025h.025l.025-.025.05-.025.05-.025h.525l.05-.025.1-.025.1-.025.1-.025.125-.025.1-.025h-.025v-.05l-.025-.05v-.05l-.025-.05V85.25l.025-.025V85.15l.025-.025V85.1l.025-.05v-.025l.025-.025.025-.05.025-.025.025-.025.025-.05.025-.025.025-.025.025-.075.05-.1.075-.075.05-.075.075-.075.05-.05.075-.05.075-.05.075-.05.075-.05.075-.05.075-.025.1-.025.075-.025L125 84l.075-.025.075-.025.1-.025.075-.025.075-.025.075-.025h.05l.025-.05v-.025l.025-.05v-.05h.025v-.025l.025-.025.025-.025.025-.025.025-.025.025-.025.025-.025h.025l.025-.05.025-.025.025-.025.05-.025.025-.025.05-.025.025-.025.05-.025.025-.025h.025l.05-.025.025-.025h.25zM118.925 61.875H119.15l.025.025.05.025.025.025.05.025.025.025.025.025.025.025.025.025.025.025.025.025.025.025.025.025.025.025.025.025.025.025.025.025.025.025v.025h.025v.025l.025.025v.025l.025.05v.225H120.2l.025.025.025.025.025.025h.025l.025.025.025.025.025.025.025.025.025.025.025.025h.025l.025.025.025.025.025.025.025.025.025.025.025.025.025.05.025.05.025.025.025.025v.025l.025.025v.025l.025.05V63.55l-.025.05v.05l-.025.05-.025.1-.05.125-.05.125-.05.15-.05.15-.05.15-.05.15-.025.075-.025.075-.025.075-.025.05.025.025.025.05.025.05.025.05.025.05.025.05v.1l.025.05v.05l-.025.05v.05l-.025.05v.05l-.025.05-.025.05-.025.05-.025.05-.025.025-.025.025-.025.025-.025.025-.025.025-.025.025-.025.025-.05.025-.025.025-.05.025-.05.025-.025.025-.05.025H119.375l-.05-.025h-.025l-.025-.025-.05-.025-.025-.025h-.025l-.05-.025-.025-.025-.025-.025h-.025l-.025-.025L119 65.9l-.025-.025-.025-.025-.025-.025-.025-.025-.025-.025-.025-.025-.025-.025-.025-.05v-.025l-.025-.025-.025-.025-.025-.025v-.025l-.025-.025-.025-.05-.025-.075-.025-.075v-.25l.025-.1v-.1l.025-.025h-.025l-.15.075-.175.075-.175.075-.1.05-.1.05-.1.05-.1.05-.1.025-.1.025-.1.025-.1.025-.125.025-.125.025-.1.025-.125.025-.125.025h-.675l-.05-.025-.075-.025-.05-.025-.05-.025-.075-.025-.05-.025-.075-.025-.05-.025-.025-.025-.025-.025-.025-.025-.025-.025-.025-.025-.025-.025-.025-.025h-.025l-.025-.025-.025-.025-.025-.025h-.025l-.025-.025-.025-.025-.025-.025-.025-.025-.025-.025-.025-.025-.025-.025v-.025H114.875l-.05-.025-.05-.025-.025-.025h-.025l-.025-.025-.05-.025-.025-.025-.025-.025h-.025l-.025-.025-.025-.025-.025-.025-.025-.025-.025-.025-.025-.025-.025-.025-.025-.025-.025-.025-.025-.025-.025-.025v-.025l-.025-.025v-.025l-.025-.025v-.025l-.025-.025v-.15l.025-.05V64l.025-.05.025-.025V63.9l.025-.025.025-.025.025-.025.025-.025.025-.05.025-.05.05-.05.05-.075.075-.075.075-.05.05-.05.075-.05.075-.05.075-.05.15-.1.175-.1.175-.1.125-.075h-.1l-.2.025h-1.075l-.1-.025-.1-.025-.125-.025-.1-.025-.05-.025-.05-.025-.05-.025-.05-.025-.05-.025-.05-.025-.05-.05-.025-.025-.025-.025-.025-.025h-.025l-.025-.025-.025-.025-.025-.025-.025-.025-.025-.025-.025-.025h-.025l-.025-.05-.025-.05-.025-.05-.025-.025v-.025l-.025-.025-.1-.025-.075-.025-.05-.025-.075-.025-.05-.025-.05-.025-.025-.025-.025-.025-.025-.025-.025-.025-.025-.025-.025-.025-.025-.025-.025-.025-.025-.025-.025-.025-.025-.025-.025-.025-.025-.025v-.025l-.025-.05-.025-.05-.025-.05-.025-.05V61.375l-.025-.05V61.1l.025-.05V61l.025-.025v-.025l.025-.025.025-.025v-.025l.025-.025.025-.025.025-.025.025-.025.025-.025.025-.025.025-.025.025-.05.075-.075.05-.05.05-.05.075-.05.05-.05.05-.05.075-.025.05-.025.075-.025.05-.025.075-.025.05-.025.075-.025.075-.025.05-.025.125-.025.15-.025.125-.025.125-.025.15-.025.15-.025.125-.025H114.8l.275-.025.525-.025.225-.025h.45l.2-.05.2-.05.2-.05.2-.05.025-.025.05-.025.05-.025.125-.05.1-.05.1-.05.1-.05.1-.05.125-.025.05-.025H118.4l.05.025.025.025.05.025.05.025.025.025.025.025.05.025.025.025.025.025.025.025.025.025.025.025.025.025.025.05.025.05.025.05.025.05.025.05v.05l.025.05v.2l-.025.05v.05l-.025.05-.025.05-.025.05-.025.05-.025.025-.025.025-.025.025-.025.025-.025.025-.025.025-.025.025-.025.025-.05.025-.025.025-.05.025-.025.025-.05.025-.1.05-.15.05-.175.075-.125.05.025.05v.2l-.025.05v.05l-.025.05-.025.05-.025.05-.025.025.05.025.05.025.025.025.025.025.025.025.025.025h.025l.025.025.025.025h.025l.025.025.025.025.025.025v.025l.025.025.025.025.025.025v.025l.025.05.025.05v.025l.025.025v.025l.025.025V62.2l.05-.025h.3l.225-.3zm.775 2.85h-.05.05z"/><g fill="#0775C4" fill-rule="nonzero"><path d="M204.525 78.946h1.074l.076-.025.1-.025H206.898l.075.025.175.025.175.025.15.05.15.05.15.05.15.05.15.05.15.05.1.025.15.025.15.025h.25l.2.025.225.025.25.025.275.025.275.05.15.025.15.025.15.025.15.025.15.025.15.025.15.025.15.025.125.025.125.05.125.05.075.025.075.025.075.025.075.025.075.025.075.025.075.05.075.05.075.05.05.05.075.05.05.05.05.05.025.025.05.075.025.05.025.05.025.05.025.075V81.12l-.025.05-.025.05-.025.05-.025.05-.025.05-.05.05-.05.05-.05.05-.05.025-.05.025-.05.025-.05.025-.05.025h-.325l-.075-.025-.05-.025-.075-.025-.075-.025-.075-.025-.125-.05-.125-.05-.275-.125-.125-.05-.05-.025-.05-.025-.05-.025-.05-.025-.05-.025H209.924l-.075-.025-.075-.025-.175-.025-.175-.025-.15-.05-.15-.05-.15-.05-.15-.05-.15-.05-.3-.1-.125-.05-.1-.025-.15-.025-.15-.025-.15-.025-.175-.025-.175-.025-.175-.025-.175-.025-.175-.025-.2-.025-.2-.025-.2-.025-.2-.025h-.1l-.1.025-.175.025-.175.025-.175.025-.175.025-.175.025-.175.025-.175.025-.175.025-.175.025-.175.025-.35.025-.375.025-.375.025-.375.025-.375.025-.375.025h-2.325l-.2.05-.2.05-.2.05-.175.05-.175.05-.175.05-.175.075-.175.075-.075.025-.075.025-.075.025-.075.025-.075.025-.075.025-.075.025-.075.025-.075.05-.075.05-.075.025-.075.05-.075.05-.05.05-.05.05-.05.05-.05.05-.05.05-.05.05-.05.05-.05.05-.05.025h.025l.075.025.075.025.1.025.1.025.1.025.1.025.1.025.1.025.225.025.25.025.25.025.25.025.5.05.25.025.25.025.225.025.125.025.125.025.125.025.1.025.1.025.1.025.1.025.1.025.1.025.1.025.1.025.1.05.1.05.05.025.075.05h.025l.025.025.025.025.1.05.1.05.125.05.125.075.075.05.075.05.075.05.075.05.075.05.075.05.075.05.075.075.075.075.075.075.05.05.025.05.025.05.025.05.025.05.025.05.025.05.025.05.025.075.025.075.025.075v.45l-.025.075-.025.075-.025.075-.025.075-.025.075-.05.075-.05.075-.05.075-.05.05-.05.05-.05.05-.05.05-.05.05-.05.05-.05.05-.05.05-.05.05-.05.05-.05.025-.05.025-.05.025-.075.025-.075.025-.125.05-.125.05-.15.05-.15.05-.15.05-.15.05-.15.05-.15.05-.15.05-.175.025-.175.025-.175.025-.175.025-.175.025-.175.025-.175.025-.175.025-.175.025-.175.025-.175.025-.35.05-.35.025-.35.025-.325.025-.325.025-.3.025-.3.025-.275.025h-.25l-.45.025H194.35l-.075-.025-.075-.025-.075-.025-.075-.05-.05-.05-.05-.05-.05-.05-.05-.05-.025-.075-.025-.075-.025-.075-.025-.075V86.17l.025-.075.025-.075.025-.075.025-.075.05-.05.05-.05.05-.05.05-.05.05-.05.075-.025.075-.025.075-.025h.7l.425-.025h.25l.275-.025.275-.025.3-.025.3-.025.325-.025.325-.025.325-.025.325-.025.175-.025.175-.025.175-.025.15-.025.15-.025.15-.025.15-.025.15-.025.15-.025.15-.025.15-.025.125-.025.125-.025.125-.025.125-.025.125-.025.1-.025.1-.025.1-.05.075-.05.025-.025.025-.025.025-.025.025-.025.025-.025.025-.025H201l-.05-.025-.05-.025-.05-.025-.1-.05-.1-.05-.125-.05-.125-.05-.075-.025-.075-.025-.075-.05-.05-.025h-.05l-.025-.025-.05-.025-.05-.025-.05-.025-.075-.025-.075-.025-.075-.025-.1-.025-.1-.025-.1-.025h-.1l-.225-.025-.225-.025-.25-.025-.5-.05-.25-.025-.25-.025-.25-.025-.25-.025-.125-.025-.125-.025-.125-.025-.125-.025-.125-.025-.125-.025-.125-.025-.1-.025-.1-.025-.1-.025-.1-.025-.1-.05-.1-.05-.1-.05-.05-.025-.05-.025-.05-.025-.05-.025-.05-.025-.05-.05-.05-.05-.05-.05-.05-.05-.05-.05-.05-.05-.05-.075-.025-.075-.025-.075-.025-.075-.025-.075-.025-.075v-.3l.025-.075.025-.075.025-.075.025-.075.025-.075.025-.05.025-.05.025-.05.05-.05.05-.05.05-.05.05-.05.05-.05.05-.05.05-.05.075-.075.075-.075.075-.075.075-.05.075-.05.075-.05.075-.05.075-.05-.35-.025-.35-.025-.325-.025-.325-.025-.3-.05-.1-.025h-.125l-.275-.025-.3-.025-.15-.025-.175-.025-.175-.025-.175-.025-.175-.025-.175-.025-.175-.025-.1-.025-.075-.025-.075-.025-.075-.025-.075-.025-.075-.025-.075-.025-.075-.025-.075-.025-.075-.025-.075-.05-.075-.05-.075-.05-.075-.05-.075-.05-.075-.05-.075-.05-.075-.075-.075-.075-.075-.075-.075-.075-.075-.075-.05-.075-.05-.1-.05-.1-.05-.1-.05-.1-.025-.1-.025-.1-.025-.1-.025-.1v-.5l.025-.125.025-.125.025-.125.025-.075.025-.075.025-.075.025-.075.025-.075.025-.075.025-.05.05-.05.05-.05.05-.05.05-.05.05-.05.05-.05.05-.05.05-.05.05-.05.1-.075.1-.075.1-.075.1-.075.1-.075.1-.075.1-.075.1-.075.1-.05.1-.05.1-.05.1-.05.2-.1.2-.1.35-.175.15-.075.125-.075.075-.025.075-.025.075-.025.075-.025.075-.025.075-.025.075-.025.075-.025.075-.025.075-.025.075-.025.075-.025.075-.025H195.224l.125.025.125.025.125.025.125.025.125.025.125.025.25.05.225.05.225.05.225.05.1.025.1.025.1.025.1.025.175.025.175.025.175.025.175.025.175.025.175.025.175.025.175.025.175.025h.95l.375.025h3.8l.275-.025.275-.025.275-.025.275-.025.275-.025.275-.025.275-.05.275-.05.275-.05.125-.025.125-.025.125-.025.125-.025.125-.025.125-.025.125-.025.125-.025h.05l.05-.025.05-.025.05-.025.075-.025.15-.075.15-.075.15-.075.175-.075.15-.075.15-.075.075-.025.075-.025.075-.025.075-.025.075-.025.1-.025.075-.025h.35l.075.025.075.025.05.025.05.025.05.05.05.05.05.05.05.05.025.05.025.05.025.075.025.05v.4l-.025.075-.025.05-.025.075-.025.05-.025.05-.05.075-.05.05-.05.05-.05.05-.075.05-.075.025-.075.025-.075.025-.075.025H209.15l-.15.075-.15.075-.175.075-.175.075-.175.075-.1.05-.1.05-.1.025-.1.025-.1.025-.075.025-.15.025-.15.025-.15.025-.15.025-.15.025-.15.025-.15.025-.15.025-.3.05-.3.05-.3.05-.3.05-.3.025-.3.025-.3.025-.3.025-.3.025H199.9l-.4-.025h-.8l-.2-.025-.2-.025-.2-.025-.2-.025-.2-.025-.2-.025-.2-.025-.2-.025-.2-.025-.2-.025-.125-.025-.125-.025-.125-.025-.125-.025-.25-.05-.225-.05-.225-.05-.225-.05-.1-.025-.1-.025-.1-.025-.1-.025-.1-.025H193.674l-.05.025-.05.025-.05.025-.05.025-.05.025-.05.025-.05.025-.05.025-.15.075-.175.075-.35.15-.175.075-.175.1-.1.05-.075.05-.075.05-.075.05-.075.05-.075.05-.075.05-.075.05-.075.05-.05.05-.05.05-.05.05-.025.025-.025.025-.025.025-.025.025-.025.025-.025.025-.025.025V78.546l.025.025.025.025.025.025.025.025.025.025.025.025.025.025.025.025.025.025.05.025.05.025.05.025.05.025.05.025.05.025.05.025.05.025.05.025.05.025.05.025.075.025.075.025.075.025.15.025.15.025.15.025.15.025.15.025.15.025.15.025.275.025.275.025.125.025.125.025.3.025.3.025.325.025.325.025.325.025.35.025.35.025.35.025.35.025.35.025.35.025.375.025h.75l.225-.05.225-.05.225-.05.225-.05.225-.025.225-.025.225-.025.225-.025.225-.025.225-.025.25-.025.225-.025.25-.025.25-.025H203.674zM92.817 3.884h.25l.25.025.25.025.25.025.25.025.25.025.25.025.25.05.25.05.25.05.25.05.25.05.25.075.25.075.125.05.125.05.125.05.125.05.125.05.125.05.125.05.125.05.125.05.125.05.125.05.125.05.125.05.125.05.125.05.125.05.1.05.1.05.1.05.1.075.1.075.1.075.1.075.1.05.224.175.2.2.175.225.15.25.126.25.075.275.05.275.024.275-.025.275-.05.275-.1.275-.124.25-.15.225-.175.2-.2.2-.225.15-.25.125-.25.1-.275.075-.275.025h-.276l-.275-.05-.275-.075-.25-.1-.25-.15-.075-.05-.05-.025-.05-.025-.05-.025-.05-.025-.05-.025-.075-.025-.075-.025-.075-.025-.075-.025-.075-.025-.075-.025-.075-.025-.075-.025-.075-.025-.075-.025-.075-.025-.075-.025-.075-.025-.075-.025-.075-.025-.075-.025-.075-.025-.075-.025-.15-.05-.15-.05-.15-.05-.15-.025-.175-.025-.175-.025-.174-.025-.175-.025-.175-.025-.175-.025-.175-.025H91.641l-.175.025-.175.025-.175.025-.175.025-.175.025-.175.025-.175.025-.175.05-.175.05-.175.05-.175.05-.15.05-.15.05-.15.05-.15.05-.15.05-.076.025-.075.025-.075.025-.075.025-.075.025-.075.025-.075.025-.075.025-.075.025-.075.025-.075.025-.075.05-.075.025-.075.05-.05.05-.05.05-.075.05-.05.05-.05.05-.05.05-.05.05-.05.05-.05.05-.05.05-.05.05-.05.05-.05.05-.05.05-.05.05-.05.05-.05.05-.05.05-.174.175-.175.175-.35.35-.376.35-.374.35-.175.175-.175.175-.175.175-.175.175-.175.175-.175.175-.175.175-.175.175-.15.175-.076.075-.075.1-.075.1-.075.075-.075.075-.075.075-.075.075-.075.075-.075.075-.05.075-.05.075-.05.075-.05.075-.05.075-.05.075-.05.075-.05.075-.05.075-.05.075-.05.075-.05.075-.024.075-.025.075-.026.075-.025.075-.025.075-.024.075-.025.075v.35l-.026.125-.025.325-.05.75-.025.425-.025.225-.025.225-.025.225-.024.225-.025.225-.026.225-.025.225-.05.225-.05.225-.025.125-.025.1-.024.125-.025.125-.026.125-.05.125-.05.125-.05.125-.05.125-.075.125-.075.15-.1.15-.1.15-.174.1-.076.1-.15.15-.1.075-.124.1-.126.075-.124.075-.1.05-.476.225-.425.225-.424.225-.425.225-.425.225-.425.25-.425.25-.425.25-.425.25-.425.25-.425.25-.425.25-.425.25-.425.275-.425.275-.425.275-.425.275-.425.275-.425.275-.425.275-.425.275-.425.275-.425.275-.425.275-.425.3-.425.3-.85.575-.85.6-.85.6-1.725 1.2-.876.6-.874.6-.875.6-.875.6-.45.3-.45.3-.45.3-.45.3-.45.3-.45.3-.45.3-.45.3-.45.275-.45.275-.45.275-.45.275-.45.275-.45.275-.45.275-.45.275-.45.275-.45.275-.476.25-.45.25-1.05.6-1.05.6-1.05.6-1.05.6-1.05.6-1.05.6-.524.3-.526.3-.525.3-.525.3-.525.3-.524.3-.526.3-.525.3-.525.3-.525.325-.524.325-.526.325-.525.325-.525.325-.525.325-.524.325-.5.325-.5.325-.5.325-.5.325-.5.325-.5.325-.5.325-.5.325-.5.325-.5.325-.5.325-.5.325-.5.325-.5.325-.5.35-.5.35-.5.35-.5.35-.5.35-.5.35-.5.35-.476.35-.475.35-.474.35-.476.35-.474.35-.476.35-.475.35-.474.35-.476.35-.474.35-.476.375-.475.375-.474.375-.476.375-.475.375-.25.2-.25.2-.25.2-.25.2-.25.175-.25.175-.25.175-.25.175-.25.175-.25.175-.25.175-.25.175-.5.325-.5.325-1 .65-.5.325-.25.15-.25.15-.224.15-.225.15-.225.15-.226.15-.224.15-.225.15-.225.175-.225.175-.126.1-.124.1-.126.1-.05.05-.05.05-.05.05-.05.05v.1l-.025.275-.05.275-.075.275-.125.25-.15.225-.175.225-.2.2-.224.175-.25.125-.25.1-.276.075-.274.025h-.275l-.275-.025-.275-.075-.25-.1-.25-.125-.225-.175-.2-.2-.175-.225-.075-.1-.1-.15-.075-.15-.075-.15-.075-.175-.05-.175-.05-.175-.025-.175-.025-.175-.025-.175V66.009l.025-.15.025-.15.025-.15.025-.15.025-.125.05-.125.05-.125.05-.125.05-.1.05-.1.05-.1.05-.1.05-.1.05-.1.1-.15.1-.15.1-.15.125-.125.1-.125.1-.125.1-.1.1-.1.1-.1.1-.1.1-.1.1-.075.1-.075.174-.15.176-.125.15-.125.25-.2.25-.175.25-.175.25-.175.25-.175.25-.175.25-.175.25-.175.25-.175.25-.175.5-.325 1-.65.5-.325.5-.325.25-.15.25-.15.224-.15.225-.15.225-.15.225-.15.226-.175.225-.175.224-.175.225-.175.226-.175.225-.175.475-.375.475-.375.475-.375.475-.375.475-.375.475-.375.5-.375.5-.375.5-.375.5-.375.5-.375.5-.35.5-.35.5-.35.5-.35.5-.35.5-.35.5-.35.5-.35.5-.35.5-.35.5-.35.5-.35.5-.35.5-.35.5-.35.5-.35.525-.35.525-.325.525-.325.525-.325.525-.325.525-.325.525-.325.525-.325.525-.325.525-.325.525-.325.525-.325.525-.325.525-.325.525-.325.525-.325.525-.325.525-.325.525-.325.525-.325.525-.325.525-.3.525-.3.525-.3.525-.3 1.05-.6 1.05-.6 1.05-.6 1.05-.6 1.05-.6 1.05-.6.45-.25.425-.25.425-.25.425-.25.45-.25.425-.25.425-.275.425-.275.425-.275.425-.275.425-.275.425-.275.425-.275.425-.275.425-.275.425-.275.425-.275.425-.3.425-.3.425-.3.875-.6.875-.6.875-.6.875-.6 1.725-1.2.875-.6.875-.6.875-.6.425-.3.45-.3.45-.3.45-.3.45-.3.45-.3.45-.3.45-.275.45-.275.45-.275.45-.275.45-.275.45-.275.45-.275.45-.275.45-.275.45-.275.45-.275.45-.25.45-.25.45-.25.45-.25.45-.25.45-.25.25-.125v-.05l.025-.15.025-.15.025-.175.024-.175.025-.175.026-.2.025-.2.025-.375.05-.75.025-.35.025-.175.025-.175.024-.175.025-.175.026-.175.025-.1.025-.1.05-.175.05-.175.05-.175.05-.175.05-.175.05-.15.075-.15.075-.15.075-.15.075-.15.075-.15.075-.15.075-.15.075-.15.075-.15.075-.15.075-.125.1-.125.1-.125.1-.125.1-.125.1-.125.1-.125.1-.125.1-.125.1-.125.1-.125.1-.125.1-.125.1-.125.2-.225.2-.225.2-.225.2-.225.2-.2.2-.2.2-.2.2-.2.2-.2.374-.375.376-.35.35-.325.15-.15.15-.15.075-.075.1-.1.1-.1.1-.075.1-.075.1-.075.1-.075.1-.075.1-.075.1-.075.1-.075.1-.075.1-.075.1-.075.1-.075.1-.075.1-.075.1-.075.1-.075.1-.075.1-.075.1-.05.124-.05.126-.05.1-.05.124-.05.125-.05.125-.05.125-.05.125-.05.125-.05.125-.05.225-.1.25-.1.25-.075.25-.075.25-.075.25-.075.25-.075.25-.05.25-.05.25-.05.25-.05.25-.05.25-.025.25-.025.25-.025.25-.025.25-.025.25-.025h.75l.45.25zm-81.35 61.6l-.026-.025-.05-.075v-.025l.075.125z"/><path d="M99.067 6.259l.2.025.175.05.175.05.174.075.15.075.2.125.175.15.1.1.1.125.075.075.1.125.075.1.075.15.076.125.075.125.1.225.1.225.05.075.024.075.025.025.026.025.05.05.15.15.1.1.1.125.1.15.075.1.05.1.075.1.075.1.075.125.05.125.05.125.05.125.05.125.05.15.05.15.025.1.024.125.025.1.026.125.05.125.05.15.05.15.05.175.05.175.075.175.075.2.075.2.075.2.075.2.075.2.1.2.1.2.1.2.1.2.1.2.05.075.05.075.05.075.05.075.05.075.05.075.05.075.05.075.05.075.05.05.05.05.05.05.05.05.025.05.025.05.025.025.024.025.025.025.05.025.126.075.124.075.126.075.124.075.126.075.1.1.1.1.1.1.1.1.1.1.1.1.1.1.075.1.075.1.075.1.075.1.075.1.075.1.05.1.05.1.05.1.05.1.05.1.1.175.075.175.075.175.075.175.075.15.075.15.124.275.05.125.05.125.05.1.05.1.05.075.05.075.025.025.026.025.025.025.025.025.024.025.025.025v.025l.026.025.025.025.1.1.1.1.1.1.1.1.1.1.1.125.1.125.1.125.1.125.1.125.1.125.1.125.1.125.075.125.075.125.075.125.075.125.075.125.075.125.075.125.15.25.15.25.15.25.15.25.124.25.125.25.125.25.125.25.125.25.125.25.125.25.125.25.1.25.1.25.1.25.1.25.1.25.1.25.2.5.2.5.375 1 .2.5.2.5.1.25.1.25.1.225.1.225.1.225.1.225.1.225.1.225.1.225.1.225.1.225.1.2.1.2.1.2.1.2.1.2.1.2.126.2.05.075.05.1.05.1.05.075.05.1.05.075.05.075.05.075.05.075.05.075.075.075.075.1.124.15.125.15.125.15.1.175.1.175.1.175.1.175.1.175.1.175.1.175.1.175.075.175.075.175.076.175.075.175.075.175.075.175.075.175.075.175.075.175.075.175.05.175.05.15.05.15.05.15.05.15.1.325.1.325.1.3.1.3.1.3.175.6.075.275.075.275.075.275.075.275.075.275.1.275.05.125.05.125.05.125.05.125.05.125.05.125.05.125.05.125.05.125.05.1.05.1.05.125.225.425.224.45.225.45.225.45.226.475.225.475.224.475.225.5.225.5.226.5.225.5.2.5.2.525.2.525.2.525.2.525.2.525.2.55.1.275.1.275.1.275.1.275.1.275.1.275.1.275.1.275.1.275.1.275.075.275.075.275.075.275.075.275.075.275.075.275.075.275.075.275.075.275.075.275.075.275.075.275.075.275.075.275.075.3.075.275.075.3.075.3.05.3.05.3.05.3.05.3.05.3.05.3.05.3.05.3.05.3.05.3.05.3.05.3.05.3.025.3.025.3.024.3.025.3.026.3.025.3.025.3.024.3.025.3.026.3.025.275V69.759l-.025.275-.025.275-.026.275-.025.275-.025.275-.024.275-.025.275-.026.275-.05.275-.05.275-.05.275-.05.275-.05.275-.05.275-.05.275-.05.275-.075.275-.075.275-.075.275-.075.275-.075.275-.075.275-.1.275-.1.25-.1.25-.1.25-.1.25-.1.25-.124.25-.125.25-.125.275-.075.15-.1.15-.1.125-.1.125-.1.1-.1.1-.1.075-.1.075-.1.075-.075.05-.076.05-.1.05-.15.1-.15.075-.15.075-.15.075-.15.075-.15.05-.15.05-.125.05-.125.05-.125.05-.25.1-.25.075-.225.075-.2.075-.075.025-.075.025-.05.025-.05.025-.024.025-.1.075-.1.075-.1.075-.1.05-.1.075-.2.125-.2.1-.225.1-.225.1-.225.1-.226.1-.225.075-.224.075-.225.075-.225.075-.226.075-.225.05-.224.05-.225.05-.225.05-.226.05-.225.05-.224.025-.225.025-.225.025-.226.025-.225.025-.224.025H113.04l-.224-.025-.2-.025-.2-.025-.2-.025-.2-.025-.2-.025-.2-.025-.2-.025-.2-.025-.2-.025-.2-.025-.2-.025-.2-.025-.2-.025-.2-.05-.2-.05-.2-.05-.4-.075-.4-.075-.4-.1-.376-.1-.374-.1-.4-.1-.175-.05-.175-.05-.175-.05-.175-.05-.15-.075-.15-.075-.15-.075-.15-.075-.15-.075-.15-.075-.276-.125-.525-.275-.25-.125-.225-.1-.1-.05-.1-.05-.075-.05-.075-.025-.05-.025-.05-.025h-.1l-.25-.05-.224-.075-.226-.1-.225-.125-.2-.15-.174-.175-.15-.2-.15-.2-.126-.225-.1-.225-.05-.25-.024-.25v-.25l.025-.25.05-.25.075-.225.1-.225.125-.225.15-.2.174-.175.2-.15.2-.15.225-.125.225-.1.25-.075.25-.025h.451l.125.025.125.025.1.025.1.025.1.025.1.025.174.05.175.05.175.05.15.075.15.075.15.075.15.075.15.075.275.125.275.125.526.25.25.125.1.05.1.05.1.05.1.05.075.025.075.025.05.025.05.025H108.416l.325.075.35.075.35.075.35.075.35.075.35.075.174.025.175.025.175.025.175.025.175.025.175.025.175.025.175.025.175.025.175.025.175.025.175.025.175.025.175.025.175.025.175.025H115.117l.15-.025.15-.025.15-.025.15-.025.15-.025.15-.025.125-.025.125-.025.125-.025.125-.025.125-.05.125-.05.125-.05.125-.05.125-.05.125-.05.125-.05.125-.05.125-.05.125-.075.125-.075.05-.025.05-.025.05-.025.05-.025.05-.025.1-.075.126-.075.15-.075.15-.075.124-.05.126-.05.124-.05.126-.05.124-.05.225-.075.225-.075.225-.075.226-.075.1-.025.1-.025.1-.025.075-.025.05-.1.075-.2.075-.2.075-.2.075-.2.075-.2.075-.2.075-.2.075-.2.05-.2.05-.2.05-.2.05-.2.05-.225.05-.225.05-.225.05-.225.05-.225.025-.225.025-.225.025-.225.024-.225.025-.225.026-.225.025-.225.025-.225.024-.225.025-.225v-2.725l-.025-.25-.025-.25-.025-.25-.024-.25-.025-.25-.026-.25-.025-.25-.025-.25-.024-.25-.025-.25-.026-.25-.025-.25-.05-.25-.05-.25-.05-.25-.05-.25-.05-.25-.05-.25-.05-.25-.05-.25-.05-.25-.05-.275-.05-.275-.05-.275-.05-.275-.05-.275-.05-.275-.075-.275-.075-.275-.075-.275-.075-.275-.075-.275-.075-.275-.075-.275-.075-.275-.075-.25-.075-.25-.075-.275-.075-.25-.075-.25-.075-.25-.075-.25-.075-.25-.075-.25-.075-.25-.075-.25-.1-.25-.1-.25-.1-.25-.1-.25-.1-.25-.175-.5-.2-.5-.2-.5-.2-.5-.2-.5-.2-.5-.2-.475-.2-.475-.2-.475-.2-.475-.2-.475-.2-.45-.2-.45-.2-.45-.2-.45-.2-.425-.2-.425-.2-.425-.075-.15-.075-.175-.075-.175-.075-.175-.075-.175-.075-.175-.075-.175-.075-.15-.05-.175-.05-.175-.05-.15-.05-.175-.1-.325-.1-.325-.1-.3-.1-.3-.1-.3-.075-.3-.174-.575-.075-.275-.076-.275-.075-.275-.075-.275-.1-.275-.05-.125-.05-.125-.05-.125-.05-.125-.05-.125-.05-.125-.05-.125-.05-.125-.05-.125-.05-.125-.05-.125-.05-.1-.05-.1-.05-.1-.05-.1-.05-.1-.05-.1-.05-.1-.05-.1-.05-.1-.075-.1-.075-.1-.075-.1-.075-.1-.075-.1-.075-.1-.075-.1-.1-.125-.1-.125-.1-.125-.1-.125-.075-.125-.075-.125-.075-.125-.075-.125-.075-.125-.075-.125-.075-.125-.15-.25-.15-.25-.15-.25-.15-.25-.124-.25-.126-.25-.124-.25-.126-.25-.124-.25-.126-.25-.124-.25-.126-.25-.1-.25-.1-.25-.1-.25-.1-.25-.1-.25-.1-.25-.2-.5-.2-.5-.374-1-.2-.5-.2-.5-.1-.25-.1-.225-.1-.225-.1-.225-.1-.225-.1-.225-.1-.225-.1-.225-.1-.225-.1-.225-.1-.2-.1-.2-.1-.2-.1-.2-.1-.2-.1-.2-.126-.2-.124-.175-.05-.075-.05-.1-.05-.075-.05-.075-.05-.075-.05-.075-.05-.075-.05-.075-.05-.075-.076-.075-.05-.075-.075-.075-.075-.075-.075-.075-.075-.075-.075-.075-.075-.075-.075-.075-.075-.075-.075-.075-.075-.075-.1-.1-.075-.1-.075-.1-.075-.1-.075-.1-.075-.1-.075-.1-.05-.1-.05-.1-.05-.1-.05-.1-.1-.175-.1-.175-.075-.175-.075-.175-.075-.15-.075-.15-.124-.275-.05-.125-.05-.125-.05-.1-.05-.1-.05-.1-.05-.1-.026-.025-.024-.025-.025-.025-.026-.025-.025-.025-.025-.025-.024-.025-.025-.025v-.025l-.026-.025-.025-.025-.05-.025-.124-.075-.15-.1-.15-.1-.15-.1-.126-.1-.124-.1-.126-.1-.1-.1-.1-.1-.1-.1-.1-.1-.1-.125-.1-.1-.075-.125-.075-.125-.075-.125-.075-.125-.075-.125-.075-.125-.075-.125-.075-.125-.075-.125-.075-.125-.075-.125-.075-.125-.075-.125-.124-.25-.126-.25-.124-.25-.126-.25-.1-.25-.1-.25-.1-.25-.1-.25-.1-.25-.1-.25-.075-.25-.075-.225-.075-.225-.075-.225-.075-.225-.05-.2-.05-.2-.05-.175-.05-.05-.075-.075-.1-.1-.1-.125-.1-.125-.075-.1-.05-.1-.05-.1-.075-.1-.075-.15-.075-.125-.05-.125-.05-.125-.075-.175-.124-.125-.126-.2-.124-.225-.1-.225-.05-.25-.025-.25v-.425l.024-.175v-.025l.025-.175.05-.175.05-.15.075-.175.1-.175.1-.175.15-.175.15-.15.175-.125.175-.125.175-.1.2-.075.2-.05.2-.05.2-.025h.2l.076-.25zm4.95 73.275h.05-.1.05zm-3.025-70.85v-.05.05zm0-.15v-.175.175z"/><path d="M10.867 70.184l.274.05.15.05.15.05.05.025.326.125.425.175.175.075.125.05.05.025.05.025.05.025.05.025.05.025.05.025.1.025.1.025.125.025.125.025.125.025.3.05.325.075.175.05.2.05.2.05.175.05.1.025.075.025.075.025.075.025.175.025.175.025.175.025.175.025.175.025.175.025.175.025.175.025.175.025.175.025.2.025.2.025.4.025.4.025.425.025.425.025.225.025.225.025.225.025.225.025.225.025.25.025.25.025.25.05.25.05.225.05.3.05.3.05.3.05.3.05.3.05.3.05.3.05.3.05.3.05.3.05.3.05.3.05.3.05.3.05.3.025.3.025.325.025.325.025.325.025.325.025.325.025.325.025.325.025.325.025.325.025.325.025.325.025.325.025.65.05.65.025.65.025.65.025.65.025.65.025.65.025.65.025.65.025.65.025h9.075l1.325.025 1.325.025 1.325.025 1.325.025 1.325.025 1.325.025 1.325.05 1.325.05 1.325.05 1.325.05 1.325.05 1.325.05 1.325.05 1.325.05 1.325.05 1.325.075 1.325.075 1.325.075 1.325.075 1.325.075 1.325.075 1.325.075 1.325.075 1.325.075 1.325.075 1.325.075 1.325.1 1.325.1 1.3.1.425.025.425.025.85.05.85.05.85.05.875.05.875.05.875.025.875.025.875.025.875.025.875.025.85.025H98.517l.2-.025.425-.025.45-.025.475-.025.25-.025.25-.025.25-.025.25-.025h2.125l.125.025.15.025.15.025.125.025.15.025.15.025.15.025.15.025.15.025.15.05.15.05.15.05.15.05.15.05.15.075.1.05.25.125.225.175.2.2.175.225.15.225.125.25.075.275.05.275.025.275-.025.275-.05.275-.1.275-.125.25-.15.225-.175.225-.2.2-.225.175-.25.125-.25.1-.275.075-.275.025h-.275l-.275-.025-.275-.075-.25-.1-.05-.025H101.117l-.225.025-.225.025-.225.025-.45.025-.45.025-.45.025-.225.025-.225.025h-4.375l-.875-.025-.875-.025-.875-.025-.875-.025-.875-.025-.875-.025-.875-.05-.875-.05-.875-.05-.875-.05-.875-.05-.425-.025-.425-.025-1.3-.1-1.3-.1-1.3-.1-1.3-.1-1.3-.075-1.3-.075-1.3-.075-1.325-.075-1.3-.075-1.325-.075-1.325-.075-1.325-.075-1.325-.075-1.325-.075-1.325-.05-1.326-.05-1.325-.05-1.325-.05-1.325-.05-1.325-.05-1.325-.05-1.325-.05-1.325-.025-1.325-.025-1.325-.025-1.325-.025-1.3-.025-1.3-.025-1.3-.025H35.916l-.65-.025-.674-.025-.676-.025-.674-.025-.675-.025-.675-.025-.675-.025-.675-.05-.675-.05-.325-.025-.325-.025-.325-.025-.325-.025-.325-.025-.325-.025-.325-.025-.325-.025-.325-.025-.325-.025-.325-.025-.325-.025-.325-.05-.325-.05-.325-.05-.325-.05-.325-.05-.325-.05-.325-.05-.325-.05-.325-.05-.325-.05-.325-.05-.325-.05-.325-.05-.325-.05-.325-.05-.3-.05-.175-.025-.175-.025-.175-.025-.175-.025-.175-.025-.175-.025-.175-.025-.175-.025-.2-.025-.2-.025-.4-.025-.4-.025-.425-.025-.425-.025-.225-.025-.225-.025-.225-.025-.226-.025-.225-.025-.225-.025-.225-.025-.25-.025-.25-.05-.25-.05-.25-.05-.25-.05-.125-.025-.125-.025-.125-.025-.1-.025-.125-.025-.125-.025-.125-.025-.125-.025-.3-.05-.325-.075-.175-.05-.175-.05-.2-.05-.2-.05-.2-.05-.1-.025-.1-.025-.1-.025-.1-.05-.125-.05-.125-.05-.2-.075-.225-.1-.425-.2-.2-.075-.175-.075-.075-.025-.25-.15-.225-.175-.2-.2-.175-.225-.15-.25-.1-.25-.075-.275-.05-.275v-.275l.025-.275.075-.275.1-.275.125-.25.175-.225.2-.2.225-.175.25-.15.25-.125.275-.1.275-.05.275-.025z"/><path d="M9.216 63.159H9.441l.1.025.175.05.1.025.075.025.075.025.075.025h.025l.05.025.05.025.05.025.05.025h.025l.05.025.05.025.05.025.05.025.05.05h.025l.05.05.05.05.05.05.05.05.05.05.026.025.05.05.05.05.05.05.05.05.05.075.05.075v.025l.05.075.025.075.025.075.025.075.025.075.025.075v.025l.025.075.025.075.025.075.025.075.025.075V65.884l-.025.075v.025l-.025.075-.025.075-.025.075-.025.075v.025l-.025.075-.025.075-.025.075-.05.1-.1.175-.075.125-.075.1-.075.1-.125.15-.125.125-.1.1-.1.1-.1.1-.175.15-.175.15-.075.075-.075.075-.075.05-.025.025-.025.125V70.284h.025l.025.025h.025l.025.025.025.025.025.025.025.025.025.025.025.025.025.025.025.025.05.025.05.025.05.025.05.025.05.025.1.025.075.025.075.025.075.025.075.025.075.025.075.025.075.05.075.05.075.05.075.05.075.05.05.05.05.05.05.05.05.05.05.05.05.05.05.05.05.075.05.075.05.075.05.075.05.075.025.075.025.075.025.075.025.075.025.075.025.075.025.075.025.075.025.075V73.134l-.025.075-.025.075-.025.075-.025.075-.025.075-.025.075-.025.075-.025.075-.025.075-.05.075-.05.075-.05.075-.05.075-.05.075-.05.05-.05.05-.05.05-.05.05-.05.05-.05.05-.075.05-.075.05-.075.05-.075.05-.075.05-.075.025-.075.025-.075.025-.075.025-.075.025-.075.025-.075.025-.075.025-.075.025-.075.025h-.6l-.075-.025-.075-.025-.075-.025-.15-.05-.175-.05-.175-.05-.175-.05-.175-.075-.175-.075-.15-.075-.15-.075-.15-.075-.15-.075-.15-.1-.15-.1-.15-.1-.125-.1-.125-.1-.125-.1-.125-.125-.125-.125-.125-.125-.1-.125-.1-.125-.1-.125-.1-.125-.1-.125-.075-.125-.075-.125-.075-.15-.075-.15-.075-.15-.05-.15-.05-.15-.05-.15-.05-.15-.05-.15-.05-.15-.025-.15-.025-.15-.025-.15-.025-.15-.025-.15-.025-.15-.025-.125-.025-.15v-1.675l.025-.125.025-.125.025-.25.025-.25.05-.275.025-.175.05-.175.05-.175.05-.15.075-.15.075-.125.075-.125.075-.1.075-.1.075-.1.075-.1.075-.075.075-.075.075-.075.125-.125.125-.125.125-.125.125-.1.125-.1.1-.1.025-.05.025-.075.025-.075.025-.075.025-.075.05-.075.05-.075.05-.075.05-.075.05-.075.05-.05.05-.05.05-.05.05-.05.05-.05.05-.05.075-.05.075-.05.075-.05.075-.05.075-.05.075-.025.075-.025.075-.025.075-.025.075-.025.075-.025.075-.025.075-.025.075-.025h.375l.275-.15zm-.474 4.4h.024-.024z"/></g></g></svg>woocommerce-blocks/build/stock-filter-frontend.asset.php000064400000000400151335517640017513 0ustar00<?php return array('dependencies' => array('lodash', 'react', 'wc-blocks-data-store', 'wc-settings', 'wp-a11y', 'wp-data', 'wp-element', 'wp-html-entities', 'wp-i18n', 'wp-is-shallow-equal', 'wp-polyfill'), 'version' => 'f1227ee0ab262761f34d5742a408129d');woocommerce-blocks/build/attribute-filter-frontend.asset.php000064400000000421151335517640020376 0ustar00<?php return array('dependencies' => array('lodash', 'react', 'wc-blocks-data-store', 'wc-settings', 'wp-a11y', 'wp-data', 'wp-element', 'wp-html-entities', 'wp-i18n', 'wp-is-shallow-equal', 'wp-polyfill', 'wp-primitives'), 'version' => 'c847f9ae0a7b1475786ec96fd457fdf4');woocommerce-blocks/build/products-by-attribute.js000064400000074175151335517640016277 0ustar00this.wc=this.wc||{},this.wc.blocks=this.wc.blocks||{},this.wc.blocks["products-by-attribute"]=function(e){function t(t){for(var n,i,l=t[0],a=t[1],u=t[2],b=0,d=[];b<l.length;b++)i=l[b],Object.prototype.hasOwnProperty.call(c,i)&&c[i]&&d.push(c[i][0]),c[i]=0;for(n in a)Object.prototype.hasOwnProperty.call(a,n)&&(e[n]=a[n]);for(s&&s(t);d.length;)d.shift()();return o.push.apply(o,u||[]),r()}function r(){for(var e,t=0;t<o.length;t++){for(var r=o[t],n=!0,l=1;l<r.length;l++){var a=r[l];0!==c[a]&&(n=!1)}n&&(o.splice(t--,1),e=i(i.s=r[0]))}return e}var n={},c={36:0},o=[];function i(t){if(n[t])return n[t].exports;var r=n[t]={i:t,l:!1,exports:{}};return e[t].call(r.exports,r,r.exports,i),r.l=!0,r.exports}i.m=e,i.c=n,i.d=function(e,t,r){i.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},i.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.t=function(e,t){if(1&t&&(e=i(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(i.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)i.d(r,n,function(t){return e[t]}.bind(null,n));return r},i.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(t,"a",t),t},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.p="";var l=window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[],a=l.push.bind(l);l.push=t,l=l.slice();for(var u=0;u<l.length;u++)t(l[u]);var s=a;return o.push([766,0]),r()}({0:function(e,t){e.exports=window.wp.element},1:function(e,t){e.exports=window.wp.i18n},11:function(e,t){e.exports=window.React},12:function(e,t){e.exports=window.wp.blockEditor},121:function(e,t){},122:function(e,t){e.exports=window.wp.coreData},130:function(e,t,r){"use strict";var n=r(0),c=r(1),o=r(4);r(2),t.a=function(e){var t=e.value,r=e.setAttributes;return Object(n.createElement)(o.SelectControl,{label:Object(c.__)("Order products by",'woocommerce'),value:t,options:[{label:Object(c.__)("Newness - newest first",'woocommerce'),value:"date"},{label:Object(c.__)("Price - low to high",'woocommerce'),value:"price_asc"},{label:Object(c.__)("Price - high to low",'woocommerce'),value:"price_desc"},{label:Object(c.__)("Rating - highest first",'woocommerce'),value:"rating"},{label:Object(c.__)("Sales - most first",'woocommerce'),value:"popularity"},{label:Object(c.__)("Title - alphabetical",'woocommerce'),value:"title"},{label:Object(c.__)("Menu Order",'woocommerce'),value:"menu_order"}],onChange:function(e){return r({orderby:e})}})}},131:function(e,t,r){"use strict";var n=r(9),c=r.n(n),o=r(16),i=r.n(o),l=r(0),a=r(49),u=r(4),s=r(6),b=r.n(s),d=["className","item","isSelected","isLoading","onSelect","disabled"];t.a=function(e){var t=e.className,r=e.item,n=e.isSelected,o=e.isLoading,s=e.onSelect,p=e.disabled,g=i()(e,d);return Object(l.createElement)(l.Fragment,null,Object(l.createElement)(a.c,c()({},g,{key:r.id,className:t,isSelected:n,item:r,onSelect:s,isSingle:!0,disabled:p})),n&&o&&Object(l.createElement)("div",{key:"loading",className:b()("woocommerce-search-list__item","woocommerce-product-attributes__item","depth-1","is-loading","is-not-active")},Object(l.createElement)(u.Spinner,null)))}},14:function(e,t){e.exports=window.wp.data},15:function(e,t){e.exports=window.wp.apiFetch},188:function(e,t,r){"use strict";r.d(t,"a",(function(){return c}));var n=r(0),c=Object(n.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 230 250",style:{width:"100%"}},Object(n.createElement)("title",null,"Grid Block Preview"),Object(n.createElement)("rect",{width:"65.374",height:"65.374",x:".162",y:".779",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"47.266",height:"5.148",x:"9.216",y:"76.153",fill:"#E1E3E6",rx:"2.574"}),Object(n.createElement)("rect",{width:"62.8",height:"15",x:"1.565",y:"101.448",fill:"#E1E3E6",rx:"5"}),Object(n.createElement)("rect",{width:"65.374",height:"65.374",x:".162",y:"136.277",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"47.266",height:"5.148",x:"9.216",y:"211.651",fill:"#E1E3E6",rx:"2.574"}),Object(n.createElement)("rect",{width:"62.8",height:"15",x:"1.565",y:"236.946",fill:"#E1E3E6",rx:"5"}),Object(n.createElement)("rect",{width:"65.374",height:"65.374",x:"82.478",y:".779",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"47.266",height:"5.148",x:"91.532",y:"76.153",fill:"#E1E3E6",rx:"2.574"}),Object(n.createElement)("rect",{width:"62.8",height:"15",x:"83.882",y:"101.448",fill:"#E1E3E6",rx:"5"}),Object(n.createElement)("rect",{width:"65.374",height:"65.374",x:"82.478",y:"136.277",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"47.266",height:"5.148",x:"91.532",y:"211.651",fill:"#E1E3E6",rx:"2.574"}),Object(n.createElement)("rect",{width:"62.8",height:"15",x:"83.882",y:"236.946",fill:"#E1E3E6",rx:"5"}),Object(n.createElement)("rect",{width:"65.374",height:"65.374",x:"164.788",y:".779",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"47.266",height:"5.148",x:"173.843",y:"76.153",fill:"#E1E3E6",rx:"2.574"}),Object(n.createElement)("rect",{width:"62.8",height:"15",x:"166.192",y:"101.448",fill:"#E1E3E6",rx:"5"}),Object(n.createElement)("rect",{width:"65.374",height:"65.374",x:"164.788",y:"136.277",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"47.266",height:"5.148",x:"173.843",y:"211.651",fill:"#E1E3E6",rx:"2.574"}),Object(n.createElement)("rect",{width:"62.8",height:"15",x:"166.192",y:"236.946",fill:"#E1E3E6",rx:"5"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"13.283",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"21.498",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"29.713",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"37.927",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"46.238",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"95.599",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"103.814",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"112.029",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"120.243",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"128.554",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"177.909",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"186.124",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"194.339",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"202.553",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"210.864",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"13.283",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"21.498",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"29.713",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"37.927",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"46.238",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"95.599",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"103.814",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"112.029",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"120.243",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"128.554",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"177.909",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"186.124",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"194.339",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"202.553",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"210.864",y:"221.798",fill:"#E1E3E6",rx:"3"}))},21:function(e,t){e.exports=window.wp.compose},22:function(e,t){e.exports=window.regeneratorRuntime},23:function(e,t){e.exports=window.wp.url},25:function(e,t){e.exports=window.wp.htmlEntities},26:function(e,t){e.exports=window.wp.blocks},28:function(e,t){e.exports=window.wp.primitives},3:function(e,t){e.exports=window.wc.wcSettings},31:function(e,t){e.exports=window.moment},36:function(e,t){e.exports=window.wp.dataControls},37:function(e,t,r){"use strict";r.d(t,"o",(function(){return o})),r.d(t,"m",(function(){return i})),r.d(t,"l",(function(){return l})),r.d(t,"n",(function(){return a})),r.d(t,"j",(function(){return u})),r.d(t,"e",(function(){return s})),r.d(t,"f",(function(){return b})),r.d(t,"g",(function(){return d})),r.d(t,"k",(function(){return p})),r.d(t,"c",(function(){return g})),r.d(t,"d",(function(){return f})),r.d(t,"h",(function(){return h})),r.d(t,"a",(function(){return O})),r.d(t,"i",(function(){return w})),r.d(t,"b",(function(){return m}));var n,c=r(3),o=Object(c.getSetting)("wcBlocksConfig",{buildPhase:1,pluginUrl:"",productCount:0,defaultAvatar:"",restApiRoutes:{},wordCountType:"words"}),i=o.pluginUrl+"images/",l=o.pluginUrl+"build/",a=o.buildPhase,u=null===(n=c.STORE_PAGES.shop)||void 0===n?void 0:n.permalink,s=c.STORE_PAGES.checkout.id,b=c.STORE_PAGES.checkout.permalink,d=c.STORE_PAGES.privacy.permalink,p=(c.STORE_PAGES.privacy.title,c.STORE_PAGES.terms.permalink),g=(c.STORE_PAGES.terms.title,c.STORE_PAGES.cart.id),f=c.STORE_PAGES.cart.permalink,h=(c.STORE_PAGES.myaccount.permalink?c.STORE_PAGES.myaccount.permalink:Object(c.getSetting)("wpLoginUrl","/wp-login.php"),Object(c.getSetting)("shippingCountries",{})),O=Object(c.getSetting)("allowedCountries",{}),w=Object(c.getSetting)("shippingStates",{}),m=Object(c.getSetting)("allowedStates",{})},39:function(e,t,r){"use strict";r.d(t,"h",(function(){return p})),r.d(t,"e",(function(){return g})),r.d(t,"b",(function(){return f})),r.d(t,"i",(function(){return h})),r.d(t,"f",(function(){return O})),r.d(t,"c",(function(){return w})),r.d(t,"d",(function(){return m})),r.d(t,"g",(function(){return E})),r.d(t,"a",(function(){return j}));var n=r(5),c=r.n(n),o=r(23),i=r(15),l=r.n(i),a=r(7),u=r(3),s=r(37);function b(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function d(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?b(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):b(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var p=function(e){var t=e.selected,r=void 0===t?[]:t,n=e.search,c=void 0===n?"":n,i=e.queryArgs,u=function(e){var t=e.selected,r=void 0===t?[]:t,n=e.search,c=void 0===n?"":n,i=e.queryArgs,l=void 0===i?{}:i,a=s.o.productCount>100,u={per_page:a?100:0,catalog_visibility:"any",search:c,orderby:"title",order:"asc"},b=[Object(o.addQueryArgs)("/wc/store/products",d(d({},u),l))];return a&&r.length&&b.push(Object(o.addQueryArgs)("/wc/store/products",{catalog_visibility:"any",include:r,per_page:0})),b}({selected:r,search:c,queryArgs:void 0===i?{}:i});return Promise.all(u.map((function(e){return l()({path:e})}))).then((function(e){return Object(a.uniqBy)(Object(a.flatten)(e),"id").map((function(e){return d(d({},e),{},{parent:0})}))})).catch((function(e){throw e}))},g=function(e){return l()({path:"/wc/store/products/".concat(e)})},f=function(){return l()({path:"wc/store/products/attributes"})},h=function(e){return l()({path:"wc/store/products/attributes/".concat(e,"/terms")})},O=function(e){var t=e.selected,r=function(e){var t=e.selected,r=void 0===t?[]:t,n=e.search,c=Object(u.getSetting)("limitTags",!1),i=[Object(o.addQueryArgs)("wc/store/products/tags",{per_page:c?100:0,orderby:c?"count":"name",order:c?"desc":"asc",search:n})];return c&&r.length&&i.push(Object(o.addQueryArgs)("wc/store/products/tags",{include:r})),i}({selected:void 0===t?[]:t,search:e.search});return Promise.all(r.map((function(e){return l()({path:e})}))).then((function(e){return Object(a.uniqBy)(Object(a.flatten)(e),"id")}))},w=function(e){return l()({path:Object(o.addQueryArgs)("wc/store/products/categories",d({per_page:0},e))})},m=function(e){return l()({path:"wc/store/products/categories/".concat(e)})},E=function(e){return l()({path:Object(o.addQueryArgs)("wc/store/products",{per_page:0,type:"variation",parent:e})})},j=function(e,t){if(!e.title.raw)return e.slug;var r=1===t.filter((function(t){return t.title.raw===e.title.raw})).length;return e.title.raw+(r?"":" - ".concat(e.slug))}},4:function(e,t){e.exports=window.wp.components},42:function(e,t,r){"use strict";r.d(t,"a",(function(){return a})),r.d(t,"b",(function(){return u}));var n=r(29),c=r.n(n),o=r(22),i=r.n(o),l=r(1),a=function(){var e=c()(i.a.mark((function e(t){var r;return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("function"!=typeof t.json){e.next=11;break}return e.prev=1,e.next=4,t.json();case 4:return r=e.sent,e.abrupt("return",{message:r.message,type:r.type||"api"});case 8:return e.prev=8,e.t0=e.catch(1),e.abrupt("return",{message:e.t0.message,type:"general"});case 11:return e.abrupt("return",{message:t.message,type:t.type||"general"});case 12:case"end":return e.stop()}}),e,null,[[1,8]])})));return function(_x){return e.apply(this,arguments)}}(),u=function(e){if(e.data&&"rest_invalid_param"===e.code){var t=Object.values(e.data.params);if(t[0])return t[0]}return(null==e?void 0:e.message)||Object(l.__)("Something went wrong. Please contact us to get assistance.",'woocommerce')}},46:function(e,t){e.exports=window.wp.keycodes},48:function(e,t){e.exports=window.wp.escapeHtml},52:function(e,t,r){"use strict";var n=r(0),c=r(1),o=(r(2),r(48));t.a=function(e){var t,r,i,l=e.error;return Object(n.createElement)("div",{className:"wc-block-error-message"},(r=(t=l).message,i=t.type,r?"general"===i?Object(n.createElement)("span",null,Object(c.__)("The following error was returned",'woocommerce'),Object(n.createElement)("br",null),Object(n.createElement)("code",null,Object(o.escapeHTML)(r))):"api"===i?Object(n.createElement)("span",null,Object(c.__)("The following error was returned from the API",'woocommerce'),Object(n.createElement)("br",null),Object(n.createElement)("code",null,Object(o.escapeHTML)(r))):r:Object(c.__)("An unknown error occurred which prevented the block from being updated.",'woocommerce')))}},55:function(e,t){e.exports=window.wp.hooks},56:function(e,t){e.exports=window.wp.deprecated},66:function(e,t,r){"use strict";var n=r(5),c=r.n(n),o=r(16),i=r.n(o),l=r(0),a=["srcElement","size"];function u(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}t.a=function(e){var t=e.srcElement,r=e.size,n=void 0===r?24:r,o=i()(e,a);return Object(l.isValidElement)(t)?Object(l.cloneElement)(t,function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?u(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):u(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({width:n,height:n},o)):null}},7:function(e,t){e.exports=window.lodash},74:function(e,t){e.exports=window.wp.dom},766:function(e,t,r){e.exports=r(861)},767:function(e,t){},768:function(e,t){},84:function(e,t){e.exports=window.wp.serverSideRender},861:function(e,t,r){"use strict";r.r(t);var n=r(0),c=r(1),o=r(66),i=r(28),l=Object(n.createElement)(i.SVG,{xmlns:"http://www.w3.org/2000/SVG",viewBox:"0 0 24 24"},Object(n.createElement)("path",{fill:"none",d:"M0 0h24v24H0V0z"}),Object(n.createElement)("path",{d:"M2.53 19.65l1.34.56v-9.03l-2.43 5.86c-.41 1.02.08 2.19 1.09 2.61zm19.5-3.7L17.07 3.98c-.31-.75-1.04-1.21-1.81-1.23-.26 0-.53.04-.79.15L7.1 5.95c-.75.31-1.21 1.03-1.23 1.8-.01.27.04.54.15.8l4.96 11.97c.31.76 1.05 1.22 1.83 1.23.26 0 .52-.05.77-.15l7.36-3.05c1.02-.42 1.51-1.59 1.09-2.6zm-9.2 3.8L7.87 7.79l7.35-3.04h.01l4.95 11.95-7.35 3.05z"}),Object(n.createElement)("circle",{cx:"11",cy:"9",r:"1"}),Object(n.createElement)("path",{d:"M5.88 19.75c0 1.1.9 2 2 2h1.45l-3.45-8.34v6.34z"})),a=r(26),u=r(3),s=(r(767),r(17)),b=r.n(s),d=r(18),p=r.n(d),g=r(19),f=r.n(g),h=r(20),O=r.n(h),w=r(10),m=r.n(w),E=r(12),j=r(84),y=r.n(j),v=r(4),_=(r(2),r(92)),x=r(93),k=r(33),P=r.n(k),S=r(9),C=r.n(S),A=r(49),R=r(21),T=r(29),B=r.n(T),D=r(5),L=r.n(D),M=r(8),N=r.n(M),G=r(22),I=r.n(G),$=r(39),z=r(42);function F(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function V(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?F(Object(r),!0).forEach((function(t){L()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):F(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Q=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"id";return Array.isArray(t)?t.find((function(t){return t[r]===e})):null},q=r(52),H=r(6),U=r.n(H),W=r(131),J=(r(768),function(e){var t=e.attributes,r=e.error,o=e.expandedAttribute,i=e.onChange,l=e.onExpandAttribute,a=e.onOperatorChange,u=e.instanceId,s=e.isCompact,b=e.isLoading,d=e.operator,p=e.selected,g=e.termsAreLoading,f=e.termsList[o]||[],h=[].concat(P()(t),P()(f)),O={clear:Object(c.__)("Clear all product attributes",'woocommerce'),list:Object(c.__)("Product Attributes",'woocommerce'),noItems:Object(c.__)("Your store doesn't have any product attributes.",'woocommerce'),search:Object(c.__)("Search for product attributes",'woocommerce'),selected:function(e){return Object(c.sprintf)(
/* translators: %d is the count of attributes selected. */
Object(c._n)("%d attribute selected","%d attributes selected",e,'woocommerce'),e)},updated:Object(c.__)("Product attribute search results updated.",'woocommerce')};return r?Object(n.createElement)(q.a,{error:r}):Object(n.createElement)(n.Fragment,null,Object(n.createElement)(A.b,{className:"woocommerce-product-attributes",list:h,isLoading:b,selected:p.map((function(e){var t=e.id;return h.find((function(e){return e.id===t}))})).filter(Boolean),onChange:i,renderItem:function(e){var t=e.item,r=e.search,a=e.depth,s=void 0===a?0:a,b=["woocommerce-product-attributes__item","woocommerce-search-list__item",{"is-searching":r.length>0,"is-skip-level":0===s&&0!==t.parent}];if(!t.breadcrumbs.length){var d=o===t.id;return Object(n.createElement)(W.a,C()({},e,{className:U.a.apply(void 0,b.concat([{"is-selected":d}])),isSelected:d,item:t,isLoading:g,disabled:"0"===t.count,onSelect:function(e){var t=e.id;return function(){i([]),l(t)}},name:"attributes-".concat(u),countLabel:Object(c.sprintf)(
/* translators: %d is the count of terms. */
Object(c._n)("%d term","%d terms",t.count,'woocommerce'),t.count),"aria-label":Object(c.sprintf)(
/* translators: %1$s is the item name, %2$d is the count of terms for the item. */
Object(c._n)("%1$s, has %2$d term","%1$s, has %2$d terms",t.count,'woocommerce'),t.name,t.count)}))}var p="".concat(t.breadcrumbs[0],": ").concat(t.name);return Object(n.createElement)(A.c,C()({},e,{name:"terms-".concat(u),className:U.a.apply(void 0,b.concat(["has-count"])),countLabel:Object(c.sprintf)(
/* translators: %d is the count of products. */
Object(c._n)("%d product","%d products",t.count,'woocommerce'),t.count),"aria-label":Object(c.sprintf)(
/* translators: %1$s is the attribute name, %2$d is the count of products for that attribute. */
Object(c._n)("%1$s, has %2$d product","%1$s, has %2$d products",t.count,'woocommerce'),p,t.count)}))},messages:O,isCompact:s,isHierarchical:!0}),!!a&&Object(n.createElement)("div",{hidden:p.length<2},Object(n.createElement)(v.SelectControl,{className:"woocommerce-product-attributes__operator",label:Object(c.__)("Display products matching",'woocommerce'),help:Object(c.__)("Pick at least two attributes to use this setting.",'woocommerce'),value:d,onChange:a,options:[{label:Object(c.__)("Any selected attributes",'woocommerce'),value:"any"},{label:Object(c.__)("All selected attributes",'woocommerce'),value:"all"}]})))});J.defaultProps={isCompact:!1,operator:"any"};var Y,K=(Y=Object(R.withInstanceId)(J),function(e){var t=e.selected,r=void 0===t?[]:t,c=r.length?r[0].attr_slug:null,o=Object(n.useState)(null),i=N()(o,2),l=i[0],a=i[1],u=Object(n.useState)(0),s=N()(u,2),b=s[0],d=s[1],p=Object(n.useState)({}),g=N()(p,2),f=g[0],h=g[1],O=Object(n.useState)(!0),w=N()(O,2),m=w[0],E=w[1],j=Object(n.useState)(!1),y=N()(j,2),v=y[0],_=y[1],x=Object(n.useState)(null),k=N()(x,2),P=k[0],S=k[1];return Object(n.useEffect)((function(){null===l&&Object($.b)().then((function(e){if(e=e.map((function(e){return V(V({},e),{},{parent:0})})),a(e),c){var t=Q(c,e,"taxonomy");t&&d(t.id)}})).catch(function(){var e=B()(I.a.mark((function e(t){return I.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.t0=S,e.next=3,Object(z.a)(t);case 3:e.t1=e.sent,(0,e.t0)(e.t1);case 5:case"end":return e.stop()}}),e)})));return function(_x){return e.apply(this,arguments)}}()).finally((function(){E(!1)}))}),[l,c]),Object(n.useEffect)((function(){var e=Q(b,l);e&&(_(!0),Object($.i)(b).then((function(t){t=t.map((function(t){return V(V({},t),{},{parent:b,attr_slug:e.taxonomy})})),h((function(e){return V(V({},e),{},L()({},b,t))}))})).catch(function(){var e=B()(I.a.mark((function e(t){return I.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.t0=S,e.next=3,Object(z.a)(t);case 3:e.t1=e.sent,(0,e.t0)(e.t1);case 5:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()).finally((function(){_(!1)})))}),[b,l]),Object(n.createElement)(Y,C()({},e,{attributes:l||[],error:P,expandedAttribute:b,onExpandAttribute:d,isLoading:m,termsAreLoading:v,termsList:f}))}),X=r(130),Z=r(188);var ee=function(e){f()(a,e);var t,r,i=(t=a,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,n=m()(t);if(r){var c=m()(this).constructor;e=Reflect.construct(n,arguments,c)}else e=n.apply(this,arguments);return O()(this,e)});function a(){return b()(this,a),i.apply(this,arguments)}return p()(a,[{key:"getInspectorControls",value:function(){var e=this.props.setAttributes,t=this.props.attributes,r=t.attributes,o=t.attrOperator,i=t.columns,l=t.contentVisibility,a=t.orderby,s=t.rows,b=t.alignButtons;return Object(n.createElement)(E.InspectorControls,{key:"inspector"},Object(n.createElement)(v.PanelBody,{title:Object(c.__)("Layout",'woocommerce'),initialOpen:!0},Object(n.createElement)(x.a,{columns:i,rows:s,alignButtons:b,setAttributes:e,minColumns:Object(u.getSetting)("min_columns",1),maxColumns:Object(u.getSetting)("max_columns",6),minRows:Object(u.getSetting)("min_rows",1),maxRows:Object(u.getSetting)("max_rows",6)})),Object(n.createElement)(v.PanelBody,{title:Object(c.__)("Content",'woocommerce'),initialOpen:!0},Object(n.createElement)(_.a,{settings:l,onChange:function(t){return e({contentVisibility:t})}})),Object(n.createElement)(v.PanelBody,{title:Object(c.__)("Filter by Product Attribute",'woocommerce'),initialOpen:!1},Object(n.createElement)(K,{selected:r,onChange:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],r=t.map((function(e){return{id:e.id,attr_slug:e.attr_slug}}));e({attributes:r})},operator:o,onOperatorChange:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"any";return e({attrOperator:t})},isCompact:!0})),Object(n.createElement)(v.PanelBody,{title:Object(c.__)("Order By",'woocommerce'),initialOpen:!1},Object(n.createElement)(X.a,{setAttributes:e,value:a})))}},{key:"renderEditMode",value:function(){var e=this.props,t=e.debouncedSpeak,r=e.setAttributes,i=this.props.attributes;return Object(n.createElement)(v.Placeholder,{icon:Object(n.createElement)(o.a,{srcElement:l}),label:Object(c.__)("Products by Attribute",'woocommerce'),className:"wc-block-products-grid wc-block-products-by-attribute"},Object(c.__)("Display a grid of products from your selected attributes.",'woocommerce'),Object(n.createElement)("div",{className:"wc-block-products-by-attribute__selection"},Object(n.createElement)(K,{selected:i.attributes,onChange:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=e.map((function(e){return{id:e.id,attr_slug:e.attr_slug}}));r({attributes:t})},operator:i.attrOperator,onOperatorChange:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"any";return r({attrOperator:e})}}),Object(n.createElement)(v.Button,{isPrimary:!0,onClick:function(){r({editMode:!1}),t(Object(c.__)("Showing Products by Attribute block preview.",'woocommerce'))}},Object(c.__)("Done",'woocommerce'))))}},{key:"render",value:function(){var e=this.props,t=e.attributes,r=e.name,o=e.setAttributes,i=t.editMode;return t.isPreview?Z.a:Object(n.createElement)(n.Fragment,null,Object(n.createElement)(E.BlockControls,null,Object(n.createElement)(v.ToolbarGroup,{controls:[{icon:"edit",title:Object(c.__)("Edit"),onClick:function(){return o({editMode:!i})},isActive:i}]})),this.getInspectorControls(),i?this.renderEditMode():Object(n.createElement)(v.Disabled,null,Object(n.createElement)(y.a,{block:r,attributes:t})))}}]),a}(n.Component),te=Object(v.withSpokenMessages)(ee);Object(a.registerBlockType)("woocommerce/products-by-attribute",{title:Object(c.__)("Products by Attribute",'woocommerce'),icon:{src:Object(n.createElement)(o.a,{srcElement:l}),foreground:"#96588a"},category:"woocommerce",keywords:[Object(c.__)("WooCommerce",'woocommerce')],description:Object(c.__)("Display a grid of products with selected attributes.",'woocommerce'),supports:{align:["wide","full"],html:!1},example:{attributes:{isPreview:!0}},attributes:{attributes:{type:"array",default:[]},attrOperator:{type:"string",default:"any"},columns:{type:"number",default:Object(u.getSetting)("default_columns",3)},editMode:{type:"boolean",default:!0},contentVisibility:{type:"object",default:{title:!0,price:!0,rating:!0,button:!0}},orderby:{type:"string",default:"date"},rows:{type:"number",default:Object(u.getSetting)("default_rows",3)},alignButtons:{type:"boolean",default:!1},isPreview:{type:"boolean",default:!1}},edit:function(e){return Object(n.createElement)(te,e)},save:function(){return null}})},87:function(e,t){e.exports=window.ReactDOM},89:function(e,t){e.exports=window.wp.viewport},92:function(e,t,r){"use strict";var n=r(5),c=r.n(n),o=r(0),i=r(1),l=(r(2),r(4));function a(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function u(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?a(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):a(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}t.a=function(e){var t=e.onChange,r=e.settings,n=r.button,c=r.price,a=r.rating,s=r.title;return Object(o.createElement)(o.Fragment,null,Object(o.createElement)(l.ToggleControl,{label:Object(i.__)("Product title",'woocommerce'),help:s?Object(i.__)("Product title is visible.",'woocommerce'):Object(i.__)("Product title is hidden.",'woocommerce'),checked:s,onChange:function(){return t(u(u({},r),{},{title:!s}))}}),Object(o.createElement)(l.ToggleControl,{label:Object(i.__)("Product price",'woocommerce'),help:c?Object(i.__)("Product price is visible.",'woocommerce'):Object(i.__)("Product price is hidden.",'woocommerce'),checked:c,onChange:function(){return t(u(u({},r),{},{price:!c}))}}),Object(o.createElement)(l.ToggleControl,{label:Object(i.__)("Product rating",'woocommerce'),help:a?Object(i.__)("Product rating is visible.",'woocommerce'):Object(i.__)("Product rating is hidden.",'woocommerce'),checked:a,onChange:function(){return t(u(u({},r),{},{rating:!a}))}}),Object(o.createElement)(l.ToggleControl,{label:Object(i.__)("Add to Cart button",'woocommerce'),help:n?Object(i.__)("Add to Cart button is visible.",'woocommerce'):Object(i.__)("Add to Cart button is hidden.",'woocommerce'),checked:n,onChange:function(){return t(u(u({},r),{},{button:!n}))}}))}},93:function(e,t,r){"use strict";var n=r(0),c=r(1),o=r(7),i=(r(2),r(4));t.a=function(e){var t=e.columns,r=e.rows,l=e.setAttributes,a=e.alignButtons,u=e.minColumns,s=void 0===u?1:u,b=e.maxColumns,d=void 0===b?6:b,p=e.minRows,g=void 0===p?1:p,f=e.maxRows,h=void 0===f?6:f;return Object(n.createElement)(n.Fragment,null,Object(n.createElement)(i.RangeControl,{label:Object(c.__)("Columns",'woocommerce'),value:t,onChange:function(e){var t=Object(o.clamp)(e,s,d);l({columns:Number.isNaN(t)?"":t})},min:s,max:d}),Object(n.createElement)(i.RangeControl,{label:Object(c.__)("Rows",'woocommerce'),value:r,onChange:function(e){var t=Object(o.clamp)(e,g,h);l({rows:Number.isNaN(t)?"":t})},min:g,max:h}),Object(n.createElement)(i.ToggleControl,{label:Object(c.__)("Align Last Block",'woocommerce'),help:a?Object(c.__)("The last inner block will be aligned vertically.",'woocommerce'):Object(c.__)("The last inner block will follow other content.",'woocommerce'),checked:a,onChange:function(){return l({alignButtons:!a})}}))}},96:function(e,t){e.exports=window.wp.date}});woocommerce-blocks/build/single-product.js000064400000106167151335517640014757 0ustar00this.wc=this.wc||{},this.wc.blocks=this.wc.blocks||{},this.wc.blocks["single-product"]=function(e){function t(t){for(var n,a,i=t[0],s=t[1],u=t[2],d=0,p=[];d<i.length;d++)a=i[d],Object.prototype.hasOwnProperty.call(o,a)&&o[a]&&p.push(o[a][0]),o[a]=0;for(n in s)Object.prototype.hasOwnProperty.call(s,n)&&(e[n]=s[n]);for(l&&l(t);p.length;)p.shift()();return c.push.apply(c,u||[]),r()}function r(){for(var e,t=0;t<c.length;t++){for(var r=c[t],n=!0,i=1;i<r.length;i++){var s=r[i];0!==o[s]&&(n=!1)}n&&(c.splice(t--,1),e=a(a.s=r[0]))}return e}var n={},o={39:0},c=[];function a(t){if(n[t])return n[t].exports;var r=n[t]={i:t,l:!1,exports:{}};return e[t].call(r.exports,r,r.exports,a),r.l=!0,r.exports}a.e=function(e){var t=[],r=o[e];if(0!==r)if(r)t.push(r[2]);else{var n=new Promise((function(t,n){r=o[e]=[t,n]}));t.push(r[2]=n);var c,i=document.createElement("script");i.charset="utf-8",i.timeout=120,a.nc&&i.setAttribute("nonce",a.nc),i.src=function(e){return a.p+""+({1:"atomic-block-components/add-to-cart--atomic-block-components/button--atomic-block-components/image---a7e2bb9b",2:"atomic-block-components/add-to-cart--atomic-block-components/image--atomic-block-components/title",3:"atomic-block-components/add-to-cart--atomic-block-components/button",4:"atomic-block-components/sale-badge",8:"atomic-block-components/add-to-cart",9:"atomic-block-components/button",10:"atomic-block-components/category-list",11:"atomic-block-components/image",12:"atomic-block-components/price",13:"atomic-block-components/rating",14:"atomic-block-components/sku",15:"atomic-block-components/stock-indicator",16:"atomic-block-components/summary",17:"atomic-block-components/tag-list",18:"atomic-block-components/title"}[e]||e)+".js"}(e);var s=new Error;c=function(t){i.onerror=i.onload=null,clearTimeout(u);var r=o[e];if(0!==r){if(r){var n=t&&("load"===t.type?"missing":t.type),c=t&&t.target&&t.target.src;s.message="Loading chunk "+e+" failed.\n("+n+": "+c+")",s.name="ChunkLoadError",s.type=n,s.request=c,r[1](s)}o[e]=void 0}};var u=setTimeout((function(){c({type:"timeout",target:i})}),12e4);i.onerror=i.onload=c,document.head.appendChild(i)}return Promise.all(t)},a.m=e,a.c=n,a.d=function(e,t,r){a.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},a.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},a.t=function(e,t){if(1&t&&(e=a(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(a.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)a.d(r,n,function(t){return e[t]}.bind(null,n));return r},a.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return a.d(t,"a",t),t},a.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},a.p="",a.oe=function(e){throw console.error(e),e};var i=window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[],s=i.push.bind(i);i.push=t,i=i.slice();for(var u=0;u<i.length;u++)t(i[u]);var l=s;return c.push([849,0]),r()}({0:function(e,t){e.exports=window.wp.element},1:function(e,t){e.exports=window.wp.i18n},106:function(e,t,r){"use strict";var n=r(0),o=r(1),c=(r(2),r(66)),a=r(150),i=r(6),s=r.n(i),u=r(4),l=r(52);r(153),t.a=function(e){var t=e.className,r=e.error,i=e.isLoading,d=e.onRetry;return Object(n.createElement)(u.Placeholder,{icon:Object(n.createElement)(c.a,{srcElement:a.a}),label:Object(o.__)("Sorry, an error occurred",'woocommerce'),className:s()("wc-block-api-error",t)},Object(n.createElement)(l.a,{error:r}),d&&Object(n.createElement)(n.Fragment,null,i?Object(n.createElement)(u.Spinner,null):Object(n.createElement)(u.Button,{isSecondary:!0,onClick:d},Object(o.__)("Retry",'woocommerce'))))}},11:function(e,t){e.exports=window.React},119:function(e,t){e.exports=window.wp.wordcount},12:function(e,t){e.exports=window.wp.blockEditor},121:function(e,t){},122:function(e,t){e.exports=window.wp.coreData},125:function(e,t,r){"use strict";var n=r(17),o=r.n(n),c=r(18),a=r.n(c),i=r(13),s=r.n(i),u=r(19),l=r.n(u),d=r(20),p=r.n(d),b=r(10),m=r.n(b),f=r(5),g=r.n(f),w=r(0),h=(r(2),r(11)),O=r(1),v=r(37),j=function(e){var t=e.imageUrl,r=void 0===t?"".concat(v.m,"/block-error.svg"):t,n=e.header,o=void 0===n?Object(O.__)("Oops!",'woocommerce'):n,c=e.text,a=void 0===c?Object(O.__)("There was an error loading the content.",'woocommerce'):c,i=e.errorMessage,s=e.errorMessagePrefix,u=void 0===s?Object(O.__)("Error:",'woocommerce'):s,l=e.button;return Object(w.createElement)("div",{className:"wc-block-error wc-block-components-error"},r&&Object(w.createElement)("img",{className:"wc-block-error__image wc-block-components-error__image",src:r,alt:""}),Object(w.createElement)("div",{className:"wc-block-error__content wc-block-components-error__content"},o&&Object(w.createElement)("p",{className:"wc-block-error__header wc-block-components-error__header"},o),a&&Object(w.createElement)("p",{className:"wc-block-error__text wc-block-components-error__text"},a),i&&Object(w.createElement)("p",{className:"wc-block-error__message wc-block-components-error__message"},u?u+" ":"",i),l&&Object(w.createElement)("p",{className:"wc-block-error__button wc-block-components-error__button"},l)))};r(218);var y=function(e){l()(c,e);var t,r,n=(t=c,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,n=m()(t);if(r){var o=m()(this).constructor;e=Reflect.construct(n,arguments,o)}else e=n.apply(this,arguments);return p()(this,e)});function c(){var e;o()(this,c);for(var t=arguments.length,r=new Array(t),a=0;a<t;a++)r[a]=arguments[a];return e=n.call.apply(n,[this].concat(r)),g()(s()(e),"state",{errorMessage:"",hasError:!1}),e}return a()(c,[{key:"render",value:function(){var e=this.props,t=e.header,r=e.imageUrl,n=e.showErrorMessage,o=e.text,c=e.errorMessagePrefix,a=e.renderError,i=e.button,s=this.state,u=s.errorMessage;return s.hasError?"function"==typeof a?a({errorMessage:u}):Object(w.createElement)(j,{errorMessage:n?u:null,header:t,imageUrl:r,text:o,errorMessagePrefix:c,button:i}):this.props.children}}],[{key:"getDerivedStateFromError",value:function(e){return void 0!==e.statusText&&void 0!==e.status?{errorMessage:Object(w.createElement)(w.Fragment,null,Object(w.createElement)("strong",null,e.status),": ",e.statusText),hasError:!0}:{errorMessage:e.message,hasError:!0}}}]),c}(h.Component);y.defaultProps={showErrorMessage:!0},t.a=y},131:function(e,t,r){"use strict";var n=r(9),o=r.n(n),c=r(16),a=r.n(c),i=r(0),s=r(49),u=r(4),l=r(6),d=r.n(l),p=["className","item","isSelected","isLoading","onSelect","disabled"];t.a=function(e){var t=e.className,r=e.item,n=e.isSelected,c=e.isLoading,l=e.onSelect,b=e.disabled,m=a()(e,p);return Object(i.createElement)(i.Fragment,null,Object(i.createElement)(s.c,o()({},m,{key:r.id,className:t,isSelected:n,item:r,onSelect:l,isSingle:!0,disabled:b})),n&&c&&Object(i.createElement)("div",{key:"loading",className:d()("woocommerce-search-list__item","woocommerce-product-attributes__item","depth-1","is-loading","is-not-active")},Object(i.createElement)(u.Spinner,null)))}},14:function(e,t){e.exports=window.wp.data},143:function(e,t,r){"use strict";var n=r(0),o=r(1),c=r(66),a=r(158),i=r(3),s=r(12),u=r(45);t.a=function(e){var t=(Object(u.useProductDataContext)().product||{}).id||e.productId||0;return t?Object(n.createElement)(s.InspectorControls,null,Object(n.createElement)("div",{className:"wc-block-single-product__edit-card"},Object(n.createElement)("div",{className:"wc-block-single-product__edit-card-title"},Object(n.createElement)("a",{href:"".concat(i.ADMIN_URL,"post.php?post=").concat(t,"&action=edit"),target:"_blank",rel:"noopener noreferrer"},Object(o.__)("Edit this product's details",'woocommerce'),Object(n.createElement)(c.a,{srcElement:a.a,size:16}))),Object(n.createElement)("div",{className:"wc-block-single-product__edit-card-description"},Object(o.__)("Edit details such as title, price, description and more.",'woocommerce')))):null}},149:function(e,t,r){"use strict";var n=r(33),o=r.n(n),c=r(5),a=r.n(c),i=r(9),s=r.n(i),u=r(0),l=r(1),d=r(7),p=(r(2),r(49)),b=r(21),m=r(17),f=r.n(m),g=r(18),w=r.n(g),h=r(19),O=r.n(h),v=r(20),j=r.n(v),y=r(10),k=r.n(y);var E=Object(b.createHigherOrderComponent)((function(e){var t=function(t){O()(c,t);var r,n,o=(r=c,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=k()(r);if(n){var o=k()(this).constructor;e=Reflect.construct(t,arguments,o)}else e=t.apply(this,arguments);return j()(this,e)});function c(){return f()(this,c),o.apply(this,arguments)}return w()(c,[{key:"render",value:function(){var t=this.props.selected,r=null==t;return Object(u.createElement)(e,s()({},this.props,{selected:r?[]:[t]}))}}]),c}(u.Component);return t.defaultProps={selected:null},t}),"withTransformSingleSelectToMultipleSelect"),_=r(302),P=r(29),S=r.n(P),x=r(13),C=r.n(x),B=r(22),N=r.n(B),R=r(34),A=r.n(R),z=r(39),I=r(42);function L(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function M(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?L(Object(r),!0).forEach((function(t){a()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):L(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var D=Object(b.createHigherOrderComponent)((function(e){var t=function(t){O()(c,t);var r,n,o=(r=c,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=k()(r);if(n){var o=k()(this).constructor;e=Reflect.construct(t,arguments,o)}else e=t.apply(this,arguments);return j()(this,e)});function c(){var e;f()(this,c);for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return e=o.call.apply(o,[this].concat(r)),a()(C()(e),"state",{error:null,loading:!1,variations:{}}),a()(C()(e),"loadVariations",(function(){var t=e.props.products,r=e.state,n=r.loading,o=r.variations;if(!n){var c=e.getExpandedProduct();if(c&&!o[c]){var i=t.find((function(e){return e.id===c}));i.variations&&0!==i.variations.length?(e.setState({loading:!0}),Object(z.g)(c).then((function(t){var r=t.map((function(e){return M(M({},e),{},{parent:c})}));e.setState({variations:M(M({},e.state.variations),{},a()({},c,r)),loading:!1,error:null})})).catch(function(){var t=S()(N.a.mark((function t(r){var n;return N.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,Object(I.a)(r);case 2:n=t.sent,e.setState({variations:M(M({},e.state.variations),{},a()({},c,null)),loading:!1,error:n});case 4:case"end":return t.stop()}}),t)})));return function(_x){return t.apply(this,arguments)}}())):e.setState({variations:M(M({},e.state.variations),{},a()({},c,null)),loading:!1,error:null})}}})),e}return w()(c,[{key:"componentDidMount",value:function(){var e=this.props,t=e.selected,r=e.showVariations;t&&r&&this.loadVariations()}},{key:"componentDidUpdate",value:function(e){var t=this.props,r=t.isLoading,n=t.selected;t.showVariations&&(!A()(e.selected,n)||e.isLoading&&!r)&&this.loadVariations()}},{key:"isProductId",value:function(e){return this.props.products.some((function(t){return t.id===e}))}},{key:"findParentProduct",value:function(e){return this.props.products.filter((function(t){return t.variations&&t.variations.find((function(t){return t.id===e}))}))[0].id}},{key:"getExpandedProduct",value:function(){var e=this.props,t=e.isLoading,r=e.selected;if(!e.showVariations)return null;var n=r&&r.length?r[0]:null;return n?this.prevSelectedItem=n:this.prevSelectedItem&&(t||this.isProductId(this.prevSelectedItem)||(n=this.prevSelectedItem)),!t&&n?this.isProductId(n)?n:this.findParentProduct(n):null}},{key:"render",value:function(){var t=this.props,r=t.error,n=t.isLoading,o=this.state,c=o.error,a=o.loading,i=o.variations;return Object(u.createElement)(e,s()({},this.props,{error:c||r,expandedProduct:this.getExpandedProduct(),isLoading:n,variations:i,variationsLoading:a}))}}]),c}(u.Component);return a()(t,"defaultProps",{selected:[],showVariations:!1}),t}),"withProductVariations"),T=r(52),V=r(6),H=r.n(V),G=r(131);function U(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function F(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?U(Object(r),!0).forEach((function(t){a()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):U(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}r(214);var q={list:Object(l.__)("Products",'woocommerce'),noItems:Object(l.__)("Your store doesn't have any products.",'woocommerce'),search:Object(l.__)("Search for a product to display",'woocommerce'),updated:Object(l.__)("Product search results updated.",'woocommerce')},Q=function(e){var t=e.expandedProduct,r=e.error,n=e.instanceId,c=e.isCompact,a=e.isLoading,i=e.onChange,b=e.onSearch,m=e.products,f=e.renderItem,g=e.selected,w=e.showVariations,h=e.variations,O=e.variationsLoading;if(r)return Object(u.createElement)(T.a,{error:r});var v=h&&h[t]?h[t]:[],j=[].concat(o()(m),o()(v));return Object(u.createElement)(p.b,{className:"woocommerce-products",list:j,isCompact:c,isLoading:a,isSingle:!0,selected:j.filter((function(e){var t=e.id;return g.includes(t)})),onChange:i,renderItem:f||(w?function(e){var t=e.item,r=e.search,o=e.depth,c=void 0===o?0:o,i=e.isSelected,b=e.onSelect,m=t.variations&&Array.isArray(t.variations)?t.variations.length:0,f=H()("woocommerce-search-product__item","woocommerce-search-list__item","depth-".concat(c),"has-count",{"is-searching":r.length>0,"is-skip-level":0===c&&0!==t.parent,"is-variable":m>0});if(!t.breadcrumbs.length)return Object(u.createElement)(G.a,s()({},e,{className:H()(f,{"is-selected":i}),isSelected:i,item:t,onSelect:function(){return function(){b(t)()}},isLoading:a||O,countLabel:t.variations.length>0?Object(l.sprintf)(
/* translators: %1$d is the number of variations of a product product. */
Object(l.__)("%1$d variations",'woocommerce'),t.variations.length):null,name:"products-".concat(n),"aria-label":Object(l.sprintf)(
/* translators: %1$s is the product name, %2$d is the number of variations of that product. */
Object(l._n)("%1$s, has %2$d variation","%1$s, has %2$d variations",t.variations.length,'woocommerce'),t.name,t.variations.length)}));var g=Object(d.isEmpty)(t.variation)?e:F(F({},e),{},{item:F(F({},e.item),{},{name:t.variation}),"aria-label":"".concat(t.breadcrumbs[0],": ").concat(t.variation)});return Object(u.createElement)(p.c,s()({},g,{className:f,name:"variations-".concat(n)}))}:null),onSearch:b,messages:q,isHierarchical:!0})};Q.defaultProps={isCompact:!1,expandedProduct:null,selected:[],showVariations:!1},t.a=E(Object(_.a)(D(Object(b.withInstanceId)(Q))))},15:function(e,t){e.exports=window.wp.apiFetch},150:function(e,t,r){"use strict";var n=r(0),o=r(28),c=Object(n.createElement)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(n.createElement)("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z"}));t.a=c},153:function(e,t){},158:function(e,t,r){"use strict";var n=r(0),o=r(28),c=Object(n.createElement)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(n.createElement)("mask",{id:"external-mask",width:"24",height:"24",x:"0",y:"0",maskUnits:"userSpaceOnUse"},Object(n.createElement)("path",{fill:"#fff",d:"M6.3431 6.3431v1.994l7.8984.0072-8.6055 8.6054 1.4142 1.4143 8.6055-8.6055.0071 7.8984h1.994V6.3431H6.3431z"})),Object(n.createElement)("g",{mask:"url(#external-mask)"},Object(n.createElement)("path",{d:"M0 0h24v24H0z"})));t.a=c},159:function(e,t,r){"use strict";r.d(t,"c",(function(){return c})),r.d(t,"d",(function(){return a})),r.d(t,"a",(function(){return i})),r.d(t,"b",(function(){return s}));var n=r(26),o=r(37),c=function(e,t){if(o.n>2)return Object(n.registerBlockType)(e,t)},a=function(e,t){if(o.n>1)return Object(n.registerBlockType)(e,t)},i=function(){return o.n>2},s=function(){return o.n>1}},191:function(e,t){e.exports=window.wp.warning},21:function(e,t){e.exports=window.wp.compose},214:function(e,t){},218:function(e,t){},22:function(e,t){e.exports=window.regeneratorRuntime},23:function(e,t){e.exports=window.wp.url},24:function(e,t){e.exports=window.wc.wcBlocksData},25:function(e,t){e.exports=window.wp.htmlEntities},26:function(e,t){e.exports=window.wp.blocks},28:function(e,t){e.exports=window.wp.primitives},3:function(e,t){e.exports=window.wc.wcSettings},302:function(e,t,r){"use strict";var n=r(9),o=r.n(n),c=r(29),a=r.n(c),i=r(8),s=r.n(i),u=r(16),l=r.n(u),d=r(0),p=r(22),b=r.n(p),m=r(37),f=r(39),g=r(222),w=r(42),h=["selected"];t.a=function(e){return function(t){var r=t.selected,n=l()(t,h),c=Object(d.useState)(!0),i=s()(c,2),u=i[0],p=i[1],O=Object(d.useState)(null),v=s()(O,2),j=v[0],y=v[1],k=Object(d.useState)([]),E=s()(k,2),_=E[0],P=E[1],S=m.o.productCount>100,x=function(){var e=a()(b.a.mark((function e(t){var r;return b.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Object(w.a)(t);case 2:r=e.sent,y(r),p(!1);case 5:case"end":return e.stop()}}),e)})));return function(_x){return e.apply(this,arguments)}}();Object(d.useEffect)((function(){Object(f.h)({selected:r}).then((function(e){P(e),p(!1)})).catch(x)}),[r]);var C=Object(g.a)((function(e){Object(f.h)({selected:r,search:e}).then((function(e){P(e),p(!1)})).catch(x)}),400),B=s()(C,1)[0],N=Object(d.useCallback)((function(e){p(!0),B(e)}),[p,B]);return Object(d.createElement)(e,o()({},n,{selected:r,error:j,products:_,isLoading:u,onSearch:S?N:null}))}}},31:function(e,t){e.exports=window.moment},34:function(e,t){e.exports=window.wp.isShallowEqual},36:function(e,t){e.exports=window.wp.dataControls},37:function(e,t,r){"use strict";r.d(t,"o",(function(){return c})),r.d(t,"m",(function(){return a})),r.d(t,"l",(function(){return i})),r.d(t,"n",(function(){return s})),r.d(t,"j",(function(){return u})),r.d(t,"e",(function(){return l})),r.d(t,"f",(function(){return d})),r.d(t,"g",(function(){return p})),r.d(t,"k",(function(){return b})),r.d(t,"c",(function(){return m})),r.d(t,"d",(function(){return f})),r.d(t,"h",(function(){return g})),r.d(t,"a",(function(){return w})),r.d(t,"i",(function(){return h})),r.d(t,"b",(function(){return O}));var n,o=r(3),c=Object(o.getSetting)("wcBlocksConfig",{buildPhase:1,pluginUrl:"",productCount:0,defaultAvatar:"",restApiRoutes:{},wordCountType:"words"}),a=c.pluginUrl+"images/",i=c.pluginUrl+"build/",s=c.buildPhase,u=null===(n=o.STORE_PAGES.shop)||void 0===n?void 0:n.permalink,l=o.STORE_PAGES.checkout.id,d=o.STORE_PAGES.checkout.permalink,p=o.STORE_PAGES.privacy.permalink,b=(o.STORE_PAGES.privacy.title,o.STORE_PAGES.terms.permalink),m=(o.STORE_PAGES.terms.title,o.STORE_PAGES.cart.id),f=o.STORE_PAGES.cart.permalink,g=(o.STORE_PAGES.myaccount.permalink?o.STORE_PAGES.myaccount.permalink:Object(o.getSetting)("wpLoginUrl","/wp-login.php"),Object(o.getSetting)("shippingCountries",{})),w=Object(o.getSetting)("allowedCountries",{}),h=Object(o.getSetting)("shippingStates",{}),O=Object(o.getSetting)("allowedStates",{})},39:function(e,t,r){"use strict";r.d(t,"h",(function(){return b})),r.d(t,"e",(function(){return m})),r.d(t,"b",(function(){return f})),r.d(t,"i",(function(){return g})),r.d(t,"f",(function(){return w})),r.d(t,"c",(function(){return h})),r.d(t,"d",(function(){return O})),r.d(t,"g",(function(){return v})),r.d(t,"a",(function(){return j}));var n=r(5),o=r.n(n),c=r(23),a=r(15),i=r.n(a),s=r(7),u=r(3),l=r(37);function d(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function p(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?d(Object(r),!0).forEach((function(t){o()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):d(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var b=function(e){var t=e.selected,r=void 0===t?[]:t,n=e.search,o=void 0===n?"":n,a=e.queryArgs,u=function(e){var t=e.selected,r=void 0===t?[]:t,n=e.search,o=void 0===n?"":n,a=e.queryArgs,i=void 0===a?{}:a,s=l.o.productCount>100,u={per_page:s?100:0,catalog_visibility:"any",search:o,orderby:"title",order:"asc"},d=[Object(c.addQueryArgs)("/wc/store/products",p(p({},u),i))];return s&&r.length&&d.push(Object(c.addQueryArgs)("/wc/store/products",{catalog_visibility:"any",include:r,per_page:0})),d}({selected:r,search:o,queryArgs:void 0===a?{}:a});return Promise.all(u.map((function(e){return i()({path:e})}))).then((function(e){return Object(s.uniqBy)(Object(s.flatten)(e),"id").map((function(e){return p(p({},e),{},{parent:0})}))})).catch((function(e){throw e}))},m=function(e){return i()({path:"/wc/store/products/".concat(e)})},f=function(){return i()({path:"wc/store/products/attributes"})},g=function(e){return i()({path:"wc/store/products/attributes/".concat(e,"/terms")})},w=function(e){var t=e.selected,r=function(e){var t=e.selected,r=void 0===t?[]:t,n=e.search,o=Object(u.getSetting)("limitTags",!1),a=[Object(c.addQueryArgs)("wc/store/products/tags",{per_page:o?100:0,orderby:o?"count":"name",order:o?"desc":"asc",search:n})];return o&&r.length&&a.push(Object(c.addQueryArgs)("wc/store/products/tags",{include:r})),a}({selected:void 0===t?[]:t,search:e.search});return Promise.all(r.map((function(e){return i()({path:e})}))).then((function(e){return Object(s.uniqBy)(Object(s.flatten)(e),"id")}))},h=function(e){return i()({path:Object(c.addQueryArgs)("wc/store/products/categories",p({per_page:0},e))})},O=function(e){return i()({path:"wc/store/products/categories/".concat(e)})},v=function(e){return i()({path:Object(c.addQueryArgs)("wc/store/products",{per_page:0,type:"variation",parent:e})})},j=function(e,t){if(!e.title.raw)return e.slug;var r=1===t.filter((function(t){return t.title.raw===e.title.raw})).length;return e.title.raw+(r?"":" - ".concat(e.slug))}},4:function(e,t){e.exports=window.wp.components},42:function(e,t,r){"use strict";r.d(t,"a",(function(){return s})),r.d(t,"b",(function(){return u}));var n=r(29),o=r.n(n),c=r(22),a=r.n(c),i=r(1),s=function(){var e=o()(a.a.mark((function e(t){var r;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("function"!=typeof t.json){e.next=11;break}return e.prev=1,e.next=4,t.json();case 4:return r=e.sent,e.abrupt("return",{message:r.message,type:r.type||"api"});case 8:return e.prev=8,e.t0=e.catch(1),e.abrupt("return",{message:e.t0.message,type:"general"});case 11:return e.abrupt("return",{message:t.message,type:t.type||"general"});case 12:case"end":return e.stop()}}),e,null,[[1,8]])})));return function(_x){return e.apply(this,arguments)}}(),u=function(e){if(e.data&&"rest_invalid_param"===e.code){var t=Object.values(e.data.params);if(t[0])return t[0]}return(null==e?void 0:e.message)||Object(i.__)("Something went wrong. Please contact us to get assistance.",'woocommerce')}},45:function(e,t){e.exports=window.wc.wcBlocksSharedContext},46:function(e,t){e.exports=window.wp.keycodes},47:function(e,t){e.exports=window.wc.priceFormat},48:function(e,t){e.exports=window.wp.escapeHtml},481:function(e,t,r){"use strict";var n=r(9),o=r.n(n),c=r(29),a=r.n(c),i=r(17),s=r.n(i),u=r(18),l=r.n(u),d=r(13),p=r.n(d),b=r(19),m=r.n(b),f=r(20),g=r.n(f),w=r(10),h=r.n(w),O=r(5),v=r.n(O),j=r(0),y=r(22),k=r.n(y),E=r(21),_=r(39),P=r(42);var S=Object(E.createHigherOrderComponent)((function(e){return function(t){m()(i,t);var r,n,c=(r=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=h()(r);if(n){var o=h()(this).constructor;e=Reflect.construct(t,arguments,o)}else e=t.apply(this,arguments);return g()(this,e)});function i(){var e;s()(this,i);for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return e=c.call.apply(c,[this].concat(r)),v()(p()(e),"state",{error:null,loading:!1,product:"preview"===e.props.attributes.productId?e.props.attributes.previewProduct:null}),v()(p()(e),"loadProduct",(function(){var t=e.props.attributes.productId;"preview"!==t&&(t?(e.setState({loading:!0}),Object(_.e)(t).then((function(t){e.setState({product:t,loading:!1,error:null})})).catch(function(){var t=a()(k.a.mark((function t(r){var n;return k.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,Object(P.a)(r);case 2:n=t.sent,e.setState({product:null,loading:!1,error:n});case 4:case"end":return t.stop()}}),t)})));return function(_x){return t.apply(this,arguments)}}())):e.setState({product:null,loading:!1,error:null}))})),e}return l()(i,[{key:"componentDidMount",value:function(){this.loadProduct()}},{key:"componentDidUpdate",value:function(e){e.attributes.productId!==this.props.attributes.productId&&this.loadProduct()}},{key:"render",value:function(){var t=this.state,r=t.error,n=t.loading,c=t.product;return Object(j.createElement)(e,o()({},this.props,{error:r,getProduct:this.loadProduct,isLoading:n,product:c}))}}]),i}(j.Component)}),"withProduct");t.a=S},52:function(e,t,r){"use strict";var n=r(0),o=r(1),c=(r(2),r(48));t.a=function(e){var t,r,a,i=e.error;return Object(n.createElement)("div",{className:"wc-block-error-message"},(r=(t=i).message,a=t.type,r?"general"===a?Object(n.createElement)("span",null,Object(o.__)("The following error was returned",'woocommerce'),Object(n.createElement)("br",null),Object(n.createElement)("code",null,Object(c.escapeHTML)(r))):"api"===a?Object(n.createElement)("span",null,Object(o.__)("The following error was returned from the API",'woocommerce'),Object(n.createElement)("br",null),Object(n.createElement)("code",null,Object(c.escapeHTML)(r))):r:Object(o.__)("An unknown error occurred which prevented the block from being updated.",'woocommerce')))}},55:function(e,t){e.exports=window.wp.hooks},56:function(e,t){e.exports=window.wp.deprecated},60:function(e,t){e.exports=window.wc.wcBlocksRegistry},64:function(e,t){e.exports=window.wp.a11y},66:function(e,t,r){"use strict";var n=r(5),o=r.n(n),c=r(16),a=r.n(c),i=r(0),s=["srcElement","size"];function u(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}t.a=function(e){var t=e.srcElement,r=e.size,n=void 0===r?24:r,c=a()(e,s);return Object(i.isValidElement)(t)?Object(i.cloneElement)(t,function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?u(Object(r),!0).forEach((function(t){o()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):u(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({width:n,height:n},c)):null}},7:function(e,t){e.exports=window.lodash},74:function(e,t){e.exports=window.wp.dom},849:function(e,t,r){e.exports=r(854)},850:function(e,t){},854:function(e,t,r){"use strict";r.r(t);var n=r(1),o=r(159),c=r(8),a=r.n(c),i=r(0),s=r(4),u=r(481),l=r(125),d=r(143),p=Object(i.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 230 100"},Object(i.createElement)("path",{fill:"#E1E3E6",d:"M76 0h11v6H76zm0 11h88v11H76zm0 16h28v6H76zm0 17h154v28H76zm0 39h22v17H76zm28 0h44v17h-44zM0 0h66v66H0z",style:{width:"100%"}})),b=r(12),m=(r(850),r(106)),f=function(e){var t=e.error,r=e.isLoading,n=e.getProduct;return Object(i.createElement)(m.a,{className:"wc-block-single-product-error",error:t,isLoading:r,onRetry:n})},g=r(149),w=function(e){var t=e.attributes,r=e.setAttributes;return Object(i.createElement)(g.a,{selected:t.productId||0,showVariations:!0,onChange:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=e[0]?e[0].id:0;r({productId:t})}})},h=function(e){var t=e.isEditing,r=e.setIsEditing;return Object(i.createElement)(b.BlockControls,null,Object(i.createElement)(s.ToolbarGroup,{controls:[{icon:"edit",title:Object(n.__)("Edit",'woocommerce'),onClick:function(){return r(!t)},isActive:t}]}))},O=r(14),v=r(45),j=r(26),y=r(66),k=r(28),E=Object(i.createElement)(k.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(i.createElement)("path",{fill:"none",d:"M0 0h24v24H0z"}),Object(i.createElement)("path",{d:"M14 12c0-1.1-.9-2-2-2s-2 .9-2 2 .9 2 2 2 2-.9 2-2zm-2-9c-5 0-9 4-9 9H0l4 4 4-4H5a7 7 0 113 5.7l-1.5 1.4A9 9 0 1012 3z"})),_=r(33),P=r.n(_),S=Object(i.createElement)(k.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(i.createElement)("path",{fill:"none",d:"M0 0h24v24H0V0z"}),Object(i.createElement)("path",{d:"M21 4H3a2 2 0 00-2 2v13c0 1.1.9 2 2 2h18a2 2 0 002-2V6a2 2 0 00-2-2zM3 19V6h8v13H3zm18 0h-8V6h8v13zm-7-9.5h6V11h-6zm0 2.5h6v1.5h-6zm0 2.5h6V16h-6z"})),x=r(877),C="woocommerce/single-product",B=Object(n.__)("Single Product",'woocommerce'),N=Object(i.createElement)(y.a,{srcElement:S}),R=Object(n.__)("Display a single product.",'woocommerce'),A=[["core/columns",{},[["core/column",{},[["woocommerce/product-image",{showSaleBadge:!1}]]],["core/column",{},[["woocommerce/product-sale-badge"],["woocommerce/product-title",{headingLevel:2}],["woocommerce/product-rating"],["woocommerce/product-price"],["woocommerce/product-summary"],["woocommerce/product-stock-indicator"],["woocommerce/product-add-to-cart",{showFormElements:!0}],["woocommerce/product-sku"],["woocommerce/product-category-list"],["woocommerce/product-tag-list"]]]]]],z=["core/columns","core/column"].concat(P()(Object.keys(Object(x.a)(C)))),I=function(e){var t=e.isLoading,r=e.product,o=e.clientId,c=Object(O.useDispatch)("core/block-editor").replaceInnerBlocks,u=Object(i.useCallback)((function(){c(o,function e(t){return t.map((function(t){var r=a()(t,3),n=r[0],o=r[1],c=void 0===o?{}:o,i=r[2],s=void 0===i?[]:i,u=s?e(s):[];return Object(j.createBlock)(n,c,u)}))}(A),!1)}),[o,c]);return Object(i.createElement)(v.InnerBlockLayoutContextProvider,{parentName:C,parentClassName:"wc-block-single-product wc-block-layout"},Object(i.createElement)(v.ProductDataContextProvider,{product:r,isLoading:t},Object(i.createElement)(b.InspectorControls,null,Object(i.createElement)(s.PanelBody,{title:Object(n.__)("Layout",'woocommerce'),initialOpen:!0},Object(i.createElement)(s.Button,{label:Object(n.__)("Reset layout to default",'woocommerce'),onClick:u,isTertiary:!0,className:"wc-block-single-product__reset-layout"},Object(i.createElement)(y.a,{srcElement:E})," ",Object(n.__)("Reset layout",'woocommerce')))),Object(i.createElement)("div",{className:"wc-block-single-product wc-block-layout"},Object(i.createElement)(b.InnerBlocks,{template:A,allowedBlocks:z,templateLock:!1,renderAppender:!1}))))},L=Object(u.a)((function(e){var t=e.className,r=e.attributes,o=e.setAttributes,c=e.error,u=e.getProduct,m=e.product,g=e.isLoading,O=e.clientId,v=r.productId,j=r.isPreview,y=Object(i.useState)(!v),k=a()(y,2),E=k[0],_=k[1];return j?p:c?Object(i.createElement)(f,{error:c,isLoading:g,getProduct:u}):Object(i.createElement)("div",{className:t},Object(i.createElement)(l.a,{header:Object(n.__)("Single Product Block Error",'woocommerce')},Object(i.createElement)(h,{setIsEditing:_,isEditing:E}),E?Object(i.createElement)(s.Placeholder,{icon:N,label:B,className:"wc-block-single-product"},R,Object(i.createElement)("div",{className:"wc-block-single-product__selection"},Object(i.createElement)(w,{attributes:r,setAttributes:o}),Object(i.createElement)(s.Button,{isSecondary:!0,onClick:function(){_(!1)}},Object(n.__)("Done",'woocommerce')))):Object(i.createElement)(i.Fragment,null,Object(i.createElement)(b.InspectorControls,null,Object(i.createElement)(s.PanelBody,{title:Object(n.__)("Product",'woocommerce'),initialOpen:!1},Object(i.createElement)(w,{attributes:r,setAttributes:o}))),Object(i.createElement)(d.a,{productId:v}),Object(i.createElement)(I,{clientId:O,product:m,isLoading:g}))))})),M=r(6),D=r.n(M),T={title:B,icon:{src:N,foreground:"#96588a"},category:"woocommerce",keywords:[Object(n.__)("WooCommerce",'woocommerce')],description:R,supports:{align:["wide","full"],html:!1},example:{attributes:{isPreview:!0}},attributes:{isPreview:{type:"boolean",default:!1,save:!1},productId:{type:"number"}},edit:L,save:function(e){var t=e.attributes;return Object(i.createElement)("div",{className:D()("is-loading",t.className)},Object(i.createElement)(b.InnerBlocks.Content,null))}};Object(o.c)(C,T)},86:function(e,t){e.exports=window.wc.wcBlocksSharedHocs},87:function(e,t){e.exports=window.ReactDOM},877:function(e,t,r){"use strict";r.d(t,"a",(function(){return a}));var n=r(60),o=r(0),c=r(37);r.p=c.l,Object(n.registerBlockComponent)({blockName:"woocommerce/product-price",component:Object(o.lazy)((function(){return Promise.all([r.e(0),r.e(12)]).then(r.bind(null,482))}))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-image",component:Object(o.lazy)((function(){return Promise.all([r.e(1),r.e(2),r.e(4),r.e(11)]).then(r.bind(null,901))}))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-title",component:Object(o.lazy)((function(){return Promise.all([r.e(1),r.e(2),r.e(18)]).then(r.bind(null,902))}))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-rating",component:Object(o.lazy)((function(){return r.e(13).then(r.bind(null,483))}))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-button",component:Object(o.lazy)((function(){return Promise.all([r.e(0),r.e(1),r.e(3),r.e(9)]).then(r.bind(null,484))}))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-summary",component:Object(o.lazy)((function(){return r.e(16).then(r.bind(null,486))}))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-sale-badge",component:Object(o.lazy)((function(){return r.e(4).then(r.bind(null,304))}))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-sku",component:Object(o.lazy)((function(){return r.e(14).then(r.bind(null,487))}))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-category-list",component:Object(o.lazy)((function(){return r.e(10).then(r.bind(null,488))}))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-tag-list",component:Object(o.lazy)((function(){return r.e(17).then(r.bind(null,489))}))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-stock-indicator",component:Object(o.lazy)((function(){return r.e(15).then(r.bind(null,490))}))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-add-to-cart",component:Object(o.lazy)((function(){return Promise.all([r.e(0),r.e(1),r.e(2),r.e(3),r.e(8)]).then(r.bind(null,903))}))});var a=function(e){return Object(n.getRegisteredBlockComponents)(e)}},89:function(e,t){e.exports=window.wp.viewport},91:function(e,t){e.exports=window.wp.autop},96:function(e,t){e.exports=window.wp.date}});woocommerce-blocks/build/wc-blocks-google-analytics.asset.php000064400000000203151335517640020414 0ustar00<?php return array('dependencies' => array('wp-hooks', 'wp-i18n', 'wp-polyfill'), 'version' => 'dc3f124fe37117216a3f4f117e436d98');woocommerce-blocks/build/stock-filter.asset.php000064400000000520151335517640015701 0ustar00<?php return array('dependencies' => array('lodash', 'react', 'wc-blocks-data-store', 'wc-settings', 'wp-a11y', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-data', 'wp-element', 'wp-html-entities', 'wp-i18n', 'wp-is-shallow-equal', 'wp-polyfill', 'wp-primitives'), 'version' => '07c0cd6d4aa2d94f98e6a5fef41acb85');woocommerce-blocks/build/single-product.asset.php000064400000001217151335517640016236 0ustar00<?php return array('dependencies' => array('lodash', 'moment', 'react', 'react-dom', 'wc-blocks-data-store', 'wc-blocks-registry', 'wc-blocks-shared-context', 'wc-blocks-shared-hocs', 'wc-price-format', 'wc-settings', 'wp-a11y', 'wp-api-fetch', 'wp-autop', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-data-controls', 'wp-date', 'wp-deprecated', 'wp-dom', 'wp-element', 'wp-escape-html', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-is-shallow-equal', 'wp-keycodes', 'wp-polyfill', 'wp-primitives', 'wp-url', 'wp-viewport', 'wp-warning', 'wp-wordcount'), 'version' => '8935615f59ebe2ae5fc7e9e59fb8f8c1');woocommerce-blocks/build/wc-blocks-editor-style.css000064400000331630151335517640016475 0ustar00@charset "UTF-8";:root{--wp-admin-theme-color:#007cba;--wp-admin-theme-color-darker-10:#006ba1;--wp-admin-theme-color-darker-20:#005a87}body.admin-color-light{--wp-admin-theme-color:#0085ba;--wp-admin-theme-color-darker-10:#0073a1;--wp-admin-theme-color-darker-20:#006187}body.admin-color-modern{--wp-admin-theme-color:#3858e9;--wp-admin-theme-color-darker-10:#2145e6;--wp-admin-theme-color-darker-20:#183ad6}body.admin-color-blue{--wp-admin-theme-color:#096484;--wp-admin-theme-color-darker-10:#07526c;--wp-admin-theme-color-darker-20:#064054}body.admin-color-coffee{--wp-admin-theme-color:#46403c;--wp-admin-theme-color-darker-10:#383330;--wp-admin-theme-color-darker-20:#2b2724}body.admin-color-ectoplasm{--wp-admin-theme-color:#523f6d;--wp-admin-theme-color-darker-10:#46365d;--wp-admin-theme-color-darker-20:#3a2c4d}body.admin-color-midnight{--wp-admin-theme-color:#e14d43;--wp-admin-theme-color-darker-10:#dd382d;--wp-admin-theme-color-darker-20:#d02c21}body.admin-color-ocean{--wp-admin-theme-color:#627c83;--wp-admin-theme-color-darker-10:#576e74;--wp-admin-theme-color-darker-20:#4c6066}body.admin-color-sunrise{--wp-admin-theme-color:#dd823b;--wp-admin-theme-color-darker-10:#d97426;--wp-admin-theme-color-darker-20:#c36922}.woocommerce-calendar{width:100%;background-color:#f0f0f0;border-top:1px solid #ccc;height:396px}.woocommerce-calendar.is-mobile{height:100%}.woocommerce-calendar__react-dates{width:100%;overflow-x:hidden}.woocommerce-calendar__react-dates .DayPicker{margin:0 auto}.woocommerce-calendar__react-dates .CalendarMonth_table{margin-top:10px}.woocommerce-calendar__react-dates .CalendarDay__selected_span{background:#007cba;background:var(--wp-admin-theme-color);border:1px solid #ccc}.woocommerce-calendar__react-dates .CalendarDay__selected_span:hover{background:#006ba1;background:var(--wp-admin-theme-color-darker-10);border:1px solid #f0f0f0}.woocommerce-calendar__react-dates .CalendarDay__selected{background:#005a87;background:var(--wp-admin-theme-color-darker-20);border:1px solid #ccc}.woocommerce-calendar__react-dates .CalendarDay__hovered_span,.woocommerce-calendar__react-dates .CalendarDay__selected:hover{background:#006ba1;background:var(--wp-admin-theme-color-darker-10);border:1px solid #f0f0f0}.woocommerce-calendar__react-dates .CalendarDay__hovered_span{color:#fff}.woocommerce-calendar__react-dates .CalendarDay__hovered_span:hover{color:#fff;background:#007cba;background:var(--wp-admin-theme-color)}.woocommerce-calendar__react-dates .CalendarDay__blocked_out_of_range{color:#ccc}.woocommerce-calendar__react-dates .CalendarMonth,.woocommerce-calendar__react-dates .CalendarMonthGrid,.woocommerce-calendar__react-dates .DayPicker,.woocommerce-calendar__react-dates .DayPicker_transitionContainer{background-color:#f0f0f0}.woocommerce-calendar__react-dates .DayPicker_weekHeader_li{color:#757575}.woocommerce-calendar__react-dates .DayPickerNavigation_button:focus{outline:2px solid #bfe7f3}.woocommerce-calendar__react-dates.is-core-datepicker .components-datetime__date{padding-left:0}.woocommerce-calendar__react-dates.is-core-datepicker .CalendarDay__default{background-color:transparent}.woocommerce-calendar__react-dates.is-core-datepicker .CalendarDay__selected{background:#533582;border:none}.woocommerce-calendar__inputs{padding:1em;width:100%;max-width:500px;display:-ms-grid;display:grid;-ms-grid-columns:43% 14% 43%;grid-template-columns:43% 14% 43%;margin:0 auto}.woocommerce-calendar__inputs .components-base-control{margin:0}.woocommerce-calendar__inputs-to{display:flex;align-items:center;justify-content:center;-ms-grid-column:2;grid-column-start:2}.woocommerce-calendar__input{position:relative}.woocommerce-calendar__input .dashicons-calendar{position:absolute;top:50%;transform:translateY(-50%);left:10px}.woocommerce-calendar__input .dashicons-calendar path{fill:#757575}.woocommerce-calendar__input:first-child{-ms-grid-column:1;grid-column-start:1}.woocommerce-calendar__input:last-child{-ms-grid-column:3;grid-column-start:3}.woocommerce-calendar__input.is-empty .dashicons-calendar path{fill:#757575}.woocommerce-calendar__input.is-error .dashicons-calendar path{fill:#d94f4f}.woocommerce-calendar__input.is-error .woocommerce-calendar__input-text{border:1px solid #d94f4f;box-shadow:inset 0 0 8px #d94f4f}.woocommerce-calendar__input.is-error .woocommerce-calendar__input-text:focus{box-shadow:inset 0 0 8px #d94f4f,0 0 6px rgba(30,140,190,.8)}.woocommerce-calendar__input .woocommerce-calendar__input-text{color:#757575;border-radius:3px;padding:10px 10px 10px 30px;width:100%;font-size:13px;font-size:.8125rem}.woocommerce-calendar__input .woocommerce-calendar__input-text:-ms-input-placeholder{color:#757575}.woocommerce-calendar__input .woocommerce-calendar__input-text::-moz-placeholder{color:#757575}.woocommerce-calendar__input .woocommerce-calendar__input-text::placeholder{color:#757575}.woocommerce-filters-date__content.is-mobile .woocommerce-calendar__input-error .components-popover__content{height:auto}.woocommerce-calendar__input-error{display:none}.is-error .woocommerce-calendar__input-text:focus+span .woocommerce-calendar__input-error{display:block;left:50%!important;position:absolute;top:auto!important}.woocommerce-calendar__input-error .components-popover__content{background-color:#757575;color:#fff;padding:.5em;border:none}.woocommerce-calendar__input-error.components-popover .components-popover__content{min-width:100px;width:100px;text-align:center}.woocommerce-calendar__input-error.components-popover:not(.no-arrow):not(.is-mobile).is-bottom:before{border-bottom-color:#757575;z-index:1;top:-6px}.woocommerce-calendar__input-error.components-popover:not(.no-arrow):not(.is-mobile).is-top:after{border-top-color:#757575;z-index:1;top:0}.woocommerce-calendar__date-picker-title{font-size:12px;font-size:.75rem;font-weight:100;text-transform:uppercase;text-align:center;color:#757575;width:100%;margin:0;padding:1em;background-color:#fff}.woocommerce-card{margin-bottom:24px;background:#fff;border-radius:3px;box-shadow:0 2px 1px -1px rgba(0,0,0,.2),0 1px 1px 0 rgba(0,0,0,.14),0 1px 3px 0 rgba(0,0,0,.12);transition:box-shadow .2s cubic-bezier(.4,1,.4,1)}@media (max-width:782px){.woocommerce-card{margin-bottom:12px;width:auto}}.woocommerce-card.is-inactive{background-color:#f6f7f7;box-shadow:none}.woocommerce-card__header{padding:16px;display:-ms-grid;display:grid;align-items:center;border-top-left-radius:3px;border-top-left-radius:4px}.has-action .woocommerce-card__header{-ms-grid-columns:auto 1fr;grid-template-columns:auto 1fr}.has-menu .woocommerce-card__header{-ms-grid-columns:auto 24px;grid-template-columns:auto 24px}.has-menu.has-action .woocommerce-card__header{grid-gap:12px;-ms-grid-columns:auto 1fr 24px;grid-template-columns:auto 1fr 24px}.woocommerce-card__header-item{-ms-grid-row-align:center}.woocommerce-card__header-item:first-child{-ms-grid-column:1;grid-column-start:1;-ms-grid-column-span:1;grid-column-end:2;-ms-grid-row:1;grid-row-start:1;-ms-grid-row-span:1;grid-row-end:2}.woocommerce-card__header-item:nth-child(2){-ms-grid-column:2;grid-column-start:2;-ms-grid-column-span:1;grid-column-end:3;-ms-grid-row:1;grid-row-start:1;-ms-grid-row-span:1;grid-row-end:2}.woocommerce-card__header-item:nth-child(3){-ms-grid-column:3;grid-column-start:3;-ms-grid-column-span:1;grid-column-end:4;-ms-grid-row:1;grid-row-start:1;-ms-grid-row-span:1;grid-row-end:2}.woocommerce-card__action,.woocommerce-card__menu{text-align:right}.woocommerce-card__body{padding:16px}.woocommerce-card__title{margin:0;font-size:24px;font-size:1.5rem;line-height:1.2;font-weight:400}.woocommerce-card__description{font-size:16px;font-size:1rem;line-height:1.5;color:#646970;margin-top:12px;margin-bottom:0;font-weight:400}.woocommerce-chart{margin-top:-16px;margin-bottom:24px;background:#fff;border:1px solid #e2e4e7;border-top:0}@media (max-width:782px){.woocommerce-chart{margin-left:-16px;margin-right:-16px;margin-bottom:12px;border-left:none;border-right:none;width:auto}}.woocommerce-chart .woocommerce-chart__header{min-height:50px;border-bottom:1px solid #e2e4e7;display:flex;flex-flow:row wrap;justify-content:space-between;align-items:center;width:100%}.woocommerce-chart .woocommerce-chart__header .woocommerce-chart__title{height:18px;color:#24292d;font-size:15px;font-weight:600;line-height:18px;margin-left:16px;margin-right:16px}.woocommerce-chart .woocommerce-chart__body{display:flex;flex-direction:row;justify-content:flex-start;align-items:flex-start;width:100%}.woocommerce-chart .woocommerce-chart__body.woocommerce-chart__body-column{flex-direction:column}.woocommerce-chart .woocommerce-chart__footer{width:100%}.woocommerce-chart-placeholder{-webkit-animation:loading-fade 1.6s ease-in-out infinite;animation:loading-fade 1.6s ease-in-out infinite;background-color:#f0f0f0;color:transparent;padding:0;width:100%;display:flex;align-items:center;justify-content:center}.woocommerce-chart-placeholder:after{content:"\00a0"}@media screen and (prefers-reduced-motion:reduce){.woocommerce-chart-placeholder{-webkit-animation:none;animation:none}}.woocommerce-chart-placeholder .components-spinner{margin:0}.woocommerce-chart__interval-select{align-items:start;border-right:1px solid #e2e4e7;display:flex;flex-direction:column;justify-content:center;margin:0 0 0 auto;min-height:50px;padding:8px 16px 0}@media (max-width:960px){.woocommerce-chart__interval-select{width:100%;order:1;margin-top:-8px;margin-left:0;padding-left:8px;border-right:0;min-height:0}}#wpbody .woocommerce-chart__interval-select .components-select-control__input{font-size:13px;font-size:.8125rem;border:0;box-shadow:none}#wpbody .woocommerce-chart__interval-select .components-select-control__input:not(:disabled):not([aria-disabled=true]):focus{background-color:#fff;color:#1e1e1e;box-shadow:inset 0 0 0 1px #757575,inset 0 0 0 2px #fff;outline:2px solid transparent;outline-offset:-2px}.woocommerce-chart__types{padding:0 8px;white-space:nowrap}.woocommerce-chart__type-button{background:transparent!important}.woocommerce-chart__type-button.components-button{color:#e2e4e7;display:inline-flex;padding:8px}.woocommerce-chart__type-button.components-button.woocommerce-chart__type-button-selected{color:#757575}@media (max-width:960px){.woocommerce-summary+.woocommerce-chart .woocommerce-chart__title{display:none}.woocommerce-summary+.woocommerce-chart .woocommerce-chart__interval-select{width:auto;order:0;margin-top:0}}.woocommerce-legend.has-total{padding-bottom:50px;position:relative}.woocommerce-legend.woocommerce-legend__direction-column{border-right:1px solid #ccc;min-width:320px}.woocommerce-chart__footer .woocommerce-legend.woocommerce-legend__direction-column{border-right:none}.woocommerce-legend__list{color:#24292d;display:flex;height:100%;margin:0}.woocommerce-legend__direction-column .woocommerce-legend__list{flex-direction:column;height:300px;overflow:auto}.woocommerce-chart__footer .woocommerce-legend__direction-column .woocommerce-legend__list{border-top:1px solid #ccc;height:100%;max-height:none;min-height:none}.has-total.woocommerce-legend__direction-column .woocommerce-legend__list{height:250px}.woocommerce-chart__footer .has-total.woocommerce-legend__direction-column .woocommerce-legend__list{height:auto;max-height:220px;min-height:none}.woocommerce-legend__direction-row .woocommerce-legend__list{flex-direction:row}.woocommerce-legend__item>button{display:flex;justify-content:center;align-items:center;background-color:#fff;color:#757575;cursor:pointer;display:inline-flex;flex-direction:row;flex-wrap:nowrap;justify-content:space-between;width:100%;border:none;padding:0}.woocommerce-legend__item>button .woocommerce-legend__item-container{display:flex;flex-direction:row;flex-wrap:nowrap;position:relative;padding:3px 0 3px 24px;font-size:13px;-webkit-user-select:none;-ms-user-select:none;-moz-user-select:none;user-select:none;width:100%}.woocommerce-legend__item>button .woocommerce-legend__item-container:hover input~.woocommerce-legend__item-checkmark{background-color:#e0e0e0}.woocommerce-legend__item>button .woocommerce-legend__item-container .woocommerce-legend__item-checkmark{border:1px solid #ccc;position:absolute;top:4px;left:0;height:16px;width:16px;background-color:#fff}.woocommerce-legend__item>button .woocommerce-legend__item-container .woocommerce-legend__item-checkmark:after{content:"";position:absolute;display:none}.woocommerce-legend__item>button .woocommerce-legend__item-container .woocommerce-legend__item-checkmark.woocommerce-legend__item-checkmark-checked{background-color:currentColor;border-color:currentColor}.woocommerce-legend__item>button .woocommerce-legend__item-container .woocommerce-legend__item-checkmark.woocommerce-legend__item-checkmark-checked:after{display:block;left:5px;top:2px;width:3px;height:6px;border:solid #fff;border-width:0 2px 2px 0;transform:rotate(45deg)
          /*!rtl:ignore*/}.rtl .woocommerce-legend__item>button .woocommerce-legend__item-container .woocommerce-legend__item-checkmark.woocommerce-legend__item-checkmark-checked:after{transform:rotate(45deg) scaleX(-1)}.woocommerce-legend__item>button .woocommerce-legend__item-container .woocommerce-legend__item-total{margin-left:auto;font-weight:700}.woocommerce-legend__item>button:focus{outline:none}.woocommerce-legend__item>button:focus .woocommerce-legend__item-container .woocommerce-legend__item-checkmark{outline:2px solid #ccc}.woocommerce-legend__item>button:hover{background-color:#f0f0f0}.woocommerce-legend__direction-column .woocommerce-legend__item{margin:0;padding:0}.woocommerce-legend__direction-column .woocommerce-legend__item>button{min-height:36px;padding:0 17px;text-align:left}.woocommerce-legend__direction-column .woocommerce-legend__item:first-child{margin-top:12px}.woocommerce-legend__direction-column .woocommerce-legend__item:last-child:after{content:"";display:block;height:12px;width:100%}.woocommerce-legend__direction-row .woocommerce-legend__item{padding:0;margin:0}.woocommerce-legend__direction-row .woocommerce-legend__item>button{padding:0 17px}.woocommerce-legend__direction-row .woocommerce-legend__item>button .woocommerce-legend__item-container{height:50px;align-items:center}.woocommerce-legend__direction-row .woocommerce-legend__item>button .woocommerce-legend__item-container .woocommerce-legend__item-checkmark{top:17px}.woocommerce-legend__direction-row .woocommerce-legend__item>button .woocommerce-legend__item-container .woocommerce-legend__item-title{margin-right:17px}.woocommerce-legend__total{align-items:center;background:#fff;border-top:1px solid #ccc;bottom:0;color:#757575;display:flex;height:50px;justify-content:center;left:0;position:absolute;right:0;text-transform:uppercase}.woocommerce-legend__total:before{background:linear-gradient(180deg,transparent,rgba(0,0,0,.2));bottom:100%;content:"";height:20px;left:0;opacity:0;pointer-events:none;position:absolute;right:0;transition:opacity .3s}.is-scrollable .woocommerce-legend__total:before{opacity:1}.woocommerce-chart__body-row .d3-chart__container{width:calc(100% - 320px)}.d3-chart__container{position:relative;width:100%}.d3-chart__container svg{overflow:visible}.d3-chart__container .d3-chart__empty-message{align-items:center;bottom:0;color:#757575;display:flex;font-size:18px;font-size:1.125rem;font-weight:700;justify-content:center;left:0;line-height:1.5;margin:0 auto;max-width:50%;padding-bottom:48px;pointer-events:none;position:absolute;right:0;top:0;text-align:center}@media (max-width:782px){.d3-chart__container .d3-chart__empty-message{font-size:13px;font-size:.8125rem}}.d3-chart__container .d3-chart__tooltip{border:1px solid #ccc;position:absolute;display:flex;min-width:324px;height:auto;background-color:#fff;text-align:left;padding:17px;box-shadow:0 3px 20px 0 rgba(18,24,30,.1),0 1px 3px 0 rgba(18,24,30,.1);flex-direction:column;flex-wrap:nowrap;justify-content:flex-start;pointer-events:none;visibility:hidden;z-index:1}@media (max-width:600px){.d3-chart__container .d3-chart__tooltip{min-width:auto;width:calc(100% - 48px)}}.d3-chart__container .d3-chart__tooltip h4{text-align:left;line-height:18px;width:100%;text-transform:uppercase;font-size:11px;color:#757575;margin-top:0}.d3-chart__container .d3-chart__tooltip ul{list-style:none;margin-bottom:2px;margin-top:2px;font-size:14px}.d3-chart__container .d3-chart__tooltip ul li{display:flex;flex-direction:row;flex-wrap:nowrap;justify-content:flex-start;align-items:center}.d3-chart__container .d3-chart__tooltip ul li.key-row{display:flex;flex-direction:row;justify-content:space-between;width:100%}.d3-chart__container .d3-chart__tooltip ul li.key-row .key-container{width:100%;min-width:100px}.d3-chart__container .d3-chart__tooltip ul li.key-row .key-container .key-color{display:inline-block;width:16px;height:16px;margin-right:8px}.d3-chart__container .d3-chart__tooltip ul li.key-row .key-container .key-key{margin-right:6px}.d3-chart__container .d3-chart__tooltip ul li.key-row .key-value{font-weight:600}.d3-chart__container .bargrouprect{shape-rendering:crispEdges}.d3-chart__container .grid .tick line{stroke:#f0f0f0;stroke-width:1;shape-rendering:crispEdges}.d3-chart__container .grid .tick:first-child line{stroke:#757575}.d3-chart__container .grid.with-positive-ticks .tick:last-child line{opacity:0}.d3-chart__container .tick{padding-top:10px;stroke-width:1}.d3-chart__container .y-axis{text-anchor:start}.d3-chart__container .y-axis.ticktext{fill:#757575}.d3-chart__container .axis-month .tick text,.d3-chart__container .y-axis .tick text{font-size:10px}.d3-chart__container .focus-grid line{stroke:rgba(0,0,0,.1);stroke-width:1px}.d3-chart__container .barfocus{fill:rgba(0,0,0,.1)}.d3-base{background:transparent;overflow-x:auto;overflow-y:hidden;position:relative;width:100%;height:100%}.woocommerce-count{border:1px solid;border-radius:10px;padding:0 8px;font-weight:700}.woocommerce-page .woocommerce-dropdown-button{background-color:#fff;position:relative;border:1px solid #757575;color:#1e1e1e;border-radius:4px;padding:0 40px 0 0;width:100%;height:auto}.woocommerce-page .woocommerce-dropdown-button:after{content:"";background:#1e1e1e;-webkit-mask:url(data:image/svg+xml;charset=US-ASCII,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M5%206l5%205%205-5%202%201-7%207-7-7%202-1z%22%20%2F%3E%3C%2Fsvg%3E) no-repeat right 0 top 55%;mask:url(data:image/svg+xml;charset=US-ASCII,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M5%206l5%205%205-5%202%201-7%207-7-7%202-1z%22%20%2F%3E%3C%2Fsvg%3E) no-repeat right 0 top 55%;position:absolute;right:14px;width:32px;height:48px}.woocommerce-page .woocommerce-dropdown-button.is-open:after{transform:translateX(12px) translateY(2px) rotate(180deg)}.woocommerce-page .woocommerce-dropdown-button.is-open,.woocommerce-page .woocommerce-dropdown-button:active,.woocommerce-page .woocommerce-dropdown-button:hover{color:#007cba;color:var(--wp-admin-theme-color)}.woocommerce-page .woocommerce-dropdown-button.is-open:after,.woocommerce-page .woocommerce-dropdown-button:active:after,.woocommerce-page .woocommerce-dropdown-button:hover:after{background:#007cba;background:var(--wp-admin-theme-color)}.woocommerce-page .woocommerce-dropdown-button.is-multi-line .woocommerce-dropdown-button__labels{flex-direction:column}.woocommerce-page .woocommerce-dropdown-button:not(:focus):not(.is-open){border-color:#757575}.woocommerce-dropdown-button__labels{text-align:left;padding:8px 12px;min-height:48px;display:flex;align-items:center;width:100%;justify-content:space-around}@media (max-width:400px){.woocommerce-dropdown-button__labels{min-height:46px}}.woocommerce-dropdown-button__labels span{width:100%;text-align:left}.woocommerce-dropdown-button__labels span:last-child{font-size:12px;font-size:.75rem;margin:0}.woocommerce-dropdown-button__labels span:first-child{font-size:13px;font-size:.8125rem;font-weight:600}@media (max-width:400px){.woocommerce-dropdown-button__labels span:last-child{font-size:10px;font-size:.625rem}.woocommerce-dropdown-button__labels span:first-child{font-size:12px;font-size:.75rem}}.woocommerce-ellipsis-menu{text-align:center}.woocommerce-ellipsis-menu__toggle{justify-content:center;vertical-align:middle;width:24px}.woocommerce-ellipsis-menu__toggle .dashicon{transform:rotate(90deg)}.woocommerce-ellipsis-menu__popover{text-align:left}.woocommerce-ellipsis-menu__popover:not(.is-mobile):after,.woocommerce-ellipsis-menu__popover:not(.is-mobile):before{margin-left:-16px}.woocommerce-ellipsis-menu__popover .components-popover__content{width:182px;padding:2px}.woocommerce-ellipsis-menu__popover .woocommerce-ellipsis-menu__content{width:100%}.woocommerce-ellipsis-menu__popover .woocommerce-ellipsis-menu__item,.woocommerce-ellipsis-menu__popover .woocommerce-ellipsis-menu__title{padding:4px 12px}.woocommerce-ellipsis-menu__popover .woocommerce-ellipsis-menu__item{cursor:pointer;color:#757575}.woocommerce-ellipsis-menu__popover .woocommerce-ellipsis-menu__item:focus{box-shadow:inset 0 0 0 1px #6c7781,inset 0 0 0 2px #fff;outline:2px solid transparent;outline-offset:-2px}.woocommerce-ellipsis-menu__popover .woocommerce-ellipsis-menu__item .components-form-toggle{margin-right:8px}.woocommerce-ellipsis-menu__popover .components-base-control__label,.woocommerce-ellipsis-menu__popover .woocommerce-ellipsis-menu__title{color:#1e1e1e;padding-top:8px;padding-bottom:8px;font-size:15px;font-size:.9375rem;margin-bottom:4px}.woocommerce-ellipsis-menu__popover .components-toggle-control .components-base-control__field{margin:4px 0}.woocommerce-ellipsis-menu__popover .components-base-control{margin:0}.woocommerce-empty-content{margin-bottom:16px;text-align:center}.woocommerce-empty-content .woocommerce-empty-content__illustration{max-width:100%}.woocommerce-empty-content .woocommerce-empty-content__actions .components-button+.components-button{margin-left:16px}.woocommerce-filters-advanced{margin:24px 0}.woocommerce-filters-advanced .components-card__body{background-color:#f0f0f0}.woocommerce-filters-advanced .components-card__body.is-size-small:hover,.woocommerce-filters-advanced .components-card__body ul li:hover{background-color:#e0e0e0}.woocommerce-filters-advanced .components-select-control__input{height:38px;padding:0 0 0 8px;margin:0}.woocommerce-filters-advanced .components-card__header .components-base-control__field{margin-bottom:0}@media (max-width:782px){.woocommerce-filters-advanced{margin:16px 0;border:1px solid #ccc}}@media (max-width:400px){.woocommerce-filters-advanced{margin:12px 0}}.woocommerce-filters-advanced__title-select{width:70px;display:inline-block;margin:0 8px}.woocommerce-filters-advanced__list{margin:0}.woocommerce-filters-advanced__list-item{padding:0 16px 0 0;margin:0;display:-ms-grid;display:grid;-ms-grid-columns:1fr 40px;grid-template-columns:1fr 40px;border-bottom:1px solid #ccc}.woocommerce-filters-advanced__list-item:hover{background-color:#e0e0e0}.woocommerce-filters-advanced__list-item .woocommerce-filters-advanced__line-item:first-child{-ms-grid-column:1;grid-column-start:1;-ms-grid-column-span:1;grid-column-end:2;-ms-grid-row:1;grid-row-start:1;-ms-grid-row-span:1;grid-row-end:2}.woocommerce-filters-advanced__list-item .woocommerce-filters-advanced__line-item:nth-child(2){-ms-grid-column:2;grid-column-start:2;-ms-grid-column-span:1;grid-column-end:3;-ms-grid-row:1;grid-row-start:1;-ms-grid-row-span:1;grid-row-end:2}.woocommerce-filters-advanced__list-item fieldset{padding:8px 8px 8px 16px}.woocommerce-filters-advanced__list-item .woocommerce-filters-advanced__remove{width:40px;height:38px;-ms-grid-row-align:center;align-self:center;color:#757575;padding:8px}@media (max-width:400px){.woocommerce-filters-advanced__list-item .woocommerce-filters-advanced__remove{position:absolute;top:0;right:4px}}.woocommerce-filters-advanced__list-item .components-form-token-field{border-radius:4px}@media (max-width:400px){.woocommerce-filters-advanced__list-item{display:block;position:relative;padding:8px 8px 0 0}}.woocommerce-filters-advanced__add-filter{margin:0;display:block}.woocommerce-filters-advanced__add-filter div div{display:inline-block}.woocommerce-filters-advanced__add-filter .components-popover:not(.is-mobile) .components-popover__content{min-width:180px}.woocommerce-filters-advanced__add-filter .components-popover__content>div{width:100%}.woocommerce-filters-advanced__fieldset{display:flex;align-items:center}.woocommerce-filters-advanced__fieldset>div{padding:0 4px}@media (max-width:782px){.woocommerce-filters-advanced__fieldset>div{width:100%;padding:4px 0}}@media (max-width:782px){.woocommerce-filters-advanced__fieldset{display:block}}.woocommerce-filters-advanced__fieldset.is-english{display:-ms-grid;display:grid;-ms-grid-columns:100px 150px 1fr;grid-template-columns:100px 150px 1fr}.woocommerce-filters-advanced__fieldset.is-english .woocommerce-filters-advanced__fieldset-item:first-child{-ms-grid-column:1;grid-column-start:1;-ms-grid-column-span:1;grid-column-end:2;-ms-grid-row:1;grid-row-start:1;-ms-grid-row-span:1;grid-row-end:2}.woocommerce-filters-advanced__fieldset.is-english .woocommerce-filters-advanced__fieldset-item:nth-child(2){-ms-grid-column:2;grid-column-start:2;-ms-grid-column-span:1;grid-column-end:3;-ms-grid-row:1;grid-row-start:1;-ms-grid-row-span:1;grid-row-end:2}.woocommerce-filters-advanced__fieldset.is-english .woocommerce-filters-advanced__fieldset-item:nth-child(3){-ms-grid-column:3;grid-column-start:3;-ms-grid-column-span:1;grid-column-end:4;-ms-grid-row:1;grid-row-start:1;-ms-grid-row-span:1;grid-row-end:2}.woocommerce-filters-advanced__fieldset.is-english .woocommerce-filters-advanced__fieldset-item:first-child{display:flex;align-items:center}.woocommerce-filters-advanced__fieldset.is-english .woocommerce-filters-advanced__fieldset-item .components-base-control__field{margin-bottom:0}@media (max-width:782px){.woocommerce-filters-advanced__fieldset.is-english{display:block}}.woocommerce-filters-advanced__rule{width:150px}.woocommerce-filters-advanced__input{width:100%}.woocommerce-filters-advanced__input.woocommerce-search.woocommerce-select-control .woocommerce-select-control__control{height:38px}.woocommerce-filters-advanced__add-filter-dropdown{display:inline-block}.woocommerce-filters-advanced__add-button{align-items:center;color:#757575;padding:8px}.woocommerce-filters-advanced__add-button svg{fill:currentColor;margin:0 6px 0 0}.woocommerce-filters-advanced__controls .components-button{margin-right:16px}.woocommerce-filters-advanced__add-dropdown{padding:8px 0}.woocommerce-filters-advanced__add-dropdown li{margin:0}.woocommerce-filters-advanced__add-dropdown .components-button{width:100%;padding:8px}.woocommerce-filters-advanced__add-dropdown .components-button:hover{background-color:#e0e0e0}.woocommerce-filters-advanced__add-dropdown .components-button:not(:disabled):not([aria-disabled=true]):focus{background-color:#f0f0f0;box-shadow:none}.woocommerce-filters-advanced__input-range{align-items:center;display:-ms-grid;display:grid;-ms-grid-columns:1fr;grid-template-columns:1fr}.woocommerce-filters-advanced__input-range.is-between{-ms-grid-columns:1fr 36px 1fr;grid-template-columns:1fr 36px 1fr}.woocommerce-filters-advanced__input-range input{height:38px;margin:0}.woocommerce-filters-advanced__input-range .separator{text-align:center}.woocommerce-filters-advanced__attribute-fieldset{align-items:center;display:-ms-grid;display:grid;-ms-grid-columns:1fr 20px 1fr;grid-template-columns:1fr 20px 1fr}.woocommerce-filters-advanced__attribute-fieldset .woocommerce-filters-advanced__attribute-field-separator{padding:0 6px}.woocommerce-filters-date__content.is-mobile .components-popover__header{border:none;height:0}.woocommerce-filters-date__content.is-mobile .components-popover__close{transform:translateY(22px)}.woocommerce-filters-date__content.is-mobile .components-tab-panel__tab-content{height:calc(100% - 46px);overflow:auto}.woocommerce-filters-date__content.components-dropdown__content .components-popover__content>div{padding:0}.woocommerce-filters-date__tabs{height:calc(100% - 42px);border-top:1px solid #ccc}.woocommerce-filters-date__tabs .components-tab-panel__tabs{display:flex;justify-content:space-between}.woocommerce-filters-date__tabs .components-tab-panel__tabs .components-button{display:block;text-align:center;width:50%}.woocommerce-filters-date__tabs .components-tab-panel__tab-content{display:flex;flex-direction:column;align-items:center}.woocommerce-filters-date__tabs:first-child{-ms-grid-column:1;grid-column-start:1;-ms-grid-column-span:1;grid-column-end:2;-ms-grid-row:1;grid-row-start:1;-ms-grid-row-span:1;grid-row-end:2}.woocommerce-filters-date__tabs:nth-child(2){-ms-grid-column:2;grid-column-start:2;-ms-grid-column-span:1;grid-column-end:3;-ms-grid-row:1;grid-row-start:1;-ms-grid-row-span:1;grid-row-end:2}.woocommerce-filters-date__text{font-size:12px;font-size:.75rem;font-weight:100;text-transform:uppercase;text-align:center;color:#757575;width:100%;margin:0;padding:1em;background-color:#fff}.woocommerce-filters-date__content-controls{display:flex;flex-direction:column;width:100%;align-items:center;padding-bottom:1em;background-color:#fff}.woocommerce-filters-date__content-controls.is-custom{border-top:1px solid #ccc}.woocommerce-filters-date__button-group{padding-top:1em;display:flex;justify-content:center;width:100%}.woocommerce-filters-date__button-group .woocommerce-filters-date__button{justify-content:center;width:40%;height:34px;margin:0 12px}.woocommerce-filters-filter__content.is-mobile .components-popover__header-title{font-size:12px;font-size:.75rem;font-weight:100;text-transform:uppercase;text-align:center;color:#757575}.woocommerce-filters-filter__content.is-mobile .woocommerce-filters-filter__content-list-item:last-child{border-bottom:1px solid #ccc}.woocommerce-filters-filter__content-list{margin:0;width:100%;min-width:100%}.woocommerce-filters-filter__content-list-item{border:1px solid transparent;border-bottom-color:#ccc;margin:0}.woocommerce-filters-filter__content-list-item:last-child{border-bottom:1px solid transparent}.woocommerce-filters-filter__content-list-item.is-selected .woocommerce-filters-filter__button,.woocommerce-filters-filter__content-list-item.is-selected .woocommerce-filters-filter__button.components-button:not(:disabled):not([aria-disabled=true]):focus{background-color:#fff}.woocommerce-filters-filter__content-list-item.is-selected .woocommerce-filters-filter__button:before{content:"";width:8px;height:8px;background-color:#7f54b3;position:absolute;top:50%;left:1em;transform:translate(50%,-50%)}.woocommerce-filters-filter__content-list-item .woocommerce-filters-filter__button{position:relative;align-items:center;display:flex;width:100%;padding:1em 1em 1em 3em;background-color:#f0f0f0;text-align:left}.woocommerce-filters-filter__content-list-item .woocommerce-filters-filter__button.components-button{color:#757575}.woocommerce-filters-filter__content-list-item .woocommerce-filters-filter__button:hover{background-color:#e0e0e0;color:#757575}.woocommerce-filters-filter__content-list-item .woocommerce-filters-filter__button.components-button:not(:disabled):not([aria-disabled=true]):focus{background-color:#f0f0f0}.woocommerce-filters-filter__content-list-item .woocommerce-filters-filter__button svg{position:absolute;left:1em}.woocommerce-filters .components-base-control__field{margin-bottom:0}@media (max-width:400px){.woocommerce-filters{margin-left:-8px;margin-right:-8px}}.woocommerce-filters__basic-filters{display:flex;margin-bottom:24px}@media (max-width:1280px){.woocommerce-filters__basic-filters{flex-direction:column}}@media (max-width:782px){.woocommerce-filters__basic-filters{margin-bottom:16px}}.woocommerce-filters__advanced-filters .components-card__body{background-color:#f0f0f0}.woocommerce-filters__advanced-filters .components-card__footer .components-button{margin-right:16px}.woocommerce-filters-filter{width:25%;padding:0 12px;min-height:82px;display:flex;flex-direction:column;justify-content:flex-end}.woocommerce-filters-filter:first-child{padding-left:0}.woocommerce-filters-filter:last-child{padding-right:0}@media (max-width:1440px){.woocommerce-filters-filter{width:33.3%}}@media (max-width:1280px){.woocommerce-filters-filter{width:50%;padding:0;min-height:78px}}@media (max-width:782px){.woocommerce-filters-filter{width:100%}}.woocommerce-filters-label{margin:7px 0;display:block}@media (max-width:1280px){.woocommerce-filters-label{margin:5px 0}}.woocommerce-filters-date__content .components-popover__content,.woocommerce-filters-filter__content .components-popover__content{width:320px;border:1px solid #ccc;background-color:#fff}.woocommerce-filters-date__content .woocommerce-calendar__input-error .components-popover__content,.woocommerce-filters-filter__content .woocommerce-calendar__input-error .components-popover__content{background-color:#757575}.woocommerce-filters-date__content.is-mobile .components-popover__content,.woocommerce-filters-filter__content.is-mobile .components-popover__content{width:100%;height:100%;border:none}.woocommerce-filters-filter__search .woocommerce-search__autocomplete-results{position:static}.woocommerce-filters-filter__search .woocommerce-search__inline-container{overflow:hidden}.woocommerce-filters-filter__search .woocommerce-search__inline-container:not(.is-active){border:none}.woocommerce-filters-advanced__list-item .components-base-control+.components-base-control{margin-bottom:0}.woocommerce-flag span{vertical-align:middle}.woocommerce-flag .woocommerce-flag__fallback{background:#f0f0f0;color:transparent;width:24px;height:18px;display:block;overflow:hidden}.woocommerce-gravatar{border-radius:50%}.woocommerce-image-upload .woocommerce-image-upload__image-preview{font-size:16px;margin-right:2em}.woocommerce-image-upload .woocommerce-image-upload__image-preview img{max-width:240px;height:auto}.woocommerce-image-upload .woocommerce-image-upload__add-image{margin:16px 0}.woocommerce-image-upload.has-image{display:flex;align-items:center}.woocommerce-list{margin:0;padding:0}a.woocommerce-list__item{color:inherit}.woocommerce-list__item{display:flex;align-items:center;margin-bottom:0;text-decoration:none;background-color:#fff}.woocommerce-list__item.has-gutters{padding:16px 24px}.woocommerce-list__item.has-action{cursor:pointer}.woocommerce-list__item:focus{box-shadow:inset 0 0 0 1px #006088,inset 0 0 0 2px #fff}.woocommerce-list__item:focus-visible{box-shadow:none}.woocommerce-list__item:not(.transitions-disabled).woocommerce-list__item-enter{opacity:0;max-height:0;transform:translateX(50%)}.woocommerce-list__item:not(.transitions-disabled).woocommerce-list__item-enter-active{opacity:1;max-height:100vh;transform:translateX(0);transition:opacity .5s,transform .5s,max-height .5s}.woocommerce-list__item:not(.transitions-disabled).woocommerce-list__item-exit{opacity:1;max-height:100vh;transform:translateX(0)}.woocommerce-list__item:not(.transitions-disabled).woocommerce-list__item-exit-active{opacity:0;max-height:0;transform:translateX(50%);transition:opacity .5s,transform .5s,max-height .5s}.woocommerce-list__item>.woocommerce-list__item-inner{text-decoration:none;width:100%;display:flex;align-items:center;padding:16px 24px}.woocommerce-list__item>.woocommerce-list__item-inner:focus{box-shadow:inset 0 0 0 1px #006088,inset 0 0 0 2px #fff}.woocommerce-list__item .woocommerce-list__item-title{color:#1d2327}.woocommerce-list__item .woocommerce-list__item-content{margin-top:4px;display:block;font-size:14px;line-height:20px;color:#50575d}.woocommerce-list__item .woocommerce-list__item-before{margin-right:20px;display:flex;align-items:center}.woocommerce-list__item .woocommerce-list__item-after{display:flex;align-items:center;margin-left:auto}.woocommerce-list__item:not(:first-child){border-top:1px solid #f0f0f0}.woocommerce-list__item:hover{background-color:#f0f0f0}.woocommerce-list__item:hover .woocommerce-list__item-title{color:#007cba;color:var(--wp-admin-theme-color)}.woocommerce-list__item:hover .woocommerce-list__item-before>svg{fill:#007cba;fill:var(--wp-admin-theme-color)}.woocommerce-list__item .woocommerce-list__item-title{color:#007cba;color:var(--wp-admin-theme-color)}.woocommerce-list__item .woocommerce-list__item-before>svg{fill:#007cba;fill:var(--wp-admin-theme-color)}.woocommerce-list__item .woocommerce-list__item-after>svg{fill:#1e1e1e}.woocommerce-list__item.is-complete .woocommerce-task__icon{background-color:#007cba;background-color:var(--wp-admin-theme-color)}.woocommerce-list__item.is-complete .woocommerce-list__item-title{color:#757575}.woocommerce-list__item.is-complete .woocommerce-list__item-content{display:none}.woocommerce-list__item-title{color:#2c3338}.woocommerce-list__item-content{color:#646970}.woocommerce-order-status{display:flex;align-items:center}.woocommerce-order-status__indicator{min-width:16px;width:16px;height:16px;display:block;background:#ccc;margin-right:8px;border-radius:50%;border:3px solid #f0f0f0}.woocommerce-order-status__indicator.is-processing{background:#4ab866;border-color:#93d5a4}.woocommerce-order-status__indicator.is-on-hold{background:#ffb900;border-color:#ffd566}.woocommerce-pagination{display:flex;flex-direction:row;flex-wrap:nowrap;justify-content:center;align-items:center}@media (max-width:782px){.woocommerce-pagination{flex-direction:column}}.woocommerce-pagination input{border-radius:4px}.woocommerce-pagination__page-arrows{display:flex;flex-direction:row}.woocommerce-pagination__page-arrows-buttons{display:inline-flex;align-items:baseline;border:1px solid #b5bfc9;border-radius:4px;background:#f0f2f4}.woocommerce-pagination__page-arrows-buttons .components-button{color:#24292d;height:30px;width:32px;justify-content:center}.woocommerce-pagination__page-arrows-buttons .components-button:not(:disabled):not([aria-disabled=true]):hover{color:#757575}.woocommerce-pagination__page-arrows-buttons button:first-child{border-top-right-radius:0;border-bottom-right-radius:0;border-right:2px solid #d3d9de}.woocommerce-pagination__page-arrows-buttons button:last-child{border-top-left-radius:0;border-bottom-left-radius:0}.woocommerce-pagination__page-arrows-buttons .woocommerce-pagination__link{padding:4px}.woocommerce-pagination__page-arrows-label{margin-top:8px;margin-right:8px}.woocommerce-pagination__page-picker{margin-left:16px}@media (max-width:782px){.woocommerce-pagination__page-picker{margin-top:16px;margin-left:0}}.woocommerce-pagination__page-picker .woocommerce-pagination__page-picker-input{margin-left:8px;width:60px;height:34px;box-shadow:none}.woocommerce-pagination__per-page-picker{margin-left:16px}@media (max-width:782px){.woocommerce-pagination__per-page-picker{margin-top:16px;margin-left:0}}.woocommerce-pagination__per-page-picker .components-base-control{margin-bottom:0}.woocommerce-pagination__per-page-picker .components-base-control .components-base-control__field{display:flex;flex-direction:row;align-items:baseline;margin-bottom:0}.woocommerce-pagination__per-page-picker .components-base-control .components-select-control__input{width:60px;height:34px;box-shadow:none}.woocommerce-pagination__per-page-picker .components-base-control .components-base-control__label{margin-right:8px}.woocommerce-pagination__page-picker-input.has-error,.woocommerce-pagination__page-picker-input.has-error:focus{border-color:#d94f4f;box-shadow:0 0 2px #d94f4f}.woocommerce-pill{border:1px solid #757575;border-radius:28px;color:#757575;display:inline-block;padding:4px 8px}@media (max-width:320px){.woocommerce-pill{font-size:11px}}.woocommerce-product-image{border-radius:2px}.woocommerce-rating{position:relative;vertical-align:middle;display:inline-block;overflow:hidden;white-space:nowrap}.woocommerce-rating .gridicon{fill:#e0e0e0}.woocommerce-rating .woocommerce-rating__star-outline{position:absolute;left:0;top:0;white-space:nowrap;overflow:hidden}.woocommerce-rating .woocommerce-rating__star-outline .gridicon{fill:#757575}.woocommerce-search.woocommerce-select-control{position:relative}.woocommerce-search.woocommerce-select-control .woocommerce-select-control__control-icon{position:absolute;top:50%;left:10px;transform:translateY(-50%);color:#ccc;font-size:20px}.woocommerce-search.woocommerce-select-control:not(.has-inline-tags) .woocommerce-tag{margin:8px 6px 0 0}.woocommerce-search.woocommerce-select-control .woocommerce-select-control__control{height:auto;font-size:13px;width:100%;padding:3px 2px 3px 36px;border-radius:4px;border:1px solid #757575;box-shadow:0 2px 6px rgba(0,0,0,.05)}.woocommerce-search.woocommerce-select-control .woocommerce-select-control__control.is-active{border-color:#007cba;border-color:var(--wp-admin-theme-color)}.woocommerce-search.woocommerce-select-control .components-base-control .woocommerce-select-control__control-input{margin:0;font-size:13px;min-height:auto}.woocommerce-search.woocommerce-select-control .components-base-control .woocommerce-select-control__control-input[type=number]::-webkit-inner-spin-button,.woocommerce-search.woocommerce-select-control .components-base-control .woocommerce-select-control__control-input[type=number]::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}.woocommerce-search.woocommerce-select-control .components-base-control .components-base-control__label{font-size:13px;color:#72777c;margin:0;width:calc(100% - 36px);top:50%;left:36px}.woocommerce-search.woocommerce-select-control.has-inline-tags .has-tags.components-base-control .components-base-control__label,.woocommerce-search.woocommerce-select-control .is-active.components-base-control .components-base-control__label,.woocommerce-search.woocommerce-select-control .with-value.components-base-control .components-base-control__label{display:none}.woocommerce-search.woocommerce-select-control .components-base-control .woocommerce-select-control__tags{margin:0}.woocommerce-search.woocommerce-select-control .components-base-control .woocommerce-tag{max-height:24px}.woocommerce-search.woocommerce-select-control .woocommerce-select-control__listbox{border:1px solid #ccc;top:38px}.woocommerce-search.woocommerce-select-control.is-static-results .woocommerce-select-control__listbox{position:static}.woocommerce-search.woocommerce-select-control .woocommerce-select-control__option{margin-bottom:0;display:flex;flex-direction:row;flex-grow:1;flex-shrink:0;align-items:center;padding:12px;color:#7f54b3;text-align:left;background:#f0f0f0;border-bottom:1px solid #f0f0f0;font-size:13px;min-height:43px}.woocommerce-search.woocommerce-select-control .woocommerce-select-control__option:last-of-type{border-bottom:none}.woocommerce-search.woocommerce-select-control .woocommerce-select-control__option:hover{box-shadow:none;color:#7f54b3;background:#e0e0e0}.woocommerce-search.woocommerce-select-control .woocommerce-select-control__option.is-selected,.woocommerce-search.woocommerce-select-control .woocommerce-select-control__option:active,.woocommerce-search.woocommerce-select-control .woocommerce-select-control__option:focus{color:#7f54b3;background:#fff;box-shadow:inset 0 0 0 1px #e0e0e0,inset 0 0 0 2px #24292d}.woocommerce-search.woocommerce-select-control .woocommerce-select-control__option .woocommerce-search__result-thumbnail{margin-right:12px}.woocommerce-search__result-name{text-decoration:underline}.woocommerce-search-list{width:100%;padding:0 0 16px;text-align:left}.woocommerce-search-list__selected{margin:16px 0;padding:16px 0 0;min-height:76px;border-top:1px solid #f0f0f0}.woocommerce-search-list__selected .woocommerce-search-list__selected-header{margin-bottom:8px}.woocommerce-search-list__selected .woocommerce-search-list__selected-header button{margin-left:12px}.woocommerce-search-list__selected .woocommerce-tag__text{max-width:13em}.woocommerce-search-list__selected ul{list-style:none}.woocommerce-search-list__selected ul li{float:left}.woocommerce-search-list__search{margin:16px 0;padding:16px 0 0;border-top:1px solid #f0f0f0}.woocommerce-search-list__search .components-base-control__field{margin-bottom:16px}.woocommerce-search-list__list{border:1px solid #e0e0e0;padding:0;max-height:17em;overflow-x:hidden;overflow-y:auto}.woocommerce-search-list__list li{margin-bottom:0}.woocommerce-search-list__list.is-loading,.woocommerce-search-list__list.is-not-found{padding:12px 0;text-align:center;border:none}.woocommerce-search-list__list.is-not-found .woocommerce-search-list__not-found-icon,.woocommerce-search-list__list.is-not-found .woocommerce-search-list__not-found-text{display:inline-block}.woocommerce-search-list__list.is-not-found .woocommerce-search-list__not-found-icon{margin-right:16px}.woocommerce-search-list__list.is-not-found .woocommerce-search-list__not-found-icon .gridicon{vertical-align:top;margin-top:-1px}.woocommerce-search-list__list .components-spinner{float:none;margin:0 auto}.woocommerce-search-list__list .components-menu-group__label{clip:rect(1px,1px,1px,1px);-webkit-clip-path:inset(50%);clip-path:inset(50%);height:1px;width:1px;margin:-1px;overflow:hidden;overflow-wrap:normal!important;word-wrap:normal!important}.woocommerce-search-list__list>[role=menu]{border:1px solid #f0f0f0;border-bottom:none}.woocommerce-search-list__list .woocommerce-search-list__item{display:flex;align-items:center;margin-bottom:0;padding:12px 16px;background:#fff;border-bottom:1px solid #f0f0f0;color:#757575}.woocommerce-search-list__list .woocommerce-search-list__item:active,.woocommerce-search-list__list .woocommerce-search-list__item:focus,.woocommerce-search-list__list .woocommerce-search-list__item:hover{background:#f0f0f0}.woocommerce-search-list__list .woocommerce-search-list__item:active,.woocommerce-search-list__list .woocommerce-search-list__item:focus{box-shadow:none}.woocommerce-search-list__list .woocommerce-search-list__item .woocommerce-search-list__item-input{margin:0 8px 0 0}.woocommerce-search-list__list .woocommerce-search-list__item .woocommerce-search-list__item-label{display:flex;flex:1}.woocommerce-search-list__list .woocommerce-search-list__item.depth-0+.depth-1{margin-top:-1px}.woocommerce-search-list__list .woocommerce-search-list__item:not(.depth-0){border-bottom:0!important}.woocommerce-search-list__list .woocommerce-search-list__item:not(.depth-0)+.depth-0{border-top:1px solid #f0f0f0}.woocommerce-search-list__list .woocommerce-search-list__item[class*=depth-] .woocommerce-search-list__item-label:before{margin-right:4px;content:"— — — — — "}.woocommerce-search-list__list .woocommerce-search-list__item.depth-0 .woocommerce-search-list__item-label:before{margin-right:0;content:""}.woocommerce-search-list__list .woocommerce-search-list__item.depth-1 .woocommerce-search-list__item-label:before{content:"— "}.woocommerce-search-list__list .woocommerce-search-list__item.depth-2 .woocommerce-search-list__item-label:before{content:"— — "}.woocommerce-search-list__list .woocommerce-search-list__item.depth-3 .woocommerce-search-list__item-label:before{content:"— — — "}.woocommerce-search-list__list .woocommerce-search-list__item.depth-4 .woocommerce-search-list__item-label:before{content:"— — — — "}.woocommerce-search-list__list .woocommerce-search-list__item .woocommerce-search-list__item-name{display:inline-block}.woocommerce-search-list__list .woocommerce-search-list__item .woocommerce-search-list__item-prefix{display:none;color:#757575}.woocommerce-search-list__list .woocommerce-search-list__item.is-searching .woocommerce-search-list__item-label,.woocommerce-search-list__list .woocommerce-search-list__item.is-skip-level .woocommerce-search-list__item-label{display:inline-block}.woocommerce-search-list__list .woocommerce-search-list__item.is-searching .woocommerce-search-list__item-prefix,.woocommerce-search-list__list .woocommerce-search-list__item.is-skip-level .woocommerce-search-list__item-prefix{display:inline}.woocommerce-search-list__list .woocommerce-search-list__item.is-searching .woocommerce-search-list__item-prefix:after,.woocommerce-search-list__list .woocommerce-search-list__item.is-skip-level .woocommerce-search-list__item-prefix:after{margin-right:4px;content:" ›"}.woocommerce-search-list__list .woocommerce-search-list__item.is-searching .woocommerce-search-list__item-name{color:#1e1e1e}.woocommerce-search-list__list .woocommerce-search-list__item.has-count>.components-menu-item__item{width:100%}.woocommerce-search-list__list .woocommerce-search-list__item .woocommerce-search-list__item-count{flex:0 1 auto;padding:2px 8px;border:1px solid #f0f0f0;border-radius:12px;font-size:.8em;line-height:1.4;color:#757575;background:#fff;white-space:nowrap}.woocommerce-search-list__list li:last-child .woocommerce-search-list__item{border-bottom:none}.woocommerce-search-list.is-compact .woocommerce-search-list__selected{margin:0 0 16px;padding:0;border-top:none;min-height:54px}.woocommerce-search-list.is-compact .woocommerce-search-list__search{margin:0 0 16px;padding:0;border-top:none}.woocommerce-section-header{padding:13px;border-bottom:none;display:flex;justify-content:space-between}@media (max-width:782px){.woocommerce-section-header{margin-left:-16px;margin-right:-16px;margin-bottom:12px;border-left:none;border-right:none;width:auto}}.woocommerce-section-header hr{-ms-grid-row-align:center;align-self:center;flex-grow:1;height:1px;margin:0 10px}@media (max-width:782px){.woocommerce-section-header.has-interval-select{position:relative;padding-bottom:30px}.woocommerce-section-header.has-interval-select .woocommerce-chart__interval-select{position:absolute;left:0;bottom:0;padding-left:6px}}.woocommerce-section-header__actions,.woocommerce-section-header__menu{text-align:right}.woocommerce-section-header__actions{display:flex;flex-grow:1;justify-content:flex-end}.woocommerce-section-header__actions .components-base-control{padding-top:0;min-height:34px}.woocommerce-section-header__actions .components-base-control .components-base-control__field{margin-bottom:0}.woocommerce-section-header__actions .components-base-control .components-base-control__field select{background:transparent}.woocommerce-ellipsis-menu__toggle{padding:0}.woocommerce-section-header__menu{display:flex;flex-direction:column;justify-content:center}.woocommerce-section-header__title{margin:0 16px 0 0;padding:3px 0;font-size:20px;font-size:1.25rem;line-height:2.2;font-weight:400}.woocommerce-segmented-selection{width:100%;color:#757575}.woocommerce-segmented-selection__container{width:100%;-ms-grid-columns:1fr 1fr;grid-template-columns:1fr 1fr;display:-ms-grid;display:grid;border-top:1px solid #ccc;border-bottom:1px solid #ccc;background-color:#ccc}.woocommerce-segmented-selection__item:nth-child(2n){border-left:1px solid #ccc;border-top:1px solid #ccc}.woocommerce-segmented-selection__item:nth-child(odd){border-top:1px solid #ccc}.woocommerce-segmented-selection__item:nth-child(-n+2){border-top:0}.woocommerce-segmented-selection__label{background-color:#f0f0f0;padding:12px 12px 12px 36px;position:relative;display:block;height:100%}.woocommerce-segmented-selection__label:active,.woocommerce-segmented-selection__label:hover{background-color:#e0e0e0}.woocommerce-segmented-selection__input{opacity:0;position:absolute;left:-9999px}.woocommerce-segmented-selection__input:active+label .woocommerce-segmented-selection__label{background-color:#e0e0e0}.woocommerce-segmented-selection__input:checked+label .woocommerce-segmented-selection__label{background-color:#fff;font-weight:600}.woocommerce-segmented-selection__input:checked+label .woocommerce-segmented-selection__label:before{content:"";width:8px;height:8px;background-color:#007cba;background-color:var(--wp-admin-theme-color);position:absolute;top:50%;transform:translate(-20px,-50%)}.woocommerce-segmented-selection__input:focus+label .woocommerce-segmented-selection__label{box-shadow:inset 0 0 0 1px #24292d}.woocommerce-select-control{position:relative}.woocommerce-select-control .components-base-control{height:56px;display:flex;align-items:center;border:1px solid #a7aaad;border-radius:3px;background:#fff;padding:12px;position:relative}.woocommerce-select-control .components-base-control .woocommerce-select-control__tags{margin:12px 4px 0 0}.woocommerce-select-control .components-base-control .woocommerce-tag{max-height:20px}.woocommerce-select-control .components-base-control .components-base-control__field{display:flex;align-items:center;flex:1;margin-bottom:0;max-width:100%}.woocommerce-select-control .components-base-control .components-base-control__label{position:absolute;top:50%;transform:translateY(-50%);color:#646970;font-size:16px}.woocommerce-select-control .components-base-control .woocommerce-select-control__control-input{font-size:16px;border:0;box-shadow:none;color:#2c3338;margin:12px 0 0;padding-left:0;padding-right:0;width:100%;line-height:24px;text-align:left;letter-spacing:inherit;background:transparent}.woocommerce-select-control .components-base-control .woocommerce-select-control__control-input::-webkit-search-cancel-button{display:none}.woocommerce-select-control .components-base-control .woocommerce-select-control__control-input:focus{outline:none}.woocommerce-select-control .components-base-control i{color:#636d75;margin-right:12px;width:24px}.woocommerce-select-control .components-base-control.is-active{box-shadow:0 0 0 1px #006088;border-color:#006088}.woocommerce-select-control .components-base-control.has-tags .components-base-control__label,.woocommerce-select-control .components-base-control.with-value .components-base-control__label{font-size:12px;margin-top:-12px}.woocommerce-select-control .components-base-control.is-disabled{opacity:.5}.woocommerce-select-control .components-base-control.is-disabled .components-base-control__label{cursor:default}.woocommerce-select-control .woocommerce-select-control__autofill-input{position:absolute;z-index:-1}.woocommerce-select-control .woocommerce-select-control__tags{position:relative;margin:12px 0 0}.woocommerce-select-control .woocommerce-select-control__tags.has-clear{padding-right:24px}.woocommerce-select-control .woocommerce-tag{max-height:24px}.woocommerce-select-control .woocommerce-select-control__clear{position:absolute;right:10px;top:calc(50% - 10px)}.woocommerce-select-control .woocommerce-select-control__clear>.dashicon{color:#c9c9c9}.woocommerce-select-control .woocommerce-select-control__listbox{background:#fff;display:flex;flex-direction:column;align-items:stretch;box-shadow:0 3px 5px rgba(0,0,0,.2),0 1px 18px rgba(0,0,0,.12),0 6px 10px rgba(0,0,0,.14);border-radius:3px;position:absolute;left:0;right:0;top:57px;z-index:10;overflow-y:auto;max-height:350px}.woocommerce-select-control .woocommerce-select-control__listbox.is-static{position:static}.woocommerce-select-control .woocommerce-select-control__option{padding:16px;min-height:56px;font-size:16px;text-align:left}.woocommerce-select-control .woocommerce-select-control__option.is-selected,.woocommerce-select-control .woocommerce-select-control__option:hover{background:#f6f7f7}.woocommerce-select-control.is-searchable .components-base-control__label{left:48px}.woocommerce-select-control.is-searchable .components-base-control.is-active .components-base-control__label{font-size:12px;margin-top:-12px}.woocommerce-stepper .woocommerce-stepper__steps{display:flex;justify-content:space-around;margin-bottom:24px}.woocommerce-stepper .woocommerce-stepper__step{padding:8px;font-weight:400;position:relative}.woocommerce-stepper .woocommerce-stepper__step .woocommerce-stepper__step-label-wrapper{display:flex;text-align:left;border:0;background-color:transparent;padding:0}.woocommerce-stepper .woocommerce-stepper__step .woocommerce-stepper__step-label-wrapper:focus{outline:none;box-shadow:none}.woocommerce-stepper .woocommerce-stepper__step button.woocommerce-stepper__step-label-wrapper{cursor:pointer}.woocommerce-stepper .woocommerce-stepper__step .woocommerce-stepper__step-text{width:100%}.woocommerce-stepper .woocommerce-stepper__step .woocommerce-stepper__step-label{color:#1e1e1e;line-height:24px;font-size:16px}.woocommerce-stepper .woocommerce-stepper__step .woocommerce-stepper__step-description{display:none;font-size:14px;color:#757575;font-weight:400;margin-top:2px}.woocommerce-stepper .woocommerce-stepper__step .woocommerce-stepper__step-icon svg{display:none}.woocommerce-stepper .woocommerce-stepper__step .woocommerce-spinner{display:block;margin-right:12px;max-height:24px;min-width:24px;width:24px;border-radius:50%;background:#007cba;background:var(--wp-admin-theme-color)}.woocommerce-stepper .woocommerce-stepper__step .woocommerce-spinner__circle{stroke:#fff}.woocommerce-stepper .woocommerce-stepper__step.is-active .woocommerce-stepper__step-icon,.woocommerce-stepper .woocommerce-stepper__step.is-complete .woocommerce-stepper__step-icon{background:#007cba;background:var(--wp-admin-theme-color);color:#fff}.woocommerce-stepper .woocommerce-stepper__step.is-active .woocommerce-stepper__step-label,.woocommerce-stepper .woocommerce-stepper__step.is-complete .woocommerce-stepper__step-label{color:#1e1e1e}.woocommerce-stepper .woocommerce-stepper__step.is-active .woocommerce-stepper__step-icon{font-weight:600}.woocommerce-stepper .woocommerce-stepper__step.is-active .woocommerce-stepper__step-label{font-weight:600;margin:0}.woocommerce-stepper .woocommerce-stepper__step.is-complete .woocommerce-stepper__step-number{display:none}.woocommerce-stepper .woocommerce-stepper__step.is-complete svg{display:inline}.woocommerce-stepper .woocommerce-stepper__step-icon{font-size:16px;display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;min-width:24px;margin-right:12px;background:#f0f0f0;color:#757575;border-radius:50%}.woocommerce-stepper .woocommerce-stepper__step-divider{align-self:flex-start;flex-grow:1;border-bottom:1px solid #f0f0f0;margin-top:20px}.woocommerce-stepper .woocommerce-stepper__step-divider:last-child{display:none}@media (max-width:782px){.woocommerce-stepper .woocommerce-stepper__step-label{display:none;padding-top:24px}.woocommerce-stepper .woocommerce-stepper__step-icon{margin-right:0}}.woocommerce-stepper.is-vertical .woocommerce-stepper__steps{align-items:normal;flex-direction:column;margin-bottom:0}.woocommerce-stepper.is-vertical .woocommerce-stepper__step{padding-bottom:36px}.woocommerce-stepper.is-vertical .woocommerce-stepper__step:after{content:"";position:absolute;left:20px;top:40px;height:calc(100% - 40px);border-left:1px solid #f0f0f0}.woocommerce-stepper.is-vertical .woocommerce-stepper__step:last-child{padding-bottom:8px}.woocommerce-stepper.is-vertical .woocommerce-stepper__step:last-child:after{display:none}.woocommerce-stepper.is-vertical .woocommerce-stepper__step-label{display:initial}.woocommerce-stepper.is-vertical .woocommerce-stepper__step-icon{margin-right:12px}.woocommerce-stepper.is-vertical .woocommerce-stepper__step-description{display:block}.woocommerce-stepper.is-vertical .woocommerce-stepper_content{margin-top:16px;margin-left:36px}@-webkit-keyframes rotate{0%{transform:rotate(0deg)}to{transform:rotate(270deg)}}@keyframes rotate{0%{transform:rotate(0deg)}to{transform:rotate(270deg)}}@-webkit-keyframes growAndShrink{0%,to{stroke-dashoffset:200}50%{stroke-dashoffset:50;transform:rotate(135deg)}to{transform:rotate(450deg)}}@keyframes growAndShrink{0%,to{stroke-dashoffset:200}50%{stroke-dashoffset:50;transform:rotate(135deg)}to{transform:rotate(450deg)}}.woocommerce-spinner{-webkit-animation:rotate 2s linear infinite;animation:rotate 2s linear infinite;width:40px;min-width:40px;height:40px;max-height:40px}.woocommerce-spinner__circle{stroke-dasharray:200;stroke-dashoffset:0;transform-origin:center;-webkit-animation:growAndShrink 2s ease-in-out infinite;animation:growAndShrink 2s ease-in-out infinite;stroke:#1d2327}.woocommerce-summary{margin:16px 0;display:-ms-grid;display:grid;border-color:#e0e0e0;border-style:solid;border-width:1px 0 0 1px;background-color:#f0f0f0;box-shadow:inset -1px -1px 0 #e0e0e0;width:100%}@media (max-width:782px){.woocommerce-summary{border-width:0}.woocommerce-summary.is-placeholder{border-top:0}.woocommerce-summary .woocommerce-summary__item-container.is-placeholder{border-top:1px solid #e0e0e0}}.woocommerce-summary .components-popover:not(.components-tooltip){position:static!important;top:auto!important;left:auto!important;right:auto!important;bottom:auto!important;margin-top:0!important;margin-left:0}.woocommerce-summary .components-popover:not(.components-tooltip) .components-popover__header{display:none}.woocommerce-summary .components-popover:not(.components-tooltip) .components-popover__content{position:static;left:auto;right:auto;margin:0;width:100%;max-width:100%!important;max-height:100%!important;box-shadow:none;border:none;transform:none}.woocommerce-summary .components-popover:not(.components-tooltip) .components-popover__content .woocommerce-summary__item.is-selected{display:none}.components-popover__content .woocommerce-summary{max-height:100%;margin-top:0;margin-bottom:0;overflow-y:auto;border:none}.woocommerce-summary .woocommerce-summary__item-delta,.woocommerce-summary .woocommerce-summary__item-value{flex:1 0 auto}.woocommerce-summary .woocommerce-summary__item-delta{flex:0 1 auto;display:flex}.woocommerce-summary,.woocommerce-summary.has-1-items,.woocommerce-summary.has-one-item{-ms-grid-columns:1fr;grid-template-columns:1fr}.woocommerce-summary.has-2-items{-ms-grid-columns:(1fr)[2];grid-template-columns:repeat(2,1fr)}.woocommerce-summary.has-2-items .woocommerce-summary__item-container:nth-of-type(2n) .woocommerce-summary__item{border-right-color:#e0e0e0}.woocommerce-summary.has-2-items .woocommerce-summary__item-container:nth-of-type(odd):nth-last-of-type(-n+2) .woocommerce-summary__item,.woocommerce-summary.has-2-items .woocommerce-summary__item-container:nth-of-type(odd):nth-last-of-type(-n+2)~.woocommerce-summary__item-container .woocommerce-summary__item{border-bottom-color:#e0e0e0}.woocommerce-summary.has-3-items{-ms-grid-columns:(1fr)[3];grid-template-columns:repeat(3,1fr)}.woocommerce-summary.has-3-items .woocommerce-summary__item-container:nth-of-type(3n) .woocommerce-summary__item{border-right-color:#e0e0e0}.woocommerce-summary.has-3-items .woocommerce-summary__item-container:nth-of-type(3n+1):nth-last-of-type(-n+3) .woocommerce-summary__item,.woocommerce-summary.has-3-items .woocommerce-summary__item-container:nth-of-type(3n+1):nth-last-of-type(-n+3)~.woocommerce-summary__item-container .woocommerce-summary__item{border-bottom-color:#e0e0e0}.woocommerce-summary.has-4-items,.woocommerce-summary.has-7-items,.woocommerce-summary.has-8-items{-ms-grid-columns:(1fr)[4];grid-template-columns:repeat(4,1fr)}.woocommerce-summary.has-4-items .woocommerce-summary__item-container:nth-of-type(4n) .woocommerce-summary__item,.woocommerce-summary.has-7-items .woocommerce-summary__item-container:nth-of-type(4n) .woocommerce-summary__item,.woocommerce-summary.has-8-items .woocommerce-summary__item-container:nth-of-type(4n) .woocommerce-summary__item{border-right-color:#e0e0e0}.woocommerce-summary.has-4-items .woocommerce-summary__item-container:nth-of-type(4n+1):nth-last-of-type(-n+4) .woocommerce-summary__item,.woocommerce-summary.has-4-items .woocommerce-summary__item-container:nth-of-type(4n+1):nth-last-of-type(-n+4)~.woocommerce-summary__item-container .woocommerce-summary__item,.woocommerce-summary.has-7-items .woocommerce-summary__item-container:nth-of-type(4n+1):nth-last-of-type(-n+4) .woocommerce-summary__item,.woocommerce-summary.has-7-items .woocommerce-summary__item-container:nth-of-type(4n+1):nth-last-of-type(-n+4)~.woocommerce-summary__item-container .woocommerce-summary__item,.woocommerce-summary.has-8-items .woocommerce-summary__item-container:nth-of-type(4n+1):nth-last-of-type(-n+4) .woocommerce-summary__item,.woocommerce-summary.has-8-items .woocommerce-summary__item-container:nth-of-type(4n+1):nth-last-of-type(-n+4)~.woocommerce-summary__item-container .woocommerce-summary__item{border-bottom-color:#e0e0e0}.woocommerce-summary.has-5-items{-ms-grid-columns:(1fr)[5];grid-template-columns:repeat(5,1fr)}.woocommerce-summary.has-5-items .woocommerce-summary__item-container:nth-of-type(5n) .woocommerce-summary__item{border-right-color:#e0e0e0}.woocommerce-summary.has-5-items .woocommerce-summary__item-container:nth-of-type(5n+1):nth-last-of-type(-n+5) .woocommerce-summary__item,.woocommerce-summary.has-5-items .woocommerce-summary__item-container:nth-of-type(5n+1):nth-last-of-type(-n+5)~.woocommerce-summary__item-container .woocommerce-summary__item{border-bottom-color:#e0e0e0}.woocommerce-summary.has-5-items.is-placeholder .woocommerce-summary__item-prev-label,.woocommerce-summary.has-5-items .woocommerce-summary__item-value .woocommerce-summary__item-prev-label{margin-right:calc(100% - 80px)}@media (min-width:1441px){.woocommerce-summary.has-6-items{-ms-grid-columns:(1fr)[6];grid-template-columns:repeat(6,1fr)}.woocommerce-summary.has-6-items .woocommerce-summary__item-container:nth-of-type(6n) .woocommerce-summary__item{border-right-color:#e0e0e0}.woocommerce-summary.has-6-items .woocommerce-summary__item-container:nth-of-type(6n+1):nth-last-of-type(-n+6) .woocommerce-summary__item,.woocommerce-summary.has-6-items .woocommerce-summary__item-container:nth-of-type(6n+1):nth-last-of-type(-n+6)~.woocommerce-summary__item-container .woocommerce-summary__item{border-bottom-color:#e0e0e0}.woocommerce-summary.has-6-items.is-placeholder .woocommerce-summary__item-prev-label,.woocommerce-summary.has-6-items .woocommerce-summary__item-value .woocommerce-summary__item-prev-label{margin-right:calc(100% - 80px)}.woocommerce-summary.has-9-items,.woocommerce-summary.has-10-items{-ms-grid-columns:(1fr)[5];grid-template-columns:repeat(5,1fr)}.woocommerce-summary.has-9-items .woocommerce-summary__item-container:nth-of-type(5n) .woocommerce-summary__item,.woocommerce-summary.has-10-items .woocommerce-summary__item-container:nth-of-type(5n) .woocommerce-summary__item{border-right-color:#e0e0e0}.woocommerce-summary.has-9-items .woocommerce-summary__item-container:nth-of-type(5n+1):nth-last-of-type(-n+5) .woocommerce-summary__item,.woocommerce-summary.has-9-items .woocommerce-summary__item-container:nth-of-type(5n+1):nth-last-of-type(-n+5)~.woocommerce-summary__item-container .woocommerce-summary__item,.woocommerce-summary.has-10-items .woocommerce-summary__item-container:nth-of-type(5n+1):nth-last-of-type(-n+5) .woocommerce-summary__item,.woocommerce-summary.has-10-items .woocommerce-summary__item-container:nth-of-type(5n+1):nth-last-of-type(-n+5)~.woocommerce-summary__item-container .woocommerce-summary__item{border-bottom-color:#e0e0e0}.woocommerce-summary.has-9-items.is-placeholder .woocommerce-summary__item-prev-label,.woocommerce-summary.has-9-items .woocommerce-summary__item-value .woocommerce-summary__item-prev-label,.woocommerce-summary.has-10-items.is-placeholder .woocommerce-summary__item-prev-label,.woocommerce-summary.has-10-items .woocommerce-summary__item-value .woocommerce-summary__item-prev-label{margin-right:calc(100% - 80px)}}@media (max-width:1440px){.woocommerce-summary.has-4-items.is-placeholder .woocommerce-summary__item-prev-label,.woocommerce-summary.has-4-items .woocommerce-summary__item-value .woocommerce-summary__item-prev-label,.woocommerce-summary.has-7-items.is-placeholder .woocommerce-summary__item-prev-label,.woocommerce-summary.has-7-items .woocommerce-summary__item-value .woocommerce-summary__item-prev-label,.woocommerce-summary.has-8-items.is-placeholder .woocommerce-summary__item-prev-label,.woocommerce-summary.has-8-items .woocommerce-summary__item-value .woocommerce-summary__item-prev-label{margin-right:calc(100% - 80px)}.woocommerce-summary.has-6-items,.woocommerce-summary.has-9-items{-ms-grid-columns:(1fr)[3];grid-template-columns:repeat(3,1fr)}.woocommerce-summary.has-6-items .woocommerce-summary__item-container:nth-of-type(3n) .woocommerce-summary__item,.woocommerce-summary.has-9-items .woocommerce-summary__item-container:nth-of-type(3n) .woocommerce-summary__item{border-right-color:#e0e0e0}.woocommerce-summary.has-6-items .woocommerce-summary__item-container:nth-of-type(3n+1):nth-last-of-type(-n+3) .woocommerce-summary__item,.woocommerce-summary.has-6-items .woocommerce-summary__item-container:nth-of-type(3n+1):nth-last-of-type(-n+3)~.woocommerce-summary__item-container .woocommerce-summary__item,.woocommerce-summary.has-9-items .woocommerce-summary__item-container:nth-of-type(3n+1):nth-last-of-type(-n+3) .woocommerce-summary__item,.woocommerce-summary.has-9-items .woocommerce-summary__item-container:nth-of-type(3n+1):nth-last-of-type(-n+3)~.woocommerce-summary__item-container .woocommerce-summary__item{border-bottom-color:#e0e0e0}.woocommerce-summary.has-10-items{-ms-grid-columns:(1fr)[4];grid-template-columns:repeat(4,1fr)}.woocommerce-summary.has-10-items .woocommerce-summary__item-container:nth-of-type(4n) .woocommerce-summary__item{border-right-color:#e0e0e0}.woocommerce-summary.has-10-items .woocommerce-summary__item-container:nth-of-type(4n+1):nth-last-of-type(-n+4) .woocommerce-summary__item,.woocommerce-summary.has-10-items .woocommerce-summary__item-container:nth-of-type(4n+1):nth-last-of-type(-n+4)~.woocommerce-summary__item-container .woocommerce-summary__item{border-bottom-color:#e0e0e0}.woocommerce-summary.has-10-items.is-placeholder .woocommerce-summary__item-prev-label,.woocommerce-summary.has-10-items .woocommerce-summary__item-value .woocommerce-summary__item-prev-label{margin-right:calc(100% - 80px)}.woocommerce-summary.has-9-items .woocommerce-summary__item-container:nth-of-type(5n) .woocommerce-summary__item,.woocommerce-summary.has-10-items .woocommerce-summary__item-container:nth-of-type(5n) .woocommerce-summary__item{border-right-color:#e0e0e0}}@media (max-width:960px){.woocommerce-summary .woocommerce-summary__item{border-right-color:#e0e0e0}}@media (max-width:782px){.woocommerce-summary .woocommerce-summary__item-container{margin-left:-16px;margin-right:-16px;width:auto}.woocommerce-summary .woocommerce-summary__item-container .woocommerce-summary__item{border-right:none}.woocommerce-summary .components-popover.components-popover{margin-left:-16px;margin-right:-16px}.woocommerce-summary .components-popover.components-popover .woocommerce-summary__item-container{margin-left:0;margin-right:0}}.woocommerce-summary__item-container{margin-bottom:0}.woocommerce-summary__item-container:last-of-type .woocommerce-summary__item{border-bottom-color:#e0e0e0!important}.woocommerce-summary__item-container.is-dropdown-button{padding:0;list-style:none;border-right:1px solid #e0e0e0}.woocommerce-summary__item-container.is-dropdown-button .components-button{border-bottom:1px solid #e0e0e0;text-align:left;display:block}@media (max-width:782px){.woocommerce-summary__item-container.is-dropdown-button{border-right:none}}.woocommerce-summary__item-container.is-placeholder .woocommerce-summary__item{height:117px}.woocommerce-summary__item-container.is-placeholder .woocommerce-summary__item-label{-webkit-animation:loading-fade 1.6s ease-in-out infinite;animation:loading-fade 1.6s ease-in-out infinite;background-color:#f0f0f0;color:transparent;display:inline-block;height:20px;margin-top:2.2px;max-width:110px;width:70%}.woocommerce-summary__item-container.is-placeholder .woocommerce-summary__item-label:after{content:"\00a0"}@media screen and (prefers-reduced-motion:reduce){.woocommerce-summary__item-container.is-placeholder .woocommerce-summary__item-label{-webkit-animation:none;animation:none}}.woocommerce-summary__item-container.is-placeholder .woocommerce-summary__item-data{justify-content:space-between}.woocommerce-summary__item-container.is-placeholder .woocommerce-summary__item-value{-webkit-animation:loading-fade 1.6s ease-in-out infinite;animation:loading-fade 1.6s ease-in-out infinite;background-color:#f0f0f0;color:transparent;display:inline-block;height:28px;width:60px;max-width:60px}.woocommerce-summary__item-container.is-placeholder .woocommerce-summary__item-value:after{content:"\00a0"}@media screen and (prefers-reduced-motion:reduce){.woocommerce-summary__item-container.is-placeholder .woocommerce-summary__item-value{-webkit-animation:none;animation:none}}.woocommerce-summary__item-container.is-placeholder .woocommerce-summary__item-delta{-webkit-animation:loading-fade 1.6s ease-in-out infinite;animation:loading-fade 1.6s ease-in-out infinite;background-color:#f0f0f0;color:transparent;width:60px;border-radius:2px}.woocommerce-summary__item-container.is-placeholder .woocommerce-summary__item-delta:after{content:"\00a0"}@media screen and (prefers-reduced-motion:reduce){.woocommerce-summary__item-container.is-placeholder .woocommerce-summary__item-delta{-webkit-animation:none;animation:none}}.woocommerce-summary__item{display:flex;flex-direction:column;height:100%;padding:24px;background-color:#f8f9fa;border-bottom:1px solid #e0e0e0;border-right:1px solid #e0e0e0;line-height:1.4em;text-decoration:none;color:#1e1e1e}.woocommerce-summary__item.components-button{height:auto;padding:16px;align-items:normal}.woocommerce-summary__item:hover{background-color:#f0f0f0}.woocommerce-summary__item:hover,.woocommerce-summary__item:hover .woocommerce-summary__item-label{color:#007cba;color:var(--wp-admin-theme-color)}.woocommerce-summary__item:active{background-color:#f0f0f0}.woocommerce-summary__item:focus{box-shadow:inset -1px 1px 0 #757575,inset 1px -1px 0 #757575!important}.woocommerce-summary__item.is-selected:focus{box-shadow:inset -1px -1px 0 #757575,inset 1px 0 0 #757575,inset 0 4px 0 #007cba!important;box-shadow:inset -1px -1px 0 #757575,inset 1px 0 0 #757575,inset 0 4px 0 var(--wp-admin-theme-color)!important}.is-dropdown-button .woocommerce-summary__item{position:relative;width:100%;padding-right:56px}@media (max-width:782px){.is-dropdown-button .woocommerce-summary__item{border-right:none}}.woocommerce-summary__item .woocommerce-summary__item-data{display:flex;justify-content:space-between}.woocommerce-summary__item .woocommerce-summary__item-label{display:block;margin-bottom:16px;color:#757575}.woocommerce-summary__item .woocommerce-summary__item-value{margin-bottom:4px;font-weight:500;color:#1e1e1e}.woocommerce-summary__item .woocommerce-summary__item-delta{padding:5px;border-radius:3px;height:-webkit-min-content;height:-moz-min-content;height:min-content;background-color:#f0f0f0;color:#1e1e1e}.woocommerce-summary__item.is-selected{background:#fff;box-shadow:inset 0 4px 0 #007cba;box-shadow:inset 0 4px 0 var(--wp-admin-theme-color)}.woocommerce-summary__item.is-selected .woocommerce-summary__item-value{font-weight:600}.woocommerce-summary__item.is-selected .woocommerce-summary__item-delta{font-weight:400}.woocommerce-summary__item.is-good-trend .woocommerce-summary__item-delta{background-color:#4ab866;color:#fff}.woocommerce-summary__item.is-bad-trend .woocommerce-summary__item-delta{background-color:#d94f4f;color:#fff}.woocommerce-summary__item .woocommerce-summary__toggle{position:absolute;top:44px;right:16px;transition:transform .2s ease}@media screen and (prefers-reduced-motion:reduce){.woocommerce-summary__item .woocommerce-summary__toggle{transition:none}}.is-dropdown-expanded .woocommerce-summary__item .woocommerce-summary__toggle{transform:rotate(-180deg)}.components-popover__content .woocommerce-summary__item .woocommerce-summary__item-delta,.components-popover__content .woocommerce-summary__item .woocommerce-summary__item-label,.components-popover__content .woocommerce-summary__item .woocommerce-summary__item-value{margin-bottom:0}.woocommerce-table{margin-bottom:40px}.woocommerce-table .woocommerce-table__actions{display:inline-flex;justify-content:flex-end;align-items:center}.woocommerce-table .woocommerce-table__actions>*{margin-right:16px}.woocommerce-table .woocommerce-table__actions>:last-child{margin-right:0}.woocommerce-table .woocommerce-table__actions>div{width:100%}.woocommerce-table .components-card__footer{flex-direction:column}.woocommerce-table .components-card__footer>*{padding-right:0}.woocommerce-table.is-empty{align-items:center;background:#f0f0f0;color:#757575;display:flex;height:calc(182px + 6.825rem);height:calc(17px + 1.1375rem + (33px + 1.1375rem)*var(--number-of-rows));justify-content:center;padding:16px;text-align:center}.woocommerce-table .woocommerce-pagination{margin-bottom:16px;z-index:1;background:#fff;position:relative}.woocommerce-table .components-card__header{align-items:center;text-align:left;display:-ms-grid;display:grid;width:100%;-ms-grid-columns:auto 1fr auto;grid-template-columns:auto 1fr auto}@media (max-width:960px){.woocommerce-table.has-search .woocommerce-table__actions{grid-gap:12px;-ms-grid-columns:auto 1fr;grid-template-columns:auto 1fr;-ms-grid-row:2;grid-row-start:2;-ms-grid-row-span:0;grid-row-end:2;-ms-grid-column:1;grid-column-start:1;-ms-grid-column-span:3;grid-column-end:4;margin:0}}.woocommerce-table .woocommerce-search .woocommerce-select-control__control{height:38px}.woocommerce-table .woocommerce-compare-button{padding:3px 12px;height:auto}.woocommerce-table .woocommerce-ellipsis-menu{justify-content:flex-end;display:flex}.woocommerce-table__caption{font-size:24px;font-size:1.5rem;text-align:left}.components-card__body{position:relative}.woocommerce-table__table{overflow-x:auto}.woocommerce-table__table:after,.woocommerce-table__table:before{content:"";position:absolute;top:0;width:60px;height:100%;opacity:0;pointer-events:none;transition:opacity .3s;z-index:1}.woocommerce-table__table:after{right:0;background:linear-gradient(90deg,hsla(0,0%,100%,0),#fff)}.woocommerce-table__table:before{left:0;background:linear-gradient(90deg,#fff,hsla(0,0%,100%,0))}.woocommerce-table__table.is-scrollable-left:before,.woocommerce-table__table.is-scrollable-right:after{opacity:1}.woocommerce-table__table table{border-collapse:collapse;width:100%}.woocommerce-table__table tr:focus-within,.woocommerce-table__table tr:hover{background-color:#e0e0e0}.woocommerce-table__table tr:focus-within td,.woocommerce-table__table tr:focus-within th,.woocommerce-table__table tr:hover td,.woocommerce-table__table tr:hover th{background:transparent}.woocommerce-table__empty-item,.woocommerce-table__header,.woocommerce-table__item{padding:16px 24px}.woocommerce-table__header,.woocommerce-table__item{font-size:13px;font-size:.8125rem;text-align:left;border-bottom:1px solid #e2e4e7}.woocommerce-table__header>a:only-child,.woocommerce-table__item>a:only-child{display:block}.woocommerce-table__header a:focus,.woocommerce-table__header a:hover,.woocommerce-table__item a:focus,.woocommerce-table__item a:hover{color:#533582}.woocommerce-table__header .is-placeholder,.woocommerce-table__item .is-placeholder{-webkit-animation:loading-fade 1.6s ease-in-out infinite;animation:loading-fade 1.6s ease-in-out infinite;background-color:#f0f0f0;color:transparent;display:inline-block;height:16px;max-width:120px;width:80%}.woocommerce-table__header .is-placeholder:after,.woocommerce-table__item .is-placeholder:after{content:"\00a0"}@media screen and (prefers-reduced-motion:reduce){.woocommerce-table__header .is-placeholder,.woocommerce-table__item .is-placeholder{-webkit-animation:none;animation:none}}.woocommerce-table__header:not(.is-left-aligned),.woocommerce-table__item:not(.is-left-aligned){text-align:right}.woocommerce-table__header:not(.is-left-aligned) button,.woocommerce-table__item:not(.is-left-aligned) button{justify-content:flex-end}.woocommerce-table__header.is-numeric .is-placeholder,.woocommerce-table__item.is-numeric .is-placeholder{max-width:40px}.woocommerce-table__header .is-negative,.woocommerce-table__item .is-negative{color:#d94f4f;font-weight:700}.woocommerce-table__header.is-sorted,.woocommerce-table__item.is-sorted{background-color:#f0f0f0}.woocommerce-table__header.is-checkbox-column,.woocommerce-table__item.is-checkbox-column{width:33px;max-width:33px;padding-right:0;padding-left:16px}.woocommerce-table__header.is-checkbox-column+th,.woocommerce-table__item.is-checkbox-column+th{border-left:0}.woocommerce-table tr:last-child .woocommerce-table__item{border-bottom:0}.woocommerce-table__empty-item{text-align:center;font-size:18px;font-size:1.125rem;color:#757575;font-weight:700}@media (max-width:782px){.woocommerce-table__empty-item{font-size:13px;font-size:.8125rem}}th.woocommerce-table__item{font-weight:400}.woocommerce-table__header{padding:8px 24px;background-color:#f8f9fa;font-weight:700;white-space:nowrap}.woocommerce-table__header.is-left-aligned.is-sortable{padding-left:16px}.woocommerce-table__header.is-left-aligned.is-sortable svg{display:inline-flex;order:1;margin-left:0}.woocommerce-table__header .components-button.is-button{height:auto;width:100%;padding:8px 24px 8px 0;vertical-align:middle;line-height:1;border:none;background:transparent!important;box-shadow:none!important;align-items:center}.woocommerce-table__header .components-button.is-button:active,.woocommerce-table__header .components-button.is-button:hover{box-shadow:none!important}.woocommerce-table__header.is-sortable{padding:0}.woocommerce-table__header.is-sortable svg{visibility:hidden;margin-left:4px}.woocommerce-table__header.is-sortable .components-button:focus svg,.woocommerce-table__header.is-sortable .components-button:hover svg,.woocommerce-table__header.is-sortable.is-sorted .components-button svg{visibility:visible}.woocommerce-table__summary{text-align:center;margin:0}.woocommerce-table__summary-item{display:inline-block;margin-bottom:0;margin-left:8px;margin-right:8px}.woocommerce-table__summary-item .woocommerce-table__summary-label,.woocommerce-table__summary-item .woocommerce-table__summary-value{display:inline-block}.woocommerce-table__summary-item .woocommerce-table__summary-label{margin-left:4px}.woocommerce-table__summary-item .woocommerce-table__summary-value{font-weight:600}.woocommerce-tag{display:inline-flex;margin:1px 4px 1px 0;overflow:hidden;vertical-align:middle}.woocommerce-tag .woocommerce-tag__remove,.woocommerce-tag .woocommerce-tag__text{display:inline-block;line-height:24px;background:#f0f0f0;transition:all .2s cubic-bezier(.4,1,.4,1)}.woocommerce-tag .woocommerce-tag__text{-ms-grid-row-align:center;align-self:center;padding:0 8px;border-radius:12px;color:#757575;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.woocommerce-tag.has-remove .woocommerce-tag__text{padding:0 4px 0 8px;border-radius:12px 0 0 12px}.woocommerce-tag .woocommerce-tag__remove{cursor:pointer;height:inherit;padding:0 2px;border-radius:0 12px 12px 0;color:#757575;line-height:10px;text-indent:0;height:24px}.woocommerce-tag .woocommerce-tag__remove:hover{color:#1e1e1e}.muriel-input-text{background:#fff;border:1px solid #a7aaad;border-radius:3px;height:56px;box-shadow:none;padding:12px 12px 4px;position:relative;box-shadow:0 2px 6px rgba(0,0,0,.05)}.muriel-input-text:hover{border-color:#787c82}.muriel-input-text label{color:#646970;font-size:14px;line-height:21px}.muriel-input-text label.components-base-control__label{margin:0}.muriel-input-text .components-text-control__input,.muriel-input-text .components-text-control__input[type=color],.muriel-input-text .components-text-control__input[type=date],.muriel-input-text .components-text-control__input[type=datetime-local],.muriel-input-text .components-text-control__input[type=datetime],.muriel-input-text .components-text-control__input[type=email],.muriel-input-text .components-text-control__input[type=month],.muriel-input-text .components-text-control__input[type=number],.muriel-input-text .components-text-control__input[type=password],.muriel-input-text .components-text-control__input[type=tel],.muriel-input-text .components-text-control__input[type=text],.muriel-input-text .components-text-control__input[type=time],.muriel-input-text .components-text-control__input[type=url],.muriel-input-text .components-text-control__input[type=week]{border:0;box-shadow:none;font-size:16px;line-height:21px;margin:0;padding:0;min-height:30px}.muriel-input-text .components-text-control__input:focus,.muriel-input-text .components-text-control__input[type=color]:focus,.muriel-input-text .components-text-control__input[type=date]:focus,.muriel-input-text .components-text-control__input[type=datetime-local]:focus,.muriel-input-text .components-text-control__input[type=datetime]:focus,.muriel-input-text .components-text-control__input[type=email]:focus,.muriel-input-text .components-text-control__input[type=month]:focus,.muriel-input-text .components-text-control__input[type=number]:focus,.muriel-input-text .components-text-control__input[type=password]:focus,.muriel-input-text .components-text-control__input[type=tel]:focus,.muriel-input-text .components-text-control__input[type=text]:focus,.muriel-input-text .components-text-control__input[type=time]:focus,.muriel-input-text .components-text-control__input[type=url]:focus,.muriel-input-text .components-text-control__input[type=week]:focus{box-shadow:none}.muriel-input-text.active{box-shadow:0 0 0 2px #007cba;box-shadow:0 0 0 2px var(--wp-admin-theme-color);border-color:transparent}.muriel-input-text.active input{color:#2c3338}.muriel-input-text.with-value .components-base-control__label{display:block;position:relative;top:-8px;width:100%;font-size:12px}.muriel-input-text.with-value input{color:#2c3338;position:relative;top:-12px}.muriel-input-text.empty label{display:none}.muriel-input-text.empty input{color:#646970}.muriel-input-text.has-error{box-shadow:none}.muriel-input-text.disabled label{display:none}.muriel-input-text.disabled input{color:#a7aaad}.muriel-input-text.disabled input:-ms-input-placeholder{opacity:1}.muriel-input-text.disabled input::-moz-placeholder{color:#a7aaad;opacity:1}.muriel-input-text.disabled input::placeholder{color:#a7aaad;opacity:1}.muriel-input-text.disabled input:-ms-input-placeholder{color:#a7aaad}.muriel-input-text.disabled input::-ms-input-placeholder{color:#a7aaad}.text-control-with-affixes{display:inline-flex;flex-direction:row;width:100%}.text-control-with-affixes input[type=email],.text-control-with-affixes input[type=number],.text-control-with-affixes input[type=password],.text-control-with-affixes input[type=text],.text-control-with-affixes input[type=url]{flex-grow:1;margin:0}.text-control-with-affixes input[type=email]:disabled,.text-control-with-affixes input[type=number]:disabled,.text-control-with-affixes input[type=password]:disabled,.text-control-with-affixes input[type=text]:disabled,.text-control-with-affixes input[type=url]:disabled{border-right-width:0}.text-control-with-affixes input[type=email]:disabled+.text-control-with-affixes__suffix,.text-control-with-affixes input[type=number]:disabled+.text-control-with-affixes__suffix,.text-control-with-affixes input[type=password]:disabled+.text-control-with-affixes__suffix,.text-control-with-affixes input[type=text]:disabled+.text-control-with-affixes__suffix,.text-control-with-affixes input[type=url]:disabled+.text-control-with-affixes__suffix{border-left:1px solid #f0f0f0}.text-control-with-affixes.text-control-with-prefix input{border-top-left-radius:0;border-bottom-left-radius:0}.text-control-with-affixes.text-control-with-suffix input{border-top-right-radius:0;border-bottom-right-radius:0}.text-control-with-affixes__prefix,.text-control-with-affixes__suffix{position:relative;background:#fff;border:1px solid #757575;color:#757575;padding:7px 14px;white-space:nowrap;flex:1 0 auto;font-size:14px;line-height:1.5}.disabled .text-control-with-affixes__prefix,.disabled .text-control-with-affixes__suffix{background:hsla(0,0%,100%,.5);border-color:hsla(0,0%,87.1%,.75);box-shadow:inset 0 1px 2px rgba(0,0,0,.04);color:rgba(51,51,51,.5)}.text-control-with-affixes__prefix{border-right:none;border-radius:4px 0 0 4px}.text-control-with-affixes__prefix+input[type=email]:disabled,.text-control-with-affixes__prefix+input[type=number]:disabled,.text-control-with-affixes__prefix+input[type=password]:disabled,.text-control-with-affixes__prefix+input[type=text]:disabled,.text-control-with-affixes__prefix+input[type=url]:disabled{border-left-color:#f0f0f0}.text-control-with-affixes__suffix{border-left:none;border-radius:0 4px 4px 0}.woocommerce-timeline ul{margin:0;padding-left:0;list-style-type:none}.woocommerce-timeline ul li{margin-bottom:0}.woocommerce-timeline .woocommerce-timeline-group .woocommerce-timeline-group__title{color:#1d2327;font-size:12px;font-weight:600;text-transform:uppercase;margin:0 0 16px;display:inline-block}.woocommerce-timeline .woocommerce-timeline-group hr{float:right;width:calc(100% - 40px);margin-bottom:16px;border:.5px solid #e3dfe2}.woocommerce-timeline .woocommerce-timeline-item .woocommerce-timeline-item__top-border{min-height:16px;border-left:1px solid #c3c4c7;margin:0 12px}.woocommerce-timeline .woocommerce-timeline-item .woocommerce-timeline-item__title{display:flex;align-items:center;flex-direction:row;justify-content:space-between;color:#2c3338}.woocommerce-timeline .woocommerce-timeline-item .woocommerce-timeline-item__title *{font-size:16px}.woocommerce-timeline .woocommerce-timeline-item .woocommerce-timeline-item__headline{display:flex;align-items:center;flex-direction:row;margin:8px 0}.woocommerce-timeline .woocommerce-timeline-item .woocommerce-timeline-item__headline *{margin:0}.woocommerce-timeline .woocommerce-timeline-item .woocommerce-timeline-item__headline>*{padding:0 16px}.woocommerce-timeline .woocommerce-timeline-item .woocommerce-timeline-item__headline svg{fill:#fff;padding:4px;background:#c3c4c7;border-radius:9999px;box-sizing:content-box;width:16px;height:16px}.woocommerce-timeline .woocommerce-timeline-item .woocommerce-timeline-item__headline svg.is-success{background:#4ab866}.woocommerce-timeline .woocommerce-timeline-item .woocommerce-timeline-item__headline svg.is-warning{background:#ffb900}.woocommerce-timeline .woocommerce-timeline-item .woocommerce-timeline-item__headline svg.is-error{background:#d94f4f}.woocommerce-timeline .woocommerce-timeline-item .woocommerce-timeline-item__timestamp{font-size:14px;line-height:16px}.woocommerce-timeline .woocommerce-timeline-item .woocommerce-timeline-item__body{display:flex;flex-direction:column;color:#50575e;margin:0 12px;padding:8px 36px;border-left:1px solid #c3c4c7}.woocommerce-timeline .woocommerce-timeline-item .woocommerce-timeline-item__body *{margin:0;font-size:14px}.woocommerce-timeline ul :last-child.woocommerce-timeline-group hr:last-child{display:none}.woocommerce-view-more-list{padding-left:4px;margin:0 0 0 4px;vertical-align:middle}.woocommerce-view-more-list__popover{margin:0;padding:16px;text-align:left}.woocommerce-view-more-list__popover__item{display:block;margin:16px 0}.woocommerce-view-more-list__popover__item:first-child{margin-top:0}.woocommerce-view-more-list__popover__item:last-child{margin-bottom:0}.woocommerce-web-preview{width:100%;display:flex;align-items:center;justify-content:center;background:#f6f7f7}.woocommerce-web-preview.is-loading .woocommerce-web-preview__iframe-wrapper{display:none}.woocommerce-web-preview .woocommerce-web-preview__iframe-wrapper{width:100%}.woocommerce-web-preview iframe{width:100%;height:100%;min-height:400px}.woocommerce-badge{background-color:#f0f0f0;border-radius:20px;display:inline-block;text-align:center;font-style:normal;font-weight:600;font-size:14px;line-height:27px;align-items:center;width:32px;height:28px}.woocommerce-component-settings .components-base-control{margin-top:16px;margin-bottom:16px;position:relative}.woocommerce-component-settings .components-base-control.has-error .components-base-control__help{left:0!important}.editor-block-preview__content{overflow:hidden}.components-placeholder__label .gridicon,.components-placeholder__label .material-icon{margin-right:1ch;fill:currentColor}.editor-styles-wrapper .wc-block-grid .wc-block-grid__products{list-style:none;margin:0 -8px 16px;padding:0}.editor-styles-wrapper .wc-block-grid .wc-block-grid__products .wc-block-grid__product{margin:0 0 24px}.editor-styles-wrapper .wc-block-grid.components-placeholder{padding:2em 1em}.editor-styles-wrapper .wc-block-grid.is-loading,.editor-styles-wrapper .wc-block-grid.is-not-found{display:block}.components-base-control+.wc-block-base-control-notice{margin:-16px 0 16px}.components-base-control+.wc-block-base-control-notice:last-child{margin:-16px 0 12px}.woocommerce-search-list__list.woocommerce-search-list__list{box-sizing:border-box;margin:0;padding:0}.woocommerce-search-list__selected.woocommerce-search-list__selected>ul{list-style:none;margin:0;padding:0}.theme-twentytwenty .wp-block .wc-block-active-filters__title,.theme-twentytwenty .wp-block .wc-block-attribute-filter__title,.theme-twentytwenty .wp-block .wc-block-grid__product-title,.theme-twentytwenty .wp-block .wc-block-price-filter__title,.theme-twentytwenty .wp-block .wc-block-stock-filter__title{font-size:1em}.wc-atomic-blocks-product__selection{width:100%}.wc-atomic-blocks-product__edit-card{padding:16px;border-top:1px solid #e0e0e0}.wc-atomic-blocks-product__edit-card .wc-atomic-blocks-product__edit-card-title{margin:0 0 16px}.wp-block-woocommerce-cart-express-payment-block{margin:14px 0 28px}.wp-block-woocommerce-cart-express-payment-block .components-placeholder__label svg{font-size:1em}.wp-block-woocommerce-cart-express-payment-block .wc-block-components-express-payment-continue-rule--checkout{margin-bottom:0}.wp-block-woocommerce-cart-express-payment-block.wp-block-woocommerce-cart-express-payment-block--has-express-payment-methods{padding:14px 0;margin:-14px 0 14px!important;position:relative}.wp-block-woocommerce-filled-cart-block .wc-block-components-sidebar-layout{display:block}.wp-block-woocommerce-filled-cart-block .block-editor-block-list__layout{display:flex;flex-flow:row wrap;align-items:flex-start}.wp-block-woocommerce-filled-cart-block .block-editor-block-list__layout>:first-child,.wp-block-woocommerce-filled-cart-block .wc-block-components-main>:first-child,.wp-block-woocommerce-filled-cart-block .wc-block-components-sidebar>:first-child{margin-top:0}.wp-block-woocommerce-filled-cart-block .wp-block-woocommerce-cart-items-block .block-editor-block-list__layout,.wp-block-woocommerce-filled-cart-block .wp-block-woocommerce-cart-totals-block .block-editor-block-list__layout{display:block}.wc-block-cart__page-notice{margin:0}.wp-block-woocommerce-cart.is-editor-preview{max-height:1000px;overflow:hidden}.wc-block-checkout__additional_fields{margin:1.5em 0 -1.5em}.wc-block-components-checkout-step__description-placeholder{opacity:.5}.wc-block-components-checkout-step__title{display:flex;width:100%}.wp-block-woocommerce-checkout-express-payment-block{margin:14px 0 28px}.wp-block-woocommerce-checkout-express-payment-block .components-placeholder__label svg{font-size:1em}.wp-block-woocommerce-checkout-express-payment-block .wc-block-components-express-payment-continue-rule--checkout{margin-bottom:0}.wp-block-woocommerce-checkout-express-payment-block.wp-block-woocommerce-checkout-express-payment-block--has-express-payment-methods{padding:14px 0;margin:-14px 0 14px!important;position:relative}.wp-block-woocommerce-checkout-express-payment-block-placeholder *{pointer-events:all}.wp-block-woocommerce-checkout-express-payment-block-placeholder .wp-block-woocommerce-checkout-express-payment-block-placeholder__description{display:block;margin:0 0 1em}.wp-block-woocommerce-checkout-order-note-block{margin-top:20px;margin-bottom:20px;padding-top:4px;padding-bottom:4px}.wp-block-woocommerce-checkout-order-note-block .wc-block-checkout__add-note{margin-top:0;margin-bottom:0}.wc-block-checkout__terms{margin:20px 0;padding-top:4px;padding-bottom:4px;display:flex;align-items:flex-start}.wc-block-checkout__terms .block-editor-rich-text__editable{vertical-align:middle;line-height:1.5em}.wc-block-components-checkbox{margin-right:16px}.wc-block-checkout__terms_notice .components-notice__action{margin-left:0}.wc-block-checkout__terms_notice-button{display:flex;flex-direction:row;align-items:center}.wc-block-checkout__terms_notice-button .wc-block-checkout__terms_notice-button__icon{margin-left:4px}.wp-block-woocommerce-checkout .wc-block-components-sidebar-layout{display:block}.wp-block-woocommerce-checkout .block-editor-block-list__layout{display:flex;flex-flow:row wrap;align-items:flex-start}.wp-block-woocommerce-checkout .block-editor-block-list__layout .wc-block-checkout__additional_fields{padding:0}.wp-block-woocommerce-checkout .block-editor-block-list__layout>:first-child,.wp-block-woocommerce-checkout .wc-block-components-main>:first-child,.wp-block-woocommerce-checkout .wc-block-components-sidebar>:first-child{margin-top:0}.wp-block-woocommerce-checkout .wp-block-woocommerce-checkout-fields-block .block-editor-block-list__layout,.wp-block-woocommerce-checkout .wp-block-woocommerce-checkout-totals-block .block-editor-block-list__layout{display:block}body.wc-lock-selected-block--move .block-editor-block-mover,body.wc-lock-selected-block--move .block-editor-block-mover__move-button-container,body.wc-lock-selected-block--remove .block-editor-block-settings-menu__popover .components-menu-group:last-child{display:none}body.wc-lock-selected-block--remove .block-editor-block-settings-menu__popover .components-menu-group:nth-last-child(2){margin-bottom:-12px}.wc-block-checkout__controls-text{color:#999;font-style:italic}.components-base-control--nested{padding-left:52px;margin-top:-12px}.wc-block-checkout__page-notice{margin:0}.components-panel__body-title .components-button{opacity:1}.wp-block-woocommerce-checkout.is-editor-preview{max-height:1000px;overflow:hidden}.wc-block-products .components-placeholder__instructions{border-bottom:1px solid #e0e2e6;width:100%;padding-bottom:1em;margin-bottom:2em}.wc-block-products .components-placeholder__label svg{fill:currentColor;margin-right:1ch}.wc-block-products .components-placeholder__fieldset{display:block}.wc-block-products .wc-block-products__add-product-button{margin:0 0 1em;vertical-align:middle;height:auto;padding:.5em 1em}.wc-block-products .wc-block-products__add-product-button svg{fill:currentColor;margin-left:.5ch;vertical-align:middle}.wc-block-products .wc-block-products__read_more_button{display:block;margin-bottom:1em}.wc-block-all-products .components-placeholder__fieldset{max-width:none;overflow:hidden}.wc-block-all-products .wc-block-all-products-grid-item-template{border-top:1px solid #e0e0e0;margin-top:20px;width:100%;overflow:hidden;text-align:center}.wc-block-all-products .wc-block-all-products-grid-item-template .components-tip{max-width:450px;margin:20px auto;text-align:left}.wc-block-all-products .wc-block-all-products-grid-item-template .components-tip p{margin:1em 0}.wc-block-all-products .wc-block-all-products-grid-item-template .wc-block-all-products__actions{display:flex;margin:20px auto;padding:1em 0 0;align-items:center;vertical-align:middle;max-width:450px}.wc-block-all-products .wc-block-all-products-grid-item-template .wc-block-all-products__actions .wc-block-all-products__done-button{margin:0;order:3;line-height:32px;height:auto}.wc-block-all-products .wc-block-all-products-grid-item-template .wc-block-all-products__actions .wc-block-all-products__cancel-button{margin:0 1em 0 auto;order:2}.wc-block-all-products .wc-block-all-products-grid-item-template .wc-block-all-products__actions .wc-block-all-products__reset-button{margin:0;order:1}.wc-block-all-products .wc-block-all-products-grid-item-template .wc-block-grid__products{margin:0 auto!important;text-align:center;position:relative;max-width:450px}.wc-block-all-products .wc-block-all-products-grid-item-template .wc-block-grid__product{padding:1px 20px;margin:0 auto;background:#fff;box-shadow:0 5px 7px -2px rgba(0,0,0,.2);position:static}.wc-block-all-products .wc-block-all-products-grid-item-template .wc-block-grid__product .wp-block-button__link{margin-top:0}.wc-block-all-products .wc-block-all-products-grid-item-template .wc-block-grid__product:after,.wc-block-all-products .wc-block-all-products-grid-item-template .wc-block-grid__product:before{content:"";background:#e0e0e0;display:block;position:absolute;width:100%;top:20px;bottom:20px}.wc-block-all-products .wc-block-all-products-grid-item-template .wc-block-grid__product:before{right:100%;margin-right:30px}.wc-block-all-products .wc-block-all-products-grid-item-template .wc-block-grid__product:after{left:100%;margin-left:30px}.components-base-control+.wc-block-reviews-by-product__notice{margin:-16px 0 16px}.components-base-control:nth-last-child(2)+.wc-block-reviews-by-product__notice{margin:-16px 0 12px}.wc-block-single-product__selection{width:100%}.wc-block-single-product__reset-layout{padding:0}.wc-block-single-product__reset-layout svg{margin-right:4px}.wc-block-single-product__edit-card{padding:16px;border-top:1px solid #e0e0e0}.wc-block-single-product__edit-card .wc-block-single-product__edit-card-title{margin:0 0 16px}.wc-block-editor-components-title{background-color:transparent}.wc-block-error-message{margin-bottom:16px;margin-top:8px}.wc-block-api-error .components-placeholder__fieldset{display:block}.wc-block-api-error .wc-block-error-message{margin-top:0}.wc-block-api-error .components-spinner{float:none}.wc-block-editor-components-external-link-card{display:flex;flex-direction:row;text-decoration:none;margin:24px 0;color:inherit;align-items:flex-start}.wc-block-editor-components-external-link-card+.wc-block-editor-components-external-link-card{margin-top:-8px}.wc-block-editor-components-external-link-card .wc-block-editor-components-external-link-card__content{flex:1 1 0;padding-right:16px}.wc-block-editor-components-external-link-card .wc-block-editor-components-external-link-card__title{font-weight:500;display:block}.wc-block-editor-components-external-link-card .wc-block-editor-components-external-link-card__description{color:#757575;display:block;font-size:.875em;margin-top:.5em}.wc-block-editor-components-external-link-card .wc-block-editor-components-external-link-card__icon{flex:0 0 24px;margin:0;text-align:right;color:inherit;vertical-align:top}.wc-block-feedback-prompt{background-color:#f7f7f7;border-top:1px solid #e0e0e0;margin:0 -16px;padding:24px;text-align:center}.wc-block-feedback-prompt .wc-block-feedback-prompt__title{margin:0 0 12px}.wc-block-feedback-prompt .wc-block-feedback-prompt__link{color:inherit}.wc-block-feedback-prompt .wc-block-feedback-prompt__link>.gridicon{vertical-align:text-bottom}.woocommerce-product-attributes__operator .components-base-control__help{border:0;clip:rect(1px,1px,1px,1px);-webkit-clip-path:inset(50%);clip-path:inset(50%);height:1px;margin:-1px;overflow:hidden;overflow-wrap:normal!important;word-wrap:normal!important;padding:0;position:absolute!important;width:1px}.woocommerce-product-attributes__operator .components-base-control__label{margin-bottom:0;margin-right:.5em}.woocommerce-search-list__item.woocommerce-product-attributes__item.is-searching .woocommerce-search-list__item-prefix:after,.woocommerce-search-list__item.woocommerce-product-attributes__item.is-skip-level .woocommerce-search-list__item-prefix:after{content:":"}.woocommerce-search-list__item.woocommerce-product-attributes__item.is-not-active:active,.woocommerce-search-list__item.woocommerce-product-attributes__item.is-not-active:focus,.woocommerce-search-list__item.woocommerce-product-attributes__item.is-not-active:hover{background:#fff}.woocommerce-search-list__item.woocommerce-product-attributes__item.is-loading{justify-content:center}.woocommerce-search-list__item.woocommerce-product-attributes__item.is-loading .components-spinner{margin-bottom:12px}.woocommerce-search-list__item.woocommerce-product-attributes__item.depth-0:after{margin-left:8px;content:"";height:24px;width:24px;background-image:url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M7.41 15.41L12 10.83l4.59 4.58L18 14l-6-6-6 6z" fill="%23757575" /></svg>');background-repeat:no-repeat;background-position:100%;background-size:contain}.woocommerce-search-list__item.woocommerce-product-attributes__item.depth-0.is-selected:after{background-image:url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M7.41 8.59L12 13.17l4.59-4.58L18 10l-6 6-6-6 1.41-1.41z" fill="%23757575" /></svg>')}.woocommerce-search-list__item.woocommerce-product-attributes__item[disabled].depth-0:after{margin-left:0;width:auto;background:none}.woocommerce-product-categories__operator .components-base-control__help{border:0;clip:rect(1px,1px,1px,1px);-webkit-clip-path:inset(50%);clip-path:inset(50%);height:1px;margin:-1px;overflow:hidden;overflow-wrap:normal!important;word-wrap:normal!important;padding:0;position:absolute!important;width:1px}.woocommerce-product-categories__operator .components-base-control__label{margin-bottom:0;margin-right:.5em}.woocommerce-search-product__item .woocommerce-search-list__item-name .description{display:block}.woocommerce-search-product__item.is-searching .woocommerce-search-list__item-prefix:after,.woocommerce-search-product__item.is-skip-level .woocommerce-search-list__item-prefix:after{content:":"}.woocommerce-search-product__item.is-not-active:active,.woocommerce-search-product__item.is-not-active:focus,.woocommerce-search-product__item.is-not-active:hover{background:#fff}.woocommerce-search-product__item.is-loading{justify-content:center}.woocommerce-search-product__item.is-loading .components-spinner{margin-bottom:12px}.woocommerce-search-product__item.depth-0.is-variable:after{margin-left:8px;content:"";height:24px;width:24px;background-image:url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M7.41 8.59L12 13.17l4.59-4.58L18 10l-6 6-6-6 1.41-1.41z" fill="%23757575" /></svg>');background-repeat:no-repeat;background-position:100%;background-size:contain}.woocommerce-search-product__item.depth-0.is-variable.is-selected:after{background-image:url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M7.41 15.41L12 10.83l4.59 4.58L18 14l-6-6-6 6z" fill="%23757575" /></svg>')}.woocommerce-product-tags__operator .components-base-control__help{border:0;clip:rect(1px,1px,1px,1px);-webkit-clip-path:inset(50%);clip-path:inset(50%);height:1px;margin:-1px;overflow:hidden;overflow-wrap:normal!important;word-wrap:normal!important;padding:0;position:absolute!important;width:1px}.woocommerce-product-tags__operator .components-base-control__label{margin-bottom:0;margin-right:.5em}.wc-block-text-toolbar-button{align-items:center}.wc-block-text-toolbar-button.is-toggled,.wc-block-text-toolbar-button.is-toggled:focus{background:#757575;color:#fff}.block-editor-block-toolbar__slot{flex-shrink:0}.components-toggle-button-control .components-base-control__field{flex-wrap:wrap}.components-toggle-button-control .components-toggle-button-control__label{width:100%;margin-bottom:8px;display:block}.components-toggle-button-control .components-base-control__help{margin-top:0}.wc-block-view-switch-control{text-align:left;background:#f0f2f3;box-shadow:0 0 0 13px #f0f2f3;margin:0 0 27px;visibility:hidden;color:#757575}.has-child-selected .wc-block-view-switch-control,.is-selected .wc-block-view-switch-control{visibility:visible}.wc-block-handpicked-products__selection,.wc-block-products-category__selection,.wc-block-reviews__selection{width:100%}.wc-block-products-category__cancel-button.is-tertiary{margin:1em auto 0}.wc-block-product-categories.wc-block-product-categories ul{margin-left:20px}.wc-block-product-categories .components-placeholder__label svg,.wc-block-product-on-sale .components-placeholder__label svg{margin-right:1ch;fill:currentColor}.wc-block-products-by-attribute__selection{width:100%}.wc-block-featured-product .components-resizable-box__handle{z-index:10}.wc-block-featured-product__message{margin-bottom:16px}.wc-block-featured-product__selection{width:100%}.wc-block-product-search__field.input-control{color:#828b96!important}.wc-block-product-search .wc-block-product-search__fields .block-editor-rich-text{flex-grow:1}.wc-block-product-tag__selection{width:100%}.wc-block-product-tag__cancel-button.is-tertiary{margin:1em auto 0}.wc-block-featured-category .components-resizable-box__handle{z-index:10}.wc-block-featured-category .components-placeholder__label svg{fill:currentColor;margin-right:1ch}.wc-block-featured-category__selection{width:100%}.components-disabled .wc-block-price-filter__range-input-wrapper .wc-block-price-filter__range-input::-webkit-slider-thumb{pointer-events:none}.components-disabled .wc-block-price-filter__range-input-wrapper .wc-block-price-filter__range-input::-moz-range-thumb{pointer-events:none}.components-disabled .wc-block-price-filter__range-input-wrapper .wc-block-price-filter__range-input::-ms-thumb{pointer-events:none}.wc-block-price-slider .components-placeholder__instructions{border-bottom:1px solid #e0e2e6;width:100%;padding-bottom:1em;margin-bottom:2em}.wc-block-price-slider .components-placeholder__label svg{fill:currentColor;margin-right:1ch}.wc-block-price-slider .components-placeholder__fieldset{display:block}.wc-block-price-slider .wc-block-price-slider__add-product-button{margin:0 0 1em;vertical-align:middle;height:auto;padding:.5em 1em}.wc-block-price-slider .wc-block-price-slider__add-product-button svg{fill:currentColor;margin-left:.5ch;vertical-align:middle}.wc-block-price-slider .wc-block-price-slider__read_more_button{display:block;margin-bottom:1em}.wc-block-attribute-filter .components-placeholder__instructions{border-bottom:1px solid #e0e2e6;width:100%;padding-bottom:1em;margin-bottom:2em}.wc-block-attribute-filter .components-placeholder__label svg{fill:currentColor;margin-right:1ch}.wc-block-attribute-filter .components-placeholder__fieldset{display:block}.wc-block-attribute-filter .woocommerce-search-list__search{border-top:0;margin-top:0;padding-top:0}.wc-block-attribute-filter .wc-block-attribute-filter__add-attribute-button{margin:0 0 1em;vertical-align:middle;height:auto;padding:.5em 1em}.wc-block-attribute-filter .wc-block-attribute-filter__add-attribute-button svg{fill:currentColor;margin-left:.5ch;vertical-align:middle}.wc-block-attribute-filter .wc-block-attribute-filter__read_more_button{display:block;margin-bottom:1em}@-webkit-keyframes loading-fade{0%{opacity:.7}50%{opacity:1}to{opacity:.7}}@keyframes loading-fade{0%{opacity:.7}50%{opacity:1}to{opacity:.7}}.wc-block-stock-filter .components-placeholder__instructions{border-bottom:1px solid #e0e2e6;width:100%;padding-bottom:1em;margin-bottom:2em}.wc-block-stock-filter .components-placeholder__label svg{fill:currentColor;margin-right:1ch}.wc-block-stock-filter .components-placeholder__fieldset{display:block}.wc-block-stock-filter .woocommerce-search-list__search{border-top:0;margin-top:0;padding-top:0}.wc-block-stock-filter .wc-block-stock-filter__add-stock-button{margin:0 0 1em;vertical-align:middle;height:auto;padding:.5em 1em}.wc-block-stock-filter .wc-block-stock-filter__add-stock-button svg{fill:currentColor;margin-left:.5ch;vertical-align:middle}.wc-block-stock-filter .wc-block-stock-filter__read_more_button{display:block;margin-bottom:1em}woocommerce-blocks/build/wc-payment-method-cheque.js000064400000003320151335517640016615 0ustar00!function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=23)}({1:function(e,t){e.exports=window.wp.i18n},23:function(e,t,n){"use strict";n.r(t);var r,o=n(7),c=n(1),u=n(4),i=n(6),l=Object(u.getSetting)("cheque_data",{}),a=Object(c.__)("Check payment",'woocommerce'),f=Object(i.decodeEntities)(l.title)||a,d=function(){return Object(i.decodeEntities)(l.description||"")},s=function(e){var t=e.components.PaymentMethodLabel;return React.createElement(t,{text:f})},p={name:"cheque",label:React.createElement(s,null),content:React.createElement(d,null),edit:React.createElement(d,null),canMakePayment:function(){return!0},ariaLabel:f,supports:{features:null!==(r=null==l?void 0:l.supports)&&void 0!==r?r:[]}};Object(o.registerPaymentMethod)(p)},4:function(e,t){e.exports=window.wc.wcSettings},6:function(e,t){e.exports=window.wp.htmlEntities},7:function(e,t){e.exports=window.wc.wcBlocksRegistry}});woocommerce-blocks/build/products-by-attribute.asset.php000064400000000746151335517640017561 0ustar00<?php return array('dependencies' => array('lodash', 'moment', 'react', 'react-dom', 'wc-settings', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-data-controls', 'wp-date', 'wp-deprecated', 'wp-dom', 'wp-element', 'wp-escape-html', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-keycodes', 'wp-polyfill', 'wp-primitives', 'wp-server-side-render', 'wp-url', 'wp-viewport'), 'version' => 'd43de0cd2a0f892d080ee2c3dbaecc8f');woocommerce-blocks/build/mini-cart-component-frontend.asset.php000064400000000703151335517640020776 0ustar00<?php return array('dependencies' => array('lodash', 'react', 'wc-blocks-checkout', 'wc-blocks-data-store', 'wc-price-format', 'wc-settings', 'wp-a11y', 'wp-autop', 'wp-components', 'wp-compose', 'wp-data', 'wp-deprecated', 'wp-dom', 'wp-element', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-is-shallow-equal', 'wp-keycodes', 'wp-polyfill', 'wp-primitives', 'wp-url', 'wp-warning', 'wp-wordcount'), 'version' => '9c378fed77e9f5259b29b53b8bc82557');woocommerce-blocks/build/wc-blocks.asset.php000064400000000275151335517640015166 0ustar00<?php return array('dependencies' => array('wp-blocks', 'wp-compose', 'wp-element', 'wp-hooks', 'wp-i18n', 'wp-polyfill', 'wp-primitives'), 'version' => '3a22aa1f11fa1e8ae82c70260664c805');woocommerce-blocks/build/wc-blocks-vendors-style.css000064400000012271151335517640016664 0ustar00.components-custom-select-control{position:relative}.components-custom-select-control__label{display:block;margin-bottom:8px}.components-custom-select-control__button{border:1px solid #757575;border-radius:2px;min-height:30px;min-width:130px;position:relative;text-align:left}.components-custom-select-control__button.components-custom-select-control__button{padding-right:24px}.components-custom-select-control__button:focus:not(:disabled){border-color:var(--wp-admin-theme-color);box-shadow:0 0 0 .5px var(--wp-admin-theme-color)}.components-custom-select-control__button .components-custom-select-control__button-icon{height:100%;padding:0;position:absolute;right:0;top:0}.components-custom-select-control__menu{background-color:#fff;max-height:400px;min-width:100%;overflow:auto;padding:0;position:absolute;z-index:1000000}.components-custom-select-control__menu:focus{border:1px solid #1e1e1e;border-radius:2px;outline:none;transition:none}.components-custom-select-control__item{align-items:center;display:flex;list-style-type:none;padding:10px 5px 10px 25px;cursor:default}.components-custom-select-control__item.is-highlighted{background:#ddd}.components-custom-select-control__item-icon{margin-left:-20px;margin-right:0}.components-spinner{display:inline-block;background-color:#949494;width:18px;height:18px;opacity:.7;margin:5px 11px 0;border-radius:100%;position:relative}.components-spinner:before{content:"";position:absolute;background-color:#fff;top:3px;left:3px;width:4px;height:4px;border-radius:100%;transform-origin:6px 6px;-webkit-animation:components-spinner__animation 1s linear infinite;animation:components-spinner__animation 1s linear infinite}@-webkit-keyframes components-spinner__animation{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}@keyframes components-spinner__animation{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}.components-snackbar{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;font-size:13px;background-color:#1e1e1e;border-radius:2px;box-shadow:0 2px 4px rgba(0,0,0,.3);color:#fff;padding:16px 24px;width:100%;max-width:600px;box-sizing:border-box;cursor:pointer}@media(min-width:600px){.components-snackbar{width:-webkit-fit-content;width:-moz-fit-content;width:fit-content}}.components-snackbar:focus{box-shadow:0 0 0 1px #fff,0 0 0 3px var(--wp-admin-theme-color)}.components-snackbar__action.components-button{margin-left:32px;color:#fff;height:auto;flex-shrink:0;line-height:1.4;padding:0}.components-snackbar__action.components-button:not(:disabled):not([aria-disabled=true]):not(.is-secondary){text-decoration:underline;background-color:transparent}.components-snackbar__action.components-button:not(:disabled):not([aria-disabled=true]):not(.is-secondary):focus{color:#fff;box-shadow:none;outline:1px dotted #fff}.components-snackbar__action.components-button:not(:disabled):not([aria-disabled=true]):not(.is-secondary):hover{color:var(--wp-admin-theme-color)}.components-snackbar__content{display:flex;align-items:baseline;justify-content:space-between;line-height:1.4}.components-snackbar-list{position:absolute;z-index:100000;width:100%;box-sizing:border-box}.components-snackbar-list__notice-container{position:relative;padding-top:8px}.components-combobox-control{width:100%}input.components-combobox-control__input[type=text]{width:100%;border:none;box-shadow:none;padding:2px;margin:0;line-height:inherit;min-height:auto}input.components-combobox-control__input[type=text]:focus{outline:none;box-shadow:none}.components-combobox-control__suggestions-container{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;box-shadow:0 0 0 transparent;transition:box-shadow .1s linear;border-radius:2px;border:1px solid #757575;font-size:16px;line-height:normal;display:flex;flex-wrap:wrap;align-items:flex-start;width:100%;margin:0 0 8px;padding:4px}@media(prefers-reduced-motion:reduce){.components-combobox-control__suggestions-container{transition-duration:0s}}@media(min-width:600px){.components-combobox-control__suggestions-container{font-size:13px;line-height:normal}}.components-combobox-control__suggestions-container:focus{border-color:var(--wp-admin-theme-color);box-shadow:0 0 0 .5px var(--wp-admin-theme-color);outline:2px solid transparent}.components-combobox-control__suggestions-container::-webkit-input-placeholder{color:rgba(30,30,30,.62)}.components-combobox-control__suggestions-container::-moz-placeholder{opacity:1;color:rgba(30,30,30,.62)}.components-combobox-control__suggestions-container:-ms-input-placeholder{color:rgba(30,30,30,.62)}.is-dark-theme .components-combobox-control__suggestions-container::-webkit-input-placeholder{color:hsla(0,0%,100%,.65)}.is-dark-theme .components-combobox-control__suggestions-container::-moz-placeholder{opacity:1;color:hsla(0,0%,100%,.65)}.is-dark-theme .components-combobox-control__suggestions-container:-ms-input-placeholder{color:hsla(0,0%,100%,.65)}.components-combobox-control__suggestions-container:focus-within{border-color:var(--wp-admin-theme-color);box-shadow:0 0 0 .5px var(--wp-admin-theme-color);outline:2px solid transparent}.components-combobox-control__reset.components-button{display:flex;height:24px;min-width:24px;padding:0}woocommerce-blocks/build/active-filters.js000064400000060253151335517640014734 0ustar00this.wc=this.wc||{},this.wc.blocks=this.wc.blocks||{},this.wc.blocks["active-filters"]=function(e){function t(t){for(var r,a,i=t[0],l=t[1],s=t[2],b=0,p=[];b<i.length;b++)a=i[b],Object.prototype.hasOwnProperty.call(c,a)&&c[a]&&p.push(c[a][0]),c[a]=0;for(r in l)Object.prototype.hasOwnProperty.call(l,r)&&(e[r]=l[r]);for(u&&u(t);p.length;)p.shift()();return o.push.apply(o,s||[]),n()}function n(){for(var e,t=0;t<o.length;t++){for(var n=o[t],r=!0,i=1;i<n.length;i++){var l=n[i];0!==c[l]&&(r=!1)}r&&(o.splice(t--,1),e=a(a.s=n[0]))}return e}var r={},c={5:0},o=[];function a(t){if(r[t])return r[t].exports;var n=r[t]={i:t,l:!1,exports:{}};return e[t].call(n.exports,n,n.exports,a),n.l=!0,n.exports}a.m=e,a.c=r,a.d=function(e,t,n){a.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},a.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},a.t=function(e,t){if(1&t&&(e=a(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(a.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)a.d(n,r,function(t){return e[t]}.bind(null,r));return n},a.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return a.d(t,"a",t),t},a.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},a.p="";var i=window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[],l=i.push.bind(i);i.push=t,i=i.slice();for(var s=0;s<i.length;s++)t(i[s]);var u=l;return o.push([806,0]),n()}({0:function(e,t){e.exports=window.wp.element},1:function(e,t){e.exports=window.wp.i18n},108:function(e,t,n){"use strict";n.d(t,"a",(function(){return f})),n.d(t,"b",(function(){return d})),n.d(t,"c",(function(){return m}));var r=n(8),c=n.n(r),o=n(24),a=n(14),i=n(0),l=n(34),s=n.n(l),u=n(62),b=n(136),p=n(78),f=function(e){var t=Object(p.a)();e=e||t;var n=Object(a.useSelect)((function(t){return t(o.QUERY_STATE_STORE_KEY).getValueForQueryContext(e,void 0)}),[e]),r=Object(a.useDispatch)(o.QUERY_STATE_STORE_KEY).setValueForQueryContext;return[n,Object(i.useCallback)((function(t){r(e,t)}),[e,r])]},d=function(e,t,n){var r=Object(p.a)();n=n||r;var c=Object(a.useSelect)((function(r){return r(o.QUERY_STATE_STORE_KEY).getValueForQueryKey(n,e,t)}),[n,e]),l=Object(a.useDispatch)(o.QUERY_STATE_STORE_KEY).setQueryValue;return[c,Object(i.useCallback)((function(t){l(n,e,t)}),[n,e,l])]},m=function(e,t){var n=Object(p.a)(),r=f(t=t||n),o=c()(r,2),a=o[0],l=o[1],d=Object(u.a)(a),m=Object(u.a)(e),v=Object(b.a)(m),O=Object(i.useRef)(!1);return Object(i.useEffect)((function(){s()(v,m)||(l(Object.assign({},d,m)),O.current=!0)}),[d,m,v,l]),O.current?[a,l]:[e,l]}},11:function(e,t){e.exports=window.React},12:function(e,t){e.exports=window.wp.blockEditor},123:function(e,t){},127:function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var r=n(8),c=n.n(r),o=n(0),a=function(){var e=Object(o.useState)(),t=c()(e,2)[1];return Object(o.useCallback)((function(e){t((function(){throw e}))}),[])}},133:function(e,t,n){"use strict";var r=n(17),c=n.n(r),o=n(18),a=n.n(o),i=n(19),l=n.n(i),s=n(20),u=n.n(s),b=n(10),p=n.n(b),f=n(0),d=n(7),m=n(1),v=n(4);function O(e){var t=e.level,n={1:"M9 5h2v10H9v-4H5v4H3V5h2v4h4V5zm6.6 0c-.6.9-1.5 1.7-2.6 2v1h2v7h2V5h-1.4z",2:"M7 5h2v10H7v-4H3v4H1V5h2v4h4V5zm8 8c.5-.4.6-.6 1.1-1.1.4-.4.8-.8 1.2-1.3.3-.4.6-.8.9-1.3.2-.4.3-.8.3-1.3 0-.4-.1-.9-.3-1.3-.2-.4-.4-.7-.8-1-.3-.3-.7-.5-1.2-.6-.5-.2-1-.2-1.5-.2-.4 0-.7 0-1.1.1-.3.1-.7.2-1 .3-.3.1-.6.3-.9.5-.3.2-.6.4-.8.7l1.2 1.2c.3-.3.6-.5 1-.7.4-.2.7-.3 1.2-.3s.9.1 1.3.4c.3.3.5.7.5 1.1 0 .4-.1.8-.4 1.1-.3.5-.6.9-1 1.2-.4.4-1 .9-1.6 1.4-.6.5-1.4 1.1-2.2 1.6V15h8v-2H15z",3:"M12.1 12.2c.4.3.8.5 1.2.7.4.2.9.3 1.4.3.5 0 1-.1 1.4-.3.3-.1.5-.5.5-.8 0-.2 0-.4-.1-.6-.1-.2-.3-.3-.5-.4-.3-.1-.7-.2-1-.3-.5-.1-1-.1-1.5-.1V9.1c.7.1 1.5-.1 2.2-.4.4-.2.6-.5.6-.9 0-.3-.1-.6-.4-.8-.3-.2-.7-.3-1.1-.3-.4 0-.8.1-1.1.3-.4.2-.7.4-1.1.6l-1.2-1.4c.5-.4 1.1-.7 1.6-.9.5-.2 1.2-.3 1.8-.3.5 0 1 .1 1.6.2.4.1.8.3 1.2.5.3.2.6.5.8.8.2.3.3.7.3 1.1 0 .5-.2.9-.5 1.3-.4.4-.9.7-1.5.9v.1c.6.1 1.2.4 1.6.8.4.4.7.9.7 1.5 0 .4-.1.8-.3 1.2-.2.4-.5.7-.9.9-.4.3-.9.4-1.3.5-.5.1-1 .2-1.6.2-.8 0-1.6-.1-2.3-.4-.6-.2-1.1-.6-1.6-1l1.1-1.4zM7 9H3V5H1v10h2v-4h4v4h2V5H7v4z",4:"M9 15H7v-4H3v4H1V5h2v4h4V5h2v10zm10-2h-1v2h-2v-2h-5v-2l4-6h3v6h1v2zm-3-2V7l-2.8 4H16z",5:"M12.1 12.2c.4.3.7.5 1.1.7.4.2.9.3 1.3.3.5 0 1-.1 1.4-.4.4-.3.6-.7.6-1.1 0-.4-.2-.9-.6-1.1-.4-.3-.9-.4-1.4-.4H14c-.1 0-.3 0-.4.1l-.4.1-.5.2-1-.6.3-5h6.4v1.9h-4.3L14 8.8c.2-.1.5-.1.7-.2.2 0 .5-.1.7-.1.5 0 .9.1 1.4.2.4.1.8.3 1.1.6.3.2.6.6.8.9.2.4.3.9.3 1.4 0 .5-.1 1-.3 1.4-.2.4-.5.8-.9 1.1-.4.3-.8.5-1.3.7-.5.2-1 .3-1.5.3-.8 0-1.6-.1-2.3-.4-.6-.2-1.1-.6-1.6-1-.1-.1 1-1.5 1-1.5zM9 15H7v-4H3v4H1V5h2v4h4V5h2v10z",6:"M9 15H7v-4H3v4H1V5h2v4h4V5h2v10zm8.6-7.5c-.2-.2-.5-.4-.8-.5-.6-.2-1.3-.2-1.9 0-.3.1-.6.3-.8.5l-.6.9c-.2.5-.2.9-.2 1.4.4-.3.8-.6 1.2-.8.4-.2.8-.3 1.3-.3.4 0 .8 0 1.2.2.4.1.7.3 1 .6.3.3.5.6.7.9.2.4.3.8.3 1.3s-.1.9-.3 1.4c-.2.4-.5.7-.8 1-.4.3-.8.5-1.2.6-1 .3-2 .3-3 0-.5-.2-1-.5-1.4-.9-.4-.4-.8-.9-1-1.5-.2-.6-.3-1.3-.3-2.1s.1-1.6.4-2.3c.2-.6.6-1.2 1-1.6.4-.4.9-.7 1.4-.9.6-.3 1.1-.4 1.7-.4.7 0 1.4.1 2 .3.5.2 1 .5 1.4.8 0 .1-1.3 1.4-1.3 1.4zm-2.4 5.8c.2 0 .4 0 .6-.1.2 0 .4-.1.5-.2.1-.1.3-.3.4-.5.1-.2.1-.5.1-.7 0-.4-.1-.8-.4-1.1-.3-.2-.7-.3-1.1-.3-.3 0-.7.1-1 .2-.4.2-.7.4-1 .7 0 .3.1.7.3 1 .1.2.3.4.4.6.2.1.3.3.5.3.2.1.5.2.7.1z"};return n.hasOwnProperty(t)?Object(f.createElement)(v.SVG,{width:"20",height:"20",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"},Object(f.createElement)(v.Path,{d:n[t]})):null}var h=function(e){l()(o,e);var t,n,r=(t=o,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=p()(t);if(n){var c=p()(this).constructor;e=Reflect.construct(r,arguments,c)}else e=r.apply(this,arguments);return u()(this,e)});function o(){return c()(this,o),r.apply(this,arguments)}return a()(o,[{key:"createLevelControl",value:function(e,t,n){var r=e===t;return{icon:Object(f.createElement)(O,{level:e}),
/* translators: %s: heading level e.g: "2", "3", "4" */
title:Object(m.sprintf)(Object(m.__)("Heading %d"),e),isActive:r,onClick:function(){return n(e)}}}},{key:"render",value:function(){var e=this,t=this.props,n=t.isCollapsed,r=void 0===n||n,c=t.minLevel,o=t.maxLevel,a=t.selectedLevel,i=t.onChange;return Object(f.createElement)(v.ToolbarGroup,{isCollapsed:r,icon:Object(f.createElement)(O,{level:a}),controls:Object(d.range)(c,o).map((function(t){return e.createLevelControl(t,a,i)}))})}}]),o}(f.Component);t.a=h},136:function(e,t,n){"use strict";n.d(t,"a",(function(){return c}));var r=n(11);function c(e,t){var n=Object(r.useRef)();return Object(r.useEffect)((function(){n.current===e||t&&!t(e,n.current)||(n.current=e)}),[e,t]),n.current}},14:function(e,t){e.exports=window.wp.data},157:function(e,t,n){"use strict";var r=n(0),c=(n(2),n(12)),o=n(21),a=n(1);n(217),t.a=Object(o.withInstanceId)((function(e){var t=e.className,n=e.headingLevel,o=e.onChange,i=e.heading,l=e.instanceId,s="h".concat(n);return Object(r.createElement)(s,{className:t},Object(r.createElement)("label",{className:"screen-reader-text",htmlFor:"block-title-".concat(l)},Object(a.__)("Block title",'woocommerce')),Object(r.createElement)(c.PlainText,{id:"block-title-".concat(l),className:"wc-block-editor-components-title",value:i,onChange:o}))}))},165:function(e,t,n){"use strict";n.d(t,"a",(function(){return l}));var r=n(24),c=n(14),o=n(0),a=n(62),i=n(127),l=function(e){var t=e.namespace,n=e.resourceName,l=e.resourceValues,s=void 0===l?[]:l,u=e.query,b=void 0===u?{}:u,p=e.shouldSelect,f=void 0===p||p;if(!t||!n)throw new Error("The options object must have valid values for the namespace and the resource properties.");var d=Object(o.useRef)({results:[],isLoading:!0}),m=Object(a.a)(b),v=Object(a.a)(s),O=Object(i.a)(),h=Object(c.useSelect)((function(e){if(!f)return null;var c=e(r.COLLECTIONS_STORE_KEY),o=[t,n,m,v],a=c.getCollectionError.apply(c,o);return a&&O(a),{results:c.getCollection.apply(c,o),isLoading:!c.hasFinishedResolution("getCollection",o)}}),[t,n,v,m,f]);return null!==h&&(d.current=h),d.current}},179:function(e,t){},21:function(e,t){e.exports=window.wp.compose},217:function(e,t){},220:function(e,t,n){"use strict";var r=n(9),c=n.n(r),o=n(16),a=n.n(o),i=n(0),l=(n(2),n(6)),s=n.n(l),u=n(1),b=n(66),p=n(305),f=(n(179),["text","screenReaderText","element","className","radius","children"]),d=function(e){var t=e.text,n=e.screenReaderText,r=void 0===n?"":n,o=e.element,l=void 0===o?"li":o,u=e.className,b=void 0===u?"":u,p=e.radius,d=void 0===p?"small":p,m=e.children,v=void 0===m?null:m,O=a()(e,f),h=l,j=s()(b,"wc-block-components-chip","wc-block-components-chip--radius-"+d),g=Boolean(r&&r!==t);return Object(i.createElement)(h,c()({className:j},O),Object(i.createElement)("span",{"aria-hidden":g,className:"wc-block-components-chip__text"},t),g&&Object(i.createElement)("span",{className:"screen-reader-text"},r),v)},m=["ariaLabel","className","disabled","onRemove","removeOnAnyClick","text","screenReaderText"];t.a=function(e){var t=e.ariaLabel,n=void 0===t?"":t,r=e.className,o=void 0===r?"":r,l=e.disabled,f=void 0!==l&&l,v=e.onRemove,O=void 0===v?function(){}:v,h=e.removeOnAnyClick,j=void 0!==h&&h,g=e.text,w=e.screenReaderText,y=void 0===w?"":w,_=a()(e,m),E=j?"span":"button";if(!n){var k=y&&"string"==typeof y?y:g;n="string"!=typeof k?
/* translators: Remove chip. */
Object(u.__)("Remove",'woocommerce'):Object(u.sprintf)(
/* translators: %s text of the chip to remove. */
Object(u.__)('Remove "%s"','woocommerce'),k)}var x={"aria-label":n,disabled:f,onClick:O,onKeyDown:function(e){"Backspace"!==e.key&&"Delete"!==e.key||O()}},S=j?x:{},C=j?{"aria-hidden":!0}:x;return Object(i.createElement)(d,c()({},_,S,{className:s()(o,"is-removable"),element:j?"button":_.element,screenReaderText:y,text:g}),Object(i.createElement)(E,c()({className:"wc-block-components-chip__remove"},C),Object(i.createElement)(b.a,{className:"wc-block-components-chip__remove-icon",srcElement:p.a,size:16})))}},24:function(e,t){e.exports=window.wc.wcBlocksData},25:function(e,t){e.exports=window.wp.htmlEntities},26:function(e,t){e.exports=window.wp.blocks},278:function(e,t,n){"use strict";n.d(t,"a",(function(){return o})),n.d(t,"b",(function(){return a}));var r=n(3),c=Object(r.getSetting)("attributes",[]).reduce((function(e,t){var n,r=(n=t)&&n.attribute_name?{id:parseInt(n.attribute_id,10),name:n.attribute_name,taxonomy:"pa_"+n.attribute_name,label:n.attribute_label}:null;return r.id&&e.push(r),e}),[]),o=function(e){if(e)return c.find((function(t){return t.id===e}))},a=function(e){if(e)return c.find((function(t){return t.taxonomy===e}))}},279:function(e,t,n){"use strict";n.d(t,"a",(function(){return c})),n.d(t,"b",(function(){return o}));var r=n(7),c=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){},n=arguments.length>2?arguments[2]:void 0,c=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"",o=e.filter((function(e){return e.attribute===n.taxonomy})),a=o.length?o[0]:null;if(a&&a.slug&&Array.isArray(a.slug)&&a.slug.includes(c)){var i=a.slug.filter((function(e){return e!==c})),l=e.filter((function(e){return e.attribute!==n.taxonomy}));i.length>0&&(a.slug=i.sort(),l.push(a)),t(Object(r.sortBy)(l,"attribute"))}},o=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){},n=arguments.length>2?arguments[2]:void 0,c=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"in",a=e.filter((function(e){return e.attribute!==n.taxonomy}));0===c.length?t(a):(a.push({attribute:n.taxonomy,operator:o,slug:c.map((function(e){return e.slug})).sort()}),t(Object(r.sortBy)(a,"attribute")))}},28:function(e,t){e.exports=window.wp.primitives},3:function(e,t){e.exports=window.wc.wcSettings},305:function(e,t,n){"use strict";var r=n(9),c=n.n(r),o=n(16),a=n.n(o),i=n(0),l=n(28),s=["className","size"],u=Object(i.createElement)((function(e){var t=e.className,n=e.size,r=a()(e,s);return Object(i.createElement)(l.SVG,c()({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",className:t,width:n,height:n},r),Object(i.createElement)("path",{d:"M14.95 6.46L11.41 10l3.54 3.54-1.41 1.41L10 11.42l-3.53 3.53-1.42-1.42L8.58 10 5.05 6.47l1.42-1.42L10 8.58l3.54-3.53z"}))}),null);t.a=u},34:function(e,t){e.exports=window.wp.isShallowEqual},4:function(e,t){e.exports=window.wp.components},41:function(e,t,n){"use strict";var r=n(5),c=n.n(r),o=n(0),a=n(6),i=n.n(a);function l(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function s(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?l(Object(n),!0).forEach((function(t){c()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):l(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}t.a=function(e){var t,n=e.label,r=e.screenReaderLabel,c=e.wrapperElement,a=e.wrapperProps,l=void 0===a?{}:a,u=null!=n,b=null!=r;return!u&&b?(t=c||"span",l=s(s({},l),{},{className:i()(l.className,"screen-reader-text")}),Object(o.createElement)(t,l,r)):(t=c||o.Fragment,u&&b&&n!==r?Object(o.createElement)(t,l,Object(o.createElement)("span",{"aria-hidden":"true"},n),Object(o.createElement)("span",{className:"screen-reader-text"},r)):Object(o.createElement)(t,l,n))}},47:function(e,t){e.exports=window.wc.priceFormat},62:function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var r=n(0),c=n(34),o=n.n(c);function a(e){var t=Object(r.useRef)(e);return o()(e,t.current)||(t.current=e),t.current}},66:function(e,t,n){"use strict";var r=n(5),c=n.n(r),o=n(16),a=n.n(o),i=n(0),l=["srcElement","size"];function s(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}t.a=function(e){var t=e.srcElement,n=e.size,r=void 0===n?24:n,o=a()(e,l);return Object(i.isValidElement)(t)?Object(i.cloneElement)(t,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?s(Object(n),!0).forEach((function(t){c()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):s(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({width:r,height:r},o)):null}},7:function(e,t){e.exports=window.lodash},78:function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(0),c=Object(r.createContext)("page"),o=function(){return Object(r.useContext)(c)};c.Provider},806:function(e,t,n){e.exports=n(859)},807:function(e,t){},859:function(e,t,n){"use strict";n.r(t);var r=n(9),c=n.n(r),o=n(0),a=n(1),i=n(26),l=n(66),s=n(28),u=Object(o.createElement)(s.SVG,{xmlns:"http://www.w3.org/2000/SVG",viewBox:"0 0 24 24"},Object(o.createElement)("path",{fill:"none",d:"M0 0h24v24H0z"}),Object(o.createElement)("path",{d:"M17 6H7c-3.31 0-6 2.69-6 6s2.69 6 6 6h10c3.31 0 6-2.69 6-6s-2.69-6-6-6zm0 10H7c-2.21 0-4-1.79-4-4s1.79-4 4-4h10c2.21 0 4 1.79 4 4s-1.79 4-4 4zm0-7c-1.66 0-3 1.34-3 3s1.34 3 3 3 3-1.34 3-3-1.34-3-3-3z"})),b=n(6),p=n.n(b),f=n(12),d=n(4),m=n(133),v=n(157),O=n(88),h=n(8),j=n.n(h),g=n(108),w=n(3),y=(n(2),n(41)),_=(n(807),n(278)),E=n(47),k=n(220),x=function(e,t){return Number.isFinite(e)&&Number.isFinite(t)?Object(a.sprintf)(
/* translators: %1$s min price, %2$s max price */
Object(a.__)("Between %1$s and %2$s",'woocommerce'),Object(E.formatPrice)(e),Object(E.formatPrice)(t)):Number.isFinite(e)?Object(a.sprintf)(
/* translators: %s min price */
Object(a.__)("From %s",'woocommerce'),Object(E.formatPrice)(e)):Object(a.sprintf)(
/* translators: %s max price */
Object(a.__)("Up to %s",'woocommerce'),Object(E.formatPrice)(t))},S=function(e){var t=e.type,n=e.name,r=e.prefix,c=e.removeCallback,i=void 0===c?function(){}:c,l=e.showLabel,s=void 0===l||l,u=e.displayStyle,b=r?Object(o.createElement)(o.Fragment,null,r," ",n):n,p=Object(a.sprintf)(
/* translators: %s attribute value used in the filter. For example: yellow, green, small, large. */
Object(a.__)("Remove %s filter",'woocommerce'),n);return Object(o.createElement)("li",{className:"wc-block-active-filters__list-item",key:t+":"+n},s&&Object(o.createElement)("span",{className:"wc-block-active-filters__list-item-type"},t+": "),"chips"===u?Object(o.createElement)(k.a,{element:"span",text:b,onRemove:i,radius:"large",ariaLabel:p}):Object(o.createElement)("span",{className:"wc-block-active-filters__list-item-name"},b,Object(o.createElement)("button",{className:"wc-block-active-filters__list-item-remove",onClick:i},Object(o.createElement)("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Object(o.createElement)("ellipse",{cx:"8",cy:"8",rx:"8",ry:"8",transform:"rotate(-180 8 8)",fill:"currentColor",fillOpacity:"0.7"}),Object(o.createElement)("rect",{x:"10.636",y:"3.94983",width:"2",height:"9.9466",transform:"rotate(45 10.636 3.94983)",fill:"white"}),Object(o.createElement)("rect",{x:"12.0503",y:"11.0209",width:"2",height:"9.9466",transform:"rotate(135 12.0503 11.0209)",fill:"white"})),Object(o.createElement)(y.a,{screenReaderLabel:p}))))},C=n(165),N=n(25),P=n(279),R=function(e){var t=e.attributeObject,n=void 0===t?{}:t,r=e.slugs,c=void 0===r?[]:r,i=e.operator,l=void 0===i?"in":i,s=e.displayStyle,u=Object(C.a)({namespace:"/wc/store",resourceName:"products/attributes/terms",resourceValues:[n.id]}),b=u.results,p=u.isLoading,f=Object(g.b)("attributes",[]),d=j()(f,2),m=d[0],v=d[1];if(p)return null;var O=n.label;return Object(o.createElement)("li",null,Object(o.createElement)("span",{className:"wc-block-active-filters__list-item-type"},O,":"),Object(o.createElement)("ul",null,c.map((function(e,t){var r=b.find((function(t){return t.slug===e}));if(!r)return null;var c="";return t>0&&"and"===l&&(c=Object(o.createElement)("span",{className:"wc-block-active-filters__list-item-operator"},Object(a.__)("and",'woocommerce'))),S({type:O,name:Object(N.decodeEntities)(r.name||e),prefix:c,removeCallback:function(){Object(P.a)(m,v,n,e)},showLabel:!1,displayStyle:s})}))))},L=function(e){var t=e.attributes,n=e.isEditor,r=void 0!==n&&n,c=Object(g.b)("attributes",[]),i=j()(c,2),l=i[0],s=i[1],u=Object(g.b)("stock_status",[]),b=j()(u,2),f=b[0],d=b[1],m=Object(g.b)("min_price"),v=j()(m,2),O=v[0],h=v[1],E=Object(g.b)("max_price"),k=j()(E,2),C=k[0],N=k[1],P=Object(w.getSetting)("stockStatusOptions",[]),L=Object(o.useMemo)((function(){if(f.length>0)return f.map((function(e){return S({type:Object(a.__)("Stock Status",'woocommerce'),name:P[e],removeCallback:function(){var t=f.filter((function(t){return t!==e}));d(t)},displayStyle:t.displayStyle})}))}),[P,f,d,t.displayStyle]),V=Object(o.useMemo)((function(){return Number.isFinite(O)||Number.isFinite(C)?S({type:Object(a.__)("Price",'woocommerce'),name:x(O,C),removeCallback:function(){h(void 0),N(void 0)},displayStyle:t.displayStyle}):null}),[O,C,t.displayStyle,h,N]),H=Object(o.useMemo)((function(){return l.map((function(e){var n=Object(_.b)(e.attribute);return Object(o.createElement)(R,{attributeObject:n,displayStyle:t.displayStyle,slugs:e.slug,key:e.attribute,operator:e.operator})}))}),[l,t.displayStyle]);if(!(l.length>0||f.length>0||Number.isFinite(O)||Number.isFinite(C)||r))return null;var z="h".concat(t.headingLevel),T=p()("wc-block-active-filters__list",{"wc-block-active-filters__list--chips":"chips"===t.displayStyle});return Object(o.createElement)(o.Fragment,null,!r&&t.heading&&Object(o.createElement)(z,{className:"wc-block-active-filters__title"},t.heading),Object(o.createElement)("div",{className:"wc-block-active-filters"},Object(o.createElement)("ul",{className:T},r?Object(o.createElement)(o.Fragment,null,S({type:Object(a.__)("Size",'woocommerce'),name:Object(a.__)("Small",'woocommerce'),displayStyle:t.displayStyle}),S({type:Object(a.__)("Color",'woocommerce'),name:Object(a.__)("Blue",'woocommerce'),displayStyle:t.displayStyle})):Object(o.createElement)(o.Fragment,null,V,L,H)),Object(o.createElement)("button",{className:"wc-block-active-filters__clear-all",onClick:function(){h(void 0),N(void 0),s([]),d([])}},Object(o.createElement)(y.a,{label:Object(a.__)("Clear All",'woocommerce'),screenReaderLabel:Object(a.__)("Clear All Filters",'woocommerce')}))))},V=Object(d.withSpokenMessages)((function(e){var t=e.attributes,n=e.setAttributes,r=t.className,c=t.displayStyle,i=t.heading,l=t.headingLevel;return Object(o.createElement)("div",{className:r},Object(o.createElement)(f.InspectorControls,{key:"inspector"},Object(o.createElement)(d.PanelBody,{title:Object(a.__)("Block Settings",'woocommerce')},Object(o.createElement)(O.a,{label:Object(a.__)("Display Style",'woocommerce'),value:c,options:[{label:Object(a.__)("List",'woocommerce'),value:"list"},{
/* translators: "Chips" is a tag-like display style for chosen attributes. */
label:Object(a.__)("Chips",'woocommerce'),value:"chips"}],onChange:function(e){return n({displayStyle:e})}}),Object(o.createElement)("p",null,Object(a.__)("Heading Level",'woocommerce')),Object(o.createElement)(m.a,{isCollapsed:!1,minLevel:2,maxLevel:7,selectedLevel:l,onChange:function(e){return n({headingLevel:e})}}))),Object(o.createElement)(v.a,{className:"wc-block-active-filters__title",headingLevel:l,heading:i,onChange:function(e){return n({heading:e})}}),Object(o.createElement)(d.Disabled,null,Object(o.createElement)(L,{attributes:t,isEditor:!0})))}));Object(i.registerBlockType)("woocommerce/active-filters",{title:Object(a.__)("Active Product Filters",'woocommerce'),icon:{src:Object(o.createElement)(l.a,{srcElement:u}),foreground:"#96588a"},category:"woocommerce",keywords:[Object(a.__)("WooCommerce",'woocommerce')],description:Object(a.__)("Show the currently active product filters. Works in combination with the All Products and filters blocks.",'woocommerce'),supports:{html:!1,multiple:!1},example:{attributes:{}},attributes:{displayStyle:{type:"string",default:"list"},heading:{type:"string",default:Object(a.__)("Active filters",'woocommerce')},headingLevel:{type:"number",default:3}},edit:V,save:function(e){var t=e.attributes,n=t.className,r={"data-display-style":t.displayStyle,"data-heading":t.heading,"data-heading-level":t.headingLevel};return Object(o.createElement)("div",c()({className:p()("is-loading",n)},r),Object(o.createElement)("span",{"aria-hidden":!0,className:"wc-block-active-product-filters__placeholder"}))}})},88:function(e,t,n){"use strict";var r=n(9),c=n.n(r),o=n(17),a=n.n(o),i=n(18),l=n.n(i),s=n(13),u=n.n(s),b=n(19),p=n.n(b),f=n(20),d=n.n(f),m=n(10),v=n.n(m),O=n(0),h=n(7),j=n(6),g=n.n(j),w=n(4),y=n(21);n(123);var _=function(e){p()(o,e);var t,n,r=(t=o,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=v()(t);if(n){var c=v()(this).constructor;e=Reflect.construct(r,arguments,c)}else e=r.apply(this,arguments);return d()(this,e)});function o(){var e;return a()(this,o),(e=r.apply(this,arguments)).onClick=e.onClick.bind(u()(e)),e}return l()(o,[{key:"onClick",value:function(e){this.props.onChange&&this.props.onChange(e.target.value)}},{key:"render",value:function(){var e,t=this,n=this.props,r=n.label,o=n.checked,a=n.instanceId,i=n.className,l=n.help,s=n.options,u=n.value,b="inspector-toggle-button-control-".concat(a);return l&&(e=Object(h.isFunction)(l)?l(o):l),Object(O.createElement)(w.BaseControl,{id:b,help:e,className:g()("components-toggle-button-control",i)},Object(O.createElement)("label",{id:b+"__label",htmlFor:b,className:"components-toggle-button-control__label"},r),Object(O.createElement)(w.ButtonGroup,{"aria-labelledby":b+"__label"},s.map((function(e,n){var o={};return u===e.value?(o.isPrimary=!0,o["aria-pressed"]=!0):(o.isSecondary=!0,o["aria-pressed"]=!1),Object(O.createElement)(w.Button,c()({key:"".concat(e.label,"-").concat(e.value,"-").concat(n),value:e.value,onClick:t.onClick,"aria-label":r+": "+e.label},o),e.label)}))))}}]),o}(O.Component);t.a=Object(y.withInstanceId)(_)}});woocommerce-blocks/build/product-top-rated.js000064400000065155151335517640015376 0ustar00this.wc=this.wc||{},this.wc.blocks=this.wc.blocks||{},this.wc.blocks["product-top-rated"]=function(e){function t(t){for(var n,i,l=t[0],u=t[1],a=t[2],b=0,d=[];b<l.length;b++)i=l[b],Object.prototype.hasOwnProperty.call(c,i)&&c[i]&&d.push(c[i][0]),c[i]=0;for(n in u)Object.prototype.hasOwnProperty.call(u,n)&&(e[n]=u[n]);for(s&&s(t);d.length;)d.shift()();return o.push.apply(o,a||[]),r()}function r(){for(var e,t=0;t<o.length;t++){for(var r=o[t],n=!0,l=1;l<r.length;l++){var u=r[l];0!==c[u]&&(n=!1)}n&&(o.splice(t--,1),e=i(i.s=r[0]))}return e}var n={},c={35:0},o=[];function i(t){if(n[t])return n[t].exports;var r=n[t]={i:t,l:!1,exports:{}};return e[t].call(r.exports,r,r.exports,i),r.l=!0,r.exports}i.m=e,i.c=n,i.d=function(e,t,r){i.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},i.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.t=function(e,t){if(1&t&&(e=i(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(i.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)i.d(r,n,function(t){return e[t]}.bind(null,n));return r},i.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(t,"a",t),t},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.p="";var l=window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[],u=l.push.bind(l);l.push=t,l=l.slice();for(var a=0;a<l.length;a++)t(l[a]);var s=u;return o.push([765,0]),r()}({0:function(e,t){e.exports=window.wp.element},1:function(e,t){e.exports=window.wp.i18n},107:function(e,t,r){"use strict";r.d(t,"b",(function(){return c}));var n=r(3),c=["woocommerce/product-best-sellers","woocommerce/product-category","woocommerce/product-new","woocommerce/product-on-sale","woocommerce/product-top-rated"];t.a={columns:{type:"number",default:Object(n.getSetting)("default_columns",3)},rows:{type:"number",default:Object(n.getSetting)("default_rows",3)},alignButtons:{type:"boolean",default:!1},categories:{type:"array",default:[]},catOperator:{type:"string",default:"any"},contentVisibility:{type:"object",default:{title:!0,price:!0,rating:!0,button:!0}},isPreview:{type:"boolean",default:!1}}},11:function(e,t){e.exports=window.React},12:function(e,t){e.exports=window.wp.blockEditor},121:function(e,t){},122:function(e,t){e.exports=window.wp.coreData},139:function(e,t){},14:function(e,t){e.exports=window.wp.data},15:function(e,t){e.exports=window.wp.apiFetch},188:function(e,t,r){"use strict";r.d(t,"a",(function(){return c}));var n=r(0),c=Object(n.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 230 250",style:{width:"100%"}},Object(n.createElement)("title",null,"Grid Block Preview"),Object(n.createElement)("rect",{width:"65.374",height:"65.374",x:".162",y:".779",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"47.266",height:"5.148",x:"9.216",y:"76.153",fill:"#E1E3E6",rx:"2.574"}),Object(n.createElement)("rect",{width:"62.8",height:"15",x:"1.565",y:"101.448",fill:"#E1E3E6",rx:"5"}),Object(n.createElement)("rect",{width:"65.374",height:"65.374",x:".162",y:"136.277",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"47.266",height:"5.148",x:"9.216",y:"211.651",fill:"#E1E3E6",rx:"2.574"}),Object(n.createElement)("rect",{width:"62.8",height:"15",x:"1.565",y:"236.946",fill:"#E1E3E6",rx:"5"}),Object(n.createElement)("rect",{width:"65.374",height:"65.374",x:"82.478",y:".779",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"47.266",height:"5.148",x:"91.532",y:"76.153",fill:"#E1E3E6",rx:"2.574"}),Object(n.createElement)("rect",{width:"62.8",height:"15",x:"83.882",y:"101.448",fill:"#E1E3E6",rx:"5"}),Object(n.createElement)("rect",{width:"65.374",height:"65.374",x:"82.478",y:"136.277",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"47.266",height:"5.148",x:"91.532",y:"211.651",fill:"#E1E3E6",rx:"2.574"}),Object(n.createElement)("rect",{width:"62.8",height:"15",x:"83.882",y:"236.946",fill:"#E1E3E6",rx:"5"}),Object(n.createElement)("rect",{width:"65.374",height:"65.374",x:"164.788",y:".779",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"47.266",height:"5.148",x:"173.843",y:"76.153",fill:"#E1E3E6",rx:"2.574"}),Object(n.createElement)("rect",{width:"62.8",height:"15",x:"166.192",y:"101.448",fill:"#E1E3E6",rx:"5"}),Object(n.createElement)("rect",{width:"65.374",height:"65.374",x:"164.788",y:"136.277",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"47.266",height:"5.148",x:"173.843",y:"211.651",fill:"#E1E3E6",rx:"2.574"}),Object(n.createElement)("rect",{width:"62.8",height:"15",x:"166.192",y:"236.946",fill:"#E1E3E6",rx:"5"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"13.283",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"21.498",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"29.713",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"37.927",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"46.238",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"95.599",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"103.814",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"112.029",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"120.243",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"128.554",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"177.909",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"186.124",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"194.339",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"202.553",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"210.864",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"13.283",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"21.498",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"29.713",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"37.927",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"46.238",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"95.599",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"103.814",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"112.029",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"120.243",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"128.554",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"177.909",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"186.124",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"194.339",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"202.553",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"210.864",y:"221.798",fill:"#E1E3E6",rx:"3"}))},21:function(e,t){e.exports=window.wp.compose},22:function(e,t){e.exports=window.regeneratorRuntime},23:function(e,t){e.exports=window.wp.url},25:function(e,t){e.exports=window.wp.htmlEntities},26:function(e,t){e.exports=window.wp.blocks},28:function(e,t){e.exports=window.wp.primitives},3:function(e,t){e.exports=window.wc.wcSettings},31:function(e,t){e.exports=window.moment},36:function(e,t){e.exports=window.wp.dataControls},37:function(e,t,r){"use strict";r.d(t,"o",(function(){return o})),r.d(t,"m",(function(){return i})),r.d(t,"l",(function(){return l})),r.d(t,"n",(function(){return u})),r.d(t,"j",(function(){return a})),r.d(t,"e",(function(){return s})),r.d(t,"f",(function(){return b})),r.d(t,"g",(function(){return d})),r.d(t,"k",(function(){return p})),r.d(t,"c",(function(){return g})),r.d(t,"d",(function(){return f})),r.d(t,"h",(function(){return h})),r.d(t,"a",(function(){return w})),r.d(t,"i",(function(){return O})),r.d(t,"b",(function(){return E}));var n,c=r(3),o=Object(c.getSetting)("wcBlocksConfig",{buildPhase:1,pluginUrl:"",productCount:0,defaultAvatar:"",restApiRoutes:{},wordCountType:"words"}),i=o.pluginUrl+"images/",l=o.pluginUrl+"build/",u=o.buildPhase,a=null===(n=c.STORE_PAGES.shop)||void 0===n?void 0:n.permalink,s=c.STORE_PAGES.checkout.id,b=c.STORE_PAGES.checkout.permalink,d=c.STORE_PAGES.privacy.permalink,p=(c.STORE_PAGES.privacy.title,c.STORE_PAGES.terms.permalink),g=(c.STORE_PAGES.terms.title,c.STORE_PAGES.cart.id),f=c.STORE_PAGES.cart.permalink,h=(c.STORE_PAGES.myaccount.permalink?c.STORE_PAGES.myaccount.permalink:Object(c.getSetting)("wpLoginUrl","/wp-login.php"),Object(c.getSetting)("shippingCountries",{})),w=Object(c.getSetting)("allowedCountries",{}),O=Object(c.getSetting)("shippingStates",{}),E=Object(c.getSetting)("allowedStates",{})},39:function(e,t,r){"use strict";r.d(t,"h",(function(){return p})),r.d(t,"e",(function(){return g})),r.d(t,"b",(function(){return f})),r.d(t,"i",(function(){return h})),r.d(t,"f",(function(){return w})),r.d(t,"c",(function(){return O})),r.d(t,"d",(function(){return E})),r.d(t,"g",(function(){return m})),r.d(t,"a",(function(){return j}));var n=r(5),c=r.n(n),o=r(23),i=r(15),l=r.n(i),u=r(7),a=r(3),s=r(37);function b(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function d(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?b(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):b(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var p=function(e){var t=e.selected,r=void 0===t?[]:t,n=e.search,c=void 0===n?"":n,i=e.queryArgs,a=function(e){var t=e.selected,r=void 0===t?[]:t,n=e.search,c=void 0===n?"":n,i=e.queryArgs,l=void 0===i?{}:i,u=s.o.productCount>100,a={per_page:u?100:0,catalog_visibility:"any",search:c,orderby:"title",order:"asc"},b=[Object(o.addQueryArgs)("/wc/store/products",d(d({},a),l))];return u&&r.length&&b.push(Object(o.addQueryArgs)("/wc/store/products",{catalog_visibility:"any",include:r,per_page:0})),b}({selected:r,search:c,queryArgs:void 0===i?{}:i});return Promise.all(a.map((function(e){return l()({path:e})}))).then((function(e){return Object(u.uniqBy)(Object(u.flatten)(e),"id").map((function(e){return d(d({},e),{},{parent:0})}))})).catch((function(e){throw e}))},g=function(e){return l()({path:"/wc/store/products/".concat(e)})},f=function(){return l()({path:"wc/store/products/attributes"})},h=function(e){return l()({path:"wc/store/products/attributes/".concat(e,"/terms")})},w=function(e){var t=e.selected,r=function(e){var t=e.selected,r=void 0===t?[]:t,n=e.search,c=Object(a.getSetting)("limitTags",!1),i=[Object(o.addQueryArgs)("wc/store/products/tags",{per_page:c?100:0,orderby:c?"count":"name",order:c?"desc":"asc",search:n})];return c&&r.length&&i.push(Object(o.addQueryArgs)("wc/store/products/tags",{include:r})),i}({selected:void 0===t?[]:t,search:e.search});return Promise.all(r.map((function(e){return l()({path:e})}))).then((function(e){return Object(u.uniqBy)(Object(u.flatten)(e),"id")}))},O=function(e){return l()({path:Object(o.addQueryArgs)("wc/store/products/categories",d({per_page:0},e))})},E=function(e){return l()({path:"wc/store/products/categories/".concat(e)})},m=function(e){return l()({path:Object(o.addQueryArgs)("wc/store/products",{per_page:0,type:"variation",parent:e})})},j=function(e,t){if(!e.title.raw)return e.slug;var r=1===t.filter((function(t){return t.title.raw===e.title.raw})).length;return e.title.raw+(r?"":" - ".concat(e.slug))}},4:function(e,t){e.exports=window.wp.components},42:function(e,t,r){"use strict";r.d(t,"a",(function(){return u})),r.d(t,"b",(function(){return a}));var n=r(29),c=r.n(n),o=r(22),i=r.n(o),l=r(1),u=function(){var e=c()(i.a.mark((function e(t){var r;return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("function"!=typeof t.json){e.next=11;break}return e.prev=1,e.next=4,t.json();case 4:return r=e.sent,e.abrupt("return",{message:r.message,type:r.type||"api"});case 8:return e.prev=8,e.t0=e.catch(1),e.abrupt("return",{message:e.t0.message,type:"general"});case 11:return e.abrupt("return",{message:t.message,type:t.type||"general"});case 12:case"end":return e.stop()}}),e,null,[[1,8]])})));return function(_x){return e.apply(this,arguments)}}(),a=function(e){if(e.data&&"rest_invalid_param"===e.code){var t=Object.values(e.data.params);if(t[0])return t[0]}return(null==e?void 0:e.message)||Object(l.__)("Something went wrong. Please contact us to get assistance.",'woocommerce')}},46:function(e,t){e.exports=window.wp.keycodes},48:function(e,t){e.exports=window.wp.escapeHtml},52:function(e,t,r){"use strict";var n=r(0),c=r(1),o=(r(2),r(48));t.a=function(e){var t,r,i,l=e.error;return Object(n.createElement)("div",{className:"wc-block-error-message"},(r=(t=l).message,i=t.type,r?"general"===i?Object(n.createElement)("span",null,Object(c.__)("The following error was returned",'woocommerce'),Object(n.createElement)("br",null),Object(n.createElement)("code",null,Object(o.escapeHTML)(r))):"api"===i?Object(n.createElement)("span",null,Object(c.__)("The following error was returned from the API",'woocommerce'),Object(n.createElement)("br",null),Object(n.createElement)("code",null,Object(o.escapeHTML)(r))):r:Object(c.__)("An unknown error occurred which prevented the block from being updated.",'woocommerce')))}},55:function(e,t){e.exports=window.wp.hooks},56:function(e,t){e.exports=window.wp.deprecated},66:function(e,t,r){"use strict";var n=r(5),c=r.n(n),o=r(16),i=r.n(o),l=r(0),u=["srcElement","size"];function a(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}t.a=function(e){var t=e.srcElement,r=e.size,n=void 0===r?24:r,o=i()(e,u);return Object(l.isValidElement)(t)?Object(l.cloneElement)(t,function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?a(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):a(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({width:n,height:n},o)):null}},7:function(e,t){e.exports=window.lodash},74:function(e,t){e.exports=window.wp.dom},765:function(e,t,r){e.exports=r(871)},84:function(e,t){e.exports=window.wp.serverSideRender},87:function(e,t){e.exports=window.ReactDOM},871:function(e,t,r){"use strict";r.r(t);var n=r(5),c=r.n(n),o=r(0),i=r(1),l=r(26),u=r(66),a=r(28),s=Object(o.createElement)(a.SVG,{xmlns:"http://www.w3.org/2000/SVG",viewBox:"0 0 24 24"},Object(o.createElement)("path",{opacity:".87",fill:"none",d:"M0 0h24v24H0V0z"}),Object(o.createElement)("path",{d:"M21 8h-6.31l.95-4.57.03-.32c0-.41-.17-.79-.44-1.06L14.17 1 7.59 7.59C7.22 7.95 7 8.45 7 9v10c0 1.1.9 2 2 2h9c.83 0 1.54-.5 1.84-1.22l3.02-7.05c.09-.23.14-.47.14-.73v-2c0-1.1-.9-2-2-2zm0 4l-3 7H9V9l4.34-4.34L12.23 10H21v2zM1 9h4v12H1z"})),b=r(7),d=r(17),p=r.n(d),g=r(18),f=r.n(g),h=r(19),w=r.n(h),O=r(20),E=r.n(O),m=r(10),j=r.n(m),y=r(4),v=r(12),x=r(84),_=r.n(x),k=(r(2),r(92)),P=r(93),S=r(97),C=r(188),R=r(3);var A=function(e){w()(c,e);var t,r,n=(t=c,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,n=j()(t);if(r){var c=j()(this).constructor;e=Reflect.construct(n,arguments,c)}else e=n.apply(this,arguments);return E()(this,e)});function c(){return p()(this,c),n.apply(this,arguments)}return f()(c,[{key:"getInspectorControls",value:function(){var e=this.props,t=e.attributes,r=e.setAttributes,n=t.categories,c=t.catOperator,l=t.columns,u=t.contentVisibility,a=t.rows,s=t.alignButtons;return Object(o.createElement)(v.InspectorControls,{key:"inspector"},Object(o.createElement)(y.PanelBody,{title:Object(i.__)("Layout",'woocommerce'),initialOpen:!0},Object(o.createElement)(P.a,{columns:l,rows:a,alignButtons:s,setAttributes:r,minColumns:Object(R.getSetting)("min_columns",1),maxColumns:Object(R.getSetting)("max_columns",6),minRows:Object(R.getSetting)("min_rows",1),maxRows:Object(R.getSetting)("max_rows",6)})),Object(o.createElement)(y.PanelBody,{title:Object(i.__)("Content",'woocommerce'),initialOpen:!0},Object(o.createElement)(k.a,{settings:u,onChange:function(e){return r({contentVisibility:e})}})),Object(o.createElement)(y.PanelBody,{title:Object(i.__)("Filter by Product Category",'woocommerce'),initialOpen:!1},Object(o.createElement)(S.a,{selected:n,onChange:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=e.map((function(e){return e.id}));r({categories:t})},operator:c,onOperatorChange:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"any";return r({catOperator:e})}})))}},{key:"render",value:function(){var e=this.props,t=e.name,r=e.attributes;return r.isPreview?C.a:Object(o.createElement)(o.Fragment,null,this.getInspectorControls(),Object(o.createElement)(y.Disabled,null,Object(o.createElement)(_.a,{block:t,attributes:r})))}}]),c}(o.Component),T=r(107);function B(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}Object(l.registerBlockType)("woocommerce/product-top-rated",{title:Object(i.__)("Top Rated Products",'woocommerce'),icon:{src:Object(o.createElement)(u.a,{srcElement:s}),foreground:"#96588a"},category:"woocommerce",keywords:[Object(i.__)("WooCommerce",'woocommerce')],description:Object(i.__)("Display a grid of your top rated products.",'woocommerce'),supports:{align:["wide","full"],html:!1},example:{attributes:{isPreview:!0}},attributes:function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?B(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):B(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({},T.a),transforms:{from:[{type:"block",blocks:Object(b.without)(T.b,"woocommerce/product-top-rated"),transform:function(e){return Object(l.createBlock)("woocommerce/product-top-rated",e)}}]},edit:function(e){return Object(o.createElement)(A,e)},save:function(){return null}})},89:function(e,t){e.exports=window.wp.viewport},92:function(e,t,r){"use strict";var n=r(5),c=r.n(n),o=r(0),i=r(1),l=(r(2),r(4));function u(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function a(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?u(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):u(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}t.a=function(e){var t=e.onChange,r=e.settings,n=r.button,c=r.price,u=r.rating,s=r.title;return Object(o.createElement)(o.Fragment,null,Object(o.createElement)(l.ToggleControl,{label:Object(i.__)("Product title",'woocommerce'),help:s?Object(i.__)("Product title is visible.",'woocommerce'):Object(i.__)("Product title is hidden.",'woocommerce'),checked:s,onChange:function(){return t(a(a({},r),{},{title:!s}))}}),Object(o.createElement)(l.ToggleControl,{label:Object(i.__)("Product price",'woocommerce'),help:c?Object(i.__)("Product price is visible.",'woocommerce'):Object(i.__)("Product price is hidden.",'woocommerce'),checked:c,onChange:function(){return t(a(a({},r),{},{price:!c}))}}),Object(o.createElement)(l.ToggleControl,{label:Object(i.__)("Product rating",'woocommerce'),help:u?Object(i.__)("Product rating is visible.",'woocommerce'):Object(i.__)("Product rating is hidden.",'woocommerce'),checked:u,onChange:function(){return t(a(a({},r),{},{rating:!u}))}}),Object(o.createElement)(l.ToggleControl,{label:Object(i.__)("Add to Cart button",'woocommerce'),help:n?Object(i.__)("Add to Cart button is visible.",'woocommerce'):Object(i.__)("Add to Cart button is hidden.",'woocommerce'),checked:n,onChange:function(){return t(a(a({},r),{},{button:!n}))}}))}},93:function(e,t,r){"use strict";var n=r(0),c=r(1),o=r(7),i=(r(2),r(4));t.a=function(e){var t=e.columns,r=e.rows,l=e.setAttributes,u=e.alignButtons,a=e.minColumns,s=void 0===a?1:a,b=e.maxColumns,d=void 0===b?6:b,p=e.minRows,g=void 0===p?1:p,f=e.maxRows,h=void 0===f?6:f;return Object(n.createElement)(n.Fragment,null,Object(n.createElement)(i.RangeControl,{label:Object(c.__)("Columns",'woocommerce'),value:t,onChange:function(e){var t=Object(o.clamp)(e,s,d);l({columns:Number.isNaN(t)?"":t})},min:s,max:d}),Object(n.createElement)(i.RangeControl,{label:Object(c.__)("Rows",'woocommerce'),value:r,onChange:function(e){var t=Object(o.clamp)(e,g,h);l({rows:Number.isNaN(t)?"":t})},min:g,max:h}),Object(n.createElement)(i.ToggleControl,{label:Object(c.__)("Align Last Block",'woocommerce'),help:u?Object(c.__)("The last inner block will be aligned vertically.",'woocommerce'):Object(c.__)("The last inner block will follow other content.",'woocommerce'),checked:u,onChange:function(){return l({alignButtons:!u})}}))}},96:function(e,t){e.exports=window.wp.date},97:function(e,t,r){"use strict";var n=r(9),c=r.n(n),o=r(0),i=r(1),l=(r(2),r(49)),u=r(4),a=r(29),s=r.n(a),b=r(17),d=r.n(b),p=r(18),g=r.n(p),f=r(13),h=r.n(f),w=r(19),O=r.n(w),E=r(20),m=r.n(E),j=r(10),y=r.n(j),v=r(22),x=r.n(v),_=r(21),k=r(39),P=r(42);var S=Object(_.createHigherOrderComponent)((function(e){return function(t){O()(l,t);var r,n,i=(r=l,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=y()(r);if(n){var c=y()(this).constructor;e=Reflect.construct(t,arguments,c)}else e=t.apply(this,arguments);return m()(this,e)});function l(){var e;return d()(this,l),(e=i.apply(this,arguments)).state={error:null,loading:!1,categories:[]},e.loadCategories=e.loadCategories.bind(h()(e)),e}return g()(l,[{key:"componentDidMount",value:function(){this.loadCategories()}},{key:"loadCategories",value:function(){var e=this;this.setState({loading:!0}),Object(k.c)().then((function(t){e.setState({categories:t,loading:!1,error:null})})).catch(function(){var t=s()(x.a.mark((function t(r){var n;return x.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,Object(P.a)(r);case 2:n=t.sent,e.setState({categories:[],loading:!1,error:n});case 4:case"end":return t.stop()}}),t)})));return function(_x){return t.apply(this,arguments)}}())}},{key:"render",value:function(){var t=this.state,r=t.error,n=t.loading,i=t.categories;return Object(o.createElement)(e,c()({},this.props,{error:r,isLoading:n,categories:i}))}}]),l}(o.Component)}),"withCategories"),C=r(52),R=r(6),A=r.n(R),T=(r(139),function(e){var t=e.categories,r=e.error,n=e.isLoading,a=e.onChange,s=e.onOperatorChange,b=e.operator,d=e.selected,p=e.isCompact,g=e.isSingle,f=e.showReviewCount,h={clear:Object(i.__)("Clear all product categories",'woocommerce'),list:Object(i.__)("Product Categories",'woocommerce'),noItems:Object(i.__)("Your store doesn't have any product categories.",'woocommerce'),search:Object(i.__)("Search for product categories",'woocommerce'),selected:function(e){return Object(i.sprintf)(
/* translators: %d is the count of selected categories. */
Object(i._n)("%d category selected","%d categories selected",e,'woocommerce'),e)},updated:Object(i.__)("Category search results updated.",'woocommerce')};return r?Object(o.createElement)(C.a,{error:r}):Object(o.createElement)(o.Fragment,null,Object(o.createElement)(l.b,{className:"woocommerce-product-categories",list:t,isLoading:n,selected:d.map((function(e){return t.find((function(t){return t.id===e}))})).filter(Boolean),onChange:a,renderItem:function(e){var t=e.item,r=e.search,n=e.depth,u=void 0===n?0:n,a=t.breadcrumbs.length?"".concat(t.breadcrumbs.join(", "),", ").concat(t.name):t.name,s=f?Object(i.sprintf)(
/* translators: %1$s is the item name, %2$d is the count of reviews for the item. */
Object(i._n)("%1$s, has %2$d review","%1$s, has %2$d reviews",t.review_count,'woocommerce'),a,t.review_count):Object(i.sprintf)(
/* translators: %1$s is the item name, %2$d is the count of products for the item. */
Object(i._n)("%1$s, has %2$d product","%1$s, has %2$d products",t.count,'woocommerce'),a,t.count),b=f?Object(i.sprintf)(
/* translators: %d is the count of reviews. */
Object(i._n)("%d review","%d reviews",t.review_count,'woocommerce'),t.review_count):Object(i.sprintf)(
/* translators: %d is the count of products. */
Object(i._n)("%d product","%d products",t.count,'woocommerce'),t.count);return Object(o.createElement)(l.c,c()({className:A()("woocommerce-product-categories__item","has-count",{"is-searching":r.length>0,"is-skip-level":0===u&&0!==t.parent})},e,{countLabel:b,"aria-label":s}))},messages:h,isCompact:p,isHierarchical:!0,isSingle:g}),!!s&&Object(o.createElement)("div",{hidden:d.length<2},Object(o.createElement)(u.SelectControl,{className:"woocommerce-product-categories__operator",label:Object(i.__)("Display products matching",'woocommerce'),help:Object(i.__)("Pick at least two categories to use this setting.",'woocommerce'),value:b,onChange:s,options:[{label:Object(i.__)("Any selected categories",'woocommerce'),value:"any"},{label:Object(i.__)("All selected categories",'woocommerce'),value:"all"}]})))});T.defaultProps={operator:"any",isCompact:!1,isSingle:!1},t.a=S(T)}});woocommerce-blocks/build/cart-i2.asset.php000064400000001027151335517640014537 0ustar00<?php return array('dependencies' => array('lodash', 'react', 'wc-blocks-checkout', 'wc-blocks-data-store', 'wc-blocks-registry', 'wc-price-format', 'wc-settings', 'wp-a11y', 'wp-api-fetch', 'wp-autop', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-data', 'wp-deprecated', 'wp-dom', 'wp-element', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-is-shallow-equal', 'wp-keycodes', 'wp-plugins', 'wp-polyfill', 'wp-primitives', 'wp-url', 'wp-warning', 'wp-wordcount'), 'version' => 'f7769c5c0091656b829f56c2bd2e6dde');woocommerce-blocks/build/wc-blocks-shared-context.asset.php000064400000000172151335517640020110 0ustar00<?php return array('dependencies' => array('wp-element', 'wp-polyfill'), 'version' => '6c34892f1014ac11188c7caf2b9bee02');woocommerce-blocks/build/wc-blocks-data.asset.php000064400000000327151335517640016073 0ustar00<?php return array('dependencies' => array('lodash', 'wc-settings', 'wp-api-fetch', 'wp-data', 'wp-data-controls', 'wp-i18n', 'wp-notices', 'wp-polyfill', 'wp-url'), 'version' => '87751a409c7fb4247c5af30965b128fd');woocommerce-blocks/build/product-tag.asset.php000064400000000724151335517640015532 0ustar00<?php return array('dependencies' => array('lodash', 'moment', 'react', 'react-dom', 'wc-settings', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-data-controls', 'wp-date', 'wp-deprecated', 'wp-dom', 'wp-element', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-keycodes', 'wp-polyfill', 'wp-primitives', 'wp-server-side-render', 'wp-url', 'wp-viewport'), 'version' => 'd367d305f86f9373602d571c30bc55ed');woocommerce-blocks/build/all-products.js000064400000464104151335517640014427 0ustar00this.wc=this.wc||{},this.wc.blocks=this.wc.blocks||{},this.wc.blocks["all-products"]=function(e){function t(t){for(var n,a,i=t[0],s=t[1],u=t[2],b=0,p=[];b<i.length;b++)a=i[b],Object.prototype.hasOwnProperty.call(c,a)&&c[a]&&p.push(c[a][0]),c[a]=0;for(n in s)Object.prototype.hasOwnProperty.call(s,n)&&(e[n]=s[n]);for(l&&l(t);p.length;)p.shift()();return o.push.apply(o,u||[]),r()}function r(){for(var e,t=0;t<o.length;t++){for(var r=o[t],n=!0,i=1;i<r.length;i++){var s=r[i];0!==c[s]&&(n=!1)}n&&(o.splice(t--,1),e=a(a.s=r[0]))}return e}var n={},c={6:0,1:0,3:0,4:0,9:0,10:0,12:0,13:0,14:0,15:0,16:0,17:0},o=[];function a(t){if(n[t])return n[t].exports;var r=n[t]={i:t,l:!1,exports:{}};return e[t].call(r.exports,r,r.exports,a),r.l=!0,r.exports}a.e=function(e){var t=[],r=c[e];if(0!==r)if(r)t.push(r[2]);else{var n=new Promise((function(t,n){r=c[e]=[t,n]}));t.push(r[2]=n);var o,i=document.createElement("script");i.charset="utf-8",i.timeout=120,a.nc&&i.setAttribute("nonce",a.nc),i.src=function(e){return a.p+""+({1:"atomic-block-components/add-to-cart--atomic-block-components/button--atomic-block-components/image---a7e2bb9b",2:"atomic-block-components/add-to-cart--atomic-block-components/image--atomic-block-components/title",3:"atomic-block-components/add-to-cart--atomic-block-components/button",4:"atomic-block-components/sale-badge",8:"atomic-block-components/add-to-cart",9:"atomic-block-components/button",10:"atomic-block-components/category-list",11:"atomic-block-components/image",12:"atomic-block-components/price",13:"atomic-block-components/rating",14:"atomic-block-components/sku",15:"atomic-block-components/stock-indicator",16:"atomic-block-components/summary",17:"atomic-block-components/tag-list",18:"atomic-block-components/title"}[e]||e)+".js"}(e);var s=new Error;o=function(t){i.onerror=i.onload=null,clearTimeout(u);var r=c[e];if(0!==r){if(r){var n=t&&("load"===t.type?"missing":t.type),o=t&&t.target&&t.target.src;s.message="Loading chunk "+e+" failed.\n("+n+": "+o+")",s.name="ChunkLoadError",s.type=n,s.request=o,r[1](s)}c[e]=void 0}};var u=setTimeout((function(){o({type:"timeout",target:i})}),12e4);i.onerror=i.onload=o,document.head.appendChild(i)}return Promise.all(t)},a.m=e,a.c=n,a.d=function(e,t,r){a.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},a.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},a.t=function(e,t){if(1&t&&(e=a(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(a.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)a.d(r,n,function(t){return e[t]}.bind(null,n));return r},a.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return a.d(t,"a",t),t},a.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},a.p="",a.oe=function(e){throw console.error(e),e};var i=window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[],s=i.push.bind(i);i.push=t,i=i.slice();for(var u=0;u<i.length;u++)t(i[u]);var l=s;return o.push([785,0]),r()}({0:function(e,t){e.exports=window.wp.element},1:function(e,t){e.exports=window.wp.i18n},108:function(e,t,r){"use strict";r.d(t,"a",(function(){return d})),r.d(t,"b",(function(){return f})),r.d(t,"c",(function(){return m}));var n=r(8),c=r.n(n),o=r(24),a=r(14),i=r(0),s=r(34),u=r.n(s),l=r(62),b=r(136),p=r(78),d=function(e){var t=Object(p.a)();e=e||t;var r=Object(a.useSelect)((function(t){return t(o.QUERY_STATE_STORE_KEY).getValueForQueryContext(e,void 0)}),[e]),n=Object(a.useDispatch)(o.QUERY_STATE_STORE_KEY).setValueForQueryContext;return[r,Object(i.useCallback)((function(t){n(e,t)}),[e,n])]},f=function(e,t,r){var n=Object(p.a)();r=r||n;var c=Object(a.useSelect)((function(n){return n(o.QUERY_STATE_STORE_KEY).getValueForQueryKey(r,e,t)}),[r,e]),s=Object(a.useDispatch)(o.QUERY_STATE_STORE_KEY).setQueryValue;return[c,Object(i.useCallback)((function(t){s(r,e,t)}),[r,e,s])]},m=function(e,t){var r=Object(p.a)(),n=d(t=t||r),o=c()(n,2),a=o[0],s=o[1],f=Object(l.a)(a),m=Object(l.a)(e),O=Object(b.a)(m),g=Object(i.useRef)(!1);return Object(i.useEffect)((function(){u()(O,m)||(s(Object.assign({},f,m)),g.current=!0)}),[f,m,O,s]),g.current?[a,s]:[e,s]}},11:function(e,t){e.exports=window.React},113:function(e,t,r){"use strict";var n=r(5),c=r.n(n),o=r(8),a=r.n(o),i=r(3),s=r(1),u=r(72);function l(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function b(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?l(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):l(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var p=Object(i.getSetting)("countryLocale",{}),d=function(e){var t={};return void 0!==e.label&&(t.label=e.label),void 0!==e.required&&(t.required=e.required),void 0!==e.hidden&&(t.hidden=e.hidden),void 0===e.label||e.optionalLabel||(t.optionalLabel=Object(s.sprintf)(
/* translators: %s Field label. */
Object(s.__)("%s (optional)",'woocommerce'),e.label)),e.priority&&(Object(u.a)(e.priority)&&(t.index=e.priority),Object(u.c)(e.priority)&&(t.index=parseInt(e.priority,10))),e.hidden&&(t.required=!1),t},f=Object.entries(p).map((function(e){var t=a()(e,2),r=t[0],n=t[1];return[r,Object.entries(n).map((function(e){var t=a()(e,2),r=t[0],n=t[1];return[r,d(n)]})).reduce((function(e,t){var r=a()(t,2),n=r[0],c=r[1];return e[n]=c,e}),{})]})).reduce((function(e,t){var r=a()(t,2),n=r[0],c=r[1];return e[n]=c,e}),{});t.a=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",n=r&&void 0!==f[r]?f[r]:{};return e.map((function(e){var r=i.defaultAddressFields[e]||{},c=n[e]||{},o=t[e]||{};return b(b(b({key:e},r),c),o)})).sort((function(e,t){return e.index-t.index}))}},114:function(e,t,r){"use strict";var n=r(0);r(209),t.a=function(){return Object(n.createElement)("span",{className:"wc-block-components-spinner","aria-hidden":"true"})}},119:function(e,t){e.exports=window.wp.wordcount},12:function(e,t){e.exports=window.wp.blockEditor},121:function(e,t){},122:function(e,t){e.exports=window.wp.coreData},123:function(e,t){},124:function(e,t,r){"use strict";var n=r(5),c=r.n(n),o=r(0),a=r(1),i=r(53),s=r(6),u=r.n(s),l=(r(2),r(47)),b=(r(206),function(e){var t=e.currency,r=e.maxPrice,n=e.minPrice,c=e.priceClassName,s=e.priceStyle;return Object(o.createElement)(o.Fragment,null,Object(o.createElement)("span",{className:"screen-reader-text"},Object(a.sprintf)(
/* translators: %1$s min price, %2$s max price */
Object(a.__)("Price between %1$s and %2$s",'woocommerce'),Object(l.formatPrice)(n),Object(l.formatPrice)(r))),Object(o.createElement)("span",{"aria-hidden":!0},Object(o.createElement)(i.a,{className:u()("wc-block-components-product-price__value",c),currency:t,value:n,style:s})," — ",Object(o.createElement)(i.a,{className:u()("wc-block-components-product-price__value",c),currency:t,value:r,style:s})))}),p=function(e){var t=e.currency,r=e.regularPriceClassName,n=e.regularPriceStyle,c=e.regularPrice,s=e.priceClassName,l=e.priceStyle,b=e.price;return Object(o.createElement)(o.Fragment,null,Object(o.createElement)("span",{className:"screen-reader-text"},Object(a.__)("Previous price:",'woocommerce')),Object(o.createElement)(i.a,{currency:t,renderText:function(e){return Object(o.createElement)("del",{className:u()("wc-block-components-product-price__regular",r),style:n},e)},value:c}),Object(o.createElement)("span",{className:"screen-reader-text"},Object(a.__)("Discounted price:",'woocommerce')),Object(o.createElement)(i.a,{currency:t,renderText:function(e){return Object(o.createElement)("ins",{className:u()("wc-block-components-product-price__value","is-discounted",s),style:l},e)},value:b}))};t.a=function(e){var t=e.align,r=e.className,n=e.currency,a=e.format,s=void 0===a?"<price/>":a,l=e.maxPrice,d=void 0===l?null:l,f=e.minPrice,m=void 0===f?null:f,O=e.price,g=void 0===O?null:O,j=e.priceClassName,h=e.priceStyle,v=e.regularPrice,w=e.regularPriceClassName,y=e.regularPriceStyle,E=u()(r,"price","wc-block-components-product-price",c()({},"wc-block-components-product-price--align-".concat(t),t));s.includes("<price/>")||(s="<price/>",console.error("Price formats need to include the `<price/>` tag."));var _=v&&g!==v,k=Object(o.createElement)("span",{className:u()("wc-block-components-product-price__value",j)});return _?k=Object(o.createElement)(p,{currency:n,price:g,priceClassName:j,priceStyle:h,regularPrice:v,regularPriceClassName:w,regularPriceStyle:y}):null!==m&&null!==d?k=Object(o.createElement)(b,{currency:n,maxPrice:d,minPrice:m,priceClassName:j,priceStyle:h}):null!==g&&(k=Object(o.createElement)(i.a,{className:u()("wc-block-components-product-price__value",j),currency:n,value:g,style:h})),Object(o.createElement)("span",{className:E},Object(o.createInterpolateElement)(s,{price:k}))}},126:function(e,t,r){"use strict";r.d(t,"a",(function(){return u})),r.d(t,"b",(function(){return b}));var n,c=r(5),o=r.n(c),a=r(7);function i(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function s(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?i(Object(r),!0).forEach((function(t){o()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):i(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}!function(e){e.ADD_EVENT_CALLBACK="add_event_callback",e.REMOVE_EVENT_CALLBACK="remove_event_callback"}(n||(n={}));var u={addEventCallback:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:10;return{id:Object(a.uniqueId)(),type:n.ADD_EVENT_CALLBACK,eventType:e,callback:t,priority:r}},removeEventCallback:function(e,t){return{id:t,type:n.REMOVE_EVENT_CALLBACK,eventType:e}}},l={},b=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:l,t=arguments.length>1?arguments[1]:void 0,r=t.type,c=t.eventType,a=t.id,i=t.callback,u=t.priority,b=e.hasOwnProperty(c)?new Map(e[c]):new Map;switch(r){case n.ADD_EVENT_CALLBACK:return b.set(a,{priority:u,callback:i}),s(s({},e),{},o()({},c,b));case n.REMOVE_EVENT_CALLBACK:return b.delete(a),s(s({},e),{},o()({},c,b))}}},127:function(e,t,r){"use strict";r.d(t,"a",(function(){return a}));var n=r(8),c=r.n(n),o=r(0),a=function(){var e=Object(o.useState)(),t=c()(e,2)[1];return Object(o.useCallback)((function(e){t((function(){throw e}))}),[])}},131:function(e,t,r){"use strict";var n=r(9),c=r.n(n),o=r(16),a=r.n(o),i=r(0),s=r(49),u=r(4),l=r(6),b=r.n(l),p=["className","item","isSelected","isLoading","onSelect","disabled"];t.a=function(e){var t=e.className,r=e.item,n=e.isSelected,o=e.isLoading,l=e.onSelect,d=e.disabled,f=a()(e,p);return Object(i.createElement)(i.Fragment,null,Object(i.createElement)(s.c,c()({},f,{key:r.id,className:t,isSelected:n,item:r,onSelect:l,isSingle:!0,disabled:d})),n&&o&&Object(i.createElement)("div",{key:"loading",className:b()("woocommerce-search-list__item","woocommerce-product-attributes__item","depth-1","is-loading","is-not-active")},Object(i.createElement)(u.Spinner,null)))}},132:function(e,t,r){"use strict";r.d(t,"b",(function(){return h})),r.d(t,"a",(function(){return v}));var n=r(38),c=r.n(n),o=r(5),a=r.n(o),i=r(16),s=r.n(i),u=r(8),l=r.n(u),b=r(0),p=r(7),d=r(34),f=r.n(d);function m(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function O(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?m(Object(r),!0).forEach((function(t){a()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):m(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function g(e){var t=function(e,t){if("object"!==c()(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!==c()(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===c()(t)?t:String(t)}var j=Object(b.createContext)({getValidationError:function(){return""},setValidationErrors:function(e){},clearValidationError:function(e){},clearAllValidationErrors:function(){},hideValidationError:function(){},showValidationError:function(){},showAllValidationErrors:function(){},hasValidationErrors:!1,getValidationErrorId:function(e){return e}}),h=function(){return Object(b.useContext)(j)},v=function(e){var t=e.children,r=Object(b.useState)({}),n=l()(r,2),c=n[0],o=n[1],i=Object(b.useCallback)((function(e){return c[e]}),[c]),u=Object(b.useCallback)((function(e){var t=c[e];return!t||t.hidden?"":"validate-error-".concat(e)}),[c]),d=Object(b.useCallback)((function(e){o((function(t){return t[e]?(t[e],s()(t,[e].map(g))):t}))}),[]),m=Object(b.useCallback)((function(){o({})}),[]),h=Object(b.useCallback)((function(e){e&&o((function(t){return e=Object(p.pickBy)(e,(function(e,r){return!("string"!=typeof e.message||t.hasOwnProperty(r)&&f()(t[r],e))})),0===Object.values(e).length?t:O(O({},t),e)}))}),[]),v=Object(b.useCallback)((function(e,t){o((function(r){if(!r.hasOwnProperty(e))return r;var n=O(O({},r[e]),t);return f()(r[e],n)?r:O(O({},r),{},a()({},e,n))}))}),[]),w={getValidationError:i,setValidationErrors:h,clearValidationError:d,clearAllValidationErrors:m,hideValidationError:Object(b.useCallback)((function(e){v(e,{hidden:!0})}),[v]),showValidationError:Object(b.useCallback)((function(e){v(e,{hidden:!1})}),[v]),showAllValidationErrors:Object(b.useCallback)((function(){o((function(e){var t={};return Object.keys(e).forEach((function(r){e[r].hidden&&(t[r]=O(O({},e[r]),{},{hidden:!1}))})),0===Object.values(t).length?e:O(O({},e),t)}))}),[]),hasValidationErrors:Object.keys(c).length>0,getValidationErrorId:u};return Object(b.createElement)(j.Provider,{value:w},t)}},133:function(e,t,r){"use strict";var n=r(17),c=r.n(n),o=r(18),a=r.n(o),i=r(19),s=r.n(i),u=r(20),l=r.n(u),b=r(10),p=r.n(b),d=r(0),f=r(7),m=r(1),O=r(4);function g(e){var t=e.level,r={1:"M9 5h2v10H9v-4H5v4H3V5h2v4h4V5zm6.6 0c-.6.9-1.5 1.7-2.6 2v1h2v7h2V5h-1.4z",2:"M7 5h2v10H7v-4H3v4H1V5h2v4h4V5zm8 8c.5-.4.6-.6 1.1-1.1.4-.4.8-.8 1.2-1.3.3-.4.6-.8.9-1.3.2-.4.3-.8.3-1.3 0-.4-.1-.9-.3-1.3-.2-.4-.4-.7-.8-1-.3-.3-.7-.5-1.2-.6-.5-.2-1-.2-1.5-.2-.4 0-.7 0-1.1.1-.3.1-.7.2-1 .3-.3.1-.6.3-.9.5-.3.2-.6.4-.8.7l1.2 1.2c.3-.3.6-.5 1-.7.4-.2.7-.3 1.2-.3s.9.1 1.3.4c.3.3.5.7.5 1.1 0 .4-.1.8-.4 1.1-.3.5-.6.9-1 1.2-.4.4-1 .9-1.6 1.4-.6.5-1.4 1.1-2.2 1.6V15h8v-2H15z",3:"M12.1 12.2c.4.3.8.5 1.2.7.4.2.9.3 1.4.3.5 0 1-.1 1.4-.3.3-.1.5-.5.5-.8 0-.2 0-.4-.1-.6-.1-.2-.3-.3-.5-.4-.3-.1-.7-.2-1-.3-.5-.1-1-.1-1.5-.1V9.1c.7.1 1.5-.1 2.2-.4.4-.2.6-.5.6-.9 0-.3-.1-.6-.4-.8-.3-.2-.7-.3-1.1-.3-.4 0-.8.1-1.1.3-.4.2-.7.4-1.1.6l-1.2-1.4c.5-.4 1.1-.7 1.6-.9.5-.2 1.2-.3 1.8-.3.5 0 1 .1 1.6.2.4.1.8.3 1.2.5.3.2.6.5.8.8.2.3.3.7.3 1.1 0 .5-.2.9-.5 1.3-.4.4-.9.7-1.5.9v.1c.6.1 1.2.4 1.6.8.4.4.7.9.7 1.5 0 .4-.1.8-.3 1.2-.2.4-.5.7-.9.9-.4.3-.9.4-1.3.5-.5.1-1 .2-1.6.2-.8 0-1.6-.1-2.3-.4-.6-.2-1.1-.6-1.6-1l1.1-1.4zM7 9H3V5H1v10h2v-4h4v4h2V5H7v4z",4:"M9 15H7v-4H3v4H1V5h2v4h4V5h2v10zm10-2h-1v2h-2v-2h-5v-2l4-6h3v6h1v2zm-3-2V7l-2.8 4H16z",5:"M12.1 12.2c.4.3.7.5 1.1.7.4.2.9.3 1.3.3.5 0 1-.1 1.4-.4.4-.3.6-.7.6-1.1 0-.4-.2-.9-.6-1.1-.4-.3-.9-.4-1.4-.4H14c-.1 0-.3 0-.4.1l-.4.1-.5.2-1-.6.3-5h6.4v1.9h-4.3L14 8.8c.2-.1.5-.1.7-.2.2 0 .5-.1.7-.1.5 0 .9.1 1.4.2.4.1.8.3 1.1.6.3.2.6.6.8.9.2.4.3.9.3 1.4 0 .5-.1 1-.3 1.4-.2.4-.5.8-.9 1.1-.4.3-.8.5-1.3.7-.5.2-1 .3-1.5.3-.8 0-1.6-.1-2.3-.4-.6-.2-1.1-.6-1.6-1-.1-.1 1-1.5 1-1.5zM9 15H7v-4H3v4H1V5h2v4h4V5h2v10z",6:"M9 15H7v-4H3v4H1V5h2v4h4V5h2v10zm8.6-7.5c-.2-.2-.5-.4-.8-.5-.6-.2-1.3-.2-1.9 0-.3.1-.6.3-.8.5l-.6.9c-.2.5-.2.9-.2 1.4.4-.3.8-.6 1.2-.8.4-.2.8-.3 1.3-.3.4 0 .8 0 1.2.2.4.1.7.3 1 .6.3.3.5.6.7.9.2.4.3.8.3 1.3s-.1.9-.3 1.4c-.2.4-.5.7-.8 1-.4.3-.8.5-1.2.6-1 .3-2 .3-3 0-.5-.2-1-.5-1.4-.9-.4-.4-.8-.9-1-1.5-.2-.6-.3-1.3-.3-2.1s.1-1.6.4-2.3c.2-.6.6-1.2 1-1.6.4-.4.9-.7 1.4-.9.6-.3 1.1-.4 1.7-.4.7 0 1.4.1 2 .3.5.2 1 .5 1.4.8 0 .1-1.3 1.4-1.3 1.4zm-2.4 5.8c.2 0 .4 0 .6-.1.2 0 .4-.1.5-.2.1-.1.3-.3.4-.5.1-.2.1-.5.1-.7 0-.4-.1-.8-.4-1.1-.3-.2-.7-.3-1.1-.3-.3 0-.7.1-1 .2-.4.2-.7.4-1 .7 0 .3.1.7.3 1 .1.2.3.4.4.6.2.1.3.3.5.3.2.1.5.2.7.1z"};return r.hasOwnProperty(t)?Object(d.createElement)(O.SVG,{width:"20",height:"20",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"},Object(d.createElement)(O.Path,{d:r[t]})):null}var j=function(e){s()(o,e);var t,r,n=(t=o,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,n=p()(t);if(r){var c=p()(this).constructor;e=Reflect.construct(n,arguments,c)}else e=n.apply(this,arguments);return l()(this,e)});function o(){return c()(this,o),n.apply(this,arguments)}return a()(o,[{key:"createLevelControl",value:function(e,t,r){var n=e===t;return{icon:Object(d.createElement)(g,{level:e}),
/* translators: %s: heading level e.g: "2", "3", "4" */
title:Object(m.sprintf)(Object(m.__)("Heading %d"),e),isActive:n,onClick:function(){return r(e)}}}},{key:"render",value:function(){var e=this,t=this.props,r=t.isCollapsed,n=void 0===r||r,c=t.minLevel,o=t.maxLevel,a=t.selectedLevel,i=t.onChange;return Object(d.createElement)(O.ToolbarGroup,{isCollapsed:n,icon:Object(d.createElement)(g,{level:a}),controls:Object(f.range)(c,o).map((function(t){return e.createLevelControl(t,a,i)}))})}}]),o}(d.Component);t.a=j},136:function(e,t,r){"use strict";r.d(t,"a",(function(){return c}));var n=r(11);function c(e,t){var r=Object(n.useRef)();return Object(n.useEffect)((function(){r.current===e||t&&!t(e,r.current)||(r.current=e)}),[e,t]),r.current}},14:function(e,t){e.exports=window.wp.data},141:function(e,t,r){"use strict";r.d(t,"b",(function(){return w})),r.d(t,"a",(function(){return y}));var n=r(5),c=r.n(n),o=r(8),a=r.n(o),i=r(0),s=(r(2),r(14)),u=r(68),l=r(63),b=r(9),p=r.n(b),d=r(6),f=r.n(d),m=r(890),O=(r(207),function(e){var t=e.status;switch(void 0===t?"default":t){case"error":return"woocommerce-error";case"success":return"woocommerce-message";case"info":case"warning":return"woocommerce-info"}return""}),g=function(e){var t=e.className,r=e.notices,n=e.removeNotice,c=r.filter((function(e){return"snackbar"!==e.type}));if(!c.length)return null;var o=f()(t,"wc-block-components-notices");return Object(i.createElement)("div",{className:o},c.map((function(e){return Object(i.createElement)(m.a,p()({key:"store-notice-"+e.id},e,{className:f()("wc-block-components-notices__notice",O(e)),onRemove:function(){e.isDismissible&&n(e.id)}}),e.content)})))};function j(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function h(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?j(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):j(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var v=Object(i.createContext)({notices:[],createNotice:function(e,t,r){},removeNotice:function(e,t){},setIsSuppressed:function(e){},context:"wc/core"}),w=function(){return Object(i.useContext)(v)},y=function(e){var t=e.children,r=e.className,n=void 0===r?"":r,c=e.createNoticeContainer,o=void 0===c||c,b=e.context,p=void 0===b?"wc/core":b,d=Object(s.useDispatch)("core/notices"),f=d.createNotice,m=d.removeNotice,O=Object(i.useState)(!1),j=a()(O,2),w=j[0],y=j[1],E=Object(u.a)().dispatchStoreEvent,_=Object(l.b)().isEditor,k=Object(i.useCallback)((function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};f(e,t,h(h({},r),{},{context:r.context||p})),E("store-notice-create",{status:e,content:t,options:r})}),[f,E,p]),P=Object(i.useCallback)((function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:p;m(e,t)}),[m,p]),C={notices:Object(s.useSelect)((function(e){return{notices:e("core/notices").getNotices(p)}}),[p]).notices,createNotice:k,removeNotice:P,context:p,setIsSuppressed:y},S=w?null:Object(i.createElement)(g,{className:n,notices:C.notices,removeNotice:C.removeNotice,isEditor:_});return Object(i.createElement)(v.Provider,{value:C},o&&S,t)}},142:function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));var n=r(8),c=r.n(n),o=function(e){return e.reduce((function(e,t){var r=c()(t,2),n=r[0],o=r[1];return e[n]=o,e}),{})}},143:function(e,t,r){"use strict";var n=r(0),c=r(1),o=r(66),a=r(158),i=r(3),s=r(12),u=r(45);t.a=function(e){var t=(Object(u.useProductDataContext)().product||{}).id||e.productId||0;return t?Object(n.createElement)(s.InspectorControls,null,Object(n.createElement)("div",{className:"wc-block-single-product__edit-card"},Object(n.createElement)("div",{className:"wc-block-single-product__edit-card-title"},Object(n.createElement)("a",{href:"".concat(i.ADMIN_URL,"post.php?post=").concat(t,"&action=edit"),target:"_blank",rel:"noopener noreferrer"},Object(c.__)("Edit this product's details",'woocommerce'),Object(n.createElement)(o.a,{srcElement:a.a,size:16}))),Object(n.createElement)("div",{className:"wc-block-single-product__edit-card-description"},Object(c.__)("Edit details such as title, price, description and more.",'woocommerce')))):null}},149:function(e,t,r){"use strict";var n=r(33),c=r.n(n),o=r(5),a=r.n(o),i=r(9),s=r.n(i),u=r(0),l=r(1),b=r(7),p=(r(2),r(49)),d=r(21),f=r(17),m=r.n(f),O=r(18),g=r.n(O),j=r(19),h=r.n(j),v=r(20),w=r.n(v),y=r(10),E=r.n(y);var _=Object(d.createHigherOrderComponent)((function(e){var t=function(t){h()(o,t);var r,n,c=(r=o,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=E()(r);if(n){var c=E()(this).constructor;e=Reflect.construct(t,arguments,c)}else e=t.apply(this,arguments);return w()(this,e)});function o(){return m()(this,o),c.apply(this,arguments)}return g()(o,[{key:"render",value:function(){var t=this.props.selected,r=null==t;return Object(u.createElement)(e,s()({},this.props,{selected:r?[]:[t]}))}}]),o}(u.Component);return t.defaultProps={selected:null},t}),"withTransformSingleSelectToMultipleSelect"),k=r(302),P=r(29),C=r.n(P),S=r(13),x=r.n(S),N=r(22),D=r.n(N),B=r(34),R=r.n(B),T=r(39),A=r(42);function I(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function L(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?I(Object(r),!0).forEach((function(t){a()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):I(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var z=Object(d.createHigherOrderComponent)((function(e){var t=function(t){h()(o,t);var r,n,c=(r=o,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=E()(r);if(n){var c=E()(this).constructor;e=Reflect.construct(t,arguments,c)}else e=t.apply(this,arguments);return w()(this,e)});function o(){var e;m()(this,o);for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return e=c.call.apply(c,[this].concat(r)),a()(x()(e),"state",{error:null,loading:!1,variations:{}}),a()(x()(e),"loadVariations",(function(){var t=e.props.products,r=e.state,n=r.loading,c=r.variations;if(!n){var o=e.getExpandedProduct();if(o&&!c[o]){var i=t.find((function(e){return e.id===o}));i.variations&&0!==i.variations.length?(e.setState({loading:!0}),Object(T.g)(o).then((function(t){var r=t.map((function(e){return L(L({},e),{},{parent:o})}));e.setState({variations:L(L({},e.state.variations),{},a()({},o,r)),loading:!1,error:null})})).catch(function(){var t=C()(D.a.mark((function t(r){var n;return D.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,Object(A.a)(r);case 2:n=t.sent,e.setState({variations:L(L({},e.state.variations),{},a()({},o,null)),loading:!1,error:n});case 4:case"end":return t.stop()}}),t)})));return function(_x){return t.apply(this,arguments)}}())):e.setState({variations:L(L({},e.state.variations),{},a()({},o,null)),loading:!1,error:null})}}})),e}return g()(o,[{key:"componentDidMount",value:function(){var e=this.props,t=e.selected,r=e.showVariations;t&&r&&this.loadVariations()}},{key:"componentDidUpdate",value:function(e){var t=this.props,r=t.isLoading,n=t.selected;t.showVariations&&(!R()(e.selected,n)||e.isLoading&&!r)&&this.loadVariations()}},{key:"isProductId",value:function(e){return this.props.products.some((function(t){return t.id===e}))}},{key:"findParentProduct",value:function(e){return this.props.products.filter((function(t){return t.variations&&t.variations.find((function(t){return t.id===e}))}))[0].id}},{key:"getExpandedProduct",value:function(){var e=this.props,t=e.isLoading,r=e.selected;if(!e.showVariations)return null;var n=r&&r.length?r[0]:null;return n?this.prevSelectedItem=n:this.prevSelectedItem&&(t||this.isProductId(this.prevSelectedItem)||(n=this.prevSelectedItem)),!t&&n?this.isProductId(n)?n:this.findParentProduct(n):null}},{key:"render",value:function(){var t=this.props,r=t.error,n=t.isLoading,c=this.state,o=c.error,a=c.loading,i=c.variations;return Object(u.createElement)(e,s()({},this.props,{error:o||r,expandedProduct:this.getExpandedProduct(),isLoading:n,variations:i,variationsLoading:a}))}}]),o}(u.Component);return a()(t,"defaultProps",{selected:[],showVariations:!1}),t}),"withProductVariations"),V=r(52),F=r(6),M=r.n(F),H=r(131);function q(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function G(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?q(Object(r),!0).forEach((function(t){a()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):q(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}r(214);var Q={list:Object(l.__)("Products",'woocommerce'),noItems:Object(l.__)("Your store doesn't have any products.",'woocommerce'),search:Object(l.__)("Search for a product to display",'woocommerce'),updated:Object(l.__)("Product search results updated.",'woocommerce')},Y=function(e){var t=e.expandedProduct,r=e.error,n=e.instanceId,o=e.isCompact,a=e.isLoading,i=e.onChange,d=e.onSearch,f=e.products,m=e.renderItem,O=e.selected,g=e.showVariations,j=e.variations,h=e.variationsLoading;if(r)return Object(u.createElement)(V.a,{error:r});var v=j&&j[t]?j[t]:[],w=[].concat(c()(f),c()(v));return Object(u.createElement)(p.b,{className:"woocommerce-products",list:w,isCompact:o,isLoading:a,isSingle:!0,selected:w.filter((function(e){var t=e.id;return O.includes(t)})),onChange:i,renderItem:m||(g?function(e){var t=e.item,r=e.search,c=e.depth,o=void 0===c?0:c,i=e.isSelected,d=e.onSelect,f=t.variations&&Array.isArray(t.variations)?t.variations.length:0,m=M()("woocommerce-search-product__item","woocommerce-search-list__item","depth-".concat(o),"has-count",{"is-searching":r.length>0,"is-skip-level":0===o&&0!==t.parent,"is-variable":f>0});if(!t.breadcrumbs.length)return Object(u.createElement)(H.a,s()({},e,{className:M()(m,{"is-selected":i}),isSelected:i,item:t,onSelect:function(){return function(){d(t)()}},isLoading:a||h,countLabel:t.variations.length>0?Object(l.sprintf)(
/* translators: %1$d is the number of variations of a product product. */
Object(l.__)("%1$d variations",'woocommerce'),t.variations.length):null,name:"products-".concat(n),"aria-label":Object(l.sprintf)(
/* translators: %1$s is the product name, %2$d is the number of variations of that product. */
Object(l._n)("%1$s, has %2$d variation","%1$s, has %2$d variations",t.variations.length,'woocommerce'),t.name,t.variations.length)}));var O=Object(b.isEmpty)(t.variation)?e:G(G({},e),{},{item:G(G({},e.item),{},{name:t.variation}),"aria-label":"".concat(t.breadcrumbs[0],": ").concat(t.variation)});return Object(u.createElement)(p.c,s()({},O,{className:m,name:"variations-".concat(n)}))}:null),onSearch:d,messages:Q,isHierarchical:!0})};Y.defaultProps={isCompact:!1,expandedProduct:null,selected:[],showVariations:!1},t.a=_(Object(k.a)(z(Object(d.withInstanceId)(Y))))},15:function(e,t){e.exports=window.wp.apiFetch},150:function(e,t,r){"use strict";var n=r(0),c=r(28),o=Object(n.createElement)(c.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(n.createElement)("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z"}));t.a=o},154:function(e,t,r){"use strict";var n=r(9),c=r.n(n),o=r(16),a=r.n(o),i=r(0),s=r(25),u=r(6),l=r.n(u),b=(r(205),["className","disabled","name","permalink"]);t.a=function(e){var t=e.className,r=void 0===t?"":t,n=e.disabled,o=void 0!==n&&n,u=e.name,p=e.permalink,d=void 0===p?"":p,f=a()(e,b),m=l()("wc-block-components-product-name",r);return o?Object(i.createElement)("span",c()({className:m},f,{dangerouslySetInnerHTML:{__html:Object(s.decodeEntities)(u)}})):Object(i.createElement)("a",c()({className:m,href:d},f,{dangerouslySetInnerHTML:{__html:Object(s.decodeEntities)(u)}}))}},155:function(e,t,r){"use strict";var n=r(0),c=r(119),o=r(91),a=function(e){var t=e.indexOf("</p>");return-1===t?e:e.substr(0,t+4)},i=function(e){return e.replace(/<\/?[a-z][^>]*?>/gi,"")},s=function(e,t){return e.replace(/[\s|\.\,]+$/i,"")+t},u=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"&hellip;",n=i(e),c=n.split(" ").splice(0,t).join(" ");return Object(o.autop)(s(c,r))},l=function(e,t){var r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"&hellip;",c=i(e),a=c.slice(0,t);if(r)return Object(o.autop)(s(a,n));var u=a.match(/([\s]+)/g),l=u?u.length:0,b=c.slice(0,t+l);return Object(o.autop)(s(b,n))};t.a=function(e){var t=e.source,r=e.maxLength,i=void 0===r?15:r,s=e.countType,b=void 0===s?"words":s,p=e.className,d=void 0===p?"":p,f=Object(n.useMemo)((function(){return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:15,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"words",n=Object(o.autop)(e),i=Object(c.count)(n,r);if(i<=t)return n;var s=a(n),b=Object(c.count)(s,r);return b<=t?s:"words"===r?u(s,t):l(s,t,"characters_including_spaces"===r)}(t,i,b)}),[t,i,b]);return Object(n.createElement)(n.RawHTML,{className:d},f)}},156:function(e,t,r){"use strict";var n=r(0),c=(r(2),r(6)),o=r.n(c),a=r(41),i=r(21);r(216),t.a=Object(i.withInstanceId)((function(e){var t=e.className,r=e.instanceId,c=e.label,i=e.onChange,s=e.options,u=e.screenReaderLabel,l=e.readOnly,b=e.value,p="wc-block-components-sort-select__select-".concat(r);return Object(n.createElement)("div",{className:o()("wc-block-sort-select","wc-block-components-sort-select",t)},Object(n.createElement)(a.a,{label:c,screenReaderLabel:u,wrapperElement:"label",wrapperProps:{className:"wc-block-sort-select__label wc-block-components-sort-select__label",htmlFor:p}}),Object(n.createElement)("select",{id:p,className:"wc-block-sort-select__select wc-block-components-sort-select__select",onChange:i,readOnly:l,value:b},s.map((function(e){return Object(n.createElement)("option",{key:e.key,value:e.key},e.label)}))))}))},158:function(e,t,r){"use strict";var n=r(0),c=r(28),o=Object(n.createElement)(c.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(n.createElement)("mask",{id:"external-mask",width:"24",height:"24",x:"0",y:"0",maskUnits:"userSpaceOnUse"},Object(n.createElement)("path",{fill:"#fff",d:"M6.3431 6.3431v1.994l7.8984.0072-8.6055 8.6054 1.4142 1.4143 8.6055-8.6055.0071 7.8984h1.994V6.3431H6.3431z"})),Object(n.createElement)("g",{mask:"url(#external-mask)"},Object(n.createElement)("path",{d:"M0 0h24v24H0z"})));t.a=o},159:function(e,t,r){"use strict";r.d(t,"c",(function(){return o})),r.d(t,"d",(function(){return a})),r.d(t,"a",(function(){return i})),r.d(t,"b",(function(){return s}));var n=r(26),c=r(37),o=function(e,t){if(c.n>2)return Object(n.registerBlockType)(e,t)},a=function(e,t){if(c.n>1)return Object(n.registerBlockType)(e,t)},i=function(){return c.n>2},s=function(){return c.n>1}},162:function(e,t,r){"use strict";r.d(t,"b",(function(){return a})),r.d(t,"c",(function(){return i})),r.d(t,"a",(function(){return s}));var n=r(3),c=r(113),o=r(23),a=function(e){var t=e.country,r=void 0===t?"":t,n=e.state,c=void 0===n?"":n,o=e.city,a=void 0===o?"":o,i=e.postcode,s=void 0===i?"":i;return{country:r.trim(),state:c.trim(),city:a.trim(),postcode:s?s.replace(" ","").toUpperCase():""}},i=function(e){var t=e.email,r=void 0===t?"":t;return Object(o.isEmail)(r)?r.trim():""},s=function(e){var t=Object.keys(n.defaultAddressFields),r=Object(c.a)(t,{},e.country),o=Object.assign({},e);return r.forEach((function(t){var r=t.key,n=void 0===r?"":r,c=t.hidden;void 0!==c&&c&&function(e,t){return e in t}(n,e)&&(o[n]="")})),o}},165:function(e,t,r){"use strict";r.d(t,"a",(function(){return s}));var n=r(24),c=r(14),o=r(0),a=r(62),i=r(127),s=function(e){var t=e.namespace,r=e.resourceName,s=e.resourceValues,u=void 0===s?[]:s,l=e.query,b=void 0===l?{}:l,p=e.shouldSelect,d=void 0===p||p;if(!t||!r)throw new Error("The options object must have valid values for the namespace and the resource properties.");var f=Object(o.useRef)({results:[],isLoading:!0}),m=Object(a.a)(b),O=Object(a.a)(u),g=Object(i.a)(),j=Object(c.useSelect)((function(e){if(!d)return null;var c=e(n.COLLECTIONS_STORE_KEY),o=[t,r,m,O],a=c.getCollectionError.apply(c,o);return a&&g(a),{results:c.getCollection.apply(c,o),isLoading:!c.hasFinishedResolution("getCollection",o)}}),[t,r,O,m,d]);return null!==j&&(f.current=j),f.current}},175:function(e,t){},188:function(e,t,r){"use strict";r.d(t,"a",(function(){return c}));var n=r(0),c=Object(n.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 230 250",style:{width:"100%"}},Object(n.createElement)("title",null,"Grid Block Preview"),Object(n.createElement)("rect",{width:"65.374",height:"65.374",x:".162",y:".779",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"47.266",height:"5.148",x:"9.216",y:"76.153",fill:"#E1E3E6",rx:"2.574"}),Object(n.createElement)("rect",{width:"62.8",height:"15",x:"1.565",y:"101.448",fill:"#E1E3E6",rx:"5"}),Object(n.createElement)("rect",{width:"65.374",height:"65.374",x:".162",y:"136.277",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"47.266",height:"5.148",x:"9.216",y:"211.651",fill:"#E1E3E6",rx:"2.574"}),Object(n.createElement)("rect",{width:"62.8",height:"15",x:"1.565",y:"236.946",fill:"#E1E3E6",rx:"5"}),Object(n.createElement)("rect",{width:"65.374",height:"65.374",x:"82.478",y:".779",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"47.266",height:"5.148",x:"91.532",y:"76.153",fill:"#E1E3E6",rx:"2.574"}),Object(n.createElement)("rect",{width:"62.8",height:"15",x:"83.882",y:"101.448",fill:"#E1E3E6",rx:"5"}),Object(n.createElement)("rect",{width:"65.374",height:"65.374",x:"82.478",y:"136.277",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"47.266",height:"5.148",x:"91.532",y:"211.651",fill:"#E1E3E6",rx:"2.574"}),Object(n.createElement)("rect",{width:"62.8",height:"15",x:"83.882",y:"236.946",fill:"#E1E3E6",rx:"5"}),Object(n.createElement)("rect",{width:"65.374",height:"65.374",x:"164.788",y:".779",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"47.266",height:"5.148",x:"173.843",y:"76.153",fill:"#E1E3E6",rx:"2.574"}),Object(n.createElement)("rect",{width:"62.8",height:"15",x:"166.192",y:"101.448",fill:"#E1E3E6",rx:"5"}),Object(n.createElement)("rect",{width:"65.374",height:"65.374",x:"164.788",y:"136.277",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"47.266",height:"5.148",x:"173.843",y:"211.651",fill:"#E1E3E6",rx:"2.574"}),Object(n.createElement)("rect",{width:"62.8",height:"15",x:"166.192",y:"236.946",fill:"#E1E3E6",rx:"5"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"13.283",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"21.498",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"29.713",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"37.927",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"46.238",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"95.599",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"103.814",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"112.029",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"120.243",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"128.554",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"177.909",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"186.124",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"194.339",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"202.553",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"210.864",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"13.283",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"21.498",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"29.713",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"37.927",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"46.238",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"95.599",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"103.814",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"112.029",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"120.243",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"128.554",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"177.909",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"186.124",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"194.339",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"202.553",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"210.864",y:"221.798",fill:"#E1E3E6",rx:"3"}))},191:function(e,t){e.exports=window.wp.warning},205:function(e,t){},206:function(e,t){},207:function(e,t){},208:function(e,t){},209:function(e,t){},21:function(e,t){e.exports=window.wp.compose},210:function(e,t){},214:function(e,t){},216:function(e,t){},22:function(e,t){e.exports=window.regeneratorRuntime},23:function(e,t){e.exports=window.wp.url},234:function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));var n=r(0),c=(r(2),r(132)),o=(r(210),function(e){var t=e.errorMessage,r=void 0===t?"":t,o=e.propertyName,a=void 0===o?"":o,i=e.elementId,s=void 0===i?"":i,u=Object(c.b)(),l=u.getValidationError,b=u.getValidationErrorId;if(!r||"string"!=typeof r){var p=l(a)||{};if(!p.message||p.hidden)return null;r=p.message}return Object(n.createElement)("div",{className:"wc-block-components-validation-error",role:"alert"},Object(n.createElement)("p",{id:b(s)},r))})},24:function(e,t){e.exports=window.wc.wcBlocksData},25:function(e,t){e.exports=window.wp.htmlEntities},26:function(e,t){e.exports=window.wp.blocks},277:function(e,t,r){"use strict";var n=r(9),c=r.n(n),o=r(0),a=(r(362),function(e){if(e){var t=e.getBoundingClientRect().bottom;t>=0&&t<=window.innerHeight||e.scrollIntoView()}});t.a=function(e){return function(t){var r=Object(o.useRef)(null);return Object(o.createElement)(o.Fragment,null,Object(o.createElement)("div",{className:"with-scroll-to-top__scroll-point",ref:r,"aria-hidden":!0}),Object(o.createElement)(e,c()({},t,{scrollToTop:function(e){var t,n;null!==r.current&&(t=r.current,n=(e||{}).focusableSelector,window&&Number.isFinite(window.innerHeight)&&(n?function(e,t){var r,n=(null===(r=e.parentElement)||void 0===r?void 0:r.querySelectorAll(t))||[];if(n.length){var c=n[0];a(c),null==c||c.focus()}else a(e)}(t,n):a(t)))}})))}}},28:function(e,t){e.exports=window.wp.primitives},3:function(e,t){e.exports=window.wc.wcSettings},302:function(e,t,r){"use strict";var n=r(9),c=r.n(n),o=r(29),a=r.n(o),i=r(8),s=r.n(i),u=r(16),l=r.n(u),b=r(0),p=r(22),d=r.n(p),f=r(37),m=r(39),O=r(222),g=r(42),j=["selected"];t.a=function(e){return function(t){var r=t.selected,n=l()(t,j),o=Object(b.useState)(!0),i=s()(o,2),u=i[0],p=i[1],h=Object(b.useState)(null),v=s()(h,2),w=v[0],y=v[1],E=Object(b.useState)([]),_=s()(E,2),k=_[0],P=_[1],C=f.o.productCount>100,S=function(){var e=a()(d.a.mark((function e(t){var r;return d.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Object(g.a)(t);case 2:r=e.sent,y(r),p(!1);case 5:case"end":return e.stop()}}),e)})));return function(_x){return e.apply(this,arguments)}}();Object(b.useEffect)((function(){Object(m.h)({selected:r}).then((function(e){P(e),p(!1)})).catch(S)}),[r]);var x=Object(O.a)((function(e){Object(m.h)({selected:r,search:e}).then((function(e){P(e),p(!1)})).catch(S)}),400),N=s()(x,1)[0],D=Object(b.useCallback)((function(e){p(!0),N(e)}),[p,N]);return Object(b.createElement)(e,c()({},n,{selected:r,error:w,products:k,isLoading:u,onSearch:C?D:null}))}}},303:function(e,t,r){"use strict";var n=r(0),c=r(28),o=Object(n.createElement)(c.SVG,{xmlns:"http://www.w3.org/2000/SVG",viewBox:"0 0 24 24"},Object(n.createElement)("path",{fill:"none",d:"M0 0h24v24H0V0z"}),Object(n.createElement)("path",{d:"M11 17h2v-1h1c.55 0 1-.45 1-1v-3c0-.55-.45-1-1-1h-3v-1h4V8h-2V7h-2v1h-1c-.55 0-1 .45-1 1v3c0 .55.45 1 1 1h3v1H9v2h2v1zm9-13H4c-1.11 0-1.99.89-1.99 2L2 18c0 1.11.89 2 2 2h16c1.11 0 2-.89 2-2V6c0-1.11-.89-2-2-2zm0 14H4V6h16v12z"}));t.a=o},304:function(e,t,r){"use strict";r.r(t);var n=r(5),c=r.n(n),o=r(0),a=(r(2),r(1)),i=r(6),s=r.n(i),u=r(41),l=r(45),b=r(86);r(557),t.default=Object(b.withProductDataContext)((function(e){var t=e.className,r=e.align,n=Object(l.useInnerBlockLayoutContext)().parentClassName,i=Object(l.useProductDataContext)().product;if(!i.id||!i.on_sale)return null;var b="string"==typeof r?"wc-block-components-product-sale-badge--align-".concat(r):"";return Object(o.createElement)("div",{className:s()("wc-block-components-product-sale-badge",t,b,c()({},"".concat(n,"__product-onsale"),n))},Object(o.createElement)(u.a,{label:Object(a.__)("Sale",'woocommerce'),screenReaderLabel:Object(a.__)("Product on sale",'woocommerce')}))}))},31:function(e,t){e.exports=window.moment},321:function(e,t,r){"use strict";r.d(t,"a",(function(){return c}));var n=r(126),c=function(e,t){return function(r){var c=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10,o=n.a.addEventCallback(e,r,c);return t(o),function(){t(n.a.removeEventCallback(e,o.id))}}}},322:function(e,t,r){"use strict";r.d(t,"a",(function(){return d})),r.d(t,"b",(function(){return f}));var n=r(38),c=r.n(n),o=r(29),a=r.n(o),i=r(22),s=r.n(i),u=function(e,t){return e[t]?Array.from(e[t].values()).sort((function(e,t){return e.priority-t.priority})):[]},l=r(50);function b(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return p(e,void 0);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?p(e,void 0):void 0}}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,c=function(){};return{s:c,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:c}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,i=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){i=!0,o=e},f:function(){try{a||null==r.return||r.return()}finally{if(i)throw o}}}}function p(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var d=function(){var e=a()(s.a.mark((function e(t,r,n){var o,a,i,l,p,d;return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:o=u(t,r),a=[],i=b(o),e.prev=3,i.s();case 5:if((l=i.n()).done){e.next=19;break}return p=l.value,e.prev=7,e.next=10,Promise.resolve(p.callback(n));case 10:d=e.sent,"object"===c()(d)&&a.push(d),e.next=17;break;case 14:e.prev=14,e.t0=e.catch(7),console.error(e.t0);case 17:e.next=5;break;case 19:e.next=24;break;case 21:e.prev=21,e.t1=e.catch(3),i.e(e.t1);case 24:return e.prev=24,i.f(),e.finish(24);case 27:return e.abrupt("return",!a.length||a);case 28:case"end":return e.stop()}}),e,null,[[3,21,24,27],[7,14]])})));return function(_x,t,r){return e.apply(this,arguments)}}(),f=function(){var e=a()(s.a.mark((function e(t,r,n){var o,a,i,p,d,f;return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:o=[],a=u(t,r),i=b(a),e.prev=3,i.s();case 5:if((p=i.n()).done){e.next=28;break}return d=p.value,e.prev=7,e.next=10,Promise.resolve(d.callback(n));case 10:if(f=e.sent,"object"===c()(f)&&null!==f){e.next=13;break}return e.abrupt("continue",26);case 13:if(f.hasOwnProperty("type")){e.next=15;break}throw new Error("Returned objects from event emitter observers must return an object with a type property");case 15:if(!Object(l.a)(f)&&!Object(l.b)(f)){e.next=18;break}return o.push(f),e.abrupt("return",o);case 18:o.push(f),e.next=26;break;case 21:return e.prev=21,e.t0=e.catch(7),console.error(e.t0),o.push({type:"error"}),e.abrupt("return",o);case 26:e.next=5;break;case 28:e.next=33;break;case 30:e.prev=30,e.t1=e.catch(3),i.e(e.t1);case 33:return e.prev=33,i.f(),e.finish(33);case 36:return e.abrupt("return",o);case 37:case"end":return e.stop()}}),e,null,[[3,30,33,36],[7,21]])})));return function(t,r,n){return e.apply(this,arguments)}}()},34:function(e,t){e.exports=window.wp.isShallowEqual},36:function(e,t){e.exports=window.wp.dataControls},361:function(e,t,r){"use strict";var n=r(0),c=r(28),o=Object(n.createElement)(c.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(n.createElement)("path",{fill:"none",d:"M0 0h24v24H0V0z"}),Object(n.createElement)("path",{d:"M15.55 13c.75 0 1.41-.41 1.75-1.03l3.58-6.49c.37-.66-.11-1.48-.87-1.48H5.21l-.94-2H1v2h2l3.6 7.59-1.35 2.44C4.52 15.37 5.48 17 7 17h12v-2H7l1.1-2h7.45zM6.16 6h12.15l-2.76 5H8.53L6.16 6zM7 18c-1.1 0-1.99.9-1.99 2S5.9 22 7 22s2-.9 2-2-.9-2-2-2zm10 0c-1.1 0-1.99.9-1.99 2s.89 2 1.99 2 2-.9 2-2-.9-2-2-2z"}));t.a=o},362:function(e,t){},37:function(e,t,r){"use strict";r.d(t,"o",(function(){return o})),r.d(t,"m",(function(){return a})),r.d(t,"l",(function(){return i})),r.d(t,"n",(function(){return s})),r.d(t,"j",(function(){return u})),r.d(t,"e",(function(){return l})),r.d(t,"f",(function(){return b})),r.d(t,"g",(function(){return p})),r.d(t,"k",(function(){return d})),r.d(t,"c",(function(){return f})),r.d(t,"d",(function(){return m})),r.d(t,"h",(function(){return O})),r.d(t,"a",(function(){return g})),r.d(t,"i",(function(){return j})),r.d(t,"b",(function(){return h}));var n,c=r(3),o=Object(c.getSetting)("wcBlocksConfig",{buildPhase:1,pluginUrl:"",productCount:0,defaultAvatar:"",restApiRoutes:{},wordCountType:"words"}),a=o.pluginUrl+"images/",i=o.pluginUrl+"build/",s=o.buildPhase,u=null===(n=c.STORE_PAGES.shop)||void 0===n?void 0:n.permalink,l=c.STORE_PAGES.checkout.id,b=c.STORE_PAGES.checkout.permalink,p=c.STORE_PAGES.privacy.permalink,d=(c.STORE_PAGES.privacy.title,c.STORE_PAGES.terms.permalink),f=(c.STORE_PAGES.terms.title,c.STORE_PAGES.cart.id),m=c.STORE_PAGES.cart.permalink,O=(c.STORE_PAGES.myaccount.permalink?c.STORE_PAGES.myaccount.permalink:Object(c.getSetting)("wpLoginUrl","/wp-login.php"),Object(c.getSetting)("shippingCountries",{})),g=Object(c.getSetting)("allowedCountries",{}),j=Object(c.getSetting)("shippingStates",{}),h=Object(c.getSetting)("allowedStates",{})},372:function(e,t){},373:function(e,t,r){"use strict";var n=r(5),c=r.n(n),o=r(159);function a(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function i(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?a(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):a(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var s={headingLevel:{type:"number",default:2},showProductLink:{type:"boolean",default:!0},productId:{type:"number",default:0}};Object(o.b)()&&(s=i(i({},s),{},{align:{type:"string"},color:{type:"string"},customColor:{type:"string"},fontSize:{type:"string"},customFontSize:{type:"number"}})),t.a=s},374:function(e,t,r){"use strict";t.a={showProductLink:{type:"boolean",default:!0},showSaleBadge:{type:"boolean",default:!0},saleBadgeAlign:{type:"string",default:"right"},imageSizing:{type:"string",default:"full-size"},productId:{type:"number",default:0}}},375:function(e,t,r){"use strict";var n=r(9),c=r.n(n),o=r(5),a=r.n(o),i=r(8),s=r.n(i),u=r(0),l=(r(2),r(1)),b=r(6),p=r.n(b),d=r(3),f=r(45),m=r(86),O=r(68),g=r(304);function j(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function h(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?j(Object(r),!0).forEach((function(t){a()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):j(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}r(558);var v=function(){return Object(u.createElement)("img",{src:d.PLACEHOLDER_IMG_SRC,alt:"",width:500,height:500})},w=function(e){var t=e.image,r=e.onLoad,n=e.loaded,o=e.showFullSize,a=e.fallbackAlt,i=t||{},s=i.thumbnail,l=i.src,b=i.srcset,p=i.sizes,d=h({alt:i.alt||a,onLoad:r,hidden:!n,src:s},o&&{src:l,srcSet:b,sizes:p});return Object(u.createElement)(u.Fragment,null,d.src&&Object(u.createElement)("img",c()({"data-testid":"product-image"},d)),!n&&Object(u.createElement)(v,null))};t.a=Object(m.withProductDataContext)((function(e){var t=e.className,r=e.imageSizing,n=void 0===r?"full-size":r,c=e.showProductLink,o=void 0===c||c,i=e.showSaleBadge,b=e.saleBadgeAlign,d=void 0===b?"right":b,m=Object(f.useInnerBlockLayoutContext)().parentClassName,j=Object(f.useProductDataContext)().product,y=Object(u.useState)(!1),E=s()(y,2),_=E[0],k=E[1],P=Object(O.a)().dispatchStoreEvent;if(!j.id)return Object(u.createElement)("div",{className:p()(t,"wc-block-components-product-image","wc-block-components-product-image--placeholder",a()({},"".concat(m,"__product-image"),m))},Object(u.createElement)(v,null));var C=!!j.images.length,S=C?j.images[0]:null,x=o?"a":u.Fragment,N=Object(l.sprintf)(
/* translators: %s is referring to the product name */
Object(l.__)("Link to %s",'woocommerce'),j.name),D=h(h({href:j.permalink,rel:"nofollow"},!C&&{"aria-label":N}),{},{onClick:function(){P("product-view-link",{product:j})}});return Object(u.createElement)("div",{className:p()(t,"wc-block-components-product-image",a()({},"".concat(m,"__product-image"),m))},Object(u.createElement)(x,o&&D,!!i&&Object(u.createElement)(g.default,{align:d,product:j}),Object(u.createElement)(w,{fallbackAlt:j.name,image:S,onLoad:function(){return k(!0)},loaded:_,showFullSize:"cropped"!==n})))}))},376:function(e,t,r){"use strict";t.a={showFormElements:{type:"boolean",default:!1},productId:{type:"number",default:0}}},377:function(e,t,r){"use strict";var n=r(0),c=(r(2),r(6)),o=r.n(c),a=r(8),i=r.n(a),s=r(1),u=r(62),l=r(879),b={status:"pristine",hasError:!1,quantity:1,processingResponse:null,requestParams:{}},p=function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=e?"set_has_error":"set_no_error";return{type:t}},d=r(5),f=r.n(d);function m(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function O(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?m(Object(r),!0).forEach((function(t){f()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):m(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var g="idle",j=function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:b,r=arguments.length>1?arguments[1]:void 0,n=r.quantity,c=r.type,o=r.data;switch(c){case"set_pristine":e=b;break;case"set_idle":e=t.status!==g?O(O({},t),{},{status:g}):t;break;case"set_disabled":e="disabled"!==t.status?O(O({},t),{},{status:"disabled"}):t;break;case"set_quantity":e=n!==t.quantity?O(O({},t),{},{quantity:n}):t;break;case"set_request_params":e=O(O({},t),{},{requestParams:O(O({},t.requestParams),o)});break;case"set_processing_response":e=O(O({},t),{},{processingResponse:o});break;case"set_processing":e=!1===(e="processing"!==t.status?O(O({},t),{},{status:"processing",hasError:!1}):t).hasError?e:O(O({},e),{},{hasError:!1});break;case"set_before_processing":e="before_processing"!==t.status?O(O({},t),{},{status:"before_processing",hasError:!1}):t;break;case"set_after_processing":e="after_processing"!==t.status?O(O({},t),{},{status:"after_processing"}):t;break;case"set_has_error":e=t.hasError?t:O(O({},t),{},{hasError:!0}),e="processing"===t.status||"before_processing"===t.status?O(O({},e),{},{status:g}):e;break;case"set_no_error":e=t.hasError?O(O({},t),{},{hasError:!1}):t}return e!==t&&"set_pristine"!==c&&"pristine"===e.status&&(e.status=g),e},h=r(126),v=r(321),w=function(e){return{onAddToCartAfterProcessingWithSuccess:Object(v.a)("add_to_cart_after_processing_with_success",e),onAddToCartProcessingWithError:Object(v.a)("add_to_cart_after_processing_with_error",e),onAddToCartBeforeProcessing:Object(v.a)("add_to_cart_before_processing",e)}},y=r(322),E=r(132),_=r(59),k=r(50),P=Object(n.createContext)({product:{},productType:"simple",productIsPurchasable:!0,productHasOptions:!1,supportsFormElements:!0,showFormElements:!1,quantity:0,minQuantity:1,maxQuantity:99,requestParams:{},isIdle:!1,isDisabled:!1,isProcessing:!1,isBeforeProcessing:!1,isAfterProcessing:!1,hasError:!1,eventRegistration:{onAddToCartAfterProcessingWithSuccess:function(e){},onAddToCartAfterProcessingWithError:function(e){},onAddToCartBeforeProcessing:function(e){}},dispatchActions:{resetForm:function(){},submitForm:function(){},setQuantity:function(e){},setHasError:function(e){},setAfterProcessing:function(e){},setRequestParams:function(e){}}}),C=function(){return Object(n.useContext)(P)},S=function(e){var t=e.children,r=e.product,c=e.showFormElements,o=Object(n.useReducer)(j,b),a=i()(o,2),d=a[0],f=a[1],m=Object(n.useReducer)(h.b,{}),O=i()(m,2),g=O[0],v=O[1],C=Object(u.a)(g),S=Object(_.a)(),x=S.addErrorNotice,N=S.removeNotices,D=Object(E.b)().setValidationErrors,B=Object(k.c)(),R=B.isSuccessResponse,T=B.isErrorResponse,A=B.isFailResponse,I=Object(n.useMemo)((function(){return{onAddToCartAfterProcessingWithSuccess:w(v).onAddToCartAfterProcessingWithSuccess,onAddToCartAfterProcessingWithError:w(v).onAddToCartAfterProcessingWithError,onAddToCartBeforeProcessing:w(v).onAddToCartBeforeProcessing}}),[v]),L=Object(n.useMemo)((function(){return{resetForm:function(){f({type:"set_pristine"})},submitForm:function(){f({type:"set_before_processing"})},setQuantity:function(e){f(function(e){return{type:"set_quantity",quantity:e}}(e))},setHasError:function(e){f(p(e))},setRequestParams:function(e){f(function(e){return{type:"set_request_params",data:e}}(e))},setAfterProcessing:function(e){f({type:"set_processing_response",data:e}),f({type:"set_after_processing"})}}}),[]);Object(n.useEffect)((function(){var e=d.status,t=!r.id||!Object(l.a)(r);"disabled"!==e||t?"disabled"!==e&&t&&f({type:"set_disabled"}):f({type:"set_idle"})}),[d.status,r,f]),Object(n.useEffect)((function(){"before_processing"===d.status&&(N("error"),Object(y.a)(C,"add_to_cart_before_processing",{}).then((function(e){!0!==e?(Array.isArray(e)&&e.forEach((function(e){var t=e.errorMessage,r=e.validationErrors;t&&x(t),r&&D(r)})),f({type:"set_idle"})):f({type:"set_processing"})})))}),[d.status,D,x,N,f,C]),Object(n.useEffect)((function(){if("after_processing"===d.status){var e={processingResponse:d.processingResponse},t=function(e){var t=!1;return e.forEach((function(e){var r=e.message,n=e.messageContext;(T(e)||A(e))&&r&&(t=!0,x(r,n?{context:n}:void 0))})),t};if(d.hasError)return void Object(y.b)(C,"add_to_cart_after_processing_with_error",e).then((function(r){if(!t(r)){var n,c=(null===(n=e.processingResponse)||void 0===n?void 0:n.message)||Object(s.__)("Something went wrong. Please contact us to get assistance.",'woocommerce');x(c,{id:"add-to-cart"})}f({type:"set_idle"})}));Object(y.b)(C,"add_to_cart_after_processing_with_success",e).then((function(e){t(e)?f(p(!0)):f({type:"set_idle"})}))}}),[d.status,d.hasError,d.processingResponse,L,x,T,A,R,C]);var z=Object(l.b)(r),V={product:r,productType:r.type||"simple",productIsPurchasable:Object(l.a)(r),productHasOptions:r.has_options||!1,supportsFormElements:z,showFormElements:c&&z,quantity:d.quantity,minQuantity:1,maxQuantity:r.quantity_limit||99,requestParams:d.requestParams,isIdle:"idle"===d.status,isDisabled:"disabled"===d.status,isProcessing:"processing"===d.status,isBeforeProcessing:"before_processing"===d.status,isAfterProcessing:"after_processing"===d.status,hasError:d.hasError,eventRegistration:I,dispatchActions:L};return Object(n.createElement)(P.Provider,{value:V},t)},x=r(15),N=r.n(x),D=r(25),B=r(43);function R(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}var T=function(){var e=C(),t=e.dispatchActions,r=e.product,c=e.quantity,o=e.eventRegistration,a=e.hasError,u=e.isProcessing,l=e.requestParams,b=Object(E.b)(),p=b.hasValidationErrors,d=b.showAllValidationErrors,m=Object(_.a)(),O=m.addErrorNotice,g=m.removeNotice,j=Object(B.a)().receiveCart,h=Object(n.useState)(!1),v=i()(h,2),w=v[0],y=v[1],k=!a&&u,P=Object(n.useCallback)((function(){return!p||(d(),{type:"error"})}),[p,d]);Object(n.useEffect)((function(){var e=o.onAddToCartBeforeProcessing(P,0);return function(){e()}}),[o,P]);var S=Object(n.useCallback)((function(){y(!0),g("add-to-cart");var e=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?R(Object(r),!0).forEach((function(t){f()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):R(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({id:r.id||0,quantity:c},l);N()({path:"/wc/store/cart/add-item",method:"POST",data:e,cache:"no-store",parse:!1}).then((function(e){N.a.setNonce(e.headers),e.json().then((function(r){e.ok?j(r):(r.body&&r.body.message?O(Object(D.decodeEntities)(r.body.message),{id:"add-to-cart"}):O(Object(s.__)("Something went wrong. Please contact us to get assistance.",'woocommerce'),{id:"add-to-cart"}),t.setHasError()),t.setAfterProcessing(r),y(!1)}))})).catch((function(e){e.json().then((function(e){var r;null!==(r=e.data)&&void 0!==r&&r.cart&&j(e.data.cart),t.setHasError(),t.setAfterProcessing(e),y(!1)}))}))}),[r,O,g,j,t,c,l]);return Object(n.useEffect)((function(){k&&!w&&S()}),[k,S,w]),null},A=function(e){var t=e.children,r=e.product,c=e.showFormElements;return Object(n.createElement)(E.a,null,Object(n.createElement)(S,{product:r,showFormElements:c},t,Object(n.createElement)(T,null)))},I=r(45),L=r(7),z=r(86),V=(r(372),r(90)),F=r(66),M=r(567),H=r(68),q=r(788),G=function(e){var t=e.className,r=e.href,c=e.text,o=e.onClick;return Object(n.createElement)(V.a,{className:t,href:r,onClick:o,rel:"nofollow"},c)},Q=function(e){var t=e.className,r=e.quantityInCart,c=e.isProcessing,o=e.isDisabled,a=e.isDone,i=e.onClick;return Object(n.createElement)(V.a,{className:t,disabled:o,showSpinner:c,onClick:i},a&&r>0?Object(s.sprintf)(
/* translators: %s number of products in cart. */
Object(s._n)("%d in cart","%d in cart",r,'woocommerce'),r):Object(s.__)("Add to cart",'woocommerce'),!!a&&Object(n.createElement)(F.a,{srcElement:M.a,alt:Object(s.__)("Done",'woocommerce')}))},Y=function(){var e=C(),t=e.showFormElements,r=e.productIsPurchasable,c=e.productHasOptions,o=e.product,a=e.productType,u=e.isDisabled,l=e.isProcessing,b=e.eventRegistration,p=e.hasError,d=e.dispatchActions,f=Object(I.useInnerBlockLayoutContext)().parentName,m=Object(H.a)().dispatchStoreEvent,O=Object(q.a)(o.id||0).cartQuantity,g=Object(n.useState)(!1),j=i()(g,2),h=j[0],v=j[1],w=o.add_to_cart||{url:"",text:""};return Object(n.useEffect)((function(){var e=b.onAddToCartAfterProcessingWithSuccess((function(){return p||v(!0),!0}),0);return function(){e()}}),[b,p]),(t||!c&&"simple"===a)&&r?Object(n.createElement)(Q,{className:"wc-block-components-product-add-to-cart-button",quantityInCart:O,isDisabled:u,isProcessing:l,isDone:h,onClick:function(){d.submitForm(),m("cart-add-item",{product:o,listName:f})}}):Object(n.createElement)(G,{className:"wc-block-components-product-add-to-cart-button",href:w.url,text:w.text||Object(s.__)("View Product",'woocommerce'),onClick:function(){m("product-view-link",{product:o,listName:f})}})},U=function(e){var t=e.disabled,r=e.min,c=e.max,o=e.value,a=e.onChange;return Object(n.createElement)("input",{className:"wc-block-components-product-add-to-cart-quantity",type:"number",value:o,min:r,max:c,hidden:1===c,disabled:t,onChange:function(e){a(e.target.value)}})},W=function(e){var t=e.reason,r=void 0===t?Object(s.__)("Sorry, this product cannot be purchased.",'woocommerce'):t;return Object(n.createElement)("div",{className:"wc-block-components-product-add-to-cart-unavailable"},r)},K=function(){var e=C(),t=e.product,r=e.quantity,c=e.minQuantity,o=e.maxQuantity,a=e.dispatchActions,i=e.isDisabled;return t.id&&!t.is_purchasable?Object(n.createElement)(W,null):t.id&&!t.is_in_stock?Object(n.createElement)(W,{reason:Object(s.__)("This product is currently out of stock and cannot be purchased.",'woocommerce')}):Object(n.createElement)(n.Fragment,null,Object(n.createElement)(U,{value:r,min:c,max:o,disabled:i,onChange:a.setQuantity}),Object(n.createElement)(Y,null))},$=(r(566),r(33)),J=r.n($),X=r(897),Z=r(11),ee=r(234),te={value:"",label:Object(s.__)("Select an option",'woocommerce')},re=function(e){var t=e.attributeName,r=e.options,c=void 0===r?[]:r,a=e.value,i=void 0===a?"":a,u=e.onChange,l=void 0===u?function(){}:u,b=e.errorMessage,p=void 0===b?Object(s.__)("Please select a value.",'woocommerce'):b,d=Object(E.b)(),m=d.getValidationError,O=d.setValidationErrors,g=d.clearValidationError,j=t,h=m(j)||{};return Object(Z.useEffect)((function(){i?g(j):O(f()({},j,{message:p,hidden:!0}))}),[i,j,p,g,O]),Object(Z.useEffect)((function(){return function(){g(j)}}),[j,g]),Object(n.createElement)("div",{className:"wc-block-components-product-add-to-cart-attribute-picker__container"},Object(n.createElement)(X.a,{label:Object(D.decodeEntities)(t),value:i||"",options:[te].concat(J()(c)),onChange:l,required:!0,className:o()("wc-block-components-product-add-to-cart-attribute-picker__select",{"has-error":h.message&&!h.hidden})}),Object(n.createElement)(ee.a,{propertyName:j,elementId:j}))},ne=r(72);function ce(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function oe(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ce(Object(r),!0).forEach((function(t){f()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ce(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var ae=function(e,t,r){var n=Object.values(t).map((function(e){return e.id}));if(Object.values(r).every((function(e){return""===e})))return n;var c=Object.keys(e);return n.filter((function(e){return c.every((function(n){var c=r[n]||"",o=t["id:"+e].attributes[n];return""===c||null===o||o===c}))}))};function ie(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function se(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ie(Object(r),!0).forEach((function(t){f()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ie(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var ue=function(e){var t=e.attributes,r=e.variationAttributes,c=e.setRequestParams,o=Object(u.a)(t),a=Object(u.a)(r),s=Object(n.useState)(0),l=i()(s,2),b=l[0],p=l[1],d=Object(n.useState)({}),m=i()(d,2),O=m[0],g=m[1],j=Object(n.useState)(!1),h=i()(j,2),v=h[0],w=h[1],y=Object(n.useMemo)((function(){return function(e,t,r){var n={},c=Object.keys(e),o=Object.values(r).filter(Boolean).length>0;return c.forEach((function(c){var a=e[c],i=oe(oe({},r),{},f()({},c,null)),s=o?ae(e,t,i):null,u=null!==s?s.map((function(e){return t["id:"+e].attributes[c]})):null;n[c]=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return Object.values(e).map((function(e){var r=e.name,n=e.slug;return null===t||t.includes(null)||t.includes(n)?{value:n,label:Object(D.decodeEntities)(r)}:null})).filter(Boolean)}(a.terms,u)})),n}(o,a,O)}),[O,o,a]);return Object(n.useEffect)((function(){if(!v){var e=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!Object(ne.b)(e))return{};var t=Object.keys(e),r={};return 0===t.length||t.forEach((function(t){var n,c=e[t],o=c.terms.filter((function(e){return e.default}));o.length>0&&(r[c.name]=null===(n=o[0])||void 0===n?void 0:n.slug)})),r}(t);e&&g(se({},e)),w(!0)}}),[O,t,v]),Object(n.useEffect)((function(){Object.values(O).filter((function(e){return""!==e})).length===Object.keys(o).length?p(function(e,t,r){return ae(e,t,r)[0]||0}(o,a,O)):b>0&&p(0)}),[O,b,o,a]),Object(n.useEffect)((function(){c({id:b,variation:Object.keys(O).map((function(e){return{attribute:e,value:O[e]}}))})}),[c,b,O]),Object(n.createElement)("div",{className:"wc-block-components-product-add-to-cart-attribute-picker"},Object.keys(o).map((function(e){return Object(n.createElement)(re,{key:e,attributeName:e,options:y[e],value:O[e],onChange:function(t){g(se(se({},O),{},f()({},e,t)))}})})))},le=function(e){var t=e.product,r=e.dispatchers,c=function(e){return e?Object(L.keyBy)(Object.values(e).filter((function(e){return e.has_variations})),"name"):{}}(t.attributes),o=function(e){if(!e)return{};var t={};return e.forEach((function(e){var r=e.id,n=e.attributes;t["id:".concat(r)]={id:r,attributes:n.reduce((function(e,t){var r=t.name,n=t.value;return e[r]=n,e}),{})}})),t}(t.variations);return 0===Object.keys(c).length||0===o.length?null:Object(n.createElement)(ue,{attributes:c,variationAttributes:o,setRequestParams:r.setRequestParams})},be=function(){var e=C(),t=e.product,r=e.quantity,c=e.minQuantity,o=e.maxQuantity,a=e.dispatchActions,i=e.isDisabled;return t.id&&!t.is_purchasable?Object(n.createElement)(W,null):t.id&&!t.is_in_stock?Object(n.createElement)(W,{reason:Object(s.__)("This product is currently out of stock and cannot be purchased.",'woocommerce')}):Object(n.createElement)(n.Fragment,null,Object(n.createElement)(le,{product:t,dispatchers:a}),Object(n.createElement)(U,{value:r,min:c,max:o,disabled:i,onChange:a.setQuantity}),Object(n.createElement)(Y,null))},pe=function(){return Object(n.createElement)(Y,null)},de=r(891),fe=function(){return Object(n.createElement)(de.a,{className:"wc-block-components-product-add-to-cart-group-list"},"This is a placeholder for the grouped products form element.")},me=function(){return Object(n.createElement)(fe,null)},Oe=function(){var e=C(),t=e.showFormElements,r=e.productType;return t?"variable"===r?Object(n.createElement)(be,null):"grouped"===r?Object(n.createElement)(me,null):"external"===r?Object(n.createElement)(pe,null):"simple"===r||"variation"===r?Object(n.createElement)(K,null):null:Object(n.createElement)(Y,null)};t.a=Object(z.withProductDataContext)((function(e){var t=e.className,r=e.showFormElements,c=Object(I.useProductDataContext)().product,a=o()(t,"wc-block-components-product-add-to-cart",{"wc-block-components-product-add-to-cart--placeholder":Object(L.isEmpty)(c)});return Object(n.createElement)(A,{product:c,showFormElements:r},Object(n.createElement)("div",{className:a},Object(n.createElement)(Oe,null)))}))},378:function(e,t,r){"use strict";var n=r(5),c=r.n(n),o=r(0),a=(r(2),r(6)),i=r.n(a),s=r(45),u=r(12),l=r(159),b=function(e){var t=e.color,r=e.fontSize;return Object(l.b)()?{color:t,fontSize:r}:{}},p=r(86),d=r(154),f=r(68);r(556),t.a=Object(p.withProductDataContext)((function(e){var t,r,n,a=e.className,p=e.headingLevel,m=void 0===p?2:p,O=e.showProductLink,g=void 0===O||O,j=e.align,h=e.color,v=e.customColor,w=e.fontSize,y=e.customFontSize,E=Object(s.useInnerBlockLayoutContext)().parentClassName,_=Object(s.useProductDataContext)().product,k=Object(f.a)().dispatchStoreEvent,P="h".concat(m),C=Object(u.getColorClassName)("color",h),S=Object(u.getFontSizeClass)(w),x=i()((t={"has-text-color":h||v,"has-font-size":w||y},c()(t,C,C),c()(t,S,S),t));return _.id?Object(o.createElement)(P,{className:i()(a,"wc-block-components-product-title",(r={},c()(r,"".concat(E,"__product-title"),E),c()(r,"wc-block-components-product-title--align-".concat(j),j&&Object(l.b)()),r))},Object(o.createElement)(d.a,{className:i()(c()({},x,Object(l.b)())),disabled:!g,name:_.name,permalink:_.permalink,rel:g?"nofollow":null,style:b({color:v,fontSize:y}),onClick:function(){k("product-view-link",{product:_})}})):Object(o.createElement)(P,{className:i()(a,"wc-block-components-product-title",(n={},c()(n,"".concat(E,"__product-title"),E),c()(n,"wc-block-components-product-title--align-".concat(j),j&&Object(l.b)()),c()(n,x,Object(l.b)()),n)),style:b({color:v,fontSize:y})})}))},39:function(e,t,r){"use strict";r.d(t,"h",(function(){return d})),r.d(t,"e",(function(){return f})),r.d(t,"b",(function(){return m})),r.d(t,"i",(function(){return O})),r.d(t,"f",(function(){return g})),r.d(t,"c",(function(){return j})),r.d(t,"d",(function(){return h})),r.d(t,"g",(function(){return v})),r.d(t,"a",(function(){return w}));var n=r(5),c=r.n(n),o=r(23),a=r(15),i=r.n(a),s=r(7),u=r(3),l=r(37);function b(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function p(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?b(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):b(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var d=function(e){var t=e.selected,r=void 0===t?[]:t,n=e.search,c=void 0===n?"":n,a=e.queryArgs,u=function(e){var t=e.selected,r=void 0===t?[]:t,n=e.search,c=void 0===n?"":n,a=e.queryArgs,i=void 0===a?{}:a,s=l.o.productCount>100,u={per_page:s?100:0,catalog_visibility:"any",search:c,orderby:"title",order:"asc"},b=[Object(o.addQueryArgs)("/wc/store/products",p(p({},u),i))];return s&&r.length&&b.push(Object(o.addQueryArgs)("/wc/store/products",{catalog_visibility:"any",include:r,per_page:0})),b}({selected:r,search:c,queryArgs:void 0===a?{}:a});return Promise.all(u.map((function(e){return i()({path:e})}))).then((function(e){return Object(s.uniqBy)(Object(s.flatten)(e),"id").map((function(e){return p(p({},e),{},{parent:0})}))})).catch((function(e){throw e}))},f=function(e){return i()({path:"/wc/store/products/".concat(e)})},m=function(){return i()({path:"wc/store/products/attributes"})},O=function(e){return i()({path:"wc/store/products/attributes/".concat(e,"/terms")})},g=function(e){var t=e.selected,r=function(e){var t=e.selected,r=void 0===t?[]:t,n=e.search,c=Object(u.getSetting)("limitTags",!1),a=[Object(o.addQueryArgs)("wc/store/products/tags",{per_page:c?100:0,orderby:c?"count":"name",order:c?"desc":"asc",search:n})];return c&&r.length&&a.push(Object(o.addQueryArgs)("wc/store/products/tags",{include:r})),a}({selected:void 0===t?[]:t,search:e.search});return Promise.all(r.map((function(e){return i()({path:e})}))).then((function(e){return Object(s.uniqBy)(Object(s.flatten)(e),"id")}))},j=function(e){return i()({path:Object(o.addQueryArgs)("wc/store/products/categories",p({per_page:0},e))})},h=function(e){return i()({path:"wc/store/products/categories/".concat(e)})},v=function(e){return i()({path:Object(o.addQueryArgs)("wc/store/products",{per_page:0,type:"variation",parent:e})})},w=function(e,t){if(!e.title.raw)return e.slug;var r=1===t.filter((function(t){return t.title.raw===e.title.raw})).length;return e.title.raw+(r?"":" - ".concat(e.slug))}},4:function(e,t){e.exports=window.wp.components},41:function(e,t,r){"use strict";var n=r(5),c=r.n(n),o=r(0),a=r(6),i=r.n(a);function s(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function u(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?s(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):s(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}t.a=function(e){var t,r=e.label,n=e.screenReaderLabel,c=e.wrapperElement,a=e.wrapperProps,s=void 0===a?{}:a,l=null!=r,b=null!=n;return!l&&b?(t=c||"span",s=u(u({},s),{},{className:i()(s.className,"screen-reader-text")}),Object(o.createElement)(t,s,n)):(t=c||o.Fragment,l&&b&&r!==n?Object(o.createElement)(t,s,Object(o.createElement)("span",{"aria-hidden":"true"},r),Object(o.createElement)("span",{className:"screen-reader-text"},n)):Object(o.createElement)(t,s,r))}},42:function(e,t,r){"use strict";r.d(t,"a",(function(){return s})),r.d(t,"b",(function(){return u}));var n=r(29),c=r.n(n),o=r(22),a=r.n(o),i=r(1),s=function(){var e=c()(a.a.mark((function e(t){var r;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("function"!=typeof t.json){e.next=11;break}return e.prev=1,e.next=4,t.json();case 4:return r=e.sent,e.abrupt("return",{message:r.message,type:r.type||"api"});case 8:return e.prev=8,e.t0=e.catch(1),e.abrupt("return",{message:e.t0.message,type:"general"});case 11:return e.abrupt("return",{message:t.message,type:t.type||"general"});case 12:case"end":return e.stop()}}),e,null,[[1,8]])})));return function(_x){return e.apply(this,arguments)}}(),u=function(e){if(e.data&&"rest_invalid_param"===e.code){var t=Object.values(e.data.params);if(t[0])return t[0]}return(null==e?void 0:e.message)||Object(i.__)("Something went wrong. Please contact us to get assistance.",'woocommerce')}},43:function(e,t,r){"use strict";r.d(t,"a",(function(){return y}));var n=r(8),c=r.n(n),o=r(5),a=r.n(o),i=r(7),s=r(0),u=r(24),l=r(14),b=r(25),p=r(142),d=r(162),f=r(63);function m(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function O(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?m(Object(r),!0).forEach((function(t){a()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):m(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var g={first_name:"",last_name:"",company:"",address_1:"",address_2:"",city:"",state:"",postcode:"",country:"",phone:""},j=O(O({},g),{},{email:""}),h={total_items:"",total_items_tax:"",total_fees:"",total_fees_tax:"",total_discount:"",total_discount_tax:"",total_shipping:"",total_shipping_tax:"",total_price:"",total_tax:"",tax_lines:u.EMPTY_TAX_LINES,currency_code:"",currency_symbol:"",currency_minor_unit:2,currency_decimal_separator:"",currency_thousand_separator:"",currency_prefix:"",currency_suffix:""},v=function(e){return Object(p.a)(Object.entries(e).map((function(e){var t=c()(e,2),r=t[0],n=t[1];return[r,Object(b.decodeEntities)(n)]})))},w={cartCoupons:u.EMPTY_CART_COUPONS,cartItems:u.EMPTY_CART_ITEMS,cartFees:u.EMPTY_CART_FEES,cartItemsCount:0,cartItemsWeight:0,cartNeedsPayment:!0,cartNeedsShipping:!0,cartItemErrors:u.EMPTY_CART_ITEM_ERRORS,cartTotals:h,cartIsLoading:!0,cartErrors:u.EMPTY_CART_ERRORS,billingAddress:j,shippingAddress:g,shippingRates:u.EMPTY_SHIPPING_RATES,shippingRatesLoading:!1,cartHasCalculatedShipping:!1,paymentRequirements:u.EMPTY_PAYMENT_REQUIREMENTS,receiveCart:function(){},extensions:u.EMPTY_EXTENSIONS},y=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{shouldSelect:!0},t=Object(f.b)(),r=t.isEditor,n=t.previewData,c=null==n?void 0:n.previewCart,o=e.shouldSelect,a=Object(s.useRef)(),b=Object(l.useSelect)((function(e,t){var n=t.dispatch;if(!o)return w;if(r)return{cartCoupons:c.coupons,cartItems:c.items,cartFees:c.fees,cartItemsCount:c.items_count,cartItemsWeight:c.items_weight,cartNeedsPayment:c.needs_payment,cartNeedsShipping:c.needs_shipping,cartItemErrors:u.EMPTY_CART_ITEM_ERRORS,cartTotals:c.totals,cartIsLoading:!1,cartErrors:u.EMPTY_CART_ERRORS,billingAddress:j,shippingAddress:g,extensions:u.EMPTY_EXTENSIONS,shippingRates:c.shipping_rates,shippingRatesLoading:!1,cartHasCalculatedShipping:c.has_calculated_shipping,paymentRequirements:c.paymentRequirements,receiveCart:"function"==typeof(null==c?void 0:c.receiveCart)?c.receiveCart:function(){}};var a=e(u.CART_STORE_KEY),i=a.getCartData(),s=a.getCartErrors(),l=a.getCartTotals(),b=!a.hasFinishedResolution("getCartData"),p=a.isCustomerDataUpdating(),f=n(u.CART_STORE_KEY).receiveCart,m=v(i.billingAddress),h=i.needsShipping?v(i.shippingAddress):m,y=i.fees.length>0?i.fees.map((function(e){return v(e)})):u.EMPTY_CART_FEES;return{cartCoupons:i.coupons.length>0?i.coupons.map((function(e){return O(O({},e),{},{label:e.code})})):u.EMPTY_CART_COUPONS,cartItems:i.items,cartFees:y,cartItemsCount:i.itemsCount,cartItemsWeight:i.itemsWeight,cartNeedsPayment:i.needsPayment,cartNeedsShipping:i.needsShipping,cartItemErrors:i.errors,cartTotals:l,cartIsLoading:b,cartErrors:s,billingAddress:Object(d.a)(m),shippingAddress:Object(d.a)(h),extensions:i.extensions,shippingRates:i.shippingRates,shippingRatesLoading:p,cartHasCalculatedShipping:i.hasCalculatedShipping,paymentRequirements:i.paymentRequirements,receiveCart:f}}),[o]);return a.current&&Object(i.isEqual)(a.current,b)||(a.current=b),a.current}},45:function(e,t){e.exports=window.wc.wcBlocksSharedContext},46:function(e,t){e.exports=window.wp.keycodes},47:function(e,t){e.exports=window.wc.priceFormat},48:function(e,t){e.exports=window.wp.escapeHtml},482:function(e,t,r){"use strict";r.r(t);var n=r(5),c=r.n(n),o=r(0),a=(r(2),r(6)),i=r.n(a),s=r(124),u=r(47),l=r(45),b=r(12),p=r(159),d=r(86);t.default=Object(d.withProductDataContext)((function(e){var t,r,n,a,d,f,m,O=e.className,g=e.align,j=e.fontSize,h=e.customFontSize,v=e.saleFontSize,w=e.customSaleFontSize,y=e.color,E=e.customColor,_=e.saleColor,k=e.customSaleColor,P=Object(l.useInnerBlockLayoutContext)().parentClassName,C=Object(l.useProductDataContext)().product,S=i()(O,c()({},"".concat(P,"__product-price"),P));if(!C.id)return Object(o.createElement)(s.a,{align:g,className:S});var x=Object(b.getColorClassName)("color",y),N=Object(b.getFontSizeClass)(j),D=Object(b.getColorClassName)("color",_),B=Object(b.getFontSizeClass)(v),R=i()((t={"has-text-color":y||E,"has-font-size":j||h},c()(t,x,x),c()(t,N,N),t)),T=i()((r={"has-text-color":_||k,"has-font-size":v||w},c()(r,D,D),c()(r,B,B),r)),A={color:E,fontSize:h},I={color:k,fontSize:w},L=C.prices,z=Object(u.getCurrencyFromPriceResponse)(L),V=L.price!==L.regular_price,F=V?i()((n={},c()(n,"".concat(P,"__product-price__value"),P),c()(n,T,Object(p.b)()),n)):i()((a={},c()(a,"".concat(P,"__product-price__value"),P),c()(a,R,Object(p.b)()),a)),M=V?I:A;return Object(o.createElement)(s.a,{align:g,className:S,currency:z,price:L.price,priceClassName:F,priceStyle:Object(p.b)()?M:{},minPrice:null==L||null===(d=L.price_range)||void 0===d?void 0:d.min_amount,maxPrice:null==L||null===(f=L.price_range)||void 0===f?void 0:f.max_amount,regularPrice:L.regular_price,regularPriceClassName:i()((m={},c()(m,"".concat(P,"__product-price__regular"),P),c()(m,R,Object(p.b)()),m)),regularPriceStyle:Object(p.b)()?A:{}})}))},483:function(e,t,r){"use strict";r.r(t);var n=r(5),c=r.n(n),o=r(0),a=(r(2),r(1)),i=r(6),s=r.n(i),u=r(45),l=r(86),b=(r(559),function(e){var t=parseFloat(e.average_rating);return Number.isFinite(t)&&t>0?t:0});t.default=Object(l.withProductDataContext)((function(e){var t=e.className,r=Object(u.useInnerBlockLayoutContext)().parentClassName,n=Object(u.useProductDataContext)().product,i=b(n);if(!i)return null;var l={width:i/5*100+"%"},p=Object(a.sprintf)(
/* translators: %f is referring to the average rating value */
Object(a.__)("Rated %f out of 5",'woocommerce'),i);return Object(o.createElement)("div",{className:s()(t,"wc-block-components-product-rating",c()({},"".concat(r,"__product-rating"),r))},Object(o.createElement)("div",{className:s()("wc-block-components-product-rating__stars","".concat(r,"__product-rating__stars")),role:"img","aria-label":p},Object(o.createElement)("span",{style:l},p)))}))},484:function(e,t,r){"use strict";r.r(t);var n=r(9),c=r.n(n),o=r(5),a=r.n(o),i=r(0),s=(r(2),r(6)),u=r.n(s),l=r(1),b=r(68),p=r(788),d=r(25),f=r(45),m=r(86),O=(r(560),function(e){var t=e.product,r=t.id,n=t.permalink,o=t.add_to_cart,a=t.has_options,s=t.is_purchasable,f=t.is_in_stock,m=Object(b.a)().dispatchStoreEvent,O=Object(p.a)(r),g=O.cartQuantity,j=O.addingToCart,h=O.addToCart,v=Number.isFinite(g)&&g>0,w=!a&&s&&f,y=Object(d.decodeEntities)((null==o?void 0:o.description)||""),E=v?Object(l.sprintf)(
/* translators: %s number of products in cart. */
Object(l._n)("%d in cart","%d in cart",g,'woocommerce'),g):Object(d.decodeEntities)((null==o?void 0:o.text)||Object(l.__)("Add to cart",'woocommerce')),_=w?"button":"a",k={};return w?k.onClick=function(){h(),m("cart-add-item",{product:t})}:(k.href=n,k.rel="nofollow",k.onClick=function(){m("product-view-link",{product:t})}),Object(i.createElement)(_,c()({"aria-label":y,className:u()("wp-block-button__link","add_to_cart_button","wc-block-components-product-button__button",{loading:j,added:v}),disabled:j},k),E)}),g=function(){return Object(i.createElement)("button",{className:u()("wp-block-button__link","add_to_cart_button","wc-block-components-product-button__button","wc-block-components-product-button__button--placeholder"),disabled:!0})};t.default=Object(m.withProductDataContext)((function(e){var t=e.className,r=Object(f.useInnerBlockLayoutContext)().parentClassName,n=Object(f.useProductDataContext)().product;return Object(i.createElement)("div",{className:u()(t,"wp-block-button","wc-block-components-product-button",a()({},"".concat(r,"__product-add-to-cart"),r))},n.id?Object(i.createElement)(O,{product:n}):Object(i.createElement)(g,null))}))},486:function(e,t,r){"use strict";r.r(t);var n=r(5),c=r.n(n),o=r(0),a=(r(2),r(6)),i=r.n(a),s=r(155),u=r(37),l=r(45),b=r(86);r(561),t.default=Object(b.withProductDataContext)((function(e){var t=e.className,r=Object(l.useInnerBlockLayoutContext)().parentClassName,n=Object(l.useProductDataContext)().product;if(!n)return Object(o.createElement)("div",{className:i()(t,"wc-block-components-product-summary",c()({},"".concat(r,"__product-summary"),r))});var a=n.short_description?n.short_description:n.description;return a?Object(o.createElement)(s.a,{className:i()(t,"wc-block-components-product-summary",c()({},"".concat(r,"__product-summary"),r)),source:a,maxLength:150,countType:u.o.wordCountType||"words"}):null}))},487:function(e,t,r){"use strict";r.r(t);var n=r(5),c=r.n(n),o=r(0),a=r(1),i=(r(2),r(6)),s=r.n(i),u=r(45),l=r(86);r(562),t.default=Object(l.withProductDataContext)((function(e){var t=e.className,r=Object(u.useInnerBlockLayoutContext)().parentClassName,n=Object(u.useProductDataContext)().product.sku;return n?Object(o.createElement)("div",{className:s()(t,"wc-block-components-product-sku",c()({},"".concat(r,"__product-sku"),r))},Object(a.__)("SKU:",'woocommerce')," ",Object(o.createElement)("strong",null,n)):null}))},488:function(e,t,r){"use strict";r.r(t);var n=r(5),c=r.n(n),o=r(0),a=r(1),i=(r(2),r(6)),s=r.n(i),u=r(45),l=r(7),b=r(86);r(563),t.default=Object(b.withProductDataContext)((function(e){var t=e.className,r=Object(u.useInnerBlockLayoutContext)().parentClassName,n=Object(u.useProductDataContext)().product;return Object(l.isEmpty)(n.categories)?null:Object(o.createElement)("div",{className:s()(t,"wc-block-components-product-category-list",c()({},"".concat(r,"__product-category-list"),r))},Object(a.__)("Categories:",'woocommerce')," ",Object(o.createElement)("ul",null,Object.values(n.categories).map((function(e){var t=e.name,r=e.link,n=e.slug;return Object(o.createElement)("li",{key:"category-list-item-".concat(n)},Object(o.createElement)("a",{href:r},t))}))))}))},489:function(e,t,r){"use strict";r.r(t);var n=r(5),c=r.n(n),o=r(0),a=r(1),i=(r(2),r(6)),s=r.n(i),u=r(45),l=r(7),b=r(86);r(564),t.default=Object(b.withProductDataContext)((function(e){var t=e.className,r=Object(u.useInnerBlockLayoutContext)().parentClassName,n=Object(u.useProductDataContext)().product;return Object(l.isEmpty)(n.tags)?null:Object(o.createElement)("div",{className:s()(t,"wc-block-components-product-tag-list",c()({},"".concat(r,"__product-tag-list"),r))},Object(a.__)("Tags:",'woocommerce')," ",Object(o.createElement)("ul",null,Object.values(n.tags).map((function(e){var t=e.name,r=e.link,n=e.slug;return Object(o.createElement)("li",{key:"tag-list-item-".concat(n)},Object(o.createElement)("a",{href:r},t))}))))}))},490:function(e,t,r){"use strict";r.r(t);var n=r(5),c=r.n(n),o=r(0),a=r(1),i=(r(2),r(6)),s=r.n(i),u=r(45),l=r(86),b=(r(565),function(e){return Object(a.sprintf)(
/* translators: %d stock amount (number of items in stock for product) */
Object(a.__)("%d left in stock",'woocommerce'),e)});t.default=Object(l.withProductDataContext)((function(e){var t,r=e.className,n=Object(u.useInnerBlockLayoutContext)().parentClassName,i=Object(u.useProductDataContext)().product;if(!i.id||!i.is_purchasable)return null;var l=!!i.is_in_stock,p=i.low_stock_remaining,d=i.is_on_backorder;return Object(o.createElement)("div",{className:s()(r,"wc-block-components-product-stock-indicator",(t={},c()(t,"".concat(n,"__stock-indicator"),n),c()(t,"wc-block-components-product-stock-indicator--in-stock",l),c()(t,"wc-block-components-product-stock-indicator--out-of-stock",!l),c()(t,"wc-block-components-product-stock-indicator--low-stock",!!p),c()(t,"wc-block-components-product-stock-indicator--available-on-backorder",!!d),t))},p?b(p):function(e,t){return t?Object(a.__)("Available on backorder",'woocommerce'):e?Object(a.__)("In Stock",'woocommerce'):Object(a.__)("Out of Stock",'woocommerce')}(l,d))}))},50:function(e,t,r){"use strict";r.d(t,"a",(function(){return s})),r.d(t,"b",(function(){return u})),r.d(t,"c",(function(){return b}));var n,c,o=r(72);!function(e){e.SUCCESS="success",e.FAIL="failure",e.ERROR="error"}(n||(n={})),function(e){e.PAYMENTS="wc/payment-area",e.EXPRESS_PAYMENTS="wc/express-payment-area"}(c||(c={}));var a=function(e,t){return Object(o.b)(e)&&"type"in e&&e.type===t},i=function(e){return a(e,n.SUCCESS)},s=function(e){return a(e,n.ERROR)},u=function(e){return a(e,n.FAIL)},l=function(e){return!Object(o.b)(e)||void 0===e.retry||!0===e.retry},b=function(){return{responseTypes:n,noticeContexts:c,shouldRetry:l,isSuccessResponse:i,isErrorResponse:s,isFailResponse:u}}},52:function(e,t,r){"use strict";var n=r(0),c=r(1),o=(r(2),r(48));t.a=function(e){var t,r,a,i=e.error;return Object(n.createElement)("div",{className:"wc-block-error-message"},(r=(t=i).message,a=t.type,r?"general"===a?Object(n.createElement)("span",null,Object(c.__)("The following error was returned",'woocommerce'),Object(n.createElement)("br",null),Object(n.createElement)("code",null,Object(o.escapeHTML)(r))):"api"===a?Object(n.createElement)("span",null,Object(c.__)("The following error was returned from the API",'woocommerce'),Object(n.createElement)("br",null),Object(n.createElement)("code",null,Object(o.escapeHTML)(r))):r:Object(c.__)("An unknown error occurred which prevented the block from being updated.",'woocommerce')))}},53:function(e,t,r){"use strict";var n=r(9),c=r.n(n),o=r(5),a=r.n(o),i=r(16),s=r.n(i),u=r(0),l=r(166),b=r(6),p=r.n(b),d=(r(175),["className","value","currency","onValueChange","displayType"]);function f(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function m(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?f(Object(r),!0).forEach((function(t){a()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):f(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}t.a=function(e){var t=e.className,r=e.value,n=e.currency,o=e.onValueChange,a=e.displayType,i=void 0===a?"text":a,b=s()(e,d),f="string"==typeof r?parseInt(r,10):r;if(!Number.isFinite(f))return null;var O=f/Math.pow(10,n.minorUnit);if(!Number.isFinite(O))return null;var g=p()("wc-block-formatted-money-amount","wc-block-components-formatted-money-amount",t),j=m(m(m({},b),function(e){return{thousandSeparator:e.thousandSeparator,decimalSeparator:e.decimalSeparator,decimalScale:e.minorUnit,fixedDecimalScale:!0,prefix:e.prefix,suffix:e.suffix,isNumericString:!0}}(n)),{},{value:void 0,currency:void 0,onValueChange:void 0}),h=o?function(e){var t=e.value*Math.pow(10,n.minorUnit);o(t)}:function(){};return Object(u.createElement)(l.a,c()({className:g,displayType:i},j,{value:O,onValueChange:h}))}},55:function(e,t){e.exports=window.wp.hooks},556:function(e,t){},557:function(e,t){},558:function(e,t){},559:function(e,t){},56:function(e,t){e.exports=window.wp.deprecated},560:function(e,t){},561:function(e,t){},562:function(e,t){},563:function(e,t){},564:function(e,t){},565:function(e,t){},566:function(e,t){},567:function(e,t,r){"use strict";var n=r(0),c=r(28),o=Object(n.createElement)(c.SVG,{xmlns:"http://www.w3.org/2000/SVG",viewBox:"0 0 24 24"},Object(n.createElement)("path",{fill:"none",d:"M0 0h24v24H0z"}),Object(n.createElement)("path",{d:"M9 16.2L4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4L9 16.2z"}));t.a=o},59:function(e,t,r){"use strict";r.d(t,"a",(function(){return u}));var n=r(5),c=r.n(n),o=r(0),a=r(141);function i(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function s(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?i(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):i(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var u=function(){var e=Object(a.b)(),t=e.notices,r=e.createNotice,n=e.removeNotice,c=e.setIsSuppressed,i=Object(o.useRef)(t);Object(o.useEffect)((function(){i.current=t}),[t]);var u=Object(o.useMemo)((function(){return{hasNoticesOfType:function(e){return i.current.some((function(t){return t.type===e}))},removeNotices:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;i.current.forEach((function(t){null!==e&&t.status!==e||n(t.id)}))},removeNotice:n}}),[n]),l=Object(o.useMemo)((function(){return{addDefaultNotice:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};r("default",e,s({},t))},addErrorNotice:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};r("error",e,s({},t))},addWarningNotice:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};r("warning",e,s({},t))},addInfoNotice:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};r("info",e,s({},t))},addSuccessNotice:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};r("success",e,s({},t))}}}),[r]);return s(s(s({notices:t},u),l),{},{setIsSuppressed:c})}},60:function(e,t){e.exports=window.wc.wcBlocksRegistry},62:function(e,t,r){"use strict";r.d(t,"a",(function(){return a}));var n=r(0),c=r(34),o=r.n(c);function a(e){var t=Object(n.useRef)(e);return o()(e,t.current)||(t.current=e),t.current}},63:function(e,t,r){"use strict";r.d(t,"b",(function(){return a})),r.d(t,"a",(function(){return i}));var n=r(0),c=r(14),o=Object(n.createContext)({isEditor:!1,currentPostId:0,previewData:{},getPreviewData:function(){}}),a=function(){return Object(n.useContext)(o)},i=function(e){var t=e.children,r=e.currentPostId,a=void 0===r?0:r,i=e.previewData,s=void 0===i?{}:i,u=Object(c.useSelect)((function(e){return a||e("core/editor").getCurrentPostId()}),[a]),l=Object(n.useCallback)((function(e){return e in s?s[e]:{}}),[s]),b={isEditor:!0,currentPostId:u,previewData:s,getPreviewData:l};return Object(n.createElement)(o.Provider,{value:b},t)}},64:function(e,t){e.exports=window.wp.a11y},66:function(e,t,r){"use strict";var n=r(5),c=r.n(n),o=r(16),a=r.n(o),i=r(0),s=["srcElement","size"];function u(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}t.a=function(e){var t=e.srcElement,r=e.size,n=void 0===r?24:r,o=a()(e,s);return Object(i.isValidElement)(t)?Object(i.cloneElement)(t,function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?u(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):u(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({width:n,height:n},o)):null}},68:function(e,t,r){"use strict";r.d(t,"a",(function(){return l}));var n=r(5),c=r.n(n),o=r(55),a=r(0),i=r(43);function s(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function u(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?s(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):s(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var l=function(){var e=Object(i.a)(),t=Object(a.useRef)(e);return Object(a.useEffect)((function(){t.current=e}),[e]),{dispatchStoreEvent:Object(a.useCallback)((function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};try{Object(o.doAction)("experimental__woocommerce_blocks-".concat(e),t)}catch(e){console.error(e)}}),[]),dispatchCheckoutEvent:Object(a.useCallback)((function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};try{Object(o.doAction)("experimental__woocommerce_blocks-checkout-".concat(e),u(u({},r),{},{storeCart:t.current}))}catch(e){console.error(e)}}),[])}}},7:function(e,t){e.exports=window.lodash},72:function(e,t,r){"use strict";r.d(t,"a",(function(){return n})),r.d(t,"c",(function(){return c})),r.d(t,"b",(function(){return o})),r.d(t,"d",(function(){return a}));var n=function(e){return"number"==typeof e},c=function(e){return"string"==typeof e},o=function(e){return!function(e){return null===e}(e)&&e instanceof Object&&e.constructor===Object};function a(e,t){return o(e)&&t in e}},74:function(e,t){e.exports=window.wp.dom},757:function(e,t,r){"use strict";var n=r(0),c=r(28),o=Object(n.createElement)(c.SVG,{xmlns:"http://www.w3.org/2000/SVG",viewBox:"0 0 24 24"},Object(n.createElement)("path",{fill:"none",d:"M0 0h24v24H0V0z"}),Object(n.createElement)("path",{d:"M20 6h-8l-2-2H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2zm0 12H4V8h16v10z"}));t.a=o},764:function(e,t,r){"use strict";var n=r(0),c=r(28),o=Object(n.createElement)(c.SVG,{xmlns:"http://www.w3.org/2000/SVG",viewBox:"0 0 24 24"},Object(n.createElement)("path",{fill:"none",d:"M0 0h24v24H0V0z"}),Object(n.createElement)("path",{d:"M21.41 11.58l-9-9C12.05 2.22 11.55 2 11 2H4c-1.1 0-2 .9-2 2v7c0 .55.22 1.05.59 1.42l9 9c.36.36.86.58 1.41.58s1.05-.22 1.41-.59l7-7c.37-.36.59-.86.59-1.41s-.23-1.06-.59-1.42zM13 20.01L4 11V4h7v-.01l9 9-7 7.02z"}),Object(n.createElement)("circle",{cx:"6.5",cy:"6.5",r:"1.5"}),Object(n.createElement)("path",{d:"M8.9 12.55c0 .57.23 1.07.6 1.45l3.5 3.5 3.5-3.5c.37-.37.6-.89.6-1.45 0-1.13-.92-2.05-2.05-2.05-.57 0-1.08.23-1.45.6l-.6.6-.6-.59c-.37-.38-.89-.61-1.45-.61-1.13 0-2.05.92-2.05 2.05z"}));t.a=o},772:function(e,t,r){"use strict";var n=r(0),c=r(28),o=Object(n.createElement)(c.SVG,{xmlns:"http://www.w3.org/2000/SVG",viewBox:"0 0 24 24"},Object(n.createElement)("path",{fill:"none",d:"M0 0h24v24H0V0z"}),Object(n.createElement)("path",{d:"M22 9.24l-7.19-.62L12 2 9.19 8.63 2 9.24l5.46 4.73L5.82 21 12 17.27 18.18 21l-1.63-7.03L22 9.24zM12 15.4l-3.76 2.27 1-4.28-3.32-2.88 4.38-.38L12 6.1l1.71 4.04 4.38.38-3.32 2.88 1 4.28L12 15.4z"}));t.a=o},773:function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));var n=r(1),c=r(37),o=[{id:1,name:"WordPress Pennant",variation:"",permalink:"https://example.org",sku:"wp-pennant",short_description:Object(n.__)("Fly your WordPress banner with this beauty! Deck out your office space or add it to your kids walls. This banner will spruce up any space it’s hung!",'woocommerce'),description:"Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.",price:"7.99",price_html:'<span class="woocommerce-Price-amount amount"><span class="woocommerce-Price-currencySymbol">$</span>7.99</span>',images:[{id:1,src:c.m+"previews/pennant.jpg",thumbnail:c.m+"previews/pennant.jpg",name:"pennant-1.jpg",alt:"WordPress Pennant",srcset:"",sizes:""}],average_rating:5,review_count:1,prices:{currency_code:"GBP",decimal_separator:".",thousand_separator:",",decimals:2,price_prefix:"£",price_suffix:"",price:"7.99",regular_price:"9.99",sale_price:"7.99",price_range:null},add_to_cart:{text:Object(n.__)("Add to cart",'woocommerce'),description:Object(n.__)("Add to cart",'woocommerce')},has_options:!1,is_purchasable:!0,is_in_stock:!0,on_sale:!0}]},778:function(e,t,r){"use strict";var n=r(0),c=r(28),o=Object(n.createElement)(c.SVG,{xmlns:"http://www.w3.org/2000/SVG",viewBox:"0 0 24 24"},Object(n.createElement)("path",{fill:"none",d:"M0 0h24v24H0V0z"}),Object(n.createElement)("path",{d:"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"}));t.a=o},78:function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));var n=r(0),c=Object(n.createContext)("page"),o=function(){return Object(n.useContext)(c)};c.Provider},785:function(e,t,r){e.exports=r(852)},786:function(e,t){},787:function(e,t){},788:function(e,t,r){"use strict";r.d(t,"a",(function(){return p}));var n=r(8),c=r.n(n),o=r(0),a=r(14),i=r(24),s=r(25),u=r(43),l=r(59),b=function(e,t){var r=e.find((function(e){return e.id===t}));return r?r.quantity:0},p=function(e){var t=Object(a.useDispatch)(i.CART_STORE_KEY).addItemToCart,r=Object(u.a)(),n=r.cartItems,p=r.cartIsLoading,d=Object(l.a)(),f=d.addErrorNotice,m=d.removeNotice,O=Object(o.useState)(!1),g=c()(O,2),j=g[0],h=g[1],v=Object(o.useRef)(b(n,e));return Object(o.useEffect)((function(){var t=b(n,e);t!==v.current&&(v.current=t)}),[n,e]),{cartQuantity:Number.isFinite(v.current)?v.current:0,addingToCart:j,cartIsLoading:p,addToCart:function(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;return h(!0),t(e,r).then((function(){m("add-to-cart")})).catch((function(e){f(Object(s.decodeEntities)(e.message),{context:"wc/all-products",id:"add-to-cart",isDismissible:!0})})).finally((function(){h(!1)}))}}}},789:function(e,t,r){"use strict";var n=r(0),c=r(28),o=Object(n.createElement)(c.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16"},Object(n.createElement)("g",{fill:"none",fillRule:"evenodd"},Object(n.createElement)("path",{stroke:"currentColor",strokeWidth:"1.5",d:"M2 .75h12c.69 0 1.25.56 1.25 1.25v12c0 .69-.56 1.25-1.25 1.25H2c-.69 0-1.25-.56-1.25-1.25V2C.75 1.31 1.31.75 2 .75z"}),Object(n.createElement)("path",{fill:"currentColor",d:"M12 6H4V4.75h8zM12 9H4V7.75h8zM10 12H4v-1.25h6z"})));t.a=o},790:function(e,t){},791:function(e,t){},792:function(e,t){},793:function(e,t){},852:function(e,t,r){"use strict";r.r(t),r.d(t,"blockSettings",(function(){return Br}));var n=r(5),c=r.n(n),o=r(9),a=r.n(o),i=r(0),s=r(1),u=r(12),l=r(26),b=r(66),p=r(28),d=Object(i.createElement)(p.SVG,{xmlns:"http://www.w3.org/2000/SVG",viewBox:"0 0 24 24"},Object(i.createElement)("path",{fill:"none",d:"M0 0h24v24H0V0z"}),Object(i.createElement)("path",{d:"M4 8h4V4H4v4zm6 12h4v-4h-4v4zm-6 0h4v-4H4v4zm0-6h4v-4H4v4zm6 0h4v-4h-4v4zm6-10v4h4V4h-4zm-6 4h4V4h-4v4zm6 6h4v-4h-4v4zm0 6h4v-4h-4v4z"})),f=r(159),m=r(6),O=r.n(m),g={category:"woocommerce-product-elements",keywords:[Object(s.__)("WooCommerce",'woocommerce')],icon:{src:Object(i.createElement)(b.a,{srcElement:d}),foreground:"#96588a"},supports:{html:!1},parent:Object(f.a)()?void 0:["@woocommerce/all-products","@woocommerce/single-product"],save:function(e){var t=e.attributes;return Object(i.createElement)("div",{className:O()("is-loading",t.className)})},deprecated:[{attributes:{},save:function(){return null}}]},j=r(373),h=r(4),v=r(21),w=r(133),y=r(378),E=r(8),_=r.n(E),k=r(149),P=r(16),C=r.n(P),S=(r(787),["className"]),x=function(e){var t=e.className,r=void 0===t?"":t,n=C()(e,S),c=O()("wc-block-text-toolbar-button",r);return Object(i.createElement)(h.Button,a()({className:c},n))},N=r(45),D=(r(786),function(e){return function(t){return function(r){var n=Object(N.useProductDataContext)(),c=r.attributes,o=r.setAttributes,a=c.productId,l=Object(i.useState)(!a),b=_()(l,2),p=b[0],d=b[1];return n.hasContext?Object(i.createElement)(t,r):Object(i.createElement)(i.Fragment,null,p?Object(i.createElement)(h.Placeholder,{icon:e.icon||"",label:e.label||"",className:"wc-atomic-blocks-product"},!!e.description&&Object(i.createElement)("div",null,e.description),Object(i.createElement)("div",{className:"wc-atomic-blocks-product__selection"},Object(i.createElement)(k.a,{selected:a||0,showVariations:!0,onChange:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];o({productId:e[0]?e[0].id:0})}}),Object(i.createElement)(h.Button,{isSecondary:!0,disabled:!a,onClick:function(){d(!1)}},Object(s.__)("Done",'woocommerce')))):Object(i.createElement)(i.Fragment,null,Object(i.createElement)(u.BlockControls,null,Object(i.createElement)(h.ToolbarGroup,null,Object(i.createElement)(x,{onClick:function(){return d(!0)}},Object(s.__)("Switch product…",'woocommerce')))),Object(i.createElement)(t,r)))}}}),B=Object(i.createElement)(p.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(i.createElement)("path",{fill:"none",d:"M0 0h24v24H0z"}),Object(i.createElement)("path",{d:"M17 3H7a2 2 0 00-2 2v16l7-3 7 3V5a2 2 0 00-2-2z"})),R=Object(s.__)("Product Title",'woocommerce'),T=Object(i.createElement)(b.a,{srcElement:B}),A=Object(s.__)("Display the title of a product.",'woocommerce'),I=function(e){var t=e.color,r=e.fontSize,n=e.setFontSize,c=e.setColor,o=e.attributes,a=e.setAttributes,l=o.headingLevel,b=o.showProductLink,p=o.align;return Object(i.createElement)(i.Fragment,null,Object(i.createElement)(u.BlockControls,null,Object(i.createElement)(w.a,{isCollapsed:!0,minLevel:1,maxLevel:7,selectedLevel:l,onChange:function(e){return a({headingLevel:e})}}),Object(f.b)()&&Object(i.createElement)(u.AlignmentToolbar,{value:p,onChange:function(e){a({align:e})}})),Object(i.createElement)(u.InspectorControls,null,Object(i.createElement)(h.PanelBody,{title:Object(s.__)("Content",'woocommerce')},Object(i.createElement)(h.ToggleControl,{label:Object(s.__)("Link to Product Page",'woocommerce'),help:Object(s.__)("Links the image to the single product listing.",'woocommerce'),checked:b,onChange:function(){return a({showProductLink:!b})}})),Object(f.b)()&&Object(i.createElement)(i.Fragment,null,Object(i.createElement)(h.PanelBody,{title:Object(s.__)("Text settings",'woocommerce')},Object(i.createElement)(u.FontSizePicker,{value:r.size,onChange:n})),Object(i.createElement)(u.PanelColorSettings,{title:Object(s.__)("Color settings",'woocommerce'),colorSettings:[{value:t.color,onChange:c,label:Object(s.__)("Text color",'woocommerce')}]}))),Object(i.createElement)(h.Disabled,null,Object(i.createElement)(y.a,o)))},L=Object(f.b)()?Object(v.compose)([Object(u.withFontSizes)("fontSize"),Object(u.withColors)("color",{textColor:"color"}),D({icon:T,label:R,description:Object(s.__)("Choose a product to display its title.",'woocommerce')})])(I):I;function z(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function V(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?z(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):z(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var F={title:R,description:A,icon:{src:T,foreground:"#874FB9"},attributes:j.a,edit:L};Object(l.registerBlockType)("woocommerce/product-title",V(V({},g),F));var M=r(482),H=r(303),q=Object(s.__)("Product Price",'woocommerce'),G=Object(i.createElement)(b.a,{srcElement:H.a}),Q=Object(s.__)("Display the price of a product.",'woocommerce'),Y=function(e){var t=e.fontSize,r=e.setFontSize,n=e.color,c=e.setColor,o=e.colorLabel;return Object(i.createElement)(i.Fragment,null,Object(i.createElement)(u.FontSizePicker,{value:t.size,onChange:r}),Object(i.createElement)(h.BaseControl,{label:o},Object(i.createElement)(u.ColorPalette,{value:n.color,onChange:c,label:Object(s.__)("Color")})))},U=function(e){var t=e.fontSize,r=e.saleFontSize,n=e.setFontSize,c=e.setSaleFontSize,o=e.color,a=e.saleColor,l=e.setColor,b=e.setSaleColor,p=e.attributes,d=e.setAttributes,m=p.align;return Object(i.createElement)(i.Fragment,null,Object(f.b)()&&Object(i.createElement)(u.BlockControls,null,Object(i.createElement)(u.AlignmentToolbar,{value:m,onChange:function(e){d({align:e})}})),Object(i.createElement)(u.InspectorControls,null,Object(f.b)()&&Object(i.createElement)(i.Fragment,null,Object(i.createElement)(h.PanelBody,{title:Object(s.__)("Price",'woocommerce')},Object(i.createElement)(Y,{color:o,setColor:l,fontSize:t,setFontSize:n,colorLabel:Object(s.__)("Color",'woocommerce')})),Object(i.createElement)(h.PanelBody,{title:Object(s.__)("Sale price",'woocommerce')},Object(i.createElement)(Y,{color:a,setColor:b,fontSize:r,setFontSize:c,colorLabel:Object(s.__)("Color",'woocommerce')})))),Object(i.createElement)(M.default,p))},W=Object(f.b)()?Object(v.compose)([Object(u.withFontSizes)("fontSize"),Object(u.withFontSizes)("saleFontSize"),Object(u.withFontSizes)("originalFontSize"),Object(u.withColors)("color",{textColor:"color"}),Object(u.withColors)("saleColor",{textColor:"saleColor"}),Object(u.withColors)("originalColor",{textColor:"originalColor"}),D({icon:G,label:q,description:Object(s.__)("Choose a product to display its price.",'woocommerce')})])(U):U;function K(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function $(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?K(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):K(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var J={productId:{type:"number",default:0}};function X(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Z(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?X(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):X(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}Object(f.b)()&&(J=$($({},J),{},{align:{type:"string"},fontSize:{type:"string"},customFontSize:{type:"number"},saleFontSize:{type:"string"},customSaleFontSize:{type:"number"},color:{type:"string"},saleColor:{type:"string"},customColor:{type:"string"},customSaleColor:{type:"string"}}));var ee={title:q,description:Q,icon:{src:G,foreground:"#874FB9"},attributes:J,edit:W};Object(l.registerBlockType)("woocommerce/product-price",Z(Z({},g),ee));var te=r(374),re=r(88),ne=r(3),ce=r(375),oe=Object(i.createElement)(p.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(i.createElement)("path",{fill:"none",d:"M0 0h24v24H0V0z"}),Object(i.createElement)("path",{d:"M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-4.86 8.86l-3 3.87L9 13.14 6 17h12l-3.86-5.14z"})),ae=Object(s.__)("Product Image",'woocommerce'),ie=Object(i.createElement)(b.a,{srcElement:oe}),se=Object(s.__)("Display the main product image",'woocommerce'),ue=D({icon:ie,label:ae,description:Object(s.__)("Choose a product to display its image.",'woocommerce')})((function(e){var t=e.attributes,r=e.setAttributes,n=t.showProductLink,c=t.imageSizing,o=t.showSaleBadge,a=t.saleBadgeAlign;return Object(i.createElement)(i.Fragment,null,Object(i.createElement)(u.InspectorControls,null,Object(i.createElement)(h.PanelBody,{title:Object(s.__)("Content",'woocommerce')},Object(i.createElement)(h.ToggleControl,{label:Object(s.__)("Link to Product Page",'woocommerce'),help:Object(s.__)("Links the image to the single product listing.",'woocommerce'),checked:n,onChange:function(){return r({showProductLink:!n})}}),Object(i.createElement)(h.ToggleControl,{label:Object(s.__)("Show On-Sale Badge",'woocommerce'),help:Object(s.__)('Overlay a "sale" badge if the product is on-sale.','woocommerce'),checked:o,onChange:function(){return r({showSaleBadge:!o})}}),o&&Object(i.createElement)(re.a,{label:Object(s.__)("Sale Badge Alignment",'woocommerce'),value:a,options:[{label:Object(s.__)("Left",'woocommerce'),value:"left"},{label:Object(s.__)("Center",'woocommerce'),value:"center"},{label:Object(s.__)("Right",'woocommerce'),value:"right"}],onChange:function(e){return r({saleBadgeAlign:e})}}),Object(i.createElement)(re.a,{label:Object(s.__)("Image Sizing",'woocommerce'),help:Object(i.createInterpolateElement)(Object(s.__)("Product image cropping can be modified in the <a>Customizer</a>.",'woocommerce'),{a:Object(i.createElement)("a",{href:"".concat(Object(ne.getAdminLink)("customize.php"),"?autofocus[panel]=woocommerce&autofocus[section]=woocommerce_product_images"),target:"_blank",rel:"noopener noreferrer"})}),value:c,options:[{label:Object(s.__)("Full Size",'woocommerce'),value:"full-size"},{label:Object(s.__)("Cropped",'woocommerce'),value:"cropped"}],onChange:function(e){return r({imageSizing:e})}}))),Object(i.createElement)(h.Disabled,null,Object(i.createElement)(ce.a,t)))}));function le(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function be(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?le(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):le(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var pe={title:ae,description:se,icon:{src:ie,foreground:"#874FB9"},attributes:te.a,edit:ue};Object(l.registerBlockType)("woocommerce/product-image",be(be({},g),pe));var de=r(483),fe=r(772),me=Object(s.__)("Product Rating",'woocommerce'),Oe=Object(i.createElement)(b.a,{srcElement:fe.a});function ge(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function je(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ge(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ge(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var he={title:me,description:Object(s.__)("Display the average rating of a product.",'woocommerce'),icon:{src:Oe,foreground:"#874FB9"},attributes:{productId:{type:"number",default:0}},edit:D({icon:Oe,label:me,description:Object(s.__)("Choose a product to display its rating.",'woocommerce')})((function(e){var t=e.attributes;return Object(i.createElement)(de.default,t)}))};Object(l.registerBlockType)("woocommerce/product-rating",je(je({},g),he));var ve=r(484),we=r(361),ye=Object(s.__)("Add to Cart Button",'woocommerce'),Ee=Object(i.createElement)(b.a,{srcElement:we.a});function _e(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function ke(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?_e(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):_e(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Pe={title:ye,description:Object(s.__)("Display a call to action button which either adds the product to the cart, or links to the product page.",'woocommerce'),icon:{src:Ee,foreground:"#874FB9"},attributes:{productId:{type:"number",default:0}},edit:D({icon:Ee,label:ye,description:Object(s.__)("Choose a product to display its add to cart button.",'woocommerce')})((function(e){var t=e.attributes;return Object(i.createElement)(h.Disabled,null,Object(i.createElement)(ve.default,t))}))};Object(l.registerBlockType)("woocommerce/product-button",ke(ke({},g),Pe));var Ce=r(486),Se=r(789),xe=Object(s.__)("Product Summary",'woocommerce'),Ne=Object(i.createElement)(b.a,{srcElement:Se.a});function De(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Be(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?De(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):De(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Re={title:xe,description:Object(s.__)("Display a short description about a product.",'woocommerce'),icon:{src:Ne,foreground:"#874FB9"},attributes:{productId:{type:"number",default:0}},edit:D({icon:Ne,label:xe,description:Object(s.__)("Choose a product to display its short description.",'woocommerce')})((function(e){var t=e.attributes;return Object(i.createElement)(Ce.default,t)}))};Object(l.registerBlockType)("woocommerce/product-summary",Be(Be({},g),Re));var Te=r(304),Ae=r(764),Ie=Object(s.__)("On-Sale Badge",'woocommerce'),Le=Object(i.createElement)(b.a,{srcElement:Ae.a});function ze(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Ve(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ze(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ze(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Fe={title:Ie,description:Object(s.__)("Displays an on-sale badge if the product is on-sale.",'woocommerce'),icon:{src:Le,foreground:"#874FB9"},supports:{html:!1},attributes:{productId:{type:"number",default:0}},edit:D({icon:Le,label:Ie,description:Object(s.__)("Choose a product to display its sale-badge.",'woocommerce')})((function(e){var t=e.attributes;return Object(i.createElement)(Te.default,t)}))};Object(l.registerBlockType)("woocommerce/product-sale-badge",Ve(Ve({},g),Fe));var Me=r(143),He=r(487),qe=Object(i.createElement)(p.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(i.createElement)("path",{d:"M2 6h2v12H2V6m3 0h1v12H5V6m2 0h3v12H7V6m4 0h1v12h-1V6m3 0h2v12h-2V6m3 0h3v12h-3V6m4 0h1v12h-1V6z"})),Ge=Object(s.__)("Product SKU",'woocommerce'),Qe=Object(i.createElement)(b.a,{srcElement:qe});function Ye(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Ue(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Ye(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ye(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var We={title:Ge,description:Object(s.__)("Display the SKU of a product.",'woocommerce'),icon:{src:Qe,foreground:"#874FB9"},attributes:{productId:{type:"number",default:0}},edit:D({icon:Qe,label:Ge,description:Object(s.__)("Choose a product to display its SKU.",'woocommerce')})((function(e){var t=e.attributes;return Object(i.createElement)(i.Fragment,null,Object(i.createElement)(Me.a,null),Object(i.createElement)(He.default,t))}))};Object(f.c)("woocommerce/product-sku",Ue(Ue({},g),We));var Ke=r(488),$e=r(757),Je=Object(s.__)("Product Category List",'woocommerce'),Xe=Object(i.createElement)(b.a,{srcElement:$e.a});function Ze(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function et(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Ze(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ze(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var tt={title:Je,description:Object(s.__)("Display a list of categories belonging to a product.",'woocommerce'),icon:{src:Xe,foreground:"#874FB9"},attributes:{productId:{type:"number",default:0}},edit:D({icon:Xe,label:Je,description:Object(s.__)("Choose a product to display its categories.",'woocommerce')})((function(e){var t=e.attributes;return Object(i.createElement)(i.Fragment,null,Object(i.createElement)(Me.a,null),Object(i.createElement)(h.Disabled,null,Object(i.createElement)(Ke.default,t)))}))};Object(f.c)("woocommerce/product-category-list",et(et({},g),tt));var rt=r(489),nt=Object(s.__)("Product Tag List",'woocommerce'),ct=Object(i.createElement)(b.a,{srcElement:Ae.a});function ot(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function at(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ot(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ot(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var it={title:nt,description:Object(s.__)("Display a list of tags belonging to a product.",'woocommerce'),icon:{src:ct,foreground:"#874FB9"},attributes:{productId:{type:"number",default:0}},edit:D({icon:ct,label:nt,description:Object(s.__)("Choose a product to display its tags.",'woocommerce')})((function(e){var t=e.attributes;return Object(i.createElement)(i.Fragment,null,Object(i.createElement)(Me.a,null),Object(i.createElement)(h.Disabled,null,Object(i.createElement)(rt.default,t)))}))};Object(f.c)("woocommerce/product-tag-list",at(at({},g),it));var st=r(490),ut=Object(i.createElement)(p.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(i.createElement)("g",{fillRule:"evenodd"},Object(i.createElement)("path",{d:"M0 0h24v24H0z",fill:"none"}),Object(i.createElement)("path",{fillRule:"nonzero",d:"M20.5 5.2l-1.4-1.7C19 3.3 18.5 3 18 3H6c-.5 0-.9.2-1.2.5L3.5 5.3A2 2 0 003 6.5V19c0 1.1.9 2 2 2h14a2 2 0 002-2V6.5c0-.5-.2-1-.5-1.3zM6.2 5h11.6l.8 1H5.4l.8-1zM5 19V8h14v11H5z"}))),lt=Object(s.__)("Product Stock Indicator",'woocommerce'),bt=Object(i.createElement)(b.a,{srcElement:ut});function pt(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function dt(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?pt(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):pt(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var ft={title:lt,description:Object(s.__)("Display product stock status.",'woocommerce'),icon:{src:bt,foreground:"#874FB9"},attributes:{productId:{type:"number",default:0}},edit:D({icon:bt,label:lt,description:Object(s.__)("Choose a product to display its stock.",'woocommerce')})((function(e){var t=e.attributes;return Object(i.createElement)(i.Fragment,null,Object(i.createElement)(Me.a,null),Object(i.createElement)(st.default,t))}))};Object(f.c)("woocommerce/product-stock-indicator",dt(dt({},g),ft));var mt=r(879),Ot=(r(372),r(377)),gt=Object(s.__)("Add to Cart",'woocommerce'),jt=Object(i.createElement)(b.a,{srcElement:we.a});function ht(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function vt(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ht(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ht(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var wt={title:gt,description:Object(s.__)("Displays an add to cart button. Optionally displays other add to cart form elements.",'woocommerce'),icon:{src:jt,foreground:"#874FB9"},edit:D({icon:jt,label:gt,description:Object(s.__)("Choose a product to display its add to cart form.",'woocommerce')})((function(e){var t=e.attributes,r=e.setAttributes,n=Object(N.useProductDataContext)().product,c=t.className,o=t.showFormElements;return Object(i.createElement)("div",{className:O()(c,"wc-block-components-product-add-to-cart")},Object(i.createElement)(Me.a,{productId:n.id}),Object(i.createElement)(u.InspectorControls,null,Object(i.createElement)(h.PanelBody,{title:Object(s.__)("Layout",'woocommerce')},Object(mt.b)(n)?Object(i.createElement)(h.ToggleControl,{label:Object(s.__)("Display form elements",'woocommerce'),help:Object(s.__)("Depending on product type, allow customers to select a quantity, variations etc.",'woocommerce'),checked:o,onChange:function(){return r({showFormElements:!o})}}):Object(i.createElement)(h.Notice,{className:"wc-block-components-product-add-to-cart-notice",isDismissible:!1,status:"info"},Object(s.__)("This product does not support the block based add to cart form. A link to the product page will be shown instead.",'woocommerce')))),Object(i.createElement)(h.Disabled,null,Object(i.createElement)(Ot.a,t)))})),attributes:r(376).a};Object(f.c)("woocommerce/product-add-to-cart",vt(vt({},g),wt));var yt=r(17),Et=r.n(yt),_t=r(13),kt=r.n(_t),Pt=r(19),Ct=r.n(Pt),St=r(20),xt=r.n(St),Nt=r(10),Dt=r.n(Nt),Bt=r(14),Rt=(r(2),r(93)),Tt=r(877),At=r(773),It=r(37),Lt=function(e,t){var r=t.className,n=t.contentVisibility;return O()(e,r,{"has-image":n&&n.image,"has-title":n&&n.title,"has-rating":n&&n.rating,"has-price":n&&n.price,"has-button":n&&n.button})},zt=r(158),Vt=function(e,t){return Object(i.createElement)(h.Placeholder,{className:"wc-block-products",icon:t,label:e},Object(i.createElement)("p",null,Object(s.__)("You haven't published any products to list here yet.",'woocommerce')),Object(i.createElement)(h.Button,{className:"wc-block-products__add-product-button",isSecondary:!0,href:ne.ADMIN_URL+"post-new.php?post_type=product"},Object(s.__)("Add new product",'woocommerce')+" ",Object(i.createElement)(b.a,{srcElement:zt.a})),Object(i.createElement)(h.Button,{className:"wc-block-products__read_more_button",isTertiary:!0,href:"https://docs.woocommerce.com/document/managing-products/"},Object(s.__)("Learn more",'woocommerce')))},Ft=function(e,t){return Object(i.createElement)(h.Placeholder,{className:"wc-block-products",icon:t,label:e},Object(s.__)("The content for this block is hidden due to block settings.",'woocommerce'))};function Mt(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Ht(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Mt(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Mt(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var qt=[["woocommerce/product-image"],["woocommerce/product-title"],["woocommerce/product-price"],["woocommerce/product-rating"],["woocommerce/product-button"]],Gt=function e(t){return t&&0!==t.length?t.map((function(t){return[t.name,Ht(Ht({},t.attributes),{},{product:void 0,children:t.innerBlocks.length>0?e(t.innerBlocks):[]})]})):[]};function Qt(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Yt(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Qt(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Qt(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Ut=function(e,t){var r=e.contentVisibility;return Object(i.createElement)(h.ToggleControl,{label:Object(s.__)("Show Sorting Dropdown",'woocommerce'),checked:r.orderBy,onChange:function(){return t({contentVisibility:Yt(Yt({},r),{},{orderBy:!r.orderBy})})}})},Wt=function(e,t){return Object(i.createElement)(h.SelectControl,{label:Object(s.__)("Order Products By",'woocommerce'),value:e.orderby,options:[{label:Object(s.__)("Default sorting (menu order)",'woocommerce'),value:"menu_order"},{label:Object(s.__)("Popularity",'woocommerce'),value:"popularity"},{label:Object(s.__)("Average rating",'woocommerce'),value:"rating"},{label:Object(s.__)("Latest",'woocommerce'),value:"date"},{label:Object(s.__)("Price: low to high",'woocommerce'),value:"price"},{label:Object(s.__)("Price: high to low",'woocommerce'),value:"price-desc"}],onChange:function(e){return t({orderby:e})}})},Kt=r(18),$t=r.n(Kt),Jt=r(11),Xt=r(7),Zt=r(41),er=(r(793),function(e){var t=e.currentPage,r=e.displayFirstAndLastPages,n=e.displayNextAndPreviousArrows,c=e.pagesToDisplay,o=e.onPageChange,a=e.totalPages,u=function(e,t,r){if(r<=2)return{minIndex:null,maxIndex:null};var n=e-1,c=Math.max(Math.floor(t-n/2),2),o=Math.min(Math.ceil(t+(n-(t-c))),r-1);return{minIndex:Math.max(Math.floor(t-(n-(o-t))),2),maxIndex:o}}(c,t,a),l=u.minIndex,b=u.maxIndex,p=r&&Boolean(1!==l),d=r&&Boolean(b!==a),f=r&&Boolean(l>3),m=r&&Boolean(b<a-2);p&&3===l&&(l-=1),d&&b===a-2&&(b+=1);var g=[];if(l&&b)for(var j=l;j<=b;j++)g.push(j);return Object(i.createElement)("div",{className:"wc-block-pagination wc-block-components-pagination"},Object(i.createElement)(Zt.a,{screenReaderLabel:Object(s.__)("Navigate to another page",'woocommerce')}),n&&Object(i.createElement)("button",{className:"wc-block-pagination-page wc-block-components-pagination__page wc-block-components-pagination-page--arrow",onClick:function(){return o(t-1)},title:Object(s.__)("Previous page",'woocommerce'),disabled:t<=1},Object(i.createElement)(Zt.a,{label:"←",screenReaderLabel:Object(s.__)("Previous page",'woocommerce')})),p&&Object(i.createElement)("button",{className:O()("wc-block-pagination-page","wc-block-components-pagination__page",{"wc-block-pagination-page--active":1===t,"wc-block-components-pagination__page--active":1===t}),onClick:function(){return o(1)},disabled:1===t},Object(i.createElement)(Zt.a,{label:1,screenReaderLabel:Object(s.sprintf)(
/* translators: %d is the page number (1, 2, 3...). */
Object(s.__)("Page %d",'woocommerce'),1)})),f&&Object(i.createElement)("span",{className:"wc-block-pagination-ellipsis wc-block-components-pagination__ellipsis","aria-hidden":"true"},Object(s.__)("…",'woocommerce')),g.map((function(e){return Object(i.createElement)("button",{key:e,className:O()("wc-block-pagination-page","wc-block-components-pagination__page",{"wc-block-pagination-page--active":t===e,"wc-block-components-pagination__page--active":t===e}),onClick:t===e?null:function(){return o(e)},disabled:t===e},Object(i.createElement)(Zt.a,{label:e,screenReaderLabel:Object(s.sprintf)(
/* translators: %d is the page number (1, 2, 3...). */
Object(s.__)("Page %d",'woocommerce'),e)}))})),m&&Object(i.createElement)("span",{className:"wc-block-pagination-ellipsis wc-block-components-pagination__ellipsis","aria-hidden":"true"},Object(s.__)("…",'woocommerce')),d&&Object(i.createElement)("button",{className:O()("wc-block-pagination-page","wc-block-components-pagination__page",{"wc-block-pagination-page--active":t===a,"wc-block-components-pagination__page--active":t===a}),onClick:function(){return o(a)},disabled:t===a},Object(i.createElement)(Zt.a,{label:a,screenReaderLabel:Object(s.sprintf)(
/* translators: %d is the page number (1, 2, 3...). */
Object(s.__)("Page %d",'woocommerce'),a)})),n&&Object(i.createElement)("button",{className:"wc-block-pagination-page wc-block-components-pagination__page wc-block-components-pagination-page--arrow",onClick:function(){return o(t+1)},title:Object(s.__)("Next page",'woocommerce'),disabled:t>=a},Object(i.createElement)(Zt.a,{label:"→",screenReaderLabel:Object(s.__)("Next page",'woocommerce')})))});er.defaultProps={displayFirstAndLastPages:!0,displayNextAndPreviousArrows:!0,pagesToDisplay:3};var tr=er,rr=r(136),nr=r(108),cr=r(165),or=r(24),ar=r(62);function ir(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function sr(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ir(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ir(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var ur=r(68),lr=r(277),br=r(64),pr=r(150),dr=function(){var e=Object(N.useInnerBlockLayoutContext)().parentClassName;return Object(i.createElement)("div",{className:"".concat(e,"__no-products")},Object(i.createElement)(b.a,{className:"".concat(e,"__no-products-image"),alt:"",srcElement:pr.a,size:100}),Object(i.createElement)("strong",{className:"".concat(e,"__no-products-title")},Object(s.__)("No products",'woocommerce')),Object(i.createElement)("p",{className:"".concat(e,"__no-products-description")},Object(s.__)("There are currently no products available to display.",'woocommerce')))},fr=r(778),mr=function(e){var t=e.resetCallback,r=void 0===t?function(){}:t,n=Object(N.useInnerBlockLayoutContext)().parentClassName;return Object(i.createElement)("div",{className:"".concat(n,"__no-products")},Object(i.createElement)(b.a,{className:"".concat(n,"__no-products-image"),alt:"",srcElement:fr.a,size:100}),Object(i.createElement)("strong",{className:"".concat(n,"__no-products-title")},Object(s.__)("No products found",'woocommerce')),Object(i.createElement)("p",{className:"".concat(n,"__no-products-description")},Object(s.__)("We were unable to find any results based on your search.",'woocommerce')),Object(i.createElement)("button",{onClick:r},Object(s.__)("Reset Search",'woocommerce')))},Or=r(156),gr=(r(792),function(e){var t=e.onChange,r=e.readOnly,n=e.value;return Object(i.createElement)(Or.a,{className:"wc-block-product-sort-select wc-block-components-product-sort-select",name:"orderby",onChange:t,options:[{key:"menu_order",label:Object(s.__)("Default sorting",'woocommerce')},{key:"popularity",label:Object(s.__)("Popularity",'woocommerce')},{key:"rating",label:Object(s.__)("Average rating",'woocommerce')},{key:"date",label:Object(s.__)("Latest",'woocommerce')},{key:"price",label:Object(s.__)("Price: low to high",'woocommerce')},{key:"price-desc",label:Object(s.__)("Price: high to low",'woocommerce')}],readOnly:r,screenReaderLabel:Object(s.__)("Order products by",'woocommerce'),value:n})}),jr=Object(v.withInstanceId)((function(e){var t=e.product,r=e.attributes,n=e.instanceId,c=r.layoutConfig,o=Object(N.useInnerBlockLayoutContext)(),s=o.parentClassName,u=o.parentName,l=0===Object.keys(t).length,b=O()("".concat(s,"__product"),"wc-block-layout",{"is-loading":l});return Object(i.createElement)("li",{className:b,"aria-hidden":l},function e(t,r,n,c){if(n){var o=Object(Tt.a)(t);return n.map((function(n,s){var u=_()(n,2),l=u[0],b=u[1],p=void 0===b?{}:b,d=[];p.children&&p.children.length>0&&(d=e(t,r,p.children,c));var f=o[l];if(!f)return null;var m=r.id||0,O=["layout",l,s,c,m];return Object(i.createElement)(i.Suspense,{key:O.join("_"),fallback:Object(i.createElement)("div",{className:"wc-block-placeholder"})},Object(i.createElement)(f,a()({},p,{children:d,product:r})))}))}}(u,t,c,n))})),hr=(r(791),["order","orderby","page","per_page"]);function vr(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function wr(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?vr(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):vr(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var yr=function(e){var t=e.totalQuery,r=e.totalProducts,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},c=n.totalQuery;return!Object(Xt.isEqual)(t,c)&&Number.isFinite(r)},Er=Object(lr.a)((function(e){var t,r=e.attributes,n=e.currentPage,c=e.onPageChange,o=e.onSortChange,a=e.sortValue,u=e.scrollToTop,l=Object(nr.b)("attributes",[]),b=_()(l,2),p=b[0],d=b[1],f=Object(nr.b)("stock_status",[]),m=_()(f,2),g=m[0],j=m[1],h=Object(nr.b)("min_price"),v=_()(h,2),w=v[0],y=v[1],E=Object(nr.b)("max_price"),k=_()(E,2),P=k[0],S=k[1],x=Object(nr.c)(function(e){var t=e.sortValue,r=e.currentPage,n=e.attributes,c=n.columns,o=n.rows;return wr(wr({},function(e){switch(e){case"menu_order":case"popularity":case"rating":case"price":return{orderby:e,order:"asc"};case"price-desc":return{orderby:"price",order:"desc"};case"date":return{orderby:"date",order:"desc"}}}(t)),{},{catalog_visibility:"catalog",per_page:c*o,page:r})}({attributes:r,sortValue:a,currentPage:n})),D=_()(x,1)[0],B=function(e){var t={namespace:"/wc/store",resourceName:"products"},r=Object(cr.a)(sr(sr({},t),{},{query:e})),n=r.results,c=r.isLoading,o=function(e,t){var r=t.namespace,n=t.resourceName,c=t.resourceValues,o=void 0===c?[]:c,a=t.query,i=void 0===a?{}:a;if(!r||!n)throw new Error("The options object must have valid values for the namespace and the resource name properties.");var s=Object(ar.a)(i),u=Object(ar.a)(o),l=Object(Bt.useSelect)((function(e){var t=e(or.COLLECTIONS_STORE_KEY),c=["x-wp-total",r,n,s,u];return{value:t.getCollectionHeader.apply(t,c),isLoading:t.hasFinishedResolution("getCollectionHeader",c)}}),["x-wp-total",r,n,u,s]),b=l.value,p=l.isLoading;return{value:b,isLoading:void 0===p||p}}(0,sr(sr({},t),{},{query:e})).value;return{products:n,totalProducts:parseInt(o,10),productsLoading:c}}(D),R=B.products,T=B.totalProducts,A=B.productsLoading,I=Object(N.useInnerBlockLayoutContext)(),L=I.parentClassName,z=I.parentName,V=((t=D).order,t.orderby,t.page,t.per_page,C()(t,hr)||{}),F=Object(ur.a)().dispatchStoreEvent,M=Object(rr.a)({totalQuery:V,totalProducts:T},yr);Object(i.useEffect)((function(){F("product-list-render",{products:R,listName:z})}),[R,z,F]),Object(i.useEffect)((function(){Object(Xt.isEqual)(V,null==M?void 0:M.totalQuery)||(c(1),null!=M&&M.totalQuery&&function(e){Number.isFinite(e)&&(0===e?Object(br.speak)(Object(s.__)("No products found",'woocommerce')):Object(br.speak)(Object(s.sprintf)(
/* translators: %s is an integer higher than 0 (1, 2, 3...) */
Object(s._n)("%d product found","%d products found",e,'woocommerce'),e)))}(T))}),[null==M?void 0:M.totalQuery,T,c,V]);var H,q,G,Q,Y,U=r.contentVisibility,W=r.columns*r.rows,K=!Number.isFinite(T)&&Number.isFinite(null==M?void 0:M.totalProducts)&&Object(Xt.isEqual)(V,null==M?void 0:M.totalQuery)?Math.ceil(M.totalProducts/W):Math.ceil(T/W),$=R.length?R:Array.from({length:W}),J=0!==R.length||A,X=p.length>0||g.length>0||Number.isFinite(w)||Number.isFinite(P);return Object(i.createElement)("div",{className:(H=r.columns,q=r.rows,G=r.alignButtons,Q=r.align,Y=void 0!==Q?"align"+Q:"",O()(L,Y,"has-"+H+"-columns",{"has-multiple-rows":q>1,"has-aligned-buttons":G}))},U.orderBy&&J&&Object(i.createElement)(gr,{onChange:o,value:a}),!J&&X&&Object(i.createElement)(mr,{resetCallback:function(){d([]),j([]),y(null),S(null)}}),!J&&!X&&Object(i.createElement)(dr,null),J&&Object(i.createElement)("ul",{className:"".concat(L,"__products")},$.map((function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return Object(i.createElement)(jr,{key:e.id||t,attributes:r,product:e})}))),K>1&&Object(i.createElement)(tr,{currentPage:n,onPageChange:function(e){u({focusableSelector:"a, button"}),c(e)},totalPages:K}))})),_r=function(e){var t=e.attributes,r=Object(i.useState)(1),n=_()(r,2),c=n[0],o=n[1],a=Object(i.useState)(t.orderby),s=_()(a,2),u=s[0],l=s[1];return Object(i.useEffect)((function(){l(t.orderby)}),[t.orderby]),Object(i.createElement)(Er,{attributes:t,currentPage:c,onPageChange:function(e){o(e)},onSortChange:function(e){var t=e.target.value;l(t),o(1)},sortValue:u})},kr=r(188);var Pr=function(e){Ct()(c,e);var t,r,n=(t=c,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,n=Dt()(t);if(r){var c=Dt()(this).constructor;e=Reflect.construct(n,arguments,c)}else e=n.apply(this,arguments);return xt()(this,e)});function c(){return Et()(this,c),n.apply(this,arguments)}return $t()(c,[{key:"render",value:function(){var e=this.props,t=e.attributes,r=e.urlParameterSuffix;return t.isPreview?kr.a:Object(i.createElement)(N.InnerBlockLayoutContextProvider,{parentName:"woocommerce/all-products",parentClassName:"wc-block-grid"},Object(i.createElement)(_r,{attributes:t,urlParameterSuffix:r}))}}]),c}(Jt.Component);r(790);var Cr=function(e){Ct()(o,e);var t,r,n=(t=o,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,n=Dt()(t);if(r){var c=Dt()(this).constructor;e=Reflect.construct(n,arguments,c)}else e=n.apply(this,arguments);return xt()(this,e)});function o(){var e;Et()(this,o);for(var t=arguments.length,r=new Array(t),a=0;a<t;a++)r[a]=arguments[a];return e=n.call.apply(n,[this].concat(r)),c()(kt()(e),"state",{isEditing:!1,innerBlocks:[]}),c()(kt()(e),"blockMap",Object(Tt.a)("woocommerce/all-products")),c()(kt()(e),"componentDidMount",(function(){var t=e.props.block;e.setState({innerBlocks:t.innerBlocks})})),c()(kt()(e),"getTitle",(function(){return Object(s.__)("All Products",'woocommerce')})),c()(kt()(e),"getIcon",(function(){return Object(i.createElement)(b.a,{srcElement:d})})),c()(kt()(e),"togglePreview",(function(){var t=e.props.debouncedSpeak;e.setState({isEditing:!e.state.isEditing}),e.state.isEditing||t(Object(s.__)("Showing All Products block preview.",'woocommerce'))})),c()(kt()(e),"getInspectorControls",(function(){var t=e.props,r=t.attributes,n=t.setAttributes,c=r.columns,o=r.rows,a=r.alignButtons;return Object(i.createElement)(u.InspectorControls,{key:"inspector"},Object(i.createElement)(h.PanelBody,{title:Object(s.__)("Layout Settings",'woocommerce'),initialOpen:!0},Object(i.createElement)(Rt.a,{columns:c,rows:o,alignButtons:a,setAttributes:n,minColumns:Object(ne.getSetting)("min_columns",1),maxColumns:Object(ne.getSetting)("max_columns",6),minRows:Object(ne.getSetting)("min_rows",1),maxRows:Object(ne.getSetting)("max_rows",6)})),Object(i.createElement)(h.PanelBody,{title:Object(s.__)("Content Settings",'woocommerce')},Ut(r,n),Wt(r,n)))})),c()(kt()(e),"getBlockControls",(function(){var t=e.state.isEditing;return Object(i.createElement)(u.BlockControls,null,Object(i.createElement)(h.ToolbarGroup,{controls:[{icon:"edit",title:Object(s.__)("Edit",'woocommerce'),onClick:function(){return e.togglePreview()},isActive:t}]}))})),c()(kt()(e),"renderEditMode",(function(){var t={template:e.props.attributes.layoutConfig,templateLock:!1,allowedBlocks:Object.keys(e.blockMap)};return 0!==e.props.attributes.layoutConfig.length&&(t.renderAppender=!1),Object(i.createElement)(h.Placeholder,{icon:e.getIcon(),label:e.getTitle()},Object(s.__)("Display all products from your store as a grid.",'woocommerce'),Object(i.createElement)("div",{className:"wc-block-all-products-grid-item-template"},Object(i.createElement)(h.Tip,null,Object(s.__)("Edit the blocks inside the preview below to change the content displayed for each product within the product grid.",'woocommerce')),Object(i.createElement)(N.InnerBlockLayoutContextProvider,{parentName:"woocommerce/all-products",parentClassName:"wc-block-grid"},Object(i.createElement)("div",{className:"wc-block-grid wc-block-layout has-1-columns"},Object(i.createElement)("ul",{className:"wc-block-grid__products"},Object(i.createElement)("li",{className:"wc-block-grid__product"},Object(i.createElement)(N.ProductDataContextProvider,{product:At.a[0]},Object(i.createElement)(u.InnerBlocks,t)))))),Object(i.createElement)("div",{className:"wc-block-all-products__actions"},Object(i.createElement)(h.Button,{className:"wc-block-all-products__done-button",isPrimary:!0,onClick:function(){var t=e.props,r=t.block;(0,t.setAttributes)({layoutConfig:Gt(r.innerBlocks)}),e.setState({innerBlocks:r.innerBlocks}),e.togglePreview()}},Object(s.__)("Done",'woocommerce')),Object(i.createElement)(h.Button,{className:"wc-block-all-products__cancel-button",isTertiary:!0,onClick:function(){var t=e.props,r=t.block,n=t.replaceInnerBlocks,c=e.state.innerBlocks;n(r.clientId,c,!1),e.togglePreview()}},Object(s.__)("Cancel",'woocommerce')),Object(i.createElement)(h.Button,{className:"wc-block-all-products__reset-button",icon:Object(i.createElement)(b.a,{srcElement:d}),label:Object(s.__)("Reset layout to default",'woocommerce'),onClick:function(){var t=e.props,r=t.block,n=t.replaceInnerBlocks,c=[];qt.map((function(e){var t=_()(e,2),r=t[0],n=t[1];return c.push(Object(l.createBlock)(r,n)),!0})),n(r.clientId,c,!1),e.setState({innerBlocks:r.innerBlocks})}},Object(s.__)("Reset Layout",'woocommerce')))))})),c()(kt()(e),"renderViewMode",(function(){var t=e.props.attributes,r=t.layoutConfig,n=r&&0!==r.length,c=e.getTitle(),o=e.getIcon();return n?Object(i.createElement)(h.Disabled,null,Object(i.createElement)(Pr,{attributes:t})):Ft(c,o)})),c()(kt()(e),"render",(function(){var t=e.props.attributes,r=e.state.isEditing,n=e.getTitle(),c=e.getIcon();return 0===It.o.productCount?Vt(n,c):Object(i.createElement)("div",{className:Lt("wc-block-all-products",t)},e.getBlockControls(),e.getInspectorControls(),r?e.renderEditMode():e.renderViewMode())})),e}return o}(i.Component),Sr=Object(v.compose)(h.withSpokenMessages,Object(Bt.withSelect)((function(e,t){var r=t.clientId;return{block:(0,e("core/block-editor").getBlock)(r)}})),Object(Bt.withDispatch)((function(e){return{replaceInnerBlocks:e("core/block-editor").replaceInnerBlocks}})))(Cr),xr={columns:Object(ne.getSetting)("default_columns",3),rows:Object(ne.getSetting)("default_rows",3),alignButtons:!1,contentVisibility:{orderBy:!0},orderby:"date",layoutConfig:qt,isPreview:!1};function Nr(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Dr(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Nr(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Nr(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Br={title:Object(s.__)("All Products",'woocommerce'),icon:{src:Object(i.createElement)(b.a,{srcElement:d}),foreground:"#96588a"},category:"woocommerce",keywords:[Object(s.__)("WooCommerce",'woocommerce')],description:Object(s.__)("Display products from your store in a grid layout.",'woocommerce'),supports:{align:["wide","full"],html:!1,multiple:!1},example:{attributes:{isPreview:!0}},attributes:{columns:{type:"number"},rows:{type:"number"},alignButtons:{type:"boolean"},contentVisibility:{type:"object"},orderby:{type:"string"},layoutConfig:{type:"array"},isPreview:{type:"boolean",default:!1}},defaults:xr,edit:function(e){return Object(i.createElement)(Sr,e)},save:function(e){var t=e.attributes,r={};Object.keys(t).sort().forEach((function(e){r[e]=t[e]}));var n={"data-attributes":JSON.stringify(r)};return Object(i.createElement)("div",a()({className:Lt("wc-block-all-products",t)},n),Object(i.createElement)(u.InnerBlocks.Content,null))}};Object(l.registerBlockType)("woocommerce/all-products",Dr(Dr({},Br),{},{deprecated:[{attributes:Object.assign({},Br.attributes,{rows:{type:"number",default:1}}),save:function(e){var t=e.attributes,r={"data-attributes":JSON.stringify(t)};return Object(i.createElement)("div",a()({className:Lt("wc-block-all-products",t)},r),Object(i.createElement)(u.InnerBlocks.Content,null))}}]}))},86:function(e,t){e.exports=window.wc.wcBlocksSharedHocs},87:function(e,t){e.exports=window.ReactDOM},877:function(e,t,r){"use strict";r.d(t,"a",(function(){return a}));var n=r(60),c=r(0),o=r(37);r.p=o.l,Object(n.registerBlockComponent)({blockName:"woocommerce/product-price",component:Object(c.lazy)((function(){return Promise.all([r.e(0),r.e(12)]).then(r.bind(null,482))}))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-image",component:Object(c.lazy)((function(){return Promise.all([r.e(1),r.e(2),r.e(4),r.e(11)]).then(r.bind(null,901))}))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-title",component:Object(c.lazy)((function(){return Promise.all([r.e(1),r.e(2),r.e(18)]).then(r.bind(null,902))}))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-rating",component:Object(c.lazy)((function(){return r.e(13).then(r.bind(null,483))}))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-button",component:Object(c.lazy)((function(){return Promise.all([r.e(0),r.e(1),r.e(3),r.e(9)]).then(r.bind(null,484))}))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-summary",component:Object(c.lazy)((function(){return r.e(16).then(r.bind(null,486))}))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-sale-badge",component:Object(c.lazy)((function(){return r.e(4).then(r.bind(null,304))}))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-sku",component:Object(c.lazy)((function(){return r.e(14).then(r.bind(null,487))}))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-category-list",component:Object(c.lazy)((function(){return r.e(10).then(r.bind(null,488))}))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-tag-list",component:Object(c.lazy)((function(){return r.e(17).then(r.bind(null,489))}))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-stock-indicator",component:Object(c.lazy)((function(){return r.e(15).then(r.bind(null,490))}))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-add-to-cart",component:Object(c.lazy)((function(){return Promise.all([r.e(0),r.e(1),r.e(2),r.e(3),r.e(8)]).then(r.bind(null,903))}))});var a=function(e){return Object(n.getRegisteredBlockComponents)(e)}},879:function(e,t,r){"use strict";r.d(t,"a",(function(){return n})),r.d(t,"b",(function(){return c}));var n=function(e){return e.is_purchasable||!1},c=function(e){return["simple","variable"].includes(e.type||"simple")}},88:function(e,t,r){"use strict";var n=r(9),c=r.n(n),o=r(17),a=r.n(o),i=r(18),s=r.n(i),u=r(13),l=r.n(u),b=r(19),p=r.n(b),d=r(20),f=r.n(d),m=r(10),O=r.n(m),g=r(0),j=r(7),h=r(6),v=r.n(h),w=r(4),y=r(21);r(123);var E=function(e){p()(o,e);var t,r,n=(t=o,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,n=O()(t);if(r){var c=O()(this).constructor;e=Reflect.construct(n,arguments,c)}else e=n.apply(this,arguments);return f()(this,e)});function o(){var e;return a()(this,o),(e=n.apply(this,arguments)).onClick=e.onClick.bind(l()(e)),e}return s()(o,[{key:"onClick",value:function(e){this.props.onChange&&this.props.onChange(e.target.value)}},{key:"render",value:function(){var e,t=this,r=this.props,n=r.label,o=r.checked,a=r.instanceId,i=r.className,s=r.help,u=r.options,l=r.value,b="inspector-toggle-button-control-".concat(a);return s&&(e=Object(j.isFunction)(s)?s(o):s),Object(g.createElement)(w.BaseControl,{id:b,help:e,className:v()("components-toggle-button-control",i)},Object(g.createElement)("label",{id:b+"__label",htmlFor:b,className:"components-toggle-button-control__label"},n),Object(g.createElement)(w.ButtonGroup,{"aria-labelledby":b+"__label"},u.map((function(e,r){var o={};return l===e.value?(o.isPrimary=!0,o["aria-pressed"]=!0):(o.isSecondary=!0,o["aria-pressed"]=!1),Object(g.createElement)(w.Button,c()({key:"".concat(e.label,"-").concat(e.value,"-").concat(r),value:e.value,onClick:t.onClick,"aria-label":n+": "+e.label},o),e.label)}))))}}]),o}(g.Component);t.a=Object(y.withInstanceId)(E)},89:function(e,t){e.exports=window.wp.viewport},90:function(e,t,r){"use strict";var n=r(9),c=r.n(n),o=r(16),a=r.n(o),i=r(0),s=r(182),u=r(6),l=r.n(u),b=r(114),p=(r(208),["className","showSpinner","children"]);t.a=function(e){var t=e.className,r=e.showSpinner,n=void 0!==r&&r,o=e.children,u=a()(e,p),d=l()("wc-block-components-button",t,{"wc-block-components-button--loading":n});return Object(i.createElement)(s.a,c()({className:d},u),n&&Object(i.createElement)(b.a,null),Object(i.createElement)("span",{className:"wc-block-components-button__text"},o))}},91:function(e,t){e.exports=window.wp.autop},93:function(e,t,r){"use strict";var n=r(0),c=r(1),o=r(7),a=(r(2),r(4));t.a=function(e){var t=e.columns,r=e.rows,i=e.setAttributes,s=e.alignButtons,u=e.minColumns,l=void 0===u?1:u,b=e.maxColumns,p=void 0===b?6:b,d=e.minRows,f=void 0===d?1:d,m=e.maxRows,O=void 0===m?6:m;return Object(n.createElement)(n.Fragment,null,Object(n.createElement)(a.RangeControl,{label:Object(c.__)("Columns",'woocommerce'),value:t,onChange:function(e){var t=Object(o.clamp)(e,l,p);i({columns:Number.isNaN(t)?"":t})},min:l,max:p}),Object(n.createElement)(a.RangeControl,{label:Object(c.__)("Rows",'woocommerce'),value:r,onChange:function(e){var t=Object(o.clamp)(e,f,O);i({rows:Number.isNaN(t)?"":t})},min:f,max:O}),Object(n.createElement)(a.ToggleControl,{label:Object(c.__)("Align Last Block",'woocommerce'),help:s?Object(c.__)("The last inner block will be aligned vertically.",'woocommerce'):Object(c.__)("The last inner block will follow other content.",'woocommerce'),checked:s,onChange:function(){return i({alignButtons:!s})}}))}},96:function(e,t){e.exports=window.wp.date}});woocommerce-blocks/build/wc-payment-method-bacs.asset.php000064400000000260151335517640017544 0ustar00<?php return array('dependencies' => array('wc-blocks-registry', 'wc-settings', 'wp-html-entities', 'wp-i18n', 'wp-polyfill'), 'version' => '4157eddd876399854f3f0af50c53769e');woocommerce-blocks/build/featured-product.asset.php000064400000000744151335517640016560 0ustar00<?php return array('dependencies' => array('lodash', 'moment', 'react', 'react-dom', 'wc-settings', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-data-controls', 'wp-date', 'wp-deprecated', 'wp-dom', 'wp-element', 'wp-escape-html', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-is-shallow-equal', 'wp-keycodes', 'wp-polyfill', 'wp-primitives', 'wp-url', 'wp-viewport'), 'version' => 'ba881493779203d777be169740cc6ff9');woocommerce-blocks/build/product-category.js000064400000076206151335517640015313 0ustar00this.wc=this.wc||{},this.wc.blocks=this.wc.blocks||{},this.wc.blocks["product-category"]=function(e){function t(t){for(var n,i,a=t[0],l=t[1],u=t[2],b=0,d=[];b<a.length;b++)i=a[b],Object.prototype.hasOwnProperty.call(c,i)&&c[i]&&d.push(c[i][0]),c[i]=0;for(n in l)Object.prototype.hasOwnProperty.call(l,n)&&(e[n]=l[n]);for(s&&s(t);d.length;)d.shift()();return o.push.apply(o,u||[]),r()}function r(){for(var e,t=0;t<o.length;t++){for(var r=o[t],n=!0,a=1;a<r.length;a++){var l=r[a];0!==c[l]&&(n=!1)}n&&(o.splice(t--,1),e=i(i.s=r[0]))}return e}var n={},c={30:0},o=[];function i(t){if(n[t])return n[t].exports;var r=n[t]={i:t,l:!1,exports:{}};return e[t].call(r.exports,r,r.exports,i),r.l=!0,r.exports}i.m=e,i.c=n,i.d=function(e,t,r){i.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},i.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.t=function(e,t){if(1&t&&(e=i(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(i.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)i.d(r,n,function(t){return e[t]}.bind(null,n));return r},i.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(t,"a",t),t},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.p="";var a=window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[],l=a.push.bind(a);a.push=t,a=a.slice();for(var u=0;u<a.length;u++)t(a[u]);var s=l;return o.push([755,0]),r()}({0:function(e,t){e.exports=window.wp.element},1:function(e,t){e.exports=window.wp.i18n},107:function(e,t,r){"use strict";r.d(t,"b",(function(){return c}));var n=r(3),c=["woocommerce/product-best-sellers","woocommerce/product-category","woocommerce/product-new","woocommerce/product-on-sale","woocommerce/product-top-rated"];t.a={columns:{type:"number",default:Object(n.getSetting)("default_columns",3)},rows:{type:"number",default:Object(n.getSetting)("default_rows",3)},alignButtons:{type:"boolean",default:!1},categories:{type:"array",default:[]},catOperator:{type:"string",default:"any"},contentVisibility:{type:"object",default:{title:!0,price:!0,rating:!0,button:!0}},isPreview:{type:"boolean",default:!1}}},11:function(e,t){e.exports=window.React},12:function(e,t){e.exports=window.wp.blockEditor},121:function(e,t){},122:function(e,t){e.exports=window.wp.coreData},130:function(e,t,r){"use strict";var n=r(0),c=r(1),o=r(4);r(2),t.a=function(e){var t=e.value,r=e.setAttributes;return Object(n.createElement)(o.SelectControl,{label:Object(c.__)("Order products by",'woocommerce'),value:t,options:[{label:Object(c.__)("Newness - newest first",'woocommerce'),value:"date"},{label:Object(c.__)("Price - low to high",'woocommerce'),value:"price_asc"},{label:Object(c.__)("Price - high to low",'woocommerce'),value:"price_desc"},{label:Object(c.__)("Rating - highest first",'woocommerce'),value:"rating"},{label:Object(c.__)("Sales - most first",'woocommerce'),value:"popularity"},{label:Object(c.__)("Title - alphabetical",'woocommerce'),value:"title"},{label:Object(c.__)("Menu Order",'woocommerce'),value:"menu_order"}],onChange:function(e){return r({orderby:e})}})}},139:function(e,t){},14:function(e,t){e.exports=window.wp.data},15:function(e,t){e.exports=window.wp.apiFetch},188:function(e,t,r){"use strict";r.d(t,"a",(function(){return c}));var n=r(0),c=Object(n.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 230 250",style:{width:"100%"}},Object(n.createElement)("title",null,"Grid Block Preview"),Object(n.createElement)("rect",{width:"65.374",height:"65.374",x:".162",y:".779",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"47.266",height:"5.148",x:"9.216",y:"76.153",fill:"#E1E3E6",rx:"2.574"}),Object(n.createElement)("rect",{width:"62.8",height:"15",x:"1.565",y:"101.448",fill:"#E1E3E6",rx:"5"}),Object(n.createElement)("rect",{width:"65.374",height:"65.374",x:".162",y:"136.277",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"47.266",height:"5.148",x:"9.216",y:"211.651",fill:"#E1E3E6",rx:"2.574"}),Object(n.createElement)("rect",{width:"62.8",height:"15",x:"1.565",y:"236.946",fill:"#E1E3E6",rx:"5"}),Object(n.createElement)("rect",{width:"65.374",height:"65.374",x:"82.478",y:".779",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"47.266",height:"5.148",x:"91.532",y:"76.153",fill:"#E1E3E6",rx:"2.574"}),Object(n.createElement)("rect",{width:"62.8",height:"15",x:"83.882",y:"101.448",fill:"#E1E3E6",rx:"5"}),Object(n.createElement)("rect",{width:"65.374",height:"65.374",x:"82.478",y:"136.277",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"47.266",height:"5.148",x:"91.532",y:"211.651",fill:"#E1E3E6",rx:"2.574"}),Object(n.createElement)("rect",{width:"62.8",height:"15",x:"83.882",y:"236.946",fill:"#E1E3E6",rx:"5"}),Object(n.createElement)("rect",{width:"65.374",height:"65.374",x:"164.788",y:".779",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"47.266",height:"5.148",x:"173.843",y:"76.153",fill:"#E1E3E6",rx:"2.574"}),Object(n.createElement)("rect",{width:"62.8",height:"15",x:"166.192",y:"101.448",fill:"#E1E3E6",rx:"5"}),Object(n.createElement)("rect",{width:"65.374",height:"65.374",x:"164.788",y:"136.277",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"47.266",height:"5.148",x:"173.843",y:"211.651",fill:"#E1E3E6",rx:"2.574"}),Object(n.createElement)("rect",{width:"62.8",height:"15",x:"166.192",y:"236.946",fill:"#E1E3E6",rx:"5"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"13.283",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"21.498",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"29.713",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"37.927",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"46.238",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"95.599",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"103.814",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"112.029",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"120.243",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"128.554",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"177.909",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"186.124",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"194.339",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"202.553",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"210.864",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"13.283",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"21.498",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"29.713",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"37.927",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"46.238",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"95.599",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"103.814",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"112.029",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"120.243",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"128.554",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"177.909",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"186.124",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"194.339",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"202.553",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"210.864",y:"221.798",fill:"#E1E3E6",rx:"3"}))},21:function(e,t){e.exports=window.wp.compose},22:function(e,t){e.exports=window.regeneratorRuntime},23:function(e,t){e.exports=window.wp.url},25:function(e,t){e.exports=window.wp.htmlEntities},26:function(e,t){e.exports=window.wp.blocks},28:function(e,t){e.exports=window.wp.primitives},3:function(e,t){e.exports=window.wc.wcSettings},31:function(e,t){e.exports=window.moment},36:function(e,t){e.exports=window.wp.dataControls},37:function(e,t,r){"use strict";r.d(t,"o",(function(){return o})),r.d(t,"m",(function(){return i})),r.d(t,"l",(function(){return a})),r.d(t,"n",(function(){return l})),r.d(t,"j",(function(){return u})),r.d(t,"e",(function(){return s})),r.d(t,"f",(function(){return b})),r.d(t,"g",(function(){return d})),r.d(t,"k",(function(){return p})),r.d(t,"c",(function(){return g})),r.d(t,"d",(function(){return f})),r.d(t,"h",(function(){return h})),r.d(t,"a",(function(){return w})),r.d(t,"i",(function(){return O})),r.d(t,"b",(function(){return E}));var n,c=r(3),o=Object(c.getSetting)("wcBlocksConfig",{buildPhase:1,pluginUrl:"",productCount:0,defaultAvatar:"",restApiRoutes:{},wordCountType:"words"}),i=o.pluginUrl+"images/",a=o.pluginUrl+"build/",l=o.buildPhase,u=null===(n=c.STORE_PAGES.shop)||void 0===n?void 0:n.permalink,s=c.STORE_PAGES.checkout.id,b=c.STORE_PAGES.checkout.permalink,d=c.STORE_PAGES.privacy.permalink,p=(c.STORE_PAGES.privacy.title,c.STORE_PAGES.terms.permalink),g=(c.STORE_PAGES.terms.title,c.STORE_PAGES.cart.id),f=c.STORE_PAGES.cart.permalink,h=(c.STORE_PAGES.myaccount.permalink?c.STORE_PAGES.myaccount.permalink:Object(c.getSetting)("wpLoginUrl","/wp-login.php"),Object(c.getSetting)("shippingCountries",{})),w=Object(c.getSetting)("allowedCountries",{}),O=Object(c.getSetting)("shippingStates",{}),E=Object(c.getSetting)("allowedStates",{})},39:function(e,t,r){"use strict";r.d(t,"h",(function(){return p})),r.d(t,"e",(function(){return g})),r.d(t,"b",(function(){return f})),r.d(t,"i",(function(){return h})),r.d(t,"f",(function(){return w})),r.d(t,"c",(function(){return O})),r.d(t,"d",(function(){return E})),r.d(t,"g",(function(){return m})),r.d(t,"a",(function(){return j}));var n=r(5),c=r.n(n),o=r(23),i=r(15),a=r.n(i),l=r(7),u=r(3),s=r(37);function b(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function d(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?b(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):b(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var p=function(e){var t=e.selected,r=void 0===t?[]:t,n=e.search,c=void 0===n?"":n,i=e.queryArgs,u=function(e){var t=e.selected,r=void 0===t?[]:t,n=e.search,c=void 0===n?"":n,i=e.queryArgs,a=void 0===i?{}:i,l=s.o.productCount>100,u={per_page:l?100:0,catalog_visibility:"any",search:c,orderby:"title",order:"asc"},b=[Object(o.addQueryArgs)("/wc/store/products",d(d({},u),a))];return l&&r.length&&b.push(Object(o.addQueryArgs)("/wc/store/products",{catalog_visibility:"any",include:r,per_page:0})),b}({selected:r,search:c,queryArgs:void 0===i?{}:i});return Promise.all(u.map((function(e){return a()({path:e})}))).then((function(e){return Object(l.uniqBy)(Object(l.flatten)(e),"id").map((function(e){return d(d({},e),{},{parent:0})}))})).catch((function(e){throw e}))},g=function(e){return a()({path:"/wc/store/products/".concat(e)})},f=function(){return a()({path:"wc/store/products/attributes"})},h=function(e){return a()({path:"wc/store/products/attributes/".concat(e,"/terms")})},w=function(e){var t=e.selected,r=function(e){var t=e.selected,r=void 0===t?[]:t,n=e.search,c=Object(u.getSetting)("limitTags",!1),i=[Object(o.addQueryArgs)("wc/store/products/tags",{per_page:c?100:0,orderby:c?"count":"name",order:c?"desc":"asc",search:n})];return c&&r.length&&i.push(Object(o.addQueryArgs)("wc/store/products/tags",{include:r})),i}({selected:void 0===t?[]:t,search:e.search});return Promise.all(r.map((function(e){return a()({path:e})}))).then((function(e){return Object(l.uniqBy)(Object(l.flatten)(e),"id")}))},O=function(e){return a()({path:Object(o.addQueryArgs)("wc/store/products/categories",d({per_page:0},e))})},E=function(e){return a()({path:"wc/store/products/categories/".concat(e)})},m=function(e){return a()({path:Object(o.addQueryArgs)("wc/store/products",{per_page:0,type:"variation",parent:e})})},j=function(e,t){if(!e.title.raw)return e.slug;var r=1===t.filter((function(t){return t.title.raw===e.title.raw})).length;return e.title.raw+(r?"":" - ".concat(e.slug))}},4:function(e,t){e.exports=window.wp.components},42:function(e,t,r){"use strict";r.d(t,"a",(function(){return l})),r.d(t,"b",(function(){return u}));var n=r(29),c=r.n(n),o=r(22),i=r.n(o),a=r(1),l=function(){var e=c()(i.a.mark((function e(t){var r;return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("function"!=typeof t.json){e.next=11;break}return e.prev=1,e.next=4,t.json();case 4:return r=e.sent,e.abrupt("return",{message:r.message,type:r.type||"api"});case 8:return e.prev=8,e.t0=e.catch(1),e.abrupt("return",{message:e.t0.message,type:"general"});case 11:return e.abrupt("return",{message:t.message,type:t.type||"general"});case 12:case"end":return e.stop()}}),e,null,[[1,8]])})));return function(_x){return e.apply(this,arguments)}}(),u=function(e){if(e.data&&"rest_invalid_param"===e.code){var t=Object.values(e.data.params);if(t[0])return t[0]}return(null==e?void 0:e.message)||Object(a.__)("Something went wrong. Please contact us to get assistance.",'woocommerce')}},46:function(e,t){e.exports=window.wp.keycodes},48:function(e,t){e.exports=window.wp.escapeHtml},52:function(e,t,r){"use strict";var n=r(0),c=r(1),o=(r(2),r(48));t.a=function(e){var t,r,i,a=e.error;return Object(n.createElement)("div",{className:"wc-block-error-message"},(r=(t=a).message,i=t.type,r?"general"===i?Object(n.createElement)("span",null,Object(c.__)("The following error was returned",'woocommerce'),Object(n.createElement)("br",null),Object(n.createElement)("code",null,Object(o.escapeHTML)(r))):"api"===i?Object(n.createElement)("span",null,Object(c.__)("The following error was returned from the API",'woocommerce'),Object(n.createElement)("br",null),Object(n.createElement)("code",null,Object(o.escapeHTML)(r))):r:Object(c.__)("An unknown error occurred which prevented the block from being updated.",'woocommerce')))}},55:function(e,t){e.exports=window.wp.hooks},56:function(e,t){e.exports=window.wp.deprecated},66:function(e,t,r){"use strict";var n=r(5),c=r.n(n),o=r(16),i=r.n(o),a=r(0),l=["srcElement","size"];function u(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}t.a=function(e){var t=e.srcElement,r=e.size,n=void 0===r?24:r,o=i()(e,l);return Object(a.isValidElement)(t)?Object(a.cloneElement)(t,function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?u(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):u(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({width:n,height:n},o)):null}},7:function(e,t){e.exports=window.lodash},74:function(e,t){e.exports=window.wp.dom},755:function(e,t,r){e.exports=r(874)},756:function(e,t){},757:function(e,t,r){"use strict";var n=r(0),c=r(28),o=Object(n.createElement)(c.SVG,{xmlns:"http://www.w3.org/2000/SVG",viewBox:"0 0 24 24"},Object(n.createElement)("path",{fill:"none",d:"M0 0h24v24H0V0z"}),Object(n.createElement)("path",{d:"M20 6h-8l-2-2H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2zm0 12H4V8h16v10z"}));t.a=o},84:function(e,t){e.exports=window.wp.serverSideRender},87:function(e,t){e.exports=window.ReactDOM},874:function(e,t,r){"use strict";r.r(t);var n=r(5),c=r.n(n),o=r(0),i=r(1),a=r(26),l=r(7),u=r(66),s=r(757),b=(r(756),r(17)),d=r.n(b),p=r(18),g=r.n(p),f=r(13),h=r.n(f),w=r(19),O=r.n(w),E=r(20),m=r.n(E),j=r(10),y=r.n(j),v=r(12),_=r(84),x=r.n(_),k=r(4),P=(r(2),r(92)),C=r(93),S=r(97),A=r(130),R=r(188),T=r(3);function B(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function D(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?B(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):B(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var M=function(){return Object(o.createElement)(k.Placeholder,{icon:Object(o.createElement)(u.a,{srcElement:s.a}),label:Object(i.__)("Products by Category",'woocommerce'),className:"wc-block-products-grid wc-block-products-category"},Object(i.__)("No products were found that matched your selection.",'woocommerce'))},N=function(e){O()(a,e);var t,r,n=(t=a,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,n=y()(t);if(r){var c=y()(this).constructor;e=Reflect.construct(n,arguments,c)}else e=n.apply(this,arguments);return m()(this,e)});function a(){var e;d()(this,a);for(var t=arguments.length,r=new Array(t),o=0;o<t;o++)r[o]=arguments[o];return e=n.call.apply(n,[this].concat(r)),c()(h()(e),"state",{changedAttributes:{},isEditing:!1}),c()(h()(e),"startEditing",(function(){e.setState({isEditing:!0,changedAttributes:{}})})),c()(h()(e),"stopEditing",(function(){e.setState({isEditing:!1,changedAttributes:{}})})),c()(h()(e),"setChangedAttributes",(function(t){e.setState((function(e){return{changedAttributes:D(D({},e.changedAttributes),t)}}))})),c()(h()(e),"save",(function(){var t=e.state.changedAttributes;(0,e.props.setAttributes)(t),e.stopEditing()})),e}return g()(a,[{key:"componentDidMount",value:function(){this.props.attributes.categories.length||this.setState({isEditing:!0})}},{key:"getInspectorControls",value:function(){var e=this,t=this.props,r=t.attributes,n=t.setAttributes,c=this.state.isEditing,a=r.columns,l=r.catOperator,u=r.contentVisibility,s=r.orderby,b=r.rows,d=r.alignButtons;return Object(o.createElement)(v.InspectorControls,{key:"inspector"},Object(o.createElement)(k.PanelBody,{title:Object(i.__)("Product Category",'woocommerce'),initialOpen:!r.categories.length&&!c},Object(o.createElement)(S.a,{selected:r.categories,onChange:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],r=t.map((function(e){return e.id})),c={categories:r};n(c),e.setChangedAttributes(c)},operator:l,onOperatorChange:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"any",r={catOperator:t};n(r),e.setChangedAttributes(r)},isCompact:!0})),Object(o.createElement)(k.PanelBody,{title:Object(i.__)("Layout",'woocommerce'),initialOpen:!0},Object(o.createElement)(C.a,{columns:a,rows:b,alignButtons:d,setAttributes:n,minColumns:Object(T.getSetting)("min_columns",1),maxColumns:Object(T.getSetting)("max_columns",6),minRows:Object(T.getSetting)("min_rows",1),maxRows:Object(T.getSetting)("max_rows",6)})),Object(o.createElement)(k.PanelBody,{title:Object(i.__)("Content",'woocommerce'),initialOpen:!0},Object(o.createElement)(P.a,{settings:u,onChange:function(e){return n({contentVisibility:e})}})),Object(o.createElement)(k.PanelBody,{title:Object(i.__)("Order By",'woocommerce'),initialOpen:!1},Object(o.createElement)(A.a,{setAttributes:n,value:s})))}},{key:"renderEditMode",value:function(){var e=this,t=this.props,r=t.attributes,n=t.debouncedSpeak,c=this.state.changedAttributes,a=D(D({},r),c);return Object(o.createElement)(k.Placeholder,{icon:Object(o.createElement)(u.a,{srcElement:s.a}),label:Object(i.__)("Products by Category",'woocommerce'),className:"wc-block-products-grid wc-block-products-category"},Object(i.__)("Display a grid of products from your selected categories.",'woocommerce'),Object(o.createElement)("div",{className:"wc-block-products-category__selection"},Object(o.createElement)(S.a,{selected:a.categories,onChange:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],r=t.map((function(e){return e.id}));e.setChangedAttributes({categories:r})},operator:a.catOperator,onOperatorChange:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"any";return e.setChangedAttributes({catOperator:t})}}),Object(o.createElement)(k.Button,{isPrimary:!0,onClick:function(){e.save(),n(Object(i.__)("Showing Products by Category block preview.",'woocommerce'))}},Object(i.__)("Done",'woocommerce')),Object(o.createElement)(k.Button,{className:"wc-block-products-category__cancel-button",isTertiary:!0,onClick:function(){e.stopEditing(),n(Object(i.__)("Showing Products by Category block preview.",'woocommerce'))}},Object(i.__)("Cancel",'woocommerce'))))}},{key:"renderViewMode",value:function(){var e=this.props,t=e.attributes,r=e.name,n=t.categories.length;return Object(o.createElement)(k.Disabled,null,n?Object(o.createElement)(x.a,{block:r,attributes:t,EmptyResponsePlaceholder:M}):Object(i.__)("Select at least one category to display its products.",'woocommerce'))}},{key:"render",value:function(){var e=this,t=this.state.isEditing;return this.props.attributes.isPreview?R.a:Object(o.createElement)(o.Fragment,null,Object(o.createElement)(v.BlockControls,null,Object(o.createElement)(k.ToolbarGroup,{controls:[{icon:"edit",title:Object(i.__)("Edit"),onClick:function(){return t?e.stopEditing():e.startEditing()},isActive:t}]})),this.getInspectorControls(),t?this.renderEditMode():this.renderViewMode())}}]),a}(o.Component),G=Object(k.withSpokenMessages)(N),V=r(107);function L(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function H(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?L(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):L(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}Object(a.registerBlockType)("woocommerce/product-category",{title:Object(i.__)("Products by Category",'woocommerce'),icon:{src:Object(o.createElement)(u.a,{srcElement:s.a}),foreground:"#96588a"},category:"woocommerce",keywords:[Object(i.__)("WooCommerce",'woocommerce')],description:Object(i.__)("Display a grid of products from your selected categories.",'woocommerce'),supports:{align:["wide","full"],html:!1},example:{attributes:{isPreview:!0}},attributes:H(H({},V.a),{},{editMode:{type:"boolean",default:!0},orderby:{type:"string",default:"date"}}),transforms:{from:[{type:"block",blocks:Object(l.without)(V.b,"woocommerce/product-category"),transform:function(e){return Object(a.createBlock)("woocommerce/product-category",H(H({},e),{},{editMode:!1}))}}]},edit:function(e){return Object(o.createElement)(G,e)},save:function(){return null}})},89:function(e,t){e.exports=window.wp.viewport},92:function(e,t,r){"use strict";var n=r(5),c=r.n(n),o=r(0),i=r(1),a=(r(2),r(4));function l(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function u(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?l(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):l(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}t.a=function(e){var t=e.onChange,r=e.settings,n=r.button,c=r.price,l=r.rating,s=r.title;return Object(o.createElement)(o.Fragment,null,Object(o.createElement)(a.ToggleControl,{label:Object(i.__)("Product title",'woocommerce'),help:s?Object(i.__)("Product title is visible.",'woocommerce'):Object(i.__)("Product title is hidden.",'woocommerce'),checked:s,onChange:function(){return t(u(u({},r),{},{title:!s}))}}),Object(o.createElement)(a.ToggleControl,{label:Object(i.__)("Product price",'woocommerce'),help:c?Object(i.__)("Product price is visible.",'woocommerce'):Object(i.__)("Product price is hidden.",'woocommerce'),checked:c,onChange:function(){return t(u(u({},r),{},{price:!c}))}}),Object(o.createElement)(a.ToggleControl,{label:Object(i.__)("Product rating",'woocommerce'),help:l?Object(i.__)("Product rating is visible.",'woocommerce'):Object(i.__)("Product rating is hidden.",'woocommerce'),checked:l,onChange:function(){return t(u(u({},r),{},{rating:!l}))}}),Object(o.createElement)(a.ToggleControl,{label:Object(i.__)("Add to Cart button",'woocommerce'),help:n?Object(i.__)("Add to Cart button is visible.",'woocommerce'):Object(i.__)("Add to Cart button is hidden.",'woocommerce'),checked:n,onChange:function(){return t(u(u({},r),{},{button:!n}))}}))}},93:function(e,t,r){"use strict";var n=r(0),c=r(1),o=r(7),i=(r(2),r(4));t.a=function(e){var t=e.columns,r=e.rows,a=e.setAttributes,l=e.alignButtons,u=e.minColumns,s=void 0===u?1:u,b=e.maxColumns,d=void 0===b?6:b,p=e.minRows,g=void 0===p?1:p,f=e.maxRows,h=void 0===f?6:f;return Object(n.createElement)(n.Fragment,null,Object(n.createElement)(i.RangeControl,{label:Object(c.__)("Columns",'woocommerce'),value:t,onChange:function(e){var t=Object(o.clamp)(e,s,d);a({columns:Number.isNaN(t)?"":t})},min:s,max:d}),Object(n.createElement)(i.RangeControl,{label:Object(c.__)("Rows",'woocommerce'),value:r,onChange:function(e){var t=Object(o.clamp)(e,g,h);a({rows:Number.isNaN(t)?"":t})},min:g,max:h}),Object(n.createElement)(i.ToggleControl,{label:Object(c.__)("Align Last Block",'woocommerce'),help:l?Object(c.__)("The last inner block will be aligned vertically.",'woocommerce'):Object(c.__)("The last inner block will follow other content.",'woocommerce'),checked:l,onChange:function(){return a({alignButtons:!l})}}))}},96:function(e,t){e.exports=window.wp.date},97:function(e,t,r){"use strict";var n=r(9),c=r.n(n),o=r(0),i=r(1),a=(r(2),r(49)),l=r(4),u=r(29),s=r.n(u),b=r(17),d=r.n(b),p=r(18),g=r.n(p),f=r(13),h=r.n(f),w=r(19),O=r.n(w),E=r(20),m=r.n(E),j=r(10),y=r.n(j),v=r(22),_=r.n(v),x=r(21),k=r(39),P=r(42);var C=Object(x.createHigherOrderComponent)((function(e){return function(t){O()(a,t);var r,n,i=(r=a,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=y()(r);if(n){var c=y()(this).constructor;e=Reflect.construct(t,arguments,c)}else e=t.apply(this,arguments);return m()(this,e)});function a(){var e;return d()(this,a),(e=i.apply(this,arguments)).state={error:null,loading:!1,categories:[]},e.loadCategories=e.loadCategories.bind(h()(e)),e}return g()(a,[{key:"componentDidMount",value:function(){this.loadCategories()}},{key:"loadCategories",value:function(){var e=this;this.setState({loading:!0}),Object(k.c)().then((function(t){e.setState({categories:t,loading:!1,error:null})})).catch(function(){var t=s()(_.a.mark((function t(r){var n;return _.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,Object(P.a)(r);case 2:n=t.sent,e.setState({categories:[],loading:!1,error:n});case 4:case"end":return t.stop()}}),t)})));return function(_x){return t.apply(this,arguments)}}())}},{key:"render",value:function(){var t=this.state,r=t.error,n=t.loading,i=t.categories;return Object(o.createElement)(e,c()({},this.props,{error:r,isLoading:n,categories:i}))}}]),a}(o.Component)}),"withCategories"),S=r(52),A=r(6),R=r.n(A),T=(r(139),function(e){var t=e.categories,r=e.error,n=e.isLoading,u=e.onChange,s=e.onOperatorChange,b=e.operator,d=e.selected,p=e.isCompact,g=e.isSingle,f=e.showReviewCount,h={clear:Object(i.__)("Clear all product categories",'woocommerce'),list:Object(i.__)("Product Categories",'woocommerce'),noItems:Object(i.__)("Your store doesn't have any product categories.",'woocommerce'),search:Object(i.__)("Search for product categories",'woocommerce'),selected:function(e){return Object(i.sprintf)(
/* translators: %d is the count of selected categories. */
Object(i._n)("%d category selected","%d categories selected",e,'woocommerce'),e)},updated:Object(i.__)("Category search results updated.",'woocommerce')};return r?Object(o.createElement)(S.a,{error:r}):Object(o.createElement)(o.Fragment,null,Object(o.createElement)(a.b,{className:"woocommerce-product-categories",list:t,isLoading:n,selected:d.map((function(e){return t.find((function(t){return t.id===e}))})).filter(Boolean),onChange:u,renderItem:function(e){var t=e.item,r=e.search,n=e.depth,l=void 0===n?0:n,u=t.breadcrumbs.length?"".concat(t.breadcrumbs.join(", "),", ").concat(t.name):t.name,s=f?Object(i.sprintf)(
/* translators: %1$s is the item name, %2$d is the count of reviews for the item. */
Object(i._n)("%1$s, has %2$d review","%1$s, has %2$d reviews",t.review_count,'woocommerce'),u,t.review_count):Object(i.sprintf)(
/* translators: %1$s is the item name, %2$d is the count of products for the item. */
Object(i._n)("%1$s, has %2$d product","%1$s, has %2$d products",t.count,'woocommerce'),u,t.count),b=f?Object(i.sprintf)(
/* translators: %d is the count of reviews. */
Object(i._n)("%d review","%d reviews",t.review_count,'woocommerce'),t.review_count):Object(i.sprintf)(
/* translators: %d is the count of products. */
Object(i._n)("%d product","%d products",t.count,'woocommerce'),t.count);return Object(o.createElement)(a.c,c()({className:R()("woocommerce-product-categories__item","has-count",{"is-searching":r.length>0,"is-skip-level":0===l&&0!==t.parent})},e,{countLabel:b,"aria-label":s}))},messages:h,isCompact:p,isHierarchical:!0,isSingle:g}),!!s&&Object(o.createElement)("div",{hidden:d.length<2},Object(o.createElement)(l.SelectControl,{className:"woocommerce-product-categories__operator",label:Object(i.__)("Display products matching",'woocommerce'),help:Object(i.__)("Pick at least two categories to use this setting.",'woocommerce'),value:b,onChange:s,options:[{label:Object(i.__)("Any selected categories",'woocommerce'),value:"any"},{label:Object(i.__)("All selected categories",'woocommerce'),value:"all"}]})))});T.defaultProps={operator:"any",isCompact:!1,isSingle:!1},t.a=C(T)}});woocommerce-blocks/build/reviews-frontend.asset.php000064400000000335151335517640016600 0ustar00<?php return array('dependencies' => array('react', 'wc-settings', 'wp-a11y', 'wp-api-fetch', 'wp-compose', 'wp-element', 'wp-i18n', 'wp-is-shallow-equal', 'wp-polyfill'), 'version' => 'c7f6737eb8cfa346b708f8eb797ba8e7');woocommerce-blocks/build/reviews-by-category.asset.php000064400000000744151335517640017212 0ustar00<?php return array('dependencies' => array('lodash', 'moment', 'react', 'react-dom', 'wc-settings', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-data-controls', 'wp-date', 'wp-deprecated', 'wp-dom', 'wp-element', 'wp-escape-html', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-is-shallow-equal', 'wp-keycodes', 'wp-polyfill', 'wp-primitives', 'wp-url', 'wp-viewport'), 'version' => 'b59aceb38d83788b0e0eca5d1ebac5e1');woocommerce-blocks/build/cart-frontend.asset.php000064400000000746151335517640016053 0ustar00<?php return array('dependencies' => array('lodash', 'react', 'wc-blocks-checkout', 'wc-blocks-data-store', 'wc-blocks-registry', 'wc-price-format', 'wc-settings', 'wp-a11y', 'wp-api-fetch', 'wp-autop', 'wp-compose', 'wp-data', 'wp-deprecated', 'wp-dom', 'wp-element', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-is-shallow-equal', 'wp-keycodes', 'wp-plugins', 'wp-polyfill', 'wp-primitives', 'wp-url', 'wp-warning', 'wp-wordcount'), 'version' => '4fec0bfd28eb6ee6cfef104acb21dee4');woocommerce-blocks/build/cart-i2-frontend.js000064400000546653151335517640015106 0ustar00!function(e){function t(t){for(var r,o,i=t[0],c=t[1],a=0,u=[];a<i.length;a++)o=i[a],Object.prototype.hasOwnProperty.call(n,o)&&n[o]&&u.push(n[o][0]),n[o]=0;for(r in c)Object.prototype.hasOwnProperty.call(c,r)&&(e[r]=c[r]);for(s&&s(t);u.length;)u.shift()()}var r={},n={30:0};function o(t){if(r[t])return r[t].exports;var n=r[t]={i:t,l:!1,exports:{}};return e[t].call(n.exports,n,n.exports,o),n.l=!0,n.exports}o.e=function(e){var t=[],r=n[e];if(0!==r)if(r)t.push(r[2]);else{var i=new Promise((function(t,o){r=n[e]=[t,o]}));t.push(r[2]=i);var c,a=document.createElement("script");a.charset="utf-8",a.timeout=120,o.nc&&a.setAttribute("nonce",o.nc),a.src=function(e){return o.p+""+({0:"vendors--atomic-block-components/add-to-cart--cart-blocks/order-summary--checkout-blocks/billing-ad--c5eb4dcd",1:"vendors--atomic-block-components/price--cart-blocks/line-items--cart-blocks/order-summary--checkout--8a3571de",2:"vendors--cart-blocks/order-summary--checkout-blocks/billing-address--checkout-blocks/order-summary---eb4d2cec",3:"cart-blocks/express-payment--checkout-blocks/express-payment--checkout-blocks/payment",4:"cart-blocks/order-summary--checkout-blocks/billing-address--checkout-blocks/shipping-address",5:"vendors--cart-blocks/line-items--checkout-blocks/order-summary",22:"cart-blocks/checkout-button",23:"cart-blocks/empty-cart",24:"cart-blocks/express-payment",25:"cart-blocks/filled-cart",26:"cart-blocks/items",27:"cart-blocks/line-items",28:"cart-blocks/order-summary",29:"cart-blocks/totals"}[e]||e)+"-frontend.js"}(e);var s=new Error;c=function(t){a.onerror=a.onload=null,clearTimeout(u);var r=n[e];if(0!==r){if(r){var o=t&&("load"===t.type?"missing":t.type),i=t&&t.target&&t.target.src;s.message="Loading chunk "+e+" failed.\n("+o+": "+i+")",s.name="ChunkLoadError",s.type=o,s.request=i,r[1](s)}n[e]=void 0}};var u=setTimeout((function(){c({type:"timeout",target:a})}),12e4);a.onerror=a.onload=c,document.head.appendChild(a)}return Promise.all(t)},o.m=e,o.c=r,o.d=function(e,t,r){o.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},o.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.t=function(e,t){if(1&t&&(e=o(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(o.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)o.d(r,n,function(t){return e[t]}.bind(null,n));return r},o.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(t,"a",t),t},o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},o.p="",o.oe=function(e){throw console.error(e),e};var i=window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[],c=i.push.bind(i);i.push=t,i=i.slice();for(var a=0;a<i.length;a++)t(i[a]);var s=c;o(o.s=308)}([function(e,t){e.exports=window.wp.element},function(e,t){e.exports=window.wp.i18n},function(e,t){e.exports=window.wc.wcSettings},function(e,t){e.exports=window.React},function(e,t){e.exports=function(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,r){var n=r(84),o=r(85),i=r(67),c=r(86);e.exports=function(e,t){return n(e)||o(e,t)||i(e,t)||c()},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,r){var n;!function(){"use strict";var r={}.hasOwnProperty;function o(){for(var e=[],t=0;t<arguments.length;t++){var n=arguments[t];if(n){var i=typeof n;if("string"===i||"number"===i)e.push(n);else if(Array.isArray(n)){if(n.length){var c=o.apply(null,n);c&&e.push(c)}}else if("object"===i)if(n.toString===Object.prototype.toString)for(var a in n)r.call(n,a)&&n[a]&&e.push(a);else e.push(n.toString())}}return e.join(" ")}e.exports?(o.default=o,e.exports=o):void 0===(n=function(){return o}.apply(t,[]))||(e.exports=n)}()},function(e,t){e.exports=window.lodash},function(e,t){e.exports=window.wc.wcBlocksData},function(e,t,r){"use strict";function n(e){return(n=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}r.d(t,"a",(function(){return n}))},function(e,t,r){e.exports=r(79)()},function(e,t){e.exports=window.wp.data},function(e,t,r){"use strict";function n(){return(n=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}r.d(t,"a",(function(){return n}))},function(e,t,r){"use strict";function n(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}r.d(t,"a",(function(){return n}))},function(e,t){function r(){return e.exports=r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},e.exports.default=e.exports,e.exports.__esModule=!0,r.apply(this,arguments)}e.exports=r,e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}r.d(t,"a",(function(){return n}))},function(e,t,r){"use strict";function n(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function o(e,t,r){return t&&n(e.prototype,t),r&&n(e,r),e}r.d(t,"a",(function(){return o}))},function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));var n=r(88);function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Object(n.a)(e,t)}},function(e,t,r){"use strict";r.d(t,"a",(function(){return c}));var n=r(21),o=r.n(n),i=r(13);function c(e,t){return!t||"object"!==o()(t)&&"function"!=typeof t?Object(i.a)(e):t}},function(e,t,r){"use strict";function n(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}r.d(t,"a",(function(){return n}))},function(e,t,r){"use strict";function n(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}r.d(t,"a",(function(){return n}))},function(e,t){function r(t){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?(e.exports=r=function(e){return typeof e},e.exports.default=e.exports,e.exports.__esModule=!0):(e.exports=r=function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.default=e.exports,e.exports.__esModule=!0),r(t)}e.exports=r,e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));var n=r(65);function o(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,i=[],_n=!0,c=!1;try{for(r=r.call(e);!(_n=(n=r.next()).done)&&(i.push(n.value),!t||i.length!==t);_n=!0);}catch(e){c=!0,o=e}finally{try{_n||null==r.return||r.return()}finally{if(c)throw o}}return i}}(e,t)||Object(n.a)(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}},function(e,t,r){var n=r(77);e.exports=function(e,t){if(null==e)return{};var r,o,i=n(e,t);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(e);for(o=0;o<c.length;o++)r=c[o],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=window.wp.compose},function(e,t){e.exports=window.wp.isShallowEqual},function(e,t){e.exports=window.wc.blocksCheckout},function(e,t){e.exports=window.regeneratorRuntime},function(e,t){e.exports=window.wp.htmlEntities},function(e,t){e.exports=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){function r(t){return e.exports=r=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},e.exports.default=e.exports,e.exports.__esModule=!0,r(t)}e.exports=r,e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,r){"use strict";r.d(t,"a",(function(){return i}));var n=r(59),o=r(65);function i(e){return function(e){if(Array.isArray(e))return Object(n.a)(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||Object(o.a)(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}},function(e,t,r){"use strict";r.d(t,"a",(function(){return j}));var n=r(5),o=r.n(n),i=r(4),c=r.n(i),a=r(7),s=r(0),u=r(8),l=r(11),f=r(28),p=r(92),d=r(93),h=r(36);function m(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function b(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?m(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):m(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var v={first_name:"",last_name:"",company:"",address_1:"",address_2:"",city:"",state:"",postcode:"",country:"",phone:""},g=b(b({},v),{},{email:""}),y={total_items:"",total_items_tax:"",total_fees:"",total_fees_tax:"",total_discount:"",total_discount_tax:"",total_shipping:"",total_shipping_tax:"",total_price:"",total_tax:"",tax_lines:u.EMPTY_TAX_LINES,currency_code:"",currency_symbol:"",currency_minor_unit:2,currency_decimal_separator:"",currency_thousand_separator:"",currency_prefix:"",currency_suffix:""},O=function(e){return Object(p.a)(Object.entries(e).map((function(e){var t=o()(e,2),r=t[0],n=t[1];return[r,Object(f.decodeEntities)(n)]})))},E={cartCoupons:u.EMPTY_CART_COUPONS,cartItems:u.EMPTY_CART_ITEMS,cartFees:u.EMPTY_CART_FEES,cartItemsCount:0,cartItemsWeight:0,cartNeedsPayment:!0,cartNeedsShipping:!0,cartItemErrors:u.EMPTY_CART_ITEM_ERRORS,cartTotals:y,cartIsLoading:!0,cartErrors:u.EMPTY_CART_ERRORS,billingAddress:g,shippingAddress:v,shippingRates:u.EMPTY_SHIPPING_RATES,shippingRatesLoading:!1,cartHasCalculatedShipping:!1,paymentRequirements:u.EMPTY_PAYMENT_REQUIREMENTS,receiveCart:function(){},extensions:u.EMPTY_EXTENSIONS},j=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{shouldSelect:!0},t=Object(h.a)(),r=t.isEditor,n=t.previewData,o=null==n?void 0:n.previewCart,i=e.shouldSelect,c=Object(s.useRef)(),f=Object(l.useSelect)((function(e,t){var n=t.dispatch;if(!i)return E;if(r)return{cartCoupons:o.coupons,cartItems:o.items,cartFees:o.fees,cartItemsCount:o.items_count,cartItemsWeight:o.items_weight,cartNeedsPayment:o.needs_payment,cartNeedsShipping:o.needs_shipping,cartItemErrors:u.EMPTY_CART_ITEM_ERRORS,cartTotals:o.totals,cartIsLoading:!1,cartErrors:u.EMPTY_CART_ERRORS,billingAddress:g,shippingAddress:v,extensions:u.EMPTY_EXTENSIONS,shippingRates:o.shipping_rates,shippingRatesLoading:!1,cartHasCalculatedShipping:o.has_calculated_shipping,paymentRequirements:o.paymentRequirements,receiveCart:"function"==typeof(null==o?void 0:o.receiveCart)?o.receiveCart:function(){}};var c=e(u.CART_STORE_KEY),a=c.getCartData(),s=c.getCartErrors(),l=c.getCartTotals(),f=!c.hasFinishedResolution("getCartData"),p=c.isCustomerDataUpdating(),h=n(u.CART_STORE_KEY).receiveCart,m=O(a.billingAddress),y=a.needsShipping?O(a.shippingAddress):m,j=a.fees.length>0?a.fees.map((function(e){return O(e)})):u.EMPTY_CART_FEES;return{cartCoupons:a.coupons.length>0?a.coupons.map((function(e){return b(b({},e),{},{label:e.code})})):u.EMPTY_CART_COUPONS,cartItems:a.items,cartFees:j,cartItemsCount:a.itemsCount,cartItemsWeight:a.itemsWeight,cartNeedsPayment:a.needsPayment,cartNeedsShipping:a.needsShipping,cartItemErrors:a.errors,cartTotals:l,cartIsLoading:f,cartErrors:s,billingAddress:Object(d.a)(m),shippingAddress:Object(d.a)(y),extensions:a.extensions,shippingRates:a.shippingRates,shippingRatesLoading:p,cartHasCalculatedShipping:a.hasCalculatedShipping,paymentRequirements:a.paymentRequirements,receiveCart:h}}),[i]);return c.current&&Object(a.isEqual)(c.current,f)||(c.current=f),c.current}},function(e,t){e.exports=window.wp.a11y},function(e,t){e.exports=window.wp.primitives},function(e,t,r){"use strict";r.d(t,"a",(function(){return s})),r.d(t,"b",(function(){return u})),r.d(t,"c",(function(){return f}));var n,o,i=r(49);!function(e){e.SUCCESS="success",e.FAIL="failure",e.ERROR="error"}(n||(n={})),function(e){e.PAYMENTS="wc/payment-area",e.EXPRESS_PAYMENTS="wc/express-payment-area"}(o||(o={}));var c=function(e,t){return Object(i.b)(e)&&"type"in e&&e.type===t},a=function(e){return c(e,n.SUCCESS)},s=function(e){return c(e,n.ERROR)},u=function(e){return c(e,n.FAIL)},l=function(e){return!Object(i.b)(e)||void 0===e.retry||!0===e.retry},f=function(){return{responseTypes:n,noticeContexts:o,shouldRetry:l,isSuccessResponse:a,isErrorResponse:s,isFailResponse:u}}},function(e,t,r){"use strict";r.d(t,"a",(function(){return i}));var n=r(0),o=(r(11),Object(n.createContext)({isEditor:!1,currentPostId:0,previewData:{},getPreviewData:function(){}})),i=function(){return Object(n.useContext)(o)}},function(e,t){e.exports=window.wp.dom},function(e,t){e.exports=window.wc.wcBlocksRegistry},function(e,t){function r(e,t,r,n,o,i,c){try{var a=e[i](c),s=a.value}catch(e){return void r(e)}a.done?t(s):Promise.resolve(s).then(n,o)}e.exports=function(e){return function(){var t=this,n=arguments;return new Promise((function(o,i){var c=e.apply(t,n);function a(e){r(c,o,i,a,s,"next",e)}function s(e){r(c,o,i,a,s,"throw",e)}a(void 0)}))}},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){function r(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}e.exports=function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,r){var n=r(71);e.exports=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&n(e,t)},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,r){var n=r(21).default,o=r(29);e.exports=function(e,t){return!t||"object"!==n(t)&&"function"!=typeof t?o(e):t},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,r){"use strict";var n=r(40),o=r.n(n),i=r(41),c=r.n(i),a=r(29),s=r.n(a),u=r(42),l=r.n(u),f=r(43),p=r.n(f),d=r(30),h=r.n(d),m=r(4),b=r.n(m),v=(r(10),r(3)),g=r(1),y=r(83),O=function(e){var t=e.imageUrl,r=void 0===t?"".concat(y.l,"/block-error.svg"):t,n=e.header,o=void 0===n?Object(g.__)("Oops!",'woocommerce'):n,i=e.text,c=void 0===i?Object(g.__)("There was an error loading the content.",'woocommerce'):i,a=e.errorMessage,s=e.errorMessagePrefix,u=void 0===s?Object(g.__)("Error:",'woocommerce'):s,l=e.button;return React.createElement("div",{className:"wc-block-error wc-block-components-error"},r&&React.createElement("img",{className:"wc-block-error__image wc-block-components-error__image",src:r,alt:""}),React.createElement("div",{className:"wc-block-error__content wc-block-components-error__content"},o&&React.createElement("p",{className:"wc-block-error__header wc-block-components-error__header"},o),c&&React.createElement("p",{className:"wc-block-error__text wc-block-components-error__text"},c),a&&React.createElement("p",{className:"wc-block-error__message wc-block-components-error__message"},u?u+" ":"",a),l&&React.createElement("p",{className:"wc-block-error__button wc-block-components-error__button"},l)))};r(81);var E=function(e){l()(i,e);var t,r,n=(t=i,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,n=h()(t);if(r){var o=h()(this).constructor;e=Reflect.construct(n,arguments,o)}else e=n.apply(this,arguments);return p()(this,e)});function i(){var e;o()(this,i);for(var t=arguments.length,r=new Array(t),c=0;c<t;c++)r[c]=arguments[c];return e=n.call.apply(n,[this].concat(r)),b()(s()(e),"state",{errorMessage:"",hasError:!1}),e}return c()(i,[{key:"render",value:function(){var e=this.props,t=e.header,r=e.imageUrl,n=e.showErrorMessage,o=e.text,i=e.errorMessagePrefix,c=e.renderError,a=e.button,s=this.state,u=s.errorMessage;return s.hasError?"function"==typeof c?c({errorMessage:u}):React.createElement(O,{errorMessage:n?u:null,header:t,imageUrl:r,text:o,errorMessagePrefix:i,button:a}):this.props.children}}],[{key:"getDerivedStateFromError",value:function(e){return void 0!==e.statusText&&void 0!==e.status?{errorMessage:React.createElement(React.Fragment,null,React.createElement("strong",null,e.status),": ",e.statusText),hasError:!0}:{errorMessage:e.message,hasError:!0}}}]),i}(v.Component);E.defaultProps={showErrorMessage:!0},t.a=E},function(e,t){e.exports=window.wp.deprecated},function(e,t,r){var n=r(94),o=r(95),i=r(67),c=r(96);e.exports=function(e){return n(e)||o(e)||i(e)||c()},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,r){"use strict";(function(e){var n=r(0),o=(r(74),Object(n.createContext)({slots:{},fills:{},registerSlot:function(){void 0!==e&&e.env},updateSlot:function(){},unregisterSlot:function(){},registerFill:function(){},unregisterFill:function(){}}));t.a=o}).call(this,r(102))},function(e,t,r){"use strict";r.d(t,"b",(function(){return F})),r.d(t,"a",(function(){return L}));var n,o=r(5),i=r.n(o),c=r(0),a=r(1),s=r(99),u=r(45),l=r.n(u),f=r(49);!function(e){e.SET_IDLE="set_idle",e.SET_PRISTINE="set_pristine",e.SET_REDIRECT_URL="set_redirect_url",e.SET_COMPLETE="set_checkout_complete",e.SET_BEFORE_PROCESSING="set_before_processing",e.SET_AFTER_PROCESSING="set_after_processing",e.SET_PROCESSING_RESPONSE="set_processing_response",e.SET_PROCESSING="set_checkout_is_processing",e.SET_HAS_ERROR="set_checkout_has_error",e.SET_NO_ERROR="set_checkout_no_error",e.SET_CUSTOMER_ID="set_checkout_customer_id",e.SET_ORDER_ID="set_checkout_order_id",e.SET_ORDER_NOTES="set_checkout_order_notes",e.INCREMENT_CALCULATING="increment_calculating",e.DECREMENT_CALCULATING="decrement_calculating",e.SET_SHOULD_CREATE_ACCOUNT="set_should_create_account",e.SET_EXTENSION_DATA="set_extension_data"}(n||(n={}));var p,d,h=function(){return{type:n.SET_IDLE}},m=function(e){return{type:n.SET_REDIRECT_URL,redirectUrl:e}},b=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{type:n.SET_COMPLETE,data:e}},v=function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return{type:e?n.SET_HAS_ERROR:n.SET_NO_ERROR}},g=r(4),y=r.n(g),O=r(2);function E(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}!function(e){e.PRISTINE="pristine",e.IDLE="idle",e.PROCESSING="processing",e.COMPLETE="complete",e.BEFORE_PROCESSING="before_processing",e.AFTER_PROCESSING="after_processing"}(d||(d={}));var j=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?E(Object(r),!0).forEach((function(t){y()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):E(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({order_id:0,customer_id:0},(null===(p=Object(O.getSetting)("preloadedApiRequests",{})["/wc/store/checkout"])||void 0===p?void 0:p.body)||{}),S={redirectUrl:"",status:d.PRISTINE,hasError:!1,calculatingCount:0,orderId:j.order_id,orderNotes:"",customerId:j.customer_id,shouldCreateAccount:!1,processingResponse:null,extensionData:{}};function w(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function _(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?w(Object(r),!0).forEach((function(t){y()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):w(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var k=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:S,t=arguments.length>1?arguments[1]:void 0,r=t.redirectUrl,o=t.type,i=t.customerId,c=t.orderId,a=t.orderNotes,s=t.extensionData,u=t.shouldCreateAccount,l=t.data,f=e;switch(o){case n.SET_PRISTINE:f=S;break;case n.SET_IDLE:f=e.status!==d.IDLE?_(_({},e),{},{status:d.IDLE}):e;break;case n.SET_REDIRECT_URL:f=void 0!==r&&r!==e.redirectUrl?_(_({},e),{},{redirectUrl:r}):e;break;case n.SET_PROCESSING_RESPONSE:f=_(_({},e),{},{processingResponse:l});break;case n.SET_COMPLETE:f=e.status!==d.COMPLETE?_(_({},e),{},{status:d.COMPLETE,redirectUrl:void 0!==l&&"string"==typeof l.redirectUrl&&l.redirectUrl?l.redirectUrl:e.redirectUrl}):e;break;case n.SET_PROCESSING:f=!1===(f=e.status!==d.PROCESSING?_(_({},e),{},{status:d.PROCESSING,hasError:!1}):e).hasError?f:_(_({},f),{},{hasError:!1});break;case n.SET_BEFORE_PROCESSING:f=e.status!==d.BEFORE_PROCESSING?_(_({},e),{},{status:d.BEFORE_PROCESSING,hasError:!1}):e;break;case n.SET_AFTER_PROCESSING:f=e.status!==d.AFTER_PROCESSING?_(_({},e),{},{status:d.AFTER_PROCESSING}):e;break;case n.SET_HAS_ERROR:f=e.hasError?e:_(_({},e),{},{hasError:!0}),f=e.status===d.PROCESSING||e.status===d.BEFORE_PROCESSING?_(_({},f),{},{status:d.IDLE}):f;break;case n.SET_NO_ERROR:f=e.hasError?_(_({},e),{},{hasError:!1}):e;break;case n.INCREMENT_CALCULATING:f=_(_({},e),{},{calculatingCount:e.calculatingCount+1});break;case n.DECREMENT_CALCULATING:f=_(_({},e),{},{calculatingCount:Math.max(0,e.calculatingCount-1)});break;case n.SET_CUSTOMER_ID:f=void 0!==i?_(_({},e),{},{customerId:i}):e;break;case n.SET_ORDER_ID:f=void 0!==c?_(_({},e),{},{orderId:c}):e;break;case n.SET_SHOULD_CREATE_ACCOUNT:void 0!==u&&u!==e.shouldCreateAccount&&(f=_(_({},e),{},{shouldCreateAccount:u}));break;case n.SET_ORDER_NOTES:void 0!==a&&e.orderNotes!==a&&(f=_(_({},e),{},{orderNotes:a}));break;case n.SET_EXTENSION_DATA:void 0!==s&&e.extensionData!==s&&(f=_(_({},e),{},{extensionData:s}))}return f!==e&&o!==n.SET_PRISTINE&&f.status===d.PRISTINE&&(f.status=d.IDLE),f},P=r(28),R=r(98),x=r(191),C=r(193),T=r(127),A=r(54),M=r(52),N=r(11),D=r(35),I=Object(c.createContext)({dispatchActions:{resetCheckout:function(){},setRedirectUrl:function(e){},setHasError:function(e){},setAfterProcessing:function(e){},incrementCalculating:function(){},decrementCalculating:function(){},setCustomerId:function(e){},setOrderId:function(e){},setOrderNotes:function(e){},setExtensionData:function(e){}},onSubmit:function(){},isComplete:!1,isIdle:!1,isCalculating:!1,isProcessing:!1,isBeforeProcessing:!1,isAfterProcessing:!1,hasError:!1,redirectUrl:"",orderId:0,orderNotes:"",customerId:0,onCheckoutAfterProcessingWithSuccess:function(){return function(){}},onCheckoutAfterProcessingWithError:function(){return function(){}},onCheckoutBeforeProcessing:function(){return function(){}},onCheckoutValidationBeforeProcessing:function(){return function(){}},hasOrder:!1,isCart:!1,shouldCreateAccount:!1,setShouldCreateAccount:function(e){},extensionData:{}}),F=function(){return Object(c.useContext)(I)},L=function(e){var t=e.children,r=e.redirectUrl,o=e.isCart,u=void 0!==o&&o;S.redirectUrl=r;var p,g=Object(c.useReducer)(k,S),y=i()(g,2),O=y[0],E=y[1],j=Object(T.b)().setValidationErrors,w=Object(A.a)(),_=w.addErrorNotice,F=w.removeNotices,L=Object(M.a)().dispatchCheckoutEvent,V=O.calculatingCount>0,B=Object(D.c)(),U=B.isSuccessResponse,H=B.isErrorResponse,G=B.isFailResponse,z=B.shouldRetry,q=(p=Object(D.c)().noticeContexts,{checkoutNotices:Object(N.useSelect)((function(e){return e("core/notices").getNotices("wc/checkout")}),[]),expressPaymentNotices:Object(N.useSelect)((function(e){return e("core/notices").getNotices(p.EXPRESS_PAYMENTS)}),[p.EXPRESS_PAYMENTS]),paymentNotices:Object(N.useSelect)((function(e){return e("core/notices").getNotices(p.PAYMENTS)}),[p.PAYMENTS])}),W=q.checkoutNotices,Y=q.paymentNotices,K=q.expressPaymentNotices,X=Object(c.useReducer)(R.b,{}),$=i()(X,2),J=$[0],Q=$[1],Z=Object(c.useRef)(J),ee=function(e){return Object(c.useMemo)((function(){return{onCheckoutAfterProcessingWithSuccess:Object(x.a)("checkout_after_processing_with_success",e),onCheckoutAfterProcessingWithError:Object(x.a)("checkout_after_processing_with_error",e),onCheckoutValidationBeforeProcessing:Object(x.a)("checkout_validation_before_processing",e)}}),[e])}(Q),te=ee.onCheckoutAfterProcessingWithSuccess,re=ee.onCheckoutAfterProcessingWithError,ne=ee.onCheckoutValidationBeforeProcessing;Object(c.useEffect)((function(){Z.current=J}),[J]);var oe=Object(c.useMemo)((function(){return function(){return l()("onCheckoutBeforeProcessing",{alternative:"onCheckoutValidationBeforeProcessing",plugin:"WooCommerce Blocks"}),ne.apply(void 0,arguments)}}),[ne]),ie=Object(c.useMemo)((function(){return{resetCheckout:function(){E({type:n.SET_PRISTINE})},setRedirectUrl:function(e){E(m(e))},setHasError:function(e){E(v(e))},incrementCalculating:function(){E({type:n.INCREMENT_CALCULATING})},decrementCalculating:function(){E({type:n.DECREMENT_CALCULATING})},setCustomerId:function(e){var t;E((t=e,{type:n.SET_CUSTOMER_ID,customerId:t}))},setOrderId:function(e){E(function(e){return{type:n.SET_ORDER_ID,orderId:e}}(e))},setOrderNotes:function(e){E(function(e){return{type:n.SET_ORDER_NOTES,orderNotes:e}}(e))},setExtensionData:function(e){E(function(e){return{type:n.SET_EXTENSION_DATA,extensionData:e}}(e))},setAfterProcessing:function(e){var t,r=function(e){var t={message:"",paymentStatus:"",redirectUrl:"",paymentDetails:{}};return"payment_result"in e&&(t.paymentStatus=e.payment_result.payment_status,t.redirectUrl=e.payment_result.redirect_url,e.payment_result.hasOwnProperty("payment_details")&&Array.isArray(e.payment_result.payment_details)&&e.payment_result.payment_details.forEach((function(e){var r=e.key,n=e.value;t.paymentDetails[r]=Object(P.decodeEntities)(n)}))),"message"in e&&(t.message=Object(P.decodeEntities)(e.message)),!t.message&&"data"in e&&"status"in e.data&&e.data.status>299&&(t.message=Object(a.__)("Something went wrong. Please contact us to get assistance.",'woocommerce')),t}(e);r.redirectUrl&&E(m(r.redirectUrl)),E((t=r,{type:n.SET_PROCESSING_RESPONSE,data:t})),E({type:n.SET_AFTER_PROCESSING})}}}),[]);Object(c.useEffect)((function(){O.status===d.BEFORE_PROCESSING&&(F("error"),Object(C.a)(Z.current,"checkout_validation_before_processing",{}).then((function(e){!0!==e?(Array.isArray(e)&&e.forEach((function(e){var t=e.errorMessage,r=e.validationErrors;_(t),j(r)})),E(h()),E(v())):E({type:n.SET_PROCESSING})})))}),[O.status,j,_,F,E]);var ce=Object(s.a)(O.status),ae=Object(s.a)(O.hasError);Object(c.useEffect)((function(){if((O.status!==ce||O.hasError!==ae)&&O.status===d.AFTER_PROCESSING){var e={redirectUrl:O.redirectUrl,orderId:O.orderId,customerId:O.customerId,orderNotes:O.orderNotes,processingResponse:O.processingResponse};O.hasError?Object(C.b)(Z.current,"checkout_after_processing_with_error",e).then((function(t){var r=function(e){var t=null;return e.forEach((function(e){if((H(e)||G(e))&&e.message){var r=e.messageContext?{context:e.messageContext}:void 0;t=e,_(e.message,r)}})),t}(t);if(null!==r)z(r)?E(h()):E(b(r));else{if(!(W.some((function(e){return"error"===e.status}))||K.some((function(e){return"error"===e.status}))||Y.some((function(e){return"error"===e.status})))){var n,o=(null===(n=e.processingResponse)||void 0===n?void 0:n.message)||Object(a.__)("Something went wrong. Please contact us to get assistance.",'woocommerce');_(o,{id:"checkout"})}E(h())}})):Object(C.b)(Z.current,"checkout_after_processing_with_success",e).then((function(e){var t=null,r=null;if(e.forEach((function(e){U(e)&&(t=e),(H(e)||G(e))&&(r=e)})),t&&!r)E(b(t));else if(Object(f.b)(r)){if(r.message){var n=r.messageContext?{context:r.messageContext}:void 0;_(r.message,n)}z(r)?E(v(!0)):E(b(r))}else E(b())}))}}),[O.status,O.hasError,O.redirectUrl,O.orderId,O.customerId,O.orderNotes,O.processingResponse,ce,ae,ie,_,H,G,U,z,W,K,Y]);var se={onSubmit:Object(c.useCallback)((function(){L("submit"),E({type:n.SET_BEFORE_PROCESSING})}),[L]),isComplete:O.status===d.COMPLETE,isIdle:O.status===d.IDLE,isCalculating:V,isProcessing:O.status===d.PROCESSING,isBeforeProcessing:O.status===d.BEFORE_PROCESSING,isAfterProcessing:O.status===d.AFTER_PROCESSING,hasError:O.hasError,redirectUrl:O.redirectUrl,onCheckoutBeforeProcessing:oe,onCheckoutValidationBeforeProcessing:ne,onCheckoutAfterProcessingWithSuccess:te,onCheckoutAfterProcessingWithError:re,dispatchActions:ie,isCart:u,orderId:O.orderId,hasOrder:!!O.orderId,customerId:O.customerId,orderNotes:O.orderNotes,shouldCreateAccount:O.shouldCreateAccount,setShouldCreateAccount:function(e){return E((t=e,{type:n.SET_SHOULD_CREATE_ACCOUNT,shouldCreateAccount:t}));var t},extensionData:O.extensionData};return React.createElement(I.Provider,{value:se},t)}},function(e,t,r){"use strict";r.d(t,"a",(function(){return n})),r.d(t,"c",(function(){return o})),r.d(t,"b",(function(){return i})),r.d(t,"d",(function(){return c}));var n=function(e){return"number"==typeof e},o=function(e){return"string"==typeof e},i=function(e){return!function(e){return null===e}(e)&&e instanceof Object&&e.constructor===Object};function c(e,t){return i(e)&&t in e}},function(e,t){e.exports=window.wp.keycodes},,function(e,t,r){"use strict";r.d(t,"a",(function(){return l}));var n=r(4),o=r.n(n),i=r(75),c=r(0),a=r(32);function s(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function u(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?s(Object(r),!0).forEach((function(t){o()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):s(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var l=function(){var e=Object(a.a)(),t=Object(c.useRef)(e);return Object(c.useEffect)((function(){t.current=e}),[e]),{dispatchStoreEvent:Object(c.useCallback)((function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};try{Object(i.doAction)("experimental__woocommerce_blocks-".concat(e),t)}catch(e){console.error(e)}}),[]),dispatchCheckoutEvent:Object(c.useCallback)((function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};try{Object(i.doAction)("experimental__woocommerce_blocks-checkout-".concat(e),u(u({},r),{},{storeCart:t.current}))}catch(e){console.error(e)}}),[])}}},function(e,t,r){"use strict";r.d(t,"a",(function(){return c}));var n=r(0),o=r(25),i=r.n(o);function c(e){var t=Object(n.useRef)(e);return i()(e,t.current)||(t.current=e),t.current}},function(e,t,r){"use strict";r.d(t,"a",(function(){return u}));var n=r(4),o=r.n(n),i=r(0),c=r(103);function a(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function s(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?a(Object(r),!0).forEach((function(t){o()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):a(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var u=function(){var e=Object(c.b)(),t=e.notices,r=e.createNotice,n=e.removeNotice,o=e.setIsSuppressed,a=Object(i.useRef)(t);Object(i.useEffect)((function(){a.current=t}),[t]);var u=Object(i.useMemo)((function(){return{hasNoticesOfType:function(e){return a.current.some((function(t){return t.type===e}))},removeNotices:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;a.current.forEach((function(t){null!==e&&t.status!==e||n(t.id)}))},removeNotice:n}}),[n]),l=Object(i.useMemo)((function(){return{addDefaultNotice:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};r("default",e,s({},t))},addErrorNotice:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};r("error",e,s({},t))},addWarningNotice:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};r("warning",e,s({},t))},addInfoNotice:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};r("info",e,s({},t))},addSuccessNotice:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};r("success",e,s({},t))}}}),[r]);return s(s(s({notices:t},u),l),{},{setIsSuppressed:o})}},,,,function(e,t){e.exports=window.wc.priceFormat},function(e,t,r){"use strict";function n(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}r.d(t,"a",(function(){return n}))},function(e,t,r){"use strict";r.d(t,"b",(function(){return S})),r.d(t,"a",(function(){return w}));var n=r(5),o=r.n(n),i=r(0),c=r(2),a=r(4),s=r.n(a),u=r(11),l=r(8),f=r(115),p=r(25),d=r.n(p),h=r(93),m=r(132),b=r(32),v=r(54);function g(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function y(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?g(Object(r),!0).forEach((function(t){s()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):g(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var O=function(e,t){return!(!function(e){return"email"in e}(t)||Object(h.c)(t)===Object(h.c)(e))||!!t.country&&!d()(Object(h.b)(e),Object(h.b)(t))},E=r(48),j=Object(i.createContext)({billingData:{first_name:"",last_name:"",company:"",address_1:"",address_2:"",city:"",state:"",postcode:"",country:"",email:"",phone:""},shippingAddress:{first_name:"",last_name:"",company:"",address_1:"",address_2:"",city:"",state:"",postcode:"",country:"",phone:""},setBillingData:function(){return null},setShippingAddress:function(){return null},shippingAsBilling:!0,setShippingAsBilling:function(){return null}}),S=function(){return Object(i.useContext)(j)},w=function(e){var t=e.children,r=function(){var e=Object(u.useDispatch)(l.CART_STORE_KEY).updateCustomerData,t=Object(v.a)(),r=t.addErrorNotice,n=t.removeNotice,c=Object(b.a)(),a=c.billingAddress,s=c.shippingAddress,p=Object(i.useState)({billingData:a,shippingAddress:s}),h=o()(p,2),g=h[0],E=h[1],j=Object(i.useRef)(g),S=Object(f.a)(g,1e3,{equalityFn:function(e,t){return d()(e.billingData,t.billingData)&&d()(e.shippingAddress,t.shippingAddress)}}),w=o()(S,1)[0],_=Object(i.useCallback)((function(e){E((function(t){return y(y({},t),{},{billingData:y(y({},t.billingData),e)})}))}),[]),k=Object(i.useCallback)((function(e){E((function(t){return y(y({},t),{},{shippingAddress:y(y({},t.shippingAddress),e)})}))}),[]);return Object(i.useEffect)((function(){(O(j.current.billingData,w.billingData)||O(j.current.shippingAddress,w.shippingAddress))&&(j.current=w,e({billing_address:w.billingData,shipping_address:w.shippingAddress}).then((function(){n("checkout")})).catch((function(e){r(Object(m.b)(e),{id:"checkout"})})))}),[w,r,n,e]),{billingData:g.billingData,shippingAddress:g.shippingAddress,setBillingData:_,setShippingAddress:k}}(),n=r.billingData,a=r.shippingAddress,s=r.setBillingData,p=r.setShippingAddress,h=Object(b.a)().cartNeedsShipping,g=Object(E.b)().customerId,S=Object(i.useState)((function(){return h&&(!g||(e=a,t=n,Object.keys(c.defaultAddressFields).every((function(r){return e[r]===t[r]}))));var e,t})),w=o()(S,2),_=w[0],k=w[1],P={billingData:n,shippingAddress:a,setBillingData:s,setShippingAddress:p,shippingAsBilling:_,setShippingAsBilling:k};return React.createElement(j.Provider,{value:P},t)}},function(e,t){e.exports=window.wp.apiFetch},,,,function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));var n=r(59);function o(e,t){if(e){if("string"==typeof e)return Object(n.a)(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Object(n.a)(e,t):void 0}}},function(e,t,r){"use strict";r.d(t,"b",(function(){return x})),r.d(t,"a",(function(){return C}));var n=r(4),o=r.n(n),i=r(5),c=r.n(i),a=r(0),s=r(25),u=r.n(s),l=r(92),f=function(e){return Object(l.a)(e.map((function(e){var t;return[e.package_id,null===(t=e.shipping_rates.find((function(e){return e.selected})))||void 0===t?void 0:t.rate_id]})))},p={NONE:"none",INVALID_ADDRESS:"invalid_address",UNKNOWN:"unknown_error"},d={INVALID_COUNTRY:"woocommerce_rest_cart_shipping_rates_invalid_country",MISSING_COUNTRY:"woocommerce_rest_cart_shipping_rates_missing_country",INVALID_STATE:"woocommerce_rest_cart_shipping_rates_invalid_state"},h={shippingErrorStatus:{isPristine:!0,isValid:!1,hasInvalidAddress:!1,hasError:!1},dispatchErrorStatus:function(){return null},shippingErrorTypes:p,shippingRates:[],shippingRatesLoading:!1,selectedRates:[],setSelectedRates:function(){return null},shippingAddress:{first_name:"",last_name:"",company:"",address_1:"",address_2:"",city:"",state:"",postcode:"",country:""},setShippingAddress:function(){return null},onShippingRateSuccess:function(){return null},onShippingRateFail:function(){return null},onShippingRateSelectSuccess:function(){return null},onShippingRateSelectFail:function(){return null},needsShipping:!1},m=function(e,t){var r=t.type;return Object.values(p).includes(r)?r:e},b=r(98),v=r(191),g=function(e){return{onSuccess:Object(v.a)("shipping_rates_success",e),onFail:Object(v.a)("shipping_rates_fail",e),onSelectSuccess:Object(v.a)("shipping_rate_select_success",e),onSelectFail:Object(v.a)("shipping_rate_select_fail",e)}},y=r(193),O=r(48),E=r(60),j=r(32),S=r(118);function w(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}var _=p.NONE,k=p.INVALID_ADDRESS,P=p.UNKNOWN,R=Object(a.createContext)(h),x=function(){return Object(a.useContext)(R)},C=function(e){var t=e.children,r=Object(O.b)().dispatchActions,n=Object(E.b)(),i=n.shippingAddress,s=n.setShippingAddress,l=Object(j.a)(),h=l.cartNeedsShipping,v=l.cartHasCalculatedShipping,x=l.shippingRates,C=l.shippingRatesLoading,T=l.cartErrors,A=Object(S.a)(),M=A.selectShippingRate,N=A.isSelectingRate,D=Object(a.useReducer)(m,_),I=c()(D,2),F=I[0],L=I[1],V=Object(a.useReducer)(b.b,{}),B=c()(V,2),U=B[0],H=B[1],G=Object(a.useRef)(U),z=Object(a.useMemo)((function(){return{onShippingRateSuccess:g(H).onSuccess,onShippingRateFail:g(H).onFail,onShippingRateSelectSuccess:g(H).onSelectSuccess,onShippingRateSelectFail:g(H).onSelectFail}}),[H]);Object(a.useEffect)((function(){G.current=U}),[U]);var q=Object(a.useRef)((function(){return f(x)}));Object(a.useEffect)((function(){var e=f(x);u()(q.current,e)||(q.current=e)}),[x]),Object(a.useEffect)((function(){C?r.incrementCalculating():r.decrementCalculating()}),[C,r]),Object(a.useEffect)((function(){N?r.incrementCalculating():r.decrementCalculating()}),[N,r]),Object(a.useEffect)((function(){T.length>0&&T.some((function(e){return!(!e.code||!Object.values(d).includes(e.code))}))?L({type:k}):L({type:_})}),[T]);var W=Object(a.useMemo)((function(){return{isPristine:F===_,isValid:F===_,hasInvalidAddress:F===k,hasError:F===P||F===k}}),[F]);Object(a.useEffect)((function(){C||0!==x.length&&!W.hasError||Object(y.a)(G.current,"shipping_rates_fail",{hasInvalidAddress:W.hasInvalidAddress,hasError:W.hasError})}),[x,C,W.hasError,W.hasInvalidAddress]),Object(a.useEffect)((function(){!C&&x.length>0&&!W.hasError&&Object(y.a)(G.current,"shipping_rates_success",x)}),[x,C,W.hasError]),Object(a.useEffect)((function(){N||(W.hasError?Object(y.a)(G.current,"shipping_rate_select_fail",{hasError:W.hasError,hasInvalidAddress:W.hasInvalidAddress}):Object(y.a)(G.current,"shipping_rate_select_success",q.current))}),[N,W.hasError,W.hasInvalidAddress]);var Y=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?w(Object(r),!0).forEach((function(t){o()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):w(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({shippingErrorStatus:W,dispatchErrorStatus:L,shippingErrorTypes:p,shippingRates:x,shippingRatesLoading:C,selectedRates:q.current,setSelectedRates:M,isSelectingRate:N,shippingAddress:i,setShippingAddress:s,needsShipping:h,hasCalculatedShipping:v},z);return React.createElement(React.Fragment,null,React.createElement(R.Provider,{value:Y},t))}},function(e,t,r){var n=r(68);e.exports=function(e,t){if(e){if("string"==typeof e)return n(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?n(e,t):void 0}},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n},e.exports.default=e.exports,e.exports.__esModule=!0},,,function(e,t){function r(t,n){return e.exports=r=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},e.exports.default=e.exports,e.exports.__esModule=!0,r(t,n)}e.exports=r,e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=window.wp.url},,function(e,t){e.exports=window.wp.warning},function(e,t){e.exports=window.wp.hooks},function(e,t,r){"use strict";var n=r(12),o=r(19),i=r(0),c=r(6),a=r.n(c),s=r(7),u=r(45),l=r.n(u),f=r(15),p=r(16),d=r(17),h=r(18),m=r(9),b=r(22),v=r(37),g=r(50),y=r(24),O=r(116),E=r(20);function j(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function S(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?j(Object(r),!0).forEach((function(t){Object(E.a)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):j(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function w(e,t,r,n,o,i,c){var a=t.width,s="rtl"===document.documentElement.dir;"left"===r&&s?r="right":"right"===r&&s&&(r="left"),"left"===n&&s?n="right":"right"===n&&s&&(n="left");var u=Math.round(e.left+e.width/2),l={popoverLeft:u,contentWidth:(u-a/2>0?a/2:u)+(u+a/2>window.innerWidth?window.innerWidth-u:a/2)},f=e.left;"right"===n?f=e.right:"middle"!==i&&(f=u);var p=e.right;"left"===n?p=e.left:"middle"!==i&&(p=u);var d,h={popoverLeft:f,contentWidth:f-a>0?a:f},m={popoverLeft:p,contentWidth:p+a>window.innerWidth?window.innerWidth-p:a},b=r,v=null;if(!o)if("center"===r&&l.contentWidth===a)b="center";else if("left"===r&&h.contentWidth===a)b="left";else if("right"===r&&m.contentWidth===a)b="right";else{var g="left"==(b=h.contentWidth>m.contentWidth?"left":"right")?h.contentWidth:m.contentWidth;v=g!==a?g:null}if(d="center"===b?l.popoverLeft:"left"===b?h.popoverLeft:m.popoverLeft,c){var y=c.getBoundingClientRect();d=Math.min(d,y.right-a)}return{xAxis:b,popoverLeft:d,contentWidth:v}}function _(e,t,r,n,o,i,c){var a=t.height;if(o){var s=(Object(v.getScrollContainer)(i)||document.body).getBoundingClientRect().top+a-c;if(e.top<=s)return{yAxis:r,popoverTop:Math.min(e.bottom,s)}}var u=e.top+e.height/2;"bottom"===n?u=e.bottom:"top"===n&&(u=e.top);var l={popoverTop:u,contentHeight:(u-a/2>0?a/2:u)+(u+a/2>window.innerHeight?window.innerHeight-u:a/2)},f={popoverTop:e.top,contentHeight:e.top-10-a>0?a:e.top-10},p={popoverTop:e.bottom,contentHeight:e.bottom+10+a>window.innerHeight?window.innerHeight-10-e.bottom:a},d=r,h=null;if(!o)if("middle"===r&&l.contentHeight===a)d="middle";else if("top"===r&&f.contentHeight===a)d="top";else if("bottom"===r&&p.contentHeight===a)d="bottom";else{var m="top"==(d=f.contentHeight>p.contentHeight?"top":"bottom")?f.contentHeight:p.contentHeight;h=m!==a?m:null}return{yAxis:d,popoverTop:"middle"===d?l.popoverTop:"top"===d?f.popoverTop:p.popoverTop,contentHeight:h}}var k=r(31),P=r(13);var R=Object(i.createContext)({focusHistory:[]}),x=R.Provider,C=R.Consumer;x.displayName="FocusReturnProvider",C.displayName="FocusReturnConsumer",i.Component;var T=Object(y.createHigherOrderComponent)((function e(t){if((n=t)instanceof i.Component||"function"==typeof n){var r=t;return e({})(r)}var n,o=t.onFocusReturn,c=void 0===o?s.stubTrue:o;return function(e){var t=function(t){Object(d.a)(a,t);var r,n,o=(r=a,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=Object(m.a)(r);if(n){var o=Object(m.a)(this).constructor;e=Reflect.construct(t,arguments,o)}else e=t.apply(this,arguments);return Object(h.a)(this,e)});function a(){var e;return Object(f.a)(this,a),(e=o.apply(this,arguments)).ownFocusedElements=new Set,e.activeElementOnMount=document.activeElement,e.setIsFocusedFalse=function(){return e.isFocused=!1},e.setIsFocusedTrue=function(t){e.ownFocusedElements.add(t.target),e.isFocused=!0},e}return Object(p.a)(a,[{key:"componentWillUnmount",value:function(){var e=this.activeElementOnMount,t=this.isFocused,r=this.ownFocusedElements;if(t&&!1!==c())for(var n,o=[].concat(Object(k.a)(s.without.apply(void 0,[this.props.focus.focusHistory].concat(Object(k.a)(r)))),[e]);n=o.pop();)if(document.body.contains(n))return void n.focus()}},{key:"render",value:function(){return Object(i.createElement)("div",{onFocus:this.setIsFocusedTrue,onBlur:this.setIsFocusedFalse},Object(i.createElement)(e,this.props.childProps))}}]),a}(i.Component);return function(e){return Object(i.createElement)(C,null,(function(r){return Object(i.createElement)(t,{childProps:e,focus:r})}))}}}),"withFocusReturn");var A=Object(y.createHigherOrderComponent)((function(e){return function(t){Object(d.a)(c,t);var r,n,o=(r=c,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=Object(m.a)(r);if(n){var o=Object(m.a)(this).constructor;e=Reflect.construct(t,arguments,o)}else e=t.apply(this,arguments);return Object(h.a)(this,e)});function c(){var e;return Object(f.a)(this,c),(e=o.apply(this,arguments)).focusContainRef=Object(i.createRef)(),e.handleTabBehaviour=e.handleTabBehaviour.bind(Object(P.a)(e)),e}return Object(p.a)(c,[{key:"handleTabBehaviour",value:function(e){if(e.keyCode===g.TAB){var t=v.focus.tabbable.find(this.focusContainRef.current);if(t.length){var r=t[0],n=t[t.length-1];e.shiftKey&&e.target===r?(e.preventDefault(),n.focus()):(e.shiftKey||e.target!==n)&&t.includes(e.target)||(e.preventDefault(),r.focus())}}}},{key:"render",value:function(){return Object(i.createElement)("div",{onKeyDown:this.handleTabBehaviour,ref:this.focusContainRef,tabIndex:"-1"},Object(i.createElement)(e,this.props))}}]),c}(i.Component)}),"withConstrainedTabbing"),M=r(89);var N=function(e){Object(d.a)(o,e);var t,r,n=(t=o,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,n=Object(m.a)(t);if(r){var o=Object(m.a)(this).constructor;e=Reflect.construct(n,arguments,o)}else e=n.apply(this,arguments);return Object(h.a)(this,e)});function o(){return Object(f.a)(this,o),n.apply(this,arguments)}return Object(p.a)(o,[{key:"handleFocusOutside",value:function(e){this.props.onFocusOutside(e)}},{key:"render",value:function(){return this.props.children}}]),o}(i.Component),D=Object(M.a)(N);function I(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=Object(m.a)(e);if(t){var o=Object(m.a)(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return Object(h.a)(this,r)}}var F=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.htmlDocument,r=void 0===t?document:t,n=e.className,o=void 0===n?"lockscroll":n,c=0,a=0;function s(e){var t=r.scrollingElement||r.body;e&&(a=t.scrollTop);var n=e?"add":"remove";t.classList[n](o),r.documentElement.classList[n](o),e||(t.scrollTop=a)}function u(){0===c&&s(!0),++c}function l(){1===c&&s(!1),--c}return function(e){Object(d.a)(r,e);var t=I(r);function r(){return Object(f.a)(this,r),t.apply(this,arguments)}return Object(p.a)(r,[{key:"componentDidMount",value:function(){u()}},{key:"componentWillUnmount",value:function(){l()}},{key:"render",value:function(){return null}}]),r}(i.Component)}();function L(e){e.stopPropagation()}var V=Object(i.forwardRef)((function(e,t){var r=e.children,c=Object(o.a)(e,["children"]);return Object(i.createElement)("div",Object(n.a)({},c,{ref:t,onMouseDown:L}),r)})),B=r(47);function U(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function H(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?U(Object(r),!0).forEach((function(t){Object(E.a)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):U(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function G(e){var t=Object(i.useContext)(B.a),r=t.slots[e]||{},n=t.fills[e],o=Object(i.useMemo)((function(){return n||[]}),[n]),c=Object(i.useCallback)((function(r){t.updateSlot(e,r)}),[e,t.updateSlot]),a=Object(i.useCallback)((function(r){t.unregisterSlot(e,r)}),[e,t.unregisterSlot]),s=Object(i.useCallback)((function(r){t.registerFill(e,r)}),[e,t.registerFill]),u=Object(i.useCallback)((function(r){t.unregisterFill(e,r)}),[e,t.unregisterFill]);return H(H({},r),{},{updateSlot:c,unregisterSlot:a,fills:o,registerFill:s,unregisterFill:u})}function z(e,t,r){return(z="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,r){var n=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=Object(m.a)(e)););return e}(e,t);if(n){var o=Object.getOwnPropertyDescriptor(n,t);return o.get?o.get.call(r):o.value}})(e,t,r||e)}r(25);var q=Object(i.createContext)({registerSlot:function(){},unregisterSlot:function(){},registerFill:function(){},unregisterFill:function(){},getSlot:function(){},getFills:function(){},subscribe:function(){}}),W=(q.Provider,q.Consumer);i.Component;var Y=function(e){Object(d.a)(o,e);var t,r,n=(t=o,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,n=Object(m.a)(t);if(r){var o=Object(m.a)(this).constructor;e=Reflect.construct(n,arguments,o)}else e=n.apply(this,arguments);return Object(h.a)(this,e)});function o(){var e;return Object(f.a)(this,o),(e=n.apply(this,arguments)).isUnmounted=!1,e.bindNode=e.bindNode.bind(Object(P.a)(e)),e}return Object(p.a)(o,[{key:"componentDidMount",value:function(){(0,this.props.registerSlot)(this.props.name,this)}},{key:"componentWillUnmount",value:function(){var e=this.props.unregisterSlot;this.isUnmounted=!0,e(this.props.name,this)}},{key:"componentDidUpdate",value:function(e){var t=this.props,r=t.name,n=t.unregisterSlot,o=t.registerSlot;e.name!==r&&(n(e.name),o(r,this))}},{key:"bindNode",value:function(e){this.node=e}},{key:"forceUpdate",value:function(){this.isUnmounted||z(Object(m.a)(o.prototype),"forceUpdate",this).call(this)}},{key:"render",value:function(){var e=this.props,t=e.children,r=e.name,n=e.fillProps,o=void 0===n?{}:n,c=e.getFills,a=Object(s.map)(c(r,this),(function(e){var t=e.occurrence,r=Object(s.isFunction)(e.children)?e.children(o):e.children;return i.Children.map(r,(function(e,r){if(!e||Object(s.isString)(e))return e;var n="".concat(t,"---").concat(e.key||r);return Object(i.cloneElement)(e,{key:n})}))})).filter(Object(s.negate)(i.isEmptyElement));return Object(i.createElement)(i.Fragment,null,Object(s.isFunction)(t)?t(a):a)}}]),o}(i.Component),K=function(e){return Object(i.createElement)(W,null,(function(t){var r=t.registerSlot,o=t.unregisterSlot,c=t.getFills;return Object(i.createElement)(Y,Object(n.a)({},e,{registerSlot:r,unregisterSlot:o,getFills:c}))}))},X=0;function $(e){var t=e.name,r=e.children,n=e.registerFill,o=e.unregisterFill,c=function(e){var t=Object(i.useContext)(q),r=t.getSlot,n=t.subscribe,o=Object(i.useState)(r(e)),c=Object(b.a)(o,2),a=c[0],s=c[1];return Object(i.useEffect)((function(){return s(r(e)),n((function(){s(r(e))}))}),[e]),a}(t),a=Object(i.useRef)({name:t,children:r});return a.current.occurrence||(a.current.occurrence=++X),Object(i.useLayoutEffect)((function(){return n(t,a.current),function(){return o(t,a.current)}}),[]),Object(i.useLayoutEffect)((function(){a.current.children=r,c&&c.forceUpdate()}),[r]),Object(i.useLayoutEffect)((function(){t!==a.current.name&&(o(a.current.name,a.current),a.current.name=t,n(t,a.current))}),[t]),c&&c.node?(Object(s.isFunction)(r)&&(r=r(c.props.fillProps)),Object(i.createPortal)(r,c.node)):null}var J=function(e){return Object(i.createElement)(W,null,(function(t){var r=t.registerFill,o=t.unregisterFill;return Object(i.createElement)($,Object(n.a)({},e,{registerFill:r,unregisterFill:o}))}))};function Q(e){var t=e.name,r=e.fillProps,c=void 0===r?{}:r,a=e.as,s=void 0===a?"div":a,u=Object(o.a)(e,["name","fillProps","as"]),l=Object(i.useContext)(B.a),f=Object(i.useRef)();return Object(i.useLayoutEffect)((function(){return l.registerSlot(t,f,c),function(){l.unregisterSlot(t,f)}}),[l.registerSlot,l.unregisterSlot,t]),Object(i.useLayoutEffect)((function(){l.updateSlot(t,c)})),Object(i.createElement)(s,Object(n.a)({ref:f},u))}function Z(e){var t,r,n=e.name,o=e.children,c=G(n),a=Object(i.useRef)({rerender:(t=Object(i.useState)({}),r=Object(b.a)(t,2)[1],function(){return r({})})});return Object(i.useEffect)((function(){return c.registerFill(a),function(){c.unregisterFill(a)}}),[c.registerFill,c.unregisterFill]),c.ref&&c.ref.current?("function"==typeof o&&(o=o(c.fillProps)),Object(i.createPortal)(o,c.ref.current)):null}function ee(e){var t=e.bubblesVirtually,r=Object(o.a)(e,["bubblesVirtually"]);return t?Object(i.createElement)(Q,r):Object(i.createElement)(K,r)}function te(e){return Object(i.createElement)(i.Fragment,null,Object(i.createElement)(J,e),Object(i.createElement)(Z,e))}function re(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function ne(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?re(Object(r),!0).forEach((function(t){Object(E.a)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):re(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function oe(e){var t=e.type,r=e.origin,n=void 0===r?function(e){return"appear"===e?"top":"left"}(t):r;if("appear"===t){var o,i=n.split(" "),c=Object(b.a)(i,2),s=c[0],u=c[1],l=void 0===u?"center":u;return a()("components-animate__appear",(o={},Object(E.a)(o,"is-from-"+l,"center"!==l),Object(E.a)(o,"is-from-"+s,"middle"!==s),o))}return"slide-in"===t?a()("components-animate__slide-in","is-from-"+n):"loading"===t?a()("components-animate__loading"):void 0}function ie(e){var t=e.type,r=e.options,n=void 0===r?{}:r;return(0,e.children)({className:oe(ne({type:t},n))})}var ce=A(T((function(e){return e.children})));function ae(e,t){var r,n=(r=t).ownerDocument.defaultView.getComputedStyle(r),o=n.paddingTop,i=n.paddingBottom,c=n.paddingLeft,a=n.paddingRight,s=o?parseInt(o,10):0,u=i?parseInt(i,10):0,l=c?parseInt(c,10):0,f=a?parseInt(a,10):0;return{x:e.left+l,y:e.top+s,width:e.width-l-f,height:e.height-s-u,left:e.left+l,right:e.right-f,top:e.top+s,bottom:e.bottom-u}}function se(e,t,r){r?e.getAttribute(t)!==r&&e.setAttribute(t,r):e.hasAttribute(t)&&e.removeAttribute(t)}function ue(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";e.style[t]!==r&&(e.style[t]=r)}function le(e,t,r){r?e.classList.contains(t)||e.classList.add(t):e.classList.contains(t)&&e.classList.remove(t)}var fe=function(e){var t=e.headerTitle,r=e.onClose,c=e.onKeyDown,s=e.children,u=e.className,f=e.noArrow,p=void 0===f||f,d=e.isAlternate,h=e.position,m=void 0===h?"bottom right":h,E=(e.range,e.focusOnMount),j=void 0===E?"firstElement":E,k=e.anchorRef,P=e.shouldAnchorIncludePadding,R=e.anchorRect,x=e.getAnchorRect,C=e.expandOnMobile,T=e.animate,A=void 0===T||T,M=e.onClickOutside,N=e.onFocusOutside,I=e.__unstableSticky,L=e.__unstableSlotName,B=void 0===L?"Popover":L,U=e.__unstableObserveElement,H=e.__unstableBoundaryParent,z=Object(o.a)(e,["headerTitle","onClose","onKeyDown","children","className","noArrow","isAlternate","position","range","focusOnMount","anchorRef","shouldAnchorIncludePadding","anchorRect","getAnchorRect","expandOnMobile","animate","onClickOutside","onFocusOutside","__unstableSticky","__unstableSlotName","__unstableObserveElement","__unstableBoundaryParent"]),q=Object(i.useRef)(null),W=Object(i.useRef)(null),Y=Object(i.useRef)(),K=Object(y.useViewportMatch)("medium","<"),X=Object(i.useState)(),$=Object(b.a)(X,2),J=$[0],Q=$[1],Z=G(B),ee=C&&K,re=Object(y.useResizeObserver)(),ne=Object(b.a)(re,2),oe=ne[0],fe=ne[1];p=ee||p,Object(i.useLayoutEffect)((function(){if(ee)return le(Y.current,"is-without-arrow",p),le(Y.current,"is-alternate",d),se(Y.current,"data-x-axis"),se(Y.current,"data-y-axis"),ue(Y.current,"top"),ue(Y.current,"left"),ue(W.current,"maxHeight"),void ue(W.current,"maxWidth");var e=function(){if(Y.current&&W.current){var e=function(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]&&arguments[3],o=arguments.length>4?arguments[4]:void 0;if(t)return t;if(r){if(!e.current)return;return r(e.current)}if(!1!==n){if(!(n&&window.Range&&window.Element&&window.DOMRect))return;if(n instanceof window.Range)return Object(v.getRectangleFromRange)(n);if(n instanceof window.Element){var i=n.getBoundingClientRect();return o?i:ae(i,n)}var c=n.top,a=n.bottom,s=c.getBoundingClientRect(),u=a.getBoundingClientRect(),l=new window.DOMRect(s.left,s.top,s.width,u.bottom-s.top);return o?l:ae(l,n)}if(e.current){var f=e.current.parentNode,p=f.getBoundingClientRect();return o?p:ae(p,f)}}(q,R,x,k,P);if(e){var t,r,n=Y.current,o=n.offsetParent,i=n.ownerDocument,c=0;if(o&&o!==i.body){var a=o.getBoundingClientRect();c=a.top,e=new window.DOMRect(e.left-a.left,e.top-a.top,e.width,e.height)}H&&(t=null===(r=Y.current.closest(".popover-slot"))||void 0===r?void 0:r.parentNode);var s=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"top",n=arguments.length>3?arguments[3]:void 0,o=arguments.length>4?arguments[4]:void 0,i=arguments.length>5?arguments[5]:void 0,c=arguments.length>6?arguments[6]:void 0,a=r.split(" "),s=Object(b.a)(a,3),u=s[0],l=s[1],f=void 0===l?"center":l,p=s[2],d=_(e,t,u,p,n,o,i),h=w(e,t,f,p,n,d.yAxis,c);return S(S({},h),d)}(e,fe.height?fe:W.current.getBoundingClientRect(),m,I,Y.current,c,t),u=s.popoverTop,l=s.popoverLeft,f=s.xAxis,h=s.yAxis,g=s.contentHeight,y=s.contentWidth;"number"==typeof u&&"number"==typeof l&&(ue(Y.current,"top",u+"px"),ue(Y.current,"left",l+"px")),le(Y.current,"is-without-arrow",p||"center"===f&&"middle"===h),le(Y.current,"is-alternate",d),se(Y.current,"data-x-axis",f),se(Y.current,"data-y-axis",h),ue(W.current,"maxHeight","number"==typeof g?g+"px":""),ue(W.current,"maxWidth","number"==typeof y?y+"px":""),Q(({left:"right",right:"left"}[f]||"center")+" "+({top:"bottom",bottom:"top"}[h]||"middle"))}}};e();var t,r,n=window.setInterval(e,500),o=function(){window.cancelAnimationFrame(t),t=window.requestAnimationFrame(e)};return window.addEventListener("click",o),window.addEventListener("resize",e),window.addEventListener("scroll",e,!0),U&&(r=new window.MutationObserver(e)).observe(U,{attributes:!0}),function(){window.clearInterval(n),window.removeEventListener("resize",e),window.removeEventListener("scroll",e,!0),window.removeEventListener("click",o),window.cancelAnimationFrame(t),r&&r.disconnect()}}),[ee,R,x,k,P,m,fe,I,U,H]),function(e,t){Object(i.useEffect)((function(){var r=setTimeout((function(){if(e&&t.current)if("firstElement"!==e)"container"===e&&t.current.focus();else{var r=v.focus.tabbable.find(t.current)[0];r?r.focus():t.current.focus()}}),0);return function(){return clearTimeout(r)}}),[])}(j,W);var pe=function(e){e.keyCode===g.ESCAPE&&r&&(e.stopPropagation(),r()),c&&c(e)},de=Object(i.createElement)(D,{onFocusOutside:function(e){if(N)N(e);else if(M){var t;try{t=new window.MouseEvent("click")}catch(e){(t=document.createEvent("MouseEvent")).initMouseEvent("click",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null)}Object.defineProperty(t,"target",{get:function(){return e.relatedTarget}}),l()("Popover onClickOutside prop",{alternative:"onFocusOutside"}),M(t)}else r&&r()}},Object(i.createElement)(ie,{type:A&&J?"appear":null,options:{origin:J}},(function(e){var o=e.className;return Object(i.createElement)(V,Object(n.a)({className:a()("components-popover",u,o,{"is-expanded":ee,"is-without-arrow":p,"is-alternate":d})},z,{onKeyDown:pe,ref:Y}),ee&&Object(i.createElement)(F,null),ee&&Object(i.createElement)("div",{className:"components-popover__header"},Object(i.createElement)("span",{className:"components-popover__header-title"},t),Object(i.createElement)(ge,{className:"components-popover__close",icon:O.a,onClick:r})),Object(i.createElement)("div",{ref:W,className:"components-popover__content",tabIndex:"-1"},Object(i.createElement)("div",{style:{position:"relative"}},oe,s)))})));return j&&(de=Object(i.createElement)(ce,null,de)),Z.ref&&(de=Object(i.createElement)(te,{name:B},de)),k||R?de:Object(i.createElement)("span",{ref:q},de)};fe.Slot=function(e){var t=e.name,r=void 0===t?"Popover":t;return Object(i.createElement)(ee,{bubblesVirtually:!0,name:r,className:"popover-slot"})};var pe=fe,de=function(e){var t,r,n=e.shortcut,o=e.className;return n?(Object(s.isString)(n)&&(t=n),Object(s.isObject)(n)&&(t=n.display,r=n.ariaLabel),Object(i.createElement)("span",{className:o,"aria-label":r},t)):null};var he=function(e){Object(d.a)(o,e);var t,r,n=(t=o,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,n=Object(m.a)(t);if(r){var o=Object(m.a)(this).constructor;e=Reflect.construct(n,arguments,o)}else e=n.apply(this,arguments);return Object(h.a)(this,e)});function o(){var e;return Object(f.a)(this,o),(e=n.apply(this,arguments)).delayedSetIsOver=Object(s.debounce)((function(t){return e.setState({isOver:t})}),700),e.cancelIsMouseDown=e.createSetIsMouseDown(!1),e.isInMouseDown=!1,e.state={isOver:!1},e}return Object(p.a)(o,[{key:"componentWillUnmount",value:function(){this.delayedSetIsOver.cancel(),document.removeEventListener("mouseup",this.cancelIsMouseDown)}},{key:"emitToChild",value:function(e,t){var r=this.props.children;if(1===i.Children.count(r)){var n=i.Children.only(r);"function"==typeof n.props[e]&&n.props[e](t)}}},{key:"createToggleIsOver",value:function(e,t){var r=this;return function(n){if(r.emitToChild(e,n),!(n.currentTarget.disabled||"focus"===n.type&&r.isInMouseDown)){r.delayedSetIsOver.cancel();var o=Object(s.includes)(["focus","mouseenter"],n.type);o!==r.state.isOver&&(t?r.delayedSetIsOver(o):r.setState({isOver:o}))}}}},{key:"createSetIsMouseDown",value:function(e){var t=this;return function(r){t.emitToChild(e?"onMouseDown":"onMouseUp",r),document[e?"addEventListener":"removeEventListener"]("mouseup",t.cancelIsMouseDown),t.isInMouseDown=e}}},{key:"render",value:function(){var e=this.props,t=e.children,r=e.position,n=e.text,o=e.shortcut;if(1!==i.Children.count(t))return t;var c=i.Children.only(t),a=this.state.isOver;return Object(i.cloneElement)(c,{onMouseEnter:this.createToggleIsOver("onMouseEnter",!0),onMouseLeave:this.createToggleIsOver("onMouseLeave"),onClick:this.createToggleIsOver("onClick"),onFocus:this.createToggleIsOver("onFocus"),onBlur:this.createToggleIsOver("onBlur"),onMouseDown:this.createSetIsMouseDown(!0),children:Object(i.concatChildren)(c.props.children,a&&Object(i.createElement)(pe,{focusOnMount:!1,position:r,className:"components-tooltip","aria-hidden":"true",animate:!1,noArrow:!0},n,Object(i.createElement)(de,{className:"components-tooltip__shortcut",shortcut:o})))})}}]),o}(i.Component),me=r(91);function be(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var ve=["onMouseDown","onClick"],ge=t.a=Object(i.forwardRef)((function(e,t){var r=e.href,c=e.target,u=e.isPrimary,f=e.isSmall,p=e.isTertiary,d=e.isPressed,h=e.isBusy,m=e.isDefault,b=e.isSecondary,v=e.isLink,g=e.isDestructive,y=e.className,O=e.disabled,E=e.icon,j=e.iconSize,S=e.showTooltip,w=e.tooltipPosition,_=e.shortcut,k=e.label,P=e.children,R=e.__experimentalIsFocusable,x=Object(o.a)(e,["href","target","isPrimary","isSmall","isTertiary","isPressed","isBusy","isDefault","isSecondary","isLink","isDestructive","className","disabled","icon","iconSize","showTooltip","tooltipPosition","shortcut","label","children","__experimentalIsFocusable"]);m&&l()("Button isDefault prop",{alternative:"isSecondary"});var C=a()("components-button",y,{"is-secondary":m||b,"is-primary":u,"is-small":f,"is-tertiary":p,"is-pressed":d,"is-busy":h,"is-link":v,"is-destructive":g,"has-text":!!E&&!!P,"has-icon":!!E}),T=O&&!R,A=void 0===r||T?"button":"a",M="a"===A?{href:r,target:c}:{type:"button",disabled:T,"aria-pressed":d};if(O&&R){M["aria-disabled"]=!0;var N,D=function(e,t){var r;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return be(e,void 0);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?be(e,void 0):void 0}}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,c=!0,a=!1;return{s:function(){r=e[Symbol.iterator]()},n:function(){var e=r.next();return c=e.done,e},e:function(e){a=!0,i=e},f:function(){try{c||null==r.return||r.return()}finally{if(a)throw i}}}}(ve);try{for(D.s();!(N=D.n()).done;)x[N.value]=function(e){e.stopPropagation(),e.preventDefault()}}catch(e){D.e(e)}finally{D.f()}}var I=!T&&(S&&k||_||!!k&&(!P||Object(s.isArray)(P)&&!P.length)&&!1!==S),F=Object(i.createElement)(A,Object(n.a)({},M,x,{className:C,"aria-label":x["aria-label"]||k,ref:t}),E&&Object(i.createElement)(me.a,{icon:E,size:j}),P);return I?Object(i.createElement)(he,{text:k,shortcut:_,position:w},F):F}))},function(e,t){e.exports=function(e,t){if(null==e)return{};var r,n,o={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(o[r]=e[r]);return o},e.exports.default=e.exports,e.exports.__esModule=!0},,function(e,t,r){"use strict";var n=r(80);function o(){}function i(){}i.resetWarningCache=o,e.exports=function(){function e(e,t,r,o,i,c){if(c!==n){var a=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw a.name="Invariant Violation",a}}function t(){return e}e.isRequired=e;var r={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:i,resetWarningCache:o};return r.PropTypes=r,r}},function(e,t,r){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},function(e,t){},function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));var n=r(3);function o(e,t,r){void 0===r&&(r={});var o=r.maxWait,i=Object(n.useRef)(null),c=Object(n.useRef)([]),a=r.leading,s=void 0===r.trailing||r.trailing,u=Object(n.useRef)(!1),l=Object(n.useRef)(null),f=Object(n.useRef)(!1),p=Object(n.useRef)(e);p.current=e;var d=Object(n.useCallback)((function(){clearTimeout(l.current),clearTimeout(i.current),i.current=null,c.current=[],l.current=null,u.current=!1}),[]);Object(n.useEffect)((function(){return f.current=!1,function(){f.current=!0}}),[]);var h=Object(n.useCallback)((function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];c.current=e,clearTimeout(l.current),u.current&&(u.current=!1),l.current||!a||u.current||(p.current.apply(p,e),u.current=!0),l.current=setTimeout((function(){var t=!0;a&&u.current&&(t=!1),d(),!f.current&&s&&t&&p.current.apply(p,e)}),t),o&&!i.current&&s&&(i.current=setTimeout((function(){var e=c.current;d(),f.current||p.current.apply(null,e)}),o))}),[o,t,d,a,s]),m=Object(n.useCallback)((function(){l.current&&(p.current.apply(null,c.current),d())}),[d]);return[h,d,m]}},function(e,t,r){"use strict";r.d(t,"n",(function(){return i})),r.d(t,"l",(function(){return c})),r.d(t,"k",(function(){return a})),r.d(t,"m",(function(){return s})),r.d(t,"i",(function(){return u})),r.d(t,"d",(function(){return l})),r.d(t,"f",(function(){return f})),r.d(t,"j",(function(){return p})),r.d(t,"c",(function(){return d})),r.d(t,"e",(function(){return h})),r.d(t,"g",(function(){return m})),r.d(t,"a",(function(){return b})),r.d(t,"h",(function(){return v})),r.d(t,"b",(function(){return g}));var n,o=r(2),i=Object(o.getSetting)("wcBlocksConfig",{buildPhase:1,pluginUrl:"",productCount:0,defaultAvatar:"",restApiRoutes:{},wordCountType:"words"}),c=i.pluginUrl+"images/",a=i.pluginUrl+"build/",s=i.buildPhase,u=null===(n=o.STORE_PAGES.shop)||void 0===n?void 0:n.permalink,l=(o.STORE_PAGES.checkout.id,o.STORE_PAGES.checkout.permalink),f=o.STORE_PAGES.privacy.permalink,p=(o.STORE_PAGES.privacy.title,o.STORE_PAGES.terms.permalink),d=(o.STORE_PAGES.terms.title,o.STORE_PAGES.cart.id,o.STORE_PAGES.cart.permalink),h=o.STORE_PAGES.myaccount.permalink?o.STORE_PAGES.myaccount.permalink:Object(o.getSetting)("wpLoginUrl","/wp-login.php"),m=Object(o.getSetting)("shippingCountries",{}),b=Object(o.getSetting)("allowedCountries",{}),v=Object(o.getSetting)("shippingStates",{}),g=Object(o.getSetting)("allowedStates",{})},function(e,t){e.exports=function(e){if(Array.isArray(e))return e},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,i=[],_n=!0,c=!1;try{for(r=r.call(e);!(_n=(n=r.next()).done)&&(i.push(n.value),!t||i.length!==t);_n=!0);}catch(e){c=!0,o=e}finally{try{_n||null==r.return||r.return()}finally{if(c)throw o}}return i}},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,r){"use strict";var n=r(4),o=r.n(n),i=r(5),c=r.n(i),a=r(2),s=r(1),u=r(49);function l(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function f(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?l(Object(r),!0).forEach((function(t){o()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):l(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var p=Object(a.getSetting)("countryLocale",{}),d=function(e){var t={};return void 0!==e.label&&(t.label=e.label),void 0!==e.required&&(t.required=e.required),void 0!==e.hidden&&(t.hidden=e.hidden),void 0===e.label||e.optionalLabel||(t.optionalLabel=Object(s.sprintf)(
/* translators: %s Field label. */
Object(s.__)("%s (optional)",'woocommerce'),e.label)),e.priority&&(Object(u.a)(e.priority)&&(t.index=e.priority),Object(u.c)(e.priority)&&(t.index=parseInt(e.priority,10))),e.hidden&&(t.required=!1),t},h=Object.entries(p).map((function(e){var t=c()(e,2),r=t[0],n=t[1];return[r,Object.entries(n).map((function(e){var t=c()(e,2),r=t[0],n=t[1];return[r,d(n)]})).reduce((function(e,t){var r=c()(t,2),n=r[0],o=r[1];return e[n]=o,e}),{})]})).reduce((function(e,t){var r=c()(t,2),n=r[0],o=r[1];return e[n]=o,e}),{});t.a=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",n=r&&void 0!==h[r]?h[r]:{};return e.map((function(e){var r=a.defaultAddressFields[e]||{},o=n[e]||{},i=t[e]||{};return f(f(f({key:e},r),o),i)})).sort((function(e,t){return e.index-t.index}))}},function(e,t,r){"use strict";function n(e,t){return(n=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}r.d(t,"a",(function(){return n}))},function(e,t,r){"use strict";var n=r(12),o=r(15),i=r(16),c=r(13),a=r(17),s=r(18),u=r(9),l=r(0),f=r(7),p=r(24);var d=["button","submit"];t.a=Object(p.createHigherOrderComponent)((function(e){return function(t){Object(a.a)(m,t);var r,p,h=(r=m,p=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=Object(u.a)(r);if(p){var n=Object(u.a)(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return Object(s.a)(this,e)});function m(){var e;return Object(o.a)(this,m),(e=h.apply(this,arguments)).bindNode=e.bindNode.bind(Object(c.a)(e)),e.cancelBlurCheck=e.cancelBlurCheck.bind(Object(c.a)(e)),e.queueBlurCheck=e.queueBlurCheck.bind(Object(c.a)(e)),e.normalizeButtonFocus=e.normalizeButtonFocus.bind(Object(c.a)(e)),e}return Object(i.a)(m,[{key:"componentWillUnmount",value:function(){this.cancelBlurCheck()}},{key:"bindNode",value:function(e){e?this.node=e:(delete this.node,this.cancelBlurCheck())}},{key:"queueBlurCheck",value:function(e){var t=this;e.persist(),this.preventBlurCheck||(this.blurCheckTimeout=setTimeout((function(){document.hasFocus()?"function"==typeof t.node.handleFocusOutside&&t.node.handleFocusOutside(e):e.preventDefault()}),0))}},{key:"cancelBlurCheck",value:function(){clearTimeout(this.blurCheckTimeout)}},{key:"normalizeButtonFocus",value:function(e){var t=e.type,r=e.target;Object(f.includes)(["mouseup","touchend"],t)?this.preventBlurCheck=!1:function(e){switch(e.nodeName){case"A":case"BUTTON":return!0;case"INPUT":return Object(f.includes)(d,e.type)}return!1}(r)&&(this.preventBlurCheck=!0)}},{key:"render",value:function(){return Object(l.createElement)("div",{onFocus:this.cancelBlurCheck,onMouseDown:this.normalizeButtonFocus,onMouseUp:this.normalizeButtonFocus,onTouchStart:this.normalizeButtonFocus,onTouchEnd:this.normalizeButtonFocus,onBlur:this.queueBlurCheck},Object(l.createElement)(e,Object(n.a)({ref:this.bindNode},this.props)))}}]),m}(l.Component)}),"withFocusOutside")},,function(e,t,r){"use strict";var n=r(20),o=r(12),i=r(19),c=r(0),a=r(34),s=function(e){var t=e.icon,r=e.className,n=Object(i.a)(e,["icon","className"]),a=["dashicon","dashicons","dashicons-"+t,r].filter(Boolean).join(" ");return Object(c.createElement)("span",Object(o.a)({className:a},n))};function u(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function l(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?u(Object(r),!0).forEach((function(t){Object(n.a)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):u(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}t.a=function(e){var t=e.icon,r=void 0===t?null:t,n=e.size,u=Object(i.a)(e,["icon","size"]);if("string"==typeof r)return Object(c.createElement)(s,Object(o.a)({icon:r},u));if(r&&s===r.type)return Object(c.cloneElement)(r,l({},u));var f=n||24;if("function"==typeof r)return r.prototype instanceof c.Component?Object(c.createElement)(r,l({size:f},u)):r(l({size:f},u));if(r&&("svg"===r.type||r.type===a.SVG)){var p=l(l({width:f,height:f},r.props),u);return Object(c.createElement)(a.SVG,p)}return Object(c.isValidElement)(r)?Object(c.cloneElement)(r,l({size:f},u)):r}},function(e,t,r){"use strict";r.d(t,"a",(function(){return i}));var n=r(5),o=r.n(n),i=function(e){return e.reduce((function(e,t){var r=o()(t,2),n=r[0],i=r[1];return e[n]=i,e}),{})}},function(e,t,r){"use strict";r.d(t,"b",(function(){return c})),r.d(t,"c",(function(){return a})),r.d(t,"a",(function(){return s}));var n=r(2),o=r(87),i=r(72),c=function(e){var t=e.country,r=void 0===t?"":t,n=e.state,o=void 0===n?"":n,i=e.city,c=void 0===i?"":i,a=e.postcode,s=void 0===a?"":a;return{country:r.trim(),state:o.trim(),city:c.trim(),postcode:s?s.replace(" ","").toUpperCase():""}},a=function(e){var t=e.email,r=void 0===t?"":t;return Object(i.isEmail)(r)?r.trim():""},s=function(e){var t=Object.keys(n.defaultAddressFields),r=Object(o.a)(t,{},e.country),i=Object.assign({},e);return r.forEach((function(t){var r=t.key,n=void 0===r?"":r,o=t.hidden;void 0!==o&&o&&function(e,t){return e in t}(n,e)&&(i[n]="")})),i}},function(e,t,r){var n=r(68);e.exports=function(e){if(Array.isArray(e))return n(e)},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=window.wp.autop},function(e,t,r){"use strict";r.d(t,"a",(function(){return u})),r.d(t,"b",(function(){return f}));var n,o=r(4),i=r.n(o),c=r(7);function a(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function s(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?a(Object(r),!0).forEach((function(t){i()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):a(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}!function(e){e.ADD_EVENT_CALLBACK="add_event_callback",e.REMOVE_EVENT_CALLBACK="remove_event_callback"}(n||(n={}));var u={addEventCallback:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:10;return{id:Object(c.uniqueId)(),type:n.ADD_EVENT_CALLBACK,eventType:e,callback:t,priority:r}},removeEventCallback:function(e,t){return{id:t,type:n.REMOVE_EVENT_CALLBACK,eventType:e}}},l={},f=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:l,t=arguments.length>1?arguments[1]:void 0,r=t.type,o=t.eventType,c=t.id,a=t.callback,u=t.priority,f=e.hasOwnProperty(o)?new Map(e[o]):new Map;switch(r){case n.ADD_EVENT_CALLBACK:return f.set(c,{priority:u,callback:a}),s(s({},e),{},i()({},o,f));case n.REMOVE_EVENT_CALLBACK:return f.delete(c),s(s({},e),{},i()({},o,f))}}},function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));var n=r(3);function o(e,t){var r=Object(n.useRef)();return Object(n.useEffect)((function(){r.current===e||t&&!t(e,r.current)||(r.current=e)}),[e,t]),r.current}},function(e,t,r){"use strict";r.d(t,"a",(function(){return c}));var n=r(5),o=r.n(n),i=r(0),c=function(){var e=Object(i.useState)(),t=o()(e,2)[1];return Object(i.useCallback)((function(e){t((function(){throw e}))}),[])}},,function(e,t){var r,n,o=e.exports={};function i(){throw new Error("setTimeout has not been defined")}function c(){throw new Error("clearTimeout has not been defined")}function a(e){if(r===setTimeout)return setTimeout(e,0);if((r===i||!r)&&setTimeout)return r=setTimeout,setTimeout(e,0);try{return r(e,0)}catch(t){try{return r.call(null,e,0)}catch(t){return r.call(this,e,0)}}}!function(){try{r="function"==typeof setTimeout?setTimeout:i}catch(e){r=i}try{n="function"==typeof clearTimeout?clearTimeout:c}catch(e){n=c}}();var s,u=[],l=!1,f=-1;function p(){l&&s&&(l=!1,s.length?u=s.concat(u):f=-1,u.length&&d())}function d(){if(!l){var e=a(p);l=!0;for(var t=u.length;t;){for(s=u,u=[];++f<t;)s&&s[f].run();f=-1,t=u.length}s=null,l=!1,function(e){if(n===clearTimeout)return clearTimeout(e);if((n===c||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(e);try{n(e)}catch(t){try{return n.call(null,e)}catch(t){return n.call(this,e)}}}(e)}}function h(e,t){this.fun=e,this.array=t}function m(){}o.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];u.push(new h(e,t)),1!==u.length||l||a(d)},h.prototype.run=function(){this.fun.apply(null,this.array)},o.title="browser",o.browser=!0,o.env={},o.argv=[],o.version="",o.versions={},o.on=m,o.addListener=m,o.once=m,o.off=m,o.removeListener=m,o.removeAllListeners=m,o.emit=m,o.prependListener=m,o.prependOnceListener=m,o.listeners=function(e){return[]},o.binding=function(e){throw new Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(e){throw new Error("process.chdir is not supported")},o.umask=function(){return 0}},function(e,t,r){"use strict";r.d(t,"b",(function(){return E})),r.d(t,"a",(function(){return j}));var n=r(4),o=r.n(n),i=r(5),c=r.n(i),a=(r(10),r(0)),s=r(11),u=r(52),l=r(36),f=r(14),p=r.n(f),d=r(6),h=r.n(d),m=r(153),b=(r(112),function(e){var t=e.status;switch(void 0===t?"default":t){case"error":return"woocommerce-error";case"success":return"woocommerce-message";case"info":case"warning":return"woocommerce-info"}return""}),v=function(e){var t=e.className,r=e.notices,n=e.removeNotice,o=r.filter((function(e){return"snackbar"!==e.type}));if(!o.length)return null;var i=h()(t,"wc-block-components-notices");return React.createElement("div",{className:i},o.map((function(e){return React.createElement(m.a,p()({key:"store-notice-"+e.id},e,{className:h()("wc-block-components-notices__notice",b(e)),onRemove:function(){e.isDismissible&&n(e.id)}}),e.content)})))};function g(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function y(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?g(Object(r),!0).forEach((function(t){o()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):g(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var O=Object(a.createContext)({notices:[],createNotice:function(e,t,r){},removeNotice:function(e,t){},setIsSuppressed:function(e){},context:"wc/core"}),E=function(){return Object(a.useContext)(O)},j=function(e){var t=e.children,r=e.className,n=void 0===r?"":r,o=e.createNoticeContainer,i=void 0===o||o,f=e.context,p=void 0===f?"wc/core":f,d=Object(s.useDispatch)("core/notices"),h=d.createNotice,m=d.removeNotice,b=Object(a.useState)(!1),g=c()(b,2),E=g[0],j=g[1],S=Object(u.a)().dispatchStoreEvent,w=Object(l.a)().isEditor,_=Object(a.useCallback)((function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};h(e,t,y(y({},r),{},{context:r.context||p})),S("store-notice-create",{status:e,content:t,options:r})}),[h,S,p]),k=Object(a.useCallback)((function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:p;m(e,t)}),[m,p]),P={notices:Object(s.useSelect)((function(e){return{notices:e("core/notices").getNotices(p)}}),[p]).notices,createNotice:_,removeNotice:k,context:p,setIsSuppressed:j},R=E?null:React.createElement(v,{className:n,notices:P.notices,removeNotice:P.removeNotice,isEditor:w});return React.createElement(O.Provider,{value:P},i&&R,t)}},,function(e,t,r){"use strict";var n=r(1),o=(r(10),r(6)),i=r.n(o),c=(r(181),r(138));t.a=function(e){var t=e.children,r=e.className,o=e.screenReaderLabel,a=e.showSpinner,s=void 0!==a&&a,u=e.isLoading,l=void 0===u||u;return React.createElement("div",{className:i()(r,{"wc-block-components-loading-mask":l})},l&&s&&React.createElement(c.a,null),React.createElement("div",{className:i()({"wc-block-components-loading-mask__children":l}),"aria-hidden":l},t),l&&React.createElement("span",{className:"screen-reader-text"},o||Object(n.__)("Loading…",'woocommerce')))}},,function(e,t,r){"use strict";r.d(t,"a",(function(){return d}));var n=r(14),o=r.n(n),i=r(4),c=r.n(i),a=r(0),s=r(44);function u(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function l(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?u(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):u(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var f=[".wp-block-woocommerce-cart"],p=function(e){var t=e.Block,r=e.containers,n=e.getProps,i=void 0===n?function(){return{}}:n,c=e.getErrorBoundaryProps,u=void 0===c?function(){return{}}:c;0!==r.length&&Array.prototype.forEach.call(r,(function(e,r){var n=i(e,r),c=u(e,r),f=l(l({},e.dataset),n.attributes||{});e.classList.remove("is-loading"),Object(a.render)(React.createElement(s.a,c,React.createElement(a.Suspense,{fallback:React.createElement("div",{className:"wc-block-placeholder"})},React.createElement(t,o()({},n,{attributes:f})))),e)}))},d=function(e){var t,r,n,o,i,c,a,s=document.body.querySelectorAll(f.join(","));t=l(l({},e),{},{wrappers:s}),r=t.Block,n=t.getProps,o=t.getErrorBoundaryProps,i=t.selector,c=t.wrappers,a=document.body.querySelectorAll(i),c.length>0&&Array.prototype.filter.call(a,(function(e){return!function(e,t){return Array.prototype.some.call(t,(function(t){return t.contains(e)&&!t.isSameNode(e)}))}(e,c)})),p({Block:r,containers:a,getProps:n,getErrorBoundaryProps:o}),Array.prototype.forEach.call(s,(function(t){t.addEventListener("wc-blocks_render_blocks_frontend",(function(){var r,n,o,i,c,a;n=(r=l(l({},e),{},{wrapper:t})).Block,o=r.getProps,i=r.getErrorBoundaryProps,c=r.selector,a=r.wrapper.querySelectorAll(c),p({Block:n,containers:a,getProps:o,getErrorBoundaryProps:i})}))}))}},,,,,function(e,t){},function(e,t){e.exports=window.wp.wordcount},function(e,t,r){"use strict";var n=r(14),o=r.n(n),i=r(0),c=(r(142),function(e){if(e){var t=e.getBoundingClientRect().bottom;t>=0&&t<=window.innerHeight||e.scrollIntoView()}});t.a=function(e){return function(t){var r=Object(i.useRef)(null);return React.createElement(React.Fragment,null,React.createElement("div",{className:"with-scroll-to-top__scroll-point",ref:r,"aria-hidden":!0}),React.createElement(e,o()({},t,{scrollToTop:function(e){var t,n;null!==r.current&&(t=r.current,n=(e||{}).focusableSelector,window&&Number.isFinite(window.innerHeight)&&(n?function(e,t){var r,n=(null===(r=e.parentElement)||void 0===r?void 0:r.querySelectorAll(t))||[];if(n.length){var o=n[0];c(o),null==o||o.focus()}else c(e)}(t,n):c(t)))}})))}}},function(e,t,r){"use strict";r.d(t,"a",(function(){return c}));var n=r(3),o=r(82);function i(e,t){return e===t}function c(e,t,r){var c=r&&r.equalityFn?r.equalityFn:i,a=Object(n.useState)(e),s=a[0],u=a[1],l=Object(o.a)(Object(n.useCallback)((function(e){return u(e)}),[]),t,r),f=l[0],p=l[1],d=l[2],h=Object(n.useRef)(e);return Object(n.useEffect)((function(){c(h.current,e)||(f(e),h.current=e)}),[e,f,c]),[s,p,d]}},function(e,t,r){"use strict";var n=r(0),o=r(34),i=Object(n.createElement)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(n.createElement)(o.Path,{d:"M13 11.8l6.1-6.3-1-1-6.1 6.2-6.1-6.2-1 1 6.1 6.3-6.5 6.7 1 1 6.5-6.6 6.5 6.6 1-1z"}));t.a=i},function(e,t,r){"use strict";function n(e){return e&&"object"==typeof e&&"default"in e?e.default:e}Object.defineProperty(t,"__esModule",{value:!0});var o=n(r(14)),i=n(r(77)),c=r(3),a=n(c),s=n(r(144)),u=n(r(29)),l={arr:Array.isArray,obj:function(e){return"[object Object]"===Object.prototype.toString.call(e)},fun:function(e){return"function"==typeof e},str:function(e){return"string"==typeof e},num:function(e){return"number"==typeof e},und:function(e){return void 0===e},nul:function(e){return null===e},set:function(e){return e instanceof Set},map:function(e){return e instanceof Map},equ:function(e,t){if(typeof e!=typeof t)return!1;if(l.str(e)||l.num(e))return e===t;if(l.obj(e)&&l.obj(t)&&Object.keys(e).length+Object.keys(t).length===0)return!0;var r;for(r in e)if(!(r in t))return!1;for(r in t)if(e[r]!==t[r])return!1;return!l.und(r)||e===t}};function f(){var e=c.useState(!1)[1];return c.useCallback((function(){return e((function(e){return!e}))}),[])}function p(e,t){return l.und(e)||l.nul(e)?t:e}function d(e){return l.und(e)?[]:l.arr(e)?e:[e]}function h(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];return l.fun(e)?e.apply(void 0,r):e}function m(e){var t=function(e){return e.to,e.from,e.config,e.onStart,e.onRest,e.onFrame,e.children,e.reset,e.reverse,e.force,e.immediate,e.delay,e.attach,e.destroyed,e.interpolateTo,e.ref,e.lazy,i(e,["to","from","config","onStart","onRest","onFrame","children","reset","reverse","force","immediate","delay","attach","destroyed","interpolateTo","ref","lazy"])}(e);if(l.und(t))return o({to:t},e);var r=Object.keys(e).reduce((function(r,n){var i;return l.und(t[n])?o({},r,((i={})[n]=e[n],i)):r}),{});return o({to:t},r)}var b,v,g=function(){function e(){this.payload=void 0,this.children=[]}var t=e.prototype;return t.getAnimatedValue=function(){return this.getValue()},t.getPayload=function(){return this.payload||this},t.attach=function(){},t.detach=function(){},t.getChildren=function(){return this.children},t.addChild=function(e){0===this.children.length&&this.attach(),this.children.push(e)},t.removeChild=function(e){var t=this.children.indexOf(e);this.children.splice(t,1),0===this.children.length&&this.detach()},e}(),y=function(e){function t(){for(var t,r=arguments.length,n=new Array(r),o=0;o<r;o++)n[o]=arguments[o];return(t=e.call.apply(e,[this].concat(n))||this).payload=[],t.attach=function(){return t.payload.forEach((function(e){return e instanceof g&&e.addChild(u(t))}))},t.detach=function(){return t.payload.forEach((function(e){return e instanceof g&&e.removeChild(u(t))}))},t}return s(t,e),t}(g),O=function(e){function t(){for(var t,r=arguments.length,n=new Array(r),o=0;o<r;o++)n[o]=arguments[o];return(t=e.call.apply(e,[this].concat(n))||this).payload={},t.attach=function(){return Object.values(t.payload).forEach((function(e){return e instanceof g&&e.addChild(u(t))}))},t.detach=function(){return Object.values(t.payload).forEach((function(e){return e instanceof g&&e.removeChild(u(t))}))},t}s(t,e);var r=t.prototype;return r.getValue=function(e){void 0===e&&(e=!1);var t={};for(var r in this.payload){var n=this.payload[r];(!e||n instanceof g)&&(t[r]=n instanceof g?n[e?"getAnimatedValue":"getValue"]():n)}return t},r.getAnimatedValue=function(){return this.getValue(!0)},t}(g);function E(e,t){b={fn:e,transform:t}}function j(e){v=e}var S,w=function(e){return"undefined"!=typeof window?window.requestAnimationFrame(e):-1},_=function(e){"undefined"!=typeof window&&window.cancelAnimationFrame(e)};function k(e){S=e}var P,R=function(){return Date.now()};function x(e){P=e}var C,T,A=function(e){return e.current};function M(e){C=e}var N=Object.freeze({get applyAnimatedValues(){return b},injectApplyAnimatedValues:E,get colorNames(){return v},injectColorNames:j,get requestFrame(){return w},get cancelFrame(){return _},injectFrame:function(e,t){w=e,_=t},get interpolation(){return S},injectStringInterpolator:k,get now(){return R},injectNow:function(e){R=e},get defaultElement(){return P},injectDefaultElement:x,get animatedApi(){return A},injectAnimatedApi:function(e){A=e},get createAnimatedStyle(){return C},injectCreateAnimatedStyle:M,get manualFrameloop(){return T},injectManualFrameloop:function(e){T=e}}),D=function(e){function t(t,r){var n;return(n=e.call(this)||this).update=void 0,n.payload=t.style?o({},t,{style:C(t.style)}):t,n.update=r,n.attach(),n}return s(t,e),t}(O),I=!1,F=new Set,L=function e(){if(!I)return!1;var t=R(),r=F,n=Array.isArray(r),o=0;for(r=n?r:r[Symbol.iterator]();;){var i;if(n){if(o>=r.length)break;i=r[o++]}else{if((o=r.next()).done)break;i=o.value}for(var c=i,a=!1,s=0;s<c.configs.length;s++){for(var u=c.configs[s],l=void 0,f=void 0,p=0;p<u.animatedValues.length;p++){var d=u.animatedValues[p];if(!d.done){var h=u.fromValues[p],m=u.toValues[p],b=d.lastPosition,v=m instanceof g,y=Array.isArray(u.initialVelocity)?u.initialVelocity[p]:u.initialVelocity;if(v&&(m=m.getValue()),u.immediate)d.setValue(m),d.done=!0;else if("string"!=typeof h&&"string"!=typeof m){if(void 0!==u.duration)b=h+u.easing((t-d.startTime)/u.duration)*(m-h),l=t>=d.startTime+u.duration;else if(u.decay)b=h+y/(1-.998)*(1-Math.exp(-(1-.998)*(t-d.startTime))),(l=Math.abs(d.lastPosition-b)<.1)&&(m=b);else{f=void 0!==d.lastTime?d.lastTime:t,y=void 0!==d.lastVelocity?d.lastVelocity:u.initialVelocity,t>f+64&&(f=t);for(var O=Math.floor(t-f),E=0;E<O;++E)b+=1*(y+=(-u.tension*(b-m)+-u.friction*y)/u.mass*1/1e3)/1e3;var j=!(!u.clamp||0===u.tension)&&(h<m?b>m:b<m),S=Math.abs(y)<=u.precision,_=0===u.tension||Math.abs(m-b)<=u.precision;l=j||S&&_,d.lastVelocity=y,d.lastTime=t}v&&!u.toValues[p].done&&(l=!1),l?(d.value!==m&&(b=m),d.done=!0):a=!0,d.setValue(b),d.lastPosition=b}else d.setValue(m),d.done=!0}}c.props.onFrame&&(c.values[u.name]=u.interpolation.getValue())}c.props.onFrame&&c.props.onFrame(c.values),a||(F.delete(c),c.stop(!0))}return F.size?T?T():w(e):I=!1,I};function V(e,t,r){if("function"==typeof e)return e;if(Array.isArray(e))return V({range:e,output:t,extrapolate:r});if(S&&"string"==typeof e.output[0])return S(e);var n=e,o=n.output,i=n.range||[0,1],c=n.extrapolateLeft||n.extrapolate||"extend",a=n.extrapolateRight||n.extrapolate||"extend",s=n.easing||function(e){return e};return function(e){var t=function(e,t){for(var r=1;r<t.length-1&&!(t[r]>=e);++r);return r-1}(e,i);return function(e,t,r,n,o,i,c,a,s){var u=s?s(e):e;if(u<t){if("identity"===c)return u;"clamp"===c&&(u=t)}if(u>r){if("identity"===a)return u;"clamp"===a&&(u=r)}return n===o?n:t===r?e<=t?n:o:(t===-1/0?u=-u:r===1/0?u-=t:u=(u-t)/(r-t),u=i(u),n===-1/0?u=-u:o===1/0?u+=n:u=u*(o-n)+n,u)}(e,i[t],i[t+1],o[t],o[t+1],s,c,a,n.map)}}var B=function(e){function t(r,n,o,i){var c;return(c=e.call(this)||this).calc=void 0,c.payload=r instanceof y&&!(r instanceof t)?r.getPayload():Array.isArray(r)?r:[r],c.calc=V(n,o,i),c}s(t,e);var r=t.prototype;return r.getValue=function(){return this.calc.apply(this,this.payload.map((function(e){return e.getValue()})))},r.updateConfig=function(e,t,r){this.calc=V(e,t,r)},r.interpolate=function(e,r,n){return new t(this,e,r,n)},t}(y),U=function(e){function t(t){var r;return(r=e.call(this)||this).animatedStyles=new Set,r.value=void 0,r.startPosition=void 0,r.lastPosition=void 0,r.lastVelocity=void 0,r.startTime=void 0,r.lastTime=void 0,r.done=!1,r.setValue=function(e,t){void 0===t&&(t=!0),r.value=e,t&&r.flush()},r.value=t,r.startPosition=t,r.lastPosition=t,r}s(t,e);var r=t.prototype;return r.flush=function(){0===this.animatedStyles.size&&function e(t,r){"update"in t?r.add(t):t.getChildren().forEach((function(t){return e(t,r)}))}(this,this.animatedStyles),this.animatedStyles.forEach((function(e){return e.update()}))},r.clearStyles=function(){this.animatedStyles.clear()},r.getValue=function(){return this.value},r.interpolate=function(e,t,r){return new B(this,e,t,r)},t}(g),H=function(e){function t(t){var r;return(r=e.call(this)||this).payload=t.map((function(e){return new U(e)})),r}s(t,e);var r=t.prototype;return r.setValue=function(e,t){var r=this;void 0===t&&(t=!0),Array.isArray(e)?e.length===this.payload.length&&e.forEach((function(e,n){return r.payload[n].setValue(e,t)})):this.payload.forEach((function(r){return r.setValue(e,t)}))},r.getValue=function(){return this.payload.map((function(e){return e.getValue()}))},r.interpolate=function(e,t){return new B(this,e,t)},t}(y),G=0,z=function(){function e(){var e=this;this.id=void 0,this.idle=!0,this.hasChanged=!1,this.guid=0,this.local=0,this.props={},this.merged={},this.animations={},this.interpolations={},this.values={},this.configs=[],this.listeners=[],this.queue=[],this.localQueue=void 0,this.getValues=function(){return e.interpolations},this.id=G++}var t=e.prototype;return t.update=function(e){if(!e)return this;var t=m(e),r=t.delay,n=void 0===r?0:r,c=t.to,a=i(t,["delay","to"]);if(l.arr(c)||l.fun(c))this.queue.push(o({},a,{delay:n,to:c}));else if(c){var s={};Object.entries(c).forEach((function(e){var t,r=e[0],i=e[1],c=o({to:(t={},t[r]=i,t),delay:h(n,r)},a),u=s[c.delay]&&s[c.delay].to;s[c.delay]=o({},s[c.delay],c,{to:o({},u,c.to)})})),this.queue=Object.values(s)}return this.queue=this.queue.sort((function(e,t){return e.delay-t.delay})),this.diff(a),this},t.start=function(e){var t=this;if(this.queue.length){this.idle=!1,this.localQueue&&this.localQueue.forEach((function(e){var r=e.from,n=void 0===r?{}:r,i=e.to,c=void 0===i?{}:i;l.obj(n)&&(t.merged=o({},n,t.merged)),l.obj(c)&&(t.merged=o({},t.merged,c))}));var r=this.local=++this.guid,n=this.localQueue=this.queue;this.queue=[],n.forEach((function(o,c){var a=o.delay,s=i(o,["delay"]),u=function(o){c===n.length-1&&r===t.guid&&o&&(t.idle=!0,t.props.onRest&&t.props.onRest(t.merged)),e&&e()},f=l.arr(s.to)||l.fun(s.to);a?setTimeout((function(){r===t.guid&&(f?t.runAsync(s,u):t.diff(s).start(u))}),a):f?t.runAsync(s,u):t.diff(s).start(u)}))}else l.fun(e)&&this.listeners.push(e),this.props.onStart&&this.props.onStart(),this,F.has(this)||F.add(this),I||(I=!0,w(T||L));return this},t.stop=function(e){return this.listeners.forEach((function(t){return t(e)})),this.listeners=[],this},t.pause=function(e){return this.stop(!0),e&&(this,F.has(this)&&F.delete(this)),this},t.runAsync=function(e,t){var r=this,n=(e.delay,i(e,["delay"])),c=this.local,a=Promise.resolve(void 0);if(l.arr(n.to))for(var s=function(e){var t=e,i=o({},n,m(n.to[t]));l.arr(i.config)&&(i.config=i.config[t]),a=a.then((function(){if(c===r.guid)return new Promise((function(e){return r.diff(i).start(e)}))}))},u=0;u<n.to.length;u++)s(u);else if(l.fun(n.to)){var f,p=0;a=a.then((function(){return n.to((function(e){var t=o({},n,m(e));if(l.arr(t.config)&&(t.config=t.config[p]),p++,c===r.guid)return f=new Promise((function(e){return r.diff(t).start(e)}))}),(function(e){return void 0===e&&(e=!0),r.stop(e)})).then((function(){return f}))}))}a.then(t)},t.diff=function(e){var t=this;this.props=o({},this.props,e);var r=this.props,n=r.from,i=void 0===n?{}:n,c=r.to,a=void 0===c?{}:c,s=r.config,u=void 0===s?{}:s,f=r.reverse,m=r.attach,b=r.reset,g=r.immediate;if(f){var y=[a,i];i=y[0],a=y[1]}this.merged=o({},i,this.merged,a),this.hasChanged=!1;var O=m&&m(this);if(this.animations=Object.entries(this.merged).reduce((function(e,r){var n=r[0],c=r[1],a=e[n]||{},s=l.num(c),f=l.str(c)&&!c.startsWith("#")&&!/\d/.test(c)&&!v[c],m=l.arr(c),y=!s&&!m&&!f,E=l.und(i[n])?c:i[n],j=s||m||f?c:1,w=h(u,n);O&&(j=O.animations[n].parent);var _,k=a.parent,P=a.interpolation,x=d(O?j.getPayload():j),C=c;y&&(C=S({range:[0,1],output:[c,c]})(1));var T,A=P&&P.getValue(),M=!l.und(k)&&a.animatedValues.some((function(e){return!e.done})),N=!l.equ(C,A),D=!l.equ(C,a.previous),I=!l.equ(w,a.config);if(b||D&&N||I){var F;if(s||f)k=P=a.parent||new U(E);else if(m)k=P=a.parent||new H(E);else if(y){var L=a.interpolation&&a.interpolation.calc(a.parent.value);L=void 0===L||b?E:L,a.parent?(k=a.parent).setValue(0,!1):k=new U(0);var V={output:[L,c]};a.interpolation?(P=a.interpolation,a.interpolation.updateConfig(V)):P=k.interpolate(V)}return x=d(O?j.getPayload():j),_=d(k.getPayload()),b&&!y&&k.setValue(E,!1),t.hasChanged=!0,_.forEach((function(e){e.startPosition=e.value,e.lastPosition=e.value,e.lastVelocity=M?e.lastVelocity:void 0,e.lastTime=M?e.lastTime:void 0,e.startTime=R(),e.done=!1,e.animatedStyles.clear()})),h(g,n)&&k.setValue(y?j:c,!1),o({},e,((F={})[n]=o({},a,{name:n,parent:k,interpolation:P,animatedValues:_,toValues:x,previous:C,config:w,fromValues:d(k.getValue()),immediate:h(g,n),initialVelocity:p(w.velocity,0),clamp:p(w.clamp,!1),precision:p(w.precision,.01),tension:p(w.tension,170),friction:p(w.friction,26),mass:p(w.mass,1),duration:w.duration,easing:p(w.easing,(function(e){return e})),decay:w.decay}),F))}return N?e:(y&&(k.setValue(1,!1),P.updateConfig({output:[C,C]})),k.done=!0,t.hasChanged=!0,o({},e,((T={})[n]=o({},e[n],{previous:C}),T)))}),this.animations),this.hasChanged)for(var E in this.configs=Object.values(this.animations),this.values={},this.interpolations={},this.animations)this.interpolations[E]=this.animations[E].interpolation,this.values[E]=this.animations[E].interpolation.getValue();return this},t.destroy=function(){this.stop(),this.props={},this.merged={},this.animations={},this.interpolations={},this.values={},this.configs=[],this.local=0},e}(),q=function(e,t){var r=c.useRef(!1),n=c.useRef(),o=l.fun(t),i=c.useMemo((function(){var r;return n.current&&(n.current.map((function(e){return e.destroy()})),n.current=void 0),[new Array(e).fill().map((function(e,n){var i=new z,c=o?h(t,n,i):t[n];return 0===n&&(r=c.ref),i.update(c),r||i.start(),i})),r]}),[e]),a=i[0],s=i[1];n.current=a,c.useImperativeHandle(s,(function(){return{start:function(){return Promise.all(n.current.map((function(e){return new Promise((function(t){return e.start(t)}))})))},stop:function(e){return n.current.forEach((function(t){return t.stop(e)}))},get controllers(){return n.current}}}));var u=c.useMemo((function(){return function(e){return n.current.map((function(t,r){t.update(o?h(e,r,t):e[r]),s||t.start()}))}}),[e]);c.useEffect((function(){r.current?o||u(t):s||n.current.forEach((function(e){return e.start()}))})),c.useEffect((function(){return r.current=!0,function(){return n.current.forEach((function(e){return e.destroy()}))}}),[]);var f=n.current.map((function(e){return e.getValues()}));return o?[f,u,function(e){return n.current.forEach((function(t){return t.pause(e)}))}]:f},W=0,Y=function(e,t){return("function"==typeof t?e.map(t):d(t)).map(String)},K=function(e){var t=e.items,r=e.keys,n=void 0===r?function(e){return e}:r,c=i(e,["items","keys"]);return t=d(void 0!==t?t:null),o({items:t,keys:Y(t,n)},c)};function X(e,t){var r=function(){if(o){if(i>=n.length)return"break";c=n[i++]}else{if((i=n.next()).done)return"break";c=i.value}var r=c.key,a=function(e){return e.key!==r};(l.und(t)||t===r)&&(e.current.instances.delete(r),e.current.transitions=e.current.transitions.filter(a),e.current.deleted=e.current.deleted.filter(a))},n=e.current.deleted,o=Array.isArray(n),i=0;for(n=o?n:n[Symbol.iterator]();;){var c;if("break"===r())break}e.current.forceUpdate()}var $=function(e){function t(t){var r;return void 0===t&&(t={}),r=e.call(this)||this,!t.transform||t.transform instanceof g||(t=b.transform(t)),r.payload=t,r}return s(t,e),t}(O),J={transparent:0,aliceblue:4042850303,antiquewhite:4209760255,aqua:16777215,aquamarine:2147472639,azure:4043309055,beige:4126530815,bisque:4293182719,black:255,blanchedalmond:4293643775,blue:65535,blueviolet:2318131967,brown:2771004159,burlywood:3736635391,burntsienna:3934150143,cadetblue:1604231423,chartreuse:2147418367,chocolate:3530104575,coral:4286533887,cornflowerblue:1687547391,cornsilk:4294499583,crimson:3692313855,cyan:16777215,darkblue:35839,darkcyan:9145343,darkgoldenrod:3095792639,darkgray:2846468607,darkgreen:6553855,darkgrey:2846468607,darkkhaki:3182914559,darkmagenta:2332068863,darkolivegreen:1433087999,darkorange:4287365375,darkorchid:2570243327,darkred:2332033279,darksalmon:3918953215,darkseagreen:2411499519,darkslateblue:1211993087,darkslategray:793726975,darkslategrey:793726975,darkturquoise:13554175,darkviolet:2483082239,deeppink:4279538687,deepskyblue:12582911,dimgray:1768516095,dimgrey:1768516095,dodgerblue:512819199,firebrick:2988581631,floralwhite:4294635775,forestgreen:579543807,fuchsia:4278255615,gainsboro:3705462015,ghostwhite:4177068031,gold:4292280575,goldenrod:3668254975,gray:2155905279,green:8388863,greenyellow:2919182335,grey:2155905279,honeydew:4043305215,hotpink:4285117695,indianred:3445382399,indigo:1258324735,ivory:4294963455,khaki:4041641215,lavender:3873897215,lavenderblush:4293981695,lawngreen:2096890111,lemonchiffon:4294626815,lightblue:2916673279,lightcoral:4034953471,lightcyan:3774873599,lightgoldenrodyellow:4210742015,lightgray:3553874943,lightgreen:2431553791,lightgrey:3553874943,lightpink:4290167295,lightsalmon:4288707327,lightseagreen:548580095,lightskyblue:2278488831,lightslategray:2005441023,lightslategrey:2005441023,lightsteelblue:2965692159,lightyellow:4294959359,lime:16711935,limegreen:852308735,linen:4210091775,magenta:4278255615,maroon:2147483903,mediumaquamarine:1724754687,mediumblue:52735,mediumorchid:3126187007,mediumpurple:2473647103,mediumseagreen:1018393087,mediumslateblue:2070474495,mediumspringgreen:16423679,mediumturquoise:1221709055,mediumvioletred:3340076543,midnightblue:421097727,mintcream:4127193855,mistyrose:4293190143,moccasin:4293178879,navajowhite:4292783615,navy:33023,oldlace:4260751103,olive:2155872511,olivedrab:1804477439,orange:4289003775,orangered:4282712319,orchid:3664828159,palegoldenrod:4008225535,palegreen:2566625535,paleturquoise:2951671551,palevioletred:3681588223,papayawhip:4293907967,peachpuff:4292524543,peru:3448061951,pink:4290825215,plum:3718307327,powderblue:2967529215,purple:2147516671,rebeccapurple:1714657791,red:4278190335,rosybrown:3163525119,royalblue:1097458175,saddlebrown:2336560127,salmon:4202722047,sandybrown:4104413439,seagreen:780883967,seashell:4294307583,sienna:2689740287,silver:3233857791,skyblue:2278484991,slateblue:1784335871,slategray:1887473919,slategrey:1887473919,snow:4294638335,springgreen:16744447,steelblue:1182971135,tan:3535047935,teal:8421631,thistle:3636451583,tomato:4284696575,turquoise:1088475391,violet:4001558271,wheat:4125012991,white:4294967295,whitesmoke:4126537215,yellow:4294902015,yellowgreen:2597139199},Q="[-+]?\\d*\\.?\\d+";function Z(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return"\\(\\s*("+t.join(")\\s*,\\s*(")+")\\s*\\)"}var ee=new RegExp("rgb"+Z(Q,Q,Q)),te=new RegExp("rgba"+Z(Q,Q,Q,Q)),re=new RegExp("hsl"+Z(Q,"[-+]?\\d*\\.?\\d+%","[-+]?\\d*\\.?\\d+%")),ne=new RegExp("hsla"+Z(Q,"[-+]?\\d*\\.?\\d+%","[-+]?\\d*\\.?\\d+%",Q)),oe=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,ie=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,ce=/^#([0-9a-fA-F]{6})$/,ae=/^#([0-9a-fA-F]{8})$/;function se(e,t,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?e+6*(t-e)*r:r<.5?t:r<2/3?e+(t-e)*(2/3-r)*6:e}function ue(e,t,r){var n=r<.5?r*(1+t):r+t-r*t,o=2*r-n,i=se(o,n,e+1/3),c=se(o,n,e),a=se(o,n,e-1/3);return Math.round(255*i)<<24|Math.round(255*c)<<16|Math.round(255*a)<<8}function le(e){var t=parseInt(e,10);return t<0?0:t>255?255:t}function fe(e){return(parseFloat(e)%360+360)%360/360}function pe(e){var t=parseFloat(e);return t<0?0:t>1?255:Math.round(255*t)}function de(e){var t=parseFloat(e);return t<0?0:t>100?1:t/100}function he(e){var t,r,n="number"==typeof(t=e)?t>>>0===t&&t>=0&&t<=4294967295?t:null:(r=ce.exec(t))?parseInt(r[1]+"ff",16)>>>0:J.hasOwnProperty(t)?J[t]:(r=ee.exec(t))?(le(r[1])<<24|le(r[2])<<16|le(r[3])<<8|255)>>>0:(r=te.exec(t))?(le(r[1])<<24|le(r[2])<<16|le(r[3])<<8|pe(r[4]))>>>0:(r=oe.exec(t))?parseInt(r[1]+r[1]+r[2]+r[2]+r[3]+r[3]+"ff",16)>>>0:(r=ae.exec(t))?parseInt(r[1],16)>>>0:(r=ie.exec(t))?parseInt(r[1]+r[1]+r[2]+r[2]+r[3]+r[3]+r[4]+r[4],16)>>>0:(r=re.exec(t))?(255|ue(fe(r[1]),de(r[2]),de(r[3])))>>>0:(r=ne.exec(t))?(ue(fe(r[1]),de(r[2]),de(r[3]))|pe(r[4]))>>>0:null;return null===n?e:"rgba("+((4278190080&(n=n||0))>>>24)+", "+((16711680&n)>>>16)+", "+((65280&n)>>>8)+", "+(255&n)/255+")"}var me=/[+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,be=/(#(?:[0-9a-f]{2}){2,4}|(#[0-9a-f]{3})|(rgb|hsl)a?\((-?\d+%?[,\s]+){2,3}\s*[\d\.]+%?\))/gi,ve=new RegExp("("+Object.keys(J).join("|")+")","g"),ge={animationIterationCount:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},ye=["Webkit","Ms","Moz","O"];function Oe(e,t,r){return null==t||"boolean"==typeof t||""===t?"":r||"number"!=typeof t||0===t||ge.hasOwnProperty(e)&&ge[e]?(""+t).trim():t+"px"}ge=Object.keys(ge).reduce((function(e,t){return ye.forEach((function(r){return e[function(e,t){return e+t.charAt(0).toUpperCase()+t.substring(1)}(r,t)]=e[t]})),e}),ge);var Ee={};M((function(e){return new $(e)})),x("div"),k((function(e){var t=e.output.map((function(e){return e.replace(be,he)})).map((function(e){return e.replace(ve,he)})),r=t[0].match(me).map((function(){return[]}));t.forEach((function(e){e.match(me).forEach((function(e,t){return r[t].push(+e)}))}));var n=t[0].match(me).map((function(t,n){return V(o({},e,{output:r[n]}))}));return function(e){var r=0;return t[0].replace(me,(function(){return n[r++](e)})).replace(/rgba\(([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+)\)/gi,(function(e,t,r,n,o){return"rgba("+Math.round(t)+", "+Math.round(r)+", "+Math.round(n)+", "+o+")"}))}})),j(J),E((function(e,t){if(!e.nodeType||void 0===e.setAttribute)return!1;var r=t.style,n=t.children,o=t.scrollTop,c=t.scrollLeft,a=i(t,["style","children","scrollTop","scrollLeft"]),s="filter"===e.nodeName||e.parentNode&&"filter"===e.parentNode.nodeName;for(var u in void 0!==o&&(e.scrollTop=o),void 0!==c&&(e.scrollLeft=c),void 0!==n&&(e.textContent=n),r)if(r.hasOwnProperty(u)){var l=0===u.indexOf("--"),f=Oe(u,r[u],l);"float"===u&&(u="cssFloat"),l?e.style.setProperty(u,f):e.style[u]=f}for(var p in a){var d=s?p:Ee[p]||(Ee[p]=p.replace(/([A-Z])/g,(function(e){return"-"+e.toLowerCase()})));void 0!==e.getAttribute(d)&&e.setAttribute(d,a[p])}}),(function(e){return e}));var je,Se,we=(je=function(e){return c.forwardRef((function(t,r){var n=f(),s=c.useRef(!0),u=c.useRef(null),p=c.useRef(null),d=c.useCallback((function(e){var t=u.current;u.current=new D(e,(function(){var e=!1;p.current&&(e=b.fn(p.current,u.current.getAnimatedValue())),p.current&&!1!==e||n()})),t&&t.detach()}),[]);c.useEffect((function(){return function(){s.current=!1,u.current&&u.current.detach()}}),[]),c.useImperativeHandle(r,(function(){return A(p,s,n)})),d(t);var h,m=u.current.getValue(),v=(m.scrollTop,m.scrollLeft,i(m,["scrollTop","scrollLeft"])),g=(h=e,!l.fun(h)||h.prototype instanceof a.Component?function(e){return p.current=function(e,t){return t&&(l.fun(t)?t(e):l.obj(t)&&(t.current=e)),e}(e,r)}:void 0);return a.createElement(e,o({},v,{ref:g}))}))},void 0===(Se=!1)&&(Se=!0),function(e){return(l.arr(e)?e:Object.keys(e)).reduce((function(e,t){var r=Se?t[0].toLowerCase()+t.substring(1):t;return e[r]=je(r),e}),je)}),_e=we(["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"]);t.apply=we,t.config={default:{tension:170,friction:26},gentle:{tension:120,friction:14},wobbly:{tension:180,friction:12},stiff:{tension:210,friction:20},slow:{tension:280,friction:60},molasses:{tension:280,friction:120}},t.update=L,t.animated=_e,t.a=_e,t.interpolate=function(e,t,r){return e&&new B(e,t,r)},t.Globals=N,t.useSpring=function(e){var t=l.fun(e),r=q(1,t?e:[e]),n=r[0],o=r[1],i=r[2];return t?[n[0],o,i]:n},t.useTrail=function(e,t){var r=c.useRef(!1),n=l.fun(t),i=h(t),a=c.useRef(),s=q(e,(function(e,t){return 0===e&&(a.current=[]),a.current.push(t),o({},i,{config:h(i.config,e),attach:e>0&&function(){return a.current[e-1]}})})),u=s[0],f=s[1],p=s[2],d=c.useMemo((function(){return function(e){return f((function(t,r){e.reverse;var n=e.reverse?t+1:t-1,c=a.current[n];return o({},e,{config:h(e.config||i.config,t),attach:c&&function(){return c}})}))}}),[e,i.reverse]);return c.useEffect((function(){r.current&&!n&&d(t)})),c.useEffect((function(){r.current=!0}),[]),n?[u,d,p]:u},t.useTransition=function(e,t,r){var n=o({items:e,keys:t||function(e){return e}},r),a=K(n),s=a.lazy,u=void 0!==s&&s,l=(a.unique,a.reset),p=void 0!==l&&l,d=(a.enter,a.leave,a.update,a.onDestroyed),m=(a.keys,a.items,a.onFrame),b=a.onRest,v=a.onStart,g=a.ref,y=i(a,["lazy","unique","reset","enter","leave","update","onDestroyed","keys","items","onFrame","onRest","onStart","ref"]),O=f(),E=c.useRef(!1),j=c.useRef({mounted:!1,first:!0,deleted:[],current:{},transitions:[],prevProps:{},paused:!!n.ref,instances:!E.current&&new Map,forceUpdate:O});return c.useImperativeHandle(n.ref,(function(){return{start:function(){return Promise.all(Array.from(j.current.instances).map((function(e){var t=e[1];return new Promise((function(e){return t.start(e)}))})))},stop:function(e){return Array.from(j.current.instances).forEach((function(t){return t[1].stop(e)}))},get controllers(){return Array.from(j.current.instances).map((function(e){return e[1]}))}}})),j.current=function(e,t){for(var r=e.first,n=e.prevProps,c=i(e,["first","prevProps"]),a=K(t),s=a.items,u=a.keys,l=a.initial,f=a.from,p=a.enter,d=a.leave,m=a.update,b=a.trail,v=void 0===b?0:b,g=a.unique,y=a.config,O=a.order,E=void 0===O?["enter","leave","update"]:O,j=K(n),S=j.keys,w=j.items,_=o({},c.current),k=[].concat(c.deleted),P=Object.keys(_),R=new Set(P),x=new Set(u),C=u.filter((function(e){return!R.has(e)})),T=c.transitions.filter((function(e){return!e.destroyed&&!x.has(e.originalKey)})).map((function(e){return e.originalKey})),A=u.filter((function(e){return R.has(e)})),M=-v;E.length;)switch(E.shift()){case"enter":C.forEach((function(e,t){g&&k.find((function(t){return t.originalKey===e}))&&(k=k.filter((function(t){return t.originalKey!==e})));var n=u.indexOf(e),o=s[n],i=r&&void 0!==l?"initial":"enter";_[e]={slot:i,originalKey:e,key:g?String(e):W++,item:o,trail:M+=v,config:h(y,o,i),from:h(r&&void 0!==l?l||{}:f,o),to:h(p,o)}}));break;case"leave":T.forEach((function(e){var t=S.indexOf(e),r=w[t];k.unshift(o({},_[e],{slot:"leave",destroyed:!0,left:S[Math.max(0,t-1)],right:S[Math.min(S.length,t+1)],trail:M+=v,config:h(y,r,"leave"),to:h(d,r)})),delete _[e]}));break;case"update":A.forEach((function(e){var t=u.indexOf(e),r=s[t];_[e]=o({},_[e],{item:r,slot:"update",trail:M+=v,config:h(y,r,"update"),to:h(m,r)})}))}var N=u.map((function(e){return _[e]}));return k.forEach((function(e){var t,r=e.left,n=(e.right,i(e,["left","right"]));-1!==(t=N.findIndex((function(e){return e.originalKey===r})))&&(t+=1),t=Math.max(0,t),N=[].concat(N.slice(0,t),[n],N.slice(t))})),o({},c,{changed:C.length||T.length||A.length,first:r&&0===C.length,transitions:N,current:_,deleted:k,prevProps:t})}(j.current,n),j.current.changed&&j.current.transitions.forEach((function(e){var t=e.slot,r=e.from,n=e.to,i=e.config,c=e.trail,a=e.key,s=e.item;j.current.instances.has(a)||j.current.instances.set(a,new z);var l=j.current.instances.get(a),f=o({},y,{to:n,from:r,config:i,ref:g,onRest:function(r){j.current.mounted&&(e.destroyed&&(g||u||X(j,a),d&&d(s)),!Array.from(j.current.instances).some((function(e){return!e[1].idle}))&&(g||u)&&j.current.deleted.length>0&&X(j),b&&b(s,t,r))},onStart:v&&function(){return v(s,t)},onFrame:m&&function(e){return m(s,t,e)},delay:c,reset:p&&"enter"===t});l.update(f),j.current.paused||l.start()})),c.useEffect((function(){return j.current.mounted=E.current=!0,function(){j.current.mounted=E.current=!1,Array.from(j.current.instances).map((function(e){return e[1].destroy()})),j.current.instances.clear()}}),[]),j.current.transitions.map((function(e){var t=e.item,r=e.slot,n=e.key;return{item:t,key:n,state:r,props:j.current.instances.get(n).getValues()}}))},t.useChain=function(e,t,r){void 0===r&&(r=1e3);var n=c.useRef();c.useEffect((function(){l.equ(e,n.current)?e.forEach((function(e){var t=e.current;return t&&t.start()})):t?e.forEach((function(e,n){var i=e.current;if(i){var c=i.controllers;if(c.length){var a=r*t[n];c.forEach((function(e){e.queue=e.queue.map((function(e){return o({},e,{delay:e.delay+a})})),e.start()}))}}})):e.reduce((function(e,t,r){var n=t.current;return e.then((function(){return n.start()}))}),Promise.resolve()),n.current=e}))},t.useSprings=q},function(e,t,r){"use strict";r.d(t,"a",(function(){return a}));var n=r(11),o=r(0),i=r(8),c=r(100),a=function(){var e=Object(c.a)(),t=Object(n.useDispatch)(i.CART_STORE_KEY).selectShippingRate;return{selectShippingRate:Object(o.useCallback)((function(r,n){t(r,n).catch((function(t){e(t)}))}),[e,t]),isSelectingRate:Object(n.useSelect)((function(e){return e(i.CART_STORE_KEY).isShippingRateBeingSelected()}),[])}}},,,,,,,,,function(e,t,r){"use strict";r.d(t,"b",(function(){return y})),r.d(t,"a",(function(){return O}));var n=r(21),o=r.n(n),i=r(4),c=r.n(i),a=r(23),s=r.n(a),u=r(5),l=r.n(u),f=r(0),p=r(7),d=r(25),h=r.n(d);function m(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function b(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?m(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):m(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function v(e){var t=function(e,t){if("object"!==o()(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!==o()(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===o()(t)?t:String(t)}var g=Object(f.createContext)({getValidationError:function(){return""},setValidationErrors:function(e){},clearValidationError:function(e){},clearAllValidationErrors:function(){},hideValidationError:function(){},showValidationError:function(){},showAllValidationErrors:function(){},hasValidationErrors:!1,getValidationErrorId:function(e){return e}}),y=function(){return Object(f.useContext)(g)},O=function(e){var t=e.children,r=Object(f.useState)({}),n=l()(r,2),o=n[0],i=n[1],a=Object(f.useCallback)((function(e){return o[e]}),[o]),u=Object(f.useCallback)((function(e){var t=o[e];return!t||t.hidden?"":"validate-error-".concat(e)}),[o]),d=Object(f.useCallback)((function(e){i((function(t){return t[e]?(t[e],s()(t,[e].map(v))):t}))}),[]),m=Object(f.useCallback)((function(){i({})}),[]),y=Object(f.useCallback)((function(e){e&&i((function(t){return e=Object(p.pickBy)(e,(function(e,r){return!("string"!=typeof e.message||t.hasOwnProperty(r)&&h()(t[r],e))})),0===Object.values(e).length?t:b(b({},t),e)}))}),[]),O=Object(f.useCallback)((function(e,t){i((function(r){if(!r.hasOwnProperty(e))return r;var n=b(b({},r[e]),t);return h()(r[e],n)?r:b(b({},r),{},c()({},e,n))}))}),[]),E={getValidationError:a,setValidationErrors:y,clearValidationError:d,clearAllValidationErrors:m,hideValidationError:Object(f.useCallback)((function(e){O(e,{hidden:!0})}),[O]),showValidationError:Object(f.useCallback)((function(e){O(e,{hidden:!1})}),[O]),showAllValidationErrors:Object(f.useCallback)((function(){i((function(e){var t={};return Object.keys(e).forEach((function(r){e[r].hidden&&(t[r]=b(b({},e[r]),{},{hidden:!1}))})),0===Object.values(t).length?e:b(b({},e),t)}))}),[]),hasValidationErrors:Object.keys(o).length>0,getValidationErrorId:u};return React.createElement(g.Provider,{value:E},t)}},function(e,t,r){"use strict";var n=r(0),o=r(8),i=r(11),c=r(83);t.a=function(e){return function(t){var r;return r=Object(n.useRef)(c.n.restApiRoutes||{}),Object(i.useSelect)((function(e,t){if(r.current){var n=e(o.SCHEMA_STORE_KEY),i=n.isResolving,c=n.hasFinishedResolution,a=t.dispatch(o.SCHEMA_STORE_KEY),s=a.receiveRoutes,u=a.startResolution,l=a.finishResolution;Object.keys(r.current).forEach((function(e){var t=r.current[e];i("getRoutes",[e])||c("getRoutes",[e])||(u("getRoutes",[e]),s(t,[e]),l("getRoutes",[e]))}))}}),[]),React.createElement(e,t)}}},function(e,t,r){var n=r(157),o=r(130),i=o.setStyleProp,c=n.html,a=n.svg,s=n.isCustomAttribute,u=Object.prototype.hasOwnProperty;e.exports=function(e){var t,r,n,l;e=e||{};var f={};for(t in e)n=e[t],s(t)?f[t]=n:(r=t.toLowerCase(),u.call(c,r)?f[(l=c[r]).propertyName]=!!(l.hasBooleanValue||l.hasOverloadedBooleanValue&&!n)||n:u.call(a,t)?f[(l=a[t]).propertyName]=n:o.PRESERVE_CUSTOM_ATTRIBUTES&&(f[t]=n));return i(e.style,f),f}},function(e,t,r){var n=r(3),o=r(161).default,i={reactCompat:!0},c=n.version.split(".")[0]>=16;e.exports={PRESERVE_CUSTOM_ATTRIBUTES:c,invertObject:function(e,t){if(!e||"object"!=typeof e)throw new TypeError("First argument must be an object");var r,n,o="function"==typeof t,i={},c={};for(r in e)n=e[r],o&&(i=t(r,n))&&2===i.length?c[i[0]]=i[1]:"string"==typeof n&&(c[n]=r);return c},isCustomComponent:function(e,t){if(-1===e.indexOf("-"))return t&&"string"==typeof t.is;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}},setStyleProp:function(e,t){null!=e&&(t.style=o(e,i))}}},function(e,t,r){for(var n,o=r(167).CASE_SENSITIVE_TAG_NAMES,i={},c=0,a=o.length;c<a;c++)n=o[c],i[n.toLowerCase()]=n;function s(e){for(var t,r={},n=0,o=e.length;n<o;n++)r[(t=e[n]).name]=t.value;return r}function u(e){return function(e){return i[e]}(e=e.toLowerCase())||e}e.exports={formatAttributes:s,formatDOM:function e(t,r,n){r=r||null;for(var o,i,c,a=[],l=0,f=t.length;l<f;l++){switch(o=t[l],c={next:null,prev:a[l-1]||null,parent:r},(i=a[l-1])&&(i.next=c),"#"!==o.nodeName[0]&&(c.name=u(o.nodeName),c.attribs={},o.attributes&&o.attributes.length&&(c.attribs=s(o.attributes))),o.nodeType){case 1:"script"===c.name||"style"===c.name?c.type=c.name:c.type="tag",c.children=e(o.childNodes,c);break;case 3:c.type="text",c.data=o.nodeValue;break;case 8:c.type="comment",c.data=o.nodeValue}a.push(c)}return n&&(a.unshift({name:n.substring(0,n.indexOf(" ")).toLowerCase(),data:n,type:"directive",next:a[0]?a[0]:null,prev:null,parent:r}),a[1]&&(a[1].prev=a[0])),a},isIE:function(e){return e?document.documentMode===e:/(MSIE |Trident\/|Edge\/)/.test(navigator.userAgent)}}},function(e,t,r){"use strict";r.d(t,"a",(function(){return s})),r.d(t,"b",(function(){return u}));var n=r(39),o=r.n(n),i=r(27),c=r.n(i),a=r(1),s=function(){var e=o()(c.a.mark((function e(t){var r;return c.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("function"!=typeof t.json){e.next=11;break}return e.prev=1,e.next=4,t.json();case 4:return r=e.sent,e.abrupt("return",{message:r.message,type:r.type||"api"});case 8:return e.prev=8,e.t0=e.catch(1),e.abrupt("return",{message:e.t0.message,type:"general"});case 11:return e.abrupt("return",{message:t.message,type:t.type||"general"});case 12:case"end":return e.stop()}}),e,null,[[1,8]])})));return function(_x){return e.apply(this,arguments)}}(),u=function(e){if(e.data&&"rest_invalid_param"===e.code){var t=Object.values(e.data.params);if(t[0])return t[0]}return(null==e?void 0:e.message)||Object(a.__)("Something went wrong. Please contact us to get assistance.",'woocommerce')}},,function(e,t,r){"use strict";(function(e){var n=r(0),o=r(7),i=r(6),c=r.n(i),a=r(33),s=r(1),u=(r(74),r(76));t.a=Object(n.forwardRef)((function(t,r){var i=t.className,l=t.children,f=t.spokenMessage,p=void 0===f?l:f,d=t.politeness,h=void 0===d?"polite":d,m=t.actions,b=void 0===m?[]:m,v=t.onRemove,g=void 0===v?o.noop:v;!function(e,t){var r="string"==typeof e?e:Object(n.renderToString)(e);Object(n.useEffect)((function(){r&&Object(a.speak)(r,t)}),[r,t])}(p,h),Object(n.useEffect)((function(){var e=setTimeout((function(){g()}),1e4);return function(){return clearTimeout(e)}}),[]);var y=c()(i,"components-snackbar");return b&&b.length>1&&(void 0!==e&&e.env,b=[b[0]]),Object(n.createElement)("div",{ref:r,className:y,onClick:g,tabIndex:"0",role:"button",onKeyPress:g,"aria-label":Object(s.__)("Dismiss this notice")},Object(n.createElement)("div",{className:"components-snackbar__content"},l,b.map((function(e,t){var r=e.label,o=e.onClick,i=e.url;return Object(n.createElement)(u.a,{key:t,href:i,isTertiary:!0,onClick:function(e){e.stopPropagation(),o&&o(e)},className:"components-snackbar__action"},r)}))))}))}).call(this,r(102))},function(e,t){e.exports=window.wp.plugins},function(e,t,r){var n=r(156),o=r(129),i=r(165),c={decodeEntities:!0,lowerCaseAttributeNames:!1};function a(e,t){if("string"!=typeof e)throw new TypeError("First argument must be a string");return""===e?[]:n(i(e,(t=t||{}).htmlparser2||c),t)}a.domToReact=n,a.htmlToDOM=i,a.attributesToProps=o,e.exports=a,e.exports.default=a},function(e,t,r){"use strict";r.d(t,"a",(function(){return i})),r.d(t,"c",(function(){return c})),r.d(t,"b",(function(){return a}));var n,o=window.CustomEvent||null,i=function(e,t){var r=t.bubbles,n=void 0!==r&&r,i=t.cancelable,c=void 0!==i&&i,a=t.element,s=t.detail,u=void 0===s?{}:s;if(o){a||(a=document.body);var l=new o(e,{bubbles:n,cancelable:c,detail:u});a.dispatchEvent(l)}},c=function(){n&&clearTimeout(n),n=setTimeout((function(){i("wc_fragment_refresh",{bubbles:!0,cancelable:!0})}),50)},a=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if("function"!=typeof jQuery)return function(){};var o=function(){i(t,{bubbles:r,cancelable:n})};return jQuery(document).on(e,o),function(){return jQuery(document).off(e,o)}}},function(e,t,r){"use strict";r(180),t.a=function(){return React.createElement("span",{className:"wc-block-components-spinner","aria-hidden":"true"})}},,,,function(e,t){},,function(e,t,r){var n=r(71);e.exports=function(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,n(e,t)},e.exports.default=e.exports,e.exports.__esModule=!0},,function(e,t,r){"use strict";r.d(t,"a",(function(){return A}));var n=r(135),o=r(2),i=r(44),c=r(173),a=r(66),s=r(60),u=r(48),l=r(39),f=r.n(l),p=r(4),d=r.n(p),h=r(5),m=r.n(h),b=r(27),v=r.n(b),g=r(1),y=r(61),O=r.n(y),E=r(0),j=r(93),S=r(132),w=function(e,t,r){var n=Object.keys(e).map((function(t){return{key:t,value:e[t]}}),[]),o="wc-".concat(r,"-new-payment-method");return n.push({key:o,value:t}),n},_=function(e,t){O.a.setNonce&&"function"==typeof O.a.setNonce&&O.a.setNonce(e),null!=e&&e.get("X-WC-Store-API-User")&&t.setCustomerId(parseInt(e.get("X-WC-Store-API-User")||"0",10))},k=r(127),P=r(32),R=r(54);function x(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function C(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?x(Object(r),!0).forEach((function(t){d()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):x(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var T=function(){var e=Object(u.b)(),t=e.hasError,r=e.onCheckoutValidationBeforeProcessing,n=e.dispatchActions,o=e.redirectUrl,i=e.isProcessing,l=e.isBeforeProcessing,p=e.isComplete,d=e.orderNotes,h=e.shouldCreateAccount,b=e.extensionData,y=Object(k.b)().hasValidationErrors,x=Object(a.b)().shippingErrorStatus,T=Object(s.b)(),A=T.billingData,M=T.shippingAddress,N=Object(P.a)(),D=N.cartNeedsPayment,I=N.receiveCart,F=Object(c.b)(),L=F.activePaymentMethod,V=F.isExpressPaymentMethodActive,B=F.currentStatus,U=F.paymentMethodData,H=F.expressPaymentMethods,G=F.paymentMethods,z=F.shouldSavePayment,q=Object(R.a)(),W=q.addErrorNotice,Y=q.removeNotice,K=q.setIsSuppressed,X=Object(E.useRef)(A),$=Object(E.useRef)(M),J=Object(E.useRef)(o),Q=Object(E.useState)(!1),Z=m()(Q,2),ee=Z[0],te=Z[1],re=Object(E.useMemo)((function(){var e,t=C(C({},H),G);return null==t||null===(e=t[L])||void 0===e?void 0:e.paymentMethodId}),[L,H,G]),ne=y&&!V||B.hasError||x.hasError,oe=!t&&!ne&&(B.isSuccessful||!D)&&i;Object(E.useEffect)((function(){K(V)}),[V,K]),Object(E.useEffect)((function(){ne===t||!i&&!l||V||n.setHasError(ne)}),[ne,t,i,l,V,n]),Object(E.useEffect)((function(){X.current=A,$.current=M,J.current=o}),[A,M,o]);var ie=Object(E.useCallback)((function(){return!y&&(B.hasError?{errorMessage:Object(g.__)("There was a problem with your payment option.",'woocommerce')}:!x.hasError||{errorMessage:Object(g.__)("There was a problem with your shipping option.",'woocommerce')})}),[y,B.hasError,x.hasError]);Object(E.useEffect)((function(){var e;return V||(e=r(ie,0)),function(){V||e()}}),[r,ie,V]),Object(E.useEffect)((function(){J.current&&(window.location.href=J.current)}),[p]);var ce=Object(E.useCallback)(f()(v.a.mark((function e(){var t,r;return v.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!ee){e.next=2;break}return e.abrupt("return");case 2:te(!0),Y("checkout"),t=D?{payment_method:re,payment_data:w(U,z,L)}:{},r=C(C({billing_address:Object(j.a)(X.current),shipping_address:Object(j.a)($.current),customer_note:d,should_create_account:h},t),{},{extensions:C({},b)}),O()({path:"/wc/store/checkout",method:"POST",data:r,cache:"no-store",parse:!1}).then((function(e){if(_(e.headers,n),!e.ok)throw new Error(e);return e.json()})).then((function(e){n.setAfterProcessing(e),te(!1)})).catch((function(e){_(e.headers,n),e.json().then((function(e){var t,r,o;null!==(t=e.data)&&void 0!==t&&t.cart&&I(e.data.cart),W(Object(S.b)(e),{id:"checkout"}),null===(r=e.additional_errors)||void 0===r||null===(o=r.forEach)||void 0===o||o.call(r,(function(e){W(e.message,{id:e.error_code})})),n.setHasError(!0),n.setAfterProcessing(e),te(!1)}))}));case 7:case"end":return e.stop()}}),e)}))),[ee,Y,d,h,D,re,U,z,L,b,n,W,I]);return Object(E.useEffect)((function(){oe&&!ee&&ce()}),[ce,oe,ee]),null},A=function(e){var t=e.children,r=e.isCart,l=void 0!==r&&r,f=e.redirectUrl;return React.createElement(u.a,{redirectUrl:f,isCart:l},React.createElement(s.a,null,React.createElement(a.a,null,React.createElement(c.a,null,t,React.createElement(i.a,{renderError:o.CURRENT_USER_IS_ADMIN?null:function(){return null}},React.createElement(n.PluginArea,{scope:"woocommerce-checkout"})),React.createElement(T,null)))))}},,,,,,,function(e,t,r){"use strict";var n=r(0),o=r(7),i=r(6),c=r.n(i),a=r(1),s=r(33),u=r(116),l=r(76);t.a=function(e){var t=e.className,r=e.status,i=void 0===r?"info":r,f=e.children,p=e.spokenMessage,d=void 0===p?f:p,h=e.onRemove,m=void 0===h?o.noop:h,b=e.isDismissible,v=void 0===b||b,g=e.actions,y=void 0===g?[]:g,O=e.politeness,E=void 0===O?function(e){switch(e){case"success":case"warning":case"info":return"polite";case"error":default:return"assertive"}}(i):O,j=e.__unstableHTML;!function(e,t){var r="string"==typeof e?e:Object(n.renderToString)(e);Object(n.useEffect)((function(){r&&Object(s.speak)(r,t)}),[r,t])}(d,E);var S=c()(t,"components-notice","is-"+i,{"is-dismissible":v});return j&&(f=Object(n.createElement)(n.RawHTML,null,f)),Object(n.createElement)("div",{className:S},Object(n.createElement)("div",{className:"components-notice__content"},f,y.map((function(e,t){var r=e.className,o=e.label,i=e.isPrimary,a=e.noDefaultClasses,s=void 0!==a&&a,u=e.onClick,f=e.url;return Object(n.createElement)(l.a,{key:t,href:f,isPrimary:i,isSecondary:!s&&!f,isLink:!s&&!!f,onClick:f?void 0:u,className:c()("components-notice__action",r)},o)}))),v&&Object(n.createElement)(l.a,{className:"components-notice__dismiss",icon:u.a,label:Object(a.__)("Dismiss this notice"),onClick:m,showTooltip:!1}))}},,,function(e,t,r){var n=r(3),o=r(129),i=r(130),c=i.setStyleProp;function a(e){return i.PRESERVE_CUSTOM_ATTRIBUTES&&"tag"===e.type&&i.isCustomComponent(e.name,e.attribs)}e.exports=function e(t,r){for(var i,s,u,l,f=(r=r||{}).library||n,p=f.cloneElement,d=f.createElement,h=f.isValidElement,m=[],b="function"==typeof r.replace,v=r.trim,g=0,y=t.length;g<y;g++)if(i=t[g],b&&h(s=r.replace(i)))y>1&&(s=p(s,{key:s.key||g})),m.push(s);else if("text"!==i.type){switch(u=i.attribs,a(i)?c(u.style,u):u&&(u=o(u)),l=null,i.type){case"script":case"style":i.children[0]&&(u.dangerouslySetInnerHTML={__html:i.children[0].data});break;case"tag":"textarea"===i.name&&i.children[0]?u.defaultValue=i.children[0].data:i.children&&i.children.length&&(l=e(i.children,r));break;default:continue}y>1&&(u.key=g),m.push(d(i.name,u,l))}else v?i.data.trim()&&m.push(i.data):m.push(i.data);return 1===m.length?m[0]:m}},function(e,t,r){var n=r(158),o=r(159),i=r(160),c=i.MUST_USE_PROPERTY,a=i.HAS_BOOLEAN_VALUE,s=i.HAS_NUMERIC_VALUE,u=i.HAS_POSITIVE_NUMERIC_VALUE,l=i.HAS_OVERLOADED_BOOLEAN_VALUE;function f(e,t){return(e&t)===t}function p(e,t,r){var n,o,i,p=e.Properties,d=e.DOMAttributeNames;for(o in p)n=d[o]||(r?o:o.toLowerCase()),i=p[o],t[n]={attributeName:n,propertyName:o,mustUseProperty:f(i,c),hasBooleanValue:f(i,a),hasNumericValue:f(i,s),hasPositiveNumericValue:f(i,u),hasOverloadedBooleanValue:f(i,l)}}var d={};p(n,d);var h={};p(o,h,!0);var m={};p(n,m),p(o,m,!0),e.exports={html:d,svg:h,properties:m,isCustomAttribute:RegExp.prototype.test.bind(new RegExp("^(data|aria)-[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"))}},function(e,t){e.exports={Properties:{autoFocus:4,accept:0,acceptCharset:0,accessKey:0,action:0,allowFullScreen:4,allowTransparency:0,alt:0,as:0,async:4,autoComplete:0,autoPlay:4,capture:4,cellPadding:0,cellSpacing:0,charSet:0,challenge:0,checked:5,cite:0,classID:0,className:0,cols:24,colSpan:0,content:0,contentEditable:0,contextMenu:0,controls:4,controlsList:0,coords:0,crossOrigin:0,data:0,dateTime:0,default:4,defer:4,dir:0,disabled:4,download:32,draggable:0,encType:0,form:0,formAction:0,formEncType:0,formMethod:0,formNoValidate:4,formTarget:0,frameBorder:0,headers:0,height:0,hidden:4,high:0,href:0,hrefLang:0,htmlFor:0,httpEquiv:0,icon:0,id:0,inputMode:0,integrity:0,is:0,keyParams:0,keyType:0,kind:0,label:0,lang:0,list:0,loop:4,low:0,manifest:0,marginHeight:0,marginWidth:0,max:0,maxLength:0,media:0,mediaGroup:0,method:0,min:0,minLength:0,multiple:5,muted:5,name:0,nonce:0,noValidate:4,open:4,optimum:0,pattern:0,placeholder:0,playsInline:4,poster:0,preload:0,profile:0,radioGroup:0,readOnly:4,referrerPolicy:0,rel:0,required:4,reversed:4,role:0,rows:24,rowSpan:8,sandbox:0,scope:0,scoped:4,scrolling:0,seamless:4,selected:5,shape:0,size:24,sizes:0,span:24,spellCheck:0,src:0,srcDoc:0,srcLang:0,srcSet:0,start:8,step:0,style:0,summary:0,tabIndex:0,target:0,title:0,type:0,useMap:0,value:0,width:0,wmode:0,wrap:0,about:0,datatype:0,inlist:0,prefix:0,property:0,resource:0,typeof:0,vocab:0,autoCapitalize:0,autoCorrect:0,autoSave:0,color:0,itemProp:0,itemScope:4,itemType:0,itemID:0,itemRef:0,results:0,security:0,unselectable:0},DOMAttributeNames:{acceptCharset:"accept-charset",className:"class",htmlFor:"for",httpEquiv:"http-equiv"}}},function(e,t){e.exports={Properties:{accentHeight:0,accumulate:0,additive:0,alignmentBaseline:0,allowReorder:0,alphabetic:0,amplitude:0,arabicForm:0,ascent:0,attributeName:0,attributeType:0,autoReverse:0,azimuth:0,baseFrequency:0,baseProfile:0,baselineShift:0,bbox:0,begin:0,bias:0,by:0,calcMode:0,capHeight:0,clip:0,clipPath:0,clipRule:0,clipPathUnits:0,colorInterpolation:0,colorInterpolationFilters:0,colorProfile:0,colorRendering:0,contentScriptType:0,contentStyleType:0,cursor:0,cx:0,cy:0,d:0,decelerate:0,descent:0,diffuseConstant:0,direction:0,display:0,divisor:0,dominantBaseline:0,dur:0,dx:0,dy:0,edgeMode:0,elevation:0,enableBackground:0,end:0,exponent:0,externalResourcesRequired:0,fill:0,fillOpacity:0,fillRule:0,filter:0,filterRes:0,filterUnits:0,floodColor:0,floodOpacity:0,focusable:0,fontFamily:0,fontSize:0,fontSizeAdjust:0,fontStretch:0,fontStyle:0,fontVariant:0,fontWeight:0,format:0,from:0,fx:0,fy:0,g1:0,g2:0,glyphName:0,glyphOrientationHorizontal:0,glyphOrientationVertical:0,glyphRef:0,gradientTransform:0,gradientUnits:0,hanging:0,horizAdvX:0,horizOriginX:0,ideographic:0,imageRendering:0,in:0,in2:0,intercept:0,k:0,k1:0,k2:0,k3:0,k4:0,kernelMatrix:0,kernelUnitLength:0,kerning:0,keyPoints:0,keySplines:0,keyTimes:0,lengthAdjust:0,letterSpacing:0,lightingColor:0,limitingConeAngle:0,local:0,markerEnd:0,markerMid:0,markerStart:0,markerHeight:0,markerUnits:0,markerWidth:0,mask:0,maskContentUnits:0,maskUnits:0,mathematical:0,mode:0,numOctaves:0,offset:0,opacity:0,operator:0,order:0,orient:0,orientation:0,origin:0,overflow:0,overlinePosition:0,overlineThickness:0,paintOrder:0,panose1:0,pathLength:0,patternContentUnits:0,patternTransform:0,patternUnits:0,pointerEvents:0,points:0,pointsAtX:0,pointsAtY:0,pointsAtZ:0,preserveAlpha:0,preserveAspectRatio:0,primitiveUnits:0,r:0,radius:0,refX:0,refY:0,renderingIntent:0,repeatCount:0,repeatDur:0,requiredExtensions:0,requiredFeatures:0,restart:0,result:0,rotate:0,rx:0,ry:0,scale:0,seed:0,shapeRendering:0,slope:0,spacing:0,specularConstant:0,specularExponent:0,speed:0,spreadMethod:0,startOffset:0,stdDeviation:0,stemh:0,stemv:0,stitchTiles:0,stopColor:0,stopOpacity:0,strikethroughPosition:0,strikethroughThickness:0,string:0,stroke:0,strokeDasharray:0,strokeDashoffset:0,strokeLinecap:0,strokeLinejoin:0,strokeMiterlimit:0,strokeOpacity:0,strokeWidth:0,surfaceScale:0,systemLanguage:0,tableValues:0,targetX:0,targetY:0,textAnchor:0,textDecoration:0,textRendering:0,textLength:0,to:0,transform:0,u1:0,u2:0,underlinePosition:0,underlineThickness:0,unicode:0,unicodeBidi:0,unicodeRange:0,unitsPerEm:0,vAlphabetic:0,vHanging:0,vIdeographic:0,vMathematical:0,values:0,vectorEffect:0,version:0,vertAdvY:0,vertOriginX:0,vertOriginY:0,viewBox:0,viewTarget:0,visibility:0,widths:0,wordSpacing:0,writingMode:0,x:0,xHeight:0,x1:0,x2:0,xChannelSelector:0,xlinkActuate:0,xlinkArcrole:0,xlinkHref:0,xlinkRole:0,xlinkShow:0,xlinkTitle:0,xlinkType:0,xmlBase:0,xmlns:0,xmlnsXlink:0,xmlLang:0,xmlSpace:0,y:0,y1:0,y2:0,yChannelSelector:0,z:0,zoomAndPan:0},DOMAttributeNames:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDasharray:"stroke-dasharray",strokeDashoffset:"stroke-dashoffset",strokeLinecap:"stroke-linecap",strokeLinejoin:"stroke-linejoin",strokeMiterlimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",xlinkActuate:"xlink:actuate",xlinkArcrole:"xlink:arcrole",xlinkHref:"xlink:href",xlinkRole:"xlink:role",xlinkShow:"xlink:show",xlinkTitle:"xlink:title",xlinkType:"xlink:type",xmlBase:"xml:base",xmlnsXlink:"xmlns:xlink",xmlLang:"xml:lang",xmlSpace:"xml:space"}}},function(e,t){e.exports={MUST_USE_PROPERTY:1,HAS_BOOLEAN_VALUE:4,HAS_NUMERIC_VALUE:8,HAS_POSITIVE_NUMERIC_VALUE:24,HAS_OVERLOADED_BOOLEAN_VALUE:32}},function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};t.__esModule=!0;var o=n(r(162)),i=r(164);t.default=function(e,t){var r={};return e&&"string"==typeof e?(o.default(e,(function(e,n){e&&n&&(r[i.camelCase(e,t)]=n)})),r):r}},function(e,t,r){var n=r(163);e.exports=function(e,t){var r,o=null;if(!e||"string"!=typeof e)return o;for(var i,c,a=n(e),s="function"==typeof t,u=0,l=a.length;u<l;u++)i=(r=a[u]).property,c=r.value,s?t(i,c,r):c&&(o||(o={}),o[i]=c);return o}},function(e,t){var r=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,n=/\n/g,o=/^\s*/,i=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,c=/^:\s*/,a=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,s=/^[;\s]*/,u=/^\s+|\s+$/g;function l(e){return e?e.replace(u,""):""}e.exports=function(e,t){if("string"!=typeof e)throw new TypeError("First argument must be a string");if(!e)return[];t=t||{};var u=1,f=1;function p(e){var t=e.match(n);t&&(u+=t.length);var r=e.lastIndexOf("\n");f=~r?e.length-r:f+e.length}function d(){var e={line:u,column:f};return function(t){return t.position=new h(e),g(),t}}function h(e){this.start=e,this.end={line:u,column:f},this.source=t.source}h.prototype.content=e;var m=[];function b(r){var n=new Error(t.source+":"+u+":"+f+": "+r);if(n.reason=r,n.filename=t.source,n.line=u,n.column=f,n.source=e,!t.silent)throw n;m.push(n)}function v(t){var r=t.exec(e);if(r){var n=r[0];return p(n),e=e.slice(n.length),r}}function g(){v(o)}function y(e){var t;for(e=e||[];t=O();)!1!==t&&e.push(t);return e}function O(){var t=d();if("/"==e.charAt(0)&&"*"==e.charAt(1)){for(var r=2;""!=e.charAt(r)&&("*"!=e.charAt(r)||"/"!=e.charAt(r+1));)++r;if(r+=2,""===e.charAt(r-1))return b("End of comment missing");var n=e.slice(2,r-2);return f+=2,p(n),e=e.slice(r),f+=2,t({type:"comment",comment:n})}}function E(){var e=d(),t=v(i);if(t){if(O(),!v(c))return b("property missing ':'");var n=v(a),o=e({type:"declaration",property:l(t[0].replace(r,"")),value:n?l(n[0].replace(r,"")):""});return v(s),o}}return g(),function(){var e,t=[];for(y(t);e=E();)!1!==e&&(t.push(e),y(t));return t}()}},function(e,t,r){"use strict";t.__esModule=!0,t.camelCase=void 0;var n=/^--[a-zA-Z0-9-]+$/,o=/-([a-z])/g,i=/^[^-]+$/,c=/^-(webkit|moz|ms|o|khtml)-/,a=function(e,t){return t.toUpperCase()},s=function(e,t){return t+"-"};t.camelCase=function(e,t){return void 0===t&&(t={}),function(e){return!e||i.test(e)||n.test(e)}(e)?e:(e=e.toLowerCase(),t.reactCompat||(e=e.replace(c,s)),e.replace(o,a))}},function(e,t,r){var n=r(166),o=r(131),i=o.formatDOM,c=o.isIE(9),a=/<(![a-zA-Z\s]+)>/;e.exports=function(e){if("string"!=typeof e)throw new TypeError("First argument must be a string");if(!e)return[];var t,r=e.match(a);return r&&r[1]&&(t=r[1],c&&(e=e.replace(r[0],""))),i(n(e),null,t)}},function(e,t,r){var n=r(131),o=/<([a-zA-Z]+[0-9]?)/,i=/<head.*>/i,c=/<body.*>/i,a=/<(area|base|br|col|embed|hr|img|input|keygen|link|menuitem|meta|param|source|track|wbr)(.*?)\/?>/gi,s=n.isIE(9),u=s||n.isIE(),l=function(){throw new Error("This browser does not support `document.implementation.createHTMLDocument`")},f=function(){throw new Error("This browser does not support `DOMParser.prototype.parseFromString`")};if("function"==typeof window.DOMParser){var p=new window.DOMParser,d=s?"text/xml":"text/html";l=f=function(e,t){return t&&(e="<"+t+">"+e+"</"+t+">"),s&&(e=e.replace(a,"<$1$2$3/>")),p.parseFromString(e,d)}}if(document.implementation){var h=document.implementation.createHTMLDocument(u?"html-dom-parser":void 0);l=function(e,t){if(t)return h.documentElement.getElementsByTagName(t)[0].innerHTML=e,h;try{return h.documentElement.innerHTML=e,h}catch(t){if(f)return f(e)}}}var m,b=document.createElement("template");b.content&&(m=function(e){return b.innerHTML=e,b.content.childNodes}),e.exports=function(e){var t,r,n,a,s=e.match(o);switch(s&&s[1]&&(t=s[1].toLowerCase()),t){case"html":return r=f(e),i.test(e)||(n=r.getElementsByTagName("head")[0])&&n.parentNode.removeChild(n),c.test(e)||(n=r.getElementsByTagName("body")[0])&&n.parentNode.removeChild(n),r.getElementsByTagName("html");case"head":case"body":return a=l(e).getElementsByTagName(t),c.test(e)&&i.test(e)?a[0].parentNode.childNodes:a;default:return m?m(e):l(e,"body").getElementsByTagName("body")[0].childNodes}}},function(e,t){e.exports={CASE_SENSITIVE_TAG_NAMES:["animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussainBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","linearGradient","radialGradient","textPath"]}},,,,,,function(e,t,r){"use strict";r.d(t,"b",(function(){return Z})),r.d(t,"a",(function(){return ee}));var n,o,i=r(46),c=r.n(i),a=r(5),s=r.n(a),u=r(0);!function(e){e.PRISTINE="pristine",e.STARTED="started",e.PROCESSING="processing",e.ERROR="has_error",e.FAILED="failed",e.SUCCESS="success",e.COMPLETE="complete"}(n||(n={})),function(e){e.SET_REGISTERED_PAYMENT_METHODS="set_registered_payment_methods",e.SET_REGISTERED_EXPRESS_PAYMENT_METHODS="set_registered_express_payment_methods",e.SET_SHOULD_SAVE_PAYMENT_METHOD="set_should_save_payment_method"}(o||(o={}));var l={currentStatus:n.PRISTINE,shouldSavePaymentMethod:!1,paymentMethodData:{payment_method:""},hasSavedToken:!1,errorMessage:"",paymentMethods:{},expressPaymentMethods:{}},f={setPaymentStatus:function(){return{pristine:function(){},started:function(){},processing:function(){},completed:function(){},error:function(e){},failed:function(e,t){},success:function(e,t){}}},currentStatus:{isPristine:!0,isStarted:!1,isProcessing:!1,isFinished:!1,hasError:!1,hasFailed:!1,isSuccessful:!1,isDoingExpressPayment:!1},paymentStatuses:n,paymentMethodData:{},errorMessage:"",activePaymentMethod:"",setActivePaymentMethod:function(){},activeSavedToken:"",setActiveSavedToken:function(){},customerPaymentMethods:{},paymentMethods:{},expressPaymentMethods:{},paymentMethodsInitialized:!1,expressPaymentMethodsInitialized:!1,onPaymentProcessing:function(){return function(){return function(){}}},setExpressPaymentError:function(){},isExpressPaymentMethodActive:!1,setShouldSavePayment:function(){},shouldSavePayment:!1},p=r(4),d=r.n(p),h=r(21),m=r.n(h);function b(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function v(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?b(Object(r),!0).forEach((function(t){d()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):b(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var g=function(e){return!("object"!==m()(e)||!e.isSavedToken)},y=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:l,t=arguments.length>1?arguments[1]:void 0,r=t.type,i=t.paymentMethodData,c=t.shouldSavePaymentMethod,a=void 0!==c&&c,s=t.errorMessage,u=void 0===s?"":s,f=t.paymentMethods,p=void 0===f?{}:f;switch(r){case n.STARTED:return v(v({},e),{},{currentStatus:n.STARTED,paymentMethodData:i||e.paymentMethodData,hasSavedToken:g(i||e.paymentMethodData)});case n.ERROR:return e.currentStatus!==n.ERROR?v(v({},e),{},{currentStatus:n.ERROR,errorMessage:u||e.errorMessage}):e;case n.FAILED:return e.currentStatus!==n.FAILED?v(v({},e),{},{currentStatus:n.FAILED,paymentMethodData:i||e.paymentMethodData,errorMessage:u||e.errorMessage}):e;case n.SUCCESS:return e.currentStatus!==n.SUCCESS?v(v({},e),{},{currentStatus:n.SUCCESS,paymentMethodData:i||e.paymentMethodData,hasSavedToken:g(i||e.paymentMethodData)}):e;case n.PROCESSING:return e.currentStatus!==n.PROCESSING?v(v({},e),{},{currentStatus:n.PROCESSING,errorMessage:""}):e;case n.COMPLETE:return e.currentStatus!==n.COMPLETE?v(v({},e),{},{currentStatus:n.COMPLETE}):e;case n.PRISTINE:return v(v({},l),{},{currentStatus:n.PRISTINE,paymentMethods:v({},e.paymentMethods),expressPaymentMethods:v({},e.expressPaymentMethods),shouldSavePaymentMethod:e.shouldSavePaymentMethod});case o.SET_REGISTERED_PAYMENT_METHODS:return v(v({},e),{},{paymentMethods:p});case o.SET_REGISTERED_EXPRESS_PAYMENT_METHODS:return v(v({},e),{},{expressPaymentMethods:p});case o.SET_SHOULD_SAVE_PAYMENT_METHOD:return v(v({},e),{},{shouldSavePaymentMethod:a})}},O=r(39),E=r.n(O),j=r(27),S=r.n(j),w=r(1),_=r(38),k=r(53),P=r(2),R=r(82),x=r(36),C=r(66),T=r(60),A=r(32),M=r(54),N=r(35);function D(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function I(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?D(Object(r),!0).forEach((function(t){d()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):D(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var F=function(e,t,r,n){var o=Object(u.useState)(!1),i=s()(o,2),c=i[0],a=i[1],l=Object(x.a)().isEditor,f=Object(C.b)().selectedRates,p=Object(T.b)(),h=p.billingData,b=p.shippingAddress,v=Object(k.a)(f),g=Object(k.a)(r),y=Object(A.a)(),O=y.cartTotals,j=y.cartNeedsShipping,_=y.paymentRequirements,N=Object(u.useRef)({cart:y,cartTotals:O,cartNeedsShipping:j,billingData:h,shippingAddress:b,selectedShippingMethods:v,paymentRequirements:_}),D=Object(M.a)().addErrorNotice;Object(u.useEffect)((function(){N.current={cart:y,cartTotals:O,cartNeedsShipping:j,billingData:h,shippingAddress:b,selectedShippingMethods:v,paymentRequirements:_}}),[y,O,j,h,b,v,_]);var F=Object(u.useCallback)(E()(S.a.mark((function r(){var o,i,c,s,u,f,p;return S.a.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:o={},i=function(e){o=I(I({},o),{},d()({},e.name,e))},c=0;case 3:if(!(c<g.length)){r.next=29;break}if(s=g[c],u=t[s]){r.next=8;break}return r.abrupt("continue",26);case 8:if(r.prev=8,!l){r.next=13;break}r.t0=!0,r.next=16;break;case 13:return r.next=15,Promise.resolve(u.canMakePayment(N.current));case 15:r.t0=r.sent;case 16:if(!(f=r.t0)){r.next=21;break}if("object"!==m()(f)||null===f||!f.error){r.next=20;break}throw new Error(f.error.message);case 20:i(u);case 21:r.next=26;break;case 23:r.prev=23,r.t1=r.catch(8),(P.CURRENT_USER_IS_ADMIN||l)&&(p=Object(w.sprintf)(
/* translators: %s the id of the payment method being registered (bank transfer, Stripe...) */
Object(w.__)("There was an error registering the payment method with id '%s': ",'woocommerce'),u.paymentMethodId),D("".concat(p," ").concat(r.t1),{context:n,id:"wc-".concat(u.paymentMethodId,"-registration-error")}));case 26:c++,r.next=3;break;case 29:e(o),a(!0);case 31:case"end":return r.stop()}}),r,null,[[8,23]])}))),[D,e,l,n,g,t]),L=Object(R.a)(F,500),V=s()(L,1)[0];return Object(u.useEffect)((function(){V()}),[V,y,v,h]),c},L=function(e){return{type:e}},V=function(e){return{type:n.ERROR,errorMessage:e}},B=function(e){var t=e.errorMessage,r=e.paymentMethodData;return{type:n.FAILED,errorMessage:t,paymentMethodData:r}},U=function(e){var t=e.paymentMethodData;return{type:n.SUCCESS,paymentMethodData:t}},H=function(e){var t=e.paymentMethodData;return{type:n.STARTED,paymentMethodData:t}},G=function(e){return{type:o.SET_REGISTERED_PAYMENT_METHODS,paymentMethods:e}},z=function(e){return{type:o.SET_REGISTERED_EXPRESS_PAYMENT_METHODS,paymentMethods:e}},q=function(e){return{type:o.SET_SHOULD_SAVE_PAYMENT_METHOD,shouldSavePaymentMethod:e}},W=r(52),Y=r(48),K=r(98),X=r(191),$=r(193),J=r(127),Q=Object(u.createContext)(f),Z=function(){return Object(u.useContext)(Q)},ee=function(e){var t,r=e.children,o=Object(Y.b)(),i=o.isProcessing,a=o.isIdle,f=o.isCalculating,p=o.hasError,d=Object(x.a)(),h=d.isEditor,b=d.getPreviewData,v=Object(J.b)().setValidationErrors,g=Object(M.a)(),O=g.addErrorNotice,E=g.removeNotice,j=Object(N.c)(),S=j.isSuccessResponse,w=j.isErrorResponse,k=j.isFailResponse,R=j.noticeContexts,A=Object(u.useReducer)(K.b,{}),D=s()(A,2),I=D[0],Z=(t=D[1],Object(u.useMemo)((function(){return{onPaymentProcessing:Object(X.a)("payment_processing",t)}}),[t])).onPaymentProcessing,ee=Object(u.useRef)(I);Object(u.useEffect)((function(){ee.current=I}),[I]);var te,re,ne,oe=Object(u.useReducer)(y,l),ie=s()(oe,2),ce=ie[0],ae=(te=ie[1],re=Object(T.b)().setBillingData,ne=Object(C.b)().setShippingAddress,{dispatchActions:Object(u.useMemo)((function(){return{setRegisteredPaymentMethods:function(e){te(G(e))},setRegisteredExpressPaymentMethods:function(e){te(z(e))},setShouldSavePayment:function(e){te(q(e))}}}),[te]),setPaymentStatus:Object(u.useCallback)((function(){return{pristine:function(){return te(L(n.PRISTINE))},started:function(e){te(H({paymentMethodData:e}))},processing:function(){return te(L(n.PROCESSING))},completed:function(){return te(L(n.COMPLETE))},error:function(e){return te(V(e))},failed:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;r&&re(r),te(B({errorMessage:e||"",paymentMethodData:t||{}}))},success:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;t&&re(t),void 0!==m()(r)&&null!=r&&r.address&&ne(r.address),te(U({paymentMethodData:e}))}}}),[te,re,ne])}),se=ae.dispatchActions,ue=ae.setPaymentStatus,le=function(e){var t=Object(_.getPaymentMethods)(),r=Object(N.c)().noticeContexts,n=new Set([].concat(c()(Object(P.getSetting)("paymentGatewaySortOrder",[])),c()(Object.keys(t))));return F(e,t,Array.from(n),r.PAYMENTS)}(se.setRegisteredPaymentMethods),fe=function(e){var t=Object(_.getExpressPaymentMethods)(),r=Object(N.c)().noticeContexts;return F(e,t,Object.keys(t),r.EXPRESS_PAYMENTS)}(se.setRegisteredExpressPaymentMethods),pe=function(){var e=Object(W.a)().dispatchCheckoutEvent,t=Object(u.useState)(""),r=s()(t,2),n=r[0],o=r[1],i=Object(u.useState)(""),c=s()(i,2),a=c[0],l=c[1];return Object(u.useEffect)((function(){e("set-active-payment-method",{activePaymentMethod:n})}),[e,n]),{activePaymentMethod:n,activeSavedToken:a,setActivePaymentMethod:o,setActiveSavedToken:l}}(),de=pe.activePaymentMethod,he=pe.activeSavedToken,me=pe.setActivePaymentMethod,be=pe.setActiveSavedToken,ve=Object(u.useMemo)((function(){return h?b("previewSavedPaymentMethods"):le?function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(0===Object.keys(e).length)return{};var t=Object(P.getSetting)("customerPaymentMethods",{}),r=Object.keys(t),n={};return r.forEach((function(r){var o=t[r].filter((function(t){var r,n=t.method.gateway;return n in e&&(null===(r=e[n].supports)||void 0===r?void 0:r.showSavedCards)}));o.length&&(n[r]=o)})),n}(ce.paymentMethods):{}}),[h,b,le,ce.paymentMethods]),ge=Object(u.useCallback)((function(e){e?O(e,{id:"wc-express-payment-error",context:R.EXPRESS_PAYMENTS}):E("wc-express-payment-error",R.EXPRESS_PAYMENTS)}),[O,R.EXPRESS_PAYMENTS,E]),ye=Object.keys(ce.expressPaymentMethods).includes(de),Oe=Object(u.useMemo)((function(){return{isPristine:ce.currentStatus===n.PRISTINE,isStarted:ce.currentStatus===n.STARTED,isProcessing:ce.currentStatus===n.PROCESSING,isFinished:[n.ERROR,n.FAILED,n.SUCCESS].includes(ce.currentStatus),hasError:ce.currentStatus===n.ERROR,hasFailed:ce.currentStatus===n.FAILED,isSuccessful:ce.currentStatus===n.SUCCESS,isDoingExpressPayment:ce.currentStatus!==n.PRISTINE&&ye}}),[ce.currentStatus,ye]);Object(u.useEffect)((function(){var e=Object.keys(ce.paymentMethods),t=[].concat(c()(e),c()(Object.keys(ce.expressPaymentMethods)));le&&e.length&&me((function(e){return e&&t.includes(e)?e:(ue().pristine(),Object.keys(ce.paymentMethods)[0])}))}),[le,ce.paymentMethods,ce.expressPaymentMethods,me,ue]),Object(u.useEffect)((function(){!i||p||f||Oe.isFinished||ue().processing()}),[i,p,f,Oe.isFinished,ue]),Object(u.useEffect)((function(){a&&!Oe.isSuccessful&&ue().pristine()}),[a,Oe.isSuccessful,ue]),Object(u.useEffect)((function(){p&&Oe.isSuccessful&&!ce.hasSavedToken&&ue().pristine()}),[p,Oe.isSuccessful,ce.hasSavedToken,ue]),Object(u.useEffect)((function(){Oe.isProcessing&&(E("wc-payment-error",R.PAYMENTS),Object($.b)(ee.current,"payment_processing",{}).then((function(e){var t,r,n,o,i,c,a,s;if(e.forEach((function(e){S(e)&&(t=e),(w(e)||k(e))&&(r=e)})),t&&!r)ue().success(null===(n=t)||void 0===n||null===(o=n.meta)||void 0===o?void 0:o.paymentMethodData,null===(i=t)||void 0===i||null===(c=i.meta)||void 0===c?void 0:c.billingData,null===(a=t)||void 0===a||null===(s=a.meta)||void 0===s?void 0:s.shippingData);else if(r&&k(r)){var u,l,f,p,d,h;r.message&&r.message.length&&O(r.message,{id:"wc-payment-error",isDismissible:!1,context:(null===(h=r)||void 0===h?void 0:h.messageContext)||R.PAYMENTS}),ue().failed(null===(u=r)||void 0===u?void 0:u.message,null===(l=r)||void 0===l||null===(f=l.meta)||void 0===f?void 0:f.paymentMethodData,null===(p=r)||void 0===p||null===(d=p.meta)||void 0===d?void 0:d.billingData)}else if(r){var m,b;r.message&&r.message.length&&O(r.message,{id:"wc-payment-error",isDismissible:!1,context:(null===(b=r)||void 0===b?void 0:b.messageContext)||R.PAYMENTS}),ue().error(r.message),v(null===(m=r)||void 0===m?void 0:m.validationErrors)}else ue().success()})))}),[Oe.isProcessing,v,ue,E,R.PAYMENTS,S,k,w,O]);var Ee={setPaymentStatus:ue,currentStatus:Oe,paymentStatuses:n,paymentMethodData:ce.paymentMethodData,errorMessage:ce.errorMessage,activePaymentMethod:de,setActivePaymentMethod:me,activeSavedToken:he,setActiveSavedToken:be,onPaymentProcessing:Z,customerPaymentMethods:ve,paymentMethods:ce.paymentMethods,expressPaymentMethods:ce.expressPaymentMethods,paymentMethodsInitialized:le,expressPaymentMethodsInitialized:fe,setExpressPaymentError:ge,isExpressPaymentMethodActive:ye,shouldSavePayment:ce.shouldSavePaymentMethod,setShouldSavePayment:se.setShouldSavePayment};return React.createElement(Q.Provider,{value:Ee},r)}},,,,,,,function(e,t){},function(e,t){},,,,,,,function(e,t,r){"use strict";r.d(t,"a",(function(){return n}));var n=function(e,t){var r=[];return Object.keys(e).forEach((function(n){if(void 0!==t[n])switch(e[n].type){case"boolean":r[n]="false"!==t[n]&&!1!==t[n];break;case"number":r[n]=parseInt(t[n],10);break;case"array":case"object":r[n]=JSON.parse(t[n]);break;default:r[n]=t[n]}else r[n]=e[n].default})),r}},,,function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));var n=r(98),o=function(e,t){return function(r){var o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10,i=n.a.addEventCallback(e,r,o);return t(i),function(){t(n.a.removeEventCallback(e,i.id))}}}},,function(e,t,r){"use strict";r.d(t,"a",(function(){return d})),r.d(t,"b",(function(){return h}));var n=r(21),o=r.n(n),i=r(39),c=r.n(i),a=r(27),s=r.n(a),u=function(e,t){return e[t]?Array.from(e[t].values()).sort((function(e,t){return e.priority-t.priority})):[]},l=r(35);function f(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return p(e,void 0);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?p(e,void 0):void 0}}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,c=!0,a=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return c=e.done,e},e:function(e){a=!0,i=e},f:function(){try{c||null==r.return||r.return()}finally{if(a)throw i}}}}function p(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var d=function(){var e=c()(s.a.mark((function e(t,r,n){var i,c,a,l,p,d;return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:i=u(t,r),c=[],a=f(i),e.prev=3,a.s();case 5:if((l=a.n()).done){e.next=19;break}return p=l.value,e.prev=7,e.next=10,Promise.resolve(p.callback(n));case 10:d=e.sent,"object"===o()(d)&&c.push(d),e.next=17;break;case 14:e.prev=14,e.t0=e.catch(7),console.error(e.t0);case 17:e.next=5;break;case 19:e.next=24;break;case 21:e.prev=21,e.t1=e.catch(3),a.e(e.t1);case 24:return e.prev=24,a.f(),e.finish(24);case 27:return e.abrupt("return",!c.length||c);case 28:case"end":return e.stop()}}),e,null,[[3,21,24,27],[7,14]])})));return function(_x,t,r){return e.apply(this,arguments)}}(),h=function(){var e=c()(s.a.mark((function e(t,r,n){var i,c,a,p,d,h;return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:i=[],c=u(t,r),a=f(c),e.prev=3,a.s();case 5:if((p=a.n()).done){e.next=28;break}return d=p.value,e.prev=7,e.next=10,Promise.resolve(d.callback(n));case 10:if(h=e.sent,"object"===o()(h)&&null!==h){e.next=13;break}return e.abrupt("continue",26);case 13:if(h.hasOwnProperty("type")){e.next=15;break}throw new Error("Returned objects from event emitter observers must return an object with a type property");case 15:if(!Object(l.a)(h)&&!Object(l.b)(h)){e.next=18;break}return i.push(h),e.abrupt("return",i);case 18:i.push(h),e.next=26;break;case 21:return e.prev=21,e.t0=e.catch(7),console.error(e.t0),i.push({type:"error"}),e.abrupt("return",i);case 26:e.next=5;break;case 28:e.next=33;break;case 30:e.prev=30,e.t1=e.catch(3),a.e(e.t1);case 33:return e.prev=33,a.f(),e.finish(33);case 36:return e.abrupt("return",i);case 37:case"end":return e.stop()}}),e,null,[[3,30,33,36],[7,21]])})));return function(t,r,n){return e.apply(this,arguments)}}()},,,,,,function(e,t,r){"use strict";var n=r(0),o=r(2),i=r(8),c=r(11),a=r(1);Object(a.__)("Unable to get cart data from the API.",'woocommerce'),t.a=function(e){return function(t){var r,a;return r=Object(n.useRef)(Object(o.getSetting)("preloadedApiRequests",{})),a=Object(c.useDispatch)(i.CART_STORE_KEY).setIsCartDataStale,Object(c.useSelect)((function(e,t){var n,o=null===(n=r.current["/wc/store/cart"])||void 0===n?void 0:n.body;if(o){var c=e(i.CART_STORE_KEY),s=c.isResolving,u=c.hasFinishedResolution,l=c.isCartDataStale;if(!l()&&!s("getCartData")&&!u("getCartData",[])){var f=window.localStorage.getItem("wc-blocks_cart_update_timestamp");if(f){var p=parseFloat(f),d=parseFloat(o.generated_timestamp);!isNaN(d)&&!isNaN(p)&&p>d&&a()}}var h,m=t.dispatch(i.CART_STORE_KEY),b=m.receiveCart,v=m.receiveError,g=m.startResolution,y=m.finishResolution;l()||s("getCartData",[])||u("getCartData",[])||(g("getCartData",[]),null!=o&&null!==(h=o.code)&&void 0!==h&&h.includes("error")?v(o):b(o),y("getCartData",[]))}}),[]),React.createElement(e,t)}}},,,,function(e){e.exports=JSON.parse('{"name":"woocommerce/filled-cart-block","version":"1.0.0","title":"Filled Cart","description":"Contains blocks that are displayed when the cart contains products.","category":"woocommerce","supports":{"align":false,"html":false,"multiple":false,"reusable":false,"inserter":false},"attributes":{"lock":{"type":"object","default":{"remove":true,"move":true}}},"parent":["woocommerce/cart-i2"],"textdomain":'woocommerce',"apiVersion":2}')},function(e){e.exports=JSON.parse('{"name":"woocommerce/empty-cart-block","version":"1.0.0","title":"Empty Cart","description":"Contains blocks that are displayed when the cart is empty.","category":"woocommerce","supports":{"align":false,"html":false,"multiple":false,"reusable":false,"inserter":false},"attributes":{"lock":{"type":"object","default":{"remove":true,"move":true}}},"parent":["woocommerce/cart-i2"],"textdomain":'woocommerce',"apiVersion":2}')},,,,,,,,,,,,,,,,,,,,function(e,t,r){"use strict";r.d(t,"a",(function(){return b}));var n=r(4),o=r.n(n),i=r(23),c=r.n(i),a=r(107),s=r(0),u=r(136),l=r.n(u),f=r(26),p=["blockName"];function d(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function h(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?d(Object(r),!0).forEach((function(t){o()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):d(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var m=function(e,t){return e&&t[e]?t[e]:null},b=function(e){var t=e.Block,r=e.selector,n=e.blockName,o=e.getProps,i=void 0===o?function(){return{}}:o,u=e.blockMap,d=e.blockWrapper;Object(a.a)({Block:t,selector:r,getProps:function(e,t){var r=function e(t){var r=t.block,n=t.blockMap,o=t.blockWrapper,i=t.children,a=t.depth,u=void 0===a?1:a;return i&&0!==i.length?Array.from(i).map((function(t,i){var a=h({key:"".concat(r,"_").concat(u,"_").concat(i)},t instanceof HTMLElement?t.dataset:{}),d=a.blockName,b=void 0===d?"":d,v=c()(a,p),g=m(b,n);if(!g){var y=l()((null==t?void 0:t.outerHTML)||(null==t?void 0:t.textContent)||"");if("string"==typeof y&&y)return y;if(!Object(s.isValidElement)(y))return null;var O=t.childNodes.length?e({block:r,blockMap:n,children:t.childNodes,depth:u+1,blockWrapper:o}):void 0;return O?Object(s.cloneElement)(y,v,O):Object(s.cloneElement)(y,v)}var E=o||s.Fragment;return React.createElement(s.Suspense,{key:"".concat(r,"_").concat(u,"_").concat(i,"_suspense"),fallback:React.createElement("div",{className:"wc-block-placeholder"})},React.createElement(E,null,React.createElement(g,v,e({block:r,blockMap:n,children:t.children,depth:u+1,blockWrapper:o}),function(e,t,r){if(!Object(f.hasInnerBlocks)(e))return null;var n=r?Array.from(r).map((function(e){return e instanceof HTMLElement&&(null==e?void 0:e.dataset.blockName)||null})).filter(Boolean):[];return Object(f.getRegisteredBlocks)(e).filter((function(e){var t=e.blockName;return!0===e.force&&!n.includes(t)})).map((function(e,r){var n=e.blockName,o=e.component||m(n,t);return o?React.createElement(o,{key:"".concat(n,"_forced_").concat(r)}):null}))}(b,n,t.children))))})):null}({block:n,blockMap:u,children:e.children||[],blockWrapper:d});return h(h({},i(e,t)),{},{children:r})}})}},,function(e,t,r){"use strict";r.d(t,"b",(function(){return C})),r.d(t,"a",(function(){return T}));var n=r(4),o=r.n(n),i=r(5),c=r.n(i),a=(r(10),r(0)),s=r(11),u=r(12),l=r(27),f=r.n(l);function p(e,t,r,n,o,i,c){try{var a=e[i](c),s=a.value}catch(e){return void r(e)}a.done?t(s):Promise.resolve(s).then(n,o)}function d(e){return function(){var t=this,r=arguments;return new Promise((function(n,o){var i=e.apply(t,r);function c(e){p(i,n,o,c,a,"next",e)}function a(e){p(i,n,o,c,a,"throw",e)}c(void 0)}))}}var h=r(22),m=r(6),b=r.n(m),v=r(7),g=r(117),y=r(24),O=r(134),E=function(e){var t=e.notices,r=e.className,n=e.children,o=e.onRemove,i=void 0===o?v.noop:o,c=Object(y.useReducedMotion)(),s=Object(a.useState)((function(){return new WeakMap})),l=Object(h.a)(s,1)[0],p=Object(g.useTransition)(t,(function(e){return e.id}),{from:{opacity:0,height:0},enter:function(e){return function(){var t=d(f.a.mark((function t(r){return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,r({opacity:1,height:l.get(e).offsetHeight});case 2:return t.abrupt("return",t.sent);case 3:case"end":return t.stop()}}),t)})));return function(_x){return t.apply(this,arguments)}}()},leave:function(){return function(){var e=d(f.a.mark((function e(t){return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t({opacity:0});case 2:return e.next=4,t({height:0});case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()},immediate:c});r=b()("components-snackbar-list",r);var m=function(e){return function(){return i(e.id)}};return Object(a.createElement)("div",{className:r},n,p.map((function(e){var t=e.item,r=e.key,n=e.props;return Object(a.createElement)(g.animated.div,{key:r,style:n},Object(a.createElement)("div",{className:"components-snackbar-list__notice-container",ref:function(e){return e&&l.set(t,e)}},Object(a.createElement)(O.a,Object(u.a)({},Object(v.omit)(t,["content"]),{onRemove:m(t)}),t.content)))})))},j=r(26),S={},w=function(e){var t=e.className,r=e.notices,n=e.removeNotice;if(e.isEditor)return null;var o=r.filter((function(e){return"snackbar"===e.type})),i=o.length>0?o.reduce((function(e,t){return e[t.content]=!0,e}),{}):S,c=Object(j.__experimentalApplyCheckoutFilter)({filterName:"snackbarNoticeVisibility",defaultValue:i}),a=o.filter((function(e){return!0===c[e.content]})),s=b()(t,"wc-block-components-notices__snackbar");return React.createElement(E,{notices:a,className:s,onRemove:n})},_=r(52),k=r(36);function P(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function R(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?P(Object(r),!0).forEach((function(t){o()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):P(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var x=Object(a.createContext)({notices:[],createSnackbarNotice:function(e,t){},removeSnackbarNotice:function(e,t){},setIsSuppressed:function(e){},context:"wc/core"}),C=function(){return Object(a.useContext)(x)},T=function(e){var t=e.children,r=e.context,n=void 0===r?"wc/core":r,o=Object(s.useDispatch)("core/notices"),i=o.createNotice,u=o.removeNotice,l=Object(a.useState)(!1),f=c()(l,2),p=f[0],d=f[1],h=Object(_.a)().dispatchStoreEvent,m=Object(k.a)().isEditor,b=Object(a.useCallback)((function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};i("default",e,R(R({},t),{},{type:"snackbar",context:t.context||n})),h("store-notice-create",{status:"default",content:e,options:t})}),[i,h,n]),v=Object(a.useCallback)((function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:n;u(e,t)}),[u,n]),g={notices:Object(s.useSelect)((function(e){return{notices:e("core/notices").getNotices(n)}}),[n]).notices,createSnackbarNotice:b,removeSnackbarNotice:v,context:n,setIsSuppressed:d},y=p?null:React.createElement(w,{notices:g.notices,removeNotice:g.removeSnackbarNotice,isEditor:m});return React.createElement(x.Provider,{value:g},t,y)}},,,,,,,,,,,,,,,function(e){e.exports=JSON.parse('{"name":"woocommerce/cart-items-block","version":"1.0.0","title":"Cart Items block","description":"Column containing cart items.","category":"woocommerce","supports":{"align":false,"html":false,"multiple":false,"reusable":false,"inserter":false},"attributes":{"lock":{"type":"object","default":{"remove":true,"move":true}}},"parent":["woocommerce/filled-cart-block"],"textdomain":'woocommerce',"apiVersion":2}')},function(e){e.exports=JSON.parse('{"name":"woocommerce/cart-line-items-block","version":"1.0.0","title":"Cart Line Items","description":"Block containing current line items in Cart.","category":"woocommerce","supports":{"align":false,"html":false,"multiple":false,"reusable":false,"inserter":false},"attributes":{"lock":{"type":"object","default":{"remove":true,"move":true}}},"parent":["woocommerce/cart-items-block"],"textdomain":'woocommerce',"apiVersion":2}')},function(e){e.exports=JSON.parse('{"name":"woocommerce/cart-totals-block","version":"1.0.0","title":"Cart Totals","description":"Column containing the cart totals.","category":"woocommerce","supports":{"align":false,"html":false,"multiple":false,"reusable":false,"inserter":false},"attributes":{"checkbox":{"type":"boolean","default":false},"text":{"type":"string","required":false},"lock":{"type":"object","default":{"remove":true}}},"parent":["woocommerce/filled-cart-block"],"textdomain":'woocommerce',"apiVersion":2}')},function(e){e.exports=JSON.parse('{"name":"woocommerce/cart-order-summary-block","version":"1.0.0","title":"Order Summary","description":"Show customers a summary of their order.","category":"woocommerce","supports":{"align":false,"html":false,"multiple":false,"reusable":false,"inserter":false},"attributes":{"lock":{"type":"object","default":{"remove":true,"move":true}}},"parent":["woocommerce/cart-totals-block"],"textdomain":'woocommerce',"apiVersion":2}')},function(e){e.exports=JSON.parse('{"name":"woocommerce/cart-express-payment-block","version":"1.0.0","title":"Express Checkout","description":"Provide an express payment option for your customers.","category":"woocommerce","supports":{"align":false,"html":false,"multiple":false,"reusable":false,"inserter":false},"attributes":{"lock":{"type":"object","default":{"remove":true,"move":true}}},"parent":["woocommerce/cart-totals-block"],"textdomain":'woocommerce',"apiVersion":2}')},function(e){e.exports=JSON.parse('{"name":"woocommerce/proceed-to-checkout-block","version":"1.0.0","title":"Proceed to checkout","description":"Allow customers proceed to Checkout.","category":"woocommerce","supports":{"align":false,"html":false,"multiple":false,"reusable":false,"inserter":false},"attributes":{"lock":{"default":{"remove":true,"move":true}}},"parent":["woocommerce/cart-totals-block"],"textdomain":'woocommerce',"apiVersion":2}')},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));var n=r(146),o=function(e){var t=e.children,r=e.redirectUrl;return React.createElement(n.a,{isCart:!0,redirectUrl:r},t)}},,,,,function(e,t,r){"use strict";r.d(t,"a",(function(){return a}));var n=r(5),o=r.n(n),i=r(0),c=r(127),a=function(){var e=Object(c.b)(),t=e.hasValidationErrors,r=e.getValidationError,n=e.clearValidationError,a=e.hideValidationError,s=e.setValidationErrors,u="extensions-errors";return{hasValidationErrors:t,getValidationError:Object(i.useCallback)((function(e){return r("".concat(u,"-").concat(e))}),[r]),clearValidationError:Object(i.useCallback)((function(e){return n("".concat(u,"-").concat(e))}),[n]),hideValidationError:Object(i.useCallback)((function(e){return a("".concat(u,"-").concat(e))}),[a]),setValidationErrors:Object(i.useCallback)((function(e){return s(Object.fromEntries(Object.entries(e).map((function(e){var t=o()(e,2),r=t[0],n=t[1];return["".concat(u,"-").concat(r),n]}))))}),[s])}}},,,,function(e,t,r){e.exports=r(322)},,,,,,,,,,,,,,function(e,t,r){"use strict";r.r(t);var n=r(23),o=r.n(n),i=r(199),c=r(128),a=r(188),s=r(0),u=r(32),l=r(304),f=r(38),p=r(224),d=r(83),h=r(26),m=r(203),b=r(204),v=r(241),g=r(245),y=r(242),O=r(244),E=r(243),j=r(246);r.p=d.k,Object(h.registerCheckoutBlock)({metadata:m,component:Object(s.lazy)((function(){return r.e(25).then(r.bind(null,397))}))}),Object(h.registerCheckoutBlock)({metadata:b,component:Object(s.lazy)((function(){return r.e(23).then(r.bind(null,398))}))}),Object(h.registerCheckoutBlock)({metadata:m,component:Object(s.lazy)((function(){return r.e(25).then(r.bind(null,397))}))}),Object(h.registerCheckoutBlock)({metadata:b,component:Object(s.lazy)((function(){return r.e(23).then(r.bind(null,398))}))}),Object(h.registerCheckoutBlock)({metadata:v,component:Object(s.lazy)((function(){return r.e(26).then(r.bind(null,399))}))}),Object(h.registerCheckoutBlock)({metadata:y,component:Object(s.lazy)((function(){return Promise.all([r.e(1),r.e(5),r.e(27)]).then(r.bind(null,414))}))}),Object(h.registerCheckoutBlock)({metadata:E,component:Object(s.lazy)((function(){return r.e(29).then(r.bind(null,400))}))}),Object(h.registerCheckoutBlock)({metadata:O,component:Object(s.lazy)((function(){return Promise.all([r.e(0),r.e(1),r.e(2),r.e(4),r.e(28)]).then(r.bind(null,401))}))}),Object(h.registerCheckoutBlock)({metadata:g,component:Object(s.lazy)((function(){return Promise.all([r.e(3),r.e(24)]).then(r.bind(null,402))}))}),Object(h.registerCheckoutBlock)({metadata:j,component:Object(s.lazy)((function(){return r.e(22).then(r.bind(null,415))}))});var S=r(1),w=r(8),_=r(11),k=r(105),P=r(127),R=r(2),x=r(44),C=r(137),T=r(114),A=r(226),M=r(103),N=r(299),D=function(){window.location.reload(!0)},I=function(e){var t=e.children,r=Object(u.a)().cartIsLoading;return React.createElement(k.a,{showSpinner:!0,isLoading:r},React.createElement(P.a,null,t))},F=function(e){var t=e.scrollToTop;return Object(s.useEffect)((function(){var e=function(){Object(_.dispatch)(w.CART_STORE_KEY).invalidateResolutionForStore(),t()},r=Object(C.b)("added_to_cart","wc-blocks_added_to_cart"),n=Object(C.b)("removed_from_cart","wc-blocks_removed_from_cart");return document.body.addEventListener("wc-blocks_added_to_cart",e),document.body.addEventListener("wc-blocks_removed_from_cart",e),function(){r(),n(),document.body.removeEventListener("wc-blocks_added_to_cart",e),document.body.removeEventListener("wc-blocks_removed_from_cart",e)}}),[t]),null},L=Object(T.a)((function(e){var t=e.attributes,r=e.children,n=e.scrollToTop;return React.createElement(x.a,{header:Object(S.__)("Something went wrong…",'woocommerce'),text:Object(S.__)("The cart has encountered an unexpected error. If the error persists, please get in touch with us for help.",'woocommerce'),button:React.createElement("button",{className:"wc-block-button",onClick:D},Object(S.__)("Reload the page",'woocommerce')),showErrorMessage:R.CURRENT_USER_IS_ADMIN},React.createElement(A.a,{context:"wc/cart"},React.createElement(M.a,{context:"wc/cart"},React.createElement(h.SlotFillProvider,null,React.createElement(N.a,null,React.createElement(I,{attributes:t},r),React.createElement(F,{scrollToTop:n}))))))})),V={isPreview:{type:"boolean",default:!1,save:!1},isShippingCalculatorEnabled:{type:"boolean",default:Object(R.getSetting)("isShippingCalculatorEnabled",!0)},checkoutPageId:{type:"number",default:0},hasDarkControls:{type:"boolean",default:Object(R.getSetting)("hasDarkEditorStyleSupport",!1)},showRateAfterTaxName:{type:"boolean",default:!0}},B=["extensions","receiveCart"];Object(p.a)({Block:Object(i.a)(Object(c.a)(L)),blockName:"woocommerce/cart-i2",selector:".wp-block-woocommerce-cart-i2",getProps:function(e){return{attributes:Object(a.a)(V,e?e.dataset:{})}},blockMap:Object(f.getRegisteredBlockComponents)("woocommerce/cart-i2"),blockWrapper:function(e){var t=e.children,r=Object(u.a)(),n=r.extensions,i=(r.receiveCart,o()(r,B)),c=Object(l.a)();return s.Children.map(t,(function(e){if(Object(s.isValidElement)(e)){var t={extensions:n,cart:i,validation:c};return Object(s.cloneElement)(e,t)}return e}))}})}]);woocommerce-blocks/build/product-categories.js000064400000023460151335517640015615 0ustar00this.wc=this.wc||{},this.wc.blocks=this.wc.blocks||{},this.wc.blocks["product-categories"]=function(e){function t(t){for(var r,a,l=t[0],i=t[1],s=t[2],b=0,p=[];b<l.length;b++)a=l[b],Object.prototype.hasOwnProperty.call(n,a)&&n[a]&&p.push(n[a][0]),n[a]=0;for(r in i)Object.prototype.hasOwnProperty.call(i,r)&&(e[r]=i[r]);for(u&&u(t);p.length;)p.shift()();return c.push.apply(c,s||[]),o()}function o(){for(var e,t=0;t<c.length;t++){for(var o=c[t],r=!0,l=1;l<o.length;l++){var i=o[l];0!==n[i]&&(r=!1)}r&&(c.splice(t--,1),e=a(a.s=o[0]))}return e}var r={},n={29:0},c=[];function a(t){if(r[t])return r[t].exports;var o=r[t]={i:t,l:!1,exports:{}};return e[t].call(o.exports,o,o.exports,a),o.l=!0,o.exports}a.m=e,a.c=r,a.d=function(e,t,o){a.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},a.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},a.t=function(e,t){if(1&t&&(e=a(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(a.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)a.d(o,r,function(t){return e[t]}.bind(null,r));return o},a.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return a.d(t,"a",t),t},a.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},a.p="";var l=window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[],i=l.push.bind(l);l.push=t,l=l.slice();for(var s=0;s<l.length;s++)t(l[s]);var u=i;return c.push([758,0]),o()}({0:function(e,t){e.exports=window.wp.element},1:function(e,t){e.exports=window.wp.i18n},12:function(e,t){e.exports=window.wp.blockEditor},123:function(e,t){},21:function(e,t){e.exports=window.wp.compose},26:function(e,t){e.exports=window.wp.blocks},28:function(e,t){e.exports=window.wp.primitives},4:function(e,t){e.exports=window.wp.components},66:function(e,t,o){"use strict";var r=o(5),n=o.n(r),c=o(16),a=o.n(c),l=o(0),i=["srcElement","size"];function s(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),o.push.apply(o,r)}return o}t.a=function(e){var t=e.srcElement,o=e.size,r=void 0===o?24:o,c=a()(e,i);return Object(l.isValidElement)(t)?Object(l.cloneElement)(t,function(e){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?s(Object(o),!0).forEach((function(t){n()(e,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):s(Object(o)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(o,t))}))}return e}({width:r,height:r},c)):null}},7:function(e,t){e.exports=window.lodash},758:function(e,t,o){e.exports=o(869)},759:function(e,t){},760:function(e,t){},84:function(e,t){e.exports=window.wp.serverSideRender},869:function(e,t,o){"use strict";o.r(t);var r=o(9),n=o.n(r),c=o(0),a=o(1),l=o(26),i=o(66),s=o(28),u=Object(c.createElement)(s.SVG,{xmlns:"http://www.w3.org/2000/SVG",viewBox:"0 0 24 24"},Object(c.createElement)("path",{fill:"none",d:"M0 0h24v24H0V0z"}),Object(c.createElement)("path",{d:"M11 7h6v2h-6zm0 4h6v2h-6zm0 4h6v2h-6zM7 7h2v2H7zm0 4h2v2H7zm0 4h2v2H7zM20.1 3H3.9c-.5 0-.9.4-.9.9v16.2c0 .4.4.9.9.9h16.2c.4 0 .9-.5.9-.9V3.9c0-.5-.5-.9-.9-.9zM19 19H5V5h14v14z"})),b=(o(759),o(760),o(12)),p=o(84),d=o.n(p),h=(o(2),o(4)),g=o(88),f=function(){return Object(c.createElement)(h.Placeholder,{icon:Object(c.createElement)(i.a,{srcElement:u}),label:Object(a.__)("Product Categories List",'woocommerce'),className:"wc-block-product-categories"},Object(a.__)("This block shows product categories for your store. To use it, you'll first need to create a product and assign it to a category.",'woocommerce'))},w=function(e){var t,o,r,n,l,i=e.attributes,s=e.setAttributes,u=e.name;return Object(c.createElement)(c.Fragment,null,(t=i.hasCount,o=i.hasImage,r=i.hasEmpty,n=i.isDropdown,l=i.isHierarchical,Object(c.createElement)(b.InspectorControls,{key:"inspector"},Object(c.createElement)(h.PanelBody,{title:Object(a.__)("List Settings",'woocommerce'),initialOpen:!0},Object(c.createElement)(g.a,{label:Object(a.__)("Display style",'woocommerce'),value:n?"dropdown":"list",options:[{label:Object(a.__)("List",'woocommerce'),value:"list"},{label:Object(a.__)("Dropdown",'woocommerce'),value:"dropdown"}],onChange:function(e){return s({isDropdown:"dropdown"===e})}})),Object(c.createElement)(h.PanelBody,{title:Object(a.__)("Content",'woocommerce'),initialOpen:!0},Object(c.createElement)(h.ToggleControl,{label:Object(a.__)("Show product count",'woocommerce'),help:t?Object(a.__)("Product count is visible.",'woocommerce'):Object(a.__)("Product count is hidden.",'woocommerce'),checked:t,onChange:function(){return s({hasCount:!t})}}),!n&&Object(c.createElement)(h.ToggleControl,{label:Object(a.__)("Show category images",'woocommerce'),help:o?Object(a.__)("Category images are visible.",'woocommerce'):Object(a.__)("Category images are hidden.",'woocommerce'),checked:o,onChange:function(){return s({hasImage:!o})}}),Object(c.createElement)(h.ToggleControl,{label:Object(a.__)("Show hierarchy",'woocommerce'),help:l?Object(a.__)("Hierarchy is visible.",'woocommerce'):Object(a.__)("Hierarchy is hidden.",'woocommerce'),checked:l,onChange:function(){return s({isHierarchical:!l})}}),Object(c.createElement)(h.ToggleControl,{label:Object(a.__)("Show empty categories",'woocommerce'),help:r?Object(a.__)("Empty categories are visible.",'woocommerce'):Object(a.__)("Empty categories are hidden.",'woocommerce'),checked:r,onChange:function(){return s({hasEmpty:!r})}})))),Object(c.createElement)(h.Disabled,null,Object(c.createElement)(d.a,{block:u,attributes:i,EmptyResponsePlaceholder:f})))};Object(l.registerBlockType)("woocommerce/product-categories",{title:Object(a.__)("Product Categories List",'woocommerce'),icon:{src:Object(c.createElement)(i.a,{srcElement:u}),foreground:"#96588a"},category:"woocommerce",keywords:[Object(a.__)("WooCommerce",'woocommerce')],description:Object(a.__)("Show all product categories as a list or dropdown.",'woocommerce'),supports:{align:["wide","full"],html:!1},example:{attributes:{hasCount:!0,hasImage:!1}},attributes:{align:{type:"string"},hasCount:{type:"boolean",default:!0},hasImage:{type:"boolean",default:!1},hasEmpty:{type:"boolean",default:!1},isDropdown:{type:"boolean",default:!1},isHierarchical:{type:"boolean",default:!0}},transforms:{from:[{type:"block",blocks:["core/legacy-widget"],isMatch:function(e){var t=e.idBase,o=e.instance;return"woocommerce_product_categories"===t&&!(null==o||!o.raw)},transform:function(e){var t=e.instance;return Object(l.createBlock)("woocommerce/product-categories",{hasCount:!!t.raw.count,hasEmpty:!t.raw.hide_empty,isDropdown:!!t.raw.dropdown,isHierarchical:!!t.raw.hierarchical})}}]},deprecated:[{attributes:{hasCount:{type:"boolean",default:!0,source:"attribute",selector:"div",attribute:"data-has-count"},hasEmpty:{type:"boolean",default:!1,source:"attribute",selector:"div",attribute:"data-has-empty"},isDropdown:{type:"boolean",default:!1,source:"attribute",selector:"div",attribute:"data-is-dropdown"},isHierarchical:{type:"boolean",default:!0,source:"attribute",selector:"div",attribute:"data-is-hierarchical"}},migrate:function(e){return e},save:function(e){var t=e.attributes,o=t.hasCount,r=t.hasEmpty,a=t.isDropdown,l=t.isHierarchical,i={};return o&&(i["data-has-count"]=!0),r&&(i["data-has-empty"]=!0),a&&(i["data-is-dropdown"]=!0),l&&(i["data-is-hierarchical"]=!0),Object(c.createElement)("div",n()({className:"is-loading"},i),a?Object(c.createElement)("span",{"aria-hidden":!0,className:"wc-block-product-categories__placeholder"}):Object(c.createElement)("ul",{"aria-hidden":!0},Object(c.createElement)("li",null,Object(c.createElement)("span",{className:"wc-block-product-categories__placeholder"})),Object(c.createElement)("li",null,Object(c.createElement)("span",{className:"wc-block-product-categories__placeholder"})),Object(c.createElement)("li",null,Object(c.createElement)("span",{className:"wc-block-product-categories__placeholder"}))))}}],edit:function(e){return Object(c.createElement)(w,e)},save:function(){return null}})},88:function(e,t,o){"use strict";var r=o(9),n=o.n(r),c=o(17),a=o.n(c),l=o(18),i=o.n(l),s=o(13),u=o.n(s),b=o(19),p=o.n(b),d=o(20),h=o.n(d),g=o(10),f=o.n(g),w=o(0),m=o(7),O=o(6),y=o.n(O),j=o(4),v=o(21);o(123);var _=function(e){p()(c,e);var t,o,r=(t=c,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=f()(t);if(o){var n=f()(this).constructor;e=Reflect.construct(r,arguments,n)}else e=r.apply(this,arguments);return h()(this,e)});function c(){var e;return a()(this,c),(e=r.apply(this,arguments)).onClick=e.onClick.bind(u()(e)),e}return i()(c,[{key:"onClick",value:function(e){this.props.onChange&&this.props.onChange(e.target.value)}},{key:"render",value:function(){var e,t=this,o=this.props,r=o.label,c=o.checked,a=o.instanceId,l=o.className,i=o.help,s=o.options,u=o.value,b="inspector-toggle-button-control-".concat(a);return i&&(e=Object(m.isFunction)(i)?i(c):i),Object(w.createElement)(j.BaseControl,{id:b,help:e,className:y()("components-toggle-button-control",l)},Object(w.createElement)("label",{id:b+"__label",htmlFor:b,className:"components-toggle-button-control__label"},r),Object(w.createElement)(j.ButtonGroup,{"aria-labelledby":b+"__label"},s.map((function(e,o){var c={};return u===e.value?(c.isPrimary=!0,c["aria-pressed"]=!0):(c.isSecondary=!0,c["aria-pressed"]=!1),Object(w.createElement)(j.Button,n()({key:"".concat(e.label,"-").concat(e.value,"-").concat(o),value:e.value,onClick:t.onClick,"aria-label":r+": "+e.label},c),e.label)}))))}}]),c}(w.Component);t.a=Object(v.withInstanceId)(_)}});woocommerce-blocks/build/wc-blocks-google-analytics.js000064400000014022151335517640017127 0ustar00!function(t){var e={};function o(n){if(e[n])return e[n].exports;var c=e[n]={i:n,l:!1,exports:{}};return t[n].call(c.exports,c,c.exports,o),c.l=!0,c.exports}o.m=t,o.c=e,o.d=function(t,e,n){o.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},o.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},o.t=function(t,e){if(1&e&&(t=o(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(o.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var c in t)o.d(n,c,function(e){return t[e]}.bind(null,c));return n},o.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return o.d(e,"a",e),e},o.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},o.p="",o(o.s=5)}([function(t,e){t.exports=window.wp.hooks},function(t,e){t.exports=window.wp.i18n},function(t,e){t.exports=function(t,e,o){return e in t?Object.defineProperty(t,e,{value:o,enumerable:!0,configurable:!0,writable:!0}):t[e]=o,t},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e,o){var n=o(4);t.exports=function(t,e){if(null==t)return{};var o,c,r=n(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(c=0;c<i.length;c++)o=i[c],e.indexOf(o)>=0||Object.prototype.propertyIsEnumerable.call(t,o)&&(r[o]=t[o])}return r},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e){t.exports=function(t,e){if(null==t)return{};var o,n,c={},r=Object.keys(t);for(n=0;n<r.length;n++)o=r[n],e.indexOf(o)>=0||(c[o]=t[o]);return c},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e,o){"use strict";o.r(e);var n=o(2),c=o.n(n),r=o(3),i=o.n(r),a=o(1),u=o(0),s="woocommerce-google-analytics",p="experimental__woocommerce_blocks",d=function(t,e){var o=t.sku?t.sku:"#"+t.id,n="categories"in t&&t.categories.length?t.categories[0].name:"";return{id:o,name:t.name,quantity:e,category:n,price:(parseInt(t.prices.price,10)/Math.pow(10,t.prices.currency_minor_unit)).toString()}},l=function(t,e){var o=t.sku?t.sku:"#"+t.id,n=t.categories.length?t.categories[0].name:"";return{id:o,name:t.name,list_name:e,category:n,price:(parseInt(t.prices.price,10)/Math.pow(10,t.prices.currency_minor_unit)).toString()}},f=function(t,e){if("function"!=typeof gtag)throw new Error("Function gtag not implemented.");console.log("Tracking event ".concat(t)),window.gtag("event",t,e)},b=-1,g=function(t){return function(e){var o,n=e.storeCart;b!==t&&(f(0===t?"begin_checkout":"checkout_progress",{items:n.cartItems.map(d),coupon:(null===(o=n.cartCoupons[0])||void 0===o?void 0:o.code)||"",currency:n.cartTotals.currency_code,value:(parseInt(n.cartTotals.total_price,10)/Math.pow(10,n.cartTotals.currency_minor_unit)).toString(),checkout_step:t}),b=t)}},m=function(t){var e=t.step,o=t.option,n=t.value;return function(){f("set_checkout_option",{checkout_step:e,checkout_option:o,value:n}),b=e}},_=["step"];function v(t,e){var o=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),o.push.apply(o,n)}return o}function y(t){for(var e=1;e<arguments.length;e++){var o=null!=arguments[e]?arguments[e]:{};e%2?v(Object(o),!0).forEach((function(e){c()(t,e,o[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(o)):v(Object(o)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(o,e))}))}return t}Object(u.addAction)("".concat(p,"-checkout-render-checkout-form"),s,g(0)),Object(u.addAction)("".concat(p,"-checkout-set-email-address"),s,g(1)),Object(u.addAction)("".concat(p,"-checkout-set-shipping-address"),s,g(2)),Object(u.addAction)("".concat(p,"-checkout-set-billing-address"),s,g(3)),Object(u.addAction)("".concat(p,"-checkout-set-phone-number"),s,(function(t){var e=t.step,o=i()(t,_);g("shipping"===e?2:3)(o)})),Object(u.addAction)("".concat(p,"-checkout-set-selected-shipping-rate"),s,(function(t){var e=t.shippingRateId;m({step:4,option:Object(a.__)("Shipping Method",'woocommerce'),value:e})()})),Object(u.addAction)("".concat(p,"-checkout-set-active-payment-method"),s,(function(t){var e=t.paymentMethodSlug;m({step:5,option:Object(a.__)("Payment Method",'woocommerce'),value:e})()})),Object(u.addAction)("".concat(p,"-checkout-submit"),s,(function(){f("add_payment_info")})),Object(u.addAction)("".concat(p,"-cart-add-item"),s,(function(t){var e=t.product,o=t.quantity,n=void 0===o?1:o;f("add_to_cart",{event_category:"ecommerce",event_label:Object(a.__)("Add to Cart",'woocommerce'),items:[d(e,n)]})})),Object(u.addAction)("".concat(p,"-cart-remove-item"),s,(function(t){var e=t.product,o=t.quantity,n=void 0===o?1:o;f("remove_from_cart",{event_category:"ecommerce",event_label:Object(a.__)("Remove Cart Item",'woocommerce'),items:[d(e,n)]})})),Object(u.addAction)("".concat(p,"-cart-set-item-quantity"),s,(function(t){var e=t.product,o=t.quantity,n=void 0===o?1:o;f("change_cart_quantity",{event_category:"ecommerce",event_label:Object(a.__)("Change Cart Item Quantity",'woocommerce'),items:[d(e,n)]})})),Object(u.addAction)("".concat(p,"-product-list-render"),s,(function(t){var e=t.products,o=t.listName,n=void 0===o?Object(a.__)("Product List",'woocommerce'):o;0!==e.length&&f("view_item_list",{event_category:"engagement",event_label:Object(a.__)("Viewing products",'woocommerce'),items:e.map((function(t,e){return y(y({},l(t,n)),{},{list_position:e+1})}))})})),Object(u.addAction)("".concat(p,"-product-view-link"),s,(function(t){var e=t.product,o=t.listName;f("select_content",{content_type:"product",items:[l(e,o)]})})),Object(u.addAction)("".concat(p,"-product-search"),s,(function(t){var e=t.searchTerm;f("search",{search_term:e})})),Object(u.addAction)("".concat(p,"-product-render"),s,(function(t){var e=t.product,o=t.listName;e&&f("view_item",{items:[l(e,o)]})})),Object(u.addAction)("".concat(p,"-store-notice-create"),s,(function(t){var e=t.status,o=t.content;"error"===e&&f("exception",{description:o,fatal:!1})}))}]);woocommerce-blocks/build/cart-frontend.js000064400001150156151335517640014564 0ustar00!function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=298)}([function(e,t){e.exports=window.wp.element},function(e,t){e.exports=window.wp.i18n},function(e,t){e.exports=window.wc.wcSettings},function(e,t){e.exports=window.React},function(e,t){e.exports=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,n){var r=n(84),o=n(85),a=n(67),c=n(86);e.exports=function(e,t){return r(e)||o(e,t)||a(e,t)||c()},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,n){var r;!function(){"use strict";var n={}.hasOwnProperty;function o(){for(var e=[],t=0;t<arguments.length;t++){var r=arguments[t];if(r){var a=typeof r;if("string"===a||"number"===a)e.push(r);else if(Array.isArray(r)){if(r.length){var c=o.apply(null,r);c&&e.push(c)}}else if("object"===a)if(r.toString===Object.prototype.toString)for(var i in r)n.call(r,i)&&r[i]&&e.push(i);else e.push(r.toString())}}return e.join(" ")}e.exports?(o.default=o,e.exports=o):void 0===(r=function(){return o}.apply(t,[]))||(e.exports=r)}()},function(e,t){e.exports=window.lodash},function(e,t){e.exports=window.wc.wcBlocksData},function(e,t,n){"use strict";function r(e){return(r=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}n.d(t,"a",(function(){return r}))},function(e,t,n){e.exports=n(79)()},function(e,t){e.exports=window.wp.data},function(e,t,n){"use strict";function r(){return(r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";function r(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}n.d(t,"a",(function(){return r}))},function(e,t){function n(){return e.exports=n=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},e.exports.default=e.exports,e.exports.__esModule=!0,n.apply(this,arguments)}e.exports=n,e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function o(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}n.d(t,"a",(function(){return o}))},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(88);function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Object(r.a)(e,t)}},function(e,t,n){"use strict";n.d(t,"a",(function(){return c}));var r=n(21),o=n.n(r),a=n(13);function c(e,t){return!t||"object"!==o()(t)&&"function"!=typeof t?Object(a.a)(e):t}},function(e,t,n){"use strict";function r(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}n.d(t,"a",(function(){return r}))},function(e,t){function n(t){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?(e.exports=n=function(e){return typeof e},e.exports.default=e.exports,e.exports.__esModule=!0):(e.exports=n=function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.default=e.exports,e.exports.__esModule=!0),n(t)}e.exports=n,e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(65);function o(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,a=[],_n=!0,c=!1;try{for(n=n.call(e);!(_n=(r=n.next()).done)&&(a.push(r.value),!t||a.length!==t);_n=!0);}catch(e){c=!0,o=e}finally{try{_n||null==n.return||n.return()}finally{if(c)throw o}}return a}}(e,t)||Object(r.a)(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}},function(e,t,n){var r=n(77);e.exports=function(e,t){if(null==e)return{};var n,o,a=r(e,t);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(e);for(o=0;o<c.length;o++)n=c[o],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=window.wp.compose},function(e,t){e.exports=window.wp.isShallowEqual},function(e,t){e.exports=window.wc.blocksCheckout},function(e,t){e.exports=window.regeneratorRuntime},function(e,t){e.exports=window.wp.htmlEntities},function(e,t){e.exports=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){function n(t){return e.exports=n=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},e.exports.default=e.exports,e.exports.__esModule=!0,n(t)}e.exports=n,e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var r=n(59),o=n(65);function a(e){return function(e){if(Array.isArray(e))return Object(r.a)(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||Object(o.a)(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}},function(e,t,n){"use strict";n.d(t,"a",(function(){return E}));var r=n(5),o=n.n(r),a=n(4),c=n.n(a),i=n(7),s=n(0),u=n(8),l=n(11),f=n(28),d=n(92),p=n(93),b=n(36);function m(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function h(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?m(Object(n),!0).forEach((function(t){c()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):m(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var g={first_name:"",last_name:"",company:"",address_1:"",address_2:"",city:"",state:"",postcode:"",country:"",phone:""},v=h(h({},g),{},{email:""}),y={total_items:"",total_items_tax:"",total_fees:"",total_fees_tax:"",total_discount:"",total_discount_tax:"",total_shipping:"",total_shipping_tax:"",total_price:"",total_tax:"",tax_lines:u.EMPTY_TAX_LINES,currency_code:"",currency_symbol:"",currency_minor_unit:2,currency_decimal_separator:"",currency_thousand_separator:"",currency_prefix:"",currency_suffix:""},O=function(e){return Object(d.a)(Object.entries(e).map((function(e){var t=o()(e,2),n=t[0],r=t[1];return[n,Object(f.decodeEntities)(r)]})))},j={cartCoupons:u.EMPTY_CART_COUPONS,cartItems:u.EMPTY_CART_ITEMS,cartFees:u.EMPTY_CART_FEES,cartItemsCount:0,cartItemsWeight:0,cartNeedsPayment:!0,cartNeedsShipping:!0,cartItemErrors:u.EMPTY_CART_ITEM_ERRORS,cartTotals:y,cartIsLoading:!0,cartErrors:u.EMPTY_CART_ERRORS,billingAddress:v,shippingAddress:g,shippingRates:u.EMPTY_SHIPPING_RATES,shippingRatesLoading:!1,cartHasCalculatedShipping:!1,paymentRequirements:u.EMPTY_PAYMENT_REQUIREMENTS,receiveCart:function(){},extensions:u.EMPTY_EXTENSIONS},E=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{shouldSelect:!0},t=Object(b.a)(),n=t.isEditor,r=t.previewData,o=null==r?void 0:r.previewCart,a=e.shouldSelect,c=Object(s.useRef)(),f=Object(l.useSelect)((function(e,t){var r=t.dispatch;if(!a)return j;if(n)return{cartCoupons:o.coupons,cartItems:o.items,cartFees:o.fees,cartItemsCount:o.items_count,cartItemsWeight:o.items_weight,cartNeedsPayment:o.needs_payment,cartNeedsShipping:o.needs_shipping,cartItemErrors:u.EMPTY_CART_ITEM_ERRORS,cartTotals:o.totals,cartIsLoading:!1,cartErrors:u.EMPTY_CART_ERRORS,billingAddress:v,shippingAddress:g,extensions:u.EMPTY_EXTENSIONS,shippingRates:o.shipping_rates,shippingRatesLoading:!1,cartHasCalculatedShipping:o.has_calculated_shipping,paymentRequirements:o.paymentRequirements,receiveCart:"function"==typeof(null==o?void 0:o.receiveCart)?o.receiveCart:function(){}};var c=e(u.CART_STORE_KEY),i=c.getCartData(),s=c.getCartErrors(),l=c.getCartTotals(),f=!c.hasFinishedResolution("getCartData"),d=c.isCustomerDataUpdating(),b=r(u.CART_STORE_KEY).receiveCart,m=O(i.billingAddress),y=i.needsShipping?O(i.shippingAddress):m,E=i.fees.length>0?i.fees.map((function(e){return O(e)})):u.EMPTY_CART_FEES;return{cartCoupons:i.coupons.length>0?i.coupons.map((function(e){return h(h({},e),{},{label:e.code})})):u.EMPTY_CART_COUPONS,cartItems:i.items,cartFees:E,cartItemsCount:i.itemsCount,cartItemsWeight:i.itemsWeight,cartNeedsPayment:i.needsPayment,cartNeedsShipping:i.needsShipping,cartItemErrors:i.errors,cartTotals:l,cartIsLoading:f,cartErrors:s,billingAddress:Object(p.a)(m),shippingAddress:Object(p.a)(y),extensions:i.extensions,shippingRates:i.shippingRates,shippingRatesLoading:d,cartHasCalculatedShipping:i.hasCalculatedShipping,paymentRequirements:i.paymentRequirements,receiveCart:b}}),[a]);return c.current&&Object(i.isEqual)(c.current,f)||(c.current=f),c.current}},function(e,t){e.exports=window.wp.a11y},function(e,t){e.exports=window.wp.primitives},function(e,t,n){"use strict";n.d(t,"a",(function(){return s})),n.d(t,"b",(function(){return u})),n.d(t,"c",(function(){return f}));var r,o,a=n(49);!function(e){e.SUCCESS="success",e.FAIL="failure",e.ERROR="error"}(r||(r={})),function(e){e.PAYMENTS="wc/payment-area",e.EXPRESS_PAYMENTS="wc/express-payment-area"}(o||(o={}));var c=function(e,t){return Object(a.b)(e)&&"type"in e&&e.type===t},i=function(e){return c(e,r.SUCCESS)},s=function(e){return c(e,r.ERROR)},u=function(e){return c(e,r.FAIL)},l=function(e){return!Object(a.b)(e)||void 0===e.retry||!0===e.retry},f=function(){return{responseTypes:r,noticeContexts:o,shouldRetry:l,isSuccessResponse:i,isErrorResponse:s,isFailResponse:u}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var r=n(0),o=(n(11),Object(r.createContext)({isEditor:!1,currentPostId:0,previewData:{},getPreviewData:function(){}})),a=function(){return Object(r.useContext)(o)}},function(e,t){e.exports=window.wp.dom},function(e,t){e.exports=window.wc.wcBlocksRegistry},function(e,t){function n(e,t,n,r,o,a,c){try{var i=e[a](c),s=i.value}catch(e){return void n(e)}i.done?t(s):Promise.resolve(s).then(r,o)}e.exports=function(e){return function(){var t=this,r=arguments;return new Promise((function(o,a){var c=e.apply(t,r);function i(e){n(c,o,a,i,s,"next",e)}function s(e){n(c,o,a,i,s,"throw",e)}i(void 0)}))}},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){function n(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}e.exports=function(e,t,r){return t&&n(e.prototype,t),r&&n(e,r),e},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,n){var r=n(71);e.exports=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&r(e,t)},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,n){var r=n(21).default,o=n(29);e.exports=function(e,t){return!t||"object"!==r(t)&&"function"!=typeof t?o(e):t},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,n){"use strict";var r=n(40),o=n.n(r),a=n(41),c=n.n(a),i=n(29),s=n.n(i),u=n(42),l=n.n(u),f=n(43),d=n.n(f),p=n(30),b=n.n(p),m=n(4),h=n.n(m),g=(n(10),n(3)),v=n(1),y=n(83),O=function(e){var t=e.imageUrl,n=void 0===t?"".concat(y.l,"/block-error.svg"):t,r=e.header,o=void 0===r?Object(v.__)("Oops!",'woocommerce'):r,a=e.text,c=void 0===a?Object(v.__)("There was an error loading the content.",'woocommerce'):a,i=e.errorMessage,s=e.errorMessagePrefix,u=void 0===s?Object(v.__)("Error:",'woocommerce'):s,l=e.button;return React.createElement("div",{className:"wc-block-error wc-block-components-error"},n&&React.createElement("img",{className:"wc-block-error__image wc-block-components-error__image",src:n,alt:""}),React.createElement("div",{className:"wc-block-error__content wc-block-components-error__content"},o&&React.createElement("p",{className:"wc-block-error__header wc-block-components-error__header"},o),c&&React.createElement("p",{className:"wc-block-error__text wc-block-components-error__text"},c),i&&React.createElement("p",{className:"wc-block-error__message wc-block-components-error__message"},u?u+" ":"",i),l&&React.createElement("p",{className:"wc-block-error__button wc-block-components-error__button"},l)))};n(81);var j=function(e){l()(a,e);var t,n,r=(t=a,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=b()(t);if(n){var o=b()(this).constructor;e=Reflect.construct(r,arguments,o)}else e=r.apply(this,arguments);return d()(this,e)});function a(){var e;o()(this,a);for(var t=arguments.length,n=new Array(t),c=0;c<t;c++)n[c]=arguments[c];return e=r.call.apply(r,[this].concat(n)),h()(s()(e),"state",{errorMessage:"",hasError:!1}),e}return c()(a,[{key:"render",value:function(){var e=this.props,t=e.header,n=e.imageUrl,r=e.showErrorMessage,o=e.text,a=e.errorMessagePrefix,c=e.renderError,i=e.button,s=this.state,u=s.errorMessage;return s.hasError?"function"==typeof c?c({errorMessage:u}):React.createElement(O,{errorMessage:r?u:null,header:t,imageUrl:n,text:o,errorMessagePrefix:a,button:i}):this.props.children}}],[{key:"getDerivedStateFromError",value:function(e){return void 0!==e.statusText&&void 0!==e.status?{errorMessage:React.createElement(React.Fragment,null,React.createElement("strong",null,e.status),": ",e.statusText),hasError:!0}:{errorMessage:e.message,hasError:!0}}}]),a}(g.Component);j.defaultProps={showErrorMessage:!0},t.a=j},function(e,t){e.exports=window.wp.deprecated},function(e,t,n){var r=n(94),o=n(95),a=n(67),c=n(96);e.exports=function(e){return r(e)||o(e)||a(e)||c()},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,n){"use strict";(function(e){var r=n(0),o=(n(74),Object(r.createContext)({slots:{},fills:{},registerSlot:function(){void 0!==e&&e.env},updateSlot:function(){},unregisterSlot:function(){},registerFill:function(){},unregisterFill:function(){}}));t.a=o}).call(this,n(102))},function(e,t,n){"use strict";n.d(t,"b",(function(){return F})),n.d(t,"a",(function(){return L}));var r,o=n(5),a=n.n(o),c=n(0),i=n(1),s=n(99),u=n(45),l=n.n(u),f=n(49);!function(e){e.SET_IDLE="set_idle",e.SET_PRISTINE="set_pristine",e.SET_REDIRECT_URL="set_redirect_url",e.SET_COMPLETE="set_checkout_complete",e.SET_BEFORE_PROCESSING="set_before_processing",e.SET_AFTER_PROCESSING="set_after_processing",e.SET_PROCESSING_RESPONSE="set_processing_response",e.SET_PROCESSING="set_checkout_is_processing",e.SET_HAS_ERROR="set_checkout_has_error",e.SET_NO_ERROR="set_checkout_no_error",e.SET_CUSTOMER_ID="set_checkout_customer_id",e.SET_ORDER_ID="set_checkout_order_id",e.SET_ORDER_NOTES="set_checkout_order_notes",e.INCREMENT_CALCULATING="increment_calculating",e.DECREMENT_CALCULATING="decrement_calculating",e.SET_SHOULD_CREATE_ACCOUNT="set_should_create_account",e.SET_EXTENSION_DATA="set_extension_data"}(r||(r={}));var d,p,b=function(){return{type:r.SET_IDLE}},m=function(e){return{type:r.SET_REDIRECT_URL,redirectUrl:e}},h=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{type:r.SET_COMPLETE,data:e}},g=function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return{type:e?r.SET_HAS_ERROR:r.SET_NO_ERROR}},v=n(4),y=n.n(v),O=n(2);function j(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}!function(e){e.PRISTINE="pristine",e.IDLE="idle",e.PROCESSING="processing",e.COMPLETE="complete",e.BEFORE_PROCESSING="before_processing",e.AFTER_PROCESSING="after_processing"}(p||(p={}));var E=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?j(Object(n),!0).forEach((function(t){y()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):j(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({order_id:0,customer_id:0},(null===(d=Object(O.getSetting)("preloadedApiRequests",{})["/wc/store/checkout"])||void 0===d?void 0:d.body)||{}),w={redirectUrl:"",status:p.PRISTINE,hasError:!1,calculatingCount:0,orderId:E.order_id,orderNotes:"",customerId:E.customer_id,shouldCreateAccount:!1,processingResponse:null,extensionData:{}};function _(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function S(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?_(Object(n),!0).forEach((function(t){y()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):_(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var k=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:w,t=arguments.length>1?arguments[1]:void 0,n=t.redirectUrl,o=t.type,a=t.customerId,c=t.orderId,i=t.orderNotes,s=t.extensionData,u=t.shouldCreateAccount,l=t.data,f=e;switch(o){case r.SET_PRISTINE:f=w;break;case r.SET_IDLE:f=e.status!==p.IDLE?S(S({},e),{},{status:p.IDLE}):e;break;case r.SET_REDIRECT_URL:f=void 0!==n&&n!==e.redirectUrl?S(S({},e),{},{redirectUrl:n}):e;break;case r.SET_PROCESSING_RESPONSE:f=S(S({},e),{},{processingResponse:l});break;case r.SET_COMPLETE:f=e.status!==p.COMPLETE?S(S({},e),{},{status:p.COMPLETE,redirectUrl:void 0!==l&&"string"==typeof l.redirectUrl&&l.redirectUrl?l.redirectUrl:e.redirectUrl}):e;break;case r.SET_PROCESSING:f=!1===(f=e.status!==p.PROCESSING?S(S({},e),{},{status:p.PROCESSING,hasError:!1}):e).hasError?f:S(S({},f),{},{hasError:!1});break;case r.SET_BEFORE_PROCESSING:f=e.status!==p.BEFORE_PROCESSING?S(S({},e),{},{status:p.BEFORE_PROCESSING,hasError:!1}):e;break;case r.SET_AFTER_PROCESSING:f=e.status!==p.AFTER_PROCESSING?S(S({},e),{},{status:p.AFTER_PROCESSING}):e;break;case r.SET_HAS_ERROR:f=e.hasError?e:S(S({},e),{},{hasError:!0}),f=e.status===p.PROCESSING||e.status===p.BEFORE_PROCESSING?S(S({},f),{},{status:p.IDLE}):f;break;case r.SET_NO_ERROR:f=e.hasError?S(S({},e),{},{hasError:!1}):e;break;case r.INCREMENT_CALCULATING:f=S(S({},e),{},{calculatingCount:e.calculatingCount+1});break;case r.DECREMENT_CALCULATING:f=S(S({},e),{},{calculatingCount:Math.max(0,e.calculatingCount-1)});break;case r.SET_CUSTOMER_ID:f=void 0!==a?S(S({},e),{},{customerId:a}):e;break;case r.SET_ORDER_ID:f=void 0!==c?S(S({},e),{},{orderId:c}):e;break;case r.SET_SHOULD_CREATE_ACCOUNT:void 0!==u&&u!==e.shouldCreateAccount&&(f=S(S({},e),{},{shouldCreateAccount:u}));break;case r.SET_ORDER_NOTES:void 0!==i&&e.orderNotes!==i&&(f=S(S({},e),{},{orderNotes:i}));break;case r.SET_EXTENSION_DATA:void 0!==s&&e.extensionData!==s&&(f=S(S({},e),{},{extensionData:s}))}return f!==e&&o!==r.SET_PRISTINE&&f.status===p.PRISTINE&&(f.status=p.IDLE),f},R=n(28),P=n(98),x=n(191),C=n(193),A=n(127),N=n(54),T=n(52),M=n(11),D=n(35),I=Object(c.createContext)({dispatchActions:{resetCheckout:function(){},setRedirectUrl:function(e){},setHasError:function(e){},setAfterProcessing:function(e){},incrementCalculating:function(){},decrementCalculating:function(){},setCustomerId:function(e){},setOrderId:function(e){},setOrderNotes:function(e){},setExtensionData:function(e){}},onSubmit:function(){},isComplete:!1,isIdle:!1,isCalculating:!1,isProcessing:!1,isBeforeProcessing:!1,isAfterProcessing:!1,hasError:!1,redirectUrl:"",orderId:0,orderNotes:"",customerId:0,onCheckoutAfterProcessingWithSuccess:function(){return function(){}},onCheckoutAfterProcessingWithError:function(){return function(){}},onCheckoutBeforeProcessing:function(){return function(){}},onCheckoutValidationBeforeProcessing:function(){return function(){}},hasOrder:!1,isCart:!1,shouldCreateAccount:!1,setShouldCreateAccount:function(e){},extensionData:{}}),F=function(){return Object(c.useContext)(I)},L=function(e){var t=e.children,n=e.redirectUrl,o=e.isCart,u=void 0!==o&&o;w.redirectUrl=n;var d,v=Object(c.useReducer)(k,w),y=a()(v,2),O=y[0],j=y[1],E=Object(A.b)().setValidationErrors,_=Object(N.a)(),S=_.addErrorNotice,F=_.removeNotices,L=Object(T.a)().dispatchCheckoutEvent,V=O.calculatingCount>0,U=Object(D.c)(),B=U.isSuccessResponse,H=U.isErrorResponse,q=U.isFailResponse,z=U.shouldRetry,W=(d=Object(D.c)().noticeContexts,{checkoutNotices:Object(M.useSelect)((function(e){return e("core/notices").getNotices("wc/checkout")}),[]),expressPaymentNotices:Object(M.useSelect)((function(e){return e("core/notices").getNotices(d.EXPRESS_PAYMENTS)}),[d.EXPRESS_PAYMENTS]),paymentNotices:Object(M.useSelect)((function(e){return e("core/notices").getNotices(d.PAYMENTS)}),[d.PAYMENTS])}),G=W.checkoutNotices,Y=W.paymentNotices,$=W.expressPaymentNotices,K=Object(c.useReducer)(P.b,{}),X=a()(K,2),Q=X[0],Z=X[1],J=Object(c.useRef)(Q),ee=function(e){return Object(c.useMemo)((function(){return{onCheckoutAfterProcessingWithSuccess:Object(x.a)("checkout_after_processing_with_success",e),onCheckoutAfterProcessingWithError:Object(x.a)("checkout_after_processing_with_error",e),onCheckoutValidationBeforeProcessing:Object(x.a)("checkout_validation_before_processing",e)}}),[e])}(Z),te=ee.onCheckoutAfterProcessingWithSuccess,ne=ee.onCheckoutAfterProcessingWithError,re=ee.onCheckoutValidationBeforeProcessing;Object(c.useEffect)((function(){J.current=Q}),[Q]);var oe=Object(c.useMemo)((function(){return function(){return l()("onCheckoutBeforeProcessing",{alternative:"onCheckoutValidationBeforeProcessing",plugin:"WooCommerce Blocks"}),re.apply(void 0,arguments)}}),[re]),ae=Object(c.useMemo)((function(){return{resetCheckout:function(){j({type:r.SET_PRISTINE})},setRedirectUrl:function(e){j(m(e))},setHasError:function(e){j(g(e))},incrementCalculating:function(){j({type:r.INCREMENT_CALCULATING})},decrementCalculating:function(){j({type:r.DECREMENT_CALCULATING})},setCustomerId:function(e){var t;j((t=e,{type:r.SET_CUSTOMER_ID,customerId:t}))},setOrderId:function(e){j(function(e){return{type:r.SET_ORDER_ID,orderId:e}}(e))},setOrderNotes:function(e){j(function(e){return{type:r.SET_ORDER_NOTES,orderNotes:e}}(e))},setExtensionData:function(e){j(function(e){return{type:r.SET_EXTENSION_DATA,extensionData:e}}(e))},setAfterProcessing:function(e){var t,n=function(e){var t={message:"",paymentStatus:"",redirectUrl:"",paymentDetails:{}};return"payment_result"in e&&(t.paymentStatus=e.payment_result.payment_status,t.redirectUrl=e.payment_result.redirect_url,e.payment_result.hasOwnProperty("payment_details")&&Array.isArray(e.payment_result.payment_details)&&e.payment_result.payment_details.forEach((function(e){var n=e.key,r=e.value;t.paymentDetails[n]=Object(R.decodeEntities)(r)}))),"message"in e&&(t.message=Object(R.decodeEntities)(e.message)),!t.message&&"data"in e&&"status"in e.data&&e.data.status>299&&(t.message=Object(i.__)("Something went wrong. Please contact us to get assistance.",'woocommerce')),t}(e);n.redirectUrl&&j(m(n.redirectUrl)),j((t=n,{type:r.SET_PROCESSING_RESPONSE,data:t})),j({type:r.SET_AFTER_PROCESSING})}}}),[]);Object(c.useEffect)((function(){O.status===p.BEFORE_PROCESSING&&(F("error"),Object(C.a)(J.current,"checkout_validation_before_processing",{}).then((function(e){!0!==e?(Array.isArray(e)&&e.forEach((function(e){var t=e.errorMessage,n=e.validationErrors;S(t),E(n)})),j(b()),j(g())):j({type:r.SET_PROCESSING})})))}),[O.status,E,S,F,j]);var ce=Object(s.a)(O.status),ie=Object(s.a)(O.hasError);Object(c.useEffect)((function(){if((O.status!==ce||O.hasError!==ie)&&O.status===p.AFTER_PROCESSING){var e={redirectUrl:O.redirectUrl,orderId:O.orderId,customerId:O.customerId,orderNotes:O.orderNotes,processingResponse:O.processingResponse};O.hasError?Object(C.b)(J.current,"checkout_after_processing_with_error",e).then((function(t){var n=function(e){var t=null;return e.forEach((function(e){if((H(e)||q(e))&&e.message){var n=e.messageContext?{context:e.messageContext}:void 0;t=e,S(e.message,n)}})),t}(t);if(null!==n)z(n)?j(b()):j(h(n));else{if(!(G.some((function(e){return"error"===e.status}))||$.some((function(e){return"error"===e.status}))||Y.some((function(e){return"error"===e.status})))){var r,o=(null===(r=e.processingResponse)||void 0===r?void 0:r.message)||Object(i.__)("Something went wrong. Please contact us to get assistance.",'woocommerce');S(o,{id:"checkout"})}j(b())}})):Object(C.b)(J.current,"checkout_after_processing_with_success",e).then((function(e){var t=null,n=null;if(e.forEach((function(e){B(e)&&(t=e),(H(e)||q(e))&&(n=e)})),t&&!n)j(h(t));else if(Object(f.b)(n)){if(n.message){var r=n.messageContext?{context:n.messageContext}:void 0;S(n.message,r)}z(n)?j(g(!0)):j(h(n))}else j(h())}))}}),[O.status,O.hasError,O.redirectUrl,O.orderId,O.customerId,O.orderNotes,O.processingResponse,ce,ie,ae,S,H,q,B,z,G,$,Y]);var se={onSubmit:Object(c.useCallback)((function(){L("submit"),j({type:r.SET_BEFORE_PROCESSING})}),[L]),isComplete:O.status===p.COMPLETE,isIdle:O.status===p.IDLE,isCalculating:V,isProcessing:O.status===p.PROCESSING,isBeforeProcessing:O.status===p.BEFORE_PROCESSING,isAfterProcessing:O.status===p.AFTER_PROCESSING,hasError:O.hasError,redirectUrl:O.redirectUrl,onCheckoutBeforeProcessing:oe,onCheckoutValidationBeforeProcessing:re,onCheckoutAfterProcessingWithSuccess:te,onCheckoutAfterProcessingWithError:ne,dispatchActions:ae,isCart:u,orderId:O.orderId,hasOrder:!!O.orderId,customerId:O.customerId,orderNotes:O.orderNotes,shouldCreateAccount:O.shouldCreateAccount,setShouldCreateAccount:function(e){return j((t=e,{type:r.SET_SHOULD_CREATE_ACCOUNT,shouldCreateAccount:t}));var t},extensionData:O.extensionData};return React.createElement(I.Provider,{value:se},t)}},function(e,t,n){"use strict";n.d(t,"a",(function(){return r})),n.d(t,"c",(function(){return o})),n.d(t,"b",(function(){return a})),n.d(t,"d",(function(){return c}));var r=function(e){return"number"==typeof e},o=function(e){return"string"==typeof e},a=function(e){return!function(e){return null===e}(e)&&e instanceof Object&&e.constructor===Object};function c(e,t){return a(e)&&t in e}},function(e,t){e.exports=window.wp.keycodes},function(e,t,n){"use strict";var r=n(4),o=n.n(r),a=n(0),c=n(6),i=n.n(c);function s(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function u(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?s(Object(n),!0).forEach((function(t){o()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):s(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}t.a=function(e){var t,n=e.label,r=e.screenReaderLabel,o=e.wrapperElement,c=e.wrapperProps,s=void 0===c?{}:c,l=null!=n,f=null!=r;return!l&&f?(t=o||"span",s=u(u({},s),{},{className:i()(s.className,"screen-reader-text")}),React.createElement(t,s,r)):(t=o||a.Fragment,l&&f&&n!==r?React.createElement(t,s,React.createElement("span",{"aria-hidden":"true"},n),React.createElement("span",{className:"screen-reader-text"},r)):React.createElement(t,s,n))}},function(e,t,n){"use strict";n.d(t,"a",(function(){return l}));var r=n(4),o=n.n(r),a=n(75),c=n(0),i=n(32);function s(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function u(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?s(Object(n),!0).forEach((function(t){o()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):s(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var l=function(){var e=Object(i.a)(),t=Object(c.useRef)(e);return Object(c.useEffect)((function(){t.current=e}),[e]),{dispatchStoreEvent:Object(c.useCallback)((function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};try{Object(a.doAction)("experimental__woocommerce_blocks-".concat(e),t)}catch(e){console.error(e)}}),[]),dispatchCheckoutEvent:Object(c.useCallback)((function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};try{Object(a.doAction)("experimental__woocommerce_blocks-checkout-".concat(e),u(u({},n),{},{storeCart:t.current}))}catch(e){console.error(e)}}),[])}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return c}));var r=n(0),o=n(25),a=n.n(o);function c(e){var t=Object(r.useRef)(e);return a()(e,t.current)||(t.current=e),t.current}},function(e,t,n){"use strict";n.d(t,"a",(function(){return u}));var r=n(4),o=n.n(r),a=n(0),c=n(103);function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function s(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?i(Object(n),!0).forEach((function(t){o()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):i(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var u=function(){var e=Object(c.b)(),t=e.notices,n=e.createNotice,r=e.removeNotice,o=e.setIsSuppressed,i=Object(a.useRef)(t);Object(a.useEffect)((function(){i.current=t}),[t]);var u=Object(a.useMemo)((function(){return{hasNoticesOfType:function(e){return i.current.some((function(t){return t.type===e}))},removeNotices:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;i.current.forEach((function(t){null!==e&&t.status!==e||r(t.id)}))},removeNotice:r}}),[r]),l=Object(a.useMemo)((function(){return{addDefaultNotice:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};n("default",e,s({},t))},addErrorNotice:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};n("error",e,s({},t))},addWarningNotice:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};n("warning",e,s({},t))},addInfoNotice:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};n("info",e,s({},t))},addSuccessNotice:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};n("success",e,s({},t))}}}),[n]);return s(s(s({notices:t},u),l),{},{setIsSuppressed:o})}},,,,function(e,t){e.exports=window.wc.priceFormat},function(e,t,n){"use strict";function r(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";n.d(t,"b",(function(){return w})),n.d(t,"a",(function(){return _}));var r=n(5),o=n.n(r),a=n(0),c=n(2),i=n(4),s=n.n(i),u=n(11),l=n(8),f=n(115),d=n(25),p=n.n(d),b=n(93),m=n(132),h=n(32),g=n(54);function v(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function y(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?v(Object(n),!0).forEach((function(t){s()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):v(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var O=function(e,t){return!(!function(e){return"email"in e}(t)||Object(b.c)(t)===Object(b.c)(e))||!!t.country&&!p()(Object(b.b)(e),Object(b.b)(t))},j=n(48),E=Object(a.createContext)({billingData:{first_name:"",last_name:"",company:"",address_1:"",address_2:"",city:"",state:"",postcode:"",country:"",email:"",phone:""},shippingAddress:{first_name:"",last_name:"",company:"",address_1:"",address_2:"",city:"",state:"",postcode:"",country:"",phone:""},setBillingData:function(){return null},setShippingAddress:function(){return null},shippingAsBilling:!0,setShippingAsBilling:function(){return null}}),w=function(){return Object(a.useContext)(E)},_=function(e){var t=e.children,n=function(){var e=Object(u.useDispatch)(l.CART_STORE_KEY).updateCustomerData,t=Object(g.a)(),n=t.addErrorNotice,r=t.removeNotice,c=Object(h.a)(),i=c.billingAddress,s=c.shippingAddress,d=Object(a.useState)({billingData:i,shippingAddress:s}),b=o()(d,2),v=b[0],j=b[1],E=Object(a.useRef)(v),w=Object(f.a)(v,1e3,{equalityFn:function(e,t){return p()(e.billingData,t.billingData)&&p()(e.shippingAddress,t.shippingAddress)}}),_=o()(w,1)[0],S=Object(a.useCallback)((function(e){j((function(t){return y(y({},t),{},{billingData:y(y({},t.billingData),e)})}))}),[]),k=Object(a.useCallback)((function(e){j((function(t){return y(y({},t),{},{shippingAddress:y(y({},t.shippingAddress),e)})}))}),[]);return Object(a.useEffect)((function(){(O(E.current.billingData,_.billingData)||O(E.current.shippingAddress,_.shippingAddress))&&(E.current=_,e({billing_address:_.billingData,shipping_address:_.shippingAddress}).then((function(){r("checkout")})).catch((function(e){n(Object(m.b)(e),{id:"checkout"})})))}),[_,n,r,e]),{billingData:v.billingData,shippingAddress:v.shippingAddress,setBillingData:S,setShippingAddress:k}}(),r=n.billingData,i=n.shippingAddress,s=n.setBillingData,d=n.setShippingAddress,b=Object(h.a)().cartNeedsShipping,v=Object(j.b)().customerId,w=Object(a.useState)((function(){return b&&(!v||(e=i,t=r,Object.keys(c.defaultAddressFields).every((function(n){return e[n]===t[n]}))));var e,t})),_=o()(w,2),S=_[0],k=_[1],R={billingData:r,shippingAddress:i,setBillingData:s,setShippingAddress:d,shippingAsBilling:S,setShippingAsBilling:k};return React.createElement(E.Provider,{value:R},t)}},function(e,t){e.exports=window.wp.apiFetch},,function(e,t,n){"use strict";n.d(t,"b",(function(){return i})),n.d(t,"a",(function(){return s}));var r=n(7),o=n(221),a=n.n(o),c=n(217);function i(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=a()(e).toRgb(),r=n.r,o=n.g,c=n.b;return"rgba(".concat(r,", ").concat(o,", ").concat(c,", ").concat(t,")")}function s(e){return Object(r.get)(c.a,e,"#000")}},,function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(59);function o(e,t){if(e){if("string"==typeof e)return Object(r.a)(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Object(r.a)(e,t):void 0}}},function(e,t,n){"use strict";n.d(t,"b",(function(){return x})),n.d(t,"a",(function(){return C}));var r=n(4),o=n.n(r),a=n(5),c=n.n(a),i=n(0),s=n(25),u=n.n(s),l=n(92),f=function(e){return Object(l.a)(e.map((function(e){var t;return[e.package_id,null===(t=e.shipping_rates.find((function(e){return e.selected})))||void 0===t?void 0:t.rate_id]})))},d={NONE:"none",INVALID_ADDRESS:"invalid_address",UNKNOWN:"unknown_error"},p={INVALID_COUNTRY:"woocommerce_rest_cart_shipping_rates_invalid_country",MISSING_COUNTRY:"woocommerce_rest_cart_shipping_rates_missing_country",INVALID_STATE:"woocommerce_rest_cart_shipping_rates_invalid_state"},b={shippingErrorStatus:{isPristine:!0,isValid:!1,hasInvalidAddress:!1,hasError:!1},dispatchErrorStatus:function(){return null},shippingErrorTypes:d,shippingRates:[],shippingRatesLoading:!1,selectedRates:[],setSelectedRates:function(){return null},shippingAddress:{first_name:"",last_name:"",company:"",address_1:"",address_2:"",city:"",state:"",postcode:"",country:""},setShippingAddress:function(){return null},onShippingRateSuccess:function(){return null},onShippingRateFail:function(){return null},onShippingRateSelectSuccess:function(){return null},onShippingRateSelectFail:function(){return null},needsShipping:!1},m=function(e,t){var n=t.type;return Object.values(d).includes(n)?n:e},h=n(98),g=n(191),v=function(e){return{onSuccess:Object(g.a)("shipping_rates_success",e),onFail:Object(g.a)("shipping_rates_fail",e),onSelectSuccess:Object(g.a)("shipping_rate_select_success",e),onSelectFail:Object(g.a)("shipping_rate_select_fail",e)}},y=n(193),O=n(48),j=n(60),E=n(32),w=n(118);function _(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}var S=d.NONE,k=d.INVALID_ADDRESS,R=d.UNKNOWN,P=Object(i.createContext)(b),x=function(){return Object(i.useContext)(P)},C=function(e){var t=e.children,n=Object(O.b)().dispatchActions,r=Object(j.b)(),a=r.shippingAddress,s=r.setShippingAddress,l=Object(E.a)(),b=l.cartNeedsShipping,g=l.cartHasCalculatedShipping,x=l.shippingRates,C=l.shippingRatesLoading,A=l.cartErrors,N=Object(w.a)(),T=N.selectShippingRate,M=N.isSelectingRate,D=Object(i.useReducer)(m,S),I=c()(D,2),F=I[0],L=I[1],V=Object(i.useReducer)(h.b,{}),U=c()(V,2),B=U[0],H=U[1],q=Object(i.useRef)(B),z=Object(i.useMemo)((function(){return{onShippingRateSuccess:v(H).onSuccess,onShippingRateFail:v(H).onFail,onShippingRateSelectSuccess:v(H).onSelectSuccess,onShippingRateSelectFail:v(H).onSelectFail}}),[H]);Object(i.useEffect)((function(){q.current=B}),[B]);var W=Object(i.useRef)((function(){return f(x)}));Object(i.useEffect)((function(){var e=f(x);u()(W.current,e)||(W.current=e)}),[x]),Object(i.useEffect)((function(){C?n.incrementCalculating():n.decrementCalculating()}),[C,n]),Object(i.useEffect)((function(){M?n.incrementCalculating():n.decrementCalculating()}),[M,n]),Object(i.useEffect)((function(){A.length>0&&A.some((function(e){return!(!e.code||!Object.values(p).includes(e.code))}))?L({type:k}):L({type:S})}),[A]);var G=Object(i.useMemo)((function(){return{isPristine:F===S,isValid:F===S,hasInvalidAddress:F===k,hasError:F===R||F===k}}),[F]);Object(i.useEffect)((function(){C||0!==x.length&&!G.hasError||Object(y.a)(q.current,"shipping_rates_fail",{hasInvalidAddress:G.hasInvalidAddress,hasError:G.hasError})}),[x,C,G.hasError,G.hasInvalidAddress]),Object(i.useEffect)((function(){!C&&x.length>0&&!G.hasError&&Object(y.a)(q.current,"shipping_rates_success",x)}),[x,C,G.hasError]),Object(i.useEffect)((function(){M||(G.hasError?Object(y.a)(q.current,"shipping_rate_select_fail",{hasError:G.hasError,hasInvalidAddress:G.hasInvalidAddress}):Object(y.a)(q.current,"shipping_rate_select_success",W.current))}),[M,G.hasError,G.hasInvalidAddress]);var Y=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?_(Object(n),!0).forEach((function(t){o()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):_(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({shippingErrorStatus:G,dispatchErrorStatus:L,shippingErrorTypes:d,shippingRates:x,shippingRatesLoading:C,selectedRates:W.current,setSelectedRates:T,isSelectingRate:M,shippingAddress:a,setShippingAddress:s,needsShipping:b,hasCalculatedShipping:g},z);return React.createElement(React.Fragment,null,React.createElement(P.Provider,{value:Y},t))}},function(e,t,n){var r=n(68);e.exports=function(e,t){if(e){if("string"==typeof e)return r(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(e,t):void 0}},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,n){"use strict";var r=n(14),o=n.n(r),a=n(4),c=n.n(a),i=n(23),s=n.n(i),u=n(126),l=n(6),f=n.n(l),d=(n(147),["className","value","currency","onValueChange","displayType"]);function p(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function b(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?p(Object(n),!0).forEach((function(t){c()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):p(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}t.a=function(e){var t=e.className,n=e.value,r=e.currency,a=e.onValueChange,c=e.displayType,i=void 0===c?"text":c,l=s()(e,d),p="string"==typeof n?parseInt(n,10):n;if(!Number.isFinite(p))return null;var m=p/Math.pow(10,r.minorUnit);if(!Number.isFinite(m))return null;var h=f()("wc-block-formatted-money-amount","wc-block-components-formatted-money-amount",t),g=b(b(b({},l),function(e){return{thousandSeparator:e.thousandSeparator,decimalSeparator:e.decimalSeparator,decimalScale:e.minorUnit,fixedDecimalScale:!0,prefix:e.prefix,suffix:e.suffix,isNumericString:!0}}(r)),{},{value:void 0,currency:void 0,onValueChange:void 0}),v=a?function(e){var t=e.value*Math.pow(10,r.minorUnit);a(t)}:function(){};return React.createElement(u.a,o()({className:h,displayType:i},g,{value:m,onValueChange:v}))}},,function(e,t){function n(t,r){return e.exports=n=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},e.exports.default=e.exports,e.exports.__esModule=!0,n(t,r)}e.exports=n,e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=window.wp.url},,function(e,t){e.exports=window.wp.warning},function(e,t){e.exports=window.wp.hooks},function(e,t,n){"use strict";var r=n(12),o=n(19),a=n(0),c=n(6),i=n.n(c),s=n(7),u=n(45),l=n.n(u),f=n(15),d=n(16),p=n(17),b=n(18),m=n(9),h=n(22),g=n(37),v=n(50),y=n(24),O=n(116),j=n(20);function E(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function w(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?E(Object(n),!0).forEach((function(t){Object(j.a)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):E(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function _(e,t,n,r,o,a,c){var i=t.width,s="rtl"===document.documentElement.dir;"left"===n&&s?n="right":"right"===n&&s&&(n="left"),"left"===r&&s?r="right":"right"===r&&s&&(r="left");var u=Math.round(e.left+e.width/2),l={popoverLeft:u,contentWidth:(u-i/2>0?i/2:u)+(u+i/2>window.innerWidth?window.innerWidth-u:i/2)},f=e.left;"right"===r?f=e.right:"middle"!==a&&(f=u);var d=e.right;"left"===r?d=e.left:"middle"!==a&&(d=u);var p,b={popoverLeft:f,contentWidth:f-i>0?i:f},m={popoverLeft:d,contentWidth:d+i>window.innerWidth?window.innerWidth-d:i},h=n,g=null;if(!o)if("center"===n&&l.contentWidth===i)h="center";else if("left"===n&&b.contentWidth===i)h="left";else if("right"===n&&m.contentWidth===i)h="right";else{var v="left"==(h=b.contentWidth>m.contentWidth?"left":"right")?b.contentWidth:m.contentWidth;g=v!==i?v:null}if(p="center"===h?l.popoverLeft:"left"===h?b.popoverLeft:m.popoverLeft,c){var y=c.getBoundingClientRect();p=Math.min(p,y.right-i)}return{xAxis:h,popoverLeft:p,contentWidth:g}}function S(e,t,n,r,o,a,c){var i=t.height;if(o){var s=(Object(g.getScrollContainer)(a)||document.body).getBoundingClientRect().top+i-c;if(e.top<=s)return{yAxis:n,popoverTop:Math.min(e.bottom,s)}}var u=e.top+e.height/2;"bottom"===r?u=e.bottom:"top"===r&&(u=e.top);var l={popoverTop:u,contentHeight:(u-i/2>0?i/2:u)+(u+i/2>window.innerHeight?window.innerHeight-u:i/2)},f={popoverTop:e.top,contentHeight:e.top-10-i>0?i:e.top-10},d={popoverTop:e.bottom,contentHeight:e.bottom+10+i>window.innerHeight?window.innerHeight-10-e.bottom:i},p=n,b=null;if(!o)if("middle"===n&&l.contentHeight===i)p="middle";else if("top"===n&&f.contentHeight===i)p="top";else if("bottom"===n&&d.contentHeight===i)p="bottom";else{var m="top"==(p=f.contentHeight>d.contentHeight?"top":"bottom")?f.contentHeight:d.contentHeight;b=m!==i?m:null}return{yAxis:p,popoverTop:"middle"===p?l.popoverTop:"top"===p?f.popoverTop:d.popoverTop,contentHeight:b}}var k=n(31),R=n(13);var P=Object(a.createContext)({focusHistory:[]}),x=P.Provider,C=P.Consumer;x.displayName="FocusReturnProvider",C.displayName="FocusReturnConsumer",a.Component;var A=Object(y.createHigherOrderComponent)((function e(t){if((r=t)instanceof a.Component||"function"==typeof r){var n=t;return e({})(n)}var r,o=t.onFocusReturn,c=void 0===o?s.stubTrue:o;return function(e){var t=function(t){Object(p.a)(i,t);var n,r,o=(n=i,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=Object(m.a)(n);if(r){var o=Object(m.a)(this).constructor;e=Reflect.construct(t,arguments,o)}else e=t.apply(this,arguments);return Object(b.a)(this,e)});function i(){var e;return Object(f.a)(this,i),(e=o.apply(this,arguments)).ownFocusedElements=new Set,e.activeElementOnMount=document.activeElement,e.setIsFocusedFalse=function(){return e.isFocused=!1},e.setIsFocusedTrue=function(t){e.ownFocusedElements.add(t.target),e.isFocused=!0},e}return Object(d.a)(i,[{key:"componentWillUnmount",value:function(){var e=this.activeElementOnMount,t=this.isFocused,n=this.ownFocusedElements;if(t&&!1!==c())for(var r,o=[].concat(Object(k.a)(s.without.apply(void 0,[this.props.focus.focusHistory].concat(Object(k.a)(n)))),[e]);r=o.pop();)if(document.body.contains(r))return void r.focus()}},{key:"render",value:function(){return Object(a.createElement)("div",{onFocus:this.setIsFocusedTrue,onBlur:this.setIsFocusedFalse},Object(a.createElement)(e,this.props.childProps))}}]),i}(a.Component);return function(e){return Object(a.createElement)(C,null,(function(n){return Object(a.createElement)(t,{childProps:e,focus:n})}))}}}),"withFocusReturn");var N=Object(y.createHigherOrderComponent)((function(e){return function(t){Object(p.a)(c,t);var n,r,o=(n=c,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=Object(m.a)(n);if(r){var o=Object(m.a)(this).constructor;e=Reflect.construct(t,arguments,o)}else e=t.apply(this,arguments);return Object(b.a)(this,e)});function c(){var e;return Object(f.a)(this,c),(e=o.apply(this,arguments)).focusContainRef=Object(a.createRef)(),e.handleTabBehaviour=e.handleTabBehaviour.bind(Object(R.a)(e)),e}return Object(d.a)(c,[{key:"handleTabBehaviour",value:function(e){if(e.keyCode===v.TAB){var t=g.focus.tabbable.find(this.focusContainRef.current);if(t.length){var n=t[0],r=t[t.length-1];e.shiftKey&&e.target===n?(e.preventDefault(),r.focus()):(e.shiftKey||e.target!==r)&&t.includes(e.target)||(e.preventDefault(),n.focus())}}}},{key:"render",value:function(){return Object(a.createElement)("div",{onKeyDown:this.handleTabBehaviour,ref:this.focusContainRef,tabIndex:"-1"},Object(a.createElement)(e,this.props))}}]),c}(a.Component)}),"withConstrainedTabbing"),T=n(89);var M=function(e){Object(p.a)(o,e);var t,n,r=(t=o,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=Object(m.a)(t);if(n){var o=Object(m.a)(this).constructor;e=Reflect.construct(r,arguments,o)}else e=r.apply(this,arguments);return Object(b.a)(this,e)});function o(){return Object(f.a)(this,o),r.apply(this,arguments)}return Object(d.a)(o,[{key:"handleFocusOutside",value:function(e){this.props.onFocusOutside(e)}},{key:"render",value:function(){return this.props.children}}]),o}(a.Component),D=Object(T.a)(M);function I(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Object(m.a)(e);if(t){var o=Object(m.a)(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Object(b.a)(this,n)}}var F=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.htmlDocument,n=void 0===t?document:t,r=e.className,o=void 0===r?"lockscroll":r,c=0,i=0;function s(e){var t=n.scrollingElement||n.body;e&&(i=t.scrollTop);var r=e?"add":"remove";t.classList[r](o),n.documentElement.classList[r](o),e||(t.scrollTop=i)}function u(){0===c&&s(!0),++c}function l(){1===c&&s(!1),--c}return function(e){Object(p.a)(n,e);var t=I(n);function n(){return Object(f.a)(this,n),t.apply(this,arguments)}return Object(d.a)(n,[{key:"componentDidMount",value:function(){u()}},{key:"componentWillUnmount",value:function(){l()}},{key:"render",value:function(){return null}}]),n}(a.Component)}();function L(e){e.stopPropagation()}var V=Object(a.forwardRef)((function(e,t){var n=e.children,c=Object(o.a)(e,["children"]);return Object(a.createElement)("div",Object(r.a)({},c,{ref:t,onMouseDown:L}),n)})),U=n(47);function B(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function H(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?B(Object(n),!0).forEach((function(t){Object(j.a)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):B(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function q(e){var t=Object(a.useContext)(U.a),n=t.slots[e]||{},r=t.fills[e],o=Object(a.useMemo)((function(){return r||[]}),[r]),c=Object(a.useCallback)((function(n){t.updateSlot(e,n)}),[e,t.updateSlot]),i=Object(a.useCallback)((function(n){t.unregisterSlot(e,n)}),[e,t.unregisterSlot]),s=Object(a.useCallback)((function(n){t.registerFill(e,n)}),[e,t.registerFill]),u=Object(a.useCallback)((function(n){t.unregisterFill(e,n)}),[e,t.unregisterFill]);return H(H({},n),{},{updateSlot:c,unregisterSlot:i,fills:o,registerFill:s,unregisterFill:u})}function z(e,t,n){return(z="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var r=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=Object(m.a)(e)););return e}(e,t);if(r){var o=Object.getOwnPropertyDescriptor(r,t);return o.get?o.get.call(n):o.value}})(e,t,n||e)}n(25);var W=Object(a.createContext)({registerSlot:function(){},unregisterSlot:function(){},registerFill:function(){},unregisterFill:function(){},getSlot:function(){},getFills:function(){},subscribe:function(){}}),G=(W.Provider,W.Consumer);a.Component;var Y=function(e){Object(p.a)(o,e);var t,n,r=(t=o,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=Object(m.a)(t);if(n){var o=Object(m.a)(this).constructor;e=Reflect.construct(r,arguments,o)}else e=r.apply(this,arguments);return Object(b.a)(this,e)});function o(){var e;return Object(f.a)(this,o),(e=r.apply(this,arguments)).isUnmounted=!1,e.bindNode=e.bindNode.bind(Object(R.a)(e)),e}return Object(d.a)(o,[{key:"componentDidMount",value:function(){(0,this.props.registerSlot)(this.props.name,this)}},{key:"componentWillUnmount",value:function(){var e=this.props.unregisterSlot;this.isUnmounted=!0,e(this.props.name,this)}},{key:"componentDidUpdate",value:function(e){var t=this.props,n=t.name,r=t.unregisterSlot,o=t.registerSlot;e.name!==n&&(r(e.name),o(n,this))}},{key:"bindNode",value:function(e){this.node=e}},{key:"forceUpdate",value:function(){this.isUnmounted||z(Object(m.a)(o.prototype),"forceUpdate",this).call(this)}},{key:"render",value:function(){var e=this.props,t=e.children,n=e.name,r=e.fillProps,o=void 0===r?{}:r,c=e.getFills,i=Object(s.map)(c(n,this),(function(e){var t=e.occurrence,n=Object(s.isFunction)(e.children)?e.children(o):e.children;return a.Children.map(n,(function(e,n){if(!e||Object(s.isString)(e))return e;var r="".concat(t,"---").concat(e.key||n);return Object(a.cloneElement)(e,{key:r})}))})).filter(Object(s.negate)(a.isEmptyElement));return Object(a.createElement)(a.Fragment,null,Object(s.isFunction)(t)?t(i):i)}}]),o}(a.Component),$=function(e){return Object(a.createElement)(G,null,(function(t){var n=t.registerSlot,o=t.unregisterSlot,c=t.getFills;return Object(a.createElement)(Y,Object(r.a)({},e,{registerSlot:n,unregisterSlot:o,getFills:c}))}))},K=0;function X(e){var t=e.name,n=e.children,r=e.registerFill,o=e.unregisterFill,c=function(e){var t=Object(a.useContext)(W),n=t.getSlot,r=t.subscribe,o=Object(a.useState)(n(e)),c=Object(h.a)(o,2),i=c[0],s=c[1];return Object(a.useEffect)((function(){return s(n(e)),r((function(){s(n(e))}))}),[e]),i}(t),i=Object(a.useRef)({name:t,children:n});return i.current.occurrence||(i.current.occurrence=++K),Object(a.useLayoutEffect)((function(){return r(t,i.current),function(){return o(t,i.current)}}),[]),Object(a.useLayoutEffect)((function(){i.current.children=n,c&&c.forceUpdate()}),[n]),Object(a.useLayoutEffect)((function(){t!==i.current.name&&(o(i.current.name,i.current),i.current.name=t,r(t,i.current))}),[t]),c&&c.node?(Object(s.isFunction)(n)&&(n=n(c.props.fillProps)),Object(a.createPortal)(n,c.node)):null}var Q=function(e){return Object(a.createElement)(G,null,(function(t){var n=t.registerFill,o=t.unregisterFill;return Object(a.createElement)(X,Object(r.a)({},e,{registerFill:n,unregisterFill:o}))}))};function Z(e){var t=e.name,n=e.fillProps,c=void 0===n?{}:n,i=e.as,s=void 0===i?"div":i,u=Object(o.a)(e,["name","fillProps","as"]),l=Object(a.useContext)(U.a),f=Object(a.useRef)();return Object(a.useLayoutEffect)((function(){return l.registerSlot(t,f,c),function(){l.unregisterSlot(t,f)}}),[l.registerSlot,l.unregisterSlot,t]),Object(a.useLayoutEffect)((function(){l.updateSlot(t,c)})),Object(a.createElement)(s,Object(r.a)({ref:f},u))}function J(e){var t,n,r=e.name,o=e.children,c=q(r),i=Object(a.useRef)({rerender:(t=Object(a.useState)({}),n=Object(h.a)(t,2)[1],function(){return n({})})});return Object(a.useEffect)((function(){return c.registerFill(i),function(){c.unregisterFill(i)}}),[c.registerFill,c.unregisterFill]),c.ref&&c.ref.current?("function"==typeof o&&(o=o(c.fillProps)),Object(a.createPortal)(o,c.ref.current)):null}function ee(e){var t=e.bubblesVirtually,n=Object(o.a)(e,["bubblesVirtually"]);return t?Object(a.createElement)(Z,n):Object(a.createElement)($,n)}function te(e){return Object(a.createElement)(a.Fragment,null,Object(a.createElement)(Q,e),Object(a.createElement)(J,e))}function ne(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function re(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ne(Object(n),!0).forEach((function(t){Object(j.a)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ne(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function oe(e){var t=e.type,n=e.origin,r=void 0===n?function(e){return"appear"===e?"top":"left"}(t):n;if("appear"===t){var o,a=r.split(" "),c=Object(h.a)(a,2),s=c[0],u=c[1],l=void 0===u?"center":u;return i()("components-animate__appear",(o={},Object(j.a)(o,"is-from-"+l,"center"!==l),Object(j.a)(o,"is-from-"+s,"middle"!==s),o))}return"slide-in"===t?i()("components-animate__slide-in","is-from-"+r):"loading"===t?i()("components-animate__loading"):void 0}function ae(e){var t=e.type,n=e.options,r=void 0===n?{}:n;return(0,e.children)({className:oe(re({type:t},r))})}var ce=N(A((function(e){return e.children})));function ie(e,t){var n,r=(n=t).ownerDocument.defaultView.getComputedStyle(n),o=r.paddingTop,a=r.paddingBottom,c=r.paddingLeft,i=r.paddingRight,s=o?parseInt(o,10):0,u=a?parseInt(a,10):0,l=c?parseInt(c,10):0,f=i?parseInt(i,10):0;return{x:e.left+l,y:e.top+s,width:e.width-l-f,height:e.height-s-u,left:e.left+l,right:e.right-f,top:e.top+s,bottom:e.bottom-u}}function se(e,t,n){n?e.getAttribute(t)!==n&&e.setAttribute(t,n):e.hasAttribute(t)&&e.removeAttribute(t)}function ue(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";e.style[t]!==n&&(e.style[t]=n)}function le(e,t,n){n?e.classList.contains(t)||e.classList.add(t):e.classList.contains(t)&&e.classList.remove(t)}var fe=function(e){var t=e.headerTitle,n=e.onClose,c=e.onKeyDown,s=e.children,u=e.className,f=e.noArrow,d=void 0===f||f,p=e.isAlternate,b=e.position,m=void 0===b?"bottom right":b,j=(e.range,e.focusOnMount),E=void 0===j?"firstElement":j,k=e.anchorRef,R=e.shouldAnchorIncludePadding,P=e.anchorRect,x=e.getAnchorRect,C=e.expandOnMobile,A=e.animate,N=void 0===A||A,T=e.onClickOutside,M=e.onFocusOutside,I=e.__unstableSticky,L=e.__unstableSlotName,U=void 0===L?"Popover":L,B=e.__unstableObserveElement,H=e.__unstableBoundaryParent,z=Object(o.a)(e,["headerTitle","onClose","onKeyDown","children","className","noArrow","isAlternate","position","range","focusOnMount","anchorRef","shouldAnchorIncludePadding","anchorRect","getAnchorRect","expandOnMobile","animate","onClickOutside","onFocusOutside","__unstableSticky","__unstableSlotName","__unstableObserveElement","__unstableBoundaryParent"]),W=Object(a.useRef)(null),G=Object(a.useRef)(null),Y=Object(a.useRef)(),$=Object(y.useViewportMatch)("medium","<"),K=Object(a.useState)(),X=Object(h.a)(K,2),Q=X[0],Z=X[1],J=q(U),ee=C&&$,ne=Object(y.useResizeObserver)(),re=Object(h.a)(ne,2),oe=re[0],fe=re[1];d=ee||d,Object(a.useLayoutEffect)((function(){if(ee)return le(Y.current,"is-without-arrow",d),le(Y.current,"is-alternate",p),se(Y.current,"data-x-axis"),se(Y.current,"data-y-axis"),ue(Y.current,"top"),ue(Y.current,"left"),ue(G.current,"maxHeight"),void ue(G.current,"maxWidth");var e=function(){if(Y.current&&G.current){var e=function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],o=arguments.length>4?arguments[4]:void 0;if(t)return t;if(n){if(!e.current)return;return n(e.current)}if(!1!==r){if(!(r&&window.Range&&window.Element&&window.DOMRect))return;if(r instanceof window.Range)return Object(g.getRectangleFromRange)(r);if(r instanceof window.Element){var a=r.getBoundingClientRect();return o?a:ie(a,r)}var c=r.top,i=r.bottom,s=c.getBoundingClientRect(),u=i.getBoundingClientRect(),l=new window.DOMRect(s.left,s.top,s.width,u.bottom-s.top);return o?l:ie(l,r)}if(e.current){var f=e.current.parentNode,d=f.getBoundingClientRect();return o?d:ie(d,f)}}(W,P,x,k,R);if(e){var t,n,r=Y.current,o=r.offsetParent,a=r.ownerDocument,c=0;if(o&&o!==a.body){var i=o.getBoundingClientRect();c=i.top,e=new window.DOMRect(e.left-i.left,e.top-i.top,e.width,e.height)}H&&(t=null===(n=Y.current.closest(".popover-slot"))||void 0===n?void 0:n.parentNode);var s=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"top",r=arguments.length>3?arguments[3]:void 0,o=arguments.length>4?arguments[4]:void 0,a=arguments.length>5?arguments[5]:void 0,c=arguments.length>6?arguments[6]:void 0,i=n.split(" "),s=Object(h.a)(i,3),u=s[0],l=s[1],f=void 0===l?"center":l,d=s[2],p=S(e,t,u,d,r,o,a),b=_(e,t,f,d,r,p.yAxis,c);return w(w({},b),p)}(e,fe.height?fe:G.current.getBoundingClientRect(),m,I,Y.current,c,t),u=s.popoverTop,l=s.popoverLeft,f=s.xAxis,b=s.yAxis,v=s.contentHeight,y=s.contentWidth;"number"==typeof u&&"number"==typeof l&&(ue(Y.current,"top",u+"px"),ue(Y.current,"left",l+"px")),le(Y.current,"is-without-arrow",d||"center"===f&&"middle"===b),le(Y.current,"is-alternate",p),se(Y.current,"data-x-axis",f),se(Y.current,"data-y-axis",b),ue(G.current,"maxHeight","number"==typeof v?v+"px":""),ue(G.current,"maxWidth","number"==typeof y?y+"px":""),Z(({left:"right",right:"left"}[f]||"center")+" "+({top:"bottom",bottom:"top"}[b]||"middle"))}}};e();var t,n,r=window.setInterval(e,500),o=function(){window.cancelAnimationFrame(t),t=window.requestAnimationFrame(e)};return window.addEventListener("click",o),window.addEventListener("resize",e),window.addEventListener("scroll",e,!0),B&&(n=new window.MutationObserver(e)).observe(B,{attributes:!0}),function(){window.clearInterval(r),window.removeEventListener("resize",e),window.removeEventListener("scroll",e,!0),window.removeEventListener("click",o),window.cancelAnimationFrame(t),n&&n.disconnect()}}),[ee,P,x,k,R,m,fe,I,B,H]),function(e,t){Object(a.useEffect)((function(){var n=setTimeout((function(){if(e&&t.current)if("firstElement"!==e)"container"===e&&t.current.focus();else{var n=g.focus.tabbable.find(t.current)[0];n?n.focus():t.current.focus()}}),0);return function(){return clearTimeout(n)}}),[])}(E,G);var de=function(e){e.keyCode===v.ESCAPE&&n&&(e.stopPropagation(),n()),c&&c(e)},pe=Object(a.createElement)(D,{onFocusOutside:function(e){if(M)M(e);else if(T){var t;try{t=new window.MouseEvent("click")}catch(e){(t=document.createEvent("MouseEvent")).initMouseEvent("click",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null)}Object.defineProperty(t,"target",{get:function(){return e.relatedTarget}}),l()("Popover onClickOutside prop",{alternative:"onFocusOutside"}),T(t)}else n&&n()}},Object(a.createElement)(ae,{type:N&&Q?"appear":null,options:{origin:Q}},(function(e){var o=e.className;return Object(a.createElement)(V,Object(r.a)({className:i()("components-popover",u,o,{"is-expanded":ee,"is-without-arrow":d,"is-alternate":p})},z,{onKeyDown:de,ref:Y}),ee&&Object(a.createElement)(F,null),ee&&Object(a.createElement)("div",{className:"components-popover__header"},Object(a.createElement)("span",{className:"components-popover__header-title"},t),Object(a.createElement)(ve,{className:"components-popover__close",icon:O.a,onClick:n})),Object(a.createElement)("div",{ref:G,className:"components-popover__content",tabIndex:"-1"},Object(a.createElement)("div",{style:{position:"relative"}},oe,s)))})));return E&&(pe=Object(a.createElement)(ce,null,pe)),J.ref&&(pe=Object(a.createElement)(te,{name:U},pe)),k||P?pe:Object(a.createElement)("span",{ref:W},pe)};fe.Slot=function(e){var t=e.name,n=void 0===t?"Popover":t;return Object(a.createElement)(ee,{bubblesVirtually:!0,name:n,className:"popover-slot"})};var de=fe,pe=function(e){var t,n,r=e.shortcut,o=e.className;return r?(Object(s.isString)(r)&&(t=r),Object(s.isObject)(r)&&(t=r.display,n=r.ariaLabel),Object(a.createElement)("span",{className:o,"aria-label":n},t)):null};var be=function(e){Object(p.a)(o,e);var t,n,r=(t=o,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=Object(m.a)(t);if(n){var o=Object(m.a)(this).constructor;e=Reflect.construct(r,arguments,o)}else e=r.apply(this,arguments);return Object(b.a)(this,e)});function o(){var e;return Object(f.a)(this,o),(e=r.apply(this,arguments)).delayedSetIsOver=Object(s.debounce)((function(t){return e.setState({isOver:t})}),700),e.cancelIsMouseDown=e.createSetIsMouseDown(!1),e.isInMouseDown=!1,e.state={isOver:!1},e}return Object(d.a)(o,[{key:"componentWillUnmount",value:function(){this.delayedSetIsOver.cancel(),document.removeEventListener("mouseup",this.cancelIsMouseDown)}},{key:"emitToChild",value:function(e,t){var n=this.props.children;if(1===a.Children.count(n)){var r=a.Children.only(n);"function"==typeof r.props[e]&&r.props[e](t)}}},{key:"createToggleIsOver",value:function(e,t){var n=this;return function(r){if(n.emitToChild(e,r),!(r.currentTarget.disabled||"focus"===r.type&&n.isInMouseDown)){n.delayedSetIsOver.cancel();var o=Object(s.includes)(["focus","mouseenter"],r.type);o!==n.state.isOver&&(t?n.delayedSetIsOver(o):n.setState({isOver:o}))}}}},{key:"createSetIsMouseDown",value:function(e){var t=this;return function(n){t.emitToChild(e?"onMouseDown":"onMouseUp",n),document[e?"addEventListener":"removeEventListener"]("mouseup",t.cancelIsMouseDown),t.isInMouseDown=e}}},{key:"render",value:function(){var e=this.props,t=e.children,n=e.position,r=e.text,o=e.shortcut;if(1!==a.Children.count(t))return t;var c=a.Children.only(t),i=this.state.isOver;return Object(a.cloneElement)(c,{onMouseEnter:this.createToggleIsOver("onMouseEnter",!0),onMouseLeave:this.createToggleIsOver("onMouseLeave"),onClick:this.createToggleIsOver("onClick"),onFocus:this.createToggleIsOver("onFocus"),onBlur:this.createToggleIsOver("onBlur"),onMouseDown:this.createSetIsMouseDown(!0),children:Object(a.concatChildren)(c.props.children,i&&Object(a.createElement)(de,{focusOnMount:!1,position:n,className:"components-tooltip","aria-hidden":"true",animate:!1,noArrow:!0},r,Object(a.createElement)(pe,{className:"components-tooltip__shortcut",shortcut:o})))})}}]),o}(a.Component),me=n(91);function he(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var ge=["onMouseDown","onClick"],ve=t.a=Object(a.forwardRef)((function(e,t){var n=e.href,c=e.target,u=e.isPrimary,f=e.isSmall,d=e.isTertiary,p=e.isPressed,b=e.isBusy,m=e.isDefault,h=e.isSecondary,g=e.isLink,v=e.isDestructive,y=e.className,O=e.disabled,j=e.icon,E=e.iconSize,w=e.showTooltip,_=e.tooltipPosition,S=e.shortcut,k=e.label,R=e.children,P=e.__experimentalIsFocusable,x=Object(o.a)(e,["href","target","isPrimary","isSmall","isTertiary","isPressed","isBusy","isDefault","isSecondary","isLink","isDestructive","className","disabled","icon","iconSize","showTooltip","tooltipPosition","shortcut","label","children","__experimentalIsFocusable"]);m&&l()("Button isDefault prop",{alternative:"isSecondary"});var C=i()("components-button",y,{"is-secondary":m||h,"is-primary":u,"is-small":f,"is-tertiary":d,"is-pressed":p,"is-busy":b,"is-link":g,"is-destructive":v,"has-text":!!j&&!!R,"has-icon":!!j}),A=O&&!P,N=void 0===n||A?"button":"a",T="a"===N?{href:n,target:c}:{type:"button",disabled:A,"aria-pressed":p};if(O&&P){T["aria-disabled"]=!0;var M,D=function(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return he(e,void 0);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?he(e,void 0):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,c=!0,i=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return c=e.done,e},e:function(e){i=!0,a=e},f:function(){try{c||null==n.return||n.return()}finally{if(i)throw a}}}}(ge);try{for(D.s();!(M=D.n()).done;)x[M.value]=function(e){e.stopPropagation(),e.preventDefault()}}catch(e){D.e(e)}finally{D.f()}}var I=!A&&(w&&k||S||!!k&&(!R||Object(s.isArray)(R)&&!R.length)&&!1!==w),F=Object(a.createElement)(N,Object(r.a)({},T,x,{className:C,"aria-label":x["aria-label"]||k,ref:t}),j&&Object(a.createElement)(me.a,{icon:j,size:E}),R);return I?Object(a.createElement)(be,{text:k,shortcut:S,position:_},F):F}))},function(e,t){e.exports=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,n){},function(e,t,n){"use strict";var r=n(80);function o(){}function a(){}a.resetWarningCache=o,e.exports=function(){function e(e,t,n,o,a,c){if(c!==r){var i=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw i.name="Invariant Violation",i}}function t(){return e}e.isRequired=e;var n={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:a,resetWarningCache:o};return n.PropTypes=n,n}},function(e,t,n){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},function(e,t){},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(3);function o(e,t,n){void 0===n&&(n={});var o=n.maxWait,a=Object(r.useRef)(null),c=Object(r.useRef)([]),i=n.leading,s=void 0===n.trailing||n.trailing,u=Object(r.useRef)(!1),l=Object(r.useRef)(null),f=Object(r.useRef)(!1),d=Object(r.useRef)(e);d.current=e;var p=Object(r.useCallback)((function(){clearTimeout(l.current),clearTimeout(a.current),a.current=null,c.current=[],l.current=null,u.current=!1}),[]);Object(r.useEffect)((function(){return f.current=!1,function(){f.current=!0}}),[]);var b=Object(r.useCallback)((function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];c.current=e,clearTimeout(l.current),u.current&&(u.current=!1),l.current||!i||u.current||(d.current.apply(d,e),u.current=!0),l.current=setTimeout((function(){var t=!0;i&&u.current&&(t=!1),p(),!f.current&&s&&t&&d.current.apply(d,e)}),t),o&&!a.current&&s&&(a.current=setTimeout((function(){var e=c.current;p(),f.current||d.current.apply(null,e)}),o))}),[o,t,p,i,s]),m=Object(r.useCallback)((function(){l.current&&(d.current.apply(null,c.current),p())}),[p]);return[b,p,m]}},function(e,t,n){"use strict";n.d(t,"n",(function(){return a})),n.d(t,"l",(function(){return c})),n.d(t,"k",(function(){return i})),n.d(t,"m",(function(){return s})),n.d(t,"i",(function(){return u})),n.d(t,"d",(function(){return l})),n.d(t,"f",(function(){return f})),n.d(t,"j",(function(){return d})),n.d(t,"c",(function(){return p})),n.d(t,"e",(function(){return b})),n.d(t,"g",(function(){return m})),n.d(t,"a",(function(){return h})),n.d(t,"h",(function(){return g})),n.d(t,"b",(function(){return v}));var r,o=n(2),a=Object(o.getSetting)("wcBlocksConfig",{buildPhase:1,pluginUrl:"",productCount:0,defaultAvatar:"",restApiRoutes:{},wordCountType:"words"}),c=a.pluginUrl+"images/",i=a.pluginUrl+"build/",s=a.buildPhase,u=null===(r=o.STORE_PAGES.shop)||void 0===r?void 0:r.permalink,l=(o.STORE_PAGES.checkout.id,o.STORE_PAGES.checkout.permalink),f=o.STORE_PAGES.privacy.permalink,d=(o.STORE_PAGES.privacy.title,o.STORE_PAGES.terms.permalink),p=(o.STORE_PAGES.terms.title,o.STORE_PAGES.cart.id,o.STORE_PAGES.cart.permalink),b=o.STORE_PAGES.myaccount.permalink?o.STORE_PAGES.myaccount.permalink:Object(o.getSetting)("wpLoginUrl","/wp-login.php"),m=Object(o.getSetting)("shippingCountries",{}),h=Object(o.getSetting)("allowedCountries",{}),g=Object(o.getSetting)("shippingStates",{}),v=Object(o.getSetting)("allowedStates",{})},function(e,t){e.exports=function(e){if(Array.isArray(e))return e},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,a=[],_n=!0,c=!1;try{for(n=n.call(e);!(_n=(r=n.next()).done)&&(a.push(r.value),!t||a.length!==t);_n=!0);}catch(e){c=!0,o=e}finally{try{_n||null==n.return||n.return()}finally{if(c)throw o}}return a}},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,n){"use strict";var r=n(4),o=n.n(r),a=n(5),c=n.n(a),i=n(2),s=n(1),u=n(49);function l(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function f(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?l(Object(n),!0).forEach((function(t){o()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):l(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var d=Object(i.getSetting)("countryLocale",{}),p=function(e){var t={};return void 0!==e.label&&(t.label=e.label),void 0!==e.required&&(t.required=e.required),void 0!==e.hidden&&(t.hidden=e.hidden),void 0===e.label||e.optionalLabel||(t.optionalLabel=Object(s.sprintf)(
/* translators: %s Field label. */
Object(s.__)("%s (optional)",'woocommerce'),e.label)),e.priority&&(Object(u.a)(e.priority)&&(t.index=e.priority),Object(u.c)(e.priority)&&(t.index=parseInt(e.priority,10))),e.hidden&&(t.required=!1),t},b=Object.entries(d).map((function(e){var t=c()(e,2),n=t[0],r=t[1];return[n,Object.entries(r).map((function(e){var t=c()(e,2),n=t[0],r=t[1];return[n,p(r)]})).reduce((function(e,t){var n=c()(t,2),r=n[0],o=n[1];return e[r]=o,e}),{})]})).reduce((function(e,t){var n=c()(t,2),r=n[0],o=n[1];return e[r]=o,e}),{});t.a=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",r=n&&void 0!==b[n]?b[n]:{};return e.map((function(e){var n=i.defaultAddressFields[e]||{},o=r[e]||{},a=t[e]||{};return f(f(f({key:e},n),o),a)})).sort((function(e,t){return e.index-t.index}))}},function(e,t,n){"use strict";function r(e,t){return(r=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";var r=n(12),o=n(15),a=n(16),c=n(13),i=n(17),s=n(18),u=n(9),l=n(0),f=n(7),d=n(24);var p=["button","submit"];t.a=Object(d.createHigherOrderComponent)((function(e){return function(t){Object(i.a)(m,t);var n,d,b=(n=m,d=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=Object(u.a)(n);if(d){var r=Object(u.a)(this).constructor;e=Reflect.construct(t,arguments,r)}else e=t.apply(this,arguments);return Object(s.a)(this,e)});function m(){var e;return Object(o.a)(this,m),(e=b.apply(this,arguments)).bindNode=e.bindNode.bind(Object(c.a)(e)),e.cancelBlurCheck=e.cancelBlurCheck.bind(Object(c.a)(e)),e.queueBlurCheck=e.queueBlurCheck.bind(Object(c.a)(e)),e.normalizeButtonFocus=e.normalizeButtonFocus.bind(Object(c.a)(e)),e}return Object(a.a)(m,[{key:"componentWillUnmount",value:function(){this.cancelBlurCheck()}},{key:"bindNode",value:function(e){e?this.node=e:(delete this.node,this.cancelBlurCheck())}},{key:"queueBlurCheck",value:function(e){var t=this;e.persist(),this.preventBlurCheck||(this.blurCheckTimeout=setTimeout((function(){document.hasFocus()?"function"==typeof t.node.handleFocusOutside&&t.node.handleFocusOutside(e):e.preventDefault()}),0))}},{key:"cancelBlurCheck",value:function(){clearTimeout(this.blurCheckTimeout)}},{key:"normalizeButtonFocus",value:function(e){var t=e.type,n=e.target;Object(f.includes)(["mouseup","touchend"],t)?this.preventBlurCheck=!1:function(e){switch(e.nodeName){case"A":case"BUTTON":return!0;case"INPUT":return Object(f.includes)(p,e.type)}return!1}(n)&&(this.preventBlurCheck=!0)}},{key:"render",value:function(){return Object(l.createElement)("div",{onFocus:this.cancelBlurCheck,onMouseDown:this.normalizeButtonFocus,onMouseUp:this.normalizeButtonFocus,onTouchStart:this.normalizeButtonFocus,onTouchEnd:this.normalizeButtonFocus,onBlur:this.queueBlurCheck},Object(l.createElement)(e,Object(r.a)({ref:this.bindNode},this.props)))}}]),m}(l.Component)}),"withFocusOutside")},,function(e,t,n){"use strict";var r=n(20),o=n(12),a=n(19),c=n(0),i=n(34),s=function(e){var t=e.icon,n=e.className,r=Object(a.a)(e,["icon","className"]),i=["dashicon","dashicons","dashicons-"+t,n].filter(Boolean).join(" ");return Object(c.createElement)("span",Object(o.a)({className:i},r))};function u(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function l(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?u(Object(n),!0).forEach((function(t){Object(r.a)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):u(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}t.a=function(e){var t=e.icon,n=void 0===t?null:t,r=e.size,u=Object(a.a)(e,["icon","size"]);if("string"==typeof n)return Object(c.createElement)(s,Object(o.a)({icon:n},u));if(n&&s===n.type)return Object(c.cloneElement)(n,l({},u));var f=r||24;if("function"==typeof n)return n.prototype instanceof c.Component?Object(c.createElement)(n,l({size:f},u)):n(l({size:f},u));if(n&&("svg"===n.type||n.type===i.SVG)){var d=l(l({width:f,height:f},n.props),u);return Object(c.createElement)(i.SVG,d)}return Object(c.isValidElement)(n)?Object(c.cloneElement)(n,l({size:f},u)):n}},function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var r=n(5),o=n.n(r),a=function(e){return e.reduce((function(e,t){var n=o()(t,2),r=n[0],a=n[1];return e[r]=a,e}),{})}},function(e,t,n){"use strict";n.d(t,"b",(function(){return c})),n.d(t,"c",(function(){return i})),n.d(t,"a",(function(){return s}));var r=n(2),o=n(87),a=n(72),c=function(e){var t=e.country,n=void 0===t?"":t,r=e.state,o=void 0===r?"":r,a=e.city,c=void 0===a?"":a,i=e.postcode,s=void 0===i?"":i;return{country:n.trim(),state:o.trim(),city:c.trim(),postcode:s?s.replace(" ","").toUpperCase():""}},i=function(e){var t=e.email,n=void 0===t?"":t;return Object(a.isEmail)(n)?n.trim():""},s=function(e){var t=Object.keys(r.defaultAddressFields),n=Object(o.a)(t,{},e.country),a=Object.assign({},e);return n.forEach((function(t){var n=t.key,r=void 0===n?"":n,o=t.hidden;void 0!==o&&o&&function(e,t){return e in t}(r,e)&&(a[r]="")})),a}},function(e,t,n){var r=n(68);e.exports=function(e){if(Array.isArray(e))return r(e)},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=window.wp.autop},function(e,t,n){"use strict";n.d(t,"a",(function(){return u})),n.d(t,"b",(function(){return f}));var r,o=n(4),a=n.n(o),c=n(7);function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function s(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?i(Object(n),!0).forEach((function(t){a()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):i(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}!function(e){e.ADD_EVENT_CALLBACK="add_event_callback",e.REMOVE_EVENT_CALLBACK="remove_event_callback"}(r||(r={}));var u={addEventCallback:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:10;return{id:Object(c.uniqueId)(),type:r.ADD_EVENT_CALLBACK,eventType:e,callback:t,priority:n}},removeEventCallback:function(e,t){return{id:t,type:r.REMOVE_EVENT_CALLBACK,eventType:e}}},l={},f=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:l,t=arguments.length>1?arguments[1]:void 0,n=t.type,o=t.eventType,c=t.id,i=t.callback,u=t.priority,f=e.hasOwnProperty(o)?new Map(e[o]):new Map;switch(n){case r.ADD_EVENT_CALLBACK:return f.set(c,{priority:u,callback:i}),s(s({},e),{},a()({},o,f));case r.REMOVE_EVENT_CALLBACK:return f.delete(c),s(s({},e),{},a()({},o,f))}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(3);function o(e,t){var n=Object(r.useRef)();return Object(r.useEffect)((function(){n.current===e||t&&!t(e,n.current)||(n.current=e)}),[e,t]),n.current}},function(e,t,n){"use strict";n.d(t,"a",(function(){return c}));var r=n(5),o=n.n(r),a=n(0),c=function(){var e=Object(a.useState)(),t=o()(e,2)[1];return Object(a.useCallback)((function(e){t((function(){throw e}))}),[])}},,function(e,t){var n,r,o=e.exports={};function a(){throw new Error("setTimeout has not been defined")}function c(){throw new Error("clearTimeout has not been defined")}function i(e){if(n===setTimeout)return setTimeout(e,0);if((n===a||!n)&&setTimeout)return n=setTimeout,setTimeout(e,0);try{return n(e,0)}catch(t){try{return n.call(null,e,0)}catch(t){return n.call(this,e,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:a}catch(e){n=a}try{r="function"==typeof clearTimeout?clearTimeout:c}catch(e){r=c}}();var s,u=[],l=!1,f=-1;function d(){l&&s&&(l=!1,s.length?u=s.concat(u):f=-1,u.length&&p())}function p(){if(!l){var e=i(d);l=!0;for(var t=u.length;t;){for(s=u,u=[];++f<t;)s&&s[f].run();f=-1,t=u.length}s=null,l=!1,function(e){if(r===clearTimeout)return clearTimeout(e);if((r===c||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(e);try{r(e)}catch(t){try{return r.call(null,e)}catch(t){return r.call(this,e)}}}(e)}}function b(e,t){this.fun=e,this.array=t}function m(){}o.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];u.push(new b(e,t)),1!==u.length||l||i(p)},b.prototype.run=function(){this.fun.apply(null,this.array)},o.title="browser",o.browser=!0,o.env={},o.argv=[],o.version="",o.versions={},o.on=m,o.addListener=m,o.once=m,o.off=m,o.removeListener=m,o.removeAllListeners=m,o.emit=m,o.prependListener=m,o.prependOnceListener=m,o.listeners=function(e){return[]},o.binding=function(e){throw new Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(e){throw new Error("process.chdir is not supported")},o.umask=function(){return 0}},function(e,t,n){"use strict";n.d(t,"b",(function(){return j})),n.d(t,"a",(function(){return E}));var r=n(4),o=n.n(r),a=n(5),c=n.n(a),i=(n(10),n(0)),s=n(11),u=n(52),l=n(36),f=n(14),d=n.n(f),p=n(6),b=n.n(p),m=n(153),h=(n(112),function(e){var t=e.status;switch(void 0===t?"default":t){case"error":return"woocommerce-error";case"success":return"woocommerce-message";case"info":case"warning":return"woocommerce-info"}return""}),g=function(e){var t=e.className,n=e.notices,r=e.removeNotice,o=n.filter((function(e){return"snackbar"!==e.type}));if(!o.length)return null;var a=b()(t,"wc-block-components-notices");return React.createElement("div",{className:a},o.map((function(e){return React.createElement(m.a,d()({key:"store-notice-"+e.id},e,{className:b()("wc-block-components-notices__notice",h(e)),onRemove:function(){e.isDismissible&&r(e.id)}}),e.content)})))};function v(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function y(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?v(Object(n),!0).forEach((function(t){o()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):v(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var O=Object(i.createContext)({notices:[],createNotice:function(e,t,n){},removeNotice:function(e,t){},setIsSuppressed:function(e){},context:"wc/core"}),j=function(){return Object(i.useContext)(O)},E=function(e){var t=e.children,n=e.className,r=void 0===n?"":n,o=e.createNoticeContainer,a=void 0===o||o,f=e.context,d=void 0===f?"wc/core":f,p=Object(s.useDispatch)("core/notices"),b=p.createNotice,m=p.removeNotice,h=Object(i.useState)(!1),v=c()(h,2),j=v[0],E=v[1],w=Object(u.a)().dispatchStoreEvent,_=Object(l.a)().isEditor,S=Object(i.useCallback)((function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};b(e,t,y(y({},n),{},{context:n.context||d})),w("store-notice-create",{status:e,content:t,options:n})}),[b,w,d]),k=Object(i.useCallback)((function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:d;m(e,t)}),[m,d]),R={notices:Object(s.useSelect)((function(e){return{notices:e("core/notices").getNotices(d)}}),[d]).notices,createNotice:S,removeNotice:k,context:d,setIsSuppressed:E},P=j?null:React.createElement(g,{className:r,notices:R.notices,removeNotice:R.removeNotice,isEditor:_});return React.createElement(O.Provider,{value:R},a&&P,t)}},,function(e,t,n){"use strict";var r=n(1),o=(n(10),n(6)),a=n.n(o),c=(n(181),n(138));t.a=function(e){var t=e.children,n=e.className,o=e.screenReaderLabel,i=e.showSpinner,s=void 0!==i&&i,u=e.isLoading,l=void 0===u||u;return React.createElement("div",{className:a()(n,{"wc-block-components-loading-mask":l})},l&&s&&React.createElement(c.a,null),React.createElement("div",{className:a()({"wc-block-components-loading-mask__children":l}),"aria-hidden":l},t),l&&React.createElement("span",{className:"screen-reader-text"},o||Object(r.__)("Loading…",'woocommerce')))}},function(e,t,n){"use strict";var r=n(6),o=n.n(r);n(184),t.a=function(e){var t=e.children,n=e.className;return React.createElement("div",{className:o()("wc-block-components-product-badge",n)},t)}},function(e,t,n){"use strict";n.d(t,"a",(function(){return p}));var r=n(14),o=n.n(r),a=n(4),c=n.n(a),i=n(0),s=n(44);function u(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function l(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?u(Object(n),!0).forEach((function(t){c()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):u(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var f=[".wp-block-woocommerce-cart"],d=function(e){var t=e.Block,n=e.containers,r=e.getProps,a=void 0===r?function(){return{}}:r,c=e.getErrorBoundaryProps,u=void 0===c?function(){return{}}:c;0!==n.length&&Array.prototype.forEach.call(n,(function(e,n){var r=a(e,n),c=u(e,n),f=l(l({},e.dataset),r.attributes||{});e.classList.remove("is-loading"),Object(i.render)(React.createElement(s.a,c,React.createElement(i.Suspense,{fallback:React.createElement("div",{className:"wc-block-placeholder"})},React.createElement(t,o()({},r,{attributes:f})))),e)}))},p=function(e){var t,n,r,o,a,c,i,s=document.body.querySelectorAll(f.join(","));t=l(l({},e),{},{wrappers:s}),n=t.Block,r=t.getProps,o=t.getErrorBoundaryProps,a=t.selector,c=t.wrappers,i=document.body.querySelectorAll(a),c.length>0&&Array.prototype.filter.call(i,(function(e){return!function(e,t){return Array.prototype.some.call(t,(function(t){return t.contains(e)&&!t.isSameNode(e)}))}(e,c)})),d({Block:n,containers:i,getProps:r,getErrorBoundaryProps:o}),Array.prototype.forEach.call(s,(function(t){t.addEventListener("wc-blocks_render_blocks_frontend",(function(){var n,r,o,a,c,i;r=(n=l(l({},e),{},{wrapper:t})).Block,o=n.getProps,a=n.getErrorBoundaryProps,c=n.selector,i=n.wrapper.querySelectorAll(c),d({Block:r,containers:i,getProps:o,getErrorBoundaryProps:a})}))}))}},,,,,function(e,t){},function(e,t){e.exports=window.wp.wordcount},function(e,t,n){"use strict";var r=n(14),o=n.n(r),a=n(0),c=(n(142),function(e){if(e){var t=e.getBoundingClientRect().bottom;t>=0&&t<=window.innerHeight||e.scrollIntoView()}});t.a=function(e){return function(t){var n=Object(a.useRef)(null);return React.createElement(React.Fragment,null,React.createElement("div",{className:"with-scroll-to-top__scroll-point",ref:n,"aria-hidden":!0}),React.createElement(e,o()({},t,{scrollToTop:function(e){var t,r;null!==n.current&&(t=n.current,r=(e||{}).focusableSelector,window&&Number.isFinite(window.innerHeight)&&(r?function(e,t){var n,r=(null===(n=e.parentElement)||void 0===n?void 0:n.querySelectorAll(t))||[];if(r.length){var o=r[0];c(o),null==o||o.focus()}else c(e)}(t,r):c(t)))}})))}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return c}));var r=n(3),o=n(82);function a(e,t){return e===t}function c(e,t,n){var c=n&&n.equalityFn?n.equalityFn:a,i=Object(r.useState)(e),s=i[0],u=i[1],l=Object(o.a)(Object(r.useCallback)((function(e){return u(e)}),[]),t,n),f=l[0],d=l[1],p=l[2],b=Object(r.useRef)(e);return Object(r.useEffect)((function(){c(b.current,e)||(f(e),b.current=e)}),[e,f,c]),[s,d,p]}},function(e,t,n){"use strict";var r=n(0),o=n(34),a=Object(r.createElement)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(r.createElement)(o.Path,{d:"M13 11.8l6.1-6.3-1-1-6.1 6.2-6.1-6.2-1 1 6.1 6.3-6.5 6.7 1 1 6.5-6.6 6.5 6.6 1-1z"}));t.a=a},function(e,t,n){"use strict";function r(e){return e&&"object"==typeof e&&"default"in e?e.default:e}Object.defineProperty(t,"__esModule",{value:!0});var o=r(n(14)),a=r(n(77)),c=n(3),i=r(c),s=r(n(144)),u=r(n(29)),l={arr:Array.isArray,obj:function(e){return"[object Object]"===Object.prototype.toString.call(e)},fun:function(e){return"function"==typeof e},str:function(e){return"string"==typeof e},num:function(e){return"number"==typeof e},und:function(e){return void 0===e},nul:function(e){return null===e},set:function(e){return e instanceof Set},map:function(e){return e instanceof Map},equ:function(e,t){if(typeof e!=typeof t)return!1;if(l.str(e)||l.num(e))return e===t;if(l.obj(e)&&l.obj(t)&&Object.keys(e).length+Object.keys(t).length===0)return!0;var n;for(n in e)if(!(n in t))return!1;for(n in t)if(e[n]!==t[n])return!1;return!l.und(n)||e===t}};function f(){var e=c.useState(!1)[1];return c.useCallback((function(){return e((function(e){return!e}))}),[])}function d(e,t){return l.und(e)||l.nul(e)?t:e}function p(e){return l.und(e)?[]:l.arr(e)?e:[e]}function b(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return l.fun(e)?e.apply(void 0,n):e}function m(e){var t=function(e){return e.to,e.from,e.config,e.onStart,e.onRest,e.onFrame,e.children,e.reset,e.reverse,e.force,e.immediate,e.delay,e.attach,e.destroyed,e.interpolateTo,e.ref,e.lazy,a(e,["to","from","config","onStart","onRest","onFrame","children","reset","reverse","force","immediate","delay","attach","destroyed","interpolateTo","ref","lazy"])}(e);if(l.und(t))return o({to:t},e);var n=Object.keys(e).reduce((function(n,r){var a;return l.und(t[r])?o({},n,((a={})[r]=e[r],a)):n}),{});return o({to:t},n)}var h,g,v=function(){function e(){this.payload=void 0,this.children=[]}var t=e.prototype;return t.getAnimatedValue=function(){return this.getValue()},t.getPayload=function(){return this.payload||this},t.attach=function(){},t.detach=function(){},t.getChildren=function(){return this.children},t.addChild=function(e){0===this.children.length&&this.attach(),this.children.push(e)},t.removeChild=function(e){var t=this.children.indexOf(e);this.children.splice(t,1),0===this.children.length&&this.detach()},e}(),y=function(e){function t(){for(var t,n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return(t=e.call.apply(e,[this].concat(r))||this).payload=[],t.attach=function(){return t.payload.forEach((function(e){return e instanceof v&&e.addChild(u(t))}))},t.detach=function(){return t.payload.forEach((function(e){return e instanceof v&&e.removeChild(u(t))}))},t}return s(t,e),t}(v),O=function(e){function t(){for(var t,n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return(t=e.call.apply(e,[this].concat(r))||this).payload={},t.attach=function(){return Object.values(t.payload).forEach((function(e){return e instanceof v&&e.addChild(u(t))}))},t.detach=function(){return Object.values(t.payload).forEach((function(e){return e instanceof v&&e.removeChild(u(t))}))},t}s(t,e);var n=t.prototype;return n.getValue=function(e){void 0===e&&(e=!1);var t={};for(var n in this.payload){var r=this.payload[n];(!e||r instanceof v)&&(t[n]=r instanceof v?r[e?"getAnimatedValue":"getValue"]():r)}return t},n.getAnimatedValue=function(){return this.getValue(!0)},t}(v);function j(e,t){h={fn:e,transform:t}}function E(e){g=e}var w,_=function(e){return"undefined"!=typeof window?window.requestAnimationFrame(e):-1},S=function(e){"undefined"!=typeof window&&window.cancelAnimationFrame(e)};function k(e){w=e}var R,P=function(){return Date.now()};function x(e){R=e}var C,A,N=function(e){return e.current};function T(e){C=e}var M=Object.freeze({get applyAnimatedValues(){return h},injectApplyAnimatedValues:j,get colorNames(){return g},injectColorNames:E,get requestFrame(){return _},get cancelFrame(){return S},injectFrame:function(e,t){_=e,S=t},get interpolation(){return w},injectStringInterpolator:k,get now(){return P},injectNow:function(e){P=e},get defaultElement(){return R},injectDefaultElement:x,get animatedApi(){return N},injectAnimatedApi:function(e){N=e},get createAnimatedStyle(){return C},injectCreateAnimatedStyle:T,get manualFrameloop(){return A},injectManualFrameloop:function(e){A=e}}),D=function(e){function t(t,n){var r;return(r=e.call(this)||this).update=void 0,r.payload=t.style?o({},t,{style:C(t.style)}):t,r.update=n,r.attach(),r}return s(t,e),t}(O),I=!1,F=new Set,L=function e(){if(!I)return!1;var t=P(),n=F,r=Array.isArray(n),o=0;for(n=r?n:n[Symbol.iterator]();;){var a;if(r){if(o>=n.length)break;a=n[o++]}else{if((o=n.next()).done)break;a=o.value}for(var c=a,i=!1,s=0;s<c.configs.length;s++){for(var u=c.configs[s],l=void 0,f=void 0,d=0;d<u.animatedValues.length;d++){var p=u.animatedValues[d];if(!p.done){var b=u.fromValues[d],m=u.toValues[d],h=p.lastPosition,g=m instanceof v,y=Array.isArray(u.initialVelocity)?u.initialVelocity[d]:u.initialVelocity;if(g&&(m=m.getValue()),u.immediate)p.setValue(m),p.done=!0;else if("string"!=typeof b&&"string"!=typeof m){if(void 0!==u.duration)h=b+u.easing((t-p.startTime)/u.duration)*(m-b),l=t>=p.startTime+u.duration;else if(u.decay)h=b+y/(1-.998)*(1-Math.exp(-(1-.998)*(t-p.startTime))),(l=Math.abs(p.lastPosition-h)<.1)&&(m=h);else{f=void 0!==p.lastTime?p.lastTime:t,y=void 0!==p.lastVelocity?p.lastVelocity:u.initialVelocity,t>f+64&&(f=t);for(var O=Math.floor(t-f),j=0;j<O;++j)h+=1*(y+=(-u.tension*(h-m)+-u.friction*y)/u.mass*1/1e3)/1e3;var E=!(!u.clamp||0===u.tension)&&(b<m?h>m:h<m),w=Math.abs(y)<=u.precision,S=0===u.tension||Math.abs(m-h)<=u.precision;l=E||w&&S,p.lastVelocity=y,p.lastTime=t}g&&!u.toValues[d].done&&(l=!1),l?(p.value!==m&&(h=m),p.done=!0):i=!0,p.setValue(h),p.lastPosition=h}else p.setValue(m),p.done=!0}}c.props.onFrame&&(c.values[u.name]=u.interpolation.getValue())}c.props.onFrame&&c.props.onFrame(c.values),i||(F.delete(c),c.stop(!0))}return F.size?A?A():_(e):I=!1,I};function V(e,t,n){if("function"==typeof e)return e;if(Array.isArray(e))return V({range:e,output:t,extrapolate:n});if(w&&"string"==typeof e.output[0])return w(e);var r=e,o=r.output,a=r.range||[0,1],c=r.extrapolateLeft||r.extrapolate||"extend",i=r.extrapolateRight||r.extrapolate||"extend",s=r.easing||function(e){return e};return function(e){var t=function(e,t){for(var n=1;n<t.length-1&&!(t[n]>=e);++n);return n-1}(e,a);return function(e,t,n,r,o,a,c,i,s){var u=s?s(e):e;if(u<t){if("identity"===c)return u;"clamp"===c&&(u=t)}if(u>n){if("identity"===i)return u;"clamp"===i&&(u=n)}return r===o?r:t===n?e<=t?r:o:(t===-1/0?u=-u:n===1/0?u-=t:u=(u-t)/(n-t),u=a(u),r===-1/0?u=-u:o===1/0?u+=r:u=u*(o-r)+r,u)}(e,a[t],a[t+1],o[t],o[t+1],s,c,i,r.map)}}var U=function(e){function t(n,r,o,a){var c;return(c=e.call(this)||this).calc=void 0,c.payload=n instanceof y&&!(n instanceof t)?n.getPayload():Array.isArray(n)?n:[n],c.calc=V(r,o,a),c}s(t,e);var n=t.prototype;return n.getValue=function(){return this.calc.apply(this,this.payload.map((function(e){return e.getValue()})))},n.updateConfig=function(e,t,n){this.calc=V(e,t,n)},n.interpolate=function(e,n,r){return new t(this,e,n,r)},t}(y),B=function(e){function t(t){var n;return(n=e.call(this)||this).animatedStyles=new Set,n.value=void 0,n.startPosition=void 0,n.lastPosition=void 0,n.lastVelocity=void 0,n.startTime=void 0,n.lastTime=void 0,n.done=!1,n.setValue=function(e,t){void 0===t&&(t=!0),n.value=e,t&&n.flush()},n.value=t,n.startPosition=t,n.lastPosition=t,n}s(t,e);var n=t.prototype;return n.flush=function(){0===this.animatedStyles.size&&function e(t,n){"update"in t?n.add(t):t.getChildren().forEach((function(t){return e(t,n)}))}(this,this.animatedStyles),this.animatedStyles.forEach((function(e){return e.update()}))},n.clearStyles=function(){this.animatedStyles.clear()},n.getValue=function(){return this.value},n.interpolate=function(e,t,n){return new U(this,e,t,n)},t}(v),H=function(e){function t(t){var n;return(n=e.call(this)||this).payload=t.map((function(e){return new B(e)})),n}s(t,e);var n=t.prototype;return n.setValue=function(e,t){var n=this;void 0===t&&(t=!0),Array.isArray(e)?e.length===this.payload.length&&e.forEach((function(e,r){return n.payload[r].setValue(e,t)})):this.payload.forEach((function(n){return n.setValue(e,t)}))},n.getValue=function(){return this.payload.map((function(e){return e.getValue()}))},n.interpolate=function(e,t){return new U(this,e,t)},t}(y),q=0,z=function(){function e(){var e=this;this.id=void 0,this.idle=!0,this.hasChanged=!1,this.guid=0,this.local=0,this.props={},this.merged={},this.animations={},this.interpolations={},this.values={},this.configs=[],this.listeners=[],this.queue=[],this.localQueue=void 0,this.getValues=function(){return e.interpolations},this.id=q++}var t=e.prototype;return t.update=function(e){if(!e)return this;var t=m(e),n=t.delay,r=void 0===n?0:n,c=t.to,i=a(t,["delay","to"]);if(l.arr(c)||l.fun(c))this.queue.push(o({},i,{delay:r,to:c}));else if(c){var s={};Object.entries(c).forEach((function(e){var t,n=e[0],a=e[1],c=o({to:(t={},t[n]=a,t),delay:b(r,n)},i),u=s[c.delay]&&s[c.delay].to;s[c.delay]=o({},s[c.delay],c,{to:o({},u,c.to)})})),this.queue=Object.values(s)}return this.queue=this.queue.sort((function(e,t){return e.delay-t.delay})),this.diff(i),this},t.start=function(e){var t=this;if(this.queue.length){this.idle=!1,this.localQueue&&this.localQueue.forEach((function(e){var n=e.from,r=void 0===n?{}:n,a=e.to,c=void 0===a?{}:a;l.obj(r)&&(t.merged=o({},r,t.merged)),l.obj(c)&&(t.merged=o({},t.merged,c))}));var n=this.local=++this.guid,r=this.localQueue=this.queue;this.queue=[],r.forEach((function(o,c){var i=o.delay,s=a(o,["delay"]),u=function(o){c===r.length-1&&n===t.guid&&o&&(t.idle=!0,t.props.onRest&&t.props.onRest(t.merged)),e&&e()},f=l.arr(s.to)||l.fun(s.to);i?setTimeout((function(){n===t.guid&&(f?t.runAsync(s,u):t.diff(s).start(u))}),i):f?t.runAsync(s,u):t.diff(s).start(u)}))}else l.fun(e)&&this.listeners.push(e),this.props.onStart&&this.props.onStart(),this,F.has(this)||F.add(this),I||(I=!0,_(A||L));return this},t.stop=function(e){return this.listeners.forEach((function(t){return t(e)})),this.listeners=[],this},t.pause=function(e){return this.stop(!0),e&&(this,F.has(this)&&F.delete(this)),this},t.runAsync=function(e,t){var n=this,r=(e.delay,a(e,["delay"])),c=this.local,i=Promise.resolve(void 0);if(l.arr(r.to))for(var s=function(e){var t=e,a=o({},r,m(r.to[t]));l.arr(a.config)&&(a.config=a.config[t]),i=i.then((function(){if(c===n.guid)return new Promise((function(e){return n.diff(a).start(e)}))}))},u=0;u<r.to.length;u++)s(u);else if(l.fun(r.to)){var f,d=0;i=i.then((function(){return r.to((function(e){var t=o({},r,m(e));if(l.arr(t.config)&&(t.config=t.config[d]),d++,c===n.guid)return f=new Promise((function(e){return n.diff(t).start(e)}))}),(function(e){return void 0===e&&(e=!0),n.stop(e)})).then((function(){return f}))}))}i.then(t)},t.diff=function(e){var t=this;this.props=o({},this.props,e);var n=this.props,r=n.from,a=void 0===r?{}:r,c=n.to,i=void 0===c?{}:c,s=n.config,u=void 0===s?{}:s,f=n.reverse,m=n.attach,h=n.reset,v=n.immediate;if(f){var y=[i,a];a=y[0],i=y[1]}this.merged=o({},a,this.merged,i),this.hasChanged=!1;var O=m&&m(this);if(this.animations=Object.entries(this.merged).reduce((function(e,n){var r=n[0],c=n[1],i=e[r]||{},s=l.num(c),f=l.str(c)&&!c.startsWith("#")&&!/\d/.test(c)&&!g[c],m=l.arr(c),y=!s&&!m&&!f,j=l.und(a[r])?c:a[r],E=s||m||f?c:1,_=b(u,r);O&&(E=O.animations[r].parent);var S,k=i.parent,R=i.interpolation,x=p(O?E.getPayload():E),C=c;y&&(C=w({range:[0,1],output:[c,c]})(1));var A,N=R&&R.getValue(),T=!l.und(k)&&i.animatedValues.some((function(e){return!e.done})),M=!l.equ(C,N),D=!l.equ(C,i.previous),I=!l.equ(_,i.config);if(h||D&&M||I){var F;if(s||f)k=R=i.parent||new B(j);else if(m)k=R=i.parent||new H(j);else if(y){var L=i.interpolation&&i.interpolation.calc(i.parent.value);L=void 0===L||h?j:L,i.parent?(k=i.parent).setValue(0,!1):k=new B(0);var V={output:[L,c]};i.interpolation?(R=i.interpolation,i.interpolation.updateConfig(V)):R=k.interpolate(V)}return x=p(O?E.getPayload():E),S=p(k.getPayload()),h&&!y&&k.setValue(j,!1),t.hasChanged=!0,S.forEach((function(e){e.startPosition=e.value,e.lastPosition=e.value,e.lastVelocity=T?e.lastVelocity:void 0,e.lastTime=T?e.lastTime:void 0,e.startTime=P(),e.done=!1,e.animatedStyles.clear()})),b(v,r)&&k.setValue(y?E:c,!1),o({},e,((F={})[r]=o({},i,{name:r,parent:k,interpolation:R,animatedValues:S,toValues:x,previous:C,config:_,fromValues:p(k.getValue()),immediate:b(v,r),initialVelocity:d(_.velocity,0),clamp:d(_.clamp,!1),precision:d(_.precision,.01),tension:d(_.tension,170),friction:d(_.friction,26),mass:d(_.mass,1),duration:_.duration,easing:d(_.easing,(function(e){return e})),decay:_.decay}),F))}return M?e:(y&&(k.setValue(1,!1),R.updateConfig({output:[C,C]})),k.done=!0,t.hasChanged=!0,o({},e,((A={})[r]=o({},e[r],{previous:C}),A)))}),this.animations),this.hasChanged)for(var j in this.configs=Object.values(this.animations),this.values={},this.interpolations={},this.animations)this.interpolations[j]=this.animations[j].interpolation,this.values[j]=this.animations[j].interpolation.getValue();return this},t.destroy=function(){this.stop(),this.props={},this.merged={},this.animations={},this.interpolations={},this.values={},this.configs=[],this.local=0},e}(),W=function(e,t){var n=c.useRef(!1),r=c.useRef(),o=l.fun(t),a=c.useMemo((function(){var n;return r.current&&(r.current.map((function(e){return e.destroy()})),r.current=void 0),[new Array(e).fill().map((function(e,r){var a=new z,c=o?b(t,r,a):t[r];return 0===r&&(n=c.ref),a.update(c),n||a.start(),a})),n]}),[e]),i=a[0],s=a[1];r.current=i,c.useImperativeHandle(s,(function(){return{start:function(){return Promise.all(r.current.map((function(e){return new Promise((function(t){return e.start(t)}))})))},stop:function(e){return r.current.forEach((function(t){return t.stop(e)}))},get controllers(){return r.current}}}));var u=c.useMemo((function(){return function(e){return r.current.map((function(t,n){t.update(o?b(e,n,t):e[n]),s||t.start()}))}}),[e]);c.useEffect((function(){n.current?o||u(t):s||r.current.forEach((function(e){return e.start()}))})),c.useEffect((function(){return n.current=!0,function(){return r.current.forEach((function(e){return e.destroy()}))}}),[]);var f=r.current.map((function(e){return e.getValues()}));return o?[f,u,function(e){return r.current.forEach((function(t){return t.pause(e)}))}]:f},G=0,Y=function(e,t){return("function"==typeof t?e.map(t):p(t)).map(String)},$=function(e){var t=e.items,n=e.keys,r=void 0===n?function(e){return e}:n,c=a(e,["items","keys"]);return t=p(void 0!==t?t:null),o({items:t,keys:Y(t,r)},c)};function K(e,t){var n=function(){if(o){if(a>=r.length)return"break";c=r[a++]}else{if((a=r.next()).done)return"break";c=a.value}var n=c.key,i=function(e){return e.key!==n};(l.und(t)||t===n)&&(e.current.instances.delete(n),e.current.transitions=e.current.transitions.filter(i),e.current.deleted=e.current.deleted.filter(i))},r=e.current.deleted,o=Array.isArray(r),a=0;for(r=o?r:r[Symbol.iterator]();;){var c;if("break"===n())break}e.current.forceUpdate()}var X=function(e){function t(t){var n;return void 0===t&&(t={}),n=e.call(this)||this,!t.transform||t.transform instanceof v||(t=h.transform(t)),n.payload=t,n}return s(t,e),t}(O),Q={transparent:0,aliceblue:4042850303,antiquewhite:4209760255,aqua:16777215,aquamarine:2147472639,azure:4043309055,beige:4126530815,bisque:4293182719,black:255,blanchedalmond:4293643775,blue:65535,blueviolet:2318131967,brown:2771004159,burlywood:3736635391,burntsienna:3934150143,cadetblue:1604231423,chartreuse:2147418367,chocolate:3530104575,coral:4286533887,cornflowerblue:1687547391,cornsilk:4294499583,crimson:3692313855,cyan:16777215,darkblue:35839,darkcyan:9145343,darkgoldenrod:3095792639,darkgray:2846468607,darkgreen:6553855,darkgrey:2846468607,darkkhaki:3182914559,darkmagenta:2332068863,darkolivegreen:1433087999,darkorange:4287365375,darkorchid:2570243327,darkred:2332033279,darksalmon:3918953215,darkseagreen:2411499519,darkslateblue:1211993087,darkslategray:793726975,darkslategrey:793726975,darkturquoise:13554175,darkviolet:2483082239,deeppink:4279538687,deepskyblue:12582911,dimgray:1768516095,dimgrey:1768516095,dodgerblue:512819199,firebrick:2988581631,floralwhite:4294635775,forestgreen:579543807,fuchsia:4278255615,gainsboro:3705462015,ghostwhite:4177068031,gold:4292280575,goldenrod:3668254975,gray:2155905279,green:8388863,greenyellow:2919182335,grey:2155905279,honeydew:4043305215,hotpink:4285117695,indianred:3445382399,indigo:1258324735,ivory:4294963455,khaki:4041641215,lavender:3873897215,lavenderblush:4293981695,lawngreen:2096890111,lemonchiffon:4294626815,lightblue:2916673279,lightcoral:4034953471,lightcyan:3774873599,lightgoldenrodyellow:4210742015,lightgray:3553874943,lightgreen:2431553791,lightgrey:3553874943,lightpink:4290167295,lightsalmon:4288707327,lightseagreen:548580095,lightskyblue:2278488831,lightslategray:2005441023,lightslategrey:2005441023,lightsteelblue:2965692159,lightyellow:4294959359,lime:16711935,limegreen:852308735,linen:4210091775,magenta:4278255615,maroon:2147483903,mediumaquamarine:1724754687,mediumblue:52735,mediumorchid:3126187007,mediumpurple:2473647103,mediumseagreen:1018393087,mediumslateblue:2070474495,mediumspringgreen:16423679,mediumturquoise:1221709055,mediumvioletred:3340076543,midnightblue:421097727,mintcream:4127193855,mistyrose:4293190143,moccasin:4293178879,navajowhite:4292783615,navy:33023,oldlace:4260751103,olive:2155872511,olivedrab:1804477439,orange:4289003775,orangered:4282712319,orchid:3664828159,palegoldenrod:4008225535,palegreen:2566625535,paleturquoise:2951671551,palevioletred:3681588223,papayawhip:4293907967,peachpuff:4292524543,peru:3448061951,pink:4290825215,plum:3718307327,powderblue:2967529215,purple:2147516671,rebeccapurple:1714657791,red:4278190335,rosybrown:3163525119,royalblue:1097458175,saddlebrown:2336560127,salmon:4202722047,sandybrown:4104413439,seagreen:780883967,seashell:4294307583,sienna:2689740287,silver:3233857791,skyblue:2278484991,slateblue:1784335871,slategray:1887473919,slategrey:1887473919,snow:4294638335,springgreen:16744447,steelblue:1182971135,tan:3535047935,teal:8421631,thistle:3636451583,tomato:4284696575,turquoise:1088475391,violet:4001558271,wheat:4125012991,white:4294967295,whitesmoke:4126537215,yellow:4294902015,yellowgreen:2597139199},Z="[-+]?\\d*\\.?\\d+";function J(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return"\\(\\s*("+t.join(")\\s*,\\s*(")+")\\s*\\)"}var ee=new RegExp("rgb"+J(Z,Z,Z)),te=new RegExp("rgba"+J(Z,Z,Z,Z)),ne=new RegExp("hsl"+J(Z,"[-+]?\\d*\\.?\\d+%","[-+]?\\d*\\.?\\d+%")),re=new RegExp("hsla"+J(Z,"[-+]?\\d*\\.?\\d+%","[-+]?\\d*\\.?\\d+%",Z)),oe=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,ae=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,ce=/^#([0-9a-fA-F]{6})$/,ie=/^#([0-9a-fA-F]{8})$/;function se(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function ue(e,t,n){var r=n<.5?n*(1+t):n+t-n*t,o=2*n-r,a=se(o,r,e+1/3),c=se(o,r,e),i=se(o,r,e-1/3);return Math.round(255*a)<<24|Math.round(255*c)<<16|Math.round(255*i)<<8}function le(e){var t=parseInt(e,10);return t<0?0:t>255?255:t}function fe(e){return(parseFloat(e)%360+360)%360/360}function de(e){var t=parseFloat(e);return t<0?0:t>1?255:Math.round(255*t)}function pe(e){var t=parseFloat(e);return t<0?0:t>100?1:t/100}function be(e){var t,n,r="number"==typeof(t=e)?t>>>0===t&&t>=0&&t<=4294967295?t:null:(n=ce.exec(t))?parseInt(n[1]+"ff",16)>>>0:Q.hasOwnProperty(t)?Q[t]:(n=ee.exec(t))?(le(n[1])<<24|le(n[2])<<16|le(n[3])<<8|255)>>>0:(n=te.exec(t))?(le(n[1])<<24|le(n[2])<<16|le(n[3])<<8|de(n[4]))>>>0:(n=oe.exec(t))?parseInt(n[1]+n[1]+n[2]+n[2]+n[3]+n[3]+"ff",16)>>>0:(n=ie.exec(t))?parseInt(n[1],16)>>>0:(n=ae.exec(t))?parseInt(n[1]+n[1]+n[2]+n[2]+n[3]+n[3]+n[4]+n[4],16)>>>0:(n=ne.exec(t))?(255|ue(fe(n[1]),pe(n[2]),pe(n[3])))>>>0:(n=re.exec(t))?(ue(fe(n[1]),pe(n[2]),pe(n[3]))|de(n[4]))>>>0:null;return null===r?e:"rgba("+((4278190080&(r=r||0))>>>24)+", "+((16711680&r)>>>16)+", "+((65280&r)>>>8)+", "+(255&r)/255+")"}var me=/[+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,he=/(#(?:[0-9a-f]{2}){2,4}|(#[0-9a-f]{3})|(rgb|hsl)a?\((-?\d+%?[,\s]+){2,3}\s*[\d\.]+%?\))/gi,ge=new RegExp("("+Object.keys(Q).join("|")+")","g"),ve={animationIterationCount:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},ye=["Webkit","Ms","Moz","O"];function Oe(e,t,n){return null==t||"boolean"==typeof t||""===t?"":n||"number"!=typeof t||0===t||ve.hasOwnProperty(e)&&ve[e]?(""+t).trim():t+"px"}ve=Object.keys(ve).reduce((function(e,t){return ye.forEach((function(n){return e[function(e,t){return e+t.charAt(0).toUpperCase()+t.substring(1)}(n,t)]=e[t]})),e}),ve);var je={};T((function(e){return new X(e)})),x("div"),k((function(e){var t=e.output.map((function(e){return e.replace(he,be)})).map((function(e){return e.replace(ge,be)})),n=t[0].match(me).map((function(){return[]}));t.forEach((function(e){e.match(me).forEach((function(e,t){return n[t].push(+e)}))}));var r=t[0].match(me).map((function(t,r){return V(o({},e,{output:n[r]}))}));return function(e){var n=0;return t[0].replace(me,(function(){return r[n++](e)})).replace(/rgba\(([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+)\)/gi,(function(e,t,n,r,o){return"rgba("+Math.round(t)+", "+Math.round(n)+", "+Math.round(r)+", "+o+")"}))}})),E(Q),j((function(e,t){if(!e.nodeType||void 0===e.setAttribute)return!1;var n=t.style,r=t.children,o=t.scrollTop,c=t.scrollLeft,i=a(t,["style","children","scrollTop","scrollLeft"]),s="filter"===e.nodeName||e.parentNode&&"filter"===e.parentNode.nodeName;for(var u in void 0!==o&&(e.scrollTop=o),void 0!==c&&(e.scrollLeft=c),void 0!==r&&(e.textContent=r),n)if(n.hasOwnProperty(u)){var l=0===u.indexOf("--"),f=Oe(u,n[u],l);"float"===u&&(u="cssFloat"),l?e.style.setProperty(u,f):e.style[u]=f}for(var d in i){var p=s?d:je[d]||(je[d]=d.replace(/([A-Z])/g,(function(e){return"-"+e.toLowerCase()})));void 0!==e.getAttribute(p)&&e.setAttribute(p,i[d])}}),(function(e){return e}));var Ee,we,_e=(Ee=function(e){return c.forwardRef((function(t,n){var r=f(),s=c.useRef(!0),u=c.useRef(null),d=c.useRef(null),p=c.useCallback((function(e){var t=u.current;u.current=new D(e,(function(){var e=!1;d.current&&(e=h.fn(d.current,u.current.getAnimatedValue())),d.current&&!1!==e||r()})),t&&t.detach()}),[]);c.useEffect((function(){return function(){s.current=!1,u.current&&u.current.detach()}}),[]),c.useImperativeHandle(n,(function(){return N(d,s,r)})),p(t);var b,m=u.current.getValue(),g=(m.scrollTop,m.scrollLeft,a(m,["scrollTop","scrollLeft"])),v=(b=e,!l.fun(b)||b.prototype instanceof i.Component?function(e){return d.current=function(e,t){return t&&(l.fun(t)?t(e):l.obj(t)&&(t.current=e)),e}(e,n)}:void 0);return i.createElement(e,o({},g,{ref:v}))}))},void 0===(we=!1)&&(we=!0),function(e){return(l.arr(e)?e:Object.keys(e)).reduce((function(e,t){var n=we?t[0].toLowerCase()+t.substring(1):t;return e[n]=Ee(n),e}),Ee)}),Se=_e(["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"]);t.apply=_e,t.config={default:{tension:170,friction:26},gentle:{tension:120,friction:14},wobbly:{tension:180,friction:12},stiff:{tension:210,friction:20},slow:{tension:280,friction:60},molasses:{tension:280,friction:120}},t.update=L,t.animated=Se,t.a=Se,t.interpolate=function(e,t,n){return e&&new U(e,t,n)},t.Globals=M,t.useSpring=function(e){var t=l.fun(e),n=W(1,t?e:[e]),r=n[0],o=n[1],a=n[2];return t?[r[0],o,a]:r},t.useTrail=function(e,t){var n=c.useRef(!1),r=l.fun(t),a=b(t),i=c.useRef(),s=W(e,(function(e,t){return 0===e&&(i.current=[]),i.current.push(t),o({},a,{config:b(a.config,e),attach:e>0&&function(){return i.current[e-1]}})})),u=s[0],f=s[1],d=s[2],p=c.useMemo((function(){return function(e){return f((function(t,n){e.reverse;var r=e.reverse?t+1:t-1,c=i.current[r];return o({},e,{config:b(e.config||a.config,t),attach:c&&function(){return c}})}))}}),[e,a.reverse]);return c.useEffect((function(){n.current&&!r&&p(t)})),c.useEffect((function(){n.current=!0}),[]),r?[u,p,d]:u},t.useTransition=function(e,t,n){var r=o({items:e,keys:t||function(e){return e}},n),i=$(r),s=i.lazy,u=void 0!==s&&s,l=(i.unique,i.reset),d=void 0!==l&&l,p=(i.enter,i.leave,i.update,i.onDestroyed),m=(i.keys,i.items,i.onFrame),h=i.onRest,g=i.onStart,v=i.ref,y=a(i,["lazy","unique","reset","enter","leave","update","onDestroyed","keys","items","onFrame","onRest","onStart","ref"]),O=f(),j=c.useRef(!1),E=c.useRef({mounted:!1,first:!0,deleted:[],current:{},transitions:[],prevProps:{},paused:!!r.ref,instances:!j.current&&new Map,forceUpdate:O});return c.useImperativeHandle(r.ref,(function(){return{start:function(){return Promise.all(Array.from(E.current.instances).map((function(e){var t=e[1];return new Promise((function(e){return t.start(e)}))})))},stop:function(e){return Array.from(E.current.instances).forEach((function(t){return t[1].stop(e)}))},get controllers(){return Array.from(E.current.instances).map((function(e){return e[1]}))}}})),E.current=function(e,t){for(var n=e.first,r=e.prevProps,c=a(e,["first","prevProps"]),i=$(t),s=i.items,u=i.keys,l=i.initial,f=i.from,d=i.enter,p=i.leave,m=i.update,h=i.trail,g=void 0===h?0:h,v=i.unique,y=i.config,O=i.order,j=void 0===O?["enter","leave","update"]:O,E=$(r),w=E.keys,_=E.items,S=o({},c.current),k=[].concat(c.deleted),R=Object.keys(S),P=new Set(R),x=new Set(u),C=u.filter((function(e){return!P.has(e)})),A=c.transitions.filter((function(e){return!e.destroyed&&!x.has(e.originalKey)})).map((function(e){return e.originalKey})),N=u.filter((function(e){return P.has(e)})),T=-g;j.length;)switch(j.shift()){case"enter":C.forEach((function(e,t){v&&k.find((function(t){return t.originalKey===e}))&&(k=k.filter((function(t){return t.originalKey!==e})));var r=u.indexOf(e),o=s[r],a=n&&void 0!==l?"initial":"enter";S[e]={slot:a,originalKey:e,key:v?String(e):G++,item:o,trail:T+=g,config:b(y,o,a),from:b(n&&void 0!==l?l||{}:f,o),to:b(d,o)}}));break;case"leave":A.forEach((function(e){var t=w.indexOf(e),n=_[t];k.unshift(o({},S[e],{slot:"leave",destroyed:!0,left:w[Math.max(0,t-1)],right:w[Math.min(w.length,t+1)],trail:T+=g,config:b(y,n,"leave"),to:b(p,n)})),delete S[e]}));break;case"update":N.forEach((function(e){var t=u.indexOf(e),n=s[t];S[e]=o({},S[e],{item:n,slot:"update",trail:T+=g,config:b(y,n,"update"),to:b(m,n)})}))}var M=u.map((function(e){return S[e]}));return k.forEach((function(e){var t,n=e.left,r=(e.right,a(e,["left","right"]));-1!==(t=M.findIndex((function(e){return e.originalKey===n})))&&(t+=1),t=Math.max(0,t),M=[].concat(M.slice(0,t),[r],M.slice(t))})),o({},c,{changed:C.length||A.length||N.length,first:n&&0===C.length,transitions:M,current:S,deleted:k,prevProps:t})}(E.current,r),E.current.changed&&E.current.transitions.forEach((function(e){var t=e.slot,n=e.from,r=e.to,a=e.config,c=e.trail,i=e.key,s=e.item;E.current.instances.has(i)||E.current.instances.set(i,new z);var l=E.current.instances.get(i),f=o({},y,{to:r,from:n,config:a,ref:v,onRest:function(n){E.current.mounted&&(e.destroyed&&(v||u||K(E,i),p&&p(s)),!Array.from(E.current.instances).some((function(e){return!e[1].idle}))&&(v||u)&&E.current.deleted.length>0&&K(E),h&&h(s,t,n))},onStart:g&&function(){return g(s,t)},onFrame:m&&function(e){return m(s,t,e)},delay:c,reset:d&&"enter"===t});l.update(f),E.current.paused||l.start()})),c.useEffect((function(){return E.current.mounted=j.current=!0,function(){E.current.mounted=j.current=!1,Array.from(E.current.instances).map((function(e){return e[1].destroy()})),E.current.instances.clear()}}),[]),E.current.transitions.map((function(e){var t=e.item,n=e.slot,r=e.key;return{item:t,key:r,state:n,props:E.current.instances.get(r).getValues()}}))},t.useChain=function(e,t,n){void 0===n&&(n=1e3);var r=c.useRef();c.useEffect((function(){l.equ(e,r.current)?e.forEach((function(e){var t=e.current;return t&&t.start()})):t?e.forEach((function(e,r){var a=e.current;if(a){var c=a.controllers;if(c.length){var i=n*t[r];c.forEach((function(e){e.queue=e.queue.map((function(e){return o({},e,{delay:e.delay+i})})),e.start()}))}}})):e.reduce((function(e,t,n){var r=t.current;return e.then((function(){return r.start()}))}),Promise.resolve()),r.current=e}))},t.useSprings=W},function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(11),o=n(0),a=n(8),c=n(100),i=function(){var e=Object(c.a)(),t=Object(r.useDispatch)(a.CART_STORE_KEY).selectShippingRate;return{selectShippingRate:Object(o.useCallback)((function(n,r){t(n,r).catch((function(t){e(t)}))}),[e,t]),isSelectingRate:Object(r.useSelect)((function(e){return e(a.CART_STORE_KEY).isShippingRateBeingSelected()}),[])}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return m}));var r=function(e){for(var t,n=0,r=0,o=e.length;o>=4;++r,o-=4)t=1540483477*(65535&(t=255&e.charCodeAt(r)|(255&e.charCodeAt(++r))<<8|(255&e.charCodeAt(++r))<<16|(255&e.charCodeAt(++r))<<24))+(59797*(t>>>16)<<16),n=1540483477*(65535&(t^=t>>>24))+(59797*(t>>>16)<<16)^1540483477*(65535&n)+(59797*(n>>>16)<<16);switch(o){case 3:n^=(255&e.charCodeAt(r+2))<<16;case 2:n^=(255&e.charCodeAt(r+1))<<8;case 1:n=1540483477*(65535&(n^=255&e.charCodeAt(r)))+(59797*(n>>>16)<<16)}return(((n=1540483477*(65535&(n^=n>>>13))+(59797*(n>>>16)<<16))^n>>>15)>>>0).toString(36)},o={animationIterationCount:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},a=n(177),c=/[A-Z]|^ms/g,i=/_EMO_([^_]+?)_([^]*?)_EMO_/g,s=function(e){return 45===e.charCodeAt(1)},u=function(e){return null!=e&&"boolean"!=typeof e},l=Object(a.a)((function(e){return s(e)?e:e.replace(c,"-$&").toLowerCase()})),f=function(e,t){switch(e){case"animation":case"animationName":if("string"==typeof t)return t.replace(i,(function(e,t,n){return p={name:t,styles:n,next:p},t}))}return 1===o[e]||s(e)||"number"!=typeof t||0===t?t:t+"px"};function d(e,t,n,r){if(null==n)return"";if(void 0!==n.__emotion_styles)return n;switch(typeof n){case"boolean":return"";case"object":if(1===n.anim)return p={name:n.name,styles:n.styles,next:p},n.name;if(void 0!==n.styles){var o=n.next;if(void 0!==o)for(;void 0!==o;)p={name:o.name,styles:o.styles,next:p},o=o.next;return n.styles+";"}return function(e,t,n){var r="";if(Array.isArray(n))for(var o=0;o<n.length;o++)r+=d(e,t,n[o],!1);else for(var a in n){var c=n[a];if("object"!=typeof c)null!=t&&void 0!==t[c]?r+=a+"{"+t[c]+"}":u(c)&&(r+=l(a)+":"+f(a,c)+";");else if(!Array.isArray(c)||"string"!=typeof c[0]||null!=t&&void 0!==t[c[0]]){var i=d(e,t,c,!1);switch(a){case"animation":case"animationName":r+=l(a)+":"+i+";";break;default:r+=a+"{"+i+"}"}}else for(var s=0;s<c.length;s++)u(c[s])&&(r+=l(a)+":"+f(a,c[s])+";")}return r}(e,t,n);case"function":if(void 0!==e){var a=p,c=n(e);return p=a,d(e,t,c,r)}}if(null==t)return n;var i=t[n];return void 0===i||r?n:i}var p,b=/label:\s*([^\s;\n{]+)\s*;/g,m=function(e,t,n){if(1===e.length&&"object"==typeof e[0]&&null!==e[0]&&void 0!==e[0].styles)return e[0];var o=!0,a="";p=void 0;var c=e[0];null==c||void 0===c.raw?(o=!1,a+=d(n,t,c,!1)):a+=c[0];for(var i=1;i<e.length;i++)a+=d(n,t,e[i],46===a.charCodeAt(a.length-1)),o&&(a+=c[i]);b.lastIndex=0;for(var s,u="";null!==(s=b.exec(a));)u+="-"+s[1];return{name:r(a)+u,styles:a,next:p}}},,function(e,t,n){"use strict";function r(e,t,n){var r="";return n.split(" ").forEach((function(n){void 0!==e[n]?t.push(e[n]):r+=n+" "})),r}n.d(t,"a",(function(){return r})),n.d(t,"b",(function(){return o}));var o=function(e,t,n){var r=e.key+"-"+t.name;if(!1===n&&void 0===e.registered[r]&&(e.registered[r]=t.styles),void 0===e.inserted[t.name]){var o=t;do{e.insert("."+r,o,e.sheet,!0),o=o.next}while(void 0!==o)}}},,,function(e,t,n){"use strict";var r=n(4),o=n.n(r),a=n(3),c=n(177),i=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|download|draggable|encType|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|inert|itemProp|itemScope|itemType|itemID|itemRef|on|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,s=Object(c.a)((function(e){return i.test(e)||111===e.charCodeAt(0)&&110===e.charCodeAt(1)&&e.charCodeAt(2)<91})),u=n(141),l=n(121),f=n(119),d=s,p=function(e){return"theme"!==e&&"innerRef"!==e},b=function(e){return"string"==typeof e&&e.charCodeAt(0)>96?d:p};function m(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function h(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?m(n,!0).forEach((function(t){o()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):m(n).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}t.a=function e(t,n){var r,o,c;void 0!==n&&(r=n.label,c=n.target,o=t.__emotion_forwardProp&&n.shouldForwardProp?function(e){return t.__emotion_forwardProp(e)&&n.shouldForwardProp(e)}:n.shouldForwardProp);var i=t.__emotion_real===t,s=i&&t.__emotion_base||t;"function"!=typeof o&&i&&(o=t.__emotion_forwardProp);var d=o||b(s),p=!d("as");return function(){var m=arguments,g=i&&void 0!==t.__emotion_styles?t.__emotion_styles.slice(0):[];if(void 0!==r&&g.push("label:"+r+";"),null==m[0]||void 0===m[0].raw)g.push.apply(g,m);else{g.push(m[0][0]);for(var v=m.length,y=1;y<v;y++)g.push(m[y],m[0][y])}var O=Object(u.c)((function(e,t,n){return Object(a.createElement)(u.a.Consumer,null,(function(r){var i=p&&e.as||s,u="",m=[],h=e;if(null==e.theme){for(var v in h={},e)h[v]=e[v];h.theme=r}"string"==typeof e.className?u=Object(l.a)(t.registered,m,e.className):null!=e.className&&(u=e.className+" ");var y=Object(f.a)(g.concat(m),t.registered,h);Object(l.b)(t,y,"string"==typeof i),u+=t.key+"-"+y.name,void 0!==c&&(u+=" "+c);var O=p&&void 0===o?b(i):d,j={};for(var E in e)p&&"as"===E||O(E)&&(j[E]=e[E]);return j.className=u,j.ref=n||e.innerRef,Object(a.createElement)(i,j)}))}));return O.displayName=void 0!==r?r:"Styled("+("string"==typeof s?s:s.displayName||s.name||"Component")+")",O.defaultProps=t.defaultProps,O.__emotion_real=O,O.__emotion_base=s,O.__emotion_styles=g,O.__emotion_forwardProp=o,Object.defineProperty(O,"toString",{value:function(){return"."+c}}),O.withComponent=function(t,r){return e(t,void 0!==r?h({},n||{},{},r):n).apply(void 0,g)},O}}},function(e,t,n){"use strict";function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function o(e){return function(e){if(Array.isArray(e))return e}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return a(e,void 0);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?a(e,void 0):void 0}}(e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function a(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var c={normalizePrecision:function(e){var t=e.reduce((function(e,t){return Math.max(e.getPrecision(),t.getPrecision())}));return e.map((function(e){return e.getPrecision()!==t?e.convertPrecision(t):e}))},minimum:function(e){var t=o(e),n=t[0],r=t.slice(1),a=n;return r.forEach((function(e){a=a.lessThan(e)?a:e})),a},maximum:function(e){var t=o(e),n=t[0],r=t.slice(1),a=n;return r.forEach((function(e){a=a.greaterThan(e)?a:e})),a}};function i(e){return!isNaN(parseInt(e))&&isFinite(e)}function s(e){return e%2==0}function u(e){return i(e)&&!Number.isInteger(e)}function l(e){return Math.abs(e)%1==.5}function f(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};for(var n in t)e.setRequestHeader(n,t[n]);return e}function d(e){return void 0===e}function p(){var e={HALF_ODD:function(e){var t=Math.round(e);return l(e)&&s(t)?t-1:t},HALF_EVEN:function(e){var t=Math.round(e);return l(e)?s(t)?t:t-1:t},HALF_UP:function(e){return Math.round(e)},HALF_DOWN:function(e){return l(e)?Math.floor(e):Math.round(e)},HALF_TOWARDS_ZERO:function(e){return l(e)?Math.sign(e)*Math.floor(Math.abs(e)):Math.round(e)},HALF_AWAY_FROM_ZERO:function(e){return l(e)?Math.sign(e)*Math.ceil(Math.abs(e)):Math.round(e)},DOWN:function(e){return Math.floor(e)}};return{add:function(e,t){return e+t},subtract:function(e,t){return e-t},multiply:function(e,t){return u(e)||u(t)?function(e,t){var n=function(e){return Math.pow(10,function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=e.toString();if(t.indexOf("e-")>0)return parseInt(t.split("e-")[1]);var n=t.split(".")[1];return n?n.length:0}(e))},r=Math.max(n(e),n(t));return Math.round(e*r)*Math.round(t*r)/(r*r)}(e,t):e*t},divide:function(e,t){return e/t},modulo:function(e,t){return e%t},round:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"HALF_EVEN";return e[n](t)}}}var b=p();function m(e){var t=/^(?:(\$|USD)?0(?:(,)0)?(\.)?(0+)?|0(?:(,)0)?(\.)?(0+)?\s?(dollar)?)$/gm.exec(e);return{getMatches:function(){return null!==t?t.slice(1).filter((function(e){return!d(e)})):[]},getMinimumFractionDigits:function(){var e=function(e){return"."===e};return d(this.getMatches().find(e))?0:this.getMatches()[b.add(this.getMatches().findIndex(e),1)].split("").length},getCurrencyDisplay:function(){return{USD:"code",dollar:"name",$:"symbol"}[this.getMatches().find((function(e){return"USD"===e||"dollar"===e||"$"===e}))]},getStyle:function(){return d(this.getCurrencyDisplay(this.getMatches()))?"decimal":"currency"},getUseGrouping:function(){return!d(this.getMatches().find((function(e){return","===e})))}}}function h(e){var t=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1?arguments[1]:void 0;for(var n in t)e=e.replace("{{".concat(n,"}}"),t[n]);return e};return{getExchangeRate:function(n,o){return(a=e.endpoint,!Boolean(a)||"object"!==r(a)&&"function"!=typeof a||"function"!=typeof a.then?function(n,r){return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return new Promise((function(n,r){var o=Object.assign(new XMLHttpRequest,{onreadystatechange:function(){4===o.readyState&&(o.status>=200&&o.status<400?n(JSON.parse(o.responseText)):r(new Error(o.statusText)))},onerror:function(){r(new Error("Network error"))}});o.open("GET",e,!0),f(o,t.headers),o.send()}))}(t(e.endpoint,{from:n,to:r}),{headers:e.headers})}(n,o):e.endpoint).then((function(a){return function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:".",o={};return Object.entries(t).forEach((function(t){if("object"===r(t[1])){var a=e(t[1]);Object.entries(a).forEach((function(e){o[t[0]+n+e[0]]=e[1]}))}else o[t[0]]=t[1]})),o}(a)[t(e.propertyPath,{from:n,to:o})]}));var a}}}function g(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Error;if(!e)throw new n(t)}function v(e){g(function(e){return i(e)&&e<=100&&e>=0}(e),"You must provide a numeric value between 0 and 100.",RangeError)}function y(e){g(Number.isInteger(e),"You must provide an integer.",TypeError)}var O=p(),j=Object.assign((function e(t){var n=Object.assign({},{amount:e.defaultAmount,currency:e.defaultCurrency,precision:e.defaultPrecision},t),r=n.amount,o=n.currency,a=n.precision;y(r),y(a);var c=e.globalLocale,i=e.globalFormat,s=e.globalRoundingMode,u=e.globalFormatRoundingMode,l=Object.assign({},e.globalExchangeRatesApi),f=function(t){var n=Object.assign({},Object.assign({},{amount:r,currency:o,precision:a},t),Object.assign({},{locale:this.locale},t));return Object.assign(e({amount:n.amount,currency:n.currency,precision:n.precision}),{locale:n.locale})},p=function(e){g(this.hasSameCurrency(e),"You must provide a Dinero instance with the same currency.",TypeError)};return{getAmount:function(){return r},getCurrency:function(){return o},getLocale:function(){return this.locale||c},setLocale:function(e){return f.call(this,{locale:e})},getPrecision:function(){return a},convertPrecision:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:u;return y(e),f.call(this,{amount:O.round(O.multiply(this.getAmount(),Math.pow(10,O.subtract(e,this.getPrecision()))),t),precision:e})},add:function(t){p.call(this,t);var n=e.normalizePrecision([this,t]);return f.call(this,{amount:O.add(n[0].getAmount(),n[1].getAmount()),precision:n[0].getPrecision()})},subtract:function(t){p.call(this,t);var n=e.normalizePrecision([this,t]);return f.call(this,{amount:O.subtract(n[0].getAmount(),n[1].getAmount()),precision:n[0].getPrecision()})},multiply:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:s;return f.call(this,{amount:O.round(O.multiply(this.getAmount(),e),t)})},divide:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:s;return f.call(this,{amount:O.round(O.divide(this.getAmount(),e),t)})},percentage:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:s;return v(e),this.multiply(O.divide(e,100),t)},allocate:function(e){var t=this;!function(e){g(function(e){return e.length>0&&e.every((function(e){return e>=0}))&&e.some((function(e){return e>0}))}(e),"You must provide a non-empty array of numeric values greater than 0.",TypeError)}(e);for(var n=e.reduce((function(e,t){return O.add(e,t)})),r=this.getAmount(),o=e.map((function(e){var o=Math.floor(O.divide(O.multiply(t.getAmount(),e),n));return r=O.subtract(r,o),f.call(t,{amount:o})})),a=0;r>0;)e[a]>0&&(o[a]=o[a].add(f.call(this,{amount:1})),r=O.subtract(r,1)),a+=1;return o},convert:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=n.endpoint,o=void 0===r?l.endpoint:r,a=n.propertyPath,c=void 0===a?l.propertyPath||"rates.{{to}}":a,i=n.headers,u=void 0===i?l.headers:i,p=n.roundingMode,b=void 0===p?s:p,m=Object.assign({},{endpoint:o,propertyPath:c,headers:u,roundingMode:b});return h(m).getExchangeRate(this.getCurrency(),e).then((function(n){return g(!d(n),'No rate was found for the destination currency "'.concat(e,'".'),TypeError),f.call(t,{amount:O.round(O.multiply(t.getAmount(),parseFloat(n)),m.roundingMode),currency:e})}))},equalsTo:function(e){return this.hasSameAmount(e)&&this.hasSameCurrency(e)},lessThan:function(t){p.call(this,t);var n=e.normalizePrecision([this,t]);return n[0].getAmount()<n[1].getAmount()},lessThanOrEqual:function(t){p.call(this,t);var n=e.normalizePrecision([this,t]);return n[0].getAmount()<=n[1].getAmount()},greaterThan:function(t){p.call(this,t);var n=e.normalizePrecision([this,t]);return n[0].getAmount()>n[1].getAmount()},greaterThanOrEqual:function(t){p.call(this,t);var n=e.normalizePrecision([this,t]);return n[0].getAmount()>=n[1].getAmount()},isZero:function(){return 0===this.getAmount()},isPositive:function(){return this.getAmount()>=0},isNegative:function(){return this.getAmount()<0},hasSubUnits:function(){return 0!==O.modulo(this.getAmount(),Math.pow(10,a))},hasCents:function(){return 0!==O.modulo(this.getAmount(),Math.pow(10,a))},hasSameCurrency:function(e){return this.getCurrency()===e.getCurrency()},hasSameAmount:function(t){var n=e.normalizePrecision([this,t]);return n[0].getAmount()===n[1].getAmount()},toFormat:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:i,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:u,n=m(e);return this.toRoundedUnit(n.getMinimumFractionDigits(),t).toLocaleString(this.getLocale(),{currencyDisplay:n.getCurrencyDisplay(),useGrouping:n.getUseGrouping(),minimumFractionDigits:n.getMinimumFractionDigits(),style:n.getStyle(),currency:this.getCurrency()})},toUnit:function(){return O.divide(this.getAmount(),Math.pow(10,a))},toRoundedUnit:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:u,n=Math.pow(10,e);return O.divide(O.round(O.multiply(this.toUnit(),n),t),n)},toObject:function(){return{amount:r,currency:o,precision:a}},toJSON:function(){return this.toObject()}}}),{defaultAmount:0,defaultCurrency:"USD",defaultPrecision:2},{globalLocale:"en-US",globalFormat:"$0,0.00",globalRoundingMode:"HALF_EVEN",globalFormatRoundingMode:"HALF_AWAY_FROM_ZERO",globalExchangeRatesApi:{endpoint:void 0,headers:void 0,propertyPath:void 0}},c);t.a=j},function(e,t,n){"use strict";var r=n(3),o=n.n(r);function a(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function c(){return(c=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function i(e){return(i=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function s(e,t){return(s=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function u(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function l(){}function f(){}f.resetWarningCache=l;var d=function(e,t){return function(e){e.exports=function(){function e(e,t,n,r,o,a){if("SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"!==a){var c=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw c.name="Invariant Violation",c}}function t(){return e}e.isRequired=e;var n={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:f,resetWarningCache:l};return n.PropTypes=n,n}()}(t={exports:{}}),t.exports}();function p(){}function b(e){return!!(e||"").match(/\d/)}function m(e){return null==e}function h(e){return e.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&")}function g(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n="-"===e[0],r=n&&t,o=(e=e.replace("-","")).split("."),a=o[0],c=o[1]||"";return{beforeDecimal:a,afterDecimal:c,hasNagation:n,addNegation:r}}function v(e,t,n){for(var r="",o=n?"0":"",a=0;a<=t-1;a++)r+=e[a]||o;return r}function y(e,t){if(e.value=e.value,null!==e){if(e.createTextRange){var n=e.createTextRange();return n.move("character",t),n.select(),!0}return e.selectionStart||0===e.selectionStart?(e.focus(),e.setSelectionRange(t,t),!0):(e.focus(),!1)}}function O(e,t,n){return Math.min(Math.max(e,t),n)}function j(e){return Math.max(e.selectionStart,e.selectionEnd)}var E={thousandSeparator:d.oneOfType([d.string,d.oneOf([!0])]),decimalSeparator:d.string,allowedDecimalSeparators:d.arrayOf(d.string),thousandsGroupStyle:d.oneOf(["thousand","lakh","wan"]),decimalScale:d.number,fixedDecimalScale:d.bool,displayType:d.oneOf(["input","text"]),prefix:d.string,suffix:d.string,format:d.oneOfType([d.string,d.func]),removeFormatting:d.func,mask:d.oneOfType([d.string,d.arrayOf(d.string)]),value:d.oneOfType([d.number,d.string]),defaultValue:d.oneOfType([d.number,d.string]),isNumericString:d.bool,customInput:d.elementType,allowNegative:d.bool,allowEmptyFormatting:d.bool,allowLeadingZeros:d.bool,onValueChange:d.func,onKeyDown:d.func,onMouseUp:d.func,onChange:d.func,onFocus:d.func,onBlur:d.func,type:d.oneOf(["text","tel","password"]),isAllowed:d.func,renderText:d.func,getInputRef:d.oneOfType([d.func,d.shape({current:d.any})])},w={displayType:"input",decimalSeparator:".",thousandsGroupStyle:"thousand",fixedDecimalScale:!1,prefix:"",suffix:"",allowNegative:!0,allowEmptyFormatting:!1,allowLeadingZeros:!1,isNumericString:!1,type:"text",onValueChange:p,onChange:p,onKeyDown:p,onMouseUp:p,onFocus:p,onBlur:p,isAllowed:function(){return!0}},_=function(e){function t(e){var n,r;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),n=!(r=i(t).call(this,e))||"object"!=typeof r&&"function"!=typeof r?u(this):r;var o=e.defaultValue;n.validateProps();var a=n.formatValueProp(o);return n.state={value:a,numAsString:n.removeFormatting(a)},n.selectionBeforeInput={selectionStart:0,selectionEnd:0},n.onChange=n.onChange.bind(u(n)),n.onKeyDown=n.onKeyDown.bind(u(n)),n.onMouseUp=n.onMouseUp.bind(u(n)),n.onFocus=n.onFocus.bind(u(n)),n.onBlur=n.onBlur.bind(u(n)),n}var n,r;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&s(e,t)}(t,e),n=t,(r=[{key:"componentDidUpdate",value:function(e){this.updateValueIfRequired(e)}},{key:"componentWillUnmount",value:function(){clearTimeout(this.focusTimeout)}},{key:"updateValueIfRequired",value:function(e){var t=this.props,n=this.state,r=this.focusedElm,o=n.value,a=n.numAsString,c=void 0===a?"":a;if(e!==t){this.validateProps();var i=this.formatNumString(c),s=m(t.value)?i:this.formatValueProp(),u=this.removeFormatting(s),l=parseFloat(u),f=parseFloat(c);(isNaN(l)&&isNaN(f)||l===f)&&i===o&&(null!==r||s===o)||this.updateValue({formattedValue:s,numAsString:u,input:r})}}},{key:"getFloatString",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=this.props.decimalScale,n=this.getSeparators(),r=n.decimalSeparator,o=this.getNumberRegex(!0),a="-"===e[0];a&&(e=e.replace("-","")),r&&0===t&&(e=e.split(r)[0]);var c=(e=(e.match(o)||[]).join("").replace(r,".")).indexOf(".");return-1!==c&&(e="".concat(e.substring(0,c),".").concat(e.substring(c+1,e.length).replace(new RegExp(h(r),"g"),""))),a&&(e="-"+e),e}},{key:"getNumberRegex",value:function(e,t){var n=this.props,r=n.format,o=n.decimalScale,a=this.getSeparators().decimalSeparator;return new RegExp("\\d"+(!a||0===o||t||r?"":"|"+h(a)),e?"g":void 0)}},{key:"getSeparators",value:function(){var e=this.props.decimalSeparator,t=this.props,n=t.thousandSeparator,r=t.allowedDecimalSeparators;return!0===n&&(n=","),r||(r=[e,"."]),{decimalSeparator:e,thousandSeparator:n,allowedDecimalSeparators:r}}},{key:"getMaskAtIndex",value:function(e){var t=this.props.mask,n=void 0===t?" ":t;return"string"==typeof n?n:n[e]||" "}},{key:"getValueObject",value:function(e,t){var n=parseFloat(t);return{formattedValue:e,value:t,floatValue:isNaN(n)?void 0:n}}},{key:"validateProps",value:function(){var e=this.props.mask,t=this.getSeparators(),n=t.decimalSeparator,r=t.thousandSeparator;if(n===r)throw new Error("\n          Decimal separator can't be same as thousand separator.\n          thousandSeparator: ".concat(r,' (thousandSeparator = {true} is same as thousandSeparator = ",")\n          decimalSeparator: ').concat(n," (default value for decimalSeparator is .)\n       "));if(e&&("string"===e?e:e.toString()).match(/\d/g))throw new Error("\n          Mask ".concat(e," should not contain numeric character;\n        "))}},{key:"setPatchedCaretPosition",value:function(e,t,n){y(e,t),setTimeout((function(){e.value===n&&y(e,t)}),0)}},{key:"correctCaretPosition",value:function(e,t,n){var r=this.props,o=r.prefix,a=r.suffix,c=r.format;if(""===e)return 0;if(t=O(t,0,e.length),!c){var i="-"===e[0];return O(t,o.length+(i?1:0),e.length-a.length)}if("function"==typeof c)return t;if("#"===c[t]&&b(e[t]))return t;if("#"===c[t-1]&&b(e[t-1]))return t;var s=c.indexOf("#");t=O(t,s,c.lastIndexOf("#")+1);for(var u=c.substring(t,c.length).indexOf("#"),l=t,f=t+(-1===u?0:u);l>s&&("#"!==c[l]||!b(e[l]));)l-=1;return!b(e[f])||"left"===n&&t!==s||t-l<f-t?b(e[l])?l+1:l:f}},{key:"getCaretPosition",value:function(e,t,n){var r,o,a=this.props.format,c=this.state.value,i=this.getNumberRegex(!0),s=(e.match(i)||[]).join(""),u=(t.match(i)||[]).join("");for(r=0,o=0;o<n;o++){var l=e[o]||"",f=t[r]||"";if((l.match(i)||l===f)&&("0"!==l||!f.match(i)||"0"===f||s.length===u.length)){for(;l!==t[r]&&r<t.length;)r++;r++}}return"string"!=typeof a||c||(r=t.length),this.correctCaretPosition(t,r)}},{key:"removePrefixAndSuffix",value:function(e){var t=this.props,n=t.format,r=t.prefix,o=t.suffix;if(!n&&e){var a="-"===e[0];a&&(e=e.substring(1,e.length));var c=(e=r&&0===e.indexOf(r)?e.substring(r.length,e.length):e).lastIndexOf(o);e=o&&-1!==c&&c===e.length-o.length?e.substring(0,c):e,a&&(e="-"+e)}return e}},{key:"removePatternFormatting",value:function(e){for(var t=this.props.format.split("#").filter((function(e){return""!==e})),n=0,r="",o=0,a=t.length;o<=a;o++){var c=t[o]||"",i=o===a?e.length:e.indexOf(c,n);if(-1===i){r=e;break}r+=e.substring(n,i),n=i+c.length}return(r.match(/\d/g)||[]).join("")}},{key:"removeFormatting",value:function(e){var t=this.props,n=t.format,r=t.removeFormatting;return e?(n?e="string"==typeof n?this.removePatternFormatting(e):"function"==typeof r?r(e):(e.match(/\d/g)||[]).join(""):(e=this.removePrefixAndSuffix(e),e=this.getFloatString(e)),e):e}},{key:"formatWithPattern",value:function(e){for(var t=this.props.format,n=0,r=t.split(""),o=0,a=t.length;o<a;o++)"#"===t[o]&&(r[o]=e[n]||this.getMaskAtIndex(n),n+=1);return r.join("")}},{key:"formatAsNumber",value:function(e){var t=this.props,n=t.decimalScale,r=t.fixedDecimalScale,o=t.prefix,a=t.suffix,c=t.allowNegative,i=t.thousandsGroupStyle,s=this.getSeparators(),u=s.thousandSeparator,l=s.decimalSeparator,f=-1!==e.indexOf(".")||n&&r,d=g(e,c),p=d.beforeDecimal,b=d.afterDecimal,m=d.addNegation;return void 0!==n&&(b=v(b,n,r)),u&&(p=function(e,t,n){var r=function(e){switch(e){case"lakh":return/(\d+?)(?=(\d\d)+(\d)(?!\d))(\.\d+)?/g;case"wan":return/(\d)(?=(\d{4})+(?!\d))/g;case"thousand":default:return/(\d)(?=(\d{3})+(?!\d))/g}}(n),o=e.search(/[1-9]/);return o=-1===o?e.length:o,e.substring(0,o)+e.substring(o,e.length).replace(r,"$1"+t)}(p,u,i)),o&&(p=o+p),a&&(b+=a),m&&(p="-"+p),p+(f&&l||"")+b}},{key:"formatNumString",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=this.props,n=t.format,r=t.allowEmptyFormatting,o=e;return""!==e||r?"-"!==e||n?"string"==typeof n?this.formatWithPattern(o):"function"==typeof n?n(o):this.formatAsNumber(o):"-":""}},{key:"formatValueProp",value:function(e){var t=this.props,n=t.format,r=t.decimalScale,o=t.fixedDecimalScale,a=t.allowEmptyFormatting,c=this.props,i=c.value,s=c.isNumericString,u=!(i=m(i)?e:i)&&0!==i;return u&&a&&(i=""),u&&!a?"":("number"==typeof i&&(i=i.toString(),s=!0),"Infinity"===i&&s&&(i=""),s&&!n&&"number"==typeof r&&(i=function(e,t,n){if(-1!==["","-"].indexOf(e))return e;var r=-1!==e.indexOf(".")&&t,o=g(e),a=o.beforeDecimal,c=o.afterDecimal,i=o.hasNagation,s=parseFloat("0.".concat(c||"0")).toFixed(t).split("."),u=a.split("").reverse().reduce((function(e,t,n){return e.length>n?(Number(e[0])+Number(t)).toString()+e.substring(1,e.length):t+e}),s[0]),l=v(s[1]||"",Math.min(t,c.length),n),f=r?".":"";return"".concat(i?"-":"").concat(u).concat(f).concat(l)}(i,r,o)),s?this.formatNumString(i):this.formatInput(i))}},{key:"formatNegation",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=this.props.allowNegative,n=new RegExp("(-)"),r=new RegExp("(-)(.)*(-)"),o=n.test(e),a=r.test(e);return e=e.replace(/-/g,""),o&&!a&&t&&(e="-"+e),e}},{key:"formatInput",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=this.props.format;return t||(e=this.removePrefixAndSuffix(e),e=this.formatNegation(e)),e=this.removeFormatting(e),this.formatNumString(e)}},{key:"isCharacterAFormat",value:function(e,t){var n=this.props,r=n.format,o=n.prefix,a=n.suffix,c=n.decimalScale,i=n.fixedDecimalScale,s=this.getSeparators().decimalSeparator;return"string"==typeof r&&"#"!==r[e]||!(r||!(e<o.length||e>=t.length-a.length||c&&i&&t[e]===s))}},{key:"checkIfFormatGotDeleted",value:function(e,t,n){for(var r=e;r<t;r++)if(this.isCharacterAFormat(r,n))return!0;return!1}},{key:"correctInputValue",value:function(e,t,n){var r=this.props,o=r.format,a=r.allowNegative,c=r.prefix,i=r.suffix,s=r.decimalScale,u=this.getSeparators(),l=u.allowedDecimalSeparators,f=u.decimalSeparator,d=this.state.numAsString||"",p=this.selectionBeforeInput,b=p.selectionStart,m=p.selectionEnd,h=function(e,t){for(var n=0,r=0,o=e.length,a=t.length;e[n]===t[n]&&n<o;)n++;for(;e[o-1-r]===t[a-1-r]&&a-r>n&&o-r>n;)r++;return{start:n,end:o-r}}(t,n),v=h.start,y=h.end;if(!o&&v===y&&-1!==l.indexOf(n[b])){var O=0===s?"":f;return n.substr(0,b)+O+n.substr(b+1,n.length)}var j=o?0:c.length,E=t.length-(o?0:i.length);if(n.length>t.length||!n.length||v===y||0===b&&m===t.length||b===j&&m===E)return n;if(this.checkIfFormatGotDeleted(v,y,t)&&(n=t),!o){var w=this.removeFormatting(n),_=g(w,a),S=_.beforeDecimal,k=_.afterDecimal,R=_.addNegation,P=e<n.indexOf(f)+1;if(w.length<d.length&&P&&""===S&&!parseFloat(k))return R?"-":""}return n}},{key:"updateValue",value:function(e){var t=e.formattedValue,n=e.input,r=e.setCaretPosition,o=void 0===r||r,a=e.numAsString,c=e.caretPos,i=this.props.onValueChange,s=this.state.value;if(n)if(o){if(!c){var u=e.inputValue||n.value,l=j(n);n.value=t,c=this.getCaretPosition(u,t,l)}this.setPatchedCaretPosition(n,c,t)}else n.value=t;void 0===a&&(a=this.removeFormatting(t)),t!==s&&(this.setState({value:t,numAsString:a}),i(this.getValueObject(t,a)))}},{key:"onChange",value:function(e){var t=e.target,n=t.value,r=this.state,o=this.props,a=o.isAllowed,c=r.value||"",i=j(t);n=this.correctInputValue(i,c,n);var s=this.formatInput(n)||"",u=this.removeFormatting(s);a(this.getValueObject(s,u))||(s=c),this.updateValue({formattedValue:s,numAsString:u,inputValue:n,input:t}),o.onChange(e)}},{key:"onBlur",value:function(e){var t=this.props,n=this.state,r=t.format,o=t.onBlur,a=t.allowLeadingZeros,c=n.numAsString,i=n.value;if(this.focusedElm=null,clearTimeout(this.focusTimeout),!r){isNaN(parseFloat(c))&&(c=""),a||(c=function(e){if(!e)return e;var t="-"===e[0];t&&(e=e.substring(1,e.length));var n=e.split("."),r=n[0].replace(/^0+/,"")||"0",o=n[1]||"";return"".concat(t?"-":"").concat(r).concat(o?".".concat(o):"")}(c));var s=this.formatNumString(c);if(s!==i)return this.updateValue({formattedValue:s,numAsString:c,input:e.target,setCaretPosition:!1}),void o(e)}o(e)}},{key:"onKeyDown",value:function(e){var t,n=e.target,r=e.key,o=n.selectionStart,a=n.selectionEnd,c=n.value,i=void 0===c?"":c,s=this.props,u=s.decimalScale,l=s.fixedDecimalScale,f=s.prefix,d=s.suffix,p=s.format,b=s.onKeyDown,m=void 0!==u&&l,h=this.getNumberRegex(!1,m),g=new RegExp("-"),v="string"==typeof p;if(this.selectionBeforeInput={selectionStart:o,selectionEnd:a},"ArrowLeft"===r||"Backspace"===r?t=o-1:"ArrowRight"===r?t=o+1:"Delete"===r&&(t=o),void 0!==t&&o===a){var y=t,O=v?p.indexOf("#"):f.length,j=v?p.lastIndexOf("#")+1:i.length-d.length;if("ArrowLeft"===r||"ArrowRight"===r){var E="ArrowLeft"===r?"left":"right";y=this.correctCaretPosition(i,t,E)}else if("Delete"!==r||h.test(i[t])||g.test(i[t])){if("Backspace"===r&&!h.test(i[t]))if(o<=O+1&&"-"===i[0]&&void 0===p){var w=i.substring(1);this.updateValue({formattedValue:w,caretPos:y,input:n})}else if(!g.test(i[t])){for(;!h.test(i[y-1])&&y>O;)y--;y=this.correctCaretPosition(i,y,"left")}}else for(;!h.test(i[y])&&y<j;)y++;(y!==t||t<O||t>j)&&(e.preventDefault(),this.setPatchedCaretPosition(n,y,i)),e.isUnitTestRun&&this.setPatchedCaretPosition(n,y,i),b(e)}else b(e)}},{key:"onMouseUp",value:function(e){var t=e.target,n=t.selectionStart,r=t.selectionEnd,o=t.value,a=void 0===o?"":o;if(n===r){var c=this.correctCaretPosition(a,n);c!==n&&this.setPatchedCaretPosition(t,c,a)}this.props.onMouseUp(e)}},{key:"onFocus",value:function(e){var t=this;e.persist(),this.focusedElm=e.target,this.focusTimeout=setTimeout((function(){var n=e.target,r=n.selectionStart,o=n.selectionEnd,a=n.value,c=void 0===a?"":a,i=t.correctCaretPosition(c,r);i===r||0===r&&o===c.length||t.setPatchedCaretPosition(n,i,c),t.props.onFocus(e)}),0)}},{key:"render",value:function(){var e,t,n,r=this.props,a=r.type,i=r.displayType,s=r.customInput,u=r.renderText,l=r.getInputRef,f=r.format,d=this.state.value,p=(e=this.props,t=E,n={},Object.keys(e).forEach((function(r){t[r]||(n[r]=e[r])})),n),b=c({inputMode:function(e){return e||!(navigator.platform&&/iPhone|iPod/.test(navigator.platform))}(f)?"numeric":void 0},p,{type:a,value:d,onChange:this.onChange,onKeyDown:this.onKeyDown,onMouseUp:this.onMouseUp,onFocus:this.onFocus,onBlur:this.onBlur});if("text"===i)return u?u(d)||null:o.a.createElement("span",c({},p,{ref:l}),d);if(s){var m=s;return o.a.createElement(m,c({},b,{ref:l}))}return o.a.createElement("input",c({},b,{ref:l}))}}])&&a(n.prototype,r),t}(o.a.Component);_.propTypes=E,_.defaultProps=w,t.a=_},function(e,t,n){"use strict";n.d(t,"b",(function(){return y})),n.d(t,"a",(function(){return O}));var r=n(21),o=n.n(r),a=n(4),c=n.n(a),i=n(23),s=n.n(i),u=n(5),l=n.n(u),f=n(0),d=n(7),p=n(25),b=n.n(p);function m(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function h(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?m(Object(n),!0).forEach((function(t){c()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):m(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function g(e){var t=function(e,t){if("object"!==o()(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==o()(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===o()(t)?t:String(t)}var v=Object(f.createContext)({getValidationError:function(){return""},setValidationErrors:function(e){},clearValidationError:function(e){},clearAllValidationErrors:function(){},hideValidationError:function(){},showValidationError:function(){},showAllValidationErrors:function(){},hasValidationErrors:!1,getValidationErrorId:function(e){return e}}),y=function(){return Object(f.useContext)(v)},O=function(e){var t=e.children,n=Object(f.useState)({}),r=l()(n,2),o=r[0],a=r[1],i=Object(f.useCallback)((function(e){return o[e]}),[o]),u=Object(f.useCallback)((function(e){var t=o[e];return!t||t.hidden?"":"validate-error-".concat(e)}),[o]),p=Object(f.useCallback)((function(e){a((function(t){return t[e]?(t[e],s()(t,[e].map(g))):t}))}),[]),m=Object(f.useCallback)((function(){a({})}),[]),y=Object(f.useCallback)((function(e){e&&a((function(t){return e=Object(d.pickBy)(e,(function(e,n){return!("string"!=typeof e.message||t.hasOwnProperty(n)&&b()(t[n],e))})),0===Object.values(e).length?t:h(h({},t),e)}))}),[]),O=Object(f.useCallback)((function(e,t){a((function(n){if(!n.hasOwnProperty(e))return n;var r=h(h({},n[e]),t);return b()(n[e],r)?n:h(h({},n),{},c()({},e,r))}))}),[]),j={getValidationError:i,setValidationErrors:y,clearValidationError:p,clearAllValidationErrors:m,hideValidationError:Object(f.useCallback)((function(e){O(e,{hidden:!0})}),[O]),showValidationError:Object(f.useCallback)((function(e){O(e,{hidden:!1})}),[O]),showAllValidationErrors:Object(f.useCallback)((function(){a((function(e){var t={};return Object.keys(e).forEach((function(n){e[n].hidden&&(t[n]=h(h({},e[n]),{},{hidden:!1}))})),0===Object.values(t).length?e:h(h({},e),t)}))}),[]),hasValidationErrors:Object.keys(o).length>0,getValidationErrorId:u};return React.createElement(v.Provider,{value:j},t)}},function(e,t,n){"use strict";var r=n(0),o=n(8),a=n(11),c=n(83);t.a=function(e){return function(t){var n;return n=Object(r.useRef)(c.n.restApiRoutes||{}),Object(a.useSelect)((function(e,t){if(n.current){var r=e(o.SCHEMA_STORE_KEY),a=r.isResolving,c=r.hasFinishedResolution,i=t.dispatch(o.SCHEMA_STORE_KEY),s=i.receiveRoutes,u=i.startResolution,l=i.finishResolution;Object.keys(n.current).forEach((function(e){var t=n.current[e];a("getRoutes",[e])||c("getRoutes",[e])||(u("getRoutes",[e]),s(t,[e]),l("getRoutes",[e]))}))}}),[]),React.createElement(e,t)}}},,,,function(e,t,n){"use strict";n.d(t,"a",(function(){return s})),n.d(t,"b",(function(){return u}));var r=n(39),o=n.n(r),a=n(27),c=n.n(a),i=n(1),s=function(){var e=o()(c.a.mark((function e(t){var n;return c.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("function"!=typeof t.json){e.next=11;break}return e.prev=1,e.next=4,t.json();case 4:return n=e.sent,e.abrupt("return",{message:n.message,type:n.type||"api"});case 8:return e.prev=8,e.t0=e.catch(1),e.abrupt("return",{message:e.t0.message,type:"general"});case 11:return e.abrupt("return",{message:t.message,type:t.type||"general"});case 12:case"end":return e.stop()}}),e,null,[[1,8]])})));return function(_x){return e.apply(this,arguments)}}(),u=function(e){if(e.data&&"rest_invalid_param"===e.code){var t=Object.values(e.data.params);if(t[0])return t[0]}return(null==e?void 0:e.message)||Object(i.__)("Something went wrong. Please contact us to get assistance.",'woocommerce')}},,function(e,t,n){"use strict";(function(e){var r=n(0),o=n(7),a=n(6),c=n.n(a),i=n(33),s=n(1),u=(n(74),n(76));t.a=Object(r.forwardRef)((function(t,n){var a=t.className,l=t.children,f=t.spokenMessage,d=void 0===f?l:f,p=t.politeness,b=void 0===p?"polite":p,m=t.actions,h=void 0===m?[]:m,g=t.onRemove,v=void 0===g?o.noop:g;!function(e,t){var n="string"==typeof e?e:Object(r.renderToString)(e);Object(r.useEffect)((function(){n&&Object(i.speak)(n,t)}),[n,t])}(d,b),Object(r.useEffect)((function(){var e=setTimeout((function(){v()}),1e4);return function(){return clearTimeout(e)}}),[]);var y=c()(a,"components-snackbar");return h&&h.length>1&&(void 0!==e&&e.env,h=[h[0]]),Object(r.createElement)("div",{ref:n,className:y,onClick:v,tabIndex:"0",role:"button",onKeyPress:v,"aria-label":Object(s.__)("Dismiss this notice")},Object(r.createElement)("div",{className:"components-snackbar__content"},l,h.map((function(e,t){var n=e.label,o=e.onClick,a=e.url;return Object(r.createElement)(u.a,{key:t,href:a,isTertiary:!0,onClick:function(e){e.stopPropagation(),o&&o(e)},className:"components-snackbar__action"},n)}))))}))}).call(this,n(102))},function(e,t){e.exports=window.wp.plugins},,function(e,t,n){"use strict";n.d(t,"a",(function(){return a})),n.d(t,"c",(function(){return c})),n.d(t,"b",(function(){return i}));var r,o=window.CustomEvent||null,a=function(e,t){var n=t.bubbles,r=void 0!==n&&n,a=t.cancelable,c=void 0!==a&&a,i=t.element,s=t.detail,u=void 0===s?{}:s;if(o){i||(i=document.body);var l=new o(e,{bubbles:r,cancelable:c,detail:u});i.dispatchEvent(l)}},c=function(){r&&clearTimeout(r),r=setTimeout((function(){a("wc_fragment_refresh",{bubbles:!0,cancelable:!0})}),50)},i=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if("function"!=typeof jQuery)return function(){};var o=function(){a(t,{bubbles:n,cancelable:r})};return jQuery(document).on(e,o),function(){return jQuery(document).off(e,o)}}},function(e,t,n){"use strict";n(180),t.a=function(){return React.createElement("span",{className:"wc-block-components-spinner","aria-hidden":"true"})}},,function(e,t,n){"use strict";var r=n(4),o=n.n(r),a=n(1),c=n(69),i=n(6),s=n.n(i),u=(n(10),n(58)),l=n(0),f=(n(183),function(e){var t=e.currency,n=e.maxPrice,r=e.minPrice,o=e.priceClassName,i=e.priceStyle;return React.createElement(React.Fragment,null,React.createElement("span",{className:"screen-reader-text"},Object(a.sprintf)(
/* translators: %1$s min price, %2$s max price */
Object(a.__)("Price between %1$s and %2$s",'woocommerce'),Object(u.formatPrice)(r),Object(u.formatPrice)(n))),React.createElement("span",{"aria-hidden":!0},React.createElement(c.a,{className:s()("wc-block-components-product-price__value",o),currency:t,value:r,style:i})," — ",React.createElement(c.a,{className:s()("wc-block-components-product-price__value",o),currency:t,value:n,style:i})))}),d=function(e){var t=e.currency,n=e.regularPriceClassName,r=e.regularPriceStyle,o=e.regularPrice,i=e.priceClassName,u=e.priceStyle,l=e.price;return React.createElement(React.Fragment,null,React.createElement("span",{className:"screen-reader-text"},Object(a.__)("Previous price:",'woocommerce')),React.createElement(c.a,{currency:t,renderText:function(e){return React.createElement("del",{className:s()("wc-block-components-product-price__regular",n),style:r},e)},value:o}),React.createElement("span",{className:"screen-reader-text"},Object(a.__)("Discounted price:",'woocommerce')),React.createElement(c.a,{currency:t,renderText:function(e){return React.createElement("ins",{className:s()("wc-block-components-product-price__value","is-discounted",i),style:u},e)},value:l}))};t.a=function(e){var t=e.align,n=e.className,r=e.currency,a=e.format,i=void 0===a?"<price/>":a,u=e.maxPrice,p=void 0===u?null:u,b=e.minPrice,m=void 0===b?null:b,h=e.price,g=void 0===h?null:h,v=e.priceClassName,y=e.priceStyle,O=e.regularPrice,j=e.regularPriceClassName,E=e.regularPriceStyle,w=s()(n,"price","wc-block-components-product-price",o()({},"wc-block-components-product-price--align-".concat(t),t));i.includes("<price/>")||(i="<price/>",console.error("Price formats need to include the `<price/>` tag."));var _=O&&g!==O,S=React.createElement("span",{className:s()("wc-block-components-product-price__value",v)});return _?S=React.createElement(d,{currency:r,price:g,priceClassName:v,priceStyle:y,regularPrice:O,regularPriceClassName:j,regularPriceStyle:E}):null!==m&&null!==p?S=React.createElement(f,{currency:r,maxPrice:p,minPrice:m,priceClassName:v,priceStyle:y}):null!==g&&(S=React.createElement(c.a,{className:s()("wc-block-components-product-price__value",v),currency:r,value:g,style:y})),React.createElement("span",{className:w},Object(l.createInterpolateElement)(i,{price:S}))}},function(e,t,n){"use strict";n.d(t,"a",(function(){return d})),n.d(t,"c",(function(){return p})),n.d(t,"b",(function(){return b}));n(88);var r=n(3),o=function(){function e(e){this.isSpeedy=void 0===e.speedy||e.speedy,this.tags=[],this.ctr=0,this.nonce=e.nonce,this.key=e.key,this.container=e.container,this.before=null}var t=e.prototype;return t.insert=function(e){if(this.ctr%(this.isSpeedy?65e3:1)==0){var t,n=function(e){var t=document.createElement("style");return t.setAttribute("data-emotion",e.key),void 0!==e.nonce&&t.setAttribute("nonce",e.nonce),t.appendChild(document.createTextNode("")),t}(this);t=0===this.tags.length?this.before:this.tags[this.tags.length-1].nextSibling,this.container.insertBefore(n,t),this.tags.push(n)}var r=this.tags[this.tags.length-1];if(this.isSpeedy){var o=function(e){if(e.sheet)return e.sheet;for(var t=0;t<document.styleSheets.length;t++)if(document.styleSheets[t].ownerNode===e)return document.styleSheets[t]}(r);try{var a=105===e.charCodeAt(1)&&64===e.charCodeAt(0);o.insertRule(e,a?0:o.cssRules.length)}catch(e){}}else r.appendChild(document.createTextNode(e));this.ctr++},t.flush=function(){this.tags.forEach((function(e){return e.parentNode.removeChild(e)})),this.tags=[],this.ctr=0},e}(),a=function(e){function t(e,t,r){var o=t.trim().split(b);t=o;var a=o.length,c=e.length;switch(c){case 0:case 1:var i=0;for(e=0===c?"":e[0]+" ";i<a;++i)t[i]=n(e,t[i],r).trim();break;default:var s=i=0;for(t=[];i<a;++i)for(var u=0;u<c;++u)t[s++]=n(e[u]+" ",o[i],r).trim()}return t}function n(e,t,n){var r=t.charCodeAt(0);switch(33>r&&(r=(t=t.trim()).charCodeAt(0)),r){case 38:return t.replace(m,"$1"+e.trim());case 58:return e.trim()+t.replace(m,"$1"+e.trim());default:if(0<1*n&&0<t.indexOf("\f"))return t.replace(m,(58===e.charCodeAt(0)?"":"$1")+e.trim())}return e+t}function r(e,t,n,a){var c=e+";",i=2*t+3*n+4*a;if(944===i){e=c.indexOf(":",9)+1;var s=c.substring(e,c.length-1).trim();return s=c.substring(0,e).trim()+s+";",1===x||2===x&&o(s,1)?"-webkit-"+s+s:s}if(0===x||2===x&&!o(c,1))return c;switch(i){case 1015:return 97===c.charCodeAt(10)?"-webkit-"+c+c:c;case 951:return 116===c.charCodeAt(3)?"-webkit-"+c+c:c;case 963:return 110===c.charCodeAt(5)?"-webkit-"+c+c:c;case 1009:if(100!==c.charCodeAt(4))break;case 969:case 942:return"-webkit-"+c+c;case 978:return"-webkit-"+c+"-moz-"+c+c;case 1019:case 983:return"-webkit-"+c+"-moz-"+c+"-ms-"+c+c;case 883:if(45===c.charCodeAt(8))return"-webkit-"+c+c;if(0<c.indexOf("image-set(",11))return c.replace(S,"$1-webkit-$2")+c;break;case 932:if(45===c.charCodeAt(4))switch(c.charCodeAt(5)){case 103:return"-webkit-box-"+c.replace("-grow","")+"-webkit-"+c+"-ms-"+c.replace("grow","positive")+c;case 115:return"-webkit-"+c+"-ms-"+c.replace("shrink","negative")+c;case 98:return"-webkit-"+c+"-ms-"+c.replace("basis","preferred-size")+c}return"-webkit-"+c+"-ms-"+c+c;case 964:return"-webkit-"+c+"-ms-flex-"+c+c;case 1023:if(99!==c.charCodeAt(8))break;return"-webkit-box-pack"+(s=c.substring(c.indexOf(":",15)).replace("flex-","").replace("space-between","justify"))+"-webkit-"+c+"-ms-flex-pack"+s+c;case 1005:return d.test(c)?c.replace(f,":-webkit-")+c.replace(f,":-moz-")+c:c;case 1e3:switch(t=(s=c.substring(13).trim()).indexOf("-")+1,s.charCodeAt(0)+s.charCodeAt(t)){case 226:s=c.replace(y,"tb");break;case 232:s=c.replace(y,"tb-rl");break;case 220:s=c.replace(y,"lr");break;default:return c}return"-webkit-"+c+"-ms-"+s+c;case 1017:if(-1===c.indexOf("sticky",9))break;case 975:switch(t=(c=e).length-10,i=(s=(33===c.charCodeAt(t)?c.substring(0,t):c).substring(e.indexOf(":",7)+1).trim()).charCodeAt(0)+(0|s.charCodeAt(7))){case 203:if(111>s.charCodeAt(8))break;case 115:c=c.replace(s,"-webkit-"+s)+";"+c;break;case 207:case 102:c=c.replace(s,"-webkit-"+(102<i?"inline-":"")+"box")+";"+c.replace(s,"-webkit-"+s)+";"+c.replace(s,"-ms-"+s+"box")+";"+c}return c+";";case 938:if(45===c.charCodeAt(5))switch(c.charCodeAt(6)){case 105:return s=c.replace("-items",""),"-webkit-"+c+"-webkit-box-"+s+"-ms-flex-"+s+c;case 115:return"-webkit-"+c+"-ms-flex-item-"+c.replace(E,"")+c;default:return"-webkit-"+c+"-ms-flex-line-pack"+c.replace("align-content","").replace(E,"")+c}break;case 973:case 989:if(45!==c.charCodeAt(3)||122===c.charCodeAt(4))break;case 931:case 953:if(!0===_.test(e))return 115===(s=e.substring(e.indexOf(":")+1)).charCodeAt(0)?r(e.replace("stretch","fill-available"),t,n,a).replace(":fill-available",":stretch"):c.replace(s,"-webkit-"+s)+c.replace(s,"-moz-"+s.replace("fill-",""))+c;break;case 962:if(c="-webkit-"+c+(102===c.charCodeAt(5)?"-ms-"+c:"")+c,211===n+a&&105===c.charCodeAt(13)&&0<c.indexOf("transform",10))return c.substring(0,c.indexOf(";",27)+1).replace(p,"$1-webkit-$2")+c}return c}function o(e,t){var n=e.indexOf(1===t?":":"{"),r=e.substring(0,3!==t?n:10);return n=e.substring(n+1,e.length-1),T(2!==t?r:r.replace(w,"$1"),n,t)}function a(e,t){var n=r(t,t.charCodeAt(0),t.charCodeAt(1),t.charCodeAt(2));return n!==t+";"?n.replace(j," or ($1)").substring(4):"("+t+")"}function c(e,t,n,r,o,a,c,i,u,l){for(var f,d=0,p=t;d<N;++d)switch(f=A[d].call(s,e,p,n,r,o,a,c,i,u,l)){case void 0:case!1:case!0:case null:break;default:p=f}if(p!==t)return p}function i(e){return void 0!==(e=e.prefix)&&(T=null,e?"function"!=typeof e?x=1:(x=2,T=e):x=0),i}function s(e,n){var i=e;if(33>i.charCodeAt(0)&&(i=i.trim()),i=[i],0<N){var s=c(-1,n,i,i,R,k,0,0,0,0);void 0!==s&&"string"==typeof s&&(n=s)}var f=function e(n,i,s,f,d){for(var p,b,m,y,j,E=0,w=0,_=0,S=0,A=0,T=0,D=m=p=0,I=0,F=0,L=0,V=0,U=s.length,B=U-1,H="",q="",z="",W="";I<U;){if(b=s.charCodeAt(I),I===B&&0!==w+S+_+E&&(0!==w&&(b=47===w?10:47),S=_=E=0,U++,B++),0===w+S+_+E){if(I===B&&(0<F&&(H=H.replace(l,"")),0<H.trim().length)){switch(b){case 32:case 9:case 59:case 13:case 10:break;default:H+=s.charAt(I)}b=59}switch(b){case 123:for(p=(H=H.trim()).charCodeAt(0),m=1,V=++I;I<U;){switch(b=s.charCodeAt(I)){case 123:m++;break;case 125:m--;break;case 47:switch(b=s.charCodeAt(I+1)){case 42:case 47:e:{for(D=I+1;D<B;++D)switch(s.charCodeAt(D)){case 47:if(42===b&&42===s.charCodeAt(D-1)&&I+2!==D){I=D+1;break e}break;case 10:if(47===b){I=D+1;break e}}I=D}}break;case 91:b++;case 40:b++;case 34:case 39:for(;I++<B&&s.charCodeAt(I)!==b;);}if(0===m)break;I++}switch(m=s.substring(V,I),0===p&&(p=(H=H.replace(u,"").trim()).charCodeAt(0)),p){case 64:switch(0<F&&(H=H.replace(l,"")),b=H.charCodeAt(1)){case 100:case 109:case 115:case 45:F=i;break;default:F=C}if(V=(m=e(i,F,m,b,d+1)).length,0<N&&(j=c(3,m,F=t(C,H,L),i,R,k,V,b,d,f),H=F.join(""),void 0!==j&&0===(V=(m=j.trim()).length)&&(b=0,m="")),0<V)switch(b){case 115:H=H.replace(O,a);case 100:case 109:case 45:m=H+"{"+m+"}";break;case 107:m=(H=H.replace(h,"$1 $2"))+"{"+m+"}",m=1===x||2===x&&o("@"+m,3)?"@-webkit-"+m+"@"+m:"@"+m;break;default:m=H+m,112===f&&(q+=m,m="")}else m="";break;default:m=e(i,t(i,H,L),m,f,d+1)}z+=m,m=L=F=D=p=0,H="",b=s.charCodeAt(++I);break;case 125:case 59:if(1<(V=(H=(0<F?H.replace(l,""):H).trim()).length))switch(0===D&&(p=H.charCodeAt(0),45===p||96<p&&123>p)&&(V=(H=H.replace(" ",":")).length),0<N&&void 0!==(j=c(1,H,i,n,R,k,q.length,f,d,f))&&0===(V=(H=j.trim()).length)&&(H="\0\0"),p=H.charCodeAt(0),b=H.charCodeAt(1),p){case 0:break;case 64:if(105===b||99===b){W+=H+s.charAt(I);break}default:58!==H.charCodeAt(V-1)&&(q+=r(H,p,b,H.charCodeAt(2)))}L=F=D=p=0,H="",b=s.charCodeAt(++I)}}switch(b){case 13:case 10:47===w?w=0:0===1+p&&107!==f&&0<H.length&&(F=1,H+="\0"),0<N*M&&c(0,H,i,n,R,k,q.length,f,d,f),k=1,R++;break;case 59:case 125:if(0===w+S+_+E){k++;break}default:switch(k++,y=s.charAt(I),b){case 9:case 32:if(0===S+E+w)switch(A){case 44:case 58:case 9:case 32:y="";break;default:32!==b&&(y=" ")}break;case 0:y="\\0";break;case 12:y="\\f";break;case 11:y="\\v";break;case 38:0===S+w+E&&(F=L=1,y="\f"+y);break;case 108:if(0===S+w+E+P&&0<D)switch(I-D){case 2:112===A&&58===s.charCodeAt(I-3)&&(P=A);case 8:111===T&&(P=T)}break;case 58:0===S+w+E&&(D=I);break;case 44:0===w+_+S+E&&(F=1,y+="\r");break;case 34:case 39:0===w&&(S=S===b?0:0===S?b:S);break;case 91:0===S+w+_&&E++;break;case 93:0===S+w+_&&E--;break;case 41:0===S+w+E&&_--;break;case 40:if(0===S+w+E){if(0===p)switch(2*A+3*T){case 533:break;default:p=1}_++}break;case 64:0===w+_+S+E+D+m&&(m=1);break;case 42:case 47:if(!(0<S+E+_))switch(w){case 0:switch(2*b+3*s.charCodeAt(I+1)){case 235:w=47;break;case 220:V=I,w=42}break;case 42:47===b&&42===A&&V+2!==I&&(33===s.charCodeAt(V+2)&&(q+=s.substring(V,I+1)),y="",w=0)}}0===w&&(H+=y)}T=A,A=b,I++}if(0<(V=q.length)){if(F=i,0<N&&void 0!==(j=c(2,q,F,n,R,k,V,f,d,f))&&0===(q=j).length)return W+q+z;if(q=F.join(",")+"{"+q+"}",0!=x*P){switch(2!==x||o(q,2)||(P=0),P){case 111:q=q.replace(v,":-moz-$1")+q;break;case 112:q=q.replace(g,"::-webkit-input-$1")+q.replace(g,"::-moz-$1")+q.replace(g,":-ms-input-$1")+q}P=0}}return W+q+z}(C,i,n,0,0);return 0<N&&void 0!==(s=c(-2,f,i,i,R,k,f.length,0,0,0))&&(f=s),P=0,k=R=1,f}var u=/^\0+/g,l=/[\0\r\f]/g,f=/: */g,d=/zoo|gra/,p=/([,: ])(transform)/g,b=/,\r+?/g,m=/([\t\r\n ])*\f?&/g,h=/@(k\w+)\s*(\S*)\s*/,g=/::(place)/g,v=/:(read-only)/g,y=/[svh]\w+-[tblr]{2}/,O=/\(\s*(.*)\s*\)/g,j=/([\s\S]*?);/g,E=/-self|flex-/g,w=/[^]*?(:[rp][el]a[\w-]+)[^]*/,_=/stretch|:\s*\w+\-(?:conte|avail)/,S=/([^-])(image-set\()/,k=1,R=1,P=0,x=1,C=[],A=[],N=0,T=null,M=0;return s.use=function e(t){switch(t){case void 0:case null:N=A.length=0;break;default:if("function"==typeof t)A[N++]=t;else if("object"==typeof t)for(var n=0,r=t.length;n<r;++n)e(t[n]);else M=0|!!t}return e},s.set=i,void 0!==e&&i(e),s};function c(e){e&&i.current.insert(e+"}")}var i={current:null},s=function(e,t,n,r,o,a,s,u,l,f){switch(e){case 1:switch(t.charCodeAt(0)){case 64:return i.current.insert(t+";"),"";case 108:if(98===t.charCodeAt(2))return""}break;case 2:if(0===u)return t+"/*|*/";break;case 3:switch(u){case 102:case 112:return i.current.insert(n[0]+t),"";default:return t+(0===f?"/*|*/":"")}case-2:t.split("/*|*/}").forEach(c)}},u=(n(144),n(121)),l=n(119),f=(Object.prototype.hasOwnProperty,Object(r.createContext)("undefined"!=typeof HTMLElement?function(e){void 0===e&&(e={});var t,n=e.key||"css";void 0!==e.prefix&&(t={prefix:e.prefix});var r,c=new a(t),u={};r=e.container||document.head;var l,f=document.querySelectorAll("style[data-emotion-"+n+"]");Array.prototype.forEach.call(f,(function(e){e.getAttribute("data-emotion-"+n).split(" ").forEach((function(e){u[e]=!0})),e.parentNode!==r&&r.appendChild(e)})),c.use(e.stylisPlugins)(s),l=function(e,t,n,r){var o=t.name;i.current=n,c(e,t.styles),r&&(d.inserted[o]=!0)};var d={key:n,sheet:new o({key:n,container:r,nonce:e.nonce,speedy:e.speedy}),nonce:e.nonce,inserted:u,registered:{},insert:l};return d}():null)),d=Object(r.createContext)({}),p=(f.Provider,function(e){var t=function(t,n){return Object(r.createElement)(f.Consumer,null,(function(r){return e(t,r,n)}))};return Object(r.forwardRef)(t)}),b=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return Object(l.a)(t)},m=(r.Component,function e(t){for(var n=t.length,r=0,o="";r<n;r++){var a=t[r];if(null!=a){var c=void 0;switch(typeof a){case"boolean":break;case"object":if(Array.isArray(a))c=e(a);else for(var i in c="",a)a[i]&&i&&(c&&(c+=" "),c+=i);break;default:c=a}c&&(o&&(o+=" "),o+=c)}}return o});function h(e,t,n){var r=[],o=Object(u.a)(e,r,n);return r.length<2?n:o+t(r)}p((function(e,t){return Object(r.createElement)(d.Consumer,null,(function(n){var r=function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];var o=Object(l.a)(n,t.registered);return Object(u.b)(t,o,!1),t.key+"-"+o.name},o={css:r,cx:function(){for(var e=arguments.length,n=new Array(e),o=0;o<e;o++)n[o]=arguments[o];return h(t.registered,r,m(n))},theme:n};return e.children(o)}))}))},function(e,t){},function(e,t,n){"use strict";var r=n(14),o=n.n(r),a=n(23),c=n.n(a),i=n(76),s=n(6),u=n.n(s),l=n(138),f=(n(251),["className","showSpinner","children"]);t.a=function(e){var t=e.className,n=e.showSpinner,r=void 0!==n&&n,a=e.children,s=c()(e,f),d=u()("wc-block-components-button",t,{"wc-block-components-button--loading":r});return React.createElement(i.a,o()({className:d},s),r&&React.createElement(l.a,null),React.createElement("span",{className:"wc-block-components-button__text"},a))}},function(e,t,n){var r=n(71);e.exports=function(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,r(e,t)},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,n){"use strict";n.d(t,"b",(function(){return c})),n.d(t,"c",(function(){return i})),n.d(t,"a",(function(){return s}));var r=n(124),o=n(141),a={name:"8kj89b",styles:"flex-direction:row-reverse;"},c=Object(r.a)("div",{target:"eboqfv50",label:"Flex"})("box-sizing:border-box;display:flex;width:100%;",(function(e){var t=e.align,n={top:"flex-start",bottom:"flex-end"}[t]||t;return Object(o.b)({alignItems:n},"")})," ",(function(e){var t=e.justify,n=e.isReversed,r={left:"flex-start",right:"flex-end"},a=r[t]||t;return n&&r[t]&&(a="left"===t?r.right:r.left),Object(o.b)({justifyContent:a},"")})," ",(function(e){var t=e.gap,n=e.isReversed,r="number"==typeof t?4*t:4,a="margin-".concat(n?"left":"right");return Object(o.b)("> *{",a,":",r,"px;&:last-child{",a,":0;}}")})," ",(function(e){return e.isReversed?a:""}),""),i=Object(r.a)("div",{target:"eboqfv51",label:"Item"})({name:"13luw5d",styles:"box-sizing:border-box;min-width:0;max-width:100%;"}),s=Object(r.a)(i,{target:"eboqfv52",label:"Block"})({name:"1rr4qq7",styles:"flex:1;"})},function(e,t,n){"use strict";n.d(t,"a",(function(){return N}));var r=n(135),o=n(2),a=n(44),c=n(173),i=n(66),s=n(60),u=n(48),l=n(39),f=n.n(l),d=n(4),p=n.n(d),b=n(5),m=n.n(b),h=n(27),g=n.n(h),v=n(1),y=n(61),O=n.n(y),j=n(0),E=n(93),w=n(132),_=function(e,t,n){var r=Object.keys(e).map((function(t){return{key:t,value:e[t]}}),[]),o="wc-".concat(n,"-new-payment-method");return r.push({key:o,value:t}),r},S=function(e,t){O.a.setNonce&&"function"==typeof O.a.setNonce&&O.a.setNonce(e),null!=e&&e.get("X-WC-Store-API-User")&&t.setCustomerId(parseInt(e.get("X-WC-Store-API-User")||"0",10))},k=n(127),R=n(32),P=n(54);function x(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function C(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?x(Object(n),!0).forEach((function(t){p()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):x(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var A=function(){var e=Object(u.b)(),t=e.hasError,n=e.onCheckoutValidationBeforeProcessing,r=e.dispatchActions,o=e.redirectUrl,a=e.isProcessing,l=e.isBeforeProcessing,d=e.isComplete,p=e.orderNotes,b=e.shouldCreateAccount,h=e.extensionData,y=Object(k.b)().hasValidationErrors,x=Object(i.b)().shippingErrorStatus,A=Object(s.b)(),N=A.billingData,T=A.shippingAddress,M=Object(R.a)(),D=M.cartNeedsPayment,I=M.receiveCart,F=Object(c.b)(),L=F.activePaymentMethod,V=F.isExpressPaymentMethodActive,U=F.currentStatus,B=F.paymentMethodData,H=F.expressPaymentMethods,q=F.paymentMethods,z=F.shouldSavePayment,W=Object(P.a)(),G=W.addErrorNotice,Y=W.removeNotice,$=W.setIsSuppressed,K=Object(j.useRef)(N),X=Object(j.useRef)(T),Q=Object(j.useRef)(o),Z=Object(j.useState)(!1),J=m()(Z,2),ee=J[0],te=J[1],ne=Object(j.useMemo)((function(){var e,t=C(C({},H),q);return null==t||null===(e=t[L])||void 0===e?void 0:e.paymentMethodId}),[L,H,q]),re=y&&!V||U.hasError||x.hasError,oe=!t&&!re&&(U.isSuccessful||!D)&&a;Object(j.useEffect)((function(){$(V)}),[V,$]),Object(j.useEffect)((function(){re===t||!a&&!l||V||r.setHasError(re)}),[re,t,a,l,V,r]),Object(j.useEffect)((function(){K.current=N,X.current=T,Q.current=o}),[N,T,o]);var ae=Object(j.useCallback)((function(){return!y&&(U.hasError?{errorMessage:Object(v.__)("There was a problem with your payment option.",'woocommerce')}:!x.hasError||{errorMessage:Object(v.__)("There was a problem with your shipping option.",'woocommerce')})}),[y,U.hasError,x.hasError]);Object(j.useEffect)((function(){var e;return V||(e=n(ae,0)),function(){V||e()}}),[n,ae,V]),Object(j.useEffect)((function(){Q.current&&(window.location.href=Q.current)}),[d]);var ce=Object(j.useCallback)(f()(g.a.mark((function e(){var t,n;return g.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!ee){e.next=2;break}return e.abrupt("return");case 2:te(!0),Y("checkout"),t=D?{payment_method:ne,payment_data:_(B,z,L)}:{},n=C(C({billing_address:Object(E.a)(K.current),shipping_address:Object(E.a)(X.current),customer_note:p,should_create_account:b},t),{},{extensions:C({},h)}),O()({path:"/wc/store/checkout",method:"POST",data:n,cache:"no-store",parse:!1}).then((function(e){if(S(e.headers,r),!e.ok)throw new Error(e);return e.json()})).then((function(e){r.setAfterProcessing(e),te(!1)})).catch((function(e){S(e.headers,r),e.json().then((function(e){var t,n,o;null!==(t=e.data)&&void 0!==t&&t.cart&&I(e.data.cart),G(Object(w.b)(e),{id:"checkout"}),null===(n=e.additional_errors)||void 0===n||null===(o=n.forEach)||void 0===o||o.call(n,(function(e){G(e.message,{id:e.error_code})})),r.setHasError(!0),r.setAfterProcessing(e),te(!1)}))}));case 7:case"end":return e.stop()}}),e)}))),[ee,Y,p,b,D,ne,B,z,L,h,r,G,I]);return Object(j.useEffect)((function(){oe&&!ee&&ce()}),[ce,oe,ee]),null},N=function(e){var t=e.children,n=e.isCart,l=void 0!==n&&n,f=e.redirectUrl;return React.createElement(u.a,{redirectUrl:f,isCart:l},React.createElement(s.a,null,React.createElement(i.a,null,React.createElement(c.a,null,t,React.createElement(a.a,{renderError:o.CURRENT_USER_IS_ADMIN?null:function(){return null}},React.createElement(r.PluginArea,{scope:"woocommerce-checkout"})),React.createElement(A,null)))))}},function(e,t){},,function(e,t){},function(e,t,n){"use strict";var r=n(14),o=n.n(r),a=n(23),c=n.n(a),i=n(28),s=n(6),u=n.n(s),l=(n(182),["className","disabled","name","permalink"]);t.a=function(e){var t=e.className,n=void 0===t?"":t,r=e.disabled,a=void 0!==r&&r,s=e.name,f=e.permalink,d=void 0===f?"":f,p=c()(e,l),b=u()("wc-block-components-product-name",n);return a?React.createElement("span",o()({className:b},p,{dangerouslySetInnerHTML:{__html:Object(i.decodeEntities)(s)}})):React.createElement("a",o()({className:b,href:d},p,{dangerouslySetInnerHTML:{__html:Object(i.decodeEntities)(s)}}))}},function(e,t,n){"use strict";var r=n(0),o=n(113),a=n(97),c=function(e){var t=e.indexOf("</p>");return-1===t?e:e.substr(0,t+4)},i=function(e){return e.replace(/<\/?[a-z][^>]*?>/gi,"")},s=function(e,t){return e.replace(/[\s|\.\,]+$/i,"")+t},u=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"&hellip;",r=i(e),o=r.split(" ").splice(0,t).join(" ");return Object(a.autop)(s(o,n))},l=function(e,t){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"&hellip;",o=i(e),c=o.slice(0,t);if(n)return Object(a.autop)(s(c,r));var u=c.match(/([\s]+)/g),l=u?u.length:0,f=o.slice(0,t+l);return Object(a.autop)(s(f,r))};t.a=function(e){var t=e.source,n=e.maxLength,i=void 0===n?15:n,s=e.countType,f=void 0===s?"words":s,d=e.className,p=void 0===d?"":d,b=Object(r.useMemo)((function(){return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:15,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"words",r=Object(a.autop)(e),i=Object(o.count)(r,n);if(i<=t)return r;var s=c(r),f=Object(o.count)(s,n);return f<=t?s:"words"===n?u(s,t):l(s,t,"characters_including_spaces"===n)}(t,i,f)}),[t,i,f]);return React.createElement(r.RawHTML,{className:p},b)}},function(e,t,n){"use strict";var r=n(4),o=n.n(r),a=n(23),c=n.n(a),i=n(0),s=["srcElement","size"];function u(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}t.a=function(e){var t=e.srcElement,n=e.size,r=void 0===n?24:n,a=c()(e,s);return Object(i.isValidElement)(t)?Object(i.cloneElement)(t,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?u(Object(n),!0).forEach((function(t){o()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):u(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({width:r,height:r},a)):null}},function(e,t,n){"use strict";var r=n(0),o=n(7),a=n(6),c=n.n(a),i=n(1),s=n(33),u=n(116),l=n(76);t.a=function(e){var t=e.className,n=e.status,a=void 0===n?"info":n,f=e.children,d=e.spokenMessage,p=void 0===d?f:d,b=e.onRemove,m=void 0===b?o.noop:b,h=e.isDismissible,g=void 0===h||h,v=e.actions,y=void 0===v?[]:v,O=e.politeness,j=void 0===O?function(e){switch(e){case"success":case"warning":case"info":return"polite";case"error":default:return"assertive"}}(a):O,E=e.__unstableHTML;!function(e,t){var n="string"==typeof e?e:Object(r.renderToString)(e);Object(r.useEffect)((function(){n&&Object(s.speak)(n,t)}),[n,t])}(p,j);var w=c()(t,"components-notice","is-"+a,{"is-dismissible":g});return E&&(f=Object(r.createElement)(r.RawHTML,null,f)),Object(r.createElement)("div",{className:w},Object(r.createElement)("div",{className:"components-notice__content"},f,y.map((function(e,t){var n=e.className,o=e.label,a=e.isPrimary,i=e.noDefaultClasses,s=void 0!==i&&i,u=e.onClick,f=e.url;return Object(r.createElement)(l.a,{key:t,href:f,isPrimary:a,isSecondary:!s&&!f,isLink:!s&&!!f,onClick:f?void 0:u,className:c()("components-notice__action",n)},o)}))),g&&Object(r.createElement)(l.a,{className:"components-notice__dismiss",icon:u.a,label:Object(i.__)("Dismiss this notice"),onClick:m,showTooltip:!1}))}},,function(e,t,n){"use strict";var r=n(21),o=n.n(r),a=n(1),c=n(33),i=n(6),s=n.n(i),u=n(0),l=n(50),f=n(49);n(190),t.a=function(e){var t=e.className,n=e.quantity,r=void 0===n?1:n,i=e.minimum,d=void 0===i?1:i,p=e.maximum,b=e.onChange,m=void 0===b?function(){}:b,h=e.itemName,g=void 0===h?"":h,v=e.disabled,y=s()("wc-block-components-quantity-selector",t),O=void 0!==p,j=r>d,E=!O||r<p,w=Object(u.useCallback)((function(e){var t=void 0!==o()(e.key)?"ArrowDown"===e.key:e.keyCode===l.DOWN,n=void 0!==o()(e.key)?"ArrowUp"===e.key:e.keyCode===l.UP;t&&j&&(e.preventDefault(),m(r-1)),n&&E&&(e.preventDefault(),m(r+1))}),[r,m,E,j]);return React.createElement("div",{className:y},React.createElement("input",{className:"wc-block-components-quantity-selector__input",disabled:v,type:"number",step:"1",min:"0",value:r,onKeyDown:w,onChange:function(e){var t=Object(f.a)(e.target.value)&&e.target.value?parseInt(e.target.value,10):0;O&&(t=Math.min(t,p)),(t=Math.max(t,d))!==r&&m(t)},"aria-label":Object(a.sprintf)(
/* translators: %s refers to the item name in the cart. */
Object(a.__)("Quantity of %s in your cart.",'woocommerce'),g)}),React.createElement("button",{"aria-label":Object(a.__)("Reduce quantity",'woocommerce'),className:"wc-block-components-quantity-selector__button wc-block-components-quantity-selector__button--minus",disabled:v||!j,onClick:function(){var e=r-1;m(e),Object(c.speak)(Object(a.sprintf)(
/* translators: %s refers to the item name in the cart. */
Object(a.__)("Quantity reduced to %s.",'woocommerce'),e))}},"-"),React.createElement("button",{"aria-label":Object(a.__)("Increase quantity",'woocommerce'),disabled:v||!E,className:"wc-block-components-quantity-selector__button wc-block-components-quantity-selector__button--plus",onClick:function(){var e=r+1;m(e),Object(c.speak)(Object(a.sprintf)(
/* translators: %s refers to the item name in the cart. */
Object(a.__)("Quantity increased to %s.",'woocommerce'),e))}},"+"))}},,,,,,,,,,,,,,,,,function(e,t,n){"use strict";var r=n(46),o=n.n(r),a=n(1),c=n(0),i=n(23),s=n.n(i),u=n(6),l=n.n(u),f=n(33),d=n(155),p=n(140),b=n(150),m=n(278),h=n(52),g=n(32),v=n(266),y=n(267),O=n(268),j=n(279),E=n(269),w=n(58),_=n(26),S=n(125),k=n(49),R=n(2),P=["receiveCart"],x=function(e,t){return e.convertPrecision(t.minorUnit).getAmount()},C=function(e){return Object(_.mustContain)(e,"<price/>")},A=Object(c.forwardRef)((function(e,t){var n=e.lineItem,r=e.onRemove,o=void 0===r?function(){}:r,i=e.tabIndex,u=void 0===i?null:i,A=n.name,N=void 0===A?"":A,T=n.catalog_visibility,M=void 0===T?"visible":T,D=n.short_description,I=void 0===D?"":D,F=n.description,L=void 0===F?"":F,V=n.low_stock_remaining,U=void 0===V?null:V,B=n.show_backorder_badge,H=void 0!==B&&B,q=n.quantity_limit,z=void 0===q?99:q,W=n.permalink,G=void 0===W?"":W,Y=n.images,$=void 0===Y?[]:Y,K=n.variation,X=void 0===K?[]:K,Q=n.item_data,Z=void 0===Q?[]:Q,J=n.prices,ee=void 0===J?{currency_code:"USD",currency_minor_unit:2,currency_symbol:"$",currency_prefix:"$",currency_suffix:"",currency_decimal_separator:".",currency_thousand_separator:",",price:"0",regular_price:"0",sale_price:"0",price_range:null,raw_prices:{precision:6,price:"0",regular_price:"0",sale_price:"0"}}:J,te=n.totals,ne=void 0===te?{currency_code:"USD",currency_minor_unit:2,currency_symbol:"$",currency_prefix:"$",currency_suffix:"",currency_decimal_separator:".",currency_thousand_separator:",",line_subtotal:"0",line_subtotal_tax:"0"}:te,re=n.extensions,oe=Object(m.a)(n),ae=oe.quantity,ce=oe.setItemQuantity,ie=oe.removeItem,se=oe.isPendingDelete,ue=Object(h.a)().dispatchStoreEvent,le=Object(g.a)(),fe=(le.receiveCart,s()(le,P)),de=Object(c.useMemo)((function(){return{context:"cart",cartItem:n,cart:fe}}),[n,fe]),pe=Object(w.getCurrencyFromPriceResponse)(ee),be=Object(_.__experimentalApplyCheckoutFilter)({filterName:"itemName",defaultValue:N,extensions:re,arg:de}),me=Object(S.a)({amount:parseInt(ee.raw_prices.regular_price,10),precision:ee.raw_prices.precision}),he=Object(S.a)({amount:parseInt(ee.raw_prices.price,10),precision:ee.raw_prices.precision}),ge=me.subtract(he),ve=ge.multiply(ae),ye=Object(w.getCurrencyFromPriceResponse)(ne),Oe=parseInt(ne.line_subtotal,10);Object(R.getSetting)("displayCartPricesIncludingTax",!1)&&(Oe+=parseInt(ne.line_subtotal_tax,10));var je=Object(S.a)({amount:Oe,precision:ye.minorUnit}),Ee=$.length?$[0]:{},we="hidden"===M||"search"===M,_e=Object(_.__experimentalApplyCheckoutFilter)({filterName:"cartItemPrice",defaultValue:"<price/>",extensions:re,arg:de,validation:C}),Se=Object(_.__experimentalApplyCheckoutFilter)({filterName:"subtotalPriceFormat",defaultValue:"<price/>",extensions:re,arg:de,validation:C}),ke=Object(_.__experimentalApplyCheckoutFilter)({filterName:"saleBadgePriceFormat",defaultValue:"<price/>",extensions:re,arg:de,validation:C});return React.createElement("tr",{className:l()("wc-block-cart-items__row",{"is-disabled":se}),ref:t,tabIndex:u},React.createElement("td",{className:"wc-block-cart-item__image","aria-hidden":!Object(k.d)(Ee,"alt")||!Ee.alt},we?React.createElement(v.a,{image:Ee}):React.createElement("a",{href:G,tabIndex:-1},React.createElement(v.a,{image:Ee}))),React.createElement("td",{className:"wc-block-cart-item__product"},React.createElement(b.a,{disabled:se||we,name:be,permalink:G}),H?React.createElement(y.a,null):!!U&&React.createElement(O.a,{lowStockRemaining:U}),React.createElement("div",{className:"wc-block-cart-item__prices"},React.createElement(p.a,{currency:pe,regularPrice:x(me,pe),price:x(he,pe),format:Se})),React.createElement(j.a,{currency:pe,saleAmount:x(ge,pe),format:ke}),React.createElement(E.a,{shortDescription:I,fullDescription:L,itemData:Z,variation:X}),React.createElement("div",{className:"wc-block-cart-item__quantity"},React.createElement(d.a,{disabled:se,quantity:ae,maximum:z,onChange:function(e){ce(e),ue("cart-set-item-quantity",{product:n,quantity:e})},itemName:be}),React.createElement("button",{className:"wc-block-cart-item__remove-link",onClick:function(){o(),ie(),ue("cart-remove-item",{product:n,quantity:ae}),Object(f.speak)(Object(a.sprintf)(
/* translators: %s refers to the item name in the cart. */
Object(a.__)("%s has been removed from your cart.",'woocommerce'),be))},disabled:se},Object(a.__)("Remove item",'woocommerce')))),React.createElement("td",{className:"wc-block-cart-item__total"},React.createElement("div",{className:"wc-block-cart-item__total-price-and-sale-badge-wrapper"},React.createElement(p.a,{currency:ye,format:_e,price:je.getAmount()}),ae>1&&React.createElement(j.a,{currency:pe,saleAmount:x(ve,pe),format:ke}))))})),N=o()(Array(3)).map((function(_x,e){return React.createElement(A,{lineItem:{},key:e})})),T=function(e){var t={};return e.forEach((function(e){var n=e.key;t[n]=Object(c.createRef)()})),t};t.a=function(e){var t=e.lineItems,n=void 0===t?[]:t,r=e.isLoading,o=void 0!==r&&r,i=Object(c.useRef)(null),s=Object(c.useRef)(T(n));Object(c.useEffect)((function(){s.current=T(n)}),[n]);var u=function(e){return function(){null!=s&&s.current&&e&&s.current[e].current instanceof HTMLElement?s.current[e].current.focus():i.current instanceof HTMLElement&&i.current.focus()}},l=o?N:n.map((function(e,t){var r=n.length>t+1?n[t+1].key:null;return React.createElement(A,{key:e.key,lineItem:e,onRemove:u(r),ref:s.current[e.key],tabIndex:-1})}));return React.createElement("table",{className:"wc-block-cart-items",ref:i,tabIndex:-1},React.createElement("thead",null,React.createElement("tr",{className:"wc-block-cart-items__header"},React.createElement("th",{className:"wc-block-cart-items__header-image"},React.createElement("span",null,Object(a.__)("Product",'woocommerce'))),React.createElement("th",{className:"wc-block-cart-items__header-product"},React.createElement("span",null,Object(a.__)("Details",'woocommerce'))),React.createElement("th",{className:"wc-block-cart-items__header-total"},React.createElement("span",null,Object(a.__)("Total",'woocommerce'))))),React.createElement("tbody",null,l))}},function(e,t,n){"use strict";n.d(t,"b",(function(){return J})),n.d(t,"a",(function(){return ee}));var r,o,a=n(46),c=n.n(a),i=n(5),s=n.n(i),u=n(0);!function(e){e.PRISTINE="pristine",e.STARTED="started",e.PROCESSING="processing",e.ERROR="has_error",e.FAILED="failed",e.SUCCESS="success",e.COMPLETE="complete"}(r||(r={})),function(e){e.SET_REGISTERED_PAYMENT_METHODS="set_registered_payment_methods",e.SET_REGISTERED_EXPRESS_PAYMENT_METHODS="set_registered_express_payment_methods",e.SET_SHOULD_SAVE_PAYMENT_METHOD="set_should_save_payment_method"}(o||(o={}));var l={currentStatus:r.PRISTINE,shouldSavePaymentMethod:!1,paymentMethodData:{payment_method:""},hasSavedToken:!1,errorMessage:"",paymentMethods:{},expressPaymentMethods:{}},f={setPaymentStatus:function(){return{pristine:function(){},started:function(){},processing:function(){},completed:function(){},error:function(e){},failed:function(e,t){},success:function(e,t){}}},currentStatus:{isPristine:!0,isStarted:!1,isProcessing:!1,isFinished:!1,hasError:!1,hasFailed:!1,isSuccessful:!1,isDoingExpressPayment:!1},paymentStatuses:r,paymentMethodData:{},errorMessage:"",activePaymentMethod:"",setActivePaymentMethod:function(){},activeSavedToken:"",setActiveSavedToken:function(){},customerPaymentMethods:{},paymentMethods:{},expressPaymentMethods:{},paymentMethodsInitialized:!1,expressPaymentMethodsInitialized:!1,onPaymentProcessing:function(){return function(){return function(){}}},setExpressPaymentError:function(){},isExpressPaymentMethodActive:!1,setShouldSavePayment:function(){},shouldSavePayment:!1},d=n(4),p=n.n(d),b=n(21),m=n.n(b);function h(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function g(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?h(Object(n),!0).forEach((function(t){p()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):h(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var v=function(e){return!("object"!==m()(e)||!e.isSavedToken)},y=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:l,t=arguments.length>1?arguments[1]:void 0,n=t.type,a=t.paymentMethodData,c=t.shouldSavePaymentMethod,i=void 0!==c&&c,s=t.errorMessage,u=void 0===s?"":s,f=t.paymentMethods,d=void 0===f?{}:f;switch(n){case r.STARTED:return g(g({},e),{},{currentStatus:r.STARTED,paymentMethodData:a||e.paymentMethodData,hasSavedToken:v(a||e.paymentMethodData)});case r.ERROR:return e.currentStatus!==r.ERROR?g(g({},e),{},{currentStatus:r.ERROR,errorMessage:u||e.errorMessage}):e;case r.FAILED:return e.currentStatus!==r.FAILED?g(g({},e),{},{currentStatus:r.FAILED,paymentMethodData:a||e.paymentMethodData,errorMessage:u||e.errorMessage}):e;case r.SUCCESS:return e.currentStatus!==r.SUCCESS?g(g({},e),{},{currentStatus:r.SUCCESS,paymentMethodData:a||e.paymentMethodData,hasSavedToken:v(a||e.paymentMethodData)}):e;case r.PROCESSING:return e.currentStatus!==r.PROCESSING?g(g({},e),{},{currentStatus:r.PROCESSING,errorMessage:""}):e;case r.COMPLETE:return e.currentStatus!==r.COMPLETE?g(g({},e),{},{currentStatus:r.COMPLETE}):e;case r.PRISTINE:return g(g({},l),{},{currentStatus:r.PRISTINE,paymentMethods:g({},e.paymentMethods),expressPaymentMethods:g({},e.expressPaymentMethods),shouldSavePaymentMethod:e.shouldSavePaymentMethod});case o.SET_REGISTERED_PAYMENT_METHODS:return g(g({},e),{},{paymentMethods:d});case o.SET_REGISTERED_EXPRESS_PAYMENT_METHODS:return g(g({},e),{},{expressPaymentMethods:d});case o.SET_SHOULD_SAVE_PAYMENT_METHOD:return g(g({},e),{},{shouldSavePaymentMethod:i})}},O=n(39),j=n.n(O),E=n(27),w=n.n(E),_=n(1),S=n(38),k=n(53),R=n(2),P=n(82),x=n(36),C=n(66),A=n(60),N=n(32),T=n(54),M=n(35);function D(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function I(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?D(Object(n),!0).forEach((function(t){p()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):D(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var F=function(e,t,n,r){var o=Object(u.useState)(!1),a=s()(o,2),c=a[0],i=a[1],l=Object(x.a)().isEditor,f=Object(C.b)().selectedRates,d=Object(A.b)(),b=d.billingData,h=d.shippingAddress,g=Object(k.a)(f),v=Object(k.a)(n),y=Object(N.a)(),O=y.cartTotals,E=y.cartNeedsShipping,S=y.paymentRequirements,M=Object(u.useRef)({cart:y,cartTotals:O,cartNeedsShipping:E,billingData:b,shippingAddress:h,selectedShippingMethods:g,paymentRequirements:S}),D=Object(T.a)().addErrorNotice;Object(u.useEffect)((function(){M.current={cart:y,cartTotals:O,cartNeedsShipping:E,billingData:b,shippingAddress:h,selectedShippingMethods:g,paymentRequirements:S}}),[y,O,E,b,h,g,S]);var F=Object(u.useCallback)(j()(w.a.mark((function n(){var o,a,c,s,u,f,d;return w.a.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:o={},a=function(e){o=I(I({},o),{},p()({},e.name,e))},c=0;case 3:if(!(c<v.length)){n.next=29;break}if(s=v[c],u=t[s]){n.next=8;break}return n.abrupt("continue",26);case 8:if(n.prev=8,!l){n.next=13;break}n.t0=!0,n.next=16;break;case 13:return n.next=15,Promise.resolve(u.canMakePayment(M.current));case 15:n.t0=n.sent;case 16:if(!(f=n.t0)){n.next=21;break}if("object"!==m()(f)||null===f||!f.error){n.next=20;break}throw new Error(f.error.message);case 20:a(u);case 21:n.next=26;break;case 23:n.prev=23,n.t1=n.catch(8),(R.CURRENT_USER_IS_ADMIN||l)&&(d=Object(_.sprintf)(
/* translators: %s the id of the payment method being registered (bank transfer, Stripe...) */
Object(_.__)("There was an error registering the payment method with id '%s': ",'woocommerce'),u.paymentMethodId),D("".concat(d," ").concat(n.t1),{context:r,id:"wc-".concat(u.paymentMethodId,"-registration-error")}));case 26:c++,n.next=3;break;case 29:e(o),i(!0);case 31:case"end":return n.stop()}}),n,null,[[8,23]])}))),[D,e,l,r,v,t]),L=Object(P.a)(F,500),V=s()(L,1)[0];return Object(u.useEffect)((function(){V()}),[V,y,g,b]),c},L=function(e){return{type:e}},V=function(e){return{type:r.ERROR,errorMessage:e}},U=function(e){var t=e.errorMessage,n=e.paymentMethodData;return{type:r.FAILED,errorMessage:t,paymentMethodData:n}},B=function(e){var t=e.paymentMethodData;return{type:r.SUCCESS,paymentMethodData:t}},H=function(e){var t=e.paymentMethodData;return{type:r.STARTED,paymentMethodData:t}},q=function(e){return{type:o.SET_REGISTERED_PAYMENT_METHODS,paymentMethods:e}},z=function(e){return{type:o.SET_REGISTERED_EXPRESS_PAYMENT_METHODS,paymentMethods:e}},W=function(e){return{type:o.SET_SHOULD_SAVE_PAYMENT_METHOD,shouldSavePaymentMethod:e}},G=n(52),Y=n(48),$=n(98),K=n(191),X=n(193),Q=n(127),Z=Object(u.createContext)(f),J=function(){return Object(u.useContext)(Z)},ee=function(e){var t,n=e.children,o=Object(Y.b)(),a=o.isProcessing,i=o.isIdle,f=o.isCalculating,d=o.hasError,p=Object(x.a)(),b=p.isEditor,h=p.getPreviewData,g=Object(Q.b)().setValidationErrors,v=Object(T.a)(),O=v.addErrorNotice,j=v.removeNotice,E=Object(M.c)(),w=E.isSuccessResponse,_=E.isErrorResponse,k=E.isFailResponse,P=E.noticeContexts,N=Object(u.useReducer)($.b,{}),D=s()(N,2),I=D[0],J=(t=D[1],Object(u.useMemo)((function(){return{onPaymentProcessing:Object(K.a)("payment_processing",t)}}),[t])).onPaymentProcessing,ee=Object(u.useRef)(I);Object(u.useEffect)((function(){ee.current=I}),[I]);var te,ne,re,oe=Object(u.useReducer)(y,l),ae=s()(oe,2),ce=ae[0],ie=(te=ae[1],ne=Object(A.b)().setBillingData,re=Object(C.b)().setShippingAddress,{dispatchActions:Object(u.useMemo)((function(){return{setRegisteredPaymentMethods:function(e){te(q(e))},setRegisteredExpressPaymentMethods:function(e){te(z(e))},setShouldSavePayment:function(e){te(W(e))}}}),[te]),setPaymentStatus:Object(u.useCallback)((function(){return{pristine:function(){return te(L(r.PRISTINE))},started:function(e){te(H({paymentMethodData:e}))},processing:function(){return te(L(r.PROCESSING))},completed:function(){return te(L(r.COMPLETE))},error:function(e){return te(V(e))},failed:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;n&&ne(n),te(U({errorMessage:e||"",paymentMethodData:t||{}}))},success:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;t&&ne(t),void 0!==m()(n)&&null!=n&&n.address&&re(n.address),te(B({paymentMethodData:e}))}}}),[te,ne,re])}),se=ie.dispatchActions,ue=ie.setPaymentStatus,le=function(e){var t=Object(S.getPaymentMethods)(),n=Object(M.c)().noticeContexts,r=new Set([].concat(c()(Object(R.getSetting)("paymentGatewaySortOrder",[])),c()(Object.keys(t))));return F(e,t,Array.from(r),n.PAYMENTS)}(se.setRegisteredPaymentMethods),fe=function(e){var t=Object(S.getExpressPaymentMethods)(),n=Object(M.c)().noticeContexts;return F(e,t,Object.keys(t),n.EXPRESS_PAYMENTS)}(se.setRegisteredExpressPaymentMethods),de=function(){var e=Object(G.a)().dispatchCheckoutEvent,t=Object(u.useState)(""),n=s()(t,2),r=n[0],o=n[1],a=Object(u.useState)(""),c=s()(a,2),i=c[0],l=c[1];return Object(u.useEffect)((function(){e("set-active-payment-method",{activePaymentMethod:r})}),[e,r]),{activePaymentMethod:r,activeSavedToken:i,setActivePaymentMethod:o,setActiveSavedToken:l}}(),pe=de.activePaymentMethod,be=de.activeSavedToken,me=de.setActivePaymentMethod,he=de.setActiveSavedToken,ge=Object(u.useMemo)((function(){return b?h("previewSavedPaymentMethods"):le?function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(0===Object.keys(e).length)return{};var t=Object(R.getSetting)("customerPaymentMethods",{}),n=Object.keys(t),r={};return n.forEach((function(n){var o=t[n].filter((function(t){var n,r=t.method.gateway;return r in e&&(null===(n=e[r].supports)||void 0===n?void 0:n.showSavedCards)}));o.length&&(r[n]=o)})),r}(ce.paymentMethods):{}}),[b,h,le,ce.paymentMethods]),ve=Object(u.useCallback)((function(e){e?O(e,{id:"wc-express-payment-error",context:P.EXPRESS_PAYMENTS}):j("wc-express-payment-error",P.EXPRESS_PAYMENTS)}),[O,P.EXPRESS_PAYMENTS,j]),ye=Object.keys(ce.expressPaymentMethods).includes(pe),Oe=Object(u.useMemo)((function(){return{isPristine:ce.currentStatus===r.PRISTINE,isStarted:ce.currentStatus===r.STARTED,isProcessing:ce.currentStatus===r.PROCESSING,isFinished:[r.ERROR,r.FAILED,r.SUCCESS].includes(ce.currentStatus),hasError:ce.currentStatus===r.ERROR,hasFailed:ce.currentStatus===r.FAILED,isSuccessful:ce.currentStatus===r.SUCCESS,isDoingExpressPayment:ce.currentStatus!==r.PRISTINE&&ye}}),[ce.currentStatus,ye]);Object(u.useEffect)((function(){var e=Object.keys(ce.paymentMethods),t=[].concat(c()(e),c()(Object.keys(ce.expressPaymentMethods)));le&&e.length&&me((function(e){return e&&t.includes(e)?e:(ue().pristine(),Object.keys(ce.paymentMethods)[0])}))}),[le,ce.paymentMethods,ce.expressPaymentMethods,me,ue]),Object(u.useEffect)((function(){!a||d||f||Oe.isFinished||ue().processing()}),[a,d,f,Oe.isFinished,ue]),Object(u.useEffect)((function(){i&&!Oe.isSuccessful&&ue().pristine()}),[i,Oe.isSuccessful,ue]),Object(u.useEffect)((function(){d&&Oe.isSuccessful&&!ce.hasSavedToken&&ue().pristine()}),[d,Oe.isSuccessful,ce.hasSavedToken,ue]),Object(u.useEffect)((function(){Oe.isProcessing&&(j("wc-payment-error",P.PAYMENTS),Object(X.b)(ee.current,"payment_processing",{}).then((function(e){var t,n,r,o,a,c,i,s;if(e.forEach((function(e){w(e)&&(t=e),(_(e)||k(e))&&(n=e)})),t&&!n)ue().success(null===(r=t)||void 0===r||null===(o=r.meta)||void 0===o?void 0:o.paymentMethodData,null===(a=t)||void 0===a||null===(c=a.meta)||void 0===c?void 0:c.billingData,null===(i=t)||void 0===i||null===(s=i.meta)||void 0===s?void 0:s.shippingData);else if(n&&k(n)){var u,l,f,d,p,b;n.message&&n.message.length&&O(n.message,{id:"wc-payment-error",isDismissible:!1,context:(null===(b=n)||void 0===b?void 0:b.messageContext)||P.PAYMENTS}),ue().failed(null===(u=n)||void 0===u?void 0:u.message,null===(l=n)||void 0===l||null===(f=l.meta)||void 0===f?void 0:f.paymentMethodData,null===(d=n)||void 0===d||null===(p=d.meta)||void 0===p?void 0:p.billingData)}else if(n){var m,h;n.message&&n.message.length&&O(n.message,{id:"wc-payment-error",isDismissible:!1,context:(null===(h=n)||void 0===h?void 0:h.messageContext)||P.PAYMENTS}),ue().error(n.message),g(null===(m=n)||void 0===m?void 0:m.validationErrors)}else ue().success()})))}),[Oe.isProcessing,g,ue,j,P.PAYMENTS,w,k,_,O]);var je={setPaymentStatus:ue,currentStatus:Oe,paymentStatuses:r,paymentMethodData:ce.paymentMethodData,errorMessage:ce.errorMessage,activePaymentMethod:pe,setActivePaymentMethod:me,activeSavedToken:be,setActiveSavedToken:he,onPaymentProcessing:J,customerPaymentMethods:ge,paymentMethods:ce.paymentMethods,expressPaymentMethods:ce.expressPaymentMethods,paymentMethodsInitialized:le,expressPaymentMethodsInitialized:fe,setExpressPaymentError:ve,isExpressPaymentMethodActive:ye,shouldSavePayment:ce.shouldSavePaymentMethod,setShouldSavePayment:se.setShouldSavePayment};return React.createElement(Z.Provider,{value:je},n)}},function(e,t,n){"use strict";t.a=function(e){var t=e.label,n=e.secondaryLabel,r=e.description,o=e.secondaryDescription,a=e.id;return React.createElement("div",{className:"wc-block-components-radio-control__option-layout"},React.createElement("div",{className:"wc-block-components-radio-control__label-group"},t&&React.createElement("span",{id:a&&"".concat(a,"__label"),className:"wc-block-components-radio-control__label"},t),n&&React.createElement("span",{id:a&&"".concat(a,"__secondary-label"),className:"wc-block-components-radio-control__secondary-label"},n)),React.createElement("div",{className:"wc-block-components-radio-control__description-group"},r&&React.createElement("span",{id:a&&"".concat(a,"__description"),className:"wc-block-components-radio-control__description"},r),o&&React.createElement("span",{id:a&&"".concat(a,"__secondary-description"),className:"wc-block-components-radio-control__secondary-description"},o)))}},function(e,t,n){"use strict";var r=n(14),o=n.n(r),a=n(23),c=n.n(a),i=n(6),s=n.n(i),u=(n(10),n(248),["children","className","headingLevel"]);t.a=function(e){var t=e.children,n=e.className,r=e.headingLevel,a=c()(e,u),i=s()("wc-block-components-title",n),l="h".concat(r);return React.createElement(l,o()({className:i},a),t)}},,function(e,t,n){"use strict";t.a=function(e){var t={};return function(n){return void 0===t[n]&&(t[n]=e(n)),t[n]}}},,function(e,t,n){"use strict";var r=n(4),o=n.n(r),a=n(6),c=n.n(a),i=n(174);t.a=function(e){var t,n=e.checked,r=e.name,a=e.onChange,s=e.option,u=s.value,l=s.label,f=s.description,d=s.secondaryLabel,p=s.secondaryDescription;return React.createElement("label",{className:c()("wc-block-components-radio-control__option",{"wc-block-components-radio-control__option-checked":n}),htmlFor:"".concat(r,"-").concat(u)},React.createElement("input",{id:"".concat(r,"-").concat(u),className:"wc-block-components-radio-control__input",type:"radio",name:r,value:u,onChange:function(e){return a(e.target.value)},checked:n,"aria-describedby":c()((t={},o()(t,"".concat(r,"-").concat(u,"__label"),l),o()(t,"".concat(r,"-").concat(u,"__secondary-label"),d),o()(t,"".concat(r,"-").concat(u,"__description"),f),o()(t,"".concat(r,"-").concat(u,"__secondary-description"),p),t))}),React.createElement(i.a,{id:"".concat(r,"-").concat(u),label:l,secondaryLabel:d,description:f,secondaryDescription:p}))}},function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t,n){"use strict";n.d(t,"b",(function(){return c})),n.d(t,"a",(function(){return i}));var r=n(53),o=n(173),a=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=Object(o.b)(),n=t.paymentMethods,a=t.expressPaymentMethods,c=t.paymentMethodsInitialized,i=t.expressPaymentMethodsInitialized,s=Object(r.a)(n),u=Object(r.a)(a);return{paymentMethods:e?u:s,isInitialized:e?i:c}},c=function(){return a(!1)},i=function(){return a(!0)}},function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));var r=function(e,t){var n=[];return Object.keys(e).forEach((function(r){if(void 0!==t[r])switch(e[r].type){case"boolean":n[r]="false"!==t[r]&&!1!==t[r];break;case"number":n[r]=parseInt(t[r],10);break;case"array":case"object":n[r]=JSON.parse(t[r]);break;default:n[r]=t[r]}else n[r]=e[r].default})),n}},function(e,t){},function(e,t){},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(98),o=function(e,t){return function(n){var o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10,a=r.a.addEventCallback(e,n,o);return t(a),function(){t(r.a.removeEventCallback(e,a.id))}}}},function(e,t,n){"use strict";var r=n(14),o=n.n(r),a=n(4),c=n.n(a),i=n(6),s=n.n(i),u=function(e){return"wc-block-components-payment-method-icon wc-block-components-payment-method-icon--".concat(e)},l=function(e){var t=e.id,n=e.src,r=void 0===n?null:n,o=e.alt,a=void 0===o?"":o;return r?React.createElement("img",{className:u(t),src:r,alt:a}):null},f=n(83),d=[{id:"alipay",alt:"Alipay",src:f.l+"payment-methods/alipay.svg"},{id:"amex",alt:"American Express",src:f.l+"payment-methods/amex.svg"},{id:"bancontact",alt:"Bancontact",src:f.l+"payment-methods/bancontact.svg"},{id:"diners",alt:"Diners Club",src:f.l+"payment-methods/diners.svg"},{id:"discover",alt:"Discover",src:f.l+"payment-methods/discover.svg"},{id:"eps",alt:"EPS",src:f.l+"payment-methods/eps.svg"},{id:"giropay",alt:"Giropay",src:f.l+"payment-methods/giropay.svg"},{id:"ideal",alt:"iDeal",src:f.l+"payment-methods/ideal.svg"},{id:"jcb",alt:"JCB",src:f.l+"payment-methods/jcb.svg"},{id:"laser",alt:"Laser",src:f.l+"payment-methods/laser.svg"},{id:"maestro",alt:"Maestro",src:f.l+"payment-methods/maestro.svg"},{id:"mastercard",alt:"Mastercard",src:f.l+"payment-methods/mastercard.svg"},{id:"multibanco",alt:"Multibanco",src:f.l+"payment-methods/multibanco.svg"},{id:"p24",alt:"Przelewy24",src:f.l+"payment-methods/p24.svg"},{id:"sepa",alt:"Sepa",src:f.l+"payment-methods/sepa.svg"},{id:"sofort",alt:"Sofort",src:f.l+"payment-methods/sofort.svg"},{id:"unionpay",alt:"Union Pay",src:f.l+"payment-methods/unionpay.svg"},{id:"visa",alt:"Visa",src:f.l+"payment-methods/visa.svg"},{id:"wechat",alt:"WeChat",src:f.l+"payment-methods/wechat.svg"}],p=n(21),b=n.n(p),m=n(49);function h(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function g(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?h(Object(n),!0).forEach((function(t){c()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):h(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}n(265),t.a=function(e){var t=e.icons,n=void 0===t?[]:t,r=e.align,a=void 0===r?"center":r,c=function(e){var t={};return e.forEach((function(e){var n={};"string"==typeof e&&(n={id:e,alt:e,src:null}),"object"===b()(e)&&(n={id:e.id||"",alt:e.alt||"",src:e.src||null}),n.id&&Object(m.c)(n.id)&&!t[n.id]&&(t[n.id]=n)})),Object.values(t)}(n);if(0===c.length)return null;var i=s()("wc-block-components-payment-method-icons",{"wc-block-components-payment-method-icons--align-left":"left"===a,"wc-block-components-payment-method-icons--align-right":"right"===a});return React.createElement("div",{className:i},c.map((function(e){var t,n=g(g({},e),(t=e.id,d.find((function(e){return e.id===t}))||{}));return React.createElement(l,o()({key:"payment-method-icon-"+e.id},n))})))}},function(e,t,n){"use strict";n.d(t,"a",(function(){return p})),n.d(t,"b",(function(){return b}));var r=n(21),o=n.n(r),a=n(39),c=n.n(a),i=n(27),s=n.n(i),u=function(e,t){return e[t]?Array.from(e[t].values()).sort((function(e,t){return e.priority-t.priority})):[]},l=n(35);function f(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return d(e,void 0);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?d(e,void 0):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,c=!0,i=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return c=e.done,e},e:function(e){i=!0,a=e},f:function(){try{c||null==n.return||n.return()}finally{if(i)throw a}}}}function d(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var p=function(){var e=c()(s.a.mark((function e(t,n,r){var a,c,i,l,d,p;return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:a=u(t,n),c=[],i=f(a),e.prev=3,i.s();case 5:if((l=i.n()).done){e.next=19;break}return d=l.value,e.prev=7,e.next=10,Promise.resolve(d.callback(r));case 10:p=e.sent,"object"===o()(p)&&c.push(p),e.next=17;break;case 14:e.prev=14,e.t0=e.catch(7),console.error(e.t0);case 17:e.next=5;break;case 19:e.next=24;break;case 21:e.prev=21,e.t1=e.catch(3),i.e(e.t1);case 24:return e.prev=24,i.f(),e.finish(24);case 27:return e.abrupt("return",!c.length||c);case 28:case"end":return e.stop()}}),e,null,[[3,21,24,27],[7,14]])})));return function(_x,t,n){return e.apply(this,arguments)}}(),b=function(){var e=c()(s.a.mark((function e(t,n,r){var a,c,i,d,p,b;return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:a=[],c=u(t,n),i=f(c),e.prev=3,i.s();case 5:if((d=i.n()).done){e.next=28;break}return p=d.value,e.prev=7,e.next=10,Promise.resolve(p.callback(r));case 10:if(b=e.sent,"object"===o()(b)&&null!==b){e.next=13;break}return e.abrupt("continue",26);case 13:if(b.hasOwnProperty("type")){e.next=15;break}throw new Error("Returned objects from event emitter observers must return an object with a type property");case 15:if(!Object(l.a)(b)&&!Object(l.b)(b)){e.next=18;break}return a.push(b),e.abrupt("return",a);case 18:a.push(b),e.next=26;break;case 21:return e.prev=21,e.t0=e.catch(7),console.error(e.t0),a.push({type:"error"}),e.abrupt("return",a);case 26:e.next=5;break;case 28:e.next=33;break;case 30:e.prev=30,e.t1=e.catch(3),i.e(e.t1);case 33:return e.prev=33,i.f(),e.finish(33);case 36:return e.abrupt("return",a);case 37:case"end":return e.stop()}}),e,null,[[3,30,33,36],[7,21]])})));return function(t,n,r){return e.apply(this,arguments)}}()},function(e,t,n){"use strict";var r=n(14),o=n.n(r),a=n(23),c=n.n(a),i=(n(10),n(6)),s=n.n(i),u=n(1),l=n(152),f=n(216),d=(n(149),["text","screenReaderText","element","className","radius","children"]),p=function(e){var t=e.text,n=e.screenReaderText,r=void 0===n?"":n,a=e.element,i=void 0===a?"li":a,u=e.className,l=void 0===u?"":u,f=e.radius,p=void 0===f?"small":f,b=e.children,m=void 0===b?null:b,h=c()(e,d),g=i,v=s()(l,"wc-block-components-chip","wc-block-components-chip--radius-"+p),y=Boolean(r&&r!==t);return React.createElement(g,o()({className:v},h),React.createElement("span",{"aria-hidden":y,className:"wc-block-components-chip__text"},t),y&&React.createElement("span",{className:"screen-reader-text"},r),m)},b=["ariaLabel","className","disabled","onRemove","removeOnAnyClick","text","screenReaderText"];t.a=function(e){var t=e.ariaLabel,n=void 0===t?"":t,r=e.className,a=void 0===r?"":r,i=e.disabled,d=void 0!==i&&i,m=e.onRemove,h=void 0===m?function(){}:m,g=e.removeOnAnyClick,v=void 0!==g&&g,y=e.text,O=e.screenReaderText,j=void 0===O?"":O,E=c()(e,b),w=v?"span":"button";if(!n){var _=j&&"string"==typeof j?j:y;n="string"!=typeof _?
/* translators: Remove chip. */
Object(u.__)("Remove",'woocommerce'):Object(u.sprintf)(
/* translators: %s text of the chip to remove. */
Object(u.__)('Remove "%s"','woocommerce'),_)}var S={"aria-label":n,disabled:d,onClick:h,onKeyDown:function(e){"Backspace"!==e.key&&"Delete"!==e.key||h()}},k=v?S:{},R=v?{"aria-hidden":!0}:S;return React.createElement(p,o()({},E,k,{className:s()(a,"is-removable"),element:v?"button":E.element,screenReaderText:j,text:y}),React.createElement(w,o()({className:"wc-block-components-chip__remove"},R),React.createElement(l.a,{className:"wc-block-components-chip__remove-icon",srcElement:f.a,size:16})))}},function(e,t,n){"use strict";var r=n(20),o=n(19),a=n(6),c=n.n(a),i=n(0);function s(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}t.a=function(e){var t=e.as,n=void 0===t?"div":t,a=e.className,u=Object(o.a)(e,["as","className"]);return function(e){var t=e.as,n=void 0===t?"div":t,r=Object(o.a)(e,["as"]);return"function"==typeof r.children?r.children(r):Object(i.createElement)(n,r)}(function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?s(Object(n),!0).forEach((function(t){Object(r.a)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):s(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({as:n,className:c()("components-visually-hidden",a)},u))}},,,,function(e,t,n){"use strict";var r=n(0),o=n(2),a=n(8),c=n(11),i=n(1);Object(i.__)("Unable to get cart data from the API.",'woocommerce'),t.a=function(e){return function(t){var n,i;return n=Object(r.useRef)(Object(o.getSetting)("preloadedApiRequests",{})),i=Object(c.useDispatch)(a.CART_STORE_KEY).setIsCartDataStale,Object(c.useSelect)((function(e,t){var r,o=null===(r=n.current["/wc/store/cart"])||void 0===r?void 0:r.body;if(o){var c=e(a.CART_STORE_KEY),s=c.isResolving,u=c.hasFinishedResolution,l=c.isCartDataStale;if(!l()&&!s("getCartData")&&!u("getCartData",[])){var f=window.localStorage.getItem("wc-blocks_cart_update_timestamp");if(f){var d=parseFloat(f),p=parseFloat(o.generated_timestamp);!isNaN(p)&&!isNaN(d)&&d>p&&i()}}var b,m=t.dispatch(a.CART_STORE_KEY),h=m.receiveCart,g=m.receiveError,v=m.startResolution,y=m.finishResolution;l()||s("getCartData",[])||u("getCartData",[])||(v("getCartData",[]),null!=o&&null!==(b=o.code)&&void 0!==b&&b.includes("error")?g(o):h(o),y("getCartData",[]))}}),[]),React.createElement(e,t)}}},,function(e,t,n){"use strict";n.d(t,"b",(function(){return l})),n.d(t,"a",(function(){return f}));var r=n(5),o=n.n(r),a=(n(10),n(0)),c=n(24),i=n(6),s=n.n(i),u=Object(a.createContext)({hasContainerWidth:!1,containerClassName:"",isMobile:!1,isSmall:!1,isMedium:!1,isLarge:!1}),l=function(){return Object(a.useContext)(u)},f=function(e){var t=e.children,n=e.className,r=void 0===n?"":n,a=function(){var e=Object(c.useResizeObserver)(),t=o()(e,2),n=t[0],r=t[1].width,a="";return r>700?a="is-large":r>520?a="is-medium":r>400?a="is-small":r&&(a="is-mobile"),[n,a]}(),i=o()(a,2),l=i[0],f=i[1],d={hasContainerWidth:""!==f,containerClassName:f,isMobile:"is-mobile"===f,isSmall:"is-small"===f,isMedium:"is-medium"===f,isLarge:"is-large"===f};return React.createElement(u.Provider,{value:d},React.createElement("div",{className:s()(r,f)},l,t))}},,,,,function(e,t){},function(e,t,n){"use strict";var r=n(6),o=n.n(r),a=n(24),c=n(179);n(252),t.a=Object(a.withInstanceId)((function(e){var t=e.className,n=e.instanceId,r=e.id,a=e.selected,i=e.onChange,s=e.options,u=void 0===s?[]:s,l=r||n;return u.length&&React.createElement("div",{className:o()("wc-block-components-radio-control",t)},u.map((function(e){return React.createElement(c.a,{key:"".concat(l,"-").concat(e.value),name:"radio-control-".concat(l),checked:e.value===a,option:e,onChange:function(t){i(t),"function"==typeof e.onChange&&e.onChange(t)}})})))}))},function(e,t){},function(e,t,n){"use strict";var r=n(23),o=n.n(r),a=n(1),c=n(0),i=n(33),s=n(105),u=n(26),l=n(326),f=n(32),d=n(36),p=n(6),b=n.n(p),m=n(28),h=n(51),g=n(5),v=n.n(g),y=n(25),O=n.n(y),j=n(118),E=n(52),w=function(e){var t;return null===(t=e.find((function(e){return e.selected})))||void 0===t?void 0:t.rate_id},_=n(207),S=n(174),k=n(58),R=n(69),P=n(2),x=function(e){var t=Object(P.getSetting)("displayCartPricesIncludingTax",!1)?parseInt(e.price,10)+parseInt(e.taxes,10):parseInt(e.price,10);return{label:Object(m.decodeEntities)(e.name),value:e.rate_id,description:React.createElement(React.Fragment,null,Number.isFinite(t)&&React.createElement(R.a,{currency:Object(k.getCurrencyFromPriceResponse)(e),value:t}),Number.isFinite(t)&&e.delivery_time?" — ":null,Object(m.decodeEntities)(e.delivery_time))}},C=function(e){var t=e.className,n=e.noResultsMessage,r=e.onSelectRate,o=e.rates,a=e.renderOption,c=void 0===a?x:a,i=e.selected;if(0===o.length)return n;if(o.length>1)return React.createElement(_.a,{className:t,onChange:function(e){r(e)},selected:i,options:o.map(c)});var s=c(o[0]),u=s.label,l=s.secondaryLabel,f=s.description,d=s.secondaryDescription;return React.createElement(S.a,{label:u,secondaryLabel:l,description:f,secondaryDescription:d})},A=(n(253),function(e){var t=e.packageId,n=e.className,r=e.noResultsMessage,o=e.renderOption,i=e.packageData,s=e.collapsible,l=void 0!==s&&s,f=e.collapse,d=void 0!==f&&f,p=e.showItems,g=void 0!==p&&p,y=function(e,t){var n=Object(E.a)().dispatchCheckoutEvent,r=Object(j.a)(),o=r.selectShippingRate,a=r.isSelectingRate,i=Object(c.useState)((function(){return w(t)})),s=v()(i,2),u=s[0],l=s[1],f=Object(c.useRef)(t);return Object(c.useEffect)((function(){O()(f.current,t)||(f.current=t,l(w(t)))}),[t]),{selectShippingRate:Object(c.useCallback)((function(t){l(t),o(t,e),n("set-selected-shipping-rate",{shippingRateId:t})}),[e,o,n]),selectedShippingRate:u,isSelectingRate:a}}(t,i.shipping_rates),_=y.selectShippingRate,S=y.selectedShippingRate,k=React.createElement(React.Fragment,null,(g||l)&&React.createElement("div",{className:"wc-block-components-shipping-rates-control__package-title"},i.name),g&&React.createElement("ul",{className:"wc-block-components-shipping-rates-control__package-items"},Object.values(i.items).map((function(e){var t=Object(m.decodeEntities)(e.name),n=e.quantity;return React.createElement("li",{key:e.key,className:"wc-block-components-shipping-rates-control__package-item"},React.createElement(h.a,{label:n>1?"".concat(t," × ").concat(n):"".concat(t),screenReaderLabel:Object(a.sprintf)(
/* translators: %1$s name of the product (ie: Sunglasses), %2$d number of units in the current cart package */
Object(a._n)("%1$s (%2$d unit)","%1$s (%2$d units)",n,'woocommerce'),t,n)}))})))),R=React.createElement(C,{className:n,noResultsMessage:r,rates:i.shipping_rates,onSelectRate:_,selected:S,renderOption:o});return l?React.createElement(u.Panel,{className:"wc-block-components-shipping-rates-control__package",initialOpen:!d,title:k},R):React.createElement("div",{className:b()("wc-block-components-shipping-rates-control__package",n)},k,R)}),N=["package_id"],T=["extensions","receiveCart"],M=function(e){var t=e.packages,n=e.collapse,r=e.showItems,a=e.collapsible,c=e.noResultsMessage,i=e.renderOption;return t.length?React.createElement(React.Fragment,null,t.map((function(e){var t=e.package_id,s=o()(e,N);return React.createElement(A,{key:t,packageId:t,packageData:s,collapsible:a,collapse:n,showItems:r,noResultsMessage:c,renderOption:i})}))):null};t.a=function(e){var t=e.shippingRates,n=e.shippingRatesLoading,r=e.className,p=e.collapsible,b=void 0!==p&&p,m=e.noResultsMessage,h=e.renderOption;Object(c.useEffect)((function(){if(!n){var e=Object(l.a)(t),r=Object(l.b)(t);1===e?Object(i.speak)(Object(a.sprintf)(
/* translators: %d number of shipping options found. */
Object(a._n)("%d shipping option was found.","%d shipping options were found.",r,'woocommerce'),r)):Object(i.speak)(Object(a.sprintf)(
/* translators: %d number of shipping packages packages. */
Object(a._n)("Shipping option searched for %d package.","Shipping options searched for %d packages.",e,'woocommerce'),e)+" "+Object(a.sprintf)(
/* translators: %d number of shipping options available. */
Object(a._n)("%d shipping option was found","%d shipping options were found",r,'woocommerce'),r))}}),[n,t]);var g=Object(f.a)(),v=g.extensions,y=(g.receiveCart,{className:r,collapsible:b,noResultsMessage:m,renderOption:h,extensions:v,cart:o()(g,T),components:{ShippingRatesControlPackage:A}}),O=Object(d.a)().isEditor;return React.createElement(s.a,{isLoading:n,screenReaderLabel:Object(a.__)("Loading shipping rates…",'woocommerce'),showSpinner:!0},O?React.createElement(M,{packages:t,noResultsMessage:m,renderOption:h}):React.createElement(React.Fragment,null,React.createElement(u.ExperimentalOrderShippingPackages.Slot,y),React.createElement(u.ExperimentalOrderShippingPackages,null,React.createElement(M,{packages:t,noResultsMessage:m,renderOption:h}))))}},function(e,t,n){"use strict";var r=n(12),o=n(19),a=n(0),c=n(6),i=n.n(c),s=n(145);t.a=Object(a.forwardRef)((function(e,t){var n=e.className,c=Object(o.a)(e,["className"]),u=i()("components-flex__block",n);return Object(a.createElement)(s.a,Object(r.a)({},c,{className:u,ref:t}))}))},function(e,t,n){"use strict";var r=n(12),o=n(19),a=n(0),c=n(6),i=n.n(c),s=n(145);t.a=Object(a.forwardRef)((function(e,t){var n=e.className,c=Object(o.a)(e,["className"]),u=i()("components-flex__item",n);return Object(a.createElement)(s.c,Object(r.a)({},c,{className:u,ref:t}))}))},function(e,t,n){"use strict";var r=n(4),o=n.n(r),a=n(5),c=n.n(a),i=n(1),s=n(318),u=n(187),l=n(0),f=n(36),d=n(173),p=n(45),b=n.n(p),m=n(213);function h(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function g(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?h(Object(n),!0).forEach((function(t){o()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):h(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}t.a=function(){var e=Object(f.a)().isEditor,t=Object(d.b)(),n=t.setActivePaymentMethod,r=t.setExpressPaymentError,o=t.activePaymentMethod,a=t.paymentMethodData,p=t.setPaymentStatus,h=Object(s.a)(),v=Object(u.a)().paymentMethods,y=Object(l.useRef)(o),O=Object(l.useRef)(a),j=Object(l.useCallback)((function(e){return function(){y.current=o,O.current=a,p().started({}),n(e)}}),[o,a,n,p]),E=Object(l.useCallback)((function(){p().pristine(),n(y.current),O.current.isSavedToken&&p().started(O.current)}),[n,p]),w=Object(l.useCallback)((function(e){p().error(e),r(e),n(y.current),O.current.isSavedToken&&p().started(O.current)}),[n,p,r]),_=Object(l.useCallback)((function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";b()("Express Payment Methods should use the provided onError handler instead.",{alternative:"onError",plugin:"woocommerce-gutenberg-products-block",link:"https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/4228"}),e?w(e):r("")}),[r,w]),S=Object.entries(v),k=S.length>0?S.map((function(t){var n=c()(t,2),r=n[0],o=n[1],a=e?o.edit:o.content;return Object(l.isValidElement)(a)?React.createElement("li",{key:r,id:"express-payment-method-".concat(r)},Object(l.cloneElement)(a,g(g({},h),{},{onClick:j(r),onClose:E,onError:w,setExpressPaymentError:_}))):null})):React.createElement("li",{key:"noneRegistered"},Object(i.__)("No registered Payment Methods",'woocommerce'));return React.createElement(m.a,{isEditor:e},React.createElement("ul",{className:"wc-block-components-express-payment__event-buttons"},k))}},function(e,t,n){"use strict";var r=n(40),o=n.n(r),a=n(41),c=n.n(a),i=n(29),s=n.n(i),u=n(42),l=n.n(u),f=n(43),d=n.n(f),p=n(30),b=n.n(p),m=n(4),h=n.n(m),g=n(1),v=n(3),y=(n(10),n(2)),O=n(78);var j=function(e){l()(a,e);var t,n,r=(t=a,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=b()(t);if(n){var o=b()(this).constructor;e=Reflect.construct(r,arguments,o)}else e=r.apply(this,arguments);return d()(this,e)});function a(){var e;o()(this,a);for(var t=arguments.length,n=new Array(t),c=0;c<t;c++)n[c]=arguments[c];return e=r.call.apply(r,[this].concat(n)),h()(s()(e),"state",{errorMessage:"",hasError:!1}),e}return c()(a,[{key:"render",value:function(){var e=this.state,t=e.hasError,n=e.errorMessage,r=this.props.isEditor;if(t){var o=Object(g.__)("This site is experiencing difficulties with this payment method. Please contact the owner of the site for assistance.",'woocommerce');(r||y.CURRENT_USER_IS_ADMIN)&&(o=n||Object(g.__)("There was an error with this payment method. Please verify it's configured correctly.",'woocommerce'));var a=[{id:"0",content:o,isDismissible:!1,status:"error"}];return React.createElement(O.StoreNoticesContainer,{notices:a})}return this.props.children}}],[{key:"getDerivedStateFromError",value:function(e){return{errorMessage:e.message,hasError:!0}}}]),a}(v.Component);j.defaultProps={isEditor:!1},t.a=j},function(e,t,n){"use strict";n.d(t,"a",(function(){return g}));var r=n(4),o=n.n(r),a=n(1),c=n(11),i=n(8),s=n(28),u=n(32),l=n(0),f=n(226);function d(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function p(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?d(Object(n),!0).forEach((function(t){o()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):d(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var b=n(127),m=n(54);function h(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}var g=function(){var e=Object(u.a)(),t=e.cartCoupons,n=e.cartIsLoading,r=Object(m.a)().addErrorNotice,d=function(){var e=Object(f.b)(),t=e.notices,n=e.createSnackbarNotice,r=e.removeSnackbarNotice,o=e.setIsSuppressed,a=Object(l.useRef)(t);Object(l.useEffect)((function(){a.current=t}),[t]);var c=Object(l.useMemo)((function(){return{removeNotices:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;a.current.forEach((function(t){null!==e&&t.status!==e||r(t.id)}))},removeSnackbarNotice:r}}),[r]),i=Object(l.useMemo)((function(){return{addSnackbarNotice:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};n(e,t)}}}),[n]);return p(p(p({notices:t},c),i),{},{setIsSuppressed:o})}().addSnackbarNotice,g=Object(b.b)().setValidationErrors;return function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?h(Object(n),!0).forEach((function(t){o()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):h(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({appliedCoupons:t,isLoading:n},Object(c.useSelect)((function(e,t){var n=t.dispatch,o=e(i.CART_STORE_KEY),c=o.isApplyingCoupon(),u=o.isRemovingCoupon(),l=n(i.CART_STORE_KEY),f=l.applyCoupon,p=l.removeCoupon,b=l.receiveApplyingCoupon;return{applyCoupon:function(e){f(e).then((function(t){!0===t&&d(Object(a.sprintf)(
/* translators: %s coupon code. */
Object(a.__)('Coupon code "%s" has been applied to your cart.','woocommerce'),e),{id:"coupon-form"})})).catch((function(e){g({coupon:{message:Object(s.decodeEntities)(e.message),hidden:!1}}),b("")}))},removeCoupon:function(e){p(e).then((function(t){!0===t&&d(Object(a.sprintf)(
/* translators: %s coupon code. */
Object(a.__)('Coupon code "%s" has been removed from your cart.','woocommerce'),e),{id:"coupon-form"})})).catch((function(e){r(e.message,{id:"coupon-form"}),b("")}))},isApplyingCoupon:c,isRemovingCoupon:u}}),[r,d]))}},,function(e,t,n){"use strict";var r=n(14),o=n.n(r),a=n(23),c=n.n(a),i=n(34),s=["className","size"],u=function(e){var t=e.className,n=e.size,r=c()(e,s);return React.createElement(i.SVG,o()({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",className:t,width:n,height:n},r),React.createElement("path",{d:"M14.95 6.46L11.41 10l3.54 3.54-1.41 1.41L10 11.42l-3.53 3.53-1.42-1.42L8.58 10 5.05 6.47l1.42-1.42L10 8.58l3.54-3.53z"}))},l=React.createElement(u,null);t.a=l},function(e,t,n){"use strict";n.d(t,"b",(function(){return u})),n.d(t,"a",(function(){return v}));var r=n(20),o=n(7),a=n(63);function c(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function i(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?c(Object(n),!0).forEach((function(t){Object(r.a)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):c(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var s={black:"#000",white:"#fff"},u={blue:{medium:{focus:"#007cba",focusDark:"#fff"}},gray:{900:"#1e1e1e",700:"#757575",600:"#949494",400:"#ccc",200:"#ddd",100:"#f0f0f0"},darkGray:{primary:"#1e1e1e"},mediumGray:{text:"#757575"},lightGray:{ui:"#949494",secondary:"#ccc",tertiary:"#e7e8e9"}},l={900:"#191e23",800:"#23282d",700:"#32373c",600:"#40464d",500:"#555d66",400:"#606a73",300:"#6c7781",200:"#7e8993",150:"#8d96a0",100:"#8f98a1",placeholder:Object(a.b)(u.gray[900],.62)},f={900:Object(a.b)("#000510",.9),800:Object(a.b)("#00000a",.85),700:Object(a.b)("#06060b",.8),600:Object(a.b)("#000913",.75),500:Object(a.b)("#0a1829",.7),400:Object(a.b)("#0a1829",.65),300:Object(a.b)("#0e1c2e",.62),200:Object(a.b)("#162435",.55),100:Object(a.b)("#223443",.5),backgroundFill:Object(a.b)(l[700],.7)},d={900:Object(a.b)("#304455",.45),800:Object(a.b)("#425863",.4),700:Object(a.b)("#667886",.35),600:Object(a.b)("#7b86a2",.3),500:Object(a.b)("#9197a2",.25),400:Object(a.b)("#95959c",.2),300:Object(a.b)("#829493",.15),200:Object(a.b)("#8b8b96",.1),100:Object(a.b)("#747474",.05)},p={900:"#a2aab2",800:"#b5bcc2",700:"#ccd0d4",600:"#d7dade",500:"#e2e4e7",400:"#e8eaeb",300:"#edeff0",200:"#f3f4f5",100:"#f8f9f9",placeholder:Object(a.b)(s.white,.65)},b={900:Object(a.b)(s.white,.5),800:Object(a.b)(s.white,.45),700:Object(a.b)(s.white,.4),600:Object(a.b)(s.white,.35),500:Object(a.b)(s.white,.3),400:Object(a.b)(s.white,.25),300:Object(a.b)(s.white,.2),200:Object(a.b)(s.white,.15),100:Object(a.b)(s.white,.1),backgroundFill:Object(a.b)(p[300],.8)},m={wordpress:{700:"#00669b"},dark:{900:"#0071a1"},medium:{900:"#006589",800:"#00739c",700:"#007fac",600:"#008dbe",500:"#00a0d2",400:"#33b3db",300:"#66c6e4",200:"#bfe7f3",100:"#e5f5fa",highlight:"#b3e7fe",focus:"#007cba"}},h={theme:"var( --wp-admin-theme-color, ".concat(m.wordpress[700],")"),themeDark10:"var( --wp-admin-theme-color-darker-10, ".concat(m.medium.focus,")")},g={theme:h.theme,background:s.white,backgroundDisabled:p[200],border:u.gray[700],borderFocus:h.themeDark10,borderDisabled:u.gray[400],borderLight:u.gray[200],label:l[500],textDisabled:l[150],textDark:s.white,textLight:s.black},v=i(i({},s),{},{darkGray:Object(o.merge)({},l,u.darkGray),darkOpacity:f,darkOpacityLight:d,mediumGray:u.mediumGray,lightGray:Object(o.merge)({},p,u.lightGray),lightGrayLight:b,blue:Object(o.merge)({},m,u.blue),alert:{yellow:"#f0b849",red:"#d94f4f",green:"#4ab866"},admin:h,ui:g})},function(e,t,n){"use strict";n.d(t,"a",(function(){return u}));var r=n(12),o=n(19),a=n(0),c=n(6),i=n.n(c),s=n(145),u=Object(a.forwardRef)((function(e,t){var n=e.align,c=void 0===n?"center":n,u=e.className,l=e.gap,f=void 0===l?2:l,d=e.justify,p=void 0===d?"space-between":d,b=e.isReversed,m=void 0!==b&&b,h=Object(o.a)(e,["align","className","gap","justify","isReversed"]),g=i()("components-flex",u);return Object(a.createElement)(s.b,Object(r.a)({},h,{align:c,className:g,ref:t,gap:f,justify:p,isReversed:m}))}));t.b=u},,function(e,t,n){"use strict";var r=n(0),o=n(6),a=n.n(o),c=n(195),i=n(124),s=n(7),u={"default.fontFamily":"-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif","default.fontSize":"13px","helpText.fontSize":"12px",mobileTextMinFontSize:"16px"};function l(e){return Object(s.get)(u,e,"")}function f(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;return isNaN(e)?"".concat(8,"px"):"".concat(8*e,"px")}var d=n(63),p=Object(i.a)("div",{target:"e1puf3u0",label:"Wrapper"})("font-family:",l("default.fontFamily"),";font-size:",l("default.fontSize"),";"),b=Object(i.a)("div",{target:"e1puf3u1",label:"StyledField"})("margin-bottom:",f(1),";.components-panel__row &{margin-bottom:inherit;}"),m=Object(i.a)("label",{target:"e1puf3u2",label:"StyledLabel"})("display:inline-block;margin-bottom:",f(1),";"),h=Object(i.a)("p",{target:"e1puf3u3",label:"StyledHelp"})("margin-top:-",f(1),";font-size:",l("helpText.fontSize"),";font-style:normal;color:",Object(d.a)("mediumGray.text"),";");function g(e){var t=e.id,n=e.label,o=e.hideLabelFromVision,i=e.help,s=e.className,u=e.children;return Object(r.createElement)(p,{className:a()("components-base-control",s)},Object(r.createElement)(b,{className:"components-base-control__field"},n&&t&&(o?Object(r.createElement)(c.a,{as:"label",htmlFor:t},n):Object(r.createElement)(m,{className:"components-base-control__label",htmlFor:t},n)),n&&!t&&(o?Object(r.createElement)(c.a,{as:"label"},n):Object(r.createElement)(g.VisualLabel,null,n)),u),!!i&&Object(r.createElement)(h,{id:t+"__help",className:"components-base-control__help"},i))}g.VisualLabel=function(e){var t=e.className,n=e.children;return t=a()("components-base-control__label",t),Object(r.createElement)("span",{className:t},n)},t.a=g},function(e,t,n){var r;!function(o){var a=/^\s+/,c=/\s+$/,i=0,s=o.round,u=o.min,l=o.max,f=o.random;function d(e,t){if(t=t||{},(e=e||"")instanceof d)return e;if(!(this instanceof d))return new d(e,t);var n=function(e){var t,n,r,i={r:0,g:0,b:0},s=1,f=null,d=null,p=null,b=!1,m=!1;return"string"==typeof e&&(e=function(e){e=e.replace(a,"").replace(c,"").toLowerCase();var t,n=!1;if(C[e])e=C[e],n=!0;else if("transparent"==e)return{r:0,g:0,b:0,a:0,format:"name"};return(t=q.rgb.exec(e))?{r:t[1],g:t[2],b:t[3]}:(t=q.rgba.exec(e))?{r:t[1],g:t[2],b:t[3],a:t[4]}:(t=q.hsl.exec(e))?{h:t[1],s:t[2],l:t[3]}:(t=q.hsla.exec(e))?{h:t[1],s:t[2],l:t[3],a:t[4]}:(t=q.hsv.exec(e))?{h:t[1],s:t[2],v:t[3]}:(t=q.hsva.exec(e))?{h:t[1],s:t[2],v:t[3],a:t[4]}:(t=q.hex8.exec(e))?{r:D(t[1]),g:D(t[2]),b:D(t[3]),a:V(t[4]),format:n?"name":"hex8"}:(t=q.hex6.exec(e))?{r:D(t[1]),g:D(t[2]),b:D(t[3]),format:n?"name":"hex"}:(t=q.hex4.exec(e))?{r:D(t[1]+""+t[1]),g:D(t[2]+""+t[2]),b:D(t[3]+""+t[3]),a:V(t[4]+""+t[4]),format:n?"name":"hex8"}:!!(t=q.hex3.exec(e))&&{r:D(t[1]+""+t[1]),g:D(t[2]+""+t[2]),b:D(t[3]+""+t[3]),format:n?"name":"hex"}}(e)),"object"==typeof e&&(z(e.r)&&z(e.g)&&z(e.b)?(t=e.r,n=e.g,r=e.b,i={r:255*T(t,255),g:255*T(n,255),b:255*T(r,255)},b=!0,m="%"===String(e.r).substr(-1)?"prgb":"rgb"):z(e.h)&&z(e.s)&&z(e.v)?(f=F(e.s),d=F(e.v),i=function(e,t,n){e=6*T(e,360),t=T(t,100),n=T(n,100);var r=o.floor(e),a=e-r,c=n*(1-t),i=n*(1-a*t),s=n*(1-(1-a)*t),u=r%6;return{r:255*[n,i,c,c,s,n][u],g:255*[s,n,n,i,c,c][u],b:255*[c,c,s,n,n,i][u]}}(e.h,f,d),b=!0,m="hsv"):z(e.h)&&z(e.s)&&z(e.l)&&(f=F(e.s),p=F(e.l),i=function(e,t,n){var r,o,a;function c(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e}if(e=T(e,360),t=T(t,100),n=T(n,100),0===t)r=o=a=n;else{var i=n<.5?n*(1+t):n+t-n*t,s=2*n-i;r=c(s,i,e+1/3),o=c(s,i,e),a=c(s,i,e-1/3)}return{r:255*r,g:255*o,b:255*a}}(e.h,f,p),b=!0,m="hsl"),e.hasOwnProperty("a")&&(s=e.a)),s=N(s),{ok:b,format:e.format||m,r:u(255,l(i.r,0)),g:u(255,l(i.g,0)),b:u(255,l(i.b,0)),a:s}}(e);this._originalInput=e,this._r=n.r,this._g=n.g,this._b=n.b,this._a=n.a,this._roundA=s(100*this._a)/100,this._format=t.format||n.format,this._gradientType=t.gradientType,this._r<1&&(this._r=s(this._r)),this._g<1&&(this._g=s(this._g)),this._b<1&&(this._b=s(this._b)),this._ok=n.ok,this._tc_id=i++}function p(e,t,n){e=T(e,255),t=T(t,255),n=T(n,255);var r,o,a=l(e,t,n),c=u(e,t,n),i=(a+c)/2;if(a==c)r=o=0;else{var s=a-c;switch(o=i>.5?s/(2-a-c):s/(a+c),a){case e:r=(t-n)/s+(t<n?6:0);break;case t:r=(n-e)/s+2;break;case n:r=(e-t)/s+4}r/=6}return{h:r,s:o,l:i}}function b(e,t,n){e=T(e,255),t=T(t,255),n=T(n,255);var r,o,a=l(e,t,n),c=u(e,t,n),i=a,s=a-c;if(o=0===a?0:s/a,a==c)r=0;else{switch(a){case e:r=(t-n)/s+(t<n?6:0);break;case t:r=(n-e)/s+2;break;case n:r=(e-t)/s+4}r/=6}return{h:r,s:o,v:i}}function m(e,t,n,r){var o=[I(s(e).toString(16)),I(s(t).toString(16)),I(s(n).toString(16))];return r&&o[0].charAt(0)==o[0].charAt(1)&&o[1].charAt(0)==o[1].charAt(1)&&o[2].charAt(0)==o[2].charAt(1)?o[0].charAt(0)+o[1].charAt(0)+o[2].charAt(0):o.join("")}function h(e,t,n,r){return[I(L(r)),I(s(e).toString(16)),I(s(t).toString(16)),I(s(n).toString(16))].join("")}function g(e,t){t=0===t?0:t||10;var n=d(e).toHsl();return n.s-=t/100,n.s=M(n.s),d(n)}function v(e,t){t=0===t?0:t||10;var n=d(e).toHsl();return n.s+=t/100,n.s=M(n.s),d(n)}function y(e){return d(e).desaturate(100)}function O(e,t){t=0===t?0:t||10;var n=d(e).toHsl();return n.l+=t/100,n.l=M(n.l),d(n)}function j(e,t){t=0===t?0:t||10;var n=d(e).toRgb();return n.r=l(0,u(255,n.r-s(-t/100*255))),n.g=l(0,u(255,n.g-s(-t/100*255))),n.b=l(0,u(255,n.b-s(-t/100*255))),d(n)}function E(e,t){t=0===t?0:t||10;var n=d(e).toHsl();return n.l-=t/100,n.l=M(n.l),d(n)}function w(e,t){var n=d(e).toHsl(),r=(n.h+t)%360;return n.h=r<0?360+r:r,d(n)}function _(e){var t=d(e).toHsl();return t.h=(t.h+180)%360,d(t)}function S(e){var t=d(e).toHsl(),n=t.h;return[d(e),d({h:(n+120)%360,s:t.s,l:t.l}),d({h:(n+240)%360,s:t.s,l:t.l})]}function k(e){var t=d(e).toHsl(),n=t.h;return[d(e),d({h:(n+90)%360,s:t.s,l:t.l}),d({h:(n+180)%360,s:t.s,l:t.l}),d({h:(n+270)%360,s:t.s,l:t.l})]}function R(e){var t=d(e).toHsl(),n=t.h;return[d(e),d({h:(n+72)%360,s:t.s,l:t.l}),d({h:(n+216)%360,s:t.s,l:t.l})]}function P(e,t,n){t=t||6,n=n||30;var r=d(e).toHsl(),o=360/n,a=[d(e)];for(r.h=(r.h-(o*t>>1)+720)%360;--t;)r.h=(r.h+o)%360,a.push(d(r));return a}function x(e,t){t=t||6;for(var n=d(e).toHsv(),r=n.h,o=n.s,a=n.v,c=[],i=1/t;t--;)c.push(d({h:r,s:o,v:a})),a=(a+i)%1;return c}d.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var e=this.toRgb();return(299*e.r+587*e.g+114*e.b)/1e3},getLuminance:function(){var e,t,n,r=this.toRgb();return e=r.r/255,t=r.g/255,n=r.b/255,.2126*(e<=.03928?e/12.92:o.pow((e+.055)/1.055,2.4))+.7152*(t<=.03928?t/12.92:o.pow((t+.055)/1.055,2.4))+.0722*(n<=.03928?n/12.92:o.pow((n+.055)/1.055,2.4))},setAlpha:function(e){return this._a=N(e),this._roundA=s(100*this._a)/100,this},toHsv:function(){var e=b(this._r,this._g,this._b);return{h:360*e.h,s:e.s,v:e.v,a:this._a}},toHsvString:function(){var e=b(this._r,this._g,this._b),t=s(360*e.h),n=s(100*e.s),r=s(100*e.v);return 1==this._a?"hsv("+t+", "+n+"%, "+r+"%)":"hsva("+t+", "+n+"%, "+r+"%, "+this._roundA+")"},toHsl:function(){var e=p(this._r,this._g,this._b);return{h:360*e.h,s:e.s,l:e.l,a:this._a}},toHslString:function(){var e=p(this._r,this._g,this._b),t=s(360*e.h),n=s(100*e.s),r=s(100*e.l);return 1==this._a?"hsl("+t+", "+n+"%, "+r+"%)":"hsla("+t+", "+n+"%, "+r+"%, "+this._roundA+")"},toHex:function(e){return m(this._r,this._g,this._b,e)},toHexString:function(e){return"#"+this.toHex(e)},toHex8:function(e){return function(e,t,n,r,o){var a=[I(s(e).toString(16)),I(s(t).toString(16)),I(s(n).toString(16)),I(L(r))];return o&&a[0].charAt(0)==a[0].charAt(1)&&a[1].charAt(0)==a[1].charAt(1)&&a[2].charAt(0)==a[2].charAt(1)&&a[3].charAt(0)==a[3].charAt(1)?a[0].charAt(0)+a[1].charAt(0)+a[2].charAt(0)+a[3].charAt(0):a.join("")}(this._r,this._g,this._b,this._a,e)},toHex8String:function(e){return"#"+this.toHex8(e)},toRgb:function(){return{r:s(this._r),g:s(this._g),b:s(this._b),a:this._a}},toRgbString:function(){return 1==this._a?"rgb("+s(this._r)+", "+s(this._g)+", "+s(this._b)+")":"rgba("+s(this._r)+", "+s(this._g)+", "+s(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:s(100*T(this._r,255))+"%",g:s(100*T(this._g,255))+"%",b:s(100*T(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return 1==this._a?"rgb("+s(100*T(this._r,255))+"%, "+s(100*T(this._g,255))+"%, "+s(100*T(this._b,255))+"%)":"rgba("+s(100*T(this._r,255))+"%, "+s(100*T(this._g,255))+"%, "+s(100*T(this._b,255))+"%, "+this._roundA+")"},toName:function(){return 0===this._a?"transparent":!(this._a<1)&&(A[m(this._r,this._g,this._b,!0)]||!1)},toFilter:function(e){var t="#"+h(this._r,this._g,this._b,this._a),n=t,r=this._gradientType?"GradientType = 1, ":"";if(e){var o=d(e);n="#"+h(o._r,o._g,o._b,o._a)}return"progid:DXImageTransform.Microsoft.gradient("+r+"startColorstr="+t+",endColorstr="+n+")"},toString:function(e){var t=!!e;e=e||this._format;var n=!1,r=this._a<1&&this._a>=0;return t||!r||"hex"!==e&&"hex6"!==e&&"hex3"!==e&&"hex4"!==e&&"hex8"!==e&&"name"!==e?("rgb"===e&&(n=this.toRgbString()),"prgb"===e&&(n=this.toPercentageRgbString()),"hex"!==e&&"hex6"!==e||(n=this.toHexString()),"hex3"===e&&(n=this.toHexString(!0)),"hex4"===e&&(n=this.toHex8String(!0)),"hex8"===e&&(n=this.toHex8String()),"name"===e&&(n=this.toName()),"hsl"===e&&(n=this.toHslString()),"hsv"===e&&(n=this.toHsvString()),n||this.toHexString()):"name"===e&&0===this._a?this.toName():this.toRgbString()},clone:function(){return d(this.toString())},_applyModification:function(e,t){var n=e.apply(null,[this].concat([].slice.call(t)));return this._r=n._r,this._g=n._g,this._b=n._b,this.setAlpha(n._a),this},lighten:function(){return this._applyModification(O,arguments)},brighten:function(){return this._applyModification(j,arguments)},darken:function(){return this._applyModification(E,arguments)},desaturate:function(){return this._applyModification(g,arguments)},saturate:function(){return this._applyModification(v,arguments)},greyscale:function(){return this._applyModification(y,arguments)},spin:function(){return this._applyModification(w,arguments)},_applyCombination:function(e,t){return e.apply(null,[this].concat([].slice.call(t)))},analogous:function(){return this._applyCombination(P,arguments)},complement:function(){return this._applyCombination(_,arguments)},monochromatic:function(){return this._applyCombination(x,arguments)},splitcomplement:function(){return this._applyCombination(R,arguments)},triad:function(){return this._applyCombination(S,arguments)},tetrad:function(){return this._applyCombination(k,arguments)}},d.fromRatio=function(e,t){if("object"==typeof e){var n={};for(var r in e)e.hasOwnProperty(r)&&(n[r]="a"===r?e[r]:F(e[r]));e=n}return d(e,t)},d.equals=function(e,t){return!(!e||!t)&&d(e).toRgbString()==d(t).toRgbString()},d.random=function(){return d.fromRatio({r:f(),g:f(),b:f()})},d.mix=function(e,t,n){n=0===n?0:n||50;var r=d(e).toRgb(),o=d(t).toRgb(),a=n/100;return d({r:(o.r-r.r)*a+r.r,g:(o.g-r.g)*a+r.g,b:(o.b-r.b)*a+r.b,a:(o.a-r.a)*a+r.a})},d.readability=function(e,t){var n=d(e),r=d(t);return(o.max(n.getLuminance(),r.getLuminance())+.05)/(o.min(n.getLuminance(),r.getLuminance())+.05)},d.isReadable=function(e,t,n){var r,o,a,c,i,s=d.readability(e,t);switch(o=!1,(a=n,"AA"!==(c=((a=a||{level:"AA",size:"small"}).level||"AA").toUpperCase())&&"AAA"!==c&&(c="AA"),"small"!==(i=(a.size||"small").toLowerCase())&&"large"!==i&&(i="small"),r={level:c,size:i}).level+r.size){case"AAsmall":case"AAAlarge":o=s>=4.5;break;case"AAlarge":o=s>=3;break;case"AAAsmall":o=s>=7}return o},d.mostReadable=function(e,t,n){var r,o,a,c,i=null,s=0;o=(n=n||{}).includeFallbackColors,a=n.level,c=n.size;for(var u=0;u<t.length;u++)(r=d.readability(e,t[u]))>s&&(s=r,i=d(t[u]));return d.isReadable(e,i,{level:a,size:c})||!o?i:(n.includeFallbackColors=!1,d.mostReadable(e,["#fff","#000"],n))};var C=d.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",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:"f0f",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:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",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",rebeccapurple:"663399",red:"f00",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:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},A=d.hexNames=function(e){var t={};for(var n in e)e.hasOwnProperty(n)&&(t[e[n]]=n);return t}(C);function N(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}function T(e,t){(function(e){return"string"==typeof e&&-1!=e.indexOf(".")&&1===parseFloat(e)})(e)&&(e="100%");var n=function(e){return"string"==typeof e&&-1!=e.indexOf("%")}(e);return e=u(t,l(0,parseFloat(e))),n&&(e=parseInt(e*t,10)/100),o.abs(e-t)<1e-6?1:e%t/parseFloat(t)}function M(e){return u(1,l(0,e))}function D(e){return parseInt(e,16)}function I(e){return 1==e.length?"0"+e:""+e}function F(e){return e<=1&&(e=100*e+"%"),e}function L(e){return o.round(255*parseFloat(e)).toString(16)}function V(e){return D(e)/255}var U,B,H,q=(B="[\\s|\\(]+("+(U="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)")+")[,|\\s]+("+U+")[,|\\s]+("+U+")\\s*\\)?",H="[\\s|\\(]+("+U+")[,|\\s]+("+U+")[,|\\s]+("+U+")[,|\\s]+("+U+")\\s*\\)?",{CSS_UNIT:new RegExp(U),rgb:new RegExp("rgb"+B),rgba:new RegExp("rgba"+H),hsl:new RegExp("hsl"+B),hsla:new RegExp("hsla"+H),hsv:new RegExp("hsv"+B),hsva:new RegExp("hsva"+H),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/});function z(e){return!!q.CSS_UNIT.exec(e)}e.exports?e.exports=d:void 0===(r=function(){return d}.call(t,n,t,e))||(e.exports=r)}(Math)},function(e,t,n){"use strict";e.exports=n(270)},,,,function(e,t,n){"use strict";n.d(t,"b",(function(){return C})),n.d(t,"a",(function(){return A}));var r=n(4),o=n.n(r),a=n(5),c=n.n(a),i=(n(10),n(0)),s=n(11),u=n(12),l=n(27),f=n.n(l);function d(e,t,n,r,o,a,c){try{var i=e[a](c),s=i.value}catch(e){return void n(e)}i.done?t(s):Promise.resolve(s).then(r,o)}function p(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var a=e.apply(t,n);function c(e){d(a,r,o,c,i,"next",e)}function i(e){d(a,r,o,c,i,"throw",e)}c(void 0)}))}}var b=n(22),m=n(6),h=n.n(m),g=n(7),v=n(117),y=n(24),O=n(134),j=function(e){var t=e.notices,n=e.className,r=e.children,o=e.onRemove,a=void 0===o?g.noop:o,c=Object(y.useReducedMotion)(),s=Object(i.useState)((function(){return new WeakMap})),l=Object(b.a)(s,1)[0],d=Object(v.useTransition)(t,(function(e){return e.id}),{from:{opacity:0,height:0},enter:function(e){return function(){var t=p(f.a.mark((function t(n){return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,n({opacity:1,height:l.get(e).offsetHeight});case 2:return t.abrupt("return",t.sent);case 3:case"end":return t.stop()}}),t)})));return function(_x){return t.apply(this,arguments)}}()},leave:function(){return function(){var e=p(f.a.mark((function e(t){return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t({opacity:0});case 2:return e.next=4,t({height:0});case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()},immediate:c});n=h()("components-snackbar-list",n);var m=function(e){return function(){return a(e.id)}};return Object(i.createElement)("div",{className:n},r,d.map((function(e){var t=e.item,n=e.key,r=e.props;return Object(i.createElement)(v.animated.div,{key:n,style:r},Object(i.createElement)("div",{className:"components-snackbar-list__notice-container",ref:function(e){return e&&l.set(t,e)}},Object(i.createElement)(O.a,Object(u.a)({},Object(g.omit)(t,["content"]),{onRemove:m(t)}),t.content)))})))},E=n(26),w={},_=function(e){var t=e.className,n=e.notices,r=e.removeNotice;if(e.isEditor)return null;var o=n.filter((function(e){return"snackbar"===e.type})),a=o.length>0?o.reduce((function(e,t){return e[t.content]=!0,e}),{}):w,c=Object(E.__experimentalApplyCheckoutFilter)({filterName:"snackbarNoticeVisibility",defaultValue:a}),i=o.filter((function(e){return!0===c[e.content]})),s=h()(t,"wc-block-components-notices__snackbar");return React.createElement(j,{notices:i,className:s,onRemove:r})},S=n(52),k=n(36);function R(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function P(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?R(Object(n),!0).forEach((function(t){o()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):R(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var x=Object(i.createContext)({notices:[],createSnackbarNotice:function(e,t){},removeSnackbarNotice:function(e,t){},setIsSuppressed:function(e){},context:"wc/core"}),C=function(){return Object(i.useContext)(x)},A=function(e){var t=e.children,n=e.context,r=void 0===n?"wc/core":n,o=Object(s.useDispatch)("core/notices"),a=o.createNotice,u=o.removeNotice,l=Object(i.useState)(!1),f=c()(l,2),d=f[0],p=f[1],b=Object(S.a)().dispatchStoreEvent,m=Object(k.a)().isEditor,h=Object(i.useCallback)((function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};a("default",e,P(P({},t),{},{type:"snackbar",context:t.context||r})),b("store-notice-create",{status:"default",content:e,options:t})}),[a,b,r]),g=Object(i.useCallback)((function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:r;u(e,t)}),[u,r]),v={notices:Object(s.useSelect)((function(e){return{notices:e("core/notices").getNotices(r)}}),[r]).notices,createSnackbarNotice:h,removeSnackbarNotice:g,context:r,setIsSuppressed:p},y=d?null:React.createElement(_,{notices:v.notices,removeNotice:v.removeSnackbarNotice,isEditor:m});return React.createElement(x.Provider,{value:v},t,y)}},,function(e,t,n){"use strict";(function(e){var r=n(5),o=n.n(r),a=n(1),c=n(0),i=n(192),s=n(143),u=n(83),l=n(48),f=n(187),d=n(302),p=(n(301),function(e){return Object.values(e).reduce((function(e,t){return null!==t.icons&&(e=e.concat(t.icons)),e}),[])});t.a=function(t){var n=t.link,r=Object(l.b)().isCalculating,b=Object(d.a)(),m=o()(b,2),h=m[0],g=m[1],v=Object(c.useState)(!1),y=o()(v,2),O=y[0],j=y[1],E=Object(f.b)().paymentMethods;Object(c.useEffect)((function(){if("function"==typeof e.addEventListener&&"function"==typeof e.removeEventListener){var t=function(){j(!1)};return e.addEventListener("pageshow",t),function(){e.removeEventListener("pageshow",t)}}}),[]);var w=React.createElement(React.Fragment,null,React.createElement(s.a,{className:"wc-block-cart__submit-button",href:n||u.d,disabled:r,onClick:function(){return j(!0)},showSpinner:O},Object(a.__)("Proceed to Checkout",'woocommerce')),React.createElement(i.a,{icons:p(E)}));return React.createElement("div",{className:"wc-block-cart__submit"},h,React.createElement("div",{className:"wc-block-cart__submit-container"},w),"below"===g&&React.createElement("div",{className:"wc-block-cart__submit-container wc-block-cart__submit-container--sticky"},w))}}).call(this,n(273))},,,,,,,,,,,,,,,,,,,,function(e,t){},,function(e,t){},function(e,t){},function(e,t){},function(e,t){},,,function(e,t){},function(e,t){},function(e,t,n){"use strict";n.d(t,"a",(function(){return o})),n(10);var r=n(127),o=(n(250),function(e){var t=e.errorMessage,n=void 0===t?"":t,o=e.propertyName,a=void 0===o?"":o,c=e.elementId,i=void 0===c?"":c,s=Object(r.b)(),u=s.getValidationError,l=s.getValidationErrorId;if(!n||"string"!=typeof n){var f=u(a)||{};if(!f.message||f.hidden)return null;n=f.message}return React.createElement("div",{className:"wc-block-components-validation-error",role:"alert"},React.createElement("p",{id:l(i)},n))})},function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t,n){"use strict";var r=n(14),o=n.n(r),a=n(28),c=n(2);t.a=function(e){var t=e.image,n=void 0===t?{}:t,r={src:n.thumbnail||c.PLACEHOLDER_IMG_SRC,alt:Object(a.decodeEntities)(n.alt)||""};return React.createElement("img",o()({},r,{alt:r.alt}))}},function(e,t,n){"use strict";var r=n(1),o=n(106);t.a=function(){return React.createElement(o.a,{className:"wc-block-components-product-backorder-badge"},Object(r.__)("Available on backorder",'woocommerce'))}},function(e,t,n){"use strict";var r=n(1),o=n(106);t.a=function(e){var t=e.lowStockRemaining;return t?React.createElement(o.a,{className:"wc-block-components-product-low-stock-badge"},Object(r.sprintf)(
/* translators: %d stock amount (number of items in stock for product) */
Object(r.__)("%d left in stock",'woocommerce'),t)):null}},function(e,t,n){"use strict";var r=n(7),o=n(28),a=(n(186),function(e){var t=e.details,n=void 0===t?[]:t;return Array.isArray(n)?0===(n=n.filter((function(e){return!e.hidden}))).length?null:React.createElement("ul",{className:"wc-block-components-product-details"},n.map((function(e){var t=e.name?"wc-block-components-product-details__".concat(Object(r.kebabCase)(e.name)):"";return React.createElement("li",{key:e.name+(e.display||e.value),className:t},e.name&&React.createElement(React.Fragment,null,React.createElement("span",{className:"wc-block-components-product-details__name"},Object(o.decodeEntities)(e.name),":")," "),React.createElement("span",{className:"wc-block-components-product-details__value"},Object(o.decodeEntities)(e.display||e.value)))}))):null}),c=n(151),i=n(83),s=function(e){var t=e.className,n=e.shortDescription,r=void 0===n?"":n,o=e.fullDescription,a=r||(void 0===o?"":o);return a?React.createElement(c.a,{className:t,source:a,maxLength:15,countType:i.n.wordCountType||"words"}):null};n(185),t.a=function(e){var t=e.shortDescription,n=void 0===t?"":t,r=e.fullDescription,o=void 0===r?"":r,c=e.itemData,i=void 0===c?[]:c,u=e.variation,l=void 0===u?[]:u;return React.createElement("div",{className:"wc-block-components-product-metadata"},React.createElement(s,{className:"wc-block-components-product-metadata__description",shortDescription:n,fullDescription:o}),React.createElement(a,{details:i}),React.createElement(a,{details:l.map((function(e){var t=e.attribute;return{name:void 0===t?"":t,value:e.value}}))}))}},function(e,t,n){"use strict";var r=n(271);e.exports=function(e,t,n){n=n||{},9===t.nodeType&&(t=r.getWindow(t));var o=n.allowHorizontalScroll,a=n.onlyScrollIfNeeded,c=n.alignWithTop,i=n.alignWithLeft,s=n.offsetTop||0,u=n.offsetLeft||0,l=n.offsetBottom||0,f=n.offsetRight||0;o=void 0===o||o;var d=r.isWindow(t),p=r.offset(e),b=r.outerHeight(e),m=r.outerWidth(e),h=void 0,g=void 0,v=void 0,y=void 0,O=void 0,j=void 0,E=void 0,w=void 0,_=void 0,S=void 0;d?(E=t,S=r.height(E),_=r.width(E),w={left:r.scrollLeft(E),top:r.scrollTop(E)},O={left:p.left-w.left-u,top:p.top-w.top-s},j={left:p.left+m-(w.left+_)+f,top:p.top+b-(w.top+S)+l},y=w):(h=r.offset(t),g=t.clientHeight,v=t.clientWidth,y={left:t.scrollLeft,top:t.scrollTop},O={left:p.left-(h.left+(parseFloat(r.css(t,"borderLeftWidth"))||0))-u,top:p.top-(h.top+(parseFloat(r.css(t,"borderTopWidth"))||0))-s},j={left:p.left+m-(h.left+v+(parseFloat(r.css(t,"borderRightWidth"))||0))+f,top:p.top+b-(h.top+g+(parseFloat(r.css(t,"borderBottomWidth"))||0))+l}),O.top<0||j.top>0?!0===c?r.scrollTop(t,y.top+O.top):!1===c?r.scrollTop(t,y.top+j.top):O.top<0?r.scrollTop(t,y.top+O.top):r.scrollTop(t,y.top+j.top):a||((c=void 0===c||!!c)?r.scrollTop(t,y.top+O.top):r.scrollTop(t,y.top+j.top)),o&&(O.left<0||j.left>0?!0===i?r.scrollLeft(t,y.left+O.left):!1===i?r.scrollLeft(t,y.left+j.left):O.left<0?r.scrollLeft(t,y.left+O.left):r.scrollLeft(t,y.left+j.left):a||((i=void 0===i||!!i)?r.scrollLeft(t,y.left+O.left):r.scrollLeft(t,y.left+j.left)))}},function(e,t,n){"use strict";var r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};function a(e,t){var n=e["page"+(t?"Y":"X")+"Offset"],r="scroll"+(t?"Top":"Left");if("number"!=typeof n){var o=e.document;"number"!=typeof(n=o.documentElement[r])&&(n=o.body[r])}return n}function c(e){return a(e)}function i(e){return a(e,!0)}function s(e){var t=function(e){var t,n=void 0,r=void 0,o=e.ownerDocument,a=o.body,c=o&&o.documentElement;return n=(t=e.getBoundingClientRect()).left,r=t.top,{left:n-=c.clientLeft||a.clientLeft||0,top:r-=c.clientTop||a.clientTop||0}}(e),n=e.ownerDocument,r=n.defaultView||n.parentWindow;return t.left+=c(r),t.top+=i(r),t}var u=new RegExp("^("+/[\-+]?(?:\d*\.|)\d+(?:[eE][\-+]?\d+|)/.source+")(?!px)[a-z%]+$","i"),l=/^(top|right|bottom|left)$/,f="left",d=void 0;function p(e,t){for(var n=0;n<e.length;n++)t(e[n])}function b(e){return"border-box"===d(e,"boxSizing")}"undefined"!=typeof window&&(d=window.getComputedStyle?function(e,t,n){var r="",o=e.ownerDocument,a=n||o.defaultView.getComputedStyle(e,null);return a&&(r=a.getPropertyValue(t)||a[t]),r}:function(e,t){var n=e.currentStyle&&e.currentStyle[t];if(u.test(n)&&!l.test(t)){var r=e.style,o=r[f],a=e.runtimeStyle[f];e.runtimeStyle[f]=e.currentStyle[f],r[f]="fontSize"===t?"1em":n||0,n=r.pixelLeft+"px",r[f]=o,e.runtimeStyle[f]=a}return""===n?"auto":n});var m=["margin","border","padding"];function h(e,t,n){var r={},o=e.style,a=void 0;for(a in t)t.hasOwnProperty(a)&&(r[a]=o[a],o[a]=t[a]);for(a in n.call(e),t)t.hasOwnProperty(a)&&(o[a]=r[a])}function g(e,t,n){var r=0,o=void 0,a=void 0,c=void 0;for(a=0;a<t.length;a++)if(o=t[a])for(c=0;c<n.length;c++){var i;i="border"===o?o+n[c]+"Width":o+n[c],r+=parseFloat(d(e,i))||0}return r}function v(e){return null!=e&&e==e.window}var y={};function O(e,t,n){if(v(e))return"width"===t?y.viewportWidth(e):y.viewportHeight(e);if(9===e.nodeType)return"width"===t?y.docWidth(e):y.docHeight(e);var r="width"===t?["Left","Right"]:["Top","Bottom"],o="width"===t?e.offsetWidth:e.offsetHeight,a=(d(e),b(e)),c=0;(null==o||o<=0)&&(o=void 0,(null==(c=d(e,t))||Number(c)<0)&&(c=e.style[t]||0),c=parseFloat(c)||0),void 0===n&&(n=a?1:-1);var i=void 0!==o||a,s=o||c;if(-1===n)return i?s-g(e,["border","padding"],r):c;if(i){var u=2===n?-g(e,["border"],r):g(e,["margin"],r);return s+(1===n?0:u)}return c+g(e,m.slice(n),r)}p(["Width","Height"],(function(e){y["doc"+e]=function(t){var n=t.document;return Math.max(n.documentElement["scroll"+e],n.body["scroll"+e],y["viewport"+e](n))},y["viewport"+e]=function(t){var n="client"+e,r=t.document,o=r.body,a=r.documentElement[n];return"CSS1Compat"===r.compatMode&&a||o&&o[n]||a}}));var j={position:"absolute",visibility:"hidden",display:"block"};function E(e){var t=void 0,n=arguments;return 0!==e.offsetWidth?t=O.apply(void 0,n):h(e,j,(function(){t=O.apply(void 0,n)})),t}function w(e,t,n){var r=n;if("object"!==(void 0===t?"undefined":o(t)))return void 0!==r?("number"==typeof r&&(r+="px"),void(e.style[t]=r)):d(e,t);for(var a in t)t.hasOwnProperty(a)&&w(e,a,t[a])}p(["width","height"],(function(e){var t=e.charAt(0).toUpperCase()+e.slice(1);y["outer"+t]=function(t,n){return t&&E(t,e,n?0:1)};var n="width"===e?["Left","Right"]:["Top","Bottom"];y[e]=function(t,r){return void 0===r?t&&E(t,e,-1):t?(d(t),b(t)&&(r+=g(t,["padding","border"],n)),w(t,e,r)):void 0}})),e.exports=r({getWindow:function(e){var t=e.ownerDocument||e;return t.defaultView||t.parentWindow},offset:function(e,t){if(void 0===t)return s(e);!function(e,t){"static"===w(e,"position")&&(e.style.position="relative");var n=s(e),r={},o=void 0,a=void 0;for(a in t)t.hasOwnProperty(a)&&(o=parseFloat(w(e,a))||0,r[a]=o+t[a]-n[a]);w(e,r)}(e,t)},isWindow:v,each:p,css:w,clone:function(e){var t={};for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);if(e.overflow)for(var n in e)e.hasOwnProperty(n)&&(t.overflow[n]=e.overflow[n]);return t},scrollLeft:function(e,t){if(v(e)){if(void 0===t)return c(e);window.scrollTo(t,i(e))}else{if(void 0===t)return e.scrollLeft;e.scrollLeft=t}},scrollTop:function(e,t){if(v(e)){if(void 0===t)return i(e);window.scrollTo(c(e),t)}else{if(void 0===t)return e.scrollTop;e.scrollTop=t}},viewportWidth:0,viewportHeight:0},y)},function(e,t){},function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n},,,function(e,t,n){"use strict";var r=n(14),o=n.n(r),a=n(4),c=n.n(a),i=n(5),s=n.n(i),u=n(23),l=n.n(u),f=n(1),d=n(3),p=n(6),b=n.n(p),m=n(127),h=n(48),g=n(258),v=n(24),y=n(49),O=n(0),j=n(51),E=(n(206),["className","id","type","ariaLabel","ariaDescribedBy","label","screenReaderLabel","disabled","help","autoCapitalize","autoComplete","value","onChange","required","onBlur","feedback"]),w=Object(d.forwardRef)((function(e,t){var n=e.className,r=e.id,a=e.type,c=void 0===a?"text":a,i=e.ariaLabel,u=e.ariaDescribedBy,f=e.label,d=e.screenReaderLabel,p=e.disabled,m=e.help,h=e.autoCapitalize,g=void 0===h?"off":h,v=e.autoComplete,y=void 0===v?"off":v,w=e.value,_=void 0===w?"":w,S=e.onChange,k=e.required,R=void 0!==k&&k,P=e.onBlur,x=void 0===P?function(){}:P,C=e.feedback,A=l()(e,E),N=Object(O.useState)(!1),T=s()(N,2),M=T[0],D=T[1];return React.createElement("div",{className:b()("wc-block-components-text-input",n,{"is-active":M||_})},React.createElement("input",o()({type:c,id:r,value:_,ref:t,autoCapitalize:g,autoComplete:y,onChange:function(e){S(e.target.value)},onFocus:function(){return D(!0)},onBlur:function(e){x(e.target.value),D(!1)},"aria-label":i||f,disabled:p,"aria-describedby":m&&!u?r+"__help":u,required:R},A)),React.createElement(j.a,{label:f,screenReaderLabel:d||f,wrapperElement:"label",wrapperProps:{htmlFor:r},htmlFor:r}),!!m&&React.createElement("p",{id:r+"__help",className:"wc-block-components-text-input__help"},m),C)})),_=["className","instanceId","id","ariaDescribedBy","errorId","validateOnMount","focusOnMount","onChange","showError","errorMessage"];t.a=Object(v.withInstanceId)((function(e){var t=e.className,n=e.instanceId,r=e.id,a=e.ariaDescribedBy,i=e.errorId,u=e.validateOnMount,p=void 0===u||u,v=e.focusOnMount,O=void 0!==v&&v,j=e.onChange,E=e.showError,S=void 0===E||E,k=e.errorMessage,R=void 0===k?"":k,P=l()(e,_),x=Object(d.useState)(!0),C=s()(x,2),A=C[0],N=C[1],T=Object(d.useRef)(null),M=Object(m.b)(),D=M.getValidationError,I=M.hideValidationError,F=M.setValidationErrors,L=M.clearValidationError,V=M.getValidationErrorId,U=Object(h.b)().isBeforeProcessing,B=void 0!==r?r:"textinput-"+n,H=void 0!==i?i:B,q=Object(d.useCallback)((function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=T.current||null;if(t){t.value=t.value.trim();var n=t.checkValidity();n?L(H):F(c()({},H,{message:t.validationMessage||Object(f.__)("Invalid value.",'woocommerce'),hidden:e}))}}),[L,H,F]);Object(d.useEffect)((function(){var e;A&&(O&&(null===(e=T.current)||void 0===e||e.focus()),N(!1))}),[O,A,N]),Object(d.useEffect)((function(){A&&(p&&q(),N(!1))}),[A,N,p,q]),Object(d.useEffect)((function(){U&&q()}),[U,q]),Object(d.useEffect)((function(){return function(){L(H)}}),[L,H]);var z=D(H)||{};Object(y.c)(R)&&""!==R&&(z.message=R);var W=z.message&&!z.hidden,G=S&&W&&V(H)?V(H):a;return React.createElement(w,o()({className:b()(t,{"has-error":W}),"aria-invalid":!0===W,id:B,onBlur:function(){q(!1)},feedback:S&&React.createElement(g.a,{errorMessage:R,propertyName:H}),ref:T,onChange:function(e){I(H),j(e)},ariaDescribedBy:G},P))}))},function(e,t,n){"use strict";var r=n(6),o=n.n(r),a=(n(10),n(201));n(189),t.a=function(e){var t=e.children,n=e.className;return React.createElement(a.a,{className:o()("wc-block-components-sidebar-layout",n)},t)}},function(e,t,n){"use strict";n.d(t,"a",(function(){return b}));var r=n(5),o=n.n(r),a=n(11),c=n(0),i=n(8),s=n(115),u=n(99),l=n(137),f=n(49),d=n(32),p=n(48),b=function(e){var t={key:"",quantity:1};(function(e){return Object(f.b)(e)&&Object(f.d)(e,"key")&&Object(f.d)(e,"quantity")&&Object(f.c)(e.key)&&Object(f.a)(e.quantity)})(e)&&(t.key=e.key,t.quantity=e.quantity);var n=t.key,r=void 0===n?"":n,b=t.quantity,m=void 0===b?1:b,h=Object(d.a)().cartErrors,g=Object(p.b)().dispatchActions,v=Object(c.useState)(m),y=o()(v,2),O=y[0],j=y[1],E=Object(s.a)(O,400),w=o()(E,1)[0],_=Object(u.a)(w),S=Object(a.useDispatch)(i.CART_STORE_KEY),k=S.removeItemFromCart,R=S.changeCartItemQuantity,P=Object(a.useSelect)((function(e){if(!r)return{quantity:!1,delete:!1};var t=e(i.CART_STORE_KEY);return{quantity:t.isItemPendingQuantity(r),delete:t.isItemPendingDelete(r)}}),[r]),x=Object(c.useCallback)((function(){return r?k(r).then((function(){return Object(l.c)(),!0})):Promise.resolve(!1)}),[r,k]);return Object(c.useEffect)((function(){r&&Object(f.a)(_)&&Number.isFinite(_)&&_!==w&&R(r,w)}),[r,R,w,_]),Object(c.useEffect)((function(){return P.delete?g.incrementCalculating():g.decrementCalculating(),function(){P.delete&&g.decrementCalculating()}}),[g,P.delete]),Object(c.useEffect)((function(){return P.quantity||w!==O?g.incrementCalculating():g.decrementCalculating(),function(){(P.quantity||w!==O)&&g.decrementCalculating()}}),[g,P.quantity,w,O]),{isPendingDelete:P.delete,quantity:O,setItemQuantity:j,removeItem:x,cartItemQuantityErrors:h}}},function(e,t,n){"use strict";var r=n(0),o=n(1),a=n(69),c=n(106);t.a=function(e){var t=e.currency,n=e.saleAmount,i=e.format,s=void 0===i?"<price/>":i;if(!n||n<=0)return null;s.includes("<price/>")||(s="<price/>",console.error("Price formats need to include the `<price/>` tag."));var u=Object(o.sprintf)(
/* translators: %s will be replaced by the discount amount */
Object(o.__)("Save %s",'woocommerce'),s);return React.createElement(c.a,{className:"wc-block-components-sale-badge"},Object(r.createInterpolateElement)(u,{price:React.createElement(a.a,{currency:t,value:n})}))}},,,,,,,,,,,,,,,,,,,function(e,t,n){e.exports=n(319)},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(146),o=function(e){var t=e.children,n=e.redirectUrl;return React.createElement(r.a,{isCart:!0,redirectUrl:n},t)}},function(e,t){},function(e,t){},function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(5),o=n.n(r),a=n(0),c={bottom:0,left:0,opacity:0,pointerEvents:"none",position:"absolute",right:0,top:0,zIndex:-1},i=function(){var e=Object(a.useState)(""),t=o()(e,2),n=t[0],r=t[1],i=Object(a.useRef)(null),s=Object(a.useRef)(new IntersectionObserver((function(e){e[0].isIntersecting?r("visible"):r(e[0].boundingClientRect.top>0?"below":"above")}),{threshold:1}));return Object(a.useLayoutEffect)((function(){var e=i.current,t=s.current;return e&&t.observe(e),function(){t.unobserve(e)}}),[]),[React.createElement("div",{"aria-hidden":!0,ref:i,style:c}),n]}},,,,,,,,,,,,,,,,function(e,t,n){"use strict";n.d(t,"a",(function(){return C}));var r=n(1),o=n(58),a=n(0),c=n(6),i=n.n(c),s=n(34),u=React.createElement(s.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},React.createElement("path",{fill:"none",d:"M0 0h24v24H0z"}),React.createElement("path",{d:"M4 10h3v7H4zM10.5 10h3v7h-3zM2 19h20v3H2zM17 10h3v7h-3zM12 1L2 6v2h20V6z"})),l=React.createElement(s.SVG,{xmlns:"http://www.w3.org/2000/SVG",viewBox:"0 0 24 24"},React.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),React.createElement("path",{d:"M11 17h2v-1h1c.55 0 1-.45 1-1v-3c0-.55-.45-1-1-1h-3v-1h4V8h-2V7h-2v1h-1c-.55 0-1 .45-1 1v3c0 .55.45 1 1 1h3v1H9v2h2v1zm9-13H4c-1.11 0-1.99.89-1.99 2L2 18c0 1.11.89 2 2 2h16c1.11 0 2-.89 2-2V6c0-1.11-.89-2-2-2zm0 14H4V6h16v12z"})),f=n(339),d=React.createElement(s.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},React.createElement("g",{fill:"none",fillRule:"evenodd"},React.createElement("path",{d:"M0 0h24v24H0z"}),React.createElement("path",{fill:"#000",fillRule:"nonzero",d:"M17.3 8v1c1 .2 1.4.9 1.4 1.7h-1c0-.6-.3-1-1-1-.8 0-1.3.4-1.3.9 0 .4.3.6 1.4 1 1 .2 2 .6 2 1.9 0 .9-.6 1.4-1.5 1.5v1H16v-1c-.9-.1-1.6-.7-1.7-1.7h1c0 .6.4 1 1.3 1 1 0 1.2-.5 1.2-.8 0-.4-.2-.8-1.3-1.1-1.3-.3-2.1-.8-2.1-1.8 0-.9.7-1.5 1.6-1.6V8h1.3zM12 10v1H6v-1h6zm2-2v1H6V8h8zM2 4v16h20V4H2zm2 14V6h16v12H4z"}),React.createElement("path",{stroke:"#000",strokeLinecap:"round",d:"M6 16c2.6 0 3.9-3 1.7-3-2 0-1 3 1.5 3 1 0 1-.8 2.8-.8"}))),p=n(152),b=n(49),m=(n(272),{bank:u,bill:l,card:f.a,checkPayment:d}),h=function(e){var t=e.icon,n=void 0===t?"":t,r=e.text,o=void 0===r?"":r,c=!!n,s=Object(a.useCallback)((function(e){return c&&Object(b.c)(e)&&Object(b.d)(m,e)}),[c]),u=i()("wc-block-components-payment-method-label",{"wc-block-components-payment-method-label--with-icon":c});return React.createElement("span",{className:u},s(n)?React.createElement(p.a,{srcElement:m[n]}):n,o)},g=n(192),v=n(2),y=n(45),O=n.n(y),j=n(258),E=n(32),w=n(214),_=n(35),S=n(48),k=n(173),R=n(66),P=n(60),x=function(e,t){var n=[],o=function(t,n){var r=n+"_tax",o=Object(b.d)(e,n)&&Object(b.c)(e[n])?parseInt(e[n],10):0;return{key:n,label:t,value:o,valueWithTax:o+(Object(b.d)(e,r)&&Object(b.c)(e[r])?parseInt(e[r],10):0)}};return n.push(o(Object(r.__)("Subtotal:",'woocommerce'),"total_items")),n.push(o(Object(r.__)("Fees:",'woocommerce'),"total_fees")),n.push(o(Object(r.__)("Discount:",'woocommerce'),"total_discount")),n.push({key:"total_tax",label:Object(r.__)("Taxes:",'woocommerce'),value:parseInt(e.total_tax,10),valueWithTax:parseInt(e.total_tax,10)}),t&&n.push(o(Object(r.__)("Shipping:",'woocommerce'),"total_shipping")),n},C=function(){var e=Object(S.b)(),t=e.isCalculating,n=e.isComplete,c=e.isIdle,i=e.isProcessing,s=e.onCheckoutBeforeProcessing,u=e.onCheckoutValidationBeforeProcessing,l=e.onCheckoutAfterProcessingWithSuccess,f=e.onCheckoutAfterProcessingWithError,d=e.onSubmit,p=e.customerId,b=Object(k.b)(),m=b.currentStatus,y=b.activePaymentMethod,C=b.onPaymentProcessing,A=b.setExpressPaymentError,N=b.shouldSavePayment,T=Object(R.b)(),M=T.shippingErrorStatus,D=T.shippingErrorTypes,I=T.shippingRates,F=T.shippingRatesLoading,L=T.selectedRates,V=T.setSelectedRates,U=T.isSelectingRate,B=T.onShippingRateSuccess,H=T.onShippingRateFail,q=T.onShippingRateSelectSuccess,z=T.onShippingRateSelectFail,W=T.needsShipping,G=Object(P.b)(),Y=G.billingData,$=G.shippingAddress,K=G.setShippingAddress,X=Object(E.a)().cartTotals,Q=Object(w.a)().appliedCoupons,Z=Object(_.c)(),J=Z.noticeContexts,ee=Z.responseTypes,te=Object(a.useRef)(x(X,W)),ne=Object(a.useRef)({label:Object(r.__)("Total",'woocommerce'),value:parseInt(X.total_price,10)});Object(a.useEffect)((function(){te.current=x(X,W),ne.current={label:Object(r.__)("Total",'woocommerce'),value:parseInt(X.total_price,10)}}),[X,W]);var re=Object(a.useCallback)((function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";O()("setExpressPaymentError should only be used by Express Payment Methods (using the provided onError handler).",{alternative:"",plugin:"woocommerce-gutenberg-products-block",link:"https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/4228"}),A(e)}),[A]);return{activePaymentMethod:y,billing:{billingData:Y,cartTotal:ne.current,currency:Object(o.getCurrencyFromPriceResponse)(X),cartTotalItems:te.current,displayPricesIncludingTax:Object(v.getSetting)("displayCartPricesIncludingTax",!1),appliedCoupons:Q,customerId:p},checkoutStatus:{isCalculating:t,isComplete:n,isIdle:c,isProcessing:i},components:{ValidationInputError:j.a,PaymentMethodIcons:g.a,PaymentMethodLabel:h},emitResponse:{noticeContexts:J,responseTypes:ee},eventRegistration:{onCheckoutBeforeProcessing:s,onCheckoutValidationBeforeProcessing:u,onCheckoutAfterProcessingWithSuccess:l,onCheckoutAfterProcessingWithError:f,onShippingRateSuccess:B,onShippingRateFail:H,onShippingRateSelectSuccess:q,onShippingRateSelectFail:z,onPaymentProcessing:C},onSubmit:d,paymentStatus:m,setExpressPaymentError:re,shippingData:{shippingRates:I,shippingRatesLoading:F,selectedRates:L,setSelectedRates:V,isSelectingRate:U,shippingAddress:$,setShippingAddress:K,needsShipping:W},shippingStatus:{shippingErrorStatus:M,shippingErrorTypes:D},shouldSavePayment:N}}},function(e,t,n){"use strict";n.r(t);var r=n(199),o=n(128),a=n(1),c=n(226),i=n(103),s=n(299),u=n(26),l=n(2),f=n(188),d=n(107),p=n(8),b=n(11),m=n(32),h=n(0),g=n(105),v=n(127),y=n(137),O=n(114),j=n(23),E=n.n(j),w=n(332),_=n(333),S=n(336),k=n(334),R=n(58),P=n(214),x=n(54),C=n(6),A=n.n(C),N=n(277),T=n(330),M=n(331),D=n(175),I=n(28),F=n(228),L=function(e){var t=e.itemCount,n=void 0===t?1:t;return React.createElement(D.a,{headingLevel:"2"},Object(a.sprintf)(
/* translators: %d is the count of items in the cart. */
Object(a._n)("Your cart (%d item)","Your cart (%d items)",n,'woocommerce'),n))},V=n(172),U=n(338),B=(n(300),["extensions","receiveCart"]),H=function(e){var t=e.attributes,n=t.isShippingCalculatorEnabled,r=t.hasDarkControls,o=t.showRateAfterTaxName,c=Object(m.a)(),i=c.cartItems,s=c.cartFees,f=c.cartTotals,d=c.cartIsLoading,p=c.cartItemsCount,b=c.cartItemErrors,g=c.cartNeedsPayment,v=c.cartNeedsShipping,y=Object(P.a)(),O=y.applyCoupon,j=y.removeCoupon,C=y.isApplyingCoupon,H=y.isRemovingCoupon,q=y.appliedCoupons,z=Object(x.a)().addErrorNotice;Object(h.useEffect)((function(){b.forEach((function(e){z(Object(I.decodeEntities)(e.message),{isDismissible:!0,id:e.code})}))}),[z,b]);var W=Object(R.getCurrencyFromPriceResponse)(f),G=A()("wc-block-cart",{"wc-block-cart--is-loading":d,"has-dark-controls":r}),Y=Object(m.a)(),$=Y.extensions,K=(Y.receiveCart,E()(Y,B)),X={extensions:$,cart:K},Q={extensions:$,cart:K};return React.createElement(React.Fragment,null,React.createElement(L,{itemCount:p}),React.createElement(N.a,{className:G},React.createElement(T.a,{className:"wc-block-cart__main"},React.createElement(V.a,{lineItems:i,isLoading:d})),React.createElement(M.a,{className:"wc-block-cart__sidebar"},React.createElement(D.a,{headingLevel:"2",className:"wc-block-cart__totals-title"},Object(a.__)("Cart totals",'woocommerce')),React.createElement(u.TotalsWrapper,null,React.createElement(u.Subtotal,{currency:W,values:f}),React.createElement(u.TotalsFees,{currency:W,cartFees:s}),React.createElement(w.a,{cartCoupons:q,currency:W,isRemovingCoupon:H,removeCoupon:j,values:f})),Object(l.getSetting)("couponsEnabled",!0)&&React.createElement(u.TotalsWrapper,null,React.createElement(_.a,{onSubmit:O,isLoading:C})),React.createElement(u.ExperimentalDiscountsMeta.Slot,Q),v&&React.createElement(u.TotalsWrapper,null,React.createElement(S.a,{showCalculator:n,showRateSelector:!0,values:f,currency:W})),!Object(l.getSetting)("displayCartPricesIncludingTax",!1)&&parseInt(f.total_tax,10)>0&&React.createElement(u.TotalsWrapper,null,React.createElement(u.TotalsTaxes,{showRateAfterTaxName:o,currency:W,values:f})),React.createElement(u.TotalsWrapper,null,React.createElement(k.a,{currency:W,values:f})),React.createElement(u.ExperimentalOrderMeta.Slot,X),React.createElement("div",{className:"wc-block-cart__payment-options"},g&&React.createElement(U.a,null),React.createElement(F.a,{link:Object(l.getSetting)("page-"+(null==t?void 0:t.checkoutPageId),!1)})))))},q=function(e){var t=e.content;return Object(h.useEffect)((function(){Object(y.a)("wc-blocks_render_blocks_frontend",{element:document.body.querySelector(".wp-block-woocommerce-cart")})}),[]),React.createElement(h.RawHTML,null,t)},z=Object(O.a)((function(e){var t=e.emptyCart,n=e.attributes,r=e.scrollToTop,o=Object(m.a)(),a=o.cartItems,c=o.cartIsLoading;return Object(h.useEffect)((function(){var e=function(e){var t=e.detail;t&&t.preserveCartData||Object(b.dispatch)(p.CART_STORE_KEY).invalidateResolutionForStore(),r()},t=Object(y.b)("added_to_cart","wc-blocks_added_to_cart"),n=Object(y.b)("removed_from_cart","wc-blocks_removed_from_cart");return document.body.addEventListener("wc-blocks_added_to_cart",e),document.body.addEventListener("wc-blocks_removed_from_cart",e),function(){t(),n(),document.body.removeEventListener("wc-blocks_added_to_cart",e),document.body.removeEventListener("wc-blocks_removed_from_cart",e)}}),[r]),React.createElement(React.Fragment,null,c||0!==a.length?React.createElement(g.a,{showSpinner:!0,isLoading:c},React.createElement(v.a,null,React.createElement(H,{attributes:n}))):React.createElement(q,{content:t}))})),W={isPreview:{type:"boolean",default:!1,save:!1},isShippingCalculatorEnabled:{type:"boolean",default:Object(l.getSetting)("isShippingCalculatorEnabled",!0)},checkoutPageId:{type:"number",default:0},hasDarkControls:{type:"boolean",default:Object(l.getSetting)("hasDarkEditorStyleSupport",!1)},showRateAfterTaxName:{type:"boolean",default:!0}},G=function(){window.location.reload(!0)};Object(d.a)({selector:".wp-block-woocommerce-cart",Block:Object(r.a)(Object(o.a)((function(e){return React.createElement(c.a,{context:"wc/cart"},React.createElement(i.a,{context:"wc/cart"},React.createElement(u.SlotFillProvider,null,React.createElement(s.a,null,React.createElement(z,e)))))}))),getProps:function(e){return{emptyCart:e.innerHTML,attributes:Object(f.a)(W,e.dataset)}},getErrorBoundaryProps:function(){return{header:Object(a.__)("Something went wrong…",'woocommerce'),text:Object(a.__)("The cart has encountered an unexpected error. If the error persists, please get in touch with us for help.",'woocommerce'),showErrorMessage:l.CURRENT_USER_IS_ADMIN,button:React.createElement("button",{className:"wc-block-button",onClick:G},Object(a.__)("Reload the page",'woocommerce'))}}})},,,,,,,function(e,t,n){"use strict";n.d(t,"a",(function(){return r})),n.d(t,"b",(function(){return o}));var r=function(e){return e.length},o=function(e){return e.reduce((function(e,t){return e+t.shipping_rates.length}),0)}},,,,function(e,t,n){"use strict";var r=n(6),o=n.n(r);n(10),t.a=function(e){var t=e.children,n=e.className;return React.createElement("div",{className:o()("wc-block-components-main",n)},t)}},function(e,t,n){"use strict";var r=n(6),o=n.n(r);n(10),t.a=function(e){var t=e.children,n=e.className;return React.createElement("div",{className:o()("wc-block-components-sidebar",n)},t)}},function(e,t,n){"use strict";var r=n(1),o=n(105),a=n(194),c=(n(10),n(26)),i=n(2),s=(n(256),{context:"summary"});t.a=function(e){var t=e.cartCoupons,n=void 0===t?[]:t,u=e.currency,l=e.isRemovingCoupon,f=e.removeCoupon,d=e.values,p=d.total_discount,b=d.total_discount_tax,m=parseInt(p,10);if(!m&&0===n.length)return null;var h=parseInt(b,10),g=Object(i.getSetting)("displayCartPricesIncludingTax",!1)?m+h:m,v=Object(c.__experimentalApplyCheckoutFilter)({arg:s,filterName:"coupons",defaultValue:n});return React.createElement(c.TotalsItem,{className:"wc-block-components-totals-discount",currency:u,description:0!==v.length&&React.createElement(o.a,{screenReaderLabel:Object(r.__)("Removing coupon…",'woocommerce'),isLoading:l,showSpinner:!1},React.createElement("ul",{className:"wc-block-components-totals-discount__coupon-list"},v.map((function(e){return React.createElement(a.a,{key:"coupon-"+e.code,className:"wc-block-components-totals-discount__coupon-list-item",text:e.label,screenReaderText:Object(r.sprintf)(
/* translators: %s Coupon code. */
Object(r.__)("Coupon: %s",'woocommerce'),e.label),disabled:l,onRemove:function(){f(e.code)},radius:"large",ariaLabel:Object(r.sprintf)(
/* translators: %s is a coupon code. */
Object(r.__)('Remove coupon "%s"','woocommerce'),e.label)})})))),label:g?Object(r.__)("Discount",'woocommerce'):Object(r.__)("Coupons",'woocommerce'),value:g?-1*g:"-"})}},function(e,t,n){"use strict";var r=n(5),o=n.n(r),a=n(1),c=n(0),i=n(143),s=n(276),u=n(51),l=n(105),f=(n(10),n(24)),d=n(127),p=n(258),b=n(26);n(257),t.a=Object(f.withInstanceId)((function(e){var t=e.instanceId,n=e.isLoading,r=void 0!==n&&n,f=e.initialOpen,m=void 0!==f&&f,h=e.onSubmit,g=void 0===h?function(){}:h,v=Object(c.useState)(""),y=o()(v,2),O=y[0],j=y[1],E=Object(c.useRef)(!1),w=Object(d.b)(),_=w.getValidationError,S=w.getValidationErrorId,k=_("coupon");Object(c.useEffect)((function(){E.current!==r&&(r||!O||k||j(""),E.current=r)}),[r,O,k]);var R="wc-block-components-totals-coupon__input-".concat(t);return React.createElement(b.Panel,{className:"wc-block-components-totals-coupon",hasBorder:!1,initialOpen:m,title:React.createElement(u.a,{label:Object(a.__)("Coupon code",'woocommerce'),screenReaderLabel:Object(a.__)("Apply a coupon code",'woocommerce'),htmlFor:R})},React.createElement(l.a,{screenReaderLabel:Object(a.__)("Applying coupon…",'woocommerce'),isLoading:r,showSpinner:!1},React.createElement("div",{className:"wc-block-components-totals-coupon__content"},React.createElement("form",{className:"wc-block-components-totals-coupon__form"},React.createElement(s.a,{id:R,errorId:"coupon",className:"wc-block-components-totals-coupon__input",label:Object(a.__)("Enter code",'woocommerce'),value:O,ariaDescribedBy:S(R),onChange:function(e){j(e)},validateOnMount:!1,focusOnMount:!0,showError:!1}),React.createElement(i.a,{className:"wc-block-components-totals-coupon__button",disabled:r||!O,showSpinner:r,onClick:function(e){e.preventDefault(),g(O)},type:"submit"},Object(a.__)("Apply",'woocommerce'))),React.createElement(p.a,{propertyName:"coupon",elementId:R}))))}))},function(e,t,n){"use strict";var r=n(23),o=n.n(r),a=n(1),c=n(0),i=n(69),s=(n(10),n(26)),u=n(32),l=n(2),f=(n(263),["receiveCart"]);t.a=function(e){var t=e.currency,n=e.values,r=Object(l.getSetting)("taxesEnabled",!0)&&Object(l.getSetting)("displayCartPricesIncludingTax",!1),d=n.total_price,p=n.total_tax,b=Object(u.a)(),m=(b.receiveCart,o()(b,f)),h=Object(s.__experimentalApplyCheckoutFilter)({filterName:"totalLabel",defaultValue:Object(a.__)("Total",'woocommerce'),extensions:m.extensions,arg:{cart:m}}),g=parseInt(p,10);return React.createElement(s.TotalsItem,{className:"wc-block-components-totals-footer-item",currency:t,label:h,value:parseInt(d,10),description:r&&0!==g&&React.createElement("p",{className:"wc-block-components-totals-footer-item-tax"},Object(c.createInterpolateElement)(Object(a.__)("Including <TaxAmount/> in taxes",'woocommerce'),{TaxAmount:React.createElement(i.a,{className:"wc-block-components-totals-footer-item-tax-value",currency:t,value:g})}))})}},function(e,t,n){"use strict";var r=n(4),o=n.n(r),a=n(276),c=n(14),i=n.n(c),s=n(83),u=n(0),l=n(1),f=n(28),d=n(6),p=n.n(d),b=n(24),m=n(340),h=n(127),g=n(258),v=n(49),y=(n(261),Object(b.withInstanceId)((function(e){var t=e.id,n=e.className,r=e.label,a=e.onChange,c=e.options,i=e.value,s=e.required,f=void 0!==s&&s,d=e.errorMessage,b=void 0===d?Object(l.__)("Please select a value.",'woocommerce'):d,y=e.errorId,O=e.instanceId,j=void 0===O?"0":O,E=e.autoComplete,w=void 0===E?"off":E,_=Object(h.b)(),S=_.getValidationError,k=_.setValidationErrors,R=_.clearValidationError,P=Object(u.useRef)(null),x=t||"control-"+j,C=y||x,A=S(C)||{message:"",hidden:!1};return Object(u.useEffect)((function(){return!f||i?R(C):k(o()({},C,{message:b,hidden:!0})),function(){R(C)}}),[R,i,C,b,f,k]),React.createElement("div",{id:x,className:p()("wc-block-components-combobox",n,{"is-active":i,"has-error":A.message&&!A.hidden}),ref:P},React.createElement(m.a,{className:"wc-block-components-combobox-control",label:r,onChange:a,onFilterValueChange:function(e){if(e.length){var t=Object(v.b)(P.current)?P.current.ownerDocument.activeElement:void 0;if(t&&Object(v.b)(P.current)&&P.current.contains(t))return;var n=e.toLocaleUpperCase(),r=c.find((function(e){return e.label.toLocaleUpperCase().startsWith(n)||e.value.toLocaleUpperCase()===n}));r&&a(r.value)}},options:c,value:i||"",allowReset:!1,autoComplete:w,"aria-invalid":A.message&&!A.hidden}),React.createElement(g.a,{propertyName:C}))}))),O=(n(260),function(e){var t=e.className,n=e.countries,r=e.id,o=e.label,a=e.onChange,c=e.value,i=void 0===c?"":c,s=e.autoComplete,d=void 0===s?"off":s,b=e.required,m=void 0!==b&&b,h=e.errorId,g=e.errorMessage,v=void 0===g?Object(l.__)("Please select a country.",'woocommerce'):g,O=Object(u.useMemo)((function(){return Object.keys(n).map((function(e){return{value:e,label:Object(f.decodeEntities)(n[e])}}))}),[n]);return React.createElement("div",{className:p()(t,"wc-block-components-country-input")},React.createElement(y,{id:r,label:o,onChange:a,options:O,value:i,errorId:h,errorMessage:v,required:m,autoComplete:d}),"off"!==d&&React.createElement("input",{type:"text","aria-hidden":!0,autoComplete:d,value:i,onChange:function(e){var t=e.target.value.toLocaleUpperCase(),n=O.find((function(e){return 2!==t.length&&e.label.toLocaleUpperCase()===t||2===t.length&&e.value.toLocaleUpperCase()===t}));a(n?n.value:"")},style:{minHeight:"0",height:"0",border:"0",padding:"0",position:"absolute"},tabIndex:-1}))}),j=function(e){return React.createElement(O,i()({countries:s.g},e))},E=function(e){return React.createElement(O,i()({countries:s.a},e))},w=(n(262),function(e,t){var n=t.find((function(t){return t.label.toLocaleUpperCase()===e.toLocaleUpperCase()||t.value.toLocaleUpperCase()===e.toLocaleUpperCase()}));return n?n.value:""}),_=function(e){var t=e.className,n=e.id,r=e.states,o=e.country,c=e.label,i=e.onChange,s=e.autoComplete,d=void 0===s?"off":s,b=e.value,m=void 0===b?"":b,h=e.required,g=void 0!==h&&h,v=r[o],O=Object(u.useMemo)((function(){return v?Object.keys(v).map((function(e){return{value:e,label:Object(f.decodeEntities)(v[e])}})):[]}),[v]),j=Object(u.useCallback)((function(e){i(O.length>0?w(e,O):e)}),[i,O]),E=Object(u.useRef)(m);return Object(u.useEffect)((function(){E.current!==m&&(E.current=m)}),[m]),Object(u.useEffect)((function(){if(O.length>0&&E.current){var e=w(E.current,O);e!==E.current&&j(e)}}),[O,j]),O.length>0?React.createElement(React.Fragment,null,React.createElement(y,{className:p()(t,"wc-block-components-state-input"),id:n,label:c,onChange:j,options:O,value:m,errorMessage:Object(l.__)("Please select a state.",'woocommerce'),required:g,autoComplete:d}),"off"!==d&&React.createElement("input",{type:"text","aria-hidden":!0,autoComplete:d,value:m,onChange:function(e){return j(e.target.value)},style:{minHeight:"0",height:"0",border:"0",padding:"0",position:"absolute"},tabIndex:-1})):React.createElement(a.a,{className:t,id:n,label:c,onChange:j,autoComplete:d,value:m,required:g})},S=function(e){return React.createElement(_,i()({states:s.h},e))},k=function(e){return React.createElement(_,i()({states:s.b},e))},R=n(53),P=n(2),x=n(87);function C(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function A(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?C(Object(n),!0).forEach((function(t){o()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):C(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}t.a=Object(b.withInstanceId)((function(e){var t=e.id,n=e.fields,r=void 0===n?Object.keys(P.defaultAddressFields):n,c=e.fieldConfig,i=void 0===c?{}:c,s=e.instanceId,f=e.onChange,d=e.type,p=void 0===d?"shipping":d,b=e.values,m=Object(h.b)(),g=m.getValidationError,v=m.setValidationErrors,y=m.clearValidationError,O=Object(R.a)(r),w=g("shipping-missing-country")||{},_=Object(u.useMemo)((function(){return Object(x.a)(O,i,b.country)}),[O,i,b.country]);return Object(u.useEffect)((function(){_.forEach((function(e){e.hidden&&b[e.key]&&f(A(A({},b),{},o()({},e.key,"")))}))}),[_,f,b]),Object(u.useEffect)((function(){"shipping"===p&&function(e,t,n,r){r||e.country||!(e.city||e.state||e.postcode)||t({"shipping-missing-country":{message:Object(l.__)("Please select a country to calculate rates.",'woocommerce'),hidden:!1}}),r&&e.country&&n("shipping-missing-country")}(b,v,y,!!w.message&&!w.hidden)}),[b,w.message,w.hidden,v,y,p]),t=t||s,React.createElement("div",{id:t,className:"wc-block-components-address-form"},_.map((function(e){if(e.hidden)return null;if("country"===e.key){var n="shipping"===p?j:E;return React.createElement(n,{key:e.key,id:"".concat(t,"-").concat(e.key),label:e.required?e.label:e.optionalLabel,value:b.country,autoComplete:e.autocomplete,onChange:function(e){return f(A(A({},b),{},{country:e,state:""}))},errorId:"shipping"===p?"shipping-missing-country":null,errorMessage:e.errorMessage,required:e.required})}if("state"===e.key){var r="shipping"===p?S:k;return React.createElement(r,{key:e.key,id:"".concat(t,"-").concat(e.key),country:b.country,label:e.required?e.label:e.optionalLabel,value:b.state,autoComplete:e.autocomplete,onChange:function(e){return f(A(A({},b),{},{state:e}))},errorMessage:e.errorMessage,required:e.required})}return React.createElement(a.a,{key:e.key,id:"".concat(t,"-").concat(e.key),className:"wc-block-components-address-form__".concat(e.key),label:e.required?e.label:e.optionalLabel,value:b[e.key],autoCapitalize:e.autocapitalize,autoComplete:e.autocomplete,onChange:function(t){return f(A(A({},b),{},o()({},e.key,t)))},errorMessage:e.errorMessage,required:e.required})})))}))},function(e,t,n){"use strict";var r=n(14),o=n.n(r),a=n(5),c=n.n(a),i=n(6),s=n.n(i),u=n(1),l=n(0),f=n(32),d=n(26),p=n(2),b=function(e){var t=e.selectedShippingRates;return React.createElement("div",{className:"wc-block-components-totals-item__description wc-block-components-totals-shipping__via"},Object(u.__)("via",'woocommerce')," ",t.join(", "))},m=n(153),h=n(209),g=function(e){var t=e.hasRates,n=e.shippingRates,r=e.shippingRatesLoading,o=t?Object(u.__)("Shipping options",'woocommerce'):Object(u.__)("Choose a shipping option",'woocommerce');return React.createElement("fieldset",{className:"wc-block-components-totals-shipping__fieldset"},React.createElement("legend",{className:"screen-reader-text"},o),React.createElement(h.a,{className:"wc-block-components-totals-shipping__options",collapsible:!0,noResultsMessage:React.createElement(m.a,{isDismissible:!1,className:s()("wc-block-components-shipping-rates-control__no-results-notice","woocommerce-error")},Object(u.__)("No shipping options were found.",'woocommerce')),shippingRates:n,shippingRatesLoading:r}))},v=n(66),y=n(143),O=n(25),j=n.n(O),E=n(127),w=(n(208),n(335)),_=function(e){var t=e.address,n=e.onUpdate,r=e.addressFields,o=Object(l.useState)(t),a=c()(o,2),i=a[0],s=a[1],f=Object(E.b)(),d=f.hasValidationErrors,p=f.showAllValidationErrors;return React.createElement("form",{className:"wc-block-components-shipping-calculator-address"},React.createElement(w.a,{fields:r,onChange:s,values:i}),React.createElement(y.a,{className:"wc-block-components-shipping-calculator-address__button",disabled:j()(i,t),onClick:function(e){if(e.preventDefault(),p(),!d)return n(i)},type:"submit"},Object(u.__)("Update",'woocommerce')))},S=function(e){var t=e.onUpdate,n=void 0===t?function(){}:t,r=e.addressFields,o=void 0===r?["country","state","city","postcode"]:r,a=Object(v.b)(),c=a.shippingAddress,i=a.setShippingAddress;return React.createElement("div",{className:"wc-block-components-shipping-calculator"},React.createElement(_,{address:c,addressFields:o,onUpdate:function(e){i(e),n(e)}}))},k=n(21),R=n.n(k),P=n(28),x=function(e){var t=e.address;if(0===Object.values(t).length)return null;var n=Object(p.getSetting)("shippingCountries",{}),r=Object(p.getSetting)("shippingStates",{}),o="string"==typeof n[t.country]?Object(P.decodeEntities)(n[t.country]):"",a="object"===R()(r[t.country])&&"string"==typeof r[t.country][t.state]?Object(P.decodeEntities)(r[t.country][t.state]):t.state,c=[];c.push(t.postcode.toUpperCase()),c.push(t.city),c.push(a),c.push(o);var i=c.filter(Boolean).join(", ");return i?React.createElement("span",{className:"wc-block-components-shipping-address"},Object(u.sprintf)(
/* translators: %s location. */
Object(u.__)("Shipping to %s",'woocommerce'),i)+" "):null},C=(n(259),function(e){var t=e.label,n=void 0===t?Object(u.__)("Calculate",'woocommerce'):t,r=e.isShippingCalculatorOpen,o=e.setIsShippingCalculatorOpen;return React.createElement("button",{className:"wc-block-components-totals-shipping__change-address-button",onClick:function(){o(!r)},"aria-expanded":r},n)}),A=function(e){var t=e.showCalculator,n=e.isShippingCalculatorOpen,r=e.setIsShippingCalculatorOpen,o=e.shippingAddress;return React.createElement(React.Fragment,null,React.createElement(x,{address:o}),t&&React.createElement(C,{label:Object(u.__)("(change address)",'woocommerce'),isShippingCalculatorOpen:n,setIsShippingCalculatorOpen:r}))},N=function(e){var t=e.showCalculator,n=e.isShippingCalculatorOpen,r=e.setIsShippingCalculatorOpen;return t?React.createElement(C,{isShippingCalculatorOpen:n,setIsShippingCalculatorOpen:r}):React.createElement("em",null,Object(u.__)("Calculated during checkout",'woocommerce'))};t.a=function(e){var t=e.currency,n=e.values,r=e.showCalculator,a=void 0===r||r,i=e.showRateSelector,m=void 0===i||i,h=e.className,v=Object(l.useState)(!1),y=c()(v,2),O=y[0],j=y[1],E=Object(f.a)(),w=E.shippingAddress,_=E.cartHasCalculatedShipping,k=E.shippingRates,R=E.shippingRatesLoading,P=Object(p.getSetting)("displayCartPricesIncludingTax",!1)?parseInt(n.total_shipping,10)+parseInt(n.total_shipping_tax,10):parseInt(n.total_shipping,10),x=k.some((function(e){return e.shipping_rates.length}))||P,C={isShippingCalculatorOpen:O,setIsShippingCalculatorOpen:j},T=k.flatMap((function(e){return e.shipping_rates.filter((function(e){return e.selected})).flatMap((function(e){return e.name}))}));return React.createElement("div",{className:s()("wc-block-components-totals-shipping",h)},React.createElement(d.TotalsItem,{label:Object(u.__)("Shipping",'woocommerce'),value:_?P:React.createElement(N,o()({showCalculator:a},C)),description:React.createElement(React.Fragment,null,_&&React.createElement(React.Fragment,null,React.createElement(b,{selectedShippingRates:T}),React.createElement(A,o()({shippingAddress:w,showCalculator:a},C)))),currency:t}),a&&O&&React.createElement(S,{onUpdate:function(){j(!1)}}),m&&_&&React.createElement(g,{hasRates:x,shippingRates:k,shippingRatesLoading:R}))}},,function(e,t,n){"use strict";var r=n(1),o=n(187),a=n(35),c=n(48),i=n(173),s=n(103),u=n(105),l=n(212);n(264),t.a=function(){var e=Object(o.a)(),t=e.paymentMethods,n=e.isInitialized,f=Object(a.c)().noticeContexts,d=Object(c.b)(),p=d.isCalculating,b=d.isProcessing,m=d.isAfterProcessing,h=d.isBeforeProcessing,g=d.isComplete,v=d.hasError,y=Object(i.b)().currentStatus;if(!n||n&&0===Object.keys(t).length)return null;var O=b||m||h||g&&!v;return React.createElement(React.Fragment,null,React.createElement(u.a,{isLoading:p||O||y.isDoingExpressPayment},React.createElement("div",{className:"wc-block-components-express-payment wc-block-components-express-payment--cart"},React.createElement("div",{className:"wc-block-components-express-payment__content"},React.createElement(s.a,{context:f.EXPRESS_PAYMENTS},React.createElement(l.a,null))))),React.createElement("div",{className:"wc-block-components-express-payment-continue-rule wc-block-components-express-payment-continue-rule--cart"},Object(r.__)("Or",'woocommerce')))}},function(e,t,n){"use strict";var r=n(34),o=React.createElement(r.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},React.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),React.createElement("path",{fill:"currentColor",d:"M20 4H4c-1.11 0-1.99.89-1.99 2L2 18c0 1.11.89 2 2 2h16c1.11 0 2-.89 2-2V6c0-1.11-.89-2-2-2zm0 14H4v-6h16v6zm0-10H4V6h16v2z"}));t.a=o},function(e,t,n){"use strict";var r=n(0),o=n(6),a=n.n(o),c=n(7),i=n(1),s=n(24),u=n(50),l=n(33),f=n(34),d=Object(r.createElement)(f.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(r.createElement)(f.Path,{d:"M12 13.06l3.712 3.713 1.061-1.06L13.061 12l3.712-3.712-1.06-1.06L12 10.938 8.288 7.227l-1.061 1.06L10.939 12l-3.712 3.712 1.06 1.061L12 13.061z"})),p=n(12),b=n(19),m=n(15),h=n(16),g=n(13),v=n(17),y=n(18),O=n(9);var j=function(e){Object(v.a)(c,e);var t,n,o=(t=c,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=Object(O.a)(t);if(n){var o=Object(O.a)(this).constructor;e=Reflect.construct(r,arguments,o)}else e=r.apply(this,arguments);return Object(y.a)(this,e)});function c(){var e;return Object(m.a)(this,c),(e=o.apply(this,arguments)).onChange=e.onChange.bind(Object(g.a)(e)),e.bindInput=e.bindInput.bind(Object(g.a)(e)),e}return Object(h.a)(c,[{key:"focus",value:function(){this.input.focus()}},{key:"hasFocus",value:function(){return this.input===this.input.ownerDocument.activeElement}},{key:"bindInput",value:function(e){this.input=e}},{key:"onChange",value:function(e){this.props.onChange({value:e.target.value})}},{key:"render",value:function(){var e=this.props,t=e.value,n=e.isExpanded,o=e.instanceId,c=e.selectedSuggestionIndex,i=e.className,s=Object(b.a)(e,["value","isExpanded","instanceId","selectedSuggestionIndex","className"]),u=t?t.length+1:0;return Object(r.createElement)("input",Object(p.a)({ref:this.bindInput,id:"components-form-token-input-".concat(o),type:"text"},s,{value:t||"",onChange:this.onChange,size:u,className:a()(i,"components-form-token-field__input"),autoComplete:"off",role:"combobox","aria-expanded":n,"aria-autocomplete":"list","aria-owns":n?"components-form-token-suggestions-".concat(o):void 0,"aria-activedescendant":-1!==c?"components-form-token-suggestions-".concat(o,"-").concat(c):void 0,"aria-describedby":"components-form-token-suggestions-howto-".concat(o)}))}}]),c}(r.Component),E=n(222),w=n.n(E);var _=function(e){Object(v.a)(i,e);var t,n,o=(t=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=Object(O.a)(t);if(n){var o=Object(O.a)(this).constructor;e=Reflect.construct(r,arguments,o)}else e=r.apply(this,arguments);return Object(y.a)(this,e)});function i(){var e;return Object(m.a)(this,i),(e=o.apply(this,arguments)).handleMouseDown=e.handleMouseDown.bind(Object(g.a)(e)),e.bindList=e.bindList.bind(Object(g.a)(e)),e}return Object(h.a)(i,[{key:"componentDidUpdate",value:function(){var e=this;this.props.selectedIndex>-1&&this.props.scrollIntoView&&(this.scrollingIntoView=!0,w()(this.list.children[this.props.selectedIndex],this.list,{onlyScrollIfNeeded:!0}),this.props.setTimeout((function(){e.scrollingIntoView=!1}),100))}},{key:"bindList",value:function(e){this.list=e}},{key:"handleHover",value:function(e){var t=this;return function(){t.scrollingIntoView||t.props.onHover(e)}}},{key:"handleClick",value:function(e){var t=this;return function(){t.props.onSelect(e)}}},{key:"handleMouseDown",value:function(e){e.preventDefault()}},{key:"computeSuggestionMatch",value:function(e){var t=this.props.displayTransform(this.props.match||"").toLocaleLowerCase();if(0===t.length)return null;var n=(e=this.props.displayTransform(e)).toLocaleLowerCase().indexOf(t);return{suggestionBeforeMatch:e.substring(0,n),suggestionMatch:e.substring(n,n+t.length),suggestionAfterMatch:e.substring(n+t.length)}}},{key:"render",value:function(){var e=this;return Object(r.createElement)("ul",{ref:this.bindList,className:"components-form-token-field__suggestions-list",id:"components-form-token-suggestions-".concat(this.props.instanceId),role:"listbox"},Object(c.map)(this.props.suggestions,(function(t,n){var o=e.computeSuggestionMatch(t),c=a()("components-form-token-field__suggestion",{"is-selected":n===e.props.selectedIndex});return Object(r.createElement)("li",{id:"components-form-token-suggestions-".concat(e.props.instanceId,"-").concat(n),role:"option",className:c,key:e.props.displayTransform(t),onMouseDown:e.handleMouseDown,onClick:e.handleClick(t),onMouseEnter:e.handleHover(t),"aria-selected":n===e.props.selectedIndex},o?Object(r.createElement)("span",{"aria-label":e.props.displayTransform(t)},o.suggestionBeforeMatch,Object(r.createElement)("strong",{className:"components-form-token-field__suggestion-match"},o.suggestionMatch),o.suggestionAfterMatch):e.props.displayTransform(t))})))}}]),i}(r.Component);_.defaultProps={match:"",onHover:function(){},onSelect:function(){},suggestions:Object.freeze([])};var S=Object(s.withSafeTimeout)(_),k=n(220),R=n(76),P=n(218),x=n(210),C=n(211),A=n(89);const N=Object(A.a)(class extends r.Component{handleFocusOutside(e){this.props.onFocusOutside(e)}render(){return this.props.children}});t.a=function e({value:t,label:n,options:o,onChange:f,onFilterValueChange:p=c.noop,hideLabelFromVision:b,help:m,allowReset:h=!0,className:g,messages:v={selected:Object(i.__)("Item selected.")}}){var y;const O=o.find(e=>e.value===t),E=null!==(y=null==O?void 0:O.label)&&void 0!==y?y:"",w=Object(s.useInstanceId)(e),[_,A]=Object(r.useState)(O||null),[T,M]=Object(r.useState)(!1),[D,I]=Object(r.useState)(!1),[F,L]=Object(r.useState)(""),V=Object(r.useRef)(),U=Object(r.useMemo)(()=>{const e=[],t=[],n=Object(c.deburr)(F.toLocaleLowerCase());return o.forEach(r=>{const o=Object(c.deburr)(r.label).toLocaleLowerCase().indexOf(n);0===o?e.push(r):o>0&&t.push(r)}),e.concat(t)},[F,o,t]),B=e=>{f(e.value),Object(l.speak)(v.selected,"assertive"),A(e),L(""),M(!1)},H=(e=1)=>{let t=U.indexOf(_)+e;t<0?t=U.length-1:t>=U.length&&(t=0),A(U[t]),M(!0)};return Object(r.useEffect)(()=>{const e=U.length>0,t=U.indexOf(_)>0;e&&!t&&A(U[0])},[U,_]),Object(r.useEffect)(()=>{const e=U.length>0;if(T){const t=e?Object(i.sprintf)(
/* translators: %d: number of results. */
Object(i._n)("%d result found, use up and down arrow keys to navigate.","%d results found, use up and down arrow keys to navigate.",U.length),U.length):Object(i.__)("No results.");Object(l.speak)(t,"polite")}},[U,T]),Object(r.createElement)(N,{onFocusOutside:()=>{M(!1)}},Object(r.createElement)(k.a,{className:a()(g,"components-combobox-control"),tabIndex:"-1",label:n,id:"components-form-token-input-"+w,hideLabelFromVision:b,help:m},Object(r.createElement)("div",{className:"components-combobox-control__suggestions-container",tabIndex:"-1",onKeyDown:e=>{let t=!1;if(!e.defaultPrevented){switch(e.keyCode){case u.ENTER:_&&(B(_),t=!0);break;case u.UP:H(-1),t=!0;break;case u.DOWN:H(1),t=!0;break;case u.ESCAPE:M(!1),A(null),t=!0}t&&e.preventDefault()}}},Object(r.createElement)(P.a,null,Object(r.createElement)(x.a,null,Object(r.createElement)(j,{className:"components-combobox-control__input",instanceId:w,ref:V,value:T?F:E,"aria-label":E?`${E}, ${n}`:null,onFocus:()=>{I(!0),M(!0),p(""),L("")},onBlur:()=>{I(!1)},isExpanded:T,selectedSuggestionIndex:U.indexOf(_),onChange:e=>{const t=e.value;L(t),p(t),D&&M(!0)}})),h&&Object(r.createElement)(C.a,null,Object(r.createElement)(R.a,{className:"components-combobox-control__reset",icon:d,disabled:!t,onClick:()=>{f(null),V.current.input.focus()},label:Object(i.__)("Reset")}))),T&&Object(r.createElement)(S,{instanceId:w,match:{label:F},displayTransform:e=>e.label,suggestions:U,selectedIndex:U.indexOf(_),onHover:A,onSelect:B,scrollIntoView:!0}))))}}]);woocommerce-blocks/build/featured-category.asset.php000064400000000715151335517640016713 0ustar00<?php return array('dependencies' => array('lodash', 'moment', 'react', 'react-dom', 'wc-settings', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-data-controls', 'wp-date', 'wp-deprecated', 'wp-dom', 'wp-element', 'wp-escape-html', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-keycodes', 'wp-polyfill', 'wp-primitives', 'wp-url', 'wp-viewport'), 'version' => '392b50d87267dc4ecf272b25e767cd5b');woocommerce-blocks/build/price-filter-frontend.js000064400000136630151335517640016220 0ustar00!function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=288)}({0:function(e,t){e.exports=window.wp.element},1:function(e,t){e.exports=window.wp.i18n},10:function(e,t,r){e.exports=r(79)()},100:function(e,t,r){"use strict";r.d(t,"a",(function(){return i}));var n=r(5),o=r.n(n),a=r(0),i=function(){var e=Object(a.useState)(),t=o()(e,2)[1];return Object(a.useCallback)((function(e){t((function(){throw e}))}),[])}},107:function(e,t,r){"use strict";r.d(t,"a",(function(){return d}));var n=r(14),o=r.n(n),a=r(4),i=r.n(a),c=r(0),u=r(44);function s(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function l(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?s(Object(r),!0).forEach((function(t){i()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):s(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var p=[".wp-block-woocommerce-cart"],f=function(e){var t=e.Block,r=e.containers,n=e.getProps,a=void 0===n?function(){return{}}:n,i=e.getErrorBoundaryProps,s=void 0===i?function(){return{}}:i;0!==r.length&&Array.prototype.forEach.call(r,(function(e,r){var n=a(e,r),i=s(e,r),p=l(l({},e.dataset),n.attributes||{});e.classList.remove("is-loading"),Object(c.render)(React.createElement(u.a,i,React.createElement(c.Suspense,{fallback:React.createElement("div",{className:"wc-block-placeholder"})},React.createElement(t,o()({},n,{attributes:p})))),e)}))},d=function(e){var t,r,n,o,a,i,c,u=document.body.querySelectorAll(p.join(","));t=l(l({},e),{},{wrappers:u}),r=t.Block,n=t.getProps,o=t.getErrorBoundaryProps,a=t.selector,i=t.wrappers,c=document.body.querySelectorAll(a),i.length>0&&Array.prototype.filter.call(c,(function(e){return!function(e,t){return Array.prototype.some.call(t,(function(t){return t.contains(e)&&!t.isSameNode(e)}))}(e,i)})),f({Block:r,containers:c,getProps:n,getErrorBoundaryProps:o}),Array.prototype.forEach.call(u,(function(t){t.addEventListener("wc-blocks_render_blocks_frontend",(function(){var r,n,o,a,i,c;n=(r=l(l({},e),{},{wrapper:t})).Block,o=r.getProps,a=r.getErrorBoundaryProps,i=r.selector,c=r.wrapper.querySelectorAll(i),f({Block:n,containers:c,getProps:o,getErrorBoundaryProps:a})}))}))}},11:function(e,t){e.exports=window.wp.data},115:function(e,t,r){"use strict";r.d(t,"a",(function(){return i}));var n=r(3),o=r(82);function a(e,t){return e===t}function i(e,t,r){var i=r&&r.equalityFn?r.equalityFn:a,c=Object(n.useState)(e),u=c[0],s=c[1],l=Object(o.a)(Object(n.useCallback)((function(e){return s(e)}),[]),t,r),p=l[0],f=l[1],d=l[2],m=Object(n.useRef)(e);return Object(n.useEffect)((function(){i(m.current,e)||(p(e),m.current=e)}),[e,p,i]),[u,f,d]}},120:function(e,t,r){"use strict";r.d(t,"a",(function(){return u}));var n=r(8),o=r(11),a=r(0),i=r(53),c=r(100),u=function(e){var t=e.namespace,r=e.resourceName,u=e.resourceValues,s=void 0===u?[]:u,l=e.query,p=void 0===l?{}:l,f=e.shouldSelect,d=void 0===f||f;if(!t||!r)throw new Error("The options object must have valid values for the namespace and the resource properties.");var m=Object(a.useRef)({results:[],isLoading:!0}),b=Object(i.a)(p),g=Object(i.a)(s),h=Object(c.a)(),v=Object(o.useSelect)((function(e){if(!d)return null;var o=e(n.COLLECTIONS_STORE_KEY),a=[t,r,b,g],i=o.getCollectionError.apply(o,a);return i&&h(i),{results:o.getCollection.apply(o,a),isLoading:!o.hasFinishedResolution("getCollection",a)}}),[t,r,g,b,d]);return null!==v&&(m.current=v),m.current}},126:function(e,t,r){"use strict";var n=r(3),o=r.n(n);function a(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function i(){return(i=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}function c(e){return(c=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function u(e,t){return(u=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function s(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function l(){}function p(){}p.resetWarningCache=l;var f=function(e,t){return function(e){e.exports=function(){function e(e,t,r,n,o,a){if("SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"!==a){var i=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw i.name="Invariant Violation",i}}function t(){return e}e.isRequired=e;var r={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:p,resetWarningCache:l};return r.PropTypes=r,r}()}(t={exports:{}}),t.exports}();function d(){}function m(e){return!!(e||"").match(/\d/)}function b(e){return null==e}function g(e){return e.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&")}function h(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r="-"===e[0],n=r&&t,o=(e=e.replace("-","")).split("."),a=o[0],i=o[1]||"";return{beforeDecimal:a,afterDecimal:i,hasNagation:r,addNegation:n}}function v(e,t,r){for(var n="",o=r?"0":"",a=0;a<=t-1;a++)n+=e[a]||o;return n}function y(e,t){if(e.value=e.value,null!==e){if(e.createTextRange){var r=e.createTextRange();return r.move("character",t),r.select(),!0}return e.selectionStart||0===e.selectionStart?(e.focus(),e.setSelectionRange(t,t),!0):(e.focus(),!1)}}function O(e,t,r){return Math.min(Math.max(e,t),r)}function x(e){return Math.max(e.selectionStart,e.selectionEnd)}var _={thousandSeparator:f.oneOfType([f.string,f.oneOf([!0])]),decimalSeparator:f.string,allowedDecimalSeparators:f.arrayOf(f.string),thousandsGroupStyle:f.oneOf(["thousand","lakh","wan"]),decimalScale:f.number,fixedDecimalScale:f.bool,displayType:f.oneOf(["input","text"]),prefix:f.string,suffix:f.string,format:f.oneOfType([f.string,f.func]),removeFormatting:f.func,mask:f.oneOfType([f.string,f.arrayOf(f.string)]),value:f.oneOfType([f.number,f.string]),defaultValue:f.oneOfType([f.number,f.string]),isNumericString:f.bool,customInput:f.elementType,allowNegative:f.bool,allowEmptyFormatting:f.bool,allowLeadingZeros:f.bool,onValueChange:f.func,onKeyDown:f.func,onMouseUp:f.func,onChange:f.func,onFocus:f.func,onBlur:f.func,type:f.oneOf(["text","tel","password"]),isAllowed:f.func,renderText:f.func,getInputRef:f.oneOfType([f.func,f.shape({current:f.any})])},w={displayType:"input",decimalSeparator:".",thousandsGroupStyle:"thousand",fixedDecimalScale:!1,prefix:"",suffix:"",allowNegative:!0,allowEmptyFormatting:!1,allowLeadingZeros:!1,isNumericString:!1,type:"text",onValueChange:d,onChange:d,onKeyDown:d,onMouseUp:d,onFocus:d,onBlur:d,isAllowed:function(){return!0}},j=function(e){function t(e){var r,n;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),r=!(n=c(t).call(this,e))||"object"!=typeof n&&"function"!=typeof n?s(this):n;var o=e.defaultValue;r.validateProps();var a=r.formatValueProp(o);return r.state={value:a,numAsString:r.removeFormatting(a)},r.selectionBeforeInput={selectionStart:0,selectionEnd:0},r.onChange=r.onChange.bind(s(r)),r.onKeyDown=r.onKeyDown.bind(s(r)),r.onMouseUp=r.onMouseUp.bind(s(r)),r.onFocus=r.onFocus.bind(s(r)),r.onBlur=r.onBlur.bind(s(r)),r}var r,n;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&u(e,t)}(t,e),r=t,(n=[{key:"componentDidUpdate",value:function(e){this.updateValueIfRequired(e)}},{key:"componentWillUnmount",value:function(){clearTimeout(this.focusTimeout)}},{key:"updateValueIfRequired",value:function(e){var t=this.props,r=this.state,n=this.focusedElm,o=r.value,a=r.numAsString,i=void 0===a?"":a;if(e!==t){this.validateProps();var c=this.formatNumString(i),u=b(t.value)?c:this.formatValueProp(),s=this.removeFormatting(u),l=parseFloat(s),p=parseFloat(i);(isNaN(l)&&isNaN(p)||l===p)&&c===o&&(null!==n||u===o)||this.updateValue({formattedValue:u,numAsString:s,input:n})}}},{key:"getFloatString",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=this.props.decimalScale,r=this.getSeparators(),n=r.decimalSeparator,o=this.getNumberRegex(!0),a="-"===e[0];a&&(e=e.replace("-","")),n&&0===t&&(e=e.split(n)[0]);var i=(e=(e.match(o)||[]).join("").replace(n,".")).indexOf(".");return-1!==i&&(e="".concat(e.substring(0,i),".").concat(e.substring(i+1,e.length).replace(new RegExp(g(n),"g"),""))),a&&(e="-"+e),e}},{key:"getNumberRegex",value:function(e,t){var r=this.props,n=r.format,o=r.decimalScale,a=this.getSeparators().decimalSeparator;return new RegExp("\\d"+(!a||0===o||t||n?"":"|"+g(a)),e?"g":void 0)}},{key:"getSeparators",value:function(){var e=this.props.decimalSeparator,t=this.props,r=t.thousandSeparator,n=t.allowedDecimalSeparators;return!0===r&&(r=","),n||(n=[e,"."]),{decimalSeparator:e,thousandSeparator:r,allowedDecimalSeparators:n}}},{key:"getMaskAtIndex",value:function(e){var t=this.props.mask,r=void 0===t?" ":t;return"string"==typeof r?r:r[e]||" "}},{key:"getValueObject",value:function(e,t){var r=parseFloat(t);return{formattedValue:e,value:t,floatValue:isNaN(r)?void 0:r}}},{key:"validateProps",value:function(){var e=this.props.mask,t=this.getSeparators(),r=t.decimalSeparator,n=t.thousandSeparator;if(r===n)throw new Error("\n          Decimal separator can't be same as thousand separator.\n          thousandSeparator: ".concat(n,' (thousandSeparator = {true} is same as thousandSeparator = ",")\n          decimalSeparator: ').concat(r," (default value for decimalSeparator is .)\n       "));if(e&&("string"===e?e:e.toString()).match(/\d/g))throw new Error("\n          Mask ".concat(e," should not contain numeric character;\n        "))}},{key:"setPatchedCaretPosition",value:function(e,t,r){y(e,t),setTimeout((function(){e.value===r&&y(e,t)}),0)}},{key:"correctCaretPosition",value:function(e,t,r){var n=this.props,o=n.prefix,a=n.suffix,i=n.format;if(""===e)return 0;if(t=O(t,0,e.length),!i){var c="-"===e[0];return O(t,o.length+(c?1:0),e.length-a.length)}if("function"==typeof i)return t;if("#"===i[t]&&m(e[t]))return t;if("#"===i[t-1]&&m(e[t-1]))return t;var u=i.indexOf("#");t=O(t,u,i.lastIndexOf("#")+1);for(var s=i.substring(t,i.length).indexOf("#"),l=t,p=t+(-1===s?0:s);l>u&&("#"!==i[l]||!m(e[l]));)l-=1;return!m(e[p])||"left"===r&&t!==u||t-l<p-t?m(e[l])?l+1:l:p}},{key:"getCaretPosition",value:function(e,t,r){var n,o,a=this.props.format,i=this.state.value,c=this.getNumberRegex(!0),u=(e.match(c)||[]).join(""),s=(t.match(c)||[]).join("");for(n=0,o=0;o<r;o++){var l=e[o]||"",p=t[n]||"";if((l.match(c)||l===p)&&("0"!==l||!p.match(c)||"0"===p||u.length===s.length)){for(;l!==t[n]&&n<t.length;)n++;n++}}return"string"!=typeof a||i||(n=t.length),this.correctCaretPosition(t,n)}},{key:"removePrefixAndSuffix",value:function(e){var t=this.props,r=t.format,n=t.prefix,o=t.suffix;if(!r&&e){var a="-"===e[0];a&&(e=e.substring(1,e.length));var i=(e=n&&0===e.indexOf(n)?e.substring(n.length,e.length):e).lastIndexOf(o);e=o&&-1!==i&&i===e.length-o.length?e.substring(0,i):e,a&&(e="-"+e)}return e}},{key:"removePatternFormatting",value:function(e){for(var t=this.props.format.split("#").filter((function(e){return""!==e})),r=0,n="",o=0,a=t.length;o<=a;o++){var i=t[o]||"",c=o===a?e.length:e.indexOf(i,r);if(-1===c){n=e;break}n+=e.substring(r,c),r=c+i.length}return(n.match(/\d/g)||[]).join("")}},{key:"removeFormatting",value:function(e){var t=this.props,r=t.format,n=t.removeFormatting;return e?(r?e="string"==typeof r?this.removePatternFormatting(e):"function"==typeof n?n(e):(e.match(/\d/g)||[]).join(""):(e=this.removePrefixAndSuffix(e),e=this.getFloatString(e)),e):e}},{key:"formatWithPattern",value:function(e){for(var t=this.props.format,r=0,n=t.split(""),o=0,a=t.length;o<a;o++)"#"===t[o]&&(n[o]=e[r]||this.getMaskAtIndex(r),r+=1);return n.join("")}},{key:"formatAsNumber",value:function(e){var t=this.props,r=t.decimalScale,n=t.fixedDecimalScale,o=t.prefix,a=t.suffix,i=t.allowNegative,c=t.thousandsGroupStyle,u=this.getSeparators(),s=u.thousandSeparator,l=u.decimalSeparator,p=-1!==e.indexOf(".")||r&&n,f=h(e,i),d=f.beforeDecimal,m=f.afterDecimal,b=f.addNegation;return void 0!==r&&(m=v(m,r,n)),s&&(d=function(e,t,r){var n=function(e){switch(e){case"lakh":return/(\d+?)(?=(\d\d)+(\d)(?!\d))(\.\d+)?/g;case"wan":return/(\d)(?=(\d{4})+(?!\d))/g;case"thousand":default:return/(\d)(?=(\d{3})+(?!\d))/g}}(r),o=e.search(/[1-9]/);return o=-1===o?e.length:o,e.substring(0,o)+e.substring(o,e.length).replace(n,"$1"+t)}(d,s,c)),o&&(d=o+d),a&&(m+=a),b&&(d="-"+d),d+(p&&l||"")+m}},{key:"formatNumString",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=this.props,r=t.format,n=t.allowEmptyFormatting,o=e;return""!==e||n?"-"!==e||r?"string"==typeof r?this.formatWithPattern(o):"function"==typeof r?r(o):this.formatAsNumber(o):"-":""}},{key:"formatValueProp",value:function(e){var t=this.props,r=t.format,n=t.decimalScale,o=t.fixedDecimalScale,a=t.allowEmptyFormatting,i=this.props,c=i.value,u=i.isNumericString,s=!(c=b(c)?e:c)&&0!==c;return s&&a&&(c=""),s&&!a?"":("number"==typeof c&&(c=c.toString(),u=!0),"Infinity"===c&&u&&(c=""),u&&!r&&"number"==typeof n&&(c=function(e,t,r){if(-1!==["","-"].indexOf(e))return e;var n=-1!==e.indexOf(".")&&t,o=h(e),a=o.beforeDecimal,i=o.afterDecimal,c=o.hasNagation,u=parseFloat("0.".concat(i||"0")).toFixed(t).split("."),s=a.split("").reverse().reduce((function(e,t,r){return e.length>r?(Number(e[0])+Number(t)).toString()+e.substring(1,e.length):t+e}),u[0]),l=v(u[1]||"",Math.min(t,i.length),r),p=n?".":"";return"".concat(c?"-":"").concat(s).concat(p).concat(l)}(c,n,o)),u?this.formatNumString(c):this.formatInput(c))}},{key:"formatNegation",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=this.props.allowNegative,r=new RegExp("(-)"),n=new RegExp("(-)(.)*(-)"),o=r.test(e),a=n.test(e);return e=e.replace(/-/g,""),o&&!a&&t&&(e="-"+e),e}},{key:"formatInput",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=this.props.format;return t||(e=this.removePrefixAndSuffix(e),e=this.formatNegation(e)),e=this.removeFormatting(e),this.formatNumString(e)}},{key:"isCharacterAFormat",value:function(e,t){var r=this.props,n=r.format,o=r.prefix,a=r.suffix,i=r.decimalScale,c=r.fixedDecimalScale,u=this.getSeparators().decimalSeparator;return"string"==typeof n&&"#"!==n[e]||!(n||!(e<o.length||e>=t.length-a.length||i&&c&&t[e]===u))}},{key:"checkIfFormatGotDeleted",value:function(e,t,r){for(var n=e;n<t;n++)if(this.isCharacterAFormat(n,r))return!0;return!1}},{key:"correctInputValue",value:function(e,t,r){var n=this.props,o=n.format,a=n.allowNegative,i=n.prefix,c=n.suffix,u=n.decimalScale,s=this.getSeparators(),l=s.allowedDecimalSeparators,p=s.decimalSeparator,f=this.state.numAsString||"",d=this.selectionBeforeInput,m=d.selectionStart,b=d.selectionEnd,g=function(e,t){for(var r=0,n=0,o=e.length,a=t.length;e[r]===t[r]&&r<o;)r++;for(;e[o-1-n]===t[a-1-n]&&a-n>r&&o-n>r;)n++;return{start:r,end:o-n}}(t,r),v=g.start,y=g.end;if(!o&&v===y&&-1!==l.indexOf(r[m])){var O=0===u?"":p;return r.substr(0,m)+O+r.substr(m+1,r.length)}var x=o?0:i.length,_=t.length-(o?0:c.length);if(r.length>t.length||!r.length||v===y||0===m&&b===t.length||m===x&&b===_)return r;if(this.checkIfFormatGotDeleted(v,y,t)&&(r=t),!o){var w=this.removeFormatting(r),j=h(w,a),S=j.beforeDecimal,k=j.afterDecimal,E=j.addNegation,P=e<r.indexOf(p)+1;if(w.length<f.length&&P&&""===S&&!parseFloat(k))return E?"-":""}return r}},{key:"updateValue",value:function(e){var t=e.formattedValue,r=e.input,n=e.setCaretPosition,o=void 0===n||n,a=e.numAsString,i=e.caretPos,c=this.props.onValueChange,u=this.state.value;if(r)if(o){if(!i){var s=e.inputValue||r.value,l=x(r);r.value=t,i=this.getCaretPosition(s,t,l)}this.setPatchedCaretPosition(r,i,t)}else r.value=t;void 0===a&&(a=this.removeFormatting(t)),t!==u&&(this.setState({value:t,numAsString:a}),c(this.getValueObject(t,a)))}},{key:"onChange",value:function(e){var t=e.target,r=t.value,n=this.state,o=this.props,a=o.isAllowed,i=n.value||"",c=x(t);r=this.correctInputValue(c,i,r);var u=this.formatInput(r)||"",s=this.removeFormatting(u);a(this.getValueObject(u,s))||(u=i),this.updateValue({formattedValue:u,numAsString:s,inputValue:r,input:t}),o.onChange(e)}},{key:"onBlur",value:function(e){var t=this.props,r=this.state,n=t.format,o=t.onBlur,a=t.allowLeadingZeros,i=r.numAsString,c=r.value;if(this.focusedElm=null,clearTimeout(this.focusTimeout),!n){isNaN(parseFloat(i))&&(i=""),a||(i=function(e){if(!e)return e;var t="-"===e[0];t&&(e=e.substring(1,e.length));var r=e.split("."),n=r[0].replace(/^0+/,"")||"0",o=r[1]||"";return"".concat(t?"-":"").concat(n).concat(o?".".concat(o):"")}(i));var u=this.formatNumString(i);if(u!==c)return this.updateValue({formattedValue:u,numAsString:i,input:e.target,setCaretPosition:!1}),void o(e)}o(e)}},{key:"onKeyDown",value:function(e){var t,r=e.target,n=e.key,o=r.selectionStart,a=r.selectionEnd,i=r.value,c=void 0===i?"":i,u=this.props,s=u.decimalScale,l=u.fixedDecimalScale,p=u.prefix,f=u.suffix,d=u.format,m=u.onKeyDown,b=void 0!==s&&l,g=this.getNumberRegex(!1,b),h=new RegExp("-"),v="string"==typeof d;if(this.selectionBeforeInput={selectionStart:o,selectionEnd:a},"ArrowLeft"===n||"Backspace"===n?t=o-1:"ArrowRight"===n?t=o+1:"Delete"===n&&(t=o),void 0!==t&&o===a){var y=t,O=v?d.indexOf("#"):p.length,x=v?d.lastIndexOf("#")+1:c.length-f.length;if("ArrowLeft"===n||"ArrowRight"===n){var _="ArrowLeft"===n?"left":"right";y=this.correctCaretPosition(c,t,_)}else if("Delete"!==n||g.test(c[t])||h.test(c[t])){if("Backspace"===n&&!g.test(c[t]))if(o<=O+1&&"-"===c[0]&&void 0===d){var w=c.substring(1);this.updateValue({formattedValue:w,caretPos:y,input:r})}else if(!h.test(c[t])){for(;!g.test(c[y-1])&&y>O;)y--;y=this.correctCaretPosition(c,y,"left")}}else for(;!g.test(c[y])&&y<x;)y++;(y!==t||t<O||t>x)&&(e.preventDefault(),this.setPatchedCaretPosition(r,y,c)),e.isUnitTestRun&&this.setPatchedCaretPosition(r,y,c),m(e)}else m(e)}},{key:"onMouseUp",value:function(e){var t=e.target,r=t.selectionStart,n=t.selectionEnd,o=t.value,a=void 0===o?"":o;if(r===n){var i=this.correctCaretPosition(a,r);i!==r&&this.setPatchedCaretPosition(t,i,a)}this.props.onMouseUp(e)}},{key:"onFocus",value:function(e){var t=this;e.persist(),this.focusedElm=e.target,this.focusTimeout=setTimeout((function(){var r=e.target,n=r.selectionStart,o=r.selectionEnd,a=r.value,i=void 0===a?"":a,c=t.correctCaretPosition(i,n);c===n||0===n&&o===i.length||t.setPatchedCaretPosition(r,c,i),t.props.onFocus(e)}),0)}},{key:"render",value:function(){var e,t,r,n=this.props,a=n.type,c=n.displayType,u=n.customInput,s=n.renderText,l=n.getInputRef,p=n.format,f=this.state.value,d=(e=this.props,t=_,r={},Object.keys(e).forEach((function(n){t[n]||(r[n]=e[n])})),r),m=i({inputMode:function(e){return e||!(navigator.platform&&/iPhone|iPod/.test(navigator.platform))}(p)?"numeric":void 0},d,{type:a,value:f,onChange:this.onChange,onKeyDown:this.onKeyDown,onMouseUp:this.onMouseUp,onFocus:this.onFocus,onBlur:this.onBlur});if("text"===c)return s?s(f)||null:o.a.createElement("span",i({},d,{ref:l}),f);if(u){var b=u;return o.a.createElement(b,i({},m,{ref:l}))}return o.a.createElement("input",i({},m,{ref:l}))}}])&&a(r.prototype,n),t}(o.a.Component);j.propTypes=_,j.defaultProps=w,t.a=j},128:function(e,t,r){"use strict";var n=r(0),o=r(8),a=r(11),i=r(83);t.a=function(e){return function(t){var r;return r=Object(n.useRef)(i.n.restApiRoutes||{}),Object(a.useSelect)((function(e,t){if(r.current){var n=e(o.SCHEMA_STORE_KEY),a=n.isResolving,i=n.hasFinishedResolution,c=t.dispatch(o.SCHEMA_STORE_KEY),u=c.receiveRoutes,s=c.startResolution,l=c.finishResolution;Object.keys(r.current).forEach((function(e){var t=r.current[e];a("getRoutes",[e])||i("getRoutes",[e])||(s("getRoutes",[e]),u(t,[e]),l("getRoutes",[e]))}))}}),[]),React.createElement(e,t)}}},133:function(e,t,r){"use strict";var n=r(1),o=(r(10),r(6)),a=r.n(o),i=r(51),c=(r(154),function(e){var t=e.className,r=e.disabled,o=e.label,c=void 0===o?Object(n.__)("Go",'woocommerce'):o,u=e.onClick,s=e.screenReaderLabel,l=void 0===s?Object(n.__)("Apply filter",'woocommerce'):s;return React.createElement("button",{type:"submit",className:a()("wc-block-filter-submit-button","wc-block-components-filter-submit-button",t),disabled:r,onClick:u},React.createElement(i.a,{label:c,screenReaderLabel:l}))});c.defaultProps={disabled:!1},t.a=c},14:function(e,t){function r(){return e.exports=r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},e.exports.default=e.exports,e.exports.__esModule=!0,r.apply(this,arguments)}e.exports=r,e.exports.default=e.exports,e.exports.__esModule=!0},147:function(e,t){},154:function(e,t){},2:function(e,t){e.exports=window.wc.wcSettings},21:function(e,t){function r(t){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?(e.exports=r=function(e){return typeof e},e.exports.default=e.exports,e.exports.__esModule=!0):(e.exports=r=function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.default=e.exports,e.exports.__esModule=!0),r(t)}e.exports=r,e.exports.default=e.exports,e.exports.__esModule=!0},223:function(e,t,r){"use strict";r.d(t,"a",(function(){return O}));var n=r(4),o=r.n(n),a=r(46),i=r.n(a),c=r(21),u=r.n(c),s=r(5),l=r.n(s),p=r(0),f=r(115),d=r(7),m=r(53),b=r(90),g=r(120),h=r(64);function v(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function y(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?v(Object(r),!0).forEach((function(t){o()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):v(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var O=function(e){var t=e.queryAttribute,r=e.queryPrices,n=e.queryStock,o=e.queryState,a=Object(h.a)();a="".concat(a,"-collection-data");var c=Object(b.a)(a),s=l()(c,1)[0],v=Object(b.b)("calculate_attribute_counts",[],a),O=l()(v,2),x=O[0],_=O[1],w=Object(b.b)("calculate_price_range",null,a),j=l()(w,2),S=j[0],k=j[1],E=Object(b.b)("calculate_stock_status_counts",null,a),P=l()(E,2),R=P[0],N=P[1],T=Object(m.a)(t||{}),C=Object(m.a)(r),F=Object(m.a)(n);Object(p.useEffect)((function(){"object"===u()(T)&&Object.keys(T).length&&(x.find((function(e){return e.taxonomy===T.taxonomy}))||_([].concat(i()(x),[T])))}),[T,x,_]),Object(p.useEffect)((function(){S!==C&&void 0!==C&&k(C)}),[C,k,S]),Object(p.useEffect)((function(){R!==F&&void 0!==F&&N(F)}),[F,N,R]);var M=Object(p.useState)(!1),A=l()(M,2),D=A[0],I=A[1],U=Object(f.a)(D,200),V=l()(U,1)[0];D||I(!0);var B=Object(p.useMemo)((function(){return function(e){var t=e;return e.calculate_attribute_counts&&(t.calculate_attribute_counts=Object(d.sortBy)(e.calculate_attribute_counts.map((function(e){return{taxonomy:e.taxonomy,query_type:e.queryType}})),["taxonomy","query_type"])),t}(s)}),[s]);return Object(g.a)({namespace:"/wc/store",resourceName:"products/collection-data",query:y(y({},o),{},{page:void 0,per_page:void 0,orderby:void 0,order:void 0},B),shouldSelect:V})}},23:function(e,t,r){var n=r(77);e.exports=function(e,t){if(null==e)return{};var r,o,a=n(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(o=0;o<i.length;o++)r=i[o],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a},e.exports.default=e.exports,e.exports.__esModule=!0},25:function(e,t){e.exports=window.wp.isShallowEqual},288:function(e,t,r){e.exports=r(317)},289:function(e,t){},29:function(e,t){e.exports=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e},e.exports.default=e.exports,e.exports.__esModule=!0},3:function(e,t){e.exports=window.React},30:function(e,t){function r(t){return e.exports=r=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},e.exports.default=e.exports,e.exports.__esModule=!0,r(t)}e.exports=r,e.exports.default=e.exports,e.exports.__esModule=!0},317:function(e,t,r){"use strict";r.r(t);var n=r(128),o=r(107),a=r(5),i=r.n(a),c=r(99),u=r(90),s=r(223),l=r(0),p=r(1),f=(r(10),r(6)),d=r.n(f),m=r(69),b=r(49),g=(r(289),function(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,o=arguments.length>4&&void 0!==arguments[4]&&arguments[4],a=parseInt(e[0],10),i=parseInt(e[1],10);return Number.isFinite(a)||(a=t||0),Number.isFinite(i)||(i=r||n),Number.isFinite(t)&&t>a&&(a=t),Number.isFinite(r)&&r<=a&&(a=r-n),Number.isFinite(t)&&t>=i&&(i=t+n),Number.isFinite(r)&&r<i&&(i=r),!o&&a>=i&&(a=i-n),o&&i<=a&&(i=a+n),[a,i]}),h=r(133),v=function(e){var t=e.minPrice,r=e.maxPrice,n=e.minConstraint,o=e.maxConstraint,a=e.onChange,c=void 0===a?function(){}:a,u=e.step,s=e.currency,f=e.showInputFields,v=void 0===f||f,y=e.showFilterButton,O=void 0!==y&&y,x=e.isLoading,_=void 0!==x&&x,w=e.onSubmit,j=void 0===w?function(){}:w,S=Object(l.useRef)(),k=Object(l.useRef)(),E=u||10*Math.pow(10,s.minorUnit),P=Object(l.useState)(t),R=i()(P,2),N=R[0],T=R[1],C=Object(l.useState)(r),F=i()(C,2),M=F[0],A=F[1];Object(l.useEffect)((function(){T(t)}),[t]),Object(l.useEffect)((function(){A(r)}),[r]);var D=Object(l.useMemo)((function(){return isFinite(n)&&isFinite(o)}),[n,o]),I=Object(l.useMemo)((function(){return isFinite(t)&&isFinite(r)&&D?{"--low":Math.round((t-n)/(o-n)*100)-.5+"%","--high":Math.round((r-n)/(o-n)*100)+.5+"%"}:{"--low":"0%","--high":"100%"}}),[t,r,n,o,D]),U=Object(l.useCallback)((function(e){if(!_&&D){var t=e.target.getBoundingClientRect(),r=e.clientX-t.left,n=S.current.offsetWidth,a=S.current.value,i=k.current.offsetWidth,c=k.current.value,u=n*(a/o),s=i*(c/o);Math.abs(r-u)>Math.abs(r-s)?(S.current.style.zIndex=20,k.current.style.zIndex=21):(S.current.style.zIndex=21,k.current.style.zIndex=20)}}),[_,o,D]),V=Object(l.useCallback)((function(e){var a=e.target.classList.contains("wc-block-price-filter__range-input--min"),i=e.target.value,u=a?[Math.round(i/E)*E,r]:[t,Math.round(i/E)*E],s=g(u,n,o,E,a);c([parseInt(s[0],10),parseInt(s[1],10)])}),[c,t,r,n,o,E]),B=Object(l.useCallback)((function(e){if(!(e.relatedTarget&&e.relatedTarget.classList&&e.relatedTarget.classList.contains("wc-block-price-filter__amount"))){var t=e.target.classList.contains("wc-block-price-filter__amount--min"),r=g([N,M],null,null,E,t);c([parseInt(r[0],10),parseInt(r[1],10)])}}),[c,E,N,M]),L=d()("wc-block-price-filter","wc-block-components-price-slider",v&&"wc-block-price-filter--has-input-fields",v&&"wc-block-components-price-slider--has-input-fields",O&&"wc-block-price-filter--has-filter-button",O&&"wc-block-components-price-slider--has-filter-button",_&&"is-loading",!D&&"is-disabled"),q=Object(b.b)(S.current)?S.current.ownerDocument.activeElement:void 0,G=q&&q===S.current?E:1,K=q&&q===k.current?E:1,W=N/Math.pow(10,s.minorUnit),Y=M/Math.pow(10,s.minorUnit);return React.createElement("div",{className:L},React.createElement("div",{className:"wc-block-price-filter__range-input-wrapper wc-block-components-price-slider__range-input-wrapper",onMouseMove:U,onFocus:U},D&&React.createElement("div",{"aria-hidden":v},React.createElement("div",{className:"wc-block-price-filter__range-input-progress wc-block-components-price-slider__range-input-progress",style:I}),React.createElement("input",{type:"range",className:"wc-block-price-filter__range-input wc-block-price-filter__range-input--min wc-block-components-price-slider__range-input wc-block-components-price-slider__range-input--min","aria-label":Object(p.__)("Filter products by minimum price",'woocommerce'),"aria-valuetext":W,value:Number.isFinite(t)?t:n,onChange:V,step:G,min:n,max:o,ref:S,disabled:_,tabIndex:v?"-1":"0"}),React.createElement("input",{type:"range",className:"wc-block-price-filter__range-input wc-block-price-filter__range-input--max wc-block-components-price-slider__range-input wc-block-components-price-slider__range-input--max","aria-label":Object(p.__)("Filter products by maximum price",'woocommerce'),"aria-valuetext":Y,value:Number.isFinite(r)?r:o,onChange:V,step:K,min:n,max:o,ref:k,disabled:_,tabIndex:v?"-1":"0"}))),React.createElement("div",{className:"wc-block-price-filter__controls wc-block-components-price-slider__controls"},v&&React.createElement(React.Fragment,null,React.createElement(m.a,{currency:s,displayType:"input",className:"wc-block-price-filter__amount wc-block-price-filter__amount--min wc-block-form-text-input wc-block-components-price-slider__amount wc-block-components-price-slider__amount--min","aria-label":Object(p.__)("Filter products by minimum price",'woocommerce'),onValueChange:function(e){e!==N&&T(e)},onBlur:B,disabled:_||!D,value:N}),React.createElement(m.a,{currency:s,displayType:"input",className:"wc-block-price-filter__amount wc-block-price-filter__amount--max wc-block-form-text-input wc-block-components-price-slider__amount wc-block-components-price-slider__amount--max","aria-label":Object(p.__)("Filter products by maximum price",'woocommerce'),onValueChange:function(e){e!==M&&A(e)},onBlur:B,disabled:_||!D,value:M})),!v&&!_&&Number.isFinite(t)&&Number.isFinite(r)&&React.createElement("div",{className:"wc-block-price-filter__range-text wc-block-components-price-slider__range-text"},Object(p.__)("Price",'woocommerce'),":  ",React.createElement(m.a,{currency:s,value:t})," – ",React.createElement(m.a,{currency:s,value:r})),O&&React.createElement(h.a,{className:"wc-block-price-filter__button wc-block-components-price-slider__button",disabled:_||!D,onClick:j,screenReaderLabel:Object(p.__)("Apply price filter",'woocommerce')})))},y=r(82),O=r(58),x=function(e,t,r){var n,o=10*Math.pow(10,t);"ROUND_UP"===r?n=isNaN(e)?null:Math.ceil(parseFloat(e,10)/o)*o:"ROUND_DOWN"===r&&(n=isNaN(e)?null:Math.floor(parseFloat(e,10)/o)*o);var a=Object(c.a)(n,Number.isFinite);return Number.isFinite(n)?n:a};Object(o.a)({selector:".wp-block-woocommerce-price-filter",Block:Object(n.a)((function(e){var t=e.attributes,r=e.isEditor,n=void 0!==r&&r,o=Object(u.b)("min_price",null),a=i()(o,2),p=a[0],f=a[1],d=Object(u.b)("max_price",null),m=i()(d,2),b=m[0],g=m[1],h=Object(u.a)(),_=i()(h,1)[0],w=Object(s.a)({queryPrices:!0,queryState:_}),j=w.results,S=w.isLoading,k=Object(l.useState)(),E=i()(k,2),P=E[0],R=E[1],N=Object(l.useState)(),T=i()(N,2),C=T[0],F=T[1],M=Object(O.getCurrencyFromPriceResponse)(j.price_range),A=function(e){var t=e.maxPrice,r=e.minorUnit;return{minConstraint:x(e.minPrice,r,"ROUND_DOWN"),maxConstraint:x(t,r,"ROUND_UP")}}({minPrice:j.price_range?j.price_range.min_price:void 0,maxPrice:j.price_range?j.price_range.max_price:void 0,minorUnit:M.minorUnit}),D=A.minConstraint,I=A.maxConstraint,U=Object(l.useCallback)((function(e,t){f(e===D?void 0:e),g(t===I?void 0:t)}),[D,I,f,g]),V=Object(y.a)(U,500),B=i()(V,1)[0],L=Object(l.useCallback)((function(e){e[0]!==P&&R(e[0]),e[1]!==C&&F(e[1])}),[P,C,R,F]);Object(l.useEffect)((function(){t.showFilterButton||B(P,C)}),[P,C,t.showFilterButton,B]);var q=Object(c.a)(p),G=Object(c.a)(b),K=Object(c.a)(D),W=Object(c.a)(I);if(Object(l.useEffect)((function(){(!Number.isFinite(P)||p!==q&&p!==P||D!==K&&D!==P)&&R(Number.isFinite(p)?p:D),(!Number.isFinite(C)||b!==G&&b!==C||I!==W&&I!==C)&&F(Number.isFinite(b)?b:I)}),[P,C,p,b,D,I,K,W,q,G]),!S&&(null===D||null===I||D===I))return null;var Y="h".concat(t.headingLevel);return React.createElement(React.Fragment,null,!n&&t.heading&&React.createElement(Y,{className:"wc-block-price-filter__title"},t.heading),React.createElement("div",{className:"wc-block-price-slider"},React.createElement(v,{minConstraint:D,maxConstraint:I,minPrice:P,maxPrice:C,currency:M,showInputFields:t.showInputFields,showFilterButton:t.showFilterButton,onChange:L,onSubmit:function(){return U(P,C)},isLoading:S})))})),getProps:function(e){return{attributes:{showInputFields:"true"===e.dataset.showinputfields,showFilterButton:"true"===e.dataset.showfilterbutton}}}})},4:function(e,t){e.exports=function(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e},e.exports.default=e.exports,e.exports.__esModule=!0},40:function(e,t){e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},e.exports.default=e.exports,e.exports.__esModule=!0},41:function(e,t){function r(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}e.exports=function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e},e.exports.default=e.exports,e.exports.__esModule=!0},42:function(e,t,r){var n=r(71);e.exports=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&n(e,t)},e.exports.default=e.exports,e.exports.__esModule=!0},43:function(e,t,r){var n=r(21).default,o=r(29);e.exports=function(e,t){return!t||"object"!==n(t)&&"function"!=typeof t?o(e):t},e.exports.default=e.exports,e.exports.__esModule=!0},44:function(e,t,r){"use strict";var n=r(40),o=r.n(n),a=r(41),i=r.n(a),c=r(29),u=r.n(c),s=r(42),l=r.n(s),p=r(43),f=r.n(p),d=r(30),m=r.n(d),b=r(4),g=r.n(b),h=(r(10),r(3)),v=r(1),y=r(83),O=function(e){var t=e.imageUrl,r=void 0===t?"".concat(y.l,"/block-error.svg"):t,n=e.header,o=void 0===n?Object(v.__)("Oops!",'woocommerce'):n,a=e.text,i=void 0===a?Object(v.__)("There was an error loading the content.",'woocommerce'):a,c=e.errorMessage,u=e.errorMessagePrefix,s=void 0===u?Object(v.__)("Error:",'woocommerce'):u,l=e.button;return React.createElement("div",{className:"wc-block-error wc-block-components-error"},r&&React.createElement("img",{className:"wc-block-error__image wc-block-components-error__image",src:r,alt:""}),React.createElement("div",{className:"wc-block-error__content wc-block-components-error__content"},o&&React.createElement("p",{className:"wc-block-error__header wc-block-components-error__header"},o),i&&React.createElement("p",{className:"wc-block-error__text wc-block-components-error__text"},i),c&&React.createElement("p",{className:"wc-block-error__message wc-block-components-error__message"},s?s+" ":"",c),l&&React.createElement("p",{className:"wc-block-error__button wc-block-components-error__button"},l)))};r(81);var x=function(e){l()(a,e);var t,r,n=(t=a,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,n=m()(t);if(r){var o=m()(this).constructor;e=Reflect.construct(n,arguments,o)}else e=n.apply(this,arguments);return f()(this,e)});function a(){var e;o()(this,a);for(var t=arguments.length,r=new Array(t),i=0;i<t;i++)r[i]=arguments[i];return e=n.call.apply(n,[this].concat(r)),g()(u()(e),"state",{errorMessage:"",hasError:!1}),e}return i()(a,[{key:"render",value:function(){var e=this.props,t=e.header,r=e.imageUrl,n=e.showErrorMessage,o=e.text,a=e.errorMessagePrefix,i=e.renderError,c=e.button,u=this.state,s=u.errorMessage;return u.hasError?"function"==typeof i?i({errorMessage:s}):React.createElement(O,{errorMessage:n?s:null,header:t,imageUrl:r,text:o,errorMessagePrefix:a,button:c}):this.props.children}}],[{key:"getDerivedStateFromError",value:function(e){return void 0!==e.statusText&&void 0!==e.status?{errorMessage:React.createElement(React.Fragment,null,React.createElement("strong",null,e.status),": ",e.statusText),hasError:!0}:{errorMessage:e.message,hasError:!0}}}]),a}(h.Component);x.defaultProps={showErrorMessage:!0},t.a=x},46:function(e,t,r){var n=r(94),o=r(95),a=r(67),i=r(96);e.exports=function(e){return n(e)||o(e)||a(e)||i()},e.exports.default=e.exports,e.exports.__esModule=!0},49:function(e,t,r){"use strict";r.d(t,"a",(function(){return n})),r.d(t,"c",(function(){return o})),r.d(t,"b",(function(){return a})),r.d(t,"d",(function(){return i}));var n=function(e){return"number"==typeof e},o=function(e){return"string"==typeof e},a=function(e){return!function(e){return null===e}(e)&&e instanceof Object&&e.constructor===Object};function i(e,t){return a(e)&&t in e}},5:function(e,t,r){var n=r(84),o=r(85),a=r(67),i=r(86);e.exports=function(e,t){return n(e)||o(e,t)||a(e,t)||i()},e.exports.default=e.exports,e.exports.__esModule=!0},51:function(e,t,r){"use strict";var n=r(4),o=r.n(n),a=r(0),i=r(6),c=r.n(i);function u(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function s(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?u(Object(r),!0).forEach((function(t){o()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):u(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}t.a=function(e){var t,r=e.label,n=e.screenReaderLabel,o=e.wrapperElement,i=e.wrapperProps,u=void 0===i?{}:i,l=null!=r,p=null!=n;return!l&&p?(t=o||"span",u=s(s({},u),{},{className:c()(u.className,"screen-reader-text")}),React.createElement(t,u,n)):(t=o||a.Fragment,l&&p&&r!==n?React.createElement(t,u,React.createElement("span",{"aria-hidden":"true"},r),React.createElement("span",{className:"screen-reader-text"},n)):React.createElement(t,u,r))}},53:function(e,t,r){"use strict";r.d(t,"a",(function(){return i}));var n=r(0),o=r(25),a=r.n(o);function i(e){var t=Object(n.useRef)(e);return a()(e,t.current)||(t.current=e),t.current}},58:function(e,t){e.exports=window.wc.priceFormat},6:function(e,t,r){var n;!function(){"use strict";var r={}.hasOwnProperty;function o(){for(var e=[],t=0;t<arguments.length;t++){var n=arguments[t];if(n){var a=typeof n;if("string"===a||"number"===a)e.push(n);else if(Array.isArray(n)){if(n.length){var i=o.apply(null,n);i&&e.push(i)}}else if("object"===a)if(n.toString===Object.prototype.toString)for(var c in n)r.call(n,c)&&n[c]&&e.push(c);else e.push(n.toString())}}return e.join(" ")}e.exports?(o.default=o,e.exports=o):void 0===(n=function(){return o}.apply(t,[]))||(e.exports=n)}()},64:function(e,t,r){"use strict";r.d(t,"a",(function(){return a}));var n=r(0),o=Object(n.createContext)("page"),a=function(){return Object(n.useContext)(o)};o.Provider},67:function(e,t,r){var n=r(68);e.exports=function(e,t){if(e){if("string"==typeof e)return n(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?n(e,t):void 0}},e.exports.default=e.exports,e.exports.__esModule=!0},68:function(e,t){e.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n},e.exports.default=e.exports,e.exports.__esModule=!0},69:function(e,t,r){"use strict";var n=r(14),o=r.n(n),a=r(4),i=r.n(a),c=r(23),u=r.n(c),s=r(126),l=r(6),p=r.n(l),f=(r(147),["className","value","currency","onValueChange","displayType"]);function d(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function m(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?d(Object(r),!0).forEach((function(t){i()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):d(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}t.a=function(e){var t=e.className,r=e.value,n=e.currency,a=e.onValueChange,i=e.displayType,c=void 0===i?"text":i,l=u()(e,f),d="string"==typeof r?parseInt(r,10):r;if(!Number.isFinite(d))return null;var b=d/Math.pow(10,n.minorUnit);if(!Number.isFinite(b))return null;var g=p()("wc-block-formatted-money-amount","wc-block-components-formatted-money-amount",t),h=m(m(m({},l),function(e){return{thousandSeparator:e.thousandSeparator,decimalSeparator:e.decimalSeparator,decimalScale:e.minorUnit,fixedDecimalScale:!0,prefix:e.prefix,suffix:e.suffix,isNumericString:!0}}(n)),{},{value:void 0,currency:void 0,onValueChange:void 0}),v=a?function(e){var t=e.value*Math.pow(10,n.minorUnit);a(t)}:function(){};return React.createElement(s.a,o()({className:g,displayType:c},h,{value:b,onValueChange:v}))}},7:function(e,t){e.exports=window.lodash},71:function(e,t){function r(t,n){return e.exports=r=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},e.exports.default=e.exports,e.exports.__esModule=!0,r(t,n)}e.exports=r,e.exports.default=e.exports,e.exports.__esModule=!0},77:function(e,t){e.exports=function(e,t){if(null==e)return{};var r,n,o={},a=Object.keys(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||(o[r]=e[r]);return o},e.exports.default=e.exports,e.exports.__esModule=!0},79:function(e,t,r){"use strict";var n=r(80);function o(){}function a(){}a.resetWarningCache=o,e.exports=function(){function e(e,t,r,o,a,i){if(i!==n){var c=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw c.name="Invariant Violation",c}}function t(){return e}e.isRequired=e;var r={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:a,resetWarningCache:o};return r.PropTypes=r,r}},8:function(e,t){e.exports=window.wc.wcBlocksData},80:function(e,t,r){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},81:function(e,t){},82:function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));var n=r(3);function o(e,t,r){void 0===r&&(r={});var o=r.maxWait,a=Object(n.useRef)(null),i=Object(n.useRef)([]),c=r.leading,u=void 0===r.trailing||r.trailing,s=Object(n.useRef)(!1),l=Object(n.useRef)(null),p=Object(n.useRef)(!1),f=Object(n.useRef)(e);f.current=e;var d=Object(n.useCallback)((function(){clearTimeout(l.current),clearTimeout(a.current),a.current=null,i.current=[],l.current=null,s.current=!1}),[]);Object(n.useEffect)((function(){return p.current=!1,function(){p.current=!0}}),[]);var m=Object(n.useCallback)((function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];i.current=e,clearTimeout(l.current),s.current&&(s.current=!1),l.current||!c||s.current||(f.current.apply(f,e),s.current=!0),l.current=setTimeout((function(){var t=!0;c&&s.current&&(t=!1),d(),!p.current&&u&&t&&f.current.apply(f,e)}),t),o&&!a.current&&u&&(a.current=setTimeout((function(){var e=i.current;d(),p.current||f.current.apply(null,e)}),o))}),[o,t,d,c,u]),b=Object(n.useCallback)((function(){l.current&&(f.current.apply(null,i.current),d())}),[d]);return[m,d,b]}},83:function(e,t,r){"use strict";r.d(t,"n",(function(){return a})),r.d(t,"l",(function(){return i})),r.d(t,"k",(function(){return c})),r.d(t,"m",(function(){return u})),r.d(t,"i",(function(){return s})),r.d(t,"d",(function(){return l})),r.d(t,"f",(function(){return p})),r.d(t,"j",(function(){return f})),r.d(t,"c",(function(){return d})),r.d(t,"e",(function(){return m})),r.d(t,"g",(function(){return b})),r.d(t,"a",(function(){return g})),r.d(t,"h",(function(){return h})),r.d(t,"b",(function(){return v}));var n,o=r(2),a=Object(o.getSetting)("wcBlocksConfig",{buildPhase:1,pluginUrl:"",productCount:0,defaultAvatar:"",restApiRoutes:{},wordCountType:"words"}),i=a.pluginUrl+"images/",c=a.pluginUrl+"build/",u=a.buildPhase,s=null===(n=o.STORE_PAGES.shop)||void 0===n?void 0:n.permalink,l=(o.STORE_PAGES.checkout.id,o.STORE_PAGES.checkout.permalink),p=o.STORE_PAGES.privacy.permalink,f=(o.STORE_PAGES.privacy.title,o.STORE_PAGES.terms.permalink),d=(o.STORE_PAGES.terms.title,o.STORE_PAGES.cart.id,o.STORE_PAGES.cart.permalink),m=o.STORE_PAGES.myaccount.permalink?o.STORE_PAGES.myaccount.permalink:Object(o.getSetting)("wpLoginUrl","/wp-login.php"),b=Object(o.getSetting)("shippingCountries",{}),g=Object(o.getSetting)("allowedCountries",{}),h=Object(o.getSetting)("shippingStates",{}),v=Object(o.getSetting)("allowedStates",{})},84:function(e,t){e.exports=function(e){if(Array.isArray(e))return e},e.exports.default=e.exports,e.exports.__esModule=!0},85:function(e,t){e.exports=function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,a=[],_n=!0,i=!1;try{for(r=r.call(e);!(_n=(n=r.next()).done)&&(a.push(n.value),!t||a.length!==t);_n=!0);}catch(e){i=!0,o=e}finally{try{_n||null==r.return||r.return()}finally{if(i)throw o}}return a}},e.exports.default=e.exports,e.exports.__esModule=!0},86:function(e,t){e.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},e.exports.default=e.exports,e.exports.__esModule=!0},90:function(e,t,r){"use strict";r.d(t,"a",(function(){return d})),r.d(t,"b",(function(){return m})),r.d(t,"c",(function(){return b}));var n=r(5),o=r.n(n),a=r(8),i=r(11),c=r(0),u=r(25),s=r.n(u),l=r(53),p=r(99),f=r(64),d=function(e){var t=Object(f.a)();e=e||t;var r=Object(i.useSelect)((function(t){return t(a.QUERY_STATE_STORE_KEY).getValueForQueryContext(e,void 0)}),[e]),n=Object(i.useDispatch)(a.QUERY_STATE_STORE_KEY).setValueForQueryContext;return[r,Object(c.useCallback)((function(t){n(e,t)}),[e,n])]},m=function(e,t,r){var n=Object(f.a)();r=r||n;var o=Object(i.useSelect)((function(n){return n(a.QUERY_STATE_STORE_KEY).getValueForQueryKey(r,e,t)}),[r,e]),u=Object(i.useDispatch)(a.QUERY_STATE_STORE_KEY).setQueryValue;return[o,Object(c.useCallback)((function(t){u(r,e,t)}),[r,e,u])]},b=function(e,t){var r=Object(f.a)(),n=d(t=t||r),a=o()(n,2),i=a[0],u=a[1],m=Object(l.a)(i),b=Object(l.a)(e),g=Object(p.a)(b),h=Object(c.useRef)(!1);return Object(c.useEffect)((function(){s()(g,b)||(u(Object.assign({},m,b)),h.current=!0)}),[m,b,g,u]),h.current?[i,u]:[e,u]}},94:function(e,t,r){var n=r(68);e.exports=function(e){if(Array.isArray(e))return n(e)},e.exports.default=e.exports,e.exports.__esModule=!0},95:function(e,t){e.exports=function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)},e.exports.default=e.exports,e.exports.__esModule=!0},96:function(e,t){e.exports=function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},e.exports.default=e.exports,e.exports.__esModule=!0},99:function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));var n=r(3);function o(e,t){var r=Object(n.useRef)();return Object(n.useEffect)((function(){r.current===e||t&&!t(e,r.current)||(r.current=e)}),[e,t]),r.current}}});woocommerce-blocks/build/reviews-by-category.js000064400000126651151335517640015727 0ustar00this.wc=this.wc||{},this.wc.blocks=this.wc.blocks||{},this.wc.blocks["reviews-by-category"]=function(e){function t(t){for(var n,a,i=t[0],s=t[1],l=t[2],d=0,b=[];d<i.length;d++)a=i[d],Object.prototype.hasOwnProperty.call(o,a)&&o[a]&&b.push(o[a][0]),o[a]=0;for(n in s)Object.prototype.hasOwnProperty.call(s,n)&&(e[n]=s[n]);for(u&&u(t);b.length;)b.shift()();return c.push.apply(c,l||[]),r()}function r(){for(var e,t=0;t<c.length;t++){for(var r=c[t],n=!0,i=1;i<r.length;i++){var s=r[i];0!==o[s]&&(n=!1)}n&&(c.splice(t--,1),e=a(a.s=r[0]))}return e}var n={},o={37:0},c=[];function a(t){if(n[t])return n[t].exports;var r=n[t]={i:t,l:!1,exports:{}};return e[t].call(r.exports,r,r.exports,a),r.l=!0,r.exports}a.m=e,a.c=n,a.d=function(e,t,r){a.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},a.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},a.t=function(e,t){if(1&t&&(e=a(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(a.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)a.d(r,n,function(t){return e[t]}.bind(null,n));return r},a.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return a.d(t,"a",t),t},a.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},a.p="";var i=window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[],s=i.push.bind(i);i.push=t,i=i.slice();for(var l=0;l<i.length;l++)t(i[l]);var u=s;return c.push([776,0]),r()}({0:function(e,t){e.exports=window.wp.element},1:function(e,t){e.exports=window.wp.i18n},106:function(e,t,r){"use strict";var n=r(0),o=r(1),c=(r(2),r(66)),a=r(150),i=r(6),s=r.n(i),l=r(4),u=r(52);r(153),t.a=function(e){var t=e.className,r=e.error,i=e.isLoading,d=e.onRetry;return Object(n.createElement)(l.Placeholder,{icon:Object(n.createElement)(c.a,{srcElement:a.a}),label:Object(o.__)("Sorry, an error occurred",'woocommerce'),className:s()("wc-block-api-error",t)},Object(n.createElement)(u.a,{error:r}),d&&Object(n.createElement)(n.Fragment,null,i?Object(n.createElement)(l.Spinner,null):Object(n.createElement)(l.Button,{isSecondary:!0,onClick:d},Object(o.__)("Retry",'woocommerce'))))}},11:function(e,t){e.exports=window.React},12:function(e,t){e.exports=window.wp.blockEditor},121:function(e,t){},122:function(e,t){e.exports=window.wp.coreData},123:function(e,t){},139:function(e,t){},14:function(e,t){e.exports=window.wp.data},144:function(e,t,r){"use strict";r.d(t,"a",(function(){return l})),r.d(t,"b",(function(){return u})),r.d(t,"c",(function(){return d}));var n=r(0),o=r(1),c=r(4),a=r(12),i=r(3),s=r(88),l=function(e,t){return Object(n.createElement)(a.BlockControls,null,Object(n.createElement)(c.ToolbarGroup,{controls:[{icon:"edit",title:Object(o.__)("Edit",'woocommerce'),onClick:function(){return t({editMode:!e})},isActive:e}]}))},u=function(e,t){var r=Object(i.getSetting)("showAvatars",!0),a=Object(i.getSetting)("reviewRatingsEnabled",!0);return Object(n.createElement)(n.Fragment,null,Object(n.createElement)(c.ToggleControl,{label:Object(o.__)("Product rating",'woocommerce'),checked:e.showReviewRating,onChange:function(){return t({showReviewRating:!e.showReviewRating})}}),e.showReviewRating&&!a&&Object(n.createElement)(c.Notice,{className:"wc-block-base-control-notice",isDismissible:!1},Object(n.createInterpolateElement)(Object(o.__)("Product rating is disabled in your <a>store settings</a>.",'woocommerce'),{a:Object(n.createElement)("a",{href:Object(i.getAdminLink)("admin.php?page=wc-settings&tab=products"),target:"_blank",rel:"noopener noreferrer"})})),Object(n.createElement)(c.ToggleControl,{label:Object(o.__)("Reviewer name",'woocommerce'),checked:e.showReviewerName,onChange:function(){return t({showReviewerName:!e.showReviewerName})}}),Object(n.createElement)(c.ToggleControl,{label:Object(o.__)("Image",'woocommerce'),checked:e.showReviewImage,onChange:function(){return t({showReviewImage:!e.showReviewImage})}}),Object(n.createElement)(c.ToggleControl,{label:Object(o.__)("Review date",'woocommerce'),checked:e.showReviewDate,onChange:function(){return t({showReviewDate:!e.showReviewDate})}}),Object(n.createElement)(c.ToggleControl,{label:Object(o.__)("Review content",'woocommerce'),checked:e.showReviewContent,onChange:function(){return t({showReviewContent:!e.showReviewContent})}}),e.showReviewImage&&Object(n.createElement)(n.Fragment,null,Object(n.createElement)(s.a,{label:Object(o.__)("Review image",'woocommerce'),value:e.imageType,options:[{label:Object(o.__)("Reviewer photo",'woocommerce'),value:"reviewer"},{label:Object(o.__)("Product",'woocommerce'),value:"product"}],onChange:function(e){return t({imageType:e})}}),"reviewer"===e.imageType&&!r&&Object(n.createElement)(c.Notice,{className:"wc-block-base-control-notice",isDismissible:!1},Object(n.createInterpolateElement)(Object(o.__)("Reviewer photo is disabled in your <a>site settings</a>.",'woocommerce'),{a:Object(n.createElement)("a",{href:Object(i.getAdminLink)("options-discussion.php"),target:"_blank",rel:"noopener noreferrer"})}))))},d=function(e,t){return Object(n.createElement)(n.Fragment,null,Object(n.createElement)(c.ToggleControl,{label:Object(o.__)("Order by",'woocommerce'),checked:e.showOrderby,onChange:function(){return t({showOrderby:!e.showOrderby})}}),Object(n.createElement)(c.SelectControl,{label:Object(o.__)("Order Product Reviews by",'woocommerce'),value:e.orderby,options:[{label:"Most recent",value:"most-recent"},{label:"Highest Rating",value:"highest-rating"},{label:"Lowest Rating",value:"lowest-rating"}],onChange:function(e){return t({orderby:e})}}),Object(n.createElement)(c.RangeControl,{label:Object(o.__)("Starting Number of Reviews",'woocommerce'),value:e.reviewsOnPageLoad,onChange:function(e){return t({reviewsOnPageLoad:e})},max:20,min:1}),Object(n.createElement)(c.ToggleControl,{label:Object(o.__)("Load more",'woocommerce'),checked:e.showLoadMore,onChange:function(){return t({showLoadMore:!e.showLoadMore})}}),e.showLoadMore&&Object(n.createElement)(c.RangeControl,{label:Object(o.__)("Load More Reviews",'woocommerce'),value:e.reviewsOnLoadMore,onChange:function(e){return t({reviewsOnLoadMore:e})},max:20,min:1}))}},15:function(e,t){e.exports=window.wp.apiFetch},150:function(e,t,r){"use strict";var n=r(0),o=r(28),c=Object(n.createElement)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(n.createElement)("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z"}));t.a=c},153:function(e,t){},156:function(e,t,r){"use strict";var n=r(0),o=(r(2),r(6)),c=r.n(o),a=r(41),i=r(21);r(216),t.a=Object(i.withInstanceId)((function(e){var t=e.className,r=e.instanceId,o=e.label,i=e.onChange,s=e.options,l=e.screenReaderLabel,u=e.readOnly,d=e.value,b="wc-block-components-sort-select__select-".concat(r);return Object(n.createElement)("div",{className:c()("wc-block-sort-select","wc-block-components-sort-select",t)},Object(n.createElement)(a.a,{label:o,screenReaderLabel:l,wrapperElement:"label",wrapperProps:{className:"wc-block-sort-select__label wc-block-components-sort-select__label",htmlFor:b}}),Object(n.createElement)("select",{id:b,className:"wc-block-sort-select__select wc-block-components-sort-select__select",onChange:i,readOnly:u,value:d},s.map((function(e){return Object(n.createElement)("option",{key:e.key,value:e.key},e.label)}))))}))},161:function(e,t,r){"use strict";r.d(t,"a",(function(){return c}));var n=r(1),o=r(37),c={attributes:{editMode:!1,imageType:"reviewer",orderby:"most-recent",reviewsOnLoadMore:10,reviewsOnPageLoad:10,showLoadMore:!0,showOrderby:!0,showReviewDate:!0,showReviewerName:!0,showReviewImage:!0,showReviewRating:!0,showReviewContent:!0,previewReviews:[{id:1,date_created:"2019-07-15T17:05:04",formatted_date_created:Object(n.__)("July 15, 2019",'woocommerce'),date_created_gmt:"2019-07-15T15:05:04",product_id:0,product_name:Object(n.__)("WordPress Pennant",'woocommerce'),product_permalink:"#",
/* translators: An example person name used for the block previews. */
reviewer:Object(n.__)("Alice",'woocommerce'),review:"<p>".concat(Object(n.__)("I bought this product last week and I'm very happy with it.",'woocommerce'),"</p>\n"),reviewer_avatar_urls:{48:o.o.defaultAvatar,96:o.o.defaultAvatar},rating:5,verified:!0},{id:2,date_created:"2019-07-12T12:39:39",formatted_date_created:Object(n.__)("July 12, 2019",'woocommerce'),date_created_gmt:"2019-07-12T10:39:39",product_id:0,product_name:Object(n.__)("WordPress Pennant",'woocommerce'),product_permalink:"#",
/* translators: An example person name used for the block previews. */
reviewer:Object(n.__)("Bob",'woocommerce'),review:"<p>".concat(Object(n.__)("This product is awesome, I love it!",'woocommerce'),"</p>\n"),reviewer_avatar_urls:{48:o.o.defaultAvatar,96:o.o.defaultAvatar},rating:null,verified:!1}]}}},192:function(e,t,r){"use strict";t.a={editMode:{type:"boolean",default:!0},imageType:{type:"string",default:"reviewer"},orderby:{type:"string",default:"most-recent"},reviewsOnLoadMore:{type:"number",default:10},reviewsOnPageLoad:{type:"number",default:10},showLoadMore:{type:"boolean",default:!0},showOrderby:{type:"boolean",default:!0},showReviewDate:{type:"boolean",default:!0},showReviewerName:{type:"boolean",default:!0},showReviewImage:{type:"boolean",default:!0},showReviewRating:{type:"boolean",default:!0},showReviewContent:{type:"boolean",default:!0},previewReviews:{type:"array",default:null}}},193:function(e,t,r){"use strict";var n=r(9),o=r.n(n),c=r(0),a=r(12),i=(r(215),r(85));t.a=function(e){var t=e.attributes;return Object(c.createElement)("div",o()({},a.useBlockProps.save({className:Object(i.a)(t)}),Object(i.b)(t)))}},199:function(e,t,r){"use strict";var n=r(0),o=r(1),c=(r(2),r(7)),a=r(4),i=r(12),s=r(17),l=r.n(s),u=r(18),d=r.n(u),b=r(19),p=r.n(b),w=r(20),g=r.n(w),f=r(10),m=r.n(f),v=r(11),h=r(3),O=r(106),y=r(41),j=(r(256),function(e){var t=e.onClick,r=e.label,o=e.screenReaderLabel;return Object(n.createElement)("div",{className:"wp-block-button wc-block-load-more wc-block-components-load-more"},Object(n.createElement)("button",{className:"wp-block-button__link",onClick:t},Object(n.createElement)(y.a,{label:r,screenReaderLabel:o})))});j.defaultProps={label:Object(o.__)("Load more",'woocommerce')};var _=j,k=r(156),E=(r(253),function(e){var t=e.onChange,r=e.readOnly,c=e.value;return Object(n.createElement)(k.a,{className:"wc-block-review-sort-select wc-block-components-review-sort-select",label:Object(o.__)("Order by",'woocommerce'),onChange:t,options:[{key:"most-recent",label:Object(o.__)("Most recent",'woocommerce')},{key:"highest-rating",label:Object(o.__)("Highest rating",'woocommerce')},{key:"lowest-rating",label:Object(o.__)("Lowest rating",'woocommerce')}],readOnly:r,screenReaderLabel:Object(o.__)("Order reviews by",'woocommerce'),value:c})}),R=r(5),P=r.n(R),C=r(6),S=r.n(C),x=r(13),N=r.n(x),T=r(236),L=r.n(T),A=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"...",n=L()(e,{suffix:r,limit:t});return n.html},I=function(e,t,r,n){var o=D(e,t,r);return A(e,o-n.length,n)},D=function(e,t,r){for(var n={start:0,middle:0,end:e.length};n.start<=n.end;)n.middle=Math.floor((n.start+n.end)/2),t.innerHTML=A(e,n.middle),n=M(n,t.clientHeight,r);return n.middle},M=function(e,t,r){return t<=r?e.start=e.middle+1:e.end=e.middle-1,e};var B=function(e){p()(c,e);var t,r,o=(t=c,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,n=m()(t);if(r){var o=m()(this).constructor;e=Reflect.construct(n,arguments,o)}else e=n.apply(this,arguments);return g()(this,e)});function c(e){var t;return l()(this,c),(t=o.apply(this,arguments)).state={isExpanded:!1,clampEnabled:null,content:e.children,summary:"."},t.reviewSummary=Object(v.createRef)(),t.reviewContent=Object(v.createRef)(),t.getButton=t.getButton.bind(N()(t)),t.onClick=t.onClick.bind(N()(t)),t}return d()(c,[{key:"componentDidMount",value:function(){if(this.props.children){var e=this.props,t=e.maxLines,r=e.ellipsis,n=(this.reviewSummary.current.clientHeight+1)*t+1,o=this.reviewContent.current.clientHeight+1>n;this.setState({clampEnabled:o}),o&&this.setState({summary:I(this.reviewContent.current.innerHTML,this.reviewSummary.current,n,r)})}}},{key:"getButton",value:function(){var e=this.state.isExpanded,t=this.props,r=t.className,o=t.lessText,c=t.moreText,a=e?o:c;if(a)return Object(n.createElement)("a",{href:"#more",className:r+"__read_more",onClick:this.onClick,"aria-expanded":!e,role:"button"},a)}},{key:"onClick",value:function(e){e.preventDefault();var t=this.state.isExpanded;this.setState({isExpanded:!t})}},{key:"render",value:function(){var e=this.props.className,t=this.state,r=t.content,o=t.summary,c=t.clampEnabled,a=t.isExpanded;return r?!1===c?Object(n.createElement)("div",{className:e},Object(n.createElement)("div",{ref:this.reviewContent},r)):Object(n.createElement)("div",{className:e},(!a||null===c)&&Object(n.createElement)("div",{ref:this.reviewSummary,"aria-hidden":a,dangerouslySetInnerHTML:{__html:o}}),(a||null===c)&&Object(n.createElement)("div",{ref:this.reviewContent,"aria-hidden":!a},r),this.getButton()):null}}]),c}(v.Component);B.defaultProps={maxLines:3,ellipsis:"&hellip;",moreText:Object(o.__)("Read more",'woocommerce'),lessText:Object(o.__)("Read less",'woocommerce'),className:"read-more-content"};var H=B;r(255);var G=function(e){var t=e.attributes,r=e.review,c=void 0===r?{}:r,a=t.imageType,i=t.showReviewDate,s=t.showReviewerName,l=t.showReviewImage,u=t.showReviewRating,d=t.showReviewContent,b=t.showProductName,p=c.rating,w=!Object.keys(c).length>0,g=Number.isFinite(p)&&u;return Object(n.createElement)("li",{className:S()("wc-block-review-list-item__item","wc-block-components-review-list-item__item",{"is-loading":w,"wc-block-components-review-list-item__item--has-image":l}),"aria-hidden":w},(b||i||s||l||g)&&Object(n.createElement)("div",{className:"wc-block-review-list-item__info wc-block-components-review-list-item__info"},l&&function(e,t,r){var c,a;return r||!e?Object(n.createElement)("div",{className:"wc-block-review-list-item__image wc-block-components-review-list-item__image"}):Object(n.createElement)("div",{className:"wc-block-review-list-item__image wc-block-components-review-list-item__image"},"product"===t?Object(n.createElement)("img",{"aria-hidden":"true",alt:(null===(c=e.product_image)||void 0===c?void 0:c.alt)||"",src:(null===(a=e.product_image)||void 0===a?void 0:a.thumbnail)||""}):Object(n.createElement)("img",{"aria-hidden":"true",alt:"",src:e.reviewer_avatar_urls[96]||""}),e.verified&&Object(n.createElement)("div",{className:"wc-block-review-list-item__verified wc-block-components-review-list-item__verified",title:Object(o.__)("Verified buyer",'woocommerce')},Object(o.__)("Verified buyer",'woocommerce')))}(c,a,w),(b||s||g||i)&&Object(n.createElement)("div",{className:"wc-block-review-list-item__meta wc-block-components-review-list-item__meta"},g&&function(e){var t=e.rating,r={width:t/5*100+"%"},c=Object(o.sprintf)(
/* translators: %f is referring to the average rating value */
Object(o.__)("Rated %f out of 5",'woocommerce'),t);return Object(n.createElement)("div",{className:"wc-block-review-list-item__rating wc-block-components-review-list-item__rating"},Object(n.createElement)("div",{className:"wc-block-review-list-item__rating__stars wc-block-components-review-list-item__rating__stars",role:"img","aria-label":c},Object(n.createElement)("span",{style:r},c)))}(c),b&&function(e){return Object(n.createElement)("div",{className:"wc-block-review-list-item__product wc-block-components-review-list-item__product"},Object(n.createElement)("a",{href:e.product_permalink,dangerouslySetInnerHTML:{__html:e.product_name}}))}(c),s&&function(e){var t=e.reviewer,r=void 0===t?"":t;return Object(n.createElement)("div",{className:"wc-block-review-list-item__author wc-block-components-review-list-item__author"},r)}(c),i&&function(e){var t=e.date_created,r=e.formatted_date_created;return Object(n.createElement)("time",{className:"wc-block-review-list-item__published-date wc-block-components-review-list-item__published-date",dateTime:t},r)}(c))),d&&function(e){return Object(n.createElement)(H,{maxLines:10,moreText:Object(o.__)("Read full review",'woocommerce'),lessText:Object(o.__)("Hide full review",'woocommerce'),className:"wc-block-review-list-item__text wc-block-components-review-list-item__text"},Object(n.createElement)("div",{dangerouslySetInnerHTML:{__html:e.review||""}}))}(c))};function F(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function V(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?F(Object(r),!0).forEach((function(t){P()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):F(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}r(254);var z=function(e){var t=e.attributes,r=e.reviews,o=Object(h.getSetting)("showAvatars",!0),c=Object(h.getSetting)("reviewRatingsEnabled",!0),a=(o||"product"===t.imageType)&&t.showReviewImage,i=c&&t.showReviewRating,s=V(V({},t),{},{showReviewImage:a,showReviewRating:i});return Object(n.createElement)("ul",{className:"wc-block-review-list wc-block-components-review-list"},0===r.length?Object(n.createElement)(G,{attributes:s}):r.map((function(e,t){return Object(n.createElement)(G,{key:e.id||t,attributes:s,review:e})})))},$=r(9),W=r.n($),q=r(29),Q=r.n(q),U=r(22),J=r.n(U),Y=r(34),K=r.n(Y),X=r(85),Z=r(42);var ee=function(e){var t=function(t){p()(a,t);var r,o,c=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=m()(r);if(o){var n=m()(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return g()(this,e)});function a(){var e;l()(this,a);for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return e=c.call.apply(c,[this].concat(r)),P()(N()(e),"isPreview",!!e.props.attributes.previewReviews),P()(N()(e),"delayedAppendReviews",e.props.delayFunction(e.appendReviews)),P()(N()(e),"isMounted",!1),P()(N()(e),"state",{error:null,loading:!0,reviews:e.isPreview?e.props.attributes.previewReviews:[],totalReviews:e.isPreview?e.props.attributes.previewReviews.length:0}),P()(N()(e),"setError",function(){var t=Q()(J.a.mark((function t(r){var n,o;return J.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e.isMounted){t.next=2;break}return t.abrupt("return");case 2:return n=e.props.onReviewsLoadError,t.next=5,Object(Z.a)(r);case 5:o=t.sent,e.setState({reviews:[],loading:!1,error:o}),n(o);case 8:case"end":return t.stop()}}),t)})));return function(_x){return t.apply(this,arguments)}}()),e}return d()(a,[{key:"componentDidMount",value:function(){this.isMounted=!0,this.replaceReviews()}},{key:"componentDidUpdate",value:function(e){e.reviewsToDisplay<this.props.reviewsToDisplay?this.delayedAppendReviews():this.shouldReplaceReviews(e,this.props)&&this.replaceReviews()}},{key:"shouldReplaceReviews",value:function(e,t){return e.orderby!==t.orderby||e.order!==t.order||e.productId!==t.productId||!K()(e.categoryIds,t.categoryIds)}},{key:"componentWillUnmount",value:function(){this.isMounted=!1,this.delayedAppendReviews.cancel&&this.delayedAppendReviews.cancel()}},{key:"getArgs",value:function(e){var t=this.props,r=t.categoryIds,n=t.order,o=t.orderby,c=t.productId,a={order:n,orderby:o,per_page:t.reviewsToDisplay-e,offset:e};return r&&r.length&&(a.category_id=Array.isArray(r)?r.join(","):r),c&&(a.product_id=c),a}},{key:"replaceReviews",value:function(){if(!this.isPreview){var e=this.props.onReviewsReplaced;this.updateListOfReviews().then(e)}}},{key:"appendReviews",value:function(){if(!this.isPreview){var e=this.props,t=e.onReviewsAppended,r=e.reviewsToDisplay,n=this.state.reviews;r<=n.length||this.updateListOfReviews(n).then(t)}}},{key:"updateListOfReviews",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],r=this.props.reviewsToDisplay,n=this.state.totalReviews,o=Math.min(n,r)-t.length;return this.setState({loading:!0,reviews:t.concat(Array(o).fill({}))}),Object(X.c)(this.getArgs(t.length)).then((function(r){var n=r.reviews,o=r.totalReviews;return e.isMounted&&e.setState({reviews:t.filter((function(e){return Object.keys(e).length})).concat(n),totalReviews:o,loading:!1,error:null}),{newReviews:n}})).catch(this.setError)}},{key:"render",value:function(){var t=this.props.reviewsToDisplay,r=this.state,o=r.error,c=r.loading,a=r.reviews,i=r.totalReviews;return Object(n.createElement)(e,W()({},this.props,{error:o,isLoading:c,reviews:a.slice(0,t),totalReviews:i}))}}]),a}(v.Component);P()(t,"defaultProps",{delayFunction:function(e){return e},onReviewsAppended:function(){},onReviewsLoadError:function(){},onReviewsReplaced:function(){}});var r=e.displayName,o=void 0===r?e.name||"Component":r;return t.displayName="WithReviews( ".concat(o," )"),t}(function(e){p()(i,e);var t,r,c=(t=i,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,n=m()(t);if(r){var o=m()(this).constructor;e=Reflect.construct(n,arguments,o)}else e=n.apply(this,arguments);return g()(this,e)});function i(){return l()(this,i),c.apply(this,arguments)}return d()(i,[{key:"render",value:function(){var e=this.props,t=e.attributes,r=e.error,c=e.isLoading,i=e.noReviewsPlaceholder,s=e.reviews,l=e.totalReviews;if(r)return Object(n.createElement)(O.a,{className:"wc-block-featured-product-error",error:r,isLoading:c});if(0===s.length&&!c)return Object(n.createElement)(i,{attributes:t});var u=Object(h.getSetting)("reviewRatingsEnabled",!0);return Object(n.createElement)(a.Disabled,null,t.showOrderby&&u&&Object(n.createElement)(E,{readOnly:!0,value:t.orderby}),Object(n.createElement)(z,{attributes:t,reviews:s}),t.showLoadMore&&l>s.length&&Object(n.createElement)(_,{screenReaderLabel:Object(o.__)("Load more reviews",'woocommerce')}))}}]),i}(v.Component));t.a=function(e){var t=e.attributes,r=e.icon,s=e.name,l=e.noReviewsPlaceholder,u=t.categoryIds,d=t.productId,b=t.reviewsOnPageLoad,p=t.showProductName,w=t.showReviewDate,g=t.showReviewerName,f=t.showReviewContent,m=t.showReviewImage,v=t.showReviewRating,h=Object(X.d)(t.orderby),O=h.order,y=h.orderby,j=!(f||v||w||g||m||p),_=Object(i.useBlockProps)({className:Object(X.a)(t)});return j?Object(n.createElement)(a.Placeholder,{icon:r,label:s},Object(o.__)("The content for this block is hidden due to block settings.",'woocommerce')):Object(n.createElement)("div",_,Object(n.createElement)(ee,{attributes:t,categoryIds:u,delayFunction:function(e){return Object(c.debounce)(e,400)},noReviewsPlaceholder:l,orderby:y,order:O,productId:d,reviewsToDisplay:b}))}},21:function(e,t){e.exports=window.wp.compose},215:function(e,t){},216:function(e,t){},22:function(e,t){e.exports=window.regeneratorRuntime},23:function(e,t){e.exports=window.wp.url},25:function(e,t){e.exports=window.wp.htmlEntities},253:function(e,t){},254:function(e,t){},255:function(e,t){},256:function(e,t){},26:function(e,t){e.exports=window.wp.blocks},28:function(e,t){e.exports=window.wp.primitives},3:function(e,t){e.exports=window.wc.wcSettings},31:function(e,t){e.exports=window.moment},34:function(e,t){e.exports=window.wp.isShallowEqual},36:function(e,t){e.exports=window.wp.dataControls},37:function(e,t,r){"use strict";r.d(t,"o",(function(){return c})),r.d(t,"m",(function(){return a})),r.d(t,"l",(function(){return i})),r.d(t,"n",(function(){return s})),r.d(t,"j",(function(){return l})),r.d(t,"e",(function(){return u})),r.d(t,"f",(function(){return d})),r.d(t,"g",(function(){return b})),r.d(t,"k",(function(){return p})),r.d(t,"c",(function(){return w})),r.d(t,"d",(function(){return g})),r.d(t,"h",(function(){return f})),r.d(t,"a",(function(){return m})),r.d(t,"i",(function(){return v})),r.d(t,"b",(function(){return h}));var n,o=r(3),c=Object(o.getSetting)("wcBlocksConfig",{buildPhase:1,pluginUrl:"",productCount:0,defaultAvatar:"",restApiRoutes:{},wordCountType:"words"}),a=c.pluginUrl+"images/",i=c.pluginUrl+"build/",s=c.buildPhase,l=null===(n=o.STORE_PAGES.shop)||void 0===n?void 0:n.permalink,u=o.STORE_PAGES.checkout.id,d=o.STORE_PAGES.checkout.permalink,b=o.STORE_PAGES.privacy.permalink,p=(o.STORE_PAGES.privacy.title,o.STORE_PAGES.terms.permalink),w=(o.STORE_PAGES.terms.title,o.STORE_PAGES.cart.id),g=o.STORE_PAGES.cart.permalink,f=(o.STORE_PAGES.myaccount.permalink?o.STORE_PAGES.myaccount.permalink:Object(o.getSetting)("wpLoginUrl","/wp-login.php"),Object(o.getSetting)("shippingCountries",{})),m=Object(o.getSetting)("allowedCountries",{}),v=Object(o.getSetting)("shippingStates",{}),h=Object(o.getSetting)("allowedStates",{})},39:function(e,t,r){"use strict";r.d(t,"h",(function(){return p})),r.d(t,"e",(function(){return w})),r.d(t,"b",(function(){return g})),r.d(t,"i",(function(){return f})),r.d(t,"f",(function(){return m})),r.d(t,"c",(function(){return v})),r.d(t,"d",(function(){return h})),r.d(t,"g",(function(){return O})),r.d(t,"a",(function(){return y}));var n=r(5),o=r.n(n),c=r(23),a=r(15),i=r.n(a),s=r(7),l=r(3),u=r(37);function d(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function b(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?d(Object(r),!0).forEach((function(t){o()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):d(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var p=function(e){var t=e.selected,r=void 0===t?[]:t,n=e.search,o=void 0===n?"":n,a=e.queryArgs,l=function(e){var t=e.selected,r=void 0===t?[]:t,n=e.search,o=void 0===n?"":n,a=e.queryArgs,i=void 0===a?{}:a,s=u.o.productCount>100,l={per_page:s?100:0,catalog_visibility:"any",search:o,orderby:"title",order:"asc"},d=[Object(c.addQueryArgs)("/wc/store/products",b(b({},l),i))];return s&&r.length&&d.push(Object(c.addQueryArgs)("/wc/store/products",{catalog_visibility:"any",include:r,per_page:0})),d}({selected:r,search:o,queryArgs:void 0===a?{}:a});return Promise.all(l.map((function(e){return i()({path:e})}))).then((function(e){return Object(s.uniqBy)(Object(s.flatten)(e),"id").map((function(e){return b(b({},e),{},{parent:0})}))})).catch((function(e){throw e}))},w=function(e){return i()({path:"/wc/store/products/".concat(e)})},g=function(){return i()({path:"wc/store/products/attributes"})},f=function(e){return i()({path:"wc/store/products/attributes/".concat(e,"/terms")})},m=function(e){var t=e.selected,r=function(e){var t=e.selected,r=void 0===t?[]:t,n=e.search,o=Object(l.getSetting)("limitTags",!1),a=[Object(c.addQueryArgs)("wc/store/products/tags",{per_page:o?100:0,orderby:o?"count":"name",order:o?"desc":"asc",search:n})];return o&&r.length&&a.push(Object(c.addQueryArgs)("wc/store/products/tags",{include:r})),a}({selected:void 0===t?[]:t,search:e.search});return Promise.all(r.map((function(e){return i()({path:e})}))).then((function(e){return Object(s.uniqBy)(Object(s.flatten)(e),"id")}))},v=function(e){return i()({path:Object(c.addQueryArgs)("wc/store/products/categories",b({per_page:0},e))})},h=function(e){return i()({path:"wc/store/products/categories/".concat(e)})},O=function(e){return i()({path:Object(c.addQueryArgs)("wc/store/products",{per_page:0,type:"variation",parent:e})})},y=function(e,t){if(!e.title.raw)return e.slug;var r=1===t.filter((function(t){return t.title.raw===e.title.raw})).length;return e.title.raw+(r?"":" - ".concat(e.slug))}},4:function(e,t){e.exports=window.wp.components},41:function(e,t,r){"use strict";var n=r(5),o=r.n(n),c=r(0),a=r(6),i=r.n(a);function s(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function l(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?s(Object(r),!0).forEach((function(t){o()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):s(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}t.a=function(e){var t,r=e.label,n=e.screenReaderLabel,o=e.wrapperElement,a=e.wrapperProps,s=void 0===a?{}:a,u=null!=r,d=null!=n;return!u&&d?(t=o||"span",s=l(l({},s),{},{className:i()(s.className,"screen-reader-text")}),Object(c.createElement)(t,s,n)):(t=o||c.Fragment,u&&d&&r!==n?Object(c.createElement)(t,s,Object(c.createElement)("span",{"aria-hidden":"true"},r),Object(c.createElement)("span",{className:"screen-reader-text"},n)):Object(c.createElement)(t,s,r))}},42:function(e,t,r){"use strict";r.d(t,"a",(function(){return s})),r.d(t,"b",(function(){return l}));var n=r(29),o=r.n(n),c=r(22),a=r.n(c),i=r(1),s=function(){var e=o()(a.a.mark((function e(t){var r;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("function"!=typeof t.json){e.next=11;break}return e.prev=1,e.next=4,t.json();case 4:return r=e.sent,e.abrupt("return",{message:r.message,type:r.type||"api"});case 8:return e.prev=8,e.t0=e.catch(1),e.abrupt("return",{message:e.t0.message,type:"general"});case 11:return e.abrupt("return",{message:t.message,type:t.type||"general"});case 12:case"end":return e.stop()}}),e,null,[[1,8]])})));return function(_x){return e.apply(this,arguments)}}(),l=function(e){if(e.data&&"rest_invalid_param"===e.code){var t=Object.values(e.data.params);if(t[0])return t[0]}return(null==e?void 0:e.message)||Object(i.__)("Something went wrong. Please contact us to get assistance.",'woocommerce')}},46:function(e,t){e.exports=window.wp.keycodes},48:function(e,t){e.exports=window.wp.escapeHtml},52:function(e,t,r){"use strict";var n=r(0),o=r(1),c=(r(2),r(48));t.a=function(e){var t,r,a,i=e.error;return Object(n.createElement)("div",{className:"wc-block-error-message"},(r=(t=i).message,a=t.type,r?"general"===a?Object(n.createElement)("span",null,Object(o.__)("The following error was returned",'woocommerce'),Object(n.createElement)("br",null),Object(n.createElement)("code",null,Object(c.escapeHTML)(r))):"api"===a?Object(n.createElement)("span",null,Object(o.__)("The following error was returned from the API",'woocommerce'),Object(n.createElement)("br",null),Object(n.createElement)("code",null,Object(c.escapeHTML)(r))):r:Object(o.__)("An unknown error occurred which prevented the block from being updated.",'woocommerce')))}},55:function(e,t){e.exports=window.wp.hooks},56:function(e,t){e.exports=window.wp.deprecated},66:function(e,t,r){"use strict";var n=r(5),o=r.n(n),c=r(16),a=r.n(c),i=r(0),s=["srcElement","size"];function l(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}t.a=function(e){var t=e.srcElement,r=e.size,n=void 0===r?24:r,c=a()(e,s);return Object(i.isValidElement)(t)?Object(i.cloneElement)(t,function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?l(Object(r),!0).forEach((function(t){o()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):l(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({width:n,height:n},c)):null}},7:function(e,t){e.exports=window.lodash},74:function(e,t){e.exports=window.wp.dom},776:function(e,t,r){e.exports=r(865)},85:function(e,t,r){"use strict";r.d(t,"d",(function(){return s})),r.d(t,"c",(function(){return l})),r.d(t,"a",(function(){return u})),r.d(t,"b",(function(){return d}));var n=r(15),o=r.n(n),c=r(6),a=r.n(c),i=r(3),s=function(e){if(Object(i.getSetting)("reviewRatingsEnabled",!0)){if("lowest-rating"===e)return{order:"asc",orderby:"rating"};if("highest-rating"===e)return{order:"desc",orderby:"rating"}}return{order:"desc",orderby:"date_gmt"}},l=function(e){return o()({path:"/wc/store/products/reviews?"+Object.entries(e).map((function(e){return e.join("=")})).join("&"),parse:!1}).then((function(e){return e.json().then((function(t){return{reviews:t,totalReviews:parseInt(e.headers.get("x-wp-total"),10)}}))}))},u=function(e){var t=e.className,r=e.categoryIds,n=e.productId,o=e.showReviewDate,c=e.showReviewerName,i=e.showReviewContent,s=e.showProductName,l=e.showReviewImage,u=e.showReviewRating,d="wc-block-all-reviews";return n&&(d="wc-block-reviews-by-product"),Array.isArray(r)&&(d="wc-block-reviews-by-category"),a()(d,t,{"has-image":l,"has-name":c,"has-date":o,"has-rating":u,"has-content":i,"has-product-name":s})},d=function(e){var t=e.categoryIds,r=e.imageType,n=e.orderby,o=e.productId,c={"data-image-type":r,"data-orderby":n,"data-reviews-on-page-load":e.reviewsOnPageLoad,"data-reviews-on-load-more":e.reviewsOnLoadMore,"data-show-load-more":e.showLoadMore,"data-show-orderby":e.showOrderby};return o&&(c["data-product-id"]=o),Array.isArray(t)&&(c["data-category-ids"]=t.join(",")),c}},865:function(e,t,r){"use strict";r.r(t);var n=r(5),o=r.n(n),c=r(0),a=r(1),i=r(26),s=r(66),l=r(28),u=Object(c.createElement)(l.SVG,{xmlns:"http://www.w3.org/2000/SVG",viewBox:"0 0 24 24"},Object(c.createElement)("path",{fill:"none",d:"M0 0h24v24H0V0z"}),Object(c.createElement)("path",{d:"M20 2H4c-1.1 0-1.99.9-1.99 2L2 22l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm0 14H5.17l-.59.59-.58.58V4h16v12zm-9.5-2H18v-2h-5.5zm3.86-5.87c.2-.2.2-.51 0-.71l-1.77-1.77c-.2-.2-.51-.2-.71 0L6 11.53V14h2.47l5.89-5.87z"})),d=r(12),b=r(4),p=(r(2),r(97)),w=r(199),g=function(){return Object(c.createElement)(b.Placeholder,{className:"wc-block-reviews-by-category",icon:Object(c.createElement)(s.a,{srcElement:u,className:"block-editor-block-icon"}),label:Object(a.__)("Reviews by Category",'woocommerce')},Object(a.__)("This block lists reviews for products from selected categories. The selected categories do not have any reviews yet, but they will show up here when they do.",'woocommerce'))},f=r(144),m=Object(b.withSpokenMessages)((function(e){var t=e.attributes,r=e.debouncedSpeak,n=e.setAttributes,o=t.editMode;return!t.categoryIds||o?Object(c.createElement)(b.Placeholder,{icon:Object(c.createElement)(s.a,{srcElement:u,className:"block-editor-block-icon"}),label:Object(a.__)("Reviews by Category",'woocommerce'),className:"wc-block-reviews-by-category"},Object(a.__)("Show product reviews from specific categories.",'woocommerce'),Object(c.createElement)("div",{className:"wc-block-reviews__selection"},Object(c.createElement)(p.a,{selected:t.categoryIds,onChange:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=e.map((function(e){return e.id}));n({categoryIds:t})},showReviewCount:!0}),Object(c.createElement)(b.Button,{isPrimary:!0,onClick:function(){n({editMode:!1}),r(Object(a.__)("Showing Reviews by Category block preview.",'woocommerce'))}},Object(a.__)("Done",'woocommerce')))):Object(c.createElement)(c.Fragment,null,Object(f.a)(o,n),Object(c.createElement)(d.InspectorControls,{key:"inspector"},Object(c.createElement)(b.PanelBody,{title:Object(a.__)("Category",'woocommerce'),initialOpen:!1},Object(c.createElement)(p.a,{selected:t.categoryIds,onChange:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=e.map((function(e){return e.id}));n({categoryIds:t})},isCompact:!0,showReviewCount:!0})),Object(c.createElement)(b.PanelBody,{title:Object(a.__)("Content",'woocommerce')},Object(c.createElement)(b.ToggleControl,{label:Object(a.__)("Product name",'woocommerce'),checked:t.showProductName,onChange:function(){return n({showProductName:!t.showProductName})}}),Object(f.b)(t,n)),Object(c.createElement)(b.PanelBody,{title:Object(a.__)("List Settings",'woocommerce')},Object(f.c)(t,n))),Object(c.createElement)(w.a,{attributes:t,icon:Object(c.createElement)(s.a,{srcElement:u,className:"block-editor-block-icon"}),name:Object(a.__)("Reviews by Category",'woocommerce'),noReviewsPlaceholder:g}))})),v=r(192),h=r(193),O=r(161);function y(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function j(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?y(Object(r),!0).forEach((function(t){o()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):y(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}Object(i.registerBlockType)("woocommerce/reviews-by-category",{apiVersion:2,title:Object(a.__)("Reviews by Category",'woocommerce'),icon:{src:Object(c.createElement)(s.a,{srcElement:u}),foreground:"#96588a"},category:"woocommerce",keywords:[Object(a.__)("WooCommerce",'woocommerce')],description:Object(a.__)("Show product reviews from specific categories.",'woocommerce'),supports:{html:!1,color:{background:!1},typography:{fontSize:!0}},example:j(j({},O.a),{},{attributes:j(j({},O.a.attributes),{},{categoryIds:[1],showProductName:!0})}),attributes:j(j({},v.a),{},{categoryIds:{type:"array",default:[]},showProductName:{type:"boolean",default:!0}}),edit:function(e){return Object(c.createElement)(m,e)},save:h.a})},87:function(e,t){e.exports=window.ReactDOM},88:function(e,t,r){"use strict";var n=r(9),o=r.n(n),c=r(17),a=r.n(c),i=r(18),s=r.n(i),l=r(13),u=r.n(l),d=r(19),b=r.n(d),p=r(20),w=r.n(p),g=r(10),f=r.n(g),m=r(0),v=r(7),h=r(6),O=r.n(h),y=r(4),j=r(21);r(123);var _=function(e){b()(c,e);var t,r,n=(t=c,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,n=f()(t);if(r){var o=f()(this).constructor;e=Reflect.construct(n,arguments,o)}else e=n.apply(this,arguments);return w()(this,e)});function c(){var e;return a()(this,c),(e=n.apply(this,arguments)).onClick=e.onClick.bind(u()(e)),e}return s()(c,[{key:"onClick",value:function(e){this.props.onChange&&this.props.onChange(e.target.value)}},{key:"render",value:function(){var e,t=this,r=this.props,n=r.label,c=r.checked,a=r.instanceId,i=r.className,s=r.help,l=r.options,u=r.value,d="inspector-toggle-button-control-".concat(a);return s&&(e=Object(v.isFunction)(s)?s(c):s),Object(m.createElement)(y.BaseControl,{id:d,help:e,className:O()("components-toggle-button-control",i)},Object(m.createElement)("label",{id:d+"__label",htmlFor:d,className:"components-toggle-button-control__label"},n),Object(m.createElement)(y.ButtonGroup,{"aria-labelledby":d+"__label"},l.map((function(e,r){var c={};return u===e.value?(c.isPrimary=!0,c["aria-pressed"]=!0):(c.isSecondary=!0,c["aria-pressed"]=!1),Object(m.createElement)(y.Button,o()({key:"".concat(e.label,"-").concat(e.value,"-").concat(r),value:e.value,onClick:t.onClick,"aria-label":n+": "+e.label},c),e.label)}))))}}]),c}(m.Component);t.a=Object(j.withInstanceId)(_)},89:function(e,t){e.exports=window.wp.viewport},96:function(e,t){e.exports=window.wp.date},97:function(e,t,r){"use strict";var n=r(9),o=r.n(n),c=r(0),a=r(1),i=(r(2),r(49)),s=r(4),l=r(29),u=r.n(l),d=r(17),b=r.n(d),p=r(18),w=r.n(p),g=r(13),f=r.n(g),m=r(19),v=r.n(m),h=r(20),O=r.n(h),y=r(10),j=r.n(y),_=r(22),k=r.n(_),E=r(21),R=r(39),P=r(42);var C=Object(E.createHigherOrderComponent)((function(e){return function(t){v()(i,t);var r,n,a=(r=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=j()(r);if(n){var o=j()(this).constructor;e=Reflect.construct(t,arguments,o)}else e=t.apply(this,arguments);return O()(this,e)});function i(){var e;return b()(this,i),(e=a.apply(this,arguments)).state={error:null,loading:!1,categories:[]},e.loadCategories=e.loadCategories.bind(f()(e)),e}return w()(i,[{key:"componentDidMount",value:function(){this.loadCategories()}},{key:"loadCategories",value:function(){var e=this;this.setState({loading:!0}),Object(R.c)().then((function(t){e.setState({categories:t,loading:!1,error:null})})).catch(function(){var t=u()(k.a.mark((function t(r){var n;return k.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,Object(P.a)(r);case 2:n=t.sent,e.setState({categories:[],loading:!1,error:n});case 4:case"end":return t.stop()}}),t)})));return function(_x){return t.apply(this,arguments)}}())}},{key:"render",value:function(){var t=this.state,r=t.error,n=t.loading,a=t.categories;return Object(c.createElement)(e,o()({},this.props,{error:r,isLoading:n,categories:a}))}}]),i}(c.Component)}),"withCategories"),S=r(52),x=r(6),N=r.n(x),T=(r(139),function(e){var t=e.categories,r=e.error,n=e.isLoading,l=e.onChange,u=e.onOperatorChange,d=e.operator,b=e.selected,p=e.isCompact,w=e.isSingle,g=e.showReviewCount,f={clear:Object(a.__)("Clear all product categories",'woocommerce'),list:Object(a.__)("Product Categories",'woocommerce'),noItems:Object(a.__)("Your store doesn't have any product categories.",'woocommerce'),search:Object(a.__)("Search for product categories",'woocommerce'),selected:function(e){return Object(a.sprintf)(
/* translators: %d is the count of selected categories. */
Object(a._n)("%d category selected","%d categories selected",e,'woocommerce'),e)},updated:Object(a.__)("Category search results updated.",'woocommerce')};return r?Object(c.createElement)(S.a,{error:r}):Object(c.createElement)(c.Fragment,null,Object(c.createElement)(i.b,{className:"woocommerce-product-categories",list:t,isLoading:n,selected:b.map((function(e){return t.find((function(t){return t.id===e}))})).filter(Boolean),onChange:l,renderItem:function(e){var t=e.item,r=e.search,n=e.depth,s=void 0===n?0:n,l=t.breadcrumbs.length?"".concat(t.breadcrumbs.join(", "),", ").concat(t.name):t.name,u=g?Object(a.sprintf)(
/* translators: %1$s is the item name, %2$d is the count of reviews for the item. */
Object(a._n)("%1$s, has %2$d review","%1$s, has %2$d reviews",t.review_count,'woocommerce'),l,t.review_count):Object(a.sprintf)(
/* translators: %1$s is the item name, %2$d is the count of products for the item. */
Object(a._n)("%1$s, has %2$d product","%1$s, has %2$d products",t.count,'woocommerce'),l,t.count),d=g?Object(a.sprintf)(
/* translators: %d is the count of reviews. */
Object(a._n)("%d review","%d reviews",t.review_count,'woocommerce'),t.review_count):Object(a.sprintf)(
/* translators: %d is the count of products. */
Object(a._n)("%d product","%d products",t.count,'woocommerce'),t.count);return Object(c.createElement)(i.c,o()({className:N()("woocommerce-product-categories__item","has-count",{"is-searching":r.length>0,"is-skip-level":0===s&&0!==t.parent})},e,{countLabel:d,"aria-label":u}))},messages:f,isCompact:p,isHierarchical:!0,isSingle:w}),!!u&&Object(c.createElement)("div",{hidden:b.length<2},Object(c.createElement)(s.SelectControl,{className:"woocommerce-product-categories__operator",label:Object(a.__)("Display products matching",'woocommerce'),help:Object(a.__)("Pick at least two categories to use this setting.",'woocommerce'),value:d,onChange:u,options:[{label:Object(a.__)("Any selected categories",'woocommerce'),value:"any"},{label:Object(a.__)("All selected categories",'woocommerce'),value:"all"}]})))});T.defaultProps={operator:"any",isCompact:!1,isSingle:!1},t.a=C(T)}});woocommerce-blocks/build/reviews-by-product.asset.php000064400000000744151335517640017055 0ustar00<?php return array('dependencies' => array('lodash', 'moment', 'react', 'react-dom', 'wc-settings', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-data-controls', 'wp-date', 'wp-deprecated', 'wp-dom', 'wp-element', 'wp-escape-html', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-is-shallow-equal', 'wp-keycodes', 'wp-polyfill', 'wp-primitives', 'wp-url', 'wp-viewport'), 'version' => 'b290366721ab1da1311c01481acfbff8');woocommerce-blocks/build/reviews-frontend.js000064400000074503151335517640015317 0ustar00!function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=314)}({0:function(e,t){e.exports=window.wp.element},1:function(e,t){e.exports=window.wp.i18n},10:function(e,t,r){e.exports=r(79)()},107:function(e,t,r){"use strict";r.d(t,"a",(function(){return f}));var n=r(14),o=r.n(n),a=r(4),i=r.n(a),c=r(0),s=r(44);function l(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function u(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?l(Object(r),!0).forEach((function(t){i()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):l(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var p=[".wp-block-woocommerce-cart"],d=function(e){var t=e.Block,r=e.containers,n=e.getProps,a=void 0===n?function(){return{}}:n,i=e.getErrorBoundaryProps,l=void 0===i?function(){return{}}:i;0!==r.length&&Array.prototype.forEach.call(r,(function(e,r){var n=a(e,r),i=l(e,r),p=u(u({},e.dataset),n.attributes||{});e.classList.remove("is-loading"),Object(c.render)(React.createElement(s.a,i,React.createElement(c.Suspense,{fallback:React.createElement("div",{className:"wc-block-placeholder"})},React.createElement(t,o()({},n,{attributes:p})))),e)}))},f=function(e){var t,r,n,o,a,i,c,s=document.body.querySelectorAll(p.join(","));t=u(u({},e),{},{wrappers:s}),r=t.Block,n=t.getProps,o=t.getErrorBoundaryProps,a=t.selector,i=t.wrappers,c=document.body.querySelectorAll(a),i.length>0&&Array.prototype.filter.call(c,(function(e){return!function(e,t){return Array.prototype.some.call(t,(function(t){return t.contains(e)&&!t.isSameNode(e)}))}(e,i)})),d({Block:r,containers:c,getProps:n,getErrorBoundaryProps:o}),Array.prototype.forEach.call(s,(function(t){t.addEventListener("wc-blocks_render_blocks_frontend",(function(){var r,n,o,a,i,c;n=(r=u(u({},e),{},{wrapper:t})).Block,o=r.getProps,a=r.getErrorBoundaryProps,i=r.selector,c=r.wrapper.querySelectorAll(i),d({Block:n,containers:c,getProps:o,getErrorBoundaryProps:a})}))}))}},132:function(e,t,r){"use strict";r.d(t,"a",(function(){return s})),r.d(t,"b",(function(){return l}));var n=r(39),o=r.n(n),a=r(27),i=r.n(a),c=r(1),s=function(){var e=o()(i.a.mark((function e(t){var r;return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("function"!=typeof t.json){e.next=11;break}return e.prev=1,e.next=4,t.json();case 4:return r=e.sent,e.abrupt("return",{message:r.message,type:r.type||"api"});case 8:return e.prev=8,e.t0=e.catch(1),e.abrupt("return",{message:e.t0.message,type:"general"});case 11:return e.abrupt("return",{message:t.message,type:t.type||"general"});case 12:case"end":return e.stop()}}),e,null,[[1,8]])})));return function(_x){return e.apply(this,arguments)}}(),l=function(e){if(e.data&&"rest_invalid_param"===e.code){var t=Object.values(e.data.params);if(t[0])return t[0]}return(null==e?void 0:e.message)||Object(c.__)("Something went wrong. Please contact us to get assistance.",'woocommerce')}},14:function(e,t){function r(){return e.exports=r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},e.exports.default=e.exports,e.exports.__esModule=!0,r.apply(this,arguments)}e.exports=r,e.exports.default=e.exports,e.exports.__esModule=!0},168:function(e,t,r){"use strict";r(10);var n=r(6),o=r.n(n),a=r(51),i=r(24);r(196),t.a=Object(i.withInstanceId)((function(e){var t=e.className,r=e.instanceId,n=e.label,i=e.onChange,c=e.options,s=e.screenReaderLabel,l=e.readOnly,u=e.value,p="wc-block-components-sort-select__select-".concat(r);return React.createElement("div",{className:o()("wc-block-sort-select","wc-block-components-sort-select",t)},React.createElement(a.a,{label:n,screenReaderLabel:s,wrapperElement:"label",wrapperProps:{className:"wc-block-sort-select__label wc-block-components-sort-select__label",htmlFor:p}}),React.createElement("select",{id:p,className:"wc-block-sort-select__select wc-block-components-sort-select__select",onChange:i,readOnly:l,value:u},c.map((function(e){return React.createElement("option",{key:e.key,value:e.key},e.label)}))))}))},196:function(e,t){},2:function(e,t){e.exports=window.wc.wcSettings},21:function(e,t){function r(t){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?(e.exports=r=function(e){return typeof e},e.exports.default=e.exports,e.exports.__esModule=!0):(e.exports=r=function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.default=e.exports,e.exports.__esModule=!0),r(t)}e.exports=r,e.exports.default=e.exports,e.exports.__esModule=!0},227:function(e,t,r){function n(e){for(var t,r,n=[],o=0;o<rowCut.length;o++)(t=rowCut.substring(o).match(/^&[a-z0-9#]+;/))?(r=t[0],n.push(r),o+=r.length-1):n.push(rowCut[o]);return n}e.exports&&(e.exports=function(e,t){for(var r,o,a,i,c,s=(t=t||{}).limit||100,l=void 0===t.preserveTags||t.preserveTags,u=void 0!==t.wordBreak&&t.wordBreak,p=t.suffix||"...",d=t.moreLink||"",f=t.moreText||"»",v=t.preserveWhiteSpace||!1,w=e.replace(/</g,"\n<").replace(/>/g,">\n").replace(/\n\n/g,"\n").replace(/^\n/g,"").replace(/\n$/g,"").split("\n"),b=0,m=[],g=!1,h=0;h<w.length;h++)if(r=w[h],rowCut=v?r:r.replace(/[ ]+/g," "),r.length){var y=n(rowCut);if("<"!==r[0])if(b>=s)r="";else if(b+y.length>=s){if(" "===y[(o=s-b)-1])for(;o&&" "===y[(o-=1)-1];);else a=y.slice(o).indexOf(" "),u||(-1!==a?o+=a:o=r.length);r=y.slice(0,o).join("")+p,d&&(r+='<a href="'+d+'" style="display:inline">'+f+"</a>"),b=s,g=!0}else b+=y.length;else if(l){if(b>=s)if(c=(i=r.match(/[a-zA-Z]+/))?i[0]:"")if("</"!==r.substring(0,2))m.push(c),r="";else{for(;m[m.length-1]!==c&&m.length;)m.pop();m.length&&(r=""),m.pop()}else r=""}else r="";w[h]=r}return{html:w.join("\n").replace(/\n/g,""),more:g}})},24:function(e,t){e.exports=window.wp.compose},25:function(e,t){e.exports=window.wp.isShallowEqual},27:function(e,t){e.exports=window.regeneratorRuntime},280:function(e,t){},281:function(e,t){},282:function(e,t){},283:function(e,t){},29:function(e,t){e.exports=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e},e.exports.default=e.exports,e.exports.__esModule=!0},3:function(e,t){e.exports=window.React},30:function(e,t){function r(t){return e.exports=r=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},e.exports.default=e.exports,e.exports.__esModule=!0,r(t)}e.exports=r,e.exports.default=e.exports,e.exports.__esModule=!0},314:function(e,t,r){"use strict";r.r(t);var n=r(107),o=r(40),a=r.n(o),i=r(41),c=r.n(i),s=r(29),l=r.n(s),u=r(42),p=r.n(u),d=r(43),f=r.n(d),v=r(30),w=r.n(v),b=r(1),m=r(33),g=r(3),h=r.n(g),y=(r(10),r(61)),_=r.n(y),R=r(6),O=r.n(R),k=r(2),x=function(e){return _()({path:"/wc/store/products/reviews?"+Object.entries(e).map((function(e){return e.join("=")})).join("&"),parse:!1}).then((function(e){return e.json().then((function(t){return{reviews:t,totalReviews:parseInt(e.headers.get("x-wp-total"),10)}}))}))},E=r(51),j=(r(283),function(e){var t=e.onClick,r=e.label,n=e.screenReaderLabel;return React.createElement("div",{className:"wp-block-button wc-block-load-more wc-block-components-load-more"},React.createElement("button",{className:"wp-block-button__link",onClick:t},React.createElement(E.a,{label:r,screenReaderLabel:n})))});j.defaultProps={label:Object(b.__)("Load more",'woocommerce')};var P=j,S=r(168),T=(r(280),function(e){var t=e.onChange,r=e.readOnly,n=e.value;return React.createElement(S.a,{className:"wc-block-review-sort-select wc-block-components-review-sort-select",label:Object(b.__)("Order by",'woocommerce'),onChange:t,options:[{key:"most-recent",label:Object(b.__)("Most recent",'woocommerce')},{key:"highest-rating",label:Object(b.__)("Highest rating",'woocommerce')},{key:"lowest-rating",label:Object(b.__)("Lowest rating",'woocommerce')}],readOnly:r,screenReaderLabel:Object(b.__)("Order reviews by",'woocommerce'),value:n})}),M=r(4),A=r.n(M),C=r(227),N=r.n(C),L=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"...",n=N()(e,{suffix:r,limit:t});return n.html},D=function(e,t,r,n){var o=I(e,t,r);return L(e,o-n.length,n)},I=function(e,t,r){for(var n={start:0,middle:0,end:e.length};n.start<=n.end;)n.middle=Math.floor((n.start+n.end)/2),t.innerHTML=L(e,n.middle),n=B(n,t.clientHeight,r);return n.middle},B=function(e,t,r){return t<=r?e.start=e.middle+1:e.end=e.middle-1,e};var G=function(e){p()(o,e);var t,r,n=(t=o,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,n=w()(t);if(r){var o=w()(this).constructor;e=Reflect.construct(n,arguments,o)}else e=n.apply(this,arguments);return f()(this,e)});function o(e){var t;return a()(this,o),(t=n.apply(this,arguments)).state={isExpanded:!1,clampEnabled:null,content:e.children,summary:"."},t.reviewSummary=Object(g.createRef)(),t.reviewContent=Object(g.createRef)(),t.getButton=t.getButton.bind(l()(t)),t.onClick=t.onClick.bind(l()(t)),t}return c()(o,[{key:"componentDidMount",value:function(){if(this.props.children){var e=this.props,t=e.maxLines,r=e.ellipsis,n=(this.reviewSummary.current.clientHeight+1)*t+1,o=this.reviewContent.current.clientHeight+1>n;this.setState({clampEnabled:o}),o&&this.setState({summary:D(this.reviewContent.current.innerHTML,this.reviewSummary.current,n,r)})}}},{key:"getButton",value:function(){var e=this.state.isExpanded,t=this.props,r=t.className,n=t.lessText,o=t.moreText,a=e?n:o;if(a)return h.a.createElement("a",{href:"#more",className:r+"__read_more",onClick:this.onClick,"aria-expanded":!e,role:"button"},a)}},{key:"onClick",value:function(e){e.preventDefault();var t=this.state.isExpanded;this.setState({isExpanded:!t})}},{key:"render",value:function(){var e=this.props.className,t=this.state,r=t.content,n=t.summary,o=t.clampEnabled,a=t.isExpanded;return r?!1===o?h.a.createElement("div",{className:e},h.a.createElement("div",{ref:this.reviewContent},r)):h.a.createElement("div",{className:e},(!a||null===o)&&h.a.createElement("div",{ref:this.reviewSummary,"aria-hidden":a,dangerouslySetInnerHTML:{__html:n}}),(a||null===o)&&h.a.createElement("div",{ref:this.reviewContent,"aria-hidden":!a},r),this.getButton()):null}}]),o}(g.Component);G.defaultProps={maxLines:3,ellipsis:"&hellip;",moreText:Object(b.__)("Read more",'woocommerce'),lessText:Object(b.__)("Read less",'woocommerce'),className:"read-more-content"};var H=G;r(282);var U=function(e){var t=e.attributes,r=e.review,n=void 0===r?{}:r,o=t.imageType,a=t.showReviewDate,i=t.showReviewerName,c=t.showReviewImage,s=t.showReviewRating,l=t.showReviewContent,u=t.showProductName,p=n.rating,d=!Object.keys(n).length>0,f=Number.isFinite(p)&&s;return React.createElement("li",{className:O()("wc-block-review-list-item__item","wc-block-components-review-list-item__item",{"is-loading":d,"wc-block-components-review-list-item__item--has-image":c}),"aria-hidden":d},(u||a||i||c||f)&&React.createElement("div",{className:"wc-block-review-list-item__info wc-block-components-review-list-item__info"},c&&function(e,t,r){var n,o;return r||!e?React.createElement("div",{className:"wc-block-review-list-item__image wc-block-components-review-list-item__image"}):React.createElement("div",{className:"wc-block-review-list-item__image wc-block-components-review-list-item__image"},"product"===t?React.createElement("img",{"aria-hidden":"true",alt:(null===(n=e.product_image)||void 0===n?void 0:n.alt)||"",src:(null===(o=e.product_image)||void 0===o?void 0:o.thumbnail)||""}):React.createElement("img",{"aria-hidden":"true",alt:"",src:e.reviewer_avatar_urls[96]||""}),e.verified&&React.createElement("div",{className:"wc-block-review-list-item__verified wc-block-components-review-list-item__verified",title:Object(b.__)("Verified buyer",'woocommerce')},Object(b.__)("Verified buyer",'woocommerce')))}(n,o,d),(u||i||f||a)&&React.createElement("div",{className:"wc-block-review-list-item__meta wc-block-components-review-list-item__meta"},f&&function(e){var t=e.rating,r={width:t/5*100+"%"},n=Object(b.sprintf)(
/* translators: %f is referring to the average rating value */
Object(b.__)("Rated %f out of 5",'woocommerce'),t);return React.createElement("div",{className:"wc-block-review-list-item__rating wc-block-components-review-list-item__rating"},React.createElement("div",{className:"wc-block-review-list-item__rating__stars wc-block-components-review-list-item__rating__stars",role:"img","aria-label":n},React.createElement("span",{style:r},n)))}(n),u&&function(e){return React.createElement("div",{className:"wc-block-review-list-item__product wc-block-components-review-list-item__product"},React.createElement("a",{href:e.product_permalink,dangerouslySetInnerHTML:{__html:e.product_name}}))}(n),i&&function(e){var t=e.reviewer,r=void 0===t?"":t;return React.createElement("div",{className:"wc-block-review-list-item__author wc-block-components-review-list-item__author"},r)}(n),a&&function(e){var t=e.date_created,r=e.formatted_date_created;return React.createElement("time",{className:"wc-block-review-list-item__published-date wc-block-components-review-list-item__published-date",dateTime:t},r)}(n))),l&&function(e){return React.createElement(H,{maxLines:10,moreText:Object(b.__)("Read full review",'woocommerce'),lessText:Object(b.__)("Hide full review",'woocommerce'),className:"wc-block-review-list-item__text wc-block-components-review-list-item__text"},React.createElement("div",{dangerouslySetInnerHTML:{__html:e.review||""}}))}(n))};function F(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function W(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?F(Object(r),!0).forEach((function(t){A()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):F(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}r(281);var q=function(e){var t=e.attributes,r=e.reviews,n=Object(k.getSetting)("showAvatars",!0),o=Object(k.getSetting)("reviewRatingsEnabled",!0),a=(n||"product"===t.imageType)&&t.showReviewImage,i=o&&t.showReviewRating,c=W(W({},t),{},{showReviewImage:a,showReviewRating:i});return React.createElement("ul",{className:"wc-block-review-list wc-block-components-review-list"},0===r.length?React.createElement(U,{attributes:c}):r.map((function(e,t){return React.createElement(U,{key:e.id||t,attributes:c,review:e})})))},V=r(14),z=r.n(V),Y=r(39),Z=r.n(Y),$=r(27),J=r.n($),K=r(25),Q=r.n(K),X=r(132);var ee=function(e){var t=function(t){p()(i,t);var r,n,o=(r=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=w()(r);if(n){var o=w()(this).constructor;e=Reflect.construct(t,arguments,o)}else e=t.apply(this,arguments);return f()(this,e)});function i(){var e;a()(this,i);for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return e=o.call.apply(o,[this].concat(r)),A()(l()(e),"isPreview",!!e.props.attributes.previewReviews),A()(l()(e),"delayedAppendReviews",e.props.delayFunction(e.appendReviews)),A()(l()(e),"isMounted",!1),A()(l()(e),"state",{error:null,loading:!0,reviews:e.isPreview?e.props.attributes.previewReviews:[],totalReviews:e.isPreview?e.props.attributes.previewReviews.length:0}),A()(l()(e),"setError",function(){var t=Z()(J.a.mark((function t(r){var n,o;return J.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e.isMounted){t.next=2;break}return t.abrupt("return");case 2:return n=e.props.onReviewsLoadError,t.next=5,Object(X.a)(r);case 5:o=t.sent,e.setState({reviews:[],loading:!1,error:o}),n(o);case 8:case"end":return t.stop()}}),t)})));return function(_x){return t.apply(this,arguments)}}()),e}return c()(i,[{key:"componentDidMount",value:function(){this.isMounted=!0,this.replaceReviews()}},{key:"componentDidUpdate",value:function(e){e.reviewsToDisplay<this.props.reviewsToDisplay?this.delayedAppendReviews():this.shouldReplaceReviews(e,this.props)&&this.replaceReviews()}},{key:"shouldReplaceReviews",value:function(e,t){return e.orderby!==t.orderby||e.order!==t.order||e.productId!==t.productId||!Q()(e.categoryIds,t.categoryIds)}},{key:"componentWillUnmount",value:function(){this.isMounted=!1,this.delayedAppendReviews.cancel&&this.delayedAppendReviews.cancel()}},{key:"getArgs",value:function(e){var t=this.props,r=t.categoryIds,n=t.order,o=t.orderby,a=t.productId,i={order:n,orderby:o,per_page:t.reviewsToDisplay-e,offset:e};return r&&r.length&&(i.category_id=Array.isArray(r)?r.join(","):r),a&&(i.product_id=a),i}},{key:"replaceReviews",value:function(){if(!this.isPreview){var e=this.props.onReviewsReplaced;this.updateListOfReviews().then(e)}}},{key:"appendReviews",value:function(){if(!this.isPreview){var e=this.props,t=e.onReviewsAppended,r=e.reviewsToDisplay,n=this.state.reviews;r<=n.length||this.updateListOfReviews(n).then(t)}}},{key:"updateListOfReviews",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],r=this.props.reviewsToDisplay,n=this.state.totalReviews,o=Math.min(n,r)-t.length;return this.setState({loading:!0,reviews:t.concat(Array(o).fill({}))}),x(this.getArgs(t.length)).then((function(r){var n=r.reviews,o=r.totalReviews;return e.isMounted&&e.setState({reviews:t.filter((function(e){return Object.keys(e).length})).concat(n),totalReviews:o,loading:!1,error:null}),{newReviews:n}})).catch(this.setError)}},{key:"render",value:function(){var t=this.props.reviewsToDisplay,r=this.state,n=r.error,o=r.loading,a=r.reviews,i=r.totalReviews;return React.createElement(e,z()({},this.props,{error:n,isLoading:o,reviews:a.slice(0,t),totalReviews:i}))}}]),i}(g.Component);A()(t,"defaultProps",{delayFunction:function(e){return e},onReviewsAppended:function(){},onReviewsLoadError:function(){},onReviewsReplaced:function(){}});var r=e.displayName,n=void 0===r?e.name||"Component":r;return t.displayName="WithReviews( ".concat(n," )"),t}((function(e){var t=e.attributes,r=e.onAppendReviews,n=e.onChangeOrderby,o=e.reviews,a=e.sortSelectValue,i=e.totalReviews;if(0===o.length)return null;var c=Object(k.getSetting)("reviewRatingsEnabled",!0);return React.createElement(React.Fragment,null,"false"!==t.showOrderby&&c&&React.createElement(T,{value:a,onChange:n}),React.createElement(q,{attributes:t,reviews:o}),"false"!==t.showLoadMore&&i>o.length&&React.createElement(P,{onClick:r,screenReaderLabel:Object(b.__)("Load more reviews",'woocommerce')}))}));var te=function(e){p()(o,e);var t,r,n=(t=o,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,n=w()(t);if(r){var o=w()(this).constructor;e=Reflect.construct(n,arguments,o)}else e=n.apply(this,arguments);return f()(this,e)});function o(){var e;a()(this,o);var t=(e=n.apply(this,arguments)).props.attributes;return e.state={orderby:t.orderby,reviewsToDisplay:parseInt(t.reviewsOnPageLoad,10)},e.onAppendReviews=e.onAppendReviews.bind(l()(e)),e.onChangeOrderby=e.onChangeOrderby.bind(l()(e)),e}return c()(o,[{key:"onAppendReviews",value:function(){var e=this.props.attributes,t=this.state.reviewsToDisplay;this.setState({reviewsToDisplay:t+parseInt(e.reviewsOnLoadMore,10)})}},{key:"onChangeOrderby",value:function(e){var t=this.props.attributes;this.setState({orderby:e.target.value,reviewsToDisplay:parseInt(t.reviewsOnPageLoad,10)})}},{key:"onReviewsAppended",value:function(e){var t=e.newReviews;Object(m.speak)(Object(b.sprintf)(
/* translators: %d is the count of reviews loaded. */
Object(b._n)("%d review loaded.","%d reviews loaded.",t.length,'woocommerce'),t.length))}},{key:"onReviewsReplaced",value:function(){Object(m.speak)(Object(b.__)("Reviews list updated.",'woocommerce'))}},{key:"onReviewsLoadError",value:function(){Object(m.speak)(Object(b.__)("There was an error loading the reviews.",'woocommerce'))}},{key:"render",value:function(){var e=this.props.attributes,t=e.categoryIds,r=e.productId,n=this.state.reviewsToDisplay,o=function(e){if(Object(k.getSetting)("reviewRatingsEnabled",!0)){if("lowest-rating"===e)return{order:"asc",orderby:"rating"};if("highest-rating"===e)return{order:"desc",orderby:"rating"}}return{order:"desc",orderby:"date_gmt"}}(this.state.orderby),a=o.order,i=o.orderby;return React.createElement(ee,{attributes:e,categoryIds:t,onAppendReviews:this.onAppendReviews,onChangeOrderby:this.onChangeOrderby,onReviewsAppended:this.onReviewsAppended,onReviewsLoadError:this.onReviewsLoadError,onReviewsReplaced:this.onReviewsReplaced,order:a,orderby:i,productId:r,reviewsToDisplay:n,sortSelectValue:this.state.orderby})}}]),o}(g.Component);Object(n.a)({selector:"\n\t.wp-block-woocommerce-all-reviews,\n\t.wp-block-woocommerce-reviews-by-product,\n\t.wp-block-woocommerce-reviews-by-category\n",Block:te,getProps:function(e){return{attributes:{showReviewDate:e.classList.contains("has-date"),showReviewerName:e.classList.contains("has-name"),showReviewImage:e.classList.contains("has-image"),showReviewRating:e.classList.contains("has-rating"),showReviewContent:e.classList.contains("has-content"),showProductName:e.classList.contains("has-product-name")}}}})},33:function(e,t){e.exports=window.wp.a11y},39:function(e,t){function r(e,t,r,n,o,a,i){try{var c=e[a](i),s=c.value}catch(e){return void r(e)}c.done?t(s):Promise.resolve(s).then(n,o)}e.exports=function(e){return function(){var t=this,n=arguments;return new Promise((function(o,a){var i=e.apply(t,n);function c(e){r(i,o,a,c,s,"next",e)}function s(e){r(i,o,a,c,s,"throw",e)}c(void 0)}))}},e.exports.default=e.exports,e.exports.__esModule=!0},4:function(e,t){e.exports=function(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e},e.exports.default=e.exports,e.exports.__esModule=!0},40:function(e,t){e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},e.exports.default=e.exports,e.exports.__esModule=!0},41:function(e,t){function r(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}e.exports=function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e},e.exports.default=e.exports,e.exports.__esModule=!0},42:function(e,t,r){var n=r(71);e.exports=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&n(e,t)},e.exports.default=e.exports,e.exports.__esModule=!0},43:function(e,t,r){var n=r(21).default,o=r(29);e.exports=function(e,t){return!t||"object"!==n(t)&&"function"!=typeof t?o(e):t},e.exports.default=e.exports,e.exports.__esModule=!0},44:function(e,t,r){"use strict";var n=r(40),o=r.n(n),a=r(41),i=r.n(a),c=r(29),s=r.n(c),l=r(42),u=r.n(l),p=r(43),d=r.n(p),f=r(30),v=r.n(f),w=r(4),b=r.n(w),m=(r(10),r(3)),g=r(1),h=r(83),y=function(e){var t=e.imageUrl,r=void 0===t?"".concat(h.l,"/block-error.svg"):t,n=e.header,o=void 0===n?Object(g.__)("Oops!",'woocommerce'):n,a=e.text,i=void 0===a?Object(g.__)("There was an error loading the content.",'woocommerce'):a,c=e.errorMessage,s=e.errorMessagePrefix,l=void 0===s?Object(g.__)("Error:",'woocommerce'):s,u=e.button;return React.createElement("div",{className:"wc-block-error wc-block-components-error"},r&&React.createElement("img",{className:"wc-block-error__image wc-block-components-error__image",src:r,alt:""}),React.createElement("div",{className:"wc-block-error__content wc-block-components-error__content"},o&&React.createElement("p",{className:"wc-block-error__header wc-block-components-error__header"},o),i&&React.createElement("p",{className:"wc-block-error__text wc-block-components-error__text"},i),c&&React.createElement("p",{className:"wc-block-error__message wc-block-components-error__message"},l?l+" ":"",c),u&&React.createElement("p",{className:"wc-block-error__button wc-block-components-error__button"},u)))};r(81);var _=function(e){u()(a,e);var t,r,n=(t=a,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,n=v()(t);if(r){var o=v()(this).constructor;e=Reflect.construct(n,arguments,o)}else e=n.apply(this,arguments);return d()(this,e)});function a(){var e;o()(this,a);for(var t=arguments.length,r=new Array(t),i=0;i<t;i++)r[i]=arguments[i];return e=n.call.apply(n,[this].concat(r)),b()(s()(e),"state",{errorMessage:"",hasError:!1}),e}return i()(a,[{key:"render",value:function(){var e=this.props,t=e.header,r=e.imageUrl,n=e.showErrorMessage,o=e.text,a=e.errorMessagePrefix,i=e.renderError,c=e.button,s=this.state,l=s.errorMessage;return s.hasError?"function"==typeof i?i({errorMessage:l}):React.createElement(y,{errorMessage:n?l:null,header:t,imageUrl:r,text:o,errorMessagePrefix:a,button:c}):this.props.children}}],[{key:"getDerivedStateFromError",value:function(e){return void 0!==e.statusText&&void 0!==e.status?{errorMessage:React.createElement(React.Fragment,null,React.createElement("strong",null,e.status),": ",e.statusText),hasError:!0}:{errorMessage:e.message,hasError:!0}}}]),a}(m.Component);_.defaultProps={showErrorMessage:!0},t.a=_},51:function(e,t,r){"use strict";var n=r(4),o=r.n(n),a=r(0),i=r(6),c=r.n(i);function s(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function l(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?s(Object(r),!0).forEach((function(t){o()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):s(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}t.a=function(e){var t,r=e.label,n=e.screenReaderLabel,o=e.wrapperElement,i=e.wrapperProps,s=void 0===i?{}:i,u=null!=r,p=null!=n;return!u&&p?(t=o||"span",s=l(l({},s),{},{className:c()(s.className,"screen-reader-text")}),React.createElement(t,s,n)):(t=o||a.Fragment,u&&p&&r!==n?React.createElement(t,s,React.createElement("span",{"aria-hidden":"true"},r),React.createElement("span",{className:"screen-reader-text"},n)):React.createElement(t,s,r))}},6:function(e,t,r){var n;!function(){"use strict";var r={}.hasOwnProperty;function o(){for(var e=[],t=0;t<arguments.length;t++){var n=arguments[t];if(n){var a=typeof n;if("string"===a||"number"===a)e.push(n);else if(Array.isArray(n)){if(n.length){var i=o.apply(null,n);i&&e.push(i)}}else if("object"===a)if(n.toString===Object.prototype.toString)for(var c in n)r.call(n,c)&&n[c]&&e.push(c);else e.push(n.toString())}}return e.join(" ")}e.exports?(o.default=o,e.exports=o):void 0===(n=function(){return o}.apply(t,[]))||(e.exports=n)}()},61:function(e,t){e.exports=window.wp.apiFetch},71:function(e,t){function r(t,n){return e.exports=r=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},e.exports.default=e.exports,e.exports.__esModule=!0,r(t,n)}e.exports=r,e.exports.default=e.exports,e.exports.__esModule=!0},79:function(e,t,r){"use strict";var n=r(80);function o(){}function a(){}a.resetWarningCache=o,e.exports=function(){function e(e,t,r,o,a,i){if(i!==n){var c=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw c.name="Invariant Violation",c}}function t(){return e}e.isRequired=e;var r={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:a,resetWarningCache:o};return r.PropTypes=r,r}},80:function(e,t,r){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},81:function(e,t){},83:function(e,t,r){"use strict";r.d(t,"n",(function(){return a})),r.d(t,"l",(function(){return i})),r.d(t,"k",(function(){return c})),r.d(t,"m",(function(){return s})),r.d(t,"i",(function(){return l})),r.d(t,"d",(function(){return u})),r.d(t,"f",(function(){return p})),r.d(t,"j",(function(){return d})),r.d(t,"c",(function(){return f})),r.d(t,"e",(function(){return v})),r.d(t,"g",(function(){return w})),r.d(t,"a",(function(){return b})),r.d(t,"h",(function(){return m})),r.d(t,"b",(function(){return g}));var n,o=r(2),a=Object(o.getSetting)("wcBlocksConfig",{buildPhase:1,pluginUrl:"",productCount:0,defaultAvatar:"",restApiRoutes:{},wordCountType:"words"}),i=a.pluginUrl+"images/",c=a.pluginUrl+"build/",s=a.buildPhase,l=null===(n=o.STORE_PAGES.shop)||void 0===n?void 0:n.permalink,u=(o.STORE_PAGES.checkout.id,o.STORE_PAGES.checkout.permalink),p=o.STORE_PAGES.privacy.permalink,d=(o.STORE_PAGES.privacy.title,o.STORE_PAGES.terms.permalink),f=(o.STORE_PAGES.terms.title,o.STORE_PAGES.cart.id,o.STORE_PAGES.cart.permalink),v=o.STORE_PAGES.myaccount.permalink?o.STORE_PAGES.myaccount.permalink:Object(o.getSetting)("wpLoginUrl","/wp-login.php"),w=Object(o.getSetting)("shippingCountries",{}),b=Object(o.getSetting)("allowedCountries",{}),m=Object(o.getSetting)("shippingStates",{}),g=Object(o.getSetting)("allowedStates",{})}});woocommerce-blocks/build/wc-blocks-middleware.asset.php000064400000000207151335517640017274 0ustar00<?php return array('dependencies' => array('wp-api-fetch', 'wp-i18n', 'wp-polyfill'), 'version' => '333788569ac617ae3faef7d22d798ebb');woocommerce-blocks/build/product-best-sellers.js000064400000064730151335517640016101 0ustar00this.wc=this.wc||{},this.wc.blocks=this.wc.blocks||{},this.wc.blocks["product-best-sellers"]=function(e){function t(t){for(var n,i,l=t[0],u=t[1],a=t[2],b=0,d=[];b<l.length;b++)i=l[b],Object.prototype.hasOwnProperty.call(c,i)&&c[i]&&d.push(c[i][0]),c[i]=0;for(n in u)Object.prototype.hasOwnProperty.call(u,n)&&(e[n]=u[n]);for(s&&s(t);d.length;)d.shift()();return o.push.apply(o,a||[]),r()}function r(){for(var e,t=0;t<o.length;t++){for(var r=o[t],n=!0,l=1;l<r.length;l++){var u=r[l];0!==c[u]&&(n=!1)}n&&(o.splice(t--,1),e=i(i.s=r[0]))}return e}var n={},c={28:0},o=[];function i(t){if(n[t])return n[t].exports;var r=n[t]={i:t,l:!1,exports:{}};return e[t].call(r.exports,r,r.exports,i),r.l=!0,r.exports}i.m=e,i.c=n,i.d=function(e,t,r){i.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},i.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.t=function(e,t){if(1&t&&(e=i(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(i.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)i.d(r,n,function(t){return e[t]}.bind(null,n));return r},i.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(t,"a",t),t},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.p="";var l=window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[],u=l.push.bind(l);l.push=t,l=l.slice();for(var a=0;a<l.length;a++)t(l[a]);var s=u;return o.push([754,0]),r()}({0:function(e,t){e.exports=window.wp.element},1:function(e,t){e.exports=window.wp.i18n},107:function(e,t,r){"use strict";r.d(t,"b",(function(){return c}));var n=r(3),c=["woocommerce/product-best-sellers","woocommerce/product-category","woocommerce/product-new","woocommerce/product-on-sale","woocommerce/product-top-rated"];t.a={columns:{type:"number",default:Object(n.getSetting)("default_columns",3)},rows:{type:"number",default:Object(n.getSetting)("default_rows",3)},alignButtons:{type:"boolean",default:!1},categories:{type:"array",default:[]},catOperator:{type:"string",default:"any"},contentVisibility:{type:"object",default:{title:!0,price:!0,rating:!0,button:!0}},isPreview:{type:"boolean",default:!1}}},11:function(e,t){e.exports=window.React},12:function(e,t){e.exports=window.wp.blockEditor},121:function(e,t){},122:function(e,t){e.exports=window.wp.coreData},139:function(e,t){},14:function(e,t){e.exports=window.wp.data},15:function(e,t){e.exports=window.wp.apiFetch},188:function(e,t,r){"use strict";r.d(t,"a",(function(){return c}));var n=r(0),c=Object(n.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 230 250",style:{width:"100%"}},Object(n.createElement)("title",null,"Grid Block Preview"),Object(n.createElement)("rect",{width:"65.374",height:"65.374",x:".162",y:".779",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"47.266",height:"5.148",x:"9.216",y:"76.153",fill:"#E1E3E6",rx:"2.574"}),Object(n.createElement)("rect",{width:"62.8",height:"15",x:"1.565",y:"101.448",fill:"#E1E3E6",rx:"5"}),Object(n.createElement)("rect",{width:"65.374",height:"65.374",x:".162",y:"136.277",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"47.266",height:"5.148",x:"9.216",y:"211.651",fill:"#E1E3E6",rx:"2.574"}),Object(n.createElement)("rect",{width:"62.8",height:"15",x:"1.565",y:"236.946",fill:"#E1E3E6",rx:"5"}),Object(n.createElement)("rect",{width:"65.374",height:"65.374",x:"82.478",y:".779",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"47.266",height:"5.148",x:"91.532",y:"76.153",fill:"#E1E3E6",rx:"2.574"}),Object(n.createElement)("rect",{width:"62.8",height:"15",x:"83.882",y:"101.448",fill:"#E1E3E6",rx:"5"}),Object(n.createElement)("rect",{width:"65.374",height:"65.374",x:"82.478",y:"136.277",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"47.266",height:"5.148",x:"91.532",y:"211.651",fill:"#E1E3E6",rx:"2.574"}),Object(n.createElement)("rect",{width:"62.8",height:"15",x:"83.882",y:"236.946",fill:"#E1E3E6",rx:"5"}),Object(n.createElement)("rect",{width:"65.374",height:"65.374",x:"164.788",y:".779",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"47.266",height:"5.148",x:"173.843",y:"76.153",fill:"#E1E3E6",rx:"2.574"}),Object(n.createElement)("rect",{width:"62.8",height:"15",x:"166.192",y:"101.448",fill:"#E1E3E6",rx:"5"}),Object(n.createElement)("rect",{width:"65.374",height:"65.374",x:"164.788",y:"136.277",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"47.266",height:"5.148",x:"173.843",y:"211.651",fill:"#E1E3E6",rx:"2.574"}),Object(n.createElement)("rect",{width:"62.8",height:"15",x:"166.192",y:"236.946",fill:"#E1E3E6",rx:"5"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"13.283",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"21.498",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"29.713",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"37.927",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"46.238",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"95.599",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"103.814",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"112.029",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"120.243",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"128.554",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"177.909",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"186.124",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"194.339",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"202.553",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"210.864",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"13.283",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"21.498",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"29.713",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"37.927",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"46.238",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"95.599",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"103.814",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"112.029",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"120.243",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"128.554",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"177.909",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"186.124",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"194.339",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"202.553",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"210.864",y:"221.798",fill:"#E1E3E6",rx:"3"}))},21:function(e,t){e.exports=window.wp.compose},22:function(e,t){e.exports=window.regeneratorRuntime},23:function(e,t){e.exports=window.wp.url},25:function(e,t){e.exports=window.wp.htmlEntities},26:function(e,t){e.exports=window.wp.blocks},28:function(e,t){e.exports=window.wp.primitives},3:function(e,t){e.exports=window.wc.wcSettings},31:function(e,t){e.exports=window.moment},36:function(e,t){e.exports=window.wp.dataControls},37:function(e,t,r){"use strict";r.d(t,"o",(function(){return o})),r.d(t,"m",(function(){return i})),r.d(t,"l",(function(){return l})),r.d(t,"n",(function(){return u})),r.d(t,"j",(function(){return a})),r.d(t,"e",(function(){return s})),r.d(t,"f",(function(){return b})),r.d(t,"g",(function(){return d})),r.d(t,"k",(function(){return p})),r.d(t,"c",(function(){return g})),r.d(t,"d",(function(){return f})),r.d(t,"h",(function(){return h})),r.d(t,"a",(function(){return w})),r.d(t,"i",(function(){return O})),r.d(t,"b",(function(){return E}));var n,c=r(3),o=Object(c.getSetting)("wcBlocksConfig",{buildPhase:1,pluginUrl:"",productCount:0,defaultAvatar:"",restApiRoutes:{},wordCountType:"words"}),i=o.pluginUrl+"images/",l=o.pluginUrl+"build/",u=o.buildPhase,a=null===(n=c.STORE_PAGES.shop)||void 0===n?void 0:n.permalink,s=c.STORE_PAGES.checkout.id,b=c.STORE_PAGES.checkout.permalink,d=c.STORE_PAGES.privacy.permalink,p=(c.STORE_PAGES.privacy.title,c.STORE_PAGES.terms.permalink),g=(c.STORE_PAGES.terms.title,c.STORE_PAGES.cart.id),f=c.STORE_PAGES.cart.permalink,h=(c.STORE_PAGES.myaccount.permalink?c.STORE_PAGES.myaccount.permalink:Object(c.getSetting)("wpLoginUrl","/wp-login.php"),Object(c.getSetting)("shippingCountries",{})),w=Object(c.getSetting)("allowedCountries",{}),O=Object(c.getSetting)("shippingStates",{}),E=Object(c.getSetting)("allowedStates",{})},39:function(e,t,r){"use strict";r.d(t,"h",(function(){return p})),r.d(t,"e",(function(){return g})),r.d(t,"b",(function(){return f})),r.d(t,"i",(function(){return h})),r.d(t,"f",(function(){return w})),r.d(t,"c",(function(){return O})),r.d(t,"d",(function(){return E})),r.d(t,"g",(function(){return m})),r.d(t,"a",(function(){return j}));var n=r(5),c=r.n(n),o=r(23),i=r(15),l=r.n(i),u=r(7),a=r(3),s=r(37);function b(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function d(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?b(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):b(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var p=function(e){var t=e.selected,r=void 0===t?[]:t,n=e.search,c=void 0===n?"":n,i=e.queryArgs,a=function(e){var t=e.selected,r=void 0===t?[]:t,n=e.search,c=void 0===n?"":n,i=e.queryArgs,l=void 0===i?{}:i,u=s.o.productCount>100,a={per_page:u?100:0,catalog_visibility:"any",search:c,orderby:"title",order:"asc"},b=[Object(o.addQueryArgs)("/wc/store/products",d(d({},a),l))];return u&&r.length&&b.push(Object(o.addQueryArgs)("/wc/store/products",{catalog_visibility:"any",include:r,per_page:0})),b}({selected:r,search:c,queryArgs:void 0===i?{}:i});return Promise.all(a.map((function(e){return l()({path:e})}))).then((function(e){return Object(u.uniqBy)(Object(u.flatten)(e),"id").map((function(e){return d(d({},e),{},{parent:0})}))})).catch((function(e){throw e}))},g=function(e){return l()({path:"/wc/store/products/".concat(e)})},f=function(){return l()({path:"wc/store/products/attributes"})},h=function(e){return l()({path:"wc/store/products/attributes/".concat(e,"/terms")})},w=function(e){var t=e.selected,r=function(e){var t=e.selected,r=void 0===t?[]:t,n=e.search,c=Object(a.getSetting)("limitTags",!1),i=[Object(o.addQueryArgs)("wc/store/products/tags",{per_page:c?100:0,orderby:c?"count":"name",order:c?"desc":"asc",search:n})];return c&&r.length&&i.push(Object(o.addQueryArgs)("wc/store/products/tags",{include:r})),i}({selected:void 0===t?[]:t,search:e.search});return Promise.all(r.map((function(e){return l()({path:e})}))).then((function(e){return Object(u.uniqBy)(Object(u.flatten)(e),"id")}))},O=function(e){return l()({path:Object(o.addQueryArgs)("wc/store/products/categories",d({per_page:0},e))})},E=function(e){return l()({path:"wc/store/products/categories/".concat(e)})},m=function(e){return l()({path:Object(o.addQueryArgs)("wc/store/products",{per_page:0,type:"variation",parent:e})})},j=function(e,t){if(!e.title.raw)return e.slug;var r=1===t.filter((function(t){return t.title.raw===e.title.raw})).length;return e.title.raw+(r?"":" - ".concat(e.slug))}},4:function(e,t){e.exports=window.wp.components},42:function(e,t,r){"use strict";r.d(t,"a",(function(){return u})),r.d(t,"b",(function(){return a}));var n=r(29),c=r.n(n),o=r(22),i=r.n(o),l=r(1),u=function(){var e=c()(i.a.mark((function e(t){var r;return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("function"!=typeof t.json){e.next=11;break}return e.prev=1,e.next=4,t.json();case 4:return r=e.sent,e.abrupt("return",{message:r.message,type:r.type||"api"});case 8:return e.prev=8,e.t0=e.catch(1),e.abrupt("return",{message:e.t0.message,type:"general"});case 11:return e.abrupt("return",{message:t.message,type:t.type||"general"});case 12:case"end":return e.stop()}}),e,null,[[1,8]])})));return function(_x){return e.apply(this,arguments)}}(),a=function(e){if(e.data&&"rest_invalid_param"===e.code){var t=Object.values(e.data.params);if(t[0])return t[0]}return(null==e?void 0:e.message)||Object(l.__)("Something went wrong. Please contact us to get assistance.",'woocommerce')}},46:function(e,t){e.exports=window.wp.keycodes},48:function(e,t){e.exports=window.wp.escapeHtml},52:function(e,t,r){"use strict";var n=r(0),c=r(1),o=(r(2),r(48));t.a=function(e){var t,r,i,l=e.error;return Object(n.createElement)("div",{className:"wc-block-error-message"},(r=(t=l).message,i=t.type,r?"general"===i?Object(n.createElement)("span",null,Object(c.__)("The following error was returned",'woocommerce'),Object(n.createElement)("br",null),Object(n.createElement)("code",null,Object(o.escapeHTML)(r))):"api"===i?Object(n.createElement)("span",null,Object(c.__)("The following error was returned from the API",'woocommerce'),Object(n.createElement)("br",null),Object(n.createElement)("code",null,Object(o.escapeHTML)(r))):r:Object(c.__)("An unknown error occurred which prevented the block from being updated.",'woocommerce')))}},55:function(e,t){e.exports=window.wp.hooks},56:function(e,t){e.exports=window.wp.deprecated},66:function(e,t,r){"use strict";var n=r(5),c=r.n(n),o=r(16),i=r.n(o),l=r(0),u=["srcElement","size"];function a(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}t.a=function(e){var t=e.srcElement,r=e.size,n=void 0===r?24:r,o=i()(e,u);return Object(l.isValidElement)(t)?Object(l.cloneElement)(t,function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?a(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):a(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({width:n,height:n},o)):null}},7:function(e,t){e.exports=window.lodash},74:function(e,t){e.exports=window.wp.dom},754:function(e,t,r){e.exports=r(868)},84:function(e,t){e.exports=window.wp.serverSideRender},868:function(e,t,r){"use strict";r.r(t);var n=r(5),c=r.n(n),o=r(0),i=r(1),l=r(7),u=r(66),a=r(28),s=Object(o.createElement)(a.SVG,{xmlns:"http://www.w3.org/2000/SVG",viewBox:"0 0 24 24"},Object(o.createElement)("path",{fill:"none",d:"M0 0h24v24H0V0z"}),Object(o.createElement)("path",{d:"M3.5 18.49l6-6.01 4 4L22 6.92l-1.41-1.41-7.09 7.97-4-4L2 16.99l1.5 1.5z"})),b=r(26),d=r(17),p=r.n(d),g=r(18),f=r.n(g),h=r(19),w=r.n(h),O=r(20),E=r.n(O),m=r(10),j=r.n(m),y=r(4),v=r(12),x=r(84),_=r.n(x),k=(r(2),r(92)),P=r(93),S=r(97),C=r(188),R=r(3);var A=function(e){w()(c,e);var t,r,n=(t=c,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,n=j()(t);if(r){var c=j()(this).constructor;e=Reflect.construct(n,arguments,c)}else e=n.apply(this,arguments);return E()(this,e)});function c(){return p()(this,c),n.apply(this,arguments)}return f()(c,[{key:"getInspectorControls",value:function(){var e=this.props,t=e.attributes,r=e.setAttributes,n=t.categories,c=t.catOperator,l=t.columns,u=t.contentVisibility,a=t.rows,s=t.alignButtons;return Object(o.createElement)(v.InspectorControls,{key:"inspector"},Object(o.createElement)(y.PanelBody,{title:Object(i.__)("Layout",'woocommerce'),initialOpen:!0},Object(o.createElement)(P.a,{columns:l,rows:a,alignButtons:s,setAttributes:r,minColumns:Object(R.getSetting)("min_columns",1),maxColumns:Object(R.getSetting)("max_columns",6),minRows:Object(R.getSetting)("min_rows",1),maxRows:Object(R.getSetting)("max_rows",6)})),Object(o.createElement)(y.PanelBody,{title:Object(i.__)("Content",'woocommerce'),initialOpen:!0},Object(o.createElement)(k.a,{settings:u,onChange:function(e){return r({contentVisibility:e})}})),Object(o.createElement)(y.PanelBody,{title:Object(i.__)("Filter by Product Category",'woocommerce'),initialOpen:!1},Object(o.createElement)(S.a,{selected:n,onChange:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=e.map((function(e){return e.id}));r({categories:t})},operator:c,onOperatorChange:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"any";return r({catOperator:e})}})))}},{key:"render",value:function(){var e=this.props,t=e.attributes,r=e.name;return t.isPreview?C.a:Object(o.createElement)(o.Fragment,null,this.getInspectorControls(),Object(o.createElement)(y.Disabled,null,Object(o.createElement)(_.a,{block:r,attributes:t})))}}]),c}(o.Component),T=r(107);function B(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}Object(b.registerBlockType)("woocommerce/product-best-sellers",{title:Object(i.__)("Best Selling Products",'woocommerce'),icon:{src:Object(o.createElement)(u.a,{srcElement:s}),foreground:"#96588a"},category:"woocommerce",keywords:[Object(i.__)("WooCommerce",'woocommerce')],description:Object(i.__)("Display a grid of your all-time best selling products.",'woocommerce'),supports:{align:["wide","full"],html:!1},example:{attributes:{isPreview:!0}},attributes:function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?B(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):B(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({},T.a),transforms:{from:[{type:"block",blocks:Object(l.without)(T.b,"woocommerce/product-best-sellers"),transform:function(e){return Object(b.createBlock)("woocommerce/product-best-sellers",e)}}]},edit:function(e){return Object(o.createElement)(A,e)},save:function(){return null}})},87:function(e,t){e.exports=window.ReactDOM},89:function(e,t){e.exports=window.wp.viewport},92:function(e,t,r){"use strict";var n=r(5),c=r.n(n),o=r(0),i=r(1),l=(r(2),r(4));function u(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function a(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?u(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):u(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}t.a=function(e){var t=e.onChange,r=e.settings,n=r.button,c=r.price,u=r.rating,s=r.title;return Object(o.createElement)(o.Fragment,null,Object(o.createElement)(l.ToggleControl,{label:Object(i.__)("Product title",'woocommerce'),help:s?Object(i.__)("Product title is visible.",'woocommerce'):Object(i.__)("Product title is hidden.",'woocommerce'),checked:s,onChange:function(){return t(a(a({},r),{},{title:!s}))}}),Object(o.createElement)(l.ToggleControl,{label:Object(i.__)("Product price",'woocommerce'),help:c?Object(i.__)("Product price is visible.",'woocommerce'):Object(i.__)("Product price is hidden.",'woocommerce'),checked:c,onChange:function(){return t(a(a({},r),{},{price:!c}))}}),Object(o.createElement)(l.ToggleControl,{label:Object(i.__)("Product rating",'woocommerce'),help:u?Object(i.__)("Product rating is visible.",'woocommerce'):Object(i.__)("Product rating is hidden.",'woocommerce'),checked:u,onChange:function(){return t(a(a({},r),{},{rating:!u}))}}),Object(o.createElement)(l.ToggleControl,{label:Object(i.__)("Add to Cart button",'woocommerce'),help:n?Object(i.__)("Add to Cart button is visible.",'woocommerce'):Object(i.__)("Add to Cart button is hidden.",'woocommerce'),checked:n,onChange:function(){return t(a(a({},r),{},{button:!n}))}}))}},93:function(e,t,r){"use strict";var n=r(0),c=r(1),o=r(7),i=(r(2),r(4));t.a=function(e){var t=e.columns,r=e.rows,l=e.setAttributes,u=e.alignButtons,a=e.minColumns,s=void 0===a?1:a,b=e.maxColumns,d=void 0===b?6:b,p=e.minRows,g=void 0===p?1:p,f=e.maxRows,h=void 0===f?6:f;return Object(n.createElement)(n.Fragment,null,Object(n.createElement)(i.RangeControl,{label:Object(c.__)("Columns",'woocommerce'),value:t,onChange:function(e){var t=Object(o.clamp)(e,s,d);l({columns:Number.isNaN(t)?"":t})},min:s,max:d}),Object(n.createElement)(i.RangeControl,{label:Object(c.__)("Rows",'woocommerce'),value:r,onChange:function(e){var t=Object(o.clamp)(e,g,h);l({rows:Number.isNaN(t)?"":t})},min:g,max:h}),Object(n.createElement)(i.ToggleControl,{label:Object(c.__)("Align Last Block",'woocommerce'),help:u?Object(c.__)("The last inner block will be aligned vertically.",'woocommerce'):Object(c.__)("The last inner block will follow other content.",'woocommerce'),checked:u,onChange:function(){return l({alignButtons:!u})}}))}},96:function(e,t){e.exports=window.wp.date},97:function(e,t,r){"use strict";var n=r(9),c=r.n(n),o=r(0),i=r(1),l=(r(2),r(49)),u=r(4),a=r(29),s=r.n(a),b=r(17),d=r.n(b),p=r(18),g=r.n(p),f=r(13),h=r.n(f),w=r(19),O=r.n(w),E=r(20),m=r.n(E),j=r(10),y=r.n(j),v=r(22),x=r.n(v),_=r(21),k=r(39),P=r(42);var S=Object(_.createHigherOrderComponent)((function(e){return function(t){O()(l,t);var r,n,i=(r=l,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=y()(r);if(n){var c=y()(this).constructor;e=Reflect.construct(t,arguments,c)}else e=t.apply(this,arguments);return m()(this,e)});function l(){var e;return d()(this,l),(e=i.apply(this,arguments)).state={error:null,loading:!1,categories:[]},e.loadCategories=e.loadCategories.bind(h()(e)),e}return g()(l,[{key:"componentDidMount",value:function(){this.loadCategories()}},{key:"loadCategories",value:function(){var e=this;this.setState({loading:!0}),Object(k.c)().then((function(t){e.setState({categories:t,loading:!1,error:null})})).catch(function(){var t=s()(x.a.mark((function t(r){var n;return x.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,Object(P.a)(r);case 2:n=t.sent,e.setState({categories:[],loading:!1,error:n});case 4:case"end":return t.stop()}}),t)})));return function(_x){return t.apply(this,arguments)}}())}},{key:"render",value:function(){var t=this.state,r=t.error,n=t.loading,i=t.categories;return Object(o.createElement)(e,c()({},this.props,{error:r,isLoading:n,categories:i}))}}]),l}(o.Component)}),"withCategories"),C=r(52),R=r(6),A=r.n(R),T=(r(139),function(e){var t=e.categories,r=e.error,n=e.isLoading,a=e.onChange,s=e.onOperatorChange,b=e.operator,d=e.selected,p=e.isCompact,g=e.isSingle,f=e.showReviewCount,h={clear:Object(i.__)("Clear all product categories",'woocommerce'),list:Object(i.__)("Product Categories",'woocommerce'),noItems:Object(i.__)("Your store doesn't have any product categories.",'woocommerce'),search:Object(i.__)("Search for product categories",'woocommerce'),selected:function(e){return Object(i.sprintf)(
/* translators: %d is the count of selected categories. */
Object(i._n)("%d category selected","%d categories selected",e,'woocommerce'),e)},updated:Object(i.__)("Category search results updated.",'woocommerce')};return r?Object(o.createElement)(C.a,{error:r}):Object(o.createElement)(o.Fragment,null,Object(o.createElement)(l.b,{className:"woocommerce-product-categories",list:t,isLoading:n,selected:d.map((function(e){return t.find((function(t){return t.id===e}))})).filter(Boolean),onChange:a,renderItem:function(e){var t=e.item,r=e.search,n=e.depth,u=void 0===n?0:n,a=t.breadcrumbs.length?"".concat(t.breadcrumbs.join(", "),", ").concat(t.name):t.name,s=f?Object(i.sprintf)(
/* translators: %1$s is the item name, %2$d is the count of reviews for the item. */
Object(i._n)("%1$s, has %2$d review","%1$s, has %2$d reviews",t.review_count,'woocommerce'),a,t.review_count):Object(i.sprintf)(
/* translators: %1$s is the item name, %2$d is the count of products for the item. */
Object(i._n)("%1$s, has %2$d product","%1$s, has %2$d products",t.count,'woocommerce'),a,t.count),b=f?Object(i.sprintf)(
/* translators: %d is the count of reviews. */
Object(i._n)("%d review","%d reviews",t.review_count,'woocommerce'),t.review_count):Object(i.sprintf)(
/* translators: %d is the count of products. */
Object(i._n)("%d product","%d products",t.count,'woocommerce'),t.count);return Object(o.createElement)(l.c,c()({className:A()("woocommerce-product-categories__item","has-count",{"is-searching":r.length>0,"is-skip-level":0===u&&0!==t.parent})},e,{countLabel:b,"aria-label":s}))},messages:h,isCompact:p,isHierarchical:!0,isSingle:g}),!!s&&Object(o.createElement)("div",{hidden:d.length<2},Object(o.createElement)(u.SelectControl,{className:"woocommerce-product-categories__operator",label:Object(i.__)("Display products matching",'woocommerce'),help:Object(i.__)("Pick at least two categories to use this setting.",'woocommerce'),value:b,onChange:s,options:[{label:Object(i.__)("Any selected categories",'woocommerce'),value:"any"},{label:Object(i.__)("All selected categories",'woocommerce'),value:"all"}]})))});T.defaultProps={operator:"any",isCompact:!1,isSingle:!1},t.a=S(T)}});woocommerce-blocks/build/featured-category.js000064400000063523151335517640015430 0ustar00this.wc=this.wc||{},this.wc.blocks=this.wc.blocks||{},this.wc.blocks["featured-category"]=function(e){function t(t){for(var n,a,i=t[0],u=t[1],l=t[2],d=0,p=[];d<i.length;d++)a=i[d],Object.prototype.hasOwnProperty.call(o,a)&&o[a]&&p.push(o[a][0]),o[a]=0;for(n in u)Object.prototype.hasOwnProperty.call(u,n)&&(e[n]=u[n]);for(s&&s(t);p.length;)p.shift()();return c.push.apply(c,l||[]),r()}function r(){for(var e,t=0;t<c.length;t++){for(var r=c[t],n=!0,i=1;i<r.length;i++){var u=r[i];0!==o[u]&&(n=!1)}n&&(c.splice(t--,1),e=a(a.s=r[0]))}return e}var n={},o={23:0},c=[];function a(t){if(n[t])return n[t].exports;var r=n[t]={i:t,l:!1,exports:{}};return e[t].call(r.exports,r,r.exports,a),r.l=!0,r.exports}a.m=e,a.c=n,a.d=function(e,t,r){a.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},a.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},a.t=function(e,t){if(1&t&&(e=a(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(a.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)a.d(r,n,function(t){return e[t]}.bind(null,n));return r},a.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return a.d(t,"a",t),t},a.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},a.p="";var i=window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[],u=i.push.bind(i);i.push=t,i=i.slice();for(var l=0;l<i.length;l++)t(i[l]);var s=u;return c.push([782,0]),r()}({0:function(e,t){e.exports=window.wp.element},1:function(e,t){e.exports=window.wp.i18n},106:function(e,t,r){"use strict";var n=r(0),o=r(1),c=(r(2),r(66)),a=r(150),i=r(6),u=r.n(i),l=r(4),s=r(52);r(153),t.a=function(e){var t=e.className,r=e.error,i=e.isLoading,d=e.onRetry;return Object(n.createElement)(l.Placeholder,{icon:Object(n.createElement)(c.a,{srcElement:a.a}),label:Object(o.__)("Sorry, an error occurred",'woocommerce'),className:u()("wc-block-api-error",t)},Object(n.createElement)(s.a,{error:r}),d&&Object(n.createElement)(n.Fragment,null,i?Object(n.createElement)(l.Spinner,null):Object(n.createElement)(l.Button,{isSecondary:!0,onClick:d},Object(o.__)("Retry",'woocommerce'))))}},11:function(e,t){e.exports=window.React},12:function(e,t){e.exports=window.wp.blockEditor},121:function(e,t){},122:function(e,t){e.exports=window.wp.coreData},139:function(e,t){},14:function(e,t){e.exports=window.wp.data},15:function(e,t){e.exports=window.wp.apiFetch},150:function(e,t,r){"use strict";var n=r(0),o=r(28),c=Object(n.createElement)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(n.createElement)("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z"}));t.a=c},153:function(e,t){},21:function(e,t){e.exports=window.wp.compose},22:function(e,t){e.exports=window.regeneratorRuntime},23:function(e,t){e.exports=window.wp.url},25:function(e,t){e.exports=window.wp.htmlEntities},26:function(e,t){e.exports=window.wp.blocks},28:function(e,t){e.exports=window.wp.primitives},3:function(e,t){e.exports=window.wc.wcSettings},31:function(e,t){e.exports=window.moment},36:function(e,t){e.exports=window.wp.dataControls},37:function(e,t,r){"use strict";r.d(t,"o",(function(){return c})),r.d(t,"m",(function(){return a})),r.d(t,"l",(function(){return i})),r.d(t,"n",(function(){return u})),r.d(t,"j",(function(){return l})),r.d(t,"e",(function(){return s})),r.d(t,"f",(function(){return d})),r.d(t,"g",(function(){return p})),r.d(t,"k",(function(){return g})),r.d(t,"c",(function(){return b})),r.d(t,"d",(function(){return f})),r.d(t,"h",(function(){return m})),r.d(t,"a",(function(){return w})),r.d(t,"i",(function(){return h})),r.d(t,"b",(function(){return O}));var n,o=r(3),c=Object(o.getSetting)("wcBlocksConfig",{buildPhase:1,pluginUrl:"",productCount:0,defaultAvatar:"",restApiRoutes:{},wordCountType:"words"}),a=c.pluginUrl+"images/",i=c.pluginUrl+"build/",u=c.buildPhase,l=null===(n=o.STORE_PAGES.shop)||void 0===n?void 0:n.permalink,s=o.STORE_PAGES.checkout.id,d=o.STORE_PAGES.checkout.permalink,p=o.STORE_PAGES.privacy.permalink,g=(o.STORE_PAGES.privacy.title,o.STORE_PAGES.terms.permalink),b=(o.STORE_PAGES.terms.title,o.STORE_PAGES.cart.id),f=o.STORE_PAGES.cart.permalink,m=(o.STORE_PAGES.myaccount.permalink?o.STORE_PAGES.myaccount.permalink:Object(o.getSetting)("wpLoginUrl","/wp-login.php"),Object(o.getSetting)("shippingCountries",{})),w=Object(o.getSetting)("allowedCountries",{}),h=Object(o.getSetting)("shippingStates",{}),O=Object(o.getSetting)("allowedStates",{})},39:function(e,t,r){"use strict";r.d(t,"h",(function(){return g})),r.d(t,"e",(function(){return b})),r.d(t,"b",(function(){return f})),r.d(t,"i",(function(){return m})),r.d(t,"f",(function(){return w})),r.d(t,"c",(function(){return h})),r.d(t,"d",(function(){return O})),r.d(t,"g",(function(){return y})),r.d(t,"a",(function(){return j}));var n=r(5),o=r.n(n),c=r(23),a=r(15),i=r.n(a),u=r(7),l=r(3),s=r(37);function d(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function p(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?d(Object(r),!0).forEach((function(t){o()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):d(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var g=function(e){var t=e.selected,r=void 0===t?[]:t,n=e.search,o=void 0===n?"":n,a=e.queryArgs,l=function(e){var t=e.selected,r=void 0===t?[]:t,n=e.search,o=void 0===n?"":n,a=e.queryArgs,i=void 0===a?{}:a,u=s.o.productCount>100,l={per_page:u?100:0,catalog_visibility:"any",search:o,orderby:"title",order:"asc"},d=[Object(c.addQueryArgs)("/wc/store/products",p(p({},l),i))];return u&&r.length&&d.push(Object(c.addQueryArgs)("/wc/store/products",{catalog_visibility:"any",include:r,per_page:0})),d}({selected:r,search:o,queryArgs:void 0===a?{}:a});return Promise.all(l.map((function(e){return i()({path:e})}))).then((function(e){return Object(u.uniqBy)(Object(u.flatten)(e),"id").map((function(e){return p(p({},e),{},{parent:0})}))})).catch((function(e){throw e}))},b=function(e){return i()({path:"/wc/store/products/".concat(e)})},f=function(){return i()({path:"wc/store/products/attributes"})},m=function(e){return i()({path:"wc/store/products/attributes/".concat(e,"/terms")})},w=function(e){var t=e.selected,r=function(e){var t=e.selected,r=void 0===t?[]:t,n=e.search,o=Object(l.getSetting)("limitTags",!1),a=[Object(c.addQueryArgs)("wc/store/products/tags",{per_page:o?100:0,orderby:o?"count":"name",order:o?"desc":"asc",search:n})];return o&&r.length&&a.push(Object(c.addQueryArgs)("wc/store/products/tags",{include:r})),a}({selected:void 0===t?[]:t,search:e.search});return Promise.all(r.map((function(e){return i()({path:e})}))).then((function(e){return Object(u.uniqBy)(Object(u.flatten)(e),"id")}))},h=function(e){return i()({path:Object(c.addQueryArgs)("wc/store/products/categories",p({per_page:0},e))})},O=function(e){return i()({path:"wc/store/products/categories/".concat(e)})},y=function(e){return i()({path:Object(c.addQueryArgs)("wc/store/products",{per_page:0,type:"variation",parent:e})})},j=function(e,t){if(!e.title.raw)return e.slug;var r=1===t.filter((function(t){return t.title.raw===e.title.raw})).length;return e.title.raw+(r?"":" - ".concat(e.slug))}},4:function(e,t){e.exports=window.wp.components},42:function(e,t,r){"use strict";r.d(t,"a",(function(){return u})),r.d(t,"b",(function(){return l}));var n=r(29),o=r.n(n),c=r(22),a=r.n(c),i=r(1),u=function(){var e=o()(a.a.mark((function e(t){var r;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("function"!=typeof t.json){e.next=11;break}return e.prev=1,e.next=4,t.json();case 4:return r=e.sent,e.abrupt("return",{message:r.message,type:r.type||"api"});case 8:return e.prev=8,e.t0=e.catch(1),e.abrupt("return",{message:e.t0.message,type:"general"});case 11:return e.abrupt("return",{message:t.message,type:t.type||"general"});case 12:case"end":return e.stop()}}),e,null,[[1,8]])})));return function(_x){return e.apply(this,arguments)}}(),l=function(e){if(e.data&&"rest_invalid_param"===e.code){var t=Object.values(e.data.params);if(t[0])return t[0]}return(null==e?void 0:e.message)||Object(i.__)("Something went wrong. Please contact us to get assistance.",'woocommerce')}},46:function(e,t){e.exports=window.wp.keycodes},48:function(e,t){e.exports=window.wp.escapeHtml},52:function(e,t,r){"use strict";var n=r(0),o=r(1),c=(r(2),r(48));t.a=function(e){var t,r,a,i=e.error;return Object(n.createElement)("div",{className:"wc-block-error-message"},(r=(t=i).message,a=t.type,r?"general"===a?Object(n.createElement)("span",null,Object(o.__)("The following error was returned",'woocommerce'),Object(n.createElement)("br",null),Object(n.createElement)("code",null,Object(c.escapeHTML)(r))):"api"===a?Object(n.createElement)("span",null,Object(o.__)("The following error was returned from the API",'woocommerce'),Object(n.createElement)("br",null),Object(n.createElement)("code",null,Object(c.escapeHTML)(r))):r:Object(o.__)("An unknown error occurred which prevented the block from being updated.",'woocommerce')))}},55:function(e,t){e.exports=window.wp.hooks},56:function(e,t){e.exports=window.wp.deprecated},66:function(e,t,r){"use strict";var n=r(5),o=r.n(n),c=r(16),a=r.n(c),i=r(0),u=["srcElement","size"];function l(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}t.a=function(e){var t=e.srcElement,r=e.size,n=void 0===r?24:r,c=a()(e,u);return Object(i.isValidElement)(t)?Object(i.cloneElement)(t,function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?l(Object(r),!0).forEach((function(t){o()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):l(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({width:n,height:n},c)):null}},7:function(e,t){e.exports=window.lodash},74:function(e,t){e.exports=window.wp.dom},782:function(e,t,r){e.exports=r(857)},783:function(e,t){},784:function(e,t){},857:function(e,t,r){"use strict";r.r(t);var n=r(0),o=r(1),c=r(12),a=r(26),i=r(3),u=r(66),l=r(28),s=Object(n.createElement)(l.SVG,{xmlns:"http://www.w3.org/2000/SVG",viewBox:"0 0 24 24"},Object(n.createElement)("path",{fill:"none",d:"M0 0h24v24H0V0z"}),Object(n.createElement)("path",{d:"M20 6h-8l-2-2H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2zm0 12H4V6h5.17l2 2H20v10zm-6.92-3.96L12.39 17 15 15.47 17.61 17l-.69-2.96 2.3-1.99-3.03-.26L15 9l-1.19 2.79-3.03.26z"})),d=(r(783),r(784),r(9)),p=r.n(d),g=r(17),b=r.n(g),f=r(18),m=r.n(f),w=r(13),h=r.n(w),O=r(19),y=r.n(O),j=r(20),v=r.n(j),k=r(10),_=r.n(k),E=r(5),S=r.n(E),C=r(4),P=r(6),x=r.n(P),R=r(14),A=r(21),T=(r(2),r(97)),B=r(106),I=r(7);function D(e){return e&&Object(I.isObject)(e.image)?e.image.src:""}var U=r(29),M=r.n(U),N=r(22),L=r.n(N),G=r(39),H=r(42);var F=Object(A.createHigherOrderComponent)((function(e){return function(t){y()(a,t);var r,o,c=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=_()(r);if(o){var n=_()(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return v()(this,e)});function a(){var e;return b()(this,a),(e=c.apply(this,arguments)).state={error:null,loading:!1,category:"preview"===e.props.attributes.categoryId?e.props.attributes.previewCategory:null},e.loadCategory=e.loadCategory.bind(h()(e)),e}return m()(a,[{key:"componentDidMount",value:function(){this.loadCategory()}},{key:"componentDidUpdate",value:function(e){e.attributes.categoryId!==this.props.attributes.categoryId&&this.loadCategory()}},{key:"loadCategory",value:function(){var e=this,t=this.props.attributes.categoryId;"preview"!==t&&(t?(this.setState({loading:!0}),Object(G.d)(t).then((function(t){e.setState({category:t,loading:!1,error:null})})).catch(function(){var t=M()(L.a.mark((function t(r){var n;return L.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,Object(H.a)(r);case 2:n=t.sent,e.setState({category:null,loading:!1,error:n});case 4:case"end":return t.stop()}}),t)})));return function(_x){return t.apply(this,arguments)}}())):this.setState({category:null,loading:!1,error:null}))}},{key:"render",value:function(){var t=this.state,r=t.error,o=t.loading,c=t.category;return Object(n.createElement)(e,p()({},this.props,{error:r,getCategory:this.loadCategory,isLoading:o,category:c}))}}]),a}(n.Component)}),"withCategory");function z(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function V(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?z(Object(r),!0).forEach((function(t){S()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):z(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var $=Object(A.compose)([F,Object(c.withColors)({overlayColor:"background-color"}),C.withSpokenMessages,Object(R.withSelect)((function(e,t,r){var n,o,c=t.clientId,a=r.dispatch,i=e("core/block-editor").getBlock(c),u=(null==i||null===(n=i.innerBlocks[0])||void 0===n?void 0:n.clientId)||"";return{updateBlockAttributes:function(e){u&&a("core/block-editor").updateBlockAttributes(u,e)},currentButtonAttributes:(null==i||null===(o=i.innerBlocks[0])||void 0===o?void 0:o.attributes)||{}}})),Object(A.createHigherOrderComponent)((function(e){return function(t){y()(a,t);var r,o,c=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=_()(r);if(o){var n=_()(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return v()(this,e)});function a(){var e;b()(this,a);for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return e=c.call.apply(c,[this].concat(r)),S()(h()(e),"state",{doUrlUpdate:!1}),S()(h()(e),"triggerUrlUpdate",(function(){e.setState({doUrlUpdate:!0})})),e}return m()(a,[{key:"componentDidUpdate",value:function(){var e=this.props,t=e.attributes,r=e.updateBlockAttributes,n=e.currentButtonAttributes,o=e.category;this.state.doUrlUpdate&&!t.editMode&&null!=o&&o.permalink&&null!=n&&n.url&&o.permalink!==n.url&&(r(V(V({},n),{},{url:o.permalink})),this.setState({doUrlUpdate:!1}))}},{key:"render",value:function(){return Object(n.createElement)(e,p()({triggerUrlUpdate:this.triggerUrlUpdate},this.props))}}]),a}(n.Component)}),"withUpdateButtonAttributes")])((function(e){var t,r,a,l,d,p,g,b=e.attributes,f=e.isSelected,m=e.setAttributes,w=e.error,h=e.getCategory,O=e.isLoading,y=e.category,j=e.overlayColor,v=e.setOverlayColor,k=e.debouncedSpeak,_=e.triggerUrlUpdate,E=void 0===_?function(){}:_,S=b.editMode;return w?Object(n.createElement)(B.a,{className:"wc-block-featured-category-error",error:w,isLoading:O,onRetry:h}):S?Object(n.createElement)(C.Placeholder,{icon:Object(n.createElement)(u.a,{srcElement:s}),label:Object(o.__)("Featured Category",'woocommerce'),className:"wc-block-featured-category"},Object(o.__)("Visually highlight a product category and encourage prompt action.",'woocommerce'),Object(n.createElement)("div",{className:"wc-block-featured-category__selection"},Object(n.createElement)(T.a,{selected:[b.categoryId],onChange:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=e[0]?e[0].id:0;m({categoryId:t,mediaId:0,mediaSrc:""}),E()},isSingle:!0}),Object(n.createElement)(C.Button,{isPrimary:!0,onClick:function(){m({editMode:!1}),k(Object(o.__)("Showing Featured Product block preview.",'woocommerce'))}},Object(o.__)("Done",'woocommerce')))):Object(n.createElement)(n.Fragment,null,(d=b.contentAlign,p=b.mediaSrc,g=b.mediaId||function(e){return e&&Object(I.isObject)(e.image)?e.image.id:0}(y),Object(n.createElement)(c.BlockControls,null,Object(n.createElement)(c.AlignmentToolbar,{value:d,onChange:function(e){m({contentAlign:e})}}),Object(n.createElement)(c.MediaReplaceFlow,{mediaId:g,mediaURL:p,accept:"image/*",onSelect:function(e){m({mediaId:e.id,mediaSrc:e.url})},allowedTypes:["image"]}),Object(n.createElement)(C.ToolbarGroup,{controls:[{icon:"edit",title:Object(o.__)("Edit"),onClick:function(){return m({editMode:!S})},isActive:S}]}))),(t=b.mediaSrc||D(y),a=void 0===(r=b.focalPoint)?{x:.5,y:.5}:r,l="function"==typeof C.FocalPointPicker,Object(n.createElement)(c.InspectorControls,{key:"inspector"},Object(n.createElement)(C.PanelBody,{title:Object(o.__)("Content",'woocommerce')},Object(n.createElement)(C.ToggleControl,{label:Object(o.__)("Show description",'woocommerce'),checked:b.showDesc,onChange:function(){return m({showDesc:!b.showDesc})}})),Object(n.createElement)(c.PanelColorSettings,{title:Object(o.__)("Overlay",'woocommerce'),colorSettings:[{value:j.color,onChange:v,label:Object(o.__)("Overlay Color",'woocommerce')}]},!!t&&Object(n.createElement)(n.Fragment,null,Object(n.createElement)(C.RangeControl,{label:Object(o.__)("Background Opacity",'woocommerce'),value:b.dimRatio,onChange:function(e){return m({dimRatio:e})},min:0,max:100,step:10}),l&&Object(n.createElement)(C.FocalPointPicker,{label:Object(o.__)("Focal Point Picker"),url:t,value:a,onChange:function(e){return m({focalPoint:e})}}))))),y?function(){var e,t,r,a=b.className,u=b.contentAlign,l=b.dimRatio,s=b.focalPoint,d=b.height,p=b.showDesc,g=x()("wc-block-featured-category",{"is-selected":f&&"preview"!==b.productId,"is-loading":!y&&O,"is-not-found":!y&&!O,"has-background-dim":0!==l},0===(e=l)||50===e?null:"has-background-dim-".concat(10*Math.round(e/10)),"center"!==u&&"has-".concat(u,"-content"),a),w=b.mediaSrc||D(y),h=y&&(t=w)?{backgroundImage:"url(".concat(t,")")}:{};if(j.color&&(h.backgroundColor=j.color),s){var v=100*s.x,k=100*s.y;h.backgroundPosition="".concat(v,"% ").concat(k,"%")}return Object(n.createElement)(C.ResizableBox,{className:g,size:{height:d},minHeight:Object(i.getSetting)("min_height",500),enable:{bottom:!0},onResizeStop:function(e,t,r){m({height:parseInt(r.style.height,10)})},style:h},Object(n.createElement)("div",{className:"wc-block-featured-category__wrapper"},Object(n.createElement)("h2",{className:"wc-block-featured-category__title",dangerouslySetInnerHTML:{__html:y.name}}),p&&Object(n.createElement)("div",{className:"wc-block-featured-category__description",dangerouslySetInnerHTML:{__html:y.description}}),Object(n.createElement)("div",{className:"wc-block-featured-category__link"},(r=x()("wp-block-button__link","is-style-fill"),"preview"===b.categoryId?Object(n.createElement)("div",{className:"wp-block-button aligncenter",style:{width:"100%"}},Object(n.createElement)(c.RichText.Content,{tagName:"a",className:r,href:y.permalink,title:b.linkText,style:{backgroundColor:"vivid-green-cyan",borderRadius:"5px"},value:b.linkText,target:y.permalink})):Object(n.createElement)(c.InnerBlocks,{template:[["core/button",{text:Object(o.__)("Shop now",'woocommerce'),url:y.permalink,align:"center"}]],templateLock:"all"})))))}():Object(n.createElement)(C.Placeholder,{className:"wc-block-featured-category",icon:Object(n.createElement)(u.a,{srcElement:s}),label:Object(o.__)("Featured Category",'woocommerce')},O?Object(n.createElement)(C.Spinner,null):Object(o.__)("No product category is selected.",'woocommerce')))})),Q=r(37),q=[{id:1,name:Object(o.__)("Clothing",'woocommerce'),slug:"clothing",parent:0,count:10,description:"<p>".concat(Object(o.__)("Branded t-shirts, jumpers, pants and more!",'woocommerce'),"</p>\n"),image:{id:1,date_created:"2019-07-15T17:05:04",date_created_gmt:"2019-07-15T17:05:04",date_modified:"2019-07-15T17:05:04",date_modified_gmt:"2019-07-15T17:05:04",src:Q.m+"previews/collection.jpg",name:"",alt:""},permalink:"#"}],W={attributes:{contentAlign:"center",dimRatio:50,editMode:!1,height:Object(i.getSetting)("default_height",500),mediaSrc:"",showDesc:!0,categoryId:"preview",previewCategory:q[0]}};Object(a.registerBlockType)("woocommerce/featured-category",{title:Object(o.__)("Featured Category",'woocommerce'),icon:{src:Object(n.createElement)(u.a,{srcElement:s}),foreground:"#96588a"},category:"woocommerce",keywords:[Object(o.__)("WooCommerce",'woocommerce')],description:Object(o.__)("Visually highlight a product category and encourage prompt action.",'woocommerce'),supports:{align:["wide","full"],html:!1},example:W,attributes:{contentAlign:{type:"string",default:"center"},dimRatio:{type:"number",default:50},editMode:{type:"boolean",default:!0},focalPoint:{type:"object"},height:{type:"number",default:Object(i.getSetting)("default_height",500)},mediaId:{type:"number",default:0},mediaSrc:{type:"string",default:""},overlayColor:{type:"string"},customOverlayColor:{type:"string"},linkText:{type:"string",default:Object(o.__)("Shop now",'woocommerce')},categoryId:{type:"number"},showDesc:{type:"boolean",default:!0},previewCategory:{type:"object",default:null}},edit:function(e){return Object(n.createElement)($,e)},save:function(){return Object(n.createElement)(c.InnerBlocks.Content,null)}})},87:function(e,t){e.exports=window.ReactDOM},89:function(e,t){e.exports=window.wp.viewport},96:function(e,t){e.exports=window.wp.date},97:function(e,t,r){"use strict";var n=r(9),o=r.n(n),c=r(0),a=r(1),i=(r(2),r(49)),u=r(4),l=r(29),s=r.n(l),d=r(17),p=r.n(d),g=r(18),b=r.n(g),f=r(13),m=r.n(f),w=r(19),h=r.n(w),O=r(20),y=r.n(O),j=r(10),v=r.n(j),k=r(22),_=r.n(k),E=r(21),S=r(39),C=r(42);var P=Object(E.createHigherOrderComponent)((function(e){return function(t){h()(i,t);var r,n,a=(r=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=v()(r);if(n){var o=v()(this).constructor;e=Reflect.construct(t,arguments,o)}else e=t.apply(this,arguments);return y()(this,e)});function i(){var e;return p()(this,i),(e=a.apply(this,arguments)).state={error:null,loading:!1,categories:[]},e.loadCategories=e.loadCategories.bind(m()(e)),e}return b()(i,[{key:"componentDidMount",value:function(){this.loadCategories()}},{key:"loadCategories",value:function(){var e=this;this.setState({loading:!0}),Object(S.c)().then((function(t){e.setState({categories:t,loading:!1,error:null})})).catch(function(){var t=s()(_.a.mark((function t(r){var n;return _.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,Object(C.a)(r);case 2:n=t.sent,e.setState({categories:[],loading:!1,error:n});case 4:case"end":return t.stop()}}),t)})));return function(_x){return t.apply(this,arguments)}}())}},{key:"render",value:function(){var t=this.state,r=t.error,n=t.loading,a=t.categories;return Object(c.createElement)(e,o()({},this.props,{error:r,isLoading:n,categories:a}))}}]),i}(c.Component)}),"withCategories"),x=r(52),R=r(6),A=r.n(R),T=(r(139),function(e){var t=e.categories,r=e.error,n=e.isLoading,l=e.onChange,s=e.onOperatorChange,d=e.operator,p=e.selected,g=e.isCompact,b=e.isSingle,f=e.showReviewCount,m={clear:Object(a.__)("Clear all product categories",'woocommerce'),list:Object(a.__)("Product Categories",'woocommerce'),noItems:Object(a.__)("Your store doesn't have any product categories.",'woocommerce'),search:Object(a.__)("Search for product categories",'woocommerce'),selected:function(e){return Object(a.sprintf)(
/* translators: %d is the count of selected categories. */
Object(a._n)("%d category selected","%d categories selected",e,'woocommerce'),e)},updated:Object(a.__)("Category search results updated.",'woocommerce')};return r?Object(c.createElement)(x.a,{error:r}):Object(c.createElement)(c.Fragment,null,Object(c.createElement)(i.b,{className:"woocommerce-product-categories",list:t,isLoading:n,selected:p.map((function(e){return t.find((function(t){return t.id===e}))})).filter(Boolean),onChange:l,renderItem:function(e){var t=e.item,r=e.search,n=e.depth,u=void 0===n?0:n,l=t.breadcrumbs.length?"".concat(t.breadcrumbs.join(", "),", ").concat(t.name):t.name,s=f?Object(a.sprintf)(
/* translators: %1$s is the item name, %2$d is the count of reviews for the item. */
Object(a._n)("%1$s, has %2$d review","%1$s, has %2$d reviews",t.review_count,'woocommerce'),l,t.review_count):Object(a.sprintf)(
/* translators: %1$s is the item name, %2$d is the count of products for the item. */
Object(a._n)("%1$s, has %2$d product","%1$s, has %2$d products",t.count,'woocommerce'),l,t.count),d=f?Object(a.sprintf)(
/* translators: %d is the count of reviews. */
Object(a._n)("%d review","%d reviews",t.review_count,'woocommerce'),t.review_count):Object(a.sprintf)(
/* translators: %d is the count of products. */
Object(a._n)("%d product","%d products",t.count,'woocommerce'),t.count);return Object(c.createElement)(i.c,o()({className:A()("woocommerce-product-categories__item","has-count",{"is-searching":r.length>0,"is-skip-level":0===u&&0!==t.parent})},e,{countLabel:d,"aria-label":s}))},messages:m,isCompact:g,isHierarchical:!0,isSingle:b}),!!s&&Object(c.createElement)("div",{hidden:p.length<2},Object(c.createElement)(u.SelectControl,{className:"woocommerce-product-categories__operator",label:Object(a.__)("Display products matching",'woocommerce'),help:Object(a.__)("Pick at least two categories to use this setting.",'woocommerce'),value:d,onChange:s,options:[{label:Object(a.__)("Any selected categories",'woocommerce'),value:"any"},{label:Object(a.__)("All selected categories",'woocommerce'),value:"all"}]})))});T.defaultProps={operator:"any",isCompact:!1,isSingle:!1},t.a=P(T)}});woocommerce-blocks/build/checkout.js000064400000646605151335517640013633 0ustar00this.wc=this.wc||{},this.wc.blocks=this.wc.blocks||{},this.wc.blocks.checkout=function(e){function t(t){for(var r,a,s=t[0],i=t[1],l=t[2],p=0,d=[];p<s.length;p++)a=s[p],Object.prototype.hasOwnProperty.call(c,a)&&c[a]&&d.push(c[a][0]),c[a]=0;for(r in i)Object.prototype.hasOwnProperty.call(i,r)&&(e[r]=i[r]);for(u&&u(t);d.length;)d.shift()();return o.push.apply(o,l||[]),n()}function n(){for(var e,t=0;t<o.length;t++){for(var n=o[t],r=!0,s=1;s<n.length;s++){var i=n[s];0!==c[i]&&(r=!1)}r&&(o.splice(t--,1),e=a(a.s=n[0]))}return e}var r={},c={22:0,1:0},o=[];function a(t){if(r[t])return r[t].exports;var n=r[t]={i:t,l:!1,exports:{}};return e[t].call(n.exports,n,n.exports,a),n.l=!0,n.exports}a.m=e,a.c=r,a.d=function(e,t,n){a.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},a.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},a.t=function(e,t){if(1&t&&(e=a(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(a.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)a.d(n,r,function(t){return e[t]}.bind(null,r));return n},a.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return a.d(t,"a",t),t},a.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},a.p="";var s=window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[],i=s.push.bind(s);s.push=t,s=s.slice();for(var l=0;l<s.length;l++)t(s[l]);var u=i;return o.push([821,0]),n()}({0:function(e,t){e.exports=window.wp.element},1:function(e,t){e.exports=window.wp.i18n},11:function(e,t){e.exports=window.React},110:function(e,t,n){"use strict";var r=n(0),c=n(6),o=n.n(c);n(262),t.a=function(e){var t=e.children,n=e.className;return Object(r.createElement)("div",{className:o()("wc-block-components-product-badge",n)},t)}},113:function(e,t,n){"use strict";var r=n(5),c=n.n(r),o=n(8),a=n.n(o),s=n(3),i=n(1),l=n(72);function u(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function p(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?u(Object(n),!0).forEach((function(t){c()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):u(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var d=Object(s.getSetting)("countryLocale",{}),b=function(e){var t={};return void 0!==e.label&&(t.label=e.label),void 0!==e.required&&(t.required=e.required),void 0!==e.hidden&&(t.hidden=e.hidden),void 0===e.label||e.optionalLabel||(t.optionalLabel=Object(i.sprintf)(
/* translators: %s Field label. */
Object(i.__)("%s (optional)",'woocommerce'),e.label)),e.priority&&(Object(l.a)(e.priority)&&(t.index=e.priority),Object(l.c)(e.priority)&&(t.index=parseInt(e.priority,10))),e.hidden&&(t.required=!1),t},m=Object.entries(d).map((function(e){var t=a()(e,2),n=t[0],r=t[1];return[n,Object.entries(r).map((function(e){var t=a()(e,2),n=t[0],r=t[1];return[n,b(r)]})).reduce((function(e,t){var n=a()(t,2),r=n[0],c=n[1];return e[r]=c,e}),{})]})).reduce((function(e,t){var n=a()(t,2),r=n[0],c=n[1];return e[r]=c,e}),{});t.a=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",r=n&&void 0!==m[n]?m[n]:{};return e.map((function(e){var n=s.defaultAddressFields[e]||{},c=r[e]||{},o=t[e]||{};return p(p(p({key:e},n),c),o)})).sort((function(e,t){return e.index-t.index}))}},114:function(e,t,n){"use strict";var r=n(0);n(209),t.a=function(){return Object(r.createElement)("span",{className:"wc-block-components-spinner","aria-hidden":"true"})}},119:function(e,t){e.exports=window.wp.wordcount},12:function(e,t){e.exports=window.wp.blockEditor},124:function(e,t,n){"use strict";var r=n(5),c=n.n(r),o=n(0),a=n(1),s=n(53),i=n(6),l=n.n(i),u=(n(2),n(47)),p=(n(206),function(e){var t=e.currency,n=e.maxPrice,r=e.minPrice,c=e.priceClassName,i=e.priceStyle;return Object(o.createElement)(o.Fragment,null,Object(o.createElement)("span",{className:"screen-reader-text"},Object(a.sprintf)(
/* translators: %1$s min price, %2$s max price */
Object(a.__)("Price between %1$s and %2$s",'woocommerce'),Object(u.formatPrice)(r),Object(u.formatPrice)(n))),Object(o.createElement)("span",{"aria-hidden":!0},Object(o.createElement)(s.a,{className:l()("wc-block-components-product-price__value",c),currency:t,value:r,style:i})," — ",Object(o.createElement)(s.a,{className:l()("wc-block-components-product-price__value",c),currency:t,value:n,style:i})))}),d=function(e){var t=e.currency,n=e.regularPriceClassName,r=e.regularPriceStyle,c=e.regularPrice,i=e.priceClassName,u=e.priceStyle,p=e.price;return Object(o.createElement)(o.Fragment,null,Object(o.createElement)("span",{className:"screen-reader-text"},Object(a.__)("Previous price:",'woocommerce')),Object(o.createElement)(s.a,{currency:t,renderText:function(e){return Object(o.createElement)("del",{className:l()("wc-block-components-product-price__regular",n),style:r},e)},value:c}),Object(o.createElement)("span",{className:"screen-reader-text"},Object(a.__)("Discounted price:",'woocommerce')),Object(o.createElement)(s.a,{currency:t,renderText:function(e){return Object(o.createElement)("ins",{className:l()("wc-block-components-product-price__value","is-discounted",i),style:u},e)},value:p}))};t.a=function(e){var t=e.align,n=e.className,r=e.currency,a=e.format,i=void 0===a?"<price/>":a,u=e.maxPrice,b=void 0===u?null:u,m=e.minPrice,f=void 0===m?null:m,O=e.price,g=void 0===O?null:O,h=e.priceClassName,j=e.priceStyle,v=e.regularPrice,E=e.regularPriceClassName,y=e.regularPriceStyle,_=l()(n,"price","wc-block-components-product-price",c()({},"wc-block-components-product-price--align-".concat(t),t));i.includes("<price/>")||(i="<price/>",console.error("Price formats need to include the `<price/>` tag."));var w=v&&g!==v,k=Object(o.createElement)("span",{className:l()("wc-block-components-product-price__value",h)});return w?k=Object(o.createElement)(d,{currency:r,price:g,priceClassName:h,priceStyle:j,regularPrice:v,regularPriceClassName:E,regularPriceStyle:y}):null!==f&&null!==b?k=Object(o.createElement)(p,{currency:r,maxPrice:b,minPrice:f,priceClassName:h,priceStyle:j}):null!==g&&(k=Object(o.createElement)(s.a,{className:l()("wc-block-components-product-price__value",h),currency:r,value:g,style:j})),Object(o.createElement)("span",{className:_},Object(o.createInterpolateElement)(i,{price:k}))}},125:function(e,t,n){"use strict";var r=n(17),c=n.n(r),o=n(18),a=n.n(o),s=n(13),i=n.n(s),l=n(19),u=n.n(l),p=n(20),d=n.n(p),b=n(10),m=n.n(b),f=n(5),O=n.n(f),g=n(0),h=(n(2),n(11)),j=n(1),v=n(37),E=function(e){var t=e.imageUrl,n=void 0===t?"".concat(v.m,"/block-error.svg"):t,r=e.header,c=void 0===r?Object(j.__)("Oops!",'woocommerce'):r,o=e.text,a=void 0===o?Object(j.__)("There was an error loading the content.",'woocommerce'):o,s=e.errorMessage,i=e.errorMessagePrefix,l=void 0===i?Object(j.__)("Error:",'woocommerce'):i,u=e.button;return Object(g.createElement)("div",{className:"wc-block-error wc-block-components-error"},n&&Object(g.createElement)("img",{className:"wc-block-error__image wc-block-components-error__image",src:n,alt:""}),Object(g.createElement)("div",{className:"wc-block-error__content wc-block-components-error__content"},c&&Object(g.createElement)("p",{className:"wc-block-error__header wc-block-components-error__header"},c),a&&Object(g.createElement)("p",{className:"wc-block-error__text wc-block-components-error__text"},a),s&&Object(g.createElement)("p",{className:"wc-block-error__message wc-block-components-error__message"},l?l+" ":"",s),u&&Object(g.createElement)("p",{className:"wc-block-error__button wc-block-components-error__button"},u)))};n(218);var y=function(e){u()(o,e);var t,n,r=(t=o,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=m()(t);if(n){var c=m()(this).constructor;e=Reflect.construct(r,arguments,c)}else e=r.apply(this,arguments);return d()(this,e)});function o(){var e;c()(this,o);for(var t=arguments.length,n=new Array(t),a=0;a<t;a++)n[a]=arguments[a];return e=r.call.apply(r,[this].concat(n)),O()(i()(e),"state",{errorMessage:"",hasError:!1}),e}return a()(o,[{key:"render",value:function(){var e=this.props,t=e.header,n=e.imageUrl,r=e.showErrorMessage,c=e.text,o=e.errorMessagePrefix,a=e.renderError,s=e.button,i=this.state,l=i.errorMessage;return i.hasError?"function"==typeof a?a({errorMessage:l}):Object(g.createElement)(E,{errorMessage:r?l:null,header:t,imageUrl:n,text:c,errorMessagePrefix:o,button:s}):this.props.children}}],[{key:"getDerivedStateFromError",value:function(e){return void 0!==e.statusText&&void 0!==e.status?{errorMessage:Object(g.createElement)(g.Fragment,null,Object(g.createElement)("strong",null,e.status),": ",e.statusText),hasError:!0}:{errorMessage:e.message,hasError:!0}}}]),o}(h.Component);y.defaultProps={showErrorMessage:!0},t.a=y},126:function(e,t,n){"use strict";n.d(t,"a",(function(){return l})),n.d(t,"b",(function(){return p}));var r,c=n(5),o=n.n(c),a=n(7);function s(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function i(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?s(Object(n),!0).forEach((function(t){o()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):s(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}!function(e){e.ADD_EVENT_CALLBACK="add_event_callback",e.REMOVE_EVENT_CALLBACK="remove_event_callback"}(r||(r={}));var l={addEventCallback:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:10;return{id:Object(a.uniqueId)(),type:r.ADD_EVENT_CALLBACK,eventType:e,callback:t,priority:n}},removeEventCallback:function(e,t){return{id:t,type:r.REMOVE_EVENT_CALLBACK,eventType:e}}},u={},p=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:u,t=arguments.length>1?arguments[1]:void 0,n=t.type,c=t.eventType,a=t.id,s=t.callback,l=t.priority,p=e.hasOwnProperty(c)?new Map(e[c]):new Map;switch(n){case r.ADD_EVENT_CALLBACK:return p.set(a,{priority:l,callback:s}),i(i({},e),{},o()({},c,p));case r.REMOVE_EVENT_CALLBACK:return p.delete(a),i(i({},e),{},o()({},c,p))}}},127:function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var r=n(8),c=n.n(r),o=n(0),a=function(){var e=Object(o.useState)(),t=c()(e,2)[1];return Object(o.useCallback)((function(e){t((function(){throw e}))}),[])}},129:function(e,t,n){"use strict";var r=n(0);t.a=function(e){var t=e.label,n=e.secondaryLabel,c=e.description,o=e.secondaryDescription,a=e.id;return Object(r.createElement)("div",{className:"wc-block-components-radio-control__option-layout"},Object(r.createElement)("div",{className:"wc-block-components-radio-control__label-group"},t&&Object(r.createElement)("span",{id:a&&"".concat(a,"__label"),className:"wc-block-components-radio-control__label"},t),n&&Object(r.createElement)("span",{id:a&&"".concat(a,"__secondary-label"),className:"wc-block-components-radio-control__secondary-label"},n)),Object(r.createElement)("div",{className:"wc-block-components-radio-control__description-group"},c&&Object(r.createElement)("span",{id:a&&"".concat(a,"__description"),className:"wc-block-components-radio-control__description"},c),o&&Object(r.createElement)("span",{id:a&&"".concat(a,"__secondary-description"),className:"wc-block-components-radio-control__secondary-description"},o)))}},132:function(e,t,n){"use strict";n.d(t,"b",(function(){return j})),n.d(t,"a",(function(){return v}));var r=n(38),c=n.n(r),o=n(5),a=n.n(o),s=n(16),i=n.n(s),l=n(8),u=n.n(l),p=n(0),d=n(7),b=n(34),m=n.n(b);function f(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function O(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?f(Object(n),!0).forEach((function(t){a()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):f(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function g(e){var t=function(e,t){if("object"!==c()(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==c()(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===c()(t)?t:String(t)}var h=Object(p.createContext)({getValidationError:function(){return""},setValidationErrors:function(e){},clearValidationError:function(e){},clearAllValidationErrors:function(){},hideValidationError:function(){},showValidationError:function(){},showAllValidationErrors:function(){},hasValidationErrors:!1,getValidationErrorId:function(e){return e}}),j=function(){return Object(p.useContext)(h)},v=function(e){var t=e.children,n=Object(p.useState)({}),r=u()(n,2),c=r[0],o=r[1],s=Object(p.useCallback)((function(e){return c[e]}),[c]),l=Object(p.useCallback)((function(e){var t=c[e];return!t||t.hidden?"":"validate-error-".concat(e)}),[c]),b=Object(p.useCallback)((function(e){o((function(t){return t[e]?(t[e],i()(t,[e].map(g))):t}))}),[]),f=Object(p.useCallback)((function(){o({})}),[]),j=Object(p.useCallback)((function(e){e&&o((function(t){return e=Object(d.pickBy)(e,(function(e,n){return!("string"!=typeof e.message||t.hasOwnProperty(n)&&m()(t[n],e))})),0===Object.values(e).length?t:O(O({},t),e)}))}),[]),v=Object(p.useCallback)((function(e,t){o((function(n){if(!n.hasOwnProperty(e))return n;var r=O(O({},n[e]),t);return m()(n[e],r)?n:O(O({},n),{},a()({},e,r))}))}),[]),E={getValidationError:s,setValidationErrors:j,clearValidationError:b,clearAllValidationErrors:f,hideValidationError:Object(p.useCallback)((function(e){v(e,{hidden:!0})}),[v]),showValidationError:Object(p.useCallback)((function(e){v(e,{hidden:!1})}),[v]),showAllValidationErrors:Object(p.useCallback)((function(){o((function(e){var t={};return Object.keys(e).forEach((function(n){e[n].hidden&&(t[n]=O(O({},e[n]),{},{hidden:!1}))})),0===Object.values(t).length?e:O(O({},e),t)}))}),[]),hasValidationErrors:Object.keys(c).length>0,getValidationErrorId:l};return Object(p.createElement)(h.Provider,{value:E},t)}},134:function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var r=n(14),c=n(0),o=n(24),a=n(127),s=function(){var e=Object(a.a)(),t=Object(r.useDispatch)(o.CART_STORE_KEY).selectShippingRate;return{selectShippingRate:Object(c.useCallback)((function(n,r){t(n,r).catch((function(t){e(t)}))}),[e,t]),isSelectingRate:Object(r.useSelect)((function(e){return e(o.CART_STORE_KEY).isShippingRateBeingSelected()}),[])}}},135:function(e,t,n){"use strict";var r=n(9),c=n.n(r),o=n(16),a=n.n(o),s=n(0),i=n(6),l=n.n(i),u=(n(2),n(260),["children","className","headingLevel"]);t.a=function(e){var t=e.children,n=e.className,r=e.headingLevel,o=a()(e,u),i=l()("wc-block-components-title",n),p="h".concat(r);return Object(s.createElement)(p,c()({className:i},o),t)}},136:function(e,t,n){"use strict";n.d(t,"a",(function(){return c}));var r=n(11);function c(e,t){var n=Object(r.useRef)();return Object(r.useEffect)((function(){n.current===e||t&&!t(e,n.current)||(n.current=e)}),[e,t]),n.current}},14:function(e,t){e.exports=window.wp.data},140:function(e,t,n){"use strict";var r=n(5),c=n.n(r),o=n(0),a=n(6),s=n.n(a),i=n(129);t.a=function(e){var t,n=e.checked,r=e.name,a=e.onChange,l=e.option,u=l.value,p=l.label,d=l.description,b=l.secondaryLabel,m=l.secondaryDescription;return Object(o.createElement)("label",{className:s()("wc-block-components-radio-control__option",{"wc-block-components-radio-control__option-checked":n}),htmlFor:"".concat(r,"-").concat(u)},Object(o.createElement)("input",{id:"".concat(r,"-").concat(u),className:"wc-block-components-radio-control__input",type:"radio",name:r,value:u,onChange:function(e){return a(e.target.value)},checked:n,"aria-describedby":s()((t={},c()(t,"".concat(r,"-").concat(u,"__label"),p),c()(t,"".concat(r,"-").concat(u,"__secondary-label"),b),c()(t,"".concat(r,"-").concat(u,"__description"),d),c()(t,"".concat(r,"-").concat(u,"__secondary-description"),m),t))}),Object(o.createElement)(i.a,{id:"".concat(r,"-").concat(u),label:p,secondaryLabel:b,description:d,secondaryDescription:m}))}},141:function(e,t,n){"use strict";n.d(t,"b",(function(){return E})),n.d(t,"a",(function(){return y}));var r=n(5),c=n.n(r),o=n(8),a=n.n(o),s=n(0),i=(n(2),n(14)),l=n(68),u=n(63),p=n(9),d=n.n(p),b=n(6),m=n.n(b),f=n(890),O=(n(207),function(e){var t=e.status;switch(void 0===t?"default":t){case"error":return"woocommerce-error";case"success":return"woocommerce-message";case"info":case"warning":return"woocommerce-info"}return""}),g=function(e){var t=e.className,n=e.notices,r=e.removeNotice,c=n.filter((function(e){return"snackbar"!==e.type}));if(!c.length)return null;var o=m()(t,"wc-block-components-notices");return Object(s.createElement)("div",{className:o},c.map((function(e){return Object(s.createElement)(f.a,d()({key:"store-notice-"+e.id},e,{className:m()("wc-block-components-notices__notice",O(e)),onRemove:function(){e.isDismissible&&r(e.id)}}),e.content)})))};function h(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function j(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?h(Object(n),!0).forEach((function(t){c()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):h(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var v=Object(s.createContext)({notices:[],createNotice:function(e,t,n){},removeNotice:function(e,t){},setIsSuppressed:function(e){},context:"wc/core"}),E=function(){return Object(s.useContext)(v)},y=function(e){var t=e.children,n=e.className,r=void 0===n?"":n,c=e.createNoticeContainer,o=void 0===c||c,p=e.context,d=void 0===p?"wc/core":p,b=Object(i.useDispatch)("core/notices"),m=b.createNotice,f=b.removeNotice,O=Object(s.useState)(!1),h=a()(O,2),E=h[0],y=h[1],_=Object(l.a)().dispatchStoreEvent,w=Object(u.b)().isEditor,k=Object(s.useCallback)((function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};m(e,t,j(j({},n),{},{context:n.context||d})),_("store-notice-create",{status:e,content:t,options:n})}),[m,_,d]),S=Object(s.useCallback)((function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:d;f(e,t)}),[f,d]),C={notices:Object(i.useSelect)((function(e){return{notices:e("core/notices").getNotices(d)}}),[d]).notices,createNotice:k,removeNotice:S,context:d,setIsSuppressed:y},P=E?null:Object(s.createElement)(g,{className:r,notices:C.notices,removeNotice:C.removeNotice,isEditor:w});return Object(s.createElement)(v.Provider,{value:C},o&&P,t)}},142:function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(8),c=n.n(r),o=function(e){return e.reduce((function(e,t){var n=c()(t,2),r=n[0],o=n[1];return e[r]=o,e}),{})}},15:function(e,t){e.exports=window.wp.apiFetch},154:function(e,t,n){"use strict";var r=n(9),c=n.n(r),o=n(16),a=n.n(o),s=n(0),i=n(25),l=n(6),u=n.n(l),p=(n(205),["className","disabled","name","permalink"]);t.a=function(e){var t=e.className,n=void 0===t?"":t,r=e.disabled,o=void 0!==r&&r,l=e.name,d=e.permalink,b=void 0===d?"":d,m=a()(e,p),f=u()("wc-block-components-product-name",n);return o?Object(s.createElement)("span",c()({className:f},m,{dangerouslySetInnerHTML:{__html:Object(i.decodeEntities)(l)}})):Object(s.createElement)("a",c()({className:f,href:b},m,{dangerouslySetInnerHTML:{__html:Object(i.decodeEntities)(l)}}))}},155:function(e,t,n){"use strict";var r=n(0),c=n(119),o=n(91),a=function(e){var t=e.indexOf("</p>");return-1===t?e:e.substr(0,t+4)},s=function(e){return e.replace(/<\/?[a-z][^>]*?>/gi,"")},i=function(e,t){return e.replace(/[\s|\.\,]+$/i,"")+t},l=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"&hellip;",r=s(e),c=r.split(" ").splice(0,t).join(" ");return Object(o.autop)(i(c,n))},u=function(e,t){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"&hellip;",c=s(e),a=c.slice(0,t);if(n)return Object(o.autop)(i(a,r));var l=a.match(/([\s]+)/g),u=l?l.length:0,p=c.slice(0,t+u);return Object(o.autop)(i(p,r))};t.a=function(e){var t=e.source,n=e.maxLength,s=void 0===n?15:n,i=e.countType,p=void 0===i?"words":i,d=e.className,b=void 0===d?"":d,m=Object(r.useMemo)((function(){return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:15,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"words",r=Object(o.autop)(e),s=Object(c.count)(r,n);if(s<=t)return r;var i=a(r),p=Object(c.count)(i,n);return p<=t?i:"words"===n?l(i,t):u(i,t,"characters_including_spaces"===n)}(t,s,p)}),[t,s,p]);return Object(r.createElement)(r.RawHTML,{className:b},m)}},158:function(e,t,n){"use strict";var r=n(0),c=n(28),o=Object(r.createElement)(c.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(r.createElement)("mask",{id:"external-mask",width:"24",height:"24",x:"0",y:"0",maskUnits:"userSpaceOnUse"},Object(r.createElement)("path",{fill:"#fff",d:"M6.3431 6.3431v1.994l7.8984.0072-8.6055 8.6054 1.4142 1.4143 8.6055-8.6055.0071 7.8984h1.994V6.3431H6.3431z"})),Object(r.createElement)("g",{mask:"url(#external-mask)"},Object(r.createElement)("path",{d:"M0 0h24v24H0z"})));t.a=o},159:function(e,t,n){"use strict";n.d(t,"c",(function(){return o})),n.d(t,"d",(function(){return a})),n.d(t,"a",(function(){return s})),n.d(t,"b",(function(){return i}));var r=n(26),c=n(37),o=function(e,t){if(c.n>2)return Object(r.registerBlockType)(e,t)},a=function(e,t){if(c.n>1)return Object(r.registerBlockType)(e,t)},s=function(){return c.n>2},i=function(){return c.n>1}},162:function(e,t,n){"use strict";n.d(t,"b",(function(){return a})),n.d(t,"c",(function(){return s})),n.d(t,"a",(function(){return i}));var r=n(3),c=n(113),o=n(23),a=function(e){var t=e.country,n=void 0===t?"":t,r=e.state,c=void 0===r?"":r,o=e.city,a=void 0===o?"":o,s=e.postcode,i=void 0===s?"":s;return{country:n.trim(),state:c.trim(),city:a.trim(),postcode:i?i.replace(" ","").toUpperCase():""}},s=function(e){var t=e.email,n=void 0===t?"":t;return Object(o.isEmail)(n)?n.trim():""},i=function(e){var t=Object.keys(r.defaultAddressFields),n=Object(c.a)(t,{},e.country),o=Object.assign({},e);return n.forEach((function(t){var n=t.key,r=void 0===n?"":n,c=t.hidden;void 0!==c&&c&&function(e,t){return e in t}(r,e)&&(o[r]="")})),o}},163:function(e,t,n){"use strict";n.d(t,"b",(function(){return a})),n.d(t,"a",(function(){return s}));var r=n(62),c=n(174),o=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=Object(c.b)(),n=t.paymentMethods,o=t.expressPaymentMethods,a=t.paymentMethodsInitialized,s=t.expressPaymentMethodsInitialized,i=Object(r.a)(n),l=Object(r.a)(o);return{paymentMethods:e?l:i,isInitialized:e?s:a}},a=function(){return o(!1)},s=function(){return o(!0)}},167:function(e,t,n){"use strict";var r=n(0),c=n(6),o=n.n(c),a=n(21),s=n(140);n(272),t.a=Object(a.withInstanceId)((function(e){var t=e.className,n=e.instanceId,c=e.id,a=e.selected,i=e.onChange,l=e.options,u=void 0===l?[]:l,p=c||n;return u.length&&Object(r.createElement)("div",{className:o()("wc-block-components-radio-control",t)},u.map((function(e){return Object(r.createElement)(s.a,{key:"".concat(p,"-").concat(e.value),name:"radio-control-".concat(p),checked:e.value===a,option:e,onChange:function(t){i(t),"function"==typeof e.onChange&&e.onChange(t)}})})))}))},168:function(e,t,n){"use strict";var r=n(17),c=n.n(r),o=n(18),a=n.n(o),s=n(13),i=n.n(s),l=n(19),u=n.n(l),p=n(20),d=n.n(p),b=n(10),m=n.n(b),f=n(5),O=n.n(f),g=n(0),h=n(1),j=n(11),v=(n(2),n(3)),E=n(44);var y=function(e){u()(o,e);var t,n,r=(t=o,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=m()(t);if(n){var c=m()(this).constructor;e=Reflect.construct(r,arguments,c)}else e=r.apply(this,arguments);return d()(this,e)});function o(){var e;c()(this,o);for(var t=arguments.length,n=new Array(t),a=0;a<t;a++)n[a]=arguments[a];return e=r.call.apply(r,[this].concat(n)),O()(i()(e),"state",{errorMessage:"",hasError:!1}),e}return a()(o,[{key:"render",value:function(){var e=this.state,t=e.hasError,n=e.errorMessage,r=this.props.isEditor;if(t){var c=Object(h.__)("This site is experiencing difficulties with this payment method. Please contact the owner of the site for assistance.",'woocommerce');(r||v.CURRENT_USER_IS_ADMIN)&&(c=n||Object(h.__)("There was an error with this payment method. Please verify it's configured correctly.",'woocommerce'));var o=[{id:"0",content:c,isDismissible:!1,status:"error"}];return Object(g.createElement)(E.StoreNoticesContainer,{notices:o})}return this.props.children}}],[{key:"getDerivedStateFromError",value:function(e){return{errorMessage:e.message,hasError:!0}}}]),o}(j.Component);y.defaultProps={isEditor:!1},t.a=y},169:function(e,t,n){"use strict";var r=n(9),c=n.n(r),o=n(5),a=n.n(o),s=n(0),i=n(6),l=n.n(i),u=function(e){return"wc-block-components-payment-method-icon wc-block-components-payment-method-icon--".concat(e)},p=function(e){var t=e.id,n=e.src,r=void 0===n?null:n,c=e.alt,o=void 0===c?"":c;return r?Object(s.createElement)("img",{className:u(t),src:r,alt:o}):null},d=n(37),b=[{id:"alipay",alt:"Alipay",src:d.m+"payment-methods/alipay.svg"},{id:"amex",alt:"American Express",src:d.m+"payment-methods/amex.svg"},{id:"bancontact",alt:"Bancontact",src:d.m+"payment-methods/bancontact.svg"},{id:"diners",alt:"Diners Club",src:d.m+"payment-methods/diners.svg"},{id:"discover",alt:"Discover",src:d.m+"payment-methods/discover.svg"},{id:"eps",alt:"EPS",src:d.m+"payment-methods/eps.svg"},{id:"giropay",alt:"Giropay",src:d.m+"payment-methods/giropay.svg"},{id:"ideal",alt:"iDeal",src:d.m+"payment-methods/ideal.svg"},{id:"jcb",alt:"JCB",src:d.m+"payment-methods/jcb.svg"},{id:"laser",alt:"Laser",src:d.m+"payment-methods/laser.svg"},{id:"maestro",alt:"Maestro",src:d.m+"payment-methods/maestro.svg"},{id:"mastercard",alt:"Mastercard",src:d.m+"payment-methods/mastercard.svg"},{id:"multibanco",alt:"Multibanco",src:d.m+"payment-methods/multibanco.svg"},{id:"p24",alt:"Przelewy24",src:d.m+"payment-methods/p24.svg"},{id:"sepa",alt:"Sepa",src:d.m+"payment-methods/sepa.svg"},{id:"sofort",alt:"Sofort",src:d.m+"payment-methods/sofort.svg"},{id:"unionpay",alt:"Union Pay",src:d.m+"payment-methods/unionpay.svg"},{id:"visa",alt:"Visa",src:d.m+"payment-methods/visa.svg"},{id:"wechat",alt:"WeChat",src:d.m+"payment-methods/wechat.svg"}],m=n(38),f=n.n(m),O=n(72);function g(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function h(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?g(Object(n),!0).forEach((function(t){a()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):g(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}n(275),t.a=function(e){var t=e.icons,n=void 0===t?[]:t,r=e.align,o=void 0===r?"center":r,a=function(e){var t={};return e.forEach((function(e){var n={};"string"==typeof e&&(n={id:e,alt:e,src:null}),"object"===f()(e)&&(n={id:e.id||"",alt:e.alt||"",src:e.src||null}),n.id&&Object(O.c)(n.id)&&!t[n.id]&&(t[n.id]=n)})),Object.values(t)}(n);if(0===a.length)return null;var i=l()("wc-block-components-payment-method-icons",{"wc-block-components-payment-method-icons--align-left":"left"===o,"wc-block-components-payment-method-icons--align-right":"right"===o});return Object(s.createElement)("div",{className:i},a.map((function(e){var t,n=h(h({},e),(t=e.id,b.find((function(e){return e.id===t}))||{}));return Object(s.createElement)(p,c()({key:"payment-method-icon-"+e.id},n))})))}},174:function(e,t,n){"use strict";n.d(t,"b",(function(){return Q})),n.d(t,"a",(function(){return ee}));var r,c,o=n(33),a=n.n(o),s=n(8),i=n.n(s),l=n(0);!function(e){e.PRISTINE="pristine",e.STARTED="started",e.PROCESSING="processing",e.ERROR="has_error",e.FAILED="failed",e.SUCCESS="success",e.COMPLETE="complete"}(r||(r={})),function(e){e.SET_REGISTERED_PAYMENT_METHODS="set_registered_payment_methods",e.SET_REGISTERED_EXPRESS_PAYMENT_METHODS="set_registered_express_payment_methods",e.SET_SHOULD_SAVE_PAYMENT_METHOD="set_should_save_payment_method"}(c||(c={}));var u={currentStatus:r.PRISTINE,shouldSavePaymentMethod:!1,paymentMethodData:{payment_method:""},hasSavedToken:!1,errorMessage:"",paymentMethods:{},expressPaymentMethods:{}},p={setPaymentStatus:function(){return{pristine:function(){},started:function(){},processing:function(){},completed:function(){},error:function(e){},failed:function(e,t){},success:function(e,t){}}},currentStatus:{isPristine:!0,isStarted:!1,isProcessing:!1,isFinished:!1,hasError:!1,hasFailed:!1,isSuccessful:!1,isDoingExpressPayment:!1},paymentStatuses:r,paymentMethodData:{},errorMessage:"",activePaymentMethod:"",setActivePaymentMethod:function(){},activeSavedToken:"",setActiveSavedToken:function(){},customerPaymentMethods:{},paymentMethods:{},expressPaymentMethods:{},paymentMethodsInitialized:!1,expressPaymentMethodsInitialized:!1,onPaymentProcessing:function(){return function(){return function(){}}},setExpressPaymentError:function(){},isExpressPaymentMethodActive:!1,setShouldSavePayment:function(){},shouldSavePayment:!1},d=n(5),b=n.n(d),m=n(38),f=n.n(m);function O(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function g(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?O(Object(n),!0).forEach((function(t){b()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):O(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var h=function(e){return!("object"!==f()(e)||!e.isSavedToken)},j=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:u,t=arguments.length>1?arguments[1]:void 0,n=t.type,o=t.paymentMethodData,a=t.shouldSavePaymentMethod,s=void 0!==a&&a,i=t.errorMessage,l=void 0===i?"":i,p=t.paymentMethods,d=void 0===p?{}:p;switch(n){case r.STARTED:return g(g({},e),{},{currentStatus:r.STARTED,paymentMethodData:o||e.paymentMethodData,hasSavedToken:h(o||e.paymentMethodData)});case r.ERROR:return e.currentStatus!==r.ERROR?g(g({},e),{},{currentStatus:r.ERROR,errorMessage:l||e.errorMessage}):e;case r.FAILED:return e.currentStatus!==r.FAILED?g(g({},e),{},{currentStatus:r.FAILED,paymentMethodData:o||e.paymentMethodData,errorMessage:l||e.errorMessage}):e;case r.SUCCESS:return e.currentStatus!==r.SUCCESS?g(g({},e),{},{currentStatus:r.SUCCESS,paymentMethodData:o||e.paymentMethodData,hasSavedToken:h(o||e.paymentMethodData)}):e;case r.PROCESSING:return e.currentStatus!==r.PROCESSING?g(g({},e),{},{currentStatus:r.PROCESSING,errorMessage:""}):e;case r.COMPLETE:return e.currentStatus!==r.COMPLETE?g(g({},e),{},{currentStatus:r.COMPLETE}):e;case r.PRISTINE:return g(g({},u),{},{currentStatus:r.PRISTINE,paymentMethods:g({},e.paymentMethods),expressPaymentMethods:g({},e.expressPaymentMethods),shouldSavePaymentMethod:e.shouldSavePaymentMethod});case c.SET_REGISTERED_PAYMENT_METHODS:return g(g({},e),{},{paymentMethods:d});case c.SET_REGISTERED_EXPRESS_PAYMENT_METHODS:return g(g({},e),{},{expressPaymentMethods:d});case c.SET_SHOULD_SAVE_PAYMENT_METHOD:return g(g({},e),{},{shouldSavePaymentMethod:s})}},v=n(29),E=n.n(v),y=n(22),_=n.n(y),w=n(1),k=n(60),S=n(62),C=n(3),P=n(222),N=n(63),x=n(75),R=n(67),T=n(43),A=n(59),I=n(50);function M(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function D(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?M(Object(n),!0).forEach((function(t){b()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):M(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var F=function(e,t,n,r){var c=Object(l.useState)(!1),o=i()(c,2),a=o[0],s=o[1],u=Object(N.b)().isEditor,p=Object(x.b)().selectedRates,d=Object(R.b)(),m=d.billingData,O=d.shippingAddress,g=Object(S.a)(p),h=Object(S.a)(n),j=Object(T.a)(),v=j.cartTotals,y=j.cartNeedsShipping,k=j.paymentRequirements,I=Object(l.useRef)({cart:j,cartTotals:v,cartNeedsShipping:y,billingData:m,shippingAddress:O,selectedShippingMethods:g,paymentRequirements:k}),M=Object(A.a)().addErrorNotice;Object(l.useEffect)((function(){I.current={cart:j,cartTotals:v,cartNeedsShipping:y,billingData:m,shippingAddress:O,selectedShippingMethods:g,paymentRequirements:k}}),[j,v,y,m,O,g,k]);var F=Object(l.useCallback)(E()(_.a.mark((function n(){var c,o,a,i,l,p,d;return _.a.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:c={},o=function(e){c=D(D({},c),{},b()({},e.name,e))},a=0;case 3:if(!(a<h.length)){n.next=29;break}if(i=h[a],l=t[i]){n.next=8;break}return n.abrupt("continue",26);case 8:if(n.prev=8,!u){n.next=13;break}n.t0=!0,n.next=16;break;case 13:return n.next=15,Promise.resolve(l.canMakePayment(I.current));case 15:n.t0=n.sent;case 16:if(!(p=n.t0)){n.next=21;break}if("object"!==f()(p)||null===p||!p.error){n.next=20;break}throw new Error(p.error.message);case 20:o(l);case 21:n.next=26;break;case 23:n.prev=23,n.t1=n.catch(8),(C.CURRENT_USER_IS_ADMIN||u)&&(d=Object(w.sprintf)(
/* translators: %s the id of the payment method being registered (bank transfer, Stripe...) */
Object(w.__)("There was an error registering the payment method with id '%s': ",'woocommerce'),l.paymentMethodId),M("".concat(d," ").concat(n.t1),{context:r,id:"wc-".concat(l.paymentMethodId,"-registration-error")}));case 26:a++,n.next=3;break;case 29:e(c),s(!0);case 31:case"end":return n.stop()}}),n,null,[[8,23]])}))),[M,e,u,r,h,t]),B=Object(P.a)(F,500),L=i()(B,1)[0];return Object(l.useEffect)((function(){L()}),[L,j,g,m]),a},B=function(e){return{type:e}},L=function(e){return{type:r.ERROR,errorMessage:e}},V=function(e){var t=e.errorMessage,n=e.paymentMethodData;return{type:r.FAILED,errorMessage:t,paymentMethodData:n}},U=function(e){var t=e.paymentMethodData;return{type:r.SUCCESS,paymentMethodData:t}},z=function(e){var t=e.paymentMethodData;return{type:r.STARTED,paymentMethodData:t}},H=function(e){return{type:c.SET_REGISTERED_PAYMENT_METHODS,paymentMethods:e}},G=function(e){return{type:c.SET_REGISTERED_EXPRESS_PAYMENT_METHODS,paymentMethods:e}},q=function(e){return{type:c.SET_SHOULD_SAVE_PAYMENT_METHOD,shouldSavePaymentMethod:e}},Y=n(68),W=n(57),$=n(126),X=n(321),K=n(322),J=n(132),Z=Object(l.createContext)(p),Q=function(){return Object(l.useContext)(Z)},ee=function(e){var t,n=e.children,c=Object(W.b)(),o=c.isProcessing,s=c.isIdle,p=c.isCalculating,d=c.hasError,b=Object(N.b)(),m=b.isEditor,O=b.getPreviewData,g=Object(J.b)().setValidationErrors,h=Object(A.a)(),v=h.addErrorNotice,E=h.removeNotice,y=Object(I.c)(),_=y.isSuccessResponse,w=y.isErrorResponse,S=y.isFailResponse,P=y.noticeContexts,T=Object(l.useReducer)($.b,{}),M=i()(T,2),D=M[0],Q=(t=M[1],Object(l.useMemo)((function(){return{onPaymentProcessing:Object(X.a)("payment_processing",t)}}),[t])).onPaymentProcessing,ee=Object(l.useRef)(D);Object(l.useEffect)((function(){ee.current=D}),[D]);var te,ne,re,ce=Object(l.useReducer)(j,u),oe=i()(ce,2),ae=oe[0],se=(te=oe[1],ne=Object(R.b)().setBillingData,re=Object(x.b)().setShippingAddress,{dispatchActions:Object(l.useMemo)((function(){return{setRegisteredPaymentMethods:function(e){te(H(e))},setRegisteredExpressPaymentMethods:function(e){te(G(e))},setShouldSavePayment:function(e){te(q(e))}}}),[te]),setPaymentStatus:Object(l.useCallback)((function(){return{pristine:function(){return te(B(r.PRISTINE))},started:function(e){te(z({paymentMethodData:e}))},processing:function(){return te(B(r.PROCESSING))},completed:function(){return te(B(r.COMPLETE))},error:function(e){return te(L(e))},failed:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;n&&ne(n),te(V({errorMessage:e||"",paymentMethodData:t||{}}))},success:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;t&&ne(t),void 0!==f()(n)&&null!=n&&n.address&&re(n.address),te(U({paymentMethodData:e}))}}}),[te,ne,re])}),ie=se.dispatchActions,le=se.setPaymentStatus,ue=function(e){var t=Object(k.getPaymentMethods)(),n=Object(I.c)().noticeContexts,r=new Set([].concat(a()(Object(C.getSetting)("paymentGatewaySortOrder",[])),a()(Object.keys(t))));return F(e,t,Array.from(r),n.PAYMENTS)}(ie.setRegisteredPaymentMethods),pe=function(e){var t=Object(k.getExpressPaymentMethods)(),n=Object(I.c)().noticeContexts;return F(e,t,Object.keys(t),n.EXPRESS_PAYMENTS)}(ie.setRegisteredExpressPaymentMethods),de=function(){var e=Object(Y.a)().dispatchCheckoutEvent,t=Object(l.useState)(""),n=i()(t,2),r=n[0],c=n[1],o=Object(l.useState)(""),a=i()(o,2),s=a[0],u=a[1];return Object(l.useEffect)((function(){e("set-active-payment-method",{activePaymentMethod:r})}),[e,r]),{activePaymentMethod:r,activeSavedToken:s,setActivePaymentMethod:c,setActiveSavedToken:u}}(),be=de.activePaymentMethod,me=de.activeSavedToken,fe=de.setActivePaymentMethod,Oe=de.setActiveSavedToken,ge=Object(l.useMemo)((function(){return m?O("previewSavedPaymentMethods"):ue?function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(0===Object.keys(e).length)return{};var t=Object(C.getSetting)("customerPaymentMethods",{}),n=Object.keys(t),r={};return n.forEach((function(n){var c=t[n].filter((function(t){var n,r=t.method.gateway;return r in e&&(null===(n=e[r].supports)||void 0===n?void 0:n.showSavedCards)}));c.length&&(r[n]=c)})),r}(ae.paymentMethods):{}}),[m,O,ue,ae.paymentMethods]),he=Object(l.useCallback)((function(e){e?v(e,{id:"wc-express-payment-error",context:P.EXPRESS_PAYMENTS}):E("wc-express-payment-error",P.EXPRESS_PAYMENTS)}),[v,P.EXPRESS_PAYMENTS,E]),je=Object.keys(ae.expressPaymentMethods).includes(be),ve=Object(l.useMemo)((function(){return{isPristine:ae.currentStatus===r.PRISTINE,isStarted:ae.currentStatus===r.STARTED,isProcessing:ae.currentStatus===r.PROCESSING,isFinished:[r.ERROR,r.FAILED,r.SUCCESS].includes(ae.currentStatus),hasError:ae.currentStatus===r.ERROR,hasFailed:ae.currentStatus===r.FAILED,isSuccessful:ae.currentStatus===r.SUCCESS,isDoingExpressPayment:ae.currentStatus!==r.PRISTINE&&je}}),[ae.currentStatus,je]);Object(l.useEffect)((function(){var e=Object.keys(ae.paymentMethods),t=[].concat(a()(e),a()(Object.keys(ae.expressPaymentMethods)));ue&&e.length&&fe((function(e){return e&&t.includes(e)?e:(le().pristine(),Object.keys(ae.paymentMethods)[0])}))}),[ue,ae.paymentMethods,ae.expressPaymentMethods,fe,le]),Object(l.useEffect)((function(){!o||d||p||ve.isFinished||le().processing()}),[o,d,p,ve.isFinished,le]),Object(l.useEffect)((function(){s&&!ve.isSuccessful&&le().pristine()}),[s,ve.isSuccessful,le]),Object(l.useEffect)((function(){d&&ve.isSuccessful&&!ae.hasSavedToken&&le().pristine()}),[d,ve.isSuccessful,ae.hasSavedToken,le]),Object(l.useEffect)((function(){ve.isProcessing&&(E("wc-payment-error",P.PAYMENTS),Object(K.b)(ee.current,"payment_processing",{}).then((function(e){var t,n,r,c,o,a,s,i;if(e.forEach((function(e){_(e)&&(t=e),(w(e)||S(e))&&(n=e)})),t&&!n)le().success(null===(r=t)||void 0===r||null===(c=r.meta)||void 0===c?void 0:c.paymentMethodData,null===(o=t)||void 0===o||null===(a=o.meta)||void 0===a?void 0:a.billingData,null===(s=t)||void 0===s||null===(i=s.meta)||void 0===i?void 0:i.shippingData);else if(n&&S(n)){var l,u,p,d,b,m;n.message&&n.message.length&&v(n.message,{id:"wc-payment-error",isDismissible:!1,context:(null===(m=n)||void 0===m?void 0:m.messageContext)||P.PAYMENTS}),le().failed(null===(l=n)||void 0===l?void 0:l.message,null===(u=n)||void 0===u||null===(p=u.meta)||void 0===p?void 0:p.paymentMethodData,null===(d=n)||void 0===d||null===(b=d.meta)||void 0===b?void 0:b.billingData)}else if(n){var f,O;n.message&&n.message.length&&v(n.message,{id:"wc-payment-error",isDismissible:!1,context:(null===(O=n)||void 0===O?void 0:O.messageContext)||P.PAYMENTS}),le().error(n.message),g(null===(f=n)||void 0===f?void 0:f.validationErrors)}else le().success()})))}),[ve.isProcessing,g,le,E,P.PAYMENTS,_,S,w,v]);var Ee={setPaymentStatus:le,currentStatus:ve,paymentStatuses:r,paymentMethodData:ae.paymentMethodData,errorMessage:ae.errorMessage,activePaymentMethod:be,setActivePaymentMethod:fe,activeSavedToken:me,setActiveSavedToken:Oe,onPaymentProcessing:Q,customerPaymentMethods:ge,paymentMethods:ae.paymentMethods,expressPaymentMethods:ae.expressPaymentMethods,paymentMethodsInitialized:ue,expressPaymentMethodsInitialized:pe,setExpressPaymentError:he,isExpressPaymentMethodActive:je,shouldSavePayment:ae.shouldSavePaymentMethod,setShouldSavePayment:ie.setShouldSavePayment};return Object(l.createElement)(Z.Provider,{value:Ee},n)}},175:function(e,t){},179:function(e,t){},189:function(e,t){},190:function(e,t){},191:function(e,t){e.exports=window.wp.warning},195:function(e,t,n){"use strict";var r=n(33),c=n.n(r),o=n(0),a=n(1),s=n(4),i=n(14),l=n(39);t.a=function(e){var t=e.setPageId,n=e.pageId,r=e.labels,u=Object(i.useSelect)((function(e){return e("core").getEntityRecords("postType","page",{status:"publish",orderby:"title",order:"asc",per_page:100})}),[])||null;return u?Object(o.createElement)(s.PanelBody,{title:r.title},Object(o.createElement)(s.SelectControl,{label:Object(a.__)("Link to",'woocommerce'),value:n,options:[{label:r.default,value:0}].concat(c()(u.map((function(e){return{label:Object(l.a)(e,u),value:parseInt(e.id,10)}})))),onChange:function(e){return t(parseInt(e,10))}})):null}},196:function(e,t,n){"use strict";n.d(t,"a",(function(){return l}));var r=n(0),c=n(1),o=(n(2),n(66)),a=n(237),s=n(158),i=(n(258),function(e){var t=e.text,n=e.url,i=void 0===n?"https://ideas.woocommerce.com/forums/133476-woocommerce?category_id=384565":n;return Object(r.createElement)("div",{className:"wc-block-feedback-prompt"},Object(r.createElement)(o.a,{srcElement:a.a}),Object(r.createElement)("h2",{className:"wc-block-feedback-prompt__title"},Object(c.__)("Feedback?",'woocommerce')),Object(r.createElement)("p",{className:"wc-block-feedback-prompt__text"},t),Object(r.createElement)("a",{href:i,className:"wc-block-feedback-prompt__link",rel:"noreferrer noopener",target:"_blank"},Object(c.__)("Give us your feedback.",'woocommerce'),Object(r.createElement)(o.a,{srcElement:s.a,size:16})))}),l=function(){return Object(r.createElement)(i,{text:Object(c.__)("We are currently working on improving our cart and checkout blocks to provide merchants with the tools and customization options they need.",'woocommerce'),url:"https://github.com/woocommerce/woocommerce-gutenberg-products-block/issues/new?template=--cart-checkout-feedback.md"})}},197:function(e,t){e.exports=window.wp.plugins},198:function(e,t,n){"use strict";var r=n(5),c=n.n(r),o=n(8),a=n.n(o),s=n(0),i=n(1),l=n(283),u=n(163),p=n(63),d=n(174),b=n(56),m=n.n(b),f=n(168);function O(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function g(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?O(Object(n),!0).forEach((function(t){c()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):O(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}t.a=function(){var e=Object(p.b)().isEditor,t=Object(d.b)(),n=t.setActivePaymentMethod,r=t.setExpressPaymentError,c=t.activePaymentMethod,o=t.paymentMethodData,b=t.setPaymentStatus,O=Object(l.a)(),h=Object(u.a)().paymentMethods,j=Object(s.useRef)(c),v=Object(s.useRef)(o),E=Object(s.useCallback)((function(e){return function(){j.current=c,v.current=o,b().started({}),n(e)}}),[c,o,n,b]),y=Object(s.useCallback)((function(){b().pristine(),n(j.current),v.current.isSavedToken&&b().started(v.current)}),[n,b]),_=Object(s.useCallback)((function(e){b().error(e),r(e),n(j.current),v.current.isSavedToken&&b().started(v.current)}),[n,b,r]),w=Object(s.useCallback)((function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";m()("Express Payment Methods should use the provided onError handler instead.",{alternative:"onError",plugin:"woocommerce-gutenberg-products-block",link:"https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/4228"}),e?_(e):r("")}),[r,_]),k=Object.entries(h),S=k.length>0?k.map((function(t){var n=a()(t,2),r=n[0],c=n[1],o=e?c.edit:c.content;return Object(s.isValidElement)(o)?Object(s.createElement)("li",{key:r,id:"express-payment-method-".concat(r)},Object(s.cloneElement)(o,g(g({},O),{},{onClick:E(r),onClose:y,onError:_,setExpressPaymentError:w}))):null})):Object(s.createElement)("li",{key:"noneRegistered"},Object(i.__)("No registered Payment Methods",'woocommerce'));return Object(s.createElement)(f.a,{isEditor:e},Object(s.createElement)("ul",{className:"wc-block-components-express-payment__event-buttons"},S))}},200:function(e,t,n){"use strict";var r=n(16),c=n.n(r),o=n(0),a=n(1),s=n(64),i=n(83),l=n(27),u=n(500),p=n(43),d=n(63),b=n(6),m=n.n(b),f=n(25),O=n(41),g=n(8),h=n.n(g),j=n(34),v=n.n(j),E=n(134),y=n(68),_=function(e){var t;return null===(t=e.find((function(e){return e.selected})))||void 0===t?void 0:t.rate_id},w=n(167),k=n(129),S=n(47),C=n(53),P=n(3),N=function(e){var t=Object(P.getSetting)("displayCartPricesIncludingTax",!1)?parseInt(e.price,10)+parseInt(e.taxes,10):parseInt(e.price,10);return{label:Object(f.decodeEntities)(e.name),value:e.rate_id,description:Object(o.createElement)(o.Fragment,null,Number.isFinite(t)&&Object(o.createElement)(C.a,{currency:Object(S.getCurrencyFromPriceResponse)(e),value:t}),Number.isFinite(t)&&e.delivery_time?" — ":null,Object(f.decodeEntities)(e.delivery_time))}},x=function(e){var t=e.className,n=e.noResultsMessage,r=e.onSelectRate,c=e.rates,a=e.renderOption,s=void 0===a?N:a,i=e.selected;if(0===c.length)return n;if(c.length>1)return Object(o.createElement)(w.a,{className:t,onChange:function(e){r(e)},selected:i,options:c.map(s)});var l=s(c[0]),u=l.label,p=l.secondaryLabel,d=l.description,b=l.secondaryDescription;return Object(o.createElement)(k.a,{label:u,secondaryLabel:p,description:d,secondaryDescription:b})},R=(n(271),function(e){var t=e.packageId,n=e.className,r=e.noResultsMessage,c=e.renderOption,s=e.packageData,i=e.collapsible,u=void 0!==i&&i,p=e.collapse,d=void 0!==p&&p,b=e.showItems,g=void 0!==b&&b,j=function(e,t){var n=Object(y.a)().dispatchCheckoutEvent,r=Object(E.a)(),c=r.selectShippingRate,a=r.isSelectingRate,s=Object(o.useState)((function(){return _(t)})),i=h()(s,2),l=i[0],u=i[1],p=Object(o.useRef)(t);return Object(o.useEffect)((function(){v()(p.current,t)||(p.current=t,u(_(t)))}),[t]),{selectShippingRate:Object(o.useCallback)((function(t){u(t),c(t,e),n("set-selected-shipping-rate",{shippingRateId:t})}),[e,c,n]),selectedShippingRate:l,isSelectingRate:a}}(t,s.shipping_rates),w=j.selectShippingRate,k=j.selectedShippingRate,S=Object(o.createElement)(o.Fragment,null,(g||u)&&Object(o.createElement)("div",{className:"wc-block-components-shipping-rates-control__package-title"},s.name),g&&Object(o.createElement)("ul",{className:"wc-block-components-shipping-rates-control__package-items"},Object.values(s.items).map((function(e){var t=Object(f.decodeEntities)(e.name),n=e.quantity;return Object(o.createElement)("li",{key:e.key,className:"wc-block-components-shipping-rates-control__package-item"},Object(o.createElement)(O.a,{label:n>1?"".concat(t," × ").concat(n):"".concat(t),screenReaderLabel:Object(a.sprintf)(
/* translators: %1$s name of the product (ie: Sunglasses), %2$d number of units in the current cart package */
Object(a._n)("%1$s (%2$d unit)","%1$s (%2$d units)",n,'woocommerce'),t,n)}))})))),C=Object(o.createElement)(x,{className:n,noResultsMessage:r,rates:s.shipping_rates,onSelectRate:w,selected:k,renderOption:c});return u?Object(o.createElement)(l.Panel,{className:"wc-block-components-shipping-rates-control__package",initialOpen:!d,title:S},C):Object(o.createElement)("div",{className:m()("wc-block-components-shipping-rates-control__package",n)},S,C)}),T=["package_id"],A=["extensions","receiveCart"],I=function(e){var t=e.packages,n=e.collapse,r=e.showItems,a=e.collapsible,s=e.noResultsMessage,i=e.renderOption;return t.length?Object(o.createElement)(o.Fragment,null,t.map((function(e){var t=e.package_id,l=c()(e,T);return Object(o.createElement)(R,{key:t,packageId:t,packageData:l,collapsible:a,collapse:n,showItems:r,noResultsMessage:s,renderOption:i})}))):null};t.a=function(e){var t=e.shippingRates,n=e.shippingRatesLoading,r=e.className,b=e.collapsible,m=void 0!==b&&b,f=e.noResultsMessage,O=e.renderOption;Object(o.useEffect)((function(){if(!n){var e=Object(u.a)(t),r=Object(u.b)(t);1===e?Object(s.speak)(Object(a.sprintf)(
/* translators: %d number of shipping options found. */
Object(a._n)("%d shipping option was found.","%d shipping options were found.",r,'woocommerce'),r)):Object(s.speak)(Object(a.sprintf)(
/* translators: %d number of shipping packages packages. */
Object(a._n)("Shipping option searched for %d package.","Shipping options searched for %d packages.",e,'woocommerce'),e)+" "+Object(a.sprintf)(
/* translators: %d number of shipping options available. */
Object(a._n)("%d shipping option was found","%d shipping options were found",r,'woocommerce'),r))}}),[n,t]);var g=Object(p.a)(),h=g.extensions,j=(g.receiveCart,{className:r,collapsible:m,noResultsMessage:f,renderOption:O,extensions:h,cart:c()(g,A),components:{ShippingRatesControlPackage:R}}),v=Object(d.b)().isEditor;return Object(o.createElement)(i.a,{isLoading:n,screenReaderLabel:Object(a.__)("Loading shipping rates…",'woocommerce'),showSpinner:!0},v?Object(o.createElement)(I,{packages:t,noResultsMessage:f,renderOption:O}):Object(o.createElement)(o.Fragment,null,Object(o.createElement)(l.ExperimentalOrderShippingPackages.Slot,j),Object(o.createElement)(l.ExperimentalOrderShippingPackages,null,Object(o.createElement)(I,{packages:t,noResultsMessage:f,renderOption:O}))))}},201:function(e,t,n){"use strict";n.d(t,"a",(function(){return g}));var r=n(5),c=n.n(r),o=n(1),a=n(14),s=n(24),i=n(25),l=n(43),u=n(0);n(8),n(2),n(899),n(6),n(27),n(68),n(63);var p=Object(u.createContext)({notices:[],createSnackbarNotice:function(e,t){},removeSnackbarNotice:function(e,t){},setIsSuppressed:function(e){},context:"wc/core"});function d(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function b(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?d(Object(n),!0).forEach((function(t){c()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):d(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var m=n(132),f=n(59);function O(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}var g=function(){var e=Object(l.a)(),t=e.cartCoupons,n=e.cartIsLoading,r=Object(f.a)().addErrorNotice,d=function(){var e=Object(u.useContext)(p),t=e.notices,n=e.createSnackbarNotice,r=e.removeSnackbarNotice,c=e.setIsSuppressed,o=Object(u.useRef)(t);Object(u.useEffect)((function(){o.current=t}),[t]);var a=Object(u.useMemo)((function(){return{removeNotices:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;o.current.forEach((function(t){null!==e&&t.status!==e||r(t.id)}))},removeSnackbarNotice:r}}),[r]),s=Object(u.useMemo)((function(){return{addSnackbarNotice:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};n(e,t)}}}),[n]);return b(b(b({notices:t},a),s),{},{setIsSuppressed:c})}().addSnackbarNotice,g=Object(m.b)().setValidationErrors;return function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?O(Object(n),!0).forEach((function(t){c()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):O(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({appliedCoupons:t,isLoading:n},Object(a.useSelect)((function(e,t){var n=t.dispatch,c=e(s.CART_STORE_KEY),a=c.isApplyingCoupon(),l=c.isRemovingCoupon(),u=n(s.CART_STORE_KEY),p=u.applyCoupon,b=u.removeCoupon,m=u.receiveApplyingCoupon;return{applyCoupon:function(e){p(e).then((function(t){!0===t&&d(Object(o.sprintf)(
/* translators: %s coupon code. */
Object(o.__)('Coupon code "%s" has been applied to your cart.','woocommerce'),e),{id:"coupon-form"})})).catch((function(e){g({coupon:{message:Object(i.decodeEntities)(e.message),hidden:!1}}),m("")}))},removeCoupon:function(e){b(e).then((function(t){!0===t&&d(Object(o.sprintf)(
/* translators: %s coupon code. */
Object(o.__)('Coupon code "%s" has been removed from your cart.','woocommerce'),e),{id:"coupon-form"})})).catch((function(e){r(e.message,{id:"coupon-form"}),m("")}))},isApplyingCoupon:a,isRemovingCoupon:l}}),[r,d]))}},205:function(e,t){},206:function(e,t){},207:function(e,t){},208:function(e,t){},209:function(e,t){},21:function(e,t){e.exports=window.wp.compose},210:function(e,t){},218:function(e,t){},22:function(e,t){e.exports=window.regeneratorRuntime},220:function(e,t,n){"use strict";var r=n(9),c=n.n(r),o=n(16),a=n.n(o),s=n(0),i=(n(2),n(6)),l=n.n(i),u=n(1),p=n(66),d=n(305),b=(n(179),["text","screenReaderText","element","className","radius","children"]),m=function(e){var t=e.text,n=e.screenReaderText,r=void 0===n?"":n,o=e.element,i=void 0===o?"li":o,u=e.className,p=void 0===u?"":u,d=e.radius,m=void 0===d?"small":d,f=e.children,O=void 0===f?null:f,g=a()(e,b),h=i,j=l()(p,"wc-block-components-chip","wc-block-components-chip--radius-"+m),v=Boolean(r&&r!==t);return Object(s.createElement)(h,c()({className:j},g),Object(s.createElement)("span",{"aria-hidden":v,className:"wc-block-components-chip__text"},t),v&&Object(s.createElement)("span",{className:"screen-reader-text"},r),O)},f=["ariaLabel","className","disabled","onRemove","removeOnAnyClick","text","screenReaderText"];t.a=function(e){var t=e.ariaLabel,n=void 0===t?"":t,r=e.className,o=void 0===r?"":r,i=e.disabled,b=void 0!==i&&i,O=e.onRemove,g=void 0===O?function(){}:O,h=e.removeOnAnyClick,j=void 0!==h&&h,v=e.text,E=e.screenReaderText,y=void 0===E?"":E,_=a()(e,f),w=j?"span":"button";if(!n){var k=y&&"string"==typeof y?y:v;n="string"!=typeof k?
/* translators: Remove chip. */
Object(u.__)("Remove",'woocommerce'):Object(u.sprintf)(
/* translators: %s text of the chip to remove. */
Object(u.__)('Remove "%s"','woocommerce'),k)}var S={"aria-label":n,disabled:b,onClick:g,onKeyDown:function(e){"Backspace"!==e.key&&"Delete"!==e.key||g()}},C=j?S:{},P=j?{"aria-hidden":!0}:S;return Object(s.createElement)(m,c()({},_,C,{className:l()(o,"is-removable"),element:j?"button":_.element,screenReaderText:y,text:v}),Object(s.createElement)(w,c()({className:"wc-block-components-chip__remove"},P),Object(s.createElement)(p.a,{className:"wc-block-components-chip__remove-icon",srcElement:d.a,size:16})))}},23:function(e,t){e.exports=window.wp.url},234:function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(0),c=(n(2),n(132)),o=(n(210),function(e){var t=e.errorMessage,n=void 0===t?"":t,o=e.propertyName,a=void 0===o?"":o,s=e.elementId,i=void 0===s?"":s,l=Object(c.b)(),u=l.getValidationError,p=l.getValidationErrorId;if(!n||"string"!=typeof n){var d=u(a)||{};if(!d.message||d.hidden)return null;n=d.message}return Object(r.createElement)("div",{className:"wc-block-components-validation-error",role:"alert"},Object(r.createElement)("p",{id:p(i)},n))})},235:function(e,t,n){"use strict";n.d(t,"a",(function(){return T}));var r=n(0),c=n(197),o=n(3),a=n(125),s=n(174),i=n(75),l=n(67),u=n(57),p=n(29),d=n.n(p),b=n(5),m=n.n(b),f=n(8),O=n.n(f),g=n(22),h=n.n(g),j=n(1),v=n(15),E=n.n(v),y=n(162),_=n(42),w=function(e,t,n){var r=Object.keys(e).map((function(t){return{key:t,value:e[t]}}),[]),c="wc-".concat(n,"-new-payment-method");return r.push({key:c,value:t}),r},k=function(e,t){E.a.setNonce&&"function"==typeof E.a.setNonce&&E.a.setNonce(e),null!=e&&e.get("X-WC-Store-API-User")&&t.setCustomerId(parseInt(e.get("X-WC-Store-API-User")||"0",10))},S=n(132),C=n(43),P=n(59);function N(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function x(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?N(Object(n),!0).forEach((function(t){m()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):N(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var R=function(){var e=Object(u.b)(),t=e.hasError,n=e.onCheckoutValidationBeforeProcessing,c=e.dispatchActions,o=e.redirectUrl,a=e.isProcessing,p=e.isBeforeProcessing,b=e.isComplete,m=e.orderNotes,f=e.shouldCreateAccount,g=e.extensionData,v=Object(S.b)().hasValidationErrors,N=Object(i.b)().shippingErrorStatus,R=Object(l.b)(),T=R.billingData,A=R.shippingAddress,I=Object(C.a)(),M=I.cartNeedsPayment,D=I.receiveCart,F=Object(s.b)(),B=F.activePaymentMethod,L=F.isExpressPaymentMethodActive,V=F.currentStatus,U=F.paymentMethodData,z=F.expressPaymentMethods,H=F.paymentMethods,G=F.shouldSavePayment,q=Object(P.a)(),Y=q.addErrorNotice,W=q.removeNotice,$=q.setIsSuppressed,X=Object(r.useRef)(T),K=Object(r.useRef)(A),J=Object(r.useRef)(o),Z=Object(r.useState)(!1),Q=O()(Z,2),ee=Q[0],te=Q[1],ne=Object(r.useMemo)((function(){var e,t=x(x({},z),H);return null==t||null===(e=t[B])||void 0===e?void 0:e.paymentMethodId}),[B,z,H]),re=v&&!L||V.hasError||N.hasError,ce=!t&&!re&&(V.isSuccessful||!M)&&a;Object(r.useEffect)((function(){$(L)}),[L,$]),Object(r.useEffect)((function(){re===t||!a&&!p||L||c.setHasError(re)}),[re,t,a,p,L,c]),Object(r.useEffect)((function(){X.current=T,K.current=A,J.current=o}),[T,A,o]);var oe=Object(r.useCallback)((function(){return!v&&(V.hasError?{errorMessage:Object(j.__)("There was a problem with your payment option.",'woocommerce')}:!N.hasError||{errorMessage:Object(j.__)("There was a problem with your shipping option.",'woocommerce')})}),[v,V.hasError,N.hasError]);Object(r.useEffect)((function(){var e;return L||(e=n(oe,0)),function(){L||e()}}),[n,oe,L]),Object(r.useEffect)((function(){J.current&&(window.location.href=J.current)}),[b]);var ae=Object(r.useCallback)(d()(h.a.mark((function e(){var t,n;return h.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!ee){e.next=2;break}return e.abrupt("return");case 2:te(!0),W("checkout"),t=M?{payment_method:ne,payment_data:w(U,G,B)}:{},n=x(x({billing_address:Object(y.a)(X.current),shipping_address:Object(y.a)(K.current),customer_note:m,should_create_account:f},t),{},{extensions:x({},g)}),E()({path:"/wc/store/checkout",method:"POST",data:n,cache:"no-store",parse:!1}).then((function(e){if(k(e.headers,c),!e.ok)throw new Error(e);return e.json()})).then((function(e){c.setAfterProcessing(e),te(!1)})).catch((function(e){k(e.headers,c),e.json().then((function(e){var t,n,r;null!==(t=e.data)&&void 0!==t&&t.cart&&D(e.data.cart),Y(Object(_.b)(e),{id:"checkout"}),null===(n=e.additional_errors)||void 0===n||null===(r=n.forEach)||void 0===r||r.call(n,(function(e){Y(e.message,{id:e.error_code})})),c.setHasError(!0),c.setAfterProcessing(e),te(!1)}))}));case 7:case"end":return e.stop()}}),e)}))),[ee,W,m,f,M,ne,U,G,B,g,c,Y,D]);return Object(r.useEffect)((function(){ce&&!ee&&ae()}),[ae,ce,ee]),null},T=function(e){var t=e.children,n=e.isCart,p=void 0!==n&&n,d=e.redirectUrl;return Object(r.createElement)(u.a,{redirectUrl:d,isCart:p},Object(r.createElement)(l.a,null,Object(r.createElement)(i.a,null,Object(r.createElement)(s.a,null,t,Object(r.createElement)(a.a,{renderError:o.CURRENT_USER_IS_ADMIN?null:function(){return null}},Object(r.createElement)(c.PluginArea,{scope:"woocommerce-checkout"})),Object(r.createElement)(R,null)))))}},237:function(e,t,n){"use strict";var r=n(0),c=n(28),o=Object(r.createElement)(c.SVG,{xmlns:"http://www.w3.org/2000/SVG",viewBox:"0 0 24 24"},Object(r.createElement)("path",{fill:"none",d:"M0 0h24v24H0V0z"}),Object(r.createElement)("path",{d:"M21.99 4c0-1.1-.89-2-1.99-2H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h14l4 4-.01-18zM20 4v13.17L18.83 16H4V4h16zM6 12h12v2H6zm0-3h12v2H6zm0-3h12v2H6z"}));t.a=o},24:function(e,t){e.exports=window.wc.wcBlocksData},25:function(e,t){e.exports=window.wp.htmlEntities},258:function(e,t){},259:function(e,t){},26:function(e,t){e.exports=window.wp.blocks},260:function(e,t){},261:function(e,t){},262:function(e,t){},263:function(e,t){},264:function(e,t){},265:function(e,t){},266:function(e,t){},267:function(e,t){},268:function(e,t){},269:function(e,t){},27:function(e,t){e.exports=window.wc.blocksCheckout},270:function(e,t){},271:function(e,t){},272:function(e,t){},273:function(e,t){},274:function(e,t){},275:function(e,t){},276:function(e,t){},28:function(e,t){e.exports=window.wp.primitives},283:function(e,t,n){"use strict";n.d(t,"a",(function(){return x}));var r=n(1),c=n(47),o=n(0),a=n(6),s=n.n(a),i=n(28),l=Object(o.createElement)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(o.createElement)("path",{fill:"none",d:"M0 0h24v24H0z"}),Object(o.createElement)("path",{d:"M4 10h3v7H4zM10.5 10h3v7h-3zM2 19h20v3H2zM17 10h3v7h-3zM12 1L2 6v2h20V6z"})),u=n(303),p=n(502),d=Object(o.createElement)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(o.createElement)("g",{fill:"none",fillRule:"evenodd"},Object(o.createElement)("path",{d:"M0 0h24v24H0z"}),Object(o.createElement)("path",{fill:"#000",fillRule:"nonzero",d:"M17.3 8v1c1 .2 1.4.9 1.4 1.7h-1c0-.6-.3-1-1-1-.8 0-1.3.4-1.3.9 0 .4.3.6 1.4 1 1 .2 2 .6 2 1.9 0 .9-.6 1.4-1.5 1.5v1H16v-1c-.9-.1-1.6-.7-1.7-1.7h1c0 .6.4 1 1.3 1 1 0 1.2-.5 1.2-.8 0-.4-.2-.8-1.3-1.1-1.3-.3-2.1-.8-2.1-1.8 0-.9.7-1.5 1.6-1.6V8h1.3zM12 10v1H6v-1h6zm2-2v1H6V8h8zM2 4v16h20V4H2zm2 14V6h16v12H4z"}),Object(o.createElement)("path",{stroke:"#000",strokeLinecap:"round",d:"M6 16c2.6 0 3.9-3 1.7-3-2 0-1 3 1.5 3 1 0 1-.8 2.8-.8"}))),b=n(66),m=n(72),f=(n(276),{bank:l,bill:u.a,card:p.a,checkPayment:d}),O=function(e){var t=e.icon,n=void 0===t?"":t,r=e.text,c=void 0===r?"":r,a=!!n,i=Object(o.useCallback)((function(e){return a&&Object(m.c)(e)&&Object(m.d)(f,e)}),[a]),l=s()("wc-block-components-payment-method-label",{"wc-block-components-payment-method-label--with-icon":a});return Object(o.createElement)("span",{className:l},i(n)?Object(o.createElement)(b.a,{srcElement:f[n]}):n,c)},g=n(169),h=n(3),j=n(56),v=n.n(j),E=n(234),y=n(43),_=n(201),w=n(50),k=n(57),S=n(174),C=n(75),P=n(67),N=function(e,t){var n=[],c=function(t,n){var r=n+"_tax",c=Object(m.d)(e,n)&&Object(m.c)(e[n])?parseInt(e[n],10):0;return{key:n,label:t,value:c,valueWithTax:c+(Object(m.d)(e,r)&&Object(m.c)(e[r])?parseInt(e[r],10):0)}};return n.push(c(Object(r.__)("Subtotal:",'woocommerce'),"total_items")),n.push(c(Object(r.__)("Fees:",'woocommerce'),"total_fees")),n.push(c(Object(r.__)("Discount:",'woocommerce'),"total_discount")),n.push({key:"total_tax",label:Object(r.__)("Taxes:",'woocommerce'),value:parseInt(e.total_tax,10),valueWithTax:parseInt(e.total_tax,10)}),t&&n.push(c(Object(r.__)("Shipping:",'woocommerce'),"total_shipping")),n},x=function(){var e=Object(k.b)(),t=e.isCalculating,n=e.isComplete,a=e.isIdle,s=e.isProcessing,i=e.onCheckoutBeforeProcessing,l=e.onCheckoutValidationBeforeProcessing,u=e.onCheckoutAfterProcessingWithSuccess,p=e.onCheckoutAfterProcessingWithError,d=e.onSubmit,b=e.customerId,m=Object(S.b)(),f=m.currentStatus,j=m.activePaymentMethod,x=m.onPaymentProcessing,R=m.setExpressPaymentError,T=m.shouldSavePayment,A=Object(C.b)(),I=A.shippingErrorStatus,M=A.shippingErrorTypes,D=A.shippingRates,F=A.shippingRatesLoading,B=A.selectedRates,L=A.setSelectedRates,V=A.isSelectingRate,U=A.onShippingRateSuccess,z=A.onShippingRateFail,H=A.onShippingRateSelectSuccess,G=A.onShippingRateSelectFail,q=A.needsShipping,Y=Object(P.b)(),W=Y.billingData,$=Y.shippingAddress,X=Y.setShippingAddress,K=Object(y.a)().cartTotals,J=Object(_.a)().appliedCoupons,Z=Object(w.c)(),Q=Z.noticeContexts,ee=Z.responseTypes,te=Object(o.useRef)(N(K,q)),ne=Object(o.useRef)({label:Object(r.__)("Total",'woocommerce'),value:parseInt(K.total_price,10)});Object(o.useEffect)((function(){te.current=N(K,q),ne.current={label:Object(r.__)("Total",'woocommerce'),value:parseInt(K.total_price,10)}}),[K,q]);var re=Object(o.useCallback)((function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";v()("setExpressPaymentError should only be used by Express Payment Methods (using the provided onError handler).",{alternative:"",plugin:"woocommerce-gutenberg-products-block",link:"https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/4228"}),R(e)}),[R]);return{activePaymentMethod:j,billing:{billingData:W,cartTotal:ne.current,currency:Object(c.getCurrencyFromPriceResponse)(K),cartTotalItems:te.current,displayPricesIncludingTax:Object(h.getSetting)("displayCartPricesIncludingTax",!1),appliedCoupons:J,customerId:b},checkoutStatus:{isCalculating:t,isComplete:n,isIdle:a,isProcessing:s},components:{ValidationInputError:E.a,PaymentMethodIcons:g.a,PaymentMethodLabel:O},emitResponse:{noticeContexts:Q,responseTypes:ee},eventRegistration:{onCheckoutBeforeProcessing:i,onCheckoutValidationBeforeProcessing:l,onCheckoutAfterProcessingWithSuccess:u,onCheckoutAfterProcessingWithError:p,onShippingRateSuccess:U,onShippingRateFail:z,onShippingRateSelectSuccess:H,onShippingRateSelectFail:G,onPaymentProcessing:x},onSubmit:d,paymentStatus:f,setExpressPaymentError:re,shippingData:{shippingRates:D,shippingRatesLoading:F,selectedRates:B,setSelectedRates:L,isSelectingRate:V,shippingAddress:$,setShippingAddress:X,needsShipping:q},shippingStatus:{shippingErrorStatus:I,shippingErrorTypes:M},shouldSavePayment:T}}},285:function(e,t,n){"use strict";n.d(t,"b",(function(){return u})),n.d(t,"a",(function(){return p}));var r=n(8),c=n.n(r),o=n(0),a=(n(2),n(21)),s=n(6),i=n.n(s),l=Object(o.createContext)({hasContainerWidth:!1,containerClassName:"",isMobile:!1,isSmall:!1,isMedium:!1,isLarge:!1}),u=function(){return Object(o.useContext)(l)},p=function(e){var t=e.children,n=e.className,r=void 0===n?"":n,s=function(){var e=Object(a.useResizeObserver)(),t=c()(e,2),n=t[0],r=t[1].width,o="";return r>700?o="is-large":r>520?o="is-medium":r>400?o="is-small":r&&(o="is-mobile"),[n,o]}(),u=c()(s,2),p=u[0],d=u[1],b={hasContainerWidth:""!==d,containerClassName:d,isMobile:"is-mobile"===d,isSmall:"is-small"===d,isMedium:"is-medium"===d,isLarge:"is-large"===d};return Object(o.createElement)(l.Provider,{value:b},Object(o.createElement)("div",{className:i()(r,d)},p,t))}},286:function(e,t,n){"use strict";var r=n(9),c=n.n(r),o=n(5),a=n.n(o),s=n(8),i=n.n(s),l=n(16),u=n.n(l),p=n(0),d=n(1),b=n(11),m=n(6),f=n.n(m),O=n(132),g=n(57),h=n(234),j=n(21),v=n(72),E=n(41),y=(n(189),["className","id","type","ariaLabel","ariaDescribedBy","label","screenReaderLabel","disabled","help","autoCapitalize","autoComplete","value","onChange","required","onBlur","feedback"]),_=Object(b.forwardRef)((function(e,t){var n=e.className,r=e.id,o=e.type,a=void 0===o?"text":o,s=e.ariaLabel,l=e.ariaDescribedBy,d=e.label,b=e.screenReaderLabel,m=e.disabled,O=e.help,g=e.autoCapitalize,h=void 0===g?"off":g,j=e.autoComplete,v=void 0===j?"off":j,_=e.value,w=void 0===_?"":_,k=e.onChange,S=e.required,C=void 0!==S&&S,P=e.onBlur,N=void 0===P?function(){}:P,x=e.feedback,R=u()(e,y),T=Object(p.useState)(!1),A=i()(T,2),I=A[0],M=A[1];return Object(p.createElement)("div",{className:f()("wc-block-components-text-input",n,{"is-active":I||w})},Object(p.createElement)("input",c()({type:a,id:r,value:w,ref:t,autoCapitalize:h,autoComplete:v,onChange:function(e){k(e.target.value)},onFocus:function(){return M(!0)},onBlur:function(e){N(e.target.value),M(!1)},"aria-label":s||d,disabled:m,"aria-describedby":O&&!l?r+"__help":l,required:C},R)),Object(p.createElement)(E.a,{label:d,screenReaderLabel:b||d,wrapperElement:"label",wrapperProps:{htmlFor:r},htmlFor:r}),!!O&&Object(p.createElement)("p",{id:r+"__help",className:"wc-block-components-text-input__help"},O),x)})),w=["className","instanceId","id","ariaDescribedBy","errorId","validateOnMount","focusOnMount","onChange","showError","errorMessage"];t.a=Object(j.withInstanceId)((function(e){var t=e.className,n=e.instanceId,r=e.id,o=e.ariaDescribedBy,s=e.errorId,l=e.validateOnMount,m=void 0===l||l,j=e.focusOnMount,E=void 0!==j&&j,y=e.onChange,k=e.showError,S=void 0===k||k,C=e.errorMessage,P=void 0===C?"":C,N=u()(e,w),x=Object(b.useState)(!0),R=i()(x,2),T=R[0],A=R[1],I=Object(b.useRef)(null),M=Object(O.b)(),D=M.getValidationError,F=M.hideValidationError,B=M.setValidationErrors,L=M.clearValidationError,V=M.getValidationErrorId,U=Object(g.b)().isBeforeProcessing,z=void 0!==r?r:"textinput-"+n,H=void 0!==s?s:z,G=Object(b.useCallback)((function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=I.current||null;if(t){t.value=t.value.trim();var n=t.checkValidity();n?L(H):B(a()({},H,{message:t.validationMessage||Object(d.__)("Invalid value.",'woocommerce'),hidden:e}))}}),[L,H,B]);Object(b.useEffect)((function(){var e;T&&(E&&(null===(e=I.current)||void 0===e||e.focus()),A(!1))}),[E,T,A]),Object(b.useEffect)((function(){T&&(m&&G(),A(!1))}),[T,A,m,G]),Object(b.useEffect)((function(){U&&G()}),[U,G]),Object(b.useEffect)((function(){return function(){L(H)}}),[L,H]);var q=D(H)||{};Object(v.c)(P)&&""!==P&&(q.message=P);var Y=q.message&&!q.hidden,W=S&&Y&&V(H)?V(H):o;return Object(p.createElement)(_,c()({className:f()(t,{"has-error":Y}),"aria-invalid":!0===Y,id:z,onBlur:function(){G(!1)},feedback:S&&Object(p.createElement)(h.a,{errorMessage:P,propertyName:H}),ref:I,onChange:function(e){F(H),y(e)},ariaDescribedBy:W},N))}))},3:function(e,t){e.exports=window.wc.wcSettings},303:function(e,t,n){"use strict";var r=n(0),c=n(28),o=Object(r.createElement)(c.SVG,{xmlns:"http://www.w3.org/2000/SVG",viewBox:"0 0 24 24"},Object(r.createElement)("path",{fill:"none",d:"M0 0h24v24H0V0z"}),Object(r.createElement)("path",{d:"M11 17h2v-1h1c.55 0 1-.45 1-1v-3c0-.55-.45-1-1-1h-3v-1h4V8h-2V7h-2v1h-1c-.55 0-1 .45-1 1v3c0 .55.45 1 1 1h3v1H9v2h2v1zm9-13H4c-1.11 0-1.99.89-1.99 2L2 18c0 1.11.89 2 2 2h16c1.11 0 2-.89 2-2V6c0-1.11-.89-2-2-2zm0 14H4V6h16v12z"}));t.a=o},305:function(e,t,n){"use strict";var r=n(9),c=n.n(r),o=n(16),a=n.n(o),s=n(0),i=n(28),l=["className","size"],u=Object(s.createElement)((function(e){var t=e.className,n=e.size,r=a()(e,l);return Object(s.createElement)(i.SVG,c()({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",className:t,width:n,height:n},r),Object(s.createElement)("path",{d:"M14.95 6.46L11.41 10l3.54 3.54-1.41 1.41L10 11.42l-3.53 3.53-1.42-1.42L8.58 10 5.05 6.47l1.42-1.42L10 8.58l3.54-3.53z"}))}),null);t.a=u},307:function(e,t,n){"use strict";var r=n(9),c=n.n(r),o=n(0),a=n(25),s=n(3);t.a=function(e){var t=e.image,n=void 0===t?{}:t,r={src:n.thumbnail||s.PLACEHOLDER_IMG_SRC,alt:Object(a.decodeEntities)(n.alt)||""};return Object(o.createElement)("img",c()({},r,{alt:r.alt}))}},308:function(e,t,n){"use strict";var r=n(0),c=n(1),o=n(110);t.a=function(){return Object(r.createElement)(o.a,{className:"wc-block-components-product-backorder-badge"},Object(c.__)("Available on backorder",'woocommerce'))}},309:function(e,t,n){"use strict";var r=n(0),c=n(1),o=n(110);t.a=function(e){var t=e.lowStockRemaining;return t?Object(r.createElement)(o.a,{className:"wc-block-components-product-low-stock-badge"},Object(c.sprintf)(
/* translators: %d stock amount (number of items in stock for product) */
Object(c.__)("%d left in stock",'woocommerce'),t)):null}},311:function(e,t,n){"use strict";var r=n(0),c=n(7),o=n(25),a=(n(264),function(e){var t=e.details,n=void 0===t?[]:t;return Array.isArray(n)?0===(n=n.filter((function(e){return!e.hidden}))).length?null:Object(r.createElement)("ul",{className:"wc-block-components-product-details"},n.map((function(e){var t=e.name?"wc-block-components-product-details__".concat(Object(c.kebabCase)(e.name)):"";return Object(r.createElement)("li",{key:e.name+(e.display||e.value),className:t},e.name&&Object(r.createElement)(r.Fragment,null,Object(r.createElement)("span",{className:"wc-block-components-product-details__name"},Object(o.decodeEntities)(e.name),":")," "),Object(r.createElement)("span",{className:"wc-block-components-product-details__value"},Object(o.decodeEntities)(e.display||e.value)))}))):null}),s=n(155),i=n(37),l=function(e){var t=e.className,n=e.shortDescription,c=void 0===n?"":n,o=e.fullDescription,a=c||(void 0===o?"":o);return a?Object(r.createElement)(s.a,{className:t,source:a,maxLength:15,countType:i.o.wordCountType||"words"}):null};n(263),t.a=function(e){var t=e.shortDescription,n=void 0===t?"":t,c=e.fullDescription,o=void 0===c?"":c,s=e.itemData,i=void 0===s?[]:s,u=e.variation,p=void 0===u?[]:u;return Object(r.createElement)("div",{className:"wc-block-components-product-metadata"},Object(r.createElement)(l,{className:"wc-block-components-product-metadata__description",shortDescription:n,fullDescription:o}),Object(r.createElement)(a,{details:i}),Object(r.createElement)(a,{details:p.map((function(e){var t=e.attribute;return{name:void 0===t?"":t,value:e.value}}))}))}},321:function(e,t,n){"use strict";n.d(t,"a",(function(){return c}));var r=n(126),c=function(e,t){return function(n){var c=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10,o=r.a.addEventCallback(e,n,c);return t(o),function(){t(r.a.removeEventCallback(e,o.id))}}}},322:function(e,t,n){"use strict";n.d(t,"a",(function(){return b})),n.d(t,"b",(function(){return m}));var r=n(38),c=n.n(r),o=n(29),a=n.n(o),s=n(22),i=n.n(s),l=function(e,t){return e[t]?Array.from(e[t].values()).sort((function(e,t){return e.priority-t.priority})):[]},u=n(50);function p(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return d(e,void 0);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?d(e,void 0):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,c=function(){};return{s:c,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:c}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function d(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var b=function(){var e=a()(i.a.mark((function e(t,n,r){var o,a,s,u,d,b;return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:o=l(t,n),a=[],s=p(o),e.prev=3,s.s();case 5:if((u=s.n()).done){e.next=19;break}return d=u.value,e.prev=7,e.next=10,Promise.resolve(d.callback(r));case 10:b=e.sent,"object"===c()(b)&&a.push(b),e.next=17;break;case 14:e.prev=14,e.t0=e.catch(7),console.error(e.t0);case 17:e.next=5;break;case 19:e.next=24;break;case 21:e.prev=21,e.t1=e.catch(3),s.e(e.t1);case 24:return e.prev=24,s.f(),e.finish(24);case 27:return e.abrupt("return",!a.length||a);case 28:case"end":return e.stop()}}),e,null,[[3,21,24,27],[7,14]])})));return function(_x,t,n){return e.apply(this,arguments)}}(),m=function(){var e=a()(i.a.mark((function e(t,n,r){var o,a,s,d,b,m;return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:o=[],a=l(t,n),s=p(a),e.prev=3,s.s();case 5:if((d=s.n()).done){e.next=28;break}return b=d.value,e.prev=7,e.next=10,Promise.resolve(b.callback(r));case 10:if(m=e.sent,"object"===c()(m)&&null!==m){e.next=13;break}return e.abrupt("continue",26);case 13:if(m.hasOwnProperty("type")){e.next=15;break}throw new Error("Returned objects from event emitter observers must return an object with a type property");case 15:if(!Object(u.a)(m)&&!Object(u.b)(m)){e.next=18;break}return o.push(m),e.abrupt("return",o);case 18:o.push(m),e.next=26;break;case 21:return e.prev=21,e.t0=e.catch(7),console.error(e.t0),o.push({type:"error"}),e.abrupt("return",o);case 26:e.next=5;break;case 28:e.next=33;break;case 30:e.prev=30,e.t1=e.catch(3),s.e(e.t1);case 33:return e.prev=33,s.f(),e.finish(33);case 36:return e.abrupt("return",o);case 37:case"end":return e.stop()}}),e,null,[[3,30,33,36],[7,21]])})));return function(t,n,r){return e.apply(this,arguments)}}()},34:function(e,t){e.exports=window.wp.isShallowEqual},37:function(e,t,n){"use strict";n.d(t,"o",(function(){return o})),n.d(t,"m",(function(){return a})),n.d(t,"l",(function(){return s})),n.d(t,"n",(function(){return i})),n.d(t,"j",(function(){return l})),n.d(t,"e",(function(){return u})),n.d(t,"f",(function(){return p})),n.d(t,"g",(function(){return d})),n.d(t,"k",(function(){return b})),n.d(t,"c",(function(){return m})),n.d(t,"d",(function(){return f})),n.d(t,"h",(function(){return O})),n.d(t,"a",(function(){return g})),n.d(t,"i",(function(){return h})),n.d(t,"b",(function(){return j}));var r,c=n(3),o=Object(c.getSetting)("wcBlocksConfig",{buildPhase:1,pluginUrl:"",productCount:0,defaultAvatar:"",restApiRoutes:{},wordCountType:"words"}),a=o.pluginUrl+"images/",s=o.pluginUrl+"build/",i=o.buildPhase,l=null===(r=c.STORE_PAGES.shop)||void 0===r?void 0:r.permalink,u=c.STORE_PAGES.checkout.id,p=c.STORE_PAGES.checkout.permalink,d=c.STORE_PAGES.privacy.permalink,b=(c.STORE_PAGES.privacy.title,c.STORE_PAGES.terms.permalink),m=(c.STORE_PAGES.terms.title,c.STORE_PAGES.cart.id),f=c.STORE_PAGES.cart.permalink,O=(c.STORE_PAGES.myaccount.permalink?c.STORE_PAGES.myaccount.permalink:Object(c.getSetting)("wpLoginUrl","/wp-login.php"),Object(c.getSetting)("shippingCountries",{})),g=Object(c.getSetting)("allowedCountries",{}),h=Object(c.getSetting)("shippingStates",{}),j=Object(c.getSetting)("allowedStates",{})},39:function(e,t,n){"use strict";n.d(t,"h",(function(){return b})),n.d(t,"e",(function(){return m})),n.d(t,"b",(function(){return f})),n.d(t,"i",(function(){return O})),n.d(t,"f",(function(){return g})),n.d(t,"c",(function(){return h})),n.d(t,"d",(function(){return j})),n.d(t,"g",(function(){return v})),n.d(t,"a",(function(){return E}));var r=n(5),c=n.n(r),o=n(23),a=n(15),s=n.n(a),i=n(7),l=n(3),u=n(37);function p(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function d(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?p(Object(n),!0).forEach((function(t){c()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):p(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var b=function(e){var t=e.selected,n=void 0===t?[]:t,r=e.search,c=void 0===r?"":r,a=e.queryArgs,l=function(e){var t=e.selected,n=void 0===t?[]:t,r=e.search,c=void 0===r?"":r,a=e.queryArgs,s=void 0===a?{}:a,i=u.o.productCount>100,l={per_page:i?100:0,catalog_visibility:"any",search:c,orderby:"title",order:"asc"},p=[Object(o.addQueryArgs)("/wc/store/products",d(d({},l),s))];return i&&n.length&&p.push(Object(o.addQueryArgs)("/wc/store/products",{catalog_visibility:"any",include:n,per_page:0})),p}({selected:n,search:c,queryArgs:void 0===a?{}:a});return Promise.all(l.map((function(e){return s()({path:e})}))).then((function(e){return Object(i.uniqBy)(Object(i.flatten)(e),"id").map((function(e){return d(d({},e),{},{parent:0})}))})).catch((function(e){throw e}))},m=function(e){return s()({path:"/wc/store/products/".concat(e)})},f=function(){return s()({path:"wc/store/products/attributes"})},O=function(e){return s()({path:"wc/store/products/attributes/".concat(e,"/terms")})},g=function(e){var t=e.selected,n=function(e){var t=e.selected,n=void 0===t?[]:t,r=e.search,c=Object(l.getSetting)("limitTags",!1),a=[Object(o.addQueryArgs)("wc/store/products/tags",{per_page:c?100:0,orderby:c?"count":"name",order:c?"desc":"asc",search:r})];return c&&n.length&&a.push(Object(o.addQueryArgs)("wc/store/products/tags",{include:n})),a}({selected:void 0===t?[]:t,search:e.search});return Promise.all(n.map((function(e){return s()({path:e})}))).then((function(e){return Object(i.uniqBy)(Object(i.flatten)(e),"id")}))},h=function(e){return s()({path:Object(o.addQueryArgs)("wc/store/products/categories",d({per_page:0},e))})},j=function(e){return s()({path:"wc/store/products/categories/".concat(e)})},v=function(e){return s()({path:Object(o.addQueryArgs)("wc/store/products",{per_page:0,type:"variation",parent:e})})},E=function(e,t){if(!e.title.raw)return e.slug;var n=1===t.filter((function(t){return t.title.raw===e.title.raw})).length;return e.title.raw+(n?"":" - ".concat(e.slug))}},4:function(e,t){e.exports=window.wp.components},41:function(e,t,n){"use strict";var r=n(5),c=n.n(r),o=n(0),a=n(6),s=n.n(a);function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function l(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?i(Object(n),!0).forEach((function(t){c()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):i(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}t.a=function(e){var t,n=e.label,r=e.screenReaderLabel,c=e.wrapperElement,a=e.wrapperProps,i=void 0===a?{}:a,u=null!=n,p=null!=r;return!u&&p?(t=c||"span",i=l(l({},i),{},{className:s()(i.className,"screen-reader-text")}),Object(o.createElement)(t,i,r)):(t=c||o.Fragment,u&&p&&n!==r?Object(o.createElement)(t,i,Object(o.createElement)("span",{"aria-hidden":"true"},n),Object(o.createElement)("span",{className:"screen-reader-text"},r)):Object(o.createElement)(t,i,n))}},42:function(e,t,n){"use strict";n.d(t,"a",(function(){return i})),n.d(t,"b",(function(){return l}));var r=n(29),c=n.n(r),o=n(22),a=n.n(o),s=n(1),i=function(){var e=c()(a.a.mark((function e(t){var n;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("function"!=typeof t.json){e.next=11;break}return e.prev=1,e.next=4,t.json();case 4:return n=e.sent,e.abrupt("return",{message:n.message,type:n.type||"api"});case 8:return e.prev=8,e.t0=e.catch(1),e.abrupt("return",{message:e.t0.message,type:"general"});case 11:return e.abrupt("return",{message:t.message,type:t.type||"general"});case 12:case"end":return e.stop()}}),e,null,[[1,8]])})));return function(_x){return e.apply(this,arguments)}}(),l=function(e){if(e.data&&"rest_invalid_param"===e.code){var t=Object.values(e.data.params);if(t[0])return t[0]}return(null==e?void 0:e.message)||Object(s.__)("Something went wrong. Please contact us to get assistance.",'woocommerce')}},43:function(e,t,n){"use strict";n.d(t,"a",(function(){return y}));var r=n(8),c=n.n(r),o=n(5),a=n.n(o),s=n(7),i=n(0),l=n(24),u=n(14),p=n(25),d=n(142),b=n(162),m=n(63);function f(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function O(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?f(Object(n),!0).forEach((function(t){a()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):f(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var g={first_name:"",last_name:"",company:"",address_1:"",address_2:"",city:"",state:"",postcode:"",country:"",phone:""},h=O(O({},g),{},{email:""}),j={total_items:"",total_items_tax:"",total_fees:"",total_fees_tax:"",total_discount:"",total_discount_tax:"",total_shipping:"",total_shipping_tax:"",total_price:"",total_tax:"",tax_lines:l.EMPTY_TAX_LINES,currency_code:"",currency_symbol:"",currency_minor_unit:2,currency_decimal_separator:"",currency_thousand_separator:"",currency_prefix:"",currency_suffix:""},v=function(e){return Object(d.a)(Object.entries(e).map((function(e){var t=c()(e,2),n=t[0],r=t[1];return[n,Object(p.decodeEntities)(r)]})))},E={cartCoupons:l.EMPTY_CART_COUPONS,cartItems:l.EMPTY_CART_ITEMS,cartFees:l.EMPTY_CART_FEES,cartItemsCount:0,cartItemsWeight:0,cartNeedsPayment:!0,cartNeedsShipping:!0,cartItemErrors:l.EMPTY_CART_ITEM_ERRORS,cartTotals:j,cartIsLoading:!0,cartErrors:l.EMPTY_CART_ERRORS,billingAddress:h,shippingAddress:g,shippingRates:l.EMPTY_SHIPPING_RATES,shippingRatesLoading:!1,cartHasCalculatedShipping:!1,paymentRequirements:l.EMPTY_PAYMENT_REQUIREMENTS,receiveCart:function(){},extensions:l.EMPTY_EXTENSIONS},y=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{shouldSelect:!0},t=Object(m.b)(),n=t.isEditor,r=t.previewData,c=null==r?void 0:r.previewCart,o=e.shouldSelect,a=Object(i.useRef)(),p=Object(u.useSelect)((function(e,t){var r=t.dispatch;if(!o)return E;if(n)return{cartCoupons:c.coupons,cartItems:c.items,cartFees:c.fees,cartItemsCount:c.items_count,cartItemsWeight:c.items_weight,cartNeedsPayment:c.needs_payment,cartNeedsShipping:c.needs_shipping,cartItemErrors:l.EMPTY_CART_ITEM_ERRORS,cartTotals:c.totals,cartIsLoading:!1,cartErrors:l.EMPTY_CART_ERRORS,billingAddress:h,shippingAddress:g,extensions:l.EMPTY_EXTENSIONS,shippingRates:c.shipping_rates,shippingRatesLoading:!1,cartHasCalculatedShipping:c.has_calculated_shipping,paymentRequirements:c.paymentRequirements,receiveCart:"function"==typeof(null==c?void 0:c.receiveCart)?c.receiveCart:function(){}};var a=e(l.CART_STORE_KEY),s=a.getCartData(),i=a.getCartErrors(),u=a.getCartTotals(),p=!a.hasFinishedResolution("getCartData"),d=a.isCustomerDataUpdating(),m=r(l.CART_STORE_KEY).receiveCart,f=v(s.billingAddress),j=s.needsShipping?v(s.shippingAddress):f,y=s.fees.length>0?s.fees.map((function(e){return v(e)})):l.EMPTY_CART_FEES;return{cartCoupons:s.coupons.length>0?s.coupons.map((function(e){return O(O({},e),{},{label:e.code})})):l.EMPTY_CART_COUPONS,cartItems:s.items,cartFees:y,cartItemsCount:s.itemsCount,cartItemsWeight:s.itemsWeight,cartNeedsPayment:s.needsPayment,cartNeedsShipping:s.needsShipping,cartItemErrors:s.errors,cartTotals:u,cartIsLoading:p,cartErrors:i,billingAddress:Object(b.a)(f),shippingAddress:Object(b.a)(j),extensions:s.extensions,shippingRates:s.shippingRates,shippingRatesLoading:d,cartHasCalculatedShipping:s.hasCalculatedShipping,paymentRequirements:s.paymentRequirements,receiveCart:m}}),[o]);return a.current&&Object(s.isEqual)(a.current,p)||(a.current=p),a.current}},44:function(e,t,n){},46:function(e,t){e.exports=window.wp.keycodes},47:function(e,t){e.exports=window.wc.priceFormat},494:function(e,t,n){"use strict";var r=n(0),c=n(6),o=n.n(c),a=(n(2),n(285));n(261),t.a=function(e){var t=e.children,n=e.className;return Object(r.createElement)(a.a,{className:o()("wc-block-components-sidebar-layout",n)},t)}},495:function(e,t,n){"use strict";var r=n(0),c=n(6),o=n.n(c);n(2),t.a=function(e){var t=e.children,n=e.className;return Object(r.createElement)("div",{className:o()("wc-block-components-main",n)},t)}},496:function(e,t,n){"use strict";var r=n(0),c=n(6),o=n.n(c);n(2),t.a=function(e){var t=e.children,n=e.className;return Object(r.createElement)("div",{className:o()("wc-block-components-sidebar",n)},t)}},497:function(e,t,n){"use strict";var r=n(0),c=n(1),o=n(83),a=n(220),s=(n(2),n(27)),i=n(3),l=(n(265),{context:"summary"});t.a=function(e){var t=e.cartCoupons,n=void 0===t?[]:t,u=e.currency,p=e.isRemovingCoupon,d=e.removeCoupon,b=e.values,m=b.total_discount,f=b.total_discount_tax,O=parseInt(m,10);if(!O&&0===n.length)return null;var g=parseInt(f,10),h=Object(i.getSetting)("displayCartPricesIncludingTax",!1)?O+g:O,j=Object(s.__experimentalApplyCheckoutFilter)({arg:l,filterName:"coupons",defaultValue:n});return Object(r.createElement)(s.TotalsItem,{className:"wc-block-components-totals-discount",currency:u,description:0!==j.length&&Object(r.createElement)(o.a,{screenReaderLabel:Object(c.__)("Removing coupon…",'woocommerce'),isLoading:p,showSpinner:!1},Object(r.createElement)("ul",{className:"wc-block-components-totals-discount__coupon-list"},j.map((function(e){return Object(r.createElement)(a.a,{key:"coupon-"+e.code,className:"wc-block-components-totals-discount__coupon-list-item",text:e.label,screenReaderText:Object(c.sprintf)(
/* translators: %s Coupon code. */
Object(c.__)("Coupon: %s",'woocommerce'),e.label),disabled:p,onRemove:function(){d(e.code)},radius:"large",ariaLabel:Object(c.sprintf)(
/* translators: %s is a coupon code. */
Object(c.__)('Remove coupon "%s"','woocommerce'),e.label)})})))),label:h?Object(c.__)("Discount",'woocommerce'):Object(c.__)("Coupons",'woocommerce'),value:h?-1*h:"-"})}},498:function(e,t,n){"use strict";var r=n(8),c=n.n(r),o=n(0),a=n(1),s=n(90),i=n(286),l=n(41),u=n(83),p=(n(2),n(21)),d=n(132),b=n(234),m=n(27);n(266),t.a=Object(p.withInstanceId)((function(e){var t=e.instanceId,n=e.isLoading,r=void 0!==n&&n,p=e.initialOpen,f=void 0!==p&&p,O=e.onSubmit,g=void 0===O?function(){}:O,h=Object(o.useState)(""),j=c()(h,2),v=j[0],E=j[1],y=Object(o.useRef)(!1),_=Object(d.b)(),w=_.getValidationError,k=_.getValidationErrorId,S=w("coupon");Object(o.useEffect)((function(){y.current!==r&&(r||!v||S||E(""),y.current=r)}),[r,v,S]);var C="wc-block-components-totals-coupon__input-".concat(t);return Object(o.createElement)(m.Panel,{className:"wc-block-components-totals-coupon",hasBorder:!1,initialOpen:f,title:Object(o.createElement)(l.a,{label:Object(a.__)("Coupon code",'woocommerce'),screenReaderLabel:Object(a.__)("Apply a coupon code",'woocommerce'),htmlFor:C})},Object(o.createElement)(u.a,{screenReaderLabel:Object(a.__)("Applying coupon…",'woocommerce'),isLoading:r,showSpinner:!1},Object(o.createElement)("div",{className:"wc-block-components-totals-coupon__content"},Object(o.createElement)("form",{className:"wc-block-components-totals-coupon__form"},Object(o.createElement)(i.a,{id:C,errorId:"coupon",className:"wc-block-components-totals-coupon__input",label:Object(a.__)("Enter code",'woocommerce'),value:v,ariaDescribedBy:k(C),onChange:function(e){E(e)},validateOnMount:!1,focusOnMount:!0,showError:!1}),Object(o.createElement)(s.a,{className:"wc-block-components-totals-coupon__button",disabled:r||!v,showSpinner:r,onClick:function(e){e.preventDefault(),g(v)},type:"submit"},Object(a.__)("Apply",'woocommerce'))),Object(o.createElement)(b.a,{propertyName:"coupon",elementId:C}))))}))},50:function(e,t,n){"use strict";n.d(t,"a",(function(){return i})),n.d(t,"b",(function(){return l})),n.d(t,"c",(function(){return p}));var r,c,o=n(72);!function(e){e.SUCCESS="success",e.FAIL="failure",e.ERROR="error"}(r||(r={})),function(e){e.PAYMENTS="wc/payment-area",e.EXPRESS_PAYMENTS="wc/express-payment-area"}(c||(c={}));var a=function(e,t){return Object(o.b)(e)&&"type"in e&&e.type===t},s=function(e){return a(e,r.SUCCESS)},i=function(e){return a(e,r.ERROR)},l=function(e){return a(e,r.FAIL)},u=function(e){return!Object(o.b)(e)||void 0===e.retry||!0===e.retry},p=function(){return{responseTypes:r,noticeContexts:c,shouldRetry:u,isSuccessResponse:s,isErrorResponse:i,isFailResponse:l}}},500:function(e,t,n){"use strict";n.d(t,"a",(function(){return r})),n.d(t,"b",(function(){return c}));var r=function(e){return e.length},c=function(e){return e.reduce((function(e,t){return e+t.shipping_rates.length}),0)}},501:function(e,t,n){"use strict";var r=n(16),c=n.n(r),o=n(0),a=n(1),s=n(53),i=(n(2),n(27)),l=n(43),u=n(3),p=(n(273),["receiveCart"]);t.a=function(e){var t=e.currency,n=e.values,r=Object(u.getSetting)("taxesEnabled",!0)&&Object(u.getSetting)("displayCartPricesIncludingTax",!1),d=n.total_price,b=n.total_tax,m=Object(l.a)(),f=(m.receiveCart,c()(m,p)),O=Object(i.__experimentalApplyCheckoutFilter)({filterName:"totalLabel",defaultValue:Object(a.__)("Total",'woocommerce'),extensions:f.extensions,arg:{cart:f}}),g=parseInt(b,10);return Object(o.createElement)(i.TotalsItem,{className:"wc-block-components-totals-footer-item",currency:t,label:O,value:parseInt(d,10),description:r&&0!==g&&Object(o.createElement)("p",{className:"wc-block-components-totals-footer-item-tax"},Object(o.createInterpolateElement)(Object(a.__)("Including <TaxAmount/> in taxes",'woocommerce'),{TaxAmount:Object(o.createElement)(s.a,{className:"wc-block-components-totals-footer-item-tax-value",currency:t,value:g})}))})}},502:function(e,t,n){"use strict";var r=n(0),c=n(28),o=Object(r.createElement)(c.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(r.createElement)("path",{fill:"none",d:"M0 0h24v24H0V0z"}),Object(r.createElement)("path",{fill:"currentColor",d:"M20 4H4c-1.11 0-1.99.89-1.99 2L2 18c0 1.11.89 2 2 2h16c1.11 0 2-.89 2-2V6c0-1.11-.89-2-2-2zm0 14H4v-6h16v6zm0-10H4V6h16v2z"}));t.a=o},504:function(e,t,n){"use strict";var r=n(5),c=n.n(r),o=n(0),a=n(286),s=n(9),i=n.n(s),l=n(37),u=n(1),p=n(25),d=n(6),b=n.n(d),m=n(21),f=n(898),O=n(132),g=n(234),h=n(72),j=(n(269),Object(m.withInstanceId)((function(e){var t=e.id,n=e.className,r=e.label,a=e.onChange,s=e.options,i=e.value,l=e.required,p=void 0!==l&&l,d=e.errorMessage,m=void 0===d?Object(u.__)("Please select a value.",'woocommerce'):d,j=e.errorId,v=e.instanceId,E=void 0===v?"0":v,y=e.autoComplete,_=void 0===y?"off":y,w=Object(O.b)(),k=w.getValidationError,S=w.setValidationErrors,C=w.clearValidationError,P=Object(o.useRef)(null),N=t||"control-"+E,x=j||N,R=k(x)||{message:"",hidden:!1};return Object(o.useEffect)((function(){return!p||i?C(x):S(c()({},x,{message:m,hidden:!0})),function(){C(x)}}),[C,i,x,m,p,S]),Object(o.createElement)("div",{id:N,className:b()("wc-block-components-combobox",n,{"is-active":i,"has-error":R.message&&!R.hidden}),ref:P},Object(o.createElement)(f.a,{className:"wc-block-components-combobox-control",label:r,onChange:a,onFilterValueChange:function(e){if(e.length){var t=Object(h.b)(P.current)?P.current.ownerDocument.activeElement:void 0;if(t&&Object(h.b)(P.current)&&P.current.contains(t))return;var n=e.toLocaleUpperCase(),r=s.find((function(e){return e.label.toLocaleUpperCase().startsWith(n)||e.value.toLocaleUpperCase()===n}));r&&a(r.value)}},options:s,value:i||"",allowReset:!1,autoComplete:_,"aria-invalid":R.message&&!R.hidden}),Object(o.createElement)(g.a,{propertyName:x}))}))),v=(n(268),function(e){var t=e.className,n=e.countries,r=e.id,c=e.label,a=e.onChange,s=e.value,i=void 0===s?"":s,l=e.autoComplete,d=void 0===l?"off":l,m=e.required,f=void 0!==m&&m,O=e.errorId,g=e.errorMessage,h=void 0===g?Object(u.__)("Please select a country.",'woocommerce'):g,v=Object(o.useMemo)((function(){return Object.keys(n).map((function(e){return{value:e,label:Object(p.decodeEntities)(n[e])}}))}),[n]);return Object(o.createElement)("div",{className:b()(t,"wc-block-components-country-input")},Object(o.createElement)(j,{id:r,label:c,onChange:a,options:v,value:i,errorId:O,errorMessage:h,required:f,autoComplete:d}),"off"!==d&&Object(o.createElement)("input",{type:"text","aria-hidden":!0,autoComplete:d,value:i,onChange:function(e){var t=e.target.value.toLocaleUpperCase(),n=v.find((function(e){return 2!==t.length&&e.label.toLocaleUpperCase()===t||2===t.length&&e.value.toLocaleUpperCase()===t}));a(n?n.value:"")},style:{minHeight:"0",height:"0",border:"0",padding:"0",position:"absolute"},tabIndex:-1}))}),E=function(e){return Object(o.createElement)(v,i()({countries:l.h},e))},y=function(e){return Object(o.createElement)(v,i()({countries:l.a},e))},_=(n(270),function(e,t){var n=t.find((function(t){return t.label.toLocaleUpperCase()===e.toLocaleUpperCase()||t.value.toLocaleUpperCase()===e.toLocaleUpperCase()}));return n?n.value:""}),w=function(e){var t=e.className,n=e.id,r=e.states,c=e.country,s=e.label,i=e.onChange,l=e.autoComplete,d=void 0===l?"off":l,m=e.value,f=void 0===m?"":m,O=e.required,g=void 0!==O&&O,h=r[c],v=Object(o.useMemo)((function(){return h?Object.keys(h).map((function(e){return{value:e,label:Object(p.decodeEntities)(h[e])}})):[]}),[h]),E=Object(o.useCallback)((function(e){i(v.length>0?_(e,v):e)}),[i,v]),y=Object(o.useRef)(f);return Object(o.useEffect)((function(){y.current!==f&&(y.current=f)}),[f]),Object(o.useEffect)((function(){if(v.length>0&&y.current){var e=_(y.current,v);e!==y.current&&E(e)}}),[v,E]),v.length>0?Object(o.createElement)(o.Fragment,null,Object(o.createElement)(j,{className:b()(t,"wc-block-components-state-input"),id:n,label:s,onChange:E,options:v,value:f,errorMessage:Object(u.__)("Please select a state.",'woocommerce'),required:g,autoComplete:d}),"off"!==d&&Object(o.createElement)("input",{type:"text","aria-hidden":!0,autoComplete:d,value:f,onChange:function(e){return E(e.target.value)},style:{minHeight:"0",height:"0",border:"0",padding:"0",position:"absolute"},tabIndex:-1})):Object(o.createElement)(a.a,{className:t,id:n,label:s,onChange:E,autoComplete:d,value:f,required:g})},k=function(e){return Object(o.createElement)(w,i()({states:l.i},e))},S=function(e){return Object(o.createElement)(w,i()({states:l.b},e))},C=n(62),P=n(3),N=n(113);function x(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function R(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?x(Object(n),!0).forEach((function(t){c()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):x(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}t.a=Object(m.withInstanceId)((function(e){var t=e.id,n=e.fields,r=void 0===n?Object.keys(P.defaultAddressFields):n,s=e.fieldConfig,i=void 0===s?{}:s,l=e.instanceId,p=e.onChange,d=e.type,b=void 0===d?"shipping":d,m=e.values,f=Object(O.b)(),g=f.getValidationError,h=f.setValidationErrors,j=f.clearValidationError,v=Object(C.a)(r),_=g("shipping-missing-country")||{},w=Object(o.useMemo)((function(){return Object(N.a)(v,i,m.country)}),[v,i,m.country]);return Object(o.useEffect)((function(){w.forEach((function(e){e.hidden&&m[e.key]&&p(R(R({},m),{},c()({},e.key,"")))}))}),[w,p,m]),Object(o.useEffect)((function(){"shipping"===b&&function(e,t,n,r){r||e.country||!(e.city||e.state||e.postcode)||t({"shipping-missing-country":{message:Object(u.__)("Please select a country to calculate rates.",'woocommerce'),hidden:!1}}),r&&e.country&&n("shipping-missing-country")}(m,h,j,!!_.message&&!_.hidden)}),[m,_.message,_.hidden,h,j,b]),t=t||l,Object(o.createElement)("div",{id:t,className:"wc-block-components-address-form"},w.map((function(e){if(e.hidden)return null;if("country"===e.key){var n="shipping"===b?E:y;return Object(o.createElement)(n,{key:e.key,id:"".concat(t,"-").concat(e.key),label:e.required?e.label:e.optionalLabel,value:m.country,autoComplete:e.autocomplete,onChange:function(e){return p(R(R({},m),{},{country:e,state:""}))},errorId:"shipping"===b?"shipping-missing-country":null,errorMessage:e.errorMessage,required:e.required})}if("state"===e.key){var r="shipping"===b?k:S;return Object(o.createElement)(r,{key:e.key,id:"".concat(t,"-").concat(e.key),country:m.country,label:e.required?e.label:e.optionalLabel,value:m.state,autoComplete:e.autocomplete,onChange:function(e){return p(R(R({},m),{},{state:e}))},errorMessage:e.errorMessage,required:e.required})}return Object(o.createElement)(a.a,{key:e.key,id:"".concat(t,"-").concat(e.key),className:"wc-block-components-address-form__".concat(e.key),label:e.required?e.label:e.optionalLabel,value:m[e.key],autoCapitalize:e.autocapitalize,autoComplete:e.autocomplete,onChange:function(t){return p(R(R({},m),{},c()({},e.key,t)))},errorMessage:e.errorMessage,required:e.required})})))}))},510:function(e,t,n){"use strict";var r=n(9),c=n.n(r),o=n(8),a=n.n(o),s=n(0),i=n(6),l=n.n(i),u=n(1),p=n(43),d=n(27),b=n(3),m=function(e){var t=e.selectedShippingRates;return Object(s.createElement)("div",{className:"wc-block-components-totals-item__description wc-block-components-totals-shipping__via"},Object(u.__)("via",'woocommerce')," ",t.join(", "))},f=n(890),O=n(200),g=function(e){var t=e.hasRates,n=e.shippingRates,r=e.shippingRatesLoading,c=t?Object(u.__)("Shipping options",'woocommerce'):Object(u.__)("Choose a shipping option",'woocommerce');return Object(s.createElement)("fieldset",{className:"wc-block-components-totals-shipping__fieldset"},Object(s.createElement)("legend",{className:"screen-reader-text"},c),Object(s.createElement)(O.a,{className:"wc-block-components-totals-shipping__options",collapsible:!0,noResultsMessage:Object(s.createElement)(f.a,{isDismissible:!1,className:l()("wc-block-components-shipping-rates-control__no-results-notice","woocommerce-error")},Object(u.__)("No shipping options were found.",'woocommerce')),shippingRates:n,shippingRatesLoading:r}))},h=n(75),j=n(90),v=n(34),E=n.n(v),y=n(132),_=(n(190),n(504)),w=function(e){var t=e.address,n=e.onUpdate,r=e.addressFields,c=Object(s.useState)(t),o=a()(c,2),i=o[0],l=o[1],p=Object(y.b)(),d=p.hasValidationErrors,b=p.showAllValidationErrors;return Object(s.createElement)("form",{className:"wc-block-components-shipping-calculator-address"},Object(s.createElement)(_.a,{fields:r,onChange:l,values:i}),Object(s.createElement)(j.a,{className:"wc-block-components-shipping-calculator-address__button",disabled:E()(i,t),onClick:function(e){if(e.preventDefault(),b(),!d)return n(i)},type:"submit"},Object(u.__)("Update",'woocommerce')))},k=function(e){var t=e.onUpdate,n=void 0===t?function(){}:t,r=e.addressFields,c=void 0===r?["country","state","city","postcode"]:r,o=Object(h.b)(),a=o.shippingAddress,i=o.setShippingAddress;return Object(s.createElement)("div",{className:"wc-block-components-shipping-calculator"},Object(s.createElement)(w,{address:a,addressFields:c,onUpdate:function(e){i(e),n(e)}}))},S=n(38),C=n.n(S),P=n(25),N=function(e){var t=e.address;if(0===Object.values(t).length)return null;var n=Object(b.getSetting)("shippingCountries",{}),r=Object(b.getSetting)("shippingStates",{}),c="string"==typeof n[t.country]?Object(P.decodeEntities)(n[t.country]):"",o="object"===C()(r[t.country])&&"string"==typeof r[t.country][t.state]?Object(P.decodeEntities)(r[t.country][t.state]):t.state,a=[];a.push(t.postcode.toUpperCase()),a.push(t.city),a.push(o),a.push(c);var i=a.filter(Boolean).join(", ");return i?Object(s.createElement)("span",{className:"wc-block-components-shipping-address"},Object(u.sprintf)(
/* translators: %s location. */
Object(u.__)("Shipping to %s",'woocommerce'),i)+" "):null},x=(n(267),function(e){var t=e.label,n=void 0===t?Object(u.__)("Calculate",'woocommerce'):t,r=e.isShippingCalculatorOpen,c=e.setIsShippingCalculatorOpen;return Object(s.createElement)("button",{className:"wc-block-components-totals-shipping__change-address-button",onClick:function(){c(!r)},"aria-expanded":r},n)}),R=function(e){var t=e.showCalculator,n=e.isShippingCalculatorOpen,r=e.setIsShippingCalculatorOpen,c=e.shippingAddress;return Object(s.createElement)(s.Fragment,null,Object(s.createElement)(N,{address:c}),t&&Object(s.createElement)(x,{label:Object(u.__)("(change address)",'woocommerce'),isShippingCalculatorOpen:n,setIsShippingCalculatorOpen:r}))},T=function(e){var t=e.showCalculator,n=e.isShippingCalculatorOpen,r=e.setIsShippingCalculatorOpen;return t?Object(s.createElement)(x,{isShippingCalculatorOpen:n,setIsShippingCalculatorOpen:r}):Object(s.createElement)("em",null,Object(u.__)("Calculated during checkout",'woocommerce'))};t.a=function(e){var t=e.currency,n=e.values,r=e.showCalculator,o=void 0===r||r,i=e.showRateSelector,f=void 0===i||i,O=e.className,h=Object(s.useState)(!1),j=a()(h,2),v=j[0],E=j[1],y=Object(p.a)(),_=y.shippingAddress,w=y.cartHasCalculatedShipping,S=y.shippingRates,C=y.shippingRatesLoading,P=Object(b.getSetting)("displayCartPricesIncludingTax",!1)?parseInt(n.total_shipping,10)+parseInt(n.total_shipping_tax,10):parseInt(n.total_shipping,10),N=S.some((function(e){return e.shipping_rates.length}))||P,x={isShippingCalculatorOpen:v,setIsShippingCalculatorOpen:E},A=S.flatMap((function(e){return e.shipping_rates.filter((function(e){return e.selected})).flatMap((function(e){return e.name}))}));return Object(s.createElement)("div",{className:l()("wc-block-components-totals-shipping",O)},Object(s.createElement)(d.TotalsItem,{label:Object(u.__)("Shipping",'woocommerce'),value:w?P:Object(s.createElement)(T,c()({showCalculator:o},x)),description:Object(s.createElement)(s.Fragment,null,w&&Object(s.createElement)(s.Fragment,null,Object(s.createElement)(m,{selectedShippingRates:A}),Object(s.createElement)(R,c()({shippingAddress:_,showCalculator:o},x)))),currency:t}),o&&v&&Object(s.createElement)(k,{onUpdate:function(){E(!1)}}),f&&w&&Object(s.createElement)(g,{hasRates:N,shippingRates:S,shippingRatesLoading:C}))}},517:function(e,t,n){"use strict";n.d(t,"a",(function(){return f}));var r=n(8),c=n.n(r),o=n(0),a=n(4),s=n(1),i=n(3),l=n(33),u=n.n(l),p=[],d=n(9),b=n.n(d),m=function(e){return Object(o.createElement)("div",b()({className:"edit-post-welcome-guide__image edit-post-welcome-guide__image__prm-np",style:{display:"flex",justifyContent:"center",alignItems:"center"}},e),Object(o.createElement)("svg",{height:"120",viewBox:"0 0 170 120",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Object(o.createElement)("g",{filter:"url(#filter0_ddd)"},Object(o.createElement)("rect",{x:"5.5",y:"18",width:"159",height:"96",rx:"3",fill:"white"}),Object(o.createElement)("rect",{x:"24.5",y:"4",width:"51",height:"22",rx:"3",fill:"white"}),Object(o.createElement)("rect",{x:"94.5",y:"4",width:"51",height:"22",rx:"3",fill:"white"})),Object(o.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M48.8908 42H125.078C129.899 42 133.802 45.9231 133.802 50.7692V80C133.802 84.8462 129.899 88.7692 125.078 88.7692H97.756L101.506 98L85.0135 88.7692H48.929C44.1076 88.7692 40.2045 84.8462 40.2045 80V50.7692C40.1662 45.9615 44.0693 42 48.8908 42Z",fill:"#7F54B3"}),Object(o.createElement)("path",{d:"M44.8709 50.723C45.4039 50.0175 46.2033 49.6462 47.2693 49.5719C49.2108 49.4234 50.3149 50.3145 50.5814 52.2453C51.7615 60.0056 53.0559 66.5778 54.4264 71.9617L62.7637 56.4782C63.5251 55.0673 64.4768 54.3246 65.6189 54.2504C67.294 54.139 68.3219 55.1786 68.7406 57.3694C69.6924 62.3077 70.9106 66.5035 72.3573 70.0681C73.3471 60.6369 75.0222 53.8419 77.3825 49.6462C77.9535 48.6065 78.7911 48.0867 79.8951 48.0124C80.7707 47.9382 81.5702 48.1981 82.2935 48.755C83.0168 49.312 83.3975 50.0175 83.4736 50.8715C83.5117 51.5398 83.3975 52.0968 83.0929 52.6538C81.6082 55.3272 80.39 59.82 79.4002 66.0579C78.4484 72.1102 78.1058 76.8258 78.3342 80.2047C78.4104 81.133 78.2581 81.9499 77.8774 82.6553C77.4205 83.4722 76.7353 83.9178 75.8597 83.9921C74.8699 84.0663 73.842 83.6207 72.8522 82.6182C69.3117 79.0908 66.4945 73.8183 64.4388 66.8006C61.9642 71.5533 60.1369 75.1178 58.9567 77.4942C56.7106 81.69 54.8071 83.8435 53.2082 83.9549C52.1803 84.0292 51.3047 83.1752 50.5433 81.3929C48.6017 76.5288 46.5079 67.1347 44.2618 53.2107C44.1476 52.2453 44.3379 51.3913 44.8709 50.723Z",fill:"white"}),Object(o.createElement)("path",{d:"M126.922 56.5426C125.536 54.1968 123.495 52.7819 120.761 52.2234C120.029 52.0745 119.336 52 118.681 52C114.985 52 111.981 53.8617 109.632 57.5851C107.63 60.75 106.629 64.25 106.629 68.0851C106.629 70.9521 107.245 73.4096 108.477 75.4574C109.863 77.8032 111.904 79.2181 114.638 79.7766C115.37 79.9255 116.063 80 116.717 80C120.453 80 123.456 78.1383 125.767 74.4149C127.769 71.2128 128.77 67.7128 128.77 63.8777C128.77 60.9734 128.154 58.5532 126.922 56.5426ZM122.07 66.8564C121.531 69.3138 120.568 71.1383 119.143 72.367C118.027 73.3351 116.987 73.7447 116.024 73.5585C115.1 73.3723 114.33 72.5904 113.752 71.1383C113.29 69.984 113.059 68.8298 113.059 67.75C113.059 66.8192 113.136 65.8883 113.329 65.0319C113.675 63.5053 114.33 62.016 115.37 60.6011C116.64 58.7766 117.988 58.0319 119.374 58.2925C120.299 58.4787 121.069 59.2606 121.646 60.7128C122.108 61.867 122.339 63.0213 122.339 64.1011C122.339 65.0691 122.224 66 122.07 66.8564Z",fill:"white"}),Object(o.createElement)("path",{d:"M102.767 56.5426C101.381 54.1968 99.3018 52.7819 96.6063 52.2234C95.8747 52.0745 95.1816 52 94.5269 52C90.8303 52 87.8267 53.8617 85.4778 57.5851C83.4755 60.75 82.4743 64.25 82.4743 68.0851C82.4743 70.9521 83.0904 73.4096 84.3226 75.4574C85.7089 77.8032 87.7497 79.2181 90.4837 79.7766C91.2153 79.9255 91.9085 80 92.5631 80C96.2983 80 99.3018 78.1383 101.612 74.4149C103.615 71.2128 104.616 67.7128 104.616 63.8777C104.616 60.9734 104 58.5532 102.767 56.5426ZM97.9155 66.8564C97.3765 69.3138 96.4138 71.1383 94.989 72.367C93.8723 73.3351 92.8326 73.7447 91.87 73.5585C90.9458 73.3723 90.1757 72.5904 89.5981 71.1383C89.136 69.984 88.9049 68.8298 88.9049 67.75C88.9049 66.8192 88.9819 65.8883 89.1745 65.0319C89.521 63.5053 90.1757 62.016 91.2153 60.6011C92.4861 58.7766 93.8338 58.0319 95.2201 58.2925C96.1442 58.4787 96.9144 59.2606 97.492 60.7128C97.9541 61.867 98.1851 63.0213 98.1851 64.1011C98.1851 65.0691 98.1081 66 97.9155 66.8564Z",fill:"white"}),Object(o.createElement)("defs",null,Object(o.createElement)("filter",{id:"filter0_ddd",x:"0.5",y:"0",width:"169",height:"120",filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB"},Object(o.createElement)("feFlood",{floodOpacity:"0",result:"BackgroundImageFix"}),Object(o.createElement)("feColorMatrix",{in:"SourceAlpha",type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"}),Object(o.createElement)("feOffset",{dy:"1"}),Object(o.createElement)("feGaussianBlur",{stdDeviation:"1.5"}),Object(o.createElement)("feColorMatrix",{type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.2 0"}),Object(o.createElement)("feBlend",{mode:"normal",in2:"BackgroundImageFix",result:"effect1_dropShadow"}),Object(o.createElement)("feColorMatrix",{in:"SourceAlpha",type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"}),Object(o.createElement)("feOffset",{dy:"1"}),Object(o.createElement)("feGaussianBlur",{stdDeviation:"2.5"}),Object(o.createElement)("feColorMatrix",{type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.12 0"}),Object(o.createElement)("feBlend",{mode:"normal",in2:"effect1_dropShadow",result:"effect2_dropShadow"}),Object(o.createElement)("feColorMatrix",{in:"SourceAlpha",type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"}),Object(o.createElement)("feOffset",{dy:"2"}),Object(o.createElement)("feGaussianBlur",{stdDeviation:"1"}),Object(o.createElement)("feColorMatrix",{type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.14 0"}),Object(o.createElement)("feBlend",{mode:"normal",in2:"effect2_dropShadow",result:"effect3_dropShadow"}),Object(o.createElement)("feBlend",{mode:"normal",in:"SourceGraphic",in2:"effect3_dropShadow",result:"shape"})))))};function f(e){var t=function(e){var t=function(e,t){var n=Object(o.useState)((function(){var n=window.localStorage.getItem(e);if(n)try{return JSON.parse(n)}catch(t){console.error("Value for key '".concat(e,"' could not be retrieved from localStorage because it can't be parsed."))}return t})),r=c()(n,2),a=r[0],s=r[1];return Object(o.useEffect)((function(){try{window.localStorage.setItem(e,JSON.stringify(a))}catch(t){console.error("Value for key '".concat(e,"' could not be saved in localStorage because it can't be converted into a string."))}}),[e,a]),[a,s]}("wc-blocks_dismissed_compatibility_notices",p),n=c()(t,2),r=n[0],a=n[1],s=Object(o.useState)(!1),i=c()(s,2),l=i[0],d=i[1],b=r.includes(e);return Object(o.useEffect)((function(){d(!b)}),[b]),[l,function(){var t=new Set(r);t.add(e),a(u()(t))}]}(e.blockName),n=c()(t,2),r=n[0],l=n[1];return Object(i.isWpVersion)("5.4","<=")||!r?null:Object(o.createElement)(a.Guide,{className:"edit-post-welcome-guide",contentLabel:Object(s.__)("Compatibility notice",'woocommerce'),onFinish:function(){return l()},finishButtonText:Object(s.__)("Got it!",'woocommerce'),pages:[{image:Object(o.createElement)(m,null),content:Object(o.createElement)(o.Fragment,null,Object(o.createElement)("h1",{className:"edit-post-welcome-guide__heading"},Object(s.__)("Compatibility notice",'woocommerce')),Object(o.createElement)("p",{className:"edit-post-welcome-guide__text"},Object(o.createInterpolateElement)(Object(s.__)("This block may not be compatible with <em>all</em> checkout extensions and integrations.",'woocommerce'),{em:Object(o.createElement)("em",null)})),Object(o.createElement)("p",{className:"edit-post-welcome-guide__text"},Object(o.createInterpolateElement)(Object(s.__)("We recommend reviewing our <a>expanding list</a> of compatible extensions prior to using this block on a live store.",'woocommerce'),{a:Object(o.createElement)("a",{href:"https://docs.woocommerce.com/document/cart-checkout-blocks-support-status/",target:"_blank",rel:"noopener noreferrer"})})))}]})}},518:function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(1),c=n(37),o=n(3),a=[{destination:{address_1:"",address_2:"",city:"",state:"",postcode:"",country:""},package_id:0,name:Object(r.__)("Shipping",'woocommerce'),items:[{key:"33e75ff09dd601bbe69f351039152189",name:Object(r._x)("Beanie with Logo","example product in Cart Block",'woocommerce'),quantity:2},{key:"6512bd43d9caa6e02c990b0a82652dca",name:Object(r._x)("Beanie","example product in Cart Block",'woocommerce'),quantity:1}],shipping_rates:[{currency_code:"USD",currency_symbol:"$",currency_minor_unit:2,currency_decimal_separator:".",currency_thousand_separator:",",currency_prefix:"$",currency_suffix:"",name:Object(r.__)("Free shipping",'woocommerce'),description:"",delivery_time:"",price:"000",taxes:"0",rate_id:"free_shipping:1",instance_id:0,meta_data:[],method_id:"flat_rate",selected:!0},{currency_code:"USD",currency_symbol:"$",currency_minor_unit:2,currency_decimal_separator:".",currency_thousand_separator:",",currency_prefix:"$",currency_suffix:"",name:Object(r.__)("Local pickup",'woocommerce'),description:"",delivery_time:"",price:"200",taxes:"0",rate_id:"local_pickup:1",instance_id:1,meta_data:[],method_id:"local_pickup",selected:!1}]}],s=Object(o.getSetting)("displayCartPricesIncludingTax",!1),i={coupons:[],shipping_rates:Object(o.getSetting)("shippingMethodsExist",!1)?a:[],items:[{key:"1",id:1,quantity:2,name:Object(r.__)("Beanie",'woocommerce'),short_description:Object(r.__)("Warm hat for winter",'woocommerce'),description:"Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.",sku:"woo-beanie",permalink:"https://example.org",low_stock_remaining:2,backorders_allowed:!1,show_backorder_badge:!1,sold_individually:!1,images:[{id:10,src:c.m+"previews/beanie.jpg",thumbnail:c.m+"previews/beanie.jpg",srcset:"",sizes:"",name:"",alt:""}],variation:[{attribute:Object(r.__)("Color",'woocommerce'),value:Object(r.__)("Yellow",'woocommerce')},{attribute:Object(r.__)("Size",'woocommerce'),value:Object(r.__)("Small",'woocommerce')}],prices:{currency_code:"USD",currency_symbol:"$",currency_minor_unit:2,currency_decimal_separator:".",currency_thousand_separator:",",currency_prefix:"$",currency_suffix:"",price:s?"800":"640",regular_price:s?"800":"640",sale_price:s?"800":"640",raw_prices:{precision:6,price:s?"8000000":"6400000",regular_price:s?"8000000":"6400000",sale_price:s?"8000000":"6400000"}},totals:{currency_code:"USD",currency_symbol:"$",currency_minor_unit:2,currency_decimal_separator:".",currency_thousand_separator:",",currency_prefix:"$",currency_suffix:"",line_subtotal:s?"1600":"1280",line_subtotal_tax:"0",line_total:"1600",line_total_tax:s?"0":"320"},extensions:{}},{key:"2",id:2,quantity:1,name:Object(r.__)("Cap",'woocommerce'),short_description:Object(r.__)("Lightweight baseball cap",'woocommerce'),description:"Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.",sku:"woo-cap",permalink:"https://example.org",backorders_allowed:!1,show_backorder_badge:!1,sold_individually:!1,images:[{id:11,src:c.m+"previews/cap.jpg",thumbnail:c.m+"previews/cap.jpg",srcset:"",sizes:"",name:"",alt:""}],variation:[{attribute:Object(r.__)("Color",'woocommerce'),value:Object(r.__)("Orange",'woocommerce')}],prices:{currency_code:"USD",currency_symbol:"$",currency_minor_unit:2,currency_decimal_separator:".",currency_thousand_separator:",",currency_prefix:"$",currency_suffix:"",price:s?"1400":"1120",regular_price:s?"1600":"1280",sale_price:s?"1400":"1120",raw_prices:{precision:6,price:s?"14000000":"11200000",regular_price:s?"16000000":"12800000",sale_price:s?"14000000":"11200000"}},totals:{currency_code:"USD",currency_symbol:"$",currency_minor_unit:2,currency_decimal_separator:".",currency_thousand_separator:",",currency_prefix:"$",currency_suffix:"",line_subtotal:s?"1400":"1120",line_subtotal_tax:s?"0":"280",line_total:"1400",line_total_tax:s?"0":"280"},extensions:{}}],fees:[],items_count:3,items_weight:0,needs_payment:!0,needs_shipping:Object(o.getSetting)("shippingEnabled",!0),has_calculated_shipping:!0,shipping_address:{first_name:"",last_name:"",company:"",address_1:"",address_2:"",city:"",state:"",postcode:"",country:"",phone:""},billing_address:{first_name:"",last_name:"",company:"",address_1:"",address_2:"",city:"",state:"",postcode:"",country:"",email:"",phone:""},totals:{currency_code:"USD",currency_symbol:"$",currency_minor_unit:2,currency_decimal_separator:".",currency_thousand_separator:",",currency_prefix:"$",currency_suffix:"",total_items:s?"3000":"2400",total_items_tax:"0",total_fees:"0",total_fees_tax:"0",total_discount:"0",total_discount_tax:"0",total_shipping:"0",total_shipping_tax:"0",total_tax:"600",total_price:"3000",tax_lines:[{name:Object(r.__)("Sales tax",'woocommerce'),rate:"20%",price:600}]},errors:[],payment_requirements:["products"],generated_timestamp:Date.now(),extensions:{}}},53:function(e,t,n){"use strict";var r=n(9),c=n.n(r),o=n(5),a=n.n(o),s=n(16),i=n.n(s),l=n(0),u=n(166),p=n(6),d=n.n(p),b=(n(175),["className","value","currency","onValueChange","displayType"]);function m(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function f(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?m(Object(n),!0).forEach((function(t){a()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):m(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}t.a=function(e){var t=e.className,n=e.value,r=e.currency,o=e.onValueChange,a=e.displayType,s=void 0===a?"text":a,p=i()(e,b),m="string"==typeof n?parseInt(n,10):n;if(!Number.isFinite(m))return null;var O=m/Math.pow(10,r.minorUnit);if(!Number.isFinite(O))return null;var g=d()("wc-block-formatted-money-amount","wc-block-components-formatted-money-amount",t),h=f(f(f({},p),function(e){return{thousandSeparator:e.thousandSeparator,decimalSeparator:e.decimalSeparator,decimalScale:e.minorUnit,fixedDecimalScale:!0,prefix:e.prefix,suffix:e.suffix,isNumericString:!0}}(r)),{},{value:void 0,currency:void 0,onValueChange:void 0}),j=o?function(e){var t=e.value*Math.pow(10,r.minorUnit);o(t)}:function(){};return Object(l.createElement)(u.a,c()({className:g,displayType:s},h,{value:O,onValueChange:j}))}},535:function(e){e.exports=JSON.parse('{"name":"woocommerce/checkout-fields-block","version":"1.0.0","title":"Checkout Fields","description":"Column containing checkout address fields.","category":"woocommerce","supports":{"align":false,"html":false,"multiple":false,"reusable":false,"inserter":false},"attributes":{"lock":{"type":"object","default":{"remove":true,"move":true}}},"parent":["woocommerce/checkout"],"textdomain":'woocommerce',"apiVersion":2}')},536:function(e){e.exports=JSON.parse('{"name":"woocommerce/checkout-totals-block","version":"1.0.0","title":"Checkout Totals","description":"Column containing the checkout totals.","category":"woocommerce","supports":{"align":false,"html":false,"multiple":false,"reusable":false,"inserter":false},"attributes":{"checkbox":{"type":"boolean","default":false},"text":{"type":"string","required":false}},"parent":["woocommerce/checkout"],"textdomain":'woocommerce',"apiVersion":2}')},537:function(e){e.exports=JSON.parse('{"name":"woocommerce/checkout-shipping-address-block","version":"1.0.0","title":"Shipping Address","description":"Collect your customer\'s shipping address.","category":"woocommerce","supports":{"align":false,"html":false,"multiple":false,"reusable":false,"inserter":false},"attributes":{"lock":{"type":"object","default":{"remove":true,"move":true}}},"parent":["woocommerce/checkout-fields-block"],"textdomain":'woocommerce',"apiVersion":2}')},538:function(e){e.exports=JSON.parse('{"name":"woocommerce/checkout-terms-block","version":"1.0.0","title":"Terms and Conditions","description":"Ensure customers agree to your terms and conditions and privacy policy.","category":"woocommerce","supports":{"align":false,"html":false,"multiple":false,"reusable":false},"attributes":{"checkbox":{"type":"boolean","default":false},"text":{"type":"string","required":false}},"parent":["woocommerce/checkout-fields-block"],"textdomain":'woocommerce',"apiVersion":2}')},539:function(e){e.exports=JSON.parse('{"name":"woocommerce/checkout-contact-information-block","version":"1.0.0","title":"Contact Information","description":"Collect your customer\'s contact information.","category":"woocommerce","supports":{"align":false,"html":false,"multiple":false,"reusable":false,"inserter":false},"attributes":{"lock":{"type":"object","default":{"remove":true,"move":true}}},"parent":["woocommerce/checkout-fields-block"],"textdomain":'woocommerce',"apiVersion":2}')},540:function(e){e.exports=JSON.parse('{"name":"woocommerce/checkout-billing-address-block","version":"1.0.0","title":"Billing Address","description":"Collect your customer\'s billing address.","category":"woocommerce","supports":{"align":false,"html":false,"multiple":false,"reusable":false,"inserter":false},"attributes":{"lock":{"type":"object","default":{"remove":true,"move":true}}},"parent":["woocommerce/checkout-fields-block"],"textdomain":'woocommerce',"apiVersion":2}')},541:function(e){e.exports=JSON.parse('{"name":"woocommerce/checkout-actions-block","version":"1.0.0","title":"Actions","description":"Allow customers to place their order.","category":"woocommerce","supports":{"align":false,"html":false,"multiple":false,"reusable":false,"inserter":false},"attributes":{"lock":{"type":"object","default":{"remove":true,"move":true}}},"parent":["woocommerce/checkout-fields-block"],"textdomain":'woocommerce',"apiVersion":2}')},542:function(e){e.exports=JSON.parse('{"name":"woocommerce/checkout-order-note-block","version":"1.0.0","title":"Order Note","description":"Allow customers to add a note to their order.","category":"woocommerce","supports":{"align":false,"html":false,"multiple":false,"reusable":false,"inserter":false},"attributes":{"lock":{"type":"object","default":{"remove":true,"move":true}}},"parent":["woocommerce/checkout-fields-block"],"textdomain":'woocommerce',"apiVersion":2}')},543:function(e){e.exports=JSON.parse('{"name":"woocommerce/checkout-order-summary-block","version":"1.0.0","title":"Order Summary","description":"Show customers a summary of their order.","category":"woocommerce","supports":{"align":false,"html":false,"multiple":false,"reusable":false,"inserter":false},"attributes":{"lock":{"type":"object","default":{"remove":true}}},"parent":["woocommerce/checkout-totals-block"],"textdomain":'woocommerce',"apiVersion":2}')},544:function(e){e.exports=JSON.parse('{"name":"woocommerce/checkout-payment-block","version":"1.0.0","title":"Payment Options","description":"Payment options for your store.","category":"woocommerce","supports":{"align":false,"html":false,"multiple":false,"reusable":false,"inserter":false},"attributes":{"lock":{"type":"object","default":{"remove":true,"move":true}}},"parent":["woocommerce/checkout-fields-block"],"textdomain":'woocommerce',"apiVersion":2}')},545:function(e){e.exports=JSON.parse('{"name":"woocommerce/checkout-express-payment-block","version":"1.0.0","title":"Express Checkout","description":"Provide an express payment option for your customers.","category":"woocommerce","supports":{"align":false,"html":false,"multiple":false,"reusable":false,"inserter":false},"attributes":{"lock":{"type":"object","default":{"remove":true,"move":true}}},"parent":["woocommerce/checkout-fields-block"],"textdomain":'woocommerce',"apiVersion":2}')},546:function(e){e.exports=JSON.parse('{"name":"woocommerce/checkout-shipping-methods-block","version":"1.0.0","title":"Shipping Options","description":"Shipping options for your store.","category":"woocommerce","supports":{"align":false,"html":false,"multiple":false,"reusable":false,"inserter":false},"attributes":{"lock":{"type":"object","default":{"remove":true,"move":true}}},"parent":["woocommerce/checkout-fields-block"],"textdomain":'woocommerce',"apiVersion":2}')},55:function(e,t){e.exports=window.wp.hooks},56:function(e,t){e.exports=window.wp.deprecated},567:function(e,t,n){"use strict";var r=n(0),c=n(28),o=Object(r.createElement)(c.SVG,{xmlns:"http://www.w3.org/2000/SVG",viewBox:"0 0 24 24"},Object(r.createElement)("path",{fill:"none",d:"M0 0h24v24H0z"}),Object(r.createElement)("path",{d:"M9 16.2L4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4L9 16.2z"}));t.a=o},57:function(e,t,n){"use strict";n.d(t,"b",(function(){return F})),n.d(t,"a",(function(){return B}));var r,c=n(8),o=n.n(c),a=n(0),s=n(1),i=n(136),l=n(56),u=n.n(l),p=n(72);!function(e){e.SET_IDLE="set_idle",e.SET_PRISTINE="set_pristine",e.SET_REDIRECT_URL="set_redirect_url",e.SET_COMPLETE="set_checkout_complete",e.SET_BEFORE_PROCESSING="set_before_processing",e.SET_AFTER_PROCESSING="set_after_processing",e.SET_PROCESSING_RESPONSE="set_processing_response",e.SET_PROCESSING="set_checkout_is_processing",e.SET_HAS_ERROR="set_checkout_has_error",e.SET_NO_ERROR="set_checkout_no_error",e.SET_CUSTOMER_ID="set_checkout_customer_id",e.SET_ORDER_ID="set_checkout_order_id",e.SET_ORDER_NOTES="set_checkout_order_notes",e.INCREMENT_CALCULATING="increment_calculating",e.DECREMENT_CALCULATING="decrement_calculating",e.SET_SHOULD_CREATE_ACCOUNT="set_should_create_account",e.SET_EXTENSION_DATA="set_extension_data"}(r||(r={}));var d,b,m=function(){return{type:r.SET_IDLE}},f=function(e){return{type:r.SET_REDIRECT_URL,redirectUrl:e}},O=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{type:r.SET_COMPLETE,data:e}},g=function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return{type:e?r.SET_HAS_ERROR:r.SET_NO_ERROR}},h=n(5),j=n.n(h),v=n(3);function E(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}!function(e){e.PRISTINE="pristine",e.IDLE="idle",e.PROCESSING="processing",e.COMPLETE="complete",e.BEFORE_PROCESSING="before_processing",e.AFTER_PROCESSING="after_processing"}(b||(b={}));var y=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?E(Object(n),!0).forEach((function(t){j()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):E(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({order_id:0,customer_id:0},(null===(d=Object(v.getSetting)("preloadedApiRequests",{})["/wc/store/checkout"])||void 0===d?void 0:d.body)||{}),_={redirectUrl:"",status:b.PRISTINE,hasError:!1,calculatingCount:0,orderId:y.order_id,orderNotes:"",customerId:y.customer_id,shouldCreateAccount:!1,processingResponse:null,extensionData:{}};function w(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function k(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?w(Object(n),!0).forEach((function(t){j()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):w(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var S=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:_,t=arguments.length>1?arguments[1]:void 0,n=t.redirectUrl,c=t.type,o=t.customerId,a=t.orderId,s=t.orderNotes,i=t.extensionData,l=t.shouldCreateAccount,u=t.data,p=e;switch(c){case r.SET_PRISTINE:p=_;break;case r.SET_IDLE:p=e.status!==b.IDLE?k(k({},e),{},{status:b.IDLE}):e;break;case r.SET_REDIRECT_URL:p=void 0!==n&&n!==e.redirectUrl?k(k({},e),{},{redirectUrl:n}):e;break;case r.SET_PROCESSING_RESPONSE:p=k(k({},e),{},{processingResponse:u});break;case r.SET_COMPLETE:p=e.status!==b.COMPLETE?k(k({},e),{},{status:b.COMPLETE,redirectUrl:void 0!==u&&"string"==typeof u.redirectUrl&&u.redirectUrl?u.redirectUrl:e.redirectUrl}):e;break;case r.SET_PROCESSING:p=!1===(p=e.status!==b.PROCESSING?k(k({},e),{},{status:b.PROCESSING,hasError:!1}):e).hasError?p:k(k({},p),{},{hasError:!1});break;case r.SET_BEFORE_PROCESSING:p=e.status!==b.BEFORE_PROCESSING?k(k({},e),{},{status:b.BEFORE_PROCESSING,hasError:!1}):e;break;case r.SET_AFTER_PROCESSING:p=e.status!==b.AFTER_PROCESSING?k(k({},e),{},{status:b.AFTER_PROCESSING}):e;break;case r.SET_HAS_ERROR:p=e.hasError?e:k(k({},e),{},{hasError:!0}),p=e.status===b.PROCESSING||e.status===b.BEFORE_PROCESSING?k(k({},p),{},{status:b.IDLE}):p;break;case r.SET_NO_ERROR:p=e.hasError?k(k({},e),{},{hasError:!1}):e;break;case r.INCREMENT_CALCULATING:p=k(k({},e),{},{calculatingCount:e.calculatingCount+1});break;case r.DECREMENT_CALCULATING:p=k(k({},e),{},{calculatingCount:Math.max(0,e.calculatingCount-1)});break;case r.SET_CUSTOMER_ID:p=void 0!==o?k(k({},e),{},{customerId:o}):e;break;case r.SET_ORDER_ID:p=void 0!==a?k(k({},e),{},{orderId:a}):e;break;case r.SET_SHOULD_CREATE_ACCOUNT:void 0!==l&&l!==e.shouldCreateAccount&&(p=k(k({},e),{},{shouldCreateAccount:l}));break;case r.SET_ORDER_NOTES:void 0!==s&&e.orderNotes!==s&&(p=k(k({},e),{},{orderNotes:s}));break;case r.SET_EXTENSION_DATA:void 0!==i&&e.extensionData!==i&&(p=k(k({},e),{},{extensionData:i}))}return p!==e&&c!==r.SET_PRISTINE&&p.status===b.PRISTINE&&(p.status=b.IDLE),p},C=n(25),P=n(126),N=n(321),x=n(322),R=n(132),T=n(59),A=n(68),I=n(14),M=n(50),D=Object(a.createContext)({dispatchActions:{resetCheckout:function(){},setRedirectUrl:function(e){},setHasError:function(e){},setAfterProcessing:function(e){},incrementCalculating:function(){},decrementCalculating:function(){},setCustomerId:function(e){},setOrderId:function(e){},setOrderNotes:function(e){},setExtensionData:function(e){}},onSubmit:function(){},isComplete:!1,isIdle:!1,isCalculating:!1,isProcessing:!1,isBeforeProcessing:!1,isAfterProcessing:!1,hasError:!1,redirectUrl:"",orderId:0,orderNotes:"",customerId:0,onCheckoutAfterProcessingWithSuccess:function(){return function(){}},onCheckoutAfterProcessingWithError:function(){return function(){}},onCheckoutBeforeProcessing:function(){return function(){}},onCheckoutValidationBeforeProcessing:function(){return function(){}},hasOrder:!1,isCart:!1,shouldCreateAccount:!1,setShouldCreateAccount:function(e){},extensionData:{}}),F=function(){return Object(a.useContext)(D)},B=function(e){var t=e.children,n=e.redirectUrl,c=e.isCart,l=void 0!==c&&c;_.redirectUrl=n;var d,h=Object(a.useReducer)(S,_),j=o()(h,2),v=j[0],E=j[1],y=Object(R.b)().setValidationErrors,w=Object(T.a)(),k=w.addErrorNotice,F=w.removeNotices,B=Object(A.a)().dispatchCheckoutEvent,L=v.calculatingCount>0,V=Object(M.c)(),U=V.isSuccessResponse,z=V.isErrorResponse,H=V.isFailResponse,G=V.shouldRetry,q=(d=Object(M.c)().noticeContexts,{checkoutNotices:Object(I.useSelect)((function(e){return e("core/notices").getNotices("wc/checkout")}),[]),expressPaymentNotices:Object(I.useSelect)((function(e){return e("core/notices").getNotices(d.EXPRESS_PAYMENTS)}),[d.EXPRESS_PAYMENTS]),paymentNotices:Object(I.useSelect)((function(e){return e("core/notices").getNotices(d.PAYMENTS)}),[d.PAYMENTS])}),Y=q.checkoutNotices,W=q.paymentNotices,$=q.expressPaymentNotices,X=Object(a.useReducer)(P.b,{}),K=o()(X,2),J=K[0],Z=K[1],Q=Object(a.useRef)(J),ee=function(e){return Object(a.useMemo)((function(){return{onCheckoutAfterProcessingWithSuccess:Object(N.a)("checkout_after_processing_with_success",e),onCheckoutAfterProcessingWithError:Object(N.a)("checkout_after_processing_with_error",e),onCheckoutValidationBeforeProcessing:Object(N.a)("checkout_validation_before_processing",e)}}),[e])}(Z),te=ee.onCheckoutAfterProcessingWithSuccess,ne=ee.onCheckoutAfterProcessingWithError,re=ee.onCheckoutValidationBeforeProcessing;Object(a.useEffect)((function(){Q.current=J}),[J]);var ce=Object(a.useMemo)((function(){return function(){return u()("onCheckoutBeforeProcessing",{alternative:"onCheckoutValidationBeforeProcessing",plugin:"WooCommerce Blocks"}),re.apply(void 0,arguments)}}),[re]),oe=Object(a.useMemo)((function(){return{resetCheckout:function(){E({type:r.SET_PRISTINE})},setRedirectUrl:function(e){E(f(e))},setHasError:function(e){E(g(e))},incrementCalculating:function(){E({type:r.INCREMENT_CALCULATING})},decrementCalculating:function(){E({type:r.DECREMENT_CALCULATING})},setCustomerId:function(e){var t;E((t=e,{type:r.SET_CUSTOMER_ID,customerId:t}))},setOrderId:function(e){E(function(e){return{type:r.SET_ORDER_ID,orderId:e}}(e))},setOrderNotes:function(e){E(function(e){return{type:r.SET_ORDER_NOTES,orderNotes:e}}(e))},setExtensionData:function(e){E(function(e){return{type:r.SET_EXTENSION_DATA,extensionData:e}}(e))},setAfterProcessing:function(e){var t,n=function(e){var t={message:"",paymentStatus:"",redirectUrl:"",paymentDetails:{}};return"payment_result"in e&&(t.paymentStatus=e.payment_result.payment_status,t.redirectUrl=e.payment_result.redirect_url,e.payment_result.hasOwnProperty("payment_details")&&Array.isArray(e.payment_result.payment_details)&&e.payment_result.payment_details.forEach((function(e){var n=e.key,r=e.value;t.paymentDetails[n]=Object(C.decodeEntities)(r)}))),"message"in e&&(t.message=Object(C.decodeEntities)(e.message)),!t.message&&"data"in e&&"status"in e.data&&e.data.status>299&&(t.message=Object(s.__)("Something went wrong. Please contact us to get assistance.",'woocommerce')),t}(e);n.redirectUrl&&E(f(n.redirectUrl)),E((t=n,{type:r.SET_PROCESSING_RESPONSE,data:t})),E({type:r.SET_AFTER_PROCESSING})}}}),[]);Object(a.useEffect)((function(){v.status===b.BEFORE_PROCESSING&&(F("error"),Object(x.a)(Q.current,"checkout_validation_before_processing",{}).then((function(e){!0!==e?(Array.isArray(e)&&e.forEach((function(e){var t=e.errorMessage,n=e.validationErrors;k(t),y(n)})),E(m()),E(g())):E({type:r.SET_PROCESSING})})))}),[v.status,y,k,F,E]);var ae=Object(i.a)(v.status),se=Object(i.a)(v.hasError);Object(a.useEffect)((function(){if((v.status!==ae||v.hasError!==se)&&v.status===b.AFTER_PROCESSING){var e={redirectUrl:v.redirectUrl,orderId:v.orderId,customerId:v.customerId,orderNotes:v.orderNotes,processingResponse:v.processingResponse};v.hasError?Object(x.b)(Q.current,"checkout_after_processing_with_error",e).then((function(t){var n=function(e){var t=null;return e.forEach((function(e){if((z(e)||H(e))&&e.message){var n=e.messageContext?{context:e.messageContext}:void 0;t=e,k(e.message,n)}})),t}(t);if(null!==n)G(n)?E(m()):E(O(n));else{if(!(Y.some((function(e){return"error"===e.status}))||$.some((function(e){return"error"===e.status}))||W.some((function(e){return"error"===e.status})))){var r,c=(null===(r=e.processingResponse)||void 0===r?void 0:r.message)||Object(s.__)("Something went wrong. Please contact us to get assistance.",'woocommerce');k(c,{id:"checkout"})}E(m())}})):Object(x.b)(Q.current,"checkout_after_processing_with_success",e).then((function(e){var t=null,n=null;if(e.forEach((function(e){U(e)&&(t=e),(z(e)||H(e))&&(n=e)})),t&&!n)E(O(t));else if(Object(p.b)(n)){if(n.message){var r=n.messageContext?{context:n.messageContext}:void 0;k(n.message,r)}G(n)?E(g(!0)):E(O(n))}else E(O())}))}}),[v.status,v.hasError,v.redirectUrl,v.orderId,v.customerId,v.orderNotes,v.processingResponse,ae,se,oe,k,z,H,U,G,Y,$,W]);var ie={onSubmit:Object(a.useCallback)((function(){B("submit"),E({type:r.SET_BEFORE_PROCESSING})}),[B]),isComplete:v.status===b.COMPLETE,isIdle:v.status===b.IDLE,isCalculating:L,isProcessing:v.status===b.PROCESSING,isBeforeProcessing:v.status===b.BEFORE_PROCESSING,isAfterProcessing:v.status===b.AFTER_PROCESSING,hasError:v.hasError,redirectUrl:v.redirectUrl,onCheckoutBeforeProcessing:ce,onCheckoutValidationBeforeProcessing:re,onCheckoutAfterProcessingWithSuccess:te,onCheckoutAfterProcessingWithError:ne,dispatchActions:oe,isCart:l,orderId:v.orderId,hasOrder:!!v.orderId,customerId:v.customerId,orderNotes:v.orderNotes,shouldCreateAccount:v.shouldCreateAccount,setShouldCreateAccount:function(e){return E((t=e,{type:r.SET_SHOULD_CREATE_ACCOUNT,shouldCreateAccount:t}));var t},extensionData:v.extensionData};return Object(a.createElement)(D.Provider,{value:ie},t)}},59:function(e,t,n){"use strict";n.d(t,"a",(function(){return l}));var r=n(5),c=n.n(r),o=n(0),a=n(141);function s(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function i(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?s(Object(n),!0).forEach((function(t){c()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):s(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var l=function(){var e=Object(a.b)(),t=e.notices,n=e.createNotice,r=e.removeNotice,c=e.setIsSuppressed,s=Object(o.useRef)(t);Object(o.useEffect)((function(){s.current=t}),[t]);var l=Object(o.useMemo)((function(){return{hasNoticesOfType:function(e){return s.current.some((function(t){return t.type===e}))},removeNotices:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;s.current.forEach((function(t){null!==e&&t.status!==e||r(t.id)}))},removeNotice:r}}),[r]),u=Object(o.useMemo)((function(){return{addDefaultNotice:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};n("default",e,i({},t))},addErrorNotice:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};n("error",e,i({},t))},addWarningNotice:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};n("warning",e,i({},t))},addInfoNotice:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};n("info",e,i({},t))},addSuccessNotice:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};n("success",e,i({},t))}}}),[n]);return i(i(i({notices:t},l),u),{},{setIsSuppressed:c})}},60:function(e,t){e.exports=window.wc.wcBlocksRegistry},62:function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var r=n(0),c=n(34),o=n.n(c);function a(e){var t=Object(r.useRef)(e);return o()(e,t.current)||(t.current=e),t.current}},63:function(e,t,n){"use strict";n.d(t,"b",(function(){return a})),n.d(t,"a",(function(){return s}));var r=n(0),c=n(14),o=Object(r.createContext)({isEditor:!1,currentPostId:0,previewData:{},getPreviewData:function(){}}),a=function(){return Object(r.useContext)(o)},s=function(e){var t=e.children,n=e.currentPostId,a=void 0===n?0:n,s=e.previewData,i=void 0===s?{}:s,l=Object(c.useSelect)((function(e){return a||e("core/editor").getCurrentPostId()}),[a]),u=Object(r.useCallback)((function(e){return e in i?i[e]:{}}),[i]),p={isEditor:!0,currentPostId:l,previewData:i,getPreviewData:u};return Object(r.createElement)(o.Provider,{value:p},t)}},64:function(e,t){e.exports=window.wp.a11y},66:function(e,t,n){"use strict";var r=n(5),c=n.n(r),o=n(16),a=n.n(o),s=n(0),i=["srcElement","size"];function l(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}t.a=function(e){var t=e.srcElement,n=e.size,r=void 0===n?24:n,o=a()(e,i);return Object(s.isValidElement)(t)?Object(s.cloneElement)(t,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?l(Object(n),!0).forEach((function(t){c()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):l(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({width:r,height:r},o)):null}},67:function(e,t,n){"use strict";n.d(t,"b",(function(){return _})),n.d(t,"a",(function(){return w}));var r=n(8),c=n.n(r),o=n(0),a=n(3),s=n(5),i=n.n(s),l=n(14),u=n(24),p=n(287),d=n(34),b=n.n(d),m=n(162),f=n(42),O=n(43),g=n(59);function h(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function j(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?h(Object(n),!0).forEach((function(t){i()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):h(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var v=function(e,t){return!(!function(e){return"email"in e}(t)||Object(m.c)(t)===Object(m.c)(e))||!!t.country&&!b()(Object(m.b)(e),Object(m.b)(t))},E=n(57),y=Object(o.createContext)({billingData:{first_name:"",last_name:"",company:"",address_1:"",address_2:"",city:"",state:"",postcode:"",country:"",email:"",phone:""},shippingAddress:{first_name:"",last_name:"",company:"",address_1:"",address_2:"",city:"",state:"",postcode:"",country:"",phone:""},setBillingData:function(){return null},setShippingAddress:function(){return null},shippingAsBilling:!0,setShippingAsBilling:function(){return null}}),_=function(){return Object(o.useContext)(y)},w=function(e){var t=e.children,n=function(){var e=Object(l.useDispatch)(u.CART_STORE_KEY).updateCustomerData,t=Object(g.a)(),n=t.addErrorNotice,r=t.removeNotice,a=Object(O.a)(),s=a.billingAddress,i=a.shippingAddress,d=Object(o.useState)({billingData:s,shippingAddress:i}),m=c()(d,2),h=m[0],E=m[1],y=Object(o.useRef)(h),_=Object(p.a)(h,1e3,{equalityFn:function(e,t){return b()(e.billingData,t.billingData)&&b()(e.shippingAddress,t.shippingAddress)}}),w=c()(_,1)[0],k=Object(o.useCallback)((function(e){E((function(t){return j(j({},t),{},{billingData:j(j({},t.billingData),e)})}))}),[]),S=Object(o.useCallback)((function(e){E((function(t){return j(j({},t),{},{shippingAddress:j(j({},t.shippingAddress),e)})}))}),[]);return Object(o.useEffect)((function(){(v(y.current.billingData,w.billingData)||v(y.current.shippingAddress,w.shippingAddress))&&(y.current=w,e({billing_address:w.billingData,shipping_address:w.shippingAddress}).then((function(){r("checkout")})).catch((function(e){n(Object(f.b)(e),{id:"checkout"})})))}),[w,n,r,e]),{billingData:h.billingData,shippingAddress:h.shippingAddress,setBillingData:k,setShippingAddress:S}}(),r=n.billingData,s=n.shippingAddress,i=n.setBillingData,d=n.setShippingAddress,m=Object(O.a)().cartNeedsShipping,h=Object(E.b)().customerId,_=Object(o.useState)((function(){return m&&(!h||(e=s,t=r,Object.keys(a.defaultAddressFields).every((function(n){return e[n]===t[n]}))));var e,t})),w=c()(_,2),k=w[0],S=w[1],C={billingData:r,shippingAddress:s,setBillingData:i,setShippingAddress:d,shippingAsBilling:k,setShippingAsBilling:S};return Object(o.createElement)(y.Provider,{value:C},t)}},68:function(e,t,n){"use strict";n.d(t,"a",(function(){return u}));var r=n(5),c=n.n(r),o=n(55),a=n(0),s=n(43);function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function l(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?i(Object(n),!0).forEach((function(t){c()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):i(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var u=function(){var e=Object(s.a)(),t=Object(a.useRef)(e);return Object(a.useEffect)((function(){t.current=e}),[e]),{dispatchStoreEvent:Object(a.useCallback)((function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};try{Object(o.doAction)("experimental__woocommerce_blocks-".concat(e),t)}catch(e){console.error(e)}}),[]),dispatchCheckoutEvent:Object(a.useCallback)((function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};try{Object(o.doAction)("experimental__woocommerce_blocks-checkout-".concat(e),l(l({},n),{},{storeCart:t.current}))}catch(e){console.error(e)}}),[])}}},7:function(e,t){e.exports=window.lodash},72:function(e,t,n){"use strict";n.d(t,"a",(function(){return r})),n.d(t,"c",(function(){return c})),n.d(t,"b",(function(){return o})),n.d(t,"d",(function(){return a}));var r=function(e){return"number"==typeof e},c=function(e){return"string"==typeof e},o=function(e){return!function(e){return null===e}(e)&&e instanceof Object&&e.constructor===Object};function a(e,t){return o(e)&&t in e}},74:function(e,t){e.exports=window.wp.dom},75:function(e,t,n){"use strict";n.d(t,"b",(function(){return N})),n.d(t,"a",(function(){return x}));var r=n(5),c=n.n(r),o=n(8),a=n.n(o),s=n(0),i=n(34),l=n.n(i),u=n(142),p=function(e){return Object(u.a)(e.map((function(e){var t;return[e.package_id,null===(t=e.shipping_rates.find((function(e){return e.selected})))||void 0===t?void 0:t.rate_id]})))},d={NONE:"none",INVALID_ADDRESS:"invalid_address",UNKNOWN:"unknown_error"},b={INVALID_COUNTRY:"woocommerce_rest_cart_shipping_rates_invalid_country",MISSING_COUNTRY:"woocommerce_rest_cart_shipping_rates_missing_country",INVALID_STATE:"woocommerce_rest_cart_shipping_rates_invalid_state"},m={shippingErrorStatus:{isPristine:!0,isValid:!1,hasInvalidAddress:!1,hasError:!1},dispatchErrorStatus:function(){return null},shippingErrorTypes:d,shippingRates:[],shippingRatesLoading:!1,selectedRates:[],setSelectedRates:function(){return null},shippingAddress:{first_name:"",last_name:"",company:"",address_1:"",address_2:"",city:"",state:"",postcode:"",country:""},setShippingAddress:function(){return null},onShippingRateSuccess:function(){return null},onShippingRateFail:function(){return null},onShippingRateSelectSuccess:function(){return null},onShippingRateSelectFail:function(){return null},needsShipping:!1},f=function(e,t){var n=t.type;return Object.values(d).includes(n)?n:e},O=n(126),g=n(321),h=function(e){return{onSuccess:Object(g.a)("shipping_rates_success",e),onFail:Object(g.a)("shipping_rates_fail",e),onSelectSuccess:Object(g.a)("shipping_rate_select_success",e),onSelectFail:Object(g.a)("shipping_rate_select_fail",e)}},j=n(322),v=n(57),E=n(67),y=n(43),_=n(134);function w(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}var k=d.NONE,S=d.INVALID_ADDRESS,C=d.UNKNOWN,P=Object(s.createContext)(m),N=function(){return Object(s.useContext)(P)},x=function(e){var t=e.children,n=Object(v.b)().dispatchActions,r=Object(E.b)(),o=r.shippingAddress,i=r.setShippingAddress,u=Object(y.a)(),m=u.cartNeedsShipping,g=u.cartHasCalculatedShipping,N=u.shippingRates,x=u.shippingRatesLoading,R=u.cartErrors,T=Object(_.a)(),A=T.selectShippingRate,I=T.isSelectingRate,M=Object(s.useReducer)(f,k),D=a()(M,2),F=D[0],B=D[1],L=Object(s.useReducer)(O.b,{}),V=a()(L,2),U=V[0],z=V[1],H=Object(s.useRef)(U),G=Object(s.useMemo)((function(){return{onShippingRateSuccess:h(z).onSuccess,onShippingRateFail:h(z).onFail,onShippingRateSelectSuccess:h(z).onSelectSuccess,onShippingRateSelectFail:h(z).onSelectFail}}),[z]);Object(s.useEffect)((function(){H.current=U}),[U]);var q=Object(s.useRef)((function(){return p(N)}));Object(s.useEffect)((function(){var e=p(N);l()(q.current,e)||(q.current=e)}),[N]),Object(s.useEffect)((function(){x?n.incrementCalculating():n.decrementCalculating()}),[x,n]),Object(s.useEffect)((function(){I?n.incrementCalculating():n.decrementCalculating()}),[I,n]),Object(s.useEffect)((function(){R.length>0&&R.some((function(e){return!(!e.code||!Object.values(b).includes(e.code))}))?B({type:S}):B({type:k})}),[R]);var Y=Object(s.useMemo)((function(){return{isPristine:F===k,isValid:F===k,hasInvalidAddress:F===S,hasError:F===C||F===S}}),[F]);Object(s.useEffect)((function(){x||0!==N.length&&!Y.hasError||Object(j.a)(H.current,"shipping_rates_fail",{hasInvalidAddress:Y.hasInvalidAddress,hasError:Y.hasError})}),[N,x,Y.hasError,Y.hasInvalidAddress]),Object(s.useEffect)((function(){!x&&N.length>0&&!Y.hasError&&Object(j.a)(H.current,"shipping_rates_success",N)}),[N,x,Y.hasError]),Object(s.useEffect)((function(){I||(Y.hasError?Object(j.a)(H.current,"shipping_rate_select_fail",{hasError:Y.hasError,hasInvalidAddress:Y.hasInvalidAddress}):Object(j.a)(H.current,"shipping_rate_select_success",q.current))}),[I,Y.hasError,Y.hasInvalidAddress]);var W=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?w(Object(n),!0).forEach((function(t){c()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):w(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({shippingErrorStatus:Y,dispatchErrorStatus:B,shippingErrorTypes:d,shippingRates:N,shippingRatesLoading:x,selectedRates:q.current,setSelectedRates:A,isSelectingRate:I,shippingAddress:o,setShippingAddress:i,needsShipping:m,hasCalculatedShipping:g},G);return Object(s.createElement)(s.Fragment,null,Object(s.createElement)(P.Provider,{value:W},t))}},789:function(e,t,n){"use strict";var r=n(0),c=n(28),o=Object(r.createElement)(c.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16"},Object(r.createElement)("g",{fill:"none",fillRule:"evenodd"},Object(r.createElement)("path",{stroke:"currentColor",strokeWidth:"1.5",d:"M2 .75h12c.69 0 1.25.56 1.25 1.25v12c0 .69-.56 1.25-1.25 1.25H2c-.69 0-1.25-.56-1.25-1.25V2C.75 1.31 1.31.75 2 .75z"}),Object(r.createElement)("path",{fill:"currentColor",d:"M12 6H4V4.75h8zM12 9H4V7.75h8zM10 12H4v-1.25h6z"})));t.a=o},821:function(e,t,n){e.exports=n(851)},822:function(e,t){},823:function(e,t){},824:function(e,t){},825:function(e,t){},826:function(e,t){},827:function(e,t){},828:function(e,t){},829:function(e,t){},83:function(e,t,n){"use strict";var r=n(0),c=n(1),o=(n(2),n(6)),a=n.n(o),s=(n(259),n(114));t.a=function(e){var t=e.children,n=e.className,o=e.screenReaderLabel,i=e.showSpinner,l=void 0!==i&&i,u=e.isLoading,p=void 0===u||u;return Object(r.createElement)("div",{className:a()(n,{"wc-block-components-loading-mask":p})},p&&l&&Object(r.createElement)(s.a,null),Object(r.createElement)("div",{className:a()({"wc-block-components-loading-mask__children":p}),"aria-hidden":p},t),p&&Object(r.createElement)("span",{className:"screen-reader-text"},o||Object(c.__)("Loading…",'woocommerce')))}},830:function(e,t){},831:function(e,t){},832:function(e,t){},833:function(e,t,n){"use strict";var r=n(0),c=n(28),o=Object(r.createElement)(c.SVG,{xmlns:"http://www.w3.org/2000/SVG",viewBox:"0 0 24 24",fill:"none"},Object(r.createElement)("path",{stroke:"currentColor",strokeWidth:"1.5",fill:"none",d:"M6 3.75h12c.69 0 1.25.56 1.25 1.25v14c0 .69-.56 1.25-1.25 1.25H6c-.69 0-1.25-.56-1.25-1.25V5c0-.69.56-1.25 1.25-1.25z"}),Object(r.createElement)("path",{fill:"currentColor",fillRule:"evenodd",d:"M6.9 7.5A1.1 1.1 0 018 6.4h8a1.1 1.1 0 011.1 1.1v2a1.1 1.1 0 01-1.1 1.1H8a1.1 1.1 0 01-1.1-1.1v-2zm1.2.1v1.8h7.8V7.6H8.1z",clipRule:"evenodd"}),Object(r.createElement)("path",{fill:"currentColor",d:"M8.5 12h1v1h-1v-1zM8.5 14h1v1h-1v-1zM8.5 16h1v1h-1v-1zM11.5 12h1v1h-1v-1zM11.5 14h1v1h-1v-1zM11.5 16h1v1h-1v-1zM14.5 12h1v1h-1v-1zM14.5 14h1v1h-1v-1zM14.5 16h1v1h-1v-1z"}));t.a=o},834:function(e,t){},835:function(e,t){},836:function(e,t){},837:function(e,t){},838:function(e,t){},839:function(e,t){},840:function(e,t){},851:function(e,t,n){"use strict";n.r(t);var r=n(0),c=n(1),o=n(6),a=n.n(o),s=n(66),i=n(28),l=Object(r.createElement)(i.SVG,{xmlns:"http://www.w3.org/2000/SVG",viewBox:"0 0 24 24",fill:"none"},Object(r.createElement)("path",{stroke:"currentColor",strokeWidth:"1.5",fill:"none",d:"M5 3.75h14c.69 0 1.25.56 1.25 1.25v14c0 .69-.56 1.25-1.25 1.25H5c-.69 0-1.25-.56-1.25-1.25V5c0-.69.56-1.25 1.25-1.25z"}),Object(r.createElement)("path",{fill:"currentColor",fillRule:"evenodd",d:"M6.4 10.75c0-.47.38-.85.85-.85h9.5c.47 0 .85.38.85.85v1.5c0 .47-.38.85-.85.85h-9.5a.85.85 0 01-.85-.85v-1.5zm1.2.35v.8h8.8v-.8H7.6zM12.4 15.25c0-.47.38-.85.85-.85h3.5c.47 0 .85.38.85.85v1.5c0 .47-.38.85-.85.85h-3.5a.85.85 0 01-.85-.85v-1.5zm1.2.35v.8h2.8v-.8h-2.8zM6.5 15.9a.6.6 0 01.6-.6h2.8a.6.6 0 010 1.2H7.1a.6.6 0 01-.6-.6zM6.5 7.9a.6.6 0 01.6-.6h9.8a.6.6 0 110 1.2H7.1a.6.6 0 01-.6-.6z",clipRule:"evenodd"})),u=n(159),p=n(12),d=n(494),b=n(63),m=n(235),f=n(518),O={cc:[{method:{gateway:"stripe",last4:"5678",brand:"Visa"},expires:"12/20",is_default:!1,tokenId:"1"}]},g=n(4),h=n(196),j=n(37),v=n(3),E=n(517),y=(n(840),n(16)),_=n.n(y),w=["children"],k=function(e){var t=e.children,n=_()(e,w),c=Object(p.useBlockProps)(n);return Object(r.createElement)("div",c,t)},S=n(5),C=n.n(S),P=n(74),N=n(14),x=n(46),R=n(55),T=n(26);function A(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function I(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?A(Object(n),!0).forEach((function(t){C()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):A(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var M=function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];t?window.document.body.classList.add(e):window.document.body.classList.remove(e)},D=function(e){var t=e.ref,n=Object(R.hasFilter)("blocks.registerBlockType","core/lock/addAttribute"),c=t.current;return Object(r.useEffect)((function(){if(c&&!n)return c.addEventListener("keydown",e,{capture:!0,passive:!1}),function(){c.removeEventListener("keydown",e,{capture:!0})};function e(e){var t=e.keyCode,n=e.target;if(n instanceof HTMLElement&&(t===x.BACKSPACE||t===x.DELETE)&&!Object(P.isTextField)(n)){var r=n;void 0!==r.dataset.block&&function(e){var t,n,r,c,o;if(!e)return!1;var a=(0,Object(N.select)(p.store).getBlock)(e);if("boolean"==typeof(null==a||null===(t=a.attributes)||void 0===t||null===(n=t.lock)||void 0===n?void 0:n.remove))return a.attributes.lock.remove;var s,i,l,u=Object(T.getBlockType)(a.name);return"boolean"==typeof(null==u||null===(r=u.attributes)||void 0===r||null===(c=r.lock)||void 0===c||null===(o=c.default)||void 0===o?void 0:o.remove)&&(null==u||null===(s=u.attributes)||void 0===s||null===(i=s.lock)||void 0===i||null===(l=i.default)||void 0===l?void 0:l.remove)}(r.dataset.block)&&(e.preventDefault(),e.stopPropagation(),e.stopImmediatePropagation())}}}),[c,n])},F=Object(r.createContext)({allowCreateAccount:!1,showCompanyField:!1,showApartmentField:!1,showPhoneField:!1,requireCompanyField:!1,requirePhoneField:!1}),B=Object(r.createContext)({addressFieldControls:function(){return null},accountControls:function(){return null}}),L=function(){return Object(r.useContext)(F)},V=function(){return Object(r.useContext)(B)};Object(R.hasFilter)("blocks.registerBlockType","core/lock/addAttribute")||Object(N.subscribe)((function(){var e,t,n,r,c=Object(N.select)(p.store);if(c){var o=c.getSelectedBlock();o&&(M("wc-lock-selected-block--remove",!(null==o||null===(e=o.attributes)||void 0===e||null===(t=e.lock)||void 0===t||!t.remove)),M("wc-lock-selected-block--move",!(null==o||null===(n=o.attributes)||void 0===n||null===(r=n.lock)||void 0===r||!r.move)))}}));var U=["woocommerce/checkout-fields-block","woocommerce/checkout-totals-block"],z=function(e){var t=e.attributes,n=e.setAttributes,o=t.hasDarkControls,a=Object(b.b)().currentPostId;return Object(r.createElement)(p.InspectorControls,null,a!==j.e&&Object(r.createElement)(g.Notice,{className:"wc-block-checkout__page-notice",isDismissible:!1,status:"warning"},Object(r.createInterpolateElement)(Object(c.__)("If you would like to use this block as your default checkout you must update your <a>page settings in WooCommerce</a>.",'woocommerce'),{a:Object(r.createElement)("a",{href:Object(v.getAdminLink)("admin.php?page=wc-settings&tab=advanced"),target:"_blank",rel:"noopener noreferrer"})})),Object(r.createElement)(g.PanelBody,{title:Object(c.__)("Style",'woocommerce')},Object(r.createElement)(g.ToggleControl,{label:Object(c.__)("Dark mode inputs",'woocommerce'),help:Object(c.__)("Inputs styled specifically for use on dark background colors.",'woocommerce'),checked:o,onChange:function(){return n({hasDarkControls:!o})}})),Object(r.createElement)(h.a,null))},H={isPreview:{type:"boolean",default:!1,save:!1},hasDarkControls:{type:"boolean",default:Object(v.getSetting)("hasDarkEditorStyleSupport",!1)},showCompanyField:{type:"boolean",default:!1},requireCompanyField:{type:"boolean",default:!1},allowCreateAccount:{type:"boolean",default:!1},showApartmentField:{type:"boolean",default:!0},showPhoneField:{type:"boolean",default:!0},requirePhoneField:{type:"boolean",default:!1},showOrderNotes:{type:"boolean",default:!0},showPolicyLinks:{type:"boolean",default:!0},showReturnToCart:{type:"boolean",default:!0},cartPageId:{type:"number",default:0},showRateAfterTaxName:{type:"boolean",default:Object(v.getSetting)("displayCartPricesIncludingTax",!1)}},G=n(892),q=n(893),Y=n(495),W=n(27),$=function(e){var t=e.clientId,n=e.template,c=Object(r.useRef)(n),o=Object(N.useDispatch)("core/block-editor").insertBlock,a=Object(N.useSelect)((function(e){return{innerBlocks:e("core/block-editor").getBlocks(t),templateTypes:c.current.map((function(e){return Object(T.getBlockType)(e)}))}}),[t,c]),s=a.innerBlocks,i=a.templateTypes;Object(r.useLayoutEffect)((function(){t&&i.forEach((function(e){if(e&&(i=e.attributes,Boolean((null===(r=i.lock)||void 0===r?void 0:r.remove)||(null===(c=i.lock)||void 0===c||null===(a=c.default)||void 0===a?void 0:a.remove)))&&!s.find((function(t){return t.name===e.name}))){var n=Object(T.createBlock)(e.name);o(n,s.length,t,!1)}var r,c,a,i}))}),[t,s,o,i])},X=n(33),K=n.n(X),J=["core/paragraph","core/image","core/separator"],Z=function(e){return[].concat(K()(Object(T.getBlockTypes)().filter((function(t){return((null==t?void 0:t.parent)||[]).includes(e)})).map((function(e){return e.name}))),J)},Q=(n(822),n(535));Object(u.d)(Q,{icon:{src:Object(r.createElement)(G.a,{icon:q.a}),foreground:"#874FB9"},edit:function(e){var t=e.clientId,n=Object(p.useBlockProps)(),c=Z(W.innerBlockAreas.CHECKOUT_FIELDS),o=V().addressFieldControls;return $({clientId:t,template:c}),Object(r.createElement)(Y.a,{className:"wc-block-checkout__main"},Object(r.createElement)("div",n,Object(r.createElement)(o,null),Object(r.createElement)("form",{className:"wc-block-components-form wc-block-checkout__form"},Object(r.createElement)(p.InnerBlocks,{allowedBlocks:c,templateLock:!1,renderAppender:p.InnerBlocks.ButtonBlockAppender}))))},save:function(){return Object(r.createElement)("div",p.useBlockProps.save(),Object(r.createElement)(p.InnerBlocks.Content,null))}});var ee=n(496),te=(n(823),n(536));Object(u.d)(te,{icon:{src:Object(r.createElement)(G.a,{icon:q.a}),foreground:"#874FB9"},edit:function(e){var t=e.clientId,n=Object(p.useBlockProps)(),c=Z(W.innerBlockAreas.CHECKOUT_TOTALS);return $({clientId:t,template:c}),Object(r.createElement)(ee.a,{className:"wc-block-checkout__sidebar"},Object(r.createElement)("div",n,Object(r.createElement)(p.InnerBlocks,{allowedBlocks:c,templateLock:!1})))},save:function(){return Object(r.createElement)("div",p.useBlockProps.save(),Object(r.createElement)(p.InnerBlocks.Content,null))}});var ne=Object(r.createElement)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 12 16"},Object(r.createElement)("path",{fill:"currentColor",fillRule:"evenodd",d:"M5.6 0A5.596 5.596 0 000 5.6C0 9.8 5.6 16 5.6 16s5.6-6.2 5.6-10.4C11.2 2.504 8.696 0 5.6 0zm-4 5.6c0-2.208 1.792-4 4-4s4 1.792 4 4c0 2.304-2.304 5.752-4 7.904-1.664-2.136-4-5.624-4-7.904zm2 0a2 2 0 114 0 2 2 0 01-4 0z"})),re=n(135),ce=function(e){var t=e.children,n=e.stepHeadingContent;return Object(r.createElement)("div",{className:"wc-block-components-checkout-step__heading"},Object(r.createElement)(re.a,{"aria-hidden":"true",className:"wc-block-components-checkout-step__title",headingLevel:"2"},t),!!n&&Object(r.createElement)("span",{className:"wc-block-components-checkout-step__heading-content"},n))},oe=function(e){var t=e.attributes,n=e.setAttributes,o=e.className,s=void 0===o?"":o,i=e.children,l=t.title,u=void 0===l?"":l,d=t.description,b=void 0===d?"":d,m=t.showStepNumber,f=void 0===m||m,O=Object(p.useBlockProps)({className:a()("wc-block-components-checkout-step",s,{"wc-block-components-checkout-step--with-step-number":f})});return Object(r.createElement)("div",O,Object(r.createElement)(p.InspectorControls,null,Object(r.createElement)(g.PanelBody,{title:Object(c.__)("Form Step Options",'woocommerce')},Object(r.createElement)(g.ToggleControl,{label:Object(c.__)("Show step number",'woocommerce'),checked:f,onChange:function(){return n({showStepNumber:!f})}}))),Object(r.createElement)(ce,null,Object(r.createElement)(p.PlainText,{className:"",value:u,onChange:function(e){return n({title:e})}})),Object(r.createElement)("div",{className:"wc-block-components-checkout-step__container"},Object(r.createElement)("p",{className:"wc-block-components-checkout-step__description"},Object(r.createElement)(p.PlainText,{className:b?"":"wc-block-components-checkout-step__description-placeholder",value:b,placeholder:Object(c.__)("Optional text for this form step.",'woocommerce'),onChange:function(e){return n({description:e})}})),Object(r.createElement)("div",{className:"wc-block-components-checkout-step__content"},i)))},ae=(n(825),function(e){var t=e.block,n=Object(p.useBlockProps)()["data-block"],c=Z(t);return $({clientId:n,template:c}),Object(r.createElement)("div",{className:"wc-block-checkout__additional_fields"},Object(r.createElement)(p.InnerBlocks,{allowedBlocks:c}))}),se=function(){return Object(r.createElement)(p.InnerBlocks.Content,null)},ie=n(894),le=n(504),ue=n(75),pe=n(67),de=["email"];function be(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}var me=function(){var e=Object(ue.b)().needsShipping,t=Object(pe.b)(),n=t.billingData,c=t.setBillingData,o=t.shippingAddress,a=t.setShippingAddress,s=t.shippingAsBilling,i=t.setShippingAsBilling,l=Object(r.useRef)(s),u=Object(r.useRef)(n),p=Object(r.useCallback)((function(e){a(e),s&&c(e)}),[s,a,c]),d=Object(r.useCallback)((function(t){c(t),e||a(t)}),[e,a,c]);Object(r.useEffect)((function(){if(l.current!==s){if(s)u.current=n,c(o);else{var e=u.current,t=(e.email,_()(e,de));c(function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?be(Object(n),!0).forEach((function(t){C()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):be(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({},t))}l.current=s}}),[s,c,o,n]);var b=Object(r.useCallback)((function(e){c({email:e})}),[c]),m=Object(r.useCallback)((function(e){c({phone:e})}),[c]),f=Object(r.useCallback)((function(e){p({phone:e})}),[p]);return{defaultAddressFields:v.defaultAddressFields,shippingFields:o,setShippingFields:p,billingFields:n,setBillingFields:d,setEmail:b,setPhone:m,setShippingPhone:f,shippingAsBilling:s,setShippingAsBilling:i,showShippingFields:e,showBillingFields:!e||!l.current}},fe=n(68),Oe=n(9),ge=n.n(Oe),he=n(21),je=(n(824),["className","label","id","instanceId","onChange","children","hasError"]),ve=Object(he.withInstanceId)((function(e){var t=e.className,n=e.label,c=e.id,o=e.instanceId,s=e.onChange,i=e.children,l=e.hasError,u=void 0!==l&&l,p=_()(e,je),d=c||"checkbox-control-".concat(o);return Object(r.createElement)("label",{className:a()("wc-block-components-checkbox",{"has-error":u},t),htmlFor:d},Object(r.createElement)("input",ge()({id:d,className:"wc-block-components-checkbox__input",type:"checkbox",onChange:function(e){return s(e.target.checked)},"aria-invalid":!0===u},p)),Object(r.createElement)("svg",{className:"wc-block-components-checkbox__mark","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 20"},Object(r.createElement)("path",{d:"M9 16.2L4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4L9 16.2z"})),n&&Object(r.createElement)("span",{className:"wc-block-components-checkbox__label"},n),i)})),Ee=n(286),ye=function(e){var t=e.id,n=void 0===t?"phone":t,o=e.isRequired,a=void 0!==o&&o,s=e.value,i=void 0===s?"":s,l=e.onChange;return Object(r.createElement)(Ee.a,{id:n,type:"tel",autoComplete:"tel",required:a,label:a?Object(c.__)("Phone",'woocommerce'):Object(c.__)("Phone (optional)",'woocommerce'),value:i,onChange:l})},_e=function(e){var t=e.showCompanyField,n=void 0!==t&&t,o=e.showApartmentField,a=void 0!==o&&o,s=e.showPhoneField,i=void 0!==s&&s,l=e.requireCompanyField,u=void 0!==l&&l,p=e.requirePhoneField,d=void 0!==p&&p,m=me(),f=m.defaultAddressFields,O=m.setShippingFields,g=m.shippingFields,h=m.setShippingAsBilling,j=m.shippingAsBilling,v=m.setShippingPhone,E=Object(fe.a)().dispatchCheckoutEvent,y=Object(b.b)().isEditor;Object(r.useEffect)((function(){i||v("")}),[i,v]);var _=Object(r.useMemo)((function(){return{company:{hidden:!n,required:u},address_2:{hidden:!a}}}),[n,u,a]),w=y?ie.a:r.Fragment;return Object(r.createElement)(r.Fragment,null,Object(r.createElement)(w,null,Object(r.createElement)(le.a,{id:"shipping",type:"shipping",onChange:function(e){O(e),E("set-shipping-address")},values:g,fields:Object.keys(f),fieldConfig:_}),i&&Object(r.createElement)(ye,{id:"shipping-phone",isRequired:d,value:g.phone,onChange:function(e){v(e),E("set-phone-number",{step:"shipping"})}})),Object(r.createElement)(ve,{className:"wc-block-checkout__use-address-for-billing",label:Object(c.__)("Use same address for billing",'woocommerce'),checked:j,onChange:function(e){return h(e)}}))},we=function(e){var t=e.defaultTitle,n=void 0===t?Object(c.__)("Step",'woocommerce'):t,r=e.defaultDescription,o=void 0===r?Object(c.__)("Step description text.",'woocommerce'):r,a=e.defaultShowStepNumber;return{title:{type:"string",default:n},description:{type:"string",default:o},showStepNumber:{type:"boolean",default:void 0===a||a}}};function ke(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Se(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ke(Object(n),!0).forEach((function(t){C()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ke(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Ce=Se(Se({},we({defaultTitle:Object(c.__)("Shipping address",'woocommerce'),defaultDescription:Object(c.__)("Enter the address where you want your order delivered.",'woocommerce')})),{},{lock:{type:"object",default:{move:!0,remove:!0}}}),Pe=n(537);Object(u.d)(Pe,{icon:{src:Object(r.createElement)(s.a,{srcElement:ne}),foreground:"#874FB9"},attributes:Ce,edit:function(e){var t=e.attributes,n=e.setAttributes,c=L(),o=c.showCompanyField,a=c.showApartmentField,s=c.requireCompanyField,i=c.showPhoneField,l=c.requirePhoneField,u=V().addressFieldControls;return Object(r.createElement)(oe,{setAttributes:n,attributes:t,className:"wc-block-checkout__shipping-fields"},Object(r.createElement)(u,null),Object(r.createElement)(_e,{showCompanyField:o,showApartmentField:a,requireCompanyField:s,showPhoneField:i,requirePhoneField:l}),Object(r.createElement)(ae,{block:W.innerBlockAreas.SHIPPING_ADDRESS}))},save:function(){return Object(r.createElement)("div",p.useBlockProps.save(),Object(r.createElement)(se,null))}});var Ne=Object(r.createElement)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16"},Object(r.createElement)("g",{fill:"currentColor",fillRule:"evenodd"},Object(r.createElement)("path",{d:"M13.147 2.527c.288.279.295.739.015 1.027L9 7.84l4.449 4.581a.726.726 0 11-1.042 1.012l-4.42-4.55-4.419 4.55a.726.726 0 01-1.042-1.012l4.45-4.581L2.81 3.554a.726.726 0 011.042-1.012l4.133 4.256 4.134-4.256a.726.726 0 011.027-.015z"}),Object(r.createElement)("path",{d:"M.467 7.915c0-.4.326-.726.727-.726H7.29l-.03-5.99a.726.726 0 011.452-.008l.031 5.998h6.229a.726.726 0 110 1.453H8.752l.033 6.328a.726.726 0 11-1.453.007L7.3 8.642H1.194a.726.726 0 01-.727-.727z"}))),xe=n(895),Re=(n(826),j.k?'<a href="'.concat(j.k,'">').concat(Object(c.__)("Terms and Conditions","woo-gutenberg-product-blocks"),"</a>"):Object(c.__)("Terms and Conditions","woo-gutenberg-product-blocks")),Te=j.g?'<a href="'.concat(j.g,'">').concat(Object(c.__)("Privacy Policy","woo-gutenberg-product-blocks"),"</a>"):Object(c.__)("Privacy Policy","woo-gutenberg-product-blocks"),Ae=Object(c.sprintf)(
/* translators: %1$s terms page link, %2$s privacy page link. */
Object(c.__)("By proceeding with your purchase you agree to our %1$s and %2$s","woo-gutenberg-product-blocks"),Re,Te),Ie=Object(c.sprintf)(
/* translators: %1$s terms page link, %2$s privacy page link. */
Object(c.__)("You must accept our %1$s and %2$s to continue with your purchase.","woo-gutenberg-product-blocks"),Re,Te),Me=n(538);Object(u.d)(Me,{icon:{src:Object(r.createElement)(s.a,{srcElement:Ne}),foreground:"#874FB9"},edit:function(e){var t=e.attributes,n=t.checkbox,o=t.text,a=e.setAttributes,s=Object(p.useBlockProps)(),i=o||(n?Ie:Ae);return Object(r.createElement)("div",s,Object(r.createElement)(p.InspectorControls,null,Object(r.createElement)(g.PanelBody,{title:Object(c.__)("Display options",'woocommerce')},Object(r.createElement)(g.ToggleControl,{label:Object(c.__)("Require checkbox",'woocommerce'),checked:n,onChange:function(){return a({checkbox:!n})}}))),Object(r.createElement)("div",{className:"wc-block-checkout__terms"},n?Object(r.createElement)(r.Fragment,null,Object(r.createElement)(ve,{id:"terms-condition",checked:!1}),Object(r.createElement)(p.RichText,{value:i,onChange:function(e){return a({text:e})}})):Object(r.createElement)(p.RichText,{tagName:"span",value:i,onChange:function(e){return a({text:e})}})),(!j.k||!j.g)&&Object(r.createElement)(g.Notice,{className:"wc-block-checkout__terms_notice",status:"warning",isDismissible:!1,actions:[!j.k&&{className:"wc-block-checkout__terms_notice-button",label:Object(r.createElement)(r.Fragment,null,Object(c.__)("Setup a Terms and Conditions page",'woocommerce'),Object(r.createElement)(G.a,{icon:xe.a,size:16,className:"wc-block-checkout__terms_notice-button__icon"})),onClick:function(){return window.open("".concat(v.ADMIN_URL,"admin.php?page=wc-settings&tab=advanced"),"_blank")}},!j.g&&{className:"wc-block-checkout__terms_notice-button",label:Object(r.createElement)(r.Fragment,null,Object(c.__)("Setup a Privacy Policy page",'woocommerce'),Object(r.createElement)(G.a,{size:16,icon:xe.a,className:"wc-block-checkout__terms_notice-button__icon"})),onClick:function(){return window.open("".concat(v.ADMIN_URL,"options-privacy.php"),"_blank")}}].filter(Boolean)},Object(r.createElement)("p",null,Object(c.__)("You don't seem to have a Terms and Conditions and/or a Privacy Policy pages setup.",'woocommerce'))),j.k&&j.g&&!(i.includes(j.k)&&i.includes(j.g))&&Object(r.createElement)(g.Notice,{className:"wc-block-checkout__terms_notice",status:"warning",isDismissible:!1,actions:Ae!==o?[{label:Object(c.__)("Restore default text",'woocommerce'),onClick:function(){return a({text:""})}}]:[]},Object(r.createElement)("p",null,Object(c.__)("Ensure you add links to your policy pages in this section.",'woocommerce'))))},save:function(){return Object(r.createElement)("div",p.useBlockProps.save())}});var De=Object(r.createElement)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 16"},Object(r.createElement)("g",{fill:"none",fillRule:"evenodd"},Object(r.createElement)("path",{stroke:"currentColor",strokeWidth:"1.5",d:"M2 .75h16c.69 0 1.25.56 1.25 1.25v12c0 .69-.56 1.25-1.25 1.25H2c-.69 0-1.25-.56-1.25-1.25V2C.75 1.31 1.31.75 2 .75z"}),Object(r.createElement)("path",{fill:"currentColor",d:"M7.667 7.667A2.34 2.34 0 0010 5.333 2.34 2.34 0 007.667 3a2.34 2.34 0 00-2.334 2.333 2.34 2.34 0 002.334 2.334zM11.556 3H17v3.889h-5.444V3zm2.722 2.916l1.944-1.36v-.779L14.278 5.14l-1.945-1.362v.778l1.945 1.361zm-5.834-.583a.78.78 0 00-.777-.777.78.78 0 00-.778.777c0 .428.35.778.778.778a.78.78 0 00.777-.778zm3.89 5.904c0-1.945-3.088-2.785-4.667-2.785-1.58 0-4.667.84-4.667 2.785v1.097h9.333v-1.097zM7.666 10c-1.012 0-2.163.389-2.738.778h5.475C9.821 10.38 8.678 10 7.667 10z"}))),Fe=n(57),Be=function(e){var t=e.allowCreateAccount,n=Object(Fe.b)(),o=n.customerId,a=n.shouldCreateAccount,s=n.setShouldCreateAccount,i=me(),l=i.billingFields,u=i.setEmail,p=Object(fe.a)().dispatchCheckoutEvent,d=!o&&t&&Object(v.getSetting)("checkoutAllowsGuest",!1)&&Object(v.getSetting)("checkoutAllowsSignup",!1)&&Object(r.createElement)(ve,{className:"wc-block-checkout__create-account",label:Object(c.__)("Create an account?",'woocommerce'),checked:a,onChange:function(e){return s(e)}});return Object(r.createElement)(r.Fragment,null,Object(r.createElement)(Ee.a,{id:"email",type:"email",label:Object(c.__)("Email address",'woocommerce'),value:l.email,autoComplete:"email",onChange:function(e){u(e),p("set-email-address")},required:!0}),d)};function Le(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Ve(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Le(Object(n),!0).forEach((function(t){C()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Le(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Ue=Ve(Ve({},we({defaultTitle:Object(c.__)("Contact information",'woocommerce'),defaultDescription:Object(c.__)("We'll use this email to send you details and updates about your order.",'woocommerce')})),{},{lock:{type:"object",default:{remove:!0,move:!0}}}),ze=n(539);Object(u.d)(ze,{icon:{src:Object(r.createElement)(s.a,{srcElement:De}),foreground:"#874FB9"},attributes:Ue,edit:function(e){var t=e.attributes,n=e.setAttributes,c=L().allowCreateAccount,o=V().accountControls;return Object(r.createElement)(oe,{attributes:t,setAttributes:n},Object(r.createElement)(o,null),Object(r.createElement)(g.Disabled,null,Object(r.createElement)(Be,{allowCreateAccount:c})),Object(r.createElement)(ae,{block:W.innerBlockAreas.CONTACT_INFORMATION}))},save:function(){return Object(r.createElement)("div",p.useBlockProps.save(),Object(r.createElement)(se,null))}});var He=function(e){var t=e.showCompanyField,n=void 0!==t&&t,c=e.showApartmentField,o=void 0!==c&&c,a=e.showPhoneField,s=void 0!==a&&a,i=e.requireCompanyField,l=void 0!==i&&i,u=e.requirePhoneField,p=void 0!==u&&u,d=me(),m=d.defaultAddressFields,f=d.billingFields,O=d.setBillingFields,g=d.setPhone,h=Object(fe.a)().dispatchCheckoutEvent,j=Object(b.b)().isEditor;Object(r.useEffect)((function(){s||g("")}),[s,g]);var v=Object(r.useMemo)((function(){return{company:{hidden:!n,required:l},address_2:{hidden:!o}}}),[n,l,o]),E=j?ie.a:r.Fragment;return Object(r.createElement)(E,null,Object(r.createElement)(le.a,{id:"billing",type:"billing",onChange:function(e){O(e),h("set-billing-address")},values:f,fields:Object.keys(m),fieldConfig:v}),s&&Object(r.createElement)(ye,{isRequired:p,value:f.phone,onChange:function(e){g(e),h("set-phone-number",{step:"billing"})}}))};function Ge(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function qe(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ge(Object(n),!0).forEach((function(t){C()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ge(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Ye=qe(qe({},we({defaultTitle:Object(c.__)("Billing address",'woocommerce'),defaultDescription:Object(c.__)("Enter the address that matches your card or payment method.",'woocommerce')})),{},{lock:{type:"object",default:{move:!0,remove:!0}}}),We=n(540);Object(u.d)(We,{icon:{src:Object(r.createElement)(s.a,{srcElement:ne}),foreground:"#874FB9"},attributes:Ye,edit:function(e){var t=e.attributes,n=e.setAttributes,c=L(),o=c.showCompanyField,a=c.showApartmentField,s=c.requireCompanyField,i=c.showPhoneField,l=c.requirePhoneField,u=V().addressFieldControls;return me().showBillingFields?Object(r.createElement)(oe,{setAttributes:n,attributes:t,className:"wc-block-checkout__billing-fields"},Object(r.createElement)(u,null),Object(r.createElement)(He,{showCompanyField:o,showApartmentField:a,requireCompanyField:s,showPhoneField:i,requirePhoneField:l}),Object(r.createElement)(ae,{block:W.innerBlockAreas.BILLING_ADDRESS})):null},save:function(){return Object(r.createElement)("div",p.useBlockProps.save(),Object(r.createElement)(se,null))}});var $e=n(896),Xe=n(195),Ke=Object(r.createElement)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"24",height:"24",fill:"currentColor"},Object(r.createElement)("path",{d:"M20 11H7.8l5.6-5.6L12 4l-8 8 8 8 1.4-1.4L7.8 13H20v-2z"})),Je=(n(828),function(e){var t=e.link;return Object(r.createElement)("a",{href:t||j.d,className:"wc-block-components-checkout-return-to-cart-button"},Object(r.createElement)(s.a,{srcElement:Ke}),Object(c.__)("Return to Cart",'woocommerce'))}),Ze=n(174),Qe=n(163),et=n(567),tt=n(90),nt=function(){var e=function(){var e=Object(Fe.b)(),t=e.onSubmit,n=e.isCalculating,r=e.isBeforeProcessing,o=e.isProcessing,a=e.isAfterProcessing,s=e.isComplete,i=e.hasError,l=Object(Qe.b)().paymentMethods,u=void 0===l?{}:l,p=Object(Ze.b)(),d=p.activePaymentMethod,b=p.currentStatus,m=u[d]||{},f=o||a||r,O=s&&!i;return{submitButtonText:(null==m?void 0:m.placeOrderButtonLabel)||Object(c.__)("Place Order",'woocommerce'),onSubmit:t,isCalculating:n,isDisabled:o||b.isDoingExpressPayment,waitingForProcessing:f,waitingForRedirect:O}}(),t=e.submitButtonText,n=e.onSubmit,o=e.isCalculating,a=e.isDisabled,i=e.waitingForProcessing,l=e.waitingForRedirect;return Object(r.createElement)(tt.a,{className:"wc-block-components-checkout-place-order-button",onClick:n,disabled:o||a||i||l,showSpinner:i},l?Object(r.createElement)(s.a,{srcElement:et.a,alt:Object(c.__)("Done",'woocommerce')}):t)},rt=(n(827),function(e){var t=e.cartPageId,n=e.showReturnToCart;return Object(r.createElement)("div",{className:"wc-block-checkout__actions"},n&&Object(r.createElement)(Je,{link:Object(v.getSetting)("page-"+t,!1)}),Object(r.createElement)(nt,null))}),ct=n(541);Object(u.d)(ct,{icon:{src:Object(r.createElement)(G.a,{icon:$e.a}),foreground:"#874FB9"},attributes:{cartPageId:{type:"number",default:0},showReturnToCart:{type:"boolean",default:!0},lock:{type:"object",default:{move:!0,remove:!0}}},edit:function(e){var t=e.attributes,n=e.setAttributes,o=Object(p.useBlockProps)(),a=t.cartPageId,s=void 0===a?0:a,i=t.showReturnToCart,l=void 0===i||i,u=Object(r.useRef)(s).current,d=Object(N.useSelect)((function(e){return u||e("core/editor").getCurrentPostId()}),[u]);return Object(r.createElement)("div",o,Object(r.createElement)(p.InspectorControls,null,Object(r.createElement)(g.PanelBody,{title:Object(c.__)("Account options",'woocommerce')},Object(r.createElement)(g.ToggleControl,{label:Object(c.__)('Show a "Return to Cart" link','woocommerce'),checked:l,onChange:function(){return n({showReturnToCart:!l})}})),l&&!(d===j.e&&0===u)&&Object(r.createElement)(Xe.a,{pageId:s,setPageId:function(e){return n({cartPageId:e})},labels:{title:Object(c.__)("Return to Cart button",'woocommerce'),default:Object(c.__)("WooCommerce Cart Page",'woocommerce')}})),Object(r.createElement)(g.Disabled,null,Object(r.createElement)(rt,{showReturnToCart:l,cartPageId:s})))},save:function(){return Object(r.createElement)("div",p.useBlockProps.save())}});var ot=n(789),at=n(2),st=n.n(at),it=(n(830),function(e){var t=e.title,n=e.stepHeadingContent;return Object(r.createElement)("div",{className:"wc-block-components-checkout-step__heading"},Object(r.createElement)(re.a,{"aria-hidden":"true",className:"wc-block-components-checkout-step__title",headingLevel:"2"},t),!!n&&Object(r.createElement)("span",{className:"wc-block-components-checkout-step__heading-content"},n))}),lt=function(e){var t=e.id,n=e.className,c=e.title,o=e.legend,s=e.description,i=e.children,l=e.disabled,u=void 0!==l&&l,p=e.showStepNumber,d=void 0===p||p,b=e.stepHeadingContent,m=void 0===b?function(){}:b,f=o||c?"fieldset":"div";return Object(r.createElement)(f,{className:a()(n,"wc-block-components-checkout-step",{"wc-block-components-checkout-step--with-step-number":d,"wc-block-components-checkout-step--disabled":u}),id:t,disabled:u},!(!o&&!c)&&Object(r.createElement)("legend",{className:"screen-reader-text"},o||c),!!c&&Object(r.createElement)(it,{title:c,stepHeadingContent:m()}),Object(r.createElement)("div",{className:"wc-block-components-checkout-step__container"},!!s&&Object(r.createElement)("p",{className:"wc-block-components-checkout-step__description"},s),Object(r.createElement)("div",{className:"wc-block-components-checkout-step__content"},i)))},ut=n(8),pt=n.n(ut),dt=(n(832),function(e){var t=e.className,n=void 0===t?"":t,c=e.disabled,o=void 0!==c&&c,s=e.onTextChange,i=e.placeholder,l=e.value,u=void 0===l?"":l;return Object(r.createElement)("textarea",{className:a()("wc-block-components-textarea",n),disabled:o,onChange:function(e){s(e.target.value)},placeholder:i,rows:2,value:u})});n(831),dt.propTypes={onTextChange:st.a.func.isRequired,disabled:st.a.bool,placeholder:st.a.string,value:st.a.string};var bt=function(e){var t=e.disabled,n=e.onChange,o=e.placeholder,a=e.value,s=Object(r.useState)(!1),i=pt()(s,2),l=i[0],u=i[1],p=Object(r.useState)(""),d=pt()(p,2),b=d[0],m=d[1];return Object(r.createElement)("div",{className:"wc-block-checkout__add-note"},Object(r.createElement)(ve,{disabled:t,label:Object(c.__)("Add a note to your order",'woocommerce'),checked:l,onChange:function(e){u(e),e?a!==b&&n(b):(n(""),m(a))}}),l&&Object(r.createElement)(dt,{disabled:t,onTextChange:n,placeholder:o,value:a}))},mt=function(){var e=Object(ue.b)().needsShipping,t=Object(Fe.b)(),n=t.isProcessing,o=t.orderNotes,a=t.dispatchActions.setOrderNotes;return Object(r.createElement)(lt,{id:"order-notes",showStepNumber:!1,className:"wc-block-checkout__order-notes",disabled:n},Object(r.createElement)(bt,{disabled:n,onChange:a,placeholder:e?Object(c.__)("Notes about your order, e.g. special notes for delivery.",'woocommerce'):Object(c.__)("Notes about your order.",'woocommerce'),value:o}))},ft=(n(829),n(542));Object(u.d)(ft,{icon:{src:Object(r.createElement)(s.a,{srcElement:ot.a}),foreground:"#874FB9"},edit:function(){var e=Object(p.useBlockProps)();return Object(r.createElement)("div",e,Object(r.createElement)(g.Disabled,null,Object(r.createElement)(mt,null)))},save:function(){return Object(r.createElement)("div",p.useBlockProps.save())}});var Ot=n(833),gt=n(285),ht=n(41),jt=n(124),vt=n(154),Et=n(47),yt=n(151),_t=n(43),wt=n(308),kt=n(307),St=n(309),Ct=n(311),Pt=["receiveCart"],Nt=function(e){return Object(W.mustContain)(e,"<price/>")},xt=function(e){var t=e.cartItem,n=t.images,o=t.low_stock_remaining,a=t.show_backorder_badge,s=t.name,i=t.permalink,l=t.prices,u=t.quantity,p=t.short_description,d=t.description,b=t.item_data,m=t.variation,f=t.totals,O=t.extensions,g=Object(_t.a)(),h=(g.receiveCart,_()(g,Pt)),j=Object(r.useMemo)((function(){return{context:"summary",cartItem:t,cart:h}}),[t,h]),E=Object(Et.getCurrencyFromPriceResponse)(l),y=Object(W.__experimentalApplyCheckoutFilter)({filterName:"itemName",defaultValue:s,extensions:O,arg:j}),w=Object(yt.a)({amount:parseInt(l.raw_prices.regular_price,10),precision:parseInt(l.raw_prices.precision,10)}).convertPrecision(E.minorUnit).getAmount(),k=Object(yt.a)({amount:parseInt(l.raw_prices.price,10),precision:parseInt(l.raw_prices.precision,10)}).convertPrecision(E.minorUnit).getAmount(),S=Object(Et.getCurrencyFromPriceResponse)(f),C=parseInt(f.line_subtotal,10);Object(v.getSetting)("displayCartPricesIncludingTax",!1)&&(C+=parseInt(f.line_subtotal_tax,10));var P=Object(yt.a)({amount:C,precision:S.minorUnit}).getAmount(),N=Object(W.__experimentalApplyCheckoutFilter)({filterName:"subtotalPriceFormat",defaultValue:"<price/>",extensions:O,arg:j,validation:Nt}),x=Object(W.__experimentalApplyCheckoutFilter)({filterName:"cartItemPrice",defaultValue:"<price/>",extensions:O,arg:j,validation:Nt});return Object(r.createElement)("div",{className:"wc-block-components-order-summary-item"},Object(r.createElement)("div",{className:"wc-block-components-order-summary-item__image"},Object(r.createElement)("div",{className:"wc-block-components-order-summary-item__quantity"},Object(r.createElement)(ht.a,{label:u,screenReaderLabel:Object(c.sprintf)(
/* translators: %d number of products of the same type in the cart */
Object(c._n)("%d item","%d items",u,'woocommerce'),u)})),Object(r.createElement)(kt.a,{image:n.length?n[0]:{}})),Object(r.createElement)("div",{className:"wc-block-components-order-summary-item__description"},Object(r.createElement)(vt.a,{disabled:!0,name:y,permalink:i}),Object(r.createElement)(jt.a,{currency:E,price:k,regularPrice:w,className:"wc-block-components-order-summary-item__individual-prices",priceClassName:"wc-block-components-order-summary-item__individual-price",regularPriceClassName:"wc-block-components-order-summary-item__regular-individual-price",format:N}),a?Object(r.createElement)(wt.a,null):!!o&&Object(r.createElement)(St.a,{lowStockRemaining:o}),Object(r.createElement)(Ct.a,{shortDescription:p,fullDescription:d,itemData:b,variation:m})),Object(r.createElement)("span",{className:"screen-reader-text"},Object(c.sprintf)(
/* translators: %1$d is the number of items, %2$s is the item name and %3$s is the total price including the currency symbol. */
Object(c._n)("Total price for %1$d %2$s item: %3$s","Total price for %1$d %2$s items: %3$s",u,'woocommerce'),u,y,Object(Et.formatPrice)(P,S))),Object(r.createElement)("div",{className:"wc-block-components-order-summary-item__total-price","aria-hidden":"true"},Object(r.createElement)(jt.a,{currency:S,format:x,price:P})))},Rt=(n(834),function(e){var t=e.cartItems,n=void 0===t?[]:t,o=Object(gt.b)(),a=o.isLarge;return o.hasContainerWidth?Object(r.createElement)(W.Panel,{className:"wc-block-components-order-summary",initialOpen:a,hasBorder:!1,title:Object(r.createElement)("span",{className:"wc-block-components-order-summary__button-text"},Object(c.__)("Order summary",'woocommerce')),titleTag:"h2"},Object(r.createElement)("div",{className:"wc-block-components-order-summary__content"},n.map((function(e){return Object(r.createElement)(xt,{key:e.key,cartItem:e})})))):null}),Tt=n(497),At=n(498),It=n(510),Mt=n(501),Dt=n(201),Ft=["extensions","receiveCart"],Bt=function(e){var t=e.showRateAfterTaxName,n=void 0!==t&&t,c=Object(_t.a)(),o=c.cartItems,a=c.cartTotals,s=c.cartCoupons,i=c.cartFees,l=Object(Dt.a)(),u=l.applyCoupon,p=l.removeCoupon,d=l.isApplyingCoupon,b=l.isRemovingCoupon,m=Object(ue.b)().needsShipping,f=Object(Et.getCurrencyFromPriceResponse)(a),O=Object(_t.a)(),g=O.extensions,h=(O.receiveCart,{extensions:g,cart:_()(O,Ft)});return Object(r.createElement)(r.Fragment,null,Object(r.createElement)(W.TotalsWrapper,null,Object(r.createElement)(Rt,{cartItems:o})),Object(r.createElement)(W.TotalsWrapper,null,Object(r.createElement)(W.Subtotal,{currency:f,values:a}),Object(r.createElement)(W.TotalsFees,{currency:f,cartFees:i}),Object(r.createElement)(Tt.a,{cartCoupons:s,currency:f,isRemovingCoupon:b,removeCoupon:p,values:a})),Object(v.getSetting)("couponsEnabled",!0)&&Object(r.createElement)(W.TotalsWrapper,null,Object(r.createElement)(At.a,{onSubmit:u,initialOpen:!1,isLoading:d})),m&&Object(r.createElement)(W.TotalsWrapper,null,Object(r.createElement)(It.a,{showCalculator:!1,showRateSelector:!1,values:a,currency:f})),!Object(v.getSetting)("displayCartPricesIncludingTax",!1)&&parseInt(a.total_tax,10)>0&&Object(r.createElement)(W.TotalsWrapper,null,Object(r.createElement)(W.TotalsTaxes,{currency:f,showRateAfterTaxName:n,values:a})),Object(r.createElement)(W.TotalsWrapper,null,Object(r.createElement)(Mt.a,{currency:f,values:a})),Object(r.createElement)(W.ExperimentalOrderMeta.Slot,h))},Lt={showRateAfterTaxName:{type:"boolean",default:Object(v.getSetting)("displayCartPricesIncludingTax",!1)},lock:{type:"object",default:{move:!0,remove:!0}}},Vt=n(543);Object(u.d)(Vt,{icon:{src:Object(r.createElement)(s.a,{srcElement:Ot.a}),foreground:"#874FB9"},attributes:Lt,edit:function(e){var t=e.attributes,n=e.setAttributes,o=Object(p.useBlockProps)(),a=Object(v.getSetting)("taxesEnabled"),s=Object(v.getSetting)("displayItemizedTaxes",!1),i=Object(v.getSetting)("displayCartPricesIncludingTax",!1);return Object(r.createElement)("div",o,Object(r.createElement)(p.InspectorControls,null,a&&s&&!i&&Object(r.createElement)(g.PanelBody,{title:Object(c.__)("Taxes",'woocommerce')},Object(r.createElement)(g.ToggleControl,{label:Object(c.__)("Show rate after tax name",'woocommerce'),help:Object(c.__)("Show the percentage rate alongside each tax line in the summary.",'woocommerce'),checked:t.showRateAfterTaxName,onChange:function(){return n({showRateAfterTaxName:!t.showRateAfterTaxName})}}))),Object(r.createElement)(g.Disabled,null,Object(r.createElement)(Bt,{showRateAfterTaxName:t.showRateAfterTaxName})))},save:function(){return Object(r.createElement)("div",p.useBlockProps.save())}});var Ut=n(502),zt=(n(835),function(e){var t=e.href,n=e.title,o=e.description;return Object(r.createElement)("a",{href:t,className:"wc-block-editor-components-external-link-card",target:"_blank",rel:"noreferrer"},Object(r.createElement)("span",{className:"wc-block-editor-components-external-link-card__content"},Object(r.createElement)("strong",{className:"wc-block-editor-components-external-link-card__title"},n),o&&Object(r.createElement)("span",{className:"wc-block-editor-components-external-link-card__description"},o)),Object(r.createElement)(g.VisuallyHidden,{as:"span"},
/* translators: accessibility text */
Object(c.__)("(opens in a new tab)",'woocommerce')),Object(r.createElement)(G.a,{icon:xe.a,className:"wc-block-editor-components-external-link-card__icon"}))}),Ht=n(141),Gt=n(50),qt=n(891),Yt=n(182),Wt=n(890),$t=(n(836),function(){return Object(r.createElement)(qt.a,{icon:Object(r.createElement)(s.a,{srcElement:Ut.a}),label:Object(c.__)("Payment methods",'woocommerce'),className:"wc-block-checkout__no-payment-methods-placeholder"},Object(r.createElement)("span",{className:"wc-block-checkout__no-payment-methods-placeholder-description"},Object(c.__)("Your store does not have any payment methods configured that support the checkout block. Once you have configured a compatible payment method (e.g. Stripe) it will be shown here.",'woocommerce')),Object(r.createElement)(Yt.a,{isSecondary:!0,href:"".concat(v.ADMIN_URL,"admin.php?page=wc-settings&tab=checkout"),target:"_blank",rel:"noopener noreferrer"},Object(c.__)("Configure Payment Methods",'woocommerce')))}),Xt=function(){return Object(r.createElement)(Wt.a,{isDismissible:!1,className:a()("wc-block-checkout__no-payment-methods-notice","woocommerce-message","woocommerce-error")},Object(c.__)("There are no payment methods available. This may be an error on our side. Please contact us if you need any help placing your order.",'woocommerce'))},Kt=function(){return Object(b.b)().isEditor?Object(r.createElement)($t,null):Object(r.createElement)(Xt,null)},Jt=n(283),Zt=n(59),Qt=n(38),en=n.n(Qt),tn=n(140),nn=Object(he.withInstanceId)((function(e){var t=e.className,n=e.instanceId,c=e.id,o=e.selected,s=e.onChange,i=e.options,l=void 0===i?[]:i,u=c||n;return l.length&&Object(r.createElement)("div",{className:a()("wc-block-components-radio-control",t)},l.map((function(e){var t="object"===en()(e)&&"content"in e,n=e.value===o;return Object(r.createElement)("div",{className:"wc-block-components-radio-control-accordion-option",key:e.value},Object(r.createElement)(tn.a,{name:"radio-control-".concat(u),checked:n,option:e,onChange:function(t){s(t),"function"==typeof e.onChange&&e.onChange(t)}}),t&&n&&Object(r.createElement)("div",{className:a()("wc-block-components-radio-control-accordion-content",{"wc-block-components-radio-control-accordion-content-hide":!n})},e.content))})))})),rn=n(168),cn=function(e){var t=e.children,n=e.showSaveOption,o=Object(b.b)().isEditor,a=Object(Ze.b)(),s=a.shouldSavePayment,i=a.setShouldSavePayment,l=Object(Fe.b)().customerId;return Object(r.createElement)(rn.a,{isEditor:o},t,l>0&&n&&Object(r.createElement)(ve,{className:"wc-block-components-payment-methods__save-card-info",label:Object(c.__)("Save payment information to my account for future purchases.",'woocommerce'),checked:s,onChange:function(){return i(!s)}}))},on=["activePaymentMethod"];function an(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function sn(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?an(Object(n),!0).forEach((function(t){C()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):an(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var ln=function(){var e=Object(Ze.b)(),t=e.setActivePaymentMethod,n=e.activeSavedToken,c=e.setActiveSavedToken,o=e.isExpressPaymentMethodActive,s=e.customerPaymentMethods,i=Object(Qe.b)().paymentMethods,l=Object(Jt.a)(),u=l.activePaymentMethod,p=_()(l,on),d=Object(Gt.c)().noticeContexts,m=Object(Zt.a)().removeNotice,f=Object(b.b)().isEditor,O=Object.keys(i).map((function(e){var t=i[e],n=t.edit,c=t.content,o=t.label,a=t.supports,s=f?n:c;return{value:e,label:"string"==typeof o?o:Object(r.cloneElement)(o,{components:p.components}),name:"wc-saved-payment-method-token-".concat(e),content:Object(r.createElement)(cn,{showSaveOption:a.showSaveOption},Object(r.cloneElement)(s,sn({activePaymentMethod:u},p)))}})),g=0===Object.keys(s).length&&1===Object.keys(i).length,h=a()({"disable-radio-control":g});return o?null:Object(r.createElement)(nn,{id:"wc-payment-method-options",className:h,selected:n?null:u,onChange:function(e){t(e),c(""),m("wc-payment-error",d.PAYMENTS)},options:O})},un=n(167),pn=n(60);function dn(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}var bn=function(){var e,t,n=Object(Ze.b)(),o=n.setPaymentStatus,a=n.customerPaymentMethods,s=n.activePaymentMethod,i=n.setActivePaymentMethod,l=n.activeSavedToken,u=n.setActiveSavedToken,p=Object(pn.getPaymentMethods)(),d=Object(Qe.b)().paymentMethods,b=Object(Jt.a)(),m=Object(r.useRef)([]),f=Object(r.useCallback)((function(e){u(e)}),[u]);Object(r.useEffect)((function(){var e=Object.keys(a).flatMap((function(e){return a[e].map((function(t){var n="cc"===e||"echeck"===e?function(e,t,n){var r=e.method,o=e.expires,a=e.tokenId;return{value:a+"",label:Object(c.sprintf)(
/* translators: %1$s is referring to the payment method brand, %2$s is referring to the last 4 digits of the payment card, %3$s is referring to the expiry date.  */
Object(c.__)("%1$s ending in %2$s (expires %3$s)","woo-gutenberg-product-blocks"),r.brand,r.last4,o),name:"wc-saved-payment-method-token-".concat(a),onChange:function(e){var c,o="wc-".concat(r.gateway,"-payment-token");t(r.gateway),n().started((c={payment_method:r.gateway},C()(c,o,e+""),C()(c,"isSavedToken",!0),c))}}}(t,i,o):function(e,t,n){var r=e.method,o=e.tokenId;return{value:o+"",label:Object(c.sprintf)(
/* translators: %s is the name of the payment method gateway. */
Object(c.__)("Saved token for %s",'woocommerce'),r.gateway),name:"wc-saved-payment-method-token-".concat(o),onChange:function(e){var c,o="wc-".concat(r.gateway,"-payment-token");t(r.gateway),n().started((c={payment_method:r.gateway},C()(c,o,e+""),C()(c,"isSavedToken",!0),c))}}}(t,i,o);return!s&&t.is_default&&""===l&&(f(t.tokenId+""),n.onChange(t.tokenId)),n}))})).filter(Boolean);m.current=e}),[a,f,l,s,i,o,p]);var O=l&&d[s]&&null!==(e=d[s])&&void 0!==e&&e.savedTokenComponent?Object(r.cloneElement)(null===(t=d[s])||void 0===t?void 0:t.savedTokenComponent,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?dn(Object(n),!0).forEach((function(t){C()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):dn(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({token:l},b)):null;return m.current.length>0?Object(r.createElement)(r.Fragment,null,Object(r.createElement)(un.a,{id:"wc-payment-method-saved-tokens",selected:l,onChange:f,options:m.current}),O):null},mn=function(){var e=Object(Qe.b)(),t=e.isInitialized,n=e.paymentMethods,o=Object(Ze.b)().customerPaymentMethods;return t&&0===Object.keys(n).length?Object(r.createElement)(Kt,null):Object(r.createElement)(r.Fragment,null,Object(r.createElement)(bn,null),Object.keys(o).length>0&&Object(r.createElement)(ht.a,{label:Object(c.__)("Use another payment method.",'woocommerce'),screenReaderLabel:Object(c.__)("Other available payment methods",'woocommerce'),wrapperElement:"p",wrapperProps:{className:["wc-block-components-checkout-step__description wc-block-components-checkout-step__description-payments-aligned"]}}),Object(r.createElement)(ln,null))},fn=function(){var e=Object(Gt.c)().noticeContexts;return Object(r.createElement)(Ht.a,{context:e.PAYMENTS},Object(r.createElement)(mn,null))};function On(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function gn(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?On(Object(n),!0).forEach((function(t){C()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):On(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var hn=gn(gn({},we({defaultTitle:Object(c.__)("Payment options",'woocommerce'),defaultDescription:""})),{},{lock:{type:"object",default:{move:!0,remove:!0}}}),jn=n(544);Object(u.d)(jn,{icon:{src:Object(r.createElement)(s.a,{srcElement:Ut.a}),foreground:"#874FB9"},attributes:hn,edit:function(e){var t=Object(v.getSetting)("globalPaymentMethods");return Object(r.createElement)(oe,ge()({},e,{className:"wc-block-checkout__payment-method"}),Object(r.createElement)(p.InspectorControls,null,t.length>0&&Object(r.createElement)(g.PanelBody,{title:Object(c.__)("Methods",'woocommerce')},Object(r.createElement)("p",{className:"wc-block-checkout__controls-text"},Object(c.__)("You currently have the following payment integrations active.",'woocommerce')),t.map((function(e){return Object(r.createElement)(zt,{key:e.id,href:"".concat(v.ADMIN_URL,"admin.php?page=wc-settings&tab=checkout&section=").concat(e.id),title:e.title,description:e.description})})),Object(r.createElement)(g.ExternalLink,{href:"".concat(v.ADMIN_URL,"admin.php?page=wc-settings&tab=checkout")},Object(c.__)("Manage payment methods",'woocommerce')))),Object(r.createElement)(g.Disabled,null,Object(r.createElement)(fn,null)),Object(r.createElement)(ae,{block:W.innerBlockAreas.PAYMENT_METHODS}))},save:function(){return Object(r.createElement)("div",p.useBlockProps.save(),Object(r.createElement)(se,null))}});var vn=n(83),En=n(198),yn=(n(274),function(){var e=Object(Fe.b)(),t=e.isCalculating,n=e.isProcessing,o=e.isAfterProcessing,a=e.isBeforeProcessing,s=e.isComplete,i=e.hasError,l=Object(Ze.b)().currentStatus,u=Object(Qe.a)(),p=u.paymentMethods,d=u.isInitialized,m=Object(b.b)().isEditor,f=Object(Gt.c)().noticeContexts;if(!d||d&&0===Object.keys(p).length)return m||v.CURRENT_USER_IS_ADMIN?Object(r.createElement)(Ht.a,{context:f.EXPRESS_PAYMENTS}):null;var O=n||o||a||s&&!i;return Object(r.createElement)(r.Fragment,null,Object(r.createElement)(vn.a,{isLoading:t||O||l.isDoingExpressPayment},Object(r.createElement)("div",{className:"wc-block-components-express-payment wc-block-components-express-payment--checkout"},Object(r.createElement)("div",{className:"wc-block-components-express-payment__title-container"},Object(r.createElement)(re.a,{className:"wc-block-components-express-payment__title",headingLevel:"2"},Object(c.__)("Express checkout",'woocommerce'))),Object(r.createElement)("div",{className:"wc-block-components-express-payment__content"},Object(r.createElement)(Ht.a,{context:f.EXPRESS_PAYMENTS},Object(r.createElement)("p",null,Object(c.__)("In a hurry? Use one of our express checkout options:",'woocommerce')),Object(r.createElement)(En.a,null))))),Object(r.createElement)("div",{className:"wc-block-components-express-payment-continue-rule wc-block-components-express-payment-continue-rule--checkout"},Object(c.__)("Or continue below",'woocommerce')))}),wn=function(){return Object(_t.a)().cartNeedsPayment?Object(r.createElement)(yn,null):null},kn=(n(837),function(){return Object(r.createElement)(qt.a,{icon:Object(r.createElement)(s.a,{srcElement:Ut.a}),label:Object(c.__)("Express Checkout",'woocommerce'),className:"wp-block-woocommerce-checkout-express-payment-block-placeholder"},Object(r.createElement)("span",{className:"wp-block-woocommerce-checkout-express-payment-block-placeholder__description"},Object(c.__)("Your store doesn't have any Payment Methods that support the Express Checkout Block. If they are added, they will be shown here.",'woocommerce')),Object(r.createElement)(Yt.a,{isPrimary:!0,href:"".concat(v.ADMIN_URL,"admin.php?page=wc-settings&tab=checkout"),target:"_blank",rel:"noopener noreferrer",className:"wp-block-woocommerce-checkout-express-payment-block-placeholder__button"},Object(c.__)("Configure Payment Methods",'woocommerce')))}),Sn=n(545);Object(u.d)(Sn,{icon:{src:Object(r.createElement)(s.a,{srcElement:Ut.a}),foreground:"#874FB9"},edit:function(e){var t=e.attributes,n=Object(Qe.a)(),c=n.paymentMethods,o=n.isInitialized,s=Object.keys(c).length>0,i=Object(p.useBlockProps)({className:a()({"wp-block-woocommerce-checkout-express-payment-block--has-express-payment-methods":s}),attributes:t});return o?Object(r.createElement)("div",i,s?Object(r.createElement)(wn,null):Object(r.createElement)(kn,null)):null},save:function(){return Object(r.createElement)("div",p.useBlockProps.save())}});var Cn=Object(r.createElement)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 17 13"},Object(r.createElement)("path",{fill:"currentColor",fillRule:"evenodd",d:"M11.667 2.5h1.666l3.334 3.333V10H15a2.5 2.5 0 11-5 0H6.667a2.5 2.5 0 11-5 0H0V1.667C0 .746.746 0 1.667 0H10c.92 0 1.667.746 1.667 1.667V2.5zM2.917 10a1.25 1.25 0 102.5 0 1.25 1.25 0 00-2.5 0zm-1.25-2.5V1.667H10V7.5H1.667zM11.25 10a1.25 1.25 0 102.5 0 1.25 1.25 0 00-2.5 0z"})),Pn=n(200),Nn=n(500),xn=n(53),Rn=n(25),Tn=(n(839),function(){return Object(r.createElement)(qt.a,{icon:Object(r.createElement)(s.a,{srcElement:Cn}),label:Object(c.__)("Shipping options",'woocommerce'),className:"wc-block-checkout__no-shipping-placeholder"},Object(r.createElement)("span",{className:"wc-block-checkout__no-shipping-placeholder-description"},Object(c.__)("Your store does not have any Shipping Options configured. Once you have added your Shipping Options they will appear here.",'woocommerce')),Object(r.createElement)(Yt.a,{isSecondary:!0,href:"".concat(v.ADMIN_URL,"admin.php?page=wc-settings&tab=shipping"),target:"_blank",rel:"noopener noreferrer"},Object(c.__)("Configure Shipping Options",'woocommerce')))}),An=(n(838),function(e){var t=Object(v.getSetting)("displayCartPricesIncludingTax",!1)?parseInt(e.price,10)+parseInt(e.taxes,10):parseInt(e.price,10);return{label:Object(Rn.decodeEntities)(e.name),value:e.rate_id,description:Object(Rn.decodeEntities)(e.description),secondaryLabel:Object(r.createElement)(xn.a,{currency:Object(Et.getCurrencyFromPriceResponse)(e),value:t}),secondaryDescription:Object(Rn.decodeEntities)(e.delivery_time)}}),In=function(){var e=Object(b.b)().isEditor,t=Object(ue.b)(),n=t.shippingRates,o=t.shippingRatesLoading,s=t.needsShipping,i=t.hasCalculatedShipping;if(!s)return null;var l=Object(Nn.a)(n);return e||i||l?Object(r.createElement)(r.Fragment,null,e&&!l?Object(r.createElement)(Tn,null):Object(r.createElement)(Pn.a,{noResultsMessage:Object(r.createElement)(Wt.a,{isDismissible:!1,className:a()("wc-block-components-shipping-rates-control__no-results-notice","woocommerce-error")},Object(c.__)("There are no shipping options available. Please check your shipping address.",'woocommerce')),renderOption:An,shippingRates:n,shippingRatesLoading:o})):Object(r.createElement)("p",null,Object(c.__)("Shipping options will be displayed here after entering your full shipping address.",'woocommerce'))};function Mn(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Dn(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Mn(Object(n),!0).forEach((function(t){C()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Mn(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Fn=Dn(Dn({},we({defaultTitle:Object(c.__)("Shipping options",'woocommerce'),defaultDescription:""})),{},{allowCreateAccount:{type:"boolean",default:!1},lock:{type:"object",default:{move:!0,remove:!0}}}),Bn=n(546);Object(u.d)(Bn,{icon:{src:Object(r.createElement)(s.a,{srcElement:Cn}),foreground:"#874FB9"},attributes:Fn,edit:function(e){var t=e.attributes,n=e.setAttributes,o=Object(v.getSetting)("globalShippingMethods"),a=Object(v.getSetting)("activeShippingZones");return Object(r.createElement)(oe,{attributes:t,setAttributes:n},Object(r.createElement)(p.InspectorControls,null,o.length>0&&Object(r.createElement)(g.PanelBody,{title:Object(c.__)("Methods",'woocommerce')},Object(r.createElement)("p",{className:"wc-block-checkout__controls-text"},Object(c.__)("You currently have the following shipping integrations active.",'woocommerce')),o.map((function(e){return Object(r.createElement)(zt,{key:e.id,href:"".concat(v.ADMIN_URL,"admin.php?page=wc-settings&tab=shipping&section=").concat(e.id),title:e.title,description:e.description})})),Object(r.createElement)(g.ExternalLink,{href:"".concat(v.ADMIN_URL,"admin.php?page=wc-settings&tab=shipping")},Object(c.__)("Manage shipping methods",'woocommerce'))),a.length&&Object(r.createElement)(g.PanelBody,{title:Object(c.__)("Zones",'woocommerce')},Object(r.createElement)("p",{className:"wc-block-checkout__controls-text"},Object(c.__)("You currently have the following shipping zones active.",'woocommerce')),a.map((function(e){return Object(r.createElement)(zt,{key:e.id,href:"".concat(v.ADMIN_URL,"admin.php?page=wc-settings&tab=shipping&zone_id=").concat(e.id),title:e.title,description:e.description})})),Object(r.createElement)(g.ExternalLink,{href:"".concat(v.ADMIN_URL,"admin.php?page=wc-settings&tab=shipping")},Object(c.__)("Manage shipping zones",'woocommerce')))),Object(r.createElement)(g.Disabled,null,Object(r.createElement)(In,null)),Object(r.createElement)(ae,{block:W.innerBlockAreas.SHIPPING_METHODS}))},save:function(){return Object(r.createElement)("div",p.useBlockProps.save(),Object(r.createElement)(se,null))}});var Ln={title:Object(c.__)("Checkout",'woocommerce'),icon:{src:Object(r.createElement)(s.a,{srcElement:l}),foreground:"#874FB9"},category:"woocommerce",keywords:[Object(c.__)("WooCommerce",'woocommerce')],description:Object(c.__)("Display a checkout form so your customers can submit orders.",'woocommerce'),supports:{align:["wide","full"],html:!1,multiple:!1},attributes:H,apiVersion:2,edit:function(e){var t=e.attributes,n=e.setAttributes,o=t.allowCreateAccount,s=t.showCompanyField,i=t.requireCompanyField,l=t.showApartmentField,u=t.showPhoneField,h=t.requirePhoneField,j=t.showOrderNotes,v=t.showPolicyLinks,y=t.showReturnToCart,_=t.showRateAfterTaxName,w=[["woocommerce/checkout-fields-block",{},[["woocommerce/checkout-express-payment-block",{},[]],["woocommerce/checkout-contact-information-block",{},[]],["woocommerce/checkout-shipping-address-block",{},[]],["woocommerce/checkout-billing-address-block",{},[]],["woocommerce/checkout-shipping-methods-block",{},[]],["woocommerce/checkout-payment-block",{},[]],!!j&&["woocommerce/checkout-order-note-block",{},[]],!!v&&["woocommerce/checkout-terms-block",{},[]],["woocommerce/checkout-actions-block",{showReturnToCart:y,cartPageId:t.cartPageId},[]]].filter(Boolean)],["woocommerce/checkout-totals-block",{},[["woocommerce/checkout-order-summary-block",{showRateAfterTaxName:_},[]]]]],S=function(e){var r={};r[e]=!t[e],n(r)},C=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=Object(r.useRef)(),n=Object(p.useBlockProps)(I({ref:t},e));return D({ref:t}),n}();return Object(r.createElement)("div",C,Object(r.createElement)(b.a,{previewData:{previewCart:f.a,previewSavedPaymentMethods:O}},Object(r.createElement)(z,{attributes:t,setAttributes:n}),Object(r.createElement)(m.a,null,Object(r.createElement)(k,null,Object(r.createElement)(d.a,{className:a()("wc-block-checkout",{"has-dark-controls":t.hasDarkControls})},Object(r.createElement)(B.Provider,{value:{addressFieldControls:function(){return Object(r.createElement)(p.InspectorControls,null,Object(r.createElement)(g.PanelBody,{title:Object(c.__)("Address Fields",'woocommerce')},Object(r.createElement)("p",{className:"wc-block-checkout__controls-text"},Object(c.__)("Show or hide fields in the checkout address forms.",'woocommerce')),Object(r.createElement)(g.ToggleControl,{label:Object(c.__)("Company",'woocommerce'),checked:s,onChange:function(){return S("showCompanyField")}}),s&&Object(r.createElement)(g.CheckboxControl,{label:Object(c.__)("Require company name?",'woocommerce'),checked:i,onChange:function(){return S("requireCompanyField")},className:"components-base-control--nested"}),Object(r.createElement)(g.ToggleControl,{label:Object(c.__)("Apartment, suite, etc.",'woocommerce'),checked:l,onChange:function(){return S("showApartmentField")}}),Object(r.createElement)(g.ToggleControl,{label:Object(c.__)("Phone",'woocommerce'),checked:u,onChange:function(){return S("showPhoneField")}}),u&&Object(r.createElement)(g.CheckboxControl,{label:Object(c.__)("Require phone number?",'woocommerce'),checked:h,onChange:function(){return S("requirePhoneField")},className:"components-base-control--nested"})))},accountControls:function(){return Object(r.createElement)(p.InspectorControls,null,Object(r.createElement)(g.PanelBody,{title:Object(c.__)("Account options",'woocommerce')},Object(r.createElement)(g.ToggleControl,{label:Object(c.__)("Allow shoppers to sign up for a user account during checkout",'woocommerce'),checked:o,onChange:function(){return n({allowCreateAccount:!o})}})))}}},Object(r.createElement)(F.Provider,{value:{allowCreateAccount:o,showCompanyField:s,requireCompanyField:i,showApartmentField:l,showPhoneField:u,requirePhoneField:h}},Object(r.createElement)(p.InnerBlocks,{allowedBlocks:U,template:w,templateLock:"insert"}))))))),Object(r.createElement)(E.a,{blockName:"checkout"}))},save:function(){return Object(r.createElement)("div",p.useBlockProps.save({className:"wc-block-checkout is-loading"}),Object(r.createElement)(p.InnerBlocks.Content,null))},deprecated:[{attributes:H,save:function(e){var t=e.attributes;return Object(r.createElement)("div",{className:a()("is-loading",t.className)})}}]};Object(u.d)("woocommerce/checkout",Ln)},90:function(e,t,n){"use strict";var r=n(9),c=n.n(r),o=n(16),a=n.n(o),s=n(0),i=n(182),l=n(6),u=n.n(l),p=n(114),d=(n(208),["className","showSpinner","children"]);t.a=function(e){var t=e.className,n=e.showSpinner,r=void 0!==n&&n,o=e.children,l=a()(e,d),b=u()("wc-block-components-button",t,{"wc-block-components-button--loading":r});return Object(s.createElement)(i.a,c()({className:b},l),r&&Object(s.createElement)(p.a,null),Object(s.createElement)("span",{className:"wc-block-components-button__text"},o))}},91:function(e,t){e.exports=window.wp.autop}});woocommerce-blocks/build/attribute-filter.asset.php000064400000000765151335517640016574 0ustar00<?php return array('dependencies' => array('lodash', 'moment', 'react', 'react-dom', 'wc-blocks-data-store', 'wc-settings', 'wp-a11y', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-data-controls', 'wp-date', 'wp-deprecated', 'wp-dom', 'wp-element', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-is-shallow-equal', 'wp-keycodes', 'wp-polyfill', 'wp-primitives', 'wp-url', 'wp-viewport'), 'version' => 'e23a6669926e72cf50a02dd296f8d9a5');woocommerce-blocks/build/wc-blocks-shared-context.js000064400000006741151335517640016627 0ustar00this.wc=this.wc||{},this.wc.wcBlocksSharedContext=function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=165)}({0:function(e,t){e.exports=window.wp.element},149:function(e,t,r){"use strict";var n=r(150);function o(){}function a(){}a.resetWarningCache=o,e.exports=function(){function e(e,t,r,o,a,i){if(i!==n){var c=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw c.name="Invariant Violation",c}}function t(){return e}e.isRequired=e;var r={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:a,resetWarningCache:o};return r.PropTypes=r,r}},150:function(e,t,r){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},165:function(e,t,r){"use strict";r.r(t),r.d(t,"useInnerBlockLayoutContext",(function(){return c})),r.d(t,"InnerBlockLayoutContextProvider",(function(){return u})),r.d(t,"useProductDataContext",(function(){return l})),r.d(t,"ProductDataContextProvider",(function(){return d}));var n=r(0),o=r(26),a=r.n(o),i=Object(n.createContext)({parentName:"",parentClassName:"",isLoading:!1}),c=function(){return Object(n.useContext)(i)},u=function(e){var t=e.parentName,r=void 0===t?"":t,o=e.parentClassName,a=void 0===o?"":o,c=e.children,u={parentName:r,parentClassName:a};return Object(n.createElement)(i.Provider,{value:u},c)};u.propTypes={children:a.a.node,parentName:a.a.string,parentClassName:a.a.string};var s={id:0,name:"",parent:0,type:"simple",variation:"",permalink:"",sku:"",short_description:"",description:"",on_sale:!1,prices:{currency_code:"USD",currency_symbol:"$",currency_minor_unit:2,currency_decimal_separator:".",currency_thousand_separator:",",currency_prefix:"$",currency_suffix:"",price:"0",regular_price:"0",sale_price:"0",price_range:null},price_html:"",average_rating:"0",review_count:0,images:[],categories:[],tags:[],attributes:[],variations:[],has_options:!1,is_purchasable:!1,is_in_stock:!1,is_on_backorder:!1,low_stock_remaining:null,sold_individually:!1,quantity_limit:99,add_to_cart:{text:"Add to cart",description:"Add to cart",url:""}},p=Object(n.createContext)({product:s,hasContext:!1}),l=function(){return Object(n.useContext)(p)},d=function(e){var t=e.product,r=void 0===t?null:t,o=e.children,a=e.isLoading,i=void 0!==a&&a,c={product:r||s,hasContext:!0};return Object(n.createElement)(p.Provider,{value:c},i?Object(n.createElement)("div",{className:"is-loading"},o):o)};d.propTypes={children:a.a.node,product:a.a.object}},26:function(e,t,r){e.exports=r(149)()}});woocommerce-blocks/build/wc-payment-method-stripe.asset.php000064400000000312151335517640020140 0ustar00<?php return array('dependencies' => array('react', 'wc-blocks-registry', 'wc-settings', 'wp-element', 'wp-i18n', 'wp-is-shallow-equal', 'wp-polyfill'), 'version' => 'b41ba331335678d1353e9f008e52b8b7');woocommerce-blocks/build/handpicked-products.asset.php000064400000000746151335517640017240 0ustar00<?php return array('dependencies' => array('lodash', 'moment', 'react', 'react-dom', 'wc-settings', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-data-controls', 'wp-date', 'wp-deprecated', 'wp-dom', 'wp-element', 'wp-escape-html', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-keycodes', 'wp-polyfill', 'wp-primitives', 'wp-server-side-render', 'wp-url', 'wp-viewport'), 'version' => 'ee285c14254a505956e245bd0b4a8b4f');woocommerce-blocks/build/attribute-filter-frontend.js000064400000177321151335517640017123 0ustar00!function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=290)}({0:function(e,t){e.exports=window.wp.element},1:function(e,t){e.exports=window.wp.i18n},10:function(e,t,n){e.exports=n(79)()},100:function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var r=n(5),o=n.n(r),i=n(0),a=function(){var e=Object(i.useState)(),t=o()(e,2)[1];return Object(i.useCallback)((function(e){t((function(){throw e}))}),[])}},107:function(e,t,n){"use strict";n.d(t,"a",(function(){return f}));var r=n(14),o=n.n(r),i=n(4),a=n.n(i),u=n(0),c=n(44);function s(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function l(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?s(Object(n),!0).forEach((function(t){a()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):s(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var p=[".wp-block-woocommerce-cart"],d=function(e){var t=e.Block,n=e.containers,r=e.getProps,i=void 0===r?function(){return{}}:r,a=e.getErrorBoundaryProps,s=void 0===a?function(){return{}}:a;0!==n.length&&Array.prototype.forEach.call(n,(function(e,n){var r=i(e,n),a=s(e,n),p=l(l({},e.dataset),r.attributes||{});e.classList.remove("is-loading"),Object(u.render)(React.createElement(c.a,a,React.createElement(u.Suspense,{fallback:React.createElement("div",{className:"wc-block-placeholder"})},React.createElement(t,o()({},r,{attributes:p})))),e)}))},f=function(e){var t,n,r,o,i,a,u,c=document.body.querySelectorAll(p.join(","));t=l(l({},e),{},{wrappers:c}),n=t.Block,r=t.getProps,o=t.getErrorBoundaryProps,i=t.selector,a=t.wrappers,u=document.body.querySelectorAll(i),a.length>0&&Array.prototype.filter.call(u,(function(e){return!function(e,t){return Array.prototype.some.call(t,(function(t){return t.contains(e)&&!t.isSameNode(e)}))}(e,a)})),d({Block:n,containers:u,getProps:r,getErrorBoundaryProps:o}),Array.prototype.forEach.call(c,(function(t){t.addEventListener("wc-blocks_render_blocks_frontend",(function(){var n,r,o,i,a,u;r=(n=l(l({},e),{},{wrapper:t})).Block,o=n.getProps,i=n.getErrorBoundaryProps,a=n.selector,u=n.wrapper.querySelectorAll(a),d({Block:r,containers:u,getProps:o,getErrorBoundaryProps:i})}))}))}},108:function(e,t,n){"use strict";var r=n(1),o=n(51);n(197),t.a=function(e){var t=e.name,n=e.count;return React.createElement(React.Fragment,null,t,Number.isFinite(n)&&React.createElement(o.a,{label:n,screenReaderLabel:Object(r.sprintf)(
/* translators: %s number of products. */
Object(r._n)("%s product","%s products",n,'woocommerce'),n),wrapperElement:"span",wrapperProps:{className:"wc-filter-element-label-list-count"}}))}},11:function(e,t){e.exports=window.wp.data},115:function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var r=n(3),o=n(82);function i(e,t){return e===t}function a(e,t,n){var a=n&&n.equalityFn?n.equalityFn:i,u=Object(r.useState)(e),c=u[0],s=u[1],l=Object(o.a)(Object(r.useCallback)((function(e){return s(e)}),[]),t,n),p=l[0],d=l[1],f=l[2],m=Object(r.useRef)(e);return Object(r.useEffect)((function(){a(m.current,e)||(p(e),m.current=e)}),[e,p,a]),[c,d,f]}},120:function(e,t,n){"use strict";n.d(t,"a",(function(){return c}));var r=n(8),o=n(11),i=n(0),a=n(53),u=n(100),c=function(e){var t=e.namespace,n=e.resourceName,c=e.resourceValues,s=void 0===c?[]:c,l=e.query,p=void 0===l?{}:l,d=e.shouldSelect,f=void 0===d||d;if(!t||!n)throw new Error("The options object must have valid values for the namespace and the resource properties.");var m=Object(i.useRef)({results:[],isLoading:!0}),b=Object(a.a)(p),g=Object(a.a)(s),h=Object(u.a)(),v=Object(o.useSelect)((function(e){if(!f)return null;var o=e(r.COLLECTIONS_STORE_KEY),i=[t,n,b,g],a=o.getCollectionError.apply(o,i);return a&&h(a),{results:o.getCollection.apply(o,i),isLoading:!o.hasFinishedResolution("getCollection",i)}}),[t,n,g,b,f]);return null!==v&&(m.current=v),m.current}},128:function(e,t,n){"use strict";var r=n(0),o=n(8),i=n(11),a=n(83);t.a=function(e){return function(t){var n;return n=Object(r.useRef)(a.n.restApiRoutes||{}),Object(i.useSelect)((function(e,t){if(n.current){var r=e(o.SCHEMA_STORE_KEY),i=r.isResolving,a=r.hasFinishedResolution,u=t.dispatch(o.SCHEMA_STORE_KEY),c=u.receiveRoutes,s=u.startResolution,l=u.finishResolution;Object.keys(n.current).forEach((function(e){var t=n.current[e];i("getRoutes",[e])||a("getRoutes",[e])||(s("getRoutes",[e]),c(t,[e]),l("getRoutes",[e]))}))}}),[]),React.createElement(e,t)}}},133:function(e,t,n){"use strict";var r=n(1),o=(n(10),n(6)),i=n.n(o),a=n(51),u=(n(154),function(e){var t=e.className,n=e.disabled,o=e.label,u=void 0===o?Object(r.__)("Go",'woocommerce'):o,c=e.onClick,s=e.screenReaderLabel,l=void 0===s?Object(r.__)("Apply filter",'woocommerce'):s;return React.createElement("button",{type:"submit",className:i()("wc-block-filter-submit-button","wc-block-components-filter-submit-button",t),disabled:n,onClick:c},React.createElement(a.a,{label:u,screenReaderLabel:l}))});u.defaultProps={disabled:!1},t.a=u},14:function(e,t){function n(){return e.exports=n=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},e.exports.default=e.exports,e.exports.__esModule=!0,n.apply(this,arguments)}e.exports=n,e.exports.default=e.exports,e.exports.__esModule=!0},149:function(e,t){},152:function(e,t,n){"use strict";var r=n(4),o=n.n(r),i=n(23),a=n.n(i),u=n(0),c=["srcElement","size"];function s(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}t.a=function(e){var t=e.srcElement,n=e.size,r=void 0===n?24:n,i=a()(e,c);return Object(u.isValidElement)(t)?Object(u.cloneElement)(t,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?s(Object(n),!0).forEach((function(t){o()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):s(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({width:r,height:r},i)):null}},154:function(e,t){},169:function(e,t,n){"use strict";n.d(t,"a",(function(){return i})),n.d(t,"b",(function(){return a}));var r=n(2),o=Object(r.getSetting)("attributes",[]).reduce((function(e,t){var n,r=(n=t)&&n.attribute_name?{id:parseInt(n.attribute_id,10),name:n.attribute_name,taxonomy:"pa_"+n.attribute_name,label:n.attribute_label}:null;return r.id&&e.push(r),e}),[]),i=function(e){if(e)return o.find((function(t){return t.id===e}))},a=function(e){if(e)return o.find((function(t){return t.taxonomy===e}))}},170:function(e,t,n){"use strict";n.d(t,"a",(function(){return o})),n.d(t,"b",(function(){return i}));var r=n(7),o=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){},n=arguments.length>2?arguments[2]:void 0,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"",i=e.filter((function(e){return e.attribute===n.taxonomy})),a=i.length?i[0]:null;if(a&&a.slug&&Array.isArray(a.slug)&&a.slug.includes(o)){var u=a.slug.filter((function(e){return e!==o})),c=e.filter((function(e){return e.attribute!==n.taxonomy}));u.length>0&&(a.slug=u.sort(),c.push(a)),t(Object(r.sortBy)(c,"attribute"))}},i=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){},n=arguments.length>2?arguments[2]:void 0,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"in",a=e.filter((function(e){return e.attribute!==n.taxonomy}));0===o.length?t(a):(a.push({attribute:n.taxonomy,operator:i,slug:o.map((function(e){return e.slug})).sort()}),t(Object(r.sortBy)(a,"attribute")))}},171:function(e,t,n){"use strict";var r=n(46),o=n.n(r),i=n(5),a=n.n(i),u=n(1),c=(n(10),n(0)),s=n(6),l=n.n(s);n(198),t.a=function(e){var t=e.className,n=e.onChange,r=void 0===n?function(){}:n,i=e.options,s=void 0===i?[]:i,p=e.checked,d=void 0===p?[]:p,f=e.isLoading,m=void 0!==f&&f,b=e.isDisabled,g=void 0!==b&&b,h=e.limit,v=void 0===h?10:h,y=Object(c.useState)(!1),O=a()(y,2),w=O[0],x=O[1],_=Object(c.useMemo)((function(){return o()(Array(5)).map((function(e,t){return React.createElement("li",{key:t,style:{width:Math.floor(75*Math.random())+25+"%"}})}))}),[]),E=Object(c.useMemo)((function(){var e=s.length-v;return!w&&React.createElement("li",{key:"show-more",className:"show-more"},React.createElement("button",{onClick:function(){x(!0)},"aria-expanded":!1,"aria-label":Object(u.sprintf)(
/* translators: %s is referring the remaining count of options */
Object(u._n)("Show %s more option","Show %s more options",e,'woocommerce'),e)},Object(u.sprintf)(
/* translators: %s number of options to reveal. */
Object(u._n)("Show %s more","Show %s more",e,'woocommerce'),e)))}),[s,v,w]),j=Object(c.useMemo)((function(){return w&&React.createElement("li",{key:"show-less",className:"show-less"},React.createElement("button",{onClick:function(){x(!1)},"aria-expanded":!0,"aria-label":Object(u.__)("Show less options",'woocommerce')},Object(u.__)("Show less",'woocommerce')))}),[w]),I=Object(c.useMemo)((function(){var e=s.length>v+5;return React.createElement(React.Fragment,null,s.map((function(t,n){return React.createElement(c.Fragment,{key:t.value},React.createElement("li",e&&!w&&n>=v&&{hidden:!0},React.createElement("input",{type:"checkbox",id:t.value,value:t.value,onChange:function(e){r(e.target.value)},checked:d.includes(t.value),disabled:g}),React.createElement("label",{htmlFor:t.value},t.label)),e&&n===v-1&&E)})),e&&j)}),[s,r,d,w,v,j,E,g]),S=l()("wc-block-checkbox-list","wc-block-components-checkbox-list",{"is-loading":m},t);return React.createElement("ul",{className:S},m?_:I)}},194:function(e,t,n){"use strict";var r=n(14),o=n.n(r),i=n(23),a=n.n(i),u=(n(10),n(6)),c=n.n(u),s=n(1),l=n(152),p=n(216),d=(n(149),["text","screenReaderText","element","className","radius","children"]),f=function(e){var t=e.text,n=e.screenReaderText,r=void 0===n?"":n,i=e.element,u=void 0===i?"li":i,s=e.className,l=void 0===s?"":s,p=e.radius,f=void 0===p?"small":p,m=e.children,b=void 0===m?null:m,g=a()(e,d),h=u,v=c()(l,"wc-block-components-chip","wc-block-components-chip--radius-"+f),y=Boolean(r&&r!==t);return React.createElement(h,o()({className:v},g),React.createElement("span",{"aria-hidden":y,className:"wc-block-components-chip__text"},t),y&&React.createElement("span",{className:"screen-reader-text"},r),b)},m=["ariaLabel","className","disabled","onRemove","removeOnAnyClick","text","screenReaderText"];t.a=function(e){var t=e.ariaLabel,n=void 0===t?"":t,r=e.className,i=void 0===r?"":r,u=e.disabled,d=void 0!==u&&u,b=e.onRemove,g=void 0===b?function(){}:b,h=e.removeOnAnyClick,v=void 0!==h&&h,y=e.text,O=e.screenReaderText,w=void 0===O?"":O,x=a()(e,m),_=v?"span":"button";if(!n){var E=w&&"string"==typeof w?w:y;n="string"!=typeof E?
/* translators: Remove chip. */
Object(s.__)("Remove",'woocommerce'):Object(s.sprintf)(
/* translators: %s text of the chip to remove. */
Object(s.__)('Remove "%s"','woocommerce'),E)}var j={"aria-label":n,disabled:d,onClick:g,onKeyDown:function(e){"Backspace"!==e.key&&"Delete"!==e.key||g()}},I=v?j:{},S=v?{"aria-hidden":!0}:j;return React.createElement(f,o()({},x,I,{className:c()(i,"is-removable"),element:v?"button":x.element,screenReaderText:w,text:y}),React.createElement(_,o()({className:"wc-block-components-chip__remove"},S),React.createElement(l.a,{className:"wc-block-components-chip__remove-icon",srcElement:p.a,size:16})))}},197:function(e,t){},198:function(e,t){},2:function(e,t){e.exports=window.wc.wcSettings},202:function(e,t,n){"use strict";e.exports=n(293)},21:function(e,t){function n(t){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?(e.exports=n=function(e){return typeof e},e.exports.default=e.exports,e.exports.__esModule=!0):(e.exports=n=function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.default=e.exports,e.exports.__esModule=!0),n(t)}e.exports=n,e.exports.default=e.exports,e.exports.__esModule=!0},216:function(e,t,n){"use strict";var r=n(14),o=n.n(r),i=n(23),a=n.n(i),u=n(34),c=["className","size"],s=function(e){var t=e.className,n=e.size,r=a()(e,c);return React.createElement(u.SVG,o()({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",className:t,width:n,height:n},r),React.createElement("path",{d:"M14.95 6.46L11.41 10l3.54 3.54-1.41 1.41L10 11.42l-3.53 3.53-1.42-1.42L8.58 10 5.05 6.47l1.42-1.42L10 8.58l3.54-3.53z"}))},l=React.createElement(s,null);t.a=l},223:function(e,t,n){"use strict";n.d(t,"a",(function(){return O}));var r=n(4),o=n.n(r),i=n(46),a=n.n(i),u=n(21),c=n.n(u),s=n(5),l=n.n(s),p=n(0),d=n(115),f=n(7),m=n(53),b=n(90),g=n(120),h=n(64);function v(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function y(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?v(Object(n),!0).forEach((function(t){o()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):v(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var O=function(e){var t=e.queryAttribute,n=e.queryPrices,r=e.queryStock,o=e.queryState,i=Object(h.a)();i="".concat(i,"-collection-data");var u=Object(b.a)(i),s=l()(u,1)[0],v=Object(b.b)("calculate_attribute_counts",[],i),O=l()(v,2),w=O[0],x=O[1],_=Object(b.b)("calculate_price_range",null,i),E=l()(_,2),j=E[0],I=E[1],S=Object(b.b)("calculate_stock_status_counts",null,i),k=l()(S,2),R=k[0],P=k[1],C=Object(m.a)(t||{}),M=Object(m.a)(n),T=Object(m.a)(r);Object(p.useEffect)((function(){"object"===c()(C)&&Object.keys(C).length&&(w.find((function(e){return e.taxonomy===C.taxonomy}))||x([].concat(a()(w),[C])))}),[C,w,x]),Object(p.useEffect)((function(){j!==M&&void 0!==M&&I(M)}),[M,I,j]),Object(p.useEffect)((function(){R!==T&&void 0!==T&&P(T)}),[T,P,R]);var D=Object(p.useState)(!1),A=l()(D,2),H=A[0],N=A[1],L=Object(d.a)(H,200),B=l()(L,1)[0];H||N(!0);var V=Object(p.useMemo)((function(){return function(e){var t=e;return e.calculate_attribute_counts&&(t.calculate_attribute_counts=Object(f.sortBy)(e.calculate_attribute_counts.map((function(e){return{taxonomy:e.taxonomy,query_type:e.queryType}})),["taxonomy","query_type"])),t}(s)}),[s]);return Object(g.a)({namespace:"/wc/store",resourceName:"products/collection-data",query:y(y({},o),{},{page:void 0,per_page:void 0,orderby:void 0,order:void 0},V),shouldSelect:B})}},23:function(e,t,n){var r=n(77);e.exports=function(e,t){if(null==e)return{};var n,o,i=r(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(o=0;o<a.length;o++)n=a[o],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i},e.exports.default=e.exports,e.exports.__esModule=!0},25:function(e,t){e.exports=window.wp.isShallowEqual},28:function(e,t){e.exports=window.wp.htmlEntities},29:function(e,t){e.exports=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e},e.exports.default=e.exports,e.exports.__esModule=!0},290:function(e,t,n){e.exports=n(312)},291:function(e,t){},292:function(e,t){},293:function(e,t,n){"use strict";var r=60103,o=60106,i=60107,a=60108,u=60114,c=60109,s=60110,l=60112,p=60113,d=60120,f=60115,m=60116,b=60121,g=60122,h=60117,v=60129,y=60131;if("function"==typeof Symbol&&Symbol.for){var O=Symbol.for;r=O("react.element"),o=O("react.portal"),i=O("react.fragment"),a=O("react.strict_mode"),u=O("react.profiler"),c=O("react.provider"),s=O("react.context"),l=O("react.forward_ref"),p=O("react.suspense"),d=O("react.suspense_list"),f=O("react.memo"),m=O("react.lazy"),b=O("react.block"),g=O("react.server.block"),h=O("react.fundamental"),v=O("react.debug_trace_mode"),y=O("react.legacy_hidden")}function w(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case r:switch(e=e.type){case i:case u:case a:case p:case d:return e;default:switch(e=e&&e.$$typeof){case s:case l:case m:case f:case c:return e;default:return t}}case o:return t}}}var x=c,_=r,E=l,j=i,I=m,S=f,k=o,R=u,P=a,C=p;t.ContextConsumer=s,t.ContextProvider=x,t.Element=_,t.ForwardRef=E,t.Fragment=j,t.Lazy=I,t.Memo=S,t.Portal=k,t.Profiler=R,t.StrictMode=P,t.Suspense=C,t.isAsyncMode=function(){return!1},t.isConcurrentMode=function(){return!1},t.isContextConsumer=function(e){return w(e)===s},t.isContextProvider=function(e){return w(e)===c},t.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===r},t.isForwardRef=function(e){return w(e)===l},t.isFragment=function(e){return w(e)===i},t.isLazy=function(e){return w(e)===m},t.isMemo=function(e){return w(e)===f},t.isPortal=function(e){return w(e)===o},t.isProfiler=function(e){return w(e)===u},t.isStrictMode=function(e){return w(e)===a},t.isSuspense=function(e){return w(e)===p},t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===i||e===u||e===v||e===a||e===p||e===d||e===y||"object"==typeof e&&null!==e&&(e.$$typeof===m||e.$$typeof===f||e.$$typeof===c||e.$$typeof===s||e.$$typeof===l||e.$$typeof===h||e.$$typeof===b||e[0]===g)},t.typeOf=w},3:function(e,t){e.exports=window.React},30:function(e,t){function n(t){return e.exports=n=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},e.exports.default=e.exports,e.exports.__esModule=!0,n(t)}e.exports=n,e.exports.default=e.exports,e.exports.__esModule=!0},312:function(e,t,n){"use strict";n.r(t);var r=n(128),o=n(107),i=n(4),a=n.n(i),u=n(5),c=n.n(u),s=n(1),l=n(33),p=n(53),d=n(99),f=n(90),m=n(120),b=n(223),g=n(0),h=n(171),v=n(10),y=n.n(v),O=n(6),w=n.n(O);function x(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}function _(){return(_=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function E(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function j(e,t){return(j=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var I=n(3);function S(e){return"object"==typeof e&&null!=e&&1===e.nodeType}function k(e,t){return(!t||"hidden"!==e)&&"visible"!==e&&"clip"!==e}function R(e,t){if(e.clientHeight<e.scrollHeight||e.clientWidth<e.scrollWidth){var n=getComputedStyle(e,null);return k(n.overflowY,t)||k(n.overflowX,t)||function(e){var t=function(e){if(!e.ownerDocument||!e.ownerDocument.defaultView)return null;try{return e.ownerDocument.defaultView.frameElement}catch(e){return null}}(e);return!!t&&(t.clientHeight<e.scrollHeight||t.clientWidth<e.scrollWidth)}(e)}return!1}function P(e,t,n,r,o,i,a,u){return i<e&&a>t||i>e&&a<t?0:i<=e&&u<=n||a>=t&&u>=n?i-e-r:a>t&&u<n||i<e&&u>n?a-t+o:0}n(202);var C=function(){return(C=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};Object.create,Object.create;var M=0;function T(e){return"function"==typeof e?e:D}function D(){}function A(e,t){e&&function(e,t){var n=window,r=t.scrollMode,o=t.block,i=t.inline,a=t.boundary,u=t.skipOverflowHiddenElements,c="function"==typeof a?a:function(e){return e!==a};if(!S(e))throw new TypeError("Invalid target");for(var s=document.scrollingElement||document.documentElement,l=[],p=e;S(p)&&c(p);){if((p=p.parentElement)===s){l.push(p);break}null!=p&&p===document.body&&R(p)&&!R(document.documentElement)||null!=p&&R(p,u)&&l.push(p)}for(var d=n.visualViewport?n.visualViewport.width:innerWidth,f=n.visualViewport?n.visualViewport.height:innerHeight,m=window.scrollX||pageXOffset,b=window.scrollY||pageYOffset,g=e.getBoundingClientRect(),h=g.height,v=g.width,y=g.top,O=g.right,w=g.bottom,x=g.left,_="start"===o||"nearest"===o?y:"end"===o?w:y+h/2,E="center"===i?x+v/2:"end"===i?O:x,j=[],I=0;I<l.length;I++){var k=l[I],C=k.getBoundingClientRect(),M=C.height,T=C.width,D=C.top,A=C.right,H=C.bottom,N=C.left;if("if-needed"===r&&y>=0&&x>=0&&w<=f&&O<=d&&y>=D&&w<=H&&x>=N&&O<=A)return j;var L=getComputedStyle(k),B=parseInt(L.borderLeftWidth,10),V=parseInt(L.borderTopWidth,10),K=parseInt(L.borderRightWidth,10),F=parseInt(L.borderBottomWidth,10),q=0,U=0,$="offsetWidth"in k?k.offsetWidth-k.clientWidth-B-K:0,W="offsetHeight"in k?k.offsetHeight-k.clientHeight-V-F:0;if(s===k)q="start"===o?_:"end"===o?_-f:"nearest"===o?P(b,b+f,f,V,F,b+_,b+_+h,h):_-f/2,U="start"===i?E:"center"===i?E-d/2:"end"===i?E-d:P(m,m+d,d,B,K,m+E,m+E+v,v),q=Math.max(0,q+b),U=Math.max(0,U+m);else{q="start"===o?_-D-V:"end"===o?_-H+F+W:"nearest"===o?P(D,H,M,V,F+W,_,_+h,h):_-(D+M/2)+W/2,U="start"===i?E-N-B:"center"===i?E-(N+T/2)+$/2:"end"===i?E-A+K+$:P(N,A,T,B,K+$,E,E+v,v);var G=k.scrollLeft,Y=k.scrollTop;_+=Y-(q=Math.max(0,Math.min(Y+q,k.scrollHeight-M+W))),E+=G-(U=Math.max(0,Math.min(G+U,k.scrollWidth-T+$)))}j.push({el:k,top:q,left:U})}return j}(e,{boundary:t,block:"nearest",scrollMode:"if-needed"}).forEach((function(e){var t=e.el,n=e.top,r=e.left;t.scrollTop=n,t.scrollLeft=r}))}function H(e,t,n){return e===t||t instanceof n.Node&&e.contains&&e.contains(t)}function N(e,t){var n;function r(){n&&clearTimeout(n)}function o(){for(var o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];r(),n=setTimeout((function(){n=null,e.apply(void 0,i)}),t)}return o.cancel=r,o}function L(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return t.some((function(t){return t&&t.apply(void 0,[e].concat(r)),e.preventDownshiftDefault||e.hasOwnProperty("nativeEvent")&&e.nativeEvent.preventDownshiftDefault}))}}function B(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(e){t.forEach((function(t){"function"==typeof t?t(e):t&&(t.current=e)}))}}function V(e){var t=e.isOpen,n=e.resultCount,r=e.previousResultCount;return t?n?n!==r?n+" result"+(1===n?" is":"s are")+" available, use up and down arrow keys to navigate. Press Enter key to select.":"":"No results are available.":""}function K(e,t){return!(e=Array.isArray(e)?e[0]:e)&&t?t:e}var F=["highlightedIndex","inputValue","isOpen","selectedItem","type"];function q(e){void 0===e&&(e={});var t={};return F.forEach((function(n){e.hasOwnProperty(n)&&(t[n]=e[n])})),t}function U(e,t){return void 0!==e[t]}function $(e){var t=e.key,n=e.keyCode;return n>=37&&n<=40&&0!==t.indexOf("Arrow")?"Arrow"+t:t}function W(e,t,n,r,o){if(void 0===o&&(o=!0),0===n)return-1;var i=n-1;("number"!=typeof t||t<0||t>=n)&&(t=e>0?-1:i+1);var a=t+e;a<0?a=o?i:0:a>i&&(a=o?0:i);var u=G(e,a,n,r,o);return-1===u?t>=n?-1:t:u}function G(e,t,n,r,o){var i=r(t);if(!i||!i.hasAttribute("disabled"))return t;if(e>0){for(var a=t+1;a<n;a++)if(!r(a).hasAttribute("disabled"))return a}else for(var u=t-1;u>=0;u--)if(!r(u).hasAttribute("disabled"))return u;return o?e>0?G(1,0,n,r,!1):G(-1,n-1,n,r,!1):-1}function Y(e,t,n,r){return void 0===r&&(r=!0),t.some((function(t){return t&&(H(t,e,n)||r&&H(t,n.document.activeElement,n))}))}var z=N((function(e){X(e).textContent=""}),500);function Q(e,t){var n=X(t);e&&(n.textContent=e,z(t))}function X(e){void 0===e&&(e=document);var t=e.getElementById("a11y-status-message");return t||((t=e.createElement("div")).setAttribute("id","a11y-status-message"),t.setAttribute("role","status"),t.setAttribute("aria-live","polite"),t.setAttribute("aria-relevant","additions text"),Object.assign(t.style,{border:"0",clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:"0",position:"absolute",width:"1px"}),e.body.appendChild(t),t)}var J=Object.freeze({__proto__:null,unknown:0,mouseUp:1,itemMouseEnter:2,keyDownArrowUp:3,keyDownArrowDown:4,keyDownEscape:5,keyDownEnter:6,keyDownHome:7,keyDownEnd:8,clickItem:9,blurInput:10,changeInput:11,keyDownSpaceButton:12,clickButton:13,blurButton:14,controlledPropUpdatedSelectedItem:15,touchEnd:16}),Z=["refKey","ref"],ee=["onClick","onPress","onKeyDown","onKeyUp","onBlur"],te=["onKeyDown","onBlur","onChange","onInput","onChangeText"],ne=["refKey","ref"],re=["onMouseMove","onMouseDown","onClick","onPress","index","item"],oe=function(){var e=function(e){var t,n;function r(t){var n;(n=e.call(this,t)||this).id=n.props.id||"downshift-"+String(M++),n.menuId=n.props.menuId||n.id+"-menu",n.labelId=n.props.labelId||n.id+"-label",n.inputId=n.props.inputId||n.id+"-input",n.getItemId=n.props.getItemId||function(e){return n.id+"-item-"+e},n.input=null,n.items=[],n.itemCount=null,n.previousResultCount=0,n.timeoutIds=[],n.internalSetTimeout=function(e,t){var r=setTimeout((function(){n.timeoutIds=n.timeoutIds.filter((function(e){return e!==r})),e()}),t);n.timeoutIds.push(r)},n.setItemCount=function(e){n.itemCount=e},n.unsetItemCount=function(){n.itemCount=null},n.setHighlightedIndex=function(e,t){void 0===e&&(e=n.props.defaultHighlightedIndex),void 0===t&&(t={}),t=q(t),n.internalSetState(_({highlightedIndex:e},t))},n.clearSelection=function(e){n.internalSetState({selectedItem:null,inputValue:"",highlightedIndex:n.props.defaultHighlightedIndex,isOpen:n.props.defaultIsOpen},e)},n.selectItem=function(e,t,r){t=q(t),n.internalSetState(_({isOpen:n.props.defaultIsOpen,highlightedIndex:n.props.defaultHighlightedIndex,selectedItem:e,inputValue:n.props.itemToString(e)},t),r)},n.selectItemAtIndex=function(e,t,r){var o=n.items[e];null!=o&&n.selectItem(o,t,r)},n.selectHighlightedItem=function(e,t){return n.selectItemAtIndex(n.getState().highlightedIndex,e,t)},n.internalSetState=function(e,t){var r,o,i={},a="function"==typeof e;return!a&&e.hasOwnProperty("inputValue")&&n.props.onInputValueChange(e.inputValue,_({},n.getStateAndHelpers(),e)),n.setState((function(t){t=n.getState(t);var u=a?e(t):e;u=n.props.stateReducer(t,u),r=u.hasOwnProperty("selectedItem");var c={},s={};return r&&u.selectedItem!==t.selectedItem&&(o=u.selectedItem),u.type=u.type||0,Object.keys(u).forEach((function(e){t[e]!==u[e]&&(i[e]=u[e]),"type"!==e&&(s[e]=u[e],U(n.props,e)||(c[e]=u[e]))})),a&&u.hasOwnProperty("inputValue")&&n.props.onInputValueChange(u.inputValue,_({},n.getStateAndHelpers(),u)),c}),(function(){T(t)(),Object.keys(i).length>1&&n.props.onStateChange(i,n.getStateAndHelpers()),r&&n.props.onSelect(e.selectedItem,n.getStateAndHelpers()),void 0!==o&&n.props.onChange(o,n.getStateAndHelpers()),n.props.onUserAction(i,n.getStateAndHelpers())}))},n.rootRef=function(e){return n._rootNode=e},n.getRootProps=function(e,t){var r,o=void 0===e?{}:e,i=o.refKey,a=void 0===i?"ref":i,u=o.ref,c=x(o,Z),s=(void 0===t?{}:t).suppressRefError,l=void 0!==s&&s;n.getRootProps.called=!0,n.getRootProps.refKey=a,n.getRootProps.suppressRefError=l;var p=n.getState().isOpen;return _(((r={})[a]=B(u,n.rootRef),r.role="combobox",r["aria-expanded"]=p,r["aria-haspopup"]="listbox",r["aria-owns"]=p?n.menuId:null,r["aria-labelledby"]=n.labelId,r),c)},n.keyDownHandlers={ArrowDown:function(e){var t=this;if(e.preventDefault(),this.getState().isOpen){var n=e.shiftKey?5:1;this.moveHighlightedIndex(n,{type:4})}else this.internalSetState({isOpen:!0,type:4},(function(){var e=t.getItemCount();if(e>0){var n=W(1,t.getState().highlightedIndex,e,(function(e){return t.getItemNodeFromIndex(e)}));t.setHighlightedIndex(n,{type:4})}}))},ArrowUp:function(e){var t=this;if(e.preventDefault(),this.getState().isOpen){var n=e.shiftKey?-5:-1;this.moveHighlightedIndex(n,{type:3})}else this.internalSetState({isOpen:!0,type:3},(function(){var e=t.getItemCount();if(e>0){var n=W(-1,t.getState().highlightedIndex,e,(function(e){return t.getItemNodeFromIndex(e)}));t.setHighlightedIndex(n,{type:3})}}))},Enter:function(e){if(229!==e.which){var t=this.getState(),n=t.isOpen,r=t.highlightedIndex;if(n&&null!=r){e.preventDefault();var o=this.items[r],i=this.getItemNodeFromIndex(r);if(null==o||i&&i.hasAttribute("disabled"))return;this.selectHighlightedItem({type:6})}}},Escape:function(e){e.preventDefault(),this.reset(_({type:5},!this.state.isOpen&&{selectedItem:null,inputValue:""}))}},n.buttonKeyDownHandlers=_({},n.keyDownHandlers,{" ":function(e){e.preventDefault(),this.toggleMenu({type:12})}}),n.inputKeyDownHandlers=_({},n.keyDownHandlers,{Home:function(e){var t=this,n=this.getState().isOpen;if(n){e.preventDefault();var r=this.getItemCount();if(!(r<=0)&&n){var o=G(1,0,r,(function(e){return t.getItemNodeFromIndex(e)}),!1);this.setHighlightedIndex(o,{type:7})}}},End:function(e){var t=this,n=this.getState().isOpen;if(n){e.preventDefault();var r=this.getItemCount();if(!(r<=0)&&n){var o=G(-1,r-1,r,(function(e){return t.getItemNodeFromIndex(e)}),!1);this.setHighlightedIndex(o,{type:8})}}}}),n.getToggleButtonProps=function(e){var t=void 0===e?{}:e,r=t.onClick;t.onPress;var o=t.onKeyDown,i=t.onKeyUp,a=t.onBlur,u=x(t,ee),c=n.getState().isOpen,s={onClick:L(r,n.buttonHandleClick),onKeyDown:L(o,n.buttonHandleKeyDown),onKeyUp:L(i,n.buttonHandleKeyUp),onBlur:L(a,n.buttonHandleBlur)};return _({type:"button",role:"button","aria-label":c?"close menu":"open menu","aria-haspopup":!0,"data-toggle":!0},u.disabled?{}:s,u)},n.buttonHandleKeyUp=function(e){e.preventDefault()},n.buttonHandleKeyDown=function(e){var t=$(e);n.buttonKeyDownHandlers[t]&&n.buttonKeyDownHandlers[t].call(E(n),e)},n.buttonHandleClick=function(e){e.preventDefault(),n.props.environment.document.activeElement===n.props.environment.document.body&&e.target.focus(),n.internalSetTimeout((function(){return n.toggleMenu({type:13})}))},n.buttonHandleBlur=function(e){var t=e.target;n.internalSetTimeout((function(){n.isMouseDown||null!=n.props.environment.document.activeElement&&n.props.environment.document.activeElement.id===n.inputId||n.props.environment.document.activeElement===t||n.reset({type:14})}))},n.getLabelProps=function(e){return _({htmlFor:n.inputId,id:n.labelId},e)},n.getInputProps=function(e){var t=void 0===e?{}:e,r=t.onKeyDown,o=t.onBlur,i=t.onChange,a=t.onInput;t.onChangeText;var u,c=x(t,te),s={},l=n.getState(),p=l.inputValue,d=l.isOpen,f=l.highlightedIndex;return c.disabled||((u={}).onChange=L(i,a,n.inputHandleChange),u.onKeyDown=L(r,n.inputHandleKeyDown),u.onBlur=L(o,n.inputHandleBlur),s=u),_({"aria-autocomplete":"list","aria-activedescendant":d&&"number"==typeof f&&f>=0?n.getItemId(f):null,"aria-controls":d?n.menuId:null,"aria-labelledby":n.labelId,autoComplete:"off",value:p,id:n.inputId},s,c)},n.inputHandleKeyDown=function(e){var t=$(e);t&&n.inputKeyDownHandlers[t]&&n.inputKeyDownHandlers[t].call(E(n),e)},n.inputHandleChange=function(e){n.internalSetState({type:11,isOpen:!0,inputValue:e.target.value,highlightedIndex:n.props.defaultHighlightedIndex})},n.inputHandleBlur=function(){n.internalSetTimeout((function(){var e=n.props.environment.document&&!!n.props.environment.document.activeElement&&!!n.props.environment.document.activeElement.dataset&&n.props.environment.document.activeElement.dataset.toggle&&n._rootNode&&n._rootNode.contains(n.props.environment.document.activeElement);n.isMouseDown||e||n.reset({type:10})}))},n.menuRef=function(e){n._menuNode=e},n.getMenuProps=function(e,t){var r,o=void 0===e?{}:e,i=o.refKey,a=void 0===i?"ref":i,u=o.ref,c=x(o,ne),s=(void 0===t?{}:t).suppressRefError,l=void 0!==s&&s;return n.getMenuProps.called=!0,n.getMenuProps.refKey=a,n.getMenuProps.suppressRefError=l,_(((r={})[a]=B(u,n.menuRef),r.role="listbox",r["aria-labelledby"]=c&&c["aria-label"]?null:n.labelId,r.id=n.menuId,r),c)},n.getItemProps=function(e){var t,r=void 0===e?{}:e,o=r.onMouseMove,i=r.onMouseDown,a=r.onClick;r.onPress;var u=r.index,c=r.item,s=void 0===c?void 0:c,l=x(r,re);void 0===u?(n.items.push(s),u=n.items.indexOf(s)):n.items[u]=s;var p=a,d=((t={onMouseMove:L(o,(function(){u!==n.getState().highlightedIndex&&(n.setHighlightedIndex(u,{type:2}),n.avoidScrolling=!0,n.internalSetTimeout((function(){return n.avoidScrolling=!1}),250))})),onMouseDown:L(i,(function(e){e.preventDefault()}))}).onClick=L(p,(function(){n.selectItemAtIndex(u,{type:9})})),t),f=l.disabled?{onMouseDown:d.onMouseDown}:d;return _({id:n.getItemId(u),role:"option","aria-selected":n.getState().highlightedIndex===u},f,l)},n.clearItems=function(){n.items=[]},n.reset=function(e,t){void 0===e&&(e={}),e=q(e),n.internalSetState((function(t){var r=t.selectedItem;return _({isOpen:n.props.defaultIsOpen,highlightedIndex:n.props.defaultHighlightedIndex,inputValue:n.props.itemToString(r)},e)}),t)},n.toggleMenu=function(e,t){void 0===e&&(e={}),e=q(e),n.internalSetState((function(t){var r=t.isOpen;return _({isOpen:!r},r&&{highlightedIndex:n.props.defaultHighlightedIndex},e)}),(function(){var r=n.getState(),o=r.isOpen,i=r.highlightedIndex;o&&n.getItemCount()>0&&"number"==typeof i&&n.setHighlightedIndex(i,e),T(t)()}))},n.openMenu=function(e){n.internalSetState({isOpen:!0},e)},n.closeMenu=function(e){n.internalSetState({isOpen:!1},e)},n.updateStatus=N((function(){var e=n.getState(),t=n.items[e.highlightedIndex],r=n.getItemCount(),o=n.props.getA11yStatusMessage(_({itemToString:n.props.itemToString,previousResultCount:n.previousResultCount,resultCount:r,highlightedItem:t},e));n.previousResultCount=r,Q(o,n.props.environment.document)}),200);var r=n.props,o=r.defaultHighlightedIndex,i=r.initialHighlightedIndex,a=void 0===i?o:i,u=r.defaultIsOpen,c=r.initialIsOpen,s=void 0===c?u:c,l=r.initialInputValue,p=void 0===l?"":l,d=r.initialSelectedItem,f=void 0===d?null:d,m=n.getState({highlightedIndex:a,isOpen:s,inputValue:p,selectedItem:f});return null!=m.selectedItem&&void 0===n.props.initialInputValue&&(m.inputValue=n.props.itemToString(m.selectedItem)),n.state=m,n}n=e,(t=r).prototype=Object.create(n.prototype),t.prototype.constructor=t,j(t,n);var o=r.prototype;return o.internalClearTimeouts=function(){this.timeoutIds.forEach((function(e){clearTimeout(e)})),this.timeoutIds=[]},o.getState=function(e){return void 0===e&&(e=this.state),t=e,n=this.props,Object.keys(t).reduce((function(e,r){return e[r]=U(n,r)?n[r]:t[r],e}),{});var t,n},o.getItemCount=function(){var e=this.items.length;return null!=this.itemCount?e=this.itemCount:void 0!==this.props.itemCount&&(e=this.props.itemCount),e},o.getItemNodeFromIndex=function(e){return this.props.environment.document.getElementById(this.getItemId(e))},o.scrollHighlightedItemIntoView=function(){var e=this.getItemNodeFromIndex(this.getState().highlightedIndex);this.props.scrollIntoView(e,this._menuNode)},o.moveHighlightedIndex=function(e,t){var n=this,r=this.getItemCount(),o=this.getState().highlightedIndex;if(r>0){var i=W(e,o,r,(function(e){return n.getItemNodeFromIndex(e)}));this.setHighlightedIndex(i,t)}},o.getStateAndHelpers=function(){var e=this.getState(),t=e.highlightedIndex,n=e.inputValue,r=e.selectedItem,o=e.isOpen,i=this.props.itemToString,a=this.id,u=this.getRootProps,c=this.getToggleButtonProps,s=this.getLabelProps,l=this.getMenuProps,p=this.getInputProps,d=this.getItemProps,f=this.openMenu,m=this.closeMenu,b=this.toggleMenu,g=this.selectItem,h=this.selectItemAtIndex,v=this.selectHighlightedItem,y=this.setHighlightedIndex,O=this.clearSelection,w=this.clearItems;return{getRootProps:u,getToggleButtonProps:c,getLabelProps:s,getMenuProps:l,getInputProps:p,getItemProps:d,reset:this.reset,openMenu:f,closeMenu:m,toggleMenu:b,selectItem:g,selectItemAtIndex:h,selectHighlightedItem:v,setHighlightedIndex:y,clearSelection:O,clearItems:w,setItemCount:this.setItemCount,unsetItemCount:this.unsetItemCount,setState:this.internalSetState,itemToString:i,id:a,highlightedIndex:t,inputValue:n,isOpen:o,selectedItem:r}},o.componentDidMount=function(){var e=this,t=function(){e.isMouseDown=!0},n=function(t){e.isMouseDown=!1,!Y(t.target,[e._rootNode,e._menuNode],e.props.environment)&&e.getState().isOpen&&e.reset({type:1},(function(){return e.props.onOuterClick(e.getStateAndHelpers())}))},r=function(){e.isTouchMove=!1},o=function(){e.isTouchMove=!0},i=function(t){var n=Y(t.target,[e._rootNode,e._menuNode],e.props.environment,!1);e.isTouchMove||n||!e.getState().isOpen||e.reset({type:16},(function(){return e.props.onOuterClick(e.getStateAndHelpers())}))},a=this.props.environment;a.addEventListener("mousedown",t),a.addEventListener("mouseup",n),a.addEventListener("touchstart",r),a.addEventListener("touchmove",o),a.addEventListener("touchend",i),this.cleanup=function(){e.internalClearTimeouts(),e.updateStatus.cancel(),a.removeEventListener("mousedown",t),a.removeEventListener("mouseup",n),a.removeEventListener("touchstart",r),a.removeEventListener("touchmove",o),a.removeEventListener("touchend",i)}},o.shouldScroll=function(e,t){var n=(void 0===this.props.highlightedIndex?this.getState():this.props).highlightedIndex,r=(void 0===t.highlightedIndex?e:t).highlightedIndex;return n&&this.getState().isOpen&&!e.isOpen||n!==r},o.componentDidUpdate=function(e,t){U(this.props,"selectedItem")&&this.props.selectedItemChanged(e.selectedItem,this.props.selectedItem)&&this.internalSetState({type:15,inputValue:this.props.itemToString(this.props.selectedItem)}),!this.avoidScrolling&&this.shouldScroll(t,e)&&this.scrollHighlightedItemIntoView(),this.updateStatus()},o.componentWillUnmount=function(){this.cleanup()},o.render=function(){var e=K(this.props.children,D);this.clearItems(),this.getRootProps.called=!1,this.getRootProps.refKey=void 0,this.getRootProps.suppressRefError=void 0,this.getMenuProps.called=!1,this.getMenuProps.refKey=void 0,this.getMenuProps.suppressRefError=void 0,this.getLabelProps.called=!1,this.getInputProps.called=!1;var t=K(e(this.getStateAndHelpers()));return t?this.getRootProps.called||this.props.suppressRefError?t:function(e){return"string"==typeof e.type}(t)?Object(I.cloneElement)(t,this.getRootProps(function(e){return e.props}(t))):void 0:null},r}(I.Component);return e.defaultProps={defaultHighlightedIndex:null,defaultIsOpen:!1,getA11yStatusMessage:V,itemToString:function(e){return null==e?"":String(e)},onStateChange:D,onInputValueChange:D,onUserAction:D,onChange:D,onSelect:D,onOuterClick:D,selectedItemChanged:function(e,t){return e!==t},environment:"undefined"==typeof window?{}:window,stateReducer:function(e,t){return t},suppressRefError:!1,scrollIntoView:A},e.stateChangeTypes=J,e}();N((function(e,t){Q(e(),t)}),200),"undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?I.useLayoutEffect:I.useEffect;var ie={itemToString:function(e){return e?String(e):""},stateReducer:function(e,t){return t.changes},getA11ySelectionMessage:function(e){var t=e.selectedItem,n=e.itemToString;return t?n(t)+" has been selected.":""},scrollIntoView:A,circularNavigation:!1,environment:"undefined"==typeof window?{}:window};y.a.array.isRequired,y.a.func,y.a.func,y.a.func,y.a.bool,y.a.number,y.a.number,y.a.number,y.a.bool,y.a.bool,y.a.bool,y.a.any,y.a.any,y.a.any,y.a.string,y.a.string,y.a.string,y.a.func,y.a.string,y.a.func,y.a.func,y.a.func,y.a.func,y.a.func,y.a.shape({addEventListener:y.a.func,removeEventListener:y.a.func,document:y.a.shape({getElementById:y.a.func,activeElement:y.a.any,body:y.a.any})}),C(C({},ie),{getA11yStatusMessage:function(e){var t=e.isOpen,n=e.resultCount,r=e.previousResultCount;return t?n?n!==r?n+" result"+(1===n?" is":"s are")+" available, use up and down arrow keys to navigate. Press Enter or Space Bar keys to select.":"":"No results are available.":""}}),y.a.array.isRequired,y.a.func,y.a.func,y.a.func,y.a.bool,y.a.number,y.a.number,y.a.number,y.a.bool,y.a.bool,y.a.bool,y.a.any,y.a.any,y.a.any,y.a.string,y.a.string,y.a.string,y.a.string,y.a.string,y.a.string,y.a.func,y.a.string,y.a.string,y.a.func,y.a.func,y.a.func,y.a.func,y.a.func,y.a.func,y.a.shape({addEventListener:y.a.func,removeEventListener:y.a.func,document:y.a.shape({getElementById:y.a.func,activeElement:y.a.any,body:y.a.any})}),_({},ie,{getA11yStatusMessage:V,circularNavigation:!0}),y.a.array,y.a.array,y.a.array,y.a.func,y.a.func,y.a.func,y.a.number,y.a.number,y.a.number,y.a.func,y.a.func,y.a.string,y.a.string,y.a.shape({addEventListener:y.a.func,removeEventListener:y.a.func,document:y.a.shape({getElementById:y.a.func,activeElement:y.a.any,body:y.a.any})});var ae=function(e){var t=e.checked,n=e.getInputProps,r=e.inputRef,o=e.isDisabled,i=e.onFocus,a=e.onRemoveItem,u=e.placeholder,c=e.tabIndex,s=e.value;return React.createElement("input",n({ref:r,className:"wc-block-dropdown-selector__input wc-block-components-dropdown-selector__input",disabled:o,onFocus:i,onKeyDown:function(e){"Backspace"===e.key&&!s&&t.length>0&&a(t[t.length-1])},placeholder:u,tabIndex:c}))},ue=function(e){var t=e.children,n=e.onClick;return React.createElement("div",{className:"wc-block-dropdown-selector__input-wrapper wc-block-components-dropdown-selector__input-wrapper",onClick:n},t)},ce=function(e){var t=e.checked,n=e.getItemProps,r=e.getMenuProps,o=e.highlightedIndex,i=e.options;return React.createElement("ul",r({className:"wc-block-dropdown-selector__list wc-block-components-dropdown-selector__list"}),i.map((function(e,r){var i=t.includes(e.value);return React.createElement("li",n({key:e.value,className:w()("wc-block-dropdown-selector__list-item","wc-block-components-dropdown-selector__list-item",{"is-selected":i,"is-highlighted":o===r}),index:r,item:e.value,"aria-label":i?Object(s.sprintf)(
/* translators: %s is referring to the filter option being removed. */
Object(s.__)("Remove %s filter",'woocommerce'),e.name):null}),e.label)})))},se=n(194),le=function(e){var t=e.onRemoveItem,n=e.option;return React.createElement(se.a,{className:"wc-block-dropdown-selector__selected-chip wc-block-components-dropdown-selector__selected-chip",removeOnAnyClick:!0,onRemove:function(){t(n.value)},ariaLabel:Object(s.sprintf)(
/* translators: %s is referring to the filter option being removed. */
Object(s.__)("Remove %s filter",'woocommerce'),n.name),text:n.label,radius:"large"})},pe=n(152),de=n(216),fe=function(e){var t=e.onClick,n=e.onRemoveItem,r=e.option,o=Object(g.useRef)(null);return Object(g.useEffect)((function(){o.current.focus()}),[o]),React.createElement("div",{className:"wc-block-dropdown-selector__selected-value wc-block-components-dropdown-selector__selected-value"},React.createElement("button",{ref:o,className:"wc-block-dropdown-selector__selected-value__label wc-block-components-dropdown-selector__selected-value__label",onClick:function(e){e.stopPropagation(),t(r.value)},"aria-label":Object(s.sprintf)(
/* translators: %s attribute value used in the filter. For example: yellow, green, small, large. */
Object(s.__)("Replace current %s filter",'woocommerce'),r.name)},r.label),React.createElement("button",{className:"wc-block-dropdown-selector__selected-value__remove wc-block-components-dropdown-selector__selected-value__remove",onClick:function(){n(r.value)},onKeyDown:function(e){"Backspace"!==e.key&&"Delete"!==e.key||n(r.value)},"aria-label":Object(s.sprintf)(
/* translators: %s attribute value used in the filter. For example: yellow, green, small, large. */
Object(s.__)("Remove %s filter",'woocommerce'),r.name)},React.createElement(pe.a,{srcElement:de.a,size:16})))};function me(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function be(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?me(Object(n),!0).forEach((function(t){a()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):me(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}n(292);var ge=function(e){var t=e.attributeLabel,n=void 0===t?"":t,r=e.className,o=e.checked,i=void 0===o?[]:o,a=e.inputLabel,u=void 0===a?"":a,c=e.isDisabled,l=void 0!==c&&c,p=e.isLoading,d=void 0!==p&&p,f=e.multiple,m=void 0!==f&&f,b=e.onChange,h=void 0===b?function(){}:b,v=e.options,y=void 0===v?[]:v,O=Object(g.useRef)(null),x=w()(r,"wc-block-dropdown-selector","wc-block-components-dropdown-selector",{"is-disabled":l,"is-loading":d}),_=Object(g.useCallback)((function(e,t){switch(t.type){case oe.stateChangeTypes.keyDownEnter:case oe.stateChangeTypes.clickItem:return be(be({},t),{},{highlightedIndex:e.highlightedIndex,isOpen:m,inputValue:""});case oe.stateChangeTypes.blurInput:case oe.stateChangeTypes.mouseUp:return be(be({},t),{},{inputValue:e.inputValue});default:return t}}),[m]);return React.createElement(oe,{onChange:h,selectedItem:null,stateReducer:_},(function(e){var t=e.getInputProps,r=e.getItemProps,o=e.getLabelProps,a=e.getMenuProps,c=e.highlightedIndex,p=e.inputValue,d=e.isOpen,f=e.openMenu;return React.createElement("div",{className:w()(x,{"is-multiple":m,"is-single":!m,"has-checked":i.length>0,"is-open":d})},React.createElement("label",o({className:"screen-reader-text"}),u),React.createElement(ue,{isOpen:d,onClick:function(){return O.current.focus()}},i.map((function(e){var t=y.find((function(t){return t.value===e})),n=function(e){h(e),O.current.focus()};return m?React.createElement(le,{key:e,onRemoveItem:n,option:t}):React.createElement(fe,{key:e,onClick:function(){return O.current.focus()},onRemoveItem:n,option:t})})),React.createElement(ae,{checked:i,getInputProps:t,inputRef:O,isDisabled:l,onFocus:f,onRemoveItem:function(e){h(e),O.current.focus()},placeholder:i.length>0&&m?null:Object(s.sprintf)(
/* translators: %s attribute name. */
Object(s.__)("Any %s",'woocommerce'),n),tabIndex:!m&&i.length>0?"-1":"0",value:p})),d&&!l&&React.createElement(ce,{checked:i,getItemProps:r,getMenuProps:a,highlightedIndex:c,options:y.filter((function(e){return!p||e.value.startsWith(p)}))}))}))},he=n(108),ve=n(133),ye=n(25),Oe=n.n(ye),we=n(28),xe=n(169),_e=n(170),Ee=[{value:"preview-1",name:"Blue",label:React.createElement(he.a,{name:"Blue",count:3})},{value:"preview-2",name:"Green",label:React.createElement(he.a,{name:"Green",count:3})},{value:"preview-3",name:"Red",label:React.createElement(he.a,{name:"Red",count:2})}],je={id:0,name:"preview",taxonomy:"preview",label:"Preview"};function Ie(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Se(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ie(Object(n),!0).forEach((function(t){a()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ie(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}n(291);Object(o.a)({selector:".wp-block-woocommerce-attribute-filter",Block:Object(r.a)((function(e){var t=e.attributes,n=e.isEditor,r=void 0!==n&&n,o=t.isPreview&&!t.attributeId?je:Object(xe.a)(t.attributeId),i=Object(g.useState)([]),a=c()(i,2),u=a[0],v=a[1],y=Object(g.useState)(t.isPreview&&!t.attributeId?Ee:[]),O=c()(y,2),w=O[0],x=O[1],_=Object(f.a)(),E=c()(_,1)[0],j=Object(f.b)("attributes",[]),I=c()(j,2),S=I[0],k=I[1],R=Object(m.a)({namespace:"/wc/store",resourceName:"products/attributes/terms",resourceValues:[o.id],shouldSelect:t.attributeId>0}),P=R.results,C=R.isLoading,M="dropdown"!==t.displayStyle&&"and"===t.queryType,T=Object(b.a)({queryAttribute:{taxonomy:o.taxonomy,queryType:t.queryType},queryState:Se(Se({},E),{},{attributes:M?E.attributes:null})}),D=T.results,A=T.isLoading,H=Object(g.useCallback)((function(e){return D.attribute_counts?D.attribute_counts.find((function(t){return t.term===e})):null}),[D]);Object(g.useEffect)((function(){if(!C&&!A){var e=P.map((function(e){var n,r=H(e.id);if(!(r||u.includes(e.slug)||(n=e.slug,null!=E&&E.attributes&&E.attributes.some((function(e){var t=e.attribute,r=e.slug,i=void 0===r?[]:r;return t===o.taxonomy&&i.includes(n)})))))return null;var i=r?r.count:0;return{value:e.slug,name:Object(we.decodeEntities)(e.name),label:React.createElement(he.a,{name:Object(we.decodeEntities)(e.name),count:t.showCounts?i:null})}})).filter(Boolean);x(e)}}),[o.taxonomy,P,C,t.showCounts,A,H,u,E.attributes]);var N=Object(g.useMemo)((function(){return S.filter((function(e){return e.attribute===o.taxonomy})).flatMap((function(e){return e.slug}))}),[S,o.taxonomy]),L=Object(p.a)(N),B=Object(d.a)(L);Object(g.useEffect)((function(){Oe()(B,L)||Oe()(u,L)||(v(L),t.showFilterButton||K(L))}),[u,L,B,K,t.showFilterButton]);var V=Object(g.useCallback)((function(e){return P.reduce((function(t,n){return e.includes(n.slug)&&t.push(n),t}),[])}),[P]),K=Object(g.useCallback)((function(e){r||Object(_e.b)(S,k,o,V(e),"or"===t.queryType?"in":"and")}),[r,S,k,o,V,t.queryType]),F="dropdown"!==t.displayStyle||"or"===t.queryType,q=Object(g.useCallback)((function(e){var n,r=function(e){return w.find((function(t){return t.value===e})).name},o=function(e){var t=e.filterAdded,n=e.filterRemoved,o=t?r(t):null,i=n?r(n):null;o&&i?Object(l.speak)(Object(s.sprintf)(
/* translators: %1$s and %2$s are attribute terms (for example: 'red', 'blue', 'large'...). */
Object(s.__)("%1$s filter replaced with %2$s.",'woocommerce'),o,i)):o?Object(l.speak)(Object(s.sprintf)(
/* translators: %s attribute term (for example: 'red', 'blue', 'large'...) */
Object(s.__)("%s filter added.",'woocommerce'),o)):i&&Object(l.speak)(Object(s.sprintf)(
/* translators: %s attribute term (for example: 'red', 'blue', 'large'...) */
Object(s.__)("%s filter removed.",'woocommerce'),i))},i=u.includes(e);F?(n=u.filter((function(t){return t!==e})),i?o({filterRemoved:e}):(n.push(e),n.sort(),o({filterAdded:e}))):(n=i?[]:[e],o({filterAdded:i?null:e,filterRemoved:1===u.length?u[0]:null})),v(n),t.showFilterButton||K(n)}),[u,w,F,K,t.showFilterButton]);if(0===w.length&&!C)return null;var U="h".concat(t.headingLevel),$=!t.isPreview&&C,W=!t.isPreview&&A;return React.createElement(React.Fragment,null,!r&&t.heading&&React.createElement(U,{className:"wc-block-attribute-filter__title"},t.heading),React.createElement("div",{className:"wc-block-attribute-filter style-".concat(t.displayStyle)},"dropdown"===t.displayStyle?React.createElement(ge,{attributeLabel:o.label,checked:u,className:"wc-block-attribute-filter-dropdown",inputLabel:t.heading,isLoading:$,multiple:F,onChange:q,options:w}):React.createElement(h.a,{className:"wc-block-attribute-filter-list",options:w,checked:u,onChange:q,isLoading:$,isDisabled:W}),t.showFilterButton&&React.createElement(ve.a,{className:"wc-block-attribute-filter__button",disabled:$||W,onClick:function(){return K(u)}})))})),getProps:function(e){return{attributes:{attributeId:parseInt(e.dataset.attributeId||0,10),showCounts:"true"===e.dataset.showCounts,queryType:e.dataset.queryType,heading:e.dataset.heading,headingLevel:e.dataset.headingLevel||3,displayStyle:e.dataset.displayStyle,showFilterButton:"true"===e.dataset.showFilterButton}}}})},33:function(e,t){e.exports=window.wp.a11y},34:function(e,t){e.exports=window.wp.primitives},4:function(e,t){e.exports=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e},e.exports.default=e.exports,e.exports.__esModule=!0},40:function(e,t){e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},e.exports.default=e.exports,e.exports.__esModule=!0},41:function(e,t){function n(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}e.exports=function(e,t,r){return t&&n(e.prototype,t),r&&n(e,r),e},e.exports.default=e.exports,e.exports.__esModule=!0},42:function(e,t,n){var r=n(71);e.exports=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&r(e,t)},e.exports.default=e.exports,e.exports.__esModule=!0},43:function(e,t,n){var r=n(21).default,o=n(29);e.exports=function(e,t){return!t||"object"!==r(t)&&"function"!=typeof t?o(e):t},e.exports.default=e.exports,e.exports.__esModule=!0},44:function(e,t,n){"use strict";var r=n(40),o=n.n(r),i=n(41),a=n.n(i),u=n(29),c=n.n(u),s=n(42),l=n.n(s),p=n(43),d=n.n(p),f=n(30),m=n.n(f),b=n(4),g=n.n(b),h=(n(10),n(3)),v=n(1),y=n(83),O=function(e){var t=e.imageUrl,n=void 0===t?"".concat(y.l,"/block-error.svg"):t,r=e.header,o=void 0===r?Object(v.__)("Oops!",'woocommerce'):r,i=e.text,a=void 0===i?Object(v.__)("There was an error loading the content.",'woocommerce'):i,u=e.errorMessage,c=e.errorMessagePrefix,s=void 0===c?Object(v.__)("Error:",'woocommerce'):c,l=e.button;return React.createElement("div",{className:"wc-block-error wc-block-components-error"},n&&React.createElement("img",{className:"wc-block-error__image wc-block-components-error__image",src:n,alt:""}),React.createElement("div",{className:"wc-block-error__content wc-block-components-error__content"},o&&React.createElement("p",{className:"wc-block-error__header wc-block-components-error__header"},o),a&&React.createElement("p",{className:"wc-block-error__text wc-block-components-error__text"},a),u&&React.createElement("p",{className:"wc-block-error__message wc-block-components-error__message"},s?s+" ":"",u),l&&React.createElement("p",{className:"wc-block-error__button wc-block-components-error__button"},l)))};n(81);var w=function(e){l()(i,e);var t,n,r=(t=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=m()(t);if(n){var o=m()(this).constructor;e=Reflect.construct(r,arguments,o)}else e=r.apply(this,arguments);return d()(this,e)});function i(){var e;o()(this,i);for(var t=arguments.length,n=new Array(t),a=0;a<t;a++)n[a]=arguments[a];return e=r.call.apply(r,[this].concat(n)),g()(c()(e),"state",{errorMessage:"",hasError:!1}),e}return a()(i,[{key:"render",value:function(){var e=this.props,t=e.header,n=e.imageUrl,r=e.showErrorMessage,o=e.text,i=e.errorMessagePrefix,a=e.renderError,u=e.button,c=this.state,s=c.errorMessage;return c.hasError?"function"==typeof a?a({errorMessage:s}):React.createElement(O,{errorMessage:r?s:null,header:t,imageUrl:n,text:o,errorMessagePrefix:i,button:u}):this.props.children}}],[{key:"getDerivedStateFromError",value:function(e){return void 0!==e.statusText&&void 0!==e.status?{errorMessage:React.createElement(React.Fragment,null,React.createElement("strong",null,e.status),": ",e.statusText),hasError:!0}:{errorMessage:e.message,hasError:!0}}}]),i}(h.Component);w.defaultProps={showErrorMessage:!0},t.a=w},46:function(e,t,n){var r=n(94),o=n(95),i=n(67),a=n(96);e.exports=function(e){return r(e)||o(e)||i(e)||a()},e.exports.default=e.exports,e.exports.__esModule=!0},5:function(e,t,n){var r=n(84),o=n(85),i=n(67),a=n(86);e.exports=function(e,t){return r(e)||o(e,t)||i(e,t)||a()},e.exports.default=e.exports,e.exports.__esModule=!0},51:function(e,t,n){"use strict";var r=n(4),o=n.n(r),i=n(0),a=n(6),u=n.n(a);function c(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function s(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?c(Object(n),!0).forEach((function(t){o()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):c(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}t.a=function(e){var t,n=e.label,r=e.screenReaderLabel,o=e.wrapperElement,a=e.wrapperProps,c=void 0===a?{}:a,l=null!=n,p=null!=r;return!l&&p?(t=o||"span",c=s(s({},c),{},{className:u()(c.className,"screen-reader-text")}),React.createElement(t,c,r)):(t=o||i.Fragment,l&&p&&n!==r?React.createElement(t,c,React.createElement("span",{"aria-hidden":"true"},n),React.createElement("span",{className:"screen-reader-text"},r)):React.createElement(t,c,n))}},53:function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var r=n(0),o=n(25),i=n.n(o);function a(e){var t=Object(r.useRef)(e);return i()(e,t.current)||(t.current=e),t.current}},6:function(e,t,n){var r;!function(){"use strict";var n={}.hasOwnProperty;function o(){for(var e=[],t=0;t<arguments.length;t++){var r=arguments[t];if(r){var i=typeof r;if("string"===i||"number"===i)e.push(r);else if(Array.isArray(r)){if(r.length){var a=o.apply(null,r);a&&e.push(a)}}else if("object"===i)if(r.toString===Object.prototype.toString)for(var u in r)n.call(r,u)&&r[u]&&e.push(u);else e.push(r.toString())}}return e.join(" ")}e.exports?(o.default=o,e.exports=o):void 0===(r=function(){return o}.apply(t,[]))||(e.exports=r)}()},64:function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(0),o=Object(r.createContext)("page"),i=function(){return Object(r.useContext)(o)};o.Provider},67:function(e,t,n){var r=n(68);e.exports=function(e,t){if(e){if("string"==typeof e)return r(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(e,t):void 0}},e.exports.default=e.exports,e.exports.__esModule=!0},68:function(e,t){e.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r},e.exports.default=e.exports,e.exports.__esModule=!0},7:function(e,t){e.exports=window.lodash},71:function(e,t){function n(t,r){return e.exports=n=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},e.exports.default=e.exports,e.exports.__esModule=!0,n(t,r)}e.exports=n,e.exports.default=e.exports,e.exports.__esModule=!0},77:function(e,t){e.exports=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o},e.exports.default=e.exports,e.exports.__esModule=!0},79:function(e,t,n){"use strict";var r=n(80);function o(){}function i(){}i.resetWarningCache=o,e.exports=function(){function e(e,t,n,o,i,a){if(a!==r){var u=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw u.name="Invariant Violation",u}}function t(){return e}e.isRequired=e;var n={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:i,resetWarningCache:o};return n.PropTypes=n,n}},8:function(e,t){e.exports=window.wc.wcBlocksData},80:function(e,t,n){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},81:function(e,t){},82:function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(3);function o(e,t,n){void 0===n&&(n={});var o=n.maxWait,i=Object(r.useRef)(null),a=Object(r.useRef)([]),u=n.leading,c=void 0===n.trailing||n.trailing,s=Object(r.useRef)(!1),l=Object(r.useRef)(null),p=Object(r.useRef)(!1),d=Object(r.useRef)(e);d.current=e;var f=Object(r.useCallback)((function(){clearTimeout(l.current),clearTimeout(i.current),i.current=null,a.current=[],l.current=null,s.current=!1}),[]);Object(r.useEffect)((function(){return p.current=!1,function(){p.current=!0}}),[]);var m=Object(r.useCallback)((function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];a.current=e,clearTimeout(l.current),s.current&&(s.current=!1),l.current||!u||s.current||(d.current.apply(d,e),s.current=!0),l.current=setTimeout((function(){var t=!0;u&&s.current&&(t=!1),f(),!p.current&&c&&t&&d.current.apply(d,e)}),t),o&&!i.current&&c&&(i.current=setTimeout((function(){var e=a.current;f(),p.current||d.current.apply(null,e)}),o))}),[o,t,f,u,c]),b=Object(r.useCallback)((function(){l.current&&(d.current.apply(null,a.current),f())}),[f]);return[m,f,b]}},83:function(e,t,n){"use strict";n.d(t,"n",(function(){return i})),n.d(t,"l",(function(){return a})),n.d(t,"k",(function(){return u})),n.d(t,"m",(function(){return c})),n.d(t,"i",(function(){return s})),n.d(t,"d",(function(){return l})),n.d(t,"f",(function(){return p})),n.d(t,"j",(function(){return d})),n.d(t,"c",(function(){return f})),n.d(t,"e",(function(){return m})),n.d(t,"g",(function(){return b})),n.d(t,"a",(function(){return g})),n.d(t,"h",(function(){return h})),n.d(t,"b",(function(){return v}));var r,o=n(2),i=Object(o.getSetting)("wcBlocksConfig",{buildPhase:1,pluginUrl:"",productCount:0,defaultAvatar:"",restApiRoutes:{},wordCountType:"words"}),a=i.pluginUrl+"images/",u=i.pluginUrl+"build/",c=i.buildPhase,s=null===(r=o.STORE_PAGES.shop)||void 0===r?void 0:r.permalink,l=(o.STORE_PAGES.checkout.id,o.STORE_PAGES.checkout.permalink),p=o.STORE_PAGES.privacy.permalink,d=(o.STORE_PAGES.privacy.title,o.STORE_PAGES.terms.permalink),f=(o.STORE_PAGES.terms.title,o.STORE_PAGES.cart.id,o.STORE_PAGES.cart.permalink),m=o.STORE_PAGES.myaccount.permalink?o.STORE_PAGES.myaccount.permalink:Object(o.getSetting)("wpLoginUrl","/wp-login.php"),b=Object(o.getSetting)("shippingCountries",{}),g=Object(o.getSetting)("allowedCountries",{}),h=Object(o.getSetting)("shippingStates",{}),v=Object(o.getSetting)("allowedStates",{})},84:function(e,t){e.exports=function(e){if(Array.isArray(e))return e},e.exports.default=e.exports,e.exports.__esModule=!0},85:function(e,t){e.exports=function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],_n=!0,a=!1;try{for(n=n.call(e);!(_n=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);_n=!0);}catch(e){a=!0,o=e}finally{try{_n||null==n.return||n.return()}finally{if(a)throw o}}return i}},e.exports.default=e.exports,e.exports.__esModule=!0},86:function(e,t){e.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},e.exports.default=e.exports,e.exports.__esModule=!0},90:function(e,t,n){"use strict";n.d(t,"a",(function(){return f})),n.d(t,"b",(function(){return m})),n.d(t,"c",(function(){return b}));var r=n(5),o=n.n(r),i=n(8),a=n(11),u=n(0),c=n(25),s=n.n(c),l=n(53),p=n(99),d=n(64),f=function(e){var t=Object(d.a)();e=e||t;var n=Object(a.useSelect)((function(t){return t(i.QUERY_STATE_STORE_KEY).getValueForQueryContext(e,void 0)}),[e]),r=Object(a.useDispatch)(i.QUERY_STATE_STORE_KEY).setValueForQueryContext;return[n,Object(u.useCallback)((function(t){r(e,t)}),[e,r])]},m=function(e,t,n){var r=Object(d.a)();n=n||r;var o=Object(a.useSelect)((function(r){return r(i.QUERY_STATE_STORE_KEY).getValueForQueryKey(n,e,t)}),[n,e]),c=Object(a.useDispatch)(i.QUERY_STATE_STORE_KEY).setQueryValue;return[o,Object(u.useCallback)((function(t){c(n,e,t)}),[n,e,c])]},b=function(e,t){var n=Object(d.a)(),r=f(t=t||n),i=o()(r,2),a=i[0],c=i[1],m=Object(l.a)(a),b=Object(l.a)(e),g=Object(p.a)(b),h=Object(u.useRef)(!1);return Object(u.useEffect)((function(){s()(g,b)||(c(Object.assign({},m,b)),h.current=!0)}),[m,b,g,c]),h.current?[a,c]:[e,c]}},94:function(e,t,n){var r=n(68);e.exports=function(e){if(Array.isArray(e))return r(e)},e.exports.default=e.exports,e.exports.__esModule=!0},95:function(e,t){e.exports=function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)},e.exports.default=e.exports,e.exports.__esModule=!0},96:function(e,t){e.exports=function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},e.exports.default=e.exports,e.exports.__esModule=!0},99:function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(3);function o(e,t){var n=Object(r.useRef)();return Object(r.useEffect)((function(){n.current===e||t&&!t(e,n.current)||(n.current=e)}),[e,t]),n.current}}});woocommerce-blocks/build/product-tag.js000064400000067357151335517640014260 0ustar00this.wc=this.wc||{},this.wc.blocks=this.wc.blocks||{},this.wc.blocks["product-tag"]=function(e){function t(t){for(var n,i,l=t[0],a=t[1],u=t[2],b=0,d=[];b<l.length;b++)i=l[b],Object.prototype.hasOwnProperty.call(c,i)&&c[i]&&d.push(c[i][0]),c[i]=0;for(n in a)Object.prototype.hasOwnProperty.call(a,n)&&(e[n]=a[n]);for(s&&s(t);d.length;)d.shift()();return o.push.apply(o,u||[]),r()}function r(){for(var e,t=0;t<o.length;t++){for(var r=o[t],n=!0,l=1;l<r.length;l++){var a=r[l];0!==c[a]&&(n=!1)}n&&(o.splice(t--,1),e=i(i.s=r[0]))}return e}var n={},c={34:0},o=[];function i(t){if(n[t])return n[t].exports;var r=n[t]={i:t,l:!1,exports:{}};return e[t].call(r.exports,r,r.exports,i),r.l=!0,r.exports}i.m=e,i.c=n,i.d=function(e,t,r){i.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},i.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.t=function(e,t){if(1&t&&(e=i(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(i.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)i.d(r,n,function(t){return e[t]}.bind(null,n));return r},i.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(t,"a",t),t},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.p="";var l=window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[],a=l.push.bind(l);l.push=t,l=l.slice();for(var u=0;u<l.length;u++)t(l[u]);var s=a;return o.push([779,0]),r()}({0:function(e,t){e.exports=window.wp.element},1:function(e,t){e.exports=window.wp.i18n},11:function(e,t){e.exports=window.React},12:function(e,t){e.exports=window.wp.blockEditor},121:function(e,t){},122:function(e,t){e.exports=window.wp.coreData},130:function(e,t,r){"use strict";var n=r(0),c=r(1),o=r(4);r(2),t.a=function(e){var t=e.value,r=e.setAttributes;return Object(n.createElement)(o.SelectControl,{label:Object(c.__)("Order products by",'woocommerce'),value:t,options:[{label:Object(c.__)("Newness - newest first",'woocommerce'),value:"date"},{label:Object(c.__)("Price - low to high",'woocommerce'),value:"price_asc"},{label:Object(c.__)("Price - high to low",'woocommerce'),value:"price_desc"},{label:Object(c.__)("Rating - highest first",'woocommerce'),value:"rating"},{label:Object(c.__)("Sales - most first",'woocommerce'),value:"popularity"},{label:Object(c.__)("Title - alphabetical",'woocommerce'),value:"title"},{label:Object(c.__)("Menu Order",'woocommerce'),value:"menu_order"}],onChange:function(e){return r({orderby:e})}})}},14:function(e,t){e.exports=window.wp.data},15:function(e,t){e.exports=window.wp.apiFetch},188:function(e,t,r){"use strict";r.d(t,"a",(function(){return c}));var n=r(0),c=Object(n.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 230 250",style:{width:"100%"}},Object(n.createElement)("title",null,"Grid Block Preview"),Object(n.createElement)("rect",{width:"65.374",height:"65.374",x:".162",y:".779",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"47.266",height:"5.148",x:"9.216",y:"76.153",fill:"#E1E3E6",rx:"2.574"}),Object(n.createElement)("rect",{width:"62.8",height:"15",x:"1.565",y:"101.448",fill:"#E1E3E6",rx:"5"}),Object(n.createElement)("rect",{width:"65.374",height:"65.374",x:".162",y:"136.277",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"47.266",height:"5.148",x:"9.216",y:"211.651",fill:"#E1E3E6",rx:"2.574"}),Object(n.createElement)("rect",{width:"62.8",height:"15",x:"1.565",y:"236.946",fill:"#E1E3E6",rx:"5"}),Object(n.createElement)("rect",{width:"65.374",height:"65.374",x:"82.478",y:".779",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"47.266",height:"5.148",x:"91.532",y:"76.153",fill:"#E1E3E6",rx:"2.574"}),Object(n.createElement)("rect",{width:"62.8",height:"15",x:"83.882",y:"101.448",fill:"#E1E3E6",rx:"5"}),Object(n.createElement)("rect",{width:"65.374",height:"65.374",x:"82.478",y:"136.277",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"47.266",height:"5.148",x:"91.532",y:"211.651",fill:"#E1E3E6",rx:"2.574"}),Object(n.createElement)("rect",{width:"62.8",height:"15",x:"83.882",y:"236.946",fill:"#E1E3E6",rx:"5"}),Object(n.createElement)("rect",{width:"65.374",height:"65.374",x:"164.788",y:".779",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"47.266",height:"5.148",x:"173.843",y:"76.153",fill:"#E1E3E6",rx:"2.574"}),Object(n.createElement)("rect",{width:"62.8",height:"15",x:"166.192",y:"101.448",fill:"#E1E3E6",rx:"5"}),Object(n.createElement)("rect",{width:"65.374",height:"65.374",x:"164.788",y:"136.277",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"47.266",height:"5.148",x:"173.843",y:"211.651",fill:"#E1E3E6",rx:"2.574"}),Object(n.createElement)("rect",{width:"62.8",height:"15",x:"166.192",y:"236.946",fill:"#E1E3E6",rx:"5"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"13.283",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"21.498",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"29.713",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"37.927",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"46.238",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"95.599",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"103.814",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"112.029",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"120.243",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"128.554",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"177.909",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"186.124",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"194.339",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"202.553",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"210.864",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"13.283",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"21.498",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"29.713",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"37.927",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"46.238",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"95.599",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"103.814",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"112.029",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"120.243",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"128.554",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"177.909",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"186.124",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"194.339",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"202.553",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"210.864",y:"221.798",fill:"#E1E3E6",rx:"3"}))},21:function(e,t){e.exports=window.wp.compose},22:function(e,t){e.exports=window.regeneratorRuntime},23:function(e,t){e.exports=window.wp.url},25:function(e,t){e.exports=window.wp.htmlEntities},26:function(e,t){e.exports=window.wp.blocks},28:function(e,t){e.exports=window.wp.primitives},3:function(e,t){e.exports=window.wc.wcSettings},31:function(e,t){e.exports=window.moment},36:function(e,t){e.exports=window.wp.dataControls},37:function(e,t,r){"use strict";r.d(t,"o",(function(){return o})),r.d(t,"m",(function(){return i})),r.d(t,"l",(function(){return l})),r.d(t,"n",(function(){return a})),r.d(t,"j",(function(){return u})),r.d(t,"e",(function(){return s})),r.d(t,"f",(function(){return b})),r.d(t,"g",(function(){return d})),r.d(t,"k",(function(){return g})),r.d(t,"c",(function(){return p})),r.d(t,"d",(function(){return h})),r.d(t,"h",(function(){return f})),r.d(t,"a",(function(){return E})),r.d(t,"i",(function(){return w})),r.d(t,"b",(function(){return O}));var n,c=r(3),o=Object(c.getSetting)("wcBlocksConfig",{buildPhase:1,pluginUrl:"",productCount:0,defaultAvatar:"",restApiRoutes:{},wordCountType:"words"}),i=o.pluginUrl+"images/",l=o.pluginUrl+"build/",a=o.buildPhase,u=null===(n=c.STORE_PAGES.shop)||void 0===n?void 0:n.permalink,s=c.STORE_PAGES.checkout.id,b=c.STORE_PAGES.checkout.permalink,d=c.STORE_PAGES.privacy.permalink,g=(c.STORE_PAGES.privacy.title,c.STORE_PAGES.terms.permalink),p=(c.STORE_PAGES.terms.title,c.STORE_PAGES.cart.id),h=c.STORE_PAGES.cart.permalink,f=(c.STORE_PAGES.myaccount.permalink?c.STORE_PAGES.myaccount.permalink:Object(c.getSetting)("wpLoginUrl","/wp-login.php"),Object(c.getSetting)("shippingCountries",{})),E=Object(c.getSetting)("allowedCountries",{}),w=Object(c.getSetting)("shippingStates",{}),O=Object(c.getSetting)("allowedStates",{})},39:function(e,t,r){"use strict";r.d(t,"h",(function(){return g})),r.d(t,"e",(function(){return p})),r.d(t,"b",(function(){return h})),r.d(t,"i",(function(){return f})),r.d(t,"f",(function(){return E})),r.d(t,"c",(function(){return w})),r.d(t,"d",(function(){return O})),r.d(t,"g",(function(){return m})),r.d(t,"a",(function(){return j}));var n=r(5),c=r.n(n),o=r(23),i=r(15),l=r.n(i),a=r(7),u=r(3),s=r(37);function b(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function d(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?b(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):b(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var g=function(e){var t=e.selected,r=void 0===t?[]:t,n=e.search,c=void 0===n?"":n,i=e.queryArgs,u=function(e){var t=e.selected,r=void 0===t?[]:t,n=e.search,c=void 0===n?"":n,i=e.queryArgs,l=void 0===i?{}:i,a=s.o.productCount>100,u={per_page:a?100:0,catalog_visibility:"any",search:c,orderby:"title",order:"asc"},b=[Object(o.addQueryArgs)("/wc/store/products",d(d({},u),l))];return a&&r.length&&b.push(Object(o.addQueryArgs)("/wc/store/products",{catalog_visibility:"any",include:r,per_page:0})),b}({selected:r,search:c,queryArgs:void 0===i?{}:i});return Promise.all(u.map((function(e){return l()({path:e})}))).then((function(e){return Object(a.uniqBy)(Object(a.flatten)(e),"id").map((function(e){return d(d({},e),{},{parent:0})}))})).catch((function(e){throw e}))},p=function(e){return l()({path:"/wc/store/products/".concat(e)})},h=function(){return l()({path:"wc/store/products/attributes"})},f=function(e){return l()({path:"wc/store/products/attributes/".concat(e,"/terms")})},E=function(e){var t=e.selected,r=function(e){var t=e.selected,r=void 0===t?[]:t,n=e.search,c=Object(u.getSetting)("limitTags",!1),i=[Object(o.addQueryArgs)("wc/store/products/tags",{per_page:c?100:0,orderby:c?"count":"name",order:c?"desc":"asc",search:n})];return c&&r.length&&i.push(Object(o.addQueryArgs)("wc/store/products/tags",{include:r})),i}({selected:void 0===t?[]:t,search:e.search});return Promise.all(r.map((function(e){return l()({path:e})}))).then((function(e){return Object(a.uniqBy)(Object(a.flatten)(e),"id")}))},w=function(e){return l()({path:Object(o.addQueryArgs)("wc/store/products/categories",d({per_page:0},e))})},O=function(e){return l()({path:"wc/store/products/categories/".concat(e)})},m=function(e){return l()({path:Object(o.addQueryArgs)("wc/store/products",{per_page:0,type:"variation",parent:e})})},j=function(e,t){if(!e.title.raw)return e.slug;var r=1===t.filter((function(t){return t.title.raw===e.title.raw})).length;return e.title.raw+(r?"":" - ".concat(e.slug))}},4:function(e,t){e.exports=window.wp.components},46:function(e,t){e.exports=window.wp.keycodes},55:function(e,t){e.exports=window.wp.hooks},56:function(e,t){e.exports=window.wp.deprecated},66:function(e,t,r){"use strict";var n=r(5),c=r.n(n),o=r(16),i=r.n(o),l=r(0),a=["srcElement","size"];function u(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}t.a=function(e){var t=e.srcElement,r=e.size,n=void 0===r?24:r,o=i()(e,a);return Object(l.isValidElement)(t)?Object(l.cloneElement)(t,function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?u(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):u(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({width:n,height:n},o)):null}},7:function(e,t){e.exports=window.lodash},74:function(e,t){e.exports=window.wp.dom},779:function(e,t,r){e.exports=r(866)},780:function(e,t){},781:function(e,t){},84:function(e,t){e.exports=window.wp.serverSideRender},866:function(e,t,r){"use strict";r.r(t);var n=r(0),c=r(1),o=r(26),i=r(3),l=r(66),a=r(28),u=Object(n.createElement)(a.SVG,{xmlns:"http://www.w3.org/2000/SVG",viewBox:"0 0 24 24"},Object(n.createElement)("path",{fill:"none",d:"M0 0h24v24H0V0z"}),Object(n.createElement)("path",{d:"M22 3H7c-.69 0-1.23.35-1.59.88L0 12l5.41 8.11c.36.53.97.89 1.66.89H22c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 16H7.07L2.4 12l4.66-7H22v14z"}),Object(n.createElement)("circle",{cx:"9",cy:"12",r:"1.5"}),Object(n.createElement)("circle",{cx:"14",cy:"12",r:"1.5"}),Object(n.createElement)("circle",{cx:"19",cy:"12",r:"1.5"})),s=(r(780),r(5)),b=r.n(s),d=r(17),g=r.n(d),p=r(18),h=r.n(p),f=r(13),E=r.n(f),w=r(19),O=r.n(w),m=r(20),j=r.n(m),y=r(10),v=r.n(y),_=r(12),x=r(84),k=r.n(x),P=r(4),S=(r(2),r(92)),C=r(93),A=r(9),T=r.n(A),R=r(7),B=r(49),D=r(6),N=r.n(D),G=r(39);r(781);var M=function(e){O()(l,e);var t,r,o=(t=l,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,n=v()(t);if(r){var c=v()(this).constructor;e=Reflect.construct(n,arguments,c)}else e=n.apply(this,arguments);return j()(this,e)});function l(){var e;return g()(this,l),(e=o.apply(this,arguments)).state={list:[],loading:!0},e.renderItem=e.renderItem.bind(E()(e)),e.debouncedOnSearch=Object(R.debounce)(e.onSearch.bind(E()(e)),400),e}return h()(l,[{key:"componentDidMount",value:function(){var e=this,t=this.props.selected;Object(G.f)({selected:t}).then((function(t){e.setState({list:t,loading:!1})})).catch((function(){e.setState({list:[],loading:!1})}))}},{key:"onSearch",value:function(e){var t=this,r=this.props.selected;this.setState({loading:!0}),Object(G.f)({selected:r,search:e}).then((function(e){t.setState({list:e,loading:!1})})).catch((function(){t.setState({list:[],loading:!1})}))}},{key:"renderItem",value:function(e){var t=e.item,r=e.search,o=e.depth,i=void 0===o?0:o,l=t.breadcrumbs.length?"".concat(t.breadcrumbs.join(", "),", ").concat(t.name):t.name;return Object(n.createElement)(B.c,T()({className:N()("woocommerce-product-tags__item","has-count",{"is-searching":r.length>0,"is-skip-level":0===i&&0!==t.parent})},e,{"aria-label":Object(c.sprintf)(
/* translators: %1$d is the count of products, %2$s is the name of the tag. */
Object(c._n)("%1$d product tagged as %2$s","%1$d products tagged as %2$s",t.count,'woocommerce'),t.count,l)}))}},{key:"render",value:function(){var e=this.state,t=e.list,r=e.loading,o=this.props,l=o.isCompact,a=o.onChange,u=o.onOperatorChange,s=o.operator,b=o.selected,d={clear:Object(c.__)("Clear all product tags",'woocommerce'),list:Object(c.__)("Product Tags",'woocommerce'),noItems:Object(c.__)("Your store doesn't have any product tags.",'woocommerce'),search:Object(c.__)("Search for product tags",'woocommerce'),selected:function(e){return Object(c.sprintf)(
/* translators: %d is the count of selected tags. */
Object(c._n)("%d tag selected","%d tags selected",e,'woocommerce'),e)},updated:Object(c.__)("Tag search results updated.",'woocommerce')},g=Object(i.getSetting)("limitTags",!1);return Object(n.createElement)(n.Fragment,null,Object(n.createElement)(B.b,{className:"woocommerce-product-tags",list:t,isLoading:r,selected:b.map((function(e){return t.find((function(t){return t.id===e}))})).filter(Boolean),onChange:a,onSearch:g?this.debouncedOnSearch:null,renderItem:this.renderItem,messages:d,isCompact:l,isHierarchical:!0}),!!u&&Object(n.createElement)("div",{hidden:b.length<2},Object(n.createElement)(P.SelectControl,{className:"woocommerce-product-tags__operator",label:Object(c.__)("Display products matching",'woocommerce'),help:Object(c.__)("Pick at least two tags to use this setting.",'woocommerce'),value:s,onChange:u,options:[{label:Object(c.__)("Any selected tags",'woocommerce'),value:"any"},{label:Object(c.__)("All selected tags",'woocommerce'),value:"all"}]})))}}]),l}(n.Component);M.defaultProps={isCompact:!1,operator:"any"};var I=M,V=r(130),H=r(188);function L(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Q(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?L(Object(r),!0).forEach((function(t){b()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):L(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var q=function(e){O()(a,e);var t,r,o=(t=a,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,n=v()(t);if(r){var c=v()(this).constructor;e=Reflect.construct(n,arguments,c)}else e=n.apply(this,arguments);return j()(this,e)});function a(){var e;return g()(this,a),(e=o.apply(this,arguments)).state={changedAttributes:{},isEditing:!1},e.startEditing=e.startEditing.bind(E()(e)),e.stopEditing=e.stopEditing.bind(E()(e)),e.setChangedAttributes=e.setChangedAttributes.bind(E()(e)),e.save=e.save.bind(E()(e)),e}return h()(a,[{key:"componentDidMount",value:function(){this.props.attributes.tags.length||this.setState({isEditing:!0})}},{key:"startEditing",value:function(){this.setState({isEditing:!0,changedAttributes:{}})}},{key:"stopEditing",value:function(){this.setState({isEditing:!1,changedAttributes:{}})}},{key:"setChangedAttributes",value:function(e){this.setState((function(t){return{changedAttributes:Q(Q({},t.changedAttributes),e)}}))}},{key:"save",value:function(){var e=this.state.changedAttributes;(0,this.props.setAttributes)(e),this.stopEditing()}},{key:"getInspectorControls",value:function(){var e=this.props,t=e.attributes,r=e.setAttributes,o=this.state.isEditing,l=t.columns,a=t.tagOperator,u=t.contentVisibility,s=t.orderby,b=t.rows,d=t.alignButtons;return Object(n.createElement)(_.InspectorControls,{key:"inspector"},Object(n.createElement)(P.PanelBody,{title:Object(c.__)("Product Tag",'woocommerce'),initialOpen:!t.tags.length&&!o},Object(n.createElement)(I,{selected:t.tags,onChange:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=e.map((function(e){return e.id}));r({tags:t})},operator:a,onOperatorChange:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"any";return r({tagOperator:e})},isCompact:!0})),Object(n.createElement)(P.PanelBody,{title:Object(c.__)("Layout",'woocommerce'),initialOpen:!0},Object(n.createElement)(C.a,{columns:l,rows:b,alignButtons:d,setAttributes:r,minColumns:Object(i.getSetting)("min_columns",1),maxColumns:Object(i.getSetting)("max_columns",6),minRows:Object(i.getSetting)("min_rows",1),maxRows:Object(i.getSetting)("max_rows",6)})),Object(n.createElement)(P.PanelBody,{title:Object(c.__)("Content",'woocommerce'),initialOpen:!0},Object(n.createElement)(S.a,{settings:u,onChange:function(e){return r({contentVisibility:e})}})),Object(n.createElement)(P.PanelBody,{title:Object(c.__)("Order By",'woocommerce'),initialOpen:!1},Object(n.createElement)(V.a,{setAttributes:r,value:s})))}},{key:"renderEditMode",value:function(){var e=this,t=this.props,r=t.attributes,o=t.debouncedSpeak,i=this.state.changedAttributes,a=Q(Q({},r),i);return Object(n.createElement)(P.Placeholder,{icon:Object(n.createElement)(l.a,{srcElement:u,className:"block-editor-block-icon"}),label:Object(c.__)("Products by Tag",'woocommerce'),className:"wc-block-products-grid wc-block-product-tag"},Object(c.__)("Display a grid of products from your selected tags.",'woocommerce'),Object(n.createElement)("div",{className:"wc-block-product-tag__selection"},Object(n.createElement)(I,{selected:a.tags,onChange:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],r=t.map((function(e){return e.id}));e.setChangedAttributes({tags:r})},operator:a.tagOperator,onOperatorChange:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"any";return e.setChangedAttributes({tagOperator:t})}}),Object(n.createElement)(P.Button,{isPrimary:!0,onClick:function(){e.save(),o(Object(c.__)("Showing Products by Tag block preview.",'woocommerce'))}},Object(c.__)("Done",'woocommerce')),Object(n.createElement)(P.Button,{className:"wc-block-product-tag__cancel-button",isTertiary:!0,onClick:function(){e.stopEditing(),o(Object(c.__)("Showing Products by Tag block preview.",'woocommerce'))}},Object(c.__)("Cancel",'woocommerce'))))}},{key:"renderViewMode",value:function(){var e=this.props,t=e.attributes,r=e.name,o=t.tags.length;return Object(n.createElement)(P.Disabled,null,o?Object(n.createElement)(k.a,{block:r,attributes:t}):Object(n.createElement)(P.Placeholder,{icon:Object(n.createElement)(l.a,{icon:u,className:"block-editor-block-icon"}),label:Object(c.__)("Products by Tag",'woocommerce'),className:"wc-block-products-grid wc-block-product-tag"},Object(c.__)("This block displays products from selected tags. Select at least one tag to display its products.",'woocommerce')))}},{key:"render",value:function(){var e=this,t=this.state.isEditing;return this.props.attributes.isPreview?H.a:Object(i.getSetting)("hasTags",!0)?Object(n.createElement)(n.Fragment,null,Object(n.createElement)(_.BlockControls,null,Object(n.createElement)(P.ToolbarGroup,{controls:[{icon:"edit",title:Object(c.__)("Edit"),onClick:function(){return t?e.stopEditing():e.startEditing()},isActive:t}]})),this.getInspectorControls(),t?this.renderEditMode():this.renderViewMode()):Object(n.createElement)(P.Placeholder,{icon:Object(n.createElement)(l.a,{icon:u,className:"block-editor-block-icon"}),label:Object(c.__)("Products by Tag",'woocommerce'),className:"wc-block-products-grid wc-block-product-tag"},Object(c.__)("This block displays products from selected tags. In order to preview this you'll first need to create a product and assign it some tags.",'woocommerce'))}}]),a}(n.Component),z=Object(P.withSpokenMessages)(q);Object(o.registerBlockType)("woocommerce/product-tag",{title:Object(c.__)("Products by Tag",'woocommerce'),icon:{src:Object(n.createElement)(l.a,{srcElement:u}),foreground:"#96588a"},category:"woocommerce",keywords:[Object(c.__)("WooCommerce",'woocommerce')],description:Object(c.__)("Display a grid of products with selected tags.",'woocommerce'),supports:{align:["wide","full"],html:!1},example:{attributes:{isPreview:!0}},attributes:{columns:{type:"number",default:Object(i.getSetting)("default_columns",3)},rows:{type:"number",default:Object(i.getSetting)("default_rows",3)},alignButtons:{type:"boolean",default:!1},contentVisibility:{type:"object",default:{title:!0,price:!0,rating:!0,button:!0}},tags:{type:"array",default:[]},tagOperator:{type:"string",default:"any"},orderby:{type:"string",default:"date"},isPreview:{type:"boolean",default:!1}},edit:function(e){return Object(n.createElement)(z,e)},save:function(){return null}})},87:function(e,t){e.exports=window.ReactDOM},89:function(e,t){e.exports=window.wp.viewport},92:function(e,t,r){"use strict";var n=r(5),c=r.n(n),o=r(0),i=r(1),l=(r(2),r(4));function a(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function u(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?a(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):a(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}t.a=function(e){var t=e.onChange,r=e.settings,n=r.button,c=r.price,a=r.rating,s=r.title;return Object(o.createElement)(o.Fragment,null,Object(o.createElement)(l.ToggleControl,{label:Object(i.__)("Product title",'woocommerce'),help:s?Object(i.__)("Product title is visible.",'woocommerce'):Object(i.__)("Product title is hidden.",'woocommerce'),checked:s,onChange:function(){return t(u(u({},r),{},{title:!s}))}}),Object(o.createElement)(l.ToggleControl,{label:Object(i.__)("Product price",'woocommerce'),help:c?Object(i.__)("Product price is visible.",'woocommerce'):Object(i.__)("Product price is hidden.",'woocommerce'),checked:c,onChange:function(){return t(u(u({},r),{},{price:!c}))}}),Object(o.createElement)(l.ToggleControl,{label:Object(i.__)("Product rating",'woocommerce'),help:a?Object(i.__)("Product rating is visible.",'woocommerce'):Object(i.__)("Product rating is hidden.",'woocommerce'),checked:a,onChange:function(){return t(u(u({},r),{},{rating:!a}))}}),Object(o.createElement)(l.ToggleControl,{label:Object(i.__)("Add to Cart button",'woocommerce'),help:n?Object(i.__)("Add to Cart button is visible.",'woocommerce'):Object(i.__)("Add to Cart button is hidden.",'woocommerce'),checked:n,onChange:function(){return t(u(u({},r),{},{button:!n}))}}))}},93:function(e,t,r){"use strict";var n=r(0),c=r(1),o=r(7),i=(r(2),r(4));t.a=function(e){var t=e.columns,r=e.rows,l=e.setAttributes,a=e.alignButtons,u=e.minColumns,s=void 0===u?1:u,b=e.maxColumns,d=void 0===b?6:b,g=e.minRows,p=void 0===g?1:g,h=e.maxRows,f=void 0===h?6:h;return Object(n.createElement)(n.Fragment,null,Object(n.createElement)(i.RangeControl,{label:Object(c.__)("Columns",'woocommerce'),value:t,onChange:function(e){var t=Object(o.clamp)(e,s,d);l({columns:Number.isNaN(t)?"":t})},min:s,max:d}),Object(n.createElement)(i.RangeControl,{label:Object(c.__)("Rows",'woocommerce'),value:r,onChange:function(e){var t=Object(o.clamp)(e,p,f);l({rows:Number.isNaN(t)?"":t})},min:p,max:f}),Object(n.createElement)(i.ToggleControl,{label:Object(c.__)("Align Last Block",'woocommerce'),help:a?Object(c.__)("The last inner block will be aligned vertically.",'woocommerce'):Object(c.__)("The last inner block will follow other content.",'woocommerce'),checked:a,onChange:function(){return l({alignButtons:!a})}}))}},96:function(e,t){e.exports=window.wp.date}});woocommerce-blocks/build/active-filters-frontend.js000064400000066427151335517640016562 0ustar00!function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=296)}({0:function(e,t){e.exports=window.wp.element},1:function(e,t){e.exports=window.wp.i18n},10:function(e,t,r){e.exports=r(79)()},100:function(e,t,r){"use strict";r.d(t,"a",(function(){return a}));var n=r(5),o=r.n(n),c=r(0),a=function(){var e=Object(c.useState)(),t=o()(e,2)[1];return Object(c.useCallback)((function(e){t((function(){throw e}))}),[])}},107:function(e,t,r){"use strict";r.d(t,"a",(function(){return b}));var n=r(14),o=r.n(n),c=r(4),a=r.n(c),i=r(0),s=r(44);function u(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function l(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?u(Object(r),!0).forEach((function(t){a()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):u(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var p=[".wp-block-woocommerce-cart"],f=function(e){var t=e.Block,r=e.containers,n=e.getProps,c=void 0===n?function(){return{}}:n,a=e.getErrorBoundaryProps,u=void 0===a?function(){return{}}:a;0!==r.length&&Array.prototype.forEach.call(r,(function(e,r){var n=c(e,r),a=u(e,r),p=l(l({},e.dataset),n.attributes||{});e.classList.remove("is-loading"),Object(i.render)(React.createElement(s.a,a,React.createElement(i.Suspense,{fallback:React.createElement("div",{className:"wc-block-placeholder"})},React.createElement(t,o()({},n,{attributes:p})))),e)}))},b=function(e){var t,r,n,o,c,a,i,s=document.body.querySelectorAll(p.join(","));t=l(l({},e),{},{wrappers:s}),r=t.Block,n=t.getProps,o=t.getErrorBoundaryProps,c=t.selector,a=t.wrappers,i=document.body.querySelectorAll(c),a.length>0&&Array.prototype.filter.call(i,(function(e){return!function(e,t){return Array.prototype.some.call(t,(function(t){return t.contains(e)&&!t.isSameNode(e)}))}(e,a)})),f({Block:r,containers:i,getProps:n,getErrorBoundaryProps:o}),Array.prototype.forEach.call(s,(function(t){t.addEventListener("wc-blocks_render_blocks_frontend",(function(){var r,n,o,c,a,i;n=(r=l(l({},e),{},{wrapper:t})).Block,o=r.getProps,c=r.getErrorBoundaryProps,a=r.selector,i=r.wrapper.querySelectorAll(a),f({Block:n,containers:i,getProps:o,getErrorBoundaryProps:c})}))}))}},11:function(e,t){e.exports=window.wp.data},120:function(e,t,r){"use strict";r.d(t,"a",(function(){return s}));var n=r(8),o=r(11),c=r(0),a=r(53),i=r(100),s=function(e){var t=e.namespace,r=e.resourceName,s=e.resourceValues,u=void 0===s?[]:s,l=e.query,p=void 0===l?{}:l,f=e.shouldSelect,b=void 0===f||f;if(!t||!r)throw new Error("The options object must have valid values for the namespace and the resource properties.");var d=Object(c.useRef)({results:[],isLoading:!0}),m=Object(a.a)(p),y=Object(a.a)(u),g=Object(i.a)(),v=Object(o.useSelect)((function(e){if(!b)return null;var o=e(n.COLLECTIONS_STORE_KEY),c=[t,r,m,y],a=o.getCollectionError.apply(o,c);return a&&g(a),{results:o.getCollection.apply(o,c),isLoading:!o.hasFinishedResolution("getCollection",c)}}),[t,r,y,m,b]);return null!==v&&(d.current=v),d.current}},128:function(e,t,r){"use strict";var n=r(0),o=r(8),c=r(11),a=r(83);t.a=function(e){return function(t){var r;return r=Object(n.useRef)(a.n.restApiRoutes||{}),Object(c.useSelect)((function(e,t){if(r.current){var n=e(o.SCHEMA_STORE_KEY),c=n.isResolving,a=n.hasFinishedResolution,i=t.dispatch(o.SCHEMA_STORE_KEY),s=i.receiveRoutes,u=i.startResolution,l=i.finishResolution;Object.keys(r.current).forEach((function(e){var t=r.current[e];c("getRoutes",[e])||a("getRoutes",[e])||(u("getRoutes",[e]),s(t,[e]),l("getRoutes",[e]))}))}}),[]),React.createElement(e,t)}}},14:function(e,t){function r(){return e.exports=r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},e.exports.default=e.exports,e.exports.__esModule=!0,r.apply(this,arguments)}e.exports=r,e.exports.default=e.exports,e.exports.__esModule=!0},149:function(e,t){},152:function(e,t,r){"use strict";var n=r(4),o=r.n(n),c=r(23),a=r.n(c),i=r(0),s=["srcElement","size"];function u(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}t.a=function(e){var t=e.srcElement,r=e.size,n=void 0===r?24:r,c=a()(e,s);return Object(i.isValidElement)(t)?Object(i.cloneElement)(t,function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?u(Object(r),!0).forEach((function(t){o()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):u(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({width:n,height:n},c)):null}},169:function(e,t,r){"use strict";r.d(t,"a",(function(){return c})),r.d(t,"b",(function(){return a}));var n=r(2),o=Object(n.getSetting)("attributes",[]).reduce((function(e,t){var r,n=(r=t)&&r.attribute_name?{id:parseInt(r.attribute_id,10),name:r.attribute_name,taxonomy:"pa_"+r.attribute_name,label:r.attribute_label}:null;return n.id&&e.push(n),e}),[]),c=function(e){if(e)return o.find((function(t){return t.id===e}))},a=function(e){if(e)return o.find((function(t){return t.taxonomy===e}))}},170:function(e,t,r){"use strict";r.d(t,"a",(function(){return o})),r.d(t,"b",(function(){return c}));var n=r(7),o=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){},r=arguments.length>2?arguments[2]:void 0,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"",c=e.filter((function(e){return e.attribute===r.taxonomy})),a=c.length?c[0]:null;if(a&&a.slug&&Array.isArray(a.slug)&&a.slug.includes(o)){var i=a.slug.filter((function(e){return e!==o})),s=e.filter((function(e){return e.attribute!==r.taxonomy}));i.length>0&&(a.slug=i.sort(),s.push(a)),t(Object(n.sortBy)(s,"attribute"))}},c=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){},r=arguments.length>2?arguments[2]:void 0,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],c=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"in",a=e.filter((function(e){return e.attribute!==r.taxonomy}));0===o.length?t(a):(a.push({attribute:r.taxonomy,operator:c,slug:o.map((function(e){return e.slug})).sort()}),t(Object(n.sortBy)(a,"attribute")))}},194:function(e,t,r){"use strict";var n=r(14),o=r.n(n),c=r(23),a=r.n(c),i=(r(10),r(6)),s=r.n(i),u=r(1),l=r(152),p=r(216),f=(r(149),["text","screenReaderText","element","className","radius","children"]),b=function(e){var t=e.text,r=e.screenReaderText,n=void 0===r?"":r,c=e.element,i=void 0===c?"li":c,u=e.className,l=void 0===u?"":u,p=e.radius,b=void 0===p?"small":p,d=e.children,m=void 0===d?null:d,y=a()(e,f),g=i,v=s()(l,"wc-block-components-chip","wc-block-components-chip--radius-"+b),O=Boolean(n&&n!==t);return React.createElement(g,o()({className:v},y),React.createElement("span",{"aria-hidden":O,className:"wc-block-components-chip__text"},t),O&&React.createElement("span",{className:"screen-reader-text"},n),m)},d=["ariaLabel","className","disabled","onRemove","removeOnAnyClick","text","screenReaderText"];t.a=function(e){var t=e.ariaLabel,r=void 0===t?"":t,n=e.className,c=void 0===n?"":n,i=e.disabled,f=void 0!==i&&i,m=e.onRemove,y=void 0===m?function(){}:m,g=e.removeOnAnyClick,v=void 0!==g&&g,O=e.text,_=e.screenReaderText,h=void 0===_?"":_,w=a()(e,d),x=v?"span":"button";if(!r){var j=h&&"string"==typeof h?h:O;r="string"!=typeof j?
/* translators: Remove chip. */
Object(u.__)("Remove",'woocommerce'):Object(u.sprintf)(
/* translators: %s text of the chip to remove. */
Object(u.__)('Remove "%s"','woocommerce'),j)}var E={"aria-label":r,disabled:f,onClick:y,onKeyDown:function(e){"Backspace"!==e.key&&"Delete"!==e.key||y()}},R=v?E:{},S=v?{"aria-hidden":!0}:E;return React.createElement(b,o()({},w,R,{className:s()(c,"is-removable"),element:v?"button":w.element,screenReaderText:h,text:O}),React.createElement(x,o()({className:"wc-block-components-chip__remove"},S),React.createElement(l.a,{className:"wc-block-components-chip__remove-icon",srcElement:p.a,size:16})))}},2:function(e,t){e.exports=window.wc.wcSettings},21:function(e,t){function r(t){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?(e.exports=r=function(e){return typeof e},e.exports.default=e.exports,e.exports.__esModule=!0):(e.exports=r=function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.default=e.exports,e.exports.__esModule=!0),r(t)}e.exports=r,e.exports.default=e.exports,e.exports.__esModule=!0},216:function(e,t,r){"use strict";var n=r(14),o=r.n(n),c=r(23),a=r.n(c),i=r(34),s=["className","size"],u=function(e){var t=e.className,r=e.size,n=a()(e,s);return React.createElement(i.SVG,o()({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",className:t,width:r,height:r},n),React.createElement("path",{d:"M14.95 6.46L11.41 10l3.54 3.54-1.41 1.41L10 11.42l-3.53 3.53-1.42-1.42L8.58 10 5.05 6.47l1.42-1.42L10 8.58l3.54-3.53z"}))},l=React.createElement(u,null);t.a=l},23:function(e,t,r){var n=r(77);e.exports=function(e,t){if(null==e)return{};var r,o,c=n(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(o=0;o<a.length;o++)r=a[o],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(c[r]=e[r])}return c},e.exports.default=e.exports,e.exports.__esModule=!0},25:function(e,t){e.exports=window.wp.isShallowEqual},28:function(e,t){e.exports=window.wp.htmlEntities},29:function(e,t){e.exports=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e},e.exports.default=e.exports,e.exports.__esModule=!0},296:function(e,t,r){e.exports=r(321)},297:function(e,t){},3:function(e,t){e.exports=window.React},30:function(e,t){function r(t){return e.exports=r=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},e.exports.default=e.exports,e.exports.__esModule=!0,r(t)}e.exports=r,e.exports.default=e.exports,e.exports.__esModule=!0},321:function(e,t,r){"use strict";r.r(t);var n=r(128),o=r(107),c=r(5),a=r.n(c),i=r(1),s=r(90),u=r(2),l=r(0),p=r(6),f=r.n(p),b=(r(10),r(51)),d=(r(297),r(169)),m=r(58),y=r(194),g=function(e,t){return Number.isFinite(e)&&Number.isFinite(t)?Object(i.sprintf)(
/* translators: %1$s min price, %2$s max price */
Object(i.__)("Between %1$s and %2$s",'woocommerce'),Object(m.formatPrice)(e),Object(m.formatPrice)(t)):Number.isFinite(e)?Object(i.sprintf)(
/* translators: %s min price */
Object(i.__)("From %s",'woocommerce'),Object(m.formatPrice)(e)):Object(i.sprintf)(
/* translators: %s max price */
Object(i.__)("Up to %s",'woocommerce'),Object(m.formatPrice)(t))},v=function(e){var t=e.type,r=e.name,n=e.prefix,o=e.removeCallback,c=void 0===o?function(){}:o,a=e.showLabel,s=void 0===a||a,u=e.displayStyle,l=n?React.createElement(React.Fragment,null,n," ",r):r,p=Object(i.sprintf)(
/* translators: %s attribute value used in the filter. For example: yellow, green, small, large. */
Object(i.__)("Remove %s filter",'woocommerce'),r);return React.createElement("li",{className:"wc-block-active-filters__list-item",key:t+":"+r},s&&React.createElement("span",{className:"wc-block-active-filters__list-item-type"},t+": "),"chips"===u?React.createElement(y.a,{element:"span",text:l,onRemove:c,radius:"large",ariaLabel:p}):React.createElement("span",{className:"wc-block-active-filters__list-item-name"},l,React.createElement("button",{className:"wc-block-active-filters__list-item-remove",onClick:c},React.createElement("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},React.createElement("ellipse",{cx:"8",cy:"8",rx:"8",ry:"8",transform:"rotate(-180 8 8)",fill:"currentColor",fillOpacity:"0.7"}),React.createElement("rect",{x:"10.636",y:"3.94983",width:"2",height:"9.9466",transform:"rotate(45 10.636 3.94983)",fill:"white"}),React.createElement("rect",{x:"12.0503",y:"11.0209",width:"2",height:"9.9466",transform:"rotate(135 12.0503 11.0209)",fill:"white"})),React.createElement(b.a,{screenReaderLabel:p}))))},O=r(120),_=r(28),h=r(170),w=function(e){var t=e.attributeObject,r=void 0===t?{}:t,n=e.slugs,o=void 0===n?[]:n,c=e.operator,u=void 0===c?"in":c,l=e.displayStyle,p=Object(O.a)({namespace:"/wc/store",resourceName:"products/attributes/terms",resourceValues:[r.id]}),f=p.results,b=p.isLoading,d=Object(s.b)("attributes",[]),m=a()(d,2),y=m[0],g=m[1];if(b)return null;var w=r.label;return React.createElement("li",null,React.createElement("span",{className:"wc-block-active-filters__list-item-type"},w,":"),React.createElement("ul",null,o.map((function(e,t){var n=f.find((function(t){return t.slug===e}));if(!n)return null;var o="";return t>0&&"and"===u&&(o=React.createElement("span",{className:"wc-block-active-filters__list-item-operator"},Object(i.__)("and",'woocommerce'))),v({type:w,name:Object(_.decodeEntities)(n.name||e),prefix:o,removeCallback:function(){Object(h.a)(y,g,r,e)},showLabel:!1,displayStyle:l})}))))};Object(o.a)({selector:".wp-block-woocommerce-active-filters",Block:Object(n.a)((function(e){var t=e.attributes,r=e.isEditor,n=void 0!==r&&r,o=Object(s.b)("attributes",[]),c=a()(o,2),p=c[0],m=c[1],y=Object(s.b)("stock_status",[]),O=a()(y,2),_=O[0],h=O[1],x=Object(s.b)("min_price"),j=a()(x,2),E=j[0],R=j[1],S=Object(s.b)("max_price"),k=a()(S,2),P=k[0],T=k[1],M=Object(u.getSetting)("stockStatusOptions",[]),N=Object(l.useMemo)((function(){if(_.length>0)return _.map((function(e){return v({type:Object(i.__)("Stock Status",'woocommerce'),name:M[e],removeCallback:function(){var t=_.filter((function(t){return t!==e}));h(t)},displayStyle:t.displayStyle})}))}),[M,_,h,t.displayStyle]),A=Object(l.useMemo)((function(){return Number.isFinite(E)||Number.isFinite(P)?v({type:Object(i.__)("Price",'woocommerce'),name:g(E,P),removeCallback:function(){R(void 0),T(void 0)},displayStyle:t.displayStyle}):null}),[E,P,t.displayStyle,R,T]),C=Object(l.useMemo)((function(){return p.map((function(e){var r=Object(d.b)(e.attribute);return React.createElement(w,{attributeObject:r,displayStyle:t.displayStyle,slugs:e.slug,key:e.attribute,operator:e.operator})}))}),[p,t.displayStyle]);if(!(p.length>0||_.length>0||Number.isFinite(E)||Number.isFinite(P)||n))return null;var L="h".concat(t.headingLevel),B=f()("wc-block-active-filters__list",{"wc-block-active-filters__list--chips":"chips"===t.displayStyle});return React.createElement(React.Fragment,null,!n&&t.heading&&React.createElement(L,{className:"wc-block-active-filters__title"},t.heading),React.createElement("div",{className:"wc-block-active-filters"},React.createElement("ul",{className:B},n?React.createElement(React.Fragment,null,v({type:Object(i.__)("Size",'woocommerce'),name:Object(i.__)("Small",'woocommerce'),displayStyle:t.displayStyle}),v({type:Object(i.__)("Color",'woocommerce'),name:Object(i.__)("Blue",'woocommerce'),displayStyle:t.displayStyle})):React.createElement(React.Fragment,null,A,N,C)),React.createElement("button",{className:"wc-block-active-filters__clear-all",onClick:function(){R(void 0),T(void 0),m([]),h([])}},React.createElement(b.a,{label:Object(i.__)("Clear All",'woocommerce'),screenReaderLabel:Object(i.__)("Clear All Filters",'woocommerce')}))))})),getProps:function(e){return{attributes:{displayStyle:e.dataset.displayStyle,heading:e.dataset.heading,headingLevel:e.dataset.headingLevel||3}}}})},34:function(e,t){e.exports=window.wp.primitives},4:function(e,t){e.exports=function(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e},e.exports.default=e.exports,e.exports.__esModule=!0},40:function(e,t){e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},e.exports.default=e.exports,e.exports.__esModule=!0},41:function(e,t){function r(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}e.exports=function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e},e.exports.default=e.exports,e.exports.__esModule=!0},42:function(e,t,r){var n=r(71);e.exports=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&n(e,t)},e.exports.default=e.exports,e.exports.__esModule=!0},43:function(e,t,r){var n=r(21).default,o=r(29);e.exports=function(e,t){return!t||"object"!==n(t)&&"function"!=typeof t?o(e):t},e.exports.default=e.exports,e.exports.__esModule=!0},44:function(e,t,r){"use strict";var n=r(40),o=r.n(n),c=r(41),a=r.n(c),i=r(29),s=r.n(i),u=r(42),l=r.n(u),p=r(43),f=r.n(p),b=r(30),d=r.n(b),m=r(4),y=r.n(m),g=(r(10),r(3)),v=r(1),O=r(83),_=function(e){var t=e.imageUrl,r=void 0===t?"".concat(O.l,"/block-error.svg"):t,n=e.header,o=void 0===n?Object(v.__)("Oops!",'woocommerce'):n,c=e.text,a=void 0===c?Object(v.__)("There was an error loading the content.",'woocommerce'):c,i=e.errorMessage,s=e.errorMessagePrefix,u=void 0===s?Object(v.__)("Error:",'woocommerce'):s,l=e.button;return React.createElement("div",{className:"wc-block-error wc-block-components-error"},r&&React.createElement("img",{className:"wc-block-error__image wc-block-components-error__image",src:r,alt:""}),React.createElement("div",{className:"wc-block-error__content wc-block-components-error__content"},o&&React.createElement("p",{className:"wc-block-error__header wc-block-components-error__header"},o),a&&React.createElement("p",{className:"wc-block-error__text wc-block-components-error__text"},a),i&&React.createElement("p",{className:"wc-block-error__message wc-block-components-error__message"},u?u+" ":"",i),l&&React.createElement("p",{className:"wc-block-error__button wc-block-components-error__button"},l)))};r(81);var h=function(e){l()(c,e);var t,r,n=(t=c,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,n=d()(t);if(r){var o=d()(this).constructor;e=Reflect.construct(n,arguments,o)}else e=n.apply(this,arguments);return f()(this,e)});function c(){var e;o()(this,c);for(var t=arguments.length,r=new Array(t),a=0;a<t;a++)r[a]=arguments[a];return e=n.call.apply(n,[this].concat(r)),y()(s()(e),"state",{errorMessage:"",hasError:!1}),e}return a()(c,[{key:"render",value:function(){var e=this.props,t=e.header,r=e.imageUrl,n=e.showErrorMessage,o=e.text,c=e.errorMessagePrefix,a=e.renderError,i=e.button,s=this.state,u=s.errorMessage;return s.hasError?"function"==typeof a?a({errorMessage:u}):React.createElement(_,{errorMessage:n?u:null,header:t,imageUrl:r,text:o,errorMessagePrefix:c,button:i}):this.props.children}}],[{key:"getDerivedStateFromError",value:function(e){return void 0!==e.statusText&&void 0!==e.status?{errorMessage:React.createElement(React.Fragment,null,React.createElement("strong",null,e.status),": ",e.statusText),hasError:!0}:{errorMessage:e.message,hasError:!0}}}]),c}(g.Component);h.defaultProps={showErrorMessage:!0},t.a=h},5:function(e,t,r){var n=r(84),o=r(85),c=r(67),a=r(86);e.exports=function(e,t){return n(e)||o(e,t)||c(e,t)||a()},e.exports.default=e.exports,e.exports.__esModule=!0},51:function(e,t,r){"use strict";var n=r(4),o=r.n(n),c=r(0),a=r(6),i=r.n(a);function s(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function u(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?s(Object(r),!0).forEach((function(t){o()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):s(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}t.a=function(e){var t,r=e.label,n=e.screenReaderLabel,o=e.wrapperElement,a=e.wrapperProps,s=void 0===a?{}:a,l=null!=r,p=null!=n;return!l&&p?(t=o||"span",s=u(u({},s),{},{className:i()(s.className,"screen-reader-text")}),React.createElement(t,s,n)):(t=o||c.Fragment,l&&p&&r!==n?React.createElement(t,s,React.createElement("span",{"aria-hidden":"true"},r),React.createElement("span",{className:"screen-reader-text"},n)):React.createElement(t,s,r))}},53:function(e,t,r){"use strict";r.d(t,"a",(function(){return a}));var n=r(0),o=r(25),c=r.n(o);function a(e){var t=Object(n.useRef)(e);return c()(e,t.current)||(t.current=e),t.current}},58:function(e,t){e.exports=window.wc.priceFormat},6:function(e,t,r){var n;!function(){"use strict";var r={}.hasOwnProperty;function o(){for(var e=[],t=0;t<arguments.length;t++){var n=arguments[t];if(n){var c=typeof n;if("string"===c||"number"===c)e.push(n);else if(Array.isArray(n)){if(n.length){var a=o.apply(null,n);a&&e.push(a)}}else if("object"===c)if(n.toString===Object.prototype.toString)for(var i in n)r.call(n,i)&&n[i]&&e.push(i);else e.push(n.toString())}}return e.join(" ")}e.exports?(o.default=o,e.exports=o):void 0===(n=function(){return o}.apply(t,[]))||(e.exports=n)}()},64:function(e,t,r){"use strict";r.d(t,"a",(function(){return c}));var n=r(0),o=Object(n.createContext)("page"),c=function(){return Object(n.useContext)(o)};o.Provider},67:function(e,t,r){var n=r(68);e.exports=function(e,t){if(e){if("string"==typeof e)return n(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?n(e,t):void 0}},e.exports.default=e.exports,e.exports.__esModule=!0},68:function(e,t){e.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n},e.exports.default=e.exports,e.exports.__esModule=!0},7:function(e,t){e.exports=window.lodash},71:function(e,t){function r(t,n){return e.exports=r=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},e.exports.default=e.exports,e.exports.__esModule=!0,r(t,n)}e.exports=r,e.exports.default=e.exports,e.exports.__esModule=!0},77:function(e,t){e.exports=function(e,t){if(null==e)return{};var r,n,o={},c=Object.keys(e);for(n=0;n<c.length;n++)r=c[n],t.indexOf(r)>=0||(o[r]=e[r]);return o},e.exports.default=e.exports,e.exports.__esModule=!0},79:function(e,t,r){"use strict";var n=r(80);function o(){}function c(){}c.resetWarningCache=o,e.exports=function(){function e(e,t,r,o,c,a){if(a!==n){var i=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw i.name="Invariant Violation",i}}function t(){return e}e.isRequired=e;var r={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:c,resetWarningCache:o};return r.PropTypes=r,r}},8:function(e,t){e.exports=window.wc.wcBlocksData},80:function(e,t,r){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},81:function(e,t){},83:function(e,t,r){"use strict";r.d(t,"n",(function(){return c})),r.d(t,"l",(function(){return a})),r.d(t,"k",(function(){return i})),r.d(t,"m",(function(){return s})),r.d(t,"i",(function(){return u})),r.d(t,"d",(function(){return l})),r.d(t,"f",(function(){return p})),r.d(t,"j",(function(){return f})),r.d(t,"c",(function(){return b})),r.d(t,"e",(function(){return d})),r.d(t,"g",(function(){return m})),r.d(t,"a",(function(){return y})),r.d(t,"h",(function(){return g})),r.d(t,"b",(function(){return v}));var n,o=r(2),c=Object(o.getSetting)("wcBlocksConfig",{buildPhase:1,pluginUrl:"",productCount:0,defaultAvatar:"",restApiRoutes:{},wordCountType:"words"}),a=c.pluginUrl+"images/",i=c.pluginUrl+"build/",s=c.buildPhase,u=null===(n=o.STORE_PAGES.shop)||void 0===n?void 0:n.permalink,l=(o.STORE_PAGES.checkout.id,o.STORE_PAGES.checkout.permalink),p=o.STORE_PAGES.privacy.permalink,f=(o.STORE_PAGES.privacy.title,o.STORE_PAGES.terms.permalink),b=(o.STORE_PAGES.terms.title,o.STORE_PAGES.cart.id,o.STORE_PAGES.cart.permalink),d=o.STORE_PAGES.myaccount.permalink?o.STORE_PAGES.myaccount.permalink:Object(o.getSetting)("wpLoginUrl","/wp-login.php"),m=Object(o.getSetting)("shippingCountries",{}),y=Object(o.getSetting)("allowedCountries",{}),g=Object(o.getSetting)("shippingStates",{}),v=Object(o.getSetting)("allowedStates",{})},84:function(e,t){e.exports=function(e){if(Array.isArray(e))return e},e.exports.default=e.exports,e.exports.__esModule=!0},85:function(e,t){e.exports=function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,c=[],_n=!0,a=!1;try{for(r=r.call(e);!(_n=(n=r.next()).done)&&(c.push(n.value),!t||c.length!==t);_n=!0);}catch(e){a=!0,o=e}finally{try{_n||null==r.return||r.return()}finally{if(a)throw o}}return c}},e.exports.default=e.exports,e.exports.__esModule=!0},86:function(e,t){e.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},e.exports.default=e.exports,e.exports.__esModule=!0},90:function(e,t,r){"use strict";r.d(t,"a",(function(){return b})),r.d(t,"b",(function(){return d})),r.d(t,"c",(function(){return m}));var n=r(5),o=r.n(n),c=r(8),a=r(11),i=r(0),s=r(25),u=r.n(s),l=r(53),p=r(99),f=r(64),b=function(e){var t=Object(f.a)();e=e||t;var r=Object(a.useSelect)((function(t){return t(c.QUERY_STATE_STORE_KEY).getValueForQueryContext(e,void 0)}),[e]),n=Object(a.useDispatch)(c.QUERY_STATE_STORE_KEY).setValueForQueryContext;return[r,Object(i.useCallback)((function(t){n(e,t)}),[e,n])]},d=function(e,t,r){var n=Object(f.a)();r=r||n;var o=Object(a.useSelect)((function(n){return n(c.QUERY_STATE_STORE_KEY).getValueForQueryKey(r,e,t)}),[r,e]),s=Object(a.useDispatch)(c.QUERY_STATE_STORE_KEY).setQueryValue;return[o,Object(i.useCallback)((function(t){s(r,e,t)}),[r,e,s])]},m=function(e,t){var r=Object(f.a)(),n=b(t=t||r),c=o()(n,2),a=c[0],s=c[1],d=Object(l.a)(a),m=Object(l.a)(e),y=Object(p.a)(m),g=Object(i.useRef)(!1);return Object(i.useEffect)((function(){u()(y,m)||(s(Object.assign({},d,m)),g.current=!0)}),[d,m,y,s]),g.current?[a,s]:[e,s]}},99:function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));var n=r(3);function o(e,t){var r=Object(n.useRef)();return Object(n.useEffect)((function(){r.current===e||t&&!t(e,r.current)||(r.current=e)}),[e,t]),r.current}}});woocommerce-blocks/build/product-new.asset.php000064400000000746151335517640015554 0ustar00<?php return array('dependencies' => array('lodash', 'moment', 'react', 'react-dom', 'wc-settings', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-data-controls', 'wp-date', 'wp-deprecated', 'wp-dom', 'wp-element', 'wp-escape-html', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-keycodes', 'wp-polyfill', 'wp-primitives', 'wp-server-side-render', 'wp-url', 'wp-viewport'), 'version' => '60c1526fa156700a35b3f1c7feab0c8c');woocommerce-blocks/build/wc-blocks-registry.js000064400000033714151335517640015547 0ustar00this.wc=this.wc||{},this.wc.wcBlocksRegistry=function(e){var t={};function n(o){if(t[o])return t[o].exports;var r=t[o]={i:o,l:!1,exports:{}};return e[o].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=e,n.c=t,n.d=function(e,t,o){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)n.d(o,r,function(t){return e[t]}.bind(null,r));return o},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=162)}({0:function(e,t){e.exports=window.wp.element},1:function(e,t){e.exports=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e},e.exports.default=e.exports,e.exports.__esModule=!0},12:function(e,t,n){var o=n(20),r=n(21),i=n(18),a=n(22);e.exports=function(e,t){return o(e)||r(e,t)||i(e,t)||a()},e.exports.default=e.exports,e.exports.__esModule=!0},162:function(e,t,n){"use strict";n.r(t),n.d(t,"registerPaymentMethod",(function(){return P})),n.d(t,"registerExpressPaymentMethod",(function(){return M})),n.d(t,"registerPaymentMethodExtensionCallbacks",(function(){return j})),n.d(t,"__experimentalDeRegisterPaymentMethod",(function(){return E})),n.d(t,"__experimentalDeRegisterExpressPaymentMethod",(function(){return T})),n.d(t,"getPaymentMethods",(function(){return C})),n.d(t,"getExpressPaymentMethods",(function(){return _})),n.d(t,"getRegisteredBlockComponents",(function(){return R})),n.d(t,"getRegisteredInnerBlocks",(function(){return D})),n.d(t,"registerBlockComponent",(function(){return $})),n.d(t,"registerInnerBlock",(function(){return N}));var o=n(12),r=n.n(o),i=n(9),a=n.n(i),s=n(23),u=n.n(s),c=n(24),p=n.n(c),l=n(1),f=n.n(l),d=n(0),m={},h=m,y=function(e,t,n){var o=function(e,t){return function(n){return((null==n?void 0:n.paymentRequirements)||[]).every((function(e){return t.includes(e)}))&&e(n)}}(e,t);return Object.values(h).some((function(e){return n in e}))?function(e,t,n){return function(o){var i=e(o);if(i){var a={};Object.entries(t).forEach((function(e){var t=r()(e,2),o=t[0],i=t[1];a[o]=i[n]})),i=Object.keys(a).every((function(e){try{return a[e](o)}catch(t){return console.error("Error when executing callback for ".concat(n," in ").concat(e),t),!0}}))}return i}}(o,h,n):o},b=function(e,t){if(null!==e&&!Object(d.isValidElement)(e))throw new TypeError("The ".concat(t," property for the payment method must be a React element or null."))},v=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=t.reduce((function(t,n){return e.hasOwnProperty(n)||t.push(n),t}),[]);if(n.length>0){var o="The payment method configuration object is missing the following properties:";throw new TypeError(o+n.join(", "))}},g=function(){return null},w=function(){function e(t){var n,o,r,i;u()(this,e),f()(this,"name",void 0),f()(this,"content",void 0),f()(this,"edit",void 0),f()(this,"paymentMethodId",void 0),f()(this,"supports",void 0),f()(this,"icons",void 0),f()(this,"label",void 0),f()(this,"ariaLabel",void 0),f()(this,"placeOrderButtonLabel",void 0),f()(this,"savedTokenComponent",void 0),f()(this,"canMakePaymentFromConfig",void 0),e.assertValidConfig(t),this.name=t.name,this.label=t.label,this.placeOrderButtonLabel=t.placeOrderButtonLabel,this.ariaLabel=t.ariaLabel,this.content=t.content,this.savedTokenComponent=t.savedTokenComponent,this.icons=t.icons||null,this.edit=t.edit,this.paymentMethodId=t.paymentMethodId||this.name,this.supports={showSavedCards:(null==t||null===(n=t.supports)||void 0===n?void 0:n.showSavedCards)||(null==t||null===(o=t.supports)||void 0===o?void 0:o.savePaymentInfo)||!1,showSaveOption:(null==t||null===(r=t.supports)||void 0===r?void 0:r.showSaveOption)||!1,features:(null==t||null===(i=t.supports)||void 0===i?void 0:i.features)||["products"]},this.canMakePaymentFromConfig=t.canMakePayment}return p()(e,[{key:"canMakePayment",get:function(){return y(this.canMakePaymentFromConfig,this.supports.features,this.name)}}]),e}();f()(w,"assertValidConfig",(function(e){var t,n,o,r,i,s,u;if(e.savedTokenComponent=e.savedTokenComponent||Object(d.createElement)(g,null),v(e,["name","label","ariaLabel","content","edit","canMakePayment"]),"string"!=typeof e.name)throw new Error("The name property for the payment method must be a string");if(void 0!==e.icons&&!Array.isArray(e.icons)&&null!==e.icons)throw new Error("The icons property for the payment method must be an array or null.");if("string"!=typeof e.paymentMethodId&&void 0!==e.paymentMethodId)throw new Error("The paymentMethodId property for the payment method must be a string or undefined (in which case it will be the value of the name property).");if("string"!=typeof e.placeOrderButtonLabel&&void 0!==e.placeOrderButtonLabel)throw new TypeError("The placeOrderButtonLabel property for the payment method must be a string");if(function(e,t){if(null!==e&&!Object(d.isValidElement)(e)&&"string"!=typeof e)throw new TypeError("The ".concat("label"," property for the payment method must be a React element, a string, or null."))}(e.label),b(e.content,"content"),b(e.edit,"edit"),b(e.savedTokenComponent,"savedTokenComponent"),"string"!=typeof e.ariaLabel)throw new TypeError("The ariaLabel property for the payment method must be a string");if("function"!=typeof e.canMakePayment)throw new TypeError("The canMakePayment property for the payment method must be a function.");if(void 0!==(null===(t=e.supports)||void 0===t?void 0:t.showSavedCards)&&"boolean"!=typeof(null===(n=e.supports)||void 0===n?void 0:n.showSavedCards))throw new TypeError("If the payment method includes the `supports.showSavedCards` property, it must be a boolean");if(void 0!==(null===(o=e.supports)||void 0===o?void 0:o.savePaymentInfo)&&a()("Passing savePaymentInfo when registering a payment method.",{alternative:"Pass showSavedCards and showSaveOption",plugin:"woocommerce-gutenberg-products-block",link:"https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/3686"}),void 0!==(null===(r=e.supports)||void 0===r?void 0:r.features)&&!Array.isArray(null===(i=e.supports)||void 0===i?void 0:i.features))throw new Error("The features property for the payment method must be an array or undefined.");if(void 0!==(null===(s=e.supports)||void 0===s?void 0:s.showSaveOption)&&"boolean"!=typeof(null===(u=e.supports)||void 0===u?void 0:u.showSaveOption))throw new TypeError("If the payment method includes the `supports.showSaveOption` property, it must be a boolean")}));var x=function(){function e(t){var n;u()(this,e),f()(this,"name",void 0),f()(this,"content",void 0),f()(this,"edit",void 0),f()(this,"paymentMethodId",void 0),f()(this,"supports",void 0),f()(this,"canMakePaymentFromConfig",void 0),e.assertValidConfig(t),this.name=t.name,this.content=t.content,this.edit=t.edit,this.paymentMethodId=t.paymentMethodId||this.name,this.supports={features:(null==t||null===(n=t.supports)||void 0===n?void 0:n.features)||["products"]},this.canMakePaymentFromConfig=t.canMakePayment}return p()(e,[{key:"canMakePayment",get:function(){return y(this.canMakePaymentFromConfig,this.supports.features,this.name)}}]),e}();f()(x,"assertValidConfig",(function(e){var t,n;if(v(e,["name","content","edit"]),"string"!=typeof e.name)throw new TypeError("The name property for the express payment method must be a string");if("string"!=typeof e.paymentMethodId&&void 0!==e.paymentMethodId)throw new Error("The paymentMethodId property for the payment method must be a string or undefined (in which case it will be the value of the name property).");if(void 0!==(null===(t=e.supports)||void 0===t?void 0:t.features)&&!Array.isArray(null===(n=e.supports)||void 0===n?void 0:n.features))throw new Error("The features property for the payment method must be an array or undefined.");if(b(e.content,"content"),b(e.edit,"edit"),"function"!=typeof e.canMakePayment)throw new TypeError("The canMakePayment property for the express payment method must be a function.")}));var O={},k={},P=function(e){var t;"function"==typeof e?(t=e(w),a()("Passing a callback to registerPaymentMethod()",{alternative:"a config options object",plugin:"woocommerce-gutenberg-products-block",link:"https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/3404"})):t=new w(e),t instanceof w&&(O[t.name]=t)},M=function(e){var t;"function"==typeof e?(t=e(x),a()("Passing a callback to registerExpressPaymentMethod()",{alternative:"a config options object",plugin:"woocommerce-gutenberg-products-block",link:"https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/3404"})):t=new x(e),t instanceof x&&(k[t.name]=t)},j=function(e,t){m[e]?console.error("The namespace provided to registerPaymentMethodExtensionCallbacks must be unique. Callbacks have already been registered for the ".concat(e," namespace.")):(m[e]={},Object.entries(t).forEach((function(t){var n=r()(t,2),o=n[0],i=n[1];"function"==typeof i?m[e][o]=i:console.error("All callbacks provided to registerPaymentMethodExtensionCallbacks must be functions. The callback for the ".concat(o," payment method in the ").concat(e," namespace was not a function."))})))},E=function(e){delete O[e]},T=function(e){delete k[e]},C=function(){return O},_=function(){return k},S=n(6),I=n.n(S),B={};function A(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function L(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?A(Object(n),!0).forEach((function(t){f()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):A(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function R(e){return L(L({},"object"===I()(B[e])&&Object.keys(B[e]).length>0?B[e]:{}),B.any)}function D(e){return a()("getRegisteredInnerBlocks",{version:"2.8.0",alternative:"getRegisteredBlockComponents",plugin:"WooCommerce Blocks"}),R(e)}function F(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function V(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?F(Object(n),!0).forEach((function(t){f()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):F(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function $(e){e.context||(e.context="any"),z(e,"context","string"),z(e,"blockName","string"),q(e,"component");var t=e.context,n=e.blockName,o=e.component;B[t]||(B[t]={}),B[t][n]=o}var q=function(e,t){if(e[t]){if("function"==typeof e[t])return;if(e[t].$$typeof&&e[t].$$typeof===Symbol.for("react.lazy"))return}throw new Error("Incorrect value for the ".concat(t," argument when registering a block component. Component must be a valid React Element or Lazy callback."))},z=function(e,t,n){var o=I()(e[t]);if(o!==n)throw new Error("Incorrect value for the ".concat(t," argument when registering a block component. It was a ").concat(o,", but must be a ").concat(n,"."))};function N(e){a()("registerInnerBlock",{version:"2.8.0",alternative:"registerBlockComponent",plugin:"WooCommerce Blocks",hint:'"main" has been replaced with "context" and is now optional.'}),z(e,"main","string"),$(V(V({},e),{},{context:e.main}))}},18:function(e,t,n){var o=n(19);e.exports=function(e,t){if(e){if("string"==typeof e)return o(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?o(e,t):void 0}},e.exports.default=e.exports,e.exports.__esModule=!0},19:function(e,t){e.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o},e.exports.default=e.exports,e.exports.__esModule=!0},20:function(e,t){e.exports=function(e){if(Array.isArray(e))return e},e.exports.default=e.exports,e.exports.__esModule=!0},21:function(e,t){e.exports=function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var o,r,i=[],_n=!0,a=!1;try{for(n=n.call(e);!(_n=(o=n.next()).done)&&(i.push(o.value),!t||i.length!==t);_n=!0);}catch(e){a=!0,r=e}finally{try{_n||null==n.return||n.return()}finally{if(a)throw r}}return i}},e.exports.default=e.exports,e.exports.__esModule=!0},22:function(e,t){e.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},e.exports.default=e.exports,e.exports.__esModule=!0},23:function(e,t){e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},e.exports.default=e.exports,e.exports.__esModule=!0},24:function(e,t){function n(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}e.exports=function(e,t,o){return t&&n(e.prototype,t),o&&n(e,o),e},e.exports.default=e.exports,e.exports.__esModule=!0},6:function(e,t){function n(t){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?(e.exports=n=function(e){return typeof e},e.exports.default=e.exports,e.exports.__esModule=!0):(e.exports=n=function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.default=e.exports,e.exports.__esModule=!0),n(t)}e.exports=n,e.exports.default=e.exports,e.exports.__esModule=!0},9:function(e,t){e.exports=window.wp.deprecated}});woocommerce-blocks/build/stock-filter.js000064400000056623151335517640014427 0ustar00this.wc=this.wc||{},this.wc.blocks=this.wc.blocks||{},this.wc.blocks["stock-filter"]=function(e){function t(t){for(var c,u,a=t[0],l=t[1],i=t[2],b=0,f=[];b<a.length;b++)u=a[b],Object.prototype.hasOwnProperty.call(r,u)&&r[u]&&f.push(r[u][0]),r[u]=0;for(c in l)Object.prototype.hasOwnProperty.call(l,c)&&(e[c]=l[c]);for(s&&s(t);f.length;)f.shift()();return o.push.apply(o,i||[]),n()}function n(){for(var e,t=0;t<o.length;t++){for(var n=o[t],c=!0,a=1;a<n.length;a++){var l=n[a];0!==r[l]&&(c=!1)}c&&(o.splice(t--,1),e=u(u.s=n[0]))}return e}var c={},r={40:0},o=[];function u(t){if(c[t])return c[t].exports;var n=c[t]={i:t,l:!1,exports:{}};return e[t].call(n.exports,n,n.exports,u),n.l=!0,n.exports}u.m=e,u.c=c,u.d=function(e,t,n){u.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},u.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},u.t=function(e,t){if(1&t&&(e=u(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(u.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var c in e)u.d(n,c,function(t){return e[t]}.bind(null,c));return n},u.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return u.d(t,"a",t),t},u.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},u.p="";var a=window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[],l=a.push.bind(a);a.push=t,a=a.slice();for(var i=0;i<a.length;i++)t(a[i]);var s=l;return o.push([803,0]),n()}({0:function(e,t){e.exports=window.wp.element},1:function(e,t){e.exports=window.wp.i18n},108:function(e,t,n){"use strict";n.d(t,"a",(function(){return p})),n.d(t,"b",(function(){return d})),n.d(t,"c",(function(){return O}));var c=n(8),r=n.n(c),o=n(24),u=n(14),a=n(0),l=n(34),i=n.n(l),s=n(62),b=n(136),f=n(78),p=function(e){var t=Object(f.a)();e=e||t;var n=Object(u.useSelect)((function(t){return t(o.QUERY_STATE_STORE_KEY).getValueForQueryContext(e,void 0)}),[e]),c=Object(u.useDispatch)(o.QUERY_STATE_STORE_KEY).setValueForQueryContext;return[n,Object(a.useCallback)((function(t){c(e,t)}),[e,c])]},d=function(e,t,n){var c=Object(f.a)();n=n||c;var r=Object(u.useSelect)((function(c){return c(o.QUERY_STATE_STORE_KEY).getValueForQueryKey(n,e,t)}),[n,e]),l=Object(u.useDispatch)(o.QUERY_STATE_STORE_KEY).setQueryValue;return[r,Object(a.useCallback)((function(t){l(n,e,t)}),[n,e,l])]},O=function(e,t){var n=Object(f.a)(),c=p(t=t||n),o=r()(c,2),u=o[0],l=o[1],d=Object(s.a)(u),O=Object(s.a)(e),v=Object(b.a)(O),j=Object(a.useRef)(!1);return Object(a.useEffect)((function(){i()(v,O)||(l(Object.assign({},d,O)),j.current=!0)}),[d,O,v,l]),j.current?[u,l]:[e,l]}},11:function(e,t){e.exports=window.React},12:function(e,t){e.exports=window.wp.blockEditor},127:function(e,t,n){"use strict";n.d(t,"a",(function(){return u}));var c=n(8),r=n.n(c),o=n(0),u=function(){var e=Object(o.useState)(),t=r()(e,2)[1];return Object(o.useCallback)((function(e){t((function(){throw e}))}),[])}},133:function(e,t,n){"use strict";var c=n(17),r=n.n(c),o=n(18),u=n.n(o),a=n(19),l=n.n(a),i=n(20),s=n.n(i),b=n(10),f=n.n(b),p=n(0),d=n(7),O=n(1),v=n(4);function j(e){var t=e.level,n={1:"M9 5h2v10H9v-4H5v4H3V5h2v4h4V5zm6.6 0c-.6.9-1.5 1.7-2.6 2v1h2v7h2V5h-1.4z",2:"M7 5h2v10H7v-4H3v4H1V5h2v4h4V5zm8 8c.5-.4.6-.6 1.1-1.1.4-.4.8-.8 1.2-1.3.3-.4.6-.8.9-1.3.2-.4.3-.8.3-1.3 0-.4-.1-.9-.3-1.3-.2-.4-.4-.7-.8-1-.3-.3-.7-.5-1.2-.6-.5-.2-1-.2-1.5-.2-.4 0-.7 0-1.1.1-.3.1-.7.2-1 .3-.3.1-.6.3-.9.5-.3.2-.6.4-.8.7l1.2 1.2c.3-.3.6-.5 1-.7.4-.2.7-.3 1.2-.3s.9.1 1.3.4c.3.3.5.7.5 1.1 0 .4-.1.8-.4 1.1-.3.5-.6.9-1 1.2-.4.4-1 .9-1.6 1.4-.6.5-1.4 1.1-2.2 1.6V15h8v-2H15z",3:"M12.1 12.2c.4.3.8.5 1.2.7.4.2.9.3 1.4.3.5 0 1-.1 1.4-.3.3-.1.5-.5.5-.8 0-.2 0-.4-.1-.6-.1-.2-.3-.3-.5-.4-.3-.1-.7-.2-1-.3-.5-.1-1-.1-1.5-.1V9.1c.7.1 1.5-.1 2.2-.4.4-.2.6-.5.6-.9 0-.3-.1-.6-.4-.8-.3-.2-.7-.3-1.1-.3-.4 0-.8.1-1.1.3-.4.2-.7.4-1.1.6l-1.2-1.4c.5-.4 1.1-.7 1.6-.9.5-.2 1.2-.3 1.8-.3.5 0 1 .1 1.6.2.4.1.8.3 1.2.5.3.2.6.5.8.8.2.3.3.7.3 1.1 0 .5-.2.9-.5 1.3-.4.4-.9.7-1.5.9v.1c.6.1 1.2.4 1.6.8.4.4.7.9.7 1.5 0 .4-.1.8-.3 1.2-.2.4-.5.7-.9.9-.4.3-.9.4-1.3.5-.5.1-1 .2-1.6.2-.8 0-1.6-.1-2.3-.4-.6-.2-1.1-.6-1.6-1l1.1-1.4zM7 9H3V5H1v10h2v-4h4v4h2V5H7v4z",4:"M9 15H7v-4H3v4H1V5h2v4h4V5h2v10zm10-2h-1v2h-2v-2h-5v-2l4-6h3v6h1v2zm-3-2V7l-2.8 4H16z",5:"M12.1 12.2c.4.3.7.5 1.1.7.4.2.9.3 1.3.3.5 0 1-.1 1.4-.4.4-.3.6-.7.6-1.1 0-.4-.2-.9-.6-1.1-.4-.3-.9-.4-1.4-.4H14c-.1 0-.3 0-.4.1l-.4.1-.5.2-1-.6.3-5h6.4v1.9h-4.3L14 8.8c.2-.1.5-.1.7-.2.2 0 .5-.1.7-.1.5 0 .9.1 1.4.2.4.1.8.3 1.1.6.3.2.6.6.8.9.2.4.3.9.3 1.4 0 .5-.1 1-.3 1.4-.2.4-.5.8-.9 1.1-.4.3-.8.5-1.3.7-.5.2-1 .3-1.5.3-.8 0-1.6-.1-2.3-.4-.6-.2-1.1-.6-1.6-1-.1-.1 1-1.5 1-1.5zM9 15H7v-4H3v4H1V5h2v4h4V5h2v10z",6:"M9 15H7v-4H3v4H1V5h2v4h4V5h2v10zm8.6-7.5c-.2-.2-.5-.4-.8-.5-.6-.2-1.3-.2-1.9 0-.3.1-.6.3-.8.5l-.6.9c-.2.5-.2.9-.2 1.4.4-.3.8-.6 1.2-.8.4-.2.8-.3 1.3-.3.4 0 .8 0 1.2.2.4.1.7.3 1 .6.3.3.5.6.7.9.2.4.3.8.3 1.3s-.1.9-.3 1.4c-.2.4-.5.7-.8 1-.4.3-.8.5-1.2.6-1 .3-2 .3-3 0-.5-.2-1-.5-1.4-.9-.4-.4-.8-.9-1-1.5-.2-.6-.3-1.3-.3-2.1s.1-1.6.4-2.3c.2-.6.6-1.2 1-1.6.4-.4.9-.7 1.4-.9.6-.3 1.1-.4 1.7-.4.7 0 1.4.1 2 .3.5.2 1 .5 1.4.8 0 .1-1.3 1.4-1.3 1.4zm-2.4 5.8c.2 0 .4 0 .6-.1.2 0 .4-.1.5-.2.1-.1.3-.3.4-.5.1-.2.1-.5.1-.7 0-.4-.1-.8-.4-1.1-.3-.2-.7-.3-1.1-.3-.3 0-.7.1-1 .2-.4.2-.7.4-1 .7 0 .3.1.7.3 1 .1.2.3.4.4.6.2.1.3.3.5.3.2.1.5.2.7.1z"};return n.hasOwnProperty(t)?Object(p.createElement)(v.SVG,{width:"20",height:"20",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"},Object(p.createElement)(v.Path,{d:n[t]})):null}var m=function(e){l()(o,e);var t,n,c=(t=o,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,c=f()(t);if(n){var r=f()(this).constructor;e=Reflect.construct(c,arguments,r)}else e=c.apply(this,arguments);return s()(this,e)});function o(){return r()(this,o),c.apply(this,arguments)}return u()(o,[{key:"createLevelControl",value:function(e,t,n){var c=e===t;return{icon:Object(p.createElement)(j,{level:e}),
/* translators: %s: heading level e.g: "2", "3", "4" */
title:Object(O.sprintf)(Object(O.__)("Heading %d"),e),isActive:c,onClick:function(){return n(e)}}}},{key:"render",value:function(){var e=this,t=this.props,n=t.isCollapsed,c=void 0===n||n,r=t.minLevel,o=t.maxLevel,u=t.selectedLevel,a=t.onChange;return Object(p.createElement)(v.ToolbarGroup,{isCollapsed:c,icon:Object(p.createElement)(j,{level:u}),controls:Object(d.range)(r,o).map((function(t){return e.createLevelControl(t,u,a)}))})}}]),o}(p.Component);t.a=m},136:function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));var c=n(11);function r(e,t){var n=Object(c.useRef)();return Object(c.useEffect)((function(){n.current===e||t&&!t(e,n.current)||(n.current=e)}),[e,t]),n.current}},14:function(e,t){e.exports=window.wp.data},145:function(e,t,n){"use strict";var c=n(0),r=n(1),o=n(41);n(363),t.a=function(e){var t=e.name,n=e.count;return Object(c.createElement)(c.Fragment,null,t,Number.isFinite(n)&&Object(c.createElement)(o.a,{label:n,screenReaderLabel:Object(r.sprintf)(
/* translators: %s number of products. */
Object(r._n)("%s product","%s products",n,'woocommerce'),n),wrapperElement:"span",wrapperProps:{className:"wc-filter-element-label-list-count"}}))}},157:function(e,t,n){"use strict";var c=n(0),r=(n(2),n(12)),o=n(21),u=n(1);n(217),t.a=Object(o.withInstanceId)((function(e){var t=e.className,n=e.headingLevel,o=e.onChange,a=e.heading,l=e.instanceId,i="h".concat(n);return Object(c.createElement)(i,{className:t},Object(c.createElement)("label",{className:"screen-reader-text",htmlFor:"block-title-".concat(l)},Object(u.__)("Block title",'woocommerce')),Object(c.createElement)(r.PlainText,{id:"block-title-".concat(l),className:"wc-block-editor-components-title",value:a,onChange:o}))}))},165:function(e,t,n){"use strict";n.d(t,"a",(function(){return l}));var c=n(24),r=n(14),o=n(0),u=n(62),a=n(127),l=function(e){var t=e.namespace,n=e.resourceName,l=e.resourceValues,i=void 0===l?[]:l,s=e.query,b=void 0===s?{}:s,f=e.shouldSelect,p=void 0===f||f;if(!t||!n)throw new Error("The options object must have valid values for the namespace and the resource properties.");var d=Object(o.useRef)({results:[],isLoading:!0}),O=Object(u.a)(b),v=Object(u.a)(i),j=Object(a.a)(),m=Object(r.useSelect)((function(e){if(!p)return null;var r=e(c.COLLECTIONS_STORE_KEY),o=[t,n,O,v],u=r.getCollectionError.apply(r,o);return u&&j(u),{results:r.getCollection.apply(r,o),isLoading:!r.hasFinishedResolution("getCollection",o)}}),[t,n,v,O,p]);return null!==m&&(d.current=m),d.current}},194:function(e,t,n){"use strict";var c=n(0),r=n(1),o=(n(2),n(6)),u=n.n(o),a=n(41),l=(n(257),function(e){var t=e.className,n=e.disabled,o=e.label,l=void 0===o?Object(r.__)("Go",'woocommerce'):o,i=e.onClick,s=e.screenReaderLabel,b=void 0===s?Object(r.__)("Apply filter",'woocommerce'):s;return Object(c.createElement)("button",{type:"submit",className:u()("wc-block-filter-submit-button","wc-block-components-filter-submit-button",t),disabled:n,onClick:i},Object(c.createElement)(a.a,{label:l,screenReaderLabel:b}))});l.defaultProps={disabled:!1},t.a=l},21:function(e,t){e.exports=window.wp.compose},217:function(e,t){},24:function(e,t){e.exports=window.wc.wcBlocksData},25:function(e,t){e.exports=window.wp.htmlEntities},257:function(e,t){},26:function(e,t){e.exports=window.wp.blocks},28:function(e,t){e.exports=window.wp.primitives},280:function(e,t,n){"use strict";var c=n(33),r=n.n(c),o=n(8),u=n.n(o),a=n(0),l=n(1),i=(n(2),n(6)),s=n.n(i);n(364),t.a=function(e){var t=e.className,n=e.onChange,c=void 0===n?function(){}:n,o=e.options,i=void 0===o?[]:o,b=e.checked,f=void 0===b?[]:b,p=e.isLoading,d=void 0!==p&&p,O=e.isDisabled,v=void 0!==O&&O,j=e.limit,m=void 0===j?10:j,h=Object(a.useState)(!1),w=u()(h,2),g=w[0],y=w[1],k=Object(a.useMemo)((function(){return r()(Array(5)).map((function(e,t){return Object(a.createElement)("li",{key:t,style:{width:Math.floor(75*Math.random())+25+"%"}})}))}),[]),E=Object(a.useMemo)((function(){var e=i.length-m;return!g&&Object(a.createElement)("li",{key:"show-more",className:"show-more"},Object(a.createElement)("button",{onClick:function(){y(!0)},"aria-expanded":!1,"aria-label":Object(l.sprintf)(
/* translators: %s is referring the remaining count of options */
Object(l._n)("Show %s more option","Show %s more options",e,'woocommerce'),e)},Object(l.sprintf)(
/* translators: %s number of options to reveal. */
Object(l._n)("Show %s more","Show %s more",e,'woocommerce'),e)))}),[i,m,g]),_=Object(a.useMemo)((function(){return g&&Object(a.createElement)("li",{key:"show-less",className:"show-less"},Object(a.createElement)("button",{onClick:function(){y(!1)},"aria-expanded":!0,"aria-label":Object(l.__)("Show less options",'woocommerce')},Object(l.__)("Show less",'woocommerce')))}),[g]),P=Object(a.useMemo)((function(){var e=i.length>m+5;return Object(a.createElement)(a.Fragment,null,i.map((function(t,n){return Object(a.createElement)(a.Fragment,{key:t.value},Object(a.createElement)("li",e&&!g&&n>=m&&{hidden:!0},Object(a.createElement)("input",{type:"checkbox",id:t.value,value:t.value,onChange:function(e){c(e.target.value)},checked:f.includes(t.value),disabled:v}),Object(a.createElement)("label",{htmlFor:t.value},t.label)),e&&n===m-1&&E)})),e&&_)}),[i,c,f,g,m,_,E,v]),S=s()("wc-block-checkbox-list","wc-block-components-checkbox-list",{"is-loading":d},t);return Object(a.createElement)("ul",{className:S},d?k:P)}},3:function(e,t){e.exports=window.wc.wcSettings},34:function(e,t){e.exports=window.wp.isShallowEqual},363:function(e,t){},364:function(e,t){},4:function(e,t){e.exports=window.wp.components},41:function(e,t,n){"use strict";var c=n(5),r=n.n(c),o=n(0),u=n(6),a=n.n(u);function l(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(e);t&&(c=c.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,c)}return n}function i(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?l(Object(n),!0).forEach((function(t){r()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):l(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}t.a=function(e){var t,n=e.label,c=e.screenReaderLabel,r=e.wrapperElement,u=e.wrapperProps,l=void 0===u?{}:u,s=null!=n,b=null!=c;return!s&&b?(t=r||"span",l=i(i({},l),{},{className:a()(l.className,"screen-reader-text")}),Object(o.createElement)(t,l,c)):(t=r||o.Fragment,s&&b&&n!==c?Object(o.createElement)(t,l,Object(o.createElement)("span",{"aria-hidden":"true"},n),Object(o.createElement)("span",{className:"screen-reader-text"},c)):Object(o.createElement)(t,l,n))}},493:function(e,t,n){"use strict";n.d(t,"a",(function(){return w}));var c=n(5),r=n.n(c),o=n(33),u=n.n(o),a=n(38),l=n.n(a),i=n(8),s=n.n(i),b=n(0),f=n(287),p=n(7),d=n(62),O=n(108),v=n(165),j=n(78);function m(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(e);t&&(c=c.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,c)}return n}function h(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?m(Object(n),!0).forEach((function(t){r()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):m(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var w=function(e){var t=e.queryAttribute,n=e.queryPrices,c=e.queryStock,r=e.queryState,o=Object(j.a)();o="".concat(o,"-collection-data");var a=Object(O.a)(o),i=s()(a,1)[0],m=Object(O.b)("calculate_attribute_counts",[],o),w=s()(m,2),g=w[0],y=w[1],k=Object(O.b)("calculate_price_range",null,o),E=s()(k,2),_=E[0],P=E[1],S=Object(O.b)("calculate_stock_status_counts",null,o),C=s()(S,2),x=C[0],N=C[1],H=Object(d.a)(t||{}),L=Object(d.a)(n),V=Object(d.a)(c);Object(b.useEffect)((function(){"object"===l()(H)&&Object.keys(H).length&&(g.find((function(e){return e.taxonomy===H.taxonomy}))||y([].concat(u()(g),[H])))}),[H,g,y]),Object(b.useEffect)((function(){_!==L&&void 0!==L&&P(L)}),[L,P,_]),Object(b.useEffect)((function(){x!==V&&void 0!==V&&N(V)}),[V,N,x]);var M=Object(b.useState)(!1),R=s()(M,2),F=R[0],T=R[1],D=Object(f.a)(F,200),z=s()(D,1)[0];F||T(!0);var B=Object(b.useMemo)((function(){return function(e){var t=e;return e.calculate_attribute_counts&&(t.calculate_attribute_counts=Object(p.sortBy)(e.calculate_attribute_counts.map((function(e){return{taxonomy:e.taxonomy,query_type:e.queryType}})),["taxonomy","query_type"])),t}(i)}),[i]);return Object(v.a)({namespace:"/wc/store",resourceName:"products/collection-data",query:h(h({},r),{},{page:void 0,per_page:void 0,orderby:void 0,order:void 0},B),shouldSelect:z})}},62:function(e,t,n){"use strict";n.d(t,"a",(function(){return u}));var c=n(0),r=n(34),o=n.n(r);function u(e){var t=Object(c.useRef)(e);return o()(e,t.current)||(t.current=e),t.current}},64:function(e,t){e.exports=window.wp.a11y},66:function(e,t,n){"use strict";var c=n(5),r=n.n(c),o=n(16),u=n.n(o),a=n(0),l=["srcElement","size"];function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(e);t&&(c=c.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,c)}return n}t.a=function(e){var t=e.srcElement,n=e.size,c=void 0===n?24:n,o=u()(e,l);return Object(a.isValidElement)(t)?Object(a.cloneElement)(t,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?i(Object(n),!0).forEach((function(t){r()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):i(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({width:c,height:c},o)):null}},7:function(e,t){e.exports=window.lodash},78:function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var c=n(0),r=Object(c.createContext)("page"),o=function(){return Object(c.useContext)(r)};r.Provider},798:function(e,t,n){"use strict";var c=n(0),r=n(28),o=Object(c.createElement)(r.SVG,{xmlns:"http://www.w3.org/2000/SVG",viewBox:"0 0 24 24"},Object(c.createElement)("path",{fill:"none",d:"M0 0h24v24H0V0z"}),Object(c.createElement)("path",{d:"M19 15v4H5v-4h14m1-2H4c-.55 0-1 .45-1 1v6c0 .55.45 1 1 1h16c.55 0 1-.45 1-1v-6c0-.55-.45-1-1-1zM7 18.5c-.82 0-1.5-.67-1.5-1.5s.68-1.5 1.5-1.5 1.5.67 1.5 1.5-.67 1.5-1.5 1.5zM19 5v4H5V5h14m1-2H4c-.55 0-1 .45-1 1v6c0 .55.45 1 1 1h16c.55 0 1-.45 1-1V4c0-.55-.45-1-1-1zM7 8.5c-.82 0-1.5-.67-1.5-1.5S6.18 5.5 7 5.5s1.5.68 1.5 1.5S7.83 8.5 7 8.5z"}));t.a=o},803:function(e,t,n){e.exports=n(867)},804:function(e,t){},805:function(e,t){},867:function(e,t,n){"use strict";n.r(t);var c=n(9),r=n.n(c),o=n(0),u=n(1),a=n(26),l=n(66),i=n(798),s=n(6),b=n.n(s),f=n(12),p=n(4),d=n(133),O=n(157),v=n(5),j=n.n(v),m=n(16),h=n.n(m),w=n(8),g=n.n(w),y=n(64),k=n(62),E=n(136),_=n(108),P=n(493),S=n(3),C=n(280),x=n(194),N=n(145),H=n(34),L=n.n(H),V=n(25),M=[{value:"preview-1",name:"In Stock",label:Object(o.createElement)(N.a,{name:"In Stock",count:3})},{value:"preview-2",name:"Out of sotck",label:Object(o.createElement)(N.a,{name:"Out of stock",count:3})},{value:"preview-3",name:"On backorder",label:Object(o.createElement)(N.a,{name:"On backorder",count:2})}],R=(n(805),["outofstock"]);function F(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(e);t&&(c=c.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,c)}return n}var T=function(e){var t=e.attributes,n=e.isEditor,c=void 0!==n&&n,r=Object(o.useState)(Object(S.getSetting)("hideOutOfStockItems",!1)),a=g()(r,1)[0],l=Object(o.useState)(Object(S.getSetting)("stockStatusOptions",{})),i=g()(l,1)[0],s=i.outofstock,b=h()(i,R),f=Object(o.useState)(a?b:function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?F(Object(n),!0).forEach((function(t){j()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):F(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({outofstock:s},b)),p=g()(f,1)[0],d=Object(o.useState)([]),O=g()(d,2),v=O[0],m=O[1],w=Object(o.useState)(t.isPreview?M:[]),H=g()(w,2),T=H[0],D=H[1],z=Object(o.useState)(Object.entries(p).map((function(e){var t=g()(e,2);return{slug:t[0],name:t[1]}})).filter((function(e){return!!e.name})).sort((function(e,t){return e.slug.localeCompare(t.slug)}))),B=g()(z,1)[0],A=Object(_.a)(),q=g()(A,1)[0],Y=Object(_.b)("stock_status",[]),I=g()(Y,2),Q=I[0],K=I[1],G=Object(P.a)({queryStock:!0,queryState:q}),U=G.results,W=G.isLoading,J=Object(o.useCallback)((function(e){return U.stock_status_counts?U.stock_status_counts.find((function(t){var n=t.status,c=t.count;return n===e&&0!==Number(c)})):null}),[U]);Object(o.useEffect)((function(){if(!W&&!t.isPreview){var e=B.map((function(e){var n,c=J(e.slug);if(!(c||v.includes(e.slug)||(n=e.slug,null!=q&&q.stock_status&&q.stock_status.some((function(e){var t=e.status;return(void 0===t?[]:t).includes(n)})))))return null;var r=c?Number(c.count):0;return{value:e.slug,name:Object(V.decodeEntities)(e.name),label:Object(o.createElement)(N.a,{name:Object(V.decodeEntities)(e.name),count:t.showCounts?r:null})}})).filter(Boolean);D(e)}}),[t.showCounts,t.isPreview,W,J,v,q.stock_status,B]);var X=Object(o.useCallback)((function(e){c||e&&K(v)}),[c,K,v]);Object(o.useEffect)((function(){t.showFilterButton||X(v)}),[t.showFilterButton,v,X]);var Z=Object(o.useMemo)((function(){return Q}),[Q]),$=Object(k.a)(Z),ee=Object(E.a)($);Object(o.useEffect)((function(){L()(ee,$)||L()(v,$)||m($)}),[v,$,ee]);var te=Object(o.useCallback)((function(e){var t=function(e){return T.find((function(t){return t.value===e})).name},n=function(e){var n=e.filterAdded,c=e.filterRemoved,r=n?t(n):null,o=c?t(c):null;r?Object(y.speak)(Object(u.sprintf)(
/* translators: %s stock statuses (for example: 'instock'...) */
Object(u.__)("%s filter added.",'woocommerce'),r)):o&&Object(y.speak)(Object(u.sprintf)(
/* translators: %s stock statuses (for example:'instock'...) */
Object(u.__)("%s filter removed.",'woocommerce'),o))},c=v.includes(e),r=v.filter((function(t){return t!==e}));c?n({filterRemoved:e}):(r.push(e),r.sort(),n({filterAdded:e})),m(r)}),[v,T]);if(0===T.length)return null;var ne="h".concat(t.headingLevel),ce=!t.isPreview&&!p,re=!t.isPreview&&W;return Object(o.createElement)(o.Fragment,null,!c&&t.heading&&Object(o.createElement)(ne,{className:"wc-block-stock-filter__title"},t.heading),Object(o.createElement)("div",{className:"wc-block-stock-filter"},Object(o.createElement)(C.a,{className:"wc-block-stock-filter-list",options:T,checked:v,onChange:te,isLoading:ce,isDisabled:re}),t.showFilterButton&&Object(o.createElement)(x.a,{className:"wc-block-stock-filter__button",disabled:ce||re,onClick:function(){return X(v)}})))},D=(n(804),Object(p.withSpokenMessages)((function(e){var t=e.attributes,n=e.setAttributes,c=t.className,r=t.heading,a=t.headingLevel,l=t.showCounts,i=t.showFilterButton;return Object(o.createElement)(o.Fragment,null,Object(o.createElement)(f.InspectorControls,{key:"inspector"},Object(o.createElement)(p.PanelBody,{title:Object(u.__)("Content",'woocommerce')},Object(o.createElement)(p.ToggleControl,{label:Object(u.__)("Product count",'woocommerce'),help:l?Object(u.__)("Product count is visible.",'woocommerce'):Object(u.__)("Product count is hidden.",'woocommerce'),checked:l,onChange:function(){return n({showCounts:!l})}}),Object(o.createElement)("p",null,Object(u.__)("Heading Level",'woocommerce')),Object(o.createElement)(d.a,{isCollapsed:!1,minLevel:2,maxLevel:7,selectedLevel:a,onChange:function(e){return n({headingLevel:e})}})),Object(o.createElement)(p.PanelBody,{title:Object(u.__)("Block Settings",'woocommerce')},Object(o.createElement)(p.ToggleControl,{label:Object(u.__)("Filter button",'woocommerce'),help:i?Object(u.__)("Products will only update when the button is pressed.",'woocommerce'):Object(u.__)("Products will update as options are selected.",'woocommerce'),checked:i,onChange:function(e){return n({showFilterButton:e})}}))),Object(o.createElement)("div",{className:b()("wc-block-stock-filter",c)},Object(o.createElement)(O.a,{className:"wc-block-stock-filter__title",headingLevel:a,heading:r,onChange:function(e){return n({heading:e})}}),Object(o.createElement)(p.Disabled,null,Object(o.createElement)(T,{attributes:t,isEditor:!0}))))})));Object(a.registerBlockType)("woocommerce/stock-filter",{title:Object(u.__)("Filter Products by Stock",'woocommerce'),icon:{src:Object(o.createElement)(l.a,{srcElement:i.a}),foreground:"#96588a"},category:"woocommerce",keywords:[Object(u.__)("WooCommerce",'woocommerce')],description:Object(u.__)("Allow customers to filter the grid by products stock status. Works in combination with the All Products block.",'woocommerce'),supports:{html:!1,multiple:!1},example:{attributes:{isPreview:!0}},attributes:{heading:{type:"string",default:Object(u.__)("Filter by stock status",'woocommerce')},headingLevel:{type:"number",default:3},showCounts:{type:"boolean",default:!0},showFilterButton:{type:"boolean",default:!1},isPreview:{type:"boolean",default:!1}},edit:D,save:function(e){var t=e.attributes,n=t.className,c=t.showCounts,u=t.heading,a=t.headingLevel,l=t.showFilterButton,i={"data-show-counts":c,"data-heading":u,"data-heading-level":a};return l&&(i["data-show-filter-button"]=l),Object(o.createElement)("div",r()({className:b()("is-loading",n)},i),Object(o.createElement)("span",{"aria-hidden":!0,className:"wc-block-product-stock-filter__placeholder"}))}})}});woocommerce-blocks/build/cart-blocks/items-frontend.js000064400000000655151335517640017155 0ustar00(window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[26],{330:function(c,e,n){"use strict";var a=n(6),t=n.n(a);n(10),e.a=function(c){var e=c.children,n=c.className;return React.createElement("div",{className:t()("wc-block-components-main",n)},e)}},399:function(c,e,n){"use strict";n.r(e);var a=n(330);e.default=function(c){var e=c.children;return React.createElement(a.a,{className:"wc-block-cart__main"},e)}}}]);woocommerce-blocks/build/cart-blocks/checkout-button-frontend.js000064400000014655151335517640021157 0ustar00(window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[22],{143:function(t,e,n){"use strict";var c=n(14),a=n.n(c),r=n(23),o=n.n(r),i=n(76),s=n(6),l=n.n(s),u=n(138),d=(n(251),["className","showSpinner","children"]);e.a=function(t){var e=t.className,n=t.showSpinner,c=void 0!==n&&n,r=t.children,s=o()(t,d),m=l()("wc-block-components-button",e,{"wc-block-components-button--loading":c});return React.createElement(i.a,a()({className:m},s),c&&React.createElement(u.a,null),React.createElement("span",{className:"wc-block-components-button__text"},r))}},187:function(t,e,n){"use strict";n.d(e,"b",(function(){return o})),n.d(e,"a",(function(){return i}));var c=n(53),a=n(173),r=function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=Object(a.b)(),n=e.paymentMethods,r=e.expressPaymentMethods,o=e.paymentMethodsInitialized,i=e.expressPaymentMethodsInitialized,s=Object(c.a)(n),l=Object(c.a)(r);return{paymentMethods:t?l:s,isInitialized:t?i:o}},o=function(){return r(!1)},i=function(){return r(!0)}},192:function(t,e,n){"use strict";var c=n(14),a=n.n(c),r=n(4),o=n.n(r),i=n(6),s=n.n(i),l=function(t){return"wc-block-components-payment-method-icon wc-block-components-payment-method-icon--".concat(t)},u=function(t){var e=t.id,n=t.src,c=void 0===n?null:n,a=t.alt,r=void 0===a?"":a;return c?React.createElement("img",{className:l(e),src:c,alt:r}):null},d=n(83),m=[{id:"alipay",alt:"Alipay",src:d.l+"payment-methods/alipay.svg"},{id:"amex",alt:"American Express",src:d.l+"payment-methods/amex.svg"},{id:"bancontact",alt:"Bancontact",src:d.l+"payment-methods/bancontact.svg"},{id:"diners",alt:"Diners Club",src:d.l+"payment-methods/diners.svg"},{id:"discover",alt:"Discover",src:d.l+"payment-methods/discover.svg"},{id:"eps",alt:"EPS",src:d.l+"payment-methods/eps.svg"},{id:"giropay",alt:"Giropay",src:d.l+"payment-methods/giropay.svg"},{id:"ideal",alt:"iDeal",src:d.l+"payment-methods/ideal.svg"},{id:"jcb",alt:"JCB",src:d.l+"payment-methods/jcb.svg"},{id:"laser",alt:"Laser",src:d.l+"payment-methods/laser.svg"},{id:"maestro",alt:"Maestro",src:d.l+"payment-methods/maestro.svg"},{id:"mastercard",alt:"Mastercard",src:d.l+"payment-methods/mastercard.svg"},{id:"multibanco",alt:"Multibanco",src:d.l+"payment-methods/multibanco.svg"},{id:"p24",alt:"Przelewy24",src:d.l+"payment-methods/p24.svg"},{id:"sepa",alt:"Sepa",src:d.l+"payment-methods/sepa.svg"},{id:"sofort",alt:"Sofort",src:d.l+"payment-methods/sofort.svg"},{id:"unionpay",alt:"Union Pay",src:d.l+"payment-methods/unionpay.svg"},{id:"visa",alt:"Visa",src:d.l+"payment-methods/visa.svg"},{id:"wechat",alt:"WeChat",src:d.l+"payment-methods/wechat.svg"}],p=n(21),b=n.n(p),f=n(49);function v(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(t);e&&(c=c.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,c)}return n}function y(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?v(Object(n),!0).forEach((function(e){o()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):v(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}n(265),e.a=function(t){var e=t.icons,n=void 0===e?[]:e,c=t.align,r=void 0===c?"center":c,o=function(t){var e={};return t.forEach((function(t){var n={};"string"==typeof t&&(n={id:t,alt:t,src:null}),"object"===b()(t)&&(n={id:t.id||"",alt:t.alt||"",src:t.src||null}),n.id&&Object(f.c)(n.id)&&!e[n.id]&&(e[n.id]=n)})),Object.values(e)}(n);if(0===o.length)return null;var i=s()("wc-block-components-payment-method-icons",{"wc-block-components-payment-method-icons--align-left":"left"===r,"wc-block-components-payment-method-icons--align-right":"right"===r});return React.createElement("div",{className:i},o.map((function(t){var e,n=y(y({},t),(e=t.id,m.find((function(t){return t.id===e}))||{}));return React.createElement(u,a()({key:"payment-method-icon-"+t.id},n))})))}},251:function(t,e){},265:function(t,e){},273:function(t,e){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(t){"object"==typeof window&&(n=window)}t.exports=n},302:function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var c=n(5),a=n.n(c),r=n(0),o={bottom:0,left:0,opacity:0,pointerEvents:"none",position:"absolute",right:0,top:0,zIndex:-1},i=function(){var t=Object(r.useState)(""),e=a()(t,2),n=e[0],c=e[1],i=Object(r.useRef)(null),s=Object(r.useRef)(new IntersectionObserver((function(t){t[0].isIntersecting?c("visible"):c(t[0].boundingClientRect.top>0?"below":"above")}),{threshold:1}));return Object(r.useLayoutEffect)((function(){var t=i.current,e=s.current;return t&&e.observe(t),function(){e.unobserve(t)}}),[]),[React.createElement("div",{"aria-hidden":!0,ref:i,style:o}),n]}},345:function(t,e,n){"use strict";var c=n(14),a=n.n(c),r=n(188);e.a=function(t){return function(e){return function(n){var c=Object(r.a)(t,n);return React.createElement(e,a()({},n,c))}}}},385:function(t,e,n){"use strict";(function(t){var c=n(5),a=n.n(c),r=n(1),o=n(0),i=n(192),s=n(143),l=n(83),u=n(48),d=n(187),m=n(302),p=(n(386),function(t){return Object.values(t).reduce((function(t,e){return null!==e.icons&&(t=t.concat(e.icons)),t}),[])});e.a=function(e){var n=e.link,c=Object(u.b)().isCalculating,b=Object(m.a)(),f=a()(b,2),v=f[0],y=f[1],h=Object(o.useState)(!1),g=a()(h,2),w=g[0],O=g[1],j=Object(d.b)().paymentMethods;Object(o.useEffect)((function(){if("function"==typeof t.addEventListener&&"function"==typeof t.removeEventListener){var e=function(){O(!1)};return t.addEventListener("pageshow",e),function(){t.removeEventListener("pageshow",e)}}}),[]);var k=React.createElement(React.Fragment,null,React.createElement(s.a,{className:"wc-block-cart__submit-button",href:n||l.d,disabled:c,onClick:function(){return O(!0)},showSpinner:w},Object(r.__)("Proceed to Checkout",'woocommerce')),React.createElement(i.a,{icons:p(j)}));return React.createElement("div",{className:"wc-block-cart__submit"},v,React.createElement("div",{className:"wc-block-cart__submit-container"},k),"below"===y&&React.createElement("div",{className:"wc-block-cart__submit-container wc-block-cart__submit-container--sticky"},k))}}).call(this,n(273))},386:function(t,e){},415:function(t,e,n){"use strict";n.r(e);var c=n(345),a=n(2),r=n(385);e.default=Object(c.a)({checkoutPageId:{type:"number",default:0},lock:{type:"object",default:{move:!0,remove:!0}}})((function(t){var e=t.checkoutPageId;return React.createElement(r.a,{link:Object(a.getSetting)("page-"+e,!1)})}))}}]);woocommerce-blocks/build/cart-blocks/filled-cart-frontend.js000064400000003145151335517640020217 0ustar00(window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[25],{189:function(e,t){},201:function(e,t,a){"use strict";a.d(t,"b",(function(){return u})),a.d(t,"a",(function(){return m}));var i=a(5),n=a.n(i),s=(a(10),a(0)),c=a(24),r=a(6),o=a.n(r),l=Object(s.createContext)({hasContainerWidth:!1,containerClassName:"",isMobile:!1,isSmall:!1,isMedium:!1,isLarge:!1}),u=function(){return Object(s.useContext)(l)},m=function(e){var t=e.children,a=e.className,i=void 0===a?"":a,s=function(){var e=Object(c.useResizeObserver)(),t=n()(e,2),a=t[0],i=t[1].width,s="";return i>700?s="is-large":i>520?s="is-medium":i>400?s="is-small":i&&(s="is-mobile"),[a,s]}(),r=n()(s,2),u=r[0],m=r[1],d={hasContainerWidth:""!==m,containerClassName:m,isMobile:"is-mobile"===m,isSmall:"is-small"===m,isMedium:"is-medium"===m,isLarge:"is-large"===m};return React.createElement(l.Provider,{value:d},React.createElement("div",{className:o()(i,m)},u,t))}},277:function(e,t,a){"use strict";var i=a(6),n=a.n(i),s=(a(10),a(201));a(189),t.a=function(e){var t=e.children,a=e.className;return React.createElement(s.a,{className:n()("wc-block-components-sidebar-layout",a)},t)}},397:function(e,t,a){"use strict";a.r(t);var i=a(6),n=a.n(i),s=a(277),c=a(32),r=a(54),o=a(0),l=a(28);t.default=function(e){var t=e.children,a=Object(c.a)(),i=a.cartItems,u=a.cartIsLoading,m=a.cartItemErrors,d=Object(r.a)().addErrorNotice;return Object(o.useEffect)((function(){m.forEach((function(e){d(Object(l.decodeEntities)(e.message),{isDismissible:!0,id:e.code})}))}),[d,m]),u||i.length>=1?React.createElement(s.a,{className:n()("wc-block-cart",{"has-dark-controls":!1})},t):null}}}]);woocommerce-blocks/build/cart-blocks/order-summary-frontend.js000064400000065072151335517640020646 0ustar00(window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[28],{143:function(e,t,n){"use strict";var c=n(14),a=n.n(c),o=n(23),r=n.n(o),s=n(76),i=n(6),l=n.n(i),p=n(138),u=(n(251),["className","showSpinner","children"]);t.a=function(e){var t=e.className,n=e.showSpinner,c=void 0!==n&&n,o=e.children,i=r()(e,u),d=l()("wc-block-components-button",t,{"wc-block-components-button--loading":c});return React.createElement(s.a,a()({className:d},i),c&&React.createElement(p.a,null),React.createElement("span",{className:"wc-block-components-button__text"},o))}},147:function(e,t){},149:function(e,t){},152:function(e,t,n){"use strict";var c=n(4),a=n.n(c),o=n(23),r=n.n(o),s=n(0),i=["srcElement","size"];function l(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(e);t&&(c=c.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,c)}return n}t.a=function(e){var t=e.srcElement,n=e.size,c=void 0===n?24:n,o=r()(e,i);return Object(s.isValidElement)(t)?Object(s.cloneElement)(t,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?l(Object(n),!0).forEach((function(t){a()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):l(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({width:c,height:c},o)):null}},174:function(e,t,n){"use strict";t.a=function(e){var t=e.label,n=e.secondaryLabel,c=e.description,a=e.secondaryDescription,o=e.id;return React.createElement("div",{className:"wc-block-components-radio-control__option-layout"},React.createElement("div",{className:"wc-block-components-radio-control__label-group"},t&&React.createElement("span",{id:o&&"".concat(o,"__label"),className:"wc-block-components-radio-control__label"},t),n&&React.createElement("span",{id:o&&"".concat(o,"__secondary-label"),className:"wc-block-components-radio-control__secondary-label"},n)),React.createElement("div",{className:"wc-block-components-radio-control__description-group"},c&&React.createElement("span",{id:o&&"".concat(o,"__description"),className:"wc-block-components-radio-control__description"},c),a&&React.createElement("span",{id:o&&"".concat(o,"__secondary-description"),className:"wc-block-components-radio-control__secondary-description"},a)))}},175:function(e,t,n){"use strict";var c=n(14),a=n.n(c),o=n(23),r=n.n(o),s=n(6),i=n.n(s),l=(n(10),n(248),["children","className","headingLevel"]);t.a=function(e){var t=e.children,n=e.className,c=e.headingLevel,o=r()(e,l),s=i()("wc-block-components-title",n),p="h".concat(c);return React.createElement(p,a()({className:s},o),t)}},179:function(e,t,n){"use strict";var c=n(4),a=n.n(c),o=n(6),r=n.n(o),s=n(174);t.a=function(e){var t,n=e.checked,c=e.name,o=e.onChange,i=e.option,l=i.value,p=i.label,u=i.description,d=i.secondaryLabel,b=i.secondaryDescription;return React.createElement("label",{className:r()("wc-block-components-radio-control__option",{"wc-block-components-radio-control__option-checked":n}),htmlFor:"".concat(c,"-").concat(l)},React.createElement("input",{id:"".concat(c,"-").concat(l),className:"wc-block-components-radio-control__input",type:"radio",name:c,value:l,onChange:function(e){return o(e.target.value)},checked:n,"aria-describedby":r()((t={},a()(t,"".concat(c,"-").concat(l,"__label"),p),a()(t,"".concat(c,"-").concat(l,"__secondary-label"),d),a()(t,"".concat(c,"-").concat(l,"__description"),u),a()(t,"".concat(c,"-").concat(l,"__secondary-description"),b),t))}),React.createElement(s.a,{id:"".concat(c,"-").concat(l),label:p,secondaryLabel:d,description:u,secondaryDescription:b}))}},194:function(e,t,n){"use strict";var c=n(14),a=n.n(c),o=n(23),r=n.n(o),s=(n(10),n(6)),i=n.n(s),l=n(1),p=n(152),u=n(216),d=(n(149),["text","screenReaderText","element","className","radius","children"]),b=function(e){var t=e.text,n=e.screenReaderText,c=void 0===n?"":n,o=e.element,s=void 0===o?"li":o,l=e.className,p=void 0===l?"":l,u=e.radius,b=void 0===u?"small":u,m=e.children,g=void 0===m?null:m,f=r()(e,d),h=s,v=i()(p,"wc-block-components-chip","wc-block-components-chip--radius-"+b),O=Boolean(c&&c!==t);return React.createElement(h,a()({className:v},f),React.createElement("span",{"aria-hidden":O,className:"wc-block-components-chip__text"},t),O&&React.createElement("span",{className:"screen-reader-text"},c),g)},m=["ariaLabel","className","disabled","onRemove","removeOnAnyClick","text","screenReaderText"];t.a=function(e){var t=e.ariaLabel,n=void 0===t?"":t,c=e.className,o=void 0===c?"":c,s=e.disabled,d=void 0!==s&&s,g=e.onRemove,f=void 0===g?function(){}:g,h=e.removeOnAnyClick,v=void 0!==h&&h,O=e.text,R=e.screenReaderText,_=void 0===R?"":R,w=r()(e,m),j=v?"span":"button";if(!n){var E=_&&"string"==typeof _?_:O;n="string"!=typeof E?
/* translators: Remove chip. */
Object(l.__)("Remove",'woocommerce'):Object(l.sprintf)(
/* translators: %s text of the chip to remove. */
Object(l.__)('Remove "%s"','woocommerce'),E)}var y={"aria-label":n,disabled:d,onClick:f,onKeyDown:function(e){"Backspace"!==e.key&&"Delete"!==e.key||f()}},k=v?y:{},C=v?{"aria-hidden":!0}:y;return React.createElement(b,a()({},w,k,{className:i()(o,"is-removable"),element:v?"button":w.element,screenReaderText:_,text:O}),React.createElement(j,a()({className:"wc-block-components-chip__remove"},C),React.createElement(p.a,{className:"wc-block-components-chip__remove-icon",srcElement:u.a,size:16})))}},207:function(e,t,n){"use strict";var c=n(6),a=n.n(c),o=n(24),r=n(179);n(252),t.a=Object(o.withInstanceId)((function(e){var t=e.className,n=e.instanceId,c=e.id,o=e.selected,s=e.onChange,i=e.options,l=void 0===i?[]:i,p=c||n;return l.length&&React.createElement("div",{className:a()("wc-block-components-radio-control",t)},l.map((function(e){return React.createElement(r.a,{key:"".concat(p,"-").concat(e.value),name:"radio-control-".concat(p),checked:e.value===o,option:e,onChange:function(t){s(t),"function"==typeof e.onChange&&e.onChange(t)}})})))}))},208:function(e,t){},209:function(e,t,n){"use strict";var c=n(23),a=n.n(c),o=n(1),r=n(0),s=n(33),i=n(105),l=n(26),p=n(326),u=n(32),d=n(36),b=n(6),m=n.n(b),g=n(28),f=n(51),h=n(5),v=n.n(h),O=n(25),R=n.n(O),_=n(118),w=n(52),j=function(e){var t;return null===(t=e.find((function(e){return e.selected})))||void 0===t?void 0:t.rate_id},E=n(207),y=n(174),k=n(58),C=n(69),S=n(2),N=function(e){var t=Object(S.getSetting)("displayCartPricesIncludingTax",!1)?parseInt(e.price,10)+parseInt(e.taxes,10):parseInt(e.price,10);return{label:Object(g.decodeEntities)(e.name),value:e.rate_id,description:React.createElement(React.Fragment,null,Number.isFinite(t)&&React.createElement(C.a,{currency:Object(k.getCurrencyFromPriceResponse)(e),value:t}),Number.isFinite(t)&&e.delivery_time?" — ":null,Object(g.decodeEntities)(e.delivery_time))}},x=function(e){var t=e.className,n=e.noResultsMessage,c=e.onSelectRate,a=e.rates,o=e.renderOption,r=void 0===o?N:o,s=e.selected;if(0===a.length)return n;if(a.length>1)return React.createElement(E.a,{className:t,onChange:function(e){c(e)},selected:s,options:a.map(r)});var i=r(a[0]),l=i.label,p=i.secondaryLabel,u=i.description,d=i.secondaryDescription;return React.createElement(y.a,{label:l,secondaryLabel:p,description:u,secondaryDescription:d})},I=(n(253),function(e){var t=e.packageId,n=e.className,c=e.noResultsMessage,a=e.renderOption,s=e.packageData,i=e.collapsible,p=void 0!==i&&i,u=e.collapse,d=void 0!==u&&u,b=e.showItems,h=void 0!==b&&b,O=function(e,t){var n=Object(w.a)().dispatchCheckoutEvent,c=Object(_.a)(),a=c.selectShippingRate,o=c.isSelectingRate,s=Object(r.useState)((function(){return j(t)})),i=v()(s,2),l=i[0],p=i[1],u=Object(r.useRef)(t);return Object(r.useEffect)((function(){R()(u.current,t)||(u.current=t,p(j(t)))}),[t]),{selectShippingRate:Object(r.useCallback)((function(t){p(t),a(t,e),n("set-selected-shipping-rate",{shippingRateId:t})}),[e,a,n]),selectedShippingRate:l,isSelectingRate:o}}(t,s.shipping_rates),E=O.selectShippingRate,y=O.selectedShippingRate,k=React.createElement(React.Fragment,null,(h||p)&&React.createElement("div",{className:"wc-block-components-shipping-rates-control__package-title"},s.name),h&&React.createElement("ul",{className:"wc-block-components-shipping-rates-control__package-items"},Object.values(s.items).map((function(e){var t=Object(g.decodeEntities)(e.name),n=e.quantity;return React.createElement("li",{key:e.key,className:"wc-block-components-shipping-rates-control__package-item"},React.createElement(f.a,{label:n>1?"".concat(t," × ").concat(n):"".concat(t),screenReaderLabel:Object(o.sprintf)(
/* translators: %1$s name of the product (ie: Sunglasses), %2$d number of units in the current cart package */
Object(o._n)("%1$s (%2$d unit)","%1$s (%2$d units)",n,'woocommerce'),t,n)}))})))),C=React.createElement(x,{className:n,noResultsMessage:c,rates:s.shipping_rates,onSelectRate:E,selected:y,renderOption:a});return p?React.createElement(l.Panel,{className:"wc-block-components-shipping-rates-control__package",initialOpen:!d,title:k},C):React.createElement("div",{className:m()("wc-block-components-shipping-rates-control__package",n)},k,C)}),P=["package_id"],T=["extensions","receiveCart"],L=function(e){var t=e.packages,n=e.collapse,c=e.showItems,o=e.collapsible,r=e.noResultsMessage,s=e.renderOption;return t.length?React.createElement(React.Fragment,null,t.map((function(e){var t=e.package_id,i=a()(e,P);return React.createElement(I,{key:t,packageId:t,packageData:i,collapsible:o,collapse:n,showItems:c,noResultsMessage:r,renderOption:s})}))):null};t.a=function(e){var t=e.shippingRates,n=e.shippingRatesLoading,c=e.className,b=e.collapsible,m=void 0!==b&&b,g=e.noResultsMessage,f=e.renderOption;Object(r.useEffect)((function(){if(!n){var e=Object(p.a)(t),c=Object(p.b)(t);1===e?Object(s.speak)(Object(o.sprintf)(
/* translators: %d number of shipping options found. */
Object(o._n)("%d shipping option was found.","%d shipping options were found.",c,'woocommerce'),c)):Object(s.speak)(Object(o.sprintf)(
/* translators: %d number of shipping packages packages. */
Object(o._n)("Shipping option searched for %d package.","Shipping options searched for %d packages.",e,'woocommerce'),e)+" "+Object(o.sprintf)(
/* translators: %d number of shipping options available. */
Object(o._n)("%d shipping option was found","%d shipping options were found",c,'woocommerce'),c))}}),[n,t]);var h=Object(u.a)(),v=h.extensions,O=(h.receiveCart,{className:c,collapsible:m,noResultsMessage:g,renderOption:f,extensions:v,cart:a()(h,T),components:{ShippingRatesControlPackage:I}}),R=Object(d.a)().isEditor;return React.createElement(i.a,{isLoading:n,screenReaderLabel:Object(o.__)("Loading shipping rates…",'woocommerce'),showSpinner:!0},R?React.createElement(L,{packages:t,noResultsMessage:g,renderOption:f}):React.createElement(React.Fragment,null,React.createElement(l.ExperimentalOrderShippingPackages.Slot,O),React.createElement(l.ExperimentalOrderShippingPackages,null,React.createElement(L,{packages:t,noResultsMessage:g,renderOption:f}))))}},214:function(e,t,n){"use strict";n.d(t,"a",(function(){return h}));var c=n(4),a=n.n(c),o=n(1),r=n(11),s=n(8),i=n(28),l=n(32),p=n(0),u=n(226);function d(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(e);t&&(c=c.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,c)}return n}function b(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?d(Object(n),!0).forEach((function(t){a()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):d(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var m=n(127),g=n(54);function f(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(e);t&&(c=c.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,c)}return n}var h=function(){var e=Object(l.a)(),t=e.cartCoupons,n=e.cartIsLoading,c=Object(g.a)().addErrorNotice,d=function(){var e=Object(u.b)(),t=e.notices,n=e.createSnackbarNotice,c=e.removeSnackbarNotice,a=e.setIsSuppressed,o=Object(p.useRef)(t);Object(p.useEffect)((function(){o.current=t}),[t]);var r=Object(p.useMemo)((function(){return{removeNotices:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;o.current.forEach((function(t){null!==e&&t.status!==e||c(t.id)}))},removeSnackbarNotice:c}}),[c]),s=Object(p.useMemo)((function(){return{addSnackbarNotice:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};n(e,t)}}}),[n]);return b(b(b({notices:t},r),s),{},{setIsSuppressed:a})}().addSnackbarNotice,h=Object(m.b)().setValidationErrors;return function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?f(Object(n),!0).forEach((function(t){a()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):f(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({appliedCoupons:t,isLoading:n},Object(r.useSelect)((function(e,t){var n=t.dispatch,a=e(s.CART_STORE_KEY),r=a.isApplyingCoupon(),l=a.isRemovingCoupon(),p=n(s.CART_STORE_KEY),u=p.applyCoupon,b=p.removeCoupon,m=p.receiveApplyingCoupon;return{applyCoupon:function(e){u(e).then((function(t){!0===t&&d(Object(o.sprintf)(
/* translators: %s coupon code. */
Object(o.__)('Coupon code "%s" has been applied to your cart.','woocommerce'),e),{id:"coupon-form"})})).catch((function(e){h({coupon:{message:Object(i.decodeEntities)(e.message),hidden:!1}}),m("")}))},removeCoupon:function(e){b(e).then((function(t){!0===t&&d(Object(o.sprintf)(
/* translators: %s coupon code. */
Object(o.__)('Coupon code "%s" has been removed from your cart.','woocommerce'),e),{id:"coupon-form"})})).catch((function(e){c(e.message,{id:"coupon-form"}),m("")}))},isApplyingCoupon:r,isRemovingCoupon:l}}),[c,d]))}},216:function(e,t,n){"use strict";var c=n(14),a=n.n(c),o=n(23),r=n.n(o),s=n(34),i=["className","size"],l=function(e){var t=e.className,n=e.size,c=r()(e,i);return React.createElement(s.SVG,a()({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",className:t,width:n,height:n},c),React.createElement("path",{d:"M14.95 6.46L11.41 10l3.54 3.54-1.41 1.41L10 11.42l-3.53 3.53-1.42-1.42L8.58 10 5.05 6.47l1.42-1.42L10 8.58l3.54-3.53z"}))},p=React.createElement(l,null);t.a=p},248:function(e,t){},251:function(e,t){},252:function(e,t){},253:function(e,t){},256:function(e,t){},257:function(e,t){},259:function(e,t){},263:function(e,t){},326:function(e,t,n){"use strict";n.d(t,"a",(function(){return c})),n.d(t,"b",(function(){return a}));var c=function(e){return e.length},a=function(e){return e.reduce((function(e,t){return e+t.shipping_rates.length}),0)}},332:function(e,t,n){"use strict";var c=n(1),a=n(105),o=n(194),r=(n(10),n(26)),s=n(2),i=(n(256),{context:"summary"});t.a=function(e){var t=e.cartCoupons,n=void 0===t?[]:t,l=e.currency,p=e.isRemovingCoupon,u=e.removeCoupon,d=e.values,b=d.total_discount,m=d.total_discount_tax,g=parseInt(b,10);if(!g&&0===n.length)return null;var f=parseInt(m,10),h=Object(s.getSetting)("displayCartPricesIncludingTax",!1)?g+f:g,v=Object(r.__experimentalApplyCheckoutFilter)({arg:i,filterName:"coupons",defaultValue:n});return React.createElement(r.TotalsItem,{className:"wc-block-components-totals-discount",currency:l,description:0!==v.length&&React.createElement(a.a,{screenReaderLabel:Object(c.__)("Removing coupon…",'woocommerce'),isLoading:p,showSpinner:!1},React.createElement("ul",{className:"wc-block-components-totals-discount__coupon-list"},v.map((function(e){return React.createElement(o.a,{key:"coupon-"+e.code,className:"wc-block-components-totals-discount__coupon-list-item",text:e.label,screenReaderText:Object(c.sprintf)(
/* translators: %s Coupon code. */
Object(c.__)("Coupon: %s",'woocommerce'),e.label),disabled:p,onRemove:function(){u(e.code)},radius:"large",ariaLabel:Object(c.sprintf)(
/* translators: %s is a coupon code. */
Object(c.__)('Remove coupon "%s"','woocommerce'),e.label)})})))),label:h?Object(c.__)("Discount",'woocommerce'):Object(c.__)("Coupons",'woocommerce'),value:h?-1*h:"-"})}},333:function(e,t,n){"use strict";var c=n(5),a=n.n(c),o=n(1),r=n(0),s=n(143),i=n(276),l=n(51),p=n(105),u=(n(10),n(24)),d=n(127),b=n(258),m=n(26);n(257),t.a=Object(u.withInstanceId)((function(e){var t=e.instanceId,n=e.isLoading,c=void 0!==n&&n,u=e.initialOpen,g=void 0!==u&&u,f=e.onSubmit,h=void 0===f?function(){}:f,v=Object(r.useState)(""),O=a()(v,2),R=O[0],_=O[1],w=Object(r.useRef)(!1),j=Object(d.b)(),E=j.getValidationError,y=j.getValidationErrorId,k=E("coupon");Object(r.useEffect)((function(){w.current!==c&&(c||!R||k||_(""),w.current=c)}),[c,R,k]);var C="wc-block-components-totals-coupon__input-".concat(t);return React.createElement(m.Panel,{className:"wc-block-components-totals-coupon",hasBorder:!1,initialOpen:g,title:React.createElement(l.a,{label:Object(o.__)("Coupon code",'woocommerce'),screenReaderLabel:Object(o.__)("Apply a coupon code",'woocommerce'),htmlFor:C})},React.createElement(p.a,{screenReaderLabel:Object(o.__)("Applying coupon…",'woocommerce'),isLoading:c,showSpinner:!1},React.createElement("div",{className:"wc-block-components-totals-coupon__content"},React.createElement("form",{className:"wc-block-components-totals-coupon__form"},React.createElement(i.a,{id:C,errorId:"coupon",className:"wc-block-components-totals-coupon__input",label:Object(o.__)("Enter code",'woocommerce'),value:R,ariaDescribedBy:y(C),onChange:function(e){_(e)},validateOnMount:!1,focusOnMount:!0,showError:!1}),React.createElement(s.a,{className:"wc-block-components-totals-coupon__button",disabled:c||!R,showSpinner:c,onClick:function(e){e.preventDefault(),h(R)},type:"submit"},Object(o.__)("Apply",'woocommerce'))),React.createElement(b.a,{propertyName:"coupon",elementId:C}))))}))},334:function(e,t,n){"use strict";var c=n(23),a=n.n(c),o=n(1),r=n(0),s=n(69),i=(n(10),n(26)),l=n(32),p=n(2),u=(n(263),["receiveCart"]);t.a=function(e){var t=e.currency,n=e.values,c=Object(p.getSetting)("taxesEnabled",!0)&&Object(p.getSetting)("displayCartPricesIncludingTax",!1),d=n.total_price,b=n.total_tax,m=Object(l.a)(),g=(m.receiveCart,a()(m,u)),f=Object(i.__experimentalApplyCheckoutFilter)({filterName:"totalLabel",defaultValue:Object(o.__)("Total",'woocommerce'),extensions:g.extensions,arg:{cart:g}}),h=parseInt(b,10);return React.createElement(i.TotalsItem,{className:"wc-block-components-totals-footer-item",currency:t,label:f,value:parseInt(d,10),description:c&&0!==h&&React.createElement("p",{className:"wc-block-components-totals-footer-item-tax"},Object(r.createInterpolateElement)(Object(o.__)("Including <TaxAmount/> in taxes",'woocommerce'),{TaxAmount:React.createElement(s.a,{className:"wc-block-components-totals-footer-item-tax-value",currency:t,value:h})}))})}},336:function(e,t,n){"use strict";var c=n(14),a=n.n(c),o=n(5),r=n.n(o),s=n(6),i=n.n(s),l=n(1),p=n(0),u=n(32),d=n(26),b=n(2),m=function(e){var t=e.selectedShippingRates;return React.createElement("div",{className:"wc-block-components-totals-item__description wc-block-components-totals-shipping__via"},Object(l.__)("via",'woocommerce')," ",t.join(", "))},g=n(153),f=n(209),h=function(e){var t=e.hasRates,n=e.shippingRates,c=e.shippingRatesLoading,a=t?Object(l.__)("Shipping options",'woocommerce'):Object(l.__)("Choose a shipping option",'woocommerce');return React.createElement("fieldset",{className:"wc-block-components-totals-shipping__fieldset"},React.createElement("legend",{className:"screen-reader-text"},a),React.createElement(f.a,{className:"wc-block-components-totals-shipping__options",collapsible:!0,noResultsMessage:React.createElement(g.a,{isDismissible:!1,className:i()("wc-block-components-shipping-rates-control__no-results-notice","woocommerce-error")},Object(l.__)("No shipping options were found.",'woocommerce')),shippingRates:n,shippingRatesLoading:c}))},v=n(66),O=n(143),R=n(25),_=n.n(R),w=n(127),j=(n(208),n(335)),E=function(e){var t=e.address,n=e.onUpdate,c=e.addressFields,a=Object(p.useState)(t),o=r()(a,2),s=o[0],i=o[1],u=Object(w.b)(),d=u.hasValidationErrors,b=u.showAllValidationErrors;return React.createElement("form",{className:"wc-block-components-shipping-calculator-address"},React.createElement(j.a,{fields:c,onChange:i,values:s}),React.createElement(O.a,{className:"wc-block-components-shipping-calculator-address__button",disabled:_()(s,t),onClick:function(e){if(e.preventDefault(),b(),!d)return n(s)},type:"submit"},Object(l.__)("Update",'woocommerce')))},y=function(e){var t=e.onUpdate,n=void 0===t?function(){}:t,c=e.addressFields,a=void 0===c?["country","state","city","postcode"]:c,o=Object(v.b)(),r=o.shippingAddress,s=o.setShippingAddress;return React.createElement("div",{className:"wc-block-components-shipping-calculator"},React.createElement(E,{address:r,addressFields:a,onUpdate:function(e){s(e),n(e)}}))},k=n(21),C=n.n(k),S=n(28),N=function(e){var t=e.address;if(0===Object.values(t).length)return null;var n=Object(b.getSetting)("shippingCountries",{}),c=Object(b.getSetting)("shippingStates",{}),a="string"==typeof n[t.country]?Object(S.decodeEntities)(n[t.country]):"",o="object"===C()(c[t.country])&&"string"==typeof c[t.country][t.state]?Object(S.decodeEntities)(c[t.country][t.state]):t.state,r=[];r.push(t.postcode.toUpperCase()),r.push(t.city),r.push(o),r.push(a);var s=r.filter(Boolean).join(", ");return s?React.createElement("span",{className:"wc-block-components-shipping-address"},Object(l.sprintf)(
/* translators: %s location. */
Object(l.__)("Shipping to %s",'woocommerce'),s)+" "):null},x=(n(259),function(e){var t=e.label,n=void 0===t?Object(l.__)("Calculate",'woocommerce'):t,c=e.isShippingCalculatorOpen,a=e.setIsShippingCalculatorOpen;return React.createElement("button",{className:"wc-block-components-totals-shipping__change-address-button",onClick:function(){a(!c)},"aria-expanded":c},n)}),I=function(e){var t=e.showCalculator,n=e.isShippingCalculatorOpen,c=e.setIsShippingCalculatorOpen,a=e.shippingAddress;return React.createElement(React.Fragment,null,React.createElement(N,{address:a}),t&&React.createElement(x,{label:Object(l.__)("(change address)",'woocommerce'),isShippingCalculatorOpen:n,setIsShippingCalculatorOpen:c}))},P=function(e){var t=e.showCalculator,n=e.isShippingCalculatorOpen,c=e.setIsShippingCalculatorOpen;return t?React.createElement(x,{isShippingCalculatorOpen:n,setIsShippingCalculatorOpen:c}):React.createElement("em",null,Object(l.__)("Calculated during checkout",'woocommerce'))};t.a=function(e){var t=e.currency,n=e.values,c=e.showCalculator,o=void 0===c||c,s=e.showRateSelector,g=void 0===s||s,f=e.className,v=Object(p.useState)(!1),O=r()(v,2),R=O[0],_=O[1],w=Object(u.a)(),j=w.shippingAddress,E=w.cartHasCalculatedShipping,k=w.shippingRates,C=w.shippingRatesLoading,S=Object(b.getSetting)("displayCartPricesIncludingTax",!1)?parseInt(n.total_shipping,10)+parseInt(n.total_shipping_tax,10):parseInt(n.total_shipping,10),N=k.some((function(e){return e.shipping_rates.length}))||S,x={isShippingCalculatorOpen:R,setIsShippingCalculatorOpen:_},T=k.flatMap((function(e){return e.shipping_rates.filter((function(e){return e.selected})).flatMap((function(e){return e.name}))}));return React.createElement("div",{className:i()("wc-block-components-totals-shipping",f)},React.createElement(d.TotalsItem,{label:Object(l.__)("Shipping",'woocommerce'),value:E?S:React.createElement(P,a()({showCalculator:o},x)),description:React.createElement(React.Fragment,null,E&&React.createElement(React.Fragment,null,React.createElement(m,{selectedShippingRates:T}),React.createElement(I,a()({shippingAddress:j,showCalculator:o},x)))),currency:t}),o&&R&&React.createElement(y,{onUpdate:function(){_(!1)}}),g&&E&&React.createElement(h,{hasRates:N,shippingRates:k,shippingRatesLoading:C}))}},401:function(e,t,n){"use strict";n.r(t);var c=n(23),a=n.n(c),o=n(1),r=n(332),s=n(333),i=n(336),l=n(334),p=n(26),u=n(58),d=n(32),b=n(214),m=n(2),g=n(175),f=["extensions"];t.default=function(e){var t=e.showRateAfterTaxName,n=void 0!==t&&t,c=e.isShippingCalculatorEnabled,h=void 0===c||c,v=Object(d.a)(),O=v.cartFees,R=v.cartTotals,_=v.cartNeedsShipping,w=Object(b.a)(),j=w.applyCoupon,E=w.removeCoupon,y=w.isApplyingCoupon,k=w.isRemovingCoupon,C=w.appliedCoupons,S=Object(u.getCurrencyFromPriceResponse)(R),N=Object(d.a)(),x=N.extensions,I=a()(N,f),P={extensions:x,cart:I},T={extensions:x,cart:I};return React.createElement(React.Fragment,null,React.createElement(g.a,{headingLevel:"2",className:"wc-block-cart__totals-title"},Object(o.__)("Cart totals",'woocommerce')),React.createElement(p.TotalsWrapper,null,React.createElement(p.Subtotal,{currency:S,values:R}),React.createElement(p.TotalsFees,{currency:S,cartFees:O}),React.createElement(r.a,{cartCoupons:C,currency:S,isRemovingCoupon:k,removeCoupon:E,values:R})),Object(m.getSetting)("couponsEnabled",!0)&&React.createElement(p.TotalsWrapper,null,React.createElement(s.a,{onSubmit:j,isLoading:y})),React.createElement(p.ExperimentalDiscountsMeta.Slot,T),_&&React.createElement(p.TotalsWrapper,null,React.createElement(i.a,{showCalculator:h,showRateSelector:!0,values:R,currency:S})),!Object(m.getSetting)("displayCartPricesIncludingTax",!1)&&parseInt(R.total_tax,10)>0&&React.createElement(p.TotalsWrapper,null,React.createElement(p.TotalsTaxes,{showRateAfterTaxName:n,currency:S,values:R})),React.createElement(p.TotalsWrapper,null,React.createElement(l.a,{currency:S,values:R})),React.createElement(p.ExperimentalOrderMeta.Slot,P))}},69:function(e,t,n){"use strict";var c=n(14),a=n.n(c),o=n(4),r=n.n(o),s=n(23),i=n.n(s),l=n(126),p=n(6),u=n.n(p),d=(n(147),["className","value","currency","onValueChange","displayType"]);function b(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(e);t&&(c=c.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,c)}return n}function m(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?b(Object(n),!0).forEach((function(t){r()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):b(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}t.a=function(e){var t=e.className,n=e.value,c=e.currency,o=e.onValueChange,r=e.displayType,s=void 0===r?"text":r,p=i()(e,d),b="string"==typeof n?parseInt(n,10):n;if(!Number.isFinite(b))return null;var g=b/Math.pow(10,c.minorUnit);if(!Number.isFinite(g))return null;var f=u()("wc-block-formatted-money-amount","wc-block-components-formatted-money-amount",t),h=m(m(m({},p),function(e){return{thousandSeparator:e.thousandSeparator,decimalSeparator:e.decimalSeparator,decimalScale:e.minorUnit,fixedDecimalScale:!0,prefix:e.prefix,suffix:e.suffix,isNumericString:!0}}(c)),{},{value:void 0,currency:void 0,onValueChange:void 0}),v=o?function(e){var t=e.value*Math.pow(10,c.minorUnit);o(t)}:function(){};return React.createElement(l.a,a()({className:f,displayType:s},h,{value:g,onValueChange:v}))}}}]);order-summary--checkout-blocks/billing-address--checkout-blocks/shipping-address-frontend.js000064400000026664151335517640035370 0ustar00woocommerce-blocks/build/cart-blocks(window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[4],{206:function(e,t){},250:function(e,t){},258:function(e,t,r){"use strict";r.d(t,"a",(function(){return n})),r(10);var a=r(127),n=(r(250),function(e){var t=e.errorMessage,r=void 0===t?"":t,n=e.propertyName,o=void 0===n?"":n,c=e.elementId,i=void 0===c?"":c,l=Object(a.b)(),s=l.getValidationError,u=l.getValidationErrorId;if(!r||"string"!=typeof r){var d=s(o)||{};if(!d.message||d.hidden)return null;r=d.message}return React.createElement("div",{className:"wc-block-components-validation-error",role:"alert"},React.createElement("p",{id:u(i)},r))})},260:function(e,t){},261:function(e,t){},262:function(e,t){},276:function(e,t,r){"use strict";var a=r(14),n=r.n(a),o=r(4),c=r.n(o),i=r(5),l=r.n(i),s=r(23),u=r.n(s),d=r(1),p=r(3),b=r(6),f=r.n(b),m=r(127),g=r(48),v=r(258),h=r(24),O=r(49),y=r(0),j=r(51),E=(r(206),["className","id","type","ariaLabel","ariaDescribedBy","label","screenReaderLabel","disabled","help","autoCapitalize","autoComplete","value","onChange","required","onBlur","feedback"]),C=Object(p.forwardRef)((function(e,t){var r=e.className,a=e.id,o=e.type,c=void 0===o?"text":o,i=e.ariaLabel,s=e.ariaDescribedBy,d=e.label,p=e.screenReaderLabel,b=e.disabled,m=e.help,g=e.autoCapitalize,v=void 0===g?"off":g,h=e.autoComplete,O=void 0===h?"off":h,C=e.value,k=void 0===C?"":C,w=e.onChange,R=e.required,N=void 0!==R&&R,P=e.onBlur,I=void 0===P?function(){}:P,M=e.feedback,L=u()(e,E),q=Object(y.useState)(!1),_=l()(q,2),V=_[0],D=_[1];return React.createElement("div",{className:f()("wc-block-components-text-input",r,{"is-active":V||k})},React.createElement("input",n()({type:c,id:a,value:k,ref:t,autoCapitalize:v,autoComplete:O,onChange:function(e){w(e.target.value)},onFocus:function(){return D(!0)},onBlur:function(e){I(e.target.value),D(!1)},"aria-label":i||d,disabled:b,"aria-describedby":m&&!s?a+"__help":s,required:N},L)),React.createElement(j.a,{label:d,screenReaderLabel:p||d,wrapperElement:"label",wrapperProps:{htmlFor:a},htmlFor:a}),!!m&&React.createElement("p",{id:a+"__help",className:"wc-block-components-text-input__help"},m),M)})),k=["className","instanceId","id","ariaDescribedBy","errorId","validateOnMount","focusOnMount","onChange","showError","errorMessage"];t.a=Object(h.withInstanceId)((function(e){var t=e.className,r=e.instanceId,a=e.id,o=e.ariaDescribedBy,i=e.errorId,s=e.validateOnMount,b=void 0===s||s,h=e.focusOnMount,y=void 0!==h&&h,j=e.onChange,E=e.showError,w=void 0===E||E,R=e.errorMessage,N=void 0===R?"":R,P=u()(e,k),I=Object(p.useState)(!0),M=l()(I,2),L=M[0],q=M[1],_=Object(p.useRef)(null),V=Object(m.b)(),D=V.getValidationError,x=V.hideValidationError,B=V.setValidationErrors,U=V.clearValidationError,F=V.getValidationErrorId,S=Object(g.b)().isBeforeProcessing,z=void 0!==a?a:"textinput-"+r,W=void 0!==i?i:z,H=Object(p.useCallback)((function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=_.current||null;if(t){t.value=t.value.trim();var r=t.checkValidity();r?U(W):B(c()({},W,{message:t.validationMessage||Object(d.__)("Invalid value.",'woocommerce'),hidden:e}))}}),[U,W,B]);Object(p.useEffect)((function(){var e;L&&(y&&(null===(e=_.current)||void 0===e||e.focus()),q(!1))}),[y,L,q]),Object(p.useEffect)((function(){L&&(b&&H(),q(!1))}),[L,q,b,H]),Object(p.useEffect)((function(){S&&H()}),[S,H]),Object(p.useEffect)((function(){return function(){U(W)}}),[U,W]);var J=D(W)||{};Object(O.c)(N)&&""!==N&&(J.message=N);var A=J.message&&!J.hidden,G=w&&A&&F(W)?F(W):o;return React.createElement(C,n()({className:f()(t,{"has-error":A}),"aria-invalid":!0===A,id:z,onBlur:function(){H(!1)},feedback:w&&React.createElement(v.a,{errorMessage:N,propertyName:W}),ref:_,onChange:function(e){x(W),j(e)},ariaDescribedBy:G},P))}))},335:function(e,t,r){"use strict";var a=r(4),n=r.n(a),o=r(276),c=r(14),i=r.n(c),l=r(83),s=r(0),u=r(1),d=r(28),p=r(6),b=r.n(p),f=r(24),m=r(340),g=r(127),v=r(258),h=r(49),O=(r(261),Object(f.withInstanceId)((function(e){var t=e.id,r=e.className,a=e.label,o=e.onChange,c=e.options,i=e.value,l=e.required,d=void 0!==l&&l,p=e.errorMessage,f=void 0===p?Object(u.__)("Please select a value.",'woocommerce'):p,O=e.errorId,y=e.instanceId,j=void 0===y?"0":y,E=e.autoComplete,C=void 0===E?"off":E,k=Object(g.b)(),w=k.getValidationError,R=k.setValidationErrors,N=k.clearValidationError,P=Object(s.useRef)(null),I=t||"control-"+j,M=O||I,L=w(M)||{message:"",hidden:!1};return Object(s.useEffect)((function(){return!d||i?N(M):R(n()({},M,{message:f,hidden:!0})),function(){N(M)}}),[N,i,M,f,d,R]),React.createElement("div",{id:I,className:b()("wc-block-components-combobox",r,{"is-active":i,"has-error":L.message&&!L.hidden}),ref:P},React.createElement(m.a,{className:"wc-block-components-combobox-control",label:a,onChange:o,onFilterValueChange:function(e){if(e.length){var t=Object(h.b)(P.current)?P.current.ownerDocument.activeElement:void 0;if(t&&Object(h.b)(P.current)&&P.current.contains(t))return;var r=e.toLocaleUpperCase(),a=c.find((function(e){return e.label.toLocaleUpperCase().startsWith(r)||e.value.toLocaleUpperCase()===r}));a&&o(a.value)}},options:c,value:i||"",allowReset:!1,autoComplete:C,"aria-invalid":L.message&&!L.hidden}),React.createElement(v.a,{propertyName:M}))}))),y=(r(260),function(e){var t=e.className,r=e.countries,a=e.id,n=e.label,o=e.onChange,c=e.value,i=void 0===c?"":c,l=e.autoComplete,p=void 0===l?"off":l,f=e.required,m=void 0!==f&&f,g=e.errorId,v=e.errorMessage,h=void 0===v?Object(u.__)("Please select a country.",'woocommerce'):v,y=Object(s.useMemo)((function(){return Object.keys(r).map((function(e){return{value:e,label:Object(d.decodeEntities)(r[e])}}))}),[r]);return React.createElement("div",{className:b()(t,"wc-block-components-country-input")},React.createElement(O,{id:a,label:n,onChange:o,options:y,value:i,errorId:g,errorMessage:h,required:m,autoComplete:p}),"off"!==p&&React.createElement("input",{type:"text","aria-hidden":!0,autoComplete:p,value:i,onChange:function(e){var t=e.target.value.toLocaleUpperCase(),r=y.find((function(e){return 2!==t.length&&e.label.toLocaleUpperCase()===t||2===t.length&&e.value.toLocaleUpperCase()===t}));o(r?r.value:"")},style:{minHeight:"0",height:"0",border:"0",padding:"0",position:"absolute"},tabIndex:-1}))}),j=function(e){return React.createElement(y,i()({countries:l.g},e))},E=function(e){return React.createElement(y,i()({countries:l.a},e))},C=(r(262),function(e,t){var r=t.find((function(t){return t.label.toLocaleUpperCase()===e.toLocaleUpperCase()||t.value.toLocaleUpperCase()===e.toLocaleUpperCase()}));return r?r.value:""}),k=function(e){var t=e.className,r=e.id,a=e.states,n=e.country,c=e.label,i=e.onChange,l=e.autoComplete,p=void 0===l?"off":l,f=e.value,m=void 0===f?"":f,g=e.required,v=void 0!==g&&g,h=a[n],y=Object(s.useMemo)((function(){return h?Object.keys(h).map((function(e){return{value:e,label:Object(d.decodeEntities)(h[e])}})):[]}),[h]),j=Object(s.useCallback)((function(e){i(y.length>0?C(e,y):e)}),[i,y]),E=Object(s.useRef)(m);return Object(s.useEffect)((function(){E.current!==m&&(E.current=m)}),[m]),Object(s.useEffect)((function(){if(y.length>0&&E.current){var e=C(E.current,y);e!==E.current&&j(e)}}),[y,j]),y.length>0?React.createElement(React.Fragment,null,React.createElement(O,{className:b()(t,"wc-block-components-state-input"),id:r,label:c,onChange:j,options:y,value:m,errorMessage:Object(u.__)("Please select a state.",'woocommerce'),required:v,autoComplete:p}),"off"!==p&&React.createElement("input",{type:"text","aria-hidden":!0,autoComplete:p,value:m,onChange:function(e){return j(e.target.value)},style:{minHeight:"0",height:"0",border:"0",padding:"0",position:"absolute"},tabIndex:-1})):React.createElement(o.a,{className:t,id:r,label:c,onChange:j,autoComplete:p,value:m,required:v})},w=function(e){return React.createElement(k,i()({states:l.h},e))},R=function(e){return React.createElement(k,i()({states:l.b},e))},N=r(53),P=r(2),I=r(87);function M(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,a)}return r}function L(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?M(Object(r),!0).forEach((function(t){n()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):M(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}t.a=Object(f.withInstanceId)((function(e){var t=e.id,r=e.fields,a=void 0===r?Object.keys(P.defaultAddressFields):r,c=e.fieldConfig,i=void 0===c?{}:c,l=e.instanceId,d=e.onChange,p=e.type,b=void 0===p?"shipping":p,f=e.values,m=Object(g.b)(),v=m.getValidationError,h=m.setValidationErrors,O=m.clearValidationError,y=Object(N.a)(a),C=v("shipping-missing-country")||{},k=Object(s.useMemo)((function(){return Object(I.a)(y,i,f.country)}),[y,i,f.country]);return Object(s.useEffect)((function(){k.forEach((function(e){e.hidden&&f[e.key]&&d(L(L({},f),{},n()({},e.key,"")))}))}),[k,d,f]),Object(s.useEffect)((function(){"shipping"===b&&function(e,t,r,a){a||e.country||!(e.city||e.state||e.postcode)||t({"shipping-missing-country":{message:Object(u.__)("Please select a country to calculate rates.",'woocommerce'),hidden:!1}}),a&&e.country&&r("shipping-missing-country")}(f,h,O,!!C.message&&!C.hidden)}),[f,C.message,C.hidden,h,O,b]),t=t||l,React.createElement("div",{id:t,className:"wc-block-components-address-form"},k.map((function(e){if(e.hidden)return null;if("country"===e.key){var r="shipping"===b?j:E;return React.createElement(r,{key:e.key,id:"".concat(t,"-").concat(e.key),label:e.required?e.label:e.optionalLabel,value:f.country,autoComplete:e.autocomplete,onChange:function(e){return d(L(L({},f),{},{country:e,state:""}))},errorId:"shipping"===b?"shipping-missing-country":null,errorMessage:e.errorMessage,required:e.required})}if("state"===e.key){var a="shipping"===b?w:R;return React.createElement(a,{key:e.key,id:"".concat(t,"-").concat(e.key),country:f.country,label:e.required?e.label:e.optionalLabel,value:f.state,autoComplete:e.autocomplete,onChange:function(e){return d(L(L({},f),{},{state:e}))},errorMessage:e.errorMessage,required:e.required})}return React.createElement(o.a,{key:e.key,id:"".concat(t,"-").concat(e.key),className:"wc-block-components-address-form__".concat(e.key),label:e.required?e.label:e.optionalLabel,value:f[e.key],autoCapitalize:e.autocapitalize,autoComplete:e.autocomplete,onChange:function(t){return d(L(L({},f),{},n()({},e.key,t)))},errorMessage:e.errorMessage,required:e.required})})))}))},51:function(e,t,r){"use strict";var a=r(4),n=r.n(a),o=r(0),c=r(6),i=r.n(c);function l(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,a)}return r}function s(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?l(Object(r),!0).forEach((function(t){n()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):l(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}t.a=function(e){var t,r=e.label,a=e.screenReaderLabel,n=e.wrapperElement,c=e.wrapperProps,l=void 0===c?{}:c,u=null!=r,d=null!=a;return!u&&d?(t=n||"span",l=s(s({},l),{},{className:i()(l.className,"screen-reader-text")}),React.createElement(t,l,a)):(t=n||o.Fragment,u&&d&&r!==a?React.createElement(t,l,React.createElement("span",{"aria-hidden":"true"},r),React.createElement("span",{className:"screen-reader-text"},a)):React.createElement(t,l,r))}}}]);woocommerce-blocks/build/cart-blocks/empty-cart-frontend.js000064400000000713151335517640020114 0ustar00(window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[23],{398:function(e,c,t){"use strict";t.r(c);var n=t(32),o=t(0),r=t(137);c.default=function(e){var c=e.children,t=Object(n.a)(),a=t.cartItems,l=t.cartIsLoading;return Object(o.useEffect)((function(){Object(r.a)("wc-blocks_render_blocks_frontend",{element:document.body.querySelector(".wp-block-woocommerce-cart")})}),[]),l||0!==a.length?null:React.createElement(React.Fragment,null,c)}}}]);cart-blocks/express-payment--checkout-blocks/express-payment--checkout-blocks/payment-frontend.js000064400000033674151335517640034237 0ustar00woocommerce-blocks/build(window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[3],{187:function(e,t,n){"use strict";n.d(t,"b",(function(){return a})),n.d(t,"a",(function(){return s}));var r=n(53),o=n(173),c=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=Object(o.b)(),n=t.paymentMethods,c=t.expressPaymentMethods,a=t.paymentMethodsInitialized,s=t.expressPaymentMethodsInitialized,i=Object(r.a)(n),l=Object(r.a)(c);return{paymentMethods:e?l:i,isInitialized:e?s:a}},a=function(){return c(!1)},s=function(){return c(!0)}},192:function(e,t,n){"use strict";var r=n(14),o=n.n(r),c=n(4),a=n.n(c),s=n(6),i=n.n(s),l=function(e){return"wc-block-components-payment-method-icon wc-block-components-payment-method-icon--".concat(e)},p=function(e){var t=e.id,n=e.src,r=void 0===n?null:n,o=e.alt,c=void 0===o?"":o;return r?React.createElement("img",{className:l(t),src:r,alt:c}):null},u=n(83),d=[{id:"alipay",alt:"Alipay",src:u.l+"payment-methods/alipay.svg"},{id:"amex",alt:"American Express",src:u.l+"payment-methods/amex.svg"},{id:"bancontact",alt:"Bancontact",src:u.l+"payment-methods/bancontact.svg"},{id:"diners",alt:"Diners Club",src:u.l+"payment-methods/diners.svg"},{id:"discover",alt:"Discover",src:u.l+"payment-methods/discover.svg"},{id:"eps",alt:"EPS",src:u.l+"payment-methods/eps.svg"},{id:"giropay",alt:"Giropay",src:u.l+"payment-methods/giropay.svg"},{id:"ideal",alt:"iDeal",src:u.l+"payment-methods/ideal.svg"},{id:"jcb",alt:"JCB",src:u.l+"payment-methods/jcb.svg"},{id:"laser",alt:"Laser",src:u.l+"payment-methods/laser.svg"},{id:"maestro",alt:"Maestro",src:u.l+"payment-methods/maestro.svg"},{id:"mastercard",alt:"Mastercard",src:u.l+"payment-methods/mastercard.svg"},{id:"multibanco",alt:"Multibanco",src:u.l+"payment-methods/multibanco.svg"},{id:"p24",alt:"Przelewy24",src:u.l+"payment-methods/p24.svg"},{id:"sepa",alt:"Sepa",src:u.l+"payment-methods/sepa.svg"},{id:"sofort",alt:"Sofort",src:u.l+"payment-methods/sofort.svg"},{id:"unionpay",alt:"Union Pay",src:u.l+"payment-methods/unionpay.svg"},{id:"visa",alt:"Visa",src:u.l+"payment-methods/visa.svg"},{id:"wechat",alt:"WeChat",src:u.l+"payment-methods/wechat.svg"}],h=n(21),m=n.n(h),b=n(49);function g(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function f(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?g(Object(n),!0).forEach((function(t){a()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):g(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}n(265),t.a=function(e){var t=e.icons,n=void 0===t?[]:t,r=e.align,c=void 0===r?"center":r,a=function(e){var t={};return e.forEach((function(e){var n={};"string"==typeof e&&(n={id:e,alt:e,src:null}),"object"===m()(e)&&(n={id:e.id||"",alt:e.alt||"",src:e.src||null}),n.id&&Object(b.c)(n.id)&&!t[n.id]&&(t[n.id]=n)})),Object.values(t)}(n);if(0===a.length)return null;var s=i()("wc-block-components-payment-method-icons",{"wc-block-components-payment-method-icons--align-left":"left"===c,"wc-block-components-payment-method-icons--align-right":"right"===c});return React.createElement("div",{className:s},a.map((function(e){var t,n=f(f({},e),(t=e.id,d.find((function(e){return e.id===t}))||{}));return React.createElement(p,o()({key:"payment-method-icon-"+e.id},n))})))}},213:function(e,t,n){"use strict";var r=n(40),o=n.n(r),c=n(41),a=n.n(c),s=n(29),i=n.n(s),l=n(42),p=n.n(l),u=n(43),d=n.n(u),h=n(30),m=n.n(h),b=n(4),g=n.n(b),f=n(1),v=n(3),y=(n(10),n(2)),O=n(78);var j=function(e){p()(c,e);var t,n,r=(t=c,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=m()(t);if(n){var o=m()(this).constructor;e=Reflect.construct(r,arguments,o)}else e=r.apply(this,arguments);return d()(this,e)});function c(){var e;o()(this,c);for(var t=arguments.length,n=new Array(t),a=0;a<t;a++)n[a]=arguments[a];return e=r.call.apply(r,[this].concat(n)),g()(i()(e),"state",{errorMessage:"",hasError:!1}),e}return a()(c,[{key:"render",value:function(){var e=this.state,t=e.hasError,n=e.errorMessage,r=this.props.isEditor;if(t){var o=Object(f.__)("This site is experiencing difficulties with this payment method. Please contact the owner of the site for assistance.",'woocommerce');(r||y.CURRENT_USER_IS_ADMIN)&&(o=n||Object(f.__)("There was an error with this payment method. Please verify it's configured correctly.",'woocommerce'));var c=[{id:"0",content:o,isDismissible:!1,status:"error"}];return React.createElement(O.StoreNoticesContainer,{notices:c})}return this.props.children}}],[{key:"getDerivedStateFromError",value:function(e){return{errorMessage:e.message,hasError:!0}}}]),c}(v.Component);j.defaultProps={isEditor:!1},t.a=j},214:function(e,t,n){"use strict";n.d(t,"a",(function(){return f}));var r=n(4),o=n.n(r),c=n(1),a=n(11),s=n(8),i=n(28),l=n(32),p=n(0),u=n(226);function d(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function h(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?d(Object(n),!0).forEach((function(t){o()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):d(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var m=n(127),b=n(54);function g(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}var f=function(){var e=Object(l.a)(),t=e.cartCoupons,n=e.cartIsLoading,r=Object(b.a)().addErrorNotice,d=function(){var e=Object(u.b)(),t=e.notices,n=e.createSnackbarNotice,r=e.removeSnackbarNotice,o=e.setIsSuppressed,c=Object(p.useRef)(t);Object(p.useEffect)((function(){c.current=t}),[t]);var a=Object(p.useMemo)((function(){return{removeNotices:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;c.current.forEach((function(t){null!==e&&t.status!==e||r(t.id)}))},removeSnackbarNotice:r}}),[r]),s=Object(p.useMemo)((function(){return{addSnackbarNotice:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};n(e,t)}}}),[n]);return h(h(h({notices:t},a),s),{},{setIsSuppressed:o})}().addSnackbarNotice,f=Object(m.b)().setValidationErrors;return function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?g(Object(n),!0).forEach((function(t){o()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):g(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({appliedCoupons:t,isLoading:n},Object(a.useSelect)((function(e,t){var n=t.dispatch,o=e(s.CART_STORE_KEY),a=o.isApplyingCoupon(),l=o.isRemovingCoupon(),p=n(s.CART_STORE_KEY),u=p.applyCoupon,h=p.removeCoupon,m=p.receiveApplyingCoupon;return{applyCoupon:function(e){u(e).then((function(t){!0===t&&d(Object(c.sprintf)(
/* translators: %s coupon code. */
Object(c.__)('Coupon code "%s" has been applied to your cart.','woocommerce'),e),{id:"coupon-form"})})).catch((function(e){f({coupon:{message:Object(i.decodeEntities)(e.message),hidden:!1}}),m("")}))},removeCoupon:function(e){h(e).then((function(t){!0===t&&d(Object(c.sprintf)(
/* translators: %s coupon code. */
Object(c.__)('Coupon code "%s" has been removed from your cart.','woocommerce'),e),{id:"coupon-form"})})).catch((function(e){r(e.message,{id:"coupon-form"}),m("")}))},isApplyingCoupon:a,isRemovingCoupon:l}}),[r,d]))}},250:function(e,t){},258:function(e,t,n){"use strict";n.d(t,"a",(function(){return o})),n(10);var r=n(127),o=(n(250),function(e){var t=e.errorMessage,n=void 0===t?"":t,o=e.propertyName,c=void 0===o?"":o,a=e.elementId,s=void 0===a?"":a,i=Object(r.b)(),l=i.getValidationError,p=i.getValidationErrorId;if(!n||"string"!=typeof n){var u=l(c)||{};if(!u.message||u.hidden)return null;n=u.message}return React.createElement("div",{className:"wc-block-components-validation-error",role:"alert"},React.createElement("p",{id:p(s)},n))})},265:function(e,t){},272:function(e,t){},318:function(e,t,n){"use strict";n.d(t,"a",(function(){return M}));var r=n(1),o=n(58),c=n(0),a=n(6),s=n.n(a),i=n(34),l=React.createElement(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},React.createElement("path",{fill:"none",d:"M0 0h24v24H0z"}),React.createElement("path",{d:"M4 10h3v7H4zM10.5 10h3v7h-3zM2 19h20v3H2zM17 10h3v7h-3zM12 1L2 6v2h20V6z"})),p=React.createElement(i.SVG,{xmlns:"http://www.w3.org/2000/SVG",viewBox:"0 0 24 24"},React.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),React.createElement("path",{d:"M11 17h2v-1h1c.55 0 1-.45 1-1v-3c0-.55-.45-1-1-1h-3v-1h4V8h-2V7h-2v1h-1c-.55 0-1 .45-1 1v3c0 .55.45 1 1 1h3v1H9v2h2v1zm9-13H4c-1.11 0-1.99.89-1.99 2L2 18c0 1.11.89 2 2 2h16c1.11 0 2-.89 2-2V6c0-1.11-.89-2-2-2zm0 14H4V6h16v12z"})),u=n(339),d=React.createElement(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},React.createElement("g",{fill:"none",fillRule:"evenodd"},React.createElement("path",{d:"M0 0h24v24H0z"}),React.createElement("path",{fill:"#000",fillRule:"nonzero",d:"M17.3 8v1c1 .2 1.4.9 1.4 1.7h-1c0-.6-.3-1-1-1-.8 0-1.3.4-1.3.9 0 .4.3.6 1.4 1 1 .2 2 .6 2 1.9 0 .9-.6 1.4-1.5 1.5v1H16v-1c-.9-.1-1.6-.7-1.7-1.7h1c0 .6.4 1 1.3 1 1 0 1.2-.5 1.2-.8 0-.4-.2-.8-1.3-1.1-1.3-.3-2.1-.8-2.1-1.8 0-.9.7-1.5 1.6-1.6V8h1.3zM12 10v1H6v-1h6zm2-2v1H6V8h8zM2 4v16h20V4H2zm2 14V6h16v12H4z"}),React.createElement("path",{stroke:"#000",strokeLinecap:"round",d:"M6 16c2.6 0 3.9-3 1.7-3-2 0-1 3 1.5 3 1 0 1-.8 2.8-.8"}))),h=n(152),m=n(49),b=(n(272),{bank:l,bill:p,card:u.a,checkPayment:d}),g=function(e){var t=e.icon,n=void 0===t?"":t,r=e.text,o=void 0===r?"":r,a=!!n,i=Object(c.useCallback)((function(e){return a&&Object(m.c)(e)&&Object(m.d)(b,e)}),[a]),l=s()("wc-block-components-payment-method-label",{"wc-block-components-payment-method-label--with-icon":a});return React.createElement("span",{className:l},i(n)?React.createElement(h.a,{srcElement:b[n]}):n,o)},f=n(192),v=n(2),y=n(45),O=n.n(y),j=n(258),w=n(32),E=n(214),S=n(35),R=n(48),P=n(173),k=n(66),C=n(60),_=function(e,t){var n=[],o=function(t,n){var r=n+"_tax",o=Object(m.d)(e,n)&&Object(m.c)(e[n])?parseInt(e[n],10):0;return{key:n,label:t,value:o,valueWithTax:o+(Object(m.d)(e,r)&&Object(m.c)(e[r])?parseInt(e[r],10):0)}};return n.push(o(Object(r.__)("Subtotal:",'woocommerce'),"total_items")),n.push(o(Object(r.__)("Fees:",'woocommerce'),"total_fees")),n.push(o(Object(r.__)("Discount:",'woocommerce'),"total_discount")),n.push({key:"total_tax",label:Object(r.__)("Taxes:",'woocommerce'),value:parseInt(e.total_tax,10),valueWithTax:parseInt(e.total_tax,10)}),t&&n.push(o(Object(r.__)("Shipping:",'woocommerce'),"total_shipping")),n},M=function(){var e=Object(R.b)(),t=e.isCalculating,n=e.isComplete,a=e.isIdle,s=e.isProcessing,i=e.onCheckoutBeforeProcessing,l=e.onCheckoutValidationBeforeProcessing,p=e.onCheckoutAfterProcessingWithSuccess,u=e.onCheckoutAfterProcessingWithError,d=e.onSubmit,h=e.customerId,m=Object(P.b)(),b=m.currentStatus,y=m.activePaymentMethod,M=m.onPaymentProcessing,x=m.setExpressPaymentError,z=m.shouldSavePayment,I=Object(k.b)(),V=I.shippingErrorStatus,D=I.shippingErrorTypes,T=I.shippingRates,A=I.shippingRatesLoading,H=I.selectedRates,N=I.setSelectedRates,B=I.isSelectingRate,L=I.onShippingRateSuccess,W=I.onShippingRateFail,F=I.onShippingRateSelectSuccess,G=I.onShippingRateSelectFail,J=I.needsShipping,U=Object(C.b)(),K=U.billingData,Y=U.shippingAddress,q=U.setShippingAddress,Q=Object(w.a)().cartTotals,X=Object(E.a)().appliedCoupons,Z=Object(S.c)(),$=Z.noticeContexts,ee=Z.responseTypes,te=Object(c.useRef)(_(Q,J)),ne=Object(c.useRef)({label:Object(r.__)("Total",'woocommerce'),value:parseInt(Q.total_price,10)});Object(c.useEffect)((function(){te.current=_(Q,J),ne.current={label:Object(r.__)("Total",'woocommerce'),value:parseInt(Q.total_price,10)}}),[Q,J]);var re=Object(c.useCallback)((function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";O()("setExpressPaymentError should only be used by Express Payment Methods (using the provided onError handler).",{alternative:"",plugin:"woocommerce-gutenberg-products-block",link:"https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/4228"}),x(e)}),[x]);return{activePaymentMethod:y,billing:{billingData:K,cartTotal:ne.current,currency:Object(o.getCurrencyFromPriceResponse)(Q),cartTotalItems:te.current,displayPricesIncludingTax:Object(v.getSetting)("displayCartPricesIncludingTax",!1),appliedCoupons:X,customerId:h},checkoutStatus:{isCalculating:t,isComplete:n,isIdle:a,isProcessing:s},components:{ValidationInputError:j.a,PaymentMethodIcons:f.a,PaymentMethodLabel:g},emitResponse:{noticeContexts:$,responseTypes:ee},eventRegistration:{onCheckoutBeforeProcessing:i,onCheckoutValidationBeforeProcessing:l,onCheckoutAfterProcessingWithSuccess:p,onCheckoutAfterProcessingWithError:u,onShippingRateSuccess:L,onShippingRateFail:W,onShippingRateSelectSuccess:F,onShippingRateSelectFail:G,onPaymentProcessing:M},onSubmit:d,paymentStatus:b,setExpressPaymentError:re,shippingData:{shippingRates:T,shippingRatesLoading:A,selectedRates:H,setSelectedRates:N,isSelectingRate:B,shippingAddress:Y,setShippingAddress:q,needsShipping:J},shippingStatus:{shippingErrorStatus:V,shippingErrorTypes:D},shouldSavePayment:z}}},339:function(e,t,n){"use strict";var r=n(34),o=React.createElement(r.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},React.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),React.createElement("path",{fill:"currentColor",d:"M20 4H4c-1.11 0-1.99.89-1.99 2L2 18c0 1.11.89 2 2 2h16c1.11 0 2-.89 2-2V6c0-1.11-.89-2-2-2zm0 14H4v-6h16v6zm0-10H4V6h16v2z"}));t.a=o},78:function(e,t,n){}}]);woocommerce-blocks/build/cart-blocks/line-items-frontend.js000064400000043403151335517640020100 0ustar00(window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[27],{106:function(e,t,c){"use strict";var a=c(6),r=c.n(a);c(184),t.a=function(e){var t=e.children,c=e.className;return React.createElement("div",{className:r()("wc-block-components-product-badge",c)},t)}},140:function(e,t,c){"use strict";var a=c(4),r=c.n(a),n=c(1),i=c(69),o=c(6),l=c.n(o),u=(c(10),c(58)),s=c(0),m=(c(183),function(e){var t=e.currency,c=e.maxPrice,a=e.minPrice,r=e.priceClassName,o=e.priceStyle;return React.createElement(React.Fragment,null,React.createElement("span",{className:"screen-reader-text"},Object(n.sprintf)(
/* translators: %1$s min price, %2$s max price */
Object(n.__)("Price between %1$s and %2$s",'woocommerce'),Object(u.formatPrice)(a),Object(u.formatPrice)(c))),React.createElement("span",{"aria-hidden":!0},React.createElement(i.a,{className:l()("wc-block-components-product-price__value",r),currency:t,value:a,style:o})," — ",React.createElement(i.a,{className:l()("wc-block-components-product-price__value",r),currency:t,value:c,style:o})))}),p=function(e){var t=e.currency,c=e.regularPriceClassName,a=e.regularPriceStyle,r=e.regularPrice,o=e.priceClassName,u=e.priceStyle,s=e.price;return React.createElement(React.Fragment,null,React.createElement("span",{className:"screen-reader-text"},Object(n.__)("Previous price:",'woocommerce')),React.createElement(i.a,{currency:t,renderText:function(e){return React.createElement("del",{className:l()("wc-block-components-product-price__regular",c),style:a},e)},value:r}),React.createElement("span",{className:"screen-reader-text"},Object(n.__)("Discounted price:",'woocommerce')),React.createElement(i.a,{currency:t,renderText:function(e){return React.createElement("ins",{className:l()("wc-block-components-product-price__value","is-discounted",o),style:u},e)},value:s}))};t.a=function(e){var t=e.align,c=e.className,a=e.currency,n=e.format,o=void 0===n?"<price/>":n,u=e.maxPrice,d=void 0===u?null:u,b=e.minPrice,v=void 0===b?null:b,f=e.price,_=void 0===f?null:f,y=e.priceClassName,g=e.priceStyle,k=e.regularPrice,O=e.regularPriceClassName,E=e.regularPriceStyle,w=l()(c,"price","wc-block-components-product-price",r()({},"wc-block-components-product-price--align-".concat(t),t));o.includes("<price/>")||(o="<price/>",console.error("Price formats need to include the `<price/>` tag."));var R=k&&_!==k,j=React.createElement("span",{className:l()("wc-block-components-product-price__value",y)});return R?j=React.createElement(p,{currency:a,price:_,priceClassName:y,priceStyle:g,regularPrice:k,regularPriceClassName:O,regularPriceStyle:E}):null!==v&&null!==d?j=React.createElement(m,{currency:a,maxPrice:d,minPrice:v,priceClassName:y,priceStyle:g}):null!==_&&(j=React.createElement(i.a,{className:l()("wc-block-components-product-price__value",y),currency:a,value:_,style:g})),React.createElement("span",{className:w},Object(s.createInterpolateElement)(o,{price:j}))}},147:function(e,t){},150:function(e,t,c){"use strict";var a=c(14),r=c.n(a),n=c(23),i=c.n(n),o=c(28),l=c(6),u=c.n(l),s=(c(182),["className","disabled","name","permalink"]);t.a=function(e){var t=e.className,c=void 0===t?"":t,a=e.disabled,n=void 0!==a&&a,l=e.name,m=e.permalink,p=void 0===m?"":m,d=i()(e,s),b=u()("wc-block-components-product-name",c);return n?React.createElement("span",r()({className:b},d,{dangerouslySetInnerHTML:{__html:Object(o.decodeEntities)(l)}})):React.createElement("a",r()({className:b,href:p},d,{dangerouslySetInnerHTML:{__html:Object(o.decodeEntities)(l)}}))}},151:function(e,t,c){"use strict";var a=c(0),r=c(113),n=c(97),i=function(e){var t=e.indexOf("</p>");return-1===t?e:e.substr(0,t+4)},o=function(e){return e.replace(/<\/?[a-z][^>]*?>/gi,"")},l=function(e,t){return e.replace(/[\s|\.\,]+$/i,"")+t},u=function(e,t){var c=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"&hellip;",a=o(e),r=a.split(" ").splice(0,t).join(" ");return Object(n.autop)(l(r,c))},s=function(e,t){var c=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"&hellip;",r=o(e),i=r.slice(0,t);if(c)return Object(n.autop)(l(i,a));var u=i.match(/([\s]+)/g),s=u?u.length:0,m=r.slice(0,t+s);return Object(n.autop)(l(m,a))};t.a=function(e){var t=e.source,c=e.maxLength,o=void 0===c?15:c,l=e.countType,m=void 0===l?"words":l,p=e.className,d=void 0===p?"":p,b=Object(a.useMemo)((function(){return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:15,c=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"words",a=Object(n.autop)(e),o=Object(r.count)(a,c);if(o<=t)return a;var l=i(a),m=Object(r.count)(l,c);return m<=t?l:"words"===c?u(l,t):s(l,t,"characters_including_spaces"===c)}(t,o,m)}),[t,o,m]);return React.createElement(a.RawHTML,{className:d},b)}},155:function(e,t,c){"use strict";var a=c(21),r=c.n(a),n=c(1),i=c(33),o=c(6),l=c.n(o),u=c(0),s=c(50),m=c(49);c(190),t.a=function(e){var t=e.className,c=e.quantity,a=void 0===c?1:c,o=e.minimum,p=void 0===o?1:o,d=e.maximum,b=e.onChange,v=void 0===b?function(){}:b,f=e.itemName,_=void 0===f?"":f,y=e.disabled,g=l()("wc-block-components-quantity-selector",t),k=void 0!==d,O=a>p,E=!k||a<d,w=Object(u.useCallback)((function(e){var t=void 0!==r()(e.key)?"ArrowDown"===e.key:e.keyCode===s.DOWN,c=void 0!==r()(e.key)?"ArrowUp"===e.key:e.keyCode===s.UP;t&&O&&(e.preventDefault(),v(a-1)),c&&E&&(e.preventDefault(),v(a+1))}),[a,v,E,O]);return React.createElement("div",{className:g},React.createElement("input",{className:"wc-block-components-quantity-selector__input",disabled:y,type:"number",step:"1",min:"0",value:a,onKeyDown:w,onChange:function(e){var t=Object(m.a)(e.target.value)&&e.target.value?parseInt(e.target.value,10):0;k&&(t=Math.min(t,d)),(t=Math.max(t,p))!==a&&v(t)},"aria-label":Object(n.sprintf)(
/* translators: %s refers to the item name in the cart. */
Object(n.__)("Quantity of %s in your cart.",'woocommerce'),_)}),React.createElement("button",{"aria-label":Object(n.__)("Reduce quantity",'woocommerce'),className:"wc-block-components-quantity-selector__button wc-block-components-quantity-selector__button--minus",disabled:y||!O,onClick:function(){var e=a-1;v(e),Object(i.speak)(Object(n.sprintf)(
/* translators: %s refers to the item name in the cart. */
Object(n.__)("Quantity reduced to %s.",'woocommerce'),e))}},"-"),React.createElement("button",{"aria-label":Object(n.__)("Increase quantity",'woocommerce'),disabled:y||!E,className:"wc-block-components-quantity-selector__button wc-block-components-quantity-selector__button--plus",onClick:function(){var e=a+1;v(e),Object(i.speak)(Object(n.sprintf)(
/* translators: %s refers to the item name in the cart. */
Object(n.__)("Quantity increased to %s.",'woocommerce'),e))}},"+"))}},182:function(e,t){},183:function(e,t){},184:function(e,t){},185:function(e,t){},186:function(e,t){},190:function(e,t){},266:function(e,t,c){"use strict";var a=c(14),r=c.n(a),n=c(28),i=c(2);t.a=function(e){var t=e.image,c=void 0===t?{}:t,a={src:c.thumbnail||i.PLACEHOLDER_IMG_SRC,alt:Object(n.decodeEntities)(c.alt)||""};return React.createElement("img",r()({},a,{alt:a.alt}))}},267:function(e,t,c){"use strict";var a=c(1),r=c(106);t.a=function(){return React.createElement(r.a,{className:"wc-block-components-product-backorder-badge"},Object(a.__)("Available on backorder",'woocommerce'))}},268:function(e,t,c){"use strict";var a=c(1),r=c(106);t.a=function(e){var t=e.lowStockRemaining;return t?React.createElement(r.a,{className:"wc-block-components-product-low-stock-badge"},Object(a.sprintf)(
/* translators: %d stock amount (number of items in stock for product) */
Object(a.__)("%d left in stock",'woocommerce'),t)):null}},269:function(e,t,c){"use strict";var a=c(7),r=c(28),n=(c(186),function(e){var t=e.details,c=void 0===t?[]:t;return Array.isArray(c)?0===(c=c.filter((function(e){return!e.hidden}))).length?null:React.createElement("ul",{className:"wc-block-components-product-details"},c.map((function(e){var t=e.name?"wc-block-components-product-details__".concat(Object(a.kebabCase)(e.name)):"";return React.createElement("li",{key:e.name+(e.display||e.value),className:t},e.name&&React.createElement(React.Fragment,null,React.createElement("span",{className:"wc-block-components-product-details__name"},Object(r.decodeEntities)(e.name),":")," "),React.createElement("span",{className:"wc-block-components-product-details__value"},Object(r.decodeEntities)(e.display||e.value)))}))):null}),i=c(151),o=c(83),l=function(e){var t=e.className,c=e.shortDescription,a=void 0===c?"":c,r=e.fullDescription,n=a||(void 0===r?"":r);return n?React.createElement(i.a,{className:t,source:n,maxLength:15,countType:o.n.wordCountType||"words"}):null};c(185),t.a=function(e){var t=e.shortDescription,c=void 0===t?"":t,a=e.fullDescription,r=void 0===a?"":a,i=e.itemData,o=void 0===i?[]:i,u=e.variation,s=void 0===u?[]:u;return React.createElement("div",{className:"wc-block-components-product-metadata"},React.createElement(l,{className:"wc-block-components-product-metadata__description",shortDescription:c,fullDescription:r}),React.createElement(n,{details:o}),React.createElement(n,{details:s.map((function(e){var t=e.attribute;return{name:void 0===t?"":t,value:e.value}}))}))}},278:function(e,t,c){"use strict";c.d(t,"a",(function(){return b}));var a=c(5),r=c.n(a),n=c(11),i=c(0),o=c(8),l=c(115),u=c(99),s=c(137),m=c(49),p=c(32),d=c(48),b=function(e){var t={key:"",quantity:1};(function(e){return Object(m.b)(e)&&Object(m.d)(e,"key")&&Object(m.d)(e,"quantity")&&Object(m.c)(e.key)&&Object(m.a)(e.quantity)})(e)&&(t.key=e.key,t.quantity=e.quantity);var c=t.key,a=void 0===c?"":c,b=t.quantity,v=void 0===b?1:b,f=Object(p.a)().cartErrors,_=Object(d.b)().dispatchActions,y=Object(i.useState)(v),g=r()(y,2),k=g[0],O=g[1],E=Object(l.a)(k,400),w=r()(E,1)[0],R=Object(u.a)(w),j=Object(n.useDispatch)(o.CART_STORE_KEY),N=j.removeItemFromCart,h=j.changeCartItemQuantity,C=Object(n.useSelect)((function(e){if(!a)return{quantity:!1,delete:!1};var t=e(o.CART_STORE_KEY);return{quantity:t.isItemPendingQuantity(a),delete:t.isItemPendingDelete(a)}}),[a]),P=Object(i.useCallback)((function(){return a?N(a).then((function(){return Object(s.c)(),!0})):Promise.resolve(!1)}),[a,N]);return Object(i.useEffect)((function(){a&&Object(m.a)(R)&&Number.isFinite(R)&&R!==w&&h(a,w)}),[a,h,w,R]),Object(i.useEffect)((function(){return C.delete?_.incrementCalculating():_.decrementCalculating(),function(){C.delete&&_.decrementCalculating()}}),[_,C.delete]),Object(i.useEffect)((function(){return C.quantity||w!==k?_.incrementCalculating():_.decrementCalculating(),function(){(C.quantity||w!==k)&&_.decrementCalculating()}}),[_,C.quantity,w,k]),{isPendingDelete:C.delete,quantity:k,setItemQuantity:O,removeItem:P,cartItemQuantityErrors:f}}},279:function(e,t,c){"use strict";var a=c(0),r=c(1),n=c(69),i=c(106);t.a=function(e){var t=e.currency,c=e.saleAmount,o=e.format,l=void 0===o?"<price/>":o;if(!c||c<=0)return null;l.includes("<price/>")||(l="<price/>",console.error("Price formats need to include the `<price/>` tag."));var u=Object(r.sprintf)(
/* translators: %s will be replaced by the discount amount */
Object(r.__)("Save %s",'woocommerce'),l);return React.createElement(i.a,{className:"wc-block-components-sale-badge"},Object(a.createInterpolateElement)(u,{price:React.createElement(n.a,{currency:t,value:c})}))}},414:function(e,t,c){"use strict";c.r(t);var a=c(32),r=c(46),n=c.n(r),i=c(1),o=c(23),l=c.n(o),u=c(6),s=c.n(u),m=c(155),p=c(140),d=c(150),b=c(278),v=c(52),f=c(266),_=c(267),y=c(268),g=c(279),k=c(269),O=c(58),E=c(26),w=c(125),R=c(0),j=c(49),N=c(2),h=["receiveCart"],C=function(e,t){return e.convertPrecision(t.minorUnit).getAmount()},P=function(e){return Object(E.mustContain)(e,"<price/>")},x=function(e){var t=e.lineItem,c=t.name,r=void 0===c?"":c,n=t.catalog_visibility,o=void 0===n?"visible":n,u=t.short_description,x=void 0===u?"":u,I=t.description,S=void 0===I?"":I,D=t.low_stock_remaining,q=void 0===D?null:D,A=t.show_backorder_badge,T=void 0!==A&&A,F=t.quantity_limit,L=void 0===F?99:F,M=t.permalink,U=void 0===M?"":M,Q=t.images,V=void 0===Q?[]:Q,$=t.variation,H=void 0===$?[]:$,B=t.item_data,K=void 0===B?[]:B,W=t.prices,J=void 0===W?{currency_code:"USD",currency_minor_unit:2,currency_symbol:"$",currency_prefix:"$",currency_suffix:"",currency_decimal_separator:".",currency_thousand_separator:",",price:"0",regular_price:"0",sale_price:"0",price_range:null,raw_prices:{precision:6,price:"0",regular_price:"0",sale_price:"0"}}:W,Y=t.totals,z=void 0===Y?{currency_code:"USD",currency_minor_unit:2,currency_symbol:"$",currency_prefix:"$",currency_suffix:"",currency_decimal_separator:".",currency_thousand_separator:",",line_subtotal:"0",line_subtotal_tax:"0"}:Y,G=t.extensions,X=Object(b.a)(t),Z=X.quantity,ee=X.setItemQuantity,te=X.removeItem,ce=X.isPendingDelete,ae=Object(v.a)().dispatchStoreEvent,re=Object(a.a)(),ne=(re.receiveCart,l()(re,h)),ie=Object(R.useMemo)((function(){return{context:"cart",cartItem:t,cart:ne}}),[t,ne]),oe=Object(O.getCurrencyFromPriceResponse)(J),le=Object(E.__experimentalApplyCheckoutFilter)({filterName:"itemName",defaultValue:r,extensions:G,arg:ie}),ue=Object(w.a)({amount:parseInt(J.raw_prices.regular_price,10),precision:J.raw_prices.precision}),se=Object(w.a)({amount:parseInt(J.raw_prices.price,10),precision:J.raw_prices.precision}),me=ue.subtract(se),pe=me.multiply(Z),de=Object(O.getCurrencyFromPriceResponse)(z),be=parseInt(z.line_subtotal,10);Object(N.getSetting)("displayCartPricesIncludingTax",!1)&&(be+=parseInt(z.line_subtotal_tax,10));var ve=Object(w.a)({amount:be,precision:de.minorUnit}),fe=V.length?V[0]:{},_e="hidden"===o||"search"===o,ye=Object(E.__experimentalApplyCheckoutFilter)({filterName:"cartItemPrice",defaultValue:"<price/>",extensions:G,arg:ie,validation:P}),ge=Object(E.__experimentalApplyCheckoutFilter)({filterName:"subtotalPriceFormat",defaultValue:"<price/>",extensions:G,arg:ie,validation:P}),ke=Object(E.__experimentalApplyCheckoutFilter)({filterName:"saleBadgePriceFormat",defaultValue:"<price/>",extensions:G,arg:ie,validation:P});return React.createElement("tr",{className:s()("wc-block-cart-items__row",{"is-disabled":ce})},React.createElement("td",{className:"wc-block-cart-item__image","aria-hidden":!Object(j.d)(fe,"alt")||!fe.alt},_e?React.createElement(f.a,{image:fe}):React.createElement("a",{href:U,tabIndex:-1},React.createElement(f.a,{image:fe}))),React.createElement("td",{className:"wc-block-cart-item__product"},React.createElement(d.a,{disabled:ce||_e,name:le,permalink:U}),T?React.createElement(_.a,null):!!q&&React.createElement(y.a,{lowStockRemaining:q}),React.createElement("div",{className:"wc-block-cart-item__prices"},React.createElement(p.a,{currency:oe,regularPrice:C(ue,oe),price:C(se,oe),format:ge})),React.createElement(g.a,{currency:oe,saleAmount:C(me,oe),format:ke}),React.createElement(k.a,{shortDescription:x,fullDescription:S,itemData:K,variation:H}),React.createElement("div",{className:"wc-block-cart-item__quantity"},React.createElement(m.a,{disabled:ce,quantity:Z,maximum:L,onChange:function(e){ee(e),ae("cart-set-item-quantity",{product:t,quantity:e})},itemName:le}),React.createElement("button",{className:"wc-block-cart-item__remove-link",onClick:function(){te(),ae("cart-remove-item",{product:t,quantity:Z})},disabled:ce},Object(i.__)("Remove item",'woocommerce')))),React.createElement("td",{className:"wc-block-cart-item__total"},React.createElement("div",{className:"wc-block-cart-item__total-price-and-sale-badge-wrapper"},React.createElement(p.a,{currency:de,format:ye,price:ve.getAmount()}),Z>1&&React.createElement(g.a,{currency:oe,saleAmount:C(pe,oe),format:ke}))))},I=n()(Array(3)).map((function(_x,e){return React.createElement(x,{lineItem:{},key:e})})),S=function(e){var t=e.lineItems,c=void 0===t?[]:t,a=e.isLoading,r=void 0!==a&&a?I:c.map((function(e){return React.createElement(x,{key:e.key,lineItem:e})}));return React.createElement("table",{className:"wc-block-cart-items"},React.createElement("thead",null,React.createElement("tr",{className:"wc-block-cart-items__header"},React.createElement("th",{className:"wc-block-cart-items__header-image"},React.createElement("span",null,Object(i.__)("Product",'woocommerce'))),React.createElement("th",{className:"wc-block-cart-items__header-product"},React.createElement("span",null,Object(i.__)("Details",'woocommerce'))),React.createElement("th",{className:"wc-block-cart-items__header-total"},React.createElement("span",null,Object(i.__)("Total",'woocommerce'))))),React.createElement("tbody",null,r))};t.default=function(){var e=Object(a.a)(),t=e.cartItems,c=e.cartIsLoading;return React.createElement(S,{lineItems:t,isLoading:c})}},69:function(e,t,c){"use strict";var a=c(14),r=c.n(a),n=c(4),i=c.n(n),o=c(23),l=c.n(o),u=c(126),s=c(6),m=c.n(s),p=(c(147),["className","value","currency","onValueChange","displayType"]);function d(e,t){var c=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),c.push.apply(c,a)}return c}function b(e){for(var t=1;t<arguments.length;t++){var c=null!=arguments[t]?arguments[t]:{};t%2?d(Object(c),!0).forEach((function(t){i()(e,t,c[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(c)):d(Object(c)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(c,t))}))}return e}t.a=function(e){var t=e.className,c=e.value,a=e.currency,n=e.onValueChange,i=e.displayType,o=void 0===i?"text":i,s=l()(e,p),d="string"==typeof c?parseInt(c,10):c;if(!Number.isFinite(d))return null;var v=d/Math.pow(10,a.minorUnit);if(!Number.isFinite(v))return null;var f=m()("wc-block-formatted-money-amount","wc-block-components-formatted-money-amount",t),_=b(b(b({},s),function(e){return{thousandSeparator:e.thousandSeparator,decimalSeparator:e.decimalSeparator,decimalScale:e.minorUnit,fixedDecimalScale:!0,prefix:e.prefix,suffix:e.suffix,isNumericString:!0}}(a)),{},{value:void 0,currency:void 0,onValueChange:void 0}),y=n?function(e){var t=e.value*Math.pow(10,a.minorUnit);n(t)}:function(){};return React.createElement(u.a,r()({className:f,displayType:o},_,{value:v,onValueChange:y}))}}}]);woocommerce-blocks/build/cart-blocks/express-payment-frontend.js000064400000010563151335517640021177 0ustar00(window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[24],{152:function(e,t,n){"use strict";var r=n(4),c=n.n(r),o=n(23),a=n.n(o),s=n(0),i=["srcElement","size"];function l(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}t.a=function(e){var t=e.srcElement,n=e.size,r=void 0===n?24:n,o=a()(e,i);return Object(s.isValidElement)(t)?Object(s.cloneElement)(t,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?l(Object(n),!0).forEach((function(t){c()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):l(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({width:r,height:r},o)):null}},212:function(e,t,n){"use strict";var r=n(4),c=n.n(r),o=n(5),a=n.n(o),s=n(1),i=n(318),l=n(187),u=n(0),b=n(36),p=n(173),m=n(45),O=n.n(m),d=n(213);function f(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function j(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?f(Object(n),!0).forEach((function(t){c()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):f(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}t.a=function(){var e=Object(b.a)().isEditor,t=Object(p.b)(),n=t.setActivePaymentMethod,r=t.setExpressPaymentError,c=t.activePaymentMethod,o=t.paymentMethodData,m=t.setPaymentStatus,f=Object(i.a)(),y=Object(l.a)().paymentMethods,E=Object(u.useRef)(c),g=Object(u.useRef)(o),v=Object(u.useCallback)((function(e){return function(){E.current=c,g.current=o,m().started({}),n(e)}}),[c,o,n,m]),w=Object(u.useCallback)((function(){m().pristine(),n(E.current),g.current.isSavedToken&&m().started(g.current)}),[n,m]),P=Object(u.useCallback)((function(e){m().error(e),r(e),n(E.current),g.current.isSavedToken&&m().started(g.current)}),[n,m,r]),h=Object(u.useCallback)((function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";O()("Express Payment Methods should use the provided onError handler instead.",{alternative:"onError",plugin:"woocommerce-gutenberg-products-block",link:"https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/4228"}),e?P(e):r("")}),[r,P]),k=Object.entries(y),R=k.length>0?k.map((function(t){var n=a()(t,2),r=n[0],c=n[1],o=e?c.edit:c.content;return Object(u.isValidElement)(o)?React.createElement("li",{key:r,id:"express-payment-method-".concat(r)},Object(u.cloneElement)(o,j(j({},f),{},{onClick:v(r),onClose:w,onError:P,setExpressPaymentError:h}))):null})):React.createElement("li",{key:"noneRegistered"},Object(s.__)("No registered Payment Methods",'woocommerce'));return React.createElement(d.a,{isEditor:e},React.createElement("ul",{className:"wc-block-components-express-payment__event-buttons"},R))}},264:function(e,t){},338:function(e,t,n){"use strict";var r=n(1),c=n(187),o=n(35),a=n(48),s=n(173),i=n(103),l=n(105),u=n(212);n(264),t.a=function(){var e=Object(c.a)(),t=e.paymentMethods,n=e.isInitialized,b=Object(o.c)().noticeContexts,p=Object(a.b)(),m=p.isCalculating,O=p.isProcessing,d=p.isAfterProcessing,f=p.isBeforeProcessing,j=p.isComplete,y=p.hasError,E=Object(s.b)().currentStatus;if(!n||n&&0===Object.keys(t).length)return null;var g=O||d||f||j&&!y;return React.createElement(React.Fragment,null,React.createElement(l.a,{isLoading:m||g||E.isDoingExpressPayment},React.createElement("div",{className:"wc-block-components-express-payment wc-block-components-express-payment--cart"},React.createElement("div",{className:"wc-block-components-express-payment__content"},React.createElement(i.a,{context:b.EXPRESS_PAYMENTS},React.createElement(u.a,null))))),React.createElement("div",{className:"wc-block-components-express-payment-continue-rule wc-block-components-express-payment-continue-rule--cart"},Object(r.__)("Or",'woocommerce')))}},402:function(e,t,n){"use strict";n.r(t);var r=n(32),c=n(338);t.default=function(){return Object(r.a)().cartNeedsPayment?React.createElement("div",{className:"wc-block-cart__payment-options"},React.createElement(c.a,null)):null}}}]);woocommerce-blocks/build/cart-blocks/totals-frontend.js000064400000000716151335517640017340 0ustar00(window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[29],{331:function(c,e,n){"use strict";var a=n(6),t=n.n(a);n(10),e.a=function(c){var e=c.children,n=c.className;return React.createElement("div",{className:t()("wc-block-components-sidebar",n)},e)}},384:function(c,e){},400:function(c,e,n){"use strict";n.r(e);var a=n(331);n(384),e.default=function(c){var e=c.children;return React.createElement(a.a,{className:"wc-block-cart__sidebar"},e)}}}]);woocommerce-blocks/build/stock-filter-frontend.js000064400000071537151335517640016245 0ustar00!function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=294)}({0:function(e,t){e.exports=window.wp.element},1:function(e,t){e.exports=window.wp.i18n},10:function(e,t,r){e.exports=r(79)()},100:function(e,t,r){"use strict";r.d(t,"a",(function(){return u}));var n=r(5),o=r.n(n),c=r(0),u=function(){var e=Object(c.useState)(),t=o()(e,2)[1];return Object(c.useCallback)((function(e){t((function(){throw e}))}),[])}},107:function(e,t,r){"use strict";r.d(t,"a",(function(){return b}));var n=r(14),o=r.n(n),c=r(4),u=r.n(c),a=r(0),s=r(44);function i(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function l(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?i(Object(r),!0).forEach((function(t){u()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):i(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var f=[".wp-block-woocommerce-cart"],p=function(e){var t=e.Block,r=e.containers,n=e.getProps,c=void 0===n?function(){return{}}:n,u=e.getErrorBoundaryProps,i=void 0===u?function(){return{}}:u;0!==r.length&&Array.prototype.forEach.call(r,(function(e,r){var n=c(e,r),u=i(e,r),f=l(l({},e.dataset),n.attributes||{});e.classList.remove("is-loading"),Object(a.render)(React.createElement(s.a,u,React.createElement(a.Suspense,{fallback:React.createElement("div",{className:"wc-block-placeholder"})},React.createElement(t,o()({},n,{attributes:f})))),e)}))},b=function(e){var t,r,n,o,c,u,a,s=document.body.querySelectorAll(f.join(","));t=l(l({},e),{},{wrappers:s}),r=t.Block,n=t.getProps,o=t.getErrorBoundaryProps,c=t.selector,u=t.wrappers,a=document.body.querySelectorAll(c),u.length>0&&Array.prototype.filter.call(a,(function(e){return!function(e,t){return Array.prototype.some.call(t,(function(t){return t.contains(e)&&!t.isSameNode(e)}))}(e,u)})),p({Block:r,containers:a,getProps:n,getErrorBoundaryProps:o}),Array.prototype.forEach.call(s,(function(t){t.addEventListener("wc-blocks_render_blocks_frontend",(function(){var r,n,o,c,u,a;n=(r=l(l({},e),{},{wrapper:t})).Block,o=r.getProps,c=r.getErrorBoundaryProps,u=r.selector,a=r.wrapper.querySelectorAll(u),p({Block:n,containers:a,getProps:o,getErrorBoundaryProps:c})}))}))}},108:function(e,t,r){"use strict";var n=r(1),o=r(51);r(197),t.a=function(e){var t=e.name,r=e.count;return React.createElement(React.Fragment,null,t,Number.isFinite(r)&&React.createElement(o.a,{label:r,screenReaderLabel:Object(n.sprintf)(
/* translators: %s number of products. */
Object(n._n)("%s product","%s products",r,'woocommerce'),r),wrapperElement:"span",wrapperProps:{className:"wc-filter-element-label-list-count"}}))}},11:function(e,t){e.exports=window.wp.data},115:function(e,t,r){"use strict";r.d(t,"a",(function(){return u}));var n=r(3),o=r(82);function c(e,t){return e===t}function u(e,t,r){var u=r&&r.equalityFn?r.equalityFn:c,a=Object(n.useState)(e),s=a[0],i=a[1],l=Object(o.a)(Object(n.useCallback)((function(e){return i(e)}),[]),t,r),f=l[0],p=l[1],b=l[2],d=Object(n.useRef)(e);return Object(n.useEffect)((function(){u(d.current,e)||(f(e),d.current=e)}),[e,f,u]),[s,p,b]}},120:function(e,t,r){"use strict";r.d(t,"a",(function(){return s}));var n=r(8),o=r(11),c=r(0),u=r(53),a=r(100),s=function(e){var t=e.namespace,r=e.resourceName,s=e.resourceValues,i=void 0===s?[]:s,l=e.query,f=void 0===l?{}:l,p=e.shouldSelect,b=void 0===p||p;if(!t||!r)throw new Error("The options object must have valid values for the namespace and the resource properties.");var d=Object(c.useRef)({results:[],isLoading:!0}),O=Object(u.a)(f),m=Object(u.a)(i),v=Object(a.a)(),y=Object(o.useSelect)((function(e){if(!b)return null;var o=e(n.COLLECTIONS_STORE_KEY),c=[t,r,O,m],u=o.getCollectionError.apply(o,c);return u&&v(u),{results:o.getCollection.apply(o,c),isLoading:!o.hasFinishedResolution("getCollection",c)}}),[t,r,m,O,b]);return null!==y&&(d.current=y),d.current}},128:function(e,t,r){"use strict";var n=r(0),o=r(8),c=r(11),u=r(83);t.a=function(e){return function(t){var r;return r=Object(n.useRef)(u.n.restApiRoutes||{}),Object(c.useSelect)((function(e,t){if(r.current){var n=e(o.SCHEMA_STORE_KEY),c=n.isResolving,u=n.hasFinishedResolution,a=t.dispatch(o.SCHEMA_STORE_KEY),s=a.receiveRoutes,i=a.startResolution,l=a.finishResolution;Object.keys(r.current).forEach((function(e){var t=r.current[e];c("getRoutes",[e])||u("getRoutes",[e])||(i("getRoutes",[e]),s(t,[e]),l("getRoutes",[e]))}))}}),[]),React.createElement(e,t)}}},133:function(e,t,r){"use strict";var n=r(1),o=(r(10),r(6)),c=r.n(o),u=r(51),a=(r(154),function(e){var t=e.className,r=e.disabled,o=e.label,a=void 0===o?Object(n.__)("Go",'woocommerce'):o,s=e.onClick,i=e.screenReaderLabel,l=void 0===i?Object(n.__)("Apply filter",'woocommerce'):i;return React.createElement("button",{type:"submit",className:c()("wc-block-filter-submit-button","wc-block-components-filter-submit-button",t),disabled:r,onClick:s},React.createElement(u.a,{label:a,screenReaderLabel:l}))});a.defaultProps={disabled:!1},t.a=a},14:function(e,t){function r(){return e.exports=r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},e.exports.default=e.exports,e.exports.__esModule=!0,r.apply(this,arguments)}e.exports=r,e.exports.default=e.exports,e.exports.__esModule=!0},154:function(e,t){},171:function(e,t,r){"use strict";var n=r(46),o=r.n(n),c=r(5),u=r.n(c),a=r(1),s=(r(10),r(0)),i=r(6),l=r.n(i);r(198),t.a=function(e){var t=e.className,r=e.onChange,n=void 0===r?function(){}:r,c=e.options,i=void 0===c?[]:c,f=e.checked,p=void 0===f?[]:f,b=e.isLoading,d=void 0!==b&&b,O=e.isDisabled,m=void 0!==O&&O,v=e.limit,y=void 0===v?10:v,g=Object(s.useState)(!1),j=u()(g,2),_=j[0],w=j[1],h=Object(s.useMemo)((function(){return o()(Array(5)).map((function(e,t){return React.createElement("li",{key:t,style:{width:Math.floor(75*Math.random())+25+"%"}})}))}),[]),x=Object(s.useMemo)((function(){var e=i.length-y;return!_&&React.createElement("li",{key:"show-more",className:"show-more"},React.createElement("button",{onClick:function(){w(!0)},"aria-expanded":!1,"aria-label":Object(a.sprintf)(
/* translators: %s is referring the remaining count of options */
Object(a._n)("Show %s more option","Show %s more options",e,'woocommerce'),e)},Object(a.sprintf)(
/* translators: %s number of options to reveal. */
Object(a._n)("Show %s more","Show %s more",e,'woocommerce'),e)))}),[i,y,_]),E=Object(s.useMemo)((function(){return _&&React.createElement("li",{key:"show-less",className:"show-less"},React.createElement("button",{onClick:function(){w(!1)},"aria-expanded":!0,"aria-label":Object(a.__)("Show less options",'woocommerce')},Object(a.__)("Show less",'woocommerce')))}),[_]),k=Object(s.useMemo)((function(){var e=i.length>y+5;return React.createElement(React.Fragment,null,i.map((function(t,r){return React.createElement(s.Fragment,{key:t.value},React.createElement("li",e&&!_&&r>=y&&{hidden:!0},React.createElement("input",{type:"checkbox",id:t.value,value:t.value,onChange:function(e){n(e.target.value)},checked:p.includes(t.value),disabled:m}),React.createElement("label",{htmlFor:t.value},t.label)),e&&r===y-1&&x)})),e&&E)}),[i,n,p,_,y,E,x,m]),S=l()("wc-block-checkbox-list","wc-block-components-checkbox-list",{"is-loading":d},t);return React.createElement("ul",{className:S},d?h:k)}},197:function(e,t){},198:function(e,t){},2:function(e,t){e.exports=window.wc.wcSettings},21:function(e,t){function r(t){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?(e.exports=r=function(e){return typeof e},e.exports.default=e.exports,e.exports.__esModule=!0):(e.exports=r=function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.default=e.exports,e.exports.__esModule=!0),r(t)}e.exports=r,e.exports.default=e.exports,e.exports.__esModule=!0},223:function(e,t,r){"use strict";r.d(t,"a",(function(){return j}));var n=r(4),o=r.n(n),c=r(46),u=r.n(c),a=r(21),s=r.n(a),i=r(5),l=r.n(i),f=r(0),p=r(115),b=r(7),d=r(53),O=r(90),m=r(120),v=r(64);function y(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function g(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?y(Object(r),!0).forEach((function(t){o()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):y(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var j=function(e){var t=e.queryAttribute,r=e.queryPrices,n=e.queryStock,o=e.queryState,c=Object(v.a)();c="".concat(c,"-collection-data");var a=Object(O.a)(c),i=l()(a,1)[0],y=Object(O.b)("calculate_attribute_counts",[],c),j=l()(y,2),_=j[0],w=j[1],h=Object(O.b)("calculate_price_range",null,c),x=l()(h,2),E=x[0],k=x[1],S=Object(O.b)("calculate_stock_status_counts",null,c),R=l()(S,2),P=R[0],M=R[1],T=Object(d.a)(t||{}),C=Object(d.a)(r),A=Object(d.a)(n);Object(f.useEffect)((function(){"object"===s()(T)&&Object.keys(T).length&&(_.find((function(e){return e.taxonomy===T.taxonomy}))||w([].concat(u()(_),[T])))}),[T,_,w]),Object(f.useEffect)((function(){E!==C&&void 0!==C&&k(C)}),[C,k,E]),Object(f.useEffect)((function(){P!==A&&void 0!==A&&M(A)}),[A,M,P]);var N=Object(f.useState)(!1),D=l()(N,2),B=D[0],F=D[1],L=Object(p.a)(B,200),q=l()(L,1)[0];B||F(!0);var I=Object(f.useMemo)((function(){return function(e){var t=e;return e.calculate_attribute_counts&&(t.calculate_attribute_counts=Object(b.sortBy)(e.calculate_attribute_counts.map((function(e){return{taxonomy:e.taxonomy,query_type:e.queryType}})),["taxonomy","query_type"])),t}(i)}),[i]);return Object(m.a)({namespace:"/wc/store",resourceName:"products/collection-data",query:g(g({},o),{},{page:void 0,per_page:void 0,orderby:void 0,order:void 0},I),shouldSelect:q})}},23:function(e,t,r){var n=r(77);e.exports=function(e,t){if(null==e)return{};var r,o,c=n(e,t);if(Object.getOwnPropertySymbols){var u=Object.getOwnPropertySymbols(e);for(o=0;o<u.length;o++)r=u[o],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(c[r]=e[r])}return c},e.exports.default=e.exports,e.exports.__esModule=!0},25:function(e,t){e.exports=window.wp.isShallowEqual},28:function(e,t){e.exports=window.wp.htmlEntities},29:function(e,t){e.exports=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e},e.exports.default=e.exports,e.exports.__esModule=!0},294:function(e,t,r){e.exports=r(323)},295:function(e,t){},3:function(e,t){e.exports=window.React},30:function(e,t){function r(t){return e.exports=r=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},e.exports.default=e.exports,e.exports.__esModule=!0,r(t)}e.exports=r,e.exports.default=e.exports,e.exports.__esModule=!0},323:function(e,t,r){"use strict";r.r(t);var n=r(128),o=r(107),c=r(4),u=r.n(c),a=r(23),s=r.n(a),i=r(5),l=r.n(i),f=r(1),p=r(33),b=r(53),d=r(99),O=r(90),m=r(223),v=r(2),y=r(0),g=r(171),j=r(133),_=r(108),w=r(25),h=r.n(w),x=r(28),E=[{value:"preview-1",name:"In Stock",label:React.createElement(_.a,{name:"In Stock",count:3})},{value:"preview-2",name:"Out of sotck",label:React.createElement(_.a,{name:"Out of stock",count:3})},{value:"preview-3",name:"On backorder",label:React.createElement(_.a,{name:"On backorder",count:2})}],k=(r(295),["outofstock"]);function S(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}Object(o.a)({selector:".wp-block-woocommerce-stock-filter",Block:Object(n.a)((function(e){var t=e.attributes,r=e.isEditor,n=void 0!==r&&r,o=Object(y.useState)(Object(v.getSetting)("hideOutOfStockItems",!1)),c=l()(o,1)[0],a=Object(y.useState)(Object(v.getSetting)("stockStatusOptions",{})),i=l()(a,1)[0],w=i.outofstock,R=s()(i,k),P=Object(y.useState)(c?R:function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?S(Object(r),!0).forEach((function(t){u()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):S(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({outofstock:w},R)),M=l()(P,1)[0],T=Object(y.useState)([]),C=l()(T,2),A=C[0],N=C[1],D=Object(y.useState)(t.isPreview?E:[]),B=l()(D,2),F=B[0],L=B[1],q=Object(y.useState)(Object.entries(M).map((function(e){var t=l()(e,2);return{slug:t[0],name:t[1]}})).filter((function(e){return!!e.name})).sort((function(e,t){return e.slug.localeCompare(t.slug)}))),I=l()(q,1)[0],U=Object(O.a)(),G=l()(U,1)[0],Y=Object(O.b)("stock_status",[]),K=l()(Y,2),Q=K[0],V=K[1],W=Object(m.a)({queryStock:!0,queryState:G}),H=W.results,$=W.isLoading,z=Object(y.useCallback)((function(e){return H.stock_status_counts?H.stock_status_counts.find((function(t){var r=t.status,n=t.count;return r===e&&0!==Number(n)})):null}),[H]);Object(y.useEffect)((function(){if(!$&&!t.isPreview){var e=I.map((function(e){var r,n=z(e.slug);if(!(n||A.includes(e.slug)||(r=e.slug,null!=G&&G.stock_status&&G.stock_status.some((function(e){var t=e.status;return(void 0===t?[]:t).includes(r)})))))return null;var o=n?Number(n.count):0;return{value:e.slug,name:Object(x.decodeEntities)(e.name),label:React.createElement(_.a,{name:Object(x.decodeEntities)(e.name),count:t.showCounts?o:null})}})).filter(Boolean);L(e)}}),[t.showCounts,t.isPreview,$,z,A,G.stock_status,I]);var J=Object(y.useCallback)((function(e){n||e&&V(A)}),[n,V,A]);Object(y.useEffect)((function(){t.showFilterButton||J(A)}),[t.showFilterButton,A,J]);var X=Object(y.useMemo)((function(){return Q}),[Q]),Z=Object(b.a)(X),ee=Object(d.a)(Z);Object(y.useEffect)((function(){h()(ee,Z)||h()(A,Z)||N(Z)}),[A,Z,ee]);var te=Object(y.useCallback)((function(e){var t=function(e){return F.find((function(t){return t.value===e})).name},r=function(e){var r=e.filterAdded,n=e.filterRemoved,o=r?t(r):null,c=n?t(n):null;o?Object(p.speak)(Object(f.sprintf)(
/* translators: %s stock statuses (for example: 'instock'...) */
Object(f.__)("%s filter added.",'woocommerce'),o)):c&&Object(p.speak)(Object(f.sprintf)(
/* translators: %s stock statuses (for example:'instock'...) */
Object(f.__)("%s filter removed.",'woocommerce'),c))},n=A.includes(e),o=A.filter((function(t){return t!==e}));n?r({filterRemoved:e}):(o.push(e),o.sort(),r({filterAdded:e})),N(o)}),[A,F]);if(0===F.length)return null;var re="h".concat(t.headingLevel),ne=!t.isPreview&&!M,oe=!t.isPreview&&$;return React.createElement(React.Fragment,null,!n&&t.heading&&React.createElement(re,{className:"wc-block-stock-filter__title"},t.heading),React.createElement("div",{className:"wc-block-stock-filter"},React.createElement(g.a,{className:"wc-block-stock-filter-list",options:F,checked:A,onChange:te,isLoading:ne,isDisabled:oe}),t.showFilterButton&&React.createElement(j.a,{className:"wc-block-stock-filter__button",disabled:ne||oe,onClick:function(){return J(A)}})))})),getProps:function(e){return{attributes:{showCounts:"true"===e.dataset.showCounts,heading:e.dataset.heading,headingLevel:e.dataset.headingLevel||3,showFilterButton:"true"===e.dataset.showFilterButton}}}})},33:function(e,t){e.exports=window.wp.a11y},4:function(e,t){e.exports=function(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e},e.exports.default=e.exports,e.exports.__esModule=!0},40:function(e,t){e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},e.exports.default=e.exports,e.exports.__esModule=!0},41:function(e,t){function r(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}e.exports=function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e},e.exports.default=e.exports,e.exports.__esModule=!0},42:function(e,t,r){var n=r(71);e.exports=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&n(e,t)},e.exports.default=e.exports,e.exports.__esModule=!0},43:function(e,t,r){var n=r(21).default,o=r(29);e.exports=function(e,t){return!t||"object"!==n(t)&&"function"!=typeof t?o(e):t},e.exports.default=e.exports,e.exports.__esModule=!0},44:function(e,t,r){"use strict";var n=r(40),o=r.n(n),c=r(41),u=r.n(c),a=r(29),s=r.n(a),i=r(42),l=r.n(i),f=r(43),p=r.n(f),b=r(30),d=r.n(b),O=r(4),m=r.n(O),v=(r(10),r(3)),y=r(1),g=r(83),j=function(e){var t=e.imageUrl,r=void 0===t?"".concat(g.l,"/block-error.svg"):t,n=e.header,o=void 0===n?Object(y.__)("Oops!",'woocommerce'):n,c=e.text,u=void 0===c?Object(y.__)("There was an error loading the content.",'woocommerce'):c,a=e.errorMessage,s=e.errorMessagePrefix,i=void 0===s?Object(y.__)("Error:",'woocommerce'):s,l=e.button;return React.createElement("div",{className:"wc-block-error wc-block-components-error"},r&&React.createElement("img",{className:"wc-block-error__image wc-block-components-error__image",src:r,alt:""}),React.createElement("div",{className:"wc-block-error__content wc-block-components-error__content"},o&&React.createElement("p",{className:"wc-block-error__header wc-block-components-error__header"},o),u&&React.createElement("p",{className:"wc-block-error__text wc-block-components-error__text"},u),a&&React.createElement("p",{className:"wc-block-error__message wc-block-components-error__message"},i?i+" ":"",a),l&&React.createElement("p",{className:"wc-block-error__button wc-block-components-error__button"},l)))};r(81);var _=function(e){l()(c,e);var t,r,n=(t=c,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,n=d()(t);if(r){var o=d()(this).constructor;e=Reflect.construct(n,arguments,o)}else e=n.apply(this,arguments);return p()(this,e)});function c(){var e;o()(this,c);for(var t=arguments.length,r=new Array(t),u=0;u<t;u++)r[u]=arguments[u];return e=n.call.apply(n,[this].concat(r)),m()(s()(e),"state",{errorMessage:"",hasError:!1}),e}return u()(c,[{key:"render",value:function(){var e=this.props,t=e.header,r=e.imageUrl,n=e.showErrorMessage,o=e.text,c=e.errorMessagePrefix,u=e.renderError,a=e.button,s=this.state,i=s.errorMessage;return s.hasError?"function"==typeof u?u({errorMessage:i}):React.createElement(j,{errorMessage:n?i:null,header:t,imageUrl:r,text:o,errorMessagePrefix:c,button:a}):this.props.children}}],[{key:"getDerivedStateFromError",value:function(e){return void 0!==e.statusText&&void 0!==e.status?{errorMessage:React.createElement(React.Fragment,null,React.createElement("strong",null,e.status),": ",e.statusText),hasError:!0}:{errorMessage:e.message,hasError:!0}}}]),c}(v.Component);_.defaultProps={showErrorMessage:!0},t.a=_},46:function(e,t,r){var n=r(94),o=r(95),c=r(67),u=r(96);e.exports=function(e){return n(e)||o(e)||c(e)||u()},e.exports.default=e.exports,e.exports.__esModule=!0},5:function(e,t,r){var n=r(84),o=r(85),c=r(67),u=r(86);e.exports=function(e,t){return n(e)||o(e,t)||c(e,t)||u()},e.exports.default=e.exports,e.exports.__esModule=!0},51:function(e,t,r){"use strict";var n=r(4),o=r.n(n),c=r(0),u=r(6),a=r.n(u);function s(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function i(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?s(Object(r),!0).forEach((function(t){o()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):s(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}t.a=function(e){var t,r=e.label,n=e.screenReaderLabel,o=e.wrapperElement,u=e.wrapperProps,s=void 0===u?{}:u,l=null!=r,f=null!=n;return!l&&f?(t=o||"span",s=i(i({},s),{},{className:a()(s.className,"screen-reader-text")}),React.createElement(t,s,n)):(t=o||c.Fragment,l&&f&&r!==n?React.createElement(t,s,React.createElement("span",{"aria-hidden":"true"},r),React.createElement("span",{className:"screen-reader-text"},n)):React.createElement(t,s,r))}},53:function(e,t,r){"use strict";r.d(t,"a",(function(){return u}));var n=r(0),o=r(25),c=r.n(o);function u(e){var t=Object(n.useRef)(e);return c()(e,t.current)||(t.current=e),t.current}},6:function(e,t,r){var n;!function(){"use strict";var r={}.hasOwnProperty;function o(){for(var e=[],t=0;t<arguments.length;t++){var n=arguments[t];if(n){var c=typeof n;if("string"===c||"number"===c)e.push(n);else if(Array.isArray(n)){if(n.length){var u=o.apply(null,n);u&&e.push(u)}}else if("object"===c)if(n.toString===Object.prototype.toString)for(var a in n)r.call(n,a)&&n[a]&&e.push(a);else e.push(n.toString())}}return e.join(" ")}e.exports?(o.default=o,e.exports=o):void 0===(n=function(){return o}.apply(t,[]))||(e.exports=n)}()},64:function(e,t,r){"use strict";r.d(t,"a",(function(){return c}));var n=r(0),o=Object(n.createContext)("page"),c=function(){return Object(n.useContext)(o)};o.Provider},67:function(e,t,r){var n=r(68);e.exports=function(e,t){if(e){if("string"==typeof e)return n(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?n(e,t):void 0}},e.exports.default=e.exports,e.exports.__esModule=!0},68:function(e,t){e.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n},e.exports.default=e.exports,e.exports.__esModule=!0},7:function(e,t){e.exports=window.lodash},71:function(e,t){function r(t,n){return e.exports=r=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},e.exports.default=e.exports,e.exports.__esModule=!0,r(t,n)}e.exports=r,e.exports.default=e.exports,e.exports.__esModule=!0},77:function(e,t){e.exports=function(e,t){if(null==e)return{};var r,n,o={},c=Object.keys(e);for(n=0;n<c.length;n++)r=c[n],t.indexOf(r)>=0||(o[r]=e[r]);return o},e.exports.default=e.exports,e.exports.__esModule=!0},79:function(e,t,r){"use strict";var n=r(80);function o(){}function c(){}c.resetWarningCache=o,e.exports=function(){function e(e,t,r,o,c,u){if(u!==n){var a=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw a.name="Invariant Violation",a}}function t(){return e}e.isRequired=e;var r={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:c,resetWarningCache:o};return r.PropTypes=r,r}},8:function(e,t){e.exports=window.wc.wcBlocksData},80:function(e,t,r){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},81:function(e,t){},82:function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));var n=r(3);function o(e,t,r){void 0===r&&(r={});var o=r.maxWait,c=Object(n.useRef)(null),u=Object(n.useRef)([]),a=r.leading,s=void 0===r.trailing||r.trailing,i=Object(n.useRef)(!1),l=Object(n.useRef)(null),f=Object(n.useRef)(!1),p=Object(n.useRef)(e);p.current=e;var b=Object(n.useCallback)((function(){clearTimeout(l.current),clearTimeout(c.current),c.current=null,u.current=[],l.current=null,i.current=!1}),[]);Object(n.useEffect)((function(){return f.current=!1,function(){f.current=!0}}),[]);var d=Object(n.useCallback)((function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];u.current=e,clearTimeout(l.current),i.current&&(i.current=!1),l.current||!a||i.current||(p.current.apply(p,e),i.current=!0),l.current=setTimeout((function(){var t=!0;a&&i.current&&(t=!1),b(),!f.current&&s&&t&&p.current.apply(p,e)}),t),o&&!c.current&&s&&(c.current=setTimeout((function(){var e=u.current;b(),f.current||p.current.apply(null,e)}),o))}),[o,t,b,a,s]),O=Object(n.useCallback)((function(){l.current&&(p.current.apply(null,u.current),b())}),[b]);return[d,b,O]}},83:function(e,t,r){"use strict";r.d(t,"n",(function(){return c})),r.d(t,"l",(function(){return u})),r.d(t,"k",(function(){return a})),r.d(t,"m",(function(){return s})),r.d(t,"i",(function(){return i})),r.d(t,"d",(function(){return l})),r.d(t,"f",(function(){return f})),r.d(t,"j",(function(){return p})),r.d(t,"c",(function(){return b})),r.d(t,"e",(function(){return d})),r.d(t,"g",(function(){return O})),r.d(t,"a",(function(){return m})),r.d(t,"h",(function(){return v})),r.d(t,"b",(function(){return y}));var n,o=r(2),c=Object(o.getSetting)("wcBlocksConfig",{buildPhase:1,pluginUrl:"",productCount:0,defaultAvatar:"",restApiRoutes:{},wordCountType:"words"}),u=c.pluginUrl+"images/",a=c.pluginUrl+"build/",s=c.buildPhase,i=null===(n=o.STORE_PAGES.shop)||void 0===n?void 0:n.permalink,l=(o.STORE_PAGES.checkout.id,o.STORE_PAGES.checkout.permalink),f=o.STORE_PAGES.privacy.permalink,p=(o.STORE_PAGES.privacy.title,o.STORE_PAGES.terms.permalink),b=(o.STORE_PAGES.terms.title,o.STORE_PAGES.cart.id,o.STORE_PAGES.cart.permalink),d=o.STORE_PAGES.myaccount.permalink?o.STORE_PAGES.myaccount.permalink:Object(o.getSetting)("wpLoginUrl","/wp-login.php"),O=Object(o.getSetting)("shippingCountries",{}),m=Object(o.getSetting)("allowedCountries",{}),v=Object(o.getSetting)("shippingStates",{}),y=Object(o.getSetting)("allowedStates",{})},84:function(e,t){e.exports=function(e){if(Array.isArray(e))return e},e.exports.default=e.exports,e.exports.__esModule=!0},85:function(e,t){e.exports=function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,c=[],_n=!0,u=!1;try{for(r=r.call(e);!(_n=(n=r.next()).done)&&(c.push(n.value),!t||c.length!==t);_n=!0);}catch(e){u=!0,o=e}finally{try{_n||null==r.return||r.return()}finally{if(u)throw o}}return c}},e.exports.default=e.exports,e.exports.__esModule=!0},86:function(e,t){e.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},e.exports.default=e.exports,e.exports.__esModule=!0},90:function(e,t,r){"use strict";r.d(t,"a",(function(){return b})),r.d(t,"b",(function(){return d})),r.d(t,"c",(function(){return O}));var n=r(5),o=r.n(n),c=r(8),u=r(11),a=r(0),s=r(25),i=r.n(s),l=r(53),f=r(99),p=r(64),b=function(e){var t=Object(p.a)();e=e||t;var r=Object(u.useSelect)((function(t){return t(c.QUERY_STATE_STORE_KEY).getValueForQueryContext(e,void 0)}),[e]),n=Object(u.useDispatch)(c.QUERY_STATE_STORE_KEY).setValueForQueryContext;return[r,Object(a.useCallback)((function(t){n(e,t)}),[e,n])]},d=function(e,t,r){var n=Object(p.a)();r=r||n;var o=Object(u.useSelect)((function(n){return n(c.QUERY_STATE_STORE_KEY).getValueForQueryKey(r,e,t)}),[r,e]),s=Object(u.useDispatch)(c.QUERY_STATE_STORE_KEY).setQueryValue;return[o,Object(a.useCallback)((function(t){s(r,e,t)}),[r,e,s])]},O=function(e,t){var r=Object(p.a)(),n=b(t=t||r),c=o()(n,2),u=c[0],s=c[1],d=Object(l.a)(u),O=Object(l.a)(e),m=Object(f.a)(O),v=Object(a.useRef)(!1);return Object(a.useEffect)((function(){i()(m,O)||(s(Object.assign({},d,O)),v.current=!0)}),[d,O,m,s]),v.current?[u,s]:[e,s]}},94:function(e,t,r){var n=r(68);e.exports=function(e){if(Array.isArray(e))return n(e)},e.exports.default=e.exports,e.exports.__esModule=!0},95:function(e,t){e.exports=function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)},e.exports.default=e.exports,e.exports.__esModule=!0},96:function(e,t){e.exports=function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},e.exports.default=e.exports,e.exports.__esModule=!0},99:function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));var n=r(3);function o(e,t){var r=Object(n.useRef)();return Object(n.useEffect)((function(){r.current===e||t&&!t(e,r.current)||(r.current=e)}),[e,t]),r.current}}});woocommerce-blocks/build/price-format.asset.php000064400000000173151335517640015667 0ustar00<?php return array('dependencies' => array('wc-settings', 'wp-polyfill'), 'version' => 'c0b15c5567c84cb7c5347f3bc4b67629');woocommerce-blocks/build/atomic-block-components/category-list.js000064400000001541151335517640021323 0ustar00(window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[10],{488:function(e,t,c){"use strict";c.r(t);var n=c(5),o=c.n(n),a=c(0),r=c(1),s=(c(2),c(6)),l=c.n(s),u=c(45),i=c(7),b=c(86);c(563),t.default=Object(b.withProductDataContext)((function(e){var t=e.className,c=Object(u.useInnerBlockLayoutContext)().parentClassName,n=Object(u.useProductDataContext)().product;return Object(i.isEmpty)(n.categories)?null:Object(a.createElement)("div",{className:l()(t,"wc-block-components-product-category-list",o()({},"".concat(c,"__product-category-list"),c))},Object(r.__)("Categories:",'woocommerce')," ",Object(a.createElement)("ul",null,Object.values(n.categories).map((function(e){var t=e.name,c=e.link,n=e.slug;return Object(a.createElement)("li",{key:"category-list-item-".concat(n)},Object(a.createElement)("a",{href:c},t))}))))}))},563:function(e,t){}}]);woocommerce-blocks/build/atomic-block-components/stock-indicator.js000064400000002402151335517640021627 0ustar00(window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[15],{490:function(o,c,t){"use strict";t.r(c);var n=t(5),e=t.n(n),r=t(0),s=t(1),a=(t(2),t(6)),i=t.n(a),u=t(45),k=t(86),b=(t(565),function(o){return Object(s.sprintf)(
/* translators: %d stock amount (number of items in stock for product) */
Object(s.__)("%d left in stock",'woocommerce'),o)});c.default=Object(k.withProductDataContext)((function(o){var c,t=o.className,n=Object(u.useInnerBlockLayoutContext)().parentClassName,a=Object(u.useProductDataContext)().product;if(!a.id||!a.is_purchasable)return null;var k=!!a.is_in_stock,d=a.low_stock_remaining,l=a.is_on_backorder;return Object(r.createElement)("div",{className:i()(t,"wc-block-components-product-stock-indicator",(c={},e()(c,"".concat(n,"__stock-indicator"),n),e()(c,"wc-block-components-product-stock-indicator--in-stock",k),e()(c,"wc-block-components-product-stock-indicator--out-of-stock",!k),e()(c,"wc-block-components-product-stock-indicator--low-stock",!!d),e()(c,"wc-block-components-product-stock-indicator--available-on-backorder",!!l),c))},d?b(d):function(o,c){return c?Object(s.__)("Available on backorder",'woocommerce'):o?Object(s.__)("In Stock",'woocommerce'):Object(s.__)("Out of Stock",'woocommerce')}(k,l))}))},565:function(o,c){}}]);woocommerce-blocks/build/atomic-block-components/button-frontend.js000064400000010733151335517640021670 0ustar00(window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[9],{361:function(t,e){},362:function(t,e,n){"use strict";n.d(e,"a",(function(){return b}));var c=n(5),o=n.n(c),r=n(0),a=n(11),i=n(8),u=n(28),d=n(32),s=n(54),l=function(t,e){var n=t.find((function(t){return t.id===e}));return n?n.quantity:0},b=function(t){var e=Object(a.useDispatch)(i.CART_STORE_KEY).addItemToCart,n=Object(d.a)(),c=n.cartItems,b=n.cartIsLoading,f=Object(s.a)(),p=f.addErrorNotice,O=f.removeNotice,v=Object(r.useState)(!1),j=o()(v,2),m=j[0],_=j[1],g=Object(r.useRef)(l(c,t));return Object(r.useEffect)((function(){var e=l(c,t);e!==g.current&&(g.current=e)}),[c,t]),{cartQuantity:Number.isFinite(g.current)?g.current:0,addingToCart:m,cartIsLoading:b,addToCart:function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;return _(!0),e(t,n).then((function(){O("add-to-cart")})).catch((function(t){p(Object(u.decodeEntities)(t.message),{context:"wc/all-products",id:"add-to-cart",isDismissible:!0})})).finally((function(){_(!1)}))}}}},389:function(t,e,n){"use strict";n.r(e);var c=n(14),o=n.n(c),r=n(4),a=n.n(r),i=(n(10),n(6)),u=n.n(i),d=n(1),s=n(52),l=n(362),b=n(28),f=n(101),p=n(249),O=(n(361),function(t){var e=t.product,n=e.id,c=e.permalink,r=e.add_to_cart,a=e.has_options,i=e.is_purchasable,f=e.is_in_stock,p=Object(s.a)().dispatchStoreEvent,O=Object(l.a)(n),v=O.cartQuantity,j=O.addingToCart,m=O.addToCart,_=Number.isFinite(v)&&v>0,g=!a&&i&&f,w=Object(b.decodeEntities)((null==r?void 0:r.description)||""),h=_?Object(d.sprintf)(
/* translators: %s number of products in cart. */
Object(d._n)("%d in cart","%d in cart",v,'woocommerce'),v):Object(b.decodeEntities)((null==r?void 0:r.text)||Object(d.__)("Add to cart",'woocommerce')),k=g?"button":"a",N={};return g?N.onClick=function(){m(),p("cart-add-item",{product:e})}:(N.href=c,N.rel="nofollow",N.onClick=function(){p("product-view-link",{product:e})}),React.createElement(k,o()({"aria-label":w,className:u()("wp-block-button__link","add_to_cart_button","wc-block-components-product-button__button",{loading:j,added:_}),disabled:j},N),h)}),v=function(){return React.createElement("button",{className:u()("wp-block-button__link","add_to_cart_button","wc-block-components-product-button__button","wc-block-components-product-button__button--placeholder"),disabled:!0})};e.default=Object(p.withProductDataContext)((function(t){var e=t.className,n=Object(f.useInnerBlockLayoutContext)().parentClassName,c=Object(f.useProductDataContext)().product;return React.createElement("div",{className:u()(e,"wp-block-button","wc-block-components-product-button",a()({},"".concat(n,"__product-add-to-cart"),n))},c.id?React.createElement(O,{product:c}):React.createElement(v,null))}))},54:function(t,e,n){"use strict";n.d(e,"a",(function(){return d}));var c=n(4),o=n.n(c),r=n(0),a=n(103);function i(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(t);e&&(c=c.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,c)}return n}function u(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?i(Object(n),!0).forEach((function(e){o()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):i(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var d=function(){var t=Object(a.b)(),e=t.notices,n=t.createNotice,c=t.removeNotice,o=t.setIsSuppressed,i=Object(r.useRef)(e);Object(r.useEffect)((function(){i.current=e}),[e]);var d=Object(r.useMemo)((function(){return{hasNoticesOfType:function(t){return i.current.some((function(e){return e.type===t}))},removeNotices:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;i.current.forEach((function(e){null!==t&&e.status!==t||c(e.id)}))},removeNotice:c}}),[c]),s=Object(r.useMemo)((function(){return{addDefaultNotice:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};n("default",t,u({},e))},addErrorNotice:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};n("error",t,u({},e))},addWarningNotice:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};n("warning",t,u({},e))},addInfoNotice:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};n("info",t,u({},e))},addSuccessNotice:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};n("success",t,u({},e))}}}),[n]);return u(u(u({notices:e},d),s),{},{setIsSuppressed:o})}}}]);woocommerce-blocks/build/atomic-block-components/title-frontend.js000064400000007175151335517640021504 0ustar00(window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[19],{150:function(e,t,n){"use strict";var c=n(14),o=n.n(c),r=n(23),a=n.n(r),i=n(28),s=n(6),l=n.n(s),u=(n(182),["className","disabled","name","permalink"]);t.a=function(e){var t=e.className,n=void 0===t?"":t,c=e.disabled,r=void 0!==c&&c,s=e.name,p=e.permalink,b=void 0===p?"":p,d=a()(e,u),f=l()("wc-block-components-product-name",n);return r?React.createElement("span",o()({className:f},d,{dangerouslySetInnerHTML:{__html:Object(i.decodeEntities)(s)}})):React.createElement("a",o()({className:f,href:b},d,{dangerouslySetInnerHTML:{__html:Object(i.decodeEntities)(s)}}))}},182:function(e,t){},188:function(e,t,n){"use strict";n.d(t,"a",(function(){return c}));var c=function(e,t){var n=[];return Object.keys(e).forEach((function(c){if(void 0!==t[c])switch(e[c].type){case"boolean":n[c]="false"!==t[c]&&!1!==t[c];break;case"number":n[c]=parseInt(t[c],10);break;case"array":case"object":n[c]=JSON.parse(t[c]);break;default:n[c]=t[c]}else n[c]=e[c].default})),n}},345:function(e,t,n){"use strict";var c=n(14),o=n.n(c),r=n(188);t.a=function(e){return function(t){return function(n){var c=Object(r.a)(e,n);return React.createElement(t,o()({},n,c))}}}},357:function(e,t,n){"use strict";n.d(t,"a",(function(){return o})),n(275);var c=n(83),o=function(){return c.m>1}},359:function(e,t){},409:function(e,t,n){"use strict";n.r(t);var c=n(345),o=n(4),r=n.n(o),a=(n(10),n(6)),i=n.n(a),s=n(101),l=n(274),u=n(357),p=function(e){var t=e.color,n=e.fontSize;return Object(u.a)()?{color:t,fontSize:n}:{}},b=n(249),d=n(150),f=n(52),m=(n(359),Object(b.withProductDataContext)((function(e){var t,n,c,o=e.className,a=e.headingLevel,b=void 0===a?2:a,m=e.showProductLink,O=void 0===m||m,j=e.align,y=e.color,v=e.customColor,k=e.fontSize,w=e.customFontSize,g=Object(s.useInnerBlockLayoutContext)().parentClassName,h=Object(s.useProductDataContext)().product,S=Object(f.a)().dispatchStoreEvent,E="h".concat(b),P=Object(l.getColorClassName)("color",y),N=Object(l.getFontSizeClass)(k),z=i()((t={"has-text-color":y||v,"has-font-size":k||w},r()(t,P,P),r()(t,N,N),t));return h.id?React.createElement(E,{className:i()(o,"wc-block-components-product-title",(n={},r()(n,"".concat(g,"__product-title"),g),r()(n,"wc-block-components-product-title--align-".concat(j),j&&Object(u.a)()),n))},React.createElement(d.a,{className:i()(r()({},z,Object(u.a)())),disabled:!O,name:h.name,permalink:h.permalink,rel:O?"nofollow":null,style:p({color:v,fontSize:w}),onClick:function(){S("product-view-link",{product:h})}})):React.createElement(E,{className:i()(o,"wc-block-components-product-title",(c={},r()(c,"".concat(g,"__product-title"),g),r()(c,"wc-block-components-product-title--align-".concat(j),j&&Object(u.a)()),r()(c,z,Object(u.a)()),c)),style:p({color:v,fontSize:w})})})));function O(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(e);t&&(c=c.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,c)}return n}function j(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?O(Object(n),!0).forEach((function(t){r()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):O(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var y={headingLevel:{type:"number",default:2},showProductLink:{type:"boolean",default:!0},productId:{type:"number",default:0}};Object(u.a)()&&(y=j(j({},y),{},{align:{type:"string"},color:{type:"string"},customColor:{type:"string"},fontSize:{type:"string"},customFontSize:{type:"number"}}));var v=y;t.default=Object(c.a)(v)(m)}}]);woocommerce-blocks/build/atomic-block-components/sku.js000064400000001151151335517640017334 0ustar00(window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[14],{487:function(t,c,e){"use strict";e.r(c);var n=e(5),o=e.n(n),u=e(0),s=e(1),a=(e(2),e(6)),r=e.n(a),l=e(45),b=e(86);e(562),c.default=Object(b.withProductDataContext)((function(t){var c=t.className,e=Object(l.useInnerBlockLayoutContext)().parentClassName,n=Object(l.useProductDataContext)().product.sku;return n?Object(u.createElement)("div",{className:r()(c,"wc-block-components-product-sku",o()({},"".concat(e,"__product-sku"),e))},Object(s.__)("SKU:",'woocommerce')," ",Object(u.createElement)("strong",null,n)):null}))},562:function(t,c){}}]);woocommerce-blocks/build/atomic-block-components/add-to-cart-frontend.js000064400000074365151335517640022467 0ustar00(window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[8],{127:function(e,t,r){"use strict";r.d(t,"b",(function(){return g})),r.d(t,"a",(function(){return y}));var n=r(21),c=r.n(n),o=r(4),a=r.n(o),s=r(23),i=r.n(s),u=r(5),l=r.n(u),f=r(0),d=r(7),b=r(25),p=r.n(b);function m(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function v(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?m(Object(r),!0).forEach((function(t){a()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):m(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function O(e){var t=function(e,t){if("object"!==c()(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!==c()(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===c()(t)?t:String(t)}var h=Object(f.createContext)({getValidationError:function(){return""},setValidationErrors:function(e){},clearValidationError:function(e){},clearAllValidationErrors:function(){},hideValidationError:function(){},showValidationError:function(){},showAllValidationErrors:function(){},hasValidationErrors:!1,getValidationErrorId:function(e){return e}}),g=function(){return Object(f.useContext)(h)},y=function(e){var t=e.children,r=Object(f.useState)({}),n=l()(r,2),c=n[0],o=n[1],s=Object(f.useCallback)((function(e){return c[e]}),[c]),u=Object(f.useCallback)((function(e){var t=c[e];return!t||t.hidden?"":"validate-error-".concat(e)}),[c]),b=Object(f.useCallback)((function(e){o((function(t){return t[e]?(t[e],i()(t,[e].map(O))):t}))}),[]),m=Object(f.useCallback)((function(){o({})}),[]),g=Object(f.useCallback)((function(e){e&&o((function(t){return e=Object(d.pickBy)(e,(function(e,r){return!("string"!=typeof e.message||t.hasOwnProperty(r)&&p()(t[r],e))})),0===Object.values(e).length?t:v(v({},t),e)}))}),[]),y=Object(f.useCallback)((function(e,t){o((function(r){if(!r.hasOwnProperty(e))return r;var n=v(v({},r[e]),t);return p()(r[e],n)?r:v(v({},r),{},a()({},e,n))}))}),[]),j={getValidationError:s,setValidationErrors:g,clearValidationError:b,clearAllValidationErrors:m,hideValidationError:Object(f.useCallback)((function(e){y(e,{hidden:!0})}),[y]),showValidationError:Object(f.useCallback)((function(e){y(e,{hidden:!1})}),[y]),showAllValidationErrors:Object(f.useCallback)((function(){o((function(e){var t={};return Object.keys(e).forEach((function(r){e[r].hidden&&(t[r]=v(v({},e[r]),{},{hidden:!1}))})),0===Object.values(t).length?e:v(v({},e),t)}))}),[]),hasValidationErrors:Object.keys(c).length>0,getValidationErrorId:u};return React.createElement(h.Provider,{value:j},t)}},138:function(e,t,r){"use strict";r(180),t.a=function(){return React.createElement("span",{className:"wc-block-components-spinner","aria-hidden":"true"})}},143:function(e,t,r){"use strict";var n=r(14),c=r.n(n),o=r(23),a=r.n(o),s=r(76),i=r(6),u=r.n(i),l=r(138),f=(r(251),["className","showSpinner","children"]);t.a=function(e){var t=e.className,r=e.showSpinner,n=void 0!==r&&r,o=e.children,i=a()(e,f),d=u()("wc-block-components-button",t,{"wc-block-components-button--loading":n});return React.createElement(s.a,c()({className:d},i),n&&React.createElement(l.a,null),React.createElement("span",{className:"wc-block-components-button__text"},o))}},180:function(e,t){},188:function(e,t,r){"use strict";r.d(t,"a",(function(){return n}));var n=function(e,t){var r=[];return Object.keys(e).forEach((function(n){if(void 0!==t[n])switch(e[n].type){case"boolean":r[n]="false"!==t[n]&&!1!==t[n];break;case"number":r[n]=parseInt(t[n],10);break;case"array":case"object":r[n]=JSON.parse(t[n]);break;default:r[n]=t[n]}else r[n]=e[n].default})),r}},191:function(e,t,r){"use strict";r.d(t,"a",(function(){return c}));var n=r(98),c=function(e,t){return function(r){var c=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10,o=n.a.addEventCallback(e,r,c);return t(o),function(){t(n.a.removeEventCallback(e,o.id))}}}},193:function(e,t,r){"use strict";r.d(t,"a",(function(){return b})),r.d(t,"b",(function(){return p}));var n=r(21),c=r.n(n),o=r(39),a=r.n(o),s=r(27),i=r.n(s),u=function(e,t){return e[t]?Array.from(e[t].values()).sort((function(e,t){return e.priority-t.priority})):[]},l=r(35);function f(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return d(e,void 0);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?d(e,void 0):void 0}}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,c=function(){};return{s:c,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:c}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function d(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var b=function(){var e=a()(i.a.mark((function e(t,r,n){var o,a,s,l,d,b;return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:o=u(t,r),a=[],s=f(o),e.prev=3,s.s();case 5:if((l=s.n()).done){e.next=19;break}return d=l.value,e.prev=7,e.next=10,Promise.resolve(d.callback(n));case 10:b=e.sent,"object"===c()(b)&&a.push(b),e.next=17;break;case 14:e.prev=14,e.t0=e.catch(7),console.error(e.t0);case 17:e.next=5;break;case 19:e.next=24;break;case 21:e.prev=21,e.t1=e.catch(3),s.e(e.t1);case 24:return e.prev=24,s.f(),e.finish(24);case 27:return e.abrupt("return",!a.length||a);case 28:case"end":return e.stop()}}),e,null,[[3,21,24,27],[7,14]])})));return function(_x,t,r){return e.apply(this,arguments)}}(),p=function(){var e=a()(i.a.mark((function e(t,r,n){var o,a,s,d,b,p;return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:o=[],a=u(t,r),s=f(a),e.prev=3,s.s();case 5:if((d=s.n()).done){e.next=28;break}return b=d.value,e.prev=7,e.next=10,Promise.resolve(b.callback(n));case 10:if(p=e.sent,"object"===c()(p)&&null!==p){e.next=13;break}return e.abrupt("continue",26);case 13:if(p.hasOwnProperty("type")){e.next=15;break}throw new Error("Returned objects from event emitter observers must return an object with a type property");case 15:if(!Object(l.a)(p)&&!Object(l.b)(p)){e.next=18;break}return o.push(p),e.abrupt("return",o);case 18:o.push(p),e.next=26;break;case 21:return e.prev=21,e.t0=e.catch(7),console.error(e.t0),o.push({type:"error"}),e.abrupt("return",o);case 26:e.next=5;break;case 28:e.next=33;break;case 30:e.prev=30,e.t1=e.catch(3),s.e(e.t1);case 33:return e.prev=33,s.f(),e.finish(33);case 36:return e.abrupt("return",o);case 37:case"end":return e.stop()}}),e,null,[[3,30,33,36],[7,21]])})));return function(t,r,n){return e.apply(this,arguments)}}()},250:function(e,t){},251:function(e,t){},258:function(e,t,r){"use strict";r.d(t,"a",(function(){return c})),r(10);var n=r(127),c=(r(250),function(e){var t=e.errorMessage,r=void 0===t?"":t,c=e.propertyName,o=void 0===c?"":c,a=e.elementId,s=void 0===a?"":a,i=Object(n.b)(),u=i.getValidationError,l=i.getValidationErrorId;if(!r||"string"!=typeof r){var f=u(o)||{};if(!f.message||f.hidden)return null;r=f.message}return React.createElement("div",{className:"wc-block-components-validation-error",role:"alert"},React.createElement("p",{id:l(s)},r))})},345:function(e,t,r){"use strict";var n=r(14),c=r.n(n),o=r(188);t.a=function(e){return function(t){return function(r){var n=Object(o.a)(e,r);return React.createElement(t,c()({},r,n))}}}},35:function(e,t,r){"use strict";r.d(t,"a",(function(){return i})),r.d(t,"b",(function(){return u})),r.d(t,"c",(function(){return f}));var n,c,o=r(49);!function(e){e.SUCCESS="success",e.FAIL="failure",e.ERROR="error"}(n||(n={})),function(e){e.PAYMENTS="wc/payment-area",e.EXPRESS_PAYMENTS="wc/express-payment-area"}(c||(c={}));var a=function(e,t){return Object(o.b)(e)&&"type"in e&&e.type===t},s=function(e){return a(e,n.SUCCESS)},i=function(e){return a(e,n.ERROR)},u=function(e){return a(e,n.FAIL)},l=function(e){return!Object(o.b)(e)||void 0===e.retry||!0===e.retry},f=function(){return{responseTypes:n,noticeContexts:c,shouldRetry:l,isSuccessResponse:s,isErrorResponse:i,isFailResponse:u}}},362:function(e,t,r){"use strict";r.d(t,"a",(function(){return d}));var n=r(5),c=r.n(n),o=r(0),a=r(11),s=r(8),i=r(28),u=r(32),l=r(54),f=function(e,t){var r=e.find((function(e){return e.id===t}));return r?r.quantity:0},d=function(e){var t=Object(a.useDispatch)(s.CART_STORE_KEY).addItemToCart,r=Object(u.a)(),n=r.cartItems,d=r.cartIsLoading,b=Object(l.a)(),p=b.addErrorNotice,m=b.removeNotice,v=Object(o.useState)(!1),O=c()(v,2),h=O[0],g=O[1],y=Object(o.useRef)(f(n,e));return Object(o.useEffect)((function(){var t=f(n,e);t!==y.current&&(y.current=t)}),[n,e]),{cartQuantity:Number.isFinite(y.current)?y.current:0,addingToCart:h,cartIsLoading:d,addToCart:function(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;return g(!0),t(e,r).then((function(){m("add-to-cart")})).catch((function(e){p(Object(i.decodeEntities)(e.message),{context:"wc/all-products",id:"add-to-cart",isDismissible:!0})})).finally((function(){g(!1)}))}}}},368:function(e,t){},369:function(e,t,r){"use strict";var n=r(34),c=React.createElement(n.SVG,{xmlns:"http://www.w3.org/2000/SVG",viewBox:"0 0 24 24"},React.createElement("path",{fill:"none",d:"M0 0h24v24H0z"}),React.createElement("path",{d:"M9 16.2L4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4L9 16.2z"}));t.a=c},370:function(e,t){},403:function(e,t,r){"use strict";r.r(t);var n=r(345),c=(r(10),r(6)),o=r.n(c),a=r(5),s=r.n(a),i=r(0),u=r(1),l=r(53),f=function(e){return e.is_purchasable||!1},d={status:"pristine",hasError:!1,quantity:1,processingResponse:null,requestParams:{}},b=function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=e?"set_has_error":"set_no_error";return{type:t}},p=r(4),m=r.n(p);function v(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function O(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?v(Object(r),!0).forEach((function(t){m()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):v(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var h="idle",g=function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:d,r=arguments.length>1?arguments[1]:void 0,n=r.quantity,c=r.type,o=r.data;switch(c){case"set_pristine":e=d;break;case"set_idle":e=t.status!==h?O(O({},t),{},{status:h}):t;break;case"set_disabled":e="disabled"!==t.status?O(O({},t),{},{status:"disabled"}):t;break;case"set_quantity":e=n!==t.quantity?O(O({},t),{},{quantity:n}):t;break;case"set_request_params":e=O(O({},t),{},{requestParams:O(O({},t.requestParams),o)});break;case"set_processing_response":e=O(O({},t),{},{processingResponse:o});break;case"set_processing":e=!1===(e="processing"!==t.status?O(O({},t),{},{status:"processing",hasError:!1}):t).hasError?e:O(O({},e),{},{hasError:!1});break;case"set_before_processing":e="before_processing"!==t.status?O(O({},t),{},{status:"before_processing",hasError:!1}):t;break;case"set_after_processing":e="after_processing"!==t.status?O(O({},t),{},{status:"after_processing"}):t;break;case"set_has_error":e=t.hasError?t:O(O({},t),{},{hasError:!0}),e="processing"===t.status||"before_processing"===t.status?O(O({},e),{},{status:h}):e;break;case"set_no_error":e=t.hasError?O(O({},t),{},{hasError:!1}):t}return e!==t&&"set_pristine"!==c&&"pristine"===e.status&&(e.status=h),e},y=r(98),j=r(191),E=function(e){return{onAddToCartAfterProcessingWithSuccess:Object(j.a)("add_to_cart_after_processing_with_success",e),onAddToCartProcessingWithError:Object(j.a)("add_to_cart_after_processing_with_error",e),onAddToCartBeforeProcessing:Object(j.a)("add_to_cart_before_processing",e)}},w=r(193),_=r(127),P=r(54),k=r(35),R=Object(i.createContext)({product:{},productType:"simple",productIsPurchasable:!0,productHasOptions:!1,supportsFormElements:!0,showFormElements:!1,quantity:0,minQuantity:1,maxQuantity:99,requestParams:{},isIdle:!1,isDisabled:!1,isProcessing:!1,isBeforeProcessing:!1,isAfterProcessing:!1,hasError:!1,eventRegistration:{onAddToCartAfterProcessingWithSuccess:function(e){},onAddToCartAfterProcessingWithError:function(e){},onAddToCartBeforeProcessing:function(e){}},dispatchActions:{resetForm:function(){},submitForm:function(){},setQuantity:function(e){},setHasError:function(e){},setAfterProcessing:function(e){},setRequestParams:function(e){}}}),C=function(){return Object(i.useContext)(R)},A=function(e){var t=e.children,r=e.product,n=e.showFormElements,c=Object(i.useReducer)(g,d),o=s()(c,2),a=o[0],p=o[1],m=Object(i.useReducer)(y.b,{}),v=s()(m,2),O=v[0],h=v[1],j=Object(l.a)(O),C=Object(P.a)(),A=C.addErrorNotice,S=C.removeNotices,N=Object(_.b)().setValidationErrors,D=Object(k.c)(),x=D.isSuccessResponse,T=D.isErrorResponse,V=D.isFailResponse,q=Object(i.useMemo)((function(){return{onAddToCartAfterProcessingWithSuccess:E(h).onAddToCartAfterProcessingWithSuccess,onAddToCartAfterProcessingWithError:E(h).onAddToCartAfterProcessingWithError,onAddToCartBeforeProcessing:E(h).onAddToCartBeforeProcessing}}),[h]),I=Object(i.useMemo)((function(){return{resetForm:function(){p({type:"set_pristine"})},submitForm:function(){p({type:"set_before_processing"})},setQuantity:function(e){p(function(e){return{type:"set_quantity",quantity:e}}(e))},setHasError:function(e){p(b(e))},setRequestParams:function(e){p(function(e){return{type:"set_request_params",data:e}}(e))},setAfterProcessing:function(e){p({type:"set_processing_response",data:e}),p({type:"set_after_processing"})}}}),[]);Object(i.useEffect)((function(){var e=a.status,t=!r.id||!f(r);"disabled"!==e||t?"disabled"!==e&&t&&p({type:"set_disabled"}):p({type:"set_idle"})}),[a.status,r,p]),Object(i.useEffect)((function(){"before_processing"===a.status&&(S("error"),Object(w.a)(j,"add_to_cart_before_processing",{}).then((function(e){!0!==e?(Array.isArray(e)&&e.forEach((function(e){var t=e.errorMessage,r=e.validationErrors;t&&A(t),r&&N(r)})),p({type:"set_idle"})):p({type:"set_processing"})})))}),[a.status,N,A,S,p,j]),Object(i.useEffect)((function(){if("after_processing"===a.status){var e={processingResponse:a.processingResponse},t=function(e){var t=!1;return e.forEach((function(e){var r=e.message,n=e.messageContext;(T(e)||V(e))&&r&&(t=!0,A(r,n?{context:n}:void 0))})),t};if(a.hasError)return void Object(w.b)(j,"add_to_cart_after_processing_with_error",e).then((function(r){if(!t(r)){var n,c=(null===(n=e.processingResponse)||void 0===n?void 0:n.message)||Object(u.__)("Something went wrong. Please contact us to get assistance.",'woocommerce');A(c,{id:"add-to-cart"})}p({type:"set_idle"})}));Object(w.b)(j,"add_to_cart_after_processing_with_success",e).then((function(e){t(e)?p(b(!0)):p({type:"set_idle"})}))}}),[a.status,a.hasError,a.processingResponse,I,A,T,V,x,j]);var F=function(e){return["simple","variable"].includes(e.type||"simple")}(r),B={product:r,productType:r.type||"simple",productIsPurchasable:f(r),productHasOptions:r.has_options||!1,supportsFormElements:F,showFormElements:n&&F,quantity:a.quantity,minQuantity:1,maxQuantity:r.quantity_limit||99,requestParams:a.requestParams,isIdle:"idle"===a.status,isDisabled:"disabled"===a.status,isProcessing:"processing"===a.status,isBeforeProcessing:"before_processing"===a.status,isAfterProcessing:"after_processing"===a.status,hasError:a.hasError,eventRegistration:q,dispatchActions:I};return React.createElement(R.Provider,{value:B},t)},S=r(61),N=r.n(S),D=r(28),x=r(32);function T(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}var V=function(){var e=C(),t=e.dispatchActions,r=e.product,n=e.quantity,c=e.eventRegistration,o=e.hasError,a=e.isProcessing,l=e.requestParams,f=Object(_.b)(),d=f.hasValidationErrors,b=f.showAllValidationErrors,p=Object(P.a)(),v=p.addErrorNotice,O=p.removeNotice,h=Object(x.a)().receiveCart,g=Object(i.useState)(!1),y=s()(g,2),j=y[0],E=y[1],w=!o&&a,k=Object(i.useCallback)((function(){return!d||(b(),{type:"error"})}),[d,b]);Object(i.useEffect)((function(){var e=c.onAddToCartBeforeProcessing(k,0);return function(){e()}}),[c,k]);var R=Object(i.useCallback)((function(){E(!0),O("add-to-cart");var e=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?T(Object(r),!0).forEach((function(t){m()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):T(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({id:r.id||0,quantity:n},l);N()({path:"/wc/store/cart/add-item",method:"POST",data:e,cache:"no-store",parse:!1}).then((function(e){N.a.setNonce(e.headers),e.json().then((function(r){e.ok?h(r):(r.body&&r.body.message?v(Object(D.decodeEntities)(r.body.message),{id:"add-to-cart"}):v(Object(u.__)("Something went wrong. Please contact us to get assistance.",'woocommerce'),{id:"add-to-cart"}),t.setHasError()),t.setAfterProcessing(r),E(!1)}))})).catch((function(e){e.json().then((function(e){var r;null!==(r=e.data)&&void 0!==r&&r.cart&&h(e.data.cart),t.setHasError(),t.setAfterProcessing(e),E(!1)}))}))}),[r,v,O,h,t,n,l]);return Object(i.useEffect)((function(){w&&!j&&R()}),[w,R,j]),null},q=function(e){var t=e.children,r=e.product,n=e.showFormElements;return React.createElement(_.a,null,React.createElement(A,{product:r,showFormElements:n},t,React.createElement(V,null)))},I=r(101),F=r(7),B=r(249),L=(r(368),r(143)),M=r(152),Q=r(369),W=r(52),H=r(362),K=function(e){var t=e.className,r=e.href,n=e.text,c=e.onClick;return React.createElement(L.a,{className:t,href:r,onClick:c,rel:"nofollow"},n)},J=function(e){var t=e.className,r=e.quantityInCart,n=e.isProcessing,c=e.isDisabled,o=e.isDone,a=e.onClick;return React.createElement(L.a,{className:t,disabled:c,showSpinner:n,onClick:a},o&&r>0?Object(u.sprintf)(
/* translators: %s number of products in cart. */
Object(u._n)("%d in cart","%d in cart",r,'woocommerce'),r):Object(u.__)("Add to cart",'woocommerce'),!!o&&React.createElement(M.a,{srcElement:Q.a,alt:Object(u.__)("Done",'woocommerce')}))},U=function(){var e=C(),t=e.showFormElements,r=e.productIsPurchasable,n=e.productHasOptions,c=e.product,o=e.productType,a=e.isDisabled,l=e.isProcessing,f=e.eventRegistration,d=e.hasError,b=e.dispatchActions,p=Object(I.useInnerBlockLayoutContext)().parentName,m=Object(W.a)().dispatchStoreEvent,v=Object(H.a)(c.id||0).cartQuantity,O=Object(i.useState)(!1),h=s()(O,2),g=h[0],y=h[1],j=c.add_to_cart||{url:"",text:""};return Object(i.useEffect)((function(){var e=f.onAddToCartAfterProcessingWithSuccess((function(){return d||y(!0),!0}),0);return function(){e()}}),[f,d]),(t||!n&&"simple"===o)&&r?React.createElement(J,{className:"wc-block-components-product-add-to-cart-button",quantityInCart:v,isDisabled:a,isProcessing:l,isDone:g,onClick:function(){b.submitForm(),m("cart-add-item",{product:c,listName:p})}}):React.createElement(K,{className:"wc-block-components-product-add-to-cart-button",href:j.url,text:j.text||Object(u.__)("View Product",'woocommerce'),onClick:function(){m("product-view-link",{product:c,listName:p})}})},Y=function(e){var t=e.disabled,r=e.min,n=e.max,c=e.value,o=e.onChange;return React.createElement("input",{className:"wc-block-components-product-add-to-cart-quantity",type:"number",value:c,min:r,max:n,hidden:1===n,disabled:t,onChange:function(e){o(e.target.value)}})},z=function(e){var t=e.reason,r=void 0===t?Object(u.__)("Sorry, this product cannot be purchased.",'woocommerce'):t;return React.createElement("div",{className:"wc-block-components-product-add-to-cart-unavailable"},r)},G=function(){var e=C(),t=e.product,r=e.quantity,n=e.minQuantity,c=e.maxQuantity,o=e.dispatchActions,a=e.isDisabled;return t.id&&!t.is_purchasable?React.createElement(z,null):t.id&&!t.is_in_stock?React.createElement(z,{reason:Object(u.__)("This product is currently out of stock and cannot be purchased.",'woocommerce')}):React.createElement(React.Fragment,null,React.createElement(Y,{value:r,min:n,max:c,disabled:a,onChange:o.setQuantity}),React.createElement(U,null))},X=(r(370),r(46)),$=r.n(X),Z=r(404),ee=r(3),te=r(258),re={value:"",label:Object(u.__)("Select an option",'woocommerce')},ne=function(e){var t=e.attributeName,r=e.options,n=void 0===r?[]:r,c=e.value,a=void 0===c?"":c,s=e.onChange,i=void 0===s?function(){}:s,l=e.errorMessage,f=void 0===l?Object(u.__)("Please select a value.",'woocommerce'):l,d=Object(_.b)(),b=d.getValidationError,p=d.setValidationErrors,v=d.clearValidationError,O=t,h=b(O)||{};return Object(ee.useEffect)((function(){a?v(O):p(m()({},O,{message:f,hidden:!0}))}),[a,O,f,v,p]),Object(ee.useEffect)((function(){return function(){v(O)}}),[O,v]),React.createElement("div",{className:"wc-block-components-product-add-to-cart-attribute-picker__container"},React.createElement(Z.a,{label:Object(D.decodeEntities)(t),value:a||"",options:[re].concat($()(n)),onChange:i,required:!0,className:o()("wc-block-components-product-add-to-cart-attribute-picker__select",{"has-error":h.message&&!h.hidden})}),React.createElement(te.a,{propertyName:O,elementId:O}))},ce=r(49);function oe(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function ae(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?oe(Object(r),!0).forEach((function(t){m()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):oe(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var se=function(e,t,r){var n=Object.values(t).map((function(e){return e.id}));if(Object.values(r).every((function(e){return""===e})))return n;var c=Object.keys(e);return n.filter((function(e){return c.every((function(n){var c=r[n]||"",o=t["id:"+e].attributes[n];return""===c||null===o||o===c}))}))};function ie(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function ue(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ie(Object(r),!0).forEach((function(t){m()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ie(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var le=function(e){var t=e.attributes,r=e.variationAttributes,n=e.setRequestParams,c=Object(l.a)(t),o=Object(l.a)(r),a=Object(i.useState)(0),u=s()(a,2),f=u[0],d=u[1],b=Object(i.useState)({}),p=s()(b,2),v=p[0],O=p[1],h=Object(i.useState)(!1),g=s()(h,2),y=g[0],j=g[1],E=Object(i.useMemo)((function(){return function(e,t,r){var n={},c=Object.keys(e),o=Object.values(r).filter(Boolean).length>0;return c.forEach((function(c){var a=e[c],s=ae(ae({},r),{},m()({},c,null)),i=o?se(e,t,s):null,u=null!==i?i.map((function(e){return t["id:"+e].attributes[c]})):null;n[c]=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return Object.values(e).map((function(e){var r=e.name,n=e.slug;return null===t||t.includes(null)||t.includes(n)?{value:n,label:Object(D.decodeEntities)(r)}:null})).filter(Boolean)}(a.terms,u)})),n}(c,o,v)}),[v,c,o]);return Object(i.useEffect)((function(){if(!y){var e=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!Object(ce.b)(e))return{};var t=Object.keys(e),r={};return 0===t.length||t.forEach((function(t){var n,c=e[t],o=c.terms.filter((function(e){return e.default}));o.length>0&&(r[c.name]=null===(n=o[0])||void 0===n?void 0:n.slug)})),r}(t);e&&O(ue({},e)),j(!0)}}),[v,t,y]),Object(i.useEffect)((function(){Object.values(v).filter((function(e){return""!==e})).length===Object.keys(c).length?d(function(e,t,r){return se(e,t,r)[0]||0}(c,o,v)):f>0&&d(0)}),[v,f,c,o]),Object(i.useEffect)((function(){n({id:f,variation:Object.keys(v).map((function(e){return{attribute:e,value:v[e]}}))})}),[n,f,v]),React.createElement("div",{className:"wc-block-components-product-add-to-cart-attribute-picker"},Object.keys(c).map((function(e){return React.createElement(ne,{key:e,attributeName:e,options:E[e],value:v[e],onChange:function(t){O(ue(ue({},v),{},m()({},e,t)))}})})))},fe=function(e){var t=e.product,r=e.dispatchers,n=function(e){return e?Object(F.keyBy)(Object.values(e).filter((function(e){return e.has_variations})),"name"):{}}(t.attributes),c=function(e){if(!e)return{};var t={};return e.forEach((function(e){var r=e.id,n=e.attributes;t["id:".concat(r)]={id:r,attributes:n.reduce((function(e,t){var r=t.name,n=t.value;return e[r]=n,e}),{})}})),t}(t.variations);return 0===Object.keys(n).length||0===c.length?null:React.createElement(le,{attributes:n,variationAttributes:c,setRequestParams:r.setRequestParams})},de=function(){var e=C(),t=e.product,r=e.quantity,n=e.minQuantity,c=e.maxQuantity,o=e.dispatchActions,a=e.isDisabled;return t.id&&!t.is_purchasable?React.createElement(z,null):t.id&&!t.is_in_stock?React.createElement(z,{reason:Object(u.__)("This product is currently out of stock and cannot be purchased.",'woocommerce')}):React.createElement(React.Fragment,null,React.createElement(fe,{product:t,dispatchers:o}),React.createElement(Y,{value:r,min:n,max:c,disabled:a,onChange:o.setQuantity}),React.createElement(U,null))},be=function(){return React.createElement(U,null)},pe=r(355),me=function(){return React.createElement(pe.a,{className:"wc-block-components-product-add-to-cart-group-list"},"This is a placeholder for the grouped products form element.")},ve=function(){return React.createElement(me,null)},Oe=function(){var e=C(),t=e.showFormElements,r=e.productType;return t?"variable"===r?React.createElement(de,null):"grouped"===r?React.createElement(ve,null):"external"===r?React.createElement(be,null):"simple"===r||"variation"===r?React.createElement(G,null):null:React.createElement(U,null)},he=Object(B.withProductDataContext)((function(e){var t=e.className,r=e.showFormElements,n=Object(I.useProductDataContext)().product,c=o()(t,"wc-block-components-product-add-to-cart",{"wc-block-components-product-add-to-cart--placeholder":Object(F.isEmpty)(n)});return React.createElement(q,{product:n,showFormElements:r},React.createElement("div",{className:c},React.createElement(Oe,null)))}));t.default=Object(n.a)({showFormElements:{type:"boolean",default:!1},productId:{type:"number",default:0}})(he)},53:function(e,t,r){"use strict";r.d(t,"a",(function(){return a}));var n=r(0),c=r(25),o=r.n(c);function a(e){var t=Object(n.useRef)(e);return o()(e,t.current)||(t.current=e),t.current}},54:function(e,t,r){"use strict";r.d(t,"a",(function(){return u}));var n=r(4),c=r.n(n),o=r(0),a=r(103);function s(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function i(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?s(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):s(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var u=function(){var e=Object(a.b)(),t=e.notices,r=e.createNotice,n=e.removeNotice,c=e.setIsSuppressed,s=Object(o.useRef)(t);Object(o.useEffect)((function(){s.current=t}),[t]);var u=Object(o.useMemo)((function(){return{hasNoticesOfType:function(e){return s.current.some((function(t){return t.type===e}))},removeNotices:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;s.current.forEach((function(t){null!==e&&t.status!==e||n(t.id)}))},removeNotice:n}}),[n]),l=Object(o.useMemo)((function(){return{addDefaultNotice:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};r("default",e,i({},t))},addErrorNotice:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};r("error",e,i({},t))},addWarningNotice:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};r("warning",e,i({},t))},addInfoNotice:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};r("info",e,i({},t))},addSuccessNotice:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};r("success",e,i({},t))}}}),[r]);return i(i(i({notices:t},u),l),{},{setIsSuppressed:c})}},98:function(e,t,r){"use strict";r.d(t,"a",(function(){return u})),r.d(t,"b",(function(){return f}));var n,c=r(4),o=r.n(c),a=r(7);function s(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function i(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?s(Object(r),!0).forEach((function(t){o()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):s(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}!function(e){e.ADD_EVENT_CALLBACK="add_event_callback",e.REMOVE_EVENT_CALLBACK="remove_event_callback"}(n||(n={}));var u={addEventCallback:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:10;return{id:Object(a.uniqueId)(),type:n.ADD_EVENT_CALLBACK,eventType:e,callback:t,priority:r}},removeEventCallback:function(e,t){return{id:t,type:n.REMOVE_EVENT_CALLBACK,eventType:e}}},l={},f=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:l,t=arguments.length>1?arguments[1]:void 0,r=t.type,c=t.eventType,a=t.id,s=t.callback,u=t.priority,f=e.hasOwnProperty(c)?new Map(e[c]):new Map;switch(r){case n.ADD_EVENT_CALLBACK:return f.set(a,{priority:u,callback:s}),i(i({},e),{},o()({},c,f));case n.REMOVE_EVENT_CALLBACK:return f.delete(a),i(i({},e),{},o()({},c,f))}}}}]);woocommerce-blocks/build/atomic-block-components/image-frontend.js000064400000012135151335517640021435 0ustar00(window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[11,14],{188:function(e,t,r){"use strict";r.d(t,"a",(function(){return n}));var n=function(e,t){var r=[];return Object.keys(e).forEach((function(n){if(void 0!==t[n])switch(e[n].type){case"boolean":r[n]="false"!==t[n]&&!1!==t[n];break;case"number":r[n]=parseInt(t[n],10);break;case"array":case"object":r[n]=JSON.parse(t[n]);break;default:r[n]=t[n]}else r[n]=e[n].default})),r}},345:function(e,t,r){"use strict";var n=r(14),a=r.n(n),c=r(188);t.a=function(e){return function(t){return function(r){var n=Object(c.a)(e,r);return React.createElement(t,a()({},r,n))}}}},351:function(e,t){},354:function(e,t,r){"use strict";r.r(t);var n=r(4),a=r.n(n),c=(r(10),r(1)),o=r(6),l=r.n(o),s=r(51),i=r(101),u=r(249);r(351),t.default=Object(u.withProductDataContext)((function(e){var t=e.className,r=e.align,n=Object(i.useInnerBlockLayoutContext)().parentClassName,o=Object(i.useProductDataContext)().product;if(!o.id||!o.on_sale)return null;var u="string"==typeof r?"wc-block-components-product-sale-badge--align-".concat(r):"";return React.createElement("div",{className:l()("wc-block-components-product-sale-badge",t,u,a()({},"".concat(n,"__product-onsale"),n))},React.createElement(s.a,{label:Object(c.__)("Sale",'woocommerce'),screenReaderLabel:Object(c.__)("Product on sale",'woocommerce')}))}))},358:function(e,t){},416:function(e,t,r){"use strict";r.r(t);var n=r(345),a=r(14),c=r.n(a),o=r(4),l=r.n(o),s=r(5),i=r.n(s),u=(r(10),r(0)),p=r(1),d=r(6),b=r.n(d),f=r(2),m=r(101),g=r(249),O=r(52),w=r(354);function j(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function y(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?j(Object(r),!0).forEach((function(t){l()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):j(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}r(358);var v=function(){return React.createElement("img",{src:f.PLACEHOLDER_IMG_SRC,alt:"",width:500,height:500})},h=function(e){var t=e.image,r=e.onLoad,n=e.loaded,a=e.showFullSize,o=e.fallbackAlt,l=t||{},s=l.thumbnail,i=l.src,u=l.srcset,p=l.sizes,d=y({alt:l.alt||o,onLoad:r,hidden:!n,src:s},a&&{src:i,srcSet:u,sizes:p});return React.createElement(React.Fragment,null,d.src&&React.createElement("img",c()({"data-testid":"product-image"},d)),!n&&React.createElement(v,null))},k=Object(g.withProductDataContext)((function(e){var t=e.className,r=e.imageSizing,n=void 0===r?"full-size":r,a=e.showProductLink,c=void 0===a||a,o=e.showSaleBadge,s=e.saleBadgeAlign,d=void 0===s?"right":s,f=Object(m.useInnerBlockLayoutContext)().parentClassName,g=Object(m.useProductDataContext)().product,j=Object(u.useState)(!1),k=i()(j,2),E=k[0],P=k[1],R=Object(O.a)().dispatchStoreEvent;if(!g.id)return React.createElement("div",{className:b()(t,"wc-block-components-product-image","wc-block-components-product-image--placeholder",l()({},"".concat(f,"__product-image"),f))},React.createElement(v,null));var S=!!g.images.length,_=S?g.images[0]:null,D=c?"a":u.Fragment,L=Object(p.sprintf)(
/* translators: %s is referring to the product name */
Object(p.__)("Link to %s",'woocommerce'),g.name),C=y(y({href:g.permalink,rel:"nofollow"},!S&&{"aria-label":L}),{},{onClick:function(){R("product-view-link",{product:g})}});return React.createElement("div",{className:b()(t,"wc-block-components-product-image",l()({},"".concat(f,"__product-image"),f))},React.createElement(D,c&&C,!!o&&React.createElement(w.default,{align:d,product:g}),React.createElement(h,{fallbackAlt:g.name,image:_,onLoad:function(){return P(!0)},loaded:E,showFullSize:"cropped"!==n})))}));t.default=Object(n.a)({showProductLink:{type:"boolean",default:!0},showSaleBadge:{type:"boolean",default:!0},saleBadgeAlign:{type:"string",default:"right"},imageSizing:{type:"string",default:"full-size"},productId:{type:"number",default:0}})(k)},51:function(e,t,r){"use strict";var n=r(4),a=r.n(n),c=r(0),o=r(6),l=r.n(o);function s(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function i(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?s(Object(r),!0).forEach((function(t){a()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):s(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}t.a=function(e){var t,r=e.label,n=e.screenReaderLabel,a=e.wrapperElement,o=e.wrapperProps,s=void 0===o?{}:o,u=null!=r,p=null!=n;return!u&&p?(t=a||"span",s=i(i({},s),{},{className:l()(s.className,"screen-reader-text")}),React.createElement(t,s,n)):(t=a||c.Fragment,u&&p&&r!==n?React.createElement(t,s,React.createElement("span",{"aria-hidden":"true"},r),React.createElement("span",{className:"screen-reader-text"},n)):React.createElement(t,s,r))}}}]);woocommerce-blocks/build/atomic-block-components/price-frontend.js000064400000013706151335517640021462 0ustar00(window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[12],{140:function(e,r,c){"use strict";var t=c(4),a=c.n(t),n=c(1),o=c(69),l=c(6),i=c.n(l),u=(c(10),c(58)),s=c(0),p=(c(183),function(e){var r=e.currency,c=e.maxPrice,t=e.minPrice,a=e.priceClassName,l=e.priceStyle;return React.createElement(React.Fragment,null,React.createElement("span",{className:"screen-reader-text"},Object(n.sprintf)(
/* translators: %1$s min price, %2$s max price */
Object(n.__)("Price between %1$s and %2$s",'woocommerce'),Object(u.formatPrice)(t),Object(u.formatPrice)(c))),React.createElement("span",{"aria-hidden":!0},React.createElement(o.a,{className:i()("wc-block-components-product-price__value",a),currency:r,value:t,style:l})," — ",React.createElement(o.a,{className:i()("wc-block-components-product-price__value",a),currency:r,value:c,style:l})))}),m=function(e){var r=e.currency,c=e.regularPriceClassName,t=e.regularPriceStyle,a=e.regularPrice,l=e.priceClassName,u=e.priceStyle,s=e.price;return React.createElement(React.Fragment,null,React.createElement("span",{className:"screen-reader-text"},Object(n.__)("Previous price:",'woocommerce')),React.createElement(o.a,{currency:r,renderText:function(e){return React.createElement("del",{className:i()("wc-block-components-product-price__regular",c),style:t},e)},value:a}),React.createElement("span",{className:"screen-reader-text"},Object(n.__)("Discounted price:",'woocommerce')),React.createElement(o.a,{currency:r,renderText:function(e){return React.createElement("ins",{className:i()("wc-block-components-product-price__value","is-discounted",l),style:u},e)},value:s}))};r.a=function(e){var r=e.align,c=e.className,t=e.currency,n=e.format,l=void 0===n?"<price/>":n,u=e.maxPrice,d=void 0===u?null:u,b=e.minPrice,f=void 0===b?null:b,y=e.price,g=void 0===y?null:y,v=e.priceClassName,_=e.priceStyle,O=e.regularPrice,P=e.regularPriceClassName,N=e.regularPriceStyle,j=i()(c,"price","wc-block-components-product-price",a()({},"wc-block-components-product-price--align-".concat(r),r));l.includes("<price/>")||(l="<price/>",console.error("Price formats need to include the `<price/>` tag."));var w=O&&g!==O,S=React.createElement("span",{className:i()("wc-block-components-product-price__value",v)});return w?S=React.createElement(m,{currency:t,price:g,priceClassName:v,priceStyle:_,regularPrice:O,regularPriceClassName:P,regularPriceStyle:N}):null!==f&&null!==d?S=React.createElement(p,{currency:t,maxPrice:d,minPrice:f,priceClassName:v,priceStyle:_}):null!==g&&(S=React.createElement(o.a,{className:i()("wc-block-components-product-price__value",v),currency:t,value:g,style:_})),React.createElement("span",{className:j},Object(s.createInterpolateElement)(l,{price:S}))}},147:function(e,r){},183:function(e,r){},357:function(e,r,c){"use strict";c.d(r,"a",(function(){return a})),c(275);var t=c(83),a=function(){return t.m>1}},387:function(e,r,c){"use strict";c.r(r);var t=c(4),a=c.n(t),n=(c(10),c(6)),o=c.n(n),l=c(140),i=c(58),u=c(101),s=c(274),p=c(357),m=c(249);r.default=Object(m.withProductDataContext)((function(e){var r,c,t,n,m,d,b,f=e.className,y=e.align,g=e.fontSize,v=e.customFontSize,_=e.saleFontSize,O=e.customSaleFontSize,P=e.color,N=e.customColor,j=e.saleColor,w=e.customSaleColor,S=Object(u.useInnerBlockLayoutContext)().parentClassName,C=Object(u.useProductDataContext)().product,E=o()(f,a()({},"".concat(S,"__product-price"),S));if(!C.id)return React.createElement(l.a,{align:y,className:E});var R=Object(s.getColorClassName)("color",P),x=Object(s.getFontSizeClass)(g),h=Object(s.getColorClassName)("color",j),k=Object(s.getFontSizeClass)(_),z=o()((r={"has-text-color":P||N,"has-font-size":g||v},a()(r,R,R),a()(r,x,x),r)),F=o()((c={"has-text-color":j||w,"has-font-size":_||O},a()(c,h,h),a()(c,k,k),c)),D={color:N,fontSize:v},T={color:w,fontSize:O},V=C.prices,B=Object(i.getCurrencyFromPriceResponse)(V),I=V.price!==V.regular_price,U=I?o()((t={},a()(t,"".concat(S,"__product-price__value"),S),a()(t,F,Object(p.a)()),t)):o()((n={},a()(n,"".concat(S,"__product-price__value"),S),a()(n,z,Object(p.a)()),n)),J=I?T:D;return React.createElement(l.a,{align:y,className:E,currency:B,price:V.price,priceClassName:U,priceStyle:Object(p.a)()?J:{},minPrice:null==V||null===(m=V.price_range)||void 0===m?void 0:m.min_amount,maxPrice:null==V||null===(d=V.price_range)||void 0===d?void 0:d.max_amount,regularPrice:V.regular_price,regularPriceClassName:o()((b={},a()(b,"".concat(S,"__product-price__regular"),S),a()(b,z,Object(p.a)()),b)),regularPriceStyle:Object(p.a)()?D:{}})}))},69:function(e,r,c){"use strict";var t=c(14),a=c.n(t),n=c(4),o=c.n(n),l=c(23),i=c.n(l),u=c(126),s=c(6),p=c.n(s),m=(c(147),["className","value","currency","onValueChange","displayType"]);function d(e,r){var c=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);r&&(t=t.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),c.push.apply(c,t)}return c}function b(e){for(var r=1;r<arguments.length;r++){var c=null!=arguments[r]?arguments[r]:{};r%2?d(Object(c),!0).forEach((function(r){o()(e,r,c[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(c)):d(Object(c)).forEach((function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(c,r))}))}return e}r.a=function(e){var r=e.className,c=e.value,t=e.currency,n=e.onValueChange,o=e.displayType,l=void 0===o?"text":o,s=i()(e,m),d="string"==typeof c?parseInt(c,10):c;if(!Number.isFinite(d))return null;var f=d/Math.pow(10,t.minorUnit);if(!Number.isFinite(f))return null;var y=p()("wc-block-formatted-money-amount","wc-block-components-formatted-money-amount",r),g=b(b(b({},s),function(e){return{thousandSeparator:e.thousandSeparator,decimalSeparator:e.decimalSeparator,decimalScale:e.minorUnit,fixedDecimalScale:!0,prefix:e.prefix,suffix:e.suffix,isNumericString:!0}}(t)),{},{value:void 0,currency:void 0,onValueChange:void 0}),v=n?function(e){var r=e.value*Math.pow(10,t.minorUnit);n(r)}:function(){};return React.createElement(u.a,a()({className:y,displayType:l},g,{value:f,onValueChange:v}))}}}]);woocommerce-blocks/build/atomic-block-components/image.js000064400000005630151335517640017622 0ustar00(window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[11],{374:function(e,t,c){"use strict";t.a={showProductLink:{type:"boolean",default:!0},showSaleBadge:{type:"boolean",default:!0},saleBadgeAlign:{type:"string",default:"right"},imageSizing:{type:"string",default:"full-size"},productId:{type:"number",default:0}}},375:function(e,t,c){"use strict";var n=c(9),r=c.n(n),a=c(5),o=c.n(a),l=c(8),i=c.n(l),s=c(0),u=(c(2),c(1)),d=c(6),p=c.n(d),b=c(3),m=c(45),g=c(86),f=c(68),O=c(304);function j(e,t){var c=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),c.push.apply(c,n)}return c}function w(e){for(var t=1;t<arguments.length;t++){var c=null!=arguments[t]?arguments[t]:{};t%2?j(Object(c),!0).forEach((function(t){o()(e,t,c[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(c)):j(Object(c)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(c,t))}))}return e}c(558);var h=function(){return Object(s.createElement)("img",{src:b.PLACEHOLDER_IMG_SRC,alt:"",width:500,height:500})},k=function(e){var t=e.image,c=e.onLoad,n=e.loaded,a=e.showFullSize,o=e.fallbackAlt,l=t||{},i=l.thumbnail,u=l.src,d=l.srcset,p=l.sizes,b=w({alt:l.alt||o,onLoad:c,hidden:!n,src:i},a&&{src:u,srcSet:d,sizes:p});return Object(s.createElement)(s.Fragment,null,b.src&&Object(s.createElement)("img",r()({"data-testid":"product-image"},b)),!n&&Object(s.createElement)(h,null))};t.a=Object(g.withProductDataContext)((function(e){var t=e.className,c=e.imageSizing,n=void 0===c?"full-size":c,r=e.showProductLink,a=void 0===r||r,l=e.showSaleBadge,d=e.saleBadgeAlign,b=void 0===d?"right":d,g=Object(m.useInnerBlockLayoutContext)().parentClassName,j=Object(m.useProductDataContext)().product,v=Object(s.useState)(!1),y=i()(v,2),E=y[0],P=y[1],S=Object(f.a)().dispatchStoreEvent;if(!j.id)return Object(s.createElement)("div",{className:p()(t,"wc-block-components-product-image","wc-block-components-product-image--placeholder",o()({},"".concat(g,"__product-image"),g))},Object(s.createElement)(h,null));var L=!!j.images.length,z=L?j.images[0]:null,_=a?"a":s.Fragment,B=Object(u.sprintf)(
/* translators: %s is referring to the product name */
Object(u.__)("Link to %s",'woocommerce'),j.name),C=w(w({href:j.permalink,rel:"nofollow"},!L&&{"aria-label":B}),{},{onClick:function(){S("product-view-link",{product:j})}});return Object(s.createElement)("div",{className:p()(t,"wc-block-components-product-image",o()({},"".concat(g,"__product-image"),g))},Object(s.createElement)(_,a&&C,!!l&&Object(s.createElement)(O.default,{align:b,product:j}),Object(s.createElement)(k,{fallbackAlt:j.name,image:z,onLoad:function(){return P(!0)},loaded:E,showFullSize:"cropped"!==n})))}))},558:function(e,t){},901:function(e,t,c){"use strict";c.r(t);var n=c(900),r=c(375),a=c(374);t.default=Object(n.a)(a.a)(r.a)}}]);woocommerce-blocks/build/atomic-block-components/price.js000064400000013644151335517640017646 0ustar00(window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[12],{124:function(e,r,c){"use strict";var t=c(5),a=c.n(t),n=c(0),o=c(1),l=c(53),i=c(6),s=c.n(i),u=(c(2),c(47)),p=(c(206),function(e){var r=e.currency,c=e.maxPrice,t=e.minPrice,a=e.priceClassName,i=e.priceStyle;return Object(n.createElement)(n.Fragment,null,Object(n.createElement)("span",{className:"screen-reader-text"},Object(o.sprintf)(
/* translators: %1$s min price, %2$s max price */
Object(o.__)("Price between %1$s and %2$s",'woocommerce'),Object(u.formatPrice)(t),Object(u.formatPrice)(c))),Object(n.createElement)("span",{"aria-hidden":!0},Object(n.createElement)(l.a,{className:s()("wc-block-components-product-price__value",a),currency:r,value:t,style:i})," — ",Object(n.createElement)(l.a,{className:s()("wc-block-components-product-price__value",a),currency:r,value:c,style:i})))}),m=function(e){var r=e.currency,c=e.regularPriceClassName,t=e.regularPriceStyle,a=e.regularPrice,i=e.priceClassName,u=e.priceStyle,p=e.price;return Object(n.createElement)(n.Fragment,null,Object(n.createElement)("span",{className:"screen-reader-text"},Object(o.__)("Previous price:",'woocommerce')),Object(n.createElement)(l.a,{currency:r,renderText:function(e){return Object(n.createElement)("del",{className:s()("wc-block-components-product-price__regular",c),style:t},e)},value:a}),Object(n.createElement)("span",{className:"screen-reader-text"},Object(o.__)("Discounted price:",'woocommerce')),Object(n.createElement)(l.a,{currency:r,renderText:function(e){return Object(n.createElement)("ins",{className:s()("wc-block-components-product-price__value","is-discounted",i),style:u},e)},value:p}))};r.a=function(e){var r=e.align,c=e.className,t=e.currency,o=e.format,i=void 0===o?"<price/>":o,u=e.maxPrice,b=void 0===u?null:u,d=e.minPrice,O=void 0===d?null:d,f=e.price,j=void 0===f?null:f,y=e.priceClassName,g=e.priceStyle,v=e.regularPrice,_=e.regularPriceClassName,P=e.regularPriceStyle,N=s()(c,"price","wc-block-components-product-price",a()({},"wc-block-components-product-price--align-".concat(r),r));i.includes("<price/>")||(i="<price/>",console.error("Price formats need to include the `<price/>` tag."));var w=v&&j!==v,S=Object(n.createElement)("span",{className:s()("wc-block-components-product-price__value",y)});return w?S=Object(n.createElement)(m,{currency:t,price:j,priceClassName:y,priceStyle:g,regularPrice:v,regularPriceClassName:_,regularPriceStyle:P}):null!==O&&null!==b?S=Object(n.createElement)(p,{currency:t,maxPrice:b,minPrice:O,priceClassName:y,priceStyle:g}):null!==j&&(S=Object(n.createElement)(l.a,{className:s()("wc-block-components-product-price__value",y),currency:t,value:j,style:g})),Object(n.createElement)("span",{className:N},Object(n.createInterpolateElement)(i,{price:S}))}},175:function(e,r){},206:function(e,r){},482:function(e,r,c){"use strict";c.r(r);var t=c(5),a=c.n(t),n=c(0),o=(c(2),c(6)),l=c.n(o),i=c(124),s=c(47),u=c(45),p=c(12),m=c(159),b=c(86);r.default=Object(b.withProductDataContext)((function(e){var r,c,t,o,b,d,O,f=e.className,j=e.align,y=e.fontSize,g=e.customFontSize,v=e.saleFontSize,_=e.customSaleFontSize,P=e.color,N=e.customColor,w=e.saleColor,S=e.customSaleColor,C=Object(u.useInnerBlockLayoutContext)().parentClassName,E=Object(u.useProductDataContext)().product,x=l()(f,a()({},"".concat(C,"__product-price"),C));if(!E.id)return Object(n.createElement)(i.a,{align:j,className:x});var h=Object(p.getColorClassName)("color",P),k=Object(p.getFontSizeClass)(y),z=Object(p.getColorClassName)("color",w),F=Object(p.getFontSizeClass)(v),D=l()((r={"has-text-color":P||N,"has-font-size":y||g},a()(r,h,h),a()(r,k,k),r)),T=l()((c={"has-text-color":w||S,"has-font-size":v||_},a()(c,z,z),a()(c,F,F),c)),V={color:N,fontSize:g},B={color:S,fontSize:_},I=E.prices,U=Object(s.getCurrencyFromPriceResponse)(I),J=I.price!==I.regular_price,M=J?l()((t={},a()(t,"".concat(C,"__product-price__value"),C),a()(t,T,Object(m.b)()),t)):l()((o={},a()(o,"".concat(C,"__product-price__value"),C),a()(o,D,Object(m.b)()),o)),W=J?B:V;return Object(n.createElement)(i.a,{align:j,className:x,currency:U,price:I.price,priceClassName:M,priceStyle:Object(m.b)()?W:{},minPrice:null==I||null===(b=I.price_range)||void 0===b?void 0:b.min_amount,maxPrice:null==I||null===(d=I.price_range)||void 0===d?void 0:d.max_amount,regularPrice:I.regular_price,regularPriceClassName:l()((O={},a()(O,"".concat(C,"__product-price__regular"),C),a()(O,D,Object(m.b)()),O)),regularPriceStyle:Object(m.b)()?V:{}})}))},53:function(e,r,c){"use strict";var t=c(9),a=c.n(t),n=c(5),o=c.n(n),l=c(16),i=c.n(l),s=c(0),u=c(166),p=c(6),m=c.n(p),b=(c(175),["className","value","currency","onValueChange","displayType"]);function d(e,r){var c=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);r&&(t=t.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),c.push.apply(c,t)}return c}function O(e){for(var r=1;r<arguments.length;r++){var c=null!=arguments[r]?arguments[r]:{};r%2?d(Object(c),!0).forEach((function(r){o()(e,r,c[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(c)):d(Object(c)).forEach((function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(c,r))}))}return e}r.a=function(e){var r=e.className,c=e.value,t=e.currency,n=e.onValueChange,o=e.displayType,l=void 0===o?"text":o,p=i()(e,b),d="string"==typeof c?parseInt(c,10):c;if(!Number.isFinite(d))return null;var f=d/Math.pow(10,t.minorUnit);if(!Number.isFinite(f))return null;var j=m()("wc-block-formatted-money-amount","wc-block-components-formatted-money-amount",r),y=O(O(O({},p),function(e){return{thousandSeparator:e.thousandSeparator,decimalSeparator:e.decimalSeparator,decimalScale:e.minorUnit,fixedDecimalScale:!0,prefix:e.prefix,suffix:e.suffix,isNumericString:!0}}(t)),{},{value:void 0,currency:void 0,onValueChange:void 0}),g=n?function(e){var r=e.value*Math.pow(10,t.minorUnit);n(r)}:function(){};return Object(s.createElement)(u.a,a()({className:j,displayType:l},y,{value:f,onValueChange:g}))}}}]);woocommerce-blocks/build/atomic-block-components/sku-frontend.js000064400000001135151335517640021153 0ustar00(window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[15],{364:function(t,c){},391:function(t,c,e){"use strict";e.r(c);var n=e(4),o=e.n(n),a=e(1),u=(e(10),e(6)),s=e.n(u),r=e(101),l=e(249);e(364),c.default=Object(l.withProductDataContext)((function(t){var c=t.className,e=Object(r.useInnerBlockLayoutContext)().parentClassName,n=Object(r.useProductDataContext)().product.sku;return n?React.createElement("div",{className:s()(c,"wc-block-components-product-sku",o()({},"".concat(e,"__product-sku"),e))},Object(a.__)("SKU:",'woocommerce')," ",React.createElement("strong",null,n)):null}))}}]);woocommerce-blocks/build/atomic-block-components/sale-badge.js000064400000003612151335517640020522 0ustar00(window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[4],{304:function(e,t,r){"use strict";r.r(t);var c=r(5),n=r.n(c),a=r(0),o=(r(2),r(1)),s=r(6),l=r.n(s),u=r(41),b=r(45),p=r(86);r(557),t.default=Object(p.withProductDataContext)((function(e){var t=e.className,r=e.align,c=Object(b.useInnerBlockLayoutContext)().parentClassName,s=Object(b.useProductDataContext)().product;if(!s.id||!s.on_sale)return null;var p="string"==typeof r?"wc-block-components-product-sale-badge--align-".concat(r):"";return Object(a.createElement)("div",{className:l()("wc-block-components-product-sale-badge",t,p,n()({},"".concat(c,"__product-onsale"),c))},Object(a.createElement)(u.a,{label:Object(o.__)("Sale",'woocommerce'),screenReaderLabel:Object(o.__)("Product on sale",'woocommerce')}))}))},41:function(e,t,r){"use strict";var c=r(5),n=r.n(c),a=r(0),o=r(6),s=r.n(o);function l(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(e);t&&(c=c.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,c)}return r}function u(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?l(Object(r),!0).forEach((function(t){n()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):l(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}t.a=function(e){var t,r=e.label,c=e.screenReaderLabel,n=e.wrapperElement,o=e.wrapperProps,l=void 0===o?{}:o,b=null!=r,p=null!=c;return!b&&p?(t=n||"span",l=u(u({},l),{},{className:s()(l.className,"screen-reader-text")}),Object(a.createElement)(t,l,c)):(t=n||a.Fragment,b&&p&&r!==c?Object(a.createElement)(t,l,Object(a.createElement)("span",{"aria-hidden":"true"},r),Object(a.createElement)("span",{className:"screen-reader-text"},c)):Object(a.createElement)(t,l,r))}},557:function(e,t){}}]);woocommerce-blocks/build/atomic-block-components/rating.js000064400000001756151335517640020031 0ustar00(window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[13],{483:function(t,e,c){"use strict";c.r(e);var a=c(5),n=c.n(a),r=c(0),o=(c(2),c(1)),s=c(6),u=c.n(s),i=c(45),l=c(86),p=(c(559),function(t){var e=parseFloat(t.average_rating);return Number.isFinite(e)&&e>0?e:0});e.default=Object(l.withProductDataContext)((function(t){var e=t.className,c=Object(i.useInnerBlockLayoutContext)().parentClassName,a=Object(i.useProductDataContext)().product,s=p(a);if(!s)return null;var l={width:s/5*100+"%"},b=Object(o.sprintf)(
/* translators: %f is referring to the average rating value */
Object(o.__)("Rated %f out of 5",'woocommerce'),s);return Object(r.createElement)("div",{className:u()(e,"wc-block-components-product-rating",n()({},"".concat(c,"__product-rating"),c))},Object(r.createElement)("div",{className:u()("wc-block-components-product-rating__stars","".concat(c,"__product-rating__stars")),role:"img","aria-label":b},Object(r.createElement)("span",{style:l},b)))}))},559:function(t,e){}}]);woocommerce-blocks/build/atomic-block-components/rating-frontend.js000064400000001736151335517640021644 0ustar00(window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[13],{360:function(t,e){},388:function(t,e,a){"use strict";a.r(e);var c=a(4),n=a.n(c),r=(a(10),a(1)),o=a(6),s=a.n(o),u=a(101),i=a(249),l=(a(360),function(t){var e=parseFloat(t.average_rating);return Number.isFinite(e)&&e>0?e:0});e.default=Object(i.withProductDataContext)((function(t){var e=t.className,a=Object(u.useInnerBlockLayoutContext)().parentClassName,c=Object(u.useProductDataContext)().product,o=l(c);if(!o)return null;var i={width:o/5*100+"%"},p=Object(r.sprintf)(
/* translators: %f is referring to the average rating value */
Object(r.__)("Rated %f out of 5",'woocommerce'),o);return React.createElement("div",{className:s()(e,"wc-block-components-product-rating",n()({},"".concat(a,"__product-rating"),a))},React.createElement("div",{className:s()("wc-block-components-product-rating__stars","".concat(a,"__product-rating__stars")),role:"img","aria-label":p},React.createElement("span",{style:i},p)))}))}}]);woocommerce-blocks/build/atomic-block-components/title.js000064400000006167151335517640017667 0ustar00(window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[18],{154:function(e,t,c){"use strict";var n=c(9),o=c.n(n),r=c(16),a=c.n(r),i=c(0),l=c(25),s=c(6),u=c.n(s),b=(c(205),["className","disabled","name","permalink"]);t.a=function(e){var t=e.className,c=void 0===t?"":t,n=e.disabled,r=void 0!==n&&n,s=e.name,p=e.permalink,d=void 0===p?"":p,m=a()(e,b),O=u()("wc-block-components-product-name",c);return r?Object(i.createElement)("span",o()({className:O},m,{dangerouslySetInnerHTML:{__html:Object(l.decodeEntities)(s)}})):Object(i.createElement)("a",o()({className:O,href:d},m,{dangerouslySetInnerHTML:{__html:Object(l.decodeEntities)(s)}}))}},205:function(e,t){},373:function(e,t,c){"use strict";var n=c(5),o=c.n(n),r=c(159);function a(e,t){var c=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),c.push.apply(c,n)}return c}function i(e){for(var t=1;t<arguments.length;t++){var c=null!=arguments[t]?arguments[t]:{};t%2?a(Object(c),!0).forEach((function(t){o()(e,t,c[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(c)):a(Object(c)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(c,t))}))}return e}var l={headingLevel:{type:"number",default:2},showProductLink:{type:"boolean",default:!0},productId:{type:"number",default:0}};Object(r.b)()&&(l=i(i({},l),{},{align:{type:"string"},color:{type:"string"},customColor:{type:"string"},fontSize:{type:"string"},customFontSize:{type:"number"}})),t.a=l},378:function(e,t,c){"use strict";var n=c(5),o=c.n(n),r=c(0),a=(c(2),c(6)),i=c.n(a),l=c(45),s=c(12),u=c(159),b=function(e){var t=e.color,c=e.fontSize;return Object(u.b)()?{color:t,fontSize:c}:{}},p=c(86),d=c(154),m=c(68);c(556),t.a=Object(p.withProductDataContext)((function(e){var t,c,n,a=e.className,p=e.headingLevel,O=void 0===p?2:p,f=e.showProductLink,j=void 0===f||f,y=e.align,w=e.color,g=e.customColor,v=e.fontSize,k=e.customFontSize,h=Object(l.useInnerBlockLayoutContext)().parentClassName,S=Object(l.useProductDataContext)().product,P=Object(m.a)().dispatchStoreEvent,z="h".concat(O),C=Object(s.getColorClassName)("color",w),E=Object(s.getFontSizeClass)(v),N=i()((t={"has-text-color":w||g,"has-font-size":v||k},o()(t,C,C),o()(t,E,E),t));return S.id?Object(r.createElement)(z,{className:i()(a,"wc-block-components-product-title",(c={},o()(c,"".concat(h,"__product-title"),h),o()(c,"wc-block-components-product-title--align-".concat(y),y&&Object(u.b)()),c))},Object(r.createElement)(d.a,{className:i()(o()({},N,Object(u.b)())),disabled:!j,name:S.name,permalink:S.permalink,rel:j?"nofollow":null,style:b({color:g,fontSize:k}),onClick:function(){P("product-view-link",{product:S})}})):Object(r.createElement)(z,{className:i()(a,"wc-block-components-product-title",(n={},o()(n,"".concat(h,"__product-title"),h),o()(n,"wc-block-components-product-title--align-".concat(y),y&&Object(u.b)()),o()(n,N,Object(u.b)()),n)),style:b({color:g,fontSize:k})})}))},556:function(e,t){},902:function(e,t,c){"use strict";c.r(t);var n=c(900),o=c(378),r=c(373);t.default=Object(n.a)(r.a)(o.a)}}]);woocommerce-blocks/build/atomic-block-components/category-list-frontend.js000064400000001515151335517640023141 0ustar00(window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[10],{365:function(e,t){},392:function(e,t,c){"use strict";c.r(t);var a=c(4),n=c.n(a),o=c(1),r=(c(10),c(6)),s=c.n(r),l=c(101),u=c(7),i=c(249);c(365),t.default=Object(i.withProductDataContext)((function(e){var t=e.className,c=Object(l.useInnerBlockLayoutContext)().parentClassName,a=Object(l.useProductDataContext)().product;return Object(u.isEmpty)(a.categories)?null:React.createElement("div",{className:s()(t,"wc-block-components-product-category-list",n()({},"".concat(c,"__product-category-list"),c))},Object(o.__)("Categories:",'woocommerce')," ",React.createElement("ul",null,Object.values(a.categories).map((function(e){var t=e.name,c=e.link,a=e.slug;return React.createElement("li",{key:"category-list-item-".concat(a)},React.createElement("a",{href:c},t))}))))}))}}]);woocommerce-blocks/build/atomic-block-components/stock-indicator-frontend.js000064400000002372151335517640023452 0ustar00(window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[16],{367:function(o,c){},394:function(o,c,t){"use strict";t.r(c);var n=t(4),e=t.n(n),r=t(1),s=(t(10),t(6)),a=t.n(s),i=t(101),u=t(249),k=(t(367),function(o){return Object(r.sprintf)(
/* translators: %d stock amount (number of items in stock for product) */
Object(r.__)("%d left in stock",'woocommerce'),o)});c.default=Object(u.withProductDataContext)((function(o){var c,t=o.className,n=Object(i.useInnerBlockLayoutContext)().parentClassName,s=Object(i.useProductDataContext)().product;if(!s.id||!s.is_purchasable)return null;var u=!!s.is_in_stock,b=s.low_stock_remaining,d=s.is_on_backorder;return React.createElement("div",{className:a()(t,"wc-block-components-product-stock-indicator",(c={},e()(c,"".concat(n,"__stock-indicator"),n),e()(c,"wc-block-components-product-stock-indicator--in-stock",u),e()(c,"wc-block-components-product-stock-indicator--out-of-stock",!u),e()(c,"wc-block-components-product-stock-indicator--low-stock",!!b),e()(c,"wc-block-components-product-stock-indicator--available-on-backorder",!!d),c))},b?k(b):function(o,c){return c?Object(r.__)("Available on backorder",'woocommerce'):o?Object(r.__)("In Stock",'woocommerce'):Object(r.__)("Out of Stock",'woocommerce')}(u,d))}))}}]);woocommerce-blocks/build/atomic-block-components/tag-list-frontend.js000064400000001454151335517640022101 0ustar00(window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[18],{366:function(t,e){},393:function(t,e,c){"use strict";c.r(e);var a=c(4),n=c.n(a),o=c(1),s=(c(10),c(6)),l=c.n(s),u=c(101),r=c(7),i=c(249);c(366),e.default=Object(i.withProductDataContext)((function(t){var e=t.className,c=Object(u.useInnerBlockLayoutContext)().parentClassName,a=Object(u.useProductDataContext)().product;return Object(r.isEmpty)(a.tags)?null:React.createElement("div",{className:l()(e,"wc-block-components-product-tag-list",n()({},"".concat(c,"__product-tag-list"),c))},Object(o.__)("Tags:",'woocommerce')," ",React.createElement("ul",null,Object.values(a.tags).map((function(t){var e=t.name,c=t.link,a=t.slug;return React.createElement("li",{key:"tag-list-item-".concat(a)},React.createElement("a",{href:c},e))}))))}))}}]);add-to-cart--atomic-block-components/button--atomic-block-components/image---a7e2bb9b.js000064400000021216151335517640036204 0ustar00woocommerce-blocks/build/atomic-block-components(window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[1],{113:function(t,e,r){"use strict";var n=r(5),c=r.n(n),i=r(8),o=r.n(i),a=r(3),s=r(1),u=r(72);function p(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function d(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?p(Object(r),!0).forEach((function(e){c()(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):p(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}var l=Object(a.getSetting)("countryLocale",{}),f=function(t){var e={};return void 0!==t.label&&(e.label=t.label),void 0!==t.required&&(e.required=t.required),void 0!==t.hidden&&(e.hidden=t.hidden),void 0===t.label||t.optionalLabel||(e.optionalLabel=Object(s.sprintf)(
/* translators: %s Field label. */
Object(s.__)("%s (optional)",'woocommerce'),t.label)),t.priority&&(Object(u.a)(t.priority)&&(e.index=t.priority),Object(u.c)(t.priority)&&(e.index=parseInt(t.priority,10))),t.hidden&&(e.required=!1),e},b=Object.entries(l).map((function(t){var e=o()(t,2),r=e[0],n=e[1];return[r,Object.entries(n).map((function(t){var e=o()(t,2),r=e[0],n=e[1];return[r,f(n)]})).reduce((function(t,e){var r=o()(e,2),n=r[0],c=r[1];return t[n]=c,t}),{})]})).reduce((function(t,e){var r=o()(e,2),n=r[0],c=r[1];return t[n]=c,t}),{});e.a=function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",n=r&&void 0!==b[r]?b[r]:{};return t.map((function(t){var r=a.defaultAddressFields[t]||{},c=n[t]||{},i=e[t]||{};return d(d(d({key:t},r),c),i)})).sort((function(t,e){return t.index-e.index}))}},142:function(t,e,r){"use strict";r.d(e,"a",(function(){return i}));var n=r(8),c=r.n(n),i=function(t){return t.reduce((function(t,e){var r=c()(e,2),n=r[0],i=r[1];return t[n]=i,t}),{})}},162:function(t,e,r){"use strict";r.d(e,"b",(function(){return o})),r.d(e,"c",(function(){return a})),r.d(e,"a",(function(){return s}));var n=r(3),c=r(113),i=r(23),o=function(t){var e=t.country,r=void 0===e?"":e,n=t.state,c=void 0===n?"":n,i=t.city,o=void 0===i?"":i,a=t.postcode,s=void 0===a?"":a;return{country:r.trim(),state:c.trim(),city:o.trim(),postcode:s?s.replace(" ","").toUpperCase():""}},a=function(t){var e=t.email,r=void 0===e?"":e;return Object(i.isEmail)(r)?r.trim():""},s=function(t){var e=Object.keys(n.defaultAddressFields),r=Object(c.a)(e,{},t.country),i=Object.assign({},t);return r.forEach((function(e){var r=e.key,n=void 0===r?"":r,c=e.hidden;void 0!==c&&c&&function(t,e){return t in e}(n,t)&&(i[n]="")})),i}},43:function(t,e,r){"use strict";r.d(e,"a",(function(){return j}));var n=r(8),c=r.n(n),i=r(5),o=r.n(i),a=r(7),s=r(0),u=r(24),p=r(14),d=r(25),l=r(142),f=r(162),b=r(63);function O(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function g(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?O(Object(r),!0).forEach((function(e){o()(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):O(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}var v={first_name:"",last_name:"",company:"",address_1:"",address_2:"",city:"",state:"",postcode:"",country:"",phone:""},_=g(g({},v),{},{email:""}),y={total_items:"",total_items_tax:"",total_fees:"",total_fees_tax:"",total_discount:"",total_discount_tax:"",total_shipping:"",total_shipping_tax:"",total_price:"",total_tax:"",tax_lines:u.EMPTY_TAX_LINES,currency_code:"",currency_symbol:"",currency_minor_unit:2,currency_decimal_separator:"",currency_thousand_separator:"",currency_prefix:"",currency_suffix:""},m=function(t){return Object(l.a)(Object.entries(t).map((function(t){var e=c()(t,2),r=e[0],n=e[1];return[r,Object(d.decodeEntities)(n)]})))},h={cartCoupons:u.EMPTY_CART_COUPONS,cartItems:u.EMPTY_CART_ITEMS,cartFees:u.EMPTY_CART_FEES,cartItemsCount:0,cartItemsWeight:0,cartNeedsPayment:!0,cartNeedsShipping:!0,cartItemErrors:u.EMPTY_CART_ITEM_ERRORS,cartTotals:y,cartIsLoading:!0,cartErrors:u.EMPTY_CART_ERRORS,billingAddress:_,shippingAddress:v,shippingRates:u.EMPTY_SHIPPING_RATES,shippingRatesLoading:!1,cartHasCalculatedShipping:!1,paymentRequirements:u.EMPTY_PAYMENT_REQUIREMENTS,receiveCart:function(){},extensions:u.EMPTY_EXTENSIONS},j=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{shouldSelect:!0},e=Object(b.b)(),r=e.isEditor,n=e.previewData,c=null==n?void 0:n.previewCart,i=t.shouldSelect,o=Object(s.useRef)(),d=Object(p.useSelect)((function(t,e){var n=e.dispatch;if(!i)return h;if(r)return{cartCoupons:c.coupons,cartItems:c.items,cartFees:c.fees,cartItemsCount:c.items_count,cartItemsWeight:c.items_weight,cartNeedsPayment:c.needs_payment,cartNeedsShipping:c.needs_shipping,cartItemErrors:u.EMPTY_CART_ITEM_ERRORS,cartTotals:c.totals,cartIsLoading:!1,cartErrors:u.EMPTY_CART_ERRORS,billingAddress:_,shippingAddress:v,extensions:u.EMPTY_EXTENSIONS,shippingRates:c.shipping_rates,shippingRatesLoading:!1,cartHasCalculatedShipping:c.has_calculated_shipping,paymentRequirements:c.paymentRequirements,receiveCart:"function"==typeof(null==c?void 0:c.receiveCart)?c.receiveCart:function(){}};var o=t(u.CART_STORE_KEY),a=o.getCartData(),s=o.getCartErrors(),p=o.getCartTotals(),d=!o.hasFinishedResolution("getCartData"),l=o.isCustomerDataUpdating(),b=n(u.CART_STORE_KEY).receiveCart,O=m(a.billingAddress),y=a.needsShipping?m(a.shippingAddress):O,j=a.fees.length>0?a.fees.map((function(t){return m(t)})):u.EMPTY_CART_FEES;return{cartCoupons:a.coupons.length>0?a.coupons.map((function(t){return g(g({},t),{},{label:t.code})})):u.EMPTY_CART_COUPONS,cartItems:a.items,cartFees:j,cartItemsCount:a.itemsCount,cartItemsWeight:a.itemsWeight,cartNeedsPayment:a.needsPayment,cartNeedsShipping:a.needsShipping,cartItemErrors:a.errors,cartTotals:p,cartIsLoading:d,cartErrors:s,billingAddress:Object(f.a)(O),shippingAddress:Object(f.a)(y),extensions:a.extensions,shippingRates:a.shippingRates,shippingRatesLoading:l,cartHasCalculatedShipping:a.hasCalculatedShipping,paymentRequirements:a.paymentRequirements,receiveCart:b}}),[i]);return o.current&&Object(a.isEqual)(o.current,d)||(o.current=d),o.current}},63:function(t,e,r){"use strict";r.d(e,"b",(function(){return o})),r.d(e,"a",(function(){return a}));var n=r(0),c=r(14),i=Object(n.createContext)({isEditor:!1,currentPostId:0,previewData:{},getPreviewData:function(){}}),o=function(){return Object(n.useContext)(i)},a=function(t){var e=t.children,r=t.currentPostId,o=void 0===r?0:r,a=t.previewData,s=void 0===a?{}:a,u=Object(c.useSelect)((function(t){return o||t("core/editor").getCurrentPostId()}),[o]),p=Object(n.useCallback)((function(t){return t in s?s[t]:{}}),[s]),d={isEditor:!0,currentPostId:u,previewData:s,getPreviewData:p};return Object(n.createElement)(i.Provider,{value:d},e)}},68:function(t,e,r){"use strict";r.d(e,"a",(function(){return p}));var n=r(5),c=r.n(n),i=r(55),o=r(0),a=r(43);function s(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function u(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?s(Object(r),!0).forEach((function(e){c()(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):s(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}var p=function(){var t=Object(a.a)(),e=Object(o.useRef)(t);return Object(o.useEffect)((function(){e.current=t}),[t]),{dispatchStoreEvent:Object(o.useCallback)((function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};try{Object(i.doAction)("experimental__woocommerce_blocks-".concat(t),e)}catch(t){console.error(t)}}),[]),dispatchCheckoutEvent:Object(o.useCallback)((function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};try{Object(i.doAction)("experimental__woocommerce_blocks-checkout-".concat(t),u(u({},r),{},{storeCart:e.current}))}catch(t){console.error(t)}}),[])}}},72:function(t,e,r){"use strict";r.d(e,"a",(function(){return n})),r.d(e,"c",(function(){return c})),r.d(e,"b",(function(){return i})),r.d(e,"d",(function(){return o}));var n=function(t){return"number"==typeof t},c=function(t){return"string"==typeof t},i=function(t){return!function(t){return null===t}(t)&&t instanceof Object&&t.constructor===Object};function o(t,e){return i(t)&&e in t}}}]);woocommerce-blocks/build/atomic-block-components/add-to-cart--atomic-block-components/button.js000064400000013005151335517640026747 0ustar00(window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[3],{141:function(e,t,n){"use strict";n.d(t,"b",(function(){return w})),n.d(t,"a",(function(){return y}));var c=n(5),r=n.n(c),o=n(8),i=n.n(o),s=n(0),u=(n(2),n(14)),a=n(68),f=n(63),d=n(9),l=n.n(d),b=n(6),v=n.n(b),O=n(890),p=(n(207),function(e){var t=e.status;switch(void 0===t?"default":t){case"error":return"woocommerce-error";case"success":return"woocommerce-message";case"info":case"warning":return"woocommerce-info"}return""}),j=function(e){var t=e.className,n=e.notices,c=e.removeNotice,r=n.filter((function(e){return"snackbar"!==e.type}));if(!r.length)return null;var o=v()(t,"wc-block-components-notices");return Object(s.createElement)("div",{className:o},r.map((function(e){return Object(s.createElement)(O.a,l()({key:"store-notice-"+e.id},e,{className:v()("wc-block-components-notices__notice",p(e)),onRemove:function(){e.isDismissible&&c(e.id)}}),e.content)})))};function m(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(e);t&&(c=c.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,c)}return n}function g(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?m(Object(n),!0).forEach((function(t){r()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):m(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var h=Object(s.createContext)({notices:[],createNotice:function(e,t,n){},removeNotice:function(e,t){},setIsSuppressed:function(e){},context:"wc/core"}),w=function(){return Object(s.useContext)(h)},y=function(e){var t=e.children,n=e.className,c=void 0===n?"":n,r=e.createNoticeContainer,o=void 0===r||r,d=e.context,l=void 0===d?"wc/core":d,b=Object(u.useDispatch)("core/notices"),v=b.createNotice,O=b.removeNotice,p=Object(s.useState)(!1),m=i()(p,2),w=m[0],y=m[1],N=Object(a.a)().dispatchStoreEvent,E=Object(f.b)().isEditor,P=Object(s.useCallback)((function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};v(e,t,g(g({},n),{},{context:n.context||l})),N("store-notice-create",{status:e,content:t,options:n})}),[v,N,l]),S=Object(s.useCallback)((function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:l;O(e,t)}),[O,l]),D={notices:Object(u.useSelect)((function(e){return{notices:e("core/notices").getNotices(l)}}),[l]).notices,createNotice:P,removeNotice:S,context:l,setIsSuppressed:y},k=w?null:Object(s.createElement)(j,{className:c,notices:D.notices,removeNotice:D.removeNotice,isEditor:E});return Object(s.createElement)(h.Provider,{value:D},o&&k,t)}},207:function(e,t){},59:function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var c=n(5),r=n.n(c),o=n(0),i=n(141);function s(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(e);t&&(c=c.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,c)}return n}function u(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?s(Object(n),!0).forEach((function(t){r()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):s(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var a=function(){var e=Object(i.b)(),t=e.notices,n=e.createNotice,c=e.removeNotice,r=e.setIsSuppressed,s=Object(o.useRef)(t);Object(o.useEffect)((function(){s.current=t}),[t]);var a=Object(o.useMemo)((function(){return{hasNoticesOfType:function(e){return s.current.some((function(t){return t.type===e}))},removeNotices:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;s.current.forEach((function(t){null!==e&&t.status!==e||c(t.id)}))},removeNotice:c}}),[c]),f=Object(o.useMemo)((function(){return{addDefaultNotice:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};n("default",e,u({},t))},addErrorNotice:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};n("error",e,u({},t))},addWarningNotice:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};n("warning",e,u({},t))},addInfoNotice:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};n("info",e,u({},t))},addSuccessNotice:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};n("success",e,u({},t))}}}),[n]);return u(u(u({notices:t},a),f),{},{setIsSuppressed:r})}},788:function(e,t,n){"use strict";n.d(t,"a",(function(){return l}));var c=n(8),r=n.n(c),o=n(0),i=n(14),s=n(24),u=n(25),a=n(43),f=n(59),d=function(e,t){var n=e.find((function(e){return e.id===t}));return n?n.quantity:0},l=function(e){var t=Object(i.useDispatch)(s.CART_STORE_KEY).addItemToCart,n=Object(a.a)(),c=n.cartItems,l=n.cartIsLoading,b=Object(f.a)(),v=b.addErrorNotice,O=b.removeNotice,p=Object(o.useState)(!1),j=r()(p,2),m=j[0],g=j[1],h=Object(o.useRef)(d(c,e));return Object(o.useEffect)((function(){var t=d(c,e);t!==h.current&&(h.current=t)}),[c,e]),{cartQuantity:Number.isFinite(h.current)?h.current:0,addingToCart:m,cartIsLoading:l,addToCart:function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;return g(!0),t(e,n).then((function(){O("add-to-cart")})).catch((function(e){v(Object(u.decodeEntities)(e.message),{context:"wc/all-products",id:"add-to-cart",isDismissible:!0})})).finally((function(){g(!1)}))}}}}}]);atomic-block-components/add-to-cart--atomic-block-components/image--atomic-block-components/title.js000064400000001041151335517640034357 0ustar00woocommerce-blocks/build(window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[2],{900:function(e,n,a){"use strict";var c=a(9),r=a.n(c),t=a(0);n.a=function(e){return function(n){return function(a){var c=function(e,n){var a=[];return Object.keys(e).forEach((function(c){if(void 0!==n[c])switch(e[c].type){case"boolean":a[c]="false"!==n[c]&&!1!==n[c];break;case"number":a[c]=parseInt(n[c],10);break;case"array":case"object":a[c]=JSON.parse(n[c]);break;default:a[c]=n[c]}else a[c]=e[c].default})),a}(e,a);return Object(t.createElement)(n,r()({},a,c))}}}}}]);woocommerce-blocks/build/atomic-block-components/summary-frontend.js000064400000004015151335517640022046 0ustar00(window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[17],{151:function(t,e,n){"use strict";var c=n(0),r=n(113),o=n(97),a=function(t){var e=t.indexOf("</p>");return-1===e?t:t.substr(0,e+4)},u=function(t){return t.replace(/<\/?[a-z][^>]*?>/gi,"")},s=function(t,e){return t.replace(/[\s|\.\,]+$/i,"")+e},i=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"&hellip;",c=u(t),r=c.split(" ").splice(0,e).join(" ");return Object(o.autop)(s(r,n))},l=function(t,e){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],c=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"&hellip;",r=u(t),a=r.slice(0,e);if(n)return Object(o.autop)(s(a,c));var i=a.match(/([\s]+)/g),l=i?i.length:0,p=r.slice(0,e+l);return Object(o.autop)(s(p,c))};e.a=function(t){var e=t.source,n=t.maxLength,u=void 0===n?15:n,s=t.countType,p=void 0===s?"words":s,d=t.className,m=void 0===d?"":d,v=Object(c.useMemo)((function(){return function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:15,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"words",c=Object(o.autop)(t),u=Object(r.count)(c,n);if(u<=e)return c;var s=a(c),p=Object(r.count)(s,n);return p<=e?s:"words"===n?i(s,e):l(s,e,"characters_including_spaces"===n)}(e,u,p)}),[e,u,p]);return React.createElement(c.RawHTML,{className:m},v)}},363:function(t,e){},390:function(t,e,n){"use strict";n.r(e);var c=n(4),r=n.n(c),o=(n(10),n(6)),a=n.n(o),u=n(151),s=n(83),i=n(101),l=n(249);n(363),e.default=Object(l.withProductDataContext)((function(t){var e=t.className,n=Object(i.useInnerBlockLayoutContext)().parentClassName,c=Object(i.useProductDataContext)().product;if(!c)return React.createElement("div",{className:a()(e,"wc-block-components-product-summary",r()({},"".concat(n,"__product-summary"),n))});var o=c.short_description?c.short_description:c.description;return o?React.createElement(u.a,{className:a()(e,"wc-block-components-product-summary",r()({},"".concat(n,"__product-summary"),n)),source:o,maxLength:150,countType:s.n.wordCountType||"words"}):null}))}}]);woocommerce-blocks/build/atomic-block-components/sale-badge-frontend.js000064400000003553151335517640022343 0ustar00(window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[14],{351:function(e,t){},354:function(e,t,r){"use strict";r.r(t);var c=r(4),n=r.n(c),a=(r(10),r(1)),o=r(6),s=r.n(o),l=r(51),u=r(101),p=r(249);r(351),t.default=Object(p.withProductDataContext)((function(e){var t=e.className,r=e.align,c=Object(u.useInnerBlockLayoutContext)().parentClassName,o=Object(u.useProductDataContext)().product;if(!o.id||!o.on_sale)return null;var p="string"==typeof r?"wc-block-components-product-sale-badge--align-".concat(r):"";return React.createElement("div",{className:s()("wc-block-components-product-sale-badge",t,p,n()({},"".concat(c,"__product-onsale"),c))},React.createElement(l.a,{label:Object(a.__)("Sale",'woocommerce'),screenReaderLabel:Object(a.__)("Product on sale",'woocommerce')}))}))},51:function(e,t,r){"use strict";var c=r(4),n=r.n(c),a=r(0),o=r(6),s=r.n(o);function l(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(e);t&&(c=c.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,c)}return r}function u(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?l(Object(r),!0).forEach((function(t){n()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):l(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}t.a=function(e){var t,r=e.label,c=e.screenReaderLabel,n=e.wrapperElement,o=e.wrapperProps,l=void 0===o?{}:o,p=null!=r,b=null!=c;return!p&&b?(t=n||"span",l=u(u({},l),{},{className:s()(l.className,"screen-reader-text")}),React.createElement(t,l,c)):(t=n||a.Fragment,p&&b&&r!==c?React.createElement(t,l,React.createElement("span",{"aria-hidden":"true"},r),React.createElement("span",{className:"screen-reader-text"},c)):React.createElement(t,l,r))}}}]);woocommerce-blocks/build/atomic-block-components/add-to-cart.js000064400000066675151335517640020657 0ustar00(window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[8],{114:function(e,t,r){"use strict";var n=r(0);r(209),t.a=function(){return Object(n.createElement)("span",{className:"wc-block-components-spinner","aria-hidden":"true"})}},126:function(e,t,r){"use strict";r.d(t,"a",(function(){return u})),r.d(t,"b",(function(){return b}));var n,c=r(5),o=r.n(c),a=r(7);function s(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function i(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?s(Object(r),!0).forEach((function(t){o()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):s(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}!function(e){e.ADD_EVENT_CALLBACK="add_event_callback",e.REMOVE_EVENT_CALLBACK="remove_event_callback"}(n||(n={}));var u={addEventCallback:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:10;return{id:Object(a.uniqueId)(),type:n.ADD_EVENT_CALLBACK,eventType:e,callback:t,priority:r}},removeEventCallback:function(e,t){return{id:t,type:n.REMOVE_EVENT_CALLBACK,eventType:e}}},l={},b=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:l,t=arguments.length>1?arguments[1]:void 0,r=t.type,c=t.eventType,a=t.id,s=t.callback,u=t.priority,b=e.hasOwnProperty(c)?new Map(e[c]):new Map;switch(r){case n.ADD_EVENT_CALLBACK:return b.set(a,{priority:u,callback:s}),i(i({},e),{},o()({},c,b));case n.REMOVE_EVENT_CALLBACK:return b.delete(a),i(i({},e),{},o()({},c,b))}}},132:function(e,t,r){"use strict";r.d(t,"b",(function(){return h})),r.d(t,"a",(function(){return g}));var n=r(38),c=r.n(n),o=r(5),a=r.n(o),s=r(16),i=r.n(s),u=r(8),l=r.n(u),b=r(0),f=r(7),d=r(34),p=r.n(d);function O(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function m(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?O(Object(r),!0).forEach((function(t){a()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):O(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function v(e){var t=function(e,t){if("object"!==c()(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!==c()(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===c()(t)?t:String(t)}var j=Object(b.createContext)({getValidationError:function(){return""},setValidationErrors:function(e){},clearValidationError:function(e){},clearAllValidationErrors:function(){},hideValidationError:function(){},showValidationError:function(){},showAllValidationErrors:function(){},hasValidationErrors:!1,getValidationErrorId:function(e){return e}}),h=function(){return Object(b.useContext)(j)},g=function(e){var t=e.children,r=Object(b.useState)({}),n=l()(r,2),c=n[0],o=n[1],s=Object(b.useCallback)((function(e){return c[e]}),[c]),u=Object(b.useCallback)((function(e){var t=c[e];return!t||t.hidden?"":"validate-error-".concat(e)}),[c]),d=Object(b.useCallback)((function(e){o((function(t){return t[e]?(t[e],i()(t,[e].map(v))):t}))}),[]),O=Object(b.useCallback)((function(){o({})}),[]),h=Object(b.useCallback)((function(e){e&&o((function(t){return e=Object(f.pickBy)(e,(function(e,r){return!("string"!=typeof e.message||t.hasOwnProperty(r)&&p()(t[r],e))})),0===Object.values(e).length?t:m(m({},t),e)}))}),[]),g=Object(b.useCallback)((function(e,t){o((function(r){if(!r.hasOwnProperty(e))return r;var n=m(m({},r[e]),t);return p()(r[e],n)?r:m(m({},r),{},a()({},e,n))}))}),[]),y={getValidationError:s,setValidationErrors:h,clearValidationError:d,clearAllValidationErrors:O,hideValidationError:Object(b.useCallback)((function(e){g(e,{hidden:!0})}),[g]),showValidationError:Object(b.useCallback)((function(e){g(e,{hidden:!1})}),[g]),showAllValidationErrors:Object(b.useCallback)((function(){o((function(e){var t={};return Object.keys(e).forEach((function(r){e[r].hidden&&(t[r]=m(m({},e[r]),{},{hidden:!1}))})),0===Object.values(t).length?e:m(m({},e),t)}))}),[]),hasValidationErrors:Object.keys(c).length>0,getValidationErrorId:u};return Object(b.createElement)(j.Provider,{value:y},t)}},208:function(e,t){},209:function(e,t){},210:function(e,t){},234:function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));var n=r(0),c=(r(2),r(132)),o=(r(210),function(e){var t=e.errorMessage,r=void 0===t?"":t,o=e.propertyName,a=void 0===o?"":o,s=e.elementId,i=void 0===s?"":s,u=Object(c.b)(),l=u.getValidationError,b=u.getValidationErrorId;if(!r||"string"!=typeof r){var f=l(a)||{};if(!f.message||f.hidden)return null;r=f.message}return Object(n.createElement)("div",{className:"wc-block-components-validation-error",role:"alert"},Object(n.createElement)("p",{id:b(i)},r))})},321:function(e,t,r){"use strict";r.d(t,"a",(function(){return c}));var n=r(126),c=function(e,t){return function(r){var c=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10,o=n.a.addEventCallback(e,r,c);return t(o),function(){t(n.a.removeEventCallback(e,o.id))}}}},322:function(e,t,r){"use strict";r.d(t,"a",(function(){return d})),r.d(t,"b",(function(){return p}));var n=r(38),c=r.n(n),o=r(29),a=r.n(o),s=r(22),i=r.n(s),u=function(e,t){return e[t]?Array.from(e[t].values()).sort((function(e,t){return e.priority-t.priority})):[]},l=r(50);function b(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return f(e,void 0);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?f(e,void 0):void 0}}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,c=function(){};return{s:c,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:c}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function f(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var d=function(){var e=a()(i.a.mark((function e(t,r,n){var o,a,s,l,f,d;return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:o=u(t,r),a=[],s=b(o),e.prev=3,s.s();case 5:if((l=s.n()).done){e.next=19;break}return f=l.value,e.prev=7,e.next=10,Promise.resolve(f.callback(n));case 10:d=e.sent,"object"===c()(d)&&a.push(d),e.next=17;break;case 14:e.prev=14,e.t0=e.catch(7),console.error(e.t0);case 17:e.next=5;break;case 19:e.next=24;break;case 21:e.prev=21,e.t1=e.catch(3),s.e(e.t1);case 24:return e.prev=24,s.f(),e.finish(24);case 27:return e.abrupt("return",!a.length||a);case 28:case"end":return e.stop()}}),e,null,[[3,21,24,27],[7,14]])})));return function(_x,t,r){return e.apply(this,arguments)}}(),p=function(){var e=a()(i.a.mark((function e(t,r,n){var o,a,s,f,d,p;return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:o=[],a=u(t,r),s=b(a),e.prev=3,s.s();case 5:if((f=s.n()).done){e.next=28;break}return d=f.value,e.prev=7,e.next=10,Promise.resolve(d.callback(n));case 10:if(p=e.sent,"object"===c()(p)&&null!==p){e.next=13;break}return e.abrupt("continue",26);case 13:if(p.hasOwnProperty("type")){e.next=15;break}throw new Error("Returned objects from event emitter observers must return an object with a type property");case 15:if(!Object(l.a)(p)&&!Object(l.b)(p)){e.next=18;break}return o.push(p),e.abrupt("return",o);case 18:o.push(p),e.next=26;break;case 21:return e.prev=21,e.t0=e.catch(7),console.error(e.t0),o.push({type:"error"}),e.abrupt("return",o);case 26:e.next=5;break;case 28:e.next=33;break;case 30:e.prev=30,e.t1=e.catch(3),s.e(e.t1);case 33:return e.prev=33,s.f(),e.finish(33);case 36:return e.abrupt("return",o);case 37:case"end":return e.stop()}}),e,null,[[3,30,33,36],[7,21]])})));return function(t,r,n){return e.apply(this,arguments)}}()},372:function(e,t){},376:function(e,t,r){"use strict";t.a={showFormElements:{type:"boolean",default:!1},productId:{type:"number",default:0}}},377:function(e,t,r){"use strict";var n=r(0),c=(r(2),r(6)),o=r.n(c),a=r(8),s=r.n(a),i=r(1),u=r(62),l=r(879),b={status:"pristine",hasError:!1,quantity:1,processingResponse:null,requestParams:{}},f=function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=e?"set_has_error":"set_no_error";return{type:t}},d=r(5),p=r.n(d);function O(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function m(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?O(Object(r),!0).forEach((function(t){p()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):O(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var v="idle",j=function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:b,r=arguments.length>1?arguments[1]:void 0,n=r.quantity,c=r.type,o=r.data;switch(c){case"set_pristine":e=b;break;case"set_idle":e=t.status!==v?m(m({},t),{},{status:v}):t;break;case"set_disabled":e="disabled"!==t.status?m(m({},t),{},{status:"disabled"}):t;break;case"set_quantity":e=n!==t.quantity?m(m({},t),{},{quantity:n}):t;break;case"set_request_params":e=m(m({},t),{},{requestParams:m(m({},t.requestParams),o)});break;case"set_processing_response":e=m(m({},t),{},{processingResponse:o});break;case"set_processing":e=!1===(e="processing"!==t.status?m(m({},t),{},{status:"processing",hasError:!1}):t).hasError?e:m(m({},e),{},{hasError:!1});break;case"set_before_processing":e="before_processing"!==t.status?m(m({},t),{},{status:"before_processing",hasError:!1}):t;break;case"set_after_processing":e="after_processing"!==t.status?m(m({},t),{},{status:"after_processing"}):t;break;case"set_has_error":e=t.hasError?t:m(m({},t),{},{hasError:!0}),e="processing"===t.status||"before_processing"===t.status?m(m({},e),{},{status:v}):e;break;case"set_no_error":e=t.hasError?m(m({},t),{},{hasError:!1}):t}return e!==t&&"set_pristine"!==c&&"pristine"===e.status&&(e.status=v),e},h=r(126),g=r(321),y=function(e){return{onAddToCartAfterProcessingWithSuccess:Object(g.a)("add_to_cart_after_processing_with_success",e),onAddToCartProcessingWithError:Object(g.a)("add_to_cart_after_processing_with_error",e),onAddToCartBeforeProcessing:Object(g.a)("add_to_cart_before_processing",e)}},E=r(322),_=r(132),w=r(59),P=r(50),k=Object(n.createContext)({product:{},productType:"simple",productIsPurchasable:!0,productHasOptions:!1,supportsFormElements:!0,showFormElements:!1,quantity:0,minQuantity:1,maxQuantity:99,requestParams:{},isIdle:!1,isDisabled:!1,isProcessing:!1,isBeforeProcessing:!1,isAfterProcessing:!1,hasError:!1,eventRegistration:{onAddToCartAfterProcessingWithSuccess:function(e){},onAddToCartAfterProcessingWithError:function(e){},onAddToCartBeforeProcessing:function(e){}},dispatchActions:{resetForm:function(){},submitForm:function(){},setQuantity:function(e){},setHasError:function(e){},setAfterProcessing:function(e){},setRequestParams:function(e){}}}),C=function(){return Object(n.useContext)(k)},A=function(e){var t=e.children,r=e.product,c=e.showFormElements,o=Object(n.useReducer)(j,b),a=s()(o,2),d=a[0],p=a[1],O=Object(n.useReducer)(h.b,{}),m=s()(O,2),v=m[0],g=m[1],C=Object(u.a)(v),A=Object(w.a)(),S=A.addErrorNotice,x=A.removeNotices,D=Object(_.b)().setValidationErrors,N=Object(P.c)(),V=N.isSuccessResponse,R=N.isErrorResponse,T=N.isFailResponse,q=Object(n.useMemo)((function(){return{onAddToCartAfterProcessingWithSuccess:y(g).onAddToCartAfterProcessingWithSuccess,onAddToCartAfterProcessingWithError:y(g).onAddToCartAfterProcessingWithError,onAddToCartBeforeProcessing:y(g).onAddToCartBeforeProcessing}}),[g]),F=Object(n.useMemo)((function(){return{resetForm:function(){p({type:"set_pristine"})},submitForm:function(){p({type:"set_before_processing"})},setQuantity:function(e){p(function(e){return{type:"set_quantity",quantity:e}}(e))},setHasError:function(e){p(f(e))},setRequestParams:function(e){p(function(e){return{type:"set_request_params",data:e}}(e))},setAfterProcessing:function(e){p({type:"set_processing_response",data:e}),p({type:"set_after_processing"})}}}),[]);Object(n.useEffect)((function(){var e=d.status,t=!r.id||!Object(l.a)(r);"disabled"!==e||t?"disabled"!==e&&t&&p({type:"set_disabled"}):p({type:"set_idle"})}),[d.status,r,p]),Object(n.useEffect)((function(){"before_processing"===d.status&&(x("error"),Object(E.a)(C,"add_to_cart_before_processing",{}).then((function(e){!0!==e?(Array.isArray(e)&&e.forEach((function(e){var t=e.errorMessage,r=e.validationErrors;t&&S(t),r&&D(r)})),p({type:"set_idle"})):p({type:"set_processing"})})))}),[d.status,D,S,x,p,C]),Object(n.useEffect)((function(){if("after_processing"===d.status){var e={processingResponse:d.processingResponse},t=function(e){var t=!1;return e.forEach((function(e){var r=e.message,n=e.messageContext;(R(e)||T(e))&&r&&(t=!0,S(r,n?{context:n}:void 0))})),t};if(d.hasError)return void Object(E.b)(C,"add_to_cart_after_processing_with_error",e).then((function(r){if(!t(r)){var n,c=(null===(n=e.processingResponse)||void 0===n?void 0:n.message)||Object(i.__)("Something went wrong. Please contact us to get assistance.",'woocommerce');S(c,{id:"add-to-cart"})}p({type:"set_idle"})}));Object(E.b)(C,"add_to_cart_after_processing_with_success",e).then((function(e){t(e)?p(f(!0)):p({type:"set_idle"})}))}}),[d.status,d.hasError,d.processingResponse,F,S,R,T,V,C]);var B=Object(l.b)(r),I={product:r,productType:r.type||"simple",productIsPurchasable:Object(l.a)(r),productHasOptions:r.has_options||!1,supportsFormElements:B,showFormElements:c&&B,quantity:d.quantity,minQuantity:1,maxQuantity:r.quantity_limit||99,requestParams:d.requestParams,isIdle:"idle"===d.status,isDisabled:"disabled"===d.status,isProcessing:"processing"===d.status,isBeforeProcessing:"before_processing"===d.status,isAfterProcessing:"after_processing"===d.status,hasError:d.hasError,eventRegistration:q,dispatchActions:F};return Object(n.createElement)(k.Provider,{value:I},t)},S=r(15),x=r.n(S),D=r(25),N=r(43);function V(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}var R=function(){var e=C(),t=e.dispatchActions,r=e.product,c=e.quantity,o=e.eventRegistration,a=e.hasError,u=e.isProcessing,l=e.requestParams,b=Object(_.b)(),f=b.hasValidationErrors,d=b.showAllValidationErrors,O=Object(w.a)(),m=O.addErrorNotice,v=O.removeNotice,j=Object(N.a)().receiveCart,h=Object(n.useState)(!1),g=s()(h,2),y=g[0],E=g[1],P=!a&&u,k=Object(n.useCallback)((function(){return!f||(d(),{type:"error"})}),[f,d]);Object(n.useEffect)((function(){var e=o.onAddToCartBeforeProcessing(k,0);return function(){e()}}),[o,k]);var A=Object(n.useCallback)((function(){E(!0),v("add-to-cart");var e=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?V(Object(r),!0).forEach((function(t){p()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):V(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({id:r.id||0,quantity:c},l);x()({path:"/wc/store/cart/add-item",method:"POST",data:e,cache:"no-store",parse:!1}).then((function(e){x.a.setNonce(e.headers),e.json().then((function(r){e.ok?j(r):(r.body&&r.body.message?m(Object(D.decodeEntities)(r.body.message),{id:"add-to-cart"}):m(Object(i.__)("Something went wrong. Please contact us to get assistance.",'woocommerce'),{id:"add-to-cart"}),t.setHasError()),t.setAfterProcessing(r),E(!1)}))})).catch((function(e){e.json().then((function(e){var r;null!==(r=e.data)&&void 0!==r&&r.cart&&j(e.data.cart),t.setHasError(),t.setAfterProcessing(e),E(!1)}))}))}),[r,m,v,j,t,c,l]);return Object(n.useEffect)((function(){P&&!y&&A()}),[P,A,y]),null},T=function(e){var t=e.children,r=e.product,c=e.showFormElements;return Object(n.createElement)(_.a,null,Object(n.createElement)(A,{product:r,showFormElements:c},t,Object(n.createElement)(R,null)))},q=r(45),F=r(7),B=r(86),I=(r(372),r(90)),L=r(66),M=r(567),Q=r(68),W=r(788),H=function(e){var t=e.className,r=e.href,c=e.text,o=e.onClick;return Object(n.createElement)(I.a,{className:t,href:r,onClick:o,rel:"nofollow"},c)},K=function(e){var t=e.className,r=e.quantityInCart,c=e.isProcessing,o=e.isDisabled,a=e.isDone,s=e.onClick;return Object(n.createElement)(I.a,{className:t,disabled:o,showSpinner:c,onClick:s},a&&r>0?Object(i.sprintf)(
/* translators: %s number of products in cart. */
Object(i._n)("%d in cart","%d in cart",r,'woocommerce'),r):Object(i.__)("Add to cart",'woocommerce'),!!a&&Object(n.createElement)(L.a,{srcElement:M.a,alt:Object(i.__)("Done",'woocommerce')}))},U=function(){var e=C(),t=e.showFormElements,r=e.productIsPurchasable,c=e.productHasOptions,o=e.product,a=e.productType,u=e.isDisabled,l=e.isProcessing,b=e.eventRegistration,f=e.hasError,d=e.dispatchActions,p=Object(q.useInnerBlockLayoutContext)().parentName,O=Object(Q.a)().dispatchStoreEvent,m=Object(W.a)(o.id||0).cartQuantity,v=Object(n.useState)(!1),j=s()(v,2),h=j[0],g=j[1],y=o.add_to_cart||{url:"",text:""};return Object(n.useEffect)((function(){var e=b.onAddToCartAfterProcessingWithSuccess((function(){return f||g(!0),!0}),0);return function(){e()}}),[b,f]),(t||!c&&"simple"===a)&&r?Object(n.createElement)(K,{className:"wc-block-components-product-add-to-cart-button",quantityInCart:m,isDisabled:u,isProcessing:l,isDone:h,onClick:function(){d.submitForm(),O("cart-add-item",{product:o,listName:p})}}):Object(n.createElement)(H,{className:"wc-block-components-product-add-to-cart-button",href:y.url,text:y.text||Object(i.__)("View Product",'woocommerce'),onClick:function(){O("product-view-link",{product:o,listName:p})}})},z=function(e){var t=e.disabled,r=e.min,c=e.max,o=e.value,a=e.onChange;return Object(n.createElement)("input",{className:"wc-block-components-product-add-to-cart-quantity",type:"number",value:o,min:r,max:c,hidden:1===c,disabled:t,onChange:function(e){a(e.target.value)}})},G=function(e){var t=e.reason,r=void 0===t?Object(i.__)("Sorry, this product cannot be purchased.",'woocommerce'):t;return Object(n.createElement)("div",{className:"wc-block-components-product-add-to-cart-unavailable"},r)},J=function(){var e=C(),t=e.product,r=e.quantity,c=e.minQuantity,o=e.maxQuantity,a=e.dispatchActions,s=e.isDisabled;return t.id&&!t.is_purchasable?Object(n.createElement)(G,null):t.id&&!t.is_in_stock?Object(n.createElement)(G,{reason:Object(i.__)("This product is currently out of stock and cannot be purchased.",'woocommerce')}):Object(n.createElement)(n.Fragment,null,Object(n.createElement)(z,{value:r,min:c,max:o,disabled:s,onChange:a.setQuantity}),Object(n.createElement)(U,null))},Y=(r(566),r(33)),X=r.n(Y),$=r(897),Z=r(11),ee=r(234),te={value:"",label:Object(i.__)("Select an option",'woocommerce')},re=function(e){var t=e.attributeName,r=e.options,c=void 0===r?[]:r,a=e.value,s=void 0===a?"":a,u=e.onChange,l=void 0===u?function(){}:u,b=e.errorMessage,f=void 0===b?Object(i.__)("Please select a value.",'woocommerce'):b,d=Object(_.b)(),O=d.getValidationError,m=d.setValidationErrors,v=d.clearValidationError,j=t,h=O(j)||{};return Object(Z.useEffect)((function(){s?v(j):m(p()({},j,{message:f,hidden:!0}))}),[s,j,f,v,m]),Object(Z.useEffect)((function(){return function(){v(j)}}),[j,v]),Object(n.createElement)("div",{className:"wc-block-components-product-add-to-cart-attribute-picker__container"},Object(n.createElement)($.a,{label:Object(D.decodeEntities)(t),value:s||"",options:[te].concat(X()(c)),onChange:l,required:!0,className:o()("wc-block-components-product-add-to-cart-attribute-picker__select",{"has-error":h.message&&!h.hidden})}),Object(n.createElement)(ee.a,{propertyName:j,elementId:j}))},ne=r(72);function ce(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function oe(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ce(Object(r),!0).forEach((function(t){p()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ce(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var ae=function(e,t,r){var n=Object.values(t).map((function(e){return e.id}));if(Object.values(r).every((function(e){return""===e})))return n;var c=Object.keys(e);return n.filter((function(e){return c.every((function(n){var c=r[n]||"",o=t["id:"+e].attributes[n];return""===c||null===o||o===c}))}))};function se(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function ie(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?se(Object(r),!0).forEach((function(t){p()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):se(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var ue=function(e){var t=e.attributes,r=e.variationAttributes,c=e.setRequestParams,o=Object(u.a)(t),a=Object(u.a)(r),i=Object(n.useState)(0),l=s()(i,2),b=l[0],f=l[1],d=Object(n.useState)({}),O=s()(d,2),m=O[0],v=O[1],j=Object(n.useState)(!1),h=s()(j,2),g=h[0],y=h[1],E=Object(n.useMemo)((function(){return function(e,t,r){var n={},c=Object.keys(e),o=Object.values(r).filter(Boolean).length>0;return c.forEach((function(c){var a=e[c],s=oe(oe({},r),{},p()({},c,null)),i=o?ae(e,t,s):null,u=null!==i?i.map((function(e){return t["id:"+e].attributes[c]})):null;n[c]=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return Object.values(e).map((function(e){var r=e.name,n=e.slug;return null===t||t.includes(null)||t.includes(n)?{value:n,label:Object(D.decodeEntities)(r)}:null})).filter(Boolean)}(a.terms,u)})),n}(o,a,m)}),[m,o,a]);return Object(n.useEffect)((function(){if(!g){var e=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!Object(ne.b)(e))return{};var t=Object.keys(e),r={};return 0===t.length||t.forEach((function(t){var n,c=e[t],o=c.terms.filter((function(e){return e.default}));o.length>0&&(r[c.name]=null===(n=o[0])||void 0===n?void 0:n.slug)})),r}(t);e&&v(ie({},e)),y(!0)}}),[m,t,g]),Object(n.useEffect)((function(){Object.values(m).filter((function(e){return""!==e})).length===Object.keys(o).length?f(function(e,t,r){return ae(e,t,r)[0]||0}(o,a,m)):b>0&&f(0)}),[m,b,o,a]),Object(n.useEffect)((function(){c({id:b,variation:Object.keys(m).map((function(e){return{attribute:e,value:m[e]}}))})}),[c,b,m]),Object(n.createElement)("div",{className:"wc-block-components-product-add-to-cart-attribute-picker"},Object.keys(o).map((function(e){return Object(n.createElement)(re,{key:e,attributeName:e,options:E[e],value:m[e],onChange:function(t){v(ie(ie({},m),{},p()({},e,t)))}})})))},le=function(e){var t=e.product,r=e.dispatchers,c=function(e){return e?Object(F.keyBy)(Object.values(e).filter((function(e){return e.has_variations})),"name"):{}}(t.attributes),o=function(e){if(!e)return{};var t={};return e.forEach((function(e){var r=e.id,n=e.attributes;t["id:".concat(r)]={id:r,attributes:n.reduce((function(e,t){var r=t.name,n=t.value;return e[r]=n,e}),{})}})),t}(t.variations);return 0===Object.keys(c).length||0===o.length?null:Object(n.createElement)(ue,{attributes:c,variationAttributes:o,setRequestParams:r.setRequestParams})},be=function(){var e=C(),t=e.product,r=e.quantity,c=e.minQuantity,o=e.maxQuantity,a=e.dispatchActions,s=e.isDisabled;return t.id&&!t.is_purchasable?Object(n.createElement)(G,null):t.id&&!t.is_in_stock?Object(n.createElement)(G,{reason:Object(i.__)("This product is currently out of stock and cannot be purchased.",'woocommerce')}):Object(n.createElement)(n.Fragment,null,Object(n.createElement)(le,{product:t,dispatchers:a}),Object(n.createElement)(z,{value:r,min:c,max:o,disabled:s,onChange:a.setQuantity}),Object(n.createElement)(U,null))},fe=function(){return Object(n.createElement)(U,null)},de=r(891),pe=function(){return Object(n.createElement)(de.a,{className:"wc-block-components-product-add-to-cart-group-list"},"This is a placeholder for the grouped products form element.")},Oe=function(){return Object(n.createElement)(pe,null)},me=function(){var e=C(),t=e.showFormElements,r=e.productType;return t?"variable"===r?Object(n.createElement)(be,null):"grouped"===r?Object(n.createElement)(Oe,null):"external"===r?Object(n.createElement)(fe,null):"simple"===r||"variation"===r?Object(n.createElement)(J,null):null:Object(n.createElement)(U,null)};t.a=Object(B.withProductDataContext)((function(e){var t=e.className,r=e.showFormElements,c=Object(q.useProductDataContext)().product,a=o()(t,"wc-block-components-product-add-to-cart",{"wc-block-components-product-add-to-cart--placeholder":Object(F.isEmpty)(c)});return Object(n.createElement)(T,{product:c,showFormElements:r},Object(n.createElement)("div",{className:a},Object(n.createElement)(me,null)))}))},50:function(e,t,r){"use strict";r.d(t,"a",(function(){return i})),r.d(t,"b",(function(){return u})),r.d(t,"c",(function(){return b}));var n,c,o=r(72);!function(e){e.SUCCESS="success",e.FAIL="failure",e.ERROR="error"}(n||(n={})),function(e){e.PAYMENTS="wc/payment-area",e.EXPRESS_PAYMENTS="wc/express-payment-area"}(c||(c={}));var a=function(e,t){return Object(o.b)(e)&&"type"in e&&e.type===t},s=function(e){return a(e,n.SUCCESS)},i=function(e){return a(e,n.ERROR)},u=function(e){return a(e,n.FAIL)},l=function(e){return!Object(o.b)(e)||void 0===e.retry||!0===e.retry},b=function(){return{responseTypes:n,noticeContexts:c,shouldRetry:l,isSuccessResponse:s,isErrorResponse:i,isFailResponse:u}}},566:function(e,t){},567:function(e,t,r){"use strict";var n=r(0),c=r(28),o=Object(n.createElement)(c.SVG,{xmlns:"http://www.w3.org/2000/SVG",viewBox:"0 0 24 24"},Object(n.createElement)("path",{fill:"none",d:"M0 0h24v24H0z"}),Object(n.createElement)("path",{d:"M9 16.2L4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4L9 16.2z"}));t.a=o},62:function(e,t,r){"use strict";r.d(t,"a",(function(){return a}));var n=r(0),c=r(34),o=r.n(c);function a(e){var t=Object(n.useRef)(e);return o()(e,t.current)||(t.current=e),t.current}},879:function(e,t,r){"use strict";r.d(t,"a",(function(){return n})),r.d(t,"b",(function(){return c}));var n=function(e){return e.is_purchasable||!1},c=function(e){return["simple","variable"].includes(e.type||"simple")}},90:function(e,t,r){"use strict";var n=r(9),c=r.n(n),o=r(16),a=r.n(o),s=r(0),i=r(182),u=r(6),l=r.n(u),b=r(114),f=(r(208),["className","showSpinner","children"]);t.a=function(e){var t=e.className,r=e.showSpinner,n=void 0!==r&&r,o=e.children,u=a()(e,f),d=l()("wc-block-components-button",t,{"wc-block-components-button--loading":n});return Object(s.createElement)(i.a,c()({className:d},u),n&&Object(s.createElement)(b.a,null),Object(s.createElement)("span",{className:"wc-block-components-button__text"},o))}},903:function(e,t,r){"use strict";r.r(t);var n=r(900),c=r(377),o=r(376);t.default=Object(n.a)(o.a)(c.a)}}]);woocommerce-blocks/build/atomic-block-components/summary.js000064400000004035151335517640020233 0ustar00(window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[16],{155:function(t,e,c){"use strict";var n=c(0),r=c(119),o=c(91),a=function(t){var e=t.indexOf("</p>");return-1===e?t:t.substr(0,e+4)},u=function(t){return t.replace(/<\/?[a-z][^>]*?>/gi,"")},s=function(t,e){return t.replace(/[\s|\.\,]+$/i,"")+e},i=function(t,e){var c=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"&hellip;",n=u(t),r=n.split(" ").splice(0,e).join(" ");return Object(o.autop)(s(r,c))},l=function(t,e){var c=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"&hellip;",r=u(t),a=r.slice(0,e);if(c)return Object(o.autop)(s(a,n));var i=a.match(/([\s]+)/g),l=i?i.length:0,p=r.slice(0,e+l);return Object(o.autop)(s(p,n))};e.a=function(t){var e=t.source,c=t.maxLength,u=void 0===c?15:c,s=t.countType,p=void 0===s?"words":s,d=t.className,m=void 0===d?"":d,v=Object(n.useMemo)((function(){return function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:15,c=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"words",n=Object(o.autop)(t),u=Object(r.count)(n,c);if(u<=e)return n;var s=a(n),p=Object(r.count)(s,c);return p<=e?s:"words"===c?i(s,e):l(s,e,"characters_including_spaces"===c)}(e,u,p)}),[e,u,p]);return Object(n.createElement)(n.RawHTML,{className:m},v)}},486:function(t,e,c){"use strict";c.r(e);var n=c(5),r=c.n(n),o=c(0),a=(c(2),c(6)),u=c.n(a),s=c(155),i=c(37),l=c(45),p=c(86);c(561),e.default=Object(p.withProductDataContext)((function(t){var e=t.className,c=Object(l.useInnerBlockLayoutContext)().parentClassName,n=Object(l.useProductDataContext)().product;if(!n)return Object(o.createElement)("div",{className:u()(e,"wc-block-components-product-summary",r()({},"".concat(c,"__product-summary"),c))});var a=n.short_description?n.short_description:n.description;return a?Object(o.createElement)(s.a,{className:u()(e,"wc-block-components-product-summary",r()({},"".concat(c,"__product-summary"),c)),source:a,maxLength:150,countType:i.o.wordCountType||"words"}):null}))},561:function(t,e){}}]);woocommerce-blocks/build/atomic-block-components/button.js000064400000003423151335517640020051 0ustar00(window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[9],{484:function(t,o,c){"use strict";c.r(o);var e=c(9),n=c.n(e),a=c(5),d=c.n(a),r=c(0),u=(c(2),c(6)),b=c.n(u),i=c(1),l=c(68),s=c(788),p=c(25),_=c(45),k=c(86),w=(c(560),function(t){var o=t.product,c=o.id,e=o.permalink,a=o.add_to_cart,d=o.has_options,u=o.is_purchasable,_=o.is_in_stock,k=Object(l.a)().dispatchStoreEvent,w=Object(s.a)(c),m=w.cartQuantity,j=w.addingToCart,O=w.addToCart,f=Number.isFinite(m)&&m>0,v=!d&&u&&_,C=Object(p.decodeEntities)((null==a?void 0:a.description)||""),E=f?Object(i.sprintf)(
/* translators: %s number of products in cart. */
Object(i._n)("%d in cart","%d in cart",m,'woocommerce'),m):Object(p.decodeEntities)((null==a?void 0:a.text)||Object(i.__)("Add to cart",'woocommerce')),h=v?"button":"a",g={};return v?g.onClick=function(){O(),k("cart-add-item",{product:o})}:(g.href=e,g.rel="nofollow",g.onClick=function(){k("product-view-link",{product:o})}),Object(r.createElement)(h,n()({"aria-label":C,className:b()("wp-block-button__link","add_to_cart_button","wc-block-components-product-button__button",{loading:j,added:f}),disabled:j},g),E)}),m=function(){return Object(r.createElement)("button",{className:b()("wp-block-button__link","add_to_cart_button","wc-block-components-product-button__button","wc-block-components-product-button__button--placeholder"),disabled:!0})};o.default=Object(k.withProductDataContext)((function(t){var o=t.className,c=Object(_.useInnerBlockLayoutContext)().parentClassName,e=Object(_.useProductDataContext)().product;return Object(r.createElement)("div",{className:b()(o,"wp-block-button","wc-block-components-product-button",d()({},"".concat(c,"__product-add-to-cart"),c))},e.id?Object(r.createElement)(w,{product:e}):Object(r.createElement)(m,null))}))},560:function(t,o){}}]);woocommerce-blocks/build/atomic-block-components/tag-list.js000064400000001500151335517640020254 0ustar00(window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[17],{489:function(t,e,c){"use strict";c.r(e);var n=c(5),a=c.n(n),o=c(0),s=c(1),l=(c(2),c(6)),u=c.n(l),r=c(45),i=c(7),b=c(86);c(564),e.default=Object(b.withProductDataContext)((function(t){var e=t.className,c=Object(r.useInnerBlockLayoutContext)().parentClassName,n=Object(r.useProductDataContext)().product;return Object(i.isEmpty)(n.tags)?null:Object(o.createElement)("div",{className:u()(e,"wc-block-components-product-tag-list",a()({},"".concat(c,"__product-tag-list"),c))},Object(s.__)("Tags:",'woocommerce')," ",Object(o.createElement)("ul",null,Object.values(n.tags).map((function(t){var e=t.name,c=t.link,n=t.slug;return Object(o.createElement)("li",{key:"tag-list-item-".concat(n)},Object(o.createElement)("a",{href:c},e))}))))}))},564:function(t,e){}}]);woocommerce-blocks/build/wc-blocks-middleware.js000064400000007172151335517640016013 0ustar00this.wc=this.wc||{},this.wc.wcBlocksMiddleware=function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=164)}({1:function(e,t){e.exports=function(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e},e.exports.default=e.exports,e.exports.__esModule=!0},13:function(e,t){e.exports=window.wp.apiFetch},14:function(e,t,r){"use strict";r.d(t,"c",(function(){return o})),r.d(t,"a",(function(){return c})),r.d(t,"b",(function(){return u}));var n=r(2),o="wc/store/cart",c={code:"cart_api_error",message:Object(n.__)("Unable to get cart data from the API.",'woocommerce'),data:{status:500}},u="wc-blocks_cart_update_timestamp"},164:function(e,t,r){"use strict";r.r(t);var n=r(1),o=r.n(n),c=r(13),u=r.n(c);function i(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function a(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?i(Object(r),!0).forEach((function(t){o()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):i(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var l="",s=0;try{var f=window.localStorage.getItem("storeApiNonce"),p=f?JSON.parse(f):{};l=(null==p?void 0:p.nonce)||"",s=(null==p?void 0:p.timestamp)||0}catch(e){}var d=function(e,t){e!==l&&(s&&t<s||(l=e,s=t||Date.now()/1e3,window.localStorage.setItem("storeApiNonce",JSON.stringify({nonce:l,timestamp:s}))))},b=function(e){var t=e.headers||{};return e.headers=a(a({},t),{},{"X-WC-Store-API-Nonce":l}),e};u.a.use((function(e,t){var r,n;return function(e){var t=e.url||e.path;return!(!t||!e.method||"GET"===e.method)&&null!==/wc\/store\//.exec(t)}(e)&&(e=b(e),Array.isArray(null===(r=e)||void 0===r||null===(n=r.data)||void 0===n?void 0:n.requests)&&(e.data.requests=e.data.requests.map(b))),t(e,t)})),u.a.setNonce=function(e){var t="function"==typeof(null==e?void 0:e.get)?e.get("X-WC-Store-API-Nonce"):e["X-WC-Store-API-Nonce"],r="function"==typeof(null==e?void 0:e.get)?e.get("X-WC-Store-API-Nonce-Timestamp"):e["X-WC-Store-API-Nonce-Timestamp"];t&&d(t,r)},d(wcBlocksMiddlewareConfig.storeApiNonce,wcBlocksMiddlewareConfig.storeApiNonceTimestamp);var w=r(14);u.a.use((function(e,t){return function(e){var t=e.url||e.path||"",r=e.method||"GET";if(!t||"POST"!==r)return!1;var n,o=/wc\/store\/cart\//,c=null!==o.exec(t),u=null!==/wc\/store\/batch/.exec(t);return!!c||!!u&&((null==e||null===(n=e.data)||void 0===n?void 0:n.requests)||[]).some((function(e){var t=e.path||"";return null!==o.exec(t)}))}(e)&&window.localStorage.setItem(w.b,(Date.now()/1e3).toString()),t(e,t)}))},2:function(e,t){e.exports=window.wp.i18n}});woocommerce-blocks/build/product-new.js000064400000065347151335517640014273 0ustar00this.wc=this.wc||{},this.wc.blocks=this.wc.blocks||{},this.wc.blocks["product-new"]=function(e){function t(t){for(var n,i,l=t[0],u=t[1],a=t[2],b=0,d=[];b<l.length;b++)i=l[b],Object.prototype.hasOwnProperty.call(c,i)&&c[i]&&d.push(c[i][0]),c[i]=0;for(n in u)Object.prototype.hasOwnProperty.call(u,n)&&(e[n]=u[n]);for(s&&s(t);d.length;)d.shift()();return o.push.apply(o,a||[]),r()}function r(){for(var e,t=0;t<o.length;t++){for(var r=o[t],n=!0,l=1;l<r.length;l++){var u=r[l];0!==c[u]&&(n=!1)}n&&(o.splice(t--,1),e=i(i.s=r[0]))}return e}var n={},c={31:0},o=[];function i(t){if(n[t])return n[t].exports;var r=n[t]={i:t,l:!1,exports:{}};return e[t].call(r.exports,r,r.exports,i),r.l=!0,r.exports}i.m=e,i.c=n,i.d=function(e,t,r){i.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},i.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.t=function(e,t){if(1&t&&(e=i(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(i.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)i.d(r,n,function(t){return e[t]}.bind(null,n));return r},i.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(t,"a",t),t},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.p="";var l=window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[],u=l.push.bind(l);l.push=t,l=l.slice();for(var a=0;a<l.length;a++)t(l[a]);var s=u;return o.push([761,0]),r()}({0:function(e,t){e.exports=window.wp.element},1:function(e,t){e.exports=window.wp.i18n},107:function(e,t,r){"use strict";r.d(t,"b",(function(){return c}));var n=r(3),c=["woocommerce/product-best-sellers","woocommerce/product-category","woocommerce/product-new","woocommerce/product-on-sale","woocommerce/product-top-rated"];t.a={columns:{type:"number",default:Object(n.getSetting)("default_columns",3)},rows:{type:"number",default:Object(n.getSetting)("default_rows",3)},alignButtons:{type:"boolean",default:!1},categories:{type:"array",default:[]},catOperator:{type:"string",default:"any"},contentVisibility:{type:"object",default:{title:!0,price:!0,rating:!0,button:!0}},isPreview:{type:"boolean",default:!1}}},11:function(e,t){e.exports=window.React},12:function(e,t){e.exports=window.wp.blockEditor},121:function(e,t){},122:function(e,t){e.exports=window.wp.coreData},139:function(e,t){},14:function(e,t){e.exports=window.wp.data},15:function(e,t){e.exports=window.wp.apiFetch},188:function(e,t,r){"use strict";r.d(t,"a",(function(){return c}));var n=r(0),c=Object(n.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 230 250",style:{width:"100%"}},Object(n.createElement)("title",null,"Grid Block Preview"),Object(n.createElement)("rect",{width:"65.374",height:"65.374",x:".162",y:".779",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"47.266",height:"5.148",x:"9.216",y:"76.153",fill:"#E1E3E6",rx:"2.574"}),Object(n.createElement)("rect",{width:"62.8",height:"15",x:"1.565",y:"101.448",fill:"#E1E3E6",rx:"5"}),Object(n.createElement)("rect",{width:"65.374",height:"65.374",x:".162",y:"136.277",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"47.266",height:"5.148",x:"9.216",y:"211.651",fill:"#E1E3E6",rx:"2.574"}),Object(n.createElement)("rect",{width:"62.8",height:"15",x:"1.565",y:"236.946",fill:"#E1E3E6",rx:"5"}),Object(n.createElement)("rect",{width:"65.374",height:"65.374",x:"82.478",y:".779",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"47.266",height:"5.148",x:"91.532",y:"76.153",fill:"#E1E3E6",rx:"2.574"}),Object(n.createElement)("rect",{width:"62.8",height:"15",x:"83.882",y:"101.448",fill:"#E1E3E6",rx:"5"}),Object(n.createElement)("rect",{width:"65.374",height:"65.374",x:"82.478",y:"136.277",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"47.266",height:"5.148",x:"91.532",y:"211.651",fill:"#E1E3E6",rx:"2.574"}),Object(n.createElement)("rect",{width:"62.8",height:"15",x:"83.882",y:"236.946",fill:"#E1E3E6",rx:"5"}),Object(n.createElement)("rect",{width:"65.374",height:"65.374",x:"164.788",y:".779",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"47.266",height:"5.148",x:"173.843",y:"76.153",fill:"#E1E3E6",rx:"2.574"}),Object(n.createElement)("rect",{width:"62.8",height:"15",x:"166.192",y:"101.448",fill:"#E1E3E6",rx:"5"}),Object(n.createElement)("rect",{width:"65.374",height:"65.374",x:"164.788",y:"136.277",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"47.266",height:"5.148",x:"173.843",y:"211.651",fill:"#E1E3E6",rx:"2.574"}),Object(n.createElement)("rect",{width:"62.8",height:"15",x:"166.192",y:"236.946",fill:"#E1E3E6",rx:"5"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"13.283",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"21.498",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"29.713",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"37.927",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"46.238",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"95.599",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"103.814",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"112.029",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"120.243",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"128.554",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"177.909",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"186.124",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"194.339",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"202.553",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"210.864",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"13.283",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"21.498",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"29.713",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"37.927",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"46.238",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"95.599",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"103.814",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"112.029",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"120.243",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"128.554",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"177.909",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"186.124",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"194.339",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"202.553",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"210.864",y:"221.798",fill:"#E1E3E6",rx:"3"}))},21:function(e,t){e.exports=window.wp.compose},22:function(e,t){e.exports=window.regeneratorRuntime},23:function(e,t){e.exports=window.wp.url},25:function(e,t){e.exports=window.wp.htmlEntities},26:function(e,t){e.exports=window.wp.blocks},28:function(e,t){e.exports=window.wp.primitives},3:function(e,t){e.exports=window.wc.wcSettings},31:function(e,t){e.exports=window.moment},36:function(e,t){e.exports=window.wp.dataControls},37:function(e,t,r){"use strict";r.d(t,"o",(function(){return o})),r.d(t,"m",(function(){return i})),r.d(t,"l",(function(){return l})),r.d(t,"n",(function(){return u})),r.d(t,"j",(function(){return a})),r.d(t,"e",(function(){return s})),r.d(t,"f",(function(){return b})),r.d(t,"g",(function(){return d})),r.d(t,"k",(function(){return p})),r.d(t,"c",(function(){return g})),r.d(t,"d",(function(){return f})),r.d(t,"h",(function(){return h})),r.d(t,"a",(function(){return w})),r.d(t,"i",(function(){return O})),r.d(t,"b",(function(){return E}));var n,c=r(3),o=Object(c.getSetting)("wcBlocksConfig",{buildPhase:1,pluginUrl:"",productCount:0,defaultAvatar:"",restApiRoutes:{},wordCountType:"words"}),i=o.pluginUrl+"images/",l=o.pluginUrl+"build/",u=o.buildPhase,a=null===(n=c.STORE_PAGES.shop)||void 0===n?void 0:n.permalink,s=c.STORE_PAGES.checkout.id,b=c.STORE_PAGES.checkout.permalink,d=c.STORE_PAGES.privacy.permalink,p=(c.STORE_PAGES.privacy.title,c.STORE_PAGES.terms.permalink),g=(c.STORE_PAGES.terms.title,c.STORE_PAGES.cart.id),f=c.STORE_PAGES.cart.permalink,h=(c.STORE_PAGES.myaccount.permalink?c.STORE_PAGES.myaccount.permalink:Object(c.getSetting)("wpLoginUrl","/wp-login.php"),Object(c.getSetting)("shippingCountries",{})),w=Object(c.getSetting)("allowedCountries",{}),O=Object(c.getSetting)("shippingStates",{}),E=Object(c.getSetting)("allowedStates",{})},39:function(e,t,r){"use strict";r.d(t,"h",(function(){return p})),r.d(t,"e",(function(){return g})),r.d(t,"b",(function(){return f})),r.d(t,"i",(function(){return h})),r.d(t,"f",(function(){return w})),r.d(t,"c",(function(){return O})),r.d(t,"d",(function(){return E})),r.d(t,"g",(function(){return m})),r.d(t,"a",(function(){return j}));var n=r(5),c=r.n(n),o=r(23),i=r(15),l=r.n(i),u=r(7),a=r(3),s=r(37);function b(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function d(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?b(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):b(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var p=function(e){var t=e.selected,r=void 0===t?[]:t,n=e.search,c=void 0===n?"":n,i=e.queryArgs,a=function(e){var t=e.selected,r=void 0===t?[]:t,n=e.search,c=void 0===n?"":n,i=e.queryArgs,l=void 0===i?{}:i,u=s.o.productCount>100,a={per_page:u?100:0,catalog_visibility:"any",search:c,orderby:"title",order:"asc"},b=[Object(o.addQueryArgs)("/wc/store/products",d(d({},a),l))];return u&&r.length&&b.push(Object(o.addQueryArgs)("/wc/store/products",{catalog_visibility:"any",include:r,per_page:0})),b}({selected:r,search:c,queryArgs:void 0===i?{}:i});return Promise.all(a.map((function(e){return l()({path:e})}))).then((function(e){return Object(u.uniqBy)(Object(u.flatten)(e),"id").map((function(e){return d(d({},e),{},{parent:0})}))})).catch((function(e){throw e}))},g=function(e){return l()({path:"/wc/store/products/".concat(e)})},f=function(){return l()({path:"wc/store/products/attributes"})},h=function(e){return l()({path:"wc/store/products/attributes/".concat(e,"/terms")})},w=function(e){var t=e.selected,r=function(e){var t=e.selected,r=void 0===t?[]:t,n=e.search,c=Object(a.getSetting)("limitTags",!1),i=[Object(o.addQueryArgs)("wc/store/products/tags",{per_page:c?100:0,orderby:c?"count":"name",order:c?"desc":"asc",search:n})];return c&&r.length&&i.push(Object(o.addQueryArgs)("wc/store/products/tags",{include:r})),i}({selected:void 0===t?[]:t,search:e.search});return Promise.all(r.map((function(e){return l()({path:e})}))).then((function(e){return Object(u.uniqBy)(Object(u.flatten)(e),"id")}))},O=function(e){return l()({path:Object(o.addQueryArgs)("wc/store/products/categories",d({per_page:0},e))})},E=function(e){return l()({path:"wc/store/products/categories/".concat(e)})},m=function(e){return l()({path:Object(o.addQueryArgs)("wc/store/products",{per_page:0,type:"variation",parent:e})})},j=function(e,t){if(!e.title.raw)return e.slug;var r=1===t.filter((function(t){return t.title.raw===e.title.raw})).length;return e.title.raw+(r?"":" - ".concat(e.slug))}},4:function(e,t){e.exports=window.wp.components},42:function(e,t,r){"use strict";r.d(t,"a",(function(){return u})),r.d(t,"b",(function(){return a}));var n=r(29),c=r.n(n),o=r(22),i=r.n(o),l=r(1),u=function(){var e=c()(i.a.mark((function e(t){var r;return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("function"!=typeof t.json){e.next=11;break}return e.prev=1,e.next=4,t.json();case 4:return r=e.sent,e.abrupt("return",{message:r.message,type:r.type||"api"});case 8:return e.prev=8,e.t0=e.catch(1),e.abrupt("return",{message:e.t0.message,type:"general"});case 11:return e.abrupt("return",{message:t.message,type:t.type||"general"});case 12:case"end":return e.stop()}}),e,null,[[1,8]])})));return function(_x){return e.apply(this,arguments)}}(),a=function(e){if(e.data&&"rest_invalid_param"===e.code){var t=Object.values(e.data.params);if(t[0])return t[0]}return(null==e?void 0:e.message)||Object(l.__)("Something went wrong. Please contact us to get assistance.",'woocommerce')}},46:function(e,t){e.exports=window.wp.keycodes},48:function(e,t){e.exports=window.wp.escapeHtml},52:function(e,t,r){"use strict";var n=r(0),c=r(1),o=(r(2),r(48));t.a=function(e){var t,r,i,l=e.error;return Object(n.createElement)("div",{className:"wc-block-error-message"},(r=(t=l).message,i=t.type,r?"general"===i?Object(n.createElement)("span",null,Object(c.__)("The following error was returned",'woocommerce'),Object(n.createElement)("br",null),Object(n.createElement)("code",null,Object(o.escapeHTML)(r))):"api"===i?Object(n.createElement)("span",null,Object(c.__)("The following error was returned from the API",'woocommerce'),Object(n.createElement)("br",null),Object(n.createElement)("code",null,Object(o.escapeHTML)(r))):r:Object(c.__)("An unknown error occurred which prevented the block from being updated.",'woocommerce')))}},55:function(e,t){e.exports=window.wp.hooks},56:function(e,t){e.exports=window.wp.deprecated},66:function(e,t,r){"use strict";var n=r(5),c=r.n(n),o=r(16),i=r.n(o),l=r(0),u=["srcElement","size"];function a(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}t.a=function(e){var t=e.srcElement,r=e.size,n=void 0===r?24:r,o=i()(e,u);return Object(l.isValidElement)(t)?Object(l.cloneElement)(t,function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?a(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):a(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({width:n,height:n},o)):null}},7:function(e,t){e.exports=window.lodash},74:function(e,t){e.exports=window.wp.dom},761:function(e,t,r){e.exports=r(870)},84:function(e,t){e.exports=window.wp.serverSideRender},87:function(e,t){e.exports=window.ReactDOM},870:function(e,t,r){"use strict";r.r(t);var n=r(5),c=r.n(n),o=r(0),i=r(1),l=r(26),u=r(7),a=r(66),s=r(28),b=Object(o.createElement)(s.SVG,{xmlns:"http://www.w3.org/2000/SVG",viewBox:"0 0 24 24"},Object(o.createElement)("path",{fill:"none",d:"M0 0h24v24H0V0z"}),Object(o.createElement)("path",{d:"M23 12l-2.44-2.78.34-3.68-3.61-.82-1.89-3.18L12 3 8.6 1.54 6.71 4.72l-3.61.81.34 3.68L1 12l2.44 2.78-.34 3.69 3.61.82 1.89 3.18L12 21l3.4 1.46 1.89-3.18 3.61-.82-.34-3.68L23 12zm-4.51 2.11l.26 2.79-2.74.62-1.43 2.41L12 18.82l-2.58 1.11-1.43-2.41-2.74-.62.26-2.8L3.66 12l1.85-2.12-.26-2.78 2.74-.61 1.43-2.41L12 5.18l2.58-1.11 1.43 2.41 2.74.62-.26 2.79L20.34 12l-1.85 2.11zM11 15h2v2h-2zm0-8h2v6h-2z"})),d=r(17),p=r.n(d),g=r(18),f=r.n(g),h=r(19),w=r.n(h),O=r(20),E=r.n(O),m=r(10),j=r.n(m),y=r(4),v=r(12),x=r(84),_=r.n(x),k=(r(2),r(92)),P=r(93),S=r(97),C=r(188),R=r(3);var A=function(e){w()(c,e);var t,r,n=(t=c,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,n=j()(t);if(r){var c=j()(this).constructor;e=Reflect.construct(n,arguments,c)}else e=n.apply(this,arguments);return E()(this,e)});function c(){return p()(this,c),n.apply(this,arguments)}return f()(c,[{key:"getInspectorControls",value:function(){var e=this.props,t=e.attributes,r=e.setAttributes,n=t.categories,c=t.catOperator,l=t.columns,u=t.contentVisibility,a=t.rows,s=t.alignButtons;return Object(o.createElement)(v.InspectorControls,{key:"inspector"},Object(o.createElement)(y.PanelBody,{title:Object(i.__)("Layout",'woocommerce'),initialOpen:!0},Object(o.createElement)(P.a,{columns:l,rows:a,alignButtons:s,setAttributes:r,minColumns:Object(R.getSetting)("min_columns",1),maxColumns:Object(R.getSetting)("max_columns",6),minRows:Object(R.getSetting)("min_rows",1),maxRows:Object(R.getSetting)("max_rows",6)})),Object(o.createElement)(y.PanelBody,{title:Object(i.__)("Content",'woocommerce'),initialOpen:!0},Object(o.createElement)(k.a,{settings:u,onChange:function(e){return r({contentVisibility:e})}})),Object(o.createElement)(y.PanelBody,{title:Object(i.__)("Filter by Product Category",'woocommerce'),initialOpen:!1},Object(o.createElement)(S.a,{selected:n,onChange:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=e.map((function(e){return e.id}));r({categories:t})},operator:c,onOperatorChange:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"any";return r({catOperator:e})}})))}},{key:"render",value:function(){var e=this.props,t=e.attributes,r=e.name;return t.isPreview?C.a:Object(o.createElement)(o.Fragment,null,this.getInspectorControls(),Object(o.createElement)(y.Disabled,null,Object(o.createElement)(_.a,{block:r,attributes:t})))}}]),c}(o.Component),T=r(107);function B(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}Object(l.registerBlockType)("woocommerce/product-new",{title:Object(i.__)("Newest Products",'woocommerce'),icon:{src:Object(o.createElement)(a.a,{srcElement:b}),foreground:"#96588a"},category:"woocommerce",keywords:[Object(i.__)("WooCommerce",'woocommerce')],description:Object(i.__)("Display a grid of your newest products.",'woocommerce'),supports:{align:["wide","full"],html:!1},attributes:function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?B(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):B(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({},T.a),example:{attributes:{isPreview:!0}},transforms:{from:[{type:"block",blocks:Object(u.without)(T.b,"woocommerce/product-new"),transform:function(e){return Object(l.createBlock)("woocommerce/product-new",e)}}]},edit:function(e){return Object(o.createElement)(A,e)},save:function(){return null}})},89:function(e,t){e.exports=window.wp.viewport},92:function(e,t,r){"use strict";var n=r(5),c=r.n(n),o=r(0),i=r(1),l=(r(2),r(4));function u(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function a(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?u(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):u(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}t.a=function(e){var t=e.onChange,r=e.settings,n=r.button,c=r.price,u=r.rating,s=r.title;return Object(o.createElement)(o.Fragment,null,Object(o.createElement)(l.ToggleControl,{label:Object(i.__)("Product title",'woocommerce'),help:s?Object(i.__)("Product title is visible.",'woocommerce'):Object(i.__)("Product title is hidden.",'woocommerce'),checked:s,onChange:function(){return t(a(a({},r),{},{title:!s}))}}),Object(o.createElement)(l.ToggleControl,{label:Object(i.__)("Product price",'woocommerce'),help:c?Object(i.__)("Product price is visible.",'woocommerce'):Object(i.__)("Product price is hidden.",'woocommerce'),checked:c,onChange:function(){return t(a(a({},r),{},{price:!c}))}}),Object(o.createElement)(l.ToggleControl,{label:Object(i.__)("Product rating",'woocommerce'),help:u?Object(i.__)("Product rating is visible.",'woocommerce'):Object(i.__)("Product rating is hidden.",'woocommerce'),checked:u,onChange:function(){return t(a(a({},r),{},{rating:!u}))}}),Object(o.createElement)(l.ToggleControl,{label:Object(i.__)("Add to Cart button",'woocommerce'),help:n?Object(i.__)("Add to Cart button is visible.",'woocommerce'):Object(i.__)("Add to Cart button is hidden.",'woocommerce'),checked:n,onChange:function(){return t(a(a({},r),{},{button:!n}))}}))}},93:function(e,t,r){"use strict";var n=r(0),c=r(1),o=r(7),i=(r(2),r(4));t.a=function(e){var t=e.columns,r=e.rows,l=e.setAttributes,u=e.alignButtons,a=e.minColumns,s=void 0===a?1:a,b=e.maxColumns,d=void 0===b?6:b,p=e.minRows,g=void 0===p?1:p,f=e.maxRows,h=void 0===f?6:f;return Object(n.createElement)(n.Fragment,null,Object(n.createElement)(i.RangeControl,{label:Object(c.__)("Columns",'woocommerce'),value:t,onChange:function(e){var t=Object(o.clamp)(e,s,d);l({columns:Number.isNaN(t)?"":t})},min:s,max:d}),Object(n.createElement)(i.RangeControl,{label:Object(c.__)("Rows",'woocommerce'),value:r,onChange:function(e){var t=Object(o.clamp)(e,g,h);l({rows:Number.isNaN(t)?"":t})},min:g,max:h}),Object(n.createElement)(i.ToggleControl,{label:Object(c.__)("Align Last Block",'woocommerce'),help:u?Object(c.__)("The last inner block will be aligned vertically.",'woocommerce'):Object(c.__)("The last inner block will follow other content.",'woocommerce'),checked:u,onChange:function(){return l({alignButtons:!u})}}))}},96:function(e,t){e.exports=window.wp.date},97:function(e,t,r){"use strict";var n=r(9),c=r.n(n),o=r(0),i=r(1),l=(r(2),r(49)),u=r(4),a=r(29),s=r.n(a),b=r(17),d=r.n(b),p=r(18),g=r.n(p),f=r(13),h=r.n(f),w=r(19),O=r.n(w),E=r(20),m=r.n(E),j=r(10),y=r.n(j),v=r(22),x=r.n(v),_=r(21),k=r(39),P=r(42);var S=Object(_.createHigherOrderComponent)((function(e){return function(t){O()(l,t);var r,n,i=(r=l,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=y()(r);if(n){var c=y()(this).constructor;e=Reflect.construct(t,arguments,c)}else e=t.apply(this,arguments);return m()(this,e)});function l(){var e;return d()(this,l),(e=i.apply(this,arguments)).state={error:null,loading:!1,categories:[]},e.loadCategories=e.loadCategories.bind(h()(e)),e}return g()(l,[{key:"componentDidMount",value:function(){this.loadCategories()}},{key:"loadCategories",value:function(){var e=this;this.setState({loading:!0}),Object(k.c)().then((function(t){e.setState({categories:t,loading:!1,error:null})})).catch(function(){var t=s()(x.a.mark((function t(r){var n;return x.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,Object(P.a)(r);case 2:n=t.sent,e.setState({categories:[],loading:!1,error:n});case 4:case"end":return t.stop()}}),t)})));return function(_x){return t.apply(this,arguments)}}())}},{key:"render",value:function(){var t=this.state,r=t.error,n=t.loading,i=t.categories;return Object(o.createElement)(e,c()({},this.props,{error:r,isLoading:n,categories:i}))}}]),l}(o.Component)}),"withCategories"),C=r(52),R=r(6),A=r.n(R),T=(r(139),function(e){var t=e.categories,r=e.error,n=e.isLoading,a=e.onChange,s=e.onOperatorChange,b=e.operator,d=e.selected,p=e.isCompact,g=e.isSingle,f=e.showReviewCount,h={clear:Object(i.__)("Clear all product categories",'woocommerce'),list:Object(i.__)("Product Categories",'woocommerce'),noItems:Object(i.__)("Your store doesn't have any product categories.",'woocommerce'),search:Object(i.__)("Search for product categories",'woocommerce'),selected:function(e){return Object(i.sprintf)(
/* translators: %d is the count of selected categories. */
Object(i._n)("%d category selected","%d categories selected",e,'woocommerce'),e)},updated:Object(i.__)("Category search results updated.",'woocommerce')};return r?Object(o.createElement)(C.a,{error:r}):Object(o.createElement)(o.Fragment,null,Object(o.createElement)(l.b,{className:"woocommerce-product-categories",list:t,isLoading:n,selected:d.map((function(e){return t.find((function(t){return t.id===e}))})).filter(Boolean),onChange:a,renderItem:function(e){var t=e.item,r=e.search,n=e.depth,u=void 0===n?0:n,a=t.breadcrumbs.length?"".concat(t.breadcrumbs.join(", "),", ").concat(t.name):t.name,s=f?Object(i.sprintf)(
/* translators: %1$s is the item name, %2$d is the count of reviews for the item. */
Object(i._n)("%1$s, has %2$d review","%1$s, has %2$d reviews",t.review_count,'woocommerce'),a,t.review_count):Object(i.sprintf)(
/* translators: %1$s is the item name, %2$d is the count of products for the item. */
Object(i._n)("%1$s, has %2$d product","%1$s, has %2$d products",t.count,'woocommerce'),a,t.count),b=f?Object(i.sprintf)(
/* translators: %d is the count of reviews. */
Object(i._n)("%d review","%d reviews",t.review_count,'woocommerce'),t.review_count):Object(i.sprintf)(
/* translators: %d is the count of products. */
Object(i._n)("%d product","%d products",t.count,'woocommerce'),t.count);return Object(o.createElement)(l.c,c()({className:A()("woocommerce-product-categories__item","has-count",{"is-searching":r.length>0,"is-skip-level":0===u&&0!==t.parent})},e,{countLabel:b,"aria-label":s}))},messages:h,isCompact:p,isHierarchical:!0,isSingle:g}),!!s&&Object(o.createElement)("div",{hidden:d.length<2},Object(o.createElement)(u.SelectControl,{className:"woocommerce-product-categories__operator",label:Object(i.__)("Display products matching",'woocommerce'),help:Object(i.__)("Pick at least two categories to use this setting.",'woocommerce'),value:b,onChange:s,options:[{label:Object(i.__)("Any selected categories",'woocommerce'),value:"any"},{label:Object(i.__)("All selected categories",'woocommerce'),value:"all"}]})))});T.defaultProps={operator:"any",isCompact:!1,isSingle:!1},t.a=S(T)}});woocommerce-blocks/build/price-filter.asset.php000064400000000504151335517640015662 0ustar00<?php return array('dependencies' => array('lodash', 'react', 'wc-blocks-data-store', 'wc-price-format', 'wc-settings', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-data', 'wp-element', 'wp-i18n', 'wp-is-shallow-equal', 'wp-polyfill', 'wp-primitives'), 'version' => 'acbe2e85502a9da8060681188a14d32c');woocommerce-blocks/build/all-reviews.asset.php000064400000000460151335517640015530 0ustar00<?php return array('dependencies' => array('lodash', 'react', 'wc-settings', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-element', 'wp-escape-html', 'wp-i18n', 'wp-is-shallow-equal', 'wp-polyfill', 'wp-primitives'), 'version' => '6af4ac591fde077153eac0abb4ca8f78');woocommerce-blocks/build/wc-settings.js000064400000022134151335517640014256 0ustar00this.wc=this.wc||{},this.wc.wcSettings=function(e){var t={};function r(o){if(t[o])return t[o].exports;var n=t[o]={i:o,l:!1,exports:{}};return e[o].call(n.exports,n,n.exports,r),n.l=!0,n.exports}return r.m=e,r.c=t,r.d=function(e,t,o){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(r.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)r.d(o,n,function(t){return e[t]}.bind(null,n));return o},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=163)}({1:function(e,t){e.exports=function(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e},e.exports.default=e.exports,e.exports.__esModule=!0},163:function(e,t,r){"use strict";r.r(t),r.d(t,"ADMIN_URL",(function(){return b})),r.d(t,"COUNTRIES",(function(){return g})),r.d(t,"CURRENCY",(function(){return _})),r.d(t,"CURRENT_USER_IS_ADMIN",(function(){return m})),r.d(t,"HOME_URL",(function(){return y})),r.d(t,"LOCALE",(function(){return w})),r.d(t,"ORDER_STATUSES",(function(){return O})),r.d(t,"PLACEHOLDER_IMG_SRC",(function(){return v})),r.d(t,"SITE_TITLE",(function(){return h})),r.d(t,"STORE_PAGES",(function(){return j})),r.d(t,"WC_ASSET_URL",(function(){return x})),r.d(t,"WC_VERSION",(function(){return S})),r.d(t,"WP_LOGIN_URL",(function(){return P})),r.d(t,"WP_VERSION",(function(){return k})),r.d(t,"defaultAddressFields",(function(){return L})),r.d(t,"getSetting",(function(){return R})),r.d(t,"isWpVersion",(function(){return T})),r.d(t,"isWcVersion",(function(){return C})),r.d(t,"getAdminLink",(function(){return M}));var o=r(1),n=r.n(o),i=r(40);function c(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,o)}return r}function u(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?c(Object(r),!0).forEach((function(t){n()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):c(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}Object(i.addFilter)("woocommerce_admin_analytics_settings","woocommerce-blocks/exclude-draft-status-from-analytics",(function(e){var t=function(e){return"customStatuses"===e.key?u(u({},e),{},{options:e.options.filter((function(e){return"checkout-draft"!==e.value}))}):e},r=e.woocommerce_actionable_order_statuses.options.map(t),o=e.woocommerce_excluded_report_order_statuses.options.map(t);return u(u({},e),{},{woocommerce_actionable_order_statuses:u(u({},e.woocommerce_actionable_order_statuses),{},{options:r}),woocommerce_excluded_report_order_statuses:u(u({},e.woocommerce_excluded_report_order_statuses),{},{options:o})})}));var a=r(6);function s(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,o)}return r}function l(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?s(Object(r),!0).forEach((function(t){n()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):s(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var d={adminUrl:"",countries:[],currency:{code:"USD",precision:2,symbol:"$",symbolPosition:"left",decimalSeparator:".",priceFormat:"%1$s%2$s",thousandSeparator:","},currentUserIsAdmin:!1,homeUrl:"",locale:{siteLocale:"en_US",userLocale:"en_US",weekdaysShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"]},orderStatuses:[],placeholderImgSrc:"",siteTitle:"",storePages:[],wcAssetUrl:"",wcVersion:"",wpLoginUrl:"",wpVersion:""},p="object"===r.n(a)()(window.wcSettings)?window.wcSettings:{},f=l(l({},d),p);f.currency=l(l({},d.currency),f.currency),f.locale=l(l({},d.locale),f.locale);var b=f.adminUrl,g=f.countries,_=f.currency,m=f.currentUserIsAdmin,y=f.homeUrl,w=f.locale,O=f.orderStatuses,v=f.placeholderImgSrc,h=f.siteTitle,j=f.storePages,x=f.wcAssetUrl,S=f.wcVersion,P=f.wpLoginUrl,k=f.wpVersion,E=r(2),L={first_name:{label:Object(E.__)("First name",'woocommerce'),optionalLabel:Object(E.__)("First name (optional)",'woocommerce'),autocomplete:"given-name",autocapitalize:"sentences",required:!0,hidden:!1,index:10},last_name:{label:Object(E.__)("Last name",'woocommerce'),optionalLabel:Object(E.__)("Last name (optional)",'woocommerce'),autocomplete:"family-name",autocapitalize:"sentences",required:!0,hidden:!1,index:20},company:{label:Object(E.__)("Company",'woocommerce'),optionalLabel:Object(E.__)("Company (optional)",'woocommerce'),autocomplete:"organization",autocapitalize:"sentences",required:!1,hidden:!1,index:30},address_1:{label:Object(E.__)("Address",'woocommerce'),optionalLabel:Object(E.__)("Address (optional)",'woocommerce'),autocomplete:"address-line1",autocapitalize:"sentences",required:!0,hidden:!1,index:40},address_2:{label:Object(E.__)("Apartment, suite, etc.",'woocommerce'),optionalLabel:Object(E.__)("Apartment, suite, etc. (optional)",'woocommerce'),autocomplete:"address-line2",autocapitalize:"sentences",required:!1,hidden:!1,index:50},country:{label:Object(E.__)("Country/Region",'woocommerce'),optionalLabel:Object(E.__)("Country/Region (optional)",'woocommerce'),autocomplete:"country",required:!0,hidden:!1,index:60},city:{label:Object(E.__)("City",'woocommerce'),optionalLabel:Object(E.__)("City (optional)",'woocommerce'),autocomplete:"address-level2",autocapitalize:"sentences",required:!0,hidden:!1,index:70},state:{label:Object(E.__)("State/County",'woocommerce'),optionalLabel:Object(E.__)("State/County (optional)",'woocommerce'),autocomplete:"address-level1",autocapitalize:"sentences",required:!0,hidden:!1,index:80},postcode:{label:Object(E.__)("Postal code",'woocommerce'),optionalLabel:Object(E.__)("Postal code (optional)",'woocommerce'),autocomplete:"postal-code",autocapitalize:"characters",required:!0,hidden:!1,index:90}},U=r(41),I=r.n(U),R=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(e,t){return void 0!==e?e:t},o=e in f?f[e]:t;return r(o,t)},A=function(e,t,r){var o=R(e,"").replace(/-[a-zA-Z0-9]*[\-]*/,".0-rc.");return o=o.endsWith(".")?o.substring(0,o.length-1):o,I.a.compare(o,t,r)},T=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"=";return A("wpVersion",e,t)},C=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"=";return A("wcVersion",e,t)},M=function(e){return R("adminUrl")+e}},2:function(e,t){e.exports=window.wp.i18n},40:function(e,t){e.exports=window.wp.hooks},41:function(e,t,r){var o,n;void 0===(n="function"==typeof(o=function(){var e=/^v?(?:\d+)(\.(?:[x*]|\d+)(\.(?:[x*]|\d+)(\.(?:[x*]|\d+))?(?:-[\da-z\-]+(?:\.[\da-z\-]+)*)?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i;function t(e){var t,r=e.replace(/^v/,"").replace(/\+.*$/,""),o=("-",-1===(t=r).indexOf("-")?t.length:t.indexOf("-")),n=r.substring(0,o).split(".");return n.push(r.substring(o+1)),n}function r(e){return isNaN(Number(e))?e:Number(e)}function o(t){if("string"!=typeof t)throw new TypeError("Invalid argument expected string");if(!e.test(t))throw new Error("Invalid argument not valid semver ('"+t+"' received)")}function n(e,n){[e,n].forEach(o);for(var i=t(e),c=t(n),u=0;u<Math.max(i.length-1,c.length-1);u++){var a=parseInt(i[u]||0,10),s=parseInt(c[u]||0,10);if(a>s)return 1;if(s>a)return-1}var l=i[i.length-1],d=c[c.length-1];if(l&&d){var p=l.split(".").map(r),f=d.split(".").map(r);for(u=0;u<Math.max(p.length,f.length);u++){if(void 0===p[u]||"string"==typeof f[u]&&"number"==typeof p[u])return-1;if(void 0===f[u]||"string"==typeof p[u]&&"number"==typeof f[u])return 1;if(p[u]>f[u])return 1;if(f[u]>p[u])return-1}}else if(l||d)return l?-1:1;return 0}var i=[">",">=","=","<","<="],c={">":[1],">=":[0,1],"=":[0],"<=":[-1,0],"<":[-1]};return n.validate=function(t){return"string"==typeof t&&e.test(t)},n.compare=function(e,t,r){!function(e){if("string"!=typeof e)throw new TypeError("Invalid operator type, expected string but got "+typeof e);if(-1===i.indexOf(e))throw new TypeError("Invalid operator, expected one of "+i.join("|"))}(r);var o=n(e,t);return c[r].indexOf(o)>-1},n})?o.apply(t,[]):o)||(e.exports=n)},6:function(e,t){function r(t){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?(e.exports=r=function(e){return typeof e},e.exports.default=e.exports,e.exports.__esModule=!0):(e.exports=r=function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.default=e.exports,e.exports.__esModule=!0),r(t)}e.exports=r,e.exports.default=e.exports,e.exports.__esModule=!0}});woocommerce-blocks/build/wc-blocks-shared-hocs.js000064400000010574151335517640016076 0ustar00this.wc=this.wc||{},this.wc.wcBlocksSharedHocs=function(t){var e={};function r(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)r.d(n,o,function(e){return t[e]}.bind(null,o));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=167)}({0:function(t,e){t.exports=window.wp.element},12:function(t,e,r){var n=r(20),o=r(21),u=r(18),c=r(22);t.exports=function(t,e){return n(t)||o(t,e)||u(t,e)||c()},t.exports.default=t.exports,t.exports.__esModule=!0},13:function(t,e){t.exports=window.wp.apiFetch},15:function(t,e){function r(){return t.exports=r=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},t.exports.default=t.exports,t.exports.__esModule=!0,r.apply(this,arguments)}t.exports=r,t.exports.default=t.exports,t.exports.__esModule=!0},167:function(t,e,r){"use strict";r.r(e),r.d(e,"withProductDataContext",(function(){return b}));var n=r(15),o=r.n(n),u=r(29),c=r.n(u),i=r(12),a=r.n(i),s=r(0),l=r(3),f=r.n(l),p=r(13),d=r.n(p),x=r(35),y=function(t){var e=t.productId,r=t.OriginalComponent,n=Object(s.useState)(null),o=a()(n,2),u=o[0],i=o[1],l=Object(s.useState)(!0),p=a()(l,2),y=p[0],b=p[1];return Object(s.useEffect)((function(){t.product&&(i(t.product),b(!1))}),[t.product]),Object(s.useEffect)((function(){e>0&&(b(!0),d()({path:"/wc/store/products/".concat(e)}).then((function(t){i(t)})).catch(c()(f.a.mark((function t(){return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:i(null);case 1:case"end":return t.stop()}}),t)})))).finally((function(){b(!1)})))}),[e]),y||u?Object(s.createElement)(x.ProductDataContextProvider,{product:u,isLoading:y},Object(s.createElement)(r,t)):null},b=function(t){return function(e){var r=Object(x.useProductDataContext)();return e.product||!r.hasContext?Object(s.createElement)(y,o()({},e,{OriginalComponent:t})):Object(s.createElement)(t,e)}}},18:function(t,e,r){var n=r(19);t.exports=function(t,e){if(t){if("string"==typeof t)return n(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?n(t,e):void 0}},t.exports.default=t.exports,t.exports.__esModule=!0},19:function(t,e){t.exports=function(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n},t.exports.default=t.exports,t.exports.__esModule=!0},20:function(t,e){t.exports=function(t){if(Array.isArray(t))return t},t.exports.default=t.exports,t.exports.__esModule=!0},21:function(t,e){t.exports=function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,u=[],_n=!0,c=!1;try{for(r=r.call(t);!(_n=(n=r.next()).done)&&(u.push(n.value),!e||u.length!==e);_n=!0);}catch(t){c=!0,o=t}finally{try{_n||null==r.return||r.return()}finally{if(c)throw o}}return u}},t.exports.default=t.exports,t.exports.__esModule=!0},22:function(t,e){t.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},t.exports.default=t.exports,t.exports.__esModule=!0},29:function(t,e){function r(t,e,r,n,o,u,c){try{var i=t[u](c),a=i.value}catch(t){return void r(t)}i.done?e(a):Promise.resolve(a).then(n,o)}t.exports=function(t){return function(){var e=this,n=arguments;return new Promise((function(o,u){var c=t.apply(e,n);function i(t){r(c,o,u,i,a,"next",t)}function a(t){r(c,o,u,i,a,"throw",t)}i(void 0)}))}},t.exports.default=t.exports,t.exports.__esModule=!0},3:function(t,e){t.exports=window.regeneratorRuntime},35:function(t,e){t.exports=window.wc.wcBlocksSharedContext}});woocommerce-blocks/build/checkout-blocks/shipping-methods-frontend.js000064400000046637151335517640022204 0ustar00(window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[41],{105:function(e,t,n){"use strict";var c=n(1),a=(n(10),n(6)),r=n.n(a),o=(n(181),n(138));t.a=function(e){var t=e.children,n=e.className,a=e.screenReaderLabel,i=e.showSpinner,s=void 0!==i&&i,l=e.isLoading,p=void 0===l||l;return React.createElement("div",{className:r()(n,{"wc-block-components-loading-mask":p})},p&&s&&React.createElement(o.a,null),React.createElement("div",{className:r()({"wc-block-components-loading-mask__children":p}),"aria-hidden":p},t),p&&React.createElement("span",{className:"screen-reader-text"},a||Object(c.__)("Loading…",'woocommerce')))}},138:function(e,t,n){"use strict";n(180),t.a=function(){return React.createElement("span",{className:"wc-block-components-spinner","aria-hidden":"true"})}},147:function(e,t){},174:function(e,t,n){"use strict";t.a=function(e){var t=e.label,n=e.secondaryLabel,c=e.description,a=e.secondaryDescription,r=e.id;return React.createElement("div",{className:"wc-block-components-radio-control__option-layout"},React.createElement("div",{className:"wc-block-components-radio-control__label-group"},t&&React.createElement("span",{id:r&&"".concat(r,"__label"),className:"wc-block-components-radio-control__label"},t),n&&React.createElement("span",{id:r&&"".concat(r,"__secondary-label"),className:"wc-block-components-radio-control__secondary-label"},n)),React.createElement("div",{className:"wc-block-components-radio-control__description-group"},c&&React.createElement("span",{id:r&&"".concat(r,"__description"),className:"wc-block-components-radio-control__description"},c),a&&React.createElement("span",{id:r&&"".concat(r,"__secondary-description"),className:"wc-block-components-radio-control__secondary-description"},a)))}},175:function(e,t,n){"use strict";var c=n(14),a=n.n(c),r=n(23),o=n.n(r),i=n(6),s=n.n(i),l=(n(10),n(248),["children","className","headingLevel"]);t.a=function(e){var t=e.children,n=e.className,c=e.headingLevel,r=o()(e,l),i=s()("wc-block-components-title",n),p="h".concat(c);return React.createElement(p,a()({className:i},r),t)}},179:function(e,t,n){"use strict";var c=n(4),a=n.n(c),r=n(6),o=n.n(r),i=n(174);t.a=function(e){var t,n=e.checked,c=e.name,r=e.onChange,s=e.option,l=s.value,p=s.label,u=s.description,d=s.secondaryLabel,b=s.secondaryDescription;return React.createElement("label",{className:o()("wc-block-components-radio-control__option",{"wc-block-components-radio-control__option-checked":n}),htmlFor:"".concat(c,"-").concat(l)},React.createElement("input",{id:"".concat(c,"-").concat(l),className:"wc-block-components-radio-control__input",type:"radio",name:c,value:l,onChange:function(e){return r(e.target.value)},checked:n,"aria-describedby":o()((t={},a()(t,"".concat(c,"-").concat(l,"__label"),p),a()(t,"".concat(c,"-").concat(l,"__secondary-label"),d),a()(t,"".concat(c,"-").concat(l,"__description"),u),a()(t,"".concat(c,"-").concat(l,"__secondary-description"),b),t))}),React.createElement(i.a,{id:"".concat(c,"-").concat(l),label:p,secondaryLabel:d,description:u,secondaryDescription:b}))}},180:function(e,t){},181:function(e,t){},207:function(e,t,n){"use strict";var c=n(6),a=n.n(c),r=n(24),o=n(179);n(252),t.a=Object(r.withInstanceId)((function(e){var t=e.className,n=e.instanceId,c=e.id,r=e.selected,i=e.onChange,s=e.options,l=void 0===s?[]:s,p=c||n;return l.length&&React.createElement("div",{className:a()("wc-block-components-radio-control",t)},l.map((function(e){return React.createElement(o.a,{key:"".concat(p,"-").concat(e.value),name:"radio-control-".concat(p),checked:e.value===r,option:e,onChange:function(t){i(t),"function"==typeof e.onChange&&e.onChange(t)}})})))}))},209:function(e,t,n){"use strict";var c=n(23),a=n.n(c),r=n(1),o=n(0),i=n(33),s=n(105),l=n(26),p=n(326),u=n(32),d=n(36),b=n(6),m=n.n(b),g=n(28),f=n(51),h=n(5),O=n.n(h),v=n(25),j=n.n(v),w=n(118),_=n(52),R=function(e){var t;return null===(t=e.find((function(e){return e.selected})))||void 0===t?void 0:t.rate_id},k=n(207),y=n(174),E=n(58),N=n(69),S=n(2),P=function(e){var t=Object(S.getSetting)("displayCartPricesIncludingTax",!1)?parseInt(e.price,10)+parseInt(e.taxes,10):parseInt(e.price,10);return{label:Object(g.decodeEntities)(e.name),value:e.rate_id,description:React.createElement(React.Fragment,null,Number.isFinite(t)&&React.createElement(N.a,{currency:Object(E.getCurrencyFromPriceResponse)(e),value:t}),Number.isFinite(t)&&e.delivery_time?" — ":null,Object(g.decodeEntities)(e.delivery_time))}},C=function(e){var t=e.className,n=e.noResultsMessage,c=e.onSelectRate,a=e.rates,r=e.renderOption,o=void 0===r?P:r,i=e.selected;if(0===a.length)return n;if(a.length>1)return React.createElement(k.a,{className:t,onChange:function(e){c(e)},selected:i,options:a.map(o)});var s=o(a[0]),l=s.label,p=s.secondaryLabel,u=s.description,d=s.secondaryDescription;return React.createElement(y.a,{label:l,secondaryLabel:p,description:u,secondaryDescription:d})},D=(n(253),function(e){var t=e.packageId,n=e.className,c=e.noResultsMessage,a=e.renderOption,i=e.packageData,s=e.collapsible,p=void 0!==s&&s,u=e.collapse,d=void 0!==u&&u,b=e.showItems,h=void 0!==b&&b,v=function(e,t){var n=Object(_.a)().dispatchCheckoutEvent,c=Object(w.a)(),a=c.selectShippingRate,r=c.isSelectingRate,i=Object(o.useState)((function(){return R(t)})),s=O()(i,2),l=s[0],p=s[1],u=Object(o.useRef)(t);return Object(o.useEffect)((function(){j()(u.current,t)||(u.current=t,p(R(t)))}),[t]),{selectShippingRate:Object(o.useCallback)((function(t){p(t),a(t,e),n("set-selected-shipping-rate",{shippingRateId:t})}),[e,a,n]),selectedShippingRate:l,isSelectingRate:r}}(t,i.shipping_rates),k=v.selectShippingRate,y=v.selectedShippingRate,E=React.createElement(React.Fragment,null,(h||p)&&React.createElement("div",{className:"wc-block-components-shipping-rates-control__package-title"},i.name),h&&React.createElement("ul",{className:"wc-block-components-shipping-rates-control__package-items"},Object.values(i.items).map((function(e){var t=Object(g.decodeEntities)(e.name),n=e.quantity;return React.createElement("li",{key:e.key,className:"wc-block-components-shipping-rates-control__package-item"},React.createElement(f.a,{label:n>1?"".concat(t," × ").concat(n):"".concat(t),screenReaderLabel:Object(r.sprintf)(
/* translators: %1$s name of the product (ie: Sunglasses), %2$d number of units in the current cart package */
Object(r._n)("%1$s (%2$d unit)","%1$s (%2$d units)",n,'woocommerce'),t,n)}))})))),N=React.createElement(C,{className:n,noResultsMessage:c,rates:i.shipping_rates,onSelectRate:k,selected:y,renderOption:a});return p?React.createElement(l.Panel,{className:"wc-block-components-shipping-rates-control__package",initialOpen:!d,title:E},N):React.createElement("div",{className:m()("wc-block-components-shipping-rates-control__package",n)},E,N)}),L=["package_id"],x=["extensions","receiveCart"],F=function(e){var t=e.packages,n=e.collapse,c=e.showItems,r=e.collapsible,o=e.noResultsMessage,i=e.renderOption;return t.length?React.createElement(React.Fragment,null,t.map((function(e){var t=e.package_id,s=a()(e,L);return React.createElement(D,{key:t,packageId:t,packageData:s,collapsible:r,collapse:n,showItems:c,noResultsMessage:o,renderOption:i})}))):null};t.a=function(e){var t=e.shippingRates,n=e.shippingRatesLoading,c=e.className,b=e.collapsible,m=void 0!==b&&b,g=e.noResultsMessage,f=e.renderOption;Object(o.useEffect)((function(){if(!n){var e=Object(p.a)(t),c=Object(p.b)(t);1===e?Object(i.speak)(Object(r.sprintf)(
/* translators: %d number of shipping options found. */
Object(r._n)("%d shipping option was found.","%d shipping options were found.",c,'woocommerce'),c)):Object(i.speak)(Object(r.sprintf)(
/* translators: %d number of shipping packages packages. */
Object(r._n)("Shipping option searched for %d package.","Shipping options searched for %d packages.",e,'woocommerce'),e)+" "+Object(r.sprintf)(
/* translators: %d number of shipping options available. */
Object(r._n)("%d shipping option was found","%d shipping options were found",c,'woocommerce'),c))}}),[n,t]);var h=Object(u.a)(),O=h.extensions,v=(h.receiveCart,{className:c,collapsible:m,noResultsMessage:g,renderOption:f,extensions:O,cart:a()(h,x),components:{ShippingRatesControlPackage:D}}),j=Object(d.a)().isEditor;return React.createElement(s.a,{isLoading:n,screenReaderLabel:Object(r.__)("Loading shipping rates…",'woocommerce'),showSpinner:!0},j?React.createElement(F,{packages:t,noResultsMessage:g,renderOption:f}):React.createElement(React.Fragment,null,React.createElement(l.ExperimentalOrderShippingPackages.Slot,v),React.createElement(l.ExperimentalOrderShippingPackages,null,React.createElement(F,{packages:t,noResultsMessage:g,renderOption:f}))))}},248:function(e,t){},252:function(e,t){},253:function(e,t){},326:function(e,t,n){"use strict";n.d(t,"a",(function(){return c})),n.d(t,"b",(function(){return a}));var c=function(e){return e.length},a=function(e){return e.reduce((function(e,t){return e+t.shipping_rates.length}),0)}},345:function(e,t,n){"use strict";var c=n(14),a=n.n(c),r=n(188);t.a=function(e){return function(t){return function(n){var c=Object(r.a)(e,n);return React.createElement(t,a()({},n,c))}}}},346:function(e,t){},349:function(e,t,n){"use strict";var c=n(1);t.a=function(e){var t=e.defaultTitle,n=void 0===t?Object(c.__)("Step",'woocommerce'):t,a=e.defaultDescription,r=void 0===a?Object(c.__)("Step description text.",'woocommerce'):a,o=e.defaultShowStepNumber;return{title:{type:"string",default:n},description:{type:"string",default:r},showStepNumber:{type:"boolean",default:void 0===o||o}}}},350:function(e,t,n){"use strict";var c=n(6),a=n.n(c),r=(n(10),n(175)),o=(n(346),function(e){var t=e.title,n=e.stepHeadingContent;return React.createElement("div",{className:"wc-block-components-checkout-step__heading"},React.createElement(r.a,{"aria-hidden":"true",className:"wc-block-components-checkout-step__title",headingLevel:"2"},t),!!n&&React.createElement("span",{className:"wc-block-components-checkout-step__heading-content"},n))});t.a=function(e){var t=e.id,n=e.className,c=e.title,r=e.legend,i=e.description,s=e.children,l=e.disabled,p=void 0!==l&&l,u=e.showStepNumber,d=void 0===u||u,b=e.stepHeadingContent,m=void 0===b?function(){}:b,g=r||c?"fieldset":"div";return React.createElement(g,{className:a()(n,"wc-block-components-checkout-step",{"wc-block-components-checkout-step--with-step-number":d,"wc-block-components-checkout-step--disabled":p}),id:t,disabled:p},!(!r&&!c)&&React.createElement("legend",{className:"screen-reader-text"},r||c),!!c&&React.createElement(o,{title:c,stepHeadingContent:m()}),React.createElement("div",{className:"wc-block-components-checkout-step__container"},!!i&&React.createElement("p",{className:"wc-block-components-checkout-step__description"},i),React.createElement("div",{className:"wc-block-components-checkout-step__content"},s)))}},352:function(e,t,n){"use strict";n.d(t,"a",(function(){return b}));var c=n(4),a=n.n(c),r=n(23),o=n.n(r),i=n(2),s=n(0),l=n(66),p=n(60),u=["email"];function d(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(e);t&&(c=c.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,c)}return n}var b=function(){var e=Object(l.b)().needsShipping,t=Object(p.b)(),n=t.billingData,c=t.setBillingData,r=t.shippingAddress,b=t.setShippingAddress,m=t.shippingAsBilling,g=t.setShippingAsBilling,f=Object(s.useRef)(m),h=Object(s.useRef)(n),O=Object(s.useCallback)((function(e){b(e),m&&c(e)}),[m,b,c]),v=Object(s.useCallback)((function(t){c(t),e||b(t)}),[e,b,c]);Object(s.useEffect)((function(){if(f.current!==m){if(m)h.current=n,c(r);else{var e=h.current,t=(e.email,o()(e,u));c(function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?d(Object(n),!0).forEach((function(t){a()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):d(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({},t))}f.current=m}}),[m,c,r,n]);var j=Object(s.useCallback)((function(e){c({email:e})}),[c]),w=Object(s.useCallback)((function(e){c({phone:e})}),[c]),_=Object(s.useCallback)((function(e){O({phone:e})}),[O]);return{defaultAddressFields:i.defaultAddressFields,shippingFields:r,setShippingFields:O,billingFields:n,setBillingFields:v,setEmail:j,setPhone:w,setShippingPhone:_,shippingAsBilling:m,setShippingAsBilling:g,showShippingFields:e,showBillingFields:!e||!f.current}}},355:function(e,t,n){"use strict";var c=n(12),a=n(22),r=n(19),o=n(0),i=n(6),s=n.n(i),l=n(24),p=n(91);t.a=function(e){var t,n=e.icon,i=e.children,u=e.label,d=e.instructions,b=e.className,m=e.notices,g=e.preview,f=e.isColumnLayout,h=Object(r.a)(e,["icon","children","label","instructions","className","notices","preview","isColumnLayout"]),O=Object(l.useResizeObserver)(),v=Object(a.a)(O,2),j=v[0],w=v[1].width;"number"==typeof w&&(t={"is-large":w>=320,"is-medium":w>=160&&w<320,"is-small":w<160});var _=s()("components-placeholder",b,t),R=s()("components-placeholder__fieldset",{"is-column-layout":f});return Object(o.createElement)("div",Object(c.a)({},h,{className:_}),j,m,g&&Object(o.createElement)("div",{className:"components-placeholder__preview"},g),Object(o.createElement)("div",{className:"components-placeholder__label"},Object(o.createElement)(p.a,{icon:n}),u),!!d&&Object(o.createElement)("div",{className:"components-placeholder__instructions"},d),Object(o.createElement)("div",{className:R},i))}},373:function(e,t){},374:function(e,t){},407:function(e,t,n){"use strict";n.r(t);var c=n(345),a=n(350),r=n(48),o=n(352),i=n(1),s=n(209),l=n(326),p=n(58),u=n(69),d=n(36),b=n(66),m=n(28),g=n(153),f=n(6),h=n.n(f),O=n(2),v=n(355),j=n(76),w=n(152),_=n(34),R=React.createElement(_.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 17 13"},React.createElement("path",{fill:"currentColor",fillRule:"evenodd",d:"M11.667 2.5h1.666l3.334 3.333V10H15a2.5 2.5 0 11-5 0H6.667a2.5 2.5 0 11-5 0H0V1.667C0 .746.746 0 1.667 0H10c.92 0 1.667.746 1.667 1.667V2.5zM2.917 10a1.25 1.25 0 102.5 0 1.25 1.25 0 00-2.5 0zm-1.25-2.5V1.667H10V7.5H1.667zM11.25 10a1.25 1.25 0 102.5 0 1.25 1.25 0 00-2.5 0z"})),k=(n(374),function(){return React.createElement(v.a,{icon:React.createElement(w.a,{srcElement:R}),label:Object(i.__)("Shipping options",'woocommerce'),className:"wc-block-checkout__no-shipping-placeholder"},React.createElement("span",{className:"wc-block-checkout__no-shipping-placeholder-description"},Object(i.__)("Your store does not have any Shipping Options configured. Once you have added your Shipping Options they will appear here.",'woocommerce')),React.createElement(j.a,{isSecondary:!0,href:"".concat(O.ADMIN_URL,"admin.php?page=wc-settings&tab=shipping"),target:"_blank",rel:"noopener noreferrer"},Object(i.__)("Configure Shipping Options",'woocommerce')))}),y=(n(373),function(e){var t=Object(O.getSetting)("displayCartPricesIncludingTax",!1)?parseInt(e.price,10)+parseInt(e.taxes,10):parseInt(e.price,10);return{label:Object(m.decodeEntities)(e.name),value:e.rate_id,description:Object(m.decodeEntities)(e.description),secondaryLabel:React.createElement(u.a,{currency:Object(p.getCurrencyFromPriceResponse)(e),value:t}),secondaryDescription:Object(m.decodeEntities)(e.delivery_time)}}),E=function(){var e=Object(d.a)().isEditor,t=Object(b.b)(),n=t.shippingRates,c=t.shippingRatesLoading,a=t.needsShipping,r=t.hasCalculatedShipping;if(!a)return null;var o=Object(l.a)(n);return e||r||o?React.createElement(React.Fragment,null,e&&!o?React.createElement(k,null):React.createElement(s.a,{noResultsMessage:React.createElement(g.a,{isDismissible:!1,className:h()("wc-block-components-shipping-rates-control__no-results-notice","woocommerce-error")},Object(i.__)("There are no shipping options available. Please check your shipping address.",'woocommerce')),renderOption:y,shippingRates:n,shippingRatesLoading:c})):React.createElement("p",null,Object(i.__)("Shipping options will be displayed here after entering your full shipping address.",'woocommerce'))},N=n(4),S=n.n(N),P=n(349);function C(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(e);t&&(c=c.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,c)}return n}function D(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?C(Object(n),!0).forEach((function(t){S()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):C(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var L=D(D({},Object(P.a)({defaultTitle:Object(i.__)("Shipping options",'woocommerce'),defaultDescription:""})),{},{allowCreateAccount:{type:"boolean",default:!1},lock:{type:"object",default:{move:!0,remove:!0}}});t.default=Object(c.a)(L)((function(e){var t=e.title,n=e.description,c=e.showStepNumber,i=e.children,s=Object(r.b)().isProcessing;return Object(o.a)().showShippingFields?React.createElement(a.a,{id:"shipping-option",disabled:s,className:"wc-block-checkout__shipping-option",title:t,description:n,showStepNumber:c},React.createElement(E,null),i):null}))},51:function(e,t,n){"use strict";var c=n(4),a=n.n(c),r=n(0),o=n(6),i=n.n(o);function s(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(e);t&&(c=c.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,c)}return n}function l(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?s(Object(n),!0).forEach((function(t){a()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):s(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}t.a=function(e){var t,n=e.label,c=e.screenReaderLabel,a=e.wrapperElement,o=e.wrapperProps,s=void 0===o?{}:o,p=null!=n,u=null!=c;return!p&&u?(t=a||"span",s=l(l({},s),{},{className:i()(s.className,"screen-reader-text")}),React.createElement(t,s,c)):(t=a||r.Fragment,p&&u&&n!==c?React.createElement(t,s,React.createElement("span",{"aria-hidden":"true"},n),React.createElement("span",{className:"screen-reader-text"},c)):React.createElement(t,s,n))}},69:function(e,t,n){"use strict";var c=n(14),a=n.n(c),r=n(4),o=n.n(r),i=n(23),s=n.n(i),l=n(126),p=n(6),u=n.n(p),d=(n(147),["className","value","currency","onValueChange","displayType"]);function b(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(e);t&&(c=c.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,c)}return n}function m(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?b(Object(n),!0).forEach((function(t){o()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):b(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}t.a=function(e){var t=e.className,n=e.value,c=e.currency,r=e.onValueChange,o=e.displayType,i=void 0===o?"text":o,p=s()(e,d),b="string"==typeof n?parseInt(n,10):n;if(!Number.isFinite(b))return null;var g=b/Math.pow(10,c.minorUnit);if(!Number.isFinite(g))return null;var f=u()("wc-block-formatted-money-amount","wc-block-components-formatted-money-amount",t),h=m(m(m({},p),function(e){return{thousandSeparator:e.thousandSeparator,decimalSeparator:e.decimalSeparator,decimalScale:e.minorUnit,fixedDecimalScale:!0,prefix:e.prefix,suffix:e.suffix,isNumericString:!0}}(c)),{},{value:void 0,currency:void 0,onValueChange:void 0}),O=r?function(e){var t=e.value*Math.pow(10,c.minorUnit);r(t)}:function(){};return React.createElement(l.a,a()({className:f,displayType:i},h,{value:g,onValueChange:O}))}}}]);woocommerce-blocks/build/checkout-blocks/terms-frontend.js000064400000007720151335517640020042 0ustar00(window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[42],{187:function(e,t,n){"use strict";n.d(t,"b",(function(){return r})),n.d(t,"a",(function(){return s}));var c=n(53),o=n(173),a=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=Object(o.b)(),n=t.paymentMethods,a=t.expressPaymentMethods,r=t.paymentMethodsInitialized,s=t.expressPaymentMethodsInitialized,i=Object(c.a)(n),u=Object(c.a)(a);return{paymentMethods:e?u:i,isInitialized:e?s:r}},r=function(){return a(!1)},s=function(){return a(!0)}},347:function(e,t,n){"use strict";var c=n(14),o=n.n(c),a=n(23),r=n.n(a),s=n(24),i=n(6),u=n.n(i),l=(n(348),["className","label","id","instanceId","onChange","children","hasError"]);t.a=Object(s.withInstanceId)((function(e){var t=e.className,n=e.label,c=e.id,a=e.instanceId,s=e.onChange,i=e.children,d=e.hasError,b=void 0!==d&&d,m=r()(e,l),h=c||"checkbox-control-".concat(a);return React.createElement("label",{className:u()("wc-block-components-checkbox",{"has-error":b},t),htmlFor:h},React.createElement("input",o()({id:h,className:"wc-block-components-checkbox__input",type:"checkbox",onChange:function(e){return s(e.target.checked)},"aria-invalid":!0===b},m)),React.createElement("svg",{className:"wc-block-components-checkbox__mark","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 20"},React.createElement("path",{d:"M9 16.2L4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4L9 16.2z"})),n&&React.createElement("span",{className:"wc-block-components-checkbox__label"},n),i)}))},348:function(e,t){},378:function(e,t){},379:function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var c=n(1),o=n(48),a=n(173),r=n(187),s=function(){var e=Object(o.b)(),t=e.onSubmit,n=e.isCalculating,s=e.isBeforeProcessing,i=e.isProcessing,u=e.isAfterProcessing,l=e.isComplete,d=e.hasError,b=Object(r.b)().paymentMethods,m=void 0===b?{}:b,h=Object(a.b)(),g=h.activePaymentMethod,p=h.currentStatus,f=m[g]||{},w=i||u||s,k=l&&!d;return{submitButtonText:(null==f?void 0:f.placeOrderButtonLabel)||Object(c.__)("Place Order",'woocommerce'),onSubmit:t,isCalculating:n,isDisabled:i||p.isDoingExpressPayment,waitingForProcessing:w,waitingForRedirect:k}}},418:function(e,t,n){"use strict";n.r(t);var c=n(4),o=n.n(c),a=n(5),r=n.n(a),s=n(1),i=n(6),u=n.n(i),l=n(0),d=n(347),b=n(379),m=n(24),h=n(83),g=h.j?'<a href="'.concat(h.j,'">').concat(Object(s.__)("Terms and Conditions","woo-gutenberg-product-blocks"),"</a>"):Object(s.__)("Terms and Conditions","woo-gutenberg-product-blocks"),p=h.f?'<a href="'.concat(h.f,'">').concat(Object(s.__)("Privacy Policy","woo-gutenberg-product-blocks"),"</a>"):Object(s.__)("Privacy Policy","woo-gutenberg-product-blocks"),f=Object(s.sprintf)(
/* translators: %1$s terms page link, %2$s privacy page link. */
Object(s.__)("By proceeding with your purchase you agree to our %1$s and %2$s","woo-gutenberg-product-blocks"),g,p),w=Object(s.sprintf)(
/* translators: %1$s terms page link, %2$s privacy page link. */
Object(s.__)("You must accept our %1$s and %2$s to continue with your purchase.","woo-gutenberg-product-blocks"),g,p);n(378),t.default=Object(m.withInstanceId)((function(e){var t=e.text,n=e.checkbox,c=e.instanceId,a=e.validation,i=Object(l.useState)(!1),m=r()(i,2),h=m[0],g=m[1],p=Object(b.a)().isDisabled,k="terms-and-conditions-"+c,_=a.getValidationError,j=a.setValidationErrors,O=a.clearValidationError,v=_(k)||{},y=v.message&&!v.hidden;return Object(l.useEffect)((function(){if(n)return h?O(k):j(o()({},k,{message:Object(s.__)("Please read and accept the terms and conditions.",'woocommerce'),hidden:!0})),function(){O(k)}}),[n,h,k,O,j]),React.createElement("div",{className:u()("wc-block-checkout__terms",{"wc-block-checkout__terms--disabled":p})},n?React.createElement(React.Fragment,null,React.createElement(d.a,{id:"terms-and-conditions",checked:h,onChange:function(){return g((function(e){return!e}))},hasError:y,disabled:p},React.createElement("span",{dangerouslySetInnerHTML:{__html:t||w}}))):React.createElement("span",{dangerouslySetInnerHTML:{__html:t||f}}))}))}}]);woocommerce-blocks/build/checkout-blocks/fields-frontend.js000064400000001047151335517640020152 0ustar00(window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[36],{330:function(c,e,n){"use strict";var a=n(6),t=n.n(a);n(10),e.a=function(c){var e=c.children,n=c.className;return React.createElement("div",{className:t()("wc-block-components-main",n)},e)}},371:function(c,e){},395:function(c,e,n){"use strict";n.r(e);var a=n(330);n(371),e.default=function(c){var e=c.children;return React.createElement(a.a,{className:"wc-block-checkout__main"},React.createElement("form",{className:"wc-block-components-form wc-block-checkout__form"},e))}}}]);woocommerce-blocks/build/checkout-blocks/order-summary-frontend.js000064400000137710151335517640021521 0ustar00(window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[38,4],{105:function(e,t,n){"use strict";var a=n(1),c=(n(10),n(6)),r=n.n(c),o=(n(181),n(138));t.a=function(e){var t=e.children,n=e.className,c=e.screenReaderLabel,i=e.showSpinner,s=void 0!==i&&i,l=e.isLoading,u=void 0===l||l;return React.createElement("div",{className:r()(n,{"wc-block-components-loading-mask":u})},u&&s&&React.createElement(o.a,null),React.createElement("div",{className:r()({"wc-block-components-loading-mask__children":u}),"aria-hidden":u},t),u&&React.createElement("span",{className:"screen-reader-text"},c||Object(a.__)("Loading…",'woocommerce')))}},106:function(e,t,n){"use strict";var a=n(6),c=n.n(a);n(184),t.a=function(e){var t=e.children,n=e.className;return React.createElement("div",{className:c()("wc-block-components-product-badge",n)},t)}},138:function(e,t,n){"use strict";n(180),t.a=function(){return React.createElement("span",{className:"wc-block-components-spinner","aria-hidden":"true"})}},140:function(e,t,n){"use strict";var a=n(4),c=n.n(a),r=n(1),o=n(69),i=n(6),s=n.n(i),l=(n(10),n(58)),u=n(0),p=(n(183),function(e){var t=e.currency,n=e.maxPrice,a=e.minPrice,c=e.priceClassName,i=e.priceStyle;return React.createElement(React.Fragment,null,React.createElement("span",{className:"screen-reader-text"},Object(r.sprintf)(
/* translators: %1$s min price, %2$s max price */
Object(r.__)("Price between %1$s and %2$s",'woocommerce'),Object(l.formatPrice)(a),Object(l.formatPrice)(n))),React.createElement("span",{"aria-hidden":!0},React.createElement(o.a,{className:s()("wc-block-components-product-price__value",c),currency:t,value:a,style:i})," — ",React.createElement(o.a,{className:s()("wc-block-components-product-price__value",c),currency:t,value:n,style:i})))}),d=function(e){var t=e.currency,n=e.regularPriceClassName,a=e.regularPriceStyle,c=e.regularPrice,i=e.priceClassName,l=e.priceStyle,u=e.price;return React.createElement(React.Fragment,null,React.createElement("span",{className:"screen-reader-text"},Object(r.__)("Previous price:",'woocommerce')),React.createElement(o.a,{currency:t,renderText:function(e){return React.createElement("del",{className:s()("wc-block-components-product-price__regular",n),style:a},e)},value:c}),React.createElement("span",{className:"screen-reader-text"},Object(r.__)("Discounted price:",'woocommerce')),React.createElement(o.a,{currency:t,renderText:function(e){return React.createElement("ins",{className:s()("wc-block-components-product-price__value","is-discounted",i),style:l},e)},value:u}))};t.a=function(e){var t=e.align,n=e.className,a=e.currency,r=e.format,i=void 0===r?"<price/>":r,l=e.maxPrice,m=void 0===l?null:l,b=e.minPrice,g=void 0===b?null:b,f=e.price,v=void 0===f?null:f,h=e.priceClassName,O=e.priceStyle,R=e.regularPrice,_=e.regularPriceClassName,E=e.regularPriceStyle,y=s()(n,"price","wc-block-components-product-price",c()({},"wc-block-components-product-price--align-".concat(t),t));i.includes("<price/>")||(i="<price/>",console.error("Price formats need to include the `<price/>` tag."));var j=R&&v!==R,k=React.createElement("span",{className:s()("wc-block-components-product-price__value",h)});return j?k=React.createElement(d,{currency:a,price:v,priceClassName:h,priceStyle:O,regularPrice:R,regularPriceClassName:_,regularPriceStyle:E}):null!==g&&null!==m?k=React.createElement(p,{currency:a,maxPrice:m,minPrice:g,priceClassName:h,priceStyle:O}):null!==v&&(k=React.createElement(o.a,{className:s()("wc-block-components-product-price__value",h),currency:a,value:v,style:O})),React.createElement("span",{className:y},Object(u.createInterpolateElement)(i,{price:k}))}},143:function(e,t,n){"use strict";var a=n(14),c=n.n(a),r=n(23),o=n.n(r),i=n(76),s=n(6),l=n.n(s),u=n(138),p=(n(251),["className","showSpinner","children"]);t.a=function(e){var t=e.className,n=e.showSpinner,a=void 0!==n&&n,r=e.children,s=o()(e,p),d=l()("wc-block-components-button",t,{"wc-block-components-button--loading":a});return React.createElement(i.a,c()({className:d},s),a&&React.createElement(u.a,null),React.createElement("span",{className:"wc-block-components-button__text"},r))}},147:function(e,t){},149:function(e,t){},150:function(e,t,n){"use strict";var a=n(14),c=n.n(a),r=n(23),o=n.n(r),i=n(28),s=n(6),l=n.n(s),u=(n(182),["className","disabled","name","permalink"]);t.a=function(e){var t=e.className,n=void 0===t?"":t,a=e.disabled,r=void 0!==a&&a,s=e.name,p=e.permalink,d=void 0===p?"":p,m=o()(e,u),b=l()("wc-block-components-product-name",n);return r?React.createElement("span",c()({className:b},m,{dangerouslySetInnerHTML:{__html:Object(i.decodeEntities)(s)}})):React.createElement("a",c()({className:b,href:d},m,{dangerouslySetInnerHTML:{__html:Object(i.decodeEntities)(s)}}))}},151:function(e,t,n){"use strict";var a=n(0),c=n(113),r=n(97),o=function(e){var t=e.indexOf("</p>");return-1===t?e:e.substr(0,t+4)},i=function(e){return e.replace(/<\/?[a-z][^>]*?>/gi,"")},s=function(e,t){return e.replace(/[\s|\.\,]+$/i,"")+t},l=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"&hellip;",a=i(e),c=a.split(" ").splice(0,t).join(" ");return Object(r.autop)(s(c,n))},u=function(e,t){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"&hellip;",c=i(e),o=c.slice(0,t);if(n)return Object(r.autop)(s(o,a));var l=o.match(/([\s]+)/g),u=l?l.length:0,p=c.slice(0,t+u);return Object(r.autop)(s(p,a))};t.a=function(e){var t=e.source,n=e.maxLength,i=void 0===n?15:n,s=e.countType,p=void 0===s?"words":s,d=e.className,m=void 0===d?"":d,b=Object(a.useMemo)((function(){return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:15,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"words",a=Object(r.autop)(e),i=Object(c.count)(a,n);if(i<=t)return a;var s=o(a),p=Object(c.count)(s,n);return p<=t?s:"words"===n?l(s,t):u(s,t,"characters_including_spaces"===n)}(t,i,p)}),[t,i,p]);return React.createElement(a.RawHTML,{className:m},b)}},174:function(e,t,n){"use strict";t.a=function(e){var t=e.label,n=e.secondaryLabel,a=e.description,c=e.secondaryDescription,r=e.id;return React.createElement("div",{className:"wc-block-components-radio-control__option-layout"},React.createElement("div",{className:"wc-block-components-radio-control__label-group"},t&&React.createElement("span",{id:r&&"".concat(r,"__label"),className:"wc-block-components-radio-control__label"},t),n&&React.createElement("span",{id:r&&"".concat(r,"__secondary-label"),className:"wc-block-components-radio-control__secondary-label"},n)),React.createElement("div",{className:"wc-block-components-radio-control__description-group"},a&&React.createElement("span",{id:r&&"".concat(r,"__description"),className:"wc-block-components-radio-control__description"},a),c&&React.createElement("span",{id:r&&"".concat(r,"__secondary-description"),className:"wc-block-components-radio-control__secondary-description"},c)))}},179:function(e,t,n){"use strict";var a=n(4),c=n.n(a),r=n(6),o=n.n(r),i=n(174);t.a=function(e){var t,n=e.checked,a=e.name,r=e.onChange,s=e.option,l=s.value,u=s.label,p=s.description,d=s.secondaryLabel,m=s.secondaryDescription;return React.createElement("label",{className:o()("wc-block-components-radio-control__option",{"wc-block-components-radio-control__option-checked":n}),htmlFor:"".concat(a,"-").concat(l)},React.createElement("input",{id:"".concat(a,"-").concat(l),className:"wc-block-components-radio-control__input",type:"radio",name:a,value:l,onChange:function(e){return r(e.target.value)},checked:n,"aria-describedby":o()((t={},c()(t,"".concat(a,"-").concat(l,"__label"),u),c()(t,"".concat(a,"-").concat(l,"__secondary-label"),d),c()(t,"".concat(a,"-").concat(l,"__description"),p),c()(t,"".concat(a,"-").concat(l,"__secondary-description"),m),t))}),React.createElement(i.a,{id:"".concat(a,"-").concat(l),label:u,secondaryLabel:d,description:p,secondaryDescription:m}))}},180:function(e,t){},181:function(e,t){},182:function(e,t){},183:function(e,t){},184:function(e,t){},185:function(e,t){},186:function(e,t){},194:function(e,t,n){"use strict";var a=n(14),c=n.n(a),r=n(23),o=n.n(r),i=(n(10),n(6)),s=n.n(i),l=n(1),u=n(152),p=n(216),d=(n(149),["text","screenReaderText","element","className","radius","children"]),m=function(e){var t=e.text,n=e.screenReaderText,a=void 0===n?"":n,r=e.element,i=void 0===r?"li":r,l=e.className,u=void 0===l?"":l,p=e.radius,m=void 0===p?"small":p,b=e.children,g=void 0===b?null:b,f=o()(e,d),v=i,h=s()(u,"wc-block-components-chip","wc-block-components-chip--radius-"+m),O=Boolean(a&&a!==t);return React.createElement(v,c()({className:h},f),React.createElement("span",{"aria-hidden":O,className:"wc-block-components-chip__text"},t),O&&React.createElement("span",{className:"screen-reader-text"},a),g)},b=["ariaLabel","className","disabled","onRemove","removeOnAnyClick","text","screenReaderText"];t.a=function(e){var t=e.ariaLabel,n=void 0===t?"":t,a=e.className,r=void 0===a?"":a,i=e.disabled,d=void 0!==i&&i,g=e.onRemove,f=void 0===g?function(){}:g,v=e.removeOnAnyClick,h=void 0!==v&&v,O=e.text,R=e.screenReaderText,_=void 0===R?"":R,E=o()(e,b),y=h?"span":"button";if(!n){var j=_&&"string"==typeof _?_:O;n="string"!=typeof j?
/* translators: Remove chip. */
Object(l.__)("Remove",'woocommerce'):Object(l.sprintf)(
/* translators: %s text of the chip to remove. */
Object(l.__)('Remove "%s"','woocommerce'),j)}var k={"aria-label":n,disabled:d,onClick:f,onKeyDown:function(e){"Backspace"!==e.key&&"Delete"!==e.key||f()}},w=h?k:{},C=h?{"aria-hidden":!0}:k;return React.createElement(m,c()({},E,w,{className:s()(r,"is-removable"),element:h?"button":E.element,screenReaderText:_,text:O}),React.createElement(y,c()({className:"wc-block-components-chip__remove"},C),React.createElement(u.a,{className:"wc-block-components-chip__remove-icon",srcElement:p.a,size:16})))}},206:function(e,t){},207:function(e,t,n){"use strict";var a=n(6),c=n.n(a),r=n(24),o=n(179);n(252),t.a=Object(r.withInstanceId)((function(e){var t=e.className,n=e.instanceId,a=e.id,r=e.selected,i=e.onChange,s=e.options,l=void 0===s?[]:s,u=a||n;return l.length&&React.createElement("div",{className:c()("wc-block-components-radio-control",t)},l.map((function(e){return React.createElement(o.a,{key:"".concat(u,"-").concat(e.value),name:"radio-control-".concat(u),checked:e.value===r,option:e,onChange:function(t){i(t),"function"==typeof e.onChange&&e.onChange(t)}})})))}))},208:function(e,t){},209:function(e,t,n){"use strict";var a=n(23),c=n.n(a),r=n(1),o=n(0),i=n(33),s=n(105),l=n(26),u=n(326),p=n(32),d=n(36),m=n(6),b=n.n(m),g=n(28),f=n(51),v=n(5),h=n.n(v),O=n(25),R=n.n(O),_=n(118),E=n(52),y=function(e){var t;return null===(t=e.find((function(e){return e.selected})))||void 0===t?void 0:t.rate_id},j=n(207),k=n(174),w=n(58),C=n(69),N=n(2),S=function(e){var t=Object(N.getSetting)("displayCartPricesIncludingTax",!1)?parseInt(e.price,10)+parseInt(e.taxes,10):parseInt(e.price,10);return{label:Object(g.decodeEntities)(e.name),value:e.rate_id,description:React.createElement(React.Fragment,null,Number.isFinite(t)&&React.createElement(C.a,{currency:Object(w.getCurrencyFromPriceResponse)(e),value:t}),Number.isFinite(t)&&e.delivery_time?" — ":null,Object(g.decodeEntities)(e.delivery_time))}},x=function(e){var t=e.className,n=e.noResultsMessage,a=e.onSelectRate,c=e.rates,r=e.renderOption,o=void 0===r?S:r,i=e.selected;if(0===c.length)return n;if(c.length>1)return React.createElement(j.a,{className:t,onChange:function(e){a(e)},selected:i,options:c.map(o)});var s=o(c[0]),l=s.label,u=s.secondaryLabel,p=s.description,d=s.secondaryDescription;return React.createElement(k.a,{label:l,secondaryLabel:u,description:p,secondaryDescription:d})},P=(n(253),function(e){var t=e.packageId,n=e.className,a=e.noResultsMessage,c=e.renderOption,i=e.packageData,s=e.collapsible,u=void 0!==s&&s,p=e.collapse,d=void 0!==p&&p,m=e.showItems,v=void 0!==m&&m,O=function(e,t){var n=Object(E.a)().dispatchCheckoutEvent,a=Object(_.a)(),c=a.selectShippingRate,r=a.isSelectingRate,i=Object(o.useState)((function(){return y(t)})),s=h()(i,2),l=s[0],u=s[1],p=Object(o.useRef)(t);return Object(o.useEffect)((function(){R()(p.current,t)||(p.current=t,u(y(t)))}),[t]),{selectShippingRate:Object(o.useCallback)((function(t){u(t),c(t,e),n("set-selected-shipping-rate",{shippingRateId:t})}),[e,c,n]),selectedShippingRate:l,isSelectingRate:r}}(t,i.shipping_rates),j=O.selectShippingRate,k=O.selectedShippingRate,w=React.createElement(React.Fragment,null,(v||u)&&React.createElement("div",{className:"wc-block-components-shipping-rates-control__package-title"},i.name),v&&React.createElement("ul",{className:"wc-block-components-shipping-rates-control__package-items"},Object.values(i.items).map((function(e){var t=Object(g.decodeEntities)(e.name),n=e.quantity;return React.createElement("li",{key:e.key,className:"wc-block-components-shipping-rates-control__package-item"},React.createElement(f.a,{label:n>1?"".concat(t," × ").concat(n):"".concat(t),screenReaderLabel:Object(r.sprintf)(
/* translators: %1$s name of the product (ie: Sunglasses), %2$d number of units in the current cart package */
Object(r._n)("%1$s (%2$d unit)","%1$s (%2$d units)",n,'woocommerce'),t,n)}))})))),C=React.createElement(x,{className:n,noResultsMessage:a,rates:i.shipping_rates,onSelectRate:j,selected:k,renderOption:c});return u?React.createElement(l.Panel,{className:"wc-block-components-shipping-rates-control__package",initialOpen:!d,title:w},C):React.createElement("div",{className:b()("wc-block-components-shipping-rates-control__package",n)},w,C)}),I=["package_id"],L=["extensions","receiveCart"],D=function(e){var t=e.packages,n=e.collapse,a=e.showItems,r=e.collapsible,o=e.noResultsMessage,i=e.renderOption;return t.length?React.createElement(React.Fragment,null,t.map((function(e){var t=e.package_id,s=c()(e,I);return React.createElement(P,{key:t,packageId:t,packageData:s,collapsible:r,collapse:n,showItems:a,noResultsMessage:o,renderOption:i})}))):null};t.a=function(e){var t=e.shippingRates,n=e.shippingRatesLoading,a=e.className,m=e.collapsible,b=void 0!==m&&m,g=e.noResultsMessage,f=e.renderOption;Object(o.useEffect)((function(){if(!n){var e=Object(u.a)(t),a=Object(u.b)(t);1===e?Object(i.speak)(Object(r.sprintf)(
/* translators: %d number of shipping options found. */
Object(r._n)("%d shipping option was found.","%d shipping options were found.",a,'woocommerce'),a)):Object(i.speak)(Object(r.sprintf)(
/* translators: %d number of shipping packages packages. */
Object(r._n)("Shipping option searched for %d package.","Shipping options searched for %d packages.",e,'woocommerce'),e)+" "+Object(r.sprintf)(
/* translators: %d number of shipping options available. */
Object(r._n)("%d shipping option was found","%d shipping options were found",a,'woocommerce'),a))}}),[n,t]);var v=Object(p.a)(),h=v.extensions,O=(v.receiveCart,{className:a,collapsible:b,noResultsMessage:g,renderOption:f,extensions:h,cart:c()(v,L),components:{ShippingRatesControlPackage:P}}),R=Object(d.a)().isEditor;return React.createElement(s.a,{isLoading:n,screenReaderLabel:Object(r.__)("Loading shipping rates…",'woocommerce'),showSpinner:!0},R?React.createElement(D,{packages:t,noResultsMessage:g,renderOption:f}):React.createElement(React.Fragment,null,React.createElement(l.ExperimentalOrderShippingPackages.Slot,O),React.createElement(l.ExperimentalOrderShippingPackages,null,React.createElement(D,{packages:t,noResultsMessage:g,renderOption:f}))))}},214:function(e,t,n){"use strict";n.d(t,"a",(function(){return v}));var a=n(4),c=n.n(a),r=n(1),o=n(11),i=n(8),s=n(28),l=n(32),u=n(0),p=n(226);function d(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function m(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?d(Object(n),!0).forEach((function(t){c()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):d(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var b=n(127),g=n(54);function f(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}var v=function(){var e=Object(l.a)(),t=e.cartCoupons,n=e.cartIsLoading,a=Object(g.a)().addErrorNotice,d=function(){var e=Object(p.b)(),t=e.notices,n=e.createSnackbarNotice,a=e.removeSnackbarNotice,c=e.setIsSuppressed,r=Object(u.useRef)(t);Object(u.useEffect)((function(){r.current=t}),[t]);var o=Object(u.useMemo)((function(){return{removeNotices:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;r.current.forEach((function(t){null!==e&&t.status!==e||a(t.id)}))},removeSnackbarNotice:a}}),[a]),i=Object(u.useMemo)((function(){return{addSnackbarNotice:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};n(e,t)}}}),[n]);return m(m(m({notices:t},o),i),{},{setIsSuppressed:c})}().addSnackbarNotice,v=Object(b.b)().setValidationErrors;return function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?f(Object(n),!0).forEach((function(t){c()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):f(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({appliedCoupons:t,isLoading:n},Object(o.useSelect)((function(e,t){var n=t.dispatch,c=e(i.CART_STORE_KEY),o=c.isApplyingCoupon(),l=c.isRemovingCoupon(),u=n(i.CART_STORE_KEY),p=u.applyCoupon,m=u.removeCoupon,b=u.receiveApplyingCoupon;return{applyCoupon:function(e){p(e).then((function(t){!0===t&&d(Object(r.sprintf)(
/* translators: %s coupon code. */
Object(r.__)('Coupon code "%s" has been applied to your cart.','woocommerce'),e),{id:"coupon-form"})})).catch((function(e){v({coupon:{message:Object(s.decodeEntities)(e.message),hidden:!1}}),b("")}))},removeCoupon:function(e){m(e).then((function(t){!0===t&&d(Object(r.sprintf)(
/* translators: %s coupon code. */
Object(r.__)('Coupon code "%s" has been removed from your cart.','woocommerce'),e),{id:"coupon-form"})})).catch((function(e){a(e.message,{id:"coupon-form"}),b("")}))},isApplyingCoupon:o,isRemovingCoupon:l}}),[a,d]))}},216:function(e,t,n){"use strict";var a=n(14),c=n.n(a),r=n(23),o=n.n(r),i=n(34),s=["className","size"],l=function(e){var t=e.className,n=e.size,a=o()(e,s);return React.createElement(i.SVG,c()({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",className:t,width:n,height:n},a),React.createElement("path",{d:"M14.95 6.46L11.41 10l3.54 3.54-1.41 1.41L10 11.42l-3.53 3.53-1.42-1.42L8.58 10 5.05 6.47l1.42-1.42L10 8.58l3.54-3.53z"}))},u=React.createElement(l,null);t.a=u},250:function(e,t){},251:function(e,t){},252:function(e,t){},253:function(e,t){},256:function(e,t){},257:function(e,t){},258:function(e,t,n){"use strict";n.d(t,"a",(function(){return c})),n(10);var a=n(127),c=(n(250),function(e){var t=e.errorMessage,n=void 0===t?"":t,c=e.propertyName,r=void 0===c?"":c,o=e.elementId,i=void 0===o?"":o,s=Object(a.b)(),l=s.getValidationError,u=s.getValidationErrorId;if(!n||"string"!=typeof n){var p=l(r)||{};if(!p.message||p.hidden)return null;n=p.message}return React.createElement("div",{className:"wc-block-components-validation-error",role:"alert"},React.createElement("p",{id:u(i)},n))})},259:function(e,t){},260:function(e,t){},261:function(e,t){},262:function(e,t){},263:function(e,t){},266:function(e,t,n){"use strict";var a=n(14),c=n.n(a),r=n(28),o=n(2);t.a=function(e){var t=e.image,n=void 0===t?{}:t,a={src:n.thumbnail||o.PLACEHOLDER_IMG_SRC,alt:Object(r.decodeEntities)(n.alt)||""};return React.createElement("img",c()({},a,{alt:a.alt}))}},267:function(e,t,n){"use strict";var a=n(1),c=n(106);t.a=function(){return React.createElement(c.a,{className:"wc-block-components-product-backorder-badge"},Object(a.__)("Available on backorder",'woocommerce'))}},268:function(e,t,n){"use strict";var a=n(1),c=n(106);t.a=function(e){var t=e.lowStockRemaining;return t?React.createElement(c.a,{className:"wc-block-components-product-low-stock-badge"},Object(a.sprintf)(
/* translators: %d stock amount (number of items in stock for product) */
Object(a.__)("%d left in stock",'woocommerce'),t)):null}},269:function(e,t,n){"use strict";var a=n(7),c=n(28),r=(n(186),function(e){var t=e.details,n=void 0===t?[]:t;return Array.isArray(n)?0===(n=n.filter((function(e){return!e.hidden}))).length?null:React.createElement("ul",{className:"wc-block-components-product-details"},n.map((function(e){var t=e.name?"wc-block-components-product-details__".concat(Object(a.kebabCase)(e.name)):"";return React.createElement("li",{key:e.name+(e.display||e.value),className:t},e.name&&React.createElement(React.Fragment,null,React.createElement("span",{className:"wc-block-components-product-details__name"},Object(c.decodeEntities)(e.name),":")," "),React.createElement("span",{className:"wc-block-components-product-details__value"},Object(c.decodeEntities)(e.display||e.value)))}))):null}),o=n(151),i=n(83),s=function(e){var t=e.className,n=e.shortDescription,a=void 0===n?"":n,c=e.fullDescription,r=a||(void 0===c?"":c);return r?React.createElement(o.a,{className:t,source:r,maxLength:15,countType:i.n.wordCountType||"words"}):null};n(185),t.a=function(e){var t=e.shortDescription,n=void 0===t?"":t,a=e.fullDescription,c=void 0===a?"":a,o=e.itemData,i=void 0===o?[]:o,l=e.variation,u=void 0===l?[]:l;return React.createElement("div",{className:"wc-block-components-product-metadata"},React.createElement(s,{className:"wc-block-components-product-metadata__description",shortDescription:n,fullDescription:c}),React.createElement(r,{details:i}),React.createElement(r,{details:u.map((function(e){var t=e.attribute;return{name:void 0===t?"":t,value:e.value}}))}))}},276:function(e,t,n){"use strict";var a=n(14),c=n.n(a),r=n(4),o=n.n(r),i=n(5),s=n.n(i),l=n(23),u=n.n(l),p=n(1),d=n(3),m=n(6),b=n.n(m),g=n(127),f=n(48),v=n(258),h=n(24),O=n(49),R=n(0),_=n(51),E=(n(206),["className","id","type","ariaLabel","ariaDescribedBy","label","screenReaderLabel","disabled","help","autoCapitalize","autoComplete","value","onChange","required","onBlur","feedback"]),y=Object(d.forwardRef)((function(e,t){var n=e.className,a=e.id,r=e.type,o=void 0===r?"text":r,i=e.ariaLabel,l=e.ariaDescribedBy,p=e.label,d=e.screenReaderLabel,m=e.disabled,g=e.help,f=e.autoCapitalize,v=void 0===f?"off":f,h=e.autoComplete,O=void 0===h?"off":h,y=e.value,j=void 0===y?"":y,k=e.onChange,w=e.required,C=void 0!==w&&w,N=e.onBlur,S=void 0===N?function(){}:N,x=e.feedback,P=u()(e,E),I=Object(R.useState)(!1),L=s()(I,2),D=L[0],M=L[1];return React.createElement("div",{className:b()("wc-block-components-text-input",n,{"is-active":D||j})},React.createElement("input",c()({type:o,id:a,value:j,ref:t,autoCapitalize:v,autoComplete:O,onChange:function(e){k(e.target.value)},onFocus:function(){return M(!0)},onBlur:function(e){S(e.target.value),M(!1)},"aria-label":i||p,disabled:m,"aria-describedby":g&&!l?a+"__help":l,required:C},P)),React.createElement(_.a,{label:p,screenReaderLabel:d||p,wrapperElement:"label",wrapperProps:{htmlFor:a},htmlFor:a}),!!g&&React.createElement("p",{id:a+"__help",className:"wc-block-components-text-input__help"},g),x)})),j=["className","instanceId","id","ariaDescribedBy","errorId","validateOnMount","focusOnMount","onChange","showError","errorMessage"];t.a=Object(h.withInstanceId)((function(e){var t=e.className,n=e.instanceId,a=e.id,r=e.ariaDescribedBy,i=e.errorId,l=e.validateOnMount,m=void 0===l||l,h=e.focusOnMount,R=void 0!==h&&h,_=e.onChange,E=e.showError,k=void 0===E||E,w=e.errorMessage,C=void 0===w?"":w,N=u()(e,j),S=Object(d.useState)(!0),x=s()(S,2),P=x[0],I=x[1],L=Object(d.useRef)(null),D=Object(g.b)(),M=D.getValidationError,T=D.hideValidationError,F=D.setValidationErrors,A=D.clearValidationError,V=D.getValidationErrorId,U=Object(f.b)().isBeforeProcessing,q=void 0!==a?a:"textinput-"+n,B=void 0!==i?i:q,$=Object(d.useCallback)((function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=L.current||null;if(t){t.value=t.value.trim();var n=t.checkValidity();n?A(B):F(o()({},B,{message:t.validationMessage||Object(p.__)("Invalid value.",'woocommerce'),hidden:e}))}}),[A,B,F]);Object(d.useEffect)((function(){var e;P&&(R&&(null===(e=L.current)||void 0===e||e.focus()),I(!1))}),[R,P,I]),Object(d.useEffect)((function(){P&&(m&&$(),I(!1))}),[P,I,m,$]),Object(d.useEffect)((function(){U&&$()}),[U,$]),Object(d.useEffect)((function(){return function(){A(B)}}),[A,B]);var z=M(B)||{};Object(O.c)(C)&&""!==C&&(z.message=C);var W=z.message&&!z.hidden,H=k&&W&&V(B)?V(B):r;return React.createElement(y,c()({className:b()(t,{"has-error":W}),"aria-invalid":!0===W,id:q,onBlur:function(){$(!1)},feedback:k&&React.createElement(v.a,{errorMessage:C,propertyName:B}),ref:L,onChange:function(e){T(B),_(e)},ariaDescribedBy:H},N))}))},326:function(e,t,n){"use strict";n.d(t,"a",(function(){return a})),n.d(t,"b",(function(){return c}));var a=function(e){return e.length},c=function(e){return e.reduce((function(e,t){return e+t.shipping_rates.length}),0)}},332:function(e,t,n){"use strict";var a=n(1),c=n(105),r=n(194),o=(n(10),n(26)),i=n(2),s=(n(256),{context:"summary"});t.a=function(e){var t=e.cartCoupons,n=void 0===t?[]:t,l=e.currency,u=e.isRemovingCoupon,p=e.removeCoupon,d=e.values,m=d.total_discount,b=d.total_discount_tax,g=parseInt(m,10);if(!g&&0===n.length)return null;var f=parseInt(b,10),v=Object(i.getSetting)("displayCartPricesIncludingTax",!1)?g+f:g,h=Object(o.__experimentalApplyCheckoutFilter)({arg:s,filterName:"coupons",defaultValue:n});return React.createElement(o.TotalsItem,{className:"wc-block-components-totals-discount",currency:l,description:0!==h.length&&React.createElement(c.a,{screenReaderLabel:Object(a.__)("Removing coupon…",'woocommerce'),isLoading:u,showSpinner:!1},React.createElement("ul",{className:"wc-block-components-totals-discount__coupon-list"},h.map((function(e){return React.createElement(r.a,{key:"coupon-"+e.code,className:"wc-block-components-totals-discount__coupon-list-item",text:e.label,screenReaderText:Object(a.sprintf)(
/* translators: %s Coupon code. */
Object(a.__)("Coupon: %s",'woocommerce'),e.label),disabled:u,onRemove:function(){p(e.code)},radius:"large",ariaLabel:Object(a.sprintf)(
/* translators: %s is a coupon code. */
Object(a.__)('Remove coupon "%s"','woocommerce'),e.label)})})))),label:v?Object(a.__)("Discount",'woocommerce'):Object(a.__)("Coupons",'woocommerce'),value:v?-1*v:"-"})}},333:function(e,t,n){"use strict";var a=n(5),c=n.n(a),r=n(1),o=n(0),i=n(143),s=n(276),l=n(51),u=n(105),p=(n(10),n(24)),d=n(127),m=n(258),b=n(26);n(257),t.a=Object(p.withInstanceId)((function(e){var t=e.instanceId,n=e.isLoading,a=void 0!==n&&n,p=e.initialOpen,g=void 0!==p&&p,f=e.onSubmit,v=void 0===f?function(){}:f,h=Object(o.useState)(""),O=c()(h,2),R=O[0],_=O[1],E=Object(o.useRef)(!1),y=Object(d.b)(),j=y.getValidationError,k=y.getValidationErrorId,w=j("coupon");Object(o.useEffect)((function(){E.current!==a&&(a||!R||w||_(""),E.current=a)}),[a,R,w]);var C="wc-block-components-totals-coupon__input-".concat(t);return React.createElement(b.Panel,{className:"wc-block-components-totals-coupon",hasBorder:!1,initialOpen:g,title:React.createElement(l.a,{label:Object(r.__)("Coupon code",'woocommerce'),screenReaderLabel:Object(r.__)("Apply a coupon code",'woocommerce'),htmlFor:C})},React.createElement(u.a,{screenReaderLabel:Object(r.__)("Applying coupon…",'woocommerce'),isLoading:a,showSpinner:!1},React.createElement("div",{className:"wc-block-components-totals-coupon__content"},React.createElement("form",{className:"wc-block-components-totals-coupon__form"},React.createElement(s.a,{id:C,errorId:"coupon",className:"wc-block-components-totals-coupon__input",label:Object(r.__)("Enter code",'woocommerce'),value:R,ariaDescribedBy:k(C),onChange:function(e){_(e)},validateOnMount:!1,focusOnMount:!0,showError:!1}),React.createElement(i.a,{className:"wc-block-components-totals-coupon__button",disabled:a||!R,showSpinner:a,onClick:function(e){e.preventDefault(),v(R)},type:"submit"},Object(r.__)("Apply",'woocommerce'))),React.createElement(m.a,{propertyName:"coupon",elementId:C}))))}))},334:function(e,t,n){"use strict";var a=n(23),c=n.n(a),r=n(1),o=n(0),i=n(69),s=(n(10),n(26)),l=n(32),u=n(2),p=(n(263),["receiveCart"]);t.a=function(e){var t=e.currency,n=e.values,a=Object(u.getSetting)("taxesEnabled",!0)&&Object(u.getSetting)("displayCartPricesIncludingTax",!1),d=n.total_price,m=n.total_tax,b=Object(l.a)(),g=(b.receiveCart,c()(b,p)),f=Object(s.__experimentalApplyCheckoutFilter)({filterName:"totalLabel",defaultValue:Object(r.__)("Total",'woocommerce'),extensions:g.extensions,arg:{cart:g}}),v=parseInt(m,10);return React.createElement(s.TotalsItem,{className:"wc-block-components-totals-footer-item",currency:t,label:f,value:parseInt(d,10),description:a&&0!==v&&React.createElement("p",{className:"wc-block-components-totals-footer-item-tax"},Object(o.createInterpolateElement)(Object(r.__)("Including <TaxAmount/> in taxes",'woocommerce'),{TaxAmount:React.createElement(i.a,{className:"wc-block-components-totals-footer-item-tax-value",currency:t,value:v})}))})}},335:function(e,t,n){"use strict";var a=n(4),c=n.n(a),r=n(276),o=n(14),i=n.n(o),s=n(83),l=n(0),u=n(1),p=n(28),d=n(6),m=n.n(d),b=n(24),g=n(340),f=n(127),v=n(258),h=n(49),O=(n(261),Object(b.withInstanceId)((function(e){var t=e.id,n=e.className,a=e.label,r=e.onChange,o=e.options,i=e.value,s=e.required,p=void 0!==s&&s,d=e.errorMessage,b=void 0===d?Object(u.__)("Please select a value.",'woocommerce'):d,O=e.errorId,R=e.instanceId,_=void 0===R?"0":R,E=e.autoComplete,y=void 0===E?"off":E,j=Object(f.b)(),k=j.getValidationError,w=j.setValidationErrors,C=j.clearValidationError,N=Object(l.useRef)(null),S=t||"control-"+_,x=O||S,P=k(x)||{message:"",hidden:!1};return Object(l.useEffect)((function(){return!p||i?C(x):w(c()({},x,{message:b,hidden:!0})),function(){C(x)}}),[C,i,x,b,p,w]),React.createElement("div",{id:S,className:m()("wc-block-components-combobox",n,{"is-active":i,"has-error":P.message&&!P.hidden}),ref:N},React.createElement(g.a,{className:"wc-block-components-combobox-control",label:a,onChange:r,onFilterValueChange:function(e){if(e.length){var t=Object(h.b)(N.current)?N.current.ownerDocument.activeElement:void 0;if(t&&Object(h.b)(N.current)&&N.current.contains(t))return;var n=e.toLocaleUpperCase(),a=o.find((function(e){return e.label.toLocaleUpperCase().startsWith(n)||e.value.toLocaleUpperCase()===n}));a&&r(a.value)}},options:o,value:i||"",allowReset:!1,autoComplete:y,"aria-invalid":P.message&&!P.hidden}),React.createElement(v.a,{propertyName:x}))}))),R=(n(260),function(e){var t=e.className,n=e.countries,a=e.id,c=e.label,r=e.onChange,o=e.value,i=void 0===o?"":o,s=e.autoComplete,d=void 0===s?"off":s,b=e.required,g=void 0!==b&&b,f=e.errorId,v=e.errorMessage,h=void 0===v?Object(u.__)("Please select a country.",'woocommerce'):v,R=Object(l.useMemo)((function(){return Object.keys(n).map((function(e){return{value:e,label:Object(p.decodeEntities)(n[e])}}))}),[n]);return React.createElement("div",{className:m()(t,"wc-block-components-country-input")},React.createElement(O,{id:a,label:c,onChange:r,options:R,value:i,errorId:f,errorMessage:h,required:g,autoComplete:d}),"off"!==d&&React.createElement("input",{type:"text","aria-hidden":!0,autoComplete:d,value:i,onChange:function(e){var t=e.target.value.toLocaleUpperCase(),n=R.find((function(e){return 2!==t.length&&e.label.toLocaleUpperCase()===t||2===t.length&&e.value.toLocaleUpperCase()===t}));r(n?n.value:"")},style:{minHeight:"0",height:"0",border:"0",padding:"0",position:"absolute"},tabIndex:-1}))}),_=function(e){return React.createElement(R,i()({countries:s.g},e))},E=function(e){return React.createElement(R,i()({countries:s.a},e))},y=(n(262),function(e,t){var n=t.find((function(t){return t.label.toLocaleUpperCase()===e.toLocaleUpperCase()||t.value.toLocaleUpperCase()===e.toLocaleUpperCase()}));return n?n.value:""}),j=function(e){var t=e.className,n=e.id,a=e.states,c=e.country,o=e.label,i=e.onChange,s=e.autoComplete,d=void 0===s?"off":s,b=e.value,g=void 0===b?"":b,f=e.required,v=void 0!==f&&f,h=a[c],R=Object(l.useMemo)((function(){return h?Object.keys(h).map((function(e){return{value:e,label:Object(p.decodeEntities)(h[e])}})):[]}),[h]),_=Object(l.useCallback)((function(e){i(R.length>0?y(e,R):e)}),[i,R]),E=Object(l.useRef)(g);return Object(l.useEffect)((function(){E.current!==g&&(E.current=g)}),[g]),Object(l.useEffect)((function(){if(R.length>0&&E.current){var e=y(E.current,R);e!==E.current&&_(e)}}),[R,_]),R.length>0?React.createElement(React.Fragment,null,React.createElement(O,{className:m()(t,"wc-block-components-state-input"),id:n,label:o,onChange:_,options:R,value:g,errorMessage:Object(u.__)("Please select a state.",'woocommerce'),required:v,autoComplete:d}),"off"!==d&&React.createElement("input",{type:"text","aria-hidden":!0,autoComplete:d,value:g,onChange:function(e){return _(e.target.value)},style:{minHeight:"0",height:"0",border:"0",padding:"0",position:"absolute"},tabIndex:-1})):React.createElement(r.a,{className:t,id:n,label:o,onChange:_,autoComplete:d,value:g,required:v})},k=function(e){return React.createElement(j,i()({states:s.h},e))},w=function(e){return React.createElement(j,i()({states:s.b},e))},C=n(53),N=n(2),S=n(87);function x(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function P(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?x(Object(n),!0).forEach((function(t){c()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):x(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}t.a=Object(b.withInstanceId)((function(e){var t=e.id,n=e.fields,a=void 0===n?Object.keys(N.defaultAddressFields):n,o=e.fieldConfig,i=void 0===o?{}:o,s=e.instanceId,p=e.onChange,d=e.type,m=void 0===d?"shipping":d,b=e.values,g=Object(f.b)(),v=g.getValidationError,h=g.setValidationErrors,O=g.clearValidationError,R=Object(C.a)(a),y=v("shipping-missing-country")||{},j=Object(l.useMemo)((function(){return Object(S.a)(R,i,b.country)}),[R,i,b.country]);return Object(l.useEffect)((function(){j.forEach((function(e){e.hidden&&b[e.key]&&p(P(P({},b),{},c()({},e.key,"")))}))}),[j,p,b]),Object(l.useEffect)((function(){"shipping"===m&&function(e,t,n,a){a||e.country||!(e.city||e.state||e.postcode)||t({"shipping-missing-country":{message:Object(u.__)("Please select a country to calculate rates.",'woocommerce'),hidden:!1}}),a&&e.country&&n("shipping-missing-country")}(b,h,O,!!y.message&&!y.hidden)}),[b,y.message,y.hidden,h,O,m]),t=t||s,React.createElement("div",{id:t,className:"wc-block-components-address-form"},j.map((function(e){if(e.hidden)return null;if("country"===e.key){var n="shipping"===m?_:E;return React.createElement(n,{key:e.key,id:"".concat(t,"-").concat(e.key),label:e.required?e.label:e.optionalLabel,value:b.country,autoComplete:e.autocomplete,onChange:function(e){return p(P(P({},b),{},{country:e,state:""}))},errorId:"shipping"===m?"shipping-missing-country":null,errorMessage:e.errorMessage,required:e.required})}if("state"===e.key){var a="shipping"===m?k:w;return React.createElement(a,{key:e.key,id:"".concat(t,"-").concat(e.key),country:b.country,label:e.required?e.label:e.optionalLabel,value:b.state,autoComplete:e.autocomplete,onChange:function(e){return p(P(P({},b),{},{state:e}))},errorMessage:e.errorMessage,required:e.required})}return React.createElement(r.a,{key:e.key,id:"".concat(t,"-").concat(e.key),className:"wc-block-components-address-form__".concat(e.key),label:e.required?e.label:e.optionalLabel,value:b[e.key],autoCapitalize:e.autocapitalize,autoComplete:e.autocomplete,onChange:function(t){return p(P(P({},b),{},c()({},e.key,t)))},errorMessage:e.errorMessage,required:e.required})})))}))},336:function(e,t,n){"use strict";var a=n(14),c=n.n(a),r=n(5),o=n.n(r),i=n(6),s=n.n(i),l=n(1),u=n(0),p=n(32),d=n(26),m=n(2),b=function(e){var t=e.selectedShippingRates;return React.createElement("div",{className:"wc-block-components-totals-item__description wc-block-components-totals-shipping__via"},Object(l.__)("via",'woocommerce')," ",t.join(", "))},g=n(153),f=n(209),v=function(e){var t=e.hasRates,n=e.shippingRates,a=e.shippingRatesLoading,c=t?Object(l.__)("Shipping options",'woocommerce'):Object(l.__)("Choose a shipping option",'woocommerce');return React.createElement("fieldset",{className:"wc-block-components-totals-shipping__fieldset"},React.createElement("legend",{className:"screen-reader-text"},c),React.createElement(f.a,{className:"wc-block-components-totals-shipping__options",collapsible:!0,noResultsMessage:React.createElement(g.a,{isDismissible:!1,className:s()("wc-block-components-shipping-rates-control__no-results-notice","woocommerce-error")},Object(l.__)("No shipping options were found.",'woocommerce')),shippingRates:n,shippingRatesLoading:a}))},h=n(66),O=n(143),R=n(25),_=n.n(R),E=n(127),y=(n(208),n(335)),j=function(e){var t=e.address,n=e.onUpdate,a=e.addressFields,c=Object(u.useState)(t),r=o()(c,2),i=r[0],s=r[1],p=Object(E.b)(),d=p.hasValidationErrors,m=p.showAllValidationErrors;return React.createElement("form",{className:"wc-block-components-shipping-calculator-address"},React.createElement(y.a,{fields:a,onChange:s,values:i}),React.createElement(O.a,{className:"wc-block-components-shipping-calculator-address__button",disabled:_()(i,t),onClick:function(e){if(e.preventDefault(),m(),!d)return n(i)},type:"submit"},Object(l.__)("Update",'woocommerce')))},k=function(e){var t=e.onUpdate,n=void 0===t?function(){}:t,a=e.addressFields,c=void 0===a?["country","state","city","postcode"]:a,r=Object(h.b)(),o=r.shippingAddress,i=r.setShippingAddress;return React.createElement("div",{className:"wc-block-components-shipping-calculator"},React.createElement(j,{address:o,addressFields:c,onUpdate:function(e){i(e),n(e)}}))},w=n(21),C=n.n(w),N=n(28),S=function(e){var t=e.address;if(0===Object.values(t).length)return null;var n=Object(m.getSetting)("shippingCountries",{}),a=Object(m.getSetting)("shippingStates",{}),c="string"==typeof n[t.country]?Object(N.decodeEntities)(n[t.country]):"",r="object"===C()(a[t.country])&&"string"==typeof a[t.country][t.state]?Object(N.decodeEntities)(a[t.country][t.state]):t.state,o=[];o.push(t.postcode.toUpperCase()),o.push(t.city),o.push(r),o.push(c);var i=o.filter(Boolean).join(", ");return i?React.createElement("span",{className:"wc-block-components-shipping-address"},Object(l.sprintf)(
/* translators: %s location. */
Object(l.__)("Shipping to %s",'woocommerce'),i)+" "):null},x=(n(259),function(e){var t=e.label,n=void 0===t?Object(l.__)("Calculate",'woocommerce'):t,a=e.isShippingCalculatorOpen,c=e.setIsShippingCalculatorOpen;return React.createElement("button",{className:"wc-block-components-totals-shipping__change-address-button",onClick:function(){c(!a)},"aria-expanded":a},n)}),P=function(e){var t=e.showCalculator,n=e.isShippingCalculatorOpen,a=e.setIsShippingCalculatorOpen,c=e.shippingAddress;return React.createElement(React.Fragment,null,React.createElement(S,{address:c}),t&&React.createElement(x,{label:Object(l.__)("(change address)",'woocommerce'),isShippingCalculatorOpen:n,setIsShippingCalculatorOpen:a}))},I=function(e){var t=e.showCalculator,n=e.isShippingCalculatorOpen,a=e.setIsShippingCalculatorOpen;return t?React.createElement(x,{isShippingCalculatorOpen:n,setIsShippingCalculatorOpen:a}):React.createElement("em",null,Object(l.__)("Calculated during checkout",'woocommerce'))};t.a=function(e){var t=e.currency,n=e.values,a=e.showCalculator,r=void 0===a||a,i=e.showRateSelector,g=void 0===i||i,f=e.className,h=Object(u.useState)(!1),O=o()(h,2),R=O[0],_=O[1],E=Object(p.a)(),y=E.shippingAddress,j=E.cartHasCalculatedShipping,w=E.shippingRates,C=E.shippingRatesLoading,N=Object(m.getSetting)("displayCartPricesIncludingTax",!1)?parseInt(n.total_shipping,10)+parseInt(n.total_shipping_tax,10):parseInt(n.total_shipping,10),S=w.some((function(e){return e.shipping_rates.length}))||N,x={isShippingCalculatorOpen:R,setIsShippingCalculatorOpen:_},L=w.flatMap((function(e){return e.shipping_rates.filter((function(e){return e.selected})).flatMap((function(e){return e.name}))}));return React.createElement("div",{className:s()("wc-block-components-totals-shipping",f)},React.createElement(d.TotalsItem,{label:Object(l.__)("Shipping",'woocommerce'),value:j?N:React.createElement(I,c()({showCalculator:r},x)),description:React.createElement(React.Fragment,null,j&&React.createElement(React.Fragment,null,React.createElement(b,{selectedShippingRates:L}),React.createElement(P,c()({shippingAddress:y,showCalculator:r},x)))),currency:t}),r&&R&&React.createElement(k,{onUpdate:function(){_(!1)}}),g&&j&&React.createElement(v,{hasRates:S,shippingRates:w,shippingRatesLoading:C}))}},383:function(e,t){},413:function(e,t,n){"use strict";n.r(t);var a=n(23),c=n.n(a),r=n(1),o=(n(10),n(201)),i=n(26),s=n(51),l=n(140),u=n(150),p=n(58),d=n(125),m=n(2),b=n(0),g=n(32),f=n(267),v=n(266),h=n(268),O=n(269),R=["receiveCart"],_=function(e){return Object(i.mustContain)(e,"<price/>")},E=function(e){var t=e.cartItem,n=t.images,a=t.low_stock_remaining,o=t.show_backorder_badge,E=t.name,y=t.permalink,j=t.prices,k=t.quantity,w=t.short_description,C=t.description,N=t.item_data,S=t.variation,x=t.totals,P=t.extensions,I=Object(g.a)(),L=(I.receiveCart,c()(I,R)),D=Object(b.useMemo)((function(){return{context:"summary",cartItem:t,cart:L}}),[t,L]),M=Object(p.getCurrencyFromPriceResponse)(j),T=Object(i.__experimentalApplyCheckoutFilter)({filterName:"itemName",defaultValue:E,extensions:P,arg:D}),F=Object(d.a)({amount:parseInt(j.raw_prices.regular_price,10),precision:parseInt(j.raw_prices.precision,10)}).convertPrecision(M.minorUnit).getAmount(),A=Object(d.a)({amount:parseInt(j.raw_prices.price,10),precision:parseInt(j.raw_prices.precision,10)}).convertPrecision(M.minorUnit).getAmount(),V=Object(p.getCurrencyFromPriceResponse)(x),U=parseInt(x.line_subtotal,10);Object(m.getSetting)("displayCartPricesIncludingTax",!1)&&(U+=parseInt(x.line_subtotal_tax,10));var q=Object(d.a)({amount:U,precision:V.minorUnit}).getAmount(),B=Object(i.__experimentalApplyCheckoutFilter)({filterName:"subtotalPriceFormat",defaultValue:"<price/>",extensions:P,arg:D,validation:_}),$=Object(i.__experimentalApplyCheckoutFilter)({filterName:"cartItemPrice",defaultValue:"<price/>",extensions:P,arg:D,validation:_});return React.createElement("div",{className:"wc-block-components-order-summary-item"},React.createElement("div",{className:"wc-block-components-order-summary-item__image"},React.createElement("div",{className:"wc-block-components-order-summary-item__quantity"},React.createElement(s.a,{label:k,screenReaderLabel:Object(r.sprintf)(
/* translators: %d number of products of the same type in the cart */
Object(r._n)("%d item","%d items",k,'woocommerce'),k)})),React.createElement(v.a,{image:n.length?n[0]:{}})),React.createElement("div",{className:"wc-block-components-order-summary-item__description"},React.createElement(u.a,{disabled:!0,name:T,permalink:y}),React.createElement(l.a,{currency:M,price:A,regularPrice:F,className:"wc-block-components-order-summary-item__individual-prices",priceClassName:"wc-block-components-order-summary-item__individual-price",regularPriceClassName:"wc-block-components-order-summary-item__regular-individual-price",format:B}),o?React.createElement(f.a,null):!!a&&React.createElement(h.a,{lowStockRemaining:a}),React.createElement(O.a,{shortDescription:w,fullDescription:C,itemData:N,variation:S})),React.createElement("span",{className:"screen-reader-text"},Object(r.sprintf)(
/* translators: %1$d is the number of items, %2$s is the item name and %3$s is the total price including the currency symbol. */
Object(r._n)("Total price for %1$d %2$s item: %3$s","Total price for %1$d %2$s items: %3$s",k,'woocommerce'),k,T,Object(p.formatPrice)(q,V))),React.createElement("div",{className:"wc-block-components-order-summary-item__total-price","aria-hidden":"true"},React.createElement(l.a,{currency:V,format:$,price:q})))},y=(n(383),function(e){var t=e.cartItems,n=void 0===t?[]:t,a=Object(o.b)(),c=a.isLarge;return a.hasContainerWidth?React.createElement(i.Panel,{className:"wc-block-components-order-summary",initialOpen:c,hasBorder:!1,title:React.createElement("span",{className:"wc-block-components-order-summary__button-text"},Object(r.__)("Order summary",'woocommerce')),titleTag:"h2"},React.createElement("div",{className:"wc-block-components-order-summary__content"},n.map((function(e){return React.createElement(E,{key:e.key,cartItem:e})})))):null}),j=n(332),k=n(333),w=n(336),C=n(334),N=n(66),S=n(214),x=["extensions","receiveCart"];t.default=function(e){var t=e.showRateAfterTaxName,n=void 0!==t&&t,a=Object(g.a)(),r=a.cartItems,o=a.cartTotals,s=a.cartCoupons,l=a.cartFees,u=Object(S.a)(),d=u.applyCoupon,b=u.removeCoupon,f=u.isApplyingCoupon,v=u.isRemovingCoupon,h=Object(N.b)().needsShipping,O=Object(p.getCurrencyFromPriceResponse)(o),R=Object(g.a)(),_=R.extensions,E=(R.receiveCart,{extensions:_,cart:c()(R,x)});return React.createElement(React.Fragment,null,React.createElement(i.TotalsWrapper,null,React.createElement(y,{cartItems:r})),React.createElement(i.TotalsWrapper,null,React.createElement(i.Subtotal,{currency:O,values:o}),React.createElement(i.TotalsFees,{currency:O,cartFees:l}),React.createElement(j.a,{cartCoupons:s,currency:O,isRemovingCoupon:v,removeCoupon:b,values:o})),Object(m.getSetting)("couponsEnabled",!0)&&React.createElement(i.TotalsWrapper,null,React.createElement(k.a,{onSubmit:d,initialOpen:!1,isLoading:f})),h&&React.createElement(i.TotalsWrapper,null,React.createElement(w.a,{showCalculator:!1,showRateSelector:!1,values:o,currency:O})),!Object(m.getSetting)("displayCartPricesIncludingTax",!1)&&parseInt(o.total_tax,10)>0&&React.createElement(i.TotalsWrapper,null,React.createElement(i.TotalsTaxes,{currency:O,showRateAfterTaxName:n,values:o})),React.createElement(i.TotalsWrapper,null,React.createElement(C.a,{currency:O,values:o})),React.createElement(i.ExperimentalOrderMeta.Slot,E))}},51:function(e,t,n){"use strict";var a=n(4),c=n.n(a),r=n(0),o=n(6),i=n.n(o);function s(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function l(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?s(Object(n),!0).forEach((function(t){c()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):s(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}t.a=function(e){var t,n=e.label,a=e.screenReaderLabel,c=e.wrapperElement,o=e.wrapperProps,s=void 0===o?{}:o,u=null!=n,p=null!=a;return!u&&p?(t=c||"span",s=l(l({},s),{},{className:i()(s.className,"screen-reader-text")}),React.createElement(t,s,a)):(t=c||r.Fragment,u&&p&&n!==a?React.createElement(t,s,React.createElement("span",{"aria-hidden":"true"},n),React.createElement("span",{className:"screen-reader-text"},a)):React.createElement(t,s,n))}},69:function(e,t,n){"use strict";var a=n(14),c=n.n(a),r=n(4),o=n.n(r),i=n(23),s=n.n(i),l=n(126),u=n(6),p=n.n(u),d=(n(147),["className","value","currency","onValueChange","displayType"]);function m(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function b(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?m(Object(n),!0).forEach((function(t){o()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):m(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}t.a=function(e){var t=e.className,n=e.value,a=e.currency,r=e.onValueChange,o=e.displayType,i=void 0===o?"text":o,u=s()(e,d),m="string"==typeof n?parseInt(n,10):n;if(!Number.isFinite(m))return null;var g=m/Math.pow(10,a.minorUnit);if(!Number.isFinite(g))return null;var f=p()("wc-block-formatted-money-amount","wc-block-components-formatted-money-amount",t),v=b(b(b({},u),function(e){return{thousandSeparator:e.thousandSeparator,decimalSeparator:e.decimalSeparator,decimalScale:e.minorUnit,fixedDecimalScale:!0,prefix:e.prefix,suffix:e.suffix,isNumericString:!0}}(a)),{},{value:void 0,currency:void 0,onValueChange:void 0}),h=r?function(e){var t=e.value*Math.pow(10,a.minorUnit);r(t)}:function(){};return React.createElement(l.a,c()({className:f,displayType:i},v,{value:g,onValueChange:h}))}}}]);woocommerce-blocks/build/checkout-blocks/express-payment-frontend.js000064400000012000151335517640022037 0ustar00(window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[35],{105:function(e,t,n){"use strict";var c=n(1),r=(n(10),n(6)),o=n.n(r),a=(n(181),n(138));t.a=function(e){var t=e.children,n=e.className,r=e.screenReaderLabel,s=e.showSpinner,l=void 0!==s&&s,i=e.isLoading,u=void 0===i||i;return React.createElement("div",{className:o()(n,{"wc-block-components-loading-mask":u})},u&&l&&React.createElement(a.a,null),React.createElement("div",{className:o()({"wc-block-components-loading-mask__children":u}),"aria-hidden":u},t),u&&React.createElement("span",{className:"screen-reader-text"},r||Object(c.__)("Loading…",'woocommerce')))}},138:function(e,t,n){"use strict";n(180),t.a=function(){return React.createElement("span",{className:"wc-block-components-spinner","aria-hidden":"true"})}},175:function(e,t,n){"use strict";var c=n(14),r=n.n(c),o=n(23),a=n.n(o),s=n(6),l=n.n(s),i=(n(10),n(248),["children","className","headingLevel"]);t.a=function(e){var t=e.children,n=e.className,c=e.headingLevel,o=a()(e,i),s=l()("wc-block-components-title",n),u="h".concat(c);return React.createElement(u,r()({className:s},o),t)}},180:function(e,t){},181:function(e,t){},212:function(e,t,n){"use strict";var c=n(4),r=n.n(c),o=n(5),a=n.n(o),s=n(1),l=n(318),i=n(187),u=n(0),m=n(36),p=n(173),b=n(45),d=n.n(b),E=n(213);function O(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(e);t&&(c=c.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,c)}return n}function g(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?O(Object(n),!0).forEach((function(t){r()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):O(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}t.a=function(){var e=Object(m.a)().isEditor,t=Object(p.b)(),n=t.setActivePaymentMethod,c=t.setExpressPaymentError,r=t.activePaymentMethod,o=t.paymentMethodData,b=t.setPaymentStatus,O=Object(l.a)(),k=Object(i.a)().paymentMethods,f=Object(u.useRef)(r),h=Object(u.useRef)(o),j=Object(u.useCallback)((function(e){return function(){f.current=r,h.current=o,b().started({}),n(e)}}),[r,o,n,b]),y=Object(u.useCallback)((function(){b().pristine(),n(f.current),h.current.isSavedToken&&b().started(h.current)}),[n,b]),v=Object(u.useCallback)((function(e){b().error(e),c(e),n(f.current),h.current.isSavedToken&&b().started(h.current)}),[n,b,c]),w=Object(u.useCallback)((function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";d()("Express Payment Methods should use the provided onError handler instead.",{alternative:"onError",plugin:"woocommerce-gutenberg-products-block",link:"https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/4228"}),e?v(e):c("")}),[c,v]),R=Object.entries(k),_=R.length>0?R.map((function(t){var n=a()(t,2),c=n[0],r=n[1],o=e?r.edit:r.content;return Object(u.isValidElement)(o)?React.createElement("li",{key:c,id:"express-payment-method-".concat(c)},Object(u.cloneElement)(o,g(g({},O),{},{onClick:j(c),onClose:y,onError:v,setExpressPaymentError:w}))):null})):React.createElement("li",{key:"noneRegistered"},Object(s.__)("No registered Payment Methods",'woocommerce'));return React.createElement(E.a,{isEditor:e},React.createElement("ul",{className:"wc-block-components-express-payment__event-buttons"},_))}},248:function(e,t){},264:function(e,t){},417:function(e,t,n){"use strict";n.r(t);var c=n(32),r=n(1),o=n(187),a=n(35),s=n(48),l=n(173),i=n(36),u=n(103),m=n(175),p=n(105),b=n(2),d=n(212),E=(n(264),function(){var e=Object(s.b)(),t=e.isCalculating,n=e.isProcessing,c=e.isAfterProcessing,E=e.isBeforeProcessing,O=e.isComplete,g=e.hasError,k=Object(l.b)().currentStatus,f=Object(o.a)(),h=f.paymentMethods,j=f.isInitialized,y=Object(i.a)().isEditor,v=Object(a.c)().noticeContexts;if(!j||j&&0===Object.keys(h).length)return y||b.CURRENT_USER_IS_ADMIN?React.createElement(u.a,{context:v.EXPRESS_PAYMENTS}):null;var w=n||c||E||O&&!g;return React.createElement(React.Fragment,null,React.createElement(p.a,{isLoading:t||w||k.isDoingExpressPayment},React.createElement("div",{className:"wc-block-components-express-payment wc-block-components-express-payment--checkout"},React.createElement("div",{className:"wc-block-components-express-payment__title-container"},React.createElement(m.a,{className:"wc-block-components-express-payment__title",headingLevel:"2"},Object(r.__)("Express checkout",'woocommerce'))),React.createElement("div",{className:"wc-block-components-express-payment__content"},React.createElement(u.a,{context:v.EXPRESS_PAYMENTS},React.createElement("p",null,Object(r.__)("In a hurry? Use one of our express checkout options:",'woocommerce')),React.createElement(d.a,null))))),React.createElement("div",{className:"wc-block-components-express-payment-continue-rule wc-block-components-express-payment-continue-rule--checkout"},Object(r.__)("Or continue below",'woocommerce')))});t.default=function(){return Object(c.a)().cartNeedsPayment?React.createElement(E,null):null}}}]);woocommerce-blocks/build/checkout-blocks/billing-address-frontend.js000064400000017243151335517640021754 0ustar00(window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[33],{175:function(e,t,n){"use strict";var c=n(14),i=n.n(c),r=n(23),o=n.n(r),a=n(6),s=n.n(a),l=(n(10),n(248),["children","className","headingLevel"]);t.a=function(e){var t=e.children,n=e.className,c=e.headingLevel,r=o()(e,l),a=s()("wc-block-components-title",n),u="h".concat(c);return React.createElement(u,i()({className:a},r),t)}},248:function(e,t){},345:function(e,t,n){"use strict";var c=n(14),i=n.n(c),r=n(188);t.a=function(e){return function(t){return function(n){var c=Object(r.a)(e,n);return React.createElement(t,i()({},n,c))}}}},346:function(e,t){},349:function(e,t,n){"use strict";var c=n(1);t.a=function(e){var t=e.defaultTitle,n=void 0===t?Object(c.__)("Step",'woocommerce'):t,i=e.defaultDescription,r=void 0===i?Object(c.__)("Step description text.",'woocommerce'):i,o=e.defaultShowStepNumber;return{title:{type:"string",default:n},description:{type:"string",default:r},showStepNumber:{type:"boolean",default:void 0===o||o}}}},350:function(e,t,n){"use strict";var c=n(6),i=n.n(c),r=(n(10),n(175)),o=(n(346),function(e){var t=e.title,n=e.stepHeadingContent;return React.createElement("div",{className:"wc-block-components-checkout-step__heading"},React.createElement(r.a,{"aria-hidden":"true",className:"wc-block-components-checkout-step__title",headingLevel:"2"},t),!!n&&React.createElement("span",{className:"wc-block-components-checkout-step__heading-content"},n))});t.a=function(e){var t=e.id,n=e.className,c=e.title,r=e.legend,a=e.description,s=e.children,l=e.disabled,u=void 0!==l&&l,d=e.showStepNumber,b=void 0===d||d,p=e.stepHeadingContent,f=void 0===p?function(){}:p,h=r||c?"fieldset":"div";return React.createElement(h,{className:i()(n,"wc-block-components-checkout-step",{"wc-block-components-checkout-step--with-step-number":b,"wc-block-components-checkout-step--disabled":u}),id:t,disabled:u},!(!r&&!c)&&React.createElement("legend",{className:"screen-reader-text"},r||c),!!c&&React.createElement(o,{title:c,stepHeadingContent:f()}),React.createElement("div",{className:"wc-block-components-checkout-step__container"},!!a&&React.createElement("p",{className:"wc-block-components-checkout-step__description"},a),React.createElement("div",{className:"wc-block-components-checkout-step__content"},s)))}},352:function(e,t,n){"use strict";n.d(t,"a",(function(){return p}));var c=n(4),i=n.n(c),r=n(23),o=n.n(r),a=n(2),s=n(0),l=n(66),u=n(60),d=["email"];function b(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(e);t&&(c=c.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,c)}return n}var p=function(){var e=Object(l.b)().needsShipping,t=Object(u.b)(),n=t.billingData,c=t.setBillingData,r=t.shippingAddress,p=t.setShippingAddress,f=t.shippingAsBilling,h=t.setShippingAsBilling,m=Object(s.useRef)(f),O=Object(s.useRef)(n),g=Object(s.useCallback)((function(e){p(e),f&&c(e)}),[f,p,c]),v=Object(s.useCallback)((function(t){c(t),e||p(t)}),[e,p,c]);Object(s.useEffect)((function(){if(m.current!==f){if(f)O.current=n,c(r);else{var e=O.current,t=(e.email,o()(e,d));c(function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?b(Object(n),!0).forEach((function(t){i()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):b(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({},t))}m.current=f}}),[f,c,r,n]);var j=Object(s.useCallback)((function(e){c({email:e})}),[c]),w=Object(s.useCallback)((function(e){c({phone:e})}),[c]),k=Object(s.useCallback)((function(e){g({phone:e})}),[g]);return{defaultAddressFields:a.defaultAddressFields,shippingFields:r,setShippingFields:g,billingFields:n,setBillingFields:v,setEmail:j,setPhone:w,setShippingPhone:k,shippingAsBilling:f,setShippingAsBilling:h,showShippingFields:e,showBillingFields:!e||!m.current}}},353:function(e,t,n){"use strict";var c=n(1),i=n(276);t.a=function(e){var t=e.id,n=void 0===t?"phone":t,r=e.isRequired,o=void 0!==r&&r,a=e.value,s=void 0===a?"":a,l=e.onChange;return React.createElement(i.a,{id:n,type:"tel",autoComplete:"tel",required:o,label:o?Object(c.__)("Phone",'woocommerce'):Object(c.__)("Phone (optional)",'woocommerce'),value:s,onChange:l})}},372:function(e,t,n){"use strict";var c=n(12),i=n(19),r=n(0),o=n(7),a=n(6),s=n.n(a),l=n(37),u=Object(r.createContext)(!1),d=u.Consumer,b=u.Provider,p=["BUTTON","FIELDSET","INPUT","OPTGROUP","OPTION","SELECT","TEXTAREA"];function f(e){var t=e.className,n=e.children,a=Object(i.a)(e,["className","children"]),u=Object(r.useRef)(),d=function(){l.focus.focusable.find(u.current).forEach((function(e){Object(o.includes)(p,e.nodeName)&&e.setAttribute("disabled",""),"A"===e.nodeName&&e.setAttribute("tabindex",-1);var t=e.getAttribute("tabindex");null!==t&&"-1"!==t&&e.removeAttribute("tabindex"),e.hasAttribute("contenteditable")&&e.setAttribute("contenteditable","false")}))},f=Object(r.useCallback)(Object(o.debounce)(d,{leading:!0}),[]);return Object(r.useLayoutEffect)((function(){d();var e=new window.MutationObserver(f);return e.observe(u.current,{childList:!0,attributes:!0,subtree:!0}),function(){e.disconnect(),f.cancel()}}),[]),Object(r.createElement)(b,{value:!0},Object(r.createElement)("div",Object(c.a)({ref:u,className:s()(t,"components-disabled")},a),n))}f.Consumer=d,t.a=f},411:function(e,t,n){"use strict";n.r(t);var c=n(345),i=n(350),r=n(48),o=n(352),a=n(0),s=n(372),l=n(52),u=n(36),d=n(335),b=n(353),p=function(e){var t=e.showCompanyField,n=void 0!==t&&t,c=e.showApartmentField,i=void 0!==c&&c,r=e.showPhoneField,p=void 0!==r&&r,f=e.requireCompanyField,h=void 0!==f&&f,m=e.requirePhoneField,O=void 0!==m&&m,g=Object(o.a)(),v=g.defaultAddressFields,j=g.billingFields,w=g.setBillingFields,k=g.setPhone,y=Object(l.a)().dispatchCheckoutEvent,E=Object(u.a)().isEditor;Object(a.useEffect)((function(){p||k("")}),[p,k]);var P=Object(a.useMemo)((function(){return{company:{hidden:!n,required:h},address_2:{hidden:!i}}}),[n,h,i]),F=E?s.a:a.Fragment;return React.createElement(F,null,React.createElement(d.a,{id:"billing",type:"billing",onChange:function(e){w(e),y("set-billing-address")},values:j,fields:Object.keys(v),fieldConfig:P}),p&&React.createElement(b.a,{isRequired:O,value:j.phone,onChange:function(e){k(e),y("set-phone-number",{step:"billing"})}}))},f=n(4),h=n.n(f),m=n(1),O=n(349);function g(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(e);t&&(c=c.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,c)}return n}function v(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?g(Object(n),!0).forEach((function(t){h()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):g(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var j=v(v({},Object(O.a)({defaultTitle:Object(m.__)("Billing address",'woocommerce'),defaultDescription:Object(m.__)("Enter the address that matches your card or payment method.",'woocommerce')})),{},{lock:{type:"object",default:{move:!0,remove:!0}}}),w=n(219);t.default=Object(c.a)(j)((function(e){var t=e.title,n=e.description,c=e.showStepNumber,a=e.children,s=Object(r.b)().isProcessing,l=Object(o.a)().showBillingFields,u=Object(w.b)(),d=u.requireCompanyField,b=u.requirePhoneField,f=u.showApartmentField,h=u.showCompanyField,m=u.showPhoneField;return l?React.createElement(i.a,{id:"billing-fields",disabled:s,className:"wc-block-checkout__billing-fields",title:t,description:n,showStepNumber:c},React.createElement(p,{requireCompanyField:d,showApartmentField:f,showCompanyField:h,showPhoneField:m,requirePhoneField:b}),a):null}))}}]);woocommerce-blocks/build/checkout-blocks/shipping-address-frontend.js000064400000021724151335517640022154 0ustar00(window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[40],{175:function(e,t,n){"use strict";var c=n(14),i=n.n(c),r=n(23),o=n.n(r),a=n(6),s=n.n(a),l=(n(10),n(248),["children","className","headingLevel"]);t.a=function(e){var t=e.children,n=e.className,c=e.headingLevel,r=o()(e,l),a=s()("wc-block-components-title",n),u="h".concat(c);return React.createElement(u,i()({className:a},r),t)}},248:function(e,t){},345:function(e,t,n){"use strict";var c=n(14),i=n.n(c),r=n(188);t.a=function(e){return function(t){return function(n){var c=Object(r.a)(e,n);return React.createElement(t,i()({},n,c))}}}},346:function(e,t){},347:function(e,t,n){"use strict";var c=n(14),i=n.n(c),r=n(23),o=n.n(r),a=n(24),s=n(6),l=n.n(s),u=(n(348),["className","label","id","instanceId","onChange","children","hasError"]);t.a=Object(a.withInstanceId)((function(e){var t=e.className,n=e.label,c=e.id,r=e.instanceId,a=e.onChange,s=e.children,d=e.hasError,p=void 0!==d&&d,b=o()(e,u),h=c||"checkbox-control-".concat(r);return React.createElement("label",{className:l()("wc-block-components-checkbox",{"has-error":p},t),htmlFor:h},React.createElement("input",i()({id:h,className:"wc-block-components-checkbox__input",type:"checkbox",onChange:function(e){return a(e.target.checked)},"aria-invalid":!0===p},b)),React.createElement("svg",{className:"wc-block-components-checkbox__mark","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 20"},React.createElement("path",{d:"M9 16.2L4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4L9 16.2z"})),n&&React.createElement("span",{className:"wc-block-components-checkbox__label"},n),s)}))},348:function(e,t){},349:function(e,t,n){"use strict";var c=n(1);t.a=function(e){var t=e.defaultTitle,n=void 0===t?Object(c.__)("Step",'woocommerce'):t,i=e.defaultDescription,r=void 0===i?Object(c.__)("Step description text.",'woocommerce'):i,o=e.defaultShowStepNumber;return{title:{type:"string",default:n},description:{type:"string",default:r},showStepNumber:{type:"boolean",default:void 0===o||o}}}},350:function(e,t,n){"use strict";var c=n(6),i=n.n(c),r=(n(10),n(175)),o=(n(346),function(e){var t=e.title,n=e.stepHeadingContent;return React.createElement("div",{className:"wc-block-components-checkout-step__heading"},React.createElement(r.a,{"aria-hidden":"true",className:"wc-block-components-checkout-step__title",headingLevel:"2"},t),!!n&&React.createElement("span",{className:"wc-block-components-checkout-step__heading-content"},n))});t.a=function(e){var t=e.id,n=e.className,c=e.title,r=e.legend,a=e.description,s=e.children,l=e.disabled,u=void 0!==l&&l,d=e.showStepNumber,p=void 0===d||d,b=e.stepHeadingContent,h=void 0===b?function(){}:b,m=r||c?"fieldset":"div";return React.createElement(m,{className:i()(n,"wc-block-components-checkout-step",{"wc-block-components-checkout-step--with-step-number":p,"wc-block-components-checkout-step--disabled":u}),id:t,disabled:u},!(!r&&!c)&&React.createElement("legend",{className:"screen-reader-text"},r||c),!!c&&React.createElement(o,{title:c,stepHeadingContent:h()}),React.createElement("div",{className:"wc-block-components-checkout-step__container"},!!a&&React.createElement("p",{className:"wc-block-components-checkout-step__description"},a),React.createElement("div",{className:"wc-block-components-checkout-step__content"},s)))}},352:function(e,t,n){"use strict";n.d(t,"a",(function(){return b}));var c=n(4),i=n.n(c),r=n(23),o=n.n(r),a=n(2),s=n(0),l=n(66),u=n(60),d=["email"];function p(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(e);t&&(c=c.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,c)}return n}var b=function(){var e=Object(l.b)().needsShipping,t=Object(u.b)(),n=t.billingData,c=t.setBillingData,r=t.shippingAddress,b=t.setShippingAddress,h=t.shippingAsBilling,m=t.setShippingAsBilling,f=Object(s.useRef)(h),g=Object(s.useRef)(n),O=Object(s.useCallback)((function(e){b(e),h&&c(e)}),[h,b,c]),v=Object(s.useCallback)((function(t){c(t),e||b(t)}),[e,b,c]);Object(s.useEffect)((function(){if(f.current!==h){if(h)g.current=n,c(r);else{var e=g.current,t=(e.email,o()(e,d));c(function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?p(Object(n),!0).forEach((function(t){i()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):p(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({},t))}f.current=h}}),[h,c,r,n]);var w=Object(s.useCallback)((function(e){c({email:e})}),[c]),j=Object(s.useCallback)((function(e){c({phone:e})}),[c]),k=Object(s.useCallback)((function(e){O({phone:e})}),[O]);return{defaultAddressFields:a.defaultAddressFields,shippingFields:r,setShippingFields:O,billingFields:n,setBillingFields:v,setEmail:w,setPhone:j,setShippingPhone:k,shippingAsBilling:h,setShippingAsBilling:m,showShippingFields:e,showBillingFields:!e||!f.current}}},353:function(e,t,n){"use strict";var c=n(1),i=n(276);t.a=function(e){var t=e.id,n=void 0===t?"phone":t,r=e.isRequired,o=void 0!==r&&r,a=e.value,s=void 0===a?"":a,l=e.onChange;return React.createElement(i.a,{id:n,type:"tel",autoComplete:"tel",required:o,label:o?Object(c.__)("Phone",'woocommerce'):Object(c.__)("Phone (optional)",'woocommerce'),value:s,onChange:l})}},372:function(e,t,n){"use strict";var c=n(12),i=n(19),r=n(0),o=n(7),a=n(6),s=n.n(a),l=n(37),u=Object(r.createContext)(!1),d=u.Consumer,p=u.Provider,b=["BUTTON","FIELDSET","INPUT","OPTGROUP","OPTION","SELECT","TEXTAREA"];function h(e){var t=e.className,n=e.children,a=Object(i.a)(e,["className","children"]),u=Object(r.useRef)(),d=function(){l.focus.focusable.find(u.current).forEach((function(e){Object(o.includes)(b,e.nodeName)&&e.setAttribute("disabled",""),"A"===e.nodeName&&e.setAttribute("tabindex",-1);var t=e.getAttribute("tabindex");null!==t&&"-1"!==t&&e.removeAttribute("tabindex"),e.hasAttribute("contenteditable")&&e.setAttribute("contenteditable","false")}))},h=Object(r.useCallback)(Object(o.debounce)(d,{leading:!0}),[]);return Object(r.useLayoutEffect)((function(){d();var e=new window.MutationObserver(h);return e.observe(u.current,{childList:!0,attributes:!0,subtree:!0}),function(){e.disconnect(),h.cancel()}}),[]),Object(r.createElement)(p,{value:!0},Object(r.createElement)("div",Object(c.a)({ref:u,className:s()(t,"components-disabled")},a),n))}h.Consumer=d,t.a=h},410:function(e,t,n){"use strict";n.r(t);var c=n(345),i=n(350),r=n(48),o=n(352),a=n(1),s=n(0),l=n(372),u=n(335),d=n(52),p=n(36),b=n(347),h=n(353),m=function(e){var t=e.showCompanyField,n=void 0!==t&&t,c=e.showApartmentField,i=void 0!==c&&c,r=e.showPhoneField,m=void 0!==r&&r,f=e.requireCompanyField,g=void 0!==f&&f,O=e.requirePhoneField,v=void 0!==O&&O,w=Object(o.a)(),j=w.defaultAddressFields,k=w.setShippingFields,E=w.shippingFields,y=w.setShippingAsBilling,_=w.shippingAsBilling,N=w.setShippingPhone,P=Object(d.a)().dispatchCheckoutEvent,R=Object(p.a)().isEditor;Object(s.useEffect)((function(){m||N("")}),[m,N]);var F=Object(s.useMemo)((function(){return{company:{hidden:!n,required:g},address_2:{hidden:!i}}}),[n,g,i]),C=R?l.a:s.Fragment;return React.createElement(React.Fragment,null,React.createElement(C,null,React.createElement(u.a,{id:"shipping",type:"shipping",onChange:function(e){k(e),P("set-shipping-address")},values:E,fields:Object.keys(j),fieldConfig:F}),m&&React.createElement(h.a,{id:"shipping-phone",isRequired:v,value:E.phone,onChange:function(e){N(e),P("set-phone-number",{step:"shipping"})}})),React.createElement(b.a,{className:"wc-block-checkout__use-address-for-billing",label:Object(a.__)("Use same address for billing",'woocommerce'),checked:_,onChange:function(e){return y(e)}}))},f=n(4),g=n.n(f),O=n(349);function v(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(e);t&&(c=c.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,c)}return n}function w(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?v(Object(n),!0).forEach((function(t){g()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):v(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var j=w(w({},Object(O.a)({defaultTitle:Object(a.__)("Shipping address",'woocommerce'),defaultDescription:Object(a.__)("Enter the address where you want your order delivered.",'woocommerce')})),{},{lock:{type:"object",default:{move:!0,remove:!0}}}),k=n(219);t.default=Object(c.a)(j)((function(e){var t=e.title,n=e.description,c=e.showStepNumber,a=e.children,s=Object(r.b)().isProcessing,l=Object(o.a)().showShippingFields,u=Object(k.b)(),d=u.requireCompanyField,p=u.requirePhoneField,b=u.showApartmentField,h=u.showCompanyField,f=u.showPhoneField;return l?React.createElement(i.a,{id:"shipping-fields",disabled:s,className:"wc-block-checkout__shipping-fields",title:t,description:n,showStepNumber:c},React.createElement(m,{requireCompanyField:d,requirePhoneField:p,showApartmentField:b,showCompanyField:h,showPhoneField:f}),a):null}))}}]);woocommerce-blocks/build/checkout-blocks/order-note-frontend.js000064400000010330151335517640020755 0ustar00(window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[37],{175:function(e,t,c){"use strict";var n=c(14),a=c.n(n),o=c(23),s=c.n(o),l=c(6),r=c.n(l),i=(c(10),c(248),["children","className","headingLevel"]);t.a=function(e){var t=e.children,c=e.className,n=e.headingLevel,o=s()(e,i),l=r()("wc-block-components-title",c),d="h".concat(n);return React.createElement(d,a()({className:l},o),t)}},248:function(e,t){},346:function(e,t){},347:function(e,t,c){"use strict";var n=c(14),a=c.n(n),o=c(23),s=c.n(o),l=c(24),r=c(6),i=c.n(r),d=(c(348),["className","label","id","instanceId","onChange","children","hasError"]);t.a=Object(l.withInstanceId)((function(e){var t=e.className,c=e.label,n=e.id,o=e.instanceId,l=e.onChange,r=e.children,u=e.hasError,m=void 0!==u&&u,b=s()(e,d),h=n||"checkbox-control-".concat(o);return React.createElement("label",{className:i()("wc-block-components-checkbox",{"has-error":m},t),htmlFor:h},React.createElement("input",a()({id:h,className:"wc-block-components-checkbox__input",type:"checkbox",onChange:function(e){return l(e.target.checked)},"aria-invalid":!0===m},b)),React.createElement("svg",{className:"wc-block-components-checkbox__mark","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 20"},React.createElement("path",{d:"M9 16.2L4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4L9 16.2z"})),c&&React.createElement("span",{className:"wc-block-components-checkbox__label"},c),r)}))},348:function(e,t){},350:function(e,t,c){"use strict";var n=c(6),a=c.n(n),o=(c(10),c(175)),s=(c(346),function(e){var t=e.title,c=e.stepHeadingContent;return React.createElement("div",{className:"wc-block-components-checkout-step__heading"},React.createElement(o.a,{"aria-hidden":"true",className:"wc-block-components-checkout-step__title",headingLevel:"2"},t),!!c&&React.createElement("span",{className:"wc-block-components-checkout-step__heading-content"},c))});t.a=function(e){var t=e.id,c=e.className,n=e.title,o=e.legend,l=e.description,r=e.children,i=e.disabled,d=void 0!==i&&i,u=e.showStepNumber,m=void 0===u||u,b=e.stepHeadingContent,h=void 0===b?function(){}:b,p=o||n?"fieldset":"div";return React.createElement(p,{className:a()(c,"wc-block-components-checkout-step",{"wc-block-components-checkout-step--with-step-number":m,"wc-block-components-checkout-step--disabled":d}),id:t,disabled:d},!(!o&&!n)&&React.createElement("legend",{className:"screen-reader-text"},o||n),!!n&&React.createElement(s,{title:n,stepHeadingContent:h()}),React.createElement("div",{className:"wc-block-components-checkout-step__container"},!!l&&React.createElement("p",{className:"wc-block-components-checkout-step__description"},l),React.createElement("div",{className:"wc-block-components-checkout-step__content"},r)))}},376:function(e,t){},377:function(e,t){},412:function(e,t,c){"use strict";c.r(t);var n=c(1),a=c(350),o=c(66),s=c(48),l=c(5),r=c.n(l),i=c(0),d=c(347),u=c(6),m=c.n(u),b=c(10),h=c.n(b),p=(c(377),function(e){var t=e.className,c=void 0===t?"":t,n=e.disabled,a=void 0!==n&&n,o=e.onTextChange,s=e.placeholder,l=e.value,r=void 0===l?"":l;return React.createElement("textarea",{className:m()("wc-block-components-textarea",c),disabled:a,onChange:function(e){o(e.target.value)},placeholder:s,rows:2,value:r})});c(376),p.propTypes={onTextChange:h.a.func.isRequired,disabled:h.a.bool,placeholder:h.a.string,value:h.a.string};var k=function(e){var t=e.disabled,c=e.onChange,a=e.placeholder,o=e.value,s=Object(i.useState)(!1),l=r()(s,2),u=l[0],m=l[1],b=Object(i.useState)(""),h=r()(b,2),k=h[0],v=h[1];return React.createElement("div",{className:"wc-block-checkout__add-note"},React.createElement(d.a,{disabled:t,label:Object(n.__)("Add a note to your order",'woocommerce'),checked:u,onChange:function(e){m(e),e?o!==k&&c(k):(c(""),v(o))}}),u&&React.createElement(p,{disabled:t,onTextChange:c,placeholder:a,value:o}))};t.default=function(){var e=Object(o.b)().needsShipping,t=Object(s.b)(),c=t.isProcessing,l=t.orderNotes,r=t.dispatchActions.setOrderNotes;return React.createElement(a.a,{id:"order-notes",showStepNumber:!1,className:"wc-block-checkout__order-notes",disabled:c},React.createElement(k,{disabled:c,onChange:r,placeholder:e?Object(n.__)("Notes about your order, e.g. special notes for delivery.",'woocommerce'):Object(n.__)("Notes about your order.",'woocommerce'),value:l}))}}}]);woocommerce-blocks/build/checkout-blocks/contact-information-frontend.js000064400000027677151335517640022703 0ustar00(window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[34],{175:function(e,t,n){"use strict";var c=n(14),r=n.n(c),a=n(23),o=n.n(a),i=n(6),l=n.n(i),s=(n(10),n(248),["children","className","headingLevel"]);t.a=function(e){var t=e.children,n=e.className,c=e.headingLevel,a=o()(e,s),i=l()("wc-block-components-title",n),u="h".concat(c);return React.createElement(u,r()({className:i},a),t)}},206:function(e,t){},248:function(e,t){},250:function(e,t){},258:function(e,t,n){"use strict";n.d(t,"a",(function(){return r})),n(10);var c=n(127),r=(n(250),function(e){var t=e.errorMessage,n=void 0===t?"":t,r=e.propertyName,a=void 0===r?"":r,o=e.elementId,i=void 0===o?"":o,l=Object(c.b)(),s=l.getValidationError,u=l.getValidationErrorId;if(!n||"string"!=typeof n){var d=s(a)||{};if(!d.message||d.hidden)return null;n=d.message}return React.createElement("div",{className:"wc-block-components-validation-error",role:"alert"},React.createElement("p",{id:u(i)},n))})},276:function(e,t,n){"use strict";var c=n(14),r=n.n(c),a=n(4),o=n.n(a),i=n(5),l=n.n(i),s=n(23),u=n.n(s),d=n(1),b=n(3),p=n(6),f=n.n(p),m=n(127),g=n(48),h=n(258),v=n(24),O=n(49),w=n(0),j=n(51),k=(n(206),["className","id","type","ariaLabel","ariaDescribedBy","label","screenReaderLabel","disabled","help","autoCapitalize","autoComplete","value","onChange","required","onBlur","feedback"]),E=Object(b.forwardRef)((function(e,t){var n=e.className,c=e.id,a=e.type,o=void 0===a?"text":a,i=e.ariaLabel,s=e.ariaDescribedBy,d=e.label,b=e.screenReaderLabel,p=e.disabled,m=e.help,g=e.autoCapitalize,h=void 0===g?"off":g,v=e.autoComplete,O=void 0===v?"off":v,E=e.value,y=void 0===E?"":E,R=e.onChange,_=e.required,N=void 0!==_&&_,C=e.onBlur,P=void 0===C?function(){}:C,S=e.feedback,D=u()(e,k),B=Object(w.useState)(!1),I=l()(B,2),x=I[0],A=I[1];return React.createElement("div",{className:f()("wc-block-components-text-input",n,{"is-active":x||y})},React.createElement("input",r()({type:o,id:c,value:y,ref:t,autoCapitalize:h,autoComplete:O,onChange:function(e){R(e.target.value)},onFocus:function(){return A(!0)},onBlur:function(e){P(e.target.value),A(!1)},"aria-label":i||d,disabled:p,"aria-describedby":m&&!s?c+"__help":s,required:N},D)),React.createElement(j.a,{label:d,screenReaderLabel:b||d,wrapperElement:"label",wrapperProps:{htmlFor:c},htmlFor:c}),!!m&&React.createElement("p",{id:c+"__help",className:"wc-block-components-text-input__help"},m),S)})),y=["className","instanceId","id","ariaDescribedBy","errorId","validateOnMount","focusOnMount","onChange","showError","errorMessage"];t.a=Object(v.withInstanceId)((function(e){var t=e.className,n=e.instanceId,c=e.id,a=e.ariaDescribedBy,i=e.errorId,s=e.validateOnMount,p=void 0===s||s,v=e.focusOnMount,w=void 0!==v&&v,j=e.onChange,k=e.showError,R=void 0===k||k,_=e.errorMessage,N=void 0===_?"":_,C=u()(e,y),P=Object(b.useState)(!0),S=l()(P,2),D=S[0],B=S[1],I=Object(b.useRef)(null),x=Object(m.b)(),A=x.getValidationError,F=x.hideValidationError,L=x.setValidationErrors,M=x.clearValidationError,V=x.getValidationErrorId,q=Object(g.b)().isBeforeProcessing,z=void 0!==c?c:"textinput-"+n,H=void 0!==i?i:z,W=Object(b.useCallback)((function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=I.current||null;if(t){t.value=t.value.trim();var n=t.checkValidity();n?M(H):L(o()({},H,{message:t.validationMessage||Object(d.__)("Invalid value.",'woocommerce'),hidden:e}))}}),[M,H,L]);Object(b.useEffect)((function(){var e;D&&(w&&(null===(e=I.current)||void 0===e||e.focus()),B(!1))}),[w,D,B]),Object(b.useEffect)((function(){D&&(p&&W(),B(!1))}),[D,B,p,W]),Object(b.useEffect)((function(){q&&W()}),[q,W]),Object(b.useEffect)((function(){return function(){M(H)}}),[M,H]);var J=A(H)||{};Object(O.c)(N)&&""!==N&&(J.message=N);var T=J.message&&!J.hidden,G=R&&T&&V(H)?V(H):a;return React.createElement(E,r()({className:f()(t,{"has-error":T}),"aria-invalid":!0===T,id:z,onBlur:function(){W(!1)},feedback:R&&React.createElement(h.a,{errorMessage:N,propertyName:H}),ref:I,onChange:function(e){F(H),j(e)},ariaDescribedBy:G},C))}))},345:function(e,t,n){"use strict";var c=n(14),r=n.n(c),a=n(188);t.a=function(e){return function(t){return function(n){var c=Object(a.a)(e,n);return React.createElement(t,r()({},n,c))}}}},346:function(e,t){},347:function(e,t,n){"use strict";var c=n(14),r=n.n(c),a=n(23),o=n.n(a),i=n(24),l=n(6),s=n.n(l),u=(n(348),["className","label","id","instanceId","onChange","children","hasError"]);t.a=Object(i.withInstanceId)((function(e){var t=e.className,n=e.label,c=e.id,a=e.instanceId,i=e.onChange,l=e.children,d=e.hasError,b=void 0!==d&&d,p=o()(e,u),f=c||"checkbox-control-".concat(a);return React.createElement("label",{className:s()("wc-block-components-checkbox",{"has-error":b},t),htmlFor:f},React.createElement("input",r()({id:f,className:"wc-block-components-checkbox__input",type:"checkbox",onChange:function(e){return i(e.target.checked)},"aria-invalid":!0===b},p)),React.createElement("svg",{className:"wc-block-components-checkbox__mark","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 20"},React.createElement("path",{d:"M9 16.2L4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4L9 16.2z"})),n&&React.createElement("span",{className:"wc-block-components-checkbox__label"},n),l)}))},348:function(e,t){},349:function(e,t,n){"use strict";var c=n(1);t.a=function(e){var t=e.defaultTitle,n=void 0===t?Object(c.__)("Step",'woocommerce'):t,r=e.defaultDescription,a=void 0===r?Object(c.__)("Step description text.",'woocommerce'):r,o=e.defaultShowStepNumber;return{title:{type:"string",default:n},description:{type:"string",default:a},showStepNumber:{type:"boolean",default:void 0===o||o}}}},350:function(e,t,n){"use strict";var c=n(6),r=n.n(c),a=(n(10),n(175)),o=(n(346),function(e){var t=e.title,n=e.stepHeadingContent;return React.createElement("div",{className:"wc-block-components-checkout-step__heading"},React.createElement(a.a,{"aria-hidden":"true",className:"wc-block-components-checkout-step__title",headingLevel:"2"},t),!!n&&React.createElement("span",{className:"wc-block-components-checkout-step__heading-content"},n))});t.a=function(e){var t=e.id,n=e.className,c=e.title,a=e.legend,i=e.description,l=e.children,s=e.disabled,u=void 0!==s&&s,d=e.showStepNumber,b=void 0===d||d,p=e.stepHeadingContent,f=void 0===p?function(){}:p,m=a||c?"fieldset":"div";return React.createElement(m,{className:r()(n,"wc-block-components-checkout-step",{"wc-block-components-checkout-step--with-step-number":b,"wc-block-components-checkout-step--disabled":u}),id:t,disabled:u},!(!a&&!c)&&React.createElement("legend",{className:"screen-reader-text"},a||c),!!c&&React.createElement(o,{title:c,stepHeadingContent:f()}),React.createElement("div",{className:"wc-block-components-checkout-step__container"},!!i&&React.createElement("p",{className:"wc-block-components-checkout-step__description"},i),React.createElement("div",{className:"wc-block-components-checkout-step__content"},l)))}},352:function(e,t,n){"use strict";n.d(t,"a",(function(){return p}));var c=n(4),r=n.n(c),a=n(23),o=n.n(a),i=n(2),l=n(0),s=n(66),u=n(60),d=["email"];function b(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(e);t&&(c=c.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,c)}return n}var p=function(){var e=Object(s.b)().needsShipping,t=Object(u.b)(),n=t.billingData,c=t.setBillingData,a=t.shippingAddress,p=t.setShippingAddress,f=t.shippingAsBilling,m=t.setShippingAsBilling,g=Object(l.useRef)(f),h=Object(l.useRef)(n),v=Object(l.useCallback)((function(e){p(e),f&&c(e)}),[f,p,c]),O=Object(l.useCallback)((function(t){c(t),e||p(t)}),[e,p,c]);Object(l.useEffect)((function(){if(g.current!==f){if(f)h.current=n,c(a);else{var e=h.current,t=(e.email,o()(e,d));c(function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?b(Object(n),!0).forEach((function(t){r()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):b(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({},t))}g.current=f}}),[f,c,a,n]);var w=Object(l.useCallback)((function(e){c({email:e})}),[c]),j=Object(l.useCallback)((function(e){c({phone:e})}),[c]),k=Object(l.useCallback)((function(e){v({phone:e})}),[v]);return{defaultAddressFields:i.defaultAddressFields,shippingFields:a,setShippingFields:v,billingFields:n,setBillingFields:O,setEmail:w,setPhone:j,setShippingPhone:k,shippingAsBilling:f,setShippingAsBilling:m,showShippingFields:e,showBillingFields:!e||!g.current}}},408:function(e,t,n){"use strict";n.r(t);var c=n(345),r=n(350),a=n(48),o=n(1),i=n(276),l=n(352),s=n(52),u=n(2),d=n(347),b=function(e){var t=e.allowCreateAccount,n=Object(a.b)(),c=n.customerId,r=n.shouldCreateAccount,b=n.setShouldCreateAccount,p=Object(l.a)(),f=p.billingFields,m=p.setEmail,g=Object(s.a)().dispatchCheckoutEvent,h=!c&&t&&Object(u.getSetting)("checkoutAllowsGuest",!1)&&Object(u.getSetting)("checkoutAllowsSignup",!1)&&React.createElement(d.a,{className:"wc-block-checkout__create-account",label:Object(o.__)("Create an account?",'woocommerce'),checked:r,onChange:function(e){return b(e)}});return React.createElement(React.Fragment,null,React.createElement(i.a,{id:"email",type:"email",label:Object(o.__)("Email address",'woocommerce'),value:f.email,autoComplete:"email",onChange:function(e){m(e),g("set-email-address")},required:!0}),h)},p=n(4),f=n.n(p),m=n(349);function g(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(e);t&&(c=c.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,c)}return n}function h(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?g(Object(n),!0).forEach((function(t){f()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):g(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var v=h(h({},Object(m.a)({defaultTitle:Object(o.__)("Contact information",'woocommerce'),defaultDescription:Object(o.__)("We'll use this email to send you details and updates about your order.",'woocommerce')})),{},{lock:{type:"object",default:{remove:!0,move:!0}}}),O=n(83),w="".concat(O.e,"?redirect_to=").concat(encodeURIComponent(window.location.href)),j=function(){var e=Object(a.b)().customerId;return!Object(u.getSetting)("checkoutShowLoginReminder",!0)||e?null:React.createElement(React.Fragment,null,Object(o.__)("Already have an account? ",'woocommerce'),React.createElement("a",{href:w},Object(o.__)("Log in.",'woocommerce')))},k=n(219);t.default=Object(c.a)(v)((function(e){var t=e.title,n=e.description,c=e.showStepNumber,o=e.children,i=Object(a.b)().isProcessing,l=Object(k.b)().allowCreateAccount;return React.createElement(r.a,{id:"contact-fields",disabled:i,className:"wc-block-checkout__contact-fields",title:t,description:n,showStepNumber:c,stepHeadingContent:function(){return React.createElement(j,null)}},React.createElement(b,{allowCreateAccount:l}),o)}))},51:function(e,t,n){"use strict";var c=n(4),r=n.n(c),a=n(0),o=n(6),i=n.n(o);function l(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(e);t&&(c=c.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,c)}return n}function s(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?l(Object(n),!0).forEach((function(t){r()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):l(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}t.a=function(e){var t,n=e.label,c=e.screenReaderLabel,r=e.wrapperElement,o=e.wrapperProps,l=void 0===o?{}:o,u=null!=n,d=null!=c;return!u&&d?(t=r||"span",l=s(s({},l),{},{className:i()(l.className,"screen-reader-text")}),React.createElement(t,l,c)):(t=r||a.Fragment,u&&d&&n!==c?React.createElement(t,l,React.createElement("span",{"aria-hidden":"true"},n),React.createElement("span",{className:"screen-reader-text"},c)):React.createElement(t,l,n))}}}]);woocommerce-blocks/build/checkout-blocks/actions-frontend.js000064400000007143151335517640020347 0ustar00(window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[32],{138:function(e,t,n){"use strict";n(180),t.a=function(){return React.createElement("span",{className:"wc-block-components-spinner","aria-hidden":"true"})}},143:function(e,t,n){"use strict";var c=n(14),a=n.n(c),r=n(23),o=n.n(r),i=n(76),s=n(6),u=n.n(s),l=n(138),m=(n(251),["className","showSpinner","children"]);t.a=function(e){var t=e.className,n=e.showSpinner,c=void 0!==n&&n,r=e.children,s=o()(e,m),b=u()("wc-block-components-button",t,{"wc-block-components-button--loading":c});return React.createElement(i.a,a()({className:b},s),c&&React.createElement(l.a,null),React.createElement("span",{className:"wc-block-components-button__text"},r))}},180:function(e,t){},187:function(e,t,n){"use strict";n.d(t,"b",(function(){return o})),n.d(t,"a",(function(){return i}));var c=n(53),a=n(173),r=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=Object(a.b)(),n=t.paymentMethods,r=t.expressPaymentMethods,o=t.paymentMethodsInitialized,i=t.expressPaymentMethodsInitialized,s=Object(c.a)(n),u=Object(c.a)(r);return{paymentMethods:e?u:s,isInitialized:e?i:o}},o=function(){return r(!1)},i=function(){return r(!0)}},251:function(e,t){},345:function(e,t,n){"use strict";var c=n(14),a=n.n(c),r=n(188);t.a=function(e){return function(t){return function(n){var c=Object(r.a)(e,n);return React.createElement(t,a()({},n,c))}}}},369:function(e,t,n){"use strict";var c=n(34),a=React.createElement(c.SVG,{xmlns:"http://www.w3.org/2000/SVG",viewBox:"0 0 24 24"},React.createElement("path",{fill:"none",d:"M0 0h24v24H0z"}),React.createElement("path",{d:"M9 16.2L4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4L9 16.2z"}));t.a=a},379:function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var c=n(1),a=n(48),r=n(173),o=n(187),i=function(){var e=Object(a.b)(),t=e.onSubmit,n=e.isCalculating,i=e.isBeforeProcessing,s=e.isProcessing,u=e.isAfterProcessing,l=e.isComplete,m=e.hasError,b=Object(o.b)().paymentMethods,d=void 0===b?{}:b,p=Object(r.b)(),w=p.activePaymentMethod,f=p.currentStatus,h=d[w]||{},g=s||u||i,v=l&&!m;return{submitButtonText:(null==h?void 0:h.placeOrderButtonLabel)||Object(c.__)("Place Order",'woocommerce'),onSubmit:t,isCalculating:n,isDisabled:s||f.isDoingExpressPayment,waitingForProcessing:g,waitingForRedirect:v}}},380:function(e,t){},381:function(e,t){},406:function(e,t,n){"use strict";n.r(t);var c=n(345),a=n(2),r=n(1),o=n(83),i=n(152),s=n(34),u=React.createElement(s.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"24",height:"24",fill:"currentColor"},React.createElement("path",{d:"M20 11H7.8l5.6-5.6L12 4l-8 8 8 8 1.4-1.4L7.8 13H20v-2z"})),l=(n(381),function(e){var t=e.link;return React.createElement("a",{href:t||o.c,className:"wc-block-components-checkout-return-to-cart-button"},React.createElement(i.a,{srcElement:u}),Object(r.__)("Return to Cart",'woocommerce'))}),m=n(379),b=n(369),d=n(143),p=function(){var e=Object(m.a)(),t=e.submitButtonText,n=e.onSubmit,c=e.isCalculating,a=e.isDisabled,o=e.waitingForProcessing,s=e.waitingForRedirect;return React.createElement(d.a,{className:"wc-block-components-checkout-place-order-button",onClick:n,disabled:c||a||o||s,showSpinner:o},s?React.createElement(i.a,{srcElement:b.a,alt:Object(r.__)("Done",'woocommerce')}):t)},w=(n(380),function(e){var t=e.cartPageId,n=e.showReturnToCart;return React.createElement("div",{className:"wc-block-checkout__actions"},n&&React.createElement(l,{link:Object(a.getSetting)("page-"+t,!1)}),React.createElement(p,null))});t.default=Object(c.a)({cartPageId:{type:"number",default:0},showReturnToCart:{type:"boolean",default:!0},lock:{type:"object",default:{move:!0,remove:!0}}})(w)}}]);woocommerce-blocks/build/checkout-blocks/payment-frontend.js000064400000040473151335517640020367 0ustar00(window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[39],{174:function(e,t,c){"use strict";t.a=function(e){var t=e.label,c=e.secondaryLabel,n=e.description,o=e.secondaryDescription,a=e.id;return React.createElement("div",{className:"wc-block-components-radio-control__option-layout"},React.createElement("div",{className:"wc-block-components-radio-control__label-group"},t&&React.createElement("span",{id:a&&"".concat(a,"__label"),className:"wc-block-components-radio-control__label"},t),c&&React.createElement("span",{id:a&&"".concat(a,"__secondary-label"),className:"wc-block-components-radio-control__secondary-label"},c)),React.createElement("div",{className:"wc-block-components-radio-control__description-group"},n&&React.createElement("span",{id:a&&"".concat(a,"__description"),className:"wc-block-components-radio-control__description"},n),o&&React.createElement("span",{id:a&&"".concat(a,"__secondary-description"),className:"wc-block-components-radio-control__secondary-description"},o)))}},175:function(e,t,c){"use strict";var n=c(14),o=c.n(n),a=c(23),r=c.n(a),s=c(6),l=c.n(s),i=(c(10),c(248),["children","className","headingLevel"]);t.a=function(e){var t=e.children,c=e.className,n=e.headingLevel,a=r()(e,i),s=l()("wc-block-components-title",c),m="h".concat(n);return React.createElement(m,o()({className:s},a),t)}},179:function(e,t,c){"use strict";var n=c(4),o=c.n(n),a=c(6),r=c.n(a),s=c(174);t.a=function(e){var t,c=e.checked,n=e.name,a=e.onChange,l=e.option,i=l.value,m=l.label,u=l.description,d=l.secondaryLabel,p=l.secondaryDescription;return React.createElement("label",{className:r()("wc-block-components-radio-control__option",{"wc-block-components-radio-control__option-checked":c}),htmlFor:"".concat(n,"-").concat(i)},React.createElement("input",{id:"".concat(n,"-").concat(i),className:"wc-block-components-radio-control__input",type:"radio",name:n,value:i,onChange:function(e){return a(e.target.value)},checked:c,"aria-describedby":r()((t={},o()(t,"".concat(n,"-").concat(i,"__label"),m),o()(t,"".concat(n,"-").concat(i,"__secondary-label"),d),o()(t,"".concat(n,"-").concat(i,"__description"),u),o()(t,"".concat(n,"-").concat(i,"__secondary-description"),p),t))}),React.createElement(s.a,{id:"".concat(n,"-").concat(i),label:m,secondaryLabel:d,description:u,secondaryDescription:p}))}},207:function(e,t,c){"use strict";var n=c(6),o=c.n(n),a=c(24),r=c(179);c(252),t.a=Object(a.withInstanceId)((function(e){var t=e.className,c=e.instanceId,n=e.id,a=e.selected,s=e.onChange,l=e.options,i=void 0===l?[]:l,m=n||c;return i.length&&React.createElement("div",{className:o()("wc-block-components-radio-control",t)},i.map((function(e){return React.createElement(r.a,{key:"".concat(m,"-").concat(e.value),name:"radio-control-".concat(m),checked:e.value===a,option:e,onChange:function(t){s(t),"function"==typeof e.onChange&&e.onChange(t)}})})))}))},248:function(e,t){},252:function(e,t){},345:function(e,t,c){"use strict";var n=c(14),o=c.n(n),a=c(188);t.a=function(e){return function(t){return function(c){var n=Object(a.a)(e,c);return React.createElement(t,o()({},c,n))}}}},346:function(e,t){},347:function(e,t,c){"use strict";var n=c(14),o=c.n(n),a=c(23),r=c.n(a),s=c(24),l=c(6),i=c.n(l),m=(c(348),["className","label","id","instanceId","onChange","children","hasError"]);t.a=Object(s.withInstanceId)((function(e){var t=e.className,c=e.label,n=e.id,a=e.instanceId,s=e.onChange,l=e.children,u=e.hasError,d=void 0!==u&&u,p=r()(e,m),b=n||"checkbox-control-".concat(a);return React.createElement("label",{className:i()("wc-block-components-checkbox",{"has-error":d},t),htmlFor:b},React.createElement("input",o()({id:b,className:"wc-block-components-checkbox__input",type:"checkbox",onChange:function(e){return s(e.target.checked)},"aria-invalid":!0===d},p)),React.createElement("svg",{className:"wc-block-components-checkbox__mark","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 20"},React.createElement("path",{d:"M9 16.2L4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4L9 16.2z"})),c&&React.createElement("span",{className:"wc-block-components-checkbox__label"},c),l)}))},348:function(e,t){},349:function(e,t,c){"use strict";var n=c(1);t.a=function(e){var t=e.defaultTitle,c=void 0===t?Object(n.__)("Step",'woocommerce'):t,o=e.defaultDescription,a=void 0===o?Object(n.__)("Step description text.",'woocommerce'):o,r=e.defaultShowStepNumber;return{title:{type:"string",default:c},description:{type:"string",default:a},showStepNumber:{type:"boolean",default:void 0===r||r}}}},350:function(e,t,c){"use strict";var n=c(6),o=c.n(n),a=(c(10),c(175)),r=(c(346),function(e){var t=e.title,c=e.stepHeadingContent;return React.createElement("div",{className:"wc-block-components-checkout-step__heading"},React.createElement(a.a,{"aria-hidden":"true",className:"wc-block-components-checkout-step__title",headingLevel:"2"},t),!!c&&React.createElement("span",{className:"wc-block-components-checkout-step__heading-content"},c))});t.a=function(e){var t=e.id,c=e.className,n=e.title,a=e.legend,s=e.description,l=e.children,i=e.disabled,m=void 0!==i&&i,u=e.showStepNumber,d=void 0===u||u,p=e.stepHeadingContent,b=void 0===p?function(){}:p,h=a||n?"fieldset":"div";return React.createElement(h,{className:o()(c,"wc-block-components-checkout-step",{"wc-block-components-checkout-step--with-step-number":d,"wc-block-components-checkout-step--disabled":m}),id:t,disabled:m},!(!a&&!n)&&React.createElement("legend",{className:"screen-reader-text"},a||n),!!n&&React.createElement(r,{title:n,stepHeadingContent:b()}),React.createElement("div",{className:"wc-block-components-checkout-step__container"},!!s&&React.createElement("p",{className:"wc-block-components-checkout-step__description"},s),React.createElement("div",{className:"wc-block-components-checkout-step__content"},l)))}},355:function(e,t,c){"use strict";var n=c(12),o=c(22),a=c(19),r=c(0),s=c(6),l=c.n(s),i=c(24),m=c(91);t.a=function(e){var t,c=e.icon,s=e.children,u=e.label,d=e.instructions,p=e.className,b=e.notices,h=e.preview,v=e.isColumnLayout,f=Object(a.a)(e,["icon","children","label","instructions","className","notices","preview","isColumnLayout"]),y=Object(i.useResizeObserver)(),O=Object(o.a)(y,2),w=O[0],g=O[1].width;"number"==typeof g&&(t={"is-large":g>=320,"is-medium":g>=160&&g<320,"is-small":g<160});var k=l()("components-placeholder",p,t),j=l()("components-placeholder__fieldset",{"is-column-layout":v});return Object(r.createElement)("div",Object(n.a)({},f,{className:k}),w,b,h&&Object(r.createElement)("div",{className:"components-placeholder__preview"},h),Object(r.createElement)("div",{className:"components-placeholder__label"},Object(r.createElement)(m.a,{icon:c}),u),!!d&&Object(r.createElement)("div",{className:"components-placeholder__instructions"},d),Object(r.createElement)("div",{className:j},s))}},375:function(e,t){},405:function(e,t,c){"use strict";c.r(t);var n=c(32),o=c(35),a=c(345),r=c(350),s=c(48),l=c(103),i=c(187),m=c(1),u=c(51),d=c(173),p=c(355),b=c(76),h=c(153),v=c(152),f=c(339),y=c(2),O=c(36),w=c(6),g=c.n(w),k=(c(375),function(){return React.createElement(p.a,{icon:React.createElement(v.a,{srcElement:f.a}),label:Object(m.__)("Payment methods",'woocommerce'),className:"wc-block-checkout__no-payment-methods-placeholder"},React.createElement("span",{className:"wc-block-checkout__no-payment-methods-placeholder-description"},Object(m.__)("Your store does not have any payment methods configured that support the checkout block. Once you have configured a compatible payment method (e.g. Stripe) it will be shown here.",'woocommerce')),React.createElement(b.a,{isSecondary:!0,href:"".concat(y.ADMIN_URL,"admin.php?page=wc-settings&tab=checkout"),target:"_blank",rel:"noopener noreferrer"},Object(m.__)("Configure Payment Methods",'woocommerce')))}),j=function(){return React.createElement(h.a,{isDismissible:!1,className:g()("wc-block-checkout__no-payment-methods-notice","woocommerce-message","woocommerce-error")},Object(m.__)("There are no payment methods available. This may be an error on our side. Please contact us if you need any help placing your order.",'woocommerce'))},_=function(){return Object(O.a)().isEditor?React.createElement(k,null):React.createElement(j,null)},E=c(4),R=c.n(E),N=c(23),P=c.n(N),S=c(318),C=c(54),D=c(0),M=c(21),x=c.n(M),I=c(24),T=c(179),L=Object(I.withInstanceId)((function(e){var t=e.className,c=e.instanceId,n=e.id,o=e.selected,a=e.onChange,r=e.options,s=void 0===r?[]:r,l=n||c;return s.length&&React.createElement("div",{className:g()("wc-block-components-radio-control",t)},s.map((function(e){var t="object"===x()(e)&&"content"in e,c=e.value===o;return React.createElement("div",{className:"wc-block-components-radio-control-accordion-option",key:e.value},React.createElement(T.a,{name:"radio-control-".concat(l),checked:c,option:e,onChange:function(t){a(t),"function"==typeof e.onChange&&e.onChange(t)}}),t&&c&&React.createElement("div",{className:g()("wc-block-components-radio-control-accordion-content",{"wc-block-components-radio-control-accordion-content-hide":!c})},e.content))})))})),A=c(347),F=(c(10),c(213)),B=function(e){var t=e.children,c=e.showSaveOption,n=Object(O.a)().isEditor,o=Object(d.b)(),a=o.shouldSavePayment,r=o.setShouldSavePayment,l=Object(s.b)().customerId;return React.createElement(F.a,{isEditor:n},t,l>0&&c&&React.createElement(A.a,{className:"wc-block-components-payment-methods__save-card-info",label:Object(m.__)("Save payment information to my account for future purchases.",'woocommerce'),checked:a,onChange:function(){return r(!a)}}))},Y=["activePaymentMethod"];function z(e,t){var c=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),c.push.apply(c,n)}return c}function H(e){for(var t=1;t<arguments.length;t++){var c=null!=arguments[t]?arguments[t]:{};t%2?z(Object(c),!0).forEach((function(t){R()(e,t,c[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(c)):z(Object(c)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(c,t))}))}return e}var $=function(){var e=Object(d.b)(),t=e.setActivePaymentMethod,c=e.activeSavedToken,n=e.setActiveSavedToken,a=e.isExpressPaymentMethodActive,r=e.customerPaymentMethods,s=Object(i.b)().paymentMethods,l=Object(S.a)(),m=l.activePaymentMethod,u=P()(l,Y),p=Object(o.c)().noticeContexts,b=Object(C.a)().removeNotice,h=Object(O.a)().isEditor,v=Object.keys(s).map((function(e){var t=s[e],c=t.edit,n=t.content,o=t.label,a=t.supports,r=h?c:n;return{value:e,label:"string"==typeof o?o:Object(D.cloneElement)(o,{components:u.components}),name:"wc-saved-payment-method-token-".concat(e),content:React.createElement(B,{showSaveOption:a.showSaveOption},Object(D.cloneElement)(r,H({activePaymentMethod:m},u)))}})),f=0===Object.keys(r).length&&1===Object.keys(s).length,y=g()({"disable-radio-control":f});return a?null:React.createElement(L,{id:"wc-payment-method-options",className:y,selected:c?null:m,onChange:function(e){t(e),n(""),b("wc-payment-error",p.PAYMENTS)},options:v})},J=c(207),U=c(38);function W(e,t){var c=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),c.push.apply(c,n)}return c}var q=function(){var e,t,c=Object(d.b)(),n=c.setPaymentStatus,o=c.customerPaymentMethods,a=c.activePaymentMethod,r=c.setActivePaymentMethod,s=c.activeSavedToken,l=c.setActiveSavedToken,u=Object(U.getPaymentMethods)(),p=Object(i.b)().paymentMethods,b=Object(S.a)(),h=Object(D.useRef)([]),v=Object(D.useCallback)((function(e){l(e)}),[l]);Object(D.useEffect)((function(){var e=Object.keys(o).flatMap((function(e){return o[e].map((function(t){var c="cc"===e||"echeck"===e?function(e,t,c){var n=e.method,o=e.expires,a=e.tokenId;return{value:a+"",label:Object(m.sprintf)(
/* translators: %1$s is referring to the payment method brand, %2$s is referring to the last 4 digits of the payment card, %3$s is referring to the expiry date.  */
Object(m.__)("%1$s ending in %2$s (expires %3$s)","woo-gutenberg-product-blocks"),n.brand,n.last4,o),name:"wc-saved-payment-method-token-".concat(a),onChange:function(e){var o,a="wc-".concat(n.gateway,"-payment-token");t(n.gateway),c().started((o={payment_method:n.gateway},R()(o,a,e+""),R()(o,"isSavedToken",!0),o))}}}(t,r,n):function(e,t,c){var n=e.method,o=e.tokenId;return{value:o+"",label:Object(m.sprintf)(
/* translators: %s is the name of the payment method gateway. */
Object(m.__)("Saved token for %s",'woocommerce'),n.gateway),name:"wc-saved-payment-method-token-".concat(o),onChange:function(e){var o,a="wc-".concat(n.gateway,"-payment-token");t(n.gateway),c().started((o={payment_method:n.gateway},R()(o,a,e+""),R()(o,"isSavedToken",!0),o))}}}(t,r,n);return!a&&t.is_default&&""===s&&(v(t.tokenId+""),c.onChange(t.tokenId)),c}))})).filter(Boolean);h.current=e}),[o,v,s,a,r,n,u]);var f=s&&p[a]&&null!==(e=p[a])&&void 0!==e&&e.savedTokenComponent?Object(D.cloneElement)(null===(t=p[a])||void 0===t?void 0:t.savedTokenComponent,function(e){for(var t=1;t<arguments.length;t++){var c=null!=arguments[t]?arguments[t]:{};t%2?W(Object(c),!0).forEach((function(t){R()(e,t,c[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(c)):W(Object(c)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(c,t))}))}return e}({token:s},b)):null;return h.current.length>0?React.createElement(React.Fragment,null,React.createElement(J.a,{id:"wc-payment-method-saved-tokens",selected:s,onChange:v,options:h.current}),f):null},G=function(){var e=Object(i.b)(),t=e.isInitialized,c=e.paymentMethods,n=Object(d.b)().customerPaymentMethods;return t&&0===Object.keys(c).length?React.createElement(_,null):React.createElement(React.Fragment,null,React.createElement(q,null),Object.keys(n).length>0&&React.createElement(u.a,{label:Object(m.__)("Use another payment method.",'woocommerce'),screenReaderLabel:Object(m.__)("Other available payment methods",'woocommerce'),wrapperElement:"p",wrapperProps:{className:["wc-block-components-checkout-step__description wc-block-components-checkout-step__description-payments-aligned"]}}),React.createElement($,null))},K=function(){var e=Object(o.c)().noticeContexts;return React.createElement(l.a,{context:e.PAYMENTS},React.createElement(G,null))},Q=c(349);function V(e,t){var c=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),c.push.apply(c,n)}return c}function X(e){for(var t=1;t<arguments.length;t++){var c=null!=arguments[t]?arguments[t]:{};t%2?V(Object(c),!0).forEach((function(t){R()(e,t,c[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(c)):V(Object(c)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(c,t))}))}return e}var Z=X(X({},Object(Q.a)({defaultTitle:Object(m.__)("Payment options",'woocommerce'),defaultDescription:""})),{},{lock:{type:"object",default:{move:!0,remove:!0}}});t.default=Object(a.a)(Z)((function(e){var t=e.title,c=e.description,a=e.showStepNumber,i=e.children,m=Object(s.b)().isProcessing,u=Object(n.a)().cartNeedsPayment,d=Object(o.c)().noticeContexts;return u?React.createElement(r.a,{id:"payment-method",disabled:m,className:"wc-block-checkout__payment-method",title:t,description:c,showStepNumber:a},React.createElement(l.a,{context:d.PAYMENTS},React.createElement(K,null)),i):null}))},51:function(e,t,c){"use strict";var n=c(4),o=c.n(n),a=c(0),r=c(6),s=c.n(r);function l(e,t){var c=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),c.push.apply(c,n)}return c}function i(e){for(var t=1;t<arguments.length;t++){var c=null!=arguments[t]?arguments[t]:{};t%2?l(Object(c),!0).forEach((function(t){o()(e,t,c[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(c)):l(Object(c)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(c,t))}))}return e}t.a=function(e){var t,c=e.label,n=e.screenReaderLabel,o=e.wrapperElement,r=e.wrapperProps,l=void 0===r?{}:r,m=null!=c,u=null!=n;return!m&&u?(t=o||"span",l=i(i({},l),{},{className:s()(l.className,"screen-reader-text")}),React.createElement(t,l,n)):(t=o||a.Fragment,m&&u&&c!==n?React.createElement(t,l,React.createElement("span",{"aria-hidden":"true"},c),React.createElement("span",{className:"screen-reader-text"},n)):React.createElement(t,l,c))}}}]);woocommerce-blocks/build/checkout-blocks/totals-frontend.js000064400000000722151335517640020211 0ustar00(window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[43],{331:function(c,e,n){"use strict";var a=n(6),t=n.n(a);n(10),e.a=function(c){var e=c.children,n=c.className;return React.createElement("div",{className:t()("wc-block-components-sidebar",n)},e)}},382:function(c,e){},396:function(c,e,n){"use strict";n.r(e);var a=n(331);n(382),e.default=function(c){var e=c.children;return React.createElement(a.a,{className:"wc-block-checkout__sidebar"},e)}}}]);woocommerce-blocks/build/checkout-frontend.js000064400000570376151335517640015451 0ustar00!function(e){function t(t){for(var r,o,i=t[0],c=t[1],a=0,u=[];a<i.length;a++)o=i[a],Object.prototype.hasOwnProperty.call(n,o)&&n[o]&&u.push(n[o][0]),n[o]=0;for(r in c)Object.prototype.hasOwnProperty.call(c,r)&&(e[r]=c[r]);for(s&&s(t);u.length;)u.shift()()}var r={},n={31:0};function o(t){if(r[t])return r[t].exports;var n=r[t]={i:t,l:!1,exports:{}};return e[t].call(n.exports,n,n.exports,o),n.l=!0,n.exports}o.e=function(e){var t=[],r=n[e];if(0!==r)if(r)t.push(r[2]);else{var i=new Promise((function(t,o){r=n[e]=[t,o]}));t.push(r[2]=i);var c,a=document.createElement("script");a.charset="utf-8",a.timeout=120,o.nc&&a.setAttribute("nonce",o.nc),a.src=function(e){return o.p+""+({0:"vendors--atomic-block-components/add-to-cart--cart-blocks/order-summary--checkout-blocks/billing-ad--c5eb4dcd",1:"vendors--atomic-block-components/price--cart-blocks/line-items--cart-blocks/order-summary--checkout--8a3571de",2:"vendors--cart-blocks/order-summary--checkout-blocks/billing-address--checkout-blocks/order-summary---eb4d2cec",3:"cart-blocks/express-payment--checkout-blocks/express-payment--checkout-blocks/payment",4:"cart-blocks/order-summary--checkout-blocks/billing-address--checkout-blocks/shipping-address",5:"vendors--cart-blocks/line-items--checkout-blocks/order-summary",32:"checkout-blocks/actions",33:"checkout-blocks/billing-address",34:"checkout-blocks/contact-information",35:"checkout-blocks/express-payment",36:"checkout-blocks/fields",37:"checkout-blocks/order-note",38:"checkout-blocks/order-summary",39:"checkout-blocks/payment",40:"checkout-blocks/shipping-address",41:"checkout-blocks/shipping-methods",42:"checkout-blocks/terms",43:"checkout-blocks/totals"}[e]||e)+"-frontend.js"}(e);var s=new Error;c=function(t){a.onerror=a.onload=null,clearTimeout(u);var r=n[e];if(0!==r){if(r){var o=t&&("load"===t.type?"missing":t.type),i=t&&t.target&&t.target.src;s.message="Loading chunk "+e+" failed.\n("+o+": "+i+")",s.name="ChunkLoadError",s.type=o,s.request=i,r[1](s)}n[e]=void 0}};var u=setTimeout((function(){c({type:"timeout",target:a})}),12e4);a.onerror=a.onload=c,document.head.appendChild(a)}return Promise.all(t)},o.m=e,o.c=r,o.d=function(e,t,r){o.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},o.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.t=function(e,t){if(1&t&&(e=o(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(o.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)o.d(r,n,function(t){return e[t]}.bind(null,n));return r},o.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(t,"a",t),t},o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},o.p="",o.oe=function(e){throw console.error(e),e};var i=window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[],c=i.push.bind(i);i.push=t,i=i.slice();for(var a=0;a<i.length;a++)t(i[a]);var s=c;o(o.s=303)}([function(e,t){e.exports=window.wp.element},function(e,t){e.exports=window.wp.i18n},function(e,t){e.exports=window.wc.wcSettings},function(e,t){e.exports=window.React},function(e,t){e.exports=function(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,r){var n=r(84),o=r(85),i=r(67),c=r(86);e.exports=function(e,t){return n(e)||o(e,t)||i(e,t)||c()},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,r){var n;!function(){"use strict";var r={}.hasOwnProperty;function o(){for(var e=[],t=0;t<arguments.length;t++){var n=arguments[t];if(n){var i=typeof n;if("string"===i||"number"===i)e.push(n);else if(Array.isArray(n)){if(n.length){var c=o.apply(null,n);c&&e.push(c)}}else if("object"===i)if(n.toString===Object.prototype.toString)for(var a in n)r.call(n,a)&&n[a]&&e.push(a);else e.push(n.toString())}}return e.join(" ")}e.exports?(o.default=o,e.exports=o):void 0===(n=function(){return o}.apply(t,[]))||(e.exports=n)}()},function(e,t){e.exports=window.lodash},function(e,t){e.exports=window.wc.wcBlocksData},function(e,t,r){"use strict";function n(e){return(n=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}r.d(t,"a",(function(){return n}))},function(e,t,r){e.exports=r(79)()},function(e,t){e.exports=window.wp.data},function(e,t,r){"use strict";function n(){return(n=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}r.d(t,"a",(function(){return n}))},function(e,t,r){"use strict";function n(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}r.d(t,"a",(function(){return n}))},function(e,t){function r(){return e.exports=r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},e.exports.default=e.exports,e.exports.__esModule=!0,r.apply(this,arguments)}e.exports=r,e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}r.d(t,"a",(function(){return n}))},function(e,t,r){"use strict";function n(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function o(e,t,r){return t&&n(e.prototype,t),r&&n(e,r),e}r.d(t,"a",(function(){return o}))},function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));var n=r(88);function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Object(n.a)(e,t)}},function(e,t,r){"use strict";r.d(t,"a",(function(){return c}));var n=r(21),o=r.n(n),i=r(13);function c(e,t){return!t||"object"!==o()(t)&&"function"!=typeof t?Object(i.a)(e):t}},function(e,t,r){"use strict";function n(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}r.d(t,"a",(function(){return n}))},function(e,t,r){"use strict";function n(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}r.d(t,"a",(function(){return n}))},function(e,t){function r(t){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?(e.exports=r=function(e){return typeof e},e.exports.default=e.exports,e.exports.__esModule=!0):(e.exports=r=function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.default=e.exports,e.exports.__esModule=!0),r(t)}e.exports=r,e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));var n=r(65);function o(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,i=[],_n=!0,c=!1;try{for(r=r.call(e);!(_n=(n=r.next()).done)&&(i.push(n.value),!t||i.length!==t);_n=!0);}catch(e){c=!0,o=e}finally{try{_n||null==r.return||r.return()}finally{if(c)throw o}}return i}}(e,t)||Object(n.a)(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}},function(e,t,r){var n=r(77);e.exports=function(e,t){if(null==e)return{};var r,o,i=n(e,t);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(e);for(o=0;o<c.length;o++)r=c[o],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=window.wp.compose},function(e,t){e.exports=window.wp.isShallowEqual},function(e,t){e.exports=window.wc.blocksCheckout},function(e,t){e.exports=window.regeneratorRuntime},function(e,t){e.exports=window.wp.htmlEntities},function(e,t){e.exports=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){function r(t){return e.exports=r=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},e.exports.default=e.exports,e.exports.__esModule=!0,r(t)}e.exports=r,e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,r){"use strict";r.d(t,"a",(function(){return i}));var n=r(59),o=r(65);function i(e){return function(e){if(Array.isArray(e))return Object(n.a)(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||Object(o.a)(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}},function(e,t,r){"use strict";r.d(t,"a",(function(){return j}));var n=r(5),o=r.n(n),i=r(4),c=r.n(i),a=r(7),s=r(0),u=r(8),l=r(11),f=r(28),p=r(92),d=r(93),h=r(36);function m(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function b(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?m(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):m(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var g={first_name:"",last_name:"",company:"",address_1:"",address_2:"",city:"",state:"",postcode:"",country:"",phone:""},v=b(b({},g),{},{email:""}),y={total_items:"",total_items_tax:"",total_fees:"",total_fees_tax:"",total_discount:"",total_discount_tax:"",total_shipping:"",total_shipping_tax:"",total_price:"",total_tax:"",tax_lines:u.EMPTY_TAX_LINES,currency_code:"",currency_symbol:"",currency_minor_unit:2,currency_decimal_separator:"",currency_thousand_separator:"",currency_prefix:"",currency_suffix:""},O=function(e){return Object(p.a)(Object.entries(e).map((function(e){var t=o()(e,2),r=t[0],n=t[1];return[r,Object(f.decodeEntities)(n)]})))},E={cartCoupons:u.EMPTY_CART_COUPONS,cartItems:u.EMPTY_CART_ITEMS,cartFees:u.EMPTY_CART_FEES,cartItemsCount:0,cartItemsWeight:0,cartNeedsPayment:!0,cartNeedsShipping:!0,cartItemErrors:u.EMPTY_CART_ITEM_ERRORS,cartTotals:y,cartIsLoading:!0,cartErrors:u.EMPTY_CART_ERRORS,billingAddress:v,shippingAddress:g,shippingRates:u.EMPTY_SHIPPING_RATES,shippingRatesLoading:!1,cartHasCalculatedShipping:!1,paymentRequirements:u.EMPTY_PAYMENT_REQUIREMENTS,receiveCart:function(){},extensions:u.EMPTY_EXTENSIONS},j=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{shouldSelect:!0},t=Object(h.a)(),r=t.isEditor,n=t.previewData,o=null==n?void 0:n.previewCart,i=e.shouldSelect,c=Object(s.useRef)(),f=Object(l.useSelect)((function(e,t){var n=t.dispatch;if(!i)return E;if(r)return{cartCoupons:o.coupons,cartItems:o.items,cartFees:o.fees,cartItemsCount:o.items_count,cartItemsWeight:o.items_weight,cartNeedsPayment:o.needs_payment,cartNeedsShipping:o.needs_shipping,cartItemErrors:u.EMPTY_CART_ITEM_ERRORS,cartTotals:o.totals,cartIsLoading:!1,cartErrors:u.EMPTY_CART_ERRORS,billingAddress:v,shippingAddress:g,extensions:u.EMPTY_EXTENSIONS,shippingRates:o.shipping_rates,shippingRatesLoading:!1,cartHasCalculatedShipping:o.has_calculated_shipping,paymentRequirements:o.paymentRequirements,receiveCart:"function"==typeof(null==o?void 0:o.receiveCart)?o.receiveCart:function(){}};var c=e(u.CART_STORE_KEY),a=c.getCartData(),s=c.getCartErrors(),l=c.getCartTotals(),f=!c.hasFinishedResolution("getCartData"),p=c.isCustomerDataUpdating(),h=n(u.CART_STORE_KEY).receiveCart,m=O(a.billingAddress),y=a.needsShipping?O(a.shippingAddress):m,j=a.fees.length>0?a.fees.map((function(e){return O(e)})):u.EMPTY_CART_FEES;return{cartCoupons:a.coupons.length>0?a.coupons.map((function(e){return b(b({},e),{},{label:e.code})})):u.EMPTY_CART_COUPONS,cartItems:a.items,cartFees:j,cartItemsCount:a.itemsCount,cartItemsWeight:a.itemsWeight,cartNeedsPayment:a.needsPayment,cartNeedsShipping:a.needsShipping,cartItemErrors:a.errors,cartTotals:l,cartIsLoading:f,cartErrors:s,billingAddress:Object(d.a)(m),shippingAddress:Object(d.a)(y),extensions:a.extensions,shippingRates:a.shippingRates,shippingRatesLoading:p,cartHasCalculatedShipping:a.hasCalculatedShipping,paymentRequirements:a.paymentRequirements,receiveCart:h}}),[i]);return c.current&&Object(a.isEqual)(c.current,f)||(c.current=f),c.current}},function(e,t){e.exports=window.wp.a11y},function(e,t){e.exports=window.wp.primitives},function(e,t,r){"use strict";r.d(t,"a",(function(){return s})),r.d(t,"b",(function(){return u})),r.d(t,"c",(function(){return f}));var n,o,i=r(49);!function(e){e.SUCCESS="success",e.FAIL="failure",e.ERROR="error"}(n||(n={})),function(e){e.PAYMENTS="wc/payment-area",e.EXPRESS_PAYMENTS="wc/express-payment-area"}(o||(o={}));var c=function(e,t){return Object(i.b)(e)&&"type"in e&&e.type===t},a=function(e){return c(e,n.SUCCESS)},s=function(e){return c(e,n.ERROR)},u=function(e){return c(e,n.FAIL)},l=function(e){return!Object(i.b)(e)||void 0===e.retry||!0===e.retry},f=function(){return{responseTypes:n,noticeContexts:o,shouldRetry:l,isSuccessResponse:a,isErrorResponse:s,isFailResponse:u}}},function(e,t,r){"use strict";r.d(t,"a",(function(){return i}));var n=r(0),o=(r(11),Object(n.createContext)({isEditor:!1,currentPostId:0,previewData:{},getPreviewData:function(){}})),i=function(){return Object(n.useContext)(o)}},function(e,t){e.exports=window.wp.dom},function(e,t){e.exports=window.wc.wcBlocksRegistry},function(e,t){function r(e,t,r,n,o,i,c){try{var a=e[i](c),s=a.value}catch(e){return void r(e)}a.done?t(s):Promise.resolve(s).then(n,o)}e.exports=function(e){return function(){var t=this,n=arguments;return new Promise((function(o,i){var c=e.apply(t,n);function a(e){r(c,o,i,a,s,"next",e)}function s(e){r(c,o,i,a,s,"throw",e)}a(void 0)}))}},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){function r(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}e.exports=function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,r){var n=r(71);e.exports=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&n(e,t)},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,r){var n=r(21).default,o=r(29);e.exports=function(e,t){return!t||"object"!==n(t)&&"function"!=typeof t?o(e):t},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,r){"use strict";var n=r(40),o=r.n(n),i=r(41),c=r.n(i),a=r(29),s=r.n(a),u=r(42),l=r.n(u),f=r(43),p=r.n(f),d=r(30),h=r.n(d),m=r(4),b=r.n(m),g=(r(10),r(3)),v=r(1),y=r(83),O=function(e){var t=e.imageUrl,r=void 0===t?"".concat(y.l,"/block-error.svg"):t,n=e.header,o=void 0===n?Object(v.__)("Oops!",'woocommerce'):n,i=e.text,c=void 0===i?Object(v.__)("There was an error loading the content.",'woocommerce'):i,a=e.errorMessage,s=e.errorMessagePrefix,u=void 0===s?Object(v.__)("Error:",'woocommerce'):s,l=e.button;return React.createElement("div",{className:"wc-block-error wc-block-components-error"},r&&React.createElement("img",{className:"wc-block-error__image wc-block-components-error__image",src:r,alt:""}),React.createElement("div",{className:"wc-block-error__content wc-block-components-error__content"},o&&React.createElement("p",{className:"wc-block-error__header wc-block-components-error__header"},o),c&&React.createElement("p",{className:"wc-block-error__text wc-block-components-error__text"},c),a&&React.createElement("p",{className:"wc-block-error__message wc-block-components-error__message"},u?u+" ":"",a),l&&React.createElement("p",{className:"wc-block-error__button wc-block-components-error__button"},l)))};r(81);var E=function(e){l()(i,e);var t,r,n=(t=i,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,n=h()(t);if(r){var o=h()(this).constructor;e=Reflect.construct(n,arguments,o)}else e=n.apply(this,arguments);return p()(this,e)});function i(){var e;o()(this,i);for(var t=arguments.length,r=new Array(t),c=0;c<t;c++)r[c]=arguments[c];return e=n.call.apply(n,[this].concat(r)),b()(s()(e),"state",{errorMessage:"",hasError:!1}),e}return c()(i,[{key:"render",value:function(){var e=this.props,t=e.header,r=e.imageUrl,n=e.showErrorMessage,o=e.text,i=e.errorMessagePrefix,c=e.renderError,a=e.button,s=this.state,u=s.errorMessage;return s.hasError?"function"==typeof c?c({errorMessage:u}):React.createElement(O,{errorMessage:n?u:null,header:t,imageUrl:r,text:o,errorMessagePrefix:i,button:a}):this.props.children}}],[{key:"getDerivedStateFromError",value:function(e){return void 0!==e.statusText&&void 0!==e.status?{errorMessage:React.createElement(React.Fragment,null,React.createElement("strong",null,e.status),": ",e.statusText),hasError:!0}:{errorMessage:e.message,hasError:!0}}}]),i}(g.Component);E.defaultProps={showErrorMessage:!0},t.a=E},function(e,t){e.exports=window.wp.deprecated},function(e,t,r){var n=r(94),o=r(95),i=r(67),c=r(96);e.exports=function(e){return n(e)||o(e)||i(e)||c()},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,r){"use strict";(function(e){var n=r(0),o=(r(74),Object(n.createContext)({slots:{},fills:{},registerSlot:function(){void 0!==e&&e.env},updateSlot:function(){},unregisterSlot:function(){},registerFill:function(){},unregisterFill:function(){}}));t.a=o}).call(this,r(102))},function(e,t,r){"use strict";r.d(t,"b",(function(){return F})),r.d(t,"a",(function(){return L}));var n,o=r(5),i=r.n(o),c=r(0),a=r(1),s=r(99),u=r(45),l=r.n(u),f=r(49);!function(e){e.SET_IDLE="set_idle",e.SET_PRISTINE="set_pristine",e.SET_REDIRECT_URL="set_redirect_url",e.SET_COMPLETE="set_checkout_complete",e.SET_BEFORE_PROCESSING="set_before_processing",e.SET_AFTER_PROCESSING="set_after_processing",e.SET_PROCESSING_RESPONSE="set_processing_response",e.SET_PROCESSING="set_checkout_is_processing",e.SET_HAS_ERROR="set_checkout_has_error",e.SET_NO_ERROR="set_checkout_no_error",e.SET_CUSTOMER_ID="set_checkout_customer_id",e.SET_ORDER_ID="set_checkout_order_id",e.SET_ORDER_NOTES="set_checkout_order_notes",e.INCREMENT_CALCULATING="increment_calculating",e.DECREMENT_CALCULATING="decrement_calculating",e.SET_SHOULD_CREATE_ACCOUNT="set_should_create_account",e.SET_EXTENSION_DATA="set_extension_data"}(n||(n={}));var p,d,h=function(){return{type:n.SET_IDLE}},m=function(e){return{type:n.SET_REDIRECT_URL,redirectUrl:e}},b=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{type:n.SET_COMPLETE,data:e}},g=function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return{type:e?n.SET_HAS_ERROR:n.SET_NO_ERROR}},v=r(4),y=r.n(v),O=r(2);function E(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}!function(e){e.PRISTINE="pristine",e.IDLE="idle",e.PROCESSING="processing",e.COMPLETE="complete",e.BEFORE_PROCESSING="before_processing",e.AFTER_PROCESSING="after_processing"}(d||(d={}));var j=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?E(Object(r),!0).forEach((function(t){y()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):E(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({order_id:0,customer_id:0},(null===(p=Object(O.getSetting)("preloadedApiRequests",{})["/wc/store/checkout"])||void 0===p?void 0:p.body)||{}),w={redirectUrl:"",status:d.PRISTINE,hasError:!1,calculatingCount:0,orderId:j.order_id,orderNotes:"",customerId:j.customer_id,shouldCreateAccount:!1,processingResponse:null,extensionData:{}};function S(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function k(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?S(Object(r),!0).forEach((function(t){y()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):S(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var _=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:w,t=arguments.length>1?arguments[1]:void 0,r=t.redirectUrl,o=t.type,i=t.customerId,c=t.orderId,a=t.orderNotes,s=t.extensionData,u=t.shouldCreateAccount,l=t.data,f=e;switch(o){case n.SET_PRISTINE:f=w;break;case n.SET_IDLE:f=e.status!==d.IDLE?k(k({},e),{},{status:d.IDLE}):e;break;case n.SET_REDIRECT_URL:f=void 0!==r&&r!==e.redirectUrl?k(k({},e),{},{redirectUrl:r}):e;break;case n.SET_PROCESSING_RESPONSE:f=k(k({},e),{},{processingResponse:l});break;case n.SET_COMPLETE:f=e.status!==d.COMPLETE?k(k({},e),{},{status:d.COMPLETE,redirectUrl:void 0!==l&&"string"==typeof l.redirectUrl&&l.redirectUrl?l.redirectUrl:e.redirectUrl}):e;break;case n.SET_PROCESSING:f=!1===(f=e.status!==d.PROCESSING?k(k({},e),{},{status:d.PROCESSING,hasError:!1}):e).hasError?f:k(k({},f),{},{hasError:!1});break;case n.SET_BEFORE_PROCESSING:f=e.status!==d.BEFORE_PROCESSING?k(k({},e),{},{status:d.BEFORE_PROCESSING,hasError:!1}):e;break;case n.SET_AFTER_PROCESSING:f=e.status!==d.AFTER_PROCESSING?k(k({},e),{},{status:d.AFTER_PROCESSING}):e;break;case n.SET_HAS_ERROR:f=e.hasError?e:k(k({},e),{},{hasError:!0}),f=e.status===d.PROCESSING||e.status===d.BEFORE_PROCESSING?k(k({},f),{},{status:d.IDLE}):f;break;case n.SET_NO_ERROR:f=e.hasError?k(k({},e),{},{hasError:!1}):e;break;case n.INCREMENT_CALCULATING:f=k(k({},e),{},{calculatingCount:e.calculatingCount+1});break;case n.DECREMENT_CALCULATING:f=k(k({},e),{},{calculatingCount:Math.max(0,e.calculatingCount-1)});break;case n.SET_CUSTOMER_ID:f=void 0!==i?k(k({},e),{},{customerId:i}):e;break;case n.SET_ORDER_ID:f=void 0!==c?k(k({},e),{},{orderId:c}):e;break;case n.SET_SHOULD_CREATE_ACCOUNT:void 0!==u&&u!==e.shouldCreateAccount&&(f=k(k({},e),{},{shouldCreateAccount:u}));break;case n.SET_ORDER_NOTES:void 0!==a&&e.orderNotes!==a&&(f=k(k({},e),{},{orderNotes:a}));break;case n.SET_EXTENSION_DATA:void 0!==s&&e.extensionData!==s&&(f=k(k({},e),{},{extensionData:s}))}return f!==e&&o!==n.SET_PRISTINE&&f.status===d.PRISTINE&&(f.status=d.IDLE),f},P=r(28),R=r(98),x=r(191),C=r(193),T=r(127),A=r(54),M=r(52),N=r(11),D=r(35),I=Object(c.createContext)({dispatchActions:{resetCheckout:function(){},setRedirectUrl:function(e){},setHasError:function(e){},setAfterProcessing:function(e){},incrementCalculating:function(){},decrementCalculating:function(){},setCustomerId:function(e){},setOrderId:function(e){},setOrderNotes:function(e){},setExtensionData:function(e){}},onSubmit:function(){},isComplete:!1,isIdle:!1,isCalculating:!1,isProcessing:!1,isBeforeProcessing:!1,isAfterProcessing:!1,hasError:!1,redirectUrl:"",orderId:0,orderNotes:"",customerId:0,onCheckoutAfterProcessingWithSuccess:function(){return function(){}},onCheckoutAfterProcessingWithError:function(){return function(){}},onCheckoutBeforeProcessing:function(){return function(){}},onCheckoutValidationBeforeProcessing:function(){return function(){}},hasOrder:!1,isCart:!1,shouldCreateAccount:!1,setShouldCreateAccount:function(e){},extensionData:{}}),F=function(){return Object(c.useContext)(I)},L=function(e){var t=e.children,r=e.redirectUrl,o=e.isCart,u=void 0!==o&&o;w.redirectUrl=r;var p,v=Object(c.useReducer)(_,w),y=i()(v,2),O=y[0],E=y[1],j=Object(T.b)().setValidationErrors,S=Object(A.a)(),k=S.addErrorNotice,F=S.removeNotices,L=Object(M.a)().dispatchCheckoutEvent,V=O.calculatingCount>0,B=Object(D.c)(),U=B.isSuccessResponse,H=B.isErrorResponse,z=B.isFailResponse,q=B.shouldRetry,G=(p=Object(D.c)().noticeContexts,{checkoutNotices:Object(N.useSelect)((function(e){return e("core/notices").getNotices("wc/checkout")}),[]),expressPaymentNotices:Object(N.useSelect)((function(e){return e("core/notices").getNotices(p.EXPRESS_PAYMENTS)}),[p.EXPRESS_PAYMENTS]),paymentNotices:Object(N.useSelect)((function(e){return e("core/notices").getNotices(p.PAYMENTS)}),[p.PAYMENTS])}),W=G.checkoutNotices,Y=G.paymentNotices,K=G.expressPaymentNotices,X=Object(c.useReducer)(R.b,{}),J=i()(X,2),$=J[0],Z=J[1],Q=Object(c.useRef)($),ee=function(e){return Object(c.useMemo)((function(){return{onCheckoutAfterProcessingWithSuccess:Object(x.a)("checkout_after_processing_with_success",e),onCheckoutAfterProcessingWithError:Object(x.a)("checkout_after_processing_with_error",e),onCheckoutValidationBeforeProcessing:Object(x.a)("checkout_validation_before_processing",e)}}),[e])}(Z),te=ee.onCheckoutAfterProcessingWithSuccess,re=ee.onCheckoutAfterProcessingWithError,ne=ee.onCheckoutValidationBeforeProcessing;Object(c.useEffect)((function(){Q.current=$}),[$]);var oe=Object(c.useMemo)((function(){return function(){return l()("onCheckoutBeforeProcessing",{alternative:"onCheckoutValidationBeforeProcessing",plugin:"WooCommerce Blocks"}),ne.apply(void 0,arguments)}}),[ne]),ie=Object(c.useMemo)((function(){return{resetCheckout:function(){E({type:n.SET_PRISTINE})},setRedirectUrl:function(e){E(m(e))},setHasError:function(e){E(g(e))},incrementCalculating:function(){E({type:n.INCREMENT_CALCULATING})},decrementCalculating:function(){E({type:n.DECREMENT_CALCULATING})},setCustomerId:function(e){var t;E((t=e,{type:n.SET_CUSTOMER_ID,customerId:t}))},setOrderId:function(e){E(function(e){return{type:n.SET_ORDER_ID,orderId:e}}(e))},setOrderNotes:function(e){E(function(e){return{type:n.SET_ORDER_NOTES,orderNotes:e}}(e))},setExtensionData:function(e){E(function(e){return{type:n.SET_EXTENSION_DATA,extensionData:e}}(e))},setAfterProcessing:function(e){var t,r=function(e){var t={message:"",paymentStatus:"",redirectUrl:"",paymentDetails:{}};return"payment_result"in e&&(t.paymentStatus=e.payment_result.payment_status,t.redirectUrl=e.payment_result.redirect_url,e.payment_result.hasOwnProperty("payment_details")&&Array.isArray(e.payment_result.payment_details)&&e.payment_result.payment_details.forEach((function(e){var r=e.key,n=e.value;t.paymentDetails[r]=Object(P.decodeEntities)(n)}))),"message"in e&&(t.message=Object(P.decodeEntities)(e.message)),!t.message&&"data"in e&&"status"in e.data&&e.data.status>299&&(t.message=Object(a.__)("Something went wrong. Please contact us to get assistance.",'woocommerce')),t}(e);r.redirectUrl&&E(m(r.redirectUrl)),E((t=r,{type:n.SET_PROCESSING_RESPONSE,data:t})),E({type:n.SET_AFTER_PROCESSING})}}}),[]);Object(c.useEffect)((function(){O.status===d.BEFORE_PROCESSING&&(F("error"),Object(C.a)(Q.current,"checkout_validation_before_processing",{}).then((function(e){!0!==e?(Array.isArray(e)&&e.forEach((function(e){var t=e.errorMessage,r=e.validationErrors;k(t),j(r)})),E(h()),E(g())):E({type:n.SET_PROCESSING})})))}),[O.status,j,k,F,E]);var ce=Object(s.a)(O.status),ae=Object(s.a)(O.hasError);Object(c.useEffect)((function(){if((O.status!==ce||O.hasError!==ae)&&O.status===d.AFTER_PROCESSING){var e={redirectUrl:O.redirectUrl,orderId:O.orderId,customerId:O.customerId,orderNotes:O.orderNotes,processingResponse:O.processingResponse};O.hasError?Object(C.b)(Q.current,"checkout_after_processing_with_error",e).then((function(t){var r=function(e){var t=null;return e.forEach((function(e){if((H(e)||z(e))&&e.message){var r=e.messageContext?{context:e.messageContext}:void 0;t=e,k(e.message,r)}})),t}(t);if(null!==r)q(r)?E(h()):E(b(r));else{if(!(W.some((function(e){return"error"===e.status}))||K.some((function(e){return"error"===e.status}))||Y.some((function(e){return"error"===e.status})))){var n,o=(null===(n=e.processingResponse)||void 0===n?void 0:n.message)||Object(a.__)("Something went wrong. Please contact us to get assistance.",'woocommerce');k(o,{id:"checkout"})}E(h())}})):Object(C.b)(Q.current,"checkout_after_processing_with_success",e).then((function(e){var t=null,r=null;if(e.forEach((function(e){U(e)&&(t=e),(H(e)||z(e))&&(r=e)})),t&&!r)E(b(t));else if(Object(f.b)(r)){if(r.message){var n=r.messageContext?{context:r.messageContext}:void 0;k(r.message,n)}q(r)?E(g(!0)):E(b(r))}else E(b())}))}}),[O.status,O.hasError,O.redirectUrl,O.orderId,O.customerId,O.orderNotes,O.processingResponse,ce,ae,ie,k,H,z,U,q,W,K,Y]);var se={onSubmit:Object(c.useCallback)((function(){L("submit"),E({type:n.SET_BEFORE_PROCESSING})}),[L]),isComplete:O.status===d.COMPLETE,isIdle:O.status===d.IDLE,isCalculating:V,isProcessing:O.status===d.PROCESSING,isBeforeProcessing:O.status===d.BEFORE_PROCESSING,isAfterProcessing:O.status===d.AFTER_PROCESSING,hasError:O.hasError,redirectUrl:O.redirectUrl,onCheckoutBeforeProcessing:oe,onCheckoutValidationBeforeProcessing:ne,onCheckoutAfterProcessingWithSuccess:te,onCheckoutAfterProcessingWithError:re,dispatchActions:ie,isCart:u,orderId:O.orderId,hasOrder:!!O.orderId,customerId:O.customerId,orderNotes:O.orderNotes,shouldCreateAccount:O.shouldCreateAccount,setShouldCreateAccount:function(e){return E((t=e,{type:n.SET_SHOULD_CREATE_ACCOUNT,shouldCreateAccount:t}));var t},extensionData:O.extensionData};return React.createElement(I.Provider,{value:se},t)}},function(e,t,r){"use strict";r.d(t,"a",(function(){return n})),r.d(t,"c",(function(){return o})),r.d(t,"b",(function(){return i})),r.d(t,"d",(function(){return c}));var n=function(e){return"number"==typeof e},o=function(e){return"string"==typeof e},i=function(e){return!function(e){return null===e}(e)&&e instanceof Object&&e.constructor===Object};function c(e,t){return i(e)&&t in e}},function(e,t){e.exports=window.wp.keycodes},,function(e,t,r){"use strict";r.d(t,"a",(function(){return l}));var n=r(4),o=r.n(n),i=r(75),c=r(0),a=r(32);function s(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function u(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?s(Object(r),!0).forEach((function(t){o()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):s(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var l=function(){var e=Object(a.a)(),t=Object(c.useRef)(e);return Object(c.useEffect)((function(){t.current=e}),[e]),{dispatchStoreEvent:Object(c.useCallback)((function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};try{Object(i.doAction)("experimental__woocommerce_blocks-".concat(e),t)}catch(e){console.error(e)}}),[]),dispatchCheckoutEvent:Object(c.useCallback)((function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};try{Object(i.doAction)("experimental__woocommerce_blocks-checkout-".concat(e),u(u({},r),{},{storeCart:t.current}))}catch(e){console.error(e)}}),[])}}},function(e,t,r){"use strict";r.d(t,"a",(function(){return c}));var n=r(0),o=r(25),i=r.n(o);function c(e){var t=Object(n.useRef)(e);return i()(e,t.current)||(t.current=e),t.current}},function(e,t,r){"use strict";r.d(t,"a",(function(){return u}));var n=r(4),o=r.n(n),i=r(0),c=r(103);function a(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function s(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?a(Object(r),!0).forEach((function(t){o()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):a(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var u=function(){var e=Object(c.b)(),t=e.notices,r=e.createNotice,n=e.removeNotice,o=e.setIsSuppressed,a=Object(i.useRef)(t);Object(i.useEffect)((function(){a.current=t}),[t]);var u=Object(i.useMemo)((function(){return{hasNoticesOfType:function(e){return a.current.some((function(t){return t.type===e}))},removeNotices:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;a.current.forEach((function(t){null!==e&&t.status!==e||n(t.id)}))},removeNotice:n}}),[n]),l=Object(i.useMemo)((function(){return{addDefaultNotice:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};r("default",e,s({},t))},addErrorNotice:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};r("error",e,s({},t))},addWarningNotice:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};r("warning",e,s({},t))},addInfoNotice:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};r("info",e,s({},t))},addSuccessNotice:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};r("success",e,s({},t))}}}),[r]);return s(s(s({notices:t},u),l),{},{setIsSuppressed:o})}},,,,function(e,t){e.exports=window.wc.priceFormat},function(e,t,r){"use strict";function n(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}r.d(t,"a",(function(){return n}))},function(e,t,r){"use strict";r.d(t,"b",(function(){return w})),r.d(t,"a",(function(){return S}));var n=r(5),o=r.n(n),i=r(0),c=r(2),a=r(4),s=r.n(a),u=r(11),l=r(8),f=r(115),p=r(25),d=r.n(p),h=r(93),m=r(132),b=r(32),g=r(54);function v(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function y(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?v(Object(r),!0).forEach((function(t){s()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):v(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var O=function(e,t){return!(!function(e){return"email"in e}(t)||Object(h.c)(t)===Object(h.c)(e))||!!t.country&&!d()(Object(h.b)(e),Object(h.b)(t))},E=r(48),j=Object(i.createContext)({billingData:{first_name:"",last_name:"",company:"",address_1:"",address_2:"",city:"",state:"",postcode:"",country:"",email:"",phone:""},shippingAddress:{first_name:"",last_name:"",company:"",address_1:"",address_2:"",city:"",state:"",postcode:"",country:"",phone:""},setBillingData:function(){return null},setShippingAddress:function(){return null},shippingAsBilling:!0,setShippingAsBilling:function(){return null}}),w=function(){return Object(i.useContext)(j)},S=function(e){var t=e.children,r=function(){var e=Object(u.useDispatch)(l.CART_STORE_KEY).updateCustomerData,t=Object(g.a)(),r=t.addErrorNotice,n=t.removeNotice,c=Object(b.a)(),a=c.billingAddress,s=c.shippingAddress,p=Object(i.useState)({billingData:a,shippingAddress:s}),h=o()(p,2),v=h[0],E=h[1],j=Object(i.useRef)(v),w=Object(f.a)(v,1e3,{equalityFn:function(e,t){return d()(e.billingData,t.billingData)&&d()(e.shippingAddress,t.shippingAddress)}}),S=o()(w,1)[0],k=Object(i.useCallback)((function(e){E((function(t){return y(y({},t),{},{billingData:y(y({},t.billingData),e)})}))}),[]),_=Object(i.useCallback)((function(e){E((function(t){return y(y({},t),{},{shippingAddress:y(y({},t.shippingAddress),e)})}))}),[]);return Object(i.useEffect)((function(){(O(j.current.billingData,S.billingData)||O(j.current.shippingAddress,S.shippingAddress))&&(j.current=S,e({billing_address:S.billingData,shipping_address:S.shippingAddress}).then((function(){n("checkout")})).catch((function(e){r(Object(m.b)(e),{id:"checkout"})})))}),[S,r,n,e]),{billingData:v.billingData,shippingAddress:v.shippingAddress,setBillingData:k,setShippingAddress:_}}(),n=r.billingData,a=r.shippingAddress,s=r.setBillingData,p=r.setShippingAddress,h=Object(b.a)().cartNeedsShipping,v=Object(E.b)().customerId,w=Object(i.useState)((function(){return h&&(!v||(e=a,t=n,Object.keys(c.defaultAddressFields).every((function(r){return e[r]===t[r]}))));var e,t})),S=o()(w,2),k=S[0],_=S[1],P={billingData:n,shippingAddress:a,setBillingData:s,setShippingAddress:p,shippingAsBilling:k,setShippingAsBilling:_};return React.createElement(j.Provider,{value:P},t)}},function(e,t){e.exports=window.wp.apiFetch},,,,function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));var n=r(59);function o(e,t){if(e){if("string"==typeof e)return Object(n.a)(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Object(n.a)(e,t):void 0}}},function(e,t,r){"use strict";r.d(t,"b",(function(){return x})),r.d(t,"a",(function(){return C}));var n=r(4),o=r.n(n),i=r(5),c=r.n(i),a=r(0),s=r(25),u=r.n(s),l=r(92),f=function(e){return Object(l.a)(e.map((function(e){var t;return[e.package_id,null===(t=e.shipping_rates.find((function(e){return e.selected})))||void 0===t?void 0:t.rate_id]})))},p={NONE:"none",INVALID_ADDRESS:"invalid_address",UNKNOWN:"unknown_error"},d={INVALID_COUNTRY:"woocommerce_rest_cart_shipping_rates_invalid_country",MISSING_COUNTRY:"woocommerce_rest_cart_shipping_rates_missing_country",INVALID_STATE:"woocommerce_rest_cart_shipping_rates_invalid_state"},h={shippingErrorStatus:{isPristine:!0,isValid:!1,hasInvalidAddress:!1,hasError:!1},dispatchErrorStatus:function(){return null},shippingErrorTypes:p,shippingRates:[],shippingRatesLoading:!1,selectedRates:[],setSelectedRates:function(){return null},shippingAddress:{first_name:"",last_name:"",company:"",address_1:"",address_2:"",city:"",state:"",postcode:"",country:""},setShippingAddress:function(){return null},onShippingRateSuccess:function(){return null},onShippingRateFail:function(){return null},onShippingRateSelectSuccess:function(){return null},onShippingRateSelectFail:function(){return null},needsShipping:!1},m=function(e,t){var r=t.type;return Object.values(p).includes(r)?r:e},b=r(98),g=r(191),v=function(e){return{onSuccess:Object(g.a)("shipping_rates_success",e),onFail:Object(g.a)("shipping_rates_fail",e),onSelectSuccess:Object(g.a)("shipping_rate_select_success",e),onSelectFail:Object(g.a)("shipping_rate_select_fail",e)}},y=r(193),O=r(48),E=r(60),j=r(32),w=r(118);function S(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}var k=p.NONE,_=p.INVALID_ADDRESS,P=p.UNKNOWN,R=Object(a.createContext)(h),x=function(){return Object(a.useContext)(R)},C=function(e){var t=e.children,r=Object(O.b)().dispatchActions,n=Object(E.b)(),i=n.shippingAddress,s=n.setShippingAddress,l=Object(j.a)(),h=l.cartNeedsShipping,g=l.cartHasCalculatedShipping,x=l.shippingRates,C=l.shippingRatesLoading,T=l.cartErrors,A=Object(w.a)(),M=A.selectShippingRate,N=A.isSelectingRate,D=Object(a.useReducer)(m,k),I=c()(D,2),F=I[0],L=I[1],V=Object(a.useReducer)(b.b,{}),B=c()(V,2),U=B[0],H=B[1],z=Object(a.useRef)(U),q=Object(a.useMemo)((function(){return{onShippingRateSuccess:v(H).onSuccess,onShippingRateFail:v(H).onFail,onShippingRateSelectSuccess:v(H).onSelectSuccess,onShippingRateSelectFail:v(H).onSelectFail}}),[H]);Object(a.useEffect)((function(){z.current=U}),[U]);var G=Object(a.useRef)((function(){return f(x)}));Object(a.useEffect)((function(){var e=f(x);u()(G.current,e)||(G.current=e)}),[x]),Object(a.useEffect)((function(){C?r.incrementCalculating():r.decrementCalculating()}),[C,r]),Object(a.useEffect)((function(){N?r.incrementCalculating():r.decrementCalculating()}),[N,r]),Object(a.useEffect)((function(){T.length>0&&T.some((function(e){return!(!e.code||!Object.values(d).includes(e.code))}))?L({type:_}):L({type:k})}),[T]);var W=Object(a.useMemo)((function(){return{isPristine:F===k,isValid:F===k,hasInvalidAddress:F===_,hasError:F===P||F===_}}),[F]);Object(a.useEffect)((function(){C||0!==x.length&&!W.hasError||Object(y.a)(z.current,"shipping_rates_fail",{hasInvalidAddress:W.hasInvalidAddress,hasError:W.hasError})}),[x,C,W.hasError,W.hasInvalidAddress]),Object(a.useEffect)((function(){!C&&x.length>0&&!W.hasError&&Object(y.a)(z.current,"shipping_rates_success",x)}),[x,C,W.hasError]),Object(a.useEffect)((function(){N||(W.hasError?Object(y.a)(z.current,"shipping_rate_select_fail",{hasError:W.hasError,hasInvalidAddress:W.hasInvalidAddress}):Object(y.a)(z.current,"shipping_rate_select_success",G.current))}),[N,W.hasError,W.hasInvalidAddress]);var Y=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?S(Object(r),!0).forEach((function(t){o()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):S(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({shippingErrorStatus:W,dispatchErrorStatus:L,shippingErrorTypes:p,shippingRates:x,shippingRatesLoading:C,selectedRates:G.current,setSelectedRates:M,isSelectingRate:N,shippingAddress:i,setShippingAddress:s,needsShipping:h,hasCalculatedShipping:g},q);return React.createElement(React.Fragment,null,React.createElement(R.Provider,{value:Y},t))}},function(e,t,r){var n=r(68);e.exports=function(e,t){if(e){if("string"==typeof e)return n(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?n(e,t):void 0}},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n},e.exports.default=e.exports,e.exports.__esModule=!0},,,function(e,t){function r(t,n){return e.exports=r=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},e.exports.default=e.exports,e.exports.__esModule=!0,r(t,n)}e.exports=r,e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=window.wp.url},,function(e,t){e.exports=window.wp.warning},function(e,t){e.exports=window.wp.hooks},function(e,t,r){"use strict";var n=r(12),o=r(19),i=r(0),c=r(6),a=r.n(c),s=r(7),u=r(45),l=r.n(u),f=r(15),p=r(16),d=r(17),h=r(18),m=r(9),b=r(22),g=r(37),v=r(50),y=r(24),O=r(116),E=r(20);function j(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function w(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?j(Object(r),!0).forEach((function(t){Object(E.a)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):j(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function S(e,t,r,n,o,i,c){var a=t.width,s="rtl"===document.documentElement.dir;"left"===r&&s?r="right":"right"===r&&s&&(r="left"),"left"===n&&s?n="right":"right"===n&&s&&(n="left");var u=Math.round(e.left+e.width/2),l={popoverLeft:u,contentWidth:(u-a/2>0?a/2:u)+(u+a/2>window.innerWidth?window.innerWidth-u:a/2)},f=e.left;"right"===n?f=e.right:"middle"!==i&&(f=u);var p=e.right;"left"===n?p=e.left:"middle"!==i&&(p=u);var d,h={popoverLeft:f,contentWidth:f-a>0?a:f},m={popoverLeft:p,contentWidth:p+a>window.innerWidth?window.innerWidth-p:a},b=r,g=null;if(!o)if("center"===r&&l.contentWidth===a)b="center";else if("left"===r&&h.contentWidth===a)b="left";else if("right"===r&&m.contentWidth===a)b="right";else{var v="left"==(b=h.contentWidth>m.contentWidth?"left":"right")?h.contentWidth:m.contentWidth;g=v!==a?v:null}if(d="center"===b?l.popoverLeft:"left"===b?h.popoverLeft:m.popoverLeft,c){var y=c.getBoundingClientRect();d=Math.min(d,y.right-a)}return{xAxis:b,popoverLeft:d,contentWidth:g}}function k(e,t,r,n,o,i,c){var a=t.height;if(o){var s=(Object(g.getScrollContainer)(i)||document.body).getBoundingClientRect().top+a-c;if(e.top<=s)return{yAxis:r,popoverTop:Math.min(e.bottom,s)}}var u=e.top+e.height/2;"bottom"===n?u=e.bottom:"top"===n&&(u=e.top);var l={popoverTop:u,contentHeight:(u-a/2>0?a/2:u)+(u+a/2>window.innerHeight?window.innerHeight-u:a/2)},f={popoverTop:e.top,contentHeight:e.top-10-a>0?a:e.top-10},p={popoverTop:e.bottom,contentHeight:e.bottom+10+a>window.innerHeight?window.innerHeight-10-e.bottom:a},d=r,h=null;if(!o)if("middle"===r&&l.contentHeight===a)d="middle";else if("top"===r&&f.contentHeight===a)d="top";else if("bottom"===r&&p.contentHeight===a)d="bottom";else{var m="top"==(d=f.contentHeight>p.contentHeight?"top":"bottom")?f.contentHeight:p.contentHeight;h=m!==a?m:null}return{yAxis:d,popoverTop:"middle"===d?l.popoverTop:"top"===d?f.popoverTop:p.popoverTop,contentHeight:h}}var _=r(31),P=r(13);var R=Object(i.createContext)({focusHistory:[]}),x=R.Provider,C=R.Consumer;x.displayName="FocusReturnProvider",C.displayName="FocusReturnConsumer",i.Component;var T=Object(y.createHigherOrderComponent)((function e(t){if((n=t)instanceof i.Component||"function"==typeof n){var r=t;return e({})(r)}var n,o=t.onFocusReturn,c=void 0===o?s.stubTrue:o;return function(e){var t=function(t){Object(d.a)(a,t);var r,n,o=(r=a,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=Object(m.a)(r);if(n){var o=Object(m.a)(this).constructor;e=Reflect.construct(t,arguments,o)}else e=t.apply(this,arguments);return Object(h.a)(this,e)});function a(){var e;return Object(f.a)(this,a),(e=o.apply(this,arguments)).ownFocusedElements=new Set,e.activeElementOnMount=document.activeElement,e.setIsFocusedFalse=function(){return e.isFocused=!1},e.setIsFocusedTrue=function(t){e.ownFocusedElements.add(t.target),e.isFocused=!0},e}return Object(p.a)(a,[{key:"componentWillUnmount",value:function(){var e=this.activeElementOnMount,t=this.isFocused,r=this.ownFocusedElements;if(t&&!1!==c())for(var n,o=[].concat(Object(_.a)(s.without.apply(void 0,[this.props.focus.focusHistory].concat(Object(_.a)(r)))),[e]);n=o.pop();)if(document.body.contains(n))return void n.focus()}},{key:"render",value:function(){return Object(i.createElement)("div",{onFocus:this.setIsFocusedTrue,onBlur:this.setIsFocusedFalse},Object(i.createElement)(e,this.props.childProps))}}]),a}(i.Component);return function(e){return Object(i.createElement)(C,null,(function(r){return Object(i.createElement)(t,{childProps:e,focus:r})}))}}}),"withFocusReturn");var A=Object(y.createHigherOrderComponent)((function(e){return function(t){Object(d.a)(c,t);var r,n,o=(r=c,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=Object(m.a)(r);if(n){var o=Object(m.a)(this).constructor;e=Reflect.construct(t,arguments,o)}else e=t.apply(this,arguments);return Object(h.a)(this,e)});function c(){var e;return Object(f.a)(this,c),(e=o.apply(this,arguments)).focusContainRef=Object(i.createRef)(),e.handleTabBehaviour=e.handleTabBehaviour.bind(Object(P.a)(e)),e}return Object(p.a)(c,[{key:"handleTabBehaviour",value:function(e){if(e.keyCode===v.TAB){var t=g.focus.tabbable.find(this.focusContainRef.current);if(t.length){var r=t[0],n=t[t.length-1];e.shiftKey&&e.target===r?(e.preventDefault(),n.focus()):(e.shiftKey||e.target!==n)&&t.includes(e.target)||(e.preventDefault(),r.focus())}}}},{key:"render",value:function(){return Object(i.createElement)("div",{onKeyDown:this.handleTabBehaviour,ref:this.focusContainRef,tabIndex:"-1"},Object(i.createElement)(e,this.props))}}]),c}(i.Component)}),"withConstrainedTabbing"),M=r(89);var N=function(e){Object(d.a)(o,e);var t,r,n=(t=o,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,n=Object(m.a)(t);if(r){var o=Object(m.a)(this).constructor;e=Reflect.construct(n,arguments,o)}else e=n.apply(this,arguments);return Object(h.a)(this,e)});function o(){return Object(f.a)(this,o),n.apply(this,arguments)}return Object(p.a)(o,[{key:"handleFocusOutside",value:function(e){this.props.onFocusOutside(e)}},{key:"render",value:function(){return this.props.children}}]),o}(i.Component),D=Object(M.a)(N);function I(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=Object(m.a)(e);if(t){var o=Object(m.a)(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return Object(h.a)(this,r)}}var F=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.htmlDocument,r=void 0===t?document:t,n=e.className,o=void 0===n?"lockscroll":n,c=0,a=0;function s(e){var t=r.scrollingElement||r.body;e&&(a=t.scrollTop);var n=e?"add":"remove";t.classList[n](o),r.documentElement.classList[n](o),e||(t.scrollTop=a)}function u(){0===c&&s(!0),++c}function l(){1===c&&s(!1),--c}return function(e){Object(d.a)(r,e);var t=I(r);function r(){return Object(f.a)(this,r),t.apply(this,arguments)}return Object(p.a)(r,[{key:"componentDidMount",value:function(){u()}},{key:"componentWillUnmount",value:function(){l()}},{key:"render",value:function(){return null}}]),r}(i.Component)}();function L(e){e.stopPropagation()}var V=Object(i.forwardRef)((function(e,t){var r=e.children,c=Object(o.a)(e,["children"]);return Object(i.createElement)("div",Object(n.a)({},c,{ref:t,onMouseDown:L}),r)})),B=r(47);function U(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function H(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?U(Object(r),!0).forEach((function(t){Object(E.a)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):U(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function z(e){var t=Object(i.useContext)(B.a),r=t.slots[e]||{},n=t.fills[e],o=Object(i.useMemo)((function(){return n||[]}),[n]),c=Object(i.useCallback)((function(r){t.updateSlot(e,r)}),[e,t.updateSlot]),a=Object(i.useCallback)((function(r){t.unregisterSlot(e,r)}),[e,t.unregisterSlot]),s=Object(i.useCallback)((function(r){t.registerFill(e,r)}),[e,t.registerFill]),u=Object(i.useCallback)((function(r){t.unregisterFill(e,r)}),[e,t.unregisterFill]);return H(H({},r),{},{updateSlot:c,unregisterSlot:a,fills:o,registerFill:s,unregisterFill:u})}function q(e,t,r){return(q="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,r){var n=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=Object(m.a)(e)););return e}(e,t);if(n){var o=Object.getOwnPropertyDescriptor(n,t);return o.get?o.get.call(r):o.value}})(e,t,r||e)}r(25);var G=Object(i.createContext)({registerSlot:function(){},unregisterSlot:function(){},registerFill:function(){},unregisterFill:function(){},getSlot:function(){},getFills:function(){},subscribe:function(){}}),W=(G.Provider,G.Consumer);i.Component;var Y=function(e){Object(d.a)(o,e);var t,r,n=(t=o,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,n=Object(m.a)(t);if(r){var o=Object(m.a)(this).constructor;e=Reflect.construct(n,arguments,o)}else e=n.apply(this,arguments);return Object(h.a)(this,e)});function o(){var e;return Object(f.a)(this,o),(e=n.apply(this,arguments)).isUnmounted=!1,e.bindNode=e.bindNode.bind(Object(P.a)(e)),e}return Object(p.a)(o,[{key:"componentDidMount",value:function(){(0,this.props.registerSlot)(this.props.name,this)}},{key:"componentWillUnmount",value:function(){var e=this.props.unregisterSlot;this.isUnmounted=!0,e(this.props.name,this)}},{key:"componentDidUpdate",value:function(e){var t=this.props,r=t.name,n=t.unregisterSlot,o=t.registerSlot;e.name!==r&&(n(e.name),o(r,this))}},{key:"bindNode",value:function(e){this.node=e}},{key:"forceUpdate",value:function(){this.isUnmounted||q(Object(m.a)(o.prototype),"forceUpdate",this).call(this)}},{key:"render",value:function(){var e=this.props,t=e.children,r=e.name,n=e.fillProps,o=void 0===n?{}:n,c=e.getFills,a=Object(s.map)(c(r,this),(function(e){var t=e.occurrence,r=Object(s.isFunction)(e.children)?e.children(o):e.children;return i.Children.map(r,(function(e,r){if(!e||Object(s.isString)(e))return e;var n="".concat(t,"---").concat(e.key||r);return Object(i.cloneElement)(e,{key:n})}))})).filter(Object(s.negate)(i.isEmptyElement));return Object(i.createElement)(i.Fragment,null,Object(s.isFunction)(t)?t(a):a)}}]),o}(i.Component),K=function(e){return Object(i.createElement)(W,null,(function(t){var r=t.registerSlot,o=t.unregisterSlot,c=t.getFills;return Object(i.createElement)(Y,Object(n.a)({},e,{registerSlot:r,unregisterSlot:o,getFills:c}))}))},X=0;function J(e){var t=e.name,r=e.children,n=e.registerFill,o=e.unregisterFill,c=function(e){var t=Object(i.useContext)(G),r=t.getSlot,n=t.subscribe,o=Object(i.useState)(r(e)),c=Object(b.a)(o,2),a=c[0],s=c[1];return Object(i.useEffect)((function(){return s(r(e)),n((function(){s(r(e))}))}),[e]),a}(t),a=Object(i.useRef)({name:t,children:r});return a.current.occurrence||(a.current.occurrence=++X),Object(i.useLayoutEffect)((function(){return n(t,a.current),function(){return o(t,a.current)}}),[]),Object(i.useLayoutEffect)((function(){a.current.children=r,c&&c.forceUpdate()}),[r]),Object(i.useLayoutEffect)((function(){t!==a.current.name&&(o(a.current.name,a.current),a.current.name=t,n(t,a.current))}),[t]),c&&c.node?(Object(s.isFunction)(r)&&(r=r(c.props.fillProps)),Object(i.createPortal)(r,c.node)):null}var $=function(e){return Object(i.createElement)(W,null,(function(t){var r=t.registerFill,o=t.unregisterFill;return Object(i.createElement)(J,Object(n.a)({},e,{registerFill:r,unregisterFill:o}))}))};function Z(e){var t=e.name,r=e.fillProps,c=void 0===r?{}:r,a=e.as,s=void 0===a?"div":a,u=Object(o.a)(e,["name","fillProps","as"]),l=Object(i.useContext)(B.a),f=Object(i.useRef)();return Object(i.useLayoutEffect)((function(){return l.registerSlot(t,f,c),function(){l.unregisterSlot(t,f)}}),[l.registerSlot,l.unregisterSlot,t]),Object(i.useLayoutEffect)((function(){l.updateSlot(t,c)})),Object(i.createElement)(s,Object(n.a)({ref:f},u))}function Q(e){var t,r,n=e.name,o=e.children,c=z(n),a=Object(i.useRef)({rerender:(t=Object(i.useState)({}),r=Object(b.a)(t,2)[1],function(){return r({})})});return Object(i.useEffect)((function(){return c.registerFill(a),function(){c.unregisterFill(a)}}),[c.registerFill,c.unregisterFill]),c.ref&&c.ref.current?("function"==typeof o&&(o=o(c.fillProps)),Object(i.createPortal)(o,c.ref.current)):null}function ee(e){var t=e.bubblesVirtually,r=Object(o.a)(e,["bubblesVirtually"]);return t?Object(i.createElement)(Z,r):Object(i.createElement)(K,r)}function te(e){return Object(i.createElement)(i.Fragment,null,Object(i.createElement)($,e),Object(i.createElement)(Q,e))}function re(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function ne(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?re(Object(r),!0).forEach((function(t){Object(E.a)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):re(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function oe(e){var t=e.type,r=e.origin,n=void 0===r?function(e){return"appear"===e?"top":"left"}(t):r;if("appear"===t){var o,i=n.split(" "),c=Object(b.a)(i,2),s=c[0],u=c[1],l=void 0===u?"center":u;return a()("components-animate__appear",(o={},Object(E.a)(o,"is-from-"+l,"center"!==l),Object(E.a)(o,"is-from-"+s,"middle"!==s),o))}return"slide-in"===t?a()("components-animate__slide-in","is-from-"+n):"loading"===t?a()("components-animate__loading"):void 0}function ie(e){var t=e.type,r=e.options,n=void 0===r?{}:r;return(0,e.children)({className:oe(ne({type:t},n))})}var ce=A(T((function(e){return e.children})));function ae(e,t){var r,n=(r=t).ownerDocument.defaultView.getComputedStyle(r),o=n.paddingTop,i=n.paddingBottom,c=n.paddingLeft,a=n.paddingRight,s=o?parseInt(o,10):0,u=i?parseInt(i,10):0,l=c?parseInt(c,10):0,f=a?parseInt(a,10):0;return{x:e.left+l,y:e.top+s,width:e.width-l-f,height:e.height-s-u,left:e.left+l,right:e.right-f,top:e.top+s,bottom:e.bottom-u}}function se(e,t,r){r?e.getAttribute(t)!==r&&e.setAttribute(t,r):e.hasAttribute(t)&&e.removeAttribute(t)}function ue(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";e.style[t]!==r&&(e.style[t]=r)}function le(e,t,r){r?e.classList.contains(t)||e.classList.add(t):e.classList.contains(t)&&e.classList.remove(t)}var fe=function(e){var t=e.headerTitle,r=e.onClose,c=e.onKeyDown,s=e.children,u=e.className,f=e.noArrow,p=void 0===f||f,d=e.isAlternate,h=e.position,m=void 0===h?"bottom right":h,E=(e.range,e.focusOnMount),j=void 0===E?"firstElement":E,_=e.anchorRef,P=e.shouldAnchorIncludePadding,R=e.anchorRect,x=e.getAnchorRect,C=e.expandOnMobile,T=e.animate,A=void 0===T||T,M=e.onClickOutside,N=e.onFocusOutside,I=e.__unstableSticky,L=e.__unstableSlotName,B=void 0===L?"Popover":L,U=e.__unstableObserveElement,H=e.__unstableBoundaryParent,q=Object(o.a)(e,["headerTitle","onClose","onKeyDown","children","className","noArrow","isAlternate","position","range","focusOnMount","anchorRef","shouldAnchorIncludePadding","anchorRect","getAnchorRect","expandOnMobile","animate","onClickOutside","onFocusOutside","__unstableSticky","__unstableSlotName","__unstableObserveElement","__unstableBoundaryParent"]),G=Object(i.useRef)(null),W=Object(i.useRef)(null),Y=Object(i.useRef)(),K=Object(y.useViewportMatch)("medium","<"),X=Object(i.useState)(),J=Object(b.a)(X,2),$=J[0],Z=J[1],Q=z(B),ee=C&&K,re=Object(y.useResizeObserver)(),ne=Object(b.a)(re,2),oe=ne[0],fe=ne[1];p=ee||p,Object(i.useLayoutEffect)((function(){if(ee)return le(Y.current,"is-without-arrow",p),le(Y.current,"is-alternate",d),se(Y.current,"data-x-axis"),se(Y.current,"data-y-axis"),ue(Y.current,"top"),ue(Y.current,"left"),ue(W.current,"maxHeight"),void ue(W.current,"maxWidth");var e=function(){if(Y.current&&W.current){var e=function(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]&&arguments[3],o=arguments.length>4?arguments[4]:void 0;if(t)return t;if(r){if(!e.current)return;return r(e.current)}if(!1!==n){if(!(n&&window.Range&&window.Element&&window.DOMRect))return;if(n instanceof window.Range)return Object(g.getRectangleFromRange)(n);if(n instanceof window.Element){var i=n.getBoundingClientRect();return o?i:ae(i,n)}var c=n.top,a=n.bottom,s=c.getBoundingClientRect(),u=a.getBoundingClientRect(),l=new window.DOMRect(s.left,s.top,s.width,u.bottom-s.top);return o?l:ae(l,n)}if(e.current){var f=e.current.parentNode,p=f.getBoundingClientRect();return o?p:ae(p,f)}}(G,R,x,_,P);if(e){var t,r,n=Y.current,o=n.offsetParent,i=n.ownerDocument,c=0;if(o&&o!==i.body){var a=o.getBoundingClientRect();c=a.top,e=new window.DOMRect(e.left-a.left,e.top-a.top,e.width,e.height)}H&&(t=null===(r=Y.current.closest(".popover-slot"))||void 0===r?void 0:r.parentNode);var s=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"top",n=arguments.length>3?arguments[3]:void 0,o=arguments.length>4?arguments[4]:void 0,i=arguments.length>5?arguments[5]:void 0,c=arguments.length>6?arguments[6]:void 0,a=r.split(" "),s=Object(b.a)(a,3),u=s[0],l=s[1],f=void 0===l?"center":l,p=s[2],d=k(e,t,u,p,n,o,i),h=S(e,t,f,p,n,d.yAxis,c);return w(w({},h),d)}(e,fe.height?fe:W.current.getBoundingClientRect(),m,I,Y.current,c,t),u=s.popoverTop,l=s.popoverLeft,f=s.xAxis,h=s.yAxis,v=s.contentHeight,y=s.contentWidth;"number"==typeof u&&"number"==typeof l&&(ue(Y.current,"top",u+"px"),ue(Y.current,"left",l+"px")),le(Y.current,"is-without-arrow",p||"center"===f&&"middle"===h),le(Y.current,"is-alternate",d),se(Y.current,"data-x-axis",f),se(Y.current,"data-y-axis",h),ue(W.current,"maxHeight","number"==typeof v?v+"px":""),ue(W.current,"maxWidth","number"==typeof y?y+"px":""),Z(({left:"right",right:"left"}[f]||"center")+" "+({top:"bottom",bottom:"top"}[h]||"middle"))}}};e();var t,r,n=window.setInterval(e,500),o=function(){window.cancelAnimationFrame(t),t=window.requestAnimationFrame(e)};return window.addEventListener("click",o),window.addEventListener("resize",e),window.addEventListener("scroll",e,!0),U&&(r=new window.MutationObserver(e)).observe(U,{attributes:!0}),function(){window.clearInterval(n),window.removeEventListener("resize",e),window.removeEventListener("scroll",e,!0),window.removeEventListener("click",o),window.cancelAnimationFrame(t),r&&r.disconnect()}}),[ee,R,x,_,P,m,fe,I,U,H]),function(e,t){Object(i.useEffect)((function(){var r=setTimeout((function(){if(e&&t.current)if("firstElement"!==e)"container"===e&&t.current.focus();else{var r=g.focus.tabbable.find(t.current)[0];r?r.focus():t.current.focus()}}),0);return function(){return clearTimeout(r)}}),[])}(j,W);var pe=function(e){e.keyCode===v.ESCAPE&&r&&(e.stopPropagation(),r()),c&&c(e)},de=Object(i.createElement)(D,{onFocusOutside:function(e){if(N)N(e);else if(M){var t;try{t=new window.MouseEvent("click")}catch(e){(t=document.createEvent("MouseEvent")).initMouseEvent("click",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null)}Object.defineProperty(t,"target",{get:function(){return e.relatedTarget}}),l()("Popover onClickOutside prop",{alternative:"onFocusOutside"}),M(t)}else r&&r()}},Object(i.createElement)(ie,{type:A&&$?"appear":null,options:{origin:$}},(function(e){var o=e.className;return Object(i.createElement)(V,Object(n.a)({className:a()("components-popover",u,o,{"is-expanded":ee,"is-without-arrow":p,"is-alternate":d})},q,{onKeyDown:pe,ref:Y}),ee&&Object(i.createElement)(F,null),ee&&Object(i.createElement)("div",{className:"components-popover__header"},Object(i.createElement)("span",{className:"components-popover__header-title"},t),Object(i.createElement)(ve,{className:"components-popover__close",icon:O.a,onClick:r})),Object(i.createElement)("div",{ref:W,className:"components-popover__content",tabIndex:"-1"},Object(i.createElement)("div",{style:{position:"relative"}},oe,s)))})));return j&&(de=Object(i.createElement)(ce,null,de)),Q.ref&&(de=Object(i.createElement)(te,{name:B},de)),_||R?de:Object(i.createElement)("span",{ref:G},de)};fe.Slot=function(e){var t=e.name,r=void 0===t?"Popover":t;return Object(i.createElement)(ee,{bubblesVirtually:!0,name:r,className:"popover-slot"})};var pe=fe,de=function(e){var t,r,n=e.shortcut,o=e.className;return n?(Object(s.isString)(n)&&(t=n),Object(s.isObject)(n)&&(t=n.display,r=n.ariaLabel),Object(i.createElement)("span",{className:o,"aria-label":r},t)):null};var he=function(e){Object(d.a)(o,e);var t,r,n=(t=o,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,n=Object(m.a)(t);if(r){var o=Object(m.a)(this).constructor;e=Reflect.construct(n,arguments,o)}else e=n.apply(this,arguments);return Object(h.a)(this,e)});function o(){var e;return Object(f.a)(this,o),(e=n.apply(this,arguments)).delayedSetIsOver=Object(s.debounce)((function(t){return e.setState({isOver:t})}),700),e.cancelIsMouseDown=e.createSetIsMouseDown(!1),e.isInMouseDown=!1,e.state={isOver:!1},e}return Object(p.a)(o,[{key:"componentWillUnmount",value:function(){this.delayedSetIsOver.cancel(),document.removeEventListener("mouseup",this.cancelIsMouseDown)}},{key:"emitToChild",value:function(e,t){var r=this.props.children;if(1===i.Children.count(r)){var n=i.Children.only(r);"function"==typeof n.props[e]&&n.props[e](t)}}},{key:"createToggleIsOver",value:function(e,t){var r=this;return function(n){if(r.emitToChild(e,n),!(n.currentTarget.disabled||"focus"===n.type&&r.isInMouseDown)){r.delayedSetIsOver.cancel();var o=Object(s.includes)(["focus","mouseenter"],n.type);o!==r.state.isOver&&(t?r.delayedSetIsOver(o):r.setState({isOver:o}))}}}},{key:"createSetIsMouseDown",value:function(e){var t=this;return function(r){t.emitToChild(e?"onMouseDown":"onMouseUp",r),document[e?"addEventListener":"removeEventListener"]("mouseup",t.cancelIsMouseDown),t.isInMouseDown=e}}},{key:"render",value:function(){var e=this.props,t=e.children,r=e.position,n=e.text,o=e.shortcut;if(1!==i.Children.count(t))return t;var c=i.Children.only(t),a=this.state.isOver;return Object(i.cloneElement)(c,{onMouseEnter:this.createToggleIsOver("onMouseEnter",!0),onMouseLeave:this.createToggleIsOver("onMouseLeave"),onClick:this.createToggleIsOver("onClick"),onFocus:this.createToggleIsOver("onFocus"),onBlur:this.createToggleIsOver("onBlur"),onMouseDown:this.createSetIsMouseDown(!0),children:Object(i.concatChildren)(c.props.children,a&&Object(i.createElement)(pe,{focusOnMount:!1,position:r,className:"components-tooltip","aria-hidden":"true",animate:!1,noArrow:!0},n,Object(i.createElement)(de,{className:"components-tooltip__shortcut",shortcut:o})))})}}]),o}(i.Component),me=r(91);function be(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var ge=["onMouseDown","onClick"],ve=t.a=Object(i.forwardRef)((function(e,t){var r=e.href,c=e.target,u=e.isPrimary,f=e.isSmall,p=e.isTertiary,d=e.isPressed,h=e.isBusy,m=e.isDefault,b=e.isSecondary,g=e.isLink,v=e.isDestructive,y=e.className,O=e.disabled,E=e.icon,j=e.iconSize,w=e.showTooltip,S=e.tooltipPosition,k=e.shortcut,_=e.label,P=e.children,R=e.__experimentalIsFocusable,x=Object(o.a)(e,["href","target","isPrimary","isSmall","isTertiary","isPressed","isBusy","isDefault","isSecondary","isLink","isDestructive","className","disabled","icon","iconSize","showTooltip","tooltipPosition","shortcut","label","children","__experimentalIsFocusable"]);m&&l()("Button isDefault prop",{alternative:"isSecondary"});var C=a()("components-button",y,{"is-secondary":m||b,"is-primary":u,"is-small":f,"is-tertiary":p,"is-pressed":d,"is-busy":h,"is-link":g,"is-destructive":v,"has-text":!!E&&!!P,"has-icon":!!E}),T=O&&!R,A=void 0===r||T?"button":"a",M="a"===A?{href:r,target:c}:{type:"button",disabled:T,"aria-pressed":d};if(O&&R){M["aria-disabled"]=!0;var N,D=function(e,t){var r;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return be(e,void 0);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?be(e,void 0):void 0}}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,c=!0,a=!1;return{s:function(){r=e[Symbol.iterator]()},n:function(){var e=r.next();return c=e.done,e},e:function(e){a=!0,i=e},f:function(){try{c||null==r.return||r.return()}finally{if(a)throw i}}}}(ge);try{for(D.s();!(N=D.n()).done;)x[N.value]=function(e){e.stopPropagation(),e.preventDefault()}}catch(e){D.e(e)}finally{D.f()}}var I=!T&&(w&&_||k||!!_&&(!P||Object(s.isArray)(P)&&!P.length)&&!1!==w),F=Object(i.createElement)(A,Object(n.a)({},M,x,{className:C,"aria-label":x["aria-label"]||_,ref:t}),E&&Object(i.createElement)(me.a,{icon:E,size:j}),P);return I?Object(i.createElement)(he,{text:_,shortcut:k,position:S},F):F}))},function(e,t){e.exports=function(e,t){if(null==e)return{};var r,n,o={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(o[r]=e[r]);return o},e.exports.default=e.exports,e.exports.__esModule=!0},,function(e,t,r){"use strict";var n=r(80);function o(){}function i(){}i.resetWarningCache=o,e.exports=function(){function e(e,t,r,o,i,c){if(c!==n){var a=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw a.name="Invariant Violation",a}}function t(){return e}e.isRequired=e;var r={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:i,resetWarningCache:o};return r.PropTypes=r,r}},function(e,t,r){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},function(e,t){},function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));var n=r(3);function o(e,t,r){void 0===r&&(r={});var o=r.maxWait,i=Object(n.useRef)(null),c=Object(n.useRef)([]),a=r.leading,s=void 0===r.trailing||r.trailing,u=Object(n.useRef)(!1),l=Object(n.useRef)(null),f=Object(n.useRef)(!1),p=Object(n.useRef)(e);p.current=e;var d=Object(n.useCallback)((function(){clearTimeout(l.current),clearTimeout(i.current),i.current=null,c.current=[],l.current=null,u.current=!1}),[]);Object(n.useEffect)((function(){return f.current=!1,function(){f.current=!0}}),[]);var h=Object(n.useCallback)((function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];c.current=e,clearTimeout(l.current),u.current&&(u.current=!1),l.current||!a||u.current||(p.current.apply(p,e),u.current=!0),l.current=setTimeout((function(){var t=!0;a&&u.current&&(t=!1),d(),!f.current&&s&&t&&p.current.apply(p,e)}),t),o&&!i.current&&s&&(i.current=setTimeout((function(){var e=c.current;d(),f.current||p.current.apply(null,e)}),o))}),[o,t,d,a,s]),m=Object(n.useCallback)((function(){l.current&&(p.current.apply(null,c.current),d())}),[d]);return[h,d,m]}},function(e,t,r){"use strict";r.d(t,"n",(function(){return i})),r.d(t,"l",(function(){return c})),r.d(t,"k",(function(){return a})),r.d(t,"m",(function(){return s})),r.d(t,"i",(function(){return u})),r.d(t,"d",(function(){return l})),r.d(t,"f",(function(){return f})),r.d(t,"j",(function(){return p})),r.d(t,"c",(function(){return d})),r.d(t,"e",(function(){return h})),r.d(t,"g",(function(){return m})),r.d(t,"a",(function(){return b})),r.d(t,"h",(function(){return g})),r.d(t,"b",(function(){return v}));var n,o=r(2),i=Object(o.getSetting)("wcBlocksConfig",{buildPhase:1,pluginUrl:"",productCount:0,defaultAvatar:"",restApiRoutes:{},wordCountType:"words"}),c=i.pluginUrl+"images/",a=i.pluginUrl+"build/",s=i.buildPhase,u=null===(n=o.STORE_PAGES.shop)||void 0===n?void 0:n.permalink,l=(o.STORE_PAGES.checkout.id,o.STORE_PAGES.checkout.permalink),f=o.STORE_PAGES.privacy.permalink,p=(o.STORE_PAGES.privacy.title,o.STORE_PAGES.terms.permalink),d=(o.STORE_PAGES.terms.title,o.STORE_PAGES.cart.id,o.STORE_PAGES.cart.permalink),h=o.STORE_PAGES.myaccount.permalink?o.STORE_PAGES.myaccount.permalink:Object(o.getSetting)("wpLoginUrl","/wp-login.php"),m=Object(o.getSetting)("shippingCountries",{}),b=Object(o.getSetting)("allowedCountries",{}),g=Object(o.getSetting)("shippingStates",{}),v=Object(o.getSetting)("allowedStates",{})},function(e,t){e.exports=function(e){if(Array.isArray(e))return e},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,i=[],_n=!0,c=!1;try{for(r=r.call(e);!(_n=(n=r.next()).done)&&(i.push(n.value),!t||i.length!==t);_n=!0);}catch(e){c=!0,o=e}finally{try{_n||null==r.return||r.return()}finally{if(c)throw o}}return i}},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,r){"use strict";var n=r(4),o=r.n(n),i=r(5),c=r.n(i),a=r(2),s=r(1),u=r(49);function l(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function f(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?l(Object(r),!0).forEach((function(t){o()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):l(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var p=Object(a.getSetting)("countryLocale",{}),d=function(e){var t={};return void 0!==e.label&&(t.label=e.label),void 0!==e.required&&(t.required=e.required),void 0!==e.hidden&&(t.hidden=e.hidden),void 0===e.label||e.optionalLabel||(t.optionalLabel=Object(s.sprintf)(
/* translators: %s Field label. */
Object(s.__)("%s (optional)",'woocommerce'),e.label)),e.priority&&(Object(u.a)(e.priority)&&(t.index=e.priority),Object(u.c)(e.priority)&&(t.index=parseInt(e.priority,10))),e.hidden&&(t.required=!1),t},h=Object.entries(p).map((function(e){var t=c()(e,2),r=t[0],n=t[1];return[r,Object.entries(n).map((function(e){var t=c()(e,2),r=t[0],n=t[1];return[r,d(n)]})).reduce((function(e,t){var r=c()(t,2),n=r[0],o=r[1];return e[n]=o,e}),{})]})).reduce((function(e,t){var r=c()(t,2),n=r[0],o=r[1];return e[n]=o,e}),{});t.a=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",n=r&&void 0!==h[r]?h[r]:{};return e.map((function(e){var r=a.defaultAddressFields[e]||{},o=n[e]||{},i=t[e]||{};return f(f(f({key:e},r),o),i)})).sort((function(e,t){return e.index-t.index}))}},function(e,t,r){"use strict";function n(e,t){return(n=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}r.d(t,"a",(function(){return n}))},function(e,t,r){"use strict";var n=r(12),o=r(15),i=r(16),c=r(13),a=r(17),s=r(18),u=r(9),l=r(0),f=r(7),p=r(24);var d=["button","submit"];t.a=Object(p.createHigherOrderComponent)((function(e){return function(t){Object(a.a)(m,t);var r,p,h=(r=m,p=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=Object(u.a)(r);if(p){var n=Object(u.a)(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return Object(s.a)(this,e)});function m(){var e;return Object(o.a)(this,m),(e=h.apply(this,arguments)).bindNode=e.bindNode.bind(Object(c.a)(e)),e.cancelBlurCheck=e.cancelBlurCheck.bind(Object(c.a)(e)),e.queueBlurCheck=e.queueBlurCheck.bind(Object(c.a)(e)),e.normalizeButtonFocus=e.normalizeButtonFocus.bind(Object(c.a)(e)),e}return Object(i.a)(m,[{key:"componentWillUnmount",value:function(){this.cancelBlurCheck()}},{key:"bindNode",value:function(e){e?this.node=e:(delete this.node,this.cancelBlurCheck())}},{key:"queueBlurCheck",value:function(e){var t=this;e.persist(),this.preventBlurCheck||(this.blurCheckTimeout=setTimeout((function(){document.hasFocus()?"function"==typeof t.node.handleFocusOutside&&t.node.handleFocusOutside(e):e.preventDefault()}),0))}},{key:"cancelBlurCheck",value:function(){clearTimeout(this.blurCheckTimeout)}},{key:"normalizeButtonFocus",value:function(e){var t=e.type,r=e.target;Object(f.includes)(["mouseup","touchend"],t)?this.preventBlurCheck=!1:function(e){switch(e.nodeName){case"A":case"BUTTON":return!0;case"INPUT":return Object(f.includes)(d,e.type)}return!1}(r)&&(this.preventBlurCheck=!0)}},{key:"render",value:function(){return Object(l.createElement)("div",{onFocus:this.cancelBlurCheck,onMouseDown:this.normalizeButtonFocus,onMouseUp:this.normalizeButtonFocus,onTouchStart:this.normalizeButtonFocus,onTouchEnd:this.normalizeButtonFocus,onBlur:this.queueBlurCheck},Object(l.createElement)(e,Object(n.a)({ref:this.bindNode},this.props)))}}]),m}(l.Component)}),"withFocusOutside")},,function(e,t,r){"use strict";var n=r(20),o=r(12),i=r(19),c=r(0),a=r(34),s=function(e){var t=e.icon,r=e.className,n=Object(i.a)(e,["icon","className"]),a=["dashicon","dashicons","dashicons-"+t,r].filter(Boolean).join(" ");return Object(c.createElement)("span",Object(o.a)({className:a},n))};function u(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function l(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?u(Object(r),!0).forEach((function(t){Object(n.a)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):u(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}t.a=function(e){var t=e.icon,r=void 0===t?null:t,n=e.size,u=Object(i.a)(e,["icon","size"]);if("string"==typeof r)return Object(c.createElement)(s,Object(o.a)({icon:r},u));if(r&&s===r.type)return Object(c.cloneElement)(r,l({},u));var f=n||24;if("function"==typeof r)return r.prototype instanceof c.Component?Object(c.createElement)(r,l({size:f},u)):r(l({size:f},u));if(r&&("svg"===r.type||r.type===a.SVG)){var p=l(l({width:f,height:f},r.props),u);return Object(c.createElement)(a.SVG,p)}return Object(c.isValidElement)(r)?Object(c.cloneElement)(r,l({size:f},u)):r}},function(e,t,r){"use strict";r.d(t,"a",(function(){return i}));var n=r(5),o=r.n(n),i=function(e){return e.reduce((function(e,t){var r=o()(t,2),n=r[0],i=r[1];return e[n]=i,e}),{})}},function(e,t,r){"use strict";r.d(t,"b",(function(){return c})),r.d(t,"c",(function(){return a})),r.d(t,"a",(function(){return s}));var n=r(2),o=r(87),i=r(72),c=function(e){var t=e.country,r=void 0===t?"":t,n=e.state,o=void 0===n?"":n,i=e.city,c=void 0===i?"":i,a=e.postcode,s=void 0===a?"":a;return{country:r.trim(),state:o.trim(),city:c.trim(),postcode:s?s.replace(" ","").toUpperCase():""}},a=function(e){var t=e.email,r=void 0===t?"":t;return Object(i.isEmail)(r)?r.trim():""},s=function(e){var t=Object.keys(n.defaultAddressFields),r=Object(o.a)(t,{},e.country),i=Object.assign({},e);return r.forEach((function(t){var r=t.key,n=void 0===r?"":r,o=t.hidden;void 0!==o&&o&&function(e,t){return e in t}(n,e)&&(i[n]="")})),i}},function(e,t,r){var n=r(68);e.exports=function(e){if(Array.isArray(e))return n(e)},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=window.wp.autop},function(e,t,r){"use strict";r.d(t,"a",(function(){return u})),r.d(t,"b",(function(){return f}));var n,o=r(4),i=r.n(o),c=r(7);function a(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function s(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?a(Object(r),!0).forEach((function(t){i()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):a(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}!function(e){e.ADD_EVENT_CALLBACK="add_event_callback",e.REMOVE_EVENT_CALLBACK="remove_event_callback"}(n||(n={}));var u={addEventCallback:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:10;return{id:Object(c.uniqueId)(),type:n.ADD_EVENT_CALLBACK,eventType:e,callback:t,priority:r}},removeEventCallback:function(e,t){return{id:t,type:n.REMOVE_EVENT_CALLBACK,eventType:e}}},l={},f=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:l,t=arguments.length>1?arguments[1]:void 0,r=t.type,o=t.eventType,c=t.id,a=t.callback,u=t.priority,f=e.hasOwnProperty(o)?new Map(e[o]):new Map;switch(r){case n.ADD_EVENT_CALLBACK:return f.set(c,{priority:u,callback:a}),s(s({},e),{},i()({},o,f));case n.REMOVE_EVENT_CALLBACK:return f.delete(c),s(s({},e),{},i()({},o,f))}}},function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));var n=r(3);function o(e,t){var r=Object(n.useRef)();return Object(n.useEffect)((function(){r.current===e||t&&!t(e,r.current)||(r.current=e)}),[e,t]),r.current}},function(e,t,r){"use strict";r.d(t,"a",(function(){return c}));var n=r(5),o=r.n(n),i=r(0),c=function(){var e=Object(i.useState)(),t=o()(e,2)[1];return Object(i.useCallback)((function(e){t((function(){throw e}))}),[])}},,function(e,t){var r,n,o=e.exports={};function i(){throw new Error("setTimeout has not been defined")}function c(){throw new Error("clearTimeout has not been defined")}function a(e){if(r===setTimeout)return setTimeout(e,0);if((r===i||!r)&&setTimeout)return r=setTimeout,setTimeout(e,0);try{return r(e,0)}catch(t){try{return r.call(null,e,0)}catch(t){return r.call(this,e,0)}}}!function(){try{r="function"==typeof setTimeout?setTimeout:i}catch(e){r=i}try{n="function"==typeof clearTimeout?clearTimeout:c}catch(e){n=c}}();var s,u=[],l=!1,f=-1;function p(){l&&s&&(l=!1,s.length?u=s.concat(u):f=-1,u.length&&d())}function d(){if(!l){var e=a(p);l=!0;for(var t=u.length;t;){for(s=u,u=[];++f<t;)s&&s[f].run();f=-1,t=u.length}s=null,l=!1,function(e){if(n===clearTimeout)return clearTimeout(e);if((n===c||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(e);try{n(e)}catch(t){try{return n.call(null,e)}catch(t){return n.call(this,e)}}}(e)}}function h(e,t){this.fun=e,this.array=t}function m(){}o.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];u.push(new h(e,t)),1!==u.length||l||a(d)},h.prototype.run=function(){this.fun.apply(null,this.array)},o.title="browser",o.browser=!0,o.env={},o.argv=[],o.version="",o.versions={},o.on=m,o.addListener=m,o.once=m,o.off=m,o.removeListener=m,o.removeAllListeners=m,o.emit=m,o.prependListener=m,o.prependOnceListener=m,o.listeners=function(e){return[]},o.binding=function(e){throw new Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(e){throw new Error("process.chdir is not supported")},o.umask=function(){return 0}},function(e,t,r){"use strict";r.d(t,"b",(function(){return E})),r.d(t,"a",(function(){return j}));var n=r(4),o=r.n(n),i=r(5),c=r.n(i),a=(r(10),r(0)),s=r(11),u=r(52),l=r(36),f=r(14),p=r.n(f),d=r(6),h=r.n(d),m=r(153),b=(r(112),function(e){var t=e.status;switch(void 0===t?"default":t){case"error":return"woocommerce-error";case"success":return"woocommerce-message";case"info":case"warning":return"woocommerce-info"}return""}),g=function(e){var t=e.className,r=e.notices,n=e.removeNotice,o=r.filter((function(e){return"snackbar"!==e.type}));if(!o.length)return null;var i=h()(t,"wc-block-components-notices");return React.createElement("div",{className:i},o.map((function(e){return React.createElement(m.a,p()({key:"store-notice-"+e.id},e,{className:h()("wc-block-components-notices__notice",b(e)),onRemove:function(){e.isDismissible&&n(e.id)}}),e.content)})))};function v(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function y(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?v(Object(r),!0).forEach((function(t){o()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):v(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var O=Object(a.createContext)({notices:[],createNotice:function(e,t,r){},removeNotice:function(e,t){},setIsSuppressed:function(e){},context:"wc/core"}),E=function(){return Object(a.useContext)(O)},j=function(e){var t=e.children,r=e.className,n=void 0===r?"":r,o=e.createNoticeContainer,i=void 0===o||o,f=e.context,p=void 0===f?"wc/core":f,d=Object(s.useDispatch)("core/notices"),h=d.createNotice,m=d.removeNotice,b=Object(a.useState)(!1),v=c()(b,2),E=v[0],j=v[1],w=Object(u.a)().dispatchStoreEvent,S=Object(l.a)().isEditor,k=Object(a.useCallback)((function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};h(e,t,y(y({},r),{},{context:r.context||p})),w("store-notice-create",{status:e,content:t,options:r})}),[h,w,p]),_=Object(a.useCallback)((function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:p;m(e,t)}),[m,p]),P={notices:Object(s.useSelect)((function(e){return{notices:e("core/notices").getNotices(p)}}),[p]).notices,createNotice:k,removeNotice:_,context:p,setIsSuppressed:j},R=E?null:React.createElement(g,{className:n,notices:P.notices,removeNotice:P.removeNotice,isEditor:S});return React.createElement(O.Provider,{value:P},i&&R,t)}},,,,function(e,t,r){"use strict";r.d(t,"a",(function(){return d}));var n=r(14),o=r.n(n),i=r(4),c=r.n(i),a=r(0),s=r(44);function u(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function l(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?u(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):u(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var f=[".wp-block-woocommerce-cart"],p=function(e){var t=e.Block,r=e.containers,n=e.getProps,i=void 0===n?function(){return{}}:n,c=e.getErrorBoundaryProps,u=void 0===c?function(){return{}}:c;0!==r.length&&Array.prototype.forEach.call(r,(function(e,r){var n=i(e,r),c=u(e,r),f=l(l({},e.dataset),n.attributes||{});e.classList.remove("is-loading"),Object(a.render)(React.createElement(s.a,c,React.createElement(a.Suspense,{fallback:React.createElement("div",{className:"wc-block-placeholder"})},React.createElement(t,o()({},n,{attributes:f})))),e)}))},d=function(e){var t,r,n,o,i,c,a,s=document.body.querySelectorAll(f.join(","));t=l(l({},e),{},{wrappers:s}),r=t.Block,n=t.getProps,o=t.getErrorBoundaryProps,i=t.selector,c=t.wrappers,a=document.body.querySelectorAll(i),c.length>0&&Array.prototype.filter.call(a,(function(e){return!function(e,t){return Array.prototype.some.call(t,(function(t){return t.contains(e)&&!t.isSameNode(e)}))}(e,c)})),p({Block:r,containers:a,getProps:n,getErrorBoundaryProps:o}),Array.prototype.forEach.call(s,(function(t){t.addEventListener("wc-blocks_render_blocks_frontend",(function(){var r,n,o,i,c,a;n=(r=l(l({},e),{},{wrapper:t})).Block,o=r.getProps,i=r.getErrorBoundaryProps,c=r.selector,a=r.wrapper.querySelectorAll(c),p({Block:n,containers:a,getProps:o,getErrorBoundaryProps:i})}))}))}},,,,,function(e,t){},function(e,t){e.exports=window.wp.wordcount},function(e,t,r){"use strict";var n=r(14),o=r.n(n),i=r(0),c=(r(142),function(e){if(e){var t=e.getBoundingClientRect().bottom;t>=0&&t<=window.innerHeight||e.scrollIntoView()}});t.a=function(e){return function(t){var r=Object(i.useRef)(null);return React.createElement(React.Fragment,null,React.createElement("div",{className:"with-scroll-to-top__scroll-point",ref:r,"aria-hidden":!0}),React.createElement(e,o()({},t,{scrollToTop:function(e){var t,n;null!==r.current&&(t=r.current,n=(e||{}).focusableSelector,window&&Number.isFinite(window.innerHeight)&&(n?function(e,t){var r,n=(null===(r=e.parentElement)||void 0===r?void 0:r.querySelectorAll(t))||[];if(n.length){var o=n[0];c(o),null==o||o.focus()}else c(e)}(t,n):c(t)))}})))}}},function(e,t,r){"use strict";r.d(t,"a",(function(){return c}));var n=r(3),o=r(82);function i(e,t){return e===t}function c(e,t,r){var c=r&&r.equalityFn?r.equalityFn:i,a=Object(n.useState)(e),s=a[0],u=a[1],l=Object(o.a)(Object(n.useCallback)((function(e){return u(e)}),[]),t,r),f=l[0],p=l[1],d=l[2],h=Object(n.useRef)(e);return Object(n.useEffect)((function(){c(h.current,e)||(f(e),h.current=e)}),[e,f,c]),[s,p,d]}},function(e,t,r){"use strict";var n=r(0),o=r(34),i=Object(n.createElement)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(n.createElement)(o.Path,{d:"M13 11.8l6.1-6.3-1-1-6.1 6.2-6.1-6.2-1 1 6.1 6.3-6.5 6.7 1 1 6.5-6.6 6.5 6.6 1-1z"}));t.a=i},function(e,t,r){"use strict";function n(e){return e&&"object"==typeof e&&"default"in e?e.default:e}Object.defineProperty(t,"__esModule",{value:!0});var o=n(r(14)),i=n(r(77)),c=r(3),a=n(c),s=n(r(144)),u=n(r(29)),l={arr:Array.isArray,obj:function(e){return"[object Object]"===Object.prototype.toString.call(e)},fun:function(e){return"function"==typeof e},str:function(e){return"string"==typeof e},num:function(e){return"number"==typeof e},und:function(e){return void 0===e},nul:function(e){return null===e},set:function(e){return e instanceof Set},map:function(e){return e instanceof Map},equ:function(e,t){if(typeof e!=typeof t)return!1;if(l.str(e)||l.num(e))return e===t;if(l.obj(e)&&l.obj(t)&&Object.keys(e).length+Object.keys(t).length===0)return!0;var r;for(r in e)if(!(r in t))return!1;for(r in t)if(e[r]!==t[r])return!1;return!l.und(r)||e===t}};function f(){var e=c.useState(!1)[1];return c.useCallback((function(){return e((function(e){return!e}))}),[])}function p(e,t){return l.und(e)||l.nul(e)?t:e}function d(e){return l.und(e)?[]:l.arr(e)?e:[e]}function h(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];return l.fun(e)?e.apply(void 0,r):e}function m(e){var t=function(e){return e.to,e.from,e.config,e.onStart,e.onRest,e.onFrame,e.children,e.reset,e.reverse,e.force,e.immediate,e.delay,e.attach,e.destroyed,e.interpolateTo,e.ref,e.lazy,i(e,["to","from","config","onStart","onRest","onFrame","children","reset","reverse","force","immediate","delay","attach","destroyed","interpolateTo","ref","lazy"])}(e);if(l.und(t))return o({to:t},e);var r=Object.keys(e).reduce((function(r,n){var i;return l.und(t[n])?o({},r,((i={})[n]=e[n],i)):r}),{});return o({to:t},r)}var b,g,v=function(){function e(){this.payload=void 0,this.children=[]}var t=e.prototype;return t.getAnimatedValue=function(){return this.getValue()},t.getPayload=function(){return this.payload||this},t.attach=function(){},t.detach=function(){},t.getChildren=function(){return this.children},t.addChild=function(e){0===this.children.length&&this.attach(),this.children.push(e)},t.removeChild=function(e){var t=this.children.indexOf(e);this.children.splice(t,1),0===this.children.length&&this.detach()},e}(),y=function(e){function t(){for(var t,r=arguments.length,n=new Array(r),o=0;o<r;o++)n[o]=arguments[o];return(t=e.call.apply(e,[this].concat(n))||this).payload=[],t.attach=function(){return t.payload.forEach((function(e){return e instanceof v&&e.addChild(u(t))}))},t.detach=function(){return t.payload.forEach((function(e){return e instanceof v&&e.removeChild(u(t))}))},t}return s(t,e),t}(v),O=function(e){function t(){for(var t,r=arguments.length,n=new Array(r),o=0;o<r;o++)n[o]=arguments[o];return(t=e.call.apply(e,[this].concat(n))||this).payload={},t.attach=function(){return Object.values(t.payload).forEach((function(e){return e instanceof v&&e.addChild(u(t))}))},t.detach=function(){return Object.values(t.payload).forEach((function(e){return e instanceof v&&e.removeChild(u(t))}))},t}s(t,e);var r=t.prototype;return r.getValue=function(e){void 0===e&&(e=!1);var t={};for(var r in this.payload){var n=this.payload[r];(!e||n instanceof v)&&(t[r]=n instanceof v?n[e?"getAnimatedValue":"getValue"]():n)}return t},r.getAnimatedValue=function(){return this.getValue(!0)},t}(v);function E(e,t){b={fn:e,transform:t}}function j(e){g=e}var w,S=function(e){return"undefined"!=typeof window?window.requestAnimationFrame(e):-1},k=function(e){"undefined"!=typeof window&&window.cancelAnimationFrame(e)};function _(e){w=e}var P,R=function(){return Date.now()};function x(e){P=e}var C,T,A=function(e){return e.current};function M(e){C=e}var N=Object.freeze({get applyAnimatedValues(){return b},injectApplyAnimatedValues:E,get colorNames(){return g},injectColorNames:j,get requestFrame(){return S},get cancelFrame(){return k},injectFrame:function(e,t){S=e,k=t},get interpolation(){return w},injectStringInterpolator:_,get now(){return R},injectNow:function(e){R=e},get defaultElement(){return P},injectDefaultElement:x,get animatedApi(){return A},injectAnimatedApi:function(e){A=e},get createAnimatedStyle(){return C},injectCreateAnimatedStyle:M,get manualFrameloop(){return T},injectManualFrameloop:function(e){T=e}}),D=function(e){function t(t,r){var n;return(n=e.call(this)||this).update=void 0,n.payload=t.style?o({},t,{style:C(t.style)}):t,n.update=r,n.attach(),n}return s(t,e),t}(O),I=!1,F=new Set,L=function e(){if(!I)return!1;var t=R(),r=F,n=Array.isArray(r),o=0;for(r=n?r:r[Symbol.iterator]();;){var i;if(n){if(o>=r.length)break;i=r[o++]}else{if((o=r.next()).done)break;i=o.value}for(var c=i,a=!1,s=0;s<c.configs.length;s++){for(var u=c.configs[s],l=void 0,f=void 0,p=0;p<u.animatedValues.length;p++){var d=u.animatedValues[p];if(!d.done){var h=u.fromValues[p],m=u.toValues[p],b=d.lastPosition,g=m instanceof v,y=Array.isArray(u.initialVelocity)?u.initialVelocity[p]:u.initialVelocity;if(g&&(m=m.getValue()),u.immediate)d.setValue(m),d.done=!0;else if("string"!=typeof h&&"string"!=typeof m){if(void 0!==u.duration)b=h+u.easing((t-d.startTime)/u.duration)*(m-h),l=t>=d.startTime+u.duration;else if(u.decay)b=h+y/(1-.998)*(1-Math.exp(-(1-.998)*(t-d.startTime))),(l=Math.abs(d.lastPosition-b)<.1)&&(m=b);else{f=void 0!==d.lastTime?d.lastTime:t,y=void 0!==d.lastVelocity?d.lastVelocity:u.initialVelocity,t>f+64&&(f=t);for(var O=Math.floor(t-f),E=0;E<O;++E)b+=1*(y+=(-u.tension*(b-m)+-u.friction*y)/u.mass*1/1e3)/1e3;var j=!(!u.clamp||0===u.tension)&&(h<m?b>m:b<m),w=Math.abs(y)<=u.precision,k=0===u.tension||Math.abs(m-b)<=u.precision;l=j||w&&k,d.lastVelocity=y,d.lastTime=t}g&&!u.toValues[p].done&&(l=!1),l?(d.value!==m&&(b=m),d.done=!0):a=!0,d.setValue(b),d.lastPosition=b}else d.setValue(m),d.done=!0}}c.props.onFrame&&(c.values[u.name]=u.interpolation.getValue())}c.props.onFrame&&c.props.onFrame(c.values),a||(F.delete(c),c.stop(!0))}return F.size?T?T():S(e):I=!1,I};function V(e,t,r){if("function"==typeof e)return e;if(Array.isArray(e))return V({range:e,output:t,extrapolate:r});if(w&&"string"==typeof e.output[0])return w(e);var n=e,o=n.output,i=n.range||[0,1],c=n.extrapolateLeft||n.extrapolate||"extend",a=n.extrapolateRight||n.extrapolate||"extend",s=n.easing||function(e){return e};return function(e){var t=function(e,t){for(var r=1;r<t.length-1&&!(t[r]>=e);++r);return r-1}(e,i);return function(e,t,r,n,o,i,c,a,s){var u=s?s(e):e;if(u<t){if("identity"===c)return u;"clamp"===c&&(u=t)}if(u>r){if("identity"===a)return u;"clamp"===a&&(u=r)}return n===o?n:t===r?e<=t?n:o:(t===-1/0?u=-u:r===1/0?u-=t:u=(u-t)/(r-t),u=i(u),n===-1/0?u=-u:o===1/0?u+=n:u=u*(o-n)+n,u)}(e,i[t],i[t+1],o[t],o[t+1],s,c,a,n.map)}}var B=function(e){function t(r,n,o,i){var c;return(c=e.call(this)||this).calc=void 0,c.payload=r instanceof y&&!(r instanceof t)?r.getPayload():Array.isArray(r)?r:[r],c.calc=V(n,o,i),c}s(t,e);var r=t.prototype;return r.getValue=function(){return this.calc.apply(this,this.payload.map((function(e){return e.getValue()})))},r.updateConfig=function(e,t,r){this.calc=V(e,t,r)},r.interpolate=function(e,r,n){return new t(this,e,r,n)},t}(y),U=function(e){function t(t){var r;return(r=e.call(this)||this).animatedStyles=new Set,r.value=void 0,r.startPosition=void 0,r.lastPosition=void 0,r.lastVelocity=void 0,r.startTime=void 0,r.lastTime=void 0,r.done=!1,r.setValue=function(e,t){void 0===t&&(t=!0),r.value=e,t&&r.flush()},r.value=t,r.startPosition=t,r.lastPosition=t,r}s(t,e);var r=t.prototype;return r.flush=function(){0===this.animatedStyles.size&&function e(t,r){"update"in t?r.add(t):t.getChildren().forEach((function(t){return e(t,r)}))}(this,this.animatedStyles),this.animatedStyles.forEach((function(e){return e.update()}))},r.clearStyles=function(){this.animatedStyles.clear()},r.getValue=function(){return this.value},r.interpolate=function(e,t,r){return new B(this,e,t,r)},t}(v),H=function(e){function t(t){var r;return(r=e.call(this)||this).payload=t.map((function(e){return new U(e)})),r}s(t,e);var r=t.prototype;return r.setValue=function(e,t){var r=this;void 0===t&&(t=!0),Array.isArray(e)?e.length===this.payload.length&&e.forEach((function(e,n){return r.payload[n].setValue(e,t)})):this.payload.forEach((function(r){return r.setValue(e,t)}))},r.getValue=function(){return this.payload.map((function(e){return e.getValue()}))},r.interpolate=function(e,t){return new B(this,e,t)},t}(y),z=0,q=function(){function e(){var e=this;this.id=void 0,this.idle=!0,this.hasChanged=!1,this.guid=0,this.local=0,this.props={},this.merged={},this.animations={},this.interpolations={},this.values={},this.configs=[],this.listeners=[],this.queue=[],this.localQueue=void 0,this.getValues=function(){return e.interpolations},this.id=z++}var t=e.prototype;return t.update=function(e){if(!e)return this;var t=m(e),r=t.delay,n=void 0===r?0:r,c=t.to,a=i(t,["delay","to"]);if(l.arr(c)||l.fun(c))this.queue.push(o({},a,{delay:n,to:c}));else if(c){var s={};Object.entries(c).forEach((function(e){var t,r=e[0],i=e[1],c=o({to:(t={},t[r]=i,t),delay:h(n,r)},a),u=s[c.delay]&&s[c.delay].to;s[c.delay]=o({},s[c.delay],c,{to:o({},u,c.to)})})),this.queue=Object.values(s)}return this.queue=this.queue.sort((function(e,t){return e.delay-t.delay})),this.diff(a),this},t.start=function(e){var t=this;if(this.queue.length){this.idle=!1,this.localQueue&&this.localQueue.forEach((function(e){var r=e.from,n=void 0===r?{}:r,i=e.to,c=void 0===i?{}:i;l.obj(n)&&(t.merged=o({},n,t.merged)),l.obj(c)&&(t.merged=o({},t.merged,c))}));var r=this.local=++this.guid,n=this.localQueue=this.queue;this.queue=[],n.forEach((function(o,c){var a=o.delay,s=i(o,["delay"]),u=function(o){c===n.length-1&&r===t.guid&&o&&(t.idle=!0,t.props.onRest&&t.props.onRest(t.merged)),e&&e()},f=l.arr(s.to)||l.fun(s.to);a?setTimeout((function(){r===t.guid&&(f?t.runAsync(s,u):t.diff(s).start(u))}),a):f?t.runAsync(s,u):t.diff(s).start(u)}))}else l.fun(e)&&this.listeners.push(e),this.props.onStart&&this.props.onStart(),this,F.has(this)||F.add(this),I||(I=!0,S(T||L));return this},t.stop=function(e){return this.listeners.forEach((function(t){return t(e)})),this.listeners=[],this},t.pause=function(e){return this.stop(!0),e&&(this,F.has(this)&&F.delete(this)),this},t.runAsync=function(e,t){var r=this,n=(e.delay,i(e,["delay"])),c=this.local,a=Promise.resolve(void 0);if(l.arr(n.to))for(var s=function(e){var t=e,i=o({},n,m(n.to[t]));l.arr(i.config)&&(i.config=i.config[t]),a=a.then((function(){if(c===r.guid)return new Promise((function(e){return r.diff(i).start(e)}))}))},u=0;u<n.to.length;u++)s(u);else if(l.fun(n.to)){var f,p=0;a=a.then((function(){return n.to((function(e){var t=o({},n,m(e));if(l.arr(t.config)&&(t.config=t.config[p]),p++,c===r.guid)return f=new Promise((function(e){return r.diff(t).start(e)}))}),(function(e){return void 0===e&&(e=!0),r.stop(e)})).then((function(){return f}))}))}a.then(t)},t.diff=function(e){var t=this;this.props=o({},this.props,e);var r=this.props,n=r.from,i=void 0===n?{}:n,c=r.to,a=void 0===c?{}:c,s=r.config,u=void 0===s?{}:s,f=r.reverse,m=r.attach,b=r.reset,v=r.immediate;if(f){var y=[a,i];i=y[0],a=y[1]}this.merged=o({},i,this.merged,a),this.hasChanged=!1;var O=m&&m(this);if(this.animations=Object.entries(this.merged).reduce((function(e,r){var n=r[0],c=r[1],a=e[n]||{},s=l.num(c),f=l.str(c)&&!c.startsWith("#")&&!/\d/.test(c)&&!g[c],m=l.arr(c),y=!s&&!m&&!f,E=l.und(i[n])?c:i[n],j=s||m||f?c:1,S=h(u,n);O&&(j=O.animations[n].parent);var k,_=a.parent,P=a.interpolation,x=d(O?j.getPayload():j),C=c;y&&(C=w({range:[0,1],output:[c,c]})(1));var T,A=P&&P.getValue(),M=!l.und(_)&&a.animatedValues.some((function(e){return!e.done})),N=!l.equ(C,A),D=!l.equ(C,a.previous),I=!l.equ(S,a.config);if(b||D&&N||I){var F;if(s||f)_=P=a.parent||new U(E);else if(m)_=P=a.parent||new H(E);else if(y){var L=a.interpolation&&a.interpolation.calc(a.parent.value);L=void 0===L||b?E:L,a.parent?(_=a.parent).setValue(0,!1):_=new U(0);var V={output:[L,c]};a.interpolation?(P=a.interpolation,a.interpolation.updateConfig(V)):P=_.interpolate(V)}return x=d(O?j.getPayload():j),k=d(_.getPayload()),b&&!y&&_.setValue(E,!1),t.hasChanged=!0,k.forEach((function(e){e.startPosition=e.value,e.lastPosition=e.value,e.lastVelocity=M?e.lastVelocity:void 0,e.lastTime=M?e.lastTime:void 0,e.startTime=R(),e.done=!1,e.animatedStyles.clear()})),h(v,n)&&_.setValue(y?j:c,!1),o({},e,((F={})[n]=o({},a,{name:n,parent:_,interpolation:P,animatedValues:k,toValues:x,previous:C,config:S,fromValues:d(_.getValue()),immediate:h(v,n),initialVelocity:p(S.velocity,0),clamp:p(S.clamp,!1),precision:p(S.precision,.01),tension:p(S.tension,170),friction:p(S.friction,26),mass:p(S.mass,1),duration:S.duration,easing:p(S.easing,(function(e){return e})),decay:S.decay}),F))}return N?e:(y&&(_.setValue(1,!1),P.updateConfig({output:[C,C]})),_.done=!0,t.hasChanged=!0,o({},e,((T={})[n]=o({},e[n],{previous:C}),T)))}),this.animations),this.hasChanged)for(var E in this.configs=Object.values(this.animations),this.values={},this.interpolations={},this.animations)this.interpolations[E]=this.animations[E].interpolation,this.values[E]=this.animations[E].interpolation.getValue();return this},t.destroy=function(){this.stop(),this.props={},this.merged={},this.animations={},this.interpolations={},this.values={},this.configs=[],this.local=0},e}(),G=function(e,t){var r=c.useRef(!1),n=c.useRef(),o=l.fun(t),i=c.useMemo((function(){var r;return n.current&&(n.current.map((function(e){return e.destroy()})),n.current=void 0),[new Array(e).fill().map((function(e,n){var i=new q,c=o?h(t,n,i):t[n];return 0===n&&(r=c.ref),i.update(c),r||i.start(),i})),r]}),[e]),a=i[0],s=i[1];n.current=a,c.useImperativeHandle(s,(function(){return{start:function(){return Promise.all(n.current.map((function(e){return new Promise((function(t){return e.start(t)}))})))},stop:function(e){return n.current.forEach((function(t){return t.stop(e)}))},get controllers(){return n.current}}}));var u=c.useMemo((function(){return function(e){return n.current.map((function(t,r){t.update(o?h(e,r,t):e[r]),s||t.start()}))}}),[e]);c.useEffect((function(){r.current?o||u(t):s||n.current.forEach((function(e){return e.start()}))})),c.useEffect((function(){return r.current=!0,function(){return n.current.forEach((function(e){return e.destroy()}))}}),[]);var f=n.current.map((function(e){return e.getValues()}));return o?[f,u,function(e){return n.current.forEach((function(t){return t.pause(e)}))}]:f},W=0,Y=function(e,t){return("function"==typeof t?e.map(t):d(t)).map(String)},K=function(e){var t=e.items,r=e.keys,n=void 0===r?function(e){return e}:r,c=i(e,["items","keys"]);return t=d(void 0!==t?t:null),o({items:t,keys:Y(t,n)},c)};function X(e,t){var r=function(){if(o){if(i>=n.length)return"break";c=n[i++]}else{if((i=n.next()).done)return"break";c=i.value}var r=c.key,a=function(e){return e.key!==r};(l.und(t)||t===r)&&(e.current.instances.delete(r),e.current.transitions=e.current.transitions.filter(a),e.current.deleted=e.current.deleted.filter(a))},n=e.current.deleted,o=Array.isArray(n),i=0;for(n=o?n:n[Symbol.iterator]();;){var c;if("break"===r())break}e.current.forceUpdate()}var J=function(e){function t(t){var r;return void 0===t&&(t={}),r=e.call(this)||this,!t.transform||t.transform instanceof v||(t=b.transform(t)),r.payload=t,r}return s(t,e),t}(O),$={transparent:0,aliceblue:4042850303,antiquewhite:4209760255,aqua:16777215,aquamarine:2147472639,azure:4043309055,beige:4126530815,bisque:4293182719,black:255,blanchedalmond:4293643775,blue:65535,blueviolet:2318131967,brown:2771004159,burlywood:3736635391,burntsienna:3934150143,cadetblue:1604231423,chartreuse:2147418367,chocolate:3530104575,coral:4286533887,cornflowerblue:1687547391,cornsilk:4294499583,crimson:3692313855,cyan:16777215,darkblue:35839,darkcyan:9145343,darkgoldenrod:3095792639,darkgray:2846468607,darkgreen:6553855,darkgrey:2846468607,darkkhaki:3182914559,darkmagenta:2332068863,darkolivegreen:1433087999,darkorange:4287365375,darkorchid:2570243327,darkred:2332033279,darksalmon:3918953215,darkseagreen:2411499519,darkslateblue:1211993087,darkslategray:793726975,darkslategrey:793726975,darkturquoise:13554175,darkviolet:2483082239,deeppink:4279538687,deepskyblue:12582911,dimgray:1768516095,dimgrey:1768516095,dodgerblue:512819199,firebrick:2988581631,floralwhite:4294635775,forestgreen:579543807,fuchsia:4278255615,gainsboro:3705462015,ghostwhite:4177068031,gold:4292280575,goldenrod:3668254975,gray:2155905279,green:8388863,greenyellow:2919182335,grey:2155905279,honeydew:4043305215,hotpink:4285117695,indianred:3445382399,indigo:1258324735,ivory:4294963455,khaki:4041641215,lavender:3873897215,lavenderblush:4293981695,lawngreen:2096890111,lemonchiffon:4294626815,lightblue:2916673279,lightcoral:4034953471,lightcyan:3774873599,lightgoldenrodyellow:4210742015,lightgray:3553874943,lightgreen:2431553791,lightgrey:3553874943,lightpink:4290167295,lightsalmon:4288707327,lightseagreen:548580095,lightskyblue:2278488831,lightslategray:2005441023,lightslategrey:2005441023,lightsteelblue:2965692159,lightyellow:4294959359,lime:16711935,limegreen:852308735,linen:4210091775,magenta:4278255615,maroon:2147483903,mediumaquamarine:1724754687,mediumblue:52735,mediumorchid:3126187007,mediumpurple:2473647103,mediumseagreen:1018393087,mediumslateblue:2070474495,mediumspringgreen:16423679,mediumturquoise:1221709055,mediumvioletred:3340076543,midnightblue:421097727,mintcream:4127193855,mistyrose:4293190143,moccasin:4293178879,navajowhite:4292783615,navy:33023,oldlace:4260751103,olive:2155872511,olivedrab:1804477439,orange:4289003775,orangered:4282712319,orchid:3664828159,palegoldenrod:4008225535,palegreen:2566625535,paleturquoise:2951671551,palevioletred:3681588223,papayawhip:4293907967,peachpuff:4292524543,peru:3448061951,pink:4290825215,plum:3718307327,powderblue:2967529215,purple:2147516671,rebeccapurple:1714657791,red:4278190335,rosybrown:3163525119,royalblue:1097458175,saddlebrown:2336560127,salmon:4202722047,sandybrown:4104413439,seagreen:780883967,seashell:4294307583,sienna:2689740287,silver:3233857791,skyblue:2278484991,slateblue:1784335871,slategray:1887473919,slategrey:1887473919,snow:4294638335,springgreen:16744447,steelblue:1182971135,tan:3535047935,teal:8421631,thistle:3636451583,tomato:4284696575,turquoise:1088475391,violet:4001558271,wheat:4125012991,white:4294967295,whitesmoke:4126537215,yellow:4294902015,yellowgreen:2597139199},Z="[-+]?\\d*\\.?\\d+";function Q(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return"\\(\\s*("+t.join(")\\s*,\\s*(")+")\\s*\\)"}var ee=new RegExp("rgb"+Q(Z,Z,Z)),te=new RegExp("rgba"+Q(Z,Z,Z,Z)),re=new RegExp("hsl"+Q(Z,"[-+]?\\d*\\.?\\d+%","[-+]?\\d*\\.?\\d+%")),ne=new RegExp("hsla"+Q(Z,"[-+]?\\d*\\.?\\d+%","[-+]?\\d*\\.?\\d+%",Z)),oe=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,ie=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,ce=/^#([0-9a-fA-F]{6})$/,ae=/^#([0-9a-fA-F]{8})$/;function se(e,t,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?e+6*(t-e)*r:r<.5?t:r<2/3?e+(t-e)*(2/3-r)*6:e}function ue(e,t,r){var n=r<.5?r*(1+t):r+t-r*t,o=2*r-n,i=se(o,n,e+1/3),c=se(o,n,e),a=se(o,n,e-1/3);return Math.round(255*i)<<24|Math.round(255*c)<<16|Math.round(255*a)<<8}function le(e){var t=parseInt(e,10);return t<0?0:t>255?255:t}function fe(e){return(parseFloat(e)%360+360)%360/360}function pe(e){var t=parseFloat(e);return t<0?0:t>1?255:Math.round(255*t)}function de(e){var t=parseFloat(e);return t<0?0:t>100?1:t/100}function he(e){var t,r,n="number"==typeof(t=e)?t>>>0===t&&t>=0&&t<=4294967295?t:null:(r=ce.exec(t))?parseInt(r[1]+"ff",16)>>>0:$.hasOwnProperty(t)?$[t]:(r=ee.exec(t))?(le(r[1])<<24|le(r[2])<<16|le(r[3])<<8|255)>>>0:(r=te.exec(t))?(le(r[1])<<24|le(r[2])<<16|le(r[3])<<8|pe(r[4]))>>>0:(r=oe.exec(t))?parseInt(r[1]+r[1]+r[2]+r[2]+r[3]+r[3]+"ff",16)>>>0:(r=ae.exec(t))?parseInt(r[1],16)>>>0:(r=ie.exec(t))?parseInt(r[1]+r[1]+r[2]+r[2]+r[3]+r[3]+r[4]+r[4],16)>>>0:(r=re.exec(t))?(255|ue(fe(r[1]),de(r[2]),de(r[3])))>>>0:(r=ne.exec(t))?(ue(fe(r[1]),de(r[2]),de(r[3]))|pe(r[4]))>>>0:null;return null===n?e:"rgba("+((4278190080&(n=n||0))>>>24)+", "+((16711680&n)>>>16)+", "+((65280&n)>>>8)+", "+(255&n)/255+")"}var me=/[+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,be=/(#(?:[0-9a-f]{2}){2,4}|(#[0-9a-f]{3})|(rgb|hsl)a?\((-?\d+%?[,\s]+){2,3}\s*[\d\.]+%?\))/gi,ge=new RegExp("("+Object.keys($).join("|")+")","g"),ve={animationIterationCount:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},ye=["Webkit","Ms","Moz","O"];function Oe(e,t,r){return null==t||"boolean"==typeof t||""===t?"":r||"number"!=typeof t||0===t||ve.hasOwnProperty(e)&&ve[e]?(""+t).trim():t+"px"}ve=Object.keys(ve).reduce((function(e,t){return ye.forEach((function(r){return e[function(e,t){return e+t.charAt(0).toUpperCase()+t.substring(1)}(r,t)]=e[t]})),e}),ve);var Ee={};M((function(e){return new J(e)})),x("div"),_((function(e){var t=e.output.map((function(e){return e.replace(be,he)})).map((function(e){return e.replace(ge,he)})),r=t[0].match(me).map((function(){return[]}));t.forEach((function(e){e.match(me).forEach((function(e,t){return r[t].push(+e)}))}));var n=t[0].match(me).map((function(t,n){return V(o({},e,{output:r[n]}))}));return function(e){var r=0;return t[0].replace(me,(function(){return n[r++](e)})).replace(/rgba\(([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+)\)/gi,(function(e,t,r,n,o){return"rgba("+Math.round(t)+", "+Math.round(r)+", "+Math.round(n)+", "+o+")"}))}})),j($),E((function(e,t){if(!e.nodeType||void 0===e.setAttribute)return!1;var r=t.style,n=t.children,o=t.scrollTop,c=t.scrollLeft,a=i(t,["style","children","scrollTop","scrollLeft"]),s="filter"===e.nodeName||e.parentNode&&"filter"===e.parentNode.nodeName;for(var u in void 0!==o&&(e.scrollTop=o),void 0!==c&&(e.scrollLeft=c),void 0!==n&&(e.textContent=n),r)if(r.hasOwnProperty(u)){var l=0===u.indexOf("--"),f=Oe(u,r[u],l);"float"===u&&(u="cssFloat"),l?e.style.setProperty(u,f):e.style[u]=f}for(var p in a){var d=s?p:Ee[p]||(Ee[p]=p.replace(/([A-Z])/g,(function(e){return"-"+e.toLowerCase()})));void 0!==e.getAttribute(d)&&e.setAttribute(d,a[p])}}),(function(e){return e}));var je,we,Se=(je=function(e){return c.forwardRef((function(t,r){var n=f(),s=c.useRef(!0),u=c.useRef(null),p=c.useRef(null),d=c.useCallback((function(e){var t=u.current;u.current=new D(e,(function(){var e=!1;p.current&&(e=b.fn(p.current,u.current.getAnimatedValue())),p.current&&!1!==e||n()})),t&&t.detach()}),[]);c.useEffect((function(){return function(){s.current=!1,u.current&&u.current.detach()}}),[]),c.useImperativeHandle(r,(function(){return A(p,s,n)})),d(t);var h,m=u.current.getValue(),g=(m.scrollTop,m.scrollLeft,i(m,["scrollTop","scrollLeft"])),v=(h=e,!l.fun(h)||h.prototype instanceof a.Component?function(e){return p.current=function(e,t){return t&&(l.fun(t)?t(e):l.obj(t)&&(t.current=e)),e}(e,r)}:void 0);return a.createElement(e,o({},g,{ref:v}))}))},void 0===(we=!1)&&(we=!0),function(e){return(l.arr(e)?e:Object.keys(e)).reduce((function(e,t){var r=we?t[0].toLowerCase()+t.substring(1):t;return e[r]=je(r),e}),je)}),ke=Se(["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"]);t.apply=Se,t.config={default:{tension:170,friction:26},gentle:{tension:120,friction:14},wobbly:{tension:180,friction:12},stiff:{tension:210,friction:20},slow:{tension:280,friction:60},molasses:{tension:280,friction:120}},t.update=L,t.animated=ke,t.a=ke,t.interpolate=function(e,t,r){return e&&new B(e,t,r)},t.Globals=N,t.useSpring=function(e){var t=l.fun(e),r=G(1,t?e:[e]),n=r[0],o=r[1],i=r[2];return t?[n[0],o,i]:n},t.useTrail=function(e,t){var r=c.useRef(!1),n=l.fun(t),i=h(t),a=c.useRef(),s=G(e,(function(e,t){return 0===e&&(a.current=[]),a.current.push(t),o({},i,{config:h(i.config,e),attach:e>0&&function(){return a.current[e-1]}})})),u=s[0],f=s[1],p=s[2],d=c.useMemo((function(){return function(e){return f((function(t,r){e.reverse;var n=e.reverse?t+1:t-1,c=a.current[n];return o({},e,{config:h(e.config||i.config,t),attach:c&&function(){return c}})}))}}),[e,i.reverse]);return c.useEffect((function(){r.current&&!n&&d(t)})),c.useEffect((function(){r.current=!0}),[]),n?[u,d,p]:u},t.useTransition=function(e,t,r){var n=o({items:e,keys:t||function(e){return e}},r),a=K(n),s=a.lazy,u=void 0!==s&&s,l=(a.unique,a.reset),p=void 0!==l&&l,d=(a.enter,a.leave,a.update,a.onDestroyed),m=(a.keys,a.items,a.onFrame),b=a.onRest,g=a.onStart,v=a.ref,y=i(a,["lazy","unique","reset","enter","leave","update","onDestroyed","keys","items","onFrame","onRest","onStart","ref"]),O=f(),E=c.useRef(!1),j=c.useRef({mounted:!1,first:!0,deleted:[],current:{},transitions:[],prevProps:{},paused:!!n.ref,instances:!E.current&&new Map,forceUpdate:O});return c.useImperativeHandle(n.ref,(function(){return{start:function(){return Promise.all(Array.from(j.current.instances).map((function(e){var t=e[1];return new Promise((function(e){return t.start(e)}))})))},stop:function(e){return Array.from(j.current.instances).forEach((function(t){return t[1].stop(e)}))},get controllers(){return Array.from(j.current.instances).map((function(e){return e[1]}))}}})),j.current=function(e,t){for(var r=e.first,n=e.prevProps,c=i(e,["first","prevProps"]),a=K(t),s=a.items,u=a.keys,l=a.initial,f=a.from,p=a.enter,d=a.leave,m=a.update,b=a.trail,g=void 0===b?0:b,v=a.unique,y=a.config,O=a.order,E=void 0===O?["enter","leave","update"]:O,j=K(n),w=j.keys,S=j.items,k=o({},c.current),_=[].concat(c.deleted),P=Object.keys(k),R=new Set(P),x=new Set(u),C=u.filter((function(e){return!R.has(e)})),T=c.transitions.filter((function(e){return!e.destroyed&&!x.has(e.originalKey)})).map((function(e){return e.originalKey})),A=u.filter((function(e){return R.has(e)})),M=-g;E.length;)switch(E.shift()){case"enter":C.forEach((function(e,t){v&&_.find((function(t){return t.originalKey===e}))&&(_=_.filter((function(t){return t.originalKey!==e})));var n=u.indexOf(e),o=s[n],i=r&&void 0!==l?"initial":"enter";k[e]={slot:i,originalKey:e,key:v?String(e):W++,item:o,trail:M+=g,config:h(y,o,i),from:h(r&&void 0!==l?l||{}:f,o),to:h(p,o)}}));break;case"leave":T.forEach((function(e){var t=w.indexOf(e),r=S[t];_.unshift(o({},k[e],{slot:"leave",destroyed:!0,left:w[Math.max(0,t-1)],right:w[Math.min(w.length,t+1)],trail:M+=g,config:h(y,r,"leave"),to:h(d,r)})),delete k[e]}));break;case"update":A.forEach((function(e){var t=u.indexOf(e),r=s[t];k[e]=o({},k[e],{item:r,slot:"update",trail:M+=g,config:h(y,r,"update"),to:h(m,r)})}))}var N=u.map((function(e){return k[e]}));return _.forEach((function(e){var t,r=e.left,n=(e.right,i(e,["left","right"]));-1!==(t=N.findIndex((function(e){return e.originalKey===r})))&&(t+=1),t=Math.max(0,t),N=[].concat(N.slice(0,t),[n],N.slice(t))})),o({},c,{changed:C.length||T.length||A.length,first:r&&0===C.length,transitions:N,current:k,deleted:_,prevProps:t})}(j.current,n),j.current.changed&&j.current.transitions.forEach((function(e){var t=e.slot,r=e.from,n=e.to,i=e.config,c=e.trail,a=e.key,s=e.item;j.current.instances.has(a)||j.current.instances.set(a,new q);var l=j.current.instances.get(a),f=o({},y,{to:n,from:r,config:i,ref:v,onRest:function(r){j.current.mounted&&(e.destroyed&&(v||u||X(j,a),d&&d(s)),!Array.from(j.current.instances).some((function(e){return!e[1].idle}))&&(v||u)&&j.current.deleted.length>0&&X(j),b&&b(s,t,r))},onStart:g&&function(){return g(s,t)},onFrame:m&&function(e){return m(s,t,e)},delay:c,reset:p&&"enter"===t});l.update(f),j.current.paused||l.start()})),c.useEffect((function(){return j.current.mounted=E.current=!0,function(){j.current.mounted=E.current=!1,Array.from(j.current.instances).map((function(e){return e[1].destroy()})),j.current.instances.clear()}}),[]),j.current.transitions.map((function(e){var t=e.item,r=e.slot,n=e.key;return{item:t,key:n,state:r,props:j.current.instances.get(n).getValues()}}))},t.useChain=function(e,t,r){void 0===r&&(r=1e3);var n=c.useRef();c.useEffect((function(){l.equ(e,n.current)?e.forEach((function(e){var t=e.current;return t&&t.start()})):t?e.forEach((function(e,n){var i=e.current;if(i){var c=i.controllers;if(c.length){var a=r*t[n];c.forEach((function(e){e.queue=e.queue.map((function(e){return o({},e,{delay:e.delay+a})})),e.start()}))}}})):e.reduce((function(e,t,r){var n=t.current;return e.then((function(){return n.start()}))}),Promise.resolve()),n.current=e}))},t.useSprings=G},function(e,t,r){"use strict";r.d(t,"a",(function(){return a}));var n=r(11),o=r(0),i=r(8),c=r(100),a=function(){var e=Object(c.a)(),t=Object(n.useDispatch)(i.CART_STORE_KEY).selectShippingRate;return{selectShippingRate:Object(o.useCallback)((function(r,n){t(r,n).catch((function(t){e(t)}))}),[e,t]),isSelectingRate:Object(n.useSelect)((function(e){return e(i.CART_STORE_KEY).isShippingRateBeingSelected()}),[])}}},,,,,,,,,function(e,t,r){"use strict";r.d(t,"b",(function(){return y})),r.d(t,"a",(function(){return O}));var n=r(21),o=r.n(n),i=r(4),c=r.n(i),a=r(23),s=r.n(a),u=r(5),l=r.n(u),f=r(0),p=r(7),d=r(25),h=r.n(d);function m(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function b(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?m(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):m(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function g(e){var t=function(e,t){if("object"!==o()(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!==o()(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===o()(t)?t:String(t)}var v=Object(f.createContext)({getValidationError:function(){return""},setValidationErrors:function(e){},clearValidationError:function(e){},clearAllValidationErrors:function(){},hideValidationError:function(){},showValidationError:function(){},showAllValidationErrors:function(){},hasValidationErrors:!1,getValidationErrorId:function(e){return e}}),y=function(){return Object(f.useContext)(v)},O=function(e){var t=e.children,r=Object(f.useState)({}),n=l()(r,2),o=n[0],i=n[1],a=Object(f.useCallback)((function(e){return o[e]}),[o]),u=Object(f.useCallback)((function(e){var t=o[e];return!t||t.hidden?"":"validate-error-".concat(e)}),[o]),d=Object(f.useCallback)((function(e){i((function(t){return t[e]?(t[e],s()(t,[e].map(g))):t}))}),[]),m=Object(f.useCallback)((function(){i({})}),[]),y=Object(f.useCallback)((function(e){e&&i((function(t){return e=Object(p.pickBy)(e,(function(e,r){return!("string"!=typeof e.message||t.hasOwnProperty(r)&&h()(t[r],e))})),0===Object.values(e).length?t:b(b({},t),e)}))}),[]),O=Object(f.useCallback)((function(e,t){i((function(r){if(!r.hasOwnProperty(e))return r;var n=b(b({},r[e]),t);return h()(r[e],n)?r:b(b({},r),{},c()({},e,n))}))}),[]),E={getValidationError:a,setValidationErrors:y,clearValidationError:d,clearAllValidationErrors:m,hideValidationError:Object(f.useCallback)((function(e){O(e,{hidden:!0})}),[O]),showValidationError:Object(f.useCallback)((function(e){O(e,{hidden:!1})}),[O]),showAllValidationErrors:Object(f.useCallback)((function(){i((function(e){var t={};return Object.keys(e).forEach((function(r){e[r].hidden&&(t[r]=b(b({},e[r]),{},{hidden:!1}))})),0===Object.values(t).length?e:b(b({},e),t)}))}),[]),hasValidationErrors:Object.keys(o).length>0,getValidationErrorId:u};return React.createElement(v.Provider,{value:E},t)}},function(e,t,r){"use strict";var n=r(0),o=r(8),i=r(11),c=r(83);t.a=function(e){return function(t){var r;return r=Object(n.useRef)(c.n.restApiRoutes||{}),Object(i.useSelect)((function(e,t){if(r.current){var n=e(o.SCHEMA_STORE_KEY),i=n.isResolving,c=n.hasFinishedResolution,a=t.dispatch(o.SCHEMA_STORE_KEY),s=a.receiveRoutes,u=a.startResolution,l=a.finishResolution;Object.keys(r.current).forEach((function(e){var t=r.current[e];i("getRoutes",[e])||c("getRoutes",[e])||(u("getRoutes",[e]),s(t,[e]),l("getRoutes",[e]))}))}}),[]),React.createElement(e,t)}}},function(e,t,r){var n=r(157),o=r(130),i=o.setStyleProp,c=n.html,a=n.svg,s=n.isCustomAttribute,u=Object.prototype.hasOwnProperty;e.exports=function(e){var t,r,n,l;e=e||{};var f={};for(t in e)n=e[t],s(t)?f[t]=n:(r=t.toLowerCase(),u.call(c,r)?f[(l=c[r]).propertyName]=!!(l.hasBooleanValue||l.hasOverloadedBooleanValue&&!n)||n:u.call(a,t)?f[(l=a[t]).propertyName]=n:o.PRESERVE_CUSTOM_ATTRIBUTES&&(f[t]=n));return i(e.style,f),f}},function(e,t,r){var n=r(3),o=r(161).default,i={reactCompat:!0},c=n.version.split(".")[0]>=16;e.exports={PRESERVE_CUSTOM_ATTRIBUTES:c,invertObject:function(e,t){if(!e||"object"!=typeof e)throw new TypeError("First argument must be an object");var r,n,o="function"==typeof t,i={},c={};for(r in e)n=e[r],o&&(i=t(r,n))&&2===i.length?c[i[0]]=i[1]:"string"==typeof n&&(c[n]=r);return c},isCustomComponent:function(e,t){if(-1===e.indexOf("-"))return t&&"string"==typeof t.is;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}},setStyleProp:function(e,t){null!=e&&(t.style=o(e,i))}}},function(e,t,r){for(var n,o=r(167).CASE_SENSITIVE_TAG_NAMES,i={},c=0,a=o.length;c<a;c++)n=o[c],i[n.toLowerCase()]=n;function s(e){for(var t,r={},n=0,o=e.length;n<o;n++)r[(t=e[n]).name]=t.value;return r}function u(e){return function(e){return i[e]}(e=e.toLowerCase())||e}e.exports={formatAttributes:s,formatDOM:function e(t,r,n){r=r||null;for(var o,i,c,a=[],l=0,f=t.length;l<f;l++){switch(o=t[l],c={next:null,prev:a[l-1]||null,parent:r},(i=a[l-1])&&(i.next=c),"#"!==o.nodeName[0]&&(c.name=u(o.nodeName),c.attribs={},o.attributes&&o.attributes.length&&(c.attribs=s(o.attributes))),o.nodeType){case 1:"script"===c.name||"style"===c.name?c.type=c.name:c.type="tag",c.children=e(o.childNodes,c);break;case 3:c.type="text",c.data=o.nodeValue;break;case 8:c.type="comment",c.data=o.nodeValue}a.push(c)}return n&&(a.unshift({name:n.substring(0,n.indexOf(" ")).toLowerCase(),data:n,type:"directive",next:a[0]?a[0]:null,prev:null,parent:r}),a[1]&&(a[1].prev=a[0])),a},isIE:function(e){return e?document.documentMode===e:/(MSIE |Trident\/|Edge\/)/.test(navigator.userAgent)}}},function(e,t,r){"use strict";r.d(t,"a",(function(){return s})),r.d(t,"b",(function(){return u}));var n=r(39),o=r.n(n),i=r(27),c=r.n(i),a=r(1),s=function(){var e=o()(c.a.mark((function e(t){var r;return c.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("function"!=typeof t.json){e.next=11;break}return e.prev=1,e.next=4,t.json();case 4:return r=e.sent,e.abrupt("return",{message:r.message,type:r.type||"api"});case 8:return e.prev=8,e.t0=e.catch(1),e.abrupt("return",{message:e.t0.message,type:"general"});case 11:return e.abrupt("return",{message:t.message,type:t.type||"general"});case 12:case"end":return e.stop()}}),e,null,[[1,8]])})));return function(_x){return e.apply(this,arguments)}}(),u=function(e){if(e.data&&"rest_invalid_param"===e.code){var t=Object.values(e.data.params);if(t[0])return t[0]}return(null==e?void 0:e.message)||Object(a.__)("Something went wrong. Please contact us to get assistance.",'woocommerce')}},,function(e,t,r){"use strict";(function(e){var n=r(0),o=r(7),i=r(6),c=r.n(i),a=r(33),s=r(1),u=(r(74),r(76));t.a=Object(n.forwardRef)((function(t,r){var i=t.className,l=t.children,f=t.spokenMessage,p=void 0===f?l:f,d=t.politeness,h=void 0===d?"polite":d,m=t.actions,b=void 0===m?[]:m,g=t.onRemove,v=void 0===g?o.noop:g;!function(e,t){var r="string"==typeof e?e:Object(n.renderToString)(e);Object(n.useEffect)((function(){r&&Object(a.speak)(r,t)}),[r,t])}(p,h),Object(n.useEffect)((function(){var e=setTimeout((function(){v()}),1e4);return function(){return clearTimeout(e)}}),[]);var y=c()(i,"components-snackbar");return b&&b.length>1&&(void 0!==e&&e.env,b=[b[0]]),Object(n.createElement)("div",{ref:r,className:y,onClick:v,tabIndex:"0",role:"button",onKeyPress:v,"aria-label":Object(s.__)("Dismiss this notice")},Object(n.createElement)("div",{className:"components-snackbar__content"},l,b.map((function(e,t){var r=e.label,o=e.onClick,i=e.url;return Object(n.createElement)(u.a,{key:t,href:i,isTertiary:!0,onClick:function(e){e.stopPropagation(),o&&o(e)},className:"components-snackbar__action"},r)}))))}))}).call(this,r(102))},function(e,t){e.exports=window.wp.plugins},function(e,t,r){var n=r(156),o=r(129),i=r(165),c={decodeEntities:!0,lowerCaseAttributeNames:!1};function a(e,t){if("string"!=typeof e)throw new TypeError("First argument must be a string");return""===e?[]:n(i(e,(t=t||{}).htmlparser2||c),t)}a.domToReact=n,a.htmlToDOM=i,a.attributesToProps=o,e.exports=a,e.exports.default=a},,,,,,function(e,t){},,function(e,t,r){var n=r(71);e.exports=function(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,n(e,t)},e.exports.default=e.exports,e.exports.__esModule=!0},,function(e,t,r){"use strict";r.d(t,"a",(function(){return A}));var n=r(135),o=r(2),i=r(44),c=r(173),a=r(66),s=r(60),u=r(48),l=r(39),f=r.n(l),p=r(4),d=r.n(p),h=r(5),m=r.n(h),b=r(27),g=r.n(b),v=r(1),y=r(61),O=r.n(y),E=r(0),j=r(93),w=r(132),S=function(e,t,r){var n=Object.keys(e).map((function(t){return{key:t,value:e[t]}}),[]),o="wc-".concat(r,"-new-payment-method");return n.push({key:o,value:t}),n},k=function(e,t){O.a.setNonce&&"function"==typeof O.a.setNonce&&O.a.setNonce(e),null!=e&&e.get("X-WC-Store-API-User")&&t.setCustomerId(parseInt(e.get("X-WC-Store-API-User")||"0",10))},_=r(127),P=r(32),R=r(54);function x(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function C(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?x(Object(r),!0).forEach((function(t){d()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):x(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var T=function(){var e=Object(u.b)(),t=e.hasError,r=e.onCheckoutValidationBeforeProcessing,n=e.dispatchActions,o=e.redirectUrl,i=e.isProcessing,l=e.isBeforeProcessing,p=e.isComplete,d=e.orderNotes,h=e.shouldCreateAccount,b=e.extensionData,y=Object(_.b)().hasValidationErrors,x=Object(a.b)().shippingErrorStatus,T=Object(s.b)(),A=T.billingData,M=T.shippingAddress,N=Object(P.a)(),D=N.cartNeedsPayment,I=N.receiveCart,F=Object(c.b)(),L=F.activePaymentMethod,V=F.isExpressPaymentMethodActive,B=F.currentStatus,U=F.paymentMethodData,H=F.expressPaymentMethods,z=F.paymentMethods,q=F.shouldSavePayment,G=Object(R.a)(),W=G.addErrorNotice,Y=G.removeNotice,K=G.setIsSuppressed,X=Object(E.useRef)(A),J=Object(E.useRef)(M),$=Object(E.useRef)(o),Z=Object(E.useState)(!1),Q=m()(Z,2),ee=Q[0],te=Q[1],re=Object(E.useMemo)((function(){var e,t=C(C({},H),z);return null==t||null===(e=t[L])||void 0===e?void 0:e.paymentMethodId}),[L,H,z]),ne=y&&!V||B.hasError||x.hasError,oe=!t&&!ne&&(B.isSuccessful||!D)&&i;Object(E.useEffect)((function(){K(V)}),[V,K]),Object(E.useEffect)((function(){ne===t||!i&&!l||V||n.setHasError(ne)}),[ne,t,i,l,V,n]),Object(E.useEffect)((function(){X.current=A,J.current=M,$.current=o}),[A,M,o]);var ie=Object(E.useCallback)((function(){return!y&&(B.hasError?{errorMessage:Object(v.__)("There was a problem with your payment option.",'woocommerce')}:!x.hasError||{errorMessage:Object(v.__)("There was a problem with your shipping option.",'woocommerce')})}),[y,B.hasError,x.hasError]);Object(E.useEffect)((function(){var e;return V||(e=r(ie,0)),function(){V||e()}}),[r,ie,V]),Object(E.useEffect)((function(){$.current&&(window.location.href=$.current)}),[p]);var ce=Object(E.useCallback)(f()(g.a.mark((function e(){var t,r;return g.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!ee){e.next=2;break}return e.abrupt("return");case 2:te(!0),Y("checkout"),t=D?{payment_method:re,payment_data:S(U,q,L)}:{},r=C(C({billing_address:Object(j.a)(X.current),shipping_address:Object(j.a)(J.current),customer_note:d,should_create_account:h},t),{},{extensions:C({},b)}),O()({path:"/wc/store/checkout",method:"POST",data:r,cache:"no-store",parse:!1}).then((function(e){if(k(e.headers,n),!e.ok)throw new Error(e);return e.json()})).then((function(e){n.setAfterProcessing(e),te(!1)})).catch((function(e){k(e.headers,n),e.json().then((function(e){var t,r,o;null!==(t=e.data)&&void 0!==t&&t.cart&&I(e.data.cart),W(Object(w.b)(e),{id:"checkout"}),null===(r=e.additional_errors)||void 0===r||null===(o=r.forEach)||void 0===o||o.call(r,(function(e){W(e.message,{id:e.error_code})})),n.setHasError(!0),n.setAfterProcessing(e),te(!1)}))}));case 7:case"end":return e.stop()}}),e)}))),[ee,Y,d,h,D,re,U,q,L,b,n,W,I]);return Object(E.useEffect)((function(){oe&&!ee&&ce()}),[ce,oe,ee]),null},A=function(e){var t=e.children,r=e.isCart,l=void 0!==r&&r,f=e.redirectUrl;return React.createElement(u.a,{redirectUrl:f,isCart:l},React.createElement(s.a,null,React.createElement(a.a,null,React.createElement(c.a,null,t,React.createElement(i.a,{renderError:o.CURRENT_USER_IS_ADMIN?null:function(){return null}},React.createElement(n.PluginArea,{scope:"woocommerce-checkout"})),React.createElement(T,null)))))}},,,,,,function(e,t,r){"use strict";var n=r(4),o=r.n(n),i=r(23),c=r.n(i),a=r(0),s=["srcElement","size"];function u(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}t.a=function(e){var t=e.srcElement,r=e.size,n=void 0===r?24:r,i=c()(e,s);return Object(a.isValidElement)(t)?Object(a.cloneElement)(t,function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?u(Object(r),!0).forEach((function(t){o()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):u(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({width:n,height:n},i)):null}},function(e,t,r){"use strict";var n=r(0),o=r(7),i=r(6),c=r.n(i),a=r(1),s=r(33),u=r(116),l=r(76);t.a=function(e){var t=e.className,r=e.status,i=void 0===r?"info":r,f=e.children,p=e.spokenMessage,d=void 0===p?f:p,h=e.onRemove,m=void 0===h?o.noop:h,b=e.isDismissible,g=void 0===b||b,v=e.actions,y=void 0===v?[]:v,O=e.politeness,E=void 0===O?function(e){switch(e){case"success":case"warning":case"info":return"polite";case"error":default:return"assertive"}}(i):O,j=e.__unstableHTML;!function(e,t){var r="string"==typeof e?e:Object(n.renderToString)(e);Object(n.useEffect)((function(){r&&Object(s.speak)(r,t)}),[r,t])}(d,E);var w=c()(t,"components-notice","is-"+i,{"is-dismissible":g});return j&&(f=Object(n.createElement)(n.RawHTML,null,f)),Object(n.createElement)("div",{className:w},Object(n.createElement)("div",{className:"components-notice__content"},f,y.map((function(e,t){var r=e.className,o=e.label,i=e.isPrimary,a=e.noDefaultClasses,s=void 0!==a&&a,u=e.onClick,f=e.url;return Object(n.createElement)(l.a,{key:t,href:f,isPrimary:i,isSecondary:!s&&!f,isLink:!s&&!!f,onClick:f?void 0:u,className:c()("components-notice__action",r)},o)}))),g&&Object(n.createElement)(l.a,{className:"components-notice__dismiss",icon:u.a,label:Object(a.__)("Dismiss this notice"),onClick:m,showTooltip:!1}))}},,,function(e,t,r){var n=r(3),o=r(129),i=r(130),c=i.setStyleProp;function a(e){return i.PRESERVE_CUSTOM_ATTRIBUTES&&"tag"===e.type&&i.isCustomComponent(e.name,e.attribs)}e.exports=function e(t,r){for(var i,s,u,l,f=(r=r||{}).library||n,p=f.cloneElement,d=f.createElement,h=f.isValidElement,m=[],b="function"==typeof r.replace,g=r.trim,v=0,y=t.length;v<y;v++)if(i=t[v],b&&h(s=r.replace(i)))y>1&&(s=p(s,{key:s.key||v})),m.push(s);else if("text"!==i.type){switch(u=i.attribs,a(i)?c(u.style,u):u&&(u=o(u)),l=null,i.type){case"script":case"style":i.children[0]&&(u.dangerouslySetInnerHTML={__html:i.children[0].data});break;case"tag":"textarea"===i.name&&i.children[0]?u.defaultValue=i.children[0].data:i.children&&i.children.length&&(l=e(i.children,r));break;default:continue}y>1&&(u.key=v),m.push(d(i.name,u,l))}else g?i.data.trim()&&m.push(i.data):m.push(i.data);return 1===m.length?m[0]:m}},function(e,t,r){var n=r(158),o=r(159),i=r(160),c=i.MUST_USE_PROPERTY,a=i.HAS_BOOLEAN_VALUE,s=i.HAS_NUMERIC_VALUE,u=i.HAS_POSITIVE_NUMERIC_VALUE,l=i.HAS_OVERLOADED_BOOLEAN_VALUE;function f(e,t){return(e&t)===t}function p(e,t,r){var n,o,i,p=e.Properties,d=e.DOMAttributeNames;for(o in p)n=d[o]||(r?o:o.toLowerCase()),i=p[o],t[n]={attributeName:n,propertyName:o,mustUseProperty:f(i,c),hasBooleanValue:f(i,a),hasNumericValue:f(i,s),hasPositiveNumericValue:f(i,u),hasOverloadedBooleanValue:f(i,l)}}var d={};p(n,d);var h={};p(o,h,!0);var m={};p(n,m),p(o,m,!0),e.exports={html:d,svg:h,properties:m,isCustomAttribute:RegExp.prototype.test.bind(new RegExp("^(data|aria)-[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"))}},function(e,t){e.exports={Properties:{autoFocus:4,accept:0,acceptCharset:0,accessKey:0,action:0,allowFullScreen:4,allowTransparency:0,alt:0,as:0,async:4,autoComplete:0,autoPlay:4,capture:4,cellPadding:0,cellSpacing:0,charSet:0,challenge:0,checked:5,cite:0,classID:0,className:0,cols:24,colSpan:0,content:0,contentEditable:0,contextMenu:0,controls:4,controlsList:0,coords:0,crossOrigin:0,data:0,dateTime:0,default:4,defer:4,dir:0,disabled:4,download:32,draggable:0,encType:0,form:0,formAction:0,formEncType:0,formMethod:0,formNoValidate:4,formTarget:0,frameBorder:0,headers:0,height:0,hidden:4,high:0,href:0,hrefLang:0,htmlFor:0,httpEquiv:0,icon:0,id:0,inputMode:0,integrity:0,is:0,keyParams:0,keyType:0,kind:0,label:0,lang:0,list:0,loop:4,low:0,manifest:0,marginHeight:0,marginWidth:0,max:0,maxLength:0,media:0,mediaGroup:0,method:0,min:0,minLength:0,multiple:5,muted:5,name:0,nonce:0,noValidate:4,open:4,optimum:0,pattern:0,placeholder:0,playsInline:4,poster:0,preload:0,profile:0,radioGroup:0,readOnly:4,referrerPolicy:0,rel:0,required:4,reversed:4,role:0,rows:24,rowSpan:8,sandbox:0,scope:0,scoped:4,scrolling:0,seamless:4,selected:5,shape:0,size:24,sizes:0,span:24,spellCheck:0,src:0,srcDoc:0,srcLang:0,srcSet:0,start:8,step:0,style:0,summary:0,tabIndex:0,target:0,title:0,type:0,useMap:0,value:0,width:0,wmode:0,wrap:0,about:0,datatype:0,inlist:0,prefix:0,property:0,resource:0,typeof:0,vocab:0,autoCapitalize:0,autoCorrect:0,autoSave:0,color:0,itemProp:0,itemScope:4,itemType:0,itemID:0,itemRef:0,results:0,security:0,unselectable:0},DOMAttributeNames:{acceptCharset:"accept-charset",className:"class",htmlFor:"for",httpEquiv:"http-equiv"}}},function(e,t){e.exports={Properties:{accentHeight:0,accumulate:0,additive:0,alignmentBaseline:0,allowReorder:0,alphabetic:0,amplitude:0,arabicForm:0,ascent:0,attributeName:0,attributeType:0,autoReverse:0,azimuth:0,baseFrequency:0,baseProfile:0,baselineShift:0,bbox:0,begin:0,bias:0,by:0,calcMode:0,capHeight:0,clip:0,clipPath:0,clipRule:0,clipPathUnits:0,colorInterpolation:0,colorInterpolationFilters:0,colorProfile:0,colorRendering:0,contentScriptType:0,contentStyleType:0,cursor:0,cx:0,cy:0,d:0,decelerate:0,descent:0,diffuseConstant:0,direction:0,display:0,divisor:0,dominantBaseline:0,dur:0,dx:0,dy:0,edgeMode:0,elevation:0,enableBackground:0,end:0,exponent:0,externalResourcesRequired:0,fill:0,fillOpacity:0,fillRule:0,filter:0,filterRes:0,filterUnits:0,floodColor:0,floodOpacity:0,focusable:0,fontFamily:0,fontSize:0,fontSizeAdjust:0,fontStretch:0,fontStyle:0,fontVariant:0,fontWeight:0,format:0,from:0,fx:0,fy:0,g1:0,g2:0,glyphName:0,glyphOrientationHorizontal:0,glyphOrientationVertical:0,glyphRef:0,gradientTransform:0,gradientUnits:0,hanging:0,horizAdvX:0,horizOriginX:0,ideographic:0,imageRendering:0,in:0,in2:0,intercept:0,k:0,k1:0,k2:0,k3:0,k4:0,kernelMatrix:0,kernelUnitLength:0,kerning:0,keyPoints:0,keySplines:0,keyTimes:0,lengthAdjust:0,letterSpacing:0,lightingColor:0,limitingConeAngle:0,local:0,markerEnd:0,markerMid:0,markerStart:0,markerHeight:0,markerUnits:0,markerWidth:0,mask:0,maskContentUnits:0,maskUnits:0,mathematical:0,mode:0,numOctaves:0,offset:0,opacity:0,operator:0,order:0,orient:0,orientation:0,origin:0,overflow:0,overlinePosition:0,overlineThickness:0,paintOrder:0,panose1:0,pathLength:0,patternContentUnits:0,patternTransform:0,patternUnits:0,pointerEvents:0,points:0,pointsAtX:0,pointsAtY:0,pointsAtZ:0,preserveAlpha:0,preserveAspectRatio:0,primitiveUnits:0,r:0,radius:0,refX:0,refY:0,renderingIntent:0,repeatCount:0,repeatDur:0,requiredExtensions:0,requiredFeatures:0,restart:0,result:0,rotate:0,rx:0,ry:0,scale:0,seed:0,shapeRendering:0,slope:0,spacing:0,specularConstant:0,specularExponent:0,speed:0,spreadMethod:0,startOffset:0,stdDeviation:0,stemh:0,stemv:0,stitchTiles:0,stopColor:0,stopOpacity:0,strikethroughPosition:0,strikethroughThickness:0,string:0,stroke:0,strokeDasharray:0,strokeDashoffset:0,strokeLinecap:0,strokeLinejoin:0,strokeMiterlimit:0,strokeOpacity:0,strokeWidth:0,surfaceScale:0,systemLanguage:0,tableValues:0,targetX:0,targetY:0,textAnchor:0,textDecoration:0,textRendering:0,textLength:0,to:0,transform:0,u1:0,u2:0,underlinePosition:0,underlineThickness:0,unicode:0,unicodeBidi:0,unicodeRange:0,unitsPerEm:0,vAlphabetic:0,vHanging:0,vIdeographic:0,vMathematical:0,values:0,vectorEffect:0,version:0,vertAdvY:0,vertOriginX:0,vertOriginY:0,viewBox:0,viewTarget:0,visibility:0,widths:0,wordSpacing:0,writingMode:0,x:0,xHeight:0,x1:0,x2:0,xChannelSelector:0,xlinkActuate:0,xlinkArcrole:0,xlinkHref:0,xlinkRole:0,xlinkShow:0,xlinkTitle:0,xlinkType:0,xmlBase:0,xmlns:0,xmlnsXlink:0,xmlLang:0,xmlSpace:0,y:0,y1:0,y2:0,yChannelSelector:0,z:0,zoomAndPan:0},DOMAttributeNames:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDasharray:"stroke-dasharray",strokeDashoffset:"stroke-dashoffset",strokeLinecap:"stroke-linecap",strokeLinejoin:"stroke-linejoin",strokeMiterlimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",xlinkActuate:"xlink:actuate",xlinkArcrole:"xlink:arcrole",xlinkHref:"xlink:href",xlinkRole:"xlink:role",xlinkShow:"xlink:show",xlinkTitle:"xlink:title",xlinkType:"xlink:type",xmlBase:"xml:base",xmlnsXlink:"xmlns:xlink",xmlLang:"xml:lang",xmlSpace:"xml:space"}}},function(e,t){e.exports={MUST_USE_PROPERTY:1,HAS_BOOLEAN_VALUE:4,HAS_NUMERIC_VALUE:8,HAS_POSITIVE_NUMERIC_VALUE:24,HAS_OVERLOADED_BOOLEAN_VALUE:32}},function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};t.__esModule=!0;var o=n(r(162)),i=r(164);t.default=function(e,t){var r={};return e&&"string"==typeof e?(o.default(e,(function(e,n){e&&n&&(r[i.camelCase(e,t)]=n)})),r):r}},function(e,t,r){var n=r(163);e.exports=function(e,t){var r,o=null;if(!e||"string"!=typeof e)return o;for(var i,c,a=n(e),s="function"==typeof t,u=0,l=a.length;u<l;u++)i=(r=a[u]).property,c=r.value,s?t(i,c,r):c&&(o||(o={}),o[i]=c);return o}},function(e,t){var r=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,n=/\n/g,o=/^\s*/,i=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,c=/^:\s*/,a=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,s=/^[;\s]*/,u=/^\s+|\s+$/g;function l(e){return e?e.replace(u,""):""}e.exports=function(e,t){if("string"!=typeof e)throw new TypeError("First argument must be a string");if(!e)return[];t=t||{};var u=1,f=1;function p(e){var t=e.match(n);t&&(u+=t.length);var r=e.lastIndexOf("\n");f=~r?e.length-r:f+e.length}function d(){var e={line:u,column:f};return function(t){return t.position=new h(e),v(),t}}function h(e){this.start=e,this.end={line:u,column:f},this.source=t.source}h.prototype.content=e;var m=[];function b(r){var n=new Error(t.source+":"+u+":"+f+": "+r);if(n.reason=r,n.filename=t.source,n.line=u,n.column=f,n.source=e,!t.silent)throw n;m.push(n)}function g(t){var r=t.exec(e);if(r){var n=r[0];return p(n),e=e.slice(n.length),r}}function v(){g(o)}function y(e){var t;for(e=e||[];t=O();)!1!==t&&e.push(t);return e}function O(){var t=d();if("/"==e.charAt(0)&&"*"==e.charAt(1)){for(var r=2;""!=e.charAt(r)&&("*"!=e.charAt(r)||"/"!=e.charAt(r+1));)++r;if(r+=2,""===e.charAt(r-1))return b("End of comment missing");var n=e.slice(2,r-2);return f+=2,p(n),e=e.slice(r),f+=2,t({type:"comment",comment:n})}}function E(){var e=d(),t=g(i);if(t){if(O(),!g(c))return b("property missing ':'");var n=g(a),o=e({type:"declaration",property:l(t[0].replace(r,"")),value:n?l(n[0].replace(r,"")):""});return g(s),o}}return v(),function(){var e,t=[];for(y(t);e=E();)!1!==e&&(t.push(e),y(t));return t}()}},function(e,t,r){"use strict";t.__esModule=!0,t.camelCase=void 0;var n=/^--[a-zA-Z0-9-]+$/,o=/-([a-z])/g,i=/^[^-]+$/,c=/^-(webkit|moz|ms|o|khtml)-/,a=function(e,t){return t.toUpperCase()},s=function(e,t){return t+"-"};t.camelCase=function(e,t){return void 0===t&&(t={}),function(e){return!e||i.test(e)||n.test(e)}(e)?e:(e=e.toLowerCase(),t.reactCompat||(e=e.replace(c,s)),e.replace(o,a))}},function(e,t,r){var n=r(166),o=r(131),i=o.formatDOM,c=o.isIE(9),a=/<(![a-zA-Z\s]+)>/;e.exports=function(e){if("string"!=typeof e)throw new TypeError("First argument must be a string");if(!e)return[];var t,r=e.match(a);return r&&r[1]&&(t=r[1],c&&(e=e.replace(r[0],""))),i(n(e),null,t)}},function(e,t,r){var n=r(131),o=/<([a-zA-Z]+[0-9]?)/,i=/<head.*>/i,c=/<body.*>/i,a=/<(area|base|br|col|embed|hr|img|input|keygen|link|menuitem|meta|param|source|track|wbr)(.*?)\/?>/gi,s=n.isIE(9),u=s||n.isIE(),l=function(){throw new Error("This browser does not support `document.implementation.createHTMLDocument`")},f=function(){throw new Error("This browser does not support `DOMParser.prototype.parseFromString`")};if("function"==typeof window.DOMParser){var p=new window.DOMParser,d=s?"text/xml":"text/html";l=f=function(e,t){return t&&(e="<"+t+">"+e+"</"+t+">"),s&&(e=e.replace(a,"<$1$2$3/>")),p.parseFromString(e,d)}}if(document.implementation){var h=document.implementation.createHTMLDocument(u?"html-dom-parser":void 0);l=function(e,t){if(t)return h.documentElement.getElementsByTagName(t)[0].innerHTML=e,h;try{return h.documentElement.innerHTML=e,h}catch(t){if(f)return f(e)}}}var m,b=document.createElement("template");b.content&&(m=function(e){return b.innerHTML=e,b.content.childNodes}),e.exports=function(e){var t,r,n,a,s=e.match(o);switch(s&&s[1]&&(t=s[1].toLowerCase()),t){case"html":return r=f(e),i.test(e)||(n=r.getElementsByTagName("head")[0])&&n.parentNode.removeChild(n),c.test(e)||(n=r.getElementsByTagName("body")[0])&&n.parentNode.removeChild(n),r.getElementsByTagName("html");case"head":case"body":return a=l(e).getElementsByTagName(t),c.test(e)&&i.test(e)?a[0].parentNode.childNodes:a;default:return m?m(e):l(e,"body").getElementsByTagName("body")[0].childNodes}}},function(e,t){e.exports={CASE_SENSITIVE_TAG_NAMES:["animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussainBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","linearGradient","radialGradient","textPath"]}},,,,,,function(e,t,r){"use strict";r.d(t,"b",(function(){return Q})),r.d(t,"a",(function(){return ee}));var n,o,i=r(46),c=r.n(i),a=r(5),s=r.n(a),u=r(0);!function(e){e.PRISTINE="pristine",e.STARTED="started",e.PROCESSING="processing",e.ERROR="has_error",e.FAILED="failed",e.SUCCESS="success",e.COMPLETE="complete"}(n||(n={})),function(e){e.SET_REGISTERED_PAYMENT_METHODS="set_registered_payment_methods",e.SET_REGISTERED_EXPRESS_PAYMENT_METHODS="set_registered_express_payment_methods",e.SET_SHOULD_SAVE_PAYMENT_METHOD="set_should_save_payment_method"}(o||(o={}));var l={currentStatus:n.PRISTINE,shouldSavePaymentMethod:!1,paymentMethodData:{payment_method:""},hasSavedToken:!1,errorMessage:"",paymentMethods:{},expressPaymentMethods:{}},f={setPaymentStatus:function(){return{pristine:function(){},started:function(){},processing:function(){},completed:function(){},error:function(e){},failed:function(e,t){},success:function(e,t){}}},currentStatus:{isPristine:!0,isStarted:!1,isProcessing:!1,isFinished:!1,hasError:!1,hasFailed:!1,isSuccessful:!1,isDoingExpressPayment:!1},paymentStatuses:n,paymentMethodData:{},errorMessage:"",activePaymentMethod:"",setActivePaymentMethod:function(){},activeSavedToken:"",setActiveSavedToken:function(){},customerPaymentMethods:{},paymentMethods:{},expressPaymentMethods:{},paymentMethodsInitialized:!1,expressPaymentMethodsInitialized:!1,onPaymentProcessing:function(){return function(){return function(){}}},setExpressPaymentError:function(){},isExpressPaymentMethodActive:!1,setShouldSavePayment:function(){},shouldSavePayment:!1},p=r(4),d=r.n(p),h=r(21),m=r.n(h);function b(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function g(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?b(Object(r),!0).forEach((function(t){d()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):b(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var v=function(e){return!("object"!==m()(e)||!e.isSavedToken)},y=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:l,t=arguments.length>1?arguments[1]:void 0,r=t.type,i=t.paymentMethodData,c=t.shouldSavePaymentMethod,a=void 0!==c&&c,s=t.errorMessage,u=void 0===s?"":s,f=t.paymentMethods,p=void 0===f?{}:f;switch(r){case n.STARTED:return g(g({},e),{},{currentStatus:n.STARTED,paymentMethodData:i||e.paymentMethodData,hasSavedToken:v(i||e.paymentMethodData)});case n.ERROR:return e.currentStatus!==n.ERROR?g(g({},e),{},{currentStatus:n.ERROR,errorMessage:u||e.errorMessage}):e;case n.FAILED:return e.currentStatus!==n.FAILED?g(g({},e),{},{currentStatus:n.FAILED,paymentMethodData:i||e.paymentMethodData,errorMessage:u||e.errorMessage}):e;case n.SUCCESS:return e.currentStatus!==n.SUCCESS?g(g({},e),{},{currentStatus:n.SUCCESS,paymentMethodData:i||e.paymentMethodData,hasSavedToken:v(i||e.paymentMethodData)}):e;case n.PROCESSING:return e.currentStatus!==n.PROCESSING?g(g({},e),{},{currentStatus:n.PROCESSING,errorMessage:""}):e;case n.COMPLETE:return e.currentStatus!==n.COMPLETE?g(g({},e),{},{currentStatus:n.COMPLETE}):e;case n.PRISTINE:return g(g({},l),{},{currentStatus:n.PRISTINE,paymentMethods:g({},e.paymentMethods),expressPaymentMethods:g({},e.expressPaymentMethods),shouldSavePaymentMethod:e.shouldSavePaymentMethod});case o.SET_REGISTERED_PAYMENT_METHODS:return g(g({},e),{},{paymentMethods:p});case o.SET_REGISTERED_EXPRESS_PAYMENT_METHODS:return g(g({},e),{},{expressPaymentMethods:p});case o.SET_SHOULD_SAVE_PAYMENT_METHOD:return g(g({},e),{},{shouldSavePaymentMethod:a})}},O=r(39),E=r.n(O),j=r(27),w=r.n(j),S=r(1),k=r(38),_=r(53),P=r(2),R=r(82),x=r(36),C=r(66),T=r(60),A=r(32),M=r(54),N=r(35);function D(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function I(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?D(Object(r),!0).forEach((function(t){d()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):D(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var F=function(e,t,r,n){var o=Object(u.useState)(!1),i=s()(o,2),c=i[0],a=i[1],l=Object(x.a)().isEditor,f=Object(C.b)().selectedRates,p=Object(T.b)(),h=p.billingData,b=p.shippingAddress,g=Object(_.a)(f),v=Object(_.a)(r),y=Object(A.a)(),O=y.cartTotals,j=y.cartNeedsShipping,k=y.paymentRequirements,N=Object(u.useRef)({cart:y,cartTotals:O,cartNeedsShipping:j,billingData:h,shippingAddress:b,selectedShippingMethods:g,paymentRequirements:k}),D=Object(M.a)().addErrorNotice;Object(u.useEffect)((function(){N.current={cart:y,cartTotals:O,cartNeedsShipping:j,billingData:h,shippingAddress:b,selectedShippingMethods:g,paymentRequirements:k}}),[y,O,j,h,b,g,k]);var F=Object(u.useCallback)(E()(w.a.mark((function r(){var o,i,c,s,u,f,p;return w.a.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:o={},i=function(e){o=I(I({},o),{},d()({},e.name,e))},c=0;case 3:if(!(c<v.length)){r.next=29;break}if(s=v[c],u=t[s]){r.next=8;break}return r.abrupt("continue",26);case 8:if(r.prev=8,!l){r.next=13;break}r.t0=!0,r.next=16;break;case 13:return r.next=15,Promise.resolve(u.canMakePayment(N.current));case 15:r.t0=r.sent;case 16:if(!(f=r.t0)){r.next=21;break}if("object"!==m()(f)||null===f||!f.error){r.next=20;break}throw new Error(f.error.message);case 20:i(u);case 21:r.next=26;break;case 23:r.prev=23,r.t1=r.catch(8),(P.CURRENT_USER_IS_ADMIN||l)&&(p=Object(S.sprintf)(
/* translators: %s the id of the payment method being registered (bank transfer, Stripe...) */
Object(S.__)("There was an error registering the payment method with id '%s': ",'woocommerce'),u.paymentMethodId),D("".concat(p," ").concat(r.t1),{context:n,id:"wc-".concat(u.paymentMethodId,"-registration-error")}));case 26:c++,r.next=3;break;case 29:e(o),a(!0);case 31:case"end":return r.stop()}}),r,null,[[8,23]])}))),[D,e,l,n,v,t]),L=Object(R.a)(F,500),V=s()(L,1)[0];return Object(u.useEffect)((function(){V()}),[V,y,g,h]),c},L=function(e){return{type:e}},V=function(e){return{type:n.ERROR,errorMessage:e}},B=function(e){var t=e.errorMessage,r=e.paymentMethodData;return{type:n.FAILED,errorMessage:t,paymentMethodData:r}},U=function(e){var t=e.paymentMethodData;return{type:n.SUCCESS,paymentMethodData:t}},H=function(e){var t=e.paymentMethodData;return{type:n.STARTED,paymentMethodData:t}},z=function(e){return{type:o.SET_REGISTERED_PAYMENT_METHODS,paymentMethods:e}},q=function(e){return{type:o.SET_REGISTERED_EXPRESS_PAYMENT_METHODS,paymentMethods:e}},G=function(e){return{type:o.SET_SHOULD_SAVE_PAYMENT_METHOD,shouldSavePaymentMethod:e}},W=r(52),Y=r(48),K=r(98),X=r(191),J=r(193),$=r(127),Z=Object(u.createContext)(f),Q=function(){return Object(u.useContext)(Z)},ee=function(e){var t,r=e.children,o=Object(Y.b)(),i=o.isProcessing,a=o.isIdle,f=o.isCalculating,p=o.hasError,d=Object(x.a)(),h=d.isEditor,b=d.getPreviewData,g=Object($.b)().setValidationErrors,v=Object(M.a)(),O=v.addErrorNotice,E=v.removeNotice,j=Object(N.c)(),w=j.isSuccessResponse,S=j.isErrorResponse,_=j.isFailResponse,R=j.noticeContexts,A=Object(u.useReducer)(K.b,{}),D=s()(A,2),I=D[0],Q=(t=D[1],Object(u.useMemo)((function(){return{onPaymentProcessing:Object(X.a)("payment_processing",t)}}),[t])).onPaymentProcessing,ee=Object(u.useRef)(I);Object(u.useEffect)((function(){ee.current=I}),[I]);var te,re,ne,oe=Object(u.useReducer)(y,l),ie=s()(oe,2),ce=ie[0],ae=(te=ie[1],re=Object(T.b)().setBillingData,ne=Object(C.b)().setShippingAddress,{dispatchActions:Object(u.useMemo)((function(){return{setRegisteredPaymentMethods:function(e){te(z(e))},setRegisteredExpressPaymentMethods:function(e){te(q(e))},setShouldSavePayment:function(e){te(G(e))}}}),[te]),setPaymentStatus:Object(u.useCallback)((function(){return{pristine:function(){return te(L(n.PRISTINE))},started:function(e){te(H({paymentMethodData:e}))},processing:function(){return te(L(n.PROCESSING))},completed:function(){return te(L(n.COMPLETE))},error:function(e){return te(V(e))},failed:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;r&&re(r),te(B({errorMessage:e||"",paymentMethodData:t||{}}))},success:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;t&&re(t),void 0!==m()(r)&&null!=r&&r.address&&ne(r.address),te(U({paymentMethodData:e}))}}}),[te,re,ne])}),se=ae.dispatchActions,ue=ae.setPaymentStatus,le=function(e){var t=Object(k.getPaymentMethods)(),r=Object(N.c)().noticeContexts,n=new Set([].concat(c()(Object(P.getSetting)("paymentGatewaySortOrder",[])),c()(Object.keys(t))));return F(e,t,Array.from(n),r.PAYMENTS)}(se.setRegisteredPaymentMethods),fe=function(e){var t=Object(k.getExpressPaymentMethods)(),r=Object(N.c)().noticeContexts;return F(e,t,Object.keys(t),r.EXPRESS_PAYMENTS)}(se.setRegisteredExpressPaymentMethods),pe=function(){var e=Object(W.a)().dispatchCheckoutEvent,t=Object(u.useState)(""),r=s()(t,2),n=r[0],o=r[1],i=Object(u.useState)(""),c=s()(i,2),a=c[0],l=c[1];return Object(u.useEffect)((function(){e("set-active-payment-method",{activePaymentMethod:n})}),[e,n]),{activePaymentMethod:n,activeSavedToken:a,setActivePaymentMethod:o,setActiveSavedToken:l}}(),de=pe.activePaymentMethod,he=pe.activeSavedToken,me=pe.setActivePaymentMethod,be=pe.setActiveSavedToken,ge=Object(u.useMemo)((function(){return h?b("previewSavedPaymentMethods"):le?function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(0===Object.keys(e).length)return{};var t=Object(P.getSetting)("customerPaymentMethods",{}),r=Object.keys(t),n={};return r.forEach((function(r){var o=t[r].filter((function(t){var r,n=t.method.gateway;return n in e&&(null===(r=e[n].supports)||void 0===r?void 0:r.showSavedCards)}));o.length&&(n[r]=o)})),n}(ce.paymentMethods):{}}),[h,b,le,ce.paymentMethods]),ve=Object(u.useCallback)((function(e){e?O(e,{id:"wc-express-payment-error",context:R.EXPRESS_PAYMENTS}):E("wc-express-payment-error",R.EXPRESS_PAYMENTS)}),[O,R.EXPRESS_PAYMENTS,E]),ye=Object.keys(ce.expressPaymentMethods).includes(de),Oe=Object(u.useMemo)((function(){return{isPristine:ce.currentStatus===n.PRISTINE,isStarted:ce.currentStatus===n.STARTED,isProcessing:ce.currentStatus===n.PROCESSING,isFinished:[n.ERROR,n.FAILED,n.SUCCESS].includes(ce.currentStatus),hasError:ce.currentStatus===n.ERROR,hasFailed:ce.currentStatus===n.FAILED,isSuccessful:ce.currentStatus===n.SUCCESS,isDoingExpressPayment:ce.currentStatus!==n.PRISTINE&&ye}}),[ce.currentStatus,ye]);Object(u.useEffect)((function(){var e=Object.keys(ce.paymentMethods),t=[].concat(c()(e),c()(Object.keys(ce.expressPaymentMethods)));le&&e.length&&me((function(e){return e&&t.includes(e)?e:(ue().pristine(),Object.keys(ce.paymentMethods)[0])}))}),[le,ce.paymentMethods,ce.expressPaymentMethods,me,ue]),Object(u.useEffect)((function(){!i||p||f||Oe.isFinished||ue().processing()}),[i,p,f,Oe.isFinished,ue]),Object(u.useEffect)((function(){a&&!Oe.isSuccessful&&ue().pristine()}),[a,Oe.isSuccessful,ue]),Object(u.useEffect)((function(){p&&Oe.isSuccessful&&!ce.hasSavedToken&&ue().pristine()}),[p,Oe.isSuccessful,ce.hasSavedToken,ue]),Object(u.useEffect)((function(){Oe.isProcessing&&(E("wc-payment-error",R.PAYMENTS),Object(J.b)(ee.current,"payment_processing",{}).then((function(e){var t,r,n,o,i,c,a,s;if(e.forEach((function(e){w(e)&&(t=e),(S(e)||_(e))&&(r=e)})),t&&!r)ue().success(null===(n=t)||void 0===n||null===(o=n.meta)||void 0===o?void 0:o.paymentMethodData,null===(i=t)||void 0===i||null===(c=i.meta)||void 0===c?void 0:c.billingData,null===(a=t)||void 0===a||null===(s=a.meta)||void 0===s?void 0:s.shippingData);else if(r&&_(r)){var u,l,f,p,d,h;r.message&&r.message.length&&O(r.message,{id:"wc-payment-error",isDismissible:!1,context:(null===(h=r)||void 0===h?void 0:h.messageContext)||R.PAYMENTS}),ue().failed(null===(u=r)||void 0===u?void 0:u.message,null===(l=r)||void 0===l||null===(f=l.meta)||void 0===f?void 0:f.paymentMethodData,null===(p=r)||void 0===p||null===(d=p.meta)||void 0===d?void 0:d.billingData)}else if(r){var m,b;r.message&&r.message.length&&O(r.message,{id:"wc-payment-error",isDismissible:!1,context:(null===(b=r)||void 0===b?void 0:b.messageContext)||R.PAYMENTS}),ue().error(r.message),g(null===(m=r)||void 0===m?void 0:m.validationErrors)}else ue().success()})))}),[Oe.isProcessing,g,ue,E,R.PAYMENTS,w,_,S,O]);var Ee={setPaymentStatus:ue,currentStatus:Oe,paymentStatuses:n,paymentMethodData:ce.paymentMethodData,errorMessage:ce.errorMessage,activePaymentMethod:de,setActivePaymentMethod:me,activeSavedToken:he,setActiveSavedToken:be,onPaymentProcessing:Q,customerPaymentMethods:ge,paymentMethods:ce.paymentMethods,expressPaymentMethods:ce.expressPaymentMethods,paymentMethodsInitialized:le,expressPaymentMethodsInitialized:fe,setExpressPaymentError:ve,isExpressPaymentMethodActive:ye,shouldSavePayment:ce.shouldSavePaymentMethod,setShouldSavePayment:se.setShouldSavePayment};return React.createElement(Z.Provider,{value:Ee},r)}},,,,,,,,,,,,,,,function(e,t,r){"use strict";r.d(t,"a",(function(){return n}));var n=function(e,t){var r=[];return Object.keys(e).forEach((function(n){if(void 0!==t[n])switch(e[n].type){case"boolean":r[n]="false"!==t[n]&&!1!==t[n];break;case"number":r[n]=parseInt(t[n],10);break;case"array":case"object":r[n]=JSON.parse(t[n]);break;default:r[n]=t[n]}else r[n]=e[n].default})),r}},function(e,t){},,function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));var n=r(98),o=function(e,t){return function(r){var o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10,i=n.a.addEventCallback(e,r,o);return t(i),function(){t(n.a.removeEventCallback(e,i.id))}}}},,function(e,t,r){"use strict";r.d(t,"a",(function(){return d})),r.d(t,"b",(function(){return h}));var n=r(21),o=r.n(n),i=r(39),c=r.n(i),a=r(27),s=r.n(a),u=function(e,t){return e[t]?Array.from(e[t].values()).sort((function(e,t){return e.priority-t.priority})):[]},l=r(35);function f(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return p(e,void 0);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?p(e,void 0):void 0}}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,c=!0,a=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return c=e.done,e},e:function(e){a=!0,i=e},f:function(){try{c||null==r.return||r.return()}finally{if(a)throw i}}}}function p(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var d=function(){var e=c()(s.a.mark((function e(t,r,n){var i,c,a,l,p,d;return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:i=u(t,r),c=[],a=f(i),e.prev=3,a.s();case 5:if((l=a.n()).done){e.next=19;break}return p=l.value,e.prev=7,e.next=10,Promise.resolve(p.callback(n));case 10:d=e.sent,"object"===o()(d)&&c.push(d),e.next=17;break;case 14:e.prev=14,e.t0=e.catch(7),console.error(e.t0);case 17:e.next=5;break;case 19:e.next=24;break;case 21:e.prev=21,e.t1=e.catch(3),a.e(e.t1);case 24:return e.prev=24,a.f(),e.finish(24);case 27:return e.abrupt("return",!c.length||c);case 28:case"end":return e.stop()}}),e,null,[[3,21,24,27],[7,14]])})));return function(_x,t,r){return e.apply(this,arguments)}}(),h=function(){var e=c()(s.a.mark((function e(t,r,n){var i,c,a,p,d,h;return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:i=[],c=u(t,r),a=f(c),e.prev=3,a.s();case 5:if((p=a.n()).done){e.next=28;break}return d=p.value,e.prev=7,e.next=10,Promise.resolve(d.callback(n));case 10:if(h=e.sent,"object"===o()(h)&&null!==h){e.next=13;break}return e.abrupt("continue",26);case 13:if(h.hasOwnProperty("type")){e.next=15;break}throw new Error("Returned objects from event emitter observers must return an object with a type property");case 15:if(!Object(l.a)(h)&&!Object(l.b)(h)){e.next=18;break}return i.push(h),e.abrupt("return",i);case 18:i.push(h),e.next=26;break;case 21:return e.prev=21,e.t0=e.catch(7),console.error(e.t0),i.push({type:"error"}),e.abrupt("return",i);case 26:e.next=5;break;case 28:e.next=33;break;case 30:e.prev=30,e.t1=e.catch(3),a.e(e.t1);case 33:return e.prev=33,a.f(),e.finish(33);case 36:return e.abrupt("return",i);case 37:case"end":return e.stop()}}),e,null,[[3,30,33,36],[7,21]])})));return function(t,r,n){return e.apply(this,arguments)}}()},,,,,,function(e,t,r){"use strict";var n=r(0),o=r(2),i=r(8),c=r(11),a=r(1);Object(a.__)("Unable to get cart data from the API.",'woocommerce'),t.a=function(e){return function(t){var r,a;return r=Object(n.useRef)(Object(o.getSetting)("preloadedApiRequests",{})),a=Object(c.useDispatch)(i.CART_STORE_KEY).setIsCartDataStale,Object(c.useSelect)((function(e,t){var n,o=null===(n=r.current["/wc/store/cart"])||void 0===n?void 0:n.body;if(o){var c=e(i.CART_STORE_KEY),s=c.isResolving,u=c.hasFinishedResolution,l=c.isCartDataStale;if(!l()&&!s("getCartData")&&!u("getCartData",[])){var f=window.localStorage.getItem("wc-blocks_cart_update_timestamp");if(f){var p=parseFloat(f),d=parseFloat(o.generated_timestamp);!isNaN(d)&&!isNaN(p)&&p>d&&a()}}var h,m=t.dispatch(i.CART_STORE_KEY),b=m.receiveCart,g=m.receiveError,v=m.startResolution,y=m.finishResolution;l()||s("getCartData",[])||u("getCartData",[])||(v("getCartData",[]),null!=o&&null!==(h=o.code)&&void 0!==h&&h.includes("error")?g(o):b(o),y("getCartData",[]))}}),[]),React.createElement(e,t)}}},,function(e,t,r){"use strict";r.d(t,"b",(function(){return l})),r.d(t,"a",(function(){return f}));var n=r(5),o=r.n(n),i=(r(10),r(0)),c=r(24),a=r(6),s=r.n(a),u=Object(i.createContext)({hasContainerWidth:!1,containerClassName:"",isMobile:!1,isSmall:!1,isMedium:!1,isLarge:!1}),l=function(){return Object(i.useContext)(u)},f=function(e){var t=e.children,r=e.className,n=void 0===r?"":r,i=function(){var e=Object(c.useResizeObserver)(),t=o()(e,2),r=t[0],n=t[1].width,i="";return n>700?i="is-large":n>520?i="is-medium":n>400?i="is-small":n&&(i="is-mobile"),[r,i]}(),a=o()(i,2),l=a[0],f=a[1],p={hasContainerWidth:""!==f,containerClassName:f,isMobile:"is-mobile"===f,isSmall:"is-small"===f,isMedium:"is-medium"===f,isLarge:"is-large"===f};return React.createElement(u.Provider,{value:p},React.createElement("div",{className:s()(n,f)},l,t))}},,,,,,,,,,,,,,,,,,function(e,t,r){"use strict";r.d(t,"a",(function(){return o})),r.d(t,"b",(function(){return i}));var n=r(0),o=Object(n.createContext)({allowCreateAccount:!1,showCompanyField:!1,showApartmentField:!1,showPhoneField:!1,requireCompanyField:!1,requirePhoneField:!1}),i=(Object(n.createContext)({addressFieldControls:function(){return null},accountControls:function(){return null}}),function(){return Object(n.useContext)(o)})},,,,,function(e,t,r){"use strict";r.d(t,"a",(function(){return b}));var n=r(4),o=r.n(n),i=r(23),c=r.n(i),a=r(107),s=r(0),u=r(136),l=r.n(u),f=r(26),p=["blockName"];function d(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function h(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?d(Object(r),!0).forEach((function(t){o()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):d(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var m=function(e,t){return e&&t[e]?t[e]:null},b=function(e){var t=e.Block,r=e.selector,n=e.blockName,o=e.getProps,i=void 0===o?function(){return{}}:o,u=e.blockMap,d=e.blockWrapper;Object(a.a)({Block:t,selector:r,getProps:function(e,t){var r=function e(t){var r=t.block,n=t.blockMap,o=t.blockWrapper,i=t.children,a=t.depth,u=void 0===a?1:a;return i&&0!==i.length?Array.from(i).map((function(t,i){var a=h({key:"".concat(r,"_").concat(u,"_").concat(i)},t instanceof HTMLElement?t.dataset:{}),d=a.blockName,b=void 0===d?"":d,g=c()(a,p),v=m(b,n);if(!v){var y=l()((null==t?void 0:t.outerHTML)||(null==t?void 0:t.textContent)||"");if("string"==typeof y&&y)return y;if(!Object(s.isValidElement)(y))return null;var O=t.childNodes.length?e({block:r,blockMap:n,children:t.childNodes,depth:u+1,blockWrapper:o}):void 0;return O?Object(s.cloneElement)(y,g,O):Object(s.cloneElement)(y,g)}var E=o||s.Fragment;return React.createElement(s.Suspense,{key:"".concat(r,"_").concat(u,"_").concat(i,"_suspense"),fallback:React.createElement("div",{className:"wc-block-placeholder"})},React.createElement(E,null,React.createElement(v,g,e({block:r,blockMap:n,children:t.children,depth:u+1,blockWrapper:o}),function(e,t,r){if(!Object(f.hasInnerBlocks)(e))return null;var n=r?Array.from(r).map((function(e){return e instanceof HTMLElement&&(null==e?void 0:e.dataset.blockName)||null})).filter(Boolean):[];return Object(f.getRegisteredBlocks)(e).filter((function(e){var t=e.blockName;return!0===e.force&&!n.includes(t)})).map((function(e,r){var n=e.blockName,o=e.component||m(n,t);return o?React.createElement(o,{key:"".concat(n,"_forced_").concat(r)}):null}))}(b,n,t.children))))})):null}({block:n,blockMap:u,children:e.children||[],blockWrapper:d});return h(h({},i(e,t)),{},{children:r})}})}},,function(e,t,r){"use strict";r.d(t,"b",(function(){return C})),r.d(t,"a",(function(){return T}));var n=r(4),o=r.n(n),i=r(5),c=r.n(i),a=(r(10),r(0)),s=r(11),u=r(12),l=r(27),f=r.n(l);function p(e,t,r,n,o,i,c){try{var a=e[i](c),s=a.value}catch(e){return void r(e)}a.done?t(s):Promise.resolve(s).then(n,o)}function d(e){return function(){var t=this,r=arguments;return new Promise((function(n,o){var i=e.apply(t,r);function c(e){p(i,n,o,c,a,"next",e)}function a(e){p(i,n,o,c,a,"throw",e)}c(void 0)}))}}var h=r(22),m=r(6),b=r.n(m),g=r(7),v=r(117),y=r(24),O=r(134),E=function(e){var t=e.notices,r=e.className,n=e.children,o=e.onRemove,i=void 0===o?g.noop:o,c=Object(y.useReducedMotion)(),s=Object(a.useState)((function(){return new WeakMap})),l=Object(h.a)(s,1)[0],p=Object(v.useTransition)(t,(function(e){return e.id}),{from:{opacity:0,height:0},enter:function(e){return function(){var t=d(f.a.mark((function t(r){return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,r({opacity:1,height:l.get(e).offsetHeight});case 2:return t.abrupt("return",t.sent);case 3:case"end":return t.stop()}}),t)})));return function(_x){return t.apply(this,arguments)}}()},leave:function(){return function(){var e=d(f.a.mark((function e(t){return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t({opacity:0});case 2:return e.next=4,t({height:0});case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()},immediate:c});r=b()("components-snackbar-list",r);var m=function(e){return function(){return i(e.id)}};return Object(a.createElement)("div",{className:r},n,p.map((function(e){var t=e.item,r=e.key,n=e.props;return Object(a.createElement)(v.animated.div,{key:r,style:n},Object(a.createElement)("div",{className:"components-snackbar-list__notice-container",ref:function(e){return e&&l.set(t,e)}},Object(a.createElement)(O.a,Object(u.a)({},Object(g.omit)(t,["content"]),{onRemove:m(t)}),t.content)))})))},j=r(26),w={},S=function(e){var t=e.className,r=e.notices,n=e.removeNotice;if(e.isEditor)return null;var o=r.filter((function(e){return"snackbar"===e.type})),i=o.length>0?o.reduce((function(e,t){return e[t.content]=!0,e}),{}):w,c=Object(j.__experimentalApplyCheckoutFilter)({filterName:"snackbarNoticeVisibility",defaultValue:i}),a=o.filter((function(e){return!0===c[e.content]})),s=b()(t,"wc-block-components-notices__snackbar");return React.createElement(E,{notices:a,className:s,onRemove:n})},k=r(52),_=r(36);function P(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function R(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?P(Object(r),!0).forEach((function(t){o()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):P(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var x=Object(a.createContext)({notices:[],createSnackbarNotice:function(e,t){},removeSnackbarNotice:function(e,t){},setIsSuppressed:function(e){},context:"wc/core"}),C=function(){return Object(a.useContext)(x)},T=function(e){var t=e.children,r=e.context,n=void 0===r?"wc/core":r,o=Object(s.useDispatch)("core/notices"),i=o.createNotice,u=o.removeNotice,l=Object(a.useState)(!1),f=c()(l,2),p=f[0],d=f[1],h=Object(k.a)().dispatchStoreEvent,m=Object(_.a)().isEditor,b=Object(a.useCallback)((function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};i("default",e,R(R({},t),{},{type:"snackbar",context:t.context||n})),h("store-notice-create",{status:"default",content:e,options:t})}),[i,h,n]),g=Object(a.useCallback)((function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:n;u(e,t)}),[u,n]),v={notices:Object(s.useSelect)((function(e){return{notices:e("core/notices").getNotices(n)}}),[n]).notices,createSnackbarNotice:b,removeSnackbarNotice:g,context:n,setIsSuppressed:d},y=p?null:React.createElement(S,{notices:v.notices,removeNotice:v.removeSnackbarNotice,isEditor:m});return React.createElement(x.Provider,{value:v},t,y)}},,,function(e){e.exports=JSON.parse('{"name":"woocommerce/checkout-fields-block","version":"1.0.0","title":"Checkout Fields","description":"Column containing checkout address fields.","category":"woocommerce","supports":{"align":false,"html":false,"multiple":false,"reusable":false,"inserter":false},"attributes":{"lock":{"type":"object","default":{"remove":true,"move":true}}},"parent":["woocommerce/checkout"],"textdomain":'woocommerce',"apiVersion":2}')},function(e){e.exports=JSON.parse('{"name":"woocommerce/checkout-express-payment-block","version":"1.0.0","title":"Express Checkout","description":"Provide an express payment option for your customers.","category":"woocommerce","supports":{"align":false,"html":false,"multiple":false,"reusable":false,"inserter":false},"attributes":{"lock":{"type":"object","default":{"remove":true,"move":true}}},"parent":["woocommerce/checkout-fields-block"],"textdomain":'woocommerce',"apiVersion":2}')},function(e){e.exports=JSON.parse('{"name":"woocommerce/checkout-contact-information-block","version":"1.0.0","title":"Contact Information","description":"Collect your customer\'s contact information.","category":"woocommerce","supports":{"align":false,"html":false,"multiple":false,"reusable":false,"inserter":false},"attributes":{"lock":{"type":"object","default":{"remove":true,"move":true}}},"parent":["woocommerce/checkout-fields-block"],"textdomain":'woocommerce',"apiVersion":2}')},function(e){e.exports=JSON.parse('{"name":"woocommerce/checkout-shipping-address-block","version":"1.0.0","title":"Shipping Address","description":"Collect your customer\'s shipping address.","category":"woocommerce","supports":{"align":false,"html":false,"multiple":false,"reusable":false,"inserter":false},"attributes":{"lock":{"type":"object","default":{"remove":true,"move":true}}},"parent":["woocommerce/checkout-fields-block"],"textdomain":'woocommerce',"apiVersion":2}')},function(e){e.exports=JSON.parse('{"name":"woocommerce/checkout-billing-address-block","version":"1.0.0","title":"Billing Address","description":"Collect your customer\'s billing address.","category":"woocommerce","supports":{"align":false,"html":false,"multiple":false,"reusable":false,"inserter":false},"attributes":{"lock":{"type":"object","default":{"remove":true,"move":true}}},"parent":["woocommerce/checkout-fields-block"],"textdomain":'woocommerce',"apiVersion":2}')},function(e){e.exports=JSON.parse('{"name":"woocommerce/checkout-shipping-methods-block","version":"1.0.0","title":"Shipping Options","description":"Shipping options for your store.","category":"woocommerce","supports":{"align":false,"html":false,"multiple":false,"reusable":false,"inserter":false},"attributes":{"lock":{"type":"object","default":{"remove":true,"move":true}}},"parent":["woocommerce/checkout-fields-block"],"textdomain":'woocommerce',"apiVersion":2}')},function(e){e.exports=JSON.parse('{"name":"woocommerce/checkout-payment-block","version":"1.0.0","title":"Payment Options","description":"Payment options for your store.","category":"woocommerce","supports":{"align":false,"html":false,"multiple":false,"reusable":false,"inserter":false},"attributes":{"lock":{"type":"object","default":{"remove":true,"move":true}}},"parent":["woocommerce/checkout-fields-block"],"textdomain":'woocommerce',"apiVersion":2}')},function(e){e.exports=JSON.parse('{"name":"woocommerce/checkout-order-note-block","version":"1.0.0","title":"Order Note","description":"Allow customers to add a note to their order.","category":"woocommerce","supports":{"align":false,"html":false,"multiple":false,"reusable":false,"inserter":false},"attributes":{"lock":{"type":"object","default":{"remove":true,"move":true}}},"parent":["woocommerce/checkout-fields-block"],"textdomain":'woocommerce',"apiVersion":2}')},function(e){e.exports=JSON.parse('{"name":"woocommerce/checkout-terms-block","version":"1.0.0","title":"Terms and Conditions","description":"Ensure customers agree to your terms and conditions and privacy policy.","category":"woocommerce","supports":{"align":false,"html":false,"multiple":false,"reusable":false},"attributes":{"checkbox":{"type":"boolean","default":false},"text":{"type":"string","required":false}},"parent":["woocommerce/checkout-fields-block"],"textdomain":'woocommerce',"apiVersion":2}')},function(e){e.exports=JSON.parse('{"name":"woocommerce/checkout-actions-block","version":"1.0.0","title":"Actions","description":"Allow customers to place their order.","category":"woocommerce","supports":{"align":false,"html":false,"multiple":false,"reusable":false,"inserter":false},"attributes":{"lock":{"type":"object","default":{"remove":true,"move":true}}},"parent":["woocommerce/checkout-fields-block"],"textdomain":'woocommerce',"apiVersion":2}')},function(e){e.exports=JSON.parse('{"name":"woocommerce/checkout-totals-block","version":"1.0.0","title":"Checkout Totals","description":"Column containing the checkout totals.","category":"woocommerce","supports":{"align":false,"html":false,"multiple":false,"reusable":false,"inserter":false},"attributes":{"checkbox":{"type":"boolean","default":false},"text":{"type":"string","required":false}},"parent":["woocommerce/checkout"],"textdomain":'woocommerce',"apiVersion":2}')},function(e){e.exports=JSON.parse('{"name":"woocommerce/checkout-order-summary-block","version":"1.0.0","title":"Order Summary","description":"Show customers a summary of their order.","category":"woocommerce","supports":{"align":false,"html":false,"multiple":false,"reusable":false,"inserter":false},"attributes":{"lock":{"type":"object","default":{"remove":true}}},"parent":["woocommerce/checkout-totals-block"],"textdomain":'woocommerce',"apiVersion":2}')},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(e,t,r){"use strict";var n=r(6),o=r.n(n),i=(r(10),r(201));r(189),t.a=function(e){var t=e.children,r=e.className;return React.createElement(i.a,{className:o()("wc-block-components-sidebar-layout",r)},t)}},,,,,,,,,,,,,,,,,,,,,,,,,,function(e,t,r){e.exports=r(315)},function(e,t,r){"use strict";r.d(t,"a",(function(){return a}));var n=r(5),o=r.n(n),i=r(0),c=r(127),a=function(){var e=Object(c.b)(),t=e.hasValidationErrors,r=e.getValidationError,n=e.clearValidationError,a=e.hideValidationError,s=e.setValidationErrors,u="extensions-errors";return{hasValidationErrors:t,getValidationError:Object(i.useCallback)((function(e){return r("".concat(u,"-").concat(e))}),[r]),clearValidationError:Object(i.useCallback)((function(e){return n("".concat(u,"-").concat(e))}),[n]),hideValidationError:Object(i.useCallback)((function(e){return a("".concat(u,"-").concat(e))}),[a]),setValidationErrors:Object(i.useCallback)((function(e){return s(Object.fromEntries(Object.entries(e).map((function(e){var t=o()(e,2),r=t[0],n=t[1];return["".concat(u,"-").concat(r),n]}))))}),[s])}}},function(e,t){},function(e,t){},function(e,t){},,,,,,,,function(e,t,r){"use strict";r.r(t);var n=r(23),o=r.n(n),i=r(0),c=r(188),a=r(32),s=r(4),u=r.n(s),l=r(25),f=r.n(l),p=r(48);function d(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function h(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?d(Object(r),!0).forEach((function(t){u()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):d(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var m=r(304),b=r(38),g=r(199),v=r(128),y=r(224),O=r(83),E=r(26),j=r(238),w=r(233),S=r(231),k=r(230),_=r(229),P=r(236),R=r(240),x=r(235),C=r(232),T=r(234),A=r(237),M=r(239);r.p=O.k,Object(E.registerCheckoutBlock)({metadata:_,component:Object(i.lazy)((function(){return r.e(36).then(r.bind(null,395))}))}),Object(E.registerCheckoutBlock)({metadata:k,component:Object(i.lazy)((function(){return Promise.all([r.e(3),r.e(35)]).then(r.bind(null,417))}))}),Object(E.registerCheckoutBlock)({metadata:S,component:Object(i.lazy)((function(){return r.e(34).then(r.bind(null,408))}))}),Object(E.registerCheckoutBlock)({metadata:C,component:Object(i.lazy)((function(){return Promise.all([r.e(0),r.e(2),r.e(4),r.e(40)]).then(r.bind(null,410))}))}),Object(E.registerCheckoutBlock)({metadata:w,component:Object(i.lazy)((function(){return Promise.all([r.e(0),r.e(2),r.e(4),r.e(33)]).then(r.bind(null,411))}))}),Object(E.registerCheckoutBlock)({metadata:T,component:Object(i.lazy)((function(){return Promise.all([r.e(1),r.e(41)]).then(r.bind(null,407))}))}),Object(E.registerCheckoutBlock)({metadata:x,component:Object(i.lazy)((function(){return Promise.all([r.e(3),r.e(39)]).then(r.bind(null,405))}))}),Object(E.registerCheckoutBlock)({metadata:P,component:Object(i.lazy)((function(){return r.e(37).then(r.bind(null,412))}))}),Object(E.registerCheckoutBlock)({metadata:A,component:Object(i.lazy)((function(){return r.e(42).then(r.bind(null,418))}))}),Object(E.registerCheckoutBlock)({metadata:j,component:Object(i.lazy)((function(){return r.e(32).then(r.bind(null,406))}))}),Object(E.registerCheckoutBlock)({metadata:M,component:Object(i.lazy)((function(){return r.e(43).then(r.bind(null,396))}))}),Object(E.registerCheckoutBlock)({metadata:R,component:Object(i.lazy)((function(){return Promise.all([r.e(0),r.e(1),r.e(2),r.e(5),r.e(38)]).then(r.bind(null,413))}))});var N=r(1),D=r(6),I=r.n(D),F=r(54),L=r(127),V=r(103),B=r(146),U=r(226),H=r(44),z=r(277),q=r(2),G=r(114),W=(r(305),r(152)),Y=r(34),K=React.createElement(Y.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},React.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),React.createElement("path",{d:"M15.55 13c.75 0 1.41-.41 1.75-1.03l3.58-6.49c.37-.66-.11-1.48-.87-1.48H5.21l-.94-2H1v2h2l3.6 7.59-1.35 2.44C4.52 15.37 5.48 17 7 17h12v-2H7l1.1-2h7.45zM6.16 6h12.15l-2.76 5H8.53L6.16 6zM7 18c-1.1 0-1.99.9-1.99 2S5.9 22 7 22s2-.9 2-2-.9-2-2-2zm10 0c-1.1 0-1.99.9-1.99 2s.89 2 1.99 2 2-.9 2-2-.9-2-2-2z"})),X=(r(306),function(){return React.createElement("div",{className:"wc-block-checkout-empty"},React.createElement(W.a,{className:"wc-block-checkout-empty__image",alt:"",srcElement:K,size:100}),React.createElement("strong",{className:"wc-block-checkout-empty__title"},Object(N.__)("Your cart is empty!",'woocommerce')),React.createElement("p",{className:"wc-block-checkout-empty__description"},Object(N.__)("Checkout is not available whilst your cart is empty—please take a look through our store and come back when you're ready to place an order.",'woocommerce')),O.i&&React.createElement("span",{className:"wp-block-button"},React.createElement("a",{href:O.i,className:"wp-block-button__link"},Object(N.__)("Browse store",'woocommerce'))))}),J=React.createElement(Y.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},React.createElement("path",{d:"M22.7 22.7l-20-20L2 2l-.7-.7L0 2.5 4.4 7l2.2 4.7L5.2 14A2 2 0 007 17h7.5l1.3 1.4a2 2 0 102.8 2.8l2.9 2.8 1.2-1.3zM7.4 15a.2.2 0 01-.2-.3l.9-1.7h2.4l2 2h-5zm8.2-2a2 2 0 001.7-1l3.6-6.5.1-.5c0-.6-.4-1-1-1H6.5l9 9zM7 18a2 2 0 100 4 2 2 0 000-4z"}),React.createElement("path",{fill:"none",d:"M0 0h24v24H0z"})),$=r(28);function Z(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}r(307);var Q=["woocommerce_product_out_of_stock","woocommerce_rest_cart_product_is_not_purchasable","woocommerce_rest_cart_product_no_stock","woocommerce_rest_cart_product_sold_individually","woocommerce_rest_cart_item_error"],ee=function(e){var t=e.errorData,r=Object(N.__)("Checkout error",'woocommerce');return Q.includes(t.code)&&(r=Object(N.__)("There is a problem with your cart",'woocommerce')),React.createElement("strong",{className:"wc-block-checkout-error_title"},r)},te=function(e){var t=e.errorData,r=t.message;return Q.includes(t.code)&&(r=r+" "+Object(N.__)("Please edit your cart and try again.",'woocommerce')),React.createElement("p",{className:"wc-block-checkout-error__description"},r)},re=function(e){var t=e.errorData,r=Object(N.__)("Retry",'woocommerce'),n="javascript:window.location.reload(true)";return Q.includes(t.code)&&(r=Object(N.__)("Edit your cart",'woocommerce'),n=O.c),React.createElement("span",{className:"wp-block-button"},React.createElement("a",{href:n,className:"wp-block-button__link"},r))},ne=function(){var e,t=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Z(Object(r),!0).forEach((function(t){u()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Z(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({code:"",message:""},(null===(e=Object(q.getSetting)("preloadedApiRequests",{})["/wc/store/checkout"])||void 0===e?void 0:e.body)||{}),r={code:t.code||"unknown",message:Object($.decodeEntities)(t.message)||Object(N.__)("There was a problem checking out. Please try again. If the problem persists, please get in touch with us so we can assist.",'woocommerce')};return React.createElement("div",{className:"wc-block-checkout-error"},React.createElement(W.a,{className:"wc-block-checkout-error__image",alt:"",srcElement:J,size:100}),React.createElement(ee,{errorData:r}),React.createElement(te,{errorData:r}),React.createElement(re,{errorData:r}))},oe=("".concat(O.e,"?redirect_to=").concat(encodeURIComponent(window.location.href)),function(){window.location.reload(!0)}),ie=r(219),ce=function(e){var t=e.attributes,r=e.children,n=Object(p.b)(),o=n.hasOrder,i=n.customerId,c=Object(a.a)(),s=c.cartItems,u=c.cartIsLoading,l=t.allowCreateAccount,f=t.showCompanyField,d=t.requireCompanyField,h=t.showApartmentField,m=t.showPhoneField,b=t.requirePhoneField;return u||0!==s.length?o?(function(e){return!e&&!Object(q.getSetting)("checkoutAllowsGuest",!1)}(i)&&l&&Object(q.getSetting)("checkoutAllowsSignup",!1),React.createElement(ie.a.Provider,{value:{allowCreateAccount:l,showCompanyField:f,requireCompanyField:d,showApartmentField:h,showPhoneField:m,requirePhoneField:b}},r)):React.createElement(ne,null):React.createElement(X,null)},ae=function(e){var t=e.scrollToTop,r=Object(F.a)().hasNoticesOfType,n=Object(p.b)(),o=n.hasError,c=n.isIdle,a=Object(L.b)(),s=a.hasValidationErrors,u=a.showAllValidationErrors,l=c&&o&&(s||r("default"));return Object(i.useEffect)((function(){var e;return l&&(u(),e=window.setTimeout((function(){t({focusableSelector:"input:invalid, .has-error input"})}),50)),function(){clearTimeout(e)}}),[l,t,u]),null},se=Object(G.a)((function(e){var t=e.attributes,r=e.children,n=e.scrollToTop;return React.createElement(H.a,{header:Object(N.__)("Something went wrong…",'woocommerce'),text:Object(i.createInterpolateElement)(Object(N.__)("The checkout has encountered an unexpected error. <button>Try reloading the page</button>. If the error persists, please get in touch with us so we can assist.",'woocommerce'),{button:React.createElement("button",{className:"wc-block-link-button",onClick:oe})}),showErrorMessage:q.CURRENT_USER_IS_ADMIN},React.createElement(U.a,{context:"wc/checkout"},React.createElement(V.a,{context:"wc/checkout"},React.createElement(L.a,null,React.createElement(E.SlotFillProvider,null,React.createElement(B.a,null,React.createElement(z.a,{className:I()("wc-block-checkout",{"has-dark-controls":t.hasDarkControls})},React.createElement(ce,{attributes:t},r),React.createElement(ae,{scrollToTop:n}))))))))})),ue={isPreview:{type:"boolean",default:!1,save:!1},hasDarkControls:{type:"boolean",default:Object(q.getSetting)("hasDarkEditorStyleSupport",!1)},showCompanyField:{type:"boolean",default:!1},requireCompanyField:{type:"boolean",default:!1},allowCreateAccount:{type:"boolean",default:!1},showApartmentField:{type:"boolean",default:!0},showPhoneField:{type:"boolean",default:!0},requirePhoneField:{type:"boolean",default:!1},showOrderNotes:{type:"boolean",default:!0},showPolicyLinks:{type:"boolean",default:!0},showReturnToCart:{type:"boolean",default:!0},cartPageId:{type:"number",default:0},showRateAfterTaxName:{type:"boolean",default:Object(q.getSetting)("displayCartPricesIncludingTax",!1)}},le=["extensions","receiveCart"];Object(y.a)({Block:Object(g.a)(Object(v.a)(se)),blockName:"woocommerce/checkout",selector:".wp-block-woocommerce-checkout",getProps:function(e){return{attributes:Object(c.a)(ue,e instanceof HTMLElement?e.dataset:{})}},blockMap:Object(b.getRegisteredBlockComponents)("woocommerce/checkout"),blockWrapper:function(e){var t=e.children,r=Object(a.a)(),n=r.extensions,c=(r.receiveCart,o()(r,le)),s=function(){var e=Object(p.b)(),t=e.dispatchActions,r=e.extensionData,n=Object(i.useRef)(r);Object(i.useEffect)((function(){f()(r,n.current)||(n.current=r)}),[r]);var o=Object(i.useCallback)((function(e,r,o){var i=n.current[e]||{};t.setExtensionData(h(h({},n.current),{},u()({},e,h(h({},i),{},u()({},r,o)))))}),[t]);return{extensionData:n.current,setExtensionData:o}}(),l=Object(m.a)();return i.Children.map(t,(function(e){if(Object(i.isValidElement)(e)){var t={extensions:n,cart:c,checkoutExtensionData:s,validation:l};return Object(i.cloneElement)(e,t)}return e}))}})}]);woocommerce-blocks/build/wc-blocks-style-rtl.css000064400000567232151335517640016021 0ustar00.wc-block-link-button{border:0;border-radius:0;margin:0;padding:0;vertical-align:baseline;color:inherit;font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;letter-spacing:inherit;line-height:inherit;text-decoration:inherit;text-transform:inherit;box-shadow:none;display:inline;text-shadow:none;text-decoration:underline}.wc-block-link-button,.wc-block-link-button:active,.wc-block-link-button:focus,.wc-block-link-button:hover{background:transparent}.wc-block-suspense-placeholder{-webkit-animation:loading-fade 1.2s ease-in-out infinite;animation:loading-fade 1.2s ease-in-out infinite;background-color:var(--global--color-primary,#e0e0e0)!important;color:var(--global--color-primary,#e0e0e0)!important;outline:0!important;border:0!important;box-shadow:none;pointer-events:none;max-width:100%}.wc-block-suspense-placeholder>*{visibility:hidden}@media screen and (prefers-reduced-motion:reduce){.wc-block-suspense-placeholder{-webkit-animation:none;animation:none}}.wc-block-suspense-placeholder:after{content:" "}.wc-block-grid__products .wc-block-grid__product-image{text-decoration:none;display:block;position:relative}.wc-block-grid__products .wc-block-grid__product-image a{text-decoration:none;border:0;outline:0;box-shadow:none}.wc-block-grid__products .wc-block-grid__product-image img{height:auto;width:100%}.wc-block-grid__products .wc-block-grid__product-image img[hidden]{display:none}.edit-post-visual-editor .editor-block-list__block .wc-block-grid__product-title,.editor-styles-wrapper .wc-block-grid__product-title,.wc-block-grid__product-title{font-family:inherit;line-height:1.2em;font-weight:700;padding:0;color:inherit;font-size:inherit;display:block}.wc-block-grid__product-price{display:block}.wc-block-grid__product-price .wc-block-grid__product-price__regular{margin-left:.5em}.wc-block-grid__product-add-to-cart.wp-block-button{word-break:break-word;white-space:normal}.wc-block-grid__product-add-to-cart.wp-block-button .wp-block-button__link{word-break:break-word;white-space:normal;margin:0 auto!important;display:inline-flex;justify-content:center;text-align:center;padding:.5em 1em;font-size:1em}.wc-block-grid__product-add-to-cart.wp-block-button .wp-block-button__link.loading{opacity:.25}.wc-block-grid__product-add-to-cart.wp-block-button .wp-block-button__link.added:after{font-family:WooCommerce;content:"";margin-right:.5em;display:inline-block;width:auto;height:auto}.wc-block-grid__product-add-to-cart.wp-block-button .wp-block-button__link.loading:after{font-family:WooCommerce;content:"";-webkit-animation:spin 2s linear infinite;animation:spin 2s linear infinite;margin-right:.5em;display:inline-block;width:auto;height:auto}.has-5-columns:not(.alignfull) .wc-block-grid__product-add-to-cart.wp-block-button .wp-block-button__link:after,.has-6-columns .wc-block-grid__product-add-to-cart.wp-block-button .wp-block-button__link:after,.has-7-columns .wc-block-grid__product-add-to-cart.wp-block-button .wp-block-button__link:after,.has-8-columns .wc-block-grid__product-add-to-cart.wp-block-button .wp-block-button__link:after,.has-9-columns .wc-block-grid__product-add-to-cart.wp-block-button .wp-block-button__link:after{content:"";margin:0}.wc-block-grid__product-rating{display:block}.wc-block-grid__product-rating .star-rating,.wc-block-grid__product-rating .wc-block-grid__product-rating__stars{overflow:hidden;position:relative;width:5.3em;height:1.618em;line-height:1.618;font-size:1em;font-family:star;font-weight:400;margin:0 auto;text-align:right}.wc-block-grid__product-rating .star-rating:before,.wc-block-grid__product-rating .wc-block-grid__product-rating__stars:before{content:"SSSSS";top:0;right:0;left:0;position:absolute;opacity:.5;color:#aaa;white-space:nowrap}.wc-block-grid__product-rating .star-rating span,.wc-block-grid__product-rating .wc-block-grid__product-rating__stars span{overflow:hidden;top:0;right:0;left:0;position:absolute;padding-top:1.5em}.wc-block-grid__product-rating .star-rating span:before,.wc-block-grid__product-rating .wc-block-grid__product-rating__stars span:before{content:"SSSSS";top:0;right:0;left:0;position:absolute;color:#000;white-space:nowrap}.wc-block-grid__product-onsale{font-size:.875em;padding:.25em .75em;display:inline-block;width:auto;border:1px solid #43454b;border-radius:3px;color:#43454b;background:#fff;text-align:center;text-transform:uppercase;font-weight:600;z-index:9;position:relative}.wc-block-grid__product .wc-block-grid__product-image,.wc-block-grid__product .wc-block-grid__product-title{margin:0 0 12px}.wc-block-grid__product .wc-block-grid__product-add-to-cart,.wc-block-grid__product .wc-block-grid__product-onsale,.wc-block-grid__product .wc-block-grid__product-price,.wc-block-grid__product .wc-block-grid__product-rating{margin:0 auto 12px}.theme-twentysixteen .wc-block-grid .price ins{color:#77a464}.theme-twentynineteen .wc-block-grid__product{font-size:.88889em}.theme-twentynineteen .wc-block-components-product-sale-badge,.theme-twentynineteen .wc-block-components-product-title,.theme-twentynineteen .wc-block-grid__product-onsale,.theme-twentynineteen .wc-block-grid__product-title{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Fira Sans,Droid Sans,Helvetica Neue,sans-serif}.theme-twentynineteen .wc-block-grid__product-title:before{display:none}.theme-twentynineteen .wc-block-components-product-sale-badge,.theme-twentynineteen .wc-block-grid__product-onsale{line-height:1}.theme-twentynineteen .editor-styles-wrapper .wp-block-button .wp-block-button__link:not(.has-text-color){color:#fff}.theme-twentytwenty .wc-block-grid__product-link{color:#000}.theme-twentytwenty .wc-block-components-product-title,.theme-twentytwenty .wc-block-grid__product-title{font-family:-apple-system,blinkmacsystemfont,Helvetica Neue,helvetica,sans-serif;color:#cd2653;font-size:1em}.theme-twentytwenty .wp-block-columns .wc-block-components-product-title{margin-top:0}.theme-twentytwenty .wc-block-components-product-price .woocommerce-Price-amount,.theme-twentytwenty .wc-block-components-product-price__value,.theme-twentytwenty .wc-block-grid__product-price .woocommerce-Price-amount,.theme-twentytwenty .wc-block-grid__product-price__value{font-family:-apple-system,blinkmacsystemfont,Helvetica Neue,helvetica,sans-serif;font-size:.9em}.theme-twentytwenty .wc-block-components-product-price del,.theme-twentytwenty .wc-block-grid__product-price del{opacity:.5}.theme-twentytwenty .wc-block-components-product-price ins,.theme-twentytwenty .wc-block-grid__product-price ins{text-decoration:none}.theme-twentytwenty .star-rating,.theme-twentytwenty .wc-block-grid__product-rating{font-size:.7em}.theme-twentytwenty .star-rating .wc-block-components-product-rating__stars,.theme-twentytwenty .star-rating .wc-block-grid__product-rating__stars,.theme-twentytwenty .wc-block-grid__product-rating .wc-block-components-product-rating__stars,.theme-twentytwenty .wc-block-grid__product-rating .wc-block-grid__product-rating__stars{line-height:1}.theme-twentytwenty .wc-block-components-product-button>.wp-block-button__link,.theme-twentytwenty .wc-block-grid__product-add-to-cart>.wp-block-button__link{font-family:-apple-system,blinkmacsystemfont,Helvetica Neue,helvetica,sans-serif}.theme-twentytwenty .wc-block-components-product-sale-badge,.theme-twentytwenty .wc-block-grid__products .wc-block-grid__product-onsale{background:#cd2653;color:#fff;font-family:-apple-system,blinkmacsystemfont,Helvetica Neue,helvetica,sans-serif;font-weight:700;letter-spacing:-.02em;line-height:1.2;text-transform:uppercase}.theme-twentytwenty .wc-block-grid__products .wc-block-components-product-sale-badge{position:static}.theme-twentytwenty .wc-block-grid__products .wc-block-grid__product-image .wc-block-components-product-sale-badge{position:absolute}.theme-twentytwenty .wc-block-grid__products .wc-block-grid__product-onsale:not(.wc-block-components-product-sale-badge){position:absolute;left:4px;top:4px;z-index:1}.theme-twentytwenty .wc-block-active-filters__title,.theme-twentytwenty .wc-block-attribute-filter__title,.theme-twentytwenty .wc-block-price-filter__title,.theme-twentytwenty .wc-block-stock-filter__title{font-size:1em}.theme-twentytwenty .wc-block-active-filters .wc-block-active-filters__clear-all{font-size:.75em}.theme-twentytwenty .wc-block-grid__product-add-to-cart.wp-block-button .wp-block-button__link{font-size:.75em;padding:.5em}@media only screen and (min-width:768px){.theme-twentytwenty .wc-block-grid__products .wc-block-grid__product-onsale{font-size:.875em;padding:.5em}}@media only screen and (min-width:1168px){.theme-twentytwenty .wc-block-grid__products .wc-block-grid__product-onsale{font-size:.875em;padding:.5em}}.screen-reader-text{border:0;clip:rect(1px,1px,1px,1px);-webkit-clip-path:inset(50%);clip-path:inset(50%);height:1px;margin:-1px;overflow:hidden;overflow-wrap:normal!important;word-wrap:normal!important;padding:0;position:absolute!important;width:1px}.screen-reader-text:focus{background-color:#fff;border-radius:3px;box-shadow:0 0 2px 2px rgba(0,0,0,.6);clip:auto!important;-webkit-clip-path:none;clip-path:none;color:#2b2d2f;display:block;font-size:.875rem;font-weight:700;height:auto;right:5px;line-height:normal;padding:15px 23px 14px;text-decoration:none;top:5px;width:auto;z-index:100000}.wc-block-components-product-add-to-cart-attribute-picker{margin:0;flex-basis:100%}.wc-block-components-product-add-to-cart-attribute-picker label{display:block;font-size:1em}.wc-block-components-product-add-to-cart-attribute-picker .wc-block-components-product-add-to-cart-attribute-picker__container{position:relative}.wc-block-components-product-add-to-cart-attribute-picker .wc-block-components-product-add-to-cart-attribute-picker__select{margin:0 0 .75em}.wc-block-components-product-add-to-cart-attribute-picker .wc-block-components-product-add-to-cart-attribute-picker__select select{min-width:60%;min-height:1.75em}.wc-block-components-product-add-to-cart-attribute-picker .wc-block-components-product-add-to-cart-attribute-picker__select.has-error{margin-bottom:24px}.wc-block-components-product-add-to-cart-attribute-picker .wc-block-components-product-add-to-cart-attribute-picker__select.has-error select{border-color:#cc1818}.wc-block-components-product-add-to-cart-attribute-picker .wc-block-components-product-add-to-cart-attribute-picker__select.has-error select:focus{outline-color:#cc1818}.wc-block-components-product-add-to-cart{margin:0;display:flex;flex-wrap:wrap}.wc-block-components-product-add-to-cart .wc-block-components-product-add-to-cart-button{margin:0 0 .75em}.wc-block-components-product-add-to-cart .wc-block-components-product-add-to-cart-button .wc-block-components-button__text{display:block}.wc-block-components-product-add-to-cart .wc-block-components-product-add-to-cart-button .wc-block-components-button__text>svg{fill:currentColor;vertical-align:top;width:1.5em;height:1.5em;margin:-.25em .5em -.25em 0}.wc-block-components-product-add-to-cart .wc-block-components-product-add-to-cart-quantity{margin:0 0 .75em 1em;flex-basis:5em;padding:.618em;background:#fff;border:1px solid #ccc;border-radius:2px;color:#43454b;box-shadow:inset 0 1px 1px rgba(0,0,0,.125);text-align:center}.is-loading .wc-block-components-product-add-to-cart .wc-block-components-product-add-to-cart-button,.is-loading .wc-block-components-product-add-to-cart .wc-block-components-product-add-to-cart-quantity,.wc-block-components-product-add-to-cart--placeholder .wc-block-components-product-add-to-cart-button,.wc-block-components-product-add-to-cart--placeholder .wc-block-components-product-add-to-cart-quantity{-webkit-animation:loading-fade 1.2s ease-in-out infinite;animation:loading-fade 1.2s ease-in-out infinite;background-color:var(--global--color-primary,#e0e0e0)!important;color:var(--global--color-primary,#e0e0e0)!important;outline:0!important;border:0!important;box-shadow:none;pointer-events:none;max-width:100%}.is-loading .wc-block-components-product-add-to-cart .wc-block-components-product-add-to-cart-button>*,.is-loading .wc-block-components-product-add-to-cart .wc-block-components-product-add-to-cart-quantity>*,.wc-block-components-product-add-to-cart--placeholder .wc-block-components-product-add-to-cart-button>*,.wc-block-components-product-add-to-cart--placeholder .wc-block-components-product-add-to-cart-quantity>*{visibility:hidden}@media screen and (prefers-reduced-motion:reduce){.is-loading .wc-block-components-product-add-to-cart .wc-block-components-product-add-to-cart-button,.is-loading .wc-block-components-product-add-to-cart .wc-block-components-product-add-to-cart-quantity,.wc-block-components-product-add-to-cart--placeholder .wc-block-components-product-add-to-cart-button,.wc-block-components-product-add-to-cart--placeholder .wc-block-components-product-add-to-cart-quantity{-webkit-animation:none;animation:none}}.wc-block-grid .wc-block-components-product-add-to-cart{justify-content:center}.wc-block-components-product-add-to-cart-notice{margin:0}.wp-block-button.wc-block-components-product-button{word-break:break-word;white-space:normal;margin-top:0;margin-bottom:12px}.wp-block-button.wc-block-components-product-button .wc-block-components-product-button__button{word-break:break-word;white-space:normal;margin:0 auto;display:inline-flex;justify-content:center}.wp-block-button.wc-block-components-product-button .wc-block-components-product-button__button--placeholder{-webkit-animation:loading-fade 1.2s ease-in-out infinite;animation:loading-fade 1.2s ease-in-out infinite;background-color:var(--global--color-primary,#e0e0e0)!important;color:var(--global--color-primary,#e0e0e0)!important;outline:0!important;border:0!important;box-shadow:none;pointer-events:none;max-width:100%;min-width:8em;min-height:3em}.wp-block-button.wc-block-components-product-button .wc-block-components-product-button__button--placeholder>*{visibility:hidden}@media screen and (prefers-reduced-motion:reduce){.wp-block-button.wc-block-components-product-button .wc-block-components-product-button__button--placeholder{-webkit-animation:none;animation:none}}.is-loading .wc-block-components-product-button>.wc-block-components-product-button__button{-webkit-animation:loading-fade 1.2s ease-in-out infinite;animation:loading-fade 1.2s ease-in-out infinite;background-color:var(--global--color-primary,#e0e0e0)!important;color:var(--global--color-primary,#e0e0e0)!important;outline:0!important;border:0!important;box-shadow:none;pointer-events:none;max-width:100%;min-width:8em;min-height:3em}.is-loading .wc-block-components-product-button>.wc-block-components-product-button__button>*{visibility:hidden}@media screen and (prefers-reduced-motion:reduce){.is-loading .wc-block-components-product-button>.wc-block-components-product-button__button{-webkit-animation:none;animation:none}}.theme-twentytwentyone .editor-styles-wrapper .wc-block-components-product-button .wp-block-button__link{background-color:var(--button--color-background);color:var(--button--color-text);border-color:var(--button--color-background)}.wc-block-components-product-category-list{margin-top:0;margin-bottom:.75em}.wc-block-components-product-category-list ul{margin:0;padding:0;display:inline}.wc-block-components-product-category-list ul li{display:inline;list-style:none}.wc-block-components-product-category-list ul li:after{content:", "}.wc-block-components-product-category-list ul li:last-child:after{content:""}.editor-styles-wrapper .wc-block-grid__products .wc-block-grid__product .wc-block-components-product-image,.wc-block-components-product-image{margin-top:0;margin-bottom:12px;text-decoration:none;display:block;position:relative}.editor-styles-wrapper .wc-block-grid__products .wc-block-grid__product .wc-block-components-product-image a,.wc-block-components-product-image a{text-decoration:none;border:0;outline:0;box-shadow:none}.editor-styles-wrapper .wc-block-grid__products .wc-block-grid__product .wc-block-components-product-image img,.wc-block-components-product-image img{vertical-align:middle;width:100%}.editor-styles-wrapper .wc-block-grid__products .wc-block-grid__product .wc-block-components-product-image img[hidden],.wc-block-components-product-image img[hidden]{display:none}.editor-styles-wrapper .wc-block-grid__products .wc-block-grid__product .wc-block-components-product-image .wc-block-components-product-sale-badge--align-left,.wc-block-components-product-image .wc-block-components-product-sale-badge--align-left{position:absolute;right:4px;top:4px;left:auto;margin:0}.editor-styles-wrapper .wc-block-grid__products .wc-block-grid__product .wc-block-components-product-image .wc-block-components-product-sale-badge--align-center,.wc-block-components-product-image .wc-block-components-product-sale-badge--align-center{position:absolute;top:4px;right:50%;left:auto;transform:translateX(50%);margin:0}.editor-styles-wrapper .wc-block-grid__products .wc-block-grid__product .wc-block-components-product-image .wc-block-components-product-sale-badge--align-right,.wc-block-components-product-image .wc-block-components-product-sale-badge--align-right{position:absolute;left:4px;top:4px;right:auto;margin:0}.is-loading .wc-block-components-product-image{-webkit-animation:loading-fade 1.2s ease-in-out infinite;animation:loading-fade 1.2s ease-in-out infinite;background-color:var(--global--color-primary,#e0e0e0)!important;color:var(--global--color-primary,#e0e0e0)!important;outline:0!important;border:0!important;box-shadow:none;pointer-events:none;max-width:100%}.is-loading .wc-block-components-product-image>*{visibility:hidden}@media screen and (prefers-reduced-motion:reduce){.is-loading .wc-block-components-product-image{-webkit-animation:none;animation:none}}.wc-block-components-product-rating{display:block;margin-top:0;margin-bottom:12px}.wc-block-components-product-rating__stars{overflow:hidden;position:relative;width:5.3em;height:1.618em;line-height:1.618;font-size:1em;font-family:star;font-weight:400;margin:0 auto;text-align:right}.wc-block-components-product-rating__stars:before{content:"SSSSS";top:0;right:0;left:0;position:absolute;opacity:.5;color:#aaa;white-space:nowrap}.wc-block-components-product-rating__stars span{overflow:hidden;top:0;right:0;left:0;position:absolute;padding-top:1.5em}.wc-block-components-product-rating__stars span:before{content:"SSSSS";top:0;right:0;left:0;position:absolute;color:#000;white-space:nowrap}.wc-block-single-product .wc-block-components-product-rating__stars{margin:0}.wc-block-components-product-sale-badge{margin:0 auto 12px;font-size:.875em;padding:.25em .75em;display:inline-block;width:auto;border:1px solid #43454b;border-radius:3px;color:#43454b;background:#fff;text-align:center;text-transform:uppercase;font-weight:600;z-index:9;position:static}.wc-block-components-product-sku{margin-top:0;margin-bottom:12px;display:block;text-transform:uppercase;font-size:.875em}.wc-block-components-product-stock-indicator{margin-top:0;margin-bottom:.75em;display:block;font-size:.875em}.wc-block-components-product-stock-indicator--in-stock{color:#4ab866}.wc-block-components-product-stock-indicator--out-of-stock{color:#cc1818}.wc-block-components-product-stock-indicator--available-on-backorder,.wc-block-components-product-stock-indicator--low-stock{color:#f0b849}.wc-block-components-product-summary{margin-top:0;margin-bottom:12px}.is-loading .wc-block-components-product-summary:before{-webkit-animation:loading-fade 1.2s ease-in-out infinite;animation:loading-fade 1.2s ease-in-out infinite;background-color:var(--global--color-primary,#e0e0e0)!important;color:var(--global--color-primary,#e0e0e0)!important;outline:0!important;border:0!important;box-shadow:none;pointer-events:none;max-width:100%;content:".";display:block;width:100%;height:6em}.is-loading .wc-block-components-product-summary:before>*{visibility:hidden}@media screen and (prefers-reduced-motion:reduce){.is-loading .wc-block-components-product-summary:before{-webkit-animation:none;animation:none}}.wc-block-components-product-tag-list{margin-top:0;margin-bottom:.75em}.wc-block-components-product-tag-list ul{margin:0;padding:0;display:inline}.wc-block-components-product-tag-list ul li{display:inline;list-style:none}.wc-block-components-product-tag-list ul li:after{content:", "}.wc-block-components-product-tag-list ul li:last-child:after{content:""}.wc-block-components-product-title{margin-top:0;margin-bottom:12px}.wc-block-grid .wc-block-components-product-title{line-height:1.5;font-weight:700;padding:0;color:inherit;font-size:inherit;display:block}.is-loading .wc-block-components-product-title:before{-webkit-animation:loading-fade 1.2s ease-in-out infinite;animation:loading-fade 1.2s ease-in-out infinite;background-color:var(--global--color-primary,#e0e0e0)!important;color:var(--global--color-primary,#e0e0e0)!important;outline:0!important;border:0!important;box-shadow:none;pointer-events:none;max-width:100%;content:".";display:inline-block;width:7em}.is-loading .wc-block-components-product-title:before>*{visibility:hidden}@media screen and (prefers-reduced-motion:reduce){.is-loading .wc-block-components-product-title:before{-webkit-animation:none;animation:none}}.is-loading .wc-block-grid .wc-block-components-product-title:before{width:10em}.wc-block-components-product-title--align-left{text-align:right}.wc-block-components-product-title--align-center{text-align:center}.wc-block-components-product-title--align-right{text-align:left}.wc-block-components-error{display:flex;padding:40px 0;margin:40px 0;align-items:center;justify-content:center;flex-direction:column;color:#757575;text-align:center}.wc-block-components-error__header{font-size:2em;margin:0;color:#646970}.wc-block-components-error__image{width:25%;margin:0 0 24px}.wc-block-components-error__text{margin:1em 0 0;color:#8c8f94;font-size:1.25em;max-width:60ch}.wc-block-components-error__message{margin:1em auto 0;font-style:italic;color:#8c8f94;max-width:60ch}.wc-block-error__button{margin:40px 0 0}.wc-block-components-button:not(.is-link){color:inherit;font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;letter-spacing:inherit;line-height:inherit;text-decoration:inherit;text-transform:inherit;align-items:center;background-color:#1e1e1e;color:#fff;display:inline-flex;font-weight:700;min-height:3em;justify-content:center;line-height:1;padding:0 1em;text-align:center;text-decoration:none;text-transform:none;position:relative}.wc-block-components-button:not(.is-link):active,.wc-block-components-button:not(.is-link):disabled,.wc-block-components-button:not(.is-link):focus,.wc-block-components-button:not(.is-link):hover{background-color:#1e1e1e;color:#fff}.wc-block-components-button:not(.is-link) .wc-block-components-button__text{display:block}.wc-block-components-button:not(.is-link) .wc-block-components-button__text>svg{fill:currentColor}.wc-block-components-button:not(.is-link) .wc-block-components-spinner+.wc-block-components-button__text{visibility:hidden}.wc-block-components-form{counter-reset:checkout-step}.wc-block-components-form .wc-block-components-checkout-step{position:relative;border:none;padding:0 24px 0 0;background:none;margin:0}.is-mobile .wc-block-components-form .wc-block-components-checkout-step,.is-small .wc-block-components-form .wc-block-components-checkout-step{padding-right:0}.wc-block-components-checkout-step--disabled{opacity:.6}.wc-block-components-checkout-step__container{position:relative}.wc-block-components-checkout-step__content>*{margin-bottom:1em}.wc-block-components-checkout-step--with-step-number .wc-block-components-checkout-step__content>:last-child{margin-bottom:0;padding-bottom:1.5em}.wc-block-components-checkout-step__heading{display:flex;justify-content:space-between;align-content:center;flex-wrap:wrap;margin:.75em 0 1em;position:relative;align-items:center;gap:1em}.wc-block-components-checkout-step:first-child .wc-block-components-checkout-step__heading,.wc-block-components-express-payment-continue-rule+.wc-block-components-checkout-step .wc-block-components-checkout-step__heading{margin-top:0}.wc-block-components-checkout-step__title{margin:0 0 0 12px}.wc-block-components-checkout-step__heading-content{font-size:.75em}.wc-block-components-checkout-step__heading-content a{font-weight:700;color:inherit}.wc-block-components-checkout-step__description{font-size:.875em;line-height:1.25;margin-bottom:16px}.wc-block-components-checkout-step--with-step-number .wc-block-components-checkout-step__title:before{border:0;border-radius:0;margin:0;padding:0;vertical-align:baseline;background:transparent;counter-increment:checkout-step;content:" " counter(checkout-step) ".";content:" " counter(checkout-step) "."/"";position:absolute;width:24px;right:-24px;top:0;text-align:center;transform:translateX(50%)}.wc-block-components-checkout-step--with-step-number .wc-block-components-checkout-step__container:after{content:"";height:100%;border-right:1px solid;opacity:.3;position:absolute;right:-24px;top:0}.is-mobile .wc-block-components-checkout-step--with-step-number .wc-block-components-checkout-step__title:before,.is-small .wc-block-components-checkout-step--with-step-number .wc-block-components-checkout-step__title:before{position:static;transform:none;right:auto;top:auto;content:counter(checkout-step) ". ";content:counter(checkout-step) ". "/""}.is-mobile .wc-block-components-checkout-step--with-step-number .wc-block-components-checkout-step__container:after,.is-small .wc-block-components-checkout-step--with-step-number .wc-block-components-checkout-step__container:after{content:unset}.editor-styles-wrapper .wp-block h4.wc-block-components-checkout-step__title{font-size:1em;line-height:24px;margin:0 0 0 12px}.wc-block-components-order-summary .wc-block-components-panel__button{padding-top:0;margin-top:0}.wc-block-components-order-summary .wc-block-components-panel__content{margin-bottom:0}.wc-block-components-order-summary__content{display:table;width:100%}.wc-block-components-order-summary-item{position:relative;font-size:.875em;display:flex;padding-bottom:1px;padding-top:16px;width:100%}.wc-block-components-order-summary-item:after{border-style:solid;border-width:0 0 1px;bottom:0;content:"";display:block;right:0;opacity:.3;pointer-events:none;position:absolute;left:0;top:0}.wc-block-components-order-summary-item:first-child{padding-top:0}.wc-block-components-order-summary-item:last-child>div{padding-bottom:0}.wc-block-components-order-summary-item:last-child:after{display:none}.wc-block-components-order-summary-item .wc-block-components-product-metadata{font-size:1em}.wc-block-components-order-summary-item__description,.wc-block-components-order-summary-item__image{display:table-cell;vertical-align:top}.wc-block-components-order-summary-item__image{width:48px;padding-bottom:16px;position:relative}.wc-block-components-order-summary-item__image>img{width:48px;max-width:48px}.wc-block-components-order-summary-item__quantity{align-items:center;background:#fff;border:2px solid;border-radius:1em;box-shadow:0 0 0 2px #fff;color:#000;display:flex;line-height:1;min-height:20px;padding:0 .4em;position:absolute;justify-content:center;min-width:20px;left:0;top:0;transform:translate(-50%,-50%);white-space:nowrap;z-index:1}.wc-block-components-order-summary-item__description{padding-right:24px;padding-left:12px;padding-bottom:16px}.wc-block-components-order-summary-item__description .wc-block-components-product-metadata,.wc-block-components-order-summary-item__description p{line-height:1.375;margin-top:4px}.wc-block-components-order-summary-item__total-price{font-weight:700;margin-right:auto;text-align:left}.wc-block-components-order-summary-item__individual-prices{display:block}.wc-block-components-payment-method-icons{margin:0 0 14px;display:flex;flex-direction:row;flex-wrap:wrap;justify-content:center}.wc-block-components-payment-method-icons .wc-block-components-payment-method-icon{display:inline-block;margin:0 4px 2px;padding:0;width:auto;max-width:38px;height:24px;max-height:24px}.wc-block-components-payment-method-icons--align-left{justify-content:flex-start}.wc-block-components-payment-method-icons--align-left .wc-block-components-payment-method-icon{margin-right:0;margin-left:8px}.wc-block-components-payment-method-icons--align-right{justify-content:flex-end}.wc-block-components-payment-method-icons--align-right .wc-block-components-payment-method-icon{margin-left:0;margin-right:8px}.wc-block-components-payment-method-icons:last-child{margin-bottom:0}.is-mobile .wc-block-components-payment-method-icons .wc-block-components-payment-method-icon,.is-small .wc-block-components-payment-method-icons .wc-block-components-payment-method-icon{height:16px}.wc-block-components-payment-method-label--with-icon{display:inline-block;vertical-align:middle}.wc-block-components-payment-method-label--with-icon>img,.wc-block-components-payment-method-label--with-icon>svg{vertical-align:middle;margin:-2px 0 0 4px}.is-mobile .wc-block-components-payment-method-label--with-icon>img,.is-mobile .wc-block-components-payment-method-label--with-icon>svg,.is-small .wc-block-components-payment-method-label--with-icon>img,.is-small .wc-block-components-payment-method-label--with-icon>svg{display:none}.editor-styles-wrapper .wc-block-components-checkout-policies,.wc-block-components-checkout-policies{font-size:.75em;text-align:center;list-style:none outside;line-height:1;margin:24px 0}.wc-block-components-checkout-policies__item{list-style:none outside;display:inline-block;padding:0 .25em;margin:0}.wc-block-components-checkout-policies__item:not(:first-child){border-right:1px solid #ccc}.wc-block-components-checkout-policies__item>a{color:inherit;padding:0 .25em}.wc-block-components-product-badge{font-size:.75em;border-radius:2px;border:1px solid;display:inline-block;font-weight:600;padding:0 .66em;text-transform:uppercase;white-space:nowrap}.wc-block-components-product-details.wc-block-components-product-details{list-style:none;margin:.5em 0;padding:0}.wc-block-components-product-details.wc-block-components-product-details:last-of-type{margin-bottom:0}.wc-block-components-product-details.wc-block-components-product-details li{margin-right:0}.wc-block-components-product-details__name,.wc-block-components-product-details__value{display:inline-block}.is-large:not(.wc-block-checkout) .wc-block-components-product-details__name{font-weight:700}.wc-block-components-product-metadata{font-size:.75em}.wc-block-components-product-metadata .wc-block-components-product-metadata__description>p,.wc-block-components-product-metadata .wc-block-components-product-metadata__variation-data{margin:.25em 0}.wc-block-components-checkout-return-to-cart-button{box-shadow:none;color:inherit;padding-right:calc(24px + .25em);position:relative;text-decoration:none}.wc-block-components-checkout-return-to-cart-button svg{right:0;position:absolute;transform:translateY(-50%);top:50%}.wc-block-components-shipping-calculator-address{margin-bottom:0}.wc-block-components-shipping-calculator-address__button{width:100%;margin-top:1.5em}.wc-block-components-shipping-calculator{padding:.5em 0 .75em}.wc-block-components-shipping-rates-control__package .wc-block-components-panel__button{margin-bottom:0;margin-top:0;padding-bottom:.75em;padding-top:.75em}.wc-block-components-shipping-rates-control__package .wc-block-components-panel__content,.wc-block-components-shipping-rates-control__package .wc-block-components-radio-control,.wc-block-components-shipping-rates-control__package .wc-block-components-radio-control .wc-block-components-radio-control__option-layout,.wc-block-components-shipping-rates-control__package .wc-block-components-radio-control__option-layout{padding-bottom:0}.wc-block-components-shipping-rates-control__package-items{font-size:.875em;display:block;list-style:none;margin:0;padding:0}.wc-block-components-shipping-rates-control__package-item{overflow-wrap:anywhere;word-break:break-word;-ms-word-break:break-all;display:inline-block;margin:0;padding:0}.wc-block-components-shipping-rates-control__package-item:not(:last-child):after{content:", ";white-space:pre}.wc-block-components-totals-coupon .wc-block-components-panel__button{margin-top:0;padding-top:0}.wc-block-components-totals-coupon .wc-block-components-panel__content{padding-bottom:0}.wc-block-components-totals-coupon__form{display:flex;width:100%;margin-bottom:0}.wc-block-components-totals-coupon__form .wc-block-components-totals-coupon__input{margin-bottom:0;margin-top:0;flex-grow:1}.wc-block-components-totals-coupon__form .wc-block-components-totals-coupon__button{height:3em;flex-shrink:0;margin-right:8px;padding-right:24px;padding-left:24px;white-space:nowrap}.wc-block-components-totals-coupon__form .wc-block-components-totals-coupon__button.no-margin{margin:0}.wc-block-components-totals-coupon__content{flex-direction:column;position:relative}.wc-block-components-totals-discount__coupon-list{list-style:none;margin:0;padding:0}.wc-block-components-totals-discount .wc-block-components-totals-item__value{color:#4ab866}.wc-block-components-totals-footer-item .wc-block-components-totals-item__label,.wc-block-components-totals-footer-item .wc-block-components-totals-item__value{font-size:1.25em}.wc-block-components-totals-footer-item .wc-block-components-totals-item__label{font-weight:700}.wc-block-components-totals-footer-item .wc-block-components-totals-footer-item-tax{margin-bottom:0}.wc-block-components-totals-shipping fieldset.wc-block-components-totals-shipping__fieldset{background-color:transparent;margin:0;padding:0;border:0}.wc-block-components-totals-shipping .wc-block-components-totals-shipping__via{margin-bottom:16px}.wc-block-components-totals-shipping .wc-block-components-totals-shipping__options .wc-block-components-radio-control__description,.wc-block-components-totals-shipping .wc-block-components-totals-shipping__options .wc-block-components-radio-control__label,.wc-block-components-totals-shipping .wc-block-components-totals-shipping__options .wc-block-components-radio-control__secondary-description,.wc-block-components-totals-shipping .wc-block-components-totals-shipping__options .wc-block-components-radio-control__secondary-label{flex-basis:100%;text-align:right}.wc-block-components-totals-shipping .wc-block-components-shipping-rates-control__no-results-notice{margin:0 0 .75em}.wc-block-components-totals-shipping .wc-block-components-totals-shipping__change-address-button{border:0;border-radius:0;margin:0;padding:0;vertical-align:baseline;color:inherit;font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;letter-spacing:inherit;line-height:inherit;text-decoration:inherit;text-transform:inherit;background:transparent;box-shadow:none;display:inline;text-shadow:none;text-decoration:underline}.wc-block-components-totals-shipping .wc-block-components-totals-shipping__change-address-button:active,.wc-block-components-totals-shipping .wc-block-components-totals-shipping__change-address-button:focus,.wc-block-components-totals-shipping .wc-block-components-totals-shipping__change-address-button:hover{background:transparent;opacity:.8}.theme-twentytwentyone.theme-twentytwentyone.theme-twentytwentyone .wc-block-components-totals-shipping__change-address-button{border:0;border-radius:0;margin:0;padding:0;vertical-align:baseline;color:inherit;font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;letter-spacing:inherit;line-height:inherit;text-decoration:inherit;text-transform:inherit;background:transparent;box-shadow:none;display:inline;text-shadow:none;text-decoration:underline}.theme-twentytwentyone.theme-twentytwentyone.theme-twentytwentyone .wc-block-components-totals-shipping__change-address-button:active,.theme-twentytwentyone.theme-twentytwentyone.theme-twentytwentyone .wc-block-components-totals-shipping__change-address-button:focus,.theme-twentytwentyone.theme-twentytwentyone.theme-twentytwentyone .wc-block-components-totals-shipping__change-address-button:hover{background:transparent}.wc-block-components-checkbox{color:inherit;font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;letter-spacing:inherit;line-height:inherit;text-decoration:inherit;text-transform:inherit;align-items:flex-start;display:flex;position:relative;margin-top:1.5em}.wc-block-components-checkbox .wc-block-components-checkbox__input[type=checkbox]{font-size:1em;-webkit-appearance:none;-moz-appearance:none;appearance:none;border:2px solid #50575e;border-radius:2px;box-sizing:border-box;height:1.5em;width:1.5em;margin:0;min-height:24px;min-width:24px;overflow:hidden;position:static;vertical-align:middle;background-color:#fff}.wc-block-components-checkbox .wc-block-components-checkbox__input[type=checkbox]:checked{background:#fff;border-color:#50575e}.wc-block-components-checkbox .wc-block-components-checkbox__input[type=checkbox]:focus{outline:2px solid #50575e;outline-offset:2px}.wc-block-components-checkbox .wc-block-components-checkbox__input[type=checkbox]:after,.wc-block-components-checkbox .wc-block-components-checkbox__input[type=checkbox]:before{content:""}.wc-block-components-checkbox .wc-block-components-checkbox__input[type=checkbox]:not(:checked)+.wc-block-components-checkbox__mark{display:none}.has-dark-controls .wc-block-components-checkbox .wc-block-components-checkbox__input[type=checkbox]{border-color:hsla(0,0%,100%,.6);background-color:rgba(0,0,0,.1)}.has-dark-controls .wc-block-components-checkbox .wc-block-components-checkbox__input[type=checkbox]:checked{background:rgba(0,0,0,.1);border-color:hsla(0,0%,100%,.6)}.has-dark-controls .wc-block-components-checkbox .wc-block-components-checkbox__input[type=checkbox]:focus{outline:2px solid hsla(0,0%,100%,.6);outline-offset:2px}.wc-block-components-checkbox.has-error,.wc-block-components-checkbox.has-error a{color:#cc1818}.wc-block-components-checkbox.has-error .wc-block-components-checkbox__input,.wc-block-components-checkbox.has-error .wc-block-components-checkbox__input:active,.wc-block-components-checkbox.has-error .wc-block-components-checkbox__input:focus,.wc-block-components-checkbox.has-error .wc-block-components-checkbox__input:hover{border-color:#cc1818}.wc-block-components-checkbox.has-error .wc-block-components-checkbox__input:focus{outline:2px solid #cc1818;outline-offset:2px}.wc-block-components-checkbox .wc-block-components-checkbox__mark{fill:#000;position:absolute;margin-right:.1875em;margin-top:.0625em;width:1.125em;height:1.125em}.has-dark-controls .wc-block-components-checkbox .wc-block-components-checkbox__mark{fill:#fff}.wc-block-components-checkbox .wc-block-components-checkbox__label,.wc-block-components-checkbox>span{padding-right:16px;vertical-align:middle;line-height:1.5em}@media (-ms-high-contrast:none),screen and (-ms-high-contrast:active){.wc-block-components-checkbox__mark{display:none}}.theme-twentytwentyone .has-dark-controls .wc-block-components-checkbox__input[type=checkbox],.theme-twentytwentyone .wc-block-components-checkbox__input[type=checkbox]{background-color:#fff;border-color:var(--form--border-color);position:relative}.theme-twentytwentyone .has-dark-controls .wc-block-components-checkbox__input[type=checkbox]:checked,.theme-twentytwentyone .wc-block-components-checkbox__input[type=checkbox]:checked{background-color:#fff;border-color:var(--form--border-color)}.theme-twentytwentyone .wc-block-components-checkbox__mark{display:none}.editor-styles-wrapper .wc-block-components-checkbox-list,.wc-block-components-checkbox-list{margin:0;padding:0;list-style:none outside}.editor-styles-wrapper .wc-block-components-checkbox-list li,.wc-block-components-checkbox-list li{margin:0 0 4px;padding:0;list-style:none outside}.editor-styles-wrapper .wc-block-components-checkbox-list li.show-less button,.editor-styles-wrapper .wc-block-components-checkbox-list li.show-more button,.wc-block-components-checkbox-list li.show-less button,.wc-block-components-checkbox-list li.show-more button{background:none;border:none;padding:0;text-decoration:underline;cursor:pointer}.editor-styles-wrapper .wc-block-components-checkbox-list.is-loading li,.wc-block-components-checkbox-list.is-loading li{-webkit-animation:loading-fade 1.2s ease-in-out infinite;animation:loading-fade 1.2s ease-in-out infinite;background-color:var(--global--color-primary,#e0e0e0)!important;color:var(--global--color-primary,#e0e0e0)!important;outline:0!important;border:0!important;box-shadow:none;pointer-events:none;max-width:100%}.editor-styles-wrapper .wc-block-components-checkbox-list.is-loading li>*,.wc-block-components-checkbox-list.is-loading li>*{visibility:hidden}@media screen and (prefers-reduced-motion:reduce){.editor-styles-wrapper .wc-block-components-checkbox-list.is-loading li,.wc-block-components-checkbox-list.is-loading li{-webkit-animation:none;animation:none}}.wc-block-components-chip{color:inherit;font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;letter-spacing:inherit;line-height:inherit;text-decoration:inherit;text-transform:inherit;align-items:center;border:0;display:inline-flex;padding:.125em .5em .25em;margin:0 0 .365em .365em;border-radius:0;line-height:1;max-width:100%}.wc-block-components-chip,.wc-block-components-chip:active,.wc-block-components-chip:focus,.wc-block-components-chip:hover{background:#e0e0e0;color:#1e1e1e}.wc-block-components-chip.wc-block-components-chip--radius-small{border-radius:3px}.wc-block-components-chip.wc-block-components-chip--radius-medium{border-radius:.433em}.wc-block-components-chip.wc-block-components-chip--radius-large{border-radius:2em;padding-right:.75em;padding-left:.75em}.wc-block-components-chip .wc-block-components-chip__text{flex-grow:1}.wc-block-components-chip.is-removable{padding-left:.5em}.wc-block-components-chip.is-removable .wc-block-components-chip__text{padding-left:.25em}.wc-block-components-chip .wc-block-components-chip__remove{font-size:.75em;background:transparent;border:0;-webkit-appearance:none;-moz-appearance:none;appearance:none;padding:0}.wc-block-components-chip .wc-block-components-chip__remove-icon{vertical-align:middle}.theme-twentytwentyone .wc-block-components-chip,.theme-twentytwentyone .wc-block-components-chip:active,.theme-twentytwentyone .wc-block-components-chip:focus,.theme-twentytwentyone .wc-block-components-chip:hover{background:#fff}.theme-twentytwentyone .wc-block-components-chip:active button.wc-block-components-chip__remove:not(:hover):not(:active):not(.has-background),.theme-twentytwentyone .wc-block-components-chip:focus button.wc-block-components-chip__remove:not(:hover):not(:active):not(.has-background),.theme-twentytwentyone .wc-block-components-chip:hover button.wc-block-components-chip__remove:not(:hover):not(:active):not(.has-background),.theme-twentytwentyone .wc-block-components-chip button.wc-block-components-chip__remove:not(:hover):not(:active):not(.has-background){background:transparent}.wc-block-components-chip__remove:focus,.wc-block-components-chip__remove:hover,button.wc-block-components-chip:focus>.wc-block-components-chip__remove,button.wc-block-components-chip:hover>.wc-block-components-chip__remove{fill:#cc1818}.wc-block-components-chip__remove:disabled,button.wc-block-components-chip:disabled>.wc-block-components-chip__remove{fill:#949494;cursor:not-allowed}.wc-block-components-combobox .wc-block-components-combobox-control,.wc-block-components-form .wc-block-components-combobox .wc-block-components-combobox-control{color:inherit;font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;letter-spacing:inherit;line-height:inherit;text-decoration:inherit;text-transform:inherit;border:0;border-radius:0;margin:0;padding:0;vertical-align:baseline}.wc-block-components-combobox .wc-block-components-combobox-control .components-base-control__field,.wc-block-components-form .wc-block-components-combobox .wc-block-components-combobox-control .components-base-control__field{border:0;border-radius:0;margin:0;padding:0;vertical-align:baseline}.wc-block-components-combobox .wc-block-components-combobox-control .components-combobox-control__suggestions-container,.wc-block-components-form .wc-block-components-combobox .wc-block-components-combobox-control .components-combobox-control__suggestions-container{color:inherit;font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;letter-spacing:inherit;line-height:inherit;text-decoration:inherit;text-transform:inherit;border:0;border-radius:0;margin:0;padding:0;vertical-align:baseline;position:relative}.wc-block-components-combobox .wc-block-components-combobox-control input.components-combobox-control__input,.wc-block-components-form .wc-block-components-combobox .wc-block-components-combobox-control input.components-combobox-control__input{color:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;line-height:inherit;text-decoration:inherit;text-transform:inherit;font-size:1em;box-sizing:border-box;outline:inherit;border:1px solid #50575e;background:#fff;box-shadow:none;color:#2b2d2f;font-family:inherit;font-weight:400;height:3em;letter-spacing:inherit;line-height:1;padding:1.5em 16px .25em;text-align:right;text-overflow:ellipsis;text-transform:none;white-space:nowrap;width:100%;opacity:1;border-radius:4px}.wc-block-components-combobox .wc-block-components-combobox-control input.components-combobox-control__input:focus,.wc-block-components-combobox .wc-block-components-combobox-control input.components-combobox-control__input[aria-expanded=true],.wc-block-components-form .wc-block-components-combobox .wc-block-components-combobox-control input.components-combobox-control__input:focus,.wc-block-components-form .wc-block-components-combobox .wc-block-components-combobox-control input.components-combobox-control__input[aria-expanded=true]{background-color:#fff;color:#2b2d2f;outline:0;box-shadow:0 0 0 1px #50575e}.wc-block-components-combobox .wc-block-components-combobox-control input.components-combobox-control__input[aria-expanded=true],.wc-block-components-form .wc-block-components-combobox .wc-block-components-combobox-control input.components-combobox-control__input[aria-expanded=true]{border-bottom-left-radius:0;border-bottom-right-radius:0}.has-dark-controls .wc-block-components-combobox .wc-block-components-combobox-control input.components-combobox-control__input,.has-dark-controls .wc-block-components-form .wc-block-components-combobox .wc-block-components-combobox-control input.components-combobox-control__input{background-color:rgba(0,0,0,.1);border-color:hsla(0,0%,100%,.4);color:#fff}.has-dark-controls .wc-block-components-combobox .wc-block-components-combobox-control input.components-combobox-control__input:focus,.has-dark-controls .wc-block-components-form .wc-block-components-combobox .wc-block-components-combobox-control input.components-combobox-control__input:focus{background-color:rgba(0,0,0,.1);color:#fff;box-shadow:0 0 0 1px hsla(0,0%,100%,.4)}.wc-block-components-combobox .wc-block-components-combobox-control .components-form-token-field__suggestions-list,.wc-block-components-form .wc-block-components-combobox .wc-block-components-combobox-control .components-form-token-field__suggestions-list{position:absolute;z-index:10;background-color:#fff;border:1px solid #50575e;border-top:0;margin:3em 0 0;padding:0;max-height:300px;min-width:100%;overflow:auto;color:#2b2d2f}.has-dark-controls .wc-block-components-combobox .wc-block-components-combobox-control .components-form-token-field__suggestions-list,.has-dark-controls .wc-block-components-form .wc-block-components-combobox .wc-block-components-combobox-control .components-form-token-field__suggestions-list{background-color:#1e1e1e;color:#fff}.wc-block-components-combobox .wc-block-components-combobox-control .components-form-token-field__suggestions-list .components-form-token-field__suggestion,.wc-block-components-form .wc-block-components-combobox .wc-block-components-combobox-control .components-form-token-field__suggestions-list .components-form-token-field__suggestion{font-size:1em;color:#757575;cursor:default;list-style:none;margin:0;padding:.25em 16px}.wc-block-components-combobox .wc-block-components-combobox-control .components-form-token-field__suggestions-list .components-form-token-field__suggestion.is-selected,.wc-block-components-form .wc-block-components-combobox .wc-block-components-combobox-control .components-form-token-field__suggestions-list .components-form-token-field__suggestion.is-selected{background-color:#ddd}.has-dark-controls .wc-block-components-combobox .wc-block-components-combobox-control .components-form-token-field__suggestions-list .components-form-token-field__suggestion.is-selected,.has-dark-controls .wc-block-components-form .wc-block-components-combobox .wc-block-components-combobox-control .components-form-token-field__suggestions-list .components-form-token-field__suggestion.is-selected{background-color:rgba(0,0,0,.4)}.wc-block-components-combobox .wc-block-components-combobox-control .components-form-token-field__suggestions-list .components-form-token-field__suggestion.is-highlighted,.wc-block-components-combobox .wc-block-components-combobox-control .components-form-token-field__suggestions-list .components-form-token-field__suggestion:active,.wc-block-components-combobox .wc-block-components-combobox-control .components-form-token-field__suggestions-list .components-form-token-field__suggestion:focus,.wc-block-components-combobox .wc-block-components-combobox-control .components-form-token-field__suggestions-list .components-form-token-field__suggestion:hover,.wc-block-components-form .wc-block-components-combobox .wc-block-components-combobox-control .components-form-token-field__suggestions-list .components-form-token-field__suggestion.is-highlighted,.wc-block-components-form .wc-block-components-combobox .wc-block-components-combobox-control .components-form-token-field__suggestions-list .components-form-token-field__suggestion:active,.wc-block-components-form .wc-block-components-combobox .wc-block-components-combobox-control .components-form-token-field__suggestions-list .components-form-token-field__suggestion:focus,.wc-block-components-form .wc-block-components-combobox .wc-block-components-combobox-control .components-form-token-field__suggestions-list .components-form-token-field__suggestion:hover{background-color:#00669e;color:#fff}.wc-block-components-combobox .wc-block-components-combobox-control label.components-base-control__label,.wc-block-components-form .wc-block-components-combobox .wc-block-components-combobox-control label.components-base-control__label{color:inherit;font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;letter-spacing:inherit;line-height:inherit;text-decoration:inherit;text-transform:inherit;font-size:1em;line-height:1.375;position:absolute;transform:translateY(.75em);transform-origin:top right;transition:all .2s ease;color:#757575;z-index:1;margin:0 17px 0 0;overflow:hidden;text-overflow:ellipsis;max-width:calc(100% - 32px);white-space:nowrap}.has-dark-controls .wc-block-components-combobox .wc-block-components-combobox-control label.components-base-control__label,.has-dark-controls .wc-block-components-form .wc-block-components-combobox .wc-block-components-combobox-control label.components-base-control__label{color:hsla(0,0%,100%,.6)}@media screen and (prefers-reduced-motion:reduce){.wc-block-components-combobox .wc-block-components-combobox-control label.components-base-control__label,.wc-block-components-form .wc-block-components-combobox .wc-block-components-combobox-control label.components-base-control__label{transition:none}}.wc-block-components-combobox.is-active .wc-block-components-combobox-control label.components-base-control__label,.wc-block-components-combobox:focus-within .wc-block-components-combobox-control label.components-base-control__label,.wc-block-components-form .wc-block-components-combobox.is-active .wc-block-components-combobox-control label.components-base-control__label,.wc-block-components-form .wc-block-components-combobox:focus-within .wc-block-components-combobox-control label.components-base-control__label{transform:translateY(4px) scale(.75)}.wc-block-components-combobox.has-error .wc-block-components-combobox-control label.components-base-control__label,.wc-block-components-form .wc-block-components-combobox.has-error .wc-block-components-combobox-control label.components-base-control__label{color:#cc1818}.wc-block-components-combobox.has-error .wc-block-components-combobox-control input.components-combobox-control__input,.wc-block-components-combobox.has-error .wc-block-components-combobox-control input.components-combobox-control__input:active,.wc-block-components-combobox.has-error .wc-block-components-combobox-control input.components-combobox-control__input:focus,.wc-block-components-combobox.has-error .wc-block-components-combobox-control input.components-combobox-control__input:hover,.wc-block-components-form .wc-block-components-combobox.has-error .wc-block-components-combobox-control input.components-combobox-control__input,.wc-block-components-form .wc-block-components-combobox.has-error .wc-block-components-combobox-control input.components-combobox-control__input:active,.wc-block-components-form .wc-block-components-combobox.has-error .wc-block-components-combobox-control input.components-combobox-control__input:focus,.wc-block-components-form .wc-block-components-combobox.has-error .wc-block-components-combobox-control input.components-combobox-control__input:hover{border-color:#cc1818}.wc-block-components-combobox.has-error .wc-block-components-combobox-control input.components-combobox-control__input:focus,.wc-block-components-form .wc-block-components-combobox.has-error .wc-block-components-combobox-control input.components-combobox-control__input:focus{box-shadow:0 0 0 1px #cc1818}.wc-block-components-country-input{margin-top:1.5em}@-webkit-keyframes fadein{0%{opacity:0}to{opacity:1}}@keyframes fadein{0%{opacity:0}to{opacity:1}}@-webkit-keyframes slidein{0%{transform:translateX(0)}to{transform:translateX(480px)}}@keyframes slidein{0%{transform:translateX(0)}to{transform:translateX(480px)}}@media only screen and (max-width:480px){@-webkit-keyframes slidein{0%{transform:translateX(0)}to{transform:translateX(100vw)}}@keyframes slidein{0%{transform:translateX(0)}to{transform:translateX(100vw)}}}.wc-block-components-drawer__screen-overlay{background-color:rgba(95,95,95,.35);bottom:0;right:0;position:fixed;left:0;top:0;transition:opacity .3s;z-index:999;opacity:1}.wc-block-components-drawer__screen-overlay--with-slide-out{transition:opacity .3s}.wc-block-components-drawer__screen-overlay--with-slide-in{-webkit-animation-duration:.3s;animation-duration:.3s;-webkit-animation-name:fadein;animation-name:fadein}.wc-block-components-drawer__screen-overlay--is-hidden{pointer-events:none;opacity:0}.wc-block-components-drawer{position:relative;background:#fff;display:block;height:100%;right:100%;overflow:auto;position:fixed;left:0;top:0;transform:translateX(480px);width:480px}.wc-block-components-drawer:after{border-style:solid;border-width:0 1px 0 0;bottom:0;content:"";display:block;right:0;opacity:.3;pointer-events:none;position:absolute;left:0;top:0}@media only screen and (max-width:480px){.wc-block-components-drawer{transform:translateX(100vw);width:100vw}}.wc-block-components-drawer__screen-overlay--with-slide-out .wc-block-components-drawer{transition:transform .3s}.wc-block-components-drawer__screen-overlay--with-slide-in .wc-block-components-drawer{-webkit-animation-duration:.3s;animation-duration:.3s;-webkit-animation-name:slidein;animation-name:slidein}.wc-block-components-drawer__screen-overlay--is-hidden .wc-block-components-drawer{transform:translateX(0)}@media screen and (prefers-reduced-motion:reduce){.wc-block-components-drawer,.wc-block-components-drawer__screen-overlay{-webkit-animation-name:none!important;animation-name:none!important;transition:none!important}}.wc-block-components-drawer .components-modal__content{padding:40px 16px}.wc-block-components-drawer .components-modal__header{position:relative}.wc-block-components-drawer .components-modal__header .components-button{border:0;border-radius:0;vertical-align:baseline;background:transparent;position:absolute;left:0;top:0;padding:1em;margin:-1em}.wc-block-components-drawer .components-modal__header .components-button>span{border:0;clip:rect(1px,1px,1px,1px);-webkit-clip-path:inset(50%);clip-path:inset(50%);height:1px;margin:-1px;overflow:hidden;overflow-wrap:normal!important;word-wrap:normal!important;padding:0;position:absolute!important;width:1px}.wc-block-components-drawer .components-modal__header-heading{border:0;border-radius:0;margin:0;padding:0;vertical-align:baseline;font-size:1.25rem;word-break:break-word}.wc-block-components-dropdown-selector{max-width:300px;position:relative;width:100%}.wc-block-components-dropdown-selector__input-wrapper{background:#fff;border:1px solid #50575e;color:#2b2d2f;align-items:center;border-radius:4px;cursor:text;display:flex;flex-wrap:wrap;padding:2px 8px}.is-disabled .wc-block-components-dropdown-selector__input-wrapper{background-color:#e0e0e0}.is-multiple.has-checked>.wc-block-components-dropdown-selector__input-wrapper{padding:2px 4px}.is-open>.wc-block-components-dropdown-selector__input-wrapper{border-radius:4px 4px 0 0}.wc-block-components-dropdown-selector__input{font-size:.875em;line-height:1.2857142857;margin:.1875em 0;min-width:0;padding:.1875em 0}.is-single .wc-block-components-dropdown-selector__input{width:100%}.is-single .wc-block-components-dropdown-selector__input:active,.is-single .wc-block-components-dropdown-selector__input:focus,.is-single .wc-block-components-dropdown-selector__input:hover{outline:0}.is-single.has-checked.is-open .wc-block-components-dropdown-selector__input{margin-bottom:1.5px;margin-top:1.5px}.is-single.has-checked:not(.is-open) .wc-block-components-dropdown-selector__input{border:0;clip:rect(1px,1px,1px,1px);-webkit-clip-path:inset(50%);clip-path:inset(50%);height:1px;margin:-1px;overflow:hidden;overflow-wrap:normal!important;word-wrap:normal!important;padding:0;position:absolute!important;width:1px;position:absolute}.is-multiple .wc-block-components-dropdown-selector__input{flex:1;min-width:0}.is-multiple .wc-block-components-dropdown-selector__input,.is-single .wc-block-components-dropdown-selector__input:first-child{background:transparent;border:0}.is-multiple .wc-block-components-dropdown-selector__input:active,.is-multiple .wc-block-components-dropdown-selector__input:focus,.is-multiple .wc-block-components-dropdown-selector__input:hover,.is-single .wc-block-components-dropdown-selector__input:first-child:active,.is-single .wc-block-components-dropdown-selector__input:first-child:focus,.is-single .wc-block-components-dropdown-selector__input:first-child:hover{outline:0}.wc-block-components-dropdown-selector .wc-block-components-dropdown-selector__selected-value__label,.wc-block-components-dropdown-selector .wc-block-components-dropdown-selector__selected-value__remove{background-color:transparent;border:0;color:inherit;font-size:inherit;font-weight:inherit;text-transform:none}.wc-block-components-dropdown-selector .wc-block-components-dropdown-selector__selected-value__label:active,.wc-block-components-dropdown-selector .wc-block-components-dropdown-selector__selected-value__label:focus,.wc-block-components-dropdown-selector .wc-block-components-dropdown-selector__selected-value__label:hover,.wc-block-components-dropdown-selector .wc-block-components-dropdown-selector__selected-value__remove:active,.wc-block-components-dropdown-selector .wc-block-components-dropdown-selector__selected-value__remove:focus,.wc-block-components-dropdown-selector .wc-block-components-dropdown-selector__selected-value__remove:hover{background-color:transparent;text-decoration:none}.wc-block-components-dropdown-selector .wc-block-components-dropdown-selector__selected-value{font-size:.875em;align-items:center;color:#757575;display:inline-flex;margin:.1875em 0;padding:.1875em 0;width:100%}.wc-block-components-dropdown-selector .wc-block-components-dropdown-selector__selected-value__label{flex-grow:1;line-height:1.2857142857;padding:0;text-align:right}.wc-block-components-dropdown-selector .wc-block-components-dropdown-selector__selected-value__remove{background-color:transparent;border:0;display:inline-block;line-height:1;padding:0 .3em 0 0}.wc-block-components-dropdown-selector .wc-block-components-dropdown-selector__selected-value__remove>svg{display:block}.wc-block-components-dropdown-selector .wc-block-components-dropdown-selector__selected-chip{font-size:.875em;margin-top:.1875em;margin-bottom:.1875em;line-height:1.2857142857}.wc-block-components-dropdown-selector__list{background-color:#fff;margin:-1px 0 0;padding:0;position:absolute;right:0;left:0;top:100%;max-height:300px;overflow-y:auto;z-index:1}.wc-block-components-dropdown-selector__list:not(:empty){border:1px solid #9f9f9f}.wc-block-components-dropdown-selector__list-item{font-size:.875em;color:#757575;cursor:default;list-style:none;margin:0;padding:0 4px}.wc-block-components-dropdown-selector__list-item.is-selected{background-color:#ddd}.wc-block-components-dropdown-selector__list-item.is-highlighted,.wc-block-components-dropdown-selector__list-item:active,.wc-block-components-dropdown-selector__list-item:focus,.wc-block-components-dropdown-selector__list-item:hover{background-color:#00669e;color:#fff}.wc-filter-element-label-list-count{opacity:.6}.wc-filter-element-label-list-count:before{content:" ("}.wc-filter-element-label-list-count:after{content:")"}.wc-block-components-filter-submit-button{display:block;margin-right:auto;white-space:nowrap}.wc-block-components-formatted-money-amount{white-space:nowrap}.wc-block-components-load-more{text-align:center;width:100%}.wc-block-components-loading-mask{position:relative;min-height:34px;pointer-events:none}.wc-block-components-loading-mask .components-spinner{position:absolute;margin:0;top:50%;right:50%;transform:translate(50%,-50%)}.wc-block-components-loading-mask .wc-block-components-loading-mask__children{opacity:.25}.wc-block-components-pagination{margin:0 auto 16px}.wc-block-components-pagination__ellipsis,.wc-block-components-pagination__page{font-size:1em;color:#333;display:inline-block;font-weight:400}.wc-block-components-pagination__page{border-color:transparent;padding:.3em .6em;min-width:2.2em}@media(max-width:782px){.wc-block-components-pagination__page{padding:.1em .2em;min-width:1.6em}}.wc-block-components-pagination__page:not(.toggle){background-color:transparent}.wc-block-components-pagination__ellipsis{padding:.3em}@media(max-width:782px){.wc-block-components-pagination__ellipsis{padding:.1em}}.wc-block-components-pagination__page--active[disabled]{color:#333;font-weight:700;opacity:1!important}.wc-block-components-pagination__page--active[disabled]:focus,.wc-block-components-pagination__page--active[disabled]:hover{background-color:inherit;color:#333;opacity:1!important}html[dir=rtl] .wc-block-components-pagination-page--arrow span{display:inline-block;transform:scaleX(-1)}.wc-block-components-price-slider{margin-bottom:24px}.wc-block-components-price-slider.wc-block-components-price-slider--has-filter-button .wc-block-components-price-slider__controls{justify-content:flex-end}.wc-block-components-price-slider.wc-block-components-price-slider--has-filter-button .wc-block-components-price-slider__controls .wc-block-components-price-slider__amount.wc-block-components-price-slider__amount--max{margin-right:0;margin-left:10px}.wc-block-components-price-slider.is-disabled .wc-block-components-price-slider__amount,.wc-block-components-price-slider.is-disabled .wc-block-components-price-slider__button,.wc-block-components-price-slider.is-disabled .wc-block-components-price-slider__range-input-wrapper,.wc-block-components-price-slider.is-loading .wc-block-components-price-slider__amount,.wc-block-components-price-slider.is-loading .wc-block-components-price-slider__button,.wc-block-components-price-slider.is-loading .wc-block-components-price-slider__range-input-wrapper{-webkit-animation:loading-fade 1.2s ease-in-out infinite;animation:loading-fade 1.2s ease-in-out infinite;background-color:var(--global--color-primary,#e0e0e0)!important;color:var(--global--color-primary,#e0e0e0)!important;outline:0!important;border:0!important;pointer-events:none;max-width:100%;box-shadow:none}.wc-block-components-price-slider.is-disabled .wc-block-components-price-slider__amount>*,.wc-block-components-price-slider.is-disabled .wc-block-components-price-slider__button>*,.wc-block-components-price-slider.is-disabled .wc-block-components-price-slider__range-input-wrapper>*,.wc-block-components-price-slider.is-loading .wc-block-components-price-slider__amount>*,.wc-block-components-price-slider.is-loading .wc-block-components-price-slider__button>*,.wc-block-components-price-slider.is-loading .wc-block-components-price-slider__range-input-wrapper>*{visibility:hidden}@media screen and (prefers-reduced-motion:reduce){.wc-block-components-price-slider.is-disabled .wc-block-components-price-slider__amount,.wc-block-components-price-slider.is-disabled .wc-block-components-price-slider__button,.wc-block-components-price-slider.is-disabled .wc-block-components-price-slider__range-input-wrapper,.wc-block-components-price-slider.is-loading .wc-block-components-price-slider__amount,.wc-block-components-price-slider.is-loading .wc-block-components-price-slider__button,.wc-block-components-price-slider.is-loading .wc-block-components-price-slider__range-input-wrapper{-webkit-animation:none;animation:none}}.wc-block-components-price-slider.is-disabled:not(.is-loading) .wc-block-components-price-slider__amount,.wc-block-components-price-slider.is-disabled:not(.is-loading) .wc-block-components-price-slider__button,.wc-block-components-price-slider.is-disabled:not(.is-loading) .wc-block-components-price-slider__range-input-wrapper{-webkit-animation:none;animation:none}.wc-block-components-price-slider__range-input-wrapper{padding:0;border:0;outline:none;background:transparent;-webkit-appearance:none;-moz-appearance:none;appearance:none;height:9px;clear:both;position:relative;box-shadow:inset 0 0 0 1px rgba(0,0,0,.1);background:#e1e1e1;margin:15px 0}.wc-block-components-price-slider__range-input-progress{height:9px;width:100%;position:absolute;right:0;top:0;--track-background:linear-gradient(90deg,transparent var(--low),var(--range-color) 0,var(--range-color) var(--high),transparent 0) no-repeat 0 100%/100% 100%;--range-color:#af7dd1;background:var(--track-background)}.wc-block-components-price-slider__controls{display:flex}.wc-block-components-price-slider__controls .wc-block-components-price-slider__amount{margin:0;border-radius:4px;width:auto;max-width:100px;min-width:0}.wc-block-components-price-slider__controls .wc-block-components-price-slider__amount.wc-block-components-price-slider__amount--min{margin-left:10px}.wc-block-components-price-slider__controls .wc-block-components-price-slider__amount.wc-block-components-price-slider__amount--max{margin-right:auto}.wc-block-components-price-slider__range-input{margin:0;padding:0;border:0;outline:none;background:transparent;-webkit-appearance:none;-moz-appearance:none;appearance:none;width:100%;height:0;display:block;position:relative;pointer-events:none;outline:none!important;position:absolute;right:0;top:0}.wc-block-components-price-slider__range-input::-webkit-slider-runnable-track{cursor:default;height:1px;outline:0;-webkit-appearance:none;-moz-appearance:none;appearance:none}.wc-block-components-price-slider__range-input::-webkit-slider-thumb{background-color:transparent;background-position:100% 0;width:28px;height:23px;border:0;padding:0;vertical-align:top;cursor:pointer;z-index:20;pointer-events:auto;background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='56' height='46' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cg clip-path='url(%23clip0)'%3E%3Cpath d='M25.318 9.942L16.9 3.8c-1.706-1.228-3.64-1.899-5.686-1.787H11.1c-4.89.335-8.985 4.356-9.099 9.27C1.888 16.645 6.21 21 11.67 21h.113c1.82 0 3.64-.67 5.118-1.787l8.417-6.255c.91-.893.91-2.234 0-3.016v0z' fill='%23fff' stroke='%23757575'/%3E%3Cpath d='M13 7v9m-3-9v9-9z' stroke='%23B8B8B8'/%3E%3Cpath d='M25.318 9.942L16.9 3.8c-1.706-1.228-3.64-1.899-5.686-1.787H11.1c-4.89.335-8.985 4.356-9.099 9.27C1.888 16.645 6.21 21 11.67 21h.113c1.82 0 3.64-.67 5.118-1.787l8.417-6.255c.91-.893.91-2.234 0-3.016v0z' fill='%23fff' stroke='%23757575'/%3E%3Cpath d='M13 7v9m-3-9v9-9z' stroke='%23B8B8B8'/%3E%3Cpath d='M25.318 32.942L16.9 26.8c-1.706-1.228-3.64-1.899-5.686-1.787H11.1c-4.89.335-8.985 4.356-9.099 9.27C1.888 39.645 6.21 44 11.67 44h.113c1.82 0 3.64-.67 5.118-1.787l8.417-6.255c.91-.893.91-2.234 0-3.016v0z' fill='%23F8F3F7' stroke='%23fff' stroke-opacity='.75' stroke-width='3'/%3E%3Cpath d='M25.318 32.942L16.9 26.8c-1.706-1.228-3.64-1.899-5.686-1.787H11.1c-4.89.335-8.985 4.356-9.099 9.27C1.888 39.645 6.21 44 11.67 44h.113c1.82 0 3.64-.67 5.118-1.787l8.417-6.255c.91-.893.91-2.234 0-3.016v0zM13 30v9m-3-9v9-9z' stroke='%23757575'/%3E%3Cpath d='M30.682 9.942L39.1 3.8c1.706-1.228 3.64-1.899 5.686-1.787h.114c4.89.335 8.985 4.356 9.099 9.27C54.112 16.645 49.79 21 44.33 21h-.113c-1.82 0-3.64-.67-5.118-1.787l-8.417-6.255c-.91-.893-.91-2.234 0-3.016v0z' fill='%23fff' stroke='%23757575'/%3E%3Cpath d='M43 7v9m3-9v9-9z' stroke='%23B8B8B8'/%3E%3Cpath d='M30.682 32.942L39.1 26.8c1.706-1.228 3.64-1.899 5.686-1.787h.114c4.89.335 8.985 4.356 9.099 9.27C54.112 39.645 49.79 44 44.33 44h-.113c-1.82 0-3.64-.67-5.118-1.787l-8.417-6.255c-.91-.893-.91-2.234 0-3.016v0z' fill='%23F8F3F7' stroke='%23fff' stroke-opacity='.75' stroke-width='3'/%3E%3Cpath d='M30.682 32.942L39.1 26.8c1.706-1.228 3.64-1.899 5.686-1.787h.114c4.89.335 8.985 4.356 9.099 9.27C54.112 39.645 49.79 44 44.33 44h-.113c-1.82 0-3.64-.67-5.118-1.787l-8.417-6.255c-.91-.893-.91-2.234 0-3.016v0zM43 30v9m3-9v9-9z' stroke='%23757575'/%3E%3C/g%3E%3Cdefs%3E%3CclipPath id='clip0'%3E%3Cpath fill='%23fff' d='M0 0h56v46H0z'/%3E%3C/clipPath%3E%3C/defs%3E%3C/svg%3E");-webkit-transition:transform .2s ease-in-out;transition:transform .2s ease-in-out;-webkit-appearance:none;-moz-appearance:none;appearance:none;margin:-6px 0 0}.wc-block-components-price-slider__range-input::-webkit-slider-thumb:hover{background-position-y:-23px;transform:scale(1.1)}.wc-block-components-price-slider__range-input::-webkit-slider-progress{margin:0;padding:0;border:0;outline:none;background:transparent;-webkit-appearance:none;-moz-appearance:none;appearance:none}.wc-block-components-price-slider__range-input::-moz-focus-outer{border:0}.wc-block-components-price-slider__range-input::-moz-range-track{cursor:default;height:1px;outline:0;-webkit-appearance:none;-moz-appearance:none;appearance:none}.wc-block-components-price-slider__range-input::-moz-range-progress{margin:0;padding:0;border:0;outline:none;background:transparent;-webkit-appearance:none;-moz-appearance:none;appearance:none}.wc-block-components-price-slider__range-input::-moz-range-thumb{background-color:transparent;background-position:100% 0;width:28px;height:23px;border:0;padding:0;margin:0;vertical-align:top;cursor:pointer;z-index:20;pointer-events:auto;background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='56' height='46' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cg clip-path='url(%23clip0)'%3E%3Cpath d='M25.318 9.942L16.9 3.8c-1.706-1.228-3.64-1.899-5.686-1.787H11.1c-4.89.335-8.985 4.356-9.099 9.27C1.888 16.645 6.21 21 11.67 21h.113c1.82 0 3.64-.67 5.118-1.787l8.417-6.255c.91-.893.91-2.234 0-3.016v0z' fill='%23fff' stroke='%23757575'/%3E%3Cpath d='M13 7v9m-3-9v9-9z' stroke='%23B8B8B8'/%3E%3Cpath d='M25.318 9.942L16.9 3.8c-1.706-1.228-3.64-1.899-5.686-1.787H11.1c-4.89.335-8.985 4.356-9.099 9.27C1.888 16.645 6.21 21 11.67 21h.113c1.82 0 3.64-.67 5.118-1.787l8.417-6.255c.91-.893.91-2.234 0-3.016v0z' fill='%23fff' stroke='%23757575'/%3E%3Cpath d='M13 7v9m-3-9v9-9z' stroke='%23B8B8B8'/%3E%3Cpath d='M25.318 32.942L16.9 26.8c-1.706-1.228-3.64-1.899-5.686-1.787H11.1c-4.89.335-8.985 4.356-9.099 9.27C1.888 39.645 6.21 44 11.67 44h.113c1.82 0 3.64-.67 5.118-1.787l8.417-6.255c.91-.893.91-2.234 0-3.016v0z' fill='%23F8F3F7' stroke='%23fff' stroke-opacity='.75' stroke-width='3'/%3E%3Cpath d='M25.318 32.942L16.9 26.8c-1.706-1.228-3.64-1.899-5.686-1.787H11.1c-4.89.335-8.985 4.356-9.099 9.27C1.888 39.645 6.21 44 11.67 44h.113c1.82 0 3.64-.67 5.118-1.787l8.417-6.255c.91-.893.91-2.234 0-3.016v0zM13 30v9m-3-9v9-9z' stroke='%23757575'/%3E%3Cpath d='M30.682 9.942L39.1 3.8c1.706-1.228 3.64-1.899 5.686-1.787h.114c4.89.335 8.985 4.356 9.099 9.27C54.112 16.645 49.79 21 44.33 21h-.113c-1.82 0-3.64-.67-5.118-1.787l-8.417-6.255c-.91-.893-.91-2.234 0-3.016v0z' fill='%23fff' stroke='%23757575'/%3E%3Cpath d='M43 7v9m3-9v9-9z' stroke='%23B8B8B8'/%3E%3Cpath d='M30.682 32.942L39.1 26.8c1.706-1.228 3.64-1.899 5.686-1.787h.114c4.89.335 8.985 4.356 9.099 9.27C54.112 39.645 49.79 44 44.33 44h-.113c-1.82 0-3.64-.67-5.118-1.787l-8.417-6.255c-.91-.893-.91-2.234 0-3.016v0z' fill='%23F8F3F7' stroke='%23fff' stroke-opacity='.75' stroke-width='3'/%3E%3Cpath d='M30.682 32.942L39.1 26.8c1.706-1.228 3.64-1.899 5.686-1.787h.114c4.89.335 8.985 4.356 9.099 9.27C54.112 39.645 49.79 44 44.33 44h-.113c-1.82 0-3.64-.67-5.118-1.787l-8.417-6.255c-.91-.893-.91-2.234 0-3.016v0zM43 30v9m3-9v9-9z' stroke='%23757575'/%3E%3C/g%3E%3Cdefs%3E%3CclipPath id='clip0'%3E%3Cpath fill='%23fff' d='M0 0h56v46H0z'/%3E%3C/clipPath%3E%3C/defs%3E%3C/svg%3E");-moz-transition:transform .2s ease-in-out;transition:transform .2s ease-in-out;-webkit-appearance:none;-moz-appearance:none;appearance:none}.wc-block-components-price-slider__range-input::-moz-range-thumb:hover{background-position-y:-23px;transform:scale(1.1)}.wc-block-components-price-slider__range-input::-ms-thumb{background-color:transparent;background-position:100% 0;width:28px;height:23px;border:0;padding:0;margin:0;vertical-align:top;cursor:pointer;z-index:20;pointer-events:auto;background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='56' height='46' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cg clip-path='url(%23clip0)'%3E%3Cpath d='M25.318 9.942L16.9 3.8c-1.706-1.228-3.64-1.899-5.686-1.787H11.1c-4.89.335-8.985 4.356-9.099 9.27C1.888 16.645 6.21 21 11.67 21h.113c1.82 0 3.64-.67 5.118-1.787l8.417-6.255c.91-.893.91-2.234 0-3.016v0z' fill='%23fff' stroke='%23757575'/%3E%3Cpath d='M13 7v9m-3-9v9-9z' stroke='%23B8B8B8'/%3E%3Cpath d='M25.318 9.942L16.9 3.8c-1.706-1.228-3.64-1.899-5.686-1.787H11.1c-4.89.335-8.985 4.356-9.099 9.27C1.888 16.645 6.21 21 11.67 21h.113c1.82 0 3.64-.67 5.118-1.787l8.417-6.255c.91-.893.91-2.234 0-3.016v0z' fill='%23fff' stroke='%23757575'/%3E%3Cpath d='M13 7v9m-3-9v9-9z' stroke='%23B8B8B8'/%3E%3Cpath d='M25.318 32.942L16.9 26.8c-1.706-1.228-3.64-1.899-5.686-1.787H11.1c-4.89.335-8.985 4.356-9.099 9.27C1.888 39.645 6.21 44 11.67 44h.113c1.82 0 3.64-.67 5.118-1.787l8.417-6.255c.91-.893.91-2.234 0-3.016v0z' fill='%23F8F3F7' stroke='%23fff' stroke-opacity='.75' stroke-width='3'/%3E%3Cpath d='M25.318 32.942L16.9 26.8c-1.706-1.228-3.64-1.899-5.686-1.787H11.1c-4.89.335-8.985 4.356-9.099 9.27C1.888 39.645 6.21 44 11.67 44h.113c1.82 0 3.64-.67 5.118-1.787l8.417-6.255c.91-.893.91-2.234 0-3.016v0zM13 30v9m-3-9v9-9z' stroke='%23757575'/%3E%3Cpath d='M30.682 9.942L39.1 3.8c1.706-1.228 3.64-1.899 5.686-1.787h.114c4.89.335 8.985 4.356 9.099 9.27C54.112 16.645 49.79 21 44.33 21h-.113c-1.82 0-3.64-.67-5.118-1.787l-8.417-6.255c-.91-.893-.91-2.234 0-3.016v0z' fill='%23fff' stroke='%23757575'/%3E%3Cpath d='M43 7v9m3-9v9-9z' stroke='%23B8B8B8'/%3E%3Cpath d='M30.682 32.942L39.1 26.8c1.706-1.228 3.64-1.899 5.686-1.787h.114c4.89.335 8.985 4.356 9.099 9.27C54.112 39.645 49.79 44 44.33 44h-.113c-1.82 0-3.64-.67-5.118-1.787l-8.417-6.255c-.91-.893-.91-2.234 0-3.016v0z' fill='%23F8F3F7' stroke='%23fff' stroke-opacity='.75' stroke-width='3'/%3E%3Cpath d='M30.682 32.942L39.1 26.8c1.706-1.228 3.64-1.899 5.686-1.787h.114c4.89.335 8.985 4.356 9.099 9.27C54.112 39.645 49.79 44 44.33 44h-.113c-1.82 0-3.64-.67-5.118-1.787l-8.417-6.255c-.91-.893-.91-2.234 0-3.016v0zM43 30v9m3-9v9-9z' stroke='%23757575'/%3E%3C/g%3E%3Cdefs%3E%3CclipPath id='clip0'%3E%3Cpath fill='%23fff' d='M0 0h56v46H0z'/%3E%3C/clipPath%3E%3C/defs%3E%3C/svg%3E");-ms-transition:transform .2s ease-in-out;transition:transform .2s ease-in-out;-webkit-appearance:none;-moz-appearance:none;appearance:none}.wc-block-components-price-slider__range-input::-ms-thumb:hover{background-position-y:-23px;transform:scale(1.1)}.wc-block-components-price-slider__range-input:focus::-webkit-slider-thumb{background-position-y:-23px;transform:scale(1.1)}.wc-block-components-price-slider__range-input:focus::-moz-range-thumb{background-position-y:-23px;transform:scale(1.1)}.wc-block-components-price-slider__range-input:focus::-ms-thumb{background-position-y:-23px;transform:scale(1.1)}.wc-block-components-price-slider__range-input.wc-block-components-price-slider__range-input--min{z-index:21}.wc-block-components-price-slider__range-input.wc-block-components-price-slider__range-input--min::-webkit-slider-thumb{margin-right:-2px;background-position-x:right}.wc-block-components-price-slider__range-input.wc-block-components-price-slider__range-input--min::-moz-range-thumb{background-position-x:right;transform:translate(2px,4px)}.wc-block-components-price-slider__range-input.wc-block-components-price-slider__range-input--min::-ms-thumb{background-position-x:right}.wc-block-components-price-slider__range-input.wc-block-components-price-slider__range-input--max{z-index:20}.wc-block-components-price-slider__range-input.wc-block-components-price-slider__range-input--max::-webkit-slider-thumb{background-position-x:left;margin-right:2px}.wc-block-components-price-slider__range-input.wc-block-components-price-slider__range-input--max::-moz-range-thumb{background-position-x:left;transform:translate(-2px,4px)}.wc-block-components-price-slider__range-input.wc-block-components-price-slider__range-input--max::-ms-thumb{background-position-x:left}.rtl .wc-block-components-price-slider__range-input-progress{--track-background:linear-gradient(270deg,transparent var(--low),var(--range-color) 0,var(--range-color) var(--high),transparent 0) no-repeat 0 100%/100% 100%;--range-color:#af7dd1;background:var(--track-background)}@media (-ms-high-contrast:none),screen and (-ms-high-contrast:active){.wc-block-components-price-slider__range-input-wrapper{background:transparent;box-shadow:none;height:24px}.wc-block-components-price-slider__range-input-progress{background:#af7dd1;width:100%;top:7px}.wc-block-components-price-slider__range-input{height:24px;pointer-events:auto}.wc-block-components-price-slider__range-input::-ms-track{background:transparent;border-color:transparent;border-width:7px 0;color:transparent}.wc-block-components-price-slider__range-input::-ms-fill-lower{background:#e1e1e1;box-shadow:inset 0 0 0 1px #b8b8b8}.wc-block-components-price-slider__range-input::-ms-fill-upper{background:transparent}.wc-block-components-price-slider__range-input::-ms-tooltip{display:none}.wc-block-components-price-slider__range-input::-ms-thumb{transform:translate(-1px);pointer-events:auto}.wc-block-components-price-slider__range-input--max::-ms-fill-upper{background:#e1e1e1;box-shadow:inset 0 0 0 1px #b8b8b8}.wc-block-components-price-slider__range-input--max::-ms-fill-lower{background:transparent}.wc-block-components-price-slider.is-disabled .wc-block-components-price-slider__range-input-wrapper,.wc-block-components-price-slider.is-loading .wc-block-components-price-slider__range-input-wrapper{-webkit-animation:loading-fade 1.2s ease-in-out infinite;animation:loading-fade 1.2s ease-in-out infinite;background-color:var(--global--color-primary,#e0e0e0)!important;color:var(--global--color-primary,#e0e0e0)!important;outline:0!important;border:0!important;pointer-events:none;max-width:100%;box-shadow:none}.wc-block-components-price-slider.is-disabled .wc-block-components-price-slider__range-input-wrapper>*,.wc-block-components-price-slider.is-loading .wc-block-components-price-slider__range-input-wrapper>*{visibility:hidden}}@media screen and (-ms-high-contrast:active)and (prefers-reduced-motion:reduce),screen and (-ms-high-contrast:none)and (prefers-reduced-motion:reduce){.wc-block-components-price-slider.is-disabled .wc-block-components-price-slider__range-input-wrapper,.wc-block-components-price-slider.is-loading .wc-block-components-price-slider__range-input-wrapper{-webkit-animation:none;animation:none}}@media (-ms-high-contrast:none),screen and (-ms-high-contrast:active){.wc-block-components-price-slider.is-disabled:not(.is-loading) .wc-block-components-price-slider__range-input-wrapper{-webkit-animation:none;animation:none}}@supports(-ms-ime-align:auto){.wc-block-components-price-slider__range-input-wrapper{background:transparent;box-shadow:none;height:24px}.wc-block-components-price-slider__range-input-progress{background:#af7dd1;width:100%;top:7px}.wc-block-components-price-slider__range-input{height:24px;pointer-events:auto}.wc-block-components-price-slider__range-input::-ms-track{background:transparent;border-color:transparent;border-width:7px 0;color:transparent}.wc-block-components-price-slider__range-input::-ms-fill-lower{background:#e1e1e1;box-shadow:inset 0 0 0 1px #b8b8b8}.wc-block-components-price-slider__range-input::-ms-fill-upper{background:transparent}.wc-block-components-price-slider__range-input::-ms-tooltip{display:none}.wc-block-components-price-slider__range-input::-ms-thumb{transform:translate(-1px);pointer-events:auto}.wc-block-components-price-slider__range-input--max::-ms-fill-upper{background:#e1e1e1;box-shadow:inset 0 0 0 1px #b8b8b8}.wc-block-components-price-slider__range-input--max::-ms-fill-lower{background:transparent}.wc-block-components-price-slider.is-disabled .wc-block-components-price-slider__range-input-wrapper,.wc-block-components-price-slider.is-loading .wc-block-components-price-slider__range-input-wrapper{-webkit-animation:loading-fade 1.2s ease-in-out infinite;animation:loading-fade 1.2s ease-in-out infinite;background-color:var(--global--color-primary,#e0e0e0)!important;color:var(--global--color-primary,#e0e0e0)!important;outline:0!important;border:0!important;pointer-events:none;max-width:100%;box-shadow:none}.wc-block-components-price-slider.is-disabled .wc-block-components-price-slider__range-input-wrapper>*,.wc-block-components-price-slider.is-loading .wc-block-components-price-slider__range-input-wrapper>*{visibility:hidden}@media screen and (prefers-reduced-motion:reduce){.wc-block-components-price-slider.is-disabled .wc-block-components-price-slider__range-input-wrapper,.wc-block-components-price-slider.is-loading .wc-block-components-price-slider__range-input-wrapper{-webkit-animation:none;animation:none}}.wc-block-components-price-slider.is-disabled:not(.is-loading) .wc-block-components-price-slider__range-input-wrapper{-webkit-animation:none;animation:none}}.theme-twentytwentyone .wc-block-components-price-slider__range-input-wrapper{background:transparent;border:3px solid;box-sizing:border-box}.theme-twentytwentyone .wc-block-components-price-slider__range-input-progress{--range-color:currentColor;margin:-3px}.theme-twentytwentyone .wc-block-price-filter__range-input{background:transparent;margin:-3px;width:calc(100% + 6px)}.theme-twentytwentyone .wc-block-price-filter__range-input:focus::-webkit-slider-thumb,.theme-twentytwentyone .wc-block-price-filter__range-input:hover::-webkit-slider-thumb{filter:none}.theme-twentytwentyone .wc-block-price-filter__range-input:focus::-moz-range-thumb,.theme-twentytwentyone .wc-block-price-filter__range-input:hover::-moz-range-thumb{filter:none}.theme-twentytwentyone .wc-block-price-filter__range-input:focus::-ms-thumb,.theme-twentytwentyone .wc-block-price-filter__range-input:hover::-ms-thumb{filter:none}.theme-twentytwentyone .wc-block-price-filter__range-input::-webkit-slider-thumb{margin-top:-9px}.theme-twentytwentyone .wc-block-price-filter__range-input.wc-block-components-price-slider__range-input--max::-moz-range-thumb{transform:translate(-2px,1px)}.theme-twentytwentyone .wc-block-price-filter__range-input.wc-block-components-price-slider__range-input--min::-moz-range-thumb{transform:translate(2px,1px)}.theme-twentytwentyone .wc-block-price-filter__range-input::-ms-track{border-color:transparent!important}@media (-ms-high-contrast:none),screen and (-ms-high-contrast:active){.theme-twentytwentyone .wc-block-components-price-slider__range-input-wrapper{border:0;height:auto;position:relative;height:50px}.theme-twentytwentyone .wc-block-components-price-slider__range-input-progress{display:none}.theme-twentytwentyone .wc-block-price-filter__range-input{height:100%;margin:0;width:100%}}.wc-block-components-product-sort-select{margin-bottom:24px;text-align:right}@-webkit-keyframes spin{0%{transform:rotate(0deg)}to{transform:rotate(-1turn)}}@keyframes spin{0%{transform:rotate(0deg)}to{transform:rotate(-1turn)}}.wc-block-grid{text-align:center}.wc-block-grid__no-products{padding:40px;text-align:center;width:100%}.wc-block-grid__no-products .wc-block-grid__no-products-image{max-width:150px;margin:0 auto 1em;display:block;color:inherit}.wc-block-grid__no-products .wc-block-grid__no-products-title{display:block;margin:0;font-weight:700}.wc-block-grid__no-products .wc-block-grid__no-products-description{display:block;margin:.25em 0 1em}.wc-block-grid__products{display:flex;flex-wrap:wrap;padding:0;margin:0 -8px 16px;background-clip:padding-box}.wc-block-grid__product{box-sizing:border-box;padding:0;margin:0;float:none;width:auto;position:relative;text-align:center;border-right:8px solid transparent;border-left:8px solid transparent;border-bottom:16px solid transparent;list-style:none}.wc-block-grid__product.wc-block-grid__product{box-sizing:border-box}.theme-twentytwenty .wc-block-grid.has-aligned-buttons .wc-block-grid__product,.wc-block-grid.has-aligned-buttons .wc-block-grid__product{display:flex;flex-direction:column}.theme-twentytwenty .wc-block-grid.has-aligned-buttons .wc-block-grid__product>:last-child,.wc-block-grid.has-aligned-buttons .wc-block-grid__product>:last-child{margin-top:auto;margin-bottom:0;padding-bottom:12px}.theme-twentytwenty .wc-block-grid.has-1-columns .wc-block-grid__product,.wc-block-grid.has-1-columns .wc-block-grid__product{flex:1 0 100%;max-width:100%}.theme-twentytwenty .wc-block-grid.has-2-columns .wc-block-grid__product,.wc-block-grid.has-2-columns .wc-block-grid__product{flex:1 0 50%;max-width:50%}.theme-twentytwenty .wc-block-grid.has-3-columns .wc-block-grid__product,.wc-block-grid.has-3-columns .wc-block-grid__product{flex:1 0 33.33333%;max-width:33.3333333333%}.theme-twentytwenty .wc-block-grid.has-4-columns .wc-block-grid__product,.wc-block-grid.has-4-columns .wc-block-grid__product{flex:1 0 25%;max-width:25%}.theme-twentytwenty .wc-block-grid.has-5-columns .wc-block-grid__product,.wc-block-grid.has-5-columns .wc-block-grid__product{flex:1 0 20%;max-width:20%}.theme-twentytwenty .wc-block-grid.has-6-columns .wc-block-grid__product,.wc-block-grid.has-6-columns .wc-block-grid__product{flex:1 0 16.66667%;max-width:16.6666666667%}.theme-twentytwenty .wc-block-grid.has-7-columns .wc-block-grid__product,.wc-block-grid.has-7-columns .wc-block-grid__product{flex:1 0 14.28571%;max-width:14.2857142857%}.theme-twentytwenty .wc-block-grid.has-8-columns .wc-block-grid__product,.wc-block-grid.has-8-columns .wc-block-grid__product{flex:1 0 12.5%;max-width:12.5%}.theme-twentytwenty .wc-block-grid.has-6-columns .wc-block-grid__product,.wc-block-grid.has-6-columns .wc-block-grid__product{font-size:.5em}.theme-twentytwenty .wc-block-grid.has-5-columns .wc-block-grid__product,.theme-twentytwenty .wc-block-grid.has-6-columns.alignfull .wc-block-grid__product,.wc-block-grid.has-5-columns .wc-block-grid__product,.wc-block-grid.has-6-columns.alignfull .wc-block-grid__product{font-size:.58em}.theme-twentytwenty .wc-block-grid.has-4-columns:not(.alignwide):not(.alignfull) .wc-block-grid__product,.theme-twentytwenty .wc-block-grid.has-5-columns.alignfull .wc-block-grid__product,.wc-block-grid.has-4-columns:not(.alignwide):not(.alignfull) .wc-block-grid__product,.wc-block-grid.has-5-columns.alignfull .wc-block-grid__product{font-size:.75em}.theme-twentytwenty .wc-block-grid.has-3-columns:not(.alignwide):not(.alignfull),.wc-block-grid.has-3-columns:not(.alignwide):not(.alignfull){font-size:.92em}@media(max-width:480px){.wc-block-grid.has-2-columns .wc-block-grid__products{display:block}.wc-block-grid.has-2-columns .wc-block-grid__product{margin-right:auto;margin-left:auto;flex:1 0 100%;max-width:100%;padding:0}.wc-block-grid.has-3-columns .wc-block-grid__products{display:block}.wc-block-grid.has-3-columns .wc-block-grid__product{margin-right:auto;margin-left:auto;flex:1 0 100%;max-width:100%;padding:0}.wc-block-grid.has-4-columns .wc-block-grid__products{display:block}.wc-block-grid.has-4-columns .wc-block-grid__product{margin-right:auto;margin-left:auto;flex:1 0 100%;max-width:100%;padding:0}.wc-block-grid.has-5-columns .wc-block-grid__products{display:block}.wc-block-grid.has-5-columns .wc-block-grid__product{margin-right:auto;margin-left:auto;flex:1 0 100%;max-width:100%;padding:0}.wc-block-grid.has-6-columns .wc-block-grid__products{display:block}.wc-block-grid.has-6-columns .wc-block-grid__product{margin-right:auto;margin-left:auto;flex:1 0 100%;max-width:100%;padding:0}.wc-block-grid.has-7-columns .wc-block-grid__products{display:block}.wc-block-grid.has-7-columns .wc-block-grid__product{margin-right:auto;margin-left:auto;flex:1 0 100%;max-width:100%;padding:0}.wc-block-grid.has-8-columns .wc-block-grid__products{display:block}.wc-block-grid.has-8-columns .wc-block-grid__product{margin-right:auto;margin-left:auto;flex:1 0 100%;max-width:100%;padding:0}}@media(min-width:481px)and (max-width:600px){.wc-block-grid.has-2-columns .wc-block-grid__product{flex:1 0 50%;max-width:50%;padding:0;margin:0 0 24px}.wc-block-grid.has-2-columns .wc-block-grid__product:nth-child(odd){padding-left:8px}.wc-block-grid.has-2-columns .wc-block-grid__product:nth-child(2n){padding-right:8px}.wc-block-grid.has-2-columns .wc-block-grid__product:nth-child(2n) .wc-block-grid__product-onsale{right:8px}.wc-block-grid.has-3-columns .wc-block-grid__product{flex:1 0 50%;max-width:50%;padding:0;margin:0 0 24px}.wc-block-grid.has-3-columns .wc-block-grid__product:nth-child(odd){padding-left:8px}.wc-block-grid.has-3-columns .wc-block-grid__product:nth-child(2n){padding-right:8px}.wc-block-grid.has-3-columns .wc-block-grid__product:nth-child(2n) .wc-block-grid__product-onsale{right:8px}.wc-block-grid.has-4-columns .wc-block-grid__product{flex:1 0 50%;max-width:50%;padding:0;margin:0 0 24px}.wc-block-grid.has-4-columns .wc-block-grid__product:nth-child(odd){padding-left:8px}.wc-block-grid.has-4-columns .wc-block-grid__product:nth-child(2n){padding-right:8px}.wc-block-grid.has-4-columns .wc-block-grid__product:nth-child(2n) .wc-block-grid__product-onsale{right:8px}.wc-block-grid.has-5-columns .wc-block-grid__product{flex:1 0 50%;max-width:50%;padding:0;margin:0 0 24px}.wc-block-grid.has-5-columns .wc-block-grid__product:nth-child(odd){padding-left:8px}.wc-block-grid.has-5-columns .wc-block-grid__product:nth-child(2n){padding-right:8px}.wc-block-grid.has-5-columns .wc-block-grid__product:nth-child(2n) .wc-block-grid__product-onsale{right:8px}.wc-block-grid.has-6-columns .wc-block-grid__product{flex:1 0 50%;max-width:50%;padding:0;margin:0 0 24px}.wc-block-grid.has-6-columns .wc-block-grid__product:nth-child(odd){padding-left:8px}.wc-block-grid.has-6-columns .wc-block-grid__product:nth-child(2n){padding-right:8px}.wc-block-grid.has-6-columns .wc-block-grid__product:nth-child(2n) .wc-block-grid__product-onsale{right:8px}.wc-block-grid.has-7-columns .wc-block-grid__product{flex:1 0 50%;max-width:50%;padding:0;margin:0 0 24px}.wc-block-grid.has-7-columns .wc-block-grid__product:nth-child(odd){padding-left:8px}.wc-block-grid.has-7-columns .wc-block-grid__product:nth-child(2n){padding-right:8px}.wc-block-grid.has-7-columns .wc-block-grid__product:nth-child(2n) .wc-block-grid__product-onsale{right:8px}.wc-block-grid.has-8-columns .wc-block-grid__product{flex:1 0 50%;max-width:50%;padding:0;margin:0 0 24px}.wc-block-grid.has-8-columns .wc-block-grid__product:nth-child(odd){padding-left:8px}.wc-block-grid.has-8-columns .wc-block-grid__product:nth-child(2n){padding-right:8px}.wc-block-grid.has-8-columns .wc-block-grid__product:nth-child(2n) .wc-block-grid__product-onsale{right:8px}}.wc-block-components-product-name{font-size:1em;overflow-wrap:anywhere;word-break:break-word;-ms-word-break:break-all}.wc-block-components-product-price--align-left{display:block;text-align:right}.wc-block-components-product-price--align-center{display:block;text-align:center}.wc-block-components-product-price--align-right{display:block;text-align:left}.wc-block-components-product-price__value.is-discounted{margin-right:.5em}.is-loading .wc-block-components-product-price:before{-webkit-animation:loading-fade 1.2s ease-in-out infinite;animation:loading-fade 1.2s ease-in-out infinite;background-color:var(--global--color-primary,#e0e0e0)!important;color:var(--global--color-primary,#e0e0e0)!important;outline:0!important;border:0!important;box-shadow:none;pointer-events:none;max-width:100%;content:".";display:inline-block;width:5em}.is-loading .wc-block-components-product-price:before>*{visibility:hidden}@media screen and (prefers-reduced-motion:reduce){.is-loading .wc-block-components-product-price:before{-webkit-animation:none;animation:none}}.wc-block-components-quantity-selector{display:flex;width:107px;border:1px solid #ddd;background:#fff;border-radius:4px;box-sizing:content-box;margin:0 0 .25em}.has-dark-controls .wc-block-components-quantity-selector{background-color:transparent;border-color:hsla(0,0%,100%,.4)}.wc-block-components-quantity-selector input.wc-block-components-quantity-selector__input{font-size:1em;order:2;min-width:40px;flex:1 1 auto;border:0;padding:.4em 0;margin:0;text-align:center;background:transparent;box-shadow:none;color:#000;line-height:1;vertical-align:middle;-moz-appearance:textfield}.wc-block-components-quantity-selector input.wc-block-components-quantity-selector__input:focus{background:#f0f0f0;outline:1px solid #ddd}.wc-block-components-quantity-selector input.wc-block-components-quantity-selector__input:disabled{color:#949494}.has-dark-controls .wc-block-components-quantity-selector input.wc-block-components-quantity-selector__input{color:#fff;background:transparent}.has-dark-controls .wc-block-components-quantity-selector input.wc-block-components-quantity-selector__input:focus{background:transparent}.has-dark-controls .wc-block-components-quantity-selector input.wc-block-components-quantity-selector__input:disabled{color:hsla(0,0%,100%,.3)}.wc-block-components-quantity-selector input::-webkit-inner-spin-button,.wc-block-components-quantity-selector input::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}.wc-block-components-quantity-selector .wc-block-components-quantity-selector__button{border:0;padding:0;margin:0;background:none transparent;box-shadow:none;font-size:1em;min-width:30px;cursor:pointer;color:#1e1e1e;font-style:normal;text-align:center;text-decoration:none}.wc-block-components-quantity-selector .wc-block-components-quantity-selector__button:focus{outline:2px solid #ddd}.wc-block-components-quantity-selector .wc-block-components-quantity-selector__button:focus,.wc-block-components-quantity-selector .wc-block-components-quantity-selector__button:hover{border:0;padding:0;margin:0;background:none transparent;box-shadow:none;color:#1e1e1e}.wc-block-components-quantity-selector .wc-block-components-quantity-selector__button:focus:focus,.wc-block-components-quantity-selector .wc-block-components-quantity-selector__button:hover:focus{outline:2px solid #ddd}.wc-block-components-quantity-selector .wc-block-components-quantity-selector__button:disabled{color:#949494;cursor:default;border:0;padding:0;margin:0;background:none transparent;box-shadow:none}.wc-block-components-quantity-selector .wc-block-components-quantity-selector__button:disabled:focus{outline:2px solid #ddd}.has-dark-controls .wc-block-components-quantity-selector .wc-block-components-quantity-selector__button,.has-dark-controls .wc-block-components-quantity-selector .wc-block-components-quantity-selector__button:focus,.has-dark-controls .wc-block-components-quantity-selector .wc-block-components-quantity-selector__button:hover{color:#fff}.has-dark-controls .wc-block-components-quantity-selector .wc-block-components-quantity-selector__button:disabled{color:hsla(0,0%,100%,.3)}.wc-block-components-quantity-selector>.wc-block-components-quantity-selector__button--minus{order:1}.wc-block-components-quantity-selector>.wc-block-components-quantity-selector__button--plus{order:3}.theme-twentyseventeen .wc-block-components-quantity-selector .wc-block-components-quantity-selector__button:focus,.theme-twentyseventeen .wc-block-components-quantity-selector .wc-block-components-quantity-selector__button:hover{background:none transparent}.wc-block-components-radio-control__option{color:inherit;font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;letter-spacing:inherit;line-height:inherit;text-decoration:inherit;text-transform:inherit;display:block;margin:1em 0;padding:0 2.5em 0 0;position:relative}.wc-block-components-radio-control__option:first-child{margin-top:0}.wc-block-components-radio-control__option:last-child{margin-bottom:0}.wc-block-components-radio-control__option-layout{display:table;width:100%}.wc-block-components-radio-control__option .wc-block-components-radio-control__option-layout:after{display:none}.wc-block-components-radio-control__description-group,.wc-block-components-radio-control__label-group{display:table-row}.wc-block-components-radio-control__description-group>span,.wc-block-components-radio-control__label-group>span{display:table-cell}.wc-block-components-radio-control__description-group .wc-block-components-radio-control__secondary-description,.wc-block-components-radio-control__description-group .wc-block-components-radio-control__secondary-label,.wc-block-components-radio-control__label-group .wc-block-components-radio-control__secondary-description,.wc-block-components-radio-control__label-group .wc-block-components-radio-control__secondary-label{text-align:left;min-width:50%}.wc-block-components-radio-control__label,.wc-block-components-radio-control__secondary-label{line-height:max(1.5rem,24px)}.wc-block-components-radio-control__description,.wc-block-components-radio-control__secondary-description{font-size:.875em;line-height:20px}.wc-block-components-radio-control .wc-block-components-radio-control__input{-webkit-appearance:none;-moz-appearance:none;appearance:none;background:#fff;border:2px solid #50575e;border-radius:50%;display:inline-block;height:1.5em;min-height:24px;min-width:24px;width:1.5em;position:absolute;right:0;top:50%;transform:translateY(-50%)}.wc-block-components-radio-control .wc-block-components-radio-control__input:checked:before{background:#000;border-radius:50%;content:"";display:block;height:.75em;right:50%;margin:0;min-height:12px;min-width:12px;position:absolute;top:50%;transform:translate(50%,-50%);width:.75em}.has-dark-controls .wc-block-components-radio-control .wc-block-components-radio-control__input{border-color:hsla(0,0%,100%,.6);background-color:rgba(0,0,0,.1)}.has-dark-controls .wc-block-components-radio-control .wc-block-components-radio-control__input:checked:before{background:#fff}.theme-twentytwentyone .wc-block-components-radio-control .wc-block-components-radio-control__input:checked{border-width:2px}.theme-twentytwentyone .wc-block-components-radio-control .wc-block-components-radio-control__input:checked:before{background-color:var(--form--color-text)}.theme-twentytwentyone .wc-block-components-radio-control .wc-block-components-radio-control__input:after{display:none}.is-loading .wc-block-components-review-list-item__text{-webkit-animation:loading-fade 1.2s ease-in-out infinite;animation:loading-fade 1.2s ease-in-out infinite;background-color:var(--global--color-primary,#e0e0e0)!important;color:var(--global--color-primary,#e0e0e0)!important;outline:0!important;border:0!important;box-shadow:none;pointer-events:none;max-width:100%;display:block;width:60%}.is-loading .wc-block-components-review-list-item__text>*{visibility:hidden}@media screen and (prefers-reduced-motion:reduce){.is-loading .wc-block-components-review-list-item__text{-webkit-animation:none;animation:none}}.is-loading .wc-block-components-review-list-item__text:after{content:" "}.is-loading .wc-block-components-review-list-item__info .wc-block-components-review-list-item__image{-webkit-animation:loading-fade 1.2s ease-in-out infinite;animation:loading-fade 1.2s ease-in-out infinite;background-color:var(--global--color-primary,#e0e0e0)!important;color:var(--global--color-primary,#e0e0e0)!important;outline:0!important;border:0!important;box-shadow:none;pointer-events:none;max-width:100%}.is-loading .wc-block-components-review-list-item__info .wc-block-components-review-list-item__image>*{visibility:hidden}@media screen and (prefers-reduced-motion:reduce){.is-loading .wc-block-components-review-list-item__info .wc-block-components-review-list-item__image{-webkit-animation:none;animation:none}}.is-loading .wc-block-components-review-list-item__info .wc-block-components-review-list-item__image:after{content:" "}.is-loading .wc-block-components-review-list-item__info .wc-block-components-review-list-item__meta .wc-block-components-review-list-item__author{-webkit-animation:loading-fade 1.2s ease-in-out infinite;animation:loading-fade 1.2s ease-in-out infinite;background-color:var(--global--color-primary,#e0e0e0)!important;color:var(--global--color-primary,#e0e0e0)!important;outline:0!important;border:0!important;box-shadow:none;pointer-events:none;max-width:100%;font-size:1em;width:80px}.is-loading .wc-block-components-review-list-item__info .wc-block-components-review-list-item__meta .wc-block-components-review-list-item__author>*{visibility:hidden}@media screen and (prefers-reduced-motion:reduce){.is-loading .wc-block-components-review-list-item__info .wc-block-components-review-list-item__meta .wc-block-components-review-list-item__author{-webkit-animation:none;animation:none}}.is-loading .wc-block-components-review-list-item__info .wc-block-components-review-list-item__meta .wc-block-components-review-list-item__author:after{content:" "}.is-loading .wc-block-components-review-list-item__info .wc-block-components-review-list-item__meta .wc-block-components-review-list-item__product,.is-loading .wc-block-components-review-list-item__info .wc-block-components-review-list-item__meta .wc-block-components-review-list-item__rating .wc-block-components-review-list-item__rating__stars>span{display:none}.is-loading .wc-block-components-review-list-item__info .wc-block-components-review-list-item__published-date{-webkit-animation:loading-fade 1.2s ease-in-out infinite;animation:loading-fade 1.2s ease-in-out infinite;background-color:var(--global--color-primary,#e0e0e0)!important;color:var(--global--color-primary,#e0e0e0)!important;outline:0!important;border:0!important;box-shadow:none;pointer-events:none;max-width:100%;height:1em;width:120px}.is-loading .wc-block-components-review-list-item__info .wc-block-components-review-list-item__published-date>*{visibility:hidden}@media screen and (prefers-reduced-motion:reduce){.is-loading .wc-block-components-review-list-item__info .wc-block-components-review-list-item__published-date{-webkit-animation:none;animation:none}}.is-loading .wc-block-components-review-list-item__info .wc-block-components-review-list-item__published-date:after{content:" "}.editor-styles-wrapper .wc-block-components-review-list-item__item,.wc-block-components-review-list-item__item{margin:0 0 48px;list-style:none}.wc-block-components-review-list-item__info{display:-ms-grid;display:grid;-ms-grid-columns:1fr;grid-template-columns:1fr;margin-bottom:24px}.wc-block-components-review-list-item__meta{-ms-grid-column:1;grid-column:1;-ms-grid-row:1;grid-row:1}.wc-block-components-review-list-item__item--has-image .wc-block-components-review-list-item__info{-ms-grid-columns:calc(3em + 16px) 1fr;grid-template-columns:calc(3em + 16px) 1fr}.wc-block-components-review-list-item__item--has-image .wc-block-components-review-list-item__meta{-ms-grid-column:2;grid-column:2}.wc-block-components-review-list-item__image{align-items:center;display:flex;height:3em;-ms-grid-column:1;grid-column:1;-ms-grid-row:1;-ms-grid-row-span:2;grid-row:1/3;justify-content:center;position:relative;width:3em}.wc-block-components-review-list-item__image>img{display:block;max-height:100%;-o-object-fit:contain;object-fit:contain}.wc-block-components-review-list-item__verified{width:21px;height:21px;text-indent:21px;margin:0;line-height:21px;overflow:hidden;position:absolute;left:-7px;bottom:-7px}.wc-block-components-review-list-item__verified:before{width:21px;height:21px;background:transparent url('data:image/svg+xml;utf8,%3Csvg xmlns="http://www.w3.org/2000/svg" width="21" height="21" fill="none"%3E%3Ccircle cx="10.5" cy="10.5" r="10.5" fill="%23fff"/%3E%3Cpath fill="%23008A21" fill-rule="evenodd" d="M2.1667 10.5003c0-4.6 3.7333-8.3333 8.3333-8.3333s8.3334 3.7333 8.3334 8.3333S15.1 18.8337 10.5 18.8337s-8.3333-3.7334-8.3333-8.3334zm2.5 0l4.1666 4.1667 7.5001-7.5-1.175-1.1833-6.325 6.325-2.9917-2.9834-1.175 1.175z" clip-rule="evenodd"/%3E%3Cmask id="a" width="17" height="17" x="2" y="2" maskUnits="userSpaceOnUse"%3E%3Cpath fill="%23fff" fill-rule="evenodd" d="M2.1667 10.5003c0-4.6 3.7333-8.3333 8.3333-8.3333s8.3334 3.7333 8.3334 8.3333S15.1 18.8337 10.5 18.8337s-8.3333-3.7334-8.3333-8.3334zm2.5 0l4.1666 4.1667 7.5001-7.5-1.175-1.1833-6.325 6.325-2.9917-2.9834-1.175 1.175z" clip-rule="evenodd"/%3E%3C/mask%3E%3Cg mask="url(%23a)"%3E%3Cpath fill="%23008A21" d="M.5.5h20v20H.5z"/%3E%3C/g%3E%3C/svg%3E') 50% no-repeat;display:block;content:""}.wc-block-components-review-list-item__meta{display:flex;align-items:center;flex-flow:row wrap}.wc-block-components-review-list-item__meta:after{order:3;content:"";flex-basis:100%}.wc-block-components-review-list-item__author,.wc-block-components-review-list-item__product{display:block;font-weight:700;order:1;margin-left:8px}.wc-block-components-review-list-item__product+.wc-block-components-review-list-item__author{font-weight:400;order:4}.wc-block-components-review-list-item__published-date{order:5}.wc-block-components-review-list-item__product+.wc-block-components-review-list-item__author+.wc-block-components-review-list-item__published-date{padding-right:8px;position:relative}.wc-block-components-review-list-item__product+.wc-block-components-review-list-item__author+.wc-block-components-review-list-item__published-date:before{content:"";display:inline-block;margin-right:-8px;border-left:1px solid;opacity:.5;height:1em;vertical-align:middle;position:absolute;top:calc(50% + .1em);transform:translateY(-50%)}.wc-block-components-review-list-item__author:first-child+.wc-block-components-review-list-item__published-date:before,.wc-block-components-review-list-item__rating+.wc-block-components-review-list-item__author+.wc-block-components-review-list-item__published-date:before{display:none}.wc-block-components-review-list-item__rating{order:2}.wc-block-components-review-list-item__rating>.wc-block-components-review-list-item__rating__stars{font-size:1em;display:block;top:0;overflow:hidden;position:relative;height:1em;line-height:1;width:5.3em;font-family:star;font-weight:400}.wc-block-components-review-list-item__rating>.wc-block-components-review-list-item__rating__stars:before{content:"SSSSS";opacity:.25;float:right;top:0;right:0;position:absolute}.wc-block-components-review-list-item__rating>.wc-block-components-review-list-item__rating__stars span{overflow:hidden;float:right;top:0;right:0;position:absolute;padding-top:1.5em}.wc-block-components-review-list-item__rating>.wc-block-components-review-list-item__rating__stars span:before{content:"SSSSS";top:0;position:absolute;right:0;color:#e6a237}.wc-block-components-review-list-item__text p{font-size:inherit}.wc-block-components-review-list.wc-block-components-review-list{margin:0}.wc-block-components-review-sort-select{text-align:left}.wc-block-components-sidebar-layout{display:flex;flex-wrap:wrap;margin:0 auto 16px;position:relative}.wc-block-components-sidebar-layout .wc-block-components-main{box-sizing:border-box;margin:0;padding-left:3.7735849057%;width:65%}.wc-block-components-sidebar{box-sizing:border-box;margin:0;padding-right:2.2641509434%;width:35%}.wc-block-components-sidebar .wc-block-components-panel>h2{font-size:1em;border:0;border-radius:0;margin:0;padding:0;vertical-align:baseline}.is-medium.wc-block-components-sidebar-layout,.is-mobile.wc-block-components-sidebar-layout,.is-small.wc-block-components-sidebar-layout{flex-direction:column;margin:0 auto 16px}.is-medium.wc-block-components-sidebar-layout .wc-block-components-main,.is-medium.wc-block-components-sidebar-layout .wc-block-components-sidebar,.is-mobile.wc-block-components-sidebar-layout .wc-block-components-main,.is-mobile.wc-block-components-sidebar-layout .wc-block-components-sidebar,.is-small.wc-block-components-sidebar-layout .wc-block-components-main,.is-small.wc-block-components-sidebar-layout .wc-block-components-sidebar{padding:0;width:100%}.is-large .wc-block-components-sidebar .wc-block-components-panel,.is-large .wc-block-components-sidebar .wc-block-components-totals-item{padding-right:16px;padding-left:16px}.is-large .wc-block-components-sidebar .wc-block-components-panel .wc-block-components-totals-item{padding:0}.wc-block-components-sidebar .wc-block-components-panel>h2{color:inherit;font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;letter-spacing:inherit;line-height:inherit;text-decoration:inherit;text-transform:inherit}.wc-block-components-sidebar .wc-block-components-panel>h2 .wc-block-components-panel__button{font-weight:400}.theme-twentytwenty .wc-block-components-sidebar .wc-block-components-panel>h2{font-size:1.25em;border:0;border-radius:0;margin:0;padding:0;vertical-align:baseline}.wc-block-components-sort-select{margin-bottom:12px}.wc-block-components-sort-select__label{margin-left:12px;display:inline-block;font-weight:400}.wc-block-components-sort-select__select{font-size:inherit;width:-webkit-max-content;width:-moz-max-content;width:max-content}.wc-block-components-spinner{position:absolute;width:100%;height:100%;color:inherit;box-sizing:content-box;text-align:center;font-size:1.25em}.wc-block-components-spinner:after{content:" ";position:absolute;top:50%;right:50%;margin:-.5em -.5em 0 0;width:1em;height:1em;box-sizing:border-box;transform-origin:50% 50%;transform:translateZ(0) scale(.5);-webkit-backface-visibility:hidden;backface-visibility:hidden;border-radius:50%;border:.2em solid;border-right:.2em solid transparent;-webkit-animation:wc-block-components-spinner__animation 1s linear infinite;animation:wc-block-components-spinner__animation 1s linear infinite}@-webkit-keyframes wc-block-components-spinner__animation{0%{-webkit-animation-timing-function:cubic-bezier(.5856,.0703,.4143,.9297);animation-timing-function:cubic-bezier(.5856,.0703,.4143,.9297);transform:rotate(0deg)}to{transform:rotate(-1turn)}}@keyframes wc-block-components-spinner__animation{0%{-webkit-animation-timing-function:cubic-bezier(.5856,.0703,.4143,.9297);animation-timing-function:cubic-bezier(.5856,.0703,.4143,.9297);transform:rotate(0deg)}to{transform:rotate(-1turn)}}.wc-block-components-state-input{margin-top:1.5em}.wc-block-components-tabs .wc-block-components-tabs__list{display:flex;flex-direction:row;flex-wrap:wrap;width:100%}.wc-block-components-tabs .wc-block-components-tabs__list>.wc-block-components-tabs__item{border:none;flex:auto;background:transparent;padding:12px 16px;color:inherit;outline-offset:-1px;text-align:center;transition:box-shadow .1s linear;box-shadow:inset 0 -1px currentColor;border-radius:0}.wc-block-components-tabs .wc-block-components-tabs__list>.wc-block-components-tabs__item.is-active{box-shadow:inset 0 -3px currentColor;font-weight:600;position:relative}.wc-block-components-tabs .wc-block-components-tabs__list>.wc-block-components-tabs__item:focus{outline-offset:-1px;outline:1px dotted currentColor}.wc-block-components-tabs .wc-block-components-tabs__list>.wc-block-components-tabs__item:active,.wc-block-components-tabs .wc-block-components-tabs__list>.wc-block-components-tabs__item:hover{background:transparent}.wc-block-components-tabs .wc-block-components-tabs__list>.wc-block-components-tabs__item .wc-block-components-tabs__item-content{font-size:1em;line-height:1;width:-webkit-fit-content;width:-moz-fit-content;width:fit-content;display:inline-block;font-weight:700}.wc-block-components-tabs .wc-block-components-tabs__list>.wc-block-components-tabs__item .wc-block-components-tabs__item-content>img,.wc-block-components-tabs .wc-block-components-tabs__list>.wc-block-components-tabs__item .wc-block-components-tabs__item-content>svg{height:1.2em;vertical-align:middle;margin:.2em 0 -.2em}.wc-block-components-tabs .wc-block-components-tabs__list>.wc-block-components-tabs__item .wc-block-components-tabs__item-content .wc-block-components-payment-method-icons{margin:.2em 0 -.2em}.wc-block-components-tabs .wc-block-components-tabs__list>.wc-block-components-tabs__item .wc-block-components-tabs__item-content .wc-block-components-payment-method-icons .wc-block-components-payment-method-icon{height:1.2em;vertical-align:middle}.wc-block-components-tabs .wc-block-components-tabs__content{padding:16px 0;text-transform:none}.wc-block-components-form .wc-block-components-text-input,.wc-block-components-text-input{position:relative;margin-top:1.5em;white-space:nowrap}.wc-block-components-form .wc-block-components-text-input label,.wc-block-components-text-input label{color:inherit;font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;letter-spacing:inherit;line-height:inherit;text-decoration:inherit;text-transform:inherit;font-size:1em;position:absolute;transform:translateY(.75em);right:0;top:0;transform-origin:top right;line-height:1.375;color:#757575;transition:transform .2s ease;margin:0 17px 0 0;overflow:hidden;text-overflow:ellipsis;max-width:calc(100% - 32px);cursor:text}.has-dark-controls .wc-block-components-form .wc-block-components-text-input label,.has-dark-controls .wc-block-components-text-input label{color:hsla(0,0%,100%,.6)}@media screen and (prefers-reduced-motion:reduce){.wc-block-components-form .wc-block-components-text-input label,.wc-block-components-text-input label{transition:none}}.wc-block-components-form .wc-block-components-text-input input:-webkit-autofill+label,.wc-block-components-text-input input:-webkit-autofill+label{transform:translateY(4px) scale(.75)}.wc-block-components-form .wc-block-components-text-input.is-active label,.wc-block-components-text-input.is-active label{transform:translateY(4px) scale(.75)}.wc-block-components-form .wc-block-components-text-input input[type=email],.wc-block-components-form .wc-block-components-text-input input[type=number],.wc-block-components-form .wc-block-components-text-input input[type=tel],.wc-block-components-form .wc-block-components-text-input input[type=text],.wc-block-components-form .wc-block-components-text-input input[type=url],.wc-block-components-text-input input[type=email],.wc-block-components-text-input input[type=number],.wc-block-components-text-input input[type=tel],.wc-block-components-text-input input[type=text],.wc-block-components-text-input input[type=url]{font-size:1em;background-color:#fff;padding:.75em 16px;border-radius:4px;border:1px solid #50575e;width:100%;line-height:1.375;font-family:inherit;margin:0;box-sizing:border-box;height:3em;min-height:0;color:#2b2d2f}.wc-block-components-form .wc-block-components-text-input input[type=email]:focus,.wc-block-components-form .wc-block-components-text-input input[type=number]:focus,.wc-block-components-form .wc-block-components-text-input input[type=tel]:focus,.wc-block-components-form .wc-block-components-text-input input[type=text]:focus,.wc-block-components-form .wc-block-components-text-input input[type=url]:focus,.wc-block-components-text-input input[type=email]:focus,.wc-block-components-text-input input[type=number]:focus,.wc-block-components-text-input input[type=tel]:focus,.wc-block-components-text-input input[type=text]:focus,.wc-block-components-text-input input[type=url]:focus{background-color:#fff;color:#2b2d2f;outline:0;box-shadow:0 0 0 1px #50575e}.has-dark-controls .wc-block-components-form .wc-block-components-text-input input[type=email],.has-dark-controls .wc-block-components-form .wc-block-components-text-input input[type=number],.has-dark-controls .wc-block-components-form .wc-block-components-text-input input[type=tel],.has-dark-controls .wc-block-components-form .wc-block-components-text-input input[type=text],.has-dark-controls .wc-block-components-form .wc-block-components-text-input input[type=url],.has-dark-controls .wc-block-components-text-input input[type=email],.has-dark-controls .wc-block-components-text-input input[type=number],.has-dark-controls .wc-block-components-text-input input[type=tel],.has-dark-controls .wc-block-components-text-input input[type=text],.has-dark-controls .wc-block-components-text-input input[type=url]{background-color:rgba(0,0,0,.1);border-color:hsla(0,0%,100%,.4);color:#fff}.has-dark-controls .wc-block-components-form .wc-block-components-text-input input[type=email]:focus,.has-dark-controls .wc-block-components-form .wc-block-components-text-input input[type=number]:focus,.has-dark-controls .wc-block-components-form .wc-block-components-text-input input[type=tel]:focus,.has-dark-controls .wc-block-components-form .wc-block-components-text-input input[type=text]:focus,.has-dark-controls .wc-block-components-form .wc-block-components-text-input input[type=url]:focus,.has-dark-controls .wc-block-components-text-input input[type=email]:focus,.has-dark-controls .wc-block-components-text-input input[type=number]:focus,.has-dark-controls .wc-block-components-text-input input[type=tel]:focus,.has-dark-controls .wc-block-components-text-input input[type=text]:focus,.has-dark-controls .wc-block-components-text-input input[type=url]:focus{background-color:rgba(0,0,0,.1);color:#fff;box-shadow:0 0 0 1px hsla(0,0%,100%,.4)}.wc-block-components-form .wc-block-components-text-input input[type=number],.wc-block-components-text-input input[type=number]{-moz-appearance:textfield}.wc-block-components-form .wc-block-components-text-input input[type=number]::-webkit-inner-spin-button,.wc-block-components-form .wc-block-components-text-input input[type=number]::-webkit-outer-spin-button,.wc-block-components-text-input input[type=number]::-webkit-inner-spin-button,.wc-block-components-text-input input[type=number]::-webkit-outer-spin-button{-webkit-appearance:none;appearance:none;margin:0}.wc-block-components-form .wc-block-components-text-input.is-active input[type=email],.wc-block-components-form .wc-block-components-text-input.is-active input[type=number],.wc-block-components-form .wc-block-components-text-input.is-active input[type=tel],.wc-block-components-form .wc-block-components-text-input.is-active input[type=text],.wc-block-components-form .wc-block-components-text-input.is-active input[type=url],.wc-block-components-text-input.is-active input[type=email],.wc-block-components-text-input.is-active input[type=number],.wc-block-components-text-input.is-active input[type=tel],.wc-block-components-text-input.is-active input[type=text],.wc-block-components-text-input.is-active input[type=url]{padding:1.5em 16px .25em 0}.wc-block-components-form .wc-block-components-text-input.has-error input,.wc-block-components-form .wc-block-components-text-input.has-error input:active,.wc-block-components-form .wc-block-components-text-input.has-error input:focus,.wc-block-components-form .wc-block-components-text-input.has-error input:hover,.wc-block-components-text-input.has-error input,.wc-block-components-text-input.has-error input:active,.wc-block-components-text-input.has-error input:focus,.wc-block-components-text-input.has-error input:hover{border-color:#cc1818}.wc-block-components-form .wc-block-components-text-input.has-error input:focus,.wc-block-components-text-input.has-error input:focus{box-shadow:0 0 0 1px #cc1818}.wc-block-components-form .wc-block-components-text-input.has-error label,.wc-block-components-text-input.has-error label{color:#cc1818}.wc-block-components-form .wc-block-components-text-input:only-child,.wc-block-components-text-input:only-child{margin-top:0}.wc-block-components-textarea{font-size:1em;background-color:#fff;border:1px solid #50575e;border-radius:4px;color:#2b2d2f;font-family:inherit;line-height:1.375;margin:0;padding:.75em 16px;width:100%}.has-dark-controls .wc-block-components-textarea{background-color:rgba(0,0,0,.1);border-color:hsla(0,0%,100%,.4);color:#fff}.has-dark-controls .wc-block-components-textarea::-moz-placeholder{color:hsla(0,0%,100%,.6)}.has-dark-controls .wc-block-components-textarea:-ms-input-placeholder{color:hsla(0,0%,100%,.6)}.has-dark-controls .wc-block-components-textarea::placeholder{color:hsla(0,0%,100%,.6)}.theme-twentytwentyone .has-dark-controls .wc-block-components-textarea{background-color:rgba(0,0,0,.1);color:#fff}.theme-twentytwenty .wc-block-components-title.wc-block-components-title,.wc-block-components-title.wc-block-components-title{border:0;border-radius:0;margin:0;padding:0;vertical-align:baseline;font-size:1.25em;word-break:break-word}.wc-block-components-notices{display:block;margin-bottom:2em}.wc-block-components-notices .wc-block-components-notices__notice{margin:0;display:flex;flex-wrap:nowrap}.wc-block-components-notices .wc-block-components-notices__notice .components-notice__dismiss{background:transparent none;padding:0;margin:0 auto 0 0;border:0;outline:0;color:currentColor}.wc-block-components-notices .wc-block-components-notices__notice .components-notice__dismiss svg{fill:currentColor;vertical-align:text-top}.wc-block-components-notices .wc-block-components-notices__notice+.wc-block-components-notices__notice{margin-top:1em}.theme-twentytwenty .wc-block-components-notices__notice,.theme-twentytwentyone .wc-block-components-notices__notice{padding:1.5rem 3rem}.wc-block-components-notices__snackbar{position:fixed;bottom:20px;right:16px;width:auto}@media(max-width:782px){.wc-block-components-notices__snackbar{position:fixed;top:10px;right:0;bottom:auto}}@media(max-width:782px){.wc-block-components-notices__snackbar .components-snackbar-list__notice-container{margin-right:10px;margin-left:10px}}.wc-block-components-validation-error{font-size:.75em;color:#cc1818;max-width:100%;white-space:normal}.wc-block-components-validation-error>p{margin:0;padding:0}.wc-block-components-select+.wc-block-components-validation-error{margin-bottom:24px}.with-scroll-to-top__scroll-point{position:relative;top:-36px}.is-medium .wc-block-cart__sidebar,.is-mobile .wc-block-cart__sidebar,.is-small .wc-block-cart__sidebar{margin-bottom:24px;order:0}.wc-block-cart__submit{position:relative}.wc-block-cart__submit-container{padding-bottom:16px}.wc-block-cart__submit-button{width:100%;margin:0 0 16px}.wc-block-cart__submit-button:last-child{margin-bottom:0}.is-medium .wc-block-cart__submit-container:not(.wc-block-cart__submit-container--sticky),.is-mobile .wc-block-cart__submit-container:not(.wc-block-cart__submit-container--sticky),.is-small .wc-block-cart__submit-container:not(.wc-block-cart__submit-container--sticky){padding-right:0;padding-left:0;padding-top:0}@media(min-width:783px){.wc-block-cart__submit-container--sticky{display:none}}@media(max-width:782px){.wc-block-cart__submit-container--sticky{background:#fff;bottom:0;right:0;padding:16px;position:fixed;width:100%;z-index:9999}.wc-block-cart__submit-container--sticky:before{box-shadow:0 -10px 20px 10px currentColor;color:hsla(0,0%,80%,.5);content:"";height:100%;right:0;position:absolute;left:0;top:0}}.editor-styles-wrapper .wc-block-cart__empty-cart__title,.wc-block-cart__empty-cart__title{font-size:inherit}.wc-block-cart .wc-block-components-shipping-calculator{white-space:nowrap}.wc-block-cart .wc-block-components-address-form .wc-block-components-country-input:first-of-type,.wc-block-cart .wc-block-components-address-form .wc-block-components-state-input:first-of-type,.wc-block-cart .wc-block-components-address-form .wc-block-components-text-input:first-of-type{margin-top:0}table.wc-block-cart-items,table.wc-block-cart-items td,table.wc-block-cart-items th{background:none!important;border:0;margin:0}.editor-styles-wrapper table.wc-block-cart-items,table.wc-block-cart-items{width:100%}.editor-styles-wrapper table.wc-block-cart-items .wc-block-cart-items__header,table.wc-block-cart-items .wc-block-cart-items__header{font-size:.75em;text-transform:uppercase}.editor-styles-wrapper table.wc-block-cart-items .wc-block-cart-items__header .wc-block-cart-items__header-image,table.wc-block-cart-items .wc-block-cart-items__header .wc-block-cart-items__header-image{width:100px}.editor-styles-wrapper table.wc-block-cart-items .wc-block-cart-items__header .wc-block-cart-items__header-product,table.wc-block-cart-items .wc-block-cart-items__header .wc-block-cart-items__header-product{visibility:hidden}.editor-styles-wrapper table.wc-block-cart-items .wc-block-cart-items__header .wc-block-cart-items__header-total,table.wc-block-cart-items .wc-block-cart-items__header .wc-block-cart-items__header-total{width:100px;text-align:left}.editor-styles-wrapper table.wc-block-cart-items .wc-block-cart-items__row .wc-block-cart-item__image img,table.wc-block-cart-items .wc-block-cart-items__row .wc-block-cart-item__image img{width:100%;margin:0}.editor-styles-wrapper table.wc-block-cart-items .wc-block-cart-items__row .wc-block-cart-item__quantity .wc-block-cart-item__remove-link,table.wc-block-cart-items .wc-block-cart-items__row .wc-block-cart-item__quantity .wc-block-cart-item__remove-link{border:0;border-radius:0;margin:0;padding:0;vertical-align:baseline;color:inherit;font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;letter-spacing:inherit;line-height:inherit;text-decoration:inherit;text-transform:inherit;background:transparent;box-shadow:none;display:inline;text-shadow:none;text-decoration:underline;font-size:.75em;text-transform:none;white-space:nowrap}.editor-styles-wrapper table.wc-block-cart-items .wc-block-cart-items__row .wc-block-cart-item__quantity .wc-block-cart-item__remove-link:active,.editor-styles-wrapper table.wc-block-cart-items .wc-block-cart-items__row .wc-block-cart-item__quantity .wc-block-cart-item__remove-link:focus,.editor-styles-wrapper table.wc-block-cart-items .wc-block-cart-items__row .wc-block-cart-item__quantity .wc-block-cart-item__remove-link:hover,table.wc-block-cart-items .wc-block-cart-items__row .wc-block-cart-item__quantity .wc-block-cart-item__remove-link:active,table.wc-block-cart-items .wc-block-cart-items__row .wc-block-cart-item__quantity .wc-block-cart-item__remove-link:focus,table.wc-block-cart-items .wc-block-cart-items__row .wc-block-cart-item__quantity .wc-block-cart-item__remove-link:hover{background:transparent}.editor-styles-wrapper table.wc-block-cart-items .wc-block-cart-items__row .wc-block-components-product-name,table.wc-block-cart-items .wc-block-cart-items__row .wc-block-components-product-name{display:block;max-width:-webkit-max-content;max-width:-moz-max-content;max-width:max-content}.editor-styles-wrapper table.wc-block-cart-items .wc-block-cart-items__row .wc-block-cart-item__total,table.wc-block-cart-items .wc-block-cart-items__row .wc-block-cart-item__total{font-size:1em;text-align:left;line-height:inherit}.editor-styles-wrapper table.wc-block-cart-items .wc-block-cart-items__row .wc-block-components-product-metadata,table.wc-block-cart-items .wc-block-cart-items__row .wc-block-components-product-metadata{margin-bottom:.75em}.editor-styles-wrapper table.wc-block-cart-items .wc-block-cart-items__row.is-disabled,table.wc-block-cart-items .wc-block-cart-items__row.is-disabled{opacity:.5;pointer-events:none;transition:opacity .2s ease}.wc-block-cart .wc-block-components-totals-footer-item,.wc-block-cart .wc-block-components-totals-taxes{margin:0}.wc-block-cart--is-loading h2 span,.wc-block-cart--is-loading th span,.wc-block-mini-cart__drawer.is-loading h2 span,.wc-block-mini-cart__drawer.is-loading th span{-webkit-animation:loading-fade 1.2s ease-in-out infinite;animation:loading-fade 1.2s ease-in-out infinite;background-color:var(--global--color-primary,#e0e0e0)!important;color:var(--global--color-primary,#e0e0e0)!important;outline:0!important;border:0!important;box-shadow:none;pointer-events:none;max-width:100%;min-width:84px;display:inline-block}.wc-block-cart--is-loading h2 span>*,.wc-block-cart--is-loading th span>*,.wc-block-mini-cart__drawer.is-loading h2 span>*,.wc-block-mini-cart__drawer.is-loading th span>*{visibility:hidden}@media screen and (prefers-reduced-motion:reduce){.wc-block-cart--is-loading h2 span,.wc-block-cart--is-loading th span,.wc-block-mini-cart__drawer.is-loading h2 span,.wc-block-mini-cart__drawer.is-loading th span{-webkit-animation:none;animation:none}}.wc-block-cart--is-loading h2 span:after,.wc-block-cart--is-loading th span:after,.wc-block-mini-cart__drawer.is-loading h2 span:after,.wc-block-mini-cart__drawer.is-loading th span:after{content:" "}.wc-block-cart--is-loading h2 span,.wc-block-mini-cart__drawer.is-loading h2 span{min-width:33%}.wc-block-cart--is-loading .wc-block-components-product-metadata,.wc-block-cart--is-loading .wc-block-components-product-price,.wc-block-cart--is-loading .wc-block-components-quantity-selector,.wc-block-mini-cart__drawer.is-loading .wc-block-components-product-metadata,.wc-block-mini-cart__drawer.is-loading .wc-block-components-product-price,.wc-block-mini-cart__drawer.is-loading .wc-block-components-quantity-selector{-webkit-animation:loading-fade 1.2s ease-in-out infinite;animation:loading-fade 1.2s ease-in-out infinite;background-color:var(--global--color-primary,#e0e0e0)!important;color:var(--global--color-primary,#e0e0e0)!important;outline:0!important;border:0!important;box-shadow:none;pointer-events:none;max-width:100%}.wc-block-cart--is-loading .wc-block-components-product-metadata>*,.wc-block-cart--is-loading .wc-block-components-product-price>*,.wc-block-cart--is-loading .wc-block-components-quantity-selector>*,.wc-block-mini-cart__drawer.is-loading .wc-block-components-product-metadata>*,.wc-block-mini-cart__drawer.is-loading .wc-block-components-product-price>*,.wc-block-mini-cart__drawer.is-loading .wc-block-components-quantity-selector>*{visibility:hidden}@media screen and (prefers-reduced-motion:reduce){.wc-block-cart--is-loading .wc-block-components-product-metadata,.wc-block-cart--is-loading .wc-block-components-product-price,.wc-block-cart--is-loading .wc-block-components-quantity-selector,.wc-block-mini-cart__drawer.is-loading .wc-block-components-product-metadata,.wc-block-mini-cart__drawer.is-loading .wc-block-components-product-price,.wc-block-mini-cart__drawer.is-loading .wc-block-components-quantity-selector{-webkit-animation:none;animation:none}}.wc-block-cart--is-loading .wc-block-components-product-name,.wc-block-mini-cart__drawer.is-loading .wc-block-components-product-name{-webkit-animation:loading-fade 1.2s ease-in-out infinite;animation:loading-fade 1.2s ease-in-out infinite;background-color:var(--global--color-primary,#e0e0e0)!important;color:var(--global--color-primary,#e0e0e0)!important;outline:0!important;border:0!important;box-shadow:none;pointer-events:none;max-width:100%;min-width:84px;display:inline-block}.wc-block-cart--is-loading .wc-block-components-product-name>*,.wc-block-mini-cart__drawer.is-loading .wc-block-components-product-name>*{visibility:hidden}@media screen and (prefers-reduced-motion:reduce){.wc-block-cart--is-loading .wc-block-components-product-name,.wc-block-mini-cart__drawer.is-loading .wc-block-components-product-name{-webkit-animation:none;animation:none}}.wc-block-cart--is-loading .wc-block-components-product-name:after,.wc-block-mini-cart__drawer.is-loading .wc-block-components-product-name:after{content:" "}.wc-block-cart--is-loading .wc-block-components-product-metadata,.wc-block-mini-cart__drawer.is-loading .wc-block-components-product-metadata{margin-top:.25em;min-width:8em}.wc-block-cart--is-loading .wc-block-cart-item__remove-link,.wc-block-mini-cart__drawer.is-loading .wc-block-cart-item__remove-link{visibility:hidden}.wc-block-cart--is-loading .wc-block-cart-item__image>a,.wc-block-mini-cart__drawer.is-loading .wc-block-cart-item__image>a{-webkit-animation:loading-fade 1.2s ease-in-out infinite;animation:loading-fade 1.2s ease-in-out infinite;background-color:var(--global--color-primary,#e0e0e0)!important;color:var(--global--color-primary,#e0e0e0)!important;outline:0!important;border:0!important;box-shadow:none;pointer-events:none;max-width:100%;display:block}.wc-block-cart--is-loading .wc-block-cart-item__image>a>*,.wc-block-mini-cart__drawer.is-loading .wc-block-cart-item__image>a>*{visibility:hidden}@media screen and (prefers-reduced-motion:reduce){.wc-block-cart--is-loading .wc-block-cart-item__image>a,.wc-block-mini-cart__drawer.is-loading .wc-block-cart-item__image>a{-webkit-animation:none;animation:none}}.wc-block-cart--is-loading .wc-block-components-product-price,.wc-block-mini-cart__drawer.is-loading .wc-block-components-product-price{max-width:3em;display:block;margin-top:.25em}.wc-block-cart--is-loading .wc-block-components-product-price:after,.wc-block-mini-cart__drawer.is-loading .wc-block-components-product-price:after{content:" "}.wc-block-cart--is-loading .wc-block-cart__sidebar .components-card,.wc-block-mini-cart__drawer.is-loading .wc-block-cart__sidebar .components-card{-webkit-animation:loading-fade 1.2s ease-in-out infinite;animation:loading-fade 1.2s ease-in-out infinite;background-color:var(--global--color-primary,#e0e0e0)!important;color:var(--global--color-primary,#e0e0e0)!important;outline:0!important;border:0!important;box-shadow:none;pointer-events:none;max-width:100%;min-height:460px}.wc-block-cart--is-loading .wc-block-cart__sidebar .components-card>*,.wc-block-mini-cart__drawer.is-loading .wc-block-cart__sidebar .components-card>*{visibility:hidden}@media screen and (prefers-reduced-motion:reduce){.wc-block-cart--is-loading .wc-block-cart__sidebar .components-card,.wc-block-mini-cart__drawer.is-loading .wc-block-cart__sidebar .components-card{-webkit-animation:none;animation:none}}.wc-block-cart--is-loading .wc-block-cart__sidebar .components-card:after,.wc-block-mini-cart__drawer.is-loading .wc-block-cart__sidebar .components-card:after{content:" "}.wc-block-components-sidebar-layout.wc-block-cart--skeleton{display:none}.is-loading+.wc-block-components-sidebar-layout.wc-block-cart--skeleton{display:flex}.wc-block-cart-item__total-price-and-sale-badge-wrapper{display:flex;flex-direction:column;align-items:flex-end}.wc-block-cart-item__total-price-and-sale-badge-wrapper .wc-block-components-sale-badge{margin-top:4px}.is-medium.wc-block-cart .wc-block-components-sidebar .wc-block-cart__totals-title,.is-mobile .wc-block-cart-item__total .wc-block-components-sale-badge,.is-mobile.wc-block-cart .wc-block-components-sidebar .wc-block-cart__totals-title,.is-small .wc-block-cart-item__total .wc-block-components-sale-badge,.is-small.wc-block-cart .wc-block-components-sidebar .wc-block-cart__totals-title{display:none}.is-medium table.wc-block-cart-items td,.is-mobile table.wc-block-cart-items td,.is-small table.wc-block-cart-items td{padding:0}.is-medium table.wc-block-cart-items .wc-block-cart-item__remove-link,.is-medium table.wc-block-cart-items .wc-block-cart-items__header,.is-mobile table.wc-block-cart-items .wc-block-cart-item__remove-link,.is-mobile table.wc-block-cart-items .wc-block-cart-items__header,.is-small table.wc-block-cart-items .wc-block-cart-item__remove-link,.is-small table.wc-block-cart-items .wc-block-cart-items__header{display:none}.is-medium table.wc-block-cart-items .wc-block-cart-items__row,.is-mobile table.wc-block-cart-items .wc-block-cart-items__row,.is-small table.wc-block-cart-items .wc-block-cart-items__row{position:relative;display:-ms-grid;display:grid;-ms-grid-columns:80px 132px;grid-template-columns:80px 132px;padding:16px 0}.is-medium table.wc-block-cart-items .wc-block-cart-items__row:after,.is-mobile table.wc-block-cart-items .wc-block-cart-items__row:after,.is-small table.wc-block-cart-items .wc-block-cart-items__row:after{border-style:solid;border-width:0 0 1px;bottom:0;content:"";display:block;right:0;opacity:.3;pointer-events:none;position:absolute;left:0;top:0}.is-medium table.wc-block-cart-items .wc-block-cart-items__row .wc-block-cart-item__image,.is-mobile table.wc-block-cart-items .wc-block-cart-items__row .wc-block-cart-item__image,.is-small table.wc-block-cart-items .wc-block-cart-items__row .wc-block-cart-item__image{-ms-grid-column:1;grid-column-start:1;-ms-grid-row:1;grid-row-start:1;padding-left:16px}.is-medium table.wc-block-cart-items .wc-block-cart-items__row .wc-block-cart-item__product,.is-mobile table.wc-block-cart-items .wc-block-cart-items__row .wc-block-cart-item__product,.is-small table.wc-block-cart-items .wc-block-cart-items__row .wc-block-cart-item__product{-ms-grid-column:2;grid-column-start:2;-ms-grid-column-span:2;grid-column-end:4;-ms-grid-row:1;grid-row-start:1;-ms-grid-column-align:stretch;justify-self:stretch;padding:0 0 16px 16px}.is-medium table.wc-block-cart-items .wc-block-cart-items__row .wc-block-cart-item__quantity,.is-mobile table.wc-block-cart-items .wc-block-cart-items__row .wc-block-cart-item__quantity,.is-small table.wc-block-cart-items .wc-block-cart-items__row .wc-block-cart-item__quantity{-ms-grid-column:1;grid-column-start:1;-ms-grid-row:2;grid-row-start:2;vertical-align:bottom;padding-left:16px;-ms-grid-row-align:end;align-self:end;padding-top:16px}.is-medium table.wc-block-cart-items .wc-block-cart-items__row .wc-block-cart-item__total,.is-mobile table.wc-block-cart-items .wc-block-cart-items__row .wc-block-cart-item__total,.is-small table.wc-block-cart-items .wc-block-cart-items__row .wc-block-cart-item__total{-ms-grid-row:1;grid-row-start:1}.is-medium table.wc-block-cart-items .wc-block-cart-items__row .wc-block-cart-item__total .wc-block-components-formatted-money-amount,.is-mobile table.wc-block-cart-items .wc-block-cart-items__row .wc-block-cart-item__total .wc-block-components-formatted-money-amount,.is-small table.wc-block-cart-items .wc-block-cart-items__row .wc-block-cart-item__total .wc-block-components-formatted-money-amount{display:inline-block}.is-large.wc-block-cart .wc-block-cart-items{position:relative}.is-large.wc-block-cart .wc-block-cart-items:after{border-style:solid;border-width:0 0 1px;bottom:0;content:"";display:block;right:0;opacity:.3;pointer-events:none;position:absolute;left:0;top:0}.is-large.wc-block-cart .wc-block-cart-items th{padding:.25rem 0 .25rem 16px;white-space:nowrap}.is-large.wc-block-cart .wc-block-cart-items td{position:relative;padding:16px 16px 16px 0;vertical-align:top}.is-large.wc-block-cart .wc-block-cart-items td:after{border-style:solid;border-width:1px 0 0;bottom:0;content:"";display:block;right:0;opacity:.3;pointer-events:none;position:absolute;left:0;top:0}.is-large.wc-block-cart .wc-block-cart-items th:last-child{padding-left:0}.is-large.wc-block-cart .wc-block-cart-items td:last-child{padding-left:16px}.is-large.wc-block-cart .wc-block-components-radio-control__input{right:0}.is-large.wc-block-cart .wc-block-cart__totals-title{border:0;border-radius:0;margin:0;vertical-align:baseline;color:inherit;font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;letter-spacing:inherit;line-height:inherit;text-decoration:inherit;text-transform:inherit;box-shadow:none;display:inline;background:transparent;font-size:.75em;display:block;font-weight:600;padding:.25rem 0;text-align:left;text-transform:uppercase}.is-large.wc-block-cart .wc-block-components-sidebar .wc-block-components-shipping-calculator,.is-large.wc-block-cart .wc-block-components-sidebar .wc-block-components-shipping-rates-control__package:not(.wc-block-components-panel){padding-right:16px;padding-left:16px}.is-large.wc-block-cart .wc-block-cart__payment-options{padding:16px}.wp-block-woocommerce-cart.is-loading{display:none}.wp-block-woocommerce-cart{margin-bottom:3em}.wc-block-checkout-error{padding:40px;text-align:center;width:100%}.wc-block-checkout-error .wc-block-checkout-error__image{max-width:150px;margin:0 auto 1em;display:block;color:inherit}.wc-block-checkout-error .wc-block-checkout-error__title{display:block;margin:0;font-weight:700}.wc-block-checkout-error .wc-block-checkout-error__description{display:block;margin:.25em 0 1em}.wc-block-checkout-empty{padding:40px;text-align:center;width:100%}.wc-block-checkout-empty .wc-block-checkout-empty__image{max-width:150px;margin:0 auto 1em;display:block;color:inherit}.wc-block-checkout-empty .wc-block-checkout-empty__title{display:block;margin:0;font-weight:700}.wc-block-checkout-empty .wc-block-checkout-empty__description{display:block;margin:.25em 0 1em}.wc-block-checkout__actions{display:flex;justify-content:space-between;align-items:center}.wc-block-checkout__actions .wc-block-components-checkout-place-order-button{width:50%;padding:1em;height:auto}.wc-block-checkout__actions .wc-block-components-checkout-place-order-button .wc-block-components-button__text{line-height:24px}.wc-block-checkout__actions .wc-block-components-checkout-place-order-button .wc-block-components-button__text>svg{fill:#fff;vertical-align:top}.is-mobile .wc-block-checkout__actions .wc-block-components-checkout-return-to-cart-button{display:none}.is-mobile .wc-block-checkout__actions .wc-block-components-checkout-place-order-button{width:100%}.is-large .wc-block-checkout__actions{position:relative;padding:1.5em 0}.is-large .wc-block-checkout__actions:after{border-style:solid;border-width:1px 0 0;bottom:0;content:"";display:block;right:0;opacity:.3;pointer-events:none;position:absolute;left:0;top:0}.wc-block-checkout__form{margin:0;max-width:100%}.is-medium .wc-block-checkout__main,.is-mobile .wc-block-checkout__main,.is-small .wc-block-checkout__main{order:1}.is-large .wc-block-checkout__billing-fields .wc-block-components-address-form,.is-large .wc-block-checkout__shipping-fields .wc-block-components-address-form,.is-medium .wc-block-checkout__billing-fields .wc-block-components-address-form,.is-medium .wc-block-checkout__shipping-fields .wc-block-components-address-form,.is-small .wc-block-checkout__billing-fields .wc-block-components-address-form,.is-small .wc-block-checkout__shipping-fields .wc-block-components-address-form{margin-right:-6px;margin-left:-6px}.is-large .wc-block-checkout__billing-fields .wc-block-components-address-form:after,.is-large .wc-block-checkout__shipping-fields .wc-block-components-address-form:after,.is-medium .wc-block-checkout__billing-fields .wc-block-components-address-form:after,.is-medium .wc-block-checkout__shipping-fields .wc-block-components-address-form:after,.is-small .wc-block-checkout__billing-fields .wc-block-components-address-form:after,.is-small .wc-block-checkout__shipping-fields .wc-block-components-address-form:after{content:"";clear:both;display:block}.is-large .wc-block-checkout__billing-fields .wc-block-components-address-form .wc-block-components-country-input,.is-large .wc-block-checkout__billing-fields .wc-block-components-address-form .wc-block-components-state-input,.is-large .wc-block-checkout__billing-fields .wc-block-components-address-form .wc-block-components-text-input,.is-large .wc-block-checkout__shipping-fields .wc-block-components-address-form .wc-block-components-country-input,.is-large .wc-block-checkout__shipping-fields .wc-block-components-address-form .wc-block-components-state-input,.is-large .wc-block-checkout__shipping-fields .wc-block-components-address-form .wc-block-components-text-input,.is-medium .wc-block-checkout__billing-fields .wc-block-components-address-form .wc-block-components-country-input,.is-medium .wc-block-checkout__billing-fields .wc-block-components-address-form .wc-block-components-state-input,.is-medium .wc-block-checkout__billing-fields .wc-block-components-address-form .wc-block-components-text-input,.is-medium .wc-block-checkout__shipping-fields .wc-block-components-address-form .wc-block-components-country-input,.is-medium .wc-block-checkout__shipping-fields .wc-block-components-address-form .wc-block-components-state-input,.is-medium .wc-block-checkout__shipping-fields .wc-block-components-address-form .wc-block-components-text-input,.is-small .wc-block-checkout__billing-fields .wc-block-components-address-form .wc-block-components-country-input,.is-small .wc-block-checkout__billing-fields .wc-block-components-address-form .wc-block-components-state-input,.is-small .wc-block-checkout__billing-fields .wc-block-components-address-form .wc-block-components-text-input,.is-small .wc-block-checkout__shipping-fields .wc-block-components-address-form .wc-block-components-country-input,.is-small .wc-block-checkout__shipping-fields .wc-block-components-address-form .wc-block-components-state-input,.is-small .wc-block-checkout__shipping-fields .wc-block-components-address-form .wc-block-components-text-input{float:right;margin-right:6px;margin-left:6px;position:relative;width:calc(50% - 12px)}.is-large .wc-block-checkout__billing-fields .wc-block-components-address-form .wc-block-components-country-input:first-of-type,.is-large .wc-block-checkout__billing-fields .wc-block-components-address-form .wc-block-components-country-input:nth-of-type(2),.is-large .wc-block-checkout__billing-fields .wc-block-components-address-form .wc-block-components-state-input:first-of-type,.is-large .wc-block-checkout__billing-fields .wc-block-components-address-form .wc-block-components-state-input:nth-of-type(2),.is-large .wc-block-checkout__billing-fields .wc-block-components-address-form .wc-block-components-text-input:first-of-type,.is-large .wc-block-checkout__billing-fields .wc-block-components-address-form .wc-block-components-text-input:nth-of-type(2),.is-large .wc-block-checkout__shipping-fields .wc-block-components-address-form .wc-block-components-country-input:first-of-type,.is-large .wc-block-checkout__shipping-fields .wc-block-components-address-form .wc-block-components-country-input:nth-of-type(2),.is-large .wc-block-checkout__shipping-fields .wc-block-components-address-form .wc-block-components-state-input:first-of-type,.is-large .wc-block-checkout__shipping-fields .wc-block-components-address-form .wc-block-components-state-input:nth-of-type(2),.is-large .wc-block-checkout__shipping-fields .wc-block-components-address-form .wc-block-components-text-input:first-of-type,.is-large .wc-block-checkout__shipping-fields .wc-block-components-address-form .wc-block-components-text-input:nth-of-type(2),.is-medium .wc-block-checkout__billing-fields .wc-block-components-address-form .wc-block-components-country-input:first-of-type,.is-medium .wc-block-checkout__billing-fields .wc-block-components-address-form .wc-block-components-country-input:nth-of-type(2),.is-medium .wc-block-checkout__billing-fields .wc-block-components-address-form .wc-block-components-state-input:first-of-type,.is-medium .wc-block-checkout__billing-fields .wc-block-components-address-form .wc-block-components-state-input:nth-of-type(2),.is-medium .wc-block-checkout__billing-fields .wc-block-components-address-form .wc-block-components-text-input:first-of-type,.is-medium .wc-block-checkout__billing-fields .wc-block-components-address-form .wc-block-components-text-input:nth-of-type(2),.is-medium .wc-block-checkout__shipping-fields .wc-block-components-address-form .wc-block-components-country-input:first-of-type,.is-medium .wc-block-checkout__shipping-fields .wc-block-components-address-form .wc-block-components-country-input:nth-of-type(2),.is-medium .wc-block-checkout__shipping-fields .wc-block-components-address-form .wc-block-components-state-input:first-of-type,.is-medium .wc-block-checkout__shipping-fields .wc-block-components-address-form .wc-block-components-state-input:nth-of-type(2),.is-medium .wc-block-checkout__shipping-fields .wc-block-components-address-form .wc-block-components-text-input:first-of-type,.is-medium .wc-block-checkout__shipping-fields .wc-block-components-address-form .wc-block-components-text-input:nth-of-type(2),.is-small .wc-block-checkout__billing-fields .wc-block-components-address-form .wc-block-components-country-input:first-of-type,.is-small .wc-block-checkout__billing-fields .wc-block-components-address-form .wc-block-components-country-input:nth-of-type(2),.is-small .wc-block-checkout__billing-fields .wc-block-components-address-form .wc-block-components-state-input:first-of-type,.is-small .wc-block-checkout__billing-fields .wc-block-components-address-form .wc-block-components-state-input:nth-of-type(2),.is-small .wc-block-checkout__billing-fields .wc-block-components-address-form .wc-block-components-text-input:first-of-type,.is-small .wc-block-checkout__billing-fields .wc-block-components-address-form .wc-block-components-text-input:nth-of-type(2),.is-small .wc-block-checkout__shipping-fields .wc-block-components-address-form .wc-block-components-country-input:first-of-type,.is-small .wc-block-checkout__shipping-fields .wc-block-components-address-form .wc-block-components-country-input:nth-of-type(2),.is-small .wc-block-checkout__shipping-fields .wc-block-components-address-form .wc-block-components-state-input:first-of-type,.is-small .wc-block-checkout__shipping-fields .wc-block-components-address-form .wc-block-components-state-input:nth-of-type(2),.is-small .wc-block-checkout__shipping-fields .wc-block-components-address-form .wc-block-components-text-input:first-of-type,.is-small .wc-block-checkout__shipping-fields .wc-block-components-address-form .wc-block-components-text-input:nth-of-type(2){margin-top:0}.is-large .wc-block-checkout__billing-fields .wc-block-components-address-form .wc-block-components-address-form__address_1,.is-large .wc-block-checkout__billing-fields .wc-block-components-address-form .wc-block-components-address-form__address_2,.is-large .wc-block-checkout__billing-fields .wc-block-components-address-form .wc-block-components-address-form__company,.is-large .wc-block-checkout__shipping-fields .wc-block-components-address-form .wc-block-components-address-form__address_1,.is-large .wc-block-checkout__shipping-fields .wc-block-components-address-form .wc-block-components-address-form__address_2,.is-large .wc-block-checkout__shipping-fields .wc-block-components-address-form .wc-block-components-address-form__company,.is-medium .wc-block-checkout__billing-fields .wc-block-components-address-form .wc-block-components-address-form__address_1,.is-medium .wc-block-checkout__billing-fields .wc-block-components-address-form .wc-block-components-address-form__address_2,.is-medium .wc-block-checkout__billing-fields .wc-block-components-address-form .wc-block-components-address-form__company,.is-medium .wc-block-checkout__shipping-fields .wc-block-components-address-form .wc-block-components-address-form__address_1,.is-medium .wc-block-checkout__shipping-fields .wc-block-components-address-form .wc-block-components-address-form__address_2,.is-medium .wc-block-checkout__shipping-fields .wc-block-components-address-form .wc-block-components-address-form__company,.is-small .wc-block-checkout__billing-fields .wc-block-components-address-form .wc-block-components-address-form__address_1,.is-small .wc-block-checkout__billing-fields .wc-block-components-address-form .wc-block-components-address-form__address_2,.is-small .wc-block-checkout__billing-fields .wc-block-components-address-form .wc-block-components-address-form__company,.is-small .wc-block-checkout__shipping-fields .wc-block-components-address-form .wc-block-components-address-form__address_1,.is-small .wc-block-checkout__shipping-fields .wc-block-components-address-form .wc-block-components-address-form__address_2,.is-small .wc-block-checkout__shipping-fields .wc-block-components-address-form .wc-block-components-address-form__company{width:calc(100% - 12px)}.is-large .wc-block-checkout__billing-fields .wc-block-components-address-form .wc-block-components-checkbox,.is-large .wc-block-checkout__shipping-fields .wc-block-components-address-form .wc-block-components-checkbox,.is-medium .wc-block-checkout__billing-fields .wc-block-components-address-form .wc-block-components-checkbox,.is-medium .wc-block-checkout__shipping-fields .wc-block-components-address-form .wc-block-components-checkbox,.is-small .wc-block-checkout__billing-fields .wc-block-components-address-form .wc-block-components-checkbox,.is-small .wc-block-checkout__shipping-fields .wc-block-components-address-form .wc-block-components-checkbox{clear:both}.components-placeholder.wc-block-checkout__no-shipping-placeholder{margin-bottom:16px}.components-placeholder.wc-block-checkout__no-shipping-placeholder *{pointer-events:all}.components-placeholder.wc-block-checkout__no-shipping-placeholder .components-placeholder__fieldset{display:block}.components-placeholder.wc-block-checkout__no-shipping-placeholder .components-placeholder__fieldset .components-button{background-color:#1e1e1e;color:#fff}.components-placeholder.wc-block-checkout__no-shipping-placeholder .components-placeholder__fieldset .wc-block-checkout__no-shipping-placeholder-description{display:block;margin:.25em 0 1em}.wc-block-checkout__shipping-option .wc-block-components-radio-control__option{position:relative;margin:0;padding:.75em 2.5em .75em 0}.wc-block-checkout__shipping-option .wc-block-components-radio-control__option:after{border-style:solid;border-width:0 0 1px;bottom:0;content:"";display:block;right:0;opacity:.3;pointer-events:none;position:absolute;left:0;top:0}.wc-block-checkout__shipping-option .wc-block-components-shipping-rates-control__no-results-notice{margin:.75em 0}.wc-block-checkout__terms{margin:1.5em 0;text-align:justify}.wc-block-checkout__terms textarea{top:-5px;position:relative}.wc-block-checkout__terms.wc-block-checkout__terms--disabled{opacity:.6}.wc-block-checkout__sidebar .wc-block-components-product-name{display:block;color:inherit;flex-grow:1;flex-basis:0}.wc-block-checkout__sidebar .wc-block-components-totals-footer-item,.wc-block-checkout__sidebar .wc-block-components-totals-taxes{margin:0;padding:0}.is-medium .wc-block-checkout__sidebar,.is-mobile .wc-block-checkout__sidebar,.is-small .wc-block-checkout__sidebar{margin-bottom:24px;order:0}.wc-block-checkout__add-note{margin:1.5em 0}.is-medium .wc-block-checkout__add-note,.is-mobile .wc-block-checkout__add-note,.is-small .wc-block-checkout__add-note{position:relative;margin-bottom:1em;margin-top:1em;padding:1em 0}.is-medium .wc-block-checkout__add-note:after,.is-mobile .wc-block-checkout__add-note:after,.is-small .wc-block-checkout__add-note:after{border-style:solid;border-width:1px 0;bottom:0;content:"";display:block;right:0;opacity:.3;pointer-events:none;position:absolute;left:0;top:0}.wc-block-checkout__add-note .wc-block-components-textarea{margin-top:16px}.wc-block-checkout__order-notes.wc-block-components-checkout-step{padding-right:0}.wp-block-woocommerce-checkout{margin:0}.wp-block-woocommerce-checkout .with-scroll-to-top__scroll-point{top:-96px}.wp-block-woocommerce-checkout.is-loading{display:flex;flex-wrap:wrap;margin:0 auto 16px;position:relative}.wp-block-woocommerce-checkout.is-loading .wp-block-woocommerce-checkout-totals-block{width:35%;padding-right:2.2641509434%}.wp-block-woocommerce-checkout.is-loading .wp-block-woocommerce-checkout-fields-block{width:65%;padding-left:3.7735849057%}.wp-block-woocommerce-checkout.is-loading .wp-block-woocommerce-checkout-fields-block,.wp-block-woocommerce-checkout.is-loading .wp-block-woocommerce-checkout-totals-block{box-sizing:border-box;margin:0}.wp-block-woocommerce-checkout.is-loading .wp-block-woocommerce-checkout-fields-block>div,.wp-block-woocommerce-checkout.is-loading .wp-block-woocommerce-checkout-totals-block>div{-webkit-animation:loading-fade 1.2s ease-in-out infinite;animation:loading-fade 1.2s ease-in-out infinite;background-color:var(--global--color-primary,#e0e0e0)!important;color:var(--global--color-primary,#e0e0e0)!important;outline:0!important;border:0!important;box-shadow:none;pointer-events:none;max-width:100%;margin:0 0 1.5em;display:none}.wp-block-woocommerce-checkout.is-loading .wp-block-woocommerce-checkout-fields-block>div>*,.wp-block-woocommerce-checkout.is-loading .wp-block-woocommerce-checkout-totals-block>div>*{visibility:hidden}@media screen and (prefers-reduced-motion:reduce){.wp-block-woocommerce-checkout.is-loading .wp-block-woocommerce-checkout-fields-block>div,.wp-block-woocommerce-checkout.is-loading .wp-block-woocommerce-checkout-totals-block>div{-webkit-animation:none;animation:none}}.wp-block-woocommerce-checkout.is-loading .wp-block-woocommerce-checkout-fields-block .wp-block-woocommerce-checkout-contact-information-block,.wp-block-woocommerce-checkout.is-loading .wp-block-woocommerce-checkout-fields-block .wp-block-woocommerce-checkout-payment-block,.wp-block-woocommerce-checkout.is-loading .wp-block-woocommerce-checkout-totals-block .wp-block-woocommerce-checkout-contact-information-block,.wp-block-woocommerce-checkout.is-loading .wp-block-woocommerce-checkout-totals-block .wp-block-woocommerce-checkout-payment-block{min-height:10em;display:block}.wp-block-woocommerce-checkout.is-loading .wp-block-woocommerce-checkout-fields-block .wp-block-woocommerce-checkout-shipping-address-block,.wp-block-woocommerce-checkout.is-loading .wp-block-woocommerce-checkout-totals-block .wp-block-woocommerce-checkout-shipping-address-block{min-height:24em;display:block}.wp-block-woocommerce-checkout.is-loading .wp-block-woocommerce-checkout-fields-block .wp-block-woocommerce-checkout-actions-block,.wp-block-woocommerce-checkout.is-loading .wp-block-woocommerce-checkout-totals-block .wp-block-woocommerce-checkout-actions-block{width:50%;min-height:4em;margin-right:50%;display:block}.wp-block-woocommerce-checkout.is-loading .wp-block-woocommerce-checkout-fields-block .wp-block-woocommerce-checkout-order-summary-block,.wp-block-woocommerce-checkout.is-loading .wp-block-woocommerce-checkout-totals-block .wp-block-woocommerce-checkout-order-summary-block{min-height:47em;display:block}.wp-block-woocommerce-checkout.is-loading .wp-block-woocommerce-checkout-fields-block .wc-block-components-panel>h2,.wp-block-woocommerce-checkout.is-loading .wp-block-woocommerce-checkout-totals-block .wc-block-components-panel>h2{font-size:1em;border:0;border-radius:0;margin:0;padding:0;vertical-align:baseline;color:inherit;font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;letter-spacing:inherit;line-height:inherit;text-decoration:inherit;text-transform:inherit}.wp-block-woocommerce-checkout.is-loading .wp-block-woocommerce-checkout-fields-block .wc-block-components-panel>h2 .wc-block-components-panel__button,.wp-block-woocommerce-checkout.is-loading .wp-block-woocommerce-checkout-totals-block .wc-block-components-panel>h2 .wc-block-components-panel__button{font-weight:400}.wp-block-woocommerce-checkout.is-loading .wp-block-woocommerce-checkout-fields-block .wc-block-components-panel,.wp-block-woocommerce-checkout.is-loading .wp-block-woocommerce-checkout-fields-block .wc-block-components-totals-item,.wp-block-woocommerce-checkout.is-loading .wp-block-woocommerce-checkout-totals-block .wc-block-components-panel,.wp-block-woocommerce-checkout.is-loading .wp-block-woocommerce-checkout-totals-block .wc-block-components-totals-item{padding-right:16px;padding-left:16px}@media only screen and (max-width:700px){.wp-block-woocommerce-checkout.is-loading{flex-direction:column;margin:0 auto 16px}.wp-block-woocommerce-checkout.is-loading .wp-block-woocommerce-checkout-fields-block,.wp-block-woocommerce-checkout.is-loading .wp-block-woocommerce-checkout-totals-block{padding:0;width:100%}.wp-block-woocommerce-checkout.is-loading .wp-block-woocommerce-checkout-totals-block .wc-block-components-panel,.wp-block-woocommerce-checkout.is-loading .wp-block-woocommerce-checkout-totals-block .wc-block-components-totals-item{padding-right:0;padding-left:0}}.theme-twentytwenty .wp-block-woocommerce-checkout.is-loading .wp-block-woocommerce-checkout-totals-block .wc-block-components-panel>h2{font-size:1.25em;border:0;border-radius:0;margin:0;padding:0;vertical-align:baseline}.modal-open .wc-block-mini-cart__button{pointer-events:none}.wc-block-mini-cart__drawer{font-size:1rem}.wc-block-components-express-payment{margin:auto;position:relative}.wc-block-components-express-payment .wc-block-components-express-payment__event-buttons{list-style:none;display:flex;flex-direction:row;flex-wrap:wrap;width:100%;padding:0;margin:0;overflow:hidden;text-align:center}.wc-block-components-express-payment .wc-block-components-express-payment__event-buttons>li{margin:0}.wc-block-components-express-payment .wc-block-components-express-payment__event-buttons>li>img{width:100%;height:48px}.wc-block-components-express-payment--checkout{margin-top:5px}.wc-block-components-express-payment--checkout .wc-block-components-express-payment__title-container{display:flex;flex-direction:row;right:0;position:absolute;left:0;top:-5px;vertical-align:middle}.wc-block-components-express-payment--checkout .wc-block-components-express-payment__title-container:before{border-right:1px solid;border-top:1px solid;border-radius:0 5px 0 0;content:"";display:block;height:4px;margin-left:12px;opacity:.3;pointer-events:none;width:10px}.wc-block-components-express-payment--checkout .wc-block-components-express-payment__title-container:after{border-left:1px solid;border-top:1px solid;border-radius:5px 0 0 0;content:"";display:block;height:4px;margin-right:12px;opacity:.3;pointer-events:none;flex-grow:1}.wc-block-components-express-payment--checkout .wc-block-components-express-payment__title{flex-grow:0;transform:translateY(-50%)}.wc-block-components-express-payment--checkout .wc-block-components-express-payment__content{position:relative;padding:1.5em 23px}.wc-block-components-express-payment--checkout .wc-block-components-express-payment__content:after{border-style:solid;border-width:0 1px 1px;bottom:0;content:"";display:block;right:0;opacity:.3;pointer-events:none;position:absolute;left:0;top:0;border-radius:0 0 5px 5px}.wc-block-components-express-payment--checkout .wc-block-components-express-payment__content>p{margin-bottom:1em}.wc-block-components-express-payment--checkout .wc-block-components-express-payment__event-buttons>li{display:inline-block;width:50%}.wc-block-components-express-payment--checkout .wc-block-components-express-payment__event-buttons>li:nth-child(2n){padding-right:8px}.wc-block-components-express-payment--checkout .wc-block-components-express-payment__event-buttons>li:nth-child(odd){padding-left:8px}.wc-block-components-express-payment--cart .wc-block-components-express-payment__event-buttons>li{padding-bottom:16px;text-align:center;width:100%}.wc-block-components-express-payment--cart .wc-block-components-express-payment__event-buttons>li:last-child{padding-bottom:0}.wc-block-components-express-payment-continue-rule{display:flex;align-items:center;text-align:center;padding:0 24px;margin:24px 0}.wc-block-components-express-payment-continue-rule:before{margin-left:10px}.wc-block-components-express-payment-continue-rule:after{margin-right:10px}.wc-block-components-express-payment-continue-rule:after,.wc-block-components-express-payment-continue-rule:before{content:" ";flex:1;border-bottom:1px solid;opacity:.3}.wc-block-components-express-payment-continue-rule--cart{margin:16px 0;text-transform:uppercase}.theme-twentynineteen .wc-block-components-express-payment__title:before{display:none}.theme-twentytwenty .wc-block-components-express-payment .wc-block-components-express-payment__title{padding-right:12px;padding-left:12px}.components-placeholder.wc-block-checkout__no-payment-methods-placeholder{margin-bottom:16px}.components-placeholder.wc-block-checkout__no-payment-methods-placeholder *{pointer-events:all}.components-placeholder.wc-block-checkout__no-payment-methods-placeholder .components-placeholder__fieldset{display:block}.components-placeholder.wc-block-checkout__no-payment-methods-placeholder .components-placeholder__fieldset .components-button{background-color:#1e1e1e;color:#fff}.components-placeholder.wc-block-checkout__no-payment-methods-placeholder .components-placeholder__fieldset .wc-block-checkout__no-payment-methods-placeholder-description{display:block;margin:.25em 0 1em}.components-notice.wc-block-checkout__no-payment-methods-notice{margin-bottom:16px}.wc-block-card-elements{display:flex;width:100%}.wc-block-card-elements .wc-block-components-validation-error{position:static}.wc-block-gateway-container{position:relative;margin-bottom:1.5em;white-space:nowrap}.wc-block-gateway-container.wc-card-number-element{flex-basis:15em;flex-grow:1;min-width:min(15em,60%)}.wc-block-gateway-container.wc-card-expiry-element{flex-basis:7em;margin-right:12px;min-width:min(7em,calc(24% - 12px))}.wc-block-gateway-container.wc-card-cvc-element{flex-basis:7em;margin-right:12px;min-width:min(5em,calc(16% - 12px))}.wc-block-gateway-container .wc-block-gateway-input{font-size:1em;line-height:1.375;background-color:#fff;padding:.75em 16px .75em 0;border-radius:4px;border:1px solid #50575e;width:100%;font-family:inherit;margin:0;box-sizing:border-box;height:3em;color:#2b2d2f;cursor:text}.wc-block-gateway-container .wc-block-gateway-input:focus,.wc-block-gateway-container:focus{background-color:#fff}.wc-block-gateway-container label{color:inherit;font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;letter-spacing:inherit;line-height:inherit;text-decoration:inherit;text-transform:inherit;font-size:1em;line-height:1.375;position:absolute;transform:translateY(.75em);right:0;top:0;transform-origin:top right;color:#757575;transition:transform .2s ease;margin:0 17px 0 0;overflow:hidden;text-overflow:ellipsis;max-width:calc(100% - 24px);cursor:text}@media screen and (prefers-reduced-motion:reduce){.wc-block-gateway-container label{transition:none}}.wc-block-gateway-container.wc-inline-card-element label{margin-right:calc(24px + 1.5em)}.wc-block-gateway-container.wc-inline-card-element .wc-block-gateway-input.focused.empty+label,.wc-block-gateway-container.wc-inline-card-element .wc-block-gateway-input:not(.empty)+label{margin-right:16px;transform:translateY(4px) scale(.75)}.wc-block-gateway-container.wc-inline-card-element+.wc-block-components-validation-error{position:static;margin-top:-24px}.wc-block-gateway-container .wc-block-gateway-input.focused.empty,.wc-block-gateway-container .wc-block-gateway-input:not(.empty){padding:1.5em 16px .25em 0}.wc-block-gateway-container .wc-block-gateway-input.focused.empty+label,.wc-block-gateway-container .wc-block-gateway-input:not(.empty)+label{transform:translateY(4px) scale(.75)}.wc-block-gateway-container .wc-block-gateway-input.has-error{border-color:#cc1818}.wc-block-gateway-container .wc-block-gateway-input.has-error:focus{outline-color:#cc1818}.wc-block-gateway-container .wc-block-gateway-input.has-error+label{color:#cc1818}.is-large .wc-card-cvc-element .wc-block-components-validation-error>p,.is-large .wc-card-expiry-element .wc-block-components-validation-error>p,.is-medium .wc-card-cvc-element .wc-block-components-validation-error>p,.is-medium .wc-card-expiry-element .wc-block-components-validation-error>p{line-height:16px;padding-top:4px}.is-mobile .wc-card-cvc-element .wc-block-components-validation-error>p,.is-mobile .wc-card-expiry-element .wc-block-components-validation-error>p,.is-small .wc-card-cvc-element .wc-block-components-validation-error>p,.is-small .wc-card-expiry-element .wc-block-components-validation-error>p{min-height:28px}.wc-block-components-checkout-payment-methods *{pointer-events:all}.is-mobile .wc-block-card-elements,.is-small .wc-block-card-elements{flex-wrap:wrap}.is-mobile .wc-block-gateway-container.wc-card-number-element,.is-small .wc-block-gateway-container.wc-card-number-element{flex-basis:100%}.is-mobile .wc-block-gateway-container.wc-card-expiry-element,.is-small .wc-block-gateway-container.wc-card-expiry-element{flex-basis:calc(50% - 8px);margin-right:0;margin-left:8px}.is-mobile .wc-block-gateway-container.wc-card-cvc-element,.is-small .wc-block-gateway-container.wc-card-cvc-element{flex-basis:calc(50% - 8px);margin-right:8px}.wc-block-checkout__payment-method .wc-block-components-radio-control__option{padding-right:56px}.wc-block-checkout__payment-method .wc-block-components-radio-control__option:after{content:none}.wc-block-checkout__payment-method .wc-block-components-radio-control__option .wc-block-components-radio-control__input{right:16px}.wc-block-checkout__payment-method .wc-block-components-radio-control__option,.wc-block-checkout__payment-method .wc-block-components-radio-control__option:first-child,.wc-block-checkout__payment-method .wc-block-components-radio-control__option:last-child{margin:0;padding-bottom:1em;padding-top:1em}.wc-block-checkout__payment-method .wc-block-components-radio-control__option-checked{font-weight:700}.wc-block-checkout__payment-method .wc-block-components-radio-control-accordion-option,.wc-block-checkout__payment-method .wc-block-components-radio-control__option{position:relative}.wc-block-checkout__payment-method .wc-block-components-radio-control-accordion-option:after,.wc-block-checkout__payment-method .wc-block-components-radio-control__option:after{border-style:solid;border-width:1px 1px 0;bottom:0;content:"";display:block;right:0;opacity:.3;pointer-events:none;position:absolute;left:0;top:0}.wc-block-checkout__payment-method .wc-block-components-radio-control-accordion-option:last-child:after,.wc-block-checkout__payment-method .wc-block-components-radio-control__option:last-child:after{border-width:1px}.wc-block-checkout__payment-method .wc-block-components-radio-control-accordion-option .wc-block-components-radio-control__option:after{border-width:0}.wc-block-checkout__payment-method .wc-block-components-radio-control-accordion-option .wc-block-components-radio-control__label{display:flex;align-items:center;justify-content:flex-start}.wc-block-checkout__payment-method .wc-block-components-radio-control-accordion-option .wc-block-components-radio-control__label img{height:24px;max-height:24px;-o-object-fit:contain;object-fit:contain;-o-object-position:left;object-position:left}.wc-block-checkout__payment-method .wc-block-components-radio-control.disable-radio-control .wc-block-components-radio-control__option{padding-right:16px}.wc-block-checkout__payment-method .wc-block-components-radio-control.disable-radio-control .wc-block-components-radio-control__input{display:none}.wc-block-checkout__payment-method .wc-block-components-checkout-step__description-payments-aligned{padding-top:14px;height:28px}.wc-block-components-radio-control-accordion-content{padding:0 16px 1em}.wc-block-components-radio-control-accordion-content:empty{display:none}.wc-block-checkout__order-notes .wc-block-components-checkout-step__content{padding-bottom:0}.wc-block-components-panel.has-border{position:relative}.wc-block-components-panel.has-border:after{border-style:solid;border-width:1px 0;bottom:0;content:"";display:block;right:0;opacity:.3;pointer-events:none;position:absolute;left:0;top:0}.wc-block-components-panel.has-border+.wc-block-components-panel.has-border:after{border-top-width:0}.wc-block-components-panel.has-border.no-top-border{position:relative}.wc-block-components-panel.has-border.no-top-border:after{border-style:solid;bottom:0;content:"";display:block;right:0;opacity:.3;pointer-events:none;position:absolute;left:0;top:0;border-width:0 0 1px}.wc-block-components-panel__button{border:0;border-radius:0;vertical-align:baseline;height:auto;line-height:1;margin:.375em 0 0;padding:.375em 0 0 32px;position:relative;text-align:right;width:100%;word-break:break-word}.wc-block-components-panel__button[aria-expanded=true]{padding-bottom:.375em;margin-bottom:.375em}.wc-block-components-panel__button,.wc-block-components-panel__button:active,.wc-block-components-panel__button:focus,.wc-block-components-panel__button:hover{color:inherit;font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;letter-spacing:inherit;line-height:inherit;text-decoration:inherit;text-transform:inherit;background:transparent;box-shadow:none}.wc-block-components-panel__button>.wc-block-components-panel__button-icon{fill:currentColor;position:absolute;left:0;top:50%;transform:translateY(-50%);width:auto}.wc-block-components-panel__content{padding-bottom:1em}.wc-block-components-panel__content[hidden]{display:none}.theme-twentytwentyone.theme-twentytwentyone.theme-twentytwentyone .wc-block-components-panel__button{background-color:inherit;color:inherit}.theme-twentyseventeen .wc-block-components-panel__button,.theme-twentytwenty .wc-block-components-panel__button{background:none transparent;color:inherit}.theme-twentyseventeen .wc-block-components-panel__button.wc-block-components-panel__button:focus,.theme-twentyseventeen .wc-block-components-panel__button.wc-block-components-panel__button:hover,.theme-twentytwenty .wc-block-components-panel__button.wc-block-components-panel__button:focus,.theme-twentytwenty .wc-block-components-panel__button.wc-block-components-panel__button:hover{background:none transparent}.wc-block-components-totals-item{display:flex;flex-wrap:wrap;margin:.75em 0 0;width:100%}.wc-block-components-totals-item:first-child{margin-top:0}.wc-block-components-totals-item__label{flex-grow:1}.wc-block-components-totals-item__value{font-weight:700;white-space:nowrap}.wc-block-components-totals-item__description{font-size:.875em;width:100%}.wc-block-components-totals-item.wc-block-components-totals-taxes__grouped-rate{margin:4px 0}.wc-block-components-totals-item.wc-block-components-totals-taxes__grouped-rate:first-child{margin-top:0}.wc-block-components-totals-item.wc-block-components-totals-taxes__grouped-rate:last-child{margin-bottom:0}.wc-block-components-totals-wrapper{position:relative;padding:16px 0}.wc-block-components-totals-wrapper:after{border-style:solid;border-width:1px 0 0;bottom:0;content:"";display:block;right:0;opacity:.3;pointer-events:none;position:absolute;left:0;top:0}.wc-block-components-totals-wrapper.has-bottom-border:after{border-bottom-width:1px}.wc-block-components-totals-wrapper.slot-wrapper{padding:0}.wc-block-components-totals-wrapper.slot-wrapper>*>*{position:relative;padding:16px 0}.wc-block-components-totals-wrapper.slot-wrapper>*>:after{border-style:solid;border-width:0 0 1px;bottom:0;content:"";display:block;right:0;opacity:.3;pointer-events:none;position:absolute;left:0;top:0}.wc-block-components-totals-wrapper.slot-wrapper>*>:last-child:after{border-bottom-width:0}.wc-block-components-discounts-meta .wc-block-components-totals-wrapper:first-child{position:relative}.wc-block-components-discounts-meta .wc-block-components-totals-wrapper:first-child:after{border-style:solid;border-width:1px 0 0;bottom:0;content:"";display:block;right:0;opacity:.3;pointer-events:none;position:absolute;left:0;top:0}.wc-block-product-categories{margin-bottom:1em}.wc-block-product-categories.is-dropdown{display:flex}.wc-block-product-categories select{margin-left:.5em}.wc-block-product-categories-list--has-images{list-style:none outside}.wc-block-product-categories-list--has-images .wc-block-product-categories-list-item{margin:4px 60px 4px 0;list-style:none outside;clear:both}.wc-block-product-categories-list--has-images .wc-block-product-categories-list-item ul{margin:4px 0 0}.wc-block-product-categories-list--has-images .wc-block-product-categories-list-item__image{max-width:50px;display:inline-block;padding:0;margin:0 -60px 0 .5em;position:relative;vertical-align:middle;border:1px solid #eee}.wc-block-product-categories-list--has-images .wc-block-product-categories-list-item__image img{display:block;height:auto;margin:0;max-width:100%;padding:0}.wc-block-product-categories-list-item-count:before{content:" ("}.wc-block-product-categories-list-item-count:after{content:")"}.wp-block-woocommerce-product-categories.is-loading .wc-block-product-categories__placeholder{display:inline-block;height:1em;width:50%;min-width:200px;background:currentColor;opacity:.2}.wc-block-product-categories__button{display:flex;align-items:center;margin:0;padding:0 .5em;position:relative;overflow:hidden}.wc-block-product-categories__button svg{fill:currentColor;outline:none}.rtl .wc-block-product-categories__button svg{transform:rotate(-180deg)}.wc-block-product-categories__button:active{color:currentColor}.wc-block-product-categories__button:disabled,.wc-block-product-categories__button[aria-disabled=true]{cursor:default;opacity:.3}.wc-block-product-categories__button:disabled:focus,.wc-block-product-categories__button[aria-disabled=true]:focus{box-shadow:none}.wc-block-featured-product{position:relative;background-color:#1e1e1e;background-size:cover;background-position:50%;width:100%;margin:0 0 1.5em}.wc-block-featured-product,.wc-block-featured-product .wc-block-featured-product__wrapper{display:flex;justify-content:center;align-items:center;flex-wrap:wrap;align-content:center}.wc-block-featured-product .wc-block-featured-product__wrapper{overflow:hidden;height:100%}.wc-block-featured-product.has-left-content{justify-content:flex-start}.wc-block-featured-product.has-left-content .wc-block-featured-product__description,.wc-block-featured-product.has-left-content .wc-block-featured-product__price,.wc-block-featured-product.has-left-content .wc-block-featured-product__title,.wc-block-featured-product.has-left-content .wc-block-featured-product__variation{margin-right:0;text-align:right}.wc-block-featured-product.has-right-content{justify-content:flex-end}.wc-block-featured-product.has-right-content .wc-block-featured-product__description,.wc-block-featured-product.has-right-content .wc-block-featured-product__price,.wc-block-featured-product.has-right-content .wc-block-featured-product__title,.wc-block-featured-product.has-right-content .wc-block-featured-product__variation{margin-left:0;text-align:left}.wc-block-featured-product .wc-block-featured-product__description,.wc-block-featured-product .wc-block-featured-product__price,.wc-block-featured-product .wc-block-featured-product__title,.wc-block-featured-product .wc-block-featured-product__variation{color:#fff;line-height:1.25;margin-bottom:0;text-align:center}.wc-block-featured-product .wc-block-featured-product__description a,.wc-block-featured-product .wc-block-featured-product__description a:active,.wc-block-featured-product .wc-block-featured-product__description a:focus,.wc-block-featured-product .wc-block-featured-product__description a:hover,.wc-block-featured-product .wc-block-featured-product__price a,.wc-block-featured-product .wc-block-featured-product__price a:active,.wc-block-featured-product .wc-block-featured-product__price a:focus,.wc-block-featured-product .wc-block-featured-product__price a:hover,.wc-block-featured-product .wc-block-featured-product__title a,.wc-block-featured-product .wc-block-featured-product__title a:active,.wc-block-featured-product .wc-block-featured-product__title a:focus,.wc-block-featured-product .wc-block-featured-product__title a:hover,.wc-block-featured-product .wc-block-featured-product__variation a,.wc-block-featured-product .wc-block-featured-product__variation a:active,.wc-block-featured-product .wc-block-featured-product__variation a:focus,.wc-block-featured-product .wc-block-featured-product__variation a:hover{color:#fff}.wc-block-featured-product .wc-block-featured-product__description,.wc-block-featured-product .wc-block-featured-product__link,.wc-block-featured-product .wc-block-featured-product__price,.wc-block-featured-product .wc-block-featured-product__title,.wc-block-featured-product .wc-block-featured-product__variation{width:100%;padding:16px 48px 0;z-index:1}.wc-block-featured-product .wc-block-featured-product__title,.wc-block-featured-product .wc-block-featured-product__variation{margin-top:0;border:0}.wc-block-featured-product .wc-block-featured-product__title:before,.wc-block-featured-product .wc-block-featured-product__variation:before{display:none}.wc-block-featured-product .wc-block-featured-product__variation{font-style:italic;padding-top:0}.wc-block-featured-product .wc-block-featured-product__description p{margin:0;line-height:1.5em}.wc-block-featured-product .wp-block-button.aligncenter{text-align:center}.wc-block-featured-product.has-background-dim:before{content:"";position:absolute;top:0;right:0;bottom:0;left:0;background-color:inherit;opacity:.5;z-index:1}.wc-block-featured-product.has-background-dim.has-background-dim-10:before{opacity:.1}.wc-block-featured-product.has-background-dim.has-background-dim-20:before{opacity:.2}.wc-block-featured-product.has-background-dim.has-background-dim-30:before{opacity:.3}.wc-block-featured-product.has-background-dim.has-background-dim-40:before{opacity:.4}.wc-block-featured-product.has-background-dim.has-background-dim-50:before{opacity:.5}.wc-block-featured-product.has-background-dim.has-background-dim-60:before{opacity:.6}.wc-block-featured-product.has-background-dim.has-background-dim-70:before{opacity:.7}.wc-block-featured-product.has-background-dim.has-background-dim-80:before{opacity:.8}.wc-block-featured-product.has-background-dim.has-background-dim-90:before{opacity:.9}.wc-block-featured-product.has-background-dim.has-background-dim-100:before{opacity:1}.wc-block-featured-product.alignleft,.wc-block-featured-product.alignright{max-width:290px;width:100%}.wc-block-featured-product:after{display:block;content:"";font-size:0;min-height:inherit}@supports((position:-webkit-sticky) or (position:sticky)){.wc-block-featured-product:after{content:none}}.wc-block-featured-product.aligncenter,.wc-block-featured-product.alignleft,.wc-block-featured-product.alignright,.wc-block-product-search .wc-block-product-search__fields{display:flex}.wc-block-product-search .wc-block-product-search__field{padding:6px 8px;line-height:1.8;flex-grow:1}.wc-block-product-search .wc-block-product-search__button{display:flex;align-items:center;margin:0 6px 0 0;cursor:pointer;padding:0 .5em;position:relative;overflow:hidden}.wc-block-product-search .wc-block-product-search__button svg{fill:currentColor;outline:none}.rtl .wc-block-product-search .wc-block-product-search__button svg{transform:rotate(-180deg)}.wc-block-product-search .wc-block-product-search__button:active{color:currentColor}.wc-block-product-search .wc-block-product-search__button:disabled,.wc-block-product-search .wc-block-product-search__button[aria-disabled=true]{cursor:default;opacity:.3}.wc-block-product-search .wc-block-product-search__button:disabled:focus,.wc-block-product-search .wc-block-product-search__button[aria-disabled=true]:focus{box-shadow:none}.wc-block-featured-category{position:relative;background-color:#1e1e1e;background-size:cover;background-position:50%;width:100%;margin:0 0 1.5em;display:flex;justify-content:center;align-items:center;flex-wrap:wrap;align-content:center}.wc-block-featured-category .wc-block-featured-category__wrapper{overflow:hidden;height:100%;display:flex;justify-content:center;align-items:center;flex-wrap:wrap;align-content:center}.wc-block-featured-category.has-left-content{justify-content:flex-start}.wc-block-featured-category.has-left-content .wc-block-featured-category__description,.wc-block-featured-category.has-left-content .wc-block-featured-category__price,.wc-block-featured-category.has-left-content .wc-block-featured-category__title{margin-right:0;text-align:right}.wc-block-featured-category.has-right-content{justify-content:flex-end}.wc-block-featured-category.has-right-content .wc-block-featured-category__description,.wc-block-featured-category.has-right-content .wc-block-featured-category__price,.wc-block-featured-category.has-right-content .wc-block-featured-category__title{margin-left:0;text-align:left}.wc-block-featured-category .wc-block-featured-category__description,.wc-block-featured-category .wc-block-featured-category__price,.wc-block-featured-category .wc-block-featured-category__title{color:#fff;line-height:1.25;margin-bottom:0;text-align:center}.wc-block-featured-category .wc-block-featured-category__description a,.wc-block-featured-category .wc-block-featured-category__description a:active,.wc-block-featured-category .wc-block-featured-category__description a:focus,.wc-block-featured-category .wc-block-featured-category__description a:hover,.wc-block-featured-category .wc-block-featured-category__price a,.wc-block-featured-category .wc-block-featured-category__price a:active,.wc-block-featured-category .wc-block-featured-category__price a:focus,.wc-block-featured-category .wc-block-featured-category__price a:hover,.wc-block-featured-category .wc-block-featured-category__title a,.wc-block-featured-category .wc-block-featured-category__title a:active,.wc-block-featured-category .wc-block-featured-category__title a:focus,.wc-block-featured-category .wc-block-featured-category__title a:hover{color:#fff}.wc-block-featured-category .wc-block-featured-category__description,.wc-block-featured-category .wc-block-featured-category__link,.wc-block-featured-category .wc-block-featured-category__price,.wc-block-featured-category .wc-block-featured-category__title{width:100%;padding:0 48px 16px;z-index:1}.wc-block-featured-category .wc-block-featured-category__title{margin-top:0}.wc-block-featured-category .wc-block-featured-category__title:before{display:none}.wc-block-featured-category .wc-block-featured-category__description p{margin:0}.wc-block-featured-category .wp-block-button.aligncenter{text-align:center}.wc-block-featured-category.has-background-dim:before{content:"";position:absolute;top:0;right:0;bottom:0;left:0;background-color:inherit;opacity:.5;z-index:1}.wc-block-featured-category.has-background-dim.has-background-dim-10:before{opacity:.1}.wc-block-featured-category.has-background-dim.has-background-dim-20:before{opacity:.2}.wc-block-featured-category.has-background-dim.has-background-dim-30:before{opacity:.3}.wc-block-featured-category.has-background-dim.has-background-dim-40:before{opacity:.4}.wc-block-featured-category.has-background-dim.has-background-dim-50:before{opacity:.5}.wc-block-featured-category.has-background-dim.has-background-dim-60:before{opacity:.6}.wc-block-featured-category.has-background-dim.has-background-dim-70:before{opacity:.7}.wc-block-featured-category.has-background-dim.has-background-dim-80:before{opacity:.8}.wc-block-featured-category.has-background-dim.has-background-dim-90:before{opacity:.9}.wc-block-featured-category.has-background-dim.has-background-dim-100:before{opacity:1}.wc-block-featured-category.alignleft,.wc-block-featured-category.alignright{max-width:290px;width:100%}.wc-block-featured-category:after{display:block;content:"";font-size:0;min-height:inherit}@supports((position:-webkit-sticky) or (position:sticky)){.wc-block-featured-category:after{content:none}}.wc-block-featured-category.aligncenter,.wc-block-featured-category.alignleft,.wc-block-featured-category.alignright{display:flex}.wc-block-attribute-filter{margin-bottom:24px}.wc-block-attribute-filter.style-dropdown{display:flex;gap:16px}.wc-block-attribute-filter .wc-block-attribute-filter-list{margin:0;width:100%}.wc-block-attribute-filter .wc-block-attribute-filter-list li{text-decoration:underline}.wc-block-attribute-filter .wc-block-attribute-filter-list li label{cursor:pointer}.wc-block-attribute-filter .wc-block-attribute-filter-list li input{cursor:pointer;display:inline-block}.wc-block-attribute-filter .wc-block-attribute-filter-dropdown{flex-grow:1;max-width:unset;width:0}.wc-block-attribute-filter .is-single .wc-block-attribute-filter-list-count,.wc-block-attribute-filter .wc-block-dropdown-selector .wc-block-dropdown-selector__list .wc-block-attribute-filter-list-count{opacity:.6}.wc-block-attribute-filter .wc-block-components-dropdown-selector__input-wrapper{height:100%}.wc-block-stock-filter{margin-bottom:24px}.wc-block-stock-filter .wc-block-stock-filter-list{margin:0}.wc-block-stock-filter .wc-block-stock-filter-list li{text-decoration:underline}.wc-block-stock-filter .wc-block-stock-filter-list li label{cursor:pointer}.wc-block-stock-filter .wc-block-stock-filter-list li input{cursor:pointer;display:inline-block}.wc-block-stock-filter .is-single,.wc-block-stock-filter .wc-block-dropdown-selector .wc-block-dropdown-selector__list{opacity:.6}.wc-block-stock-filter .wc-block-stock-filter__button{margin-top:8px}@-webkit-keyframes loading-fade{0%{opacity:.7}50%{opacity:1}to{opacity:.7}}@keyframes loading-fade{0%{opacity:.7}50%{opacity:1}to{opacity:.7}}.wc-block-active-filters{margin-bottom:24px;overflow:hidden}.wc-block-active-filters .wc-block-active-filters__clear-all{font-size:1em;float:left;border:none;padding:0;text-decoration:underline;cursor:pointer}.wc-block-active-filters .wc-block-active-filters__clear-all,.wc-block-active-filters .wc-block-active-filters__clear-all:active,.wc-block-active-filters .wc-block-active-filters__clear-all:focus,.wc-block-active-filters .wc-block-active-filters__clear-all:hover{background:transparent;color:inherit}.wc-block-active-filters .wc-block-active-filters__list{margin:0 0 4px;padding:0;list-style:none outside;clear:both}.wc-block-active-filters .wc-block-active-filters__list li{margin:0;padding:0;list-style:none outside;clear:both}.wc-block-active-filters .wc-block-active-filters__list li ul{margin:0;padding:0;list-style:none outside}.wc-block-active-filters .wc-block-active-filters__list li:first-child .wc-block-active-filters__list-item-type{margin:0}.wc-block-active-filters .wc-block-active-filters__list-item-type{font-size:.75em;text-transform:uppercase;letter-spacing:.1em;margin:16px 0 0;display:block}.wc-block-active-filters .wc-block-active-filters__list-item-operator{font-weight:400;font-style:italic}.wc-block-active-filters .wc-block-active-filters__list-item-name{font-weight:700;display:block;position:relative;padding:0 0 0 16px}.wc-block-active-filters .wc-block-active-filters__list-item-remove{background:transparent;border:0;-webkit-appearance:none;-moz-appearance:none;appearance:none;height:16px;width:16px;padding:0;position:absolute;left:0;top:50%;margin:-8px 0 0;color:currentColor}.wc-block-active-filters .wc-block-active-filters__list--chips li,.wc-block-active-filters .wc-block-active-filters__list--chips ul{display:inline}.wc-block-active-filters .wc-block-active-filters__list--chips .wc-block-active-filters__list-item-type{display:none}.wc-block-active-filters .wc-block-active-filters__list--chips .wc-block-components-chip{font-size:.875em;margin-top:.1875em;margin-bottom:.1875em}woocommerce-blocks/build/attribute-filter.js000064400000121071151335517640015275 0ustar00this.wc=this.wc||{},this.wc.blocks=this.wc.blocks||{},this.wc.blocks["attribute-filter"]=function(e){function t(t){for(var r,a,l=t[0],i=t[1],u=t[2],b=0,d=[];b<l.length;b++)a=l[b],Object.prototype.hasOwnProperty.call(c,a)&&c[a]&&d.push(c[a][0]),c[a]=0;for(r in i)Object.prototype.hasOwnProperty.call(i,r)&&(e[r]=i[r]);for(s&&s(t);d.length;)d.shift()();return o.push.apply(o,u||[]),n()}function n(){for(var e,t=0;t<o.length;t++){for(var n=o[t],r=!0,l=1;l<n.length;l++){var i=n[l];0!==c[i]&&(r=!1)}r&&(o.splice(t--,1),e=a(a.s=n[0]))}return e}var r={},c={19:0},o=[];function a(t){if(r[t])return r[t].exports;var n=r[t]={i:t,l:!1,exports:{}};return e[t].call(n.exports,n,n.exports,a),n.l=!0,n.exports}a.m=e,a.c=r,a.d=function(e,t,n){a.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},a.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},a.t=function(e,t){if(1&t&&(e=a(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(a.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)a.d(n,r,function(t){return e[t]}.bind(null,r));return n},a.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return a.d(t,"a",t),t},a.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},a.p="";var l=window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[],i=l.push.bind(l);l.push=t,l=l.slice();for(var u=0;u<l.length;u++)t(l[u]);var s=i;return o.push([797,0]),n()}({0:function(e,t){e.exports=window.wp.element},1:function(e,t){e.exports=window.wp.i18n},108:function(e,t,n){"use strict";n.d(t,"a",(function(){return p})),n.d(t,"b",(function(){return f})),n.d(t,"c",(function(){return m}));var r=n(8),c=n.n(r),o=n(24),a=n(14),l=n(0),i=n(34),u=n.n(i),s=n(62),b=n(136),d=n(78),p=function(e){var t=Object(d.a)();e=e||t;var n=Object(a.useSelect)((function(t){return t(o.QUERY_STATE_STORE_KEY).getValueForQueryContext(e,void 0)}),[e]),r=Object(a.useDispatch)(o.QUERY_STATE_STORE_KEY).setValueForQueryContext;return[n,Object(l.useCallback)((function(t){r(e,t)}),[e,r])]},f=function(e,t,n){var r=Object(d.a)();n=n||r;var c=Object(a.useSelect)((function(r){return r(o.QUERY_STATE_STORE_KEY).getValueForQueryKey(n,e,t)}),[n,e]),i=Object(a.useDispatch)(o.QUERY_STATE_STORE_KEY).setQueryValue;return[c,Object(l.useCallback)((function(t){i(n,e,t)}),[n,e,i])]},m=function(e,t){var n=Object(d.a)(),r=p(t=t||n),o=c()(r,2),a=o[0],i=o[1],f=Object(s.a)(a),m=Object(s.a)(e),O=Object(b.a)(m),v=Object(l.useRef)(!1);return Object(l.useEffect)((function(){u()(O,m)||(i(Object.assign({},f,m)),v.current=!0)}),[f,m,O,i]),v.current?[a,i]:[e,i]}},11:function(e,t){e.exports=window.React},12:function(e,t){e.exports=window.wp.blockEditor},121:function(e,t){},122:function(e,t){e.exports=window.wp.coreData},123:function(e,t){},127:function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var r=n(8),c=n.n(r),o=n(0),a=function(){var e=Object(o.useState)(),t=c()(e,2)[1];return Object(o.useCallback)((function(e){t((function(){throw e}))}),[])}},133:function(e,t,n){"use strict";var r=n(17),c=n.n(r),o=n(18),a=n.n(o),l=n(19),i=n.n(l),u=n(20),s=n.n(u),b=n(10),d=n.n(b),p=n(0),f=n(7),m=n(1),O=n(4);function v(e){var t=e.level,n={1:"M9 5h2v10H9v-4H5v4H3V5h2v4h4V5zm6.6 0c-.6.9-1.5 1.7-2.6 2v1h2v7h2V5h-1.4z",2:"M7 5h2v10H7v-4H3v4H1V5h2v4h4V5zm8 8c.5-.4.6-.6 1.1-1.1.4-.4.8-.8 1.2-1.3.3-.4.6-.8.9-1.3.2-.4.3-.8.3-1.3 0-.4-.1-.9-.3-1.3-.2-.4-.4-.7-.8-1-.3-.3-.7-.5-1.2-.6-.5-.2-1-.2-1.5-.2-.4 0-.7 0-1.1.1-.3.1-.7.2-1 .3-.3.1-.6.3-.9.5-.3.2-.6.4-.8.7l1.2 1.2c.3-.3.6-.5 1-.7.4-.2.7-.3 1.2-.3s.9.1 1.3.4c.3.3.5.7.5 1.1 0 .4-.1.8-.4 1.1-.3.5-.6.9-1 1.2-.4.4-1 .9-1.6 1.4-.6.5-1.4 1.1-2.2 1.6V15h8v-2H15z",3:"M12.1 12.2c.4.3.8.5 1.2.7.4.2.9.3 1.4.3.5 0 1-.1 1.4-.3.3-.1.5-.5.5-.8 0-.2 0-.4-.1-.6-.1-.2-.3-.3-.5-.4-.3-.1-.7-.2-1-.3-.5-.1-1-.1-1.5-.1V9.1c.7.1 1.5-.1 2.2-.4.4-.2.6-.5.6-.9 0-.3-.1-.6-.4-.8-.3-.2-.7-.3-1.1-.3-.4 0-.8.1-1.1.3-.4.2-.7.4-1.1.6l-1.2-1.4c.5-.4 1.1-.7 1.6-.9.5-.2 1.2-.3 1.8-.3.5 0 1 .1 1.6.2.4.1.8.3 1.2.5.3.2.6.5.8.8.2.3.3.7.3 1.1 0 .5-.2.9-.5 1.3-.4.4-.9.7-1.5.9v.1c.6.1 1.2.4 1.6.8.4.4.7.9.7 1.5 0 .4-.1.8-.3 1.2-.2.4-.5.7-.9.9-.4.3-.9.4-1.3.5-.5.1-1 .2-1.6.2-.8 0-1.6-.1-2.3-.4-.6-.2-1.1-.6-1.6-1l1.1-1.4zM7 9H3V5H1v10h2v-4h4v4h2V5H7v4z",4:"M9 15H7v-4H3v4H1V5h2v4h4V5h2v10zm10-2h-1v2h-2v-2h-5v-2l4-6h3v6h1v2zm-3-2V7l-2.8 4H16z",5:"M12.1 12.2c.4.3.7.5 1.1.7.4.2.9.3 1.3.3.5 0 1-.1 1.4-.4.4-.3.6-.7.6-1.1 0-.4-.2-.9-.6-1.1-.4-.3-.9-.4-1.4-.4H14c-.1 0-.3 0-.4.1l-.4.1-.5.2-1-.6.3-5h6.4v1.9h-4.3L14 8.8c.2-.1.5-.1.7-.2.2 0 .5-.1.7-.1.5 0 .9.1 1.4.2.4.1.8.3 1.1.6.3.2.6.6.8.9.2.4.3.9.3 1.4 0 .5-.1 1-.3 1.4-.2.4-.5.8-.9 1.1-.4.3-.8.5-1.3.7-.5.2-1 .3-1.5.3-.8 0-1.6-.1-2.3-.4-.6-.2-1.1-.6-1.6-1-.1-.1 1-1.5 1-1.5zM9 15H7v-4H3v4H1V5h2v4h4V5h2v10z",6:"M9 15H7v-4H3v4H1V5h2v4h4V5h2v10zm8.6-7.5c-.2-.2-.5-.4-.8-.5-.6-.2-1.3-.2-1.9 0-.3.1-.6.3-.8.5l-.6.9c-.2.5-.2.9-.2 1.4.4-.3.8-.6 1.2-.8.4-.2.8-.3 1.3-.3.4 0 .8 0 1.2.2.4.1.7.3 1 .6.3.3.5.6.7.9.2.4.3.8.3 1.3s-.1.9-.3 1.4c-.2.4-.5.7-.8 1-.4.3-.8.5-1.2.6-1 .3-2 .3-3 0-.5-.2-1-.5-1.4-.9-.4-.4-.8-.9-1-1.5-.2-.6-.3-1.3-.3-2.1s.1-1.6.4-2.3c.2-.6.6-1.2 1-1.6.4-.4.9-.7 1.4-.9.6-.3 1.1-.4 1.7-.4.7 0 1.4.1 2 .3.5.2 1 .5 1.4.8 0 .1-1.3 1.4-1.3 1.4zm-2.4 5.8c.2 0 .4 0 .6-.1.2 0 .4-.1.5-.2.1-.1.3-.3.4-.5.1-.2.1-.5.1-.7 0-.4-.1-.8-.4-1.1-.3-.2-.7-.3-1.1-.3-.3 0-.7.1-1 .2-.4.2-.7.4-1 .7 0 .3.1.7.3 1 .1.2.3.4.4.6.2.1.3.3.5.3.2.1.5.2.7.1z"};return n.hasOwnProperty(t)?Object(p.createElement)(O.SVG,{width:"20",height:"20",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"},Object(p.createElement)(O.Path,{d:n[t]})):null}var w=function(e){i()(o,e);var t,n,r=(t=o,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=d()(t);if(n){var c=d()(this).constructor;e=Reflect.construct(r,arguments,c)}else e=r.apply(this,arguments);return s()(this,e)});function o(){return c()(this,o),r.apply(this,arguments)}return a()(o,[{key:"createLevelControl",value:function(e,t,n){var r=e===t;return{icon:Object(p.createElement)(v,{level:e}),
/* translators: %s: heading level e.g: "2", "3", "4" */
title:Object(m.sprintf)(Object(m.__)("Heading %d"),e),isActive:r,onClick:function(){return n(e)}}}},{key:"render",value:function(){var e=this,t=this.props,n=t.isCollapsed,r=void 0===n||n,c=t.minLevel,o=t.maxLevel,a=t.selectedLevel,l=t.onChange;return Object(p.createElement)(O.ToolbarGroup,{isCollapsed:r,icon:Object(p.createElement)(v,{level:a}),controls:Object(f.range)(c,o).map((function(t){return e.createLevelControl(t,a,l)}))})}}]),o}(p.Component);t.a=w},136:function(e,t,n){"use strict";n.d(t,"a",(function(){return c}));var r=n(11);function c(e,t){var n=Object(r.useRef)();return Object(r.useEffect)((function(){n.current===e||t&&!t(e,n.current)||(n.current=e)}),[e,t]),n.current}},14:function(e,t){e.exports=window.wp.data},145:function(e,t,n){"use strict";var r=n(0),c=n(1),o=n(41);n(363),t.a=function(e){var t=e.name,n=e.count;return Object(r.createElement)(r.Fragment,null,t,Number.isFinite(n)&&Object(r.createElement)(o.a,{label:n,screenReaderLabel:Object(c.sprintf)(
/* translators: %s number of products. */
Object(c._n)("%s product","%s products",n,'woocommerce'),n),wrapperElement:"span",wrapperProps:{className:"wc-filter-element-label-list-count"}}))}},15:function(e,t){e.exports=window.wp.apiFetch},157:function(e,t,n){"use strict";var r=n(0),c=(n(2),n(12)),o=n(21),a=n(1);n(217),t.a=Object(o.withInstanceId)((function(e){var t=e.className,n=e.headingLevel,o=e.onChange,l=e.heading,i=e.instanceId,u="h".concat(n);return Object(r.createElement)(u,{className:t},Object(r.createElement)("label",{className:"screen-reader-text",htmlFor:"block-title-".concat(i)},Object(a.__)("Block title",'woocommerce')),Object(r.createElement)(c.PlainText,{id:"block-title-".concat(i),className:"wc-block-editor-components-title",value:l,onChange:o}))}))},158:function(e,t,n){"use strict";var r=n(0),c=n(28),o=Object(r.createElement)(c.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(r.createElement)("mask",{id:"external-mask",width:"24",height:"24",x:"0",y:"0",maskUnits:"userSpaceOnUse"},Object(r.createElement)("path",{fill:"#fff",d:"M6.3431 6.3431v1.994l7.8984.0072-8.6055 8.6054 1.4142 1.4143 8.6055-8.6055.0071 7.8984h1.994V6.3431H6.3431z"})),Object(r.createElement)("g",{mask:"url(#external-mask)"},Object(r.createElement)("path",{d:"M0 0h24v24H0z"})));t.a=o},165:function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(24),c=n(14),o=n(0),a=n(62),l=n(127),i=function(e){var t=e.namespace,n=e.resourceName,i=e.resourceValues,u=void 0===i?[]:i,s=e.query,b=void 0===s?{}:s,d=e.shouldSelect,p=void 0===d||d;if(!t||!n)throw new Error("The options object must have valid values for the namespace and the resource properties.");var f=Object(o.useRef)({results:[],isLoading:!0}),m=Object(a.a)(b),O=Object(a.a)(u),v=Object(l.a)(),w=Object(c.useSelect)((function(e){if(!p)return null;var c=e(r.COLLECTIONS_STORE_KEY),o=[t,n,m,O],a=c.getCollectionError.apply(c,o);return a&&v(a),{results:c.getCollection.apply(c,o),isLoading:!c.hasFinishedResolution("getCollection",o)}}),[t,n,O,m,p]);return null!==w&&(f.current=w),f.current}},179:function(e,t){},194:function(e,t,n){"use strict";var r=n(0),c=n(1),o=(n(2),n(6)),a=n.n(o),l=n(41),i=(n(257),function(e){var t=e.className,n=e.disabled,o=e.label,i=void 0===o?Object(c.__)("Go",'woocommerce'):o,u=e.onClick,s=e.screenReaderLabel,b=void 0===s?Object(c.__)("Apply filter",'woocommerce'):s;return Object(r.createElement)("button",{type:"submit",className:a()("wc-block-filter-submit-button","wc-block-components-filter-submit-button",t),disabled:n,onClick:u},Object(r.createElement)(l.a,{label:i,screenReaderLabel:b}))});i.defaultProps={disabled:!1},t.a=i},21:function(e,t){e.exports=window.wp.compose},217:function(e,t){},22:function(e,t){e.exports=window.regeneratorRuntime},220:function(e,t,n){"use strict";var r=n(9),c=n.n(r),o=n(16),a=n.n(o),l=n(0),i=(n(2),n(6)),u=n.n(i),s=n(1),b=n(66),d=n(305),p=(n(179),["text","screenReaderText","element","className","radius","children"]),f=function(e){var t=e.text,n=e.screenReaderText,r=void 0===n?"":n,o=e.element,i=void 0===o?"li":o,s=e.className,b=void 0===s?"":s,d=e.radius,f=void 0===d?"small":d,m=e.children,O=void 0===m?null:m,v=a()(e,p),w=i,g=u()(b,"wc-block-components-chip","wc-block-components-chip--radius-"+f),j=Boolean(r&&r!==t);return Object(l.createElement)(w,c()({className:g},v),Object(l.createElement)("span",{"aria-hidden":j,className:"wc-block-components-chip__text"},t),j&&Object(l.createElement)("span",{className:"screen-reader-text"},r),O)},m=["ariaLabel","className","disabled","onRemove","removeOnAnyClick","text","screenReaderText"];t.a=function(e){var t=e.ariaLabel,n=void 0===t?"":t,r=e.className,o=void 0===r?"":r,i=e.disabled,p=void 0!==i&&i,O=e.onRemove,v=void 0===O?function(){}:O,w=e.removeOnAnyClick,g=void 0!==w&&w,j=e.text,h=e.screenReaderText,y=void 0===h?"":h,_=a()(e,m),k=g?"span":"button";if(!n){var E=y&&"string"==typeof y?y:j;n="string"!=typeof E?
/* translators: Remove chip. */
Object(s.__)("Remove",'woocommerce'):Object(s.sprintf)(
/* translators: %s text of the chip to remove. */
Object(s.__)('Remove "%s"','woocommerce'),E)}var x={"aria-label":n,disabled:p,onClick:v,onKeyDown:function(e){"Backspace"!==e.key&&"Delete"!==e.key||v()}},P=g?x:{},C=g?{"aria-hidden":!0}:x;return Object(l.createElement)(f,c()({},_,P,{className:u()(o,"is-removable"),element:g?"button":_.element,screenReaderText:y,text:j}),Object(l.createElement)(k,c()({className:"wc-block-components-chip__remove"},C),Object(l.createElement)(b.a,{className:"wc-block-components-chip__remove-icon",srcElement:d.a,size:16})))}},23:function(e,t){e.exports=window.wp.url},24:function(e,t){e.exports=window.wc.wcBlocksData},25:function(e,t){e.exports=window.wp.htmlEntities},257:function(e,t){},26:function(e,t){e.exports=window.wp.blocks},278:function(e,t,n){"use strict";n.d(t,"a",(function(){return o})),n.d(t,"b",(function(){return a}));var r=n(3),c=Object(r.getSetting)("attributes",[]).reduce((function(e,t){var n,r=(n=t)&&n.attribute_name?{id:parseInt(n.attribute_id,10),name:n.attribute_name,taxonomy:"pa_"+n.attribute_name,label:n.attribute_label}:null;return r.id&&e.push(r),e}),[]),o=function(e){if(e)return c.find((function(t){return t.id===e}))},a=function(e){if(e)return c.find((function(t){return t.taxonomy===e}))}},279:function(e,t,n){"use strict";n.d(t,"a",(function(){return c})),n.d(t,"b",(function(){return o}));var r=n(7),c=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){},n=arguments.length>2?arguments[2]:void 0,c=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"",o=e.filter((function(e){return e.attribute===n.taxonomy})),a=o.length?o[0]:null;if(a&&a.slug&&Array.isArray(a.slug)&&a.slug.includes(c)){var l=a.slug.filter((function(e){return e!==c})),i=e.filter((function(e){return e.attribute!==n.taxonomy}));l.length>0&&(a.slug=l.sort(),i.push(a)),t(Object(r.sortBy)(i,"attribute"))}},o=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){},n=arguments.length>2?arguments[2]:void 0,c=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"in",a=e.filter((function(e){return e.attribute!==n.taxonomy}));0===c.length?t(a):(a.push({attribute:n.taxonomy,operator:o,slug:c.map((function(e){return e.slug})).sort()}),t(Object(r.sortBy)(a,"attribute")))}},28:function(e,t){e.exports=window.wp.primitives},280:function(e,t,n){"use strict";var r=n(33),c=n.n(r),o=n(8),a=n.n(o),l=n(0),i=n(1),u=(n(2),n(6)),s=n.n(u);n(364),t.a=function(e){var t=e.className,n=e.onChange,r=void 0===n?function(){}:n,o=e.options,u=void 0===o?[]:o,b=e.checked,d=void 0===b?[]:b,p=e.isLoading,f=void 0!==p&&p,m=e.isDisabled,O=void 0!==m&&m,v=e.limit,w=void 0===v?10:v,g=Object(l.useState)(!1),j=a()(g,2),h=j[0],y=j[1],_=Object(l.useMemo)((function(){return c()(Array(5)).map((function(e,t){return Object(l.createElement)("li",{key:t,style:{width:Math.floor(75*Math.random())+25+"%"}})}))}),[]),k=Object(l.useMemo)((function(){var e=u.length-w;return!h&&Object(l.createElement)("li",{key:"show-more",className:"show-more"},Object(l.createElement)("button",{onClick:function(){y(!0)},"aria-expanded":!1,"aria-label":Object(i.sprintf)(
/* translators: %s is referring the remaining count of options */
Object(i._n)("Show %s more option","Show %s more options",e,'woocommerce'),e)},Object(i.sprintf)(
/* translators: %s number of options to reveal. */
Object(i._n)("Show %s more","Show %s more",e,'woocommerce'),e)))}),[u,w,h]),E=Object(l.useMemo)((function(){return h&&Object(l.createElement)("li",{key:"show-less",className:"show-less"},Object(l.createElement)("button",{onClick:function(){y(!1)},"aria-expanded":!0,"aria-label":Object(i.__)("Show less options",'woocommerce')},Object(i.__)("Show less",'woocommerce')))}),[h]),x=Object(l.useMemo)((function(){var e=u.length>w+5;return Object(l.createElement)(l.Fragment,null,u.map((function(t,n){return Object(l.createElement)(l.Fragment,{key:t.value},Object(l.createElement)("li",e&&!h&&n>=w&&{hidden:!0},Object(l.createElement)("input",{type:"checkbox",id:t.value,value:t.value,onChange:function(e){r(e.target.value)},checked:d.includes(t.value),disabled:O}),Object(l.createElement)("label",{htmlFor:t.value},t.label)),e&&n===w-1&&k)})),e&&E)}),[u,r,d,h,w,E,k,O]),P=s()("wc-block-checkbox-list","wc-block-components-checkbox-list",{"is-loading":f},t);return Object(l.createElement)("ul",{className:P},f?_:x)}},3:function(e,t){e.exports=window.wc.wcSettings},305:function(e,t,n){"use strict";var r=n(9),c=n.n(r),o=n(16),a=n.n(o),l=n(0),i=n(28),u=["className","size"],s=Object(l.createElement)((function(e){var t=e.className,n=e.size,r=a()(e,u);return Object(l.createElement)(i.SVG,c()({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",className:t,width:n,height:n},r),Object(l.createElement)("path",{d:"M14.95 6.46L11.41 10l3.54 3.54-1.41 1.41L10 11.42l-3.53 3.53-1.42-1.42L8.58 10 5.05 6.47l1.42-1.42L10 8.58l3.54-3.53z"}))}),null);t.a=s},31:function(e,t){e.exports=window.moment},34:function(e,t){e.exports=window.wp.isShallowEqual},36:function(e,t){e.exports=window.wp.dataControls},363:function(e,t){},364:function(e,t){},4:function(e,t){e.exports=window.wp.components},41:function(e,t,n){"use strict";var r=n(5),c=n.n(r),o=n(0),a=n(6),l=n.n(a);function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function u(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?i(Object(n),!0).forEach((function(t){c()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):i(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}t.a=function(e){var t,n=e.label,r=e.screenReaderLabel,c=e.wrapperElement,a=e.wrapperProps,i=void 0===a?{}:a,s=null!=n,b=null!=r;return!s&&b?(t=c||"span",i=u(u({},i),{},{className:l()(i.className,"screen-reader-text")}),Object(o.createElement)(t,i,r)):(t=c||o.Fragment,s&&b&&n!==r?Object(o.createElement)(t,i,Object(o.createElement)("span",{"aria-hidden":"true"},n),Object(o.createElement)("span",{className:"screen-reader-text"},r)):Object(o.createElement)(t,i,n))}},46:function(e,t){e.exports=window.wp.keycodes},493:function(e,t,n){"use strict";n.d(t,"a",(function(){return j}));var r=n(5),c=n.n(r),o=n(33),a=n.n(o),l=n(38),i=n.n(l),u=n(8),s=n.n(u),b=n(0),d=n(287),p=n(7),f=n(62),m=n(108),O=n(165),v=n(78);function w(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function g(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?w(Object(n),!0).forEach((function(t){c()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):w(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var j=function(e){var t=e.queryAttribute,n=e.queryPrices,r=e.queryStock,c=e.queryState,o=Object(v.a)();o="".concat(o,"-collection-data");var l=Object(m.a)(o),u=s()(l,1)[0],w=Object(m.b)("calculate_attribute_counts",[],o),j=s()(w,2),h=j[0],y=j[1],_=Object(m.b)("calculate_price_range",null,o),k=s()(_,2),E=k[0],x=k[1],P=Object(m.b)("calculate_stock_status_counts",null,o),C=s()(P,2),S=C[0],N=C[1],R=Object(f.a)(t||{}),L=Object(f.a)(n),T=Object(f.a)(r);Object(b.useEffect)((function(){"object"===i()(R)&&Object.keys(R).length&&(h.find((function(e){return e.taxonomy===R.taxonomy}))||y([].concat(a()(h),[R])))}),[R,h,y]),Object(b.useEffect)((function(){E!==L&&void 0!==L&&x(L)}),[L,x,E]),Object(b.useEffect)((function(){S!==T&&void 0!==T&&N(T)}),[T,N,S]);var B=Object(b.useState)(!1),D=s()(B,2),I=D[0],V=D[1],F=Object(d.a)(I,200),M=s()(F,1)[0];I||V(!0);var A=Object(b.useMemo)((function(){return function(e){var t=e;return e.calculate_attribute_counts&&(t.calculate_attribute_counts=Object(p.sortBy)(e.calculate_attribute_counts.map((function(e){return{taxonomy:e.taxonomy,query_type:e.queryType}})),["taxonomy","query_type"])),t}(u)}),[u]);return Object(O.a)({namespace:"/wc/store",resourceName:"products/collection-data",query:g(g({},c),{},{page:void 0,per_page:void 0,orderby:void 0,order:void 0},A),shouldSelect:M})}},55:function(e,t){e.exports=window.wp.hooks},56:function(e,t){e.exports=window.wp.deprecated},62:function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var r=n(0),c=n(34),o=n.n(c);function a(e){var t=Object(r.useRef)(e);return o()(e,t.current)||(t.current=e),t.current}},64:function(e,t){e.exports=window.wp.a11y},66:function(e,t,n){"use strict";var r=n(5),c=n.n(r),o=n(16),a=n.n(o),l=n(0),i=["srcElement","size"];function u(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}t.a=function(e){var t=e.srcElement,n=e.size,r=void 0===n?24:n,o=a()(e,i);return Object(l.isValidElement)(t)?Object(l.cloneElement)(t,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?u(Object(n),!0).forEach((function(t){c()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):u(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({width:r,height:r},o)):null}},7:function(e,t){e.exports=window.lodash},74:function(e,t){e.exports=window.wp.dom},78:function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(0),c=Object(r.createContext)("page"),o=function(){return Object(r.useContext)(c)};c.Provider},797:function(e,t,n){e.exports=n(856)},798:function(e,t,n){"use strict";var r=n(0),c=n(28),o=Object(r.createElement)(c.SVG,{xmlns:"http://www.w3.org/2000/SVG",viewBox:"0 0 24 24"},Object(r.createElement)("path",{fill:"none",d:"M0 0h24v24H0V0z"}),Object(r.createElement)("path",{d:"M19 15v4H5v-4h14m1-2H4c-.55 0-1 .45-1 1v6c0 .55.45 1 1 1h16c.55 0 1-.45 1-1v-6c0-.55-.45-1-1-1zM7 18.5c-.82 0-1.5-.67-1.5-1.5s.68-1.5 1.5-1.5 1.5.67 1.5 1.5-.67 1.5-1.5 1.5zM19 5v4H5V5h14m1-2H4c-.55 0-1 .45-1 1v6c0 .55.45 1 1 1h16c.55 0 1-.45 1-1V4c0-.55-.45-1-1-1zM7 8.5c-.82 0-1.5-.67-1.5-1.5S6.18 5.5 7 5.5s1.5.68 1.5 1.5S7.83 8.5 7 8.5z"}));t.a=o},799:function(e,t){},800:function(e,t){},801:function(e,t){},856:function(e,t,n){"use strict";n.r(t);var r=n(9),c=n.n(r),o=n(0),a=n(1),l=n(26),i=n(66),u=n(798),s=n(6),b=n.n(s),d=n(8),p=n.n(d),f=n(12),m=n(4),O=n(158),v=n(49),w=n(7),g=n(3),j=n(133),h=n(157),y=n(88),_=n(5),k=n.n(_),E=n(64),x=n(62),P=n(136),C=n(108),S=n(165),N=n(493),R=n(280),L=(n(2),n(243)),T=function(e){var t=e.checked,n=e.getInputProps,r=e.inputRef,c=e.isDisabled,a=e.onFocus,l=e.onRemoveItem,i=e.placeholder,u=e.tabIndex,s=e.value;return Object(o.createElement)("input",n({ref:r,className:"wc-block-dropdown-selector__input wc-block-components-dropdown-selector__input",disabled:c,onFocus:a,onKeyDown:function(e){"Backspace"===e.key&&!s&&t.length>0&&l(t[t.length-1])},placeholder:i,tabIndex:u}))},B=function(e){var t=e.children,n=e.onClick;return Object(o.createElement)("div",{className:"wc-block-dropdown-selector__input-wrapper wc-block-components-dropdown-selector__input-wrapper",onClick:n},t)},D=function(e){var t=e.checked,n=e.getItemProps,r=e.getMenuProps,c=e.highlightedIndex,l=e.options;return Object(o.createElement)("ul",r({className:"wc-block-dropdown-selector__list wc-block-components-dropdown-selector__list"}),l.map((function(e,r){var l=t.includes(e.value);return Object(o.createElement)("li",n({key:e.value,className:b()("wc-block-dropdown-selector__list-item","wc-block-components-dropdown-selector__list-item",{"is-selected":l,"is-highlighted":c===r}),index:r,item:e.value,"aria-label":l?Object(a.sprintf)(
/* translators: %s is referring to the filter option being removed. */
Object(a.__)("Remove %s filter",'woocommerce'),e.name):null}),e.label)})))},I=n(220),V=function(e){var t=e.onRemoveItem,n=e.option;return Object(o.createElement)(I.a,{className:"wc-block-dropdown-selector__selected-chip wc-block-components-dropdown-selector__selected-chip",removeOnAnyClick:!0,onRemove:function(){t(n.value)},ariaLabel:Object(a.sprintf)(
/* translators: %s is referring to the filter option being removed. */
Object(a.__)("Remove %s filter",'woocommerce'),n.name),text:n.label,radius:"large"})},F=n(305),M=function(e){var t=e.onClick,n=e.onRemoveItem,r=e.option,c=Object(o.useRef)(null);return Object(o.useEffect)((function(){c.current.focus()}),[c]),Object(o.createElement)("div",{className:"wc-block-dropdown-selector__selected-value wc-block-components-dropdown-selector__selected-value"},Object(o.createElement)("button",{ref:c,className:"wc-block-dropdown-selector__selected-value__label wc-block-components-dropdown-selector__selected-value__label",onClick:function(e){e.stopPropagation(),t(r.value)},"aria-label":Object(a.sprintf)(
/* translators: %s attribute value used in the filter. For example: yellow, green, small, large. */
Object(a.__)("Replace current %s filter",'woocommerce'),r.name)},r.label),Object(o.createElement)("button",{className:"wc-block-dropdown-selector__selected-value__remove wc-block-components-dropdown-selector__selected-value__remove",onClick:function(){n(r.value)},onKeyDown:function(e){"Backspace"!==e.key&&"Delete"!==e.key||n(r.value)},"aria-label":Object(a.sprintf)(
/* translators: %s attribute value used in the filter. For example: yellow, green, small, large. */
Object(a.__)("Remove %s filter",'woocommerce'),r.name)},Object(o.createElement)(i.a,{srcElement:F.a,size:16})))};function A(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function H(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?A(Object(n),!0).forEach((function(t){k()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):A(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}n(801);var z=function(e){var t=e.attributeLabel,n=void 0===t?"":t,r=e.className,c=e.checked,l=void 0===c?[]:c,i=e.inputLabel,u=void 0===i?"":i,s=e.isDisabled,d=void 0!==s&&s,p=e.isLoading,f=void 0!==p&&p,m=e.multiple,O=void 0!==m&&m,v=e.onChange,w=void 0===v?function(){}:v,g=e.options,j=void 0===g?[]:g,h=Object(o.useRef)(null),y=b()(r,"wc-block-dropdown-selector","wc-block-components-dropdown-selector",{"is-disabled":d,"is-loading":f}),_=Object(o.useCallback)((function(e,t){switch(t.type){case L.a.stateChangeTypes.keyDownEnter:case L.a.stateChangeTypes.clickItem:return H(H({},t),{},{highlightedIndex:e.highlightedIndex,isOpen:O,inputValue:""});case L.a.stateChangeTypes.blurInput:case L.a.stateChangeTypes.mouseUp:return H(H({},t),{},{inputValue:e.inputValue});default:return t}}),[O]);return Object(o.createElement)(L.a,{onChange:w,selectedItem:null,stateReducer:_},(function(e){var t=e.getInputProps,r=e.getItemProps,c=e.getLabelProps,i=e.getMenuProps,s=e.highlightedIndex,p=e.inputValue,f=e.isOpen,m=e.openMenu;return Object(o.createElement)("div",{className:b()(y,{"is-multiple":O,"is-single":!O,"has-checked":l.length>0,"is-open":f})},Object(o.createElement)("label",c({className:"screen-reader-text"}),u),Object(o.createElement)(B,{isOpen:f,onClick:function(){return h.current.focus()}},l.map((function(e){var t=j.find((function(t){return t.value===e})),n=function(e){w(e),h.current.focus()};return O?Object(o.createElement)(V,{key:e,onRemoveItem:n,option:t}):Object(o.createElement)(M,{key:e,onClick:function(){return h.current.focus()},onRemoveItem:n,option:t})})),Object(o.createElement)(T,{checked:l,getInputProps:t,inputRef:h,isDisabled:d,onFocus:m,onRemoveItem:function(e){w(e),h.current.focus()},placeholder:l.length>0&&O?null:Object(a.sprintf)(
/* translators: %s attribute name. */
Object(a.__)("Any %s",'woocommerce'),n),tabIndex:!O&&l.length>0?"-1":"0",value:p})),f&&!d&&Object(o.createElement)(D,{checked:l,getItemProps:r,getMenuProps:i,highlightedIndex:s,options:j.filter((function(e){return!p||e.value.startsWith(p)}))}))}))},q=n(145),G=n(194),Y=n(34),K=n.n(Y),Q=n(25),U=n(278),W=n(279),J=[{value:"preview-1",name:"Blue",label:Object(o.createElement)(q.a,{name:"Blue",count:3})},{value:"preview-2",name:"Green",label:Object(o.createElement)(q.a,{name:"Green",count:3})},{value:"preview-3",name:"Red",label:Object(o.createElement)(q.a,{name:"Red",count:2})}],$={id:0,name:"preview",taxonomy:"preview",label:"Preview"};function X(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Z(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?X(Object(n),!0).forEach((function(t){k()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):X(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}n(800);var ee=function(e){var t=e.attributes,n=e.isEditor,r=void 0!==n&&n,c=t.isPreview&&!t.attributeId?$:Object(U.a)(t.attributeId),l=Object(o.useState)([]),i=p()(l,2),u=i[0],s=i[1],b=Object(o.useState)(t.isPreview&&!t.attributeId?J:[]),d=p()(b,2),f=d[0],m=d[1],O=Object(C.a)(),v=p()(O,1)[0],w=Object(C.b)("attributes",[]),g=p()(w,2),j=g[0],h=g[1],y=Object(S.a)({namespace:"/wc/store",resourceName:"products/attributes/terms",resourceValues:[c.id],shouldSelect:t.attributeId>0}),_=y.results,k=y.isLoading,L="dropdown"!==t.displayStyle&&"and"===t.queryType,T=Object(N.a)({queryAttribute:{taxonomy:c.taxonomy,queryType:t.queryType},queryState:Z(Z({},v),{},{attributes:L?v.attributes:null})}),B=T.results,D=T.isLoading,I=Object(o.useCallback)((function(e){return B.attribute_counts?B.attribute_counts.find((function(t){return t.term===e})):null}),[B]);Object(o.useEffect)((function(){if(!k&&!D){var e=_.map((function(e){var n,r=I(e.id);if(!(r||u.includes(e.slug)||(n=e.slug,null!=v&&v.attributes&&v.attributes.some((function(e){var t=e.attribute,r=e.slug,o=void 0===r?[]:r;return t===c.taxonomy&&o.includes(n)})))))return null;var a=r?r.count:0;return{value:e.slug,name:Object(Q.decodeEntities)(e.name),label:Object(o.createElement)(q.a,{name:Object(Q.decodeEntities)(e.name),count:t.showCounts?a:null})}})).filter(Boolean);m(e)}}),[c.taxonomy,_,k,t.showCounts,D,I,u,v.attributes]);var V=Object(o.useMemo)((function(){return j.filter((function(e){return e.attribute===c.taxonomy})).flatMap((function(e){return e.slug}))}),[j,c.taxonomy]),F=Object(x.a)(V),M=Object(P.a)(F);Object(o.useEffect)((function(){K()(M,F)||K()(u,F)||(s(F),t.showFilterButton||H(F))}),[u,F,M,H,t.showFilterButton]);var A=Object(o.useCallback)((function(e){return _.reduce((function(t,n){return e.includes(n.slug)&&t.push(n),t}),[])}),[_]),H=Object(o.useCallback)((function(e){r||Object(W.b)(j,h,c,A(e),"or"===t.queryType?"in":"and")}),[r,j,h,c,A,t.queryType]),Y="dropdown"!==t.displayStyle||"or"===t.queryType,X=Object(o.useCallback)((function(e){var n,r=function(e){return f.find((function(t){return t.value===e})).name},c=function(e){var t=e.filterAdded,n=e.filterRemoved,c=t?r(t):null,o=n?r(n):null;c&&o?Object(E.speak)(Object(a.sprintf)(
/* translators: %1$s and %2$s are attribute terms (for example: 'red', 'blue', 'large'...). */
Object(a.__)("%1$s filter replaced with %2$s.",'woocommerce'),c,o)):c?Object(E.speak)(Object(a.sprintf)(
/* translators: %s attribute term (for example: 'red', 'blue', 'large'...) */
Object(a.__)("%s filter added.",'woocommerce'),c)):o&&Object(E.speak)(Object(a.sprintf)(
/* translators: %s attribute term (for example: 'red', 'blue', 'large'...) */
Object(a.__)("%s filter removed.",'woocommerce'),o))},o=u.includes(e);Y?(n=u.filter((function(t){return t!==e})),o?c({filterRemoved:e}):(n.push(e),n.sort(),c({filterAdded:e}))):(n=o?[]:[e],c({filterAdded:o?null:e,filterRemoved:1===u.length?u[0]:null})),s(n),t.showFilterButton||H(n)}),[u,f,Y,H,t.showFilterButton]);if(0===f.length&&!k)return null;var ee="h".concat(t.headingLevel),te=!t.isPreview&&k,ne=!t.isPreview&&D;return Object(o.createElement)(o.Fragment,null,!r&&t.heading&&Object(o.createElement)(ee,{className:"wc-block-attribute-filter__title"},t.heading),Object(o.createElement)("div",{className:"wc-block-attribute-filter style-".concat(t.displayStyle)},"dropdown"===t.displayStyle?Object(o.createElement)(z,{attributeLabel:c.label,checked:u,className:"wc-block-attribute-filter-dropdown",inputLabel:t.heading,isLoading:te,multiple:Y,onChange:X,options:f}):Object(o.createElement)(R.a,{className:"wc-block-attribute-filter-list",options:f,checked:u,onChange:X,isLoading:te,isDisabled:ne}),t.showFilterButton&&Object(o.createElement)(G.a,{className:"wc-block-attribute-filter__button",disabled:te||ne,onClick:function(){return H(u)}})))},te=(n(799),Object(g.getSetting)("attributes",[])),ne=Object(m.withSpokenMessages)((function(e){var t=e.attributes,n=e.setAttributes,r=e.debouncedSpeak,c=t.attributeId,l=t.className,s=t.displayStyle,b=t.heading,d=t.headingLevel,_=t.isPreview,k=t.queryType,E=t.showCounts,x=t.showFilterButton,P=Object(o.useState)(!c&&!_),C=p()(P,2),S=C[0],N=C[1],R=function(e){if(e&&e.length){var t=e[0].id,r=te.find((function(e){return e.attribute_id===t.toString()}));if(r&&c!==t){var o=r.attribute_label;n({attributeId:t,heading:Object(a.sprintf)(
/* translators: %s attribute name. */
Object(a.__)("Filter by %s",'woocommerce'),o)})}}},L=function(e){var t=e.isCompact,n={clear:Object(a.__)("Clear selected attribute",'woocommerce'),list:Object(a.__)("Product Attributes",'woocommerce'),noItems:Object(a.__)("Your store doesn't have any product attributes.",'woocommerce'),search:Object(a.__)("Search for a product attribute:",'woocommerce'),selected:function(e){return Object(a.sprintf)(
/* translators: %d is the number of attributes selected. */
Object(a._n)("%d attribute selected","%d attributes selected",e,'woocommerce'),e)},updated:Object(a.__)("Product attribute search results updated.",'woocommerce')},r=Object(w.sortBy)(Object(w.toArray)(Object(w.mapValues)(te,(function(e){return{id:parseInt(e.attribute_id,10),name:e.attribute_label}}))),"name");return Object(o.createElement)(v.b,{className:"woocommerce-product-attributes",list:r,selected:r.filter((function(e){return e.id===c})),onChange:R,messages:n,isSingle:!0,isCompact:t})};return 0===Object.keys(te).length?Object(o.createElement)(m.Placeholder,{className:"wc-block-attribute-filter",icon:Object(o.createElement)(i.a,{srcElement:u.a}),label:Object(a.__)("Filter Products by Attribute",'woocommerce'),instructions:Object(a.__)("Display a list of filters based on a chosen attribute.",'woocommerce')},Object(o.createElement)("p",null,Object(a.__)("Attributes are needed for filtering your products. You haven't created any attributes yet.",'woocommerce')),Object(o.createElement)(m.Button,{className:"wc-block-attribute-filter__add-attribute-button",isSecondary:!0,href:Object(g.getAdminLink)("edit.php?post_type=product&page=product_attributes")},Object(a.__)("Add new attribute",'woocommerce')+" ",Object(o.createElement)(i.a,{srcElement:O.a})),Object(o.createElement)(m.Button,{className:"wc-block-attribute-filter__read_more_button",isTertiary:!0,href:"https://docs.woocommerce.com/document/managing-product-taxonomies/"},Object(a.__)("Learn more",'woocommerce'))):Object(o.createElement)(o.Fragment,null,Object(o.createElement)(f.BlockControls,null,Object(o.createElement)(m.ToolbarGroup,{controls:[{icon:"edit",title:Object(a.__)("Edit",'woocommerce'),onClick:function(){return N(!S)},isActive:S}]})),Object(o.createElement)(f.InspectorControls,{key:"inspector"},Object(o.createElement)(m.PanelBody,{title:Object(a.__)("Content",'woocommerce')},Object(o.createElement)(m.ToggleControl,{label:Object(a.__)("Product count",'woocommerce'),help:E?Object(a.__)("Product count is visible.",'woocommerce'):Object(a.__)("Product count is hidden.",'woocommerce'),checked:E,onChange:function(){return n({showCounts:!E})}}),Object(o.createElement)("p",null,Object(a.__)("Heading Level",'woocommerce')),Object(o.createElement)(j.a,{isCollapsed:!1,minLevel:2,maxLevel:7,selectedLevel:d,onChange:function(e){return n({headingLevel:e})}})),Object(o.createElement)(m.PanelBody,{title:Object(a.__)("Block Settings",'woocommerce')},Object(o.createElement)(y.a,{label:Object(a.__)("Query Type",'woocommerce'),help:"and"===k?Object(a.__)("Products that have all of the selected attributes will be shown.",'woocommerce'):Object(a.__)("Products that have any of the selected attributes will be shown.",'woocommerce'),value:k,options:[{label:Object(a.__)("And",'woocommerce'),value:"and"},{label:Object(a.__)("Or",'woocommerce'),value:"or"}],onChange:function(e){return n({queryType:e})}}),Object(o.createElement)(y.a,{label:Object(a.__)("Display Style",'woocommerce'),value:s,options:[{label:Object(a.__)("List",'woocommerce'),value:"list"},{label:Object(a.__)("Dropdown",'woocommerce'),value:"dropdown"}],onChange:function(e){return n({displayStyle:e})}}),Object(o.createElement)(m.ToggleControl,{label:Object(a.__)("Filter button",'woocommerce'),help:x?Object(a.__)("Products will only update when the button is pressed.",'woocommerce'):Object(a.__)("Products will update as options are selected.",'woocommerce'),checked:x,onChange:function(e){return n({showFilterButton:e})}})),Object(o.createElement)(m.PanelBody,{title:Object(a.__)("Filter Products by Attribute",'woocommerce'),initialOpen:!1},L({isCompact:!0}))),S?Object(o.createElement)(m.Placeholder,{className:"wc-block-attribute-filter",icon:Object(o.createElement)(i.a,{srcElement:u.a}),label:Object(a.__)("Filter Products by Attribute",'woocommerce'),instructions:Object(a.__)("Display a list of filters based on a chosen attribute.",'woocommerce')},Object(o.createElement)("div",{className:"wc-block-attribute-filter__selection"},L({isCompact:!1}),Object(o.createElement)(m.Button,{isPrimary:!0,onClick:function(){N(!1),r(Object(a.__)("Showing Filter Products by Attribute block preview.",'woocommerce'))}},Object(a.__)("Done",'woocommerce')))):Object(o.createElement)("div",{className:l},Object(o.createElement)(h.a,{className:"wc-block-attribute-filter__title",headingLevel:d,heading:b,onChange:function(e){return n({heading:e})}}),Object(o.createElement)(m.Disabled,null,Object(o.createElement)(ee,{attributes:t,isEditor:!0}))))}));Object(l.registerBlockType)("woocommerce/attribute-filter",{title:Object(a.__)("Filter Products by Attribute",'woocommerce'),icon:{src:Object(o.createElement)(i.a,{srcElement:u.a}),foreground:"#96588a"},category:"woocommerce",keywords:[Object(a.__)("WooCommerce",'woocommerce')],description:Object(a.__)("Allow customers to filter the grid by product attribute, such as color. Works in combination with the All Products block.",'woocommerce'),supports:{html:!1},example:{attributes:{isPreview:!0}},attributes:{attributeId:{type:"number",default:0},showCounts:{type:"boolean",default:!0},queryType:{type:"string",default:"or"},heading:{type:"string",default:Object(a.__)("Filter by attribute",'woocommerce')},headingLevel:{type:"number",default:3},displayStyle:{type:"string",default:"list"},showFilterButton:{type:"boolean",default:!1},isPreview:{type:"boolean",default:!1}},edit:ne,save:function(e){var t=e.attributes,n=t.className,r=t.showCounts,a=t.queryType,l=t.attributeId,i=t.heading,u=t.headingLevel,s=t.displayStyle,d=t.showFilterButton,p={"data-attribute-id":l,"data-show-counts":r,"data-query-type":a,"data-heading":i,"data-heading-level":u};return"list"!==s&&(p["data-display-style"]=s),d&&(p["data-show-filter-button"]=d),Object(o.createElement)("div",c()({className:b()("is-loading",n)},p),Object(o.createElement)("span",{"aria-hidden":!0,className:"wc-block-product-attribute-filter__placeholder"}))}})},87:function(e,t){e.exports=window.ReactDOM},88:function(e,t,n){"use strict";var r=n(9),c=n.n(r),o=n(17),a=n.n(o),l=n(18),i=n.n(l),u=n(13),s=n.n(u),b=n(19),d=n.n(b),p=n(20),f=n.n(p),m=n(10),O=n.n(m),v=n(0),w=n(7),g=n(6),j=n.n(g),h=n(4),y=n(21);n(123);var _=function(e){d()(o,e);var t,n,r=(t=o,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=O()(t);if(n){var c=O()(this).constructor;e=Reflect.construct(r,arguments,c)}else e=r.apply(this,arguments);return f()(this,e)});function o(){var e;return a()(this,o),(e=r.apply(this,arguments)).onClick=e.onClick.bind(s()(e)),e}return i()(o,[{key:"onClick",value:function(e){this.props.onChange&&this.props.onChange(e.target.value)}},{key:"render",value:function(){var e,t=this,n=this.props,r=n.label,o=n.checked,a=n.instanceId,l=n.className,i=n.help,u=n.options,s=n.value,b="inspector-toggle-button-control-".concat(a);return i&&(e=Object(w.isFunction)(i)?i(o):i),Object(v.createElement)(h.BaseControl,{id:b,help:e,className:j()("components-toggle-button-control",l)},Object(v.createElement)("label",{id:b+"__label",htmlFor:b,className:"components-toggle-button-control__label"},r),Object(v.createElement)(h.ButtonGroup,{"aria-labelledby":b+"__label"},u.map((function(e,n){var o={};return s===e.value?(o.isPrimary=!0,o["aria-pressed"]=!0):(o.isSecondary=!0,o["aria-pressed"]=!1),Object(v.createElement)(h.Button,c()({key:"".concat(e.label,"-").concat(e.value,"-").concat(n),value:e.value,onClick:t.onClick,"aria-label":r+": "+e.label},o),e.label)}))))}}]),o}(v.Component);t.a=Object(y.withInstanceId)(_)},89:function(e,t){e.exports=window.wp.viewport},96:function(e,t){e.exports=window.wp.date}});woocommerce-blocks/build/wc-payment-method-cheque.asset.php000064400000000260151335517640020106 0ustar00<?php return array('dependencies' => array('wc-blocks-registry', 'wc-settings', 'wp-html-entities', 'wp-i18n', 'wp-polyfill'), 'version' => '3ba4d9bfc507e92837fb23cfee28ba72');woocommerce-blocks/build/active-filters.asset.php000064400000000530151335517640016215 0ustar00<?php return array('dependencies' => array('lodash', 'react', 'wc-blocks-data-store', 'wc-price-format', 'wc-settings', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-data', 'wp-element', 'wp-html-entities', 'wp-i18n', 'wp-is-shallow-equal', 'wp-polyfill', 'wp-primitives'), 'version' => '457014276d6e0ad275390f78627cd552');woocommerce-blocks/build/cart.js000064400000525753151335517640012757 0ustar00this.wc=this.wc||{},this.wc.blocks=this.wc.blocks||{},this.wc.blocks.cart=function(e){function t(t){for(var r,a,i=t[0],s=t[1],u=t[2],p=0,d=[];p<i.length;p++)a=i[p],Object.prototype.hasOwnProperty.call(c,a)&&c[a]&&d.push(c[a][0]),c[a]=0;for(r in s)Object.prototype.hasOwnProperty.call(s,r)&&(e[r]=s[r]);for(l&&l(t);d.length;)d.shift()();return o.push.apply(o,u||[]),n()}function n(){for(var e,t=0;t<o.length;t++){for(var n=o[t],r=!0,i=1;i<n.length;i++){var s=n[i];0!==c[s]&&(r=!1)}r&&(o.splice(t--,1),e=a(a.s=n[0]))}return e}var r={},c={20:0,1:0},o=[];function a(t){if(r[t])return r[t].exports;var n=r[t]={i:t,l:!1,exports:{}};return e[t].call(n.exports,n,n.exports,a),n.l=!0,n.exports}a.m=e,a.c=r,a.d=function(e,t,n){a.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},a.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},a.t=function(e,t){if(1&t&&(e=a(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(a.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)a.d(n,r,function(t){return e[t]}.bind(null,r));return n},a.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return a.d(t,"a",t),t},a.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},a.p="";var i=window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[],s=i.push.bind(i);i.push=t,i=i.slice();for(var u=0;u<i.length;u++)t(i[u]);var l=s;return o.push([808,0]),n()}({0:function(e,t){e.exports=window.wp.element},1:function(e,t){e.exports=window.wp.i18n},11:function(e,t){e.exports=window.React},110:function(e,t,n){"use strict";var r=n(0),c=n(6),o=n.n(c);n(262),t.a=function(e){var t=e.children,n=e.className;return Object(r.createElement)("div",{className:o()("wc-block-components-product-badge",n)},t)}},113:function(e,t,n){"use strict";var r=n(5),c=n.n(r),o=n(8),a=n.n(o),i=n(3),s=n(1),u=n(72);function l(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function p(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?l(Object(n),!0).forEach((function(t){c()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):l(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var d=Object(i.getSetting)("countryLocale",{}),b=function(e){var t={};return void 0!==e.label&&(t.label=e.label),void 0!==e.required&&(t.required=e.required),void 0!==e.hidden&&(t.hidden=e.hidden),void 0===e.label||e.optionalLabel||(t.optionalLabel=Object(s.sprintf)(
/* translators: %s Field label. */
Object(s.__)("%s (optional)",'woocommerce'),e.label)),e.priority&&(Object(u.a)(e.priority)&&(t.index=e.priority),Object(u.c)(e.priority)&&(t.index=parseInt(e.priority,10))),e.hidden&&(t.required=!1),t},m=Object.entries(d).map((function(e){var t=a()(e,2),n=t[0],r=t[1];return[n,Object.entries(r).map((function(e){var t=a()(e,2),n=t[0],r=t[1];return[n,b(r)]})).reduce((function(e,t){var n=a()(t,2),r=n[0],c=n[1];return e[r]=c,e}),{})]})).reduce((function(e,t){var n=a()(t,2),r=n[0],c=n[1];return e[r]=c,e}),{});t.a=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",r=n&&void 0!==m[n]?m[n]:{};return e.map((function(e){var n=i.defaultAddressFields[e]||{},c=r[e]||{},o=t[e]||{};return p(p(p({key:e},n),c),o)})).sort((function(e,t){return e.index-t.index}))}},114:function(e,t,n){"use strict";var r=n(0);n(209),t.a=function(){return Object(r.createElement)("span",{className:"wc-block-components-spinner","aria-hidden":"true"})}},119:function(e,t){e.exports=window.wp.wordcount},12:function(e,t){e.exports=window.wp.blockEditor},124:function(e,t,n){"use strict";var r=n(5),c=n.n(r),o=n(0),a=n(1),i=n(53),s=n(6),u=n.n(s),l=(n(2),n(47)),p=(n(206),function(e){var t=e.currency,n=e.maxPrice,r=e.minPrice,c=e.priceClassName,s=e.priceStyle;return Object(o.createElement)(o.Fragment,null,Object(o.createElement)("span",{className:"screen-reader-text"},Object(a.sprintf)(
/* translators: %1$s min price, %2$s max price */
Object(a.__)("Price between %1$s and %2$s",'woocommerce'),Object(l.formatPrice)(r),Object(l.formatPrice)(n))),Object(o.createElement)("span",{"aria-hidden":!0},Object(o.createElement)(i.a,{className:u()("wc-block-components-product-price__value",c),currency:t,value:r,style:s})," — ",Object(o.createElement)(i.a,{className:u()("wc-block-components-product-price__value",c),currency:t,value:n,style:s})))}),d=function(e){var t=e.currency,n=e.regularPriceClassName,r=e.regularPriceStyle,c=e.regularPrice,s=e.priceClassName,l=e.priceStyle,p=e.price;return Object(o.createElement)(o.Fragment,null,Object(o.createElement)("span",{className:"screen-reader-text"},Object(a.__)("Previous price:",'woocommerce')),Object(o.createElement)(i.a,{currency:t,renderText:function(e){return Object(o.createElement)("del",{className:u()("wc-block-components-product-price__regular",n),style:r},e)},value:c}),Object(o.createElement)("span",{className:"screen-reader-text"},Object(a.__)("Discounted price:",'woocommerce')),Object(o.createElement)(i.a,{currency:t,renderText:function(e){return Object(o.createElement)("ins",{className:u()("wc-block-components-product-price__value","is-discounted",s),style:l},e)},value:p}))};t.a=function(e){var t=e.align,n=e.className,r=e.currency,a=e.format,s=void 0===a?"<price/>":a,l=e.maxPrice,b=void 0===l?null:l,m=e.minPrice,f=void 0===m?null:m,g=e.price,O=void 0===g?null:g,h=e.priceClassName,j=e.priceStyle,v=e.regularPrice,E=e.regularPriceClassName,y=e.regularPriceStyle,_=u()(n,"price","wc-block-components-product-price",c()({},"wc-block-components-product-price--align-".concat(t),t));s.includes("<price/>")||(s="<price/>",console.error("Price formats need to include the `<price/>` tag."));var w=v&&O!==v,S=Object(o.createElement)("span",{className:u()("wc-block-components-product-price__value",h)});return w?S=Object(o.createElement)(d,{currency:r,price:O,priceClassName:h,priceStyle:j,regularPrice:v,regularPriceClassName:E,regularPriceStyle:y}):null!==f&&null!==b?S=Object(o.createElement)(p,{currency:r,maxPrice:b,minPrice:f,priceClassName:h,priceStyle:j}):null!==O&&(S=Object(o.createElement)(i.a,{className:u()("wc-block-components-product-price__value",h),currency:r,value:O,style:j})),Object(o.createElement)("span",{className:_},Object(o.createInterpolateElement)(s,{price:S}))}},125:function(e,t,n){"use strict";var r=n(17),c=n.n(r),o=n(18),a=n.n(o),i=n(13),s=n.n(i),u=n(19),l=n.n(u),p=n(20),d=n.n(p),b=n(10),m=n.n(b),f=n(5),g=n.n(f),O=n(0),h=(n(2),n(11)),j=n(1),v=n(37),E=function(e){var t=e.imageUrl,n=void 0===t?"".concat(v.m,"/block-error.svg"):t,r=e.header,c=void 0===r?Object(j.__)("Oops!",'woocommerce'):r,o=e.text,a=void 0===o?Object(j.__)("There was an error loading the content.",'woocommerce'):o,i=e.errorMessage,s=e.errorMessagePrefix,u=void 0===s?Object(j.__)("Error:",'woocommerce'):s,l=e.button;return Object(O.createElement)("div",{className:"wc-block-error wc-block-components-error"},n&&Object(O.createElement)("img",{className:"wc-block-error__image wc-block-components-error__image",src:n,alt:""}),Object(O.createElement)("div",{className:"wc-block-error__content wc-block-components-error__content"},c&&Object(O.createElement)("p",{className:"wc-block-error__header wc-block-components-error__header"},c),a&&Object(O.createElement)("p",{className:"wc-block-error__text wc-block-components-error__text"},a),i&&Object(O.createElement)("p",{className:"wc-block-error__message wc-block-components-error__message"},u?u+" ":"",i),l&&Object(O.createElement)("p",{className:"wc-block-error__button wc-block-components-error__button"},l)))};n(218);var y=function(e){l()(o,e);var t,n,r=(t=o,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=m()(t);if(n){var c=m()(this).constructor;e=Reflect.construct(r,arguments,c)}else e=r.apply(this,arguments);return d()(this,e)});function o(){var e;c()(this,o);for(var t=arguments.length,n=new Array(t),a=0;a<t;a++)n[a]=arguments[a];return e=r.call.apply(r,[this].concat(n)),g()(s()(e),"state",{errorMessage:"",hasError:!1}),e}return a()(o,[{key:"render",value:function(){var e=this.props,t=e.header,n=e.imageUrl,r=e.showErrorMessage,c=e.text,o=e.errorMessagePrefix,a=e.renderError,i=e.button,s=this.state,u=s.errorMessage;return s.hasError?"function"==typeof a?a({errorMessage:u}):Object(O.createElement)(E,{errorMessage:r?u:null,header:t,imageUrl:n,text:c,errorMessagePrefix:o,button:i}):this.props.children}}],[{key:"getDerivedStateFromError",value:function(e){return void 0!==e.statusText&&void 0!==e.status?{errorMessage:Object(O.createElement)(O.Fragment,null,Object(O.createElement)("strong",null,e.status),": ",e.statusText),hasError:!0}:{errorMessage:e.message,hasError:!0}}}]),o}(h.Component);y.defaultProps={showErrorMessage:!0},t.a=y},126:function(e,t,n){"use strict";n.d(t,"a",(function(){return u})),n.d(t,"b",(function(){return p}));var r,c=n(5),o=n.n(c),a=n(7);function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function s(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?i(Object(n),!0).forEach((function(t){o()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):i(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}!function(e){e.ADD_EVENT_CALLBACK="add_event_callback",e.REMOVE_EVENT_CALLBACK="remove_event_callback"}(r||(r={}));var u={addEventCallback:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:10;return{id:Object(a.uniqueId)(),type:r.ADD_EVENT_CALLBACK,eventType:e,callback:t,priority:n}},removeEventCallback:function(e,t){return{id:t,type:r.REMOVE_EVENT_CALLBACK,eventType:e}}},l={},p=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:l,t=arguments.length>1?arguments[1]:void 0,n=t.type,c=t.eventType,a=t.id,i=t.callback,u=t.priority,p=e.hasOwnProperty(c)?new Map(e[c]):new Map;switch(n){case r.ADD_EVENT_CALLBACK:return p.set(a,{priority:u,callback:i}),s(s({},e),{},o()({},c,p));case r.REMOVE_EVENT_CALLBACK:return p.delete(a),s(s({},e),{},o()({},c,p))}}},127:function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var r=n(8),c=n.n(r),o=n(0),a=function(){var e=Object(o.useState)(),t=c()(e,2)[1];return Object(o.useCallback)((function(e){t((function(){throw e}))}),[])}},129:function(e,t,n){"use strict";var r=n(0);t.a=function(e){var t=e.label,n=e.secondaryLabel,c=e.description,o=e.secondaryDescription,a=e.id;return Object(r.createElement)("div",{className:"wc-block-components-radio-control__option-layout"},Object(r.createElement)("div",{className:"wc-block-components-radio-control__label-group"},t&&Object(r.createElement)("span",{id:a&&"".concat(a,"__label"),className:"wc-block-components-radio-control__label"},t),n&&Object(r.createElement)("span",{id:a&&"".concat(a,"__secondary-label"),className:"wc-block-components-radio-control__secondary-label"},n)),Object(r.createElement)("div",{className:"wc-block-components-radio-control__description-group"},c&&Object(r.createElement)("span",{id:a&&"".concat(a,"__description"),className:"wc-block-components-radio-control__description"},c),o&&Object(r.createElement)("span",{id:a&&"".concat(a,"__secondary-description"),className:"wc-block-components-radio-control__secondary-description"},o)))}},132:function(e,t,n){"use strict";n.d(t,"b",(function(){return j})),n.d(t,"a",(function(){return v}));var r=n(38),c=n.n(r),o=n(5),a=n.n(o),i=n(16),s=n.n(i),u=n(8),l=n.n(u),p=n(0),d=n(7),b=n(34),m=n.n(b);function f(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function g(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?f(Object(n),!0).forEach((function(t){a()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):f(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function O(e){var t=function(e,t){if("object"!==c()(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==c()(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===c()(t)?t:String(t)}var h=Object(p.createContext)({getValidationError:function(){return""},setValidationErrors:function(e){},clearValidationError:function(e){},clearAllValidationErrors:function(){},hideValidationError:function(){},showValidationError:function(){},showAllValidationErrors:function(){},hasValidationErrors:!1,getValidationErrorId:function(e){return e}}),j=function(){return Object(p.useContext)(h)},v=function(e){var t=e.children,n=Object(p.useState)({}),r=l()(n,2),c=r[0],o=r[1],i=Object(p.useCallback)((function(e){return c[e]}),[c]),u=Object(p.useCallback)((function(e){var t=c[e];return!t||t.hidden?"":"validate-error-".concat(e)}),[c]),b=Object(p.useCallback)((function(e){o((function(t){return t[e]?(t[e],s()(t,[e].map(O))):t}))}),[]),f=Object(p.useCallback)((function(){o({})}),[]),j=Object(p.useCallback)((function(e){e&&o((function(t){return e=Object(d.pickBy)(e,(function(e,n){return!("string"!=typeof e.message||t.hasOwnProperty(n)&&m()(t[n],e))})),0===Object.values(e).length?t:g(g({},t),e)}))}),[]),v=Object(p.useCallback)((function(e,t){o((function(n){if(!n.hasOwnProperty(e))return n;var r=g(g({},n[e]),t);return m()(n[e],r)?n:g(g({},n),{},a()({},e,r))}))}),[]),E={getValidationError:i,setValidationErrors:j,clearValidationError:b,clearAllValidationErrors:f,hideValidationError:Object(p.useCallback)((function(e){v(e,{hidden:!0})}),[v]),showValidationError:Object(p.useCallback)((function(e){v(e,{hidden:!1})}),[v]),showAllValidationErrors:Object(p.useCallback)((function(){o((function(e){var t={};return Object.keys(e).forEach((function(n){e[n].hidden&&(t[n]=g(g({},e[n]),{},{hidden:!1}))})),0===Object.values(t).length?e:g(g({},e),t)}))}),[]),hasValidationErrors:Object.keys(c).length>0,getValidationErrorId:u};return Object(p.createElement)(h.Provider,{value:E},t)}},134:function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(14),c=n(0),o=n(24),a=n(127),i=function(){var e=Object(a.a)(),t=Object(r.useDispatch)(o.CART_STORE_KEY).selectShippingRate;return{selectShippingRate:Object(c.useCallback)((function(n,r){t(n,r).catch((function(t){e(t)}))}),[e,t]),isSelectingRate:Object(r.useSelect)((function(e){return e(o.CART_STORE_KEY).isShippingRateBeingSelected()}),[])}}},135:function(e,t,n){"use strict";var r=n(9),c=n.n(r),o=n(16),a=n.n(o),i=n(0),s=n(6),u=n.n(s),l=(n(2),n(260),["children","className","headingLevel"]);t.a=function(e){var t=e.children,n=e.className,r=e.headingLevel,o=a()(e,l),s=u()("wc-block-components-title",n),p="h".concat(r);return Object(i.createElement)(p,c()({className:s},o),t)}},136:function(e,t,n){"use strict";n.d(t,"a",(function(){return c}));var r=n(11);function c(e,t){var n=Object(r.useRef)();return Object(r.useEffect)((function(){n.current===e||t&&!t(e,n.current)||(n.current=e)}),[e,t]),n.current}},14:function(e,t){e.exports=window.wp.data},140:function(e,t,n){"use strict";var r=n(5),c=n.n(r),o=n(0),a=n(6),i=n.n(a),s=n(129);t.a=function(e){var t,n=e.checked,r=e.name,a=e.onChange,u=e.option,l=u.value,p=u.label,d=u.description,b=u.secondaryLabel,m=u.secondaryDescription;return Object(o.createElement)("label",{className:i()("wc-block-components-radio-control__option",{"wc-block-components-radio-control__option-checked":n}),htmlFor:"".concat(r,"-").concat(l)},Object(o.createElement)("input",{id:"".concat(r,"-").concat(l),className:"wc-block-components-radio-control__input",type:"radio",name:r,value:l,onChange:function(e){return a(e.target.value)},checked:n,"aria-describedby":i()((t={},c()(t,"".concat(r,"-").concat(l,"__label"),p),c()(t,"".concat(r,"-").concat(l,"__secondary-label"),b),c()(t,"".concat(r,"-").concat(l,"__description"),d),c()(t,"".concat(r,"-").concat(l,"__secondary-description"),m),t))}),Object(o.createElement)(s.a,{id:"".concat(r,"-").concat(l),label:p,secondaryLabel:b,description:d,secondaryDescription:m}))}},141:function(e,t,n){"use strict";n.d(t,"b",(function(){return E})),n.d(t,"a",(function(){return y}));var r=n(5),c=n.n(r),o=n(8),a=n.n(o),i=n(0),s=(n(2),n(14)),u=n(68),l=n(63),p=n(9),d=n.n(p),b=n(6),m=n.n(b),f=n(890),g=(n(207),function(e){var t=e.status;switch(void 0===t?"default":t){case"error":return"woocommerce-error";case"success":return"woocommerce-message";case"info":case"warning":return"woocommerce-info"}return""}),O=function(e){var t=e.className,n=e.notices,r=e.removeNotice,c=n.filter((function(e){return"snackbar"!==e.type}));if(!c.length)return null;var o=m()(t,"wc-block-components-notices");return Object(i.createElement)("div",{className:o},c.map((function(e){return Object(i.createElement)(f.a,d()({key:"store-notice-"+e.id},e,{className:m()("wc-block-components-notices__notice",g(e)),onRemove:function(){e.isDismissible&&r(e.id)}}),e.content)})))};function h(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function j(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?h(Object(n),!0).forEach((function(t){c()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):h(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var v=Object(i.createContext)({notices:[],createNotice:function(e,t,n){},removeNotice:function(e,t){},setIsSuppressed:function(e){},context:"wc/core"}),E=function(){return Object(i.useContext)(v)},y=function(e){var t=e.children,n=e.className,r=void 0===n?"":n,c=e.createNoticeContainer,o=void 0===c||c,p=e.context,d=void 0===p?"wc/core":p,b=Object(s.useDispatch)("core/notices"),m=b.createNotice,f=b.removeNotice,g=Object(i.useState)(!1),h=a()(g,2),E=h[0],y=h[1],_=Object(u.a)().dispatchStoreEvent,w=Object(l.b)().isEditor,S=Object(i.useCallback)((function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};m(e,t,j(j({},n),{},{context:n.context||d})),_("store-notice-create",{status:e,content:t,options:n})}),[m,_,d]),k=Object(i.useCallback)((function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:d;f(e,t)}),[f,d]),C={notices:Object(s.useSelect)((function(e){return{notices:e("core/notices").getNotices(d)}}),[d]).notices,createNotice:S,removeNotice:k,context:d,setIsSuppressed:y},P=E?null:Object(i.createElement)(O,{className:r,notices:C.notices,removeNotice:C.removeNotice,isEditor:w});return Object(i.createElement)(v.Provider,{value:C},o&&P,t)}},142:function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(8),c=n.n(r),o=function(e){return e.reduce((function(e,t){var n=c()(t,2),r=n[0],o=n[1];return e[r]=o,e}),{})}},15:function(e,t){e.exports=window.wp.apiFetch},154:function(e,t,n){"use strict";var r=n(9),c=n.n(r),o=n(16),a=n.n(o),i=n(0),s=n(25),u=n(6),l=n.n(u),p=(n(205),["className","disabled","name","permalink"]);t.a=function(e){var t=e.className,n=void 0===t?"":t,r=e.disabled,o=void 0!==r&&r,u=e.name,d=e.permalink,b=void 0===d?"":d,m=a()(e,p),f=l()("wc-block-components-product-name",n);return o?Object(i.createElement)("span",c()({className:f},m,{dangerouslySetInnerHTML:{__html:Object(s.decodeEntities)(u)}})):Object(i.createElement)("a",c()({className:f,href:b},m,{dangerouslySetInnerHTML:{__html:Object(s.decodeEntities)(u)}}))}},155:function(e,t,n){"use strict";var r=n(0),c=n(119),o=n(91),a=function(e){var t=e.indexOf("</p>");return-1===t?e:e.substr(0,t+4)},i=function(e){return e.replace(/<\/?[a-z][^>]*?>/gi,"")},s=function(e,t){return e.replace(/[\s|\.\,]+$/i,"")+t},u=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"&hellip;",r=i(e),c=r.split(" ").splice(0,t).join(" ");return Object(o.autop)(s(c,n))},l=function(e,t){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"&hellip;",c=i(e),a=c.slice(0,t);if(n)return Object(o.autop)(s(a,r));var u=a.match(/([\s]+)/g),l=u?u.length:0,p=c.slice(0,t+l);return Object(o.autop)(s(p,r))};t.a=function(e){var t=e.source,n=e.maxLength,i=void 0===n?15:n,s=e.countType,p=void 0===s?"words":s,d=e.className,b=void 0===d?"":d,m=Object(r.useMemo)((function(){return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:15,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"words",r=Object(o.autop)(e),i=Object(c.count)(r,n);if(i<=t)return r;var s=a(r),p=Object(c.count)(s,n);return p<=t?s:"words"===n?u(s,t):l(s,t,"characters_including_spaces"===n)}(t,i,p)}),[t,i,p]);return Object(r.createElement)(r.RawHTML,{className:b},m)}},158:function(e,t,n){"use strict";var r=n(0),c=n(28),o=Object(r.createElement)(c.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(r.createElement)("mask",{id:"external-mask",width:"24",height:"24",x:"0",y:"0",maskUnits:"userSpaceOnUse"},Object(r.createElement)("path",{fill:"#fff",d:"M6.3431 6.3431v1.994l7.8984.0072-8.6055 8.6054 1.4142 1.4143 8.6055-8.6055.0071 7.8984h1.994V6.3431H6.3431z"})),Object(r.createElement)("g",{mask:"url(#external-mask)"},Object(r.createElement)("path",{d:"M0 0h24v24H0z"})));t.a=o},159:function(e,t,n){"use strict";n.d(t,"c",(function(){return o})),n.d(t,"d",(function(){return a})),n.d(t,"a",(function(){return i})),n.d(t,"b",(function(){return s}));var r=n(26),c=n(37),o=function(e,t){if(c.n>2)return Object(r.registerBlockType)(e,t)},a=function(e,t){if(c.n>1)return Object(r.registerBlockType)(e,t)},i=function(){return c.n>2},s=function(){return c.n>1}},162:function(e,t,n){"use strict";n.d(t,"b",(function(){return a})),n.d(t,"c",(function(){return i})),n.d(t,"a",(function(){return s}));var r=n(3),c=n(113),o=n(23),a=function(e){var t=e.country,n=void 0===t?"":t,r=e.state,c=void 0===r?"":r,o=e.city,a=void 0===o?"":o,i=e.postcode,s=void 0===i?"":i;return{country:n.trim(),state:c.trim(),city:a.trim(),postcode:s?s.replace(" ","").toUpperCase():""}},i=function(e){var t=e.email,n=void 0===t?"":t;return Object(o.isEmail)(n)?n.trim():""},s=function(e){var t=Object.keys(r.defaultAddressFields),n=Object(c.a)(t,{},e.country),o=Object.assign({},e);return n.forEach((function(t){var n=t.key,r=void 0===n?"":n,c=t.hidden;void 0!==c&&c&&function(e,t){return e in t}(r,e)&&(o[r]="")})),o}},163:function(e,t,n){"use strict";n.d(t,"b",(function(){return a})),n.d(t,"a",(function(){return i}));var r=n(62),c=n(174),o=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=Object(c.b)(),n=t.paymentMethods,o=t.expressPaymentMethods,a=t.paymentMethodsInitialized,i=t.expressPaymentMethodsInitialized,s=Object(r.a)(n),u=Object(r.a)(o);return{paymentMethods:e?u:s,isInitialized:e?i:a}},a=function(){return o(!1)},i=function(){return o(!0)}},167:function(e,t,n){"use strict";var r=n(0),c=n(6),o=n.n(c),a=n(21),i=n(140);n(272),t.a=Object(a.withInstanceId)((function(e){var t=e.className,n=e.instanceId,c=e.id,a=e.selected,s=e.onChange,u=e.options,l=void 0===u?[]:u,p=c||n;return l.length&&Object(r.createElement)("div",{className:o()("wc-block-components-radio-control",t)},l.map((function(e){return Object(r.createElement)(i.a,{key:"".concat(p,"-").concat(e.value),name:"radio-control-".concat(p),checked:e.value===a,option:e,onChange:function(t){s(t),"function"==typeof e.onChange&&e.onChange(t)}})})))}))},168:function(e,t,n){"use strict";var r=n(17),c=n.n(r),o=n(18),a=n.n(o),i=n(13),s=n.n(i),u=n(19),l=n.n(u),p=n(20),d=n.n(p),b=n(10),m=n.n(b),f=n(5),g=n.n(f),O=n(0),h=n(1),j=n(11),v=(n(2),n(3)),E=n(44);var y=function(e){l()(o,e);var t,n,r=(t=o,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=m()(t);if(n){var c=m()(this).constructor;e=Reflect.construct(r,arguments,c)}else e=r.apply(this,arguments);return d()(this,e)});function o(){var e;c()(this,o);for(var t=arguments.length,n=new Array(t),a=0;a<t;a++)n[a]=arguments[a];return e=r.call.apply(r,[this].concat(n)),g()(s()(e),"state",{errorMessage:"",hasError:!1}),e}return a()(o,[{key:"render",value:function(){var e=this.state,t=e.hasError,n=e.errorMessage,r=this.props.isEditor;if(t){var c=Object(h.__)("This site is experiencing difficulties with this payment method. Please contact the owner of the site for assistance.",'woocommerce');(r||v.CURRENT_USER_IS_ADMIN)&&(c=n||Object(h.__)("There was an error with this payment method. Please verify it's configured correctly.",'woocommerce'));var o=[{id:"0",content:c,isDismissible:!1,status:"error"}];return Object(O.createElement)(E.StoreNoticesContainer,{notices:o})}return this.props.children}}],[{key:"getDerivedStateFromError",value:function(e){return{errorMessage:e.message,hasError:!0}}}]),o}(j.Component);y.defaultProps={isEditor:!1},t.a=y},169:function(e,t,n){"use strict";var r=n(9),c=n.n(r),o=n(5),a=n.n(o),i=n(0),s=n(6),u=n.n(s),l=function(e){return"wc-block-components-payment-method-icon wc-block-components-payment-method-icon--".concat(e)},p=function(e){var t=e.id,n=e.src,r=void 0===n?null:n,c=e.alt,o=void 0===c?"":c;return r?Object(i.createElement)("img",{className:l(t),src:r,alt:o}):null},d=n(37),b=[{id:"alipay",alt:"Alipay",src:d.m+"payment-methods/alipay.svg"},{id:"amex",alt:"American Express",src:d.m+"payment-methods/amex.svg"},{id:"bancontact",alt:"Bancontact",src:d.m+"payment-methods/bancontact.svg"},{id:"diners",alt:"Diners Club",src:d.m+"payment-methods/diners.svg"},{id:"discover",alt:"Discover",src:d.m+"payment-methods/discover.svg"},{id:"eps",alt:"EPS",src:d.m+"payment-methods/eps.svg"},{id:"giropay",alt:"Giropay",src:d.m+"payment-methods/giropay.svg"},{id:"ideal",alt:"iDeal",src:d.m+"payment-methods/ideal.svg"},{id:"jcb",alt:"JCB",src:d.m+"payment-methods/jcb.svg"},{id:"laser",alt:"Laser",src:d.m+"payment-methods/laser.svg"},{id:"maestro",alt:"Maestro",src:d.m+"payment-methods/maestro.svg"},{id:"mastercard",alt:"Mastercard",src:d.m+"payment-methods/mastercard.svg"},{id:"multibanco",alt:"Multibanco",src:d.m+"payment-methods/multibanco.svg"},{id:"p24",alt:"Przelewy24",src:d.m+"payment-methods/p24.svg"},{id:"sepa",alt:"Sepa",src:d.m+"payment-methods/sepa.svg"},{id:"sofort",alt:"Sofort",src:d.m+"payment-methods/sofort.svg"},{id:"unionpay",alt:"Union Pay",src:d.m+"payment-methods/unionpay.svg"},{id:"visa",alt:"Visa",src:d.m+"payment-methods/visa.svg"},{id:"wechat",alt:"WeChat",src:d.m+"payment-methods/wechat.svg"}],m=n(38),f=n.n(m),g=n(72);function O(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function h(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?O(Object(n),!0).forEach((function(t){a()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):O(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}n(275),t.a=function(e){var t=e.icons,n=void 0===t?[]:t,r=e.align,o=void 0===r?"center":r,a=function(e){var t={};return e.forEach((function(e){var n={};"string"==typeof e&&(n={id:e,alt:e,src:null}),"object"===f()(e)&&(n={id:e.id||"",alt:e.alt||"",src:e.src||null}),n.id&&Object(g.c)(n.id)&&!t[n.id]&&(t[n.id]=n)})),Object.values(t)}(n);if(0===a.length)return null;var s=u()("wc-block-components-payment-method-icons",{"wc-block-components-payment-method-icons--align-left":"left"===o,"wc-block-components-payment-method-icons--align-right":"right"===o});return Object(i.createElement)("div",{className:s},a.map((function(e){var t,n=h(h({},e),(t=e.id,b.find((function(e){return e.id===t}))||{}));return Object(i.createElement)(p,c()({key:"payment-method-icon-"+e.id},n))})))}},174:function(e,t,n){"use strict";n.d(t,"b",(function(){return J})),n.d(t,"a",(function(){return ee}));var r,c,o=n(33),a=n.n(o),i=n(8),s=n.n(i),u=n(0);!function(e){e.PRISTINE="pristine",e.STARTED="started",e.PROCESSING="processing",e.ERROR="has_error",e.FAILED="failed",e.SUCCESS="success",e.COMPLETE="complete"}(r||(r={})),function(e){e.SET_REGISTERED_PAYMENT_METHODS="set_registered_payment_methods",e.SET_REGISTERED_EXPRESS_PAYMENT_METHODS="set_registered_express_payment_methods",e.SET_SHOULD_SAVE_PAYMENT_METHOD="set_should_save_payment_method"}(c||(c={}));var l={currentStatus:r.PRISTINE,shouldSavePaymentMethod:!1,paymentMethodData:{payment_method:""},hasSavedToken:!1,errorMessage:"",paymentMethods:{},expressPaymentMethods:{}},p={setPaymentStatus:function(){return{pristine:function(){},started:function(){},processing:function(){},completed:function(){},error:function(e){},failed:function(e,t){},success:function(e,t){}}},currentStatus:{isPristine:!0,isStarted:!1,isProcessing:!1,isFinished:!1,hasError:!1,hasFailed:!1,isSuccessful:!1,isDoingExpressPayment:!1},paymentStatuses:r,paymentMethodData:{},errorMessage:"",activePaymentMethod:"",setActivePaymentMethod:function(){},activeSavedToken:"",setActiveSavedToken:function(){},customerPaymentMethods:{},paymentMethods:{},expressPaymentMethods:{},paymentMethodsInitialized:!1,expressPaymentMethodsInitialized:!1,onPaymentProcessing:function(){return function(){return function(){}}},setExpressPaymentError:function(){},isExpressPaymentMethodActive:!1,setShouldSavePayment:function(){},shouldSavePayment:!1},d=n(5),b=n.n(d),m=n(38),f=n.n(m);function g(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function O(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?g(Object(n),!0).forEach((function(t){b()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):g(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var h=function(e){return!("object"!==f()(e)||!e.isSavedToken)},j=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:l,t=arguments.length>1?arguments[1]:void 0,n=t.type,o=t.paymentMethodData,a=t.shouldSavePaymentMethod,i=void 0!==a&&a,s=t.errorMessage,u=void 0===s?"":s,p=t.paymentMethods,d=void 0===p?{}:p;switch(n){case r.STARTED:return O(O({},e),{},{currentStatus:r.STARTED,paymentMethodData:o||e.paymentMethodData,hasSavedToken:h(o||e.paymentMethodData)});case r.ERROR:return e.currentStatus!==r.ERROR?O(O({},e),{},{currentStatus:r.ERROR,errorMessage:u||e.errorMessage}):e;case r.FAILED:return e.currentStatus!==r.FAILED?O(O({},e),{},{currentStatus:r.FAILED,paymentMethodData:o||e.paymentMethodData,errorMessage:u||e.errorMessage}):e;case r.SUCCESS:return e.currentStatus!==r.SUCCESS?O(O({},e),{},{currentStatus:r.SUCCESS,paymentMethodData:o||e.paymentMethodData,hasSavedToken:h(o||e.paymentMethodData)}):e;case r.PROCESSING:return e.currentStatus!==r.PROCESSING?O(O({},e),{},{currentStatus:r.PROCESSING,errorMessage:""}):e;case r.COMPLETE:return e.currentStatus!==r.COMPLETE?O(O({},e),{},{currentStatus:r.COMPLETE}):e;case r.PRISTINE:return O(O({},l),{},{currentStatus:r.PRISTINE,paymentMethods:O({},e.paymentMethods),expressPaymentMethods:O({},e.expressPaymentMethods),shouldSavePaymentMethod:e.shouldSavePaymentMethod});case c.SET_REGISTERED_PAYMENT_METHODS:return O(O({},e),{},{paymentMethods:d});case c.SET_REGISTERED_EXPRESS_PAYMENT_METHODS:return O(O({},e),{},{expressPaymentMethods:d});case c.SET_SHOULD_SAVE_PAYMENT_METHOD:return O(O({},e),{},{shouldSavePaymentMethod:i})}},v=n(29),E=n.n(v),y=n(22),_=n.n(y),w=n(1),S=n(60),k=n(62),C=n(3),P=n(222),N=n(63),M=n(75),R=n(67),I=n(43),x=n(59),D=n(50);function T(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function A(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?T(Object(n),!0).forEach((function(t){b()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):T(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var L=function(e,t,n,r){var c=Object(u.useState)(!1),o=s()(c,2),a=o[0],i=o[1],l=Object(N.b)().isEditor,p=Object(M.b)().selectedRates,d=Object(R.b)(),m=d.billingData,g=d.shippingAddress,O=Object(k.a)(p),h=Object(k.a)(n),j=Object(I.a)(),v=j.cartTotals,y=j.cartNeedsShipping,S=j.paymentRequirements,D=Object(u.useRef)({cart:j,cartTotals:v,cartNeedsShipping:y,billingData:m,shippingAddress:g,selectedShippingMethods:O,paymentRequirements:S}),T=Object(x.a)().addErrorNotice;Object(u.useEffect)((function(){D.current={cart:j,cartTotals:v,cartNeedsShipping:y,billingData:m,shippingAddress:g,selectedShippingMethods:O,paymentRequirements:S}}),[j,v,y,m,g,O,S]);var L=Object(u.useCallback)(E()(_.a.mark((function n(){var c,o,a,s,u,p,d;return _.a.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:c={},o=function(e){c=A(A({},c),{},b()({},e.name,e))},a=0;case 3:if(!(a<h.length)){n.next=29;break}if(s=h[a],u=t[s]){n.next=8;break}return n.abrupt("continue",26);case 8:if(n.prev=8,!l){n.next=13;break}n.t0=!0,n.next=16;break;case 13:return n.next=15,Promise.resolve(u.canMakePayment(D.current));case 15:n.t0=n.sent;case 16:if(!(p=n.t0)){n.next=21;break}if("object"!==f()(p)||null===p||!p.error){n.next=20;break}throw new Error(p.error.message);case 20:o(u);case 21:n.next=26;break;case 23:n.prev=23,n.t1=n.catch(8),(C.CURRENT_USER_IS_ADMIN||l)&&(d=Object(w.sprintf)(
/* translators: %s the id of the payment method being registered (bank transfer, Stripe...) */
Object(w.__)("There was an error registering the payment method with id '%s': ",'woocommerce'),u.paymentMethodId),T("".concat(d," ").concat(n.t1),{context:r,id:"wc-".concat(u.paymentMethodId,"-registration-error")}));case 26:a++,n.next=3;break;case 29:e(c),i(!0);case 31:case"end":return n.stop()}}),n,null,[[8,23]])}))),[T,e,l,r,h,t]),U=Object(P.a)(L,500),F=s()(U,1)[0];return Object(u.useEffect)((function(){F()}),[F,j,O,m]),a},U=function(e){return{type:e}},F=function(e){return{type:r.ERROR,errorMessage:e}},V=function(e){var t=e.errorMessage,n=e.paymentMethodData;return{type:r.FAILED,errorMessage:t,paymentMethodData:n}},z=function(e){var t=e.paymentMethodData;return{type:r.SUCCESS,paymentMethodData:t}},B=function(e){var t=e.paymentMethodData;return{type:r.STARTED,paymentMethodData:t}},G=function(e){return{type:c.SET_REGISTERED_PAYMENT_METHODS,paymentMethods:e}},q=function(e){return{type:c.SET_REGISTERED_EXPRESS_PAYMENT_METHODS,paymentMethods:e}},Y=function(e){return{type:c.SET_SHOULD_SAVE_PAYMENT_METHOD,shouldSavePaymentMethod:e}},H=n(68),W=n(57),Q=n(126),$=n(321),K=n(322),X=n(132),Z=Object(u.createContext)(p),J=function(){return Object(u.useContext)(Z)},ee=function(e){var t,n=e.children,c=Object(W.b)(),o=c.isProcessing,i=c.isIdle,p=c.isCalculating,d=c.hasError,b=Object(N.b)(),m=b.isEditor,g=b.getPreviewData,O=Object(X.b)().setValidationErrors,h=Object(x.a)(),v=h.addErrorNotice,E=h.removeNotice,y=Object(D.c)(),_=y.isSuccessResponse,w=y.isErrorResponse,k=y.isFailResponse,P=y.noticeContexts,I=Object(u.useReducer)(Q.b,{}),T=s()(I,2),A=T[0],J=(t=T[1],Object(u.useMemo)((function(){return{onPaymentProcessing:Object($.a)("payment_processing",t)}}),[t])).onPaymentProcessing,ee=Object(u.useRef)(A);Object(u.useEffect)((function(){ee.current=A}),[A]);var te,ne,re,ce=Object(u.useReducer)(j,l),oe=s()(ce,2),ae=oe[0],ie=(te=oe[1],ne=Object(R.b)().setBillingData,re=Object(M.b)().setShippingAddress,{dispatchActions:Object(u.useMemo)((function(){return{setRegisteredPaymentMethods:function(e){te(G(e))},setRegisteredExpressPaymentMethods:function(e){te(q(e))},setShouldSavePayment:function(e){te(Y(e))}}}),[te]),setPaymentStatus:Object(u.useCallback)((function(){return{pristine:function(){return te(U(r.PRISTINE))},started:function(e){te(B({paymentMethodData:e}))},processing:function(){return te(U(r.PROCESSING))},completed:function(){return te(U(r.COMPLETE))},error:function(e){return te(F(e))},failed:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;n&&ne(n),te(V({errorMessage:e||"",paymentMethodData:t||{}}))},success:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;t&&ne(t),void 0!==f()(n)&&null!=n&&n.address&&re(n.address),te(z({paymentMethodData:e}))}}}),[te,ne,re])}),se=ie.dispatchActions,ue=ie.setPaymentStatus,le=function(e){var t=Object(S.getPaymentMethods)(),n=Object(D.c)().noticeContexts,r=new Set([].concat(a()(Object(C.getSetting)("paymentGatewaySortOrder",[])),a()(Object.keys(t))));return L(e,t,Array.from(r),n.PAYMENTS)}(se.setRegisteredPaymentMethods),pe=function(e){var t=Object(S.getExpressPaymentMethods)(),n=Object(D.c)().noticeContexts;return L(e,t,Object.keys(t),n.EXPRESS_PAYMENTS)}(se.setRegisteredExpressPaymentMethods),de=function(){var e=Object(H.a)().dispatchCheckoutEvent,t=Object(u.useState)(""),n=s()(t,2),r=n[0],c=n[1],o=Object(u.useState)(""),a=s()(o,2),i=a[0],l=a[1];return Object(u.useEffect)((function(){e("set-active-payment-method",{activePaymentMethod:r})}),[e,r]),{activePaymentMethod:r,activeSavedToken:i,setActivePaymentMethod:c,setActiveSavedToken:l}}(),be=de.activePaymentMethod,me=de.activeSavedToken,fe=de.setActivePaymentMethod,ge=de.setActiveSavedToken,Oe=Object(u.useMemo)((function(){return m?g("previewSavedPaymentMethods"):le?function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(0===Object.keys(e).length)return{};var t=Object(C.getSetting)("customerPaymentMethods",{}),n=Object.keys(t),r={};return n.forEach((function(n){var c=t[n].filter((function(t){var n,r=t.method.gateway;return r in e&&(null===(n=e[r].supports)||void 0===n?void 0:n.showSavedCards)}));c.length&&(r[n]=c)})),r}(ae.paymentMethods):{}}),[m,g,le,ae.paymentMethods]),he=Object(u.useCallback)((function(e){e?v(e,{id:"wc-express-payment-error",context:P.EXPRESS_PAYMENTS}):E("wc-express-payment-error",P.EXPRESS_PAYMENTS)}),[v,P.EXPRESS_PAYMENTS,E]),je=Object.keys(ae.expressPaymentMethods).includes(be),ve=Object(u.useMemo)((function(){return{isPristine:ae.currentStatus===r.PRISTINE,isStarted:ae.currentStatus===r.STARTED,isProcessing:ae.currentStatus===r.PROCESSING,isFinished:[r.ERROR,r.FAILED,r.SUCCESS].includes(ae.currentStatus),hasError:ae.currentStatus===r.ERROR,hasFailed:ae.currentStatus===r.FAILED,isSuccessful:ae.currentStatus===r.SUCCESS,isDoingExpressPayment:ae.currentStatus!==r.PRISTINE&&je}}),[ae.currentStatus,je]);Object(u.useEffect)((function(){var e=Object.keys(ae.paymentMethods),t=[].concat(a()(e),a()(Object.keys(ae.expressPaymentMethods)));le&&e.length&&fe((function(e){return e&&t.includes(e)?e:(ue().pristine(),Object.keys(ae.paymentMethods)[0])}))}),[le,ae.paymentMethods,ae.expressPaymentMethods,fe,ue]),Object(u.useEffect)((function(){!o||d||p||ve.isFinished||ue().processing()}),[o,d,p,ve.isFinished,ue]),Object(u.useEffect)((function(){i&&!ve.isSuccessful&&ue().pristine()}),[i,ve.isSuccessful,ue]),Object(u.useEffect)((function(){d&&ve.isSuccessful&&!ae.hasSavedToken&&ue().pristine()}),[d,ve.isSuccessful,ae.hasSavedToken,ue]),Object(u.useEffect)((function(){ve.isProcessing&&(E("wc-payment-error",P.PAYMENTS),Object(K.b)(ee.current,"payment_processing",{}).then((function(e){var t,n,r,c,o,a,i,s;if(e.forEach((function(e){_(e)&&(t=e),(w(e)||k(e))&&(n=e)})),t&&!n)ue().success(null===(r=t)||void 0===r||null===(c=r.meta)||void 0===c?void 0:c.paymentMethodData,null===(o=t)||void 0===o||null===(a=o.meta)||void 0===a?void 0:a.billingData,null===(i=t)||void 0===i||null===(s=i.meta)||void 0===s?void 0:s.shippingData);else if(n&&k(n)){var u,l,p,d,b,m;n.message&&n.message.length&&v(n.message,{id:"wc-payment-error",isDismissible:!1,context:(null===(m=n)||void 0===m?void 0:m.messageContext)||P.PAYMENTS}),ue().failed(null===(u=n)||void 0===u?void 0:u.message,null===(l=n)||void 0===l||null===(p=l.meta)||void 0===p?void 0:p.paymentMethodData,null===(d=n)||void 0===d||null===(b=d.meta)||void 0===b?void 0:b.billingData)}else if(n){var f,g;n.message&&n.message.length&&v(n.message,{id:"wc-payment-error",isDismissible:!1,context:(null===(g=n)||void 0===g?void 0:g.messageContext)||P.PAYMENTS}),ue().error(n.message),O(null===(f=n)||void 0===f?void 0:f.validationErrors)}else ue().success()})))}),[ve.isProcessing,O,ue,E,P.PAYMENTS,_,k,w,v]);var Ee={setPaymentStatus:ue,currentStatus:ve,paymentStatuses:r,paymentMethodData:ae.paymentMethodData,errorMessage:ae.errorMessage,activePaymentMethod:be,setActivePaymentMethod:fe,activeSavedToken:me,setActiveSavedToken:ge,onPaymentProcessing:J,customerPaymentMethods:Oe,paymentMethods:ae.paymentMethods,expressPaymentMethods:ae.expressPaymentMethods,paymentMethodsInitialized:le,expressPaymentMethodsInitialized:pe,setExpressPaymentError:he,isExpressPaymentMethodActive:je,shouldSavePayment:ae.shouldSavePaymentMethod,setShouldSavePayment:se.setShouldSavePayment};return Object(u.createElement)(Z.Provider,{value:Ee},n)}},175:function(e,t){},179:function(e,t){},189:function(e,t){},190:function(e,t){},191:function(e,t){e.exports=window.wp.warning},195:function(e,t,n){"use strict";var r=n(33),c=n.n(r),o=n(0),a=n(1),i=n(4),s=n(14),u=n(39);t.a=function(e){var t=e.setPageId,n=e.pageId,r=e.labels,l=Object(s.useSelect)((function(e){return e("core").getEntityRecords("postType","page",{status:"publish",orderby:"title",order:"asc",per_page:100})}),[])||null;return l?Object(o.createElement)(i.PanelBody,{title:r.title},Object(o.createElement)(i.SelectControl,{label:Object(a.__)("Link to",'woocommerce'),value:n,options:[{label:r.default,value:0}].concat(c()(l.map((function(e){return{label:Object(u.a)(e,l),value:parseInt(e.id,10)}})))),onChange:function(e){return t(parseInt(e,10))}})):null}},196:function(e,t,n){"use strict";n.d(t,"a",(function(){return u}));var r=n(0),c=n(1),o=(n(2),n(66)),a=n(237),i=n(158),s=(n(258),function(e){var t=e.text,n=e.url,s=void 0===n?"https://ideas.woocommerce.com/forums/133476-woocommerce?category_id=384565":n;return Object(r.createElement)("div",{className:"wc-block-feedback-prompt"},Object(r.createElement)(o.a,{srcElement:a.a}),Object(r.createElement)("h2",{className:"wc-block-feedback-prompt__title"},Object(c.__)("Feedback?",'woocommerce')),Object(r.createElement)("p",{className:"wc-block-feedback-prompt__text"},t),Object(r.createElement)("a",{href:s,className:"wc-block-feedback-prompt__link",rel:"noreferrer noopener",target:"_blank"},Object(c.__)("Give us your feedback.",'woocommerce'),Object(r.createElement)(o.a,{srcElement:i.a,size:16})))}),u=function(){return Object(r.createElement)(s,{text:Object(c.__)("We are currently working on improving our cart and checkout blocks to provide merchants with the tools and customization options they need.",'woocommerce'),url:"https://github.com/woocommerce/woocommerce-gutenberg-products-block/issues/new?template=--cart-checkout-feedback.md"})}},197:function(e,t){e.exports=window.wp.plugins},198:function(e,t,n){"use strict";var r=n(5),c=n.n(r),o=n(8),a=n.n(o),i=n(0),s=n(1),u=n(283),l=n(163),p=n(63),d=n(174),b=n(56),m=n.n(b),f=n(168);function g(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function O(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?g(Object(n),!0).forEach((function(t){c()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):g(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}t.a=function(){var e=Object(p.b)().isEditor,t=Object(d.b)(),n=t.setActivePaymentMethod,r=t.setExpressPaymentError,c=t.activePaymentMethod,o=t.paymentMethodData,b=t.setPaymentStatus,g=Object(u.a)(),h=Object(l.a)().paymentMethods,j=Object(i.useRef)(c),v=Object(i.useRef)(o),E=Object(i.useCallback)((function(e){return function(){j.current=c,v.current=o,b().started({}),n(e)}}),[c,o,n,b]),y=Object(i.useCallback)((function(){b().pristine(),n(j.current),v.current.isSavedToken&&b().started(v.current)}),[n,b]),_=Object(i.useCallback)((function(e){b().error(e),r(e),n(j.current),v.current.isSavedToken&&b().started(v.current)}),[n,b,r]),w=Object(i.useCallback)((function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";m()("Express Payment Methods should use the provided onError handler instead.",{alternative:"onError",plugin:"woocommerce-gutenberg-products-block",link:"https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/4228"}),e?_(e):r("")}),[r,_]),S=Object.entries(h),k=S.length>0?S.map((function(t){var n=a()(t,2),r=n[0],c=n[1],o=e?c.edit:c.content;return Object(i.isValidElement)(o)?Object(i.createElement)("li",{key:r,id:"express-payment-method-".concat(r)},Object(i.cloneElement)(o,O(O({},g),{},{onClick:E(r),onClose:y,onError:_,setExpressPaymentError:w}))):null})):Object(i.createElement)("li",{key:"noneRegistered"},Object(s.__)("No registered Payment Methods",'woocommerce'));return Object(i.createElement)(f.a,{isEditor:e},Object(i.createElement)("ul",{className:"wc-block-components-express-payment__event-buttons"},k))}},200:function(e,t,n){"use strict";var r=n(16),c=n.n(r),o=n(0),a=n(1),i=n(64),s=n(83),u=n(27),l=n(500),p=n(43),d=n(63),b=n(6),m=n.n(b),f=n(25),g=n(41),O=n(8),h=n.n(O),j=n(34),v=n.n(j),E=n(134),y=n(68),_=function(e){var t;return null===(t=e.find((function(e){return e.selected})))||void 0===t?void 0:t.rate_id},w=n(167),S=n(129),k=n(47),C=n(53),P=n(3),N=function(e){var t=Object(P.getSetting)("displayCartPricesIncludingTax",!1)?parseInt(e.price,10)+parseInt(e.taxes,10):parseInt(e.price,10);return{label:Object(f.decodeEntities)(e.name),value:e.rate_id,description:Object(o.createElement)(o.Fragment,null,Number.isFinite(t)&&Object(o.createElement)(C.a,{currency:Object(k.getCurrencyFromPriceResponse)(e),value:t}),Number.isFinite(t)&&e.delivery_time?" — ":null,Object(f.decodeEntities)(e.delivery_time))}},M=function(e){var t=e.className,n=e.noResultsMessage,r=e.onSelectRate,c=e.rates,a=e.renderOption,i=void 0===a?N:a,s=e.selected;if(0===c.length)return n;if(c.length>1)return Object(o.createElement)(w.a,{className:t,onChange:function(e){r(e)},selected:s,options:c.map(i)});var u=i(c[0]),l=u.label,p=u.secondaryLabel,d=u.description,b=u.secondaryDescription;return Object(o.createElement)(S.a,{label:l,secondaryLabel:p,description:d,secondaryDescription:b})},R=(n(271),function(e){var t=e.packageId,n=e.className,r=e.noResultsMessage,c=e.renderOption,i=e.packageData,s=e.collapsible,l=void 0!==s&&s,p=e.collapse,d=void 0!==p&&p,b=e.showItems,O=void 0!==b&&b,j=function(e,t){var n=Object(y.a)().dispatchCheckoutEvent,r=Object(E.a)(),c=r.selectShippingRate,a=r.isSelectingRate,i=Object(o.useState)((function(){return _(t)})),s=h()(i,2),u=s[0],l=s[1],p=Object(o.useRef)(t);return Object(o.useEffect)((function(){v()(p.current,t)||(p.current=t,l(_(t)))}),[t]),{selectShippingRate:Object(o.useCallback)((function(t){l(t),c(t,e),n("set-selected-shipping-rate",{shippingRateId:t})}),[e,c,n]),selectedShippingRate:u,isSelectingRate:a}}(t,i.shipping_rates),w=j.selectShippingRate,S=j.selectedShippingRate,k=Object(o.createElement)(o.Fragment,null,(O||l)&&Object(o.createElement)("div",{className:"wc-block-components-shipping-rates-control__package-title"},i.name),O&&Object(o.createElement)("ul",{className:"wc-block-components-shipping-rates-control__package-items"},Object.values(i.items).map((function(e){var t=Object(f.decodeEntities)(e.name),n=e.quantity;return Object(o.createElement)("li",{key:e.key,className:"wc-block-components-shipping-rates-control__package-item"},Object(o.createElement)(g.a,{label:n>1?"".concat(t," × ").concat(n):"".concat(t),screenReaderLabel:Object(a.sprintf)(
/* translators: %1$s name of the product (ie: Sunglasses), %2$d number of units in the current cart package */
Object(a._n)("%1$s (%2$d unit)","%1$s (%2$d units)",n,'woocommerce'),t,n)}))})))),C=Object(o.createElement)(M,{className:n,noResultsMessage:r,rates:i.shipping_rates,onSelectRate:w,selected:S,renderOption:c});return l?Object(o.createElement)(u.Panel,{className:"wc-block-components-shipping-rates-control__package",initialOpen:!d,title:k},C):Object(o.createElement)("div",{className:m()("wc-block-components-shipping-rates-control__package",n)},k,C)}),I=["package_id"],x=["extensions","receiveCart"],D=function(e){var t=e.packages,n=e.collapse,r=e.showItems,a=e.collapsible,i=e.noResultsMessage,s=e.renderOption;return t.length?Object(o.createElement)(o.Fragment,null,t.map((function(e){var t=e.package_id,u=c()(e,I);return Object(o.createElement)(R,{key:t,packageId:t,packageData:u,collapsible:a,collapse:n,showItems:r,noResultsMessage:i,renderOption:s})}))):null};t.a=function(e){var t=e.shippingRates,n=e.shippingRatesLoading,r=e.className,b=e.collapsible,m=void 0!==b&&b,f=e.noResultsMessage,g=e.renderOption;Object(o.useEffect)((function(){if(!n){var e=Object(l.a)(t),r=Object(l.b)(t);1===e?Object(i.speak)(Object(a.sprintf)(
/* translators: %d number of shipping options found. */
Object(a._n)("%d shipping option was found.","%d shipping options were found.",r,'woocommerce'),r)):Object(i.speak)(Object(a.sprintf)(
/* translators: %d number of shipping packages packages. */
Object(a._n)("Shipping option searched for %d package.","Shipping options searched for %d packages.",e,'woocommerce'),e)+" "+Object(a.sprintf)(
/* translators: %d number of shipping options available. */
Object(a._n)("%d shipping option was found","%d shipping options were found",r,'woocommerce'),r))}}),[n,t]);var O=Object(p.a)(),h=O.extensions,j=(O.receiveCart,{className:r,collapsible:m,noResultsMessage:f,renderOption:g,extensions:h,cart:c()(O,x),components:{ShippingRatesControlPackage:R}}),v=Object(d.b)().isEditor;return Object(o.createElement)(s.a,{isLoading:n,screenReaderLabel:Object(a.__)("Loading shipping rates…",'woocommerce'),showSpinner:!0},v?Object(o.createElement)(D,{packages:t,noResultsMessage:f,renderOption:g}):Object(o.createElement)(o.Fragment,null,Object(o.createElement)(u.ExperimentalOrderShippingPackages.Slot,j),Object(o.createElement)(u.ExperimentalOrderShippingPackages,null,Object(o.createElement)(D,{packages:t,noResultsMessage:f,renderOption:g}))))}},201:function(e,t,n){"use strict";n.d(t,"a",(function(){return O}));var r=n(5),c=n.n(r),o=n(1),a=n(14),i=n(24),s=n(25),u=n(43),l=n(0);n(8),n(2),n(899),n(6),n(27),n(68),n(63);var p=Object(l.createContext)({notices:[],createSnackbarNotice:function(e,t){},removeSnackbarNotice:function(e,t){},setIsSuppressed:function(e){},context:"wc/core"});function d(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function b(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?d(Object(n),!0).forEach((function(t){c()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):d(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var m=n(132),f=n(59);function g(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}var O=function(){var e=Object(u.a)(),t=e.cartCoupons,n=e.cartIsLoading,r=Object(f.a)().addErrorNotice,d=function(){var e=Object(l.useContext)(p),t=e.notices,n=e.createSnackbarNotice,r=e.removeSnackbarNotice,c=e.setIsSuppressed,o=Object(l.useRef)(t);Object(l.useEffect)((function(){o.current=t}),[t]);var a=Object(l.useMemo)((function(){return{removeNotices:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;o.current.forEach((function(t){null!==e&&t.status!==e||r(t.id)}))},removeSnackbarNotice:r}}),[r]),i=Object(l.useMemo)((function(){return{addSnackbarNotice:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};n(e,t)}}}),[n]);return b(b(b({notices:t},a),i),{},{setIsSuppressed:c})}().addSnackbarNotice,O=Object(m.b)().setValidationErrors;return function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?g(Object(n),!0).forEach((function(t){c()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):g(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({appliedCoupons:t,isLoading:n},Object(a.useSelect)((function(e,t){var n=t.dispatch,c=e(i.CART_STORE_KEY),a=c.isApplyingCoupon(),u=c.isRemovingCoupon(),l=n(i.CART_STORE_KEY),p=l.applyCoupon,b=l.removeCoupon,m=l.receiveApplyingCoupon;return{applyCoupon:function(e){p(e).then((function(t){!0===t&&d(Object(o.sprintf)(
/* translators: %s coupon code. */
Object(o.__)('Coupon code "%s" has been applied to your cart.','woocommerce'),e),{id:"coupon-form"})})).catch((function(e){O({coupon:{message:Object(s.decodeEntities)(e.message),hidden:!1}}),m("")}))},removeCoupon:function(e){b(e).then((function(t){!0===t&&d(Object(o.sprintf)(
/* translators: %s coupon code. */
Object(o.__)('Coupon code "%s" has been removed from your cart.','woocommerce'),e),{id:"coupon-form"})})).catch((function(e){r(e.message,{id:"coupon-form"}),m("")}))},isApplyingCoupon:a,isRemovingCoupon:u}}),[r,d]))}},205:function(e,t){},206:function(e,t){},207:function(e,t){},208:function(e,t){},209:function(e,t){},21:function(e,t){e.exports=window.wp.compose},210:function(e,t){},218:function(e,t){},22:function(e,t){e.exports=window.regeneratorRuntime},220:function(e,t,n){"use strict";var r=n(9),c=n.n(r),o=n(16),a=n.n(o),i=n(0),s=(n(2),n(6)),u=n.n(s),l=n(1),p=n(66),d=n(305),b=(n(179),["text","screenReaderText","element","className","radius","children"]),m=function(e){var t=e.text,n=e.screenReaderText,r=void 0===n?"":n,o=e.element,s=void 0===o?"li":o,l=e.className,p=void 0===l?"":l,d=e.radius,m=void 0===d?"small":d,f=e.children,g=void 0===f?null:f,O=a()(e,b),h=s,j=u()(p,"wc-block-components-chip","wc-block-components-chip--radius-"+m),v=Boolean(r&&r!==t);return Object(i.createElement)(h,c()({className:j},O),Object(i.createElement)("span",{"aria-hidden":v,className:"wc-block-components-chip__text"},t),v&&Object(i.createElement)("span",{className:"screen-reader-text"},r),g)},f=["ariaLabel","className","disabled","onRemove","removeOnAnyClick","text","screenReaderText"];t.a=function(e){var t=e.ariaLabel,n=void 0===t?"":t,r=e.className,o=void 0===r?"":r,s=e.disabled,b=void 0!==s&&s,g=e.onRemove,O=void 0===g?function(){}:g,h=e.removeOnAnyClick,j=void 0!==h&&h,v=e.text,E=e.screenReaderText,y=void 0===E?"":E,_=a()(e,f),w=j?"span":"button";if(!n){var S=y&&"string"==typeof y?y:v;n="string"!=typeof S?
/* translators: Remove chip. */
Object(l.__)("Remove",'woocommerce'):Object(l.sprintf)(
/* translators: %s text of the chip to remove. */
Object(l.__)('Remove "%s"','woocommerce'),S)}var k={"aria-label":n,disabled:b,onClick:O,onKeyDown:function(e){"Backspace"!==e.key&&"Delete"!==e.key||O()}},C=j?k:{},P=j?{"aria-hidden":!0}:k;return Object(i.createElement)(m,c()({},_,C,{className:u()(o,"is-removable"),element:j?"button":_.element,screenReaderText:y,text:v}),Object(i.createElement)(w,c()({className:"wc-block-components-chip__remove"},P),Object(i.createElement)(p.a,{className:"wc-block-components-chip__remove-icon",srcElement:d.a,size:16})))}},23:function(e,t){e.exports=window.wp.url},234:function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(0),c=(n(2),n(132)),o=(n(210),function(e){var t=e.errorMessage,n=void 0===t?"":t,o=e.propertyName,a=void 0===o?"":o,i=e.elementId,s=void 0===i?"":i,u=Object(c.b)(),l=u.getValidationError,p=u.getValidationErrorId;if(!n||"string"!=typeof n){var d=l(a)||{};if(!d.message||d.hidden)return null;n=d.message}return Object(r.createElement)("div",{className:"wc-block-components-validation-error",role:"alert"},Object(r.createElement)("p",{id:p(s)},n))})},235:function(e,t,n){"use strict";n.d(t,"a",(function(){return I}));var r=n(0),c=n(197),o=n(3),a=n(125),i=n(174),s=n(75),u=n(67),l=n(57),p=n(29),d=n.n(p),b=n(5),m=n.n(b),f=n(8),g=n.n(f),O=n(22),h=n.n(O),j=n(1),v=n(15),E=n.n(v),y=n(162),_=n(42),w=function(e,t,n){var r=Object.keys(e).map((function(t){return{key:t,value:e[t]}}),[]),c="wc-".concat(n,"-new-payment-method");return r.push({key:c,value:t}),r},S=function(e,t){E.a.setNonce&&"function"==typeof E.a.setNonce&&E.a.setNonce(e),null!=e&&e.get("X-WC-Store-API-User")&&t.setCustomerId(parseInt(e.get("X-WC-Store-API-User")||"0",10))},k=n(132),C=n(43),P=n(59);function N(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function M(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?N(Object(n),!0).forEach((function(t){m()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):N(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var R=function(){var e=Object(l.b)(),t=e.hasError,n=e.onCheckoutValidationBeforeProcessing,c=e.dispatchActions,o=e.redirectUrl,a=e.isProcessing,p=e.isBeforeProcessing,b=e.isComplete,m=e.orderNotes,f=e.shouldCreateAccount,O=e.extensionData,v=Object(k.b)().hasValidationErrors,N=Object(s.b)().shippingErrorStatus,R=Object(u.b)(),I=R.billingData,x=R.shippingAddress,D=Object(C.a)(),T=D.cartNeedsPayment,A=D.receiveCart,L=Object(i.b)(),U=L.activePaymentMethod,F=L.isExpressPaymentMethodActive,V=L.currentStatus,z=L.paymentMethodData,B=L.expressPaymentMethods,G=L.paymentMethods,q=L.shouldSavePayment,Y=Object(P.a)(),H=Y.addErrorNotice,W=Y.removeNotice,Q=Y.setIsSuppressed,$=Object(r.useRef)(I),K=Object(r.useRef)(x),X=Object(r.useRef)(o),Z=Object(r.useState)(!1),J=g()(Z,2),ee=J[0],te=J[1],ne=Object(r.useMemo)((function(){var e,t=M(M({},B),G);return null==t||null===(e=t[U])||void 0===e?void 0:e.paymentMethodId}),[U,B,G]),re=v&&!F||V.hasError||N.hasError,ce=!t&&!re&&(V.isSuccessful||!T)&&a;Object(r.useEffect)((function(){Q(F)}),[F,Q]),Object(r.useEffect)((function(){re===t||!a&&!p||F||c.setHasError(re)}),[re,t,a,p,F,c]),Object(r.useEffect)((function(){$.current=I,K.current=x,X.current=o}),[I,x,o]);var oe=Object(r.useCallback)((function(){return!v&&(V.hasError?{errorMessage:Object(j.__)("There was a problem with your payment option.",'woocommerce')}:!N.hasError||{errorMessage:Object(j.__)("There was a problem with your shipping option.",'woocommerce')})}),[v,V.hasError,N.hasError]);Object(r.useEffect)((function(){var e;return F||(e=n(oe,0)),function(){F||e()}}),[n,oe,F]),Object(r.useEffect)((function(){X.current&&(window.location.href=X.current)}),[b]);var ae=Object(r.useCallback)(d()(h.a.mark((function e(){var t,n;return h.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!ee){e.next=2;break}return e.abrupt("return");case 2:te(!0),W("checkout"),t=T?{payment_method:ne,payment_data:w(z,q,U)}:{},n=M(M({billing_address:Object(y.a)($.current),shipping_address:Object(y.a)(K.current),customer_note:m,should_create_account:f},t),{},{extensions:M({},O)}),E()({path:"/wc/store/checkout",method:"POST",data:n,cache:"no-store",parse:!1}).then((function(e){if(S(e.headers,c),!e.ok)throw new Error(e);return e.json()})).then((function(e){c.setAfterProcessing(e),te(!1)})).catch((function(e){S(e.headers,c),e.json().then((function(e){var t,n,r;null!==(t=e.data)&&void 0!==t&&t.cart&&A(e.data.cart),H(Object(_.b)(e),{id:"checkout"}),null===(n=e.additional_errors)||void 0===n||null===(r=n.forEach)||void 0===r||r.call(n,(function(e){H(e.message,{id:e.error_code})})),c.setHasError(!0),c.setAfterProcessing(e),te(!1)}))}));case 7:case"end":return e.stop()}}),e)}))),[ee,W,m,f,T,ne,z,q,U,O,c,H,A]);return Object(r.useEffect)((function(){ce&&!ee&&ae()}),[ae,ce,ee]),null},I=function(e){var t=e.children,n=e.isCart,p=void 0!==n&&n,d=e.redirectUrl;return Object(r.createElement)(l.a,{redirectUrl:d,isCart:p},Object(r.createElement)(u.a,null,Object(r.createElement)(s.a,null,Object(r.createElement)(i.a,null,t,Object(r.createElement)(a.a,{renderError:o.CURRENT_USER_IS_ADMIN?null:function(){return null}},Object(r.createElement)(c.PluginArea,{scope:"woocommerce-checkout"})),Object(r.createElement)(R,null)))))}},237:function(e,t,n){"use strict";var r=n(0),c=n(28),o=Object(r.createElement)(c.SVG,{xmlns:"http://www.w3.org/2000/SVG",viewBox:"0 0 24 24"},Object(r.createElement)("path",{fill:"none",d:"M0 0h24v24H0V0z"}),Object(r.createElement)("path",{d:"M21.99 4c0-1.1-.89-2-1.99-2H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h14l4 4-.01-18zM20 4v13.17L18.83 16H4V4h16zM6 12h12v2H6zm0-3h12v2H6zm0-3h12v2H6z"}));t.a=o},24:function(e,t){e.exports=window.wc.wcBlocksData},25:function(e,t){e.exports=window.wp.htmlEntities},258:function(e,t){},259:function(e,t){},26:function(e,t){e.exports=window.wp.blocks},260:function(e,t){},261:function(e,t){},262:function(e,t){},263:function(e,t){},264:function(e,t){},265:function(e,t){},266:function(e,t){},267:function(e,t){},268:function(e,t){},269:function(e,t){},27:function(e,t){e.exports=window.wc.blocksCheckout},270:function(e,t){},271:function(e,t){},272:function(e,t){},273:function(e,t){},274:function(e,t){},275:function(e,t){},276:function(e,t){},277:function(e,t,n){"use strict";var r=n(9),c=n.n(r),o=n(0),a=(n(362),function(e){if(e){var t=e.getBoundingClientRect().bottom;t>=0&&t<=window.innerHeight||e.scrollIntoView()}});t.a=function(e){return function(t){var n=Object(o.useRef)(null);return Object(o.createElement)(o.Fragment,null,Object(o.createElement)("div",{className:"with-scroll-to-top__scroll-point",ref:n,"aria-hidden":!0}),Object(o.createElement)(e,c()({},t,{scrollToTop:function(e){var t,r;null!==n.current&&(t=n.current,r=(e||{}).focusableSelector,window&&Number.isFinite(window.innerHeight)&&(r?function(e,t){var n,r=(null===(n=e.parentElement)||void 0===n?void 0:n.querySelectorAll(t))||[];if(r.length){var c=r[0];a(c),null==c||c.focus()}else a(e)}(t,r):a(t)))}})))}}},28:function(e,t){e.exports=window.wp.primitives},281:function(e,t,n){"use strict";var r=n(38),c=n.n(r),o=n(0),a=n(1),i=n(64),s=n(6),u=n.n(s),l=n(46),p=n(72);n(365),t.a=function(e){var t=e.className,n=e.quantity,r=void 0===n?1:n,s=e.minimum,d=void 0===s?1:s,b=e.maximum,m=e.onChange,f=void 0===m?function(){}:m,g=e.itemName,O=void 0===g?"":g,h=e.disabled,j=u()("wc-block-components-quantity-selector",t),v=void 0!==b,E=r>d,y=!v||r<b,_=Object(o.useCallback)((function(e){var t=void 0!==c()(e.key)?"ArrowDown"===e.key:e.keyCode===l.DOWN,n=void 0!==c()(e.key)?"ArrowUp"===e.key:e.keyCode===l.UP;t&&E&&(e.preventDefault(),f(r-1)),n&&y&&(e.preventDefault(),f(r+1))}),[r,f,y,E]);return Object(o.createElement)("div",{className:j},Object(o.createElement)("input",{className:"wc-block-components-quantity-selector__input",disabled:h,type:"number",step:"1",min:"0",value:r,onKeyDown:_,onChange:function(e){var t=Object(p.a)(e.target.value)&&e.target.value?parseInt(e.target.value,10):0;v&&(t=Math.min(t,b)),(t=Math.max(t,d))!==r&&f(t)},"aria-label":Object(a.sprintf)(
/* translators: %s refers to the item name in the cart. */
Object(a.__)("Quantity of %s in your cart.",'woocommerce'),O)}),Object(o.createElement)("button",{"aria-label":Object(a.__)("Reduce quantity",'woocommerce'),className:"wc-block-components-quantity-selector__button wc-block-components-quantity-selector__button--minus",disabled:h||!E,onClick:function(){var e=r-1;f(e),Object(i.speak)(Object(a.sprintf)(
/* translators: %s refers to the item name in the cart. */
Object(a.__)("Quantity reduced to %s.",'woocommerce'),e))}},"-"),Object(o.createElement)("button",{"aria-label":Object(a.__)("Increase quantity",'woocommerce'),disabled:h||!y,className:"wc-block-components-quantity-selector__button wc-block-components-quantity-selector__button--plus",onClick:function(){var e=r+1;f(e),Object(i.speak)(Object(a.sprintf)(
/* translators: %s refers to the item name in the cart. */
Object(a.__)("Quantity increased to %s.",'woocommerce'),e))}},"+"))}},283:function(e,t,n){"use strict";n.d(t,"a",(function(){return M}));var r=n(1),c=n(47),o=n(0),a=n(6),i=n.n(a),s=n(28),u=Object(o.createElement)(s.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(o.createElement)("path",{fill:"none",d:"M0 0h24v24H0z"}),Object(o.createElement)("path",{d:"M4 10h3v7H4zM10.5 10h3v7h-3zM2 19h20v3H2zM17 10h3v7h-3zM12 1L2 6v2h20V6z"})),l=n(303),p=n(502),d=Object(o.createElement)(s.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(o.createElement)("g",{fill:"none",fillRule:"evenodd"},Object(o.createElement)("path",{d:"M0 0h24v24H0z"}),Object(o.createElement)("path",{fill:"#000",fillRule:"nonzero",d:"M17.3 8v1c1 .2 1.4.9 1.4 1.7h-1c0-.6-.3-1-1-1-.8 0-1.3.4-1.3.9 0 .4.3.6 1.4 1 1 .2 2 .6 2 1.9 0 .9-.6 1.4-1.5 1.5v1H16v-1c-.9-.1-1.6-.7-1.7-1.7h1c0 .6.4 1 1.3 1 1 0 1.2-.5 1.2-.8 0-.4-.2-.8-1.3-1.1-1.3-.3-2.1-.8-2.1-1.8 0-.9.7-1.5 1.6-1.6V8h1.3zM12 10v1H6v-1h6zm2-2v1H6V8h8zM2 4v16h20V4H2zm2 14V6h16v12H4z"}),Object(o.createElement)("path",{stroke:"#000",strokeLinecap:"round",d:"M6 16c2.6 0 3.9-3 1.7-3-2 0-1 3 1.5 3 1 0 1-.8 2.8-.8"}))),b=n(66),m=n(72),f=(n(276),{bank:u,bill:l.a,card:p.a,checkPayment:d}),g=function(e){var t=e.icon,n=void 0===t?"":t,r=e.text,c=void 0===r?"":r,a=!!n,s=Object(o.useCallback)((function(e){return a&&Object(m.c)(e)&&Object(m.d)(f,e)}),[a]),u=i()("wc-block-components-payment-method-label",{"wc-block-components-payment-method-label--with-icon":a});return Object(o.createElement)("span",{className:u},s(n)?Object(o.createElement)(b.a,{srcElement:f[n]}):n,c)},O=n(169),h=n(3),j=n(56),v=n.n(j),E=n(234),y=n(43),_=n(201),w=n(50),S=n(57),k=n(174),C=n(75),P=n(67),N=function(e,t){var n=[],c=function(t,n){var r=n+"_tax",c=Object(m.d)(e,n)&&Object(m.c)(e[n])?parseInt(e[n],10):0;return{key:n,label:t,value:c,valueWithTax:c+(Object(m.d)(e,r)&&Object(m.c)(e[r])?parseInt(e[r],10):0)}};return n.push(c(Object(r.__)("Subtotal:",'woocommerce'),"total_items")),n.push(c(Object(r.__)("Fees:",'woocommerce'),"total_fees")),n.push(c(Object(r.__)("Discount:",'woocommerce'),"total_discount")),n.push({key:"total_tax",label:Object(r.__)("Taxes:",'woocommerce'),value:parseInt(e.total_tax,10),valueWithTax:parseInt(e.total_tax,10)}),t&&n.push(c(Object(r.__)("Shipping:",'woocommerce'),"total_shipping")),n},M=function(){var e=Object(S.b)(),t=e.isCalculating,n=e.isComplete,a=e.isIdle,i=e.isProcessing,s=e.onCheckoutBeforeProcessing,u=e.onCheckoutValidationBeforeProcessing,l=e.onCheckoutAfterProcessingWithSuccess,p=e.onCheckoutAfterProcessingWithError,d=e.onSubmit,b=e.customerId,m=Object(k.b)(),f=m.currentStatus,j=m.activePaymentMethod,M=m.onPaymentProcessing,R=m.setExpressPaymentError,I=m.shouldSavePayment,x=Object(C.b)(),D=x.shippingErrorStatus,T=x.shippingErrorTypes,A=x.shippingRates,L=x.shippingRatesLoading,U=x.selectedRates,F=x.setSelectedRates,V=x.isSelectingRate,z=x.onShippingRateSuccess,B=x.onShippingRateFail,G=x.onShippingRateSelectSuccess,q=x.onShippingRateSelectFail,Y=x.needsShipping,H=Object(P.b)(),W=H.billingData,Q=H.shippingAddress,$=H.setShippingAddress,K=Object(y.a)().cartTotals,X=Object(_.a)().appliedCoupons,Z=Object(w.c)(),J=Z.noticeContexts,ee=Z.responseTypes,te=Object(o.useRef)(N(K,Y)),ne=Object(o.useRef)({label:Object(r.__)("Total",'woocommerce'),value:parseInt(K.total_price,10)});Object(o.useEffect)((function(){te.current=N(K,Y),ne.current={label:Object(r.__)("Total",'woocommerce'),value:parseInt(K.total_price,10)}}),[K,Y]);var re=Object(o.useCallback)((function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";v()("setExpressPaymentError should only be used by Express Payment Methods (using the provided onError handler).",{alternative:"",plugin:"woocommerce-gutenberg-products-block",link:"https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/4228"}),R(e)}),[R]);return{activePaymentMethod:j,billing:{billingData:W,cartTotal:ne.current,currency:Object(c.getCurrencyFromPriceResponse)(K),cartTotalItems:te.current,displayPricesIncludingTax:Object(h.getSetting)("displayCartPricesIncludingTax",!1),appliedCoupons:X,customerId:b},checkoutStatus:{isCalculating:t,isComplete:n,isIdle:a,isProcessing:i},components:{ValidationInputError:E.a,PaymentMethodIcons:O.a,PaymentMethodLabel:g},emitResponse:{noticeContexts:J,responseTypes:ee},eventRegistration:{onCheckoutBeforeProcessing:s,onCheckoutValidationBeforeProcessing:u,onCheckoutAfterProcessingWithSuccess:l,onCheckoutAfterProcessingWithError:p,onShippingRateSuccess:z,onShippingRateFail:B,onShippingRateSelectSuccess:G,onShippingRateSelectFail:q,onPaymentProcessing:M},onSubmit:d,paymentStatus:f,setExpressPaymentError:re,shippingData:{shippingRates:A,shippingRatesLoading:L,selectedRates:U,setSelectedRates:F,isSelectingRate:V,shippingAddress:Q,setShippingAddress:$,needsShipping:Y},shippingStatus:{shippingErrorStatus:D,shippingErrorTypes:T},shouldSavePayment:I}}},285:function(e,t,n){"use strict";n.d(t,"b",(function(){return l})),n.d(t,"a",(function(){return p}));var r=n(8),c=n.n(r),o=n(0),a=(n(2),n(21)),i=n(6),s=n.n(i),u=Object(o.createContext)({hasContainerWidth:!1,containerClassName:"",isMobile:!1,isSmall:!1,isMedium:!1,isLarge:!1}),l=function(){return Object(o.useContext)(u)},p=function(e){var t=e.children,n=e.className,r=void 0===n?"":n,i=function(){var e=Object(a.useResizeObserver)(),t=c()(e,2),n=t[0],r=t[1].width,o="";return r>700?o="is-large":r>520?o="is-medium":r>400?o="is-small":r&&(o="is-mobile"),[n,o]}(),l=c()(i,2),p=l[0],d=l[1],b={hasContainerWidth:""!==d,containerClassName:d,isMobile:"is-mobile"===d,isSmall:"is-small"===d,isMedium:"is-medium"===d,isLarge:"is-large"===d};return Object(o.createElement)(u.Provider,{value:b},Object(o.createElement)("div",{className:s()(r,d)},p,t))}},286:function(e,t,n){"use strict";var r=n(9),c=n.n(r),o=n(5),a=n.n(o),i=n(8),s=n.n(i),u=n(16),l=n.n(u),p=n(0),d=n(1),b=n(11),m=n(6),f=n.n(m),g=n(132),O=n(57),h=n(234),j=n(21),v=n(72),E=n(41),y=(n(189),["className","id","type","ariaLabel","ariaDescribedBy","label","screenReaderLabel","disabled","help","autoCapitalize","autoComplete","value","onChange","required","onBlur","feedback"]),_=Object(b.forwardRef)((function(e,t){var n=e.className,r=e.id,o=e.type,a=void 0===o?"text":o,i=e.ariaLabel,u=e.ariaDescribedBy,d=e.label,b=e.screenReaderLabel,m=e.disabled,g=e.help,O=e.autoCapitalize,h=void 0===O?"off":O,j=e.autoComplete,v=void 0===j?"off":j,_=e.value,w=void 0===_?"":_,S=e.onChange,k=e.required,C=void 0!==k&&k,P=e.onBlur,N=void 0===P?function(){}:P,M=e.feedback,R=l()(e,y),I=Object(p.useState)(!1),x=s()(I,2),D=x[0],T=x[1];return Object(p.createElement)("div",{className:f()("wc-block-components-text-input",n,{"is-active":D||w})},Object(p.createElement)("input",c()({type:a,id:r,value:w,ref:t,autoCapitalize:h,autoComplete:v,onChange:function(e){S(e.target.value)},onFocus:function(){return T(!0)},onBlur:function(e){N(e.target.value),T(!1)},"aria-label":i||d,disabled:m,"aria-describedby":g&&!u?r+"__help":u,required:C},R)),Object(p.createElement)(E.a,{label:d,screenReaderLabel:b||d,wrapperElement:"label",wrapperProps:{htmlFor:r},htmlFor:r}),!!g&&Object(p.createElement)("p",{id:r+"__help",className:"wc-block-components-text-input__help"},g),M)})),w=["className","instanceId","id","ariaDescribedBy","errorId","validateOnMount","focusOnMount","onChange","showError","errorMessage"];t.a=Object(j.withInstanceId)((function(e){var t=e.className,n=e.instanceId,r=e.id,o=e.ariaDescribedBy,i=e.errorId,u=e.validateOnMount,m=void 0===u||u,j=e.focusOnMount,E=void 0!==j&&j,y=e.onChange,S=e.showError,k=void 0===S||S,C=e.errorMessage,P=void 0===C?"":C,N=l()(e,w),M=Object(b.useState)(!0),R=s()(M,2),I=R[0],x=R[1],D=Object(b.useRef)(null),T=Object(g.b)(),A=T.getValidationError,L=T.hideValidationError,U=T.setValidationErrors,F=T.clearValidationError,V=T.getValidationErrorId,z=Object(O.b)().isBeforeProcessing,B=void 0!==r?r:"textinput-"+n,G=void 0!==i?i:B,q=Object(b.useCallback)((function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=D.current||null;if(t){t.value=t.value.trim();var n=t.checkValidity();n?F(G):U(a()({},G,{message:t.validationMessage||Object(d.__)("Invalid value.",'woocommerce'),hidden:e}))}}),[F,G,U]);Object(b.useEffect)((function(){var e;I&&(E&&(null===(e=D.current)||void 0===e||e.focus()),x(!1))}),[E,I,x]),Object(b.useEffect)((function(){I&&(m&&q(),x(!1))}),[I,x,m,q]),Object(b.useEffect)((function(){z&&q()}),[z,q]),Object(b.useEffect)((function(){return function(){F(G)}}),[F,G]);var Y=A(G)||{};Object(v.c)(P)&&""!==P&&(Y.message=P);var H=Y.message&&!Y.hidden,W=k&&H&&V(G)?V(G):o;return Object(p.createElement)(_,c()({className:f()(t,{"has-error":H}),"aria-invalid":!0===H,id:B,onBlur:function(){q(!1)},feedback:k&&Object(p.createElement)(h.a,{errorMessage:P,propertyName:G}),ref:D,onChange:function(e){L(G),y(e)},ariaDescribedBy:W},N))}))},3:function(e,t){e.exports=window.wc.wcSettings},303:function(e,t,n){"use strict";var r=n(0),c=n(28),o=Object(r.createElement)(c.SVG,{xmlns:"http://www.w3.org/2000/SVG",viewBox:"0 0 24 24"},Object(r.createElement)("path",{fill:"none",d:"M0 0h24v24H0V0z"}),Object(r.createElement)("path",{d:"M11 17h2v-1h1c.55 0 1-.45 1-1v-3c0-.55-.45-1-1-1h-3v-1h4V8h-2V7h-2v1h-1c-.55 0-1 .45-1 1v3c0 .55.45 1 1 1h3v1H9v2h2v1zm9-13H4c-1.11 0-1.99.89-1.99 2L2 18c0 1.11.89 2 2 2h16c1.11 0 2-.89 2-2V6c0-1.11-.89-2-2-2zm0 14H4V6h16v12z"}));t.a=o},305:function(e,t,n){"use strict";var r=n(9),c=n.n(r),o=n(16),a=n.n(o),i=n(0),s=n(28),u=["className","size"],l=Object(i.createElement)((function(e){var t=e.className,n=e.size,r=a()(e,u);return Object(i.createElement)(s.SVG,c()({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",className:t,width:n,height:n},r),Object(i.createElement)("path",{d:"M14.95 6.46L11.41 10l3.54 3.54-1.41 1.41L10 11.42l-3.53 3.53-1.42-1.42L8.58 10 5.05 6.47l1.42-1.42L10 8.58l3.54-3.53z"}))}),null);t.a=l},307:function(e,t,n){"use strict";var r=n(9),c=n.n(r),o=n(0),a=n(25),i=n(3);t.a=function(e){var t=e.image,n=void 0===t?{}:t,r={src:n.thumbnail||i.PLACEHOLDER_IMG_SRC,alt:Object(a.decodeEntities)(n.alt)||""};return Object(o.createElement)("img",c()({},r,{alt:r.alt}))}},308:function(e,t,n){"use strict";var r=n(0),c=n(1),o=n(110);t.a=function(){return Object(r.createElement)(o.a,{className:"wc-block-components-product-backorder-badge"},Object(c.__)("Available on backorder",'woocommerce'))}},309:function(e,t,n){"use strict";var r=n(0),c=n(1),o=n(110);t.a=function(e){var t=e.lowStockRemaining;return t?Object(r.createElement)(o.a,{className:"wc-block-components-product-low-stock-badge"},Object(c.sprintf)(
/* translators: %d stock amount (number of items in stock for product) */
Object(c.__)("%d left in stock",'woocommerce'),t)):null}},311:function(e,t,n){"use strict";var r=n(0),c=n(7),o=n(25),a=(n(264),function(e){var t=e.details,n=void 0===t?[]:t;return Array.isArray(n)?0===(n=n.filter((function(e){return!e.hidden}))).length?null:Object(r.createElement)("ul",{className:"wc-block-components-product-details"},n.map((function(e){var t=e.name?"wc-block-components-product-details__".concat(Object(c.kebabCase)(e.name)):"";return Object(r.createElement)("li",{key:e.name+(e.display||e.value),className:t},e.name&&Object(r.createElement)(r.Fragment,null,Object(r.createElement)("span",{className:"wc-block-components-product-details__name"},Object(o.decodeEntities)(e.name),":")," "),Object(r.createElement)("span",{className:"wc-block-components-product-details__value"},Object(o.decodeEntities)(e.display||e.value)))}))):null}),i=n(155),s=n(37),u=function(e){var t=e.className,n=e.shortDescription,c=void 0===n?"":n,o=e.fullDescription,a=c||(void 0===o?"":o);return a?Object(r.createElement)(i.a,{className:t,source:a,maxLength:15,countType:s.o.wordCountType||"words"}):null};n(263),t.a=function(e){var t=e.shortDescription,n=void 0===t?"":t,c=e.fullDescription,o=void 0===c?"":c,i=e.itemData,s=void 0===i?[]:i,l=e.variation,p=void 0===l?[]:l;return Object(r.createElement)("div",{className:"wc-block-components-product-metadata"},Object(r.createElement)(u,{className:"wc-block-components-product-metadata__description",shortDescription:n,fullDescription:o}),Object(r.createElement)(a,{details:s}),Object(r.createElement)(a,{details:p.map((function(e){var t=e.attribute;return{name:void 0===t?"":t,value:e.value}}))}))}},321:function(e,t,n){"use strict";n.d(t,"a",(function(){return c}));var r=n(126),c=function(e,t){return function(n){var c=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10,o=r.a.addEventCallback(e,n,c);return t(o),function(){t(r.a.removeEventCallback(e,o.id))}}}},322:function(e,t,n){"use strict";n.d(t,"a",(function(){return b})),n.d(t,"b",(function(){return m}));var r=n(38),c=n.n(r),o=n(29),a=n.n(o),i=n(22),s=n.n(i),u=function(e,t){return e[t]?Array.from(e[t].values()).sort((function(e,t){return e.priority-t.priority})):[]},l=n(50);function p(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return d(e,void 0);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?d(e,void 0):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,c=function(){};return{s:c,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:c}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,i=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){i=!0,o=e},f:function(){try{a||null==n.return||n.return()}finally{if(i)throw o}}}}function d(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var b=function(){var e=a()(s.a.mark((function e(t,n,r){var o,a,i,l,d,b;return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:o=u(t,n),a=[],i=p(o),e.prev=3,i.s();case 5:if((l=i.n()).done){e.next=19;break}return d=l.value,e.prev=7,e.next=10,Promise.resolve(d.callback(r));case 10:b=e.sent,"object"===c()(b)&&a.push(b),e.next=17;break;case 14:e.prev=14,e.t0=e.catch(7),console.error(e.t0);case 17:e.next=5;break;case 19:e.next=24;break;case 21:e.prev=21,e.t1=e.catch(3),i.e(e.t1);case 24:return e.prev=24,i.f(),e.finish(24);case 27:return e.abrupt("return",!a.length||a);case 28:case"end":return e.stop()}}),e,null,[[3,21,24,27],[7,14]])})));return function(_x,t,n){return e.apply(this,arguments)}}(),m=function(){var e=a()(s.a.mark((function e(t,n,r){var o,a,i,d,b,m;return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:o=[],a=u(t,n),i=p(a),e.prev=3,i.s();case 5:if((d=i.n()).done){e.next=28;break}return b=d.value,e.prev=7,e.next=10,Promise.resolve(b.callback(r));case 10:if(m=e.sent,"object"===c()(m)&&null!==m){e.next=13;break}return e.abrupt("continue",26);case 13:if(m.hasOwnProperty("type")){e.next=15;break}throw new Error("Returned objects from event emitter observers must return an object with a type property");case 15:if(!Object(l.a)(m)&&!Object(l.b)(m)){e.next=18;break}return o.push(m),e.abrupt("return",o);case 18:o.push(m),e.next=26;break;case 21:return e.prev=21,e.t0=e.catch(7),console.error(e.t0),o.push({type:"error"}),e.abrupt("return",o);case 26:e.next=5;break;case 28:e.next=33;break;case 30:e.prev=30,e.t1=e.catch(3),i.e(e.t1);case 33:return e.prev=33,i.f(),e.finish(33);case 36:return e.abrupt("return",o);case 37:case"end":return e.stop()}}),e,null,[[3,30,33,36],[7,21]])})));return function(t,n,r){return e.apply(this,arguments)}}()},34:function(e,t){e.exports=window.wp.isShallowEqual},361:function(e,t,n){"use strict";var r=n(0),c=n(28),o=Object(r.createElement)(c.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(r.createElement)("path",{fill:"none",d:"M0 0h24v24H0V0z"}),Object(r.createElement)("path",{d:"M15.55 13c.75 0 1.41-.41 1.75-1.03l3.58-6.49c.37-.66-.11-1.48-.87-1.48H5.21l-.94-2H1v2h2l3.6 7.59-1.35 2.44C4.52 15.37 5.48 17 7 17h12v-2H7l1.1-2h7.45zM6.16 6h12.15l-2.76 5H8.53L6.16 6zM7 18c-1.1 0-1.99.9-1.99 2S5.9 22 7 22s2-.9 2-2-.9-2-2-2zm10 0c-1.1 0-1.99.9-1.99 2s.89 2 1.99 2 2-.9 2-2-.9-2-2-2z"}));t.a=o},362:function(e,t){},365:function(e,t){},369:function(e,t,n){"use strict";n.d(t,"a",(function(){return o})),n.d(t,"c",(function(){return a})),n.d(t,"b",(function(){return i}));var r,c=window.CustomEvent||null,o=function(e,t){var n=t.bubbles,r=void 0!==n&&n,o=t.cancelable,a=void 0!==o&&o,i=t.element,s=t.detail,u=void 0===s?{}:s;if(c){i||(i=document.body);var l=new c(e,{bubbles:r,cancelable:a,detail:u});i.dispatchEvent(l)}},a=function(){r&&clearTimeout(r),r=setTimeout((function(){o("wc_fragment_refresh",{bubbles:!0,cancelable:!0})}),50)},i=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if("function"!=typeof jQuery)return function(){};var c=function(){o(t,{bubbles:n,cancelable:r})};return jQuery(document).on(e,c),function(){return jQuery(document).off(e,c)}}},37:function(e,t,n){"use strict";n.d(t,"o",(function(){return o})),n.d(t,"m",(function(){return a})),n.d(t,"l",(function(){return i})),n.d(t,"n",(function(){return s})),n.d(t,"j",(function(){return u})),n.d(t,"e",(function(){return l})),n.d(t,"f",(function(){return p})),n.d(t,"g",(function(){return d})),n.d(t,"k",(function(){return b})),n.d(t,"c",(function(){return m})),n.d(t,"d",(function(){return f})),n.d(t,"h",(function(){return g})),n.d(t,"a",(function(){return O})),n.d(t,"i",(function(){return h})),n.d(t,"b",(function(){return j}));var r,c=n(3),o=Object(c.getSetting)("wcBlocksConfig",{buildPhase:1,pluginUrl:"",productCount:0,defaultAvatar:"",restApiRoutes:{},wordCountType:"words"}),a=o.pluginUrl+"images/",i=o.pluginUrl+"build/",s=o.buildPhase,u=null===(r=c.STORE_PAGES.shop)||void 0===r?void 0:r.permalink,l=c.STORE_PAGES.checkout.id,p=c.STORE_PAGES.checkout.permalink,d=c.STORE_PAGES.privacy.permalink,b=(c.STORE_PAGES.privacy.title,c.STORE_PAGES.terms.permalink),m=(c.STORE_PAGES.terms.title,c.STORE_PAGES.cart.id),f=c.STORE_PAGES.cart.permalink,g=(c.STORE_PAGES.myaccount.permalink?c.STORE_PAGES.myaccount.permalink:Object(c.getSetting)("wpLoginUrl","/wp-login.php"),Object(c.getSetting)("shippingCountries",{})),O=Object(c.getSetting)("allowedCountries",{}),h=Object(c.getSetting)("shippingStates",{}),j=Object(c.getSetting)("allowedStates",{})},371:function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(8),c=n.n(r),o=n(0),a={bottom:0,left:0,opacity:0,pointerEvents:"none",position:"absolute",right:0,top:0,zIndex:-1},i=function(){var e=Object(o.useState)(""),t=c()(e,2),n=t[0],r=t[1],i=Object(o.useRef)(null),s=Object(o.useRef)(new IntersectionObserver((function(e){e[0].isIntersecting?r("visible"):r(e[0].boundingClientRect.top>0?"below":"above")}),{threshold:1}));return Object(o.useLayoutEffect)((function(){var e=i.current,t=s.current;return e&&t.observe(e),function(){t.unobserve(e)}}),[]),[Object(o.createElement)("div",{"aria-hidden":!0,ref:i,style:a}),n]}},39:function(e,t,n){"use strict";n.d(t,"h",(function(){return b})),n.d(t,"e",(function(){return m})),n.d(t,"b",(function(){return f})),n.d(t,"i",(function(){return g})),n.d(t,"f",(function(){return O})),n.d(t,"c",(function(){return h})),n.d(t,"d",(function(){return j})),n.d(t,"g",(function(){return v})),n.d(t,"a",(function(){return E}));var r=n(5),c=n.n(r),o=n(23),a=n(15),i=n.n(a),s=n(7),u=n(3),l=n(37);function p(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function d(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?p(Object(n),!0).forEach((function(t){c()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):p(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var b=function(e){var t=e.selected,n=void 0===t?[]:t,r=e.search,c=void 0===r?"":r,a=e.queryArgs,u=function(e){var t=e.selected,n=void 0===t?[]:t,r=e.search,c=void 0===r?"":r,a=e.queryArgs,i=void 0===a?{}:a,s=l.o.productCount>100,u={per_page:s?100:0,catalog_visibility:"any",search:c,orderby:"title",order:"asc"},p=[Object(o.addQueryArgs)("/wc/store/products",d(d({},u),i))];return s&&n.length&&p.push(Object(o.addQueryArgs)("/wc/store/products",{catalog_visibility:"any",include:n,per_page:0})),p}({selected:n,search:c,queryArgs:void 0===a?{}:a});return Promise.all(u.map((function(e){return i()({path:e})}))).then((function(e){return Object(s.uniqBy)(Object(s.flatten)(e),"id").map((function(e){return d(d({},e),{},{parent:0})}))})).catch((function(e){throw e}))},m=function(e){return i()({path:"/wc/store/products/".concat(e)})},f=function(){return i()({path:"wc/store/products/attributes"})},g=function(e){return i()({path:"wc/store/products/attributes/".concat(e,"/terms")})},O=function(e){var t=e.selected,n=function(e){var t=e.selected,n=void 0===t?[]:t,r=e.search,c=Object(u.getSetting)("limitTags",!1),a=[Object(o.addQueryArgs)("wc/store/products/tags",{per_page:c?100:0,orderby:c?"count":"name",order:c?"desc":"asc",search:r})];return c&&n.length&&a.push(Object(o.addQueryArgs)("wc/store/products/tags",{include:n})),a}({selected:void 0===t?[]:t,search:e.search});return Promise.all(n.map((function(e){return i()({path:e})}))).then((function(e){return Object(s.uniqBy)(Object(s.flatten)(e),"id")}))},h=function(e){return i()({path:Object(o.addQueryArgs)("wc/store/products/categories",d({per_page:0},e))})},j=function(e){return i()({path:"wc/store/products/categories/".concat(e)})},v=function(e){return i()({path:Object(o.addQueryArgs)("wc/store/products",{per_page:0,type:"variation",parent:e})})},E=function(e,t){if(!e.title.raw)return e.slug;var n=1===t.filter((function(t){return t.title.raw===e.title.raw})).length;return e.title.raw+(n?"":" - ".concat(e.slug))}},4:function(e,t){e.exports=window.wp.components},41:function(e,t,n){"use strict";var r=n(5),c=n.n(r),o=n(0),a=n(6),i=n.n(a);function s(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function u(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?s(Object(n),!0).forEach((function(t){c()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):s(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}t.a=function(e){var t,n=e.label,r=e.screenReaderLabel,c=e.wrapperElement,a=e.wrapperProps,s=void 0===a?{}:a,l=null!=n,p=null!=r;return!l&&p?(t=c||"span",s=u(u({},s),{},{className:i()(s.className,"screen-reader-text")}),Object(o.createElement)(t,s,r)):(t=c||o.Fragment,l&&p&&n!==r?Object(o.createElement)(t,s,Object(o.createElement)("span",{"aria-hidden":"true"},n),Object(o.createElement)("span",{className:"screen-reader-text"},r)):Object(o.createElement)(t,s,n))}},42:function(e,t,n){"use strict";n.d(t,"a",(function(){return s})),n.d(t,"b",(function(){return u}));var r=n(29),c=n.n(r),o=n(22),a=n.n(o),i=n(1),s=function(){var e=c()(a.a.mark((function e(t){var n;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("function"!=typeof t.json){e.next=11;break}return e.prev=1,e.next=4,t.json();case 4:return n=e.sent,e.abrupt("return",{message:n.message,type:n.type||"api"});case 8:return e.prev=8,e.t0=e.catch(1),e.abrupt("return",{message:e.t0.message,type:"general"});case 11:return e.abrupt("return",{message:t.message,type:t.type||"general"});case 12:case"end":return e.stop()}}),e,null,[[1,8]])})));return function(_x){return e.apply(this,arguments)}}(),u=function(e){if(e.data&&"rest_invalid_param"===e.code){var t=Object.values(e.data.params);if(t[0])return t[0]}return(null==e?void 0:e.message)||Object(i.__)("Something went wrong. Please contact us to get assistance.",'woocommerce')}},43:function(e,t,n){"use strict";n.d(t,"a",(function(){return y}));var r=n(8),c=n.n(r),o=n(5),a=n.n(o),i=n(7),s=n(0),u=n(24),l=n(14),p=n(25),d=n(142),b=n(162),m=n(63);function f(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function g(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?f(Object(n),!0).forEach((function(t){a()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):f(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var O={first_name:"",last_name:"",company:"",address_1:"",address_2:"",city:"",state:"",postcode:"",country:"",phone:""},h=g(g({},O),{},{email:""}),j={total_items:"",total_items_tax:"",total_fees:"",total_fees_tax:"",total_discount:"",total_discount_tax:"",total_shipping:"",total_shipping_tax:"",total_price:"",total_tax:"",tax_lines:u.EMPTY_TAX_LINES,currency_code:"",currency_symbol:"",currency_minor_unit:2,currency_decimal_separator:"",currency_thousand_separator:"",currency_prefix:"",currency_suffix:""},v=function(e){return Object(d.a)(Object.entries(e).map((function(e){var t=c()(e,2),n=t[0],r=t[1];return[n,Object(p.decodeEntities)(r)]})))},E={cartCoupons:u.EMPTY_CART_COUPONS,cartItems:u.EMPTY_CART_ITEMS,cartFees:u.EMPTY_CART_FEES,cartItemsCount:0,cartItemsWeight:0,cartNeedsPayment:!0,cartNeedsShipping:!0,cartItemErrors:u.EMPTY_CART_ITEM_ERRORS,cartTotals:j,cartIsLoading:!0,cartErrors:u.EMPTY_CART_ERRORS,billingAddress:h,shippingAddress:O,shippingRates:u.EMPTY_SHIPPING_RATES,shippingRatesLoading:!1,cartHasCalculatedShipping:!1,paymentRequirements:u.EMPTY_PAYMENT_REQUIREMENTS,receiveCart:function(){},extensions:u.EMPTY_EXTENSIONS},y=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{shouldSelect:!0},t=Object(m.b)(),n=t.isEditor,r=t.previewData,c=null==r?void 0:r.previewCart,o=e.shouldSelect,a=Object(s.useRef)(),p=Object(l.useSelect)((function(e,t){var r=t.dispatch;if(!o)return E;if(n)return{cartCoupons:c.coupons,cartItems:c.items,cartFees:c.fees,cartItemsCount:c.items_count,cartItemsWeight:c.items_weight,cartNeedsPayment:c.needs_payment,cartNeedsShipping:c.needs_shipping,cartItemErrors:u.EMPTY_CART_ITEM_ERRORS,cartTotals:c.totals,cartIsLoading:!1,cartErrors:u.EMPTY_CART_ERRORS,billingAddress:h,shippingAddress:O,extensions:u.EMPTY_EXTENSIONS,shippingRates:c.shipping_rates,shippingRatesLoading:!1,cartHasCalculatedShipping:c.has_calculated_shipping,paymentRequirements:c.paymentRequirements,receiveCart:"function"==typeof(null==c?void 0:c.receiveCart)?c.receiveCart:function(){}};var a=e(u.CART_STORE_KEY),i=a.getCartData(),s=a.getCartErrors(),l=a.getCartTotals(),p=!a.hasFinishedResolution("getCartData"),d=a.isCustomerDataUpdating(),m=r(u.CART_STORE_KEY).receiveCart,f=v(i.billingAddress),j=i.needsShipping?v(i.shippingAddress):f,y=i.fees.length>0?i.fees.map((function(e){return v(e)})):u.EMPTY_CART_FEES;return{cartCoupons:i.coupons.length>0?i.coupons.map((function(e){return g(g({},e),{},{label:e.code})})):u.EMPTY_CART_COUPONS,cartItems:i.items,cartFees:y,cartItemsCount:i.itemsCount,cartItemsWeight:i.itemsWeight,cartNeedsPayment:i.needsPayment,cartNeedsShipping:i.needsShipping,cartItemErrors:i.errors,cartTotals:l,cartIsLoading:p,cartErrors:s,billingAddress:Object(b.a)(f),shippingAddress:Object(b.a)(j),extensions:i.extensions,shippingRates:i.shippingRates,shippingRatesLoading:d,cartHasCalculatedShipping:i.hasCalculatedShipping,paymentRequirements:i.paymentRequirements,receiveCart:m}}),[o]);return a.current&&Object(i.isEqual)(a.current,p)||(a.current=p),a.current}},44:function(e,t,n){},46:function(e,t){e.exports=window.wp.keycodes},47:function(e,t){e.exports=window.wc.priceFormat},494:function(e,t,n){"use strict";var r=n(0),c=n(6),o=n.n(c),a=(n(2),n(285));n(261),t.a=function(e){var t=e.children,n=e.className;return Object(r.createElement)(a.a,{className:o()("wc-block-components-sidebar-layout",n)},t)}},495:function(e,t,n){"use strict";var r=n(0),c=n(6),o=n.n(c);n(2),t.a=function(e){var t=e.children,n=e.className;return Object(r.createElement)("div",{className:o()("wc-block-components-main",n)},t)}},496:function(e,t,n){"use strict";var r=n(0),c=n(6),o=n.n(c);n(2),t.a=function(e){var t=e.children,n=e.className;return Object(r.createElement)("div",{className:o()("wc-block-components-sidebar",n)},t)}},497:function(e,t,n){"use strict";var r=n(0),c=n(1),o=n(83),a=n(220),i=(n(2),n(27)),s=n(3),u=(n(265),{context:"summary"});t.a=function(e){var t=e.cartCoupons,n=void 0===t?[]:t,l=e.currency,p=e.isRemovingCoupon,d=e.removeCoupon,b=e.values,m=b.total_discount,f=b.total_discount_tax,g=parseInt(m,10);if(!g&&0===n.length)return null;var O=parseInt(f,10),h=Object(s.getSetting)("displayCartPricesIncludingTax",!1)?g+O:g,j=Object(i.__experimentalApplyCheckoutFilter)({arg:u,filterName:"coupons",defaultValue:n});return Object(r.createElement)(i.TotalsItem,{className:"wc-block-components-totals-discount",currency:l,description:0!==j.length&&Object(r.createElement)(o.a,{screenReaderLabel:Object(c.__)("Removing coupon…",'woocommerce'),isLoading:p,showSpinner:!1},Object(r.createElement)("ul",{className:"wc-block-components-totals-discount__coupon-list"},j.map((function(e){return Object(r.createElement)(a.a,{key:"coupon-"+e.code,className:"wc-block-components-totals-discount__coupon-list-item",text:e.label,screenReaderText:Object(c.sprintf)(
/* translators: %s Coupon code. */
Object(c.__)("Coupon: %s",'woocommerce'),e.label),disabled:p,onRemove:function(){d(e.code)},radius:"large",ariaLabel:Object(c.sprintf)(
/* translators: %s is a coupon code. */
Object(c.__)('Remove coupon "%s"','woocommerce'),e.label)})})))),label:h?Object(c.__)("Discount",'woocommerce'):Object(c.__)("Coupons",'woocommerce'),value:h?-1*h:"-"})}},498:function(e,t,n){"use strict";var r=n(8),c=n.n(r),o=n(0),a=n(1),i=n(90),s=n(286),u=n(41),l=n(83),p=(n(2),n(21)),d=n(132),b=n(234),m=n(27);n(266),t.a=Object(p.withInstanceId)((function(e){var t=e.instanceId,n=e.isLoading,r=void 0!==n&&n,p=e.initialOpen,f=void 0!==p&&p,g=e.onSubmit,O=void 0===g?function(){}:g,h=Object(o.useState)(""),j=c()(h,2),v=j[0],E=j[1],y=Object(o.useRef)(!1),_=Object(d.b)(),w=_.getValidationError,S=_.getValidationErrorId,k=w("coupon");Object(o.useEffect)((function(){y.current!==r&&(r||!v||k||E(""),y.current=r)}),[r,v,k]);var C="wc-block-components-totals-coupon__input-".concat(t);return Object(o.createElement)(m.Panel,{className:"wc-block-components-totals-coupon",hasBorder:!1,initialOpen:f,title:Object(o.createElement)(u.a,{label:Object(a.__)("Coupon code",'woocommerce'),screenReaderLabel:Object(a.__)("Apply a coupon code",'woocommerce'),htmlFor:C})},Object(o.createElement)(l.a,{screenReaderLabel:Object(a.__)("Applying coupon…",'woocommerce'),isLoading:r,showSpinner:!1},Object(o.createElement)("div",{className:"wc-block-components-totals-coupon__content"},Object(o.createElement)("form",{className:"wc-block-components-totals-coupon__form"},Object(o.createElement)(s.a,{id:C,errorId:"coupon",className:"wc-block-components-totals-coupon__input",label:Object(a.__)("Enter code",'woocommerce'),value:v,ariaDescribedBy:S(C),onChange:function(e){E(e)},validateOnMount:!1,focusOnMount:!0,showError:!1}),Object(o.createElement)(i.a,{className:"wc-block-components-totals-coupon__button",disabled:r||!v,showSpinner:r,onClick:function(e){e.preventDefault(),O(v)},type:"submit"},Object(a.__)("Apply",'woocommerce'))),Object(o.createElement)(b.a,{propertyName:"coupon",elementId:C}))))}))},50:function(e,t,n){"use strict";n.d(t,"a",(function(){return s})),n.d(t,"b",(function(){return u})),n.d(t,"c",(function(){return p}));var r,c,o=n(72);!function(e){e.SUCCESS="success",e.FAIL="failure",e.ERROR="error"}(r||(r={})),function(e){e.PAYMENTS="wc/payment-area",e.EXPRESS_PAYMENTS="wc/express-payment-area"}(c||(c={}));var a=function(e,t){return Object(o.b)(e)&&"type"in e&&e.type===t},i=function(e){return a(e,r.SUCCESS)},s=function(e){return a(e,r.ERROR)},u=function(e){return a(e,r.FAIL)},l=function(e){return!Object(o.b)(e)||void 0===e.retry||!0===e.retry},p=function(){return{responseTypes:r,noticeContexts:c,shouldRetry:l,isSuccessResponse:i,isErrorResponse:s,isFailResponse:u}}},500:function(e,t,n){"use strict";n.d(t,"a",(function(){return r})),n.d(t,"b",(function(){return c}));var r=function(e){return e.length},c=function(e){return e.reduce((function(e,t){return e+t.shipping_rates.length}),0)}},501:function(e,t,n){"use strict";var r=n(16),c=n.n(r),o=n(0),a=n(1),i=n(53),s=(n(2),n(27)),u=n(43),l=n(3),p=(n(273),["receiveCart"]);t.a=function(e){var t=e.currency,n=e.values,r=Object(l.getSetting)("taxesEnabled",!0)&&Object(l.getSetting)("displayCartPricesIncludingTax",!1),d=n.total_price,b=n.total_tax,m=Object(u.a)(),f=(m.receiveCart,c()(m,p)),g=Object(s.__experimentalApplyCheckoutFilter)({filterName:"totalLabel",defaultValue:Object(a.__)("Total",'woocommerce'),extensions:f.extensions,arg:{cart:f}}),O=parseInt(b,10);return Object(o.createElement)(s.TotalsItem,{className:"wc-block-components-totals-footer-item",currency:t,label:g,value:parseInt(d,10),description:r&&0!==O&&Object(o.createElement)("p",{className:"wc-block-components-totals-footer-item-tax"},Object(o.createInterpolateElement)(Object(a.__)("Including <TaxAmount/> in taxes",'woocommerce'),{TaxAmount:Object(o.createElement)(i.a,{className:"wc-block-components-totals-footer-item-tax-value",currency:t,value:O})}))})}},502:function(e,t,n){"use strict";var r=n(0),c=n(28),o=Object(r.createElement)(c.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(r.createElement)("path",{fill:"none",d:"M0 0h24v24H0V0z"}),Object(r.createElement)("path",{fill:"currentColor",d:"M20 4H4c-1.11 0-1.99.89-1.99 2L2 18c0 1.11.89 2 2 2h16c1.11 0 2-.89 2-2V6c0-1.11-.89-2-2-2zm0 14H4v-6h16v6zm0-10H4V6h16v2z"}));t.a=o},504:function(e,t,n){"use strict";var r=n(5),c=n.n(r),o=n(0),a=n(286),i=n(9),s=n.n(i),u=n(37),l=n(1),p=n(25),d=n(6),b=n.n(d),m=n(21),f=n(898),g=n(132),O=n(234),h=n(72),j=(n(269),Object(m.withInstanceId)((function(e){var t=e.id,n=e.className,r=e.label,a=e.onChange,i=e.options,s=e.value,u=e.required,p=void 0!==u&&u,d=e.errorMessage,m=void 0===d?Object(l.__)("Please select a value.",'woocommerce'):d,j=e.errorId,v=e.instanceId,E=void 0===v?"0":v,y=e.autoComplete,_=void 0===y?"off":y,w=Object(g.b)(),S=w.getValidationError,k=w.setValidationErrors,C=w.clearValidationError,P=Object(o.useRef)(null),N=t||"control-"+E,M=j||N,R=S(M)||{message:"",hidden:!1};return Object(o.useEffect)((function(){return!p||s?C(M):k(c()({},M,{message:m,hidden:!0})),function(){C(M)}}),[C,s,M,m,p,k]),Object(o.createElement)("div",{id:N,className:b()("wc-block-components-combobox",n,{"is-active":s,"has-error":R.message&&!R.hidden}),ref:P},Object(o.createElement)(f.a,{className:"wc-block-components-combobox-control",label:r,onChange:a,onFilterValueChange:function(e){if(e.length){var t=Object(h.b)(P.current)?P.current.ownerDocument.activeElement:void 0;if(t&&Object(h.b)(P.current)&&P.current.contains(t))return;var n=e.toLocaleUpperCase(),r=i.find((function(e){return e.label.toLocaleUpperCase().startsWith(n)||e.value.toLocaleUpperCase()===n}));r&&a(r.value)}},options:i,value:s||"",allowReset:!1,autoComplete:_,"aria-invalid":R.message&&!R.hidden}),Object(o.createElement)(O.a,{propertyName:M}))}))),v=(n(268),function(e){var t=e.className,n=e.countries,r=e.id,c=e.label,a=e.onChange,i=e.value,s=void 0===i?"":i,u=e.autoComplete,d=void 0===u?"off":u,m=e.required,f=void 0!==m&&m,g=e.errorId,O=e.errorMessage,h=void 0===O?Object(l.__)("Please select a country.",'woocommerce'):O,v=Object(o.useMemo)((function(){return Object.keys(n).map((function(e){return{value:e,label:Object(p.decodeEntities)(n[e])}}))}),[n]);return Object(o.createElement)("div",{className:b()(t,"wc-block-components-country-input")},Object(o.createElement)(j,{id:r,label:c,onChange:a,options:v,value:s,errorId:g,errorMessage:h,required:f,autoComplete:d}),"off"!==d&&Object(o.createElement)("input",{type:"text","aria-hidden":!0,autoComplete:d,value:s,onChange:function(e){var t=e.target.value.toLocaleUpperCase(),n=v.find((function(e){return 2!==t.length&&e.label.toLocaleUpperCase()===t||2===t.length&&e.value.toLocaleUpperCase()===t}));a(n?n.value:"")},style:{minHeight:"0",height:"0",border:"0",padding:"0",position:"absolute"},tabIndex:-1}))}),E=function(e){return Object(o.createElement)(v,s()({countries:u.h},e))},y=function(e){return Object(o.createElement)(v,s()({countries:u.a},e))},_=(n(270),function(e,t){var n=t.find((function(t){return t.label.toLocaleUpperCase()===e.toLocaleUpperCase()||t.value.toLocaleUpperCase()===e.toLocaleUpperCase()}));return n?n.value:""}),w=function(e){var t=e.className,n=e.id,r=e.states,c=e.country,i=e.label,s=e.onChange,u=e.autoComplete,d=void 0===u?"off":u,m=e.value,f=void 0===m?"":m,g=e.required,O=void 0!==g&&g,h=r[c],v=Object(o.useMemo)((function(){return h?Object.keys(h).map((function(e){return{value:e,label:Object(p.decodeEntities)(h[e])}})):[]}),[h]),E=Object(o.useCallback)((function(e){s(v.length>0?_(e,v):e)}),[s,v]),y=Object(o.useRef)(f);return Object(o.useEffect)((function(){y.current!==f&&(y.current=f)}),[f]),Object(o.useEffect)((function(){if(v.length>0&&y.current){var e=_(y.current,v);e!==y.current&&E(e)}}),[v,E]),v.length>0?Object(o.createElement)(o.Fragment,null,Object(o.createElement)(j,{className:b()(t,"wc-block-components-state-input"),id:n,label:i,onChange:E,options:v,value:f,errorMessage:Object(l.__)("Please select a state.",'woocommerce'),required:O,autoComplete:d}),"off"!==d&&Object(o.createElement)("input",{type:"text","aria-hidden":!0,autoComplete:d,value:f,onChange:function(e){return E(e.target.value)},style:{minHeight:"0",height:"0",border:"0",padding:"0",position:"absolute"},tabIndex:-1})):Object(o.createElement)(a.a,{className:t,id:n,label:i,onChange:E,autoComplete:d,value:f,required:O})},S=function(e){return Object(o.createElement)(w,s()({states:u.i},e))},k=function(e){return Object(o.createElement)(w,s()({states:u.b},e))},C=n(62),P=n(3),N=n(113);function M(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function R(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?M(Object(n),!0).forEach((function(t){c()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):M(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}t.a=Object(m.withInstanceId)((function(e){var t=e.id,n=e.fields,r=void 0===n?Object.keys(P.defaultAddressFields):n,i=e.fieldConfig,s=void 0===i?{}:i,u=e.instanceId,p=e.onChange,d=e.type,b=void 0===d?"shipping":d,m=e.values,f=Object(g.b)(),O=f.getValidationError,h=f.setValidationErrors,j=f.clearValidationError,v=Object(C.a)(r),_=O("shipping-missing-country")||{},w=Object(o.useMemo)((function(){return Object(N.a)(v,s,m.country)}),[v,s,m.country]);return Object(o.useEffect)((function(){w.forEach((function(e){e.hidden&&m[e.key]&&p(R(R({},m),{},c()({},e.key,"")))}))}),[w,p,m]),Object(o.useEffect)((function(){"shipping"===b&&function(e,t,n,r){r||e.country||!(e.city||e.state||e.postcode)||t({"shipping-missing-country":{message:Object(l.__)("Please select a country to calculate rates.",'woocommerce'),hidden:!1}}),r&&e.country&&n("shipping-missing-country")}(m,h,j,!!_.message&&!_.hidden)}),[m,_.message,_.hidden,h,j,b]),t=t||u,Object(o.createElement)("div",{id:t,className:"wc-block-components-address-form"},w.map((function(e){if(e.hidden)return null;if("country"===e.key){var n="shipping"===b?E:y;return Object(o.createElement)(n,{key:e.key,id:"".concat(t,"-").concat(e.key),label:e.required?e.label:e.optionalLabel,value:m.country,autoComplete:e.autocomplete,onChange:function(e){return p(R(R({},m),{},{country:e,state:""}))},errorId:"shipping"===b?"shipping-missing-country":null,errorMessage:e.errorMessage,required:e.required})}if("state"===e.key){var r="shipping"===b?S:k;return Object(o.createElement)(r,{key:e.key,id:"".concat(t,"-").concat(e.key),country:m.country,label:e.required?e.label:e.optionalLabel,value:m.state,autoComplete:e.autocomplete,onChange:function(e){return p(R(R({},m),{},{state:e}))},errorMessage:e.errorMessage,required:e.required})}return Object(o.createElement)(a.a,{key:e.key,id:"".concat(t,"-").concat(e.key),className:"wc-block-components-address-form__".concat(e.key),label:e.required?e.label:e.optionalLabel,value:m[e.key],autoCapitalize:e.autocapitalize,autoComplete:e.autocomplete,onChange:function(t){return p(R(R({},m),{},c()({},e.key,t)))},errorMessage:e.errorMessage,required:e.required})})))}))},510:function(e,t,n){"use strict";var r=n(9),c=n.n(r),o=n(8),a=n.n(o),i=n(0),s=n(6),u=n.n(s),l=n(1),p=n(43),d=n(27),b=n(3),m=function(e){var t=e.selectedShippingRates;return Object(i.createElement)("div",{className:"wc-block-components-totals-item__description wc-block-components-totals-shipping__via"},Object(l.__)("via",'woocommerce')," ",t.join(", "))},f=n(890),g=n(200),O=function(e){var t=e.hasRates,n=e.shippingRates,r=e.shippingRatesLoading,c=t?Object(l.__)("Shipping options",'woocommerce'):Object(l.__)("Choose a shipping option",'woocommerce');return Object(i.createElement)("fieldset",{className:"wc-block-components-totals-shipping__fieldset"},Object(i.createElement)("legend",{className:"screen-reader-text"},c),Object(i.createElement)(g.a,{className:"wc-block-components-totals-shipping__options",collapsible:!0,noResultsMessage:Object(i.createElement)(f.a,{isDismissible:!1,className:u()("wc-block-components-shipping-rates-control__no-results-notice","woocommerce-error")},Object(l.__)("No shipping options were found.",'woocommerce')),shippingRates:n,shippingRatesLoading:r}))},h=n(75),j=n(90),v=n(34),E=n.n(v),y=n(132),_=(n(190),n(504)),w=function(e){var t=e.address,n=e.onUpdate,r=e.addressFields,c=Object(i.useState)(t),o=a()(c,2),s=o[0],u=o[1],p=Object(y.b)(),d=p.hasValidationErrors,b=p.showAllValidationErrors;return Object(i.createElement)("form",{className:"wc-block-components-shipping-calculator-address"},Object(i.createElement)(_.a,{fields:r,onChange:u,values:s}),Object(i.createElement)(j.a,{className:"wc-block-components-shipping-calculator-address__button",disabled:E()(s,t),onClick:function(e){if(e.preventDefault(),b(),!d)return n(s)},type:"submit"},Object(l.__)("Update",'woocommerce')))},S=function(e){var t=e.onUpdate,n=void 0===t?function(){}:t,r=e.addressFields,c=void 0===r?["country","state","city","postcode"]:r,o=Object(h.b)(),a=o.shippingAddress,s=o.setShippingAddress;return Object(i.createElement)("div",{className:"wc-block-components-shipping-calculator"},Object(i.createElement)(w,{address:a,addressFields:c,onUpdate:function(e){s(e),n(e)}}))},k=n(38),C=n.n(k),P=n(25),N=function(e){var t=e.address;if(0===Object.values(t).length)return null;var n=Object(b.getSetting)("shippingCountries",{}),r=Object(b.getSetting)("shippingStates",{}),c="string"==typeof n[t.country]?Object(P.decodeEntities)(n[t.country]):"",o="object"===C()(r[t.country])&&"string"==typeof r[t.country][t.state]?Object(P.decodeEntities)(r[t.country][t.state]):t.state,a=[];a.push(t.postcode.toUpperCase()),a.push(t.city),a.push(o),a.push(c);var s=a.filter(Boolean).join(", ");return s?Object(i.createElement)("span",{className:"wc-block-components-shipping-address"},Object(l.sprintf)(
/* translators: %s location. */
Object(l.__)("Shipping to %s",'woocommerce'),s)+" "):null},M=(n(267),function(e){var t=e.label,n=void 0===t?Object(l.__)("Calculate",'woocommerce'):t,r=e.isShippingCalculatorOpen,c=e.setIsShippingCalculatorOpen;return Object(i.createElement)("button",{className:"wc-block-components-totals-shipping__change-address-button",onClick:function(){c(!r)},"aria-expanded":r},n)}),R=function(e){var t=e.showCalculator,n=e.isShippingCalculatorOpen,r=e.setIsShippingCalculatorOpen,c=e.shippingAddress;return Object(i.createElement)(i.Fragment,null,Object(i.createElement)(N,{address:c}),t&&Object(i.createElement)(M,{label:Object(l.__)("(change address)",'woocommerce'),isShippingCalculatorOpen:n,setIsShippingCalculatorOpen:r}))},I=function(e){var t=e.showCalculator,n=e.isShippingCalculatorOpen,r=e.setIsShippingCalculatorOpen;return t?Object(i.createElement)(M,{isShippingCalculatorOpen:n,setIsShippingCalculatorOpen:r}):Object(i.createElement)("em",null,Object(l.__)("Calculated during checkout",'woocommerce'))};t.a=function(e){var t=e.currency,n=e.values,r=e.showCalculator,o=void 0===r||r,s=e.showRateSelector,f=void 0===s||s,g=e.className,h=Object(i.useState)(!1),j=a()(h,2),v=j[0],E=j[1],y=Object(p.a)(),_=y.shippingAddress,w=y.cartHasCalculatedShipping,k=y.shippingRates,C=y.shippingRatesLoading,P=Object(b.getSetting)("displayCartPricesIncludingTax",!1)?parseInt(n.total_shipping,10)+parseInt(n.total_shipping_tax,10):parseInt(n.total_shipping,10),N=k.some((function(e){return e.shipping_rates.length}))||P,M={isShippingCalculatorOpen:v,setIsShippingCalculatorOpen:E},x=k.flatMap((function(e){return e.shipping_rates.filter((function(e){return e.selected})).flatMap((function(e){return e.name}))}));return Object(i.createElement)("div",{className:u()("wc-block-components-totals-shipping",g)},Object(i.createElement)(d.TotalsItem,{label:Object(l.__)("Shipping",'woocommerce'),value:w?P:Object(i.createElement)(I,c()({showCalculator:o},M)),description:Object(i.createElement)(i.Fragment,null,w&&Object(i.createElement)(i.Fragment,null,Object(i.createElement)(m,{selectedShippingRates:x}),Object(i.createElement)(R,c()({shippingAddress:_,showCalculator:o},M)))),currency:t}),o&&v&&Object(i.createElement)(S,{onUpdate:function(){E(!1)}}),f&&w&&Object(i.createElement)(O,{hasRates:N,shippingRates:k,shippingRatesLoading:C}))}},517:function(e,t,n){"use strict";n.d(t,"a",(function(){return f}));var r=n(8),c=n.n(r),o=n(0),a=n(4),i=n(1),s=n(3),u=n(33),l=n.n(u),p=[],d=n(9),b=n.n(d),m=function(e){return Object(o.createElement)("div",b()({className:"edit-post-welcome-guide__image edit-post-welcome-guide__image__prm-np",style:{display:"flex",justifyContent:"center",alignItems:"center"}},e),Object(o.createElement)("svg",{height:"120",viewBox:"0 0 170 120",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Object(o.createElement)("g",{filter:"url(#filter0_ddd)"},Object(o.createElement)("rect",{x:"5.5",y:"18",width:"159",height:"96",rx:"3",fill:"white"}),Object(o.createElement)("rect",{x:"24.5",y:"4",width:"51",height:"22",rx:"3",fill:"white"}),Object(o.createElement)("rect",{x:"94.5",y:"4",width:"51",height:"22",rx:"3",fill:"white"})),Object(o.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M48.8908 42H125.078C129.899 42 133.802 45.9231 133.802 50.7692V80C133.802 84.8462 129.899 88.7692 125.078 88.7692H97.756L101.506 98L85.0135 88.7692H48.929C44.1076 88.7692 40.2045 84.8462 40.2045 80V50.7692C40.1662 45.9615 44.0693 42 48.8908 42Z",fill:"#7F54B3"}),Object(o.createElement)("path",{d:"M44.8709 50.723C45.4039 50.0175 46.2033 49.6462 47.2693 49.5719C49.2108 49.4234 50.3149 50.3145 50.5814 52.2453C51.7615 60.0056 53.0559 66.5778 54.4264 71.9617L62.7637 56.4782C63.5251 55.0673 64.4768 54.3246 65.6189 54.2504C67.294 54.139 68.3219 55.1786 68.7406 57.3694C69.6924 62.3077 70.9106 66.5035 72.3573 70.0681C73.3471 60.6369 75.0222 53.8419 77.3825 49.6462C77.9535 48.6065 78.7911 48.0867 79.8951 48.0124C80.7707 47.9382 81.5702 48.1981 82.2935 48.755C83.0168 49.312 83.3975 50.0175 83.4736 50.8715C83.5117 51.5398 83.3975 52.0968 83.0929 52.6538C81.6082 55.3272 80.39 59.82 79.4002 66.0579C78.4484 72.1102 78.1058 76.8258 78.3342 80.2047C78.4104 81.133 78.2581 81.9499 77.8774 82.6553C77.4205 83.4722 76.7353 83.9178 75.8597 83.9921C74.8699 84.0663 73.842 83.6207 72.8522 82.6182C69.3117 79.0908 66.4945 73.8183 64.4388 66.8006C61.9642 71.5533 60.1369 75.1178 58.9567 77.4942C56.7106 81.69 54.8071 83.8435 53.2082 83.9549C52.1803 84.0292 51.3047 83.1752 50.5433 81.3929C48.6017 76.5288 46.5079 67.1347 44.2618 53.2107C44.1476 52.2453 44.3379 51.3913 44.8709 50.723Z",fill:"white"}),Object(o.createElement)("path",{d:"M126.922 56.5426C125.536 54.1968 123.495 52.7819 120.761 52.2234C120.029 52.0745 119.336 52 118.681 52C114.985 52 111.981 53.8617 109.632 57.5851C107.63 60.75 106.629 64.25 106.629 68.0851C106.629 70.9521 107.245 73.4096 108.477 75.4574C109.863 77.8032 111.904 79.2181 114.638 79.7766C115.37 79.9255 116.063 80 116.717 80C120.453 80 123.456 78.1383 125.767 74.4149C127.769 71.2128 128.77 67.7128 128.77 63.8777C128.77 60.9734 128.154 58.5532 126.922 56.5426ZM122.07 66.8564C121.531 69.3138 120.568 71.1383 119.143 72.367C118.027 73.3351 116.987 73.7447 116.024 73.5585C115.1 73.3723 114.33 72.5904 113.752 71.1383C113.29 69.984 113.059 68.8298 113.059 67.75C113.059 66.8192 113.136 65.8883 113.329 65.0319C113.675 63.5053 114.33 62.016 115.37 60.6011C116.64 58.7766 117.988 58.0319 119.374 58.2925C120.299 58.4787 121.069 59.2606 121.646 60.7128C122.108 61.867 122.339 63.0213 122.339 64.1011C122.339 65.0691 122.224 66 122.07 66.8564Z",fill:"white"}),Object(o.createElement)("path",{d:"M102.767 56.5426C101.381 54.1968 99.3018 52.7819 96.6063 52.2234C95.8747 52.0745 95.1816 52 94.5269 52C90.8303 52 87.8267 53.8617 85.4778 57.5851C83.4755 60.75 82.4743 64.25 82.4743 68.0851C82.4743 70.9521 83.0904 73.4096 84.3226 75.4574C85.7089 77.8032 87.7497 79.2181 90.4837 79.7766C91.2153 79.9255 91.9085 80 92.5631 80C96.2983 80 99.3018 78.1383 101.612 74.4149C103.615 71.2128 104.616 67.7128 104.616 63.8777C104.616 60.9734 104 58.5532 102.767 56.5426ZM97.9155 66.8564C97.3765 69.3138 96.4138 71.1383 94.989 72.367C93.8723 73.3351 92.8326 73.7447 91.87 73.5585C90.9458 73.3723 90.1757 72.5904 89.5981 71.1383C89.136 69.984 88.9049 68.8298 88.9049 67.75C88.9049 66.8192 88.9819 65.8883 89.1745 65.0319C89.521 63.5053 90.1757 62.016 91.2153 60.6011C92.4861 58.7766 93.8338 58.0319 95.2201 58.2925C96.1442 58.4787 96.9144 59.2606 97.492 60.7128C97.9541 61.867 98.1851 63.0213 98.1851 64.1011C98.1851 65.0691 98.1081 66 97.9155 66.8564Z",fill:"white"}),Object(o.createElement)("defs",null,Object(o.createElement)("filter",{id:"filter0_ddd",x:"0.5",y:"0",width:"169",height:"120",filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB"},Object(o.createElement)("feFlood",{floodOpacity:"0",result:"BackgroundImageFix"}),Object(o.createElement)("feColorMatrix",{in:"SourceAlpha",type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"}),Object(o.createElement)("feOffset",{dy:"1"}),Object(o.createElement)("feGaussianBlur",{stdDeviation:"1.5"}),Object(o.createElement)("feColorMatrix",{type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.2 0"}),Object(o.createElement)("feBlend",{mode:"normal",in2:"BackgroundImageFix",result:"effect1_dropShadow"}),Object(o.createElement)("feColorMatrix",{in:"SourceAlpha",type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"}),Object(o.createElement)("feOffset",{dy:"1"}),Object(o.createElement)("feGaussianBlur",{stdDeviation:"2.5"}),Object(o.createElement)("feColorMatrix",{type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.12 0"}),Object(o.createElement)("feBlend",{mode:"normal",in2:"effect1_dropShadow",result:"effect2_dropShadow"}),Object(o.createElement)("feColorMatrix",{in:"SourceAlpha",type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"}),Object(o.createElement)("feOffset",{dy:"2"}),Object(o.createElement)("feGaussianBlur",{stdDeviation:"1"}),Object(o.createElement)("feColorMatrix",{type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.14 0"}),Object(o.createElement)("feBlend",{mode:"normal",in2:"effect2_dropShadow",result:"effect3_dropShadow"}),Object(o.createElement)("feBlend",{mode:"normal",in:"SourceGraphic",in2:"effect3_dropShadow",result:"shape"})))))};function f(e){var t=function(e){var t=function(e,t){var n=Object(o.useState)((function(){var n=window.localStorage.getItem(e);if(n)try{return JSON.parse(n)}catch(t){console.error("Value for key '".concat(e,"' could not be retrieved from localStorage because it can't be parsed."))}return t})),r=c()(n,2),a=r[0],i=r[1];return Object(o.useEffect)((function(){try{window.localStorage.setItem(e,JSON.stringify(a))}catch(t){console.error("Value for key '".concat(e,"' could not be saved in localStorage because it can't be converted into a string."))}}),[e,a]),[a,i]}("wc-blocks_dismissed_compatibility_notices",p),n=c()(t,2),r=n[0],a=n[1],i=Object(o.useState)(!1),s=c()(i,2),u=s[0],d=s[1],b=r.includes(e);return Object(o.useEffect)((function(){d(!b)}),[b]),[u,function(){var t=new Set(r);t.add(e),a(l()(t))}]}(e.blockName),n=c()(t,2),r=n[0],u=n[1];return Object(s.isWpVersion)("5.4","<=")||!r?null:Object(o.createElement)(a.Guide,{className:"edit-post-welcome-guide",contentLabel:Object(i.__)("Compatibility notice",'woocommerce'),onFinish:function(){return u()},finishButtonText:Object(i.__)("Got it!",'woocommerce'),pages:[{image:Object(o.createElement)(m,null),content:Object(o.createElement)(o.Fragment,null,Object(o.createElement)("h1",{className:"edit-post-welcome-guide__heading"},Object(i.__)("Compatibility notice",'woocommerce')),Object(o.createElement)("p",{className:"edit-post-welcome-guide__text"},Object(o.createInterpolateElement)(Object(i.__)("This block may not be compatible with <em>all</em> checkout extensions and integrations.",'woocommerce'),{em:Object(o.createElement)("em",null)})),Object(o.createElement)("p",{className:"edit-post-welcome-guide__text"},Object(o.createInterpolateElement)(Object(i.__)("We recommend reviewing our <a>expanding list</a> of compatible extensions prior to using this block on a live store.",'woocommerce'),{a:Object(o.createElement)("a",{href:"https://docs.woocommerce.com/document/cart-checkout-blocks-support-status/",target:"_blank",rel:"noopener noreferrer"})})))}]})}},518:function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var r=n(1),c=n(37),o=n(3),a=[{destination:{address_1:"",address_2:"",city:"",state:"",postcode:"",country:""},package_id:0,name:Object(r.__)("Shipping",'woocommerce'),items:[{key:"33e75ff09dd601bbe69f351039152189",name:Object(r._x)("Beanie with Logo","example product in Cart Block",'woocommerce'),quantity:2},{key:"6512bd43d9caa6e02c990b0a82652dca",name:Object(r._x)("Beanie","example product in Cart Block",'woocommerce'),quantity:1}],shipping_rates:[{currency_code:"USD",currency_symbol:"$",currency_minor_unit:2,currency_decimal_separator:".",currency_thousand_separator:",",currency_prefix:"$",currency_suffix:"",name:Object(r.__)("Free shipping",'woocommerce'),description:"",delivery_time:"",price:"000",taxes:"0",rate_id:"free_shipping:1",instance_id:0,meta_data:[],method_id:"flat_rate",selected:!0},{currency_code:"USD",currency_symbol:"$",currency_minor_unit:2,currency_decimal_separator:".",currency_thousand_separator:",",currency_prefix:"$",currency_suffix:"",name:Object(r.__)("Local pickup",'woocommerce'),description:"",delivery_time:"",price:"200",taxes:"0",rate_id:"local_pickup:1",instance_id:1,meta_data:[],method_id:"local_pickup",selected:!1}]}],i=Object(o.getSetting)("displayCartPricesIncludingTax",!1),s={coupons:[],shipping_rates:Object(o.getSetting)("shippingMethodsExist",!1)?a:[],items:[{key:"1",id:1,quantity:2,name:Object(r.__)("Beanie",'woocommerce'),short_description:Object(r.__)("Warm hat for winter",'woocommerce'),description:"Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.",sku:"woo-beanie",permalink:"https://example.org",low_stock_remaining:2,backorders_allowed:!1,show_backorder_badge:!1,sold_individually:!1,images:[{id:10,src:c.m+"previews/beanie.jpg",thumbnail:c.m+"previews/beanie.jpg",srcset:"",sizes:"",name:"",alt:""}],variation:[{attribute:Object(r.__)("Color",'woocommerce'),value:Object(r.__)("Yellow",'woocommerce')},{attribute:Object(r.__)("Size",'woocommerce'),value:Object(r.__)("Small",'woocommerce')}],prices:{currency_code:"USD",currency_symbol:"$",currency_minor_unit:2,currency_decimal_separator:".",currency_thousand_separator:",",currency_prefix:"$",currency_suffix:"",price:i?"800":"640",regular_price:i?"800":"640",sale_price:i?"800":"640",raw_prices:{precision:6,price:i?"8000000":"6400000",regular_price:i?"8000000":"6400000",sale_price:i?"8000000":"6400000"}},totals:{currency_code:"USD",currency_symbol:"$",currency_minor_unit:2,currency_decimal_separator:".",currency_thousand_separator:",",currency_prefix:"$",currency_suffix:"",line_subtotal:i?"1600":"1280",line_subtotal_tax:"0",line_total:"1600",line_total_tax:i?"0":"320"},extensions:{}},{key:"2",id:2,quantity:1,name:Object(r.__)("Cap",'woocommerce'),short_description:Object(r.__)("Lightweight baseball cap",'woocommerce'),description:"Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.",sku:"woo-cap",permalink:"https://example.org",backorders_allowed:!1,show_backorder_badge:!1,sold_individually:!1,images:[{id:11,src:c.m+"previews/cap.jpg",thumbnail:c.m+"previews/cap.jpg",srcset:"",sizes:"",name:"",alt:""}],variation:[{attribute:Object(r.__)("Color",'woocommerce'),value:Object(r.__)("Orange",'woocommerce')}],prices:{currency_code:"USD",currency_symbol:"$",currency_minor_unit:2,currency_decimal_separator:".",currency_thousand_separator:",",currency_prefix:"$",currency_suffix:"",price:i?"1400":"1120",regular_price:i?"1600":"1280",sale_price:i?"1400":"1120",raw_prices:{precision:6,price:i?"14000000":"11200000",regular_price:i?"16000000":"12800000",sale_price:i?"14000000":"11200000"}},totals:{currency_code:"USD",currency_symbol:"$",currency_minor_unit:2,currency_decimal_separator:".",currency_thousand_separator:",",currency_prefix:"$",currency_suffix:"",line_subtotal:i?"1400":"1120",line_subtotal_tax:i?"0":"280",line_total:"1400",line_total_tax:i?"0":"280"},extensions:{}}],fees:[],items_count:3,items_weight:0,needs_payment:!0,needs_shipping:Object(o.getSetting)("shippingEnabled",!0),has_calculated_shipping:!0,shipping_address:{first_name:"",last_name:"",company:"",address_1:"",address_2:"",city:"",state:"",postcode:"",country:"",phone:""},billing_address:{first_name:"",last_name:"",company:"",address_1:"",address_2:"",city:"",state:"",postcode:"",country:"",email:"",phone:""},totals:{currency_code:"USD",currency_symbol:"$",currency_minor_unit:2,currency_decimal_separator:".",currency_thousand_separator:",",currency_prefix:"$",currency_suffix:"",total_items:i?"3000":"2400",total_items_tax:"0",total_fees:"0",total_fees_tax:"0",total_discount:"0",total_discount_tax:"0",total_shipping:"0",total_shipping_tax:"0",total_tax:"600",total_price:"3000",tax_lines:[{name:Object(r.__)("Sales tax",'woocommerce'),rate:"20%",price:600}]},errors:[],payment_requirements:["products"],generated_timestamp:Date.now(),extensions:{}}},53:function(e,t,n){"use strict";var r=n(9),c=n.n(r),o=n(5),a=n.n(o),i=n(16),s=n.n(i),u=n(0),l=n(166),p=n(6),d=n.n(p),b=(n(175),["className","value","currency","onValueChange","displayType"]);function m(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function f(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?m(Object(n),!0).forEach((function(t){a()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):m(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}t.a=function(e){var t=e.className,n=e.value,r=e.currency,o=e.onValueChange,a=e.displayType,i=void 0===a?"text":a,p=s()(e,b),m="string"==typeof n?parseInt(n,10):n;if(!Number.isFinite(m))return null;var g=m/Math.pow(10,r.minorUnit);if(!Number.isFinite(g))return null;var O=d()("wc-block-formatted-money-amount","wc-block-components-formatted-money-amount",t),h=f(f(f({},p),function(e){return{thousandSeparator:e.thousandSeparator,decimalSeparator:e.decimalSeparator,decimalScale:e.minorUnit,fixedDecimalScale:!0,prefix:e.prefix,suffix:e.suffix,isNumericString:!0}}(r)),{},{value:void 0,currency:void 0,onValueChange:void 0}),j=o?function(e){var t=e.value*Math.pow(10,r.minorUnit);o(t)}:function(){};return Object(u.createElement)(l.a,c()({className:O,displayType:i},h,{value:g,onValueChange:j}))}},534:function(e,t,n){"use strict";(function(e){var r=n(8),c=n.n(r),o=n(0),a=n(1),i=n(169),s=n(90),u=n(37),l=n(57),p=n(163),d=n(371),b=(n(819),function(e){return Object.values(e).reduce((function(e,t){return null!==t.icons&&(e=e.concat(t.icons)),e}),[])});t.a=function(t){var n=t.link,r=Object(l.b)().isCalculating,m=Object(d.a)(),f=c()(m,2),g=f[0],O=f[1],h=Object(o.useState)(!1),j=c()(h,2),v=j[0],E=j[1],y=Object(p.b)().paymentMethods;Object(o.useEffect)((function(){if("function"==typeof e.addEventListener&&"function"==typeof e.removeEventListener){var t=function(){E(!1)};return e.addEventListener("pageshow",t),function(){e.removeEventListener("pageshow",t)}}}),[]);var _=Object(o.createElement)(o.Fragment,null,Object(o.createElement)(s.a,{className:"wc-block-cart__submit-button",href:n||u.f,disabled:r,onClick:function(){return E(!0)},showSpinner:v},Object(a.__)("Proceed to Checkout",'woocommerce')),Object(o.createElement)(i.a,{icons:b(y)}));return Object(o.createElement)("div",{className:"wc-block-cart__submit"},g,Object(o.createElement)("div",{className:"wc-block-cart__submit-container"},_),"below"===O&&Object(o.createElement)("div",{className:"wc-block-cart__submit-container wc-block-cart__submit-container--sticky"},_))}}).call(this,n(225))},55:function(e,t){e.exports=window.wp.hooks},56:function(e,t){e.exports=window.wp.deprecated},57:function(e,t,n){"use strict";n.d(t,"b",(function(){return L})),n.d(t,"a",(function(){return U}));var r,c=n(8),o=n.n(c),a=n(0),i=n(1),s=n(136),u=n(56),l=n.n(u),p=n(72);!function(e){e.SET_IDLE="set_idle",e.SET_PRISTINE="set_pristine",e.SET_REDIRECT_URL="set_redirect_url",e.SET_COMPLETE="set_checkout_complete",e.SET_BEFORE_PROCESSING="set_before_processing",e.SET_AFTER_PROCESSING="set_after_processing",e.SET_PROCESSING_RESPONSE="set_processing_response",e.SET_PROCESSING="set_checkout_is_processing",e.SET_HAS_ERROR="set_checkout_has_error",e.SET_NO_ERROR="set_checkout_no_error",e.SET_CUSTOMER_ID="set_checkout_customer_id",e.SET_ORDER_ID="set_checkout_order_id",e.SET_ORDER_NOTES="set_checkout_order_notes",e.INCREMENT_CALCULATING="increment_calculating",e.DECREMENT_CALCULATING="decrement_calculating",e.SET_SHOULD_CREATE_ACCOUNT="set_should_create_account",e.SET_EXTENSION_DATA="set_extension_data"}(r||(r={}));var d,b,m=function(){return{type:r.SET_IDLE}},f=function(e){return{type:r.SET_REDIRECT_URL,redirectUrl:e}},g=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{type:r.SET_COMPLETE,data:e}},O=function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return{type:e?r.SET_HAS_ERROR:r.SET_NO_ERROR}},h=n(5),j=n.n(h),v=n(3);function E(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}!function(e){e.PRISTINE="pristine",e.IDLE="idle",e.PROCESSING="processing",e.COMPLETE="complete",e.BEFORE_PROCESSING="before_processing",e.AFTER_PROCESSING="after_processing"}(b||(b={}));var y=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?E(Object(n),!0).forEach((function(t){j()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):E(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({order_id:0,customer_id:0},(null===(d=Object(v.getSetting)("preloadedApiRequests",{})["/wc/store/checkout"])||void 0===d?void 0:d.body)||{}),_={redirectUrl:"",status:b.PRISTINE,hasError:!1,calculatingCount:0,orderId:y.order_id,orderNotes:"",customerId:y.customer_id,shouldCreateAccount:!1,processingResponse:null,extensionData:{}};function w(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function S(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?w(Object(n),!0).forEach((function(t){j()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):w(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var k=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:_,t=arguments.length>1?arguments[1]:void 0,n=t.redirectUrl,c=t.type,o=t.customerId,a=t.orderId,i=t.orderNotes,s=t.extensionData,u=t.shouldCreateAccount,l=t.data,p=e;switch(c){case r.SET_PRISTINE:p=_;break;case r.SET_IDLE:p=e.status!==b.IDLE?S(S({},e),{},{status:b.IDLE}):e;break;case r.SET_REDIRECT_URL:p=void 0!==n&&n!==e.redirectUrl?S(S({},e),{},{redirectUrl:n}):e;break;case r.SET_PROCESSING_RESPONSE:p=S(S({},e),{},{processingResponse:l});break;case r.SET_COMPLETE:p=e.status!==b.COMPLETE?S(S({},e),{},{status:b.COMPLETE,redirectUrl:void 0!==l&&"string"==typeof l.redirectUrl&&l.redirectUrl?l.redirectUrl:e.redirectUrl}):e;break;case r.SET_PROCESSING:p=!1===(p=e.status!==b.PROCESSING?S(S({},e),{},{status:b.PROCESSING,hasError:!1}):e).hasError?p:S(S({},p),{},{hasError:!1});break;case r.SET_BEFORE_PROCESSING:p=e.status!==b.BEFORE_PROCESSING?S(S({},e),{},{status:b.BEFORE_PROCESSING,hasError:!1}):e;break;case r.SET_AFTER_PROCESSING:p=e.status!==b.AFTER_PROCESSING?S(S({},e),{},{status:b.AFTER_PROCESSING}):e;break;case r.SET_HAS_ERROR:p=e.hasError?e:S(S({},e),{},{hasError:!0}),p=e.status===b.PROCESSING||e.status===b.BEFORE_PROCESSING?S(S({},p),{},{status:b.IDLE}):p;break;case r.SET_NO_ERROR:p=e.hasError?S(S({},e),{},{hasError:!1}):e;break;case r.INCREMENT_CALCULATING:p=S(S({},e),{},{calculatingCount:e.calculatingCount+1});break;case r.DECREMENT_CALCULATING:p=S(S({},e),{},{calculatingCount:Math.max(0,e.calculatingCount-1)});break;case r.SET_CUSTOMER_ID:p=void 0!==o?S(S({},e),{},{customerId:o}):e;break;case r.SET_ORDER_ID:p=void 0!==a?S(S({},e),{},{orderId:a}):e;break;case r.SET_SHOULD_CREATE_ACCOUNT:void 0!==u&&u!==e.shouldCreateAccount&&(p=S(S({},e),{},{shouldCreateAccount:u}));break;case r.SET_ORDER_NOTES:void 0!==i&&e.orderNotes!==i&&(p=S(S({},e),{},{orderNotes:i}));break;case r.SET_EXTENSION_DATA:void 0!==s&&e.extensionData!==s&&(p=S(S({},e),{},{extensionData:s}))}return p!==e&&c!==r.SET_PRISTINE&&p.status===b.PRISTINE&&(p.status=b.IDLE),p},C=n(25),P=n(126),N=n(321),M=n(322),R=n(132),I=n(59),x=n(68),D=n(14),T=n(50),A=Object(a.createContext)({dispatchActions:{resetCheckout:function(){},setRedirectUrl:function(e){},setHasError:function(e){},setAfterProcessing:function(e){},incrementCalculating:function(){},decrementCalculating:function(){},setCustomerId:function(e){},setOrderId:function(e){},setOrderNotes:function(e){},setExtensionData:function(e){}},onSubmit:function(){},isComplete:!1,isIdle:!1,isCalculating:!1,isProcessing:!1,isBeforeProcessing:!1,isAfterProcessing:!1,hasError:!1,redirectUrl:"",orderId:0,orderNotes:"",customerId:0,onCheckoutAfterProcessingWithSuccess:function(){return function(){}},onCheckoutAfterProcessingWithError:function(){return function(){}},onCheckoutBeforeProcessing:function(){return function(){}},onCheckoutValidationBeforeProcessing:function(){return function(){}},hasOrder:!1,isCart:!1,shouldCreateAccount:!1,setShouldCreateAccount:function(e){},extensionData:{}}),L=function(){return Object(a.useContext)(A)},U=function(e){var t=e.children,n=e.redirectUrl,c=e.isCart,u=void 0!==c&&c;_.redirectUrl=n;var d,h=Object(a.useReducer)(k,_),j=o()(h,2),v=j[0],E=j[1],y=Object(R.b)().setValidationErrors,w=Object(I.a)(),S=w.addErrorNotice,L=w.removeNotices,U=Object(x.a)().dispatchCheckoutEvent,F=v.calculatingCount>0,V=Object(T.c)(),z=V.isSuccessResponse,B=V.isErrorResponse,G=V.isFailResponse,q=V.shouldRetry,Y=(d=Object(T.c)().noticeContexts,{checkoutNotices:Object(D.useSelect)((function(e){return e("core/notices").getNotices("wc/checkout")}),[]),expressPaymentNotices:Object(D.useSelect)((function(e){return e("core/notices").getNotices(d.EXPRESS_PAYMENTS)}),[d.EXPRESS_PAYMENTS]),paymentNotices:Object(D.useSelect)((function(e){return e("core/notices").getNotices(d.PAYMENTS)}),[d.PAYMENTS])}),H=Y.checkoutNotices,W=Y.paymentNotices,Q=Y.expressPaymentNotices,$=Object(a.useReducer)(P.b,{}),K=o()($,2),X=K[0],Z=K[1],J=Object(a.useRef)(X),ee=function(e){return Object(a.useMemo)((function(){return{onCheckoutAfterProcessingWithSuccess:Object(N.a)("checkout_after_processing_with_success",e),onCheckoutAfterProcessingWithError:Object(N.a)("checkout_after_processing_with_error",e),onCheckoutValidationBeforeProcessing:Object(N.a)("checkout_validation_before_processing",e)}}),[e])}(Z),te=ee.onCheckoutAfterProcessingWithSuccess,ne=ee.onCheckoutAfterProcessingWithError,re=ee.onCheckoutValidationBeforeProcessing;Object(a.useEffect)((function(){J.current=X}),[X]);var ce=Object(a.useMemo)((function(){return function(){return l()("onCheckoutBeforeProcessing",{alternative:"onCheckoutValidationBeforeProcessing",plugin:"WooCommerce Blocks"}),re.apply(void 0,arguments)}}),[re]),oe=Object(a.useMemo)((function(){return{resetCheckout:function(){E({type:r.SET_PRISTINE})},setRedirectUrl:function(e){E(f(e))},setHasError:function(e){E(O(e))},incrementCalculating:function(){E({type:r.INCREMENT_CALCULATING})},decrementCalculating:function(){E({type:r.DECREMENT_CALCULATING})},setCustomerId:function(e){var t;E((t=e,{type:r.SET_CUSTOMER_ID,customerId:t}))},setOrderId:function(e){E(function(e){return{type:r.SET_ORDER_ID,orderId:e}}(e))},setOrderNotes:function(e){E(function(e){return{type:r.SET_ORDER_NOTES,orderNotes:e}}(e))},setExtensionData:function(e){E(function(e){return{type:r.SET_EXTENSION_DATA,extensionData:e}}(e))},setAfterProcessing:function(e){var t,n=function(e){var t={message:"",paymentStatus:"",redirectUrl:"",paymentDetails:{}};return"payment_result"in e&&(t.paymentStatus=e.payment_result.payment_status,t.redirectUrl=e.payment_result.redirect_url,e.payment_result.hasOwnProperty("payment_details")&&Array.isArray(e.payment_result.payment_details)&&e.payment_result.payment_details.forEach((function(e){var n=e.key,r=e.value;t.paymentDetails[n]=Object(C.decodeEntities)(r)}))),"message"in e&&(t.message=Object(C.decodeEntities)(e.message)),!t.message&&"data"in e&&"status"in e.data&&e.data.status>299&&(t.message=Object(i.__)("Something went wrong. Please contact us to get assistance.",'woocommerce')),t}(e);n.redirectUrl&&E(f(n.redirectUrl)),E((t=n,{type:r.SET_PROCESSING_RESPONSE,data:t})),E({type:r.SET_AFTER_PROCESSING})}}}),[]);Object(a.useEffect)((function(){v.status===b.BEFORE_PROCESSING&&(L("error"),Object(M.a)(J.current,"checkout_validation_before_processing",{}).then((function(e){!0!==e?(Array.isArray(e)&&e.forEach((function(e){var t=e.errorMessage,n=e.validationErrors;S(t),y(n)})),E(m()),E(O())):E({type:r.SET_PROCESSING})})))}),[v.status,y,S,L,E]);var ae=Object(s.a)(v.status),ie=Object(s.a)(v.hasError);Object(a.useEffect)((function(){if((v.status!==ae||v.hasError!==ie)&&v.status===b.AFTER_PROCESSING){var e={redirectUrl:v.redirectUrl,orderId:v.orderId,customerId:v.customerId,orderNotes:v.orderNotes,processingResponse:v.processingResponse};v.hasError?Object(M.b)(J.current,"checkout_after_processing_with_error",e).then((function(t){var n=function(e){var t=null;return e.forEach((function(e){if((B(e)||G(e))&&e.message){var n=e.messageContext?{context:e.messageContext}:void 0;t=e,S(e.message,n)}})),t}(t);if(null!==n)q(n)?E(m()):E(g(n));else{if(!(H.some((function(e){return"error"===e.status}))||Q.some((function(e){return"error"===e.status}))||W.some((function(e){return"error"===e.status})))){var r,c=(null===(r=e.processingResponse)||void 0===r?void 0:r.message)||Object(i.__)("Something went wrong. Please contact us to get assistance.",'woocommerce');S(c,{id:"checkout"})}E(m())}})):Object(M.b)(J.current,"checkout_after_processing_with_success",e).then((function(e){var t=null,n=null;if(e.forEach((function(e){z(e)&&(t=e),(B(e)||G(e))&&(n=e)})),t&&!n)E(g(t));else if(Object(p.b)(n)){if(n.message){var r=n.messageContext?{context:n.messageContext}:void 0;S(n.message,r)}q(n)?E(O(!0)):E(g(n))}else E(g())}))}}),[v.status,v.hasError,v.redirectUrl,v.orderId,v.customerId,v.orderNotes,v.processingResponse,ae,ie,oe,S,B,G,z,q,H,Q,W]);var se={onSubmit:Object(a.useCallback)((function(){U("submit"),E({type:r.SET_BEFORE_PROCESSING})}),[U]),isComplete:v.status===b.COMPLETE,isIdle:v.status===b.IDLE,isCalculating:F,isProcessing:v.status===b.PROCESSING,isBeforeProcessing:v.status===b.BEFORE_PROCESSING,isAfterProcessing:v.status===b.AFTER_PROCESSING,hasError:v.hasError,redirectUrl:v.redirectUrl,onCheckoutBeforeProcessing:ce,onCheckoutValidationBeforeProcessing:re,onCheckoutAfterProcessingWithSuccess:te,onCheckoutAfterProcessingWithError:ne,dispatchActions:oe,isCart:u,orderId:v.orderId,hasOrder:!!v.orderId,customerId:v.customerId,orderNotes:v.orderNotes,shouldCreateAccount:v.shouldCreateAccount,setShouldCreateAccount:function(e){return E((t=e,{type:r.SET_SHOULD_CREATE_ACCOUNT,shouldCreateAccount:t}));var t},extensionData:v.extensionData};return Object(a.createElement)(A.Provider,{value:se},t)}},59:function(e,t,n){"use strict";n.d(t,"a",(function(){return u}));var r=n(5),c=n.n(r),o=n(0),a=n(141);function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function s(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?i(Object(n),!0).forEach((function(t){c()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):i(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var u=function(){var e=Object(a.b)(),t=e.notices,n=e.createNotice,r=e.removeNotice,c=e.setIsSuppressed,i=Object(o.useRef)(t);Object(o.useEffect)((function(){i.current=t}),[t]);var u=Object(o.useMemo)((function(){return{hasNoticesOfType:function(e){return i.current.some((function(t){return t.type===e}))},removeNotices:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;i.current.forEach((function(t){null!==e&&t.status!==e||r(t.id)}))},removeNotice:r}}),[r]),l=Object(o.useMemo)((function(){return{addDefaultNotice:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};n("default",e,s({},t))},addErrorNotice:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};n("error",e,s({},t))},addWarningNotice:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};n("warning",e,s({},t))},addInfoNotice:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};n("info",e,s({},t))},addSuccessNotice:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};n("success",e,s({},t))}}}),[n]);return s(s(s({notices:t},u),l),{},{setIsSuppressed:c})}},60:function(e,t){e.exports=window.wc.wcBlocksRegistry},62:function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var r=n(0),c=n(34),o=n.n(c);function a(e){var t=Object(r.useRef)(e);return o()(e,t.current)||(t.current=e),t.current}},63:function(e,t,n){"use strict";n.d(t,"b",(function(){return a})),n.d(t,"a",(function(){return i}));var r=n(0),c=n(14),o=Object(r.createContext)({isEditor:!1,currentPostId:0,previewData:{},getPreviewData:function(){}}),a=function(){return Object(r.useContext)(o)},i=function(e){var t=e.children,n=e.currentPostId,a=void 0===n?0:n,i=e.previewData,s=void 0===i?{}:i,u=Object(c.useSelect)((function(e){return a||e("core/editor").getCurrentPostId()}),[a]),l=Object(r.useCallback)((function(e){return e in s?s[e]:{}}),[s]),p={isEditor:!0,currentPostId:u,previewData:s,getPreviewData:l};return Object(r.createElement)(o.Provider,{value:p},t)}},64:function(e,t){e.exports=window.wp.a11y},66:function(e,t,n){"use strict";var r=n(5),c=n.n(r),o=n(16),a=n.n(o),i=n(0),s=["srcElement","size"];function u(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}t.a=function(e){var t=e.srcElement,n=e.size,r=void 0===n?24:n,o=a()(e,s);return Object(i.isValidElement)(t)?Object(i.cloneElement)(t,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?u(Object(n),!0).forEach((function(t){c()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):u(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({width:r,height:r},o)):null}},67:function(e,t,n){"use strict";n.d(t,"b",(function(){return _})),n.d(t,"a",(function(){return w}));var r=n(8),c=n.n(r),o=n(0),a=n(3),i=n(5),s=n.n(i),u=n(14),l=n(24),p=n(287),d=n(34),b=n.n(d),m=n(162),f=n(42),g=n(43),O=n(59);function h(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function j(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?h(Object(n),!0).forEach((function(t){s()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):h(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var v=function(e,t){return!(!function(e){return"email"in e}(t)||Object(m.c)(t)===Object(m.c)(e))||!!t.country&&!b()(Object(m.b)(e),Object(m.b)(t))},E=n(57),y=Object(o.createContext)({billingData:{first_name:"",last_name:"",company:"",address_1:"",address_2:"",city:"",state:"",postcode:"",country:"",email:"",phone:""},shippingAddress:{first_name:"",last_name:"",company:"",address_1:"",address_2:"",city:"",state:"",postcode:"",country:"",phone:""},setBillingData:function(){return null},setShippingAddress:function(){return null},shippingAsBilling:!0,setShippingAsBilling:function(){return null}}),_=function(){return Object(o.useContext)(y)},w=function(e){var t=e.children,n=function(){var e=Object(u.useDispatch)(l.CART_STORE_KEY).updateCustomerData,t=Object(O.a)(),n=t.addErrorNotice,r=t.removeNotice,a=Object(g.a)(),i=a.billingAddress,s=a.shippingAddress,d=Object(o.useState)({billingData:i,shippingAddress:s}),m=c()(d,2),h=m[0],E=m[1],y=Object(o.useRef)(h),_=Object(p.a)(h,1e3,{equalityFn:function(e,t){return b()(e.billingData,t.billingData)&&b()(e.shippingAddress,t.shippingAddress)}}),w=c()(_,1)[0],S=Object(o.useCallback)((function(e){E((function(t){return j(j({},t),{},{billingData:j(j({},t.billingData),e)})}))}),[]),k=Object(o.useCallback)((function(e){E((function(t){return j(j({},t),{},{shippingAddress:j(j({},t.shippingAddress),e)})}))}),[]);return Object(o.useEffect)((function(){(v(y.current.billingData,w.billingData)||v(y.current.shippingAddress,w.shippingAddress))&&(y.current=w,e({billing_address:w.billingData,shipping_address:w.shippingAddress}).then((function(){r("checkout")})).catch((function(e){n(Object(f.b)(e),{id:"checkout"})})))}),[w,n,r,e]),{billingData:h.billingData,shippingAddress:h.shippingAddress,setBillingData:S,setShippingAddress:k}}(),r=n.billingData,i=n.shippingAddress,s=n.setBillingData,d=n.setShippingAddress,m=Object(g.a)().cartNeedsShipping,h=Object(E.b)().customerId,_=Object(o.useState)((function(){return m&&(!h||(e=i,t=r,Object.keys(a.defaultAddressFields).every((function(n){return e[n]===t[n]}))));var e,t})),w=c()(_,2),S=w[0],k=w[1],C={billingData:r,shippingAddress:i,setBillingData:s,setShippingAddress:d,shippingAsBilling:S,setShippingAsBilling:k};return Object(o.createElement)(y.Provider,{value:C},t)}},68:function(e,t,n){"use strict";n.d(t,"a",(function(){return l}));var r=n(5),c=n.n(r),o=n(55),a=n(0),i=n(43);function s(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function u(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?s(Object(n),!0).forEach((function(t){c()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):s(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var l=function(){var e=Object(i.a)(),t=Object(a.useRef)(e);return Object(a.useEffect)((function(){t.current=e}),[e]),{dispatchStoreEvent:Object(a.useCallback)((function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};try{Object(o.doAction)("experimental__woocommerce_blocks-".concat(e),t)}catch(e){console.error(e)}}),[]),dispatchCheckoutEvent:Object(a.useCallback)((function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};try{Object(o.doAction)("experimental__woocommerce_blocks-checkout-".concat(e),u(u({},n),{},{storeCart:t.current}))}catch(e){console.error(e)}}),[])}}},7:function(e,t){e.exports=window.lodash},72:function(e,t,n){"use strict";n.d(t,"a",(function(){return r})),n.d(t,"c",(function(){return c})),n.d(t,"b",(function(){return o})),n.d(t,"d",(function(){return a}));var r=function(e){return"number"==typeof e},c=function(e){return"string"==typeof e},o=function(e){return!function(e){return null===e}(e)&&e instanceof Object&&e.constructor===Object};function a(e,t){return o(e)&&t in e}},74:function(e,t){e.exports=window.wp.dom},75:function(e,t,n){"use strict";n.d(t,"b",(function(){return N})),n.d(t,"a",(function(){return M}));var r=n(5),c=n.n(r),o=n(8),a=n.n(o),i=n(0),s=n(34),u=n.n(s),l=n(142),p=function(e){return Object(l.a)(e.map((function(e){var t;return[e.package_id,null===(t=e.shipping_rates.find((function(e){return e.selected})))||void 0===t?void 0:t.rate_id]})))},d={NONE:"none",INVALID_ADDRESS:"invalid_address",UNKNOWN:"unknown_error"},b={INVALID_COUNTRY:"woocommerce_rest_cart_shipping_rates_invalid_country",MISSING_COUNTRY:"woocommerce_rest_cart_shipping_rates_missing_country",INVALID_STATE:"woocommerce_rest_cart_shipping_rates_invalid_state"},m={shippingErrorStatus:{isPristine:!0,isValid:!1,hasInvalidAddress:!1,hasError:!1},dispatchErrorStatus:function(){return null},shippingErrorTypes:d,shippingRates:[],shippingRatesLoading:!1,selectedRates:[],setSelectedRates:function(){return null},shippingAddress:{first_name:"",last_name:"",company:"",address_1:"",address_2:"",city:"",state:"",postcode:"",country:""},setShippingAddress:function(){return null},onShippingRateSuccess:function(){return null},onShippingRateFail:function(){return null},onShippingRateSelectSuccess:function(){return null},onShippingRateSelectFail:function(){return null},needsShipping:!1},f=function(e,t){var n=t.type;return Object.values(d).includes(n)?n:e},g=n(126),O=n(321),h=function(e){return{onSuccess:Object(O.a)("shipping_rates_success",e),onFail:Object(O.a)("shipping_rates_fail",e),onSelectSuccess:Object(O.a)("shipping_rate_select_success",e),onSelectFail:Object(O.a)("shipping_rate_select_fail",e)}},j=n(322),v=n(57),E=n(67),y=n(43),_=n(134);function w(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}var S=d.NONE,k=d.INVALID_ADDRESS,C=d.UNKNOWN,P=Object(i.createContext)(m),N=function(){return Object(i.useContext)(P)},M=function(e){var t=e.children,n=Object(v.b)().dispatchActions,r=Object(E.b)(),o=r.shippingAddress,s=r.setShippingAddress,l=Object(y.a)(),m=l.cartNeedsShipping,O=l.cartHasCalculatedShipping,N=l.shippingRates,M=l.shippingRatesLoading,R=l.cartErrors,I=Object(_.a)(),x=I.selectShippingRate,D=I.isSelectingRate,T=Object(i.useReducer)(f,S),A=a()(T,2),L=A[0],U=A[1],F=Object(i.useReducer)(g.b,{}),V=a()(F,2),z=V[0],B=V[1],G=Object(i.useRef)(z),q=Object(i.useMemo)((function(){return{onShippingRateSuccess:h(B).onSuccess,onShippingRateFail:h(B).onFail,onShippingRateSelectSuccess:h(B).onSelectSuccess,onShippingRateSelectFail:h(B).onSelectFail}}),[B]);Object(i.useEffect)((function(){G.current=z}),[z]);var Y=Object(i.useRef)((function(){return p(N)}));Object(i.useEffect)((function(){var e=p(N);u()(Y.current,e)||(Y.current=e)}),[N]),Object(i.useEffect)((function(){M?n.incrementCalculating():n.decrementCalculating()}),[M,n]),Object(i.useEffect)((function(){D?n.incrementCalculating():n.decrementCalculating()}),[D,n]),Object(i.useEffect)((function(){R.length>0&&R.some((function(e){return!(!e.code||!Object.values(b).includes(e.code))}))?U({type:k}):U({type:S})}),[R]);var H=Object(i.useMemo)((function(){return{isPristine:L===S,isValid:L===S,hasInvalidAddress:L===k,hasError:L===C||L===k}}),[L]);Object(i.useEffect)((function(){M||0!==N.length&&!H.hasError||Object(j.a)(G.current,"shipping_rates_fail",{hasInvalidAddress:H.hasInvalidAddress,hasError:H.hasError})}),[N,M,H.hasError,H.hasInvalidAddress]),Object(i.useEffect)((function(){!M&&N.length>0&&!H.hasError&&Object(j.a)(G.current,"shipping_rates_success",N)}),[N,M,H.hasError]),Object(i.useEffect)((function(){D||(H.hasError?Object(j.a)(G.current,"shipping_rate_select_fail",{hasError:H.hasError,hasInvalidAddress:H.hasInvalidAddress}):Object(j.a)(G.current,"shipping_rate_select_success",Y.current))}),[D,H.hasError,H.hasInvalidAddress]);var W=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?w(Object(n),!0).forEach((function(t){c()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):w(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({shippingErrorStatus:H,dispatchErrorStatus:U,shippingErrorTypes:d,shippingRates:N,shippingRatesLoading:M,selectedRates:Y.current,setSelectedRates:x,isSelectingRate:D,shippingAddress:o,setShippingAddress:s,needsShipping:m,hasCalculatedShipping:O},q);return Object(i.createElement)(i.Fragment,null,Object(i.createElement)(P.Provider,{value:W},t))}},808:function(e,t,n){e.exports=n(855)},809:function(e,t){},810:function(e,t){},811:function(e,t){},812:function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(0),c=n(235),o=function(e){var t=e.children,n=e.redirectUrl;return Object(r.createElement)(c.a,{isCart:!0,redirectUrl:n},t)}},813:function(e,t){},814:function(e,t,n){"use strict";n.d(t,"a",(function(){return m}));var r=n(8),c=n.n(r),o=n(14),a=n(0),i=n(24),s=n(287),u=n(136),l=n(369),p=n(72),d=n(43),b=n(57),m=function(e){var t={key:"",quantity:1};(function(e){return Object(p.b)(e)&&Object(p.d)(e,"key")&&Object(p.d)(e,"quantity")&&Object(p.c)(e.key)&&Object(p.a)(e.quantity)})(e)&&(t.key=e.key,t.quantity=e.quantity);var n=t.key,r=void 0===n?"":n,m=t.quantity,f=void 0===m?1:m,g=Object(d.a)().cartErrors,O=Object(b.b)().dispatchActions,h=Object(a.useState)(f),j=c()(h,2),v=j[0],E=j[1],y=Object(s.a)(v,400),_=c()(y,1)[0],w=Object(u.a)(_),S=Object(o.useDispatch)(i.CART_STORE_KEY),k=S.removeItemFromCart,C=S.changeCartItemQuantity,P=Object(o.useSelect)((function(e){if(!r)return{quantity:!1,delete:!1};var t=e(i.CART_STORE_KEY);return{quantity:t.isItemPendingQuantity(r),delete:t.isItemPendingDelete(r)}}),[r]),N=Object(a.useCallback)((function(){return r?k(r).then((function(){return Object(l.c)(),!0})):Promise.resolve(!1)}),[r,k]);return Object(a.useEffect)((function(){r&&Object(p.a)(w)&&Number.isFinite(w)&&w!==_&&C(r,_)}),[r,C,_,w]),Object(a.useEffect)((function(){return P.delete?O.incrementCalculating():O.decrementCalculating(),function(){P.delete&&O.decrementCalculating()}}),[O,P.delete]),Object(a.useEffect)((function(){return P.quantity||_!==v?O.incrementCalculating():O.decrementCalculating(),function(){(P.quantity||_!==v)&&O.decrementCalculating()}}),[O,P.quantity,_,v]),{isPendingDelete:P.delete,quantity:v,setItemQuantity:E,removeItem:N,cartItemQuantityErrors:g}}},815:function(e,t,n){"use strict";var r=n(0),c=n(1),o=n(53),a=n(110);t.a=function(e){var t=e.currency,n=e.saleAmount,i=e.format,s=void 0===i?"<price/>":i;if(!n||n<=0)return null;s.includes("<price/>")||(s="<price/>",console.error("Price formats need to include the `<price/>` tag."));var u=Object(c.sprintf)(
/* translators: %s will be replaced by the discount amount */
Object(c.__)("Save %s",'woocommerce'),s);return Object(r.createElement)(a.a,{className:"wc-block-components-sale-badge"},Object(r.createInterpolateElement)(u,{price:Object(r.createElement)(o.a,{currency:t,value:n})}))}},818:function(e,t,n){"use strict";var r=n(0),c=n(1),o=n(163),a=n(50),i=n(57),s=n(174),u=n(141),l=n(83),p=n(198);n(274),t.a=function(){var e=Object(o.a)(),t=e.paymentMethods,n=e.isInitialized,d=Object(a.c)().noticeContexts,b=Object(i.b)(),m=b.isCalculating,f=b.isProcessing,g=b.isAfterProcessing,O=b.isBeforeProcessing,h=b.isComplete,j=b.hasError,v=Object(s.b)().currentStatus;if(!n||n&&0===Object.keys(t).length)return null;var E=f||g||O||h&&!j;return Object(r.createElement)(r.Fragment,null,Object(r.createElement)(l.a,{isLoading:m||E||v.isDoingExpressPayment},Object(r.createElement)("div",{className:"wc-block-components-express-payment wc-block-components-express-payment--cart"},Object(r.createElement)("div",{className:"wc-block-components-express-payment__content"},Object(r.createElement)(u.a,{context:d.EXPRESS_PAYMENTS},Object(r.createElement)(p.a,null))))),Object(r.createElement)("div",{className:"wc-block-components-express-payment-continue-rule wc-block-components-express-payment-continue-rule--cart"},Object(c.__)("Or",'woocommerce')))}},819:function(e,t){},820:function(e,t){},83:function(e,t,n){"use strict";var r=n(0),c=n(1),o=(n(2),n(6)),a=n.n(o),i=(n(259),n(114));t.a=function(e){var t=e.children,n=e.className,o=e.screenReaderLabel,s=e.showSpinner,u=void 0!==s&&s,l=e.isLoading,p=void 0===l||l;return Object(r.createElement)("div",{className:a()(n,{"wc-block-components-loading-mask":p})},p&&u&&Object(r.createElement)(i.a,null),Object(r.createElement)("div",{className:a()({"wc-block-components-loading-mask__children":p}),"aria-hidden":p},t),p&&Object(r.createElement)("span",{className:"screen-reader-text"},o||Object(c.__)("Loading…",'woocommerce')))}},855:function(e,t,n){"use strict";n.r(t);var r=n(0),c=n(1),o=n(12),a=n(66),i=n(361),s=n(6),u=n.n(s),l=n(159),p=n(196),d=n(4),b=(n(2),n(517)),m=n(8),f=n.n(m),g=n(21),O=(n(811),Object(g.withInstanceId)((function(e){var t=e.className,n=e.label,o=void 0===n?Object(c.__)("View",'woocommerce'):n,a=e.views,i=e.defaultView,s=e.instanceId,l=e.render,p=Object(r.useState)(i),b=f()(p,2),m=b[0],g=b[1],O=u()(t,"wc-block-view-switch-control"),h="wc-block-view-switch-control-"+s;return Object(r.createElement)(r.Fragment,null,Object(r.createElement)("div",{className:O},Object(r.createElement)("label",{htmlFor:h,className:"wc-block-view-switch-control__label"},o+": "),Object(r.createElement)(d.ButtonGroup,{id:h},a.map((function(e){return Object(r.createElement)(d.Button,{key:e.value,isPrimary:m===e.value,"aria-pressed":m===e.value,onMouseDown:function(){m!==e.value&&g(e.value)},onClick:function(){m!==e.value&&g(e.value)}},e.name)})))),l(m))}))),h=n(195),j=n(37),v=n(125),E=n(63),y=n(812),_=n(3),w=n(518),S=n(24),k=n(14),C=n(43),P=n(83),N=n(132),M=n(369),R=n(277),I=n(16),x=n.n(I),D=n(497),T=n(498),A=n(510),L=n(501),U=n(27),F=n(47),V=n(201),z=n(59),B=n(494),G=n(495),q=n(496),Y=n(135),H=n(25),W=n(534),Q=function(e){var t=e.itemCount,n=void 0===t?1:t;return Object(r.createElement)(Y.a,{headingLevel:"2"},Object(c.sprintf)(
/* translators: %d is the count of items in the cart. */
Object(c._n)("Your cart (%d item)","Your cart (%d items)",n,'woocommerce'),n))},$=n(33),K=n.n($),X=n(64),Z=n(281),J=n(124),ee=n(154),te=n(814),ne=n(68),re=n(307),ce=n(308),oe=n(309),ae=n(815),ie=n(311),se=n(151),ue=n(72),le=["receiveCart"],pe=function(e,t){return e.convertPrecision(t.minorUnit).getAmount()},de=function(e){return Object(U.mustContain)(e,"<price/>")},be=Object(r.forwardRef)((function(e,t){var n=e.lineItem,o=e.onRemove,a=void 0===o?function(){}:o,i=e.tabIndex,s=void 0===i?null:i,l=n.name,p=void 0===l?"":l,d=n.catalog_visibility,b=void 0===d?"visible":d,m=n.short_description,f=void 0===m?"":m,g=n.description,O=void 0===g?"":g,h=n.low_stock_remaining,j=void 0===h?null:h,v=n.show_backorder_badge,E=void 0!==v&&v,y=n.quantity_limit,w=void 0===y?99:y,S=n.permalink,k=void 0===S?"":S,P=n.images,N=void 0===P?[]:P,M=n.variation,R=void 0===M?[]:M,I=n.item_data,D=void 0===I?[]:I,T=n.prices,A=void 0===T?{currency_code:"USD",currency_minor_unit:2,currency_symbol:"$",currency_prefix:"$",currency_suffix:"",currency_decimal_separator:".",currency_thousand_separator:",",price:"0",regular_price:"0",sale_price:"0",price_range:null,raw_prices:{precision:6,price:"0",regular_price:"0",sale_price:"0"}}:T,L=n.totals,V=void 0===L?{currency_code:"USD",currency_minor_unit:2,currency_symbol:"$",currency_prefix:"$",currency_suffix:"",currency_decimal_separator:".",currency_thousand_separator:",",line_subtotal:"0",line_subtotal_tax:"0"}:L,z=n.extensions,B=Object(te.a)(n),G=B.quantity,q=B.setItemQuantity,Y=B.removeItem,H=B.isPendingDelete,W=Object(ne.a)().dispatchStoreEvent,Q=Object(C.a)(),$=(Q.receiveCart,x()(Q,le)),K=Object(r.useMemo)((function(){return{context:"cart",cartItem:n,cart:$}}),[n,$]),be=Object(F.getCurrencyFromPriceResponse)(A),me=Object(U.__experimentalApplyCheckoutFilter)({filterName:"itemName",defaultValue:p,extensions:z,arg:K}),fe=Object(se.a)({amount:parseInt(A.raw_prices.regular_price,10),precision:A.raw_prices.precision}),ge=Object(se.a)({amount:parseInt(A.raw_prices.price,10),precision:A.raw_prices.precision}),Oe=fe.subtract(ge),he=Oe.multiply(G),je=Object(F.getCurrencyFromPriceResponse)(V),ve=parseInt(V.line_subtotal,10);Object(_.getSetting)("displayCartPricesIncludingTax",!1)&&(ve+=parseInt(V.line_subtotal_tax,10));var Ee=Object(se.a)({amount:ve,precision:je.minorUnit}),ye=N.length?N[0]:{},_e="hidden"===b||"search"===b,we=Object(U.__experimentalApplyCheckoutFilter)({filterName:"cartItemPrice",defaultValue:"<price/>",extensions:z,arg:K,validation:de}),Se=Object(U.__experimentalApplyCheckoutFilter)({filterName:"subtotalPriceFormat",defaultValue:"<price/>",extensions:z,arg:K,validation:de}),ke=Object(U.__experimentalApplyCheckoutFilter)({filterName:"saleBadgePriceFormat",defaultValue:"<price/>",extensions:z,arg:K,validation:de});return Object(r.createElement)("tr",{className:u()("wc-block-cart-items__row",{"is-disabled":H}),ref:t,tabIndex:s},Object(r.createElement)("td",{className:"wc-block-cart-item__image","aria-hidden":!Object(ue.d)(ye,"alt")||!ye.alt},_e?Object(r.createElement)(re.a,{image:ye}):Object(r.createElement)("a",{href:k,tabIndex:-1},Object(r.createElement)(re.a,{image:ye}))),Object(r.createElement)("td",{className:"wc-block-cart-item__product"},Object(r.createElement)(ee.a,{disabled:H||_e,name:me,permalink:k}),E?Object(r.createElement)(ce.a,null):!!j&&Object(r.createElement)(oe.a,{lowStockRemaining:j}),Object(r.createElement)("div",{className:"wc-block-cart-item__prices"},Object(r.createElement)(J.a,{currency:be,regularPrice:pe(fe,be),price:pe(ge,be),format:Se})),Object(r.createElement)(ae.a,{currency:be,saleAmount:pe(Oe,be),format:ke}),Object(r.createElement)(ie.a,{shortDescription:f,fullDescription:O,itemData:D,variation:R}),Object(r.createElement)("div",{className:"wc-block-cart-item__quantity"},Object(r.createElement)(Z.a,{disabled:H,quantity:G,maximum:w,onChange:function(e){q(e),W("cart-set-item-quantity",{product:n,quantity:e})},itemName:me}),Object(r.createElement)("button",{className:"wc-block-cart-item__remove-link",onClick:function(){a(),Y(),W("cart-remove-item",{product:n,quantity:G}),Object(X.speak)(Object(c.sprintf)(
/* translators: %s refers to the item name in the cart. */
Object(c.__)("%s has been removed from your cart.",'woocommerce'),me))},disabled:H},Object(c.__)("Remove item",'woocommerce')))),Object(r.createElement)("td",{className:"wc-block-cart-item__total"},Object(r.createElement)("div",{className:"wc-block-cart-item__total-price-and-sale-badge-wrapper"},Object(r.createElement)(J.a,{currency:je,format:we,price:Ee.getAmount()}),G>1&&Object(r.createElement)(ae.a,{currency:be,saleAmount:pe(he,be),format:ke}))))})),me=K()(Array(3)).map((function(_x,e){return Object(r.createElement)(be,{lineItem:{},key:e})})),fe=function(e){var t={};return e.forEach((function(e){var n=e.key;t[n]=Object(r.createRef)()})),t},ge=function(e){var t=e.lineItems,n=void 0===t?[]:t,o=e.isLoading,a=void 0!==o&&o,i=Object(r.useRef)(null),s=Object(r.useRef)(fe(n));Object(r.useEffect)((function(){s.current=fe(n)}),[n]);var u=function(e){return function(){null!=s&&s.current&&e&&s.current[e].current instanceof HTMLElement?s.current[e].current.focus():i.current instanceof HTMLElement&&i.current.focus()}},l=a?me:n.map((function(e,t){var c=n.length>t+1?n[t+1].key:null;return Object(r.createElement)(be,{key:e.key,lineItem:e,onRemove:u(c),ref:s.current[e.key],tabIndex:-1})}));return Object(r.createElement)("table",{className:"wc-block-cart-items",ref:i,tabIndex:-1},Object(r.createElement)("thead",null,Object(r.createElement)("tr",{className:"wc-block-cart-items__header"},Object(r.createElement)("th",{className:"wc-block-cart-items__header-image"},Object(r.createElement)("span",null,Object(c.__)("Product",'woocommerce'))),Object(r.createElement)("th",{className:"wc-block-cart-items__header-product"},Object(r.createElement)("span",null,Object(c.__)("Details",'woocommerce'))),Object(r.createElement)("th",{className:"wc-block-cart-items__header-total"},Object(r.createElement)("span",null,Object(c.__)("Total",'woocommerce'))))),Object(r.createElement)("tbody",null,l))},Oe=n(818),he=(n(813),["extensions","receiveCart"]),je=function(e){var t=e.attributes,n=t.isShippingCalculatorEnabled,o=t.hasDarkControls,a=t.showRateAfterTaxName,i=Object(C.a)(),s=i.cartItems,l=i.cartFees,p=i.cartTotals,d=i.cartIsLoading,b=i.cartItemsCount,m=i.cartItemErrors,f=i.cartNeedsPayment,g=i.cartNeedsShipping,O=Object(V.a)(),h=O.applyCoupon,j=O.removeCoupon,v=O.isApplyingCoupon,E=O.isRemovingCoupon,y=O.appliedCoupons,w=Object(z.a)().addErrorNotice;Object(r.useEffect)((function(){m.forEach((function(e){w(Object(H.decodeEntities)(e.message),{isDismissible:!0,id:e.code})}))}),[w,m]);var S=Object(F.getCurrencyFromPriceResponse)(p),k=u()("wc-block-cart",{"wc-block-cart--is-loading":d,"has-dark-controls":o}),P=Object(C.a)(),N=P.extensions,M=(P.receiveCart,x()(P,he)),R={extensions:N,cart:M},I={extensions:N,cart:M};return Object(r.createElement)(r.Fragment,null,Object(r.createElement)(Q,{itemCount:b}),Object(r.createElement)(B.a,{className:k},Object(r.createElement)(G.a,{className:"wc-block-cart__main"},Object(r.createElement)(ge,{lineItems:s,isLoading:d})),Object(r.createElement)(q.a,{className:"wc-block-cart__sidebar"},Object(r.createElement)(Y.a,{headingLevel:"2",className:"wc-block-cart__totals-title"},Object(c.__)("Cart totals",'woocommerce')),Object(r.createElement)(U.TotalsWrapper,null,Object(r.createElement)(U.Subtotal,{currency:S,values:p}),Object(r.createElement)(U.TotalsFees,{currency:S,cartFees:l}),Object(r.createElement)(D.a,{cartCoupons:y,currency:S,isRemovingCoupon:E,removeCoupon:j,values:p})),Object(_.getSetting)("couponsEnabled",!0)&&Object(r.createElement)(U.TotalsWrapper,null,Object(r.createElement)(T.a,{onSubmit:h,isLoading:v})),Object(r.createElement)(U.ExperimentalDiscountsMeta.Slot,I),g&&Object(r.createElement)(U.TotalsWrapper,null,Object(r.createElement)(A.a,{showCalculator:n,showRateSelector:!0,values:p,currency:S})),!Object(_.getSetting)("displayCartPricesIncludingTax",!1)&&parseInt(p.total_tax,10)>0&&Object(r.createElement)(U.TotalsWrapper,null,Object(r.createElement)(U.TotalsTaxes,{showRateAfterTaxName:a,currency:S,values:p})),Object(r.createElement)(U.TotalsWrapper,null,Object(r.createElement)(L.a,{currency:S,values:p})),Object(r.createElement)(U.ExperimentalOrderMeta.Slot,R),Object(r.createElement)("div",{className:"wc-block-cart__payment-options"},f&&Object(r.createElement)(Oe.a,null),Object(r.createElement)(W.a,{link:Object(_.getSetting)("page-"+(null==t?void 0:t.checkoutPageId),!1)})))))},ve=function(e){var t=e.content;return Object(r.useEffect)((function(){Object(M.a)("wc-blocks_render_blocks_frontend",{element:document.body.querySelector(".wp-block-woocommerce-cart")})}),[]),Object(r.createElement)(r.RawHTML,null,t)},Ee=Object(R.a)((function(e){var t=e.emptyCart,n=e.attributes,c=e.scrollToTop,o=Object(C.a)(),a=o.cartItems,i=o.cartIsLoading;return Object(r.useEffect)((function(){var e=function(e){var t=e.detail;t&&t.preserveCartData||Object(k.dispatch)(S.CART_STORE_KEY).invalidateResolutionForStore(),c()},t=Object(M.b)("added_to_cart","wc-blocks_added_to_cart"),n=Object(M.b)("removed_from_cart","wc-blocks_removed_from_cart");return document.body.addEventListener("wc-blocks_added_to_cart",e),document.body.addEventListener("wc-blocks_removed_from_cart",e),function(){t(),n(),document.body.removeEventListener("wc-blocks_added_to_cart",e),document.body.removeEventListener("wc-blocks_removed_from_cart",e)}}),[c]),Object(r.createElement)(r.Fragment,null,i||0!==a.length?Object(r.createElement)(P.a,{showSpinner:!0,isLoading:i},Object(r.createElement)(N.a,null,Object(r.createElement)(je,{attributes:n}))):Object(r.createElement)(ve,{content:t}))})),ye=(n(820),j.j?["core/paragraph",{align:"center",content:Object(c.sprintf)(
/* translators: %s is the link to the store product directory. */
Object(c.__)('<a href="%s">Browse store</a>.','woocommerce'),j.j),dropCap:!1}]:null),_e=[["core/image",{align:"center",url:"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzgiIGhlaWdodD0iMzgiIHZpZXdCb3g9IjAgMCAzOCAzOCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTE5IDBDOC41MDQwMyAwIDAgOC41MDQwMyAwIDE5QzAgMjkuNDk2IDguNTA0MDMgMzggMTkgMzhDMjkuNDk2IDM4IDM4IDI5LjQ5NiAzOCAxOUMzOCA4LjUwNDAzIDI5LjQ5NiAwIDE5IDBaTTI1LjEyOSAxMi44NzFDMjYuNDg1MSAxMi44NzEgMjcuNTgwNiAxMy45NjY1IDI3LjU4MDYgMTUuMzIyNkMyNy41ODA2IDE2LjY3ODYgMjYuNDg1MSAxNy43NzQyIDI1LjEyOSAxNy43NzQyQzIzLjc3MyAxNy43NzQyIDIyLjY3NzQgMTYuNjc4NiAyMi42Nzc0IDE1LjMyMjZDMjIuNjc3NCAxMy45NjY1IDIzLjc3MyAxMi44NzEgMjUuMTI5IDEyLjg3MVpNMTEuNjQ1MiAzMS4yNTgxQzkuNjE0OTIgMzEuMjU4MSA3Ljk2Nzc0IDI5LjY0OTIgNy45Njc3NCAyNy42NTczQzcuOTY3NzQgMjYuMTI1IDEwLjE1MTIgMjMuMDI5OCAxMS4xNTQ4IDIxLjY5NjhDMTEuNCAyMS4zNjczIDExLjg5MDMgMjEuMzY3MyAxMi4xMzU1IDIxLjY5NjhDMTMuMTM5MSAyMy4wMjk4IDE1LjMyMjYgMjYuMTI1IDE1LjMyMjYgMjcuNjU3M0MxNS4zMjI2IDI5LjY0OTIgMTMuNjc1NCAzMS4yNTgxIDExLjY0NTIgMzEuMjU4MVpNMTIuODcxIDE3Ljc3NDJDMTEuNTE0OSAxNy43NzQyIDEwLjQxOTQgMTYuNjc4NiAxMC40MTk0IDE1LjMyMjZDMTAuNDE5NCAxMy45NjY1IDExLjUxNDkgMTIuODcxIDEyLjg3MSAxMi44NzFDMTQuMjI3IDEyLjg3MSAxNS4zMjI2IDEzLjk2NjUgMTUuMzIyNiAxNS4zMjI2QzE1LjMyMjYgMTYuNjc4NiAxNC4yMjcgMTcuNzc0MiAxMi44NzEgMTcuNzc0MlpNMjUuOTEwNSAyOS41ODc5QzI0LjE5NDQgMjcuNTM0NyAyMS42NzM4IDI2LjM1NDggMTkgMjYuMzU0OEMxNy4zNzU4IDI2LjM1NDggMTcuMzc1OCAyMy45MDMyIDE5IDIzLjkwMzJDMjIuNDAxNiAyMy45MDMyIDI1LjYxMTcgMjUuNDA0OCAyNy43ODc1IDI4LjAyNUMyOC44NDQ4IDI5LjI4MTUgMjYuOTI5NCAzMC44MjE0IDI1LjkxMDUgMjkuNTg3OVoiIGZpbGw9ImJsYWNrIi8+Cjwvc3ZnPgo=",sizeSlug:"small"}],["core/heading",{textAlign:"center",content:Object(c.__)("Your cart is currently empty!",'woocommerce'),level:2,className:"wc-block-cart__empty-cart__title"}],ye,["core/separator",{className:"is-style-dots"}],["core/heading",{textAlign:"center",content:Object(c.__)("New in store",'woocommerce'),level:2}],["woocommerce/product-new",{columns:3,rows:1}]].filter(Boolean),we=function(e){var t=e.hidden,n=void 0!==t&&t;return Object(r.createElement)("div",{hidden:n},Object(r.createElement)(o.InnerBlocks,{templateInsertUpdatesSelection:!1,template:_e}))},Se=(n(810),function(e){var t=e.attributes,n=e.setAttributes,a=t.isShippingCalculatorEnabled,i=t.checkoutPageId,s=t.hasDarkControls,u=t.showRateAfterTaxName,l=Object(E.b)().currentPostId,b=Object(r.useRef)(i).current;return Object(r.createElement)(o.InspectorControls,null,l!==j.c&&Object(r.createElement)(d.Notice,{className:"wc-block-cart__page-notice",isDismissible:!1,status:"warning"},Object(r.createInterpolateElement)(Object(c.__)("If you would like to use this block as your default cart you must update your <a>page settings in WooCommerce</a>.",'woocommerce'),{a:Object(r.createElement)("a",{href:Object(_.getAdminLink)("admin.php?page=wc-settings&tab=advanced"),target:"_blank",rel:"noopener noreferrer"})})),Object(_.getSetting)("shippingEnabled",!0)&&Object(r.createElement)(d.PanelBody,{title:Object(c.__)("Shipping rates",'woocommerce')},Object(r.createElement)(d.ToggleControl,{label:Object(c.__)("Shipping calculator",'woocommerce'),help:Object(c.__)("Allow customers to estimate shipping by entering their address.",'woocommerce'),checked:a,onChange:function(){return n({isShippingCalculatorEnabled:!a})}})),Object(_.getSetting)("taxesEnabled")&&Object(_.getSetting)("displayItemizedTaxes",!1)&&!Object(_.getSetting)("displayCartPricesIncludingTax",!1)&&Object(r.createElement)(d.PanelBody,{title:Object(c.__)("Taxes",'woocommerce')},Object(r.createElement)(d.ToggleControl,{label:Object(c.__)("Show rate after tax name",'woocommerce'),help:Object(c.__)("Show the percentage rate alongside each tax line in the summary.",'woocommerce'),checked:u,onChange:function(){return n({showRateAfterTaxName:!u})}})),!(l===j.c&&0===b)&&Object(r.createElement)(h.a,{pageId:i,setPageId:function(e){return n({checkoutPageId:e})},labels:{title:Object(c.__)("Proceed to Checkout button",'woocommerce'),default:Object(c.__)("WooCommerce Checkout Page",'woocommerce')}}),Object(r.createElement)(d.PanelBody,{title:Object(c.__)("Style",'woocommerce')},Object(r.createElement)(d.ToggleControl,{label:Object(c.__)("Dark mode inputs",'woocommerce'),help:Object(c.__)("Inputs styled specifically for use on dark background colors.",'woocommerce'),checked:s,onChange:function(){return n({hasDarkControls:!s})}})),Object(r.createElement)(p.a,null))}),ke=(n(809),{isPreview:{type:"boolean",default:!1,save:!1},isShippingCalculatorEnabled:{type:"boolean",default:Object(_.getSetting)("isShippingCalculatorEnabled",!0)},checkoutPageId:{type:"number",default:0},hasDarkControls:{type:"boolean",default:Object(_.getSetting)("hasDarkEditorStyleSupport",!1)},showRateAfterTaxName:{type:"boolean",default:!0}}),Ce={title:Object(c.__)("Cart",'woocommerce'),icon:{src:Object(r.createElement)(a.a,{srcElement:i.a}),foreground:"#96588a"},category:"woocommerce",keywords:[Object(c.__)("WooCommerce",'woocommerce')],description:Object(c.__)("Shopping cart.",'woocommerce'),supports:{align:["wide","full"],html:!1,multiple:!1},example:{attributes:{isPreview:!0}},attributes:ke,edit:function(e){var t=e.className,n=e.attributes,o=e.setAttributes;return Object(r.createElement)("div",{className:u()(t,"wp-block-woocommerce-cart",{"is-editor-preview":n.isPreview})},Object(r.createElement)(O,{label:Object(c.__)("Edit",'woocommerce'),views:[{value:"full",name:Object(c.__)("Full Cart",'woocommerce')},{value:"empty",name:Object(c.__)("Empty Cart",'woocommerce')}],defaultView:"full",render:function(e){return Object(r.createElement)(v.a,{header:Object(c.__)("Cart Block Error",'woocommerce'),text:Object(c.__)("There was an error whilst rendering the cart block. If this problem continues, try re-creating the block.",'woocommerce'),showErrorMessage:!0,errorMessagePrefix:Object(c.__)("Error message:",'woocommerce')},"full"===e&&Object(r.createElement)(r.Fragment,null,Object(r.createElement)(E.a,{previewData:{previewCart:w.a}},Object(r.createElement)(Se,{attributes:n,setAttributes:o}),Object(r.createElement)(d.Disabled,null,Object(r.createElement)(y.a,null,Object(r.createElement)(Ee,{attributes:n})))),Object(r.createElement)(we,{hidden:!0})),"empty"===e&&Object(r.createElement)(we,null))}}),Object(r.createElement)(b.a,{blockName:"cart"}))},save:function(e){var t=e.attributes;return Object(r.createElement)("div",{className:u()("is-loading",t.className)},Object(r.createElement)(o.InnerBlocks.Content,null))}};Object(l.d)("woocommerce/cart",Ce)},90:function(e,t,n){"use strict";var r=n(9),c=n.n(r),o=n(16),a=n.n(o),i=n(0),s=n(182),u=n(6),l=n.n(u),p=n(114),d=(n(208),["className","showSpinner","children"]);t.a=function(e){var t=e.className,n=e.showSpinner,r=void 0!==n&&n,o=e.children,u=a()(e,d),b=l()("wc-block-components-button",t,{"wc-block-components-button--loading":r});return Object(i.createElement)(s.a,c()({className:b},u),r&&Object(i.createElement)(p.a,null),Object(i.createElement)("span",{className:"wc-block-components-button__text"},o))}},91:function(e,t){e.exports=window.wp.autop}});woocommerce-blocks/build/blocks-checkout.asset.php000064400000000466151335517640016364 0ustar00<?php return array('dependencies' => array('lodash', 'react', 'wc-blocks-registry', 'wc-settings', 'wp-compose', 'wp-data', 'wp-deprecated', 'wp-dom', 'wp-element', 'wp-i18n', 'wp-is-shallow-equal', 'wp-keycodes', 'wp-polyfill', 'wp-primitives', 'wp-warning'), 'version' => '59e27b0a737826d43870f2733f3825e6');woocommerce-blocks/build/all-products-frontend.js000064400000263717151335517640016253 0ustar00!function(e){function t(t){for(var r,o,c=t[0],i=t[1],a=0,s=[];a<c.length;a++)o=c[a],Object.prototype.hasOwnProperty.call(n,o)&&n[o]&&s.push(n[o][0]),n[o]=0;for(r in i)Object.prototype.hasOwnProperty.call(i,r)&&(e[r]=i[r]);for(u&&u(t);s.length;)s.shift()()}var r={},n={7:0};function o(t){if(r[t])return r[t].exports;var n=r[t]={i:t,l:!1,exports:{}};return e[t].call(n.exports,n,n.exports,o),n.l=!0,n.exports}o.e=function(e){var t=[],r=n[e];if(0!==r)if(r)t.push(r[2]);else{var c=new Promise((function(t,o){r=n[e]=[t,o]}));t.push(r[2]=c);var i,a=document.createElement("script");a.charset="utf-8",a.timeout=120,o.nc&&a.setAttribute("nonce",o.nc),a.src=function(e){return o.p+""+({0:"vendors--atomic-block-components/add-to-cart--cart-blocks/order-summary--checkout-blocks/billing-ad--c5eb4dcd",1:"vendors--atomic-block-components/price--cart-blocks/line-items--cart-blocks/order-summary--checkout--8a3571de",8:"atomic-block-components/add-to-cart",9:"atomic-block-components/button",10:"atomic-block-components/category-list",11:"atomic-block-components/image",12:"atomic-block-components/price",13:"atomic-block-components/rating",14:"atomic-block-components/sale-badge",15:"atomic-block-components/sku",16:"atomic-block-components/stock-indicator",17:"atomic-block-components/summary",18:"atomic-block-components/tag-list",19:"atomic-block-components/title",50:"vendors--atomic-block-components/add-to-cart"}[e]||e)+"-frontend.js"}(e);var u=new Error;i=function(t){a.onerror=a.onload=null,clearTimeout(s);var r=n[e];if(0!==r){if(r){var o=t&&("load"===t.type?"missing":t.type),c=t&&t.target&&t.target.src;u.message="Loading chunk "+e+" failed.\n("+o+": "+c+")",u.name="ChunkLoadError",u.type=o,u.request=c,r[1](u)}n[e]=void 0}};var s=setTimeout((function(){i({type:"timeout",target:a})}),12e4);a.onerror=a.onload=i,document.head.appendChild(a)}return Promise.all(t)},o.m=e,o.c=r,o.d=function(e,t,r){o.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},o.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.t=function(e,t){if(1&t&&(e=o(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(o.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)o.d(r,n,function(t){return e[t]}.bind(null,n));return r},o.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(t,"a",t),t},o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},o.p="",o.oe=function(e){throw console.error(e),e};var c=window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[],i=c.push.bind(c);c.push=t,c=c.slice();for(var a=0;a<c.length;a++)t(c[a]);var u=i;o(o.s=284)}([function(e,t){e.exports=window.wp.element},function(e,t){e.exports=window.wp.i18n},function(e,t){e.exports=window.wc.wcSettings},function(e,t){e.exports=window.React},function(e,t){e.exports=function(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,r){var n=r(84),o=r(85),c=r(67),i=r(86);e.exports=function(e,t){return n(e)||o(e,t)||c(e,t)||i()},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,r){var n;!function(){"use strict";var r={}.hasOwnProperty;function o(){for(var e=[],t=0;t<arguments.length;t++){var n=arguments[t];if(n){var c=typeof n;if("string"===c||"number"===c)e.push(n);else if(Array.isArray(n)){if(n.length){var i=o.apply(null,n);i&&e.push(i)}}else if("object"===c)if(n.toString===Object.prototype.toString)for(var a in n)r.call(n,a)&&n[a]&&e.push(a);else e.push(n.toString())}}return e.join(" ")}e.exports?(o.default=o,e.exports=o):void 0===(n=function(){return o}.apply(t,[]))||(e.exports=n)}()},function(e,t){e.exports=window.lodash},function(e,t){e.exports=window.wc.wcBlocksData},function(e,t,r){"use strict";function n(e){return(n=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}r.d(t,"a",(function(){return n}))},function(e,t,r){e.exports=r(79)()},function(e,t){e.exports=window.wp.data},function(e,t,r){"use strict";function n(){return(n=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}r.d(t,"a",(function(){return n}))},function(e,t,r){"use strict";function n(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}r.d(t,"a",(function(){return n}))},function(e,t){function r(){return e.exports=r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},e.exports.default=e.exports,e.exports.__esModule=!0,r.apply(this,arguments)}e.exports=r,e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}r.d(t,"a",(function(){return n}))},function(e,t,r){"use strict";function n(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function o(e,t,r){return t&&n(e.prototype,t),r&&n(e,r),e}r.d(t,"a",(function(){return o}))},function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));var n=r(88);function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Object(n.a)(e,t)}},function(e,t,r){"use strict";r.d(t,"a",(function(){return i}));var n=r(21),o=r.n(n),c=r(13);function i(e,t){return!t||"object"!==o()(t)&&"function"!=typeof t?Object(c.a)(e):t}},function(e,t,r){"use strict";function n(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},c=Object.keys(e);for(n=0;n<c.length;n++)r=c[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(e);for(n=0;n<c.length;n++)r=c[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}r.d(t,"a",(function(){return n}))},function(e,t,r){"use strict";function n(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}r.d(t,"a",(function(){return n}))},function(e,t){function r(t){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?(e.exports=r=function(e){return typeof e},e.exports.default=e.exports,e.exports.__esModule=!0):(e.exports=r=function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.default=e.exports,e.exports.__esModule=!0),r(t)}e.exports=r,e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));var n=r(65);function o(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,c=[],_n=!0,i=!1;try{for(r=r.call(e);!(_n=(n=r.next()).done)&&(c.push(n.value),!t||c.length!==t);_n=!0);}catch(e){i=!0,o=e}finally{try{_n||null==r.return||r.return()}finally{if(i)throw o}}return c}}(e,t)||Object(n.a)(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}},function(e,t,r){var n=r(77);e.exports=function(e,t){if(null==e)return{};var r,o,c=n(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(o=0;o<i.length;o++)r=i[o],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(c[r]=e[r])}return c},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=window.wp.compose},function(e,t){e.exports=window.wp.isShallowEqual},,function(e,t){e.exports=window.regeneratorRuntime},function(e,t){e.exports=window.wp.htmlEntities},function(e,t){e.exports=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){function r(t){return e.exports=r=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},e.exports.default=e.exports,e.exports.__esModule=!0,r(t)}e.exports=r,e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,r){"use strict";r.d(t,"a",(function(){return c}));var n=r(59),o=r(65);function c(e){return function(e){if(Array.isArray(e))return Object(n.a)(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||Object(o.a)(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}},function(e,t,r){"use strict";r.d(t,"a",(function(){return j}));var n=r(5),o=r.n(n),c=r(4),i=r.n(c),a=r(7),u=r(0),s=r(8),l=r(11),p=r(28),f=r(92),d=r(93),b=r(36);function m(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function h(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?m(Object(r),!0).forEach((function(t){i()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):m(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var g={first_name:"",last_name:"",company:"",address_1:"",address_2:"",city:"",state:"",postcode:"",country:"",phone:""},O=h(h({},g),{},{email:""}),v={total_items:"",total_items_tax:"",total_fees:"",total_fees_tax:"",total_discount:"",total_discount_tax:"",total_shipping:"",total_shipping_tax:"",total_price:"",total_tax:"",tax_lines:s.EMPTY_TAX_LINES,currency_code:"",currency_symbol:"",currency_minor_unit:2,currency_decimal_separator:"",currency_thousand_separator:"",currency_prefix:"",currency_suffix:""},y=function(e){return Object(f.a)(Object.entries(e).map((function(e){var t=o()(e,2),r=t[0],n=t[1];return[r,Object(p.decodeEntities)(n)]})))},w={cartCoupons:s.EMPTY_CART_COUPONS,cartItems:s.EMPTY_CART_ITEMS,cartFees:s.EMPTY_CART_FEES,cartItemsCount:0,cartItemsWeight:0,cartNeedsPayment:!0,cartNeedsShipping:!0,cartItemErrors:s.EMPTY_CART_ITEM_ERRORS,cartTotals:v,cartIsLoading:!0,cartErrors:s.EMPTY_CART_ERRORS,billingAddress:O,shippingAddress:g,shippingRates:s.EMPTY_SHIPPING_RATES,shippingRatesLoading:!1,cartHasCalculatedShipping:!1,paymentRequirements:s.EMPTY_PAYMENT_REQUIREMENTS,receiveCart:function(){},extensions:s.EMPTY_EXTENSIONS},j=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{shouldSelect:!0},t=Object(b.a)(),r=t.isEditor,n=t.previewData,o=null==n?void 0:n.previewCart,c=e.shouldSelect,i=Object(u.useRef)(),p=Object(l.useSelect)((function(e,t){var n=t.dispatch;if(!c)return w;if(r)return{cartCoupons:o.coupons,cartItems:o.items,cartFees:o.fees,cartItemsCount:o.items_count,cartItemsWeight:o.items_weight,cartNeedsPayment:o.needs_payment,cartNeedsShipping:o.needs_shipping,cartItemErrors:s.EMPTY_CART_ITEM_ERRORS,cartTotals:o.totals,cartIsLoading:!1,cartErrors:s.EMPTY_CART_ERRORS,billingAddress:O,shippingAddress:g,extensions:s.EMPTY_EXTENSIONS,shippingRates:o.shipping_rates,shippingRatesLoading:!1,cartHasCalculatedShipping:o.has_calculated_shipping,paymentRequirements:o.paymentRequirements,receiveCart:"function"==typeof(null==o?void 0:o.receiveCart)?o.receiveCart:function(){}};var i=e(s.CART_STORE_KEY),a=i.getCartData(),u=i.getCartErrors(),l=i.getCartTotals(),p=!i.hasFinishedResolution("getCartData"),f=i.isCustomerDataUpdating(),b=n(s.CART_STORE_KEY).receiveCart,m=y(a.billingAddress),v=a.needsShipping?y(a.shippingAddress):m,j=a.fees.length>0?a.fees.map((function(e){return y(e)})):s.EMPTY_CART_FEES;return{cartCoupons:a.coupons.length>0?a.coupons.map((function(e){return h(h({},e),{},{label:e.code})})):s.EMPTY_CART_COUPONS,cartItems:a.items,cartFees:j,cartItemsCount:a.itemsCount,cartItemsWeight:a.itemsWeight,cartNeedsPayment:a.needsPayment,cartNeedsShipping:a.needsShipping,cartItemErrors:a.errors,cartTotals:l,cartIsLoading:p,cartErrors:u,billingAddress:Object(d.a)(m),shippingAddress:Object(d.a)(v),extensions:a.extensions,shippingRates:a.shippingRates,shippingRatesLoading:f,cartHasCalculatedShipping:a.hasCalculatedShipping,paymentRequirements:a.paymentRequirements,receiveCart:b}}),[c]);return i.current&&Object(a.isEqual)(i.current,p)||(i.current=p),i.current}},function(e,t){e.exports=window.wp.a11y},function(e,t){e.exports=window.wp.primitives},,function(e,t,r){"use strict";r.d(t,"a",(function(){return c}));var n=r(0),o=(r(11),Object(n.createContext)({isEditor:!1,currentPostId:0,previewData:{},getPreviewData:function(){}})),c=function(){return Object(n.useContext)(o)}},function(e,t){e.exports=window.wp.dom},function(e,t){e.exports=window.wc.wcBlocksRegistry},,function(e,t){e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){function r(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}e.exports=function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,r){var n=r(71);e.exports=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&n(e,t)},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,r){var n=r(21).default,o=r(29);e.exports=function(e,t){return!t||"object"!==n(t)&&"function"!=typeof t?o(e):t},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,r){"use strict";var n=r(40),o=r.n(n),c=r(41),i=r.n(c),a=r(29),u=r.n(a),s=r(42),l=r.n(s),p=r(43),f=r.n(p),d=r(30),b=r.n(d),m=r(4),h=r.n(m),g=(r(10),r(3)),O=r(1),v=r(83),y=function(e){var t=e.imageUrl,r=void 0===t?"".concat(v.l,"/block-error.svg"):t,n=e.header,o=void 0===n?Object(O.__)("Oops!",'woocommerce'):n,c=e.text,i=void 0===c?Object(O.__)("There was an error loading the content.",'woocommerce'):c,a=e.errorMessage,u=e.errorMessagePrefix,s=void 0===u?Object(O.__)("Error:",'woocommerce'):u,l=e.button;return React.createElement("div",{className:"wc-block-error wc-block-components-error"},r&&React.createElement("img",{className:"wc-block-error__image wc-block-components-error__image",src:r,alt:""}),React.createElement("div",{className:"wc-block-error__content wc-block-components-error__content"},o&&React.createElement("p",{className:"wc-block-error__header wc-block-components-error__header"},o),i&&React.createElement("p",{className:"wc-block-error__text wc-block-components-error__text"},i),a&&React.createElement("p",{className:"wc-block-error__message wc-block-components-error__message"},s?s+" ":"",a),l&&React.createElement("p",{className:"wc-block-error__button wc-block-components-error__button"},l)))};r(81);var w=function(e){l()(c,e);var t,r,n=(t=c,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,n=b()(t);if(r){var o=b()(this).constructor;e=Reflect.construct(n,arguments,o)}else e=n.apply(this,arguments);return f()(this,e)});function c(){var e;o()(this,c);for(var t=arguments.length,r=new Array(t),i=0;i<t;i++)r[i]=arguments[i];return e=n.call.apply(n,[this].concat(r)),h()(u()(e),"state",{errorMessage:"",hasError:!1}),e}return i()(c,[{key:"render",value:function(){var e=this.props,t=e.header,r=e.imageUrl,n=e.showErrorMessage,o=e.text,c=e.errorMessagePrefix,i=e.renderError,a=e.button,u=this.state,s=u.errorMessage;return u.hasError?"function"==typeof i?i({errorMessage:s}):React.createElement(y,{errorMessage:n?s:null,header:t,imageUrl:r,text:o,errorMessagePrefix:c,button:a}):this.props.children}}],[{key:"getDerivedStateFromError",value:function(e){return void 0!==e.statusText&&void 0!==e.status?{errorMessage:React.createElement(React.Fragment,null,React.createElement("strong",null,e.status),": ",e.statusText),hasError:!0}:{errorMessage:e.message,hasError:!0}}}]),c}(g.Component);w.defaultProps={showErrorMessage:!0},t.a=w},function(e,t){e.exports=window.wp.deprecated},,function(e,t,r){"use strict";(function(e){var n=r(0),o=(r(74),Object(n.createContext)({slots:{},fills:{},registerSlot:function(){void 0!==e&&e.env},updateSlot:function(){},unregisterSlot:function(){},registerFill:function(){},unregisterFill:function(){}}));t.a=o}).call(this,r(102))},,function(e,t,r){"use strict";r.d(t,"a",(function(){return n})),r.d(t,"c",(function(){return o})),r.d(t,"b",(function(){return c})),r.d(t,"d",(function(){return i}));var n=function(e){return"number"==typeof e},o=function(e){return"string"==typeof e},c=function(e){return!function(e){return null===e}(e)&&e instanceof Object&&e.constructor===Object};function i(e,t){return c(e)&&t in e}},function(e,t){e.exports=window.wp.keycodes},function(e,t,r){"use strict";var n=r(4),o=r.n(n),c=r(0),i=r(6),a=r.n(i);function u(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function s(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?u(Object(r),!0).forEach((function(t){o()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):u(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}t.a=function(e){var t,r=e.label,n=e.screenReaderLabel,o=e.wrapperElement,i=e.wrapperProps,u=void 0===i?{}:i,l=null!=r,p=null!=n;return!l&&p?(t=o||"span",u=s(s({},u),{},{className:a()(u.className,"screen-reader-text")}),React.createElement(t,u,n)):(t=o||c.Fragment,l&&p&&r!==n?React.createElement(t,u,React.createElement("span",{"aria-hidden":"true"},r),React.createElement("span",{className:"screen-reader-text"},n)):React.createElement(t,u,r))}},function(e,t,r){"use strict";r.d(t,"a",(function(){return l}));var n=r(4),o=r.n(n),c=r(75),i=r(0),a=r(32);function u(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function s(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?u(Object(r),!0).forEach((function(t){o()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):u(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var l=function(){var e=Object(a.a)(),t=Object(i.useRef)(e);return Object(i.useEffect)((function(){t.current=e}),[e]),{dispatchStoreEvent:Object(i.useCallback)((function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};try{Object(c.doAction)("experimental__woocommerce_blocks-".concat(e),t)}catch(e){console.error(e)}}),[]),dispatchCheckoutEvent:Object(i.useCallback)((function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};try{Object(c.doAction)("experimental__woocommerce_blocks-checkout-".concat(e),s(s({},r),{},{storeCart:t.current}))}catch(e){console.error(e)}}),[])}}},function(e,t,r){"use strict";r.d(t,"a",(function(){return i}));var n=r(0),o=r(25),c=r.n(o);function i(e){var t=Object(n.useRef)(e);return c()(e,t.current)||(t.current=e),t.current}},,,,,function(e,t){e.exports=window.wc.priceFormat},function(e,t,r){"use strict";function n(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}r.d(t,"a",(function(){return n}))},,function(e,t){e.exports=window.wp.apiFetch},,,function(e,t,r){"use strict";r.d(t,"a",(function(){return c}));var n=r(0),o=Object(n.createContext)("page"),c=function(){return Object(n.useContext)(o)};o.Provider},function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));var n=r(59);function o(e,t){if(e){if("string"==typeof e)return Object(n.a)(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Object(n.a)(e,t):void 0}}},,function(e,t,r){var n=r(68);e.exports=function(e,t){if(e){if("string"==typeof e)return n(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?n(e,t):void 0}},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n},e.exports.default=e.exports,e.exports.__esModule=!0},,,function(e,t){function r(t,n){return e.exports=r=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},e.exports.default=e.exports,e.exports.__esModule=!0,r(t,n)}e.exports=r,e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=window.wp.url},,function(e,t){e.exports=window.wp.warning},function(e,t){e.exports=window.wp.hooks},function(e,t,r){"use strict";var n=r(12),o=r(19),c=r(0),i=r(6),a=r.n(i),u=r(7),s=r(45),l=r.n(s),p=r(15),f=r(16),d=r(17),b=r(18),m=r(9),h=r(22),g=r(37),O=r(50),v=r(24),y=r(116),w=r(20);function j(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function E(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?j(Object(r),!0).forEach((function(t){Object(w.a)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):j(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function _(e,t,r,n,o,c,i){var a=t.width,u="rtl"===document.documentElement.dir;"left"===r&&u?r="right":"right"===r&&u&&(r="left"),"left"===n&&u?n="right":"right"===n&&u&&(n="left");var s=Math.round(e.left+e.width/2),l={popoverLeft:s,contentWidth:(s-a/2>0?a/2:s)+(s+a/2>window.innerWidth?window.innerWidth-s:a/2)},p=e.left;"right"===n?p=e.right:"middle"!==c&&(p=s);var f=e.right;"left"===n?f=e.left:"middle"!==c&&(f=s);var d,b={popoverLeft:p,contentWidth:p-a>0?a:p},m={popoverLeft:f,contentWidth:f+a>window.innerWidth?window.innerWidth-f:a},h=r,g=null;if(!o)if("center"===r&&l.contentWidth===a)h="center";else if("left"===r&&b.contentWidth===a)h="left";else if("right"===r&&m.contentWidth===a)h="right";else{var O="left"==(h=b.contentWidth>m.contentWidth?"left":"right")?b.contentWidth:m.contentWidth;g=O!==a?O:null}if(d="center"===h?l.popoverLeft:"left"===h?b.popoverLeft:m.popoverLeft,i){var v=i.getBoundingClientRect();d=Math.min(d,v.right-a)}return{xAxis:h,popoverLeft:d,contentWidth:g}}function x(e,t,r,n,o,c,i){var a=t.height;if(o){var u=(Object(g.getScrollContainer)(c)||document.body).getBoundingClientRect().top+a-i;if(e.top<=u)return{yAxis:r,popoverTop:Math.min(e.bottom,u)}}var s=e.top+e.height/2;"bottom"===n?s=e.bottom:"top"===n&&(s=e.top);var l={popoverTop:s,contentHeight:(s-a/2>0?a/2:s)+(s+a/2>window.innerHeight?window.innerHeight-s:a/2)},p={popoverTop:e.top,contentHeight:e.top-10-a>0?a:e.top-10},f={popoverTop:e.bottom,contentHeight:e.bottom+10+a>window.innerHeight?window.innerHeight-10-e.bottom:a},d=r,b=null;if(!o)if("middle"===r&&l.contentHeight===a)d="middle";else if("top"===r&&p.contentHeight===a)d="top";else if("bottom"===r&&f.contentHeight===a)d="bottom";else{var m="top"==(d=p.contentHeight>f.contentHeight?"top":"bottom")?p.contentHeight:f.contentHeight;b=m!==a?m:null}return{yAxis:d,popoverTop:"middle"===d?l.popoverTop:"top"===d?p.popoverTop:f.popoverTop,contentHeight:b}}var R=r(31),k=r(13);var P=Object(c.createContext)({focusHistory:[]}),S=P.Provider,C=P.Consumer;S.displayName="FocusReturnProvider",C.displayName="FocusReturnConsumer",c.Component;var T=Object(v.createHigherOrderComponent)((function e(t){if((n=t)instanceof c.Component||"function"==typeof n){var r=t;return e({})(r)}var n,o=t.onFocusReturn,i=void 0===o?u.stubTrue:o;return function(e){var t=function(t){Object(d.a)(a,t);var r,n,o=(r=a,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=Object(m.a)(r);if(n){var o=Object(m.a)(this).constructor;e=Reflect.construct(t,arguments,o)}else e=t.apply(this,arguments);return Object(b.a)(this,e)});function a(){var e;return Object(p.a)(this,a),(e=o.apply(this,arguments)).ownFocusedElements=new Set,e.activeElementOnMount=document.activeElement,e.setIsFocusedFalse=function(){return e.isFocused=!1},e.setIsFocusedTrue=function(t){e.ownFocusedElements.add(t.target),e.isFocused=!0},e}return Object(f.a)(a,[{key:"componentWillUnmount",value:function(){var e=this.activeElementOnMount,t=this.isFocused,r=this.ownFocusedElements;if(t&&!1!==i())for(var n,o=[].concat(Object(R.a)(u.without.apply(void 0,[this.props.focus.focusHistory].concat(Object(R.a)(r)))),[e]);n=o.pop();)if(document.body.contains(n))return void n.focus()}},{key:"render",value:function(){return Object(c.createElement)("div",{onFocus:this.setIsFocusedTrue,onBlur:this.setIsFocusedFalse},Object(c.createElement)(e,this.props.childProps))}}]),a}(c.Component);return function(e){return Object(c.createElement)(C,null,(function(r){return Object(c.createElement)(t,{childProps:e,focus:r})}))}}}),"withFocusReturn");var N=Object(v.createHigherOrderComponent)((function(e){return function(t){Object(d.a)(i,t);var r,n,o=(r=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=Object(m.a)(r);if(n){var o=Object(m.a)(this).constructor;e=Reflect.construct(t,arguments,o)}else e=t.apply(this,arguments);return Object(b.a)(this,e)});function i(){var e;return Object(p.a)(this,i),(e=o.apply(this,arguments)).focusContainRef=Object(c.createRef)(),e.handleTabBehaviour=e.handleTabBehaviour.bind(Object(k.a)(e)),e}return Object(f.a)(i,[{key:"handleTabBehaviour",value:function(e){if(e.keyCode===O.TAB){var t=g.focus.tabbable.find(this.focusContainRef.current);if(t.length){var r=t[0],n=t[t.length-1];e.shiftKey&&e.target===r?(e.preventDefault(),n.focus()):(e.shiftKey||e.target!==n)&&t.includes(e.target)||(e.preventDefault(),r.focus())}}}},{key:"render",value:function(){return Object(c.createElement)("div",{onKeyDown:this.handleTabBehaviour,ref:this.focusContainRef,tabIndex:"-1"},Object(c.createElement)(e,this.props))}}]),i}(c.Component)}),"withConstrainedTabbing"),D=r(89);var M=function(e){Object(d.a)(o,e);var t,r,n=(t=o,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,n=Object(m.a)(t);if(r){var o=Object(m.a)(this).constructor;e=Reflect.construct(n,arguments,o)}else e=n.apply(this,arguments);return Object(b.a)(this,e)});function o(){return Object(p.a)(this,o),n.apply(this,arguments)}return Object(f.a)(o,[{key:"handleFocusOutside",value:function(e){this.props.onFocusOutside(e)}},{key:"render",value:function(){return this.props.children}}]),o}(c.Component),A=Object(D.a)(M);function F(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=Object(m.a)(e);if(t){var o=Object(m.a)(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return Object(b.a)(this,r)}}var I=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.htmlDocument,r=void 0===t?document:t,n=e.className,o=void 0===n?"lockscroll":n,i=0,a=0;function u(e){var t=r.scrollingElement||r.body;e&&(a=t.scrollTop);var n=e?"add":"remove";t.classList[n](o),r.documentElement.classList[n](o),e||(t.scrollTop=a)}function s(){0===i&&u(!0),++i}function l(){1===i&&u(!1),--i}return function(e){Object(d.a)(r,e);var t=F(r);function r(){return Object(p.a)(this,r),t.apply(this,arguments)}return Object(f.a)(r,[{key:"componentDidMount",value:function(){s()}},{key:"componentWillUnmount",value:function(){l()}},{key:"render",value:function(){return null}}]),r}(c.Component)}();function B(e){e.stopPropagation()}var L=Object(c.forwardRef)((function(e,t){var r=e.children,i=Object(o.a)(e,["children"]);return Object(c.createElement)("div",Object(n.a)({},i,{ref:t,onMouseDown:B}),r)})),z=r(47);function H(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function U(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?H(Object(r),!0).forEach((function(t){Object(w.a)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):H(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function W(e){var t=Object(c.useContext)(z.a),r=t.slots[e]||{},n=t.fills[e],o=Object(c.useMemo)((function(){return n||[]}),[n]),i=Object(c.useCallback)((function(r){t.updateSlot(e,r)}),[e,t.updateSlot]),a=Object(c.useCallback)((function(r){t.unregisterSlot(e,r)}),[e,t.unregisterSlot]),u=Object(c.useCallback)((function(r){t.registerFill(e,r)}),[e,t.registerFill]),s=Object(c.useCallback)((function(r){t.unregisterFill(e,r)}),[e,t.unregisterFill]);return U(U({},r),{},{updateSlot:i,unregisterSlot:a,fills:o,registerFill:u,unregisterFill:s})}function Y(e,t,r){return(Y="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,r){var n=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=Object(m.a)(e)););return e}(e,t);if(n){var o=Object.getOwnPropertyDescriptor(n,t);return o.get?o.get.call(r):o.value}})(e,t,r||e)}r(25);var q=Object(c.createContext)({registerSlot:function(){},unregisterSlot:function(){},registerFill:function(){},unregisterFill:function(){},getSlot:function(){},getFills:function(){},subscribe:function(){}}),V=(q.Provider,q.Consumer);c.Component;var G=function(e){Object(d.a)(o,e);var t,r,n=(t=o,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,n=Object(m.a)(t);if(r){var o=Object(m.a)(this).constructor;e=Reflect.construct(n,arguments,o)}else e=n.apply(this,arguments);return Object(b.a)(this,e)});function o(){var e;return Object(p.a)(this,o),(e=n.apply(this,arguments)).isUnmounted=!1,e.bindNode=e.bindNode.bind(Object(k.a)(e)),e}return Object(f.a)(o,[{key:"componentDidMount",value:function(){(0,this.props.registerSlot)(this.props.name,this)}},{key:"componentWillUnmount",value:function(){var e=this.props.unregisterSlot;this.isUnmounted=!0,e(this.props.name,this)}},{key:"componentDidUpdate",value:function(e){var t=this.props,r=t.name,n=t.unregisterSlot,o=t.registerSlot;e.name!==r&&(n(e.name),o(r,this))}},{key:"bindNode",value:function(e){this.node=e}},{key:"forceUpdate",value:function(){this.isUnmounted||Y(Object(m.a)(o.prototype),"forceUpdate",this).call(this)}},{key:"render",value:function(){var e=this.props,t=e.children,r=e.name,n=e.fillProps,o=void 0===n?{}:n,i=e.getFills,a=Object(u.map)(i(r,this),(function(e){var t=e.occurrence,r=Object(u.isFunction)(e.children)?e.children(o):e.children;return c.Children.map(r,(function(e,r){if(!e||Object(u.isString)(e))return e;var n="".concat(t,"---").concat(e.key||r);return Object(c.cloneElement)(e,{key:n})}))})).filter(Object(u.negate)(c.isEmptyElement));return Object(c.createElement)(c.Fragment,null,Object(u.isFunction)(t)?t(a):a)}}]),o}(c.Component),K=function(e){return Object(c.createElement)(V,null,(function(t){var r=t.registerSlot,o=t.unregisterSlot,i=t.getFills;return Object(c.createElement)(G,Object(n.a)({},e,{registerSlot:r,unregisterSlot:o,getFills:i}))}))},Q=0;function J(e){var t=e.name,r=e.children,n=e.registerFill,o=e.unregisterFill,i=function(e){var t=Object(c.useContext)(q),r=t.getSlot,n=t.subscribe,o=Object(c.useState)(r(e)),i=Object(h.a)(o,2),a=i[0],u=i[1];return Object(c.useEffect)((function(){return u(r(e)),n((function(){u(r(e))}))}),[e]),a}(t),a=Object(c.useRef)({name:t,children:r});return a.current.occurrence||(a.current.occurrence=++Q),Object(c.useLayoutEffect)((function(){return n(t,a.current),function(){return o(t,a.current)}}),[]),Object(c.useLayoutEffect)((function(){a.current.children=r,i&&i.forceUpdate()}),[r]),Object(c.useLayoutEffect)((function(){t!==a.current.name&&(o(a.current.name,a.current),a.current.name=t,n(t,a.current))}),[t]),i&&i.node?(Object(u.isFunction)(r)&&(r=r(i.props.fillProps)),Object(c.createPortal)(r,i.node)):null}var X=function(e){return Object(c.createElement)(V,null,(function(t){var r=t.registerFill,o=t.unregisterFill;return Object(c.createElement)(J,Object(n.a)({},e,{registerFill:r,unregisterFill:o}))}))};function $(e){var t=e.name,r=e.fillProps,i=void 0===r?{}:r,a=e.as,u=void 0===a?"div":a,s=Object(o.a)(e,["name","fillProps","as"]),l=Object(c.useContext)(z.a),p=Object(c.useRef)();return Object(c.useLayoutEffect)((function(){return l.registerSlot(t,p,i),function(){l.unregisterSlot(t,p)}}),[l.registerSlot,l.unregisterSlot,t]),Object(c.useLayoutEffect)((function(){l.updateSlot(t,i)})),Object(c.createElement)(u,Object(n.a)({ref:p},s))}function Z(e){var t,r,n=e.name,o=e.children,i=W(n),a=Object(c.useRef)({rerender:(t=Object(c.useState)({}),r=Object(h.a)(t,2)[1],function(){return r({})})});return Object(c.useEffect)((function(){return i.registerFill(a),function(){i.unregisterFill(a)}}),[i.registerFill,i.unregisterFill]),i.ref&&i.ref.current?("function"==typeof o&&(o=o(i.fillProps)),Object(c.createPortal)(o,i.ref.current)):null}function ee(e){var t=e.bubblesVirtually,r=Object(o.a)(e,["bubblesVirtually"]);return t?Object(c.createElement)($,r):Object(c.createElement)(K,r)}function te(e){return Object(c.createElement)(c.Fragment,null,Object(c.createElement)(X,e),Object(c.createElement)(Z,e))}function re(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function ne(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?re(Object(r),!0).forEach((function(t){Object(w.a)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):re(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function oe(e){var t=e.type,r=e.origin,n=void 0===r?function(e){return"appear"===e?"top":"left"}(t):r;if("appear"===t){var o,c=n.split(" "),i=Object(h.a)(c,2),u=i[0],s=i[1],l=void 0===s?"center":s;return a()("components-animate__appear",(o={},Object(w.a)(o,"is-from-"+l,"center"!==l),Object(w.a)(o,"is-from-"+u,"middle"!==u),o))}return"slide-in"===t?a()("components-animate__slide-in","is-from-"+n):"loading"===t?a()("components-animate__loading"):void 0}function ce(e){var t=e.type,r=e.options,n=void 0===r?{}:r;return(0,e.children)({className:oe(ne({type:t},n))})}var ie=N(T((function(e){return e.children})));function ae(e,t){var r,n=(r=t).ownerDocument.defaultView.getComputedStyle(r),o=n.paddingTop,c=n.paddingBottom,i=n.paddingLeft,a=n.paddingRight,u=o?parseInt(o,10):0,s=c?parseInt(c,10):0,l=i?parseInt(i,10):0,p=a?parseInt(a,10):0;return{x:e.left+l,y:e.top+u,width:e.width-l-p,height:e.height-u-s,left:e.left+l,right:e.right-p,top:e.top+u,bottom:e.bottom-s}}function ue(e,t,r){r?e.getAttribute(t)!==r&&e.setAttribute(t,r):e.hasAttribute(t)&&e.removeAttribute(t)}function se(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";e.style[t]!==r&&(e.style[t]=r)}function le(e,t,r){r?e.classList.contains(t)||e.classList.add(t):e.classList.contains(t)&&e.classList.remove(t)}var pe=function(e){var t=e.headerTitle,r=e.onClose,i=e.onKeyDown,u=e.children,s=e.className,p=e.noArrow,f=void 0===p||p,d=e.isAlternate,b=e.position,m=void 0===b?"bottom right":b,w=(e.range,e.focusOnMount),j=void 0===w?"firstElement":w,R=e.anchorRef,k=e.shouldAnchorIncludePadding,P=e.anchorRect,S=e.getAnchorRect,C=e.expandOnMobile,T=e.animate,N=void 0===T||T,D=e.onClickOutside,M=e.onFocusOutside,F=e.__unstableSticky,B=e.__unstableSlotName,z=void 0===B?"Popover":B,H=e.__unstableObserveElement,U=e.__unstableBoundaryParent,Y=Object(o.a)(e,["headerTitle","onClose","onKeyDown","children","className","noArrow","isAlternate","position","range","focusOnMount","anchorRef","shouldAnchorIncludePadding","anchorRect","getAnchorRect","expandOnMobile","animate","onClickOutside","onFocusOutside","__unstableSticky","__unstableSlotName","__unstableObserveElement","__unstableBoundaryParent"]),q=Object(c.useRef)(null),V=Object(c.useRef)(null),G=Object(c.useRef)(),K=Object(v.useViewportMatch)("medium","<"),Q=Object(c.useState)(),J=Object(h.a)(Q,2),X=J[0],$=J[1],Z=W(z),ee=C&&K,re=Object(v.useResizeObserver)(),ne=Object(h.a)(re,2),oe=ne[0],pe=ne[1];f=ee||f,Object(c.useLayoutEffect)((function(){if(ee)return le(G.current,"is-without-arrow",f),le(G.current,"is-alternate",d),ue(G.current,"data-x-axis"),ue(G.current,"data-y-axis"),se(G.current,"top"),se(G.current,"left"),se(V.current,"maxHeight"),void se(V.current,"maxWidth");var e=function(){if(G.current&&V.current){var e=function(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]&&arguments[3],o=arguments.length>4?arguments[4]:void 0;if(t)return t;if(r){if(!e.current)return;return r(e.current)}if(!1!==n){if(!(n&&window.Range&&window.Element&&window.DOMRect))return;if(n instanceof window.Range)return Object(g.getRectangleFromRange)(n);if(n instanceof window.Element){var c=n.getBoundingClientRect();return o?c:ae(c,n)}var i=n.top,a=n.bottom,u=i.getBoundingClientRect(),s=a.getBoundingClientRect(),l=new window.DOMRect(u.left,u.top,u.width,s.bottom-u.top);return o?l:ae(l,n)}if(e.current){var p=e.current.parentNode,f=p.getBoundingClientRect();return o?f:ae(f,p)}}(q,P,S,R,k);if(e){var t,r,n=G.current,o=n.offsetParent,c=n.ownerDocument,i=0;if(o&&o!==c.body){var a=o.getBoundingClientRect();i=a.top,e=new window.DOMRect(e.left-a.left,e.top-a.top,e.width,e.height)}U&&(t=null===(r=G.current.closest(".popover-slot"))||void 0===r?void 0:r.parentNode);var u=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"top",n=arguments.length>3?arguments[3]:void 0,o=arguments.length>4?arguments[4]:void 0,c=arguments.length>5?arguments[5]:void 0,i=arguments.length>6?arguments[6]:void 0,a=r.split(" "),u=Object(h.a)(a,3),s=u[0],l=u[1],p=void 0===l?"center":l,f=u[2],d=x(e,t,s,f,n,o,c),b=_(e,t,p,f,n,d.yAxis,i);return E(E({},b),d)}(e,pe.height?pe:V.current.getBoundingClientRect(),m,F,G.current,i,t),s=u.popoverTop,l=u.popoverLeft,p=u.xAxis,b=u.yAxis,O=u.contentHeight,v=u.contentWidth;"number"==typeof s&&"number"==typeof l&&(se(G.current,"top",s+"px"),se(G.current,"left",l+"px")),le(G.current,"is-without-arrow",f||"center"===p&&"middle"===b),le(G.current,"is-alternate",d),ue(G.current,"data-x-axis",p),ue(G.current,"data-y-axis",b),se(V.current,"maxHeight","number"==typeof O?O+"px":""),se(V.current,"maxWidth","number"==typeof v?v+"px":""),$(({left:"right",right:"left"}[p]||"center")+" "+({top:"bottom",bottom:"top"}[b]||"middle"))}}};e();var t,r,n=window.setInterval(e,500),o=function(){window.cancelAnimationFrame(t),t=window.requestAnimationFrame(e)};return window.addEventListener("click",o),window.addEventListener("resize",e),window.addEventListener("scroll",e,!0),H&&(r=new window.MutationObserver(e)).observe(H,{attributes:!0}),function(){window.clearInterval(n),window.removeEventListener("resize",e),window.removeEventListener("scroll",e,!0),window.removeEventListener("click",o),window.cancelAnimationFrame(t),r&&r.disconnect()}}),[ee,P,S,R,k,m,pe,F,H,U]),function(e,t){Object(c.useEffect)((function(){var r=setTimeout((function(){if(e&&t.current)if("firstElement"!==e)"container"===e&&t.current.focus();else{var r=g.focus.tabbable.find(t.current)[0];r?r.focus():t.current.focus()}}),0);return function(){return clearTimeout(r)}}),[])}(j,V);var fe=function(e){e.keyCode===O.ESCAPE&&r&&(e.stopPropagation(),r()),i&&i(e)},de=Object(c.createElement)(A,{onFocusOutside:function(e){if(M)M(e);else if(D){var t;try{t=new window.MouseEvent("click")}catch(e){(t=document.createEvent("MouseEvent")).initMouseEvent("click",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null)}Object.defineProperty(t,"target",{get:function(){return e.relatedTarget}}),l()("Popover onClickOutside prop",{alternative:"onFocusOutside"}),D(t)}else r&&r()}},Object(c.createElement)(ce,{type:N&&X?"appear":null,options:{origin:X}},(function(e){var o=e.className;return Object(c.createElement)(L,Object(n.a)({className:a()("components-popover",s,o,{"is-expanded":ee,"is-without-arrow":f,"is-alternate":d})},Y,{onKeyDown:fe,ref:G}),ee&&Object(c.createElement)(I,null),ee&&Object(c.createElement)("div",{className:"components-popover__header"},Object(c.createElement)("span",{className:"components-popover__header-title"},t),Object(c.createElement)(Oe,{className:"components-popover__close",icon:y.a,onClick:r})),Object(c.createElement)("div",{ref:V,className:"components-popover__content",tabIndex:"-1"},Object(c.createElement)("div",{style:{position:"relative"}},oe,u)))})));return j&&(de=Object(c.createElement)(ie,null,de)),Z.ref&&(de=Object(c.createElement)(te,{name:z},de)),R||P?de:Object(c.createElement)("span",{ref:q},de)};pe.Slot=function(e){var t=e.name,r=void 0===t?"Popover":t;return Object(c.createElement)(ee,{bubblesVirtually:!0,name:r,className:"popover-slot"})};var fe=pe,de=function(e){var t,r,n=e.shortcut,o=e.className;return n?(Object(u.isString)(n)&&(t=n),Object(u.isObject)(n)&&(t=n.display,r=n.ariaLabel),Object(c.createElement)("span",{className:o,"aria-label":r},t)):null};var be=function(e){Object(d.a)(o,e);var t,r,n=(t=o,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,n=Object(m.a)(t);if(r){var o=Object(m.a)(this).constructor;e=Reflect.construct(n,arguments,o)}else e=n.apply(this,arguments);return Object(b.a)(this,e)});function o(){var e;return Object(p.a)(this,o),(e=n.apply(this,arguments)).delayedSetIsOver=Object(u.debounce)((function(t){return e.setState({isOver:t})}),700),e.cancelIsMouseDown=e.createSetIsMouseDown(!1),e.isInMouseDown=!1,e.state={isOver:!1},e}return Object(f.a)(o,[{key:"componentWillUnmount",value:function(){this.delayedSetIsOver.cancel(),document.removeEventListener("mouseup",this.cancelIsMouseDown)}},{key:"emitToChild",value:function(e,t){var r=this.props.children;if(1===c.Children.count(r)){var n=c.Children.only(r);"function"==typeof n.props[e]&&n.props[e](t)}}},{key:"createToggleIsOver",value:function(e,t){var r=this;return function(n){if(r.emitToChild(e,n),!(n.currentTarget.disabled||"focus"===n.type&&r.isInMouseDown)){r.delayedSetIsOver.cancel();var o=Object(u.includes)(["focus","mouseenter"],n.type);o!==r.state.isOver&&(t?r.delayedSetIsOver(o):r.setState({isOver:o}))}}}},{key:"createSetIsMouseDown",value:function(e){var t=this;return function(r){t.emitToChild(e?"onMouseDown":"onMouseUp",r),document[e?"addEventListener":"removeEventListener"]("mouseup",t.cancelIsMouseDown),t.isInMouseDown=e}}},{key:"render",value:function(){var e=this.props,t=e.children,r=e.position,n=e.text,o=e.shortcut;if(1!==c.Children.count(t))return t;var i=c.Children.only(t),a=this.state.isOver;return Object(c.cloneElement)(i,{onMouseEnter:this.createToggleIsOver("onMouseEnter",!0),onMouseLeave:this.createToggleIsOver("onMouseLeave"),onClick:this.createToggleIsOver("onClick"),onFocus:this.createToggleIsOver("onFocus"),onBlur:this.createToggleIsOver("onBlur"),onMouseDown:this.createSetIsMouseDown(!0),children:Object(c.concatChildren)(i.props.children,a&&Object(c.createElement)(fe,{focusOnMount:!1,position:r,className:"components-tooltip","aria-hidden":"true",animate:!1,noArrow:!0},n,Object(c.createElement)(de,{className:"components-tooltip__shortcut",shortcut:o})))})}}]),o}(c.Component),me=r(91);function he(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var ge=["onMouseDown","onClick"],Oe=t.a=Object(c.forwardRef)((function(e,t){var r=e.href,i=e.target,s=e.isPrimary,p=e.isSmall,f=e.isTertiary,d=e.isPressed,b=e.isBusy,m=e.isDefault,h=e.isSecondary,g=e.isLink,O=e.isDestructive,v=e.className,y=e.disabled,w=e.icon,j=e.iconSize,E=e.showTooltip,_=e.tooltipPosition,x=e.shortcut,R=e.label,k=e.children,P=e.__experimentalIsFocusable,S=Object(o.a)(e,["href","target","isPrimary","isSmall","isTertiary","isPressed","isBusy","isDefault","isSecondary","isLink","isDestructive","className","disabled","icon","iconSize","showTooltip","tooltipPosition","shortcut","label","children","__experimentalIsFocusable"]);m&&l()("Button isDefault prop",{alternative:"isSecondary"});var C=a()("components-button",v,{"is-secondary":m||h,"is-primary":s,"is-small":p,"is-tertiary":f,"is-pressed":d,"is-busy":b,"is-link":g,"is-destructive":O,"has-text":!!w&&!!k,"has-icon":!!w}),T=y&&!P,N=void 0===r||T?"button":"a",D="a"===N?{href:r,target:i}:{type:"button",disabled:T,"aria-pressed":d};if(y&&P){D["aria-disabled"]=!0;var M,A=function(e,t){var r;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return he(e,void 0);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?he(e,void 0):void 0}}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var c,i=!0,a=!1;return{s:function(){r=e[Symbol.iterator]()},n:function(){var e=r.next();return i=e.done,e},e:function(e){a=!0,c=e},f:function(){try{i||null==r.return||r.return()}finally{if(a)throw c}}}}(ge);try{for(A.s();!(M=A.n()).done;)S[M.value]=function(e){e.stopPropagation(),e.preventDefault()}}catch(e){A.e(e)}finally{A.f()}}var F=!T&&(E&&R||x||!!R&&(!k||Object(u.isArray)(k)&&!k.length)&&!1!==E),I=Object(c.createElement)(N,Object(n.a)({},D,S,{className:C,"aria-label":S["aria-label"]||R,ref:t}),w&&Object(c.createElement)(me.a,{icon:w,size:j}),k);return F?Object(c.createElement)(be,{text:R,shortcut:x,position:_},I):I}))},function(e,t){e.exports=function(e,t){if(null==e)return{};var r,n,o={},c=Object.keys(e);for(n=0;n<c.length;n++)r=c[n],t.indexOf(r)>=0||(o[r]=e[r]);return o},e.exports.default=e.exports,e.exports.__esModule=!0},,function(e,t,r){"use strict";var n=r(80);function o(){}function c(){}c.resetWarningCache=o,e.exports=function(){function e(e,t,r,o,c,i){if(i!==n){var a=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw a.name="Invariant Violation",a}}function t(){return e}e.isRequired=e;var r={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:c,resetWarningCache:o};return r.PropTypes=r,r}},function(e,t,r){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},function(e,t){},,function(e,t,r){"use strict";r.d(t,"n",(function(){return c})),r.d(t,"l",(function(){return i})),r.d(t,"k",(function(){return a})),r.d(t,"m",(function(){return u})),r.d(t,"i",(function(){return s})),r.d(t,"d",(function(){return l})),r.d(t,"f",(function(){return p})),r.d(t,"j",(function(){return f})),r.d(t,"c",(function(){return d})),r.d(t,"e",(function(){return b})),r.d(t,"g",(function(){return m})),r.d(t,"a",(function(){return h})),r.d(t,"h",(function(){return g})),r.d(t,"b",(function(){return O}));var n,o=r(2),c=Object(o.getSetting)("wcBlocksConfig",{buildPhase:1,pluginUrl:"",productCount:0,defaultAvatar:"",restApiRoutes:{},wordCountType:"words"}),i=c.pluginUrl+"images/",a=c.pluginUrl+"build/",u=c.buildPhase,s=null===(n=o.STORE_PAGES.shop)||void 0===n?void 0:n.permalink,l=(o.STORE_PAGES.checkout.id,o.STORE_PAGES.checkout.permalink),p=o.STORE_PAGES.privacy.permalink,f=(o.STORE_PAGES.privacy.title,o.STORE_PAGES.terms.permalink),d=(o.STORE_PAGES.terms.title,o.STORE_PAGES.cart.id,o.STORE_PAGES.cart.permalink),b=o.STORE_PAGES.myaccount.permalink?o.STORE_PAGES.myaccount.permalink:Object(o.getSetting)("wpLoginUrl","/wp-login.php"),m=Object(o.getSetting)("shippingCountries",{}),h=Object(o.getSetting)("allowedCountries",{}),g=Object(o.getSetting)("shippingStates",{}),O=Object(o.getSetting)("allowedStates",{})},function(e,t){e.exports=function(e){if(Array.isArray(e))return e},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,c=[],_n=!0,i=!1;try{for(r=r.call(e);!(_n=(n=r.next()).done)&&(c.push(n.value),!t||c.length!==t);_n=!0);}catch(e){i=!0,o=e}finally{try{_n||null==r.return||r.return()}finally{if(i)throw o}}return c}},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,r){"use strict";var n=r(4),o=r.n(n),c=r(5),i=r.n(c),a=r(2),u=r(1),s=r(49);function l(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function p(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?l(Object(r),!0).forEach((function(t){o()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):l(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var f=Object(a.getSetting)("countryLocale",{}),d=function(e){var t={};return void 0!==e.label&&(t.label=e.label),void 0!==e.required&&(t.required=e.required),void 0!==e.hidden&&(t.hidden=e.hidden),void 0===e.label||e.optionalLabel||(t.optionalLabel=Object(u.sprintf)(
/* translators: %s Field label. */
Object(u.__)("%s (optional)",'woocommerce'),e.label)),e.priority&&(Object(s.a)(e.priority)&&(t.index=e.priority),Object(s.c)(e.priority)&&(t.index=parseInt(e.priority,10))),e.hidden&&(t.required=!1),t},b=Object.entries(f).map((function(e){var t=i()(e,2),r=t[0],n=t[1];return[r,Object.entries(n).map((function(e){var t=i()(e,2),r=t[0],n=t[1];return[r,d(n)]})).reduce((function(e,t){var r=i()(t,2),n=r[0],o=r[1];return e[n]=o,e}),{})]})).reduce((function(e,t){var r=i()(t,2),n=r[0],o=r[1];return e[n]=o,e}),{});t.a=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",n=r&&void 0!==b[r]?b[r]:{};return e.map((function(e){var r=a.defaultAddressFields[e]||{},o=n[e]||{},c=t[e]||{};return p(p(p({key:e},r),o),c)})).sort((function(e,t){return e.index-t.index}))}},function(e,t,r){"use strict";function n(e,t){return(n=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}r.d(t,"a",(function(){return n}))},function(e,t,r){"use strict";var n=r(12),o=r(15),c=r(16),i=r(13),a=r(17),u=r(18),s=r(9),l=r(0),p=r(7),f=r(24);var d=["button","submit"];t.a=Object(f.createHigherOrderComponent)((function(e){return function(t){Object(a.a)(m,t);var r,f,b=(r=m,f=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=Object(s.a)(r);if(f){var n=Object(s.a)(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return Object(u.a)(this,e)});function m(){var e;return Object(o.a)(this,m),(e=b.apply(this,arguments)).bindNode=e.bindNode.bind(Object(i.a)(e)),e.cancelBlurCheck=e.cancelBlurCheck.bind(Object(i.a)(e)),e.queueBlurCheck=e.queueBlurCheck.bind(Object(i.a)(e)),e.normalizeButtonFocus=e.normalizeButtonFocus.bind(Object(i.a)(e)),e}return Object(c.a)(m,[{key:"componentWillUnmount",value:function(){this.cancelBlurCheck()}},{key:"bindNode",value:function(e){e?this.node=e:(delete this.node,this.cancelBlurCheck())}},{key:"queueBlurCheck",value:function(e){var t=this;e.persist(),this.preventBlurCheck||(this.blurCheckTimeout=setTimeout((function(){document.hasFocus()?"function"==typeof t.node.handleFocusOutside&&t.node.handleFocusOutside(e):e.preventDefault()}),0))}},{key:"cancelBlurCheck",value:function(){clearTimeout(this.blurCheckTimeout)}},{key:"normalizeButtonFocus",value:function(e){var t=e.type,r=e.target;Object(p.includes)(["mouseup","touchend"],t)?this.preventBlurCheck=!1:function(e){switch(e.nodeName){case"A":case"BUTTON":return!0;case"INPUT":return Object(p.includes)(d,e.type)}return!1}(r)&&(this.preventBlurCheck=!0)}},{key:"render",value:function(){return Object(l.createElement)("div",{onFocus:this.cancelBlurCheck,onMouseDown:this.normalizeButtonFocus,onMouseUp:this.normalizeButtonFocus,onTouchStart:this.normalizeButtonFocus,onTouchEnd:this.normalizeButtonFocus,onBlur:this.queueBlurCheck},Object(l.createElement)(e,Object(n.a)({ref:this.bindNode},this.props)))}}]),m}(l.Component)}),"withFocusOutside")},function(e,t,r){"use strict";r.d(t,"a",(function(){return d})),r.d(t,"b",(function(){return b})),r.d(t,"c",(function(){return m}));var n=r(5),o=r.n(n),c=r(8),i=r(11),a=r(0),u=r(25),s=r.n(u),l=r(53),p=r(99),f=r(64),d=function(e){var t=Object(f.a)();e=e||t;var r=Object(i.useSelect)((function(t){return t(c.QUERY_STATE_STORE_KEY).getValueForQueryContext(e,void 0)}),[e]),n=Object(i.useDispatch)(c.QUERY_STATE_STORE_KEY).setValueForQueryContext;return[r,Object(a.useCallback)((function(t){n(e,t)}),[e,n])]},b=function(e,t,r){var n=Object(f.a)();r=r||n;var o=Object(i.useSelect)((function(n){return n(c.QUERY_STATE_STORE_KEY).getValueForQueryKey(r,e,t)}),[r,e]),u=Object(i.useDispatch)(c.QUERY_STATE_STORE_KEY).setQueryValue;return[o,Object(a.useCallback)((function(t){u(r,e,t)}),[r,e,u])]},m=function(e,t){var r=Object(f.a)(),n=d(t=t||r),c=o()(n,2),i=c[0],u=c[1],b=Object(l.a)(i),m=Object(l.a)(e),h=Object(p.a)(m),g=Object(a.useRef)(!1);return Object(a.useEffect)((function(){s()(h,m)||(u(Object.assign({},b,m)),g.current=!0)}),[b,m,h,u]),g.current?[i,u]:[e,u]}},function(e,t,r){"use strict";var n=r(20),o=r(12),c=r(19),i=r(0),a=r(34),u=function(e){var t=e.icon,r=e.className,n=Object(c.a)(e,["icon","className"]),a=["dashicon","dashicons","dashicons-"+t,r].filter(Boolean).join(" ");return Object(i.createElement)("span",Object(o.a)({className:a},n))};function s(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function l(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?s(Object(r),!0).forEach((function(t){Object(n.a)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):s(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}t.a=function(e){var t=e.icon,r=void 0===t?null:t,n=e.size,s=Object(c.a)(e,["icon","size"]);if("string"==typeof r)return Object(i.createElement)(u,Object(o.a)({icon:r},s));if(r&&u===r.type)return Object(i.cloneElement)(r,l({},s));var p=n||24;if("function"==typeof r)return r.prototype instanceof i.Component?Object(i.createElement)(r,l({size:p},s)):r(l({size:p},s));if(r&&("svg"===r.type||r.type===a.SVG)){var f=l(l({width:p,height:p},r.props),s);return Object(i.createElement)(a.SVG,f)}return Object(i.isValidElement)(r)?Object(i.cloneElement)(r,l({size:p},s)):r}},function(e,t,r){"use strict";r.d(t,"a",(function(){return c}));var n=r(5),o=r.n(n),c=function(e){return e.reduce((function(e,t){var r=o()(t,2),n=r[0],c=r[1];return e[n]=c,e}),{})}},function(e,t,r){"use strict";r.d(t,"b",(function(){return i})),r.d(t,"c",(function(){return a})),r.d(t,"a",(function(){return u}));var n=r(2),o=r(87),c=r(72),i=function(e){var t=e.country,r=void 0===t?"":t,n=e.state,o=void 0===n?"":n,c=e.city,i=void 0===c?"":c,a=e.postcode,u=void 0===a?"":a;return{country:r.trim(),state:o.trim(),city:i.trim(),postcode:u?u.replace(" ","").toUpperCase():""}},a=function(e){var t=e.email,r=void 0===t?"":t;return Object(c.isEmail)(r)?r.trim():""},u=function(e){var t=Object.keys(n.defaultAddressFields),r=Object(o.a)(t,{},e.country),c=Object.assign({},e);return r.forEach((function(t){var r=t.key,n=void 0===r?"":r,o=t.hidden;void 0!==o&&o&&function(e,t){return e in t}(n,e)&&(c[n]="")})),c}},,,,function(e,t){e.exports=window.wp.autop},,function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));var n=r(3);function o(e,t){var r=Object(n.useRef)();return Object(n.useEffect)((function(){r.current===e||t&&!t(e,r.current)||(r.current=e)}),[e,t]),r.current}},function(e,t,r){"use strict";r.d(t,"a",(function(){return i}));var n=r(5),o=r.n(n),c=r(0),i=function(){var e=Object(c.useState)(),t=o()(e,2)[1];return Object(c.useCallback)((function(e){t((function(){throw e}))}),[])}},function(e,t){e.exports=window.wc.wcBlocksSharedContext},function(e,t){var r,n,o=e.exports={};function c(){throw new Error("setTimeout has not been defined")}function i(){throw new Error("clearTimeout has not been defined")}function a(e){if(r===setTimeout)return setTimeout(e,0);if((r===c||!r)&&setTimeout)return r=setTimeout,setTimeout(e,0);try{return r(e,0)}catch(t){try{return r.call(null,e,0)}catch(t){return r.call(this,e,0)}}}!function(){try{r="function"==typeof setTimeout?setTimeout:c}catch(e){r=c}try{n="function"==typeof clearTimeout?clearTimeout:i}catch(e){n=i}}();var u,s=[],l=!1,p=-1;function f(){l&&u&&(l=!1,u.length?s=u.concat(s):p=-1,s.length&&d())}function d(){if(!l){var e=a(f);l=!0;for(var t=s.length;t;){for(u=s,s=[];++p<t;)u&&u[p].run();p=-1,t=s.length}u=null,l=!1,function(e){if(n===clearTimeout)return clearTimeout(e);if((n===i||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(e);try{n(e)}catch(t){try{return n.call(null,e)}catch(t){return n.call(this,e)}}}(e)}}function b(e,t){this.fun=e,this.array=t}function m(){}o.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];s.push(new b(e,t)),1!==s.length||l||a(d)},b.prototype.run=function(){this.fun.apply(null,this.array)},o.title="browser",o.browser=!0,o.env={},o.argv=[],o.version="",o.versions={},o.on=m,o.addListener=m,o.once=m,o.off=m,o.removeListener=m,o.removeAllListeners=m,o.emit=m,o.prependListener=m,o.prependOnceListener=m,o.listeners=function(e){return[]},o.binding=function(e){throw new Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(e){throw new Error("process.chdir is not supported")},o.umask=function(){return 0}},function(e,t,r){"use strict";r.d(t,"b",(function(){return w})),r.d(t,"a",(function(){return j}));var n=r(4),o=r.n(n),c=r(5),i=r.n(c),a=(r(10),r(0)),u=r(11),s=r(52),l=r(36),p=r(14),f=r.n(p),d=r(6),b=r.n(d),m=r(153),h=(r(112),function(e){var t=e.status;switch(void 0===t?"default":t){case"error":return"woocommerce-error";case"success":return"woocommerce-message";case"info":case"warning":return"woocommerce-info"}return""}),g=function(e){var t=e.className,r=e.notices,n=e.removeNotice,o=r.filter((function(e){return"snackbar"!==e.type}));if(!o.length)return null;var c=b()(t,"wc-block-components-notices");return React.createElement("div",{className:c},o.map((function(e){return React.createElement(m.a,f()({key:"store-notice-"+e.id},e,{className:b()("wc-block-components-notices__notice",h(e)),onRemove:function(){e.isDismissible&&n(e.id)}}),e.content)})))};function O(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function v(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?O(Object(r),!0).forEach((function(t){o()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):O(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var y=Object(a.createContext)({notices:[],createNotice:function(e,t,r){},removeNotice:function(e,t){},setIsSuppressed:function(e){},context:"wc/core"}),w=function(){return Object(a.useContext)(y)},j=function(e){var t=e.children,r=e.className,n=void 0===r?"":r,o=e.createNoticeContainer,c=void 0===o||o,p=e.context,f=void 0===p?"wc/core":p,d=Object(u.useDispatch)("core/notices"),b=d.createNotice,m=d.removeNotice,h=Object(a.useState)(!1),O=i()(h,2),w=O[0],j=O[1],E=Object(s.a)().dispatchStoreEvent,_=Object(l.a)().isEditor,x=Object(a.useCallback)((function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};b(e,t,v(v({},r),{},{context:r.context||f})),E("store-notice-create",{status:e,content:t,options:r})}),[b,E,f]),R=Object(a.useCallback)((function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:f;m(e,t)}),[m,f]),k={notices:Object(u.useSelect)((function(e){return{notices:e("core/notices").getNotices(f)}}),[f]).notices,createNotice:x,removeNotice:R,context:f,setIsSuppressed:j},P=w?null:React.createElement(g,{className:n,notices:k.notices,removeNotice:k.removeNotice,isEditor:_});return React.createElement(y.Provider,{value:k},c&&P,t)}},,,,function(e,t,r){"use strict";r.d(t,"a",(function(){return d}));var n=r(14),o=r.n(n),c=r(4),i=r.n(c),a=r(0),u=r(44);function s(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function l(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?s(Object(r),!0).forEach((function(t){i()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):s(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var p=[".wp-block-woocommerce-cart"],f=function(e){var t=e.Block,r=e.containers,n=e.getProps,c=void 0===n?function(){return{}}:n,i=e.getErrorBoundaryProps,s=void 0===i?function(){return{}}:i;0!==r.length&&Array.prototype.forEach.call(r,(function(e,r){var n=c(e,r),i=s(e,r),p=l(l({},e.dataset),n.attributes||{});e.classList.remove("is-loading"),Object(a.render)(React.createElement(u.a,i,React.createElement(a.Suspense,{fallback:React.createElement("div",{className:"wc-block-placeholder"})},React.createElement(t,o()({},n,{attributes:p})))),e)}))},d=function(e){var t,r,n,o,c,i,a,u=document.body.querySelectorAll(p.join(","));t=l(l({},e),{},{wrappers:u}),r=t.Block,n=t.getProps,o=t.getErrorBoundaryProps,c=t.selector,i=t.wrappers,a=document.body.querySelectorAll(c),i.length>0&&Array.prototype.filter.call(a,(function(e){return!function(e,t){return Array.prototype.some.call(t,(function(t){return t.contains(e)&&!t.isSameNode(e)}))}(e,i)})),f({Block:r,containers:a,getProps:n,getErrorBoundaryProps:o}),Array.prototype.forEach.call(u,(function(t){t.addEventListener("wc-blocks_render_blocks_frontend",(function(){var r,n,o,c,i,a;n=(r=l(l({},e),{},{wrapper:t})).Block,o=r.getProps,c=r.getErrorBoundaryProps,i=r.selector,a=r.wrapper.querySelectorAll(i),f({Block:n,containers:a,getProps:o,getErrorBoundaryProps:c})}))}))}},,,,,function(e,t){},function(e,t){e.exports=window.wp.wordcount},function(e,t,r){"use strict";var n=r(14),o=r.n(n),c=r(0),i=(r(142),function(e){if(e){var t=e.getBoundingClientRect().bottom;t>=0&&t<=window.innerHeight||e.scrollIntoView()}});t.a=function(e){return function(t){var r=Object(c.useRef)(null);return React.createElement(React.Fragment,null,React.createElement("div",{className:"with-scroll-to-top__scroll-point",ref:r,"aria-hidden":!0}),React.createElement(e,o()({},t,{scrollToTop:function(e){var t,n;null!==r.current&&(t=r.current,n=(e||{}).focusableSelector,window&&Number.isFinite(window.innerHeight)&&(n?function(e,t){var r,n=(null===(r=e.parentElement)||void 0===r?void 0:r.querySelectorAll(t))||[];if(n.length){var o=n[0];i(o),null==o||o.focus()}else i(e)}(t,n):i(t)))}})))}}},,function(e,t,r){"use strict";var n=r(0),o=r(34),c=Object(n.createElement)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(n.createElement)(o.Path,{d:"M13 11.8l6.1-6.3-1-1-6.1 6.2-6.1-6.2-1 1 6.1 6.3-6.5 6.7 1 1 6.5-6.6 6.5 6.6 1-1z"}));t.a=c},,,,function(e,t,r){"use strict";r.d(t,"a",(function(){return u}));var n=r(8),o=r(11),c=r(0),i=r(53),a=r(100),u=function(e){var t=e.namespace,r=e.resourceName,u=e.resourceValues,s=void 0===u?[]:u,l=e.query,p=void 0===l?{}:l,f=e.shouldSelect,d=void 0===f||f;if(!t||!r)throw new Error("The options object must have valid values for the namespace and the resource properties.");var b=Object(c.useRef)({results:[],isLoading:!0}),m=Object(i.a)(p),h=Object(i.a)(s),g=Object(a.a)(),O=Object(o.useSelect)((function(e){if(!d)return null;var o=e(n.COLLECTIONS_STORE_KEY),c=[t,r,m,h],i=o.getCollectionError.apply(o,c);return i&&g(i),{results:o.getCollection.apply(o,c),isLoading:!o.hasFinishedResolution("getCollection",c)}}),[t,r,h,m,d]);return null!==O&&(b.current=O),b.current}},,,,,,,,function(e,t,r){"use strict";var n=r(0),o=r(8),c=r(11),i=r(83);t.a=function(e){return function(t){var r;return r=Object(n.useRef)(i.n.restApiRoutes||{}),Object(c.useSelect)((function(e,t){if(r.current){var n=e(o.SCHEMA_STORE_KEY),c=n.isResolving,i=n.hasFinishedResolution,a=t.dispatch(o.SCHEMA_STORE_KEY),u=a.receiveRoutes,s=a.startResolution,l=a.finishResolution;Object.keys(r.current).forEach((function(e){var t=r.current[e];c("getRoutes",[e])||i("getRoutes",[e])||(s("getRoutes",[e]),u(t,[e]),l("getRoutes",[e]))}))}}),[]),React.createElement(e,t)}}},,,,,,,,,,,,,,function(e,t){},,,,,,,,,,function(e,t,r){"use strict";var n=r(4),o=r.n(n),c=r(23),i=r.n(c),a=r(0),u=["srcElement","size"];function s(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}t.a=function(e){var t=e.srcElement,r=e.size,n=void 0===r?24:r,c=i()(e,u);return Object(a.isValidElement)(t)?Object(a.cloneElement)(t,function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?s(Object(r),!0).forEach((function(t){o()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):s(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({width:n,height:n},c)):null}},function(e,t,r){"use strict";var n=r(0),o=r(7),c=r(6),i=r.n(c),a=r(1),u=r(33),s=r(116),l=r(76);t.a=function(e){var t=e.className,r=e.status,c=void 0===r?"info":r,p=e.children,f=e.spokenMessage,d=void 0===f?p:f,b=e.onRemove,m=void 0===b?o.noop:b,h=e.isDismissible,g=void 0===h||h,O=e.actions,v=void 0===O?[]:O,y=e.politeness,w=void 0===y?function(e){switch(e){case"success":case"warning":case"info":return"polite";case"error":default:return"assertive"}}(c):y,j=e.__unstableHTML;!function(e,t){var r="string"==typeof e?e:Object(n.renderToString)(e);Object(n.useEffect)((function(){r&&Object(u.speak)(r,t)}),[r,t])}(d,w);var E=i()(t,"components-notice","is-"+c,{"is-dismissible":g});return j&&(p=Object(n.createElement)(n.RawHTML,null,p)),Object(n.createElement)("div",{className:E},Object(n.createElement)("div",{className:"components-notice__content"},p,v.map((function(e,t){var r=e.className,o=e.label,c=e.isPrimary,a=e.noDefaultClasses,u=void 0!==a&&a,s=e.onClick,p=e.url;return Object(n.createElement)(l.a,{key:t,href:p,isPrimary:c,isSecondary:!u&&!p,isLink:!u&&!!p,onClick:p?void 0:s,className:i()("components-notice__action",r)},o)}))),g&&Object(n.createElement)(l.a,{className:"components-notice__dismiss",icon:s.a,label:Object(a.__)("Dismiss this notice"),onClick:m,showTooltip:!1}))}},,,,,,,,,,,,,,,function(e,t,r){"use strict";r(10);var n=r(6),o=r.n(n),c=r(51),i=r(24);r(196),t.a=Object(i.withInstanceId)((function(e){var t=e.className,r=e.instanceId,n=e.label,i=e.onChange,a=e.options,u=e.screenReaderLabel,s=e.readOnly,l=e.value,p="wc-block-components-sort-select__select-".concat(r);return React.createElement("div",{className:o()("wc-block-sort-select","wc-block-components-sort-select",t)},React.createElement(c.a,{label:n,screenReaderLabel:u,wrapperElement:"label",wrapperProps:{className:"wc-block-sort-select__label wc-block-components-sort-select__label",htmlFor:p}}),React.createElement("select",{id:p,className:"wc-block-sort-select__select wc-block-components-sort-select__select",onChange:i,readOnly:s,value:l},a.map((function(e){return React.createElement("option",{key:e.key,value:e.key},e.label)}))))}))},,,,,,,,,,,,,,,,,,,,,,,,,,,,function(e,t){},,,,function(e,t,r){"use strict";r.d(t,"a",(function(){return i}));var n=r(38),o=r(0),c=r(83);r.p=c.k,Object(n.registerBlockComponent)({blockName:"woocommerce/product-price",component:Object(o.lazy)((function(){return Promise.all([r.e(1),r.e(12)]).then(r.bind(null,387))}))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-image",component:Object(o.lazy)((function(){return r.e(11).then(r.bind(null,416))}))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-title",component:Object(o.lazy)((function(){return r.e(19).then(r.bind(null,409))}))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-rating",component:Object(o.lazy)((function(){return r.e(13).then(r.bind(null,388))}))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-button",component:Object(o.lazy)((function(){return r.e(9).then(r.bind(null,389))}))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-summary",component:Object(o.lazy)((function(){return r.e(17).then(r.bind(null,390))}))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-sale-badge",component:Object(o.lazy)((function(){return r.e(14).then(r.bind(null,354))}))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-sku",component:Object(o.lazy)((function(){return r.e(15).then(r.bind(null,391))}))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-category-list",component:Object(o.lazy)((function(){return r.e(10).then(r.bind(null,392))}))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-tag-list",component:Object(o.lazy)((function(){return r.e(18).then(r.bind(null,393))}))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-stock-indicator",component:Object(o.lazy)((function(){return r.e(16).then(r.bind(null,394))}))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-add-to-cart",component:Object(o.lazy)((function(){return Promise.all([r.e(0),r.e(50),r.e(8)]).then(r.bind(null,403))}))});var i=function(e){return Object(n.getRegisteredBlockComponents)(e)}},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(e,t){e.exports=window.wc.wcBlocksSharedHocs},,,,,,,,,,,,,,,,,,,,,,,,,function(e,t){e.exports=window.wp.blockEditor},function(e,t){e.exports=window.wp.blocks},,,,,,,,,function(e,t,r){e.exports=r(313)},function(e,t){},function(e,t){},function(e,t){},,,,,,,,,,,,,,,,,,,,,,,,,,function(e,t,r){"use strict";r.r(t);var n=r(128),o=r(103),c=r(107),i=r(40),a=r.n(i),u=r(41),s=r.n(u),l=r(42),p=r.n(l),f=r(43),d=r.n(f),b=r(30),m=r.n(b),h=r(3),g=(r(10),r(5)),O=r.n(g),v=r(0),y=r(23),w=r.n(y),j=r(4),E=r.n(j),_=r(1),x=r(7),R=r(6),k=r.n(R),P=r(51),S=(r(287),function(e){var t=e.currentPage,r=e.displayFirstAndLastPages,n=e.displayNextAndPreviousArrows,o=e.pagesToDisplay,c=e.onPageChange,i=e.totalPages,a=function(e,t,r){if(r<=2)return{minIndex:null,maxIndex:null};var n=e-1,o=Math.max(Math.floor(t-n/2),2),c=Math.min(Math.ceil(t+(n-(t-o))),r-1);return{minIndex:Math.max(Math.floor(t-(n-(c-t))),2),maxIndex:c}}(o,t,i),u=a.minIndex,s=a.maxIndex,l=r&&Boolean(1!==u),p=r&&Boolean(s!==i),f=r&&Boolean(u>3),d=r&&Boolean(s<i-2);l&&3===u&&(u-=1),p&&s===i-2&&(s+=1);var b=[];if(u&&s)for(var m=u;m<=s;m++)b.push(m);return React.createElement("div",{className:"wc-block-pagination wc-block-components-pagination"},React.createElement(P.a,{screenReaderLabel:Object(_.__)("Navigate to another page",'woocommerce')}),n&&React.createElement("button",{className:"wc-block-pagination-page wc-block-components-pagination__page wc-block-components-pagination-page--arrow",onClick:function(){return c(t-1)},title:Object(_.__)("Previous page",'woocommerce'),disabled:t<=1},React.createElement(P.a,{label:"←",screenReaderLabel:Object(_.__)("Previous page",'woocommerce')})),l&&React.createElement("button",{className:k()("wc-block-pagination-page","wc-block-components-pagination__page",{"wc-block-pagination-page--active":1===t,"wc-block-components-pagination__page--active":1===t}),onClick:function(){return c(1)},disabled:1===t},React.createElement(P.a,{label:1,screenReaderLabel:Object(_.sprintf)(
/* translators: %d is the page number (1, 2, 3...). */
Object(_.__)("Page %d",'woocommerce'),1)})),f&&React.createElement("span",{className:"wc-block-pagination-ellipsis wc-block-components-pagination__ellipsis","aria-hidden":"true"},Object(_.__)("…",'woocommerce')),b.map((function(e){return React.createElement("button",{key:e,className:k()("wc-block-pagination-page","wc-block-components-pagination__page",{"wc-block-pagination-page--active":t===e,"wc-block-components-pagination__page--active":t===e}),onClick:t===e?null:function(){return c(e)},disabled:t===e},React.createElement(P.a,{label:e,screenReaderLabel:Object(_.sprintf)(
/* translators: %d is the page number (1, 2, 3...). */
Object(_.__)("Page %d",'woocommerce'),e)}))})),d&&React.createElement("span",{className:"wc-block-pagination-ellipsis wc-block-components-pagination__ellipsis","aria-hidden":"true"},Object(_.__)("…",'woocommerce')),p&&React.createElement("button",{className:k()("wc-block-pagination-page","wc-block-components-pagination__page",{"wc-block-pagination-page--active":t===i,"wc-block-components-pagination__page--active":t===i}),onClick:function(){return c(i)},disabled:t===i},React.createElement(P.a,{label:i,screenReaderLabel:Object(_.sprintf)(
/* translators: %d is the page number (1, 2, 3...). */
Object(_.__)("Page %d",'woocommerce'),i)})),n&&React.createElement("button",{className:"wc-block-pagination-page wc-block-components-pagination__page wc-block-components-pagination-page--arrow",onClick:function(){return c(t+1)},title:Object(_.__)("Next page",'woocommerce'),disabled:t>=i},React.createElement(P.a,{label:"→",screenReaderLabel:Object(_.__)("Next page",'woocommerce')})))});S.defaultProps={displayFirstAndLastPages:!0,displayNextAndPreviousArrows:!0,pagesToDisplay:3};var C=S,T=r(99),N=r(90),D=r(120),M=r(8),A=r(11),F=r(53);function I(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function B(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?I(Object(r),!0).forEach((function(t){E()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):I(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var L=r(52),z=r(114),H=r(101),U=r(33),W=r(152),Y=r(34),q=React.createElement(Y.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},React.createElement("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z"})),V=function(){var e=Object(H.useInnerBlockLayoutContext)().parentClassName;return React.createElement("div",{className:"".concat(e,"__no-products")},React.createElement(W.a,{className:"".concat(e,"__no-products-image"),alt:"",srcElement:q,size:100}),React.createElement("strong",{className:"".concat(e,"__no-products-title")},Object(_.__)("No products",'woocommerce')),React.createElement("p",{className:"".concat(e,"__no-products-description")},Object(_.__)("There are currently no products available to display.",'woocommerce')))},G=React.createElement(Y.SVG,{xmlns:"http://www.w3.org/2000/SVG",viewBox:"0 0 24 24"},React.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),React.createElement("path",{d:"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"})),K=function(e){var t=e.resetCallback,r=void 0===t?function(){}:t,n=Object(H.useInnerBlockLayoutContext)().parentClassName;return React.createElement("div",{className:"".concat(n,"__no-products")},React.createElement(W.a,{className:"".concat(n,"__no-products-image"),alt:"",srcElement:G,size:100}),React.createElement("strong",{className:"".concat(n,"__no-products-title")},Object(_.__)("No products found",'woocommerce')),React.createElement("p",{className:"".concat(n,"__no-products-description")},Object(_.__)("We were unable to find any results based on your search.",'woocommerce')),React.createElement("button",{onClick:r},Object(_.__)("Reset Search",'woocommerce')))},Q=r(168),J=(r(286),function(e){var t=e.onChange,r=e.readOnly,n=e.value;return React.createElement(Q.a,{className:"wc-block-product-sort-select wc-block-components-product-sort-select",name:"orderby",onChange:t,options:[{key:"menu_order",label:Object(_.__)("Default sorting",'woocommerce')},{key:"popularity",label:Object(_.__)("Popularity",'woocommerce')},{key:"rating",label:Object(_.__)("Average rating",'woocommerce')},{key:"date",label:Object(_.__)("Latest",'woocommerce')},{key:"price",label:Object(_.__)("Price: low to high",'woocommerce')},{key:"price-desc",label:Object(_.__)("Price: high to low",'woocommerce')}],readOnly:r,screenReaderLabel:Object(_.__)("Order products by",'woocommerce'),value:n})}),X=r(24),$=r(14),Z=r.n($),ee=r(200),te=Object(X.withInstanceId)((function(e){var t=e.product,r=e.attributes,n=e.instanceId,o=r.layoutConfig,c=Object(H.useInnerBlockLayoutContext)(),i=c.parentClassName,a=c.parentName,u=0===Object.keys(t).length,s=k()("".concat(i,"__product"),"wc-block-layout",{"is-loading":u});return React.createElement("li",{className:s,"aria-hidden":u},function e(t,r,n,o){if(n){var c=Object(ee.a)(t);return n.map((function(n,i){var a=O()(n,2),u=a[0],s=a[1],l=void 0===s?{}:s,p=[];l.children&&l.children.length>0&&(p=e(t,r,l.children,o));var f=c[u];if(!f)return null;var d=r.id||0,b=["layout",u,i,o,d];return React.createElement(v.Suspense,{key:b.join("_"),fallback:React.createElement("div",{className:"wc-block-placeholder"})},React.createElement(f,Z()({},l,{children:p,product:r})))}))}}(a,t,o,n))})),re=(r(285),["order","orderby","page","per_page"]);function ne(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function oe(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ne(Object(r),!0).forEach((function(t){E()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ne(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var ce=function(e){var t=e.totalQuery,r=e.totalProducts,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=n.totalQuery;return!Object(x.isEqual)(t,o)&&Number.isFinite(r)},ie=Object(z.a)((function(e){var t,r=e.attributes,n=e.currentPage,o=e.onPageChange,c=e.onSortChange,i=e.sortValue,a=e.scrollToTop,u=Object(N.b)("attributes",[]),s=O()(u,2),l=s[0],p=s[1],f=Object(N.b)("stock_status",[]),d=O()(f,2),b=d[0],m=d[1],h=Object(N.b)("min_price"),g=O()(h,2),y=g[0],j=g[1],E=Object(N.b)("max_price"),R=O()(E,2),P=R[0],S=R[1],I=Object(N.c)(function(e){var t=e.sortValue,r=e.currentPage,n=e.attributes,o=n.columns,c=n.rows;return oe(oe({},function(e){switch(e){case"menu_order":case"popularity":case"rating":case"price":return{orderby:e,order:"asc"};case"price-desc":return{orderby:"price",order:"desc"};case"date":return{orderby:"date",order:"desc"}}}(t)),{},{catalog_visibility:"catalog",per_page:o*c,page:r})}({attributes:r,sortValue:i,currentPage:n})),z=O()(I,1)[0],W=function(e){var t={namespace:"/wc/store",resourceName:"products"},r=Object(D.a)(B(B({},t),{},{query:e})),n=r.results,o=r.isLoading,c=function(e,t){var r=t.namespace,n=t.resourceName,o=t.resourceValues,c=void 0===o?[]:o,i=t.query,a=void 0===i?{}:i;if(!r||!n)throw new Error("The options object must have valid values for the namespace and the resource name properties.");var u=Object(F.a)(a),s=Object(F.a)(c),l=Object(A.useSelect)((function(e){var t=e(M.COLLECTIONS_STORE_KEY),o=["x-wp-total",r,n,u,s];return{value:t.getCollectionHeader.apply(t,o),isLoading:t.hasFinishedResolution("getCollectionHeader",o)}}),["x-wp-total",r,n,s,u]),p=l.value,f=l.isLoading;return{value:p,isLoading:void 0===f||f}}(0,B(B({},t),{},{query:e})).value;return{products:n,totalProducts:parseInt(c,10),productsLoading:o}}(z),Y=W.products,q=W.totalProducts,G=W.productsLoading,Q=Object(H.useInnerBlockLayoutContext)(),X=Q.parentClassName,$=Q.parentName,Z=((t=z).order,t.orderby,t.page,t.per_page,w()(t,re)||{}),ee=Object(L.a)().dispatchStoreEvent,ne=Object(T.a)({totalQuery:Z,totalProducts:q},ce);Object(v.useEffect)((function(){ee("product-list-render",{products:Y,listName:$})}),[Y,$,ee]),Object(v.useEffect)((function(){Object(x.isEqual)(Z,null==ne?void 0:ne.totalQuery)||(o(1),null!=ne&&ne.totalQuery&&function(e){Number.isFinite(e)&&(0===e?Object(U.speak)(Object(_.__)("No products found",'woocommerce')):Object(U.speak)(Object(_.sprintf)(
/* translators: %s is an integer higher than 0 (1, 2, 3...) */
Object(_._n)("%d product found","%d products found",e,'woocommerce'),e)))}(q))}),[null==ne?void 0:ne.totalQuery,q,o,Z]);var ie,ae,ue,se,le,pe=r.contentVisibility,fe=r.columns*r.rows,de=!Number.isFinite(q)&&Number.isFinite(null==ne?void 0:ne.totalProducts)&&Object(x.isEqual)(Z,null==ne?void 0:ne.totalQuery)?Math.ceil(ne.totalProducts/fe):Math.ceil(q/fe),be=Y.length?Y:Array.from({length:fe}),me=0!==Y.length||G,he=l.length>0||b.length>0||Number.isFinite(y)||Number.isFinite(P);return React.createElement("div",{className:(ie=r.columns,ae=r.rows,ue=r.alignButtons,se=r.align,le=void 0!==se?"align"+se:"",k()(X,le,"has-"+ie+"-columns",{"has-multiple-rows":ae>1,"has-aligned-buttons":ue}))},pe.orderBy&&me&&React.createElement(J,{onChange:c,value:i}),!me&&he&&React.createElement(K,{resetCallback:function(){p([]),m([]),j(null),S(null)}}),!me&&!he&&React.createElement(V,null),me&&React.createElement("ul",{className:"".concat(X,"__products")},be.map((function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return React.createElement(te,{key:e.id||t,attributes:r,product:e})}))),de>1&&React.createElement(C,{currentPage:n,onPageChange:function(e){a({focusableSelector:"a, button"}),o(e)},totalPages:de}))})),ae=function(e){var t=e.attributes,r=Object(v.useState)(1),n=O()(r,2),o=n[0],c=n[1],i=Object(v.useState)(t.orderby),a=O()(i,2),u=a[0],s=a[1];return Object(v.useEffect)((function(){s(t.orderby)}),[t.orderby]),React.createElement(ie,{attributes:t,currentPage:o,onPageChange:function(e){c(e)},onSortChange:function(e){var t=e.target.value;s(t),c(1)},sortValue:u})},ue=React.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 230 250",style:{width:"100%"}},React.createElement("title",null,"Grid Block Preview"),React.createElement("rect",{width:"65.374",height:"65.374",x:".162",y:".779",fill:"#E1E3E6",rx:"3"}),React.createElement("rect",{width:"47.266",height:"5.148",x:"9.216",y:"76.153",fill:"#E1E3E6",rx:"2.574"}),React.createElement("rect",{width:"62.8",height:"15",x:"1.565",y:"101.448",fill:"#E1E3E6",rx:"5"}),React.createElement("rect",{width:"65.374",height:"65.374",x:".162",y:"136.277",fill:"#E1E3E6",rx:"3"}),React.createElement("rect",{width:"47.266",height:"5.148",x:"9.216",y:"211.651",fill:"#E1E3E6",rx:"2.574"}),React.createElement("rect",{width:"62.8",height:"15",x:"1.565",y:"236.946",fill:"#E1E3E6",rx:"5"}),React.createElement("rect",{width:"65.374",height:"65.374",x:"82.478",y:".779",fill:"#E1E3E6",rx:"3"}),React.createElement("rect",{width:"47.266",height:"5.148",x:"91.532",y:"76.153",fill:"#E1E3E6",rx:"2.574"}),React.createElement("rect",{width:"62.8",height:"15",x:"83.882",y:"101.448",fill:"#E1E3E6",rx:"5"}),React.createElement("rect",{width:"65.374",height:"65.374",x:"82.478",y:"136.277",fill:"#E1E3E6",rx:"3"}),React.createElement("rect",{width:"47.266",height:"5.148",x:"91.532",y:"211.651",fill:"#E1E3E6",rx:"2.574"}),React.createElement("rect",{width:"62.8",height:"15",x:"83.882",y:"236.946",fill:"#E1E3E6",rx:"5"}),React.createElement("rect",{width:"65.374",height:"65.374",x:"164.788",y:".779",fill:"#E1E3E6",rx:"3"}),React.createElement("rect",{width:"47.266",height:"5.148",x:"173.843",y:"76.153",fill:"#E1E3E6",rx:"2.574"}),React.createElement("rect",{width:"62.8",height:"15",x:"166.192",y:"101.448",fill:"#E1E3E6",rx:"5"}),React.createElement("rect",{width:"65.374",height:"65.374",x:"164.788",y:"136.277",fill:"#E1E3E6",rx:"3"}),React.createElement("rect",{width:"47.266",height:"5.148",x:"173.843",y:"211.651",fill:"#E1E3E6",rx:"2.574"}),React.createElement("rect",{width:"62.8",height:"15",x:"166.192",y:"236.946",fill:"#E1E3E6",rx:"5"}),React.createElement("rect",{width:"6.177",height:"6.177",x:"13.283",y:"86.301",fill:"#E1E3E6",rx:"3"}),React.createElement("rect",{width:"6.177",height:"6.177",x:"21.498",y:"86.301",fill:"#E1E3E6",rx:"3"}),React.createElement("rect",{width:"6.177",height:"6.177",x:"29.713",y:"86.301",fill:"#E1E3E6",rx:"3"}),React.createElement("rect",{width:"6.177",height:"6.177",x:"37.927",y:"86.301",fill:"#E1E3E6",rx:"3"}),React.createElement("rect",{width:"6.177",height:"6.177",x:"46.238",y:"86.301",fill:"#E1E3E6",rx:"3"}),React.createElement("rect",{width:"6.177",height:"6.177",x:"95.599",y:"86.301",fill:"#E1E3E6",rx:"3"}),React.createElement("rect",{width:"6.177",height:"6.177",x:"103.814",y:"86.301",fill:"#E1E3E6",rx:"3"}),React.createElement("rect",{width:"6.177",height:"6.177",x:"112.029",y:"86.301",fill:"#E1E3E6",rx:"3"}),React.createElement("rect",{width:"6.177",height:"6.177",x:"120.243",y:"86.301",fill:"#E1E3E6",rx:"3"}),React.createElement("rect",{width:"6.177",height:"6.177",x:"128.554",y:"86.301",fill:"#E1E3E6",rx:"3"}),React.createElement("rect",{width:"6.177",height:"6.177",x:"177.909",y:"86.301",fill:"#E1E3E6",rx:"3"}),React.createElement("rect",{width:"6.177",height:"6.177",x:"186.124",y:"86.301",fill:"#E1E3E6",rx:"3"}),React.createElement("rect",{width:"6.177",height:"6.177",x:"194.339",y:"86.301",fill:"#E1E3E6",rx:"3"}),React.createElement("rect",{width:"6.177",height:"6.177",x:"202.553",y:"86.301",fill:"#E1E3E6",rx:"3"}),React.createElement("rect",{width:"6.177",height:"6.177",x:"210.864",y:"86.301",fill:"#E1E3E6",rx:"3"}),React.createElement("rect",{width:"6.177",height:"6.177",x:"13.283",y:"221.798",fill:"#E1E3E6",rx:"3"}),React.createElement("rect",{width:"6.177",height:"6.177",x:"21.498",y:"221.798",fill:"#E1E3E6",rx:"3"}),React.createElement("rect",{width:"6.177",height:"6.177",x:"29.713",y:"221.798",fill:"#E1E3E6",rx:"3"}),React.createElement("rect",{width:"6.177",height:"6.177",x:"37.927",y:"221.798",fill:"#E1E3E6",rx:"3"}),React.createElement("rect",{width:"6.177",height:"6.177",x:"46.238",y:"221.798",fill:"#E1E3E6",rx:"3"}),React.createElement("rect",{width:"6.177",height:"6.177",x:"95.599",y:"221.798",fill:"#E1E3E6",rx:"3"}),React.createElement("rect",{width:"6.177",height:"6.177",x:"103.814",y:"221.798",fill:"#E1E3E6",rx:"3"}),React.createElement("rect",{width:"6.177",height:"6.177",x:"112.029",y:"221.798",fill:"#E1E3E6",rx:"3"}),React.createElement("rect",{width:"6.177",height:"6.177",x:"120.243",y:"221.798",fill:"#E1E3E6",rx:"3"}),React.createElement("rect",{width:"6.177",height:"6.177",x:"128.554",y:"221.798",fill:"#E1E3E6",rx:"3"}),React.createElement("rect",{width:"6.177",height:"6.177",x:"177.909",y:"221.798",fill:"#E1E3E6",rx:"3"}),React.createElement("rect",{width:"6.177",height:"6.177",x:"186.124",y:"221.798",fill:"#E1E3E6",rx:"3"}),React.createElement("rect",{width:"6.177",height:"6.177",x:"194.339",y:"221.798",fill:"#E1E3E6",rx:"3"}),React.createElement("rect",{width:"6.177",height:"6.177",x:"202.553",y:"221.798",fill:"#E1E3E6",rx:"3"}),React.createElement("rect",{width:"6.177",height:"6.177",x:"210.864",y:"221.798",fill:"#E1E3E6",rx:"3"}));var se=function(e){p()(o,e);var t,r,n=(t=o,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,n=m()(t);if(r){var o=m()(this).constructor;e=Reflect.construct(n,arguments,o)}else e=n.apply(this,arguments);return d()(this,e)});function o(){return a()(this,o),n.apply(this,arguments)}return s()(o,[{key:"render",value:function(){var e=this.props,t=e.attributes,r=e.urlParameterSuffix;return t.isPreview?ue:React.createElement(H.InnerBlockLayoutContextProvider,{parentName:"woocommerce/all-products",parentClassName:"wc-block-grid"},React.createElement(ae,{attributes:t,urlParameterSuffix:r}))}}]),o}(h.Component);Object(c.a)({selector:".wp-block-woocommerce-all-products",Block:Object(n.a)((function(e){return React.createElement(o.a,{context:"wc/all-products"},React.createElement(se,e))})),getProps:function(e){return{attributes:JSON.parse(e.dataset.attributes)}}})}]);woocommerce-blocks/build/product-search.js000064400000016541151335517640014737 0ustar00this.wc=this.wc||{},this.wc.blocks=this.wc.blocks||{},this.wc.blocks["product-search"]=function(e){function t(t){for(var c,l,a=t[0],s=t[1],i=t[2],b=0,p=[];b<a.length;b++)l=a[b],Object.prototype.hasOwnProperty.call(o,l)&&o[l]&&p.push(o[l][0]),o[l]=0;for(c in s)Object.prototype.hasOwnProperty.call(s,c)&&(e[c]=s[c]);for(u&&u(t);p.length;)p.shift()();return n.push.apply(n,i||[]),r()}function r(){for(var e,t=0;t<n.length;t++){for(var r=n[t],c=!0,a=1;a<r.length;a++){var s=r[a];0!==o[s]&&(c=!1)}c&&(n.splice(t--,1),e=l(l.s=r[0]))}return e}var c={},o={33:0},n=[];function l(t){if(c[t])return c[t].exports;var r=c[t]={i:t,l:!1,exports:{}};return e[t].call(r.exports,r,r.exports,l),r.l=!0,r.exports}l.m=e,l.c=c,l.d=function(e,t,r){l.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},l.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},l.t=function(e,t){if(1&t&&(e=l(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(l.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var c in e)l.d(r,c,function(t){return e[t]}.bind(null,c));return r},l.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return l.d(t,"a",t),t},l.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},l.p="";var a=window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[],s=a.push.bind(a);a.push=t,a=a.slice();for(var i=0;i<a.length;i++)t(a[i]);var u=s;return n.push([777,0]),r()}({0:function(e,t){e.exports=window.wp.element},1:function(e,t){e.exports=window.wp.i18n},12:function(e,t){e.exports=window.wp.blockEditor},21:function(e,t){e.exports=window.wp.compose},26:function(e,t){e.exports=window.wp.blocks},28:function(e,t){e.exports=window.wp.primitives},3:function(e,t){e.exports=window.wc.wcSettings},359:function(e,t){},360:function(e,t){},4:function(e,t){e.exports=window.wp.components},66:function(e,t,r){"use strict";var c=r(5),o=r.n(c),n=r(16),l=r.n(n),a=r(0),s=["srcElement","size"];function i(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(e);t&&(c=c.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,c)}return r}t.a=function(e){var t=e.srcElement,r=e.size,c=void 0===r?24:r,n=l()(e,s);return Object(a.isValidElement)(t)?Object(a.cloneElement)(t,function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?i(Object(r),!0).forEach((function(t){o()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):i(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({width:c,height:c},n)):null}},777:function(e,t,r){e.exports=r(873)},778:function(e,t,r){"use strict";var c=r(0),o=r(28),n=Object(c.createElement)(o.SVG,{xmlns:"http://www.w3.org/2000/SVG",viewBox:"0 0 24 24"},Object(c.createElement)("path",{fill:"none",d:"M0 0h24v24H0V0z"}),Object(c.createElement)("path",{d:"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"}));t.a=n},873:function(e,t,r){"use strict";r.r(t);var c=r(0),o=r(1),n=r(26),l=r(66),a=r(778),s=(r(359),r(360),r(6)),i=r.n(s),u=(r(2),r(3)),b=function(e){var t=e.attributes,r=t.label,n=t.placeholder,l=t.formId,a=t.className,s=t.hasLabel,b=t.align,p=i()("wc-block-product-search",b?"align"+b:"",a);return Object(c.createElement)("div",{className:p},Object(c.createElement)("form",{role:"search",method:"get",action:u.HOME_URL},Object(c.createElement)("label",{htmlFor:l,className:s?"wc-block-product-search__label":"wc-block-product-search__label screen-reader-text"},r),Object(c.createElement)("div",{className:"wc-block-product-search__fields"},Object(c.createElement)("input",{type:"search",id:l,className:"wc-block-product-search__field",placeholder:n,name:"s"}),Object(c.createElement)("input",{type:"hidden",name:"post_type",value:"product"}),Object(c.createElement)("button",{type:"submit",className:"wc-block-product-search__button",label:Object(o.__)("Search",'woocommerce')},Object(c.createElement)("svg",{"aria-hidden":"true",role:"img",focusable:"false",className:"dashicon dashicons-arrow-right-alt2",xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 20 20"},Object(c.createElement)("path",{d:"M6 15l5-5-5-5 1-2 7 7-7 7z"}))))))},p=r(12),d=r(4),w=r(21),f=Object(w.withInstanceId)((function(e){var t=e.attributes,r=t.label,n=t.placeholder,l=t.formId,a=t.className,s=t.hasLabel,u=t.align,b=e.instanceId,w=e.setAttributes,f=i()("wc-block-product-search",u?"align"+u:"",a);return Object(c.useEffect)((function(){l||w({formId:"wc-block-product-search-".concat(b)})}),[l,w,b]),Object(c.createElement)(c.Fragment,null,Object(c.createElement)(p.InspectorControls,{key:"inspector"},Object(c.createElement)(d.PanelBody,{title:Object(o.__)("Content",'woocommerce'),initialOpen:!0},Object(c.createElement)(d.ToggleControl,{label:Object(o.__)("Show search field label",'woocommerce'),help:s?Object(o.__)("Label is visible.",'woocommerce'):Object(o.__)("Label is hidden.",'woocommerce'),checked:s,onChange:function(){return w({hasLabel:!s})}}))),Object(c.createElement)("div",{className:f},!!s&&Object(c.createElement)(p.PlainText,{className:"wc-block-product-search__label",value:r,onChange:function(e){return w({label:e})}}),Object(c.createElement)("div",{className:"wc-block-product-search__fields"},Object(c.createElement)(d.TextControl,{className:"wc-block-product-search__field input-control",value:n,onChange:function(e){return w({placeholder:e})}}),Object(c.createElement)("button",{type:"submit",className:"wc-block-product-search__button",label:Object(o.__)("Search",'woocommerce'),onClick:function(e){return e.preventDefault()},tabIndex:"-1"},Object(c.createElement)("svg",{"aria-hidden":"true",role:"img",focusable:"false",className:"dashicon dashicons-arrow-right-alt2",xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 20 20"},Object(c.createElement)("path",{d:"M6 15l5-5-5-5 1-2 7 7-7 7z"}))))))})),h={hasLabel:{type:"boolean",default:!0},label:{type:"string",default:Object(o.__)("Search",'woocommerce')},placeholder:{type:"string",default:Object(o.__)("Search products…",'woocommerce')},formId:{type:"string",default:""}};Object(n.registerBlockType)("woocommerce/product-search",{title:Object(o.__)("Product Search",'woocommerce'),icon:{src:Object(c.createElement)(l.a,{srcElement:a.a}),foreground:"#96588a"},category:"woocommerce",keywords:[Object(o.__)("WooCommerce",'woocommerce')],description:Object(o.__)("A search box to allow customers to search for products by keyword.",'woocommerce'),supports:{align:["wide","full"]},example:{attributes:{hasLabel:!0}},attributes:h,transforms:{from:[{type:"block",blocks:["core/legacy-widget"],isMatch:function(e){var t=e.idBase,r=e.instance;return"woocommerce_product_search"===t&&!(null==r||!r.raw)},transform:function(e){var t=e.instance;return Object(n.createBlock)("woocommerce/product-search",{label:""===t.raw.title?Object(o.__)("Search",'woocommerce'):t.raw.title})}}]},deprecated:[{attributes:h,save:function(e){return Object(c.createElement)("div",null,Object(c.createElement)(b,e))}}],edit:f,save:function(){return null}})}});woocommerce-blocks/build/mini-cart-frontend.js000064400000014136151335517640015512 0ustar00!function(e){var n={};function t(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,t),o.l=!0,o.exports}t.m=e,t.c=n,t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{enumerable:!0,get:r})},t.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},t.t=function(e,n){if(1&n&&(e=t(e)),8&n)return e;if(4&n&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(t.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&n&&"string"!=typeof e)for(var o in e)t.d(r,o,function(n){return e[n]}.bind(null,o));return r},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},t.p="",t(t.s=309)}({137:function(e,n,t){"use strict";t.d(n,"a",(function(){return c})),t.d(n,"c",(function(){return i})),t.d(n,"b",(function(){return u}));var r,o=window.CustomEvent||null,c=function(e,n){var t=n.bubbles,r=void 0!==t&&t,c=n.cancelable,i=void 0!==c&&c,u=n.element,a=n.detail,d=void 0===a?{}:a;if(o){u||(u=document.body);var f=new o(e,{bubbles:r,cancelable:i,detail:d});u.dispatchEvent(f)}},i=function(){r&&clearTimeout(r),r=setTimeout((function(){c("wc_fragment_refresh",{bubbles:!0,cancelable:!0})}),50)},u=function(e,n){var t=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if("function"!=typeof jQuery)return function(){};var o=function(){c(n,{bubbles:t,cancelable:r})};return jQuery(document).on(e,o),function(){return jQuery(document).off(e,o)}}},2:function(e,n){e.exports=window.wc.wcSettings},27:function(e,n){e.exports=window.regeneratorRuntime},309:function(e,n,t){e.exports=t(324)},324:function(e,n,t){"use strict";t.r(n);var r=t(39),o=t.n(r),c=t(4),i=t.n(c),u=t(27),a=t.n(u),d=t(2),f=function(e){var n=e.handle,t=e.src,r=e.version;if(0===document.querySelectorAll("#".concat(n,"-js, #").concat(n,"-js-prefetch")).length){var o=document.createElement("link");o.href=r?"".concat(t,"?ver=").concat(r):t,o.rel="preload",o.as="script",o.id="".concat(n,"-js-prefetch"),document.head.appendChild(o)}},s=t(49),l=function(e){return document.querySelectorAll("script#".concat(e)).length>0},b=function(e){if(Object(s.c)(e.id)&&!l(e.id)){var n=document.createElement("script");for(var t in e)if(e.hasOwnProperty(t)){var r=t;if("onload"!==r&&"onerror"!==r){var o=e[r];Object(s.c)(o)&&(n[r]=o)}}"function"==typeof e.onload&&(n.onload=e.onload),"function"==typeof e.onerror&&(n.onerror=e.onerror),document.body.appendChild(n)}},p=function(e){var n=e.handle,t=e.src,r=e.version,o=e.after,c=e.before,i=e.translations;return new Promise((function(e,u){l("".concat(n,"-js"))&&e(),i&&b({id:"".concat(n,"-js-translations"),innerHTML:i}),c&&b({id:"".concat(n,"-js-before"),innerHTML:c}),b({id:"".concat(n,"-js"),onerror:u,onload:function(){o&&b({id:"".concat(n,"-js-after"),innerHTML:o}),e()},src:r?"".concat(t,"?ver=").concat(r):t})}))},v=t(137);function y(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,r)}return t}function m(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?y(Object(t),!0).forEach((function(n){i()(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):y(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}window.onload=function(){var e=document.querySelectorAll(".wc-block-mini-cart"),n=!1;if(0!==e.length){var t=Object(d.getSetting)("mini_cart_block_frontend_dependencies",{});for(var r in t){var c=t[r];f(m({handle:r},c))}var i=Object(v.b)("adding_to_cart","wc-blocks_adding_to_cart"),u=Object(v.b)("added_to_cart","wc-blocks_added_to_cart"),s=function(){var e=o()(a.a.mark((function e(){var r,o;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!n){e.next=2;break}return e.abrupt("return");case 2:n=!0,document.body.removeEventListener("wc-blocks_adding_to_cart",s),i(),e.t0=a.a.keys(t);case 6:if((e.t1=e.t0()).done){e.next=13;break}return r=e.t1.value,o=t[r],e.next=11,p(m({handle:r},o));case 11:e.next=6;break;case 13:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();document.body.addEventListener("wc-blocks_adding_to_cart",s),e.forEach((function(e,t){if(e instanceof HTMLElement){var r=e.querySelector(".wc-block-mini-cart__button"),o=e.querySelector(".wc-block-components-drawer__screen-overlay");if(r&&o){var c=function(){n||s(),document.body.removeEventListener("wc-blocks_added_to_cart",i),e.dataset.isPlaceholderOpen="true",o.classList.add("wc-block-components-drawer__screen-overlay--with-slide-in"),o.classList.remove("wc-block-components-drawer__screen-overlay--is-hidden"),u()},i=function(){e.dataset.isDataOutdated="true",c()};r.addEventListener("mouseover",s),r.addEventListener("focus",s),r.addEventListener("click",c),0===t&&document.body.addEventListener("wc-blocks_added_to_cart",i)}}}))}}},39:function(e,n){function t(e,n,t,r,o,c,i){try{var u=e[c](i),a=u.value}catch(e){return void t(e)}u.done?n(a):Promise.resolve(a).then(r,o)}e.exports=function(e){return function(){var n=this,r=arguments;return new Promise((function(o,c){var i=e.apply(n,r);function u(e){t(i,o,c,u,a,"next",e)}function a(e){t(i,o,c,u,a,"throw",e)}u(void 0)}))}},e.exports.default=e.exports,e.exports.__esModule=!0},4:function(e,n){e.exports=function(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e},e.exports.default=e.exports,e.exports.__esModule=!0},49:function(e,n,t){"use strict";t.d(n,"a",(function(){return r})),t.d(n,"c",(function(){return o})),t.d(n,"b",(function(){return c})),t.d(n,"d",(function(){return i}));var r=function(e){return"number"==typeof e},o=function(e){return"string"==typeof e},c=function(e){return!function(e){return null===e}(e)&&e instanceof Object&&e.constructor===Object};function i(e,n){return c(e)&&n in e}}});woocommerce-blocks/build/handpicked-products.js000064400000062236151335517640015751 0ustar00this.wc=this.wc||{},this.wc.blocks=this.wc.blocks||{},this.wc.blocks["handpicked-products"]=function(e){function t(t){for(var n,i,l=t[0],u=t[1],a=t[2],d=0,b=[];d<l.length;d++)i=l[d],Object.prototype.hasOwnProperty.call(c,i)&&c[i]&&b.push(c[i][0]),c[i]=0;for(n in u)Object.prototype.hasOwnProperty.call(u,n)&&(e[n]=u[n]);for(s&&s(t);b.length;)b.shift()();return o.push.apply(o,a||[]),r()}function r(){for(var e,t=0;t<o.length;t++){for(var r=o[t],n=!0,l=1;l<r.length;l++){var u=r[l];0!==c[u]&&(n=!1)}n&&(o.splice(t--,1),e=i(i.s=r[0]))}return e}var n={},c={25:0},o=[];function i(t){if(n[t])return n[t].exports;var r=n[t]={i:t,l:!1,exports:{}};return e[t].call(r.exports,r,r.exports,i),r.l=!0,r.exports}i.m=e,i.c=n,i.d=function(e,t,r){i.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},i.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.t=function(e,t){if(1&t&&(e=i(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(i.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)i.d(r,n,function(t){return e[t]}.bind(null,n));return r},i.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(t,"a",t),t},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.p="";var l=window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[],u=l.push.bind(l);l.push=t,l=l.slice();for(var a=0;a<l.length;a++)t(l[a]);var s=u;return o.push([583,0]),r()}({0:function(e,t){e.exports=window.wp.element},1:function(e,t){e.exports=window.wp.i18n},11:function(e,t){e.exports=window.React},12:function(e,t){e.exports=window.wp.blockEditor},121:function(e,t){},122:function(e,t){e.exports=window.wp.coreData},130:function(e,t,r){"use strict";var n=r(0),c=r(1),o=r(4);r(2),t.a=function(e){var t=e.value,r=e.setAttributes;return Object(n.createElement)(o.SelectControl,{label:Object(c.__)("Order products by",'woocommerce'),value:t,options:[{label:Object(c.__)("Newness - newest first",'woocommerce'),value:"date"},{label:Object(c.__)("Price - low to high",'woocommerce'),value:"price_asc"},{label:Object(c.__)("Price - high to low",'woocommerce'),value:"price_desc"},{label:Object(c.__)("Rating - highest first",'woocommerce'),value:"rating"},{label:Object(c.__)("Sales - most first",'woocommerce'),value:"popularity"},{label:Object(c.__)("Title - alphabetical",'woocommerce'),value:"title"},{label:Object(c.__)("Menu Order",'woocommerce'),value:"menu_order"}],onChange:function(e){return r({orderby:e})}})}},14:function(e,t){e.exports=window.wp.data},15:function(e,t){e.exports=window.wp.apiFetch},188:function(e,t,r){"use strict";r.d(t,"a",(function(){return c}));var n=r(0),c=Object(n.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 230 250",style:{width:"100%"}},Object(n.createElement)("title",null,"Grid Block Preview"),Object(n.createElement)("rect",{width:"65.374",height:"65.374",x:".162",y:".779",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"47.266",height:"5.148",x:"9.216",y:"76.153",fill:"#E1E3E6",rx:"2.574"}),Object(n.createElement)("rect",{width:"62.8",height:"15",x:"1.565",y:"101.448",fill:"#E1E3E6",rx:"5"}),Object(n.createElement)("rect",{width:"65.374",height:"65.374",x:".162",y:"136.277",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"47.266",height:"5.148",x:"9.216",y:"211.651",fill:"#E1E3E6",rx:"2.574"}),Object(n.createElement)("rect",{width:"62.8",height:"15",x:"1.565",y:"236.946",fill:"#E1E3E6",rx:"5"}),Object(n.createElement)("rect",{width:"65.374",height:"65.374",x:"82.478",y:".779",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"47.266",height:"5.148",x:"91.532",y:"76.153",fill:"#E1E3E6",rx:"2.574"}),Object(n.createElement)("rect",{width:"62.8",height:"15",x:"83.882",y:"101.448",fill:"#E1E3E6",rx:"5"}),Object(n.createElement)("rect",{width:"65.374",height:"65.374",x:"82.478",y:"136.277",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"47.266",height:"5.148",x:"91.532",y:"211.651",fill:"#E1E3E6",rx:"2.574"}),Object(n.createElement)("rect",{width:"62.8",height:"15",x:"83.882",y:"236.946",fill:"#E1E3E6",rx:"5"}),Object(n.createElement)("rect",{width:"65.374",height:"65.374",x:"164.788",y:".779",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"47.266",height:"5.148",x:"173.843",y:"76.153",fill:"#E1E3E6",rx:"2.574"}),Object(n.createElement)("rect",{width:"62.8",height:"15",x:"166.192",y:"101.448",fill:"#E1E3E6",rx:"5"}),Object(n.createElement)("rect",{width:"65.374",height:"65.374",x:"164.788",y:"136.277",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"47.266",height:"5.148",x:"173.843",y:"211.651",fill:"#E1E3E6",rx:"2.574"}),Object(n.createElement)("rect",{width:"62.8",height:"15",x:"166.192",y:"236.946",fill:"#E1E3E6",rx:"5"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"13.283",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"21.498",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"29.713",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"37.927",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"46.238",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"95.599",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"103.814",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"112.029",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"120.243",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"128.554",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"177.909",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"186.124",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"194.339",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"202.553",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"210.864",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"13.283",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"21.498",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"29.713",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"37.927",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"46.238",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"95.599",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"103.814",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"112.029",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"120.243",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"128.554",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"177.909",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"186.124",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"194.339",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"202.553",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"210.864",y:"221.798",fill:"#E1E3E6",rx:"3"}))},21:function(e,t){e.exports=window.wp.compose},22:function(e,t){e.exports=window.regeneratorRuntime},23:function(e,t){e.exports=window.wp.url},25:function(e,t){e.exports=window.wp.htmlEntities},26:function(e,t){e.exports=window.wp.blocks},28:function(e,t){e.exports=window.wp.primitives},3:function(e,t){e.exports=window.wc.wcSettings},302:function(e,t,r){"use strict";var n=r(9),c=r.n(n),o=r(29),i=r.n(o),l=r(8),u=r.n(l),a=r(16),s=r.n(a),d=r(0),b=r(22),p=r.n(b),g=r(37),f=r(39),h=r(222),w=r(42),E=["selected"];t.a=function(e){return function(t){var r=t.selected,n=s()(t,E),o=Object(d.useState)(!0),l=u()(o,2),a=l[0],b=l[1],O=Object(d.useState)(null),j=u()(O,2),m=j[0],y=j[1],v=Object(d.useState)([]),x=u()(v,2),_=x[0],k=x[1],P=g.o.productCount>100,S=function(){var e=i()(p.a.mark((function e(t){var r;return p.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Object(w.a)(t);case 2:r=e.sent,y(r),b(!1);case 5:case"end":return e.stop()}}),e)})));return function(_x){return e.apply(this,arguments)}}();Object(d.useEffect)((function(){Object(f.h)({selected:r}).then((function(e){k(e),b(!1)})).catch(S)}),[r]);var C=Object(h.a)((function(e){Object(f.h)({selected:r,search:e}).then((function(e){k(e),b(!1)})).catch(S)}),400),A=u()(C,1)[0],T=Object(d.useCallback)((function(e){b(!0),A(e)}),[b,A]);return Object(d.createElement)(e,c()({},n,{selected:r,error:m,products:_,isLoading:a,onSearch:P?T:null}))}}},31:function(e,t){e.exports=window.moment},36:function(e,t){e.exports=window.wp.dataControls},37:function(e,t,r){"use strict";r.d(t,"o",(function(){return o})),r.d(t,"m",(function(){return i})),r.d(t,"l",(function(){return l})),r.d(t,"n",(function(){return u})),r.d(t,"j",(function(){return a})),r.d(t,"e",(function(){return s})),r.d(t,"f",(function(){return d})),r.d(t,"g",(function(){return b})),r.d(t,"k",(function(){return p})),r.d(t,"c",(function(){return g})),r.d(t,"d",(function(){return f})),r.d(t,"h",(function(){return h})),r.d(t,"a",(function(){return w})),r.d(t,"i",(function(){return E})),r.d(t,"b",(function(){return O}));var n,c=r(3),o=Object(c.getSetting)("wcBlocksConfig",{buildPhase:1,pluginUrl:"",productCount:0,defaultAvatar:"",restApiRoutes:{},wordCountType:"words"}),i=o.pluginUrl+"images/",l=o.pluginUrl+"build/",u=o.buildPhase,a=null===(n=c.STORE_PAGES.shop)||void 0===n?void 0:n.permalink,s=c.STORE_PAGES.checkout.id,d=c.STORE_PAGES.checkout.permalink,b=c.STORE_PAGES.privacy.permalink,p=(c.STORE_PAGES.privacy.title,c.STORE_PAGES.terms.permalink),g=(c.STORE_PAGES.terms.title,c.STORE_PAGES.cart.id),f=c.STORE_PAGES.cart.permalink,h=(c.STORE_PAGES.myaccount.permalink?c.STORE_PAGES.myaccount.permalink:Object(c.getSetting)("wpLoginUrl","/wp-login.php"),Object(c.getSetting)("shippingCountries",{})),w=Object(c.getSetting)("allowedCountries",{}),E=Object(c.getSetting)("shippingStates",{}),O=Object(c.getSetting)("allowedStates",{})},39:function(e,t,r){"use strict";r.d(t,"h",(function(){return p})),r.d(t,"e",(function(){return g})),r.d(t,"b",(function(){return f})),r.d(t,"i",(function(){return h})),r.d(t,"f",(function(){return w})),r.d(t,"c",(function(){return E})),r.d(t,"d",(function(){return O})),r.d(t,"g",(function(){return j})),r.d(t,"a",(function(){return m}));var n=r(5),c=r.n(n),o=r(23),i=r(15),l=r.n(i),u=r(7),a=r(3),s=r(37);function d(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function b(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?d(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):d(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var p=function(e){var t=e.selected,r=void 0===t?[]:t,n=e.search,c=void 0===n?"":n,i=e.queryArgs,a=function(e){var t=e.selected,r=void 0===t?[]:t,n=e.search,c=void 0===n?"":n,i=e.queryArgs,l=void 0===i?{}:i,u=s.o.productCount>100,a={per_page:u?100:0,catalog_visibility:"any",search:c,orderby:"title",order:"asc"},d=[Object(o.addQueryArgs)("/wc/store/products",b(b({},a),l))];return u&&r.length&&d.push(Object(o.addQueryArgs)("/wc/store/products",{catalog_visibility:"any",include:r,per_page:0})),d}({selected:r,search:c,queryArgs:void 0===i?{}:i});return Promise.all(a.map((function(e){return l()({path:e})}))).then((function(e){return Object(u.uniqBy)(Object(u.flatten)(e),"id").map((function(e){return b(b({},e),{},{parent:0})}))})).catch((function(e){throw e}))},g=function(e){return l()({path:"/wc/store/products/".concat(e)})},f=function(){return l()({path:"wc/store/products/attributes"})},h=function(e){return l()({path:"wc/store/products/attributes/".concat(e,"/terms")})},w=function(e){var t=e.selected,r=function(e){var t=e.selected,r=void 0===t?[]:t,n=e.search,c=Object(a.getSetting)("limitTags",!1),i=[Object(o.addQueryArgs)("wc/store/products/tags",{per_page:c?100:0,orderby:c?"count":"name",order:c?"desc":"asc",search:n})];return c&&r.length&&i.push(Object(o.addQueryArgs)("wc/store/products/tags",{include:r})),i}({selected:void 0===t?[]:t,search:e.search});return Promise.all(r.map((function(e){return l()({path:e})}))).then((function(e){return Object(u.uniqBy)(Object(u.flatten)(e),"id")}))},E=function(e){return l()({path:Object(o.addQueryArgs)("wc/store/products/categories",b({per_page:0},e))})},O=function(e){return l()({path:"wc/store/products/categories/".concat(e)})},j=function(e){return l()({path:Object(o.addQueryArgs)("wc/store/products",{per_page:0,type:"variation",parent:e})})},m=function(e,t){if(!e.title.raw)return e.slug;var r=1===t.filter((function(t){return t.title.raw===e.title.raw})).length;return e.title.raw+(r?"":" - ".concat(e.slug))}},4:function(e,t){e.exports=window.wp.components},42:function(e,t,r){"use strict";r.d(t,"a",(function(){return u})),r.d(t,"b",(function(){return a}));var n=r(29),c=r.n(n),o=r(22),i=r.n(o),l=r(1),u=function(){var e=c()(i.a.mark((function e(t){var r;return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("function"!=typeof t.json){e.next=11;break}return e.prev=1,e.next=4,t.json();case 4:return r=e.sent,e.abrupt("return",{message:r.message,type:r.type||"api"});case 8:return e.prev=8,e.t0=e.catch(1),e.abrupt("return",{message:e.t0.message,type:"general"});case 11:return e.abrupt("return",{message:t.message,type:t.type||"general"});case 12:case"end":return e.stop()}}),e,null,[[1,8]])})));return function(_x){return e.apply(this,arguments)}}(),a=function(e){if(e.data&&"rest_invalid_param"===e.code){var t=Object.values(e.data.params);if(t[0])return t[0]}return(null==e?void 0:e.message)||Object(l.__)("Something went wrong. Please contact us to get assistance.",'woocommerce')}},46:function(e,t){e.exports=window.wp.keycodes},48:function(e,t){e.exports=window.wp.escapeHtml},52:function(e,t,r){"use strict";var n=r(0),c=r(1),o=(r(2),r(48));t.a=function(e){var t,r,i,l=e.error;return Object(n.createElement)("div",{className:"wc-block-error-message"},(r=(t=l).message,i=t.type,r?"general"===i?Object(n.createElement)("span",null,Object(c.__)("The following error was returned",'woocommerce'),Object(n.createElement)("br",null),Object(n.createElement)("code",null,Object(o.escapeHTML)(r))):"api"===i?Object(n.createElement)("span",null,Object(c.__)("The following error was returned from the API",'woocommerce'),Object(n.createElement)("br",null),Object(n.createElement)("code",null,Object(o.escapeHTML)(r))):r:Object(c.__)("An unknown error occurred which prevented the block from being updated.",'woocommerce')))}},55:function(e,t){e.exports=window.wp.hooks},56:function(e,t){e.exports=window.wp.deprecated},583:function(e,t,r){e.exports=r(863)},584:function(e,t){},66:function(e,t,r){"use strict";var n=r(5),c=r.n(n),o=r(16),i=r.n(o),l=r(0),u=["srcElement","size"];function a(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}t.a=function(e){var t=e.srcElement,r=e.size,n=void 0===r?24:r,o=i()(e,u);return Object(l.isValidElement)(t)?Object(l.cloneElement)(t,function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?a(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):a(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({width:n,height:n},o)):null}},7:function(e,t){e.exports=window.lodash},74:function(e,t){e.exports=window.wp.dom},84:function(e,t){e.exports=window.wp.serverSideRender},863:function(e,t,r){"use strict";r.r(t);var n=r(0),c=r(1),o=r(26),i=r(3),l=r(66),u=r(28),a=Object(n.createElement)(u.SVG,{xmlns:"http://www.w3.org/2000/SVG",viewBox:"0 0 24 24"},Object(n.createElement)("path",{fill:"none",d:"M0 0h24v24H0V0z"}),Object(n.createElement)("path",{d:"M16.66 4.52l2.83 2.83-2.83 2.83-2.83-2.83 2.83-2.83M9 5v4H5V5h4m10 10v4h-4v-4h4M9 15v4H5v-4h4m7.66-13.31L11 7.34 16.66 13l5.66-5.66-5.66-5.65zM11 3H3v8h8V3zm10 10h-8v8h8v-8zm-10 0H3v8h8v-8z"})),s=(r(584),r(17)),d=r.n(s),b=r(18),p=r.n(b),g=r(19),f=r.n(g),h=r(20),w=r.n(h),E=r(10),O=r.n(E),j=r(12),m=r(84),y=r.n(m),v=r(4),x=(r(2),r(92)),_=r(5),k=r.n(_),P=r(49),S=r(302),C=r(52);function A(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function T(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?A(Object(r),!0).forEach((function(t){k()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):A(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var B=function(e){var t=e.error,r=e.onChange,o=e.onSearch,i=e.selected,l=e.products,u=e.isLoading,a=e.isCompact,s={clear:Object(c.__)("Clear all products",'woocommerce'),list:Object(c.__)("Products",'woocommerce'),noItems:Object(c.__)("Your store doesn't have any products.",'woocommerce'),search:Object(c.__)("Search for products to display",'woocommerce'),selected:function(e){return Object(c.sprintf)(
/* translators: %d is the number of selected products. */
Object(c._n)("%d product selected","%d products selected",e,'woocommerce'),e)},updated:Object(c.__)("Product search results updated.",'woocommerce')};return t?Object(n.createElement)(C.a,{error:t}):Object(n.createElement)(P.b,{className:"woocommerce-products",list:l.map((function(e){var t=e.sku?" ("+e.sku+")":"";return T(T({},e),{},{name:"".concat(e.name).concat(t)})})),isCompact:a,isLoading:u,selected:l.filter((function(e){var t=e.id;return i.includes(t)})),onSearch:o,onChange:r,messages:s})};B.defaultProps={selected:[],products:[],isCompact:!1,isLoading:!0};var R=Object(S.a)(B),D=r(130),M=r(188);var G=function(e){f()(u,e);var t,r,o=(t=u,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,n=O()(t);if(r){var c=O()(this).constructor;e=Reflect.construct(n,arguments,c)}else e=n.apply(this,arguments);return w()(this,e)});function u(){return d()(this,u),o.apply(this,arguments)}return p()(u,[{key:"getInspectorControls",value:function(){var e=this.props,t=e.attributes,r=e.setAttributes,o=t.columns,l=t.contentVisibility,u=t.orderby,a=t.alignButtons;return Object(n.createElement)(j.InspectorControls,{key:"inspector"},Object(n.createElement)(v.PanelBody,{title:Object(c.__)("Layout",'woocommerce'),initialOpen:!0},Object(n.createElement)(v.RangeControl,{label:Object(c.__)("Columns",'woocommerce'),value:o,onChange:function(e){return r({columns:e})},min:Object(i.getSetting)("min_columns",1),max:Object(i.getSetting)("max_columns",6)}),Object(n.createElement)(v.ToggleControl,{label:Object(c.__)("Align Buttons",'woocommerce'),help:a?Object(c.__)("Buttons are aligned vertically.",'woocommerce'):Object(c.__)("Buttons follow content.",'woocommerce'),checked:a,onChange:function(){return r({alignButtons:!a})}})),Object(n.createElement)(v.PanelBody,{title:Object(c.__)("Content",'woocommerce'),initialOpen:!0},Object(n.createElement)(x.a,{settings:l,onChange:function(e){return r({contentVisibility:e})}})),Object(n.createElement)(v.PanelBody,{title:Object(c.__)("Order By",'woocommerce'),initialOpen:!1},Object(n.createElement)(D.a,{setAttributes:r,value:u})),Object(n.createElement)(v.PanelBody,{title:Object(c.__)("Products",'woocommerce'),initialOpen:!1},Object(n.createElement)(R,{selected:t.products,onChange:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=e.map((function(e){return e.id}));r({products:t})},isCompact:!0})))}},{key:"renderEditMode",value:function(){var e=this.props,t=e.attributes,r=e.debouncedSpeak,o=e.setAttributes;return Object(n.createElement)(v.Placeholder,{icon:Object(n.createElement)(l.a,{srcElement:a}),label:Object(c.__)("Hand-picked Products",'woocommerce'),className:"wc-block-products-grid wc-block-handpicked-products"},Object(c.__)("Display a selection of hand-picked products in a grid.",'woocommerce'),Object(n.createElement)("div",{className:"wc-block-handpicked-products__selection"},Object(n.createElement)(R,{selected:t.products,onChange:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=e.map((function(e){return e.id}));o({products:t})}}),Object(n.createElement)(v.Button,{isPrimary:!0,onClick:function(){o({editMode:!1}),r(Object(c.__)("Showing Hand-picked Products block preview.",'woocommerce'))}},Object(c.__)("Done",'woocommerce'))))}},{key:"render",value:function(){var e=this.props,t=e.attributes,r=e.name,o=e.setAttributes,i=t.editMode;return t.isPreview?M.a:Object(n.createElement)(n.Fragment,null,Object(n.createElement)(j.BlockControls,null,Object(n.createElement)(v.ToolbarGroup,{controls:[{icon:"edit",title:Object(c.__)("Edit"),onClick:function(){return o({editMode:!i})},isActive:i}]})),this.getInspectorControls(),i?this.renderEditMode():Object(n.createElement)(v.Disabled,null,Object(n.createElement)(y.a,{block:r,attributes:t})))}}]),u}(n.Component),H=Object(v.withSpokenMessages)(G);Object(o.registerBlockType)("woocommerce/handpicked-products",{title:Object(c.__)("Hand-picked Products",'woocommerce'),icon:{src:Object(n.createElement)(l.a,{srcElement:a}),foreground:"#96588a"},category:"woocommerce",keywords:[Object(c.__)("Handpicked Products",'woocommerce'),Object(c.__)("WooCommerce",'woocommerce')],description:Object(c.__)("Display a selection of hand-picked products in a grid.",'woocommerce'),supports:{align:["wide","full"],html:!1},example:{attributes:{isPreview:!0}},attributes:{align:{type:"string"},columns:{type:"number",default:Object(i.getSetting)("default_columns",3)},editMode:{type:"boolean",default:!0},contentVisibility:{type:"object",default:{title:!0,price:!0,rating:!0,button:!0}},orderby:{type:"string",default:"date"},products:{type:"array",default:[]},alignButtons:{type:"boolean",default:!1},isPreview:{type:"boolean",default:!1}},edit:function(e){return Object(n.createElement)(H,e)},save:function(){return null}})},87:function(e,t){e.exports=window.ReactDOM},89:function(e,t){e.exports=window.wp.viewport},92:function(e,t,r){"use strict";var n=r(5),c=r.n(n),o=r(0),i=r(1),l=(r(2),r(4));function u(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function a(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?u(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):u(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}t.a=function(e){var t=e.onChange,r=e.settings,n=r.button,c=r.price,u=r.rating,s=r.title;return Object(o.createElement)(o.Fragment,null,Object(o.createElement)(l.ToggleControl,{label:Object(i.__)("Product title",'woocommerce'),help:s?Object(i.__)("Product title is visible.",'woocommerce'):Object(i.__)("Product title is hidden.",'woocommerce'),checked:s,onChange:function(){return t(a(a({},r),{},{title:!s}))}}),Object(o.createElement)(l.ToggleControl,{label:Object(i.__)("Product price",'woocommerce'),help:c?Object(i.__)("Product price is visible.",'woocommerce'):Object(i.__)("Product price is hidden.",'woocommerce'),checked:c,onChange:function(){return t(a(a({},r),{},{price:!c}))}}),Object(o.createElement)(l.ToggleControl,{label:Object(i.__)("Product rating",'woocommerce'),help:u?Object(i.__)("Product rating is visible.",'woocommerce'):Object(i.__)("Product rating is hidden.",'woocommerce'),checked:u,onChange:function(){return t(a(a({},r),{},{rating:!u}))}}),Object(o.createElement)(l.ToggleControl,{label:Object(i.__)("Add to Cart button",'woocommerce'),help:n?Object(i.__)("Add to Cart button is visible.",'woocommerce'):Object(i.__)("Add to Cart button is hidden.",'woocommerce'),checked:n,onChange:function(){return t(a(a({},r),{},{button:!n}))}}))}},96:function(e,t){e.exports=window.wp.date}});woocommerce-blocks/build/product-top-rated.asset.php000064400000000746151335517640016662 0ustar00<?php return array('dependencies' => array('lodash', 'moment', 'react', 'react-dom', 'wc-settings', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-data-controls', 'wp-date', 'wp-deprecated', 'wp-dom', 'wp-element', 'wp-escape-html', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-keycodes', 'wp-polyfill', 'wp-primitives', 'wp-server-side-render', 'wp-url', 'wp-viewport'), 'version' => '643ef3f35a091a78713440ddfabc118d');woocommerce-blocks/build/product-search.asset.php000064400000000344151335517640016222 0ustar00<?php return array('dependencies' => array('wc-settings', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-element', 'wp-i18n', 'wp-polyfill', 'wp-primitives'), 'version' => 'a4d8b0f78ff2b500447193a7723cee2e');woocommerce-blocks/build/mini-cart-frontend.asset.php000064400000000173151335517640016777 0ustar00<?php return array('dependencies' => array('wc-settings', 'wp-polyfill'), 'version' => '340778f9f5c406186eecdd03f42d7dfd');woocommerce-blocks/build/checkout.asset.php000064400000001027151335517640015103 0ustar00<?php return array('dependencies' => array('lodash', 'react', 'wc-blocks-checkout', 'wc-blocks-data-store', 'wc-blocks-registry', 'wc-price-format', 'wc-settings', 'wp-a11y', 'wp-api-fetch', 'wp-autop', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-data', 'wp-deprecated', 'wp-dom', 'wp-element', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-is-shallow-equal', 'wp-keycodes', 'wp-plugins', 'wp-polyfill', 'wp-primitives', 'wp-url', 'wp-warning', 'wp-wordcount'), 'version' => 'a30ee5aaa08bab40df38220c3accb99e');woocommerce-blocks/build/all-products.asset.php000064400000001217151335517640015710 0ustar00<?php return array('dependencies' => array('lodash', 'moment', 'react', 'react-dom', 'wc-blocks-data-store', 'wc-blocks-registry', 'wc-blocks-shared-context', 'wc-blocks-shared-hocs', 'wc-price-format', 'wc-settings', 'wp-a11y', 'wp-api-fetch', 'wp-autop', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-data-controls', 'wp-date', 'wp-deprecated', 'wp-dom', 'wp-element', 'wp-escape-html', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-is-shallow-equal', 'wp-keycodes', 'wp-polyfill', 'wp-primitives', 'wp-url', 'wp-viewport', 'wp-warning', 'wp-wordcount'), 'version' => '90c2a1e8d28242947d631286b5835b1e');woocommerce-blocks/build/product-on-sale.js000064400000070424151335517640015030 0ustar00this.wc=this.wc||{},this.wc.blocks=this.wc.blocks||{},this.wc.blocks["product-on-sale"]=function(e){function t(t){for(var n,i,l=t[0],u=t[1],a=t[2],b=0,d=[];b<l.length;b++)i=l[b],Object.prototype.hasOwnProperty.call(c,i)&&c[i]&&d.push(c[i][0]),c[i]=0;for(n in u)Object.prototype.hasOwnProperty.call(u,n)&&(e[n]=u[n]);for(s&&s(t);d.length;)d.shift()();return o.push.apply(o,a||[]),r()}function r(){for(var e,t=0;t<o.length;t++){for(var r=o[t],n=!0,l=1;l<r.length;l++){var u=r[l];0!==c[u]&&(n=!1)}n&&(o.splice(t--,1),e=i(i.s=r[0]))}return e}var n={},c={32:0},o=[];function i(t){if(n[t])return n[t].exports;var r=n[t]={i:t,l:!1,exports:{}};return e[t].call(r.exports,r,r.exports,i),r.l=!0,r.exports}i.m=e,i.c=n,i.d=function(e,t,r){i.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},i.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.t=function(e,t){if(1&t&&(e=i(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(i.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)i.d(r,n,function(t){return e[t]}.bind(null,n));return r},i.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(t,"a",t),t},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.p="";var l=window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[],u=l.push.bind(l);l.push=t,l=l.slice();for(var a=0;a<l.length;a++)t(l[a]);var s=u;return o.push([762,0]),r()}({0:function(e,t){e.exports=window.wp.element},1:function(e,t){e.exports=window.wp.i18n},107:function(e,t,r){"use strict";r.d(t,"b",(function(){return c}));var n=r(3),c=["woocommerce/product-best-sellers","woocommerce/product-category","woocommerce/product-new","woocommerce/product-on-sale","woocommerce/product-top-rated"];t.a={columns:{type:"number",default:Object(n.getSetting)("default_columns",3)},rows:{type:"number",default:Object(n.getSetting)("default_rows",3)},alignButtons:{type:"boolean",default:!1},categories:{type:"array",default:[]},catOperator:{type:"string",default:"any"},contentVisibility:{type:"object",default:{title:!0,price:!0,rating:!0,button:!0}},isPreview:{type:"boolean",default:!1}}},11:function(e,t){e.exports=window.React},12:function(e,t){e.exports=window.wp.blockEditor},121:function(e,t){},122:function(e,t){e.exports=window.wp.coreData},130:function(e,t,r){"use strict";var n=r(0),c=r(1),o=r(4);r(2),t.a=function(e){var t=e.value,r=e.setAttributes;return Object(n.createElement)(o.SelectControl,{label:Object(c.__)("Order products by",'woocommerce'),value:t,options:[{label:Object(c.__)("Newness - newest first",'woocommerce'),value:"date"},{label:Object(c.__)("Price - low to high",'woocommerce'),value:"price_asc"},{label:Object(c.__)("Price - high to low",'woocommerce'),value:"price_desc"},{label:Object(c.__)("Rating - highest first",'woocommerce'),value:"rating"},{label:Object(c.__)("Sales - most first",'woocommerce'),value:"popularity"},{label:Object(c.__)("Title - alphabetical",'woocommerce'),value:"title"},{label:Object(c.__)("Menu Order",'woocommerce'),value:"menu_order"}],onChange:function(e){return r({orderby:e})}})}},139:function(e,t){},14:function(e,t){e.exports=window.wp.data},15:function(e,t){e.exports=window.wp.apiFetch},188:function(e,t,r){"use strict";r.d(t,"a",(function(){return c}));var n=r(0),c=Object(n.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 230 250",style:{width:"100%"}},Object(n.createElement)("title",null,"Grid Block Preview"),Object(n.createElement)("rect",{width:"65.374",height:"65.374",x:".162",y:".779",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"47.266",height:"5.148",x:"9.216",y:"76.153",fill:"#E1E3E6",rx:"2.574"}),Object(n.createElement)("rect",{width:"62.8",height:"15",x:"1.565",y:"101.448",fill:"#E1E3E6",rx:"5"}),Object(n.createElement)("rect",{width:"65.374",height:"65.374",x:".162",y:"136.277",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"47.266",height:"5.148",x:"9.216",y:"211.651",fill:"#E1E3E6",rx:"2.574"}),Object(n.createElement)("rect",{width:"62.8",height:"15",x:"1.565",y:"236.946",fill:"#E1E3E6",rx:"5"}),Object(n.createElement)("rect",{width:"65.374",height:"65.374",x:"82.478",y:".779",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"47.266",height:"5.148",x:"91.532",y:"76.153",fill:"#E1E3E6",rx:"2.574"}),Object(n.createElement)("rect",{width:"62.8",height:"15",x:"83.882",y:"101.448",fill:"#E1E3E6",rx:"5"}),Object(n.createElement)("rect",{width:"65.374",height:"65.374",x:"82.478",y:"136.277",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"47.266",height:"5.148",x:"91.532",y:"211.651",fill:"#E1E3E6",rx:"2.574"}),Object(n.createElement)("rect",{width:"62.8",height:"15",x:"83.882",y:"236.946",fill:"#E1E3E6",rx:"5"}),Object(n.createElement)("rect",{width:"65.374",height:"65.374",x:"164.788",y:".779",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"47.266",height:"5.148",x:"173.843",y:"76.153",fill:"#E1E3E6",rx:"2.574"}),Object(n.createElement)("rect",{width:"62.8",height:"15",x:"166.192",y:"101.448",fill:"#E1E3E6",rx:"5"}),Object(n.createElement)("rect",{width:"65.374",height:"65.374",x:"164.788",y:"136.277",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"47.266",height:"5.148",x:"173.843",y:"211.651",fill:"#E1E3E6",rx:"2.574"}),Object(n.createElement)("rect",{width:"62.8",height:"15",x:"166.192",y:"236.946",fill:"#E1E3E6",rx:"5"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"13.283",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"21.498",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"29.713",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"37.927",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"46.238",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"95.599",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"103.814",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"112.029",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"120.243",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"128.554",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"177.909",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"186.124",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"194.339",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"202.553",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"210.864",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"13.283",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"21.498",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"29.713",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"37.927",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"46.238",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"95.599",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"103.814",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"112.029",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"120.243",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"128.554",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"177.909",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"186.124",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"194.339",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"202.553",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"210.864",y:"221.798",fill:"#E1E3E6",rx:"3"}))},21:function(e,t){e.exports=window.wp.compose},22:function(e,t){e.exports=window.regeneratorRuntime},23:function(e,t){e.exports=window.wp.url},25:function(e,t){e.exports=window.wp.htmlEntities},26:function(e,t){e.exports=window.wp.blocks},28:function(e,t){e.exports=window.wp.primitives},3:function(e,t){e.exports=window.wc.wcSettings},31:function(e,t){e.exports=window.moment},36:function(e,t){e.exports=window.wp.dataControls},37:function(e,t,r){"use strict";r.d(t,"o",(function(){return o})),r.d(t,"m",(function(){return i})),r.d(t,"l",(function(){return l})),r.d(t,"n",(function(){return u})),r.d(t,"j",(function(){return a})),r.d(t,"e",(function(){return s})),r.d(t,"f",(function(){return b})),r.d(t,"g",(function(){return d})),r.d(t,"k",(function(){return p})),r.d(t,"c",(function(){return g})),r.d(t,"d",(function(){return f})),r.d(t,"h",(function(){return h})),r.d(t,"a",(function(){return w})),r.d(t,"i",(function(){return O})),r.d(t,"b",(function(){return E}));var n,c=r(3),o=Object(c.getSetting)("wcBlocksConfig",{buildPhase:1,pluginUrl:"",productCount:0,defaultAvatar:"",restApiRoutes:{},wordCountType:"words"}),i=o.pluginUrl+"images/",l=o.pluginUrl+"build/",u=o.buildPhase,a=null===(n=c.STORE_PAGES.shop)||void 0===n?void 0:n.permalink,s=c.STORE_PAGES.checkout.id,b=c.STORE_PAGES.checkout.permalink,d=c.STORE_PAGES.privacy.permalink,p=(c.STORE_PAGES.privacy.title,c.STORE_PAGES.terms.permalink),g=(c.STORE_PAGES.terms.title,c.STORE_PAGES.cart.id),f=c.STORE_PAGES.cart.permalink,h=(c.STORE_PAGES.myaccount.permalink?c.STORE_PAGES.myaccount.permalink:Object(c.getSetting)("wpLoginUrl","/wp-login.php"),Object(c.getSetting)("shippingCountries",{})),w=Object(c.getSetting)("allowedCountries",{}),O=Object(c.getSetting)("shippingStates",{}),E=Object(c.getSetting)("allowedStates",{})},39:function(e,t,r){"use strict";r.d(t,"h",(function(){return p})),r.d(t,"e",(function(){return g})),r.d(t,"b",(function(){return f})),r.d(t,"i",(function(){return h})),r.d(t,"f",(function(){return w})),r.d(t,"c",(function(){return O})),r.d(t,"d",(function(){return E})),r.d(t,"g",(function(){return m})),r.d(t,"a",(function(){return j}));var n=r(5),c=r.n(n),o=r(23),i=r(15),l=r.n(i),u=r(7),a=r(3),s=r(37);function b(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function d(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?b(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):b(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var p=function(e){var t=e.selected,r=void 0===t?[]:t,n=e.search,c=void 0===n?"":n,i=e.queryArgs,a=function(e){var t=e.selected,r=void 0===t?[]:t,n=e.search,c=void 0===n?"":n,i=e.queryArgs,l=void 0===i?{}:i,u=s.o.productCount>100,a={per_page:u?100:0,catalog_visibility:"any",search:c,orderby:"title",order:"asc"},b=[Object(o.addQueryArgs)("/wc/store/products",d(d({},a),l))];return u&&r.length&&b.push(Object(o.addQueryArgs)("/wc/store/products",{catalog_visibility:"any",include:r,per_page:0})),b}({selected:r,search:c,queryArgs:void 0===i?{}:i});return Promise.all(a.map((function(e){return l()({path:e})}))).then((function(e){return Object(u.uniqBy)(Object(u.flatten)(e),"id").map((function(e){return d(d({},e),{},{parent:0})}))})).catch((function(e){throw e}))},g=function(e){return l()({path:"/wc/store/products/".concat(e)})},f=function(){return l()({path:"wc/store/products/attributes"})},h=function(e){return l()({path:"wc/store/products/attributes/".concat(e,"/terms")})},w=function(e){var t=e.selected,r=function(e){var t=e.selected,r=void 0===t?[]:t,n=e.search,c=Object(a.getSetting)("limitTags",!1),i=[Object(o.addQueryArgs)("wc/store/products/tags",{per_page:c?100:0,orderby:c?"count":"name",order:c?"desc":"asc",search:n})];return c&&r.length&&i.push(Object(o.addQueryArgs)("wc/store/products/tags",{include:r})),i}({selected:void 0===t?[]:t,search:e.search});return Promise.all(r.map((function(e){return l()({path:e})}))).then((function(e){return Object(u.uniqBy)(Object(u.flatten)(e),"id")}))},O=function(e){return l()({path:Object(o.addQueryArgs)("wc/store/products/categories",d({per_page:0},e))})},E=function(e){return l()({path:"wc/store/products/categories/".concat(e)})},m=function(e){return l()({path:Object(o.addQueryArgs)("wc/store/products",{per_page:0,type:"variation",parent:e})})},j=function(e,t){if(!e.title.raw)return e.slug;var r=1===t.filter((function(t){return t.title.raw===e.title.raw})).length;return e.title.raw+(r?"":" - ".concat(e.slug))}},4:function(e,t){e.exports=window.wp.components},42:function(e,t,r){"use strict";r.d(t,"a",(function(){return u})),r.d(t,"b",(function(){return a}));var n=r(29),c=r.n(n),o=r(22),i=r.n(o),l=r(1),u=function(){var e=c()(i.a.mark((function e(t){var r;return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("function"!=typeof t.json){e.next=11;break}return e.prev=1,e.next=4,t.json();case 4:return r=e.sent,e.abrupt("return",{message:r.message,type:r.type||"api"});case 8:return e.prev=8,e.t0=e.catch(1),e.abrupt("return",{message:e.t0.message,type:"general"});case 11:return e.abrupt("return",{message:t.message,type:t.type||"general"});case 12:case"end":return e.stop()}}),e,null,[[1,8]])})));return function(_x){return e.apply(this,arguments)}}(),a=function(e){if(e.data&&"rest_invalid_param"===e.code){var t=Object.values(e.data.params);if(t[0])return t[0]}return(null==e?void 0:e.message)||Object(l.__)("Something went wrong. Please contact us to get assistance.",'woocommerce')}},46:function(e,t){e.exports=window.wp.keycodes},48:function(e,t){e.exports=window.wp.escapeHtml},52:function(e,t,r){"use strict";var n=r(0),c=r(1),o=(r(2),r(48));t.a=function(e){var t,r,i,l=e.error;return Object(n.createElement)("div",{className:"wc-block-error-message"},(r=(t=l).message,i=t.type,r?"general"===i?Object(n.createElement)("span",null,Object(c.__)("The following error was returned",'woocommerce'),Object(n.createElement)("br",null),Object(n.createElement)("code",null,Object(o.escapeHTML)(r))):"api"===i?Object(n.createElement)("span",null,Object(c.__)("The following error was returned from the API",'woocommerce'),Object(n.createElement)("br",null),Object(n.createElement)("code",null,Object(o.escapeHTML)(r))):r:Object(c.__)("An unknown error occurred which prevented the block from being updated.",'woocommerce')))}},55:function(e,t){e.exports=window.wp.hooks},56:function(e,t){e.exports=window.wp.deprecated},66:function(e,t,r){"use strict";var n=r(5),c=r.n(n),o=r(16),i=r.n(o),l=r(0),u=["srcElement","size"];function a(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}t.a=function(e){var t=e.srcElement,r=e.size,n=void 0===r?24:r,o=i()(e,u);return Object(l.isValidElement)(t)?Object(l.cloneElement)(t,function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?a(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):a(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({width:n,height:n},o)):null}},7:function(e,t){e.exports=window.lodash},74:function(e,t){e.exports=window.wp.dom},762:function(e,t,r){e.exports=r(875)},763:function(e,t){},764:function(e,t,r){"use strict";var n=r(0),c=r(28),o=Object(n.createElement)(c.SVG,{xmlns:"http://www.w3.org/2000/SVG",viewBox:"0 0 24 24"},Object(n.createElement)("path",{fill:"none",d:"M0 0h24v24H0V0z"}),Object(n.createElement)("path",{d:"M21.41 11.58l-9-9C12.05 2.22 11.55 2 11 2H4c-1.1 0-2 .9-2 2v7c0 .55.22 1.05.59 1.42l9 9c.36.36.86.58 1.41.58s1.05-.22 1.41-.59l7-7c.37-.36.59-.86.59-1.41s-.23-1.06-.59-1.42zM13 20.01L4 11V4h7v-.01l9 9-7 7.02z"}),Object(n.createElement)("circle",{cx:"6.5",cy:"6.5",r:"1.5"}),Object(n.createElement)("path",{d:"M8.9 12.55c0 .57.23 1.07.6 1.45l3.5 3.5 3.5-3.5c.37-.37.6-.89.6-1.45 0-1.13-.92-2.05-2.05-2.05-.57 0-1.08.23-1.45.6l-.6.6-.6-.59c-.37-.38-.89-.61-1.45-.61-1.13 0-2.05.92-2.05 2.05z"}));t.a=o},84:function(e,t){e.exports=window.wp.serverSideRender},87:function(e,t){e.exports=window.ReactDOM},875:function(e,t,r){"use strict";r.r(t);var n=r(5),c=r.n(n),o=r(0),i=r(1),l=r(26),u=r(7),a=r(66),s=r(764),b=r(17),d=r.n(b),p=r(18),g=r.n(p),f=r(19),h=r.n(f),w=r(20),O=r.n(w),E=r(10),m=r.n(E),j=r(4),y=r(12),v=r(84),x=r.n(v),_=(r(2),r(92)),k=r(93),P=r(97),S=r(130),C=r(188),R=r(3);var A=function(){return Object(o.createElement)(j.Placeholder,{icon:Object(o.createElement)(a.a,{srcElement:s.a}),label:Object(i.__)("On Sale Products",'woocommerce'),className:"wc-block-product-on-sale"},Object(i.__)("This block shows on-sale products. There are currently no discounted products in your store.",'woocommerce'))},T=function(e){h()(c,e);var t,r,n=(t=c,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,n=m()(t);if(r){var c=m()(this).constructor;e=Reflect.construct(n,arguments,c)}else e=n.apply(this,arguments);return O()(this,e)});function c(){return d()(this,c),n.apply(this,arguments)}return g()(c,[{key:"getInspectorControls",value:function(){var e=this.props,t=e.attributes,r=e.setAttributes,n=t.categories,c=t.catOperator,l=t.columns,u=t.contentVisibility,a=t.rows,s=t.orderby,b=t.alignButtons;return Object(o.createElement)(y.InspectorControls,{key:"inspector"},Object(o.createElement)(j.PanelBody,{title:Object(i.__)("Layout",'woocommerce'),initialOpen:!0},Object(o.createElement)(k.a,{columns:l,rows:a,alignButtons:b,setAttributes:r,minColumns:Object(R.getSetting)("min_columns",1),maxColumns:Object(R.getSetting)("max_columns",6),minRows:Object(R.getSetting)("min_rows",1),maxRows:Object(R.getSetting)("max_rows",6)})),Object(o.createElement)(j.PanelBody,{title:Object(i.__)("Content",'woocommerce'),initialOpen:!0},Object(o.createElement)(_.a,{settings:u,onChange:function(e){return r({contentVisibility:e})}})),Object(o.createElement)(j.PanelBody,{title:Object(i.__)("Order By",'woocommerce'),initialOpen:!1},Object(o.createElement)(S.a,{setAttributes:r,value:s})),Object(o.createElement)(j.PanelBody,{title:Object(i.__)("Filter by Product Category",'woocommerce'),initialOpen:!1},Object(o.createElement)(P.a,{selected:n,onChange:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=e.map((function(e){return e.id}));r({categories:t})},operator:c,onOperatorChange:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"any";return r({catOperator:e})}})))}},{key:"render",value:function(){var e=this.props,t=e.attributes,r=e.name;return t.isPreview?C.a:Object(o.createElement)(o.Fragment,null,this.getInspectorControls(),Object(o.createElement)(j.Disabled,null,Object(o.createElement)(x.a,{block:r,attributes:t,EmptyResponsePlaceholder:A})))}}]),c}(o.Component),B=(r(763),r(107));function D(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function G(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?D(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):D(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}Object(l.registerBlockType)("woocommerce/product-on-sale",{title:Object(i.__)("On Sale Products",'woocommerce'),icon:{src:Object(o.createElement)(a.a,{srcElement:s.a}),foreground:"#96588a"},category:"woocommerce",keywords:[Object(i.__)("WooCommerce",'woocommerce')],description:Object(i.__)("Display a grid of products currently on sale.",'woocommerce'),supports:{align:["wide","full"],html:!1},attributes:G(G({},B.a),{},{orderby:{type:"string",default:"date"}}),example:{attributes:{isPreview:!0}},transforms:{from:[{type:"block",blocks:Object(u.without)(B.b,"woocommerce/product-on-sale"),transform:function(e){return Object(l.createBlock)("woocommerce/product-on-sale",e)}}]},edit:function(e){return Object(o.createElement)(T,e)},save:function(){return null}})},89:function(e,t){e.exports=window.wp.viewport},92:function(e,t,r){"use strict";var n=r(5),c=r.n(n),o=r(0),i=r(1),l=(r(2),r(4));function u(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function a(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?u(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):u(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}t.a=function(e){var t=e.onChange,r=e.settings,n=r.button,c=r.price,u=r.rating,s=r.title;return Object(o.createElement)(o.Fragment,null,Object(o.createElement)(l.ToggleControl,{label:Object(i.__)("Product title",'woocommerce'),help:s?Object(i.__)("Product title is visible.",'woocommerce'):Object(i.__)("Product title is hidden.",'woocommerce'),checked:s,onChange:function(){return t(a(a({},r),{},{title:!s}))}}),Object(o.createElement)(l.ToggleControl,{label:Object(i.__)("Product price",'woocommerce'),help:c?Object(i.__)("Product price is visible.",'woocommerce'):Object(i.__)("Product price is hidden.",'woocommerce'),checked:c,onChange:function(){return t(a(a({},r),{},{price:!c}))}}),Object(o.createElement)(l.ToggleControl,{label:Object(i.__)("Product rating",'woocommerce'),help:u?Object(i.__)("Product rating is visible.",'woocommerce'):Object(i.__)("Product rating is hidden.",'woocommerce'),checked:u,onChange:function(){return t(a(a({},r),{},{rating:!u}))}}),Object(o.createElement)(l.ToggleControl,{label:Object(i.__)("Add to Cart button",'woocommerce'),help:n?Object(i.__)("Add to Cart button is visible.",'woocommerce'):Object(i.__)("Add to Cart button is hidden.",'woocommerce'),checked:n,onChange:function(){return t(a(a({},r),{},{button:!n}))}}))}},93:function(e,t,r){"use strict";var n=r(0),c=r(1),o=r(7),i=(r(2),r(4));t.a=function(e){var t=e.columns,r=e.rows,l=e.setAttributes,u=e.alignButtons,a=e.minColumns,s=void 0===a?1:a,b=e.maxColumns,d=void 0===b?6:b,p=e.minRows,g=void 0===p?1:p,f=e.maxRows,h=void 0===f?6:f;return Object(n.createElement)(n.Fragment,null,Object(n.createElement)(i.RangeControl,{label:Object(c.__)("Columns",'woocommerce'),value:t,onChange:function(e){var t=Object(o.clamp)(e,s,d);l({columns:Number.isNaN(t)?"":t})},min:s,max:d}),Object(n.createElement)(i.RangeControl,{label:Object(c.__)("Rows",'woocommerce'),value:r,onChange:function(e){var t=Object(o.clamp)(e,g,h);l({rows:Number.isNaN(t)?"":t})},min:g,max:h}),Object(n.createElement)(i.ToggleControl,{label:Object(c.__)("Align Last Block",'woocommerce'),help:u?Object(c.__)("The last inner block will be aligned vertically.",'woocommerce'):Object(c.__)("The last inner block will follow other content.",'woocommerce'),checked:u,onChange:function(){return l({alignButtons:!u})}}))}},96:function(e,t){e.exports=window.wp.date},97:function(e,t,r){"use strict";var n=r(9),c=r.n(n),o=r(0),i=r(1),l=(r(2),r(49)),u=r(4),a=r(29),s=r.n(a),b=r(17),d=r.n(b),p=r(18),g=r.n(p),f=r(13),h=r.n(f),w=r(19),O=r.n(w),E=r(20),m=r.n(E),j=r(10),y=r.n(j),v=r(22),x=r.n(v),_=r(21),k=r(39),P=r(42);var S=Object(_.createHigherOrderComponent)((function(e){return function(t){O()(l,t);var r,n,i=(r=l,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=y()(r);if(n){var c=y()(this).constructor;e=Reflect.construct(t,arguments,c)}else e=t.apply(this,arguments);return m()(this,e)});function l(){var e;return d()(this,l),(e=i.apply(this,arguments)).state={error:null,loading:!1,categories:[]},e.loadCategories=e.loadCategories.bind(h()(e)),e}return g()(l,[{key:"componentDidMount",value:function(){this.loadCategories()}},{key:"loadCategories",value:function(){var e=this;this.setState({loading:!0}),Object(k.c)().then((function(t){e.setState({categories:t,loading:!1,error:null})})).catch(function(){var t=s()(x.a.mark((function t(r){var n;return x.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,Object(P.a)(r);case 2:n=t.sent,e.setState({categories:[],loading:!1,error:n});case 4:case"end":return t.stop()}}),t)})));return function(_x){return t.apply(this,arguments)}}())}},{key:"render",value:function(){var t=this.state,r=t.error,n=t.loading,i=t.categories;return Object(o.createElement)(e,c()({},this.props,{error:r,isLoading:n,categories:i}))}}]),l}(o.Component)}),"withCategories"),C=r(52),R=r(6),A=r.n(R),T=(r(139),function(e){var t=e.categories,r=e.error,n=e.isLoading,a=e.onChange,s=e.onOperatorChange,b=e.operator,d=e.selected,p=e.isCompact,g=e.isSingle,f=e.showReviewCount,h={clear:Object(i.__)("Clear all product categories",'woocommerce'),list:Object(i.__)("Product Categories",'woocommerce'),noItems:Object(i.__)("Your store doesn't have any product categories.",'woocommerce'),search:Object(i.__)("Search for product categories",'woocommerce'),selected:function(e){return Object(i.sprintf)(
/* translators: %d is the count of selected categories. */
Object(i._n)("%d category selected","%d categories selected",e,'woocommerce'),e)},updated:Object(i.__)("Category search results updated.",'woocommerce')};return r?Object(o.createElement)(C.a,{error:r}):Object(o.createElement)(o.Fragment,null,Object(o.createElement)(l.b,{className:"woocommerce-product-categories",list:t,isLoading:n,selected:d.map((function(e){return t.find((function(t){return t.id===e}))})).filter(Boolean),onChange:a,renderItem:function(e){var t=e.item,r=e.search,n=e.depth,u=void 0===n?0:n,a=t.breadcrumbs.length?"".concat(t.breadcrumbs.join(", "),", ").concat(t.name):t.name,s=f?Object(i.sprintf)(
/* translators: %1$s is the item name, %2$d is the count of reviews for the item. */
Object(i._n)("%1$s, has %2$d review","%1$s, has %2$d reviews",t.review_count,'woocommerce'),a,t.review_count):Object(i.sprintf)(
/* translators: %1$s is the item name, %2$d is the count of products for the item. */
Object(i._n)("%1$s, has %2$d product","%1$s, has %2$d products",t.count,'woocommerce'),a,t.count),b=f?Object(i.sprintf)(
/* translators: %d is the count of reviews. */
Object(i._n)("%d review","%d reviews",t.review_count,'woocommerce'),t.review_count):Object(i.sprintf)(
/* translators: %d is the count of products. */
Object(i._n)("%d product","%d products",t.count,'woocommerce'),t.count);return Object(o.createElement)(l.c,c()({className:A()("woocommerce-product-categories__item","has-count",{"is-searching":r.length>0,"is-skip-level":0===u&&0!==t.parent})},e,{countLabel:b,"aria-label":s}))},messages:h,isCompact:p,isHierarchical:!0,isSingle:g}),!!s&&Object(o.createElement)("div",{hidden:d.length<2},Object(o.createElement)(u.SelectControl,{className:"woocommerce-product-categories__operator",label:Object(i.__)("Display products matching",'woocommerce'),help:Object(i.__)("Pick at least two categories to use this setting.",'woocommerce'),value:b,onChange:s,options:[{label:Object(i.__)("Any selected categories",'woocommerce'),value:"any"},{label:Object(i.__)("All selected categories",'woocommerce'),value:"all"}]})))});T.defaultProps={operator:"any",isCompact:!1,isSingle:!1},t.a=S(T)}});woocommerce-blocks/build/wc-blocks-shared-hocs.asset.php000064400000000246151335517640017362 0ustar00<?php return array('dependencies' => array('wc-blocks-shared-context', 'wp-api-fetch', 'wp-element', 'wp-polyfill'), 'version' => '898d2de3bee84bf57b5759e93fc551c0');woocommerce-blocks/build/wc-blocks-data.js000064400000123600151335517640014602 0ustar00this.wc=this.wc||{},this.wc.wcBlocksData=function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=161)}({1:function(e,t){e.exports=function(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e},e.exports.default=e.exports,e.exports.__esModule=!0},10:function(e,t){e.exports=window.wp.data},12:function(e,t,r){var n=r(20),o=r(21),a=r(18),c=r(22);e.exports=function(e,t){return n(e)||o(e,t)||a(e,t)||c()},e.exports.default=e.exports,e.exports.__esModule=!0},13:function(e,t){e.exports=window.wp.apiFetch},14:function(e,t,r){"use strict";r.d(t,"c",(function(){return o})),r.d(t,"a",(function(){return a})),r.d(t,"b",(function(){return c}));var n=r(2),o="wc/store/cart",a={code:"cart_api_error",message:Object(n.__)("Unable to get cart data from the API.",'woocommerce'),data:{status:500}},c="wc-blocks_cart_update_timestamp"},143:function(e,t){e.exports=window.wp.notices},144:function(e,t,r){var n=r(19);e.exports=function(e){if(Array.isArray(e))return n(e)},e.exports.default=e.exports,e.exports.__esModule=!0},145:function(e,t){e.exports=function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)},e.exports.default=e.exports,e.exports.__esModule=!0},146:function(e,t){e.exports=function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},e.exports.default=e.exports,e.exports.__esModule=!0},147:function(e,t,r){(function(e){var n=void 0!==e&&e||"undefined"!=typeof self&&self||window,o=Function.prototype.apply;function a(e,t){this._id=e,this._clearFn=t}t.setTimeout=function(){return new a(o.call(setTimeout,n,arguments),clearTimeout)},t.setInterval=function(){return new a(o.call(setInterval,n,arguments),clearInterval)},t.clearTimeout=t.clearInterval=function(e){e&&e.close()},a.prototype.unref=a.prototype.ref=function(){},a.prototype.close=function(){this._clearFn.call(n,this._id)},t.enroll=function(e,t){clearTimeout(e._idleTimeoutId),e._idleTimeout=t},t.unenroll=function(e){clearTimeout(e._idleTimeoutId),e._idleTimeout=-1},t._unrefActive=t.active=function(e){clearTimeout(e._idleTimeoutId);var t=e._idleTimeout;t>=0&&(e._idleTimeoutId=setTimeout((function(){e._onTimeout&&e._onTimeout()}),t))},r(148),t.setImmediate="undefined"!=typeof self&&self.setImmediate||void 0!==e&&e.setImmediate||this&&this.setImmediate,t.clearImmediate="undefined"!=typeof self&&self.clearImmediate||void 0!==e&&e.clearImmediate||this&&this.clearImmediate}).call(this,r(39))},148:function(e,t,r){(function(e,t){!function(e,r){"use strict";if(!e.setImmediate){var n,o,a,c,u,i=1,s={},f=!1,l=e.document,p=Object.getPrototypeOf&&Object.getPrototypeOf(e);p=p&&p.setTimeout?p:e,"[object process]"==={}.toString.call(e.process)?n=function(e){t.nextTick((function(){h(e)}))}:function(){if(e.postMessage&&!e.importScripts){var t=!0,r=e.onmessage;return e.onmessage=function(){t=!1},e.postMessage("","*"),e.onmessage=r,t}}()?(c="setImmediate$"+Math.random()+"$",u=function(t){t.source===e&&"string"==typeof t.data&&0===t.data.indexOf(c)&&h(+t.data.slice(c.length))},e.addEventListener?e.addEventListener("message",u,!1):e.attachEvent("onmessage",u),n=function(t){e.postMessage(c+t,"*")}):e.MessageChannel?((a=new MessageChannel).port1.onmessage=function(e){h(e.data)},n=function(e){a.port2.postMessage(e)}):l&&"onreadystatechange"in l.createElement("script")?(o=l.documentElement,n=function(e){var t=l.createElement("script");t.onreadystatechange=function(){h(e),t.onreadystatechange=null,o.removeChild(t),t=null},o.appendChild(t)}):n=function(e){setTimeout(h,0,e)},p.setImmediate=function(e){"function"!=typeof e&&(e=new Function(""+e));for(var t=new Array(arguments.length-1),r=0;r<t.length;r++)t[r]=arguments[r+1];var o={callback:e,args:t};return s[i]=o,n(i),i++},p.clearImmediate=d}function d(e){delete s[e]}function h(e){if(f)setTimeout(h,0,e);else{var t=s[e];if(t){f=!0;try{!function(e){var t=e.callback,r=e.args;switch(r.length){case 0:t();break;case 1:t(r[0]);break;case 2:t(r[0],r[1]);break;case 3:t(r[0],r[1],r[2]);break;default:t.apply(void 0,r)}}(t)}finally{d(e),f=!1}}}}}("undefined"==typeof self?void 0===e?this:e:self)}).call(this,r(39),r(31))},161:function(e,t,r){"use strict";r.r(t),r.d(t,"SCHEMA_STORE_KEY",(function(){return W})),r.d(t,"COLLECTIONS_STORE_KEY",(function(){return Ue})),r.d(t,"CART_STORE_KEY",(function(){return Ht})),r.d(t,"QUERY_STATE_STORE_KEY",(function(){return Zt})),r.d(t,"API_BLOCK_NAMESPACE",(function(){return C})),r.d(t,"EMPTY_CART_COUPONS",(function(){return P})),r.d(t,"EMPTY_CART_ITEMS",(function(){return S})),r.d(t,"EMPTY_CART_FEES",(function(){return R})),r.d(t,"EMPTY_CART_ITEM_ERRORS",(function(){return j})),r.d(t,"EMPTY_CART_ERRORS",(function(){return I})),r.d(t,"EMPTY_SHIPPING_RATES",(function(){return D})),r.d(t,"EMPTY_PAYMENT_REQUIREMENTS",(function(){return A})),r.d(t,"EMPTY_EXTENSIONS",(function(){return k})),r.d(t,"EMPTY_TAX_LINES",(function(){return M}));var n={};r.r(n),r.d(n,"getRoute",(function(){return O})),r.d(n,"getRoutes",(function(){return w}));var o={};r.r(o),r.d(o,"receiveRoutes",(function(){return N}));var a={};r.r(a),r.d(a,"getRoute",(function(){return G})),r.d(a,"getRoutes",(function(){return Y}));var c={};r.r(c),r.d(c,"getCollection",(function(){return oe})),r.d(c,"getCollectionError",(function(){return ae})),r.d(c,"getCollectionHeader",(function(){return ce})),r.d(c,"getCollectionLastModified",(function(){return ue}));var u={};r.r(u),r.d(u,"receiveCollection",(function(){return se})),r.d(u,"receiveCollectionError",(function(){return fe})),r.d(u,"receiveLastModified",(function(){return le}));var i={};r.r(i),r.d(i,"getCollection",(function(){return ke})),r.d(i,"getCollectionHeader",(function(){return Me}));var s={};r.r(s),r.d(s,"getCartData",(function(){return Ke})),r.d(s,"getCartTotals",(function(){return Qe})),r.d(s,"getCartMeta",(function(){return He})),r.d(s,"getCartErrors",(function(){return qe})),r.d(s,"isApplyingCoupon",(function(){return Be})),r.d(s,"isCartDataStale",(function(){return ze})),r.d(s,"getCouponBeingApplied",(function(){return Je})),r.d(s,"isRemovingCoupon",(function(){return We})),r.d(s,"getCouponBeingRemoved",(function(){return $e})),r.d(s,"getCartItem",(function(){return Xe})),r.d(s,"isItemPendingQuantity",(function(){return Ze})),r.d(s,"isItemPendingDelete",(function(){return et})),r.d(s,"isCustomerDataUpdating",(function(){return tt})),r.d(s,"isShippingRateBeingSelected",(function(){return rt}));var f={};r.r(f),r.d(f,"receiveCart",(function(){return lt})),r.d(f,"receiveError",(function(){return pt})),r.d(f,"receiveApplyingCoupon",(function(){return dt})),r.d(f,"receiveRemovingCoupon",(function(){return ht})),r.d(f,"receiveCartItem",(function(){return mt})),r.d(f,"itemIsPendingQuantity",(function(){return vt})),r.d(f,"itemIsPendingDelete",(function(){return yt})),r.d(f,"setIsCartDataStale",(function(){return bt})),r.d(f,"updatingCustomerData",(function(){return gt})),r.d(f,"shippingRatesBeingSelected",(function(){return _t})),r.d(f,"updateCartFragments",(function(){return Et})),r.d(f,"triggerAddingToCartEvent",(function(){return Ot})),r.d(f,"triggerAddedToCartEvent",(function(){return wt})),r.d(f,"applyExtensionCartUpdate",(function(){return xt})),r.d(f,"applyCoupon",(function(){return Tt})),r.d(f,"removeCoupon",(function(){return Ct})),r.d(f,"addItemToCart",(function(){return Pt})),r.d(f,"removeItemFromCart",(function(){return St})),r.d(f,"changeCartItemQuantity",(function(){return Rt})),r.d(f,"selectShippingRate",(function(){return jt})),r.d(f,"updateCustomerData",(function(){return It}));var l={};r.r(l),r.d(l,"getCartData",(function(){return kt})),r.d(l,"getCartTotals",(function(){return Mt}));var p={};r.r(p),r.d(p,"getValueForQueryKey",(function(){return Bt})),r.d(p,"getValueForQueryContext",(function(){return zt}));var d={};r.r(d),r.d(d,"setQueryValue",(function(){return Jt})),r.d(d,"setValueForQueryContext",(function(){return Wt})),r(143);var h=r(10),m=r(8),v="wc/store/schema",y=r(12),b=r.n(y),g=r(30),_=r.n(g),E=r(2),O=Object(h.createRegistrySelector)((function(e){return function(t,r,n){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],a=e(v).hasFinishedResolution("getRoutes",[r]),c="";if((t=t.routes)[r]?t[r][n]||(c=Object(E.sprintf)("There is no route for the given resource name (%s) in the store",n)):c=Object(E.sprintf)("There is no route for the given namespace (%s) in the store",r),""!==c){if(a)throw new Error(c);return""}var u=x(t[r][n],o);if(""===u&&a)throw new Error(Object(E.sprintf)("While there is a route for the given namespace (%1$s) and resource name (%2$s), there is no route utilizing the number of ids you included in the select arguments. The available routes are: (%3$s)",r,n,JSON.stringify(t[r][n])));return u}})),w=Object(h.createRegistrySelector)((function(e){return function(t,r){var n=e(v).hasFinishedResolution("getRoutes",[r]),o=t.routes[r];if(!o){if(n)throw new Error(Object(E.sprintf)("There is no route for the given namespace (%s) in the store",r));return[]}var a=[];for(var c in o)a=[].concat(_()(a),_()(Object.keys(o[c])));return a}})),x=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=(e=Object.entries(e)).find((function(e){var r=b()(e,2)[1];return t.length===r.length})),n=r||[],o=b()(n,2),a=o[0],c=o[1];return a?0===t.length?a:T(a,c,t):""},T=function(e,t,r){return t.forEach((function(t,n){e=e.replace("{".concat(t,"}"),r[n])})),e},C="wc/blocks",P=[],S=[],R=[],j=[],I=[],D=[],A=[],k={},M=[];function N(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:C;return{type:"RECEIVE_MODEL_ROUTES",routes:e,namespace:t}}var L=r(3),F=r.n(L),V=F.a.mark(G),U=F.a.mark(Y);function G(e){return F.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,Object(m.select)(v,"getRoutes",e);case 2:case"end":return t.stop()}}),V)}function Y(e){var t,r;return F.a.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,Object(m.apiFetch)({path:e});case 2:return t=n.sent,r=t&&t.routes?Object.keys(t.routes):[],n.next=6,N(r,e);case 6:case"end":return n.stop()}}),U)}var K=function(e,t){return(t=t.replace("".concat(e,"/"),"")).replace(/\/\(\?P\<[a-z_]*\>\[\\*[a-z]\]\+\)/g,"")},Q=function(e){var t=e.match(/\<[a-z_]*\>/g);return Array.isArray(t)&&0!==t.length?t.map((function(e){return e.replace(/<|>/g,"")})):[]},H=function(e,t){return Array.isArray(t)&&0!==t.length?(t.forEach((function(t){var r="\\(\\?P<".concat(t,">.*?\\)");e=e.replace(new RegExp(r),"{".concat(t,"}"))})),e):e},q=r(4);function B(e,t){return Object(q.has)(e,t)}function z(e,t,r){return Object(q.setWith)(Object(q.clone)(e),t,r,q.clone)}var J=Object(h.combineReducers)({routes:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,r=t.type,n=t.routes,o=t.namespace;return"RECEIVE_MODEL_ROUTES"===r&&n.forEach((function(t){var r=K(o,t);if(r&&r!==o){var n=Q(t),a=H(t,n);B(e,[o,r,a])||(e=z(e,[o,r,a],n))}})),e}});Object(h.registerStore)(v,{reducer:J,actions:o,controls:m.controls,selectors:n,resolvers:a});var W=v,$=r(1),X=r.n($),Z="wc/store/collections",ee=[],te=r(32),re=function(e){var t=e.state,r=e.namespace,n=e.resourceName,o=e.query,a=e.ids,c=e.type,u=void 0===c?"items":c,i=e.fallback,s=void 0===i?ee:i;return B(t,[r,n,a=JSON.stringify(a),o=null!==o?Object(te.addQueryArgs)("",o):"",u])?t[r][n][a][o][u]:s},ne=function(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:ee;return re({state:e,namespace:t,resourceName:r,query:n,ids:o,type:"headers",fallback:void 0})},oe=function(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:ee;return re({state:e,namespace:t,resourceName:r,query:n,ids:o})},ae=function(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:ee;return re({state:e,namespace:t,resourceName:r,query:n,ids:o,type:"error",fallback:null})},ce=function(e,t,r,n){var o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null,a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:ee,c=ne(e,r,n,o,a);return c&&c.get?c.has(t)?c.get(t):void 0:null},ue=function(e){return e.lastModified||0},ie=window.Headers||null;function se(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{items:[],headers:ie},a=arguments.length>5&&void 0!==arguments[5]&&arguments[5];return{type:a?"RESET_COLLECTION":"RECEIVE_COLLECTION",namespace:e,resourceName:t,queryString:r,ids:n,response:o}}function fe(e,t,r,n,o){return{type:"ERROR",namespace:e,resourceName:t,queryString:r,ids:n,response:{items:[],headers:ie,error:o}}}function le(e){return{type:"RECEIVE_LAST_MODIFIED",timestamp:e}}ie=ie?new ie:{get:function(){},has:function(){}};var pe=r(29),de=r.n(pe),he=r(13),me=r.n(he),ve=r(42),ye=r.n(ve),be=r(7),ge=r(6),_e=r.n(ge);function Ee(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Oe(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Ee(Object(r),!0).forEach((function(t){X()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ee(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var we=function(e){return{type:"API_FETCH_WITH_HEADERS",options:e}},xe={},Te={code:"invalid_json",message:Object(E.__)("The response is not a valid JSON response.",'woocommerce')},Ce=function(e){me.a.setNonce&&"function"==typeof me.a.setNonce?me.a.setNonce(e):console.error('The monkey patched function on APIFetch, "setNonce", is not present, likely another plugin or some other code has removed this augmentation')},Pe=new ye.a((function(e){return me()({path:"/wc/store/batch",method:"POST",data:{requests:e.map((function(e){return Oe(Oe({},e),{},{body:null==e?void 0:e.data})}))}}).then((function(t){return function(e){if("object"!==_e()(e)||null===e||!e.hasOwnProperty("responses"))throw new Error("Response not valid")}(t),e.map((function(e,r){return t.responses[r]||xe}))}))}),{batchScheduleFn:function(e){return setTimeout(e,300)},cache:!1,maxBatchSize:25}),Se=function(){var e=de()(F.a.mark((function e(t){return F.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Pe.load(t);case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e)})));return function(_x){return e.apply(this,arguments)}}(),Re={API_FETCH_WITH_HEADERS:function(e){var t=e.options;return new Promise((function(e,r){!t.method||"GET"===t.method||Object(be.isWpVersion)("5.6","<")?me()(Oe(Oe({},t),{},{parse:!1})).then((function(t){t.json().then((function(r){e({response:r,headers:t.headers}),Ce(t.headers)})).catch((function(){r(Te)}))})).catch((function(e){Ce(e.headers),"function"==typeof e.json?e.json().then((function(e){r(e)})).catch((function(){r(Te)})):r(e.message)})):Se(t).then((function(t){throw function(e){if("object"!==_e()(e)||null===e||!e.hasOwnProperty("body")||!e.hasOwnProperty("headers"))throw new Error("Response not valid")}(t),t.status>=200&&t.status<300&&(e({response:t.body,headers:t.headers}),Ce(t.headers)),t})).catch((function(e){e.headers&&Ce(e.headers),e.body?r(e.body):r()}))}))}},je=F.a.mark(Ae),Ie=F.a.mark(ke),De=F.a.mark(Me);function Ae(e){var t;return F.a.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,Object(m.select)(Z,"getCollectionLastModified");case 2:if(t=r.sent){r.next=8;break}return r.next=6,Object(m.dispatch)(Z,"receiveLastModified",e);case 6:r.next=13;break;case 8:if(!(e>t)){r.next=13;break}return r.next=11,Object(m.dispatch)(Z,"invalidateResolutionForStore");case 11:return r.next=13,Object(m.dispatch)(Z,"receiveLastModified",e);case 13:case"end":return r.stop()}}),je)}function ke(e,t,r,n){var o,a,c,u,i,s;return F.a.wrap((function(f){for(;;)switch(f.prev=f.next){case 0:return f.next=2,Object(m.select)(v,"getRoute",e,t,n);case 2:if(o=f.sent,a=Object(te.addQueryArgs)("",r),o){f.next=8;break}return f.next=7,se(e,t,a,n);case 7:return f.abrupt("return");case 8:return f.prev=8,f.next=11,we({path:o+a});case 11:if(c=f.sent,u=c.response,i=void 0===u?ee:u,!((s=c.headers)&&s.get&&s.has("last-modified"))){f.next=18;break}return f.next=18,Ae(parseInt(s.get("last-modified"),10));case 18:return f.next=20,se(e,t,a,n,{items:i,headers:s});case 20:f.next=26;break;case 22:return f.prev=22,f.t0=f.catch(8),f.next=26,fe(e,t,a,n,f.t0);case 26:case"end":return f.stop()}}),Ie,null,[[8,22]])}function Me(e,t,r,n,o){var a;return F.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=[t,r,n,o].filter((function(e){return void 0!==e})),e.next=3,m.select.apply(void 0,[Z,"getCollection"].concat(_()(a)));case 3:case"end":return e.stop()}}),De)}function Ne(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Le(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Ne(Object(r),!0).forEach((function(t){X()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ne(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Fe(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Ve(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Fe(Object(r),!0).forEach((function(t){X()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Fe(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}Object(h.registerStore)(Z,{reducer:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;if("RECEIVE_LAST_MODIFIED"===t.type)return t.timestamp===e.lastModified?e:Le(Le({},e),{},{lastModified:t.timestamp});if("INVALIDATE_RESOLUTION_FOR_STORE"===t.type)return{};var r=t.type,n=t.namespace,o=t.resourceName,a=t.queryString,c=t.response,u=t.ids?JSON.stringify(t.ids):"[]";switch(r){case"RECEIVE_COLLECTION":if(B(e,[n,o,u,a]))return e;e=z(e,[n,o,u,a],c);break;case"RESET_COLLECTION":case"ERROR":e=z(e,[n,o,u,a],c)}return e},actions:u,controls:Ve(Ve({},m.controls),Re),selectors:c,resolvers:i});var Ue=Z,Ge=r(14),Ye={cartItemsPendingQuantity:[],cartItemsPendingDelete:[],cartData:{coupons:P,shippingRates:D,shippingAddress:{first_name:"",last_name:"",company:"",address_1:"",address_2:"",city:"",state:"",postcode:"",country:"",phone:""},billingAddress:{first_name:"",last_name:"",company:"",address_1:"",address_2:"",city:"",state:"",postcode:"",country:"",phone:"",email:""},items:S,itemsCount:0,itemsWeight:0,needsShipping:!0,needsPayment:!1,hasCalculatedShipping:!0,fees:R,totals:{currency_code:"",currency_symbol:"",currency_minor_unit:2,currency_decimal_separator:".",currency_thousand_separator:",",currency_prefix:"",currency_suffix:"",total_items:"0",total_items_tax:"0",total_fees:"0",total_fees_tax:"0",total_discount:"0",total_discount_tax:"0",total_shipping:"0",total_shipping_tax:"0",total_price:"0",total_tax:"0",tax_lines:M},errors:j,paymentRequirements:A,extensions:k},metaData:{updatingCustomerData:!1,updatingSelectedRate:!1,applyingCoupon:"",removingCoupon:"",isCartDataStale:!1},errors:I},Ke=function(e){return e.cartData},Qe=function(e){return e.cartData.totals||Ye.cartData.totals},He=function(e){return e.metaData||Ye.metaData},qe=function(e){return e.errors},Be=function(e){return!!e.metaData.applyingCoupon},ze=function(e){return e.metaData.isCartDataStale},Je=function(e){return e.metaData.applyingCoupon||""},We=function(e){return!!e.metaData.removingCoupon},$e=function(e){return e.metaData.removingCoupon||""},Xe=function(e,t){return e.cartData.items.find((function(e){return e.key===t}))},Ze=function(e,t){return e.cartItemsPendingQuantity.includes(t)},et=function(e,t){return e.cartItemsPendingDelete.includes(t)},tt=function(e){return!!e.metaData.updatingCustomerData},rt=function(e){return!!e.metaData.updatingSelectedRate},nt=F.a.mark(xt),ot=F.a.mark(Tt),at=F.a.mark(Ct),ct=F.a.mark(Pt),ut=F.a.mark(St),it=F.a.mark(Rt),st=F.a.mark(jt),ft=F.a.mark(It),lt=function(e){return{type:"RECEIVE_CART",response:Object(q.mapKeys)(e,(function(e,t){return Object(q.camelCase)(t)}))}},pt=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return{type:t?"REPLACE_ERRORS":"RECEIVE_ERROR",error:e}},dt=function(e){return{type:"APPLYING_COUPON",couponCode:e}},ht=function(e){return{type:"REMOVING_COUPON",couponCode:e}},mt=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return{type:"RECEIVE_CART_ITEM",cartItem:e}},vt=function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return{type:"ITEM_PENDING_QUANTITY",cartItemKey:e,isPendingQuantity:t}},yt=function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return{type:"RECEIVE_REMOVED_ITEM",cartItemKey:e,isPendingDelete:t}},bt=function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return{type:"SET_IS_CART_DATA_STALE",isCartDataStale:e}},gt=function(e){return{type:"UPDATING_CUSTOMER_DATA",isResolving:e}},_t=function(e){return{type:"UPDATING_SELECTED_SHIPPING_RATE",isResolving:e}},Et=function(){return{type:"UPDATE_LEGACY_CART_FRAGMENTS"}},Ot=function(){return{type:"TRIGGER_ADDING_TO_CART_EVENT"}},wt=function(e){return{type:"TRIGGER_ADDED_TO_CART_EVENT",preserveCartData:e.preserveCartData}};function xt(e){var t,r,n;return F.a.wrap((function(o){for(;;)switch(o.prev=o.next){case 0:return o.prev=0,o.next=3,we({path:"/wc/store/cart/extensions",method:"POST",data:{namespace:e.namespace,data:e.data},cache:"no-store"});case 3:return t=o.sent,r=t.response,o.next=7,lt(r);case 7:return o.next=9,Et();case 9:return o.abrupt("return",r);case 12:return o.prev=12,o.t0=o.catch(0),o.next=16,pt(o.t0);case 16:if(null===(n=o.t0.data)||void 0===n||!n.cart){o.next=19;break}return o.next=19,lt(o.t0.data.cart);case 19:throw o.t0;case 20:case"end":return o.stop()}}),nt,null,[[0,12]])}function Tt(e){var t,r,n;return F.a.wrap((function(o){for(;;)switch(o.prev=o.next){case 0:return o.next=2,dt(e);case 2:return o.prev=2,o.next=5,we({path:"/wc/store/cart/apply-coupon",method:"POST",data:{code:e},cache:"no-store"});case 5:return t=o.sent,r=t.response,o.next=9,lt(r);case 9:return o.next=11,dt("");case 11:return o.next=13,Et();case 13:o.next=25;break;case 15:return o.prev=15,o.t0=o.catch(2),o.next=19,pt(o.t0);case 19:return o.next=21,dt("");case 21:if(null===(n=o.t0.data)||void 0===n||!n.cart){o.next=24;break}return o.next=24,lt(o.t0.data.cart);case 24:throw o.t0;case 25:return o.abrupt("return",!0);case 26:case"end":return o.stop()}}),ot,null,[[2,15]])}function Ct(e){var t,r,n;return F.a.wrap((function(o){for(;;)switch(o.prev=o.next){case 0:return o.next=2,ht(e);case 2:return o.prev=2,o.next=5,we({path:"/wc/store/cart/remove-coupon",method:"POST",data:{code:e},cache:"no-store"});case 5:return t=o.sent,r=t.response,o.next=9,lt(r);case 9:return o.next=11,ht("");case 11:return o.next=13,Et();case 13:o.next=25;break;case 15:return o.prev=15,o.t0=o.catch(2),o.next=19,pt(o.t0);case 19:return o.next=21,ht("");case 21:if(null===(n=o.t0.data)||void 0===n||!n.cart){o.next=24;break}return o.next=24,lt(o.t0.data.cart);case 24:throw o.t0;case 25:return o.abrupt("return",!0);case 26:case"end":return o.stop()}}),at,null,[[2,15]])}function Pt(e){var t,r,n,o,a=arguments;return F.a.wrap((function(c){for(;;)switch(c.prev=c.next){case 0:return t=a.length>1&&void 0!==a[1]?a[1]:1,c.prev=1,c.next=4,Ot();case 4:return c.next=6,we({path:"/wc/store/cart/add-item",method:"POST",data:{id:e,quantity:t},cache:"no-store"});case 6:return r=c.sent,n=r.response,c.next=10,lt(n);case 10:return c.next=12,wt({preserveCartData:!0});case 12:return c.next=14,Et();case 14:c.next=24;break;case 16:return c.prev=16,c.t0=c.catch(1),c.next=20,pt(c.t0);case 20:if(null===(o=c.t0.data)||void 0===o||!o.cart){c.next=23;break}return c.next=23,lt(c.t0.data.cart);case 23:throw c.t0;case 24:case"end":return c.stop()}}),ct,null,[[1,16]])}function St(e){var t,r,n;return F.a.wrap((function(o){for(;;)switch(o.prev=o.next){case 0:return o.next=2,yt(e);case 2:return o.prev=2,o.next=5,we({path:"/wc/store/cart/remove-item",data:{key:e},method:"POST",cache:"no-store"});case 5:return t=o.sent,r=t.response,o.next=9,lt(r);case 9:return o.next=11,Et();case 11:o.next=20;break;case 13:return o.prev=13,o.t0=o.catch(2),o.next=17,pt(o.t0);case 17:if(null===(n=o.t0.data)||void 0===n||!n.cart){o.next=20;break}return o.next=20,lt(o.t0.data.cart);case 20:return o.next=22,yt(e,!1);case 22:case"end":return o.stop()}}),ut,null,[[2,13]])}function Rt(e,t){var r,n,o,a;return F.a.wrap((function(c){for(;;)switch(c.prev=c.next){case 0:return c.next=2,Object(m.select)(Ge.c,"getCartItem",e);case 2:return r=c.sent,c.next=5,vt(e);case 5:if((null==r?void 0:r.quantity)!==t){c.next=7;break}return c.abrupt("return");case 7:return c.prev=7,c.next=10,we({path:"/wc/store/cart/update-item",method:"POST",data:{key:e,quantity:t},cache:"no-store"});case 10:return n=c.sent,o=n.response,c.next=14,lt(o);case 14:return c.next=16,Et();case 16:c.next=25;break;case 18:return c.prev=18,c.t0=c.catch(7),c.next=22,pt(c.t0);case 22:if(null===(a=c.t0.data)||void 0===a||!a.cart){c.next=25;break}return c.next=25,lt(c.t0.data.cart);case 25:return c.next=27,vt(e,!1);case 27:case"end":return c.stop()}}),it,null,[[7,18]])}function jt(e){var t,r,n,o,a=arguments;return F.a.wrap((function(c){for(;;)switch(c.prev=c.next){case 0:return t=a.length>1&&void 0!==a[1]?a[1]:0,c.prev=1,c.next=4,_t(!0);case 4:return c.next=6,we({path:"/wc/store/cart/select-shipping-rate",method:"POST",data:{package_id:t,rate_id:e},cache:"no-store"});case 6:return r=c.sent,n=r.response,c.next=10,lt(n);case 10:c.next=22;break;case 12:return c.prev=12,c.t0=c.catch(1),c.next=16,pt(c.t0);case 16:return c.next=18,_t(!1);case 18:if(null===(o=c.t0.data)||void 0===o||!o.cart){c.next=21;break}return c.next=21,lt(c.t0.data.cart);case 21:throw c.t0;case 22:return c.next=24,_t(!1);case 24:return c.abrupt("return",!0);case 25:case"end":return c.stop()}}),st,null,[[1,12]])}function It(e){var t,r,n;return F.a.wrap((function(o){for(;;)switch(o.prev=o.next){case 0:return o.next=2,gt(!0);case 2:return o.prev=2,o.next=5,we({path:"/wc/store/cart/update-customer",method:"POST",data:e,cache:"no-store"});case 5:return t=o.sent,r=t.response,o.next=9,lt(r);case 9:o.next=21;break;case 11:return o.prev=11,o.t0=o.catch(2),o.next=15,pt(o.t0);case 15:return o.next=17,gt(!1);case 17:if(null===(n=o.t0.data)||void 0===n||!n.cart){o.next=20;break}return o.next=20,lt(o.t0.data.cart);case 20:throw o.t0;case 21:return o.next=23,gt(!1);case 23:return o.abrupt("return",!0);case 24:case"end":return o.stop()}}),ft,null,[[2,11]])}var Dt=F.a.mark(kt),At=F.a.mark(Mt);function kt(){var e;return F.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,Object(m.apiFetch)({path:"/wc/store/cart",method:"GET",cache:"no-store"});case 2:if(e=t.sent){t.next=7;break}return t.next=6,pt(Ge.a);case 6:return t.abrupt("return");case 7:return t.next=9,lt(e);case 9:case"end":return t.stop()}}),Dt)}function Mt(){return F.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Object(m.select)(Ge.c,"getCartData");case 2:case"end":return e.stop()}}),At)}function Nt(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Lt(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Nt(Object(r),!0).forEach((function(t){X()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Nt(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Ft,Vt=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"RECEIVE_CART_ITEM":return e.map((function(e){var r;return e.key===(null===(r=t.cartItem)||void 0===r?void 0:r.key)?t.cartItem:e}))}return e},Ut=window.CustomEvent||null,Gt=function(e,t){var r=t.bubbles,n=void 0!==r&&r,o=t.cancelable,a=void 0!==o&&o,c=t.element,u=t.detail,i=void 0===u?{}:u;if(Ut){c||(c=document.body);var s=new Ut(e,{bubbles:n,cancelable:a,detail:i});c.dispatchEvent(s)}},Yt={UPDATE_LEGACY_CART_FRAGMENTS:function(){Ft&&clearTimeout(Ft),Ft=setTimeout((function(){Gt("wc_fragment_refresh",{bubbles:!0,cancelable:!0})}),50)},TRIGGER_ADDING_TO_CART_EVENT:function(){Gt("wc-blocks_adding_to_cart",{bubbles:!0,cancelable:!0})},TRIGGER_ADDED_TO_CART_EVENT:function(e){var t;t=e.preserveCartData,Gt("wc-blocks_added_to_cart",{bubbles:!0,cancelable:!0,detail:{preserveCartData:void 0!==t&&t}})}};function Kt(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Qt(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Kt(Object(r),!0).forEach((function(t){X()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Kt(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}Object(h.registerStore)(Ge.c,{reducer:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Ye,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"RECEIVE_ERROR":t.error&&(e=Lt(Lt({},e),{},{errors:e.errors.concat(t.error)}));break;case"REPLACE_ERRORS":t.error&&(e=Lt(Lt({},e),{},{errors:[t.error]}));break;case"RECEIVE_CART":t.response&&(e=Lt(Lt({},e),{},{errors:I,cartData:t.response}));break;case"APPLYING_COUPON":(t.couponCode||""===t.couponCode)&&(e=Lt(Lt({},e),{},{metaData:Lt(Lt({},e.metaData),{},{applyingCoupon:t.couponCode})}));break;case"REMOVING_COUPON":(t.couponCode||""===t.couponCode)&&(e=Lt(Lt({},e),{},{metaData:Lt(Lt({},e.metaData),{},{removingCoupon:t.couponCode})}));break;case"ITEM_PENDING_QUANTITY":var r=e.cartItemsPendingQuantity.filter((function(e){return e!==t.cartItemKey}));t.isPendingQuantity&&t.cartItemKey&&r.push(t.cartItemKey),e=Lt(Lt({},e),{},{cartItemsPendingQuantity:r});break;case"RECEIVE_REMOVED_ITEM":var n=e.cartItemsPendingDelete.filter((function(e){return e!==t.cartItemKey}));t.isPendingDelete&&t.cartItemKey&&n.push(t.cartItemKey),e=Lt(Lt({},e),{},{cartItemsPendingDelete:n});break;case"RECEIVE_CART_ITEM":e=Lt(Lt({},e),{},{errors:I,cartData:Lt(Lt({},e.cartData),{},{items:Vt(e.cartData.items,t)})});break;case"UPDATING_CUSTOMER_DATA":e=Lt(Lt({},e),{},{metaData:Lt(Lt({},e.metaData),{},{updatingCustomerData:!!t.isResolving})});break;case"UPDATING_SELECTED_SHIPPING_RATE":e=Lt(Lt({},e),{},{metaData:Lt(Lt({},e.metaData),{},{updatingSelectedRate:!!t.isResolving})});break;case"SET_IS_CART_DATA_STALE":e=Lt(Lt({},e),{},{metaData:Lt(Lt({},e.metaData),{},{isCartDataStale:t.isCartDataStale})})}return e},actions:f,controls:Qt(Qt(Qt({},m.controls),Re),Yt),selectors:s,resolvers:l});var Ht=Ge.c,qt=function(e,t){return void 0===e[t]?null:e[t]},Bt=function(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=qt(e,t);return null===o?n:void 0!==(o=JSON.parse(o))[r]?o[r]:n},zt=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=qt(e,t);return null===n?r:JSON.parse(n)},Jt=function(e,t,r){return{type:"SET_QUERY_KEY_VALUE",context:e,queryKey:t,value:r}},Wt=function(e,t){return{type:"SET_QUERY_CONTEXT_VALUE",context:e,value:t}};function $t(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Xt(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?$t(Object(r),!0).forEach((function(t){X()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):$t(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}Object(h.registerStore)("wc/store/query-state",{reducer:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,n=r.type,o=r.context,a=r.queryKey,c=r.value,u=qt(t,o);switch(n){case"SET_QUERY_KEY_VALUE":var i=null!==u?JSON.parse(u):{};i[a]=c,u!==(e=JSON.stringify(i))&&(t=Xt(Xt({},t),{},X()({},o,e)));break;case"SET_QUERY_CONTEXT_VALUE":u!==(e=JSON.stringify(c))&&(t=Xt(Xt({},t),{},X()({},o,e)))}return t},actions:d,selectors:p});var Zt="wc/store/query-state"},18:function(e,t,r){var n=r(19);e.exports=function(e,t){if(e){if("string"==typeof e)return n(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?n(e,t):void 0}},e.exports.default=e.exports,e.exports.__esModule=!0},19:function(e,t){e.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n},e.exports.default=e.exports,e.exports.__esModule=!0},2:function(e,t){e.exports=window.wp.i18n},20:function(e,t){e.exports=function(e){if(Array.isArray(e))return e},e.exports.default=e.exports,e.exports.__esModule=!0},21:function(e,t){e.exports=function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,a=[],_n=!0,c=!1;try{for(r=r.call(e);!(_n=(n=r.next()).done)&&(a.push(n.value),!t||a.length!==t);_n=!0);}catch(e){c=!0,o=e}finally{try{_n||null==r.return||r.return()}finally{if(c)throw o}}return a}},e.exports.default=e.exports,e.exports.__esModule=!0},22:function(e,t){e.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},e.exports.default=e.exports,e.exports.__esModule=!0},29:function(e,t){function r(e,t,r,n,o,a,c){try{var u=e[a](c),i=u.value}catch(e){return void r(e)}u.done?t(i):Promise.resolve(i).then(n,o)}e.exports=function(e){return function(){var t=this,n=arguments;return new Promise((function(o,a){var c=e.apply(t,n);function u(e){r(c,o,a,u,i,"next",e)}function i(e){r(c,o,a,u,i,"throw",e)}u(void 0)}))}},e.exports.default=e.exports,e.exports.__esModule=!0},3:function(e,t){e.exports=window.regeneratorRuntime},30:function(e,t,r){var n=r(144),o=r(145),a=r(18),c=r(146);e.exports=function(e){return n(e)||o(e)||a(e)||c()},e.exports.default=e.exports,e.exports.__esModule=!0},31:function(e,t){var r,n,o=e.exports={};function a(){throw new Error("setTimeout has not been defined")}function c(){throw new Error("clearTimeout has not been defined")}function u(e){if(r===setTimeout)return setTimeout(e,0);if((r===a||!r)&&setTimeout)return r=setTimeout,setTimeout(e,0);try{return r(e,0)}catch(t){try{return r.call(null,e,0)}catch(t){return r.call(this,e,0)}}}!function(){try{r="function"==typeof setTimeout?setTimeout:a}catch(e){r=a}try{n="function"==typeof clearTimeout?clearTimeout:c}catch(e){n=c}}();var i,s=[],f=!1,l=-1;function p(){f&&i&&(f=!1,i.length?s=i.concat(s):l=-1,s.length&&d())}function d(){if(!f){var e=u(p);f=!0;for(var t=s.length;t;){for(i=s,s=[];++l<t;)i&&i[l].run();l=-1,t=s.length}i=null,f=!1,function(e){if(n===clearTimeout)return clearTimeout(e);if((n===c||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(e);try{n(e)}catch(t){try{return n.call(null,e)}catch(t){return n.call(this,e)}}}(e)}}function h(e,t){this.fun=e,this.array=t}function m(){}o.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];s.push(new h(e,t)),1!==s.length||f||u(d)},h.prototype.run=function(){this.fun.apply(null,this.array)},o.title="browser",o.browser=!0,o.env={},o.argv=[],o.version="",o.versions={},o.on=m,o.addListener=m,o.once=m,o.off=m,o.removeListener=m,o.removeAllListeners=m,o.emit=m,o.prependListener=m,o.prependOnceListener=m,o.listeners=function(e){return[]},o.binding=function(e){throw new Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(e){throw new Error("process.chdir is not supported")},o.umask=function(){return 0}},32:function(e,t){e.exports=window.wp.url},39:function(e,t){var r;r=function(){return this}();try{r=r||new Function("return this")()}catch(e){"object"==typeof window&&(r=window)}e.exports=r},4:function(e,t){e.exports=window.lodash},42:function(e,t,r){"use strict";(function(t,r){var n,o=function(){function e(e,t){if("function"!=typeof e)throw new TypeError("DataLoader must be constructed with a function which accepts Array<key> and returns Promise<Array<value>>, but got: "+e+".");this._batchLoadFn=e,this._maxBatchSize=function(e){if(e&&!1===e.batch)return 1;var t=e&&e.maxBatchSize;if(void 0===t)return 1/0;if("number"!=typeof t||t<1)throw new TypeError("maxBatchSize must be a positive number: "+t);return t}(t),this._batchScheduleFn=function(e){var t=e&&e.batchScheduleFn;if(void 0===t)return a;if("function"!=typeof t)throw new TypeError("batchScheduleFn must be a function: "+t);return t}(t),this._cacheKeyFn=function(e){var t=e&&e.cacheKeyFn;if(void 0===t)return function(e){return e};if("function"!=typeof t)throw new TypeError("cacheKeyFn must be a function: "+t);return t}(t),this._cacheMap=function(e){if(e&&!1===e.cache)return null;var t=e&&e.cacheMap;if(void 0===t)return new Map;if(null!==t){var r=["get","set","delete","clear"].filter((function(e){return t&&"function"!=typeof t[e]}));if(0!==r.length)throw new TypeError("Custom cacheMap missing methods: "+r.join(", "))}return t}(t),this._batch=null}var t=e.prototype;return t.load=function(e){if(null==e)throw new TypeError("The loader.load() function must be called with a value,but got: "+String(e)+".");var t=function(e){var t=e._batch;if(null!==t&&!t.hasDispatched&&t.keys.length<e._maxBatchSize&&(!t.cacheHits||t.cacheHits.length<e._maxBatchSize))return t;var r={hasDispatched:!1,keys:[],callbacks:[]};return e._batch=r,e._batchScheduleFn((function(){return function(e,t){if(t.hasDispatched=!0,0!==t.keys.length){var r=e._batchLoadFn(t.keys);if(!r||"function"!=typeof r.then)return c(e,t,new TypeError("DataLoader must be constructed with a function which accepts Array<key> and returns Promise<Array<value>>, but the function did not return a Promise: "+String(r)+"."));r.then((function(e){if(!i(e))throw new TypeError("DataLoader must be constructed with a function which accepts Array<key> and returns Promise<Array<value>>, but the function did not return a Promise of an Array: "+String(e)+".");if(e.length!==t.keys.length)throw new TypeError("DataLoader must be constructed with a function which accepts Array<key> and returns Promise<Array<value>>, but the function did not return a Promise of an Array of the same length as the Array of keys.\n\nKeys:\n"+String(t.keys)+"\n\nValues:\n"+String(e));u(t);for(var r=0;r<t.callbacks.length;r++){var n=e[r];n instanceof Error?t.callbacks[r].reject(n):t.callbacks[r].resolve(n)}})).catch((function(r){return c(e,t,r)}))}else u(t)}(e,r)})),r}(this),r=this._cacheMap,n=this._cacheKeyFn(e);if(r){var o=r.get(n);if(o){var a=t.cacheHits||(t.cacheHits=[]);return new Promise((function(e){a.push((function(){return e(o)}))}))}}t.keys.push(e);var s=new Promise((function(e,r){t.callbacks.push({resolve:e,reject:r})}));return r&&r.set(n,s),s},t.loadMany=function(e){if(!i(e))throw new TypeError("The loader.loadMany() function must be called with Array<key> but got: "+e+".");for(var t=[],r=0;r<e.length;r++)t.push(this.load(e[r]).catch((function(e){return e})));return Promise.all(t)},t.clear=function(e){var t=this._cacheMap;if(t){var r=this._cacheKeyFn(e);t.delete(r)}return this},t.clearAll=function(){var e=this._cacheMap;return e&&e.clear(),this},t.prime=function(e,t){var r=this._cacheMap;if(r){var n,o=this._cacheKeyFn(e);void 0===r.get(o)&&(t instanceof Error?(n=Promise.reject(t)).catch((function(){})):n=Promise.resolve(t),r.set(o,n))}return this},e}(),a="object"==typeof t&&"function"==typeof t.nextTick?function(e){n||(n=Promise.resolve()),n.then((function(){return t.nextTick(e)}))}:r||setTimeout;function c(e,t,r){u(t);for(var n=0;n<t.keys.length;n++)e.clear(t.keys[n]),t.callbacks[n].reject(r)}function u(e){if(e.cacheHits)for(var t=0;t<e.cacheHits.length;t++)e.cacheHits[t]()}function i(e){return"object"==typeof e&&null!==e&&"number"==typeof e.length&&(0===e.length||e.length>0&&Object.prototype.hasOwnProperty.call(e,e.length-1))}e.exports=o}).call(this,r(31),r(147).setImmediate)},6:function(e,t){function r(t){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?(e.exports=r=function(e){return typeof e},e.exports.default=e.exports,e.exports.__esModule=!0):(e.exports=r=function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.default=e.exports,e.exports.__esModule=!0),r(t)}e.exports=r,e.exports.default=e.exports,e.exports.__esModule=!0},7:function(e,t){e.exports=window.wc.wcSettings},8:function(e,t){e.exports=window.wp.dataControls}});woocommerce-blocks/build/mini-cart.asset.php000064400000000305151335517640015157 0ustar00<?php return array('dependencies' => array('wc-settings', 'wp-block-editor', 'wp-blocks', 'wp-element', 'wp-i18n', 'wp-polyfill', 'wp-primitives'), 'version' => 'bd2b4f04c97e92148b7284cf929fa640');add-to-cart--cart-blocks/order-summary--checkout-blocks/billing-ad--c5eb4dcd-frontend.js000064400000126663151335517640040014 0ustar00woocommerce-blocks/build/vendors--atomic-block-components(window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[0],{119:function(e,t,r){"use strict";r.d(t,"a",(function(){return g}));var a=function(e){for(var t,r=0,a=0,n=e.length;n>=4;++a,n-=4)t=1540483477*(65535&(t=255&e.charCodeAt(a)|(255&e.charCodeAt(++a))<<8|(255&e.charCodeAt(++a))<<16|(255&e.charCodeAt(++a))<<24))+(59797*(t>>>16)<<16),r=1540483477*(65535&(t^=t>>>24))+(59797*(t>>>16)<<16)^1540483477*(65535&r)+(59797*(r>>>16)<<16);switch(n){case 3:r^=(255&e.charCodeAt(a+2))<<16;case 2:r^=(255&e.charCodeAt(a+1))<<8;case 1:r=1540483477*(65535&(r^=255&e.charCodeAt(a)))+(59797*(r>>>16)<<16)}return(((r=1540483477*(65535&(r^=r>>>13))+(59797*(r>>>16)<<16))^r>>>15)>>>0).toString(36)},n={animationIterationCount:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},i=r(177),o=/[A-Z]|^ms/g,s=/_EMO_([^_]+?)_([^]*?)_EMO_/g,c=function(e){return 45===e.charCodeAt(1)},l=function(e){return null!=e&&"boolean"!=typeof e},f=Object(i.a)((function(e){return c(e)?e:e.replace(o,"-$&").toLowerCase()})),u=function(e,t){switch(e){case"animation":case"animationName":if("string"==typeof t)return t.replace(s,(function(e,t,r){return d={name:t,styles:r,next:d},t}))}return 1===n[e]||c(e)||"number"!=typeof t||0===t?t:t+"px"};function h(e,t,r,a){if(null==r)return"";if(void 0!==r.__emotion_styles)return r;switch(typeof r){case"boolean":return"";case"object":if(1===r.anim)return d={name:r.name,styles:r.styles,next:d},r.name;if(void 0!==r.styles){var n=r.next;if(void 0!==n)for(;void 0!==n;)d={name:n.name,styles:n.styles,next:d},n=n.next;return r.styles+";"}return function(e,t,r){var a="";if(Array.isArray(r))for(var n=0;n<r.length;n++)a+=h(e,t,r[n],!1);else for(var i in r){var o=r[i];if("object"!=typeof o)null!=t&&void 0!==t[o]?a+=i+"{"+t[o]+"}":l(o)&&(a+=f(i)+":"+u(i,o)+";");else if(!Array.isArray(o)||"string"!=typeof o[0]||null!=t&&void 0!==t[o[0]]){var s=h(e,t,o,!1);switch(i){case"animation":case"animationName":a+=f(i)+":"+s+";";break;default:a+=i+"{"+s+"}"}}else for(var c=0;c<o.length;c++)l(o[c])&&(a+=f(i)+":"+u(i,o[c])+";")}return a}(e,t,r);case"function":if(void 0!==e){var i=d,o=r(e);return d=i,h(e,t,o,a)}}if(null==t)return r;var s=t[r];return void 0===s||a?r:s}var d,b=/label:\s*([^\s;\n{]+)\s*;/g,g=function(e,t,r){if(1===e.length&&"object"==typeof e[0]&&null!==e[0]&&void 0!==e[0].styles)return e[0];var n=!0,i="";d=void 0;var o=e[0];null==o||void 0===o.raw?(n=!1,i+=h(r,t,o,!1)):i+=o[0];for(var s=1;s<e.length;s++)i+=h(r,t,e[s],46===i.charCodeAt(i.length-1)),n&&(i+=o[s]);b.lastIndex=0;for(var c,l="";null!==(c=b.exec(i));)l+="-"+c[1];return{name:a(i)+l,styles:i,next:d}}},121:function(e,t,r){"use strict";function a(e,t,r){var a="";return r.split(" ").forEach((function(r){void 0!==e[r]?t.push(e[r]):a+=r+" "})),a}r.d(t,"a",(function(){return a})),r.d(t,"b",(function(){return n}));var n=function(e,t,r){var a=e.key+"-"+t.name;if(!1===r&&void 0===e.registered[a]&&(e.registered[a]=t.styles),void 0===e.inserted[t.name]){var n=t;do{e.insert("."+a,n,e.sheet,!0),n=n.next}while(void 0!==n)}}},124:function(e,t,r){"use strict";var a=r(4),n=r.n(a),i=r(3),o=r(177),s=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|download|draggable|encType|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|inert|itemProp|itemScope|itemType|itemID|itemRef|on|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,c=Object(o.a)((function(e){return s.test(e)||111===e.charCodeAt(0)&&110===e.charCodeAt(1)&&e.charCodeAt(2)<91})),l=r(141),f=r(121),u=r(119),h=c,d=function(e){return"theme"!==e&&"innerRef"!==e},b=function(e){return"string"==typeof e&&e.charCodeAt(0)>96?h:d};function g(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,a)}return r}function p(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?g(r,!0).forEach((function(t){n()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):g(r).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}t.a=function e(t,r){var a,n,o;void 0!==r&&(a=r.label,o=r.target,n=t.__emotion_forwardProp&&r.shouldForwardProp?function(e){return t.__emotion_forwardProp(e)&&r.shouldForwardProp(e)}:r.shouldForwardProp);var s=t.__emotion_real===t,c=s&&t.__emotion_base||t;"function"!=typeof n&&s&&(n=t.__emotion_forwardProp);var h=n||b(c),d=!h("as");return function(){var g=arguments,m=s&&void 0!==t.__emotion_styles?t.__emotion_styles.slice(0):[];if(void 0!==a&&m.push("label:"+a+";"),null==g[0]||void 0===g[0].raw)m.push.apply(m,g);else{m.push(g[0][0]);for(var v=g.length,y=1;y<v;y++)m.push(g[y],g[0][y])}var k=Object(l.c)((function(e,t,r){return Object(i.createElement)(l.a.Consumer,null,(function(a){var s=d&&e.as||c,l="",g=[],p=e;if(null==e.theme){for(var v in p={},e)p[v]=e[v];p.theme=a}"string"==typeof e.className?l=Object(f.a)(t.registered,g,e.className):null!=e.className&&(l=e.className+" ");var y=Object(u.a)(m.concat(g),t.registered,p);Object(f.b)(t,y,"string"==typeof s),l+=t.key+"-"+y.name,void 0!==o&&(l+=" "+o);var k=d&&void 0===n?b(s):h,w={};for(var x in e)d&&"as"===x||k(x)&&(w[x]=e[x]);return w.className=l,w.ref=r||e.innerRef,Object(i.createElement)(s,w)}))}));return k.displayName=void 0!==a?a:"Styled("+("string"==typeof c?c:c.displayName||c.name||"Component")+")",k.defaultProps=t.defaultProps,k.__emotion_real=k,k.__emotion_base=c,k.__emotion_styles=m,k.__emotion_forwardProp=n,Object.defineProperty(k,"toString",{value:function(){return"."+o}}),k.withComponent=function(t,a){return e(t,void 0!==a?p({},r||{},{},a):r).apply(void 0,m)},k}}},141:function(e,t,r){"use strict";r.d(t,"a",(function(){return h})),r.d(t,"c",(function(){return d})),r.d(t,"b",(function(){return b}));r(88);var a=r(3),n=function(){function e(e){this.isSpeedy=void 0===e.speedy||e.speedy,this.tags=[],this.ctr=0,this.nonce=e.nonce,this.key=e.key,this.container=e.container,this.before=null}var t=e.prototype;return t.insert=function(e){if(this.ctr%(this.isSpeedy?65e3:1)==0){var t,r=function(e){var t=document.createElement("style");return t.setAttribute("data-emotion",e.key),void 0!==e.nonce&&t.setAttribute("nonce",e.nonce),t.appendChild(document.createTextNode("")),t}(this);t=0===this.tags.length?this.before:this.tags[this.tags.length-1].nextSibling,this.container.insertBefore(r,t),this.tags.push(r)}var a=this.tags[this.tags.length-1];if(this.isSpeedy){var n=function(e){if(e.sheet)return e.sheet;for(var t=0;t<document.styleSheets.length;t++)if(document.styleSheets[t].ownerNode===e)return document.styleSheets[t]}(a);try{var i=105===e.charCodeAt(1)&&64===e.charCodeAt(0);n.insertRule(e,i?0:n.cssRules.length)}catch(e){}}else a.appendChild(document.createTextNode(e));this.ctr++},t.flush=function(){this.tags.forEach((function(e){return e.parentNode.removeChild(e)})),this.tags=[],this.ctr=0},e}(),i=function(e){function t(e,t,a){var n=t.trim().split(b);t=n;var i=n.length,o=e.length;switch(o){case 0:case 1:var s=0;for(e=0===o?"":e[0]+" ";s<i;++s)t[s]=r(e,t[s],a).trim();break;default:var c=s=0;for(t=[];s<i;++s)for(var l=0;l<o;++l)t[c++]=r(e[l]+" ",n[s],a).trim()}return t}function r(e,t,r){var a=t.charCodeAt(0);switch(33>a&&(a=(t=t.trim()).charCodeAt(0)),a){case 38:return t.replace(g,"$1"+e.trim());case 58:return e.trim()+t.replace(g,"$1"+e.trim());default:if(0<1*r&&0<t.indexOf("\f"))return t.replace(g,(58===e.charCodeAt(0)?"":"$1")+e.trim())}return e+t}function a(e,t,r,i){var o=e+";",s=2*t+3*r+4*i;if(944===s){e=o.indexOf(":",9)+1;var c=o.substring(e,o.length-1).trim();return c=o.substring(0,e).trim()+c+";",1===R||2===R&&n(c,1)?"-webkit-"+c+c:c}if(0===R||2===R&&!n(o,1))return o;switch(s){case 1015:return 97===o.charCodeAt(10)?"-webkit-"+o+o:o;case 951:return 116===o.charCodeAt(3)?"-webkit-"+o+o:o;case 963:return 110===o.charCodeAt(5)?"-webkit-"+o+o:o;case 1009:if(100!==o.charCodeAt(4))break;case 969:case 942:return"-webkit-"+o+o;case 978:return"-webkit-"+o+"-moz-"+o+o;case 1019:case 983:return"-webkit-"+o+"-moz-"+o+"-ms-"+o+o;case 883:if(45===o.charCodeAt(8))return"-webkit-"+o+o;if(0<o.indexOf("image-set(",11))return o.replace(A,"$1-webkit-$2")+o;break;case 932:if(45===o.charCodeAt(4))switch(o.charCodeAt(5)){case 103:return"-webkit-box-"+o.replace("-grow","")+"-webkit-"+o+"-ms-"+o.replace("grow","positive")+o;case 115:return"-webkit-"+o+"-ms-"+o.replace("shrink","negative")+o;case 98:return"-webkit-"+o+"-ms-"+o.replace("basis","preferred-size")+o}return"-webkit-"+o+"-ms-"+o+o;case 964:return"-webkit-"+o+"-ms-flex-"+o+o;case 1023:if(99!==o.charCodeAt(8))break;return"-webkit-box-pack"+(c=o.substring(o.indexOf(":",15)).replace("flex-","").replace("space-between","justify"))+"-webkit-"+o+"-ms-flex-pack"+c+o;case 1005:return h.test(o)?o.replace(u,":-webkit-")+o.replace(u,":-moz-")+o:o;case 1e3:switch(t=(c=o.substring(13).trim()).indexOf("-")+1,c.charCodeAt(0)+c.charCodeAt(t)){case 226:c=o.replace(y,"tb");break;case 232:c=o.replace(y,"tb-rl");break;case 220:c=o.replace(y,"lr");break;default:return o}return"-webkit-"+o+"-ms-"+c+o;case 1017:if(-1===o.indexOf("sticky",9))break;case 975:switch(t=(o=e).length-10,s=(c=(33===o.charCodeAt(t)?o.substring(0,t):o).substring(e.indexOf(":",7)+1).trim()).charCodeAt(0)+(0|c.charCodeAt(7))){case 203:if(111>c.charCodeAt(8))break;case 115:o=o.replace(c,"-webkit-"+c)+";"+o;break;case 207:case 102:o=o.replace(c,"-webkit-"+(102<s?"inline-":"")+"box")+";"+o.replace(c,"-webkit-"+c)+";"+o.replace(c,"-ms-"+c+"box")+";"+o}return o+";";case 938:if(45===o.charCodeAt(5))switch(o.charCodeAt(6)){case 105:return c=o.replace("-items",""),"-webkit-"+o+"-webkit-box-"+c+"-ms-flex-"+c+o;case 115:return"-webkit-"+o+"-ms-flex-item-"+o.replace(x,"")+o;default:return"-webkit-"+o+"-ms-flex-line-pack"+o.replace("align-content","").replace(x,"")+o}break;case 973:case 989:if(45!==o.charCodeAt(3)||122===o.charCodeAt(4))break;case 931:case 953:if(!0===_.test(e))return 115===(c=e.substring(e.indexOf(":")+1)).charCodeAt(0)?a(e.replace("stretch","fill-available"),t,r,i).replace(":fill-available",":stretch"):o.replace(c,"-webkit-"+c)+o.replace(c,"-moz-"+c.replace("fill-",""))+o;break;case 962:if(o="-webkit-"+o+(102===o.charCodeAt(5)?"-ms-"+o:"")+o,211===r+i&&105===o.charCodeAt(13)&&0<o.indexOf("transform",10))return o.substring(0,o.indexOf(";",27)+1).replace(d,"$1-webkit-$2")+o}return o}function n(e,t){var r=e.indexOf(1===t?":":"{"),a=e.substring(0,3!==t?r:10);return r=e.substring(r+1,e.length-1),N(2!==t?a:a.replace(O,"$1"),r,t)}function i(e,t){var r=a(t,t.charCodeAt(0),t.charCodeAt(1),t.charCodeAt(2));return r!==t+";"?r.replace(w," or ($1)").substring(4):"("+t+")"}function o(e,t,r,a,n,i,o,s,l,f){for(var u,h=0,d=t;h<F;++h)switch(u=E[h].call(c,e,d,r,a,n,i,o,s,l,f)){case void 0:case!1:case!0:case null:break;default:d=u}if(d!==t)return d}function s(e){return void 0!==(e=e.prefix)&&(N=null,e?"function"!=typeof e?R=1:(R=2,N=e):R=0),s}function c(e,r){var s=e;if(33>s.charCodeAt(0)&&(s=s.trim()),s=[s],0<F){var c=o(-1,r,s,s,C,j,0,0,0,0);void 0!==c&&"string"==typeof c&&(r=c)}var u=function e(r,s,c,u,h){for(var d,b,g,y,w,x=0,O=0,_=0,A=0,E=0,N=0,z=g=d=0,T=0,L=0,D=0,M=0,I=c.length,q=I-1,$="",G="",U="",B="";T<I;){if(b=c.charCodeAt(T),T===q&&0!==O+A+_+x&&(0!==O&&(b=47===O?10:47),A=_=x=0,I++,q++),0===O+A+_+x){if(T===q&&(0<L&&($=$.replace(f,"")),0<$.trim().length)){switch(b){case 32:case 9:case 59:case 13:case 10:break;default:$+=c.charAt(T)}b=59}switch(b){case 123:for(d=($=$.trim()).charCodeAt(0),g=1,M=++T;T<I;){switch(b=c.charCodeAt(T)){case 123:g++;break;case 125:g--;break;case 47:switch(b=c.charCodeAt(T+1)){case 42:case 47:e:{for(z=T+1;z<q;++z)switch(c.charCodeAt(z)){case 47:if(42===b&&42===c.charCodeAt(z-1)&&T+2!==z){T=z+1;break e}break;case 10:if(47===b){T=z+1;break e}}T=z}}break;case 91:b++;case 40:b++;case 34:case 39:for(;T++<q&&c.charCodeAt(T)!==b;);}if(0===g)break;T++}switch(g=c.substring(M,T),0===d&&(d=($=$.replace(l,"").trim()).charCodeAt(0)),d){case 64:switch(0<L&&($=$.replace(f,"")),b=$.charCodeAt(1)){case 100:case 109:case 115:case 45:L=s;break;default:L=P}if(M=(g=e(s,L,g,b,h+1)).length,0<F&&(w=o(3,g,L=t(P,$,D),s,C,j,M,b,h,u),$=L.join(""),void 0!==w&&0===(M=(g=w.trim()).length)&&(b=0,g="")),0<M)switch(b){case 115:$=$.replace(k,i);case 100:case 109:case 45:g=$+"{"+g+"}";break;case 107:g=($=$.replace(p,"$1 $2"))+"{"+g+"}",g=1===R||2===R&&n("@"+g,3)?"@-webkit-"+g+"@"+g:"@"+g;break;default:g=$+g,112===u&&(G+=g,g="")}else g="";break;default:g=e(s,t(s,$,D),g,u,h+1)}U+=g,g=D=L=z=d=0,$="",b=c.charCodeAt(++T);break;case 125:case 59:if(1<(M=($=(0<L?$.replace(f,""):$).trim()).length))switch(0===z&&(d=$.charCodeAt(0),45===d||96<d&&123>d)&&(M=($=$.replace(" ",":")).length),0<F&&void 0!==(w=o(1,$,s,r,C,j,G.length,u,h,u))&&0===(M=($=w.trim()).length)&&($="\0\0"),d=$.charCodeAt(0),b=$.charCodeAt(1),d){case 0:break;case 64:if(105===b||99===b){B+=$+c.charAt(T);break}default:58!==$.charCodeAt(M-1)&&(G+=a($,d,b,$.charCodeAt(2)))}D=L=z=d=0,$="",b=c.charCodeAt(++T)}}switch(b){case 13:case 10:47===O?O=0:0===1+d&&107!==u&&0<$.length&&(L=1,$+="\0"),0<F*H&&o(0,$,s,r,C,j,G.length,u,h,u),j=1,C++;break;case 59:case 125:if(0===O+A+_+x){j++;break}default:switch(j++,y=c.charAt(T),b){case 9:case 32:if(0===A+x+O)switch(E){case 44:case 58:case 9:case 32:y="";break;default:32!==b&&(y=" ")}break;case 0:y="\\0";break;case 12:y="\\f";break;case 11:y="\\v";break;case 38:0===A+O+x&&(L=D=1,y="\f"+y);break;case 108:if(0===A+O+x+S&&0<z)switch(T-z){case 2:112===E&&58===c.charCodeAt(T-3)&&(S=E);case 8:111===N&&(S=N)}break;case 58:0===A+O+x&&(z=T);break;case 44:0===O+_+A+x&&(L=1,y+="\r");break;case 34:case 39:0===O&&(A=A===b?0:0===A?b:A);break;case 91:0===A+O+_&&x++;break;case 93:0===A+O+_&&x--;break;case 41:0===A+O+x&&_--;break;case 40:if(0===A+O+x){if(0===d)switch(2*E+3*N){case 533:break;default:d=1}_++}break;case 64:0===O+_+A+x+z+g&&(g=1);break;case 42:case 47:if(!(0<A+x+_))switch(O){case 0:switch(2*b+3*c.charCodeAt(T+1)){case 235:O=47;break;case 220:M=T,O=42}break;case 42:47===b&&42===E&&M+2!==T&&(33===c.charCodeAt(M+2)&&(G+=c.substring(M,T+1)),y="",O=0)}}0===O&&($+=y)}N=E,E=b,T++}if(0<(M=G.length)){if(L=s,0<F&&void 0!==(w=o(2,G,L,r,C,j,M,u,h,u))&&0===(G=w).length)return B+G+U;if(G=L.join(",")+"{"+G+"}",0!=R*S){switch(2!==R||n(G,2)||(S=0),S){case 111:G=G.replace(v,":-moz-$1")+G;break;case 112:G=G.replace(m,"::-webkit-input-$1")+G.replace(m,"::-moz-$1")+G.replace(m,":-ms-input-$1")+G}S=0}}return B+G+U}(P,s,r,0,0);return 0<F&&void 0!==(c=o(-2,u,s,s,C,j,u.length,0,0,0))&&(u=c),S=0,j=C=1,u}var l=/^\0+/g,f=/[\0\r\f]/g,u=/: */g,h=/zoo|gra/,d=/([,: ])(transform)/g,b=/,\r+?/g,g=/([\t\r\n ])*\f?&/g,p=/@(k\w+)\s*(\S*)\s*/,m=/::(place)/g,v=/:(read-only)/g,y=/[svh]\w+-[tblr]{2}/,k=/\(\s*(.*)\s*\)/g,w=/([\s\S]*?);/g,x=/-self|flex-/g,O=/[^]*?(:[rp][el]a[\w-]+)[^]*/,_=/stretch|:\s*\w+\-(?:conte|avail)/,A=/([^-])(image-set\()/,j=1,C=1,S=0,R=1,P=[],E=[],F=0,N=null,H=0;return c.use=function e(t){switch(t){case void 0:case null:F=E.length=0;break;default:if("function"==typeof t)E[F++]=t;else if("object"==typeof t)for(var r=0,a=t.length;r<a;++r)e(t[r]);else H=0|!!t}return e},c.set=s,void 0!==e&&s(e),c};function o(e){e&&s.current.insert(e+"}")}var s={current:null},c=function(e,t,r,a,n,i,c,l,f,u){switch(e){case 1:switch(t.charCodeAt(0)){case 64:return s.current.insert(t+";"),"";case 108:if(98===t.charCodeAt(2))return""}break;case 2:if(0===l)return t+"/*|*/";break;case 3:switch(l){case 102:case 112:return s.current.insert(r[0]+t),"";default:return t+(0===u?"/*|*/":"")}case-2:t.split("/*|*/}").forEach(o)}},l=(r(144),r(121)),f=r(119),u=(Object.prototype.hasOwnProperty,Object(a.createContext)("undefined"!=typeof HTMLElement?function(e){void 0===e&&(e={});var t,r=e.key||"css";void 0!==e.prefix&&(t={prefix:e.prefix});var a,o=new i(t),l={};a=e.container||document.head;var f,u=document.querySelectorAll("style[data-emotion-"+r+"]");Array.prototype.forEach.call(u,(function(e){e.getAttribute("data-emotion-"+r).split(" ").forEach((function(e){l[e]=!0})),e.parentNode!==a&&a.appendChild(e)})),o.use(e.stylisPlugins)(c),f=function(e,t,r,a){var n=t.name;s.current=r,o(e,t.styles),a&&(h.inserted[n]=!0)};var h={key:r,sheet:new n({key:r,container:a,nonce:e.nonce,speedy:e.speedy}),nonce:e.nonce,inserted:l,registered:{},insert:f};return h}():null)),h=Object(a.createContext)({}),d=(u.Provider,function(e){var t=function(t,r){return Object(a.createElement)(u.Consumer,null,(function(a){return e(t,a,r)}))};return Object(a.forwardRef)(t)}),b=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return Object(f.a)(t)},g=(a.Component,function e(t){for(var r=t.length,a=0,n="";a<r;a++){var i=t[a];if(null!=i){var o=void 0;switch(typeof i){case"boolean":break;case"object":if(Array.isArray(i))o=e(i);else for(var s in o="",i)i[s]&&s&&(o&&(o+=" "),o+=s);break;default:o=i}o&&(n&&(n+=" "),n+=o)}}return n});function p(e,t,r){var a=[],n=Object(l.a)(e,a,r);return a.length<2?r:n+t(a)}d((function(e,t){return Object(a.createElement)(h.Consumer,null,(function(r){var a=function(){for(var e=arguments.length,r=new Array(e),a=0;a<e;a++)r[a]=arguments[a];var n=Object(f.a)(r,t.registered);return Object(l.b)(t,n,!1),t.key+"-"+n.name},n={css:a,cx:function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];return p(t.registered,a,g(r))},theme:r};return e.children(n)}))}))},145:function(e,t,r){"use strict";r.d(t,"b",(function(){return o})),r.d(t,"c",(function(){return s})),r.d(t,"a",(function(){return c}));var a=r(124),n=r(141),i={name:"8kj89b",styles:"flex-direction:row-reverse;"},o=Object(a.a)("div",{target:"eboqfv50",label:"Flex"})("box-sizing:border-box;display:flex;width:100%;",(function(e){var t=e.align,r={top:"flex-start",bottom:"flex-end"}[t]||t;return Object(n.b)({alignItems:r},"")})," ",(function(e){var t=e.justify,r=e.isReversed,a={left:"flex-start",right:"flex-end"},i=a[t]||t;return r&&a[t]&&(i="left"===t?a.right:a.left),Object(n.b)({justifyContent:i},"")})," ",(function(e){var t=e.gap,r=e.isReversed,a="number"==typeof t?4*t:4,i="margin-".concat(r?"left":"right");return Object(n.b)("> *{",i,":",a,"px;&:last-child{",i,":0;}}")})," ",(function(e){return e.isReversed?i:""}),""),s=Object(a.a)("div",{target:"eboqfv51",label:"Item"})({name:"13luw5d",styles:"box-sizing:border-box;min-width:0;max-width:100%;"}),c=Object(a.a)(s,{target:"eboqfv52",label:"Block"})({name:"1rr4qq7",styles:"flex:1;"})},177:function(e,t,r){"use strict";t.a=function(e){var t={};return function(r){return void 0===t[r]&&(t[r]=e(r)),t[r]}}},195:function(e,t,r){"use strict";var a=r(20),n=r(19),i=r(6),o=r.n(i),s=r(0);function c(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,a)}return r}t.a=function(e){var t=e.as,r=void 0===t?"div":t,i=e.className,l=Object(n.a)(e,["as","className"]);return function(e){var t=e.as,r=void 0===t?"div":t,a=Object(n.a)(e,["as"]);return"function"==typeof a.children?a.children(a):Object(s.createElement)(r,a)}(function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?c(Object(r),!0).forEach((function(t){Object(a.a)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):c(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({as:r,className:o()("components-visually-hidden",i)},l))}},211:function(e,t,r){"use strict";var a=r(12),n=r(19),i=r(0),o=r(6),s=r.n(o),c=r(145);t.a=Object(i.forwardRef)((function(e,t){var r=e.className,o=Object(n.a)(e,["className"]),l=s()("components-flex__item",r);return Object(i.createElement)(c.c,Object(a.a)({},o,{className:l,ref:t}))}))},217:function(e,t,r){"use strict";r.d(t,"b",(function(){return l})),r.d(t,"a",(function(){return v}));var a=r(20),n=r(7),i=r(63);function o(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,a)}return r}function s(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?o(Object(r),!0).forEach((function(t){Object(a.a)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):o(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var c={black:"#000",white:"#fff"},l={blue:{medium:{focus:"#007cba",focusDark:"#fff"}},gray:{900:"#1e1e1e",700:"#757575",600:"#949494",400:"#ccc",200:"#ddd",100:"#f0f0f0"},darkGray:{primary:"#1e1e1e"},mediumGray:{text:"#757575"},lightGray:{ui:"#949494",secondary:"#ccc",tertiary:"#e7e8e9"}},f={900:"#191e23",800:"#23282d",700:"#32373c",600:"#40464d",500:"#555d66",400:"#606a73",300:"#6c7781",200:"#7e8993",150:"#8d96a0",100:"#8f98a1",placeholder:Object(i.b)(l.gray[900],.62)},u={900:Object(i.b)("#000510",.9),800:Object(i.b)("#00000a",.85),700:Object(i.b)("#06060b",.8),600:Object(i.b)("#000913",.75),500:Object(i.b)("#0a1829",.7),400:Object(i.b)("#0a1829",.65),300:Object(i.b)("#0e1c2e",.62),200:Object(i.b)("#162435",.55),100:Object(i.b)("#223443",.5),backgroundFill:Object(i.b)(f[700],.7)},h={900:Object(i.b)("#304455",.45),800:Object(i.b)("#425863",.4),700:Object(i.b)("#667886",.35),600:Object(i.b)("#7b86a2",.3),500:Object(i.b)("#9197a2",.25),400:Object(i.b)("#95959c",.2),300:Object(i.b)("#829493",.15),200:Object(i.b)("#8b8b96",.1),100:Object(i.b)("#747474",.05)},d={900:"#a2aab2",800:"#b5bcc2",700:"#ccd0d4",600:"#d7dade",500:"#e2e4e7",400:"#e8eaeb",300:"#edeff0",200:"#f3f4f5",100:"#f8f9f9",placeholder:Object(i.b)(c.white,.65)},b={900:Object(i.b)(c.white,.5),800:Object(i.b)(c.white,.45),700:Object(i.b)(c.white,.4),600:Object(i.b)(c.white,.35),500:Object(i.b)(c.white,.3),400:Object(i.b)(c.white,.25),300:Object(i.b)(c.white,.2),200:Object(i.b)(c.white,.15),100:Object(i.b)(c.white,.1),backgroundFill:Object(i.b)(d[300],.8)},g={wordpress:{700:"#00669b"},dark:{900:"#0071a1"},medium:{900:"#006589",800:"#00739c",700:"#007fac",600:"#008dbe",500:"#00a0d2",400:"#33b3db",300:"#66c6e4",200:"#bfe7f3",100:"#e5f5fa",highlight:"#b3e7fe",focus:"#007cba"}},p={theme:"var( --wp-admin-theme-color, ".concat(g.wordpress[700],")"),themeDark10:"var( --wp-admin-theme-color-darker-10, ".concat(g.medium.focus,")")},m={theme:p.theme,background:c.white,backgroundDisabled:d[200],border:l.gray[700],borderFocus:p.themeDark10,borderDisabled:l.gray[400],borderLight:l.gray[200],label:f[500],textDisabled:f[150],textDark:c.white,textLight:c.black},v=s(s({},c),{},{darkGray:Object(n.merge)({},f,l.darkGray),darkOpacity:u,darkOpacityLight:h,mediumGray:l.mediumGray,lightGray:Object(n.merge)({},d,l.lightGray),lightGrayLight:b,blue:Object(n.merge)({},g,l.blue),alert:{yellow:"#f0b849",red:"#d94f4f",green:"#4ab866"},admin:p,ui:m})},218:function(e,t,r){"use strict";r.d(t,"a",(function(){return l}));var a=r(12),n=r(19),i=r(0),o=r(6),s=r.n(o),c=r(145),l=Object(i.forwardRef)((function(e,t){var r=e.align,o=void 0===r?"center":r,l=e.className,f=e.gap,u=void 0===f?2:f,h=e.justify,d=void 0===h?"space-between":h,b=e.isReversed,g=void 0!==b&&b,p=Object(n.a)(e,["align","className","gap","justify","isReversed"]),m=s()("components-flex",l);return Object(i.createElement)(c.b,Object(a.a)({},p,{align:o,className:m,ref:t,gap:u,justify:d,isReversed:g}))}));t.b=l},220:function(e,t,r){"use strict";var a=r(0),n=r(6),i=r.n(n),o=r(195),s=r(124),c=r(7),l={"default.fontFamily":"-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif","default.fontSize":"13px","helpText.fontSize":"12px",mobileTextMinFontSize:"16px"};function f(e){return Object(c.get)(l,e,"")}function u(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;return isNaN(e)?"".concat(8,"px"):"".concat(8*e,"px")}var h=r(63),d=Object(s.a)("div",{target:"e1puf3u0",label:"Wrapper"})("font-family:",f("default.fontFamily"),";font-size:",f("default.fontSize"),";"),b=Object(s.a)("div",{target:"e1puf3u1",label:"StyledField"})("margin-bottom:",u(1),";.components-panel__row &{margin-bottom:inherit;}"),g=Object(s.a)("label",{target:"e1puf3u2",label:"StyledLabel"})("display:inline-block;margin-bottom:",u(1),";"),p=Object(s.a)("p",{target:"e1puf3u3",label:"StyledHelp"})("margin-top:-",u(1),";font-size:",f("helpText.fontSize"),";font-style:normal;color:",Object(h.a)("mediumGray.text"),";");function m(e){var t=e.id,r=e.label,n=e.hideLabelFromVision,s=e.help,c=e.className,l=e.children;return Object(a.createElement)(d,{className:i()("components-base-control",c)},Object(a.createElement)(b,{className:"components-base-control__field"},r&&t&&(n?Object(a.createElement)(o.a,{as:"label",htmlFor:t},r):Object(a.createElement)(g,{className:"components-base-control__label",htmlFor:t},r)),r&&!t&&(n?Object(a.createElement)(o.a,{as:"label"},r):Object(a.createElement)(m.VisualLabel,null,r)),l),!!s&&Object(a.createElement)(p,{id:t+"__help",className:"components-base-control__help"},s))}m.VisualLabel=function(e){var t=e.className,r=e.children;return t=i()("components-base-control__label",t),Object(a.createElement)("span",{className:t},r)},t.a=m},221:function(e,t,r){var a;!function(n){var i=/^\s+/,o=/\s+$/,s=0,c=n.round,l=n.min,f=n.max,u=n.random;function h(e,t){if(t=t||{},(e=e||"")instanceof h)return e;if(!(this instanceof h))return new h(e,t);var r=function(e){var t,r,a,s={r:0,g:0,b:0},c=1,u=null,h=null,d=null,b=!1,g=!1;return"string"==typeof e&&(e=function(e){e=e.replace(i,"").replace(o,"").toLowerCase();var t,r=!1;if(P[e])e=P[e],r=!0;else if("transparent"==e)return{r:0,g:0,b:0,a:0,format:"name"};return(t=G.rgb.exec(e))?{r:t[1],g:t[2],b:t[3]}:(t=G.rgba.exec(e))?{r:t[1],g:t[2],b:t[3],a:t[4]}:(t=G.hsl.exec(e))?{h:t[1],s:t[2],l:t[3]}:(t=G.hsla.exec(e))?{h:t[1],s:t[2],l:t[3],a:t[4]}:(t=G.hsv.exec(e))?{h:t[1],s:t[2],v:t[3]}:(t=G.hsva.exec(e))?{h:t[1],s:t[2],v:t[3],a:t[4]}:(t=G.hex8.exec(e))?{r:z(t[1]),g:z(t[2]),b:z(t[3]),a:M(t[4]),format:r?"name":"hex8"}:(t=G.hex6.exec(e))?{r:z(t[1]),g:z(t[2]),b:z(t[3]),format:r?"name":"hex"}:(t=G.hex4.exec(e))?{r:z(t[1]+""+t[1]),g:z(t[2]+""+t[2]),b:z(t[3]+""+t[3]),a:M(t[4]+""+t[4]),format:r?"name":"hex8"}:!!(t=G.hex3.exec(e))&&{r:z(t[1]+""+t[1]),g:z(t[2]+""+t[2]),b:z(t[3]+""+t[3]),format:r?"name":"hex"}}(e)),"object"==typeof e&&(U(e.r)&&U(e.g)&&U(e.b)?(t=e.r,r=e.g,a=e.b,s={r:255*N(t,255),g:255*N(r,255),b:255*N(a,255)},b=!0,g="%"===String(e.r).substr(-1)?"prgb":"rgb"):U(e.h)&&U(e.s)&&U(e.v)?(u=L(e.s),h=L(e.v),s=function(e,t,r){e=6*N(e,360),t=N(t,100),r=N(r,100);var a=n.floor(e),i=e-a,o=r*(1-t),s=r*(1-i*t),c=r*(1-(1-i)*t),l=a%6;return{r:255*[r,s,o,o,c,r][l],g:255*[c,r,r,s,o,o][l],b:255*[o,o,c,r,r,s][l]}}(e.h,u,h),b=!0,g="hsv"):U(e.h)&&U(e.s)&&U(e.l)&&(u=L(e.s),d=L(e.l),s=function(e,t,r){var a,n,i;function o(e,t,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?e+6*(t-e)*r:r<.5?t:r<2/3?e+(t-e)*(2/3-r)*6:e}if(e=N(e,360),t=N(t,100),r=N(r,100),0===t)a=n=i=r;else{var s=r<.5?r*(1+t):r+t-r*t,c=2*r-s;a=o(c,s,e+1/3),n=o(c,s,e),i=o(c,s,e-1/3)}return{r:255*a,g:255*n,b:255*i}}(e.h,u,d),b=!0,g="hsl"),e.hasOwnProperty("a")&&(c=e.a)),c=F(c),{ok:b,format:e.format||g,r:l(255,f(s.r,0)),g:l(255,f(s.g,0)),b:l(255,f(s.b,0)),a:c}}(e);this._originalInput=e,this._r=r.r,this._g=r.g,this._b=r.b,this._a=r.a,this._roundA=c(100*this._a)/100,this._format=t.format||r.format,this._gradientType=t.gradientType,this._r<1&&(this._r=c(this._r)),this._g<1&&(this._g=c(this._g)),this._b<1&&(this._b=c(this._b)),this._ok=r.ok,this._tc_id=s++}function d(e,t,r){e=N(e,255),t=N(t,255),r=N(r,255);var a,n,i=f(e,t,r),o=l(e,t,r),s=(i+o)/2;if(i==o)a=n=0;else{var c=i-o;switch(n=s>.5?c/(2-i-o):c/(i+o),i){case e:a=(t-r)/c+(t<r?6:0);break;case t:a=(r-e)/c+2;break;case r:a=(e-t)/c+4}a/=6}return{h:a,s:n,l:s}}function b(e,t,r){e=N(e,255),t=N(t,255),r=N(r,255);var a,n,i=f(e,t,r),o=l(e,t,r),s=i,c=i-o;if(n=0===i?0:c/i,i==o)a=0;else{switch(i){case e:a=(t-r)/c+(t<r?6:0);break;case t:a=(r-e)/c+2;break;case r:a=(e-t)/c+4}a/=6}return{h:a,s:n,v:s}}function g(e,t,r,a){var n=[T(c(e).toString(16)),T(c(t).toString(16)),T(c(r).toString(16))];return a&&n[0].charAt(0)==n[0].charAt(1)&&n[1].charAt(0)==n[1].charAt(1)&&n[2].charAt(0)==n[2].charAt(1)?n[0].charAt(0)+n[1].charAt(0)+n[2].charAt(0):n.join("")}function p(e,t,r,a){return[T(D(a)),T(c(e).toString(16)),T(c(t).toString(16)),T(c(r).toString(16))].join("")}function m(e,t){t=0===t?0:t||10;var r=h(e).toHsl();return r.s-=t/100,r.s=H(r.s),h(r)}function v(e,t){t=0===t?0:t||10;var r=h(e).toHsl();return r.s+=t/100,r.s=H(r.s),h(r)}function y(e){return h(e).desaturate(100)}function k(e,t){t=0===t?0:t||10;var r=h(e).toHsl();return r.l+=t/100,r.l=H(r.l),h(r)}function w(e,t){t=0===t?0:t||10;var r=h(e).toRgb();return r.r=f(0,l(255,r.r-c(-t/100*255))),r.g=f(0,l(255,r.g-c(-t/100*255))),r.b=f(0,l(255,r.b-c(-t/100*255))),h(r)}function x(e,t){t=0===t?0:t||10;var r=h(e).toHsl();return r.l-=t/100,r.l=H(r.l),h(r)}function O(e,t){var r=h(e).toHsl(),a=(r.h+t)%360;return r.h=a<0?360+a:a,h(r)}function _(e){var t=h(e).toHsl();return t.h=(t.h+180)%360,h(t)}function A(e){var t=h(e).toHsl(),r=t.h;return[h(e),h({h:(r+120)%360,s:t.s,l:t.l}),h({h:(r+240)%360,s:t.s,l:t.l})]}function j(e){var t=h(e).toHsl(),r=t.h;return[h(e),h({h:(r+90)%360,s:t.s,l:t.l}),h({h:(r+180)%360,s:t.s,l:t.l}),h({h:(r+270)%360,s:t.s,l:t.l})]}function C(e){var t=h(e).toHsl(),r=t.h;return[h(e),h({h:(r+72)%360,s:t.s,l:t.l}),h({h:(r+216)%360,s:t.s,l:t.l})]}function S(e,t,r){t=t||6,r=r||30;var a=h(e).toHsl(),n=360/r,i=[h(e)];for(a.h=(a.h-(n*t>>1)+720)%360;--t;)a.h=(a.h+n)%360,i.push(h(a));return i}function R(e,t){t=t||6;for(var r=h(e).toHsv(),a=r.h,n=r.s,i=r.v,o=[],s=1/t;t--;)o.push(h({h:a,s:n,v:i})),i=(i+s)%1;return o}h.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var e=this.toRgb();return(299*e.r+587*e.g+114*e.b)/1e3},getLuminance:function(){var e,t,r,a=this.toRgb();return e=a.r/255,t=a.g/255,r=a.b/255,.2126*(e<=.03928?e/12.92:n.pow((e+.055)/1.055,2.4))+.7152*(t<=.03928?t/12.92:n.pow((t+.055)/1.055,2.4))+.0722*(r<=.03928?r/12.92:n.pow((r+.055)/1.055,2.4))},setAlpha:function(e){return this._a=F(e),this._roundA=c(100*this._a)/100,this},toHsv:function(){var e=b(this._r,this._g,this._b);return{h:360*e.h,s:e.s,v:e.v,a:this._a}},toHsvString:function(){var e=b(this._r,this._g,this._b),t=c(360*e.h),r=c(100*e.s),a=c(100*e.v);return 1==this._a?"hsv("+t+", "+r+"%, "+a+"%)":"hsva("+t+", "+r+"%, "+a+"%, "+this._roundA+")"},toHsl:function(){var e=d(this._r,this._g,this._b);return{h:360*e.h,s:e.s,l:e.l,a:this._a}},toHslString:function(){var e=d(this._r,this._g,this._b),t=c(360*e.h),r=c(100*e.s),a=c(100*e.l);return 1==this._a?"hsl("+t+", "+r+"%, "+a+"%)":"hsla("+t+", "+r+"%, "+a+"%, "+this._roundA+")"},toHex:function(e){return g(this._r,this._g,this._b,e)},toHexString:function(e){return"#"+this.toHex(e)},toHex8:function(e){return function(e,t,r,a,n){var i=[T(c(e).toString(16)),T(c(t).toString(16)),T(c(r).toString(16)),T(D(a))];return n&&i[0].charAt(0)==i[0].charAt(1)&&i[1].charAt(0)==i[1].charAt(1)&&i[2].charAt(0)==i[2].charAt(1)&&i[3].charAt(0)==i[3].charAt(1)?i[0].charAt(0)+i[1].charAt(0)+i[2].charAt(0)+i[3].charAt(0):i.join("")}(this._r,this._g,this._b,this._a,e)},toHex8String:function(e){return"#"+this.toHex8(e)},toRgb:function(){return{r:c(this._r),g:c(this._g),b:c(this._b),a:this._a}},toRgbString:function(){return 1==this._a?"rgb("+c(this._r)+", "+c(this._g)+", "+c(this._b)+")":"rgba("+c(this._r)+", "+c(this._g)+", "+c(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:c(100*N(this._r,255))+"%",g:c(100*N(this._g,255))+"%",b:c(100*N(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return 1==this._a?"rgb("+c(100*N(this._r,255))+"%, "+c(100*N(this._g,255))+"%, "+c(100*N(this._b,255))+"%)":"rgba("+c(100*N(this._r,255))+"%, "+c(100*N(this._g,255))+"%, "+c(100*N(this._b,255))+"%, "+this._roundA+")"},toName:function(){return 0===this._a?"transparent":!(this._a<1)&&(E[g(this._r,this._g,this._b,!0)]||!1)},toFilter:function(e){var t="#"+p(this._r,this._g,this._b,this._a),r=t,a=this._gradientType?"GradientType = 1, ":"";if(e){var n=h(e);r="#"+p(n._r,n._g,n._b,n._a)}return"progid:DXImageTransform.Microsoft.gradient("+a+"startColorstr="+t+",endColorstr="+r+")"},toString:function(e){var t=!!e;e=e||this._format;var r=!1,a=this._a<1&&this._a>=0;return t||!a||"hex"!==e&&"hex6"!==e&&"hex3"!==e&&"hex4"!==e&&"hex8"!==e&&"name"!==e?("rgb"===e&&(r=this.toRgbString()),"prgb"===e&&(r=this.toPercentageRgbString()),"hex"!==e&&"hex6"!==e||(r=this.toHexString()),"hex3"===e&&(r=this.toHexString(!0)),"hex4"===e&&(r=this.toHex8String(!0)),"hex8"===e&&(r=this.toHex8String()),"name"===e&&(r=this.toName()),"hsl"===e&&(r=this.toHslString()),"hsv"===e&&(r=this.toHsvString()),r||this.toHexString()):"name"===e&&0===this._a?this.toName():this.toRgbString()},clone:function(){return h(this.toString())},_applyModification:function(e,t){var r=e.apply(null,[this].concat([].slice.call(t)));return this._r=r._r,this._g=r._g,this._b=r._b,this.setAlpha(r._a),this},lighten:function(){return this._applyModification(k,arguments)},brighten:function(){return this._applyModification(w,arguments)},darken:function(){return this._applyModification(x,arguments)},desaturate:function(){return this._applyModification(m,arguments)},saturate:function(){return this._applyModification(v,arguments)},greyscale:function(){return this._applyModification(y,arguments)},spin:function(){return this._applyModification(O,arguments)},_applyCombination:function(e,t){return e.apply(null,[this].concat([].slice.call(t)))},analogous:function(){return this._applyCombination(S,arguments)},complement:function(){return this._applyCombination(_,arguments)},monochromatic:function(){return this._applyCombination(R,arguments)},splitcomplement:function(){return this._applyCombination(C,arguments)},triad:function(){return this._applyCombination(A,arguments)},tetrad:function(){return this._applyCombination(j,arguments)}},h.fromRatio=function(e,t){if("object"==typeof e){var r={};for(var a in e)e.hasOwnProperty(a)&&(r[a]="a"===a?e[a]:L(e[a]));e=r}return h(e,t)},h.equals=function(e,t){return!(!e||!t)&&h(e).toRgbString()==h(t).toRgbString()},h.random=function(){return h.fromRatio({r:u(),g:u(),b:u()})},h.mix=function(e,t,r){r=0===r?0:r||50;var a=h(e).toRgb(),n=h(t).toRgb(),i=r/100;return h({r:(n.r-a.r)*i+a.r,g:(n.g-a.g)*i+a.g,b:(n.b-a.b)*i+a.b,a:(n.a-a.a)*i+a.a})},h.readability=function(e,t){var r=h(e),a=h(t);return(n.max(r.getLuminance(),a.getLuminance())+.05)/(n.min(r.getLuminance(),a.getLuminance())+.05)},h.isReadable=function(e,t,r){var a,n,i,o,s,c=h.readability(e,t);switch(n=!1,(i=r,"AA"!==(o=((i=i||{level:"AA",size:"small"}).level||"AA").toUpperCase())&&"AAA"!==o&&(o="AA"),"small"!==(s=(i.size||"small").toLowerCase())&&"large"!==s&&(s="small"),a={level:o,size:s}).level+a.size){case"AAsmall":case"AAAlarge":n=c>=4.5;break;case"AAlarge":n=c>=3;break;case"AAAsmall":n=c>=7}return n},h.mostReadable=function(e,t,r){var a,n,i,o,s=null,c=0;n=(r=r||{}).includeFallbackColors,i=r.level,o=r.size;for(var l=0;l<t.length;l++)(a=h.readability(e,t[l]))>c&&(c=a,s=h(t[l]));return h.isReadable(e,s,{level:i,size:o})||!n?s:(r.includeFallbackColors=!1,h.mostReadable(e,["#fff","#000"],r))};var P=h.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",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:"f0f",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:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",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",rebeccapurple:"663399",red:"f00",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:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},E=h.hexNames=function(e){var t={};for(var r in e)e.hasOwnProperty(r)&&(t[e[r]]=r);return t}(P);function F(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}function N(e,t){(function(e){return"string"==typeof e&&-1!=e.indexOf(".")&&1===parseFloat(e)})(e)&&(e="100%");var r=function(e){return"string"==typeof e&&-1!=e.indexOf("%")}(e);return e=l(t,f(0,parseFloat(e))),r&&(e=parseInt(e*t,10)/100),n.abs(e-t)<1e-6?1:e%t/parseFloat(t)}function H(e){return l(1,f(0,e))}function z(e){return parseInt(e,16)}function T(e){return 1==e.length?"0"+e:""+e}function L(e){return e<=1&&(e=100*e+"%"),e}function D(e){return n.round(255*parseFloat(e)).toString(16)}function M(e){return z(e)/255}var I,q,$,G=(q="[\\s|\\(]+("+(I="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)")+")[,|\\s]+("+I+")[,|\\s]+("+I+")\\s*\\)?",$="[\\s|\\(]+("+I+")[,|\\s]+("+I+")[,|\\s]+("+I+")[,|\\s]+("+I+")\\s*\\)?",{CSS_UNIT:new RegExp(I),rgb:new RegExp("rgb"+q),rgba:new RegExp("rgba"+$),hsl:new RegExp("hsl"+q),hsla:new RegExp("hsla"+$),hsv:new RegExp("hsv"+q),hsva:new RegExp("hsva"+$),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/});function U(e){return!!G.CSS_UNIT.exec(e)}e.exports?e.exports=h:void 0===(a=function(){return h}.call(t,r,t,e))||(e.exports=a)}(Math)},63:function(e,t,r){"use strict";r.d(t,"b",(function(){return s})),r.d(t,"a",(function(){return c}));var a=r(7),n=r(221),i=r.n(n),o=r(217);function s(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,r=i()(e).toRgb(),a=r.r,n=r.g,o=r.b;return"rgba(".concat(a,", ").concat(n,", ").concat(o,", ").concat(t,")")}function c(e){return Object(a.get)(o.a,e,"#000")}}}]);woocommerce-blocks/build/vendors--atomic-block-components/add-to-cart-frontend.js000064400000034603151335517640024211 0ustar00(window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[50],{144:function(e,t,n){var r=n(71);e.exports=function(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,r(e,t)},e.exports.default=e.exports,e.exports.__esModule=!0},355:function(e,t,n){"use strict";var r=n(12),o=n(22),i=n(19),a=n(0),c=n(6),l=n.n(c),s=n(24),u=n(91);t.a=function(e){var t,n=e.icon,c=e.children,b=e.label,d=e.instructions,p=e.className,f=e.notices,m=e.preview,h=e.isColumnLayout,g=Object(i.a)(e,["icon","children","label","instructions","className","notices","preview","isColumnLayout"]),x=Object(s.useResizeObserver)(),v=Object(o.a)(x,2),O=v[0],j=v[1].width;"number"==typeof j&&(t={"is-large":j>=320,"is-medium":j>=160&&j<320,"is-small":j<160});var w=l()("components-placeholder",p,t),y=l()("components-placeholder__fieldset",{"is-column-layout":h});return Object(a.createElement)("div",Object(r.a)({},g,{className:w}),O,f,m&&Object(a.createElement)("div",{className:"components-placeholder__preview"},m),Object(a.createElement)("div",{className:"components-placeholder__label"},Object(a.createElement)(u.a,{icon:n}),b),!!d&&Object(a.createElement)("div",{className:"components-placeholder__instructions"},d),Object(a.createElement)("div",{className:y},c))}},39:function(e,t){function n(e,t,n,r,o,i,a){try{var c=e[i](a),l=c.value}catch(e){return void n(e)}c.done?t(l):Promise.resolve(l).then(r,o)}e.exports=function(e){return function(){var t=this,r=arguments;return new Promise((function(o,i){var a=e.apply(t,r);function c(e){n(a,o,i,c,l,"next",e)}function l(e){n(a,o,i,c,l,"throw",e)}c(void 0)}))}},e.exports.default=e.exports,e.exports.__esModule=!0},404:function(e,t,n){"use strict";var r=n(12),o=n(31),i=n(22),a=n(19),c=n(0),l=n(7),s=n(6),u=n.n(s),b=n(24),d=n(20);function p(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}var f=function(e){var t=e.icon,n=e.size,r=void 0===n?24:n,o=Object(a.a)(e,["icon","size"]);return Object(c.cloneElement)(t,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?p(Object(n),!0).forEach((function(t){Object(d.a)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):p(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({width:r,height:r},o))},m=n(34),h=Object(c.createElement)(m.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},Object(c.createElement)(m.Path,{d:"M17.5 11.6L12 16l-5.5-4.4.9-1.2L12 14l4.5-3.6 1 1.2z"})),g=n(220),x=n(124),v=n(141),O=n(218),j=n(211);function w(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var y=v.b,z=n(217);function _(){var e=w(["\n\t","\n\t","\n"]);return _=function(){return e},e}function E(){var e=w(["\n\t\t\t\t","\n\t\t\t\t","\n\t\t\t"]);return E=function(){return e},e}function k(){var e=w(["\n\t\t\t\t","\n\t\t\t\t","\n\t\t\t"]);return k=function(){return e},e}function F(){var e=w(["\n\t\t\t\t","\n\t\t\t"]);return F=function(){return e},e}function P(){var e=w(["\n\t\t\t\t","\n\t\t\t\t","\n\t\t\t"]);return P=function(){return e},e}function N(){var e=w(["\n\t\t\t\t","\n\t\t\t\t","\n\t\t\t"]);return N=function(){return e},e}function L(){var e=w(["\n\t\t\t\t","\n\t\t\t\t","\n\t\t\t"]);return L=function(){return e},e}function S(){var e=w(["\n\t\t\t\t","\n\t\t\t\t","\n\t\t\t"]);return S=function(){return e},e}function I(){var e=w(["\n\t\t\t\t","\n\t\t\t\t","\n\t\t\t"]);return I=function(){return e},e}var R="\n  ".concat("font-weight: 400;","\n"),C="\n\tfont-size: 32px;\n\tline-height: 40px;\n",B="\n\tfont-size: 24px;\n\tline-height: 32px;\n",D="\n\tfont-size: 20px;\n\tline-height: 28px;\n",H="\n\t".concat("font-weight: 600;","\n\tfont-size: 14px;\n\tline-height: 20px;\n"),V="\n\t".concat("font-weight: 400;","\n"),W="\n\tfont-size: 16px;\n\tline-height: 24px;\n",M="\n\tfont-size: 14px;\n\tline-height: 20px;\n",A="\n  ".concat("font-weight: 600;","\n  font-size: 14px;\n  line-height: 20px;\n"),T="\n\t".concat("font-weight: 400;","\n\tfont-size: 12px;\n\tline-height: 16px;\n"),U="\n\t".concat("font-weight: 600;","\n\tfont-size: 12px;\n\tline-height: 16px;\n"),J="\n\t".concat("font-weight: 500;","\n\tfont-size: 11px;\n\tline-height: 1.4;\n\ttext-transform: uppercase;\n\tcolor: ").concat(z.b.gray[700],"\n"),q=Object(x.a)("p",{target:"e15wbhsk0",label:"Text"})("\n\tbox-sizing: border-box;\n\tmargin: 0;\n",(function(e){return y(_(),'font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,\nOxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;',function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"body";switch(e){case"title.large":return y(I(),R,C);case"title.medium":return y(S(),R,B);case"title.small":return y(L(),R,D);case"subtitle":return y(N(),H,"\n\tfont-size: 16px;\n\tline-height: 24px;\n");case"subtitle.small":return y(P(),H,"\n\tfont-size: 14px;\n\tline-height: 20px;\n");case"body":return y(F(),V);case"body.large":return y(k(),V,W);case"body.small":return y(E(),V,M);case"button":return A;case"caption":return T;case"label":return U;case"sectionheading":return J}}(e.variant))}),""),G=n(63),K=new RegExp(/-left/g),Q=new RegExp(/-right/g),X=new RegExp(/Left/g),Y=new RegExp(/Right/g);function Z(){return!(!document||"rtl"!==document.documentElement.dir)}function $(e){return"left"===e?"right":"right"===e?"left":K.test(e)?e.replace(K,"-right"):Q.test(e)?e.replace(Q,"-left"):X.test(e)?e.replace(X,"Right"):Y.test(e)?e.replace(Y,"Left"):e}var ee=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Object(l.mapKeys)(e,(function(e,t){return $(t)}))};function te(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return function(){var n=Z();return t?n?Object(v.b)(t,""):Object(v.b)(e,""):n?Object(v.b)(ee(e),""):Object(v.b)(e,"")}}var ne={name:"1dacand",styles:"padding-top:0;"},re=function(){return ne},oe={name:"r6z5ec",styles:"z-index:1;"},ie=function(e){return e.isFocused?oe:""},ae={name:"uz6002",styles:"align-items:flex-start;flex-direction:column;"},ce={name:"53hdd7",styles:"align-items:flex-start;flex-direction:column-reverse;"},le={name:"x4dmss",styles:"justify-content:space-between;"},se=function(e){switch(e.labelPosition){case"top":return ae;case"bottom":return ce;case"edge":return le;default:return""}},ue=Object(x.a)(O.b,{target:"e1cr7zh10",label:"Root"})("position:relative;border-radius:2px;",re," ",ie," ",se,""),be={name:"8atqhb",styles:"width:100%;"},de=Object(x.a)("div",{target:"e1cr7zh11",label:"Container"})("align-items:center;box-sizing:border-box;border-radius:inherit;display:flex;flex:1;position:relative;",(function(e){var t=e.disabled?Object(G.a)("ui.backgroundDisabled"):Object(G.a)("ui.background");return Object(v.b)({backgroundColor:t},"")})," ",(function(e){var t=e.__unstableInputWidth,n=e.labelPosition;return t?"side"===n?"":"edge"===n?Object(v.b)({flex:"0 0 ".concat(t)},""):Object(v.b)({width:t},""):be}),""),pe={name:"103r1kr",styles:"&::-webkit-input-placeholder{line-height:normal;}"},fe=(Object(x.a)("input",{target:"e1cr7zh12",label:"Input"})("&&&{background-color:transparent;box-sizing:border-box;border:none;box-shadow:none !important;color:",Object(G.a)("black"),";display:block;margin:0;outline:none;padding-left:8px;padding-right:8px;width:100%;",(function(e){var t=e.isDragging,n=e.dragCursor,r="",o="";return t&&(r=Object(v.b)("cursor:",n,";user-select:none;&::-webkit-outer-spin-button,&::-webkit-inner-spin-button{-webkit-appearance:none !important;margin:0 !important;}")),t&&n&&(o=Object(v.b)("&:active{cursor:",n,";}")),Object(v.b)(r," ",o,"")})," ",(function(e){return e.disabled?Object(v.b)({color:Object(G.a)("ui.textDisabled")},""):""})," ",(function(e){var t={default:"13px",small:"11px"}[e.size];return t?Object(v.b)("font-size:","16px",";@media ( min-width:600px ){font-size:",t,";}"):""})," ",(function(e){var t={default:{height:30,lineHeight:1,minHeight:30},small:{height:24,lineHeight:1,minHeight:24}},n=t[e.size]||t.default;return Object(v.b)(n,"")})," ",(function(){return pe}),"}"),{name:"8uhtka",styles:"overflow:hidden;text-overflow:ellipsis;white-space:nowrap;"}),me=function(){return fe},he=function(e){var t=e.labelPosition,n=4;return"edge"!==t&&"side"!==t||(n=0),Object(v.b)({paddingTop:0,paddingBottom:n},"")},ge=Object(x.a)(q,{target:"e1cr7zh13",label:"BaseLabel"})("&&&{box-sizing:border-box;color:currentColor;display:block;margin:0;max-width:100%;z-index:1;",he," ",me,"}"),xe=function(e){return Object(c.createElement)(ge,Object(r.a)({},e,{as:"label"}))},ve=Object(x.a)(j.a,{target:"e1cr7zh14",label:"LabelWrapper"})({name:"120o8im",styles:"max-width:calc( 100% - 10px );"}),Oe=Object(x.a)("div",{target:"e1cr7zh15",label:"BackdropUI"})("&&&{box-sizing:border-box;border-radius:inherit;bottom:0;left:0;margin:0;padding:0;pointer-events:none;position:absolute;right:0;top:0;",(function(e){var t=e.disabled,n=e.isFocused,r=n?Object(G.a)("ui.borderFocus"):Object(G.a)("ui.border"),o=null;return n&&(o="0 0 0 1px ".concat(Object(G.a)("ui.borderFocus")," inset")),t&&(r=Object(G.a)("ui.borderDisabled")),Object(v.b)({boxShadow:o,borderColor:r,borderStyle:"solid",borderWidth:1},"")})," ",te({paddingLeft:2}),"}"),je=Object(x.a)("span",{target:"e1cr7zh16",label:"Prefix"})({name:"1pxuk39",styles:"box-sizing:border-box;display:block;"}),we=Object(x.a)("span",{target:"e1cr7zh17",label:"Suffix"})({name:"1pxuk39",styles:"box-sizing:border-box;display:block;"}),ye=Object(c.memo)((function(e){var t=e.disabled,n=void 0!==t&&t,r=e.isFocused,o=void 0!==r&&r;return Object(c.createElement)(Oe,{"aria-hidden":"true",className:"components-input-control__backdrop",disabled:n,isFocused:o})})),ze=n(195);function _e(e){var t=e.children,n=e.hideLabelFromVision,o=e.htmlFor,i=Object(a.a)(e,["children","hideLabelFromVision","htmlFor"]);return t?n?Object(c.createElement)(ze.a,{as:"label",htmlFor:o},t):Object(c.createElement)(xe,Object(r.a)({htmlFor:o},i),t):null}var Ee=Object(c.forwardRef)((function e(t,n){var o=t.__unstableInputWidth,i=t.children,l=t.className,s=t.disabled,u=void 0!==s&&s,d=t.hideLabelFromVision,p=void 0!==d&&d,f=t.labelPosition,m=t.id,h=t.isFocused,g=void 0!==h&&h,x=t.label,v=t.prefix,O=t.size,j=void 0===O?"default":O,w=t.suffix,y=Object(a.a)(t,["__unstableInputWidth","children","className","disabled","hideLabelFromVision","labelPosition","id","isFocused","label","prefix","size","suffix"]),z=function(t){var n=Object(b.useInstanceId)(e),r="input-base-control-".concat(n);return t||r}(m);return Object(c.createElement)(ue,Object(r.a)({},y,{className:l,isFocused:g,labelPosition:f,ref:n}),Object(c.createElement)(ve,null,Object(c.createElement)(_e,{className:"components-input-control__label",hideLabelFromVision:p,labelPosition:f,htmlFor:z,size:j},x)),Object(c.createElement)(de,{__unstableInputWidth:o,className:"components-input-control__container",disabled:u,isFocused:g,labelPosition:f},v&&Object(c.createElement)(je,{className:"components-input-control__prefix"},v),i,w&&Object(c.createElement)(we,{className:"components-input-control__suffix"},w),Object(c.createElement)(ye,{"aria-hidden":"true",disabled:u,isFocused:g,label:x,size:j})))})),ke=Object(x.a)("select",{target:"e12x0a390",label:"Select"})("&&&{appearance:none;background:transparent;box-sizing:border-box;border:none;box-shadow:none !important;color:",Object(G.a)("black"),";display:block;margin:0;outline:none;width:100%;",(function(e){return e.disabled?Object(v.b)({color:Object(G.a)("ui.textDisabled")},""):""}),";",(function(e){var t={default:"13px",small:"11px"}[e.size];return t?Object(v.b)("font-size:","16px",";@media ( min-width:600px ){font-size:",t,";}"):""}),";",(function(e){var t={default:{height:30,lineHeight:1,minHeight:30},small:{height:24,lineHeight:1,minHeight:24}},n=t[e.size]||t.default;return Object(v.b)(n,"")}),";",te({paddingLeft:8,paddingRight:24})(),"}"),Fe=Object(x.a)("div",{target:"e12x0a391",label:"DownArrowWrapper"})("align-items:center;bottom:0;box-sizing:border-box;display:flex;padding:0 4px;pointer-events:none;position:absolute;top:0;",te({right:0})()," svg{display:block;}");var Pe=Object(c.forwardRef)((function e(t,n){var s=t.className,d=t.disabled,p=void 0!==d&&d,m=t.help,x=t.hideLabelFromVision,v=t.id,O=t.label,j=t.multiple,w=void 0!==j&&j,y=t.onBlur,z=void 0===y?l.noop:y,_=t.onChange,E=void 0===_?l.noop:_,k=t.onFocus,F=void 0===k?l.noop:k,P=t.options,N=void 0===P?[]:P,L=t.size,S=void 0===L?"default":L,I=t.value,R=t.labelPosition,C=void 0===R?"top":R,B=Object(a.a)(t,["className","disabled","help","hideLabelFromVision","id","label","multiple","onBlur","onChange","onFocus","options","size","value","labelPosition"]),D=Object(c.useState)(!1),H=Object(i.a)(D,2),V=H[0],W=H[1],M=function(t){var n=Object(b.useInstanceId)(e),r="inspector-select-control-".concat(n);return t||r}(v),A=m?"".concat(M,"__help"):void 0;if(Object(l.isEmpty)(N))return null;var T=u()("components-select-control",s);return Object(c.createElement)(g.a,{help:m},Object(c.createElement)(Ee,{className:T,disabled:p,hideLabelFromVision:x,id:M,isFocused:V,label:O,size:S,suffix:Object(c.createElement)(Fe,null,Object(c.createElement)(f,{icon:h,size:18})),labelPosition:C},Object(c.createElement)(ke,Object(r.a)({},B,{"aria-describedby":A,className:"components-select-control__input",disabled:p,id:M,multiple:w,onBlur:function(e){z(e),W(!1)},onChange:function(e){if(w){var t=Object(o.a)(e.target.options).filter((function(e){return e.selected})).map((function(e){return e.value}));E(t)}else E(e.target.value,{event:e})},onFocus:function(e){F(e),W(!0)},ref:n,size:S,value:I}),N.map((function(e,t){var n=e.id||"".concat(e.label,"-").concat(e.value,"-").concat(t);return Object(c.createElement)("option",{key:n,value:e.value,disabled:e.disabled},e.label)})))))}));t.a=Pe},46:function(e,t,n){var r=n(94),o=n(95),i=n(67),a=n(96);e.exports=function(e){return r(e)||o(e)||i(e)||a()},e.exports.default=e.exports,e.exports.__esModule=!0},94:function(e,t,n){var r=n(68);e.exports=function(e){if(Array.isArray(e))return r(e)},e.exports.default=e.exports,e.exports.__esModule=!0},95:function(e,t){e.exports=function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)},e.exports.default=e.exports,e.exports.__esModule=!0},96:function(e,t){e.exports=function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},e.exports.default=e.exports,e.exports.__esModule=!0}}]);price--cart-blocks/line-items--cart-blocks/order-summary--checkout--8a3571de-frontend.js000064400000037515151335517640037650 0ustar00woocommerce-blocks/build/vendors--atomic-block-components(window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[1],{126:function(e,t,r){"use strict";var n=r(3),a=r.n(n);function o(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function i(){return(i=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}function s(e){return(s=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function u(e,t){return(u=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function l(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function c(){}function f(){}f.resetWarningCache=c;var p=function(e,t){return function(e){e.exports=function(){function e(e,t,r,n,a,o){if("SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"!==o){var i=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw i.name="Invariant Violation",i}}function t(){return e}e.isRequired=e;var r={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:f,resetWarningCache:c};return r.PropTypes=r,r}()}(t={exports:{}}),t.exports}();function h(){}function g(e){return!!(e||"").match(/\d/)}function m(e){return null==e}function d(e){return e.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&")}function v(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r="-"===e[0],n=r&&t,a=(e=e.replace("-","")).split("."),o=a[0],i=a[1]||"";return{beforeDecimal:o,afterDecimal:i,hasNagation:r,addNegation:n}}function y(e,t,r){for(var n="",a=r?"0":"",o=0;o<=t-1;o++)n+=e[o]||a;return n}function S(e,t){if(e.value=e.value,null!==e){if(e.createTextRange){var r=e.createTextRange();return r.move("character",t),r.select(),!0}return e.selectionStart||0===e.selectionStart?(e.focus(),e.setSelectionRange(t,t),!0):(e.focus(),!1)}}function b(e,t,r){return Math.min(Math.max(e,t),r)}function x(e){return Math.max(e.selectionStart,e.selectionEnd)}var w={thousandSeparator:p.oneOfType([p.string,p.oneOf([!0])]),decimalSeparator:p.string,allowedDecimalSeparators:p.arrayOf(p.string),thousandsGroupStyle:p.oneOf(["thousand","lakh","wan"]),decimalScale:p.number,fixedDecimalScale:p.bool,displayType:p.oneOf(["input","text"]),prefix:p.string,suffix:p.string,format:p.oneOfType([p.string,p.func]),removeFormatting:p.func,mask:p.oneOfType([p.string,p.arrayOf(p.string)]),value:p.oneOfType([p.number,p.string]),defaultValue:p.oneOfType([p.number,p.string]),isNumericString:p.bool,customInput:p.elementType,allowNegative:p.bool,allowEmptyFormatting:p.bool,allowLeadingZeros:p.bool,onValueChange:p.func,onKeyDown:p.func,onMouseUp:p.func,onChange:p.func,onFocus:p.func,onBlur:p.func,type:p.oneOf(["text","tel","password"]),isAllowed:p.func,renderText:p.func,getInputRef:p.oneOfType([p.func,p.shape({current:p.any})])},k={displayType:"input",decimalSeparator:".",thousandsGroupStyle:"thousand",fixedDecimalScale:!1,prefix:"",suffix:"",allowNegative:!0,allowEmptyFormatting:!1,allowLeadingZeros:!1,isNumericString:!1,type:"text",onValueChange:h,onChange:h,onKeyDown:h,onMouseUp:h,onFocus:h,onBlur:h,isAllowed:function(){return!0}},O=function(e){function t(e){var r,n;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),r=!(n=s(t).call(this,e))||"object"!=typeof n&&"function"!=typeof n?l(this):n;var a=e.defaultValue;r.validateProps();var o=r.formatValueProp(a);return r.state={value:o,numAsString:r.removeFormatting(o)},r.selectionBeforeInput={selectionStart:0,selectionEnd:0},r.onChange=r.onChange.bind(l(r)),r.onKeyDown=r.onKeyDown.bind(l(r)),r.onMouseUp=r.onMouseUp.bind(l(r)),r.onFocus=r.onFocus.bind(l(r)),r.onBlur=r.onBlur.bind(l(r)),r}var r,n;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&u(e,t)}(t,e),r=t,(n=[{key:"componentDidUpdate",value:function(e){this.updateValueIfRequired(e)}},{key:"componentWillUnmount",value:function(){clearTimeout(this.focusTimeout)}},{key:"updateValueIfRequired",value:function(e){var t=this.props,r=this.state,n=this.focusedElm,a=r.value,o=r.numAsString,i=void 0===o?"":o;if(e!==t){this.validateProps();var s=this.formatNumString(i),u=m(t.value)?s:this.formatValueProp(),l=this.removeFormatting(u),c=parseFloat(l),f=parseFloat(i);(isNaN(c)&&isNaN(f)||c===f)&&s===a&&(null!==n||u===a)||this.updateValue({formattedValue:u,numAsString:l,input:n})}}},{key:"getFloatString",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=this.props.decimalScale,r=this.getSeparators(),n=r.decimalSeparator,a=this.getNumberRegex(!0),o="-"===e[0];o&&(e=e.replace("-","")),n&&0===t&&(e=e.split(n)[0]);var i=(e=(e.match(a)||[]).join("").replace(n,".")).indexOf(".");return-1!==i&&(e="".concat(e.substring(0,i),".").concat(e.substring(i+1,e.length).replace(new RegExp(d(n),"g"),""))),o&&(e="-"+e),e}},{key:"getNumberRegex",value:function(e,t){var r=this.props,n=r.format,a=r.decimalScale,o=this.getSeparators().decimalSeparator;return new RegExp("\\d"+(!o||0===a||t||n?"":"|"+d(o)),e?"g":void 0)}},{key:"getSeparators",value:function(){var e=this.props.decimalSeparator,t=this.props,r=t.thousandSeparator,n=t.allowedDecimalSeparators;return!0===r&&(r=","),n||(n=[e,"."]),{decimalSeparator:e,thousandSeparator:r,allowedDecimalSeparators:n}}},{key:"getMaskAtIndex",value:function(e){var t=this.props.mask,r=void 0===t?" ":t;return"string"==typeof r?r:r[e]||" "}},{key:"getValueObject",value:function(e,t){var r=parseFloat(t);return{formattedValue:e,value:t,floatValue:isNaN(r)?void 0:r}}},{key:"validateProps",value:function(){var e=this.props.mask,t=this.getSeparators(),r=t.decimalSeparator,n=t.thousandSeparator;if(r===n)throw new Error("\n          Decimal separator can't be same as thousand separator.\n          thousandSeparator: ".concat(n,' (thousandSeparator = {true} is same as thousandSeparator = ",")\n          decimalSeparator: ').concat(r," (default value for decimalSeparator is .)\n       "));if(e&&("string"===e?e:e.toString()).match(/\d/g))throw new Error("\n          Mask ".concat(e," should not contain numeric character;\n        "))}},{key:"setPatchedCaretPosition",value:function(e,t,r){S(e,t),setTimeout((function(){e.value===r&&S(e,t)}),0)}},{key:"correctCaretPosition",value:function(e,t,r){var n=this.props,a=n.prefix,o=n.suffix,i=n.format;if(""===e)return 0;if(t=b(t,0,e.length),!i){var s="-"===e[0];return b(t,a.length+(s?1:0),e.length-o.length)}if("function"==typeof i)return t;if("#"===i[t]&&g(e[t]))return t;if("#"===i[t-1]&&g(e[t-1]))return t;var u=i.indexOf("#");t=b(t,u,i.lastIndexOf("#")+1);for(var l=i.substring(t,i.length).indexOf("#"),c=t,f=t+(-1===l?0:l);c>u&&("#"!==i[c]||!g(e[c]));)c-=1;return!g(e[f])||"left"===r&&t!==u||t-c<f-t?g(e[c])?c+1:c:f}},{key:"getCaretPosition",value:function(e,t,r){var n,a,o=this.props.format,i=this.state.value,s=this.getNumberRegex(!0),u=(e.match(s)||[]).join(""),l=(t.match(s)||[]).join("");for(n=0,a=0;a<r;a++){var c=e[a]||"",f=t[n]||"";if((c.match(s)||c===f)&&("0"!==c||!f.match(s)||"0"===f||u.length===l.length)){for(;c!==t[n]&&n<t.length;)n++;n++}}return"string"!=typeof o||i||(n=t.length),this.correctCaretPosition(t,n)}},{key:"removePrefixAndSuffix",value:function(e){var t=this.props,r=t.format,n=t.prefix,a=t.suffix;if(!r&&e){var o="-"===e[0];o&&(e=e.substring(1,e.length));var i=(e=n&&0===e.indexOf(n)?e.substring(n.length,e.length):e).lastIndexOf(a);e=a&&-1!==i&&i===e.length-a.length?e.substring(0,i):e,o&&(e="-"+e)}return e}},{key:"removePatternFormatting",value:function(e){for(var t=this.props.format.split("#").filter((function(e){return""!==e})),r=0,n="",a=0,o=t.length;a<=o;a++){var i=t[a]||"",s=a===o?e.length:e.indexOf(i,r);if(-1===s){n=e;break}n+=e.substring(r,s),r=s+i.length}return(n.match(/\d/g)||[]).join("")}},{key:"removeFormatting",value:function(e){var t=this.props,r=t.format,n=t.removeFormatting;return e?(r?e="string"==typeof r?this.removePatternFormatting(e):"function"==typeof n?n(e):(e.match(/\d/g)||[]).join(""):(e=this.removePrefixAndSuffix(e),e=this.getFloatString(e)),e):e}},{key:"formatWithPattern",value:function(e){for(var t=this.props.format,r=0,n=t.split(""),a=0,o=t.length;a<o;a++)"#"===t[a]&&(n[a]=e[r]||this.getMaskAtIndex(r),r+=1);return n.join("")}},{key:"formatAsNumber",value:function(e){var t=this.props,r=t.decimalScale,n=t.fixedDecimalScale,a=t.prefix,o=t.suffix,i=t.allowNegative,s=t.thousandsGroupStyle,u=this.getSeparators(),l=u.thousandSeparator,c=u.decimalSeparator,f=-1!==e.indexOf(".")||r&&n,p=v(e,i),h=p.beforeDecimal,g=p.afterDecimal,m=p.addNegation;return void 0!==r&&(g=y(g,r,n)),l&&(h=function(e,t,r){var n=function(e){switch(e){case"lakh":return/(\d+?)(?=(\d\d)+(\d)(?!\d))(\.\d+)?/g;case"wan":return/(\d)(?=(\d{4})+(?!\d))/g;case"thousand":default:return/(\d)(?=(\d{3})+(?!\d))/g}}(r),a=e.search(/[1-9]/);return a=-1===a?e.length:a,e.substring(0,a)+e.substring(a,e.length).replace(n,"$1"+t)}(h,l,s)),a&&(h=a+h),o&&(g+=o),m&&(h="-"+h),h+(f&&c||"")+g}},{key:"formatNumString",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=this.props,r=t.format,n=t.allowEmptyFormatting,a=e;return""!==e||n?"-"!==e||r?"string"==typeof r?this.formatWithPattern(a):"function"==typeof r?r(a):this.formatAsNumber(a):"-":""}},{key:"formatValueProp",value:function(e){var t=this.props,r=t.format,n=t.decimalScale,a=t.fixedDecimalScale,o=t.allowEmptyFormatting,i=this.props,s=i.value,u=i.isNumericString,l=!(s=m(s)?e:s)&&0!==s;return l&&o&&(s=""),l&&!o?"":("number"==typeof s&&(s=s.toString(),u=!0),"Infinity"===s&&u&&(s=""),u&&!r&&"number"==typeof n&&(s=function(e,t,r){if(-1!==["","-"].indexOf(e))return e;var n=-1!==e.indexOf(".")&&t,a=v(e),o=a.beforeDecimal,i=a.afterDecimal,s=a.hasNagation,u=parseFloat("0.".concat(i||"0")).toFixed(t).split("."),l=o.split("").reverse().reduce((function(e,t,r){return e.length>r?(Number(e[0])+Number(t)).toString()+e.substring(1,e.length):t+e}),u[0]),c=y(u[1]||"",Math.min(t,i.length),r),f=n?".":"";return"".concat(s?"-":"").concat(l).concat(f).concat(c)}(s,n,a)),u?this.formatNumString(s):this.formatInput(s))}},{key:"formatNegation",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=this.props.allowNegative,r=new RegExp("(-)"),n=new RegExp("(-)(.)*(-)"),a=r.test(e),o=n.test(e);return e=e.replace(/-/g,""),a&&!o&&t&&(e="-"+e),e}},{key:"formatInput",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=this.props.format;return t||(e=this.removePrefixAndSuffix(e),e=this.formatNegation(e)),e=this.removeFormatting(e),this.formatNumString(e)}},{key:"isCharacterAFormat",value:function(e,t){var r=this.props,n=r.format,a=r.prefix,o=r.suffix,i=r.decimalScale,s=r.fixedDecimalScale,u=this.getSeparators().decimalSeparator;return"string"==typeof n&&"#"!==n[e]||!(n||!(e<a.length||e>=t.length-o.length||i&&s&&t[e]===u))}},{key:"checkIfFormatGotDeleted",value:function(e,t,r){for(var n=e;n<t;n++)if(this.isCharacterAFormat(n,r))return!0;return!1}},{key:"correctInputValue",value:function(e,t,r){var n=this.props,a=n.format,o=n.allowNegative,i=n.prefix,s=n.suffix,u=n.decimalScale,l=this.getSeparators(),c=l.allowedDecimalSeparators,f=l.decimalSeparator,p=this.state.numAsString||"",h=this.selectionBeforeInput,g=h.selectionStart,m=h.selectionEnd,d=function(e,t){for(var r=0,n=0,a=e.length,o=t.length;e[r]===t[r]&&r<a;)r++;for(;e[a-1-n]===t[o-1-n]&&o-n>r&&a-n>r;)n++;return{start:r,end:a-n}}(t,r),y=d.start,S=d.end;if(!a&&y===S&&-1!==c.indexOf(r[g])){var b=0===u?"":f;return r.substr(0,g)+b+r.substr(g+1,r.length)}var x=a?0:i.length,w=t.length-(a?0:s.length);if(r.length>t.length||!r.length||y===S||0===g&&m===t.length||g===x&&m===w)return r;if(this.checkIfFormatGotDeleted(y,S,t)&&(r=t),!a){var k=this.removeFormatting(r),O=v(k,o),P=O.beforeDecimal,F=O.afterDecimal,N=O.addNegation,C=e<r.indexOf(f)+1;if(k.length<p.length&&C&&""===P&&!parseFloat(F))return N?"-":""}return r}},{key:"updateValue",value:function(e){var t=e.formattedValue,r=e.input,n=e.setCaretPosition,a=void 0===n||n,o=e.numAsString,i=e.caretPos,s=this.props.onValueChange,u=this.state.value;if(r)if(a){if(!i){var l=e.inputValue||r.value,c=x(r);r.value=t,i=this.getCaretPosition(l,t,c)}this.setPatchedCaretPosition(r,i,t)}else r.value=t;void 0===o&&(o=this.removeFormatting(t)),t!==u&&(this.setState({value:t,numAsString:o}),s(this.getValueObject(t,o)))}},{key:"onChange",value:function(e){var t=e.target,r=t.value,n=this.state,a=this.props,o=a.isAllowed,i=n.value||"",s=x(t);r=this.correctInputValue(s,i,r);var u=this.formatInput(r)||"",l=this.removeFormatting(u);o(this.getValueObject(u,l))||(u=i),this.updateValue({formattedValue:u,numAsString:l,inputValue:r,input:t}),a.onChange(e)}},{key:"onBlur",value:function(e){var t=this.props,r=this.state,n=t.format,a=t.onBlur,o=t.allowLeadingZeros,i=r.numAsString,s=r.value;if(this.focusedElm=null,clearTimeout(this.focusTimeout),!n){isNaN(parseFloat(i))&&(i=""),o||(i=function(e){if(!e)return e;var t="-"===e[0];t&&(e=e.substring(1,e.length));var r=e.split("."),n=r[0].replace(/^0+/,"")||"0",a=r[1]||"";return"".concat(t?"-":"").concat(n).concat(a?".".concat(a):"")}(i));var u=this.formatNumString(i);if(u!==s)return this.updateValue({formattedValue:u,numAsString:i,input:e.target,setCaretPosition:!1}),void a(e)}a(e)}},{key:"onKeyDown",value:function(e){var t,r=e.target,n=e.key,a=r.selectionStart,o=r.selectionEnd,i=r.value,s=void 0===i?"":i,u=this.props,l=u.decimalScale,c=u.fixedDecimalScale,f=u.prefix,p=u.suffix,h=u.format,g=u.onKeyDown,m=void 0!==l&&c,d=this.getNumberRegex(!1,m),v=new RegExp("-"),y="string"==typeof h;if(this.selectionBeforeInput={selectionStart:a,selectionEnd:o},"ArrowLeft"===n||"Backspace"===n?t=a-1:"ArrowRight"===n?t=a+1:"Delete"===n&&(t=a),void 0!==t&&a===o){var S=t,b=y?h.indexOf("#"):f.length,x=y?h.lastIndexOf("#")+1:s.length-p.length;if("ArrowLeft"===n||"ArrowRight"===n){var w="ArrowLeft"===n?"left":"right";S=this.correctCaretPosition(s,t,w)}else if("Delete"!==n||d.test(s[t])||v.test(s[t])){if("Backspace"===n&&!d.test(s[t]))if(a<=b+1&&"-"===s[0]&&void 0===h){var k=s.substring(1);this.updateValue({formattedValue:k,caretPos:S,input:r})}else if(!v.test(s[t])){for(;!d.test(s[S-1])&&S>b;)S--;S=this.correctCaretPosition(s,S,"left")}}else for(;!d.test(s[S])&&S<x;)S++;(S!==t||t<b||t>x)&&(e.preventDefault(),this.setPatchedCaretPosition(r,S,s)),e.isUnitTestRun&&this.setPatchedCaretPosition(r,S,s),g(e)}else g(e)}},{key:"onMouseUp",value:function(e){var t=e.target,r=t.selectionStart,n=t.selectionEnd,a=t.value,o=void 0===a?"":a;if(r===n){var i=this.correctCaretPosition(o,r);i!==r&&this.setPatchedCaretPosition(t,i,o)}this.props.onMouseUp(e)}},{key:"onFocus",value:function(e){var t=this;e.persist(),this.focusedElm=e.target,this.focusTimeout=setTimeout((function(){var r=e.target,n=r.selectionStart,a=r.selectionEnd,o=r.value,i=void 0===o?"":o,s=t.correctCaretPosition(i,n);s===n||0===n&&a===i.length||t.setPatchedCaretPosition(r,s,i),t.props.onFocus(e)}),0)}},{key:"render",value:function(){var e,t,r,n=this.props,o=n.type,s=n.displayType,u=n.customInput,l=n.renderText,c=n.getInputRef,f=n.format,p=this.state.value,h=(e=this.props,t=w,r={},Object.keys(e).forEach((function(n){t[n]||(r[n]=e[n])})),r),g=i({inputMode:function(e){return e||!(navigator.platform&&/iPhone|iPod/.test(navigator.platform))}(f)?"numeric":void 0},h,{type:o,value:p,onChange:this.onChange,onKeyDown:this.onKeyDown,onMouseUp:this.onMouseUp,onFocus:this.onFocus,onBlur:this.onBlur});if("text"===s)return l?l(p)||null:a.a.createElement("span",i({},h,{ref:c}),p);if(u){var m=u;return a.a.createElement(m,i({},g,{ref:c}))}return a.a.createElement("input",i({},g,{ref:c}))}}])&&o(r.prototype,n),t}(a.a.Component);O.propTypes=w,O.defaultProps=k,t.a=O}}]);woocommerce-blocks/build/wc-payment-method-paypal.js000064400000003450151335517640016635 0ustar00!function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=24)}({1:function(e,t){e.exports=window.wp.i18n},24:function(e,t,n){"use strict";n.r(t);var r,o=n(7),c=n(1),i=n(4),a=n(6),u=Object(i.getSetting)("paypal_data",{}),l=function(){return Object(a.decodeEntities)(u.description||"")},p={name:"paypal",label:React.createElement("img",{src:"".concat(i.WC_ASSET_URL,"/images/paypal.png"),alt:Object(a.decodeEntities)(u.title||Object(c.__)("PayPal",'woocommerce'))}),placeOrderButtonLabel:Object(c.__)("Proceed to PayPal",'woocommerce'),content:React.createElement(l,null),edit:React.createElement(l,null),canMakePayment:function(){return!0},ariaLabel:Object(a.decodeEntities)(u.title||Object(c.__)("Payment via PayPal",'woocommerce')),supports:{features:null!==(r=u.supports)&&void 0!==r?r:[]}};Object(o.registerPaymentMethod)(p)},4:function(e,t){e.exports=window.wc.wcSettings},6:function(e,t){e.exports=window.wp.htmlEntities},7:function(e,t){e.exports=window.wc.wcBlocksRegistry}});woocommerce-blocks/build/blocks-checkout.js000064400000232550151335517640015074 0ustar00this.wc=this.wc||{},this.wc.blocksCheckout=function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=160)}([function(e,t){e.exports=window.wp.element},function(e,t){e.exports=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=window.wp.i18n},,function(e,t){e.exports=window.lodash},function(e,t,n){var r;!function(){"use strict";var n={}.hasOwnProperty;function o(){for(var e=[],t=0;t<arguments.length;t++){var r=arguments[t];if(r){var i=typeof r;if("string"===i||"number"===i)e.push(r);else if(Array.isArray(r)){if(r.length){var c=o.apply(null,r);c&&e.push(c)}}else if("object"===i)if(r.toString===Object.prototype.toString)for(var a in r)n.call(r,a)&&r[a]&&e.push(a);else e.push(r.toString())}}return e.join(" ")}e.exports?(o.default=o,e.exports=o):void 0===(r=function(){return o}.apply(t,[]))||(e.exports=r)}()},function(e,t){function n(t){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?(e.exports=n=function(e){return typeof e},e.exports.default=e.exports,e.exports.__esModule=!0):(e.exports=n=function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.default=e.exports,e.exports.__esModule=!0),n(t)}e.exports=n,e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=window.wc.wcSettings},,function(e,t){e.exports=window.wp.deprecated},function(e,t){e.exports=window.wp.data},function(e,t){e.exports=window.wp.primitives},function(e,t,n){var r=n(20),o=n(21),i=n(18),c=n(22);e.exports=function(e,t){return r(e)||o(e,t)||i(e,t)||c()},e.exports.default=e.exports,e.exports.__esModule=!0},,function(e,t,n){"use strict";n.d(t,"c",(function(){return o})),n.d(t,"a",(function(){return i})),n.d(t,"b",(function(){return c}));var r=n(2),o="wc/store/cart",i={code:"cart_api_error",message:Object(r.__)("Unable to get cart data from the API.",'woocommerce'),data:{status:500}},c="wc-blocks_cart_update_timestamp"},function(e,t){function n(){return e.exports=n=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},e.exports.default=e.exports,e.exports.__esModule=!0,n.apply(this,arguments)}e.exports=n,e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=window.wp.compose},function(e,t){e.exports=window.React},function(e,t,n){var r=n(19);e.exports=function(e,t){if(e){if("string"==typeof e)return r(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(e,t):void 0}},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(e){if(Array.isArray(e))return e},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],_n=!0,c=!1;try{for(n=n.call(e);!(_n=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);_n=!0);}catch(e){c=!0,o=e}finally{try{_n||null==n.return||n.return()}finally{if(c)throw o}}return i}},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){function n(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}e.exports=function(e,t,r){return t&&n(e.prototype,t),r&&n(e,r),e},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=window.wp.dom},,function(e,t,n){var r=n(152);e.exports=function(e,t){if(null==e)return{};var n,o,i=r(e,t);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(e);for(o=0;o<c.length;o++)n=c[o],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,n){"use strict";(function(e){var r=n(0),o=(n(43),Object(r.createContext)({slots:{},fills:{},registerSlot:function(){void 0!==e&&e.env},updateSlot:function(){},unregisterSlot:function(){},registerFill:function(){},unregisterFill:function(){}}));t.a=o}).call(this,n(31))},,,function(e,t){var n,r,o=e.exports={};function i(){throw new Error("setTimeout has not been defined")}function c(){throw new Error("clearTimeout has not been defined")}function a(e){if(n===setTimeout)return setTimeout(e,0);if((n===i||!n)&&setTimeout)return n=setTimeout,setTimeout(e,0);try{return n(e,0)}catch(t){try{return n.call(null,e,0)}catch(t){return n.call(this,e,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:i}catch(e){n=i}try{r="function"==typeof clearTimeout?clearTimeout:c}catch(e){r=c}}();var u,s=[],l=!1,f=-1;function p(){l&&u&&(l=!1,u.length?s=u.concat(s):f=-1,s.length&&d())}function d(){if(!l){var e=a(p);l=!0;for(var t=s.length;t;){for(u=s,s=[];++f<t;)u&&u[f].run();f=-1,t=s.length}u=null,l=!1,function(e){if(r===clearTimeout)return clearTimeout(e);if((r===c||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(e);try{r(e)}catch(t){try{return r.call(null,e)}catch(t){return r.call(this,e)}}}(e)}}function m(e,t){this.fun=e,this.array=t}function h(){}o.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];s.push(new m(e,t)),1!==s.length||l||a(d)},m.prototype.run=function(){this.fun.apply(null,this.array)},o.title="browser",o.browser=!0,o.env={},o.argv=[],o.version="",o.versions={},o.on=h,o.addListener=h,o.once=h,o.off=h,o.removeListener=h,o.removeAllListeners=h,o.emit=h,o.prependListener=h,o.prependOnceListener=h,o.listeners=function(e){return[]},o.binding=function(e){throw new Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(e){throw new Error("process.chdir is not supported")},o.umask=function(){return 0}},,function(e,t){e.exports=window.wp.keycodes},function(e,t){e.exports=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e},e.exports.default=e.exports,e.exports.__esModule=!0},,function(e,t){function n(t){return e.exports=n=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},e.exports.default=e.exports,e.exports.__esModule=!0,n(t)}e.exports=n,e.exports.default=e.exports,e.exports.__esModule=!0},,,,,,,function(e,t){e.exports=window.wp.warning},function(e,t,n){"use strict";function r(e,t){return(r=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}n.d(t,"a",(function(){return r}))},function(e,t){e.exports=window.wp.isShallowEqual},function(e,t,n){var r=n(155);e.exports=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&r(e,t)},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,n){var r=n(6).default,o=n(34);e.exports=function(e,t){return!t||"object"!==r(t)&&"function"!=typeof t?o(e):t},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=window.wc.wcBlocksRegistry},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(e,t){},function(e,t){e.exports=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){},function(e,t){},function(e,t){function n(t,r){return e.exports=n=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},e.exports.default=e.exports,e.exports.__esModule=!0,n(t,r)}e.exports=n,e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t,n){"use strict";n.r(t),n.d(t,"TotalsItem",(function(){return V})),n.d(t,"Subtotal",(function(){return H})),n.d(t,"TotalsTaxes",(function(){return z})),n.d(t,"TotalsFees",(function(){return K})),n.d(t,"mustContain",(function(){return $})),n.d(t,"returnTrue",(function(){return G})),n.d(t,"extensionCartUpdate",(function(){return Z})),n.d(t,"hasValidFills",(function(){return ot})),n.d(t,"useSlot",(function(){return nt})),n.d(t,"createSlotFill",(function(){return it})),n.d(t,"__experimentalRegisterCheckoutFilters",(function(){return lt})),n.d(t,"__experimentalApplyCheckoutFilter",(function(){return ft})),n.d(t,"TotalsWrapper",(function(){return pt})),n.d(t,"hasInnerBlocks",(function(){return mt})),n.d(t,"getRegisteredBlocks",(function(){return ht})),n.d(t,"registerCheckoutBlock",(function(){return gt})),n.d(t,"innerBlockAreas",(function(){return ut})),n.d(t,"ExperimentalOrderMeta",(function(){return jt})),n.d(t,"ExperimentalDiscountsMeta",(function(){return kt})),n.d(t,"ExperimentalOrderShippingPackages",(function(){return Ct})),n.d(t,"Panel",(function(){return Bt})),n.d(t,"SlotFillProvider",(function(){return Ne})),n.d(t,"Button",(function(){return Pn})),n.d(t,"Label",(function(){return Tn}));var r=n(0),o=n(5),i=n.n(o),c=n(15),a=n.n(c),u=n(1),s=n.n(u),l=n(27),f=n.n(l),p=n(17),d=n.n(p);function m(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function h(){return(h=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function b(e){return(b=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function v(e,t){return(v=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function g(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function y(){}function O(){}O.resetWarningCache=y;var w=function(e,t){return function(e){e.exports=function(){function e(e,t,n,r,o,i){if("SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"!==i){var c=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw c.name="Invariant Violation",c}}function t(){return e}e.isRequired=e;var n={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:O,resetWarningCache:y};return n.PropTypes=n,n}()}(t={exports:{}}),t.exports}();function j(){}function S(e){return!!(e||"").match(/\d/)}function x(e){return null==e}function E(e){return e.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&")}function k(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n="-"===e[0],r=n&&t,o=(e=e.replace("-","")).split("."),i=o[0],c=o[1]||"";return{beforeDecimal:i,afterDecimal:c,hasNagation:n,addNegation:r}}function P(e,t,n){for(var r="",o=n?"0":"",i=0;i<=t-1;i++)r+=e[i]||o;return r}function _(e,t){if(e.value=e.value,null!==e){if(e.createTextRange){var n=e.createTextRange();return n.move("character",t),n.select(),!0}return e.selectionStart||0===e.selectionStart?(e.focus(),e.setSelectionRange(t,t),!0):(e.focus(),!1)}}function F(e,t,n){return Math.min(Math.max(e,t),n)}function C(e){return Math.max(e.selectionStart,e.selectionEnd)}var T={thousandSeparator:w.oneOfType([w.string,w.oneOf([!0])]),decimalSeparator:w.string,allowedDecimalSeparators:w.arrayOf(w.string),thousandsGroupStyle:w.oneOf(["thousand","lakh","wan"]),decimalScale:w.number,fixedDecimalScale:w.bool,displayType:w.oneOf(["input","text"]),prefix:w.string,suffix:w.string,format:w.oneOfType([w.string,w.func]),removeFormatting:w.func,mask:w.oneOfType([w.string,w.arrayOf(w.string)]),value:w.oneOfType([w.number,w.string]),defaultValue:w.oneOfType([w.number,w.string]),isNumericString:w.bool,customInput:w.elementType,allowNegative:w.bool,allowEmptyFormatting:w.bool,allowLeadingZeros:w.bool,onValueChange:w.func,onKeyDown:w.func,onMouseUp:w.func,onChange:w.func,onFocus:w.func,onBlur:w.func,type:w.oneOf(["text","tel","password"]),isAllowed:w.func,renderText:w.func,getInputRef:w.oneOfType([w.func,w.shape({current:w.any})])},D={displayType:"input",decimalSeparator:".",thousandsGroupStyle:"thousand",fixedDecimalScale:!1,prefix:"",suffix:"",allowNegative:!0,allowEmptyFormatting:!1,allowLeadingZeros:!1,isNumericString:!1,type:"text",onValueChange:j,onChange:j,onKeyDown:j,onMouseUp:j,onFocus:j,onBlur:j,isAllowed:function(){return!0}},N=function(e){function t(e){var n,r;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),n=!(r=b(t).call(this,e))||"object"!=typeof r&&"function"!=typeof r?g(this):r;var o=e.defaultValue;n.validateProps();var i=n.formatValueProp(o);return n.state={value:i,numAsString:n.removeFormatting(i)},n.selectionBeforeInput={selectionStart:0,selectionEnd:0},n.onChange=n.onChange.bind(g(n)),n.onKeyDown=n.onKeyDown.bind(g(n)),n.onMouseUp=n.onMouseUp.bind(g(n)),n.onFocus=n.onFocus.bind(g(n)),n.onBlur=n.onBlur.bind(g(n)),n}var n,r;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&v(e,t)}(t,e),n=t,(r=[{key:"componentDidUpdate",value:function(e){this.updateValueIfRequired(e)}},{key:"componentWillUnmount",value:function(){clearTimeout(this.focusTimeout)}},{key:"updateValueIfRequired",value:function(e){var t=this.props,n=this.state,r=this.focusedElm,o=n.value,i=n.numAsString,c=void 0===i?"":i;if(e!==t){this.validateProps();var a=this.formatNumString(c),u=x(t.value)?a:this.formatValueProp(),s=this.removeFormatting(u),l=parseFloat(s),f=parseFloat(c);(isNaN(l)&&isNaN(f)||l===f)&&a===o&&(null!==r||u===o)||this.updateValue({formattedValue:u,numAsString:s,input:r})}}},{key:"getFloatString",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=this.props.decimalScale,n=this.getSeparators(),r=n.decimalSeparator,o=this.getNumberRegex(!0),i="-"===e[0];i&&(e=e.replace("-","")),r&&0===t&&(e=e.split(r)[0]);var c=(e=(e.match(o)||[]).join("").replace(r,".")).indexOf(".");return-1!==c&&(e="".concat(e.substring(0,c),".").concat(e.substring(c+1,e.length).replace(new RegExp(E(r),"g"),""))),i&&(e="-"+e),e}},{key:"getNumberRegex",value:function(e,t){var n=this.props,r=n.format,o=n.decimalScale,i=this.getSeparators().decimalSeparator;return new RegExp("\\d"+(!i||0===o||t||r?"":"|"+E(i)),e?"g":void 0)}},{key:"getSeparators",value:function(){var e=this.props.decimalSeparator,t=this.props,n=t.thousandSeparator,r=t.allowedDecimalSeparators;return!0===n&&(n=","),r||(r=[e,"."]),{decimalSeparator:e,thousandSeparator:n,allowedDecimalSeparators:r}}},{key:"getMaskAtIndex",value:function(e){var t=this.props.mask,n=void 0===t?" ":t;return"string"==typeof n?n:n[e]||" "}},{key:"getValueObject",value:function(e,t){var n=parseFloat(t);return{formattedValue:e,value:t,floatValue:isNaN(n)?void 0:n}}},{key:"validateProps",value:function(){var e=this.props.mask,t=this.getSeparators(),n=t.decimalSeparator,r=t.thousandSeparator;if(n===r)throw new Error("\n          Decimal separator can't be same as thousand separator.\n          thousandSeparator: ".concat(r,' (thousandSeparator = {true} is same as thousandSeparator = ",")\n          decimalSeparator: ').concat(n," (default value for decimalSeparator is .)\n       "));if(e&&("string"===e?e:e.toString()).match(/\d/g))throw new Error("\n          Mask ".concat(e," should not contain numeric character;\n        "))}},{key:"setPatchedCaretPosition",value:function(e,t,n){_(e,t),setTimeout((function(){e.value===n&&_(e,t)}),0)}},{key:"correctCaretPosition",value:function(e,t,n){var r=this.props,o=r.prefix,i=r.suffix,c=r.format;if(""===e)return 0;if(t=F(t,0,e.length),!c){var a="-"===e[0];return F(t,o.length+(a?1:0),e.length-i.length)}if("function"==typeof c)return t;if("#"===c[t]&&S(e[t]))return t;if("#"===c[t-1]&&S(e[t-1]))return t;var u=c.indexOf("#");t=F(t,u,c.lastIndexOf("#")+1);for(var s=c.substring(t,c.length).indexOf("#"),l=t,f=t+(-1===s?0:s);l>u&&("#"!==c[l]||!S(e[l]));)l-=1;return!S(e[f])||"left"===n&&t!==u||t-l<f-t?S(e[l])?l+1:l:f}},{key:"getCaretPosition",value:function(e,t,n){var r,o,i=this.props.format,c=this.state.value,a=this.getNumberRegex(!0),u=(e.match(a)||[]).join(""),s=(t.match(a)||[]).join("");for(r=0,o=0;o<n;o++){var l=e[o]||"",f=t[r]||"";if((l.match(a)||l===f)&&("0"!==l||!f.match(a)||"0"===f||u.length===s.length)){for(;l!==t[r]&&r<t.length;)r++;r++}}return"string"!=typeof i||c||(r=t.length),this.correctCaretPosition(t,r)}},{key:"removePrefixAndSuffix",value:function(e){var t=this.props,n=t.format,r=t.prefix,o=t.suffix;if(!n&&e){var i="-"===e[0];i&&(e=e.substring(1,e.length));var c=(e=r&&0===e.indexOf(r)?e.substring(r.length,e.length):e).lastIndexOf(o);e=o&&-1!==c&&c===e.length-o.length?e.substring(0,c):e,i&&(e="-"+e)}return e}},{key:"removePatternFormatting",value:function(e){for(var t=this.props.format.split("#").filter((function(e){return""!==e})),n=0,r="",o=0,i=t.length;o<=i;o++){var c=t[o]||"",a=o===i?e.length:e.indexOf(c,n);if(-1===a){r=e;break}r+=e.substring(n,a),n=a+c.length}return(r.match(/\d/g)||[]).join("")}},{key:"removeFormatting",value:function(e){var t=this.props,n=t.format,r=t.removeFormatting;return e?(n?e="string"==typeof n?this.removePatternFormatting(e):"function"==typeof r?r(e):(e.match(/\d/g)||[]).join(""):(e=this.removePrefixAndSuffix(e),e=this.getFloatString(e)),e):e}},{key:"formatWithPattern",value:function(e){for(var t=this.props.format,n=0,r=t.split(""),o=0,i=t.length;o<i;o++)"#"===t[o]&&(r[o]=e[n]||this.getMaskAtIndex(n),n+=1);return r.join("")}},{key:"formatAsNumber",value:function(e){var t=this.props,n=t.decimalScale,r=t.fixedDecimalScale,o=t.prefix,i=t.suffix,c=t.allowNegative,a=t.thousandsGroupStyle,u=this.getSeparators(),s=u.thousandSeparator,l=u.decimalSeparator,f=-1!==e.indexOf(".")||n&&r,p=k(e,c),d=p.beforeDecimal,m=p.afterDecimal,h=p.addNegation;return void 0!==n&&(m=P(m,n,r)),s&&(d=function(e,t,n){var r=function(e){switch(e){case"lakh":return/(\d+?)(?=(\d\d)+(\d)(?!\d))(\.\d+)?/g;case"wan":return/(\d)(?=(\d{4})+(?!\d))/g;case"thousand":default:return/(\d)(?=(\d{3})+(?!\d))/g}}(n),o=e.search(/[1-9]/);return o=-1===o?e.length:o,e.substring(0,o)+e.substring(o,e.length).replace(r,"$1"+t)}(d,s,a)),o&&(d=o+d),i&&(m+=i),h&&(d="-"+d),d+(f&&l||"")+m}},{key:"formatNumString",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=this.props,n=t.format,r=t.allowEmptyFormatting,o=e;return""!==e||r?"-"!==e||n?"string"==typeof n?this.formatWithPattern(o):"function"==typeof n?n(o):this.formatAsNumber(o):"-":""}},{key:"formatValueProp",value:function(e){var t=this.props,n=t.format,r=t.decimalScale,o=t.fixedDecimalScale,i=t.allowEmptyFormatting,c=this.props,a=c.value,u=c.isNumericString,s=!(a=x(a)?e:a)&&0!==a;return s&&i&&(a=""),s&&!i?"":("number"==typeof a&&(a=a.toString(),u=!0),"Infinity"===a&&u&&(a=""),u&&!n&&"number"==typeof r&&(a=function(e,t,n){if(-1!==["","-"].indexOf(e))return e;var r=-1!==e.indexOf(".")&&t,o=k(e),i=o.beforeDecimal,c=o.afterDecimal,a=o.hasNagation,u=parseFloat("0.".concat(c||"0")).toFixed(t).split("."),s=i.split("").reverse().reduce((function(e,t,n){return e.length>n?(Number(e[0])+Number(t)).toString()+e.substring(1,e.length):t+e}),u[0]),l=P(u[1]||"",Math.min(t,c.length),n),f=r?".":"";return"".concat(a?"-":"").concat(s).concat(f).concat(l)}(a,r,o)),u?this.formatNumString(a):this.formatInput(a))}},{key:"formatNegation",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=this.props.allowNegative,n=new RegExp("(-)"),r=new RegExp("(-)(.)*(-)"),o=n.test(e),i=r.test(e);return e=e.replace(/-/g,""),o&&!i&&t&&(e="-"+e),e}},{key:"formatInput",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=this.props.format;return t||(e=this.removePrefixAndSuffix(e),e=this.formatNegation(e)),e=this.removeFormatting(e),this.formatNumString(e)}},{key:"isCharacterAFormat",value:function(e,t){var n=this.props,r=n.format,o=n.prefix,i=n.suffix,c=n.decimalScale,a=n.fixedDecimalScale,u=this.getSeparators().decimalSeparator;return"string"==typeof r&&"#"!==r[e]||!(r||!(e<o.length||e>=t.length-i.length||c&&a&&t[e]===u))}},{key:"checkIfFormatGotDeleted",value:function(e,t,n){for(var r=e;r<t;r++)if(this.isCharacterAFormat(r,n))return!0;return!1}},{key:"correctInputValue",value:function(e,t,n){var r=this.props,o=r.format,i=r.allowNegative,c=r.prefix,a=r.suffix,u=r.decimalScale,s=this.getSeparators(),l=s.allowedDecimalSeparators,f=s.decimalSeparator,p=this.state.numAsString||"",d=this.selectionBeforeInput,m=d.selectionStart,h=d.selectionEnd,b=function(e,t){for(var n=0,r=0,o=e.length,i=t.length;e[n]===t[n]&&n<o;)n++;for(;e[o-1-r]===t[i-1-r]&&i-r>n&&o-r>n;)r++;return{start:n,end:o-r}}(t,n),v=b.start,g=b.end;if(!o&&v===g&&-1!==l.indexOf(n[m])){var y=0===u?"":f;return n.substr(0,m)+y+n.substr(m+1,n.length)}var O=o?0:c.length,w=t.length-(o?0:a.length);if(n.length>t.length||!n.length||v===g||0===m&&h===t.length||m===O&&h===w)return n;if(this.checkIfFormatGotDeleted(v,g,t)&&(n=t),!o){var j=this.removeFormatting(n),S=k(j,i),x=S.beforeDecimal,E=S.afterDecimal,P=S.addNegation,_=e<n.indexOf(f)+1;if(j.length<p.length&&_&&""===x&&!parseFloat(E))return P?"-":""}return n}},{key:"updateValue",value:function(e){var t=e.formattedValue,n=e.input,r=e.setCaretPosition,o=void 0===r||r,i=e.numAsString,c=e.caretPos,a=this.props.onValueChange,u=this.state.value;if(n)if(o){if(!c){var s=e.inputValue||n.value,l=C(n);n.value=t,c=this.getCaretPosition(s,t,l)}this.setPatchedCaretPosition(n,c,t)}else n.value=t;void 0===i&&(i=this.removeFormatting(t)),t!==u&&(this.setState({value:t,numAsString:i}),a(this.getValueObject(t,i)))}},{key:"onChange",value:function(e){var t=e.target,n=t.value,r=this.state,o=this.props,i=o.isAllowed,c=r.value||"",a=C(t);n=this.correctInputValue(a,c,n);var u=this.formatInput(n)||"",s=this.removeFormatting(u);i(this.getValueObject(u,s))||(u=c),this.updateValue({formattedValue:u,numAsString:s,inputValue:n,input:t}),o.onChange(e)}},{key:"onBlur",value:function(e){var t=this.props,n=this.state,r=t.format,o=t.onBlur,i=t.allowLeadingZeros,c=n.numAsString,a=n.value;if(this.focusedElm=null,clearTimeout(this.focusTimeout),!r){isNaN(parseFloat(c))&&(c=""),i||(c=function(e){if(!e)return e;var t="-"===e[0];t&&(e=e.substring(1,e.length));var n=e.split("."),r=n[0].replace(/^0+/,"")||"0",o=n[1]||"";return"".concat(t?"-":"").concat(r).concat(o?".".concat(o):"")}(c));var u=this.formatNumString(c);if(u!==a)return this.updateValue({formattedValue:u,numAsString:c,input:e.target,setCaretPosition:!1}),void o(e)}o(e)}},{key:"onKeyDown",value:function(e){var t,n=e.target,r=e.key,o=n.selectionStart,i=n.selectionEnd,c=n.value,a=void 0===c?"":c,u=this.props,s=u.decimalScale,l=u.fixedDecimalScale,f=u.prefix,p=u.suffix,d=u.format,m=u.onKeyDown,h=void 0!==s&&l,b=this.getNumberRegex(!1,h),v=new RegExp("-"),g="string"==typeof d;if(this.selectionBeforeInput={selectionStart:o,selectionEnd:i},"ArrowLeft"===r||"Backspace"===r?t=o-1:"ArrowRight"===r?t=o+1:"Delete"===r&&(t=o),void 0!==t&&o===i){var y=t,O=g?d.indexOf("#"):f.length,w=g?d.lastIndexOf("#")+1:a.length-p.length;if("ArrowLeft"===r||"ArrowRight"===r){var j="ArrowLeft"===r?"left":"right";y=this.correctCaretPosition(a,t,j)}else if("Delete"!==r||b.test(a[t])||v.test(a[t])){if("Backspace"===r&&!b.test(a[t]))if(o<=O+1&&"-"===a[0]&&void 0===d){var S=a.substring(1);this.updateValue({formattedValue:S,caretPos:y,input:n})}else if(!v.test(a[t])){for(;!b.test(a[y-1])&&y>O;)y--;y=this.correctCaretPosition(a,y,"left")}}else for(;!b.test(a[y])&&y<w;)y++;(y!==t||t<O||t>w)&&(e.preventDefault(),this.setPatchedCaretPosition(n,y,a)),e.isUnitTestRun&&this.setPatchedCaretPosition(n,y,a),m(e)}else m(e)}},{key:"onMouseUp",value:function(e){var t=e.target,n=t.selectionStart,r=t.selectionEnd,o=t.value,i=void 0===o?"":o;if(n===r){var c=this.correctCaretPosition(i,n);c!==n&&this.setPatchedCaretPosition(t,c,i)}this.props.onMouseUp(e)}},{key:"onFocus",value:function(e){var t=this;e.persist(),this.focusedElm=e.target,this.focusTimeout=setTimeout((function(){var n=e.target,r=n.selectionStart,o=n.selectionEnd,i=n.value,c=void 0===i?"":i,a=t.correctCaretPosition(c,r);a===r||0===r&&o===c.length||t.setPatchedCaretPosition(n,a,c),t.props.onFocus(e)}),0)}},{key:"render",value:function(){var e,t,n,r=this.props,o=r.type,i=r.displayType,c=r.customInput,a=r.renderText,u=r.getInputRef,s=r.format,l=this.state.value,f=(e=this.props,t=T,n={},Object.keys(e).forEach((function(r){t[r]||(n[r]=e[r])})),n),p=h({inputMode:function(e){return e||!(navigator.platform&&/iPhone|iPod/.test(navigator.platform))}(s)?"numeric":void 0},f,{type:o,value:l,onChange:this.onChange,onKeyDown:this.onKeyDown,onMouseUp:this.onMouseUp,onFocus:this.onFocus,onBlur:this.onBlur});if("text"===i)return a?a(l)||null:d.a.createElement("span",h({},f,{ref:u}),l);if(c){var m=c;return d.a.createElement(m,h({},p,{ref:u}))}return d.a.createElement("input",h({},p,{ref:u}))}}])&&m(n.prototype,r),t}(d.a.Component);N.propTypes=T,N.defaultProps=D;var R=N,M=(n(153),["className","value","currency","onValueChange","displayType"]);function I(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function A(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?I(Object(n),!0).forEach((function(t){s()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):I(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var B=function(e){var t=e.className,n=e.value,o=e.currency,c=e.onValueChange,u=e.displayType,s=void 0===u?"text":u,l=f()(e,M),p="string"==typeof n?parseInt(n,10):n;if(!Number.isFinite(p))return null;var d=p/Math.pow(10,o.minorUnit);if(!Number.isFinite(d))return null;var m=i()("wc-block-formatted-money-amount","wc-block-components-formatted-money-amount",t),h=A(A(A({},l),function(e){return{thousandSeparator:e.thousandSeparator,decimalSeparator:e.decimalSeparator,decimalScale:e.minorUnit,fixedDecimalScale:!0,prefix:e.prefix,suffix:e.suffix,isNumericString:!0}}(o)),{},{value:void 0,currency:void 0,onValueChange:void 0}),b=c?function(e){var t=e.value*Math.pow(10,o.minorUnit);c(t)}:function(){};return Object(r.createElement)(R,a()({className:m,displayType:s},h,{value:d,onValueChange:b}))},L=(n(151),function(e){var t=e.value,n=e.currency;return Object(r.isValidElement)(t)?Object(r.createElement)("div",{className:"wc-block-components-totals-item__value"},t):Number.isFinite(t)?Object(r.createElement)(B,{className:"wc-block-components-totals-item__value",currency:n||{},value:t}):null}),V=function(e){var t=e.className,n=e.currency,o=e.label,c=e.value,a=e.description;return Object(r.createElement)("div",{className:i()("wc-block-components-totals-item",t)},Object(r.createElement)("span",{className:"wc-block-components-totals-item__label"},o),Object(r.createElement)(L,{value:c,currency:n}),Object(r.createElement)("div",{className:"wc-block-components-totals-item__description"},a))},U=n(2),W=n(7),H=function(e){var t=e.currency,n=e.values,o=e.className,i=n.total_items,c=n.total_items_tax,a=parseInt(i,10),u=parseInt(c,10);return Object(r.createElement)(V,{className:o,currency:t,label:Object(U.__)("Subtotal",'woocommerce'),value:Object(W.getSetting)("displayCartPricesIncludingTax",!1)?a+u:a})},z=(n(154),function(e){var t=e.currency,n=e.values,o=e.className,c=e.showRateAfterTaxName,a=n.total_tax,u=n.tax_lines;if(!Object(W.getSetting)("taxesEnabled",!0)&&parseInt(a,10)<=0)return null;var s=Object(W.getSetting)("displayItemizedTaxes",!1),l=s&&u.length>0?Object(r.createElement)("div",{className:i()("wc-block-components-totals-taxes",o)},u.map((function(e,n){var o=e.name,i=e.rate,a=e.price,u="".concat(o).concat(c?" ".concat(i):"");return Object(r.createElement)(V,{key:"tax-line-".concat(n),className:"wc-block-components-totals-taxes__grouped-rate",currency:t,label:u,value:parseInt(a,10)})}))," "):null;return s?l:Object(r.createElement)(r.Fragment,null,Object(r.createElement)(V,{className:i()("wc-block-components-totals-taxes",o),currency:t,label:Object(U.__)("Taxes",'woocommerce'),value:parseInt(a,10),description:null}))}),K=function(e){var t=e.currency,n=e.cartFees,o=e.className;return Object(r.createElement)(r.Fragment,null,n.map((function(e,n){var c=e.id,a=e.name,u=e.totals,s=parseInt(u.total,10);if(!s)return null;var l=parseInt(u.total_tax,10);return Object(r.createElement)(V,{key:c||"".concat(n,"-").concat(a),className:i()("wc-block-components-totals-fees",o),currency:t,label:a||Object(U.__)("Fee",'woocommerce'),value:Object(W.getSetting)("displayCartPricesIncludingTax",!1)?s+l:s})})))},$=function(e,t){if(!e.includes(t))throw Error(Object(U.sprintf)(
/* translators: %1$s value passed to filter, %2$s : value that must be included. */
Object(U.__)('Returned value must include %1$s, you passed "%2$s"','woocommerce'),e,t));return!0},G=function(){return!0},q=n(10),Y=n(14),Z=function(e){return(0,Object(q.dispatch)(Y.c).applyExtensionCartUpdate)(e)},J=n(9),Q=n.n(J),X=n(11);function ee(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var te=n(28);function ne(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function re(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ne(Object(n),!0).forEach((function(t){ee(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ne(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function oe(e){var t=Object(r.useContext)(te.a),n=t.slots[e]||{},o=t.fills[e],i=Object(r.useMemo)((function(){return o||[]}),[o]),c=Object(r.useCallback)((function(n){t.updateSlot(e,n)}),[e,t.updateSlot]),a=Object(r.useCallback)((function(n){t.unregisterSlot(e,n)}),[e,t.unregisterSlot]),u=Object(r.useCallback)((function(n){t.registerFill(e,n)}),[e,t.registerFill]),s=Object(r.useCallback)((function(n){t.unregisterFill(e,n)}),[e,t.unregisterFill]);return re(re({},n),{},{updateSlot:c,unregisterSlot:a,fills:i,registerFill:u,unregisterFill:s})}function ie(){return(ie=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function ce(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function ae(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ue(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function se(e,t,n){return t&&ue(e.prototype,t),n&&ue(e,n),e}function le(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function fe(e){return(fe=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function pe(e,t,n){return(pe="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var r=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=fe(e)););return e}(e,t);if(r){var o=Object.getOwnPropertyDescriptor(r,t);return o.get?o.get.call(n):o.value}})(e,t,n||e)}var de=n(44);function me(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Object(de.a)(e,t)}var he=n(6),be=n.n(he);function ve(e,t){return!t||"object"!==be()(t)&&"function"!=typeof t?le(e):t}var ge=n(4);function ye(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Oe(e,t){if(e){if("string"==typeof e)return ye(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ye(e,t):void 0}}function we(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],_n=!0,c=!1;try{for(n=n.call(e);!(_n=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);_n=!0);}catch(e){c=!0,o=e}finally{try{_n||null==n.return||n.return()}finally{if(c)throw o}}return i}}(e,t)||Oe(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function je(e){return function(e){if(Array.isArray(e))return ye(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||Oe(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Se(e){return(Se="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var xe=n(45),Ee=n.n(xe);function ke(e){var t=function(e,t){if("object"!==Se(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==Se(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===Se(t)?t:String(t)}function Pe(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function _e(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Pe(Object(n),!0).forEach((function(t){ee(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Pe(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Fe(e){var t,n,o,i,c,a,u,s,l,f,p,d=e.children,m=(t=we(Object(r.useState)({}),2),n=t[0],o=t[1],i=we(Object(r.useState)({}),2),c=i[0],a=i[1],u=Object(r.useCallback)((function(e,t,n){o((function(r){var o=r[e]||{};return _e(_e({},r),{},ee({},e,_e(_e({},o),{},{ref:t||o.ref,fillProps:n||o.fillProps||{}})))}))}),[]),s=Object(r.useCallback)((function(e,t){o((function(n){var r=n[e],o=ce(n,[e].map(ke));return(null==r?void 0:r.ref)===t?o:n}))}),[]),l=Object(r.useCallback)((function(e,t){var r=n[e];if(r&&!Ee()(r.fillProps,t)){r.fillProps=t;var o=c[e];o&&o.map((function(e){return e.current.rerender()}))}}),[n,c]),f=Object(r.useCallback)((function(e,t){a((function(n){return _e(_e({},n),{},ee({},e,[].concat(je(n[e]||[]),[t])))}))}),[]),p=Object(r.useCallback)((function(e,t){a((function(n){return n[e]?_e(_e({},n),{},ee({},e,n[e].filter((function(e){return e!==t})))):n}))}),[]),Object(r.useMemo)((function(){return{slots:n,fills:c,registerSlot:u,updateSlot:l,unregisterSlot:s,registerFill:f,unregisterFill:p}}),[n,c,u,l,s,f,p]));return Object(r.createElement)(te.a.Provider,{value:m},d)}var Ce=Object(r.createContext)({registerSlot:function(){},unregisterSlot:function(){},registerFill:function(){},unregisterFill:function(){},getSlot:function(){},getFills:function(){},subscribe:function(){}}),Te=Ce.Provider,De=Ce.Consumer,Ne=function(e){me(i,e);var t,n,o=(t=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=fe(t);if(n){var o=fe(this).constructor;e=Reflect.construct(r,arguments,o)}else e=r.apply(this,arguments);return ve(this,e)});function i(){var e;return ae(this,i),(e=o.apply(this,arguments)).registerSlot=e.registerSlot.bind(le(e)),e.registerFill=e.registerFill.bind(le(e)),e.unregisterSlot=e.unregisterSlot.bind(le(e)),e.unregisterFill=e.unregisterFill.bind(le(e)),e.getSlot=e.getSlot.bind(le(e)),e.getFills=e.getFills.bind(le(e)),e.hasFills=e.hasFills.bind(le(e)),e.subscribe=e.subscribe.bind(le(e)),e.slots={},e.fills={},e.listeners=[],e.contextValue={registerSlot:e.registerSlot,unregisterSlot:e.unregisterSlot,registerFill:e.registerFill,unregisterFill:e.unregisterFill,getSlot:e.getSlot,getFills:e.getFills,hasFills:e.hasFills,subscribe:e.subscribe},e}return se(i,[{key:"registerSlot",value:function(e,t){var n=this.slots[e];this.slots[e]=t,this.triggerListeners(),this.forceUpdateSlot(e),n&&n.forceUpdate()}},{key:"registerFill",value:function(e,t){this.fills[e]=[].concat(je(this.fills[e]||[]),[t]),this.forceUpdateSlot(e)}},{key:"unregisterSlot",value:function(e,t){this.slots[e]===t&&(delete this.slots[e],this.triggerListeners())}},{key:"unregisterFill",value:function(e,t){this.fills[e]=Object(ge.without)(this.fills[e],t),this.resetFillOccurrence(e),this.forceUpdateSlot(e)}},{key:"getSlot",value:function(e){return this.slots[e]}},{key:"getFills",value:function(e,t){return this.slots[e]!==t?[]:Object(ge.sortBy)(this.fills[e],"occurrence")}},{key:"hasFills",value:function(e){return this.fills[e]&&!!this.fills[e].length}},{key:"resetFillOccurrence",value:function(e){Object(ge.forEach)(this.fills[e],(function(e){e.occurrence=void 0}))}},{key:"forceUpdateSlot",value:function(e){var t=this.getSlot(e);t&&t.forceUpdate()}},{key:"triggerListeners",value:function(){this.listeners.forEach((function(e){return e()}))}},{key:"subscribe",value:function(e){var t=this;return this.listeners.push(e),function(){t.listeners=Object(ge.without)(t.listeners,e)}}},{key:"render",value:function(){return Object(r.createElement)(Te,{value:this.contextValue},Object(r.createElement)(Fe,null,this.props.children))}}]),i}(r.Component);var Re=function(e){me(i,e);var t,n,o=(t=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=fe(t);if(n){var o=fe(this).constructor;e=Reflect.construct(r,arguments,o)}else e=r.apply(this,arguments);return ve(this,e)});function i(){var e;return ae(this,i),(e=o.apply(this,arguments)).isUnmounted=!1,e.bindNode=e.bindNode.bind(le(e)),e}return se(i,[{key:"componentDidMount",value:function(){(0,this.props.registerSlot)(this.props.name,this)}},{key:"componentWillUnmount",value:function(){var e=this.props.unregisterSlot;this.isUnmounted=!0,e(this.props.name,this)}},{key:"componentDidUpdate",value:function(e){var t=this.props,n=t.name,r=t.unregisterSlot,o=t.registerSlot;e.name!==n&&(r(e.name),o(n,this))}},{key:"bindNode",value:function(e){this.node=e}},{key:"forceUpdate",value:function(){this.isUnmounted||pe(fe(i.prototype),"forceUpdate",this).call(this)}},{key:"render",value:function(){var e=this.props,t=e.children,n=e.name,o=e.fillProps,i=void 0===o?{}:o,c=e.getFills,a=Object(ge.map)(c(n,this),(function(e){var t=e.occurrence,n=Object(ge.isFunction)(e.children)?e.children(i):e.children;return r.Children.map(n,(function(e,n){if(!e||Object(ge.isString)(e))return e;var o="".concat(t,"---").concat(e.key||n);return Object(r.cloneElement)(e,{key:o})}))})).filter(Object(ge.negate)(r.isEmptyElement));return Object(r.createElement)(r.Fragment,null,Object(ge.isFunction)(t)?t(a):a)}}]),i}(r.Component),Me=function(e){return Object(r.createElement)(De,null,(function(t){var n=t.registerSlot,o=t.unregisterSlot,i=t.getFills;return Object(r.createElement)(Re,ie({},e,{registerSlot:n,unregisterSlot:o,getFills:i}))}))},Ie=0;function Ae(e){var t=e.name,n=e.children,o=e.registerFill,i=e.unregisterFill,c=function(e){var t=Object(r.useContext)(Ce),n=t.getSlot,o=t.subscribe,i=we(Object(r.useState)(n(e)),2),c=i[0],a=i[1];return Object(r.useEffect)((function(){return a(n(e)),o((function(){a(n(e))}))}),[e]),c}(t),a=Object(r.useRef)({name:t,children:n});return a.current.occurrence||(a.current.occurrence=++Ie),Object(r.useLayoutEffect)((function(){return o(t,a.current),function(){return i(t,a.current)}}),[]),Object(r.useLayoutEffect)((function(){a.current.children=n,c&&c.forceUpdate()}),[n]),Object(r.useLayoutEffect)((function(){t!==a.current.name&&(i(a.current.name,a.current),a.current.name=t,o(t,a.current))}),[t]),c&&c.node?(Object(ge.isFunction)(n)&&(n=n(c.props.fillProps)),Object(r.createPortal)(n,c.node)):null}var Be=function(e){return Object(r.createElement)(De,null,(function(t){var n=t.registerFill,o=t.unregisterFill;return Object(r.createElement)(Ae,ie({},e,{registerFill:n,unregisterFill:o}))}))};function Le(e){var t=e.name,n=e.fillProps,o=void 0===n?{}:n,i=e.as,c=void 0===i?"div":i,a=ce(e,["name","fillProps","as"]),u=Object(r.useContext)(te.a),s=Object(r.useRef)();return Object(r.useLayoutEffect)((function(){return u.registerSlot(t,s,o),function(){u.unregisterSlot(t,s)}}),[u.registerSlot,u.unregisterSlot,t]),Object(r.useLayoutEffect)((function(){u.updateSlot(t,o)})),Object(r.createElement)(c,ie({ref:s},a))}function Ve(e){var t,n=e.name,o=e.children,i=oe(n),c=Object(r.useRef)({rerender:(t=we(Object(r.useState)({}),2)[1],function(){return t({})})});return Object(r.useEffect)((function(){return i.registerFill(c),function(){i.unregisterFill(c)}}),[i.registerFill,i.unregisterFill]),i.ref&&i.ref.current?("function"==typeof o&&(o=o(i.fillProps)),Object(r.createPortal)(o,i.ref.current)):null}function Ue(e){var t=e.bubblesVirtually,n=ce(e,["bubblesVirtually"]);return t?Object(r.createElement)(Le,n):Object(r.createElement)(Me,n)}function We(e){return Object(r.createElement)(r.Fragment,null,Object(r.createElement)(Be,e),Object(r.createElement)(Ve,e))}function He(e){var t=function(t){return Object(r.createElement)(We,ie({name:e},t))};t.displayName=e+"Fill";var n=function(t){return Object(r.createElement)(Ue,ie({name:e},t))};return n.displayName=e+"Slot",{Fill:t,Slot:n}}var ze=n(23),Ke=n.n(ze),$e=n(24),Ge=n.n($e),qe=n(34),Ye=n.n(qe),Ze=n(46),Je=n.n(Ze),Qe=n(47),Xe=n.n(Qe),et=n(36),tt=n.n(et);var nt,rt=function(e){Je()(i,e);var t,n,o=(t=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=tt()(t);if(n){var o=tt()(this).constructor;e=Reflect.construct(r,arguments,o)}else e=r.apply(this,arguments);return Xe()(this,e)});function i(){var e;Ke()(this,i);for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return e=o.call.apply(o,[this].concat(n)),s()(Ye()(e),"state",{errorMessage:"",hasError:!1}),e}return Ge()(i,[{key:"render",value:function(){var e=this.props.renderError,t=this.state,n=t.errorMessage;return t.hasError?"function"==typeof e?e(n):Object(r.createElement)("p",null,n):this.props.children}}],[{key:"getDerivedStateFromError",value:function(e){return void 0!==e.statusText&&void 0!==e.status?{errorMessage:Object(r.createElement)(r.Fragment,null,Object(r.createElement)("strong",null,e.status),": "+e.statusText),hasError:!0}:{errorMessage:e.message,hasError:!0}}}]),i}(p.Component),ot=function(e){return Array.isArray(e)&&e.filter(Boolean).length>0};nt=oe;var it=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=He(e),o=n.Fill,i=n.Slot,c=function(e){var n=e.children;return Object(r.createElement)(o,null,(function(e){return r.Children.map(n,(function(n){return Object(r.createElement)(rt,{renderError:W.CURRENT_USER_IS_ADMIN?t:function(){return null}},Object(r.cloneElement)(n,e))}))}))},u=function(e){return Object(r.createElement)(i,a()({},e,{bubblesVirtually:!0}))};return{Fill:c,Slot:u}};function ct(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function at(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ct(Object(n),!0).forEach((function(t){s()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ct(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var ut,st={},lt=function(e,t){Object.keys(t).includes("couponName")&&Q()("snackbarNotices",{alternative:"snackbarNoticeVisibility",plugin:"WooCommerce Blocks",link:"https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/4417"}),Object.keys(t).includes("couponName")&&Q()("couponName",{alternative:"coupons",plugin:"WooCommerce Blocks",link:"https://github.com/woocommerce/woocommerce-gutenberg-products-block/blob/bb921d21f42e21f38df2b1c87b48e07aa4cb0538/docs/extensibility/available-filters.md#coupons"}),st=at(at({},st),{},s()({},e,t))},ft=function(e){var t=e.filterName,n=e.defaultValue,o=e.extensions,i=void 0===o?null:o,c=e.arg,a=void 0===c?null:c,u=e.validation,s=void 0===u?G:u;return Object(r.useMemo)((function(){var e=function(e){return Object.keys(st).map((function(t){return st[t][e]})).filter(Boolean)}(t),r=n;return e.forEach((function(e){try{var t=e(r,i||{},a);if(be()(t)!==be()(r))throw new Error(Object(U.sprintf)(
/* translators: %1$s is the type of the variable passed to the filter function, %2$s is the type of the value returned by the filter function. */
Object(U.__)("The type returned by checkout filters must be the same as the type they receive. The function received %1$s but returned %2$s.",'woocommerce'),be()(r),be()(t)));r=s(t)?t:r}catch(e){if(W.CURRENT_USER_IS_ADMIN)throw e;console.error(e)}})),r}),[t,n,i,a,s])},pt=(n(156),function(e){var t=e.children,n=e.slotWrapper,o=void 0!==n&&n;return p.Children.count(t)?Object(r.createElement)("div",{className:"wc-block-components-totals-wrapper".concat(o?" slot-wrapper":"")},t):null});!function(e){e.CHECKOUT="woocommerce/checkout",e.CHECKOUT_FIELDS="woocommerce/checkout-fields-block",e.CHECKOUT_TOTALS="woocommerce/checkout-totals-block",e.CONTACT_INFORMATION="woocommerce/checkout-contact-information-block",e.SHIPPING_ADDRESS="woocommerce/checkout-shipping-address-block",e.BILLING_ADDRESS="woocommerce/checkout-billing-address-block",e.SHIPPING_METHODS="woocommerce/checkout-shipping-methods-block",e.PAYMENT_METHODS="woocommerce/checkout-payment-methods-block",e.CART="woocommerce/cart-i2",e.EMPTY_CART="woocommerce/empty-cart-block",e.FILLED_CART="woocommerce/filled-cart-block",e.CART_ITEMS="woocommerce/cart-items-block",e.CART_TOTALS="woocommerce/cart-totals-block"}(ut||(ut={}));var dt={},mt=function(e){return Object.values(ut).includes(e)},ht=function(e){return mt(e)?Object.values(dt).filter((function(t){var n=t.metadata;return((null==n?void 0:n.parent)||[]).includes(e)})):[]},bt=n(48),vt=function(e){return!function(e){return null===e}(e)&&e instanceof Object&&e.constructor===Object},gt=function(e){var t,n,r,o;!function(e,t,n){if(vt(e)){var r=be()(e.metadata);if("object"!==r)throw new Error("Incorrect value for the ".concat("metadata"," argument when registering a block component. It was a ").concat(r,", but must be a ").concat("object","."))}}(e),function(e){if(function(e,t,n){var r=be()(t);if("string"!==r)throw new Error("Incorrect value for the ".concat("blockName"," argument when registering a checkout block. It was a ").concat(r,", but must be a ").concat("string","."))}(0,e),!e)throw new Error("Value for the blockName argument must not be empty.")}(e.metadata.name),function(e){if("string"!=typeof e&&!Array.isArray(e))throw new Error("Incorrect value for the parent argument when registering a checkout block. It was a ".concat(be()(e),", but must be a string or array of strings."));if("string"==typeof e&&!mt(e))throw new Error("When registering a checkout block, the parent must be a valid inner block area.");if(Array.isArray(e)&&!e.some((function(e){return mt(e)})))throw new Error("When registering a checkout block, the parent must be a valid inner block area.")}(e.metadata.parent),function(e,t){var n=e.component;if(n){if("function"==typeof n)return;if(vt(n)&&n.$$typeof&&n.$$typeof===Symbol.for("react.lazy"))return}throw new Error("Incorrect value for the ".concat("component"," argument when registering a block component. Component must be a valid React Element or Lazy callback."))}(e),Object(bt.registerBlockComponent)({blockName:e.metadata.name,component:e.component}),dt[e.metadata.name]={blockName:e.metadata.name,metadata:e.metadata,component:e.component,force:!(null===(t=e.metadata)||void 0===t||null===(n=t.attributes)||void 0===n||null===(r=n.lock)||void 0===r||null===(o=r.default)||void 0===o||!o.remove)}},yt=it("__experimentalOrderMeta"),Ot=yt.Fill,wt=yt.Slot;Ot.Slot=function(e){var t=e.className,n=e.extensions,o=e.cart,c=nt("__experimentalOrderMeta").fills;return ot(c)&&Object(r.createElement)(pt,{slotWrapper:!0},Object(r.createElement)(wt,{className:i()(t,"wc-block-components-order-meta"),fillProps:{extensions:n,cart:o}}))};var jt=Ot,St=it("__experimentalDiscountsMeta"),xt=St.Fill,Et=St.Slot;xt.Slot=function(e){var t=e.className,n=e.extensions,o=e.cart,c=nt("__experimentalDiscountsMeta").fills;return ot(c)&&Object(r.createElement)(pt,{slotWrapper:!0},Object(r.createElement)(Et,{className:i()(t,"wc-block-components-discounts-meta"),fillProps:{extensions:n,cart:o}}))};var kt=xt,Pt=it("__experimentalOrderShippingPackages"),_t=Pt.Fill,Ft=Pt.Slot;_t.Slot=function(e){var t=e.className,n=e.collapsible,o=e.noResultsMessage,c=e.renderOption,a=e.extensions,u=e.cart,s=e.components,l=nt("__experimentalOrderShippingPackages").fills.length>1;return Object(r.createElement)(Ft,{className:i()("wc-block-components-shipping-rates-control",t),fillProps:{collapsible:n,collapse:l,showItems:l,noResultsMessage:o,renderOption:c,extensions:a,cart:u,components:s}})};var Ct=_t,Tt=n(12),Dt=n.n(Tt),Nt=["srcElement","size"];function Rt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}var Mt=function(e){var t=e.srcElement,n=e.size,o=void 0===n?24:n,i=f()(e,Nt);return Object(r.isValidElement)(t)?Object(r.cloneElement)(t,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Rt(Object(n),!0).forEach((function(t){s()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Rt(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({width:o,height:o},i)):null},It=Object(r.createElement)(X.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},Object(r.createElement)("path",{d:"M12 8l-6 5.4 1 1.2 5-4.6 5 4.6 1-1.2z"})),At=Object(r.createElement)(X.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},Object(r.createElement)("path",{d:"M17 9.4L12 14 7 9.4l-1 1.2 6 5.4 6-5.4z"})),Bt=(n(157),function(e){var t=e.children,n=e.className,o=e.initialOpen,c=void 0!==o&&o,a=e.hasBorder,u=void 0!==a&&a,s=e.title,l=e.titleTag,f=void 0===l?"div":l,p=Object(r.useState)(c),d=Dt()(p,2),m=d[0],h=d[1];return Object(r.createElement)("div",{className:i()(n,"wc-block-components-panel",{"has-border":u})},Object(r.createElement)(f,null,Object(r.createElement)("button",{"aria-expanded":m,className:"wc-block-components-panel__button",onClick:function(){return h(!m)}},Object(r.createElement)(Mt,{"aria-hidden":"true",className:"wc-block-components-panel__button-icon",srcElement:m?It:At}),s)),m&&Object(r.createElement)("div",{className:"wc-block-components-panel__content"},t))}),Lt=n(25),Vt=n(33),Ut=n(16),Wt=Object(r.createElement)(X.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(r.createElement)(X.Path,{d:"M13 11.8l6.1-6.3-1-1-6.1 6.2-6.1-6.2-1 1 6.1 6.3-6.5 6.7 1 1 6.5-6.6 6.5 6.6 1-1z"}));function Ht(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function zt(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ht(Object(n),!0).forEach((function(t){ee(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ht(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Kt(e,t,n,r,o,i,c){var a=t.width,u="rtl"===document.documentElement.dir;"left"===n&&u?n="right":"right"===n&&u&&(n="left"),"left"===r&&u?r="right":"right"===r&&u&&(r="left");var s=Math.round(e.left+e.width/2),l={popoverLeft:s,contentWidth:(s-a/2>0?a/2:s)+(s+a/2>window.innerWidth?window.innerWidth-s:a/2)},f=e.left;"right"===r?f=e.right:"middle"!==i&&(f=s);var p=e.right;"left"===r?p=e.left:"middle"!==i&&(p=s);var d,m={popoverLeft:f,contentWidth:f-a>0?a:f},h={popoverLeft:p,contentWidth:p+a>window.innerWidth?window.innerWidth-p:a},b=n,v=null;if(!o)if("center"===n&&l.contentWidth===a)b="center";else if("left"===n&&m.contentWidth===a)b="left";else if("right"===n&&h.contentWidth===a)b="right";else{var g="left"==(b=m.contentWidth>h.contentWidth?"left":"right")?m.contentWidth:h.contentWidth;v=g!==a?g:null}if(d="center"===b?l.popoverLeft:"left"===b?m.popoverLeft:h.popoverLeft,c){var y=c.getBoundingClientRect();d=Math.min(d,y.right-a)}return{xAxis:b,popoverLeft:d,contentWidth:v}}function $t(e,t,n,r,o,i,c){var a=t.height;if(o){var u=(Object(Lt.getScrollContainer)(i)||document.body).getBoundingClientRect().top+a-c;if(e.top<=u)return{yAxis:n,popoverTop:Math.min(e.bottom,u)}}var s=e.top+e.height/2;"bottom"===r?s=e.bottom:"top"===r&&(s=e.top);var l={popoverTop:s,contentHeight:(s-a/2>0?a/2:s)+(s+a/2>window.innerHeight?window.innerHeight-s:a/2)},f={popoverTop:e.top,contentHeight:e.top-10-a>0?a:e.top-10},p={popoverTop:e.bottom,contentHeight:e.bottom+10+a>window.innerHeight?window.innerHeight-10-e.bottom:a},d=n,m=null;if(!o)if("middle"===n&&l.contentHeight===a)d="middle";else if("top"===n&&f.contentHeight===a)d="top";else if("bottom"===n&&p.contentHeight===a)d="bottom";else{var h="top"==(d=f.contentHeight>p.contentHeight?"top":"bottom")?f.contentHeight:p.contentHeight;m=h!==a?h:null}return{yAxis:d,popoverTop:"middle"===d?l.popoverTop:"top"===d?f.popoverTop:p.popoverTop,contentHeight:m}}var Gt=Object(r.createContext)({focusHistory:[]}),qt=Gt.Provider,Yt=Gt.Consumer;qt.displayName="FocusReturnProvider",Yt.displayName="FocusReturnConsumer",r.Component;var Zt=Object(Ut.createHigherOrderComponent)((function e(t){if((o=t)instanceof r.Component||"function"==typeof o){var n=t;return e({})(n)}var o,i=t.onFocusReturn,c=void 0===i?ge.stubTrue:i;return function(e){var t=function(t){me(a,t);var n,o,i=(n=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=fe(n);if(o){var r=fe(this).constructor;e=Reflect.construct(t,arguments,r)}else e=t.apply(this,arguments);return ve(this,e)});function a(){var e;return ae(this,a),(e=i.apply(this,arguments)).ownFocusedElements=new Set,e.activeElementOnMount=document.activeElement,e.setIsFocusedFalse=function(){return e.isFocused=!1},e.setIsFocusedTrue=function(t){e.ownFocusedElements.add(t.target),e.isFocused=!0},e}return se(a,[{key:"componentWillUnmount",value:function(){var e=this.activeElementOnMount,t=this.isFocused,n=this.ownFocusedElements;if(t&&!1!==c())for(var r,o=[].concat(je(ge.without.apply(void 0,[this.props.focus.focusHistory].concat(je(n)))),[e]);r=o.pop();)if(document.body.contains(r))return void r.focus()}},{key:"render",value:function(){return Object(r.createElement)("div",{onFocus:this.setIsFocusedTrue,onBlur:this.setIsFocusedFalse},Object(r.createElement)(e,this.props.childProps))}}]),a}(r.Component);return function(e){return Object(r.createElement)(Yt,null,(function(n){return Object(r.createElement)(t,{childProps:e,focus:n})}))}}}),"withFocusReturn");var Jt=Object(Ut.createHigherOrderComponent)((function(e){return function(t){me(c,t);var n,o,i=(n=c,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=fe(n);if(o){var r=fe(this).constructor;e=Reflect.construct(t,arguments,r)}else e=t.apply(this,arguments);return ve(this,e)});function c(){var e;return ae(this,c),(e=i.apply(this,arguments)).focusContainRef=Object(r.createRef)(),e.handleTabBehaviour=e.handleTabBehaviour.bind(le(e)),e}return se(c,[{key:"handleTabBehaviour",value:function(e){if(e.keyCode===Vt.TAB){var t=Lt.focus.tabbable.find(this.focusContainRef.current);if(t.length){var n=t[0],r=t[t.length-1];e.shiftKey&&e.target===n?(e.preventDefault(),r.focus()):(e.shiftKey||e.target!==r)&&t.includes(e.target)||(e.preventDefault(),n.focus())}}}},{key:"render",value:function(){return Object(r.createElement)("div",{onKeyDown:this.handleTabBehaviour,ref:this.focusContainRef,tabIndex:"-1"},Object(r.createElement)(e,this.props))}}]),c}(r.Component)}),"withConstrainedTabbing");var Qt=["button","submit"];var Xt=Object(Ut.createHigherOrderComponent)((function(e){return function(t){me(c,t);var n,o,i=(n=c,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=fe(n);if(o){var r=fe(this).constructor;e=Reflect.construct(t,arguments,r)}else e=t.apply(this,arguments);return ve(this,e)});function c(){var e;return ae(this,c),(e=i.apply(this,arguments)).bindNode=e.bindNode.bind(le(e)),e.cancelBlurCheck=e.cancelBlurCheck.bind(le(e)),e.queueBlurCheck=e.queueBlurCheck.bind(le(e)),e.normalizeButtonFocus=e.normalizeButtonFocus.bind(le(e)),e}return se(c,[{key:"componentWillUnmount",value:function(){this.cancelBlurCheck()}},{key:"bindNode",value:function(e){e?this.node=e:(delete this.node,this.cancelBlurCheck())}},{key:"queueBlurCheck",value:function(e){var t=this;e.persist(),this.preventBlurCheck||(this.blurCheckTimeout=setTimeout((function(){document.hasFocus()?"function"==typeof t.node.handleFocusOutside&&t.node.handleFocusOutside(e):e.preventDefault()}),0))}},{key:"cancelBlurCheck",value:function(){clearTimeout(this.blurCheckTimeout)}},{key:"normalizeButtonFocus",value:function(e){var t=e.type,n=e.target;Object(ge.includes)(["mouseup","touchend"],t)?this.preventBlurCheck=!1:function(e){switch(e.nodeName){case"A":case"BUTTON":return!0;case"INPUT":return Object(ge.includes)(Qt,e.type)}return!1}(n)&&(this.preventBlurCheck=!0)}},{key:"render",value:function(){return Object(r.createElement)("div",{onFocus:this.cancelBlurCheck,onMouseDown:this.normalizeButtonFocus,onMouseUp:this.normalizeButtonFocus,onTouchStart:this.normalizeButtonFocus,onTouchEnd:this.normalizeButtonFocus,onBlur:this.queueBlurCheck},Object(r.createElement)(e,ie({ref:this.bindNode},this.props)))}}]),c}(r.Component)}),"withFocusOutside")(function(e){me(o,e);var t,n,r=(t=o,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=fe(t);if(n){var o=fe(this).constructor;e=Reflect.construct(r,arguments,o)}else e=r.apply(this,arguments);return ve(this,e)});function o(){return ae(this,o),r.apply(this,arguments)}return se(o,[{key:"handleFocusOutside",value:function(e){this.props.onFocusOutside(e)}},{key:"render",value:function(){return this.props.children}}]),o}(r.Component));function en(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=fe(e);if(t){var o=fe(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return ve(this,n)}}var tn=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.htmlDocument,n=void 0===t?document:t,o=e.className,i=void 0===o?"lockscroll":o,c=0,a=0;function u(e){var t=n.scrollingElement||n.body;e&&(a=t.scrollTop);var r=e?"add":"remove";t.classList[r](i),n.documentElement.classList[r](i),e||(t.scrollTop=a)}function s(){0===c&&u(!0),++c}function l(){1===c&&u(!1),--c}return function(e){me(n,e);var t=en(n);function n(){return ae(this,n),t.apply(this,arguments)}return se(n,[{key:"componentDidMount",value:function(){s()}},{key:"componentWillUnmount",value:function(){l()}},{key:"render",value:function(){return null}}]),n}(r.Component)}();function nn(e){e.stopPropagation()}var rn=Object(r.forwardRef)((function(e,t){var n=e.children,o=ce(e,["children"]);return Object(r.createElement)("div",ie({},o,{ref:t,onMouseDown:nn}),n)}));function on(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function cn(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?on(Object(n),!0).forEach((function(t){ee(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):on(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function an(e){var t=e.type,n=e.origin,r=void 0===n?function(e){return"appear"===e?"top":"left"}(t):n;if("appear"===t){var o,c=we(r.split(" "),2),a=c[0],u=c[1],s=void 0===u?"center":u;return i()("components-animate__appear",(ee(o={},"is-from-"+s,"center"!==s),ee(o,"is-from-"+a,"middle"!==a),o))}return"slide-in"===t?i()("components-animate__slide-in","is-from-"+r):"loading"===t?i()("components-animate__loading"):void 0}function un(e){var t=e.type,n=e.options,r=void 0===n?{}:n;return(0,e.children)({className:an(cn({type:t},r))})}var sn=Jt(Zt((function(e){return e.children})));function ln(e,t){var n,r=(n=t).ownerDocument.defaultView.getComputedStyle(n),o=r.paddingTop,i=r.paddingBottom,c=r.paddingLeft,a=r.paddingRight,u=o?parseInt(o,10):0,s=i?parseInt(i,10):0,l=c?parseInt(c,10):0,f=a?parseInt(a,10):0;return{x:e.left+l,y:e.top+u,width:e.width-l-f,height:e.height-u-s,left:e.left+l,right:e.right-f,top:e.top+u,bottom:e.bottom-s}}function fn(e,t,n){n?e.getAttribute(t)!==n&&e.setAttribute(t,n):e.hasAttribute(t)&&e.removeAttribute(t)}function pn(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";e.style[t]!==n&&(e.style[t]=n)}function dn(e,t,n){n?e.classList.contains(t)||e.classList.add(t):e.classList.contains(t)&&e.classList.remove(t)}var mn=function(e){var t=e.headerTitle,n=e.onClose,o=e.onKeyDown,c=e.children,a=e.className,u=e.noArrow,s=void 0===u||u,l=e.isAlternate,f=e.position,p=void 0===f?"bottom right":f,d=(e.range,e.focusOnMount),m=void 0===d?"firstElement":d,h=e.anchorRef,b=e.shouldAnchorIncludePadding,v=e.anchorRect,g=e.getAnchorRect,y=e.expandOnMobile,O=e.animate,w=void 0===O||O,j=e.onClickOutside,S=e.onFocusOutside,x=e.__unstableSticky,E=e.__unstableSlotName,k=void 0===E?"Popover":E,P=e.__unstableObserveElement,_=e.__unstableBoundaryParent,F=ce(e,["headerTitle","onClose","onKeyDown","children","className","noArrow","isAlternate","position","range","focusOnMount","anchorRef","shouldAnchorIncludePadding","anchorRect","getAnchorRect","expandOnMobile","animate","onClickOutside","onFocusOutside","__unstableSticky","__unstableSlotName","__unstableObserveElement","__unstableBoundaryParent"]),C=Object(r.useRef)(null),T=Object(r.useRef)(null),D=Object(r.useRef)(),N=Object(Ut.useViewportMatch)("medium","<"),R=we(Object(r.useState)(),2),M=R[0],I=R[1],A=oe(k),B=y&&N,L=we(Object(Ut.useResizeObserver)(),2),V=L[0],U=L[1];s=B||s,Object(r.useLayoutEffect)((function(){if(B)return dn(D.current,"is-without-arrow",s),dn(D.current,"is-alternate",l),fn(D.current,"data-x-axis"),fn(D.current,"data-y-axis"),pn(D.current,"top"),pn(D.current,"left"),pn(T.current,"maxHeight"),void pn(T.current,"maxWidth");var e=function(){if(D.current&&T.current){var e=function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],o=arguments.length>4?arguments[4]:void 0;if(t)return t;if(n){if(!e.current)return;return n(e.current)}if(!1!==r){if(!(r&&window.Range&&window.Element&&window.DOMRect))return;if(r instanceof window.Range)return Object(Lt.getRectangleFromRange)(r);if(r instanceof window.Element){var i=r.getBoundingClientRect();return o?i:ln(i,r)}var c=r.top,a=r.bottom,u=c.getBoundingClientRect(),s=a.getBoundingClientRect(),l=new window.DOMRect(u.left,u.top,u.width,s.bottom-u.top);return o?l:ln(l,r)}if(e.current){var f=e.current.parentNode,p=f.getBoundingClientRect();return o?p:ln(p,f)}}(C,v,g,h,b);if(e){var t,n,r=D.current,o=r.offsetParent,i=r.ownerDocument,c=0;if(o&&o!==i.body){var a=o.getBoundingClientRect();c=a.top,e=new window.DOMRect(e.left-a.left,e.top-a.top,e.width,e.height)}_&&(t=null===(n=D.current.closest(".popover-slot"))||void 0===n?void 0:n.parentNode);var u=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"top",r=arguments.length>3?arguments[3]:void 0,o=arguments.length>4?arguments[4]:void 0,i=arguments.length>5?arguments[5]:void 0,c=arguments.length>6?arguments[6]:void 0,a=n.split(" "),u=we(a,3),s=u[0],l=u[1],f=void 0===l?"center":l,p=u[2],d=$t(e,t,s,p,r,o,i),m=Kt(e,t,f,p,r,d.yAxis,c);return zt(zt({},m),d)}(e,U.height?U:T.current.getBoundingClientRect(),p,x,D.current,c,t),f=u.popoverTop,d=u.popoverLeft,m=u.xAxis,y=u.yAxis,O=u.contentHeight,w=u.contentWidth;"number"==typeof f&&"number"==typeof d&&(pn(D.current,"top",f+"px"),pn(D.current,"left",d+"px")),dn(D.current,"is-without-arrow",s||"center"===m&&"middle"===y),dn(D.current,"is-alternate",l),fn(D.current,"data-x-axis",m),fn(D.current,"data-y-axis",y),pn(T.current,"maxHeight","number"==typeof O?O+"px":""),pn(T.current,"maxWidth","number"==typeof w?w+"px":""),I(({left:"right",right:"left"}[m]||"center")+" "+({top:"bottom",bottom:"top"}[y]||"middle"))}}};e();var t,n,r=window.setInterval(e,500),o=function(){window.cancelAnimationFrame(t),t=window.requestAnimationFrame(e)};return window.addEventListener("click",o),window.addEventListener("resize",e),window.addEventListener("scroll",e,!0),P&&(n=new window.MutationObserver(e)).observe(P,{attributes:!0}),function(){window.clearInterval(r),window.removeEventListener("resize",e),window.removeEventListener("scroll",e,!0),window.removeEventListener("click",o),window.cancelAnimationFrame(t),n&&n.disconnect()}}),[B,v,g,h,b,p,U,x,P,_]),function(e,t){Object(r.useEffect)((function(){var n=setTimeout((function(){if(e&&t.current)if("firstElement"!==e)"container"===e&&t.current.focus();else{var n=Lt.focus.tabbable.find(t.current)[0];n?n.focus():t.current.focus()}}),0);return function(){return clearTimeout(n)}}),[])}(m,T);var W=function(e){e.keyCode===Vt.ESCAPE&&n&&(e.stopPropagation(),n()),o&&o(e)},H=Object(r.createElement)(Xt,{onFocusOutside:function(e){if(S)S(e);else if(j){var t;try{t=new window.MouseEvent("click")}catch(e){(t=document.createEvent("MouseEvent")).initMouseEvent("click",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null)}Object.defineProperty(t,"target",{get:function(){return e.relatedTarget}}),Q()("Popover onClickOutside prop",{alternative:"onFocusOutside"}),j(t)}else n&&n()}},Object(r.createElement)(un,{type:w&&M?"appear":null,options:{origin:M}},(function(e){var o=e.className;return Object(r.createElement)(rn,ie({className:i()("components-popover",a,o,{"is-expanded":B,"is-without-arrow":s,"is-alternate":l})},F,{onKeyDown:W,ref:D}),B&&Object(r.createElement)(tn,null),B&&Object(r.createElement)("div",{className:"components-popover__header"},Object(r.createElement)("span",{className:"components-popover__header-title"},t),Object(r.createElement)(xn,{className:"components-popover__close",icon:Wt,onClick:n})),Object(r.createElement)("div",{ref:T,className:"components-popover__content",tabIndex:"-1"},Object(r.createElement)("div",{style:{position:"relative"}},V,c)))})));return m&&(H=Object(r.createElement)(sn,null,H)),A.ref&&(H=Object(r.createElement)(We,{name:k},H)),h||v?H:Object(r.createElement)("span",{ref:C},H)};mn.Slot=function(e){var t=e.name,n=void 0===t?"Popover":t;return Object(r.createElement)(Ue,{bubblesVirtually:!0,name:n,className:"popover-slot"})};var hn=mn,bn=function(e){var t,n,o=e.shortcut,i=e.className;return o?(Object(ge.isString)(o)&&(t=o),Object(ge.isObject)(o)&&(t=o.display,n=o.ariaLabel),Object(r.createElement)("span",{className:i,"aria-label":n},t)):null};var vn=function(e){me(i,e);var t,n,o=(t=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=fe(t);if(n){var o=fe(this).constructor;e=Reflect.construct(r,arguments,o)}else e=r.apply(this,arguments);return ve(this,e)});function i(){var e;return ae(this,i),(e=o.apply(this,arguments)).delayedSetIsOver=Object(ge.debounce)((function(t){return e.setState({isOver:t})}),700),e.cancelIsMouseDown=e.createSetIsMouseDown(!1),e.isInMouseDown=!1,e.state={isOver:!1},e}return se(i,[{key:"componentWillUnmount",value:function(){this.delayedSetIsOver.cancel(),document.removeEventListener("mouseup",this.cancelIsMouseDown)}},{key:"emitToChild",value:function(e,t){var n=this.props.children;if(1===r.Children.count(n)){var o=r.Children.only(n);"function"==typeof o.props[e]&&o.props[e](t)}}},{key:"createToggleIsOver",value:function(e,t){var n=this;return function(r){if(n.emitToChild(e,r),!(r.currentTarget.disabled||"focus"===r.type&&n.isInMouseDown)){n.delayedSetIsOver.cancel();var o=Object(ge.includes)(["focus","mouseenter"],r.type);o!==n.state.isOver&&(t?n.delayedSetIsOver(o):n.setState({isOver:o}))}}}},{key:"createSetIsMouseDown",value:function(e){var t=this;return function(n){t.emitToChild(e?"onMouseDown":"onMouseUp",n),document[e?"addEventListener":"removeEventListener"]("mouseup",t.cancelIsMouseDown),t.isInMouseDown=e}}},{key:"render",value:function(){var e=this.props,t=e.children,n=e.position,o=e.text,i=e.shortcut;if(1!==r.Children.count(t))return t;var c=r.Children.only(t),a=this.state.isOver;return Object(r.cloneElement)(c,{onMouseEnter:this.createToggleIsOver("onMouseEnter",!0),onMouseLeave:this.createToggleIsOver("onMouseLeave"),onClick:this.createToggleIsOver("onClick"),onFocus:this.createToggleIsOver("onFocus"),onBlur:this.createToggleIsOver("onBlur"),onMouseDown:this.createSetIsMouseDown(!0),children:Object(r.concatChildren)(c.props.children,a&&Object(r.createElement)(hn,{focusOnMount:!1,position:n,className:"components-tooltip","aria-hidden":"true",animate:!1,noArrow:!0},o,Object(r.createElement)(bn,{className:"components-tooltip__shortcut",shortcut:i})))})}}]),i}(r.Component),gn=function(e){var t=e.icon,n=e.className,o=ce(e,["icon","className"]),i=["dashicon","dashicons","dashicons-"+t,n].filter(Boolean).join(" ");return Object(r.createElement)("span",ie({className:i},o))};function yn(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function On(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?yn(Object(n),!0).forEach((function(t){ee(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):yn(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var wn=function(e){var t=e.icon,n=void 0===t?null:t,o=e.size,i=ce(e,["icon","size"]);if("string"==typeof n)return Object(r.createElement)(gn,ie({icon:n},i));if(n&&gn===n.type)return Object(r.cloneElement)(n,On({},i));var c=o||24;if("function"==typeof n)return n.prototype instanceof r.Component?Object(r.createElement)(n,On({size:c},i)):n(On({size:c},i));if(n&&("svg"===n.type||n.type===X.SVG)){var a=On(On({width:c,height:c},n.props),i);return Object(r.createElement)(X.SVG,a)}return Object(r.isValidElement)(n)?Object(r.cloneElement)(n,On({size:c},i)):n};function jn(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Sn=["onMouseDown","onClick"],xn=Object(r.forwardRef)((function(e,t){var n=e.href,o=e.target,c=e.isPrimary,a=e.isSmall,u=e.isTertiary,s=e.isPressed,l=e.isBusy,f=e.isDefault,p=e.isSecondary,d=e.isLink,m=e.isDestructive,h=e.className,b=e.disabled,v=e.icon,g=e.iconSize,y=e.showTooltip,O=e.tooltipPosition,w=e.shortcut,j=e.label,S=e.children,x=e.__experimentalIsFocusable,E=ce(e,["href","target","isPrimary","isSmall","isTertiary","isPressed","isBusy","isDefault","isSecondary","isLink","isDestructive","className","disabled","icon","iconSize","showTooltip","tooltipPosition","shortcut","label","children","__experimentalIsFocusable"]);f&&Q()("Button isDefault prop",{alternative:"isSecondary"});var k=i()("components-button",h,{"is-secondary":f||p,"is-primary":c,"is-small":a,"is-tertiary":u,"is-pressed":s,"is-busy":l,"is-link":d,"is-destructive":m,"has-text":!!v&&!!S,"has-icon":!!v}),P=b&&!x,_=void 0===n||P?"button":"a",F="a"===_?{href:n,target:o}:{type:"button",disabled:P,"aria-pressed":s};if(b&&x){F["aria-disabled"]=!0;var C,T=function(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return jn(e,void 0);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?jn(e,void 0):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,c=!0,a=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return c=e.done,e},e:function(e){a=!0,i=e},f:function(){try{c||null==n.return||n.return()}finally{if(a)throw i}}}}(Sn);try{for(T.s();!(C=T.n()).done;)E[C.value]=function(e){e.stopPropagation(),e.preventDefault()}}catch(e){T.e(e)}finally{T.f()}}var D=!P&&(y&&j||w||!!j&&(!S||Object(ge.isArray)(S)&&!S.length)&&!1!==y),N=Object(r.createElement)(_,ie({},F,E,{className:k,"aria-label":E["aria-label"]||j,ref:t}),v&&Object(r.createElement)(wn,{icon:v,size:g}),S);return D?Object(r.createElement)(vn,{text:j,shortcut:w,position:O},N):N})),En=(n(159),function(){return Object(r.createElement)("span",{className:"wc-block-components-spinner","aria-hidden":"true"})}),kn=(n(158),["className","showSpinner","children"]),Pn=function(e){var t=e.className,n=e.showSpinner,o=void 0!==n&&n,c=e.children,u=f()(e,kn),s=i()("wc-block-components-button",t,{"wc-block-components-button--loading":o});return Object(r.createElement)(xn,a()({className:s},u),o&&Object(r.createElement)(En,null),Object(r.createElement)("span",{className:"wc-block-components-button__text"},c))};function Fn(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Cn(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Fn(Object(n),!0).forEach((function(t){s()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Fn(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Tn=function(e){var t,n=e.label,o=e.screenReaderLabel,c=e.wrapperElement,a=e.wrapperProps,u=void 0===a?{}:a,s=null!=n,l=null!=o;return!s&&l?(t=c||"span",u=Cn(Cn({},u),{},{className:i()(u.className,"screen-reader-text")}),Object(r.createElement)(t,u,o)):(t=c||r.Fragment,s&&l&&n!==o?Object(r.createElement)(t,u,Object(r.createElement)("span",{"aria-hidden":"true"},n),Object(r.createElement)("span",{className:"screen-reader-text"},o)):Object(r.createElement)(t,u,n))}}]);woocommerce-blocks/build/single-product-frontend.js000064400000264407151335517640016576 0ustar00!function(e){function t(t){for(var n,o,c=t[0],i=t[1],a=0,s=[];a<c.length;a++)o=c[a],Object.prototype.hasOwnProperty.call(r,o)&&r[o]&&s.push(r[o][0]),r[o]=0;for(n in i)Object.prototype.hasOwnProperty.call(i,n)&&(e[n]=i[n]);for(u&&u(t);s.length;)s.shift()()}var n={},r={48:0};function o(t){if(n[t])return n[t].exports;var r=n[t]={i:t,l:!1,exports:{}};return e[t].call(r.exports,r,r.exports,o),r.l=!0,r.exports}o.e=function(e){var t=[],n=r[e];if(0!==n)if(n)t.push(n[2]);else{var c=new Promise((function(t,o){n=r[e]=[t,o]}));t.push(n[2]=c);var i,a=document.createElement("script");a.charset="utf-8",a.timeout=120,o.nc&&a.setAttribute("nonce",o.nc),a.src=function(e){return o.p+""+({0:"vendors--atomic-block-components/add-to-cart--cart-blocks/order-summary--checkout-blocks/billing-ad--c5eb4dcd",1:"vendors--atomic-block-components/price--cart-blocks/line-items--cart-blocks/order-summary--checkout--8a3571de",8:"atomic-block-components/add-to-cart",9:"atomic-block-components/button",10:"atomic-block-components/category-list",11:"atomic-block-components/image",12:"atomic-block-components/price",13:"atomic-block-components/rating",14:"atomic-block-components/sale-badge",15:"atomic-block-components/sku",16:"atomic-block-components/stock-indicator",17:"atomic-block-components/summary",18:"atomic-block-components/tag-list",19:"atomic-block-components/title",50:"vendors--atomic-block-components/add-to-cart"}[e]||e)+"-frontend.js"}(e);var u=new Error;i=function(t){a.onerror=a.onload=null,clearTimeout(s);var n=r[e];if(0!==n){if(n){var o=t&&("load"===t.type?"missing":t.type),c=t&&t.target&&t.target.src;u.message="Loading chunk "+e+" failed.\n("+o+": "+c+")",u.name="ChunkLoadError",u.type=o,u.request=c,n[1](u)}r[e]=void 0}};var s=setTimeout((function(){i({type:"timeout",target:a})}),12e4);a.onerror=a.onload=i,document.head.appendChild(a)}return Promise.all(t)},o.m=e,o.c=n,o.d=function(e,t,n){o.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},o.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.t=function(e,t){if(1&t&&(e=o(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(o.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)o.d(n,r,function(t){return e[t]}.bind(null,r));return n},o.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(t,"a",t),t},o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},o.p="",o.oe=function(e){throw console.error(e),e};var c=window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[],i=c.push.bind(c);c.push=t,c=c.slice();for(var a=0;a<c.length;a++)t(c[a]);var u=i;o(o.s=310)}([function(e,t){e.exports=window.wp.element},function(e,t){e.exports=window.wp.i18n},function(e,t){e.exports=window.wc.wcSettings},function(e,t){e.exports=window.React},function(e,t){e.exports=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,n){var r=n(84),o=n(85),c=n(67),i=n(86);e.exports=function(e,t){return r(e)||o(e,t)||c(e,t)||i()},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,n){var r;!function(){"use strict";var n={}.hasOwnProperty;function o(){for(var e=[],t=0;t<arguments.length;t++){var r=arguments[t];if(r){var c=typeof r;if("string"===c||"number"===c)e.push(r);else if(Array.isArray(r)){if(r.length){var i=o.apply(null,r);i&&e.push(i)}}else if("object"===c)if(r.toString===Object.prototype.toString)for(var a in r)n.call(r,a)&&r[a]&&e.push(a);else e.push(r.toString())}}return e.join(" ")}e.exports?(o.default=o,e.exports=o):void 0===(r=function(){return o}.apply(t,[]))||(e.exports=r)}()},function(e,t){e.exports=window.lodash},function(e,t){e.exports=window.wc.wcBlocksData},function(e,t,n){"use strict";function r(e){return(r=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}n.d(t,"a",(function(){return r}))},function(e,t,n){e.exports=n(79)()},function(e,t){e.exports=window.wp.data},function(e,t,n){"use strict";function r(){return(r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";function r(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}n.d(t,"a",(function(){return r}))},function(e,t){function n(){return e.exports=n=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},e.exports.default=e.exports,e.exports.__esModule=!0,n.apply(this,arguments)}e.exports=n,e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function o(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}n.d(t,"a",(function(){return o}))},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(88);function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Object(r.a)(e,t)}},function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(21),o=n.n(r),c=n(13);function i(e,t){return!t||"object"!==o()(t)&&"function"!=typeof t?Object(c.a)(e):t}},function(e,t,n){"use strict";function r(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},c=Object.keys(e);for(r=0;r<c.length;r++)n=c[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(e);for(r=0;r<c.length;r++)n=c[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}n.d(t,"a",(function(){return r}))},function(e,t){function n(t){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?(e.exports=n=function(e){return typeof e},e.exports.default=e.exports,e.exports.__esModule=!0):(e.exports=n=function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.default=e.exports,e.exports.__esModule=!0),n(t)}e.exports=n,e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(65);function o(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,c=[],_n=!0,i=!1;try{for(n=n.call(e);!(_n=(r=n.next()).done)&&(c.push(r.value),!t||c.length!==t);_n=!0);}catch(e){i=!0,o=e}finally{try{_n||null==n.return||n.return()}finally{if(i)throw o}}return c}}(e,t)||Object(r.a)(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}},function(e,t,n){var r=n(77);e.exports=function(e,t){if(null==e)return{};var n,o,c=r(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(o=0;o<i.length;o++)n=i[o],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(c[n]=e[n])}return c},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=window.wp.compose},function(e,t){e.exports=window.wp.isShallowEqual},function(e,t){e.exports=window.wc.blocksCheckout},function(e,t){e.exports=window.regeneratorRuntime},function(e,t){e.exports=window.wp.htmlEntities},function(e,t){e.exports=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){function n(t){return e.exports=n=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},e.exports.default=e.exports,e.exports.__esModule=!0,n(t)}e.exports=n,e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,n){"use strict";n.d(t,"a",(function(){return c}));var r=n(59),o=n(65);function c(e){return function(e){if(Array.isArray(e))return Object(r.a)(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||Object(o.a)(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}},function(e,t,n){"use strict";n.d(t,"a",(function(){return j}));var r=n(5),o=n.n(r),c=n(4),i=n.n(c),a=n(7),u=n(0),s=n(8),l=n(11),p=n(28),f=n(92),d=n(93),m=n(36);function b(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function h(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?b(Object(n),!0).forEach((function(t){i()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):b(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var v={first_name:"",last_name:"",company:"",address_1:"",address_2:"",city:"",state:"",postcode:"",country:"",phone:""},g=h(h({},v),{},{email:""}),y={total_items:"",total_items_tax:"",total_fees:"",total_fees_tax:"",total_discount:"",total_discount_tax:"",total_shipping:"",total_shipping_tax:"",total_price:"",total_tax:"",tax_lines:s.EMPTY_TAX_LINES,currency_code:"",currency_symbol:"",currency_minor_unit:2,currency_decimal_separator:"",currency_thousand_separator:"",currency_prefix:"",currency_suffix:""},O=function(e){return Object(f.a)(Object.entries(e).map((function(e){var t=o()(e,2),n=t[0],r=t[1];return[n,Object(p.decodeEntities)(r)]})))},w={cartCoupons:s.EMPTY_CART_COUPONS,cartItems:s.EMPTY_CART_ITEMS,cartFees:s.EMPTY_CART_FEES,cartItemsCount:0,cartItemsWeight:0,cartNeedsPayment:!0,cartNeedsShipping:!0,cartItemErrors:s.EMPTY_CART_ITEM_ERRORS,cartTotals:y,cartIsLoading:!0,cartErrors:s.EMPTY_CART_ERRORS,billingAddress:g,shippingAddress:v,shippingRates:s.EMPTY_SHIPPING_RATES,shippingRatesLoading:!1,cartHasCalculatedShipping:!1,paymentRequirements:s.EMPTY_PAYMENT_REQUIREMENTS,receiveCart:function(){},extensions:s.EMPTY_EXTENSIONS},j=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{shouldSelect:!0},t=Object(m.a)(),n=t.isEditor,r=t.previewData,o=null==r?void 0:r.previewCart,c=e.shouldSelect,i=Object(u.useRef)(),p=Object(l.useSelect)((function(e,t){var r=t.dispatch;if(!c)return w;if(n)return{cartCoupons:o.coupons,cartItems:o.items,cartFees:o.fees,cartItemsCount:o.items_count,cartItemsWeight:o.items_weight,cartNeedsPayment:o.needs_payment,cartNeedsShipping:o.needs_shipping,cartItemErrors:s.EMPTY_CART_ITEM_ERRORS,cartTotals:o.totals,cartIsLoading:!1,cartErrors:s.EMPTY_CART_ERRORS,billingAddress:g,shippingAddress:v,extensions:s.EMPTY_EXTENSIONS,shippingRates:o.shipping_rates,shippingRatesLoading:!1,cartHasCalculatedShipping:o.has_calculated_shipping,paymentRequirements:o.paymentRequirements,receiveCart:"function"==typeof(null==o?void 0:o.receiveCart)?o.receiveCart:function(){}};var i=e(s.CART_STORE_KEY),a=i.getCartData(),u=i.getCartErrors(),l=i.getCartTotals(),p=!i.hasFinishedResolution("getCartData"),f=i.isCustomerDataUpdating(),m=r(s.CART_STORE_KEY).receiveCart,b=O(a.billingAddress),y=a.needsShipping?O(a.shippingAddress):b,j=a.fees.length>0?a.fees.map((function(e){return O(e)})):s.EMPTY_CART_FEES;return{cartCoupons:a.coupons.length>0?a.coupons.map((function(e){return h(h({},e),{},{label:e.code})})):s.EMPTY_CART_COUPONS,cartItems:a.items,cartFees:j,cartItemsCount:a.itemsCount,cartItemsWeight:a.itemsWeight,cartNeedsPayment:a.needsPayment,cartNeedsShipping:a.needsShipping,cartItemErrors:a.errors,cartTotals:l,cartIsLoading:p,cartErrors:u,billingAddress:Object(d.a)(b),shippingAddress:Object(d.a)(y),extensions:a.extensions,shippingRates:a.shippingRates,shippingRatesLoading:f,cartHasCalculatedShipping:a.hasCalculatedShipping,paymentRequirements:a.paymentRequirements,receiveCart:m}}),[c]);return i.current&&Object(a.isEqual)(i.current,p)||(i.current=p),i.current}},function(e,t){e.exports=window.wp.a11y},function(e,t){e.exports=window.wp.primitives},,function(e,t,n){"use strict";n.d(t,"a",(function(){return c}));var r=n(0),o=(n(11),Object(r.createContext)({isEditor:!1,currentPostId:0,previewData:{},getPreviewData:function(){}})),c=function(){return Object(r.useContext)(o)}},function(e,t){e.exports=window.wp.dom},function(e,t){e.exports=window.wc.wcBlocksRegistry},function(e,t){function n(e,t,n,r,o,c,i){try{var a=e[c](i),u=a.value}catch(e){return void n(e)}a.done?t(u):Promise.resolve(u).then(r,o)}e.exports=function(e){return function(){var t=this,r=arguments;return new Promise((function(o,c){var i=e.apply(t,r);function a(e){n(i,o,c,a,u,"next",e)}function u(e){n(i,o,c,a,u,"throw",e)}a(void 0)}))}},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){function n(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}e.exports=function(e,t,r){return t&&n(e.prototype,t),r&&n(e,r),e},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,n){var r=n(71);e.exports=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&r(e,t)},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,n){var r=n(21).default,o=n(29);e.exports=function(e,t){return!t||"object"!==r(t)&&"function"!=typeof t?o(e):t},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,n){"use strict";var r=n(40),o=n.n(r),c=n(41),i=n.n(c),a=n(29),u=n.n(a),s=n(42),l=n.n(s),p=n(43),f=n.n(p),d=n(30),m=n.n(d),b=n(4),h=n.n(b),v=(n(10),n(3)),g=n(1),y=n(83),O=function(e){var t=e.imageUrl,n=void 0===t?"".concat(y.l,"/block-error.svg"):t,r=e.header,o=void 0===r?Object(g.__)("Oops!",'woocommerce'):r,c=e.text,i=void 0===c?Object(g.__)("There was an error loading the content.",'woocommerce'):c,a=e.errorMessage,u=e.errorMessagePrefix,s=void 0===u?Object(g.__)("Error:",'woocommerce'):u,l=e.button;return React.createElement("div",{className:"wc-block-error wc-block-components-error"},n&&React.createElement("img",{className:"wc-block-error__image wc-block-components-error__image",src:n,alt:""}),React.createElement("div",{className:"wc-block-error__content wc-block-components-error__content"},o&&React.createElement("p",{className:"wc-block-error__header wc-block-components-error__header"},o),i&&React.createElement("p",{className:"wc-block-error__text wc-block-components-error__text"},i),a&&React.createElement("p",{className:"wc-block-error__message wc-block-components-error__message"},s?s+" ":"",a),l&&React.createElement("p",{className:"wc-block-error__button wc-block-components-error__button"},l)))};n(81);var w=function(e){l()(c,e);var t,n,r=(t=c,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=m()(t);if(n){var o=m()(this).constructor;e=Reflect.construct(r,arguments,o)}else e=r.apply(this,arguments);return f()(this,e)});function c(){var e;o()(this,c);for(var t=arguments.length,n=new Array(t),i=0;i<t;i++)n[i]=arguments[i];return e=r.call.apply(r,[this].concat(n)),h()(u()(e),"state",{errorMessage:"",hasError:!1}),e}return i()(c,[{key:"render",value:function(){var e=this.props,t=e.header,n=e.imageUrl,r=e.showErrorMessage,o=e.text,c=e.errorMessagePrefix,i=e.renderError,a=e.button,u=this.state,s=u.errorMessage;return u.hasError?"function"==typeof i?i({errorMessage:s}):React.createElement(O,{errorMessage:r?s:null,header:t,imageUrl:n,text:o,errorMessagePrefix:c,button:a}):this.props.children}}],[{key:"getDerivedStateFromError",value:function(e){return void 0!==e.statusText&&void 0!==e.status?{errorMessage:React.createElement(React.Fragment,null,React.createElement("strong",null,e.status),": ",e.statusText),hasError:!0}:{errorMessage:e.message,hasError:!0}}}]),c}(v.Component);w.defaultProps={showErrorMessage:!0},t.a=w},function(e,t){e.exports=window.wp.deprecated},function(e,t,n){var r=n(94),o=n(95),c=n(67),i=n(96);e.exports=function(e){return r(e)||o(e)||c(e)||i()},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,n){"use strict";(function(e){var r=n(0),o=(n(74),Object(r.createContext)({slots:{},fills:{},registerSlot:function(){void 0!==e&&e.env},updateSlot:function(){},unregisterSlot:function(){},registerFill:function(){},unregisterFill:function(){}}));t.a=o}).call(this,n(102))},,function(e,t,n){"use strict";n.d(t,"a",(function(){return r})),n.d(t,"c",(function(){return o})),n.d(t,"b",(function(){return c})),n.d(t,"d",(function(){return i}));var r=function(e){return"number"==typeof e},o=function(e){return"string"==typeof e},c=function(e){return!function(e){return null===e}(e)&&e instanceof Object&&e.constructor===Object};function i(e,t){return c(e)&&t in e}},function(e,t){e.exports=window.wp.keycodes},,function(e,t,n){"use strict";n.d(t,"a",(function(){return l}));var r=n(4),o=n.n(r),c=n(75),i=n(0),a=n(32);function u(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function s(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?u(Object(n),!0).forEach((function(t){o()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):u(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var l=function(){var e=Object(a.a)(),t=Object(i.useRef)(e);return Object(i.useEffect)((function(){t.current=e}),[e]),{dispatchStoreEvent:Object(i.useCallback)((function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};try{Object(c.doAction)("experimental__woocommerce_blocks-".concat(e),t)}catch(e){console.error(e)}}),[]),dispatchCheckoutEvent:Object(i.useCallback)((function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};try{Object(c.doAction)("experimental__woocommerce_blocks-checkout-".concat(e),s(s({},n),{},{storeCart:t.current}))}catch(e){console.error(e)}}),[])}}},,,,,,function(e,t){e.exports=window.wc.priceFormat},function(e,t,n){"use strict";function r(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}n.d(t,"a",(function(){return r}))},,function(e,t){e.exports=window.wp.apiFetch},,,,function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(59);function o(e,t){if(e){if("string"==typeof e)return Object(r.a)(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Object(r.a)(e,t):void 0}}},,function(e,t,n){var r=n(68);e.exports=function(e,t){if(e){if("string"==typeof e)return r(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(e,t):void 0}},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r},e.exports.default=e.exports,e.exports.__esModule=!0},,,function(e,t){function n(t,r){return e.exports=n=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},e.exports.default=e.exports,e.exports.__esModule=!0,n(t,r)}e.exports=n,e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=window.wp.url},,function(e,t){e.exports=window.wp.warning},function(e,t){e.exports=window.wp.hooks},function(e,t,n){"use strict";var r=n(12),o=n(19),c=n(0),i=n(6),a=n.n(i),u=n(7),s=n(45),l=n.n(s),p=n(15),f=n(16),d=n(17),m=n(18),b=n(9),h=n(22),v=n(37),g=n(50),y=n(24),O=n(116),w=n(20);function j(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function k(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?j(Object(n),!0).forEach((function(t){Object(w.a)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):j(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function E(e,t,n,r,o,c,i){var a=t.width,u="rtl"===document.documentElement.dir;"left"===n&&u?n="right":"right"===n&&u&&(n="left"),"left"===r&&u?r="right":"right"===r&&u&&(r="left");var s=Math.round(e.left+e.width/2),l={popoverLeft:s,contentWidth:(s-a/2>0?a/2:s)+(s+a/2>window.innerWidth?window.innerWidth-s:a/2)},p=e.left;"right"===r?p=e.right:"middle"!==c&&(p=s);var f=e.right;"left"===r?f=e.left:"middle"!==c&&(f=s);var d,m={popoverLeft:p,contentWidth:p-a>0?a:p},b={popoverLeft:f,contentWidth:f+a>window.innerWidth?window.innerWidth-f:a},h=n,v=null;if(!o)if("center"===n&&l.contentWidth===a)h="center";else if("left"===n&&m.contentWidth===a)h="left";else if("right"===n&&b.contentWidth===a)h="right";else{var g="left"==(h=m.contentWidth>b.contentWidth?"left":"right")?m.contentWidth:b.contentWidth;v=g!==a?g:null}if(d="center"===h?l.popoverLeft:"left"===h?m.popoverLeft:b.popoverLeft,i){var y=i.getBoundingClientRect();d=Math.min(d,y.right-a)}return{xAxis:h,popoverLeft:d,contentWidth:v}}function x(e,t,n,r,o,c,i){var a=t.height;if(o){var u=(Object(v.getScrollContainer)(c)||document.body).getBoundingClientRect().top+a-i;if(e.top<=u)return{yAxis:n,popoverTop:Math.min(e.bottom,u)}}var s=e.top+e.height/2;"bottom"===r?s=e.bottom:"top"===r&&(s=e.top);var l={popoverTop:s,contentHeight:(s-a/2>0?a/2:s)+(s+a/2>window.innerHeight?window.innerHeight-s:a/2)},p={popoverTop:e.top,contentHeight:e.top-10-a>0?a:e.top-10},f={popoverTop:e.bottom,contentHeight:e.bottom+10+a>window.innerHeight?window.innerHeight-10-e.bottom:a},d=n,m=null;if(!o)if("middle"===n&&l.contentHeight===a)d="middle";else if("top"===n&&p.contentHeight===a)d="top";else if("bottom"===n&&f.contentHeight===a)d="bottom";else{var b="top"==(d=p.contentHeight>f.contentHeight?"top":"bottom")?p.contentHeight:f.contentHeight;m=b!==a?b:null}return{yAxis:d,popoverTop:"middle"===d?l.popoverTop:"top"===d?p.popoverTop:f.popoverTop,contentHeight:m}}var _=n(31),S=n(13);var P=Object(c.createContext)({focusHistory:[]}),R=P.Provider,C=P.Consumer;R.displayName="FocusReturnProvider",C.displayName="FocusReturnConsumer",c.Component;var T=Object(y.createHigherOrderComponent)((function e(t){if((r=t)instanceof c.Component||"function"==typeof r){var n=t;return e({})(n)}var r,o=t.onFocusReturn,i=void 0===o?u.stubTrue:o;return function(e){var t=function(t){Object(d.a)(a,t);var n,r,o=(n=a,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=Object(b.a)(n);if(r){var o=Object(b.a)(this).constructor;e=Reflect.construct(t,arguments,o)}else e=t.apply(this,arguments);return Object(m.a)(this,e)});function a(){var e;return Object(p.a)(this,a),(e=o.apply(this,arguments)).ownFocusedElements=new Set,e.activeElementOnMount=document.activeElement,e.setIsFocusedFalse=function(){return e.isFocused=!1},e.setIsFocusedTrue=function(t){e.ownFocusedElements.add(t.target),e.isFocused=!0},e}return Object(f.a)(a,[{key:"componentWillUnmount",value:function(){var e=this.activeElementOnMount,t=this.isFocused,n=this.ownFocusedElements;if(t&&!1!==i())for(var r,o=[].concat(Object(_.a)(u.without.apply(void 0,[this.props.focus.focusHistory].concat(Object(_.a)(n)))),[e]);r=o.pop();)if(document.body.contains(r))return void r.focus()}},{key:"render",value:function(){return Object(c.createElement)("div",{onFocus:this.setIsFocusedTrue,onBlur:this.setIsFocusedFalse},Object(c.createElement)(e,this.props.childProps))}}]),a}(c.Component);return function(e){return Object(c.createElement)(C,null,(function(n){return Object(c.createElement)(t,{childProps:e,focus:n})}))}}}),"withFocusReturn");var A=Object(y.createHigherOrderComponent)((function(e){return function(t){Object(d.a)(i,t);var n,r,o=(n=i,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=Object(b.a)(n);if(r){var o=Object(b.a)(this).constructor;e=Reflect.construct(t,arguments,o)}else e=t.apply(this,arguments);return Object(m.a)(this,e)});function i(){var e;return Object(p.a)(this,i),(e=o.apply(this,arguments)).focusContainRef=Object(c.createRef)(),e.handleTabBehaviour=e.handleTabBehaviour.bind(Object(S.a)(e)),e}return Object(f.a)(i,[{key:"handleTabBehaviour",value:function(e){if(e.keyCode===g.TAB){var t=v.focus.tabbable.find(this.focusContainRef.current);if(t.length){var n=t[0],r=t[t.length-1];e.shiftKey&&e.target===n?(e.preventDefault(),r.focus()):(e.shiftKey||e.target!==r)&&t.includes(e.target)||(e.preventDefault(),n.focus())}}}},{key:"render",value:function(){return Object(c.createElement)("div",{onKeyDown:this.handleTabBehaviour,ref:this.focusContainRef,tabIndex:"-1"},Object(c.createElement)(e,this.props))}}]),i}(c.Component)}),"withConstrainedTabbing"),M=n(89);var N=function(e){Object(d.a)(o,e);var t,n,r=(t=o,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=Object(b.a)(t);if(n){var o=Object(b.a)(this).constructor;e=Reflect.construct(r,arguments,o)}else e=r.apply(this,arguments);return Object(m.a)(this,e)});function o(){return Object(p.a)(this,o),r.apply(this,arguments)}return Object(f.a)(o,[{key:"handleFocusOutside",value:function(e){this.props.onFocusOutside(e)}},{key:"render",value:function(){return this.props.children}}]),o}(c.Component),D=Object(M.a)(N);function F(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Object(b.a)(e);if(t){var o=Object(b.a)(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Object(m.a)(this,n)}}var I=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.htmlDocument,n=void 0===t?document:t,r=e.className,o=void 0===r?"lockscroll":r,i=0,a=0;function u(e){var t=n.scrollingElement||n.body;e&&(a=t.scrollTop);var r=e?"add":"remove";t.classList[r](o),n.documentElement.classList[r](o),e||(t.scrollTop=a)}function s(){0===i&&u(!0),++i}function l(){1===i&&u(!1),--i}return function(e){Object(d.a)(n,e);var t=F(n);function n(){return Object(p.a)(this,n),t.apply(this,arguments)}return Object(f.a)(n,[{key:"componentDidMount",value:function(){s()}},{key:"componentWillUnmount",value:function(){l()}},{key:"render",value:function(){return null}}]),n}(c.Component)}();function B(e){e.stopPropagation()}var L=Object(c.forwardRef)((function(e,t){var n=e.children,i=Object(o.a)(e,["children"]);return Object(c.createElement)("div",Object(r.a)({},i,{ref:t,onMouseDown:B}),n)})),U=n(47);function H(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function z(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?H(Object(n),!0).forEach((function(t){Object(w.a)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):H(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function V(e){var t=Object(c.useContext)(U.a),n=t.slots[e]||{},r=t.fills[e],o=Object(c.useMemo)((function(){return r||[]}),[r]),i=Object(c.useCallback)((function(n){t.updateSlot(e,n)}),[e,t.updateSlot]),a=Object(c.useCallback)((function(n){t.unregisterSlot(e,n)}),[e,t.unregisterSlot]),u=Object(c.useCallback)((function(n){t.registerFill(e,n)}),[e,t.registerFill]),s=Object(c.useCallback)((function(n){t.unregisterFill(e,n)}),[e,t.unregisterFill]);return z(z({},n),{},{updateSlot:i,unregisterSlot:a,fills:o,registerFill:u,unregisterFill:s})}function W(e,t,n){return(W="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var r=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=Object(b.a)(e)););return e}(e,t);if(r){var o=Object.getOwnPropertyDescriptor(r,t);return o.get?o.get.call(n):o.value}})(e,t,n||e)}n(25);var q=Object(c.createContext)({registerSlot:function(){},unregisterSlot:function(){},registerFill:function(){},unregisterFill:function(){},getSlot:function(){},getFills:function(){},subscribe:function(){}}),Y=(q.Provider,q.Consumer);c.Component;var G=function(e){Object(d.a)(o,e);var t,n,r=(t=o,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=Object(b.a)(t);if(n){var o=Object(b.a)(this).constructor;e=Reflect.construct(r,arguments,o)}else e=r.apply(this,arguments);return Object(m.a)(this,e)});function o(){var e;return Object(p.a)(this,o),(e=r.apply(this,arguments)).isUnmounted=!1,e.bindNode=e.bindNode.bind(Object(S.a)(e)),e}return Object(f.a)(o,[{key:"componentDidMount",value:function(){(0,this.props.registerSlot)(this.props.name,this)}},{key:"componentWillUnmount",value:function(){var e=this.props.unregisterSlot;this.isUnmounted=!0,e(this.props.name,this)}},{key:"componentDidUpdate",value:function(e){var t=this.props,n=t.name,r=t.unregisterSlot,o=t.registerSlot;e.name!==n&&(r(e.name),o(n,this))}},{key:"bindNode",value:function(e){this.node=e}},{key:"forceUpdate",value:function(){this.isUnmounted||W(Object(b.a)(o.prototype),"forceUpdate",this).call(this)}},{key:"render",value:function(){var e=this.props,t=e.children,n=e.name,r=e.fillProps,o=void 0===r?{}:r,i=e.getFills,a=Object(u.map)(i(n,this),(function(e){var t=e.occurrence,n=Object(u.isFunction)(e.children)?e.children(o):e.children;return c.Children.map(n,(function(e,n){if(!e||Object(u.isString)(e))return e;var r="".concat(t,"---").concat(e.key||n);return Object(c.cloneElement)(e,{key:r})}))})).filter(Object(u.negate)(c.isEmptyElement));return Object(c.createElement)(c.Fragment,null,Object(u.isFunction)(t)?t(a):a)}}]),o}(c.Component),X=function(e){return Object(c.createElement)(Y,null,(function(t){var n=t.registerSlot,o=t.unregisterSlot,i=t.getFills;return Object(c.createElement)(G,Object(r.a)({},e,{registerSlot:n,unregisterSlot:o,getFills:i}))}))},$=0;function K(e){var t=e.name,n=e.children,r=e.registerFill,o=e.unregisterFill,i=function(e){var t=Object(c.useContext)(q),n=t.getSlot,r=t.subscribe,o=Object(c.useState)(n(e)),i=Object(h.a)(o,2),a=i[0],u=i[1];return Object(c.useEffect)((function(){return u(n(e)),r((function(){u(n(e))}))}),[e]),a}(t),a=Object(c.useRef)({name:t,children:n});return a.current.occurrence||(a.current.occurrence=++$),Object(c.useLayoutEffect)((function(){return r(t,a.current),function(){return o(t,a.current)}}),[]),Object(c.useLayoutEffect)((function(){a.current.children=n,i&&i.forceUpdate()}),[n]),Object(c.useLayoutEffect)((function(){t!==a.current.name&&(o(a.current.name,a.current),a.current.name=t,r(t,a.current))}),[t]),i&&i.node?(Object(u.isFunction)(n)&&(n=n(i.props.fillProps)),Object(c.createPortal)(n,i.node)):null}var Z=function(e){return Object(c.createElement)(Y,null,(function(t){var n=t.registerFill,o=t.unregisterFill;return Object(c.createElement)(K,Object(r.a)({},e,{registerFill:n,unregisterFill:o}))}))};function J(e){var t=e.name,n=e.fillProps,i=void 0===n?{}:n,a=e.as,u=void 0===a?"div":a,s=Object(o.a)(e,["name","fillProps","as"]),l=Object(c.useContext)(U.a),p=Object(c.useRef)();return Object(c.useLayoutEffect)((function(){return l.registerSlot(t,p,i),function(){l.unregisterSlot(t,p)}}),[l.registerSlot,l.unregisterSlot,t]),Object(c.useLayoutEffect)((function(){l.updateSlot(t,i)})),Object(c.createElement)(u,Object(r.a)({ref:p},s))}function Q(e){var t,n,r=e.name,o=e.children,i=V(r),a=Object(c.useRef)({rerender:(t=Object(c.useState)({}),n=Object(h.a)(t,2)[1],function(){return n({})})});return Object(c.useEffect)((function(){return i.registerFill(a),function(){i.unregisterFill(a)}}),[i.registerFill,i.unregisterFill]),i.ref&&i.ref.current?("function"==typeof o&&(o=o(i.fillProps)),Object(c.createPortal)(o,i.ref.current)):null}function ee(e){var t=e.bubblesVirtually,n=Object(o.a)(e,["bubblesVirtually"]);return t?Object(c.createElement)(J,n):Object(c.createElement)(X,n)}function te(e){return Object(c.createElement)(c.Fragment,null,Object(c.createElement)(Z,e),Object(c.createElement)(Q,e))}function ne(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function re(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ne(Object(n),!0).forEach((function(t){Object(w.a)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ne(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function oe(e){var t=e.type,n=e.origin,r=void 0===n?function(e){return"appear"===e?"top":"left"}(t):n;if("appear"===t){var o,c=r.split(" "),i=Object(h.a)(c,2),u=i[0],s=i[1],l=void 0===s?"center":s;return a()("components-animate__appear",(o={},Object(w.a)(o,"is-from-"+l,"center"!==l),Object(w.a)(o,"is-from-"+u,"middle"!==u),o))}return"slide-in"===t?a()("components-animate__slide-in","is-from-"+r):"loading"===t?a()("components-animate__loading"):void 0}function ce(e){var t=e.type,n=e.options,r=void 0===n?{}:n;return(0,e.children)({className:oe(re({type:t},r))})}var ie=A(T((function(e){return e.children})));function ae(e,t){var n,r=(n=t).ownerDocument.defaultView.getComputedStyle(n),o=r.paddingTop,c=r.paddingBottom,i=r.paddingLeft,a=r.paddingRight,u=o?parseInt(o,10):0,s=c?parseInt(c,10):0,l=i?parseInt(i,10):0,p=a?parseInt(a,10):0;return{x:e.left+l,y:e.top+u,width:e.width-l-p,height:e.height-u-s,left:e.left+l,right:e.right-p,top:e.top+u,bottom:e.bottom-s}}function ue(e,t,n){n?e.getAttribute(t)!==n&&e.setAttribute(t,n):e.hasAttribute(t)&&e.removeAttribute(t)}function se(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";e.style[t]!==n&&(e.style[t]=n)}function le(e,t,n){n?e.classList.contains(t)||e.classList.add(t):e.classList.contains(t)&&e.classList.remove(t)}var pe=function(e){var t=e.headerTitle,n=e.onClose,i=e.onKeyDown,u=e.children,s=e.className,p=e.noArrow,f=void 0===p||p,d=e.isAlternate,m=e.position,b=void 0===m?"bottom right":m,w=(e.range,e.focusOnMount),j=void 0===w?"firstElement":w,_=e.anchorRef,S=e.shouldAnchorIncludePadding,P=e.anchorRect,R=e.getAnchorRect,C=e.expandOnMobile,T=e.animate,A=void 0===T||T,M=e.onClickOutside,N=e.onFocusOutside,F=e.__unstableSticky,B=e.__unstableSlotName,U=void 0===B?"Popover":B,H=e.__unstableObserveElement,z=e.__unstableBoundaryParent,W=Object(o.a)(e,["headerTitle","onClose","onKeyDown","children","className","noArrow","isAlternate","position","range","focusOnMount","anchorRef","shouldAnchorIncludePadding","anchorRect","getAnchorRect","expandOnMobile","animate","onClickOutside","onFocusOutside","__unstableSticky","__unstableSlotName","__unstableObserveElement","__unstableBoundaryParent"]),q=Object(c.useRef)(null),Y=Object(c.useRef)(null),G=Object(c.useRef)(),X=Object(y.useViewportMatch)("medium","<"),$=Object(c.useState)(),K=Object(h.a)($,2),Z=K[0],J=K[1],Q=V(U),ee=C&&X,ne=Object(y.useResizeObserver)(),re=Object(h.a)(ne,2),oe=re[0],pe=re[1];f=ee||f,Object(c.useLayoutEffect)((function(){if(ee)return le(G.current,"is-without-arrow",f),le(G.current,"is-alternate",d),ue(G.current,"data-x-axis"),ue(G.current,"data-y-axis"),se(G.current,"top"),se(G.current,"left"),se(Y.current,"maxHeight"),void se(Y.current,"maxWidth");var e=function(){if(G.current&&Y.current){var e=function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],o=arguments.length>4?arguments[4]:void 0;if(t)return t;if(n){if(!e.current)return;return n(e.current)}if(!1!==r){if(!(r&&window.Range&&window.Element&&window.DOMRect))return;if(r instanceof window.Range)return Object(v.getRectangleFromRange)(r);if(r instanceof window.Element){var c=r.getBoundingClientRect();return o?c:ae(c,r)}var i=r.top,a=r.bottom,u=i.getBoundingClientRect(),s=a.getBoundingClientRect(),l=new window.DOMRect(u.left,u.top,u.width,s.bottom-u.top);return o?l:ae(l,r)}if(e.current){var p=e.current.parentNode,f=p.getBoundingClientRect();return o?f:ae(f,p)}}(q,P,R,_,S);if(e){var t,n,r=G.current,o=r.offsetParent,c=r.ownerDocument,i=0;if(o&&o!==c.body){var a=o.getBoundingClientRect();i=a.top,e=new window.DOMRect(e.left-a.left,e.top-a.top,e.width,e.height)}z&&(t=null===(n=G.current.closest(".popover-slot"))||void 0===n?void 0:n.parentNode);var u=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"top",r=arguments.length>3?arguments[3]:void 0,o=arguments.length>4?arguments[4]:void 0,c=arguments.length>5?arguments[5]:void 0,i=arguments.length>6?arguments[6]:void 0,a=n.split(" "),u=Object(h.a)(a,3),s=u[0],l=u[1],p=void 0===l?"center":l,f=u[2],d=x(e,t,s,f,r,o,c),m=E(e,t,p,f,r,d.yAxis,i);return k(k({},m),d)}(e,pe.height?pe:Y.current.getBoundingClientRect(),b,F,G.current,i,t),s=u.popoverTop,l=u.popoverLeft,p=u.xAxis,m=u.yAxis,g=u.contentHeight,y=u.contentWidth;"number"==typeof s&&"number"==typeof l&&(se(G.current,"top",s+"px"),se(G.current,"left",l+"px")),le(G.current,"is-without-arrow",f||"center"===p&&"middle"===m),le(G.current,"is-alternate",d),ue(G.current,"data-x-axis",p),ue(G.current,"data-y-axis",m),se(Y.current,"maxHeight","number"==typeof g?g+"px":""),se(Y.current,"maxWidth","number"==typeof y?y+"px":""),J(({left:"right",right:"left"}[p]||"center")+" "+({top:"bottom",bottom:"top"}[m]||"middle"))}}};e();var t,n,r=window.setInterval(e,500),o=function(){window.cancelAnimationFrame(t),t=window.requestAnimationFrame(e)};return window.addEventListener("click",o),window.addEventListener("resize",e),window.addEventListener("scroll",e,!0),H&&(n=new window.MutationObserver(e)).observe(H,{attributes:!0}),function(){window.clearInterval(r),window.removeEventListener("resize",e),window.removeEventListener("scroll",e,!0),window.removeEventListener("click",o),window.cancelAnimationFrame(t),n&&n.disconnect()}}),[ee,P,R,_,S,b,pe,F,H,z]),function(e,t){Object(c.useEffect)((function(){var n=setTimeout((function(){if(e&&t.current)if("firstElement"!==e)"container"===e&&t.current.focus();else{var n=v.focus.tabbable.find(t.current)[0];n?n.focus():t.current.focus()}}),0);return function(){return clearTimeout(n)}}),[])}(j,Y);var fe=function(e){e.keyCode===g.ESCAPE&&n&&(e.stopPropagation(),n()),i&&i(e)},de=Object(c.createElement)(D,{onFocusOutside:function(e){if(N)N(e);else if(M){var t;try{t=new window.MouseEvent("click")}catch(e){(t=document.createEvent("MouseEvent")).initMouseEvent("click",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null)}Object.defineProperty(t,"target",{get:function(){return e.relatedTarget}}),l()("Popover onClickOutside prop",{alternative:"onFocusOutside"}),M(t)}else n&&n()}},Object(c.createElement)(ce,{type:A&&Z?"appear":null,options:{origin:Z}},(function(e){var o=e.className;return Object(c.createElement)(L,Object(r.a)({className:a()("components-popover",s,o,{"is-expanded":ee,"is-without-arrow":f,"is-alternate":d})},W,{onKeyDown:fe,ref:G}),ee&&Object(c.createElement)(I,null),ee&&Object(c.createElement)("div",{className:"components-popover__header"},Object(c.createElement)("span",{className:"components-popover__header-title"},t),Object(c.createElement)(ge,{className:"components-popover__close",icon:O.a,onClick:n})),Object(c.createElement)("div",{ref:Y,className:"components-popover__content",tabIndex:"-1"},Object(c.createElement)("div",{style:{position:"relative"}},oe,u)))})));return j&&(de=Object(c.createElement)(ie,null,de)),Q.ref&&(de=Object(c.createElement)(te,{name:U},de)),_||P?de:Object(c.createElement)("span",{ref:q},de)};pe.Slot=function(e){var t=e.name,n=void 0===t?"Popover":t;return Object(c.createElement)(ee,{bubblesVirtually:!0,name:n,className:"popover-slot"})};var fe=pe,de=function(e){var t,n,r=e.shortcut,o=e.className;return r?(Object(u.isString)(r)&&(t=r),Object(u.isObject)(r)&&(t=r.display,n=r.ariaLabel),Object(c.createElement)("span",{className:o,"aria-label":n},t)):null};var me=function(e){Object(d.a)(o,e);var t,n,r=(t=o,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=Object(b.a)(t);if(n){var o=Object(b.a)(this).constructor;e=Reflect.construct(r,arguments,o)}else e=r.apply(this,arguments);return Object(m.a)(this,e)});function o(){var e;return Object(p.a)(this,o),(e=r.apply(this,arguments)).delayedSetIsOver=Object(u.debounce)((function(t){return e.setState({isOver:t})}),700),e.cancelIsMouseDown=e.createSetIsMouseDown(!1),e.isInMouseDown=!1,e.state={isOver:!1},e}return Object(f.a)(o,[{key:"componentWillUnmount",value:function(){this.delayedSetIsOver.cancel(),document.removeEventListener("mouseup",this.cancelIsMouseDown)}},{key:"emitToChild",value:function(e,t){var n=this.props.children;if(1===c.Children.count(n)){var r=c.Children.only(n);"function"==typeof r.props[e]&&r.props[e](t)}}},{key:"createToggleIsOver",value:function(e,t){var n=this;return function(r){if(n.emitToChild(e,r),!(r.currentTarget.disabled||"focus"===r.type&&n.isInMouseDown)){n.delayedSetIsOver.cancel();var o=Object(u.includes)(["focus","mouseenter"],r.type);o!==n.state.isOver&&(t?n.delayedSetIsOver(o):n.setState({isOver:o}))}}}},{key:"createSetIsMouseDown",value:function(e){var t=this;return function(n){t.emitToChild(e?"onMouseDown":"onMouseUp",n),document[e?"addEventListener":"removeEventListener"]("mouseup",t.cancelIsMouseDown),t.isInMouseDown=e}}},{key:"render",value:function(){var e=this.props,t=e.children,n=e.position,r=e.text,o=e.shortcut;if(1!==c.Children.count(t))return t;var i=c.Children.only(t),a=this.state.isOver;return Object(c.cloneElement)(i,{onMouseEnter:this.createToggleIsOver("onMouseEnter",!0),onMouseLeave:this.createToggleIsOver("onMouseLeave"),onClick:this.createToggleIsOver("onClick"),onFocus:this.createToggleIsOver("onFocus"),onBlur:this.createToggleIsOver("onBlur"),onMouseDown:this.createSetIsMouseDown(!0),children:Object(c.concatChildren)(i.props.children,a&&Object(c.createElement)(fe,{focusOnMount:!1,position:n,className:"components-tooltip","aria-hidden":"true",animate:!1,noArrow:!0},r,Object(c.createElement)(de,{className:"components-tooltip__shortcut",shortcut:o})))})}}]),o}(c.Component),be=n(91);function he(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var ve=["onMouseDown","onClick"],ge=t.a=Object(c.forwardRef)((function(e,t){var n=e.href,i=e.target,s=e.isPrimary,p=e.isSmall,f=e.isTertiary,d=e.isPressed,m=e.isBusy,b=e.isDefault,h=e.isSecondary,v=e.isLink,g=e.isDestructive,y=e.className,O=e.disabled,w=e.icon,j=e.iconSize,k=e.showTooltip,E=e.tooltipPosition,x=e.shortcut,_=e.label,S=e.children,P=e.__experimentalIsFocusable,R=Object(o.a)(e,["href","target","isPrimary","isSmall","isTertiary","isPressed","isBusy","isDefault","isSecondary","isLink","isDestructive","className","disabled","icon","iconSize","showTooltip","tooltipPosition","shortcut","label","children","__experimentalIsFocusable"]);b&&l()("Button isDefault prop",{alternative:"isSecondary"});var C=a()("components-button",y,{"is-secondary":b||h,"is-primary":s,"is-small":p,"is-tertiary":f,"is-pressed":d,"is-busy":m,"is-link":v,"is-destructive":g,"has-text":!!w&&!!S,"has-icon":!!w}),T=O&&!P,A=void 0===n||T?"button":"a",M="a"===A?{href:n,target:i}:{type:"button",disabled:T,"aria-pressed":d};if(O&&P){M["aria-disabled"]=!0;var N,D=function(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return he(e,void 0);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?he(e,void 0):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var c,i=!0,a=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return i=e.done,e},e:function(e){a=!0,c=e},f:function(){try{i||null==n.return||n.return()}finally{if(a)throw c}}}}(ve);try{for(D.s();!(N=D.n()).done;)R[N.value]=function(e){e.stopPropagation(),e.preventDefault()}}catch(e){D.e(e)}finally{D.f()}}var F=!T&&(k&&_||x||!!_&&(!S||Object(u.isArray)(S)&&!S.length)&&!1!==k),I=Object(c.createElement)(A,Object(r.a)({},M,R,{className:C,"aria-label":R["aria-label"]||_,ref:t}),w&&Object(c.createElement)(be.a,{icon:w,size:j}),S);return F?Object(c.createElement)(me,{text:_,shortcut:x,position:E},I):I}))},function(e,t){e.exports=function(e,t){if(null==e)return{};var n,r,o={},c=Object.keys(e);for(r=0;r<c.length;r++)n=c[r],t.indexOf(n)>=0||(o[n]=e[n]);return o},e.exports.default=e.exports,e.exports.__esModule=!0},,function(e,t,n){"use strict";var r=n(80);function o(){}function c(){}c.resetWarningCache=o,e.exports=function(){function e(e,t,n,o,c,i){if(i!==r){var a=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw a.name="Invariant Violation",a}}function t(){return e}e.isRequired=e;var n={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:c,resetWarningCache:o};return n.PropTypes=n,n}},function(e,t,n){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},function(e,t){},,function(e,t,n){"use strict";n.d(t,"n",(function(){return c})),n.d(t,"l",(function(){return i})),n.d(t,"k",(function(){return a})),n.d(t,"m",(function(){return u})),n.d(t,"i",(function(){return s})),n.d(t,"d",(function(){return l})),n.d(t,"f",(function(){return p})),n.d(t,"j",(function(){return f})),n.d(t,"c",(function(){return d})),n.d(t,"e",(function(){return m})),n.d(t,"g",(function(){return b})),n.d(t,"a",(function(){return h})),n.d(t,"h",(function(){return v})),n.d(t,"b",(function(){return g}));var r,o=n(2),c=Object(o.getSetting)("wcBlocksConfig",{buildPhase:1,pluginUrl:"",productCount:0,defaultAvatar:"",restApiRoutes:{},wordCountType:"words"}),i=c.pluginUrl+"images/",a=c.pluginUrl+"build/",u=c.buildPhase,s=null===(r=o.STORE_PAGES.shop)||void 0===r?void 0:r.permalink,l=(o.STORE_PAGES.checkout.id,o.STORE_PAGES.checkout.permalink),p=o.STORE_PAGES.privacy.permalink,f=(o.STORE_PAGES.privacy.title,o.STORE_PAGES.terms.permalink),d=(o.STORE_PAGES.terms.title,o.STORE_PAGES.cart.id,o.STORE_PAGES.cart.permalink),m=o.STORE_PAGES.myaccount.permalink?o.STORE_PAGES.myaccount.permalink:Object(o.getSetting)("wpLoginUrl","/wp-login.php"),b=Object(o.getSetting)("shippingCountries",{}),h=Object(o.getSetting)("allowedCountries",{}),v=Object(o.getSetting)("shippingStates",{}),g=Object(o.getSetting)("allowedStates",{})},function(e,t){e.exports=function(e){if(Array.isArray(e))return e},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,c=[],_n=!0,i=!1;try{for(n=n.call(e);!(_n=(r=n.next()).done)&&(c.push(r.value),!t||c.length!==t);_n=!0);}catch(e){i=!0,o=e}finally{try{_n||null==n.return||n.return()}finally{if(i)throw o}}return c}},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,n){"use strict";var r=n(4),o=n.n(r),c=n(5),i=n.n(c),a=n(2),u=n(1),s=n(49);function l(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function p(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?l(Object(n),!0).forEach((function(t){o()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):l(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var f=Object(a.getSetting)("countryLocale",{}),d=function(e){var t={};return void 0!==e.label&&(t.label=e.label),void 0!==e.required&&(t.required=e.required),void 0!==e.hidden&&(t.hidden=e.hidden),void 0===e.label||e.optionalLabel||(t.optionalLabel=Object(u.sprintf)(
/* translators: %s Field label. */
Object(u.__)("%s (optional)",'woocommerce'),e.label)),e.priority&&(Object(s.a)(e.priority)&&(t.index=e.priority),Object(s.c)(e.priority)&&(t.index=parseInt(e.priority,10))),e.hidden&&(t.required=!1),t},m=Object.entries(f).map((function(e){var t=i()(e,2),n=t[0],r=t[1];return[n,Object.entries(r).map((function(e){var t=i()(e,2),n=t[0],r=t[1];return[n,d(r)]})).reduce((function(e,t){var n=i()(t,2),r=n[0],o=n[1];return e[r]=o,e}),{})]})).reduce((function(e,t){var n=i()(t,2),r=n[0],o=n[1];return e[r]=o,e}),{});t.a=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",r=n&&void 0!==m[n]?m[n]:{};return e.map((function(e){var n=a.defaultAddressFields[e]||{},o=r[e]||{},c=t[e]||{};return p(p(p({key:e},n),o),c)})).sort((function(e,t){return e.index-t.index}))}},function(e,t,n){"use strict";function r(e,t){return(r=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";var r=n(12),o=n(15),c=n(16),i=n(13),a=n(17),u=n(18),s=n(9),l=n(0),p=n(7),f=n(24);var d=["button","submit"];t.a=Object(f.createHigherOrderComponent)((function(e){return function(t){Object(a.a)(b,t);var n,f,m=(n=b,f=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=Object(s.a)(n);if(f){var r=Object(s.a)(this).constructor;e=Reflect.construct(t,arguments,r)}else e=t.apply(this,arguments);return Object(u.a)(this,e)});function b(){var e;return Object(o.a)(this,b),(e=m.apply(this,arguments)).bindNode=e.bindNode.bind(Object(i.a)(e)),e.cancelBlurCheck=e.cancelBlurCheck.bind(Object(i.a)(e)),e.queueBlurCheck=e.queueBlurCheck.bind(Object(i.a)(e)),e.normalizeButtonFocus=e.normalizeButtonFocus.bind(Object(i.a)(e)),e}return Object(c.a)(b,[{key:"componentWillUnmount",value:function(){this.cancelBlurCheck()}},{key:"bindNode",value:function(e){e?this.node=e:(delete this.node,this.cancelBlurCheck())}},{key:"queueBlurCheck",value:function(e){var t=this;e.persist(),this.preventBlurCheck||(this.blurCheckTimeout=setTimeout((function(){document.hasFocus()?"function"==typeof t.node.handleFocusOutside&&t.node.handleFocusOutside(e):e.preventDefault()}),0))}},{key:"cancelBlurCheck",value:function(){clearTimeout(this.blurCheckTimeout)}},{key:"normalizeButtonFocus",value:function(e){var t=e.type,n=e.target;Object(p.includes)(["mouseup","touchend"],t)?this.preventBlurCheck=!1:function(e){switch(e.nodeName){case"A":case"BUTTON":return!0;case"INPUT":return Object(p.includes)(d,e.type)}return!1}(n)&&(this.preventBlurCheck=!0)}},{key:"render",value:function(){return Object(l.createElement)("div",{onFocus:this.cancelBlurCheck,onMouseDown:this.normalizeButtonFocus,onMouseUp:this.normalizeButtonFocus,onTouchStart:this.normalizeButtonFocus,onTouchEnd:this.normalizeButtonFocus,onBlur:this.queueBlurCheck},Object(l.createElement)(e,Object(r.a)({ref:this.bindNode},this.props)))}}]),b}(l.Component)}),"withFocusOutside")},,function(e,t,n){"use strict";var r=n(20),o=n(12),c=n(19),i=n(0),a=n(34),u=function(e){var t=e.icon,n=e.className,r=Object(c.a)(e,["icon","className"]),a=["dashicon","dashicons","dashicons-"+t,n].filter(Boolean).join(" ");return Object(i.createElement)("span",Object(o.a)({className:a},r))};function s(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function l(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?s(Object(n),!0).forEach((function(t){Object(r.a)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):s(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}t.a=function(e){var t=e.icon,n=void 0===t?null:t,r=e.size,s=Object(c.a)(e,["icon","size"]);if("string"==typeof n)return Object(i.createElement)(u,Object(o.a)({icon:n},s));if(n&&u===n.type)return Object(i.cloneElement)(n,l({},s));var p=r||24;if("function"==typeof n)return n.prototype instanceof i.Component?Object(i.createElement)(n,l({size:p},s)):n(l({size:p},s));if(n&&("svg"===n.type||n.type===a.SVG)){var f=l(l({width:p,height:p},n.props),s);return Object(i.createElement)(a.SVG,f)}return Object(i.isValidElement)(n)?Object(i.cloneElement)(n,l({size:p},s)):n}},function(e,t,n){"use strict";n.d(t,"a",(function(){return c}));var r=n(5),o=n.n(r),c=function(e){return e.reduce((function(e,t){var n=o()(t,2),r=n[0],c=n[1];return e[r]=c,e}),{})}},function(e,t,n){"use strict";n.d(t,"b",(function(){return i})),n.d(t,"c",(function(){return a})),n.d(t,"a",(function(){return u}));var r=n(2),o=n(87),c=n(72),i=function(e){var t=e.country,n=void 0===t?"":t,r=e.state,o=void 0===r?"":r,c=e.city,i=void 0===c?"":c,a=e.postcode,u=void 0===a?"":a;return{country:n.trim(),state:o.trim(),city:i.trim(),postcode:u?u.replace(" ","").toUpperCase():""}},a=function(e){var t=e.email,n=void 0===t?"":t;return Object(c.isEmail)(n)?n.trim():""},u=function(e){var t=Object.keys(r.defaultAddressFields),n=Object(o.a)(t,{},e.country),c=Object.assign({},e);return n.forEach((function(t){var n=t.key,r=void 0===n?"":n,o=t.hidden;void 0!==o&&o&&function(e,t){return e in t}(r,e)&&(c[r]="")})),c}},function(e,t,n){var r=n(68);e.exports=function(e){if(Array.isArray(e))return r(e)},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=window.wp.autop},,,,function(e,t){e.exports=window.wc.wcBlocksSharedContext},function(e,t){var n,r,o=e.exports={};function c(){throw new Error("setTimeout has not been defined")}function i(){throw new Error("clearTimeout has not been defined")}function a(e){if(n===setTimeout)return setTimeout(e,0);if((n===c||!n)&&setTimeout)return n=setTimeout,setTimeout(e,0);try{return n(e,0)}catch(t){try{return n.call(null,e,0)}catch(t){return n.call(this,e,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:c}catch(e){n=c}try{r="function"==typeof clearTimeout?clearTimeout:i}catch(e){r=i}}();var u,s=[],l=!1,p=-1;function f(){l&&u&&(l=!1,u.length?s=u.concat(s):p=-1,s.length&&d())}function d(){if(!l){var e=a(f);l=!0;for(var t=s.length;t;){for(u=s,s=[];++p<t;)u&&u[p].run();p=-1,t=s.length}u=null,l=!1,function(e){if(r===clearTimeout)return clearTimeout(e);if((r===i||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(e);try{r(e)}catch(t){try{return r.call(null,e)}catch(t){return r.call(this,e)}}}(e)}}function m(e,t){this.fun=e,this.array=t}function b(){}o.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];s.push(new m(e,t)),1!==s.length||l||a(d)},m.prototype.run=function(){this.fun.apply(null,this.array)},o.title="browser",o.browser=!0,o.env={},o.argv=[],o.version="",o.versions={},o.on=b,o.addListener=b,o.once=b,o.off=b,o.removeListener=b,o.removeAllListeners=b,o.emit=b,o.prependListener=b,o.prependOnceListener=b,o.listeners=function(e){return[]},o.binding=function(e){throw new Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(e){throw new Error("process.chdir is not supported")},o.umask=function(){return 0}},function(e,t,n){"use strict";n.d(t,"b",(function(){return w})),n.d(t,"a",(function(){return j}));var r=n(4),o=n.n(r),c=n(5),i=n.n(c),a=(n(10),n(0)),u=n(11),s=n(52),l=n(36),p=n(14),f=n.n(p),d=n(6),m=n.n(d),b=n(153),h=(n(112),function(e){var t=e.status;switch(void 0===t?"default":t){case"error":return"woocommerce-error";case"success":return"woocommerce-message";case"info":case"warning":return"woocommerce-info"}return""}),v=function(e){var t=e.className,n=e.notices,r=e.removeNotice,o=n.filter((function(e){return"snackbar"!==e.type}));if(!o.length)return null;var c=m()(t,"wc-block-components-notices");return React.createElement("div",{className:c},o.map((function(e){return React.createElement(b.a,f()({key:"store-notice-"+e.id},e,{className:m()("wc-block-components-notices__notice",h(e)),onRemove:function(){e.isDismissible&&r(e.id)}}),e.content)})))};function g(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function y(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?g(Object(n),!0).forEach((function(t){o()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):g(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var O=Object(a.createContext)({notices:[],createNotice:function(e,t,n){},removeNotice:function(e,t){},setIsSuppressed:function(e){},context:"wc/core"}),w=function(){return Object(a.useContext)(O)},j=function(e){var t=e.children,n=e.className,r=void 0===n?"":n,o=e.createNoticeContainer,c=void 0===o||o,p=e.context,f=void 0===p?"wc/core":p,d=Object(u.useDispatch)("core/notices"),m=d.createNotice,b=d.removeNotice,h=Object(a.useState)(!1),g=i()(h,2),w=g[0],j=g[1],k=Object(s.a)().dispatchStoreEvent,E=Object(l.a)().isEditor,x=Object(a.useCallback)((function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};m(e,t,y(y({},n),{},{context:n.context||f})),k("store-notice-create",{status:e,content:t,options:n})}),[m,k,f]),_=Object(a.useCallback)((function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:f;b(e,t)}),[b,f]),S={notices:Object(u.useSelect)((function(e){return{notices:e("core/notices").getNotices(f)}}),[f]).notices,createNotice:x,removeNotice:_,context:f,setIsSuppressed:j},P=w?null:React.createElement(v,{className:r,notices:S.notices,removeNotice:S.removeNotice,isEditor:E});return React.createElement(O.Provider,{value:S},c&&P,t)}},,,,function(e,t,n){"use strict";n.d(t,"a",(function(){return d}));var r=n(14),o=n.n(r),c=n(4),i=n.n(c),a=n(0),u=n(44);function s(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function l(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?s(Object(n),!0).forEach((function(t){i()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):s(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var p=[".wp-block-woocommerce-cart"],f=function(e){var t=e.Block,n=e.containers,r=e.getProps,c=void 0===r?function(){return{}}:r,i=e.getErrorBoundaryProps,s=void 0===i?function(){return{}}:i;0!==n.length&&Array.prototype.forEach.call(n,(function(e,n){var r=c(e,n),i=s(e,n),p=l(l({},e.dataset),r.attributes||{});e.classList.remove("is-loading"),Object(a.render)(React.createElement(u.a,i,React.createElement(a.Suspense,{fallback:React.createElement("div",{className:"wc-block-placeholder"})},React.createElement(t,o()({},r,{attributes:p})))),e)}))},d=function(e){var t,n,r,o,c,i,a,u=document.body.querySelectorAll(p.join(","));t=l(l({},e),{},{wrappers:u}),n=t.Block,r=t.getProps,o=t.getErrorBoundaryProps,c=t.selector,i=t.wrappers,a=document.body.querySelectorAll(c),i.length>0&&Array.prototype.filter.call(a,(function(e){return!function(e,t){return Array.prototype.some.call(t,(function(t){return t.contains(e)&&!t.isSameNode(e)}))}(e,i)})),f({Block:n,containers:a,getProps:r,getErrorBoundaryProps:o}),Array.prototype.forEach.call(u,(function(t){t.addEventListener("wc-blocks_render_blocks_frontend",(function(){var n,r,o,c,i,a;r=(n=l(l({},e),{},{wrapper:t})).Block,o=n.getProps,c=n.getErrorBoundaryProps,i=n.selector,a=n.wrapper.querySelectorAll(i),f({Block:r,containers:a,getProps:o,getErrorBoundaryProps:c})}))}))}},,,,,function(e,t){},function(e,t){e.exports=window.wp.wordcount},,,function(e,t,n){"use strict";var r=n(0),o=n(34),c=Object(r.createElement)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(r.createElement)(o.Path,{d:"M13 11.8l6.1-6.3-1-1-6.1 6.2-6.1-6.2-1 1 6.1 6.3-6.5 6.7 1 1 6.5-6.6 6.5 6.6 1-1z"}));t.a=c},,,,,,,,,,,,,function(e,t,n){var r=n(157),o=n(130),c=o.setStyleProp,i=r.html,a=r.svg,u=r.isCustomAttribute,s=Object.prototype.hasOwnProperty;e.exports=function(e){var t,n,r,l;e=e||{};var p={};for(t in e)r=e[t],u(t)?p[t]=r:(n=t.toLowerCase(),s.call(i,n)?p[(l=i[n]).propertyName]=!!(l.hasBooleanValue||l.hasOverloadedBooleanValue&&!r)||r:s.call(a,t)?p[(l=a[t]).propertyName]=r:o.PRESERVE_CUSTOM_ATTRIBUTES&&(p[t]=r));return c(e.style,p),p}},function(e,t,n){var r=n(3),o=n(161).default,c={reactCompat:!0},i=r.version.split(".")[0]>=16;e.exports={PRESERVE_CUSTOM_ATTRIBUTES:i,invertObject:function(e,t){if(!e||"object"!=typeof e)throw new TypeError("First argument must be an object");var n,r,o="function"==typeof t,c={},i={};for(n in e)r=e[n],o&&(c=t(n,r))&&2===c.length?i[c[0]]=c[1]:"string"==typeof r&&(i[r]=n);return i},isCustomComponent:function(e,t){if(-1===e.indexOf("-"))return t&&"string"==typeof t.is;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}},setStyleProp:function(e,t){null!=e&&(t.style=o(e,c))}}},function(e,t,n){for(var r,o=n(167).CASE_SENSITIVE_TAG_NAMES,c={},i=0,a=o.length;i<a;i++)r=o[i],c[r.toLowerCase()]=r;function u(e){for(var t,n={},r=0,o=e.length;r<o;r++)n[(t=e[r]).name]=t.value;return n}function s(e){return function(e){return c[e]}(e=e.toLowerCase())||e}e.exports={formatAttributes:u,formatDOM:function e(t,n,r){n=n||null;for(var o,c,i,a=[],l=0,p=t.length;l<p;l++){switch(o=t[l],i={next:null,prev:a[l-1]||null,parent:n},(c=a[l-1])&&(c.next=i),"#"!==o.nodeName[0]&&(i.name=s(o.nodeName),i.attribs={},o.attributes&&o.attributes.length&&(i.attribs=u(o.attributes))),o.nodeType){case 1:"script"===i.name||"style"===i.name?i.type=i.name:i.type="tag",i.children=e(o.childNodes,i);break;case 3:i.type="text",i.data=o.nodeValue;break;case 8:i.type="comment",i.data=o.nodeValue}a.push(i)}return r&&(a.unshift({name:r.substring(0,r.indexOf(" ")).toLowerCase(),data:r,type:"directive",next:a[0]?a[0]:null,prev:null,parent:n}),a[1]&&(a[1].prev=a[0])),a},isIE:function(e){return e?document.documentMode===e:/(MSIE |Trident\/|Edge\/)/.test(navigator.userAgent)}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return u})),n.d(t,"b",(function(){return s}));var r=n(39),o=n.n(r),c=n(27),i=n.n(c),a=n(1),u=function(){var e=o()(i.a.mark((function e(t){var n;return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("function"!=typeof t.json){e.next=11;break}return e.prev=1,e.next=4,t.json();case 4:return n=e.sent,e.abrupt("return",{message:n.message,type:n.type||"api"});case 8:return e.prev=8,e.t0=e.catch(1),e.abrupt("return",{message:e.t0.message,type:"general"});case 11:return e.abrupt("return",{message:t.message,type:t.type||"general"});case 12:case"end":return e.stop()}}),e,null,[[1,8]])})));return function(_x){return e.apply(this,arguments)}}(),s=function(e){if(e.data&&"rest_invalid_param"===e.code){var t=Object.values(e.data.params);if(t[0])return t[0]}return(null==e?void 0:e.message)||Object(a.__)("Something went wrong. Please contact us to get assistance.",'woocommerce')}},,,,function(e,t,n){var r=n(156),o=n(129),c=n(165),i={decodeEntities:!0,lowerCaseAttributeNames:!1};function a(e,t){if("string"!=typeof e)throw new TypeError("First argument must be a string");return""===e?[]:r(c(e,(t=t||{}).htmlparser2||i),t)}a.domToReact=r,a.htmlToDOM=c,a.attributesToProps=o,e.exports=a,e.exports.default=a},,,,,,,,,,,,,,,,function(e,t,n){"use strict";var r=n(4),o=n.n(r),c=n(23),i=n.n(c),a=n(0),u=["srcElement","size"];function s(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}t.a=function(e){var t=e.srcElement,n=e.size,r=void 0===n?24:n,c=i()(e,u);return Object(a.isValidElement)(t)?Object(a.cloneElement)(t,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?s(Object(n),!0).forEach((function(t){o()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):s(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({width:r,height:r},c)):null}},function(e,t,n){"use strict";var r=n(0),o=n(7),c=n(6),i=n.n(c),a=n(1),u=n(33),s=n(116),l=n(76);t.a=function(e){var t=e.className,n=e.status,c=void 0===n?"info":n,p=e.children,f=e.spokenMessage,d=void 0===f?p:f,m=e.onRemove,b=void 0===m?o.noop:m,h=e.isDismissible,v=void 0===h||h,g=e.actions,y=void 0===g?[]:g,O=e.politeness,w=void 0===O?function(e){switch(e){case"success":case"warning":case"info":return"polite";case"error":default:return"assertive"}}(c):O,j=e.__unstableHTML;!function(e,t){var n="string"==typeof e?e:Object(r.renderToString)(e);Object(r.useEffect)((function(){n&&Object(u.speak)(n,t)}),[n,t])}(d,w);var k=i()(t,"components-notice","is-"+c,{"is-dismissible":v});return j&&(p=Object(r.createElement)(r.RawHTML,null,p)),Object(r.createElement)("div",{className:k},Object(r.createElement)("div",{className:"components-notice__content"},p,y.map((function(e,t){var n=e.className,o=e.label,c=e.isPrimary,a=e.noDefaultClasses,u=void 0!==a&&a,s=e.onClick,p=e.url;return Object(r.createElement)(l.a,{key:t,href:p,isPrimary:c,isSecondary:!u&&!p,isLink:!u&&!!p,onClick:p?void 0:s,className:i()("components-notice__action",n)},o)}))),v&&Object(r.createElement)(l.a,{className:"components-notice__dismiss",icon:s.a,label:Object(a.__)("Dismiss this notice"),onClick:b,showTooltip:!1}))}},,,function(e,t,n){var r=n(3),o=n(129),c=n(130),i=c.setStyleProp;function a(e){return c.PRESERVE_CUSTOM_ATTRIBUTES&&"tag"===e.type&&c.isCustomComponent(e.name,e.attribs)}e.exports=function e(t,n){for(var c,u,s,l,p=(n=n||{}).library||r,f=p.cloneElement,d=p.createElement,m=p.isValidElement,b=[],h="function"==typeof n.replace,v=n.trim,g=0,y=t.length;g<y;g++)if(c=t[g],h&&m(u=n.replace(c)))y>1&&(u=f(u,{key:u.key||g})),b.push(u);else if("text"!==c.type){switch(s=c.attribs,a(c)?i(s.style,s):s&&(s=o(s)),l=null,c.type){case"script":case"style":c.children[0]&&(s.dangerouslySetInnerHTML={__html:c.children[0].data});break;case"tag":"textarea"===c.name&&c.children[0]?s.defaultValue=c.children[0].data:c.children&&c.children.length&&(l=e(c.children,n));break;default:continue}y>1&&(s.key=g),b.push(d(c.name,s,l))}else v?c.data.trim()&&b.push(c.data):b.push(c.data);return 1===b.length?b[0]:b}},function(e,t,n){var r=n(158),o=n(159),c=n(160),i=c.MUST_USE_PROPERTY,a=c.HAS_BOOLEAN_VALUE,u=c.HAS_NUMERIC_VALUE,s=c.HAS_POSITIVE_NUMERIC_VALUE,l=c.HAS_OVERLOADED_BOOLEAN_VALUE;function p(e,t){return(e&t)===t}function f(e,t,n){var r,o,c,f=e.Properties,d=e.DOMAttributeNames;for(o in f)r=d[o]||(n?o:o.toLowerCase()),c=f[o],t[r]={attributeName:r,propertyName:o,mustUseProperty:p(c,i),hasBooleanValue:p(c,a),hasNumericValue:p(c,u),hasPositiveNumericValue:p(c,s),hasOverloadedBooleanValue:p(c,l)}}var d={};f(r,d);var m={};f(o,m,!0);var b={};f(r,b),f(o,b,!0),e.exports={html:d,svg:m,properties:b,isCustomAttribute:RegExp.prototype.test.bind(new RegExp("^(data|aria)-[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"))}},function(e,t){e.exports={Properties:{autoFocus:4,accept:0,acceptCharset:0,accessKey:0,action:0,allowFullScreen:4,allowTransparency:0,alt:0,as:0,async:4,autoComplete:0,autoPlay:4,capture:4,cellPadding:0,cellSpacing:0,charSet:0,challenge:0,checked:5,cite:0,classID:0,className:0,cols:24,colSpan:0,content:0,contentEditable:0,contextMenu:0,controls:4,controlsList:0,coords:0,crossOrigin:0,data:0,dateTime:0,default:4,defer:4,dir:0,disabled:4,download:32,draggable:0,encType:0,form:0,formAction:0,formEncType:0,formMethod:0,formNoValidate:4,formTarget:0,frameBorder:0,headers:0,height:0,hidden:4,high:0,href:0,hrefLang:0,htmlFor:0,httpEquiv:0,icon:0,id:0,inputMode:0,integrity:0,is:0,keyParams:0,keyType:0,kind:0,label:0,lang:0,list:0,loop:4,low:0,manifest:0,marginHeight:0,marginWidth:0,max:0,maxLength:0,media:0,mediaGroup:0,method:0,min:0,minLength:0,multiple:5,muted:5,name:0,nonce:0,noValidate:4,open:4,optimum:0,pattern:0,placeholder:0,playsInline:4,poster:0,preload:0,profile:0,radioGroup:0,readOnly:4,referrerPolicy:0,rel:0,required:4,reversed:4,role:0,rows:24,rowSpan:8,sandbox:0,scope:0,scoped:4,scrolling:0,seamless:4,selected:5,shape:0,size:24,sizes:0,span:24,spellCheck:0,src:0,srcDoc:0,srcLang:0,srcSet:0,start:8,step:0,style:0,summary:0,tabIndex:0,target:0,title:0,type:0,useMap:0,value:0,width:0,wmode:0,wrap:0,about:0,datatype:0,inlist:0,prefix:0,property:0,resource:0,typeof:0,vocab:0,autoCapitalize:0,autoCorrect:0,autoSave:0,color:0,itemProp:0,itemScope:4,itemType:0,itemID:0,itemRef:0,results:0,security:0,unselectable:0},DOMAttributeNames:{acceptCharset:"accept-charset",className:"class",htmlFor:"for",httpEquiv:"http-equiv"}}},function(e,t){e.exports={Properties:{accentHeight:0,accumulate:0,additive:0,alignmentBaseline:0,allowReorder:0,alphabetic:0,amplitude:0,arabicForm:0,ascent:0,attributeName:0,attributeType:0,autoReverse:0,azimuth:0,baseFrequency:0,baseProfile:0,baselineShift:0,bbox:0,begin:0,bias:0,by:0,calcMode:0,capHeight:0,clip:0,clipPath:0,clipRule:0,clipPathUnits:0,colorInterpolation:0,colorInterpolationFilters:0,colorProfile:0,colorRendering:0,contentScriptType:0,contentStyleType:0,cursor:0,cx:0,cy:0,d:0,decelerate:0,descent:0,diffuseConstant:0,direction:0,display:0,divisor:0,dominantBaseline:0,dur:0,dx:0,dy:0,edgeMode:0,elevation:0,enableBackground:0,end:0,exponent:0,externalResourcesRequired:0,fill:0,fillOpacity:0,fillRule:0,filter:0,filterRes:0,filterUnits:0,floodColor:0,floodOpacity:0,focusable:0,fontFamily:0,fontSize:0,fontSizeAdjust:0,fontStretch:0,fontStyle:0,fontVariant:0,fontWeight:0,format:0,from:0,fx:0,fy:0,g1:0,g2:0,glyphName:0,glyphOrientationHorizontal:0,glyphOrientationVertical:0,glyphRef:0,gradientTransform:0,gradientUnits:0,hanging:0,horizAdvX:0,horizOriginX:0,ideographic:0,imageRendering:0,in:0,in2:0,intercept:0,k:0,k1:0,k2:0,k3:0,k4:0,kernelMatrix:0,kernelUnitLength:0,kerning:0,keyPoints:0,keySplines:0,keyTimes:0,lengthAdjust:0,letterSpacing:0,lightingColor:0,limitingConeAngle:0,local:0,markerEnd:0,markerMid:0,markerStart:0,markerHeight:0,markerUnits:0,markerWidth:0,mask:0,maskContentUnits:0,maskUnits:0,mathematical:0,mode:0,numOctaves:0,offset:0,opacity:0,operator:0,order:0,orient:0,orientation:0,origin:0,overflow:0,overlinePosition:0,overlineThickness:0,paintOrder:0,panose1:0,pathLength:0,patternContentUnits:0,patternTransform:0,patternUnits:0,pointerEvents:0,points:0,pointsAtX:0,pointsAtY:0,pointsAtZ:0,preserveAlpha:0,preserveAspectRatio:0,primitiveUnits:0,r:0,radius:0,refX:0,refY:0,renderingIntent:0,repeatCount:0,repeatDur:0,requiredExtensions:0,requiredFeatures:0,restart:0,result:0,rotate:0,rx:0,ry:0,scale:0,seed:0,shapeRendering:0,slope:0,spacing:0,specularConstant:0,specularExponent:0,speed:0,spreadMethod:0,startOffset:0,stdDeviation:0,stemh:0,stemv:0,stitchTiles:0,stopColor:0,stopOpacity:0,strikethroughPosition:0,strikethroughThickness:0,string:0,stroke:0,strokeDasharray:0,strokeDashoffset:0,strokeLinecap:0,strokeLinejoin:0,strokeMiterlimit:0,strokeOpacity:0,strokeWidth:0,surfaceScale:0,systemLanguage:0,tableValues:0,targetX:0,targetY:0,textAnchor:0,textDecoration:0,textRendering:0,textLength:0,to:0,transform:0,u1:0,u2:0,underlinePosition:0,underlineThickness:0,unicode:0,unicodeBidi:0,unicodeRange:0,unitsPerEm:0,vAlphabetic:0,vHanging:0,vIdeographic:0,vMathematical:0,values:0,vectorEffect:0,version:0,vertAdvY:0,vertOriginX:0,vertOriginY:0,viewBox:0,viewTarget:0,visibility:0,widths:0,wordSpacing:0,writingMode:0,x:0,xHeight:0,x1:0,x2:0,xChannelSelector:0,xlinkActuate:0,xlinkArcrole:0,xlinkHref:0,xlinkRole:0,xlinkShow:0,xlinkTitle:0,xlinkType:0,xmlBase:0,xmlns:0,xmlnsXlink:0,xmlLang:0,xmlSpace:0,y:0,y1:0,y2:0,yChannelSelector:0,z:0,zoomAndPan:0},DOMAttributeNames:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDasharray:"stroke-dasharray",strokeDashoffset:"stroke-dashoffset",strokeLinecap:"stroke-linecap",strokeLinejoin:"stroke-linejoin",strokeMiterlimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",xlinkActuate:"xlink:actuate",xlinkArcrole:"xlink:arcrole",xlinkHref:"xlink:href",xlinkRole:"xlink:role",xlinkShow:"xlink:show",xlinkTitle:"xlink:title",xlinkType:"xlink:type",xmlBase:"xml:base",xmlnsXlink:"xmlns:xlink",xmlLang:"xml:lang",xmlSpace:"xml:space"}}},function(e,t){e.exports={MUST_USE_PROPERTY:1,HAS_BOOLEAN_VALUE:4,HAS_NUMERIC_VALUE:8,HAS_POSITIVE_NUMERIC_VALUE:24,HAS_OVERLOADED_BOOLEAN_VALUE:32}},function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};t.__esModule=!0;var o=r(n(162)),c=n(164);t.default=function(e,t){var n={};return e&&"string"==typeof e?(o.default(e,(function(e,r){e&&r&&(n[c.camelCase(e,t)]=r)})),n):n}},function(e,t,n){var r=n(163);e.exports=function(e,t){var n,o=null;if(!e||"string"!=typeof e)return o;for(var c,i,a=r(e),u="function"==typeof t,s=0,l=a.length;s<l;s++)c=(n=a[s]).property,i=n.value,u?t(c,i,n):i&&(o||(o={}),o[c]=i);return o}},function(e,t){var n=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,r=/\n/g,o=/^\s*/,c=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,i=/^:\s*/,a=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,u=/^[;\s]*/,s=/^\s+|\s+$/g;function l(e){return e?e.replace(s,""):""}e.exports=function(e,t){if("string"!=typeof e)throw new TypeError("First argument must be a string");if(!e)return[];t=t||{};var s=1,p=1;function f(e){var t=e.match(r);t&&(s+=t.length);var n=e.lastIndexOf("\n");p=~n?e.length-n:p+e.length}function d(){var e={line:s,column:p};return function(t){return t.position=new m(e),g(),t}}function m(e){this.start=e,this.end={line:s,column:p},this.source=t.source}m.prototype.content=e;var b=[];function h(n){var r=new Error(t.source+":"+s+":"+p+": "+n);if(r.reason=n,r.filename=t.source,r.line=s,r.column=p,r.source=e,!t.silent)throw r;b.push(r)}function v(t){var n=t.exec(e);if(n){var r=n[0];return f(r),e=e.slice(r.length),n}}function g(){v(o)}function y(e){var t;for(e=e||[];t=O();)!1!==t&&e.push(t);return e}function O(){var t=d();if("/"==e.charAt(0)&&"*"==e.charAt(1)){for(var n=2;""!=e.charAt(n)&&("*"!=e.charAt(n)||"/"!=e.charAt(n+1));)++n;if(n+=2,""===e.charAt(n-1))return h("End of comment missing");var r=e.slice(2,n-2);return p+=2,f(r),e=e.slice(n),p+=2,t({type:"comment",comment:r})}}function w(){var e=d(),t=v(c);if(t){if(O(),!v(i))return h("property missing ':'");var r=v(a),o=e({type:"declaration",property:l(t[0].replace(n,"")),value:r?l(r[0].replace(n,"")):""});return v(u),o}}return g(),function(){var e,t=[];for(y(t);e=w();)!1!==e&&(t.push(e),y(t));return t}()}},function(e,t,n){"use strict";t.__esModule=!0,t.camelCase=void 0;var r=/^--[a-zA-Z0-9-]+$/,o=/-([a-z])/g,c=/^[^-]+$/,i=/^-(webkit|moz|ms|o|khtml)-/,a=function(e,t){return t.toUpperCase()},u=function(e,t){return t+"-"};t.camelCase=function(e,t){return void 0===t&&(t={}),function(e){return!e||c.test(e)||r.test(e)}(e)?e:(e=e.toLowerCase(),t.reactCompat||(e=e.replace(i,u)),e.replace(o,a))}},function(e,t,n){var r=n(166),o=n(131),c=o.formatDOM,i=o.isIE(9),a=/<(![a-zA-Z\s]+)>/;e.exports=function(e){if("string"!=typeof e)throw new TypeError("First argument must be a string");if(!e)return[];var t,n=e.match(a);return n&&n[1]&&(t=n[1],i&&(e=e.replace(n[0],""))),c(r(e),null,t)}},function(e,t,n){var r=n(131),o=/<([a-zA-Z]+[0-9]?)/,c=/<head.*>/i,i=/<body.*>/i,a=/<(area|base|br|col|embed|hr|img|input|keygen|link|menuitem|meta|param|source|track|wbr)(.*?)\/?>/gi,u=r.isIE(9),s=u||r.isIE(),l=function(){throw new Error("This browser does not support `document.implementation.createHTMLDocument`")},p=function(){throw new Error("This browser does not support `DOMParser.prototype.parseFromString`")};if("function"==typeof window.DOMParser){var f=new window.DOMParser,d=u?"text/xml":"text/html";l=p=function(e,t){return t&&(e="<"+t+">"+e+"</"+t+">"),u&&(e=e.replace(a,"<$1$2$3/>")),f.parseFromString(e,d)}}if(document.implementation){var m=document.implementation.createHTMLDocument(s?"html-dom-parser":void 0);l=function(e,t){if(t)return m.documentElement.getElementsByTagName(t)[0].innerHTML=e,m;try{return m.documentElement.innerHTML=e,m}catch(t){if(p)return p(e)}}}var b,h=document.createElement("template");h.content&&(b=function(e){return h.innerHTML=e,h.content.childNodes}),e.exports=function(e){var t,n,r,a,u=e.match(o);switch(u&&u[1]&&(t=u[1].toLowerCase()),t){case"html":return n=p(e),c.test(e)||(r=n.getElementsByTagName("head")[0])&&r.parentNode.removeChild(r),i.test(e)||(r=n.getElementsByTagName("body")[0])&&r.parentNode.removeChild(r),n.getElementsByTagName("html");case"head":case"body":return a=l(e).getElementsByTagName(t),i.test(e)&&c.test(e)?a[0].parentNode.childNodes:a;default:return b?b(e):l(e,"body").getElementsByTagName("body")[0].childNodes}}},function(e,t){e.exports={CASE_SENSITIVE_TAG_NAMES:["animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussainBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","linearGradient","radialGradient","textPath"]}},,,,,,,,,,,,,,,,,,,,,function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));var r=function(e,t){var n=[];return Object.keys(e).forEach((function(r){if(void 0!==t[r])switch(e[r].type){case"boolean":n[r]="false"!==t[r]&&!1!==t[r];break;case"number":n[r]=parseInt(t[r],10);break;case"array":case"object":n[r]=JSON.parse(t[r]);break;default:n[r]=t[r]}else n[r]=e[r].default})),n}},,,,,,,,,,,,function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(38),o=n(0),c=n(83);n.p=c.k,Object(r.registerBlockComponent)({blockName:"woocommerce/product-price",component:Object(o.lazy)((function(){return Promise.all([n.e(1),n.e(12)]).then(n.bind(null,387))}))}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-image",component:Object(o.lazy)((function(){return n.e(11).then(n.bind(null,416))}))}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-title",component:Object(o.lazy)((function(){return n.e(19).then(n.bind(null,409))}))}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-rating",component:Object(o.lazy)((function(){return n.e(13).then(n.bind(null,388))}))}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-button",component:Object(o.lazy)((function(){return n.e(9).then(n.bind(null,389))}))}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-summary",component:Object(o.lazy)((function(){return n.e(17).then(n.bind(null,390))}))}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-sale-badge",component:Object(o.lazy)((function(){return n.e(14).then(n.bind(null,354))}))}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-sku",component:Object(o.lazy)((function(){return n.e(15).then(n.bind(null,391))}))}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-category-list",component:Object(o.lazy)((function(){return n.e(10).then(n.bind(null,392))}))}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-tag-list",component:Object(o.lazy)((function(){return n.e(18).then(n.bind(null,393))}))}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-stock-indicator",component:Object(o.lazy)((function(){return n.e(16).then(n.bind(null,394))}))}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-add-to-cart",component:Object(o.lazy)((function(){return Promise.all([n.e(0),n.e(50),n.e(8)]).then(n.bind(null,403))}))});var i=function(e){return Object(r.getRegisteredBlockComponents)(e)}},,,,,,,,,,,,,,,,,,,,,,,,function(e,t,n){"use strict";n.d(t,"a",(function(){return h}));var r=n(4),o=n.n(r),c=n(23),i=n.n(c),a=n(107),u=n(0),s=n(136),l=n.n(s),p=n(26),f=["blockName"];function d(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function m(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?d(Object(n),!0).forEach((function(t){o()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):d(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var b=function(e,t){return e&&t[e]?t[e]:null},h=function(e){var t=e.Block,n=e.selector,r=e.blockName,o=e.getProps,c=void 0===o?function(){return{}}:o,s=e.blockMap,d=e.blockWrapper;Object(a.a)({Block:t,selector:n,getProps:function(e,t){var n=function e(t){var n=t.block,r=t.blockMap,o=t.blockWrapper,c=t.children,a=t.depth,s=void 0===a?1:a;return c&&0!==c.length?Array.from(c).map((function(t,c){var a=m({key:"".concat(n,"_").concat(s,"_").concat(c)},t instanceof HTMLElement?t.dataset:{}),d=a.blockName,h=void 0===d?"":d,v=i()(a,f),g=b(h,r);if(!g){var y=l()((null==t?void 0:t.outerHTML)||(null==t?void 0:t.textContent)||"");if("string"==typeof y&&y)return y;if(!Object(u.isValidElement)(y))return null;var O=t.childNodes.length?e({block:n,blockMap:r,children:t.childNodes,depth:s+1,blockWrapper:o}):void 0;return O?Object(u.cloneElement)(y,v,O):Object(u.cloneElement)(y,v)}var w=o||u.Fragment;return React.createElement(u.Suspense,{key:"".concat(n,"_").concat(s,"_").concat(c,"_suspense"),fallback:React.createElement("div",{className:"wc-block-placeholder"})},React.createElement(w,null,React.createElement(g,v,e({block:n,blockMap:r,children:t.children,depth:s+1,blockWrapper:o}),function(e,t,n){if(!Object(p.hasInnerBlocks)(e))return null;var r=n?Array.from(n).map((function(e){return e instanceof HTMLElement&&(null==e?void 0:e.dataset.blockName)||null})).filter(Boolean):[];return Object(p.getRegisteredBlocks)(e).filter((function(e){var t=e.blockName;return!0===e.force&&!r.includes(t)})).map((function(e,n){var r=e.blockName,o=e.component||b(r,t);return o?React.createElement(o,{key:"".concat(r,"_forced_").concat(n)}):null}))}(h,r,t.children))))})):null}({block:r,blockMap:s,children:e.children||[],blockWrapper:d});return m(m({},c(e,t)),{},{children:n})}})}},,,,,,,,,,,,,,,,,,,,,,,,,function(e,t){e.exports=window.wc.wcBlocksSharedHocs},,,,,,,,,,,,,,,,,,,,,,,,,function(e,t){e.exports=window.wp.blockEditor},function(e,t){e.exports=window.wp.blocks},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(e,t,n){e.exports=n(316)},,,,,,function(e,t,n){"use strict";n.r(t);var r=n(188),o=n(224),c=n(200),i=n(107),a=n(0),u=n(14),s=n.n(u),l=n(39),p=n.n(l),f=n(40),d=n.n(f),m=n(41),b=n.n(m),h=n(29),v=n.n(h),g=n(42),y=n.n(g),O=n(43),w=n.n(O),j=n(30),k=n.n(j),E=n(4),x=n.n(E),_=n(27),S=n.n(_),P=n(24),R=(n(72),n(61)),C=n.n(R);n(7),n(2),n(83);var T=function(e){return C()({path:"/wc/store/products/".concat(e)})},A=n(132);var M,N=Object(P.createHigherOrderComponent)((function(e){return function(t){y()(c,t);var n,r,o=(n=c,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=k()(n);if(r){var o=k()(this).constructor;e=Reflect.construct(t,arguments,o)}else e=t.apply(this,arguments);return w()(this,e)});function c(){var e;d()(this,c);for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return e=o.call.apply(o,[this].concat(n)),x()(v()(e),"state",{error:null,loading:!1,product:"preview"===e.props.attributes.productId?e.props.attributes.previewProduct:null}),x()(v()(e),"loadProduct",(function(){var t=e.props.attributes.productId;"preview"!==t&&(t?(e.setState({loading:!0}),T(t).then((function(t){e.setState({product:t,loading:!1,error:null})})).catch(function(){var t=p()(S.a.mark((function t(n){var r;return S.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,Object(A.a)(n);case 2:r=t.sent,e.setState({product:null,loading:!1,error:r});case 4:case"end":return t.stop()}}),t)})));return function(_x){return t.apply(this,arguments)}}())):e.setState({product:null,loading:!1,error:null}))})),e}return b()(c,[{key:"componentDidMount",value:function(){this.loadProduct()}},{key:"componentDidUpdate",value:function(e){e.attributes.productId!==this.props.attributes.productId&&this.loadProduct()}},{key:"render",value:function(){var t=this.state,n=t.error,r=t.loading,o=t.product;return React.createElement(e,s()({},this.props,{error:n,getProduct:this.loadProduct,isLoading:r,product:o}))}}]),c}(a.Component)}),"withProduct"),D=n(101),F=n(103),I=n(52),B=n(46),L=n.n(B),U=n(1),H=n(152),z=n(34),V=(z.SVG,"woocommerce/single-product"),W=(Object(U.__)("Single Product",'woocommerce'),H.a,Object(U.__)("Display a single product.",'woocommerce'),["core/columns","core/column"].concat(L()(Object.keys(Object(c.a)(V)))),N((function(e){var t=e.isLoading,n=e.product,r=e.children,o=Object(I.a)().dispatchStoreEvent,c="wc-block-single-product wc-block-layout",i="woocommerce/single-product/".concat((null==n?void 0:n.id)||0);return Object(a.useEffect)((function(){o("product-render",{product:n,listName:V})}),[n,o]),React.createElement(D.InnerBlockLayoutContextProvider,{parentName:V,parentClassName:c},React.createElement(D.ProductDataContextProvider,{product:n,isLoading:t},React.createElement(F.a,{context:i},React.createElement("div",{className:c},r))))}))),q={isPreview:{type:"boolean",default:!1,save:!1},productId:{type:"number"}};Object(o.a)({Block:W,blockName:V,selector:".wp-block-woocommerce-single-product",getProps:function(e){return{attributes:Object(r.a)(q,e.dataset)}},blockMap:Object(c.a)(V)}),M=Object(c.a)(""),Object.keys(M).forEach((function(e){var t=".wp-block-"+e.replace("/","-");Object(i.a)({Block:M[e],selector:t,getProps:function(e){return e.dataset}})}))}]);woocommerce-blocks/build/active-filters-frontend.asset.php000064400000000431151335517640020032 0ustar00<?php return array('dependencies' => array('lodash', 'react', 'wc-blocks-data-store', 'wc-price-format', 'wc-settings', 'wp-data', 'wp-element', 'wp-html-entities', 'wp-i18n', 'wp-is-shallow-equal', 'wp-polyfill', 'wp-primitives'), 'version' => 'b80f837f2fae749d09b712be28033e08');woocommerce-blocks/build/cart.asset.php000064400000001027151335517640014227 0ustar00<?php return array('dependencies' => array('lodash', 'react', 'wc-blocks-checkout', 'wc-blocks-data-store', 'wc-blocks-registry', 'wc-price-format', 'wc-settings', 'wp-a11y', 'wp-api-fetch', 'wp-autop', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-data', 'wp-deprecated', 'wp-dom', 'wp-element', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-is-shallow-equal', 'wp-keycodes', 'wp-plugins', 'wp-polyfill', 'wp-primitives', 'wp-url', 'wp-warning', 'wp-wordcount'), 'version' => '9216b4001ecdb07003753d8a8ce6549d');woocommerce-blocks/build/mini-cart.js000064400000013524151335517640013675 0ustar00this.wc=this.wc||{},this.wc.blocks=this.wc.blocks||{},this.wc.blocks["mini-cart"]=function(t){function e(e){for(var r,i,u=e[0],l=e[1],s=e[2],p=0,f=[];p<u.length;p++)i=u[p],Object.prototype.hasOwnProperty.call(o,i)&&o[i]&&f.push(o[i][0]),o[i]=0;for(r in l)Object.prototype.hasOwnProperty.call(l,r)&&(t[r]=l[r]);for(a&&a(e);f.length;)f.shift()();return c.push.apply(c,s||[]),n()}function n(){for(var t,e=0;e<c.length;e++){for(var n=c[e],r=!0,u=1;u<n.length;u++){var l=n[u];0!==o[l]&&(r=!1)}r&&(c.splice(e--,1),t=i(i.s=n[0]))}return t}var r={},o={26:0},c=[];function i(e){if(r[e])return r[e].exports;var n=r[e]={i:e,l:!1,exports:{}};return t[e].call(n.exports,n,n.exports,i),n.l=!0,n.exports}i.m=t,i.c=r,i.d=function(t,e,n){i.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},i.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},i.t=function(t,e){if(1&e&&(t=i(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(i.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)i.d(n,r,function(e){return t[e]}.bind(null,r));return n},i.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return i.d(e,"a",e),e},i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},i.p="";var u=window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[],l=u.push.bind(u);u.push=e,u=u.slice();for(var s=0;s<u.length;s++)e(u[s]);var a=l;return c.push([848,0]),n()}({0:function(t,e){t.exports=window.wp.element},1:function(t,e){t.exports=window.wp.i18n},12:function(t,e){t.exports=window.wp.blockEditor},159:function(t,e,n){"use strict";n.d(e,"c",(function(){return c})),n.d(e,"d",(function(){return i})),n.d(e,"a",(function(){return u})),n.d(e,"b",(function(){return l}));var r=n(26),o=n(37),c=function(t,e){if(o.n>2)return Object(r.registerBlockType)(t,e)},i=function(t,e){if(o.n>1)return Object(r.registerBlockType)(t,e)},u=function(){return o.n>2},l=function(){return o.n>1}},26:function(t,e){t.exports=window.wp.blocks},28:function(t,e){t.exports=window.wp.primitives},3:function(t,e){t.exports=window.wc.wcSettings},361:function(t,e,n){"use strict";var r=n(0),o=n(28),c=Object(r.createElement)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(r.createElement)("path",{fill:"none",d:"M0 0h24v24H0V0z"}),Object(r.createElement)("path",{d:"M15.55 13c.75 0 1.41-.41 1.75-1.03l3.58-6.49c.37-.66-.11-1.48-.87-1.48H5.21l-.94-2H1v2h2l3.6 7.59-1.35 2.44C4.52 15.37 5.48 17 7 17h12v-2H7l1.1-2h7.45zM6.16 6h12.15l-2.76 5H8.53L6.16 6zM7 18c-1.1 0-1.99.9-1.99 2S5.9 22 7 22s2-.9 2-2-.9-2-2-2zm10 0c-1.1 0-1.99.9-1.99 2s.89 2 1.99 2 2-.9 2-2-.9-2-2-2z"}));e.a=c},37:function(t,e,n){"use strict";n.d(e,"o",(function(){return c})),n.d(e,"m",(function(){return i})),n.d(e,"l",(function(){return u})),n.d(e,"n",(function(){return l})),n.d(e,"j",(function(){return s})),n.d(e,"e",(function(){return a})),n.d(e,"f",(function(){return p})),n.d(e,"g",(function(){return f})),n.d(e,"k",(function(){return d})),n.d(e,"c",(function(){return b})),n.d(e,"d",(function(){return w})),n.d(e,"h",(function(){return O})),n.d(e,"a",(function(){return g})),n.d(e,"i",(function(){return m})),n.d(e,"b",(function(){return h}));var r,o=n(3),c=Object(o.getSetting)("wcBlocksConfig",{buildPhase:1,pluginUrl:"",productCount:0,defaultAvatar:"",restApiRoutes:{},wordCountType:"words"}),i=c.pluginUrl+"images/",u=c.pluginUrl+"build/",l=c.buildPhase,s=null===(r=o.STORE_PAGES.shop)||void 0===r?void 0:r.permalink,a=o.STORE_PAGES.checkout.id,p=o.STORE_PAGES.checkout.permalink,f=o.STORE_PAGES.privacy.permalink,d=(o.STORE_PAGES.privacy.title,o.STORE_PAGES.terms.permalink),b=(o.STORE_PAGES.terms.title,o.STORE_PAGES.cart.id),w=o.STORE_PAGES.cart.permalink,O=(o.STORE_PAGES.myaccount.permalink?o.STORE_PAGES.myaccount.permalink:Object(o.getSetting)("wpLoginUrl","/wp-login.php"),Object(o.getSetting)("shippingCountries",{})),g=Object(o.getSetting)("allowedCountries",{}),m=Object(o.getSetting)("shippingStates",{}),h=Object(o.getSetting)("allowedStates",{})},66:function(t,e,n){"use strict";var r=n(5),o=n.n(r),c=n(16),i=n.n(c),u=n(0),l=["srcElement","size"];function s(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}e.a=function(t){var e=t.srcElement,n=t.size,r=void 0===n?24:n,c=i()(t,l);return Object(u.isValidElement)(e)?Object(u.cloneElement)(e,function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?s(Object(n),!0).forEach((function(e){o()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):s(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}({width:r,height:r},c)):null}},848:function(t,e,n){t.exports=n(876)},876:function(t,e,n){"use strict";n.r(e);var r=n(0),o=n(1),c=n(66),i=n(361),u=n(159),l=n(12),s={apiVersion:2,title:Object(o.__)("Mini Cart",'woocommerce'),icon:{src:Object(r.createElement)(c.a,{srcElement:i.a}),foreground:"#96588a"},category:"woocommerce",keywords:[Object(o.__)("WooCommerce",'woocommerce')],description:Object(o.__)("Display a mini cart widget.",'woocommerce'),supports:{html:!1,multiple:!1},example:{attributes:{isPreview:!0}},attributes:{isPreview:{type:"boolean",default:!1,save:!1}},edit:function(){var t=Object(l.useBlockProps)({className:"wc-block-mini-cart"});return Object(r.createElement)("div",t,Object(r.createElement)("button",{className:"wc-block-mini-cart__button"},Object(o.sprintf)(
/* translators: %d is the number of products in the cart. */
Object(o._n)("%d product","%d products",0,'woocommerce'),0)))},save:function(){return null}};Object(u.c)("woocommerce/mini-cart",s)}});woocommerce-blocks/build/wc-payment-method-cod.asset.php000064400000000260151335517640017401 0ustar00<?php return array('dependencies' => array('wc-blocks-registry', 'wc-settings', 'wp-html-entities', 'wp-i18n', 'wp-polyfill'), 'version' => 'bf7acb625587b16d8b19b6a7d971e7b3');woocommerce-blocks/build/wc-payment-method-stripe.js000064400000116001151335517640016652 0ustar00!function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=22)}([function(e,t){e.exports=window.wp.element},function(e,t){e.exports=window.wp.i18n},function(e,t){e.exports=function(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,r){var n=r(15),o=r(16),a=r(17),c=r(19);e.exports=function(e,t){return n(e)||o(e,t)||a(e,t)||c()},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=window.wc.wcSettings},function(e,t,r){!function(e,t){"use strict";function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function n(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function o(){}function a(){}t=t&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t,a.resetWarningCache=o;var c=function(e,t){return function(e){e.exports=function(){function e(e,t,r,n,o,a){if("SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"!==a){var c=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw c.name="Invariant Violation",c}}function t(){return e}e.isRequired=e;var r={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:a,resetWarningCache:o};return r.PropTypes=r,r}()}(t={exports:{}}),t.exports}(),i=function(e){return null!==e&&"object"===r(e)},s=function e(t,r){if(!i(t)||!i(r))return t===r;var n=Array.isArray(t);if(n!==Array.isArray(r))return!1;var o="[object Object]"===Object.prototype.toString.call(t);if(o!==("[object Object]"===Object.prototype.toString.call(r)))return!1;if(!o&&!n)return!1;var a=Object.keys(t),c=Object.keys(r);if(a.length!==c.length)return!1;for(var s={},u=0;u<a.length;u+=1)s[a[u]]=!0;for(var l=0;l<c.length;l+=1)s[c[l]]=!0;var p=Object.keys(s);if(p.length!==a.length)return!1;var f=t,d=r;return p.every((function(t){return e(f[t],d[t])}))},u=function(e){var r=t.useRef(e);return t.useEffect((function(){r.current=e}),[e]),r.current},l=function(e){if(null===e||i(t=e)&&"function"==typeof t.elements&&"function"==typeof t.createToken&&"function"==typeof t.createPaymentMethod&&"function"==typeof t.confirmCardPayment)return e;var t;throw new Error("Invalid prop `stripe` supplied to `Elements`. We recommend using the `loadStripe` utility from `@stripe/stripe-js`. See https://stripe.com/docs/stripe-js/react#elements-props-stripe for details.")},p=t.createContext(null);p.displayName="ElementsContext";var f=function(e){var r,o,a=e.stripe,c=e.options,f=e.children,d=t.useRef(!1),m=t.useRef(!0),y=t.useMemo((function(){return function(e){if(function(e){return i(e)&&"function"==typeof e.then}(e))return{tag:"async",stripePromise:Promise.resolve(e).then(l)};var t=l(e);return null===t?{tag:"empty"}:{tag:"sync",stripe:t}}(a)}),[a]),b=(r=t.useState((function(){return{stripe:null,elements:null}})),o=2,function(e){if(Array.isArray(e))return e}(r)||function(e,t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e)){var r=[],_n=!0,n=!1,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(_n=(a=c.next()).done)&&(r.push(a.value),!t||r.length!==t);_n=!0);}catch(e){n=!0,o=e}finally{try{_n||null==c.return||c.return()}finally{if(n)throw o}}return r}}(r,o)||function(e,t){if(e){if("string"==typeof e)return n(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?n(e,t):void 0}}(r,o)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),v=b[0],g=b[1],h=u(a),E=u(c);return null!==h&&(h!==a&&console.warn("Unsupported prop change on Elements: You cannot change the `stripe` prop after setting it."),s(c,E)||console.warn("Unsupported prop change on Elements: You cannot change the `options` prop after setting the `stripe` prop.")),d.current||("sync"===y.tag&&(d.current=!0,g({stripe:y.stripe,elements:y.stripe.elements(c)})),"async"===y.tag&&(d.current=!0,y.stripePromise.then((function(e){e&&m.current&&g({stripe:e,elements:e.elements(c)})})))),t.useEffect((function(){return function(){m.current=!1}}),[]),t.useEffect((function(){var e=v.stripe;e&&e._registerWrapper&&e.registerAppInfo&&(e._registerWrapper({name:"react-stripe-js",version:"1.4.1"}),e.registerAppInfo({name:"react-stripe-js",version:"1.4.1",url:"https://stripe.com/docs/stripe-js/react"}))}),[v.stripe]),t.createElement(p.Provider,{value:v},f)};f.propTypes={stripe:c.any,options:c.object};var d=function(e){return function(e,t){if(!e)throw new Error("Could not find Elements context; You need to wrap the part of your app that ".concat(t," in an <Elements> provider."));return e}(t.useContext(p),e)},m=function(e){return(0,e.children)(d("mounts <ElementsConsumer>"))};m.propTypes={children:c.func.isRequired};var y=function(e){var r=t.useRef(e);return t.useEffect((function(){r.current=e}),[e]),function(){r.current&&r.current.apply(r,arguments)}},b=function(e){return i(e)?(e.paymentRequest,function(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},a=Object.keys(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}(e,["paymentRequest"])):{}},v=function(){},g=function(e,r){var n,o="".concat((n=e).charAt(0).toUpperCase()+n.slice(1),"Element"),a=r?function(e){d("mounts <".concat(o,">"));var r=e.id,n=e.className;return t.createElement("div",{id:r,className:n})}:function(r){var n=r.id,a=r.className,c=r.options,i=void 0===c?{}:c,u=r.onBlur,l=void 0===u?v:u,p=r.onFocus,f=void 0===p?v:p,m=r.onReady,g=void 0===m?v:m,h=r.onChange,E=void 0===h?v:h,w=r.onEscape,O=void 0===w?v:w,_=r.onClick,C=void 0===_?v:_,R=d("mounts <".concat(o,">")).elements,j=t.useRef(null),S=t.useRef(null),x=y(g),P=y(l),T=y(f),A=y(C),k=y(E),I=y(O);t.useLayoutEffect((function(){if(null==j.current&&R&&null!=S.current){var t=R.create(e,i);j.current=t,t.mount(S.current),t.on("ready",(function(){return x(t)})),t.on("change",k),t.on("blur",P),t.on("focus",T),t.on("escape",I),t.on("click",A)}}));var M=t.useRef(i);return t.useEffect((function(){M.current&&M.current.paymentRequest!==i.paymentRequest&&console.warn("Unsupported prop change: options.paymentRequest is not a customizable property.");var e=b(i);0===Object.keys(e).length||s(e,b(M.current))||j.current&&(j.current.update(e),M.current=i)}),[i]),t.useLayoutEffect((function(){return function(){j.current&&j.current.destroy()}}),[]),t.createElement("div",{id:n,className:a,ref:S})};return a.propTypes={id:c.string,className:c.string,onChange:c.func,onBlur:c.func,onFocus:c.func,onReady:c.func,onClick:c.func,options:c.object},a.displayName=o,a.__elementType=e,a},h="undefined"==typeof window,E=g("auBankAccount",h),w=g("card",h),O=g("cardNumber",h),_=g("cardExpiry",h),C=g("cardCvc",h),R=g("fpxBank",h),j=g("iban",h),S=g("idealBank",h),x=g("p24Bank",h),P=g("epsBank",h),T=g("payment",h),A=g("paymentRequestButton",h),k=g("afterpayClearpayMessage",h);e.AfterpayClearpayMessageElement=k,e.AuBankAccountElement=E,e.CardCvcElement=C,e.CardElement=w,e.CardExpiryElement=_,e.CardNumberElement=O,e.Elements=f,e.ElementsConsumer=m,e.EpsBankElement=P,e.FpxBankElement=R,e.IbanElement=j,e.IdealBankElement=S,e.P24BankElement=x,e.PaymentElement=T,e.PaymentRequestButtonElement=A,e.useElements=function(){return d("calls useElements()").elements},e.useStripe=function(){return d("calls useStripe()").stripe},Object.defineProperty(e,"__esModule",{value:!0})}(t,r(20))},,function(e,t){e.exports=window.wc.wcBlocksRegistry},,function(e,t){e.exports=window.regeneratorRuntime},function(e,t){function r(t){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?(e.exports=r=function(e){return typeof e},e.exports.default=e.exports,e.exports.__esModule=!0):(e.exports=r=function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.default=e.exports,e.exports.__esModule=!0),r(t)}e.exports=r,e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){function r(e,t,r,n,o,a,c){try{var i=e[a](c),s=i.value}catch(e){return void r(e)}i.done?t(s):Promise.resolve(s).then(n,o)}e.exports=function(e){return function(){var t=this,n=arguments;return new Promise((function(o,a){var c=e.apply(t,n);function i(e){r(c,o,a,i,s,"next",e)}function s(e){r(c,o,a,i,s,"throw",e)}i(void 0)}))}},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){function r(){return e.exports=r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},e.exports.default=e.exports,e.exports.__esModule=!0,r.apply(this,arguments)}e.exports=r,e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=window.wp.isShallowEqual},function(e,t,r){var n=r(21);e.exports=function(e,t){if(null==e)return{};var r,o,a=n(e,t);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(e);for(o=0;o<c.length;o++)r=c[o],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(e){if(Array.isArray(e))return e},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,a=[],_n=!0,c=!1;try{for(r=r.call(e);!(_n=(n=r.next()).done)&&(a.push(n.value),!t||a.length!==t);_n=!0);}catch(e){c=!0,o=e}finally{try{_n||null==r.return||r.return()}finally{if(c)throw o}}return a}},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,r){var n=r(18);e.exports=function(e,t){if(e){if("string"==typeof e)return n(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?n(e,t):void 0}},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=window.React},function(e,t){e.exports=function(e,t){if(null==e)return{};var r,n,o={},a=Object.keys(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||(o[r]=e[r]);return o},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,r){"use strict";r.r(t);var n=r(7),o=r(12),a=r.n(o),c=r(3),i=r.n(c),s=r(1),u=r(0),l="https://js.stripe.com/v3",p=/^https:\/\/js\.stripe\.com\/v3\/?(\?.*)?$/,f="loadStripe.setLoadParameters was called but an existing Stripe.js script already exists in the document; existing script parameters will be used",d=null,m=function(e,t,r){if(null===e)return null;var n=e.apply(void 0,t);return function(e,t){e&&e._registerWrapper&&e._registerWrapper({name:"stripe-js",version:"1.16.0",startTime:t})}(n,r),n},y=Promise.resolve().then((function(){return e=null,null!==d?d:d=new Promise((function(t,r){if("undefined"!=typeof window)if(window.Stripe&&e&&console.warn(f),window.Stripe)t(window.Stripe);else try{var n=function(){for(var e=document.querySelectorAll('script[src^="'.concat(l,'"]')),t=0;t<e.length;t++){var r=e[t];if(p.test(r.src))return r}return null}();n&&e?console.warn(f):n||(n=function(e){var t=e&&!e.advancedFraudSignals?"?advancedFraudSignals=false":"",r=document.createElement("script");r.src="".concat(l).concat(t);var n=document.head||document.body;if(!n)throw new Error("Expected document.body not to be null. Stripe.js requires a <body> element.");return n.appendChild(r),r}(e)),n.addEventListener("load",(function(){window.Stripe?t(window.Stripe):r(new Error("Stripe.js not available"))})),n.addEventListener("error",(function(){r(new Error("Failed to load Stripe.js"))}))}catch(e){return void r(e)}else t(null)}));var e})),b=!1;y.catch((function(e){b||console.warn(e)}));var v=r(2),g=r.n(v),h=r(4),E=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return e.map((function(e){return!!e.value&&{amount:e.value,label:e.label,pending:t}})).filter(Boolean)},w=function(e){return e[0].shipping_rates.map((function(e){return{id:e.rate_id,label:e.name,detail:e.description,amount:parseInt(e.price,10)}}))},O=function(e){return{first_name:e.recipient.split(" ").slice(0,1).join(" "),last_name:e.recipient.split(" ").slice(1).join(" "),company:"",address_1:void 0===e.addressLine[0]?"":e.addressLine[0],address_2:void 0===e.addressLine[1]?"":e.addressLine[1],city:e.city,state:e.region,country:e.country,postcode:e.postalCode.replace(" ","")}},_=function(e){var t=e.source,r=t&&t.owner.name,n=t&&t.owner.address,o=e.payerEmail||"",a=e.payerPhone||"";return{first_name:r?r.split(" ").slice(0,1).join(" "):"",last_name:r?r.split(" ").slice(1).join(" "):"",email:t&&t.owner.email||o,phone:t&&t.owner.phone||a.replace("/[() -]/g",""),country:n&&n.country||"",address_1:n&&n.line1||"",address_2:n&&n.line2||"",city:n&&n.city||"",state:n&&n.state||"",postcode:n&&n.postal_code||"",company:""}},C=function(e,t){return{payment_method:"stripe",stripe_source:e.source?e.source.id:null,payment_request_type:t}},R={INVALID_EMAIL:"email_invalid",INVALID_REQUEST:"invalid_request_error",API_CONNECTION:"api_connection_error",API_ERROR:"api_error",AUTHENTICATION_ERROR:"authentication_error",RATE_LIMIT_ERROR:"rate_limit_error",CARD_ERROR:"card_error",VALIDATION_ERROR:"validation_error"},j=function(){var e=Object(h.getSetting)("stripe_data",null);if(!e)throw new Error("Stripe initialization data is not available");return e},S=function(e){return{label:j().stripeTotalLabel||Object(s.__)("Total",'woocommerce'),amount:e.value}},x=function(e){return[R.INVALID_REQUEST,R.API_CONNECTION,R.API_ERROR,R.AUTHENTICATION_ERROR,R.RATE_LIMIT_ERROR].includes(e)},P=function(e){var t;return(t={},g()(t,"invalid_number",Object(s.__)("The card number is not a valid credit card number.","woocommerce-gateway-stripe")),g()(t,"invalid_expiry_month",Object(s.__)("The card expiration month is invalid.","woocommerce-gateway-stripe")),g()(t,"invalid_expiry_year",Object(s.__)("The card expiration year is invalid.","woocommerce-gateway-stripe")),g()(t,"invalid_cvc",Object(s.__)("The card security code is invalid.","woocommerce-gateway-stripe")),g()(t,"incorrect_number",Object(s.__)("The card number is incorrect.","woocommerce-gateway-stripe")),g()(t,"incomplete_number",Object(s.__)("The card number is incomplete.","woocommerce-gateway-stripe")),g()(t,"incomplete_cvc",Object(s.__)("The card security code is incomplete.","woocommerce-gateway-stripe")),g()(t,"incomplete_expiry",Object(s.__)("The card expiration date is incomplete.","woocommerce-gateway-stripe")),g()(t,"expired_card",Object(s.__)("The card has expired.","woocommerce-gateway-stripe")),g()(t,"incorrect_cvc",Object(s.__)("The card security code is incorrect.","woocommerce-gateway-stripe")),g()(t,"incorrect_zip",Object(s.__)("The card zip code failed validation.","woocommerce-gateway-stripe")),g()(t,"invalid_expiry_year_past",Object(s.__)("The card expiration year is in the past","woocommerce-gateway-stripe")),g()(t,"card_declined",Object(s.__)("The card was declined.","woocommerce-gateway-stripe")),g()(t,"missing",Object(s.__)("There is no card on a customer that is being charged.","woocommerce-gateway-stripe")),g()(t,"processing_error",Object(s.__)("An error occurred while processing the card.","woocommerce-gateway-stripe")),t)[e]||null},T=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";switch(e){case R.INVALID_EMAIL:return Object(s.__)("Invalid email address, please correct and try again.","woo-gutenberg-product-blocks");case x(e):return Object(s.__)("Unable to process this payment, please try again or use alternative method.","woo-gutenberg-product-blocks");case R.CARD_ERROR:return P(t);case R.VALIDATION_ERROR:return""}return null},A=function(e){return{country:e.country,state:e.state,city:e.city,postcode:e.postcode.replace(" ","").toUpperCase()}},k=function(){return new Promise((function(e){try{e(function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];b=!0;var n=Date.now();return y.then((function(e){return m(e,t,n)}))}(function(){var e=j().publicKey;if(!e)throw new Error("There is no api key available for stripe. Make sure it is available on the wc.stripe_data.stripe.key property.");return e}()))}catch(t){e({error:t})}}))},I=r(5),M=r(11),q=r.n(M),N=r(9),D=r.n(N),L=function(e){var t=e.stripe,r=e.paymentDetails,n=e.errorContext,o=e.errorType,a={type:e.successType};if(!r.setup_intent&&!r.payment_intent_secret)return a;var c=!!r.setupIntent,i=r.verification_endpoint,s=c?r.setup_intent:r.payment_intent_secret;return t[c?"confirmCardSetup":"confirmCardPayment"](s).then((function(e){if(e.error)throw e.error;var t=e[c?"setupIntent":"paymentIntent"];return"requires_capture"!==t.status&&"succeeded"!==t.status||(a.redirectUrl=i),a})).catch((function(e){return a.type=o,a.message=e.message,a.retry=!0,a.messageContext=n,window.fetch(i+"&is_ajax"),a}))},H=r(10),B=r.n(H);function U(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function F(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?U(Object(r),!0).forEach((function(t){g()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):U(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var V={style:{base:{iconColor:"#666EE8",color:"#31325F",fontSize:function(e,t,r){var n={};if("object"===("undefined"==typeof document?"undefined":B()(document))&&"function"==typeof document.querySelector&&"function"==typeof window.getComputedStyle){var o=document.querySelector(".wc-block-checkout");o&&(n=window.getComputedStyle(o))}return n.fontSize||"16px"}(),lineHeight:1.375,"::placeholder":{color:"#fff"}}},classes:{focus:"focused",empty:"empty",invalid:"has-error"}},W=function(e){var t=Object(u.useState)(!1),r=i()(t,2),n=r[0],o=r[1],a=Object(u.useState)(F(F({},V),e)),c=i()(a,2),s=c[0],l=c[1],p=Object(u.useState)(""),f=i()(p,2),d=f[0],m=f[1];return Object(u.useEffect)((function(){var e=n?"#CFD7E0":"#fff";l((function(t){var r=void 0!==t.showIcon?{showIcon:n}:{};return F(F({},t),{},{style:F(F({},t.style),{},{base:F(F({},t.style.base),{},{"::placeholder":{color:e}})})},r)}))}),[n]),{options:s,onActive:Object(u.useCallback)((function(e){o(!e||function(e){return!e})}),[o]),error:d,setError:m}};function Y(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Z(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Y(Object(r),!0).forEach((function(t){g()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Y(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var z,$,Q=function(e){var t=e.inputErrorComponent,r=e.onChange,n=Object(u.useState)(!0),o=i()(n,2),a=o[0],c=o[1],l=W({hidePostalCode:!0}),p=l.options,f=l.onActive,d=l.error,m=l.setError;return React.createElement(React.Fragment,null,React.createElement("div",{className:"wc-block-gateway-container wc-inline-card-element"},React.createElement(I.CardElement,{id:"wc-stripe-inline-card-element",className:"wc-block-gateway-input",options:p,onBlur:function(){return f(a)},onFocus:function(){return f(a)},onChange:function(e){e.error?m(e.error.message):m(""),c(e.empty),r(e)}}),React.createElement("label",{htmlFor:"wc-stripe-inline-card-element"},Object(s.__)("Credit Card Information",'woocommerce'))),React.createElement(t,{errorMessage:d}))},K=function(e){var t=e.onChange,r=e.inputErrorComponent,n=Object(u.useState)({cardNumber:!0,cardExpiry:!0,cardCvc:!0}),o=i()(n,2),a=o[0],c=o[1],l=W({showIcon:!1}),p=l.options,f=l.onActive,d=l.error,m=l.setError,y=W(),b=y.options,v=y.onActive,h=y.error,E=y.setError,w=W(),O=w.options,_=w.onActive,C=w.error,R=w.setError,j=function(e,r){return function(n){n.error?e(n.error.message):e(""),c(Z(Z({},a),{},g()({},r,n.empty))),t(n)}};return React.createElement("div",{className:"wc-block-card-elements"},React.createElement("div",{className:"wc-block-gateway-container wc-card-number-element"},React.createElement(I.CardNumberElement,{onChange:j(m,"cardNumber"),options:p,className:"wc-block-gateway-input",id:"wc-stripe-card-number-element",onFocus:function(){return f(a.cardNumber)},onBlur:function(){return f(a.cardNumber)}}),React.createElement("label",{htmlFor:"wc-stripe-card-number-element"},Object(s.__)("Card Number","woo-gutenberg-product-blocks")),React.createElement(r,{errorMessage:d})),React.createElement("div",{className:"wc-block-gateway-container wc-card-expiry-element"},React.createElement(I.CardExpiryElement,{onChange:j(E,"cardExpiry"),options:b,className:"wc-block-gateway-input",onFocus:function(){return v(a.cardExpiry)},onBlur:function(){return v(a.cardExpiry)},id:"wc-stripe-card-expiry-element"}),React.createElement("label",{htmlFor:"wc-stripe-card-expiry-element"},Object(s.__)("Expiry Date","woo-gutenberg-product-blocks")),React.createElement(r,{errorMessage:h})),React.createElement("div",{className:"wc-block-gateway-container wc-card-cvc-element"},React.createElement(I.CardCvcElement,{onChange:j(R,"cardCvc"),options:O,className:"wc-block-gateway-input",onFocus:function(){return _(a.cardCvc)},onBlur:function(){return _(a.cardCvc)},id:"wc-stripe-card-code-element"}),React.createElement("label",{htmlFor:"wc-stripe-card-code-element"},Object(s.__)("CVV/CVC","woo-gutenberg-product-blocks")),React.createElement(r,{errorMessage:C})))},X=function(){return Object.entries(j().icons).map((function(e){var t=i()(e,2),r=t[0],n=t[1];return{id:r,src:n.src,alt:n.alt}}))},G=function(e){var t=e.billing,r=e.eventRegistration,n=e.emitResponse,o=e.components,a=o.ValidationInputError,c=o.PaymentMethodIcons,s=Object(u.useState)(""),l=i()(s,2),p=l[0],f=l[1],d=Object(I.useStripe)(),m=function(e,t,r,n,o,a){var c=Object(u.useState)(""),s=i()(c,2),l=s[0],p=s[1],f=Object(u.useCallback)((function(e){var t,r=e.error.type,n=e.error.code||"",o=null!==(t=T(r,n))&&void 0!==t?t:e.error.message;return p(o),o}),[]),d=e.onCheckoutAfterProcessingWithSuccess,m=e.onPaymentProcessing,y=e.onCheckoutAfterProcessingWithError;return function(e,t,r,n){Object(u.useEffect)((function(){var o=t(function(){var t=q()(D.a.mark((function t(o){var a,c,i;return D.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return a=o.processingResponse,c=a.paymentDetails||{},t.next=4,L({stripe:e,paymentDetails:c,errorContext:n.noticeContexts.PAYMENTS,errorType:n.responseTypes.ERROR,successType:n.responseTypes.SUCCESS});case 4:return(i=t.sent).type===n.responseTypes.ERROR&&i.retry&&r("0"),t.abrupt("return",i);case 7:case"end":return t.stop()}}),t)})));return function(_x){return t.apply(this,arguments)}}());return function(){return o()}}),[t,n.noticeContexts.PAYMENTS,n.responseTypes.ERROR,n.responseTypes.SUCCESS,r,e])}(a,d,n,o),function(e,t,r,n,o,a,c,i){var s=Object(I.useElements)();Object(u.useEffect)((function(){var u=function(){var e=q()(D.a.mark((function e(t){var n;return D.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=j().inline_cc_form?I.CardElement:I.CardNumberElement,e.next=3,r.createSource(null==s?void 0:s.getElement(n),{type:"card",owner:t});case 3:return e.abrupt("return",e.sent);case 4:case"end":return e.stop()}}),e)})));return function(_x){return e.apply(this,arguments)}}(),l=i(function(){var r=q()(D.a.mark((function r(){var i,s,l;return D.a.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(r.prev=0,i=n.billingData,!t){r.next=4;break}return r.abrupt("return",{type:o.responseTypes.ERROR,message:t});case 4:if(""===a||"0"===a){r.next=6;break}return r.abrupt("return",{type:o.responseTypes.SUCCESS,meta:{paymentMethodData:{paymentMethod:"stripe",paymentRequestType:"cc",stripe_source:a},billingData:i}});case 6:return s={address:{line1:i.address_1,line2:i.address_2,city:i.city,state:i.state,postal_code:i.postcode,country:i.country}},i.phone&&(s.phone=i.phone),i.email&&(s.email=i.email),(i.first_name||i.last_name)&&(s.name="".concat(i.first_name," ").concat(i.last_name)),r.next=12,u(s);case 12:if(!(l=r.sent).error){r.next=15;break}return r.abrupt("return",{type:o.responseTypes.ERROR,message:e(l)});case 15:if(l.source&&l.source.id){r.next=17;break}throw new Error(T(R.API_ERROR));case 17:return c(l.source.id),r.abrupt("return",{type:o.responseTypes.SUCCESS,meta:{paymentMethodData:{stripe_source:l.source.id,paymentMethod:"stripe",paymentRequestType:"cc"},billingData:i}});case 21:return r.prev=21,r.t0=r.catch(0),r.abrupt("return",{type:o.responseTypes.ERROR,message:r.t0});case 24:case"end":return r.stop()}}),r,null,[[0,21]])})));return function(){return r.apply(this,arguments)}}());return function(){l()}}),[i,n.billingData,r,a,c,e,t,o.noticeContexts.PAYMENTS,o.responseTypes.ERROR,o.responseTypes.SUCCESS,s])}(f,l,a,t,o,r,n,m),Object(u.useEffect)((function(){var e=y((function(e){var t,r=e.processingResponse;return null==r||null===(t=r.paymentDetails)||void 0===t||!t.errorMessage||{type:o.responseTypes.ERROR,message:r.paymentDetails.errorMessage,messageContext:o.noticeContexts.PAYMENTS}}));return function(){e()}}),[y,o.noticeContexts.PAYMENTS,o.responseTypes.ERROR]),f}(r,t,p,f,n,d),y=function(e){e.error&&m(e),f("0")},b=X(),v=j().inline_cc_form?React.createElement(Q,{onChange:y,inputErrorComponent:a}):React.createElement(K,{onChange:y,inputErrorComponent:a});return React.createElement(React.Fragment,null,v,c&&b.length&&React.createElement(c,{icons:b,align:"left"}))},J=function(e){var t=j().button.locale,r=e.stripe;return React.createElement(I.Elements,{stripe:r,locale:t},React.createElement(G,e))},ee=k(),te=function(e){var t=Object(u.useState)(""),r=i()(t,2),n=r[0],o=r[1];return Object(u.useEffect)((function(){Promise.resolve(ee).then((function(e){var t=e.error;t&&o(t.message)}))}),[o]),Object(u.useEffect)((function(){if(n)throw new Error(n)}),[n]),React.createElement(J,a()({stripe:ee},e))},re=function(e){var t=e.components.PaymentMethodLabel,r=j().title?j().title:Object(s.__)("Credit / Debit Card",'woocommerce');return React.createElement(t,{text:r})},ne=X(),oe={name:"stripe",label:React.createElement(re,null),content:React.createElement(te,null),edit:React.createElement(te,null),icons:ne,canMakePayment:function(){return ee},ariaLabel:Object(s.__)("Stripe Credit Card payment method",'woocommerce'),supports:{showSavedCards:j().showSavedCards,showSaveOption:j().showSaveOption,features:null!==(z=null===($=j())||void 0===$?void 0:$.supports)&&void 0!==z?z:[]}},ae={shippingAddressChange:null,shippingOptionChange:null,source:null},ce=r(13),ie=r.n(ce),se=r(14),ue=r.n(se);function le(e){var t=function(e,t){if("object"!==B()(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!==B()(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===B()(t)?t:String(t)}function pe(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function fe(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?pe(Object(r),!0).forEach((function(t){g()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):pe(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var de,me,ye=function(e){var t=e.shippingData,r=e.billing,n=e.eventRegistration,o=e.onSubmit,a=e.setExpressPaymentError,c=e.emitResponse,l=function(e){var t=e.billing,r=e.shippingData,n=e.setExpressPaymentError,o=e.onClick,a=e.onClose,c=e.onSubmit,l=Object(I.useStripe)(),p=Object(u.useState)(null),f=i()(p,2),d=f[0],m=f[1],y=Object(u.useState)(!1),b=i()(y,2),v=b[0],_=b[1],C=Object(u.useState)(!1),R=i()(C,2),x=R[0],P=R[1],T=Object(u.useState)(!1),k=i()(T,2),M=k[0],q=k[1],N=Object(u.useState)(""),D=i()(N,2),L=D[0],H=D[1],B=Object(u.useRef)(r),U=function(){var e=Object(u.useState)(ae),t=i()(e,2),r=t[0],n=t[1];return{paymentRequestEventHandlers:r,setPaymentRequestEventHandler:Object(u.useCallback)((function(e,t){n((function(r){return fe(fe({},r),{},g()({},e,t))}))}),[n]),clearPaymentRequestEventHandler:Object(u.useCallback)((function(e){n((function(t){return t[e],ue()(t,[e].map(le))}))}),[n])}}(),F=U.paymentRequestEventHandlers,V=U.clearPaymentRequestEventHandler,W=U.setPaymentRequestEventHandler;Object(u.useEffect)((function(){B.current=r}),[r]),Object(u.useEffect)((function(){var e;if(l&&t.cartTotal.value&&!v&&!x&&!d){var n=function(e){var t=e.stripe,r=e.currencyCode,n=e.countryCode,o=e.shippingRequired,a=e.cartTotalItems,c={total:S(e.total),currency:r,country:n||"US",requestPayerName:!0,requestPayerEmail:!0,requestPayerPhone:!0,requestShipping:o,displayItems:E(a)};return t.paymentRequest(c)}({total:t.cartTotal,currencyCode:t.currency.code.toLowerCase(),countryCode:null===(e=Object(h.getSetting)("baseLocation",{}))||void 0===e?void 0:e.country,shippingRequired:r.needsShipping,cartTotalItems:t.cartTotalItems,stripe:l});(function(e){return new Promise((function(t){e.canMakePayment().then((function(e){if(e){var r=e.applePay?"apple_pay":"payment_request_api";t({canPay:!0,requestType:r})}else t({canPay:!1})}))}))})(n).then((function(e){m(n),H(e.requestType||""),q(e.canPay)}))}}),[t.cartTotal,t.currency.code,r.needsShipping,t.cartTotalItems,l,x,v,d]);var Y=Object(u.useCallback)((function(){var e,r,a,c;P(!0),_(!1),n(""),e={paymentRequest:d,total:t.cartTotal,currencyCode:t.currency.code.toLowerCase(),cartTotalItems:t.cartTotalItems},r=e.total,a=e.currencyCode,c=e.cartTotalItems,e.paymentRequest.update({total:S(r),currency:a,displayItems:E(c)}),o()}),[o,d,n,t.cartTotal,t.currency.code,t.cartTotalItems]),Z=Object(u.useCallback)((function(e){e.complete("fail"),P(!1),_(!0)}),[]),z=Object(u.useCallback)((function(e){e.complete("success"),_(!0),P(!1)}),[]);return Object(u.useEffect)((function(){var e={removeAllListeners:function(){}},t=e,r=e,o=e,i=e;return d&&(t=d.on("shippingaddresschange",(function(e){var t=O(e.shippingAddress);ie()(A(t),A(B.current.shippingAddress))?e.updateWith({status:"success",shippingOptions:w(B.current.shippingRates)}):(B.current.setShippingAddress(O(e.shippingAddress)),W("shippingAddressChange",e))})),r=d.on("shippingoptionchange",(function(e){B.current.setSelectedRates(e.shippingOption.id),W("shippingOptionChange",e)})),o=d.on("source",(function(e){j().allowPrepaidCard||!e.source.card.funding?(W("sourceEvent",e),c()):n(Object(s.__)("Sorry, we're not accepting prepaid cards at this time.","woocommerce-gateway-stripe"))})),i=d.on("cancel",(function(){_(!1),P(!1),m(null),a()}))),function(){d&&(t.removeAllListeners(),r.removeAllListeners(),o.removeAllListeners(),i.removeAllListeners())}}),[d,M,x,W,n,c,a]),{paymentRequest:d,paymentRequestEventHandlers:F,clearPaymentRequestEventHandler:V,isProcessing:x,canMakePayment:M,onButtonClick:Y,abortPayment:Z,completePayment:z,paymentRequestType:L}}({billing:r,shippingData:t,setExpressPaymentError:a,onClick:e.onClick,onClose:e.onClose,onSubmit:o}),p=l.paymentRequest,f=l.paymentRequestEventHandlers,d=l.clearPaymentRequestEventHandler,m=l.isProcessing,y=l.canMakePayment,b=l.onButtonClick,v=l.abortPayment,R=l.completePayment;!function(e){var t=e.canMakePayment,r=e.isProcessing,n=e.eventRegistration,o=e.paymentRequestEventHandlers,a=e.clearPaymentRequestEventHandler,c=e.billing,i=e.shippingData,s=e.emitResponse,l=e.paymentRequestType,p=e.completePayment,f=e.abortPayment,d=n.onShippingRateSuccess,m=n.onShippingRateFail,y=n.onShippingRateSelectSuccess,b=n.onShippingRateSelectFail,v=n.onPaymentProcessing,g=n.onCheckoutAfterProcessingWithSuccess,h=n.onCheckoutAfterProcessingWithError,R=s.noticeContexts,j=s.responseTypes,x=Object(u.useRef)(o),P=Object(u.useRef)(c),T=Object(u.useRef)(i),A=Object(u.useRef)(l);Object(u.useEffect)((function(){x.current=o,P.current=c,T.current=i,A.current=l}),[o,c,i,l]),Object(u.useEffect)((function(){var e=function(e){var t=x.current;t.shippingAddressChange&&r&&t.shippingAddressChange.updateWith({status:e.hasInvalidAddress?"invalid_shipping_address":"fail",shippingOptions:[]}),a("shippingAddressChange")},n=function(e){var t=x.current,n={type:j.SUCCESS};if(t.sourceEvent&&r){var o=e.processingResponse,c=o.paymentStatus,i=o.paymentDetails;c===j.SUCCESS&&p(t.sourceEvent),c!==j.ERROR&&c!==j.FAIL||(f(t.sourceEvent),n={type:j.ERROR,message:null==i?void 0:i.errorMessage,messageContext:R.EXPRESS_PAYMENTS,retry:!0}),a("sourceEvent")}return n};if(t&&r){var o=d((function(e){var t=x.current,n=P.current;t.shippingAddressChange&&r&&(t.shippingAddressChange.updateWith({status:"success",shippingOptions:w(e),total:S(n.cartTotal),displayItems:E(n.cartTotalItems)}),a("shippingAddressChange"))})),c=m(e),i=y(function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return function(){var t=x.current,n=T.current,o=P.current;if(t.shippingOptionChange&&!n.isSelectingRate&&r){var c=e?{status:"success",total:S(o.cartTotal),displayItems:E(o.cartTotalItems)}:{status:"fail"};t.shippingOptionChange.updateWith(c),a("shippingOptionChange")}}}()),s=b(e),u=v((function(){var e,t=x.current;return t.sourceEvent&&r?{type:j.SUCCESS,meta:{billingData:_(t.sourceEvent),paymentMethodData:C(t.sourceEvent,A.current),shippingData:(e=t.sourceEvent,e.shippingAddress?{address:O(e.shippingAddress)}:null)}}:{type:j.SUCCESS}})),l=g(n),k=h(n);return function(){k(),l(),u(),c(),o(),i(),s()}}}),[t,r,d,m,y,b,v,g,h,j,R,p,f,a])}({canMakePayment:y,isProcessing:m,eventRegistration:n,paymentRequestEventHandlers:f,clearPaymentRequestEventHandler:d,billing:r,shippingData:t,emitResponse:c,paymentRequestType:l.paymentRequestType,completePayment:R,abortPayment:v});var x={paymentRequestButton:{type:"default",theme:j().button.theme,height:"48px"}};return y&&p?React.createElement(I.PaymentRequestButtonElement,{onClick:b,options:{style:x,paymentRequest:p}}):null},be=function(e){var t=j().button.locale,r=e.stripe;return React.createElement(I.Elements,{stripe:r,locale:t},React.createElement(ye,e))},ve=function(){return React.createElement("img",{src:"data:image/svg+xml,%3Csvg width='264' height='48' viewBox='0 0 264 48' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Crect width='264' height='48' rx='3' fill='black'/%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M125.114 16.6407C125.682 15.93 126.067 14.9756 125.966 14C125.135 14.0415 124.121 14.549 123.533 15.2602C123.006 15.8693 122.539 16.8641 122.661 17.7983C123.594 17.8797 124.526 17.3317 125.114 16.6407Z' fill='white'/%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M125.955 17.982C124.601 17.9011 123.448 18.7518 122.801 18.7518C122.154 18.7518 121.163 18.0224 120.092 18.0421C118.696 18.0629 117.402 18.8524 116.694 20.1079C115.238 22.6196 116.31 26.3453 117.726 28.3909C118.414 29.4028 119.242 30.5174 120.334 30.4769C121.366 30.4365 121.77 29.8087 123.024 29.8087C124.277 29.8087 124.641 30.4769 125.733 30.4567C126.865 30.4365 127.573 29.4443 128.261 28.4313C129.049 27.2779 129.373 26.1639 129.393 26.1027C129.373 26.0825 127.209 25.2515 127.189 22.7606C127.169 20.6751 128.888 19.6834 128.969 19.6217C127.998 18.1847 126.481 18.0224 125.955 17.982Z' fill='white'/%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M136.131 23.1804H138.834C140.886 23.1804 142.053 22.0752 142.053 20.1592C142.053 18.2432 140.886 17.1478 138.845 17.1478H136.131V23.1804ZM139.466 15.1582C142.411 15.1582 144.461 17.1903 144.461 20.1483C144.461 23.1172 142.369 25.1596 139.392 25.1596H136.131V30.3498H133.775V15.1582H139.466Z' fill='white'/%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M152.198 26.224V25.3712L149.579 25.5397C148.106 25.6341 147.339 26.182 147.339 27.14C147.339 28.0664 148.138 28.6667 149.39 28.6667C150.988 28.6667 152.198 27.6449 152.198 26.224ZM145.046 27.2032C145.046 25.2551 146.529 24.1395 149.263 23.971L152.198 23.7922V22.9498C152.198 21.7181 151.388 21.0442 149.947 21.0442C148.758 21.0442 147.896 21.6548 147.717 22.5916H145.592C145.656 20.6232 147.507 19.1914 150.01 19.1914C152.703 19.1914 154.459 20.602 154.459 22.7917V30.351H152.282V28.5298H152.229C151.609 29.719 150.241 30.4666 148.758 30.4666C146.571 30.4666 145.046 29.1612 145.046 27.2032Z' fill='white'/%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M156.461 34.4145V32.5934C156.608 32.6141 156.965 32.6354 157.155 32.6354C158.196 32.6354 158.785 32.1932 159.142 31.0564L159.353 30.3824L155.366 19.3281H157.827L160.604 28.298H160.657L163.434 19.3281H165.832L161.698 30.9402C160.752 33.6038 159.668 34.4778 157.376 34.4778C157.197 34.4778 156.618 34.4565 156.461 34.4145Z' fill='white'/%3E%3C/svg%3E%0A",alt:""})},ge=k(),he=k(),Ee=!1,we=!1,Oe={name:"payment_request",content:React.createElement(be,{stripe:he}),edit:React.createElement(ve,null),canMakePayment:function(e){var t,r,n,o,a,c;return o={currencyCode:null==e||null===(t=e.cartTotals)||void 0===t||null===(r=t.currency_code)||void 0===r?void 0:r.toLowerCase(),totalPrice:parseInt((null==e||null===(n=e.cartTotals)||void 0===n?void 0:n.total_price)||0,10)},a=o.currencyCode,!((c=o.totalPrice)<30)&&(Ee?we:ge.then((function(e){var t;if(null===e)return Ee=!0,we;if(e.error&&e.error instanceof Error)throw e.error;return e.paymentRequest({total:{label:"Total",amount:c,pending:!0},country:null===(t=Object(h.getSetting)("baseLocation",{}))||void 0===t?void 0:t.country,currency:a}).canMakePayment().then((function(e){return Ee=!0,we=!!e}))})))},paymentMethodId:"stripe",supports:{features:null!==(de=null===(me=j())||void 0===me?void 0:me.supports)&&void 0!==de?de:[]}};Object(n.registerPaymentMethod)(oe),j().allowPaymentRequest&&Object(n.registerExpressPaymentMethod)(Oe)}]);woocommerce-blocks/build/product-best-sellers.asset.php000064400000000746151335517640017367 0ustar00<?php return array('dependencies' => array('lodash', 'moment', 'react', 'react-dom', 'wc-settings', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-data-controls', 'wp-date', 'wp-deprecated', 'wp-dom', 'wp-element', 'wp-escape-html', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-keycodes', 'wp-polyfill', 'wp-primitives', 'wp-server-side-render', 'wp-url', 'wp-viewport'), 'version' => 'db90aedebf8bf6e9ef0a0a54e3bd1832');woocommerce-blocks/build/wc-blocks-vendors.js000064400003470006151335517640015361 0ustar00(window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[0],[,,function(e,t,n){e.exports=n(585)()},,,function(e,t){e.exports=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,n){var r;!function(){"use strict";var n={}.hasOwnProperty;function o(){for(var e=[],t=0;t<arguments.length;t++){var r=arguments[t];if(r){var a=typeof r;if("string"===a||"number"===a)e.push(r);else if(Array.isArray(r)){if(r.length){var i=o.apply(null,r);i&&e.push(i)}}else if("object"===a)if(r.toString===Object.prototype.toString)for(var c in r)n.call(r,c)&&r[c]&&e.push(c);else e.push(r.toString())}}return e.join(" ")}e.exports?(o.default=o,e.exports=o):void 0===(r=function(){return o}.apply(t,[]))||(e.exports=r)}()},,function(e,t,n){var r=n(661),o=n(662),a=n(387),i=n(663);e.exports=function(e,t){return r(e)||o(e,t)||a(e,t)||i()},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){function n(){return e.exports=n=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},e.exports.default=e.exports,e.exports.__esModule=!0,n.apply(this,arguments)}e.exports=n,e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){function n(t){return e.exports=n=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},e.exports.default=e.exports,e.exports.__esModule=!0,n(t)}e.exports=n,e.exports.default=e.exports,e.exports.__esModule=!0},,,function(e,t){e.exports=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e},e.exports.default=e.exports,e.exports.__esModule=!0},,,function(e,t,n){var r=n(389);e.exports=function(e,t){if(null==e)return{};var n,o,a=r(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(o=0;o<i.length;o++)n=i[o],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){function n(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}e.exports=function(e,t,r){return t&&n(e.prototype,t),r&&n(e,r),e},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,n){var r=n(388);e.exports=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&r(e,t)},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,n){var r=n(38).default,o=n(13);e.exports=function(e,t){return!t||"object"!==r(t)&&"function"!=typeof t?o(e):t},e.exports.default=e.exports,e.exports.__esModule=!0},,,,,,,,,function(e,t){function n(e,t,n,r,o,a,i){try{var c=e[a](i),s=c.value}catch(e){return void n(e)}c.done?t(s):Promise.resolve(s).then(r,o)}e.exports=function(e){return function(){var t=this,r=arguments;return new Promise((function(o,a){var i=e.apply(t,r);function c(e){n(i,o,a,c,s,"next",e)}function s(e){n(i,o,a,c,s,"throw",e)}c(void 0)}))}},e.exports.default=e.exports,e.exports.__esModule=!0},,,,function(e,t,n){var r=n(578),o=n(579),a=n(387),i=n(580);e.exports=function(e){return r(e)||o(e)||a(e)||i()},e.exports.default=e.exports,e.exports.__esModule=!0},,,,,function(e,t){function n(t){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?(e.exports=n=function(e){return typeof e},e.exports.default=e.exports,e.exports.__esModule=!0):(e.exports=n=function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.default=e.exports,e.exports.__esModule=!0),n(t)}e.exports=n,e.exports.default=e.exports,e.exports.__esModule=!0},,function(e,t,n){"use strict";n.d(t,"a",(function(){return r})),n.d(t,"c",(function(){return o})),n.d(t,"e",(function(){return a})),n.d(t,"b",(function(){return i})),n.d(t,"d",(function(){return c}));const r="/jetpack/v4",o="/wc-analytics",a="/wc-admin",i=100,c={pageSize:25,period:"month",compare:"previous_year",noteTypes:["info","marketing","survey","warning"]}},,,,,,,,,function(e,t,n){"use strict";n.d(t,"a",(function(){return Hs})),n.d(t,"b",(function(){return Dl})),n.d(t,"c",(function(){return kl})),n.d(t,"d",(function(){return ve})),n.d(t,"e",(function(){return eu})),n(587);var r=n(5),o=n.n(r),a=n(33),i=n.n(a),c=n(17),s=n.n(c),l=n(18),u=n.n(l),d=n(13),f=n.n(d),p=n(19),h=n.n(p),m=n(20),y=n.n(m),b=n(10),g=n.n(b),v=n(0),O=n(1),w=n(4),_=n(7),k=n(2),S=n.n(k),j=n(519),E=n.n(j),C=n(71),D=n.n(C),P=n(65);w.Navigation||w.__experimentalNavigation,w.NavigationBackButton||w.__experimentalNavigationBackButton,w.NavigationGroup||w.__experimentalNavigationGroup,w.NavigationMenu||w.__experimentalNavigationMenu,w.NavigationItem||w.__experimentalNavigationItem;const x=w.Text||w.__experimentalText;w.useSlot||w.__experimentalUseSlot;var F=n(9),T=n.n(F),M=n(16),R=n.n(M);function I(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function A(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?I(Object(n),!0).forEach((function(t){o()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):I(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function N(e){var t=e.children,n=e.href,r=e.type,o=A(A({},R()(e,["children","href","type"])),{},{"data-link-type":r});return"wc-admin"===r&&(o.onClick=Object(_.partial)((function(e,t){t.ctrlKey||t.metaKey||t.altKey||t.shiftKey||(t.preventDefault(),!1!==(!e||e(t))&&Object(P.e)().push(t.target.closest("a").getAttribute("href")))}),o.onClick)),Object(v.createElement)("a",T()({href:n},o),t)}N.propTypes={href:S.a.string.isRequired,type:S.a.oneOf(["wp-admin","wc-admin","external"]).isRequired},N.defaultProps={type:"wc-admin"},N.contextTypes={router:S.a.object};var L=N,U=n(522),B=n.n(U),H=n(6),q=n.n(H);function z(e){var t="";return function e(n){if(Object(_.isString)(n)||Object(_.isNumber)(n))t+=n;else if(Object(_.isArray)(n))n.forEach(e);else if(n&&n.props){var r=n.props.children;Object(_.isArray)(r)?r.forEach(e):e(r)}}(e),t}var V=function(e){h()(o,e);var t,n,r=(t=o,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=g()(t);if(n){var o=g()(this).constructor;e=Reflect.construct(r,arguments,o)}else e=r.apply(this,arguments);return y()(this,e)});function o(e){var t,n=e.filter,a=e.config,i=e.onFilterChange;s()(this,o),t=r.apply(this,arguments);var c=a.input.options;return t.state={options:c},t.updateOptions=t.updateOptions.bind(f()(t)),!c&&a.input.getOptions&&a.input.getOptions().then(t.updateOptions).then((function(e){if(!n.value){var t=Object(P.d)(a,e);i("value",t)}})),t}return u()(o,[{key:"updateOptions",value:function(e){return this.setState({options:e}),e}},{key:"getScreenReaderText",value:function(e,t){if(""===e.value)return"";var n=Object(_.find)(t.rules,{value:e.rule})||{},r=Object(_.find)(t.input.options,{value:e.value})||{};return z(D()({mixedString:t.labels.title,components:{filter:Object(v.createElement)(v.Fragment,null,r.label),rule:Object(v.createElement)(v.Fragment,null,n.label),title:Object(v.createElement)(v.Fragment,null)}}))}},{key:"render",value:function(){var e=this.props,t=e.className,n=e.config,r=e.filter,o=e.onFilterChange,a=e.isEnglish,i=this.state.options,c=r.rule,s=r.value,l=n.labels,u=n.rules,d=D()({mixedString:l.title,components:{title:Object(v.createElement)("span",{className:t}),rule:Object(v.createElement)(w.SelectControl,{className:q()(t,"woocommerce-filters-advanced__rule"),options:u,value:c,onChange:Object(_.partial)(o,"rule"),"aria-label":l.rule}),filter:i?Object(v.createElement)(w.SelectControl,{className:q()(t,"woocommerce-filters-advanced__input"),options:i,value:s,onChange:Object(_.partial)(o,"value"),"aria-label":l.filter}):Object(v.createElement)(w.Spinner,null)}}),f=this.getScreenReaderText(r,n);return Object(v.createElement)("fieldset",{className:"woocommerce-filters-advanced__line-item",tabIndex:"0"},Object(v.createElement)("legend",{className:"screen-reader-text"},l.add||""),Object(v.createElement)("div",{className:q()("woocommerce-filters-advanced__fieldset",{"is-english":a})},d),f&&Object(v.createElement)("span",{className:"screen-reader-text"},f))}}]),o}(v.Component);V.propTypes={config:S.a.shape({labels:S.a.shape({rule:S.a.string,title:S.a.string,filter:S.a.string}),rules:S.a.arrayOf(S.a.object),input:S.a.object}).isRequired,filter:S.a.shape({key:S.a.string,rule:S.a.string,value:S.a.string}).isRequired,onFilterChange:S.a.func.isRequired};var K=V,W=n(29),G=n.n(W),Y=n(38),$=n.n(Y),Q=n(22),J=n.n(Q),Z=n(21),X=n(46);var ee=function(e){h()(o,e);var t,n,r=(t=o,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=g()(t);if(n){var o=g()(this).constructor;e=Reflect.construct(r,arguments,o)}else e=r.apply(this,arguments);return y()(this,e)});function o(){var e;return s()(this,o),(e=r.apply(this,arguments)).handleKeyDown=e.handleKeyDown.bind(f()(e)),e.select=e.select.bind(f()(e)),e.optionRefs={},e.listbox=Object(v.createRef)(),e}return u()(o,[{key:"componentDidUpdate",value:function(e){var t=this.props,n=t.options,r=t.selectedIndex;Object(_.isEqual)(n,e.options)||(this.optionRefs={}),r!==e.selectedIndex&&this.scrollToOption(r)}},{key:"getOptionRef",value:function(e){return this.optionRefs.hasOwnProperty(e)||(this.optionRefs[e]=Object(v.createRef)()),this.optionRefs[e]}},{key:"select",value:function(e){var t=this.props.onSelect;e.isDisabled||t(e)}},{key:"scrollToOption",value:function(e){var t=this.listbox.current;if(!(t.scrollHeight<=t.clientHeight)&&this.optionRefs[e]){var n=this.optionRefs[e].current,r=t.clientHeight+t.scrollTop,o=n.offsetTop+n.offsetHeight;o>r?t.scrollTop=o-t.clientHeight:n.offsetTop<t.scrollTop&&(t.scrollTop=n.offsetTop)}}},{key:"handleKeyDown",value:function(e){var t=this.props,n=t.decrementSelectedIndex,r=t.incrementSelectedIndex,o=t.options,a=t.onSearch,i=t.selectedIndex,c=t.setExpanded;if(0!==o.length)switch(e.keyCode){case X.UP:n(),e.preventDefault(),e.stopPropagation();break;case X.DOWN:r(),e.preventDefault(),e.stopPropagation();break;case X.ENTER:o[i]&&this.select(o[i]),e.preventDefault(),e.stopPropagation();break;case X.LEFT:case X.RIGHT:c(!1);break;case X.ESCAPE:return c(!1),void a(null);case X.TAB:o[i]&&this.select(o[i]),c(!1)}}},{key:"toggleKeyEvents",value:function(e){this.props.node[e?"addEventListener":"removeEventListener"]("keydown",this.handleKeyDown,!0)}},{key:"componentDidMount",value:function(){var e=this.props.selectedIndex;e>-1&&this.scrollToOption(e),this.toggleKeyEvents(!0)}},{key:"componentWillUnmount",value:function(){this.toggleKeyEvents(!1)}},{key:"render",value:function(){var e=this,t=this.props,n=t.instanceId,r=t.listboxId,o=t.options,a=t.selectedIndex,i=t.staticList,c=q()("woocommerce-select-control__listbox",{"is-static":i});return Object(v.createElement)("div",{ref:this.listbox,id:r,role:"listbox",className:c,tabIndex:"-1"},o.map((function(t,r){return Object(v.createElement)(w.Button,{ref:e.getOptionRef(r),key:t.key,id:"woocommerce-select-control__option-".concat(n,"-").concat(t.key),role:"option","aria-selected":r===a,disabled:t.isDisabled,className:q()("woocommerce-select-control__option",{"is-selected":r===a}),onClick:function(){return e.select(t)},tabIndex:"-1"},t.label)})))}}]),o}(v.Component);ee.propTypes={instanceId:S.a.number,listboxId:S.a.string,node:S.a.instanceOf(Element).isRequired,onSelect:S.a.func,options:S.a.arrayOf(S.a.shape({isDisabled:S.a.bool,key:S.a.oneOfType([S.a.number,S.a.string]).isRequired,keywords:S.a.arrayOf(S.a.oneOfType([S.a.string,S.a.number])),label:S.a.oneOfType([S.a.string,S.a.object]),value:S.a.any})).isRequired,selectedIndex:S.a.number,staticList:S.a.bool};var te=ee,ne=n(25),re=function(e){var t=e.id,n=e.instanceId,r=e.isVisible,o=e.label,a=e.popoverContents,i=e.remove,c=e.screenReaderLabel,s=e.setState,l=e.className;if(c=c||o,!o)return null;o=Object(ne.decodeEntities)(o);var u=q()("woocommerce-tag",l,{"has-remove":!!i}),d="woocommerce-tag__label-".concat(n),f=Object(v.createElement)(v.Fragment,null,Object(v.createElement)("span",{className:"screen-reader-text"},c),Object(v.createElement)("span",{"aria-hidden":"true"},o));return Object(v.createElement)("span",{className:u},a?Object(v.createElement)(w.Button,{className:"woocommerce-tag__text",id:d,onClick:function(){return s((function(){return{isVisible:!0}}))}},f):Object(v.createElement)("span",{className:"woocommerce-tag__text",id:d},f),a&&r&&Object(v.createElement)(w.Popover,{onClose:function(){return s((function(){return{isVisible:!1}}))}},a),i&&Object(v.createElement)(w.Button,{className:"woocommerce-tag__remove",onClick:i(t),label:Object(O.sprintf)(Object(O.__)("Remove %s",'woocommerce'),o),"aria-describedby":d},Object(v.createElement)(w.Dashicon,{icon:"dismiss",size:20})))};re.propTypes={id:S.a.oneOfType([S.a.number,S.a.string]),label:S.a.string.isRequired,popoverContents:S.a.node,remove:S.a.func,screenReaderLabel:S.a.string};var oe=Object(Z.withState)({isVisible:!1})(Object(Z.withInstanceId)(re));var ae=function(e){h()(o,e);var t,n,r=(t=o,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=g()(t);if(n){var o=g()(this).constructor;e=Reflect.construct(r,arguments,o)}else e=r.apply(this,arguments);return y()(this,e)});function o(e){var t;return s()(this,o),(t=r.call(this,e)).removeAll=t.removeAll.bind(f()(t)),t.removeResult=t.removeResult.bind(f()(t)),t}return u()(o,[{key:"removeAll",value:function(){(0,this.props.onChange)([])}},{key:"removeResult",value:function(e){var t=this;return function(){var n=t.props,r=n.selected,o=n.onChange,a=Object(_.findIndex)(r,{key:e});o([].concat(i()(r.slice(0,a)),i()(r.slice(a+1))))}}},{key:"render",value:function(){var e=this,t=this.props,n=t.selected,r=t.showClearButton;return n.length?Object(v.createElement)(v.Fragment,null,Object(v.createElement)("div",{className:"woocommerce-select-control__tags"},n.map((function(t,r){if(!t.label)return null;var o=Object(O.sprintf)(Object(O.__)("%1$s (%2$s of %3$s)",'woocommerce'),t.label,r+1,n.length);return Object(v.createElement)(oe,{key:t.key,id:t.key,label:t.label,remove:e.removeResult,screenReaderLabel:o})}))),r&&Object(v.createElement)(w.Button,{className:"woocommerce-select-control__clear",isLink:!0,onClick:this.removeAll},Object(v.createElement)(w.Icon,{icon:"dismiss"}),Object(v.createElement)("span",{className:"screen-reader-text"},Object(O.__)("Clear all",'woocommerce')))):null}}]),o}(v.Component);ae.propTypes={onChange:S.a.func,onSelect:S.a.func,selected:S.a.arrayOf(S.a.shape({key:S.a.oneOfType([S.a.number,S.a.string]).isRequired,label:S.a.string})),showClearButton:S.a.bool};var ie=ae,ce=n(94),se=n(61);function le(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}var ue=function(e){var t=e.icon,n=e.size,r=void 0===n?24:n,o=Object(se.a)(e,["icon","size"]);return Object(v.cloneElement)(t,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?le(Object(n),!0).forEach((function(t){Object(ce.a)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):le(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({width:r,height:r},o))},de=n(28),fe=Object(v.createElement)(de.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(v.createElement)(de.Path,{d:"M13.5 6C10.5 6 8 8.5 8 11.5c0 1.1.3 2.1.9 3l-3.4 3 1 1.1 3.4-2.9c1 .9 2.2 1.4 3.6 1.4 3 0 5.5-2.5 5.5-5.5C19 8.5 16.5 6 13.5 6zm0 9.5c-2.2 0-4-1.8-4-4s1.8-4 4-4 4 1.8 4 4-1.8 4-4 4z"}));var pe=function(e){h()(o,e);var t,n,r=(t=o,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=g()(t);if(n){var o=g()(this).constructor;e=Reflect.construct(r,arguments,o)}else e=r.apply(this,arguments);return y()(this,e)});function o(e){var t;return s()(this,o),(t=r.call(this,e)).state={isActive:!1},t.input=Object(v.createRef)(),t.updateSearch=t.updateSearch.bind(f()(t)),t.onFocus=t.onFocus.bind(f()(t)),t.onBlur=t.onBlur.bind(f()(t)),t.onKeyDown=t.onKeyDown.bind(f()(t)),t}return u()(o,[{key:"updateSearch",value:function(e){return function(t){e(t.target.value)}}},{key:"onFocus",value:function(e){var t=this,n=this.props,r=n.isSearchable,o=n.setExpanded,a=n.showAllOnFocus,i=n.updateSearchOptions;return function(n){t.setState({isActive:!0}),r&&a?(n.target.select(),i("")):r?e(n.target.value):o(!0)}}},{key:"onBlur",value:function(){var e=this.props.onBlur;"function"==typeof e&&e(),this.setState({isActive:!1})}},{key:"onKeyDown",value:function(e){var t=this.props,n=t.decrementSelectedIndex,r=t.incrementSelectedIndex,o=t.selected,a=t.onChange,c=t.query,s=t.setExpanded;X.BACKSPACE===e.keyCode&&!c&&o.length&&a(i()(o.slice(0,-1))),X.DOWN===e.keyCode&&(r(),s(!0),e.preventDefault(),e.stopPropagation()),X.UP===e.keyCode&&(n(),s(!0),e.preventDefault(),e.stopPropagation())}},{key:"renderButton",value:function(){var e=this.props,t=e.multiple,n=e.selected;return t||!n.length?null:Object(v.createElement)("div",{className:"woocommerce-select-control__control-value"},n[0].label)}},{key:"renderInput",value:function(){var e=this.props,t=e.activeId,n=e.disabled,r=e.hasTags,o=e.inlineTags,a=e.instanceId,i=e.isExpanded,c=e.isSearchable,s=e.listboxId,l=e.onSearch,u=e.placeholder,d=e.searchInputType,f=this.state.isActive;return Object(v.createElement)("input",{autoComplete:"off",className:"woocommerce-select-control__control-input",id:"woocommerce-select-control-".concat(a,"__control-input"),ref:this.input,type:c?d:"button",value:this.getInputValue(),placeholder:f?u:"",onChange:this.updateSearch(l),onFocus:this.onFocus(l),onBlur:this.onBlur,onKeyDown:this.onKeyDown,role:"combobox","aria-autocomplete":"list","aria-expanded":i,"aria-haspopup":"true","aria-owns":s,"aria-controls":s,"aria-activedescendant":t,"aria-describedby":r&&o?"search-inline-input-".concat(a):null,disabled:n})}},{key:"getInputValue",value:function(){var e=this.props,t=e.inlineTags,n=e.isFocused,r=e.isSearchable,o=e.multiple,a=e.query,i=e.selected,c=i.length?i[0].label:"";return o||n||t?r&&n&&a?a:"":c}},{key:"render",value:function(){var e=this,t=this.props,n=t.className,r=t.disabled,o=t.hasTags,a=t.help,i=t.inlineTags,c=t.instanceId,s=t.isSearchable,l=t.label,u=t.query,d=this.state.isActive;return Object(v.createElement)("div",{className:q()("components-base-control","woocommerce-select-control__control",n,{empty:!u||0===u.length,"is-active":d,"has-tags":i&&o,"with-value":this.getInputValue().length,"has-error":!!a,"is-disabled":r}),onClick:function(){e.input.current.focus()}},s&&Object(v.createElement)(ue,{className:"woocommerce-select-control__control-icon",icon:fe}),i&&Object(v.createElement)(ie,this.props),Object(v.createElement)("div",{className:"components-base-control__field"},!!l&&Object(v.createElement)("label",{htmlFor:"woocommerce-select-control-".concat(c,"__control-input"),className:"components-base-control__label"},l),this.renderInput(),i&&Object(v.createElement)("span",{id:"search-inline-input-".concat(c),className:"screen-reader-text"},Object(O.__)("Move backward for selected items",'woocommerce')),!!a&&Object(v.createElement)("p",{id:"woocommerce-select-control-".concat(c,"__help"),className:"components-base-control__help"},a)))}}]),o}(v.Component);pe.propTypes={hasTags:S.a.bool,help:S.a.oneOfType([S.a.string,S.a.node]),inlineTags:S.a.bool,isSearchable:S.a.bool,instanceId:S.a.number,label:S.a.string,listboxId:S.a.string,onBlur:S.a.func,onChange:S.a.func,onSearch:S.a.func,placeholder:S.a.string,query:S.a.string,selected:S.a.arrayOf(S.a.shape({key:S.a.oneOfType([S.a.number,S.a.string]).isRequired,label:S.a.string})),showAllOnFocus:S.a.bool};var he=pe;function me(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function ye(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?me(Object(n),!0).forEach((function(t){o()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):me(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var be={isExpanded:!1,isFocused:!1,query:""},ge=function(e){h()(o,e);var t,n,r=(t=o,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=g()(t);if(n){var o=g()(this).constructor;e=Reflect.construct(r,arguments,o)}else e=r.apply(this,arguments);return y()(this,e)});function o(e){var t;s()(this,o),t=r.call(this,e);var n=e.selected,a=e.options,i=e.excludeSelectedOptions;return t.state=ye(ye({},be),{},{searchOptions:[],selectedIndex:n&&null!=a&&a.length&&!i?a.findIndex((function(e){return e.key===n})):null}),t.bindNode=t.bindNode.bind(f()(t)),t.decrementSelectedIndex=t.decrementSelectedIndex.bind(f()(t)),t.incrementSelectedIndex=t.incrementSelectedIndex.bind(f()(t)),t.onAutofillChange=t.onAutofillChange.bind(f()(t)),t.updateSearchOptions=Object(_.debounce)(t.updateSearchOptions.bind(f()(t)),e.searchDebounceTime),t.search=t.search.bind(f()(t)),t.selectOption=t.selectOption.bind(f()(t)),t.setExpanded=t.setExpanded.bind(f()(t)),t.setNewValue=t.setNewValue.bind(f()(t)),t}return u()(o,[{key:"bindNode",value:function(e){this.node=e}},{key:"reset",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.getSelected(),t=this.props,n=t.multiple,r=t.excludeSelectedOptions,o=ye({},be);!n&&e.length&&e[0].label&&(o.query=e[0].label,o.selectedIndex=r?null:this.props.options.findIndex((function(t){return t.key===e[0].key}))),this.setState(o)}},{key:"handleFocusOutside",value:function(){this.reset()}},{key:"hasMultiple",value:function(){var e=this.props,t=e.multiple,n=e.selected;return!!t&&(Array.isArray(n)?n.some((function(e){return Boolean(e.label)})):Boolean(n))}},{key:"getSelected",value:function(){var e=this.props,t=e.multiple,n=e.options,r=e.selected;if(t||Array.isArray(r))return r;var o=n.find((function(e){return e.key===r}));return o?[o]:[]}},{key:"selectOption",value:function(e){var t=this.props,n=t.multiple,r=t.selected,o=n?[].concat(i()(r),[e]):[e];this.reset(o),-1===(Array.isArray(r)?r:[{key:r}]).findIndex((function(t){return t.key===e.key}))&&this.setNewValue(o);var a=this.props.excludeSelectedOptions?null:this.getOptions().findIndex((function(t){return t.key===e.key}));this.setState({selectedIndex:a})}},{key:"setNewValue",value:function(e){var t=this.props,n=t.onChange,r=t.selected,o=t.multiple,a=this.state.query;o||Array.isArray(r)?n(e,a):n(e.length>0?e[0].key:"",a)}},{key:"decrementSelectedIndex",value:function(){var e=this.state.selectedIndex,t=this.getOptions(),n=null!==e?(0===e?t.length:e)-1:t.length-1;this.setState({selectedIndex:n})}},{key:"incrementSelectedIndex",value:function(){var e=this.state.selectedIndex,t=this.getOptions(),n=null!==e?(e+1)%t.length:0;this.setState({selectedIndex:n})}},{key:"announce",value:function(e){var t=this.props.debouncedSpeak;t&&(e.length?t(Object(O.sprintf)(Object(O._n)("%d result found, use up and down arrow keys to navigate.","%d results found, use up and down arrow keys to navigate.",e.length,'woocommerce'),e.length),"assertive"):t(Object(O.__)("No results.",'woocommerce'),"assertive"))}},{key:"getOptions",value:function(){var e=this.props,t=e.isSearchable,n=e.options,r=e.excludeSelectedOptions,o=this.state.searchOptions,a=this.getSelected().map((function(e){return e.key})),i=t?o:n;return r?i.filter((function(e){return!a.includes(e.key)})):i}},{key:"getOptionsByQuery",value:function(e,t){for(var n=this.props,r=n.getSearchExpression,o=n.maxResults,a=n.onFilter,c=[],s=r(Object(_.escapeRegExp)(t?t.trim():"")),l=s?new RegExp(s,"i"):/^$/,u=0;u<e.length;u++){var d=e[u],f=d.keywords,p=void 0===f?[]:f;if("string"==typeof d.label&&(p=[].concat(i()(p),[d.label])),p.some((function(e){return l.test(e)}))&&(c.push(d),o&&c.length===o))break}return a(c,t)}},{key:"setExpanded",value:function(e){this.setState({isExpanded:e})}},{key:"search",value:function(e){var t=this,n=this.cacheSearchOptions||[],r=null===e||e.length||this.props.hideBeforeSearch?this.getOptionsByQuery(n,e):n;this.setState({query:e,isFocused:!0,searchOptions:r,selectedIndex:(null==e?void 0:e.length)>0?null:this.state.selectedIndex},(function(){t.setState({isExpanded:Boolean(t.getOptions().length)})})),this.updateSearchOptions(e)}},{key:"updateSearchOptions",value:function(e){var t=this,n=this.props,r=n.hideBeforeSearch,o=n.options,a=n.onSearch,i=this.activePromise=Promise.resolve(a(o,e)).then((function(n){if(i===t.activePromise){t.cacheSearchOptions=n;var o=null===e||e.length||r?t.getOptionsByQuery(n,e):n;t.setState({searchOptions:o,selectedIndex:(null==e?void 0:e.length)>0?null:t.state.selectedIndex},(function(){t.setState({isExpanded:Boolean(t.getOptions().length)}),t.announce(o)}))}}))}},{key:"onAutofillChange",value:function(e){var t=this.props.options,n=this.getOptionsByQuery(t,e.target.value);1===n.length&&this.selectOption(n[0])}},{key:"render",value:function(){var e=this.props,t=e.autofill,n=e.children,r=e.className,o=e.disabled,a=e.controlClassName,i=e.inlineTags,c=e.instanceId,s=e.isSearchable,l=e.options,u=this.state,d=u.isExpanded,f=u.isFocused,p=u.selectedIndex,h=this.hasMultiple(),m=(l[p]||{}).key,y=void 0===m?"":m,b=d?"woocommerce-select-control__listbox-".concat(c):null,g=d?"woocommerce-select-control__option-".concat(c,"-").concat(y):null;return Object(v.createElement)("div",{className:q()("woocommerce-select-control",r,{"has-inline-tags":h&&i,"is-focused":f,"is-searchable":s}),ref:this.bindNode},t&&Object(v.createElement)("input",{onChange:this.onAutofillChange,name:t,type:"text",className:"woocommerce-select-control__autofill-input",tabIndex:"-1"}),n,Object(v.createElement)(he,T()({},this.props,this.state,{activeId:g,className:a,disabled:o,hasTags:h,isExpanded:d,listboxId:b,onSearch:this.search,selected:this.getSelected(),onChange:this.setNewValue,setExpanded:this.setExpanded,updateSearchOptions:this.updateSearchOptions,decrementSelectedIndex:this.decrementSelectedIndex,incrementSelectedIndex:this.incrementSelectedIndex})),!i&&h&&Object(v.createElement)(ie,T()({},this.props,{selected:this.getSelected()})),d&&Object(v.createElement)(te,T()({},this.props,this.state,{activeId:g,listboxId:b,node:this.node,onSelect:this.selectOption,onSearch:this.search,options:this.getOptions(),decrementSelectedIndex:this.decrementSelectedIndex,incrementSelectedIndex:this.incrementSelectedIndex,setExpanded:this.setExpanded})))}}]),o}(v.Component);ge.propTypes={autofill:S.a.string,children:S.a.node,className:S.a.string,controlClassName:S.a.string,disabled:S.a.bool,excludeSelectedOptions:S.a.bool,onFilter:S.a.func,getSearchExpression:S.a.func,help:S.a.oneOfType([S.a.string,S.a.node]),inlineTags:S.a.bool,isSearchable:S.a.bool,label:S.a.string,onChange:S.a.func,onSearch:S.a.func,options:S.a.arrayOf(S.a.shape({isDisabled:S.a.bool,key:S.a.oneOfType([S.a.number,S.a.string]).isRequired,keywords:S.a.arrayOf(S.a.oneOfType([S.a.string,S.a.number])),label:S.a.oneOfType([S.a.string,S.a.object]),value:S.a.any})).isRequired,placeholder:S.a.string,searchDebounceTime:S.a.number,selected:S.a.oneOfType([S.a.string,S.a.arrayOf(S.a.shape({key:S.a.oneOfType([S.a.number,S.a.string]).isRequired,label:S.a.string}))]),maxResults:S.a.number,multiple:S.a.bool,showClearButton:S.a.bool,searchInputType:S.a.oneOf(["text","search","number","email","tel","url"]),hideBeforeSearch:S.a.bool,showAllOnFocus:S.a.bool,staticList:S.a.bool},ge.defaultProps={autofill:null,excludeSelectedOptions:!0,getSearchExpression:_.identity,inlineTags:!1,isSearchable:!1,onChange:_.noop,onFilter:_.identity,onSearch:function(e){return Promise.resolve(e)},maxResults:0,multiple:!1,searchDebounceTime:0,searchInputType:"search",selected:[],showAllOnFocus:!1,showClearButton:!1,hideBeforeSearch:!1,staticList:!1};var ve=Object(Z.compose)([w.withSpokenMessages,Z.withInstanceId,w.withFocusOutside])(ge),Oe=n(23),we=n(15),_e=n.n(we);function ke(e,t){if(!t)return null;var n=e.toLocaleLowerCase().indexOf(t.toLocaleLowerCase());return{suggestionBeforeMatch:Object(ne.decodeEntities)(e.substring(0,n)),suggestionMatch:Object(ne.decodeEntities)(e.substring(n,n+t.length)),suggestionAfterMatch:Object(ne.decodeEntities)(e.substring(n+t.length))}}function Se(e){return[e.country,e.state,e.name||Object(O.__)("TAX",'woocommerce'),e.priority].filter(Boolean).map((function(e){return e.toString().toUpperCase().trim()})).join("-")}var je={name:"attributes",className:"woocommerce-search__product-result",options:function(e){var t=e?{search:e,per_page:10,orderby:"count"}:{};return _e()({path:Object(Oe.addQueryArgs)("/wc-analytics/products/attributes",t)})},isDebounced:!0,getOptionIdentifier:function(e){return e.id},getOptionKeywords:function(e){return[e.name]},getFreeTextOptions:function(e){return[{key:"name",label:Object(v.createElement)("span",{key:"name",className:"woocommerce-search__result-name"},D()({mixedString:Object(O.__)("All attributes with names that include {{query /}}",'woocommerce'),components:{query:Object(v.createElement)("strong",{className:"components-form-token-field__suggestion-match"},e)}})),value:{id:e,name:e}}]},getOptionLabel:function(e,t){var n=ke(e.name,t)||{};return Object(v.createElement)("span",{key:"name",className:"woocommerce-search__result-name","aria-label":e.name},n.suggestionBeforeMatch,Object(v.createElement)("strong",{className:"components-form-token-field__suggestion-match"},n.suggestionMatch),n.suggestionAfterMatch)},getOptionCompletion:function(e){return{key:e.id,label:e.name}}},Ee={name:"categories",className:"woocommerce-search__product-result",options:function(e){var t=e?{search:e,per_page:10,orderby:"count"}:{};return _e()({path:Object(Oe.addQueryArgs)("/wc-analytics/products/categories",t)})},isDebounced:!0,getOptionIdentifier:function(e){return e.id},getOptionKeywords:function(e){return[e.name]},getFreeTextOptions:function(e){return[{key:"title",label:Object(v.createElement)("span",{key:"name",className:"woocommerce-search__result-name"},D()({mixedString:Object(O.__)("All categories with titles that include {{query /}}",'woocommerce'),components:{query:Object(v.createElement)("strong",{className:"components-form-token-field__suggestion-match"},e)}})),value:{id:e,name:e}}]},getOptionLabel:function(e,t){var n=ke(e.name,t)||{};return Object(v.createElement)("span",{key:"name",className:"woocommerce-search__result-name","aria-label":e.name},n.suggestionBeforeMatch,Object(v.createElement)("strong",{className:"components-form-token-field__suggestion-match"},n.suggestionMatch),n.suggestionAfterMatch)},getOptionCompletion:function(e){return{key:e.id,label:e.name}}},Ce=n(523),De=n.n(Ce),Pe=function(e){var t=e.code,n=e.order,r=e.className,o=e.size,a=e.hideFromScreenReader,i=q()("woocommerce-flag",r),c=t||"unknown";n&&n.shipping&&n.shipping.country?c=n.shipping.country:n&&n.billing&&n.billing.country&&(c=n.billing.country);var s={fontSize:o},l=Object(_.get)(De.a.countryCode(c),"emoji");return Object(v.createElement)("div",{className:i,style:s,"aria-hidden":a},l&&Object(v.createElement)("span",null,l),!l&&Object(v.createElement)("span",{className:"woocommerce-flag__fallback"},"Invalid country flag"))};Pe.propTypes={code:S.a.string,order:S.a.object,className:S.a.string,size:S.a.number};var xe=Pe,Fe=null,Te={name:"countries",className:"woocommerce-search__country-result",isDebounced:!0,options:function(){return Fe?Promise.resolve(Fe):_e()({path:"/wc-analytics/data/countries"}).then((function(e){return Fe=e}))},getOptionIdentifier:function(e){return e.code},getSearchExpression:function(e){return"^"+e},getOptionKeywords:function(e){return[e.code,Object(ne.decodeEntities)(e.name)]},getOptionLabel:function(e,t){var n=Object(ne.decodeEntities)(e.name),r=ke(n,t)||{};return Object(v.createElement)(v.Fragment,null,Object(v.createElement)(xe,{key:"thumbnail",className:"woocommerce-search__result-thumbnail",code:e.code,size:18,hideFromScreenReader:!0}),Object(v.createElement)("span",{key:"name",className:"woocommerce-search__result-name","aria-label":n},t?Object(v.createElement)(v.Fragment,null,r.suggestionBeforeMatch,Object(v.createElement)("strong",{className:"components-form-token-field__suggestion-match"},r.suggestionMatch),r.suggestionAfterMatch):n))},getOptionCompletion:function(e){return{key:e.code,label:Object(ne.decodeEntities)(e.name)}}},Me={name:"coupons",className:"woocommerce-search__coupon-result",options:function(e){var t=e?{search:e,per_page:10}:{};return _e()({path:Object(Oe.addQueryArgs)("/wc-analytics/coupons",t)})},isDebounced:!0,getOptionIdentifier:function(e){return e.id},getOptionKeywords:function(e){return[e.code]},getFreeTextOptions:function(e){return[{key:"code",label:Object(v.createElement)("span",{key:"name",className:"woocommerce-search__result-name"},D()({mixedString:Object(O.__)("All coupons with codes that include {{query /}}",'woocommerce'),components:{query:Object(v.createElement)("strong",{className:"components-form-token-field__suggestion-match"},e)}})),value:{id:e,code:e}}]},getOptionLabel:function(e,t){var n=ke(e.code,t)||{};return Object(v.createElement)("span",{key:"name",className:"woocommerce-search__result-name","aria-label":e.code},n.suggestionBeforeMatch,Object(v.createElement)("strong",{className:"components-form-token-field__suggestion-match"},n.suggestionMatch),n.suggestionAfterMatch)},getOptionCompletion:function(e){return{key:e.id,label:e.code}}},Re={name:"customers",className:"woocommerce-search__customers-result",options:function(e){var t=e?{search:e,searchby:"name",per_page:10}:{};return _e()({path:Object(Oe.addQueryArgs)("/wc-analytics/customers",t)})},isDebounced:!0,getOptionIdentifier:function(e){return e.id},getOptionKeywords:function(e){return[e.name]},getFreeTextOptions:function(e){return[{key:"name",label:Object(v.createElement)("span",{key:"name",className:"woocommerce-search__result-name"},D()({mixedString:Object(O.__)("All customers with names that include {{query /}}",'woocommerce'),components:{query:Object(v.createElement)("strong",{className:"components-form-token-field__suggestion-match"},e)}})),value:{id:e,name:e}}]},getOptionLabel:function(e,t){var n=ke(e.name,t)||{};return Object(v.createElement)("span",{key:"name",className:"woocommerce-search__result-name","aria-label":e.name},n.suggestionBeforeMatch,Object(v.createElement)("strong",{className:"components-form-token-field__suggestion-match"},n.suggestionMatch),n.suggestionAfterMatch)},getOptionCompletion:function(e){return{key:e.id,label:e.name}}},Ie={name:"download-ips",className:"woocommerce-search__download-ip-result",options:function(e){var t=e?{match:e}:{};return _e()({path:Object(Oe.addQueryArgs)("/wc-analytics/data/download-ips",t)})},isDebounced:!0,getOptionIdentifier:function(e){return e.user_ip_address},getOptionKeywords:function(e){return[e.user_ip_address]},getOptionLabel:function(e,t){var n=ke(e.user_ip_address,t)||{};return Object(v.createElement)("span",{key:"name",className:"woocommerce-search__result-name","aria-label":e.user_ip_address},n.suggestionBeforeMatch,Object(v.createElement)("strong",{className:"components-form-token-field__suggestion-match"},n.suggestionMatch),n.suggestionAfterMatch)},getOptionCompletion:function(e){return{key:e.user_ip_address,label:e.user_ip_address}}},Ae={name:"emails",className:"woocommerce-search__emails-result",options:function(e){var t=e?{search:e,searchby:"email",per_page:10}:{};return _e()({path:Object(Oe.addQueryArgs)("/wc-analytics/customers",t)})},isDebounced:!0,getOptionIdentifier:function(e){return e.id},getOptionKeywords:function(e){return[e.email]},getOptionLabel:function(e,t){var n=ke(e.email,t)||{};return Object(v.createElement)("span",{key:"name",className:"woocommerce-search__result-name","aria-label":e.email},n.suggestionBeforeMatch,Object(v.createElement)("strong",{className:"components-form-token-field__suggestion-match"},n.suggestionMatch),n.suggestionAfterMatch)},getOptionCompletion:function(e){return{key:e.id,label:e.email}}},Ne={name:"orders",className:"woocommerce-search__order-result",options:function(e){var t=e?{number:e,per_page:10}:{};return _e()({path:Object(Oe.addQueryArgs)("/wc-analytics/orders",t)})},isDebounced:!0,getOptionIdentifier:function(e){return e.id},getOptionKeywords:function(e){return["#"+e.number]},getOptionLabel:function(e,t){var n=ke("#"+e.number,t)||{};return Object(v.createElement)("span",{key:"name",className:"woocommerce-search__result-name","aria-label":"#"+e.number},n.suggestionBeforeMatch,Object(v.createElement)("strong",{className:"components-form-token-field__suggestion-match"},n.suggestionMatch),n.suggestionAfterMatch)},getOptionCompletion:function(e){return{key:e.id,label:"#"+e.number}}},Le=function(e){var t=e.product,n=e.alt,r=e.width,o=e.height,a=e.className,i=R()(e,["product","alt","width","height","className"]),c=Object(_.get)(t,["images",0])||Object(_.get)(t,["image"]),s=c&&c.src||!1,l=n||c&&c.alt||"",u=q()("woocommerce-product-image",a,{"is-placeholder":!s});return Object(v.createElement)("img",T()({className:u,src:s||"data:image/svg+xml;utf8,%3Csvg width='421' height='421' xmlns='http://www.w3.org/2000/svg' xmlns:svg='http://www.w3.org/2000/svg'%3E%3Cstyle type='text/css'%3E.st0%7Bfill:url(%23SVGID_1_);stroke:%23717275;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10%7D .st1%7Bfill:%23FFFFFF;%7D .st2%7Bfill:%23717275;%7D .st3%7Bfill:%23DCDDE0;stroke:%23717275;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;%7D%3C/style%3E%3CradialGradient cx='105.8248' cy='287.7805' gradientUnits='userSpaceOnUse' id='SVGID_1_' r='372.6935'%3E%3Cstop offset='0.2613' stop-color='%23DCDDE0'/%3E%3Cstop offset='0.633' stop-color='%23D8DADD'/%3E%3Cstop offset='0.9665' stop-color='%23CECFD3'/%3E%3Cstop offset='1' stop-color='%23CCCED2'/%3E%3C/radialGradient%3E%3Cg class='layer' display='inline'%3E%3Ctitle%3ELayer 2%3C/title%3E%3Crect fill='%23ffffff' height='417.99996' id='svg_7' stroke-dasharray='null' stroke-linecap='null' stroke-linejoin='null' stroke-width='null' width='417.99996' x='1.50002' y='1.5'/%3E%3C/g%3E%3Cg class='layer' display='inline'%3E%3Ctitle%3ELayer 1%3C/title%3E%3Cg id='svg_2'/%3E%3Cg id='svg_6'%3E%3Cpath class='st0' d='m330.44409,336.12693c-0.12194,0.36582 0,0.67068 0.30485,0.79262c1.40232,-0.79262 3.17047,-1.0365 4.63377,-0.48776c0.67068,-1.46329 0.12194,-2.43882 0.06097,-3.90212c-0.91456,-15.66945 -0.73165,-31.9486 -0.73165,-47.73998c0,-16.34012 -0.30485,-32.74121 0.54874,-48.9594c0.79262,-15.9743 1.89009,-31.5218 1.28038,-47.55707c-0.60971,-15.79139 -0.06097,-31.70471 0.73165,-47.37416c0.36582,-8.04812 0.79262,-15.66945 0.36582,-23.77854c-0.48776,-9.08462 -0.36582,-21.88845 -0.36582,-30.97307c0,-1.0365 0.18291,-1.82912 -0.79262,-2.43882c-0.79262,-0.48776 -1.52427,-0.42679 -2.43882,-0.42679c-2.49979,0 -4.87765,-0.36582 -7.37744,-0.36582c-1.52427,0 -2.86562,0 -4.32891,0.30485c-0.79262,0.12194 -1.52427,0.06097 -2.31688,0.06097c-0.85359,0 -1.52427,0.18291 -2.31688,0.36582c-6.88968,1.15844 -15.73042,2.49979 -22.62009,1.76815c-6.88968,-0.73165 -13.71839,-0.67068 -20.54709,-2.01203c-6.46288,-1.28038 -12.92577,-0.42679 -19.38865,-0.42679c-4.146,0 -8.23103,0 -12.37703,0c-3.96309,0 -7.80424,-0.73165 -11.8283,-0.73165c-6.52385,0.06097 -13.10868,0.12194 -19.63253,0.36582c-4.51182,0.18291 -8.84074,0 -13.35256,0.42679c-6.82871,0.60971 -13.77936,1.09747 -20.66903,1.0365c-3.59727,0 -7.07259,0.24388 -10.60889,-0.42679c-3.17047,-0.60971 -6.58483,-0.12194 -9.7553,0.18291c-3.96309,0.36582 -7.86521,1.0365 -11.8283,1.0365c-3.84115,-0.06097 -7.74327,-0.85359 -11.58441,-0.85359c-4.38988,-0.12194 -8.59686,0.42679 -12.98674,0.12194c-5.36541,-0.36582 -10.60889,-0.06097 -15.91333,-0.12194c-0.91456,0 -1.34135,0.24388 -2.13397,0.36582c-0.79262,0.12194 -1.40232,0.36582 -2.19494,0.36582c-0.85359,0 -1.34135,-0.30485 -2.13397,-0.36582c-1.64621,-0.18291 -5.91415,-0.06097 -7.49938,-0.48776c-1.70718,-0.42679 -3.41435,-0.91456 -5.12153,-1.34135c-1.40232,1.34135 -1.52427,3.5363 -1.64621,5.48735c-0.85359,21.58359 -0.73165,43.16719 -0.60971,64.75078c0,4.99959 0.06097,9.99918 0.60971,14.9378c0.42679,3.84115 1.15844,7.6823 1.46329,11.52344c0.48776,6.219 -0.06097,12.49897 -0.36582,18.71798c-0.36582,7.31647 -0.36582,14.63295 0.06097,21.94942c0.97553,18.90089 -0.48776,40.30157 -0.79262,59.20246c-0.36582,18.41312 -0.67068,37.1311 3.90212,54.99549c4.63377,-1.82912 17.13274,1.15844 22.55912,1.40232c5.85318,0.24388 11.8283,0.30485 17.74245,0.30485c6.76774,0 13.59644,-0.36582 20.30321,0c8.47491,0.42679 16.09624,2.31688 24.63212,1.82912c4.146,-0.24388 8.65783,0.36582 12.68189,0.36582c3.29241,0 9.87724,-1.09747 12.25509,0.73165c8.77977,0 20.18127,0.12194 28.90007,-0.73165c9.08462,-0.85359 19.38865,-1.21941 28.47327,-0.36582c7.37744,0.73165 14.45003,1.34135 21.82748,0.36582c4.63377,-0.60971 9.14559,-1.09747 13.9013,-1.09747c4.32891,0 8.292,-1.58524 12.49897,-1.46329c4.63377,0.12194 9.38947,1.40232 14.02324,1.89009c3.04853,0.30485 9.63336,-2.49979 12.49897,-1.21941l-0.00003,-0.00001z' fill='black' id='svg_1'/%3E%3Cpath class='st1' d='m313.79912,275.40021c-1.09747,0 -3.90212,-4.20697 -4.99959,-5.85318c-0.42679,-0.67068 -0.79262,-1.21941 -1.0365,-1.52427c-1.76815,-2.25591 -4.02406,-4.51182 -6.219,-6.6458c-0.67068,-0.67068 -1.40232,-1.40232 -2.073,-2.073c-3.5363,-3.59727 -9.02365,-7.98715 -13.16965,-9.51141c-1.40232,-0.48776 -2.56077,-1.21941 -3.71921,-1.82912c-2.19494,-1.28038 -4.20697,-2.43882 -7.49938,-2.49979c-0.30485,0 -0.67068,0 -0.97553,0c-3.78018,0 -7.49938,0.48776 -11.34053,1.09747c-7.19453,1.09747 -16.82789,7.49938 -21.52262,14.32809c-0.73165,1.09747 -1.15844,2.31688 -1.21941,3.5363c-2.31688,-0.54874 -5.6093,-3.17047 -7.62133,-4.75571c-0.30485,-0.24388 -0.60971,-0.48776 -0.85359,-0.67068c-2.74368,-2.13397 -4.75571,-4.5728 -6.95065,-7.2555c-1.28038,-1.52427 -2.62174,-3.1095 -4.08503,-4.63377c-7.92618,-8.17006 -16.88886,-15.48653 -25.54668,-22.55912c-4.51182,-3.65824 -9.14559,-7.43841 -13.59644,-11.27956c-5.79221,-4.99959 -10.365,-9.81627 -14.45003,-15.12071c-0.42679,-0.54874 -0.85359,-1.09747 -1.21941,-1.64621c-1.58524,-2.13397 -3.23144,-4.26794 -5.12153,-6.15803c-0.67068,-0.67068 -2.31688,-1.89009 -4.20697,-3.23144c-2.98756,-2.19494 -7.56035,-5.48735 -7.92618,-6.70677c-0.42679,-1.40232 -3.5363,-3.5363 -3.59727,-3.5363c-0.85359,-0.48776 -1.76815,-1.40232 -1.82912,-2.62174l-0.06097,-0.85359l-0.79262,0.36582c-2.86562,1.34135 -4.93862,3.41435 -7.07259,5.6093c-0.36582,0.36582 -0.67068,0.73165 -1.0365,1.0365c-5.67027,5.73124 -11.15762,11.64539 -16.27915,17.49856c-2.49979,2.86562 -5.12153,6.03609 -7.31647,9.38947c-0.60971,0.91456 -1.15844,2.01203 -1.70718,3.17047c-0.91456,1.89009 -1.89009,3.84115 -3.04853,4.99959c-0.36582,-0.54874 -0.73165,-1.64621 -0.91456,-2.13397c-0.06097,-0.18291 -0.12194,-0.42679 -0.18291,-0.54874c-1.28038,-3.17047 -0.79262,-6.52385 -0.30485,-10.06015c0.36582,-2.49979 0.73165,-4.99959 0.48776,-7.62133c-0.12194,-0.97553 -0.30485,-2.01203 -0.48776,-3.04853c-0.60971,-3.47532 -1.21941,-7.01162 -0.73165,-10.24306c1.21941,-9.63336 2.43882,-19.51059 3.04853,-29.32686c0.97553,-9.69433 0.42679,-18.83992 -0.18291,-28.53424c-0.12194,-2.43882 -0.30485,-4.99959 -0.42679,-7.49938c0,-1.0365 -0.06097,-2.13397 -0.06097,-3.17047c-0.12194,-3.17047 -0.24388,-6.219 0.60971,-9.20656c0.18291,-0.12194 0.48776,-0.30485 0.85359,-0.36582l2.37785,1.0365c2.25591,0.91456 5.1825,1.40232 8.90171,1.40232c3.41435,0 7.01162,-0.36582 10.54791,-0.73165c3.23144,-0.30485 6.34094,-0.60971 9.02365,-0.60971c0.67068,0 1.28038,0 1.89009,0.06097c1.52427,0.12194 3.04853,0.30485 4.51182,0.48776c2.13397,0.24388 4.38988,0.54874 6.58483,0.54874c0.54874,0 1.09747,0 1.58524,0c3.90212,0 7.92618,-0.18291 11.76733,-0.36582c3.17047,-0.12194 6.46288,-0.30485 9.69433,-0.36582c5.48735,-0.06097 11.09665,-0.36582 16.46206,-0.60971c2.25591,-0.12194 4.45085,-0.24388 6.70677,-0.30485c4.38988,-0.18291 8.90171,-0.18291 13.23062,-0.18291c3.1095,0 6.34094,0 9.57238,-0.06097c6.6458,-0.18291 13.35256,-0.54874 19.81545,-0.97553c6.88968,-0.42679 14.08421,-0.85359 21.09583,-0.97553c1.76815,-0.06097 3.5363,-0.06097 5.24347,-0.06097c3.84115,-0.06097 7.80424,-0.06097 11.76733,-0.30485c2.25591,-0.12194 4.5728,-0.36582 6.82871,-0.54874c3.78018,-0.36582 7.74327,-0.67068 11.58441,-0.67068c1.40232,0 2.74368,0.06097 4.02406,0.12194c1.89009,0.12194 3.78018,0.48776 5.79221,0.85359c2.62174,0.48776 5.30444,0.91456 7.92618,0.91456c0.67068,0 1.34135,-0.06097 1.95106,-0.12194c-0.73165,1.40232 -0.73165,3.17047 -0.67068,4.08503c0.12194,2.31688 0.12194,4.81668 0.12194,7.19453c0,9.38947 -0.97553,18.29118 -2.01203,27.74163c-0.36582,3.23144 -0.73165,6.6458 -1.0365,9.99918c-0.60971,13.65742 0,28.10745 0.60971,40.8503l0,4.63377c0.30485,4.146 0,8.23103 -0.30485,12.13315c-0.30485,3.90212 -0.60971,7.92618 -0.30485,11.95024c1.28038,12.07218 1.82912,23.71757 1.64621,34.6313l0.42679,10.60889l0.06097,0.06097c0.48776,1.34135 0.97553,6.95065 -0.24388,8.77977c-0.36582,0.42679 -0.60971,0.48776 -0.79262,0.48776l0,0l-0.00004,0.00002z' id='svg_3'/%3E%3Cpath class='st2' d='m296.54444,101.02428c1.40232,0 2.68271,0.06097 3.96309,0.12194c1.82912,0.12194 3.71921,0.48776 5.73124,0.79262c2.62174,0.48776 5.36541,0.97553 8.04812,0.97553c0.36582,0 0.67068,0 1.0365,0c-0.36582,1.21941 -0.36582,2.49979 -0.36582,3.41435c0.12194,2.31688 0.12194,4.75571 0.12194,7.13356c0,9.38947 -0.97553,18.29118 -2.01203,27.68065c-0.36582,3.29241 -0.73165,6.6458 -1.0365,9.99918l0,0l0,0c-0.60971,13.59644 0,28.10745 0.60971,40.8503l0,4.63377l0,0.06097l0,0.06097c0.30485,4.02406 0,8.10909 -0.30485,12.01121c-0.30485,3.90212 -0.60971,7.98715 -0.30485,12.01121l0,0l0,0c1.28038,12.01121 1.82912,23.65659 1.64621,34.50936l0,0.06097l0,0.06097l0.42679,10.48694l0,0.18291l0.06097,0.18291c0.48776,1.34135 0.85359,6.70677 -0.18291,8.292c-0.06097,0.06097 -0.12194,0.18291 -0.18291,0.18291c-1.0365,-0.36582 -3.65824,-4.26794 -4.51182,-5.54833c-0.48776,-0.67068 -0.79262,-1.21941 -1.09747,-1.58524c-1.82912,-2.31688 -4.08503,-4.51182 -6.219,-6.70677c-0.67068,-0.67068 -1.40232,-1.34135 -2.073,-2.073c-3.59727,-3.65824 -9.14559,-8.04812 -13.41353,-9.63336c-1.34135,-0.48776 -2.49979,-1.15844 -3.59727,-1.82912c-2.13397,-1.21941 -4.32891,-2.49979 -7.80424,-2.62174c-0.30485,0 -0.67068,0 -0.97553,0c-3.84115,0 -7.56035,0.48776 -11.46247,1.09747c-7.37744,1.09747 -17.19371,7.62133 -21.94942,14.57197c-0.67068,0.97553 -1.09747,2.01203 -1.28038,3.1095c-2.13397,-0.79262 -4.93862,-3.04853 -6.70677,-4.45085c-0.30485,-0.24388 -0.60971,-0.48776 -0.85359,-0.67068c-2.68271,-2.073 -4.69474,-4.51182 -6.88968,-7.13356c-1.28038,-1.52427 -2.62174,-3.1095 -4.08503,-4.69474c-7.92618,-8.17006 -16.88886,-15.48653 -25.60765,-22.55912c-4.51182,-3.65824 -9.14559,-7.43841 -13.53547,-11.27956c-5.73124,-4.99959 -10.30403,-9.7553 -14.38906,-15.05974c-0.42679,-0.54874 -0.85359,-1.09747 -1.21941,-1.64621c-1.58524,-2.13397 -3.29241,-4.32891 -5.1825,-6.219c-0.73165,-0.73165 -2.31688,-1.89009 -4.26794,-3.29241c-2.37785,-1.70718 -7.31647,-5.30444 -7.6823,-6.40191c-0.48776,-1.70718 -3.84115,-3.90212 -3.84115,-3.90212c-0.67068,-0.42679 -1.46329,-1.15844 -1.52427,-2.13397l-0.12194,-1.70718l-1.58524,0.73165c-2.98756,1.34135 -5.1825,3.59727 -7.2555,5.73124c-0.36582,0.36582 -0.67068,0.73165 -1.0365,1.0365c-5.67027,5.73124 -11.15762,11.64539 -16.27915,17.49856c-2.56077,2.92659 -5.1825,6.09706 -7.37744,9.45044c-0.60971,0.91456 -1.15844,2.073 -1.76815,3.29241c-0.73165,1.46329 -1.46329,3.04853 -2.37785,4.146c-0.18291,-0.48776 -0.42679,-0.97553 -0.48776,-1.28038c-0.06097,-0.24388 -0.18291,-0.42679 -0.24388,-0.54874c-1.21941,-2.98756 -0.79262,-6.27997 -0.24388,-9.69433c0.36582,-2.49979 0.73165,-5.12153 0.48776,-7.74327l0,0l0,0c-0.12194,-0.97553 -0.30485,-1.95106 -0.48776,-2.98756c-0.60971,-3.41435 -1.15844,-6.95065 -0.73165,-10.06015c1.21941,-9.63336 2.43882,-19.51059 3.04853,-29.32686c0.97553,-9.7553 0.42679,-18.90089 -0.18291,-28.65618c-0.12194,-2.43882 -0.30485,-4.93862 -0.42679,-7.43841c0,-1.09747 -0.06097,-2.13397 -0.06097,-3.23144c-0.12194,-3.04853 -0.18291,-5.97512 0.54874,-8.84074c0.06097,-0.06097 0.18291,-0.06097 0.24388,-0.12194l2.25591,0.97553c2.31688,0.97553 5.30444,1.46329 9.14559,1.46329c3.41435,0 7.07259,-0.36582 10.60889,-0.73165c3.23144,-0.30485 6.27997,-0.60971 8.96268,-0.60971c0.67068,0 1.28038,0 1.82912,0.06097c1.46329,0.12194 2.98756,0.30485 4.45085,0.42679c2.19494,0.24388 4.38988,0.54874 6.6458,0.54874c0.54874,0 1.09747,0 1.58524,0c3.96309,0 7.92618,-0.18291 11.76733,-0.36582c3.17047,-0.12194 6.46288,-0.30485 9.69433,-0.36582c5.48735,-0.06097 11.09665,-0.36582 16.46206,-0.60971c2.25591,-0.12194 4.45085,-0.24388 6.70677,-0.30485c4.38988,-0.18291 8.84074,-0.18291 13.16965,-0.18291c3.1095,0 6.40191,0 9.57238,-0.06097c6.6458,-0.18291 13.35256,-0.54874 19.87642,-0.97553c6.88968,-0.42679 14.02324,-0.85359 21.09583,-0.97553c1.76815,-0.06097 3.5363,-0.06097 5.24347,-0.06097c3.84115,-0.06097 7.86521,-0.06097 11.76733,-0.30485c2.31688,-0.12194 4.63377,-0.36582 6.88968,-0.54874c3.78018,-0.30485 7.74327,-0.67068 11.52344,-0.67068l0,0m0,-1.21941c-6.15803,0 -12.31606,0.85359 -18.47409,1.21941c-5.67027,0.30485 -11.34053,0.24388 -16.94983,0.36582c-13.65742,0.24388 -27.25386,1.58524 -40.97225,1.95106c-7.62133,0.18291 -15.18168,-0.06097 -22.80301,0.30485c-7.74327,0.30485 -15.42556,0.79262 -23.16883,0.91456c-7.13356,0.12194 -14.26712,0.73165 -21.46165,0.73165c-0.54874,0 -1.0365,0 -1.58524,0c-3.71921,-0.06097 -7.37744,-0.73165 -11.03568,-1.0365c-0.60971,-0.06097 -1.21941,-0.06097 -1.89009,-0.06097c-5.6093,0 -13.04771,1.34135 -19.51059,1.34135c-3.23144,0 -6.27997,-0.30485 -8.7188,-1.34135l-2.49979,-1.09747c-0.91456,0 -1.52427,0.60971 -1.52427,0.60971c-1.21941,4.26794 -0.60971,8.53588 -0.60971,12.80383c0.60971,12.19412 1.82912,23.77854 0.60971,35.97266c-0.60971,9.7553 -1.82912,19.51059 -3.04853,29.26589c-0.60971,4.26794 0.60971,9.14559 1.21941,13.41353c0.60971,6.09706 -2.43882,12.19412 -0.12194,17.80342c0.30485,0.73165 0.97553,2.80465 1.64621,3.29241c2.31688,-1.70718 3.65824,-6.15803 5.30444,-8.7188c2.13397,-3.29241 4.75571,-6.46288 7.2555,-9.3285c5.24347,-5.97512 10.66986,-11.8283 16.21818,-17.43759c2.49979,-2.49979 4.69474,-5.06056 7.92618,-6.58483c0.12194,1.34135 1.0365,2.43882 2.13397,3.1095c0.24388,0.12194 2.98756,2.073 3.29241,3.17047c0.60971,2.19494 10.42597,8.35297 12.25509,10.24306c2.37785,2.37785 4.32891,5.12153 6.34094,7.74327c4.38988,5.67027 9.14559,10.54791 14.57197,15.24265c12.98674,11.27956 27.07095,21.40068 39.08216,33.77771c3.90212,4.02406 6.6458,8.47491 11.09665,11.88927c2.31688,1.82912 6.6458,5.48735 9.51141,5.67027c-0.12194,-1.40232 0.36582,-2.74368 1.15844,-3.90212c4.32891,-6.34094 13.65742,-12.92577 21.09583,-14.08421c3.65824,-0.54874 7.49938,-1.09747 11.27956,-1.09747c0.30485,0 0.60971,0 0.97553,0c4.81668,0.12194 6.95065,2.80465 10.97471,4.32891c4.26794,1.58524 9.69433,6.03609 12.98674,9.38947c2.74368,2.80465 5.85318,5.67027 8.17006,8.65783c0.97553,1.28038 4.63377,7.56035 6.52385,7.56035c0,0 0.06097,0 0.06097,0c2.74368,-0.18291 2.073,-8.41394 1.46329,-10.12112l-0.42679,-10.48694c0.18291,-11.52344 -0.42679,-23.10786 -1.64621,-34.69227c-0.60971,-7.92618 1.21941,-15.85236 0.60971,-24.02242l0,-4.69474c-0.60971,-13.35256 -1.21941,-27.3758 -0.60971,-40.78933c1.21941,-12.80383 3.04853,-24.99795 3.04853,-37.80177c0,-2.43882 0,-4.87765 -0.12194,-7.19453c-0.06097,-1.58524 0.12194,-3.84115 1.52427,-4.87765c-1.09747,0.24388 -2.25591,0.30485 -3.41435,0.30485c-4.5728,0 -9.26753,-1.46329 -13.65742,-1.76815c-1.34135,0.12194 -2.68271,0.06097 -4.08503,0.06097l0,0l0.00003,0zm22.80301,1.09747c-0.67068,0 -1.21941,0.18291 -1.64621,0.48776c0.60971,-0.12194 1.21941,-0.30485 1.82912,-0.48776c-0.06097,0 -0.12194,0 -0.18291,0l0,0z' id='svg_4'/%3E%3Cpath class='st3' d='m235.75674,146.69126c-3.1095,3.41435 -4.38988,9.81627 -4.81668,14.20615c-0.60971,6.03609 -1.46329,10.97471 2.74368,15.66945c4.63377,5.12153 12.55994,9.87724 19.20574,11.64539c3.47532,0.97553 7.49938,-0.73165 10.7918,-1.40232c7.92618,-1.70718 11.95024,-6.52385 15.42556,-13.9013c4.20697,-8.77977 0.67068,-15.73042 -2.86562,-23.96145c-3.84115,-8.90171 -15.5475,-12.92577 -24.81504,-11.70636c-3.78018,0.48776 -5.91415,2.80465 -8.90171,4.87765c-1.64621,1.15844 -6.52385,2.80465 -6.76774,4.5728l0.00001,-0.00001z' id='svg_5'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E",width:r,height:o,alt:l},i))};Le.propTypes={width:S.a.number,height:S.a.number,className:S.a.string,product:S.a.object,alt:S.a.string},Le.defaultProps={width:33,height:33,className:""};var Ue=Le,Be={name:"products",className:"woocommerce-search__product-result",options:function(e){var t=e?{search:e,per_page:10,orderby:"popularity"}:{};return _e()({path:Object(Oe.addQueryArgs)("/wc-analytics/products",t)})},isDebounced:!0,getOptionIdentifier:function(e){return e.id},getOptionKeywords:function(e){return[e.name,e.sku]},getFreeTextOptions:function(e){return[{key:"title",label:Object(v.createElement)("span",{key:"name",className:"woocommerce-search__result-name"},D()({mixedString:Object(O.__)("All products with titles that include {{query /}}",'woocommerce'),components:{query:Object(v.createElement)("strong",{className:"components-form-token-field__suggestion-match"},e)}})),value:{id:e,name:e}}]},getOptionLabel:function(e,t){var n=ke(e.name,t)||{};return Object(v.createElement)(v.Fragment,null,Object(v.createElement)(Ue,{key:"thumbnail",className:"woocommerce-search__result-thumbnail",product:e,width:18,height:18,alt:""}),Object(v.createElement)("span",{key:"name",className:"woocommerce-search__result-name","aria-label":e.name},n.suggestionBeforeMatch,Object(v.createElement)("strong",{className:"components-form-token-field__suggestion-match"},n.suggestionMatch),n.suggestionAfterMatch))},getOptionCompletion:function(e){return{key:e.id,label:e.name}}},He={name:"taxes",className:"woocommerce-search__tax-result",options:function(e){var t=e?{code:e,per_page:10}:{};return _e()({path:Object(Oe.addQueryArgs)("/wc-analytics/taxes",t)})},isDebounced:!0,getOptionIdentifier:function(e){return e.id},getOptionKeywords:function(e){return[e.id,Se(e)]},getFreeTextOptions:function(e){return[{key:"code",label:Object(v.createElement)("span",{key:"name",className:"woocommerce-search__result-name"},D()({mixedString:Object(O.__)("All taxes with codes that include {{query /}}",'woocommerce'),components:{query:Object(v.createElement)("strong",{className:"components-form-token-field__suggestion-match"},e)}})),value:{id:e,name:e}}]},getOptionLabel:function(e,t){var n=ke(Se(e),t)||{};return Object(v.createElement)("span",{key:"name",className:"woocommerce-search__result-name","aria-label":e.code},n.suggestionBeforeMatch,Object(v.createElement)("strong",{className:"components-form-token-field__suggestion-match"},n.suggestionMatch),n.suggestionAfterMatch)},getOptionCompletion:function(e){return{key:e.id,label:Se(e)}}},qe={name:"usernames",className:"woocommerce-search__usernames-result",options:function(e){var t=e?{search:e,searchby:"username",per_page:10}:{};return _e()({path:Object(Oe.addQueryArgs)("/wc-analytics/customers",t)})},isDebounced:!0,getOptionIdentifier:function(e){return e.id},getOptionKeywords:function(e){return[e.username]},getOptionLabel:function(e,t){var n=ke(e.username,t)||{};return Object(v.createElement)("span",{key:"name",className:"woocommerce-search__result-name","aria-label":e.username},n.suggestionBeforeMatch,Object(v.createElement)("strong",{className:"components-form-token-field__suggestion-match"},n.suggestionMatch),n.suggestionAfterMatch)},getOptionCompletion:function(e){return{key:e.id,label:e.username}}};function ze(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Ve(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ze(Object(n),!0).forEach((function(t){o()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ze(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Ke=Ve(Ve({},Be),{},{name:"products",options:function(e){var t=e?{search:e,per_page:10,orderby:"popularity",type:"variable"}:{};return _e()({path:Object(Oe.addQueryArgs)("/wc-analytics/products",t)})}});function We(e){var t=e.attributes,n=e.name,r=window.wcSettings.variationTitleAttributesSeparator||" - ";if(n.indexOf(r)>-1)return n;var o=t.map((function(e){return e.option})).join(", ");return o?n+r+o:n}var Ge={name:"variations",className:"woocommerce-search__product-result",options:function(e){var t=e?{search:e,per_page:30,_fields:["attributes","description","id","name","sku"]}:{},n=Object(P.i)().products;return n?(n.includes(",")&&console.warn("Invalid product id supplied to Variations autocompleter"),_e()({path:Object(Oe.addQueryArgs)("/wc-analytics/products/".concat(n,"/variations"),t)})):_e()({path:Object(Oe.addQueryArgs)("/wc-analytics/variations",t)})},isDebounced:!0,getOptionIdentifier:function(e){return e.id},getOptionKeywords:function(e){return[We(e),e.sku]},getOptionLabel:function(e,t){var n=ke(We(e),t)||{};return Object(v.createElement)(v.Fragment,null,Object(v.createElement)(Ue,{key:"thumbnail",className:"woocommerce-search__result-thumbnail",product:e,width:18,height:18,alt:""}),Object(v.createElement)("span",{key:"name",className:"woocommerce-search__result-name","aria-label":e.description},n.suggestionBeforeMatch,Object(v.createElement)("strong",{className:"components-form-token-field__suggestion-match"},n.suggestionMatch),n.suggestionAfterMatch))},getOptionCompletion:function(e){return{key:e.id,label:We(e)}}};var Ye=function(e){h()(o,e);var t,n,r=(t=o,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=g()(t);if(n){var o=g()(this).constructor;e=Reflect.construct(r,arguments,o)}else e=r.apply(this,arguments);return y()(this,e)});function o(e){var t;return s()(this,o),(t=r.call(this,e)).state={options:[]},t.appendFreeTextSearch=t.appendFreeTextSearch.bind(f()(t)),t.fetchOptions=t.fetchOptions.bind(f()(t)),t.updateSelected=t.updateSelected.bind(f()(t)),t}return u()(o,[{key:"getAutocompleter",value:function(){switch(this.props.type){case"attributes":return je;case"categories":return Ee;case"countries":return Te;case"coupons":return Me;case"customers":return Re;case"downloadIps":return Ie;case"emails":return Ae;case"orders":return Ne;case"products":return Be;case"taxes":return He;case"usernames":return qe;case"variableProducts":return Ke;case"variations":return Ge;case"custom":if(!this.props.autocompleter||"object"!==$()(this.props.autocompleter))throw new Error("Invalid autocompleter provided to Search component, it requires a completer object when using 'custom' type.");return this.props.autocompleter;default:return{}}}},{key:"getFormattedOptions",value:function(e,t){var n=this.getAutocompleter(),r=[];return e.forEach((function(e){var o={key:n.getOptionIdentifier(e),label:n.getOptionLabel(e,t),keywords:n.getOptionKeywords(e).filter(Boolean),value:e};r.push(o)})),r}},{key:"fetchOptions",value:function(e,t){var n=this;if(!t)return[];var r=this.getAutocompleter().options;return Promise.resolve("function"==typeof r?r(t):r||[]).then(function(){var e=G()(J.a.mark((function e(r){var o;return J.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=n.getFormattedOptions(r,t),n.setState({options:o}),e.abrupt("return",o);case 3:case"end":return e.stop()}}),e)})));return function(_x){return e.apply(this,arguments)}}())}},{key:"updateSelected",value:function(e){var t=this.props.onChange,n=this.getAutocompleter();t(e.map((function(e){return e.value?n.getOptionCompletion(e.value):e})))}},{key:"appendFreeTextSearch",value:function(e,t){var n=this.props.allowFreeTextSearch;if(!t||!t.length)return[];if(!n)return e;var r=this.getAutocompleter();return[].concat(i()(r.getFreeTextOptions(t)),i()(e))}},{key:"render",value:function(){var e=this.getAutocompleter(),t=this.props,n=t.className,r=t.inlineTags,o=t.placeholder,a=t.selected,i=t.showClearButton,c=t.staticResults,s=t.disabled,l=t.multiple,u=this.state.options,d=e.inputType?e.inputType:"text";return Object(v.createElement)("div",null,Object(v.createElement)(ve,{className:q()("woocommerce-search",n,{"is-static-results":c}),disabled:s,hideBeforeSearch:!0,inlineTags:r,isSearchable:!0,getSearchExpression:e.getSearchExpression,multiple:l,placeholder:o,onChange:this.updateSelected,onFilter:this.appendFreeTextSearch,onSearch:this.fetchOptions,options:u,searchDebounceTime:500,searchInputType:d,selected:a,showClearButton:i}))}}]),o}(v.Component);Ye.propTypes={allowFreeTextSearch:S.a.bool,className:S.a.string,onChange:S.a.func,type:S.a.oneOf(["attributes","categories","countries","coupons","customers","downloadIps","emails","orders","products","taxes","usernames","variableProducts","variations","custom"]).isRequired,autocompleter:S.a.object,placeholder:S.a.string,selected:S.a.oneOfType([S.a.string,S.a.arrayOf(S.a.shape({key:S.a.oneOfType([S.a.number,S.a.string]).isRequired,label:S.a.string}))]),inlineTags:S.a.bool,showClearButton:S.a.bool,staticResults:S.a.bool,disabled:S.a.bool},Ye.defaultProps={allowFreeTextSearch:!1,onChange:_.noop,selected:[],inlineTags:!1,showClearButton:!1,staticResults:!1,disabled:!1,multiple:!0};var $e=Ye;function Qe(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Je(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Qe(Object(n),!0).forEach((function(t){o()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Qe(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Ze=function(e){h()(o,e);var t,n,r=(t=o,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=g()(t);if(n){var o=g()(this).constructor;e=Reflect.construct(r,arguments,o)}else e=r.apply(this,arguments);return y()(this,e)});function o(e){var t,n=e.filter,a=e.config,i=e.query;return s()(this,o),(t=r.apply(this,arguments)).onSearchChange=t.onSearchChange.bind(f()(t)),t.state={selected:[]},t.updateLabels=t.updateLabels.bind(f()(t)),n.value.length&&a.input.getLabels(n.value,i).then((function(e){var n=e.map((function(e){return Je({key:e.id},e)}));t.updateLabels(n)})),t}return u()(o,[{key:"componentDidUpdate",value:function(e){var t=this.props,n=t.config,r=t.filter,o=t.query,a=e.filter;if(r.value.length&&!Object(_.isEqual)(a,r)){var i=this.state.selected.map((function(e){return e.key}));Object(P.f)(r.value).every((function(e){return!i.includes(e)}))&&n.input.getLabels(r.value,o).then(this.updateLabels)}}},{key:"updateLabels",value:function(e){var t=this.state.selected.map((function(e){return e.key})),n=e.map((function(e){return e.key}));Object(_.isEqual)(n.sort(),t.sort())||this.setState({selected:e})}},{key:"onSearchChange",value:function(e){this.setState({selected:e}),(0,this.props.onFilterChange)("value",e.map((function(e){return e.key})).join(","))}},{key:"getScreenReaderText",value:function(e,t){var n=this.state.selected;if(0===n.length)return"";var r=Object(_.find)(t.rules,{value:e.rule})||{},o=n.map((function(e){return e.label})).join(", ");return z(D()({mixedString:t.labels.title,components:{filter:Object(v.createElement)(v.Fragment,null,o),rule:Object(v.createElement)(v.Fragment,null,r.label),title:Object(v.createElement)(v.Fragment,null)}}))}},{key:"render",value:function(){var e=this.props,t=e.className,n=e.config,r=e.filter,o=e.onFilterChange,a=e.isEnglish,i=this.state.selected,c=r.rule,s=n.input,l=n.labels,u=n.rules,d=D()({mixedString:l.title,components:{title:Object(v.createElement)("span",{className:t}),rule:Object(v.createElement)(w.SelectControl,{className:q()(t,"woocommerce-filters-advanced__rule"),options:u,value:c,onChange:Object(_.partial)(o,"rule"),"aria-label":l.rule}),filter:Object(v.createElement)($e,{className:q()(t,"woocommerce-filters-advanced__input"),onChange:this.onSearchChange,type:s.type,autocompleter:s.autocompleter,placeholder:l.placeholder,selected:i,inlineTags:!0,"aria-label":l.filter})}}),f=this.getScreenReaderText(r,n);return Object(v.createElement)("fieldset",{className:"woocommerce-filters-advanced__line-item",tabIndex:"0"},Object(v.createElement)("legend",{className:"screen-reader-text"},l.add||""),Object(v.createElement)("div",{className:q()("woocommerce-filters-advanced__fieldset",{"is-english":a})},d),f&&Object(v.createElement)("span",{className:"screen-reader-text"},f))}}]),o}(v.Component);Ze.propTypes={config:S.a.shape({labels:S.a.shape({placeholder:S.a.string,rule:S.a.string,title:S.a.string}),rules:S.a.arrayOf(S.a.object),input:S.a.object}).isRequired,filter:S.a.shape({key:S.a.string,rule:S.a.string,value:S.a.string}).isRequired,onFilterChange:S.a.func.isRequired,query:S.a.object};var Xe=Ze,et=n(8),tt=n.n(et),nt=n(664);var rt=n(56),ot=n.n(rt);function at(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function it(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?at(Object(n),!0).forEach((function(t){o()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):at(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var ct=function(e){var t;function n(e){var n=it(it({},{code:"USD",symbol:"$",symbolPosition:"left",thousandSeparator:",",decimalSeparator:".",precision:2}),e);t={code:n.code.toString(),symbol:n.symbol.toString(),symbolPosition:n.symbolPosition.toString(),decimalSeparator:n.decimalSeparator.toString(),priceFormat:o(n),thousandSeparator:n.thousandSeparator.toString(),precision:parseInt(n.precision,10)}}function r(e){var n=function(e,t){var n=e.precision,r=void 0===n?null:n,o=e.decimalSeparator,a=void 0===o?".":o,i=e.thousandSeparator,c=void 0===i?",":i;if("number"!=typeof t&&(t=parseFloat(t)),isNaN(t))return"";var s=parseInt(r,10);if(isNaN(s)){var l=t.toString().split("."),u=tt()(l,2)[1];s=u?u.length:0}return nt(t,s,a,c)}(t,e);if(""===n)return n;var r=t,o=r.priceFormat,a=r.symbol;return Object(O.sprintf)(o,a,n)}function o(e){if(e.priceFormat)return t=e.priceFormat.toString(),(n=document.createElement("DIV")).innerHTML=t,n.textContent||n.innerText||"";var t,n;switch(e.symbolPosition){case"left":return"%1$s%2$s";case"right":return"%2$s%1$s";case"left_space":return"%1$s %2$s";case"right_space":return"%2$s %1$s"}return"%1$s%2$s"}return n(e),{getCurrencyConfig:function(){return it({},t)},getDataForCountry:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=t[e]||{},o=n[r.currency_code];return o?{code:r.currency_code,symbol:Object(ne.decodeEntities)(o),symbolPosition:r.currency_pos,thousandSeparator:r.thousand_sep,decimalSeparator:r.decimal_sep,precision:r.num_decimals}:{}},setCurrency:n,formatAmount:r,formatCurrency:function(e){return ot()("Currency().formatCurrency",{version:"5.0.0",alternative:"Currency().formatAmount",plugin:"WooCommerce",hint:"`formatAmount` accepts the same arguments as formatCurrency"}),r(e)},getPriceFormat:o,formatDecimal:function(e){if("number"!=typeof e&&(e=parseFloat(e)),Number.isNaN(e))return 0;var n=t.precision;return Math.round(e*Math.pow(10,n))/Math.pow(10,n)},formatDecimalString:function(e){if("number"!=typeof e&&(e=parseFloat(e)),Number.isNaN(e))return"";var n=t.precision;return e.toFixed(n)},render:function(e){return"number"!=typeof e&&(e=parseFloat(e)),e<0?Object(v.createElement)("span",{className:"is-negative"},r(e)):r(e)}}};var st=function(e){h()(o,e);var t,n,r=(t=o,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=g()(t);if(n){var o=g()(this).constructor;e=Reflect.construct(r,arguments,o)}else e=r.apply(this,arguments);return y()(this,e)});function o(e){var t;return s()(this,o),(t=r.call(this,e)).state={isFocused:!1},t}return u()(o,[{key:"handleFocusOutside",value:function(){this.setState({isFocused:!1})}},{key:"handleOnClick",value:function(e,t){this.setState({isFocused:!0}),"function"==typeof t&&t(e)}},{key:"render",value:function(){var e=this,t=this.props,n=t.label,r=t.value,o=t.help,a=t.className,i=t.instanceId,c=t.onChange,s=t.onClick,l=t.prefix,u=t.suffix,d=t.type,f=t.disabled,p=R()(t,["label","value","help","className","instanceId","onChange","onClick","prefix","suffix","type","disabled"]),h=this.state.isFocused,m="inspector-text-control-with-affixes-".concat(i),y=[];o&&y.push("".concat(m,"__help")),l&&y.push("".concat(m,"__prefix")),u&&y.push("".concat(m,"__suffix"));var b=q()(a,{"with-value":""!==r,empty:""===r,active:h&&!f}),g=q()("text-control-with-affixes",{"text-control-with-prefix":l,"text-control-with-suffix":u,disabled:f});return Object(v.createElement)(w.BaseControl,{label:n,id:m,help:o,className:b,onClick:function(t){return e.handleOnClick(t,s)}},Object(v.createElement)("div",{className:g},l&&Object(v.createElement)("span",{id:"".concat(m,"__prefix"),className:"text-control-with-affixes__prefix"},l),Object(v.createElement)("input",T()({className:"components-text-control__input",type:d,id:m,value:r,onChange:function(e){return c(e.target.value)},"aria-describedby":y.join(" "),disabled:f,onFocus:function(){return e.setState({isFocused:!0})}},p)),u&&Object(v.createElement)("span",{id:"".concat(m,"__suffix"),className:"text-control-with-affixes__suffix"},u)))}}]),o}(v.Component);st.defaultProps={type:"text"},st.propTypes={label:S.a.string,help:S.a.string,type:S.a.string,value:S.a.string.isRequired,className:S.a.string,onChange:S.a.func.isRequired,prefix:S.a.node,suffix:S.a.node,disabled:S.a.bool};var lt=Object(Z.compose)([Z.withInstanceId,w.withFocusOutside])(st);var ut=function(e){h()(o,e);var t,n,r=(t=o,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=g()(t);if(n){var o=g()(this).constructor;e=Reflect.construct(r,arguments,o)}else e=r.apply(this,arguments);return y()(this,e)});function o(){return s()(this,o),r.apply(this,arguments)}return u()(o,[{key:"getBetweenString",value:function(){return Object(O._x)("{{rangeStart /}}{{span}} and {{/span}}{{rangeEnd /}}","Numerical range inputs arranged on a single line",'woocommerce')}},{key:"getScreenReaderText",value:function(e,t){var n=this.props.currency,r=Object(_.find)(t.rules,{value:e.rule})||{},o=Object(_.isArray)(e.value)?e.value:[e.value],a=tt()(o,2),i=a[0],c=a[1];if(!i||"between"===r.value&&!c)return"";if("currency"===Object(_.get)(t,["input","type"],"number")){var s=ct(n).formatAmount;i=s(i),c=s(c)}var l=i;return"between"===r.value&&(l=D()({mixedString:this.getBetweenString(),components:{rangeStart:Object(v.createElement)(v.Fragment,null,i),rangeEnd:Object(v.createElement)(v.Fragment,null,c),span:Object(v.createElement)(v.Fragment,null)}})),z(D()({mixedString:t.labels.title,components:{filter:Object(v.createElement)(v.Fragment,null,l),rule:Object(v.createElement)(v.Fragment,null,r.label),title:Object(v.createElement)(v.Fragment,null)}}))}},{key:"getFormControl",value:function(e){var t=e.type,n=e.value,r=e.label,o=e.onChange,a=e.currencySymbol,i=e.symbolPosition;return"currency"===t?0===i.indexOf("right")?Object(v.createElement)(lt,{suffix:Object(v.createElement)("span",{dangerouslySetInnerHTML:{__html:a}}),className:"woocommerce-filters-advanced__input",type:"number",value:n||"","aria-label":r,onChange:o}):Object(v.createElement)(lt,{prefix:Object(v.createElement)("span",{dangerouslySetInnerHTML:{__html:a}}),className:"woocommerce-filters-advanced__input",type:"number",value:n||"","aria-label":r,onChange:o}):Object(v.createElement)(w.TextControl,{className:"woocommerce-filters-advanced__input",type:"number",value:n||"","aria-label":r,onChange:o})}},{key:"getFilterInputs",value:function(){var e=this.props,t=e.config,n=e.filter,r=e.onFilterChange,o=e.currency,a=o.symbol,i=o.symbolPosition;if("between"===n.rule)return this.getRangeInput();var c=Object(_.get)(t,["input","type"],"number"),s=Object(_.isArray)(n.value)?n.value:[n.value],l=tt()(s,2),u=l[0],d=l[1];Boolean(d)&&r("value",u||d);var f;
/* translators: Sentence fragment, "maximum amount" refers to a numeric value the field must be less than. Screenshot for context: https://cloudup.com/cmv5CLyMPNQ */
return f="lessthan"===n.rule?Object(O._x)("%(field)s maximum amount","maximum value input",'woocommerce'):Object(O._x)("%(field)s minimum amount","minimum value input",'woocommerce'),this.getFormControl({type:c,value:u||d,label:Object(O.sprintf)(f,{field:Object(_.get)(t,["labels","add"])}),onChange:Object(_.partial)(r,"value"),currencySymbol:a,symbolPosition:i})}},{key:"getRangeInput",value:function(){var e=this.props,t=e.config,n=e.filter,r=e.onFilterChange,o=e.currency,a=o.symbol,i=o.symbolPosition,c=Object(_.get)(t,["input","type"],"number"),s=Object(_.isArray)(n.value)?n.value:[n.value],l=tt()(s,2),u=l[0],d=l[1];return D()({mixedString:this.getBetweenString(),components:{rangeStart:this.getFormControl({type:c,value:u||"",label:Object(O.sprintf)(
/* translators: Sentence fragment, "range start" refers to the first of two numeric values the field must be between. Screenshot for context: https://cloudup.com/cmv5CLyMPNQ */
Object(O.__)("%(field)s range start",'woocommerce'),{field:Object(_.get)(t,["labels","add"])}),onChange:function(e){r("value",[e,d])},currencySymbol:a,symbolPosition:i}),rangeEnd:this.getFormControl({type:c,value:d||"",label:Object(O.sprintf)(
/* translators: Sentence fragment, "range end" refers to the second of two numeric values the field must be between. Screenshot for context: https://cloudup.com/cmv5CLyMPNQ */
Object(O.__)("%(field)s range end",'woocommerce'),{field:Object(_.get)(t,["labels","add"])}),onChange:function(e){r("value",[u,e])},currencySymbol:a,symbolPosition:i}),span:Object(v.createElement)("span",{className:"separator"})}})}},{key:"render",value:function(){var e=this.props,t=e.className,n=e.config,r=e.filter,o=e.onFilterChange,a=e.isEnglish,i=r.rule,c=n.labels,s=n.rules,l=D()({mixedString:c.title,components:{title:Object(v.createElement)("span",{className:t}),rule:Object(v.createElement)(w.SelectControl,{className:q()(t,"woocommerce-filters-advanced__rule"),options:s,value:i,onChange:Object(_.partial)(o,"rule"),"aria-label":c.rule}),filter:Object(v.createElement)("div",{className:q()(t,"woocommerce-filters-advanced__input-range",{"is-between":"between"===i})},this.getFilterInputs())}}),u=this.getScreenReaderText(r,n);return Object(v.createElement)("fieldset",{className:"woocommerce-filters-advanced__line-item",tabIndex:"0"},Object(v.createElement)("legend",{className:"screen-reader-text"},c.add||""),Object(v.createElement)("div",{className:q()("woocommerce-filters-advanced__fieldset",{"is-english":a})},l),u&&Object(v.createElement)("span",{className:"screen-reader-text"},u))}}]),o}(v.Component),dt=n(69),ft=n(31),pt=n.n(ft),ht=(n(414),n(429),function(e){var t=e.disabled,n=e.value,r=e.onChange,o=e.dateFormat,a=e.label,i=e.describedBy,c=e.error,s=e.onFocus,l=e.onKeyDown,u=e.errorPosition,d=q()("woocommerce-calendar__input",{"is-empty":0===n.length,"is-error":c}),f=Object(_.uniqueId)("_woo-dates-input");return Object(v.createElement)("div",{className:d},Object(v.createElement)("input",{type:"text",className:"woocommerce-calendar__input-text",value:n,onChange:r,"aria-label":a,id:f,"aria-describedby":"".concat(f,"-message"),placeholder:o.toLowerCase(),onFocus:s,onKeyDown:l,disabled:t}),c&&Object(v.createElement)(w.Popover,{className:"woocommerce-calendar__input-error",focusOnMount:!1,position:u},c),Object(v.createElement)(w.Dashicon,{icon:"calendar"}),Object(v.createElement)("p",{className:"screen-reader-text",id:"".concat(f,"-message")},c||i))});ht.propTypes={disabled:S.a.bool,value:S.a.string,onChange:S.a.func.isRequired,dateFormat:S.a.string.isRequired,label:S.a.string.isRequired,describedBy:S.a.string.isRequired,error:S.a.string,errorPosition:S.a.string,onFocus:S.a.func,onKeyDown:S.a.func},ht.defaultProps={disabled:!1,onFocus:function(){},errorPosition:"bottom center",onKeyDown:_.noop};var mt=ht,yt=Object(v.createContext)(2);function bt(e){return Object(v.createElement)(yt.Consumer,null,(function(t){var n="h"+Math.min(t,6);return Object(v.createElement)(n,e)}))}function gt(e){var t=e.component,n=e.children,r=R()(e,["component","children"]),o=t||"div";return Object(v.createElement)(yt.Consumer,null,(function(e){return Object(v.createElement)(yt.Provider,{value:e+1},!1===t?n:Object(v.createElement)(o,r,n))}))}gt.propTypes={component:S.a.oneOfType([S.a.func,S.a.string,S.a.bool]),children:S.a.node};var vt=function(e){h()(o,e);var t,n,r=(t=o,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=g()(t);if(n){var o=g()(this).constructor;e=Reflect.construct(r,arguments,o)}else e=r.apply(this,arguments);return y()(this,e)});function o(e){var t;return s()(this,o),(t=r.call(this,e)).onDateChange=t.onDateChange.bind(f()(t)),t.onInputChange=t.onInputChange.bind(f()(t)),t}return u()(o,[{key:"handleKeyDown",value:function(e,t,n){var r=n.keyCode;X.TAB===r&&e&&t()}},{key:"handleFocus",value:function(e,t){e||t()}},{key:"onDateChange",value:function(e,t){var n=this.props,r=n.onUpdate,o=n.dateFormat,a=pt()(t);r({date:a,text:t?a.format(o):"",error:null}),e()}},{key:"onInputChange",value:function(e){var t=e.target.value,n=this.props.dateFormat,r=Object(dt.i)(n,t),o=r?null:dt.b.invalid;this.props.onUpdate({date:r,text:t,error:t.length>0?o:null})}},{key:"render",value:function(){var e=this,t=this.props,n=t.date,r=t.disabled,o=t.text,a=t.dateFormat,i=t.error,c=t.isInvalidDate;return Object(v.createElement)(w.Dropdown,{position:"bottom center",focusOnMount:!1,renderToggle:function(t){var n=t.isOpen,c=t.onToggle;return Object(v.createElement)(mt,{disabled:r,value:o,onChange:e.onInputChange,dateFormat:a,label:Object(O.__)("Choose a date",'woocommerce'),error:i,describedBy:Object(O.sprintf)(Object(O.__)("Date input describing a selected date in format %s",'woocommerce'),a),onFocus:Object(_.partial)(e.handleFocus,n,c),"aria-expanded":n,focusOnMount:!1,onKeyDown:Object(_.partial)(e.handleKeyDown,n,c),errorPosition:"top center"})},renderContent:function(t){var r=t.onToggle;return Object(v.createElement)(gt,{component:!1},Object(v.createElement)(bt,{className:"woocommerce-calendar__date-picker-title"},Object(O.__)("select a date",'woocommerce')),Object(v.createElement)("div",{className:"woocommerce-calendar__react-dates is-core-datepicker"},Object(v.createElement)(w.DatePicker,{currentDate:n,onChange:Object(_.partial)(e.onDateChange,r),isInvalidDate:c})))}})}}]),o}(v.Component);vt.propTypes={date:S.a.object,disabled:S.a.bool,text:S.a.string,error:S.a.string,onUpdate:S.a.func.isRequired,dateFormat:S.a.string.isRequired,isInvalidDate:S.a.func};var Ot=vt;var wt=Object(O.__)("MMM D, YYYY",'woocommerce'),_t=Object(O.__)("MM/DD/YYYY",'woocommerce'),kt=function(e){h()(a,e);var t,n,r=(t=a,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=g()(t);if(n){var o=g()(this).constructor;e=Reflect.construct(r,arguments,o)}else e=r.apply(this,arguments);return y()(this,e)});function a(e){var t,n=e.filter;s()(this,a),t=r.apply(this,arguments);var o=Array.isArray(n.value)?n.value:[null,n.value],i=tt()(o,2),c=i[0],l=i[1],u=c?Object(dt.i)(dt.f,c):null,d=l?Object(dt.i)(dt.f,l):null;return t.state={before:d,beforeText:d?d.format(_t):"",beforeError:null,after:u,afterText:u?u.format(_t):"",afterError:null},t.onSingleDateChange=t.onSingleDateChange.bind(f()(t)),t.onRangeDateChange=t.onRangeDateChange.bind(f()(t)),t}return u()(a,[{key:"getBetweenString",value:function(){return Object(O._x)("{{after /}}{{span}} and {{/span}}{{before /}}","Date range inputs arranged on a single line",'woocommerce')}},{key:"getScreenReaderText",value:function(e,t){var n=Object(_.find)(t.rules,{value:e.rule})||{},r=this.state,o=r.before,a=r.after;if(!o||"between"===n.value&&!a)return"";var i=o.format(wt);return"between"===n.value&&(i=D()({mixedString:this.getBetweenString(),components:{after:Object(v.createElement)(v.Fragment,null,a.format(wt)),before:Object(v.createElement)(v.Fragment,null,o.format(wt)),span:Object(v.createElement)(v.Fragment,null)}})),z(D()({mixedString:t.labels.title,components:{filter:Object(v.createElement)(v.Fragment,null,i),rule:Object(v.createElement)(v.Fragment,null,n.label),title:Object(v.createElement)(v.Fragment,null)}}))}},{key:"onSingleDateChange",value:function(e){var t=e.date,n=e.text,r=e.error,o=this.props.onFilterChange;this.setState({before:t,beforeText:n,beforeError:r}),t&&o("value",t.format(dt.f))}},{key:"onRangeDateChange",value:function(e,t){var n,r=t.date,a=t.text,i=t.error,c=this.props.onFilterChange;if(this.setState((n={},o()(n,e,r),o()(n,e+"Text",a),o()(n,e+"Error",i),n)),r){var s=this.state,l=s.before,u=s.after,d=null,f=null;"after"===e&&(d=r.format(dt.f),f=l?l.format(dt.f):null),"before"===e&&(d=u?u.format(dt.f):null,f=r.format(dt.f)),d&&f&&c("value",[d,f])}}},{key:"isFutureDate",value:function(e){return pt()().isBefore(pt()(e),"day")}},{key:"getFormControl",value:function(e){var t=e.date,n=e.error,r=e.onUpdate,o=e.text;return Object(v.createElement)(Ot,{date:t,dateFormat:_t,error:n,isInvalidDate:this.isFutureDate,onUpdate:r,text:o})}},{key:"getRangeInput",value:function(){var e=this.state,t=e.before,n=e.beforeText,r=e.beforeError,o=e.after,a=e.afterText,i=e.afterError;return D()({mixedString:this.getBetweenString(),components:{after:this.getFormControl({date:o,error:i,onUpdate:Object(_.partial)(this.onRangeDateChange,"after"),text:a}),before:this.getFormControl({date:t,error:r,onUpdate:Object(_.partial)(this.onRangeDateChange,"before"),text:n}),span:Object(v.createElement)("span",{className:"separator"})}})}},{key:"getFilterInputs",value:function(){var e=this.props.filter,t=this.state,n=t.before,r=t.beforeText,o=t.beforeError;return"between"===e.rule?this.getRangeInput():this.getFormControl({date:n,error:o,onUpdate:this.onSingleDateChange,text:r})}},{key:"render",value:function(){var e=this.props,t=e.className,n=e.config,r=e.filter,o=e.isEnglish,a=e.onFilterChange,i=r.rule,c=n.labels,s=n.rules,l=this.getScreenReaderText(r,n),u=D()({mixedString:c.title,components:{title:Object(v.createElement)("span",{className:t}),rule:Object(v.createElement)(w.SelectControl,{className:q()(t,"woocommerce-filters-advanced__rule"),options:s,value:i,onChange:Object(_.partial)(a,"rule"),"aria-label":c.rule}),filter:Object(v.createElement)("div",{className:q()(t,"woocommerce-filters-advanced__input-range",{"is-between":"between"===i})},this.getFilterInputs())}});return Object(v.createElement)("fieldset",{className:"woocommerce-filters-advanced__line-item",tabIndex:"0"},Object(v.createElement)("legend",{className:"screen-reader-text"},c.add||""),Object(v.createElement)("div",{className:q()("woocommerce-filters-advanced__fieldset",{"is-english":o})},u),l&&Object(v.createElement)("span",{className:"screen-reader-text"},l))}}]),a}(v.Component),St=function(e){var t=e.className,n=e.config,r=e.filter,o=e.isEnglish,a=e.onFilterChange,i=r.rule,c=r.value,s=n.labels,l=n.rules,u=Object(v.useState)([]),d=tt()(u,2),f=d[0],p=d[1];Object(v.useEffect)((function(){!f.length&&Array.isArray(c)&&c[0]&&_e()({path:"/wc-analytics/products/attributes/".concat(c[0])}).then((function(e){var t=e.id,n=e.name;return[{key:t.toString(),label:n}]})).then(p)}),[c,f]);var h=Object(v.useState)([]),m=tt()(h,2),y=m[0],b=m[1];Object(v.useEffect)((function(){f.length&&(b(!1),_e()({path:"/wc-analytics/products/attributes/".concat(f[0].key,"/terms?per_page=100")}).then((function(e){return e.map((function(e){var t=e.id,n=e.name;return{key:t.toString(),label:n}}))})).then(b))}),[f]);var g=Object(v.useState)(Array.isArray(c)&&c[1]||""),k=tt()(g,2),S=k[0],j=k[1],E=function(e){var t=e.attributeTerms,n=e.config,r=e.filter,o=e.selectedAttribute,a=e.selectedAttributeTerm;if(!t||0===t.length||!o||0===o.length||""===a)return"";var i=Array.isArray(n.rules)&&n.rules.find((function(e){return e.value===r.rule}))||{},c=o[0].label,s=t.find((function(e){return e.key===a})),l=s&&s.label;if(!c||!l)return"";var u=D()({
/* translators: Sentence fragment describing a product attribute match. Example: "Color Is Not Blue" - attribute = Color, equals = Is Not, value = Blue */
mixedString:Object(O.__)("{{attribute /}} {{equals /}} {{value /}}",'woocommerce'),components:{attribute:Object(v.createElement)(v.Fragment,null,c),equals:Object(v.createElement)(v.Fragment,null,i.label),value:Object(v.createElement)(v.Fragment,null,l)}});return z(D()({mixedString:n.labels.title,components:{filter:Object(v.createElement)(v.Fragment,null,u),rule:Object(v.createElement)(v.Fragment,null),title:Object(v.createElement)(v.Fragment,null)}}))}({attributeTerms:y,config:n,filter:r,selectedAttribute:f,selectedAttributeTerm:S});return Object(v.createElement)("fieldset",{className:"woocommerce-filters-advanced__line-item",tabIndex:"0"},Object(v.createElement)("legend",{className:"screen-reader-text"},s.add||""),Object(v.createElement)("div",{className:q()("woocommerce-filters-advanced__fieldset",{"is-english":o})},D()({mixedString:s.title,components:{title:Object(v.createElement)("span",{className:t}),rule:Object(v.createElement)(w.SelectControl,{className:q()(t,"woocommerce-filters-advanced__rule"),options:l,value:i,onChange:Object(_.partial)(a,"rule"),"aria-label":s.rule}),filter:Object(v.createElement)("div",{className:q()(t,"woocommerce-filters-advanced__attribute-fieldset")},Array.isArray(c)&&c.length&&!f.length?Object(v.createElement)(w.Spinner,null):Object(v.createElement)($e,{className:"woocommerce-filters-advanced__input woocommerce-search",onChange:function(e){var t=tt()(e,1)[0];p(t?[t]:[]),j(""),a("value",[t&&t.key].filter(Boolean))},type:"attributes",placeholder:Object(O.__)("Attribute name",'woocommerce'),multiple:!1,selected:f,inlineTags:!0,"aria-label":Object(O.__)("Attribute name",'woocommerce')}),f.length>0&&(y.length?Object(v.createElement)(v.Fragment,null,Object(v.createElement)("span",{className:"woocommerce-filters-advanced__attribute-field-separator"},"="),Object(v.createElement)(ve,{className:"woocommerce-filters-advanced__input woocommerce-search",placeholder:Object(O.__)("Attribute value",'woocommerce'),inlineTags:!0,isSearchable:!0,multiple:!1,showAllOnFocus:!0,options:y,selected:S,onChange:function(e){"string"!=typeof e&&(e=""),j(e),a("value",[f[0].key,e].filter(Boolean))}})):Object(v.createElement)(w.Spinner,null)))}})),E&&Object(v.createElement)("span",{className:"screen-reader-text"},E))};St.propTypes={config:S.a.shape({labels:S.a.shape({rule:S.a.string,title:S.a.string,filter:S.a.string}),rules:S.a.arrayOf(S.a.object),input:S.a.object}).isRequired,filter:S.a.shape({key:S.a.string,rule:S.a.string,value:S.a.arrayOf(S.a.oneOfType([S.a.string,S.a.number]))}).isRequired,onFilterChange:S.a.func.isRequired};var jt=St;function Et(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Ct(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Et(Object(n),!0).forEach((function(t){o()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Et(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Dt=function(e){var t=e.config,n=e.currency,r=e.filter,o=e.isEnglish,a=e.onFilterChange,i=e.query,c=e.removeFilter,s=r.key,l=t.filters[s],u=l,d=u.input,f=u.labels,p={Currency:ut,Date:kt,Number:ut,ProductAttribute:jt,Search:Xe,SelectControl:K};if(p.hasOwnProperty(d.component)){"Currency"===d.component&&(l=Ct(Ct({},l),{input:{type:"currency",component:"Currency"}}));var h=p[d.component];return Object(v.createElement)("li",{className:"woocommerce-filters-advanced__list-item"},Object(v.createElement)(h,{className:"woocommerce-filters-advanced__fieldset-item",currency:n,filter:r,config:l,onFilterChange:a,isEnglish:o,query:i}),Object(v.createElement)(w.Button,{className:q()("woocommerce-filters-advanced__line-item","woocommerce-filters-advanced__remove"),label:f.remove,onClick:c},Object(v.createElement)(B.a,null)))}};function Pt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function xt(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Pt(Object(n),!0).forEach((function(t){o()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Pt(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Ft=[{value:"all",label:Object(O.__)("All",'woocommerce')},{value:"any",label:Object(O.__)("Any",'woocommerce')}],Tt=function(e){h()(a,e);var t,n,r=(t=a,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=g()(t);if(n){var o=g()(this).constructor;e=Reflect.construct(r,arguments,o)}else e=r.apply(this,arguments);return y()(this,e)});function a(e){var t,n=e.query,o=e.config;s()(this,a),(t=r.apply(this,arguments)).instanceCounts={};var i=Object(P.c)(n,o.filters),c=i.map((function(e){return o.filters[e.key].allowMultiple&&(e.instance=t.getInstanceNumber(e.key)),e}));return t.state={match:n.match||"all",activeFilters:c},t.filterListRef=Object(v.createRef)(),t.onMatchChange=t.onMatchChange.bind(f()(t)),t.onFilterChange=t.onFilterChange.bind(f()(t)),t.getAvailableFilterKeys=t.getAvailableFilterKeys.bind(f()(t)),t.addFilter=t.addFilter.bind(f()(t)),t.removeFilter=t.removeFilter.bind(f()(t)),t.clearFilters=t.clearFilters.bind(f()(t)),t.getUpdateHref=t.getUpdateHref.bind(f()(t)),t.onFilter=t.onFilter.bind(f()(t)),t}return u()(a,[{key:"componentDidUpdate",value:function(e){var t=this,n=this.props,r=n.config,o=n.query,a=e.query;if(!Object(_.isEqual)(a,o)){var i=Object(P.c)(o,r.filters);this.instanceCounts={};var c=i.map((function(e){return r.filters[e.key].allowMultiple&&(e.instance=t.getInstanceNumber(e.key)),e}));this.setState({activeFilters:c})}}},{key:"getInstanceNumber",value:function(e){return this.instanceCounts.hasOwnProperty(e)||(this.instanceCounts[e]=1),this.instanceCounts[e]++}},{key:"onMatchChange",value:function(e){var t=this.props.onAdvancedFilterAction;this.setState({match:e}),t("match",{match:e})}},{key:"onFilterChange",value:function(e,t,n){var r=i()(this.state.activeFilters);r[e]=xt(xt({},r[e]),{},o()({},t,n)),this.setState({activeFilters:r})}},{key:"removeFilter",value:function(e){var t=this.props.onAdvancedFilterAction,n=i()(this.state.activeFilters);t("remove",n[e]),n.splice(e,1),this.setState({activeFilters:n}),0===n.length&&Object(P.e)().push(this.getUpdateHref([]))}},{key:"getTitle",value:function(){var e=this.state.match,t=this.props.config;return D()({mixedString:t.title,components:{select:Object(v.createElement)(w.SelectControl,{className:"woocommerce-filters-advanced__title-select",options:Ft,value:e,onChange:this.onMatchChange,"aria-label":Object(O.__)("Choose to apply any or all filters",'woocommerce')})}})}},{key:"getAvailableFilterKeys",value:function(){var e=this.props.config,t=this.state.activeFilters.map((function(e){return e.key})),n=Object.keys(e.filters).filter((function(t){return e.filters[t].allowMultiple||!1})),r=Object(_.difference)(Object.keys(e.filters),t,n);return[].concat(i()(r),i()(n))}},{key:"addFilter",value:function(e,t){var n=this,r=this.props,o=r.onAdvancedFilterAction,a=r.config.filters[e],c={key:e};Array.isArray(a.rules)&&a.rules.length&&(c.rule=a.rules[0].value),a.input&&a.input.options&&(c.value=Object(P.d)(a,a.input.options)),a.input&&"Search"===a.input.component&&(c.value=""),a.allowMultiple&&(c.instance=this.getInstanceNumber(e)),this.setState((function(e){return{activeFilters:[].concat(i()(e.activeFilters),[c])}})),o("add",c),t(),setTimeout((function(){n.filterListRef.current.querySelector("li:last-of-type fieldset").focus()}))}},{key:"clearFilters",value:function(){(0,this.props.onAdvancedFilterAction)("clear_all"),this.setState({activeFilters:[],match:"all"})}},{key:"getUpdateHref",value:function(e,t){var n=this.props,r=n.path,o=n.query,a=n.config,i=Object(P.j)(e,o,a.filters),c="all"===t?void 0:t;return Object(P.g)(xt(xt({},i),{},{match:c}),r,o)}},{key:"isEnglish",value:function(){return/en[-|_]/.test(this.props.siteLocale)}},{key:"onFilter",value:function(){var e=this.props,t=e.onAdvancedFilterAction,n=e.query,r=e.config,o=this.state,a=o.activeFilters,i=o.match;t("filter",xt(xt({},Object(P.j)(a,n,r.filters)),{},{match:i}))}},{key:"orderFilters",value:function(e,t){var n=window.location.search,r=n.indexOf(e.key),o=n.indexOf(t.key);return-1===r||-1===o?0:r-o}},{key:"render",value:function(){var e=this,t=this.props,n=t.config,r=t.query,o=t.currency,a=this.state,i=a.activeFilters,c=a.match,s=this.getAvailableFilterKeys(),l=this.getUpdateHref(i,c),u="admin.php"+window.location.search===l||0===i.length,d=this.isEnglish();return Object(v.createElement)(w.Card,{className:"woocommerce-filters-advanced",size:"small"},Object(v.createElement)(w.CardHeader,{justify:"flex-start"},Object(v.createElement)(x,{variant:"subtitle.small"},this.getTitle())),!!i.length&&Object(v.createElement)(w.CardBody,{size:null},Object(v.createElement)("ul",{className:"woocommerce-filters-advanced__list",ref:this.filterListRef},i.sort(this.orderFilters).map((function(t,a){var i=t.instance,c=t.key;return Object(v.createElement)(Dt,{key:c+(i||""),config:n,currency:o,filter:t,isEnglish:d,onFilterChange:Object(_.partial)(e.onFilterChange,a),query:r,removeFilter:function(){return e.removeFilter(a)}})})))),s.length>0&&Object(v.createElement)(w.CardBody,null,Object(v.createElement)("div",{className:"woocommerce-filters-advanced__add-filter"},Object(v.createElement)(w.Dropdown,{className:"woocommerce-filters-advanced__add-filter-dropdown",position:"bottom center",renderToggle:function(e){var t=e.isOpen,n=e.onToggle;return Object(v.createElement)(w.Button,{className:"woocommerce-filters-advanced__add-button",onClick:n,"aria-expanded":t},Object(v.createElement)(E.a,null),Object(O.__)("Add a Filter",'woocommerce'))},renderContent:function(t){var r=t.onClose;return Object(v.createElement)("ul",{className:"woocommerce-filters-advanced__add-dropdown"},s.map((function(t){return Object(v.createElement)("li",{key:t},Object(v.createElement)(w.Button,{onClick:Object(_.partial)(e.addFilter,t,r)},n.filters[t].labels.add))})))}}))),Object(v.createElement)(w.CardFooter,{align:"center"},Object(v.createElement)("div",{className:"woocommerce-filters-advanced__controls"},u&&Object(v.createElement)(w.Button,{isPrimary:!0,disabled:!0},Object(O.__)("Filter",'woocommerce')),!u&&Object(v.createElement)(L,{className:"components-button is-primary is-button",type:"wc-admin",href:l,onClick:this.onFilter},Object(O.__)("Filter",'woocommerce')),i.length>0&&Object(v.createElement)(L,{type:"wc-admin",href:this.getUpdateHref([]),onClick:this.clearFilters},Object(O.__)("Clear all filters",'woocommerce')))))}}]),a}(v.Component);Tt.propTypes={config:S.a.shape({title:S.a.string,filters:S.a.objectOf(S.a.shape({labels:S.a.shape({add:S.a.string,remove:S.a.string,rule:S.a.string,title:S.a.string,filter:S.a.string}),rules:S.a.arrayOf(S.a.object),input:S.a.object}))}).isRequired,path:S.a.string.isRequired,query:S.a.object,onAdvancedFilterAction:S.a.func,siteLocale:S.a.string,currency:S.a.object.isRequired},Tt.defaultProps={query:{},onAdvancedFilterAction:function(){},siteLocale:"en_US"};var Mt=Tt,Rt=n(202),It=n(51),At=n(79),Nt=n(203),Lt=n(11),Ut=n.n(Lt),Bt=Ut.a.createContext(null);function Ht(e,t){var n=Object.create(null);return e&&Lt.Children.map(e,(function(e){return e})).forEach((function(e){n[e.key]=function(e){return t&&Object(Lt.isValidElement)(e)?t(e):e}(e)})),n}function qt(e,t,n){return null!=n[t]?n[t]:e.props[t]}function zt(e,t,n){var r=Ht(e.children),o=function(e,t){function n(n){return n in t?t[n]:e[n]}e=e||{},t=t||{};var r,o=Object.create(null),a=[];for(var i in e)i in t?a.length&&(o[i]=a,a=[]):a.push(i);var c={};for(var s in t){if(o[s])for(r=0;r<o[s].length;r++){var l=o[s][r];c[o[s][r]]=n(l)}c[s]=n(s)}for(r=0;r<a.length;r++)c[a[r]]=n(a[r]);return c}(t,r);return Object.keys(o).forEach((function(a){var i=o[a];if(Object(Lt.isValidElement)(i)){var c=a in t,s=a in r,l=t[a],u=Object(Lt.isValidElement)(l)&&!l.props.in;!s||c&&!u?s||!c||u?s&&c&&Object(Lt.isValidElement)(l)&&(o[a]=Object(Lt.cloneElement)(i,{onExited:n.bind(null,i),in:l.props.in,exit:qt(i,"exit",e),enter:qt(i,"enter",e)})):o[a]=Object(Lt.cloneElement)(i,{in:!1}):o[a]=Object(Lt.cloneElement)(i,{onExited:n.bind(null,i),in:!0,exit:qt(i,"exit",e),enter:qt(i,"enter",e)})}})),o}var Vt=Object.values||function(e){return Object.keys(e).map((function(t){return e[t]}))},Kt=function(e){function t(t,n){var r,o=(r=e.call(this,t,n)||this).handleExited.bind(Object(At.a)(r));return r.state={contextValue:{isMounting:!0},handleExited:o,firstRender:!0},r}Object(Nt.a)(t,e);var n=t.prototype;return n.componentDidMount=function(){this.mounted=!0,this.setState({contextValue:{isMounting:!1}})},n.componentWillUnmount=function(){this.mounted=!1},t.getDerivedStateFromProps=function(e,t){var n,r,o=t.children,a=t.handleExited;return{children:t.firstRender?(n=e,r=a,Ht(n.children,(function(e){return Object(Lt.cloneElement)(e,{onExited:r.bind(null,e),in:!0,appear:qt(e,"appear",n),enter:qt(e,"enter",n),exit:qt(e,"exit",n)})}))):zt(e,o,a),firstRender:!1}},n.handleExited=function(e,t){var n=Ht(this.props.children);e.key in n||(e.props.onExited&&e.props.onExited(t),this.mounted&&this.setState((function(t){var n=Object(It.a)({},t.children);return delete n[e.key],{children:n}})))},n.render=function(){var e=this.props,t=e.component,n=e.childFactory,r=Object(Rt.a)(e,["component","childFactory"]),o=this.state.contextValue,a=Vt(this.state.children).map(n);return delete r.appear,delete r.enter,delete r.exit,null===t?Ut.a.createElement(Bt.Provider,{value:o},a):Ut.a.createElement(Bt.Provider,{value:o},Ut.a.createElement(t,r,a))},t}(Ut.a.Component);Kt.propTypes={},Kt.defaultProps={component:"div",childFactory:function(e){return e}};var Wt=Kt;function Gt(e,t){return e.replace(new RegExp("(^|\\s)"+t+"(?:\\s|$)","g"),"$1").replace(/\s+/g," ").replace(/^\s*|\s*$/g,"")}var Yt=n(87),$t=n.n(Yt),Qt=function(e){function t(t,n){var r;r=e.call(this,t,n)||this;var o,a=n&&!n.isMounting?t.enter:t.appear;return r.appearStatus=null,t.in?a?(o="exited",r.appearStatus="entering"):o="entered":o=t.unmountOnExit||t.mountOnEnter?"unmounted":"exited",r.state={status:o},r.nextCallback=null,r}Object(Nt.a)(t,e),t.getDerivedStateFromProps=function(e,t){return e.in&&"unmounted"===t.status?{status:"exited"}:null};var n=t.prototype;return n.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},n.componentDidUpdate=function(e){var t=null;if(e!==this.props){var n=this.state.status;this.props.in?"entering"!==n&&"entered"!==n&&(t="entering"):"entering"!==n&&"entered"!==n||(t="exiting")}this.updateStatus(!1,t)},n.componentWillUnmount=function(){this.cancelNextCallback()},n.getTimeouts=function(){var e,t,n,r=this.props.timeout;return e=t=n=r,null!=r&&"number"!=typeof r&&(e=r.exit,t=r.enter,n=void 0!==r.appear?r.appear:t),{exit:e,enter:t,appear:n}},n.updateStatus=function(e,t){void 0===e&&(e=!1),null!==t?(this.cancelNextCallback(),"entering"===t?this.performEnter(e):this.performExit()):this.props.unmountOnExit&&"exited"===this.state.status&&this.setState({status:"unmounted"})},n.performEnter=function(e){var t=this,n=this.props.enter,r=this.context?this.context.isMounting:e,o=this.props.nodeRef?[r]:[$t.a.findDOMNode(this),r],a=o[0],i=o[1],c=this.getTimeouts(),s=r?c.appear:c.enter;e||n?(this.props.onEnter(a,i),this.safeSetState({status:"entering"},(function(){t.props.onEntering(a,i),t.onTransitionEnd(s,(function(){t.safeSetState({status:"entered"},(function(){t.props.onEntered(a,i)}))}))}))):this.safeSetState({status:"entered"},(function(){t.props.onEntered(a)}))},n.performExit=function(){var e=this,t=this.props.exit,n=this.getTimeouts(),r=this.props.nodeRef?void 0:$t.a.findDOMNode(this);t?(this.props.onExit(r),this.safeSetState({status:"exiting"},(function(){e.props.onExiting(r),e.onTransitionEnd(n.exit,(function(){e.safeSetState({status:"exited"},(function(){e.props.onExited(r)}))}))}))):this.safeSetState({status:"exited"},(function(){e.props.onExited(r)}))},n.cancelNextCallback=function(){null!==this.nextCallback&&(this.nextCallback.cancel(),this.nextCallback=null)},n.safeSetState=function(e,t){t=this.setNextCallback(t),this.setState(e,t)},n.setNextCallback=function(e){var t=this,n=!0;return this.nextCallback=function(r){n&&(n=!1,t.nextCallback=null,e(r))},this.nextCallback.cancel=function(){n=!1},this.nextCallback},n.onTransitionEnd=function(e,t){this.setNextCallback(t);var n=this.props.nodeRef?this.props.nodeRef.current:$t.a.findDOMNode(this),r=null==e&&!this.props.addEndListener;if(n&&!r){if(this.props.addEndListener){var o=this.props.nodeRef?[this.nextCallback]:[n,this.nextCallback],a=o[0],i=o[1];this.props.addEndListener(a,i)}null!=e&&setTimeout(this.nextCallback,e)}else setTimeout(this.nextCallback,0)},n.render=function(){var e=this.state.status;if("unmounted"===e)return null;var t=this.props,n=t.children,r=(t.in,t.mountOnEnter,t.unmountOnExit,t.appear,t.enter,t.exit,t.timeout,t.addEndListener,t.onEnter,t.onEntering,t.onEntered,t.onExit,t.onExiting,t.onExited,t.nodeRef,Object(Rt.a)(t,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]));return Ut.a.createElement(Bt.Provider,{value:null},"function"==typeof n?n(e,r):Ut.a.cloneElement(Ut.a.Children.only(n),r))},t}(Ut.a.Component);function Jt(){}Qt.contextType=Bt,Qt.propTypes={},Qt.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:Jt,onEntering:Jt,onEntered:Jt,onExit:Jt,onExiting:Jt,onExited:Jt},Qt.UNMOUNTED="unmounted",Qt.EXITED="exited",Qt.ENTERING="entering",Qt.ENTERED="entered",Qt.EXITING="exiting";var Zt=Qt,Xt=function(e,t){return e&&t&&t.split(" ").forEach((function(t){return r=t,void((n=e).classList?n.classList.remove(r):"string"==typeof n.className?n.className=Gt(n.className,r):n.setAttribute("class",Gt(n.className&&n.className.baseVal||"",r)));var n,r}))},en=function(e){function t(){for(var t,n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return(t=e.call.apply(e,[this].concat(r))||this).appliedClasses={appear:{},enter:{},exit:{}},t.onEnter=function(e,n){var r=t.resolveArguments(e,n),o=r[0],a=r[1];t.removeClasses(o,"exit"),t.addClass(o,a?"appear":"enter","base"),t.props.onEnter&&t.props.onEnter(e,n)},t.onEntering=function(e,n){var r=t.resolveArguments(e,n),o=r[0],a=r[1]?"appear":"enter";t.addClass(o,a,"active"),t.props.onEntering&&t.props.onEntering(e,n)},t.onEntered=function(e,n){var r=t.resolveArguments(e,n),o=r[0],a=r[1]?"appear":"enter";t.removeClasses(o,a),t.addClass(o,a,"done"),t.props.onEntered&&t.props.onEntered(e,n)},t.onExit=function(e){var n=t.resolveArguments(e)[0];t.removeClasses(n,"appear"),t.removeClasses(n,"enter"),t.addClass(n,"exit","base"),t.props.onExit&&t.props.onExit(e)},t.onExiting=function(e){var n=t.resolveArguments(e)[0];t.addClass(n,"exit","active"),t.props.onExiting&&t.props.onExiting(e)},t.onExited=function(e){var n=t.resolveArguments(e)[0];t.removeClasses(n,"exit"),t.addClass(n,"exit","done"),t.props.onExited&&t.props.onExited(e)},t.resolveArguments=function(e,n){return t.props.nodeRef?[t.props.nodeRef.current,e]:[e,n]},t.getClassNames=function(e){var n=t.props.classNames,r="string"==typeof n,o=r?(r&&n?n+"-":"")+e:n[e];return{baseClassName:o,activeClassName:r?o+"-active":n[e+"Active"],doneClassName:r?o+"-done":n[e+"Done"]}},t}Object(Nt.a)(t,e);var n=t.prototype;return n.addClass=function(e,t,n){var r=this.getClassNames(t)[n+"ClassName"],o=this.getClassNames("enter").doneClassName;"appear"===t&&"done"===n&&o&&(r+=" "+o),"active"===n&&e&&e.scrollTop,r&&(this.appliedClasses[t][n]=r,function(e,t){e&&t&&t.split(" ").forEach((function(t){return r=t,void((n=e).classList?n.classList.add(r):function(e,t){return e.classList?!!t&&e.classList.contains(t):-1!==(" "+(e.className.baseVal||e.className)+" ").indexOf(" "+t+" ")}(n,r)||("string"==typeof n.className?n.className=n.className+" "+r:n.setAttribute("class",(n.className&&n.className.baseVal||"")+" "+r)));var n,r}))}(e,r))},n.removeClasses=function(e,t){var n=this.appliedClasses[t],r=n.base,o=n.active,a=n.done;this.appliedClasses[t]={},r&&Xt(e,r),o&&Xt(e,o),a&&Xt(e,a)},n.render=function(){var e=this.props,t=(e.classNames,Object(Rt.a)(e,["classNames"]));return Ut.a.createElement(Zt,Object(It.a)({},t,{onEnter:this.onEnter,onEntered:this.onEntered,onEntering:this.onEntering,onExit:this.onExit,onExiting:this.onExiting,onExited:this.onExited}))},t}(Ut.a.Component);en.defaultProps={classNames:""},en.propTypes={};var tn=en;var nn=function(e){h()(o,e);var t,n,r=(t=o,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=g()(t);if(n){var o=g()(this).constructor;e=Reflect.construct(r,arguments,o)}else e=r.apply(this,arguments);return y()(this,e)});function o(){var e;return s()(this,o),(e=r.call(this)).state={animate:null},e.container=Object(v.createRef)(),e.onExited=e.onExited.bind(f()(e)),e}return u()(o,[{key:"onExited",value:function(){var e=this.props.onExited;e&&e(this.container.current)}},{key:"render",value:function(){var e=this.props,t=e.children,n=e.animationKey,r=e.animate,o=q()("woocommerce-slide-animation",r&&"animate-".concat(r));return Object(v.createElement)("div",{className:o,ref:this.container},Object(v.createElement)(Wt,null,Object(v.createElement)(tn,T()({timeout:200,classNames:"slide",key:n},this.props,{onExited:this.onExited}),(function(e){return t({status:e})}))))}}]),o}(v.Component);nn.propTypes={children:S.a.func.isRequired,animationKey:S.a.any.isRequired,animate:S.a.oneOf([null,"left","right"]),onExited:S.a.func};var rn=nn;function on(e,t){if((n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"))<0)return null;var n,r=e.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+e.slice(n+1)]}var an=function(e){return(e=on(Math.abs(e)))?e[1]:NaN},cn=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function sn(e){if(!(t=cn.exec(e)))throw new Error("invalid format: "+e);var t;return new ln({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}function ln(e){this.fill=void 0===e.fill?" ":e.fill+"",this.align=void 0===e.align?">":e.align+"",this.sign=void 0===e.sign?"-":e.sign+"",this.symbol=void 0===e.symbol?"":e.symbol+"",this.zero=!!e.zero,this.width=void 0===e.width?void 0:+e.width,this.comma=!!e.comma,this.precision=void 0===e.precision?void 0:+e.precision,this.trim=!!e.trim,this.type=void 0===e.type?"":e.type+""}sn.prototype=ln.prototype,ln.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(void 0===this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(void 0===this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};var un,dn,fn,pn,hn=function(e,t){var n=on(e,t);if(!n)return e+"";var r=n[0],o=n[1];return o<0?"0."+new Array(-o).join("0")+r:r.length>o+1?r.slice(0,o+1)+"."+r.slice(o+1):r+new Array(o-r.length+2).join("0")},mn={"%":function(e,t){return(100*e).toFixed(t)},b:function(e){return Math.round(e).toString(2)},c:function(e){return e+""},d:function(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)},e:function(e,t){return e.toExponential(t)},f:function(e,t){return e.toFixed(t)},g:function(e,t){return e.toPrecision(t)},o:function(e){return Math.round(e).toString(8)},p:function(e,t){return hn(100*e,t)},r:hn,s:function(e,t){var n=on(e,t);if(!n)return e+"";var r=n[0],o=n[1],a=o-(un=3*Math.max(-8,Math.min(8,Math.floor(o/3))))+1,i=r.length;return a===i?r:a>i?r+new Array(a-i+1).join("0"):a>0?r.slice(0,a)+"."+r.slice(a):"0."+new Array(1-a).join("0")+on(e,Math.max(0,t+a-1))[0]},X:function(e){return Math.round(e).toString(16).toUpperCase()},x:function(e){return Math.round(e).toString(16)}},yn=function(e){return e},bn=Array.prototype.map,gn=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function vn(e){return dn=function(e){var t,n,r=void 0===e.grouping||void 0===e.thousands?yn:(t=bn.call(e.grouping,Number),n=e.thousands+"",function(e,r){for(var o=e.length,a=[],i=0,c=t[0],s=0;o>0&&c>0&&(s+c+1>r&&(c=Math.max(1,r-s)),a.push(e.substring(o-=c,o+c)),!((s+=c+1)>r));)c=t[i=(i+1)%t.length];return a.reverse().join(n)}),o=void 0===e.currency?"":e.currency[0]+"",a=void 0===e.currency?"":e.currency[1]+"",i=void 0===e.decimal?".":e.decimal+"",c=void 0===e.numerals?yn:function(e){return function(t){return t.replace(/[0-9]/g,(function(t){return e[+t]}))}}(bn.call(e.numerals,String)),s=void 0===e.percent?"%":e.percent+"",l=void 0===e.minus?"-":e.minus+"",u=void 0===e.nan?"NaN":e.nan+"";function d(e){var t=(e=sn(e)).fill,n=e.align,d=e.sign,f=e.symbol,p=e.zero,h=e.width,m=e.comma,y=e.precision,b=e.trim,g=e.type;"n"===g?(m=!0,g="g"):mn[g]||(void 0===y&&(y=12),b=!0,g="g"),(p||"0"===t&&"="===n)&&(p=!0,t="0",n="=");var v="$"===f?o:"#"===f&&/[boxX]/.test(g)?"0"+g.toLowerCase():"",O="$"===f?a:/[%p]/.test(g)?s:"",w=mn[g],_=/[defgprs%]/.test(g);function k(e){var o,a,s,f=v,k=O;if("c"===g)k=w(e)+k,e="";else{var S=(e=+e)<0||1/e<0;if(e=isNaN(e)?u:w(Math.abs(e),y),b&&(e=function(e){e:for(var t,n=e.length,r=1,o=-1;r<n;++r)switch(e[r]){case".":o=t=r;break;case"0":0===o&&(o=r),t=r;break;default:if(!+e[r])break e;o>0&&(o=0)}return o>0?e.slice(0,o)+e.slice(t+1):e}(e)),S&&0==+e&&"+"!==d&&(S=!1),f=(S?"("===d?d:l:"-"===d||"("===d?"":d)+f,k=("s"===g?gn[8+un/3]:"")+k+(S&&"("===d?")":""),_)for(o=-1,a=e.length;++o<a;)if(48>(s=e.charCodeAt(o))||s>57){k=(46===s?i+e.slice(o+1):e.slice(o))+k,e=e.slice(0,o);break}}m&&!p&&(e=r(e,1/0));var j=f.length+e.length+k.length,E=j<h?new Array(h-j+1).join(t):"";switch(m&&p&&(e=r(E+e,E.length?h-k.length:1/0),E=""),n){case"<":e=f+e+k+E;break;case"=":e=f+E+e+k;break;case"^":e=E.slice(0,j=E.length>>1)+f+e+k+E.slice(j);break;default:e=E+f+e+k}return c(e)}return y=void 0===y?6:/[gprs]/.test(g)?Math.max(1,Math.min(21,y)):Math.max(0,Math.min(20,y)),k.toString=function(){return e+""},k}return{format:d,formatPrefix:function(e,t){var n=d(((e=sn(e)).type="f",e)),r=3*Math.max(-8,Math.min(8,Math.floor(an(t)/3))),o=Math.pow(10,-r),a=gn[8+r/3];return function(e){return n(o*e)+a}}}}(e),fn=dn.format,pn=dn.formatPrefix,dn}vn({decimal:".",thousands:",",grouping:[3],currency:["$",""],minus:"-"});var On=n(524),wn=n.n(On),kn=n(525),Sn=n.n(kn),jn=function(e){for(var t=e.length/6|0,n=new Array(t),r=0;r<t;)n[r]="#"+e.slice(6*r,6*++r);return n};function En(e){var t=e.length;return function(n){return e[Math.max(0,Math.min(t-1,Math.floor(n*t)))]}}var Cn=En(jn("44015444025645045745055946075a46085c460a5d460b5e470d60470e6147106347116447136548146748166848176948186a481a6c481b6d481c6e481d6f481f70482071482173482374482475482576482677482878482979472a7a472c7a472d7b472e7c472f7d46307e46327e46337f463480453581453781453882443983443a83443b84433d84433e85423f854240864241864142874144874045884046883f47883f48893e49893e4a893e4c8a3d4d8a3d4e8a3c4f8a3c508b3b518b3b528b3a538b3a548c39558c39568c38588c38598c375a8c375b8d365c8d365d8d355e8d355f8d34608d34618d33628d33638d32648e32658e31668e31678e31688e30698e306a8e2f6b8e2f6c8e2e6d8e2e6e8e2e6f8e2d708e2d718e2c718e2c728e2c738e2b748e2b758e2a768e2a778e2a788e29798e297a8e297b8e287c8e287d8e277e8e277f8e27808e26818e26828e26828e25838e25848e25858e24868e24878e23888e23898e238a8d228b8d228c8d228d8d218e8d218f8d21908d21918c20928c20928c20938c1f948c1f958b1f968b1f978b1f988b1f998a1f9a8a1e9b8a1e9c891e9d891f9e891f9f881fa0881fa1881fa1871fa28720a38620a48621a58521a68522a78522a88423a98324aa8325ab8225ac8226ad8127ad8128ae8029af7f2ab07f2cb17e2db27d2eb37c2fb47c31b57b32b67a34b67935b77937b87838b9773aba763bbb753dbc743fbc7340bd7242be7144bf7046c06f48c16e4ac16d4cc26c4ec36b50c46a52c56954c56856c66758c7655ac8645cc8635ec96260ca6063cb5f65cb5e67cc5c69cd5b6ccd5a6ece5870cf5773d05675d05477d1537ad1517cd2507fd34e81d34d84d44b86d54989d5488bd6468ed64590d74393d74195d84098d83e9bd93c9dd93ba0da39a2da37a5db36a8db34aadc32addc30b0dd2fb2dd2db5de2bb8de29bade28bddf26c0df25c2df23c5e021c8e020cae11fcde11dd0e11cd2e21bd5e21ad8e219dae319dde318dfe318e2e418e5e419e7e419eae51aece51befe51cf1e51df4e61ef6e620f8e621fbe723fde725"));function Dn(e,t){if(e.length!==t.length)return!1;for(var n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}En(jn("00000401000501010601010802010902020b02020d03030f03031204041405041606051806051a07061c08071e0907200a08220b09240c09260d0a290e0b2b100b2d110c2f120d31130d34140e36150e38160f3b180f3d19103f1a10421c10441d11471e114920114b21114e22115024125325125527125829115a2a115c2c115f2d11612f116331116533106734106936106b38106c390f6e3b0f703d0f713f0f72400f74420f75440f764510774710784910784a10794c117a4e117b4f127b51127c52137c54137d56147d57157e59157e5a167e5c167f5d177f5f187f601880621980641a80651a80671b80681c816a1c816b1d816d1d816e1e81701f81721f817320817521817621817822817922827b23827c23827e24828025828125818326818426818627818827818928818b29818c29818e2a81902a81912b81932b80942c80962c80982d80992d809b2e7f9c2e7f9e2f7fa02f7fa1307ea3307ea5317ea6317da8327daa337dab337cad347cae347bb0357bb2357bb3367ab5367ab73779b83779ba3878bc3978bd3977bf3a77c03a76c23b75c43c75c53c74c73d73c83e73ca3e72cc3f71cd4071cf4070d0416fd2426fd3436ed5446dd6456cd8456cd9466bdb476adc4869de4968df4a68e04c67e24d66e34e65e44f64e55064e75263e85362e95462ea5661eb5760ec5860ed5a5fee5b5eef5d5ef05f5ef1605df2625df2645cf3655cf4675cf4695cf56b5cf66c5cf66e5cf7705cf7725cf8745cf8765cf9785df9795df97b5dfa7d5efa7f5efa815ffb835ffb8560fb8761fc8961fc8a62fc8c63fc8e64fc9065fd9266fd9467fd9668fd9869fd9a6afd9b6bfe9d6cfe9f6dfea16efea36ffea571fea772fea973feaa74feac76feae77feb078feb27afeb47bfeb67cfeb77efeb97ffebb81febd82febf84fec185fec287fec488fec68afec88cfeca8dfecc8ffecd90fecf92fed194fed395fed597fed799fed89afdda9cfddc9efddea0fde0a1fde2a3fde3a5fde5a7fde7a9fde9aafdebacfcecaefceeb0fcf0b2fcf2b4fcf4b6fcf6b8fcf7b9fcf9bbfcfbbdfcfdbf")),En(jn("00000401000501010601010802010a02020c02020e03021004031204031405041706041907051b08051d09061f0a07220b07240c08260d08290e092b10092d110a30120a32140b34150b37160b39180c3c190c3e1b0c411c0c431e0c451f0c48210c4a230c4c240c4f260c51280b53290b552b0b572d0b592f0a5b310a5c320a5e340a5f3609613809623909633b09643d09653e0966400a67420a68440a68450a69470b6a490b6a4a0c6b4c0c6b4d0d6c4f0d6c510e6c520e6d540f6d550f6d57106e59106e5a116e5c126e5d126e5f136e61136e62146e64156e65156e67166e69166e6a176e6c186e6d186e6f196e71196e721a6e741a6e751b6e771c6d781c6d7a1d6d7c1d6d7d1e6d7f1e6c801f6c82206c84206b85216b87216b88226a8a226a8c23698d23698f24699025689225689326679526679727669827669a28659b29649d29649f2a63a02a63a22b62a32c61a52c60a62d60a82e5fa92e5eab2f5ead305dae305cb0315bb1325ab3325ab43359b63458b73557b93556ba3655bc3754bd3853bf3952c03a51c13a50c33b4fc43c4ec63d4dc73e4cc83f4bca404acb4149cc4248ce4347cf4446d04545d24644d34743d44842d54a41d74b3fd84c3ed94d3dda4e3cdb503bdd513ade5238df5337e05536e15635e25734e35933e45a31e55c30e65d2fe75e2ee8602de9612bea632aeb6429eb6628ec6726ed6925ee6a24ef6c23ef6e21f06f20f1711ff1731df2741cf3761bf37819f47918f57b17f57d15f67e14f68013f78212f78410f8850ff8870ef8890cf98b0bf98c0af98e09fa9008fa9207fa9407fb9606fb9706fb9906fb9b06fb9d07fc9f07fca108fca309fca50afca60cfca80dfcaa0ffcac11fcae12fcb014fcb216fcb418fbb61afbb81dfbba1ffbbc21fbbe23fac026fac228fac42afac62df9c72ff9c932f9cb35f8cd37f8cf3af7d13df7d340f6d543f6d746f5d949f5db4cf4dd4ff4df53f4e156f3e35af3e55df2e661f2e865f2ea69f1ec6df1ed71f1ef75f1f179f2f27df2f482f3f586f3f68af4f88ef5f992f6fa96f8fb9af9fc9dfafda1fcffa4")),En(jn("0d088710078813078916078a19068c1b068d1d068e20068f2206902406912605912805922a05932c05942e05952f059631059733059735049837049938049a3a049a3c049b3e049c3f049c41049d43039e44039e46039f48039f4903a04b03a14c02a14e02a25002a25102a35302a35502a45601a45801a45901a55b01a55c01a65e01a66001a66100a76300a76400a76600a76700a86900a86a00a86c00a86e00a86f00a87100a87201a87401a87501a87701a87801a87a02a87b02a87d03a87e03a88004a88104a78305a78405a78606a68707a68808a68a09a58b0aa58d0ba58e0ca48f0da4910ea3920fa39410a29511a19613a19814a099159f9a169f9c179e9d189d9e199da01a9ca11b9ba21d9aa31e9aa51f99a62098a72197a82296aa2395ab2494ac2694ad2793ae2892b02991b12a90b22b8fb32c8eb42e8db52f8cb6308bb7318ab83289ba3388bb3488bc3587bd3786be3885bf3984c03a83c13b82c23c81c33d80c43e7fc5407ec6417dc7427cc8437bc9447aca457acb4679cc4778cc4977cd4a76ce4b75cf4c74d04d73d14e72d24f71d35171d45270d5536fd5546ed6556dd7566cd8576bd9586ada5a6ada5b69db5c68dc5d67dd5e66de5f65de6164df6263e06363e16462e26561e26660e3685fe4695ee56a5de56b5de66c5ce76e5be76f5ae87059e97158e97257ea7457eb7556eb7655ec7754ed7953ed7a52ee7b51ef7c51ef7e50f07f4ff0804ef1814df1834cf2844bf3854bf3874af48849f48948f58b47f58c46f68d45f68f44f79044f79143f79342f89441f89540f9973ff9983ef99a3efa9b3dfa9c3cfa9e3bfb9f3afba139fba238fca338fca537fca636fca835fca934fdab33fdac33fdae32fdaf31fdb130fdb22ffdb42ffdb52efeb72dfeb82cfeba2cfebb2bfebd2afebe2afec029fdc229fdc328fdc527fdc627fdc827fdca26fdcb26fccd25fcce25fcd025fcd225fbd324fbd524fbd724fad824fada24f9dc24f9dd25f8df25f8e125f7e225f7e425f6e626f6e826f5e926f5eb27f4ed27f3ee27f3f027f2f227f1f426f1f525f0f724f0f921"));var Pn=function(e,t){var n;void 0===t&&(t=Dn);var r,o=[],a=!1;return function(){for(var i=[],c=0;c<arguments.length;c++)i[c]=arguments[c];return a&&n===this&&t(i,o)||(r=e.apply(this,i),a=!0,n=this,o=i),r}},xn=n(89),Fn=n(526);var Tn=function(e){h()(o,e);var t,n,r=(t=o,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=g()(t);if(n){var o=g()(this).constructor;e=Reflect.construct(r,arguments,o)}else e=r.apply(this,arguments);return y()(this,e)});function o(){return s()(this,o),r.apply(this,arguments)}return u()(o,[{key:"render",value:function(){var e=this.props.height;return Object(v.createElement)("div",{"aria-hidden":"true",className:"woocommerce-chart-placeholder",style:{height:e}},Object(v.createElement)(w.Spinner,null))}}]),o}(v.Component);Tn.propTypes={height:S.a.number},Tn.defaultProps={height:0};var Mn=Tn,Rn=new Date,In=new Date;function An(e,t,n,r){function o(t){return e(t=0===arguments.length?new Date:new Date(+t)),t}return o.floor=function(t){return e(t=new Date(+t)),t},o.ceil=function(n){return e(n=new Date(n-1)),t(n,1),e(n),n},o.round=function(e){var t=o(e),n=o.ceil(e);return e-t<n-e?t:n},o.offset=function(e,n){return t(e=new Date(+e),null==n?1:Math.floor(n)),e},o.range=function(n,r,a){var i,c=[];if(n=o.ceil(n),a=null==a?1:Math.floor(a),!(n<r&&a>0))return c;do{c.push(i=new Date(+n)),t(n,a),e(n)}while(i<n&&n<r);return c},o.filter=function(n){return An((function(t){if(t>=t)for(;e(t),!n(t);)t.setTime(t-1)}),(function(e,r){if(e>=e)if(r<0)for(;++r<=0;)for(;t(e,-1),!n(e););else for(;--r>=0;)for(;t(e,1),!n(e););}))},n&&(o.count=function(t,r){return Rn.setTime(+t),In.setTime(+r),e(Rn),e(In),Math.floor(n(Rn,In))},o.every=function(e){return e=Math.floor(e),isFinite(e)&&e>0?e>1?o.filter(r?function(t){return r(t)%e==0}:function(t){return o.count(0,t)%e==0}):o:null}),o}function Nn(e){return An((function(t){t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)}),(function(e,t){e.setUTCDate(e.getUTCDate()+7*t)}),(function(e,t){return(t-e)/6048e5}))}var Ln=Nn(0),Un=Nn(1),Bn=Nn(2),Hn=Nn(3),qn=Nn(4),zn=Nn(5),Vn=Nn(6),Kn=(Ln.range,Un.range,Bn.range,Hn.range,qn.range,zn.range,Vn.range,An((function(e){e.setUTCHours(0,0,0,0)}),(function(e,t){e.setUTCDate(e.getUTCDate()+t)}),(function(e,t){return(t-e)/864e5}),(function(e){return e.getUTCDate()-1}))),Wn=Kn;function Gn(e){return An((function(t){t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)}),(function(e,t){e.setDate(e.getDate()+7*t)}),(function(e,t){return(t-e-6e4*(t.getTimezoneOffset()-e.getTimezoneOffset()))/6048e5}))}Kn.range;var Yn=Gn(0),$n=Gn(1),Qn=Gn(2),Jn=Gn(3),Zn=Gn(4),Xn=Gn(5),er=Gn(6),tr=(Yn.range,$n.range,Qn.range,Jn.range,Zn.range,Xn.range,er.range,An((function(e){e.setHours(0,0,0,0)}),(function(e,t){e.setDate(e.getDate()+t)}),(function(e,t){return(t-e-6e4*(t.getTimezoneOffset()-e.getTimezoneOffset()))/864e5}),(function(e){return e.getDate()-1}))),nr=tr,rr=(tr.range,An((function(e){e.setMonth(0,1),e.setHours(0,0,0,0)}),(function(e,t){e.setFullYear(e.getFullYear()+t)}),(function(e,t){return t.getFullYear()-e.getFullYear()}),(function(e){return e.getFullYear()})));rr.every=function(e){return isFinite(e=Math.floor(e))&&e>0?An((function(t){t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)}),(function(t,n){t.setFullYear(t.getFullYear()+n*e)})):null};var or=rr,ar=(rr.range,An((function(e){e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)}),(function(e,t){e.setUTCFullYear(e.getUTCFullYear()+t)}),(function(e,t){return t.getUTCFullYear()-e.getUTCFullYear()}),(function(e){return e.getUTCFullYear()})));ar.every=function(e){return isFinite(e=Math.floor(e))&&e>0?An((function(t){t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)}),(function(t,n){t.setUTCFullYear(t.getUTCFullYear()+n*e)})):null};var ir=ar;function cr(e){if(0<=e.y&&e.y<100){var t=new Date(-1,e.m,e.d,e.H,e.M,e.S,e.L);return t.setFullYear(e.y),t}return new Date(e.y,e.m,e.d,e.H,e.M,e.S,e.L)}function sr(e){if(0<=e.y&&e.y<100){var t=new Date(Date.UTC(-1,e.m,e.d,e.H,e.M,e.S,e.L));return t.setUTCFullYear(e.y),t}return new Date(Date.UTC(e.y,e.m,e.d,e.H,e.M,e.S,e.L))}function lr(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}ar.range;var ur,dr,fr,pr={"-":"",_:" ",0:"0"},hr=/^\s*\d+/,mr=/^%/,yr=/[\\^$*+?|[\]().{}]/g;function br(e,t,n){var r=e<0?"-":"",o=(r?-e:e)+"",a=o.length;return r+(a<n?new Array(n-a+1).join(t)+o:o)}function gr(e){return e.replace(yr,"\\$&")}function vr(e){return new RegExp("^(?:"+e.map(gr).join("|")+")","i")}function Or(e){for(var t={},n=-1,r=e.length;++n<r;)t[e[n].toLowerCase()]=n;return t}function wr(e,t,n){var r=hr.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function _r(e,t,n){var r=hr.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function kr(e,t,n){var r=hr.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function Sr(e,t,n){var r=hr.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function jr(e,t,n){var r=hr.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function Er(e,t,n){var r=hr.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function Cr(e,t,n){var r=hr.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function Dr(e,t,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(n,n+6));return r?(e.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function Pr(e,t,n){var r=hr.exec(t.slice(n,n+1));return r?(e.q=3*r[0]-3,n+r[0].length):-1}function xr(e,t,n){var r=hr.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function Fr(e,t,n){var r=hr.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function Tr(e,t,n){var r=hr.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function Mr(e,t,n){var r=hr.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function Rr(e,t,n){var r=hr.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function Ir(e,t,n){var r=hr.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function Ar(e,t,n){var r=hr.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function Nr(e,t,n){var r=hr.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function Lr(e,t,n){var r=mr.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function Ur(e,t,n){var r=hr.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function Br(e,t,n){var r=hr.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function Hr(e,t){return br(e.getDate(),t,2)}function qr(e,t){return br(e.getHours(),t,2)}function zr(e,t){return br(e.getHours()%12||12,t,2)}function Vr(e,t){return br(1+nr.count(or(e),e),t,3)}function Kr(e,t){return br(e.getMilliseconds(),t,3)}function Wr(e,t){return Kr(e,t)+"000"}function Gr(e,t){return br(e.getMonth()+1,t,2)}function Yr(e,t){return br(e.getMinutes(),t,2)}function $r(e,t){return br(e.getSeconds(),t,2)}function Qr(e){var t=e.getDay();return 0===t?7:t}function Jr(e,t){return br(Yn.count(or(e)-1,e),t,2)}function Zr(e){var t=e.getDay();return t>=4||0===t?Zn(e):Zn.ceil(e)}function Xr(e,t){return e=Zr(e),br(Zn.count(or(e),e)+(4===or(e).getDay()),t,2)}function eo(e){return e.getDay()}function to(e,t){return br($n.count(or(e)-1,e),t,2)}function no(e,t){return br(e.getFullYear()%100,t,2)}function ro(e,t){return br((e=Zr(e)).getFullYear()%100,t,2)}function oo(e,t){return br(e.getFullYear()%1e4,t,4)}function ao(e,t){var n=e.getDay();return br((e=n>=4||0===n?Zn(e):Zn.ceil(e)).getFullYear()%1e4,t,4)}function io(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+br(t/60|0,"0",2)+br(t%60,"0",2)}function co(e,t){return br(e.getUTCDate(),t,2)}function so(e,t){return br(e.getUTCHours(),t,2)}function lo(e,t){return br(e.getUTCHours()%12||12,t,2)}function uo(e,t){return br(1+Wn.count(ir(e),e),t,3)}function fo(e,t){return br(e.getUTCMilliseconds(),t,3)}function po(e,t){return fo(e,t)+"000"}function ho(e,t){return br(e.getUTCMonth()+1,t,2)}function mo(e,t){return br(e.getUTCMinutes(),t,2)}function yo(e,t){return br(e.getUTCSeconds(),t,2)}function bo(e){var t=e.getUTCDay();return 0===t?7:t}function go(e,t){return br(Ln.count(ir(e)-1,e),t,2)}function vo(e){var t=e.getUTCDay();return t>=4||0===t?qn(e):qn.ceil(e)}function Oo(e,t){return e=vo(e),br(qn.count(ir(e),e)+(4===ir(e).getUTCDay()),t,2)}function wo(e){return e.getUTCDay()}function _o(e,t){return br(Un.count(ir(e)-1,e),t,2)}function ko(e,t){return br(e.getUTCFullYear()%100,t,2)}function So(e,t){return br((e=vo(e)).getUTCFullYear()%100,t,2)}function jo(e,t){return br(e.getUTCFullYear()%1e4,t,4)}function Eo(e,t){var n=e.getUTCDay();return br((e=n>=4||0===n?qn(e):qn.ceil(e)).getUTCFullYear()%1e4,t,4)}function Co(){return"+0000"}function Do(){return"%"}function Po(e){return+e}function xo(e){return Math.floor(+e/1e3)}function Fo(){}ur=function(e){var t=e.dateTime,n=e.date,r=e.time,o=e.periods,a=e.days,i=e.shortDays,c=e.months,s=e.shortMonths,l=vr(o),u=Or(o),d=vr(a),f=Or(a),p=vr(i),h=Or(i),m=vr(c),y=Or(c),b=vr(s),g=Or(s),v={a:function(e){return i[e.getDay()]},A:function(e){return a[e.getDay()]},b:function(e){return s[e.getMonth()]},B:function(e){return c[e.getMonth()]},c:null,d:Hr,e:Hr,f:Wr,g:ro,G:ao,H:qr,I:zr,j:Vr,L:Kr,m:Gr,M:Yr,p:function(e){return o[+(e.getHours()>=12)]},q:function(e){return 1+~~(e.getMonth()/3)},Q:Po,s:xo,S:$r,u:Qr,U:Jr,V:Xr,w:eo,W:to,x:null,X:null,y:no,Y:oo,Z:io,"%":Do},O={a:function(e){return i[e.getUTCDay()]},A:function(e){return a[e.getUTCDay()]},b:function(e){return s[e.getUTCMonth()]},B:function(e){return c[e.getUTCMonth()]},c:null,d:co,e:co,f:po,g:So,G:Eo,H:so,I:lo,j:uo,L:fo,m:ho,M:mo,p:function(e){return o[+(e.getUTCHours()>=12)]},q:function(e){return 1+~~(e.getUTCMonth()/3)},Q:Po,s:xo,S:yo,u:bo,U:go,V:Oo,w:wo,W:_o,x:null,X:null,y:ko,Y:jo,Z:Co,"%":Do},w={a:function(e,t,n){var r=p.exec(t.slice(n));return r?(e.w=h[r[0].toLowerCase()],n+r[0].length):-1},A:function(e,t,n){var r=d.exec(t.slice(n));return r?(e.w=f[r[0].toLowerCase()],n+r[0].length):-1},b:function(e,t,n){var r=b.exec(t.slice(n));return r?(e.m=g[r[0].toLowerCase()],n+r[0].length):-1},B:function(e,t,n){var r=m.exec(t.slice(n));return r?(e.m=y[r[0].toLowerCase()],n+r[0].length):-1},c:function(e,n,r){return S(e,t,n,r)},d:Fr,e:Fr,f:Nr,g:Cr,G:Er,H:Mr,I:Mr,j:Tr,L:Ar,m:xr,M:Rr,p:function(e,t,n){var r=l.exec(t.slice(n));return r?(e.p=u[r[0].toLowerCase()],n+r[0].length):-1},q:Pr,Q:Ur,s:Br,S:Ir,u:_r,U:kr,V:Sr,w:wr,W:jr,x:function(e,t,r){return S(e,n,t,r)},X:function(e,t,n){return S(e,r,t,n)},y:Cr,Y:Er,Z:Dr,"%":Lr};function _(e,t){return function(n){var r,o,a,i=[],c=-1,s=0,l=e.length;for(n instanceof Date||(n=new Date(+n));++c<l;)37===e.charCodeAt(c)&&(i.push(e.slice(s,c)),null!=(o=pr[r=e.charAt(++c)])?r=e.charAt(++c):o="e"===r?" ":"0",(a=t[r])&&(r=a(n,o)),i.push(r),s=c+1);return i.push(e.slice(s,c)),i.join("")}}function k(e,t){return function(n){var r,o,a=lr(1900,void 0,1);if(S(a,e,n+="",0)!=n.length)return null;if("Q"in a)return new Date(a.Q);if("s"in a)return new Date(1e3*a.s+("L"in a?a.L:0));if(t&&!("Z"in a)&&(a.Z=0),"p"in a&&(a.H=a.H%12+12*a.p),void 0===a.m&&(a.m="q"in a?a.q:0),"V"in a){if(a.V<1||a.V>53)return null;"w"in a||(a.w=1),"Z"in a?(o=(r=sr(lr(a.y,0,1))).getUTCDay(),r=o>4||0===o?Un.ceil(r):Un(r),r=Wn.offset(r,7*(a.V-1)),a.y=r.getUTCFullYear(),a.m=r.getUTCMonth(),a.d=r.getUTCDate()+(a.w+6)%7):(o=(r=cr(lr(a.y,0,1))).getDay(),r=o>4||0===o?$n.ceil(r):$n(r),r=nr.offset(r,7*(a.V-1)),a.y=r.getFullYear(),a.m=r.getMonth(),a.d=r.getDate()+(a.w+6)%7)}else("W"in a||"U"in a)&&("w"in a||(a.w="u"in a?a.u%7:"W"in a?1:0),o="Z"in a?sr(lr(a.y,0,1)).getUTCDay():cr(lr(a.y,0,1)).getDay(),a.m=0,a.d="W"in a?(a.w+6)%7+7*a.W-(o+5)%7:a.w+7*a.U-(o+6)%7);return"Z"in a?(a.H+=a.Z/100|0,a.M+=a.Z%100,sr(a)):cr(a)}}function S(e,t,n,r){for(var o,a,i=0,c=t.length,s=n.length;i<c;){if(r>=s)return-1;if(37===(o=t.charCodeAt(i++))){if(o=t.charAt(i++),!(a=w[o in pr?t.charAt(i++):o])||(r=a(e,n,r))<0)return-1}else if(o!=n.charCodeAt(r++))return-1}return r}return v.x=_(n,v),v.X=_(r,v),v.c=_(t,v),O.x=_(n,O),O.X=_(r,O),O.c=_(t,O),{format:function(e){var t=_(e+="",v);return t.toString=function(){return e},t},parse:function(e){var t=k(e+="",!1);return t.toString=function(){return e},t},utcFormat:function(e){var t=_(e+="",O);return t.toString=function(){return e},t},utcParse:function(e){var t=k(e+="",!0);return t.toString=function(){return e},t}}}({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]}),dr=ur.format,ur.parse,ur.utcFormat,fr=ur.utcParse;var To=function(e){return null==e?Fo:function(){return this.querySelector(e)}};function Mo(){return[]}var Ro=function(e){return new Array(e.length)};function Io(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}function Ao(e,t,n,r,o,a){for(var i,c=0,s=t.length,l=a.length;c<l;++c)(i=t[c])?(i.__data__=a[c],r[c]=i):n[c]=new Io(e,a[c]);for(;c<s;++c)(i=t[c])&&(o[c]=i)}function No(e,t,n,r,o,a,i){var c,s,l,u={},d=t.length,f=a.length,p=new Array(d);for(c=0;c<d;++c)(s=t[c])&&(p[c]=l="$"+i.call(s,s.__data__,c,t),l in u?o[c]=s:u[l]=s);for(c=0;c<f;++c)(s=u[l="$"+i.call(e,a[c],c,a)])?(r[c]=s,s.__data__=a[c],u[l]=null):n[c]=new Io(e,a[c]);for(c=0;c<d;++c)(s=t[c])&&u[p[c]]===s&&(o[c]=s)}function Lo(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}Io.prototype={constructor:Io,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};var Uo="http://www.w3.org/1999/xhtml",Bo={svg:"http://www.w3.org/2000/svg",xhtml:Uo,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"},Ho=function(e){var t=e+="",n=t.indexOf(":");return n>=0&&"xmlns"!==(t=e.slice(0,n))&&(e=e.slice(n+1)),Bo.hasOwnProperty(t)?{space:Bo[t],local:e}:e};function qo(e){return function(){this.removeAttribute(e)}}function zo(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Vo(e,t){return function(){this.setAttribute(e,t)}}function Ko(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function Wo(e,t){return function(){var n=t.apply(this,arguments);null==n?this.removeAttribute(e):this.setAttribute(e,n)}}function Go(e,t){return function(){var n=t.apply(this,arguments);null==n?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}var Yo=function(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView};function $o(e){return function(){this.style.removeProperty(e)}}function Qo(e,t,n){return function(){this.style.setProperty(e,t,n)}}function Jo(e,t,n){return function(){var r=t.apply(this,arguments);null==r?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function Zo(e,t){return e.style.getPropertyValue(t)||Yo(e).getComputedStyle(e,null).getPropertyValue(t)}function Xo(e){return function(){delete this[e]}}function ea(e,t){return function(){this[e]=t}}function ta(e,t){return function(){var n=t.apply(this,arguments);null==n?delete this[e]:this[e]=n}}function na(e){return e.trim().split(/^|\s+/)}function ra(e){return e.classList||new oa(e)}function oa(e){this._node=e,this._names=na(e.getAttribute("class")||"")}function aa(e,t){for(var n=ra(e),r=-1,o=t.length;++r<o;)n.add(t[r])}function ia(e,t){for(var n=ra(e),r=-1,o=t.length;++r<o;)n.remove(t[r])}function ca(e){return function(){aa(this,e)}}function sa(e){return function(){ia(this,e)}}function la(e,t){return function(){(t.apply(this,arguments)?aa:ia)(this,e)}}function ua(){this.textContent=""}function da(e){return function(){this.textContent=e}}function fa(e){return function(){var t=e.apply(this,arguments);this.textContent=null==t?"":t}}function pa(){this.innerHTML=""}function ha(e){return function(){this.innerHTML=e}}function ma(e){return function(){var t=e.apply(this,arguments);this.innerHTML=null==t?"":t}}function ya(){this.nextSibling&&this.parentNode.appendChild(this)}function ba(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function ga(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===Uo&&t.documentElement.namespaceURI===Uo?t.createElement(e):t.createElementNS(n,e)}}function va(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}oa.prototype={add:function(e){this._names.indexOf(e)<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};var Oa=function(e){var t=Ho(e);return(t.local?va:ga)(t)};function wa(){return null}function _a(){var e=this.parentNode;e&&e.removeChild(this)}function ka(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function Sa(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}var ja={},Ea=null;function Ca(e,t,n){return e=Da(e,t,n),function(t){var n=t.relatedTarget;n&&(n===this||8&n.compareDocumentPosition(this))||e.call(this,t)}}function Da(e,t,n){return function(r){var o=Ea;Ea=r;try{e.call(this,this.__data__,t,n)}finally{Ea=o}}}function Pa(e){return e.trim().split(/^|\s+/).map((function(e){var t="",n=e.indexOf(".");return n>=0&&(t=e.slice(n+1),e=e.slice(0,n)),{type:e,name:t}}))}function xa(e){return function(){var t=this.__on;if(t){for(var n,r=0,o=-1,a=t.length;r<a;++r)n=t[r],e.type&&n.type!==e.type||n.name!==e.name?t[++o]=n:this.removeEventListener(n.type,n.listener,n.capture);++o?t.length=o:delete this.__on}}}function Fa(e,t,n){var r=ja.hasOwnProperty(e.type)?Ca:Da;return function(o,a,i){var c,s=this.__on,l=r(t,a,i);if(s)for(var u=0,d=s.length;u<d;++u)if((c=s[u]).type===e.type&&c.name===e.name)return this.removeEventListener(c.type,c.listener,c.capture),this.addEventListener(c.type,c.listener=l,c.capture=n),void(c.value=t);this.addEventListener(e.type,l,n),c={type:e.type,name:e.name,value:t,listener:l,capture:n},s?s.push(c):this.__on=[c]}}function Ta(e,t,n){var r=Yo(e),o=r.CustomEvent;"function"==typeof o?o=new o(t,n):(o=r.document.createEvent("Event"),n?(o.initEvent(t,n.bubbles,n.cancelable),o.detail=n.detail):o.initEvent(t,!1,!1)),e.dispatchEvent(o)}function Ma(e,t){return function(){return Ta(this,e,t)}}function Ra(e,t){return function(){return Ta(this,e,t.apply(this,arguments))}}"undefined"!=typeof document&&("onmouseenter"in document.documentElement||(ja={mouseenter:"mouseover",mouseleave:"mouseout"}));var Ia=[null];function Aa(e,t){this._groups=e,this._parents=t}Aa.prototype=function(){return new Aa([[document.documentElement]],Ia)}.prototype={constructor:Aa,select:function(e){"function"!=typeof e&&(e=To(e));for(var t=this._groups,n=t.length,r=new Array(n),o=0;o<n;++o)for(var a,i,c=t[o],s=c.length,l=r[o]=new Array(s),u=0;u<s;++u)(a=c[u])&&(i=e.call(a,a.__data__,u,c))&&("__data__"in a&&(i.__data__=a.__data__),l[u]=i);return new Aa(r,this._parents)},selectAll:function(e){var t;"function"!=typeof e&&(e=null==(t=e)?Mo:function(){return this.querySelectorAll(t)});for(var n=this._groups,r=n.length,o=[],a=[],i=0;i<r;++i)for(var c,s=n[i],l=s.length,u=0;u<l;++u)(c=s[u])&&(o.push(e.call(c,c.__data__,u,s)),a.push(c));return new Aa(o,a)},filter:function(e){var t;"function"!=typeof e&&(t=e,e=function(){return this.matches(t)});for(var n=this._groups,r=n.length,o=new Array(r),a=0;a<r;++a)for(var i,c=n[a],s=c.length,l=o[a]=[],u=0;u<s;++u)(i=c[u])&&e.call(i,i.__data__,u,c)&&l.push(i);return new Aa(o,this._parents)},data:function(e,t){if(!e)return h=new Array(this.size()),u=-1,this.each((function(e){h[++u]=e})),h;var n,r=t?No:Ao,o=this._parents,a=this._groups;"function"!=typeof e&&(n=e,e=function(){return n});for(var i=a.length,c=new Array(i),s=new Array(i),l=new Array(i),u=0;u<i;++u){var d=o[u],f=a[u],p=f.length,h=e.call(d,d&&d.__data__,u,o),m=h.length,y=s[u]=new Array(m),b=c[u]=new Array(m);r(d,f,y,b,l[u]=new Array(p),h,t);for(var g,v,O=0,w=0;O<m;++O)if(g=y[O]){for(O>=w&&(w=O+1);!(v=b[w])&&++w<m;);g._next=v||null}}return(c=new Aa(c,o))._enter=s,c._exit=l,c},enter:function(){return new Aa(this._enter||this._groups.map(Ro),this._parents)},exit:function(){return new Aa(this._exit||this._groups.map(Ro),this._parents)},join:function(e,t,n){var r=this.enter(),o=this,a=this.exit();return r="function"==typeof e?e(r):r.append(e+""),null!=t&&(o=t(o)),null==n?a.remove():n(a),r&&o?r.merge(o).order():o},merge:function(e){for(var t=this._groups,n=e._groups,r=t.length,o=n.length,a=Math.min(r,o),i=new Array(r),c=0;c<a;++c)for(var s,l=t[c],u=n[c],d=l.length,f=i[c]=new Array(d),p=0;p<d;++p)(s=l[p]||u[p])&&(f[p]=s);for(;c<r;++c)i[c]=t[c];return new Aa(i,this._parents)},order:function(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var r,o=e[t],a=o.length-1,i=o[a];--a>=0;)(r=o[a])&&(i&&4^r.compareDocumentPosition(i)&&i.parentNode.insertBefore(r,i),i=r);return this},sort:function(e){function t(t,n){return t&&n?e(t.__data__,n.__data__):!t-!n}e||(e=Lo);for(var n=this._groups,r=n.length,o=new Array(r),a=0;a<r;++a){for(var i,c=n[a],s=c.length,l=o[a]=new Array(s),u=0;u<s;++u)(i=c[u])&&(l[u]=i);l.sort(t)}return new Aa(o,this._parents).order()},call:function(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this},nodes:function(){var e=new Array(this.size()),t=-1;return this.each((function(){e[++t]=this})),e},node:function(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],o=0,a=r.length;o<a;++o){var i=r[o];if(i)return i}return null},size:function(){var e=0;return this.each((function(){++e})),e},empty:function(){return!this.node()},each:function(e){for(var t=this._groups,n=0,r=t.length;n<r;++n)for(var o,a=t[n],i=0,c=a.length;i<c;++i)(o=a[i])&&e.call(o,o.__data__,i,a);return this},attr:function(e,t){var n=Ho(e);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((null==t?n.local?zo:qo:"function"==typeof t?n.local?Go:Wo:n.local?Ko:Vo)(n,t))},style:function(e,t,n){return arguments.length>1?this.each((null==t?$o:"function"==typeof t?Jo:Qo)(e,t,null==n?"":n)):Zo(this.node(),e)},property:function(e,t){return arguments.length>1?this.each((null==t?Xo:"function"==typeof t?ta:ea)(e,t)):this.node()[e]},classed:function(e,t){var n=na(e+"");if(arguments.length<2){for(var r=ra(this.node()),o=-1,a=n.length;++o<a;)if(!r.contains(n[o]))return!1;return!0}return this.each(("function"==typeof t?la:t?ca:sa)(n,t))},text:function(e){return arguments.length?this.each(null==e?ua:("function"==typeof e?fa:da)(e)):this.node().textContent},html:function(e){return arguments.length?this.each(null==e?pa:("function"==typeof e?ma:ha)(e)):this.node().innerHTML},raise:function(){return this.each(ya)},lower:function(){return this.each(ba)},append:function(e){var t="function"==typeof e?e:Oa(e);return this.select((function(){return this.appendChild(t.apply(this,arguments))}))},insert:function(e,t){var n="function"==typeof e?e:Oa(e),r=null==t?wa:"function"==typeof t?t:To(t);return this.select((function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)}))},remove:function(){return this.each(_a)},clone:function(e){return this.select(e?Sa:ka)},datum:function(e){return arguments.length?this.property("__data__",e):this.node().__data__},on:function(e,t,n){var r,o,a=Pa(e+""),i=a.length;if(!(arguments.length<2)){for(c=t?Fa:xa,null==n&&(n=!1),r=0;r<i;++r)this.each(c(a[r],t,n));return this}var c=this.node().__on;if(c)for(var s,l=0,u=c.length;l<u;++l)for(r=0,s=c[l];r<i;++r)if((o=a[r]).type===s.type&&o.name===s.name)return s.value},dispatch:function(e,t){return this.each(("function"==typeof t?Ra:Ma)(e,t))}};var Na=function(e){return"string"==typeof e?new Aa([[document.querySelector(e)]],[document.documentElement]):new Aa([[e]],Ia)};var La=function(e){h()(o,e);var t,n,r=(t=o,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=g()(t);if(n){var o=g()(this).constructor;e=Reflect.construct(r,arguments,o)}else e=r.apply(this,arguments);return y()(this,e)});function o(e){var t;return s()(this,o),(t=r.call(this,e)).chartRef=Object(v.createRef)(),t}return u()(o,[{key:"componentDidMount",value:function(){this.drawUpdatedChart()}},{key:"shouldComponentUpdate",value:function(e){return this.props.className!==e.className||!Object(_.isEqual)(this.props.data,e.data)||!Object(_.isEqual)(this.props.orderedKeys,e.orderedKeys)||this.props.drawChart!==e.drawChart||this.props.height!==e.height||this.props.chartType!==e.chartType||this.props.width!==e.width}},{key:"componentDidUpdate",value:function(){this.drawUpdatedChart()}},{key:"componentWillUnmount",value:function(){this.deleteChart()}},{key:"delayedScroll",value:function(){var e=this.props.tooltip;return Object(_.throttle)((function(){e&&e.hide()}),300)}},{key:"deleteChart",value:function(){Na(this.chartRef.current).selectAll("svg").remove()}},{key:"drawUpdatedChart",value:function(){(0,this.props.drawChart)(this.getContainer())}},{key:"getContainer",value:function(){var e=this.props,t=e.className,n=e.height,r=e.width;this.deleteChart();var o=Na(this.chartRef.current).append("svg").attr("viewBox","0 0 ".concat(r," ").concat(n)).attr("height",n).attr("width",r).attr("preserveAspectRatio","xMidYMid meet");return t&&o.attr("class","".concat(t,"__viewbox")),o.append("g")}},{key:"render",value:function(){var e=this.props.className;return Object(v.createElement)("div",{className:q()("d3-base",e),ref:this.chartRef,onScroll:this.delayedScroll()})}}]),o}(v.Component);La.propTypes={className:S.a.string,data:S.a.array,orderedKeys:S.a.array,tooltip:S.a.object,chartType:S.a.string};var Ua=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:fn;return"function"==typeof e?e:t(e)},Ba=function(e){var t=new Set(e.reduce((function(e,t){return e.concat(Object.keys(t))}),[]));return i()(t).filter((function(e){return"date"!==e}))},Ha=function(e,t){return e<t?-1:e>t?1:e>=t?0:NaN},qa=function(e){var t;return 1===e.length&&(t=e,e=function(e,n){return Ha(t(e),n)}),{left:function(t,n,r,o){for(null==r&&(r=0),null==o&&(o=t.length);r<o;){var a=r+o>>>1;e(t[a],n)<0?r=a+1:o=a}return r},right:function(t,n,r,o){for(null==r&&(r=0),null==o&&(o=t.length);r<o;){var a=r+o>>>1;e(t[a],n)>0?o=a:r=a+1}return r}}},za=qa(Ha),Va=za.right,Ka=(za.left,Va),Wa=Array.prototype,Ga=(Wa.slice,Wa.map,function(e,t,n){e=+e,t=+t,n=(o=arguments.length)<2?(t=e,e=0,1):o<3?1:+n;for(var r=-1,o=0|Math.max(0,Math.ceil((t-e)/n)),a=new Array(o);++r<o;)a[r]=e+r*n;return a}),Ya=Math.sqrt(50),$a=Math.sqrt(10),Qa=Math.sqrt(2);function Ja(e,t,n){var r=(t-e)/Math.max(0,n),o=Math.floor(Math.log(r)/Math.LN10),a=r/Math.pow(10,o);return o>=0?(a>=Ya?10:a>=$a?5:a>=Qa?2:1)*Math.pow(10,o):-Math.pow(10,-o)/(a>=Ya?10:a>=$a?5:a>=Qa?2:1)}function Za(e,t,n){var r=Math.abs(t-e)/Math.max(0,n),o=Math.pow(10,Math.floor(Math.log(r)/Math.LN10)),a=r/o;return a>=Ya?o*=10:a>=$a?o*=5:a>=Qa&&(o*=2),t<e?-o:o}function Xa(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e)}return this}function ei(){}function ti(e,t){var n=new ei;if(e instanceof ei)e.each((function(e,t){n.set(t,e)}));else if(Array.isArray(e)){var r,o=-1,a=e.length;if(null==t)for(;++o<a;)n.set(o,e[o]);else for(;++o<a;)n.set(t(r=e[o],o,e),r)}else if(e)for(var i in e)n.set(i,e[i]);return n}ei.prototype=ti.prototype={constructor:ei,has:function(e){return"$"+e in this},get:function(e){return this["$"+e]},set:function(e,t){return this["$"+e]=t,this},remove:function(e){var t="$"+e;return t in this&&delete this[t]},clear:function(){for(var e in this)"$"===e[0]&&delete this[e]},keys:function(){var e=[];for(var t in this)"$"===t[0]&&e.push(t.slice(1));return e},values:function(){var e=[];for(var t in this)"$"===t[0]&&e.push(this[t]);return e},entries:function(){var e=[];for(var t in this)"$"===t[0]&&e.push({key:t.slice(1),value:this[t]});return e},size:function(){var e=0;for(var t in this)"$"===t[0]&&++e;return e},empty:function(){for(var e in this)if("$"===e[0])return!1;return!0},each:function(e){for(var t in this)"$"===t[0]&&e(this[t],t.slice(1),this)}};var ni=ti;function ri(){}var oi=ni.prototype;ri.prototype=function(e,t){var n=new ri;if(e instanceof ri)e.each((function(e){n.add(e)}));else if(e){var r=-1,o=e.length;if(null==t)for(;++r<o;)n.add(e[r]);else for(;++r<o;)n.add(t(e[r],r,e))}return n}.prototype={constructor:ri,has:oi.has,add:function(e){return this["$"+(e+="")]=e,this},remove:oi.remove,clear:oi.clear,values:oi.keys,size:oi.size,empty:oi.empty,each:oi.each};var ai=Array.prototype,ii=ai.map,ci=ai.slice,si={name:"implicit"};function li(){var e=ni(),t=[],n=[],r=si;function o(o){var a=o+"",i=e.get(a);if(!i){if(r!==si)return r;e.set(a,i=t.push(o))}return n[(i-1)%n.length]}return o.domain=function(n){if(!arguments.length)return t.slice();t=[],e=ni();for(var r,a,i=-1,c=n.length;++i<c;)e.has(a=(r=n[i])+"")||e.set(a,t.push(r));return o},o.range=function(e){return arguments.length?(n=ci.call(e),o):n.slice()},o.unknown=function(e){return arguments.length?(r=e,o):r},o.copy=function(){return li(t,n).unknown(r)},Xa.apply(o,arguments),o}function ui(){var e,t,n=li().unknown(void 0),r=n.domain,o=n.range,a=[0,1],i=!1,c=0,s=0,l=.5;function u(){var n=r().length,u=a[1]<a[0],d=a[u-0],f=a[1-u];e=(f-d)/Math.max(1,n-c+2*s),i&&(e=Math.floor(e)),d+=(f-d-e*(n-c))*l,t=e*(1-c),i&&(d=Math.round(d),t=Math.round(t));var p=Ga(n).map((function(t){return d+e*t}));return o(u?p.reverse():p)}return delete n.unknown,n.domain=function(e){return arguments.length?(r(e),u()):r()},n.range=function(e){return arguments.length?(a=[+e[0],+e[1]],u()):a.slice()},n.rangeRound=function(e){return a=[+e[0],+e[1]],i=!0,u()},n.bandwidth=function(){return t},n.step=function(){return e},n.round=function(e){return arguments.length?(i=!!e,u()):i},n.padding=function(e){return arguments.length?(c=Math.min(1,s=+e),u()):c},n.paddingInner=function(e){return arguments.length?(c=Math.min(1,e),u()):c},n.paddingOuter=function(e){return arguments.length?(s=+e,u()):s},n.align=function(e){return arguments.length?(l=Math.max(0,Math.min(1,e)),u()):l},n.copy=function(){return ui(r(),a).round(i).paddingInner(c).paddingOuter(s).align(l)},Xa.apply(u(),arguments)}var di=function(e,t,n){e.prototype=t.prototype=n,n.constructor=e};function fi(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function pi(){}var hi="\\s*([+-]?\\d+)\\s*",mi="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",yi="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",bi=/^#([0-9a-f]{3,8})$/,gi=new RegExp("^rgb\\("+[hi,hi,hi]+"\\)$"),vi=new RegExp("^rgb\\("+[yi,yi,yi]+"\\)$"),Oi=new RegExp("^rgba\\("+[hi,hi,hi,mi]+"\\)$"),wi=new RegExp("^rgba\\("+[yi,yi,yi,mi]+"\\)$"),_i=new RegExp("^hsl\\("+[mi,yi,yi]+"\\)$"),ki=new RegExp("^hsla\\("+[mi,yi,yi,mi]+"\\)$"),Si={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function ji(){return this.rgb().formatHex()}function Ei(){return this.rgb().formatRgb()}function Ci(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=bi.exec(e))?(n=t[1].length,t=parseInt(t[1],16),6===n?Di(t):3===n?new Ti(t>>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===n?Pi(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===n?Pi(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|240&t,((15&t)<<4|15&t)/255):null):(t=gi.exec(e))?new Ti(t[1],t[2],t[3],1):(t=vi.exec(e))?new Ti(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=Oi.exec(e))?Pi(t[1],t[2],t[3],t[4]):(t=wi.exec(e))?Pi(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=_i.exec(e))?Ai(t[1],t[2]/100,t[3]/100,1):(t=ki.exec(e))?Ai(t[1],t[2]/100,t[3]/100,t[4]):Si.hasOwnProperty(e)?Di(Si[e]):"transparent"===e?new Ti(NaN,NaN,NaN,0):null}function Di(e){return new Ti(e>>16&255,e>>8&255,255&e,1)}function Pi(e,t,n,r){return r<=0&&(e=t=n=NaN),new Ti(e,t,n,r)}function xi(e){return e instanceof pi||(e=Ci(e)),e?new Ti((e=e.rgb()).r,e.g,e.b,e.opacity):new Ti}function Fi(e,t,n,r){return 1===arguments.length?xi(e):new Ti(e,t,n,null==r?1:r)}function Ti(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}function Mi(){return"#"+Ii(this.r)+Ii(this.g)+Ii(this.b)}function Ri(){var e=this.opacity;return(1===(e=isNaN(e)?1:Math.max(0,Math.min(1,e)))?"rgb(":"rgba(")+Math.max(0,Math.min(255,Math.round(this.r)||0))+", "+Math.max(0,Math.min(255,Math.round(this.g)||0))+", "+Math.max(0,Math.min(255,Math.round(this.b)||0))+(1===e?")":", "+e+")")}function Ii(e){return((e=Math.max(0,Math.min(255,Math.round(e)||0)))<16?"0":"")+e.toString(16)}function Ai(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Li(e,t,n,r)}function Ni(e){if(e instanceof Li)return new Li(e.h,e.s,e.l,e.opacity);if(e instanceof pi||(e=Ci(e)),!e)return new Li;if(e instanceof Li)return e;var t=(e=e.rgb()).r/255,n=e.g/255,r=e.b/255,o=Math.min(t,n,r),a=Math.max(t,n,r),i=NaN,c=a-o,s=(a+o)/2;return c?(i=t===a?(n-r)/c+6*(n<r):n===a?(r-t)/c+2:(t-n)/c+4,c/=s<.5?a+o:2-a-o,i*=60):c=s>0&&s<1?0:i,new Li(i,c,s,e.opacity)}function Li(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}function Ui(e,t,n){return 255*(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)}function Bi(e,t,n,r,o){var a=e*e,i=a*e;return((1-3*e+3*a-i)*t+(4-6*a+3*i)*n+(1+3*e+3*a-3*i)*r+i*o)/6}di(pi,Ci,{copy:function(e){return Object.assign(new this.constructor,this,e)},displayable:function(){return this.rgb().displayable()},hex:ji,formatHex:ji,formatHsl:function(){return Ni(this).formatHsl()},formatRgb:Ei,toString:Ei}),di(Ti,Fi,fi(pi,{brighter:function(e){return e=null==e?1/.7:Math.pow(1/.7,e),new Ti(this.r*e,this.g*e,this.b*e,this.opacity)},darker:function(e){return e=null==e?.7:Math.pow(.7,e),new Ti(this.r*e,this.g*e,this.b*e,this.opacity)},rgb:function(){return this},displayable:function(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:Mi,formatHex:Mi,formatRgb:Ri,toString:Ri})),di(Li,(function(e,t,n,r){return 1===arguments.length?Ni(e):new Li(e,t,n,null==r?1:r)}),fi(pi,{brighter:function(e){return e=null==e?1/.7:Math.pow(1/.7,e),new Li(this.h,this.s,this.l*e,this.opacity)},darker:function(e){return e=null==e?.7:Math.pow(.7,e),new Li(this.h,this.s,this.l*e,this.opacity)},rgb:function(){var e=this.h%360+360*(this.h<0),t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,o=2*n-r;return new Ti(Ui(e>=240?e-240:e+120,o,r),Ui(e,o,r),Ui(e<120?e+240:e-120,o,r),this.opacity)},displayable:function(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl:function(){var e=this.opacity;return(1===(e=isNaN(e)?1:Math.max(0,Math.min(1,e)))?"hsl(":"hsla(")+(this.h||0)+", "+100*(this.s||0)+"%, "+100*(this.l||0)+"%"+(1===e?")":", "+e+")")}}));var Hi=function(e){return function(){return e}};function qi(e,t){var n=t-e;return n?function(e,t){return function(n){return e+n*t}}(e,n):Hi(isNaN(e)?t:e)}var zi=function e(t){var n=function(e){return 1==(e=+e)?qi:function(t,n){return n-t?function(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}(t,n,e):Hi(isNaN(t)?n:t)}}(t);function r(e,t){var r=n((e=Fi(e)).r,(t=Fi(t)).r),o=n(e.g,t.g),a=n(e.b,t.b),i=qi(e.opacity,t.opacity);return function(t){return e.r=r(t),e.g=o(t),e.b=a(t),e.opacity=i(t),e+""}}return r.gamma=e,r}(1);function Vi(e){return function(t){var n,r,o=t.length,a=new Array(o),i=new Array(o),c=new Array(o);for(n=0;n<o;++n)r=Fi(t[n]),a[n]=r.r||0,i[n]=r.g||0,c[n]=r.b||0;return a=e(a),i=e(i),c=e(c),r.opacity=1,function(e){return r.r=a(e),r.g=i(e),r.b=c(e),r+""}}}Vi((function(e){var t=e.length-1;return function(n){var r=n<=0?n=0:n>=1?(n=1,t-1):Math.floor(n*t),o=e[r],a=e[r+1],i=r>0?e[r-1]:2*o-a,c=r<t-1?e[r+2]:2*a-o;return Bi((n-r/t)*t,i,o,a,c)}})),Vi((function(e){var t=e.length;return function(n){var r=Math.floor(((n%=1)<0?++n:n)*t),o=e[(r+t-1)%t],a=e[r%t],i=e[(r+1)%t],c=e[(r+2)%t];return Bi((n-r/t)*t,o,a,i,c)}}));var Ki=function(e,t){t||(t=[]);var n,r=e?Math.min(t.length,e.length):0,o=t.slice();return function(a){for(n=0;n<r;++n)o[n]=e[n]*(1-a)+t[n]*a;return o}};function Wi(e,t){var n,r=t?t.length:0,o=e?Math.min(r,e.length):0,a=new Array(o),i=new Array(r);for(n=0;n<o;++n)a[n]=Xi(e[n],t[n]);for(;n<r;++n)i[n]=t[n];return function(e){for(n=0;n<o;++n)i[n]=a[n](e);return i}}var Gi=function(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}},Yi=function(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}},$i=function(e,t){var n,r={},o={};for(n in null!==e&&"object"==typeof e||(e={}),null!==t&&"object"==typeof t||(t={}),t)n in e?r[n]=Xi(e[n],t[n]):o[n]=t[n];return function(e){for(n in r)o[n]=r[n](e);return o}},Qi=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Ji=new RegExp(Qi.source,"g"),Zi=function(e,t){var n,r,o,a=Qi.lastIndex=Ji.lastIndex=0,i=-1,c=[],s=[];for(e+="",t+="";(n=Qi.exec(e))&&(r=Ji.exec(t));)(o=r.index)>a&&(o=t.slice(a,o),c[i]?c[i]+=o:c[++i]=o),(n=n[0])===(r=r[0])?c[i]?c[i]+=r:c[++i]=r:(c[++i]=null,s.push({i:i,x:Yi(n,r)})),a=Ji.lastIndex;return a<t.length&&(o=t.slice(a),c[i]?c[i]+=o:c[++i]=o),c.length<2?s[0]?function(e){return function(t){return e(t)+""}}(s[0].x):function(e){return function(){return e}}(t):(t=s.length,function(e){for(var n,r=0;r<t;++r)c[(n=s[r]).i]=n.x(e);return c.join("")})},Xi=function(e,t){var n,r,o=typeof t;return null==t||"boolean"===o?Hi(t):("number"===o?Yi:"string"===o?(n=Ci(t))?(t=n,zi):Zi:t instanceof Ci?zi:t instanceof Date?Gi:(r=t,!ArrayBuffer.isView(r)||r instanceof DataView?Array.isArray(t)?Wi:"function"!=typeof t.valueOf&&"function"!=typeof t.toString||isNaN(t)?$i:Yi:Ki))(e,t)},ec=function(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}},tc=function(e){return+e},nc=[0,1];function rc(e){return e}function oc(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:(n=isNaN(t)?NaN:.5,function(){return n});var n}function ac(e){var t,n=e[0],r=e[e.length-1];return n>r&&(t=n,n=r,r=t),function(e){return Math.max(n,Math.min(r,e))}}function ic(e,t,n){var r=e[0],o=e[1],a=t[0],i=t[1];return o<r?(r=oc(o,r),a=n(i,a)):(r=oc(r,o),a=n(a,i)),function(e){return a(r(e))}}function cc(e,t,n){var r=Math.min(e.length,t.length)-1,o=new Array(r),a=new Array(r),i=-1;for(e[r]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++i<r;)o[i]=oc(e[i],e[i+1]),a[i]=n(t[i],t[i+1]);return function(t){var n=Ka(e,t,1,r)-1;return a[n](o[n](t))}}function sc(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function lc(e,t){return function(){var e,t,n,r,o,a,i=nc,c=nc,s=Xi,l=rc;function u(){return r=Math.min(i.length,c.length)>2?cc:ic,o=a=null,d}function d(t){return isNaN(t=+t)?n:(o||(o=r(i.map(e),c,s)))(e(l(t)))}return d.invert=function(n){return l(t((a||(a=r(c,i.map(e),Yi)))(n)))},d.domain=function(e){return arguments.length?(i=ii.call(e,tc),l===rc||(l=ac(i)),u()):i.slice()},d.range=function(e){return arguments.length?(c=ci.call(e),u()):c.slice()},d.rangeRound=function(e){return c=ci.call(e),s=ec,u()},d.clamp=function(e){return arguments.length?(l=e?ac(i):rc,d):l!==rc},d.interpolate=function(e){return arguments.length?(s=e,u()):s},d.unknown=function(e){return arguments.length?(n=e,d):n},function(n,r){return e=n,t=r,u()}}()(e,t)}function uc(e){var t=e.domain;return e.ticks=function(e){var n=t();return function(e,t,n){var r,o,a,i,c=-1;if(n=+n,(e=+e)==(t=+t)&&n>0)return[e];if((r=t<e)&&(o=e,e=t,t=o),0===(i=Ja(e,t,n))||!isFinite(i))return[];if(i>0)for(e=Math.ceil(e/i),t=Math.floor(t/i),a=new Array(o=Math.ceil(t-e+1));++c<o;)a[c]=(e+c)*i;else for(e=Math.floor(e*i),t=Math.ceil(t*i),a=new Array(o=Math.ceil(e-t+1));++c<o;)a[c]=(e-c)/i;return r&&a.reverse(),a}(n[0],n[n.length-1],null==e?10:e)},e.tickFormat=function(e,n){var r=t();return function(e,t,n,r){var o,a=Za(e,t,n);switch((r=sn(null==r?",f":r)).type){case"s":var i=Math.max(Math.abs(e),Math.abs(t));return null!=r.precision||isNaN(o=function(e,t){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(an(t)/3)))-an(Math.abs(e)))}(a,i))||(r.precision=o),pn(r,i);case"":case"e":case"g":case"p":case"r":null!=r.precision||isNaN(o=function(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,an(t)-an(e))+1}(a,Math.max(Math.abs(e),Math.abs(t))))||(r.precision=o-("e"===r.type));break;case"f":case"%":null!=r.precision||isNaN(o=function(e){return Math.max(0,-an(Math.abs(e)))}(a))||(r.precision=o-2*("%"===r.type))}return fn(r)}(r[0],r[r.length-1],null==e?10:e,n)},e.nice=function(n){null==n&&(n=10);var r,o=t(),a=0,i=o.length-1,c=o[a],s=o[i];return s<c&&(r=c,c=s,s=r,r=a,a=i,i=r),(r=Ja(c,s,n))>0?r=Ja(c=Math.floor(c/r)*r,s=Math.ceil(s/r)*r,n):r<0&&(r=Ja(c=Math.ceil(c*r)/r,s=Math.floor(s*r)/r,n)),r>0?(o[a]=Math.floor(c/r)*r,o[i]=Math.ceil(s/r)*r,t(o)):r<0&&(o[a]=Math.ceil(c*r)/r,o[i]=Math.floor(s*r)/r,t(o)),e},e}var dc=An((function(e){e.setDate(1),e.setHours(0,0,0,0)}),(function(e,t){e.setMonth(e.getMonth()+t)}),(function(e,t){return t.getMonth()-e.getMonth()+12*(t.getFullYear()-e.getFullYear())}),(function(e){return e.getMonth()})),fc=dc,pc=(dc.range,An((function(e){e.setTime(e-e.getMilliseconds()-1e3*e.getSeconds()-6e4*e.getMinutes())}),(function(e,t){e.setTime(+e+36e5*t)}),(function(e,t){return(t-e)/36e5}),(function(e){return e.getHours()}))),hc=pc,mc=(pc.range,An((function(e){e.setTime(e-e.getMilliseconds()-1e3*e.getSeconds())}),(function(e,t){e.setTime(+e+6e4*t)}),(function(e,t){return(t-e)/6e4}),(function(e){return e.getMinutes()}))),yc=mc,bc=(mc.range,An((function(e){e.setTime(e-e.getMilliseconds())}),(function(e,t){e.setTime(+e+1e3*t)}),(function(e,t){return(t-e)/1e3}),(function(e){return e.getUTCSeconds()}))),gc=bc,vc=(bc.range,An((function(){}),(function(e,t){e.setTime(+e+t)}),(function(e,t){return t-e})));vc.every=function(e){return e=Math.floor(e),isFinite(e)&&e>0?e>1?An((function(t){t.setTime(Math.floor(t/e)*e)}),(function(t,n){t.setTime(+t+n*e)}),(function(t,n){return(n-t)/e})):vc:null};var Oc=vc;function wc(e){return new Date(e)}function _c(e){return e instanceof Date?+e:+new Date(+e)}function kc(e,t,n,r,o,a,i,c,s){var l=lc(rc,rc),u=l.invert,d=l.domain,f=s(".%L"),p=s(":%S"),h=s("%I:%M"),m=s("%I %p"),y=s("%a %d"),b=s("%b %d"),g=s("%B"),v=s("%Y"),O=[[i,1,1e3],[i,5,5e3],[i,15,15e3],[i,30,3e4],[a,1,6e4],[a,5,3e5],[a,15,9e5],[a,30,18e5],[o,1,36e5],[o,3,108e5],[o,6,216e5],[o,12,432e5],[r,1,864e5],[r,2,1728e5],[n,1,6048e5],[t,1,2592e6],[t,3,7776e6],[e,1,31536e6]];function w(c){return(i(c)<c?f:a(c)<c?p:o(c)<c?h:r(c)<c?m:t(c)<c?n(c)<c?y:b:e(c)<c?g:v)(c)}function _(t,n,r,o){if(null==t&&(t=10),"number"==typeof t){var a=Math.abs(r-n)/t,i=qa((function(e){return e[2]})).right(O,a);i===O.length?(o=Za(n/31536e6,r/31536e6,t),t=e):i?(o=(i=O[a/O[i-1][2]<O[i][2]/a?i-1:i])[1],t=i[0]):(o=Math.max(Za(n,r,t),1),t=c)}return null==o?t:t.every(o)}return l.invert=function(e){return new Date(u(e))},l.domain=function(e){return arguments.length?d(ii.call(e,_c)):d().map(wc)},l.ticks=function(e,t){var n,r=d(),o=r[0],a=r[r.length-1],i=a<o;return i&&(n=o,o=a,a=n),n=(n=_(e,o,a,t))?n.range(o,a+1):[],i?n.reverse():n},l.tickFormat=function(e,t){return null==t?w:s(t)},l.nice=function(e,t){var n=d();return(e=_(e,n[0],n[n.length-1],t))?d(function(e,t){var n,r=0,o=(e=e.slice()).length-1,a=e[r],i=e[o];return i<a&&(n=r,r=o,o=n,n=a,a=i,i=n),e[r]=t.floor(a),e[o]=t.ceil(i),e}(n,e)):l},l.copy=function(){return sc(l,kc(e,t,n,r,o,a,i,c,s))},l}vc.range,((An((function(e){e.setUTCDate(1),e.setUTCHours(0,0,0,0)}),(function(e,t){e.setUTCMonth(e.getUTCMonth()+t)}),(function(e,t){return t.getUTCMonth()-e.getUTCMonth()+12*(t.getUTCFullYear()-e.getUTCFullYear())}),(function(e){return e.getUTCMonth()})).range,An((function(e){e.setUTCMinutes(0,0,0)}),(function(e,t){e.setTime(+e+36e5*t)}),(function(e,t){return(t-e)/36e5}),(function(e){return e.getUTCHours()}))).range,An((function(e){e.setUTCSeconds(0,0)}),(function(e,t){e.setTime(+e+6e4*t)}),(function(e,t){return(t-e)/6e4}),(function(e){return e.getUTCMinutes()}))).range;var Sc=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return ui().domain(e.filter((function(e){return e.visible})).map((function(e){return e.key}))).rangeRound([0,t.bandwidth()]).padding(n?0:.07)},jc=function(e,t){return function(){return Xa.apply(kc(or,fc,Yn,nr,hc,yc,gc,Oc,dr).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}().domain([pt()(e[0],"YYYY-MM-DD HH:mm").toDate(),pt()(e[e.length-1],"YYYY-MM-DD HH:mm").toDate()]).rangeRound([0,t])},Ec=Array.prototype.slice,Cc=function(e){return e};function Dc(e){return"translate("+(e+.5)+",0)"}function Pc(e){return"translate(0,"+(e+.5)+")"}function xc(e){return function(t){return+e(t)}}function Fc(e){var t=Math.max(0,e.bandwidth()-1)/2;return e.round()&&(t=Math.round(t)),function(n){return+e(n)+t}}function Tc(){return!this.__axis}function Mc(e,t){var n=[],r=null,o=null,a=6,i=6,c=3,s=1===e||4===e?-1:1,l=4===e||2===e?"x":"y",u=1===e||3===e?Dc:Pc;function d(d){var f=null==r?t.ticks?t.ticks.apply(t,n):t.domain():r,p=null==o?t.tickFormat?t.tickFormat.apply(t,n):Cc:o,h=Math.max(a,0)+c,m=t.range(),y=+m[0]+.5,b=+m[m.length-1]+.5,g=(t.bandwidth?Fc:xc)(t.copy()),v=d.selection?d.selection():d,O=v.selectAll(".domain").data([null]),w=v.selectAll(".tick").data(f,t).order(),_=w.exit(),k=w.enter().append("g").attr("class","tick"),S=w.select("line"),j=w.select("text");O=O.merge(O.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),w=w.merge(k),S=S.merge(k.append("line").attr("stroke","currentColor").attr(l+"2",s*a)),j=j.merge(k.append("text").attr("fill","currentColor").attr(l,s*h).attr("dy",1===e?"0em":3===e?"0.71em":"0.32em")),d!==v&&(O=O.transition(d),w=w.transition(d),S=S.transition(d),j=j.transition(d),_=_.transition(d).attr("opacity",1e-6).attr("transform",(function(e){return isFinite(e=g(e))?u(e):this.getAttribute("transform")})),k.attr("opacity",1e-6).attr("transform",(function(e){var t=this.parentNode.__axis;return u(t&&isFinite(t=t(e))?t:g(e))}))),_.remove(),O.attr("d",4===e||2==e?i?"M"+s*i+","+y+"H0.5V"+b+"H"+s*i:"M0.5,"+y+"V"+b:i?"M"+y+","+s*i+"V0.5H"+b+"V"+s*i:"M"+y+",0.5H"+b),w.attr("opacity",1).attr("transform",(function(e){return u(g(e))})),S.attr(l+"2",s*a),j.attr(l,s*h).text(p),v.filter(Tc).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",2===e?"start":4===e?"end":"middle"),v.each((function(){this.__axis=g}))}return d.scale=function(e){return arguments.length?(t=e,d):t},d.ticks=function(){return n=Ec.call(arguments),d},d.tickArguments=function(e){return arguments.length?(n=null==e?[]:Ec.call(e),d):n.slice()},d.tickValues=function(e){return arguments.length?(r=null==e?null:Ec.call(e),d):r&&r.slice()},d.tickFormat=function(e){return arguments.length?(o=e,d):o},d.tickSize=function(e){return arguments.length?(a=i=+e,d):a},d.tickSizeInner=function(e){return arguments.length?(a=+e,d):a},d.tickSizeOuter=function(e){return arguments.length?(i=+e,d):i},d.tickPadding=function(e){return arguments.length?(c=+e,d):c},d}function Rc(e){return Mc(3,e)}function Ic(e){return Mc(4,e)}var Ac=function(e){for(var t=[],n=1;n<=Math.floor(Math.sqrt(e));n++)e%n==0&&(t.push(n),e/n!==n&&t.push(e/n));return t.sort((function(e,t){return e-t})),t},Nc=function(e,t,n,r){var o=pt()(e).toDate(),a=0!==t?n[t-1]:n[t];return a=a instanceof Date?a:pt()(a).toDate(),0===t?r(o):function(e,t){for(var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new RegExp([" |,"],"g"),r=e.split(n),o=t.split(n),a=new Array,i=e.length>t.length?r:o,c=0;c<i.length;c++)r[c]!==o[c]&&a.push(o[c]);return a}(r(a),r(o)).join(" ")},Lc=function(e,t,n){for(var r=[],o=0;o<e;o++){var a=(o+1)/e*t,i=n?Math.round(a):a;r[r.length-1]!==i&&r.push(i)}return r},Uc=function(e,t,n,r,o,a){!function(e,t,n,r){var o,a,i,c,s,l,u=n.yScale.range()[0],d=(o=t.uniqueDates,a=n.xScale.range()[1],i=t.mode,c=t.interval,l=function(e,t){if(e<783)return 7;if(e>=783&&e<=1130)return 12;if(e>1130&&e<=1365){if("time-comparison"===t)return 16;if("item-comparison"===t)return 12}else if(e>1365){if("time-comparison"===t)return 31;if("item-comparison"===t)return 16}return 16}(a,i),(o.length>=63&&"day"===c||o.length>=9&&"week"===c)&&(o=(s=o).filter((function(e,t){return 0===t||pt()(e).toDate().getMonth()!==pt()(s[t-1]).toDate().getMonth()}))),o.length<=l||"hour"===c&&function(e){var t=pt()(e[0]).toDate(),n=pt()(e[e.length-1]).toDate();return t.getDate()===n.getDate()&&t.getMonth()===n.getMonth()&&t.getFullYear()===n.getFullYear()}(o)&&a>783?o:function(e,t){for(var n=[],r=0;r<e.length;r+=t)n.push(e[r]);return n[0]!==e[0]&&n.unshift(e[0]),n}(o,function(e,t){for(var n=[],r=1;n.length<=3;)n=Ac(e.length-r),r+=1;return n.find((function(n){return e.length/n<t}))}(o,l)));"line"===t.chartType&&(d=d.map((function(e){return pt()(e).toDate()}))),e.append("g").attr("class","axis").attr("aria-hidden","true").attr("transform","translate(0, ".concat(u,")")).call(Rc(n.xScale).tickValues(d).tickFormat((function(e,n){return"hour"===t.interval?r.xFormat(e instanceof Date?e:pt()(e).toDate()):Nc(e,n,d,r.xFormat)}))),e.append("g").attr("class","axis axis-month").attr("aria-hidden","true").attr("transform","translate(0, ".concat(u+14,")")).call(Rc(n.xScale).tickValues(d).tickFormat((function(e,t){return Nc(e,t,d,r.x2Format)}))),e.append("g").attr("class","pipes").attr("transform","translate(0, ".concat(u,")")).call(Rc(n.xScale).tickValues(d).tickSize(5).tickFormat(""))}(e,t,n,r),function(e,t,n,r,o){var a,c,s,l=(a=t.yScale.domain()[0],c=t.yScale.domain()[1],s=t.step,[0].concat(i()(function(e,t){if(e>=0)return[];var n=Math.ceil(-e/t);return Lc(n,e,e<-1)}(a,s)),i()(function(e,t){if(e<=0)return[];var n=Math.ceil(e/t);return Lc(n,e,e>1)}(c,s)))),u=t.xScale.range()[1],d=o?u+r.left+r.right/2-15:-r.left/2-15,f=t.yMin>=0||t.yMax>0?" with-positive-ticks":"";e.append("g").attr("class","grid"+f).attr("transform","translate(-".concat(r.left,", 0)")).call(Ic(t.yScale).tickValues(l).tickSize(-u-r.left-r.right).tickFormat("")),e.append("g").attr("class","axis y-axis").attr("aria-hidden","true").attr("transform","translate("+d+", 12)").attr("text-anchor","start").call(Ic(t.yScale).tickValues(0===t.yMax&&0===t.yMin?[l[0]]:l).tickFormat((function(e){return e>-1&&e<1&&n.yBelow1Format?n.yBelow1Format(e):n.yFormat(e)})))}(e,n,r,o,a),e.selectAll(".domain").remove(),e.selectAll(".axis .tick line").remove()},Bc=Math.PI,Hc=2*Bc,qc=Hc-1e-6;function zc(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function Vc(){return new zc}zc.prototype=Vc.prototype={constructor:zc,moveTo:function(e,t){this._+="M"+(this._x0=this._x1=+e)+","+(this._y0=this._y1=+t)},closePath:function(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")},lineTo:function(e,t){this._+="L"+(this._x1=+e)+","+(this._y1=+t)},quadraticCurveTo:function(e,t,n,r){this._+="Q"+ +e+","+ +t+","+(this._x1=+n)+","+(this._y1=+r)},bezierCurveTo:function(e,t,n,r,o,a){this._+="C"+ +e+","+ +t+","+ +n+","+ +r+","+(this._x1=+o)+","+(this._y1=+a)},arcTo:function(e,t,n,r,o){e=+e,t=+t,n=+n,r=+r,o=+o;var a=this._x1,i=this._y1,c=n-e,s=r-t,l=a-e,u=i-t,d=l*l+u*u;if(o<0)throw new Error("negative radius: "+o);if(null===this._x1)this._+="M"+(this._x1=e)+","+(this._y1=t);else if(d>1e-6)if(Math.abs(u*c-s*l)>1e-6&&o){var f=n-a,p=r-i,h=c*c+s*s,m=f*f+p*p,y=Math.sqrt(h),b=Math.sqrt(d),g=o*Math.tan((Bc-Math.acos((h+d-m)/(2*y*b)))/2),v=g/b,O=g/y;Math.abs(v-1)>1e-6&&(this._+="L"+(e+v*l)+","+(t+v*u)),this._+="A"+o+","+o+",0,0,"+ +(u*f>l*p)+","+(this._x1=e+O*c)+","+(this._y1=t+O*s)}else this._+="L"+(this._x1=e)+","+(this._y1=t)},arc:function(e,t,n,r,o,a){e=+e,t=+t,a=!!a;var i=(n=+n)*Math.cos(r),c=n*Math.sin(r),s=e+i,l=t+c,u=1^a,d=a?r-o:o-r;if(n<0)throw new Error("negative radius: "+n);null===this._x1?this._+="M"+s+","+l:(Math.abs(this._x1-s)>1e-6||Math.abs(this._y1-l)>1e-6)&&(this._+="L"+s+","+l),n&&(d<0&&(d=d%Hc+Hc),d>qc?this._+="A"+n+","+n+",0,1,"+u+","+(e-i)+","+(t-c)+"A"+n+","+n+",0,1,"+u+","+(this._x1=s)+","+(this._y1=l):d>1e-6&&(this._+="A"+n+","+n+",0,"+ +(d>=Bc)+","+u+","+(this._x1=e+n*Math.cos(o))+","+(this._y1=t+n*Math.sin(o))))},rect:function(e,t,n,r){this._+="M"+(this._x0=this._x1=+e)+","+(this._y0=this._y1=+t)+"h"+ +n+"v"+ +r+"h"+-n+"Z"},toString:function(){return this._}};var Kc=Vc,Wc=function(e){return function(){return e}};function Gc(e){this._context=e}Gc.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t)}}};var Yc=function(e){return new Gc(e)};function $c(e){return e[0]}function Qc(e){return e[1]}function Jc(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Zc(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Jc(Object(n),!0).forEach((function(t){o()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Jc(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Xc=function(e,t,n,r,o,a){var i,c,s=r.yScale.range()[0],l=r.xScale.range()[1],u=(i=r.xScale,c=r.yScale,function(){var e=$c,t=Qc,n=Wc(!0),r=null,o=Yc,a=null;function i(i){var c,s,l,u=i.length,d=!1;for(null==r&&(a=o(l=Kc())),c=0;c<=u;++c)!(c<u&&n(s=i[c],c,i))===d&&((d=!d)?a.lineStart():a.lineEnd()),d&&a.point(+e(s,c,i),+t(s,c,i));if(l)return a=null,l+""||null}return i.x=function(t){return arguments.length?(e="function"==typeof t?t:Wc(+t),i):e},i.y=function(e){return arguments.length?(t="function"==typeof e?e:Wc(+e),i):t},i.defined=function(e){return arguments.length?(n="function"==typeof e?e:Wc(!!e),i):n},i.curve=function(e){return arguments.length?(o=e,null!=r&&(a=o(r)),i):o},i.context=function(e){return arguments.length?(null==e?r=a=null:a=o(r=e),i):r},i}().x((function(e){return i(pt()(e.date).toDate())})).y((function(e){return c(e.value)}))),d=function(e,t){return t.map((function(t){return{key:t.key,focus:t.focus,visible:t.visible,label:t.label,values:e.map((function(e){return{date:e.date,focus:t.focus,value:Object(_.get)(e,[t.key,"value"],0),visible:t.visible}}))}}))}(t,n.visibleKeys),f=e.append("g").attr("class","lines").selectAll(".line-g").data(d.filter((function(e){return e.visible})).reverse()).enter().append("g").attr("class","line-g").attr("role","region").attr("aria-label",(function(e){return e.label||e.key})),p=function(e,t,n,r,o){var a=n.slice().reverse();return t.map((function(n,i){var c=Object(_.first)(e.filter((function(e){return e.date===n}))),s=o(pt()(n).toDate()),l=o(i>=1?pt()(t[i-1]).toDate():pt()(t[0]).toDate()),u=i<t.length-1?o(pt()(t[i+1]).toDate()):o(pt()(t[t.length-1]).toDate()),d=0===i?u-s:s-l,f=0===i?0:s-d/2;return d=0===i||i===t.length-1?d/2:d,{date:n,start:t.length>1?f:0,width:t.length>1?d:r,values:a.map((function(e){var t=e.key,r=c[t];return r?{key:t,value:r.value,date:n}:null})).filter(Boolean)}}))}(t,n.uniqueDates,n.visibleKeys,l,r.xScale),h=l<=1365||n.uniqueDates.length>50?2:3;h=l<=783?1.25:h;var m=l<=1365?4:6;n.uniqueDates.length>1&&f.append("path").attr("fill","none").attr("stroke-width",h).attr("stroke-linejoin","round").attr("stroke-linecap","round").attr("stroke",(function(e){return n.getColor(e.key)})).style("opacity",(function(e){var t=e.focus?1:.1;return e.visible?t:0})).attr("d",(function(e){return u(e.values)})),l/n.uniqueDates.length>36&&f.selectAll("circle").data((function(e,t){return e.values.map((function(n){return Zc(Zc({},n),{},{i:t,visible:e.visible,key:e.key})}))})).enter().append("circle").attr("r",m).attr("fill",(function(e){return n.getColor(e.key)})).attr("stroke","#fff").attr("stroke-width",h+1).style("opacity",(function(e){var t=e.focus?1:.1;return e.visible?t:0})).attr("cx",(function(e){return r.xScale(pt()(e.date).toDate())})).attr("cy",(function(e){return r.yScale(e.value)})).attr("tabindex","0").attr("role","graphics-symbol").attr("aria-label",(function(e){var t=o.screenReaderFormat(e.date instanceof Date?e.date:pt()(e.date).toDate());return"".concat(t," ").concat(a.valueFormat(e.value))})).on("focus",(function(e,n,r){a.show(t.find((function(t){return t.date===e.date})),r[n].parentNode,Ea.target)})).on("blur",(function(){return a.hide()}));var y=e.append("g").attr("class","focusspaces").selectAll(".focus").data(p).enter().append("g").attr("class","focus"),b=y.append("g").attr("class","focus-grid").attr("opacity","0");b.append("line").attr("x1",(function(e){return r.xScale(pt()(e.date).toDate())})).attr("y1",0).attr("x2",(function(e){return r.xScale(pt()(e.date).toDate())})).attr("y2",s),b.selectAll("circle").data((function(e){return e.values})).enter().append("circle").attr("r",m+2).attr("fill",(function(e){return n.getColor(e.key)})).attr("stroke","#fff").attr("stroke-width",h+2).attr("cx",(function(e){return r.xScale(pt()(e.date).toDate())})).attr("cy",(function(e){return r.yScale(e.value)})),y.append("rect").attr("class","focus-g").attr("x",(function(e){return e.start})).attr("y",0).attr("width",(function(e){return e.width})).attr("height",s).attr("opacity",0).on("mouseover",(function(e,r,o){var i=(0===r||r===p.length-1)&&n.uniqueDates.length>1?0:.5;a.show(t.find((function(t){return t.date===e.date})),Ea.target,o[r].parentNode,i)})).on("mouseout",(function(){return a.hide()}))},es=[[],[.5],[.333,.667],[.2,.5,.8],[.12,.375,.625,.88],[0,.25,.5,.75,1]],ts=function(e,t){return function(n){var r=e.length>5?5:e.length,o=Object(_.findIndex)(e,(function(e){return e.key===n})),a=o<=4?es[r][o]:0;return t(a)}},ns=function(){function e(){s()(this,e),this.ref=null,this.chart=null,this.position="",this.title="",this.labelFormat="",this.valueFormat="",this.visibleKeys="",this.getColor=null,this.margin=24}return u()(e,[{key:"calculateXPosition",value:function(e,t,n){var r=this.ref.getBoundingClientRect(),o=this.ref.parentNode.querySelector(".d3-base").getBoundingClientRect(),a=Math.max(o.left,t.left);if("below"===this.position)return Math.max(this.margin,Math.min(e.left+.5*e.width-r.width/2-a,o.width-r.width-this.margin));var i=e.left+e.width*n+this.margin-a;return i+r.width+this.margin>o.width?Math.max(this.margin,e.left+e.width*(1-n)-r.width-this.margin-a):i}},{key:"calculateYPosition",value:function(e,t){if("below"===this.position)return t.height;var n=this.ref.getBoundingClientRect(),r=e.top+this.margin-t.top;return r+n.height+this.margin>t.height?Math.max(0,e.top-n.height-this.margin-t.top):r}},{key:"calculatePosition",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=e.getBoundingClientRect(),r=this.chart.getBoundingClientRect();return"below"===this.position&&(t=0),{x:this.calculateXPosition(n,r,t),y:this.calculateYPosition(n,r)}}},{key:"hide",value:function(){Na(this.chart).selectAll(".barfocus, .focus-grid").attr("opacity","0"),Na(this.ref).style("visibility","hidden")}},{key:"getTooltipRowLabel",value:function(e,t){return e[t.key].labelDate?this.labelFormat(pt()(e[t.key].labelDate).toDate()):t.label||t.key}},{key:"show",value:function(e,t,n){var r=this,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;if(this.visibleKeys.length){Na(n).select(".focus-grid, .barfocus").attr("opacity","1");var a=this.calculatePosition(t,o),i=this.visibleKeys.map((function(t){return'\n\t\t\t\t\t<li class="key-row">\n\t\t\t\t\t\t<div class="key-container">\n\t\t\t\t\t\t\t<span\n\t\t\t\t\t\t\t\tclass="key-color"\n\t\t\t\t\t\t\t\tstyle="background-color: '.concat(r.getColor(t.key),'">\n\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t<span class="key-key">').concat(r.getTooltipRowLabel(e,t),'</span>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<span class="key-value">').concat(r.valueFormat(e[t.key].value),"</span>\n\t\t\t\t\t</li>\n\t\t\t\t")})),c=this.title?this.title:this.labelFormat(pt()(e.date).toDate());Na(this.ref).style("left",a.x+"px").style("top",a.y+"px").style("visibility","visible").html("\n\t\t\t\t<div>\n\t\t\t\t\t<h4>".concat(c,"</h4>\n\t\t\t\t\t<ul>\n\t\t\t\t\t").concat(i.join(""),"\n\t\t\t\t\t</ul>\n\t\t\t\t</div>\n\t\t\t"))}}}]),e}();var rs=function(){return"rtl"===document.documentElement.dir},os=function(e){h()(o,e);var t,n,r=(t=o,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=g()(t);if(n){var o=g()(this).constructor;e=Reflect.construct(r,arguments,o)}else e=r.apply(this,arguments);return y()(this,e)});function o(e){var t;return s()(this,o),(t=r.call(this,e)).drawChart=t.drawChart.bind(f()(t)),t.getParams=t.getParams.bind(f()(t)),t.tooltipRef=Object(v.createRef)(),t}return u()(o,[{key:"getFormatParams",value:function(){var e=this.props,t=e.screenReaderFormat,n=e.xFormat,r=e.x2Format,o=e.yFormat,a=e.yBelow1Format;return{screenReaderFormat:Ua(t,dr),xFormat:Ua(n,dr),x2Format:Ua(r,dr),yBelow1Format:Ua(a),yFormat:Ua(o)}}},{key:"getScaleParams",value:function(e){var t=this.props,n=t.data,r=t.height,o=t.orderedKeys,a=t.chartType,i=this.getMargin(),c=r-i.top-i.bottom,s=this.getWidth()-i.left-i.right,l=function(e){var t=function(e){var t=Number.NEGATIVE_INFINITY,n=Number.POSITIVE_INFINITY;return e.forEach((function(e){for(var r=0,o=Object.entries(e);r<o.length;r++){var a=tt()(o[r],2),i=a[0],c=a[1];"date"!==i&&Number.isFinite(c.value)&&c.value>t&&(t=c.value),"date"!==i&&Number.isFinite(c.value)&&c.value<n&&(n=c.value)}})),{upper:t,lower:n}}(e),n=t.lower,r=t.upper,o=function(e,t){if(!Number.isFinite(e)||!Number.isFinite(t))return 1;if(0===t&&0===e)return 1/3;var n=4/3*Math.max(-e,t),r=3*Math.pow(10,(Math.log(n)*Math.LOG10E+1|0)-2),o=Math.ceil(n/r)*r/3;return t<1&&e>-1?Math.round(4*o)/4:Math.ceil(o)}(n,r),a={lower:0,upper:0,step:o};return(Number.isFinite(n)||n<0)&&(a.lower=Math.floor(n/o)*o,a.lower===n&&0!==n&&(a.lower-=o)),(Number.isFinite(r)||r>0)&&(a.upper=Math.ceil(r/o)*o,a.upper===r&&0!==r&&(a.upper+=o)),a}(n),u=l.upper,d=l.lower,f=l.step,p=function(e,t,n){return function e(){var t=lc(rc,rc);return t.copy=function(){return sc(t,e())},Xa.apply(t,arguments),uc(t)}().domain([Math.min(t,0),0===n&&0===t?1:Math.max(n,0)]).rangeRound([e,0])}(c,d,u);if("line"===a)return{step:f,xScale:jc(e,s),yMax:u,yMin:d,yScale:p};var h=this.shouldBeCompact(),m=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return ui().domain(e).range([0,t]).paddingInner(n?0:.1)}(e,s,h);return{step:f,xGroupScale:Sc(o,m,h),xScale:m,yMax:u,yMin:d,yScale:p}}},{key:"getParams",value:function(e){var t=this.props,n=t.chartType,r=t.colorScheme,o=t.data,a=t.interval,i=t.mode,c=t.orderedKeys||function(e){return Ba(e).map((function(t){return{key:t,focus:!0,total:e.reduce((function(e,n){return e+n[t].value}),0),visible:!0}})).sort((function(e,t){return t.total-e.total}))}(o),s=c.filter((function(e){return e.visible})),l=c.length>5?s:c;return{getColor:ts(l,r),interval:a,mode:i,chartType:n,uniqueDates:e,visibleKeys:s}}},{key:"createTooltip",value:function(e,t,n){var r=this.props,o=r.tooltipLabelFormat,a=r.tooltipPosition,i=r.tooltipTitle,c=r.tooltipValueFormat,s=new ns;s.ref=this.tooltipRef.current,s.chart=e,s.position=a,s.title=i,s.labelFormat=Ua(o,dr),s.valueFormat=Ua(c),s.visibleKeys=n,s.getColor=t,this.tooltip=s}},{key:"drawChart",value:function(e){var t=this.props,n=t.data,r=t.dateParser,o=t.chartType,a=this.getMargin(),c=function(e,t){var n=fr(t),r=new Set(e.map((function(e){return e.date})));return i()(r).sort((function(e,t){return n(e)-n(t)}))}(n,r),s=this.getFormatParams(),l=this.getParams(c),u=this.getScaleParams(c),d=e.attr("id","chart").append("g").attr("transform","translate(".concat(a.left,", ").concat(a.top,")"));this.createTooltip(d.node(),l.getColor,l.visibleKeys),Uc(d,l,u,s,a,rs()),"line"===o&&Xc(d,n,l,u,s,this.tooltip),"bar"===o&&function(e,t,n,r,o,a){var i=r.yScale.range()[0],c=e.append("g").attr("class","bars").selectAll("g").data(t).enter().append("g").attr("transform",(function(e){return"translate(".concat(r.xScale(e.date),", 0)")})).attr("class","bargroup").attr("role","region").attr("aria-label",(function(e){return"item-comparison"===n.mode?o.screenReaderFormat(e.date instanceof Date?e.date:pt()(e.date).toDate()):null}));c.append("rect").attr("class","barfocus").attr("x",0).attr("y",0).attr("width",r.xGroupScale.range()[1]).attr("height",i).attr("opacity","0").on("mouseover",(function(e,n,r){a.show(t.find((function(t){return t.date===e.date})),Ea.target,r[n].parentNode)})).on("mouseout",(function(){return a.hide()}));var s=r.yScale(0);c.selectAll(".bar").data((function(e){return n.visibleKeys.map((function(t){return{key:t.key,focus:t.focus,value:Object(_.get)(e,[t.key,"value"],0),label:t.label,visible:t.visible,date:e.date}}))})).enter().append("rect").attr("class","bar").attr("x",(function(e){return r.xGroupScale(e.key)})).attr("y",(function(e){return Math.min(s,r.yScale(e.value))})).attr("width",r.xGroupScale.bandwidth()).attr("height",(function(e){return Math.abs(s-r.yScale(e.value))})).attr("fill",(function(e){return n.getColor(e.key)})).attr("pointer-events","none").attr("tabindex","0").attr("aria-label",(function(e){var r=e.label||e.key;if("time-comparison"===n.mode){var i=t.find((function(t){return t.date===e.date}));r=o.screenReaderFormat(pt()(i[e.key].labelDate).toDate())}return"".concat(r," ").concat(a.valueFormat(e.value))})).style("opacity",(function(e){var t=e.focus?1:.1;return e.visible?t:0})).on("focus",(function(e,n,r){var o=e.value>0?Ea.target:Ea.target.parentNode;a.show(t.find((function(t){return t.date===e.date})),o,r[n].parentNode)})).on("blur",(function(){return a.hide()}))}(d,n,l,u,s,this.tooltip)}},{key:"shouldBeCompact",value:function(){var e=this.props,t=e.data,n=e.chartType,r=e.width;if("bar"!==n)return!1;var o=this.getMargin(),a=r-o.left-o.right,i=t&&t.length?Object.keys(t[0]).length-1:0;return a<t.length*(i+1)}},{key:"getMargin",value:function(){var e=this.props.margin;return rs()?{bottom:e.bottom,left:e.right,right:e.left,top:e.top}:e}},{key:"getWidth",value:function(){var e=this.props,t=e.data,n=e.chartType,r=e.width;if("bar"!==n)return r;var o=this.getMargin(),a=t&&t.length?Object.keys(t[0]).length-1:0,i=this.shouldBeCompact()?t.length*a:t.length*(a+1);return Math.max(r,i+o.left+o.right)}},{key:"getEmptyMessage",value:function(){var e=this.props,t=e.baseValue,n=e.data,r=e.emptyMessage;if(r&&function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=0;n<e.length;n++)for(var r=0,o=Object.entries(e[n]);r<o.length;r++){var a=tt()(o[r],2),i=a[0],c=a[1];if("date"!==i&&!Object(_.isNil)(c.value)&&c.value!==t)return!1}return!0}(n,t))return Object(v.createElement)("div",{className:"d3-chart__empty-message"},r)}},{key:"render",value:function(){var e=this.props,t=e.className,n=e.data,r=e.height,o=e.orderedKeys,a=e.chartType,i=this.getWidth();return Object(v.createElement)("div",{className:q()("d3-chart__container",t),style:{height:r}},this.getEmptyMessage(),Object(v.createElement)("div",{className:"d3-chart__tooltip",ref:this.tooltipRef}),Object(v.createElement)(La,{className:q()(t),data:n,drawChart:this.drawChart,height:r,orderedKeys:o,tooltip:this.tooltip,chartType:a,width:i}))}}]),o}(v.Component);os.propTypes={baseValue:S.a.number,className:S.a.string,colorScheme:S.a.func,data:S.a.array.isRequired,dateParser:S.a.string.isRequired,emptyMessage:S.a.string,height:S.a.number,interval:S.a.oneOf(["hour","day","week","month","quarter","year"]),margin:S.a.shape({bottom:S.a.number,left:S.a.number,right:S.a.number,top:S.a.number}),mode:S.a.oneOf(["item-comparison","time-comparison"]),screenReaderFormat:S.a.oneOfType([S.a.string,S.a.func]),orderedKeys:S.a.array,tooltipLabelFormat:S.a.oneOfType([S.a.string,S.a.func]),tooltipValueFormat:S.a.oneOfType([S.a.string,S.a.func]),tooltipPosition:S.a.oneOf(["below","over"]),tooltipTitle:S.a.string,chartType:S.a.oneOf(["bar","line"]),width:S.a.number,xFormat:S.a.oneOfType([S.a.string,S.a.func]),x2Format:S.a.oneOfType([S.a.string,S.a.func]),yBelow1Format:S.a.oneOfType([S.a.string,S.a.func]),yFormat:S.a.oneOfType([S.a.string,S.a.func])},os.defaultProps={baseValue:0,data:[],dateParser:"%Y-%m-%dT%H:%M:%S",height:200,margin:{bottom:30,left:40,right:0,top:20},mode:"time-comparison",screenReaderFormat:"%B %-d, %Y",tooltipPosition:"over",tooltipLabelFormat:"%B %-d, %Y",tooltipValueFormat:",",chartType:"line",width:600,xFormat:"%Y-%m-%d",x2Format:"",yBelow1Format:".3~f",yFormat:".3~s"};var as=os;var is=function(e){h()(o,e);var t,n,r=(t=o,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=g()(t);if(n){var o=g()(this).constructor;e=Reflect.construct(r,arguments,o)}else e=r.apply(this,arguments);return y()(this,e)});function o(){var e;return s()(this,o),(e=r.call(this)).listRef=Object(v.createRef)(),e.state={isScrollable:!1},e}return u()(o,[{key:"componentDidMount",value:function(){this.updateListScroll(),window.addEventListener("resize",this.updateListScroll)}},{key:"componentWillUnmount",value:function(){window.removeEventListener("resize",this.updateListScroll)}},{key:"updateListScroll",value:function(){if(this&&this.listRef){var e=this.listRef.current,t=e.scrollHeight-e.scrollTop<=e.offsetHeight;this.setState({isScrollable:!t})}}},{key:"render",value:function(){var e=this.props,t=e.colorScheme,n=e.data,r=e.handleLegendHover,o=e.handleLegendToggle,a=e.interactive,i=e.legendDirection,c=e.legendValueFormat,s=e.instanceId,l=e.totalLabel,u=this.state.isScrollable,d=n.filter((function(e){return e.visible})),f=d.length,p="column"===i&&n.length>5&&l,h=n.length>5?d:n;return Object(v.createElement)("div",{className:q()("woocommerce-legend","woocommerce-legend__direction-".concat(i),{"has-total":p,"is-scrollable":u},this.props.className)},Object(v.createElement)("ul",{className:"woocommerce-legend__list",ref:this.listRef,onScroll:p?this.updateListScroll:null},n.map((function(e){return Object(v.createElement)("li",{className:q()("woocommerce-legend__item",{"woocommerce-legend__item-checked":e.visible}),key:e.key,id:"woocommerce-legend-".concat(s,"__item__").concat(e.key),onMouseEnter:r,onMouseLeave:r,onBlur:r,onFocus:r},Object(v.createElement)("button",{role:"checkbox","aria-checked":e.visible?"true":"false",onClick:o,id:"woocommerce-legend-".concat(s,"__item-button__").concat(e.key),disabled:e.visible&&f<=1||!e.visible&&f>=5||!a,title:f>=5?Object(O.sprintf)(Object(O.__)("You may select up to %d items.",'woocommerce'),5):""},Object(v.createElement)("div",{className:"woocommerce-legend__item-container"},Object(v.createElement)("span",{className:q()("woocommerce-legend__item-checkmark",{"woocommerce-legend__item-checkmark-checked":e.visible}),style:e.visible?{color:ts(h,t)(e.key)}:null}),Object(v.createElement)("span",{className:"woocommerce-legend__item-title"},e.label),Object(v.createElement)("span",{className:"woocommerce-legend__item-total"},Ua(c)(e.total)))))}))),p&&Object(v.createElement)("div",{className:"woocommerce-legend__total"},l))}}]),o}(v.Component);is.propTypes={className:S.a.string,colorScheme:S.a.func,data:S.a.array.isRequired,handleLegendToggle:S.a.func,handleLegendHover:S.a.func,interactive:S.a.bool,legendDirection:S.a.oneOf(["row","column"]),legendValueFormat:S.a.oneOfType([S.a.string,S.a.func]),totalLabel:S.a.string,instanceId:S.a.number},is.defaultProps={interactive:!0,legendDirection:"row",legendValueFormat:","};var cs=Object(Z.withInstanceId)(is);function ss(e,t){switch(t){case"left_space":return[e+" ",""];case"right":return["",e];case"right_space":return[""," "+e];case"left":default:return[e,""]}}var ls=function(e){h()(o,e);var t,n,r=(t=o,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=g()(t);if(n){var o=g()(this).constructor;e=Reflect.construct(r,arguments,o)}else e=r.apply(this,arguments);return y()(this,e)});function o(e){var t;s()(this,o),(t=r.call(this,e)).chartBodyRef=Object(v.createRef)();var n=t.getDataKeys();return t.state={focusedKeys:[],visibleKeys:n.slice(0,5),width:0},t.prevDataKeys=n.sort(),t.handleTypeToggle=t.handleTypeToggle.bind(f()(t)),t.handleLegendToggle=t.handleLegendToggle.bind(f()(t)),t.handleLegendHover=t.handleLegendHover.bind(f()(t)),t.updateDimensions=t.updateDimensions.bind(f()(t)),t.getVisibleData=Pn(t.getVisibleData),t.getOrderedKeys=Pn(t.getOrderedKeys),t.setInterval=t.setInterval.bind(f()(t)),t}return u()(o,[{key:"getDataKeys",value:function(){var e=this.props,t=e.data,n=e.filterParam,r=e.mode,o=e.query;if("item-comparison"===r){var a=n?Object(P.f)(o[n]):[];return this.getOrderedKeys([],[],a).map((function(e){return e.key}))}return Ba(t)}},{key:"componentDidUpdate",value:function(){var e=this.props.data;if(e&&e.length){var t=Ba(e).sort();if(!Object(_.isEqual)(t,this.prevDataKeys)){var n=this.getDataKeys();this.prevDataKeys=t,this.setState({visibleKeys:n.slice(0,5)})}}}},{key:"componentDidMount",value:function(){this.updateDimensions(),this.setD3DefaultFormat(),window.addEventListener("resize",this.updateDimensions)}},{key:"componentWillUnmount",value:function(){window.removeEventListener("resize",this.updateDimensions)}},{key:"setD3DefaultFormat",value:function(){var e=this.props.currency,t=e.symbol,n=e.symbolPosition;vn({decimal:e.decimalSeparator,thousands:e.thousandSeparator,grouping:[3],currency:ss(t,n)})}},{key:"getOrderedKeys",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],r=this.props,o=r.data,a=r.legendTotals,i=r.mode;if(!o||0===o.length)return[];var c=o.reduce((function(e,t){return Object.entries(t).forEach((function(t){var n=tt()(t,2),r=n[0],o=n[1];"date"===r||e[r]||(e[r]=o.label)})),e}),{}),s=Object.entries(c).map((function(n){var r=tt()(n,2),i=r[0],c=r[1];return c=Object(Fn.sanitize)(c,{ALLOWED_TAGS:[]}),{focus:0===e.length||e.includes(i),key:i,label:c,total:a&&void 0!==a[i]?a[i]:o.reduce((function(e,t){return e+t[i].value}),0),visible:t.includes(i)}}));return"item-comparison"===i?s.sort((function(e,t){return t.total-e.total})).filter((function(e){return e.total>0||n.includes(parseInt(e.key,10))})):s}},{key:"handleTypeToggle",value:function(e){if(this.props.chartType!==e){var t=this.props,n=t.path,r=t.query;Object(P.k)({chartType:e},n,r)}}},{key:"handleLegendToggle",value:function(e){if(this.props.interactiveLegend){var t=e.currentTarget.id.split("_").pop(),n=this.state,r=n.focusedKeys,o=n.visibleKeys;o.includes(t)?this.setState({focusedKeys:Object(_.without)(r,t),visibleKeys:Object(_.without)(o,t)}):this.setState({focusedKeys:r.concat([t]),visibleKeys:o.concat([t])})}}},{key:"handleLegendHover",value:function(e){if("mouseleave"===e.type||"blur"===e.type)this.setState({focusedKeys:[]});else if("mouseenter"===e.type||"focus"===e.type){var t=e.currentTarget.id.split("__").pop();this.setState({focusedKeys:[t]})}}},{key:"updateDimensions",value:function(){this.setState({width:this.chartBodyRef.current.offsetWidth})}},{key:"getVisibleData",value:function(e,t){var n=t.filter((function(e){return e.visible}));return e.map((function(e){var t={date:e.date};return n.forEach((function(n){t[n.key]=e[n.key]})),t}))}},{key:"setInterval",value:function(e){var t=this.props,n=t.path,r=t.query;Object(P.k)({interval:e},n,r)}},{key:"renderIntervalSelector",value:function(){var e=this.props,t=e.interval,n=e.allowedIntervals;if(!n||n.length<1)return null;var r={hour:Object(O.__)("By hour",'woocommerce'),day:Object(O.__)("By day",'woocommerce'),week:Object(O.__)("By week",'woocommerce'),month:Object(O.__)("By month",'woocommerce'),quarter:Object(O.__)("By quarter",'woocommerce'),year:Object(O.__)("By year",'woocommerce')};return Object(v.createElement)(w.SelectControl,{className:"woocommerce-chart__interval-select",value:t,options:n.map((function(e){return{value:e,label:r[e]}})),onChange:this.setInterval})}},{key:"getChartHeight",value:function(){var e=this.props,t=e.isViewportLarge;return e.isViewportMobile?180:t?300:220}},{key:"getLegendPosition",value:function(){var e=this.props,t=e.legendPosition,n=e.mode,r=e.isViewportWide;return t||(r&&"time-comparison"===n?"top":r&&"item-comparison"===n?"side":"bottom")}},{key:"render",value:function(){var e=this.state,t=e.focusedKeys,n=e.visibleKeys,r=e.width,o=this.props,a=o.baseValue,i=o.chartType,c=o.data,s=o.dateParser,l=o.emptyMessage,u=o.filterParam,d=o.interactiveLegend,f=o.interval,p=o.isRequesting,h=o.isViewportLarge,m=o.itemsLabel,y=o.mode,b=o.query,g=o.screenReaderFormat,k=o.showHeaderControls,S=o.title,j=o.tooltipLabelFormat,E=o.tooltipValueFormat,C=o.tooltipTitle,D=o.valueType,x=o.xFormat,F=o.x2Format,T=o.yBelow1Format,M=o.yFormat,R=u?Object(P.f)(b[u]):[],I=this.getOrderedKeys(t,n,R),A=p?null:this.getVisibleData(c,I),N=this.getLegendPosition(),L="top"===N?"row":"column",U="side"===N?"row":"column",B=this.getChartHeight(),H=p?null:Object(v.createElement)(cs,{colorScheme:Cn,data:I,handleLegendHover:this.handleLegendHover,handleLegendToggle:this.handleLegendToggle,interactive:d,legendDirection:L,legendValueFormat:E,totalLabel:Object(O.sprintf)(m,I.length)}),z=M,V=T;if(!M)switch(D){case"average":z=",.0f";break;case"currency":z="$.3~s",V="$.3~f";break;case"number":z=",.0f"}return Object(v.createElement)("div",{className:"woocommerce-chart"},k&&Object(v.createElement)("div",{className:"woocommerce-chart__header"},Object(v.createElement)(bt,{className:"woocommerce-chart__title"},S),"top"===N&&H,this.renderIntervalSelector(),Object(v.createElement)(w.NavigableMenu,{className:"woocommerce-chart__types",orientation:"horizontal",role:"menubar"},Object(v.createElement)(w.Button,{className:q()("woocommerce-chart__type-button",{"woocommerce-chart__type-button-selected":"line"===i}),title:Object(O.__)("Line chart",'woocommerce'),"aria-checked":"line"===i,role:"menuitemradio",tabIndex:"line"===i?0:-1,onClick:Object(_.partial)(this.handleTypeToggle,"line")},Object(v.createElement)(wn.a,null)),Object(v.createElement)(w.Button,{className:q()("woocommerce-chart__type-button",{"woocommerce-chart__type-button-selected":"bar"===i}),title:Object(O.__)("Bar chart",'woocommerce'),"aria-checked":"bar"===i,role:"menuitemradio",tabIndex:"bar"===i?0:-1,onClick:Object(_.partial)(this.handleTypeToggle,"bar")},Object(v.createElement)(Sn.a,null)))),Object(v.createElement)(gt,{component:!1},Object(v.createElement)("div",{className:q()("woocommerce-chart__body","woocommerce-chart__body-".concat(U)),ref:this.chartBodyRef},"side"===N&&H,p&&Object(v.createElement)(v.Fragment,null,Object(v.createElement)("span",{className:"screen-reader-text"},Object(O.__)("Your requested data is loading",'woocommerce')),Object(v.createElement)(Mn,{height:B})),!p&&r>0&&Object(v.createElement)(as,{baseValue:a,chartType:i,colorScheme:Cn,data:A,dateParser:s,height:B,emptyMessage:l,interval:f,margin:{bottom:50,left:80,right:30,top:0},mode:y,orderedKeys:I,screenReaderFormat:g,tooltipLabelFormat:j,tooltipValueFormat:E,tooltipPosition:h?"over":"below",tooltipTitle:C,valueType:D,width:"row"===U?r-320:r,xFormat:x,x2Format:F,yBelow1Format:V,yFormat:z})),"bottom"===N&&Object(v.createElement)("div",{className:"woocommerce-chart__footer"},H)))}}]),o}(v.Component);ls.propTypes={allowedIntervals:S.a.array,baseValue:S.a.number,chartType:S.a.oneOf(["bar","line"]),data:S.a.array.isRequired,dateParser:S.a.string.isRequired,emptyMessage:S.a.string,filterParam:S.a.string,itemsLabel:S.a.string,mode:S.a.oneOf(["item-comparison","time-comparison"]),path:S.a.string,query:S.a.object,interactiveLegend:S.a.bool,interval:S.a.oneOf(["hour","day","week","month","quarter","year"]),intervalData:S.a.object,isRequesting:S.a.bool,legendPosition:S.a.oneOf(["bottom","side","top"]),legendTotals:S.a.object,screenReaderFormat:S.a.oneOfType([S.a.string,S.a.func]),showHeaderControls:S.a.bool,title:S.a.string,tooltipLabelFormat:S.a.oneOfType([S.a.string,S.a.func]),tooltipValueFormat:S.a.oneOfType([S.a.string,S.a.func]),tooltipTitle:S.a.string,valueType:S.a.string,xFormat:S.a.string,x2Format:S.a.string,yBelow1Format:S.a.string,yFormat:S.a.string,currency:S.a.object},ls.defaultProps={baseValue:0,chartType:"line",data:[],dateParser:"%Y-%m-%dT%H:%M:%S",interactiveLegend:!0,interval:"day",isRequesting:!1,mode:"time-comparison",screenReaderFormat:"%B %-d, %Y",showHeaderControls:!0,tooltipLabelFormat:"%B %-d, %Y",tooltipValueFormat:",",xFormat:"%d",x2Format:"%b %Y",currency:{symbol:"$",symbolPosition:"left",decimalSeparator:".",thousandSeparator:","}},Object(xn.withViewportMatch)({isViewportMobile:"< medium",isViewportLarge:">= large",isViewportWide:">= wide"})(ls);var us=Object(v.createElement)(de.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},Object(v.createElement)(de.Path,{d:"M4 9v1.5h16V9H4zm12 5.5h4V13h-4v1.5zm-6 0h4V13h-4v1.5zm-6 0h4V13H4v1.5z"}));var ds=function(e){h()(o,e);var t,n,r=(t=o,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=g()(t);if(n){var o=g()(this).constructor;e=Reflect.construct(r,arguments,o)}else e=r.apply(this,arguments);return y()(this,e)});function o(){return s()(this,o),r.apply(this,arguments)}return u()(o,[{key:"render",value:function(){var e=this.props,t=e.label,n=e.renderContent;return n?Object(v.createElement)("div",{className:"woocommerce-ellipsis-menu"},Object(v.createElement)(w.Dropdown,{contentClassName:"woocommerce-ellipsis-menu__popover",position:"bottom left",renderToggle:function(e){var n=e.onToggle,r=e.isOpen,o=q()("woocommerce-ellipsis-menu__toggle",{"is-opened":r});return Object(v.createElement)(w.Button,{className:o,onClick:n,icon:"ellipsis",title:t,"aria-expanded":r},Object(v.createElement)(ue,{icon:us}))},renderContent:function(e){return Object(v.createElement)(w.NavigableMenu,{className:"woocommerce-ellipsis-menu__content"},n(e))}})):null}}]),o}(v.Component);ds.propTypes={label:S.a.string.isRequired,renderContent:S.a.func};var fs=ds;function ps(e){return function(t,n,r){if(t[n])return t[n].type&&t[n].type===e?void 0:new Error("Invalid ".concat(n," passed to ").concat(r,". Must be ")+"`"+e.name+"`")}}(function(e){h()(o,e);var t,n,r=(t=o,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=g()(t);if(n){var o=g()(this).constructor;e=Reflect.construct(r,arguments,o)}else e=r.apply(this,arguments);return y()(this,e)});function o(){var e;return s()(this,o),e=r.call(this),ot()("Card",{version:"5.2.0",alternative:"@wordpress/components Card",plugin:"WooCommerce",hint:'Use `import { Card } from "@wordpress/components"`'}),e}return u()(o,[{key:"render",value:function(){var e=this.props,t=e.action,n=e.children,r=e.description,o=e.isInactive,a=e.menu,i=e.title,c=q()("woocommerce-card",this.props.className,{"has-menu":!!a,"has-action":!!t,"is-inactive":!!o});return Object(v.createElement)("div",{className:c},i&&Object(v.createElement)("div",{className:"woocommerce-card__header"},Object(v.createElement)("div",{className:"woocommerce-card__title-wrapper"},Object(v.createElement)(bt,{className:"woocommerce-card__title woocommerce-card__header-item"},i),r&&Object(v.createElement)(bt,{className:"woocommerce-card__description woocommerce-card__header-item"},r)),t&&Object(v.createElement)("div",{className:"woocommerce-card__action woocommerce-card__header-item"},t),a&&Object(v.createElement)("div",{className:"woocommerce-card__menu woocommerce-card__header-item"},a)),Object(v.createElement)(gt,{className:"woocommerce-card__body"},n))}}]),o}(v.Component)).propTypes={action:S.a.node,className:S.a.string,description:S.a.oneOfType([S.a.string,S.a.node]),isInactive:S.a.bool,menu:ps(fs),title:S.a.oneOfType([S.a.string,S.a.node])};var hs=function(e){var t=e.count,n=e.label;return n||(n=Object(O.sprintf)(Object(O.__)("Total %d",'woocommerce'),t)),Object(v.createElement)("span",{className:"woocommerce-count","aria-label":n},t)};hs.propTypes={count:S.a.number.isRequired,label:S.a.string},hs.defaultProps={label:""};var ms=function(e){var t=e.className,n=e.count,r=e.children,o=e.disabled,a=e.helpText,i=e.onClick;return!o&&n<2?Object(v.createElement)(w.Tooltip,{text:a},Object(v.createElement)("span",{className:t},Object(v.createElement)(w.Button,{className:"woocommerce-compare-button",disabled:!0,isSecondary:!0},r))):Object(v.createElement)(w.Button,{className:q()("woocommerce-compare-button",t),onClick:i,disabled:o,isSecondary:!0},r)};ms.propTypes={className:S.a.string,count:S.a.number.isRequired,children:S.a.node.isRequired,helpText:S.a.string.isRequired,onClick:S.a.func.isRequired,disabled:S.a.bool};var ys=ms;var bs=function(e){h()(a,e);var t,n,r=(t=a,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=g()(t);if(n){var o=g()(this).constructor;e=Reflect.construct(r,arguments,o)}else e=r.apply(this,arguments);return y()(this,e)});function a(e){var t,n=e.getLabels,o=e.param,i=e.query;return s()(this,a),(t=r.apply(this,arguments)).state={selected:[]},t.clearQuery=t.clearQuery.bind(f()(t)),t.updateQuery=t.updateQuery.bind(f()(t)),t.updateLabels=t.updateLabels.bind(f()(t)),t.onButtonClicked=t.onButtonClicked.bind(f()(t)),i[o]&&n(i[o],i).then(t.updateLabels),t}return u()(a,[{key:"componentDidUpdate",value:function(e,t){var n=e.param,r=e.query,o=t.selected,a=this.props,i=a.getLabels,c=a.param,s=a.query,l=this.state.selected;if(n!==c||o.length>0&&0===l.length)this.clearQuery();else{var u=Object(P.f)(r[c]),d=Object(P.f)(s[c]);Object(_.isEqual)(u.sort(),d.sort())||i(s[c],s).then(this.updateLabels)}}},{key:"clearQuery",value:function(){var e=this.props,t=e.param,n=e.path,r=e.query;this.setState({selected:[]}),Object(P.k)(o()({},t,void 0),n,r)}},{key:"updateLabels",value:function(e){this.setState({selected:e})}},{key:"updateQuery",value:function(){var e=this.props,t=e.param,n=e.path,r=e.query,a=this.state.selected.map((function(e){return e.key}));Object(P.k)(o()({},t,a.join(",")),n,r)}},{key:"onButtonClicked",value:function(e){this.updateQuery(e),Object(_.isFunction)(this.props.onClick)&&this.props.onClick(e)}},{key:"render",value:function(){var e=this,t=this.props,n=t.labels,r=t.type,o=t.autocompleter,a=this.state.selected;return Object(v.createElement)(w.Card,{className:"woocommerce-filters__compare"},Object(v.createElement)(w.CardHeader,null,Object(v.createElement)(x,{variant:"subtitle.small"},n.title)),Object(v.createElement)(w.CardBody,null,Object(v.createElement)($e,{autocompleter:o,type:r,selected:a,placeholder:n.placeholder,onChange:function(t){e.setState({selected:t})}})),Object(v.createElement)(w.CardFooter,{justify:"flex-start"},Object(v.createElement)(ys,{count:a.length,helpText:n.helpText,onClick:this.onButtonClicked},n.update),a.length>0&&Object(v.createElement)(w.Button,{isLink:!0,onClick:this.clearQuery},Object(O.__)("Clear all",'woocommerce'))))}}]),a}(v.Component);bs.propTypes={getLabels:S.a.func.isRequired,labels:S.a.shape({placeholder:S.a.string,title:S.a.string,update:S.a.string}),param:S.a.string.isRequired,path:S.a.string.isRequired,query:S.a.object,type:S.a.string.isRequired,autocompleter:S.a.object},bs.defaultProps={labels:{},query:{}};var gs=n(96),vs=function(e){var t=e.date,n=e.machineFormat,r=e.screenReaderFormat,o=e.visibleFormat;return Object(v.createElement)("time",{dateTime:Object(gs.format)(n,t)},Object(v.createElement)("span",{"aria-hidden":"true"},Object(gs.format)(o,t)),Object(v.createElement)("span",{className:"screen-reader-text"},Object(gs.format)(r,t)))};vs.propTypes={date:S.a.oneOfType([S.a.string,S.a.object]).isRequired,machineFormat:S.a.string,screenReaderFormat:S.a.string,visibleFormat:S.a.string},vs.defaultProps={machineFormat:"Y-m-d H:i:s",screenReaderFormat:"F j, Y",visibleFormat:"Y-m-d"};var Os=function(e){h()(a,e);var t,n,r=(t=a,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=g()(t);if(n){var o=g()(this).constructor;e=Reflect.construct(r,arguments,o)}else e=r.apply(this,arguments);return y()(this,e)});function a(){return s()(this,a),r.apply(this,arguments)}return u()(a,[{key:"render",value:function(){var e=this.props,t=e.className,n=e.options,r=e.selected,a=e.onSelect,i=e.name,c=e.legend;return Object(v.createElement)("fieldset",{className:"woocommerce-segmented-selection"},Object(v.createElement)("legend",{className:"screen-reader-text"},c),Object(v.createElement)("div",{className:q()(t,"woocommerce-segmented-selection__container")},n.map((function(e){var t=e.value,n=e.label;if(!t||!n)return null;var c=Object(_.uniqueId)("".concat(t,"_"));return Object(v.createElement)("div",{className:"woocommerce-segmented-selection__item",key:t},Object(v.createElement)("input",{className:"woocommerce-segmented-selection__input",type:"radio",name:i,id:c,checked:r===t,onChange:Object(_.partial)(a,o()({},i,t))}),Object(v.createElement)("label",{htmlFor:c},Object(v.createElement)("span",{className:"woocommerce-segmented-selection__label"},n)))}))))}}]),a}(v.Component);Os.propTypes={className:S.a.string,options:S.a.arrayOf(S.a.shape({value:S.a.string.isRequired,label:S.a.string.isRequired})).isRequired,selected:S.a.string,onSelect:S.a.func.isRequired,name:S.a.string.isRequired,legend:S.a.string.isRequired};var ws=Os;var _s=function(e){h()(o,e);var t,n,r=(t=o,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=g()(t);if(n){var o=g()(this).constructor;e=Reflect.construct(r,arguments,o)}else e=r.apply(this,arguments);return y()(this,e)});function o(){return s()(this,o),r.apply(this,arguments)}return u()(o,[{key:"render",value:function(){var e=this.props,t=e.onSelect,n=e.compare;return Object(v.createElement)(ws,{options:dt.g,selected:n,onSelect:t,name:"compare",legend:Object(O.__)("compare to",'woocommerce')})}}]),o}(v.Component);_s.propTypes={onSelect:S.a.func.isRequired,compare:S.a.string};var ks=_s,Ss=n(527),js={calendarLabel:Object(O.__)("Calendar",'woocommerce'),closeDatePicker:Object(O.__)("Close",'woocommerce'),focusStartDate:Object(O.__)("Interact with the calendar and select start and end dates.",'woocommerce'),clearDate:Object(O.__)("Clear Date",'woocommerce'),clearDates:Object(O.__)("Clear Dates",'woocommerce'),jumpToPrevMonth:Object(O.__)("Move backward to switch to the previous month.",'woocommerce'),jumpToNextMonth:Object(O.__)("Move forward to switch to the next month.",'woocommerce'),enterKey:Object(O.__)("Enter key",'woocommerce'),leftArrowRightArrow:Object(O.__)("Right and left arrow keys",'woocommerce'),upArrowDownArrow:Object(O.__)("up and down arrow keys",'woocommerce'),pageUpPageDown:Object(O.__)("page up and page down keys",'woocommerce'),homeEnd:Object(O.__)("Home and end keys",'woocommerce'),escape:Object(O.__)("Escape key",'woocommerce'),questionMark:Object(O.__)("Question mark",'woocommerce'),selectFocusedDate:Object(O.__)("Select the date in focus.",'woocommerce'),moveFocusByOneDay:Object(O.__)("Move backward (left) and forward (right) by one day.",'woocommerce'),moveFocusByOneWeek:Object(O.__)("Move backward (up) and forward (down) by one week.",'woocommerce'),moveFocusByOneMonth:Object(O.__)("Switch months.",'woocommerce'),moveFocustoStartAndEndOfWeek:Object(O.__)("Go to the first or last day of a week.",'woocommerce'),returnFocusToInput:Object(O.__)("Return to the date input field.",'woocommerce'),keyboardNavigationInstructions:Object(O.__)("Press the down arrow key to interact with the calendar and select a date.",'woocommerce'),chooseAvailableStartDate:function(e){var t=e.date;return Object(O.sprintf)(Object(O.__)("Select %s as a start date.",'woocommerce'),t)},chooseAvailableEndDate:function(e){var t=e.date;return Object(O.sprintf)(Object(O.__)("Select %s as an end date.",'woocommerce'),t)},chooseAvailableDate:function(e){return e.date},dateIsUnavailable:function(e){var t=e.date;return Object(O.sprintf)(Object(O.__)("%s is not selectable.",'woocommerce'),t)},dateIsSelected:function(e){var t=e.date;return Object(O.sprintf)(Object(O.__)("Selected. %s",'woocommerce'),t)}};var Es=function(e){h()(a,e);var t,n,r=(t=a,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=g()(t);if(n){var o=g()(this).constructor;e=Reflect.construct(r,arguments,o)}else e=r.apply(this,arguments);return y()(this,e)});function a(e){var t;return s()(this,a),(t=r.call(this,e)).onDatesChange=t.onDatesChange.bind(f()(t)),t.onFocusChange=t.onFocusChange.bind(f()(t)),t.onInputChange=t.onInputChange.bind(f()(t)),t.nodeRef=Object(v.createRef)(),t.keepFocusInside=t.keepFocusInside.bind(f()(t)),t}return u()(a,[{key:"keepFocusInside",value:function(e,t){if(this.nodeRef.current){var n=this.props.losesFocusTo;if("container"!==e||!t.target||!t.target.classList.contains("DayPickerNavigation_button")&&!t.target.classList.contains("CalendarDay")||t.relatedTarget&&(t.relatedTarget.classList.contains("DayPickerNavigation_button")||t.relatedTarget.classList.contains("CalendarDay"))){if("onPrevMonthClick"===e||"onNextMonthClick"===e){var r=this.nodeRef.current.querySelector(".DayPickerNavigation_button");r&&r.focus()}}else{if(t.relatedTarget&&(t.relatedTarget.classList.contains("DayPickerNavigation_button")||t.relatedTarget.classList.contains("CalendarDay")))return;if(t.relatedTarget&&n&&n.contains(t.relatedTarget))return;var o=this.nodeRef.current.querySelector(".DayPicker_focusRegion");o&&o.focus()}}}},{key:"onDatesChange",value:function(e){var t=e.startDate,n=e.endDate,r=this.props,o=r.onUpdate,a=r.shortDateFormat;o({after:t,before:n,afterText:t?t.format(a):"",beforeText:n?n.format(a):"",afterError:null,beforeError:null})}},{key:"onFocusChange",value:function(e){this.props.onUpdate({focusedInput:e||"startDate"})}},{key:"onInputChange",value:function(e,t){var n,r=t.target.value,a=this.props,i=a.after,c=a.before,s=a.shortDateFormat,l=Object(dt.j)(e,r,c,i,s),u=l.date,d=l.error;this.props.onUpdate((n={},o()(n,e,u),o()(n,e+"Text",r),o()(n,e+"Error",r.length>0?d:null),n))}},{key:"setTnitialVisibleMonth",value:function(e,t){return function(){var n=t||pt()();return e?n.clone().subtract(1,"month"):n}}},{key:"render",value:function(){var e=this,t=this.props,n=t.after,r=t.before,o=t.focusedInput,a=t.afterText,i=t.beforeText,c=t.afterError,s=t.beforeError,l=t.shortDateFormat,u=t.isViewportMobile,d=t.isViewportSmall,f=t.isInvalidDate,p=u&&!d;return Object(v.createElement)("div",{className:q()("woocommerce-calendar",{"is-mobile":u})},Object(v.createElement)("div",{className:"woocommerce-calendar__inputs"},Object(v.createElement)(mt,{value:a,onChange:Object(_.partial)(this.onInputChange,"after"),dateFormat:l,label:Object(O.__)("Start Date",'woocommerce'),error:c,describedBy:Object(O.sprintf)(Object(O.__)("Date input describing a selected date range's start date in format %s",'woocommerce'),l),onFocus:function(){return e.onFocusChange("startDate")}}),Object(v.createElement)("div",{className:"woocommerce-calendar__inputs-to"},Object(O.__)("to",'woocommerce')),Object(v.createElement)(mt,{value:i,onChange:Object(_.partial)(this.onInputChange,"before"),dateFormat:l,label:Object(O.__)("End Date",'woocommerce'),error:s,describedBy:Object(O.sprintf)(Object(O.__)("Date input describing a selected date range's end date in format %s",'woocommerce'),l),onFocus:function(){return e.onFocusChange("endDate")}})),Object(v.createElement)("div",{className:"woocommerce-calendar__react-dates",ref:this.nodeRef,onBlur:Object(_.partial)(this.keepFocusInside,"container"),tabIndex:-1},Object(v.createElement)(Ss.DayPickerRangeController,{onNextMonthClick:Object(_.partial)(this.keepFocusInside,"onNextMonthClick"),onPrevMonthClick:Object(_.partial)(this.keepFocusInside,"onPrevMonthClick"),onDatesChange:this.onDatesChange,onFocusChange:this.onFocusChange,focusedInput:o,startDate:n,endDate:r,orientation:"horizontal",numberOfMonths:p?2:1,isOutsideRange:function(e){return f&&f(e.toDate())},minimumNights:0,hideKeyboardShortcutsPanel:!0,noBorder:!0,isRTL:"rtl"===document.documentElement.dir,initialVisibleMonth:this.setTnitialVisibleMonth(p,r),phrases:js})))}}]),a}(v.Component);Es.propTypes={after:S.a.object,afterError:S.a.string,afterText:S.a.string,before:S.a.object,beforeError:S.a.string,beforeText:S.a.string,focusedInput:S.a.string,isInvalidDate:S.a.func,onUpdate:S.a.func.isRequired,shortDateFormat:S.a.string.isRequired,losesFocusTo:S.a.instanceOf(Element)};var Cs=Object(xn.withViewportMatch)({isViewportMobile:"< medium",isViewportSmall:"< small"})(Es);var Ds=function(e){h()(o,e);var t,n,r=(t=o,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=g()(t);if(n){var o=g()(this).constructor;e=Reflect.construct(r,arguments,o)}else e=r.apply(this,arguments);return y()(this,e)});function o(){return s()(this,o),r.apply(this,arguments)}return u()(o,[{key:"render",value:function(){var e=this.props,t=e.onSelect,n=e.period;return Object(v.createElement)(ws,{options:Object(_.filter)(dt.h,(function(e){return"custom"!==e.value})),selected:n,onSelect:t,name:"period",legend:Object(O.__)("select a preset period",'woocommerce')})}}]),o}(v.Component);Ds.propTypes={onSelect:S.a.func.isRequired,period:S.a.string};var Ps=Ds;var xs=function(e){h()(o,e);var t,n,r=(t=o,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=g()(t);if(n){var o=g()(this).constructor;e=Reflect.construct(r,arguments,o)}else e=r.apply(this,arguments);return y()(this,e)});function o(){var e;return s()(this,o),(e=r.call(this)).onTabSelect=e.onTabSelect.bind(f()(e)),e.controlsRef=Object(v.createRef)(),e}return u()(o,[{key:"onTabSelect",value:function(e){var t=this.props,n=t.onUpdate,r=t.period;"period"===e&&"custom"===r&&n({period:"today"})}},{key:"isFutureDate",value:function(e){return pt()().isBefore(pt()(e),"day")}},{key:"render",value:function(){var e=this,t=this.props,n=t.period,r=t.compare,o=t.after,a=t.before,i=t.onUpdate,c=t.onClose,s=t.onSelect,l=t.isValidSelection,u=t.resetCustomValues,d=t.focusedInput,f=t.afterText,p=t.beforeText,h=t.afterError,m=t.beforeError,y=t.shortDateFormat;return Object(v.createElement)("div",null,Object(v.createElement)(bt,{className:"screen-reader-text",tabIndex:"0"},Object(O.__)("Select date range and comparison",'woocommerce')),Object(v.createElement)(gt,{component:!1},Object(v.createElement)(bt,{className:"woocommerce-filters-date__text"},Object(O.__)("select a date range",'woocommerce')),Object(v.createElement)(w.TabPanel,{tabs:[{name:"period",title:Object(O.__)("Presets",'woocommerce'),className:"woocommerce-filters-date__tab"},{name:"custom",title:Object(O.__)("Custom",'woocommerce'),className:"woocommerce-filters-date__tab"}],className:"woocommerce-filters-date__tabs",activeClass:"is-active",initialTabName:"custom"===n?"custom":"period",onSelect:this.onTabSelect},(function(t){return Object(v.createElement)(v.Fragment,null,"period"===t.name&&Object(v.createElement)(Ps,{onSelect:i,period:n}),"custom"===t.name&&Object(v.createElement)(Cs,{after:o,before:a,onUpdate:i,isInvalidDate:e.isFutureDate,focusedInput:d,afterText:f,beforeText:p,afterError:h,beforeError:m,shortDateFormat:y,losesFocusTo:e.controlsRef.current}),Object(v.createElement)("div",{className:q()("woocommerce-filters-date__content-controls",{"is-custom":"custom"===t.name}),ref:e.controlsRef},Object(v.createElement)(bt,{className:"woocommerce-filters-date__text"},Object(O.__)("compare to",'woocommerce')),Object(v.createElement)(ks,{onSelect:i,compare:r}),Object(v.createElement)("div",{className:"woocommerce-filters-date__button-group"},"custom"===t.name&&Object(v.createElement)(w.Button,{className:"woocommerce-filters-date__button",isSecondary:!0,onClick:u,disabled:!(o||a)},Object(O.__)("Reset",'woocommerce')),l(t.name)?Object(v.createElement)(w.Button,{className:"woocommerce-filters-date__button",onClick:s(t.name,c),isPrimary:!0},Object(O.__)("Update",'woocommerce')):Object(v.createElement)(w.Button,{className:"woocommerce-filters-date__button",isPrimary:!0,disabled:!0},Object(O.__)("Update",'woocommerce')))))}))))}}]),o}(v.Component);xs.propTypes={period:S.a.string.isRequired,compare:S.a.string.isRequired,onUpdate:S.a.func.isRequired,onClose:S.a.func.isRequired,onSelect:S.a.func.isRequired,resetCustomValues:S.a.func.isRequired,focusedInput:S.a.string,afterText:S.a.string,beforeText:S.a.string,afterError:S.a.string,beforeError:S.a.string,shortDateFormat:S.a.string.isRequired};var Fs=xs,Ts=function(e){var t=e.labels,n=e.isOpen,r=R()(e,["labels","isOpen"]),o=q()("woocommerce-dropdown-button",{"is-open":n,"is-multi-line":t.length>1});return Object(v.createElement)(w.Button,T()({className:o,"aria-expanded":n},r),Object(v.createElement)("div",{className:"woocommerce-dropdown-button__labels"},t.map((function(e,t){return Object(v.createElement)("span",{key:t},Object(ne.decodeEntities)(e))}))))};Ts.propTypes={labels:S.a.array.isRequired,isOpen:S.a.bool};var Ms=Ts;var Rs=Object(O.__)("MM/DD/YYYY",'woocommerce'),Is=function(e){h()(o,e);var t,n,r=(t=o,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=g()(t);if(n){var o=g()(this).constructor;e=Reflect.construct(r,arguments,o)}else e=r.apply(this,arguments);return y()(this,e)});function o(e){var t;return s()(this,o),(t=r.call(this,e)).state=t.getResetState(),t.update=t.update.bind(f()(t)),t.onSelect=t.onSelect.bind(f()(t)),t.isValidSelection=t.isValidSelection.bind(f()(t)),t.resetCustomValues=t.resetCustomValues.bind(f()(t)),t}return u()(o,[{key:"formatDate",value:function(e,t){return e&&e._isAMomentObject&&"function"==typeof e.format?e.format(t):""}},{key:"getResetState",value:function(){var e=this.props.dateQuery,t=e.period,n=e.compare,r=e.before,o=e.after;return{period:t,compare:n,before:r,after:o,focusedInput:"startDate",afterText:this.formatDate(o,Rs),beforeText:this.formatDate(r,Rs),afterError:null,beforeError:null}}},{key:"update",value:function(e){this.setState(e)}},{key:"onSelect",value:function(e,t){var n=this,r=this.props,o=r.isoDateFormat,a=r.onRangeSelect;return function(r){var i=n.state,c=i.period,s=i.compare,l=i.after,u=i.before,d={period:"custom"===e?"custom":c,compare:s};"custom"===e?(d.after=n.formatDate(l,o),d.before=n.formatDate(u,o)):(d.after=void 0,d.before=void 0),a(d),t(r)}}},{key:"getButtonLabel",value:function(){var e=this.props.dateQuery,t=e.primaryDate,n=e.secondaryDate;return["".concat(t.label," (").concat(t.range,")"),"".concat(Object(O.__)("vs.",'woocommerce')," ").concat(n.label," (").concat(n.range,")")]}},{key:"isValidSelection",value:function(e){var t=this.state,n=t.compare,r=t.after,o=t.before;return"custom"!==e||n&&r&&o}},{key:"resetCustomValues",value:function(){this.setState({after:null,before:null,focusedInput:"startDate",afterText:"",beforeText:"",afterError:null,beforeError:null})}},{key:"render",value:function(){var e=this,t=this.state,n=t.period,r=t.compare,o=t.after,a=t.before,i=t.focusedInput,c=t.afterText,s=t.beforeText,l=t.afterError,u=t.beforeError,d=this.props.isViewportMobile,f=q()("woocommerce-filters-date__content",{"is-mobile":d});return Object(v.createElement)("div",{className:"woocommerce-filters-filter"},Object(v.createElement)("span",{className:"woocommerce-filters-label"},Object(O.__)("Date Range",'woocommerce'),":"),Object(v.createElement)(w.Dropdown,{contentClassName:f,position:"bottom",expandOnMobile:!0,renderToggle:function(t){var n=t.isOpen,r=t.onToggle;return Object(v.createElement)(Ms,{onClick:r,isOpen:n,labels:e.getButtonLabel()})},renderContent:function(t){var d=t.onClose;return Object(v.createElement)(Fs,{period:n,compare:r,after:o,before:a,onUpdate:e.update,onClose:d,onSelect:e.onSelect,isValidSelection:e.isValidSelection,resetCustomValues:e.resetCustomValues,focusedInput:i,afterText:c,beforeText:s,afterError:l,beforeError:u,shortDateFormat:Rs})}}))}}]),o}(v.Component);Is.propTypes={onRangeSelect:S.a.func.isRequired,dateQuery:S.a.shape({period:S.a.string.isRequired,compare:S.a.string.isRequired,before:S.a.object,after:S.a.object,primaryDate:S.a.shape({label:S.a.string.isRequired,range:S.a.string.isRequired}).isRequired,secondaryDate:S.a.shape({label:S.a.string.isRequired,range:S.a.string.isRequired}).isRequired}).isRequired};var As=Object(xn.withViewportMatch)({isViewportMobile:"< medium"})(Is);var Ns=function(e){h()(o,e);var t,n,r=(t=o,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=g()(t);if(n){var o=g()(this).constructor;e=Reflect.construct(r,arguments,o)}else e=r.apply(this,arguments);return y()(this,e)});function o(){return s()(this,o),r.apply(this,arguments)}return u()(o,[{key:"renderIllustration",value:function(){var e=this.props,t=e.illustrationWidth,n=e.illustrationHeight,r=e.illustration;return Object(v.createElement)("img",{alt:"",src:r,width:t,height:n,className:"woocommerce-empty-content__illustration"})}},{key:"renderActionButtons",value:function(e){var t="secondary"===e?this.props.secondaryActionLabel:this.props.actionLabel,n="secondary"===e?this.props.secondaryActionURL:this.props.actionURL,r="secondary"===e?this.props.secondaryActionCallback:this.props.actionCallback,o="secondary"!==e;return n&&r?Object(v.createElement)(w.Button,{className:"woocommerce-empty-content__action",isPrimary:o,onClick:r,href:n},t):n?Object(v.createElement)(w.Button,{className:"woocommerce-empty-content__action",isPrimary:o,href:n},t):r?Object(v.createElement)(w.Button,{className:"woocommerce-empty-content__action",isPrimary:o,onClick:r},t):null}},{key:"renderActions",value:function(){var e=this.props,t=e.actionLabel,n=e.secondaryActionLabel;return Object(v.createElement)("div",{className:"woocommerce-empty-content__actions"},t&&this.renderActionButtons("primary"),n&&this.renderActionButtons("secondary"))}},{key:"render",value:function(){var e=this.props,t=e.className,n=e.title,r=e.message,o=e.illustration;return Object(v.createElement)("div",{className:q()("woocommerce-empty-content",t)},o&&this.renderIllustration(),n?Object(v.createElement)(bt,{className:"woocommerce-empty-content__title"},n):null,r?Object(v.createElement)("p",{className:"woocommerce-empty-content__message"},r):null,this.renderActions())}}]),o}(v.Component);function Ls(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Us(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ls(Object(n),!0).forEach((function(t){o()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ls(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}Ns.propTypes={title:S.a.string.isRequired,message:S.a.node,illustration:S.a.string,illustrationHeight:S.a.number,illustrationWidth:S.a.number,actionLabel:S.a.string.isRequired,actionURL:S.a.string,actionCallback:S.a.func,secondaryActionLabel:S.a.string,secondaryActionURL:S.a.string,secondaryActionCallback:S.a.func,className:S.a.string},Ns.defaultProps={illustration:'data:image/svg+xml;utf8,%3Csvg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 400 400"%3E%3Cpath d="M226.153073,88.3099993 L355.380187,301.446227 C363.970299,315.614028 359.448689,334.062961 345.280888,342.653073 C340.591108,345.496544 335.21158,347 329.727115,347 L71.2728854,347 C54.7043429,347 41.2728854,333.568542 41.2728854,317 C41.2728854,311.515534 42.7763415,306.136007 45.6198127,301.446227 L174.846927,88.3099993 C183.437039,74.1421985 201.885972,69.6205881 216.053773,78.2106999 C220.184157,80.7150022 223.64877,84.1796157 226.153073,88.3099993 Z M184.370159,153 L186.899684,255.024156 L213.459691,255.024156 L215.989216,153 L184.370159,153 Z M200.179688,307.722584 C209.770801,307.722584 217.359375,300.450201 217.359375,291.175278 C217.359375,281.900355 209.770801,274.627972 200.179688,274.627972 C190.588574,274.627972 183,281.900355 183,291.175278 C183,300.450201 190.588574,307.722584 200.179688,307.722584 Z" id="Combined-Shape" stroke="%23979797" fill="%2395588A" fill-rule="nonzero"%3E%3C/path%3E%3C/svg%3E',illustrationWidth:400};var Bs=function(e){h()(c,e);var t,n,r,a,i=(r=c,a=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=g()(r);if(a){var n=g()(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return y()(this,e)});function c(e){var t;return s()(this,c),(t=i.call(this)).state={values:e.initialValues,errors:e.errors,touched:e.touched},t.getInputProps=t.getInputProps.bind(f()(t)),t.handleSubmit=t.handleSubmit.bind(f()(t)),t.setTouched=t.setTouched.bind(f()(t)),t.setValue=t.setValue.bind(f()(t)),t}return u()(c,[{key:"componentDidMount",value:function(){this.validate()}},{key:"isValidForm",value:(n=G()(J.a.mark((function e(){return J.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.validate();case 2:return e.abrupt("return",!Object.keys(this.state.errors).length);case 3:case"end":return e.stop()}}),e,this)}))),function(){return n.apply(this,arguments)})},{key:"validate",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(){},t=this.state.values,n=this.props.validate(t);this.setState({errors:n},e)}},{key:"setValue",value:function(e,t){var n=this;this.setState((function(n){return{values:Us(Us({},n.values),{},o()({},e,t))}}),(function(){n.validate((function(){n.props.onChangeCallback({name:e,value:t},n.state.values,!Object.keys(n.state.errors||{}).length)}))}))}},{key:"setTouched",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this.setState((function(n){return{touched:Us(Us({},n.touched),{},o()({},e,t))}}))}},{key:"handleChange",value:function(e,t){var n=this.state.values;t.target?"checkbox"===t.target.type?this.setValue(e,!n[e]):this.setValue(e,t.target.value):this.setValue(e,t)}},{key:"handleBlur",value:function(e){this.setTouched(e)}},{key:"handleSubmit",value:(t=G()(J.a.mark((function e(){var t,n;return J.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=this.state.values,n={},Object.keys(t).map((function(e){return n[e]=!0})),this.setState({touched:n}),e.next=6,this.isValidForm();case 6:if(!e.sent){e.next=8;break}this.props.onSubmitCallback(t);case 8:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"getInputProps",value:function(e){var t=this,n=this.state,r=n.errors,o=n.touched,a=n.values;return{value:a[e],checked:Boolean(a[e]),selected:a[e],onChange:function(n){return t.handleChange(e,n)},onBlur:function(){return t.handleBlur(e)},className:o[e]&&r[e]?"has-error":null,help:o[e]?r[e]:null}}},{key:"getStateAndHelpers",value:function(){var e=this.state,t=e.values,n=e.errors;return{values:t,errors:n,touched:e.touched,setTouched:this.setTouched,setValue:this.setValue,handleSubmit:this.handleSubmit,getInputProps:this.getInputProps,isValidForm:!Object.keys(n).length}}},{key:"render",value:function(){var e=this.props.children(this.getStateAndHelpers());return Object(v.cloneElement)(e)}}]),c}(v.Component);Bs.propTypes={children:S.a.any,errors:S.a.object,initialValues:S.a.object.isRequired,onSubmitCallback:S.a.func,onChangeCallback:S.a.func,validate:S.a.func},Bs.defaultProps={errors:{},initialValues:{},onSubmitCallback:function(){},onChangeCallback:function(){},touched:{},validate:function(){}};var Hs=Bs,qs=n(74),zs=Object(v.createElement)(de.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(v.createElement)(de.Path,{d:"M14.6 7l-1.2-1L8 12l5.4 6 1.2-1-4.6-5z"}));function Vs(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Ks(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Vs(Object(n),!0).forEach((function(t){o()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Vs(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Ws=function(e){h()(a,e);var t,n,r=(t=a,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=g()(t);if(n){var o=g()(this).constructor;e=Reflect.construct(r,arguments,o)}else e=r.apply(this,arguments);return y()(this,e)});function a(e){var t;s()(this,a);var n=(t=r.call(this,e)).getFilter();if(t.state={nav:n.path||[],animate:null,selectedTag:null},t.selectSubFilter=t.selectSubFilter.bind(f()(t)),t.getVisibleFilters=t.getVisibleFilters.bind(f()(t)),t.updateSelectedTag=t.updateSelectedTag.bind(f()(t)),t.onTagChange=t.onTagChange.bind(f()(t)),t.onContentMount=t.onContentMount.bind(f()(t)),t.goBack=t.goBack.bind(f()(t)),n.settings&&n.settings.getLabels){var o=t.props.query,i=n.settings,c=i.param;(0,i.getLabels)(o[c],o).then(t.updateSelectedTag)}return t}return u()(a,[{key:"componentDidUpdate",value:function(e){var t=e.query,n=this.props,r=n.query,o=n.config;if(t[o.param]!==r[[o.param]]){var a=this.getFilter();if(a&&"Search"===a.component){this.setState({nav:a.path||[]});var i=a.settings,c=i.param;(0,i.getLabels)(r[c],r).then(this.updateSelectedTag)}}}},{key:"updateSelectedTag",value:function(e){this.setState({selectedTag:e[0]})}},{key:"getFilter",value:function(e){var t=this.props,n=t.config,r=t.query,o=Object(P.b)(n.filters);return e=e||r[n.param]||n.defaultValue||"all",Object(_.find)(o,{value:e})||{}}},{key:"getButtonLabel",value:function(e){if("Search"===e.component){var t=this.state.selectedTag;return[t&&t.label,Object(_.get)(e,"settings.labels.button")]}return e?[e.label]:[]}},{key:"getVisibleFilters",value:function(e,t){if(0===t.length)return e;var n=t[0],r=Object(_.find)(e,{value:n});return this.getVisibleFilters(r&&r.subFilters,t.slice(1))}},{key:"selectSubFilter",value:function(e){this.setState((function(t){return{nav:[].concat(i()(t.nav),[e]),animate:"left"}}))}},{key:"goBack",value:function(){this.setState((function(e){return{nav:e.nav.slice(0,-1),animate:"right"}}))}},{key:"update",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.props,r=n.path,a=n.query,i=n.config,c=n.onFilterSelect,s=Object(P.h)(a),l=Ks(o()({},i.param,(i.defaultValue||"all")===e?void 0:e),t);i.staticParams.forEach((function(e){l[e]=a[e]})),Object(P.k)(l,r,s),c(l)}},{key:"onTagChange",value:function(e,t,n,r){var a=Object(_.last)(r),i=e.value,c=e.settings.param;a?(this.update(i,o()({},c,a.key)),t()):this.update(n.defaultValue||"all"),this.updateSelectedTag([a])}},{key:"renderButton",value:function(e,t,n){var r=this;if(e.component){var o=e.settings,a=o.type,i=o.labels,c=o.autocompleter,s=this.getFilter().value===e.value?this.state.selectedTag:null;return Object(v.createElement)($e,{autocompleter:c,className:"woocommerce-filters-filter__search",type:a,placeholder:i.placeholder,selected:s?[s]:[],onChange:Object(_.partial)(this.onTagChange,e,t,n),inlineTags:!0,staticResults:!0})}var l=Object(_.partial)(this.selectSubFilter,e.value),u=this.getFilter(),d=u.value===e.value||u.path&&Object(_.includes)(u.path,e.value);return Object(v.createElement)(w.Button,{className:"woocommerce-filters-filter__button",onClick:function(n){d?t(n):e.subFilters?l(n):function(n){t(n),r.update(e.value,e.query||{}),r.setState({selectedTag:null})}(n)}},e.label)}},{key:"onContentMount",value:function(e){var t=this.state.nav,n=t.length&&this.getFilter(t[t.length-1])?1:0,r=qs.focus.tabbable.find(e)[n];setTimeout((function(){r.focus()}),0)}},{key:"render",value:function(){var e=this,t=this.props.config,n=this.state,r=n.nav,o=n.animate,a=this.getVisibleFilters(t.filters,r),i=!!r.length&&this.getFilter(r[r.length-1]),c=this.getFilter();return Object(v.createElement)("div",{className:"woocommerce-filters-filter"},t.label&&Object(v.createElement)("span",{className:"woocommerce-filters-label"},t.label,":"),Object(v.createElement)(w.Dropdown,{contentClassName:"woocommerce-filters-filter__content",position:"bottom",expandOnMobile:!0,headerTitle:Object(O.__)("filter report to show:",'woocommerce'),renderToggle:function(t){var n=t.isOpen,r=t.onToggle;return Object(v.createElement)(Ms,{onClick:r,isOpen:n,labels:e.getButtonLabel(c)})},renderContent:function(n){var s=n.onClose;return Object(v.createElement)(rn,{animationKey:r,animate:o,onExited:e.onContentMount},(function(){return Object(v.createElement)("ul",{className:"woocommerce-filters-filter__content-list"},i&&Object(v.createElement)("li",{className:"woocommerce-filters-filter__content-list-item"},Object(v.createElement)(w.Button,{className:"woocommerce-filters-filter__button",onClick:e.goBack},Object(v.createElement)(ue,{icon:zs}),i.label)),a.map((function(n){return Object(v.createElement)("li",{key:n.value,className:q()("woocommerce-filters-filter__content-list-item",{"is-selected":c.value===n.value||c.path&&Object(_.includes)(c.path,n.value)})},e.renderButton(n,s,t))})))}))}}))}}]),a}(v.Component);Ws.propTypes={config:S.a.shape({label:S.a.string,staticParams:S.a.array.isRequired,param:S.a.string.isRequired,defaultValue:S.a.string,showFilters:S.a.func.isRequired,filters:S.a.arrayOf(S.a.shape({chartMode:S.a.oneOf(["item-comparison","time-comparison"]),component:S.a.string,label:S.a.string,path:S.a.string,subFilters:S.a.array,value:S.a.string.isRequired}))}).isRequired,path:S.a.string.isRequired,query:S.a.object,onFilterSelect:S.a.func},Ws.defaultProps={query:{},onFilterSelect:function(){}};var Gs=Ws,Ys=n(181),$s=n(366),Qs=n.n($s),Js=n(313),Zs=n.n(Js),Xs=function(e){var t,n,r,o,a=e.alt,i=e.title,c=e.size,s=e.user,l=e.className,u=q()("woocommerce-gravatar",l,{"is-placeholder":!s}),d=a||s&&(s.display_name||s.name)||"",f="https://www.gravatar.com/avatar/0?s="+c+"&d=mp";return s&&(t=Object(_.isString)(s)?(o=s,"https://www.gravatar.com/avatar/"+Zs()(o)):s.avatar_URLs[96],n=Qs.a.parse(t),(r=Object(Ys.parse)(n.query)).s=c,r.d="mp",n.search=Object(Ys.stringify)(r),f=Qs.a.format(n)),Object(v.createElement)("img",{alt:d,title:i,className:u,src:f,width:c,height:c})};Xs.propTypes={user:S.a.oneOfType([S.a.object,S.a.string]),alt:S.a.string,title:S.a.string,size:S.a.number,className:S.a.string},Xs.defaultProps={size:60};Object(v.createElement)(de.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(v.createElement)(de.Path,{d:"M18.5 15v3.5H13V6.7l4.5 4.1 1-1.1-6.2-5.8-5.8 5.8 1 1.1 4-4v11.7h-6V15H4v5h16v-5z"}));function el(e){var t=e.href;return e.linkType||(t?"external":null)}function tl(e){var t=e.item,n=t.before,r=t.title,o=t.after,a=t.content,i=t.onClick,c=t.href,s=t.target,l=t.listItemTag,u="function"==typeof i||c,d=c?L:"div",f={className:"woocommerce-list__item-inner",onClick:"function"==typeof i?i:null,"aria-disabled":u?"false":null,tabIndex:u?"0":null,role:u?"menuitem":null,onKeyDown:function(e){return u?function(e,t){"function"==typeof t&&e.keyCode===X.ENTER&&t()}(e,i):null},target:c?s:null,type:el(t),href:c,"data-list-item-tag":l};return Object(v.createElement)(d,f,n&&Object(v.createElement)("div",{className:"woocommerce-list__item-before"},n),Object(v.createElement)("div",{className:"woocommerce-list__item-text"},Object(v.createElement)("span",{className:"woocommerce-list__item-title"},r),a&&Object(v.createElement)("span",{className:"woocommerce-list__item-content"},a)),o&&Object(v.createElement)("div",{className:"woocommerce-list__item-after"},o))}v.Component,tl.propTypes={item:S.a.shape({after:S.a.node,before:S.a.node,className:S.a.string,content:S.a.oneOfType([S.a.string,S.a.node]),href:S.a.string,onClick:S.a.func,target:S.a.string,title:S.a.oneOfType([S.a.string,S.a.node])}).isRequired};S.a.string,S.a.arrayOf(S.a.shape({after:S.a.node,before:S.a.node,className:S.a.string,content:S.a.oneOfType([S.a.string,S.a.node]),href:S.a.string,onClick:S.a.func,target:S.a.string,title:S.a.oneOfType([S.a.string,S.a.node]),key:S.a.string}));var nl=function(e){h()(o,e);var t,n,r=(t=o,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=g()(t);if(n){var o=g()(this).constructor;e=Reflect.construct(r,arguments,o)}else e=r.apply(this,arguments);return y()(this,e)});function o(){var e;return s()(this,o),(e=r.apply(this,arguments)).onClick=e.onClick.bind(f()(e)),e.onFocusFormToggle=e.onFocusFormToggle.bind(f()(e)),e.onKeyDown=e.onKeyDown.bind(f()(e)),e.container=Object(v.createRef)(),e}return u()(o,[{key:"onClick",value:function(e){var t=this.props,n=t.isClickable,r=t.onInvoke;n&&(e.preventDefault(),r())}},{key:"onKeyDown",value:function(e){e.target.isSameNode(e.currentTarget)&&(e.keyCode!==X.ENTER&&e.keyCode!==X.SPACE||(e.preventDefault(),this.props.onInvoke()),e.keyCode===X.UP&&e.preventDefault(),e.keyCode===X.DOWN&&(e.preventDefault(),(e.target.nextSibling||e.target.parentNode.querySelector(".woocommerce-ellipsis-menu__item")).focus()))}},{key:"onFocusFormToggle",value:function(){this.container.current.focus()}},{key:"render",value:function(){var e=this.props,t=e.checked,n=e.children;return e.isCheckbox?Object(v.createElement)("div",{"aria-checked":t,ref:this.container,role:"menuitemcheckbox",tabIndex:"0",onKeyDown:this.onKeyDown,onClick:this.onClick,className:"woocommerce-ellipsis-menu__item"},Object(v.createElement)(w.BaseControl,{className:"components-toggle-control"},Object(v.createElement)(w.FormToggle,{"aria-hidden":"true",checked:t,onChange:this.props.onInvoke,onFocus:this.onFocusFormToggle,onClick:function(e){return e.stopPropagation()},tabIndex:"-1"}),n)):Object(v.createElement)("div",{role:"menuitem",tabIndex:"0",onKeyDown:this.onKeyDown,onClick:this.onClick,className:"woocommerce-ellipsis-menu__item"},n)}}]),o}(v.Component);nl.propTypes={checked:S.a.bool,children:S.a.node,isCheckbox:S.a.bool,isClickable:S.a.bool,onInvoke:S.a.func.isRequired},nl.defaultProps={isClickable:!1,isCheckbox:!1};var rl=nl,ol=function(e){var t=e.children;return Object(v.createElement)("div",{className:"woocommerce-ellipsis-menu__title"},t)};ol.propTypes={children:S.a.node};var al=ol;S.a.object.isRequired,S.a.string,S.a.object;var il=Object(v.createElement)(de.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(v.createElement)(de.Path,{d:"M10.6 6L9.4 7l4.6 5-4.6 5 1.2 1 5.4-6z"}));var cl=[25,50,75,100],sl=function(e){h()(o,e);var t,n,r=(t=o,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=g()(t);if(n){var o=g()(this).constructor;e=Reflect.construct(r,arguments,o)}else e=r.apply(this,arguments);return y()(this,e)});function o(e){var t;return s()(this,o),(t=r.call(this,e)).state={inputValue:t.props.page},t.previousPage=t.previousPage.bind(f()(t)),t.nextPage=t.nextPage.bind(f()(t)),t.onInputChange=t.onInputChange.bind(f()(t)),t.onInputBlur=t.onInputBlur.bind(f()(t)),t.perPageChange=t.perPageChange.bind(f()(t)),t.selectInputValue=t.selectInputValue.bind(f()(t)),t}return u()(o,[{key:"previousPage",value:function(e){e.stopPropagation();var t=this.props,n=t.page,r=t.onPageChange;n-1<1||r(n-1,"previous")}},{key:"nextPage",value:function(e){e.stopPropagation();var t=this.props,n=t.page,r=t.onPageChange;n+1>this.pageCount||r(n+1,"next")}},{key:"perPageChange",value:function(e){var t=this.props,n=t.onPerPageChange,r=t.onPageChange,o=t.total,a=t.page;n(parseInt(e,10));var i=Math.ceil(o/parseInt(e,10));a>i&&r(i)}},{key:"onInputChange",value:function(e){this.setState({inputValue:e.target.value})}},{key:"onInputBlur",value:function(e){var t=this.props,n=t.onPageChange,r=t.page,o=parseInt(e.target.value,10);o!==r&&Number.isFinite(o)&&o>0&&this.pageCount&&this.pageCount>=o&&n(o,"goto")}},{key:"selectInputValue",value:function(e){e.target.select()}},{key:"renderPageArrows",value:function(){var e=this.props,t=e.page,n=e.showPageArrowsLabel;if(this.pageCount<=1)return null;var r=q()("woocommerce-pagination__link",{"is-active":t>1}),o=q()("woocommerce-pagination__link",{"is-active":t<this.pageCount});return Object(v.createElement)("div",{className:"woocommerce-pagination__page-arrows"},n&&Object(v.createElement)("span",{className:"woocommerce-pagination__page-arrows-label",role:"status","aria-live":"polite"},Object(O.sprintf)(Object(O.__)("Page %d of %d",'woocommerce'),t,this.pageCount)),Object(v.createElement)("div",{className:"woocommerce-pagination__page-arrows-buttons"},Object(v.createElement)(w.Button,{className:r,disabled:!(t>1),onClick:this.previousPage,label:Object(O.__)("Previous Page",'woocommerce')},Object(v.createElement)(ue,{icon:zs})),Object(v.createElement)(w.Button,{className:o,disabled:!(t<this.pageCount),onClick:this.nextPage,label:Object(O.__)("Next Page",'woocommerce')},Object(v.createElement)(ue,{icon:il}))))}},{key:"renderPagePicker",value:function(){var e=this.props.page,t=this.state.inputValue,n=e<1||e>this.pageCount,r=q()("woocommerce-pagination__page-picker-input",{"has-error":n}),o=Object(_.uniqueId)("woocommerce-pagination-page-picker-");return Object(v.createElement)("div",{className:"woocommerce-pagination__page-picker"},Object(v.createElement)("label",{htmlFor:o,className:"woocommerce-pagination__page-picker-label"},Object(O.__)("Go to page",'woocommerce'),Object(v.createElement)("input",{id:o,className:r,"aria-invalid":n,type:"number",onClick:this.selectInputValue,onChange:this.onInputChange,onBlur:this.onInputBlur,value:t,min:1,max:this.pageCount})))}},{key:"renderPerPagePicker",value:function(){var e=cl.map((function(e){return{value:e,label:e}}));return Object(v.createElement)("div",{className:"woocommerce-pagination__per-page-picker"},Object(v.createElement)(w.SelectControl,{label:Object(O.__)("Rows per page",'woocommerce'),value:this.props.perPage,onChange:this.perPageChange,options:e}))}},{key:"render",value:function(){var e=this.props,t=e.total,n=e.perPage,r=e.className,o=e.showPagePicker,a=e.showPerPagePicker;this.pageCount=Math.ceil(t/n);var i=q()("woocommerce-pagination",r);return this.pageCount<=1?t>cl[0]&&Object(v.createElement)("div",{className:i},this.renderPerPagePicker())||null:Object(v.createElement)("div",{className:i},this.renderPageArrows(),o&&this.renderPagePicker(),a&&this.renderPerPagePicker())}}]),o}(v.Component);sl.propTypes={page:S.a.number.isRequired,onPageChange:S.a.func,perPage:S.a.number.isRequired,onPerPageChange:S.a.func,total:S.a.number.isRequired,className:S.a.string,showPagePicker:S.a.bool,showPerPagePicker:S.a.bool,showPageArrowsLabel:S.a.bool},sl.defaultProps={onPageChange:_.noop,onPerPageChange:_.noop,showPagePicker:!0,showPerPagePicker:!0,showPageArrowsLabel:!0};var ll=sl,ul=n(14),dl=n(367);var fl=function(e){h()(a,e);var t,n,r,o=(n=a,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=g()(n);if(r){var o=g()(this).constructor;e=Reflect.construct(t,arguments,o)}else e=t.apply(this,arguments);return y()(this,e)});function a(){var e;return s()(this,a),(e=o.apply(this,arguments)).state={hasErrors:!1},e.installAndActivate=e.installAndActivate.bind(f()(e)),e.skipInstaller=e.skipInstaller.bind(f()(e)),e.handleErrors=e.handleErrors.bind(f()(e)),e.handleSuccess=e.handleSuccess.bind(f()(e)),e}return u()(a,[{key:"componentDidMount",value:function(){this.props.autoInstall&&this.installAndActivate()}},{key:"installAndActivate",value:(t=G()(J.a.mark((function e(t){var n,r,o,a,i=this;return J.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t&&t.preventDefault(),n=this.props,r=n.installAndActivatePlugins,o=n.isRequesting,a=n.pluginSlugs,!o){e.next=4;break}return e.abrupt("return",!1);case 4:r(a).then((function(e){i.handleSuccess(e.data.activated,e)})).catch((function(e){i.handleErrors(e.errors,e)}));case 5:case"end":return e.stop()}}),e,this)}))),function(_x){return t.apply(this,arguments)})},{key:"handleErrors",value:function(e,t){var n=this.props.onError;this.setState({hasErrors:!0}),n(e,t)}},{key:"handleSuccess",value:function(e,t){(0,this.props.onComplete)(e,t)}},{key:"skipInstaller",value:function(){this.props.onSkip()}},{key:"render",value:function(){var e=this.props,t=e.isRequesting,n=e.skipText,r=e.autoInstall,o=e.pluginSlugs,a=e.onAbort,i=e.abortText;return this.state.hasErrors?Object(v.createElement)(v.Fragment,null,Object(v.createElement)(w.Button,{isPrimary:!0,isBusy:t,onClick:this.installAndActivate},Object(O.__)("Retry",'woocommerce')),Object(v.createElement)(w.Button,{onClick:this.skipInstaller},Object(O.__)("Continue without installing",'woocommerce'))):r?null:0===o.length?Object(v.createElement)(v.Fragment,null,Object(v.createElement)(w.Button,{isPrimary:!0,isBusy:t,onClick:this.skipInstaller},Object(O.__)("Continue",'woocommerce'))):Object(v.createElement)(v.Fragment,null,Object(v.createElement)(w.Button,{isBusy:t,isPrimary:!0,onClick:this.installAndActivate},Object(O.__)("Install & enable",'woocommerce')),Object(v.createElement)(w.Button,{isTertiary:!0,onClick:this.skipInstaller},n||Object(O.__)("No thanks",'woocommerce')),a&&Object(v.createElement)(w.Button,{isTertiary:!0,onClick:a},i||Object(O.__)("Abort",'woocommerce')))}}]),a}(v.Component);fl.propTypes={onComplete:S.a.func.isRequired,onError:S.a.func,onSkip:S.a.func,skipText:S.a.string,autoInstall:S.a.bool,pluginSlugs:S.a.arrayOf(S.a.string),onAbort:S.a.func,abortText:S.a.string},fl.defaultProps={autoInstall:!1,onError:function(){},onSkip:function(){},pluginSlugs:["jetpack","woocommerce-services"]},Object(Z.compose)(Object(ul.withSelect)((function(e){var t=e(dl.PLUGINS_STORE_NAME),n=t.getActivePlugins,r=t.getInstalledPlugins,o=t.isPluginsRequesting;return{isRequesting:o("activatePlugins")||o("installPlugins"),activePlugins:n(),installedPlugins:r()}})),Object(ul.withDispatch)((function(e){return{installAndActivatePlugins:e(dl.PLUGINS_STORE_NAME).installAndActivatePlugins}})))(fl);var pl=n(528),hl=n.n(pl);var ml=function(e){h()(o,e);var t,n,r=(t=o,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=g()(t);if(n){var o=g()(this).constructor;e=Reflect.construct(r,arguments,o)}else e=r.apply(this,arguments);return y()(this,e)});function o(){return s()(this,o),r.apply(this,arguments)}return u()(o,[{key:"stars",value:function(e){for(var t=this.props,n=t.size,r=t.totalStars,o={width:n+"px",height:n+"px"},a=[],i=0;i<r;i++){var c=e||hl.a;a.push(Object(v.createElement)(c,{key:"star-"+i,style:o}))}return a}},{key:"render",value:function(){var e=this.props,t=e.rating,n=e.totalStars,r=e.className,o=e.icon,a=e.outlineIcon,i=q()("woocommerce-rating",r),c=100/n,s={width:Math.round(c*t)+"%"},l=Object(O.sprintf)(Object(O.__)("%1$s out of %2$s stars.",'woocommerce'),t,n);return Object(v.createElement)("div",{className:i,"aria-label":l},this.stars(o),Object(v.createElement)("div",{className:"woocommerce-rating__star-outline",style:s},this.stars(a||o)))}}]),o}(v.Component);ml.propTypes={rating:S.a.number,totalStars:S.a.number,size:S.a.number,className:S.a.string,icon:S.a.elementType,outlineIcon:S.a.elementType},ml.defaultProps={rating:0,totalStars:5,size:18};S.a.object.isRequired;var yl=function(e){h()(o,e);var t,n,r=(t=o,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=g()(t);if(n){var o=g()(this).constructor;e=Reflect.construct(r,arguments,o)}else e=r.apply(this,arguments);return y()(this,e)});function o(){var e;return s()(this,o),(e=r.call(this)).renderCard=e.renderCard.bind(f()(e)),e.onRangeSelect=e.onRangeSelect.bind(f()(e)),e}return u()(o,[{key:"renderCard",value:function(e){var t=this.props,n=t.siteLocale,r=t.advancedFilters,o=t.query,a=t.path,i=t.onAdvancedFilterAction,c=t.currency,s=e.filters,l=e.param;if(!o[l])return null;if(0===o[l].indexOf("compare")){var u=Object(_.find)(s,{value:o[l]});if(!u)return null;var d=u.settings,f=void 0===d?{}:d;return Object(v.createElement)("div",{key:l,className:"woocommerce-filters__advanced-filters"},Object(v.createElement)(bs,T()({path:a,query:o},f)))}return"advanced"===o[l]?Object(v.createElement)("div",{key:l,className:"woocommerce-filters__advanced-filters"},Object(v.createElement)(Mt,{siteLocale:n,currency:c,config:r,path:a,query:o,onAdvancedFilterAction:i})):void 0}},{key:"onRangeSelect",value:function(e){var t=this.props,n=t.query,r=t.path,o=t.onDateSelect;Object(P.k)(e,r,n),o(e)}},{key:"getDateQuery",value:function(e){var t=Object(dt.d)(e),n=t.period,r=t.compare,o=t.before,a=t.after,i=Object(dt.c)(e);return{period:n,compare:r,before:o,after:a,primaryDate:i.primary,secondaryDate:i.secondary}}},{key:"render",value:function(){var e=this.props,t=e.dateQuery,n=e.filters,r=e.query,o=e.path,a=e.showDatePicker,i=e.onFilterSelect,c=e.isoDateFormat;return Object(v.createElement)(v.Fragment,null,Object(v.createElement)(bt,{className:"screen-reader-text"},Object(O.__)("Filters",'woocommerce')),Object(v.createElement)(gt,{component:"div",className:"woocommerce-filters"},Object(v.createElement)("div",{className:"woocommerce-filters__basic-filters"},a&&Object(v.createElement)(As,{key:JSON.stringify(r),dateQuery:t||this.getDateQuery(r),onRangeSelect:this.onRangeSelect,isoDateFormat:c}),n.map((function(e){return e.showFilters(r)?Object(v.createElement)(Gs,{key:e.param,config:e,query:r,path:o,onFilterSelect:i}):null}))),n.map(this.renderCard)))}}]),o}(v.Component);yl.propTypes={siteLocale:S.a.string,advancedFilters:S.a.object,filters:S.a.array,path:S.a.string.isRequired,query:S.a.object,showDatePicker:S.a.bool,onDateSelect:S.a.func,onFilterSelect:S.a.func,onAdvancedFilterAction:S.a.func,currency:S.a.object,dateQuery:S.a.shape({period:S.a.string.isRequired,compare:S.a.string.isRequired,before:S.a.object,after:S.a.object,primaryDate:S.a.shape({label:S.a.string.isRequired,range:S.a.string.isRequired}).isRequired,secondaryDate:S.a.shape({label:S.a.string.isRequired,range:S.a.string.isRequired})}),isoDateFormat:S.a.string},yl.defaultProps={siteLocale:"en_US",advancedFilters:{},filters:[],query:{},showDatePicker:!0,onDateSelect:function(){},currency:ct().getCurrencyConfig()};S.a.object.isRequired;var bl=n(529),gl=n.n(bl);function vl(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Ol(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?vl(Object(n),!0).forEach((function(t){o()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):vl(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function wl(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e,n=Object(_.groupBy)(e,"parent"),r=Object(_.keyBy)(t,"id"),o=function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!t.parent)return t.name?[t.name]:[];var n=e(r[t.parent]);return[].concat(i()(n),[t.name])},a=function e(t){return t.map((function(t){var a=n[t.id];return delete n[t.id],Ol(Ol({},t),{},{breadcrumbs:o(r[t.parent]),children:a&&a.length?e(a):[]})}))},c=a(n[0]||[]);return delete n[0],Object(_.forEach)(n,(function(e){c.push.apply(c,i()(a(e||[])))})),c}var _l=function(e){var t=e.countLabel,n=e.className,r=e.depth,o=void 0===r?0:r,a=e.controlId,i=void 0===a?"":a,c=e.item,s=e.isSelected,l=e.isSingle,u=e.onSelect,d=e.search,f=void 0===d?"":d,p=R()(e,["countLabel","className","depth","controlId","item","isSelected","isSingle","onSelect","search"]),h=!Object(_.isNil)(t)||!Object(_.isNil)(c.count),m=[n,"woocommerce-search-list__item"];m.push("depth-".concat(o)),l&&m.push("is-radio-button"),h&&m.push("has-count");var y,b=c.breadcrumbs&&c.breadcrumbs.length,g=p.name||"search-list-item-".concat(i),O="".concat(g,"-").concat(c.id);return Object(v.createElement)("label",{htmlFor:O,className:m.join(" ")},l?Object(v.createElement)("input",T()({type:"radio",id:O,name:g,value:c.value,onChange:u(c),checked:s,className:"woocommerce-search-list__item-input"},p)):Object(v.createElement)("input",T()({type:"checkbox",id:O,name:g,value:c.value,onChange:u(c),checked:s,className:"woocommerce-search-list__item-input"},p)),Object(v.createElement)("span",{className:"woocommerce-search-list__item-label"},b?Object(v.createElement)("span",{className:"woocommerce-search-list__item-prefix"},1===(y=c.breadcrumbs).length?Object(_.first)(y):2===y.length?Object(_.first)(y)+" › "+Object(_.last)(y):Object(_.first)(y)+" … "+Object(_.last)(y)):null,Object(v.createElement)("span",{className:"woocommerce-search-list__item-name"},function(e,t){if(!t)return e;var n=new RegExp(Object(_.escapeRegExp)(t),"ig");return e.split(n).map((function(e,n){return 0===n?e:Object(v.createElement)(v.Fragment,{key:n},Object(v.createElement)("strong",null,t),e)}))}(c.name,f))),!!h&&Object(v.createElement)("span",{className:"woocommerce-search-list__item-count"},t||c.count))};_l.propTypes={className:S.a.string,countLabel:S.a.node,controlId:S.a.node,depth:S.a.number,item:S.a.object,name:S.a.string,isSelected:S.a.bool,isSingle:S.a.bool,onSelect:S.a.func,search:S.a.string};var kl=_l;function Sl(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function jl(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Sl(Object(n),!0).forEach((function(t){o()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Sl(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var El={clear:Object(O.__)("Clear all selected items",'woocommerce'),noItems:Object(O.__)("No items found.",'woocommerce'),noResults:Object(O.__)("No results for %s",'woocommerce'),search:Object(O.__)("Search for items",'woocommerce'),selected:function(e){return Object(O.sprintf)(
/* translators: Number of items selected from list. */
Object(O._n)("%d item selected","%d items selected",e,'woocommerce'),e)},updated:Object(O.__)("Search results updated.",'woocommerce')},Cl=function(e){h()(o,e);var t,n,r=(t=o,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=g()(t);if(n){var o=g()(this).constructor;e=Reflect.construct(r,arguments,o)}else e=r.apply(this,arguments);return y()(this,e)});function o(){var e;return s()(this,o),(e=r.apply(this,arguments)).onSelect=e.onSelect.bind(f()(e)),e.onRemove=e.onRemove.bind(f()(e)),e.onClear=e.onClear.bind(f()(e)),e.isSelected=e.isSelected.bind(f()(e)),e.defaultRenderItem=e.defaultRenderItem.bind(f()(e)),e.renderList=e.renderList.bind(f()(e)),e}return u()(o,[{key:"componentDidUpdate",value:function(e){var t=this.props,n=t.onSearch,r=t.search;r!==e.search&&"function"==typeof n&&n(r)}},{key:"onRemove",value:function(e){var t=this.props,n=t.isSingle,r=t.onChange,o=t.selected;return function(){n&&r([]);var t=Object(_.findIndex)(o,{id:e});r([].concat(i()(o.slice(0,t)),i()(o.slice(t+1))))}}},{key:"onSelect",value:function(e){var t=this,n=this.props,r=n.isSingle,o=n.onChange,a=n.selected;return function(){t.isSelected(e)?t.onRemove(e.id)():o(r?[e]:[].concat(i()(a),[e]))}}},{key:"onClear",value:function(){this.props.onChange([])}},{key:"isSelected",value:function(e){return-1!==Object(_.findIndex)(this.props.selected,{id:e.id})}},{key:"getFilteredList",value:function(e,t){var n=this.props.isHierarchical;if(!t)return n?wl(e):e;var r=jl(jl({},El),this.props.messages),o=new RegExp(Object(_.escapeRegExp)(t),"i");this.props.debouncedSpeak(r.updated);var a=e.map((function(e){return!!o.test(e.name)&&e})).filter(Boolean);return n?wl(a,e):a}},{key:"defaultRenderItem",value:function(e){return Object(v.createElement)(kl,e)}},{key:"renderList",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=this.props,o=r.isSingle,a=r.search,i=r.instanceId,c=this.props.renderItem||this.defaultRenderItem;return e?e.map((function(e){return Object(v.createElement)(v.Fragment,{key:e.id},Object(v.createElement)("li",null,c({item:e,isSelected:t.isSelected(e),onSelect:t.onSelect,isSingle:o,search:a,depth:n,controlId:i})),t.renderList(e.children,n+1))})):null}},{key:"renderListSection",value:function(){var e=this.props,t=e.isLoading,n=e.search,r=jl(jl({},El),this.props.messages);if(t)return Object(v.createElement)("div",{className:"woocommerce-search-list__list is-loading"},Object(v.createElement)(w.Spinner,null));var o=this.getFilteredList(this.props.list,n);return o.length?Object(v.createElement)("ul",{className:"woocommerce-search-list__list"},this.renderList(o)):Object(v.createElement)("div",{className:"woocommerce-search-list__list is-not-found"},Object(v.createElement)("span",{className:"woocommerce-search-list__not-found-icon"},Object(v.createElement)(gl.a,{role:"img","aria-hidden":"true",focusable:"false"})),Object(v.createElement)("span",{className:"woocommerce-search-list__not-found-text"},n?Object(O.sprintf)(r.noResults,n):r.noItems))}},{key:"renderSelectedSection",value:function(){var e=this,t=this.props,n=t.isLoading,r=t.isSingle,o=t.selected,a=jl(jl({},El),this.props.messages);if(n||r||!o)return null;var i=o.length;return Object(v.createElement)("div",{className:"woocommerce-search-list__selected"},Object(v.createElement)("div",{className:"woocommerce-search-list__selected-header"},Object(v.createElement)("strong",null,a.selected(i)),i>0?Object(v.createElement)(w.Button,{isLink:!0,isDestructive:!0,onClick:this.onClear,"aria-label":a.clear},Object(O.__)("Clear all",'woocommerce')):null),i>0?Object(v.createElement)("ul",null,o.map((function(t,n){return Object(v.createElement)("li",{key:n},Object(v.createElement)(oe,{label:t.name,id:t.id,remove:e.onRemove}))}))):null)}},{key:"render",value:function(){var e=this.props,t=e.className,n=void 0===t?"":t,r=e.isCompact,o=e.search,a=e.setState,i=jl(jl({},El),this.props.messages);return Object(v.createElement)("div",{className:q()("woocommerce-search-list",n,{"is-compact":r})},this.renderSelectedSection(),Object(v.createElement)("div",{className:"woocommerce-search-list__search"},Object(v.createElement)(w.TextControl,{label:i.search,type:"search",value:o,onChange:function(e){return a({search:e})}})),this.renderListSection())}}]),o}(v.Component);Cl.propTypes={className:S.a.string,isCompact:S.a.bool,isHierarchical:S.a.bool,isLoading:S.a.bool,isSingle:S.a.bool,list:S.a.arrayOf(S.a.shape({id:S.a.number,name:S.a.string})),messages:S.a.shape({clear:S.a.string,noItems:S.a.string,noResults:S.a.string,search:S.a.string,selected:S.a.func,updated:S.a.string}),onChange:S.a.func.isRequired,onSearch:S.a.func,renderItem:S.a.func,selected:S.a.array.isRequired,search:S.a.string,setState:S.a.func,debouncedSpeak:S.a.func,instanceId:S.a.number};var Dl=Object(Z.compose)([Object(Z.withState)({search:""}),w.withSpokenMessages,Z.withInstanceId])(Cl);(function(e){h()(o,e);var t,n,r=(t=o,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=g()(t);if(n){var o=g()(this).constructor;e=Reflect.construct(r,arguments,o)}else e=r.apply(this,arguments);return y()(this,e)});function o(){return s()(this,o),r.apply(this,arguments)}return u()(o,[{key:"render",value:function(){var e=this.props,t=e.children,n=e.menu,r=e.title,o=q()("woocommerce-section-header",this.props.className);return Object(v.createElement)("div",{className:o},Object(v.createElement)(bt,{className:"woocommerce-section-header__title woocommerce-section-header__header-item"},r),Object(v.createElement)("hr",{role:"presentation"}),t&&Object(v.createElement)("div",{className:"woocommerce-section-header__actions woocommerce-section-header__header-item"},t),n&&Object(v.createElement)("div",{className:"woocommerce-section-header__menu woocommerce-section-header__header-item"},n))}}]),o}(v.Component)).propTypes={className:S.a.string,menu:ps(fs),title:S.a.oneOfType([S.a.string,S.a.node]).isRequired};var Pl=function(e){h()(o,e);var t,n,r=(t=o,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=g()(t);if(n){var o=g()(this).constructor;e=Reflect.construct(r,arguments,o)}else e=r.apply(this,arguments);return y()(this,e)});function o(e){var t;return s()(this,o),(t=r.call(this,e)).scrollTo=t.scrollTo.bind(f()(t)),t}return u()(o,[{key:"componentDidMount",value:function(){setTimeout(this.scrollTo,250)}},{key:"scrollTo",value:function(){var e=this.props.offset;this.ref.current&&this.ref.current.offsetTop?window.scrollTo(0,this.ref.current.offsetTop+parseInt(e,10)):setTimeout(this.scrollTo,250)}},{key:"render",value:function(){var e=this.props.children;return this.ref=Object(v.createRef)(),Object(v.createElement)("span",{ref:this.ref},e)}}]),o}(v.Component);Pl.propTypes={offset:S.a.string},Pl.defaultProps={offset:"0"};var xl=function(e){h()(o,e);var t,n,r=(t=o,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=g()(t);if(n){var o=g()(this).constructor;e=Reflect.construct(r,arguments,o)}else e=r.apply(this,arguments);return y()(this,e)});function o(){return s()(this,o),r.apply(this,arguments)}return u()(o,[{key:"render",value:function(){var e=this.props.className,t=q()("woocommerce-spinner",e);return Object(v.createElement)("svg",{className:t,viewBox:"0 0 100 100",xmlns:"http://www.w3.org/2000/svg"},Object(v.createElement)("circle",{className:"woocommerce-spinner__circle",fill:"none",strokeWidth:"5",strokeLinecap:"round",cx:"50",cy:"50",r:"30"}))}}]),o}(v.Component);xl.propTypes={className:S.a.string};var Fl=xl,Tl=function(){return Object(v.createElement)("svg",{role:"img","aria-hidden":"true",focusable:"false",width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Object(v.createElement)("mask",{id:"mask0","mask-type":"alpha",maskUnits:"userSpaceOnUse",x:"2",y:"3",width:"14",height:"12"},Object(v.createElement)("path",{d:"M6.59631 11.9062L3.46881 8.77875L2.40381 9.83625L6.59631 14.0287L15.5963 5.02875L14.5388 3.97125L6.59631 11.9062Z",fill:"white"})),Object(v.createElement)("g",{mask:"url(#mask0)"},Object(v.createElement)("rect",{width:"18",height:"18",fill:"white"})))};var Ml=function(e){h()(o,e);var t,n,r=(t=o,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=g()(t);if(n){var o=g()(this).constructor;e=Reflect.construct(r,arguments,o)}else e=r.apply(this,arguments);return y()(this,e)});function o(){return s()(this,o),r.apply(this,arguments)}return u()(o,[{key:"renderCurrentStepContent",value:function(){var e=this.props,t=e.currentStep,n=e.steps.find((function(e){return t===e.key}));return n.content?Object(v.createElement)("div",{className:"woocommerce-stepper_content"},n.content):null}},{key:"render",value:function(){var e=this,t=this.props,n=t.className,r=t.currentStep,o=t.steps,a=t.isVertical,i=t.isPending,c=o.findIndex((function(e){return r===e.key})),s=q()("woocommerce-stepper",n,{"is-vertical":a});return Object(v.createElement)("div",{className:s},Object(v.createElement)("div",{className:"woocommerce-stepper__steps"},o.map((function(t,n){var o=t.key,s=t.label,l=t.description,u=t.isComplete,d=t.onClick,f=o===r,p=q()("woocommerce-stepper__step",{"is-active":f,"is-complete":void 0!==u?u:c>n}),h=f&&i?Object(v.createElement)(Fl,null):Object(v.createElement)("div",{className:"woocommerce-stepper__step-icon"},Object(v.createElement)("span",{className:"woocommerce-stepper__step-number"},n+1),Object(v.createElement)(Tl,null)),m="function"==typeof d?"button":"div";return Object(v.createElement)(v.Fragment,{key:o},Object(v.createElement)("div",{className:p},Object(v.createElement)(m,{className:"woocommerce-stepper__step-label-wrapper",onClick:"function"==typeof d?function(){return d(o)}:null},h,Object(v.createElement)("div",{className:"woocommerce-stepper__step-text"},Object(v.createElement)("span",{className:"woocommerce-stepper__step-label"},s),l&&Object(v.createElement)("span",{className:"woocommerce-stepper__step-description"},l))),f&&a&&e.renderCurrentStepContent()),!a&&Object(v.createElement)("div",{className:"woocommerce-stepper__step-divider"}))}))),!a&&this.renderCurrentStepContent())}}]),o}(v.Component);function Rl(e){return e<10?"has-".concat(e,"-items"):"has-10-items"}Ml.propTypes={className:S.a.string,currentStep:S.a.string.isRequired,steps:S.a.arrayOf(S.a.shape({content:S.a.node,description:S.a.oneOfType([S.a.string,S.a.array]),isComplete:S.a.bool,key:S.a.string.isRequired,label:S.a.string.isRequired,onClick:S.a.func})).isRequired,isVertical:S.a.bool,isPending:S.a.bool},Ml.defaultProps={isVertical:!1,isPending:!1};var Il=function(e){var t=e.label,n=e.orientation,r=e.itemCount,a=e.items,i=Object(_.uniqueId)("woocommerce-summary-helptext-"),c=Rl(r),s=q()("woocommerce-summary",o()({},c,"horizontal"===n));return Object(v.createElement)(w.NavigableMenu,{"aria-label":t,"aria-describedby":i,orientation:n,stopNavigationEvents:!0},Object(v.createElement)("p",{id:i,className:"screen-reader-text"},Object(O.__)("List of data points available for filtering. Use arrow keys to cycle through the list. Click a data point for a detailed report.",'woocommerce')),Object(v.createElement)("ul",{className:s},a))};Il.propTypes={label:S.a.string,orientation:S.a.oneOf(["vertical","horizontal"]).isRequired,items:S.a.node.isRequired,itemCount:S.a.number.isRequired};var Al=Il,Nl=function(e){var t=e.children,n=e.isDropdownBreakpoint,r=e.label,o=t({}),a=v.Children.count(o)||1,i=n?"vertical":"horizontal",c=Object(v.createElement)(Al,{label:r,orientation:i,itemCount:a,items:o});if(!n||a<2)return c;var s=o.find((function(e){return!!e.props.selected}));return s?Object(v.createElement)(w.Dropdown,{className:"woocommerce-summary",position:"bottom",headerTitle:r,renderToggle:function(e){var t=e.isOpen,n=e.onToggle;return Object(v.cloneElement)(s,{onToggle:n,isOpen:t})},renderContent:function(e){return Object(v.createElement)(Al,{label:r,orientation:i,itemCount:a,items:t(e)})}}):c};Nl.propTypes={children:S.a.func.isRequired,label:S.a.string},Nl.defaultProps={label:Object(O.__)("Performance Indicators",'woocommerce')},Object(xn.withViewportMatch)({isDropdownBreakpoint:"< large"})(Nl);var Ll=function(e){var t=e.className;return Object(v.createElement)("li",{"data-testid":"summary-placeholder",className:q()("woocommerce-summary__item-container is-placeholder",t)},Object(v.createElement)("div",{className:"woocommerce-summary__item"},Object(v.createElement)("div",{className:"woocommerce-summary__item-label"}),Object(v.createElement)("div",{className:"woocommerce-summary__item-data"},Object(v.createElement)("div",{className:"woocommerce-summary__item-value"}),Object(v.createElement)("div",{className:"woocommerce-summary__item-delta"}))))},Ul=function(e){h()(a,e);var t,n,r=(t=a,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=g()(t);if(n){var o=g()(this).constructor;e=Reflect.construct(r,arguments,o)}else e=r.apply(this,arguments);return y()(this,e)});function a(){return s()(this,a),r.apply(this,arguments)}return u()(a,[{key:"render",value:function(){var e,t=this.props.isDropdownBreakpoint,n=t?1:this.props.numberOfItems,r=Rl(n),a=q()("woocommerce-summary",(e={},o()(e,r,!t),o()(e,"is-placeholder",!0),e));return Object(v.createElement)("ul",{className:a,"aria-hidden":"true"},Object(_.range)(n).map((function(e){return Object(v.createElement)(Ll,{key:e})})))}}]),a}(v.Component);Ul.propTypes={numberOfItems:S.a.number.isRequired},Ul.defaultProps={numberOfRows:5},Object(xn.withViewportMatch)({isDropdownBreakpoint:"< large"})(Ul);var Bl=n(530),Hl=n.n(Bl),ql=function(e){var t,n=e.children,r=e.delta,o=e.href,a=e.hrefType,i=e.isOpen,c=e.label,s=e.onToggle,l=e.prevLabel,u=e.prevValue,d=e.reverseTrend,f=e.selected,p=e.value,h=e.onLinkClickCallback,m=q()("woocommerce-summary__item-container",{"is-dropdown-button":s,"is-dropdown-expanded":i}),y=q()("woocommerce-summary__item",{"is-selected":f,"is-good-trend":d?r<0:r>0,"is-bad-trend":d?r>0:r<0}),b=r>0?Object(O.sprintf)(Object(O.__)("Up %f%% from %s",'woocommerce'),r,l):Object(O.sprintf)(Object(O.__)("Down %f%% from %s",'woocommerce'),Math.abs(r),l);r||(b=Object(O.sprintf)(Object(O.__)("No change from %s",'woocommerce'),l));var g={className:y,"aria-current":f?"page":null};if(s||o){var k=!!s;t=k?w.Button:L,k?(g.onClick=s,g["aria-expanded"]=i):(g.href=o,g.role="menuitem",g.onClick=h,g.type=a)}else t="div";return Object(v.createElement)("li",{className:m},Object(v.createElement)(t,g,Object(v.createElement)("div",{className:"woocommerce-summary__item-label"},Object(v.createElement)(x,{variant:"body.small"},c)),Object(v.createElement)("div",{className:"woocommerce-summary__item-data"},Object(v.createElement)("div",{className:"woocommerce-summary__item-value"},Object(v.createElement)(x,{variant:"title.small"},Object(_.isNil)(p)?Object(O.__)("N/A",'woocommerce'):p)),Object(v.createElement)(w.Tooltip,{text:Object(_.isNil)(u)?Object(O.__)("N/A",'woocommerce'):"".concat(l," ").concat(u),position:"top center"},Object(v.createElement)("div",{className:"woocommerce-summary__item-delta",role:"presentation","aria-label":b},Object(v.createElement)(x,{variant:"caption"},Object(_.isNil)(r)?Object(O.__)("N/A",'woocommerce'):Object(O.sprintf)(Object(O.__)("%f%%",'woocommerce'),r))))),s?Object(v.createElement)(Hl.a,{className:"woocommerce-summary__toggle",size:24}):null,n))};ql.propTypes={delta:S.a.number,href:S.a.string,hrefType:S.a.oneOf(["wp-admin","wc-admin","external"]).isRequired,isOpen:S.a.bool,label:S.a.string.isRequired,onToggle:S.a.func,prevLabel:S.a.string,prevValue:S.a.oneOfType([S.a.number,S.a.string]),reverseTrend:S.a.bool,selected:S.a.bool,value:S.a.oneOfType([S.a.number,S.a.string]),onLinkClickCallback:S.a.func},ql.defaultProps={href:"",hrefType:"wc-admin",isOpen:!1,prevLabel:Object(O.__)("Previous Period:",'woocommerce'),reverseTrend:!1,selected:!1,onLinkClickCallback:_.noop};var zl=Object(v.createElement)(de.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},Object(v.createElement)(de.Path,{d:"M6.5 12.4L12 8l5.5 4.4-.9 1.2L12 10l-4.5 3.6-1-1.2z"})),Vl=Object(v.createElement)(de.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},Object(v.createElement)(de.Path,{d:"M17.5 11.6L12 16l-5.5-4.4.9-1.2L12 14l4.5-3.6 1 1.2z"}));var Kl=function(e){h()(o,e);var t,n,r=(t=o,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=g()(t);if(n){var o=g()(this).constructor;e=Reflect.construct(r,arguments,o)}else e=r.apply(this,arguments);return y()(this,e)});function o(e){var t;return s()(this,o),(t=r.call(this,e)).state={tabIndex:null,isScrollableRight:!1,isScrollableLeft:!1},t.container=Object(v.createRef)(),t.sortBy=t.sortBy.bind(f()(t)),t.updateTableShadow=t.updateTableShadow.bind(f()(t)),t}return u()(o,[{key:"componentDidMount",value:function(){var e=this.container.current,t=e.scrollWidth>e.clientWidth;this.setState({tabIndex:t?"0":null}),this.updateTableShadow(),window.addEventListener("resize",this.updateTableShadow)}},{key:"componentDidUpdate",value:function(){this.updateTableShadow()}},{key:"componentWillUnmount",value:function(){window.removeEventListener("resize",this.updateTableShadow)}},{key:"sortBy",value:function(e){var t=this,n=this.props,r=n.headers,o=n.query;return function(){var n=o.orderby||Object(_.get)(Object(_.find)(r,{defaultSort:!0}),"key",!1),a=o.order||Object(_.get)(Object(_.find)(r,{key:n}),"defaultOrder","desc"),i="desc";e===n&&(i="desc"===a?"asc":"desc"),t.props.onSort(e,i)}}},{key:"updateTableShadow",value:function(){var e=this.container.current,t=this.state,n=t.isScrollableRight,r=t.isScrollableLeft,o=e.scrollWidth-e.scrollLeft<=e.offsetWidth;o&&n?this.setState({isScrollableRight:!1}):o||this.state.isScrollableRight||this.setState({isScrollableRight:!0});var a=e.scrollLeft<=0;a&&r?this.setState({isScrollableLeft:!1}):a||r||this.setState({isScrollableLeft:!0})}},{key:"render",value:function(){var e=this,t=this.props,n=t.ariaHidden,r=t.caption,o=t.classNames,a=t.headers,i=t.instanceId,c=t.query,s=t.rowHeader,l=t.rows,u=this.state,d=u.isScrollableRight,f=u.isScrollableLeft,p=u.tabIndex,h=q()("woocommerce-table__table",o,{"is-scrollable-right":d,"is-scrollable-left":f}),m=c.orderby||Object(_.get)(Object(_.find)(a,{defaultSort:!0}),"key",!1),y=c.order||Object(_.get)(Object(_.find)(a,{key:m}),"defaultOrder","desc"),b=!!l.length;return Object(v.createElement)("div",{className:h,ref:this.container,tabIndex:p,"aria-hidden":n,"aria-labelledby":"caption-".concat(i),role:"group",onScroll:this.updateTableShadow},Object(v.createElement)("table",null,Object(v.createElement)("caption",{id:"caption-".concat(i),className:"woocommerce-table__caption screen-reader-text"},r,"0"===p&&Object(v.createElement)("small",null,Object(O.__)("(scroll to see more)",'woocommerce'))),Object(v.createElement)("tbody",null,Object(v.createElement)("tr",null,a.map((function(t,n){var r=t.cellClassName,o=t.isLeftAligned,a=t.isSortable,c=t.isNumeric,s=t.key,l=t.label,u=t.screenReaderLabel,d="header-".concat(i,"-").concat(n),f={className:q()("woocommerce-table__header",r,{"is-left-aligned":o,"is-sortable":a,"is-sorted":m===s,"is-numeric":c})};a&&(f["aria-sort"]="none",m===s&&(f["aria-sort"]="asc"===y?"ascending":"descending"));var p=m===s&&"asc"!==y?Object(O.sprintf)(Object(O.__)("Sort by %s in ascending order",'woocommerce'),u||l):Object(O.sprintf)(Object(O.__)("Sort by %s in descending order",'woocommerce'),u||l),h=Object(v.createElement)(v.Fragment,null,Object(v.createElement)("span",{"aria-hidden":Boolean(u)},l),u&&Object(v.createElement)("span",{className:"screen-reader-text"},u));return Object(v.createElement)("th",T()({role:"columnheader",scope:"col",key:n},f),a?Object(v.createElement)(v.Fragment,null,Object(v.createElement)(w.Button,{"aria-describedby":d,onClick:b?e.sortBy(s):_.noop},m===s&&"asc"===y?Object(v.createElement)(ue,{icon:zl}):Object(v.createElement)(ue,{icon:Vl}),h),Object(v.createElement)("span",{className:"screen-reader-text",id:d},p)):h)}))),b?l.map((function(e,t){return Object(v.createElement)("tr",{key:t},e.map((function(e,t){var n=a[t],r=n.cellClassName,o=n.isLeftAligned,i=n.isNumeric,c=s===t,l=c?"th":"td",u=q()("woocommerce-table__item",r,{"is-left-aligned":o,"is-numeric":i,"is-sorted":m===a[t].key});return Object(v.createElement)(l,{scope:c?"row":null,key:t,className:u},function(e){return e.display||null}(e))})))})):Object(v.createElement)("tr",null,Object(v.createElement)("td",{className:"woocommerce-table__empty-item",colSpan:a.length},Object(O.__)("No data to display",'woocommerce'))))))}}]),o}(v.Component);Kl.propTypes={ariaHidden:S.a.bool,caption:S.a.string.isRequired,className:S.a.string,headers:S.a.arrayOf(S.a.shape({defaultSort:S.a.bool,defaultOrder:S.a.string,isLeftAligned:S.a.bool,isNumeric:S.a.bool,isSortable:S.a.bool,key:S.a.string,label:S.a.node,required:S.a.bool,screenReaderLabel:S.a.string})),onSort:S.a.func,query:S.a.object,rows:S.a.arrayOf(S.a.arrayOf(S.a.shape({display:S.a.node,value:S.a.oneOfType([S.a.string,S.a.number,S.a.bool])}))).isRequired,rowHeader:S.a.oneOfType([S.a.number,S.a.bool])},Kl.defaultProps={ariaHidden:!1,headers:[],onSort:_.noop,query:{},rowHeader:0};var Wl=Object(Z.withInstanceId)(Kl);var Gl=function(e){h()(o,e);var t,n,r=(t=o,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=g()(t);if(n){var o=g()(this).constructor;e=Reflect.construct(r,arguments,o)}else e=r.apply(this,arguments);return y()(this,e)});function o(){return s()(this,o),r.apply(this,arguments)}return u()(o,[{key:"render",value:function(){var e=this,t=this.props,n=t.numberOfRows,r=R()(t,["numberOfRows"]),o=Object(_.range)(n).map((function(){return e.props.headers.map((function(){return{display:Object(v.createElement)("span",{className:"is-placeholder"})}}))}));return Object(v.createElement)(Wl,T()({ariaHidden:!0,classNames:"is-loading",rows:o},r))}}]),o}(v.Component);Gl.propTypes={query:S.a.object,caption:S.a.string.isRequired,headers:S.a.arrayOf(S.a.shape({hiddenByDefault:S.a.bool,defaultSort:S.a.bool,isSortable:S.a.bool,key:S.a.string,label:S.a.node,required:S.a.bool})),numberOfRows:S.a.number},Gl.defaultProps={numberOfRows:5};var Yl=Gl,$l=function(e){var t=e.data;return Object(v.createElement)("ul",{className:"woocommerce-table__summary"},t.map((function(e,t){var n=e.label,r=e.value;return Object(v.createElement)("li",{className:"woocommerce-table__summary-item",key:t},Object(v.createElement)("span",{className:"woocommerce-table__summary-value"},r),Object(v.createElement)("span",{className:"woocommerce-table__summary-label"},n))})))};$l.propTypes={data:S.a.array};var Ql=$l;var Jl=function(e){h()(o,e);var t,n,r=(t=o,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=g()(t);if(n){var o=g()(this).constructor;e=Reflect.construct(r,arguments,o)}else e=r.apply(this,arguments);return y()(this,e)});function o(e){var t;s()(this,o);var n=(t=r.call(this,e)).getShowCols(e.headers);return t.state={showCols:n},t.onColumnToggle=t.onColumnToggle.bind(f()(t)),t.onPageChange=t.onPageChange.bind(f()(t)),t}return u()(o,[{key:"componentDidUpdate",value:function(e){var t=e.headers,n=e.query,r=this.props,o=r.headers,a=r.onColumnsChange,i=r.query,c=this.state.showCols;if(Object(_.isEqual)(o,t)||this.setState({showCols:this.getShowCols(o)}),i.orderby!==n.orderby&&!c.includes(i.orderby)){var s=c.concat(i.orderby);this.setState({showCols:s}),a(s)}}},{key:"getShowCols",value:function(e){return e.map((function(e){var t=e.key,n=e.visible;return!(void 0!==n&&!n)&&t})).filter(Boolean)}},{key:"getVisibleHeaders",value:function(){var e=this.props.headers,t=this.state.showCols;return e.filter((function(e){var n=e.key;return t.includes(n)}))}},{key:"getVisibleRows",value:function(){var e=this.props,t=e.headers,n=e.rows,r=this.state.showCols;return n.map((function(e){return t.map((function(t,n){var o=t.key;return r.includes(o)&&e[n]})).filter(Boolean)}))}},{key:"onColumnToggle",value:function(e){var t=this,n=this.props,r=n.headers,o=n.query,a=n.onQueryChange,c=n.onColumnsChange;return function(){t.setState((function(t){if(t.showCols.includes(e)){if(o.orderby===e){var n=Object(_.find)(r,{defaultSort:!0})||Object(_.first)(r)||{};a("sort")(n.key,"desc")}var s=Object(_.without)(t.showCols,e);return c(s,e),{showCols:s}}var l=[].concat(i()(t.showCols),[e]);return c(l,e),{showCols:l}}))}}},{key:"onPageChange",value:function(){var e=this.props,t=e.onPageChange,n=e.onQueryChange;t&&t.apply(void 0,arguments),n&&n("paged").apply(void 0,arguments)}},{key:"render",value:function(){var e=this,t=this.props,n=t.actions,r=t.className,o=t.hasSearch,a=t.isLoading,i=t.onQueryChange,c=t.onSort,s=t.query,l=t.rowHeader,u=t.rowsPerPage,d=t.showMenu,f=t.summary,p=t.title,h=t.totalRows,m=this.state.showCols,y=this.props.headers,b=this.getVisibleHeaders(),g=this.getVisibleRows(),_=q()("woocommerce-table",r,{"has-actions":!!n,"has-menu":d,"has-search":o});return Object(v.createElement)(w.Card,{className:_},Object(v.createElement)(w.CardHeader,null,Object(v.createElement)(w.__experimentalText,{variant:"title.small",as:"h2"},p),Object(v.createElement)("div",{className:"woocommerce-table__actions"},n),d&&Object(v.createElement)(fs,{label:Object(O.__)("Choose which values to display",'woocommerce'),renderContent:function(){return Object(v.createElement)(v.Fragment,null,Object(v.createElement)(al,null,Object(O.__)("Columns:",'woocommerce')),y.map((function(t){var n=t.key,r=t.label;return t.required?null:Object(v.createElement)(rl,{checked:m.includes(n),isCheckbox:!0,isClickable:!0,key:n,onInvoke:e.onColumnToggle(n)},r)})))}})),Object(v.createElement)(w.CardBody,{size:null},a?Object(v.createElement)(v.Fragment,null,Object(v.createElement)("span",{className:"screen-reader-text"},Object(O.__)("Your requested data is loading",'woocommerce')),Object(v.createElement)(Yl,{numberOfRows:u,headers:b,rowHeader:l,caption:p,query:s})):Object(v.createElement)(Wl,{rows:g,headers:b,rowHeader:l,caption:p,query:s,onSort:c||i("sort")})),Object(v.createElement)(w.CardFooter,{justify:"center"},Object(v.createElement)(ll,{key:parseInt(s.paged,10)||1,page:parseInt(s.paged,10)||1,perPage:u,total:h,onPageChange:this.onPageChange,onPerPageChange:i("per_page")}),f&&Object(v.createElement)(Ql,{data:f})))}}]),o}(v.Component);Jl.propTypes={hasSearch:S.a.bool,headers:S.a.arrayOf(S.a.shape({hiddenByDefault:S.a.bool,defaultSort:S.a.bool,isSortable:S.a.bool,key:S.a.string,label:S.a.oneOfType([S.a.string,S.a.node]),required:S.a.bool})),ids:S.a.arrayOf(S.a.number),isLoading:S.a.bool,onQueryChange:S.a.func,onColumnsChange:S.a.func,onSort:S.a.func,query:S.a.object,rowHeader:S.a.oneOfType([S.a.number,S.a.bool]),rows:S.a.arrayOf(S.a.arrayOf(S.a.shape({display:S.a.node,value:S.a.oneOfType([S.a.string,S.a.number,S.a.bool])}))).isRequired,rowsPerPage:S.a.number.isRequired,showMenu:S.a.bool,summary:S.a.arrayOf(S.a.shape({label:S.a.node,value:S.a.oneOfType([S.a.string,S.a.number])})),title:S.a.string.isRequired,totalRows:S.a.number.isRequired},Jl.defaultProps={isLoading:!1,onQueryChange:function(){return function(){}},onColumnsChange:function(){},onSort:void 0,query:{},rowHeader:0,rows:[],showMenu:!0};var Zl=function(e){var t=e.children,n=e.numberOfRows;return Object(v.createElement)("div",{className:"woocommerce-table is-empty",style:{"--number-of-rows":n}},t)};Zl.propTypes={numberOfRows:S.a.number},Zl.defaultProps={numberOfRows:5};var Xl=Object(w.withFocusOutside)(function(e){h()(o,e);var t,n,r=(t=o,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=g()(t);if(n){var o=g()(this).constructor;e=Reflect.construct(r,arguments,o)}else e=r.apply(this,arguments);return y()(this,e)});function o(e){var t;return s()(this,o),(t=r.call(this,e)).state={isFocused:!1},t}return u()(o,[{key:"handleFocusOutside",value:function(){this.setState({isFocused:!1})}},{key:"handleOnClick",value:function(e,t){this.setState({isFocused:!0}),"function"==typeof t&&t(e)}},{key:"render",value:function(){var e=this,t=this.state.isFocused,n=this.props,r=n.className,o=n.onClick,a=R()(n,["className","onClick"]),i=a.label,c=a.value,s=a.disabled,l=""===c,u=t&&!s;return Object(v.createElement)(w.TextControl,T()({className:q()("muriel-component","muriel-input-text",r,{disabled:s,empty:l,active:u,"with-value":!l}),placeholder:i,onClick:function(t){return e.handleOnClick(t,o)},onFocus:function(){return e.setState({isFocused:!0})}},a))}}]),o}(v.Component));Xl.propTypes={className:S.a.string,disabled:S.a.bool,label:S.a.string,onClick:S.a.func,value:S.a.string};var eu=Xl,tu=function(e){var t=e.item,n=e.className,r=e.clockFormat,o=q()("woocommerce-timeline-item",n),a=Object(gs.format)(r,t.date);return Object(v.createElement)("li",{className:o},Object(v.createElement)("div",{className:"woocommerce-timeline-item__top-border"}),Object(v.createElement)("div",{className:"woocommerce-timeline-item__title"},Object(v.createElement)("div",{className:"woocommerce-timeline-item__headline"},t.icon,Object(v.createElement)("span",null,t.headline)),Object(v.createElement)("span",{className:"woocommerce-timeline-item__timestamp"},t.hideTimestamp?null:a)),Object(v.createElement)("div",{className:"woocommerce-timeline-item__body"},(t.body||[]).map((function(e,t){return Object(v.createElement)("span",{key:"timeline-item-body-".concat(t)},e)}))))};tu.propTypes={className:S.a.string,item:S.a.shape({date:S.a.instanceOf(Date).isRequired,icon:S.a.element.isRequired,headline:S.a.oneOfType([S.a.element,S.a.string]).isRequired,body:S.a.arrayOf(S.a.oneOfType([S.a.element,S.a.string])),hideTimestamp:S.a.bool,clockFormat:S.a.string}).isRequired},tu.defaultProps={className:"",item:{}};var nu=tu,ru=function(e,t){return e.date.getTime()-t.date.getTime()},ou=function(e,t){return t.date.getTime()-e.date.getTime()},au=function(e){switch(e){case"asc":return ru;case"desc":default:return ou}},iu=function(e){var t=e.group,n=e.className,r=e.orderBy,o=e.clockFormat,a=q()("woocommerce-timeline-group",n);return Object(v.createElement)("li",{className:a},Object(v.createElement)("p",{className:"woocommerce-timeline-group__title"},t.title),Object(v.createElement)("ul",null,t.items.sort(au(r)).map((function(e,n){var r=t.title+"-"+n;return Object(v.createElement)(nu,{key:r,item:e,clockFormat:o})}))),Object(v.createElement)("hr",null))};iu.propTypes={className:S.a.string,group:S.a.shape({title:S.a.string,items:S.a.arrayOf(S.a.shape({date:S.a.instanceOf(Date).isRequired,icon:S.a.element.isRequired,headline:S.a.oneOfType([S.a.element,S.a.string]).isRequired,body:S.a.arrayOf(S.a.oneOfType([S.a.element,S.a.string])),hideTimestamp:S.a.bool})).isRequired}).isRequired,orderBy:S.a.oneOf(["asc","desc"]),clockFormat:S.a.string},iu.defaultProps={className:"",group:{title:"",items:[]},orderBy:"desc"};var cu=iu;function su(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function lu(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?su(Object(n),!0).forEach((function(t){o()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):su(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var uu=function(e){var t=e.className,n=e.items,r=e.groupBy,o=e.orderBy,a=e.dateFormat,c=e.clockFormat,s=q()("woocommerce-timeline",t);return n&&0!==n.length?Object(v.createElement)("div",{className:s},Object(v.createElement)("ul",null,n.reduce(function(e){return function(t,n){var r=t.findIndex((function(t){return function(t,n){return pt()(t.date).isSame(pt()(n.date),e)}(t,n)}));return r>=0?(t[r].items.push(n),t):[].concat(i()(t),[{date:n.date,items:[n]}])}}(r),[]).map((function(e){return lu(lu({},e),{},{title:Object(gs.format)(a,e.date)})})).sort(au(o)).map((function(e){return Object(v.createElement)(cu,{key:e.date.getTime().toString(),group:e,orderBy:o,clockFormat:c})})))):Object(v.createElement)("div",{className:s},Object(v.createElement)("p",{className:"timeline_no_events"},Object(O.__)("No data to display",'woocommerce')))};uu.propTypes={className:S.a.string,items:S.a.arrayOf(S.a.shape({date:S.a.instanceOf(Date).isRequired,icon:S.a.element.isRequired,headline:S.a.oneOfType([S.a.element,S.a.string]).isRequired,body:S.a.arrayOf(S.a.oneOfType([S.a.element,S.a.string])),hideTimestamp:S.a.bool})).isRequired,groupBy:S.a.oneOf(["day","week","month"]),orderBy:S.a.oneOf(["asc","desc"]),dateFormat:S.a.string,clockFormat:S.a.string},uu.defaultProps={className:"",items:[],groupBy:"day",orderBy:"desc",
/* translators: PHP date format string used to display dates, see php.net/date. */
dateFormat:Object(O.__)("F j, Y",'woocommerce'),
/* translators: PHP clock format string used to display times, see php.net/date. */
clockFormat:Object(O.__)("g:ia",'woocommerce')},n(55);var du=function(e){var t=e.items;return Object(v.createElement)(oe,{className:"woocommerce-view-more-list",label:Object(O.sprintf)(Object(O.__)("+%d more",'woocommerce'),t.length-1),popoverContents:Object(v.createElement)("ul",{className:"woocommerce-view-more-list__popover"},t.map((function(e,t){return Object(v.createElement)("li",{key:t,className:"woocommerce-view-more-list__popover__item"},e)})))})};du.propTypes={items:S.a.arrayOf(S.a.node)},du.defaultProps={items:[]};var fu=function(e){h()(o,e);var t,n,r=(t=o,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=g()(t);if(n){var o=g()(this).constructor;e=Reflect.construct(r,arguments,o)}else e=r.apply(this,arguments);return y()(this,e)});function o(e){var t;return s()(this,o),(t=r.call(this,e)).state={isLoading:!0},t.iframeRef=Object(v.createRef)(),t.setLoaded=t.setLoaded.bind(f()(t)),t}return u()(o,[{key:"componentDidMount",value:function(){this.iframeRef.current.addEventListener("load",this.setLoaded)}},{key:"setLoaded",value:function(){this.setState({isLoading:!1}),this.props.onLoad()}},{key:"render",value:function(){var e=this.props,t=e.className,n=e.loadingContent,r=e.src,o=e.title,a=this.state.isLoading,i=q()("woocommerce-web-preview",t,{"is-loading":a});return Object(v.createElement)("div",{className:i},a&&n,Object(v.createElement)("div",{className:"woocommerce-web-preview__iframe-wrapper"},Object(v.createElement)("iframe",{ref:this.iframeRef,title:o,src:r})))}}]),o}(v.Component);fu.propTypes={className:S.a.string,loadingContent:S.a.node,onLoad:S.a.func,src:S.a.string.isRequired,title:S.a.string.isRequired},fu.defaultProps={loadingContent:Object(v.createElement)(Fl,null),onLoad:_.noop}},,function(e,t,n){"use strict";function r(){return(r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}n.d(t,"a",(function(){return r}))},,,,,,,,,,function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(202);function o(e,t){if(null==e)return{};var n,o,a=Object(r.a)(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(o=0;o<i.length;o++)n=i[o],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}},,,,function(e,t,n){"use strict";n.d(t,"e",(function(){return w})),n.d(t,"b",(function(){return E})),n.d(t,"c",(function(){return C})),n.d(t,"d",(function(){return D})),n.d(t,"j",(function(){return P})),n.d(t,"h",(function(){return R})),n.d(t,"f",(function(){return I})),n.d(t,"g",(function(){return A})),n.d(t,"i",(function(){return N})),n.d(t,"k",(function(){return L})),n.d(t,"a",(function(){return U}));var r=n(172),o=n.n(r),a=(n(520),n(0),n(23)),i=n(181),c=n(7),s=n(55),l=n(4),u=n(51);function d(e){return"/"===e.charAt(0)}function f(e,t){for(var n=t,r=n+1,o=e.length;r<o;n+=1,r+=1)e[n]=e[r];e.pop()}function p(e,t,n,r){var o;"string"==typeof e?(o=function(e){var t=e||"/",n="",r="",o=t.indexOf("#");-1!==o&&(r=t.substr(o),t=t.substr(0,o));var a=t.indexOf("?");return-1!==a&&(n=t.substr(a),t=t.substr(0,a)),{pathname:t,search:"?"===n?"":n,hash:"#"===r?"":r}}(e)).state=t:(void 0===(o=Object(u.a)({},e)).pathname&&(o.pathname=""),o.search?"?"!==o.search.charAt(0)&&(o.search="?"+o.search):o.search="",o.hash?"#"!==o.hash.charAt(0)&&(o.hash="#"+o.hash):o.hash="",void 0!==t&&void 0===o.state&&(o.state=t));try{o.pathname=decodeURI(o.pathname)}catch(e){throw e instanceof URIError?new URIError('Pathname "'+o.pathname+'" could not be decoded. This is likely caused by an invalid percent-encoding.'):e}return n&&(o.key=n),r?o.pathname?"/"!==o.pathname.charAt(0)&&(o.pathname=function(e,t){void 0===t&&(t="");var n,r=e&&e.split("/")||[],o=t&&t.split("/")||[],a=e&&d(e),i=t&&d(t),c=a||i;if(e&&d(e)?o=r:r.length&&(o.pop(),o=o.concat(r)),!o.length)return"/";if(o.length){var s=o[o.length-1];n="."===s||".."===s||""===s}else n=!1;for(var l=0,u=o.length;u>=0;u--){var p=o[u];"."===p?f(o,u):".."===p?(f(o,u),l++):l&&(f(o,u),l--)}if(!c)for(;l--;l)o.unshift("..");!c||""===o[0]||o[0]&&d(o[0])||o.unshift("");var h=o.join("/");return n&&"/"!==h.substr(-1)&&(h+="/"),h}(o.pathname,r.pathname)):o.pathname=r.pathname:o.pathname||(o.pathname="/"),o}var h,m=!("undefined"==typeof window||!window.document||!window.document.createElement);function y(e,t){t(window.confirm(e))}function b(){try{return window.history.state||{}}catch(e){return{}}}function g(e){void 0===e&&(e={}),m||function(e,t){if(!e)throw new Error("Invariant failed")}(!1);var t,n,r=window.history,o=(-1===(t=window.navigator.userAgent).indexOf("Android 2.")&&-1===t.indexOf("Android 4.0")||-1===t.indexOf("Mobile Safari")||-1!==t.indexOf("Chrome")||-1!==t.indexOf("Windows Phone"))&&window.history&&"pushState"in window.history,a=!(-1===window.navigator.userAgent.indexOf("Trident")),i=e,c=i.forceRefresh,s=void 0!==c&&c,l=i.getUserConfirmation,d=void 0===l?y:l,f=i.keyLength,h=void 0===f?6:f,g=e.basename?function(e){return"/"===e.charAt(e.length-1)?e.slice(0,-1):e}("/"===(n=e.basename).charAt(0)?n:"/"+n):"";function v(e){var t=e||{},n=t.key,r=t.state,o=window.location,a=o.pathname+o.search+o.hash;return g&&(a=function(e,t){return function(e,t){return 0===e.toLowerCase().indexOf(t.toLowerCase())&&-1!=="/?#".indexOf(e.charAt(t.length))}(e,t)?e.substr(t.length):e}(a,g)),p(a,r,n)}function O(){return Math.random().toString(36).substr(2,h)}var w,_,k=(w=null,_=[],{setPrompt:function(e){return w=e,function(){w===e&&(w=null)}},confirmTransitionTo:function(e,t,n,r){if(null!=w){var o="function"==typeof w?w(e,t):w;"string"==typeof o?"function"==typeof n?n(o,r):r(!0):r(!1!==o)}else r(!0)},appendListener:function(e){var t=!0;function n(){t&&e.apply(void 0,arguments)}return _.push(n),function(){t=!1,_=_.filter((function(e){return e!==n}))}},notifyListeners:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];_.forEach((function(e){return e.apply(void 0,t)}))}});function S(e){Object(u.a)(A,e),A.length=r.length,k.notifyListeners(A.location,A.action)}function j(e){(function(e){return void 0===e.state&&-1===navigator.userAgent.indexOf("CriOS")})(e)||D(v(e.state))}function E(){D(v(b()))}var C=!1;function D(e){C?(C=!1,S()):k.confirmTransitionTo(e,"POP",d,(function(t){t?S({action:"POP",location:e}):function(e){var t=A.location,n=x.indexOf(t.key);-1===n&&(n=0);var r=x.indexOf(e.key);-1===r&&(r=0);var o=n-r;o&&(C=!0,T(o))}(e)}))}var P=v(b()),x=[P.key];function F(e){return g+function(e){var t=e.pathname,n=e.search,r=e.hash,o=t||"/";return n&&"?"!==n&&(o+="?"===n.charAt(0)?n:"?"+n),r&&"#"!==r&&(o+="#"===r.charAt(0)?r:"#"+r),o}(e)}function T(e){r.go(e)}var M=0;function R(e){1===(M+=e)&&1===e?(window.addEventListener("popstate",j),a&&window.addEventListener("hashchange",E)):0===M&&(window.removeEventListener("popstate",j),a&&window.removeEventListener("hashchange",E))}var I=!1,A={length:r.length,action:"POP",location:P,createHref:F,push:function(e,t){var n=p(e,t,O(),A.location);k.confirmTransitionTo(n,"PUSH",d,(function(e){if(e){var t=F(n),a=n.key,i=n.state;if(o)if(r.pushState({key:a,state:i},null,t),s)window.location.href=t;else{var c=x.indexOf(A.location.key),l=x.slice(0,c+1);l.push(n.key),x=l,S({action:"PUSH",location:n})}else window.location.href=t}}))},replace:function(e,t){var n=p(e,t,O(),A.location);k.confirmTransitionTo(n,"REPLACE",d,(function(e){if(e){var t=F(n),a=n.key,i=n.state;if(o)if(r.replaceState({key:a,state:i},null,t),s)window.location.replace(t);else{var c=x.indexOf(A.location.key);-1!==c&&(x[c]=n.key),S({action:"REPLACE",location:n})}else window.location.replace(t)}}))},go:T,goBack:function(){T(-1)},goForward:function(){T(1)},block:function(e){void 0===e&&(e=!1);var t=k.setPrompt(e);return I||(R(1),I=!0),function(){return I&&(I=!1,R(-1)),t()}},listen:function(e){var t=k.appendListener(e);return R(1),function(){R(-1),t()}}};return A}function v(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function O(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?v(Object(n),!0).forEach((function(t){o()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):v(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function w(){if(!h){var e=document.location.pathname,t=g({basename:e.substring(0,e.lastIndexOf("/"))});h={get length(){return t.length},get action(){return t.action},get location(){var e=t.location,n=Object(i.parse)(e.search.substring(1)).path||"/";return O(O({},e),{},{pathname:n})},createHref:function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return t.createHref.apply(t,n)},push:function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return t.push.apply(t,n)},replace:function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return t.replace.apply(t,n)},go:function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return t.go.apply(t,n)},goBack:function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return t.goBack.apply(t,n)},goForward:function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return t.goForward.apply(t,n)},block:function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return t.block.apply(t,n)},listen:function(e){var n=this;return t.listen((function(){e(n.location,n.action)}))}}}return h}var _=n(521),k=n.n(_);function S(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function j(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?S(Object(n),!0).forEach((function(t){o()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):S(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function E(e){var t=[];return e.forEach((function(e){if(e.subFilters){t.push(Object(c.omit)(e,"subFilters"));var n=E(e.subFilters);t.push.apply(t,k()(n))}else t.push(e)})),t}function C(e,t){return Object.keys(t).reduce((function(n,r){var o=t[r];if(o.rules){var a=o.rules.filter((function(t){return e.hasOwnProperty(x(r,t.value))}));if(a.length)if(o.allowMultiple)a.forEach((function(t){e[x(r,t.value)].forEach((function(e){n.push({key:r,rule:t.value,value:e})}))}));else{var i=e[x(r,a[0].value)];n.push({key:r,rule:a[0].value,value:i})}}else e[r]&&(o.allowMultiple?e[r].forEach((function(e){n.push({key:r,value:e})})):n.push({key:r,value:e[r]}));return n}),[])}function D(e,t){var n=e.input.defaultOption;if(e.input.defaultOption){var r=Object(c.find)(t,{value:n});return r?r.value:void console.warn("invalid defaultOption ".concat(n," supplied to ").concat(e.labels.add))}return Object(c.get)(t,[0,"value"])}function P(e,t,n){var r=C(t,n).reduce((function(e,t){return e[x(t.key,t.rule)]=void 0,e}),{}),o=e.reduce((function(e,t){if("between"===t.rule&&(!Array.isArray(t.value)||t.value.some((function(e){return!e}))))return e;if(t.value){var r=x(t.key,t.rule);n[t.key]&&n[t.key].allowMultiple?(e.hasOwnProperty(r)||(e[r]=[]),e[r].push(t.value)):e[r]=t.value}return e}),{});return j(j({},r),o)}function x(e,t){return t&&t.length?"".concat(e,"_").concat(t):e}function F(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function T(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?F(Object(n),!0).forEach((function(t){o()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):F(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}l.Navigation||l.__experimentalNavigation,l.NavigationBackButton||l.__experimentalNavigationBackButton,l.NavigationGroup||l.__experimentalNavigationGroup,l.NavigationMenu||l.__experimentalNavigationMenu,l.NavigationItem||l.__experimentalNavigationItem,l.Text||l.__experimentalText,l.useSlot||l.__experimentalUseSlot;var M=function(){return w().location.pathname},R=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:N(),t=Object(s.applyFilters)("woocommerce_admin_persisted_queries",["period","compare","before","after","interval","type"]);return Object(c.pick)(e,t)};function I(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return Object(c.uniq)(e.split(",").map((function(e){return parseInt(e,10)})).filter(Boolean))}function A(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:M(),n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:N(),r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"wc-admin",o=T(T({page:r},n),e);return"/"!==t&&(o.path=t),Object(a.addQueryArgs)("admin.php",o)}function N(){var e=w().location.search;return e.length&&Object(i.parse)(e.substring(1))||{}}function L(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:M(),n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:N(),r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"wc-admin",o=A(e,t,n,r);w().push(o)}var U=function(e){var t,n,r;return window.wcNavigation&&!window.wcNavigation.historyPatched&&(t=window.history,n=t.pushState,r=t.replaceState,t.pushState=function(e){var r=new CustomEvent("pushstate",{state:e});return window.dispatchEvent(r),n.apply(t,arguments)},t.replaceState=function(e){var n=new CustomEvent("replacestate",{state:e});return window.dispatchEvent(n),r.apply(t,arguments)},window.wcNavigation.historyPatched=!0),window.addEventListener("popstate",e),window.addEventListener("pushstate",e),window.addEventListener("replacestate",e),function(){window.removeEventListener("popstate",e),window.removeEventListener("pushstate",e),window.removeEventListener("replacestate",e)}}},,,,function(e,t,n){"use strict";n.d(t,"f",(function(){return s})),n.d(t,"h",(function(){return l})),n.d(t,"g",(function(){return u})),n.d(t,"a",(function(){return d})),n.d(t,"i",(function(){return f})),n.d(t,"d",(function(){return g})),n.d(t,"c",(function(){return O})),n.d(t,"e",(function(){return w})),n.d(t,"b",(function(){return _})),n.d(t,"j",(function(){return k}));var r=n(31),o=n.n(r),a=n(7),i=n(1),c=n(181),s="YYYY-MM-DD",l=[{value:"today",label:Object(i.__)("Today",'woocommerce')},{value:"yesterday",label:Object(i.__)("Yesterday",'woocommerce')},{value:"week",label:Object(i.__)("Week to Date",'woocommerce')},{value:"last_week",label:Object(i.__)("Last Week",'woocommerce')},{value:"month",label:Object(i.__)("Month to Date",'woocommerce')},{value:"last_month",label:Object(i.__)("Last Month",'woocommerce')},{value:"quarter",label:Object(i.__)("Quarter to Date",'woocommerce')},{value:"last_quarter",label:Object(i.__)("Last Quarter",'woocommerce')},{value:"year",label:Object(i.__)("Year to Date",'woocommerce')},{value:"last_year",label:Object(i.__)("Last Year",'woocommerce')},{value:"custom",label:Object(i.__)("Custom",'woocommerce')}],u=[{value:"previous_period",label:Object(i.__)("Previous Period",'woocommerce')},{value:"previous_year",label:Object(i.__)("Previous Year",'woocommerce')}],d=function(e,t){if(e=e.format(s),"start"===t)return e+"T00:00:00";if("now"===t)return e+"T"+o()().format("HH:mm:00");if("end"===t)return e+"T23:59:59";throw new Error("appendTimestamp requires second parameter to be either `start`, `now` or `end`")};function f(e,t){if(o.a.isMoment(t))return t.isValid()?t:null;if("string"==typeof t){var n=o()(t,[s,e],!0);return n.isValid()?n:null}throw new Error("toMoment requires a string to be passed as an argument")}function p(e,t){var n=e.year()===t.year(),r=n&&e.month()===t.month(),o=n&&r&&e.isSame(t,"day"),a=Object(i.__)("MMM D, YYYY",'woocommerce');if(o)return e.format(a);if(r){var c=e.date();return e.format(a).replace(c,"".concat(c," - ").concat(t.date()))}if(n){var s=Object(i.__)("MMM D",'woocommerce');return"".concat(e.format(s)," - ").concat(t.format(a))}return"".concat(e.format(a)," - ").concat(t.format(a))}function h(e,t){var n,r,a=o()().startOf(e).subtract(1,e),i=a.clone().endOf(e);if("previous_period"===t)if("year"===e)r=(n=o()().startOf(e).subtract(2,e)).clone().endOf(e);else{var c=i.diff(a,"days");n=(r=a.clone().subtract(1,"days")).clone().subtract(c,"days")}else n=a.clone().subtract(1,"years"),r=i.clone().subtract(1,"years");return"month"===e&&(r=r.clone().endOf("month")),{primaryStart:a,primaryEnd:i,secondaryStart:n,secondaryEnd:r}}function m(e,t){var n,r,a=o()().startOf(e),i=o()(),c=i.diff(a,"days");return"previous_period"===t?(n=a.clone().subtract(1,e),r=i.clone().subtract(1,e)):r=(n=a.clone().subtract(1,"years")).clone().add(c+1,"days").subtract(1,"seconds"),{primaryStart:a,primaryEnd:i,secondaryStart:n,secondaryEnd:r}}var y=Object(a.memoize)((function(e,t,n,r){switch(e){case"today":return m("day",t);case"yesterday":return h("day",t);case"week":return m("week",t);case"last_week":return h("week",t);case"month":return m("month",t);case"last_month":return h("month",t);case"quarter":return m("quarter",t);case"last_quarter":return h("quarter",t);case"year":return m("year",t);case"last_year":return h("year",t);case"custom":var o=r.diff(n,"days");if("previous_period"===t){var a=n.clone().subtract(1,"days");return{primaryStart:n,primaryEnd:r,secondaryStart:a.clone().subtract(o,"days"),secondaryEnd:a}}return{primaryStart:n,primaryEnd:r,secondaryStart:n.clone().subtract(1,"years"),secondaryEnd:r.clone().subtract(1,"years")}}}),(function(e,t,n,r){return[e,t,n&&n.format(),r&&r.format()].join(":")})),b=Object(a.memoize)((function(e,t,n,r,a){if(e&&t)return{period:e,compare:t,after:n?o()(n):null,before:r?o()(r):null};var i=Object(c.parse)(a.replace(/&amp;/g,"&"));return{period:i.period,compare:i.compare,after:i.after?o()(i.after):null,before:i.before?o()(i.before):null}}),(function(e,t,n,r,o){return[e,t,n,r,o].join(":")})),g=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"period=month&compare=previous_year",n=e.period,r=e.compare,o=e.after,a=e.before;return b(n,r,o,a,t)},v=Object(a.memoize)((function(e,t,n,r,o,i){return{primary:{label:Object(a.find)(l,(function(t){return t.value===e})).label,range:p(n,r),after:n,before:r},secondary:{label:Object(a.find)(u,(function(e){return e.value===t})).label,range:p(o,i),after:o,before:i}}}),(function(e,t,n,r,o,a){return[e,t,n&&n.format(),r&&r.format(),o&&o.format(),a&&a.format()].join(":")})),O=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"period=month&compare=previous_year",n=g(e,t),r=n.period,o=n.compare,a=n.after,i=n.before,c=y(r,o,a,i),s=c.primaryStart,l=c.primaryEnd,u=c.secondaryStart,d=c.secondaryEnd;return v(r,o,s,l,u,d)};function w(e){var t=function(e){var t,n,r,a,i=[];if("custom"===e.period){var c=O(e).primary,s=(t=c.before,n=c.after,r=o()(t),a=o()(n),r.diff(a,"days"));i=s>=365?["day","week","month","quarter","year"]:s>=90?["day","week","month","quarter"]:s>=28?["day","week","month"]:s>=7?["day","week"]:s>1&&s<7?["day"]:["hour","day"]}else switch(e.period){case"today":case"yesterday":i=["hour","day"];break;case"week":case"last_week":i=["day"];break;case"month":case"last_month":i=["day","week"];break;case"quarter":case"last_quarter":i=["day","week","month"];break;case"year":case"last_year":i=["day","week","month","quarter"];break;default:i=["day"]}return i}(e),n=t[0],r=e.interval||n;return e.interval&&!t.includes(e.interval)&&(r=n),r}var _={invalid:Object(i.__)("Invalid date",'woocommerce'),future:Object(i.__)("Select a date in the past",'woocommerce'),startAfterEnd:Object(i.__)("Start date must be before end date",'woocommerce'),endBeforeStart:Object(i.__)("Start date must be before end date",'woocommerce')};function k(e,t,n,r,a){var i=f(a,t);return i?o()().isBefore(i,"day")?{date:null,error:_.future}:"after"===e&&n&&i.isAfter(n,"day")?{date:null,error:_.startAfterEnd}:"before"===e&&r&&i.isBefore(r,"day")?{date:null,error:_.endBeforeStart}:{date:i}:{date:null,error:_.invalid}}},function(e,t,n){"use strict";function r(e){return(r=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o=c(n(11)),a=c(n(639)),i=c(n(642));function c(e){return e&&e.__esModule?e:{default:e}}var s=void 0;t.default=function(e){var t=e.mixedString,n=e.components,c=e.throwErrors;if(s=t,!n)return t;if("object"!==(void 0===n?"undefined":r(n))){if(c)throw new Error("Interpolation Error: unable to process `"+t+"` because components is not an object");return t}var l=(0,i.default)(t);try{return function e(t,n){var i,c,l,u,d,f,p,h,m=[],y={};for(f=0;f<t.length;f++)if("string"!==(d=t[f]).type){if(!n.hasOwnProperty(d.value)||void 0===n[d.value])throw new Error("Invalid interpolation, missing component node: `"+d.value+"`");if("object"!==r(n[d.value]))throw new Error("Invalid interpolation, component node must be a ReactElement or null: `"+d.value+"`","\n> "+s);if("componentClose"===d.type)throw new Error("Missing opening component token: `"+d.value+"`");if("componentOpen"===d.type){i=n[d.value],l=f;break}m.push(n[d.value])}else m.push(d.value);return i&&(u=function(e,t){var n,r,o=t[e],a=0;for(r=e+1;r<t.length;r++)if((n=t[r]).value===o.value){if("componentOpen"===n.type){a++;continue}if("componentClose"===n.type){if(0===a)return r;a--}}throw new Error("Missing closing component token `"+o.value+"`")}(l,t),p=e(t.slice(l+1,u),n),c=o.default.cloneElement(i,{},p),m.push(c),u<t.length-1&&(h=e(t.slice(u+1),n),m=m.concat(h))),1===m.length?m[0]:(m.forEach((function(e,t){e&&(y["interpolation-child-"+t]=e)})),(0,a.default)(y))}(l,n)}catch(e){if(c)throw new Error("Interpolation Error: unable to process `"+t+"` because of error `"+e.message+"`");return t}}},,,,,function(e,t,n){"use strict";n.d(t,"b",(function(){return c})),n.d(t,"a",(function(){return s}));var r=n(7),o=n(531),a=n.n(o),i=n(317);function c(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=a()(e).toRgb(),r=n.r,o=n.g,i=n.b;return"rgba(".concat(r,", ").concat(o,", ").concat(i,", ").concat(t,")")}function s(e){return Object(r.get)(i.a,e,"#000")}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DISPLAY_FORMAT="L",t.ISO_FORMAT="YYYY-MM-DD",t.ISO_MONTH_FORMAT="YYYY-MM",t.START_DATE="startDate",t.END_DATE="endDate",t.HORIZONTAL_ORIENTATION="horizontal",t.VERTICAL_ORIENTATION="vertical",t.VERTICAL_SCROLLABLE="verticalScrollable",t.ICON_BEFORE_POSITION="before",t.ICON_AFTER_POSITION="after",t.INFO_POSITION_TOP="top",t.INFO_POSITION_BOTTOM="bottom",t.INFO_POSITION_BEFORE="before",t.INFO_POSITION_AFTER="after",t.ANCHOR_LEFT="left",t.ANCHOR_RIGHT="right",t.OPEN_DOWN="down",t.OPEN_UP="up",t.DAY_SIZE=39,t.BLOCKED_MODIFIER="blocked",t.WEEKDAYS=[0,1,2,3,4,5,6],t.FANG_WIDTH_PX=20,t.FANG_HEIGHT_PX=10,t.DEFAULT_VERTICAL_SPACING=22,t.MODIFIER_KEY_NAMES=new Set(["Shift","Control","Alt","Meta"])},,function(e,t,n){"use strict";function r(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";n.d(t,"a",(function(){return f})),n.d(t,"c",(function(){return p})),n.d(t,"b",(function(){return h}));n(203);var r=n(11),o=function(){function e(e){this.isSpeedy=void 0===e.speedy||e.speedy,this.tags=[],this.ctr=0,this.nonce=e.nonce,this.key=e.key,this.container=e.container,this.before=null}var t=e.prototype;return t.insert=function(e){if(this.ctr%(this.isSpeedy?65e3:1)==0){var t,n=function(e){var t=document.createElement("style");return t.setAttribute("data-emotion",e.key),void 0!==e.nonce&&t.setAttribute("nonce",e.nonce),t.appendChild(document.createTextNode("")),t}(this);t=0===this.tags.length?this.before:this.tags[this.tags.length-1].nextSibling,this.container.insertBefore(n,t),this.tags.push(n)}var r=this.tags[this.tags.length-1];if(this.isSpeedy){var o=function(e){if(e.sheet)return e.sheet;for(var t=0;t<document.styleSheets.length;t++)if(document.styleSheets[t].ownerNode===e)return document.styleSheets[t]}(r);try{var a=105===e.charCodeAt(1)&&64===e.charCodeAt(0);o.insertRule(e,a?0:o.cssRules.length)}catch(e){}}else r.appendChild(document.createTextNode(e));this.ctr++},t.flush=function(){this.tags.forEach((function(e){return e.parentNode.removeChild(e)})),this.tags=[],this.ctr=0},e}(),a=function(e){function t(e,t,r){var o=t.trim().split(h);t=o;var a=o.length,i=e.length;switch(i){case 0:case 1:var c=0;for(e=0===i?"":e[0]+" ";c<a;++c)t[c]=n(e,t[c],r).trim();break;default:var s=c=0;for(t=[];c<a;++c)for(var l=0;l<i;++l)t[s++]=n(e[l]+" ",o[c],r).trim()}return t}function n(e,t,n){var r=t.charCodeAt(0);switch(33>r&&(r=(t=t.trim()).charCodeAt(0)),r){case 38:return t.replace(m,"$1"+e.trim());case 58:return e.trim()+t.replace(m,"$1"+e.trim());default:if(0<1*n&&0<t.indexOf("\f"))return t.replace(m,(58===e.charCodeAt(0)?"":"$1")+e.trim())}return e+t}function r(e,t,n,a){var i=e+";",c=2*t+3*n+4*a;if(944===c){e=i.indexOf(":",9)+1;var s=i.substring(e,i.length-1).trim();return s=i.substring(0,e).trim()+s+";",1===P||2===P&&o(s,1)?"-webkit-"+s+s:s}if(0===P||2===P&&!o(i,1))return i;switch(c){case 1015:return 97===i.charCodeAt(10)?"-webkit-"+i+i:i;case 951:return 116===i.charCodeAt(3)?"-webkit-"+i+i:i;case 963:return 110===i.charCodeAt(5)?"-webkit-"+i+i:i;case 1009:if(100!==i.charCodeAt(4))break;case 969:case 942:return"-webkit-"+i+i;case 978:return"-webkit-"+i+"-moz-"+i+i;case 1019:case 983:return"-webkit-"+i+"-moz-"+i+"-ms-"+i+i;case 883:if(45===i.charCodeAt(8))return"-webkit-"+i+i;if(0<i.indexOf("image-set(",11))return i.replace(j,"$1-webkit-$2")+i;break;case 932:if(45===i.charCodeAt(4))switch(i.charCodeAt(5)){case 103:return"-webkit-box-"+i.replace("-grow","")+"-webkit-"+i+"-ms-"+i.replace("grow","positive")+i;case 115:return"-webkit-"+i+"-ms-"+i.replace("shrink","negative")+i;case 98:return"-webkit-"+i+"-ms-"+i.replace("basis","preferred-size")+i}return"-webkit-"+i+"-ms-"+i+i;case 964:return"-webkit-"+i+"-ms-flex-"+i+i;case 1023:if(99!==i.charCodeAt(8))break;return"-webkit-box-pack"+(s=i.substring(i.indexOf(":",15)).replace("flex-","").replace("space-between","justify"))+"-webkit-"+i+"-ms-flex-pack"+s+i;case 1005:return f.test(i)?i.replace(d,":-webkit-")+i.replace(d,":-moz-")+i:i;case 1e3:switch(t=(s=i.substring(13).trim()).indexOf("-")+1,s.charCodeAt(0)+s.charCodeAt(t)){case 226:s=i.replace(v,"tb");break;case 232:s=i.replace(v,"tb-rl");break;case 220:s=i.replace(v,"lr");break;default:return i}return"-webkit-"+i+"-ms-"+s+i;case 1017:if(-1===i.indexOf("sticky",9))break;case 975:switch(t=(i=e).length-10,c=(s=(33===i.charCodeAt(t)?i.substring(0,t):i).substring(e.indexOf(":",7)+1).trim()).charCodeAt(0)+(0|s.charCodeAt(7))){case 203:if(111>s.charCodeAt(8))break;case 115:i=i.replace(s,"-webkit-"+s)+";"+i;break;case 207:case 102:i=i.replace(s,"-webkit-"+(102<c?"inline-":"")+"box")+";"+i.replace(s,"-webkit-"+s)+";"+i.replace(s,"-ms-"+s+"box")+";"+i}return i+";";case 938:if(45===i.charCodeAt(5))switch(i.charCodeAt(6)){case 105:return s=i.replace("-items",""),"-webkit-"+i+"-webkit-box-"+s+"-ms-flex-"+s+i;case 115:return"-webkit-"+i+"-ms-flex-item-"+i.replace(_,"")+i;default:return"-webkit-"+i+"-ms-flex-line-pack"+i.replace("align-content","").replace(_,"")+i}break;case 973:case 989:if(45!==i.charCodeAt(3)||122===i.charCodeAt(4))break;case 931:case 953:if(!0===S.test(e))return 115===(s=e.substring(e.indexOf(":")+1)).charCodeAt(0)?r(e.replace("stretch","fill-available"),t,n,a).replace(":fill-available",":stretch"):i.replace(s,"-webkit-"+s)+i.replace(s,"-moz-"+s.replace("fill-",""))+i;break;case 962:if(i="-webkit-"+i+(102===i.charCodeAt(5)?"-ms-"+i:"")+i,211===n+a&&105===i.charCodeAt(13)&&0<i.indexOf("transform",10))return i.substring(0,i.indexOf(";",27)+1).replace(p,"$1-webkit-$2")+i}return i}function o(e,t){var n=e.indexOf(1===t?":":"{"),r=e.substring(0,3!==t?n:10);return n=e.substring(n+1,e.length-1),M(2!==t?r:r.replace(k,"$1"),n,t)}function a(e,t){var n=r(t,t.charCodeAt(0),t.charCodeAt(1),t.charCodeAt(2));return n!==t+";"?n.replace(w," or ($1)").substring(4):"("+t+")"}function i(e,t,n,r,o,a,i,c,l,u){for(var d,f=0,p=t;f<T;++f)switch(d=F[f].call(s,e,p,n,r,o,a,i,c,l,u)){case void 0:case!1:case!0:case null:break;default:p=d}if(p!==t)return p}function c(e){return void 0!==(e=e.prefix)&&(M=null,e?"function"!=typeof e?P=1:(P=2,M=e):P=0),c}function s(e,n){var c=e;if(33>c.charCodeAt(0)&&(c=c.trim()),c=[c],0<T){var s=i(-1,n,c,c,C,E,0,0,0,0);void 0!==s&&"string"==typeof s&&(n=s)}var d=function e(n,c,s,d,f){for(var p,h,m,v,w,_=0,k=0,S=0,j=0,F=0,M=0,I=m=p=0,A=0,N=0,L=0,U=0,B=s.length,H=B-1,q="",z="",V="",K="";A<B;){if(h=s.charCodeAt(A),A===H&&0!==k+j+S+_&&(0!==k&&(h=47===k?10:47),j=S=_=0,B++,H++),0===k+j+S+_){if(A===H&&(0<N&&(q=q.replace(u,"")),0<q.trim().length)){switch(h){case 32:case 9:case 59:case 13:case 10:break;default:q+=s.charAt(A)}h=59}switch(h){case 123:for(p=(q=q.trim()).charCodeAt(0),m=1,U=++A;A<B;){switch(h=s.charCodeAt(A)){case 123:m++;break;case 125:m--;break;case 47:switch(h=s.charCodeAt(A+1)){case 42:case 47:e:{for(I=A+1;I<H;++I)switch(s.charCodeAt(I)){case 47:if(42===h&&42===s.charCodeAt(I-1)&&A+2!==I){A=I+1;break e}break;case 10:if(47===h){A=I+1;break e}}A=I}}break;case 91:h++;case 40:h++;case 34:case 39:for(;A++<H&&s.charCodeAt(A)!==h;);}if(0===m)break;A++}switch(m=s.substring(U,A),0===p&&(p=(q=q.replace(l,"").trim()).charCodeAt(0)),p){case 64:switch(0<N&&(q=q.replace(u,"")),h=q.charCodeAt(1)){case 100:case 109:case 115:case 45:N=c;break;default:N=x}if(U=(m=e(c,N,m,h,f+1)).length,0<T&&(w=i(3,m,N=t(x,q,L),c,C,E,U,h,f,d),q=N.join(""),void 0!==w&&0===(U=(m=w.trim()).length)&&(h=0,m="")),0<U)switch(h){case 115:q=q.replace(O,a);case 100:case 109:case 45:m=q+"{"+m+"}";break;case 107:m=(q=q.replace(y,"$1 $2"))+"{"+m+"}",m=1===P||2===P&&o("@"+m,3)?"@-webkit-"+m+"@"+m:"@"+m;break;default:m=q+m,112===d&&(z+=m,m="")}else m="";break;default:m=e(c,t(c,q,L),m,d,f+1)}V+=m,m=L=N=I=p=0,q="",h=s.charCodeAt(++A);break;case 125:case 59:if(1<(U=(q=(0<N?q.replace(u,""):q).trim()).length))switch(0===I&&(p=q.charCodeAt(0),45===p||96<p&&123>p)&&(U=(q=q.replace(" ",":")).length),0<T&&void 0!==(w=i(1,q,c,n,C,E,z.length,d,f,d))&&0===(U=(q=w.trim()).length)&&(q="\0\0"),p=q.charCodeAt(0),h=q.charCodeAt(1),p){case 0:break;case 64:if(105===h||99===h){K+=q+s.charAt(A);break}default:58!==q.charCodeAt(U-1)&&(z+=r(q,p,h,q.charCodeAt(2)))}L=N=I=p=0,q="",h=s.charCodeAt(++A)}}switch(h){case 13:case 10:47===k?k=0:0===1+p&&107!==d&&0<q.length&&(N=1,q+="\0"),0<T*R&&i(0,q,c,n,C,E,z.length,d,f,d),E=1,C++;break;case 59:case 125:if(0===k+j+S+_){E++;break}default:switch(E++,v=s.charAt(A),h){case 9:case 32:if(0===j+_+k)switch(F){case 44:case 58:case 9:case 32:v="";break;default:32!==h&&(v=" ")}break;case 0:v="\\0";break;case 12:v="\\f";break;case 11:v="\\v";break;case 38:0===j+k+_&&(N=L=1,v="\f"+v);break;case 108:if(0===j+k+_+D&&0<I)switch(A-I){case 2:112===F&&58===s.charCodeAt(A-3)&&(D=F);case 8:111===M&&(D=M)}break;case 58:0===j+k+_&&(I=A);break;case 44:0===k+S+j+_&&(N=1,v+="\r");break;case 34:case 39:0===k&&(j=j===h?0:0===j?h:j);break;case 91:0===j+k+S&&_++;break;case 93:0===j+k+S&&_--;break;case 41:0===j+k+_&&S--;break;case 40:if(0===j+k+_){if(0===p)switch(2*F+3*M){case 533:break;default:p=1}S++}break;case 64:0===k+S+j+_+I+m&&(m=1);break;case 42:case 47:if(!(0<j+_+S))switch(k){case 0:switch(2*h+3*s.charCodeAt(A+1)){case 235:k=47;break;case 220:U=A,k=42}break;case 42:47===h&&42===F&&U+2!==A&&(33===s.charCodeAt(U+2)&&(z+=s.substring(U,A+1)),v="",k=0)}}0===k&&(q+=v)}M=F,F=h,A++}if(0<(U=z.length)){if(N=c,0<T&&void 0!==(w=i(2,z,N,n,C,E,U,d,f,d))&&0===(z=w).length)return K+z+V;if(z=N.join(",")+"{"+z+"}",0!=P*D){switch(2!==P||o(z,2)||(D=0),D){case 111:z=z.replace(g,":-moz-$1")+z;break;case 112:z=z.replace(b,"::-webkit-input-$1")+z.replace(b,"::-moz-$1")+z.replace(b,":-ms-input-$1")+z}D=0}}return K+z+V}(x,c,n,0,0);return 0<T&&void 0!==(s=i(-2,d,c,c,C,E,d.length,0,0,0))&&(d=s),D=0,E=C=1,d}var l=/^\0+/g,u=/[\0\r\f]/g,d=/: */g,f=/zoo|gra/,p=/([,: ])(transform)/g,h=/,\r+?/g,m=/([\t\r\n ])*\f?&/g,y=/@(k\w+)\s*(\S*)\s*/,b=/::(place)/g,g=/:(read-only)/g,v=/[svh]\w+-[tblr]{2}/,O=/\(\s*(.*)\s*\)/g,w=/([\s\S]*?);/g,_=/-self|flex-/g,k=/[^]*?(:[rp][el]a[\w-]+)[^]*/,S=/stretch|:\s*\w+\-(?:conte|avail)/,j=/([^-])(image-set\()/,E=1,C=1,D=0,P=1,x=[],F=[],T=0,M=null,R=0;return s.use=function e(t){switch(t){case void 0:case null:T=F.length=0;break;default:if("function"==typeof t)F[T++]=t;else if("object"==typeof t)for(var n=0,r=t.length;n<r;++n)e(t[n]);else R=0|!!t}return e},s.set=c,void 0!==e&&c(e),s};function i(e){e&&c.current.insert(e+"}")}var c={current:null},s=function(e,t,n,r,o,a,s,l,u,d){switch(e){case 1:switch(t.charCodeAt(0)){case 64:return c.current.insert(t+";"),"";case 108:if(98===t.charCodeAt(2))return""}break;case 2:if(0===l)return t+"/*|*/";break;case 3:switch(l){case 102:case 112:return c.current.insert(n[0]+t),"";default:return t+(0===d?"/*|*/":"")}case-2:t.split("/*|*/}").forEach(i)}},l=(n(491),n(173)),u=n(171),d=(Object.prototype.hasOwnProperty,Object(r.createContext)("undefined"!=typeof HTMLElement?function(e){void 0===e&&(e={});var t,n=e.key||"css";void 0!==e.prefix&&(t={prefix:e.prefix});var r,i=new a(t),l={};r=e.container||document.head;var u,d=document.querySelectorAll("style[data-emotion-"+n+"]");Array.prototype.forEach.call(d,(function(e){e.getAttribute("data-emotion-"+n).split(" ").forEach((function(e){l[e]=!0})),e.parentNode!==r&&r.appendChild(e)})),i.use(e.stylisPlugins)(s),u=function(e,t,n,r){var o=t.name;c.current=n,i(e,t.styles),r&&(f.inserted[o]=!0)};var f={key:n,sheet:new o({key:n,container:r,nonce:e.nonce,speedy:e.speedy}),nonce:e.nonce,inserted:l,registered:{},insert:u};return f}():null)),f=Object(r.createContext)({}),p=(d.Provider,function(e){var t=function(t,n){return Object(r.createElement)(d.Consumer,null,(function(r){return e(t,r,n)}))};return Object(r.forwardRef)(t)}),h=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return Object(u.a)(t)},m=(r.Component,function e(t){for(var n=t.length,r=0,o="";r<n;r++){var a=t[r];if(null!=a){var i=void 0;switch(typeof a){case"boolean":break;case"object":if(Array.isArray(a))i=e(a);else for(var c in i="",a)a[c]&&c&&(i&&(i+=" "),i+=c);break;default:i=a}i&&(o&&(o+=" "),o+=i)}}return o});function y(e,t,n){var r=[],o=Object(l.a)(e,r,n);return r.length<2?n:o+t(r)}p((function(e,t){return Object(r.createElement)(f.Consumer,null,(function(n){var r=function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];var o=Object(u.a)(n,t.registered);return Object(l.b)(t,o,!1),t.key+"-"+o.name},o={css:r,cx:function(){for(var e=arguments.length,n=new Array(e),o=0;o<e;o++)n[o]=arguments[o];return y(t.registered,r,m(n))},theme:n};return e.children(o)}))}))},function(e,t,n){"use strict";var r=SyntaxError,o=Function,a=TypeError,i=function(e){try{return o('"use strict"; return ('+e+").constructor;")()}catch(e){}},c=Object.getOwnPropertyDescriptor;if(c)try{c({},"")}catch(e){c=null}var s=function(){throw new a},l=c?function(){try{return s}catch(e){try{return c(arguments,"callee").get}catch(e){return s}}}():s,u=n(392)(),d=Object.getPrototypeOf||function(e){return e.__proto__},f={},p="undefined"==typeof Uint8Array?void 0:d(Uint8Array),h={"%AggregateError%":"undefined"==typeof AggregateError?void 0:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?void 0:ArrayBuffer,"%ArrayIteratorPrototype%":u?d([][Symbol.iterator]()):void 0,"%AsyncFromSyncIteratorPrototype%":void 0,"%AsyncFunction%":f,"%AsyncGenerator%":f,"%AsyncGeneratorFunction%":f,"%AsyncIteratorPrototype%":f,"%Atomics%":"undefined"==typeof Atomics?void 0:Atomics,"%BigInt%":"undefined"==typeof BigInt?void 0:BigInt,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?void 0:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":"undefined"==typeof Float32Array?void 0:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?void 0:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?void 0:FinalizationRegistry,"%Function%":o,"%GeneratorFunction%":f,"%Int8Array%":"undefined"==typeof Int8Array?void 0:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?void 0:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?void 0:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":u?d(d([][Symbol.iterator]())):void 0,"%JSON%":"object"==typeof JSON?JSON:void 0,"%Map%":"undefined"==typeof Map?void 0:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&u?d((new Map)[Symbol.iterator]()):void 0,"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?void 0:Promise,"%Proxy%":"undefined"==typeof Proxy?void 0:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":"undefined"==typeof Reflect?void 0:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?void 0:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&u?d((new Set)[Symbol.iterator]()):void 0,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?void 0:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":u?d(""[Symbol.iterator]()):void 0,"%Symbol%":u?Symbol:void 0,"%SyntaxError%":r,"%ThrowTypeError%":l,"%TypedArray%":p,"%TypeError%":a,"%Uint8Array%":"undefined"==typeof Uint8Array?void 0:Uint8Array,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?void 0:Uint8ClampedArray,"%Uint16Array%":"undefined"==typeof Uint16Array?void 0:Uint16Array,"%Uint32Array%":"undefined"==typeof Uint32Array?void 0:Uint32Array,"%URIError%":URIError,"%WeakMap%":"undefined"==typeof WeakMap?void 0:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?void 0:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?void 0:WeakSet},m={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},y=n(328),b=n(211),g=y.call(Function.call,Array.prototype.concat),v=y.call(Function.apply,Array.prototype.splice),O=y.call(Function.call,String.prototype.replace),w=y.call(Function.call,String.prototype.slice),_=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,k=/\\(\\)?/g,S=function(e){var t=w(e,0,1),n=w(e,-1);if("%"===t&&"%"!==n)throw new r("invalid intrinsic syntax, expected closing `%`");if("%"===n&&"%"!==t)throw new r("invalid intrinsic syntax, expected opening `%`");var o=[];return O(e,_,(function(e,t,n,r){o[o.length]=n?O(r,k,"$1"):t||e})),o},j=function(e,t){var n,o=e;if(b(m,o)&&(o="%"+(n=m[o])[0]+"%"),b(h,o)){var c=h[o];if(c===f&&(c=function e(t){var n;if("%AsyncFunction%"===t)n=i("async function () {}");else if("%GeneratorFunction%"===t)n=i("function* () {}");else if("%AsyncGeneratorFunction%"===t)n=i("async function* () {}");else if("%AsyncGenerator%"===t){var r=e("%AsyncGeneratorFunction%");r&&(n=r.prototype)}else if("%AsyncIteratorPrototype%"===t){var o=e("%AsyncGenerator%");o&&(n=d(o.prototype))}return h[t]=n,n}(o)),void 0===c&&!t)throw new a("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:n,name:o,value:c}}throw new r("intrinsic "+e+" does not exist!")};e.exports=function(e,t){if("string"!=typeof e||0===e.length)throw new a("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof t)throw new a('"allowMissing" argument must be a boolean');var n=S(e),o=n.length>0?n[0]:"",i=j("%"+o+"%",t),s=i.name,l=i.value,u=!1,d=i.alias;d&&(o=d[0],v(n,g([0,1],d)));for(var f=1,p=!0;f<n.length;f+=1){var m=n[f],y=w(m,0,1),O=w(m,-1);if(('"'===y||"'"===y||"`"===y||'"'===O||"'"===O||"`"===O)&&y!==O)throw new r("property names with quotes must have matching quotes");if("constructor"!==m&&p||(u=!0),b(h,s="%"+(o+="."+m)+"%"))l=h[s];else if(null!=l){if(!(m in l)){if(!t)throw new a("base intrinsic for "+e+" exists, but the property is not available.");return}if(c&&f+1>=n.length){var _=c(l,m);l=(p=!!_)&&"get"in _&&!("originalValue"in _.get)?_.get:l[m]}else p=b(l,m),l=l[m];p&&!u&&(h[s]=l)}}return l}},function(e,t,n){"use strict";function r(e,t){return`${e}:${JSON.stringify(t,Object.keys(t).sort())}`}function o(e){const t=e.indexOf(":");return t<0?e:e.substring(0,t)}n.d(t,"a",(function(){return r})),n.d(t,"b",(function(){return o}))},,,,,,,,,,,,function(e,t,n){"use strict";function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";var r=n(5),o=n.n(r),a=n(11),i=n(316),c=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|download|draggable|encType|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|inert|itemProp|itemScope|itemType|itemID|itemRef|on|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,s=Object(i.a)((function(e){return c.test(e)||111===e.charCodeAt(0)&&110===e.charCodeAt(1)&&e.charCodeAt(2)<91})),l=n(80),u=n(173),d=n(171),f=s,p=function(e){return"theme"!==e&&"innerRef"!==e},h=function(e){return"string"==typeof e&&e.charCodeAt(0)>96?f:p};function m(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function y(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?m(n,!0).forEach((function(t){o()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):m(n).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}t.a=function e(t,n){var r,o,i;void 0!==n&&(r=n.label,i=n.target,o=t.__emotion_forwardProp&&n.shouldForwardProp?function(e){return t.__emotion_forwardProp(e)&&n.shouldForwardProp(e)}:n.shouldForwardProp);var c=t.__emotion_real===t,s=c&&t.__emotion_base||t;"function"!=typeof o&&c&&(o=t.__emotion_forwardProp);var f=o||h(s),p=!f("as");return function(){var m=arguments,b=c&&void 0!==t.__emotion_styles?t.__emotion_styles.slice(0):[];if(void 0!==r&&b.push("label:"+r+";"),null==m[0]||void 0===m[0].raw)b.push.apply(b,m);else{b.push(m[0][0]);for(var g=m.length,v=1;v<g;v++)b.push(m[v],m[0][v])}var O=Object(l.c)((function(e,t,n){return Object(a.createElement)(l.a.Consumer,null,(function(r){var c=p&&e.as||s,l="",m=[],y=e;if(null==e.theme){for(var g in y={},e)y[g]=e[g];y.theme=r}"string"==typeof e.className?l=Object(u.a)(t.registered,m,e.className):null!=e.className&&(l=e.className+" ");var v=Object(d.a)(b.concat(m),t.registered,y);Object(u.b)(t,v,"string"==typeof c),l+=t.key+"-"+v.name,void 0!==i&&(l+=" "+i);var O=p&&void 0===o?h(c):f,w={};for(var _ in e)p&&"as"===_||O(_)&&(w[_]=e[_]);return w.className=l,w.ref=n||e.innerRef,Object(a.createElement)(c,w)}))}));return O.displayName=void 0!==r?r:"Styled("+("string"==typeof s?s:s.displayName||s.name||"Component")+")",O.defaultProps=t.defaultProps,O.__emotion_real=O,O.__emotion_base=s,O.__emotion_styles=b,O.__emotion_forwardProp=o,Object.defineProperty(O,"toString",{value:function(){return"."+i}}),O.withComponent=function(t,r){return e(t,void 0!==r?y({},n||{},{},r):n).apply(void 0,b)},O}}},,,function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function o(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}n.d(t,"a",(function(){return o}))},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(312);function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Object(r.a)(e,t)}},function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(38),o=n.n(r),a=n(79);function i(e,t){return!t||"object"!==o()(t)&&"function"!=typeof t?Object(a.a)(e):t}},function(e,t,n){"use strict";n.d(t,"b",(function(){return o})),n.d(t,"a",(function(){return a})),n.d(t,"c",(function(){return i}));var r=n(1);const o="wc/admin/plugins",a="/wc-paypal/v1",i={"facebook-for-woocommerce":Object(r.__)("Facebook for WooCommerce",'woocommerce'),jetpack:Object(r.__)("Jetpack",'woocommerce'),"klarna-checkout-for-woocommerce":Object(r.__)("Klarna Checkout for WooCommerce",'woocommerce'),"klarna-payments-for-woocommerce":Object(r.__)("Klarna Payments for WooCommerce",'woocommerce'),"mailchimp-for-woocommerce":Object(r.__)("Mailchimp for WooCommerce",'woocommerce'),"creative-mail-by-constant-contact":Object(r.__)("Creative Mail for WooCommerce",'woocommerce'),"woocommerce-gateway-paypal-express-checkout":Object(r.__)("WooCommerce PayPal",'woocommerce'),"woocommerce-gateway-stripe":Object(r.__)("WooCommerce Stripe",'woocommerce'),"woocommerce-payfast-gateway":Object(r.__)("WooCommerce PayFast",'woocommerce'),"woocommerce-payments":Object(r.__)("WooCommerce Payments",'woocommerce'),"woocommerce-services":Object(r.__)("WooCommerce Shipping & Tax",'woocommerce'),"woocommerce-services:shipping":Object(r.__)("WooCommerce Shipping & Tax",'woocommerce'),"woocommerce-services:tax":Object(r.__)("WooCommerce Shipping & Tax",'woocommerce'),"woocommerce-shipstation-integration":Object(r.__)("WooCommerce ShipStation Gateway",'woocommerce'),"woocommerce-mercadopago":Object(r.__)("Mercado Pago payments for WooCommerce",'woocommerce'),"google-listings-and-ads":Object(r.__)("Google Listings and Ads",'woocommerce'),"woo-razorpay":Object(r.__)("Razorpay",'woocommerce'),mailpoet:Object(r.__)("MailPoet",'woocommerce')}},,function(e,t,n){e.exports=n(706)},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(314);function o(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,a=[],_n=!0,i=!1;try{for(n=n.call(e);!(_n=(r=n.next()).done)&&(a.push(r.value),!t||a.length!==t);_n=!0);}catch(e){i=!0,o=e}finally{try{_n||null==n.return||n.return()}finally{if(i)throw o}}return a}}(e,t)||Object(r.a)(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}},,,,,,,function(e,t,n){"use strict";var r=n(176),o=n(245),a=n(434),i=n(435),c=n(703),s=o.apply(i()),l=function(e,t){return s(Object,arguments)};r(l,{getPolyfill:i,implementation:a,shim:c}),e.exports=l},,,function(e,t,n){"use strict";n.d(t,"b",(function(){return i}));var r=n(36),o=n(15),a=n.n(o);const i=e=>({type:"FETCH_WITH_HEADERS",options:e}),c={...r.controls,FETCH_WITH_HEADERS:({options:e})=>a()({...e,parse:!1}).then(e=>Promise.all([e.headers,e.status,e.json()])).then(([e,t,n])=>({headers:e,status:t,data:n}))};t.a=c},,,function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r="Interact with the calendar and add the check-in date for your trip.",o="Move backward to switch to the previous month.",a="Move forward to switch to the next month.",i="page up and page down keys",c="Home and end keys",s="Escape key",l="Select the date in focus.",u="Move backward (left) and forward (right) by one day.",d="Move backward (up) and forward (down) by one week.",f="Return to the date input field.",p="Press the down arrow key to interact with the calendar and\n  select a date. Press the question mark key to get the keyboard shortcuts for changing dates.",h=function(e){var t=e.date;return"Choose "+String(t)+" as your check-in date. It’s available."},m=function(e){var t=e.date;return"Choose "+String(t)+" as your check-out date. It’s available."},y=function(e){return e.date},b=function(e){var t=e.date;return"Not available. "+String(t)},g=function(e){var t=e.date;return"Selected. "+String(t)};t.default={calendarLabel:"Calendar",closeDatePicker:"Close",focusStartDate:r,clearDate:"Clear Date",clearDates:"Clear Dates",jumpToPrevMonth:o,jumpToNextMonth:a,keyboardShortcuts:"Keyboard Shortcuts",showKeyboardShortcutsPanel:"Open the keyboard shortcuts panel.",hideKeyboardShortcutsPanel:"Close the shortcuts panel.",openThisPanel:"Open this panel.",enterKey:"Enter key",leftArrowRightArrow:"Right and left arrow keys",upArrowDownArrow:"up and down arrow keys",pageUpPageDown:i,homeEnd:c,escape:s,questionMark:"Question mark",selectFocusedDate:l,moveFocusByOneDay:u,moveFocusByOneWeek:d,moveFocusByOneMonth:"Switch months.",moveFocustoStartAndEndOfWeek:"Go to the first or last day of a week.",returnFocusToInput:f,keyboardNavigationInstructions:p,chooseAvailableStartDate:h,chooseAvailableEndDate:m,dateIsUnavailable:b,dateIsSelected:g},t.DateRangePickerPhrases={calendarLabel:"Calendar",closeDatePicker:"Close",clearDates:"Clear Dates",focusStartDate:r,jumpToPrevMonth:o,jumpToNextMonth:a,keyboardShortcuts:"Keyboard Shortcuts",showKeyboardShortcutsPanel:"Open the keyboard shortcuts panel.",hideKeyboardShortcutsPanel:"Close the shortcuts panel.",openThisPanel:"Open this panel.",enterKey:"Enter key",leftArrowRightArrow:"Right and left arrow keys",upArrowDownArrow:"up and down arrow keys",pageUpPageDown:i,homeEnd:c,escape:s,questionMark:"Question mark",selectFocusedDate:l,moveFocusByOneDay:u,moveFocusByOneWeek:d,moveFocusByOneMonth:"Switch months.",moveFocustoStartAndEndOfWeek:"Go to the first or last day of a week.",returnFocusToInput:f,keyboardNavigationInstructions:p,chooseAvailableStartDate:h,chooseAvailableEndDate:m,dateIsUnavailable:b,dateIsSelected:g},t.DateRangePickerInputPhrases={focusStartDate:r,clearDates:"Clear Dates",keyboardNavigationInstructions:p},t.SingleDatePickerPhrases={calendarLabel:"Calendar",closeDatePicker:"Close",clearDate:"Clear Date",jumpToPrevMonth:o,jumpToNextMonth:a,keyboardShortcuts:"Keyboard Shortcuts",showKeyboardShortcutsPanel:"Open the keyboard shortcuts panel.",hideKeyboardShortcutsPanel:"Close the shortcuts panel.",openThisPanel:"Open this panel.",enterKey:"Enter key",leftArrowRightArrow:"Right and left arrow keys",upArrowDownArrow:"up and down arrow keys",pageUpPageDown:i,homeEnd:c,escape:s,questionMark:"Question mark",selectFocusedDate:l,moveFocusByOneDay:u,moveFocusByOneWeek:d,moveFocusByOneMonth:"Switch months.",moveFocustoStartAndEndOfWeek:"Go to the first or last day of a week.",returnFocusToInput:f,keyboardNavigationInstructions:p,chooseAvailableDate:y,dateIsUnavailable:b,dateIsSelected:g},t.SingleDatePickerInputPhrases={clearDate:"Clear Date",keyboardNavigationInstructions:p},t.DayPickerPhrases={calendarLabel:"Calendar",jumpToPrevMonth:o,jumpToNextMonth:a,keyboardShortcuts:"Keyboard Shortcuts",showKeyboardShortcutsPanel:"Open the keyboard shortcuts panel.",hideKeyboardShortcutsPanel:"Close the shortcuts panel.",openThisPanel:"Open this panel.",enterKey:"Enter key",leftArrowRightArrow:"Right and left arrow keys",upArrowDownArrow:"up and down arrow keys",pageUpPageDown:i,homeEnd:c,escape:s,questionMark:"Question mark",selectFocusedDate:l,moveFocusByOneDay:u,moveFocusByOneWeek:d,moveFocusByOneMonth:"Switch months.",moveFocustoStartAndEndOfWeek:"Go to the first or last day of a week.",returnFocusToInput:f,chooseAvailableStartDate:h,chooseAvailableEndDate:m,chooseAvailableDate:y,dateIsUnavailable:b,dateIsSelected:g},t.DayPickerKeyboardShortcutsPhrases={keyboardShortcuts:"Keyboard Shortcuts",showKeyboardShortcutsPanel:"Open the keyboard shortcuts panel.",hideKeyboardShortcutsPanel:"Close the shortcuts panel.",openThisPanel:"Open this panel.",enterKey:"Enter key",leftArrowRightArrow:"Right and left arrow keys",upArrowDownArrow:"up and down arrow keys",pageUpPageDown:i,homeEnd:c,escape:s,questionMark:"Question mark",selectFocusedDate:l,moveFocusByOneDay:u,moveFocusByOneWeek:d,moveFocusByOneMonth:"Switch months.",moveFocustoStartAndEndOfWeek:"Go to the first or last day of a week.",returnFocusToInput:f},t.DayPickerNavigationPhrases={jumpToPrevMonth:o,jumpToNextMonth:a},t.CalendarDayPhrases={chooseAvailableDate:y,dateIsUnavailable:b,dateIsSelected:g}},,,,,,,,,,function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return Object.keys(e).reduce((function(e,t){return(0,r.default)({},e,function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}({},t,o.default.oneOfType([o.default.string,o.default.func,o.default.node])))}),{})};var r=a(n(112)),o=a(n(2));function a(e){return e&&e.__esModule?e:{default:e}}},,,,,,,,,function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));const r="wc/admin/settings"},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.withStylesPropTypes=t.css=void 0;var r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();t.withStyles=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.stylesPropName,c=void 0===n?"styles":n,u=t.themePropName,f=void 0===u?"theme":u,b=t.cssPropName,_=void 0===b?"css":b,k=t.flushBefore,S=void 0!==k&&k,j=t.pureComponent,E=void 0!==j&&j,C=void 0,D=void 0,P=void 0,x=void 0,F=v(E);function T(e){return e===l.DIRECTIONS.LTR?d.default.resolveLTR:d.default.resolveRTL}function M(e){return e===l.DIRECTIONS.LTR?P:x}function R(t,n){var r=M(t),o=t===l.DIRECTIONS.LTR?C:D,a=d.default.get();return o&&r===a||(t===l.DIRECTIONS.RTL?(D=e?d.default.createRTL(e):g,x=a,o=D):(C=e?d.default.createLTR(e):g,P=a,o=C)),o}function I(e,t){return{resolveMethod:T(e),styleDef:R(e)}}return function(e){var t=e.displayName||e.name||"Component",n=function(t){function n(e,t){p(this,n);var r=h(this,(n.__proto__||Object.getPrototypeOf(n)).call(this,e,t)),o=r.context[l.CHANNEL]?r.context[l.CHANNEL].getState():w;return r.state=I(o),r}return m(n,t),o(n,[{key:"componentDidMount",value:function(){var e=this;this.context[l.CHANNEL]&&(this.channelUnsubscribe=this.context[l.CHANNEL].subscribe((function(t){e.setState(I(t))})))}},{key:"componentWillUnmount",value:function(){this.channelUnsubscribe&&this.channelUnsubscribe()}},{key:"render",value:function(){var t;S&&d.default.flush();var n=this.state,o=n.resolveMethod,a=n.styleDef;return i.default.createElement(e,r({},this.props,(y(t={},f,d.default.get()),y(t,c,a()),y(t,_,o),t)))}}]),n}(F);return n.WrappedComponent=e,n.displayName="withStyles("+String(t)+")",n.contextTypes=O,e.propTypes&&(n.propTypes=(0,a.default)({},e.propTypes),delete n.propTypes[c],delete n.propTypes[f],delete n.propTypes[_]),e.defaultProps&&(n.defaultProps=(0,a.default)({},e.defaultProps)),(0,s.default)(n,e)}};var a=f(n(112)),i=f(n(11)),c=f(n(2)),s=f(n(707)),l=n(710),u=f(n(711)),d=f(n(409));function f(e){return e&&e.__esModule?e:{default:e}}function p(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function h(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function m(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function y(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}t.css=d.default.resolveLTR,t.withStylesPropTypes={styles:c.default.object.isRequired,theme:c.default.object.isRequired,css:c.default.func.isRequired};var b={},g=function(){return b};function v(e){if(e){if(!i.default.PureComponent)throw new ReferenceError("withStyles() pureComponent option requires React 15.3.0 or later");return i.default.PureComponent}return i.default.Component}var O=y({},l.CHANNEL,u.default),w=l.DIRECTIONS.LTR},,,,,,,,,function(e,t,n){"use strict";var r=n(597);e.exports=function(e){return"symbol"==typeof e?"Symbol":"bigint"==typeof e?"BigInt":r(e)}},function(e,t,n){(function(t){var n=function(e){return e&&e.Math==Math&&e};e.exports=n("object"==typeof globalThis&&globalThis)||n("object"==typeof window&&window)||n("object"==typeof self&&self)||n("object"==typeof t&&t)||function(){return this}()||Function("return this")()}).call(this,n(225))},,,function(e,t,n){"use strict";function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function o(e){return function(e){if(Array.isArray(e))return e}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return a(e,void 0);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?a(e,void 0):void 0}}(e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function a(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var i={normalizePrecision:function(e){var t=e.reduce((function(e,t){return Math.max(e.getPrecision(),t.getPrecision())}));return e.map((function(e){return e.getPrecision()!==t?e.convertPrecision(t):e}))},minimum:function(e){var t=o(e),n=t[0],r=t.slice(1),a=n;return r.forEach((function(e){a=a.lessThan(e)?a:e})),a},maximum:function(e){var t=o(e),n=t[0],r=t.slice(1),a=n;return r.forEach((function(e){a=a.greaterThan(e)?a:e})),a}};function c(e){return!isNaN(parseInt(e))&&isFinite(e)}function s(e){return e%2==0}function l(e){return c(e)&&!Number.isInteger(e)}function u(e){return Math.abs(e)%1==.5}function d(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};for(var n in t)e.setRequestHeader(n,t[n]);return e}function f(e){return void 0===e}function p(){var e={HALF_ODD:function(e){var t=Math.round(e);return u(e)&&s(t)?t-1:t},HALF_EVEN:function(e){var t=Math.round(e);return u(e)?s(t)?t:t-1:t},HALF_UP:function(e){return Math.round(e)},HALF_DOWN:function(e){return u(e)?Math.floor(e):Math.round(e)},HALF_TOWARDS_ZERO:function(e){return u(e)?Math.sign(e)*Math.floor(Math.abs(e)):Math.round(e)},HALF_AWAY_FROM_ZERO:function(e){return u(e)?Math.sign(e)*Math.ceil(Math.abs(e)):Math.round(e)},DOWN:function(e){return Math.floor(e)}};return{add:function(e,t){return e+t},subtract:function(e,t){return e-t},multiply:function(e,t){return l(e)||l(t)?function(e,t){var n=function(e){return Math.pow(10,function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=e.toString();if(t.indexOf("e-")>0)return parseInt(t.split("e-")[1]);var n=t.split(".")[1];return n?n.length:0}(e))},r=Math.max(n(e),n(t));return Math.round(e*r)*Math.round(t*r)/(r*r)}(e,t):e*t},divide:function(e,t){return e/t},modulo:function(e,t){return e%t},round:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"HALF_EVEN";return e[n](t)}}}var h=p();function m(e){var t=/^(?:(\$|USD)?0(?:(,)0)?(\.)?(0+)?|0(?:(,)0)?(\.)?(0+)?\s?(dollar)?)$/gm.exec(e);return{getMatches:function(){return null!==t?t.slice(1).filter((function(e){return!f(e)})):[]},getMinimumFractionDigits:function(){var e=function(e){return"."===e};return f(this.getMatches().find(e))?0:this.getMatches()[h.add(this.getMatches().findIndex(e),1)].split("").length},getCurrencyDisplay:function(){return{USD:"code",dollar:"name",$:"symbol"}[this.getMatches().find((function(e){return"USD"===e||"dollar"===e||"$"===e}))]},getStyle:function(){return f(this.getCurrencyDisplay(this.getMatches()))?"decimal":"currency"},getUseGrouping:function(){return!f(this.getMatches().find((function(e){return","===e})))}}}function y(e){var t=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1?arguments[1]:void 0;for(var n in t)e=e.replace("{{".concat(n,"}}"),t[n]);return e};return{getExchangeRate:function(n,o){return(a=e.endpoint,!Boolean(a)||"object"!==r(a)&&"function"!=typeof a||"function"!=typeof a.then?function(n,r){return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return new Promise((function(n,r){var o=Object.assign(new XMLHttpRequest,{onreadystatechange:function(){4===o.readyState&&(o.status>=200&&o.status<400?n(JSON.parse(o.responseText)):r(new Error(o.statusText)))},onerror:function(){r(new Error("Network error"))}});o.open("GET",e,!0),d(o,t.headers),o.send()}))}(t(e.endpoint,{from:n,to:r}),{headers:e.headers})}(n,o):e.endpoint).then((function(a){return function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:".",o={};return Object.entries(t).forEach((function(t){if("object"===r(t[1])){var a=e(t[1]);Object.entries(a).forEach((function(e){o[t[0]+n+e[0]]=e[1]}))}else o[t[0]]=t[1]})),o}(a)[t(e.propertyPath,{from:n,to:o})]}));var a}}}function b(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Error;if(!e)throw new n(t)}function g(e){b(function(e){return c(e)&&e<=100&&e>=0}(e),"You must provide a numeric value between 0 and 100.",RangeError)}function v(e){b(Number.isInteger(e),"You must provide an integer.",TypeError)}var O=p(),w=Object.assign((function e(t){var n=Object.assign({},{amount:e.defaultAmount,currency:e.defaultCurrency,precision:e.defaultPrecision},t),r=n.amount,o=n.currency,a=n.precision;v(r),v(a);var i=e.globalLocale,c=e.globalFormat,s=e.globalRoundingMode,l=e.globalFormatRoundingMode,u=Object.assign({},e.globalExchangeRatesApi),d=function(t){var n=Object.assign({},Object.assign({},{amount:r,currency:o,precision:a},t),Object.assign({},{locale:this.locale},t));return Object.assign(e({amount:n.amount,currency:n.currency,precision:n.precision}),{locale:n.locale})},p=function(e){b(this.hasSameCurrency(e),"You must provide a Dinero instance with the same currency.",TypeError)};return{getAmount:function(){return r},getCurrency:function(){return o},getLocale:function(){return this.locale||i},setLocale:function(e){return d.call(this,{locale:e})},getPrecision:function(){return a},convertPrecision:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:l;return v(e),d.call(this,{amount:O.round(O.multiply(this.getAmount(),Math.pow(10,O.subtract(e,this.getPrecision()))),t),precision:e})},add:function(t){p.call(this,t);var n=e.normalizePrecision([this,t]);return d.call(this,{amount:O.add(n[0].getAmount(),n[1].getAmount()),precision:n[0].getPrecision()})},subtract:function(t){p.call(this,t);var n=e.normalizePrecision([this,t]);return d.call(this,{amount:O.subtract(n[0].getAmount(),n[1].getAmount()),precision:n[0].getPrecision()})},multiply:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:s;return d.call(this,{amount:O.round(O.multiply(this.getAmount(),e),t)})},divide:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:s;return d.call(this,{amount:O.round(O.divide(this.getAmount(),e),t)})},percentage:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:s;return g(e),this.multiply(O.divide(e,100),t)},allocate:function(e){var t=this;!function(e){b(function(e){return e.length>0&&e.every((function(e){return e>=0}))&&e.some((function(e){return e>0}))}(e),"You must provide a non-empty array of numeric values greater than 0.",TypeError)}(e);for(var n=e.reduce((function(e,t){return O.add(e,t)})),r=this.getAmount(),o=e.map((function(e){var o=Math.floor(O.divide(O.multiply(t.getAmount(),e),n));return r=O.subtract(r,o),d.call(t,{amount:o})})),a=0;r>0;)e[a]>0&&(o[a]=o[a].add(d.call(this,{amount:1})),r=O.subtract(r,1)),a+=1;return o},convert:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=n.endpoint,o=void 0===r?u.endpoint:r,a=n.propertyPath,i=void 0===a?u.propertyPath||"rates.{{to}}":a,c=n.headers,l=void 0===c?u.headers:c,p=n.roundingMode,h=void 0===p?s:p,m=Object.assign({},{endpoint:o,propertyPath:i,headers:l,roundingMode:h});return y(m).getExchangeRate(this.getCurrency(),e).then((function(n){return b(!f(n),'No rate was found for the destination currency "'.concat(e,'".'),TypeError),d.call(t,{amount:O.round(O.multiply(t.getAmount(),parseFloat(n)),m.roundingMode),currency:e})}))},equalsTo:function(e){return this.hasSameAmount(e)&&this.hasSameCurrency(e)},lessThan:function(t){p.call(this,t);var n=e.normalizePrecision([this,t]);return n[0].getAmount()<n[1].getAmount()},lessThanOrEqual:function(t){p.call(this,t);var n=e.normalizePrecision([this,t]);return n[0].getAmount()<=n[1].getAmount()},greaterThan:function(t){p.call(this,t);var n=e.normalizePrecision([this,t]);return n[0].getAmount()>n[1].getAmount()},greaterThanOrEqual:function(t){p.call(this,t);var n=e.normalizePrecision([this,t]);return n[0].getAmount()>=n[1].getAmount()},isZero:function(){return 0===this.getAmount()},isPositive:function(){return this.getAmount()>=0},isNegative:function(){return this.getAmount()<0},hasSubUnits:function(){return 0!==O.modulo(this.getAmount(),Math.pow(10,a))},hasCents:function(){return 0!==O.modulo(this.getAmount(),Math.pow(10,a))},hasSameCurrency:function(e){return this.getCurrency()===e.getCurrency()},hasSameAmount:function(t){var n=e.normalizePrecision([this,t]);return n[0].getAmount()===n[1].getAmount()},toFormat:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:c,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:l,n=m(e);return this.toRoundedUnit(n.getMinimumFractionDigits(),t).toLocaleString(this.getLocale(),{currencyDisplay:n.getCurrencyDisplay(),useGrouping:n.getUseGrouping(),minimumFractionDigits:n.getMinimumFractionDigits(),style:n.getStyle(),currency:this.getCurrency()})},toUnit:function(){return O.divide(this.getAmount(),Math.pow(10,a))},toRoundedUnit:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:l,n=Math.pow(10,e);return O.divide(O.round(O.multiply(this.toUnit(),n),t),n)},toObject:function(){return{amount:r,currency:o,precision:a}},toJSON:function(){return this.toObject()}}}),{defaultAmount:0,defaultCurrency:"USD",defaultPrecision:2},{globalLocale:"en-US",globalFormat:"$0,0.00",globalRoundingMode:"HALF_EVEN",globalFormatRoundingMode:"HALF_AWAY_FROM_ZERO",globalExchangeRatesApi:{endpoint:void 0,headers:void 0,propertyPath:void 0}},i);t.a=w},,,,,,,,,function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var r=n(282),o=n(314);function a(e){return function(e){if(Array.isArray(e))return Object(r.a)(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||Object(o.a)(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}},,,,,,function(e,t,n){"use strict";var r=n(11),o=n.n(r);function a(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function i(){return(i=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function c(e){return(c=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function s(e,t){return(s=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function l(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function u(){}function d(){}d.resetWarningCache=u;var f=function(e,t){return function(e){e.exports=function(){function e(e,t,n,r,o,a){if("SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"!==a){var i=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw i.name="Invariant Violation",i}}function t(){return e}e.isRequired=e;var n={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:d,resetWarningCache:u};return n.PropTypes=n,n}()}(t={exports:{}}),t.exports}();function p(){}function h(e){return!!(e||"").match(/\d/)}function m(e){return null==e}function y(e){return e.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&")}function b(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n="-"===e[0],r=n&&t,o=(e=e.replace("-","")).split("."),a=o[0],i=o[1]||"";return{beforeDecimal:a,afterDecimal:i,hasNagation:n,addNegation:r}}function g(e,t,n){for(var r="",o=n?"0":"",a=0;a<=t-1;a++)r+=e[a]||o;return r}function v(e,t){if(e.value=e.value,null!==e){if(e.createTextRange){var n=e.createTextRange();return n.move("character",t),n.select(),!0}return e.selectionStart||0===e.selectionStart?(e.focus(),e.setSelectionRange(t,t),!0):(e.focus(),!1)}}function O(e,t,n){return Math.min(Math.max(e,t),n)}function w(e){return Math.max(e.selectionStart,e.selectionEnd)}var _={thousandSeparator:f.oneOfType([f.string,f.oneOf([!0])]),decimalSeparator:f.string,allowedDecimalSeparators:f.arrayOf(f.string),thousandsGroupStyle:f.oneOf(["thousand","lakh","wan"]),decimalScale:f.number,fixedDecimalScale:f.bool,displayType:f.oneOf(["input","text"]),prefix:f.string,suffix:f.string,format:f.oneOfType([f.string,f.func]),removeFormatting:f.func,mask:f.oneOfType([f.string,f.arrayOf(f.string)]),value:f.oneOfType([f.number,f.string]),defaultValue:f.oneOfType([f.number,f.string]),isNumericString:f.bool,customInput:f.elementType,allowNegative:f.bool,allowEmptyFormatting:f.bool,allowLeadingZeros:f.bool,onValueChange:f.func,onKeyDown:f.func,onMouseUp:f.func,onChange:f.func,onFocus:f.func,onBlur:f.func,type:f.oneOf(["text","tel","password"]),isAllowed:f.func,renderText:f.func,getInputRef:f.oneOfType([f.func,f.shape({current:f.any})])},k={displayType:"input",decimalSeparator:".",thousandsGroupStyle:"thousand",fixedDecimalScale:!1,prefix:"",suffix:"",allowNegative:!0,allowEmptyFormatting:!1,allowLeadingZeros:!1,isNumericString:!1,type:"text",onValueChange:p,onChange:p,onKeyDown:p,onMouseUp:p,onFocus:p,onBlur:p,isAllowed:function(){return!0}},S=function(e){function t(e){var n;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),n=function(e,t){return!t||"object"!=typeof t&&"function"!=typeof t?l(e):t}(this,c(t).call(this,e));var r=e.defaultValue;n.validateProps();var o=n.formatValueProp(r);return n.state={value:o,numAsString:n.removeFormatting(o)},n.selectionBeforeInput={selectionStart:0,selectionEnd:0},n.onChange=n.onChange.bind(l(n)),n.onKeyDown=n.onKeyDown.bind(l(n)),n.onMouseUp=n.onMouseUp.bind(l(n)),n.onFocus=n.onFocus.bind(l(n)),n.onBlur=n.onBlur.bind(l(n)),n}var n,r;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&s(e,t)}(t,e),n=t,(r=[{key:"componentDidUpdate",value:function(e){this.updateValueIfRequired(e)}},{key:"componentWillUnmount",value:function(){clearTimeout(this.focusTimeout)}},{key:"updateValueIfRequired",value:function(e){var t=this.props,n=this.state,r=this.focusedElm,o=n.value,a=n.numAsString,i=void 0===a?"":a;if(e!==t){this.validateProps();var c=this.formatNumString(i),s=m(t.value)?c:this.formatValueProp(),l=this.removeFormatting(s),u=parseFloat(l),d=parseFloat(i);(isNaN(u)&&isNaN(d)||u===d)&&c===o&&(null!==r||s===o)||this.updateValue({formattedValue:s,numAsString:l,input:r})}}},{key:"getFloatString",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=this.props.decimalScale,n=this.getSeparators(),r=n.decimalSeparator,o=this.getNumberRegex(!0),a="-"===e[0];a&&(e=e.replace("-","")),r&&0===t&&(e=e.split(r)[0]);var i=(e=(e.match(o)||[]).join("").replace(r,".")).indexOf(".");return-1!==i&&(e="".concat(e.substring(0,i),".").concat(e.substring(i+1,e.length).replace(new RegExp(y(r),"g"),""))),a&&(e="-"+e),e}},{key:"getNumberRegex",value:function(e,t){var n=this.props,r=n.format,o=n.decimalScale,a=this.getSeparators().decimalSeparator;return new RegExp("\\d"+(!a||0===o||t||r?"":"|"+y(a)),e?"g":void 0)}},{key:"getSeparators",value:function(){var e=this.props.decimalSeparator,t=this.props,n=t.thousandSeparator,r=t.allowedDecimalSeparators;return!0===n&&(n=","),r||(r=[e,"."]),{decimalSeparator:e,thousandSeparator:n,allowedDecimalSeparators:r}}},{key:"getMaskAtIndex",value:function(e){var t=this.props.mask,n=void 0===t?" ":t;return"string"==typeof n?n:n[e]||" "}},{key:"getValueObject",value:function(e,t){var n=parseFloat(t);return{formattedValue:e,value:t,floatValue:isNaN(n)?void 0:n}}},{key:"validateProps",value:function(){var e=this.props.mask,t=this.getSeparators(),n=t.decimalSeparator,r=t.thousandSeparator;if(n===r)throw new Error("\n          Decimal separator can't be same as thousand separator.\n          thousandSeparator: ".concat(r,' (thousandSeparator = {true} is same as thousandSeparator = ",")\n          decimalSeparator: ').concat(n," (default value for decimalSeparator is .)\n       "));if(e&&("string"===e?e:e.toString()).match(/\d/g))throw new Error("\n          Mask ".concat(e," should not contain numeric character;\n        "))}},{key:"setPatchedCaretPosition",value:function(e,t,n){v(e,t),setTimeout((function(){e.value===n&&v(e,t)}),0)}},{key:"correctCaretPosition",value:function(e,t,n){var r=this.props,o=r.prefix,a=r.suffix,i=r.format;if(""===e)return 0;if(t=O(t,0,e.length),!i){var c="-"===e[0];return O(t,o.length+(c?1:0),e.length-a.length)}if("function"==typeof i)return t;if("#"===i[t]&&h(e[t]))return t;if("#"===i[t-1]&&h(e[t-1]))return t;var s=i.indexOf("#");t=O(t,s,i.lastIndexOf("#")+1);for(var l=i.substring(t,i.length).indexOf("#"),u=t,d=t+(-1===l?0:l);u>s&&("#"!==i[u]||!h(e[u]));)u-=1;return!h(e[d])||"left"===n&&t!==s||t-u<d-t?h(e[u])?u+1:u:d}},{key:"getCaretPosition",value:function(e,t,n){var r,o,a=this.props.format,i=this.state.value,c=this.getNumberRegex(!0),s=(e.match(c)||[]).join(""),l=(t.match(c)||[]).join("");for(r=0,o=0;o<n;o++){var u=e[o]||"",d=t[r]||"";if((u.match(c)||u===d)&&("0"!==u||!d.match(c)||"0"===d||s.length===l.length)){for(;u!==t[r]&&r<t.length;)r++;r++}}return"string"!=typeof a||i||(r=t.length),this.correctCaretPosition(t,r)}},{key:"removePrefixAndSuffix",value:function(e){var t=this.props,n=t.format,r=t.prefix,o=t.suffix;if(!n&&e){var a="-"===e[0];a&&(e=e.substring(1,e.length));var i=(e=r&&0===e.indexOf(r)?e.substring(r.length,e.length):e).lastIndexOf(o);e=o&&-1!==i&&i===e.length-o.length?e.substring(0,i):e,a&&(e="-"+e)}return e}},{key:"removePatternFormatting",value:function(e){for(var t=this.props.format.split("#").filter((function(e){return""!==e})),n=0,r="",o=0,a=t.length;o<=a;o++){var i=t[o]||"",c=o===a?e.length:e.indexOf(i,n);if(-1===c){r=e;break}r+=e.substring(n,c),n=c+i.length}return(r.match(/\d/g)||[]).join("")}},{key:"removeFormatting",value:function(e){var t=this.props,n=t.format,r=t.removeFormatting;return e?(n?e="string"==typeof n?this.removePatternFormatting(e):"function"==typeof r?r(e):(e.match(/\d/g)||[]).join(""):(e=this.removePrefixAndSuffix(e),e=this.getFloatString(e)),e):e}},{key:"formatWithPattern",value:function(e){for(var t=this.props.format,n=0,r=t.split(""),o=0,a=t.length;o<a;o++)"#"===t[o]&&(r[o]=e[n]||this.getMaskAtIndex(n),n+=1);return r.join("")}},{key:"formatAsNumber",value:function(e){var t=this.props,n=t.decimalScale,r=t.fixedDecimalScale,o=t.prefix,a=t.suffix,i=t.allowNegative,c=t.thousandsGroupStyle,s=this.getSeparators(),l=s.thousandSeparator,u=s.decimalSeparator,d=-1!==e.indexOf(".")||n&&r,f=b(e,i),p=f.beforeDecimal,h=f.afterDecimal,m=f.addNegation;return void 0!==n&&(h=g(h,n,r)),l&&(p=function(e,t,n){var r=function(e){switch(e){case"lakh":return/(\d+?)(?=(\d\d)+(\d)(?!\d))(\.\d+)?/g;case"wan":return/(\d)(?=(\d{4})+(?!\d))/g;case"thousand":default:return/(\d)(?=(\d{3})+(?!\d))/g}}(n),o=e.search(/[1-9]/);return o=-1===o?e.length:o,e.substring(0,o)+e.substring(o,e.length).replace(r,"$1"+t)}(p,l,c)),o&&(p=o+p),a&&(h+=a),m&&(p="-"+p),p+(d&&u||"")+h}},{key:"formatNumString",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=this.props,n=t.format,r=t.allowEmptyFormatting,o=e;return""!==e||r?"-"!==e||n?"string"==typeof n?this.formatWithPattern(o):"function"==typeof n?n(o):this.formatAsNumber(o):"-":""}},{key:"formatValueProp",value:function(e){var t=this.props,n=t.format,r=t.decimalScale,o=t.fixedDecimalScale,a=t.allowEmptyFormatting,i=this.props,c=i.value,s=i.isNumericString,l=!(c=m(c)?e:c)&&0!==c;return l&&a&&(c=""),l&&!a?"":("number"==typeof c&&(c=c.toString(),s=!0),"Infinity"===c&&s&&(c=""),s&&!n&&"number"==typeof r&&(c=function(e,t,n){if(-1!==["","-"].indexOf(e))return e;var r=-1!==e.indexOf(".")&&t,o=b(e),a=o.beforeDecimal,i=o.afterDecimal,c=o.hasNagation,s=parseFloat("0.".concat(i||"0")).toFixed(t).split("."),l=a.split("").reverse().reduce((function(e,t,n){return e.length>n?(Number(e[0])+Number(t)).toString()+e.substring(1,e.length):t+e}),s[0]),u=g(s[1]||"",Math.min(t,i.length),n),d=r?".":"";return"".concat(c?"-":"").concat(l).concat(d).concat(u)}(c,r,o)),s?this.formatNumString(c):this.formatInput(c))}},{key:"formatNegation",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=this.props.allowNegative,n=new RegExp("(-)"),r=new RegExp("(-)(.)*(-)"),o=n.test(e),a=r.test(e);return e=e.replace(/-/g,""),o&&!a&&t&&(e="-"+e),e}},{key:"formatInput",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=this.props.format;return t||(e=this.removePrefixAndSuffix(e),e=this.formatNegation(e)),e=this.removeFormatting(e),this.formatNumString(e)}},{key:"isCharacterAFormat",value:function(e,t){var n=this.props,r=n.format,o=n.prefix,a=n.suffix,i=n.decimalScale,c=n.fixedDecimalScale,s=this.getSeparators().decimalSeparator;return"string"==typeof r&&"#"!==r[e]||!(r||!(e<o.length||e>=t.length-a.length||i&&c&&t[e]===s))}},{key:"checkIfFormatGotDeleted",value:function(e,t,n){for(var r=e;r<t;r++)if(this.isCharacterAFormat(r,n))return!0;return!1}},{key:"correctInputValue",value:function(e,t,n){var r=this.props,o=r.format,a=r.allowNegative,i=r.prefix,c=r.suffix,s=r.decimalScale,l=this.getSeparators(),u=l.allowedDecimalSeparators,d=l.decimalSeparator,f=this.state.numAsString||"",p=this.selectionBeforeInput,h=p.selectionStart,m=p.selectionEnd,y=function(e,t){for(var n=0,r=0,o=e.length,a=t.length;e[n]===t[n]&&n<o;)n++;for(;e[o-1-r]===t[a-1-r]&&a-r>n&&o-r>n;)r++;return{start:n,end:o-r}}(t,n),g=y.start,v=y.end;if(!o&&g===v&&-1!==u.indexOf(n[h])){var O=0===s?"":d;return n.substr(0,h)+O+n.substr(h+1,n.length)}var w=o?0:i.length,_=t.length-(o?0:c.length);if(n.length>t.length||!n.length||g===v||0===h&&m===t.length||h===w&&m===_)return n;if(this.checkIfFormatGotDeleted(g,v,t)&&(n=t),!o){var k=this.removeFormatting(n),S=b(k,a),j=S.beforeDecimal,E=S.afterDecimal,C=S.addNegation,D=e<n.indexOf(d)+1;if(k.length<f.length&&D&&""===j&&!parseFloat(E))return C?"-":""}return n}},{key:"updateValue",value:function(e){var t=e.formattedValue,n=e.input,r=e.setCaretPosition,o=void 0===r||r,a=e.numAsString,i=e.caretPos,c=this.props.onValueChange,s=this.state.value;if(n)if(o){if(!i){var l=e.inputValue||n.value,u=w(n);n.value=t,i=this.getCaretPosition(l,t,u)}this.setPatchedCaretPosition(n,i,t)}else n.value=t;void 0===a&&(a=this.removeFormatting(t)),t!==s&&(this.setState({value:t,numAsString:a}),c(this.getValueObject(t,a)))}},{key:"onChange",value:function(e){var t=e.target,n=t.value,r=this.state,o=this.props,a=o.isAllowed,i=r.value||"",c=w(t);n=this.correctInputValue(c,i,n);var s=this.formatInput(n)||"",l=this.removeFormatting(s);a(this.getValueObject(s,l))||(s=i),this.updateValue({formattedValue:s,numAsString:l,inputValue:n,input:t}),o.onChange(e)}},{key:"onBlur",value:function(e){var t=this.props,n=this.state,r=t.format,o=t.onBlur,a=t.allowLeadingZeros,i=n.numAsString,c=n.value;if(this.focusedElm=null,clearTimeout(this.focusTimeout),!r){isNaN(parseFloat(i))&&(i=""),a||(i=function(e){if(!e)return e;var t="-"===e[0];t&&(e=e.substring(1,e.length));var n=e.split("."),r=n[0].replace(/^0+/,"")||"0",o=n[1]||"";return"".concat(t?"-":"").concat(r).concat(o?".".concat(o):"")}(i));var s=this.formatNumString(i);if(s!==c)return this.updateValue({formattedValue:s,numAsString:i,input:e.target,setCaretPosition:!1}),void o(e)}o(e)}},{key:"onKeyDown",value:function(e){var t,n=e.target,r=e.key,o=n.selectionStart,a=n.selectionEnd,i=n.value,c=void 0===i?"":i,s=this.props,l=s.decimalScale,u=s.fixedDecimalScale,d=s.prefix,f=s.suffix,p=s.format,h=s.onKeyDown,m=void 0!==l&&u,y=this.getNumberRegex(!1,m),b=new RegExp("-"),g="string"==typeof p;if(this.selectionBeforeInput={selectionStart:o,selectionEnd:a},"ArrowLeft"===r||"Backspace"===r?t=o-1:"ArrowRight"===r?t=o+1:"Delete"===r&&(t=o),void 0!==t&&o===a){var v=t,O=g?p.indexOf("#"):d.length,w=g?p.lastIndexOf("#")+1:c.length-f.length;if("ArrowLeft"===r||"ArrowRight"===r){var _="ArrowLeft"===r?"left":"right";v=this.correctCaretPosition(c,t,_)}else if("Delete"!==r||y.test(c[t])||b.test(c[t])){if("Backspace"===r&&!y.test(c[t]))if(o<=O+1&&"-"===c[0]&&void 0===p){var k=c.substring(1);this.updateValue({formattedValue:k,caretPos:v,input:n})}else if(!b.test(c[t])){for(;!y.test(c[v-1])&&v>O;)v--;v=this.correctCaretPosition(c,v,"left")}}else for(;!y.test(c[v])&&v<w;)v++;(v!==t||t<O||t>w)&&(e.preventDefault(),this.setPatchedCaretPosition(n,v,c)),e.isUnitTestRun&&this.setPatchedCaretPosition(n,v,c),h(e)}else h(e)}},{key:"onMouseUp",value:function(e){var t=e.target,n=t.selectionStart,r=t.selectionEnd,o=t.value,a=void 0===o?"":o;if(n===r){var i=this.correctCaretPosition(a,n);i!==n&&this.setPatchedCaretPosition(t,i,a)}this.props.onMouseUp(e)}},{key:"onFocus",value:function(e){var t=this;e.persist(),this.focusedElm=e.target,this.focusTimeout=setTimeout((function(){var n=e.target,r=n.selectionStart,o=n.selectionEnd,a=n.value,i=void 0===a?"":a,c=t.correctCaretPosition(i,r);c===r||0===r&&o===i.length||t.setPatchedCaretPosition(n,c,i),t.props.onFocus(e)}),0)}},{key:"render",value:function(){var e,t,n,r=this.props,a=r.type,c=r.displayType,s=r.customInput,l=r.renderText,u=r.getInputRef,d=r.format,f=this.state.value,p=(e=this.props,t=_,n={},Object.keys(e).forEach((function(r){t[r]||(n[r]=e[r])})),n),h=i({inputMode:function(e){return e||!(navigator.platform&&/iPhone|iPod/.test(navigator.platform))}(d)?"numeric":void 0},p,{type:a,value:f,onChange:this.onChange,onKeyDown:this.onKeyDown,onMouseUp:this.onMouseUp,onFocus:this.onFocus,onBlur:this.onBlur});if("text"===c)return l?l(f)||null:o.a.createElement("span",i({},p,{ref:u}),f);if(s){var m=s;return o.a.createElement(m,i({},h,{ref:u}))}return o.a.createElement("input",i({},h,{ref:u}))}}])&&a(n.prototype,r),t}(o.a.Component);S.propTypes=_,S.defaultProps=k,t.a=S},,,,function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));const r="core"},function(e,t,n){"use strict";n.d(t,"a",(function(){return m}));var r=function(e){for(var t,n=0,r=0,o=e.length;o>=4;++r,o-=4)t=1540483477*(65535&(t=255&e.charCodeAt(r)|(255&e.charCodeAt(++r))<<8|(255&e.charCodeAt(++r))<<16|(255&e.charCodeAt(++r))<<24))+(59797*(t>>>16)<<16),n=1540483477*(65535&(t^=t>>>24))+(59797*(t>>>16)<<16)^1540483477*(65535&n)+(59797*(n>>>16)<<16);switch(o){case 3:n^=(255&e.charCodeAt(r+2))<<16;case 2:n^=(255&e.charCodeAt(r+1))<<8;case 1:n=1540483477*(65535&(n^=255&e.charCodeAt(r)))+(59797*(n>>>16)<<16)}return(((n=1540483477*(65535&(n^=n>>>13))+(59797*(n>>>16)<<16))^n>>>15)>>>0).toString(36)},o={animationIterationCount:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},a=n(316),i=/[A-Z]|^ms/g,c=/_EMO_([^_]+?)_([^]*?)_EMO_/g,s=function(e){return 45===e.charCodeAt(1)},l=function(e){return null!=e&&"boolean"!=typeof e},u=Object(a.a)((function(e){return s(e)?e:e.replace(i,"-$&").toLowerCase()})),d=function(e,t){switch(e){case"animation":case"animationName":if("string"==typeof t)return t.replace(c,(function(e,t,n){return p={name:t,styles:n,next:p},t}))}return 1===o[e]||s(e)||"number"!=typeof t||0===t?t:t+"px"};function f(e,t,n,r){if(null==n)return"";if(void 0!==n.__emotion_styles)return n;switch(typeof n){case"boolean":return"";case"object":if(1===n.anim)return p={name:n.name,styles:n.styles,next:p},n.name;if(void 0!==n.styles){var o=n.next;if(void 0!==o)for(;void 0!==o;)p={name:o.name,styles:o.styles,next:p},o=o.next;return n.styles+";"}return function(e,t,n){var r="";if(Array.isArray(n))for(var o=0;o<n.length;o++)r+=f(e,t,n[o],!1);else for(var a in n){var i=n[a];if("object"!=typeof i)null!=t&&void 0!==t[i]?r+=a+"{"+t[i]+"}":l(i)&&(r+=u(a)+":"+d(a,i)+";");else if(!Array.isArray(i)||"string"!=typeof i[0]||null!=t&&void 0!==t[i[0]]){var c=f(e,t,i,!1);switch(a){case"animation":case"animationName":r+=u(a)+":"+c+";";break;default:r+=a+"{"+c+"}"}}else for(var s=0;s<i.length;s++)l(i[s])&&(r+=u(a)+":"+d(a,i[s])+";")}return r}(e,t,n);case"function":if(void 0!==e){var a=p,i=n(e);return p=a,f(e,t,i,r)}}if(null==t)return n;var c=t[n];return void 0===c||r?n:c}var p,h=/label:\s*([^\s;\n{]+)\s*;/g,m=function(e,t,n){if(1===e.length&&"object"==typeof e[0]&&null!==e[0]&&void 0!==e[0].styles)return e[0];var o=!0,a="";p=void 0;var i=e[0];null==i||void 0===i.raw?(o=!1,a+=f(n,t,i,!1)):a+=i[0];for(var c=1;c<e.length;c++)a+=f(n,t,e[c],46===a.charCodeAt(a.length-1)),o&&(a+=i[c]);h.lastIndex=0;for(var s,l="";null!==(s=h.exec(a));)l+="-"+s[1];return{name:r(a)+l,styles:a,next:p}}},function(e,t){e.exports=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,n){"use strict";function r(e,t,n){var r="";return n.split(" ").forEach((function(n){void 0!==e[n]?t.push(e[n]):r+=n+" "})),r}n.d(t,"a",(function(){return r})),n.d(t,"b",(function(){return o}));var o=function(e,t,n){var r=e.key+"-"+t.name;if(!1===n&&void 0===e.registered[r]&&(e.registered[r]=t.styles),void 0===e.inserted[t.name]){var o=t;do{e.insert("."+r,o,e.sheet,!0),o=o.next}while(void 0!==o)}}},,,function(e,t,n){"use strict";var r=n(390),o="function"==typeof Symbol&&"symbol"==typeof Symbol("foo"),a=Object.prototype.toString,i=Array.prototype.concat,c=Object.defineProperty,s=c&&function(){var e={};try{for(var t in c(e,"x",{enumerable:!1,value:e}),e)return!1;return e.x===e}catch(e){return!1}}(),l=function(e,t,n,r){var o;(!(t in e)||"function"==typeof(o=r)&&"[object Function]"===a.call(o)&&r())&&(s?c(e,t,{configurable:!0,enumerable:!1,value:n,writable:!0}):e[t]=n)},u=function(e,t){var n=arguments.length>2?arguments[2]:{},a=r(t);o&&(a=i.call(a,Object.getOwnPropertySymbols(t)));for(var c=0;c<a.length;c+=1)l(e,a[c],t[a[c]],n[a[c]])};u.supportsDescriptors=!!s,e.exports=u},function(e,t){var n={}.hasOwnProperty;e.exports=function(e,t){return n.call(e,t)}},function(e,t,n){var r=n(31),o=n(704),a=n(705);e.exports={momentObj:a.createMomentChecker("object",(function(e){return"object"==typeof e}),(function(e){return o.isValidMoment(e)}),"Moment"),momentString:a.createMomentChecker("string",(function(e){return"string"==typeof e}),(function(e){return o.isValidMoment(r(e))}),"Moment"),momentDurationObj:a.createMomentChecker("object",(function(e){return"object"==typeof e}),(function(e){return r.isDuration(e)}),"Duration")}},,function(e,t,n){"use strict";n.d(t,"a",(function(){return u}));var r=n(7),o=n(31),a=n.n(o),i=n(69),c=n(65),s=(n(180),n(40));n(221),n(82);const l=["stock","customers"];function u(e){const{query:t,tableQuery:n={}}=e,o=function(e){const{endpoint:t,query:n,limitBy:o,filters:s=[],advancedFilters:l={}}=e;return n.search?(o||[t]).reduce((e,t)=>(e[t]=n[t],e),{}):s.map(e=>function(e,t,n){const o=n[e.param];if(!o)return{};if("advanced"===o){const e=Object(c.c)(n,t.filters);if(0===e.length)return{};const o=Object(c.j)(e.map(e=>function(e,t){const n=e.filters[t.key];if("Date"!==Object(r.get)(n,["input","component"]))return t;const{rule:o,value:c}=t,s={after:"start",before:"end"};if(Array.isArray(c)){const[e,n]=c;return Object.assign({},t,{value:[Object(i.a)(a()(e),s.after),Object(i.a)(a()(n),s.before)]})}return Object.assign({},t,{value:Object(i.a)(a()(c),s[o])})}(t,e)),{},t.filters);return{match:n.match||"all",...o}}const s=Object(r.find)(Object(c.b)(e.filters),{value:o});if(!s)return{};if(s.settings&&s.settings.param){const{param:e}=s.settings;return n[e]?{[e]:n[e]}:{}}return{[e.param]:o}}(e,l,n)).reduce((e,t)=>Object.assign(e,t),{})}(e),u=Object(i.c)(t,e.defaultDateRange),d=Object(r.includes)(l,e.endpoint);return{orderby:t.orderby||"date",order:t.order||"desc",after:d?void 0:Object(i.a)(u.primary.after,"start"),before:d?void 0:Object(i.a)(u.primary.before,"end"),page:t.paged||1,per_page:t.per_page||s.d.pageSize,...o,...n}}Object(r.memoize)((e,t,n)=>({isEmpty:!1,isError:!1,isRequesting:!1,data:{totals:t,intervals:n}}),(e,t,n)=>[e,t.length,n.length].join(":"))},function(e,t,n){"use strict";var r=n(643),o=n(644),a=n(333);e.exports={formats:a,parse:o,stringify:r}},function(e,t,n){"use strict";var r=n(51),o=n(61),a=n(0),i=n(6),c=n.n(i),s=n(7),l=n(56),u=n.n(l),d=n(98),f=n(99),p=n(100),h=n(101),m=n(70),y=n(105),b=n(74),g=n(46),v=n(21),O=n(878),w=n(94);function _(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function k(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?_(Object(n),!0).forEach((function(t){Object(w.a)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):_(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function S(e,t,n,r,o,a,i){var c=t.width,s="rtl"===document.documentElement.dir;"left"===n&&s?n="right":"right"===n&&s&&(n="left"),"left"===r&&s?r="right":"right"===r&&s&&(r="left");var l=Math.round(e.left+e.width/2),u={popoverLeft:l,contentWidth:(l-c/2>0?c/2:l)+(l+c/2>window.innerWidth?window.innerWidth-l:c/2)},d=e.left;"right"===r?d=e.right:"middle"!==a&&(d=l);var f=e.right;"left"===r?f=e.left:"middle"!==a&&(f=l);var p,h={popoverLeft:d,contentWidth:d-c>0?c:d},m={popoverLeft:f,contentWidth:f+c>window.innerWidth?window.innerWidth-f:c},y=n,b=null;if(!o)if("center"===n&&u.contentWidth===c)y="center";else if("left"===n&&h.contentWidth===c)y="left";else if("right"===n&&m.contentWidth===c)y="right";else{var g="left"==(y=h.contentWidth>m.contentWidth?"left":"right")?h.contentWidth:m.contentWidth;b=g!==c?g:null}if(p="center"===y?u.popoverLeft:"left"===y?h.popoverLeft:m.popoverLeft,i){var v=i.getBoundingClientRect();p=Math.min(p,v.right-c)}return{xAxis:y,popoverLeft:p,contentWidth:b}}function j(e,t,n,r,o,a,i){var c=t.height;if(o){var s=(Object(b.getScrollContainer)(a)||document.body).getBoundingClientRect().top+c-i;if(e.top<=s)return{yAxis:n,popoverTop:Math.min(e.bottom,s)}}var l=e.top+e.height/2;"bottom"===r?l=e.bottom:"top"===r&&(l=e.top);var u={popoverTop:l,contentHeight:(l-c/2>0?c/2:l)+(l+c/2>window.innerHeight?window.innerHeight-l:c/2)},d={popoverTop:e.top,contentHeight:e.top-10-c>0?c:e.top-10},f={popoverTop:e.bottom,contentHeight:e.bottom+10+c>window.innerHeight?window.innerHeight-10-e.bottom:c},p=n,h=null;if(!o)if("middle"===n&&u.contentHeight===c)p="middle";else if("top"===n&&d.contentHeight===c)p="top";else if("bottom"===n&&f.contentHeight===c)p="bottom";else{var m="top"==(p=d.contentHeight>f.contentHeight?"top":"bottom")?d.contentHeight:f.contentHeight;h=m!==c?m:null}return{yAxis:p,popoverTop:"middle"===p?u.popoverTop:"top"===p?d.popoverTop:f.popoverTop,contentHeight:h}}var E=n(160),C=n(79);var D=Object(a.createContext)({focusHistory:[]}),P=D.Provider,x=D.Consumer;P.displayName="FocusReturnProvider",x.displayName="FocusReturnConsumer",a.Component;var F=Object(v.createHigherOrderComponent)((function e(t){if((r=t)instanceof a.Component||"function"==typeof r){var n=t;return e({})(n)}var r,o=t.onFocusReturn,i=void 0===o?s.stubTrue:o;return function(e){var t=function(t){Object(p.a)(c,t);var n,r,o=(n=c,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=Object(m.a)(n);if(r){var o=Object(m.a)(this).constructor;e=Reflect.construct(t,arguments,o)}else e=t.apply(this,arguments);return Object(h.a)(this,e)});function c(){var e;return Object(d.a)(this,c),(e=o.apply(this,arguments)).ownFocusedElements=new Set,e.activeElementOnMount=document.activeElement,e.setIsFocusedFalse=function(){return e.isFocused=!1},e.setIsFocusedTrue=function(t){e.ownFocusedElements.add(t.target),e.isFocused=!0},e}return Object(f.a)(c,[{key:"componentWillUnmount",value:function(){var e=this.activeElementOnMount,t=this.isFocused,n=this.ownFocusedElements;if(t&&!1!==i())for(var r,o=[].concat(Object(E.a)(s.without.apply(void 0,[this.props.focus.focusHistory].concat(Object(E.a)(n)))),[e]);r=o.pop();)if(document.body.contains(r))return void r.focus()}},{key:"render",value:function(){return Object(a.createElement)("div",{onFocus:this.setIsFocusedTrue,onBlur:this.setIsFocusedFalse},Object(a.createElement)(e,this.props.childProps))}}]),c}(a.Component);return function(e){return Object(a.createElement)(x,null,(function(n){return Object(a.createElement)(t,{childProps:e,focus:n})}))}}}),"withFocusReturn");var T=Object(v.createHigherOrderComponent)((function(e){return function(t){Object(p.a)(i,t);var n,r,o=(n=i,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=Object(m.a)(n);if(r){var o=Object(m.a)(this).constructor;e=Reflect.construct(t,arguments,o)}else e=t.apply(this,arguments);return Object(h.a)(this,e)});function i(){var e;return Object(d.a)(this,i),(e=o.apply(this,arguments)).focusContainRef=Object(a.createRef)(),e.handleTabBehaviour=e.handleTabBehaviour.bind(Object(C.a)(e)),e}return Object(f.a)(i,[{key:"handleTabBehaviour",value:function(e){if(e.keyCode===g.TAB){var t=b.focus.tabbable.find(this.focusContainRef.current);if(t.length){var n=t[0],r=t[t.length-1];e.shiftKey&&e.target===n?(e.preventDefault(),r.focus()):(e.shiftKey||e.target!==r)&&t.includes(e.target)||(e.preventDefault(),n.focus())}}}},{key:"render",value:function(){return Object(a.createElement)("div",{onKeyDown:this.handleTabBehaviour,ref:this.focusContainRef,tabIndex:"-1"},Object(a.createElement)(e,this.props))}}]),i}(a.Component)}),"withConstrainedTabbing"),M=n(315);var R=function(e){Object(p.a)(o,e);var t,n,r=(t=o,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=Object(m.a)(t);if(n){var o=Object(m.a)(this).constructor;e=Reflect.construct(r,arguments,o)}else e=r.apply(this,arguments);return Object(h.a)(this,e)});function o(){return Object(d.a)(this,o),r.apply(this,arguments)}return Object(f.a)(o,[{key:"handleFocusOutside",value:function(e){this.props.onFocusOutside(e)}},{key:"render",value:function(){return this.props.children}}]),o}(a.Component),I=Object(M.a)(R);function A(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Object(m.a)(e);if(t){var o=Object(m.a)(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Object(h.a)(this,n)}}var N=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.htmlDocument,n=void 0===t?document:t,r=e.className,o=void 0===r?"lockscroll":r,i=0,c=0;function s(e){var t=n.scrollingElement||n.body;e&&(c=t.scrollTop);var r=e?"add":"remove";t.classList[r](o),n.documentElement.classList[r](o),e||(t.scrollTop=c)}function l(){0===i&&s(!0),++i}function u(){1===i&&s(!1),--i}return function(e){Object(p.a)(n,e);var t=A(n);function n(){return Object(d.a)(this,n),t.apply(this,arguments)}return Object(f.a)(n,[{key:"componentDidMount",value:function(){l()}},{key:"componentWillUnmount",value:function(){u()}},{key:"render",value:function(){return null}}]),n}(a.Component)}();function L(e){e.stopPropagation()}var U=Object(a.forwardRef)((function(e,t){var n=e.children,i=Object(o.a)(e,["children"]);return Object(a.createElement)("div",Object(r.a)({},i,{ref:t,onMouseDown:L}),n)})),B=n(238);function H(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function q(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?H(Object(n),!0).forEach((function(t){Object(w.a)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):H(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function z(e){var t=Object(a.useContext)(B.a),n=t.slots[e]||{},r=t.fills[e],o=Object(a.useMemo)((function(){return r||[]}),[r]),i=Object(a.useCallback)((function(n){t.updateSlot(e,n)}),[e,t.updateSlot]),c=Object(a.useCallback)((function(n){t.unregisterSlot(e,n)}),[e,t.unregisterSlot]),s=Object(a.useCallback)((function(n){t.registerFill(e,n)}),[e,t.registerFill]),l=Object(a.useCallback)((function(n){t.unregisterFill(e,n)}),[e,t.unregisterFill]);return q(q({},n),{},{updateSlot:i,unregisterSlot:c,fills:o,registerFill:s,unregisterFill:l})}function V(e,t,n){return(V="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var r=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=Object(m.a)(e)););return e}(e,t);if(r){var o=Object.getOwnPropertyDescriptor(r,t);return o.get?o.get.call(n):o.value}})(e,t,n||e)}n(34);var K=Object(a.createContext)({registerSlot:function(){},unregisterSlot:function(){},registerFill:function(){},unregisterFill:function(){},getSlot:function(){},getFills:function(){},subscribe:function(){}}),W=(K.Provider,K.Consumer);a.Component;var G=function(e){Object(p.a)(o,e);var t,n,r=(t=o,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=Object(m.a)(t);if(n){var o=Object(m.a)(this).constructor;e=Reflect.construct(r,arguments,o)}else e=r.apply(this,arguments);return Object(h.a)(this,e)});function o(){var e;return Object(d.a)(this,o),(e=r.apply(this,arguments)).isUnmounted=!1,e.bindNode=e.bindNode.bind(Object(C.a)(e)),e}return Object(f.a)(o,[{key:"componentDidMount",value:function(){(0,this.props.registerSlot)(this.props.name,this)}},{key:"componentWillUnmount",value:function(){var e=this.props.unregisterSlot;this.isUnmounted=!0,e(this.props.name,this)}},{key:"componentDidUpdate",value:function(e){var t=this.props,n=t.name,r=t.unregisterSlot,o=t.registerSlot;e.name!==n&&(r(e.name),o(n,this))}},{key:"bindNode",value:function(e){this.node=e}},{key:"forceUpdate",value:function(){this.isUnmounted||V(Object(m.a)(o.prototype),"forceUpdate",this).call(this)}},{key:"render",value:function(){var e=this.props,t=e.children,n=e.name,r=e.fillProps,o=void 0===r?{}:r,i=e.getFills,c=Object(s.map)(i(n,this),(function(e){var t=e.occurrence,n=Object(s.isFunction)(e.children)?e.children(o):e.children;return a.Children.map(n,(function(e,n){if(!e||Object(s.isString)(e))return e;var r="".concat(t,"---").concat(e.key||n);return Object(a.cloneElement)(e,{key:r})}))})).filter(Object(s.negate)(a.isEmptyElement));return Object(a.createElement)(a.Fragment,null,Object(s.isFunction)(t)?t(c):c)}}]),o}(a.Component),Y=function(e){return Object(a.createElement)(W,null,(function(t){var n=t.registerSlot,o=t.unregisterSlot,i=t.getFills;return Object(a.createElement)(G,Object(r.a)({},e,{registerSlot:n,unregisterSlot:o,getFills:i}))}))},$=0;function Q(e){var t=e.name,n=e.children,r=e.registerFill,o=e.unregisterFill,i=function(e){var t=Object(a.useContext)(K),n=t.getSlot,r=t.subscribe,o=Object(a.useState)(n(e)),i=Object(y.a)(o,2),c=i[0],s=i[1];return Object(a.useEffect)((function(){return s(n(e)),r((function(){s(n(e))}))}),[e]),c}(t),c=Object(a.useRef)({name:t,children:n});return c.current.occurrence||(c.current.occurrence=++$),Object(a.useLayoutEffect)((function(){return r(t,c.current),function(){return o(t,c.current)}}),[]),Object(a.useLayoutEffect)((function(){c.current.children=n,i&&i.forceUpdate()}),[n]),Object(a.useLayoutEffect)((function(){t!==c.current.name&&(o(c.current.name,c.current),c.current.name=t,r(t,c.current))}),[t]),i&&i.node?(Object(s.isFunction)(n)&&(n=n(i.props.fillProps)),Object(a.createPortal)(n,i.node)):null}var J=function(e){return Object(a.createElement)(W,null,(function(t){var n=t.registerFill,o=t.unregisterFill;return Object(a.createElement)(Q,Object(r.a)({},e,{registerFill:n,unregisterFill:o}))}))};function Z(e){var t=e.name,n=e.fillProps,i=void 0===n?{}:n,c=e.as,s=void 0===c?"div":c,l=Object(o.a)(e,["name","fillProps","as"]),u=Object(a.useContext)(B.a),d=Object(a.useRef)();return Object(a.useLayoutEffect)((function(){return u.registerSlot(t,d,i),function(){u.unregisterSlot(t,d)}}),[u.registerSlot,u.unregisterSlot,t]),Object(a.useLayoutEffect)((function(){u.updateSlot(t,i)})),Object(a.createElement)(s,Object(r.a)({ref:d},l))}function X(e){var t,n,r=e.name,o=e.children,i=z(r),c=Object(a.useRef)({rerender:(t=Object(a.useState)({}),n=Object(y.a)(t,2)[1],function(){return n({})})});return Object(a.useEffect)((function(){return i.registerFill(c),function(){i.unregisterFill(c)}}),[i.registerFill,i.unregisterFill]),i.ref&&i.ref.current?("function"==typeof o&&(o=o(i.fillProps)),Object(a.createPortal)(o,i.ref.current)):null}function ee(e){var t=e.bubblesVirtually,n=Object(o.a)(e,["bubblesVirtually"]);return t?Object(a.createElement)(Z,n):Object(a.createElement)(Y,n)}function te(e){return Object(a.createElement)(a.Fragment,null,Object(a.createElement)(J,e),Object(a.createElement)(X,e))}function ne(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function re(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ne(Object(n),!0).forEach((function(t){Object(w.a)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ne(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function oe(e){var t=e.type,n=e.origin,r=void 0===n?function(e){return"appear"===e?"top":"left"}(t):n;if("appear"===t){var o,a=r.split(" "),i=Object(y.a)(a,2),s=i[0],l=i[1],u=void 0===l?"center":l;return c()("components-animate__appear",(o={},Object(w.a)(o,"is-from-"+u,"center"!==u),Object(w.a)(o,"is-from-"+s,"middle"!==s),o))}return"slide-in"===t?c()("components-animate__slide-in","is-from-"+r):"loading"===t?c()("components-animate__loading"):void 0}function ae(e){var t=e.type,n=e.options,r=void 0===n?{}:n;return(0,e.children)({className:oe(re({type:t},r))})}var ie=T(F((function(e){return e.children})));function ce(e,t){var n,r=(n=t).ownerDocument.defaultView.getComputedStyle(n),o=r.paddingTop,a=r.paddingBottom,i=r.paddingLeft,c=r.paddingRight,s=o?parseInt(o,10):0,l=a?parseInt(a,10):0,u=i?parseInt(i,10):0,d=c?parseInt(c,10):0;return{x:e.left+u,y:e.top+s,width:e.width-u-d,height:e.height-s-l,left:e.left+u,right:e.right-d,top:e.top+s,bottom:e.bottom-l}}function se(e,t,n){n?e.getAttribute(t)!==n&&e.setAttribute(t,n):e.hasAttribute(t)&&e.removeAttribute(t)}function le(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";e.style[t]!==n&&(e.style[t]=n)}function ue(e,t,n){n?e.classList.contains(t)||e.classList.add(t):e.classList.contains(t)&&e.classList.remove(t)}var de=function(e){var t=e.headerTitle,n=e.onClose,i=e.onKeyDown,s=e.children,l=e.className,d=e.noArrow,f=void 0===d||d,p=e.isAlternate,h=e.position,m=void 0===h?"bottom right":h,w=(e.range,e.focusOnMount),_=void 0===w?"firstElement":w,E=e.anchorRef,C=e.shouldAnchorIncludePadding,D=e.anchorRect,P=e.getAnchorRect,x=e.expandOnMobile,F=e.animate,T=void 0===F||F,M=e.onClickOutside,R=e.onFocusOutside,A=e.__unstableSticky,L=e.__unstableSlotName,B=void 0===L?"Popover":L,H=e.__unstableObserveElement,q=e.__unstableBoundaryParent,V=Object(o.a)(e,["headerTitle","onClose","onKeyDown","children","className","noArrow","isAlternate","position","range","focusOnMount","anchorRef","shouldAnchorIncludePadding","anchorRect","getAnchorRect","expandOnMobile","animate","onClickOutside","onFocusOutside","__unstableSticky","__unstableSlotName","__unstableObserveElement","__unstableBoundaryParent"]),K=Object(a.useRef)(null),W=Object(a.useRef)(null),G=Object(a.useRef)(),Y=Object(v.useViewportMatch)("medium","<"),$=Object(a.useState)(),Q=Object(y.a)($,2),J=Q[0],Z=Q[1],X=z(B),ee=x&&Y,ne=Object(v.useResizeObserver)(),re=Object(y.a)(ne,2),oe=re[0],de=re[1];f=ee||f,Object(a.useLayoutEffect)((function(){if(ee)return ue(G.current,"is-without-arrow",f),ue(G.current,"is-alternate",p),se(G.current,"data-x-axis"),se(G.current,"data-y-axis"),le(G.current,"top"),le(G.current,"left"),le(W.current,"maxHeight"),void le(W.current,"maxWidth");var e=function(){if(G.current&&W.current){var e=function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],o=arguments.length>4?arguments[4]:void 0;if(t)return t;if(n){if(!e.current)return;return n(e.current)}if(!1!==r){if(!(r&&window.Range&&window.Element&&window.DOMRect))return;if(r instanceof window.Range)return Object(b.getRectangleFromRange)(r);if(r instanceof window.Element){var a=r.getBoundingClientRect();return o?a:ce(a,r)}var i=r.top,c=r.bottom,s=i.getBoundingClientRect(),l=c.getBoundingClientRect(),u=new window.DOMRect(s.left,s.top,s.width,l.bottom-s.top);return o?u:ce(u,r)}if(e.current){var d=e.current.parentNode,f=d.getBoundingClientRect();return o?f:ce(f,d)}}(K,D,P,E,C);if(e){var t,n,r=G.current,o=r.offsetParent,a=r.ownerDocument,i=0;if(o&&o!==a.body){var c=o.getBoundingClientRect();i=c.top,e=new window.DOMRect(e.left-c.left,e.top-c.top,e.width,e.height)}q&&(t=null===(n=G.current.closest(".popover-slot"))||void 0===n?void 0:n.parentNode);var s=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"top",r=arguments.length>3?arguments[3]:void 0,o=arguments.length>4?arguments[4]:void 0,a=arguments.length>5?arguments[5]:void 0,i=arguments.length>6?arguments[6]:void 0,c=n.split(" "),s=Object(y.a)(c,3),l=s[0],u=s[1],d=void 0===u?"center":u,f=s[2],p=j(e,t,l,f,r,o,a),h=S(e,t,d,f,r,p.yAxis,i);return k(k({},h),p)}(e,de.height?de:W.current.getBoundingClientRect(),m,A,G.current,i,t),l=s.popoverTop,u=s.popoverLeft,d=s.xAxis,h=s.yAxis,g=s.contentHeight,v=s.contentWidth;"number"==typeof l&&"number"==typeof u&&(le(G.current,"top",l+"px"),le(G.current,"left",u+"px")),ue(G.current,"is-without-arrow",f||"center"===d&&"middle"===h),ue(G.current,"is-alternate",p),se(G.current,"data-x-axis",d),se(G.current,"data-y-axis",h),le(W.current,"maxHeight","number"==typeof g?g+"px":""),le(W.current,"maxWidth","number"==typeof v?v+"px":""),Z(({left:"right",right:"left"}[d]||"center")+" "+({top:"bottom",bottom:"top"}[h]||"middle"))}}};e();var t,n,r=window.setInterval(e,500),o=function(){window.cancelAnimationFrame(t),t=window.requestAnimationFrame(e)};return window.addEventListener("click",o),window.addEventListener("resize",e),window.addEventListener("scroll",e,!0),H&&(n=new window.MutationObserver(e)).observe(H,{attributes:!0}),function(){window.clearInterval(r),window.removeEventListener("resize",e),window.removeEventListener("scroll",e,!0),window.removeEventListener("click",o),window.cancelAnimationFrame(t),n&&n.disconnect()}}),[ee,D,P,E,C,m,de,A,H,q]),function(e,t){Object(a.useEffect)((function(){var n=setTimeout((function(){if(e&&t.current)if("firstElement"!==e)"container"===e&&t.current.focus();else{var n=b.focus.tabbable.find(t.current)[0];n?n.focus():t.current.focus()}}),0);return function(){return clearTimeout(n)}}),[])}(_,W);var fe=function(e){e.keyCode===g.ESCAPE&&n&&(e.stopPropagation(),n()),i&&i(e)},pe=Object(a.createElement)(I,{onFocusOutside:function(e){if(R)R(e);else if(M){var t;try{t=new window.MouseEvent("click")}catch(e){(t=document.createEvent("MouseEvent")).initMouseEvent("click",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null)}Object.defineProperty(t,"target",{get:function(){return e.relatedTarget}}),u()("Popover onClickOutside prop",{alternative:"onFocusOutside"}),M(t)}else n&&n()}},Object(a.createElement)(ae,{type:T&&J?"appear":null,options:{origin:J}},(function(e){var o=e.className;return Object(a.createElement)(U,Object(r.a)({className:c()("components-popover",l,o,{"is-expanded":ee,"is-without-arrow":f,"is-alternate":p})},V,{onKeyDown:fe,ref:G}),ee&&Object(a.createElement)(N,null),ee&&Object(a.createElement)("div",{className:"components-popover__header"},Object(a.createElement)("span",{className:"components-popover__header-title"},t),Object(a.createElement)(ge,{className:"components-popover__close",icon:O.a,onClick:n})),Object(a.createElement)("div",{ref:W,className:"components-popover__content",tabIndex:"-1"},Object(a.createElement)("div",{style:{position:"relative"}},oe,s)))})));return _&&(pe=Object(a.createElement)(ie,null,pe)),X.ref&&(pe=Object(a.createElement)(te,{name:B},pe)),E||D?pe:Object(a.createElement)("span",{ref:K},pe)};de.Slot=function(e){var t=e.name,n=void 0===t?"Popover":t;return Object(a.createElement)(ee,{bubblesVirtually:!0,name:n,className:"popover-slot"})};var fe=de,pe=function(e){var t,n,r=e.shortcut,o=e.className;return r?(Object(s.isString)(r)&&(t=r),Object(s.isObject)(r)&&(t=r.display,n=r.ariaLabel),Object(a.createElement)("span",{className:o,"aria-label":n},t)):null};var he=function(e){Object(p.a)(o,e);var t,n,r=(t=o,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=Object(m.a)(t);if(n){var o=Object(m.a)(this).constructor;e=Reflect.construct(r,arguments,o)}else e=r.apply(this,arguments);return Object(h.a)(this,e)});function o(){var e;return Object(d.a)(this,o),(e=r.apply(this,arguments)).delayedSetIsOver=Object(s.debounce)((function(t){return e.setState({isOver:t})}),700),e.cancelIsMouseDown=e.createSetIsMouseDown(!1),e.isInMouseDown=!1,e.state={isOver:!1},e}return Object(f.a)(o,[{key:"componentWillUnmount",value:function(){this.delayedSetIsOver.cancel(),document.removeEventListener("mouseup",this.cancelIsMouseDown)}},{key:"emitToChild",value:function(e,t){var n=this.props.children;if(1===a.Children.count(n)){var r=a.Children.only(n);"function"==typeof r.props[e]&&r.props[e](t)}}},{key:"createToggleIsOver",value:function(e,t){var n=this;return function(r){if(n.emitToChild(e,r),!(r.currentTarget.disabled||"focus"===r.type&&n.isInMouseDown)){n.delayedSetIsOver.cancel();var o=Object(s.includes)(["focus","mouseenter"],r.type);o!==n.state.isOver&&(t?n.delayedSetIsOver(o):n.setState({isOver:o}))}}}},{key:"createSetIsMouseDown",value:function(e){var t=this;return function(n){t.emitToChild(e?"onMouseDown":"onMouseUp",n),document[e?"addEventListener":"removeEventListener"]("mouseup",t.cancelIsMouseDown),t.isInMouseDown=e}}},{key:"render",value:function(){var e=this.props,t=e.children,n=e.position,r=e.text,o=e.shortcut;if(1!==a.Children.count(t))return t;var i=a.Children.only(t),c=this.state.isOver;return Object(a.cloneElement)(i,{onMouseEnter:this.createToggleIsOver("onMouseEnter",!0),onMouseLeave:this.createToggleIsOver("onMouseLeave"),onClick:this.createToggleIsOver("onClick"),onFocus:this.createToggleIsOver("onFocus"),onBlur:this.createToggleIsOver("onBlur"),onMouseDown:this.createSetIsMouseDown(!0),children:Object(a.concatChildren)(i.props.children,c&&Object(a.createElement)(fe,{focusOnMount:!1,position:n,className:"components-tooltip","aria-hidden":"true",animate:!1,noArrow:!0},r,Object(a.createElement)(pe,{className:"components-tooltip__shortcut",shortcut:o})))})}}]),o}(a.Component),me=n(320);function ye(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var be=["onMouseDown","onClick"],ge=t.a=Object(a.forwardRef)((function(e,t){var n=e.href,i=e.target,l=e.isPrimary,d=e.isSmall,f=e.isTertiary,p=e.isPressed,h=e.isBusy,m=e.isDefault,y=e.isSecondary,b=e.isLink,g=e.isDestructive,v=e.className,O=e.disabled,w=e.icon,_=e.iconSize,k=e.showTooltip,S=e.tooltipPosition,j=e.shortcut,E=e.label,C=e.children,D=e.__experimentalIsFocusable,P=Object(o.a)(e,["href","target","isPrimary","isSmall","isTertiary","isPressed","isBusy","isDefault","isSecondary","isLink","isDestructive","className","disabled","icon","iconSize","showTooltip","tooltipPosition","shortcut","label","children","__experimentalIsFocusable"]);m&&u()("Button isDefault prop",{alternative:"isSecondary"});var x=c()("components-button",v,{"is-secondary":m||y,"is-primary":l,"is-small":d,"is-tertiary":f,"is-pressed":p,"is-busy":h,"is-link":b,"is-destructive":g,"has-text":!!w&&!!C,"has-icon":!!w}),F=O&&!D,T=void 0===n||F?"button":"a",M="a"===T?{href:n,target:i}:{type:"button",disabled:F,"aria-pressed":p};if(O&&D){M["aria-disabled"]=!0;var R,I=function(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return ye(e,void 0);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ye(e,void 0):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,i=!0,c=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return i=e.done,e},e:function(e){c=!0,a=e},f:function(){try{i||null==n.return||n.return()}finally{if(c)throw a}}}}(be);try{for(I.s();!(R=I.n()).done;)P[R.value]=function(e){e.stopPropagation(),e.preventDefault()}}catch(e){I.e(e)}finally{I.f()}}var A=!F&&(k&&E||j||!!E&&(!C||Object(s.isArray)(C)&&!C.length)&&!1!==k),N=Object(a.createElement)(T,Object(r.a)({},M,P,{className:x,"aria-label":P["aria-label"]||E,ref:t}),w&&Object(a.createElement)(me.a,{icon:w,size:_}),C);return A?Object(a.createElement)(he,{text:E,shortcut:j,position:S},N):N}))},,,function(e,t,n){"use strict";var r=n(81),o=n(245),a=o(r("String.prototype.indexOf"));e.exports=function(e,t){var n=r(e,!!t);return"function"==typeof n&&a(e,".prototype.")>-1?o(n):n}},function(e,t){e.exports=function(e){try{return!!e()}catch(e){return!0}}},function(e,t,n){var r=n(148),o=n(423),a=n(177),i=n(424),c=n(432),s=n(684),l=o("wks"),u=r.Symbol,d=s?u:u&&u.withoutSetter||i;e.exports=function(e){return a(l,e)&&(c||"string"==typeof l[e])||(c&&a(u,e)?l[e]=u[e]:l[e]=d("Symbol."+e)),l[e]}},,,,,,,,,,,,,,,function(e,t,n){"use strict";function r(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(312);function o(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,Object(r.a)(e,t)}},function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));const r="woocommerce-navigation"},,,,,,,function(e,t,n){"use strict";var r=n(328);e.exports=r.call(Function.call,Object.prototype.hasOwnProperty)},function(e,t,n){var r=n(246);e.exports=function(e){if(!r(e))throw TypeError(String(e)+" is not an object");return e}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,o=(r=n(2))&&r.__esModule?r:{default:r},a=n(77);t.default=o.default.oneOf(a.WEEKDAYS)},,,,,,function(e,t,n){"use strict";n.d(t,"a",(function(){return o})),n(69),n(242);var r=n(82);function o(e,t){const{_fields:n,page:o,per_page:a,...i}=t;return Object(r.a)("total-"+e,i)}},,function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));const r="wc/admin/reports"},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(11);function o(e,t,n){void 0===n&&(n={});var o=n.maxWait,a=Object(r.useRef)(null),i=Object(r.useRef)([]),c=n.leading,s=void 0===n.trailing||n.trailing,l=Object(r.useRef)(!1),u=Object(r.useRef)(null),d=Object(r.useRef)(!1),f=Object(r.useRef)(e);f.current=e;var p=Object(r.useCallback)((function(){clearTimeout(u.current),clearTimeout(a.current),a.current=null,i.current=[],u.current=null,l.current=!1}),[]);Object(r.useEffect)((function(){return d.current=!1,function(){d.current=!0}}),[]);var h=Object(r.useCallback)((function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];i.current=e,clearTimeout(u.current),l.current&&(l.current=!1),u.current||!c||l.current||(f.current.apply(f,e),l.current=!0),u.current=setTimeout((function(){var t=!0;c&&l.current&&(t=!1),p(),!d.current&&s&&t&&f.current.apply(f,e)}),t),o&&!a.current&&s&&(a.current=setTimeout((function(){var e=i.current;p(),d.current||f.current.apply(null,e)}),o))}),[o,t,p,c,s]),m=Object(r.useCallback)((function(){u.current&&(f.current.apply(null,i.current),p())}),[p]);return[h,p,m]}},,function(e,t,n){"use strict";e.exports=function(e){return"string"==typeof e||"symbol"==typeof e}},function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t,n){var r=n(186);e.exports=!r((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]}))},function(e,t,n){var r=n(226),o=n(247),a=n(294);e.exports=r?function(e,t,n){return o.f(e,t,a(1,n))}:function(e,t,n){return e[t]=n,e}},function(e,t,n){"use strict";var r=Object.prototype.hasOwnProperty;function o(e,t){return e===t?0!==e||0!==t||1/e==1/t:e!=e&&t!=t}function a(e,t){if(o(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;var n=Object.keys(e),a=Object.keys(t);if(n.length!==a.length)return!1;for(var i=0;i<n.length;i++)if(!r.call(t,n[i])||!o(e[n[i]],t[n[i]]))return!1;return!0}e.exports=function(e,t,n){return!a(e.props,t)||!a(e.state,n)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){return!(!o.default.isMoment(e)||!o.default.isMoment(t))&&e.date()===t.date()&&e.month()===t.month()&&e.year()===t.year()};var r,o=(r=n(31))&&r.__esModule?r:{default:r}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){var n=t?[t,a.DISPLAY_FORMAT,a.ISO_FORMAT]:[a.DISPLAY_FORMAT,a.ISO_FORMAT],r=(0,o.default)(e,n,!0);return r.isValid()?r.hour(12):null};var r,o=(r=n(31))&&r.__esModule?r:{default:r},a=n(77)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,o=(r=n(2))&&r.__esModule?r:{default:r},a=n(77);t.default=o.default.oneOf([a.HORIZONTAL_ORIENTATION,a.VERTICAL_ORIENTATION,a.VERTICAL_SCROLLABLE])},function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){return!("undefined"==typeof window||!("ontouchstart"in window||window.DocumentTouch&&"undefined"!=typeof document&&document instanceof window.DocumentTouch))||!("undefined"==typeof navigator||!navigator.maxTouchPoints&&!navigator.msMaxTouchPoints)},e.exports=t.default},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,o=(r=n(2))&&r.__esModule?r:{default:r},a=n(77);t.default=o.default.oneOf([a.OPEN_DOWN,a.OPEN_UP])},,,function(e,t,n){function r(e){for(var t,n,r=[],o=0;o<rowCut.length;o++)(t=rowCut.substring(o).match(/^&[a-z0-9#]+;/))?(n=t[0],r.push(n),o+=n.length-1):r.push(rowCut[o]);return r}e.exports&&(e.exports=function(e,t){for(var n,o,a,i,c,s=(t=t||{}).limit||100,l=void 0===t.preserveTags||t.preserveTags,u=void 0!==t.wordBreak&&t.wordBreak,d=t.suffix||"...",f=t.moreLink||"",p=t.moreText||"»",h=t.preserveWhiteSpace||!1,m=e.replace(/</g,"\n<").replace(/>/g,">\n").replace(/\n\n/g,"\n").replace(/^\n/g,"").replace(/\n$/g,"").split("\n"),y=0,b=[],g=!1,v=0;v<m.length;v++)if(n=m[v],rowCut=h?n:n.replace(/[ ]+/g," "),n.length){var O=r(rowCut);if("<"!==n[0])if(y>=s)n="";else if(y+O.length>=s){if(" "===O[(o=s-y)-1])for(;o&&" "===O[(o-=1)-1];);else a=O.slice(o).indexOf(" "),u||(-1!==a?o+=a:o=n.length);n=O.slice(0,o).join("")+d,f&&(n+='<a href="'+f+'" style="display:inline">'+p+"</a>"),y=s,g=!0}else y+=O.length;else if(l){if(y>=s)if(c=(i=n.match(/[a-zA-Z]+/))?i[0]:"")if("</"!==n.substring(0,2))b.push(c),n="";else{for(;b[b.length-1]!==c&&b.length;)b.pop();b.length&&(n=""),b.pop()}else n=""}else n="";m[v]=n}return{html:m.join("\n").replace(/\n/g,""),more:g}})},,function(e,t,n){"use strict";(function(e){var r=n(0),o=(n(191),Object(r.createContext)({slots:{},fills:{},registerSlot:function(){void 0!==e&&e.env},updateSlot:function(){},unregisterSlot:function(){},registerFill:function(){},unregisterFill:function(){}}));t.a=o}).call(this,n(485))},function(e,t,n){"use strict";n.d(t,"b",(function(){return i})),n.d(t,"c",(function(){return c})),n.d(t,"a",(function(){return s}));var r=n(95),o=n(80),a={name:"8kj89b",styles:"flex-direction:row-reverse;"},i=Object(r.a)("div",{target:"eboqfv50",label:"Flex"})("box-sizing:border-box;display:flex;width:100%;",(function(e){var t=e.align,n={top:"flex-start",bottom:"flex-end"}[t]||t;return Object(o.b)({alignItems:n},"")})," ",(function(e){var t=e.justify,n=e.isReversed,r={left:"flex-start",right:"flex-end"},a=r[t]||t;return n&&r[t]&&(a="left"===t?r.right:r.left),Object(o.b)({justifyContent:a},"")})," ",(function(e){var t=e.gap,n=e.isReversed,r="number"==typeof t?4*t:4,a="margin-".concat(n?"left":"right");return Object(o.b)("> *{",a,":",r,"px;&:last-child{",a,":0;}}")})," ",(function(e){return e.isReversed?a:""}),""),c=Object(r.a)("div",{target:"eboqfv51",label:"Item"})({name:"13luw5d",styles:"box-sizing:border-box;min-width:0;max-width:100%;"}),s=Object(r.a)(c,{target:"eboqfv52",label:"Block"})({name:"1rr4qq7",styles:"flex:1;"})},function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));const r="wc/admin/options"},function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));const r="wc/admin/onboarding"},function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));const r="wc/admin/items"},function(e,t,n){"use strict";function r(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}function o(){return(o=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function a(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function i(e,t){return(i=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}n.d(t,"a",(function(){return H}));var c=n(2),s=n.n(c),l=n(11);function u(e){return"object"==typeof e&&null!=e&&1===e.nodeType}function d(e,t){return(!t||"hidden"!==e)&&"visible"!==e&&"clip"!==e}function f(e,t){if(e.clientHeight<e.scrollHeight||e.clientWidth<e.scrollWidth){var n=getComputedStyle(e,null);return d(n.overflowY,t)||d(n.overflowX,t)||function(e){var t=function(e){if(!e.ownerDocument||!e.ownerDocument.defaultView)return null;try{return e.ownerDocument.defaultView.frameElement}catch(e){return null}}(e);return!!t&&(t.clientHeight<e.scrollHeight||t.clientWidth<e.scrollWidth)}(e)}return!1}function p(e,t,n,r,o,a,i,c){return a<e&&i>t||a>e&&i<t?0:a<=e&&c<=n||i>=t&&c>=n?a-e-r:i>t&&c<n||a<e&&c>n?i-t+o:0}n(368);var h=function(){return(h=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};Object.create,Object.create;var m=0;function y(e){return"function"==typeof e?e:b}function b(){}function g(e,t){e&&function(e,t){var n=window,r=t.scrollMode,o=t.block,a=t.inline,i=t.boundary,c=t.skipOverflowHiddenElements,s="function"==typeof i?i:function(e){return e!==i};if(!u(e))throw new TypeError("Invalid target");for(var l=document.scrollingElement||document.documentElement,d=[],h=e;u(h)&&s(h);){if((h=h.parentElement)===l){d.push(h);break}null!=h&&h===document.body&&f(h)&&!f(document.documentElement)||null!=h&&f(h,c)&&d.push(h)}for(var m=n.visualViewport?n.visualViewport.width:innerWidth,y=n.visualViewport?n.visualViewport.height:innerHeight,b=window.scrollX||pageXOffset,g=window.scrollY||pageYOffset,v=e.getBoundingClientRect(),O=v.height,w=v.width,_=v.top,k=v.right,S=v.bottom,j=v.left,E="start"===o||"nearest"===o?_:"end"===o?S:_+O/2,C="center"===a?j+w/2:"end"===a?k:j,D=[],P=0;P<d.length;P++){var x=d[P],F=x.getBoundingClientRect(),T=F.height,M=F.width,R=F.top,I=F.right,A=F.bottom,N=F.left;if("if-needed"===r&&_>=0&&j>=0&&S<=y&&k<=m&&_>=R&&S<=A&&j>=N&&k<=I)return D;var L=getComputedStyle(x),U=parseInt(L.borderLeftWidth,10),B=parseInt(L.borderTopWidth,10),H=parseInt(L.borderRightWidth,10),q=parseInt(L.borderBottomWidth,10),z=0,V=0,K="offsetWidth"in x?x.offsetWidth-x.clientWidth-U-H:0,W="offsetHeight"in x?x.offsetHeight-x.clientHeight-B-q:0;if(l===x)z="start"===o?E:"end"===o?E-y:"nearest"===o?p(g,g+y,y,B,q,g+E,g+E+O,O):E-y/2,V="start"===a?C:"center"===a?C-m/2:"end"===a?C-m:p(b,b+m,m,U,H,b+C,b+C+w,w),z=Math.max(0,z+g),V=Math.max(0,V+b);else{z="start"===o?E-R-B:"end"===o?E-A+q+W:"nearest"===o?p(R,A,T,B,q+W,E,E+O,O):E-(R+T/2)+W/2,V="start"===a?C-N-U:"center"===a?C-(N+M/2)+K/2:"end"===a?C-I+H+K:p(N,I,M,U,H+K,C,C+w,w);var G=x.scrollLeft,Y=x.scrollTop;E+=Y-(z=Math.max(0,Math.min(Y+z,x.scrollHeight-T+W))),C+=G-(V=Math.max(0,Math.min(G+V,x.scrollWidth-M+K)))}D.push({el:x,top:z,left:V})}return D}(e,{boundary:t,block:"nearest",scrollMode:"if-needed"}).forEach((function(e){var t=e.el,n=e.top,r=e.left;t.scrollTop=n,t.scrollLeft=r}))}function v(e,t,n){return e===t||t instanceof n.Node&&e.contains&&e.contains(t)}function O(e,t){var n;function r(){n&&clearTimeout(n)}function o(){for(var o=arguments.length,a=new Array(o),i=0;i<o;i++)a[i]=arguments[i];r(),n=setTimeout((function(){n=null,e.apply(void 0,a)}),t)}return o.cancel=r,o}function w(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return t.some((function(t){return t&&t.apply(void 0,[e].concat(r)),e.preventDownshiftDefault||e.hasOwnProperty("nativeEvent")&&e.nativeEvent.preventDownshiftDefault}))}}function _(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(e){t.forEach((function(t){"function"==typeof t?t(e):t&&(t.current=e)}))}}function k(e){var t=e.isOpen,n=e.resultCount,r=e.previousResultCount;return t?n?n!==r?n+" result"+(1===n?" is":"s are")+" available, use up and down arrow keys to navigate. Press Enter key to select.":"":"No results are available.":""}function S(e,t){return!(e=Array.isArray(e)?e[0]:e)&&t?t:e}var j=["highlightedIndex","inputValue","isOpen","selectedItem","type"];function E(e){void 0===e&&(e={});var t={};return j.forEach((function(n){e.hasOwnProperty(n)&&(t[n]=e[n])})),t}function C(e,t){return void 0!==e[t]}function D(e){var t=e.key,n=e.keyCode;return n>=37&&n<=40&&0!==t.indexOf("Arrow")?"Arrow"+t:t}function P(e,t,n,r,o){if(void 0===o&&(o=!0),0===n)return-1;var a=n-1;("number"!=typeof t||t<0||t>=n)&&(t=e>0?-1:a+1);var i=t+e;i<0?i=o?a:0:i>a&&(i=o?0:a);var c=x(e,i,n,r,o);return-1===c?t>=n?-1:t:c}function x(e,t,n,r,o){var a=r(t);if(!a||!a.hasAttribute("disabled"))return t;if(e>0){for(var i=t+1;i<n;i++)if(!r(i).hasAttribute("disabled"))return i}else for(var c=t-1;c>=0;c--)if(!r(c).hasAttribute("disabled"))return c;return o?e>0?x(1,0,n,r,!1):x(-1,n-1,n,r,!1):-1}function F(e,t,n,r){return void 0===r&&(r=!0),t.some((function(t){return t&&(v(t,e,n)||r&&v(t,n.document.activeElement,n))}))}var T=O((function(e){R(e).textContent=""}),500);function M(e,t){var n=R(t);e&&(n.textContent=e,T(t))}function R(e){void 0===e&&(e=document);var t=e.getElementById("a11y-status-message");return t||((t=e.createElement("div")).setAttribute("id","a11y-status-message"),t.setAttribute("role","status"),t.setAttribute("aria-live","polite"),t.setAttribute("aria-relevant","additions text"),Object.assign(t.style,{border:"0",clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:"0",position:"absolute",width:"1px"}),e.body.appendChild(t),t)}var I=Object.freeze({__proto__:null,unknown:0,mouseUp:1,itemMouseEnter:2,keyDownArrowUp:3,keyDownArrowDown:4,keyDownEscape:5,keyDownEnter:6,keyDownHome:7,keyDownEnd:8,clickItem:9,blurInput:10,changeInput:11,keyDownSpaceButton:12,clickButton:13,blurButton:14,controlledPropUpdatedSelectedItem:15,touchEnd:16}),A=["refKey","ref"],N=["onClick","onPress","onKeyDown","onKeyUp","onBlur"],L=["onKeyDown","onBlur","onChange","onInput","onChangeText"],U=["refKey","ref"],B=["onMouseMove","onMouseDown","onClick","onPress","index","item"],H=function(){var e=function(e){var t,n;function c(t){var n;(n=e.call(this,t)||this).id=n.props.id||"downshift-"+String(m++),n.menuId=n.props.menuId||n.id+"-menu",n.labelId=n.props.labelId||n.id+"-label",n.inputId=n.props.inputId||n.id+"-input",n.getItemId=n.props.getItemId||function(e){return n.id+"-item-"+e},n.input=null,n.items=[],n.itemCount=null,n.previousResultCount=0,n.timeoutIds=[],n.internalSetTimeout=function(e,t){var r=setTimeout((function(){n.timeoutIds=n.timeoutIds.filter((function(e){return e!==r})),e()}),t);n.timeoutIds.push(r)},n.setItemCount=function(e){n.itemCount=e},n.unsetItemCount=function(){n.itemCount=null},n.setHighlightedIndex=function(e,t){void 0===e&&(e=n.props.defaultHighlightedIndex),void 0===t&&(t={}),t=E(t),n.internalSetState(o({highlightedIndex:e},t))},n.clearSelection=function(e){n.internalSetState({selectedItem:null,inputValue:"",highlightedIndex:n.props.defaultHighlightedIndex,isOpen:n.props.defaultIsOpen},e)},n.selectItem=function(e,t,r){t=E(t),n.internalSetState(o({isOpen:n.props.defaultIsOpen,highlightedIndex:n.props.defaultHighlightedIndex,selectedItem:e,inputValue:n.props.itemToString(e)},t),r)},n.selectItemAtIndex=function(e,t,r){var o=n.items[e];null!=o&&n.selectItem(o,t,r)},n.selectHighlightedItem=function(e,t){return n.selectItemAtIndex(n.getState().highlightedIndex,e,t)},n.internalSetState=function(e,t){var r,a,i={},c="function"==typeof e;return!c&&e.hasOwnProperty("inputValue")&&n.props.onInputValueChange(e.inputValue,o({},n.getStateAndHelpers(),e)),n.setState((function(t){t=n.getState(t);var s=c?e(t):e;s=n.props.stateReducer(t,s),r=s.hasOwnProperty("selectedItem");var l={},u={};return r&&s.selectedItem!==t.selectedItem&&(a=s.selectedItem),s.type=s.type||0,Object.keys(s).forEach((function(e){t[e]!==s[e]&&(i[e]=s[e]),"type"!==e&&(u[e]=s[e],C(n.props,e)||(l[e]=s[e]))})),c&&s.hasOwnProperty("inputValue")&&n.props.onInputValueChange(s.inputValue,o({},n.getStateAndHelpers(),s)),l}),(function(){y(t)(),Object.keys(i).length>1&&n.props.onStateChange(i,n.getStateAndHelpers()),r&&n.props.onSelect(e.selectedItem,n.getStateAndHelpers()),void 0!==a&&n.props.onChange(a,n.getStateAndHelpers()),n.props.onUserAction(i,n.getStateAndHelpers())}))},n.rootRef=function(e){return n._rootNode=e},n.getRootProps=function(e,t){var a,i=void 0===e?{}:e,c=i.refKey,s=void 0===c?"ref":c,l=i.ref,u=r(i,A),d=(void 0===t?{}:t).suppressRefError,f=void 0!==d&&d;n.getRootProps.called=!0,n.getRootProps.refKey=s,n.getRootProps.suppressRefError=f;var p=n.getState().isOpen;return o(((a={})[s]=_(l,n.rootRef),a.role="combobox",a["aria-expanded"]=p,a["aria-haspopup"]="listbox",a["aria-owns"]=p?n.menuId:null,a["aria-labelledby"]=n.labelId,a),u)},n.keyDownHandlers={ArrowDown:function(e){var t=this;if(e.preventDefault(),this.getState().isOpen){var n=e.shiftKey?5:1;this.moveHighlightedIndex(n,{type:4})}else this.internalSetState({isOpen:!0,type:4},(function(){var e=t.getItemCount();if(e>0){var n=P(1,t.getState().highlightedIndex,e,(function(e){return t.getItemNodeFromIndex(e)}));t.setHighlightedIndex(n,{type:4})}}))},ArrowUp:function(e){var t=this;if(e.preventDefault(),this.getState().isOpen){var n=e.shiftKey?-5:-1;this.moveHighlightedIndex(n,{type:3})}else this.internalSetState({isOpen:!0,type:3},(function(){var e=t.getItemCount();if(e>0){var n=P(-1,t.getState().highlightedIndex,e,(function(e){return t.getItemNodeFromIndex(e)}));t.setHighlightedIndex(n,{type:3})}}))},Enter:function(e){if(229!==e.which){var t=this.getState(),n=t.isOpen,r=t.highlightedIndex;if(n&&null!=r){e.preventDefault();var o=this.items[r],a=this.getItemNodeFromIndex(r);if(null==o||a&&a.hasAttribute("disabled"))return;this.selectHighlightedItem({type:6})}}},Escape:function(e){e.preventDefault(),this.reset(o({type:5},!this.state.isOpen&&{selectedItem:null,inputValue:""}))}},n.buttonKeyDownHandlers=o({},n.keyDownHandlers,{" ":function(e){e.preventDefault(),this.toggleMenu({type:12})}}),n.inputKeyDownHandlers=o({},n.keyDownHandlers,{Home:function(e){var t=this,n=this.getState().isOpen;if(n){e.preventDefault();var r=this.getItemCount();if(!(r<=0)&&n){var o=x(1,0,r,(function(e){return t.getItemNodeFromIndex(e)}),!1);this.setHighlightedIndex(o,{type:7})}}},End:function(e){var t=this,n=this.getState().isOpen;if(n){e.preventDefault();var r=this.getItemCount();if(!(r<=0)&&n){var o=x(-1,r-1,r,(function(e){return t.getItemNodeFromIndex(e)}),!1);this.setHighlightedIndex(o,{type:8})}}}}),n.getToggleButtonProps=function(e){var t=void 0===e?{}:e,a=t.onClick;t.onPress;var i=t.onKeyDown,c=t.onKeyUp,s=t.onBlur,l=r(t,N),u=n.getState().isOpen,d={onClick:w(a,n.buttonHandleClick),onKeyDown:w(i,n.buttonHandleKeyDown),onKeyUp:w(c,n.buttonHandleKeyUp),onBlur:w(s,n.buttonHandleBlur)};return o({type:"button",role:"button","aria-label":u?"close menu":"open menu","aria-haspopup":!0,"data-toggle":!0},l.disabled?{}:d,l)},n.buttonHandleKeyUp=function(e){e.preventDefault()},n.buttonHandleKeyDown=function(e){var t=D(e);n.buttonKeyDownHandlers[t]&&n.buttonKeyDownHandlers[t].call(a(n),e)},n.buttonHandleClick=function(e){e.preventDefault(),n.props.environment.document.activeElement===n.props.environment.document.body&&e.target.focus(),n.internalSetTimeout((function(){return n.toggleMenu({type:13})}))},n.buttonHandleBlur=function(e){var t=e.target;n.internalSetTimeout((function(){n.isMouseDown||null!=n.props.environment.document.activeElement&&n.props.environment.document.activeElement.id===n.inputId||n.props.environment.document.activeElement===t||n.reset({type:14})}))},n.getLabelProps=function(e){return o({htmlFor:n.inputId,id:n.labelId},e)},n.getInputProps=function(e){var t=void 0===e?{}:e,a=t.onKeyDown,i=t.onBlur,c=t.onChange,s=t.onInput;t.onChangeText;var l,u=r(t,L),d={},f=n.getState(),p=f.inputValue,h=f.isOpen,m=f.highlightedIndex;return u.disabled||((l={}).onChange=w(c,s,n.inputHandleChange),l.onKeyDown=w(a,n.inputHandleKeyDown),l.onBlur=w(i,n.inputHandleBlur),d=l),o({"aria-autocomplete":"list","aria-activedescendant":h&&"number"==typeof m&&m>=0?n.getItemId(m):null,"aria-controls":h?n.menuId:null,"aria-labelledby":n.labelId,autoComplete:"off",value:p,id:n.inputId},d,u)},n.inputHandleKeyDown=function(e){var t=D(e);t&&n.inputKeyDownHandlers[t]&&n.inputKeyDownHandlers[t].call(a(n),e)},n.inputHandleChange=function(e){n.internalSetState({type:11,isOpen:!0,inputValue:e.target.value,highlightedIndex:n.props.defaultHighlightedIndex})},n.inputHandleBlur=function(){n.internalSetTimeout((function(){var e=n.props.environment.document&&!!n.props.environment.document.activeElement&&!!n.props.environment.document.activeElement.dataset&&n.props.environment.document.activeElement.dataset.toggle&&n._rootNode&&n._rootNode.contains(n.props.environment.document.activeElement);n.isMouseDown||e||n.reset({type:10})}))},n.menuRef=function(e){n._menuNode=e},n.getMenuProps=function(e,t){var a,i=void 0===e?{}:e,c=i.refKey,s=void 0===c?"ref":c,l=i.ref,u=r(i,U),d=(void 0===t?{}:t).suppressRefError,f=void 0!==d&&d;return n.getMenuProps.called=!0,n.getMenuProps.refKey=s,n.getMenuProps.suppressRefError=f,o(((a={})[s]=_(l,n.menuRef),a.role="listbox",a["aria-labelledby"]=u&&u["aria-label"]?null:n.labelId,a.id=n.menuId,a),u)},n.getItemProps=function(e){var t,a=void 0===e?{}:e,i=a.onMouseMove,c=a.onMouseDown,s=a.onClick;a.onPress;var l=a.index,u=a.item,d=void 0===u?void 0:u,f=r(a,B);void 0===l?(n.items.push(d),l=n.items.indexOf(d)):n.items[l]=d;var p=s,h=((t={onMouseMove:w(i,(function(){l!==n.getState().highlightedIndex&&(n.setHighlightedIndex(l,{type:2}),n.avoidScrolling=!0,n.internalSetTimeout((function(){return n.avoidScrolling=!1}),250))})),onMouseDown:w(c,(function(e){e.preventDefault()}))}).onClick=w(p,(function(){n.selectItemAtIndex(l,{type:9})})),t),m=f.disabled?{onMouseDown:h.onMouseDown}:h;return o({id:n.getItemId(l),role:"option","aria-selected":n.getState().highlightedIndex===l},m,f)},n.clearItems=function(){n.items=[]},n.reset=function(e,t){void 0===e&&(e={}),e=E(e),n.internalSetState((function(t){var r=t.selectedItem;return o({isOpen:n.props.defaultIsOpen,highlightedIndex:n.props.defaultHighlightedIndex,inputValue:n.props.itemToString(r)},e)}),t)},n.toggleMenu=function(e,t){void 0===e&&(e={}),e=E(e),n.internalSetState((function(t){var r=t.isOpen;return o({isOpen:!r},r&&{highlightedIndex:n.props.defaultHighlightedIndex},e)}),(function(){var r=n.getState(),o=r.isOpen,a=r.highlightedIndex;o&&n.getItemCount()>0&&"number"==typeof a&&n.setHighlightedIndex(a,e),y(t)()}))},n.openMenu=function(e){n.internalSetState({isOpen:!0},e)},n.closeMenu=function(e){n.internalSetState({isOpen:!1},e)},n.updateStatus=O((function(){var e=n.getState(),t=n.items[e.highlightedIndex],r=n.getItemCount(),a=n.props.getA11yStatusMessage(o({itemToString:n.props.itemToString,previousResultCount:n.previousResultCount,resultCount:r,highlightedItem:t},e));n.previousResultCount=r,M(a,n.props.environment.document)}),200);var i=n.props,c=i.defaultHighlightedIndex,s=i.initialHighlightedIndex,l=void 0===s?c:s,u=i.defaultIsOpen,d=i.initialIsOpen,f=void 0===d?u:d,p=i.initialInputValue,h=void 0===p?"":p,b=i.initialSelectedItem,g=void 0===b?null:b,v=n.getState({highlightedIndex:l,isOpen:f,inputValue:h,selectedItem:g});return null!=v.selectedItem&&void 0===n.props.initialInputValue&&(v.inputValue=n.props.itemToString(v.selectedItem)),n.state=v,n}n=e,(t=c).prototype=Object.create(n.prototype),t.prototype.constructor=t,i(t,n);var s=c.prototype;return s.internalClearTimeouts=function(){this.timeoutIds.forEach((function(e){clearTimeout(e)})),this.timeoutIds=[]},s.getState=function(e){return void 0===e&&(e=this.state),t=e,n=this.props,Object.keys(t).reduce((function(e,r){return e[r]=C(n,r)?n[r]:t[r],e}),{});var t,n},s.getItemCount=function(){var e=this.items.length;return null!=this.itemCount?e=this.itemCount:void 0!==this.props.itemCount&&(e=this.props.itemCount),e},s.getItemNodeFromIndex=function(e){return this.props.environment.document.getElementById(this.getItemId(e))},s.scrollHighlightedItemIntoView=function(){var e=this.getItemNodeFromIndex(this.getState().highlightedIndex);this.props.scrollIntoView(e,this._menuNode)},s.moveHighlightedIndex=function(e,t){var n=this,r=this.getItemCount(),o=this.getState().highlightedIndex;if(r>0){var a=P(e,o,r,(function(e){return n.getItemNodeFromIndex(e)}));this.setHighlightedIndex(a,t)}},s.getStateAndHelpers=function(){var e=this.getState(),t=e.highlightedIndex,n=e.inputValue,r=e.selectedItem,o=e.isOpen,a=this.props.itemToString,i=this.id,c=this.getRootProps,s=this.getToggleButtonProps,l=this.getLabelProps,u=this.getMenuProps,d=this.getInputProps,f=this.getItemProps,p=this.openMenu,h=this.closeMenu,m=this.toggleMenu,y=this.selectItem,b=this.selectItemAtIndex,g=this.selectHighlightedItem,v=this.setHighlightedIndex,O=this.clearSelection,w=this.clearItems;return{getRootProps:c,getToggleButtonProps:s,getLabelProps:l,getMenuProps:u,getInputProps:d,getItemProps:f,reset:this.reset,openMenu:p,closeMenu:h,toggleMenu:m,selectItem:y,selectItemAtIndex:b,selectHighlightedItem:g,setHighlightedIndex:v,clearSelection:O,clearItems:w,setItemCount:this.setItemCount,unsetItemCount:this.unsetItemCount,setState:this.internalSetState,itemToString:a,id:i,highlightedIndex:t,inputValue:n,isOpen:o,selectedItem:r}},s.componentDidMount=function(){var e=this,t=function(){e.isMouseDown=!0},n=function(t){e.isMouseDown=!1,!F(t.target,[e._rootNode,e._menuNode],e.props.environment)&&e.getState().isOpen&&e.reset({type:1},(function(){return e.props.onOuterClick(e.getStateAndHelpers())}))},r=function(){e.isTouchMove=!1},o=function(){e.isTouchMove=!0},a=function(t){var n=F(t.target,[e._rootNode,e._menuNode],e.props.environment,!1);e.isTouchMove||n||!e.getState().isOpen||e.reset({type:16},(function(){return e.props.onOuterClick(e.getStateAndHelpers())}))},i=this.props.environment;i.addEventListener("mousedown",t),i.addEventListener("mouseup",n),i.addEventListener("touchstart",r),i.addEventListener("touchmove",o),i.addEventListener("touchend",a),this.cleanup=function(){e.internalClearTimeouts(),e.updateStatus.cancel(),i.removeEventListener("mousedown",t),i.removeEventListener("mouseup",n),i.removeEventListener("touchstart",r),i.removeEventListener("touchmove",o),i.removeEventListener("touchend",a)}},s.shouldScroll=function(e,t){var n=(void 0===this.props.highlightedIndex?this.getState():this.props).highlightedIndex,r=(void 0===t.highlightedIndex?e:t).highlightedIndex;return n&&this.getState().isOpen&&!e.isOpen||n!==r},s.componentDidUpdate=function(e,t){C(this.props,"selectedItem")&&this.props.selectedItemChanged(e.selectedItem,this.props.selectedItem)&&this.internalSetState({type:15,inputValue:this.props.itemToString(this.props.selectedItem)}),!this.avoidScrolling&&this.shouldScroll(t,e)&&this.scrollHighlightedItemIntoView(),this.updateStatus()},s.componentWillUnmount=function(){this.cleanup()},s.render=function(){var e=S(this.props.children,b);this.clearItems(),this.getRootProps.called=!1,this.getRootProps.refKey=void 0,this.getRootProps.suppressRefError=void 0,this.getMenuProps.called=!1,this.getMenuProps.refKey=void 0,this.getMenuProps.suppressRefError=void 0,this.getLabelProps.called=!1,this.getInputProps.called=!1;var t=S(e(this.getStateAndHelpers()));return t?this.getRootProps.called||this.props.suppressRefError?t:function(e){return"string"==typeof e.type}(t)?Object(l.cloneElement)(t,this.getRootProps(function(e){return e.props}(t))):void 0:null},c}(l.Component);return e.defaultProps={defaultHighlightedIndex:null,defaultIsOpen:!1,getA11yStatusMessage:k,itemToString:function(e){return null==e?"":String(e)},onStateChange:b,onInputValueChange:b,onUserAction:b,onChange:b,onSelect:b,onOuterClick:b,selectedItemChanged:function(e,t){return e!==t},environment:"undefined"==typeof window?{}:window,stateReducer:function(e,t){return t},suppressRefError:!1,scrollIntoView:g},e.stateChangeTypes=I,e}();O((function(e,t){M(e(),t)}),200),"undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?l.useLayoutEffect:l.useEffect;var q={itemToString:function(e){return e?String(e):""},stateReducer:function(e,t){return t.changes},getA11ySelectionMessage:function(e){var t=e.selectedItem,n=e.itemToString;return t?n(t)+" has been selected.":""},scrollIntoView:g,circularNavigation:!1,environment:"undefined"==typeof window?{}:window};s.a.array.isRequired,s.a.func,s.a.func,s.a.func,s.a.bool,s.a.number,s.a.number,s.a.number,s.a.bool,s.a.bool,s.a.bool,s.a.any,s.a.any,s.a.any,s.a.string,s.a.string,s.a.string,s.a.func,s.a.string,s.a.func,s.a.func,s.a.func,s.a.func,s.a.func,s.a.shape({addEventListener:s.a.func,removeEventListener:s.a.func,document:s.a.shape({getElementById:s.a.func,activeElement:s.a.any,body:s.a.any})}),h(h({},q),{getA11yStatusMessage:function(e){var t=e.isOpen,n=e.resultCount,r=e.previousResultCount;return t?n?n!==r?n+" result"+(1===n?" is":"s are")+" available, use up and down arrow keys to navigate. Press Enter or Space Bar keys to select.":"":"No results are available.":""}}),s.a.array.isRequired,s.a.func,s.a.func,s.a.func,s.a.bool,s.a.number,s.a.number,s.a.number,s.a.bool,s.a.bool,s.a.bool,s.a.any,s.a.any,s.a.any,s.a.string,s.a.string,s.a.string,s.a.string,s.a.string,s.a.string,s.a.func,s.a.string,s.a.string,s.a.func,s.a.func,s.a.func,s.a.func,s.a.func,s.a.func,s.a.shape({addEventListener:s.a.func,removeEventListener:s.a.func,document:s.a.shape({getElementById:s.a.func,activeElement:s.a.any,body:s.a.any})}),o({},q,{getA11yStatusMessage:k,circularNavigation:!0}),s.a.array,s.a.array,s.a.array,s.a.func,s.a.func,s.a.func,s.a.number,s.a.number,s.a.number,s.a.func,s.a.func,s.a.string,s.a.string,s.a.shape({addEventListener:s.a.func,removeEventListener:s.a.func,document:s.a.shape({getElementById:s.a.func,activeElement:s.a.any,body:s.a.any})})},,function(e,t,n){"use strict";var r=n(328),o=n(81),a=o("%Function.prototype.apply%"),i=o("%Function.prototype.call%"),c=o("%Reflect.apply%",!0)||r.call(i,a),s=o("%Object.getOwnPropertyDescriptor%",!0),l=o("%Object.defineProperty%",!0),u=o("%Math.max%");if(l)try{l({},"a",{value:1})}catch(e){l=null}e.exports=function(e){var t=c(r,i,arguments);if(s&&l){var n=s(t,"length");n.configurable&&l(t,"length",{value:1+u(0,e.length-(arguments.length-1))})}return t};var d=function(){return c(r,a,arguments)};l?l(e.exports,"apply",{value:d}):e.exports.apply=d},function(e,t){e.exports=function(e){return"object"==typeof e?null!==e:"function"==typeof e}},function(e,t,n){var r=n(226),o=n(418),a=n(212),i=n(339),c=Object.defineProperty;t.f=r?c:function(e,t,n){if(a(e),t=i(t,!0),a(n),o)try{return c(e,t,n)}catch(e){}if("get"in n||"set"in n)throw TypeError("Accessors not supported");return"value"in n&&(e[t]=n.value),e}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,o=(r=n(2))&&r.__esModule?r:{default:r},a=n(77);t.default=o.default.oneOf([a.ICON_BEFORE_POSITION,a.ICON_AFTER_POSITION])},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,o=(r=n(2))&&r.__esModule?r:{default:r},a=n(77);t.default=o.default.oneOf([a.INFO_POSITION_TOP,a.INFO_POSITION_BOTTOM,a.INFO_POSITION_BEFORE,a.INFO_POSITION_AFTER])},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){return!(!r.default.isMoment(e)||!r.default.isMoment(t)||(0,o.default)(e,t))};var r=a(n(31)),o=a(n(251));function a(e){return e&&e.__esModule?e:{default:e}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){if(!o.default.isMoment(e)||!o.default.isMoment(t))return!1;var n=e.year(),r=e.month(),a=t.year(),i=t.month(),c=n===a;return c&&r===i?e.date()<t.date():c?r<i:n<a};var r,o=(r=n(31))&&r.__esModule?r:{default:r}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,o=(r=n(11))&&r.__esModule?r:{default:r},a=function(e){return o.default.createElement("svg",e,o.default.createElement("path",{fillRule:"evenodd",d:"M11.53.47a.75.75 0 0 0-1.061 0l-4.47 4.47L1.529.47A.75.75 0 1 0 .468 1.531l4.47 4.47-4.47 4.47a.75.75 0 1 0 1.061 1.061l4.47-4.47 4.47 4.47a.75.75 0 1 0 1.061-1.061l-4.47-4.47 4.47-4.47a.75.75 0 0 0 0-1.061z"}))};a.defaultProps={viewBox:"0 0 12 12"},t.default=a},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(e,t,n){"use strict";function r(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}n.d(t,"a",(function(){return r}))},,function(e,t,n){"use strict";var r=n(94),o=n(61),a=n(6),i=n.n(a),c=n(0);function s(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}t.a=function(e){var t=e.as,n=void 0===t?"div":t,a=e.className,l=Object(o.a)(e,["as","className"]);return function(e){var t=e.as,n=void 0===t?"div":t,r=Object(o.a)(e,["as"]);return"function"==typeof r.children?r.children(r):Object(c.createElement)(n,r)}(function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?s(Object(n),!0).forEach((function(t){Object(r.a)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):s(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({as:n,className:i()("components-visually-hidden",a)},l))}},,,function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(11),o=n(222);function a(e,t){return e===t}function i(e,t,n){var i=n&&n.equalityFn?n.equalityFn:a,c=Object(r.useState)(e),s=c[0],l=c[1],u=Object(o.a)(Object(r.useCallback)((function(e){return l(e)}),[]),t,n),d=u[0],f=u[1],p=u[2],h=Object(r.useRef)(e);return Object(r.useEffect)((function(){i(h.current,e)||(d(e),h.current=e)}),[e,d,i]),[s,f,p]}},,,,function(e,t,n){"use strict";var r=n(81)("%TypeError%"),o=n(596),a=n(224),i=n(147);e.exports=function(e,t){if("Object"!==i(e))throw new r("Assertion failed: Type(O) is not Object");if(!a(t))throw new r("Assertion failed: IsPropertyKey(P) is not true, got "+o(t));return e[t]}},function(e,t,n){"use strict";var r=n(81)("%Array%"),o=!r.isArray&&n(185)("Object.prototype.toString");e.exports=r.isArray||function(e){return"[object Array]"===o(e)}},function(e,t){var n=/^\[object .+?Constructor\]$/;function r(e){return!!e&&"object"==typeof e}var o,a,i=Object.prototype,c=Function.prototype.toString,s=i.hasOwnProperty,l=i.toString,u=RegExp("^"+c.call(s).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),d=("isArray",function(e){return null!=e&&(function(e){return function(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}(e)&&"[object Function]"==l.call(e)}(e)?u.test(c.call(e)):r(e)&&n.test(e))}(a=null==(o=Array)?void 0:o.isArray)?a:void 0)||function(e){return r(e)&&function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}(e.length)&&"[object Array]"==l.call(e)};e.exports=d},function(e,t){e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},function(e,t){e.exports={}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,o=(r=n(2))&&r.__esModule?r:{default:r},a=n(104);function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function c(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}t.default=(0,a.and)([o.default.instanceOf(Set),function(e,t){for(var n=arguments.length,r=Array(n>2?n-2:0),a=2;a<n;a++)r[a-2]=arguments[a];var s=e[t],l=void 0;return[].concat(c(s)).some((function(e,n){var a,c=String(t)+": index "+String(n);return null!=(l=(a=o.default.string).isRequired.apply(a,[i({},c,e),c].concat(r)))})),null==l?null:l}],"Modifiers (Set of Strings)")},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){var n=r.default.isMoment(e)?e:(0,o.default)(e,t);return n?n.format(a.ISO_FORMAT):null};var r=i(n(31)),o=i(n(230)),a=n(77);function i(e){return e&&e.__esModule?e:{default:e}}},function(e,t,n){"use strict";n.r(t),n.d(t,"addEventListener",(function(){return c}));var r=!("undefined"==typeof window||!window.document||!window.document.createElement),o=void 0;function a(e){e.handlers===e.nextHandlers&&(e.nextHandlers=e.handlers.slice())}function i(e){this.target=e,this.events={}}function c(e,t,n,a){e.__consolidated_events_handlers__||(e.__consolidated_events_handlers__=new i(e));var c=function(e){if(e)return void 0===o&&(o=function(){if(!r)return!1;if(!window.addEventListener||!window.removeEventListener||!Object.defineProperty)return!1;var e=!1;try{var t=Object.defineProperty({},"passive",{get:function(){e=!0}}),n=function(){};window.addEventListener("testPassiveEventSupport",n,t),window.removeEventListener("testPassiveEventSupport",n,t)}catch(e){}return e}()),o?e:!!e.capture}(a);return e.__consolidated_events_handlers__.add(t,n,c)}i.prototype.getEventHandlers=function(e,t){var n,r=String(e)+" "+String((n=t)?!0===n?100:(n.capture<<0)+(n.passive<<1)+(n.once<<2):0);return this.events[r]||(this.events[r]={handlers:[],handleEvent:void 0},this.events[r].nextHandlers=this.events[r].handlers),this.events[r]},i.prototype.handleEvent=function(e,t,n){var r=this.getEventHandlers(e,t);r.handlers=r.nextHandlers,r.handlers.forEach((function(e){e&&e(n)}))},i.prototype.add=function(e,t,n){var r=this,o=this.getEventHandlers(e,n);a(o),0===o.nextHandlers.length&&(o.handleEvent=this.handleEvent.bind(this,e,n),this.target.addEventListener(e,o.handleEvent,n)),o.nextHandlers.push(t);var i=!0;return function(){if(i){i=!1,a(o);var c=o.nextHandlers.indexOf(t);o.nextHandlers.splice(c,1),0===o.nextHandlers.length&&(r.target&&r.target.removeEventListener(e,o.handleEvent,n),o.handleEvent=void 0)}}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){var n=r.default.isMoment(e)?e:(0,o.default)(e,t);return n?n.format(a.ISO_MONTH_FORMAT):null};var r=i(n(31)),o=i(n(230)),a=n(77);function i(e){return e&&e.__esModule?e:{default:e}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,o=(r=n(2))&&r.__esModule?r:{default:r},a=n(77);t.default=o.default.oneOfType([o.default.bool,o.default.oneOf([a.START_DATE,a.END_DATE])])},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){return!(!r.default.isMoment(e)||!r.default.isMoment(t)||(0,o.default)(e,t)||(0,a.default)(e,t))};var r=i(n(31)),o=i(n(251)),a=i(n(229));function i(e){return e&&e.__esModule?e:{default:e}}},,,,,function(e,t,n){"use strict";n.r(t),n.d(t,"getProfileItems",(function(){return r})),n.d(t,"getTasksStatus",(function(){return o})),n.d(t,"getPaymentGatewaySuggestions",(function(){return a})),n.d(t,"getOnboardingError",(function(){return i})),n.d(t,"isOnboardingRequesting",(function(){return c}));const r=e=>e.profileItems||{},o=e=>e.tasksStatus||{},a=e=>e.paymentMethods||[],i=(e,t)=>e.errors[t]||!1,c=(e,t)=>e.requesting[t]||!1},,,,function(e,t,n){"use strict";n.d(t,"a",(function(){return P}));var r={};n.r(r),n.d(r,"getOption",(function(){return s})),n.d(r,"getOptionsRequestingError",(function(){return l})),n.d(r,"isOptionsUpdating",(function(){return u})),n.d(r,"getOptionsUpdatingError",(function(){return d}));var o={};n.r(o),n.d(o,"receiveOptions",(function(){return g})),n.d(o,"setRequestingError",(function(){return v})),n.d(o,"setUpdatingError",(function(){return O})),n.d(o,"setIsUpdating",(function(){return w})),n.d(o,"updateOptions",(function(){return _}));var a={};n.r(a),n.d(a,"getOption",(function(){return D}));var i=n(14),c=n(240);const s=(e,t)=>e[t],l=(e,t)=>e.requestingErrors[t]||!1,u=e=>e.isUpdating||!1,d=e=>e.updatingError||!1;var f=n(36),p="RECEIVE_OPTIONS",h="SET_IS_UPDATING",m="SET_REQUESTING_ERROR",y="SET_UPDATING_ERROR",b=n(40);function g(e){return{type:p,options:e}}function v(e,t){return{type:m,error:e,name:t}}function O(e){return{type:y,error:e}}function w(e){return{type:h,isUpdating:e}}function*_(e){yield w(!0),yield g(e);try{const t=yield Object(f.apiFetch)({path:b.e+"/options",method:"POST",data:e});return yield w(!1),{success:!0,...t}}catch(e){return yield O(e),{success:!1,...e}}}var k=n(15),S=n.n(k);let j=[];const E={},C={...f.controls,BATCH_FETCH:({optionName:e})=>(j.push(e),new Promise(t=>{setTimeout((function(){const n=j.join(",");if(E[n])return E[n].then(n=>{t(n[e])});const r=b.e+"/options?options="+n;E[n]=S()({path:r}),E[n].then(e=>t(e)),setTimeout(()=>{j=[],delete E[n]},1)}),1)}))};function*D(e){try{const n=yield(t=e,{type:"BATCH_FETCH",optionName:t});yield g(n)}catch(t){yield v(t,e)}var t}Object(i.registerStore)(c.a,{reducer:(e={isUpdating:!1,requestingErrors:{}},{type:t,options:n,error:r,isUpdating:o,name:a})=>{switch(t){case p:e={...e,...n};break;case h:e={...e,isUpdating:o};break;case m:e={...e,requestingErrors:{[a]:r}};break;case y:e={...e,error:r,updatingError:r,isUpdating:!1}}return e},actions:o,controls:C,selectors:r,resolvers:a});const P=c.a},,function(e,t,n){"use strict";function r(e,t){return(r=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}n.d(t,"a",(function(){return r}))},function(e,t,n){var r,o,a,i,c;r=n(752),o=n(468).utf8,a=n(753),i=n(468).bin,(c=function(e,t){e.constructor==String?e=t&&"binary"===t.encoding?i.stringToBytes(e):o.stringToBytes(e):a(e)?e=Array.prototype.slice.call(e,0):Array.isArray(e)||e.constructor===Uint8Array||(e=e.toString());for(var n=r.bytesToWords(e),s=8*e.length,l=1732584193,u=-271733879,d=-1732584194,f=271733878,p=0;p<n.length;p++)n[p]=16711935&(n[p]<<8|n[p]>>>24)|4278255360&(n[p]<<24|n[p]>>>8);n[s>>>5]|=128<<s%32,n[14+(s+64>>>9<<4)]=s;var h=c._ff,m=c._gg,y=c._hh,b=c._ii;for(p=0;p<n.length;p+=16){var g=l,v=u,O=d,w=f;l=h(l,u,d,f,n[p+0],7,-680876936),f=h(f,l,u,d,n[p+1],12,-389564586),d=h(d,f,l,u,n[p+2],17,606105819),u=h(u,d,f,l,n[p+3],22,-1044525330),l=h(l,u,d,f,n[p+4],7,-176418897),f=h(f,l,u,d,n[p+5],12,1200080426),d=h(d,f,l,u,n[p+6],17,-1473231341),u=h(u,d,f,l,n[p+7],22,-45705983),l=h(l,u,d,f,n[p+8],7,1770035416),f=h(f,l,u,d,n[p+9],12,-1958414417),d=h(d,f,l,u,n[p+10],17,-42063),u=h(u,d,f,l,n[p+11],22,-1990404162),l=h(l,u,d,f,n[p+12],7,1804603682),f=h(f,l,u,d,n[p+13],12,-40341101),d=h(d,f,l,u,n[p+14],17,-1502002290),l=m(l,u=h(u,d,f,l,n[p+15],22,1236535329),d,f,n[p+1],5,-165796510),f=m(f,l,u,d,n[p+6],9,-1069501632),d=m(d,f,l,u,n[p+11],14,643717713),u=m(u,d,f,l,n[p+0],20,-373897302),l=m(l,u,d,f,n[p+5],5,-701558691),f=m(f,l,u,d,n[p+10],9,38016083),d=m(d,f,l,u,n[p+15],14,-660478335),u=m(u,d,f,l,n[p+4],20,-405537848),l=m(l,u,d,f,n[p+9],5,568446438),f=m(f,l,u,d,n[p+14],9,-1019803690),d=m(d,f,l,u,n[p+3],14,-187363961),u=m(u,d,f,l,n[p+8],20,1163531501),l=m(l,u,d,f,n[p+13],5,-1444681467),f=m(f,l,u,d,n[p+2],9,-51403784),d=m(d,f,l,u,n[p+7],14,1735328473),l=y(l,u=m(u,d,f,l,n[p+12],20,-1926607734),d,f,n[p+5],4,-378558),f=y(f,l,u,d,n[p+8],11,-2022574463),d=y(d,f,l,u,n[p+11],16,1839030562),u=y(u,d,f,l,n[p+14],23,-35309556),l=y(l,u,d,f,n[p+1],4,-1530992060),f=y(f,l,u,d,n[p+4],11,1272893353),d=y(d,f,l,u,n[p+7],16,-155497632),u=y(u,d,f,l,n[p+10],23,-1094730640),l=y(l,u,d,f,n[p+13],4,681279174),f=y(f,l,u,d,n[p+0],11,-358537222),d=y(d,f,l,u,n[p+3],16,-722521979),u=y(u,d,f,l,n[p+6],23,76029189),l=y(l,u,d,f,n[p+9],4,-640364487),f=y(f,l,u,d,n[p+12],11,-421815835),d=y(d,f,l,u,n[p+15],16,530742520),l=b(l,u=y(u,d,f,l,n[p+2],23,-995338651),d,f,n[p+0],6,-198630844),f=b(f,l,u,d,n[p+7],10,1126891415),d=b(d,f,l,u,n[p+14],15,-1416354905),u=b(u,d,f,l,n[p+5],21,-57434055),l=b(l,u,d,f,n[p+12],6,1700485571),f=b(f,l,u,d,n[p+3],10,-1894986606),d=b(d,f,l,u,n[p+10],15,-1051523),u=b(u,d,f,l,n[p+1],21,-2054922799),l=b(l,u,d,f,n[p+8],6,1873313359),f=b(f,l,u,d,n[p+15],10,-30611744),d=b(d,f,l,u,n[p+6],15,-1560198380),u=b(u,d,f,l,n[p+13],21,1309151649),l=b(l,u,d,f,n[p+4],6,-145523070),f=b(f,l,u,d,n[p+11],10,-1120210379),d=b(d,f,l,u,n[p+2],15,718787259),u=b(u,d,f,l,n[p+9],21,-343485551),l=l+g>>>0,u=u+v>>>0,d=d+O>>>0,f=f+w>>>0}return r.endian([l,u,d,f])})._ff=function(e,t,n,r,o,a,i){var c=e+(t&n|~t&r)+(o>>>0)+i;return(c<<a|c>>>32-a)+t},c._gg=function(e,t,n,r,o,a,i){var c=e+(t&r|n&~r)+(o>>>0)+i;return(c<<a|c>>>32-a)+t},c._hh=function(e,t,n,r,o,a,i){var c=e+(t^n^r)+(o>>>0)+i;return(c<<a|c>>>32-a)+t},c._ii=function(e,t,n,r,o,a,i){var c=e+(n^(t|~r))+(o>>>0)+i;return(c<<a|c>>>32-a)+t},c._blocksize=16,c._digestsize=16,e.exports=function(e,t){if(null==e)throw new Error("Illegal argument "+e);var n=r.wordsToBytes(c(e,t));return t&&t.asBytes?n:t&&t.asString?i.bytesToString(n):r.bytesToHex(n)}},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(282);function o(e,t){if(e){if("string"==typeof e)return Object(r.a)(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Object(r.a)(e,t):void 0}}},function(e,t,n){"use strict";var r=n(51),o=n(98),a=n(99),i=n(79),c=n(100),s=n(101),l=n(70),u=n(0),d=n(7),f=n(21);var p=["button","submit"];t.a=Object(f.createHigherOrderComponent)((function(e){return function(t){Object(c.a)(m,t);var n,f,h=(n=m,f=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=Object(l.a)(n);if(f){var r=Object(l.a)(this).constructor;e=Reflect.construct(t,arguments,r)}else e=t.apply(this,arguments);return Object(s.a)(this,e)});function m(){var e;return Object(o.a)(this,m),(e=h.apply(this,arguments)).bindNode=e.bindNode.bind(Object(i.a)(e)),e.cancelBlurCheck=e.cancelBlurCheck.bind(Object(i.a)(e)),e.queueBlurCheck=e.queueBlurCheck.bind(Object(i.a)(e)),e.normalizeButtonFocus=e.normalizeButtonFocus.bind(Object(i.a)(e)),e}return Object(a.a)(m,[{key:"componentWillUnmount",value:function(){this.cancelBlurCheck()}},{key:"bindNode",value:function(e){e?this.node=e:(delete this.node,this.cancelBlurCheck())}},{key:"queueBlurCheck",value:function(e){var t=this;e.persist(),this.preventBlurCheck||(this.blurCheckTimeout=setTimeout((function(){document.hasFocus()?"function"==typeof t.node.handleFocusOutside&&t.node.handleFocusOutside(e):e.preventDefault()}),0))}},{key:"cancelBlurCheck",value:function(){clearTimeout(this.blurCheckTimeout)}},{key:"normalizeButtonFocus",value:function(e){var t=e.type,n=e.target;Object(d.includes)(["mouseup","touchend"],t)?this.preventBlurCheck=!1:function(e){switch(e.nodeName){case"A":case"BUTTON":return!0;case"INPUT":return Object(d.includes)(p,e.type)}return!1}(n)&&(this.preventBlurCheck=!0)}},{key:"render",value:function(){return Object(u.createElement)("div",{onFocus:this.cancelBlurCheck,onMouseDown:this.normalizeButtonFocus,onMouseUp:this.normalizeButtonFocus,onTouchStart:this.normalizeButtonFocus,onTouchEnd:this.normalizeButtonFocus,onBlur:this.queueBlurCheck},Object(u.createElement)(e,Object(r.a)({ref:this.bindNode},this.props)))}}]),m}(u.Component)}),"withFocusOutside")},function(e,t,n){"use strict";t.a=function(e){var t={};return function(n){return void 0===t[n]&&(t[n]=e(n)),t[n]}}},function(e,t,n){"use strict";n.d(t,"b",(function(){return l})),n.d(t,"a",(function(){return g}));var r=n(94),o=n(7),a=n(76);function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function c(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?i(Object(n),!0).forEach((function(t){Object(r.a)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):i(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var s={black:"#000",white:"#fff"},l={blue:{medium:{focus:"#007cba",focusDark:"#fff"}},gray:{900:"#1e1e1e",700:"#757575",600:"#949494",400:"#ccc",200:"#ddd",100:"#f0f0f0"},darkGray:{primary:"#1e1e1e"},mediumGray:{text:"#757575"},lightGray:{ui:"#949494",secondary:"#ccc",tertiary:"#e7e8e9"}},u={900:"#191e23",800:"#23282d",700:"#32373c",600:"#40464d",500:"#555d66",400:"#606a73",300:"#6c7781",200:"#7e8993",150:"#8d96a0",100:"#8f98a1",placeholder:Object(a.b)(l.gray[900],.62)},d={900:Object(a.b)("#000510",.9),800:Object(a.b)("#00000a",.85),700:Object(a.b)("#06060b",.8),600:Object(a.b)("#000913",.75),500:Object(a.b)("#0a1829",.7),400:Object(a.b)("#0a1829",.65),300:Object(a.b)("#0e1c2e",.62),200:Object(a.b)("#162435",.55),100:Object(a.b)("#223443",.5),backgroundFill:Object(a.b)(u[700],.7)},f={900:Object(a.b)("#304455",.45),800:Object(a.b)("#425863",.4),700:Object(a.b)("#667886",.35),600:Object(a.b)("#7b86a2",.3),500:Object(a.b)("#9197a2",.25),400:Object(a.b)("#95959c",.2),300:Object(a.b)("#829493",.15),200:Object(a.b)("#8b8b96",.1),100:Object(a.b)("#747474",.05)},p={900:"#a2aab2",800:"#b5bcc2",700:"#ccd0d4",600:"#d7dade",500:"#e2e4e7",400:"#e8eaeb",300:"#edeff0",200:"#f3f4f5",100:"#f8f9f9",placeholder:Object(a.b)(s.white,.65)},h={900:Object(a.b)(s.white,.5),800:Object(a.b)(s.white,.45),700:Object(a.b)(s.white,.4),600:Object(a.b)(s.white,.35),500:Object(a.b)(s.white,.3),400:Object(a.b)(s.white,.25),300:Object(a.b)(s.white,.2),200:Object(a.b)(s.white,.15),100:Object(a.b)(s.white,.1),backgroundFill:Object(a.b)(p[300],.8)},m={wordpress:{700:"#00669b"},dark:{900:"#0071a1"},medium:{900:"#006589",800:"#00739c",700:"#007fac",600:"#008dbe",500:"#00a0d2",400:"#33b3db",300:"#66c6e4",200:"#bfe7f3",100:"#e5f5fa",highlight:"#b3e7fe",focus:"#007cba"}},y={theme:"var( --wp-admin-theme-color, ".concat(m.wordpress[700],")"),themeDark10:"var( --wp-admin-theme-color-darker-10, ".concat(m.medium.focus,")")},b={theme:y.theme,background:s.white,backgroundDisabled:p[200],border:l.gray[700],borderFocus:y.themeDark10,borderDisabled:l.gray[400],borderLight:l.gray[200],label:u[500],textDisabled:u[150],textDark:s.white,textLight:s.black},g=c(c({},s),{},{darkGray:Object(o.merge)({},u,l.darkGray),darkOpacity:d,darkOpacityLight:f,mediumGray:l.mediumGray,lightGray:Object(o.merge)({},p,l.lightGray),lightGrayLight:h,blue:Object(o.merge)({},m,l.blue),alert:{yellow:"#f0b849",red:"#d94f4f",green:"#4ab866"},admin:y,ui:b})},function(e,t,n){"use strict";n.d(t,"a",(function(){return l}));var r=n(51),o=n(61),a=n(0),i=n(6),c=n.n(i),s=n(239),l=Object(a.forwardRef)((function(e,t){var n=e.align,i=void 0===n?"center":n,l=e.className,u=e.gap,d=void 0===u?2:u,f=e.justify,p=void 0===f?"space-between":f,h=e.isReversed,m=void 0!==h&&h,y=Object(o.a)(e,["align","className","gap","justify","isReversed"]),b=c()("components-flex",l);return Object(a.createElement)(s.b,Object(r.a)({},y,{align:i,className:b,ref:t,gap:d,justify:p,isReversed:m}))}));t.b=l},function(e,t,n){"use strict";var r=n(0),o=n(6),a=n.n(o),i=n(284),c=n(95),s=n(7),l={"default.fontFamily":"-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif","default.fontSize":"13px","helpText.fontSize":"12px",mobileTextMinFontSize:"16px"};function u(e){return Object(s.get)(l,e,"")}function d(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;return isNaN(e)?"".concat(8,"px"):"".concat(8*e,"px")}var f=n(76),p=Object(c.a)("div",{target:"e1puf3u0",label:"Wrapper"})("font-family:",u("default.fontFamily"),";font-size:",u("default.fontSize"),";"),h=Object(c.a)("div",{target:"e1puf3u1",label:"StyledField"})("margin-bottom:",d(1),";.components-panel__row &{margin-bottom:inherit;}"),m=Object(c.a)("label",{target:"e1puf3u2",label:"StyledLabel"})("display:inline-block;margin-bottom:",d(1),";"),y=Object(c.a)("p",{target:"e1puf3u3",label:"StyledHelp"})("margin-top:-",d(1),";font-size:",u("helpText.fontSize"),";font-style:normal;color:",Object(f.a)("mediumGray.text"),";");function b(e){var t=e.id,n=e.label,o=e.hideLabelFromVision,c=e.help,s=e.className,l=e.children;return Object(r.createElement)(p,{className:a()("components-base-control",s)},Object(r.createElement)(h,{className:"components-base-control__field"},n&&t&&(o?Object(r.createElement)(i.a,{as:"label",htmlFor:t},n):Object(r.createElement)(m,{className:"components-base-control__label",htmlFor:t},n)),n&&!t&&(o?Object(r.createElement)(i.a,{as:"label"},n):Object(r.createElement)(b.VisualLabel,null,n)),l),!!c&&Object(r.createElement)(y,{id:t+"__help",className:"components-base-control__help"},c))}b.VisualLabel=function(e){var t=e.className,n=e.children;return t=a()("components-base-control__label",t),Object(r.createElement)("span",{className:t},n)},t.a=b},function(e,t,n){"use strict";var r=n(94),o=n(51),a=n(61),i=n(0),c=n(28),s=function(e){var t=e.icon,n=e.className,r=Object(a.a)(e,["icon","className"]),c=["dashicon","dashicons","dashicons-"+t,n].filter(Boolean).join(" ");return Object(i.createElement)("span",Object(o.a)({className:c},r))};function l(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function u(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?l(Object(n),!0).forEach((function(t){Object(r.a)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):l(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}t.a=function(e){var t=e.icon,n=void 0===t?null:t,r=e.size,l=Object(a.a)(e,["icon","size"]);if("string"==typeof n)return Object(i.createElement)(s,Object(o.a)({icon:n},l));if(n&&s===n.type)return Object(i.cloneElement)(n,u({},l));var d=r||24;if("function"==typeof n)return n.prototype instanceof i.Component?Object(i.createElement)(n,u({size:d},l)):n(u({size:d},l));if(n&&("svg"===n.type||n.type===c.SVG)){var f=u(u({width:d,height:d},n.props),l);return Object(i.createElement)(c.SVG,f)}return Object(i.isValidElement)(n)?Object(i.cloneElement)(n,u({size:d},l)):n}},,,,,,,,function(e,t,n){"use strict";var r=n(594);e.exports=Function.prototype.bind||r},function(e,t,n){"use strict";e.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var e={},t=Symbol("test"),n=Object(t);if("string"==typeof t)return!1;if("[object Symbol]"!==Object.prototype.toString.call(t))return!1;if("[object Symbol]"!==Object.prototype.toString.call(n))return!1;for(t in e[t]=42,e)return!1;if("function"==typeof Object.keys&&0!==Object.keys(e).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(e).length)return!1;var r=Object.getOwnPropertySymbols(e);if(1!==r.length||r[0]!==t)return!1;if(!Object.prototype.propertyIsEnumerable.call(e,t))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var o=Object.getOwnPropertyDescriptor(e,t);if(42!==o.value||!0!==o.enumerable)return!1}return!0}},function(e,t,n){"use strict";var r=n(81),o=r("%TypeError%"),a=r("%SyntaxError%"),i=n(211),c={"Property Descriptor":function(e,t){if("Object"!==e(t))return!1;var n={"[[Configurable]]":!0,"[[Enumerable]]":!0,"[[Get]]":!0,"[[Set]]":!0,"[[Value]]":!0,"[[Writable]]":!0};for(var r in t)if(i(t,r)&&!n[r])return!1;var a=i(t,"[[Value]]"),c=i(t,"[[Get]]")||i(t,"[[Set]]");if(a&&c)throw new o("Property Descriptors may not be both accessor and data descriptors");return!0}};e.exports=function(e,t,n,r){var i=c[t];if("function"!=typeof i)throw new a("unknown record type: "+t);if(!i(e,r))throw new o(n+" must be a "+t)}},function(e,t,n){"use strict";e.exports=Number.isNaN||function(e){return e!=e}},function(e,t,n){"use strict";var r,o,a=Function.prototype.toString,i="object"==typeof Reflect&&null!==Reflect&&Reflect.apply;if("function"==typeof i&&"function"==typeof Object.defineProperty)try{r=Object.defineProperty({},"length",{get:function(){throw o}}),o={},i((function(){throw 42}),null,r)}catch(e){e!==o&&(i=null)}else i=null;var c=/^\s*class\b/,s=function(e){try{var t=a.call(e);return c.test(t)}catch(e){return!1}},l=Object.prototype.toString,u="function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag,d="object"==typeof document&&void 0===document.all&&void 0!==document.all?document.all:{};e.exports=i?function(e){if(e===d)return!0;if(!e)return!1;if("function"!=typeof e&&"object"!=typeof e)return!1;if("function"==typeof e&&!e.prototype)return!0;try{i(e,null,r)}catch(e){if(e!==o)return!1}return!s(e)}:function(e){if(e===d)return!0;if(!e)return!1;if("function"!=typeof e&&"object"!=typeof e)return!1;if("function"==typeof e&&!e.prototype)return!0;if(u)return function(e){try{return!s(e)&&(a.call(e),!0)}catch(e){return!1}}(e);if(s(e))return!1;var t=l.call(e);return"[object Function]"===t||"[object GeneratorFunction]"===t}},function(e,t,n){"use strict";var r=String.prototype.replace,o=/%20/g;e.exports={default:"RFC3986",formatters:{RFC1738:function(e){return r.call(e,o,"+")},RFC3986:function(e){return String(e)}},RFC1738:"RFC1738",RFC3986:"RFC3986"}},function(e,t,n){var r=n(654),o=n(655),a=n(293),i=/^\d+$/,c=Object.prototype.hasOwnProperty,s=r(Object,"keys"),l=("length",function(e){return null==e?void 0:e.length});function u(e,t){return t=null==t?9007199254740991:t,(e="number"==typeof e||i.test(e)?+e:-1)>-1&&e%1==0&&e<t}function d(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}function f(e){for(var t=function(e){if(null==e)return[];p(e)||(e=Object(e));var t=e.length;t=t&&d(t)&&(a(e)||o(e))&&t||0;for(var n=e.constructor,r=-1,i="function"==typeof n&&n.prototype===e,s=Array(t),l=t>0;++r<t;)s[r]=r+"";for(var f in e)l&&u(f,t)||"constructor"==f&&(i||!c.call(e,f))||s.push(f);return s}(e),n=t.length,r=n&&e.length,i=!!r&&d(r)&&(a(e)||o(e)),s=-1,l=[];++s<n;){var f=t[s];(i&&u(f,r)||c.call(e,f))&&l.push(f)}return l}function p(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}var h=s?function(e){var t,n=null==e?void 0:e.constructor;return"function"==typeof n&&n.prototype===e||"function"!=typeof e&&null!=(t=e)&&d(l(t))?f(e):p(e)?s(e):[]}:f;e.exports=h},function(e,t,n){var r=n(148),o=n(415).f,a=n(227),i=n(420),c=n(340),s=n(668),l=n(673);e.exports=function(e,t){var n,u,d,f,p,h=e.target,m=e.global,y=e.stat;if(n=m?r:y?r[h]||c(h,{}):(r[h]||{}).prototype)for(u in t){if(f=t[u],d=e.noTargetGet?(p=o(n,u))&&p.value:n[u],!l(m?u:h+(y?".":"#")+u,e.forced)&&void 0!==d){if(typeof f==typeof d)continue;s(f,d)}(e.sham||d&&d.sham)&&a(f,"sham",!0),i(n,u,f,e)}}},function(e,t,n){var r=n(417),o=n(338);e.exports=function(e){return r(o(e))}},function(e,t){var n={}.toString;e.exports=function(e){return n.call(e).slice(8,-1)}},function(e,t){e.exports=function(e){if(null==e)throw TypeError("Can't call method on "+e);return e}},function(e,t,n){var r=n(246);e.exports=function(e,t){if(!r(e))return e;var n,o;if(t&&"function"==typeof(n=e.toString)&&!r(o=n.call(e)))return o;if("function"==typeof(n=e.valueOf)&&!r(o=n.call(e)))return o;if(!t&&"function"==typeof(n=e.toString)&&!r(o=n.call(e)))return o;throw TypeError("Can't convert object to primitive value")}},function(e,t,n){var r=n(148),o=n(227);e.exports=function(e,t){try{o(r,e,t)}catch(n){r[e]=t}return t}},function(e,t,n){var r=n(148),o=n(340),a=r["__core-js_shared__"]||o("__core-js_shared__",{});e.exports=a},function(e,t,n){var r=n(423),o=n(424),a=r("keys");e.exports=function(e){return a[e]||(a[e]=o(e))}},function(e,t){e.exports=!1},function(e,t){e.exports={}},function(e,t,n){var r=n(346),o=n(148),a=function(e){return"function"==typeof e?e:void 0};e.exports=function(e,t){return arguments.length<2?a(r[e])||a(o[e]):r[e]&&r[e][t]||o[e]&&o[e][t]}},function(e,t,n){var r=n(148);e.exports=r},function(e,t){var n=Math.ceil,r=Math.floor;e.exports=function(e){return isNaN(e=+e)?0:(e>0?r:n)(e)}},function(e,t){e.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},function(e,t,n){var r=n(338);e.exports=function(e){return Object(r(e))}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PureCalendarDay=void 0;var r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=g(n(112)),i=g(n(11)),c=g(n(2)),s=g(n(228)),l=g(n(178)),u=n(104),d=n(138),f=g(n(31)),p=n(118),h=g(n(128)),m=g(n(436)),y=g(n(296)),b=n(77);function g(e){return e&&e.__esModule?e:{default:e}}function v(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function O(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}var w=(0,u.forbidExtraProps)((0,a.default)({},d.withStylesPropTypes,{day:l.default.momentObj,daySize:u.nonNegativeInteger,isOutsideDay:c.default.bool,modifiers:y.default,isFocused:c.default.bool,tabIndex:c.default.oneOf([0,-1]),onDayClick:c.default.func,onDayMouseEnter:c.default.func,onDayMouseLeave:c.default.func,renderDayContents:c.default.func,ariaLabelFormat:c.default.string,phrases:c.default.shape((0,h.default)(p.CalendarDayPhrases))})),_={day:(0,f.default)(),daySize:b.DAY_SIZE,isOutsideDay:!1,modifiers:new Set,isFocused:!1,tabIndex:-1,onDayClick:function(){},onDayMouseEnter:function(){},onDayMouseLeave:function(){},renderDayContents:null,ariaLabelFormat:"dddd, LL",phrases:p.CalendarDayPhrases},k=function(e){function t(){var e;v(this,t);for(var n=arguments.length,r=Array(n),o=0;o<n;o++)r[o]=arguments[o];var a=O(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(r)));return a.setButtonRef=a.setButtonRef.bind(a),a}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),o(t,[{key:"shouldComponentUpdate",value:function(e,t){return(0,s.default)(this,e,t)}},{key:"componentDidUpdate",value:function(e){var t=this.props,n=t.isFocused,r=t.tabIndex;0===r&&(n||r!==e.tabIndex)&&this.buttonRef.focus()}},{key:"onDayClick",value:function(e,t){(0,this.props.onDayClick)(e,t)}},{key:"onDayMouseEnter",value:function(e,t){(0,this.props.onDayMouseEnter)(e,t)}},{key:"onDayMouseLeave",value:function(e,t){(0,this.props.onDayMouseLeave)(e,t)}},{key:"onKeyDown",value:function(e,t){var n=this.props.onDayClick,r=t.key;"Enter"!==r&&" "!==r||n(e,t)}},{key:"setButtonRef",value:function(e){this.buttonRef=e}},{key:"render",value:function(){var e=this,t=this.props,n=t.day,o=t.ariaLabelFormat,a=t.daySize,c=t.isOutsideDay,s=t.modifiers,l=t.renderDayContents,u=t.tabIndex,f=t.styles,p=t.phrases;if(!n)return i.default.createElement("td",null);var h=(0,m.default)(n,o,a,s,p),y=h.daySizeStyles,b=h.useDefaultCursor,g=h.selected,v=h.hoveredSpan,O=h.isOutsideRange,w=h.ariaLabel;return i.default.createElement("td",r({},(0,d.css)(f.CalendarDay,b&&f.CalendarDay__defaultCursor,f.CalendarDay__default,c&&f.CalendarDay__outside,s.has("today")&&f.CalendarDay__today,s.has("first-day-of-week")&&f.CalendarDay__firstDayOfWeek,s.has("last-day-of-week")&&f.CalendarDay__lastDayOfWeek,s.has("hovered-offset")&&f.CalendarDay__hovered_offset,s.has("highlighted-calendar")&&f.CalendarDay__highlighted_calendar,s.has("blocked-minimum-nights")&&f.CalendarDay__blocked_minimum_nights,s.has("blocked-calendar")&&f.CalendarDay__blocked_calendar,v&&f.CalendarDay__hovered_span,s.has("selected-span")&&f.CalendarDay__selected_span,s.has("last-in-range")&&f.CalendarDay__last_in_range,s.has("selected-start")&&f.CalendarDay__selected_start,s.has("selected-end")&&f.CalendarDay__selected_end,g&&f.CalendarDay__selected,O&&f.CalendarDay__blocked_out_of_range,y),{role:"button",ref:this.setButtonRef,"aria-label":w,onMouseEnter:function(t){e.onDayMouseEnter(n,t)},onMouseLeave:function(t){e.onDayMouseLeave(n,t)},onMouseUp:function(e){e.currentTarget.blur()},onClick:function(t){e.onDayClick(n,t)},onKeyDown:function(t){e.onKeyDown(n,t)},tabIndex:u}),l?l(n,s):n.format("D"))}}]),t}(i.default.Component);k.propTypes=w,k.defaultProps=_,t.PureCalendarDay=k,t.default=(0,d.withStyles)((function(e){var t=e.reactDates,n=t.color;return{CalendarDay:{boxSizing:"border-box",cursor:"pointer",fontSize:t.font.size,textAlign:"center",":active":{outline:0}},CalendarDay__defaultCursor:{cursor:"default"},CalendarDay__default:{border:"1px solid "+String(n.core.borderLight),color:n.text,background:n.background,":hover":{background:n.core.borderLight,border:"1px double "+String(n.core.borderLight),color:"inherit"}},CalendarDay__hovered_offset:{background:n.core.borderBright,border:"1px double "+String(n.core.borderLight),color:"inherit"},CalendarDay__outside:{border:0,background:n.outside.backgroundColor,color:n.outside.color,":hover":{border:0}},CalendarDay__blocked_minimum_nights:{background:n.minimumNights.backgroundColor,border:"1px solid "+String(n.minimumNights.borderColor),color:n.minimumNights.color,":hover":{background:n.minimumNights.backgroundColor_hover,color:n.minimumNights.color_active},":active":{background:n.minimumNights.backgroundColor_active,color:n.minimumNights.color_active}},CalendarDay__highlighted_calendar:{background:n.highlighted.backgroundColor,color:n.highlighted.color,":hover":{background:n.highlighted.backgroundColor_hover,color:n.highlighted.color_active},":active":{background:n.highlighted.backgroundColor_active,color:n.highlighted.color_active}},CalendarDay__selected_span:{background:n.selectedSpan.backgroundColor,border:"1px solid "+String(n.selectedSpan.borderColor),color:n.selectedSpan.color,":hover":{background:n.selectedSpan.backgroundColor_hover,border:"1px solid "+String(n.selectedSpan.borderColor),color:n.selectedSpan.color_active},":active":{background:n.selectedSpan.backgroundColor_active,border:"1px solid "+String(n.selectedSpan.borderColor),color:n.selectedSpan.color_active}},CalendarDay__last_in_range:{borderRight:n.core.primary},CalendarDay__selected:{background:n.selected.backgroundColor,border:"1px solid "+String(n.selected.borderColor),color:n.selected.color,":hover":{background:n.selected.backgroundColor_hover,border:"1px solid "+String(n.selected.borderColor),color:n.selected.color_active},":active":{background:n.selected.backgroundColor_active,border:"1px solid "+String(n.selected.borderColor),color:n.selected.color_active}},CalendarDay__hovered_span:{background:n.hoveredSpan.backgroundColor,border:"1px solid "+String(n.hoveredSpan.borderColor),color:n.hoveredSpan.color,":hover":{background:n.hoveredSpan.backgroundColor_hover,border:"1px solid "+String(n.hoveredSpan.borderColor),color:n.hoveredSpan.color_active},":active":{background:n.hoveredSpan.backgroundColor_active,border:"1px solid "+String(n.hoveredSpan.borderColor),color:n.hoveredSpan.color_active}},CalendarDay__blocked_calendar:{background:n.blocked_calendar.backgroundColor,border:"1px solid "+String(n.blocked_calendar.borderColor),color:n.blocked_calendar.color,":hover":{background:n.blocked_calendar.backgroundColor_hover,border:"1px solid "+String(n.blocked_calendar.borderColor),color:n.blocked_calendar.color_active},":active":{background:n.blocked_calendar.backgroundColor_active,border:"1px solid "+String(n.blocked_calendar.borderColor),color:n.blocked_calendar.color_active}},CalendarDay__blocked_out_of_range:{background:n.blocked_out_of_range.backgroundColor,border:"1px solid "+String(n.blocked_out_of_range.borderColor),color:n.blocked_out_of_range.color,":hover":{background:n.blocked_out_of_range.backgroundColor_hover,border:"1px solid "+String(n.blocked_out_of_range.borderColor),color:n.blocked_out_of_range.color_active},":active":{background:n.blocked_out_of_range.backgroundColor_active,border:"1px solid "+String(n.blocked_out_of_range.borderColor),color:n.blocked_out_of_range.color_active}},CalendarDay__selected_start:{},CalendarDay__selected_end:{},CalendarDay__today:{},CalendarDay__firstDayOfWeek:{},CalendarDay__lastDayOfWeek:{}}}))(k)},function(e,t,n){e.exports=n(721)},function(e,t,n){"use strict";var r=n(176),o=n(245),a=n(442),i=n(443),c=n(722),s=o(i(),Object);r(s,{getPolyfill:i,implementation:a,shim:c}),e.exports=s},function(e,t,n){"use strict";function r(e,t,n){var r="number"==typeof t,o="number"==typeof n,a="number"==typeof e;return r&&o?t+n:r&&a?t+e:r?t:o&&a?n+e:o?n:a?2*e:0}Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){var n=e.font.input,o=n.lineHeight,a=n.lineHeight_small,i=e.spacing,c=i.inputPadding,s=i.displayTextPaddingVertical,l=i.displayTextPaddingTop,u=i.displayTextPaddingBottom,d=i.displayTextPaddingVertical_small,f=i.displayTextPaddingTop_small,p=i.displayTextPaddingBottom_small,h=t?a:o,m=t?r(d,f,p):r(s,l,u);return parseInt(h,10)+2*c+m}},function(e,t){e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){var n=r.default.isMoment(e)?e:(0,o.default)(e,t);return n?n.format(a.DISPLAY_FORMAT):null};var r=i(n(31)),o=i(n(230)),a=n(77);function i(e){return e&&e.__esModule?e:{default:e}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t,n,a){var i=t.clone().startOf("month");if(a&&(i=i.startOf("week")),(0,r.default)(e,i))return!1;var c=t.clone().add(n-1,"months").endOf("month");return a&&(c=c.endOf("week")),!(0,o.default)(e,c)};var r=a(n(251)),o=a(n(301));function a(e){return e&&e.__esModule?e:{default:e}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PureDayPicker=t.defaultProps=void 0;var r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=F(n(112)),i=F(n(11)),c=F(n(2)),s=F(n(228)),l=n(104),u=n(138),d=F(n(31)),f=F(n(456)),p=F(n(232)),h=F(n(351)),m=n(118),y=F(n(128)),b=F(n(439)),g=F(n(737)),v=n(740),O=F(v),w=F(n(742)),_=F(n(440)),k=F(n(438)),S=F(n(743)),j=F(n(356)),E=F(n(296)),C=F(n(231)),D=F(n(213)),P=F(n(249)),x=n(77);function F(e){return e&&e.__esModule?e:{default:e}}function T(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}var M=(0,l.forbidExtraProps)((0,a.default)({},u.withStylesPropTypes,{enableOutsideDays:c.default.bool,numberOfMonths:c.default.number,orientation:C.default,withPortal:c.default.bool,onOutsideClick:c.default.func,hidden:c.default.bool,initialVisibleMonth:c.default.func,firstDayOfWeek:D.default,renderCalendarInfo:c.default.func,calendarInfoPosition:P.default,hideKeyboardShortcutsPanel:c.default.bool,daySize:l.nonNegativeInteger,isRTL:c.default.bool,verticalHeight:l.nonNegativeInteger,noBorder:c.default.bool,transitionDuration:l.nonNegativeInteger,verticalBorderSpacing:l.nonNegativeInteger,horizontalMonthPadding:l.nonNegativeInteger,navPrev:c.default.node,navNext:c.default.node,noNavButtons:c.default.bool,onPrevMonthClick:c.default.func,onNextMonthClick:c.default.func,onMonthChange:c.default.func,onYearChange:c.default.func,onMultiplyScrollableMonths:c.default.func,renderMonthText:(0,l.mutuallyExclusiveProps)(c.default.func,"renderMonthText","renderMonthElement"),renderMonthElement:(0,l.mutuallyExclusiveProps)(c.default.func,"renderMonthText","renderMonthElement"),modifiers:c.default.objectOf(c.default.objectOf(E.default)),renderCalendarDay:c.default.func,renderDayContents:c.default.func,onDayClick:c.default.func,onDayMouseEnter:c.default.func,onDayMouseLeave:c.default.func,isFocused:c.default.bool,getFirstFocusableDay:c.default.func,onBlur:c.default.func,showKeyboardShortcuts:c.default.bool,monthFormat:c.default.string,weekDayFormat:c.default.string,phrases:c.default.shape((0,y.default)(m.DayPickerPhrases)),dayAriaLabelFormat:c.default.string})),R=t.defaultProps={enableOutsideDays:!1,numberOfMonths:2,orientation:x.HORIZONTAL_ORIENTATION,withPortal:!1,onOutsideClick:function(){},hidden:!1,initialVisibleMonth:function(){return(0,d.default)()},firstDayOfWeek:null,renderCalendarInfo:null,calendarInfoPosition:x.INFO_POSITION_BOTTOM,hideKeyboardShortcutsPanel:!1,daySize:x.DAY_SIZE,isRTL:!1,verticalHeight:null,noBorder:!1,transitionDuration:void 0,verticalBorderSpacing:void 0,horizontalMonthPadding:13,navPrev:null,navNext:null,noNavButtons:!1,onPrevMonthClick:function(){},onNextMonthClick:function(){},onMonthChange:function(){},onYearChange:function(){},onMultiplyScrollableMonths:function(){},renderMonthText:null,renderMonthElement:null,modifiers:{},renderCalendarDay:void 0,renderDayContents:null,onDayClick:function(){},onDayMouseEnter:function(){},onDayMouseLeave:function(){},isFocused:!1,getFirstFocusableDay:null,onBlur:function(){},showKeyboardShortcuts:!1,monthFormat:"MMMM YYYY",weekDayFormat:"dd",phrases:m.DayPickerPhrases,dayAriaLabelFormat:void 0},I=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e)),r=e.hidden?(0,d.default)():e.initialVisibleMonth(),o=r.clone().startOf("month");e.getFirstFocusableDay&&(o=e.getFirstFocusableDay(r));var a=e.horizontalMonthPadding,i=e.isRTL&&n.isHorizontal()?-(0,_.default)(e.daySize,a):0;return n.hasSetInitialVisibleMonth=!e.hidden,n.state={currentMonth:r,monthTransition:null,translationValue:i,scrollableMonthMultiple:1,calendarMonthWidth:(0,_.default)(e.daySize,a),focusedDate:!e.hidden||e.isFocused?o:null,nextFocusedDate:null,showKeyboardShortcuts:e.showKeyboardShortcuts,onKeyboardShortcutsPanelClose:function(){},isTouchDevice:(0,p.default)(),withMouseInteractions:!0,calendarInfoWidth:0,monthTitleHeight:null,hasSetHeight:!1},n.setCalendarMonthWeeks(r),n.calendarMonthGridHeight=0,n.setCalendarInfoWidthTimeout=null,n.onKeyDown=n.onKeyDown.bind(n),n.throttledKeyDown=(0,f.default)(n.onFinalKeyDown,200,{trailing:!1}),n.onPrevMonthClick=n.onPrevMonthClick.bind(n),n.onNextMonthClick=n.onNextMonthClick.bind(n),n.onMonthChange=n.onMonthChange.bind(n),n.onYearChange=n.onYearChange.bind(n),n.multiplyScrollableMonths=n.multiplyScrollableMonths.bind(n),n.updateStateAfterMonthTransition=n.updateStateAfterMonthTransition.bind(n),n.openKeyboardShortcutsPanel=n.openKeyboardShortcutsPanel.bind(n),n.closeKeyboardShortcutsPanel=n.closeKeyboardShortcutsPanel.bind(n),n.setCalendarInfoRef=n.setCalendarInfoRef.bind(n),n.setContainerRef=n.setContainerRef.bind(n),n.setTransitionContainerRef=n.setTransitionContainerRef.bind(n),n.setMonthTitleHeight=n.setMonthTitleHeight.bind(n),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),o(t,[{key:"componentDidMount",value:function(){var e=this.state.currentMonth;this.calendarInfo?this.setState({isTouchDevice:(0,p.default)(),calendarInfoWidth:(0,k.default)(this.calendarInfo,"width",!0,!0)}):this.setState({isTouchDevice:(0,p.default)()}),this.setCalendarMonthWeeks(e)}},{key:"componentWillReceiveProps",value:function(e){var t=e.hidden,n=e.isFocused,r=e.showKeyboardShortcuts,o=e.onBlur,a=e.renderMonthText,i=e.horizontalMonthPadding,c=this.state.currentMonth;t||this.hasSetInitialVisibleMonth||(this.hasSetInitialVisibleMonth=!0,this.setState({currentMonth:e.initialVisibleMonth()}));var s=this.props,l=s.daySize,u=s.isFocused,d=s.renderMonthText;if(e.daySize!==l&&this.setState({calendarMonthWidth:(0,_.default)(e.daySize,i)}),n!==u)if(n){var f=this.getFocusedDay(c),p=this.state.onKeyboardShortcutsPanelClose;e.showKeyboardShortcuts&&(p=o),this.setState({showKeyboardShortcuts:r,onKeyboardShortcutsPanelClose:p,focusedDate:f,withMouseInteractions:!1})}else this.setState({focusedDate:null});a!==d&&this.setState({monthTitleHeight:null})}},{key:"shouldComponentUpdate",value:function(e,t){return(0,s.default)(this,e,t)}},{key:"componentWillUpdate",value:function(){var e=this,t=this.props.transitionDuration;this.calendarInfo&&(this.setCalendarInfoWidthTimeout=setTimeout((function(){var t=e.state.calendarInfoWidth,n=(0,k.default)(e.calendarInfo,"width",!0,!0);t!==n&&e.setState({calendarInfoWidth:n})}),t))}},{key:"componentDidUpdate",value:function(e){var t=this.props,n=t.orientation,r=t.daySize,o=t.isFocused,a=t.numberOfMonths,i=this.state,c=i.focusedDate,s=i.monthTitleHeight;if(this.isHorizontal()&&(n!==e.orientation||r!==e.daySize)){var l=this.calendarMonthWeeks.slice(1,a+1),u=s+Math.max.apply(Math,[0].concat(T(l)))*(r-1)+1;this.adjustDayPickerHeight(u)}e.isFocused||!o||c||this.container.focus()}},{key:"componentWillUnmount",value:function(){clearTimeout(this.setCalendarInfoWidthTimeout)}},{key:"onKeyDown",value:function(e){e.stopPropagation(),x.MODIFIER_KEY_NAMES.has(e.key)||this.throttledKeyDown(e)}},{key:"onFinalKeyDown",value:function(e){this.setState({withMouseInteractions:!1});var t=this.props,n=t.onBlur,r=t.isRTL,o=this.state,a=o.focusedDate,i=o.showKeyboardShortcuts;if(a){var c=a.clone(),s=!1,l=(0,S.default)();switch(e.key){case"ArrowUp":e.preventDefault(),c.subtract(1,"week"),s=this.maybeTransitionPrevMonth(c);break;case"ArrowLeft":e.preventDefault(),r?c.add(1,"day"):c.subtract(1,"day"),s=this.maybeTransitionPrevMonth(c);break;case"Home":e.preventDefault(),c.startOf("week"),s=this.maybeTransitionPrevMonth(c);break;case"PageUp":e.preventDefault(),c.subtract(1,"month"),s=this.maybeTransitionPrevMonth(c);break;case"ArrowDown":e.preventDefault(),c.add(1,"week"),s=this.maybeTransitionNextMonth(c);break;case"ArrowRight":e.preventDefault(),r?c.subtract(1,"day"):c.add(1,"day"),s=this.maybeTransitionNextMonth(c);break;case"End":e.preventDefault(),c.endOf("week"),s=this.maybeTransitionNextMonth(c);break;case"PageDown":e.preventDefault(),c.add(1,"month"),s=this.maybeTransitionNextMonth(c);break;case"?":this.openKeyboardShortcutsPanel((function(){l&&l.focus()}));break;case"Escape":i?this.closeKeyboardShortcutsPanel():n()}s||this.setState({focusedDate:c})}}},{key:"onPrevMonthClick",value:function(e,t){var n=this.props,r=n.daySize,o=n.isRTL,a=n.numberOfMonths,i=this.state,c=i.calendarMonthWidth,s=i.monthTitleHeight;t&&t.preventDefault();var l=void 0;if(this.isVertical())l=s+this.calendarMonthWeeks[0]*(r-1)+1;else if(this.isHorizontal()){l=c,o&&(l=-2*c);var u=this.calendarMonthWeeks.slice(0,a),d=s+Math.max.apply(Math,[0].concat(T(u)))*(r-1)+1;this.adjustDayPickerHeight(d)}this.setState({monthTransition:"prev",translationValue:l,focusedDate:null,nextFocusedDate:e})}},{key:"onMonthChange",value:function(e){this.setCalendarMonthWeeks(e),this.calculateAndSetDayPickerHeight(),this.setState({monthTransition:"month_selection",translationValue:1e-5,focusedDate:null,nextFocusedDate:e,currentMonth:e})}},{key:"onYearChange",value:function(e){this.setCalendarMonthWeeks(e),this.calculateAndSetDayPickerHeight(),this.setState({monthTransition:"year_selection",translationValue:1e-4,focusedDate:null,nextFocusedDate:e,currentMonth:e})}},{key:"onNextMonthClick",value:function(e,t){var n=this.props,r=n.isRTL,o=n.numberOfMonths,a=n.daySize,i=this.state,c=i.calendarMonthWidth,s=i.monthTitleHeight;t&&t.preventDefault();var l=void 0;if(this.isVertical()&&(l=-(s+this.calendarMonthWeeks[1]*(a-1)+1)),this.isHorizontal()){l=-c,r&&(l=0);var u=this.calendarMonthWeeks.slice(2,o+2),d=s+Math.max.apply(Math,[0].concat(T(u)))*(a-1)+1;this.adjustDayPickerHeight(d)}this.setState({monthTransition:"next",translationValue:l,focusedDate:null,nextFocusedDate:e})}},{key:"getFirstDayOfWeek",value:function(){var e=this.props.firstDayOfWeek;return null==e?d.default.localeData().firstDayOfWeek():e}},{key:"getFirstVisibleIndex",value:function(){var e=this.props.orientation,t=this.state.monthTransition;if(e===x.VERTICAL_SCROLLABLE)return 0;var n=1;return"prev"===t?n-=1:"next"===t&&(n+=1),n}},{key:"getFocusedDay",value:function(e){var t=this.props,n=t.getFirstFocusableDay,r=t.numberOfMonths,o=void 0;return n&&(o=n(e)),!e||o&&(0,j.default)(o,e,r)||(o=e.clone().startOf("month")),o}},{key:"setMonthTitleHeight",value:function(e){var t=this;this.setState({monthTitleHeight:e},(function(){t.calculateAndSetDayPickerHeight()}))}},{key:"setCalendarMonthWeeks",value:function(e){var t=this.props.numberOfMonths;this.calendarMonthWeeks=[];for(var n=e.clone().subtract(1,"months"),r=this.getFirstDayOfWeek(),o=0;o<t+2;o+=1){var a=(0,w.default)(n,r);this.calendarMonthWeeks.push(a),n=n.add(1,"months")}}},{key:"setContainerRef",value:function(e){this.container=e}},{key:"setCalendarInfoRef",value:function(e){this.calendarInfo=e}},{key:"setTransitionContainerRef",value:function(e){this.transitionContainer=e}},{key:"maybeTransitionNextMonth",value:function(e){var t=this.props.numberOfMonths,n=this.state,r=n.currentMonth,o=n.focusedDate,a=e.month(),i=o.month(),c=(0,j.default)(e,r,t);return a!==i&&!c&&(this.onNextMonthClick(e),!0)}},{key:"maybeTransitionPrevMonth",value:function(e){var t=this.props.numberOfMonths,n=this.state,r=n.currentMonth,o=n.focusedDate,a=e.month(),i=o.month(),c=(0,j.default)(e,r,t);return a!==i&&!c&&(this.onPrevMonthClick(e),!0)}},{key:"multiplyScrollableMonths",value:function(e){var t=this.props.onMultiplyScrollableMonths;e&&e.preventDefault(),t&&t(e),this.setState((function(e){return{scrollableMonthMultiple:e.scrollableMonthMultiple+1}}))}},{key:"isHorizontal",value:function(){return this.props.orientation===x.HORIZONTAL_ORIENTATION}},{key:"isVertical",value:function(){var e=this.props.orientation;return e===x.VERTICAL_ORIENTATION||e===x.VERTICAL_SCROLLABLE}},{key:"updateStateAfterMonthTransition",value:function(){var e=this,t=this.props,n=t.onPrevMonthClick,r=t.onNextMonthClick,o=t.numberOfMonths,a=t.onMonthChange,i=t.onYearChange,c=t.isRTL,s=this.state,l=s.currentMonth,u=s.monthTransition,d=s.focusedDate,f=s.nextFocusedDate,p=s.withMouseInteractions,h=s.calendarMonthWidth;if(u){var m=l.clone(),y=this.getFirstDayOfWeek();if("prev"===u){m.subtract(1,"month"),n&&n(m);var b=m.clone().subtract(1,"month"),g=(0,w.default)(b,y);this.calendarMonthWeeks=[g].concat(T(this.calendarMonthWeeks.slice(0,-1)))}else if("next"===u){m.add(1,"month"),r&&r(m);var v=m.clone().add(o,"month"),O=(0,w.default)(v,y);this.calendarMonthWeeks=[].concat(T(this.calendarMonthWeeks.slice(1)),[O])}else"month_selection"===u?a&&a(m):"year_selection"===u&&i&&i(m);var _=null;f?_=f:d||p||(_=this.getFocusedDay(m)),this.setState({currentMonth:m,monthTransition:null,translationValue:c&&this.isHorizontal()?-h:0,nextFocusedDate:null,focusedDate:_},(function(){if(p){var t=(0,S.default)();t&&t!==document.body&&e.container.contains(t)&&t.blur()}}))}}},{key:"adjustDayPickerHeight",value:function(e){var t=this,n=e+23;n!==this.calendarMonthGridHeight&&(this.transitionContainer.style.height=String(n)+"px",this.calendarMonthGridHeight||setTimeout((function(){t.setState({hasSetHeight:!0})}),0),this.calendarMonthGridHeight=n)}},{key:"calculateAndSetDayPickerHeight",value:function(){var e=this.props,t=e.daySize,n=e.numberOfMonths,r=this.state.monthTitleHeight,o=this.calendarMonthWeeks.slice(1,n+1),a=r+Math.max.apply(Math,[0].concat(T(o)))*(t-1)+1;this.isHorizontal()&&this.adjustDayPickerHeight(a)}},{key:"openKeyboardShortcutsPanel",value:function(e){this.setState({showKeyboardShortcuts:!0,onKeyboardShortcutsPanelClose:e})}},{key:"closeKeyboardShortcutsPanel",value:function(){var e=this.state.onKeyboardShortcutsPanelClose;e&&e(),this.setState({onKeyboardShortcutsPanelClose:null,showKeyboardShortcuts:!1})}},{key:"renderNavigation",value:function(){var e=this,t=this.props,n=t.navPrev,r=t.navNext,o=t.noNavButtons,a=t.orientation,c=t.phrases,s=t.isRTL;if(o)return null;var l;return l=a===x.VERTICAL_SCROLLABLE?this.multiplyScrollableMonths:function(t){e.onNextMonthClick(null,t)},i.default.createElement(g.default,{onPrevMonthClick:function(t){e.onPrevMonthClick(null,t)},onNextMonthClick:l,navPrev:n,navNext:r,orientation:a,phrases:c,isRTL:s})}},{key:"renderWeekHeader",value:function(e){var t=this.props,n=t.daySize,o=t.horizontalMonthPadding,a=t.orientation,c=t.weekDayFormat,s=t.styles,l=this.state.calendarMonthWidth,f=a===x.VERTICAL_SCROLLABLE,p={left:e*l},h={marginLeft:-l/2},m={};this.isHorizontal()?m=p:this.isVertical()&&!f&&(m=h);for(var y=this.getFirstDayOfWeek(),b=[],g=0;g<7;g+=1)b.push(i.default.createElement("li",r({key:g},(0,u.css)(s.DayPicker_weekHeader_li,{width:n})),i.default.createElement("small",null,(0,d.default)().day((g+y)%7).format(c))));return i.default.createElement("div",r({},(0,u.css)(s.DayPicker_weekHeader,this.isVertical()&&s.DayPicker_weekHeader__vertical,f&&s.DayPicker_weekHeader__verticalScrollable,m,{padding:"0 "+String(o)+"px"}),{key:"week-"+String(e)}),i.default.createElement("ul",(0,u.css)(s.DayPicker_weekHeader_ul),b))}},{key:"render",value:function(){for(var e=this,t=this.state,n=t.calendarMonthWidth,o=t.currentMonth,a=t.monthTransition,c=t.translationValue,s=t.scrollableMonthMultiple,l=t.focusedDate,d=t.showKeyboardShortcuts,f=t.isTouchDevice,p=t.hasSetHeight,m=t.calendarInfoWidth,y=t.monthTitleHeight,g=this.props,w=g.enableOutsideDays,_=g.numberOfMonths,k=g.orientation,S=g.modifiers,j=g.withPortal,E=g.onDayClick,C=g.onDayMouseEnter,D=g.onDayMouseLeave,P=g.firstDayOfWeek,F=g.renderMonthText,T=g.renderCalendarDay,M=g.renderDayContents,R=g.renderCalendarInfo,I=g.renderMonthElement,A=g.calendarInfoPosition,N=g.hideKeyboardShortcutsPanel,L=g.onOutsideClick,U=g.monthFormat,B=g.daySize,H=g.isFocused,q=g.isRTL,z=g.styles,V=g.theme,K=g.phrases,W=g.verticalHeight,G=g.dayAriaLabelFormat,Y=g.noBorder,$=g.transitionDuration,Q=g.verticalBorderSpacing,J=g.horizontalMonthPadding,Z=V.reactDates.spacing.dayPickerHorizontalPadding,X=this.isHorizontal(),ee=this.isVertical()?1:_,te=[],ne=0;ne<ee;ne+=1)te.push(this.renderWeekHeader(ne));var re=k===x.VERTICAL_SCROLLABLE,oe=void 0;X?oe=this.calendarMonthGridHeight:!this.isVertical()||re||j||(oe=W||1.75*n);var ae=null!==a,ie=!ae&&H,ce=v.BOTTOM_RIGHT;this.isVertical()&&(ce=j?v.TOP_LEFT:v.TOP_RIGHT);var se=X&&p,le=A===x.INFO_POSITION_TOP,ue=A===x.INFO_POSITION_BOTTOM,de=A===x.INFO_POSITION_BEFORE,fe=A===x.INFO_POSITION_AFTER,pe=de||fe,he=R&&i.default.createElement("div",r({ref:this.setCalendarInfoRef},(0,u.css)(pe&&z.DayPicker_calendarInfo__horizontal)),R()),me=R&&pe?m:0,ye=this.getFirstVisibleIndex(),be=n*_+2*Z,ge=be+me+1,ve={width:X&&be,height:oe},Oe={width:X&&be},we={width:X&&ge,marginLeft:X&&j?-ge/2:null,marginTop:X&&j?-n/2:null};return i.default.createElement("div",r({role:"application","aria-label":K.calendarLabel},(0,u.css)(z.DayPicker,X&&z.DayPicker__horizontal,re&&z.DayPicker__verticalScrollable,X&&j&&z.DayPicker_portal__horizontal,this.isVertical()&&j&&z.DayPicker_portal__vertical,we,!y&&z.DayPicker__hidden,!Y&&z.DayPicker__withBorder)),i.default.createElement(h.default,{onOutsideClick:L},(le||de)&&he,i.default.createElement("div",(0,u.css)(Oe,pe&&X&&z.DayPicker_wrapper__horizontal),i.default.createElement("div",r({},(0,u.css)(z.DayPicker_weekHeaders,X&&z.DayPicker_weekHeaders__horizontal),{"aria-hidden":"true",role:"presentation"}),te),i.default.createElement("div",r({},(0,u.css)(z.DayPicker_focusRegion),{ref:this.setContainerRef,onClick:function(e){e.stopPropagation()},onKeyDown:this.onKeyDown,onMouseUp:function(){e.setState({withMouseInteractions:!0})},role:"region",tabIndex:-1}),!re&&this.renderNavigation(),i.default.createElement("div",r({},(0,u.css)(z.DayPicker_transitionContainer,se&&z.DayPicker_transitionContainer__horizontal,this.isVertical()&&z.DayPicker_transitionContainer__vertical,re&&z.DayPicker_transitionContainer__verticalScrollable,ve),{ref:this.setTransitionContainerRef}),i.default.createElement(b.default,{setMonthTitleHeight:y?void 0:this.setMonthTitleHeight,translationValue:c,enableOutsideDays:w,firstVisibleMonthIndex:ye,initialMonth:o,isAnimating:ae,modifiers:S,orientation:k,numberOfMonths:_*s,onDayClick:E,onDayMouseEnter:C,onDayMouseLeave:D,onMonthChange:this.onMonthChange,onYearChange:this.onYearChange,renderMonthText:F,renderCalendarDay:T,renderDayContents:M,renderMonthElement:I,onMonthTransitionEnd:this.updateStateAfterMonthTransition,monthFormat:U,daySize:B,firstDayOfWeek:P,isFocused:ie,focusedDate:l,phrases:K,isRTL:q,dayAriaLabelFormat:G,transitionDuration:$,verticalBorderSpacing:Q,horizontalMonthPadding:J}),re&&this.renderNavigation()),!f&&!N&&i.default.createElement(O.default,{block:this.isVertical()&&!j,buttonLocation:ce,showKeyboardShortcutsPanel:d,openKeyboardShortcutsPanel:this.openKeyboardShortcutsPanel,closeKeyboardShortcutsPanel:this.closeKeyboardShortcutsPanel,phrases:K}))),(ue||fe)&&he))}}]),t}(i.default.Component);I.propTypes=M,I.defaultProps=R,t.PureDayPicker=I,t.default=(0,u.withStyles)((function(e){var t=e.reactDates,n=t.color,r=t.font,o=t.noScrollBarOnVerticalScrollable,i=t.spacing,c=t.zIndex;return{DayPicker:{background:n.background,position:"relative",textAlign:"left"},DayPicker__horizontal:{background:n.background},DayPicker__verticalScrollable:{height:"100%"},DayPicker__hidden:{visibility:"hidden"},DayPicker__withBorder:{boxShadow:"0 2px 6px rgba(0, 0, 0, 0.05), 0 0 0 1px rgba(0, 0, 0, 0.07)",borderRadius:3},DayPicker_portal__horizontal:{boxShadow:"none",position:"absolute",left:"50%",top:"50%"},DayPicker_portal__vertical:{position:"initial"},DayPicker_focusRegion:{outline:"none"},DayPicker_calendarInfo__horizontal:{display:"inline-block",verticalAlign:"top"},DayPicker_wrapper__horizontal:{display:"inline-block",verticalAlign:"top"},DayPicker_weekHeaders:{position:"relative"},DayPicker_weekHeaders__horizontal:{marginLeft:i.dayPickerHorizontalPadding},DayPicker_weekHeader:{color:n.placeholderText,position:"absolute",top:62,zIndex:c+2,textAlign:"left"},DayPicker_weekHeader__vertical:{left:"50%"},DayPicker_weekHeader__verticalScrollable:{top:0,display:"table-row",borderBottom:"1px solid "+String(n.core.border),background:n.background,marginLeft:0,left:0,width:"100%",textAlign:"center"},DayPicker_weekHeader_ul:{listStyle:"none",margin:"1px 0",paddingLeft:0,paddingRight:0,fontSize:r.size},DayPicker_weekHeader_li:{display:"inline-block",textAlign:"center"},DayPicker_transitionContainer:{position:"relative",overflow:"hidden",borderRadius:3},DayPicker_transitionContainer__horizontal:{transition:"height 0.2s ease-in-out"},DayPicker_transitionContainer__vertical:{width:"100%"},DayPicker_transitionContainer__verticalScrollable:(0,a.default)({paddingTop:20,height:"100%",position:"absolute",top:0,bottom:0,right:0,left:0,overflowY:"scroll"},o&&{"-webkitOverflowScrolling":"touch","::-webkit-scrollbar":{"-webkit-appearance":"none",display:"none"}})}}))(I)},function(e,t,n){"use strict";n(0),n(21),n(14),n(240)},,,,,,,,function(e,t,n){"use strict";var r=n(746),o=n(748);function a(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}t.parse=v,t.resolve=function(e,t){return v(e,!1,!0).resolve(t)},t.resolveObject=function(e,t){return e?v(e,!1,!0).resolveObject(t):t},t.format=function(e){return o.isString(e)&&(e=v(e)),e instanceof a?e.format():a.prototype.format.call(e)},t.Url=a;var i=/^([a-z0-9.+-]+:)/i,c=/:[0-9]*$/,s=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,l=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),u=["'"].concat(l),d=["%","/","?",";","#"].concat(u),f=["/","?","#"],p=/^[+a-z0-9A-Z_-]{0,63}$/,h=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,m={javascript:!0,"javascript:":!0},y={javascript:!0,"javascript:":!0},b={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},g=n(749);function v(e,t,n){if(e&&o.isObject(e)&&e instanceof a)return e;var r=new a;return r.parse(e,t,n),r}a.prototype.parse=function(e,t,n){if(!o.isString(e))throw new TypeError("Parameter 'url' must be a string, not "+typeof e);var a=e.indexOf("?"),c=-1!==a&&a<e.indexOf("#")?"?":"#",l=e.split(c);l[0]=l[0].replace(/\\/g,"/");var v=e=l.join(c);if(v=v.trim(),!n&&1===e.split("#").length){var O=s.exec(v);if(O)return this.path=v,this.href=v,this.pathname=O[1],O[2]?(this.search=O[2],this.query=t?g.parse(this.search.substr(1)):this.search.substr(1)):t&&(this.search="",this.query={}),this}var w=i.exec(v);if(w){var _=(w=w[0]).toLowerCase();this.protocol=_,v=v.substr(w.length)}if(n||w||v.match(/^\/\/[^@\/]+@[^@\/]+/)){var k="//"===v.substr(0,2);!k||w&&y[w]||(v=v.substr(2),this.slashes=!0)}if(!y[w]&&(k||w&&!b[w])){for(var S,j,E=-1,C=0;C<f.length;C++)-1!==(D=v.indexOf(f[C]))&&(-1===E||D<E)&&(E=D);for(-1!==(j=-1===E?v.lastIndexOf("@"):v.lastIndexOf("@",E))&&(S=v.slice(0,j),v=v.slice(j+1),this.auth=decodeURIComponent(S)),E=-1,C=0;C<d.length;C++){var D;-1!==(D=v.indexOf(d[C]))&&(-1===E||D<E)&&(E=D)}-1===E&&(E=v.length),this.host=v.slice(0,E),v=v.slice(E),this.parseHost(),this.hostname=this.hostname||"";var P="["===this.hostname[0]&&"]"===this.hostname[this.hostname.length-1];if(!P)for(var x=this.hostname.split(/\./),F=(C=0,x.length);C<F;C++){var T=x[C];if(T&&!T.match(p)){for(var M="",R=0,I=T.length;R<I;R++)T.charCodeAt(R)>127?M+="x":M+=T[R];if(!M.match(p)){var A=x.slice(0,C),N=x.slice(C+1),L=T.match(h);L&&(A.push(L[1]),N.unshift(L[2])),N.length&&(v="/"+N.join(".")+v),this.hostname=A.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),P||(this.hostname=r.toASCII(this.hostname));var U=this.port?":"+this.port:"",B=this.hostname||"";this.host=B+U,this.href+=this.host,P&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==v[0]&&(v="/"+v))}if(!m[_])for(C=0,F=u.length;C<F;C++){var H=u[C];if(-1!==v.indexOf(H)){var q=encodeURIComponent(H);q===H&&(q=escape(H)),v=v.split(H).join(q)}}var z=v.indexOf("#");-1!==z&&(this.hash=v.substr(z),v=v.slice(0,z));var V=v.indexOf("?");if(-1!==V?(this.search=v.substr(V),this.query=v.substr(V+1),t&&(this.query=g.parse(this.query)),v=v.slice(0,V)):t&&(this.search="",this.query={}),v&&(this.pathname=v),b[_]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){U=this.pathname||"";var K=this.search||"";this.path=U+K}return this.href=this.format(),this},a.prototype.format=function(){var e=this.auth||"";e&&(e=(e=encodeURIComponent(e)).replace(/%3A/i,":"),e+="@");var t=this.protocol||"",n=this.pathname||"",r=this.hash||"",a=!1,i="";this.host?a=e+this.host:this.hostname&&(a=e+(-1===this.hostname.indexOf(":")?this.hostname:"["+this.hostname+"]"),this.port&&(a+=":"+this.port)),this.query&&o.isObject(this.query)&&Object.keys(this.query).length&&(i=g.stringify(this.query));var c=this.search||i&&"?"+i||"";return t&&":"!==t.substr(-1)&&(t+=":"),this.slashes||(!t||b[t])&&!1!==a?(a="//"+(a||""),n&&"/"!==n.charAt(0)&&(n="/"+n)):a||(a=""),r&&"#"!==r.charAt(0)&&(r="#"+r),c&&"?"!==c.charAt(0)&&(c="?"+c),t+a+(n=n.replace(/[?#]/g,(function(e){return encodeURIComponent(e)})))+(c=c.replace("#","%23"))+r},a.prototype.resolve=function(e){return this.resolveObject(v(e,!1,!0)).format()},a.prototype.resolveObject=function(e){if(o.isString(e)){var t=new a;t.parse(e,!1,!0),e=t}for(var n=new a,r=Object.keys(this),i=0;i<r.length;i++){var c=r[i];n[c]=this[c]}if(n.hash=e.hash,""===e.href)return n.href=n.format(),n;if(e.slashes&&!e.protocol){for(var s=Object.keys(e),l=0;l<s.length;l++){var u=s[l];"protocol"!==u&&(n[u]=e[u])}return b[n.protocol]&&n.hostname&&!n.pathname&&(n.path=n.pathname="/"),n.href=n.format(),n}if(e.protocol&&e.protocol!==n.protocol){if(!b[e.protocol]){for(var d=Object.keys(e),f=0;f<d.length;f++){var p=d[f];n[p]=e[p]}return n.href=n.format(),n}if(n.protocol=e.protocol,e.host||y[e.protocol])n.pathname=e.pathname;else{for(var h=(e.pathname||"").split("/");h.length&&!(e.host=h.shift()););e.host||(e.host=""),e.hostname||(e.hostname=""),""!==h[0]&&h.unshift(""),h.length<2&&h.unshift(""),n.pathname=h.join("/")}if(n.search=e.search,n.query=e.query,n.host=e.host||"",n.auth=e.auth,n.hostname=e.hostname||e.host,n.port=e.port,n.pathname||n.search){var m=n.pathname||"",g=n.search||"";n.path=m+g}return n.slashes=n.slashes||e.slashes,n.href=n.format(),n}var v=n.pathname&&"/"===n.pathname.charAt(0),O=e.host||e.pathname&&"/"===e.pathname.charAt(0),w=O||v||n.host&&e.pathname,_=w,k=n.pathname&&n.pathname.split("/")||[],S=(h=e.pathname&&e.pathname.split("/")||[],n.protocol&&!b[n.protocol]);if(S&&(n.hostname="",n.port=null,n.host&&(""===k[0]?k[0]=n.host:k.unshift(n.host)),n.host="",e.protocol&&(e.hostname=null,e.port=null,e.host&&(""===h[0]?h[0]=e.host:h.unshift(e.host)),e.host=null),w=w&&(""===h[0]||""===k[0])),O)n.host=e.host||""===e.host?e.host:n.host,n.hostname=e.hostname||""===e.hostname?e.hostname:n.hostname,n.search=e.search,n.query=e.query,k=h;else if(h.length)k||(k=[]),k.pop(),k=k.concat(h),n.search=e.search,n.query=e.query;else if(!o.isNullOrUndefined(e.search))return S&&(n.hostname=n.host=k.shift(),(P=!!(n.host&&n.host.indexOf("@")>0)&&n.host.split("@"))&&(n.auth=P.shift(),n.host=n.hostname=P.shift())),n.search=e.search,n.query=e.query,o.isNull(n.pathname)&&o.isNull(n.search)||(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.href=n.format(),n;if(!k.length)return n.pathname=null,n.search?n.path="/"+n.search:n.path=null,n.href=n.format(),n;for(var j=k.slice(-1)[0],E=(n.host||e.host||k.length>1)&&("."===j||".."===j)||""===j,C=0,D=k.length;D>=0;D--)"."===(j=k[D])?k.splice(D,1):".."===j?(k.splice(D,1),C++):C&&(k.splice(D,1),C--);if(!w&&!_)for(;C--;C)k.unshift("..");!w||""===k[0]||k[0]&&"/"===k[0].charAt(0)||k.unshift(""),E&&"/"!==k.join("/").substr(-1)&&k.push("");var P,x=""===k[0]||k[0]&&"/"===k[0].charAt(0);return S&&(n.hostname=n.host=x?"":k.length?k.shift():"",(P=!!(n.host&&n.host.indexOf("@")>0)&&n.host.split("@"))&&(n.auth=P.shift(),n.host=n.hostname=P.shift())),(w=w||n.host&&k.length)&&!x&&k.unshift(""),k.length?n.pathname=k.join("/"):(n.pathname=null,n.path=null),o.isNull(n.pathname)&&o.isNull(n.search)||(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.auth=e.auth||n.auth,n.slashes=n.slashes||e.slashes,n.href=n.format(),n},a.prototype.parseHost=function(){var e=this.host,t=c.exec(e);t&&(":"!==(t=t[0])&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)}},function(e,t,n){"use strict";n(122),n(469),n(511),n(472),n(473);var r=n(512);n.d(t,"PLUGINS_STORE_NAME",(function(){return r.a})),n(102),n(474),n(516),n(475),n(476),n(477),n(478),n(479),n(310),n(358),n(505),n(503),n(513),n(514),n(219),n(506),n(480),n(507),n(180),n(40),n(508),n(509),n(306)},function(e,t,n){"use strict";e.exports=n(802)},,function(e,t,n){"use strict";function r(e){return e&&"object"==typeof e&&"default"in e?e.default:e}Object.defineProperty(t,"__esModule",{value:!0});var o=r(n(9)),a=r(n(389)),i=n(11),c=r(i),s=r(n(491)),l=r(n(13)),u={arr:Array.isArray,obj:function(e){return"[object Object]"===Object.prototype.toString.call(e)},fun:function(e){return"function"==typeof e},str:function(e){return"string"==typeof e},num:function(e){return"number"==typeof e},und:function(e){return void 0===e},nul:function(e){return null===e},set:function(e){return e instanceof Set},map:function(e){return e instanceof Map},equ:function(e,t){if(typeof e!=typeof t)return!1;if(u.str(e)||u.num(e))return e===t;if(u.obj(e)&&u.obj(t)&&Object.keys(e).length+Object.keys(t).length===0)return!0;var n;for(n in e)if(!(n in t))return!1;for(n in t)if(e[n]!==t[n])return!1;return!u.und(n)||e===t}};function d(){var e=i.useState(!1)[1];return i.useCallback((function(){return e((function(e){return!e}))}),[])}function f(e,t){return u.und(e)||u.nul(e)?t:e}function p(e){return u.und(e)?[]:u.arr(e)?e:[e]}function h(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return u.fun(e)?e.apply(void 0,n):e}function m(e){var t=function(e){return e.to,e.from,e.config,e.onStart,e.onRest,e.onFrame,e.children,e.reset,e.reverse,e.force,e.immediate,e.delay,e.attach,e.destroyed,e.interpolateTo,e.ref,e.lazy,a(e,["to","from","config","onStart","onRest","onFrame","children","reset","reverse","force","immediate","delay","attach","destroyed","interpolateTo","ref","lazy"])}(e);if(u.und(t))return o({to:t},e);var n=Object.keys(e).reduce((function(n,r){var a;return u.und(t[r])?o({},n,((a={})[r]=e[r],a)):n}),{});return o({to:t},n)}var y,b,g=function(){function e(){this.payload=void 0,this.children=[]}var t=e.prototype;return t.getAnimatedValue=function(){return this.getValue()},t.getPayload=function(){return this.payload||this},t.attach=function(){},t.detach=function(){},t.getChildren=function(){return this.children},t.addChild=function(e){0===this.children.length&&this.attach(),this.children.push(e)},t.removeChild=function(e){var t=this.children.indexOf(e);this.children.splice(t,1),0===this.children.length&&this.detach()},e}(),v=function(e){function t(){for(var t,n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return(t=e.call.apply(e,[this].concat(r))||this).payload=[],t.attach=function(){return t.payload.forEach((function(e){return e instanceof g&&e.addChild(l(t))}))},t.detach=function(){return t.payload.forEach((function(e){return e instanceof g&&e.removeChild(l(t))}))},t}return s(t,e),t}(g),O=function(e){function t(){for(var t,n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return(t=e.call.apply(e,[this].concat(r))||this).payload={},t.attach=function(){return Object.values(t.payload).forEach((function(e){return e instanceof g&&e.addChild(l(t))}))},t.detach=function(){return Object.values(t.payload).forEach((function(e){return e instanceof g&&e.removeChild(l(t))}))},t}s(t,e);var n=t.prototype;return n.getValue=function(e){void 0===e&&(e=!1);var t={};for(var n in this.payload){var r=this.payload[n];(!e||r instanceof g)&&(t[n]=r instanceof g?r[e?"getAnimatedValue":"getValue"]():r)}return t},n.getAnimatedValue=function(){return this.getValue(!0)},t}(g);function w(e,t){y={fn:e,transform:t}}function _(e){b=e}var k,S=function(e){return"undefined"!=typeof window?window.requestAnimationFrame(e):-1},j=function(e){"undefined"!=typeof window&&window.cancelAnimationFrame(e)};function E(e){k=e}var C,D=function(){return Date.now()};function P(e){C=e}var x,F,T=function(e){return e.current};function M(e){x=e}var R=Object.freeze({get applyAnimatedValues(){return y},injectApplyAnimatedValues:w,get colorNames(){return b},injectColorNames:_,get requestFrame(){return S},get cancelFrame(){return j},injectFrame:function(e,t){S=e,j=t},get interpolation(){return k},injectStringInterpolator:E,get now(){return D},injectNow:function(e){D=e},get defaultElement(){return C},injectDefaultElement:P,get animatedApi(){return T},injectAnimatedApi:function(e){T=e},get createAnimatedStyle(){return x},injectCreateAnimatedStyle:M,get manualFrameloop(){return F},injectManualFrameloop:function(e){F=e}}),I=function(e){function t(t,n){var r;return(r=e.call(this)||this).update=void 0,r.payload=t.style?o({},t,{style:x(t.style)}):t,r.update=n,r.attach(),r}return s(t,e),t}(O),A=!1,N=new Set,L=function e(){if(!A)return!1;var t=D(),n=N,r=Array.isArray(n),o=0;for(n=r?n:n[Symbol.iterator]();;){var a;if(r){if(o>=n.length)break;a=n[o++]}else{if((o=n.next()).done)break;a=o.value}for(var i=a,c=!1,s=0;s<i.configs.length;s++){for(var l=i.configs[s],u=void 0,d=void 0,f=0;f<l.animatedValues.length;f++){var p=l.animatedValues[f];if(!p.done){var h=l.fromValues[f],m=l.toValues[f],y=p.lastPosition,b=m instanceof g,v=Array.isArray(l.initialVelocity)?l.initialVelocity[f]:l.initialVelocity;if(b&&(m=m.getValue()),l.immediate)p.setValue(m),p.done=!0;else if("string"!=typeof h&&"string"!=typeof m){if(void 0!==l.duration)y=h+l.easing((t-p.startTime)/l.duration)*(m-h),u=t>=p.startTime+l.duration;else if(l.decay)y=h+v/(1-.998)*(1-Math.exp(-(1-.998)*(t-p.startTime))),(u=Math.abs(p.lastPosition-y)<.1)&&(m=y);else{d=void 0!==p.lastTime?p.lastTime:t,v=void 0!==p.lastVelocity?p.lastVelocity:l.initialVelocity,t>d+64&&(d=t);for(var O=Math.floor(t-d),w=0;w<O;++w)y+=1*(v+=(-l.tension*(y-m)+-l.friction*v)/l.mass*1/1e3)/1e3;var _=!(!l.clamp||0===l.tension)&&(h<m?y>m:y<m),k=Math.abs(v)<=l.precision,j=0===l.tension||Math.abs(m-y)<=l.precision;u=_||k&&j,p.lastVelocity=v,p.lastTime=t}b&&!l.toValues[f].done&&(u=!1),u?(p.value!==m&&(y=m),p.done=!0):c=!0,p.setValue(y),p.lastPosition=y}else p.setValue(m),p.done=!0}}i.props.onFrame&&(i.values[l.name]=l.interpolation.getValue())}i.props.onFrame&&i.props.onFrame(i.values),c||(N.delete(i),i.stop(!0))}return N.size?F?F():S(e):A=!1,A};function U(e,t,n){if("function"==typeof e)return e;if(Array.isArray(e))return U({range:e,output:t,extrapolate:n});if(k&&"string"==typeof e.output[0])return k(e);var r=e,o=r.output,a=r.range||[0,1],i=r.extrapolateLeft||r.extrapolate||"extend",c=r.extrapolateRight||r.extrapolate||"extend",s=r.easing||function(e){return e};return function(e){var t=function(e,t){for(var n=1;n<t.length-1&&!(t[n]>=e);++n);return n-1}(e,a);return function(e,t,n,r,o,a,i,c,s){var l=s?s(e):e;if(l<t){if("identity"===i)return l;"clamp"===i&&(l=t)}if(l>n){if("identity"===c)return l;"clamp"===c&&(l=n)}return r===o?r:t===n?e<=t?r:o:(t===-1/0?l=-l:n===1/0?l-=t:l=(l-t)/(n-t),l=a(l),r===-1/0?l=-l:o===1/0?l+=r:l=l*(o-r)+r,l)}(e,a[t],a[t+1],o[t],o[t+1],s,i,c,r.map)}}var B=function(e){function t(n,r,o,a){var i;return(i=e.call(this)||this).calc=void 0,i.payload=n instanceof v&&!(n instanceof t)?n.getPayload():Array.isArray(n)?n:[n],i.calc=U(r,o,a),i}s(t,e);var n=t.prototype;return n.getValue=function(){return this.calc.apply(this,this.payload.map((function(e){return e.getValue()})))},n.updateConfig=function(e,t,n){this.calc=U(e,t,n)},n.interpolate=function(e,n,r){return new t(this,e,n,r)},t}(v),H=function(e){function t(t){var n;return(n=e.call(this)||this).animatedStyles=new Set,n.value=void 0,n.startPosition=void 0,n.lastPosition=void 0,n.lastVelocity=void 0,n.startTime=void 0,n.lastTime=void 0,n.done=!1,n.setValue=function(e,t){void 0===t&&(t=!0),n.value=e,t&&n.flush()},n.value=t,n.startPosition=t,n.lastPosition=t,n}s(t,e);var n=t.prototype;return n.flush=function(){0===this.animatedStyles.size&&function e(t,n){"update"in t?n.add(t):t.getChildren().forEach((function(t){return e(t,n)}))}(this,this.animatedStyles),this.animatedStyles.forEach((function(e){return e.update()}))},n.clearStyles=function(){this.animatedStyles.clear()},n.getValue=function(){return this.value},n.interpolate=function(e,t,n){return new B(this,e,t,n)},t}(g),q=function(e){function t(t){var n;return(n=e.call(this)||this).payload=t.map((function(e){return new H(e)})),n}s(t,e);var n=t.prototype;return n.setValue=function(e,t){var n=this;void 0===t&&(t=!0),Array.isArray(e)?e.length===this.payload.length&&e.forEach((function(e,r){return n.payload[r].setValue(e,t)})):this.payload.forEach((function(n){return n.setValue(e,t)}))},n.getValue=function(){return this.payload.map((function(e){return e.getValue()}))},n.interpolate=function(e,t){return new B(this,e,t)},t}(v),z=0,V=function(){function e(){var e=this;this.id=void 0,this.idle=!0,this.hasChanged=!1,this.guid=0,this.local=0,this.props={},this.merged={},this.animations={},this.interpolations={},this.values={},this.configs=[],this.listeners=[],this.queue=[],this.localQueue=void 0,this.getValues=function(){return e.interpolations},this.id=z++}var t=e.prototype;return t.update=function(e){if(!e)return this;var t=m(e),n=t.delay,r=void 0===n?0:n,i=t.to,c=a(t,["delay","to"]);if(u.arr(i)||u.fun(i))this.queue.push(o({},c,{delay:r,to:i}));else if(i){var s={};Object.entries(i).forEach((function(e){var t,n=e[0],a=e[1],i=o({to:(t={},t[n]=a,t),delay:h(r,n)},c),l=s[i.delay]&&s[i.delay].to;s[i.delay]=o({},s[i.delay],i,{to:o({},l,i.to)})})),this.queue=Object.values(s)}return this.queue=this.queue.sort((function(e,t){return e.delay-t.delay})),this.diff(c),this},t.start=function(e){var t=this;if(this.queue.length){this.idle=!1,this.localQueue&&this.localQueue.forEach((function(e){var n=e.from,r=void 0===n?{}:n,a=e.to,i=void 0===a?{}:a;u.obj(r)&&(t.merged=o({},r,t.merged)),u.obj(i)&&(t.merged=o({},t.merged,i))}));var n=this.local=++this.guid,r=this.localQueue=this.queue;this.queue=[],r.forEach((function(o,i){var c=o.delay,s=a(o,["delay"]),l=function(o){i===r.length-1&&n===t.guid&&o&&(t.idle=!0,t.props.onRest&&t.props.onRest(t.merged)),e&&e()},d=u.arr(s.to)||u.fun(s.to);c?setTimeout((function(){n===t.guid&&(d?t.runAsync(s,l):t.diff(s).start(l))}),c):d?t.runAsync(s,l):t.diff(s).start(l)}))}else u.fun(e)&&this.listeners.push(e),this.props.onStart&&this.props.onStart(),this,N.has(this)||N.add(this),A||(A=!0,S(F||L));return this},t.stop=function(e){return this.listeners.forEach((function(t){return t(e)})),this.listeners=[],this},t.pause=function(e){return this.stop(!0),e&&(this,N.has(this)&&N.delete(this)),this},t.runAsync=function(e,t){var n=this,r=(e.delay,a(e,["delay"])),i=this.local,c=Promise.resolve(void 0);if(u.arr(r.to))for(var s=function(e){var t=e,a=o({},r,m(r.to[t]));u.arr(a.config)&&(a.config=a.config[t]),c=c.then((function(){if(i===n.guid)return new Promise((function(e){return n.diff(a).start(e)}))}))},l=0;l<r.to.length;l++)s(l);else if(u.fun(r.to)){var d,f=0;c=c.then((function(){return r.to((function(e){var t=o({},r,m(e));if(u.arr(t.config)&&(t.config=t.config[f]),f++,i===n.guid)return d=new Promise((function(e){return n.diff(t).start(e)}))}),(function(e){return void 0===e&&(e=!0),n.stop(e)})).then((function(){return d}))}))}c.then(t)},t.diff=function(e){var t=this;this.props=o({},this.props,e);var n=this.props,r=n.from,a=void 0===r?{}:r,i=n.to,c=void 0===i?{}:i,s=n.config,l=void 0===s?{}:s,d=n.reverse,m=n.attach,y=n.reset,g=n.immediate;if(d){var v=[c,a];a=v[0],c=v[1]}this.merged=o({},a,this.merged,c),this.hasChanged=!1;var O=m&&m(this);if(this.animations=Object.entries(this.merged).reduce((function(e,n){var r=n[0],i=n[1],c=e[r]||{},s=u.num(i),d=u.str(i)&&!i.startsWith("#")&&!/\d/.test(i)&&!b[i],m=u.arr(i),v=!s&&!m&&!d,w=u.und(a[r])?i:a[r],_=s||m||d?i:1,S=h(l,r);O&&(_=O.animations[r].parent);var j,E=c.parent,C=c.interpolation,P=p(O?_.getPayload():_),x=i;v&&(x=k({range:[0,1],output:[i,i]})(1));var F,T=C&&C.getValue(),M=!u.und(E)&&c.animatedValues.some((function(e){return!e.done})),R=!u.equ(x,T),I=!u.equ(x,c.previous),A=!u.equ(S,c.config);if(y||I&&R||A){var N;if(s||d)E=C=c.parent||new H(w);else if(m)E=C=c.parent||new q(w);else if(v){var L=c.interpolation&&c.interpolation.calc(c.parent.value);L=void 0===L||y?w:L,c.parent?(E=c.parent).setValue(0,!1):E=new H(0);var U={output:[L,i]};c.interpolation?(C=c.interpolation,c.interpolation.updateConfig(U)):C=E.interpolate(U)}return P=p(O?_.getPayload():_),j=p(E.getPayload()),y&&!v&&E.setValue(w,!1),t.hasChanged=!0,j.forEach((function(e){e.startPosition=e.value,e.lastPosition=e.value,e.lastVelocity=M?e.lastVelocity:void 0,e.lastTime=M?e.lastTime:void 0,e.startTime=D(),e.done=!1,e.animatedStyles.clear()})),h(g,r)&&E.setValue(v?_:i,!1),o({},e,((N={})[r]=o({},c,{name:r,parent:E,interpolation:C,animatedValues:j,toValues:P,previous:x,config:S,fromValues:p(E.getValue()),immediate:h(g,r),initialVelocity:f(S.velocity,0),clamp:f(S.clamp,!1),precision:f(S.precision,.01),tension:f(S.tension,170),friction:f(S.friction,26),mass:f(S.mass,1),duration:S.duration,easing:f(S.easing,(function(e){return e})),decay:S.decay}),N))}return R?e:(v&&(E.setValue(1,!1),C.updateConfig({output:[x,x]})),E.done=!0,t.hasChanged=!0,o({},e,((F={})[r]=o({},e[r],{previous:x}),F)))}),this.animations),this.hasChanged)for(var w in this.configs=Object.values(this.animations),this.values={},this.interpolations={},this.animations)this.interpolations[w]=this.animations[w].interpolation,this.values[w]=this.animations[w].interpolation.getValue();return this},t.destroy=function(){this.stop(),this.props={},this.merged={},this.animations={},this.interpolations={},this.values={},this.configs=[],this.local=0},e}(),K=function(e,t){var n=i.useRef(!1),r=i.useRef(),o=u.fun(t),a=i.useMemo((function(){var n;return r.current&&(r.current.map((function(e){return e.destroy()})),r.current=void 0),[new Array(e).fill().map((function(e,r){var a=new V,i=o?h(t,r,a):t[r];return 0===r&&(n=i.ref),a.update(i),n||a.start(),a})),n]}),[e]),c=a[0],s=a[1];r.current=c,i.useImperativeHandle(s,(function(){return{start:function(){return Promise.all(r.current.map((function(e){return new Promise((function(t){return e.start(t)}))})))},stop:function(e){return r.current.forEach((function(t){return t.stop(e)}))},get controllers(){return r.current}}}));var l=i.useMemo((function(){return function(e){return r.current.map((function(t,n){t.update(o?h(e,n,t):e[n]),s||t.start()}))}}),[e]);i.useEffect((function(){n.current?o||l(t):s||r.current.forEach((function(e){return e.start()}))})),i.useEffect((function(){return n.current=!0,function(){return r.current.forEach((function(e){return e.destroy()}))}}),[]);var d=r.current.map((function(e){return e.getValues()}));return o?[d,l,function(e){return r.current.forEach((function(t){return t.pause(e)}))}]:d},W=0,G=function(e,t){return("function"==typeof t?e.map(t):p(t)).map(String)},Y=function(e){var t=e.items,n=e.keys,r=void 0===n?function(e){return e}:n,i=a(e,["items","keys"]);return t=p(void 0!==t?t:null),o({items:t,keys:G(t,r)},i)};function $(e,t){var n=function(){if(o){if(a>=r.length)return"break";i=r[a++]}else{if((a=r.next()).done)return"break";i=a.value}var n=i.key,c=function(e){return e.key!==n};(u.und(t)||t===n)&&(e.current.instances.delete(n),e.current.transitions=e.current.transitions.filter(c),e.current.deleted=e.current.deleted.filter(c))},r=e.current.deleted,o=Array.isArray(r),a=0;for(r=o?r:r[Symbol.iterator]();;){var i;if("break"===n())break}e.current.forceUpdate()}var Q=function(e){function t(t){var n;return void 0===t&&(t={}),n=e.call(this)||this,!t.transform||t.transform instanceof g||(t=y.transform(t)),n.payload=t,n}return s(t,e),t}(O),J={transparent:0,aliceblue:4042850303,antiquewhite:4209760255,aqua:16777215,aquamarine:2147472639,azure:4043309055,beige:4126530815,bisque:4293182719,black:255,blanchedalmond:4293643775,blue:65535,blueviolet:2318131967,brown:2771004159,burlywood:3736635391,burntsienna:3934150143,cadetblue:1604231423,chartreuse:2147418367,chocolate:3530104575,coral:4286533887,cornflowerblue:1687547391,cornsilk:4294499583,crimson:3692313855,cyan:16777215,darkblue:35839,darkcyan:9145343,darkgoldenrod:3095792639,darkgray:2846468607,darkgreen:6553855,darkgrey:2846468607,darkkhaki:3182914559,darkmagenta:2332068863,darkolivegreen:1433087999,darkorange:4287365375,darkorchid:2570243327,darkred:2332033279,darksalmon:3918953215,darkseagreen:2411499519,darkslateblue:1211993087,darkslategray:793726975,darkslategrey:793726975,darkturquoise:13554175,darkviolet:2483082239,deeppink:4279538687,deepskyblue:12582911,dimgray:1768516095,dimgrey:1768516095,dodgerblue:512819199,firebrick:2988581631,floralwhite:4294635775,forestgreen:579543807,fuchsia:4278255615,gainsboro:3705462015,ghostwhite:4177068031,gold:4292280575,goldenrod:3668254975,gray:2155905279,green:8388863,greenyellow:2919182335,grey:2155905279,honeydew:4043305215,hotpink:4285117695,indianred:3445382399,indigo:1258324735,ivory:4294963455,khaki:4041641215,lavender:3873897215,lavenderblush:4293981695,lawngreen:2096890111,lemonchiffon:4294626815,lightblue:2916673279,lightcoral:4034953471,lightcyan:3774873599,lightgoldenrodyellow:4210742015,lightgray:3553874943,lightgreen:2431553791,lightgrey:3553874943,lightpink:4290167295,lightsalmon:4288707327,lightseagreen:548580095,lightskyblue:2278488831,lightslategray:2005441023,lightslategrey:2005441023,lightsteelblue:2965692159,lightyellow:4294959359,lime:16711935,limegreen:852308735,linen:4210091775,magenta:4278255615,maroon:2147483903,mediumaquamarine:1724754687,mediumblue:52735,mediumorchid:3126187007,mediumpurple:2473647103,mediumseagreen:1018393087,mediumslateblue:2070474495,mediumspringgreen:16423679,mediumturquoise:1221709055,mediumvioletred:3340076543,midnightblue:421097727,mintcream:4127193855,mistyrose:4293190143,moccasin:4293178879,navajowhite:4292783615,navy:33023,oldlace:4260751103,olive:2155872511,olivedrab:1804477439,orange:4289003775,orangered:4282712319,orchid:3664828159,palegoldenrod:4008225535,palegreen:2566625535,paleturquoise:2951671551,palevioletred:3681588223,papayawhip:4293907967,peachpuff:4292524543,peru:3448061951,pink:4290825215,plum:3718307327,powderblue:2967529215,purple:2147516671,rebeccapurple:1714657791,red:4278190335,rosybrown:3163525119,royalblue:1097458175,saddlebrown:2336560127,salmon:4202722047,sandybrown:4104413439,seagreen:780883967,seashell:4294307583,sienna:2689740287,silver:3233857791,skyblue:2278484991,slateblue:1784335871,slategray:1887473919,slategrey:1887473919,snow:4294638335,springgreen:16744447,steelblue:1182971135,tan:3535047935,teal:8421631,thistle:3636451583,tomato:4284696575,turquoise:1088475391,violet:4001558271,wheat:4125012991,white:4294967295,whitesmoke:4126537215,yellow:4294902015,yellowgreen:2597139199},Z="[-+]?\\d*\\.?\\d+";function X(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return"\\(\\s*("+t.join(")\\s*,\\s*(")+")\\s*\\)"}var ee=new RegExp("rgb"+X(Z,Z,Z)),te=new RegExp("rgba"+X(Z,Z,Z,Z)),ne=new RegExp("hsl"+X(Z,"[-+]?\\d*\\.?\\d+%","[-+]?\\d*\\.?\\d+%")),re=new RegExp("hsla"+X(Z,"[-+]?\\d*\\.?\\d+%","[-+]?\\d*\\.?\\d+%",Z)),oe=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,ae=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,ie=/^#([0-9a-fA-F]{6})$/,ce=/^#([0-9a-fA-F]{8})$/;function se(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function le(e,t,n){var r=n<.5?n*(1+t):n+t-n*t,o=2*n-r,a=se(o,r,e+1/3),i=se(o,r,e),c=se(o,r,e-1/3);return Math.round(255*a)<<24|Math.round(255*i)<<16|Math.round(255*c)<<8}function ue(e){var t=parseInt(e,10);return t<0?0:t>255?255:t}function de(e){return(parseFloat(e)%360+360)%360/360}function fe(e){var t=parseFloat(e);return t<0?0:t>1?255:Math.round(255*t)}function pe(e){var t=parseFloat(e);return t<0?0:t>100?1:t/100}function he(e){var t,n,r="number"==typeof(t=e)?t>>>0===t&&t>=0&&t<=4294967295?t:null:(n=ie.exec(t))?parseInt(n[1]+"ff",16)>>>0:J.hasOwnProperty(t)?J[t]:(n=ee.exec(t))?(ue(n[1])<<24|ue(n[2])<<16|ue(n[3])<<8|255)>>>0:(n=te.exec(t))?(ue(n[1])<<24|ue(n[2])<<16|ue(n[3])<<8|fe(n[4]))>>>0:(n=oe.exec(t))?parseInt(n[1]+n[1]+n[2]+n[2]+n[3]+n[3]+"ff",16)>>>0:(n=ce.exec(t))?parseInt(n[1],16)>>>0:(n=ae.exec(t))?parseInt(n[1]+n[1]+n[2]+n[2]+n[3]+n[3]+n[4]+n[4],16)>>>0:(n=ne.exec(t))?(255|le(de(n[1]),pe(n[2]),pe(n[3])))>>>0:(n=re.exec(t))?(le(de(n[1]),pe(n[2]),pe(n[3]))|fe(n[4]))>>>0:null;return null===r?e:"rgba("+((4278190080&(r=r||0))>>>24)+", "+((16711680&r)>>>16)+", "+((65280&r)>>>8)+", "+(255&r)/255+")"}var me=/[+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,ye=/(#(?:[0-9a-f]{2}){2,4}|(#[0-9a-f]{3})|(rgb|hsl)a?\((-?\d+%?[,\s]+){2,3}\s*[\d\.]+%?\))/gi,be=new RegExp("("+Object.keys(J).join("|")+")","g"),ge={animationIterationCount:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},ve=["Webkit","Ms","Moz","O"];function Oe(e,t,n){return null==t||"boolean"==typeof t||""===t?"":n||"number"!=typeof t||0===t||ge.hasOwnProperty(e)&&ge[e]?(""+t).trim():t+"px"}ge=Object.keys(ge).reduce((function(e,t){return ve.forEach((function(n){return e[function(e,t){return e+t.charAt(0).toUpperCase()+t.substring(1)}(n,t)]=e[t]})),e}),ge);var we={};M((function(e){return new Q(e)})),P("div"),E((function(e){var t=e.output.map((function(e){return e.replace(ye,he)})).map((function(e){return e.replace(be,he)})),n=t[0].match(me).map((function(){return[]}));t.forEach((function(e){e.match(me).forEach((function(e,t){return n[t].push(+e)}))}));var r=t[0].match(me).map((function(t,r){return U(o({},e,{output:n[r]}))}));return function(e){var n=0;return t[0].replace(me,(function(){return r[n++](e)})).replace(/rgba\(([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+)\)/gi,(function(e,t,n,r,o){return"rgba("+Math.round(t)+", "+Math.round(n)+", "+Math.round(r)+", "+o+")"}))}})),_(J),w((function(e,t){if(!e.nodeType||void 0===e.setAttribute)return!1;var n=t.style,r=t.children,o=t.scrollTop,i=t.scrollLeft,c=a(t,["style","children","scrollTop","scrollLeft"]),s="filter"===e.nodeName||e.parentNode&&"filter"===e.parentNode.nodeName;for(var l in void 0!==o&&(e.scrollTop=o),void 0!==i&&(e.scrollLeft=i),void 0!==r&&(e.textContent=r),n)if(n.hasOwnProperty(l)){var u=0===l.indexOf("--"),d=Oe(l,n[l],u);"float"===l&&(l="cssFloat"),u?e.style.setProperty(l,d):e.style[l]=d}for(var f in c){var p=s?f:we[f]||(we[f]=f.replace(/([A-Z])/g,(function(e){return"-"+e.toLowerCase()})));void 0!==e.getAttribute(p)&&e.setAttribute(p,c[f])}}),(function(e){return e}));var _e,ke,Se=(_e=function(e){return i.forwardRef((function(t,n){var r=d(),s=i.useRef(!0),l=i.useRef(null),f=i.useRef(null),p=i.useCallback((function(e){var t=l.current;l.current=new I(e,(function(){var e=!1;f.current&&(e=y.fn(f.current,l.current.getAnimatedValue())),f.current&&!1!==e||r()})),t&&t.detach()}),[]);i.useEffect((function(){return function(){s.current=!1,l.current&&l.current.detach()}}),[]),i.useImperativeHandle(n,(function(){return T(f,s,r)})),p(t);var h,m=l.current.getValue(),b=(m.scrollTop,m.scrollLeft,a(m,["scrollTop","scrollLeft"])),g=(h=e,!u.fun(h)||h.prototype instanceof c.Component?function(e){return f.current=function(e,t){return t&&(u.fun(t)?t(e):u.obj(t)&&(t.current=e)),e}(e,n)}:void 0);return c.createElement(e,o({},b,{ref:g}))}))},void 0===(ke=!1)&&(ke=!0),function(e){return(u.arr(e)?e:Object.keys(e)).reduce((function(e,t){var n=ke?t[0].toLowerCase()+t.substring(1):t;return e[n]=_e(n),e}),_e)}),je=Se(["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"]);t.apply=Se,t.config={default:{tension:170,friction:26},gentle:{tension:120,friction:14},wobbly:{tension:180,friction:12},stiff:{tension:210,friction:20},slow:{tension:280,friction:60},molasses:{tension:280,friction:120}},t.update=L,t.animated=je,t.a=je,t.interpolate=function(e,t,n){return e&&new B(e,t,n)},t.Globals=R,t.useSpring=function(e){var t=u.fun(e),n=K(1,t?e:[e]),r=n[0],o=n[1],a=n[2];return t?[r[0],o,a]:r},t.useTrail=function(e,t){var n=i.useRef(!1),r=u.fun(t),a=h(t),c=i.useRef(),s=K(e,(function(e,t){return 0===e&&(c.current=[]),c.current.push(t),o({},a,{config:h(a.config,e),attach:e>0&&function(){return c.current[e-1]}})})),l=s[0],d=s[1],f=s[2],p=i.useMemo((function(){return function(e){return d((function(t,n){e.reverse;var r=e.reverse?t+1:t-1,i=c.current[r];return o({},e,{config:h(e.config||a.config,t),attach:i&&function(){return i}})}))}}),[e,a.reverse]);return i.useEffect((function(){n.current&&!r&&p(t)})),i.useEffect((function(){n.current=!0}),[]),r?[l,p,f]:l},t.useTransition=function(e,t,n){var r=o({items:e,keys:t||function(e){return e}},n),c=Y(r),s=c.lazy,l=void 0!==s&&s,u=(c.unique,c.reset),f=void 0!==u&&u,p=(c.enter,c.leave,c.update,c.onDestroyed),m=(c.keys,c.items,c.onFrame),y=c.onRest,b=c.onStart,g=c.ref,v=a(c,["lazy","unique","reset","enter","leave","update","onDestroyed","keys","items","onFrame","onRest","onStart","ref"]),O=d(),w=i.useRef(!1),_=i.useRef({mounted:!1,first:!0,deleted:[],current:{},transitions:[],prevProps:{},paused:!!r.ref,instances:!w.current&&new Map,forceUpdate:O});return i.useImperativeHandle(r.ref,(function(){return{start:function(){return Promise.all(Array.from(_.current.instances).map((function(e){var t=e[1];return new Promise((function(e){return t.start(e)}))})))},stop:function(e){return Array.from(_.current.instances).forEach((function(t){return t[1].stop(e)}))},get controllers(){return Array.from(_.current.instances).map((function(e){return e[1]}))}}})),_.current=function(e,t){for(var n=e.first,r=e.prevProps,i=a(e,["first","prevProps"]),c=Y(t),s=c.items,l=c.keys,u=c.initial,d=c.from,f=c.enter,p=c.leave,m=c.update,y=c.trail,b=void 0===y?0:y,g=c.unique,v=c.config,O=c.order,w=void 0===O?["enter","leave","update"]:O,_=Y(r),k=_.keys,S=_.items,j=o({},i.current),E=[].concat(i.deleted),C=Object.keys(j),D=new Set(C),P=new Set(l),x=l.filter((function(e){return!D.has(e)})),F=i.transitions.filter((function(e){return!e.destroyed&&!P.has(e.originalKey)})).map((function(e){return e.originalKey})),T=l.filter((function(e){return D.has(e)})),M=-b;w.length;)switch(w.shift()){case"enter":x.forEach((function(e,t){g&&E.find((function(t){return t.originalKey===e}))&&(E=E.filter((function(t){return t.originalKey!==e})));var r=l.indexOf(e),o=s[r],a=n&&void 0!==u?"initial":"enter";j[e]={slot:a,originalKey:e,key:g?String(e):W++,item:o,trail:M+=b,config:h(v,o,a),from:h(n&&void 0!==u?u||{}:d,o),to:h(f,o)}}));break;case"leave":F.forEach((function(e){var t=k.indexOf(e),n=S[t];E.unshift(o({},j[e],{slot:"leave",destroyed:!0,left:k[Math.max(0,t-1)],right:k[Math.min(k.length,t+1)],trail:M+=b,config:h(v,n,"leave"),to:h(p,n)})),delete j[e]}));break;case"update":T.forEach((function(e){var t=l.indexOf(e),n=s[t];j[e]=o({},j[e],{item:n,slot:"update",trail:M+=b,config:h(v,n,"update"),to:h(m,n)})}))}var R=l.map((function(e){return j[e]}));return E.forEach((function(e){var t,n=e.left,r=(e.right,a(e,["left","right"]));-1!==(t=R.findIndex((function(e){return e.originalKey===n})))&&(t+=1),t=Math.max(0,t),R=[].concat(R.slice(0,t),[r],R.slice(t))})),o({},i,{changed:x.length||F.length||T.length,first:n&&0===x.length,transitions:R,current:j,deleted:E,prevProps:t})}(_.current,r),_.current.changed&&_.current.transitions.forEach((function(e){var t=e.slot,n=e.from,r=e.to,a=e.config,i=e.trail,c=e.key,s=e.item;_.current.instances.has(c)||_.current.instances.set(c,new V);var u=_.current.instances.get(c),d=o({},v,{to:r,from:n,config:a,ref:g,onRest:function(n){_.current.mounted&&(e.destroyed&&(g||l||$(_,c),p&&p(s)),!Array.from(_.current.instances).some((function(e){return!e[1].idle}))&&(g||l)&&_.current.deleted.length>0&&$(_),y&&y(s,t,n))},onStart:b&&function(){return b(s,t)},onFrame:m&&function(e){return m(s,t,e)},delay:i,reset:f&&"enter"===t});u.update(d),_.current.paused||u.start()})),i.useEffect((function(){return _.current.mounted=w.current=!0,function(){_.current.mounted=w.current=!1,Array.from(_.current.instances).map((function(e){return e[1].destroy()})),_.current.instances.clear()}}),[]),_.current.transitions.map((function(e){var t=e.item,n=e.slot,r=e.key;return{item:t,key:r,state:n,props:_.current.instances.get(r).getValues()}}))},t.useChain=function(e,t,n){void 0===n&&(n=1e3);var r=i.useRef();i.useEffect((function(){u.equ(e,r.current)?e.forEach((function(e){var t=e.current;return t&&t.start()})):t?e.forEach((function(e,r){var a=e.current;if(a){var i=a.controllers;if(i.length){var c=n*t[r];i.forEach((function(e){e.queue=e.queue.map((function(e){return o({},e,{delay:e.delay+c})})),e.start()}))}}})):e.reduce((function(e,t,n){var r=t.current;return e.then((function(){return r.start()}))}),Promise.resolve()),r.current=e}))},t.useSprings=K},,,,,,,,,,,,,,,,function(e,t){e.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,n){var r=n(386);e.exports=function(e,t){if(e){if("string"==typeof e)return r(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(e,t):void 0}},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){function n(t,r){return e.exports=n=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},e.exports.default=e.exports,e.exports.__esModule=!0,n(t,r)}e.exports=n,e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,n){"use strict";var r=Array.prototype.slice,o=n(391),a=Object.keys,i=a?function(e){return a(e)}:n(593),c=Object.keys;i.shim=function(){return Object.keys?function(){var e=Object.keys(arguments);return e&&e.length===arguments.length}(1,2)||(Object.keys=function(e){return o(e)?c(r.call(e)):c(e)}):Object.keys=i,Object.keys||i},e.exports=i},function(e,t,n){"use strict";var r=Object.prototype.toString;e.exports=function(e){var t=r.call(e),n="[object Arguments]"===t;return n||(n="[object Array]"!==t&&null!==e&&"object"==typeof e&&"number"==typeof e.length&&e.length>=0&&"[object Function]"===r.call(e.callee)),n}},function(e,t,n){"use strict";var r="undefined"!=typeof Symbol&&Symbol,o=n(329);e.exports=function(){return"function"==typeof r&&"function"==typeof Symbol&&"symbol"==typeof r("foo")&&"symbol"==typeof Symbol("bar")&&o()}},function(e,t,n){"use strict";var r=n(595),o=n(607),a=n(291),i=n(404),c=n(403),s=n(631);e.exports=function(){var e=s(this),t=c(a(e,"length")),n=1;arguments.length>0&&void 0!==arguments[0]&&(n=i(arguments[0]));var l=r(e,0);return o(l,e,t,0,n),l}},function(e,t,n){"use strict";var r=n(81)("%Object.defineProperty%",!0);if(r)try{r({},"a",{value:1})}catch(e){r=null}var o=n(185)("Object.prototype.propertyIsEnumerable");e.exports=function(e,t,n,a,i,c){if(!r){if(!e(c))return!1;if(!c["[[Configurable]]"]||!c["[[Writable]]"])return!1;if(i in a&&o(a,i)!==!!c["[[Enumerable]]"])return!1;var s=c["[[Value]]"];return a[i]=s,t(a[i],s)}return r(a,i,n(c)),!0}},function(e,t,n){"use strict";var r=n(330),o=n(147);e.exports=function(e){if(void 0===e)return e;r(o,"Property Descriptor","Desc",e);var t={};return"[[Value]]"in e&&(t.value=e["[[Value]]"]),"[[Writable]]"in e&&(t.writable=e["[[Writable]]"]),"[[Get]]"in e&&(t.get=e["[[Get]]"]),"[[Set]]"in e&&(t.set=e["[[Set]]"]),"[[Enumerable]]"in e&&(t.enumerable=e["[[Enumerable]]"]),"[[Configurable]]"in e&&(t.configurable=e["[[Configurable]]"]),t}},function(e,t,n){"use strict";var r=n(211),o=n(330),a=n(147);e.exports=function(e){return void 0!==e&&(o(a,"Property Descriptor","Desc",e),!(!r(e,"[[Value]]")&&!r(e,"[[Writable]]")))}},function(e,t,n){"use strict";var r=n(331);e.exports=function(e,t){return e===t?0!==e||1/e==1/t:r(e)&&r(t)}},function(e,t,n){"use strict";var r=n(211),o=n(81)("%TypeError%"),a=n(147),i=n(399),c=n(603);e.exports=function(e){if("Object"!==a(e))throw new o("ToPropertyDescriptor requires an object");var t={};if(r(e,"enumerable")&&(t["[[Enumerable]]"]=i(e.enumerable)),r(e,"configurable")&&(t["[[Configurable]]"]=i(e.configurable)),r(e,"value")&&(t["[[Value]]"]=e.value),r(e,"writable")&&(t["[[Writable]]"]=i(e.writable)),r(e,"get")){var n=e.get;if(void 0!==n&&!c(n))throw new o("getter must be a function");t["[[Get]]"]=n}if(r(e,"set")){var s=e.set;if(void 0!==s&&!c(s))throw new o("setter must be a function");t["[[Set]]"]=s}if((r(t,"[[Get]]")||r(t,"[[Set]]"))&&(r(t,"[[Value]]")||r(t,"[[Writable]]")))throw new o("Invalid property descriptor. Cannot both specify accessors and a value or writable attribute");return t}},function(e,t,n){"use strict";e.exports=function(e){return!!e}},function(e,t,n){"use strict";var r=Number.isNaN||function(e){return e!=e};e.exports=Number.isFinite||function(e){return"number"==typeof e&&!r(e)&&e!==1/0&&e!==-1/0}},function(e,t,n){"use strict";var r=n(81),o=r("%Math%"),a=r("%Number%");e.exports=a.MAX_SAFE_INTEGER||o.pow(2,53)-1},function(e,t,n){"use strict";e.exports=function(e){return null===e||"function"!=typeof e&&"object"!=typeof e}},function(e,t,n){"use strict";var r=n(401),o=n(404);e.exports=function(e){var t=o(e);return t<=0?0:t>r?r:t}},function(e,t,n){"use strict";var r=n(618),o=n(625);e.exports=function(e){var t=o(e);return 0!==t&&(t=r(t)),0===t?0:t}},function(e,t,n){"use strict";e.exports=function(e){return null===e||"function"!=typeof e&&"object"!=typeof e}},function(e,t,n){"use strict";var r=Object.prototype.toString;if(n(392)()){var o=Symbol.prototype.toString,a=/^Symbol\(.*\)$/;e.exports=function(e){if("symbol"==typeof e)return!0;if("[object Symbol]"!==r.call(e))return!1;try{return function(e){return"symbol"==typeof e.valueOf()&&a.test(o.call(e))}(e)}catch(e){return!1}}}else e.exports=function(e){return!1}},function(e,t,n){"use strict";e.exports=n(632)},function(e,t,n){"use strict";var r=n(393);e.exports=function(){return Array.prototype.flat||r}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=void 0,o=void 0;function a(e,t){var n=t(e(o));return function(){return n}}function i(e){return a(e,r.createLTR||r.create)}function c(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];var o=r.resolve(t);return o}function s(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return r.resolveLTR?r.resolveLTR(t):c(t)}t.default={registerTheme:function(e){o=e},registerInterface:function(e){r=e},create:i,createLTR:i,createRTL:function(e){return a(e,r.createRTL||r.create)},get:function(){return o},resolve:s,resolveLTR:s,resolveRTL:function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return r.resolveRTL?r.resolveRTL(t):c(t)},flush:function(){r.flush&&r.flush()}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r={white:"#fff",gray:"#484848",grayLight:"#82888a",grayLighter:"#cacccd",grayLightest:"#f2f2f2",borderMedium:"#c4c4c4",border:"#dbdbdb",borderLight:"#e4e7e7",borderLighter:"#eceeee",borderBright:"#f4f5f5",primary:"#00a699",primaryShade_1:"#33dacd",primaryShade_2:"#66e2da",primaryShade_3:"#80e8e0",primaryShade_4:"#b2f1ec",primary_dark:"#008489",secondary:"#007a87",yellow:"#ffe8bc",yellow_dark:"#ffce71"};t.default={reactDates:{zIndex:0,border:{input:{border:0,borderTop:0,borderRight:0,borderBottom:"2px solid transparent",borderLeft:0,outlineFocused:0,borderFocused:0,borderTopFocused:0,borderLeftFocused:0,borderBottomFocused:"2px solid "+String(r.primary_dark),borderRightFocused:0,borderRadius:0},pickerInput:{borderWidth:1,borderStyle:"solid",borderRadius:2}},color:{core:r,disabled:r.grayLightest,background:r.white,backgroundDark:"#f2f2f2",backgroundFocused:r.white,border:"rgb(219, 219, 219)",text:r.gray,textDisabled:r.border,textFocused:"#007a87",placeholderText:"#757575",outside:{backgroundColor:r.white,backgroundColor_active:r.white,backgroundColor_hover:r.white,color:r.gray,color_active:r.gray,color_hover:r.gray},highlighted:{backgroundColor:r.yellow,backgroundColor_active:r.yellow_dark,backgroundColor_hover:r.yellow_dark,color:r.gray,color_active:r.gray,color_hover:r.gray},minimumNights:{backgroundColor:r.white,backgroundColor_active:r.white,backgroundColor_hover:r.white,borderColor:r.borderLighter,color:r.grayLighter,color_active:r.grayLighter,color_hover:r.grayLighter},hoveredSpan:{backgroundColor:r.primaryShade_4,backgroundColor_active:r.primaryShade_3,backgroundColor_hover:r.primaryShade_4,borderColor:r.primaryShade_3,borderColor_active:r.primaryShade_3,borderColor_hover:r.primaryShade_3,color:r.secondary,color_active:r.secondary,color_hover:r.secondary},selectedSpan:{backgroundColor:r.primaryShade_2,backgroundColor_active:r.primaryShade_1,backgroundColor_hover:r.primaryShade_1,borderColor:r.primaryShade_1,borderColor_active:r.primary,borderColor_hover:r.primary,color:r.white,color_active:r.white,color_hover:r.white},selected:{backgroundColor:r.primary,backgroundColor_active:r.primary,backgroundColor_hover:r.primary,borderColor:r.primary,borderColor_active:r.primary,borderColor_hover:r.primary,color:r.white,color_active:r.white,color_hover:r.white},blocked_calendar:{backgroundColor:r.grayLighter,backgroundColor_active:r.grayLighter,backgroundColor_hover:r.grayLighter,borderColor:r.grayLighter,borderColor_active:r.grayLighter,borderColor_hover:r.grayLighter,color:r.grayLight,color_active:r.grayLight,color_hover:r.grayLight},blocked_out_of_range:{backgroundColor:r.white,backgroundColor_active:r.white,backgroundColor_hover:r.white,borderColor:r.borderLight,borderColor_active:r.borderLight,borderColor_hover:r.borderLight,color:r.grayLighter,color_active:r.grayLighter,color_hover:r.grayLighter}},spacing:{dayPickerHorizontalPadding:9,captionPaddingTop:22,captionPaddingBottom:37,inputPadding:0,displayTextPaddingVertical:void 0,displayTextPaddingTop:11,displayTextPaddingBottom:9,displayTextPaddingHorizontal:void 0,displayTextPaddingLeft:11,displayTextPaddingRight:11,displayTextPaddingVertical_small:void 0,displayTextPaddingTop_small:7,displayTextPaddingBottom_small:5,displayTextPaddingHorizontal_small:void 0,displayTextPaddingLeft_small:7,displayTextPaddingRight_small:7},sizing:{inputWidth:130,inputWidth_small:97,arrowWidth:24},noScrollBarOnVerticalScrollable:!1,font:{size:14,captionSize:18,input:{size:19,lineHeight:"24px",size_small:15,lineHeight_small:"18px",letterSpacing_small:"0.2px",styleDisabled:"italic"}}}}},function(e,t,n){"use strict";function r(e){return function(){return e}}var o=function(){};o.thatReturns=r,o.thatReturnsFalse=r(!1),o.thatReturnsTrue=r(!0),o.thatReturnsNull=r(null),o.thatReturnsThis=function(){return this},o.thatReturnsArgument=function(e){return e},e.exports=o},function(e,t,n){"use strict";var r=n(333),o=Object.prototype.hasOwnProperty,a=Array.isArray,i=function(){for(var e=[],t=0;t<256;++t)e.push("%"+((t<16?"0":"")+t.toString(16)).toUpperCase());return e}(),c=function(e,t){for(var n=t&&t.plainObjects?Object.create(null):{},r=0;r<e.length;++r)void 0!==e[r]&&(n[r]=e[r]);return n};e.exports={arrayToObject:c,assign:function(e,t){return Object.keys(t).reduce((function(e,n){return e[n]=t[n],e}),e)},combine:function(e,t){return[].concat(e,t)},compact:function(e){for(var t=[{obj:{o:e},prop:"o"}],n=[],r=0;r<t.length;++r)for(var o=t[r],i=o.obj[o.prop],c=Object.keys(i),s=0;s<c.length;++s){var l=c[s],u=i[l];"object"==typeof u&&null!==u&&-1===n.indexOf(u)&&(t.push({obj:i,prop:l}),n.push(u))}return function(e){for(;e.length>1;){var t=e.pop(),n=t.obj[t.prop];if(a(n)){for(var r=[],o=0;o<n.length;++o)void 0!==n[o]&&r.push(n[o]);t.obj[t.prop]=r}}}(t),e},decode:function(e,t,n){var r=e.replace(/\+/g," ");if("iso-8859-1"===n)return r.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(r)}catch(e){return r}},encode:function(e,t,n,o,a){if(0===e.length)return e;var c=e;if("symbol"==typeof e?c=Symbol.prototype.toString.call(e):"string"!=typeof e&&(c=String(e)),"iso-8859-1"===n)return escape(c).replace(/%u[0-9a-f]{4}/gi,(function(e){return"%26%23"+parseInt(e.slice(2),16)+"%3B"}));for(var s="",l=0;l<c.length;++l){var u=c.charCodeAt(l);45===u||46===u||95===u||126===u||u>=48&&u<=57||u>=65&&u<=90||u>=97&&u<=122||a===r.RFC1738&&(40===u||41===u)?s+=c.charAt(l):u<128?s+=i[u]:u<2048?s+=i[192|u>>6]+i[128|63&u]:u<55296||u>=57344?s+=i[224|u>>12]+i[128|u>>6&63]+i[128|63&u]:(l+=1,u=65536+((1023&u)<<10|1023&c.charCodeAt(l)),s+=i[240|u>>18]+i[128|u>>12&63]+i[128|u>>6&63]+i[128|63&u])}return s},isBuffer:function(e){return!(!e||"object"!=typeof e||!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e)))},isRegExp:function(e){return"[object RegExp]"===Object.prototype.toString.call(e)},maybeMap:function(e,t){if(a(e)){for(var n=[],r=0;r<e.length;r+=1)n.push(t(e[r]));return n}return t(e)},merge:function e(t,n,r){if(!n)return t;if("object"!=typeof n){if(a(t))t.push(n);else{if(!t||"object"!=typeof t)return[t,n];(r&&(r.plainObjects||r.allowPrototypes)||!o.call(Object.prototype,n))&&(t[n]=!0)}return t}if(!t||"object"!=typeof t)return[t].concat(n);var i=t;return a(t)&&!a(n)&&(i=c(t,r)),a(t)&&a(n)?(n.forEach((function(n,a){if(o.call(t,a)){var i=t[a];i&&"object"==typeof i&&n&&"object"==typeof n?t[a]=e(i,n,r):t.push(n)}else t[a]=n})),t):Object.keys(n).reduce((function(t,a){var i=n[a];return o.call(t,a)?t[a]=e(t[a],i,r):t[a]=i,t}),i)}}},function(e,t){e.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,n){var r=n(665);e.exports=r},function(e,t,n){var r=n(226),o=n(416),a=n(294),i=n(336),c=n(339),s=n(177),l=n(418),u=Object.getOwnPropertyDescriptor;t.f=r?u:function(e,t){if(e=i(e),t=c(t,!0),l)try{return u(e,t)}catch(e){}if(s(e,t))return a(!o.f.call(e,t),e[t])}},function(e,t,n){"use strict";var r={}.propertyIsEnumerable,o=Object.getOwnPropertyDescriptor,a=o&&!r.call({1:2},1);t.f=a?function(e){var t=o(this,e);return!!t&&t.enumerable}:r},function(e,t,n){var r=n(186),o=n(337),a="".split;e.exports=r((function(){return!Object("z").propertyIsEnumerable(0)}))?function(e){return"String"==o(e)?a.call(e,""):Object(e)}:Object},function(e,t,n){var r=n(226),o=n(186),a=n(419);e.exports=!r&&!o((function(){return 7!=Object.defineProperty(a("div"),"a",{get:function(){return 7}}).a}))},function(e,t,n){var r=n(148),o=n(246),a=r.document,i=o(a)&&o(a.createElement);e.exports=function(e){return i?a.createElement(e):{}}},function(e,t,n){var r=n(148),o=n(227),a=n(177),i=n(340),c=n(421),s=n(422),l=s.get,u=s.enforce,d=String(String).split("String");(e.exports=function(e,t,n,c){var s,l=!!c&&!!c.unsafe,f=!!c&&!!c.enumerable,p=!!c&&!!c.noTargetGet;"function"==typeof n&&("string"!=typeof t||a(n,"name")||o(n,"name",t),(s=u(n)).source||(s.source=d.join("string"==typeof t?t:""))),e!==r?(l?!p&&e[t]&&(f=!0):delete e[t],f?e[t]=n:o(e,t,n)):f?e[t]=n:i(t,n)})(Function.prototype,"toString",(function(){return"function"==typeof this&&l(this).source||c(this)}))},function(e,t,n){var r=n(341),o=Function.toString;"function"!=typeof r.inspectSource&&(r.inspectSource=function(e){return o.call(e)}),e.exports=r.inspectSource},function(e,t,n){var r,o,a,i=n(667),c=n(148),s=n(246),l=n(227),u=n(177),d=n(341),f=n(342),p=n(344),h=c.WeakMap;if(i){var m=d.state||(d.state=new h),y=m.get,b=m.has,g=m.set;r=function(e,t){return t.facade=e,g.call(m,e,t),t},o=function(e){return y.call(m,e)||{}},a=function(e){return b.call(m,e)}}else{var v=f("state");p[v]=!0,r=function(e,t){return t.facade=e,l(e,v,t),t},o=function(e){return u(e,v)?e[v]:{}},a=function(e){return u(e,v)}}e.exports={set:r,get:o,has:a,enforce:function(e){return a(e)?o(e):r(e,{})},getterFor:function(e){return function(t){var n;if(!s(t)||(n=o(t)).type!==e)throw TypeError("Incompatible receiver, "+e+" required");return n}}}},function(e,t,n){var r=n(343),o=n(341);(e.exports=function(e,t){return o[e]||(o[e]=void 0!==t?t:{})})("versions",[]).push({version:"3.9.1",mode:r?"pure":"global",copyright:"© 2021 Denis Pushkarev (zloirock.ru)"})},function(e,t){var n=0,r=Math.random();e.exports=function(e){return"Symbol("+String(void 0===e?"":e)+")_"+(++n+r).toString(36)}},function(e,t,n){var r=n(177),o=n(336),a=n(671).indexOf,i=n(344);e.exports=function(e,t){var n,c=o(e),s=0,l=[];for(n in c)!r(i,n)&&r(c,n)&&l.push(n);for(;t.length>s;)r(c,n=t[s++])&&(~a(l,n)||l.push(n));return l}},function(e,t,n){var r=n(347),o=Math.min;e.exports=function(e){return e>0?o(r(e),9007199254740991):0}},function(e,t){t.f=Object.getOwnPropertySymbols},function(e,t,n){var r=n(425),o=n(348);e.exports=Object.keys||function(e){return r(e,o)}},function(e,t,n){var r=n(675);e.exports=r},function(e,t,n){"use strict";var r,o,a,i=n(186),c=n(431),s=n(227),l=n(177),u=n(187),d=n(343),f=u("iterator"),p=!1;[].keys&&("next"in(a=[].keys())?(o=c(c(a)))!==Object.prototype&&(r=o):p=!0);var h=null==r||i((function(){var e={};return r[f].call(e)!==e}));h&&(r={}),d&&!h||l(r,f)||s(r,f,(function(){return this})),e.exports={IteratorPrototype:r,BUGGY_SAFARI_ITERATORS:p}},function(e,t,n){var r=n(177),o=n(349),a=n(342),i=n(680),c=a("IE_PROTO"),s=Object.prototype;e.exports=i?Object.getPrototypeOf:function(e){return e=o(e),r(e,c)?e[c]:"function"==typeof e.constructor&&e instanceof e.constructor?e.constructor.prototype:e instanceof Object?s:null}},function(e,t,n){var r=n(681),o=n(682),a=n(186);e.exports=!!Object.getOwnPropertySymbols&&!a((function(){return!Symbol.sham&&(r?38===o:o>37&&o<41)}))},function(e,t,n){var r=n(247).f,o=n(177),a=n(187)("toStringTag");e.exports=function(e,t,n){e&&!o(e=n?e:e.prototype,a)&&r(e,a,{configurable:!0,value:t})}},function(e,t,n){"use strict";var r=n(390),o=function(e){return null!=e},a=n(329)(),i=n(185),c=Object,s=i("Array.prototype.push"),l=i("Object.prototype.propertyIsEnumerable"),u=a?Object.getOwnPropertySymbols:null;e.exports=function(e,t){if(!o(e))throw new TypeError("target must be an object");var n,i,d,f,p,h,m,y=c(e);for(n=1;n<arguments.length;++n){i=c(arguments[n]),f=r(i);var b=a&&(Object.getOwnPropertySymbols||u);if(b)for(p=b(i),d=0;d<p.length;++d)m=p[d],l(i,m)&&s(f,m);for(d=0;d<f.length;++d)h=i[m=f[d]],l(i,m)&&(y[m]=h)}return y}},function(e,t,n){"use strict";var r=n(434);e.exports=function(){return Object.assign?function(){if(!Object.assign)return!1;for(var e="abcdefghijklmnopqrst",t=e.split(""),n={},r=0;r<t.length;++r)n[t[r]]=t[r];var o=Object.assign({},n),a="";for(var i in o)a+=i;return e!==a}()||function(){if(!Object.assign||!Object.preventExtensions)return!1;var e=Object.preventExtensions({1:2});try{Object.assign(e,"xy")}catch(t){return"y"===e[1]}return!1}()?r:Object.assign:r}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t,n,r,i){var c=i.chooseAvailableDate,s=i.dateIsUnavailable,l=i.dateIsSelected,u={width:n,height:n-1},d=r.has("blocked-minimum-nights")||r.has("blocked-calendar")||r.has("blocked-out-of-range"),f=r.has("selected")||r.has("selected-start")||r.has("selected-end"),p=!f&&(r.has("hovered-span")||r.has("after-hovered-start")),h=r.has("blocked-out-of-range"),m={date:e.format(t)},y=(0,o.default)(c,m);return r.has(a.BLOCKED_MODIFIER)?y=(0,o.default)(s,m):f&&(y=(0,o.default)(l,m)),{daySizeStyles:u,useDefaultCursor:d,selected:f,hoveredSpan:p,isOutsideRange:h,ariaLabel:y}};var r,o=(r=n(712))&&r.__esModule?r:{default:r},a=n(77)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=j(n(112)),i=j(n(11)),c=j(n(2)),s=j(n(228)),l=j(n(178)),u=n(104),d=n(138),f=j(n(31)),p=n(118),h=j(n(128)),m=j(n(713)),y=j(n(350)),b=j(n(438)),g=j(n(715)),v=j(n(229)),O=j(n(297)),w=j(n(296)),_=j(n(231)),k=j(n(213)),S=n(77);function j(e){return e&&e.__esModule?e:{default:e}}var E=(0,u.forbidExtraProps)((0,a.default)({},d.withStylesPropTypes,{month:l.default.momentObj,horizontalMonthPadding:u.nonNegativeInteger,isVisible:c.default.bool,enableOutsideDays:c.default.bool,modifiers:c.default.objectOf(w.default),orientation:_.default,daySize:u.nonNegativeInteger,onDayClick:c.default.func,onDayMouseEnter:c.default.func,onDayMouseLeave:c.default.func,onMonthSelect:c.default.func,onYearSelect:c.default.func,renderMonthText:(0,u.mutuallyExclusiveProps)(c.default.func,"renderMonthText","renderMonthElement"),renderCalendarDay:c.default.func,renderDayContents:c.default.func,renderMonthElement:(0,u.mutuallyExclusiveProps)(c.default.func,"renderMonthText","renderMonthElement"),firstDayOfWeek:k.default,setMonthTitleHeight:c.default.func,verticalBorderSpacing:u.nonNegativeInteger,focusedDate:l.default.momentObj,isFocused:c.default.bool,monthFormat:c.default.string,phrases:c.default.shape((0,h.default)(p.CalendarDayPhrases)),dayAriaLabelFormat:c.default.string})),C={month:(0,f.default)(),horizontalMonthPadding:13,isVisible:!0,enableOutsideDays:!1,modifiers:{},orientation:S.HORIZONTAL_ORIENTATION,daySize:S.DAY_SIZE,onDayClick:function(){},onDayMouseEnter:function(){},onDayMouseLeave:function(){},onMonthSelect:function(){},onYearSelect:function(){},renderMonthText:null,renderCalendarDay:function(e){return i.default.createElement(y.default,e)},renderDayContents:null,renderMonthElement:null,firstDayOfWeek:null,setMonthTitleHeight:null,focusedDate:null,isFocused:!1,monthFormat:"MMMM YYYY",phrases:p.CalendarDayPhrases,dayAriaLabelFormat:void 0,verticalBorderSpacing:void 0},D=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.state={weeks:(0,g.default)(e.month,e.enableOutsideDays,null==e.firstDayOfWeek?f.default.localeData().firstDayOfWeek():e.firstDayOfWeek)},n.setCaptionRef=n.setCaptionRef.bind(n),n.setMonthTitleHeight=n.setMonthTitleHeight.bind(n),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),o(t,[{key:"componentDidMount",value:function(){this.setMonthTitleHeightTimeout=setTimeout(this.setMonthTitleHeight,0)}},{key:"componentWillReceiveProps",value:function(e){var t=e.month,n=e.enableOutsideDays,r=e.firstDayOfWeek,o=this.props,a=o.month,i=o.enableOutsideDays,c=o.firstDayOfWeek;t.isSame(a)&&n===i&&r===c||this.setState({weeks:(0,g.default)(t,n,null==r?f.default.localeData().firstDayOfWeek():r)})}},{key:"shouldComponentUpdate",value:function(e,t){return(0,s.default)(this,e,t)}},{key:"componentWillUnmount",value:function(){this.setMonthTitleHeightTimeout&&clearTimeout(this.setMonthTitleHeightTimeout)}},{key:"setMonthTitleHeight",value:function(){var e=this.props.setMonthTitleHeight;e&&e((0,b.default)(this.captionRef,"height",!0,!0))}},{key:"setCaptionRef",value:function(e){this.captionRef=e}},{key:"render",value:function(){var e=this.props,t=e.dayAriaLabelFormat,n=e.daySize,o=e.focusedDate,a=e.horizontalMonthPadding,c=e.isFocused,s=e.isVisible,l=e.modifiers,u=e.month,f=e.monthFormat,p=e.onDayClick,h=e.onDayMouseEnter,y=e.onDayMouseLeave,b=e.onMonthSelect,g=e.onYearSelect,w=e.orientation,_=e.phrases,k=e.renderCalendarDay,j=e.renderDayContents,E=e.renderMonthElement,C=e.renderMonthText,D=e.styles,P=e.verticalBorderSpacing,x=this.state.weeks,F=C?C(u):u.format(f),T=w===S.VERTICAL_SCROLLABLE;return i.default.createElement("div",r({},(0,d.css)(D.CalendarMonth,{padding:"0 "+String(a)+"px"}),{"data-visible":s}),i.default.createElement("div",r({ref:this.setCaptionRef},(0,d.css)(D.CalendarMonth_caption,T&&D.CalendarMonth_caption__verticalScrollable)),E?E({month:u,onMonthSelect:b,onYearSelect:g}):i.default.createElement("strong",null,F)),i.default.createElement("table",r({},(0,d.css)(!P&&D.CalendarMonth_table,P&&D.CalendarMonth_verticalSpacing,P&&{borderSpacing:"0px "+String(P)+"px"}),{role:"presentation"}),i.default.createElement("tbody",null,x.map((function(e,r){return i.default.createElement(m.default,{key:r},e.map((function(e,r){return k({key:r,day:e,daySize:n,isOutsideDay:!e||e.month()!==u.month(),tabIndex:s&&(0,v.default)(e,o)?0:-1,isFocused:c,onDayMouseEnter:h,onDayMouseLeave:y,onDayClick:p,renderDayContents:j,phrases:_,modifiers:l[(0,O.default)(e)],ariaLabelFormat:t})})))})))))}}]),t}(i.default.Component);D.propTypes=E,D.defaultProps=C,t.default=(0,d.withStyles)((function(e){var t=e.reactDates,n=t.color,r=t.font,o=t.spacing;return{CalendarMonth:{background:n.background,textAlign:"center",verticalAlign:"top",userSelect:"none"},CalendarMonth_table:{borderCollapse:"collapse",borderSpacing:0},CalendarMonth_verticalSpacing:{borderCollapse:"separate"},CalendarMonth_caption:{color:n.text,fontSize:r.captionSize,textAlign:"center",paddingTop:o.captionPaddingTop,paddingBottom:o.captionPaddingBottom,captionSide:"initial"},CalendarMonth_caption__verticalScrollable:{paddingTop:12,paddingBottom:7}}}))(D)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(!e)return 0;var o="width"===t?"Left":"Top",a="width"===t?"Right":"Bottom",i=!n||r?window.getComputedStyle(e):null,c=e.offsetWidth,s=e.offsetHeight,l="width"===t?c:s;return n||(l-=parseFloat(i["padding"+o])+parseFloat(i["padding"+a])+parseFloat(i["border"+o+"Width"])+parseFloat(i["border"+a+"Width"])),r&&(l+=parseFloat(i["margin"+o])+parseFloat(i["margin"+a])),l}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=C(n(112)),i=C(n(11)),c=C(n(2)),s=C(n(228)),l=C(n(178)),u=n(104),d=n(138),f=C(n(31)),p=n(298),h=n(118),m=C(n(128)),y=C(n(437)),b=C(n(716)),g=C(n(717)),v=C(n(440)),O=C(n(299)),w=C(n(718)),_=C(n(719)),k=C(n(296)),S=C(n(231)),j=C(n(213)),E=n(77);function C(e){return e&&e.__esModule?e:{default:e}}var D=(0,u.forbidExtraProps)((0,a.default)({},d.withStylesPropTypes,{enableOutsideDays:c.default.bool,firstVisibleMonthIndex:c.default.number,horizontalMonthPadding:u.nonNegativeInteger,initialMonth:l.default.momentObj,isAnimating:c.default.bool,numberOfMonths:c.default.number,modifiers:c.default.objectOf(c.default.objectOf(k.default)),orientation:S.default,onDayClick:c.default.func,onDayMouseEnter:c.default.func,onDayMouseLeave:c.default.func,onMonthTransitionEnd:c.default.func,onMonthChange:c.default.func,onYearChange:c.default.func,renderMonthText:(0,u.mutuallyExclusiveProps)(c.default.func,"renderMonthText","renderMonthElement"),renderCalendarDay:c.default.func,renderDayContents:c.default.func,translationValue:c.default.number,renderMonthElement:(0,u.mutuallyExclusiveProps)(c.default.func,"renderMonthText","renderMonthElement"),daySize:u.nonNegativeInteger,focusedDate:l.default.momentObj,isFocused:c.default.bool,firstDayOfWeek:j.default,setMonthTitleHeight:c.default.func,isRTL:c.default.bool,transitionDuration:u.nonNegativeInteger,verticalBorderSpacing:u.nonNegativeInteger,monthFormat:c.default.string,phrases:c.default.shape((0,m.default)(h.CalendarDayPhrases)),dayAriaLabelFormat:c.default.string})),P={enableOutsideDays:!1,firstVisibleMonthIndex:0,horizontalMonthPadding:13,initialMonth:(0,f.default)(),isAnimating:!1,numberOfMonths:1,modifiers:{},orientation:E.HORIZONTAL_ORIENTATION,onDayClick:function(){},onDayMouseEnter:function(){},onDayMouseLeave:function(){},onMonthChange:function(){},onYearChange:function(){},onMonthTransitionEnd:function(){},renderMonthText:null,renderCalendarDay:void 0,renderDayContents:null,translationValue:null,renderMonthElement:null,daySize:E.DAY_SIZE,focusedDate:null,isFocused:!1,firstDayOfWeek:null,setMonthTitleHeight:null,isRTL:!1,transitionDuration:200,verticalBorderSpacing:void 0,monthFormat:"MMMM YYYY",phrases:h.CalendarDayPhrases,dayAriaLabelFormat:void 0};function x(e,t,n){var r=e.clone();n||(r=r.subtract(1,"month"));for(var o=[],a=0;a<(n?t:t+2);a+=1)o.push(r),r=r.clone().add(1,"month");return o}var F=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e)),r=e.orientation===E.VERTICAL_SCROLLABLE;return n.state={months:x(e.initialMonth,e.numberOfMonths,r)},n.isTransitionEndSupported=(0,b.default)(),n.onTransitionEnd=n.onTransitionEnd.bind(n),n.setContainerRef=n.setContainerRef.bind(n),n.locale=f.default.locale(),n.onMonthSelect=n.onMonthSelect.bind(n),n.onYearSelect=n.onYearSelect.bind(n),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),o(t,[{key:"componentDidMount",value:function(){this.removeEventListener=(0,p.addEventListener)(this.container,"transitionend",this.onTransitionEnd)}},{key:"componentWillReceiveProps",value:function(e){var t=this,n=e.initialMonth,r=e.numberOfMonths,o=e.orientation,a=this.state.months,i=this.props,c=i.initialMonth,s=i.numberOfMonths!==r,l=a;c.isSame(n,"month")||s||((0,_.default)(c,n)?(l=a.slice(1)).push(a[a.length-1].clone().add(1,"month")):(0,w.default)(c,n)?(l=a.slice(0,a.length-1)).unshift(a[0].clone().subtract(1,"month")):l=x(n,r,o===E.VERTICAL_SCROLLABLE)),s&&(l=x(n,r,o===E.VERTICAL_SCROLLABLE));var u=f.default.locale();this.locale!==u&&(this.locale=u,l=l.map((function(e){return e.locale(t.locale)}))),this.setState({months:l})}},{key:"shouldComponentUpdate",value:function(e,t){return(0,s.default)(this,e,t)}},{key:"componentDidUpdate",value:function(){var e=this.props,t=e.isAnimating,n=e.transitionDuration,r=e.onMonthTransitionEnd;this.isTransitionEndSupported&&n||!t||r()}},{key:"componentWillUnmount",value:function(){this.removeEventListener&&this.removeEventListener()}},{key:"onTransitionEnd",value:function(){(0,this.props.onMonthTransitionEnd)()}},{key:"onMonthSelect",value:function(e,t){var n=e.clone(),r=this.props,o=r.onMonthChange,a=r.orientation,i=this.state.months,c=a===E.VERTICAL_SCROLLABLE,s=i.indexOf(e);c||(s-=1),n.set("month",t).subtract(s,"months"),o(n)}},{key:"onYearSelect",value:function(e,t){var n=e.clone(),r=this.props,o=r.onYearChange,a=r.orientation,i=this.state.months,c=a===E.VERTICAL_SCROLLABLE,s=i.indexOf(e);c||(s-=1),n.set("year",t).subtract(s,"months"),o(n)}},{key:"setContainerRef",value:function(e){this.container=e}},{key:"render",value:function(){var e=this,t=this.props,n=t.enableOutsideDays,o=t.firstVisibleMonthIndex,c=t.horizontalMonthPadding,s=t.isAnimating,l=t.modifiers,u=t.numberOfMonths,f=t.monthFormat,p=t.orientation,h=t.translationValue,m=t.daySize,b=t.onDayMouseEnter,w=t.onDayMouseLeave,_=t.onDayClick,k=t.renderMonthText,S=t.renderCalendarDay,j=t.renderDayContents,C=t.renderMonthElement,D=t.onMonthTransitionEnd,P=t.firstDayOfWeek,x=t.focusedDate,F=t.isFocused,T=t.isRTL,M=t.styles,R=t.phrases,I=t.dayAriaLabelFormat,A=t.transitionDuration,N=t.verticalBorderSpacing,L=t.setMonthTitleHeight,U=this.state.months,B=p===E.VERTICAL_ORIENTATION,H=p===E.VERTICAL_SCROLLABLE,q=p===E.HORIZONTAL_ORIENTATION,z=(0,v.default)(m,c),V=B||H?z:(u+2)*z,K=(B||H?"translateY":"translateX")+"("+String(h)+"px)";return i.default.createElement("div",r({},(0,d.css)(M.CalendarMonthGrid,q&&M.CalendarMonthGrid__horizontal,B&&M.CalendarMonthGrid__vertical,H&&M.CalendarMonthGrid__vertical_scrollable,s&&M.CalendarMonthGrid__animating,s&&A&&{transition:"transform "+String(A)+"ms ease-in-out"},(0,a.default)({},(0,g.default)(K),{width:V})),{ref:this.setContainerRef,onTransitionEnd:D}),U.map((function(t,a){var g=a>=o&&a<o+u,v=0===a&&!g,E=0===a&&s&&g,D=(0,O.default)(t);return i.default.createElement("div",r({key:D},(0,d.css)(q&&M.CalendarMonthGrid_month__horizontal,v&&M.CalendarMonthGrid_month__hideForAnimation,E&&!B&&!T&&{position:"absolute",left:-z},E&&!B&&T&&{position:"absolute",right:0},E&&B&&{position:"absolute",top:-h},!g&&!s&&M.CalendarMonthGrid_month__hidden)),i.default.createElement(y.default,{month:t,isVisible:g,enableOutsideDays:n,modifiers:l[D],monthFormat:f,orientation:p,onDayMouseEnter:b,onDayMouseLeave:w,onDayClick:_,onMonthSelect:e.onMonthSelect,onYearSelect:e.onYearSelect,renderMonthText:k,renderCalendarDay:S,renderDayContents:j,renderMonthElement:C,firstDayOfWeek:P,daySize:m,focusedDate:g?x:null,isFocused:F,phrases:R,setMonthTitleHeight:L,dayAriaLabelFormat:I,verticalBorderSpacing:N,horizontalMonthPadding:c}))})))}}]),t}(i.default.Component);F.propTypes=D,F.defaultProps=P,t.default=(0,d.withStyles)((function(e){var t=e.reactDates,n=t.color,r=t.noScrollBarOnVerticalScrollable,o=t.spacing,i=t.zIndex;return{CalendarMonthGrid:{background:n.background,textAlign:"left",zIndex:i},CalendarMonthGrid__animating:{zIndex:i+1},CalendarMonthGrid__horizontal:{position:"absolute",left:o.dayPickerHorizontalPadding},CalendarMonthGrid__vertical:{margin:"0 auto"},CalendarMonthGrid__vertical_scrollable:(0,a.default)({margin:"0 auto",overflowY:"scroll"},r&&{"-webkitOverflowScrolling":"touch","::-webkit-scrollbar":{"-webkit-appearance":"none",display:"none"}}),CalendarMonthGrid_month__horizontal:{display:"inline-block",verticalAlign:"top",minHeight:"100%"},CalendarMonthGrid_month__hideForAnimation:{position:"absolute",zIndex:i-1,opacity:0,pointerEvents:"none"},CalendarMonthGrid_month__hidden:{visibility:"hidden"}}}))(F)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){return 7*e+2*t+1}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){return!(!o.default.isMoment(e)||!o.default.isMoment(t))&&e.month()===t.month()&&e.year()===t.year()};var r,o=(r=n(31))&&r.__esModule?r:{default:r}},function(e,t,n){"use strict";var r=n(407),o=n(185)("Object.prototype.propertyIsEnumerable");e.exports=function(e){var t=r(e),n=[];for(var a in t)o(t,a)&&n.push(t[a]);return n}},function(e,t,n){"use strict";var r=n(442);e.exports=function(){return"function"==typeof Object.values?Object.values:r}},function(e,t,n){"use strict";e.exports=function(e){if(arguments.length<1)throw new TypeError("1 argument is required");if("object"!=typeof e)throw new TypeError("Argument 1 (”other“) to Node.contains must be an instance of Node");var t=e;do{if(this===t)return!0;t&&(t=t.parentNode)}while(t);return!1}},function(e,t,n){"use strict";var r=n(444);e.exports=function(){if("undefined"!=typeof document){if(document.contains)return document.contains;if(document.body&&document.body.contains)try{if("boolean"==typeof document.body.contains.call(document,""))return document.body.contains}catch(e){}}return r}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=y(n(2)),o=y(n(178)),a=n(104),i=n(118),c=y(n(128)),s=y(n(447)),l=y(n(248)),u=y(n(448)),d=y(n(300)),f=y(n(449)),p=y(n(233)),h=y(n(213)),m=y(n(249));function y(e){return e&&e.__esModule?e:{default:e}}t.default={startDate:o.default.momentObj,endDate:o.default.momentObj,onDatesChange:r.default.func.isRequired,focusedInput:s.default,onFocusChange:r.default.func.isRequired,onClose:r.default.func,startDateId:r.default.string.isRequired,startDatePlaceholderText:r.default.string,endDateId:r.default.string.isRequired,endDatePlaceholderText:r.default.string,disabled:d.default,required:r.default.bool,readOnly:r.default.bool,screenReaderInputMessage:r.default.string,showClearDates:r.default.bool,showDefaultInputIcon:r.default.bool,inputIconPosition:l.default,customInputIcon:r.default.node,customArrowIcon:r.default.node,customCloseIcon:r.default.node,noBorder:r.default.bool,block:r.default.bool,small:r.default.bool,regular:r.default.bool,keepFocusOnInput:r.default.bool,renderMonthText:(0,a.mutuallyExclusiveProps)(r.default.func,"renderMonthText","renderMonthElement"),renderMonthElement:(0,a.mutuallyExclusiveProps)(r.default.func,"renderMonthText","renderMonthElement"),orientation:u.default,anchorDirection:f.default,openDirection:p.default,horizontalMargin:r.default.number,withPortal:r.default.bool,withFullScreenPortal:r.default.bool,appendToBody:r.default.bool,disableScroll:r.default.bool,daySize:a.nonNegativeInteger,isRTL:r.default.bool,firstDayOfWeek:h.default,initialVisibleMonth:r.default.func,numberOfMonths:r.default.number,keepOpenOnDateSelect:r.default.bool,reopenPickerOnClearDates:r.default.bool,renderCalendarInfo:r.default.func,calendarInfoPosition:m.default,hideKeyboardShortcutsPanel:r.default.bool,verticalHeight:a.nonNegativeInteger,transitionDuration:a.nonNegativeInteger,verticalSpacing:a.nonNegativeInteger,navPrev:r.default.node,navNext:r.default.node,onPrevMonthClick:r.default.func,onNextMonthClick:r.default.func,renderCalendarDay:r.default.func,renderDayContents:r.default.func,minimumNights:r.default.number,enableOutsideDays:r.default.bool,isDayBlocked:r.default.func,isOutsideRange:r.default.func,isDayHighlighted:r.default.func,displayFormat:r.default.oneOfType([r.default.string,r.default.func]),monthFormat:r.default.string,weekDayFormat:r.default.string,phrases:r.default.shape((0,c.default)(i.DateRangePickerPhrases)),dayAriaLabelFormat:r.default.string}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,o=(r=n(2))&&r.__esModule?r:{default:r},a=n(77);t.default=o.default.oneOf([a.START_DATE,a.END_DATE])},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,o=(r=n(2))&&r.__esModule?r:{default:r},a=n(77);t.default=o.default.oneOf([a.HORIZONTAL_ORIENTATION,a.VERTICAL_ORIENTATION])},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,o=(r=n(2))&&r.__esModule?r:{default:r},a=n(77);t.default=o.default.oneOf([a.ANCHOR_LEFT,a.ANCHOR_RIGHT])},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t,n,o){var a,i,c,s="undefined"!=typeof window?window.innerWidth:0,l=e===r.ANCHOR_LEFT?s-n:n,u=o||0;return a={},i=e,c=Math.min(t+l-u,0),i in a?Object.defineProperty(a,i,{value:c,enumerable:!0,configurable:!0,writable:!0}):a[i]=c,a};var r=n(77)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t,n){var o=n.getBoundingClientRect(),a=o.left,i=o.top;return e===r.OPEN_UP&&(i=-(window.innerHeight-o.bottom)),t===r.ANCHOR_RIGHT&&(a=-(window.innerWidth-o.right)),{transform:"translate3d("+String(Math.round(a))+"px, "+String(Math.round(i))+"px, 0)"}};var r=n(77)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getScrollParent=o,t.getScrollAncestorsOverflowY=a,t.default=function(e){var t=a(e),n=function(e){return t.forEach((function(t,n){n.style.setProperty("overflow-y",e?"hidden":t)}))};return n(!0),function(){return n(!1)}};var r=function(){return document.scrollingElement||document.documentElement};function o(e){var t=e.parentElement;if(null==t)return r();var n=window.getComputedStyle(t).overflowY;return"visible"!==n&&"hidden"!==n&&t.scrollHeight>t.clientHeight?t:o(t)}function a(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Map,n=r(),i=o(e);return t.set(i,i.style.overflowY),i===n?t:a(i,t)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=O(n(11)),a=O(n(2)),i=O(n(31)),c=O(n(178)),s=n(104),l=O(n(233)),u=n(118),d=O(n(128)),f=O(n(454)),p=O(n(248)),h=O(n(300)),m=O(n(230)),y=O(n(355)),b=O(n(250)),g=O(n(251)),v=n(77);function O(e){return e&&e.__esModule?e:{default:e}}var w=(0,s.forbidExtraProps)({startDate:c.default.momentObj,startDateId:a.default.string,startDatePlaceholderText:a.default.string,isStartDateFocused:a.default.bool,endDate:c.default.momentObj,endDateId:a.default.string,endDatePlaceholderText:a.default.string,isEndDateFocused:a.default.bool,screenReaderMessage:a.default.string,showClearDates:a.default.bool,showCaret:a.default.bool,showDefaultInputIcon:a.default.bool,inputIconPosition:p.default,disabled:h.default,required:a.default.bool,readOnly:a.default.bool,openDirection:l.default,noBorder:a.default.bool,block:a.default.bool,small:a.default.bool,regular:a.default.bool,verticalSpacing:s.nonNegativeInteger,keepOpenOnDateSelect:a.default.bool,reopenPickerOnClearDates:a.default.bool,withFullScreenPortal:a.default.bool,minimumNights:s.nonNegativeInteger,isOutsideRange:a.default.func,displayFormat:a.default.oneOfType([a.default.string,a.default.func]),onFocusChange:a.default.func,onClose:a.default.func,onDatesChange:a.default.func,onKeyDownArrowDown:a.default.func,onKeyDownQuestionMark:a.default.func,customInputIcon:a.default.node,customArrowIcon:a.default.node,customCloseIcon:a.default.node,isFocused:a.default.bool,phrases:a.default.shape((0,d.default)(u.DateRangePickerInputPhrases)),isRTL:a.default.bool}),_={startDate:null,startDateId:v.START_DATE,startDatePlaceholderText:"Start Date",isStartDateFocused:!1,endDate:null,endDateId:v.END_DATE,endDatePlaceholderText:"End Date",isEndDateFocused:!1,screenReaderMessage:"",showClearDates:!1,showCaret:!1,showDefaultInputIcon:!1,inputIconPosition:v.ICON_BEFORE_POSITION,disabled:!1,required:!1,readOnly:!1,openDirection:v.OPEN_DOWN,noBorder:!1,block:!1,small:!1,regular:!1,verticalSpacing:void 0,keepOpenOnDateSelect:!1,reopenPickerOnClearDates:!1,withFullScreenPortal:!1,minimumNights:1,isOutsideRange:function(e){return!(0,b.default)(e,(0,i.default)())},displayFormat:function(){return i.default.localeData().longDateFormat("L")},onFocusChange:function(){},onClose:function(){},onDatesChange:function(){},onKeyDownArrowDown:function(){},onKeyDownQuestionMark:function(){},customInputIcon:null,customArrowIcon:null,customCloseIcon:null,isFocused:!1,phrases:u.DateRangePickerInputPhrases,isRTL:!1},k=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.onClearFocus=n.onClearFocus.bind(n),n.onStartDateChange=n.onStartDateChange.bind(n),n.onStartDateFocus=n.onStartDateFocus.bind(n),n.onEndDateChange=n.onEndDateChange.bind(n),n.onEndDateFocus=n.onEndDateFocus.bind(n),n.clearDates=n.clearDates.bind(n),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),r(t,[{key:"onClearFocus",value:function(){var e=this.props,t=e.onFocusChange,n=e.onClose,r=e.startDate,o=e.endDate;t(null),n({startDate:r,endDate:o})}},{key:"onEndDateChange",value:function(e){var t=this.props,n=t.startDate,r=t.isOutsideRange,o=t.minimumNights,a=t.keepOpenOnDateSelect,i=t.onDatesChange,c=(0,m.default)(e,this.getDisplayFormat());!c||r(c)||n&&(0,g.default)(c,n.clone().add(o,"days"))?i({startDate:n,endDate:null}):(i({startDate:n,endDate:c}),a||this.onClearFocus())}},{key:"onEndDateFocus",value:function(){var e=this.props,t=e.startDate,n=e.onFocusChange,r=e.withFullScreenPortal,o=e.disabled;t||!r||o&&o!==v.END_DATE?o&&o!==v.START_DATE||n(v.END_DATE):n(v.START_DATE)}},{key:"onStartDateChange",value:function(e){var t=this.props.endDate,n=this.props,r=n.isOutsideRange,o=n.minimumNights,a=n.onDatesChange,i=n.onFocusChange,c=n.disabled,s=(0,m.default)(e,this.getDisplayFormat()),l=s&&(0,g.default)(t,s.clone().add(o,"days"));!s||r(s)||c===v.END_DATE&&l?a({startDate:null,endDate:t}):(l&&(t=null),a({startDate:s,endDate:t}),i(v.END_DATE))}},{key:"onStartDateFocus",value:function(){var e=this.props,t=e.disabled,n=e.onFocusChange;t&&t!==v.END_DATE||n(v.START_DATE)}},{key:"getDisplayFormat",value:function(){var e=this.props.displayFormat;return"string"==typeof e?e:e()}},{key:"getDateString",value:function(e){var t=this.getDisplayFormat();return e&&t?e&&e.format(t):(0,y.default)(e)}},{key:"clearDates",value:function(){var e=this.props,t=e.onDatesChange,n=e.reopenPickerOnClearDates,r=e.onFocusChange;t({startDate:null,endDate:null}),n&&r(v.START_DATE)}},{key:"render",value:function(){var e=this.props,t=e.startDate,n=e.startDateId,r=e.startDatePlaceholderText,a=e.isStartDateFocused,i=e.endDate,c=e.endDateId,s=e.endDatePlaceholderText,l=e.isEndDateFocused,u=e.screenReaderMessage,d=e.showClearDates,p=e.showCaret,h=e.showDefaultInputIcon,m=e.inputIconPosition,y=e.customInputIcon,b=e.customArrowIcon,g=e.customCloseIcon,v=e.disabled,O=e.required,w=e.readOnly,_=e.openDirection,k=e.isFocused,S=e.phrases,j=e.onKeyDownArrowDown,E=e.onKeyDownQuestionMark,C=e.isRTL,D=e.noBorder,P=e.block,x=e.small,F=e.regular,T=e.verticalSpacing,M=this.getDateString(t),R=this.getDateString(i);return o.default.createElement(f.default,{startDate:M,startDateId:n,startDatePlaceholderText:r,isStartDateFocused:a,endDate:R,endDateId:c,endDatePlaceholderText:s,isEndDateFocused:l,isFocused:k,disabled:v,required:O,readOnly:w,openDirection:_,showCaret:p,showDefaultInputIcon:h,inputIconPosition:m,customInputIcon:y,customArrowIcon:b,customCloseIcon:g,phrases:S,onStartDateChange:this.onStartDateChange,onStartDateFocus:this.onStartDateFocus,onStartDateShiftTab:this.onClearFocus,onEndDateChange:this.onEndDateChange,onEndDateFocus:this.onEndDateFocus,onEndDateTab:this.onClearFocus,showClearDates:d,onClearDates:this.clearDates,screenReaderMessage:u,onKeyDownArrowDown:j,onKeyDownQuestionMark:E,isRTL:C,noBorder:D,block:P,small:x,regular:F,verticalSpacing:T})}}]),t}(o.default.Component);t.default=k,k.propTypes=w,k.defaultProps=_},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},o=O(n(112)),a=O(n(11)),i=O(n(2)),c=n(104),s=n(138),l=n(118),u=O(n(128)),d=O(n(233)),f=O(n(455)),p=O(n(248)),h=O(n(300)),m=O(n(459)),y=O(n(460)),b=O(n(252)),g=O(n(461)),v=n(77);function O(e){return e&&e.__esModule?e:{default:e}}var w=(0,c.forbidExtraProps)((0,o.default)({},s.withStylesPropTypes,{startDateId:i.default.string,startDatePlaceholderText:i.default.string,screenReaderMessage:i.default.string,endDateId:i.default.string,endDatePlaceholderText:i.default.string,onStartDateFocus:i.default.func,onEndDateFocus:i.default.func,onStartDateChange:i.default.func,onEndDateChange:i.default.func,onStartDateShiftTab:i.default.func,onEndDateTab:i.default.func,onClearDates:i.default.func,onKeyDownArrowDown:i.default.func,onKeyDownQuestionMark:i.default.func,startDate:i.default.string,endDate:i.default.string,isStartDateFocused:i.default.bool,isEndDateFocused:i.default.bool,showClearDates:i.default.bool,disabled:h.default,required:i.default.bool,readOnly:i.default.bool,openDirection:d.default,showCaret:i.default.bool,showDefaultInputIcon:i.default.bool,inputIconPosition:p.default,customInputIcon:i.default.node,customArrowIcon:i.default.node,customCloseIcon:i.default.node,noBorder:i.default.bool,block:i.default.bool,small:i.default.bool,regular:i.default.bool,verticalSpacing:c.nonNegativeInteger,isFocused:i.default.bool,phrases:i.default.shape((0,u.default)(l.DateRangePickerInputPhrases)),isRTL:i.default.bool})),_={startDateId:v.START_DATE,endDateId:v.END_DATE,startDatePlaceholderText:"Start Date",endDatePlaceholderText:"End Date",screenReaderMessage:"",onStartDateFocus:function(){},onEndDateFocus:function(){},onStartDateChange:function(){},onEndDateChange:function(){},onStartDateShiftTab:function(){},onEndDateTab:function(){},onClearDates:function(){},onKeyDownArrowDown:function(){},onKeyDownQuestionMark:function(){},startDate:"",endDate:"",isStartDateFocused:!1,isEndDateFocused:!1,showClearDates:!1,disabled:!1,required:!1,readOnly:!1,openDirection:v.OPEN_DOWN,showCaret:!1,showDefaultInputIcon:!1,inputIconPosition:v.ICON_BEFORE_POSITION,customInputIcon:null,customArrowIcon:null,customCloseIcon:null,noBorder:!1,block:!1,small:!1,regular:!1,verticalSpacing:void 0,isFocused:!1,phrases:l.DateRangePickerInputPhrases,isRTL:!1};function k(e){var t=e.startDate,n=e.startDateId,o=e.startDatePlaceholderText,i=e.screenReaderMessage,c=e.isStartDateFocused,l=e.onStartDateChange,u=e.onStartDateFocus,d=e.onStartDateShiftTab,p=e.endDate,h=e.endDateId,O=e.endDatePlaceholderText,w=e.isEndDateFocused,_=e.onEndDateChange,k=e.onEndDateFocus,S=e.onEndDateTab,j=e.onKeyDownArrowDown,E=e.onKeyDownQuestionMark,C=e.onClearDates,D=e.showClearDates,P=e.disabled,x=e.required,F=e.readOnly,T=e.showCaret,M=e.openDirection,R=e.showDefaultInputIcon,I=e.inputIconPosition,A=e.customInputIcon,N=e.customArrowIcon,L=e.customCloseIcon,U=e.isFocused,B=e.phrases,H=e.isRTL,q=e.noBorder,z=e.block,V=e.verticalSpacing,K=e.small,W=e.regular,G=e.styles,Y=A||a.default.createElement(g.default,(0,s.css)(G.DateRangePickerInput_calendarIcon_svg)),$=N||a.default.createElement(m.default,(0,s.css)(G.DateRangePickerInput_arrow_svg));H&&($=a.default.createElement(y.default,(0,s.css)(G.DateRangePickerInput_arrow_svg))),K&&($="-");var Q=L||a.default.createElement(b.default,(0,s.css)(G.DateRangePickerInput_clearDates_svg,K&&G.DateRangePickerInput_clearDates_svg__small)),J=i||B.keyboardNavigationInstructions,Z=(R||null!==A)&&a.default.createElement("button",r({},(0,s.css)(G.DateRangePickerInput_calendarIcon),{type:"button",disabled:P,"aria-label":B.focusStartDate,onClick:j}),Y),X=P===v.START_DATE||!0===P,ee=P===v.END_DATE||!0===P;return a.default.createElement("div",(0,s.css)(G.DateRangePickerInput,P&&G.DateRangePickerInput__disabled,H&&G.DateRangePickerInput__rtl,!q&&G.DateRangePickerInput__withBorder,z&&G.DateRangePickerInput__block,D&&G.DateRangePickerInput__showClearDates),I===v.ICON_BEFORE_POSITION&&Z,a.default.createElement(f.default,{id:n,placeholder:o,displayValue:t,screenReaderMessage:J,focused:c,isFocused:U,disabled:X,required:x,readOnly:F,showCaret:T,openDirection:M,onChange:l,onFocus:u,onKeyDownShiftTab:d,onKeyDownArrowDown:j,onKeyDownQuestionMark:E,verticalSpacing:V,small:K,regular:W}),a.default.createElement("div",r({},(0,s.css)(G.DateRangePickerInput_arrow),{"aria-hidden":"true",role:"presentation"}),$),a.default.createElement(f.default,{id:h,placeholder:O,displayValue:p,screenReaderMessage:J,focused:w,isFocused:U,disabled:ee,required:x,readOnly:F,showCaret:T,openDirection:M,onChange:_,onFocus:k,onKeyDownTab:S,onKeyDownArrowDown:j,onKeyDownQuestionMark:E,verticalSpacing:V,small:K,regular:W}),D&&a.default.createElement("button",r({type:"button","aria-label":B.clearDates},(0,s.css)(G.DateRangePickerInput_clearDates,K&&G.DateRangePickerInput_clearDates__small,!L&&G.DateRangePickerInput_clearDates_default,!(t||p)&&G.DateRangePickerInput_clearDates__hide),{onClick:C,disabled:P}),Q),I===v.ICON_AFTER_POSITION&&Z)}k.propTypes=w,k.defaultProps=_,t.default=(0,s.withStyles)((function(e){var t=e.reactDates,n=t.border,r=t.color,o=t.sizing;return{DateRangePickerInput:{backgroundColor:r.background,display:"inline-block"},DateRangePickerInput__disabled:{background:r.disabled},DateRangePickerInput__withBorder:{borderColor:r.border,borderWidth:n.pickerInput.borderWidth,borderStyle:n.pickerInput.borderStyle,borderRadius:n.pickerInput.borderRadius},DateRangePickerInput__rtl:{direction:"rtl"},DateRangePickerInput__block:{display:"block"},DateRangePickerInput__showClearDates:{paddingRight:30},DateRangePickerInput_arrow:{display:"inline-block",verticalAlign:"middle",color:r.text},DateRangePickerInput_arrow_svg:{verticalAlign:"middle",fill:r.text,height:o.arrowWidth,width:o.arrowWidth},DateRangePickerInput_clearDates:{background:"none",border:0,color:"inherit",font:"inherit",lineHeight:"normal",overflow:"visible",cursor:"pointer",padding:10,margin:"0 10px 0 5px",position:"absolute",right:0,top:"50%",transform:"translateY(-50%)"},DateRangePickerInput_clearDates__small:{padding:6},DateRangePickerInput_clearDates_default:{":focus":{background:r.core.border,borderRadius:"50%"},":hover":{background:r.core.border,borderRadius:"50%"}},DateRangePickerInput_clearDates__hide:{visibility:"hidden"},DateRangePickerInput_clearDates_svg:{fill:r.core.grayLight,height:12,width:15,verticalAlign:"middle"},DateRangePickerInput_clearDates_svg__small:{height:9},DateRangePickerInput_calendarIcon:{background:"none",border:0,color:"inherit",font:"inherit",lineHeight:"normal",overflow:"visible",cursor:"pointer",display:"inline-block",verticalAlign:"middle",padding:10,margin:"0 5px 0 10px"},DateRangePickerInput_calendarIcon_svg:{fill:r.core.grayLight,height:15,width:14,verticalAlign:"middle"}}}))(k)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=m(n(112)),i=m(n(11)),c=m(n(2)),s=n(104),l=n(138),u=m(n(456)),d=m(n(232)),f=m(n(353)),p=m(n(233)),h=n(77);function m(e){return e&&e.__esModule?e:{default:e}}var y="M0,"+String(h.FANG_HEIGHT_PX)+" "+String(h.FANG_WIDTH_PX)+","+String(h.FANG_HEIGHT_PX)+" "+h.FANG_WIDTH_PX/2+",0z",b="M0,"+String(h.FANG_HEIGHT_PX)+" "+h.FANG_WIDTH_PX/2+",0 "+String(h.FANG_WIDTH_PX)+","+String(h.FANG_HEIGHT_PX),g="M0,0 "+String(h.FANG_WIDTH_PX)+",0 "+h.FANG_WIDTH_PX/2+","+String(h.FANG_HEIGHT_PX)+"z",v="M0,0 "+h.FANG_WIDTH_PX/2+","+String(h.FANG_HEIGHT_PX)+" "+String(h.FANG_WIDTH_PX)+",0",O=(0,s.forbidExtraProps)((0,a.default)({},l.withStylesPropTypes,{id:c.default.string.isRequired,placeholder:c.default.string,displayValue:c.default.string,screenReaderMessage:c.default.string,focused:c.default.bool,disabled:c.default.bool,required:c.default.bool,readOnly:c.default.bool,openDirection:p.default,showCaret:c.default.bool,verticalSpacing:s.nonNegativeInteger,small:c.default.bool,block:c.default.bool,regular:c.default.bool,onChange:c.default.func,onFocus:c.default.func,onKeyDownShiftTab:c.default.func,onKeyDownTab:c.default.func,onKeyDownArrowDown:c.default.func,onKeyDownQuestionMark:c.default.func,isFocused:c.default.bool})),w={placeholder:"Select Date",displayValue:"",screenReaderMessage:"",focused:!1,disabled:!1,required:!1,readOnly:null,openDirection:h.OPEN_DOWN,showCaret:!1,verticalSpacing:h.DEFAULT_VERTICAL_SPACING,small:!1,block:!1,regular:!1,onChange:function(){},onFocus:function(){},onKeyDownShiftTab:function(){},onKeyDownTab:function(){},onKeyDownArrowDown:function(){},onKeyDownQuestionMark:function(){},isFocused:!1},_=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.state={dateString:"",isTouchDevice:!1},n.onChange=n.onChange.bind(n),n.onKeyDown=n.onKeyDown.bind(n),n.setInputRef=n.setInputRef.bind(n),n.throttledKeyDown=(0,u.default)(n.onFinalKeyDown,300,{trailing:!1}),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),o(t,[{key:"componentDidMount",value:function(){this.setState({isTouchDevice:(0,d.default)()})}},{key:"componentWillReceiveProps",value:function(e){this.state.dateString&&e.displayValue&&this.setState({dateString:""})}},{key:"componentDidUpdate",value:function(e){var t=this.props,n=t.focused,r=t.isFocused;e.focused===n&&e.isFocused===r||n&&r&&this.inputRef.focus()}},{key:"onChange",value:function(e){var t=this.props,n=t.onChange,r=t.onKeyDownQuestionMark,o=e.target.value;"?"===o[o.length-1]?r(e):this.setState({dateString:o},(function(){return n(o)}))}},{key:"onKeyDown",value:function(e){e.stopPropagation(),h.MODIFIER_KEY_NAMES.has(e.key)||this.throttledKeyDown(e)}},{key:"onFinalKeyDown",value:function(e){var t=this.props,n=t.onKeyDownShiftTab,r=t.onKeyDownTab,o=t.onKeyDownArrowDown,a=t.onKeyDownQuestionMark,i=e.key;"Tab"===i?e.shiftKey?n(e):r(e):"ArrowDown"===i?o(e):"?"===i&&(e.preventDefault(),a(e))}},{key:"setInputRef",value:function(e){this.inputRef=e}},{key:"render",value:function(){var e=this.state,t=e.dateString,n=e.isTouchDevice,o=this.props,a=o.id,c=o.placeholder,s=o.displayValue,u=o.screenReaderMessage,d=o.focused,p=o.showCaret,m=o.onFocus,O=o.disabled,w=o.required,_=o.readOnly,k=o.openDirection,S=o.verticalSpacing,j=o.small,E=o.regular,C=o.block,D=o.styles,P=o.theme.reactDates,x=t||s||"",F="DateInput__screen-reader-message-"+String(a),T=p&&d,M=(0,f.default)(P,j);return i.default.createElement("div",(0,l.css)(D.DateInput,j&&D.DateInput__small,C&&D.DateInput__block,T&&D.DateInput__withFang,O&&D.DateInput__disabled,T&&k===h.OPEN_DOWN&&D.DateInput__openDown,T&&k===h.OPEN_UP&&D.DateInput__openUp),i.default.createElement("input",r({},(0,l.css)(D.DateInput_input,j&&D.DateInput_input__small,E&&D.DateInput_input__regular,_&&D.DateInput_input__readOnly,d&&D.DateInput_input__focused,O&&D.DateInput_input__disabled),{"aria-label":c,type:"text",id:a,name:a,ref:this.setInputRef,value:x,onChange:this.onChange,onKeyDown:this.onKeyDown,onFocus:m,placeholder:c,autoComplete:"off",disabled:O,readOnly:"boolean"==typeof _?_:n,required:w,"aria-describedby":u&&F})),T&&i.default.createElement("svg",r({role:"presentation",focusable:"false"},(0,l.css)(D.DateInput_fang,k===h.OPEN_DOWN&&{top:M+S-h.FANG_HEIGHT_PX-1},k===h.OPEN_UP&&{bottom:M+S-h.FANG_HEIGHT_PX-1})),i.default.createElement("path",r({},(0,l.css)(D.DateInput_fangShape),{d:k===h.OPEN_DOWN?y:g})),i.default.createElement("path",r({},(0,l.css)(D.DateInput_fangStroke),{d:k===h.OPEN_DOWN?b:v}))),u&&i.default.createElement("p",r({},(0,l.css)(D.DateInput_screenReaderMessage),{id:F}),u))}}]),t}(i.default.Component);_.propTypes=O,_.defaultProps=w,t.default=(0,l.withStyles)((function(e){var t=e.reactDates,n=t.border,r=t.color,o=t.sizing,a=t.spacing,i=t.font,c=t.zIndex;return{DateInput:{margin:0,padding:a.inputPadding,background:r.background,position:"relative",display:"inline-block",width:o.inputWidth,verticalAlign:"middle"},DateInput__small:{width:o.inputWidth_small},DateInput__block:{width:"100%"},DateInput__disabled:{background:r.disabled,color:r.textDisabled},DateInput_input:{fontWeight:200,fontSize:i.input.size,lineHeight:i.input.lineHeight,color:r.text,backgroundColor:r.background,width:"100%",padding:String(a.displayTextPaddingVertical)+"px "+String(a.displayTextPaddingHorizontal)+"px",paddingTop:a.displayTextPaddingTop,paddingBottom:a.displayTextPaddingBottom,paddingLeft:a.displayTextPaddingLeft,paddingRight:a.displayTextPaddingRight,border:n.input.border,borderTop:n.input.borderTop,borderRight:n.input.borderRight,borderBottom:n.input.borderBottom,borderLeft:n.input.borderLeft,borderRadius:n.input.borderRadius},DateInput_input__small:{fontSize:i.input.size_small,lineHeight:i.input.lineHeight_small,letterSpacing:i.input.letterSpacing_small,padding:String(a.displayTextPaddingVertical_small)+"px "+String(a.displayTextPaddingHorizontal_small)+"px",paddingTop:a.displayTextPaddingTop_small,paddingBottom:a.displayTextPaddingBottom_small,paddingLeft:a.displayTextPaddingLeft_small,paddingRight:a.displayTextPaddingRight_small},DateInput_input__regular:{fontWeight:"auto"},DateInput_input__readOnly:{userSelect:"none"},DateInput_input__focused:{outline:n.input.outlineFocused,background:r.backgroundFocused,border:n.input.borderFocused,borderTop:n.input.borderTopFocused,borderRight:n.input.borderRightFocused,borderBottom:n.input.borderBottomFocused,borderLeft:n.input.borderLeftFocused},DateInput_input__disabled:{background:r.disabled,fontStyle:i.input.styleDisabled},DateInput_screenReaderMessage:{border:0,clip:"rect(0, 0, 0, 0)",height:1,margin:-1,overflow:"hidden",padding:0,position:"absolute",width:1},DateInput_fang:{position:"absolute",width:h.FANG_WIDTH_PX,height:h.FANG_HEIGHT_PX,left:22,zIndex:c+2},DateInput_fangShape:{fill:r.background},DateInput_fangStroke:{stroke:r.core.border,fill:"transparent"}}}))(_)},function(e,t,n){var r=n(725),o=n(354);e.exports=function(e,t,n){var a=!0,i=!0;if("function"!=typeof e)throw new TypeError("Expected a function");return o(n)&&(a="leading"in n?!!n.leading:a,i="trailing"in n?!!n.trailing:i),r(e,t,{leading:a,maxWait:t,trailing:i})}},function(e,t,n){var r=n(727),o="object"==typeof self&&self&&self.Object===Object&&self,a=r||o||Function("return this")();e.exports=a},function(e,t,n){var r=n(457).Symbol;e.exports=r},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,o=(r=n(11))&&r.__esModule?r:{default:r},a=function(e){return o.default.createElement("svg",e,o.default.createElement("path",{d:"M694.4 242.4l249.1 249.1c11 11 11 21 0 32L694.4 772.7c-5 5-10 7-16 7s-11-2-16-7c-11-11-11-21 0-32l210.1-210.1H67.1c-13 0-23-10-23-23s10-23 23-23h805.4L662.4 274.5c-21-21.1 11-53.1 32-32.1z"}))};a.defaultProps={viewBox:"0 0 1000 1000"},t.default=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,o=(r=n(11))&&r.__esModule?r:{default:r},a=function(e){return o.default.createElement("svg",e,o.default.createElement("path",{d:"M336.2 274.5l-210.1 210h805.4c13 0 23 10 23 23s-10 23-23 23H126.1l210.1 210.1c11 11 11 21 0 32-5 5-10 7-16 7s-11-2-16-7l-249.1-249c-11-11-11-21 0-32l249.1-249.1c21-21.1 53 10.9 32 32z"}))};a.defaultProps={viewBox:"0 0 1000 1000"},t.default=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,o=(r=n(11))&&r.__esModule?r:{default:r},a=function(e){return o.default.createElement("svg",e,o.default.createElement("path",{d:"M107.2 1392.9h241.1v-241.1H107.2v241.1zm294.7 0h267.9v-241.1H401.9v241.1zm-294.7-294.7h241.1V830.4H107.2v267.8zm294.7 0h267.9V830.4H401.9v267.8zM107.2 776.8h241.1V535.7H107.2v241.1zm616.2 616.1h267.9v-241.1H723.4v241.1zM401.9 776.8h267.9V535.7H401.9v241.1zm642.9 616.1H1286v-241.1h-241.1v241.1zm-321.4-294.7h267.9V830.4H723.4v267.8zM428.7 375V133.9c0-7.3-2.7-13.5-8-18.8-5.3-5.3-11.6-8-18.8-8h-53.6c-7.3 0-13.5 2.7-18.8 8-5.3 5.3-8 11.6-8 18.8V375c0 7.3 2.7 13.5 8 18.8 5.3 5.3 11.6 8 18.8 8h53.6c7.3 0 13.5-2.7 18.8-8 5.3-5.3 8-11.5 8-18.8zm616.1 723.2H1286V830.4h-241.1v267.8zM723.4 776.8h267.9V535.7H723.4v241.1zm321.4 0H1286V535.7h-241.1v241.1zm26.8-401.8V133.9c0-7.3-2.7-13.5-8-18.8-5.3-5.3-11.6-8-18.8-8h-53.6c-7.3 0-13.5 2.7-18.8 8-5.3 5.3-8 11.6-8 18.8V375c0 7.3 2.7 13.5 8 18.8 5.3 5.3 11.6 8 18.8 8h53.6c7.3 0 13.5-2.7 18.8-8 5.4-5.3 8-11.5 8-18.8zm321.5-53.6v1071.4c0 29-10.6 54.1-31.8 75.3-21.2 21.2-46.3 31.8-75.3 31.8H107.2c-29 0-54.1-10.6-75.3-31.8C10.6 1447 0 1421.9 0 1392.9V321.4c0-29 10.6-54.1 31.8-75.3s46.3-31.8 75.3-31.8h107.2v-80.4c0-36.8 13.1-68.4 39.3-94.6S311.4 0 348.3 0h53.6c36.8 0 68.4 13.1 94.6 39.3 26.2 26.2 39.3 57.8 39.3 94.6v80.4h321.5v-80.4c0-36.8 13.1-68.4 39.3-94.6C922.9 13.1 954.4 0 991.3 0h53.6c36.8 0 68.4 13.1 94.6 39.3s39.3 57.8 39.3 94.6v80.4H1286c29 0 54.1 10.6 75.3 31.8 21.2 21.2 31.8 46.3 31.8 75.3z"}))};a.defaultProps={viewBox:"0 0 1393.1 1500"},t.default=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=F(n(112)),a=F(n(11)),i=F(n(2)),c=F(n(178)),s=n(104),l=F(n(31)),u=F(n(352)),d=F(n(232)),f=n(118),p=F(n(128)),h=F(n(250)),m=F(n(463)),y=F(n(229)),b=F(n(301)),g=F(n(251)),v=F(n(464)),O=F(n(356)),w=F(n(736)),_=F(n(297)),k=F(n(299)),S=F(n(300)),j=F(n(447)),E=F(n(231)),C=F(n(213)),D=F(n(249)),P=n(77),x=F(n(357));function F(e){return e&&e.__esModule?e:{default:e}}function T(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var M=(0,s.forbidExtraProps)({startDate:c.default.momentObj,endDate:c.default.momentObj,onDatesChange:i.default.func,startDateOffset:i.default.func,endDateOffset:i.default.func,focusedInput:j.default,onFocusChange:i.default.func,onClose:i.default.func,keepOpenOnDateSelect:i.default.bool,minimumNights:i.default.number,disabled:S.default,isOutsideRange:i.default.func,isDayBlocked:i.default.func,isDayHighlighted:i.default.func,renderMonthText:(0,s.mutuallyExclusiveProps)(i.default.func,"renderMonthText","renderMonthElement"),renderMonthElement:(0,s.mutuallyExclusiveProps)(i.default.func,"renderMonthText","renderMonthElement"),enableOutsideDays:i.default.bool,numberOfMonths:i.default.number,orientation:E.default,withPortal:i.default.bool,initialVisibleMonth:i.default.func,hideKeyboardShortcutsPanel:i.default.bool,daySize:s.nonNegativeInteger,noBorder:i.default.bool,verticalBorderSpacing:s.nonNegativeInteger,horizontalMonthPadding:s.nonNegativeInteger,navPrev:i.default.node,navNext:i.default.node,noNavButtons:i.default.bool,onPrevMonthClick:i.default.func,onNextMonthClick:i.default.func,onOutsideClick:i.default.func,renderCalendarDay:i.default.func,renderDayContents:i.default.func,renderCalendarInfo:i.default.func,calendarInfoPosition:D.default,firstDayOfWeek:C.default,verticalHeight:s.nonNegativeInteger,transitionDuration:s.nonNegativeInteger,onBlur:i.default.func,isFocused:i.default.bool,showKeyboardShortcuts:i.default.bool,monthFormat:i.default.string,weekDayFormat:i.default.string,phrases:i.default.shape((0,p.default)(f.DayPickerPhrases)),dayAriaLabelFormat:i.default.string,isRTL:i.default.bool}),R={startDate:void 0,endDate:void 0,onDatesChange:function(){},startDateOffset:void 0,endDateOffset:void 0,focusedInput:null,onFocusChange:function(){},onClose:function(){},keepOpenOnDateSelect:!1,minimumNights:1,disabled:!1,isOutsideRange:function(){},isDayBlocked:function(){},isDayHighlighted:function(){},renderMonthText:null,enableOutsideDays:!1,numberOfMonths:1,orientation:P.HORIZONTAL_ORIENTATION,withPortal:!1,hideKeyboardShortcutsPanel:!1,initialVisibleMonth:null,daySize:P.DAY_SIZE,navPrev:null,navNext:null,noNavButtons:!1,onPrevMonthClick:function(){},onNextMonthClick:function(){},onOutsideClick:function(){},renderCalendarDay:void 0,renderDayContents:null,renderCalendarInfo:null,renderMonthElement:null,calendarInfoPosition:P.INFO_POSITION_BOTTOM,firstDayOfWeek:null,verticalHeight:null,noBorder:!1,transitionDuration:void 0,verticalBorderSpacing:void 0,horizontalMonthPadding:13,onBlur:function(){},isFocused:!1,showKeyboardShortcuts:!1,monthFormat:"MMMM YYYY",weekDayFormat:"dd",phrases:f.DayPickerPhrases,dayAriaLabelFormat:void 0,isRTL:!1},I=function(e,t){return t===P.START_DATE?e.chooseAvailableStartDate:t===P.END_DATE?e.chooseAvailableEndDate:e.chooseAvailableDate},A=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));n.isTouchDevice=(0,d.default)(),n.today=(0,l.default)(),n.modifiers={today:function(e){return n.isToday(e)},blocked:function(e){return n.isBlocked(e)},"blocked-calendar":function(t){return e.isDayBlocked(t)},"blocked-out-of-range":function(t){return e.isOutsideRange(t)},"highlighted-calendar":function(t){return e.isDayHighlighted(t)},valid:function(e){return!n.isBlocked(e)},"selected-start":function(e){return n.isStartDate(e)},"selected-end":function(e){return n.isEndDate(e)},"blocked-minimum-nights":function(e){return n.doesNotMeetMinimumNights(e)},"selected-span":function(e){return n.isInSelectedSpan(e)},"last-in-range":function(e){return n.isLastInRange(e)},hovered:function(e){return n.isHovered(e)},"hovered-span":function(e){return n.isInHoveredSpan(e)},"hovered-offset":function(e){return n.isInHoveredSpan(e)},"after-hovered-start":function(e){return n.isDayAfterHoveredStartDate(e)},"first-day-of-week":function(e){return n.isFirstDayOfWeek(e)},"last-day-of-week":function(e){return n.isLastDayOfWeek(e)}};var r=n.getStateForNewMonth(e),a=r.currentMonth,i=r.visibleDays,c=I(e.phrases,e.focusedInput);return n.state={hoverDate:null,currentMonth:a,phrases:(0,o.default)({},e.phrases,{chooseAvailableDate:c}),visibleDays:i},n.onDayClick=n.onDayClick.bind(n),n.onDayMouseEnter=n.onDayMouseEnter.bind(n),n.onDayMouseLeave=n.onDayMouseLeave.bind(n),n.onPrevMonthClick=n.onPrevMonthClick.bind(n),n.onNextMonthClick=n.onNextMonthClick.bind(n),n.onMonthChange=n.onMonthChange.bind(n),n.onYearChange=n.onYearChange.bind(n),n.onMultiplyScrollableMonths=n.onMultiplyScrollableMonths.bind(n),n.getFirstFocusableDay=n.getFirstFocusableDay.bind(n),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),r(t,[{key:"componentWillReceiveProps",value:function(e){var t=this,n=e.startDate,r=e.endDate,a=e.focusedInput,i=e.minimumNights,c=e.isOutsideRange,s=e.isDayBlocked,d=e.isDayHighlighted,f=e.phrases,p=e.initialVisibleMonth,h=e.numberOfMonths,m=e.enableOutsideDays,b=this.props,g=b.startDate,v=b.endDate,O=b.focusedInput,w=b.minimumNights,_=b.isOutsideRange,k=b.isDayBlocked,S=b.isDayHighlighted,j=b.phrases,E=b.initialVisibleMonth,C=b.numberOfMonths,D=b.enableOutsideDays,x=this.state.visibleDays,F=!1,T=!1,M=!1;c!==_&&(this.modifiers["blocked-out-of-range"]=function(e){return c(e)},F=!0),s!==k&&(this.modifiers["blocked-calendar"]=function(e){return s(e)},T=!0),d!==S&&(this.modifiers["highlighted-calendar"]=function(e){return d(e)},M=!0);var R=F||T||M,A=n!==g,N=r!==v,L=a!==O;if(h!==C||m!==D||p!==E&&!O&&L){var U=this.getStateForNewMonth(e),B=U.currentMonth;x=U.visibleDays,this.setState({currentMonth:B,visibleDays:x})}var H={};if(A&&(H=this.deleteModifier(H,g,"selected-start"),H=this.addModifier(H,n,"selected-start"),g)){var q=g.clone().add(1,"day"),z=g.clone().add(w+1,"days");H=this.deleteModifierFromRange(H,q,z,"after-hovered-start")}if(N&&(H=this.deleteModifier(H,v,"selected-end"),H=this.addModifier(H,r,"selected-end")),(A||N)&&(g&&v&&(H=this.deleteModifierFromRange(H,g,v.clone().add(1,"day"),"selected-span")),n&&r&&(H=this.deleteModifierFromRange(H,n,r.clone().add(1,"day"),"hovered-span"),H=this.addModifierToRange(H,n.clone().add(1,"day"),r,"selected-span"))),!this.isTouchDevice&&A&&n&&!r){var V=n.clone().add(1,"day"),K=n.clone().add(i+1,"days");H=this.addModifierToRange(H,V,K,"after-hovered-start")}if(w>0&&(L||A||i!==w)){var W=g||this.today;H=this.deleteModifierFromRange(H,W,W.clone().add(w,"days"),"blocked-minimum-nights"),H=this.deleteModifierFromRange(H,W,W.clone().add(w,"days"),"blocked")}(L||R)&&(0,u.default)(x).forEach((function(e){Object.keys(e).forEach((function(e){var n=(0,l.default)(e),r=!1;(L||F)&&(c(n)?(H=t.addModifier(H,n,"blocked-out-of-range"),r=!0):H=t.deleteModifier(H,n,"blocked-out-of-range")),(L||T)&&(s(n)?(H=t.addModifier(H,n,"blocked-calendar"),r=!0):H=t.deleteModifier(H,n,"blocked-calendar")),H=r?t.addModifier(H,n,"blocked"):t.deleteModifier(H,n,"blocked"),(L||M)&&(H=d(n)?t.addModifier(H,n,"highlighted-calendar"):t.deleteModifier(H,n,"highlighted-calendar"))}))})),i>0&&n&&a===P.END_DATE&&(H=this.addModifierToRange(H,n,n.clone().add(i,"days"),"blocked-minimum-nights"),H=this.addModifierToRange(H,n,n.clone().add(i,"days"),"blocked"));var G=(0,l.default)();if((0,y.default)(this.today,G)||(H=this.deleteModifier(H,this.today,"today"),H=this.addModifier(H,G,"today"),this.today=G),Object.keys(H).length>0&&this.setState({visibleDays:(0,o.default)({},x,H)}),L||f!==j){var Y=I(f,a);this.setState({phrases:(0,o.default)({},f,{chooseAvailableDate:Y})})}}},{key:"onDayClick",value:function(e,t){var n=this.props,r=n.keepOpenOnDateSelect,o=n.minimumNights,a=n.onBlur,i=n.focusedInput,c=n.onFocusChange,s=n.onClose,l=n.onDatesChange,u=n.startDateOffset,d=n.endDateOffset,f=n.disabled;if(t&&t.preventDefault(),!this.isBlocked(e)){var p=this.props,m=p.startDate,y=p.endDate;if(u||d)m=(0,w.default)(u,e),y=(0,w.default)(d,e),r||(c(null),s({startDate:m,endDate:y}));else if(i===P.START_DATE){var v=y&&y.clone().subtract(o,"days"),O=(0,g.default)(v,e)||(0,b.default)(m,y),_=f===P.END_DATE;_&&O||(m=e,O&&(y=null)),_&&!O?(c(null),s({startDate:m,endDate:y})):_||c(P.END_DATE)}else if(i===P.END_DATE){var k=m&&m.clone().add(o,"days");m?(0,h.default)(e,k)?(y=e,r||(c(null),s({startDate:m,endDate:y}))):f!==P.START_DATE&&(m=e,y=null):(y=e,c(P.START_DATE))}l({startDate:m,endDate:y}),a()}}},{key:"onDayMouseEnter",value:function(e){if(!this.isTouchDevice){var t=this.props,n=t.startDate,r=t.endDate,a=t.focusedInput,i=t.minimumNights,c=t.startDateOffset,s=t.endDateOffset,l=this.state,u=l.hoverDate,d=l.visibleDays,f=null;if(a){var p=c||s,h={};if(p){var m=(0,w.default)(c,e),v=(0,w.default)(s,e,(function(e){return e.add(1,"day")}));f={start:m,end:v},this.state.dateOffset&&this.state.dateOffset.start&&this.state.dateOffset.end&&(h=this.deleteModifierFromRange(h,this.state.dateOffset.start,this.state.dateOffset.end,"hovered-offset")),h=this.addModifierToRange(h,m,v,"hovered-offset")}if(!p){if(h=this.deleteModifier(h,u,"hovered"),h=this.addModifier(h,e,"hovered"),n&&!r&&a===P.END_DATE){if((0,b.default)(u,n)){var O=u.clone().add(1,"day");h=this.deleteModifierFromRange(h,n,O,"hovered-span")}if(!this.isBlocked(e)&&(0,b.default)(e,n)){var _=e.clone().add(1,"day");h=this.addModifierToRange(h,n,_,"hovered-span")}}if(!n&&r&&a===P.START_DATE&&((0,g.default)(u,r)&&(h=this.deleteModifierFromRange(h,u,r,"hovered-span")),!this.isBlocked(e)&&(0,g.default)(e,r)&&(h=this.addModifierToRange(h,e,r,"hovered-span"))),n){var k=n.clone().add(1,"day"),S=n.clone().add(i+1,"days");if(h=this.deleteModifierFromRange(h,k,S,"after-hovered-start"),(0,y.default)(e,n)){var j=n.clone().add(1,"day"),E=n.clone().add(i+1,"days");h=this.addModifierToRange(h,j,E,"after-hovered-start")}}}this.setState({hoverDate:e,dateOffset:f,visibleDays:(0,o.default)({},d,h)})}}}},{key:"onDayMouseLeave",value:function(e){var t=this.props,n=t.startDate,r=t.endDate,a=t.minimumNights,i=this.state,c=i.hoverDate,s=i.visibleDays,l=i.dateOffset;if(!this.isTouchDevice&&c){var u={};if(u=this.deleteModifier(u,c,"hovered"),l&&(u=this.deleteModifierFromRange(u,this.state.dateOffset.start,this.state.dateOffset.end,"hovered-offset")),n&&!r&&(0,b.default)(c,n)){var d=c.clone().add(1,"day");u=this.deleteModifierFromRange(u,n,d,"hovered-span")}if(!n&&r&&(0,b.default)(r,c)&&(u=this.deleteModifierFromRange(u,c,r,"hovered-span")),n&&(0,y.default)(e,n)){var f=n.clone().add(1,"day"),p=n.clone().add(a+1,"days");u=this.deleteModifierFromRange(u,f,p,"after-hovered-start")}this.setState({hoverDate:null,visibleDays:(0,o.default)({},s,u)})}}},{key:"onPrevMonthClick",value:function(){var e=this.props,t=e.onPrevMonthClick,n=e.numberOfMonths,r=e.enableOutsideDays,a=this.state,i=a.currentMonth,c=a.visibleDays,s={};Object.keys(c).sort().slice(0,n+1).forEach((function(e){s[e]=c[e]}));var l=i.clone().subtract(2,"months"),u=(0,v.default)(l,1,r,!0),d=i.clone().subtract(1,"month");this.setState({currentMonth:d,visibleDays:(0,o.default)({},s,this.getModifiers(u))},(function(){t(d.clone())}))}},{key:"onNextMonthClick",value:function(){var e=this.props,t=e.onNextMonthClick,n=e.numberOfMonths,r=e.enableOutsideDays,a=this.state,i=a.currentMonth,c=a.visibleDays,s={};Object.keys(c).sort().slice(1).forEach((function(e){s[e]=c[e]}));var l=i.clone().add(n+1,"month"),u=(0,v.default)(l,1,r,!0),d=i.clone().add(1,"month");this.setState({currentMonth:d,visibleDays:(0,o.default)({},s,this.getModifiers(u))},(function(){t(d.clone())}))}},{key:"onMonthChange",value:function(e){var t=this.props,n=t.numberOfMonths,r=t.enableOutsideDays,o=t.orientation===P.VERTICAL_SCROLLABLE,a=(0,v.default)(e,n,r,o);this.setState({currentMonth:e.clone(),visibleDays:this.getModifiers(a)})}},{key:"onYearChange",value:function(e){var t=this.props,n=t.numberOfMonths,r=t.enableOutsideDays,o=t.orientation===P.VERTICAL_SCROLLABLE,a=(0,v.default)(e,n,r,o);this.setState({currentMonth:e.clone(),visibleDays:this.getModifiers(a)})}},{key:"onMultiplyScrollableMonths",value:function(){var e=this.props,t=e.numberOfMonths,n=e.enableOutsideDays,r=this.state,a=r.currentMonth,i=r.visibleDays,c=Object.keys(i).length,s=a.clone().add(c,"month"),l=(0,v.default)(s,t,n,!0);this.setState({visibleDays:(0,o.default)({},i,this.getModifiers(l))})}},{key:"getFirstFocusableDay",value:function(e){var t=this,n=this.props,r=n.startDate,o=n.endDate,a=n.focusedInput,i=n.minimumNights,c=n.numberOfMonths,s=e.clone().startOf("month");if(a===P.START_DATE&&r?s=r.clone():a===P.END_DATE&&!o&&r?s=r.clone().add(i,"days"):a===P.END_DATE&&o&&(s=o.clone()),this.isBlocked(s)){for(var l=[],u=e.clone().add(c-1,"months").endOf("month"),d=s.clone();!(0,b.default)(d,u);)d=d.clone().add(1,"day"),l.push(d);var f=l.filter((function(e){return!t.isBlocked(e)}));f.length>0&&(s=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],_n=!0,r=!1,o=void 0;try{for(var a,i=e[Symbol.iterator]();!(_n=(a=i.next()).done)&&(n.push(a.value),!t||n.length!==t);_n=!0);}catch(e){r=!0,o=e}finally{try{!_n&&i.return&&i.return()}finally{if(r)throw o}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")}(f,1)[0])}return s}},{key:"getModifiers",value:function(e){var t=this,n={};return Object.keys(e).forEach((function(r){n[r]={},e[r].forEach((function(e){n[r][(0,_.default)(e)]=t.getModifiersForDay(e)}))})),n}},{key:"getModifiersForDay",value:function(e){var t=this;return new Set(Object.keys(this.modifiers).filter((function(n){return t.modifiers[n](e)})))}},{key:"getStateForNewMonth",value:function(e){var t=this,n=e.initialVisibleMonth,r=e.numberOfMonths,o=e.enableOutsideDays,a=e.orientation,i=e.startDate,c=(n||(i?function(){return i}:function(){return t.today}))(),s=a===P.VERTICAL_SCROLLABLE;return{currentMonth:c,visibleDays:this.getModifiers((0,v.default)(c,r,o,s))}}},{key:"addModifier",value:function(e,t,n){var r=this.props,a=r.numberOfMonths,i=r.enableOutsideDays,c=r.orientation,s=this.state,l=s.currentMonth,u=s.visibleDays,d=l,f=a;if(c===P.VERTICAL_SCROLLABLE?f=Object.keys(u).length:(d=d.clone().subtract(1,"month"),f+=2),!t||!(0,O.default)(t,d,f,i))return e;var p=(0,_.default)(t),h=(0,o.default)({},e);if(i)h=Object.keys(u).filter((function(e){return Object.keys(u[e]).indexOf(p)>-1})).reduce((function(t,r){var a=e[r]||u[r],i=new Set(a[p]);return i.add(n),(0,o.default)({},t,T({},r,(0,o.default)({},a,T({},p,i))))}),h);else{var m=(0,k.default)(t),y=e[m]||u[m],b=new Set(y[p]);b.add(n),h=(0,o.default)({},h,T({},m,(0,o.default)({},y,T({},p,b))))}return h}},{key:"addModifierToRange",value:function(e,t,n,r){for(var o=e,a=t.clone();(0,g.default)(a,n);)o=this.addModifier(o,a,r),a=a.clone().add(1,"day");return o}},{key:"deleteModifier",value:function(e,t,n){var r=this.props,a=r.numberOfMonths,i=r.enableOutsideDays,c=r.orientation,s=this.state,l=s.currentMonth,u=s.visibleDays,d=l,f=a;if(c===P.VERTICAL_SCROLLABLE?f=Object.keys(u).length:(d=d.clone().subtract(1,"month"),f+=2),!t||!(0,O.default)(t,d,f,i))return e;var p=(0,_.default)(t),h=(0,o.default)({},e);if(i)h=Object.keys(u).filter((function(e){return Object.keys(u[e]).indexOf(p)>-1})).reduce((function(t,r){var a=e[r]||u[r],i=new Set(a[p]);return i.delete(n),(0,o.default)({},t,T({},r,(0,o.default)({},a,T({},p,i))))}),h);else{var m=(0,k.default)(t),y=e[m]||u[m],b=new Set(y[p]);b.delete(n),h=(0,o.default)({},h,T({},m,(0,o.default)({},y,T({},p,b))))}return h}},{key:"deleteModifierFromRange",value:function(e,t,n,r){for(var o=e,a=t.clone();(0,g.default)(a,n);)o=this.deleteModifier(o,a,r),a=a.clone().add(1,"day");return o}},{key:"doesNotMeetMinimumNights",value:function(e){var t=this.props,n=t.startDate,r=t.isOutsideRange,o=t.focusedInput,a=t.minimumNights;if(o!==P.END_DATE)return!1;if(n){var i=e.diff(n.clone().startOf("day").hour(12),"days");return i<a&&i>=0}return r((0,l.default)(e).subtract(a,"days"))}},{key:"isDayAfterHoveredStartDate",value:function(e){var t=this.props,n=t.startDate,r=t.endDate,o=t.minimumNights,a=(this.state||{}).hoverDate;return!!n&&!r&&!this.isBlocked(e)&&(0,m.default)(a,e)&&o>0&&(0,y.default)(a,n)}},{key:"isEndDate",value:function(e){var t=this.props.endDate;return(0,y.default)(e,t)}},{key:"isHovered",value:function(e){var t=(this.state||{}).hoverDate;return!!this.props.focusedInput&&(0,y.default)(e,t)}},{key:"isInHoveredSpan",value:function(e){var t=this.props,n=t.startDate,r=t.endDate,o=(this.state||{}).hoverDate,a=!!n&&!r&&(e.isBetween(n,o)||(0,y.default)(o,e)),i=!!r&&!n&&(e.isBetween(o,r)||(0,y.default)(o,e)),c=o&&!this.isBlocked(o);return(a||i)&&c}},{key:"isInSelectedSpan",value:function(e){var t=this.props,n=t.startDate,r=t.endDate;return e.isBetween(n,r)}},{key:"isLastInRange",value:function(e){var t=this.props.endDate;return this.isInSelectedSpan(e)&&(0,m.default)(e,t)}},{key:"isStartDate",value:function(e){var t=this.props.startDate;return(0,y.default)(e,t)}},{key:"isBlocked",value:function(e){var t=this.props,n=t.isDayBlocked,r=t.isOutsideRange;return n(e)||r(e)||this.doesNotMeetMinimumNights(e)}},{key:"isToday",value:function(e){return(0,y.default)(e,this.today)}},{key:"isFirstDayOfWeek",value:function(e){var t=this.props.firstDayOfWeek;return e.day()===(t||l.default.localeData().firstDayOfWeek())}},{key:"isLastDayOfWeek",value:function(e){var t=this.props.firstDayOfWeek;return e.day()===((t||l.default.localeData().firstDayOfWeek())+6)%7}},{key:"render",value:function(){var e=this.props,t=e.numberOfMonths,n=e.orientation,r=e.monthFormat,o=e.renderMonthText,i=e.navPrev,c=e.navNext,s=e.noNavButtons,l=e.onOutsideClick,u=e.withPortal,d=e.enableOutsideDays,f=e.firstDayOfWeek,p=e.hideKeyboardShortcutsPanel,h=e.daySize,m=e.focusedInput,y=e.renderCalendarDay,b=e.renderDayContents,g=e.renderCalendarInfo,v=e.renderMonthElement,O=e.calendarInfoPosition,w=e.onBlur,_=e.isFocused,k=e.showKeyboardShortcuts,S=e.isRTL,j=e.weekDayFormat,E=e.dayAriaLabelFormat,C=e.verticalHeight,D=e.noBorder,P=e.transitionDuration,F=e.verticalBorderSpacing,T=e.horizontalMonthPadding,M=this.state,R=M.currentMonth,I=M.phrases,A=M.visibleDays;return a.default.createElement(x.default,{orientation:n,enableOutsideDays:d,modifiers:A,numberOfMonths:t,onDayClick:this.onDayClick,onDayMouseEnter:this.onDayMouseEnter,onDayMouseLeave:this.onDayMouseLeave,onPrevMonthClick:this.onPrevMonthClick,onNextMonthClick:this.onNextMonthClick,onMonthChange:this.onMonthChange,onYearChange:this.onYearChange,onMultiplyScrollableMonths:this.onMultiplyScrollableMonths,monthFormat:r,renderMonthText:o,withPortal:u,hidden:!m,initialVisibleMonth:function(){return R},daySize:h,onOutsideClick:l,navPrev:i,navNext:c,noNavButtons:s,renderCalendarDay:y,renderDayContents:b,renderCalendarInfo:g,renderMonthElement:v,calendarInfoPosition:O,firstDayOfWeek:f,hideKeyboardShortcutsPanel:p,isFocused:_,getFirstFocusableDay:this.getFirstFocusableDay,onBlur:w,showKeyboardShortcuts:k,phrases:I,isRTL:S,weekDayFormat:j,dayAriaLabelFormat:E,verticalHeight:C,verticalBorderSpacing:F,noBorder:D,transitionDuration:P,horizontalMonthPadding:T})}}]),t}(a.default.Component);t.default=A,A.propTypes=M,A.defaultProps=R},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){if(!r.default.isMoment(e)||!r.default.isMoment(t))return!1;var n=(0,r.default)(e).add(1,"day");return(0,o.default)(n,t)};var r=a(n(31)),o=a(n(229));function a(e){return e&&e.__esModule?e:{default:e}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t,n,a){if(!r.default.isMoment(e))return{};for(var i={},c=a?e.clone():e.clone().subtract(1,"month"),s=0;s<(a?t:t+2);s+=1){var l=[],u=c.clone(),d=u.clone().startOf("month").hour(12),f=u.clone().endOf("month").hour(12),p=d.clone();if(n)for(var h=0;h<p.weekday();h+=1){var m=p.clone().subtract(h+1,"day");l.unshift(m)}for(;p<f;)l.push(p.clone()),p.add(1,"day");if(n&&0!==p.weekday())for(var y=p.weekday(),b=0;y<7;y+=1,b+=1){var g=p.clone().add(b,"day");l.push(g)}i[(0,o.default)(c)]=l,c=c.clone().add(1,"month")}return i};var r=a(n(31)),o=a(n(299));function a(e){return e&&e.__esModule?e:{default:e}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=j(n(112)),a=j(n(11)),i=j(n(2)),c=j(n(178)),s=n(104),l=j(n(31)),u=j(n(352)),d=j(n(232)),f=n(118),p=j(n(128)),h=j(n(229)),m=j(n(301)),y=j(n(464)),b=j(n(356)),g=j(n(297)),v=j(n(299)),O=j(n(231)),w=j(n(213)),_=j(n(249)),k=n(77),S=j(n(357));function j(e){return e&&e.__esModule?e:{default:e}}function E(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var C=(0,s.forbidExtraProps)({date:c.default.momentObj,onDateChange:i.default.func,focused:i.default.bool,onFocusChange:i.default.func,onClose:i.default.func,keepOpenOnDateSelect:i.default.bool,isOutsideRange:i.default.func,isDayBlocked:i.default.func,isDayHighlighted:i.default.func,renderMonthText:(0,s.mutuallyExclusiveProps)(i.default.func,"renderMonthText","renderMonthElement"),renderMonthElement:(0,s.mutuallyExclusiveProps)(i.default.func,"renderMonthText","renderMonthElement"),enableOutsideDays:i.default.bool,numberOfMonths:i.default.number,orientation:O.default,withPortal:i.default.bool,initialVisibleMonth:i.default.func,firstDayOfWeek:w.default,hideKeyboardShortcutsPanel:i.default.bool,daySize:s.nonNegativeInteger,verticalHeight:s.nonNegativeInteger,noBorder:i.default.bool,verticalBorderSpacing:s.nonNegativeInteger,transitionDuration:s.nonNegativeInteger,horizontalMonthPadding:s.nonNegativeInteger,navPrev:i.default.node,navNext:i.default.node,onPrevMonthClick:i.default.func,onNextMonthClick:i.default.func,onOutsideClick:i.default.func,renderCalendarDay:i.default.func,renderDayContents:i.default.func,renderCalendarInfo:i.default.func,calendarInfoPosition:_.default,onBlur:i.default.func,isFocused:i.default.bool,showKeyboardShortcuts:i.default.bool,monthFormat:i.default.string,weekDayFormat:i.default.string,phrases:i.default.shape((0,p.default)(f.DayPickerPhrases)),dayAriaLabelFormat:i.default.string,isRTL:i.default.bool}),D={date:void 0,onDateChange:function(){},focused:!1,onFocusChange:function(){},onClose:function(){},keepOpenOnDateSelect:!1,isOutsideRange:function(){},isDayBlocked:function(){},isDayHighlighted:function(){},renderMonthText:null,enableOutsideDays:!1,numberOfMonths:1,orientation:k.HORIZONTAL_ORIENTATION,withPortal:!1,hideKeyboardShortcutsPanel:!1,initialVisibleMonth:null,firstDayOfWeek:null,daySize:k.DAY_SIZE,verticalHeight:null,noBorder:!1,verticalBorderSpacing:void 0,transitionDuration:void 0,horizontalMonthPadding:13,navPrev:null,navNext:null,onPrevMonthClick:function(){},onNextMonthClick:function(){},onOutsideClick:function(){},renderCalendarDay:void 0,renderDayContents:null,renderCalendarInfo:null,renderMonthElement:null,calendarInfoPosition:k.INFO_POSITION_BOTTOM,onBlur:function(){},isFocused:!1,showKeyboardShortcuts:!1,monthFormat:"MMMM YYYY",weekDayFormat:"dd",phrases:f.DayPickerPhrases,dayAriaLabelFormat:void 0,isRTL:!1},P=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));n.isTouchDevice=!1,n.today=(0,l.default)(),n.modifiers={today:function(e){return n.isToday(e)},blocked:function(e){return n.isBlocked(e)},"blocked-calendar":function(t){return e.isDayBlocked(t)},"blocked-out-of-range":function(t){return e.isOutsideRange(t)},"highlighted-calendar":function(t){return e.isDayHighlighted(t)},valid:function(e){return!n.isBlocked(e)},hovered:function(e){return n.isHovered(e)},selected:function(e){return n.isSelected(e)},"first-day-of-week":function(e){return n.isFirstDayOfWeek(e)},"last-day-of-week":function(e){return n.isLastDayOfWeek(e)}};var r=n.getStateForNewMonth(e),o=r.currentMonth,a=r.visibleDays;return n.state={hoverDate:null,currentMonth:o,visibleDays:a},n.onDayMouseEnter=n.onDayMouseEnter.bind(n),n.onDayMouseLeave=n.onDayMouseLeave.bind(n),n.onDayClick=n.onDayClick.bind(n),n.onPrevMonthClick=n.onPrevMonthClick.bind(n),n.onNextMonthClick=n.onNextMonthClick.bind(n),n.onMonthChange=n.onMonthChange.bind(n),n.onYearChange=n.onYearChange.bind(n),n.getFirstFocusableDay=n.getFirstFocusableDay.bind(n),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),r(t,[{key:"componentDidMount",value:function(){this.isTouchDevice=(0,d.default)()}},{key:"componentWillReceiveProps",value:function(e){var t=this,n=e.date,r=e.focused,a=e.isOutsideRange,i=e.isDayBlocked,c=e.isDayHighlighted,s=e.initialVisibleMonth,d=e.numberOfMonths,f=e.enableOutsideDays,p=this.props,m=p.isOutsideRange,y=p.isDayBlocked,b=p.isDayHighlighted,g=p.numberOfMonths,v=p.enableOutsideDays,O=p.initialVisibleMonth,w=p.focused,_=p.date,k=this.state.visibleDays,S=!1,j=!1,E=!1;a!==m&&(this.modifiers["blocked-out-of-range"]=function(e){return a(e)},S=!0),i!==y&&(this.modifiers["blocked-calendar"]=function(e){return i(e)},j=!0),c!==b&&(this.modifiers["highlighted-calendar"]=function(e){return c(e)},E=!0);var C=S||j||E;if(d!==g||f!==v||s!==O&&!w&&r){var D=this.getStateForNewMonth(e),P=D.currentMonth;k=D.visibleDays,this.setState({currentMonth:P,visibleDays:k})}var x=r!==w,F={};n!==_&&(F=this.deleteModifier(F,_,"selected"),F=this.addModifier(F,n,"selected")),(x||C)&&(0,u.default)(k).forEach((function(e){Object.keys(e).forEach((function(e){var n=(0,l.default)(e);F=t.isBlocked(n)?t.addModifier(F,n,"blocked"):t.deleteModifier(F,n,"blocked"),(x||S)&&(F=a(n)?t.addModifier(F,n,"blocked-out-of-range"):t.deleteModifier(F,n,"blocked-out-of-range")),(x||j)&&(F=i(n)?t.addModifier(F,n,"blocked-calendar"):t.deleteModifier(F,n,"blocked-calendar")),(x||E)&&(F=c(n)?t.addModifier(F,n,"highlighted-calendar"):t.deleteModifier(F,n,"highlighted-calendar"))}))}));var T=(0,l.default)();(0,h.default)(this.today,T)||(F=this.deleteModifier(F,this.today,"today"),F=this.addModifier(F,T,"today"),this.today=T),Object.keys(F).length>0&&this.setState({visibleDays:(0,o.default)({},k,F)})}},{key:"componentWillUpdate",value:function(){this.today=(0,l.default)()}},{key:"onDayClick",value:function(e,t){if(t&&t.preventDefault(),!this.isBlocked(e)){var n=this.props,r=n.onDateChange,o=n.keepOpenOnDateSelect,a=n.onFocusChange,i=n.onClose;r(e),o||(a({focused:!1}),i({date:e}))}}},{key:"onDayMouseEnter",value:function(e){if(!this.isTouchDevice){var t=this.state,n=t.hoverDate,r=t.visibleDays,a=this.deleteModifier({},n,"hovered");a=this.addModifier(a,e,"hovered"),this.setState({hoverDate:e,visibleDays:(0,o.default)({},r,a)})}}},{key:"onDayMouseLeave",value:function(){var e=this.state,t=e.hoverDate,n=e.visibleDays;if(!this.isTouchDevice&&t){var r=this.deleteModifier({},t,"hovered");this.setState({hoverDate:null,visibleDays:(0,o.default)({},n,r)})}}},{key:"onPrevMonthClick",value:function(){var e=this.props,t=e.onPrevMonthClick,n=e.numberOfMonths,r=e.enableOutsideDays,a=this.state,i=a.currentMonth,c=a.visibleDays,s={};Object.keys(c).sort().slice(0,n+1).forEach((function(e){s[e]=c[e]}));var l=i.clone().subtract(1,"month"),u=(0,y.default)(l,1,r);this.setState({currentMonth:l,visibleDays:(0,o.default)({},s,this.getModifiers(u))},(function(){t(l.clone())}))}},{key:"onNextMonthClick",value:function(){var e=this.props,t=e.onNextMonthClick,n=e.numberOfMonths,r=e.enableOutsideDays,a=this.state,i=a.currentMonth,c=a.visibleDays,s={};Object.keys(c).sort().slice(1).forEach((function(e){s[e]=c[e]}));var l=i.clone().add(n,"month"),u=(0,y.default)(l,1,r),d=i.clone().add(1,"month");this.setState({currentMonth:d,visibleDays:(0,o.default)({},s,this.getModifiers(u))},(function(){t(d.clone())}))}},{key:"onMonthChange",value:function(e){var t=this.props,n=t.numberOfMonths,r=t.enableOutsideDays,o=t.orientation===k.VERTICAL_SCROLLABLE,a=(0,y.default)(e,n,r,o);this.setState({currentMonth:e.clone(),visibleDays:this.getModifiers(a)})}},{key:"onYearChange",value:function(e){var t=this.props,n=t.numberOfMonths,r=t.enableOutsideDays,o=t.orientation===k.VERTICAL_SCROLLABLE,a=(0,y.default)(e,n,r,o);this.setState({currentMonth:e.clone(),visibleDays:this.getModifiers(a)})}},{key:"getFirstFocusableDay",value:function(e){var t=this,n=this.props,r=n.date,o=n.numberOfMonths,a=e.clone().startOf("month");if(r&&(a=r.clone()),this.isBlocked(a)){for(var i=[],c=e.clone().add(o-1,"months").endOf("month"),s=a.clone();!(0,m.default)(s,c);)s=s.clone().add(1,"day"),i.push(s);var l=i.filter((function(e){return!t.isBlocked(e)&&(0,m.default)(e,a)}));if(l.length>0){var u=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],_n=!0,r=!1,o=void 0;try{for(var a,i=e[Symbol.iterator]();!(_n=(a=i.next()).done)&&(n.push(a.value),!t||n.length!==t);_n=!0);}catch(e){r=!0,o=e}finally{try{!_n&&i.return&&i.return()}finally{if(r)throw o}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")}(l,1);a=u[0]}}return a}},{key:"getModifiers",value:function(e){var t=this,n={};return Object.keys(e).forEach((function(r){n[r]={},e[r].forEach((function(e){n[r][(0,g.default)(e)]=t.getModifiersForDay(e)}))})),n}},{key:"getModifiersForDay",value:function(e){var t=this;return new Set(Object.keys(this.modifiers).filter((function(n){return t.modifiers[n](e)})))}},{key:"getStateForNewMonth",value:function(e){var t=this,n=e.initialVisibleMonth,r=e.date,o=e.numberOfMonths,a=e.enableOutsideDays,i=(n||(r?function(){return r}:function(){return t.today}))();return{currentMonth:i,visibleDays:this.getModifiers((0,y.default)(i,o,a))}}},{key:"addModifier",value:function(e,t,n){var r=this.props,a=r.numberOfMonths,i=r.enableOutsideDays,c=r.orientation,s=this.state,l=s.currentMonth,u=s.visibleDays,d=l,f=a;if(c===k.VERTICAL_SCROLLABLE?f=Object.keys(u).length:(d=d.clone().subtract(1,"month"),f+=2),!t||!(0,b.default)(t,d,f,i))return e;var p=(0,g.default)(t),h=(0,o.default)({},e);if(i)h=Object.keys(u).filter((function(e){return Object.keys(u[e]).indexOf(p)>-1})).reduce((function(t,r){var a=e[r]||u[r],i=new Set(a[p]);return i.add(n),(0,o.default)({},t,E({},r,(0,o.default)({},a,E({},p,i))))}),h);else{var m=(0,v.default)(t),y=e[m]||u[m],O=new Set(y[p]);O.add(n),h=(0,o.default)({},h,E({},m,(0,o.default)({},y,E({},p,O))))}return h}},{key:"deleteModifier",value:function(e,t,n){var r=this.props,a=r.numberOfMonths,i=r.enableOutsideDays,c=r.orientation,s=this.state,l=s.currentMonth,u=s.visibleDays,d=l,f=a;if(c===k.VERTICAL_SCROLLABLE?f=Object.keys(u).length:(d=d.clone().subtract(1,"month"),f+=2),!t||!(0,b.default)(t,d,f,i))return e;var p=(0,g.default)(t),h=(0,o.default)({},e);if(i)h=Object.keys(u).filter((function(e){return Object.keys(u[e]).indexOf(p)>-1})).reduce((function(t,r){var a=e[r]||u[r],i=new Set(a[p]);return i.delete(n),(0,o.default)({},t,E({},r,(0,o.default)({},a,E({},p,i))))}),h);else{var m=(0,v.default)(t),y=e[m]||u[m],O=new Set(y[p]);O.delete(n),h=(0,o.default)({},h,E({},m,(0,o.default)({},y,E({},p,O))))}return h}},{key:"isBlocked",value:function(e){var t=this.props,n=t.isDayBlocked,r=t.isOutsideRange;return n(e)||r(e)}},{key:"isHovered",value:function(e){var t=(this.state||{}).hoverDate;return(0,h.default)(e,t)}},{key:"isSelected",value:function(e){var t=this.props.date;return(0,h.default)(e,t)}},{key:"isToday",value:function(e){return(0,h.default)(e,this.today)}},{key:"isFirstDayOfWeek",value:function(e){var t=this.props.firstDayOfWeek;return e.day()===(t||l.default.localeData().firstDayOfWeek())}},{key:"isLastDayOfWeek",value:function(e){var t=this.props.firstDayOfWeek;return e.day()===((t||l.default.localeData().firstDayOfWeek())+6)%7}},{key:"render",value:function(){var e=this.props,t=e.numberOfMonths,n=e.orientation,r=e.monthFormat,o=e.renderMonthText,i=e.navPrev,c=e.navNext,s=e.onOutsideClick,l=e.withPortal,u=e.focused,d=e.enableOutsideDays,f=e.hideKeyboardShortcutsPanel,p=e.daySize,h=e.firstDayOfWeek,m=e.renderCalendarDay,y=e.renderDayContents,b=e.renderCalendarInfo,g=e.renderMonthElement,v=e.calendarInfoPosition,O=e.isFocused,w=e.isRTL,_=e.phrases,k=e.dayAriaLabelFormat,j=e.onBlur,E=e.showKeyboardShortcuts,C=e.weekDayFormat,D=e.verticalHeight,P=e.noBorder,x=e.transitionDuration,F=e.verticalBorderSpacing,T=e.horizontalMonthPadding,M=this.state,R=M.currentMonth,I=M.visibleDays;return a.default.createElement(S.default,{orientation:n,enableOutsideDays:d,modifiers:I,numberOfMonths:t,onDayClick:this.onDayClick,onDayMouseEnter:this.onDayMouseEnter,onDayMouseLeave:this.onDayMouseLeave,onPrevMonthClick:this.onPrevMonthClick,onNextMonthClick:this.onNextMonthClick,onMonthChange:this.onMonthChange,onYearChange:this.onYearChange,monthFormat:r,withPortal:l,hidden:!u,hideKeyboardShortcutsPanel:f,initialVisibleMonth:function(){return R},firstDayOfWeek:h,onOutsideClick:s,navPrev:i,navNext:c,renderMonthText:o,renderCalendarDay:m,renderDayContents:y,renderCalendarInfo:b,renderMonthElement:g,calendarInfoPosition:v,isFocused:O,getFirstFocusableDay:this.getFirstFocusableDay,onBlur:j,phrases:_,daySize:p,isRTL:w,showKeyboardShortcuts:E,weekDayFormat:C,dayAriaLabelFormat:k,verticalHeight:D,noBorder:P,transitionDuration:x,verticalBorderSpacing:F,horizontalMonthPadding:T})}}]),t}(a.default.Component);t.default=P,P.propTypes=C,P.defaultProps=D},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=h(n(2)),o=h(n(178)),a=n(104),i=n(118),c=h(n(128)),s=h(n(248)),l=h(n(448)),u=h(n(449)),d=h(n(233)),f=h(n(213)),p=h(n(249));function h(e){return e&&e.__esModule?e:{default:e}}t.default={date:o.default.momentObj,onDateChange:r.default.func.isRequired,focused:r.default.bool,onFocusChange:r.default.func.isRequired,id:r.default.string.isRequired,placeholder:r.default.string,disabled:r.default.bool,required:r.default.bool,readOnly:r.default.bool,screenReaderInputMessage:r.default.string,showClearDate:r.default.bool,customCloseIcon:r.default.node,showDefaultInputIcon:r.default.bool,inputIconPosition:s.default,customInputIcon:r.default.node,noBorder:r.default.bool,block:r.default.bool,small:r.default.bool,regular:r.default.bool,verticalSpacing:a.nonNegativeInteger,keepFocusOnInput:r.default.bool,renderMonthText:(0,a.mutuallyExclusiveProps)(r.default.func,"renderMonthText","renderMonthElement"),renderMonthElement:(0,a.mutuallyExclusiveProps)(r.default.func,"renderMonthText","renderMonthElement"),orientation:l.default,anchorDirection:u.default,openDirection:d.default,horizontalMargin:r.default.number,withPortal:r.default.bool,withFullScreenPortal:r.default.bool,appendToBody:r.default.bool,disableScroll:r.default.bool,initialVisibleMonth:r.default.func,firstDayOfWeek:f.default,numberOfMonths:r.default.number,keepOpenOnDateSelect:r.default.bool,reopenPickerOnClearDate:r.default.bool,renderCalendarInfo:r.default.func,calendarInfoPosition:p.default,hideKeyboardShortcutsPanel:r.default.bool,daySize:a.nonNegativeInteger,isRTL:r.default.bool,verticalHeight:a.nonNegativeInteger,transitionDuration:a.nonNegativeInteger,horizontalMonthPadding:a.nonNegativeInteger,navPrev:r.default.node,navNext:r.default.node,onPrevMonthClick:r.default.func,onNextMonthClick:r.default.func,onClose:r.default.func,renderCalendarDay:r.default.func,renderDayContents:r.default.func,enableOutsideDays:r.default.bool,isDayBlocked:r.default.func,isOutsideRange:r.default.func,isDayHighlighted:r.default.func,displayFormat:r.default.oneOfType([r.default.string,r.default.func]),monthFormat:r.default.string,weekDayFormat:r.default.string,phrases:r.default.shape((0,c.default)(i.SingleDatePickerPhrases)),dayAriaLabelFormat:r.default.string}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},o=b(n(112)),a=b(n(11)),i=b(n(2)),c=n(104),s=n(138),l=n(118),u=b(n(128)),d=b(n(455)),f=b(n(248)),p=b(n(252)),h=b(n(461)),m=b(n(233)),y=n(77);function b(e){return e&&e.__esModule?e:{default:e}}var g=(0,c.forbidExtraProps)((0,o.default)({},s.withStylesPropTypes,{id:i.default.string.isRequired,placeholder:i.default.string,displayValue:i.default.string,screenReaderMessage:i.default.string,focused:i.default.bool,isFocused:i.default.bool,disabled:i.default.bool,required:i.default.bool,readOnly:i.default.bool,openDirection:m.default,showCaret:i.default.bool,showClearDate:i.default.bool,customCloseIcon:i.default.node,showDefaultInputIcon:i.default.bool,inputIconPosition:f.default,customInputIcon:i.default.node,isRTL:i.default.bool,noBorder:i.default.bool,block:i.default.bool,small:i.default.bool,regular:i.default.bool,verticalSpacing:c.nonNegativeInteger,onChange:i.default.func,onClearDate:i.default.func,onFocus:i.default.func,onKeyDownShiftTab:i.default.func,onKeyDownTab:i.default.func,onKeyDownArrowDown:i.default.func,onKeyDownQuestionMark:i.default.func,phrases:i.default.shape((0,u.default)(l.SingleDatePickerInputPhrases))})),v={placeholder:"Select Date",displayValue:"",screenReaderMessage:"",focused:!1,isFocused:!1,disabled:!1,required:!1,readOnly:!1,openDirection:y.OPEN_DOWN,showCaret:!1,showClearDate:!1,showDefaultInputIcon:!1,inputIconPosition:y.ICON_BEFORE_POSITION,customCloseIcon:null,customInputIcon:null,isRTL:!1,noBorder:!1,block:!1,small:!1,regular:!1,verticalSpacing:void 0,onChange:function(){},onClearDate:function(){},onFocus:function(){},onKeyDownShiftTab:function(){},onKeyDownTab:function(){},onKeyDownArrowDown:function(){},onKeyDownQuestionMark:function(){},phrases:l.SingleDatePickerInputPhrases};function O(e){var t=e.id,n=e.placeholder,o=e.displayValue,i=e.focused,c=e.isFocused,l=e.disabled,u=e.required,f=e.readOnly,m=e.showCaret,b=e.showClearDate,g=e.showDefaultInputIcon,v=e.inputIconPosition,O=e.phrases,w=e.onClearDate,_=e.onChange,k=e.onFocus,S=e.onKeyDownShiftTab,j=e.onKeyDownTab,E=e.onKeyDownArrowDown,C=e.onKeyDownQuestionMark,D=e.screenReaderMessage,P=e.customCloseIcon,x=e.customInputIcon,F=e.openDirection,T=e.isRTL,M=e.noBorder,R=e.block,I=e.small,A=e.regular,N=e.verticalSpacing,L=e.styles,U=x||a.default.createElement(h.default,(0,s.css)(L.SingleDatePickerInput_calendarIcon_svg)),B=P||a.default.createElement(p.default,(0,s.css)(L.SingleDatePickerInput_clearDate_svg,I&&L.SingleDatePickerInput_clearDate_svg__small)),H=D||O.keyboardNavigationInstructions,q=(g||null!==x)&&a.default.createElement("button",r({},(0,s.css)(L.SingleDatePickerInput_calendarIcon),{type:"button",disabled:l,"aria-label":O.focusStartDate,onClick:k}),U);return a.default.createElement("div",(0,s.css)(L.SingleDatePickerInput,l&&L.SingleDatePickerInput__disabled,T&&L.SingleDatePickerInput__rtl,!M&&L.SingleDatePickerInput__withBorder,R&&L.SingleDatePickerInput__block,b&&L.SingleDatePickerInput__showClearDate),v===y.ICON_BEFORE_POSITION&&q,a.default.createElement(d.default,{id:t,placeholder:n,displayValue:o,screenReaderMessage:H,focused:i,isFocused:c,disabled:l,required:u,readOnly:f,showCaret:m,onChange:_,onFocus:k,onKeyDownShiftTab:S,onKeyDownTab:j,onKeyDownArrowDown:E,onKeyDownQuestionMark:C,openDirection:F,verticalSpacing:N,small:I,regular:A,block:R}),b&&a.default.createElement("button",r({},(0,s.css)(L.SingleDatePickerInput_clearDate,I&&L.SingleDatePickerInput_clearDate__small,!P&&L.SingleDatePickerInput_clearDate__default,!o&&L.SingleDatePickerInput_clearDate__hide),{type:"button","aria-label":O.clearDate,disabled:l,onMouseEnter:this&&this.onClearDateMouseEnter,onMouseLeave:this&&this.onClearDateMouseLeave,onClick:w}),B),v===y.ICON_AFTER_POSITION&&q)}O.propTypes=g,O.defaultProps=v,t.default=(0,s.withStyles)((function(e){var t=e.reactDates,n=t.border,r=t.color;return{SingleDatePickerInput:{display:"inline-block",backgroundColor:r.background},SingleDatePickerInput__withBorder:{borderColor:r.border,borderWidth:n.pickerInput.borderWidth,borderStyle:n.pickerInput.borderStyle,borderRadius:n.pickerInput.borderRadius},SingleDatePickerInput__rtl:{direction:"rtl"},SingleDatePickerInput__disabled:{backgroundColor:r.disabled},SingleDatePickerInput__block:{display:"block"},SingleDatePickerInput__showClearDate:{paddingRight:30},SingleDatePickerInput_clearDate:{background:"none",border:0,color:"inherit",font:"inherit",lineHeight:"normal",overflow:"visible",cursor:"pointer",padding:10,margin:"0 10px 0 5px",position:"absolute",right:0,top:"50%",transform:"translateY(-50%)"},SingleDatePickerInput_clearDate__default:{":focus":{background:r.core.border,borderRadius:"50%"},":hover":{background:r.core.border,borderRadius:"50%"}},SingleDatePickerInput_clearDate__small:{padding:6},SingleDatePickerInput_clearDate__hide:{visibility:"hidden"},SingleDatePickerInput_clearDate_svg:{fill:r.core.grayLight,height:12,width:15,verticalAlign:"middle"},SingleDatePickerInput_clearDate_svg__small:{height:9},SingleDatePickerInput_calendarIcon:{background:"none",border:0,color:"inherit",font:"inherit",lineHeight:"normal",overflow:"visible",cursor:"pointer",display:"inline-block",verticalAlign:"middle",padding:10,margin:"0 5px 0 10px"},SingleDatePickerInput_calendarIcon_svg:{fill:r.core.grayLight,height:15,width:14,verticalAlign:"middle"}}}))(O)},function(e,t){var n={utf8:{stringToBytes:function(e){return n.bin.stringToBytes(unescape(encodeURIComponent(e)))},bytesToString:function(e){return decodeURIComponent(escape(n.bin.bytesToString(e)))}},bin:{stringToBytes:function(e){for(var t=[],n=0;n<e.length;n++)t.push(255&e.charCodeAt(n));return t},bytesToString:function(e){for(var t=[],n=0;n<e.length;n++)t.push(String.fromCharCode(e[n]));return t.join("")}}};e.exports=n},function(e,t,n){"use strict";n(470),n(471)},function(e,t){},function(e,t){},function(e,t,n){"use strict";n(0),n(21),n(14),n(137)},function(e,t,n){"use strict";n(14),n(0),n(137)},function(e,t,n){"use strict";n(0),n(21),n(14),n(102)},function(e,t,n){"use strict";n(0),n(21),n(14),n(241)},function(e,t,n){"use strict";n(170).a},function(e,t,n){"use strict";n(0),n(21),n(14),n(170)},function(e,t,n){"use strict";n(14),n(170)},function(e,t,n){"use strict";n(7),n(14),n(170)},function(e,t,n){"use strict";n(0),n(21),n(14),n(204)},,,,,function(e,t){var n,r,o=e.exports={};function a(){throw new Error("setTimeout has not been defined")}function i(){throw new Error("clearTimeout has not been defined")}function c(e){if(n===setTimeout)return setTimeout(e,0);if((n===a||!n)&&setTimeout)return n=setTimeout,setTimeout(e,0);try{return n(e,0)}catch(t){try{return n.call(null,e,0)}catch(t){return n.call(this,e,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:a}catch(e){n=a}try{r="function"==typeof clearTimeout?clearTimeout:i}catch(e){r=i}}();var s,l=[],u=!1,d=-1;function f(){u&&s&&(u=!1,s.length?l=s.concat(l):d=-1,l.length&&p())}function p(){if(!u){var e=c(f);u=!0;for(var t=l.length;t;){for(s=l,l=[];++d<t;)s&&s[d].run();d=-1,t=l.length}s=null,u=!1,function(e){if(r===clearTimeout)return clearTimeout(e);if((r===i||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(e);try{r(e)}catch(t){try{return r.call(null,e)}catch(t){return r.call(this,e)}}}(e)}}function h(e,t){this.fun=e,this.array=t}function m(){}o.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];l.push(new h(e,t)),1!==l.length||u||c(p)},h.prototype.run=function(){this.fun.apply(null,this.array)},o.title="browser",o.browser=!0,o.env={},o.argv=[],o.version="",o.versions={},o.on=m,o.addListener=m,o.once=m,o.off=m,o.removeListener=m,o.removeAllListeners=m,o.emit=m,o.prependListener=m,o.prependOnceListener=m,o.listeners=function(e){return[]},o.binding=function(e){throw new Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(e){throw new Error("process.chdir is not supported")},o.umask=function(){return 0}},,,,,,function(e,t,n){var r=n(388);e.exports=function(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,r(e,t)},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,n){"use strict";var r=n(51),o=n(61),a=n(0),i=n(6),c=n.n(i),s=n(239);t.a=Object(a.forwardRef)((function(e,t){var n=e.className,i=Object(o.a)(e,["className"]),l=c()("components-flex__item",n);return Object(a.createElement)(s.c,Object(r.a)({},i,{className:l,ref:t}))}))},,,,,,,function(e,t,n){"use strict";var r=n(51),o=n(61),a=n(0),i=n(6),c=n.n(i),s=n(239);t.a=Object(a.forwardRef)((function(e,t){var n=e.className,i=Object(o.a)(e,["className"]),l=c()("components-flex__block",n);return Object(a.createElement)(s.a,Object(r.a)({},i,{className:l,ref:t}))}))},,,,function(e,t,n){"use strict";var r={};n.r(r),n.d(r,"getNotes",(function(){return p})),n.d(r,"getNotesError",(function(){return h})),n.d(r,"isNotesRequesting",(function(){return m}));var o={};n.r(o),n.d(o,"triggerNoteAction",(function(){return k})),n.d(o,"removeNote",(function(){return S})),n.d(o,"removeAllNotes",(function(){return j})),n.d(o,"batchUpdateNotes",(function(){return E})),n.d(o,"updateNote",(function(){return C})),n.d(o,"setNote",(function(){return D})),n.d(o,"setNoteIsUpdating",(function(){return P})),n.d(o,"setNotes",(function(){return x})),n.d(o,"setNotesQuery",(function(){return F})),n.d(o,"setError",(function(){return T})),n.d(o,"setIsRequesting",(function(){return M}));var a={};n.r(a),n.d(a,"getNotes",(function(){return I}));var i,c,s=n(14),l=n(36);function u(e){return[e]}function d(){var e={clear:function(){e.head=null}};return e}function f(e,t,n){var r;if(e.length!==t.length)return!1;for(r=n;r<e.length;r++)if(e[r]!==t[r])return!1;return!0}i={},c="undefined"!=typeof WeakMap;const p=function(e,t){var n,r;function o(){n=c?new WeakMap:d()}function a(){var n,o,a,i,c,s=arguments.length;for(i=new Array(s),a=0;a<s;a++)i[a]=arguments[a];for(c=t.apply(null,i),(n=r(c)).isUniqueByDependants||(n.lastDependants&&!f(c,n.lastDependants,0)&&n.clear(),n.lastDependants=c),o=n.head;o;){if(f(o.args,i,1))return o!==n.head&&(o.prev.next=o.next,o.next&&(o.next.prev=o.prev),o.next=n.head,o.prev=null,n.head.prev=o,n.head=o),o.val;o=o.next}return o={val:e.apply(null,i)},i[0]=null,o.args=i,n.head&&(n.head.prev=o,o.next=n.head),n.head=o,o.val}return t||(t=u),r=c?function(e){var t,r,o,a,c,s=n,l=!0;for(t=0;t<e.length;t++){if(!(c=r=e[t])||"object"!=typeof c){l=!1;break}s.has(r)?s=s.get(r):(o=new WeakMap,s.set(r,o),s=o)}return s.has(i)||((a=d()).isUniqueByDependants=l,s.set(i,a)),s.get(i)}:function(){return n},a.getDependants=t,a.clear=o,o(),a}((e,t)=>(e.noteQueries[JSON.stringify(t)]||[]).map(t=>e.notes[t]),(e,t)=>[e.noteQueries[JSON.stringify(t)],e.notes]),h=(e,t)=>e.errors[t]||!1,m=(e,t)=>e.requesting[t]||!1;var y=n(40),b="SET_ERROR",g="SET_NOTE",v="SET_NOTE_IS_UPDATING",O="SET_NOTES",w="SET_NOTES_QUERY",_="SET_IS_REQUESTING";function*k(e,t){yield M("triggerNoteAction",!0);const n=`${y.c}/admin/notes/${e}/action/${t}`;try{const t=yield Object(l.apiFetch)({path:n,method:"POST"});yield C(e,t),yield M("triggerNoteAction",!1)}catch(e){throw yield T("triggerNoteAction",e),yield M("triggerNoteAction",!1),new Error}}function*S(e){yield M("removeNote",!0),yield P(e,!0);try{const t=`${y.c}/admin/notes/delete/${e}`,n=yield Object(l.apiFetch)({path:t,method:"DELETE"});return yield D(e,n),yield M("removeNote",!1),n}catch(t){throw yield T("removeNote",t),yield M("removeNote",!1),yield P(e,!1),new Error}}function*j(){yield M("removeAllNotes",!0);try{const e=y.c+"/admin/notes/delete/all",t=yield Object(l.apiFetch)({path:e,method:"DELETE"});return yield x(t),yield M("removeAllNotes",!1),t}catch(e){throw yield T("removeAllNotes",e),yield M("removeAllNotes",!1),new Error}}function*E(e,t){yield M("batchUpdateNotes",!0);try{const n=y.c+"/admin/notes/update",r=yield Object(l.apiFetch)({path:n,method:"PUT",data:{noteIds:e,...t}});yield x(r),yield M("batchUpdateNotes",!1)}catch(e){throw yield T("updateNote",e),yield M("batchUpdateNotes",!1),new Error}}function*C(e,t){yield M("updateNote",!0),yield P(e,!0);try{const n=`${y.c}/admin/notes/${e}`,r=yield Object(l.apiFetch)({path:n,method:"PUT",data:t});yield D(e,r),yield M("updateNote",!1),yield P(e,!1)}catch(t){throw yield T("updateNote",t),yield M("updateNote",!1),yield P(e,!1),new Error}}function D(e,t){return{type:g,noteId:e,noteFields:t}}function P(e,t){return{type:v,noteId:e,isUpdating:t}}function x(e){return{type:O,notes:e}}function F(e,t){return{type:w,query:e,noteIds:t}}function T(e,t){return{type:b,error:t,selector:e}}function M(e,t){return{type:_,selector:e,isRequesting:t}}var R=n(23);function*I(e={}){const t=Object(R.addQueryArgs)(y.c+"/admin/notes",e);try{const n=yield Object(l.apiFetch)({path:t});yield x(n),yield F(e,n.map(e=>e.id))}catch(e){yield T("getNotes",e)}}Object(s.registerStore)("wc/admin/notes",{reducer:(e={errors:{},noteQueries:{},notes:{},requesting:{}},{error:t,isRequesting:n,isUpdating:r,noteFields:o,noteId:a,noteIds:i,notes:c,query:s,selector:l,type:u})=>{switch(u){case O:e={...e,notes:{...e.notes,...c.reduce((e,t)=>(e[t.id]=t,e),{})}};break;case w:e={...e,noteQueries:{...e.noteQueries,[JSON.stringify(s)]:i}};break;case b:e={...e,errors:{...e.errors,[l]:t}};break;case g:e={...e,notes:{...e.notes,[a]:o}};break;case v:e={...e,notes:{...e.notes,[a]:{...e.notes[a],isUpdating:r}}};break;case _:e={...e,requesting:{...e.requesting,[l]:n}}}return e},actions:o,controls:l.controls,selectors:r,resolvers:a})},,function(e,t,n){"use strict";var r={};n.r(r),n.d(r,"getReviews",(function(){return c})),n.d(r,"getReviewsTotalCount",(function(){return s})),n.d(r,"getReviewsError",(function(){return l}));var o={};n.r(o),n.d(o,"updateReviews",(function(){return b})),n.d(o,"updateReview",(function(){return g})),n.d(o,"deleteReview",(function(){return v})),n.d(o,"setReviewIsUpdating",(function(){return O})),n.d(o,"setReview",(function(){return w})),n.d(o,"setError",(function(){return _}));var a={};n.r(a),n.d(a,"getReviews",(function(){return S})),n.d(a,"getReviewsTotalCount",(function(){return j}));var i=n(14);const c=(e,t)=>{const n=JSON.stringify(t);return(e.reviews[n]&&e.reviews[n].data||[]).map(t=>e.data[t])},s=(e,t)=>{const n=JSON.stringify(t);return e.reviews[n]&&e.reviews[n].totalCount},l=(e,t)=>{const n=JSON.stringify(t);return e.errors[n]};var u=n(36),d=n(23),f="UPDATE_REVIEWS",p="SET_REVIEW",h="SET_ERROR",m="SET_REVIEW_IS_UPDATING",y=n(40);function b(e,t,n){return{type:f,reviews:t,query:e,totalCount:n}}function*g(e,t,n){yield O(e,!0);try{const r=Object(d.addQueryArgs)(`${y.c}/products/reviews/${e}`,n||{}),o=yield Object(u.apiFetch)({path:r,method:"PUT",data:t});yield w(e,o),yield O(e,!1)}catch(t){throw yield _("updateReview",t),yield O(e,!1),new Error}}function*v(e){yield O(e,!0);try{const t=`${y.c}/products/reviews/${e}`,n=yield Object(u.apiFetch)({path:t,method:"DELETE"});return yield w(e,n),yield O(e,!1),n}catch(t){throw yield _("deleteReview",t),yield O(e,!1),new Error}}function O(e,t){return{type:m,reviewId:e,isUpdating:t}}function w(e,t){return{type:p,reviewId:e,reviewData:t}}function _(e,t){return{type:h,query:e,error:t}}var k=n(115);function*S(e){try{const t=Object(d.addQueryArgs)(y.c+"/products/reviews",e),n=yield Object(k.b)({path:t,method:"GET"}),r=parseInt(n.headers.get("x-wp-total"),10);yield b(e,n.data,r)}catch(t){yield _(e,t)}}function*j(e){yield S(e)}Object(i.registerStore)("wc/admin/reviews",{reducer:(e={reviews:{},errors:{},data:{}},{type:t,query:n,reviews:r,reviewId:o,reviewData:a,totalCount:i,error:c,isUpdating:s})=>{switch(t){case f:const t=[],l=r.reduce((n,r)=>(t.push(r.id),n[r.id]={...e.data[r.id]||{},...r},n),{});return{...e,reviews:{...e.reviews,[JSON.stringify(n)]:{data:t,totalCount:i}},data:{...e.data,...l}};case p:return{...e,data:{...e.data,[o]:a}};case h:return{...e,errors:{...e.errors,[JSON.stringify(n)]:c}};case m:return{...e,data:{...e.data,[o]:{...e.data[o],isUpdating:s}}};default:return e}},actions:o,controls:k.a,selectors:r,resolvers:a})},function(e,t,n){"use strict";var r={};n.r(r),n.d(r,"getMenuItems",(function(){return u})),n.d(r,"getFavorites",(function(){return d})),n.d(r,"isNavigationRequesting",(function(){return f})),n.d(r,"getPersistedQuery",(function(){return p}));var o={};n.r(o),n.d(o,"setMenuItems",(function(){return x})),n.d(o,"addMenuItems",(function(){return F})),n.d(o,"getFavoritesFailure",(function(){return T})),n.d(o,"getFavoritesRequest",(function(){return M})),n.d(o,"getFavoritesSuccess",(function(){return R})),n.d(o,"addFavoriteRequest",(function(){return I})),n.d(o,"addFavoriteFailure",(function(){return A})),n.d(o,"addFavoriteSuccess",(function(){return N})),n.d(o,"removeFavoriteRequest",(function(){return L})),n.d(o,"removeFavoriteFailure",(function(){return U})),n.d(o,"removeFavoriteSuccess",(function(){return B})),n.d(o,"onLoad",(function(){return H})),n.d(o,"onHistoryChange",(function(){return q})),n.d(o,"addFavorite",(function(){return z})),n.d(o,"removeFavorite",(function(){return V}));var a={};n.r(a),n.d(a,"getFavorites",(function(){return K}));var i=n(36),c=n(14),s=n(204),l=n(55);const u=e=>Object(l.applyFilters)("woocommerce_navigation_menu_items",e.menuItems),d=e=>e.favorites||[],f=(e,t)=>e.requesting[t]||!1,p=e=>e.persistedQuery||{};var h=n(15),m=n.n(h),y=n(65),b="ADD_MENU_ITEMS",g="SET_MENU_ITEMS",v="ON_HISTORY_CHANGE",O="ADD_FAVORITE_FAILURE",w="ADD_FAVORITE_REQUEST",_="ADD_FAVORITE_SUCCESS",k="GET_FAVORITES_FAILURE",S="GET_FAVORITES_REQUEST",j="GET_FAVORITES_SUCCESS",E="REMOVE_FAVORITE_FAILURE",C="REMOVE_FAVORITE_REQUEST",D="REMOVE_FAVORITE_SUCCESS",P=n(40);function x(e){return{type:g,menuItems:e}}function F(e){return{type:b,menuItems:e}}function T(e){return{type:k,error:e}}function M(e){return{type:S,favorites:e}}function R(e){return{type:j,favorites:e}}function I(e){return{type:w,favorite:e}}function A(e,t){return{type:O,favorite:e,error:t}}function N(e){return{type:_,favorite:e}}function L(e){return{type:C,favorite:e}}function U(e,t){return{type:E,favorite:e,error:t}}function B(e,t){return{type:D,favorite:e,error:t}}function*H(){yield q()}function*q(){const e=Object(y.h)();if(!Object.keys(e).length)return null;yield{type:v,persistedQuery:e}}function*z(e){yield I(e);try{const t=yield m()({path:P.e+"/navigation/favorites/me",method:"POST",data:{item_id:e}});if(t)return yield N(e),t;throw new Error}catch(t){throw yield A(e,t),new Error}}function*V(e){yield L(e);try{const t=yield m()({path:P.e+"/navigation/favorites/me",method:"DELETE",data:{item_id:e}});if(t)return yield B(e),t;throw new Error}catch(t){throw yield U(e,t),new Error}}function*K(){yield M();try{const e=yield Object(i.apiFetch)({path:P.e+"/navigation/favorites/me"});if(e)return void(yield R(e));throw new Error}catch(e){throw yield T(e),new Error}}Object(c.registerStore)(s.a,{reducer:(e={error:null,menuItems:[],favorites:[],requesting:{},persistedQuery:{}},{type:t,error:n,favorite:r,favorites:o,menuItems:a,persistedQuery:i})=>{switch(t){case g:e={...e,menuItems:a};break;case b:e={...e,menuItems:[...e.menuItems,...a]};break;case v:e={...e,persistedQuery:i};break;case k:e={...e,requesting:{...e.requesting,getFavorites:!1}};break;case S:e={...e,requesting:{...e.requesting,getFavorites:!0}};break;case j:e={...e,favorites:o,requesting:{...e.requesting,getFavorites:!1}};break;case O:e={...e,error:n,requesting:{...e.requesting,addFavorite:!1}};break;case w:e={...e,requesting:{...e.requesting,addFavorite:!0}};break;case _:const t=e.favorites.includes(r)?e.favorites:[...e.favorites,r];e={...e,favorites:t,menuItems:e.menuItems.map(e=>e.id===r?{...e,menuId:"favorites"}:e),requesting:{...e.requesting,addFavorite:!1}};break;case E:e={...e,requesting:{...e.requesting,error:n,removeFavorite:!1}};break;case C:e={...e,requesting:{...e.requesting,removeFavorite:!0}};break;case D:const c=e.favorites.filter(e=>e!==r);e={...e,favorites:c,menuItems:e.menuItems.map(e=>e.id===r?{...e,menuId:"plugins"}:e),requesting:{...e.requesting,removeFavorite:!1}}}return e},actions:o,controls:i.controls,resolvers:a,selectors:r}),(async()=>{const{onLoad:e,onHistoryChange:t}=Object(c.dispatch)(s.a);await e(),Object(y.a)(async()=>{setTimeout(async()=>{await t()},0)})})(),s.a},function(e,t,n){"use strict";var r={};n.r(r),n.d(r,"getPaymentGatewaysRequest",(function(){return l})),n.d(r,"getPaymentGatewaysSuccess",(function(){return u})),n.d(r,"getPaymentGatewaysError",(function(){return d})),n.d(r,"getPaymentGatewayRequest",(function(){return f})),n.d(r,"getPaymentGatewayError",(function(){return p})),n.d(r,"getPaymentGatewaySuccess",(function(){return h})),n.d(r,"updatePaymentGatewaySuccess",(function(){return m})),n.d(r,"updatePaymentGatewayRequest",(function(){return y})),n.d(r,"updatePaymentGatewayError",(function(){return b})),n.d(r,"updatePaymentGateway",(function(){return g}));var o={};n.r(o),n.d(o,"getPaymentGateways",(function(){return O})),n.d(o,"getPaymentGateway",(function(){return w}));var a={};n.r(a),n.d(a,"getPaymentGateway",(function(){return _})),n.d(a,"getPaymentGateways",(function(){return k})),n.d(a,"getPaymentGatewayError",(function(){return S})),n.d(a,"isPaymentGatewayUpdating",(function(){return j}));var i=n(14),c=n(36);let s;!function(e){e.GET_PAYMENT_GATEWAYS_REQUEST="GET_PAYMENT_GATEWAYS_REQUEST",e.GET_PAYMENT_GATEWAYS_SUCCESS="GET_PAYMENT_GATEWAYS_SUCCESS",e.GET_PAYMENT_GATEWAYS_ERROR="GET_PAYMENT_GATEWAYS_ERROR",e.UPDATE_PAYMENT_GATEWAY_REQUEST="UPDATE_PAYMENT_GATEWAY_REQUEST",e.UPDATE_PAYMENT_GATEWAY_SUCCESS="UPDATE_PAYMENT_GATEWAY_SUCCESS",e.UPDATE_PAYMENT_GATEWAY_ERROR="UPDATE_PAYMENT_GATEWAY_ERROR",e.GET_PAYMENT_GATEWAY_REQUEST="GET_PAYMENT_GATEWAY_REQUEST",e.GET_PAYMENT_GATEWAY_SUCCESS="GET_PAYMENT_GATEWAY_SUCCESS",e.GET_PAYMENT_GATEWAY_ERROR="GET_PAYMENT_GATEWAY_ERROR"}(s||(s={}));function l(){return{type:s.GET_PAYMENT_GATEWAYS_REQUEST}}function u(e){return{type:s.GET_PAYMENT_GATEWAYS_SUCCESS,paymentGateways:e}}function d(e){return{type:s.GET_PAYMENT_GATEWAYS_ERROR,error:e}}function f(){return{type:s.GET_PAYMENT_GATEWAY_REQUEST}}function p(e){return{type:s.GET_PAYMENT_GATEWAY_ERROR,error:e}}function h(e){return{type:s.GET_PAYMENT_GATEWAY_SUCCESS,paymentGateway:e}}function m(e){return{type:s.UPDATE_PAYMENT_GATEWAY_SUCCESS,paymentGateway:e}}function y(){return{type:s.UPDATE_PAYMENT_GATEWAY_REQUEST}}function b(e){return{type:s.UPDATE_PAYMENT_GATEWAY_ERROR,error:e}}function*g(e,t){try{yield y();const n=yield Object(c.apiFetch)({method:"PUT",path:"wc/v3/payment_gateways/"+e,body:JSON.stringify(t)});if(n&&n.id===e)return yield m(n),n}catch(e){throw yield b(e),e}}const v=i.controls&&i.controls.dispatch?i.controls.dispatch:c.dispatch;function*O(){yield l();try{const e=yield Object(c.apiFetch)({path:"wc/v3/payment_gateways"});yield u(e);for(let t=0;t<e.length;t++)yield v("wc/payment-gateways","finishResolution","getPaymentGateway",[e[t].id])}catch(e){yield d(e)}}function*w(e){yield f();try{const t=yield Object(c.apiFetch)({path:"wc/v3/payment_gateways/"+e});if(t&&t.id)return yield h(t),t}catch(e){yield p(e)}}function _(e,t){return e.paymentGateways.find(e=>e.id===t)}function k(e){return e.paymentGateways}function S(e,t){return e.errors[t]||null}function j(e){return e.isUpdating||!1}Object(i.registerStore)("wc/payment-gateways",{actions:r,selectors:a,resolvers:o,controls:c.controls,reducer:(e={paymentGateways:[],isUpdating:!1,errors:{}},t)=>{if(t&&"type"in t)switch(t.type){case s.GET_PAYMENT_GATEWAYS_REQUEST:case s.GET_PAYMENT_GATEWAY_REQUEST:return e;case s.GET_PAYMENT_GATEWAYS_SUCCESS:return{...e,paymentGateways:t.paymentGateways};case s.GET_PAYMENT_GATEWAYS_ERROR:return{...e,errors:{...e.errors,getPaymentGateways:t.error}};case s.GET_PAYMENT_GATEWAY_ERROR:return{...e,errors:{...e.errors,getPaymentGateway:t.error}};case s.UPDATE_PAYMENT_GATEWAY_REQUEST:return{...e,isUpdating:!0};case s.UPDATE_PAYMENT_GATEWAY_SUCCESS:case s.GET_PAYMENT_GATEWAY_SUCCESS:return function(e,t){const n=e.paymentGateways.findIndex(e=>e.id===t.id);return-1===n?{...e,paymentGateways:[...e.paymentGateways,t],isUpdating:!1}:{...e,paymentGateways:[...e.paymentGateways.slice(0,n),t,...e.paymentGateways.slice(n+1)],isUpdating:!1}}(e,t.paymentGateway);case s.UPDATE_PAYMENT_GATEWAY_ERROR:return{...e,errors:{...e.errors,updatePaymentGateway:t.error},isUpdating:!1}}return e}})},function(e,t,n){"use strict";var r={};n.r(r),n.d(r,"isExportRequesting",(function(){return u})),n.d(r,"getExportId",(function(){return d})),n.d(r,"getError",(function(){return f}));var o={};n.r(o),n.d(o,"setExportId",(function(){return g})),n.d(o,"setIsRequesting",(function(){return v})),n.d(o,"setError",(function(){return O})),n.d(o,"startExport",(function(){return w}));var a=n(14),i=n(313),c=n.n(i),s=n(82);const l=e=>c()(Object(s.a)("export",e)),u=(e,t,n)=>Boolean(e.requesting[t]&&e.requesting[t][l(n)]),d=(e,t,n)=>e.exportIds[t]&&e.exportIds[t][l(n)],f=(e,t,n)=>e.errors[t]&&e.errors[t][l(n)];var p=n(115),h="SET_EXPORT_ID",m="SET_ERROR",y="SET_IS_REQUESTING",b=n(40);function g(e,t,n){return{type:h,exportType:e,exportArgs:t,exportId:n}}function v(e,t,n){return{type:y,selector:e,selectorArgs:t,isRequesting:n}}function O(e,t,n){return{type:m,selector:e,selectorArgs:t,error:n}}function*w(e,t){yield v("startExport",{type:e,args:t},!0);try{const n=yield Object(p.b)({path:`${b.c}/reports/${e}/export`,method:"POST",data:{report_args:t,email:!0}});yield v("startExport",{type:e,args:t},!1);const{export_id:r,message:o}=n.data;if(!r)throw new Error(o);return yield g(e,t,r),n.data}catch(n){throw yield O("startExport",{type:e,args:t},n.message),yield v("startExport",{type:e,args:t},!1),n}}Object(a.registerStore)("wc/admin/export",{reducer:(e={errors:{},requesting:{},exportMeta:{},exportIds:{}},{error:t,exportArgs:n,exportId:r,exportType:o,isRequesting:a,selector:i,selectorArgs:c,type:s})=>{switch(s){case y:return{...e,requesting:{...e.requesting,[i]:{...e.requesting[i],[l(c)]:a}}};case h:return{...e,exportMeta:{...e.exportMeta,[r]:{exportType:o,exportArgs:n}},exportIds:{...e.exportIds,[o]:{...e.exportIds[o],[l({type:o,args:n})]:r}}};case m:return{...e,errors:{...e.errors,[i]:{...e.errors[i],[l(c)]:t}}};default:return e}},actions:o,controls:p.a,selectors:r})},function(e,t,n){"use strict";var r={};n.r(r),n.d(r,"getImportStarted",(function(){return s})),n.d(r,"getFormSettings",(function(){return l})),n.d(r,"getImportStatus",(function(){return u})),n.d(r,"getImportTotals",(function(){return d})),n.d(r,"getImportError",(function(){return f}));var o={};n.r(o),n.d(o,"setImportStarted",(function(){return O})),n.d(o,"setImportPeriod",(function(){return w})),n.d(o,"setSkipPrevious",(function(){return _})),n.d(o,"setImportStatus",(function(){return k})),n.d(o,"setImportTotals",(function(){return S})),n.d(o,"setImportError",(function(){return j})),n.d(o,"updateImportation",(function(){return E}));var a={};n.r(a),n.d(a,"getImportStatus",(function(){return x})),n.d(a,"getImportTotals",(function(){return F}));var i=n(14),c=n(36);const s=e=>{const{activeImport:t,lastImportStartTimestamp:n}=e;return{activeImport:t,lastImportStartTimestamp:n}||{}},l=e=>{const{period:t,skipPrevious:n}=e;return{period:t,skipPrevious:n}||{}},u=(e,t)=>{const n=JSON.stringify(t);return e.importStatus[n]||{}},d=(e,t)=>{const{importTotals:n,lastImportStartTimestamp:r}=e;return{...n[JSON.stringify(t)],lastImportStartTimestamp:r}||{}},f=(e,t)=>{const n=JSON.stringify(t);return e.errors[n]||!1};var p="SET_IMPORT_DATE",h="SET_IMPORT_ERROR",m="SET_IMPORT_PERIOD",y="SET_IMPORT_STARTED",b="SET_IMPORT_STATUS",g="SET_IMPORT_TOTALS",v="SET_SKIP_IMPORTED";function O(e){return{type:y,activeImport:e}}function w(e,t){return t?{type:p,date:e}:{type:m,date:e}}function _(e){return{type:v,skipPrevious:e}}function k(e,t){return{type:b,importStatus:t,query:e}}function S(e,t){return{type:g,importTotals:t,query:e}}function j(e,t){return{type:h,error:t,query:e}}function*E(e,t=!1){yield O(t);try{return yield Object(c.apiFetch)({path:e,method:"POST"})}catch(t){throw yield j(e,t),t}}var C=n(23),D=n(7),P=n(40);function*x(e){try{const t=Object(C.addQueryArgs)(P.c+"/reports/import/status",Object(D.omit)(e,["timestamp"])),n=yield Object(c.apiFetch)({path:t});yield k(e,n)}catch(t){yield j(e,t)}}function*F(e){try{const t=Object(C.addQueryArgs)(P.c+"/reports/import/totals",e),n=yield Object(c.apiFetch)({path:t});yield S(e,n)}catch(t){yield j(e,t)}}var T=n(1),M=n(31),R=n.n(M);Object(i.registerStore)("wc/admin/import",{reducer:(e={activeImport:!1,importStatus:{},importTotals:{},errors:{},lastImportStartTimestamp:0,period:{date:R()().format(Object(T.__)("MM/DD/YYYY",'woocommerce')),label:"all"},skipPrevious:!0},{type:t,query:n,importStatus:r,importTotals:o,activeImport:a,date:i,error:c,skipPrevious:s})=>{switch(t){case y:e={...e,activeImport:a,lastImportStartTimestamp:a?Date.now():e.lastImportStartTimestamp};break;case m:e={...e,period:{...e.period,label:i},activeImport:!1};break;case p:e={...e,period:{date:i,label:"custom"},activeImport:!1};break;case v:e={...e,skipPrevious:s,activeImport:!1};break;case b:e={...e,importStatus:{...e.importStatus,[JSON.stringify(n)]:r},errors:{...e.errors,[JSON.stringify(n)]:!1}};break;case g:e={...e,importTotals:{...e.importTotals,[JSON.stringify(n)]:o}};break;case h:e={...e,errors:{...e.errors,[JSON.stringify(n)]:c}}}return e},actions:o,controls:c.controls,selectors:r,resolvers:a})},,function(e,t,n){"use strict";var r={};n.r(r),n.d(r,"getSettingsGroupNames",(function(){return u})),n.d(r,"getSettings",(function(){return d})),n.d(r,"getDirtyKeys",(function(){return f})),n.d(r,"getIsDirty",(function(){return p})),n.d(r,"getSettingsForGroup",(function(){return h})),n.d(r,"isUpdateSettingsRequesting",(function(){return m})),n.d(r,"getSetting",(function(){return y})),n.d(r,"getLastSettingsErrorForGroup",(function(){return b})),n.d(r,"getSettingsError",(function(){return g}));var o={};n.r(o),n.d(o,"updateSettingsForGroup",(function(){return D})),n.d(o,"updateErrorForGroup",(function(){return P})),n.d(o,"setIsRequesting",(function(){return x})),n.d(o,"clearIsDirty",(function(){return F})),n.d(o,"updateAndPersistSettingsForGroup",(function(){return T})),n.d(o,"persistSettingsForGroup",(function(){return M})),n.d(o,"clearSettings",(function(){return R}));var a={};n.r(a),n.d(a,"getSettings",(function(){return A})),n.d(a,"getSettingsForGroup",(function(){return N}));var i=n(14),c=n(36),s=n(137),l=n(82);const u=e=>[...new Set(Object.keys(e).map(e=>Object(l.b)(e)))],d=(e,t)=>{const n={},r=e[t]&&e[t].data||[];return 0===r.length||r.forEach(r=>{n[r]=e[Object(l.a)(t,r)].data}),n},f=(e,t)=>e[t].dirty||[],p=(e,t,n=[])=>{const r=f(e,t);return 0!==r.length&&n.some(e=>r.includes(e))},h=(e,t,n)=>{const r=d(e,t);return n.reduce((e,t)=>(e[t]=r[t]||{},e),{})},m=(e,t)=>e[t]&&Boolean(e[t].isRequesting);function y(e,t,n,r=!1,o=(e=>e)){const a=Object(l.a)(t,n);return o(e[a]&&e[a].data||r,r)}const b=(e,t)=>{const n=e[t].data;return 0===n.length?e[t].error:[...n].pop().error},g=(e,t,n)=>n?e[Object(l.a)(t,n)].error||!1:e[t]&&e[t].error||!1;var v=n(1),O=n(7),w=n(40),_="UPDATE_SETTINGS_FOR_GROUP",k="UPDATE_ERROR_FOR_GROUP",S="CLEAR_SETTINGS",j="SET_IS_REQUESTING",E="CLEAR_IS_DIRTY";const C=i.controls&&i.controls.resolveSelect?i.controls.resolveSelect:c.select;function D(e,t,n=new Date){return{type:_,group:e,data:t,time:n}}function P(e,t,n,r=new Date){return{type:k,group:e,data:t,error:n,time:r}}function x(e,t){return{type:j,group:e,isRequesting:t}}function F(e){return{type:E,group:e}}function*T(e,t){yield D(e,t),yield*M(e)}function*M(e){yield x(e,!0);const t=yield C(s.a,"getDirtyKeys",e);if(0===t.length)return void(yield x(e,!1));const n=yield C(s.a,"getSettingsForGroup",e,t),r=`${w.c}/settings/${e}/batch`,o=t.reduce((e,t)=>{const r=Object.keys(n[t]).map(e=>({id:e,value:n[t][e]}));return Object(O.concat)(e,r)},[]);try{const t=yield Object(c.apiFetch)({path:r,method:"POST",data:{update:o}});if(yield x(e,!1),!t)throw new Error(Object(v.__)("There was a problem updating your settings.",'woocommerce'));yield F(e)}catch(t){throw yield P(e,null,t),yield x(e,!1),t}}function R(){return{type:S}}const I=i.controls&&i.controls.dispatch?i.controls.dispatch:c.dispatch;function*A(e){yield I(s.a,"setIsRequesting",e,!0);try{const t=w.c+"/settings/"+e;return D(e,{[e]:(yield Object(c.apiFetch)({path:t,method:"GET"})).reduce((e,t)=>(e[t.id]=t.value,e),{})})}catch(t){return P(e,null,t.message)}}function*N(e){return A(e)}const L=(e,{group:t,groupIds:n,data:r,time:o,error:a})=>(n.forEach(n=>{e[Object(l.a)(t,n)]={data:r[n],lastReceived:o,error:a}}),e);Object(i.registerStore)(s.a,{reducer:(e={},{type:t,group:n,data:r,error:o,time:a,isRequesting:i})=>{const c={};switch(t){case j:e={...e,[n]:{...e[n],isRequesting:i}};break;case E:e={...e,[n]:{...e[n],dirty:[]}};break;case _:case k:const t=r?Object.keys(r):[];e=null===r?{...e,[n]:{data:e[n]?e[n].data:[],error:o,lastReceived:a}}:{...e,[n]:{data:e[n]&&e[n].data?[...e[n].data,...t]:t,error:o,lastReceived:a,isRequesting:!1,dirty:e[n]&&e[n].dirty?Object(O.union)(e[n].dirty,t):t},...L(c,{group:n,groupIds:t,data:r,time:a,error:o})};break;case S:e={}}return e},actions:o,controls:c.controls,selectors:r,resolvers:a}),s.a},function(e,t,n){"use strict";n.d(t,"a",(function(){return Z}));var r={};n.r(r),n.d(r,"getActivePlugins",(function(){return l})),n.d(r,"getInstalledPlugins",(function(){return u})),n.d(r,"isPluginsRequesting",(function(){return d})),n.d(r,"getPluginsError",(function(){return f})),n.d(r,"isJetpackConnected",(function(){return p})),n.d(r,"getJetpackConnectUrl",(function(){return h})),n.d(r,"getPluginInstallState",(function(){return m})),n.d(r,"getPaypalOnboardingStatus",(function(){return y})),n.d(r,"getRecommendedPlugins",(function(){return b}));var o={};n.r(o),n.d(o,"formatErrors",(function(){return k})),n.d(o,"updateActivePlugins",(function(){return j})),n.d(o,"updateInstalledPlugins",(function(){return E})),n.d(o,"setIsRequesting",(function(){return C})),n.d(o,"setError",(function(){return D})),n.d(o,"updateIsJetpackConnected",(function(){return P})),n.d(o,"updateJetpackConnectUrl",(function(){return x})),n.d(o,"installPlugins",(function(){return F})),n.d(o,"activatePlugins",(function(){return T})),n.d(o,"installAndActivatePlugins",(function(){return M})),n.d(o,"createErrorNotice",(function(){return R})),n.d(o,"connectToJetpack",(function(){return I})),n.d(o,"installJetpackAndConnect",(function(){return A})),n.d(o,"connectToJetpackWithFailureRedirect",(function(){return N})),n.d(o,"setPaypalOnboardingStatus",(function(){return L})),n.d(o,"setRecommendedPlugins",(function(){return U}));var a={};n.r(a),n.d(a,"getActivePlugins",(function(){return z})),n.d(a,"getInstalledPlugins",(function(){return V})),n.d(a,"isJetpackConnected",(function(){return K})),n.d(a,"getJetpackConnectUrl",(function(){return W})),n.d(a,"getPaypalOnboardingStatus",(function(){return Y})),n.d(a,"getRecommendedPlugins",(function(){return Q}));var i=n(14),c=n(36),s=n(102);const l=e=>e.active||[],u=e=>e.installed||[],d=(e,t)=>e.requesting[t]||!1,f=(e,t)=>e.errors[t]||!1,p=e=>e.jetpackConnection,h=(e,t)=>e.jetpackConnectUrls[t.redirect_url],m=(e,t)=>e.active.includes(t)?"activated":e.installed.includes(t)?"installed":"unavailable",y=e=>e.paypalOnboardingStatus,b=(e,t)=>e.recommended[t];var g=n(1);let v;!function(e){e.UPDATE_ACTIVE_PLUGINS="UPDATE_ACTIVE_PLUGINS",e.UPDATE_INSTALLED_PLUGINS="UPDATE_INSTALLED_PLUGINS",e.SET_IS_REQUESTING="SET_IS_REQUESTING",e.SET_ERROR="SET_ERROR",e.UPDATE_JETPACK_CONNECTION="UPDATE_JETPACK_CONNECTION",e.UPDATE_JETPACK_CONNECT_URL="UPDATE_JETPACK_CONNECT_URL",e.SET_PAYPAL_ONBOARDING_STATUS="SET_PAYPAL_ONBOARDING_STATUS",e.SET_RECOMMENDED_PLUGINS="SET_RECOMMENDED_PLUGINS"}(v||(v={}));var O=n(40);const w=i.controls&&i.controls.dispatch?i.controls.dispatch:c.dispatch,_=i.controls&&i.controls.resolveSelect?i.controls.resolveSelect:c.select;function k(e){return void 0===e.errors?"string"==typeof e?e:e.message:(Object.keys(e.errors).forEach(t=>{e.errors[t]=e.errors[t].map(e=>s.c[t]?e.replace(`\`${t}\``,s.c[t]):e)}),"")}const S=(e,t="install")=>Object(g.sprintf)(
/* translators: %(actionType): install or activate (the plugin). %(pluginName): a plugin slug (e.g. woocommerce-services). %(error): a single error message or in plural a comma separated error message list.*/
Object(g._n)("Could not %(actionType)s %(pluginName)s plugin, %(error)s","Could not %(actionType)s the following plugins: %(pluginName)s with these Errors: %(error)s",Object.keys(e).length||1,'woocommerce'),{actionType:t,pluginName:Object.keys(e).join(", "),error:Object.values(e).join(", \n")});function j(e,t=!1){return{type:v.UPDATE_ACTIVE_PLUGINS,active:e,replace:t}}function E(e,t=!1){return{type:v.UPDATE_INSTALLED_PLUGINS,installed:e,replace:t}}function C(e,t){return{type:v.SET_IS_REQUESTING,selector:e,isRequesting:t}}function D(e,t){return{type:v.SET_ERROR,selector:e,error:t}}function P(e){return{type:v.UPDATE_JETPACK_CONNECTION,jetpackConnection:e}}function x(e,t){return{type:v.UPDATE_JETPACK_CONNECT_URL,jetpackConnectUrl:t,redirectUrl:e}}function*F(e){yield C("installPlugins",!0);try{const t=yield Object(c.apiFetch)({path:O.e+"/plugins/install",method:"POST",data:{plugins:e.join(",")}});if(t.data.installed.length&&(yield E(t.data.installed)),Object.keys(t.errors.errors).length)throw t.errors.errors;return yield C("installPlugins",!1),t}catch(t){throw 1!==e.length||t[e[0]]||(t={[e[0]]:t.message}),yield D("installPlugins",t),new Error(S(t))}}function*T(e){yield C("activatePlugins",!0);try{const t=yield Object(c.apiFetch)({path:O.e+"/plugins/activate",method:"POST",data:{plugins:e.join(",")}});if(t.data.activated.length&&(yield j(t.data.activated)),Object.keys(t.errors.errors).length)throw t.errors.errors;return yield C("activatePlugins",!1),t}catch(t){throw 1!==e.length||t[e[0]]||(t={[e[0]]:t.message}),yield D("activatePlugins",t),new Error(S(t,"activate"))}}function*M(e){try{return yield w(s.b,"installPlugins",e),yield w(s.b,"activatePlugins",e)}catch(e){throw e}}const R=e=>w("core/notices","createNotice","error",e);function*I(e){const t=yield _(s.b,"getJetpackConnectUrl",{redirect_url:e("admin.php?page=wc-admin")}),n=yield _(s.b,"getPluginsError","getJetpackConnectUrl");if(n)throw new Error(n);return t}function*A(e,t){try{yield w(s.b,"installPlugins",["jetpack"]),yield w(s.b,"activatePlugins",["jetpack"]);const e=yield w(s.b,"connectToJetpack",t);window.location.href=e}catch(t){yield e(t.message)}}function*N(e,t,n){try{const e=yield w(s.b,"connectToJetpack",n);window.location.href=e}catch(n){yield t(n.message),window.location.href=e}}function L(e){return{type:v.SET_PAYPAL_ONBOARDING_STATUS,paypalOnboardingStatus:e}}function U(e,t){return{type:v.SET_RECOMMENDED_PLUGINS,recommendedType:e,plugins:t}}var B=n(23),H=n(310);const q=i.controls&&i.controls.resolveSelect?i.controls.resolveSelect:c.select;function*z(){yield C("getActivePlugins",!0);try{const e=O.e+"/plugins/active",t=yield Object(c.apiFetch)({path:e,method:"GET"});yield j(t.plugins,!0)}catch(e){yield D("getActivePlugins",e)}}function*V(){yield C("getInstalledPlugins",!0);try{const e=O.e+"/plugins/installed",t=yield Object(c.apiFetch)({path:e,method:"GET"});yield E(t.plugins,!0)}catch(e){yield D("getInstalledPlugins",e)}}function*K(){yield C("isJetpackConnected",!0);try{const e=O.a+"/connection",t=yield Object(c.apiFetch)({path:e,method:"GET"});yield P(t.isActive)}catch(e){yield D("isJetpackConnected",e)}yield C("isJetpackConnected",!1)}function*W(e){yield C("getJetpackConnectUrl",!0);try{const t=Object(B.addQueryArgs)(O.e+"/plugins/connect-jetpack",e),n=yield Object(c.apiFetch)({path:t,method:"GET"});yield x(e.redirect_url,n.connectAction)}catch(e){yield D("getJetpackConnectUrl",e)}yield C("getJetpackConnectUrl",!1)}function*G(){const e=yield q(H.a,"getOption","woocommerce-ppcp-settings"),t=e.merchant_email_production&&e.merchant_id_production&&e.client_id_production&&e.client_secret_production;yield L({production:{state:t?"onboarded":"unknown",onboarded:!!t}})}function*Y(){yield C("getPaypalOnboardingStatus",!0);const e=yield q(s.b,"getPluginsError","getPaypalOnboardingStatus");if(e&&e.data&&404===e.data.status)yield G();else try{const e=s.a+"/onboarding/get-status",t=yield Object(c.apiFetch)({path:e,method:"GET"});yield L(t)}catch(e){yield G(),yield D("getPaypalOnboardingStatus",e)}yield C("getPaypalOnboardingStatus",!1)}const $=["payments"];function*Q(e){if(!$.includes(e))return[];yield C("getRecommendedPlugins",!0);try{const t=O.e+"/plugins/recommended-payment-plugins",n=yield Object(c.apiFetch)({path:t,method:"GET"});yield U(e,n)}catch(e){yield D("getRecommendedPlugins",e)}yield C("getRecommendedPlugins",!1)}var J=n(7);Object(i.registerStore)(s.b,{reducer:(e={active:[],installed:[],requesting:{},errors:{},jetpackConnectUrls:{},recommended:{}},t)=>{if(t&&"type"in t)switch(t.type){case v.UPDATE_ACTIVE_PLUGINS:e={...e,active:t.replace?t.active:Object(J.concat)(e.active,t.active),requesting:{...e.requesting,getActivePlugins:!1,activatePlugins:!1},errors:{...e.errors,getActivePlugins:!1,activatePlugins:!1}};break;case v.UPDATE_INSTALLED_PLUGINS:e={...e,installed:t.replace?t.installed:Object(J.concat)(e.installed,t.installed),requesting:{...e.requesting,getInstalledPlugins:!1,installPlugins:!1},errors:{...e.errors,getInstalledPlugins:!1,installPlugin:!1}};break;case v.SET_IS_REQUESTING:e={...e,requesting:{...e.requesting,[t.selector]:t.isRequesting}};break;case v.SET_ERROR:e={...e,requesting:{...e.requesting,[t.selector]:!1},errors:{...e.errors,[t.selector]:t.error}};break;case v.UPDATE_JETPACK_CONNECTION:e={...e,jetpackConnection:t.jetpackConnection};break;case v.UPDATE_JETPACK_CONNECT_URL:e={...e,jetpackConnectUrls:{...e.jetpackConnectUrls,[t.redirectUrl]:t.jetpackConnectUrl}};break;case v.SET_PAYPAL_ONBOARDING_STATUS:e={...e,paypalOnboardingStatus:t.paypalOnboardingStatus};break;case v.SET_RECOMMENDED_PLUGINS:e={...e,recommended:{...e.recommended,[t.recommendedType]:t.plugins}}}return e},actions:o,controls:c.controls,selectors:r,resolvers:a});const Z=s.b},function(e,t,n){"use strict";var r={};n.r(r),n.d(r,"getReportItemsError",(function(){return u})),n.d(r,"getReportItems",(function(){return d})),n.d(r,"getReportStats",(function(){return f})),n.d(r,"getReportStatsError",(function(){return p}));var o={};n.r(o),n.d(o,"setReportItemsError",(function(){return g})),n.d(o,"setReportItems",(function(){return v})),n.d(o,"setReportStats",(function(){return O})),n.d(o,"setReportStatsError",(function(){return w}));var a={};n.r(a),n.d(a,"getReportItems",(function(){return j})),n.d(a,"getReportStats",(function(){return E}));var i=n(14),c=n(221),s=n(82);const l={},u=(e,t,n)=>{const r=Object(s.a)(t,n);return e.itemErrors[r]||!1},d=(e,t,n)=>{const r=Object(s.a)(t,n);return e.items[r]||l},f=(e,t,n)=>{const r=Object(s.a)(t,n);return e.stats[r]||l},p=(e,t,n)=>{const r=Object(s.a)(t,n);return e.statErrors[r]||!1};var h="SET_ITEM_ERROR",m="SET_STAT_ERROR",y="SET_REPORT_ITEMS",b="SET_REPORT_STATS";function g(e,t,n){const r=Object(s.a)(e,t);return{type:h,resourceName:r,error:n}}function v(e,t,n){const r=Object(s.a)(e,t);return{type:y,resourceName:r,items:n}}function O(e,t,n){const r=Object(s.a)(e,t);return{type:b,resourceName:r,stats:n}}function w(e,t,n){const r=Object(s.a)(e,t);return{type:m,resourceName:r,error:n}}var _=n(23),k=n(115),S=n(40);function*j(e,t){const n={parse:!1,path:Object(_.addQueryArgs)(`${S.c}/reports/${e}`,t)};try{const r=yield Object(k.b)(n),o=r.data,a=parseInt(r.headers.get("x-wp-total"),10),i=parseInt(r.headers.get("x-wp-totalpages"),10);yield v(e,t,{data:o,totalResults:a,totalPages:i})}catch(n){yield g(e,t,n)}}function*E(e,t){const n={parse:!1,path:Object(_.addQueryArgs)(`${S.c}/reports/${e}/stats`,t)};try{const r=yield Object(k.b)(n),o=r.data,a=parseInt(r.headers.get("x-wp-total"),10),i=parseInt(r.headers.get("x-wp-totalpages"),10);yield O(e,t,{data:o,totalResults:a,totalPages:i})}catch(n){yield w(e,t,n)}}Object(i.registerStore)(c.a,{reducer:(e={itemErrors:{},items:{},statErrors:{},stats:{}},{type:t,items:n,stats:r,error:o,resourceName:a})=>{switch(t){case y:return{...e,items:{...e.items,[a]:n}};case b:return{...e,stats:{...e.stats,[a]:r}};case h:return{...e,itemErrors:{...e.itemErrors,[a]:o}};case m:return{...e,statErrors:{...e.statErrors,[a]:o}};default:return e}},actions:o,controls:k.a,selectors:r,resolvers:a}),c.a},function(e,t,n){"use strict";var r={};n.r(r),n.d(r,"getItems",(function(){return u})),n.d(r,"getItemsTotalCount",(function(){return d})),n.d(r,"getItemsError",(function(){return f}));var o={};n.r(o),n.d(o,"setItem",(function(){return O})),n.d(o,"setItems",(function(){return w})),n.d(o,"setItemsTotalCount",(function(){return _})),n.d(o,"setError",(function(){return k})),n.d(o,"updateProductStock",(function(){return S})),n.d(o,"createProductFromTemplate",(function(){return j}));var a={};n.r(a),n.d(a,"getItems",(function(){return D})),n.d(a,"getReviewsTotalCount",(function(){return P})),n.d(a,"getItemsTotalCount",(function(){return x}));var i=n(14),c=n(242),s=n(82),l=n(219);const u=(e,t,n)=>{const r=Object(s.a)(t,n);return(e.items[r]&&e.items[r].data||[]).reduce((n,r)=>(n.set(r,e.data[t][r]),n),new Map)},d=(e,t,n,r=0)=>{const o=Object(l.a)(t,n);return e.items.hasOwnProperty(o)?e.items[o]:r},f=(e,t,n)=>{const r=Object(s.a)(t,n);return e.errors[r]};var p=n(36),h=n(23),m="SET_ITEM",y="SET_ITEMS",b="SET_ITEMS_TOTAL_COUNT",g="SET_ERROR",v=n(40);function O(e,t,n){return{type:m,id:t,item:n,itemType:e}}function w(e,t,n,r){return{type:y,items:n,itemType:e,query:t,totalCount:r}}function _(e,t,n){return{type:b,itemType:e,query:t,totalCount:n}}function k(e,t,n){return{type:g,itemType:e,query:t,error:n}}function*S(e,t){const n={...e,stock_quantity:t},{id:r,parent_id:o,type:a}=n;yield O("products",r,n);let i=v.c;switch(a){case"variation":i+=`/products/${o}/variations/${r}`;break;case"variable":case"simple":default:i+="/products/"+r}try{return yield Object(p.apiFetch)({path:i,method:"PUT",data:n}),!0}catch(t){return yield O("products",r,e),yield k("products",r,t),!1}}function*j(e,t){try{const n=Object(h.addQueryArgs)(v.e+"/onboarding/tasks/create_product_from_template",t||{}),r=yield Object(p.apiFetch)({path:n,method:"POST",data:e});return yield O("products",r.id,r),r}catch(e){throw yield k("createProductFromTemplate",t,e),e}}var E=n(115);function*C(e,t){const n="categories"===e?"products/categories":e,r=Object(h.addQueryArgs)(`${v.c}/${n}`,t),o=-1===t.per_page,a=o?p.apiFetch:E.b,i=yield a({path:r,method:"GET"});if(o)return{items:i,totalCount:i.length};const c=parseInt(i.headers.get("x-wp-total"),10);return{items:i.data,totalCount:c}}function*D(e,t){try{const{items:n,totalCount:r}=yield C(e,t);yield _(e,t,r),yield w(e,t,n)}catch(n){yield k(e,t,n)}}function*P(e,t){yield x(e,t)}function*x(e,t){try{const n={...t,page:1,per_page:1},{totalCount:r}=yield C(e,n);yield _(e,t,r)}catch(n){yield k(e,t,n)}}Object(i.registerStore)(c.a,{reducer:(e={items:{},errors:{},data:{}},{type:t,id:n,itemType:r,query:o,item:a,items:i,totalCount:c,error:u})=>{switch(t){case m:const t=e.data[r]||{};return{...e,data:{...e.data,[r]:{...t,[n]:{...t[n]||{},...a}}}};case y:const d=[],f=i.reduce((e,t)=>(d.push(t.id),e[t.id]=t,e),{}),p=Object(s.a)(r,o);return{...e,items:{...e.items,[p]:{data:d}},data:{...e.data,[r]:{...e.data[r],...f}}};case b:const h=Object(l.a)(r,o);return{...e,items:{...e.items,[h]:c}};case g:return{...e,errors:{...e.errors,[Object(s.a)(r,o)]:u}};default:return e}},actions:o,controls:E.a,selectors:r,resolvers:a}),c.a},function(e,t,n){"use strict";n.r(t),n.d(t,"Portal",(function(){return O})),n.d(t,"PortalWithState",(function(){return k}));var r=n(87),o=n.n(r),a=n(11),i=n.n(a),c=n(2),s=n.n(c),l=!("undefined"==typeof window||!window.document||!window.document.createElement),u=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();function d(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function f(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}var p=function(e){function t(){return d(this,t),f(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),u(t,[{key:"componentWillUnmount",value:function(){this.defaultNode&&document.body.removeChild(this.defaultNode),this.defaultNode=null}},{key:"render",value:function(){return l?(this.props.node||this.defaultNode||(this.defaultNode=document.createElement("div"),document.body.appendChild(this.defaultNode)),o.a.createPortal(this.props.children,this.props.node||this.defaultNode)):null}}]),t}(i.a.Component);p.propTypes={children:s.a.node.isRequired,node:s.a.any};var h=p,m=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();function y(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function b(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}var g=function(e){function t(){return y(this,t),b(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),m(t,[{key:"componentDidMount",value:function(){this.renderPortal()}},{key:"componentDidUpdate",value:function(e){this.renderPortal()}},{key:"componentWillUnmount",value:function(){o.a.unmountComponentAtNode(this.defaultNode||this.props.node),this.defaultNode&&document.body.removeChild(this.defaultNode),this.defaultNode=null,this.portal=null}},{key:"renderPortal",value:function(e){this.props.node||this.defaultNode||(this.defaultNode=document.createElement("div"),document.body.appendChild(this.defaultNode));var t=this.props.children;"function"==typeof this.props.children.type&&(t=i.a.cloneElement(this.props.children)),this.portal=o.a.unstable_renderSubtreeIntoContainer(this,t,this.props.node||this.defaultNode)}},{key:"render",value:function(){return null}}]),t}(i.a.Component),v=g;g.propTypes={children:s.a.node.isRequired,node:s.a.any};var O=o.a.createPortal?h:v,w=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),_=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.portalNode=null,n.state={active:!!e.defaultOpen},n.openPortal=n.openPortal.bind(n),n.closePortal=n.closePortal.bind(n),n.wrapWithPortal=n.wrapWithPortal.bind(n),n.handleOutsideMouseClick=n.handleOutsideMouseClick.bind(n),n.handleKeydown=n.handleKeydown.bind(n),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),w(t,[{key:"componentDidMount",value:function(){this.props.closeOnEsc&&document.addEventListener("keydown",this.handleKeydown),this.props.closeOnOutsideClick&&document.addEventListener("click",this.handleOutsideMouseClick)}},{key:"componentWillUnmount",value:function(){this.props.closeOnEsc&&document.removeEventListener("keydown",this.handleKeydown),this.props.closeOnOutsideClick&&document.removeEventListener("click",this.handleOutsideMouseClick)}},{key:"openPortal",value:function(e){this.state.active||(e&&e.nativeEvent&&e.nativeEvent.stopImmediatePropagation(),this.setState({active:!0},this.props.onOpen))}},{key:"closePortal",value:function(){this.state.active&&this.setState({active:!1},this.props.onClose)}},{key:"wrapWithPortal",value:function(e){var t=this;return this.state.active?i.a.createElement(O,{node:this.props.node,key:"react-portal",ref:function(e){return t.portalNode=e}},e):null}},{key:"handleOutsideMouseClick",value:function(e){if(this.state.active){var t=this.portalNode&&(this.portalNode.props.node||this.portalNode.defaultNode);!t||t.contains(e.target)||e.button&&0!==e.button||this.closePortal()}}},{key:"handleKeydown",value:function(e){27===e.keyCode&&this.state.active&&this.closePortal()}},{key:"render",value:function(){return this.props.children({openPortal:this.openPortal,closePortal:this.closePortal,portal:this.wrapWithPortal,isOpen:this.state.active})}}]),t}(i.a.Component);_.propTypes={children:s.a.func.isRequired,defaultOpen:s.a.bool,node:s.a.any,closeOnEsc:s.a.bool,closeOnOutsideClick:s.a.bool,onOpen:s.a.func,onClose:s.a.func},_.defaultProps={onOpen:function(){},onClose:function(){}};var k=_},function(e,t,n){"use strict";var r={};n.r(r),n.d(r,"setError",(function(){return m})),n.d(r,"setIsRequesting",(function(){return y})),n.d(r,"setProfileItems",(function(){return b})),n.d(r,"setTasksStatus",(function(){return g})),n.d(r,"setPaymentMethods",(function(){return v})),n.d(r,"updateProfileItems",(function(){return O}));var o={};n.r(o),n.d(o,"getProfileItems",(function(){return w})),n.d(o,"getTasksStatus",(function(){return _})),n.d(o,"getPaymentGatewaySuggestions",(function(){return k}));var a=n(14),i=n(36),c=n(241),s=n(306),l="SET_ERROR",u="SET_IS_REQUESTING",d="SET_PROFILE_ITEMS",f="SET_TASKS_STATUS",p="GET_PAYMENT_METHODS_SUCCESS",h=n(40);function m(e,t){return{type:l,selector:e,error:t}}function y(e,t){return{type:u,selector:e,isRequesting:t}}function b(e,t=!1){return{type:d,profileItems:e,replace:t}}function g(e){return{type:f,tasksStatus:e}}function v(e){return{type:p,paymentMethods:e}}function*O(e){yield y("updateProfileItems",!0);try{const t=yield Object(i.apiFetch)({path:h.e+"/onboarding/profile",method:"POST",data:e});if(t&&"success"===t.status)return yield b(e),yield y("updateProfileItems",!1),t;throw new Error}catch(e){throw yield m("updateProfileItems",e),yield y("updateProfileItems",!1),new Error}}function*w(){try{const e=yield Object(i.apiFetch)({path:h.e+"/onboarding/profile",method:"GET"});yield b(e,!0)}catch(e){yield m("getProfileItems",e)}}function*_(){try{const e=yield Object(i.apiFetch)({path:h.e+"/onboarding/tasks/status",method:"GET"});yield g(e)}catch(e){yield m("getTasksStatus",e)}}function*k(){try{const e=yield Object(i.apiFetch)({path:h.e+"/onboarding/payments",method:"GET"});yield v(e)}catch(e){yield m("getPaymentGatewaySuggestions",e)}}const S={errors:{},profileItems:{business_extensions:null,completed:null,industry:null,other_platform:null,other_platform_name:null,product_count:null,product_types:null,revenue:null,selling_venues:null,setup_client:null,skipped:null,theme:null,wccom_connected:null},paymentMethods:[],requesting:{},tasksStatus:{}};Object(a.registerStore)(c.a,{reducer:(e=S,{type:t,profileItems:n,paymentMethods:r,replace:o,error:a,isRequesting:i,selector:c,tasksStatus:s})=>{switch(t){case d:return{...e,profileItems:o?n:{...e.profileItems,...n}};case f:return{...e,tasksStatus:{...e.tasksStatus,...s}};case l:return{...e,errors:{...e.errors,[c]:a}};case u:return{...e,requesting:{...e.requesting,[c]:i}};case p:return{...e,paymentMethods:r};default:return e}},actions:r,controls:i.controls,selectors:s,resolvers:o}),c.a},,,function(e,t,n){"use strict";var r=Object.assign||function(e){for(var t,n=1;n<arguments.length;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e};Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n=e.size,o=void 0===n?24:n,i=e.onClick,c=(e.icon,e.className),s=function(e,t){var n={};for(var r in e)0<=t.indexOf(r)||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}(e,["size","onClick","icon","className"]),l=["gridicon","gridicons-add-outline",c,(t=o,!(0!=t%18)&&"needs-offset"),!1,!1].filter(Boolean).join(" ");return a.default.createElement("svg",r({className:l,height:o,width:o,onClick:i},s,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"}),a.default.createElement("g",null,a.default.createElement("path",{d:"M12 4c4.41 0 8 3.59 8 8s-3.59 8-8 8-8-3.59-8-8 3.59-8 8-8m0-2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2zm5 9h-4V7h-2v4H7v2h4v4h2v-4h4v-2z"})))};var o,a=(o=n(11))&&o.__esModule?o:{default:o};e.exports=t.default},function(e,t){function n(t){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?(e.exports=n=function(e){return typeof e},e.exports.default=e.exports,e.exports.__esModule=!0):(e.exports=n=function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.default=e.exports,e.exports.__esModule=!0),n(t)}e.exports=n,e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,n){var r=n(645),o=n(646),a=n(647),i=n(648);e.exports=function(e){return r(e)||o(e)||a(e)||i()},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,n){"use strict";var r=Object.assign||function(e){for(var t,n=1;n<arguments.length;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e};Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t=e.size,n=void 0===t?24:t,o=e.onClick,i=(e.icon,e.className),c=function(e,t){var n={};for(var r in e)0<=t.indexOf(r)||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}(e,["size","onClick","icon","className"]),s=["gridicon","gridicons-cross-small",i,!1,!1,!1].filter(Boolean).join(" ");return a.default.createElement("svg",r({className:s,height:n,width:n,onClick:o},c,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"}),a.default.createElement("g",null,a.default.createElement("path",{d:"M17.705 7.705l-1.41-1.41L12 10.59 7.705 6.295l-1.41 1.41L10.59 12l-4.295 4.295 1.41 1.41L12 13.41l4.295 4.295 1.41-1.41L13.41 12l4.295-4.295z"})))};var o,a=(o=n(11))&&o.__esModule?o:{default:o};e.exports=t.default},function(e,t,n){"use strict";var r=n(649),o=n(650),a={countryCode:function(e){if(!e)throw new Error("Expected 1 country code as the first argument");return o(r,(function(t){return t.code===e.toUpperCase()}))},get data(){return r}};["emoji","code","name","unicode"].forEach((function(e){Object.defineProperty(a,e+"s",{get:function(){return r.map((function(t){return t[e]}))}})})),r.forEach((function(e,t){a[e.code]=r[t]})),e.exports=a},function(e,t,n){"use strict";var r=Object.assign||function(e){for(var t,n=1;n<arguments.length;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e};Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t=e.size,n=void 0===t?24:t,o=e.onClick,i=(e.icon,e.className),c=function(e,t){var n={};for(var r in e)0<=t.indexOf(r)||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}(e,["size","onClick","icon","className"]),s=["gridicon","gridicons-line-graph",i,!1,!1,!1].filter(Boolean).join(" ");return a.default.createElement("svg",r({className:s,height:n,width:n,onClick:o},c,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"}),a.default.createElement("g",null,a.default.createElement("path",{d:"M3 19h18v2H3zm3-3c1.1 0 2-.9 2-2 0-.5-.2-1-.5-1.3L8.8 10H9c.5 0 1-.2 1.3-.5l2.7 1.4v.1c0 1.1.9 2 2 2s2-.9 2-2c0-.5-.2-.9-.5-1.3L17.8 7h.2c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2c0 .5.2 1 .5 1.3L15.2 9H15c-.5 0-1 .2-1.3.5L11 8.2V8c0-1.1-.9-2-2-2s-2 .9-2 2c0 .5.2 1 .5 1.3L6.2 12H6c-1.1 0-2 .9-2 2s.9 2 2 2z"})))};var o,a=(o=n(11))&&o.__esModule?o:{default:o};e.exports=t.default},function(e,t,n){"use strict";var r=Object.assign||function(e){for(var t,n=1;n<arguments.length;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e};Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n=e.size,o=void 0===n?24:n,i=e.onClick,c=(e.icon,e.className),s=function(e,t){var n={};for(var r in e)0<=t.indexOf(r)||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}(e,["size","onClick","icon","className"]),l=["gridicon","gridicons-stats-alt",c,!1,!1,(t=o,!(0!=t%18)&&"needs-offset-y")].filter(Boolean).join(" ");return a.default.createElement("svg",r({className:l,height:o,width:o,onClick:i},s,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"}),a.default.createElement("g",null,a.default.createElement("path",{d:"M21 21H3v-2h18v2zM8 10H4v7h4v-7zm6-7h-4v14h4V3zm6 3h-4v11h4V6z"})))};var o,a=(o=n(11))&&o.__esModule?o:{default:o};e.exports=t.default},function(e,t,n){e.exports=function(){"use strict";var e=Object.hasOwnProperty,t=Object.setPrototypeOf,n=Object.isFrozen,r=Object.getPrototypeOf,o=Object.getOwnPropertyDescriptor,a=Object.freeze,i=Object.seal,c=Object.create,s="undefined"!=typeof Reflect&&Reflect,l=s.apply,u=s.construct;l||(l=function(e,t,n){return e.apply(t,n)}),a||(a=function(e){return e}),i||(i=function(e){return e}),u||(u=function(e,t){return new(Function.prototype.bind.apply(e,[null].concat(function(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}(t))))});var d,f=_(Array.prototype.forEach),p=_(Array.prototype.pop),h=_(Array.prototype.push),m=_(String.prototype.toLowerCase),y=_(String.prototype.match),b=_(String.prototype.replace),g=_(String.prototype.indexOf),v=_(String.prototype.trim),O=_(RegExp.prototype.test),w=(d=TypeError,function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return u(d,t)});function _(e){return function(t){for(var n=arguments.length,r=Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return l(e,t,r)}}function k(e,r){t&&t(e,null);for(var o=r.length;o--;){var a=r[o];if("string"==typeof a){var i=m(a);i!==a&&(n(r)||(r[o]=i),a=i)}e[a]=!0}return e}function S(t){var n=c(null),r=void 0;for(r in t)l(e,t,[r])&&(n[r]=t[r]);return n}function j(e,t){for(;null!==e;){var n=o(e,t);if(n){if(n.get)return _(n.get);if("function"==typeof n.value)return _(n.value)}e=r(e)}return function(e){return console.warn("fallback value for",e),null}}var E=a(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),C=a(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),D=a(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),P=a(["animate","color-profile","cursor","discard","fedropshadow","feimage","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),x=a(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover"]),F=a(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),T=a(["#text"]),M=a(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","xmlns"]),R=a(["accent-height","accumulate","additive","alignment-baseline","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","targetx","targety","transform","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),I=a(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),A=a(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),N=i(/\{\{[\s\S]*|[\s\S]*\}\}/gm),L=i(/<%[\s\S]*|[\s\S]*%>/gm),U=i(/^data-[\-\w.\u00B7-\uFFFF]/),B=i(/^aria-[\-\w]+$/),H=i(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),q=i(/^(?:\w+script|data):/i),z=i(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),V="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};function K(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}var W=function(){return"undefined"==typeof window?null:window},G=function(e,t){if("object"!==(void 0===e?"undefined":V(e))||"function"!=typeof e.createPolicy)return null;var n=null;t.currentScript&&t.currentScript.hasAttribute("data-tt-policy-suffix")&&(n=t.currentScript.getAttribute("data-tt-policy-suffix"));var r="dompurify"+(n?"#"+n:"");try{return e.createPolicy(r,{createHTML:function(e){return e}})}catch(e){return console.warn("TrustedTypes policy "+r+" could not be created."),null}};return function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:W(),n=function(t){return e(t)};if(n.version="2.2.7",n.removed=[],!t||!t.document||9!==t.document.nodeType)return n.isSupported=!1,n;var r=t.document,o=t.document,i=t.DocumentFragment,c=t.HTMLTemplateElement,s=t.Node,l=t.Element,u=t.NodeFilter,d=t.NamedNodeMap,_=void 0===d?t.NamedNodeMap||t.MozNamedAttrMap:d,Y=t.Text,$=t.Comment,Q=t.DOMParser,J=t.trustedTypes,Z=l.prototype,X=j(Z,"cloneNode"),ee=j(Z,"nextSibling"),te=j(Z,"childNodes"),ne=j(Z,"parentNode");if("function"==typeof c){var re=o.createElement("template");re.content&&re.content.ownerDocument&&(o=re.content.ownerDocument)}var oe=G(J,r),ae=oe&&Ne?oe.createHTML(""):"",ie=o,ce=ie.implementation,se=ie.createNodeIterator,le=ie.getElementsByTagName,ue=ie.createDocumentFragment,de=r.importNode,fe={};try{fe=S(o).documentMode?o.documentMode:{}}catch(e){}var pe={};n.isSupported="function"==typeof ne&&ce&&void 0!==ce.createHTMLDocument&&9!==fe;var he=N,me=L,ye=U,be=B,ge=q,ve=z,Oe=H,we=null,_e=k({},[].concat(K(E),K(C),K(D),K(x),K(T))),ke=null,Se=k({},[].concat(K(M),K(R),K(I),K(A))),je=null,Ee=null,Ce=!0,De=!0,Pe=!1,xe=!1,Fe=!1,Te=!1,Me=!1,Re=!1,Ie=!1,Ae=!0,Ne=!1,Le=!0,Ue=!0,Be=!1,He={},qe=k({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]),ze=null,Ve=k({},["audio","video","img","source","image","track"]),Ke=null,We=k({},["alt","class","for","id","label","name","pattern","placeholder","summary","title","value","style","xmlns"]),Ge=null,Ye=o.createElement("form"),$e=function(e){Ge&&Ge===e||(e&&"object"===(void 0===e?"undefined":V(e))||(e={}),e=S(e),we="ALLOWED_TAGS"in e?k({},e.ALLOWED_TAGS):_e,ke="ALLOWED_ATTR"in e?k({},e.ALLOWED_ATTR):Se,Ke="ADD_URI_SAFE_ATTR"in e?k(S(We),e.ADD_URI_SAFE_ATTR):We,ze="ADD_DATA_URI_TAGS"in e?k(S(Ve),e.ADD_DATA_URI_TAGS):Ve,je="FORBID_TAGS"in e?k({},e.FORBID_TAGS):{},Ee="FORBID_ATTR"in e?k({},e.FORBID_ATTR):{},He="USE_PROFILES"in e&&e.USE_PROFILES,Ce=!1!==e.ALLOW_ARIA_ATTR,De=!1!==e.ALLOW_DATA_ATTR,Pe=e.ALLOW_UNKNOWN_PROTOCOLS||!1,xe=e.SAFE_FOR_TEMPLATES||!1,Fe=e.WHOLE_DOCUMENT||!1,Re=e.RETURN_DOM||!1,Ie=e.RETURN_DOM_FRAGMENT||!1,Ae=!1!==e.RETURN_DOM_IMPORT,Ne=e.RETURN_TRUSTED_TYPE||!1,Me=e.FORCE_BODY||!1,Le=!1!==e.SANITIZE_DOM,Ue=!1!==e.KEEP_CONTENT,Be=e.IN_PLACE||!1,Oe=e.ALLOWED_URI_REGEXP||Oe,xe&&(De=!1),Ie&&(Re=!0),He&&(we=k({},[].concat(K(T))),ke=[],!0===He.html&&(k(we,E),k(ke,M)),!0===He.svg&&(k(we,C),k(ke,R),k(ke,A)),!0===He.svgFilters&&(k(we,D),k(ke,R),k(ke,A)),!0===He.mathMl&&(k(we,x),k(ke,I),k(ke,A))),e.ADD_TAGS&&(we===_e&&(we=S(we)),k(we,e.ADD_TAGS)),e.ADD_ATTR&&(ke===Se&&(ke=S(ke)),k(ke,e.ADD_ATTR)),e.ADD_URI_SAFE_ATTR&&k(Ke,e.ADD_URI_SAFE_ATTR),Ue&&(we["#text"]=!0),Fe&&k(we,["html","head","body"]),we.table&&(k(we,["tbody"]),delete je.tbody),a&&a(e),Ge=e)},Qe=k({},["mi","mo","mn","ms","mtext"]),Je=k({},["foreignobject","desc","title","annotation-xml"]),Ze=k({},C);k(Ze,D),k(Ze,P);var Xe=k({},x);k(Xe,F);var et="http://www.w3.org/1998/Math/MathML",tt="http://www.w3.org/2000/svg",nt="http://www.w3.org/1999/xhtml",rt=function(e){var t=ne(e);t&&t.tagName||(t={namespaceURI:nt,tagName:"template"});var n=m(e.tagName),r=m(t.tagName);if(e.namespaceURI===tt)return t.namespaceURI===nt?"svg"===n:t.namespaceURI===et?"svg"===n&&("annotation-xml"===r||Qe[r]):Boolean(Ze[n]);if(e.namespaceURI===et)return t.namespaceURI===nt?"math"===n:t.namespaceURI===tt?"math"===n&&Je[r]:Boolean(Xe[n]);if(e.namespaceURI===nt){if(t.namespaceURI===tt&&!Je[r])return!1;if(t.namespaceURI===et&&!Qe[r])return!1;var o=k({},["title","style","font","a","script"]);return!Xe[n]&&(o[n]||!Ze[n])}return!1},ot=function(e){h(n.removed,{element:e});try{e.parentNode.removeChild(e)}catch(t){try{e.outerHTML=ae}catch(t){e.remove()}}},at=function(e,t){try{h(n.removed,{attribute:t.getAttributeNode(e),from:t})}catch(e){h(n.removed,{attribute:null,from:t})}if(t.removeAttribute(e),"is"===e&&!ke[e])if(Re||Ie)try{ot(t)}catch(e){}else try{t.setAttribute(e,"")}catch(e){}},it=function(e){var t=void 0,n=void 0;if(Me)e="<remove></remove>"+e;else{var r=y(e,/^[\r\n\t ]+/);n=r&&r[0]}var a=oe?oe.createHTML(e):e;try{t=(new Q).parseFromString(a,"text/html")}catch(e){}if(!t||!t.documentElement){var i=(t=ce.createHTMLDocument("")).body;i.parentNode.removeChild(i.parentNode.firstElementChild),i.outerHTML=a}return e&&n&&t.body.insertBefore(o.createTextNode(n),t.body.childNodes[0]||null),le.call(t,Fe?"html":"body")[0]},ct=function(e){return se.call(e.ownerDocument||e,e,u.SHOW_ELEMENT|u.SHOW_COMMENT|u.SHOW_TEXT,(function(){return u.FILTER_ACCEPT}),!1)},st=function(e){return!(e instanceof Y||e instanceof $||"string"==typeof e.nodeName&&"string"==typeof e.textContent&&"function"==typeof e.removeChild&&e.attributes instanceof _&&"function"==typeof e.removeAttribute&&"function"==typeof e.setAttribute&&"string"==typeof e.namespaceURI&&"function"==typeof e.insertBefore)},lt=function(e){return"object"===(void 0===s?"undefined":V(s))?e instanceof s:e&&"object"===(void 0===e?"undefined":V(e))&&"number"==typeof e.nodeType&&"string"==typeof e.nodeName},ut=function(e,t,r){pe[e]&&f(pe[e],(function(e){e.call(n,t,r,Ge)}))},dt=function(e){var t=void 0;if(ut("beforeSanitizeElements",e,null),st(e))return ot(e),!0;if(y(e.nodeName,/[\u0080-\uFFFF]/))return ot(e),!0;var r=m(e.nodeName);if(ut("uponSanitizeElement",e,{tagName:r,allowedTags:we}),!lt(e.firstElementChild)&&(!lt(e.content)||!lt(e.content.firstElementChild))&&O(/<[/\w]/g,e.innerHTML)&&O(/<[/\w]/g,e.textContent))return ot(e),!0;if(!we[r]||je[r]){if(Ue&&!qe[r]){var o=ne(e),a=te(e);if(a&&o)for(var i=a.length-1;i>=0;--i)o.insertBefore(X(a[i],!0),ee(e))}return ot(e),!0}return e instanceof l&&!rt(e)?(ot(e),!0):"noscript"!==r&&"noembed"!==r||!O(/<\/no(script|embed)/i,e.innerHTML)?(xe&&3===e.nodeType&&(t=e.textContent,t=b(t,he," "),t=b(t,me," "),e.textContent!==t&&(h(n.removed,{element:e.cloneNode()}),e.textContent=t)),ut("afterSanitizeElements",e,null),!1):(ot(e),!0)},ft=function(e,t,n){if(Le&&("id"===t||"name"===t)&&(n in o||n in Ye))return!1;if(De&&O(ye,t));else if(Ce&&O(be,t));else{if(!ke[t]||Ee[t])return!1;if(Ke[t]);else if(O(Oe,b(n,ve,"")));else if("src"!==t&&"xlink:href"!==t&&"href"!==t||"script"===e||0!==g(n,"data:")||!ze[e])if(Pe&&!O(ge,b(n,ve,"")));else if(n)return!1}return!0},pt=function(e){var t=void 0,r=void 0,o=void 0,a=void 0;ut("beforeSanitizeAttributes",e,null);var i=e.attributes;if(i){var c={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:ke};for(a=i.length;a--;){var s=t=i[a],l=s.name,u=s.namespaceURI;if(r=v(t.value),o=m(l),c.attrName=o,c.attrValue=r,c.keepAttr=!0,c.forceKeepAttr=void 0,ut("uponSanitizeAttribute",e,c),r=c.attrValue,!c.forceKeepAttr&&(at(l,e),c.keepAttr))if(O(/\/>/i,r))at(l,e);else{xe&&(r=b(r,he," "),r=b(r,me," "));var d=e.nodeName.toLowerCase();if(ft(d,o,r))try{u?e.setAttributeNS(u,l,r):e.setAttribute(l,r),p(n.removed)}catch(e){}}}ut("afterSanitizeAttributes",e,null)}},ht=function e(t){var n=void 0,r=ct(t);for(ut("beforeSanitizeShadowDOM",t,null);n=r.nextNode();)ut("uponSanitizeShadowNode",n,null),dt(n)||(n.content instanceof i&&e(n.content),pt(n));ut("afterSanitizeShadowDOM",t,null)};return n.sanitize=function(e,o){var a=void 0,c=void 0,l=void 0,u=void 0,d=void 0;if(e||(e="\x3c!--\x3e"),"string"!=typeof e&&!lt(e)){if("function"!=typeof e.toString)throw w("toString is not a function");if("string"!=typeof(e=e.toString()))throw w("dirty is not a string, aborting")}if(!n.isSupported){if("object"===V(t.toStaticHTML)||"function"==typeof t.toStaticHTML){if("string"==typeof e)return t.toStaticHTML(e);if(lt(e))return t.toStaticHTML(e.outerHTML)}return e}if(Te||$e(o),n.removed=[],"string"==typeof e&&(Be=!1),Be);else if(e instanceof s)1===(c=(a=it("\x3c!----\x3e")).ownerDocument.importNode(e,!0)).nodeType&&"BODY"===c.nodeName||"HTML"===c.nodeName?a=c:a.appendChild(c);else{if(!Re&&!xe&&!Fe&&-1===e.indexOf("<"))return oe&&Ne?oe.createHTML(e):e;if(!(a=it(e)))return Re?null:ae}a&&Me&&ot(a.firstChild);for(var f=ct(Be?e:a);l=f.nextNode();)3===l.nodeType&&l===u||dt(l)||(l.content instanceof i&&ht(l.content),pt(l),u=l);if(u=null,Be)return e;if(Re){if(Ie)for(d=ue.call(a.ownerDocument);a.firstChild;)d.appendChild(a.firstChild);else d=a;return Ae&&(d=de.call(r,d,!0)),d}var p=Fe?a.outerHTML:a.innerHTML;return xe&&(p=b(p,he," "),p=b(p,me," ")),oe&&Ne?oe.createHTML(p):p},n.setConfig=function(e){$e(e),Te=!0},n.clearConfig=function(){Ge=null,Te=!1},n.isValidAttribute=function(e,t,n){Ge||$e({});var r=m(e),o=m(t);return ft(r,o,n)},n.addHook=function(e,t){"function"==typeof t&&(pe[e]=pe[e]||[],h(pe[e],t))},n.removeHook=function(e){pe[e]&&p(pe[e])},n.removeHooks=function(e){pe[e]&&(pe[e]=[])},n.removeAllHooks=function(){pe={}},n}()}()},function(e,t,n){e.exports=n(702)},function(e,t,n){"use strict";var r=Object.assign||function(e){for(var t,n=1;n<arguments.length;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e};Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n=e.size,o=void 0===n?24:n,i=e.onClick,c=(e.icon,e.className),s=function(e,t){var n={};for(var r in e)0<=t.indexOf(r)||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}(e,["size","onClick","icon","className"]),l=["gridicon","gridicons-star",c,(t=o,!(0!=t%18)&&"needs-offset"),!1,!1].filter(Boolean).join(" ");return a.default.createElement("svg",r({className:l,height:o,width:o,onClick:i},s,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"}),a.default.createElement("g",null,a.default.createElement("path",{d:"M12 2l2.582 6.953L22 9.257l-5.822 4.602L18.18 21 12 16.89 5.82 21l2.002-7.14L2 9.256l7.418-.304"})))};var o,a=(o=n(11))&&o.__esModule?o:{default:o};e.exports=t.default},function(e,t,n){"use strict";var r=Object.assign||function(e){for(var t,n=1;n<arguments.length;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e};Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n=e.size,o=void 0===n?24:n,i=e.onClick,c=(e.icon,e.className),s=function(e,t){var n={};for(var r in e)0<=t.indexOf(r)||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}(e,["size","onClick","icon","className"]),l=["gridicon","gridicons-notice-outline",c,(t=o,!(0!=t%18)&&"needs-offset"),!1,!1].filter(Boolean).join(" ");return a.default.createElement("svg",r({className:l,height:o,width:o,onClick:i},s,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"}),a.default.createElement("g",null,a.default.createElement("path",{d:"M12 4c4.41 0 8 3.59 8 8s-3.59 8-8 8-8-3.59-8-8 3.59-8 8-8m0-2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2zm1 13h-2v2h2v-2zm-2-2h2l.5-6h-3l.5 6z"})))};var o,a=(o=n(11))&&o.__esModule?o:{default:o};e.exports=t.default},function(e,t,n){"use strict";var r=Object.assign||function(e){for(var t,n=1;n<arguments.length;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e};Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t=e.size,n=void 0===t?24:t,o=e.onClick,i=(e.icon,e.className),c=function(e,t){var n={};for(var r in e)0<=t.indexOf(r)||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}(e,["size","onClick","icon","className"]),s=["gridicon","gridicons-chevron-down",i,!1,!1,!1].filter(Boolean).join(" ");return a.default.createElement("svg",r({className:s,height:n,width:n,onClick:o},c,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"}),a.default.createElement("g",null,a.default.createElement("path",{d:"M20 9l-8 8-8-8 1.414-1.414L12 14.172l6.586-6.586"})))};var o,a=(o=n(11))&&o.__esModule?o:{default:o};e.exports=t.default},function(e,t,n){var r;!function(o){var a=/^\s+/,i=/\s+$/,c=0,s=o.round,l=o.min,u=o.max,d=o.random;function f(e,t){if(t=t||{},(e=e||"")instanceof f)return e;if(!(this instanceof f))return new f(e,t);var n=function(e){var t,n,r,c={r:0,g:0,b:0},s=1,d=null,f=null,p=null,h=!1,m=!1;return"string"==typeof e&&(e=function(e){e=e.replace(a,"").replace(i,"").toLowerCase();var t,n=!1;if(x[e])e=x[e],n=!0;else if("transparent"==e)return{r:0,g:0,b:0,a:0,format:"name"};return(t=z.rgb.exec(e))?{r:t[1],g:t[2],b:t[3]}:(t=z.rgba.exec(e))?{r:t[1],g:t[2],b:t[3],a:t[4]}:(t=z.hsl.exec(e))?{h:t[1],s:t[2],l:t[3]}:(t=z.hsla.exec(e))?{h:t[1],s:t[2],l:t[3],a:t[4]}:(t=z.hsv.exec(e))?{h:t[1],s:t[2],v:t[3]}:(t=z.hsva.exec(e))?{h:t[1],s:t[2],v:t[3],a:t[4]}:(t=z.hex8.exec(e))?{r:I(t[1]),g:I(t[2]),b:I(t[3]),a:U(t[4]),format:n?"name":"hex8"}:(t=z.hex6.exec(e))?{r:I(t[1]),g:I(t[2]),b:I(t[3]),format:n?"name":"hex"}:(t=z.hex4.exec(e))?{r:I(t[1]+""+t[1]),g:I(t[2]+""+t[2]),b:I(t[3]+""+t[3]),a:U(t[4]+""+t[4]),format:n?"name":"hex8"}:!!(t=z.hex3.exec(e))&&{r:I(t[1]+""+t[1]),g:I(t[2]+""+t[2]),b:I(t[3]+""+t[3]),format:n?"name":"hex"}}(e)),"object"==typeof e&&(V(e.r)&&V(e.g)&&V(e.b)?(t=e.r,n=e.g,r=e.b,c={r:255*M(t,255),g:255*M(n,255),b:255*M(r,255)},h=!0,m="%"===String(e.r).substr(-1)?"prgb":"rgb"):V(e.h)&&V(e.s)&&V(e.v)?(d=N(e.s),f=N(e.v),c=function(e,t,n){e=6*M(e,360),t=M(t,100),n=M(n,100);var r=o.floor(e),a=e-r,i=n*(1-t),c=n*(1-a*t),s=n*(1-(1-a)*t),l=r%6;return{r:255*[n,c,i,i,s,n][l],g:255*[s,n,n,c,i,i][l],b:255*[i,i,s,n,n,c][l]}}(e.h,d,f),h=!0,m="hsv"):V(e.h)&&V(e.s)&&V(e.l)&&(d=N(e.s),p=N(e.l),c=function(e,t,n){var r,o,a;function i(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e}if(e=M(e,360),t=M(t,100),n=M(n,100),0===t)r=o=a=n;else{var c=n<.5?n*(1+t):n+t-n*t,s=2*n-c;r=i(s,c,e+1/3),o=i(s,c,e),a=i(s,c,e-1/3)}return{r:255*r,g:255*o,b:255*a}}(e.h,d,p),h=!0,m="hsl"),e.hasOwnProperty("a")&&(s=e.a)),s=T(s),{ok:h,format:e.format||m,r:l(255,u(c.r,0)),g:l(255,u(c.g,0)),b:l(255,u(c.b,0)),a:s}}(e);this._originalInput=e,this._r=n.r,this._g=n.g,this._b=n.b,this._a=n.a,this._roundA=s(100*this._a)/100,this._format=t.format||n.format,this._gradientType=t.gradientType,this._r<1&&(this._r=s(this._r)),this._g<1&&(this._g=s(this._g)),this._b<1&&(this._b=s(this._b)),this._ok=n.ok,this._tc_id=c++}function p(e,t,n){e=M(e,255),t=M(t,255),n=M(n,255);var r,o,a=u(e,t,n),i=l(e,t,n),c=(a+i)/2;if(a==i)r=o=0;else{var s=a-i;switch(o=c>.5?s/(2-a-i):s/(a+i),a){case e:r=(t-n)/s+(t<n?6:0);break;case t:r=(n-e)/s+2;break;case n:r=(e-t)/s+4}r/=6}return{h:r,s:o,l:c}}function h(e,t,n){e=M(e,255),t=M(t,255),n=M(n,255);var r,o,a=u(e,t,n),i=l(e,t,n),c=a,s=a-i;if(o=0===a?0:s/a,a==i)r=0;else{switch(a){case e:r=(t-n)/s+(t<n?6:0);break;case t:r=(n-e)/s+2;break;case n:r=(e-t)/s+4}r/=6}return{h:r,s:o,v:c}}function m(e,t,n,r){var o=[A(s(e).toString(16)),A(s(t).toString(16)),A(s(n).toString(16))];return r&&o[0].charAt(0)==o[0].charAt(1)&&o[1].charAt(0)==o[1].charAt(1)&&o[2].charAt(0)==o[2].charAt(1)?o[0].charAt(0)+o[1].charAt(0)+o[2].charAt(0):o.join("")}function y(e,t,n,r){return[A(L(r)),A(s(e).toString(16)),A(s(t).toString(16)),A(s(n).toString(16))].join("")}function b(e,t){t=0===t?0:t||10;var n=f(e).toHsl();return n.s-=t/100,n.s=R(n.s),f(n)}function g(e,t){t=0===t?0:t||10;var n=f(e).toHsl();return n.s+=t/100,n.s=R(n.s),f(n)}function v(e){return f(e).desaturate(100)}function O(e,t){t=0===t?0:t||10;var n=f(e).toHsl();return n.l+=t/100,n.l=R(n.l),f(n)}function w(e,t){t=0===t?0:t||10;var n=f(e).toRgb();return n.r=u(0,l(255,n.r-s(-t/100*255))),n.g=u(0,l(255,n.g-s(-t/100*255))),n.b=u(0,l(255,n.b-s(-t/100*255))),f(n)}function _(e,t){t=0===t?0:t||10;var n=f(e).toHsl();return n.l-=t/100,n.l=R(n.l),f(n)}function k(e,t){var n=f(e).toHsl(),r=(n.h+t)%360;return n.h=r<0?360+r:r,f(n)}function S(e){var t=f(e).toHsl();return t.h=(t.h+180)%360,f(t)}function j(e){var t=f(e).toHsl(),n=t.h;return[f(e),f({h:(n+120)%360,s:t.s,l:t.l}),f({h:(n+240)%360,s:t.s,l:t.l})]}function E(e){var t=f(e).toHsl(),n=t.h;return[f(e),f({h:(n+90)%360,s:t.s,l:t.l}),f({h:(n+180)%360,s:t.s,l:t.l}),f({h:(n+270)%360,s:t.s,l:t.l})]}function C(e){var t=f(e).toHsl(),n=t.h;return[f(e),f({h:(n+72)%360,s:t.s,l:t.l}),f({h:(n+216)%360,s:t.s,l:t.l})]}function D(e,t,n){t=t||6,n=n||30;var r=f(e).toHsl(),o=360/n,a=[f(e)];for(r.h=(r.h-(o*t>>1)+720)%360;--t;)r.h=(r.h+o)%360,a.push(f(r));return a}function P(e,t){t=t||6;for(var n=f(e).toHsv(),r=n.h,o=n.s,a=n.v,i=[],c=1/t;t--;)i.push(f({h:r,s:o,v:a})),a=(a+c)%1;return i}f.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var e=this.toRgb();return(299*e.r+587*e.g+114*e.b)/1e3},getLuminance:function(){var e,t,n,r=this.toRgb();return e=r.r/255,t=r.g/255,n=r.b/255,.2126*(e<=.03928?e/12.92:o.pow((e+.055)/1.055,2.4))+.7152*(t<=.03928?t/12.92:o.pow((t+.055)/1.055,2.4))+.0722*(n<=.03928?n/12.92:o.pow((n+.055)/1.055,2.4))},setAlpha:function(e){return this._a=T(e),this._roundA=s(100*this._a)/100,this},toHsv:function(){var e=h(this._r,this._g,this._b);return{h:360*e.h,s:e.s,v:e.v,a:this._a}},toHsvString:function(){var e=h(this._r,this._g,this._b),t=s(360*e.h),n=s(100*e.s),r=s(100*e.v);return 1==this._a?"hsv("+t+", "+n+"%, "+r+"%)":"hsva("+t+", "+n+"%, "+r+"%, "+this._roundA+")"},toHsl:function(){var e=p(this._r,this._g,this._b);return{h:360*e.h,s:e.s,l:e.l,a:this._a}},toHslString:function(){var e=p(this._r,this._g,this._b),t=s(360*e.h),n=s(100*e.s),r=s(100*e.l);return 1==this._a?"hsl("+t+", "+n+"%, "+r+"%)":"hsla("+t+", "+n+"%, "+r+"%, "+this._roundA+")"},toHex:function(e){return m(this._r,this._g,this._b,e)},toHexString:function(e){return"#"+this.toHex(e)},toHex8:function(e){return function(e,t,n,r,o){var a=[A(s(e).toString(16)),A(s(t).toString(16)),A(s(n).toString(16)),A(L(r))];return o&&a[0].charAt(0)==a[0].charAt(1)&&a[1].charAt(0)==a[1].charAt(1)&&a[2].charAt(0)==a[2].charAt(1)&&a[3].charAt(0)==a[3].charAt(1)?a[0].charAt(0)+a[1].charAt(0)+a[2].charAt(0)+a[3].charAt(0):a.join("")}(this._r,this._g,this._b,this._a,e)},toHex8String:function(e){return"#"+this.toHex8(e)},toRgb:function(){return{r:s(this._r),g:s(this._g),b:s(this._b),a:this._a}},toRgbString:function(){return 1==this._a?"rgb("+s(this._r)+", "+s(this._g)+", "+s(this._b)+")":"rgba("+s(this._r)+", "+s(this._g)+", "+s(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:s(100*M(this._r,255))+"%",g:s(100*M(this._g,255))+"%",b:s(100*M(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return 1==this._a?"rgb("+s(100*M(this._r,255))+"%, "+s(100*M(this._g,255))+"%, "+s(100*M(this._b,255))+"%)":"rgba("+s(100*M(this._r,255))+"%, "+s(100*M(this._g,255))+"%, "+s(100*M(this._b,255))+"%, "+this._roundA+")"},toName:function(){return 0===this._a?"transparent":!(this._a<1)&&(F[m(this._r,this._g,this._b,!0)]||!1)},toFilter:function(e){var t="#"+y(this._r,this._g,this._b,this._a),n=t,r=this._gradientType?"GradientType = 1, ":"";if(e){var o=f(e);n="#"+y(o._r,o._g,o._b,o._a)}return"progid:DXImageTransform.Microsoft.gradient("+r+"startColorstr="+t+",endColorstr="+n+")"},toString:function(e){var t=!!e;e=e||this._format;var n=!1,r=this._a<1&&this._a>=0;return t||!r||"hex"!==e&&"hex6"!==e&&"hex3"!==e&&"hex4"!==e&&"hex8"!==e&&"name"!==e?("rgb"===e&&(n=this.toRgbString()),"prgb"===e&&(n=this.toPercentageRgbString()),"hex"!==e&&"hex6"!==e||(n=this.toHexString()),"hex3"===e&&(n=this.toHexString(!0)),"hex4"===e&&(n=this.toHex8String(!0)),"hex8"===e&&(n=this.toHex8String()),"name"===e&&(n=this.toName()),"hsl"===e&&(n=this.toHslString()),"hsv"===e&&(n=this.toHsvString()),n||this.toHexString()):"name"===e&&0===this._a?this.toName():this.toRgbString()},clone:function(){return f(this.toString())},_applyModification:function(e,t){var n=e.apply(null,[this].concat([].slice.call(t)));return this._r=n._r,this._g=n._g,this._b=n._b,this.setAlpha(n._a),this},lighten:function(){return this._applyModification(O,arguments)},brighten:function(){return this._applyModification(w,arguments)},darken:function(){return this._applyModification(_,arguments)},desaturate:function(){return this._applyModification(b,arguments)},saturate:function(){return this._applyModification(g,arguments)},greyscale:function(){return this._applyModification(v,arguments)},spin:function(){return this._applyModification(k,arguments)},_applyCombination:function(e,t){return e.apply(null,[this].concat([].slice.call(t)))},analogous:function(){return this._applyCombination(D,arguments)},complement:function(){return this._applyCombination(S,arguments)},monochromatic:function(){return this._applyCombination(P,arguments)},splitcomplement:function(){return this._applyCombination(C,arguments)},triad:function(){return this._applyCombination(j,arguments)},tetrad:function(){return this._applyCombination(E,arguments)}},f.fromRatio=function(e,t){if("object"==typeof e){var n={};for(var r in e)e.hasOwnProperty(r)&&(n[r]="a"===r?e[r]:N(e[r]));e=n}return f(e,t)},f.equals=function(e,t){return!(!e||!t)&&f(e).toRgbString()==f(t).toRgbString()},f.random=function(){return f.fromRatio({r:d(),g:d(),b:d()})},f.mix=function(e,t,n){n=0===n?0:n||50;var r=f(e).toRgb(),o=f(t).toRgb(),a=n/100;return f({r:(o.r-r.r)*a+r.r,g:(o.g-r.g)*a+r.g,b:(o.b-r.b)*a+r.b,a:(o.a-r.a)*a+r.a})},f.readability=function(e,t){var n=f(e),r=f(t);return(o.max(n.getLuminance(),r.getLuminance())+.05)/(o.min(n.getLuminance(),r.getLuminance())+.05)},f.isReadable=function(e,t,n){var r,o,a,i,c,s=f.readability(e,t);switch(o=!1,(a=n,"AA"!==(i=((a=a||{level:"AA",size:"small"}).level||"AA").toUpperCase())&&"AAA"!==i&&(i="AA"),"small"!==(c=(a.size||"small").toLowerCase())&&"large"!==c&&(c="small"),r={level:i,size:c}).level+r.size){case"AAsmall":case"AAAlarge":o=s>=4.5;break;case"AAlarge":o=s>=3;break;case"AAAsmall":o=s>=7}return o},f.mostReadable=function(e,t,n){var r,o,a,i,c=null,s=0;o=(n=n||{}).includeFallbackColors,a=n.level,i=n.size;for(var l=0;l<t.length;l++)(r=f.readability(e,t[l]))>s&&(s=r,c=f(t[l]));return f.isReadable(e,c,{level:a,size:i})||!o?c:(n.includeFallbackColors=!1,f.mostReadable(e,["#fff","#000"],n))};var x=f.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",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:"f0f",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:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",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",rebeccapurple:"663399",red:"f00",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:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},F=f.hexNames=function(e){var t={};for(var n in e)e.hasOwnProperty(n)&&(t[e[n]]=n);return t}(x);function T(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}function M(e,t){(function(e){return"string"==typeof e&&-1!=e.indexOf(".")&&1===parseFloat(e)})(e)&&(e="100%");var n=function(e){return"string"==typeof e&&-1!=e.indexOf("%")}(e);return e=l(t,u(0,parseFloat(e))),n&&(e=parseInt(e*t,10)/100),o.abs(e-t)<1e-6?1:e%t/parseFloat(t)}function R(e){return l(1,u(0,e))}function I(e){return parseInt(e,16)}function A(e){return 1==e.length?"0"+e:""+e}function N(e){return e<=1&&(e=100*e+"%"),e}function L(e){return o.round(255*parseFloat(e)).toString(16)}function U(e){return I(e)/255}var B,H,q,z=(H="[\\s|\\(]+("+(B="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)")+")[,|\\s]+("+B+")[,|\\s]+("+B+")\\s*\\)?",q="[\\s|\\(]+("+B+")[,|\\s]+("+B+")[,|\\s]+("+B+")[,|\\s]+("+B+")\\s*\\)?",{CSS_UNIT:new RegExp(B),rgb:new RegExp("rgb"+H),rgba:new RegExp("rgba"+q),hsl:new RegExp("hsl"+H),hsla:new RegExp("hsla"+q),hsv:new RegExp("hsv"+H),hsva:new RegExp("hsva"+q),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/});function V(e){return!!z.CSS_UNIT.exec(e)}e.exports?e.exports=f:void 0===(r=function(){return f}.call(t,n,t,e))||(e.exports=r)}(Math)},function(e,t,n){"use strict";(function(e){var r=n(0),o=n(7),a=n(6),i=n.n(a),c=n(64),s=n(1),l=(n(191),n(182));t.a=Object(r.forwardRef)((function(t,n){var a=t.className,u=t.children,d=t.spokenMessage,f=void 0===d?u:d,p=t.politeness,h=void 0===p?"polite":p,m=t.actions,y=void 0===m?[]:m,b=t.onRemove,g=void 0===b?o.noop:b;!function(e,t){var n="string"==typeof e?e:Object(r.renderToString)(e);Object(r.useEffect)((function(){n&&Object(c.speak)(n,t)}),[n,t])}(f,h),Object(r.useEffect)((function(){var e=setTimeout((function(){g()}),1e4);return function(){return clearTimeout(e)}}),[]);var v=i()(a,"components-snackbar");return y&&y.length>1&&(void 0!==e&&e.env,y=[y[0]]),Object(r.createElement)("div",{ref:n,className:v,onClick:g,tabIndex:"0",role:"button",onKeyPress:g,"aria-label":Object(s.__)("Dismiss this notice")},Object(r.createElement)("div",{className:"components-snackbar__content"},u,y.map((function(e,t){var n=e.label,o=e.onClick,a=e.url;return Object(r.createElement)(l.a,{key:t,href:a,isTertiary:!0,onClick:function(e){e.stopPropagation(),o&&o(e)},className:"components-snackbar__action"},n)}))))}))}).call(this,n(485))},function(e,t,n){"use strict";e.exports=n(816)},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(e,t,n){var r=n(386);e.exports=function(e){if(Array.isArray(e))return r(e)},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},e.exports.default=e.exports,e.exports.__esModule=!0},,,,,function(e,t,n){"use strict";var r=n(586);function o(){}function a(){}a.resetWarningCache=o,e.exports=function(){function e(e,t,n,o,a,i){if(i!==r){var c=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw c.name="Invariant Violation",c}}function t(){return e}e.isRequired=e;var n={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:a,resetWarningCache:o};return n.PropTypes=n,n}},function(e,t,n){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},function(e,t,n){n(588)},function(e,t,n){"use strict";var r;(0,((r=n(589))&&r.__esModule?r:{default:r}).default)()},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){(0,o.default)(r.default)};var r=a(n(590)),o=a(n(638));function a(e){return e&&e.__esModule?e:{default:e}}},function(e,t,n){e.exports=n(591).default},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});var r=s(n(592)),o=s(n(634)),a=n(635),i=s(n(636)),c=s(n(637));function s(e){return e&&e.__esModule?e:{default:e}}t.default={create:function(e){var t={},n=Object.keys(e),r=(o.default.get(a.GLOBAL_CACHE_KEY)||{}).namespace,c=void 0===r?"":r;return n.forEach((function(e){var n=(0,i.default)(c,e);t[e]=n})),t},resolve:function(e){var t=(0,r.default)(e,1/0),n=(0,c.default)(t),o=n.classNames,a=n.hasInlineStyles,i=n.inlineStyles,s={className:o.map((function(e,t){return String(e)+" "+String(e)+"_"+String(t+1)})).join(" ")};return a&&(s.style=i),s}}},function(e,t,n){"use strict";var r=n(176),o=n(245),a=n(393),i=n(408),c=i(),s=n(633),l=o(c);r(l,{getPolyfill:i,implementation:a,shim:s}),e.exports=l},function(e,t,n){"use strict";var r;if(!Object.keys){var o=Object.prototype.hasOwnProperty,a=Object.prototype.toString,i=n(391),c=Object.prototype.propertyIsEnumerable,s=!c.call({toString:null},"toString"),l=c.call((function(){}),"prototype"),u=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],d=function(e){var t=e.constructor;return t&&t.prototype===e},f={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},p=function(){if("undefined"==typeof window)return!1;for(var e in window)try{if(!f["$"+e]&&o.call(window,e)&&null!==window[e]&&"object"==typeof window[e])try{d(window[e])}catch(e){return!0}}catch(e){return!0}return!1}();r=function(e){var t=null!==e&&"object"==typeof e,n="[object Function]"===a.call(e),r=i(e),c=t&&"[object String]"===a.call(e),f=[];if(!t&&!n&&!r)throw new TypeError("Object.keys called on a non-object");var h=l&&n;if(c&&e.length>0&&!o.call(e,0))for(var m=0;m<e.length;++m)f.push(String(m));if(r&&e.length>0)for(var y=0;y<e.length;++y)f.push(String(y));else for(var b in e)h&&"prototype"===b||!o.call(e,b)||f.push(String(b));if(s)for(var g=function(e){if("undefined"==typeof window||!p)return d(e);try{return d(e)}catch(e){return!1}}(e),v=0;v<u.length;++v)g&&"constructor"===u[v]||!o.call(e,u[v])||f.push(u[v]);return f}}e.exports=r},function(e,t,n){"use strict";var r="Function.prototype.bind called on incompatible ",o=Array.prototype.slice,a=Object.prototype.toString;e.exports=function(e){var t=this;if("function"!=typeof t||"[object Function]"!==a.call(t))throw new TypeError(r+t);for(var n,i=o.call(arguments,1),c=function(){if(this instanceof n){var r=t.apply(this,i.concat(o.call(arguments)));return Object(r)===r?r:this}return t.apply(e,i.concat(o.call(arguments)))},s=Math.max(0,t.length-i.length),l=[],u=0;u<s;u++)l.push("$"+u);if(n=Function("binder","return function ("+l.join(",")+"){ return binder.apply(this,arguments); }")(c),t.prototype){var d=function(){};d.prototype=t.prototype,n.prototype=new d,d.prototype=null}return n}},function(e,t,n){"use strict";var r=n(81),o=r("%Array%"),a=r("%Symbol.species%",!0),i=r("%TypeError%"),c=n(291),s=n(292),l=n(598),u=n(604),d=n(147);e.exports=function(e,t){if(!u(t)||t<0)throw new i("Assertion failed: length must be an integer >= 0");var n,r=0===t?0:t;if(s(e)&&(n=c(e,"constructor"),a&&"Object"===d(n)&&null===(n=c(n,a))&&(n=void 0)),void 0===n)return o(r);if(!l(n))throw new i("C must be a constructor");return new n(r)}},function(e,t,n){var r="function"==typeof Map&&Map.prototype,o=Object.getOwnPropertyDescriptor&&r?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,a=r&&o&&"function"==typeof o.get?o.get:null,i=r&&Map.prototype.forEach,c="function"==typeof Set&&Set.prototype,s=Object.getOwnPropertyDescriptor&&c?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,l=c&&s&&"function"==typeof s.get?s.get:null,u=c&&Set.prototype.forEach,d="function"==typeof WeakMap&&WeakMap.prototype?WeakMap.prototype.has:null,f="function"==typeof WeakSet&&WeakSet.prototype?WeakSet.prototype.has:null,p="function"==typeof WeakRef&&WeakRef.prototype?WeakRef.prototype.deref:null,h=Boolean.prototype.valueOf,m=Object.prototype.toString,y=Function.prototype.toString,b=String.prototype.match,g="function"==typeof BigInt?BigInt.prototype.valueOf:null,v=Object.getOwnPropertySymbols,O="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?Symbol.prototype.toString:null,w="function"==typeof Symbol&&"object"==typeof Symbol.iterator,_=Object.prototype.propertyIsEnumerable,k=("function"==typeof Reflect?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(e){return e.__proto__}:null),S=n(121).custom,j=S&&x(S)?S:null,E="function"==typeof Symbol&&void 0!==Symbol.toStringTag?Symbol.toStringTag:null;function C(e,t,n){var r="double"===(n.quoteStyle||t)?'"':"'";return r+e+r}function D(e){return String(e).replace(/"/g,"&quot;")}function P(e){return!("[object Array]"!==M(e)||E&&"object"==typeof e&&E in e)}function x(e){if(w)return e&&"object"==typeof e&&e instanceof Symbol;if("symbol"==typeof e)return!0;if(!e||"object"!=typeof e||!O)return!1;try{return O.call(e),!0}catch(e){}return!1}e.exports=function e(t,n,r,o){var c=n||{};if(T(c,"quoteStyle")&&"single"!==c.quoteStyle&&"double"!==c.quoteStyle)throw new TypeError('option "quoteStyle" must be "single" or "double"');if(T(c,"maxStringLength")&&("number"==typeof c.maxStringLength?c.maxStringLength<0&&c.maxStringLength!==1/0:null!==c.maxStringLength))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var s=!T(c,"customInspect")||c.customInspect;if("boolean"!=typeof s)throw new TypeError('option "customInspect", if provided, must be `true` or `false`');if(T(c,"indent")&&null!==c.indent&&"\t"!==c.indent&&!(parseInt(c.indent,10)===c.indent&&c.indent>0))throw new TypeError('options "indent" must be "\\t", an integer > 0, or `null`');if(void 0===t)return"undefined";if(null===t)return"null";if("boolean"==typeof t)return t?"true":"false";if("string"==typeof t)return function e(t,n){if(t.length>n.maxStringLength){var r=t.length-n.maxStringLength,o="... "+r+" more character"+(r>1?"s":"");return e(t.slice(0,n.maxStringLength),n)+o}return C(t.replace(/(['\\])/g,"\\$1").replace(/[\x00-\x1f]/g,I),"single",n)}(t,c);if("number"==typeof t)return 0===t?1/0/t>0?"0":"-0":String(t);if("bigint"==typeof t)return String(t)+"n";var m=void 0===c.depth?5:c.depth;if(void 0===r&&(r=0),r>=m&&m>0&&"object"==typeof t)return P(t)?"[Array]":"[Object]";var v,_=function(e,t){var n;if("\t"===e.indent)n="\t";else{if(!("number"==typeof e.indent&&e.indent>0))return null;n=Array(e.indent+1).join(" ")}return{base:n,prev:Array(t+1).join(n)}}(c,r);if(void 0===o)o=[];else if(R(o,t)>=0)return"[Circular]";function S(t,n,a){if(n&&(o=o.slice()).push(n),a){var i={depth:c.depth};return T(c,"quoteStyle")&&(i.quoteStyle=c.quoteStyle),e(t,i,r+1,o)}return e(t,c,r+1,o)}if("function"==typeof t){var F=function(e){if(e.name)return e.name;var t=b.call(y.call(e),/^function\s*([\w$]+)/);return t?t[1]:null}(t),H=B(t,S);return"[Function"+(F?": "+F:" (anonymous)")+"]"+(H.length>0?" { "+H.join(", ")+" }":"")}if(x(t)){var q=w?String(t).replace(/^(Symbol\(.*\))_[^)]*$/,"$1"):O.call(t);return"object"!=typeof t||w?q:A(q)}if((v=t)&&"object"==typeof v&&("undefined"!=typeof HTMLElement&&v instanceof HTMLElement||"string"==typeof v.nodeName&&"function"==typeof v.getAttribute)){for(var z="<"+String(t.nodeName).toLowerCase(),V=t.attributes||[],K=0;K<V.length;K++)z+=" "+V[K].name+"="+C(D(V[K].value),"double",c);return z+=">",t.childNodes&&t.childNodes.length&&(z+="..."),z+"</"+String(t.nodeName).toLowerCase()+">"}if(P(t)){if(0===t.length)return"[]";var W=B(t,S);return _&&!function(e){for(var t=0;t<e.length;t++)if(R(e[t],"\n")>=0)return!1;return!0}(W)?"["+U(W,_)+"]":"[ "+W.join(", ")+" ]"}if(function(e){return!("[object Error]"!==M(e)||E&&"object"==typeof e&&E in e)}(t)){var G=B(t,S);return 0===G.length?"["+String(t)+"]":"{ ["+String(t)+"] "+G.join(", ")+" }"}if("object"==typeof t&&s){if(j&&"function"==typeof t[j])return t[j]();if("function"==typeof t.inspect)return t.inspect()}if(function(e){if(!a||!e||"object"!=typeof e)return!1;try{a.call(e);try{l.call(e)}catch(e){return!0}return e instanceof Map}catch(e){}return!1}(t)){var Y=[];return i.call(t,(function(e,n){Y.push(S(n,t,!0)+" => "+S(e,t))})),L("Map",a.call(t),Y,_)}if(function(e){if(!l||!e||"object"!=typeof e)return!1;try{l.call(e);try{a.call(e)}catch(e){return!0}return e instanceof Set}catch(e){}return!1}(t)){var $=[];return u.call(t,(function(e){$.push(S(e,t))})),L("Set",l.call(t),$,_)}if(function(e){if(!d||!e||"object"!=typeof e)return!1;try{d.call(e,d);try{f.call(e,f)}catch(e){return!0}return e instanceof WeakMap}catch(e){}return!1}(t))return N("WeakMap");if(function(e){if(!f||!e||"object"!=typeof e)return!1;try{f.call(e,f);try{d.call(e,d)}catch(e){return!0}return e instanceof WeakSet}catch(e){}return!1}(t))return N("WeakSet");if(function(e){if(!p||!e||"object"!=typeof e)return!1;try{return p.call(e),!0}catch(e){}return!1}(t))return N("WeakRef");if(function(e){return!("[object Number]"!==M(e)||E&&"object"==typeof e&&E in e)}(t))return A(S(Number(t)));if(function(e){if(!e||"object"!=typeof e||!g)return!1;try{return g.call(e),!0}catch(e){}return!1}(t))return A(S(g.call(t)));if(function(e){return!("[object Boolean]"!==M(e)||E&&"object"==typeof e&&E in e)}(t))return A(h.call(t));if(function(e){return!("[object String]"!==M(e)||E&&"object"==typeof e&&E in e)}(t))return A(S(String(t)));if(!function(e){return!("[object Date]"!==M(e)||E&&"object"==typeof e&&E in e)}(t)&&!function(e){return!("[object RegExp]"!==M(e)||E&&"object"==typeof e&&E in e)}(t)){var Q=B(t,S),J=k?k(t)===Object.prototype:t instanceof Object||t.constructor===Object,Z=t instanceof Object?"":"null prototype",X=!J&&E&&Object(t)===t&&E in t?M(t).slice(8,-1):Z?"Object":"",ee=(J||"function"!=typeof t.constructor?"":t.constructor.name?t.constructor.name+" ":"")+(X||Z?"["+[].concat(X||[],Z||[]).join(": ")+"] ":"");return 0===Q.length?ee+"{}":_?ee+"{"+U(Q,_)+"}":ee+"{ "+Q.join(", ")+" }"}return String(t)};var F=Object.prototype.hasOwnProperty||function(e){return e in this};function T(e,t){return F.call(e,t)}function M(e){return m.call(e)}function R(e,t){if(e.indexOf)return e.indexOf(t);for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return-1}function I(e){var t=e.charCodeAt(0),n={8:"b",9:"t",10:"n",12:"f",13:"r"}[t];return n?"\\"+n:"\\x"+(t<16?"0":"")+t.toString(16).toUpperCase()}function A(e){return"Object("+e+")"}function N(e){return e+" { ? }"}function L(e,t,n,r){return e+" ("+t+") {"+(r?U(n,r):n.join(", "))+"}"}function U(e,t){if(0===e.length)return"";var n="\n"+t.prev+t.base;return n+e.join(","+n)+"\n"+t.prev}function B(e,t){var n=P(e),r=[];if(n){r.length=e.length;for(var o=0;o<e.length;o++)r[o]=T(e,o)?t(e[o],e):""}var a,i="function"==typeof v?v(e):[];if(w){a={};for(var c=0;c<i.length;c++)a["$"+i[c]]=i[c]}for(var s in e)T(e,s)&&(n&&String(Number(s))===s&&s<e.length||w&&a["$"+s]instanceof Symbol||(/[^\w$]/.test(s)?r.push(t(s,e)+": "+t(e[s],e)):r.push(s+": "+t(e[s],e))));if("function"==typeof v)for(var l=0;l<i.length;l++)_.call(e,i[l])&&r.push("["+t(i[l])+"]: "+t(e[i[l]],e));return r}},function(e,t,n){"use strict";e.exports=function(e){return null===e?"Null":void 0===e?"Undefined":"function"==typeof e||"object"==typeof e?"Object":"number"==typeof e?"Number":"boolean"==typeof e?"Boolean":"string"==typeof e?"String":void 0}},function(e,t,n){"use strict";var r=n(599)("%Reflect.construct%",!0),o=n(600);try{o({},"",{"[[Get]]":function(){}})}catch(e){o=null}if(o&&r){var a={},i={};o(i,"length",{"[[Get]]":function(){throw a},"[[Enumerable]]":!0}),e.exports=function(e){try{r(e,i)}catch(e){return e===a}}}else e.exports=function(e){return"function"==typeof e&&!!e.prototype}},function(e,t,n){"use strict";e.exports=n(81)},function(e,t,n){"use strict";var r=n(81)("%TypeError%"),o=n(601),a=n(394),i=n(395),c=n(602),s=n(396),l=n(224),u=n(397),d=n(398),f=n(147);e.exports=function(e,t,n){if("Object"!==f(e))throw new r("Assertion failed: Type(O) is not Object");if(!l(t))throw new r("Assertion failed: IsPropertyKey(P) is not true");var p=o({Type:f,IsDataDescriptor:s,IsAccessorDescriptor:c},n)?n:d(n);if(!o({Type:f,IsDataDescriptor:s,IsAccessorDescriptor:c},p))throw new r("Assertion failed: Desc is not a valid Property Descriptor");return a(s,u,i,e,t,p)}},function(e,t,n){"use strict";var r=n(81),o=n(211),a=r("%TypeError%");e.exports=function(e,t){if("Object"!==e.Type(t))return!1;var n={"[[Configurable]]":!0,"[[Enumerable]]":!0,"[[Get]]":!0,"[[Set]]":!0,"[[Value]]":!0,"[[Writable]]":!0};for(var r in t)if(o(t,r)&&!n[r])return!1;if(e.IsDataDescriptor(t)&&e.IsAccessorDescriptor(t))throw new a("Property Descriptors may not be both accessor and data descriptors");return!0}},function(e,t,n){"use strict";var r=n(211),o=n(330),a=n(147);e.exports=function(e){return void 0!==e&&(o(a,"Property Descriptor","Desc",e),!(!r(e,"[[Get]]")&&!r(e,"[[Set]]")))}},function(e,t,n){"use strict";e.exports=n(332)},function(e,t,n){"use strict";var r=n(605),o=n(606),a=n(331),i=n(400);e.exports=function(e){if("number"!=typeof e||a(e)||!i(e))return!1;var t=r(e);return o(t)===t}},function(e,t,n){"use strict";var r=n(81)("%Math.abs%");e.exports=function(e){return r(e)}},function(e,t,n){"use strict";var r=Math.floor;e.exports=function(e){return r(e)}},function(e,t,n){"use strict";var r=n(81)("%TypeError%"),o=n(401),a=n(608),i=n(609),c=n(291),s=n(616),l=n(292),u=n(617),d=n(630);e.exports=function e(t,n,f,p,h){var m;arguments.length>5&&(m=arguments[5]);for(var y=p,b=0;b<f;){var g=d(b),v=s(n,g);if(!0===v){var O=c(n,g);if(void 0!==m){if(arguments.length<=6)throw new r("Assertion failed: thisArg is required when mapperFunction is provided");O=a(m,arguments[6],[O,b,n])}var w=!1;if(h>0&&(w=l(O)),w){var _=u(O);y=e(t,O,_,y,h-1)}else{if(y>=o)throw new r("index too large");i(t,d(y),O),y+=1}}b+=1}return y}},function(e,t,n){"use strict";var r=n(81),o=n(185),a=r("%TypeError%"),i=n(292),c=r("%Reflect.apply%",!0)||o("%Function.prototype.apply%");e.exports=function(e,t){var n=arguments.length>2?arguments[2]:[];if(!i(n))throw new a("Assertion failed: optional `argumentsList`, if provided, must be a List");return c(e,t,n)}},function(e,t,n){"use strict";var r=n(81)("%TypeError%"),o=n(610),a=n(224),i=n(147);e.exports=function(e,t,n){if("Object"!==i(e))throw new r("Assertion failed: Type(O) is not Object");if(!a(t))throw new r("Assertion failed: IsPropertyKey(P) is not true");var c=o(e,t,n);if(!c)throw new r("unable to create data property");return c}},function(e,t,n){"use strict";var r=n(81)("%TypeError%"),o=n(394),a=n(395),i=n(611),c=n(396),s=n(615),l=n(224),u=n(397),d=n(147);e.exports=function(e,t,n){if("Object"!==d(e))throw new r("Assertion failed: Type(O) is not Object");if(!l(t))throw new r("Assertion failed: IsPropertyKey(P) is not true");var f=i(e,t),p=!f||s(e);return!(f&&(!f["[[Writable]]"]||!f["[[Configurable]]"])||!p)&&o(c,u,a,e,t,{"[[Configurable]]":!0,"[[Enumerable]]":!0,"[[Value]]":n,"[[Writable]]":!0})}},function(e,t,n){"use strict";var r=n(81),o=n(612),a=r("%TypeError%"),i=n(185)("Object.prototype.propertyIsEnumerable"),c=n(211),s=n(292),l=n(224),u=n(613),d=n(398),f=n(147);e.exports=function(e,t){if("Object"!==f(e))throw new a("Assertion failed: O must be an Object");if(!l(t))throw new a("Assertion failed: P must be a Property Key");if(c(e,t)){if(!o){var n=s(e)&&"length"===t,r=u(e)&&"lastIndex"===t;return{"[[Configurable]]":!(n||r),"[[Enumerable]]":i(e,t),"[[Value]]":e[t],"[[Writable]]":!0}}return d(o(e,t))}}},function(e,t,n){"use strict";var r=n(81)("%Object.getOwnPropertyDescriptor%");if(r)try{r([],"length")}catch(e){r=null}e.exports=r},function(e,t,n){"use strict";var r=n(81)("%Symbol.match%",!0),o=n(614),a=n(399);e.exports=function(e){if(!e||"object"!=typeof e)return!1;if(r){var t=e[r];if(void 0!==t)return a(t)}return o(e)}},function(e,t,n){"use strict";var r,o,a,i,c=n(185),s=n(329)()&&!!Symbol.toStringTag;if(s){r=c("Object.prototype.hasOwnProperty"),o=c("RegExp.prototype.exec"),a={};var l=function(){throw a};i={toString:l,valueOf:l},"symbol"==typeof Symbol.toPrimitive&&(i[Symbol.toPrimitive]=l)}var u=c("Object.prototype.toString"),d=Object.getOwnPropertyDescriptor;e.exports=s?function(e){if(!e||"object"!=typeof e)return!1;var t=d(e,"lastIndex");if(!t||!r(t,"value"))return!1;try{o(e,i)}catch(e){return e===a}}:function(e){return!(!e||"object"!=typeof e&&"function"!=typeof e)&&"[object RegExp]"===u(e)}},function(e,t,n){"use strict";var r=n(81)("%Object%"),o=n(402),a=r.preventExtensions,i=r.isExtensible;e.exports=a?function(e){return!o(e)&&i(e)}:function(e){return!o(e)}},function(e,t,n){"use strict";var r=n(81)("%TypeError%"),o=n(224),a=n(147);e.exports=function(e,t){if("Object"!==a(e))throw new r("Assertion failed: `O` must be an Object");if(!o(t))throw new r("Assertion failed: `P` must be a Property Key");return t in e}},function(e,t,n){"use strict";var r=n(81)("%TypeError%"),o=n(291),a=n(403),i=n(147);e.exports=function(e){if("Object"!==i(e))throw new r("Assertion failed: `obj` must be an Object");return a(o(e,"length"))}},function(e,t,n){"use strict";var r=n(619),o=n(620),a=n(621),i=n(331),c=n(400),s=n(624);e.exports=function(e){var t=a(e);return i(t)?0:0!==t&&c(t)?s(t)*o(r(t)):t}},function(e,t,n){"use strict";var r=n(81)("%Math.abs%");e.exports=function(e){return r(e)}},function(e,t,n){"use strict";var r=Math.floor;e.exports=function(e){return r(e)}},function(e,t,n){"use strict";var r=n(622);e.exports=function(e){var t=r(e,Number);if("string"!=typeof t)return+t;var n=t.replace(/^[ \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u0085]+|[ \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u0085]+$/g,"");return/^0[ob]|^[+-]0x/.test(n)?NaN:+n}},function(e,t,n){"use strict";e.exports=n(623)},function(e,t,n){"use strict";var r=Object.prototype.toString,o=n(405),a=n(332),i=function(e){var t;if((t=arguments.length>1?arguments[1]:"[object Date]"===r.call(e)?String:Number)===String||t===Number){var n,i,c=t===String?["toString","valueOf"]:["valueOf","toString"];for(i=0;i<c.length;++i)if(a(e[c[i]])&&(n=e[c[i]](),o(n)))return n;throw new TypeError("No default value")}throw new TypeError("invalid [[DefaultValue]] hint supplied")};e.exports=function(e){return o(e)?e:arguments.length>1?i(e,arguments[1]):i(e)}},function(e,t,n){"use strict";e.exports=function(e){return e>=0?1:-1}},function(e,t,n){"use strict";var r=n(81),o=r("%TypeError%"),a=r("%Number%"),i=r("%RegExp%"),c=r("%parseInt%"),s=n(185),l=n(626),u=n(402),d=s("String.prototype.slice"),f=l(/^0b[01]+$/i),p=l(/^0o[0-7]+$/i),h=l(/^[-+]0x[0-9a-f]+$/i),m=l(new i("["+["…","​","￾"].join("")+"]","g")),y=["\t\n\v\f\r   ᠎    ","          \u2028","\u2029\ufeff"].join(""),b=new RegExp("(^["+y+"]+)|(["+y+"]+$)","g"),g=s("String.prototype.replace"),v=n(627);e.exports=function e(t){var n=u(t)?t:v(t,a);if("symbol"==typeof n)throw new o("Cannot convert a Symbol value to a number");if("bigint"==typeof n)throw new o("Conversion from 'BigInt' to 'number' is not allowed.");if("string"==typeof n){if(f(n))return e(c(d(n,2),2));if(p(n))return e(c(d(n,2),8));if(m(n)||h(n))return NaN;var r=function(e){return g(e,b,"")}(n);if(r!==n)return e(r)}return a(n)}},function(e,t,n){"use strict";var r=n(81)("RegExp.prototype.test"),o=n(245);e.exports=function(e){return o(r,e)}},function(e,t,n){"use strict";var r=n(628);e.exports=function(e){return arguments.length>1?r(e,arguments[1]):r(e)}},function(e,t,n){"use strict";var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator,o=n(405),a=n(332),i=n(629),c=n(406),s=function(e,t){if(null==e)throw new TypeError("Cannot call method on "+e);if("string"!=typeof t||"number"!==t&&"string"!==t)throw new TypeError('hint must be "string" or "number"');var n,r,i,c="string"===t?["toString","valueOf"]:["valueOf","toString"];for(i=0;i<c.length;++i)if(n=e[c[i]],a(n)&&(r=n.call(e),o(r)))return r;throw new TypeError("No default value")},l=function(e,t){var n=e[t];if(null!=n){if(!a(n))throw new TypeError(n+" returned for property "+t+" of object "+e+" is not a function");return n}};e.exports=function(e){if(o(e))return e;var t,n="default";if(arguments.length>1&&(arguments[1]===String?n="string":arguments[1]===Number&&(n="number")),r&&(Symbol.toPrimitive?t=l(e,Symbol.toPrimitive):c(e)&&(t=Symbol.prototype.valueOf)),void 0!==t){var a=t.call(e,n);if(o(a))return a;throw new TypeError("unable to convert exotic object to primitive")}return"default"===n&&(i(e)||c(e))&&(n="string"),s(e,"default"===n?"number":n)}},function(e,t,n){"use strict";var r=Date.prototype.getDay,o=Object.prototype.toString,a="function"==typeof Symbol&&!!Symbol.toStringTag;e.exports=function(e){return"object"==typeof e&&null!==e&&(a?function(e){try{return r.call(e),!0}catch(e){return!1}}(e):"[object Date]"===o.call(e))}},function(e,t,n){"use strict";var r=n(81),o=r("%String%"),a=r("%TypeError%");e.exports=function(e){if("symbol"==typeof e)throw new a("Cannot convert a Symbol value to a string");return o(e)}},function(e,t,n){"use strict";var r=n(81)("%Object%"),o=n(407);e.exports=function(e){return o(e),r(e)}},function(e,t,n){"use strict";var r=n(81)("%TypeError%");e.exports=function(e,t){if(null==e)throw new r(t||"Cannot call method on "+e);return e}},function(e,t,n){"use strict";var r=n(176),o=n(408);e.exports=function(){var e=o();return r(Array.prototype,{flat:e},{flat:function(){return Array.prototype.flat!==e}}),e}},function(e,t,n){"use strict";(function(t){var r=n(176),o=n(406),a="__ global cache key __";"function"==typeof Symbol&&o(Symbol("foo"))&&"function"==typeof Symbol.for&&(a=Symbol.for(a));var i=function(){return!0},c=function(){if(!t[a]){var e={};e[a]={};var n={};n[a]=i,r(t,e,n)}return t[a]},s=c(),l=function(e){return o(e)?Symbol.prototype.valueOf.call(e):typeof e+" | "+String(e)},u=function(e){if(!function(e){return null===e||"object"!=typeof e&&"function"!=typeof e}(e))throw new TypeError("key must not be an object")},d={clear:function(){delete t[a],s=c()},delete:function(e){return u(e),delete s[l(e)],!d.has(e)},get:function(e){return u(e),s[l(e)]},has:function(e){return u(e),l(e)in s},set:function(e,t){u(e);var n=l(e),o={};o[n]=t;var a={};return a[n]=i,r(s,o,a),d.has(e)},setIfMissingThenGet:function(e,t){if(d.has(e))return d.get(e);var n=t();return d.set(e,n),n}};e.exports=d}).call(this,n(225))},function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.GLOBAL_CACHE_KEY="reactWithStylesInterfaceCSS",t.MAX_SPECIFICITY=20},function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){return(e.length>0?String(e)+"__":"")+String(t)}},function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){for(var t=[],n=!1,r={},o=0;o<e.length;o++){var a=e[o];a&&("string"==typeof a?t.push(a):(Object.assign(r,a),n=!0))}return{classNames:t,hasInlineStyles:n,inlineStyles:r}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){r.default.registerInterface(e),r.default.registerTheme(o.default)};var r=a(n(409)),o=a(n(410));function a(e){return e&&e.__esModule?e:{default:e}}},function(e,t,n){"use strict";var r=n(11),o="function"==typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103,a=n(411),i=n(640),c=n(641),s="function"==typeof Symbol&&Symbol.iterator;function l(e,t){return e&&"object"==typeof e&&null!=e.key?(n=e.key,r={"=":"=0",":":"=2"},"$"+(""+n).replace(/[=:]/g,(function(e){return r[e]}))):t.toString(36);var n,r}var u=/\/+/g;function d(e){return(""+e).replace(u,"$&/")}var f,p,h=m,m=function(e){if(this.instancePool.length){var t=this.instancePool.pop();return this.call(t,e),t}return new this(e)};function y(e,t,n,r){this.result=e,this.keyPrefix=t,this.func=n,this.context=r,this.count=0}function b(e,t,n){var o,i,c=e.result,s=e.keyPrefix,l=e.func,u=e.context,f=l.call(u,t,e.count++);Array.isArray(f)?g(f,c,n,a.thatReturnsArgument):null!=f&&(r.isValidElement(f)&&(o=f,i=s+(!f.key||t&&t.key===f.key?"":d(f.key)+"/")+n,f=r.cloneElement(o,{key:i},void 0!==o.props?o.props.children:void 0)),c.push(f))}function g(e,t,n,r,a){var c="";null!=n&&(c=d(n)+"/");var u=y.getPooled(t,c,r,a);!function(e,t,n){null==e||function e(t,n,r,a){var c,u=typeof t;if("undefined"!==u&&"boolean"!==u||(t=null),null===t||"string"===u||"number"===u||"object"===u&&t.$$typeof===o)return r(a,t,""===n?"."+l(t,0):n),1;var d=0,f=""===n?".":n+":";if(Array.isArray(t))for(var p=0;p<t.length;p++)d+=e(c=t[p],f+l(c,p),r,a);else{var h=function(e){var t=e&&(s&&e[s]||e["@@iterator"]);if("function"==typeof t)return t}(t);if(h)for(var m,y=h.call(t),b=0;!(m=y.next()).done;)d+=e(c=m.value,f+l(c,b++),r,a);else if("object"===u){var g=""+t;i(!1,"Objects are not valid as a React child (found: %s).%s","[object Object]"===g?"object with keys {"+Object.keys(t).join(", ")+"}":g,"")}}return d}(e,"",t,n)}(e,b,u),y.release(u)}y.prototype.destructor=function(){this.result=null,this.keyPrefix=null,this.func=null,this.context=null,this.count=0},f=function(e,t,n,r){if(this.instancePool.length){var o=this.instancePool.pop();return this.call(o,e,t,n,r),o}return new this(e,t,n,r)},(p=y).instancePool=[],p.getPooled=f||h,p.poolSize||(p.poolSize=10),p.release=function(e){i(e instanceof this,"Trying to release an instance into a pool of a different type."),e.destructor(),this.instancePool.length<this.poolSize&&this.instancePool.push(e)},e.exports=function(e){if("object"!=typeof e||!e||Array.isArray(e))return c(!1,"React.addons.createFragment only accepts a single object. Got: %s",e),e;if(r.isValidElement(e))return c(!1,"React.addons.createFragment does not accept a ReactElement without a wrapper object."),e;i(1!==e.nodeType,"React.addons.createFragment(...): Encountered an invalid child; DOM elements are not valid children of React components.");var t=[];for(var n in e)g(e[n],t,n,a.thatReturnsArgument);return t}},function(e,t,n){"use strict";e.exports=function(e,t,n,r,o,a,i,c){if(!e){var s;if(void 0===t)s=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var l=[n,r,o,a,i,c],u=0;(s=new Error(t.replace(/%s/g,(function(){return l[u++]})))).name="Invariant Violation"}throw s.framesToPop=1,s}}},function(e,t,n){"use strict";var r=n(411);e.exports=r},function(e,t,n){"use strict";function r(e){return e.match(/^\{\{\//)?{type:"componentClose",value:e.replace(/\W/g,"")}:e.match(/\/\}\}$/)?{type:"componentSelfClosing",value:e.replace(/\W/g,"")}:e.match(/^\{\{/)?{type:"componentOpen",value:e.replace(/\W/g,"")}:{type:"string",value:e}}e.exports=function(e){return e.split(/(\{\{\/?\s*\w+\s*\/?\}\})/g).map(r)}},function(e,t,n){"use strict";var r=n(412),o=n(333),a=Object.prototype.hasOwnProperty,i={brackets:function(e){return e+"[]"},comma:"comma",indices:function(e,t){return e+"["+t+"]"},repeat:function(e){return e}},c=Array.isArray,s=Array.prototype.push,l=function(e,t){s.apply(e,c(t)?t:[t])},u=Date.prototype.toISOString,d=o.default,f={addQueryPrefix:!1,allowDots:!1,charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encoder:r.encode,encodeValuesOnly:!1,format:d,formatter:o.formatters[d],indices:!1,serializeDate:function(e){return u.call(e)},skipNulls:!1,strictNullHandling:!1},p=function e(t,n,o,a,i,s,u,d,p,h,m,y,b,g){var v,O=t;if("function"==typeof u?O=u(n,O):O instanceof Date?O=h(O):"comma"===o&&c(O)&&(O=r.maybeMap(O,(function(e){return e instanceof Date?h(e):e}))),null===O){if(a)return s&&!b?s(n,f.encoder,g,"key",m):n;O=""}if("string"==typeof(v=O)||"number"==typeof v||"boolean"==typeof v||"symbol"==typeof v||"bigint"==typeof v||r.isBuffer(O))return s?[y(b?n:s(n,f.encoder,g,"key",m))+"="+y(s(O,f.encoder,g,"value",m))]:[y(n)+"="+y(String(O))];var w,_=[];if(void 0===O)return _;if("comma"===o&&c(O))w=[{value:O.length>0?O.join(",")||null:void 0}];else if(c(u))w=u;else{var k=Object.keys(O);w=d?k.sort(d):k}for(var S=0;S<w.length;++S){var j=w[S],E="object"==typeof j&&void 0!==j.value?j.value:O[j];if(!i||null!==E){var C=c(O)?"function"==typeof o?o(n,j):n:n+(p?"."+j:"["+j+"]");l(_,e(E,C,o,a,i,s,u,d,p,h,m,y,b,g))}}return _};e.exports=function(e,t){var n,r=e,s=function(e){if(!e)return f;if(null!==e.encoder&&void 0!==e.encoder&&"function"!=typeof e.encoder)throw new TypeError("Encoder has to be a function.");var t=e.charset||f.charset;if(void 0!==e.charset&&"utf-8"!==e.charset&&"iso-8859-1"!==e.charset)throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var n=o.default;if(void 0!==e.format){if(!a.call(o.formatters,e.format))throw new TypeError("Unknown format option provided.");n=e.format}var r=o.formatters[n],i=f.filter;return("function"==typeof e.filter||c(e.filter))&&(i=e.filter),{addQueryPrefix:"boolean"==typeof e.addQueryPrefix?e.addQueryPrefix:f.addQueryPrefix,allowDots:void 0===e.allowDots?f.allowDots:!!e.allowDots,charset:t,charsetSentinel:"boolean"==typeof e.charsetSentinel?e.charsetSentinel:f.charsetSentinel,delimiter:void 0===e.delimiter?f.delimiter:e.delimiter,encode:"boolean"==typeof e.encode?e.encode:f.encode,encoder:"function"==typeof e.encoder?e.encoder:f.encoder,encodeValuesOnly:"boolean"==typeof e.encodeValuesOnly?e.encodeValuesOnly:f.encodeValuesOnly,filter:i,format:n,formatter:r,serializeDate:"function"==typeof e.serializeDate?e.serializeDate:f.serializeDate,skipNulls:"boolean"==typeof e.skipNulls?e.skipNulls:f.skipNulls,sort:"function"==typeof e.sort?e.sort:null,strictNullHandling:"boolean"==typeof e.strictNullHandling?e.strictNullHandling:f.strictNullHandling}}(t);"function"==typeof s.filter?r=(0,s.filter)("",r):c(s.filter)&&(n=s.filter);var u,d=[];if("object"!=typeof r||null===r)return"";u=t&&t.arrayFormat in i?t.arrayFormat:t&&"indices"in t?t.indices?"indices":"repeat":"indices";var h=i[u];n||(n=Object.keys(r)),s.sort&&n.sort(s.sort);for(var m=0;m<n.length;++m){var y=n[m];s.skipNulls&&null===r[y]||l(d,p(r[y],y,h,s.strictNullHandling,s.skipNulls,s.encode?s.encoder:null,s.filter,s.sort,s.allowDots,s.serializeDate,s.format,s.formatter,s.encodeValuesOnly,s.charset))}var b=d.join(s.delimiter),g=!0===s.addQueryPrefix?"?":"";return s.charsetSentinel&&("iso-8859-1"===s.charset?g+="utf8=%26%2310003%3B&":g+="utf8=%E2%9C%93&"),b.length>0?g+b:""}},function(e,t,n){"use strict";var r=n(412),o=Object.prototype.hasOwnProperty,a=Array.isArray,i={allowDots:!1,allowPrototypes:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decoder:r.decode,delimiter:"&",depth:5,ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictNullHandling:!1},c=function(e){return e.replace(/&#(\d+);/g,(function(e,t){return String.fromCharCode(parseInt(t,10))}))},s=function(e,t){return e&&"string"==typeof e&&t.comma&&e.indexOf(",")>-1?e.split(","):e},l=function(e,t,n,r){if(e){var a=n.allowDots?e.replace(/\.([^.[]+)/g,"[$1]"):e,i=/(\[[^[\]]*])/g,c=n.depth>0&&/(\[[^[\]]*])/.exec(a),l=c?a.slice(0,c.index):a,u=[];if(l){if(!n.plainObjects&&o.call(Object.prototype,l)&&!n.allowPrototypes)return;u.push(l)}for(var d=0;n.depth>0&&null!==(c=i.exec(a))&&d<n.depth;){if(d+=1,!n.plainObjects&&o.call(Object.prototype,c[1].slice(1,-1))&&!n.allowPrototypes)return;u.push(c[1])}return c&&u.push("["+a.slice(c.index)+"]"),function(e,t,n,r){for(var o=r?t:s(t,n),a=e.length-1;a>=0;--a){var i,c=e[a];if("[]"===c&&n.parseArrays)i=[].concat(o);else{i=n.plainObjects?Object.create(null):{};var l="["===c.charAt(0)&&"]"===c.charAt(c.length-1)?c.slice(1,-1):c,u=parseInt(l,10);n.parseArrays||""!==l?!isNaN(u)&&c!==l&&String(u)===l&&u>=0&&n.parseArrays&&u<=n.arrayLimit?(i=[])[u]=o:i[l]=o:i={0:o}}o=i}return o}(u,t,n,r)}};e.exports=function(e,t){var n=function(e){if(!e)return i;if(null!==e.decoder&&void 0!==e.decoder&&"function"!=typeof e.decoder)throw new TypeError("Decoder has to be a function.");if(void 0!==e.charset&&"utf-8"!==e.charset&&"iso-8859-1"!==e.charset)throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var t=void 0===e.charset?i.charset:e.charset;return{allowDots:void 0===e.allowDots?i.allowDots:!!e.allowDots,allowPrototypes:"boolean"==typeof e.allowPrototypes?e.allowPrototypes:i.allowPrototypes,arrayLimit:"number"==typeof e.arrayLimit?e.arrayLimit:i.arrayLimit,charset:t,charsetSentinel:"boolean"==typeof e.charsetSentinel?e.charsetSentinel:i.charsetSentinel,comma:"boolean"==typeof e.comma?e.comma:i.comma,decoder:"function"==typeof e.decoder?e.decoder:i.decoder,delimiter:"string"==typeof e.delimiter||r.isRegExp(e.delimiter)?e.delimiter:i.delimiter,depth:"number"==typeof e.depth||!1===e.depth?+e.depth:i.depth,ignoreQueryPrefix:!0===e.ignoreQueryPrefix,interpretNumericEntities:"boolean"==typeof e.interpretNumericEntities?e.interpretNumericEntities:i.interpretNumericEntities,parameterLimit:"number"==typeof e.parameterLimit?e.parameterLimit:i.parameterLimit,parseArrays:!1!==e.parseArrays,plainObjects:"boolean"==typeof e.plainObjects?e.plainObjects:i.plainObjects,strictNullHandling:"boolean"==typeof e.strictNullHandling?e.strictNullHandling:i.strictNullHandling}}(t);if(""===e||null==e)return n.plainObjects?Object.create(null):{};for(var u="string"==typeof e?function(e,t){var n,l={},u=t.ignoreQueryPrefix?e.replace(/^\?/,""):e,d=t.parameterLimit===1/0?void 0:t.parameterLimit,f=u.split(t.delimiter,d),p=-1,h=t.charset;if(t.charsetSentinel)for(n=0;n<f.length;++n)0===f[n].indexOf("utf8=")&&("utf8=%E2%9C%93"===f[n]?h="utf-8":"utf8=%26%2310003%3B"===f[n]&&(h="iso-8859-1"),p=n,n=f.length);for(n=0;n<f.length;++n)if(n!==p){var m,y,b=f[n],g=b.indexOf("]="),v=-1===g?b.indexOf("="):g+1;-1===v?(m=t.decoder(b,i.decoder,h,"key"),y=t.strictNullHandling?null:""):(m=t.decoder(b.slice(0,v),i.decoder,h,"key"),y=r.maybeMap(s(b.slice(v+1),t),(function(e){return t.decoder(e,i.decoder,h,"value")}))),y&&t.interpretNumericEntities&&"iso-8859-1"===h&&(y=c(y)),b.indexOf("[]=")>-1&&(y=a(y)?[y]:y),o.call(l,m)?l[m]=r.combine(l[m],y):l[m]=y}return l}(e,n):e,d=n.plainObjects?Object.create(null):{},f=Object.keys(u),p=0;p<f.length;++p){var h=f[p],m=l(h,u[h],n,"string"==typeof e);d=r.merge(d,m,n)}return r.compact(d)}},function(e,t,n){var r=n(413);e.exports=function(e){if(Array.isArray(e))return r(e)},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,n){var r=n(413);e.exports=function(e,t){if(e){if("string"==typeof e)return r(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(e,t):void 0}},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},e.exports.default=e.exports,e.exports.__esModule=!0},function(e){e.exports=JSON.parse('[{"code":"AD","emoji":"🇦🇩","unicode":"U+1F1E6 U+1F1E9","name":"Andorra","title":"flag for Andorra","dialCode":"+376"},{"code":"AE","emoji":"🇦🇪","unicode":"U+1F1E6 U+1F1EA","name":"United Arab Emirates","title":"flag for United Arab Emirates","dialCode":"+971"},{"code":"AF","emoji":"🇦🇫","unicode":"U+1F1E6 U+1F1EB","name":"Afghanistan","title":"flag for Afghanistan","dialCode":"+93"},{"code":"AG","emoji":"🇦🇬","unicode":"U+1F1E6 U+1F1EC","name":"Antigua and Barbuda","title":"flag for Antigua and Barbuda","dialCode":"+1268"},{"code":"AI","emoji":"🇦🇮","unicode":"U+1F1E6 U+1F1EE","name":"Anguilla","title":"flag for Anguilla","dialCode":"+1 264"},{"code":"AL","emoji":"🇦🇱","unicode":"U+1F1E6 U+1F1F1","name":"Albania","title":"flag for Albania","dialCode":"+355"},{"code":"AM","emoji":"🇦🇲","unicode":"U+1F1E6 U+1F1F2","name":"Armenia","title":"flag for Armenia","dialCode":"+374"},{"code":"AO","emoji":"🇦🇴","unicode":"U+1F1E6 U+1F1F4","name":"Angola","title":"flag for Angola","dialCode":"+244"},{"code":"AQ","emoji":"🇦🇶","unicode":"U+1F1E6 U+1F1F6","name":"Antarctica","title":"flag for Antarctica","dialCode":null},{"code":"AR","emoji":"🇦🇷","unicode":"U+1F1E6 U+1F1F7","name":"Argentina","title":"flag for Argentina","dialCode":"+54"},{"code":"AS","emoji":"🇦🇸","unicode":"U+1F1E6 U+1F1F8","name":"American Samoa","title":"flag for American Samoa","dialCode":"+1 684"},{"code":"AT","emoji":"🇦🇹","unicode":"U+1F1E6 U+1F1F9","name":"Austria","title":"flag for Austria","dialCode":"+43"},{"code":"AU","emoji":"🇦🇺","unicode":"U+1F1E6 U+1F1FA","name":"Australia","title":"flag for Australia","dialCode":"+61"},{"code":"AW","emoji":"🇦🇼","unicode":"U+1F1E6 U+1F1FC","name":"Aruba","title":"flag for Aruba","dialCode":"+297"},{"code":"AX","emoji":"🇦🇽","unicode":"U+1F1E6 U+1F1FD","name":"Åland Islands","title":"flag for Åland Islands","dialCode":""},{"code":"AZ","emoji":"🇦🇿","unicode":"U+1F1E6 U+1F1FF","name":"Azerbaijan","title":"flag for Azerbaijan","dialCode":"+994"},{"code":"BA","emoji":"🇧🇦","unicode":"U+1F1E7 U+1F1E6","name":"Bosnia and Herzegovina","title":"flag for Bosnia and Herzegovina","dialCode":"+387"},{"code":"BB","emoji":"🇧🇧","unicode":"U+1F1E7 U+1F1E7","name":"Barbados","title":"flag for Barbados","dialCode":"+1 246"},{"code":"BD","emoji":"🇧🇩","unicode":"U+1F1E7 U+1F1E9","name":"Bangladesh","title":"flag for Bangladesh","dialCode":"+880"},{"code":"BE","emoji":"🇧🇪","unicode":"U+1F1E7 U+1F1EA","name":"Belgium","title":"flag for Belgium","dialCode":"+32"},{"code":"BF","emoji":"🇧🇫","unicode":"U+1F1E7 U+1F1EB","name":"Burkina Faso","title":"flag for Burkina Faso","dialCode":"+226"},{"code":"BG","emoji":"🇧🇬","unicode":"U+1F1E7 U+1F1EC","name":"Bulgaria","title":"flag for Bulgaria","dialCode":"+359"},{"code":"BH","emoji":"🇧🇭","unicode":"U+1F1E7 U+1F1ED","name":"Bahrain","title":"flag for Bahrain","dialCode":"+973"},{"code":"BI","emoji":"🇧🇮","unicode":"U+1F1E7 U+1F1EE","name":"Burundi","title":"flag for Burundi","dialCode":"+257"},{"code":"BJ","emoji":"🇧🇯","unicode":"U+1F1E7 U+1F1EF","name":"Benin","title":"flag for Benin","dialCode":"+229"},{"code":"BL","emoji":"🇧🇱","unicode":"U+1F1E7 U+1F1F1","name":"Saint Barthélemy","title":"flag for Saint Barthélemy","dialCode":"+590"},{"code":"BM","emoji":"🇧🇲","unicode":"U+1F1E7 U+1F1F2","name":"Bermuda","title":"flag for Bermuda","dialCode":"+1 441"},{"code":"BN","emoji":"🇧🇳","unicode":"U+1F1E7 U+1F1F3","name":"Brunei Darussalam","title":"flag for Brunei Darussalam","dialCode":"+673"},{"code":"BO","emoji":"🇧🇴","unicode":"U+1F1E7 U+1F1F4","name":"Bolivia","title":"flag for Bolivia","dialCode":"+591"},{"code":"BQ","emoji":"🇧🇶","unicode":"U+1F1E7 U+1F1F6","name":"Bonaire, Sint Eustatius and Saba","title":"flag for Bonaire, Sint Eustatius and Saba"},{"code":"BR","emoji":"🇧🇷","unicode":"U+1F1E7 U+1F1F7","name":"Brazil","title":"flag for Brazil","dialCode":"+55"},{"code":"BS","emoji":"🇧🇸","unicode":"U+1F1E7 U+1F1F8","name":"Bahamas","title":"flag for Bahamas","dialCode":"+1 242"},{"code":"BT","emoji":"🇧🇹","unicode":"U+1F1E7 U+1F1F9","name":"Bhutan","title":"flag for Bhutan","dialCode":"+975"},{"code":"BV","emoji":"🇧🇻","unicode":"U+1F1E7 U+1F1FB","name":"Bouvet Island","title":"flag for Bouvet Island"},{"code":"BW","emoji":"🇧🇼","unicode":"U+1F1E7 U+1F1FC","name":"Botswana","title":"flag for Botswana","dialCode":"+267"},{"code":"BY","emoji":"🇧🇾","unicode":"U+1F1E7 U+1F1FE","name":"Belarus","title":"flag for Belarus","dialCode":"+375"},{"code":"BZ","emoji":"🇧🇿","unicode":"U+1F1E7 U+1F1FF","name":"Belize","title":"flag for Belize","dialCode":"+501"},{"code":"CA","emoji":"🇨🇦","unicode":"U+1F1E8 U+1F1E6","name":"Canada","title":"flag for Canada","dialCode":"+1"},{"code":"CC","emoji":"🇨🇨","unicode":"U+1F1E8 U+1F1E8","name":"Cocos (Keeling) Islands","title":"flag for Cocos (Keeling) Islands","dialCode":"+61"},{"code":"CD","emoji":"🇨🇩","unicode":"U+1F1E8 U+1F1E9","name":"Congo","title":"flag for Congo","dialCode":"+243"},{"code":"CF","emoji":"🇨🇫","unicode":"U+1F1E8 U+1F1EB","name":"Central African Republic","title":"flag for Central African Republic","dialCode":"+236"},{"code":"CG","emoji":"🇨🇬","unicode":"U+1F1E8 U+1F1EC","name":"Congo","title":"flag for Congo","dialCode":"+242"},{"code":"CH","emoji":"🇨🇭","unicode":"U+1F1E8 U+1F1ED","name":"Switzerland","title":"flag for Switzerland","dialCode":"+41"},{"code":"CI","emoji":"🇨🇮","unicode":"U+1F1E8 U+1F1EE","name":"Côte D\'Ivoire","title":"flag for Côte D\'Ivoire","dialCode":"+225"},{"code":"CK","emoji":"🇨🇰","unicode":"U+1F1E8 U+1F1F0","name":"Cook Islands","title":"flag for Cook Islands","dialCode":"+682"},{"code":"CL","emoji":"🇨🇱","unicode":"U+1F1E8 U+1F1F1","name":"Chile","title":"flag for Chile","dialCode":"+56"},{"code":"CM","emoji":"🇨🇲","unicode":"U+1F1E8 U+1F1F2","name":"Cameroon","title":"flag for Cameroon","dialCode":"+237"},{"code":"CN","emoji":"🇨🇳","unicode":"U+1F1E8 U+1F1F3","name":"China","title":"flag for China","dialCode":"+86"},{"code":"CO","emoji":"🇨🇴","unicode":"U+1F1E8 U+1F1F4","name":"Colombia","title":"flag for Colombia","dialCode":"+57"},{"code":"CR","emoji":"🇨🇷","unicode":"U+1F1E8 U+1F1F7","name":"Costa Rica","title":"flag for Costa Rica","dialCode":"+506"},{"code":"CU","emoji":"🇨🇺","unicode":"U+1F1E8 U+1F1FA","name":"Cuba","title":"flag for Cuba","dialCode":"+53"},{"code":"CV","emoji":"🇨🇻","unicode":"U+1F1E8 U+1F1FB","name":"Cape Verde","title":"flag for Cape Verde","dialCode":"+238"},{"code":"CW","emoji":"🇨🇼","unicode":"U+1F1E8 U+1F1FC","name":"Curaçao","title":"flag for Curaçao"},{"code":"CX","emoji":"🇨🇽","unicode":"U+1F1E8 U+1F1FD","name":"Christmas Island","title":"flag for Christmas Island","dialCode":"+61"},{"code":"CY","emoji":"🇨🇾","unicode":"U+1F1E8 U+1F1FE","name":"Cyprus","title":"flag for Cyprus","dialCode":"+537"},{"code":"CZ","emoji":"🇨🇿","unicode":"U+1F1E8 U+1F1FF","name":"Czech Republic","title":"flag for Czech Republic","dialCode":"+420"},{"code":"DE","emoji":"🇩🇪","unicode":"U+1F1E9 U+1F1EA","name":"Germany","title":"flag for Germany","dialCode":"+49"},{"code":"DJ","emoji":"🇩🇯","unicode":"U+1F1E9 U+1F1EF","name":"Djibouti","title":"flag for Djibouti","dialCode":"+253"},{"code":"DK","emoji":"🇩🇰","unicode":"U+1F1E9 U+1F1F0","name":"Denmark","title":"flag for Denmark","dialCode":"+45"},{"code":"DM","emoji":"🇩🇲","unicode":"U+1F1E9 U+1F1F2","name":"Dominica","title":"flag for Dominica","dialCode":"+1 767"},{"code":"DO","emoji":"🇩🇴","unicode":"U+1F1E9 U+1F1F4","name":"Dominican Republic","title":"flag for Dominican Republic","dialCode":"+1 849"},{"code":"DZ","emoji":"🇩🇿","unicode":"U+1F1E9 U+1F1FF","name":"Algeria","title":"flag for Algeria","dialCode":"+213"},{"code":"EC","emoji":"🇪🇨","unicode":"U+1F1EA U+1F1E8","name":"Ecuador","title":"flag for Ecuador","dialCode":"+593"},{"code":"EE","emoji":"🇪🇪","unicode":"U+1F1EA U+1F1EA","name":"Estonia","title":"flag for Estonia","dialCode":"+372"},{"code":"EG","emoji":"🇪🇬","unicode":"U+1F1EA U+1F1EC","name":"Egypt","title":"flag for Egypt","dialCode":"+20"},{"code":"EH","emoji":"🇪🇭","unicode":"U+1F1EA U+1F1ED","name":"Western Sahara","title":"flag for Western Sahara"},{"code":"ER","emoji":"🇪🇷","unicode":"U+1F1EA U+1F1F7","name":"Eritrea","title":"flag for Eritrea","dialCode":"+291"},{"code":"ES","emoji":"🇪🇸","unicode":"U+1F1EA U+1F1F8","name":"Spain","title":"flag for Spain","dialCode":"+34"},{"code":"ET","emoji":"🇪🇹","unicode":"U+1F1EA U+1F1F9","name":"Ethiopia","title":"flag for Ethiopia","dialCode":"+251"},{"code":"EU","emoji":"🇪🇺","unicode":"U+1F1EA U+1F1FA","name":"European Union","title":"flag for European Union"},{"code":"FI","emoji":"🇫🇮","unicode":"U+1F1EB U+1F1EE","name":"Finland","title":"flag for Finland","dialCode":"+358"},{"code":"FJ","emoji":"🇫🇯","unicode":"U+1F1EB U+1F1EF","name":"Fiji","title":"flag for Fiji","dialCode":"+679"},{"code":"FK","emoji":"🇫🇰","unicode":"U+1F1EB U+1F1F0","name":"Falkland Islands (Malvinas)","title":"flag for Falkland Islands (Malvinas)","dialCode":"+500"},{"code":"FM","emoji":"🇫🇲","unicode":"U+1F1EB U+1F1F2","name":"Micronesia","title":"flag for Micronesia","dialCode":"+691"},{"code":"FO","emoji":"🇫🇴","unicode":"U+1F1EB U+1F1F4","name":"Faroe Islands","title":"flag for Faroe Islands","dialCode":"+298"},{"code":"FR","emoji":"🇫🇷","unicode":"U+1F1EB U+1F1F7","name":"France","title":"flag for France","dialCode":"+33"},{"code":"GA","emoji":"🇬🇦","unicode":"U+1F1EC U+1F1E6","name":"Gabon","title":"flag for Gabon","dialCode":"+241"},{"code":"GB","emoji":"🇬🇧","unicode":"U+1F1EC U+1F1E7","name":"United Kingdom","title":"flag for United Kingdom","dialCode":"+44"},{"code":"GD","emoji":"🇬🇩","unicode":"U+1F1EC U+1F1E9","name":"Grenada","title":"flag for Grenada","dialCode":"+1 473"},{"code":"GE","emoji":"🇬🇪","unicode":"U+1F1EC U+1F1EA","name":"Georgia","title":"flag for Georgia","dialCode":"+995"},{"code":"GF","emoji":"🇬🇫","unicode":"U+1F1EC U+1F1EB","name":"French Guiana","title":"flag for French Guiana","dialCode":"+594"},{"code":"GG","emoji":"🇬🇬","unicode":"U+1F1EC U+1F1EC","name":"Guernsey","title":"flag for Guernsey","dialCode":"+44"},{"code":"GH","emoji":"🇬🇭","unicode":"U+1F1EC U+1F1ED","name":"Ghana","title":"flag for Ghana","dialCode":"+233"},{"code":"GI","emoji":"🇬🇮","unicode":"U+1F1EC U+1F1EE","name":"Gibraltar","title":"flag for Gibraltar","dialCode":"+350"},{"code":"GL","emoji":"🇬🇱","unicode":"U+1F1EC U+1F1F1","name":"Greenland","title":"flag for Greenland","dialCode":"+299"},{"code":"GM","emoji":"🇬🇲","unicode":"U+1F1EC U+1F1F2","name":"Gambia","title":"flag for Gambia","dialCode":"+220"},{"code":"GN","emoji":"🇬🇳","unicode":"U+1F1EC U+1F1F3","name":"Guinea","title":"flag for Guinea","dialCode":"+224"},{"code":"GP","emoji":"🇬🇵","unicode":"U+1F1EC U+1F1F5","name":"Guadeloupe","title":"flag for Guadeloupe","dialCode":"+590"},{"code":"GQ","emoji":"🇬🇶","unicode":"U+1F1EC U+1F1F6","name":"Equatorial Guinea","title":"flag for Equatorial Guinea","dialCode":"+240"},{"code":"GR","emoji":"🇬🇷","unicode":"U+1F1EC U+1F1F7","name":"Greece","title":"flag for Greece","dialCode":"+30"},{"code":"GS","emoji":"🇬🇸","unicode":"U+1F1EC U+1F1F8","name":"South Georgia","title":"flag for South Georgia","dialCode":"+500"},{"code":"GT","emoji":"🇬🇹","unicode":"U+1F1EC U+1F1F9","name":"Guatemala","title":"flag for Guatemala","dialCode":"+502"},{"code":"GU","emoji":"🇬🇺","unicode":"U+1F1EC U+1F1FA","name":"Guam","title":"flag for Guam","dialCode":"+1 671"},{"code":"GW","emoji":"🇬🇼","unicode":"U+1F1EC U+1F1FC","name":"Guinea-Bissau","title":"flag for Guinea-Bissau","dialCode":"+245"},{"code":"GY","emoji":"🇬🇾","unicode":"U+1F1EC U+1F1FE","name":"Guyana","title":"flag for Guyana","dialCode":"+595"},{"code":"HK","emoji":"🇭🇰","unicode":"U+1F1ED U+1F1F0","name":"Hong Kong","title":"flag for Hong Kong","dialCode":"+852"},{"code":"HM","emoji":"🇭🇲","unicode":"U+1F1ED U+1F1F2","name":"Heard Island and Mcdonald Islands","title":"flag for Heard Island and Mcdonald Islands"},{"code":"HN","emoji":"🇭🇳","unicode":"U+1F1ED U+1F1F3","name":"Honduras","title":"flag for Honduras","dialCode":"+504"},{"code":"HR","emoji":"🇭🇷","unicode":"U+1F1ED U+1F1F7","name":"Croatia","title":"flag for Croatia","dialCode":"+385"},{"code":"HT","emoji":"🇭🇹","unicode":"U+1F1ED U+1F1F9","name":"Haiti","title":"flag for Haiti","dialCode":"+509"},{"code":"HU","emoji":"🇭🇺","unicode":"U+1F1ED U+1F1FA","name":"Hungary","title":"flag for Hungary","dialCode":"+36"},{"code":"ID","emoji":"🇮🇩","unicode":"U+1F1EE U+1F1E9","name":"Indonesia","title":"flag for Indonesia","dialCode":"+62"},{"code":"IE","emoji":"🇮🇪","unicode":"U+1F1EE U+1F1EA","name":"Ireland","title":"flag for Ireland","dialCode":"+353"},{"code":"IL","emoji":"🇮🇱","unicode":"U+1F1EE U+1F1F1","name":"Israel","title":"flag for Israel","dialCode":"+972"},{"code":"IM","emoji":"🇮🇲","unicode":"U+1F1EE U+1F1F2","name":"Isle of Man","title":"flag for Isle of Man","dialCode":"+44"},{"code":"IN","emoji":"🇮🇳","unicode":"U+1F1EE U+1F1F3","name":"India","title":"flag for India","dialCode":"+91"},{"code":"IO","emoji":"🇮🇴","unicode":"U+1F1EE U+1F1F4","name":"British Indian Ocean Territory","title":"flag for British Indian Ocean Territory","dialCode":"+246"},{"code":"IQ","emoji":"🇮🇶","unicode":"U+1F1EE U+1F1F6","name":"Iraq","title":"flag for Iraq","dialCode":"+964"},{"code":"IR","emoji":"🇮🇷","unicode":"U+1F1EE U+1F1F7","name":"Iran","title":"flag for Iran","dialCode":"+98"},{"code":"IS","emoji":"🇮🇸","unicode":"U+1F1EE U+1F1F8","name":"Iceland","title":"flag for Iceland","dialCode":"+354"},{"code":"IT","emoji":"🇮🇹","unicode":"U+1F1EE U+1F1F9","name":"Italy","title":"flag for Italy","dialCode":"+39"},{"code":"JE","emoji":"🇯🇪","unicode":"U+1F1EF U+1F1EA","name":"Jersey","title":"flag for Jersey","dialCode":"+44"},{"code":"JM","emoji":"🇯🇲","unicode":"U+1F1EF U+1F1F2","name":"Jamaica","title":"flag for Jamaica","dialCode":"+1 876"},{"code":"JO","emoji":"🇯🇴","unicode":"U+1F1EF U+1F1F4","name":"Jordan","title":"flag for Jordan","dialCode":"+962"},{"code":"JP","emoji":"🇯🇵","unicode":"U+1F1EF U+1F1F5","name":"Japan","title":"flag for Japan","dialCode":"+81"},{"code":"KE","emoji":"🇰🇪","unicode":"U+1F1F0 U+1F1EA","name":"Kenya","title":"flag for Kenya","dialCode":"+254"},{"code":"KG","emoji":"🇰🇬","unicode":"U+1F1F0 U+1F1EC","name":"Kyrgyzstan","title":"flag for Kyrgyzstan","dialCode":"+996"},{"code":"KH","emoji":"🇰🇭","unicode":"U+1F1F0 U+1F1ED","name":"Cambodia","title":"flag for Cambodia","dialCode":"+855"},{"code":"KI","emoji":"🇰🇮","unicode":"U+1F1F0 U+1F1EE","name":"Kiribati","title":"flag for Kiribati","dialCode":"+686"},{"code":"KM","emoji":"🇰🇲","unicode":"U+1F1F0 U+1F1F2","name":"Comoros","title":"flag for Comoros","dialCode":"+269"},{"code":"KN","emoji":"🇰🇳","unicode":"U+1F1F0 U+1F1F3","name":"Saint Kitts and Nevis","title":"flag for Saint Kitts and Nevis","dialCode":"+1 869"},{"code":"KP","emoji":"🇰🇵","unicode":"U+1F1F0 U+1F1F5","name":"North Korea","title":"flag for North Korea","dialCode":"+850"},{"code":"KR","emoji":"🇰🇷","unicode":"U+1F1F0 U+1F1F7","name":"South Korea","title":"flag for South Korea","dialCode":"+82"},{"code":"KW","emoji":"🇰🇼","unicode":"U+1F1F0 U+1F1FC","name":"Kuwait","title":"flag for Kuwait","dialCode":"+965"},{"code":"KY","emoji":"🇰🇾","unicode":"U+1F1F0 U+1F1FE","name":"Cayman Islands","title":"flag for Cayman Islands","dialCode":"+ 345"},{"code":"KZ","emoji":"🇰🇿","unicode":"U+1F1F0 U+1F1FF","name":"Kazakhstan","title":"flag for Kazakhstan","dialCode":"+7 7"},{"code":"LA","emoji":"🇱🇦","unicode":"U+1F1F1 U+1F1E6","name":"Lao People\'s Democratic Republic","title":"flag for Lao People\'s Democratic Republic","dialCode":"+856"},{"code":"LB","emoji":"🇱🇧","unicode":"U+1F1F1 U+1F1E7","name":"Lebanon","title":"flag for Lebanon","dialCode":"+961"},{"code":"LC","emoji":"🇱🇨","unicode":"U+1F1F1 U+1F1E8","name":"Saint Lucia","title":"flag for Saint Lucia","dialCode":"+1 758"},{"code":"LI","emoji":"🇱🇮","unicode":"U+1F1F1 U+1F1EE","name":"Liechtenstein","title":"flag for Liechtenstein","dialCode":"+423"},{"code":"LK","emoji":"🇱🇰","unicode":"U+1F1F1 U+1F1F0","name":"Sri Lanka","title":"flag for Sri Lanka","dialCode":"+94"},{"code":"LR","emoji":"🇱🇷","unicode":"U+1F1F1 U+1F1F7","name":"Liberia","title":"flag for Liberia","dialCode":"+231"},{"code":"LS","emoji":"🇱🇸","unicode":"U+1F1F1 U+1F1F8","name":"Lesotho","title":"flag for Lesotho","dialCode":"+266"},{"code":"LT","emoji":"🇱🇹","unicode":"U+1F1F1 U+1F1F9","name":"Lithuania","title":"flag for Lithuania","dialCode":"+370"},{"code":"LU","emoji":"🇱🇺","unicode":"U+1F1F1 U+1F1FA","name":"Luxembourg","title":"flag for Luxembourg","dialCode":"+352"},{"code":"LV","emoji":"🇱🇻","unicode":"U+1F1F1 U+1F1FB","name":"Latvia","title":"flag for Latvia","dialCode":"+371"},{"code":"LY","emoji":"🇱🇾","unicode":"U+1F1F1 U+1F1FE","name":"Libya","title":"flag for Libya","dialCode":"+218"},{"code":"MA","emoji":"🇲🇦","unicode":"U+1F1F2 U+1F1E6","name":"Morocco","title":"flag for Morocco","dialCode":"+212"},{"code":"MC","emoji":"🇲🇨","unicode":"U+1F1F2 U+1F1E8","name":"Monaco","title":"flag for Monaco","dialCode":"+377"},{"code":"MD","emoji":"🇲🇩","unicode":"U+1F1F2 U+1F1E9","name":"Moldova","title":"flag for Moldova","dialCode":"+373"},{"code":"ME","emoji":"🇲🇪","unicode":"U+1F1F2 U+1F1EA","name":"Montenegro","title":"flag for Montenegro","dialCode":"+382"},{"code":"MF","emoji":"🇲🇫","unicode":"U+1F1F2 U+1F1EB","name":"Saint Martin (French Part)","title":"flag for Saint Martin (French Part)","dialCode":"+590"},{"code":"MG","emoji":"🇲🇬","unicode":"U+1F1F2 U+1F1EC","name":"Madagascar","title":"flag for Madagascar","dialCode":"+261"},{"code":"MH","emoji":"🇲🇭","unicode":"U+1F1F2 U+1F1ED","name":"Marshall Islands","title":"flag for Marshall Islands","dialCode":"+692"},{"code":"MK","emoji":"🇲🇰","unicode":"U+1F1F2 U+1F1F0","name":"Macedonia","title":"flag for Macedonia","dialCode":"+389"},{"code":"ML","emoji":"🇲🇱","unicode":"U+1F1F2 U+1F1F1","name":"Mali","title":"flag for Mali","dialCode":"+223"},{"code":"MM","emoji":"🇲🇲","unicode":"U+1F1F2 U+1F1F2","name":"Myanmar","title":"flag for Myanmar","dialCode":"+95"},{"code":"MN","emoji":"🇲🇳","unicode":"U+1F1F2 U+1F1F3","name":"Mongolia","title":"flag for Mongolia","dialCode":"+976"},{"code":"MO","emoji":"🇲🇴","unicode":"U+1F1F2 U+1F1F4","name":"Macao","title":"flag for Macao","dialCode":"+853"},{"code":"MP","emoji":"🇲🇵","unicode":"U+1F1F2 U+1F1F5","name":"Northern Mariana Islands","title":"flag for Northern Mariana Islands","dialCode":"+1 670"},{"code":"MQ","emoji":"🇲🇶","unicode":"U+1F1F2 U+1F1F6","name":"Martinique","title":"flag for Martinique","dialCode":"+596"},{"code":"MR","emoji":"🇲🇷","unicode":"U+1F1F2 U+1F1F7","name":"Mauritania","title":"flag for Mauritania","dialCode":"+222"},{"code":"MS","emoji":"🇲🇸","unicode":"U+1F1F2 U+1F1F8","name":"Montserrat","title":"flag for Montserrat","dialCode":"+1664"},{"code":"MT","emoji":"🇲🇹","unicode":"U+1F1F2 U+1F1F9","name":"Malta","title":"flag for Malta","dialCode":"+356"},{"code":"MU","emoji":"🇲🇺","unicode":"U+1F1F2 U+1F1FA","name":"Mauritius","title":"flag for Mauritius","dialCode":"+230"},{"code":"MV","emoji":"🇲🇻","unicode":"U+1F1F2 U+1F1FB","name":"Maldives","title":"flag for Maldives","dialCode":"+960"},{"code":"MW","emoji":"🇲🇼","unicode":"U+1F1F2 U+1F1FC","name":"Malawi","title":"flag for Malawi","dialCode":"+265"},{"code":"MX","emoji":"🇲🇽","unicode":"U+1F1F2 U+1F1FD","name":"Mexico","title":"flag for Mexico","dialCode":"+52"},{"code":"MY","emoji":"🇲🇾","unicode":"U+1F1F2 U+1F1FE","name":"Malaysia","title":"flag for Malaysia","dialCode":"+60"},{"code":"MZ","emoji":"🇲🇿","unicode":"U+1F1F2 U+1F1FF","name":"Mozambique","title":"flag for Mozambique","dialCode":"+258"},{"code":"NA","emoji":"🇳🇦","unicode":"U+1F1F3 U+1F1E6","name":"Namibia","title":"flag for Namibia","dialCode":"+264"},{"code":"NC","emoji":"🇳🇨","unicode":"U+1F1F3 U+1F1E8","name":"New Caledonia","title":"flag for New Caledonia","dialCode":"+687"},{"code":"NE","emoji":"🇳🇪","unicode":"U+1F1F3 U+1F1EA","name":"Niger","title":"flag for Niger","dialCode":"+227"},{"code":"NF","emoji":"🇳🇫","unicode":"U+1F1F3 U+1F1EB","name":"Norfolk Island","title":"flag for Norfolk Island","dialCode":"+672"},{"code":"NG","emoji":"🇳🇬","unicode":"U+1F1F3 U+1F1EC","name":"Nigeria","title":"flag for Nigeria","dialCode":"+234"},{"code":"NI","emoji":"🇳🇮","unicode":"U+1F1F3 U+1F1EE","name":"Nicaragua","title":"flag for Nicaragua","dialCode":"+505"},{"code":"NL","emoji":"🇳🇱","unicode":"U+1F1F3 U+1F1F1","name":"Netherlands","title":"flag for Netherlands","dialCode":"+31"},{"code":"NO","emoji":"🇳🇴","unicode":"U+1F1F3 U+1F1F4","name":"Norway","title":"flag for Norway","dialCode":"+47"},{"code":"NP","emoji":"🇳🇵","unicode":"U+1F1F3 U+1F1F5","name":"Nepal","title":"flag for Nepal","dialCode":"+977"},{"code":"NR","emoji":"🇳🇷","unicode":"U+1F1F3 U+1F1F7","name":"Nauru","title":"flag for Nauru","dialCode":"+674"},{"code":"NU","emoji":"🇳🇺","unicode":"U+1F1F3 U+1F1FA","name":"Niue","title":"flag for Niue","dialCode":"+683"},{"code":"NZ","emoji":"🇳🇿","unicode":"U+1F1F3 U+1F1FF","name":"New Zealand","title":"flag for New Zealand","dialCode":"+64"},{"code":"OM","emoji":"🇴🇲","unicode":"U+1F1F4 U+1F1F2","name":"Oman","title":"flag for Oman","dialCode":"+968"},{"code":"PA","emoji":"🇵🇦","unicode":"U+1F1F5 U+1F1E6","name":"Panama","title":"flag for Panama","dialCode":"+507"},{"code":"PE","emoji":"🇵🇪","unicode":"U+1F1F5 U+1F1EA","name":"Peru","title":"flag for Peru","dialCode":"+51"},{"code":"PF","emoji":"🇵🇫","unicode":"U+1F1F5 U+1F1EB","name":"French Polynesia","title":"flag for French Polynesia","dialCode":"+689"},{"code":"PG","emoji":"🇵🇬","unicode":"U+1F1F5 U+1F1EC","name":"Papua New Guinea","title":"flag for Papua New Guinea","dialCode":"+675"},{"code":"PH","emoji":"🇵🇭","unicode":"U+1F1F5 U+1F1ED","name":"Philippines","title":"flag for Philippines","dialCode":"+63"},{"code":"PK","emoji":"🇵🇰","unicode":"U+1F1F5 U+1F1F0","name":"Pakistan","title":"flag for Pakistan","dialCode":"+92"},{"code":"PL","emoji":"🇵🇱","unicode":"U+1F1F5 U+1F1F1","name":"Poland","title":"flag for Poland","dialCode":"+48"},{"code":"PM","emoji":"🇵🇲","unicode":"U+1F1F5 U+1F1F2","name":"Saint Pierre and Miquelon","title":"flag for Saint Pierre and Miquelon","dialCode":"+508"},{"code":"PN","emoji":"🇵🇳","unicode":"U+1F1F5 U+1F1F3","name":"Pitcairn","title":"flag for Pitcairn","dialCode":"+872"},{"code":"PR","emoji":"🇵🇷","unicode":"U+1F1F5 U+1F1F7","name":"Puerto Rico","title":"flag for Puerto Rico","dialCode":"+1 939"},{"code":"PS","emoji":"🇵🇸","unicode":"U+1F1F5 U+1F1F8","name":"Palestinian Territory","title":"flag for Palestinian Territory","dialCode":"+970"},{"code":"PT","emoji":"🇵🇹","unicode":"U+1F1F5 U+1F1F9","name":"Portugal","title":"flag for Portugal","dialCode":"+351"},{"code":"PW","emoji":"🇵🇼","unicode":"U+1F1F5 U+1F1FC","name":"Palau","title":"flag for Palau","dialCode":"+680"},{"code":"PY","emoji":"🇵🇾","unicode":"U+1F1F5 U+1F1FE","name":"Paraguay","title":"flag for Paraguay","dialCode":"+595"},{"code":"QA","emoji":"🇶🇦","unicode":"U+1F1F6 U+1F1E6","name":"Qatar","title":"flag for Qatar","dialCode":"+974"},{"code":"RE","emoji":"🇷🇪","unicode":"U+1F1F7 U+1F1EA","name":"Réunion","title":"flag for Réunion","dialCode":"+262"},{"code":"RO","emoji":"🇷🇴","unicode":"U+1F1F7 U+1F1F4","name":"Romania","title":"flag for Romania","dialCode":"+40"},{"code":"RS","emoji":"🇷🇸","unicode":"U+1F1F7 U+1F1F8","name":"Serbia","title":"flag for Serbia","dialCode":"+381"},{"code":"RU","emoji":"🇷🇺","unicode":"U+1F1F7 U+1F1FA","name":"Russia","title":"flag for Russia","dialCode":"+7"},{"code":"RW","emoji":"🇷🇼","unicode":"U+1F1F7 U+1F1FC","name":"Rwanda","title":"flag for Rwanda","dialCode":"+250"},{"code":"SA","emoji":"🇸🇦","unicode":"U+1F1F8 U+1F1E6","name":"Saudi Arabia","title":"flag for Saudi Arabia","dialCode":"+966"},{"code":"SB","emoji":"🇸🇧","unicode":"U+1F1F8 U+1F1E7","name":"Solomon Islands","title":"flag for Solomon Islands","dialCode":"+677"},{"code":"SC","emoji":"🇸🇨","unicode":"U+1F1F8 U+1F1E8","name":"Seychelles","title":"flag for Seychelles","dialCode":"+248"},{"code":"SD","emoji":"🇸🇩","unicode":"U+1F1F8 U+1F1E9","name":"Sudan","title":"flag for Sudan","dialCode":"+249"},{"code":"SE","emoji":"🇸🇪","unicode":"U+1F1F8 U+1F1EA","name":"Sweden","title":"flag for Sweden","dialCode":"+46"},{"code":"SG","emoji":"🇸🇬","unicode":"U+1F1F8 U+1F1EC","name":"Singapore","title":"flag for Singapore","dialCode":"+65"},{"code":"SH","emoji":"🇸🇭","unicode":"U+1F1F8 U+1F1ED","name":"Saint Helena, Ascension and Tristan Da Cunha","title":"flag for Saint Helena, Ascension and Tristan Da Cunha","dialCode":"+290"},{"code":"SI","emoji":"🇸🇮","unicode":"U+1F1F8 U+1F1EE","name":"Slovenia","title":"flag for Slovenia","dialCode":"+386"},{"code":"SJ","emoji":"🇸🇯","unicode":"U+1F1F8 U+1F1EF","name":"Svalbard and Jan Mayen","title":"flag for Svalbard and Jan Mayen","dialCode":"+47"},{"code":"SK","emoji":"🇸🇰","unicode":"U+1F1F8 U+1F1F0","name":"Slovakia","title":"flag for Slovakia","dialCode":"+421"},{"code":"SL","emoji":"🇸🇱","unicode":"U+1F1F8 U+1F1F1","name":"Sierra Leone","title":"flag for Sierra Leone","dialCode":"+232"},{"code":"SM","emoji":"🇸🇲","unicode":"U+1F1F8 U+1F1F2","name":"San Marino","title":"flag for San Marino","dialCode":"+378"},{"code":"SN","emoji":"🇸🇳","unicode":"U+1F1F8 U+1F1F3","name":"Senegal","title":"flag for Senegal","dialCode":"+221"},{"code":"SO","emoji":"🇸🇴","unicode":"U+1F1F8 U+1F1F4","name":"Somalia","title":"flag for Somalia","dialCode":"+252"},{"code":"SR","emoji":"🇸🇷","unicode":"U+1F1F8 U+1F1F7","name":"Suriname","title":"flag for Suriname","dialCode":"+597"},{"code":"SS","emoji":"🇸🇸","unicode":"U+1F1F8 U+1F1F8","name":"South Sudan","title":"flag for South Sudan"},{"code":"ST","emoji":"🇸🇹","unicode":"U+1F1F8 U+1F1F9","name":"Sao Tome and Principe","title":"flag for Sao Tome and Principe","dialCode":"+239"},{"code":"SV","emoji":"🇸🇻","unicode":"U+1F1F8 U+1F1FB","name":"El Salvador","title":"flag for El Salvador","dialCode":"+503"},{"code":"SX","emoji":"🇸🇽","unicode":"U+1F1F8 U+1F1FD","name":"Sint Maarten (Dutch Part)","title":"flag for Sint Maarten (Dutch Part)"},{"code":"SY","emoji":"🇸🇾","unicode":"U+1F1F8 U+1F1FE","name":"Syrian Arab Republic","title":"flag for Syrian Arab Republic","dialCode":"+963"},{"code":"SZ","emoji":"🇸🇿","unicode":"U+1F1F8 U+1F1FF","name":"Swaziland","title":"flag for Swaziland","dialCode":"+268"},{"code":"TC","emoji":"🇹🇨","unicode":"U+1F1F9 U+1F1E8","name":"Turks and Caicos Islands","title":"flag for Turks and Caicos Islands","dialCode":"+1 649"},{"code":"TD","emoji":"🇹🇩","unicode":"U+1F1F9 U+1F1E9","name":"Chad","title":"flag for Chad","dialCode":"+235"},{"code":"TF","emoji":"🇹🇫","unicode":"U+1F1F9 U+1F1EB","name":"French Southern Territories","title":"flag for French Southern Territories"},{"code":"TG","emoji":"🇹🇬","unicode":"U+1F1F9 U+1F1EC","name":"Togo","title":"flag for Togo","dialCode":"+228"},{"code":"TH","emoji":"🇹🇭","unicode":"U+1F1F9 U+1F1ED","name":"Thailand","title":"flag for Thailand","dialCode":"+66"},{"code":"TJ","emoji":"🇹🇯","unicode":"U+1F1F9 U+1F1EF","name":"Tajikistan","title":"flag for Tajikistan","dialCode":"+992"},{"code":"TK","emoji":"🇹🇰","unicode":"U+1F1F9 U+1F1F0","name":"Tokelau","title":"flag for Tokelau","dialCode":"+690"},{"code":"TL","emoji":"🇹🇱","unicode":"U+1F1F9 U+1F1F1","name":"Timor-Leste","title":"flag for Timor-Leste","dialCode":"+670"},{"code":"TM","emoji":"🇹🇲","unicode":"U+1F1F9 U+1F1F2","name":"Turkmenistan","title":"flag for Turkmenistan","dialCode":"+993"},{"code":"TN","emoji":"🇹🇳","unicode":"U+1F1F9 U+1F1F3","name":"Tunisia","title":"flag for Tunisia","dialCode":"+216"},{"code":"TO","emoji":"🇹🇴","unicode":"U+1F1F9 U+1F1F4","name":"Tonga","title":"flag for Tonga","dialCode":"+676"},{"code":"TR","emoji":"🇹🇷","unicode":"U+1F1F9 U+1F1F7","name":"Turkey","title":"flag for Turkey","dialCode":"+90"},{"code":"TT","emoji":"🇹🇹","unicode":"U+1F1F9 U+1F1F9","name":"Trinidad and Tobago","title":"flag for Trinidad and Tobago","dialCode":"+1 868"},{"code":"TV","emoji":"🇹🇻","unicode":"U+1F1F9 U+1F1FB","name":"Tuvalu","title":"flag for Tuvalu","dialCode":"+688"},{"code":"TW","emoji":"🇹🇼","unicode":"U+1F1F9 U+1F1FC","name":"Taiwan","title":"flag for Taiwan","dialCode":"+886"},{"code":"TZ","emoji":"🇹🇿","unicode":"U+1F1F9 U+1F1FF","name":"Tanzania","title":"flag for Tanzania","dialCode":"+255"},{"code":"UA","emoji":"🇺🇦","unicode":"U+1F1FA U+1F1E6","name":"Ukraine","title":"flag for Ukraine","dialCode":"+380"},{"code":"UG","emoji":"🇺🇬","unicode":"U+1F1FA U+1F1EC","name":"Uganda","title":"flag for Uganda","dialCode":"+256"},{"code":"UM","emoji":"🇺🇲","unicode":"U+1F1FA U+1F1F2","name":"United States Minor Outlying Islands","title":"flag for United States Minor Outlying Islands"},{"code":"US","emoji":"🇺🇸","unicode":"U+1F1FA U+1F1F8","name":"United States","title":"flag for United States","dialCode":"+1"},{"code":"UY","emoji":"🇺🇾","unicode":"U+1F1FA U+1F1FE","name":"Uruguay","title":"flag for Uruguay","dialCode":"+598"},{"code":"UZ","emoji":"🇺🇿","unicode":"U+1F1FA U+1F1FF","name":"Uzbekistan","title":"flag for Uzbekistan","dialCode":"+998"},{"code":"VA","emoji":"🇻🇦","unicode":"U+1F1FB U+1F1E6","name":"Vatican City","title":"flag for Vatican City","dialCode":"+379"},{"code":"VC","emoji":"🇻🇨","unicode":"U+1F1FB U+1F1E8","name":"Saint Vincent and The Grenadines","title":"flag for Saint Vincent and The Grenadines","dialCode":"+1 784"},{"code":"VE","emoji":"🇻🇪","unicode":"U+1F1FB U+1F1EA","name":"Venezuela","title":"flag for Venezuela","dialCode":"+58"},{"code":"VG","emoji":"🇻🇬","unicode":"U+1F1FB U+1F1EC","name":"Virgin Islands, British","title":"flag for Virgin Islands, British","dialCode":"+1 284"},{"code":"VI","emoji":"🇻🇮","unicode":"U+1F1FB U+1F1EE","name":"Virgin Islands, U.S.","title":"flag for Virgin Islands, U.S.","dialCode":"+1 340"},{"code":"VN","emoji":"🇻🇳","unicode":"U+1F1FB U+1F1F3","name":"Viet Nam","title":"flag for Viet Nam","dialCode":"+84"},{"code":"VU","emoji":"🇻🇺","unicode":"U+1F1FB U+1F1FA","name":"Vanuatu","title":"flag for Vanuatu","dialCode":"+678"},{"code":"WF","emoji":"🇼🇫","unicode":"U+1F1FC U+1F1EB","name":"Wallis and Futuna","title":"flag for Wallis and Futuna","dialCode":"+681"},{"code":"WS","emoji":"🇼🇸","unicode":"U+1F1FC U+1F1F8","name":"Samoa","title":"flag for Samoa","dialCode":"+685"},{"code":"XK","emoji":"🇽🇰","unicode":"U+1F1FD U+1F1F0","name":"Kosovo","title":"flag for Kosovo","dialCode":"+383"},{"code":"YE","emoji":"🇾🇪","unicode":"U+1F1FE U+1F1EA","name":"Yemen","title":"flag for Yemen","dialCode":"+967"},{"code":"YT","emoji":"🇾🇹","unicode":"U+1F1FE U+1F1F9","name":"Mayotte","title":"flag for Mayotte","dialCode":"+262"},{"code":"ZA","emoji":"🇿🇦","unicode":"U+1F1FF U+1F1E6","name":"South Africa","title":"flag for South Africa","dialCode":"+27"},{"code":"ZM","emoji":"🇿🇲","unicode":"U+1F1FF U+1F1F2","name":"Zambia","title":"flag for Zambia","dialCode":"+260"},{"code":"ZW","emoji":"🇿🇼","unicode":"U+1F1FF U+1F1FC","name":"Zimbabwe","title":"flag for Zimbabwe","dialCode":"+263"}]')},function(e,t,n){var r,o=n(651),a=n(658),i=n(659),c=n(660),s=n(293),l=(r=a,function(e,t,n){if(t=o(t,n,3),s(e)){var a=c(e,t,void 0);return a>-1?e[a]:void 0}return i(e,t,r)});e.exports=l},function(e,t,n){var r=n(652),o=n(656),a=n(293),i=n(657),c=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\n\\]|\\.)*?\1)\]/,s=/^\w*$/,l=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\n\\]|\\.)*?)\2)\]/g,u=/\\(\\)?/g;function d(e,t,n){if(null!=e){void 0!==n&&n in h(e)&&(t=[n]);for(var r=0,o=t.length;null!=e&&r<o;)e=e[t[r++]];return r&&r==o?e:void 0}}function f(e,t){var n=typeof e;return!!("string"==n&&s.test(e)||"number"==n)||!a(e)&&(!c.test(e)||null!=t&&e in h(t))}function p(e){return e==e&&!y(e)}function h(e){return y(e)?e:Object(e)}function m(e){if(a(e))return e;var t=[];return function(e){return null==e?"":e+""}(e).replace(l,(function(e,n,r,o){t.push(r?o.replace(u,"$1"):n||e)})),t}function y(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function b(e){return e}e.exports=function(e,t,n){var c,s,l=typeof e;return"function"==l?void 0===t?e:o(e,t,n):null==e?b:"object"==l?function(e){var t=function(e){for(var t=i(e),n=t.length;n--;)t[n][2]=p(t[n][1]);return t}(e);if(1==t.length&&t[0][2]){var n=t[0][0],o=t[0][1];return function(e){return null!=e&&e[n]===o&&(void 0!==o||n in h(e))}}return function(e){return function(e,t,n){var o=t.length,a=o;if(null==e)return!a;for(e=h(e);o--;){var i=t[o];if(i[2]?i[1]!==e[i[0]]:!(i[0]in e))return!1}for(;++o<a;){var c=(i=t[o])[0],s=e[c],l=i[1];if(i[2]){if(void 0===s&&!(c in e))return!1}else{if(!r(l,s,void 0,!0))return!1}}return!0}(e,t)}}(e):void 0===t?f(c=e)?(s=c,function(e){return null==e?void 0:e[s]}):function(e){var t=e+"";return e=m(e),function(n){return d(n,e,t)}}(c):function(e,t){var n=a(e),o=f(e)&&p(t),i=e+"";return e=m(e),function(a){if(null==a)return!1;var c,s,l=i;if(a=h(a),(n||!o)&&!(l in a)){if(null==(a=1==e.length?a:d(a,function(e,t,n){var r=-1,o=e.length;(t=null==t?0:+t||0)<0&&(t=-t>o?0:o+t),(n=void 0===n||n>o?o:+n||0)<0&&(n+=o),o=t>n?0:n-t>>>0,t>>>=0;for(var a=Array(o);++r<o;)a[r]=e[r+t];return a}(e,0,-1))))return!1;l=(s=(c=e)?c.length:0)?c[s-1]:void 0,a=h(a)}return a[l]===t?void 0!==t||l in a:r(t,a[l],void 0,!0)}}(e,t)}},function(e,t,n){var r=n(293),o=n(653),a=n(334),i="[object Object]",c=Object.prototype,s=c.hasOwnProperty,l=c.toString;function u(e,t){for(var n=-1,r=e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}function d(e,t,n,r,o,a,i){var c=-1,s=e.length,l=t.length;if(s!=l&&!(o&&l>s))return!1;for(;++c<s;){var d=e[c],f=t[c],p=r?r(o?f:d,o?d:f,c):void 0;if(void 0!==p){if(p)continue;return!1}if(o){if(!u(t,(function(e){return d===e||n(d,e,r,o,a,i)})))return!1}else if(d!==f&&!n(d,f,r,o,a,i))return!1}return!0}function f(e,t,n,r,o,i,c){var l=a(e),u=l.length;if(u!=a(t).length&&!o)return!1;for(var d=u;d--;){var f=l[d];if(!(o?f in t:s.call(t,f)))return!1}for(var p=o;++d<u;){var h=e[f=l[d]],m=t[f],y=r?r(o?m:h,o?h:m,f):void 0;if(!(void 0===y?n(h,m,r,o,i,c):y))return!1;p||(p="constructor"==f)}if(!p){var b=e.constructor,g=t.constructor;if(b!=g&&"constructor"in e&&"constructor"in t&&!("function"==typeof b&&b instanceof b&&"function"==typeof g&&g instanceof g))return!1}return!0}e.exports=function e(t,n,a,c,u,p){return t===n||(null==t||null==n||!function(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}(t)&&!function(e){return!!e&&"object"==typeof e}(n)?t!=t&&n!=n:function(e,t,n,a,c,u,p){var h=r(e),m=r(t),y="[object Array]",b="[object Array]";h||("[object Arguments]"==(y=l.call(e))?y=i:y!=i&&(h=o(e))),m||("[object Arguments]"==(b=l.call(t))?b=i:b!=i&&(m=o(t)));var g=y==i,v=b==i,O=y==b;if(O&&!h&&!g)return function(e,t,n){switch(n){case"[object Boolean]":case"[object Date]":return+e==+t;case"[object Error]":return e.name==t.name&&e.message==t.message;case"[object Number]":return e!=+e?t!=+t:e==+t;case"[object RegExp]":case"[object String]":return e==t+""}return!1}(e,t,y);if(!c){var w=g&&s.call(e,"__wrapped__"),_=v&&s.call(t,"__wrapped__");if(w||_)return n(w?e.value():e,_?t.value():t,a,c,u,p)}if(!O)return!1;u||(u=[]),p||(p=[]);for(var k=u.length;k--;)if(u[k]==e)return p[k]==t;u.push(e),p.push(t);var S=(h?d:f)(e,t,n,a,c,u,p);return u.pop(),p.pop(),S}(t,n,e,a,c,u,p))}},function(e,t){var n={};n["[object Float32Array]"]=n["[object Float64Array]"]=n["[object Int8Array]"]=n["[object Int16Array]"]=n["[object Int32Array]"]=n["[object Uint8Array]"]=n["[object Uint8ClampedArray]"]=n["[object Uint16Array]"]=n["[object Uint32Array]"]=!0,n["[object Arguments]"]=n["[object Array]"]=n["[object ArrayBuffer]"]=n["[object Boolean]"]=n["[object DataView]"]=n["[object Date]"]=n["[object Error]"]=n["[object Function]"]=n["[object Map]"]=n["[object Number]"]=n["[object Object]"]=n["[object RegExp]"]=n["[object Set]"]=n["[object String]"]=n["[object WeakMap]"]=!1;var r=Object.prototype.toString;e.exports=function(e){return function(e){return!!e&&"object"==typeof e}(e)&&function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}(e.length)&&!!n[r.call(e)]}},function(e,t){var n=/^\[object .+?Constructor\]$/,r=Object.prototype,o=Function.prototype.toString,a=r.hasOwnProperty,i=r.toString,c=RegExp("^"+o.call(a).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");e.exports=function(e,t){var r=null==e?void 0:e[t];return function(e){return null!=e&&(function(e){return function(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}(e)&&"[object Function]"==i.call(e)}(e)?c.test(o.call(e)):function(e){return!!e&&"object"==typeof e}(e)&&n.test(e))}(r)?r:void 0}},function(e,t){var n=Object.prototype,r=n.hasOwnProperty,o=n.toString,a=n.propertyIsEnumerable;e.exports=function(e){return function(e){return function(e){return!!e&&"object"==typeof e}(e)&&function(e){return null!=e&&function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}(e.length)&&!function(e){var t=function(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}(e)?o.call(e):"";return"[object Function]"==t||"[object GeneratorFunction]"==t}(e)}(e)}(e)&&r.call(e,"callee")&&(!a.call(e,"callee")||"[object Arguments]"==o.call(e))}},function(e,t){function n(e){return e}e.exports=function(e,t,r){if("function"!=typeof e)return n;if(void 0===t)return e;switch(r){case 1:return function(n){return e.call(t,n)};case 3:return function(n,r,o){return e.call(t,n,r,o)};case 4:return function(n,r,o,a){return e.call(t,n,r,o,a)};case 5:return function(n,r,o,a,i){return e.call(t,n,r,o,a,i)}}return function(){return e.apply(t,arguments)}}},function(e,t,n){var r=n(334);e.exports=function(e){var t;e=function(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}(t=e)?t:Object(t);for(var n=-1,o=r(e),a=o.length,i=Array(a);++n<a;){var c=o[n];i[n]=[c,e[c]]}return i}},function(e,t,n){var r,o=n(334),a=(r=function(e,t){return i(e,t,o)},function(e,t){var n,o=e?c(e):0;if(!("number"==typeof(n=o)&&n>-1&&n%1==0&&n<=9007199254740991))return r(e,t);for(var a=-1,i=s(e);++a<o&&!1!==t(i[a],a,i););return e}),i=function(e,t,n){for(var r=s(e),o=n(e),a=o.length,i=-1;++i<a;){var c=o[i];if(!1===t(r[c],c,r))break}return e},c=("length",function(e){return null==e?void 0:e.length});function s(e){return function(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}(e)?e:Object(e)}e.exports=a},function(e,t){e.exports=function(e,t,n,r){var o;return n(e,(function(e,n,a){if(t(e,n,a))return o=r?n:e,!1})),o}},function(e,t){e.exports=function(e,t,n){for(var r=e.length,o=n?r:-1;n?o--:++o<r;)if(t(e[o],o,e))return o;return-1}},function(e,t){e.exports=function(e){if(Array.isArray(e))return e},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,a=[],_n=!0,i=!1;try{for(n=n.call(e);!(_n=(r=n.next()).done)&&(a.push(r.value),!t||a.length!==t);_n=!0);}catch(e){i=!0,o=e}finally{try{_n||null==n.return||n.return()}finally{if(i)throw o}}return a}},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,n){"use strict";e.exports=function(e,t,n,r){e=(e+"").replace(/[^0-9+\-Ee.]/g,"");var o=isFinite(+e)?+e:0,a=isFinite(+t)?Math.abs(t):0,i=void 0===r?",":r,c=void 0===n?".":n,s="";return(s=(a?function(e,t){if(-1===(""+e).indexOf("e"))return+(Math.round(e+"e+"+t)+"e-"+t);var n=(""+e).split("e"),r="";return+n[1]+t>0&&(r="+"),(+(Math.round(+n[0]+"e"+r+(+n[1]+t))+"e-"+t)).toFixed(t)}(o,a).toString():""+Math.round(o)).split("."))[0].length>3&&(s[0]=s[0].replace(/\B(?=(?:\d{3})+(?!\d))/g,i)),(s[1]||"").length<a&&(s[1]=s[1]||"",s[1]+=new Array(a-s[1].length+1).join("0")),s.join(c)}},function(e,t,n){n(666);var r=n(346);e.exports=r.Object.assign},function(e,t,n){var r=n(335),o=n(674);r({target:"Object",stat:!0,forced:Object.assign!==o},{assign:o})},function(e,t,n){var r=n(148),o=n(421),a=r.WeakMap;e.exports="function"==typeof a&&/native code/.test(o(a))},function(e,t,n){var r=n(177),o=n(669),a=n(415),i=n(247);e.exports=function(e,t){for(var n=o(t),c=i.f,s=a.f,l=0;l<n.length;l++){var u=n[l];r(e,u)||c(e,u,s(t,u))}}},function(e,t,n){var r=n(345),o=n(670),a=n(427),i=n(212);e.exports=r("Reflect","ownKeys")||function(e){var t=o.f(i(e)),n=a.f;return n?t.concat(n(e)):t}},function(e,t,n){var r=n(425),o=n(348).concat("length","prototype");t.f=Object.getOwnPropertyNames||function(e){return r(e,o)}},function(e,t,n){var r=n(336),o=n(426),a=n(672),i=function(e){return function(t,n,i){var c,s=r(t),l=o(s.length),u=a(i,l);if(e&&n!=n){for(;l>u;)if((c=s[u++])!=c)return!0}else for(;l>u;u++)if((e||u in s)&&s[u]===n)return e||u||0;return!e&&-1}};e.exports={includes:i(!0),indexOf:i(!1)}},function(e,t,n){var r=n(347),o=Math.max,a=Math.min;e.exports=function(e,t){var n=r(e);return n<0?o(n+t,0):a(n,t)}},function(e,t,n){var r=n(186),o=/#|\.prototype\./,a=function(e,t){var n=c[i(e)];return n==l||n!=s&&("function"==typeof t?r(t):!!t)},i=a.normalize=function(e){return String(e).replace(o,".").toLowerCase()},c=a.data={},s=a.NATIVE="N",l=a.POLYFILL="P";e.exports=a},function(e,t,n){"use strict";var r=n(226),o=n(186),a=n(428),i=n(427),c=n(416),s=n(349),l=n(417),u=Object.assign,d=Object.defineProperty;e.exports=!u||o((function(){if(r&&1!==u({b:1},u(d({},"a",{enumerable:!0,get:function(){d(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var e={},t={},n=Symbol();return e[n]=7,"abcdefghijklmnopqrst".split("").forEach((function(e){t[e]=e})),7!=u({},e)[n]||"abcdefghijklmnopqrst"!=a(u({},t)).join("")}))?function(e,t){for(var n=s(e),o=arguments.length,u=1,d=i.f,f=c.f;o>u;)for(var p,h=l(arguments[u++]),m=d?a(h).concat(d(h)):a(h),y=m.length,b=0;y>b;)p=m[b++],r&&!f.call(h,p)||(n[p]=h[p]);return n}:u},function(e,t,n){n(676),n(690);var r=n(346);e.exports=r.Array.from},function(e,t,n){"use strict";var r=n(677).charAt,o=n(422),a=n(678),i=o.set,c=o.getterFor("String Iterator");a(String,"String",(function(e){i(this,{type:"String Iterator",string:String(e),index:0})}),(function(){var e,t=c(this),n=t.string,o=t.index;return o>=n.length?{value:void 0,done:!0}:(e=r(n,o),t.index+=e.length,{value:e,done:!1})}))},function(e,t,n){var r=n(347),o=n(338),a=function(e){return function(t,n){var a,i,c=String(o(t)),s=r(n),l=c.length;return s<0||s>=l?e?"":void 0:(a=c.charCodeAt(s))<55296||a>56319||s+1===l||(i=c.charCodeAt(s+1))<56320||i>57343?e?c.charAt(s):a:e?c.slice(s,s+2):i-56320+(a-55296<<10)+65536}};e.exports={codeAt:a(!1),charAt:a(!0)}},function(e,t,n){"use strict";var r=n(335),o=n(679),a=n(431),i=n(688),c=n(433),s=n(227),l=n(420),u=n(187),d=n(343),f=n(295),p=n(430),h=p.IteratorPrototype,m=p.BUGGY_SAFARI_ITERATORS,y=u("iterator"),b=function(){return this};e.exports=function(e,t,n,u,p,g,v){o(n,t,u);var O,w,_,k=function(e){if(e===p&&D)return D;if(!m&&e in E)return E[e];switch(e){case"keys":case"values":case"entries":return function(){return new n(this,e)}}return function(){return new n(this)}},S=t+" Iterator",j=!1,E=e.prototype,C=E[y]||E["@@iterator"]||p&&E[p],D=!m&&C||k(p),P="Array"==t&&E.entries||C;if(P&&(O=a(P.call(new e)),h!==Object.prototype&&O.next&&(d||a(O)===h||(i?i(O,h):"function"!=typeof O[y]&&s(O,y,b)),c(O,S,!0,!0),d&&(f[S]=b))),"values"==p&&C&&"values"!==C.name&&(j=!0,D=function(){return C.call(this)}),d&&!v||E[y]===D||s(E,y,D),f[t]=D,p)if(w={values:k("values"),keys:g?D:k("keys"),entries:k("entries")},v)for(_ in w)(m||j||!(_ in E))&&l(E,_,w[_]);else r({target:t,proto:!0,forced:m||j},w);return w}},function(e,t,n){"use strict";var r=n(430).IteratorPrototype,o=n(685),a=n(294),i=n(433),c=n(295),s=function(){return this};e.exports=function(e,t,n){var l=t+" Iterator";return e.prototype=o(r,{next:a(1,n)}),i(e,l,!1,!0),c[l]=s,e}},function(e,t,n){var r=n(186);e.exports=!r((function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype}))},function(e,t,n){var r=n(337),o=n(148);e.exports="process"==r(o.process)},function(e,t,n){var r,o,a=n(148),i=n(683),c=a.process,s=c&&c.versions,l=s&&s.v8;l?o=(r=l.split("."))[0]+r[1]:i&&(!(r=i.match(/Edge\/(\d+)/))||r[1]>=74)&&(r=i.match(/Chrome\/(\d+)/))&&(o=r[1]),e.exports=o&&+o},function(e,t,n){var r=n(345);e.exports=r("navigator","userAgent")||""},function(e,t,n){var r=n(432);e.exports=r&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},function(e,t,n){var r,o=n(212),a=n(686),i=n(348),c=n(344),s=n(687),l=n(419),u=n(342)("IE_PROTO"),d=function(){},f=function(e){return"<script>"+e+"<\/script>"},p=function(){try{r=document.domain&&new ActiveXObject("htmlfile")}catch(e){}var e,t;p=r?function(e){e.write(f("")),e.close();var t=e.parentWindow.Object;return e=null,t}(r):((t=l("iframe")).style.display="none",s.appendChild(t),t.src=String("javascript:"),(e=t.contentWindow.document).open(),e.write(f("document.F=Object")),e.close(),e.F);for(var n=i.length;n--;)delete p.prototype[i[n]];return p()};c[u]=!0,e.exports=Object.create||function(e,t){var n;return null!==e?(d.prototype=o(e),n=new d,d.prototype=null,n[u]=e):n=p(),void 0===t?n:a(n,t)}},function(e,t,n){var r=n(226),o=n(247),a=n(212),i=n(428);e.exports=r?Object.defineProperties:function(e,t){a(e);for(var n,r=i(t),c=r.length,s=0;c>s;)o.f(e,n=r[s++],t[n]);return e}},function(e,t,n){var r=n(345);e.exports=r("document","documentElement")},function(e,t,n){var r=n(212),o=n(689);e.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,n={};try{(e=Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set).call(n,[]),t=n instanceof Array}catch(e){}return function(n,a){return r(n),o(a),t?e.call(n,a):n.__proto__=a,n}}():void 0)},function(e,t,n){var r=n(246);e.exports=function(e){if(!r(e)&&null!==e)throw TypeError("Can't set "+String(e)+" as a prototype");return e}},function(e,t,n){var r=n(335),o=n(691);r({target:"Array",stat:!0,forced:!n(701)((function(e){Array.from(e)}))},{from:o})},function(e,t,n){"use strict";var r=n(692),o=n(349),a=n(694),i=n(696),c=n(426),s=n(697),l=n(698);e.exports=function(e){var t,n,u,d,f,p,h=o(e),m="function"==typeof this?this:Array,y=arguments.length,b=y>1?arguments[1]:void 0,g=void 0!==b,v=l(h),O=0;if(g&&(b=r(b,y>2?arguments[2]:void 0,2)),null==v||m==Array&&i(v))for(n=new m(t=c(h.length));t>O;O++)p=g?b(h[O],O):h[O],s(n,O,p);else for(f=(d=v.call(h)).next,n=new m;!(u=f.call(d)).done;O++)p=g?a(d,b,[u.value,O],!0):u.value,s(n,O,p);return n.length=O,n}},function(e,t,n){var r=n(693);e.exports=function(e,t,n){if(r(e),void 0===t)return e;switch(n){case 0:return function(){return e.call(t)};case 1:return function(n){return e.call(t,n)};case 2:return function(n,r){return e.call(t,n,r)};case 3:return function(n,r,o){return e.call(t,n,r,o)}}return function(){return e.apply(t,arguments)}}},function(e,t){e.exports=function(e){if("function"!=typeof e)throw TypeError(String(e)+" is not a function");return e}},function(e,t,n){var r=n(212),o=n(695);e.exports=function(e,t,n,a){try{return a?t(r(n)[0],n[1]):t(n)}catch(t){throw o(e),t}}},function(e,t,n){var r=n(212);e.exports=function(e){var t=e.return;if(void 0!==t)return r(t.call(e)).value}},function(e,t,n){var r=n(187),o=n(295),a=r("iterator"),i=Array.prototype;e.exports=function(e){return void 0!==e&&(o.Array===e||i[a]===e)}},function(e,t,n){"use strict";var r=n(339),o=n(247),a=n(294);e.exports=function(e,t,n){var i=r(t);i in e?o.f(e,i,a(0,n)):e[i]=n}},function(e,t,n){var r=n(699),o=n(295),a=n(187)("iterator");e.exports=function(e){if(null!=e)return e[a]||e["@@iterator"]||o[r(e)]}},function(e,t,n){var r=n(700),o=n(337),a=n(187)("toStringTag"),i="Arguments"==o(function(){return arguments}());e.exports=r?o:function(e){var t,n,r;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(n=function(e,t){try{return e[t]}catch(e){}}(t=Object(e),a))?n:i?o(t):"Object"==(r=o(t))&&"function"==typeof t.callee?"Arguments":r}},function(e,t,n){var r={};r[n(187)("toStringTag")]="z",e.exports="[object z]"===String(r)},function(e,t,n){var r=n(187)("iterator"),o=!1;try{var a=0,i={next:function(){return{done:!!a++}},return:function(){o=!0}};i[r]=function(){return this},Array.from(i,(function(){throw 2}))}catch(e){}e.exports=function(e,t){if(!t&&!o)return!1;var n=!1;try{var a={};a[r]=function(){return{next:function(){return{done:n=!0}}}},e(a)}catch(e){}return n}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(350);Object.defineProperty(t,"CalendarDay",{enumerable:!0,get:function(){return k(r).default}});var o=n(437);Object.defineProperty(t,"CalendarMonth",{enumerable:!0,get:function(){return k(o).default}});var a=n(439);Object.defineProperty(t,"CalendarMonthGrid",{enumerable:!0,get:function(){return k(a).default}});var i=n(720);Object.defineProperty(t,"DateRangePicker",{enumerable:!0,get:function(){return k(i).default}});var c=n(454);Object.defineProperty(t,"DateRangePickerInput",{enumerable:!0,get:function(){return k(c).default}});var s=n(453);Object.defineProperty(t,"DateRangePickerInputController",{enumerable:!0,get:function(){return k(s).default}});var l=n(446);Object.defineProperty(t,"DateRangePickerShape",{enumerable:!0,get:function(){return k(l).default}});var u=n(357);Object.defineProperty(t,"DayPicker",{enumerable:!0,get:function(){return k(u).default}});var d=n(462);Object.defineProperty(t,"DayPickerRangeController",{enumerable:!0,get:function(){return k(d).default}});var f=n(465);Object.defineProperty(t,"DayPickerSingleDateController",{enumerable:!0,get:function(){return k(f).default}});var p=n(744);Object.defineProperty(t,"SingleDatePicker",{enumerable:!0,get:function(){return k(p).default}});var h=n(467);Object.defineProperty(t,"SingleDatePickerInput",{enumerable:!0,get:function(){return k(h).default}});var m=n(466);Object.defineProperty(t,"SingleDatePickerShape",{enumerable:!0,get:function(){return k(m).default}});var y=n(250);Object.defineProperty(t,"isInclusivelyAfterDay",{enumerable:!0,get:function(){return k(y).default}});var b=n(745);Object.defineProperty(t,"isInclusivelyBeforeDay",{enumerable:!0,get:function(){return k(b).default}});var g=n(463);Object.defineProperty(t,"isNextDay",{enumerable:!0,get:function(){return k(g).default}});var v=n(229);Object.defineProperty(t,"isSameDay",{enumerable:!0,get:function(){return k(v).default}});var O=n(297);Object.defineProperty(t,"toISODateString",{enumerable:!0,get:function(){return k(O).default}});var w=n(355);Object.defineProperty(t,"toLocalizedDateString",{enumerable:!0,get:function(){return k(w).default}});var _=n(230);function k(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"toMomentObject",{enumerable:!0,get:function(){return k(_).default}})},function(e,t,n){"use strict";var r=n(176),o=n(435);e.exports=function(){var e=o();return r(Object,{assign:e},{assign:function(){return Object.assign!==e}}),e}},function(e,t,n){var r=n(31);e.exports={isValidMoment:function(e){return!("function"==typeof r.isMoment&&!r.isMoment(e))&&("function"==typeof e.isValid?e.isValid():!isNaN(e))}}},function(e,t){var n={invalidPredicate:"`predicate` must be a function",invalidPropValidator:"`propValidator` must be a function",requiredCore:"is marked as required",invalidTypeCore:"Invalid input type",predicateFailureCore:"Failed to succeed with predicate",anonymousMessage:"<<anonymous>>",baseInvalidMessage:"Invalid "};function r(e){if("function"!=typeof e)throw new Error(n.invalidPropValidator);var t=e.bind(null,!1,null);return t.isRequired=e.bind(null,!0,null),t.withPredicate=function(t){if("function"!=typeof t)throw new Error(n.invalidPredicate);var r=e.bind(null,!1,t);return r.isRequired=e.bind(null,!0,t),r},t}function o(e,t,r){return new Error("The prop `"+e+"` "+n.requiredCore+" in `"+t+"`, but its value is `"+r+"`.")}e.exports={constructPropValidatorVariations:r,createMomentChecker:function(e,t,a,i){return r((function(r,c,s,l,u,d,f){var p=s[l],h=typeof p,m=function(e,t,n,r){var a=void 0===r,i=null===r;if(e){if(a)return o(n,t,"undefined");if(i)return o(n,t,"null")}return a||i?null:-1}(r,u=u||n.anonymousMessage,f=f||l,p);if(-1!==m)return m;if(t&&!t(p))return new Error(n.invalidTypeCore+": `"+l+"` of type `"+h+"` supplied to `"+u+"`, expected `"+e+"`.");if(!a(p))return new Error(n.baseInvalidMessage+d+" `"+l+"` of type `"+h+"` supplied to `"+u+"`, expected `"+i+"`.");if(c&&!c(p)){var y=c.name||n.anonymousMessage;return new Error(n.baseInvalidMessage+d+" `"+l+"` of type `"+h+"` supplied to `"+u+"`. "+n.predicateFailureCore+" `"+y+"`.")}return null}))},messages:n}},function(e,t,n){"use strict";function r(){return null}function o(){return r}r.isRequired=r,e.exports={and:o,between:o,booleanSome:o,childrenHavePropXorChildren:o,childrenOf:o,childrenOfType:o,childrenSequenceOf:o,componentWithName:o,disallowedIf:o,elementType:o,empty:o,explicitNull:o,forbidExtraProps:Object,integer:o,keysOf:o,mutuallyExclusiveProps:o,mutuallyExclusiveTrueProps:o,nChildren:o,nonNegativeInteger:r,nonNegativeNumber:o,numericString:o,object:o,or:o,predicate:o,range:o,ref:o,requiredBy:o,restrictedProp:o,sequenceOf:o,shape:o,stringEndsWith:o,stringStartsWith:o,uniqueArray:o,uniqueArrayOf:o,valuesOf:o,withShape:o}},function(e,t,n){"use strict";var r=n(708),o={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},a={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},i={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},c={};function s(e){return r.isMemo(e)?i:c[e.$$typeof]||o}c[r.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},c[r.Memo]=i;var l=Object.defineProperty,u=Object.getOwnPropertyNames,d=Object.getOwnPropertySymbols,f=Object.getOwnPropertyDescriptor,p=Object.getPrototypeOf,h=Object.prototype;e.exports=function e(t,n,r){if("string"!=typeof n){if(h){var o=p(n);o&&o!==h&&e(t,o,r)}var i=u(n);d&&(i=i.concat(d(n)));for(var c=s(t),m=s(n),y=0;y<i.length;++y){var b=i[y];if(!(a[b]||r&&r[b]||m&&m[b]||c&&c[b])){var g=f(n,b);try{l(t,b,g)}catch(e){}}}}return t}},function(e,t,n){"use strict";e.exports=n(709)},function(e,t,n){"use strict";var r="function"==typeof Symbol&&Symbol.for,o=r?Symbol.for("react.element"):60103,a=r?Symbol.for("react.portal"):60106,i=r?Symbol.for("react.fragment"):60107,c=r?Symbol.for("react.strict_mode"):60108,s=r?Symbol.for("react.profiler"):60114,l=r?Symbol.for("react.provider"):60109,u=r?Symbol.for("react.context"):60110,d=r?Symbol.for("react.async_mode"):60111,f=r?Symbol.for("react.concurrent_mode"):60111,p=r?Symbol.for("react.forward_ref"):60112,h=r?Symbol.for("react.suspense"):60113,m=r?Symbol.for("react.suspense_list"):60120,y=r?Symbol.for("react.memo"):60115,b=r?Symbol.for("react.lazy"):60116,g=r?Symbol.for("react.block"):60121,v=r?Symbol.for("react.fundamental"):60117,O=r?Symbol.for("react.responder"):60118,w=r?Symbol.for("react.scope"):60119;function _(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case o:switch(e=e.type){case d:case f:case i:case s:case c:case h:return e;default:switch(e=e&&e.$$typeof){case u:case p:case b:case y:case l:return e;default:return t}}case a:return t}}}function k(e){return _(e)===f}t.AsyncMode=d,t.ConcurrentMode=f,t.ContextConsumer=u,t.ContextProvider=l,t.Element=o,t.ForwardRef=p,t.Fragment=i,t.Lazy=b,t.Memo=y,t.Portal=a,t.Profiler=s,t.StrictMode=c,t.Suspense=h,t.isAsyncMode=function(e){return k(e)||_(e)===d},t.isConcurrentMode=k,t.isContextConsumer=function(e){return _(e)===u},t.isContextProvider=function(e){return _(e)===l},t.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===o},t.isForwardRef=function(e){return _(e)===p},t.isFragment=function(e){return _(e)===i},t.isLazy=function(e){return _(e)===b},t.isMemo=function(e){return _(e)===y},t.isPortal=function(e){return _(e)===a},t.isProfiler=function(e){return _(e)===s},t.isStrictMode=function(e){return _(e)===c},t.isSuspense=function(e){return _(e)===h},t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===i||e===f||e===s||e===c||e===h||e===m||"object"==typeof e&&null!==e&&(e.$$typeof===b||e.$$typeof===y||e.$$typeof===l||e.$$typeof===u||e.$$typeof===p||e.$$typeof===v||e.$$typeof===O||e.$$typeof===w||e.$$typeof===g)},t.typeOf=_},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CHANNEL="__direction__",t.DIRECTIONS={LTR:"ltr",RTL:"rtl"}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,o=(r=n(2))&&r.__esModule?r:{default:r};t.default=o.default.shape({getState:o.default.func,setState:o.default.func,subscribe:o.default.func})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){return"string"==typeof e?e:"function"==typeof e?e(t):""}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=l;var r=c(n(11)),o=n(104),a=c(n(350)),i=c(n(714));function c(e){return e&&e.__esModule?e:{default:e}}var s=(0,o.forbidExtraProps)({children:(0,o.or)([(0,o.childrenOfType)(a.default),(0,o.childrenOfType)(i.default)]).isRequired});function l(e){var t=e.children;return r.default.createElement("tr",null,t)}l.propTypes=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PureCustomizableCalendarDay=t.selectedStyles=t.lastInRangeStyles=t.selectedSpanStyles=t.hoveredSpanStyles=t.blockedOutOfRangeStyles=t.blockedCalendarStyles=t.blockedMinNightsStyles=t.highlightedCalendarStyles=t.outsideStyles=t.defaultStyles=void 0;var r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=b(n(112)),i=b(n(11)),c=b(n(2)),s=b(n(228)),l=b(n(178)),u=n(104),d=n(138),f=b(n(31)),p=n(118),h=b(n(128)),m=b(n(436)),y=n(77);function b(e){return e&&e.__esModule?e:{default:e}}function g(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function v(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}var O=b(n(410)).default.reactDates.color;function w(e,t){if(!e)return null;var n=e.hover;return t&&n?n:e}var _=c.default.shape({background:c.default.string,border:(0,u.or)([c.default.string,c.default.number]),color:c.default.string,hover:c.default.shape({background:c.default.string,border:(0,u.or)([c.default.string,c.default.number]),color:c.default.string})}),k=(0,u.forbidExtraProps)((0,a.default)({},d.withStylesPropTypes,{day:l.default.momentObj,daySize:u.nonNegativeInteger,isOutsideDay:c.default.bool,modifiers:c.default.instanceOf(Set),isFocused:c.default.bool,tabIndex:c.default.oneOf([0,-1]),onDayClick:c.default.func,onDayMouseEnter:c.default.func,onDayMouseLeave:c.default.func,renderDayContents:c.default.func,ariaLabelFormat:c.default.string,defaultStyles:_,outsideStyles:_,todayStyles:_,firstDayOfWeekStyles:_,lastDayOfWeekStyles:_,highlightedCalendarStyles:_,blockedMinNightsStyles:_,blockedCalendarStyles:_,blockedOutOfRangeStyles:_,hoveredSpanStyles:_,selectedSpanStyles:_,lastInRangeStyles:_,selectedStyles:_,selectedStartStyles:_,selectedEndStyles:_,afterHoveredStartStyles:_,phrases:c.default.shape((0,h.default)(p.CalendarDayPhrases))})),S=t.defaultStyles={border:"1px solid "+String(O.core.borderLight),color:O.text,background:O.background,hover:{background:O.core.borderLight,border:"1px double "+String(O.core.borderLight),color:"inherit"}},j=t.outsideStyles={background:O.outside.backgroundColor,border:0,color:O.outside.color},E=t.highlightedCalendarStyles={background:O.highlighted.backgroundColor,color:O.highlighted.color,hover:{background:O.highlighted.backgroundColor_hover,color:O.highlighted.color_active}},C=t.blockedMinNightsStyles={background:O.minimumNights.backgroundColor,border:"1px solid "+String(O.minimumNights.borderColor),color:O.minimumNights.color,hover:{background:O.minimumNights.backgroundColor_hover,color:O.minimumNights.color_active}},D=t.blockedCalendarStyles={background:O.blocked_calendar.backgroundColor,border:"1px solid "+String(O.blocked_calendar.borderColor),color:O.blocked_calendar.color,hover:{background:O.blocked_calendar.backgroundColor_hover,border:"1px solid "+String(O.blocked_calendar.borderColor),color:O.blocked_calendar.color_active}},P=t.blockedOutOfRangeStyles={background:O.blocked_out_of_range.backgroundColor,border:"1px solid "+String(O.blocked_out_of_range.borderColor),color:O.blocked_out_of_range.color,hover:{background:O.blocked_out_of_range.backgroundColor_hover,border:"1px solid "+String(O.blocked_out_of_range.borderColor),color:O.blocked_out_of_range.color_active}},x=t.hoveredSpanStyles={background:O.hoveredSpan.backgroundColor,border:"1px solid "+String(O.hoveredSpan.borderColor),color:O.hoveredSpan.color,hover:{background:O.hoveredSpan.backgroundColor_hover,border:"1px solid "+String(O.hoveredSpan.borderColor),color:O.hoveredSpan.color_active}},F=t.selectedSpanStyles={background:O.selectedSpan.backgroundColor,border:"1px solid "+String(O.selectedSpan.borderColor),color:O.selectedSpan.color,hover:{background:O.selectedSpan.backgroundColor_hover,border:"1px solid "+String(O.selectedSpan.borderColor),color:O.selectedSpan.color_active}},T=t.lastInRangeStyles={borderRight:O.core.primary},M=t.selectedStyles={background:O.selected.backgroundColor,border:"1px solid "+String(O.selected.borderColor),color:O.selected.color,hover:{background:O.selected.backgroundColor_hover,border:"1px solid "+String(O.selected.borderColor),color:O.selected.color_active}},R={day:(0,f.default)(),daySize:y.DAY_SIZE,isOutsideDay:!1,modifiers:new Set,isFocused:!1,tabIndex:-1,onDayClick:function(){},onDayMouseEnter:function(){},onDayMouseLeave:function(){},renderDayContents:null,ariaLabelFormat:"dddd, LL",defaultStyles:S,outsideStyles:j,todayStyles:{},highlightedCalendarStyles:E,blockedMinNightsStyles:C,blockedCalendarStyles:D,blockedOutOfRangeStyles:P,hoveredSpanStyles:x,selectedSpanStyles:F,lastInRangeStyles:T,selectedStyles:M,selectedStartStyles:{},selectedEndStyles:{},afterHoveredStartStyles:{},firstDayOfWeekStyles:{},lastDayOfWeekStyles:{},phrases:p.CalendarDayPhrases},I=function(e){function t(){var e;g(this,t);for(var n=arguments.length,r=Array(n),o=0;o<n;o++)r[o]=arguments[o];var a=v(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(r)));return a.state={isHovered:!1},a.setButtonRef=a.setButtonRef.bind(a),a}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),o(t,[{key:"shouldComponentUpdate",value:function(e,t){return(0,s.default)(this,e,t)}},{key:"componentDidUpdate",value:function(e){var t=this.props,n=t.isFocused,r=t.tabIndex;0===r&&(n||r!==e.tabIndex)&&this.buttonRef.focus()}},{key:"onDayClick",value:function(e,t){(0,this.props.onDayClick)(e,t)}},{key:"onDayMouseEnter",value:function(e,t){var n=this.props.onDayMouseEnter;this.setState({isHovered:!0}),n(e,t)}},{key:"onDayMouseLeave",value:function(e,t){var n=this.props.onDayMouseLeave;this.setState({isHovered:!1}),n(e,t)}},{key:"onKeyDown",value:function(e,t){var n=this.props.onDayClick,r=t.key;"Enter"!==r&&" "!==r||n(e,t)}},{key:"setButtonRef",value:function(e){this.buttonRef=e}},{key:"render",value:function(){var e=this,t=this.props,n=t.day,o=t.ariaLabelFormat,a=t.daySize,c=t.isOutsideDay,s=t.modifiers,l=t.tabIndex,u=t.renderDayContents,f=t.styles,p=t.phrases,h=t.defaultStyles,y=t.outsideStyles,b=t.todayStyles,g=t.firstDayOfWeekStyles,v=t.lastDayOfWeekStyles,O=t.highlightedCalendarStyles,_=t.blockedMinNightsStyles,k=t.blockedCalendarStyles,S=t.blockedOutOfRangeStyles,j=t.hoveredSpanStyles,E=t.selectedSpanStyles,C=t.lastInRangeStyles,D=t.selectedStyles,P=t.selectedStartStyles,x=t.selectedEndStyles,F=t.afterHoveredStartStyles,T=this.state.isHovered;if(!n)return i.default.createElement("td",null);var M=(0,m.default)(n,o,a,s,p),R=M.daySizeStyles,I=M.useDefaultCursor,A=M.selected,N=M.hoveredSpan,L=M.isOutsideRange,U=M.ariaLabel;return i.default.createElement("td",r({},(0,d.css)(f.CalendarDay,I&&f.CalendarDay__defaultCursor,R,w(h,T),c&&w(y,T),s.has("today")&&w(b,T),s.has("first-day-of-week")&&w(g,T),s.has("last-day-of-week")&&w(v,T),s.has("highlighted-calendar")&&w(O,T),s.has("blocked-minimum-nights")&&w(_,T),s.has("blocked-calendar")&&w(k,T),N&&w(j,T),s.has("after-hovered-start")&&w(F,T),s.has("selected-span")&&w(E,T),s.has("last-in-range")&&w(C,T),A&&w(D,T),s.has("selected-start")&&w(P,T),s.has("selected-end")&&w(x,T),L&&w(S,T)),{role:"button",ref:this.setButtonRef,"aria-label":U,onMouseEnter:function(t){e.onDayMouseEnter(n,t)},onMouseLeave:function(t){e.onDayMouseLeave(n,t)},onMouseUp:function(e){e.currentTarget.blur()},onClick:function(t){e.onDayClick(n,t)},onKeyDown:function(t){e.onKeyDown(n,t)},tabIndex:l}),u?u(n,s):n.format("D"))}}]),t}(i.default.Component);I.propTypes=k,I.defaultProps=R,t.PureCustomizableCalendarDay=I,t.default=(0,d.withStyles)((function(e){return{CalendarDay:{boxSizing:"border-box",cursor:"pointer",fontSize:e.reactDates.font.size,textAlign:"center",":active":{outline:0}},CalendarDay__defaultCursor:{cursor:"default"}}}))(I)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:o.default.localeData().firstDayOfWeek();if(!o.default.isMoment(e)||!e.isValid())throw new TypeError("`month` must be a valid moment object");if(-1===a.WEEKDAYS.indexOf(n))throw new TypeError("`firstDayOfWeek` must be an integer between 0 and 6");for(var r=e.clone().startOf("month").hour(12),i=e.clone().endOf("month").hour(12),c=(r.day()+7-n)%7,s=(n+6-i.day())%7,l=r.clone().subtract(c,"day"),u=i.clone().add(s,"day"),d=u.diff(l,"days")+1,f=l.clone(),p=[],h=0;h<d;h+=1){h%7==0&&p.push([]);var m=null;(h>=c&&h<d-s||t)&&(m=f.clone()),p[p.length-1].push(m),f.add(1,"day")}return p};var r,o=(r=n(31))&&r.__esModule?r:{default:r},a=n(77)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){return!("undefined"==typeof window||!("TransitionEvent"in window))}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return{transform:e,msTransform:e,MozTransform:e,WebkitTransform:e}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){return!(!r.default.isMoment(e)||!r.default.isMoment(t))&&(0,o.default)(e.clone().subtract(1,"month"),t)};var r=a(n(31)),o=a(n(441));function a(e){return e&&e.__esModule?e:{default:e}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){return!(!r.default.isMoment(e)||!r.default.isMoment(t))&&(0,o.default)(e.clone().add(1,"month"),t)};var r=a(n(31)),o=a(n(441));function a(e){return e&&e.__esModule?e:{default:e}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PureDateRangePicker=void 0;var r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=E(n(112)),i=E(n(11)),c=E(n(228)),s=E(n(31)),l=n(138),u=n(515),d=n(104),f=n(298),p=E(n(232)),h=E(n(351)),m=E(n(446)),y=n(118),b=E(n(450)),g=E(n(451)),v=E(n(353)),O=E(n(250)),w=E(n(452)),_=E(n(453)),k=E(n(462)),S=E(n(252)),j=n(77);function E(e){return e&&e.__esModule?e:{default:e}}var C=(0,d.forbidExtraProps)((0,a.default)({},l.withStylesPropTypes,m.default)),D={startDate:null,endDate:null,focusedInput:null,startDatePlaceholderText:"Start Date",endDatePlaceholderText:"End Date",disabled:!1,required:!1,readOnly:!1,screenReaderInputMessage:"",showClearDates:!1,showDefaultInputIcon:!1,inputIconPosition:j.ICON_BEFORE_POSITION,customInputIcon:null,customArrowIcon:null,customCloseIcon:null,noBorder:!1,block:!1,small:!1,regular:!1,keepFocusOnInput:!1,renderMonthText:null,orientation:j.HORIZONTAL_ORIENTATION,anchorDirection:j.ANCHOR_LEFT,openDirection:j.OPEN_DOWN,horizontalMargin:0,withPortal:!1,withFullScreenPortal:!1,appendToBody:!1,disableScroll:!1,initialVisibleMonth:null,numberOfMonths:2,keepOpenOnDateSelect:!1,reopenPickerOnClearDates:!1,renderCalendarInfo:null,calendarInfoPosition:j.INFO_POSITION_BOTTOM,hideKeyboardShortcutsPanel:!1,daySize:j.DAY_SIZE,isRTL:!1,firstDayOfWeek:null,verticalHeight:null,transitionDuration:void 0,verticalSpacing:j.DEFAULT_VERTICAL_SPACING,navPrev:null,navNext:null,onPrevMonthClick:function(){},onNextMonthClick:function(){},onClose:function(){},renderCalendarDay:void 0,renderDayContents:null,renderMonthElement:null,minimumNights:1,enableOutsideDays:!1,isDayBlocked:function(){return!1},isOutsideRange:function(e){return!(0,O.default)(e,(0,s.default)())},isDayHighlighted:function(){return!1},displayFormat:function(){return s.default.localeData().longDateFormat("L")},monthFormat:"MMMM YYYY",weekDayFormat:"dd",phrases:y.DateRangePickerPhrases,dayAriaLabelFormat:void 0},P=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.state={dayPickerContainerStyles:{},isDateRangePickerInputFocused:!1,isDayPickerFocused:!1,showKeyboardShortcuts:!1},n.isTouchDevice=!1,n.onOutsideClick=n.onOutsideClick.bind(n),n.onDateRangePickerInputFocus=n.onDateRangePickerInputFocus.bind(n),n.onDayPickerFocus=n.onDayPickerFocus.bind(n),n.onDayPickerBlur=n.onDayPickerBlur.bind(n),n.showKeyboardShortcutsPanel=n.showKeyboardShortcutsPanel.bind(n),n.responsivizePickerPosition=n.responsivizePickerPosition.bind(n),n.disableScroll=n.disableScroll.bind(n),n.setDayPickerContainerRef=n.setDayPickerContainerRef.bind(n),n.setContainerRef=n.setContainerRef.bind(n),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),o(t,[{key:"componentDidMount",value:function(){this.removeEventListener=(0,f.addEventListener)(window,"resize",this.responsivizePickerPosition,{passive:!0}),this.responsivizePickerPosition(),this.disableScroll(),this.props.focusedInput&&this.setState({isDateRangePickerInputFocused:!0}),this.isTouchDevice=(0,p.default)()}},{key:"shouldComponentUpdate",value:function(e,t){return(0,c.default)(this,e,t)}},{key:"componentDidUpdate",value:function(e){var t=this.props.focusedInput;!e.focusedInput&&t&&this.isOpened()?(this.responsivizePickerPosition(),this.disableScroll()):!e.focusedInput||t||this.isOpened()||this.enableScroll&&this.enableScroll()}},{key:"componentWillUnmount",value:function(){this.removeEventListener&&this.removeEventListener(),this.enableScroll&&this.enableScroll()}},{key:"onOutsideClick",value:function(e){var t=this.props,n=t.onFocusChange,r=t.onClose,o=t.startDate,a=t.endDate,i=t.appendToBody;this.isOpened()&&(i&&this.dayPickerContainer.contains(e.target)||(this.setState({isDateRangePickerInputFocused:!1,isDayPickerFocused:!1,showKeyboardShortcuts:!1}),n(null),r({startDate:o,endDate:a})))}},{key:"onDateRangePickerInputFocus",value:function(e){var t=this.props,n=t.onFocusChange,r=t.readOnly,o=t.withPortal,a=t.withFullScreenPortal,i=t.keepFocusOnInput;e&&(o||a||r&&!i||this.isTouchDevice&&!i?this.onDayPickerFocus():this.onDayPickerBlur()),n(e)}},{key:"onDayPickerFocus",value:function(){var e=this.props,t=e.focusedInput,n=e.onFocusChange;t||n(j.START_DATE),this.setState({isDateRangePickerInputFocused:!1,isDayPickerFocused:!0,showKeyboardShortcuts:!1})}},{key:"onDayPickerBlur",value:function(){this.setState({isDateRangePickerInputFocused:!0,isDayPickerFocused:!1,showKeyboardShortcuts:!1})}},{key:"setDayPickerContainerRef",value:function(e){this.dayPickerContainer=e}},{key:"setContainerRef",value:function(e){this.container=e}},{key:"isOpened",value:function(){var e=this.props.focusedInput;return e===j.START_DATE||e===j.END_DATE}},{key:"disableScroll",value:function(){var e=this.props,t=e.appendToBody,n=e.disableScroll;(t||n)&&this.isOpened()&&(this.enableScroll=(0,w.default)(this.container))}},{key:"responsivizePickerPosition",value:function(){if(this.setState({dayPickerContainerStyles:{}}),this.isOpened()){var e=this.props,t=e.openDirection,n=e.anchorDirection,r=e.horizontalMargin,o=e.withPortal,i=e.withFullScreenPortal,c=e.appendToBody,s=this.state.dayPickerContainerStyles,l=n===j.ANCHOR_LEFT;if(!o&&!i){var u=this.dayPickerContainer.getBoundingClientRect(),d=s[n]||0,f=l?u[j.ANCHOR_RIGHT]:u[j.ANCHOR_LEFT];this.setState({dayPickerContainerStyles:(0,a.default)({},(0,b.default)(n,d,f,r),c&&(0,g.default)(t,n,this.container))})}}}},{key:"showKeyboardShortcutsPanel",value:function(){this.setState({isDateRangePickerInputFocused:!1,isDayPickerFocused:!0,showKeyboardShortcuts:!0})}},{key:"maybeRenderDayPickerWithPortal",value:function(){var e=this.props,t=e.withPortal,n=e.withFullScreenPortal,r=e.appendToBody;return this.isOpened()?t||n||r?i.default.createElement(u.Portal,null,this.renderDayPicker()):this.renderDayPicker():null}},{key:"renderDayPicker",value:function(){var e=this.props,t=e.anchorDirection,n=e.openDirection,o=e.isDayBlocked,a=e.isDayHighlighted,c=e.isOutsideRange,u=e.numberOfMonths,d=e.orientation,f=e.monthFormat,p=e.renderMonthText,h=e.navPrev,m=e.navNext,y=e.onPrevMonthClick,b=e.onNextMonthClick,g=e.onDatesChange,O=e.onFocusChange,w=e.withPortal,_=e.withFullScreenPortal,E=e.daySize,C=e.enableOutsideDays,D=e.focusedInput,P=e.startDate,x=e.endDate,F=e.minimumNights,T=e.keepOpenOnDateSelect,M=e.renderCalendarDay,R=e.renderDayContents,I=e.renderCalendarInfo,A=e.renderMonthElement,N=e.calendarInfoPosition,L=e.firstDayOfWeek,U=e.initialVisibleMonth,B=e.hideKeyboardShortcutsPanel,H=e.customCloseIcon,q=e.onClose,z=e.phrases,V=e.dayAriaLabelFormat,K=e.isRTL,W=e.weekDayFormat,G=e.styles,Y=e.verticalHeight,$=e.transitionDuration,Q=e.verticalSpacing,J=e.small,Z=e.disabled,X=e.theme.reactDates,ee=this.state,te=ee.dayPickerContainerStyles,ne=ee.isDayPickerFocused,re=ee.showKeyboardShortcuts,oe=!_&&w?this.onOutsideClick:void 0,ae=U||function(){return P||x||(0,s.default)()},ie=H||i.default.createElement(S.default,(0,l.css)(G.DateRangePicker_closeButton_svg)),ce=(0,v.default)(X,J),se=w||_;return i.default.createElement("div",r({ref:this.setDayPickerContainerRef},(0,l.css)(G.DateRangePicker_picker,t===j.ANCHOR_LEFT&&G.DateRangePicker_picker__directionLeft,t===j.ANCHOR_RIGHT&&G.DateRangePicker_picker__directionRight,d===j.HORIZONTAL_ORIENTATION&&G.DateRangePicker_picker__horizontal,d===j.VERTICAL_ORIENTATION&&G.DateRangePicker_picker__vertical,!se&&n===j.OPEN_DOWN&&{top:ce+Q},!se&&n===j.OPEN_UP&&{bottom:ce+Q},se&&G.DateRangePicker_picker__portal,_&&G.DateRangePicker_picker__fullScreenPortal,K&&G.DateRangePicker_picker__rtl,te),{onClick:oe}),i.default.createElement(k.default,{orientation:d,enableOutsideDays:C,numberOfMonths:u,onPrevMonthClick:y,onNextMonthClick:b,onDatesChange:g,onFocusChange:O,onClose:q,focusedInput:D,startDate:P,endDate:x,monthFormat:f,renderMonthText:p,withPortal:se,daySize:E,initialVisibleMonth:ae,hideKeyboardShortcutsPanel:B,navPrev:h,navNext:m,minimumNights:F,isOutsideRange:c,isDayHighlighted:a,isDayBlocked:o,keepOpenOnDateSelect:T,renderCalendarDay:M,renderDayContents:R,renderCalendarInfo:I,renderMonthElement:A,calendarInfoPosition:N,isFocused:ne,showKeyboardShortcuts:re,onBlur:this.onDayPickerBlur,phrases:z,dayAriaLabelFormat:V,isRTL:K,firstDayOfWeek:L,weekDayFormat:W,verticalHeight:Y,transitionDuration:$,disabled:Z}),_&&i.default.createElement("button",r({},(0,l.css)(G.DateRangePicker_closeButton),{type:"button",onClick:this.onOutsideClick,"aria-label":z.closeDatePicker}),ie))}},{key:"render",value:function(){var e=this.props,t=e.startDate,n=e.startDateId,o=e.startDatePlaceholderText,a=e.endDate,c=e.endDateId,s=e.endDatePlaceholderText,u=e.focusedInput,d=e.screenReaderInputMessage,f=e.showClearDates,p=e.showDefaultInputIcon,m=e.inputIconPosition,y=e.customInputIcon,b=e.customArrowIcon,g=e.customCloseIcon,v=e.disabled,O=e.required,w=e.readOnly,k=e.openDirection,S=e.phrases,E=e.isOutsideRange,C=e.minimumNights,D=e.withPortal,P=e.withFullScreenPortal,x=e.displayFormat,F=e.reopenPickerOnClearDates,T=e.keepOpenOnDateSelect,M=e.onDatesChange,R=e.onClose,I=e.isRTL,A=e.noBorder,N=e.block,L=e.verticalSpacing,U=e.small,B=e.regular,H=e.styles,q=this.state.isDateRangePickerInputFocused,z=!D&&!P,V=L<j.FANG_HEIGHT_PX,K=i.default.createElement(_.default,{startDate:t,startDateId:n,startDatePlaceholderText:o,isStartDateFocused:u===j.START_DATE,endDate:a,endDateId:c,endDatePlaceholderText:s,isEndDateFocused:u===j.END_DATE,displayFormat:x,showClearDates:f,showCaret:!D&&!P&&!V,showDefaultInputIcon:p,inputIconPosition:m,customInputIcon:y,customArrowIcon:b,customCloseIcon:g,disabled:v,required:O,readOnly:w,openDirection:k,reopenPickerOnClearDates:F,keepOpenOnDateSelect:T,isOutsideRange:E,minimumNights:C,withFullScreenPortal:P,onDatesChange:M,onFocusChange:this.onDateRangePickerInputFocus,onKeyDownArrowDown:this.onDayPickerFocus,onKeyDownQuestionMark:this.showKeyboardShortcutsPanel,onClose:R,phrases:S,screenReaderMessage:d,isFocused:q,isRTL:I,noBorder:A,block:N,small:U,regular:B,verticalSpacing:L});return i.default.createElement("div",r({ref:this.setContainerRef},(0,l.css)(H.DateRangePicker,N&&H.DateRangePicker__block)),z&&i.default.createElement(h.default,{onOutsideClick:this.onOutsideClick},K,this.maybeRenderDayPickerWithPortal()),!z&&K,!z&&this.maybeRenderDayPickerWithPortal())}}]),t}(i.default.Component);P.propTypes=C,P.defaultProps=D,t.PureDateRangePicker=P,t.default=(0,l.withStyles)((function(e){var t=e.reactDates,n=t.color,r=t.zIndex;return{DateRangePicker:{position:"relative",display:"inline-block"},DateRangePicker__block:{display:"block"},DateRangePicker_picker:{zIndex:r+1,backgroundColor:n.background,position:"absolute"},DateRangePicker_picker__rtl:{direction:"rtl"},DateRangePicker_picker__directionLeft:{left:0},DateRangePicker_picker__directionRight:{right:0},DateRangePicker_picker__portal:{backgroundColor:"rgba(0, 0, 0, 0.3)",position:"fixed",top:0,left:0,height:"100%",width:"100%"},DateRangePicker_picker__fullScreenPortal:{backgroundColor:n.background},DateRangePicker_closeButton:{background:"none",border:0,color:"inherit",font:"inherit",lineHeight:"normal",overflow:"visible",cursor:"pointer",position:"absolute",top:0,right:0,padding:15,zIndex:r+2,":hover":{color:"darken("+String(n.core.grayLighter)+", 10%)",textDecoration:"none"},":focus":{color:"darken("+String(n.core.grayLighter)+", 10%)",textDecoration:"none"}},DateRangePicker_closeButton_svg:{height:15,width:15,fill:n.core.grayLighter}}}))(P)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=u(n(11)),a=u(n(2)),i=n(104),c=n(298),s=u(n(352)),l=u(n(723));function u(e){return e&&e.__esModule?e:{default:e}}function d(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function f(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}var p={BLOCK:"block",FLEX:"flex",INLINE:"inline",INLINE_BLOCK:"inline-block",CONTENTS:"contents"},h=(0,i.forbidExtraProps)({children:a.default.node.isRequired,onOutsideClick:a.default.func.isRequired,disabled:a.default.bool,useCapture:a.default.bool,display:a.default.oneOf((0,s.default)(p))}),m={disabled:!1,useCapture:!0,display:p.BLOCK},y=function(e){function t(){var e;d(this,t);for(var n=arguments.length,r=Array(n),o=0;o<n;o++)r[o]=arguments[o];var a=f(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(r)));return a.onMouseDown=a.onMouseDown.bind(a),a.onMouseUp=a.onMouseUp.bind(a),a.setChildNodeRef=a.setChildNodeRef.bind(a),a}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),r(t,[{key:"componentDidMount",value:function(){var e=this.props,t=e.disabled,n=e.useCapture;t||this.addMouseDownEventListener(n)}},{key:"componentDidUpdate",value:function(e){var t=e.disabled,n=this.props,r=n.disabled,o=n.useCapture;t!==r&&(r?this.removeEventListeners():this.addMouseDownEventListener(o))}},{key:"componentWillUnmount",value:function(){this.removeEventListeners()}},{key:"onMouseDown",value:function(e){var t=this.props.useCapture;this.childNode&&(0,l.default)(this.childNode,e.target)||(this.removeMouseUp&&(this.removeMouseUp(),this.removeMouseUp=null),this.removeMouseUp=(0,c.addEventListener)(document,"mouseup",this.onMouseUp,{capture:t}))}},{key:"onMouseUp",value:function(e){var t=this.props.onOutsideClick,n=this.childNode&&(0,l.default)(this.childNode,e.target);this.removeMouseUp&&(this.removeMouseUp(),this.removeMouseUp=null),n||t(e)}},{key:"setChildNodeRef",value:function(e){this.childNode=e}},{key:"addMouseDownEventListener",value:function(e){this.removeMouseDown=(0,c.addEventListener)(document,"mousedown",this.onMouseDown,{capture:e})}},{key:"removeEventListeners",value:function(){this.removeMouseDown&&this.removeMouseDown(),this.removeMouseUp&&this.removeMouseUp()}},{key:"render",value:function(){var e=this.props,t=e.children,n=e.display;return o.default.createElement("div",{ref:this.setChildNodeRef,style:n!==p.BLOCK&&(0,s.default)(p).includes(n)?{display:n}:void 0},t)}}]),t}(o.default.Component);t.default=y,y.propTypes=h,y.defaultProps=m},function(e,t,n){"use strict";var r=n(443),o=n(176);e.exports=function(){var e=r();return o(Object,{values:e},{values:function(){return Object.values!==e}}),e}},function(e,t,n){"use strict";var r=n(176),o=n(444),a=n(445),i=a(),c=function(e,t){return i.apply(e,[t])};r(c,{getPolyfill:a,implementation:o,shim:n(724)}),e.exports=c},function(e,t,n){"use strict";var r=n(176),o=n(445);e.exports=function(){var e=o();return"undefined"!=typeof document&&(r(document,{contains:e},{contains:function(){return document.contains!==e}}),"undefined"!=typeof Element&&r(Element.prototype,{contains:e},{contains:function(){return Element.prototype.contains!==e}})),e}},function(e,t,n){var r=n(354),o=n(726),a=n(728),i=Math.max,c=Math.min;e.exports=function(e,t,n){var s,l,u,d,f,p,h=0,m=!1,y=!1,b=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function g(t){var n=s,r=l;return s=l=void 0,h=t,d=e.apply(r,n)}function v(e){return h=e,f=setTimeout(w,t),m?g(e):d}function O(e){var n=e-p;return void 0===p||n>=t||n<0||y&&e-h>=u}function w(){var e=o();if(O(e))return _(e);f=setTimeout(w,function(e){var n=t-(e-p);return y?c(n,u-(e-h)):n}(e))}function _(e){return f=void 0,b&&s?g(e):(s=l=void 0,d)}function k(){var e=o(),n=O(e);if(s=arguments,l=this,p=e,n){if(void 0===f)return v(p);if(y)return clearTimeout(f),f=setTimeout(w,t),g(p)}return void 0===f&&(f=setTimeout(w,t)),d}return t=a(t)||0,r(n)&&(m=!!n.leading,u=(y="maxWait"in n)?i(a(n.maxWait)||0,t):u,b="trailing"in n?!!n.trailing:b),k.cancel=function(){void 0!==f&&clearTimeout(f),h=0,s=p=l=f=void 0},k.flush=function(){return void 0===f?d:_(o())},k}},function(e,t,n){var r=n(457);e.exports=function(){return r.Date.now()}},function(e,t,n){(function(t){var n="object"==typeof t&&t&&t.Object===Object&&t;e.exports=n}).call(this,n(225))},function(e,t,n){var r=n(729),o=n(354),a=n(731),i=/^[-+]0x[0-9a-f]+$/i,c=/^0b[01]+$/i,s=/^0o[0-7]+$/i,l=parseInt;e.exports=function(e){if("number"==typeof e)return e;if(a(e))return NaN;if(o(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=o(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=r(e);var n=c.test(e);return n||s.test(e)?l(e.slice(2),n?2:8):i.test(e)?NaN:+e}},function(e,t,n){var r=n(730),o=/^\s+/;e.exports=function(e){return e?e.slice(0,r(e)+1).replace(o,""):e}},function(e,t){var n=/\s/;e.exports=function(e){for(var t=e.length;t--&&n.test(e.charAt(t)););return t}},function(e,t,n){var r=n(732),o=n(735);e.exports=function(e){return"symbol"==typeof e||o(e)&&"[object Symbol]"==r(e)}},function(e,t,n){var r=n(458),o=n(733),a=n(734),i=r?r.toStringTag:void 0;e.exports=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":i&&i in Object(e)?o(e):a(e)}},function(e,t,n){var r=n(458),o=Object.prototype,a=o.hasOwnProperty,i=o.toString,c=r?r.toStringTag:void 0;e.exports=function(e){var t=a.call(e,c),n=e[c];try{e[c]=void 0;var r=!0}catch(e){}var o=i.call(e);return r&&(t?e[c]=n:delete e[c]),o}},function(e,t){var n=Object.prototype.toString;e.exports=function(e){return n.call(e)}},function(e,t){e.exports=function(e){return null!=e&&"object"==typeof e}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:r;return e?n(e(t.clone())):t};var r=function(e){return e}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},o=b(n(112)),a=b(n(11)),i=b(n(2)),c=n(104),s=n(138),l=n(118),u=b(n(128)),d=b(n(460)),f=b(n(459)),p=b(n(738)),h=b(n(739)),m=b(n(231)),y=n(77);function b(e){return e&&e.__esModule?e:{default:e}}function g(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}var v=(0,c.forbidExtraProps)((0,o.default)({},s.withStylesPropTypes,{navPrev:i.default.node,navNext:i.default.node,orientation:m.default,onPrevMonthClick:i.default.func,onNextMonthClick:i.default.func,phrases:i.default.shape((0,u.default)(l.DayPickerNavigationPhrases)),isRTL:i.default.bool})),O={navPrev:null,navNext:null,orientation:y.HORIZONTAL_ORIENTATION,onPrevMonthClick:function(){},onNextMonthClick:function(){},phrases:l.DayPickerNavigationPhrases,isRTL:!1};function w(e){var t=e.navPrev,n=e.navNext,o=e.onPrevMonthClick,i=e.onNextMonthClick,c=e.orientation,l=e.phrases,u=e.isRTL,m=e.styles,b=c===y.HORIZONTAL_ORIENTATION,v=c!==y.HORIZONTAL_ORIENTATION,O=c===y.VERTICAL_SCROLLABLE,w=t,_=n,k=!1,S=!1;if(!w){k=!0;var j=v?p.default:d.default;u&&!v&&(j=f.default),w=a.default.createElement(j,(0,s.css)(b&&m.DayPickerNavigation_svg__horizontal,v&&m.DayPickerNavigation_svg__vertical))}if(!_){S=!0;var E=v?h.default:f.default;u&&!v&&(E=d.default),_=a.default.createElement(E,(0,s.css)(b&&m.DayPickerNavigation_svg__horizontal,v&&m.DayPickerNavigation_svg__vertical))}var C=O?S:S||k;return a.default.createElement("div",s.css.apply(void 0,[m.DayPickerNavigation,b&&m.DayPickerNavigation__horizontal].concat(g(v&&[m.DayPickerNavigation__vertical,C&&m.DayPickerNavigation__verticalDefault]),g(O&&[m.DayPickerNavigation__verticalScrollable,C&&m.DayPickerNavigation__verticalScrollableDefault]))),!O&&a.default.createElement("div",r({role:"button",tabIndex:"0"},s.css.apply(void 0,[m.DayPickerNavigation_button,k&&m.DayPickerNavigation_button__default].concat(g(b&&[m.DayPickerNavigation_button__horizontal].concat(g(k&&[m.DayPickerNavigation_button__horizontalDefault,!u&&m.DayPickerNavigation_leftButton__horizontalDefault,u&&m.DayPickerNavigation_rightButton__horizontalDefault]))),g(v&&[m.DayPickerNavigation_button__vertical].concat(g(k&&[m.DayPickerNavigation_button__verticalDefault,m.DayPickerNavigation_prevButton__verticalDefault]))))),{"aria-label":l.jumpToPrevMonth,onClick:o,onKeyUp:function(e){var t=e.key;"Enter"!==t&&" "!==t||o(e)},onMouseUp:function(e){e.currentTarget.blur()}}),w),a.default.createElement("div",r({role:"button",tabIndex:"0"},s.css.apply(void 0,[m.DayPickerNavigation_button,S&&m.DayPickerNavigation_button__default].concat(g(b&&[m.DayPickerNavigation_button__horizontal].concat(g(S&&[m.DayPickerNavigation_button__horizontalDefault,u&&m.DayPickerNavigation_leftButton__horizontalDefault,!u&&m.DayPickerNavigation_rightButton__horizontalDefault]))),g(v&&[m.DayPickerNavigation_button__vertical,m.DayPickerNavigation_nextButton__vertical].concat(g(S&&[m.DayPickerNavigation_button__verticalDefault,m.DayPickerNavigation_nextButton__verticalDefault,O&&m.DayPickerNavigation_nextButton__verticalScrollableDefault]))))),{"aria-label":l.jumpToNextMonth,onClick:i,onKeyUp:function(e){var t=e.key;"Enter"!==t&&" "!==t||i(e)},onMouseUp:function(e){e.currentTarget.blur()}}),_))}w.propTypes=v,w.defaultProps=O,t.default=(0,s.withStyles)((function(e){var t=e.reactDates,n=t.color;return{DayPickerNavigation:{position:"relative",zIndex:t.zIndex+2},DayPickerNavigation__horizontal:{height:0},DayPickerNavigation__vertical:{},DayPickerNavigation__verticalScrollable:{},DayPickerNavigation__verticalDefault:{position:"absolute",width:"100%",height:52,bottom:0,left:0},DayPickerNavigation__verticalScrollableDefault:{position:"relative"},DayPickerNavigation_button:{cursor:"pointer",userSelect:"none",border:0,padding:0,margin:0},DayPickerNavigation_button__default:{border:"1px solid "+String(n.core.borderLight),backgroundColor:n.background,color:n.placeholderText,":focus":{border:"1px solid "+String(n.core.borderMedium)},":hover":{border:"1px solid "+String(n.core.borderMedium)},":active":{background:n.backgroundDark}},DayPickerNavigation_button__horizontal:{},DayPickerNavigation_button__horizontalDefault:{position:"absolute",top:18,lineHeight:.78,borderRadius:3,padding:"6px 9px"},DayPickerNavigation_leftButton__horizontalDefault:{left:22},DayPickerNavigation_rightButton__horizontalDefault:{right:22},DayPickerNavigation_button__vertical:{},DayPickerNavigation_button__verticalDefault:{padding:5,background:n.background,boxShadow:"0 0 5px 2px rgba(0, 0, 0, 0.1)",position:"relative",display:"inline-block",height:"100%",width:"50%"},DayPickerNavigation_prevButton__verticalDefault:{},DayPickerNavigation_nextButton__verticalDefault:{borderLeft:0},DayPickerNavigation_nextButton__verticalScrollableDefault:{width:"100%"},DayPickerNavigation_svg__horizontal:{height:19,width:19,fill:n.core.grayLight,display:"block"},DayPickerNavigation_svg__vertical:{height:42,width:42,fill:n.text,display:"block"}}}))(w)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,o=(r=n(11))&&r.__esModule?r:{default:r},a=function(e){return o.default.createElement("svg",e,o.default.createElement("path",{d:"M32.1 712.6l453.2-452.2c11-11 21-11 32 0l453.2 452.2c4 5 6 10 6 16 0 13-10 23-22 23-7 0-12-2-16-7L501.3 308.5 64.1 744.7c-4 5-9 7-15 7-7 0-12-2-17-7-9-11-9-21 0-32.1z"}))};a.defaultProps={viewBox:"0 0 1000 1000"},t.default=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,o=(r=n(11))&&r.__esModule?r:{default:r},a=function(e){return o.default.createElement("svg",e,o.default.createElement("path",{d:"M967.5 288.5L514.3 740.7c-11 11-21 11-32 0L29.1 288.5c-4-5-6-11-6-16 0-13 10-23 23-23 6 0 11 2 15 7l437.2 436.2 437.2-436.2c4-5 9-7 16-7 6 0 11 2 16 7 9 10.9 9 21 0 32z"}))};a.defaultProps={viewBox:"0 0 1000 1000"},t.default=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BOTTOM_RIGHT=t.TOP_RIGHT=t.TOP_LEFT=void 0;var r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=h(n(112)),i=h(n(11)),c=h(n(2)),s=n(104),l=n(138),u=n(118),d=h(n(128)),f=h(n(741)),p=h(n(252));function h(e){return e&&e.__esModule?e:{default:e}}function m(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function y(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}var b=t.TOP_LEFT="top-left",g=t.TOP_RIGHT="top-right",v=t.BOTTOM_RIGHT="bottom-right",O=(0,s.forbidExtraProps)((0,a.default)({},l.withStylesPropTypes,{block:c.default.bool,buttonLocation:c.default.oneOf([b,g,v]),showKeyboardShortcutsPanel:c.default.bool,openKeyboardShortcutsPanel:c.default.func,closeKeyboardShortcutsPanel:c.default.func,phrases:c.default.shape((0,d.default)(u.DayPickerKeyboardShortcutsPhrases))})),w={block:!1,buttonLocation:v,showKeyboardShortcutsPanel:!1,openKeyboardShortcutsPanel:function(){},closeKeyboardShortcutsPanel:function(){},phrases:u.DayPickerKeyboardShortcutsPhrases};function _(e){return[{unicode:"↵",label:e.enterKey,action:e.selectFocusedDate},{unicode:"←/→",label:e.leftArrowRightArrow,action:e.moveFocusByOneDay},{unicode:"↑/↓",label:e.upArrowDownArrow,action:e.moveFocusByOneWeek},{unicode:"PgUp/PgDn",label:e.pageUpPageDown,action:e.moveFocusByOneMonth},{unicode:"Home/End",label:e.homeEnd,action:e.moveFocustoStartAndEndOfWeek},{unicode:"Esc",label:e.escape,action:e.returnFocusToInput},{unicode:"?",label:e.questionMark,action:e.openThisPanel}]}var k=function(e){function t(){var e;m(this,t);for(var n=arguments.length,r=Array(n),o=0;o<n;o++)r[o]=arguments[o];var a=y(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(r))),i=a.props.phrases;return a.keyboardShortcuts=_(i),a.onShowKeyboardShortcutsButtonClick=a.onShowKeyboardShortcutsButtonClick.bind(a),a.setShowKeyboardShortcutsButtonRef=a.setShowKeyboardShortcutsButtonRef.bind(a),a.setHideKeyboardShortcutsButtonRef=a.setHideKeyboardShortcutsButtonRef.bind(a),a.handleFocus=a.handleFocus.bind(a),a.onKeyDown=a.onKeyDown.bind(a),a}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),o(t,[{key:"componentWillReceiveProps",value:function(e){var t=this.props.phrases;e.phrases!==t&&(this.keyboardShortcuts=_(e.phrases))}},{key:"componentDidUpdate",value:function(){this.handleFocus()}},{key:"onKeyDown",value:function(e){e.stopPropagation();var t=this.props.closeKeyboardShortcutsPanel;switch(e.key){case"Enter":case" ":case"Spacebar":case"Escape":t();break;case"ArrowUp":case"ArrowDown":break;case"Tab":case"Home":case"End":case"PageUp":case"PageDown":case"ArrowLeft":case"ArrowRight":e.preventDefault()}}},{key:"onShowKeyboardShortcutsButtonClick",value:function(){var e=this;(0,this.props.openKeyboardShortcutsPanel)((function(){e.showKeyboardShortcutsButton.focus()}))}},{key:"setShowKeyboardShortcutsButtonRef",value:function(e){this.showKeyboardShortcutsButton=e}},{key:"setHideKeyboardShortcutsButtonRef",value:function(e){this.hideKeyboardShortcutsButton=e}},{key:"handleFocus",value:function(){this.hideKeyboardShortcutsButton&&this.hideKeyboardShortcutsButton.focus()}},{key:"render",value:function(){var e=this,t=this.props,n=t.block,o=t.buttonLocation,a=t.showKeyboardShortcutsPanel,c=t.closeKeyboardShortcutsPanel,s=t.styles,u=t.phrases,d=a?u.hideKeyboardShortcutsPanel:u.showKeyboardShortcutsPanel,h=o===v,m=o===g,y=o===b;return i.default.createElement("div",null,i.default.createElement("button",r({ref:this.setShowKeyboardShortcutsButtonRef},(0,l.css)(s.DayPickerKeyboardShortcuts_buttonReset,s.DayPickerKeyboardShortcuts_show,h&&s.DayPickerKeyboardShortcuts_show__bottomRight,m&&s.DayPickerKeyboardShortcuts_show__topRight,y&&s.DayPickerKeyboardShortcuts_show__topLeft),{type:"button","aria-label":d,onClick:this.onShowKeyboardShortcutsButtonClick,onKeyDown:function(t){"Enter"===t.key?t.preventDefault():"Space"===t.key&&e.onShowKeyboardShortcutsButtonClick(t)},onMouseUp:function(e){e.currentTarget.blur()}}),i.default.createElement("span",(0,l.css)(s.DayPickerKeyboardShortcuts_showSpan,h&&s.DayPickerKeyboardShortcuts_showSpan__bottomRight,m&&s.DayPickerKeyboardShortcuts_showSpan__topRight,y&&s.DayPickerKeyboardShortcuts_showSpan__topLeft),"?")),a&&i.default.createElement("div",r({},(0,l.css)(s.DayPickerKeyboardShortcuts_panel),{role:"dialog","aria-labelledby":"DayPickerKeyboardShortcuts_title","aria-describedby":"DayPickerKeyboardShortcuts_description"}),i.default.createElement("div",r({},(0,l.css)(s.DayPickerKeyboardShortcuts_title),{id:"DayPickerKeyboardShortcuts_title"}),u.keyboardShortcuts),i.default.createElement("button",r({ref:this.setHideKeyboardShortcutsButtonRef},(0,l.css)(s.DayPickerKeyboardShortcuts_buttonReset,s.DayPickerKeyboardShortcuts_close),{type:"button",tabIndex:"0","aria-label":u.hideKeyboardShortcutsPanel,onClick:c,onKeyDown:this.onKeyDown}),i.default.createElement(p.default,(0,l.css)(s.DayPickerKeyboardShortcuts_closeSvg))),i.default.createElement("ul",r({},(0,l.css)(s.DayPickerKeyboardShortcuts_list),{id:"DayPickerKeyboardShortcuts_description"}),this.keyboardShortcuts.map((function(e){var t=e.unicode,r=e.label,o=e.action;return i.default.createElement(f.default,{key:r,unicode:t,label:r,action:o,block:n})})))))}}]),t}(i.default.Component);k.propTypes=O,k.defaultProps=w,t.default=(0,l.withStyles)((function(e){var t=e.reactDates,n=t.color,r=t.font,o=t.zIndex;return{DayPickerKeyboardShortcuts_buttonReset:{background:"none",border:0,borderRadius:0,color:"inherit",font:"inherit",lineHeight:"normal",overflow:"visible",padding:0,cursor:"pointer",fontSize:r.size,":active":{outline:"none"}},DayPickerKeyboardShortcuts_show:{width:22,position:"absolute",zIndex:o+2},DayPickerKeyboardShortcuts_show__bottomRight:{borderTop:"26px solid transparent",borderRight:"33px solid "+String(n.core.primary),bottom:0,right:0,":hover":{borderRight:"33px solid "+String(n.core.primary_dark)}},DayPickerKeyboardShortcuts_show__topRight:{borderBottom:"26px solid transparent",borderRight:"33px solid "+String(n.core.primary),top:0,right:0,":hover":{borderRight:"33px solid "+String(n.core.primary_dark)}},DayPickerKeyboardShortcuts_show__topLeft:{borderBottom:"26px solid transparent",borderLeft:"33px solid "+String(n.core.primary),top:0,left:0,":hover":{borderLeft:"33px solid "+String(n.core.primary_dark)}},DayPickerKeyboardShortcuts_showSpan:{color:n.core.white,position:"absolute"},DayPickerKeyboardShortcuts_showSpan__bottomRight:{bottom:0,right:-28},DayPickerKeyboardShortcuts_showSpan__topRight:{top:1,right:-28},DayPickerKeyboardShortcuts_showSpan__topLeft:{top:1,left:-28},DayPickerKeyboardShortcuts_panel:{overflow:"auto",background:n.background,border:"1px solid "+String(n.core.border),borderRadius:2,position:"absolute",top:0,bottom:0,right:0,left:0,zIndex:o+2,padding:22,margin:33},DayPickerKeyboardShortcuts_title:{fontSize:16,fontWeight:"bold",margin:0},DayPickerKeyboardShortcuts_list:{listStyle:"none",padding:0,fontSize:r.size},DayPickerKeyboardShortcuts_close:{position:"absolute",right:22,top:22,zIndex:o+2,":active":{outline:"none"}},DayPickerKeyboardShortcuts_closeSvg:{height:15,width:15,fill:n.core.grayLighter,":hover":{fill:n.core.grayLight},":focus":{fill:n.core.grayLight}}}}))(k)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},o=l(n(112)),a=l(n(11)),i=l(n(2)),c=n(104),s=n(138);function l(e){return e&&e.__esModule?e:{default:e}}var u=(0,c.forbidExtraProps)((0,o.default)({},s.withStylesPropTypes,{unicode:i.default.string.isRequired,label:i.default.string.isRequired,action:i.default.string.isRequired,block:i.default.bool}));function d(e){var t=e.unicode,n=e.label,o=e.action,i=e.block,c=e.styles;return a.default.createElement("li",(0,s.css)(c.KeyboardShortcutRow,i&&c.KeyboardShortcutRow__block),a.default.createElement("div",(0,s.css)(c.KeyboardShortcutRow_keyContainer,i&&c.KeyboardShortcutRow_keyContainer__block),a.default.createElement("span",r({},(0,s.css)(c.KeyboardShortcutRow_key),{role:"img","aria-label":String(n)+","}),t)),a.default.createElement("div",(0,s.css)(c.KeyboardShortcutRow_action),o))}d.propTypes=u,d.defaultProps={block:!1},t.default=(0,s.withStyles)((function(e){return{KeyboardShortcutRow:{listStyle:"none",margin:"6px 0"},KeyboardShortcutRow__block:{marginBottom:16},KeyboardShortcutRow_keyContainer:{display:"inline-block",whiteSpace:"nowrap",textAlign:"right",marginRight:6},KeyboardShortcutRow_keyContainer__block:{textAlign:"left",display:"inline"},KeyboardShortcutRow_key:{fontFamily:"monospace",fontSize:12,textTransform:"uppercase",background:e.reactDates.color.core.grayLightest,padding:"2px 6px"},KeyboardShortcutRow_action:{display:"inline",wordBreak:"break-word",marginLeft:8}}}))(d)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:o.default.localeData().firstDayOfWeek(),n=e.clone().startOf("month"),r=a(n,t);return Math.ceil((r+e.daysInMonth())/7)};var r,o=(r=n(31))&&r.__esModule?r:{default:r};function a(e,t){return(e.day()-t+7)%7}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){return"undefined"!=typeof document&&document.activeElement}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PureSingleDatePicker=void 0;var r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=C(n(112)),i=C(n(11)),c=C(n(31)),s=n(138),l=n(515),u=n(104),d=n(298),f=C(n(232)),p=C(n(351)),h=C(n(466)),m=n(118),y=C(n(230)),b=C(n(355)),g=C(n(450)),v=C(n(451)),O=C(n(353)),w=C(n(250)),_=C(n(452)),k=C(n(467)),S=C(n(465)),j=C(n(252)),E=n(77);function C(e){return e&&e.__esModule?e:{default:e}}var D=(0,u.forbidExtraProps)((0,a.default)({},s.withStylesPropTypes,h.default)),P={date:null,focused:!1,id:"date",placeholder:"Date",disabled:!1,required:!1,readOnly:!1,screenReaderInputMessage:"",showClearDate:!1,showDefaultInputIcon:!1,inputIconPosition:E.ICON_BEFORE_POSITION,customInputIcon:null,customCloseIcon:null,noBorder:!1,block:!1,small:!1,regular:!1,verticalSpacing:E.DEFAULT_VERTICAL_SPACING,keepFocusOnInput:!1,orientation:E.HORIZONTAL_ORIENTATION,anchorDirection:E.ANCHOR_LEFT,openDirection:E.OPEN_DOWN,horizontalMargin:0,withPortal:!1,withFullScreenPortal:!1,appendToBody:!1,disableScroll:!1,initialVisibleMonth:null,firstDayOfWeek:null,numberOfMonths:2,keepOpenOnDateSelect:!1,reopenPickerOnClearDate:!1,renderCalendarInfo:null,calendarInfoPosition:E.INFO_POSITION_BOTTOM,hideKeyboardShortcutsPanel:!1,daySize:E.DAY_SIZE,isRTL:!1,verticalHeight:null,transitionDuration:void 0,horizontalMonthPadding:13,navPrev:null,navNext:null,onPrevMonthClick:function(){},onNextMonthClick:function(){},onClose:function(){},renderMonthText:null,renderCalendarDay:void 0,renderDayContents:null,renderMonthElement:null,enableOutsideDays:!1,isDayBlocked:function(){return!1},isOutsideRange:function(e){return!(0,w.default)(e,(0,c.default)())},isDayHighlighted:function(){},displayFormat:function(){return c.default.localeData().longDateFormat("L")},monthFormat:"MMMM YYYY",weekDayFormat:"dd",phrases:m.SingleDatePickerPhrases,dayAriaLabelFormat:void 0},x=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.isTouchDevice=!1,n.state={dayPickerContainerStyles:{},isDayPickerFocused:!1,isInputFocused:!1,showKeyboardShortcuts:!1},n.onDayPickerFocus=n.onDayPickerFocus.bind(n),n.onDayPickerBlur=n.onDayPickerBlur.bind(n),n.showKeyboardShortcutsPanel=n.showKeyboardShortcutsPanel.bind(n),n.onChange=n.onChange.bind(n),n.onFocus=n.onFocus.bind(n),n.onClearFocus=n.onClearFocus.bind(n),n.clearDate=n.clearDate.bind(n),n.responsivizePickerPosition=n.responsivizePickerPosition.bind(n),n.disableScroll=n.disableScroll.bind(n),n.setDayPickerContainerRef=n.setDayPickerContainerRef.bind(n),n.setContainerRef=n.setContainerRef.bind(n),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),o(t,[{key:"componentDidMount",value:function(){this.removeEventListener=(0,d.addEventListener)(window,"resize",this.responsivizePickerPosition,{passive:!0}),this.responsivizePickerPosition(),this.disableScroll(),this.props.focused&&this.setState({isInputFocused:!0}),this.isTouchDevice=(0,f.default)()}},{key:"componentDidUpdate",value:function(e){var t=this.props.focused;!e.focused&&t?(this.responsivizePickerPosition(),this.disableScroll()):e.focused&&!t&&this.enableScroll&&this.enableScroll()}},{key:"componentWillUnmount",value:function(){this.removeEventListener&&this.removeEventListener(),this.enableScroll&&this.enableScroll()}},{key:"onChange",value:function(e){var t=this.props,n=t.isOutsideRange,r=t.keepOpenOnDateSelect,o=t.onDateChange,a=t.onFocusChange,i=t.onClose,c=(0,y.default)(e,this.getDisplayFormat());c&&!n(c)?(o(c),r||(a({focused:!1}),i({date:c}))):o(null)}},{key:"onFocus",value:function(){var e=this.props,t=e.disabled,n=e.onFocusChange,r=e.readOnly,o=e.withPortal,a=e.withFullScreenPortal,i=e.keepFocusOnInput;o||a||r&&!i||this.isTouchDevice&&!i?this.onDayPickerFocus():this.onDayPickerBlur(),t||n({focused:!0})}},{key:"onClearFocus",value:function(e){var t=this.props,n=t.date,r=t.focused,o=t.onFocusChange,a=t.onClose,i=t.appendToBody;r&&(i&&this.dayPickerContainer.contains(e.target)||(this.setState({isInputFocused:!1,isDayPickerFocused:!1}),o({focused:!1}),a({date:n})))}},{key:"onDayPickerFocus",value:function(){this.setState({isInputFocused:!1,isDayPickerFocused:!0,showKeyboardShortcuts:!1})}},{key:"onDayPickerBlur",value:function(){this.setState({isInputFocused:!0,isDayPickerFocused:!1,showKeyboardShortcuts:!1})}},{key:"getDateString",value:function(e){var t=this.getDisplayFormat();return e&&t?e&&e.format(t):(0,b.default)(e)}},{key:"getDisplayFormat",value:function(){var e=this.props.displayFormat;return"string"==typeof e?e:e()}},{key:"setDayPickerContainerRef",value:function(e){this.dayPickerContainer=e}},{key:"setContainerRef",value:function(e){this.container=e}},{key:"clearDate",value:function(){var e=this.props,t=e.onDateChange,n=e.reopenPickerOnClearDate,r=e.onFocusChange;t(null),n&&r({focused:!0})}},{key:"disableScroll",value:function(){var e=this.props,t=e.appendToBody,n=e.disableScroll,r=e.focused;(t||n)&&r&&(this.enableScroll=(0,_.default)(this.container))}},{key:"responsivizePickerPosition",value:function(){this.setState({dayPickerContainerStyles:{}});var e=this.props,t=e.openDirection,n=e.anchorDirection,r=e.horizontalMargin,o=e.withPortal,i=e.withFullScreenPortal,c=e.appendToBody,s=e.focused,l=this.state.dayPickerContainerStyles;if(s){var u=n===E.ANCHOR_LEFT;if(!o&&!i){var d=this.dayPickerContainer.getBoundingClientRect(),f=l[n]||0,p=u?d[E.ANCHOR_RIGHT]:d[E.ANCHOR_LEFT];this.setState({dayPickerContainerStyles:(0,a.default)({},(0,g.default)(n,f,p,r),c&&(0,v.default)(t,n,this.container))})}}}},{key:"showKeyboardShortcutsPanel",value:function(){this.setState({isInputFocused:!1,isDayPickerFocused:!0,showKeyboardShortcuts:!0})}},{key:"maybeRenderDayPickerWithPortal",value:function(){var e=this.props,t=e.focused,n=e.withPortal,r=e.withFullScreenPortal,o=e.appendToBody;return t?n||r||o?i.default.createElement(l.Portal,null,this.renderDayPicker()):this.renderDayPicker():null}},{key:"renderDayPicker",value:function(){var e=this.props,t=e.anchorDirection,n=e.openDirection,o=e.onDateChange,a=e.date,c=e.onFocusChange,l=e.focused,u=e.enableOutsideDays,d=e.numberOfMonths,f=e.orientation,p=e.monthFormat,h=e.navPrev,m=e.navNext,y=e.onPrevMonthClick,b=e.onNextMonthClick,g=e.onClose,v=e.withPortal,w=e.withFullScreenPortal,_=e.keepOpenOnDateSelect,k=e.initialVisibleMonth,C=e.renderMonthText,D=e.renderCalendarDay,P=e.renderDayContents,x=e.renderCalendarInfo,F=e.renderMonthElement,T=e.calendarInfoPosition,M=e.hideKeyboardShortcutsPanel,R=e.firstDayOfWeek,I=e.customCloseIcon,A=e.phrases,N=e.dayAriaLabelFormat,L=e.daySize,U=e.isRTL,B=e.isOutsideRange,H=e.isDayBlocked,q=e.isDayHighlighted,z=e.weekDayFormat,V=e.styles,K=e.verticalHeight,W=e.transitionDuration,G=e.verticalSpacing,Y=e.horizontalMonthPadding,$=e.small,Q=e.theme.reactDates,J=this.state,Z=J.dayPickerContainerStyles,X=J.isDayPickerFocused,ee=J.showKeyboardShortcuts,te=!w&&v?this.onClearFocus:void 0,ne=I||i.default.createElement(j.default,null),re=(0,O.default)(Q,$),oe=v||w;return i.default.createElement("div",r({ref:this.setDayPickerContainerRef},(0,s.css)(V.SingleDatePicker_picker,t===E.ANCHOR_LEFT&&V.SingleDatePicker_picker__directionLeft,t===E.ANCHOR_RIGHT&&V.SingleDatePicker_picker__directionRight,n===E.OPEN_DOWN&&V.SingleDatePicker_picker__openDown,n===E.OPEN_UP&&V.SingleDatePicker_picker__openUp,!oe&&n===E.OPEN_DOWN&&{top:re+G},!oe&&n===E.OPEN_UP&&{bottom:re+G},f===E.HORIZONTAL_ORIENTATION&&V.SingleDatePicker_picker__horizontal,f===E.VERTICAL_ORIENTATION&&V.SingleDatePicker_picker__vertical,oe&&V.SingleDatePicker_picker__portal,w&&V.SingleDatePicker_picker__fullScreenPortal,U&&V.SingleDatePicker_picker__rtl,Z),{onClick:te}),i.default.createElement(S.default,{date:a,onDateChange:o,onFocusChange:c,orientation:f,enableOutsideDays:u,numberOfMonths:d,monthFormat:p,withPortal:oe,focused:l,keepOpenOnDateSelect:_,hideKeyboardShortcutsPanel:M,initialVisibleMonth:k,navPrev:h,navNext:m,onPrevMonthClick:y,onNextMonthClick:b,onClose:g,renderMonthText:C,renderCalendarDay:D,renderDayContents:P,renderCalendarInfo:x,renderMonthElement:F,calendarInfoPosition:T,isFocused:X,showKeyboardShortcuts:ee,onBlur:this.onDayPickerBlur,phrases:A,dayAriaLabelFormat:N,daySize:L,isRTL:U,isOutsideRange:B,isDayBlocked:H,isDayHighlighted:q,firstDayOfWeek:R,weekDayFormat:z,verticalHeight:K,transitionDuration:W,horizontalMonthPadding:Y}),w&&i.default.createElement("button",r({},(0,s.css)(V.SingleDatePicker_closeButton),{"aria-label":A.closeDatePicker,type:"button",onClick:this.onClearFocus}),i.default.createElement("div",(0,s.css)(V.SingleDatePicker_closeButton_svg),ne)))}},{key:"render",value:function(){var e=this.props,t=e.id,n=e.placeholder,o=e.disabled,a=e.focused,c=e.required,l=e.readOnly,u=e.openDirection,d=e.showClearDate,f=e.showDefaultInputIcon,h=e.inputIconPosition,m=e.customCloseIcon,y=e.customInputIcon,b=e.date,g=e.phrases,v=e.withPortal,O=e.withFullScreenPortal,w=e.screenReaderInputMessage,_=e.isRTL,S=e.noBorder,j=e.block,C=e.small,D=e.regular,P=e.verticalSpacing,x=e.styles,F=this.state.isInputFocused,T=this.getDateString(b),M=!v&&!O,R=P<E.FANG_HEIGHT_PX,I=i.default.createElement(k.default,{id:t,placeholder:n,focused:a,isFocused:F,disabled:o,required:c,readOnly:l,openDirection:u,showCaret:!v&&!O&&!R,onClearDate:this.clearDate,showClearDate:d,showDefaultInputIcon:f,inputIconPosition:h,customCloseIcon:m,customInputIcon:y,displayValue:T,onChange:this.onChange,onFocus:this.onFocus,onKeyDownShiftTab:this.onClearFocus,onKeyDownTab:this.onClearFocus,onKeyDownArrowDown:this.onDayPickerFocus,onKeyDownQuestionMark:this.showKeyboardShortcutsPanel,screenReaderMessage:w,phrases:g,isRTL:_,noBorder:S,block:j,small:C,regular:D,verticalSpacing:P});return i.default.createElement("div",r({ref:this.setContainerRef},(0,s.css)(x.SingleDatePicker,j&&x.SingleDatePicker__block)),M&&i.default.createElement(p.default,{onOutsideClick:this.onClearFocus},I,this.maybeRenderDayPickerWithPortal()),!M&&I,!M&&this.maybeRenderDayPickerWithPortal())}}]),t}(i.default.Component);x.propTypes=D,x.defaultProps=P,t.PureSingleDatePicker=x,t.default=(0,s.withStyles)((function(e){var t=e.reactDates,n=t.color,r=t.zIndex;return{SingleDatePicker:{position:"relative",display:"inline-block"},SingleDatePicker__block:{display:"block"},SingleDatePicker_picker:{zIndex:r+1,backgroundColor:n.background,position:"absolute"},SingleDatePicker_picker__rtl:{direction:"rtl"},SingleDatePicker_picker__directionLeft:{left:0},SingleDatePicker_picker__directionRight:{right:0},SingleDatePicker_picker__portal:{backgroundColor:"rgba(0, 0, 0, 0.3)",position:"fixed",top:0,left:0,height:"100%",width:"100%"},SingleDatePicker_picker__fullScreenPortal:{backgroundColor:n.background},SingleDatePicker_closeButton:{background:"none",border:0,color:"inherit",font:"inherit",lineHeight:"normal",overflow:"visible",cursor:"pointer",position:"absolute",top:0,right:0,padding:15,zIndex:r+2,":hover":{color:"darken("+String(n.core.grayLighter)+", 10%)",textDecoration:"none"},":focus":{color:"darken("+String(n.core.grayLighter)+", 10%)",textDecoration:"none"}},SingleDatePicker_closeButton_svg:{height:15,width:15,fill:n.core.grayLighter}}}))(x)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){return!(!r.default.isMoment(e)||!r.default.isMoment(t)||(0,o.default)(e,t))};var r=a(n(31)),o=a(n(301));function a(e){return e&&e.__esModule?e:{default:e}}},function(e,t,n){(function(e,r){var o;!function(a){t&&t.nodeType,e&&e.nodeType;var i="object"==typeof r&&r;i.global!==i&&i.window!==i&&i.self;var c,s=2147483647,l=/^xn--/,u=/[^\x20-\x7E]/,d=/[\x2E\u3002\uFF0E\uFF61]/g,f={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},p=Math.floor,h=String.fromCharCode;function m(e){throw new RangeError(f[e])}function y(e,t){for(var n=e.length,r=[];n--;)r[n]=t(e[n]);return r}function b(e,t){var n=e.split("@"),r="";return n.length>1&&(r=n[0]+"@",e=n[1]),r+y((e=e.replace(d,".")).split("."),t).join(".")}function g(e){for(var t,n,r=[],o=0,a=e.length;o<a;)(t=e.charCodeAt(o++))>=55296&&t<=56319&&o<a?56320==(64512&(n=e.charCodeAt(o++)))?r.push(((1023&t)<<10)+(1023&n)+65536):(r.push(t),o--):r.push(t);return r}function v(e){return y(e,(function(e){var t="";return e>65535&&(t+=h((e-=65536)>>>10&1023|55296),e=56320|1023&e),t+h(e)})).join("")}function O(e,t){return e+22+75*(e<26)-((0!=t)<<5)}function w(e,t,n){var r=0;for(e=n?p(e/700):e>>1,e+=p(e/t);e>455;r+=36)e=p(e/35);return p(r+36*e/(e+38))}function _(e){var t,n,r,o,a,i,c,l,u,d,f,h=[],y=e.length,b=0,g=128,O=72;for((n=e.lastIndexOf("-"))<0&&(n=0),r=0;r<n;++r)e.charCodeAt(r)>=128&&m("not-basic"),h.push(e.charCodeAt(r));for(o=n>0?n+1:0;o<y;){for(a=b,i=1,c=36;o>=y&&m("invalid-input"),((l=(f=e.charCodeAt(o++))-48<10?f-22:f-65<26?f-65:f-97<26?f-97:36)>=36||l>p((s-b)/i))&&m("overflow"),b+=l*i,!(l<(u=c<=O?1:c>=O+26?26:c-O));c+=36)i>p(s/(d=36-u))&&m("overflow"),i*=d;O=w(b-a,t=h.length+1,0==a),p(b/t)>s-g&&m("overflow"),g+=p(b/t),b%=t,h.splice(b++,0,g)}return v(h)}function k(e){var t,n,r,o,a,i,c,l,u,d,f,y,b,v,_,k=[];for(y=(e=g(e)).length,t=128,n=0,a=72,i=0;i<y;++i)(f=e[i])<128&&k.push(h(f));for(r=o=k.length,o&&k.push("-");r<y;){for(c=s,i=0;i<y;++i)(f=e[i])>=t&&f<c&&(c=f);for(c-t>p((s-n)/(b=r+1))&&m("overflow"),n+=(c-t)*b,t=c,i=0;i<y;++i)if((f=e[i])<t&&++n>s&&m("overflow"),f==t){for(l=n,u=36;!(l<(d=u<=a?1:u>=a+26?26:u-a));u+=36)_=l-d,v=36-d,k.push(h(O(d+_%v,0))),l=p(_/v);k.push(h(O(l,0))),a=w(n,b,r==o),n=0,++r}++n,++t}return k.join("")}c={version:"1.4.1",ucs2:{decode:g,encode:v},decode:_,encode:k,toASCII:function(e){return b(e,(function(e){return u.test(e)?"xn--"+k(e):e}))},toUnicode:function(e){return b(e,(function(e){return l.test(e)?_(e.slice(4).toLowerCase()):e}))}},void 0===(o=function(){return c}.call(t,n,t,e))||(e.exports=o)}()}).call(this,n(747)(e),n(225))},function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}},function(e,t,n){"use strict";e.exports={isString:function(e){return"string"==typeof e},isObject:function(e){return"object"==typeof e&&null!==e},isNull:function(e){return null===e},isNullOrUndefined:function(e){return null==e}}},function(e,t,n){"use strict";t.decode=t.parse=n(750),t.encode=t.stringify=n(751)},function(e,t,n){"use strict";function r(e,t){return Object.prototype.hasOwnProperty.call(e,t)}e.exports=function(e,t,n,a){t=t||"&",n=n||"=";var i={};if("string"!=typeof e||0===e.length)return i;var c=/\+/g;e=e.split(t);var s=1e3;a&&"number"==typeof a.maxKeys&&(s=a.maxKeys);var l=e.length;s>0&&l>s&&(l=s);for(var u=0;u<l;++u){var d,f,p,h,m=e[u].replace(c,"%20"),y=m.indexOf(n);y>=0?(d=m.substr(0,y),f=m.substr(y+1)):(d=m,f=""),p=decodeURIComponent(d),h=decodeURIComponent(f),r(i,p)?o(i[p])?i[p].push(h):i[p]=[i[p],h]:i[p]=h}return i};var o=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)}},function(e,t,n){"use strict";var r=function(e){switch(typeof e){case"string":return e;case"boolean":return e?"true":"false";case"number":return isFinite(e)?e:"";default:return""}};e.exports=function(e,t,n,c){return t=t||"&",n=n||"=",null===e&&(e=void 0),"object"==typeof e?a(i(e),(function(i){var c=encodeURIComponent(r(i))+n;return o(e[i])?a(e[i],(function(e){return c+encodeURIComponent(r(e))})).join(t):c+encodeURIComponent(r(e[i]))})).join(t):c?encodeURIComponent(r(c))+n+encodeURIComponent(r(e)):""};var o=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)};function a(e,t){if(e.map)return e.map(t);for(var n=[],r=0;r<e.length;r++)n.push(t(e[r],r));return n}var i=Object.keys||function(e){var t=[];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.push(n);return t}},function(e,t){var n,r;n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r={rotl:function(e,t){return e<<t|e>>>32-t},rotr:function(e,t){return e<<32-t|e>>>t},endian:function(e){if(e.constructor==Number)return 16711935&r.rotl(e,8)|4278255360&r.rotl(e,24);for(var t=0;t<e.length;t++)e[t]=r.endian(e[t]);return e},randomBytes:function(e){for(var t=[];e>0;e--)t.push(Math.floor(256*Math.random()));return t},bytesToWords:function(e){for(var t=[],n=0,r=0;n<e.length;n++,r+=8)t[r>>>5]|=e[n]<<24-r%32;return t},wordsToBytes:function(e){for(var t=[],n=0;n<32*e.length;n+=8)t.push(e[n>>>5]>>>24-n%32&255);return t},bytesToHex:function(e){for(var t=[],n=0;n<e.length;n++)t.push((e[n]>>>4).toString(16)),t.push((15&e[n]).toString(16));return t.join("")},hexToBytes:function(e){for(var t=[],n=0;n<e.length;n+=2)t.push(parseInt(e.substr(n,2),16));return t},bytesToBase64:function(e){for(var t=[],r=0;r<e.length;r+=3)for(var o=e[r]<<16|e[r+1]<<8|e[r+2],a=0;a<4;a++)8*r+6*a<=8*e.length?t.push(n.charAt(o>>>6*(3-a)&63)):t.push("=");return t.join("")},base64ToBytes:function(e){e=e.replace(/[^A-Z0-9+\/]/gi,"");for(var t=[],r=0,o=0;r<e.length;o=++r%4)0!=o&&t.push((n.indexOf(e.charAt(r-1))&Math.pow(2,-2*o+8)-1)<<2*o|n.indexOf(e.charAt(r))>>>6-2*o);return t}},e.exports=r},function(e,t){function n(e){return!!e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}e.exports=function(e){return null!=e&&(n(e)||function(e){return"function"==typeof e.readFloatLE&&"function"==typeof e.slice&&n(e.slice(0,0))}(e)||!!e._isBuffer)}},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(e,t,n){"use strict";var r=60103,o=60106,a=60107,i=60108,c=60114,s=60109,l=60110,u=60112,d=60113,f=60120,p=60115,h=60116,m=60121,y=60122,b=60117,g=60129,v=60131;if("function"==typeof Symbol&&Symbol.for){var O=Symbol.for;r=O("react.element"),o=O("react.portal"),a=O("react.fragment"),i=O("react.strict_mode"),c=O("react.profiler"),s=O("react.provider"),l=O("react.context"),u=O("react.forward_ref"),d=O("react.suspense"),f=O("react.suspense_list"),p=O("react.memo"),h=O("react.lazy"),m=O("react.block"),y=O("react.server.block"),b=O("react.fundamental"),g=O("react.debug_trace_mode"),v=O("react.legacy_hidden")}function w(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case r:switch(e=e.type){case a:case c:case i:case d:case f:return e;default:switch(e=e&&e.$$typeof){case l:case u:case h:case p:case s:return e;default:return t}}case o:return t}}}var _=s,k=r,S=u,j=a,E=h,C=p,D=o,P=c,x=i,F=d;t.ContextConsumer=l,t.ContextProvider=_,t.Element=k,t.ForwardRef=S,t.Fragment=j,t.Lazy=E,t.Memo=C,t.Portal=D,t.Profiler=P,t.StrictMode=x,t.Suspense=F,t.isAsyncMode=function(){return!1},t.isConcurrentMode=function(){return!1},t.isContextConsumer=function(e){return w(e)===l},t.isContextProvider=function(e){return w(e)===s},t.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===r},t.isForwardRef=function(e){return w(e)===u},t.isFragment=function(e){return w(e)===a},t.isLazy=function(e){return w(e)===h},t.isMemo=function(e){return w(e)===p},t.isPortal=function(e){return w(e)===o},t.isProfiler=function(e){return w(e)===c},t.isStrictMode=function(e){return w(e)===i},t.isSuspense=function(e){return w(e)===d},t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===a||e===c||e===g||e===i||e===d||e===f||e===v||"object"==typeof e&&null!==e&&(e.$$typeof===h||e.$$typeof===p||e.$$typeof===s||e.$$typeof===l||e.$$typeof===u||e.$$typeof===b||e.$$typeof===m||e[0]===y)},t.typeOf=w},,,,,,,,,,,,,,function(e,t,n){"use strict";var r=n(817);e.exports=function(e,t,n){n=n||{},9===t.nodeType&&(t=r.getWindow(t));var o=n.allowHorizontalScroll,a=n.onlyScrollIfNeeded,i=n.alignWithTop,c=n.alignWithLeft,s=n.offsetTop||0,l=n.offsetLeft||0,u=n.offsetBottom||0,d=n.offsetRight||0;o=void 0===o||o;var f=r.isWindow(t),p=r.offset(e),h=r.outerHeight(e),m=r.outerWidth(e),y=void 0,b=void 0,g=void 0,v=void 0,O=void 0,w=void 0,_=void 0,k=void 0,S=void 0,j=void 0;f?(_=t,j=r.height(_),S=r.width(_),k={left:r.scrollLeft(_),top:r.scrollTop(_)},O={left:p.left-k.left-l,top:p.top-k.top-s},w={left:p.left+m-(k.left+S)+d,top:p.top+h-(k.top+j)+u},v=k):(y=r.offset(t),b=t.clientHeight,g=t.clientWidth,v={left:t.scrollLeft,top:t.scrollTop},O={left:p.left-(y.left+(parseFloat(r.css(t,"borderLeftWidth"))||0))-l,top:p.top-(y.top+(parseFloat(r.css(t,"borderTopWidth"))||0))-s},w={left:p.left+m-(y.left+g+(parseFloat(r.css(t,"borderRightWidth"))||0))+d,top:p.top+h-(y.top+b+(parseFloat(r.css(t,"borderBottomWidth"))||0))+u}),O.top<0||w.top>0?!0===i?r.scrollTop(t,v.top+O.top):!1===i?r.scrollTop(t,v.top+w.top):O.top<0?r.scrollTop(t,v.top+O.top):r.scrollTop(t,v.top+w.top):a||((i=void 0===i||!!i)?r.scrollTop(t,v.top+O.top):r.scrollTop(t,v.top+w.top)),o&&(O.left<0||w.left>0?!0===c?r.scrollLeft(t,v.left+O.left):!1===c?r.scrollLeft(t,v.left+w.left):O.left<0?r.scrollLeft(t,v.left+O.left):r.scrollLeft(t,v.left+w.left):a||((c=void 0===c||!!c)?r.scrollLeft(t,v.left+O.left):r.scrollLeft(t,v.left+w.left)))}},function(e,t,n){"use strict";var r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};function a(e,t){var n=e["page"+(t?"Y":"X")+"Offset"],r="scroll"+(t?"Top":"Left");if("number"!=typeof n){var o=e.document;"number"!=typeof(n=o.documentElement[r])&&(n=o.body[r])}return n}function i(e){return a(e)}function c(e){return a(e,!0)}function s(e){var t=function(e){var t,n=void 0,r=void 0,o=e.ownerDocument,a=o.body,i=o&&o.documentElement;return n=(t=e.getBoundingClientRect()).left,r=t.top,{left:n-=i.clientLeft||a.clientLeft||0,top:r-=i.clientTop||a.clientTop||0}}(e),n=e.ownerDocument,r=n.defaultView||n.parentWindow;return t.left+=i(r),t.top+=c(r),t}var l=new RegExp("^("+/[\-+]?(?:\d*\.|)\d+(?:[eE][\-+]?\d+|)/.source+")(?!px)[a-z%]+$","i"),u=/^(top|right|bottom|left)$/,d="left",f=void 0;function p(e,t){for(var n=0;n<e.length;n++)t(e[n])}function h(e){return"border-box"===f(e,"boxSizing")}"undefined"!=typeof window&&(f=window.getComputedStyle?function(e,t,n){var r="",o=e.ownerDocument,a=n||o.defaultView.getComputedStyle(e,null);return a&&(r=a.getPropertyValue(t)||a[t]),r}:function(e,t){var n=e.currentStyle&&e.currentStyle[t];if(l.test(n)&&!u.test(t)){var r=e.style,o=r[d],a=e.runtimeStyle[d];e.runtimeStyle[d]=e.currentStyle[d],r[d]="fontSize"===t?"1em":n||0,n=r.pixelLeft+"px",r[d]=o,e.runtimeStyle[d]=a}return""===n?"auto":n});var m=["margin","border","padding"];function y(e,t,n){var r={},o=e.style,a=void 0;for(a in t)t.hasOwnProperty(a)&&(r[a]=o[a],o[a]=t[a]);for(a in n.call(e),t)t.hasOwnProperty(a)&&(o[a]=r[a])}function b(e,t,n){var r=0,o=void 0,a=void 0,i=void 0;for(a=0;a<t.length;a++)if(o=t[a])for(i=0;i<n.length;i++){var c;c="border"===o?o+n[i]+"Width":o+n[i],r+=parseFloat(f(e,c))||0}return r}function g(e){return null!=e&&e==e.window}var v={};function O(e,t,n){if(g(e))return"width"===t?v.viewportWidth(e):v.viewportHeight(e);if(9===e.nodeType)return"width"===t?v.docWidth(e):v.docHeight(e);var r="width"===t?["Left","Right"]:["Top","Bottom"],o="width"===t?e.offsetWidth:e.offsetHeight,a=(f(e),h(e)),i=0;(null==o||o<=0)&&(o=void 0,(null==(i=f(e,t))||Number(i)<0)&&(i=e.style[t]||0),i=parseFloat(i)||0),void 0===n&&(n=a?1:-1);var c=void 0!==o||a,s=o||i;if(-1===n)return c?s-b(e,["border","padding"],r):i;if(c){var l=2===n?-b(e,["border"],r):b(e,["margin"],r);return s+(1===n?0:l)}return i+b(e,m.slice(n),r)}p(["Width","Height"],(function(e){v["doc"+e]=function(t){var n=t.document;return Math.max(n.documentElement["scroll"+e],n.body["scroll"+e],v["viewport"+e](n))},v["viewport"+e]=function(t){var n="client"+e,r=t.document,o=r.body,a=r.documentElement[n];return"CSS1Compat"===r.compatMode&&a||o&&o[n]||a}}));var w={position:"absolute",visibility:"hidden",display:"block"};function _(e){var t=void 0,n=arguments;return 0!==e.offsetWidth?t=O.apply(void 0,n):y(e,w,(function(){t=O.apply(void 0,n)})),t}function k(e,t,n){var r=n;if("object"!==(void 0===t?"undefined":o(t)))return void 0!==r?("number"==typeof r&&(r+="px"),void(e.style[t]=r)):f(e,t);for(var a in t)t.hasOwnProperty(a)&&k(e,a,t[a])}p(["width","height"],(function(e){var t=e.charAt(0).toUpperCase()+e.slice(1);v["outer"+t]=function(t,n){return t&&_(t,e,n?0:1)};var n="width"===e?["Left","Right"]:["Top","Bottom"];v[e]=function(t,r){return void 0===r?t&&_(t,e,-1):t?(f(t),h(t)&&(r+=b(t,["padding","border"],n)),k(t,e,r)):void 0}})),e.exports=r({getWindow:function(e){var t=e.ownerDocument||e;return t.defaultView||t.parentWindow},offset:function(e,t){if(void 0===t)return s(e);!function(e,t){"static"===k(e,"position")&&(e.style.position="relative");var n=s(e),r={},o=void 0,a=void 0;for(a in t)t.hasOwnProperty(a)&&(o=parseFloat(k(e,a))||0,r[a]=o+t[a]-n[a]);k(e,r)}(e,t)},isWindow:g,each:p,css:k,clone:function(e){var t={};for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);if(e.overflow)for(var n in e)e.hasOwnProperty(n)&&(t.overflow[n]=e.overflow[n]);return t},scrollLeft:function(e,t){if(g(e)){if(void 0===t)return i(e);window.scrollTo(t,c(e))}else{if(void 0===t)return e.scrollLeft;e.scrollLeft=t}},scrollTop:function(e,t){if(g(e)){if(void 0===t)return c(e);window.scrollTo(i(e),t)}else{if(void 0===t)return e.scrollTop;e.scrollTop=t}},viewportWidth:0,viewportHeight:0},v)},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(e,t,n){"use strict";var r=n(0),o=n(28),a=Object(r.createElement)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(r.createElement)(o.Path,{d:"M13 11.8l6.1-6.3-1-1-6.1 6.2-6.1-6.2-1 1 6.1 6.3-6.5 6.7 1 1 6.5-6.6 6.5 6.6 1-1z"}));t.a=a},,,,,,,,,,,,function(e,t,n){"use strict";var r=n(0),o=n(7),a=n(6),i=n.n(a),c=n(1),s=n(64),l=n(878),u=n(182);t.a=function(e){var t=e.className,n=e.status,a=void 0===n?"info":n,d=e.children,f=e.spokenMessage,p=void 0===f?d:f,h=e.onRemove,m=void 0===h?o.noop:h,y=e.isDismissible,b=void 0===y||y,g=e.actions,v=void 0===g?[]:g,O=e.politeness,w=void 0===O?function(e){switch(e){case"success":case"warning":case"info":return"polite";case"error":default:return"assertive"}}(a):O,_=e.__unstableHTML;!function(e,t){var n="string"==typeof e?e:Object(r.renderToString)(e);Object(r.useEffect)((function(){n&&Object(s.speak)(n,t)}),[n,t])}(p,w);var k=i()(t,"components-notice","is-"+a,{"is-dismissible":b});return _&&(d=Object(r.createElement)(r.RawHTML,null,d)),Object(r.createElement)("div",{className:k},Object(r.createElement)("div",{className:"components-notice__content"},d,v.map((function(e,t){var n=e.className,o=e.label,a=e.isPrimary,c=e.noDefaultClasses,s=void 0!==c&&c,l=e.onClick,d=e.url;return Object(r.createElement)(u.a,{key:t,href:d,isPrimary:a,isSecondary:!s&&!d,isLink:!s&&!!d,onClick:d?void 0:l,className:i()("components-notice__action",n)},o)}))),b&&Object(r.createElement)(u.a,{className:"components-notice__dismiss",icon:l.a,label:Object(c.__)("Dismiss this notice"),onClick:m,showTooltip:!1}))}},function(e,t,n){"use strict";var r=n(51),o=n(105),a=n(61),i=n(0),c=n(6),s=n.n(c),l=n(21),u=n(320);t.a=function(e){var t,n=e.icon,c=e.children,d=e.label,f=e.instructions,p=e.className,h=e.notices,m=e.preview,y=e.isColumnLayout,b=Object(a.a)(e,["icon","children","label","instructions","className","notices","preview","isColumnLayout"]),g=Object(l.useResizeObserver)(),v=Object(o.a)(g,2),O=v[0],w=v[1].width;"number"==typeof w&&(t={"is-large":w>=320,"is-medium":w>=160&&w<320,"is-small":w<160});var _=s()("components-placeholder",p,t),k=s()("components-placeholder__fieldset",{"is-column-layout":y});return Object(i.createElement)("div",Object(r.a)({},b,{className:_}),O,h,m&&Object(i.createElement)("div",{className:"components-placeholder__preview"},m),Object(i.createElement)("div",{className:"components-placeholder__label"},Object(i.createElement)(u.a,{icon:n}),d),!!f&&Object(i.createElement)("div",{className:"components-placeholder__instructions"},f),Object(i.createElement)("div",{className:k},c))}},function(e,t,n){"use strict";var r=n(0);t.a=function({icon:e,size:t=24,...n}){return Object(r.cloneElement)(e,{width:t,height:t,...n})}},function(e,t,n){"use strict";var r=n(0),o=n(28);const a=Object(r.createElement)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(r.createElement)(o.Path,{d:"M19 6H6c-1.1 0-2 .9-2 2v9c0 1.1.9 2 2 2h13c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2zM6 17.5c-.3 0-.5-.2-.5-.5V8c0-.3.2-.5.5-.5h3v10H6zm13.5-.5c0 .3-.2.5-.5.5h-3v-10h3c.3 0 .5.2.5.5v9z"}));t.a=a},function(e,t,n){"use strict";var r=n(51),o=n(61),a=n(0),i=n(7),c=n(6),s=n.n(c),l=n(74),u=Object(a.createContext)(!1),d=u.Consumer,f=u.Provider,p=["BUTTON","FIELDSET","INPUT","OPTGROUP","OPTION","SELECT","TEXTAREA"];function h(e){var t=e.className,n=e.children,c=Object(o.a)(e,["className","children"]),u=Object(a.useRef)(),d=function(){l.focus.focusable.find(u.current).forEach((function(e){Object(i.includes)(p,e.nodeName)&&e.setAttribute("disabled",""),"A"===e.nodeName&&e.setAttribute("tabindex",-1);var t=e.getAttribute("tabindex");null!==t&&"-1"!==t&&e.removeAttribute("tabindex"),e.hasAttribute("contenteditable")&&e.setAttribute("contenteditable","false")}))},h=Object(a.useCallback)(Object(i.debounce)(d,{leading:!0}),[]);return Object(a.useLayoutEffect)((function(){d();var e=new window.MutationObserver(h);return e.observe(u.current,{childList:!0,attributes:!0,subtree:!0}),function(){e.disconnect(),h.cancel()}}),[]),Object(a.createElement)(f,{value:!0},Object(a.createElement)("div",Object(r.a)({ref:u,className:s()(t,"components-disabled")},c),n))}h.Consumer=d,t.a=h},function(e,t,n){"use strict";var r=n(0),o=n(28);const a=Object(r.createElement)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(r.createElement)(o.Path,{d:"M18.2 17c0 .7-.6 1.2-1.2 1.2H7c-.7 0-1.2-.6-1.2-1.2V7c0-.7.6-1.2 1.2-1.2h3.2V4.2H7C5.5 4.2 4.2 5.5 4.2 7v10c0 1.5 1.2 2.8 2.8 2.8h10c1.5 0 2.8-1.2 2.8-2.8v-3.6h-1.5V17zM14.9 3v1.5h3.7l-6.4 6.4 1.1 1.1 6.4-6.4v3.7h1.5V3h-6.3z"}));t.a=a},function(e,t,n){"use strict";var r=n(0),o=n(28);const a=Object(r.createElement)(o.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},Object(r.createElement)(o.Path,{d:"M19 6.5H5c-1.1 0-2 .9-2 2v7c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2v-7c0-1.1-.9-2-2-2zm.5 9c0 .3-.2.5-.5.5H5c-.3 0-.5-.2-.5-.5v-7c0-.3.2-.5.5-.5h14c.3 0 .5.2.5.5v7zM8 12.8h8v-1.5H8v1.5z"}));t.a=a},function(e,t,n){"use strict";var r=n(51),o=n(160),a=n(105),i=n(61),c=n(0),s=n(7),l=n(6),u=n.n(l),d=n(21),f=n(94);function p(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}var h=function(e){var t=e.icon,n=e.size,r=void 0===n?24:n,o=Object(i.a)(e,["icon","size"]);return Object(c.cloneElement)(t,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?p(Object(n),!0).forEach((function(t){Object(f.a)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):p(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({width:r,height:r},o))},m=n(28),y=Object(c.createElement)(m.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},Object(c.createElement)(m.Path,{d:"M17.5 11.6L12 16l-5.5-4.4.9-1.2L12 14l4.5-3.6 1 1.2z"})),b=n(319),g=n(95),v=n(80),O=n(318),w=n(492);function _(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var k=v.b,S=n(317);function j(){var e=_(["\n\t","\n\t","\n"]);return j=function(){return e},e}function E(){var e=_(["\n\t\t\t\t","\n\t\t\t\t","\n\t\t\t"]);return E=function(){return e},e}function C(){var e=_(["\n\t\t\t\t","\n\t\t\t\t","\n\t\t\t"]);return C=function(){return e},e}function D(){var e=_(["\n\t\t\t\t","\n\t\t\t"]);return D=function(){return e},e}function P(){var e=_(["\n\t\t\t\t","\n\t\t\t\t","\n\t\t\t"]);return P=function(){return e},e}function x(){var e=_(["\n\t\t\t\t","\n\t\t\t\t","\n\t\t\t"]);return x=function(){return e},e}function F(){var e=_(["\n\t\t\t\t","\n\t\t\t\t","\n\t\t\t"]);return F=function(){return e},e}function T(){var e=_(["\n\t\t\t\t","\n\t\t\t\t","\n\t\t\t"]);return T=function(){return e},e}function M(){var e=_(["\n\t\t\t\t","\n\t\t\t\t","\n\t\t\t"]);return M=function(){return e},e}var R="\n  ".concat("font-weight: 400;","\n"),I="\n\tfont-size: 32px;\n\tline-height: 40px;\n",A="\n\tfont-size: 24px;\n\tline-height: 32px;\n",N="\n\tfont-size: 20px;\n\tline-height: 28px;\n",L="\n\t".concat("font-weight: 600;","\n\tfont-size: 14px;\n\tline-height: 20px;\n"),U="\n\t".concat("font-weight: 400;","\n"),B="\n\tfont-size: 16px;\n\tline-height: 24px;\n",H="\n\tfont-size: 14px;\n\tline-height: 20px;\n",q="\n  ".concat("font-weight: 600;","\n  font-size: 14px;\n  line-height: 20px;\n"),z="\n\t".concat("font-weight: 400;","\n\tfont-size: 12px;\n\tline-height: 16px;\n"),V="\n\t".concat("font-weight: 600;","\n\tfont-size: 12px;\n\tline-height: 16px;\n"),K="\n\t".concat("font-weight: 500;","\n\tfont-size: 11px;\n\tline-height: 1.4;\n\ttext-transform: uppercase;\n\tcolor: ").concat(S.b.gray[700],"\n"),W=Object(g.a)("p",{target:"e15wbhsk0",label:"Text"})("\n\tbox-sizing: border-box;\n\tmargin: 0;\n",(function(e){return k(j(),'font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,\nOxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;',function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"body";switch(e){case"title.large":return k(M(),R,I);case"title.medium":return k(T(),R,A);case"title.small":return k(F(),R,N);case"subtitle":return k(x(),L,"\n\tfont-size: 16px;\n\tline-height: 24px;\n");case"subtitle.small":return k(P(),L,"\n\tfont-size: 14px;\n\tline-height: 20px;\n");case"body":return k(D(),U);case"body.large":return k(C(),U,B);case"body.small":return k(E(),U,H);case"button":return q;case"caption":return z;case"label":return V;case"sectionheading":return K}}(e.variant))}),""),G=n(76),Y=new RegExp(/-left/g),$=new RegExp(/-right/g),Q=new RegExp(/Left/g),J=new RegExp(/Right/g);function Z(){return!(!document||"rtl"!==document.documentElement.dir)}function X(e){return"left"===e?"right":"right"===e?"left":Y.test(e)?e.replace(Y,"-right"):$.test(e)?e.replace($,"-left"):Q.test(e)?e.replace(Q,"Right"):J.test(e)?e.replace(J,"Left"):e}var ee=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Object(s.mapKeys)(e,(function(e,t){return X(t)}))};function te(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return function(){var n=Z();return t?n?Object(v.b)(t,""):Object(v.b)(e,""):n?Object(v.b)(ee(e),""):Object(v.b)(e,"")}}var ne={name:"1dacand",styles:"padding-top:0;"},re=function(){return ne},oe={name:"r6z5ec",styles:"z-index:1;"},ae=function(e){return e.isFocused?oe:""},ie={name:"uz6002",styles:"align-items:flex-start;flex-direction:column;"},ce={name:"53hdd7",styles:"align-items:flex-start;flex-direction:column-reverse;"},se={name:"x4dmss",styles:"justify-content:space-between;"},le=function(e){switch(e.labelPosition){case"top":return ie;case"bottom":return ce;case"edge":return se;default:return""}},ue=Object(g.a)(O.b,{target:"e1cr7zh10",label:"Root"})("position:relative;border-radius:2px;",re," ",ae," ",le,""),de={name:"8atqhb",styles:"width:100%;"},fe=Object(g.a)("div",{target:"e1cr7zh11",label:"Container"})("align-items:center;box-sizing:border-box;border-radius:inherit;display:flex;flex:1;position:relative;",(function(e){var t=e.disabled?Object(G.a)("ui.backgroundDisabled"):Object(G.a)("ui.background");return Object(v.b)({backgroundColor:t},"")})," ",(function(e){var t=e.__unstableInputWidth,n=e.labelPosition;return t?"side"===n?"":"edge"===n?Object(v.b)({flex:"0 0 ".concat(t)},""):Object(v.b)({width:t},""):de}),""),pe={name:"103r1kr",styles:"&::-webkit-input-placeholder{line-height:normal;}"},he=(Object(g.a)("input",{target:"e1cr7zh12",label:"Input"})("&&&{background-color:transparent;box-sizing:border-box;border:none;box-shadow:none !important;color:",Object(G.a)("black"),";display:block;margin:0;outline:none;padding-left:8px;padding-right:8px;width:100%;",(function(e){var t=e.isDragging,n=e.dragCursor,r="",o="";return t&&(r=Object(v.b)("cursor:",n,";user-select:none;&::-webkit-outer-spin-button,&::-webkit-inner-spin-button{-webkit-appearance:none !important;margin:0 !important;}")),t&&n&&(o=Object(v.b)("&:active{cursor:",n,";}")),Object(v.b)(r," ",o,"")})," ",(function(e){return e.disabled?Object(v.b)({color:Object(G.a)("ui.textDisabled")},""):""})," ",(function(e){var t={default:"13px",small:"11px"}[e.size];return t?Object(v.b)("font-size:","16px",";@media ( min-width:600px ){font-size:",t,";}"):""})," ",(function(e){var t={default:{height:30,lineHeight:1,minHeight:30},small:{height:24,lineHeight:1,minHeight:24}},n=t[e.size]||t.default;return Object(v.b)(n,"")})," ",(function(){return pe}),"}"),{name:"8uhtka",styles:"overflow:hidden;text-overflow:ellipsis;white-space:nowrap;"}),me=function(){return he},ye=function(e){var t=e.labelPosition,n=4;return"edge"!==t&&"side"!==t||(n=0),Object(v.b)({paddingTop:0,paddingBottom:n},"")},be=Object(g.a)(W,{target:"e1cr7zh13",label:"BaseLabel"})("&&&{box-sizing:border-box;color:currentColor;display:block;margin:0;max-width:100%;z-index:1;",ye," ",me,"}"),ge=function(e){return Object(c.createElement)(be,Object(r.a)({},e,{as:"label"}))},ve=Object(g.a)(w.a,{target:"e1cr7zh14",label:"LabelWrapper"})({name:"120o8im",styles:"max-width:calc( 100% - 10px );"}),Oe=Object(g.a)("div",{target:"e1cr7zh15",label:"BackdropUI"})("&&&{box-sizing:border-box;border-radius:inherit;bottom:0;left:0;margin:0;padding:0;pointer-events:none;position:absolute;right:0;top:0;",(function(e){var t=e.disabled,n=e.isFocused,r=n?Object(G.a)("ui.borderFocus"):Object(G.a)("ui.border"),o=null;return n&&(o="0 0 0 1px ".concat(Object(G.a)("ui.borderFocus")," inset")),t&&(r=Object(G.a)("ui.borderDisabled")),Object(v.b)({boxShadow:o,borderColor:r,borderStyle:"solid",borderWidth:1},"")})," ",te({paddingLeft:2}),"}"),we=Object(g.a)("span",{target:"e1cr7zh16",label:"Prefix"})({name:"1pxuk39",styles:"box-sizing:border-box;display:block;"}),_e=Object(g.a)("span",{target:"e1cr7zh17",label:"Suffix"})({name:"1pxuk39",styles:"box-sizing:border-box;display:block;"}),ke=Object(c.memo)((function(e){var t=e.disabled,n=void 0!==t&&t,r=e.isFocused,o=void 0!==r&&r;return Object(c.createElement)(Oe,{"aria-hidden":"true",className:"components-input-control__backdrop",disabled:n,isFocused:o})})),Se=n(284);function je(e){var t=e.children,n=e.hideLabelFromVision,o=e.htmlFor,a=Object(i.a)(e,["children","hideLabelFromVision","htmlFor"]);return t?n?Object(c.createElement)(Se.a,{as:"label",htmlFor:o},t):Object(c.createElement)(ge,Object(r.a)({htmlFor:o},a),t):null}var Ee=Object(c.forwardRef)((function e(t,n){var o=t.__unstableInputWidth,a=t.children,s=t.className,l=t.disabled,u=void 0!==l&&l,f=t.hideLabelFromVision,p=void 0!==f&&f,h=t.labelPosition,m=t.id,y=t.isFocused,b=void 0!==y&&y,g=t.label,v=t.prefix,O=t.size,w=void 0===O?"default":O,_=t.suffix,k=Object(i.a)(t,["__unstableInputWidth","children","className","disabled","hideLabelFromVision","labelPosition","id","isFocused","label","prefix","size","suffix"]),S=function(t){var n=Object(d.useInstanceId)(e),r="input-base-control-".concat(n);return t||r}(m);return Object(c.createElement)(ue,Object(r.a)({},k,{className:s,isFocused:b,labelPosition:h,ref:n}),Object(c.createElement)(ve,null,Object(c.createElement)(je,{className:"components-input-control__label",hideLabelFromVision:p,labelPosition:h,htmlFor:S,size:w},g)),Object(c.createElement)(fe,{__unstableInputWidth:o,className:"components-input-control__container",disabled:u,isFocused:b,labelPosition:h},v&&Object(c.createElement)(we,{className:"components-input-control__prefix"},v),a,_&&Object(c.createElement)(_e,{className:"components-input-control__suffix"},_),Object(c.createElement)(ke,{"aria-hidden":"true",disabled:u,isFocused:b,label:g,size:w})))})),Ce=Object(g.a)("select",{target:"e12x0a390",label:"Select"})("&&&{appearance:none;background:transparent;box-sizing:border-box;border:none;box-shadow:none !important;color:",Object(G.a)("black"),";display:block;margin:0;outline:none;width:100%;",(function(e){return e.disabled?Object(v.b)({color:Object(G.a)("ui.textDisabled")},""):""}),";",(function(e){var t={default:"13px",small:"11px"}[e.size];return t?Object(v.b)("font-size:","16px",";@media ( min-width:600px ){font-size:",t,";}"):""}),";",(function(e){var t={default:{height:30,lineHeight:1,minHeight:30},small:{height:24,lineHeight:1,minHeight:24}},n=t[e.size]||t.default;return Object(v.b)(n,"")}),";",te({paddingLeft:8,paddingRight:24})(),"}"),De=Object(g.a)("div",{target:"e12x0a391",label:"DownArrowWrapper"})("align-items:center;bottom:0;box-sizing:border-box;display:flex;padding:0 4px;pointer-events:none;position:absolute;top:0;",te({right:0})()," svg{display:block;}");var Pe=Object(c.forwardRef)((function e(t,n){var l=t.className,f=t.disabled,p=void 0!==f&&f,m=t.help,g=t.hideLabelFromVision,v=t.id,O=t.label,w=t.multiple,_=void 0!==w&&w,k=t.onBlur,S=void 0===k?s.noop:k,j=t.onChange,E=void 0===j?s.noop:j,C=t.onFocus,D=void 0===C?s.noop:C,P=t.options,x=void 0===P?[]:P,F=t.size,T=void 0===F?"default":F,M=t.value,R=t.labelPosition,I=void 0===R?"top":R,A=Object(i.a)(t,["className","disabled","help","hideLabelFromVision","id","label","multiple","onBlur","onChange","onFocus","options","size","value","labelPosition"]),N=Object(c.useState)(!1),L=Object(a.a)(N,2),U=L[0],B=L[1],H=function(t){var n=Object(d.useInstanceId)(e),r="inspector-select-control-".concat(n);return t||r}(v),q=m?"".concat(H,"__help"):void 0;if(Object(s.isEmpty)(x))return null;var z=u()("components-select-control",l);return Object(c.createElement)(b.a,{help:m},Object(c.createElement)(Ee,{className:z,disabled:p,hideLabelFromVision:g,id:H,isFocused:U,label:O,size:T,suffix:Object(c.createElement)(De,null,Object(c.createElement)(h,{icon:y,size:18})),labelPosition:I},Object(c.createElement)(Ce,Object(r.a)({},A,{"aria-describedby":q,className:"components-select-control__input",disabled:p,id:H,multiple:_,onBlur:function(e){S(e),B(!1)},onChange:function(e){if(_){var t=Object(o.a)(e.target.options).filter((function(e){return e.selected})).map((function(e){return e.value}));E(t)}else E(e.target.value,{event:e})},onFocus:function(e){D(e),B(!0)},ref:n,size:T,value:M}),x.map((function(e,t){var n=e.id||"".concat(e.label,"-").concat(e.value,"-").concat(t);return Object(c.createElement)("option",{key:n,value:e.value,disabled:e.disabled},e.label)})))))}));t.a=Pe},function(e,t,n){"use strict";var r=n(0),o=n(6),a=n.n(o),i=n(7),c=n(1),s=n(21),l=n(46),u=n(64),d=n(28),f=Object(r.createElement)(d.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(r.createElement)(d.Path,{d:"M12 13.06l3.712 3.713 1.061-1.06L13.061 12l3.712-3.712-1.06-1.06L12 10.938 8.288 7.227l-1.061 1.06L10.939 12l-3.712 3.712 1.06 1.061L12 13.061z"})),p=n(51),h=n(61),m=n(98),y=n(99),b=n(79),g=n(100),v=n(101),O=n(70);var w=function(e){Object(g.a)(i,e);var t,n,o=(t=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=Object(O.a)(t);if(n){var o=Object(O.a)(this).constructor;e=Reflect.construct(r,arguments,o)}else e=r.apply(this,arguments);return Object(v.a)(this,e)});function i(){var e;return Object(m.a)(this,i),(e=o.apply(this,arguments)).onChange=e.onChange.bind(Object(b.a)(e)),e.bindInput=e.bindInput.bind(Object(b.a)(e)),e}return Object(y.a)(i,[{key:"focus",value:function(){this.input.focus()}},{key:"hasFocus",value:function(){return this.input===this.input.ownerDocument.activeElement}},{key:"bindInput",value:function(e){this.input=e}},{key:"onChange",value:function(e){this.props.onChange({value:e.target.value})}},{key:"render",value:function(){var e=this.props,t=e.value,n=e.isExpanded,o=e.instanceId,i=e.selectedSuggestionIndex,c=e.className,s=Object(h.a)(e,["value","isExpanded","instanceId","selectedSuggestionIndex","className"]),l=t?t.length+1:0;return Object(r.createElement)("input",Object(p.a)({ref:this.bindInput,id:"components-form-token-input-".concat(o),type:"text"},s,{value:t||"",onChange:this.onChange,size:l,className:a()(c,"components-form-token-field__input"),autoComplete:"off",role:"combobox","aria-expanded":n,"aria-autocomplete":"list","aria-owns":n?"components-form-token-suggestions-".concat(o):void 0,"aria-activedescendant":-1!==i?"components-form-token-suggestions-".concat(o,"-").concat(i):void 0,"aria-describedby":"components-form-token-suggestions-howto-".concat(o)}))}}]),i}(r.Component),_=n(533),k=n.n(_);var S=function(e){Object(g.a)(c,e);var t,n,o=(t=c,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=Object(O.a)(t);if(n){var o=Object(O.a)(this).constructor;e=Reflect.construct(r,arguments,o)}else e=r.apply(this,arguments);return Object(v.a)(this,e)});function c(){var e;return Object(m.a)(this,c),(e=o.apply(this,arguments)).handleMouseDown=e.handleMouseDown.bind(Object(b.a)(e)),e.bindList=e.bindList.bind(Object(b.a)(e)),e}return Object(y.a)(c,[{key:"componentDidUpdate",value:function(){var e=this;this.props.selectedIndex>-1&&this.props.scrollIntoView&&(this.scrollingIntoView=!0,k()(this.list.children[this.props.selectedIndex],this.list,{onlyScrollIfNeeded:!0}),this.props.setTimeout((function(){e.scrollingIntoView=!1}),100))}},{key:"bindList",value:function(e){this.list=e}},{key:"handleHover",value:function(e){var t=this;return function(){t.scrollingIntoView||t.props.onHover(e)}}},{key:"handleClick",value:function(e){var t=this;return function(){t.props.onSelect(e)}}},{key:"handleMouseDown",value:function(e){e.preventDefault()}},{key:"computeSuggestionMatch",value:function(e){var t=this.props.displayTransform(this.props.match||"").toLocaleLowerCase();if(0===t.length)return null;var n=(e=this.props.displayTransform(e)).toLocaleLowerCase().indexOf(t);return{suggestionBeforeMatch:e.substring(0,n),suggestionMatch:e.substring(n,n+t.length),suggestionAfterMatch:e.substring(n+t.length)}}},{key:"render",value:function(){var e=this;return Object(r.createElement)("ul",{ref:this.bindList,className:"components-form-token-field__suggestions-list",id:"components-form-token-suggestions-".concat(this.props.instanceId),role:"listbox"},Object(i.map)(this.props.suggestions,(function(t,n){var o=e.computeSuggestionMatch(t),i=a()("components-form-token-field__suggestion",{"is-selected":n===e.props.selectedIndex});return Object(r.createElement)("li",{id:"components-form-token-suggestions-".concat(e.props.instanceId,"-").concat(n),role:"option",className:i,key:e.props.displayTransform(t),onMouseDown:e.handleMouseDown,onClick:e.handleClick(t),onMouseEnter:e.handleHover(t),"aria-selected":n===e.props.selectedIndex},o?Object(r.createElement)("span",{"aria-label":e.props.displayTransform(t)},o.suggestionBeforeMatch,Object(r.createElement)("strong",{className:"components-form-token-field__suggestion-match"},o.suggestionMatch),o.suggestionAfterMatch):e.props.displayTransform(t))})))}}]),c}(r.Component);S.defaultProps={match:"",onHover:function(){},onSelect:function(){},suggestions:Object.freeze([])};var j=Object(s.withSafeTimeout)(S),E=n(319),C=n(182),D=n(318),P=n(499),x=n(492),F=n(315);const T=Object(F.a)(class extends r.Component{handleFocusOutside(e){this.props.onFocusOutside(e)}render(){return this.props.children}});t.a=function e({value:t,label:n,options:o,onChange:d,onFilterValueChange:p=i.noop,hideLabelFromVision:h,help:m,allowReset:y=!0,className:b,messages:g={selected:Object(c.__)("Item selected.")}}){var v;const O=o.find(e=>e.value===t),_=null!==(v=null==O?void 0:O.label)&&void 0!==v?v:"",k=Object(s.useInstanceId)(e),[S,F]=Object(r.useState)(O||null),[M,R]=Object(r.useState)(!1),[I,A]=Object(r.useState)(!1),[N,L]=Object(r.useState)(""),U=Object(r.useRef)(),B=Object(r.useMemo)(()=>{const e=[],t=[],n=Object(i.deburr)(N.toLocaleLowerCase());return o.forEach(r=>{const o=Object(i.deburr)(r.label).toLocaleLowerCase().indexOf(n);0===o?e.push(r):o>0&&t.push(r)}),e.concat(t)},[N,o,t]),H=e=>{d(e.value),Object(u.speak)(g.selected,"assertive"),F(e),L(""),R(!1)},q=(e=1)=>{let t=B.indexOf(S)+e;t<0?t=B.length-1:t>=B.length&&(t=0),F(B[t]),R(!0)};return Object(r.useEffect)(()=>{const e=B.length>0,t=B.indexOf(S)>0;e&&!t&&F(B[0])},[B,S]),Object(r.useEffect)(()=>{const e=B.length>0;if(M){const t=e?Object(c.sprintf)(
/* translators: %d: number of results. */
Object(c._n)("%d result found, use up and down arrow keys to navigate.","%d results found, use up and down arrow keys to navigate.",B.length),B.length):Object(c.__)("No results.");Object(u.speak)(t,"polite")}},[B,M]),Object(r.createElement)(T,{onFocusOutside:()=>{R(!1)}},Object(r.createElement)(E.a,{className:a()(b,"components-combobox-control"),tabIndex:"-1",label:n,id:"components-form-token-input-"+k,hideLabelFromVision:h,help:m},Object(r.createElement)("div",{className:"components-combobox-control__suggestions-container",tabIndex:"-1",onKeyDown:e=>{let t=!1;if(!e.defaultPrevented){switch(e.keyCode){case l.ENTER:S&&(H(S),t=!0);break;case l.UP:q(-1),t=!0;break;case l.DOWN:q(1),t=!0;break;case l.ESCAPE:R(!1),F(null),t=!0}t&&e.preventDefault()}}},Object(r.createElement)(D.a,null,Object(r.createElement)(P.a,null,Object(r.createElement)(w,{className:"components-combobox-control__input",instanceId:k,ref:U,value:M?N:_,"aria-label":_?`${_}, ${n}`:null,onFocus:()=>{A(!0),R(!0),p(""),L("")},onBlur:()=>{A(!1)},isExpanded:M,selectedSuggestionIndex:B.indexOf(S),onChange:e=>{const t=e.value;L(t),p(t),I&&R(!0)}})),y&&Object(r.createElement)(x.a,null,Object(r.createElement)(C.a,{className:"components-combobox-control__reset",icon:f,disabled:!t,onClick:()=>{d(null),U.current.input.focus()},label:Object(c.__)("Reset")}))),M&&Object(r.createElement)(j,{instanceId:k,match:{label:N},displayTransform:e=>e.label,suggestions:B,selectedIndex:B.indexOf(S),onHover:F,onSelect:H,scrollIntoView:!0}))))}},function(e,t,n){"use strict";var r=n(51),o=n(22),a=n.n(o);function i(e,t,n,r,o,a,i){try{var c=e[a](i),s=c.value}catch(e){return void n(e)}c.done?t(s):Promise.resolve(s).then(r,o)}function c(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var a=e.apply(t,n);function c(e){i(a,r,o,c,s,"next",e)}function s(e){i(a,r,o,c,s,"throw",e)}c(void 0)}))}}var s=n(105),l=n(0),u=n(6),d=n.n(u),f=n(7),p=n(370),h=n(21),m=n(532);t.a=function(e){var t=e.notices,n=e.className,o=e.children,i=e.onRemove,u=void 0===i?f.noop:i,y=Object(h.useReducedMotion)(),b=Object(l.useState)((function(){return new WeakMap})),g=Object(s.a)(b,1)[0],v=Object(p.useTransition)(t,(function(e){return e.id}),{from:{opacity:0,height:0},enter:function(e){return function(){var t=c(a.a.mark((function t(n){return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,n({opacity:1,height:g.get(e).offsetHeight});case 2:return t.abrupt("return",t.sent);case 3:case"end":return t.stop()}}),t)})));return function(_x){return t.apply(this,arguments)}}()},leave:function(){return function(){var e=c(a.a.mark((function e(t){return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t({opacity:0});case 2:return e.next=4,t({height:0});case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()},immediate:y});n=d()("components-snackbar-list",n);var O=function(e){return function(){return u(e.id)}};return Object(l.createElement)("div",{className:n},o,v.map((function(e){var t=e.item,n=e.key,o=e.props;return Object(l.createElement)(p.animated.div,{key:n,style:o},Object(l.createElement)("div",{className:"components-snackbar-list__notice-container",ref:function(e){return e&&g.set(t,e)}},Object(l.createElement)(m.a,Object(r.a)({},Object(f.omit)(t,["content"]),{onRemove:O(t)}),t.content)))})))}}]]);woocommerce-blocks/build/price-format.js000064400000007122151335517640014377 0ustar00this.wc=this.wc||{},this.wc.priceFormat=function(e){var r={};function t(n){if(r[n])return r[n].exports;var o=r[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,t),o.l=!0,o.exports}return t.m=e,t.c=r,t.d=function(e,r,n){t.o(e,r)||Object.defineProperty(e,r,{enumerable:!0,get:n})},t.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},t.t=function(e,r){if(1&r&&(e=t(e)),8&r)return e;if(4&r&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(t.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&r&&"string"!=typeof e)for(var o in e)t.d(n,o,function(r){return e[r]}.bind(null,o));return n},t.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(r,"a",r),r},t.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},t.p="",t(t.s=166)}({1:function(e,r){e.exports=function(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e},e.exports.default=e.exports,e.exports.__esModule=!0},166:function(e,r,t){"use strict";t.r(r),t.d(r,"getCurrencyFromPriceResponse",(function(){return y})),t.d(r,"getCurrency",(function(){return b})),t.d(r,"formatPrice",(function(){return d}));var n=t(1),o=t.n(n),i=t(6),u=t.n(i),c=t(7);function f(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),t.push.apply(t,n)}return t}function s(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?f(Object(t),!0).forEach((function(r){o()(e,r,t[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):f(Object(t)).forEach((function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}))}return e}var p,a,l={code:c.CURRENCY.code,symbol:c.CURRENCY.symbol,thousandSeparator:c.CURRENCY.thousandSeparator,decimalSeparator:c.CURRENCY.decimalSeparator,minorUnit:c.CURRENCY.precision,prefix:(p=c.CURRENCY.symbol,a=c.CURRENCY.symbolPosition,{left:p,left_space:" "+p,right:"",right_space:""}[a]||""),suffix:function(e,r){return{left:"",left_space:"",right:e,right_space:" "+e}[r]||""}(c.CURRENCY.symbol,c.CURRENCY.symbolPosition)},y=function(e){if(!e||"object"!==u()(e))return l;var r=e.currency_code,t=e.currency_symbol,n=e.currency_thousand_separator,o=e.currency_decimal_separator,i=e.currency_minor_unit,c=e.currency_prefix,f=e.currency_suffix;return{code:r||"USD",symbol:t||"$",thousandSeparator:"string"==typeof n?n:",",decimalSeparator:"string"==typeof o?o:".",minorUnit:Number.isFinite(i)?i:2,prefix:"string"==typeof c?c:"$",suffix:"string"==typeof f?f:""}},b=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return s(s({},l),e)},d=function(e,r){if(""===e||void 0===e)return"";var t="number"==typeof e?e:parseInt(e,10);if(!Number.isFinite(t))return"";var n=b(r),o=t/Math.pow(10,n.minorUnit),i=n.prefix+o+n.suffix,u=document.createElement("textarea");return u.innerHTML=i,u.value}},6:function(e,r){function t(r){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?(e.exports=t=function(e){return typeof e},e.exports.default=e.exports,e.exports.__esModule=!0):(e.exports=t=function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.default=e.exports,e.exports.__esModule=!0),t(r)}e.exports=t,e.exports.default=e.exports,e.exports.__esModule=!0},7:function(e,r){e.exports=window.wc.wcSettings}});woocommerce-blocks/build/wc-blocks-vendors-style-rtl.css000064400000012274151335517640017466 0ustar00.components-custom-select-control{position:relative}.components-custom-select-control__label{display:block;margin-bottom:8px}.components-custom-select-control__button{border:1px solid #757575;border-radius:2px;min-height:30px;min-width:130px;position:relative;text-align:right}.components-custom-select-control__button.components-custom-select-control__button{padding-left:24px}.components-custom-select-control__button:focus:not(:disabled){border-color:var(--wp-admin-theme-color);box-shadow:0 0 0 .5px var(--wp-admin-theme-color)}.components-custom-select-control__button .components-custom-select-control__button-icon{height:100%;padding:0;position:absolute;left:0;top:0}.components-custom-select-control__menu{background-color:#fff;max-height:400px;min-width:100%;overflow:auto;padding:0;position:absolute;z-index:1000000}.components-custom-select-control__menu:focus{border:1px solid #1e1e1e;border-radius:2px;outline:none;transition:none}.components-custom-select-control__item{align-items:center;display:flex;list-style-type:none;padding:10px 25px 10px 5px;cursor:default}.components-custom-select-control__item.is-highlighted{background:#ddd}.components-custom-select-control__item-icon{margin-right:-20px;margin-left:0}.components-spinner{display:inline-block;background-color:#949494;width:18px;height:18px;opacity:.7;margin:5px 11px 0;border-radius:100%;position:relative}.components-spinner:before{content:"";position:absolute;background-color:#fff;top:3px;right:3px;width:4px;height:4px;border-radius:100%;transform-origin:6px 6px;-webkit-animation:components-spinner__animation 1s linear infinite;animation:components-spinner__animation 1s linear infinite}@-webkit-keyframes components-spinner__animation{0%{transform:rotate(0deg)}to{transform:rotate(-1turn)}}@keyframes components-spinner__animation{0%{transform:rotate(0deg)}to{transform:rotate(-1turn)}}.components-snackbar{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;font-size:13px;background-color:#1e1e1e;border-radius:2px;box-shadow:0 2px 4px rgba(0,0,0,.3);color:#fff;padding:16px 24px;width:100%;max-width:600px;box-sizing:border-box;cursor:pointer}@media(min-width:600px){.components-snackbar{width:-webkit-fit-content;width:-moz-fit-content;width:fit-content}}.components-snackbar:focus{box-shadow:0 0 0 1px #fff,0 0 0 3px var(--wp-admin-theme-color)}.components-snackbar__action.components-button{margin-right:32px;color:#fff;height:auto;flex-shrink:0;line-height:1.4;padding:0}.components-snackbar__action.components-button:not(:disabled):not([aria-disabled=true]):not(.is-secondary){text-decoration:underline;background-color:transparent}.components-snackbar__action.components-button:not(:disabled):not([aria-disabled=true]):not(.is-secondary):focus{color:#fff;box-shadow:none;outline:1px dotted #fff}.components-snackbar__action.components-button:not(:disabled):not([aria-disabled=true]):not(.is-secondary):hover{color:var(--wp-admin-theme-color)}.components-snackbar__content{display:flex;align-items:baseline;justify-content:space-between;line-height:1.4}.components-snackbar-list{position:absolute;z-index:100000;width:100%;box-sizing:border-box}.components-snackbar-list__notice-container{position:relative;padding-top:8px}.components-combobox-control{width:100%}input.components-combobox-control__input[type=text]{width:100%;border:none;box-shadow:none;padding:2px;margin:0;line-height:inherit;min-height:auto}input.components-combobox-control__input[type=text]:focus{outline:none;box-shadow:none}.components-combobox-control__suggestions-container{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;box-shadow:0 0 0 transparent;transition:box-shadow .1s linear;border-radius:2px;border:1px solid #757575;font-size:16px;line-height:normal;display:flex;flex-wrap:wrap;align-items:flex-start;width:100%;margin:0 0 8px;padding:4px}@media(prefers-reduced-motion:reduce){.components-combobox-control__suggestions-container{transition-duration:0s}}@media(min-width:600px){.components-combobox-control__suggestions-container{font-size:13px;line-height:normal}}.components-combobox-control__suggestions-container:focus{border-color:var(--wp-admin-theme-color);box-shadow:0 0 0 .5px var(--wp-admin-theme-color);outline:2px solid transparent}.components-combobox-control__suggestions-container::-webkit-input-placeholder{color:rgba(30,30,30,.62)}.components-combobox-control__suggestions-container::-moz-placeholder{opacity:1;color:rgba(30,30,30,.62)}.components-combobox-control__suggestions-container:-ms-input-placeholder{color:rgba(30,30,30,.62)}.is-dark-theme .components-combobox-control__suggestions-container::-webkit-input-placeholder{color:hsla(0,0%,100%,.65)}.is-dark-theme .components-combobox-control__suggestions-container::-moz-placeholder{opacity:1;color:hsla(0,0%,100%,.65)}.is-dark-theme .components-combobox-control__suggestions-container:-ms-input-placeholder{color:hsla(0,0%,100%,.65)}.components-combobox-control__suggestions-container:focus-within{border-color:var(--wp-admin-theme-color);box-shadow:0 0 0 .5px var(--wp-admin-theme-color);outline:2px solid transparent}.components-combobox-control__reset.components-button{display:flex;height:24px;min-width:24px;padding:0}woocommerce-blocks/build/price-filter.js000064400000074714151335517640014407 0ustar00this.wc=this.wc||{},this.wc.blocks=this.wc.blocks||{},this.wc.blocks["price-filter"]=function(e){function t(t){for(var r,i,a=t[0],u=t[1],l=t[2],b=0,p=[];b<a.length;b++)i=a[b],Object.prototype.hasOwnProperty.call(c,i)&&c[i]&&p.push(c[i][0]),c[i]=0;for(r in u)Object.prototype.hasOwnProperty.call(u,r)&&(e[r]=u[r]);for(s&&s(t);p.length;)p.shift()();return o.push.apply(o,l||[]),n()}function n(){for(var e,t=0;t<o.length;t++){for(var n=o[t],r=!0,a=1;a<n.length;a++){var u=n[a];0!==c[u]&&(r=!1)}r&&(o.splice(t--,1),e=i(i.s=n[0]))}return e}var r={},c={27:0},o=[];function i(t){if(r[t])return r[t].exports;var n=r[t]={i:t,l:!1,exports:{}};return e[t].call(n.exports,n,n.exports,i),n.l=!0,n.exports}i.m=e,i.c=r,i.d=function(e,t,n){i.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},i.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.t=function(e,t){if(1&t&&(e=i(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(i.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)i.d(n,r,function(t){return e[t]}.bind(null,r));return n},i.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(t,"a",t),t},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.p="";var a=window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[],u=a.push.bind(a);a.push=t,a=a.slice();for(var l=0;l<a.length;l++)t(a[l]);var s=u;return o.push([794,0]),n()}({0:function(e,t){e.exports=window.wp.element},1:function(e,t){e.exports=window.wp.i18n},108:function(e,t,n){"use strict";n.d(t,"a",(function(){return d})),n.d(t,"b",(function(){return f})),n.d(t,"c",(function(){return m}));var r=n(8),c=n.n(r),o=n(24),i=n(14),a=n(0),u=n(34),l=n.n(u),s=n(62),b=n(136),p=n(78),d=function(e){var t=Object(p.a)();e=e||t;var n=Object(i.useSelect)((function(t){return t(o.QUERY_STATE_STORE_KEY).getValueForQueryContext(e,void 0)}),[e]),r=Object(i.useDispatch)(o.QUERY_STATE_STORE_KEY).setValueForQueryContext;return[n,Object(a.useCallback)((function(t){r(e,t)}),[e,r])]},f=function(e,t,n){var r=Object(p.a)();n=n||r;var c=Object(i.useSelect)((function(r){return r(o.QUERY_STATE_STORE_KEY).getValueForQueryKey(n,e,t)}),[n,e]),u=Object(i.useDispatch)(o.QUERY_STATE_STORE_KEY).setQueryValue;return[c,Object(a.useCallback)((function(t){u(n,e,t)}),[n,e,u])]},m=function(e,t){var n=Object(p.a)(),r=d(t=t||n),o=c()(r,2),i=o[0],u=o[1],f=Object(s.a)(i),m=Object(s.a)(e),O=Object(b.a)(m),v=Object(a.useRef)(!1);return Object(a.useEffect)((function(){l()(O,m)||(u(Object.assign({},f,m)),v.current=!0)}),[f,m,O,u]),v.current?[i,u]:[e,u]}},11:function(e,t){e.exports=window.React},12:function(e,t){e.exports=window.wp.blockEditor},123:function(e,t){},127:function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(8),c=n.n(r),o=n(0),i=function(){var e=Object(o.useState)(),t=c()(e,2)[1];return Object(o.useCallback)((function(e){t((function(){throw e}))}),[])}},133:function(e,t,n){"use strict";var r=n(17),c=n.n(r),o=n(18),i=n.n(o),a=n(19),u=n.n(a),l=n(20),s=n.n(l),b=n(10),p=n.n(b),d=n(0),f=n(7),m=n(1),O=n(4);function v(e){var t=e.level,n={1:"M9 5h2v10H9v-4H5v4H3V5h2v4h4V5zm6.6 0c-.6.9-1.5 1.7-2.6 2v1h2v7h2V5h-1.4z",2:"M7 5h2v10H7v-4H3v4H1V5h2v4h4V5zm8 8c.5-.4.6-.6 1.1-1.1.4-.4.8-.8 1.2-1.3.3-.4.6-.8.9-1.3.2-.4.3-.8.3-1.3 0-.4-.1-.9-.3-1.3-.2-.4-.4-.7-.8-1-.3-.3-.7-.5-1.2-.6-.5-.2-1-.2-1.5-.2-.4 0-.7 0-1.1.1-.3.1-.7.2-1 .3-.3.1-.6.3-.9.5-.3.2-.6.4-.8.7l1.2 1.2c.3-.3.6-.5 1-.7.4-.2.7-.3 1.2-.3s.9.1 1.3.4c.3.3.5.7.5 1.1 0 .4-.1.8-.4 1.1-.3.5-.6.9-1 1.2-.4.4-1 .9-1.6 1.4-.6.5-1.4 1.1-2.2 1.6V15h8v-2H15z",3:"M12.1 12.2c.4.3.8.5 1.2.7.4.2.9.3 1.4.3.5 0 1-.1 1.4-.3.3-.1.5-.5.5-.8 0-.2 0-.4-.1-.6-.1-.2-.3-.3-.5-.4-.3-.1-.7-.2-1-.3-.5-.1-1-.1-1.5-.1V9.1c.7.1 1.5-.1 2.2-.4.4-.2.6-.5.6-.9 0-.3-.1-.6-.4-.8-.3-.2-.7-.3-1.1-.3-.4 0-.8.1-1.1.3-.4.2-.7.4-1.1.6l-1.2-1.4c.5-.4 1.1-.7 1.6-.9.5-.2 1.2-.3 1.8-.3.5 0 1 .1 1.6.2.4.1.8.3 1.2.5.3.2.6.5.8.8.2.3.3.7.3 1.1 0 .5-.2.9-.5 1.3-.4.4-.9.7-1.5.9v.1c.6.1 1.2.4 1.6.8.4.4.7.9.7 1.5 0 .4-.1.8-.3 1.2-.2.4-.5.7-.9.9-.4.3-.9.4-1.3.5-.5.1-1 .2-1.6.2-.8 0-1.6-.1-2.3-.4-.6-.2-1.1-.6-1.6-1l1.1-1.4zM7 9H3V5H1v10h2v-4h4v4h2V5H7v4z",4:"M9 15H7v-4H3v4H1V5h2v4h4V5h2v10zm10-2h-1v2h-2v-2h-5v-2l4-6h3v6h1v2zm-3-2V7l-2.8 4H16z",5:"M12.1 12.2c.4.3.7.5 1.1.7.4.2.9.3 1.3.3.5 0 1-.1 1.4-.4.4-.3.6-.7.6-1.1 0-.4-.2-.9-.6-1.1-.4-.3-.9-.4-1.4-.4H14c-.1 0-.3 0-.4.1l-.4.1-.5.2-1-.6.3-5h6.4v1.9h-4.3L14 8.8c.2-.1.5-.1.7-.2.2 0 .5-.1.7-.1.5 0 .9.1 1.4.2.4.1.8.3 1.1.6.3.2.6.6.8.9.2.4.3.9.3 1.4 0 .5-.1 1-.3 1.4-.2.4-.5.8-.9 1.1-.4.3-.8.5-1.3.7-.5.2-1 .3-1.5.3-.8 0-1.6-.1-2.3-.4-.6-.2-1.1-.6-1.6-1-.1-.1 1-1.5 1-1.5zM9 15H7v-4H3v4H1V5h2v4h4V5h2v10z",6:"M9 15H7v-4H3v4H1V5h2v4h4V5h2v10zm8.6-7.5c-.2-.2-.5-.4-.8-.5-.6-.2-1.3-.2-1.9 0-.3.1-.6.3-.8.5l-.6.9c-.2.5-.2.9-.2 1.4.4-.3.8-.6 1.2-.8.4-.2.8-.3 1.3-.3.4 0 .8 0 1.2.2.4.1.7.3 1 .6.3.3.5.6.7.9.2.4.3.8.3 1.3s-.1.9-.3 1.4c-.2.4-.5.7-.8 1-.4.3-.8.5-1.2.6-1 .3-2 .3-3 0-.5-.2-1-.5-1.4-.9-.4-.4-.8-.9-1-1.5-.2-.6-.3-1.3-.3-2.1s.1-1.6.4-2.3c.2-.6.6-1.2 1-1.6.4-.4.9-.7 1.4-.9.6-.3 1.1-.4 1.7-.4.7 0 1.4.1 2 .3.5.2 1 .5 1.4.8 0 .1-1.3 1.4-1.3 1.4zm-2.4 5.8c.2 0 .4 0 .6-.1.2 0 .4-.1.5-.2.1-.1.3-.3.4-.5.1-.2.1-.5.1-.7 0-.4-.1-.8-.4-1.1-.3-.2-.7-.3-1.1-.3-.3 0-.7.1-1 .2-.4.2-.7.4-1 .7 0 .3.1.7.3 1 .1.2.3.4.4.6.2.1.3.3.5.3.2.1.5.2.7.1z"};return n.hasOwnProperty(t)?Object(d.createElement)(O.SVG,{width:"20",height:"20",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"},Object(d.createElement)(O.Path,{d:n[t]})):null}var h=function(e){u()(o,e);var t,n,r=(t=o,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=p()(t);if(n){var c=p()(this).constructor;e=Reflect.construct(r,arguments,c)}else e=r.apply(this,arguments);return s()(this,e)});function o(){return c()(this,o),r.apply(this,arguments)}return i()(o,[{key:"createLevelControl",value:function(e,t,n){var r=e===t;return{icon:Object(d.createElement)(v,{level:e}),
/* translators: %s: heading level e.g: "2", "3", "4" */
title:Object(m.sprintf)(Object(m.__)("Heading %d"),e),isActive:r,onClick:function(){return n(e)}}}},{key:"render",value:function(){var e=this,t=this.props,n=t.isCollapsed,r=void 0===n||n,c=t.minLevel,o=t.maxLevel,i=t.selectedLevel,a=t.onChange;return Object(d.createElement)(O.ToolbarGroup,{isCollapsed:r,icon:Object(d.createElement)(v,{level:i}),controls:Object(f.range)(c,o).map((function(t){return e.createLevelControl(t,i,a)}))})}}]),o}(d.Component);t.a=h},136:function(e,t,n){"use strict";n.d(t,"a",(function(){return c}));var r=n(11);function c(e,t){var n=Object(r.useRef)();return Object(r.useEffect)((function(){n.current===e||t&&!t(e,n.current)||(n.current=e)}),[e,t]),n.current}},14:function(e,t){e.exports=window.wp.data},157:function(e,t,n){"use strict";var r=n(0),c=(n(2),n(12)),o=n(21),i=n(1);n(217),t.a=Object(o.withInstanceId)((function(e){var t=e.className,n=e.headingLevel,o=e.onChange,a=e.heading,u=e.instanceId,l="h".concat(n);return Object(r.createElement)(l,{className:t},Object(r.createElement)("label",{className:"screen-reader-text",htmlFor:"block-title-".concat(u)},Object(i.__)("Block title",'woocommerce')),Object(r.createElement)(c.PlainText,{id:"block-title-".concat(u),className:"wc-block-editor-components-title",value:a,onChange:o}))}))},158:function(e,t,n){"use strict";var r=n(0),c=n(28),o=Object(r.createElement)(c.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(r.createElement)("mask",{id:"external-mask",width:"24",height:"24",x:"0",y:"0",maskUnits:"userSpaceOnUse"},Object(r.createElement)("path",{fill:"#fff",d:"M6.3431 6.3431v1.994l7.8984.0072-8.6055 8.6054 1.4142 1.4143 8.6055-8.6055.0071 7.8984h1.994V6.3431H6.3431z"})),Object(r.createElement)("g",{mask:"url(#external-mask)"},Object(r.createElement)("path",{d:"M0 0h24v24H0z"})));t.a=o},165:function(e,t,n){"use strict";n.d(t,"a",(function(){return u}));var r=n(24),c=n(14),o=n(0),i=n(62),a=n(127),u=function(e){var t=e.namespace,n=e.resourceName,u=e.resourceValues,l=void 0===u?[]:u,s=e.query,b=void 0===s?{}:s,p=e.shouldSelect,d=void 0===p||p;if(!t||!n)throw new Error("The options object must have valid values for the namespace and the resource properties.");var f=Object(o.useRef)({results:[],isLoading:!0}),m=Object(i.a)(b),O=Object(i.a)(l),v=Object(a.a)(),h=Object(c.useSelect)((function(e){if(!d)return null;var c=e(r.COLLECTIONS_STORE_KEY),o=[t,n,m,O],i=c.getCollectionError.apply(c,o);return i&&v(i),{results:c.getCollection.apply(c,o),isLoading:!c.hasFinishedResolution("getCollection",o)}}),[t,n,O,m,d]);return null!==h&&(f.current=h),f.current}},175:function(e,t){},194:function(e,t,n){"use strict";var r=n(0),c=n(1),o=(n(2),n(6)),i=n.n(o),a=n(41),u=(n(257),function(e){var t=e.className,n=e.disabled,o=e.label,u=void 0===o?Object(c.__)("Go",'woocommerce'):o,l=e.onClick,s=e.screenReaderLabel,b=void 0===s?Object(c.__)("Apply filter",'woocommerce'):s;return Object(r.createElement)("button",{type:"submit",className:i()("wc-block-filter-submit-button","wc-block-components-filter-submit-button",t),disabled:n,onClick:l},Object(r.createElement)(a.a,{label:u,screenReaderLabel:b}))});u.defaultProps={disabled:!1},t.a=u},21:function(e,t){e.exports=window.wp.compose},217:function(e,t){},24:function(e,t){e.exports=window.wc.wcBlocksData},257:function(e,t){},26:function(e,t){e.exports=window.wp.blocks},28:function(e,t){e.exports=window.wp.primitives},3:function(e,t){e.exports=window.wc.wcSettings},303:function(e,t,n){"use strict";var r=n(0),c=n(28),o=Object(r.createElement)(c.SVG,{xmlns:"http://www.w3.org/2000/SVG",viewBox:"0 0 24 24"},Object(r.createElement)("path",{fill:"none",d:"M0 0h24v24H0V0z"}),Object(r.createElement)("path",{d:"M11 17h2v-1h1c.55 0 1-.45 1-1v-3c0-.55-.45-1-1-1h-3v-1h4V8h-2V7h-2v1h-1c-.55 0-1 .45-1 1v3c0 .55.45 1 1 1h3v1H9v2h2v1zm9-13H4c-1.11 0-1.99.89-1.99 2L2 18c0 1.11.89 2 2 2h16c1.11 0 2-.89 2-2V6c0-1.11-.89-2-2-2zm0 14H4V6h16v12z"}));t.a=o},34:function(e,t){e.exports=window.wp.isShallowEqual},37:function(e,t,n){"use strict";n.d(t,"o",(function(){return o})),n.d(t,"m",(function(){return i})),n.d(t,"l",(function(){return a})),n.d(t,"n",(function(){return u})),n.d(t,"j",(function(){return l})),n.d(t,"e",(function(){return s})),n.d(t,"f",(function(){return b})),n.d(t,"g",(function(){return p})),n.d(t,"k",(function(){return d})),n.d(t,"c",(function(){return f})),n.d(t,"d",(function(){return m})),n.d(t,"h",(function(){return O})),n.d(t,"a",(function(){return v})),n.d(t,"i",(function(){return h})),n.d(t,"b",(function(){return g}));var r,c=n(3),o=Object(c.getSetting)("wcBlocksConfig",{buildPhase:1,pluginUrl:"",productCount:0,defaultAvatar:"",restApiRoutes:{},wordCountType:"words"}),i=o.pluginUrl+"images/",a=o.pluginUrl+"build/",u=o.buildPhase,l=null===(r=c.STORE_PAGES.shop)||void 0===r?void 0:r.permalink,s=c.STORE_PAGES.checkout.id,b=c.STORE_PAGES.checkout.permalink,p=c.STORE_PAGES.privacy.permalink,d=(c.STORE_PAGES.privacy.title,c.STORE_PAGES.terms.permalink),f=(c.STORE_PAGES.terms.title,c.STORE_PAGES.cart.id),m=c.STORE_PAGES.cart.permalink,O=(c.STORE_PAGES.myaccount.permalink?c.STORE_PAGES.myaccount.permalink:Object(c.getSetting)("wpLoginUrl","/wp-login.php"),Object(c.getSetting)("shippingCountries",{})),v=Object(c.getSetting)("allowedCountries",{}),h=Object(c.getSetting)("shippingStates",{}),g=Object(c.getSetting)("allowedStates",{})},4:function(e,t){e.exports=window.wp.components},41:function(e,t,n){"use strict";var r=n(5),c=n.n(r),o=n(0),i=n(6),a=n.n(i);function u(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function l(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?u(Object(n),!0).forEach((function(t){c()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):u(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}t.a=function(e){var t,n=e.label,r=e.screenReaderLabel,c=e.wrapperElement,i=e.wrapperProps,u=void 0===i?{}:i,s=null!=n,b=null!=r;return!s&&b?(t=c||"span",u=l(l({},u),{},{className:a()(u.className,"screen-reader-text")}),Object(o.createElement)(t,u,r)):(t=c||o.Fragment,s&&b&&n!==r?Object(o.createElement)(t,u,Object(o.createElement)("span",{"aria-hidden":"true"},n),Object(o.createElement)("span",{className:"screen-reader-text"},r)):Object(o.createElement)(t,u,n))}},47:function(e,t){e.exports=window.wc.priceFormat},493:function(e,t,n){"use strict";n.d(t,"a",(function(){return j}));var r=n(5),c=n.n(r),o=n(33),i=n.n(o),a=n(38),u=n.n(a),l=n(8),s=n.n(l),b=n(0),p=n(287),d=n(7),f=n(62),m=n(108),O=n(165),v=n(78);function h(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function g(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?h(Object(n),!0).forEach((function(t){c()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):h(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var j=function(e){var t=e.queryAttribute,n=e.queryPrices,r=e.queryStock,c=e.queryState,o=Object(v.a)();o="".concat(o,"-collection-data");var a=Object(m.a)(o),l=s()(a,1)[0],h=Object(m.b)("calculate_attribute_counts",[],o),j=s()(h,2),w=j[0],_=j[1],y=Object(m.b)("calculate_price_range",null,o),k=s()(y,2),E=k[0],x=k[1],P=Object(m.b)("calculate_stock_status_counts",null,o),S=s()(P,2),C=S[0],N=S[1],F=Object(f.a)(t||{}),R=Object(f.a)(n),T=Object(f.a)(r);Object(b.useEffect)((function(){"object"===u()(F)&&Object.keys(F).length&&(w.find((function(e){return e.taxonomy===F.taxonomy}))||_([].concat(i()(w),[F])))}),[F,w,_]),Object(b.useEffect)((function(){E!==R&&void 0!==R&&x(R)}),[R,x,E]),Object(b.useEffect)((function(){C!==T&&void 0!==T&&N(T)}),[T,N,C]);var V=Object(b.useState)(!1),L=s()(V,2),M=L[0],B=L[1],D=Object(p.a)(M,200),H=s()(D,1)[0];M||B(!0);var I=Object(b.useMemo)((function(){return function(e){var t=e;return e.calculate_attribute_counts&&(t.calculate_attribute_counts=Object(d.sortBy)(e.calculate_attribute_counts.map((function(e){return{taxonomy:e.taxonomy,query_type:e.queryType}})),["taxonomy","query_type"])),t}(l)}),[l]);return Object(O.a)({namespace:"/wc/store",resourceName:"products/collection-data",query:g(g({},c),{},{page:void 0,per_page:void 0,orderby:void 0,order:void 0},I),shouldSelect:H})}},53:function(e,t,n){"use strict";var r=n(9),c=n.n(r),o=n(5),i=n.n(o),a=n(16),u=n.n(a),l=n(0),s=n(166),b=n(6),p=n.n(b),d=(n(175),["className","value","currency","onValueChange","displayType"]);function f(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function m(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?f(Object(n),!0).forEach((function(t){i()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):f(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}t.a=function(e){var t=e.className,n=e.value,r=e.currency,o=e.onValueChange,i=e.displayType,a=void 0===i?"text":i,b=u()(e,d),f="string"==typeof n?parseInt(n,10):n;if(!Number.isFinite(f))return null;var O=f/Math.pow(10,r.minorUnit);if(!Number.isFinite(O))return null;var v=p()("wc-block-formatted-money-amount","wc-block-components-formatted-money-amount",t),h=m(m(m({},b),function(e){return{thousandSeparator:e.thousandSeparator,decimalSeparator:e.decimalSeparator,decimalScale:e.minorUnit,fixedDecimalScale:!0,prefix:e.prefix,suffix:e.suffix,isNumericString:!0}}(r)),{},{value:void 0,currency:void 0,onValueChange:void 0}),g=o?function(e){var t=e.value*Math.pow(10,r.minorUnit);o(t)}:function(){};return Object(l.createElement)(s.a,c()({className:v,displayType:a},h,{value:O,onValueChange:g}))}},62:function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(0),c=n(34),o=n.n(c);function i(e){var t=Object(r.useRef)(e);return o()(e,t.current)||(t.current=e),t.current}},66:function(e,t,n){"use strict";var r=n(5),c=n.n(r),o=n(16),i=n.n(o),a=n(0),u=["srcElement","size"];function l(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}t.a=function(e){var t=e.srcElement,n=e.size,r=void 0===n?24:n,o=i()(e,u);return Object(a.isValidElement)(t)?Object(a.cloneElement)(t,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?l(Object(n),!0).forEach((function(t){c()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):l(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({width:r,height:r},o)):null}},7:function(e,t){e.exports=window.lodash},72:function(e,t,n){"use strict";n.d(t,"a",(function(){return r})),n.d(t,"c",(function(){return c})),n.d(t,"b",(function(){return o})),n.d(t,"d",(function(){return i}));var r=function(e){return"number"==typeof e},c=function(e){return"string"==typeof e},o=function(e){return!function(e){return null===e}(e)&&e instanceof Object&&e.constructor===Object};function i(e,t){return o(e)&&t in e}},78:function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(0),c=Object(r.createContext)("page"),o=function(){return Object(r.useContext)(c)};c.Provider},794:function(e,t,n){e.exports=n(858)},795:function(e,t){},796:function(e,t){},858:function(e,t,n){"use strict";n.r(t);var r=n(9),c=n.n(r),o=n(0),i=n(1),a=n(26),u=n(6),l=n.n(u),s=n(66),b=n(303),p=n(12),d=n(4),f=n(3),m=n(37),O=n(133),v=n(157),h=n(88),g=n(158),j=n(8),w=n.n(j),_=n(136),y=n(108),k=n(493),E=(n(2),n(53)),x=n(72),P=(n(796),function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,c=arguments.length>4&&void 0!==arguments[4]&&arguments[4],o=parseInt(e[0],10),i=parseInt(e[1],10);return Number.isFinite(o)||(o=t||0),Number.isFinite(i)||(i=n||r),Number.isFinite(t)&&t>o&&(o=t),Number.isFinite(n)&&n<=o&&(o=n-r),Number.isFinite(t)&&t>=i&&(i=t+r),Number.isFinite(n)&&n<i&&(i=n),!c&&o>=i&&(o=i-r),c&&i<=o&&(i=o+r),[o,i]}),S=n(194),C=function(e){var t=e.minPrice,n=e.maxPrice,r=e.minConstraint,c=e.maxConstraint,a=e.onChange,u=void 0===a?function(){}:a,s=e.step,b=e.currency,p=e.showInputFields,d=void 0===p||p,f=e.showFilterButton,m=void 0!==f&&f,O=e.isLoading,v=void 0!==O&&O,h=e.onSubmit,g=void 0===h?function(){}:h,j=Object(o.useRef)(),_=Object(o.useRef)(),y=s||10*Math.pow(10,b.minorUnit),k=Object(o.useState)(t),C=w()(k,2),N=C[0],F=C[1],R=Object(o.useState)(n),T=w()(R,2),V=T[0],L=T[1];Object(o.useEffect)((function(){F(t)}),[t]),Object(o.useEffect)((function(){L(n)}),[n]);var M=Object(o.useMemo)((function(){return isFinite(r)&&isFinite(c)}),[r,c]),B=Object(o.useMemo)((function(){return isFinite(t)&&isFinite(n)&&M?{"--low":Math.round((t-r)/(c-r)*100)-.5+"%","--high":Math.round((n-r)/(c-r)*100)+.5+"%"}:{"--low":"0%","--high":"100%"}}),[t,n,r,c,M]),D=Object(o.useCallback)((function(e){if(!v&&M){var t=e.target.getBoundingClientRect(),n=e.clientX-t.left,r=j.current.offsetWidth,o=j.current.value,i=_.current.offsetWidth,a=_.current.value,u=r*(o/c),l=i*(a/c);Math.abs(n-u)>Math.abs(n-l)?(j.current.style.zIndex=20,_.current.style.zIndex=21):(j.current.style.zIndex=21,_.current.style.zIndex=20)}}),[v,c,M]),H=Object(o.useCallback)((function(e){var o=e.target.classList.contains("wc-block-price-filter__range-input--min"),i=e.target.value,a=o?[Math.round(i/y)*y,n]:[t,Math.round(i/y)*y],l=P(a,r,c,y,o);u([parseInt(l[0],10),parseInt(l[1],10)])}),[u,t,n,r,c,y]),I=Object(o.useCallback)((function(e){if(!(e.relatedTarget&&e.relatedTarget.classList&&e.relatedTarget.classList.contains("wc-block-price-filter__amount"))){var t=e.target.classList.contains("wc-block-price-filter__amount--min"),n=P([N,V],null,null,y,t);u([parseInt(n[0],10),parseInt(n[1],10)])}}),[u,y,N,V]),z=l()("wc-block-price-filter","wc-block-components-price-slider",d&&"wc-block-price-filter--has-input-fields",d&&"wc-block-components-price-slider--has-input-fields",m&&"wc-block-price-filter--has-filter-button",m&&"wc-block-components-price-slider--has-filter-button",v&&"is-loading",!M&&"is-disabled"),A=Object(x.b)(j.current)?j.current.ownerDocument.activeElement:void 0,U=A&&A===j.current?y:1,G=A&&A===_.current?y:1,q=N/Math.pow(10,b.minorUnit),Y=V/Math.pow(10,b.minorUnit);return Object(o.createElement)("div",{className:z},Object(o.createElement)("div",{className:"wc-block-price-filter__range-input-wrapper wc-block-components-price-slider__range-input-wrapper",onMouseMove:D,onFocus:D},M&&Object(o.createElement)("div",{"aria-hidden":d},Object(o.createElement)("div",{className:"wc-block-price-filter__range-input-progress wc-block-components-price-slider__range-input-progress",style:B}),Object(o.createElement)("input",{type:"range",className:"wc-block-price-filter__range-input wc-block-price-filter__range-input--min wc-block-components-price-slider__range-input wc-block-components-price-slider__range-input--min","aria-label":Object(i.__)("Filter products by minimum price",'woocommerce'),"aria-valuetext":q,value:Number.isFinite(t)?t:r,onChange:H,step:U,min:r,max:c,ref:j,disabled:v,tabIndex:d?"-1":"0"}),Object(o.createElement)("input",{type:"range",className:"wc-block-price-filter__range-input wc-block-price-filter__range-input--max wc-block-components-price-slider__range-input wc-block-components-price-slider__range-input--max","aria-label":Object(i.__)("Filter products by maximum price",'woocommerce'),"aria-valuetext":Y,value:Number.isFinite(n)?n:c,onChange:H,step:G,min:r,max:c,ref:_,disabled:v,tabIndex:d?"-1":"0"}))),Object(o.createElement)("div",{className:"wc-block-price-filter__controls wc-block-components-price-slider__controls"},d&&Object(o.createElement)(o.Fragment,null,Object(o.createElement)(E.a,{currency:b,displayType:"input",className:"wc-block-price-filter__amount wc-block-price-filter__amount--min wc-block-form-text-input wc-block-components-price-slider__amount wc-block-components-price-slider__amount--min","aria-label":Object(i.__)("Filter products by minimum price",'woocommerce'),onValueChange:function(e){e!==N&&F(e)},onBlur:I,disabled:v||!M,value:N}),Object(o.createElement)(E.a,{currency:b,displayType:"input",className:"wc-block-price-filter__amount wc-block-price-filter__amount--max wc-block-form-text-input wc-block-components-price-slider__amount wc-block-components-price-slider__amount--max","aria-label":Object(i.__)("Filter products by maximum price",'woocommerce'),onValueChange:function(e){e!==V&&L(e)},onBlur:I,disabled:v||!M,value:V})),!d&&!v&&Number.isFinite(t)&&Number.isFinite(n)&&Object(o.createElement)("div",{className:"wc-block-price-filter__range-text wc-block-components-price-slider__range-text"},Object(i.__)("Price",'woocommerce'),":  ",Object(o.createElement)(E.a,{currency:b,value:t})," – ",Object(o.createElement)(E.a,{currency:b,value:n})),m&&Object(o.createElement)(S.a,{className:"wc-block-price-filter__button wc-block-components-price-slider__button",disabled:v||!M,onClick:g,screenReaderLabel:Object(i.__)("Apply price filter",'woocommerce')})))},N=n(222),F=n(47),R=function(e,t,n){var r,c=10*Math.pow(10,t);"ROUND_UP"===n?r=isNaN(e)?null:Math.ceil(parseFloat(e,10)/c)*c:"ROUND_DOWN"===n&&(r=isNaN(e)?null:Math.floor(parseFloat(e,10)/c)*c);var o=Object(_.a)(r,Number.isFinite);return Number.isFinite(r)?r:o},T=function(e){var t=e.attributes,n=e.isEditor,r=void 0!==n&&n,c=Object(y.b)("min_price",null),i=w()(c,2),a=i[0],u=i[1],l=Object(y.b)("max_price",null),s=w()(l,2),b=s[0],p=s[1],d=Object(y.a)(),f=w()(d,1)[0],m=Object(k.a)({queryPrices:!0,queryState:f}),O=m.results,v=m.isLoading,h=Object(o.useState)(),g=w()(h,2),j=g[0],E=g[1],x=Object(o.useState)(),P=w()(x,2),S=P[0],T=P[1],V=Object(F.getCurrencyFromPriceResponse)(O.price_range),L=function(e){var t=e.maxPrice,n=e.minorUnit;return{minConstraint:R(e.minPrice,n,"ROUND_DOWN"),maxConstraint:R(t,n,"ROUND_UP")}}({minPrice:O.price_range?O.price_range.min_price:void 0,maxPrice:O.price_range?O.price_range.max_price:void 0,minorUnit:V.minorUnit}),M=L.minConstraint,B=L.maxConstraint,D=Object(o.useCallback)((function(e,t){u(e===M?void 0:e),p(t===B?void 0:t)}),[M,B,u,p]),H=Object(N.a)(D,500),I=w()(H,1)[0],z=Object(o.useCallback)((function(e){e[0]!==j&&E(e[0]),e[1]!==S&&T(e[1])}),[j,S,E,T]);Object(o.useEffect)((function(){t.showFilterButton||I(j,S)}),[j,S,t.showFilterButton,I]);var A=Object(_.a)(a),U=Object(_.a)(b),G=Object(_.a)(M),q=Object(_.a)(B);if(Object(o.useEffect)((function(){(!Number.isFinite(j)||a!==A&&a!==j||M!==G&&M!==j)&&E(Number.isFinite(a)?a:M),(!Number.isFinite(S)||b!==U&&b!==S||B!==q&&B!==S)&&T(Number.isFinite(b)?b:B)}),[j,S,a,b,M,B,G,q,A,U]),!v&&(null===M||null===B||M===B))return null;var Y="h".concat(t.headingLevel);return Object(o.createElement)(o.Fragment,null,!r&&t.heading&&Object(o.createElement)(Y,{className:"wc-block-price-filter__title"},t.heading),Object(o.createElement)("div",{className:"wc-block-price-slider"},Object(o.createElement)(C,{minConstraint:M,maxConstraint:B,minPrice:j,maxPrice:S,currency:V,showInputFields:t.showInputFields,showFilterButton:t.showFilterButton,onChange:z,onSubmit:function(){return D(j,S)},isLoading:v})))};n(795),Object(a.registerBlockType)("woocommerce/price-filter",{title:Object(i.__)("Filter Products by Price",'woocommerce'),icon:{src:Object(o.createElement)(s.a,{srcElement:b.a}),foreground:"#96588a"},category:"woocommerce",keywords:[Object(i.__)("WooCommerce",'woocommerce')],description:Object(i.__)("Allow customers to filter the products by choosing a lower or upper price limit. Works in combination with the All Products block.",'woocommerce'),supports:{html:!1,multiple:!1},example:{},attributes:{showInputFields:{type:"boolean",default:!0},showFilterButton:{type:"boolean",default:!1},heading:{type:"string",default:Object(i.__)("Filter by price",'woocommerce')},headingLevel:{type:"number",default:3}},edit:function(e){var t=e.attributes,n=e.setAttributes,r=t.className,c=t.heading,a=t.headingLevel,u=t.showInputFields,l=t.showFilterButton;return Object(o.createElement)(o.Fragment,null,0===m.o.productCount?Object(o.createElement)(d.Placeholder,{className:"wc-block-price-slider",icon:Object(o.createElement)(s.a,{srcElement:b.a}),label:Object(i.__)("Filter Products by Price",'woocommerce'),instructions:Object(i.__)("Display a slider to filter products in your store by price.",'woocommerce')},Object(o.createElement)("p",null,Object(i.__)("Products with prices are needed for filtering by price. You haven't created any products yet.",'woocommerce')),Object(o.createElement)(d.Button,{className:"wc-block-price-slider__add-product-button",isSecondary:!0,href:Object(f.getAdminLink)("post-new.php?post_type=product")},Object(i.__)("Add new product",'woocommerce')+" ",Object(o.createElement)(s.a,{srcElement:g.a})),Object(o.createElement)(d.Button,{className:"wc-block-price-slider__read_more_button",isTertiary:!0,href:"https://docs.woocommerce.com/document/managing-products/"},Object(i.__)("Learn more",'woocommerce'))):Object(o.createElement)("div",{className:r},Object(o.createElement)(p.InspectorControls,{key:"inspector"},Object(o.createElement)(d.PanelBody,{title:Object(i.__)("Block Settings",'woocommerce')},Object(o.createElement)(h.a,{label:Object(i.__)("Price Range",'woocommerce'),value:u?"editable":"text",options:[{label:Object(i.__)("Editable",'woocommerce'),value:"editable"},{label:Object(i.__)("Text",'woocommerce'),value:"text"}],onChange:function(e){return n({showInputFields:"editable"===e})}}),Object(o.createElement)(d.ToggleControl,{label:Object(i.__)("Filter button",'woocommerce'),help:l?Object(i.__)("Products will only update when the button is pressed.",'woocommerce'):Object(i.__)("Products will update when the slider is moved.",'woocommerce'),checked:l,onChange:function(){return n({showFilterButton:!l})}}),Object(o.createElement)("p",null,Object(i.__)("Heading Level",'woocommerce')),Object(o.createElement)(O.a,{isCollapsed:!1,minLevel:2,maxLevel:7,selectedLevel:a,onChange:function(e){return n({headingLevel:e})}}))),Object(o.createElement)(v.a,{className:"wc-block-price-filter__title",headingLevel:a,heading:c,onChange:function(e){return n({heading:e})}}),Object(o.createElement)(d.Disabled,null,Object(o.createElement)(T,{attributes:t,isEditor:!0}))))},save:function(e){var t=e.attributes,n=t.className,r={"data-showinputfields":t.showInputFields,"data-showfilterbutton":t.showFilterButton,"data-heading":t.heading,"data-heading-level":t.headingLevel};return Object(o.createElement)("div",c()({className:l()("is-loading",n)},r),Object(o.createElement)("span",{"aria-hidden":!0,className:"wc-block-product-categories__placeholder"}))}})},88:function(e,t,n){"use strict";var r=n(9),c=n.n(r),o=n(17),i=n.n(o),a=n(18),u=n.n(a),l=n(13),s=n.n(l),b=n(19),p=n.n(b),d=n(20),f=n.n(d),m=n(10),O=n.n(m),v=n(0),h=n(7),g=n(6),j=n.n(g),w=n(4),_=n(21);n(123);var y=function(e){p()(o,e);var t,n,r=(t=o,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=O()(t);if(n){var c=O()(this).constructor;e=Reflect.construct(r,arguments,c)}else e=r.apply(this,arguments);return f()(this,e)});function o(){var e;return i()(this,o),(e=r.apply(this,arguments)).onClick=e.onClick.bind(s()(e)),e}return u()(o,[{key:"onClick",value:function(e){this.props.onChange&&this.props.onChange(e.target.value)}},{key:"render",value:function(){var e,t=this,n=this.props,r=n.label,o=n.checked,i=n.instanceId,a=n.className,u=n.help,l=n.options,s=n.value,b="inspector-toggle-button-control-".concat(i);return u&&(e=Object(h.isFunction)(u)?u(o):u),Object(v.createElement)(w.BaseControl,{id:b,help:e,className:j()("components-toggle-button-control",a)},Object(v.createElement)("label",{id:b+"__label",htmlFor:b,className:"components-toggle-button-control__label"},r),Object(v.createElement)(w.ButtonGroup,{"aria-labelledby":b+"__label"},l.map((function(e,n){var o={};return s===e.value?(o.isPrimary=!0,o["aria-pressed"]=!0):(o.isSecondary=!0,o["aria-pressed"]=!1),Object(v.createElement)(w.Button,c()({key:"".concat(e.label,"-").concat(e.value,"-").concat(n),value:e.value,onClick:t.onClick,"aria-label":r+": "+e.label},o),e.label)}))))}}]),o}(v.Component);t.a=Object(_.withInstanceId)(y)}});woocommerce-blocks/build/wc-payment-method-bacs.js000064400000003323151335517640016256 0ustar00!function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=25)}({1:function(e,t){e.exports=window.wp.i18n},25:function(e,t,n){"use strict";n.r(t);var r,o=n(7),c=n(1),i=n(4),u=n(6),a=Object(i.getSetting)("bacs_data",{}),l=Object(c.__)("Direct bank transfer",'woocommerce'),f=Object(u.decodeEntities)(a.title)||l,s=function(){return Object(u.decodeEntities)(a.description||"")},d=function(e){var t=e.components.PaymentMethodLabel;return React.createElement(t,{text:f})},p={name:"bacs",label:React.createElement(d,null),content:React.createElement(s,null),edit:React.createElement(s,null),canMakePayment:function(){return!0},ariaLabel:f,supports:{features:null!==(r=null==a?void 0:a.supports)&&void 0!==r?r:[]}};Object(o.registerPaymentMethod)(p)},4:function(e,t){e.exports=window.wc.wcSettings},6:function(e,t){e.exports=window.wp.htmlEntities},7:function(e,t){e.exports=window.wc.wcBlocksRegistry}});woocommerce-blocks/build/wc-payment-method-paypal.asset.php000064400000000260151335517640020122 0ustar00<?php return array('dependencies' => array('wc-blocks-registry', 'wc-settings', 'wp-html-entities', 'wp-i18n', 'wp-polyfill'), 'version' => '02c97fdf2403609ccd49ac1264f838ba');woocommerce-blocks/build/product-category.asset.php000064400000000746151335517640016600 0ustar00<?php return array('dependencies' => array('lodash', 'moment', 'react', 'react-dom', 'wc-settings', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-data-controls', 'wp-date', 'wp-deprecated', 'wp-dom', 'wp-element', 'wp-escape-html', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-keycodes', 'wp-polyfill', 'wp-primitives', 'wp-server-side-render', 'wp-url', 'wp-viewport'), 'version' => '0b17b8554468f92fb478e407d7c0b059');woocommerce-blocks/build/mini-cart-component-frontend.js000064400000416322151335517640017515 0ustar00!function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=320)}([function(e,t){e.exports=window.wp.element},function(e,t){e.exports=window.wp.i18n},function(e,t){e.exports=window.wc.wcSettings},function(e,t){e.exports=window.React},function(e,t){e.exports=function(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,r){var n=r(84),o=r(85),c=r(67),i=r(86);e.exports=function(e,t){return n(e)||o(e,t)||c(e,t)||i()},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,r){var n;!function(){"use strict";var r={}.hasOwnProperty;function o(){for(var e=[],t=0;t<arguments.length;t++){var n=arguments[t];if(n){var c=typeof n;if("string"===c||"number"===c)e.push(n);else if(Array.isArray(n)){if(n.length){var i=o.apply(null,n);i&&e.push(i)}}else if("object"===c)if(n.toString===Object.prototype.toString)for(var a in n)r.call(n,a)&&n[a]&&e.push(a);else e.push(n.toString())}}return e.join(" ")}e.exports?(o.default=o,e.exports=o):void 0===(n=function(){return o}.apply(t,[]))||(e.exports=n)}()},function(e,t){e.exports=window.lodash},function(e,t){e.exports=window.wc.wcBlocksData},function(e,t,r){"use strict";function n(e){return(n=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}r.d(t,"a",(function(){return n}))},function(e,t,r){e.exports=r(79)()},function(e,t){e.exports=window.wp.data},function(e,t,r){"use strict";function n(){return(n=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}r.d(t,"a",(function(){return n}))},function(e,t,r){"use strict";function n(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}r.d(t,"a",(function(){return n}))},function(e,t){function r(){return e.exports=r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},e.exports.default=e.exports,e.exports.__esModule=!0,r.apply(this,arguments)}e.exports=r,e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}r.d(t,"a",(function(){return n}))},function(e,t,r){"use strict";function n(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function o(e,t,r){return t&&n(e.prototype,t),r&&n(e,r),e}r.d(t,"a",(function(){return o}))},function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));var n=r(88);function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Object(n.a)(e,t)}},function(e,t,r){"use strict";r.d(t,"a",(function(){return i}));var n=r(21),o=r.n(n),c=r(13);function i(e,t){return!t||"object"!==o()(t)&&"function"!=typeof t?Object(c.a)(e):t}},function(e,t,r){"use strict";function n(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},c=Object.keys(e);for(n=0;n<c.length;n++)r=c[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(e);for(n=0;n<c.length;n++)r=c[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}r.d(t,"a",(function(){return n}))},function(e,t,r){"use strict";function n(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}r.d(t,"a",(function(){return n}))},function(e,t){function r(t){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?(e.exports=r=function(e){return typeof e},e.exports.default=e.exports,e.exports.__esModule=!0):(e.exports=r=function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.default=e.exports,e.exports.__esModule=!0),r(t)}e.exports=r,e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));var n=r(65);function o(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,c=[],_n=!0,i=!1;try{for(r=r.call(e);!(_n=(n=r.next()).done)&&(c.push(n.value),!t||c.length!==t);_n=!0);}catch(e){i=!0,o=e}finally{try{_n||null==r.return||r.return()}finally{if(i)throw o}}return c}}(e,t)||Object(n.a)(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}},function(e,t,r){var n=r(77);e.exports=function(e,t){if(null==e)return{};var r,o,c=n(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(o=0;o<i.length;o++)r=i[o],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(c[r]=e[r])}return c},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=window.wp.compose},function(e,t){e.exports=window.wp.isShallowEqual},function(e,t){e.exports=window.wc.blocksCheckout},function(e,t){e.exports=window.regeneratorRuntime},function(e,t){e.exports=window.wp.htmlEntities},function(e,t){e.exports=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){function r(t){return e.exports=r=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},e.exports.default=e.exports,e.exports.__esModule=!0,r(t)}e.exports=r,e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,r){"use strict";r.d(t,"a",(function(){return c}));var n=r(59),o=r(65);function c(e){return function(e){if(Array.isArray(e))return Object(n.a)(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||Object(o.a)(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}},function(e,t,r){"use strict";r.d(t,"a",(function(){return j}));var n=r(5),o=r.n(n),c=r(4),i=r.n(c),a=r(7),u=r(0),s=r(8),l=r(11),f=r(28),p=r(92),d=r(93),m=r(36);function b(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function v(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?b(Object(r),!0).forEach((function(t){i()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):b(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var h={first_name:"",last_name:"",company:"",address_1:"",address_2:"",city:"",state:"",postcode:"",country:"",phone:""},g=v(v({},h),{},{email:""}),y={total_items:"",total_items_tax:"",total_fees:"",total_fees_tax:"",total_discount:"",total_discount_tax:"",total_shipping:"",total_shipping_tax:"",total_price:"",total_tax:"",tax_lines:s.EMPTY_TAX_LINES,currency_code:"",currency_symbol:"",currency_minor_unit:2,currency_decimal_separator:"",currency_thousand_separator:"",currency_prefix:"",currency_suffix:""},O=function(e){return Object(p.a)(Object.entries(e).map((function(e){var t=o()(e,2),r=t[0],n=t[1];return[r,Object(f.decodeEntities)(n)]})))},E={cartCoupons:s.EMPTY_CART_COUPONS,cartItems:s.EMPTY_CART_ITEMS,cartFees:s.EMPTY_CART_FEES,cartItemsCount:0,cartItemsWeight:0,cartNeedsPayment:!0,cartNeedsShipping:!0,cartItemErrors:s.EMPTY_CART_ITEM_ERRORS,cartTotals:y,cartIsLoading:!0,cartErrors:s.EMPTY_CART_ERRORS,billingAddress:g,shippingAddress:h,shippingRates:s.EMPTY_SHIPPING_RATES,shippingRatesLoading:!1,cartHasCalculatedShipping:!1,paymentRequirements:s.EMPTY_PAYMENT_REQUIREMENTS,receiveCart:function(){},extensions:s.EMPTY_EXTENSIONS},j=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{shouldSelect:!0},t=Object(m.a)(),r=t.isEditor,n=t.previewData,o=null==n?void 0:n.previewCart,c=e.shouldSelect,i=Object(u.useRef)(),f=Object(l.useSelect)((function(e,t){var n=t.dispatch;if(!c)return E;if(r)return{cartCoupons:o.coupons,cartItems:o.items,cartFees:o.fees,cartItemsCount:o.items_count,cartItemsWeight:o.items_weight,cartNeedsPayment:o.needs_payment,cartNeedsShipping:o.needs_shipping,cartItemErrors:s.EMPTY_CART_ITEM_ERRORS,cartTotals:o.totals,cartIsLoading:!1,cartErrors:s.EMPTY_CART_ERRORS,billingAddress:g,shippingAddress:h,extensions:s.EMPTY_EXTENSIONS,shippingRates:o.shipping_rates,shippingRatesLoading:!1,cartHasCalculatedShipping:o.has_calculated_shipping,paymentRequirements:o.paymentRequirements,receiveCart:"function"==typeof(null==o?void 0:o.receiveCart)?o.receiveCart:function(){}};var i=e(s.CART_STORE_KEY),a=i.getCartData(),u=i.getCartErrors(),l=i.getCartTotals(),f=!i.hasFinishedResolution("getCartData"),p=i.isCustomerDataUpdating(),m=n(s.CART_STORE_KEY).receiveCart,b=O(a.billingAddress),y=a.needsShipping?O(a.shippingAddress):b,j=a.fees.length>0?a.fees.map((function(e){return O(e)})):s.EMPTY_CART_FEES;return{cartCoupons:a.coupons.length>0?a.coupons.map((function(e){return v(v({},e),{},{label:e.code})})):s.EMPTY_CART_COUPONS,cartItems:a.items,cartFees:j,cartItemsCount:a.itemsCount,cartItemsWeight:a.itemsWeight,cartNeedsPayment:a.needsPayment,cartNeedsShipping:a.needsShipping,cartItemErrors:a.errors,cartTotals:l,cartIsLoading:f,cartErrors:u,billingAddress:Object(d.a)(b),shippingAddress:Object(d.a)(y),extensions:a.extensions,shippingRates:a.shippingRates,shippingRatesLoading:p,cartHasCalculatedShipping:a.hasCalculatedShipping,paymentRequirements:a.paymentRequirements,receiveCart:m}}),[c]);return i.current&&Object(a.isEqual)(i.current,f)||(i.current=f),i.current}},function(e,t){e.exports=window.wp.a11y},function(e,t){e.exports=window.wp.primitives},function(e,t,r){"use strict";r.d(t,"a",(function(){return u})),r.d(t,"b",(function(){return s})),r.d(t,"c",(function(){return f}));var n,o,c=r(49);!function(e){e.SUCCESS="success",e.FAIL="failure",e.ERROR="error"}(n||(n={})),function(e){e.PAYMENTS="wc/payment-area",e.EXPRESS_PAYMENTS="wc/express-payment-area"}(o||(o={}));var i=function(e,t){return Object(c.b)(e)&&"type"in e&&e.type===t},a=function(e){return i(e,n.SUCCESS)},u=function(e){return i(e,n.ERROR)},s=function(e){return i(e,n.FAIL)},l=function(e){return!Object(c.b)(e)||void 0===e.retry||!0===e.retry},f=function(){return{responseTypes:n,noticeContexts:o,shouldRetry:l,isSuccessResponse:a,isErrorResponse:u,isFailResponse:s}}},function(e,t,r){"use strict";r.d(t,"a",(function(){return c}));var n=r(0),o=(r(11),Object(n.createContext)({isEditor:!1,currentPostId:0,previewData:{},getPreviewData:function(){}})),c=function(){return Object(n.useContext)(o)}},function(e,t){e.exports=window.wp.dom},,function(e,t){function r(e,t,r,n,o,c,i){try{var a=e[c](i),u=a.value}catch(e){return void r(e)}a.done?t(u):Promise.resolve(u).then(n,o)}e.exports=function(e){return function(){var t=this,n=arguments;return new Promise((function(o,c){var i=e.apply(t,n);function a(e){r(i,o,c,a,u,"next",e)}function u(e){r(i,o,c,a,u,"throw",e)}a(void 0)}))}},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){function r(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}e.exports=function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,r){var n=r(71);e.exports=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&n(e,t)},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,r){var n=r(21).default,o=r(29);e.exports=function(e,t){return!t||"object"!==n(t)&&"function"!=typeof t?o(e):t},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,r){"use strict";var n=r(40),o=r.n(n),c=r(41),i=r.n(c),a=r(29),u=r.n(a),s=r(42),l=r.n(s),f=r(43),p=r.n(f),d=r(30),m=r.n(d),b=r(4),v=r.n(b),h=(r(10),r(3)),g=r(1),y=r(83),O=function(e){var t=e.imageUrl,r=void 0===t?"".concat(y.l,"/block-error.svg"):t,n=e.header,o=void 0===n?Object(g.__)("Oops!",'woocommerce'):n,c=e.text,i=void 0===c?Object(g.__)("There was an error loading the content.",'woocommerce'):c,a=e.errorMessage,u=e.errorMessagePrefix,s=void 0===u?Object(g.__)("Error:",'woocommerce'):u,l=e.button;return React.createElement("div",{className:"wc-block-error wc-block-components-error"},r&&React.createElement("img",{className:"wc-block-error__image wc-block-components-error__image",src:r,alt:""}),React.createElement("div",{className:"wc-block-error__content wc-block-components-error__content"},o&&React.createElement("p",{className:"wc-block-error__header wc-block-components-error__header"},o),i&&React.createElement("p",{className:"wc-block-error__text wc-block-components-error__text"},i),a&&React.createElement("p",{className:"wc-block-error__message wc-block-components-error__message"},s?s+" ":"",a),l&&React.createElement("p",{className:"wc-block-error__button wc-block-components-error__button"},l)))};r(81);var E=function(e){l()(c,e);var t,r,n=(t=c,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,n=m()(t);if(r){var o=m()(this).constructor;e=Reflect.construct(n,arguments,o)}else e=n.apply(this,arguments);return p()(this,e)});function c(){var e;o()(this,c);for(var t=arguments.length,r=new Array(t),i=0;i<t;i++)r[i]=arguments[i];return e=n.call.apply(n,[this].concat(r)),v()(u()(e),"state",{errorMessage:"",hasError:!1}),e}return i()(c,[{key:"render",value:function(){var e=this.props,t=e.header,r=e.imageUrl,n=e.showErrorMessage,o=e.text,c=e.errorMessagePrefix,i=e.renderError,a=e.button,u=this.state,s=u.errorMessage;return u.hasError?"function"==typeof i?i({errorMessage:s}):React.createElement(O,{errorMessage:n?s:null,header:t,imageUrl:r,text:o,errorMessagePrefix:c,button:a}):this.props.children}}],[{key:"getDerivedStateFromError",value:function(e){return void 0!==e.statusText&&void 0!==e.status?{errorMessage:React.createElement(React.Fragment,null,React.createElement("strong",null,e.status),": ",e.statusText),hasError:!0}:{errorMessage:e.message,hasError:!0}}}]),c}(h.Component);E.defaultProps={showErrorMessage:!0},t.a=E},function(e,t){e.exports=window.wp.deprecated},function(e,t,r){var n=r(94),o=r(95),c=r(67),i=r(96);e.exports=function(e){return n(e)||o(e)||c(e)||i()},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,r){"use strict";(function(e){var n=r(0),o=(r(74),Object(n.createContext)({slots:{},fills:{},registerSlot:function(){void 0!==e&&e.env},updateSlot:function(){},unregisterSlot:function(){},registerFill:function(){},unregisterFill:function(){}}));t.a=o}).call(this,r(102))},function(e,t,r){"use strict";r.d(t,"b",(function(){return F})),r.d(t,"a",(function(){return L}));var n,o=r(5),c=r.n(o),i=r(0),a=r(1),u=r(99),s=r(45),l=r.n(s),f=r(49);!function(e){e.SET_IDLE="set_idle",e.SET_PRISTINE="set_pristine",e.SET_REDIRECT_URL="set_redirect_url",e.SET_COMPLETE="set_checkout_complete",e.SET_BEFORE_PROCESSING="set_before_processing",e.SET_AFTER_PROCESSING="set_after_processing",e.SET_PROCESSING_RESPONSE="set_processing_response",e.SET_PROCESSING="set_checkout_is_processing",e.SET_HAS_ERROR="set_checkout_has_error",e.SET_NO_ERROR="set_checkout_no_error",e.SET_CUSTOMER_ID="set_checkout_customer_id",e.SET_ORDER_ID="set_checkout_order_id",e.SET_ORDER_NOTES="set_checkout_order_notes",e.INCREMENT_CALCULATING="increment_calculating",e.DECREMENT_CALCULATING="decrement_calculating",e.SET_SHOULD_CREATE_ACCOUNT="set_should_create_account",e.SET_EXTENSION_DATA="set_extension_data"}(n||(n={}));var p,d,m=function(){return{type:n.SET_IDLE}},b=function(e){return{type:n.SET_REDIRECT_URL,redirectUrl:e}},v=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{type:n.SET_COMPLETE,data:e}},h=function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return{type:e?n.SET_HAS_ERROR:n.SET_NO_ERROR}},g=r(4),y=r.n(g),O=r(2);function E(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}!function(e){e.PRISTINE="pristine",e.IDLE="idle",e.PROCESSING="processing",e.COMPLETE="complete",e.BEFORE_PROCESSING="before_processing",e.AFTER_PROCESSING="after_processing"}(d||(d={}));var j=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?E(Object(r),!0).forEach((function(t){y()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):E(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({order_id:0,customer_id:0},(null===(p=Object(O.getSetting)("preloadedApiRequests",{})["/wc/store/checkout"])||void 0===p?void 0:p.body)||{}),_={redirectUrl:"",status:d.PRISTINE,hasError:!1,calculatingCount:0,orderId:j.order_id,orderNotes:"",customerId:j.customer_id,shouldCreateAccount:!1,processingResponse:null,extensionData:{}};function w(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function S(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?w(Object(r),!0).forEach((function(t){y()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):w(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var R=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:_,t=arguments.length>1?arguments[1]:void 0,r=t.redirectUrl,o=t.type,c=t.customerId,i=t.orderId,a=t.orderNotes,u=t.extensionData,s=t.shouldCreateAccount,l=t.data,f=e;switch(o){case n.SET_PRISTINE:f=_;break;case n.SET_IDLE:f=e.status!==d.IDLE?S(S({},e),{},{status:d.IDLE}):e;break;case n.SET_REDIRECT_URL:f=void 0!==r&&r!==e.redirectUrl?S(S({},e),{},{redirectUrl:r}):e;break;case n.SET_PROCESSING_RESPONSE:f=S(S({},e),{},{processingResponse:l});break;case n.SET_COMPLETE:f=e.status!==d.COMPLETE?S(S({},e),{},{status:d.COMPLETE,redirectUrl:void 0!==l&&"string"==typeof l.redirectUrl&&l.redirectUrl?l.redirectUrl:e.redirectUrl}):e;break;case n.SET_PROCESSING:f=!1===(f=e.status!==d.PROCESSING?S(S({},e),{},{status:d.PROCESSING,hasError:!1}):e).hasError?f:S(S({},f),{},{hasError:!1});break;case n.SET_BEFORE_PROCESSING:f=e.status!==d.BEFORE_PROCESSING?S(S({},e),{},{status:d.BEFORE_PROCESSING,hasError:!1}):e;break;case n.SET_AFTER_PROCESSING:f=e.status!==d.AFTER_PROCESSING?S(S({},e),{},{status:d.AFTER_PROCESSING}):e;break;case n.SET_HAS_ERROR:f=e.hasError?e:S(S({},e),{},{hasError:!0}),f=e.status===d.PROCESSING||e.status===d.BEFORE_PROCESSING?S(S({},f),{},{status:d.IDLE}):f;break;case n.SET_NO_ERROR:f=e.hasError?S(S({},e),{},{hasError:!1}):e;break;case n.INCREMENT_CALCULATING:f=S(S({},e),{},{calculatingCount:e.calculatingCount+1});break;case n.DECREMENT_CALCULATING:f=S(S({},e),{},{calculatingCount:Math.max(0,e.calculatingCount-1)});break;case n.SET_CUSTOMER_ID:f=void 0!==c?S(S({},e),{},{customerId:c}):e;break;case n.SET_ORDER_ID:f=void 0!==i?S(S({},e),{},{orderId:i}):e;break;case n.SET_SHOULD_CREATE_ACCOUNT:void 0!==s&&s!==e.shouldCreateAccount&&(f=S(S({},e),{},{shouldCreateAccount:s}));break;case n.SET_ORDER_NOTES:void 0!==a&&e.orderNotes!==a&&(f=S(S({},e),{},{orderNotes:a}));break;case n.SET_EXTENSION_DATA:void 0!==u&&e.extensionData!==u&&(f=S(S({},e),{},{extensionData:u}))}return f!==e&&o!==n.SET_PRISTINE&&f.status===d.PRISTINE&&(f.status=d.IDLE),f},P=r(28),k=r(98),C=r(191),x=r(193),T=r(127),N=r(54),A=r(52),I=r(11),D=r(35),M=Object(i.createContext)({dispatchActions:{resetCheckout:function(){},setRedirectUrl:function(e){},setHasError:function(e){},setAfterProcessing:function(e){},incrementCalculating:function(){},decrementCalculating:function(){},setCustomerId:function(e){},setOrderId:function(e){},setOrderNotes:function(e){},setExtensionData:function(e){}},onSubmit:function(){},isComplete:!1,isIdle:!1,isCalculating:!1,isProcessing:!1,isBeforeProcessing:!1,isAfterProcessing:!1,hasError:!1,redirectUrl:"",orderId:0,orderNotes:"",customerId:0,onCheckoutAfterProcessingWithSuccess:function(){return function(){}},onCheckoutAfterProcessingWithError:function(){return function(){}},onCheckoutBeforeProcessing:function(){return function(){}},onCheckoutValidationBeforeProcessing:function(){return function(){}},hasOrder:!1,isCart:!1,shouldCreateAccount:!1,setShouldCreateAccount:function(e){},extensionData:{}}),F=function(){return Object(i.useContext)(M)},L=function(e){var t=e.children,r=e.redirectUrl,o=e.isCart,s=void 0!==o&&o;_.redirectUrl=r;var p,g=Object(i.useReducer)(R,_),y=c()(g,2),O=y[0],E=y[1],j=Object(T.b)().setValidationErrors,w=Object(N.a)(),S=w.addErrorNotice,F=w.removeNotices,L=Object(A.a)().dispatchCheckoutEvent,U=O.calculatingCount>0,B=Object(D.c)(),V=B.isSuccessResponse,q=B.isErrorResponse,H=B.isFailResponse,G=B.shouldRetry,W=(p=Object(D.c)().noticeContexts,{checkoutNotices:Object(I.useSelect)((function(e){return e("core/notices").getNotices("wc/checkout")}),[]),expressPaymentNotices:Object(I.useSelect)((function(e){return e("core/notices").getNotices(p.EXPRESS_PAYMENTS)}),[p.EXPRESS_PAYMENTS]),paymentNotices:Object(I.useSelect)((function(e){return e("core/notices").getNotices(p.PAYMENTS)}),[p.PAYMENTS])}),Y=W.checkoutNotices,K=W.paymentNotices,z=W.expressPaymentNotices,$=Object(i.useReducer)(k.b,{}),Q=c()($,2),X=Q[0],Z=Q[1],J=Object(i.useRef)(X),ee=function(e){return Object(i.useMemo)((function(){return{onCheckoutAfterProcessingWithSuccess:Object(C.a)("checkout_after_processing_with_success",e),onCheckoutAfterProcessingWithError:Object(C.a)("checkout_after_processing_with_error",e),onCheckoutValidationBeforeProcessing:Object(C.a)("checkout_validation_before_processing",e)}}),[e])}(Z),te=ee.onCheckoutAfterProcessingWithSuccess,re=ee.onCheckoutAfterProcessingWithError,ne=ee.onCheckoutValidationBeforeProcessing;Object(i.useEffect)((function(){J.current=X}),[X]);var oe=Object(i.useMemo)((function(){return function(){return l()("onCheckoutBeforeProcessing",{alternative:"onCheckoutValidationBeforeProcessing",plugin:"WooCommerce Blocks"}),ne.apply(void 0,arguments)}}),[ne]),ce=Object(i.useMemo)((function(){return{resetCheckout:function(){E({type:n.SET_PRISTINE})},setRedirectUrl:function(e){E(b(e))},setHasError:function(e){E(h(e))},incrementCalculating:function(){E({type:n.INCREMENT_CALCULATING})},decrementCalculating:function(){E({type:n.DECREMENT_CALCULATING})},setCustomerId:function(e){var t;E((t=e,{type:n.SET_CUSTOMER_ID,customerId:t}))},setOrderId:function(e){E(function(e){return{type:n.SET_ORDER_ID,orderId:e}}(e))},setOrderNotes:function(e){E(function(e){return{type:n.SET_ORDER_NOTES,orderNotes:e}}(e))},setExtensionData:function(e){E(function(e){return{type:n.SET_EXTENSION_DATA,extensionData:e}}(e))},setAfterProcessing:function(e){var t,r=function(e){var t={message:"",paymentStatus:"",redirectUrl:"",paymentDetails:{}};return"payment_result"in e&&(t.paymentStatus=e.payment_result.payment_status,t.redirectUrl=e.payment_result.redirect_url,e.payment_result.hasOwnProperty("payment_details")&&Array.isArray(e.payment_result.payment_details)&&e.payment_result.payment_details.forEach((function(e){var r=e.key,n=e.value;t.paymentDetails[r]=Object(P.decodeEntities)(n)}))),"message"in e&&(t.message=Object(P.decodeEntities)(e.message)),!t.message&&"data"in e&&"status"in e.data&&e.data.status>299&&(t.message=Object(a.__)("Something went wrong. Please contact us to get assistance.",'woocommerce')),t}(e);r.redirectUrl&&E(b(r.redirectUrl)),E((t=r,{type:n.SET_PROCESSING_RESPONSE,data:t})),E({type:n.SET_AFTER_PROCESSING})}}}),[]);Object(i.useEffect)((function(){O.status===d.BEFORE_PROCESSING&&(F("error"),Object(x.a)(J.current,"checkout_validation_before_processing",{}).then((function(e){!0!==e?(Array.isArray(e)&&e.forEach((function(e){var t=e.errorMessage,r=e.validationErrors;S(t),j(r)})),E(m()),E(h())):E({type:n.SET_PROCESSING})})))}),[O.status,j,S,F,E]);var ie=Object(u.a)(O.status),ae=Object(u.a)(O.hasError);Object(i.useEffect)((function(){if((O.status!==ie||O.hasError!==ae)&&O.status===d.AFTER_PROCESSING){var e={redirectUrl:O.redirectUrl,orderId:O.orderId,customerId:O.customerId,orderNotes:O.orderNotes,processingResponse:O.processingResponse};O.hasError?Object(x.b)(J.current,"checkout_after_processing_with_error",e).then((function(t){var r=function(e){var t=null;return e.forEach((function(e){if((q(e)||H(e))&&e.message){var r=e.messageContext?{context:e.messageContext}:void 0;t=e,S(e.message,r)}})),t}(t);if(null!==r)G(r)?E(m()):E(v(r));else{if(!(Y.some((function(e){return"error"===e.status}))||z.some((function(e){return"error"===e.status}))||K.some((function(e){return"error"===e.status})))){var n,o=(null===(n=e.processingResponse)||void 0===n?void 0:n.message)||Object(a.__)("Something went wrong. Please contact us to get assistance.",'woocommerce');S(o,{id:"checkout"})}E(m())}})):Object(x.b)(J.current,"checkout_after_processing_with_success",e).then((function(e){var t=null,r=null;if(e.forEach((function(e){V(e)&&(t=e),(q(e)||H(e))&&(r=e)})),t&&!r)E(v(t));else if(Object(f.b)(r)){if(r.message){var n=r.messageContext?{context:r.messageContext}:void 0;S(r.message,n)}G(r)?E(h(!0)):E(v(r))}else E(v())}))}}),[O.status,O.hasError,O.redirectUrl,O.orderId,O.customerId,O.orderNotes,O.processingResponse,ie,ae,ce,S,q,H,V,G,Y,z,K]);var ue={onSubmit:Object(i.useCallback)((function(){L("submit"),E({type:n.SET_BEFORE_PROCESSING})}),[L]),isComplete:O.status===d.COMPLETE,isIdle:O.status===d.IDLE,isCalculating:U,isProcessing:O.status===d.PROCESSING,isBeforeProcessing:O.status===d.BEFORE_PROCESSING,isAfterProcessing:O.status===d.AFTER_PROCESSING,hasError:O.hasError,redirectUrl:O.redirectUrl,onCheckoutBeforeProcessing:oe,onCheckoutValidationBeforeProcessing:ne,onCheckoutAfterProcessingWithSuccess:te,onCheckoutAfterProcessingWithError:re,dispatchActions:ce,isCart:s,orderId:O.orderId,hasOrder:!!O.orderId,customerId:O.customerId,orderNotes:O.orderNotes,shouldCreateAccount:O.shouldCreateAccount,setShouldCreateAccount:function(e){return E((t=e,{type:n.SET_SHOULD_CREATE_ACCOUNT,shouldCreateAccount:t}));var t},extensionData:O.extensionData};return React.createElement(M.Provider,{value:ue},t)}},function(e,t,r){"use strict";r.d(t,"a",(function(){return n})),r.d(t,"c",(function(){return o})),r.d(t,"b",(function(){return c})),r.d(t,"d",(function(){return i}));var n=function(e){return"number"==typeof e},o=function(e){return"string"==typeof e},c=function(e){return!function(e){return null===e}(e)&&e instanceof Object&&e.constructor===Object};function i(e,t){return c(e)&&t in e}},function(e,t){e.exports=window.wp.keycodes},,function(e,t,r){"use strict";r.d(t,"a",(function(){return l}));var n=r(4),o=r.n(n),c=r(75),i=r(0),a=r(32);function u(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function s(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?u(Object(r),!0).forEach((function(t){o()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):u(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var l=function(){var e=Object(a.a)(),t=Object(i.useRef)(e);return Object(i.useEffect)((function(){t.current=e}),[e]),{dispatchStoreEvent:Object(i.useCallback)((function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};try{Object(c.doAction)("experimental__woocommerce_blocks-".concat(e),t)}catch(e){console.error(e)}}),[]),dispatchCheckoutEvent:Object(i.useCallback)((function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};try{Object(c.doAction)("experimental__woocommerce_blocks-checkout-".concat(e),s(s({},r),{},{storeCart:t.current}))}catch(e){console.error(e)}}),[])}}},,function(e,t,r){"use strict";r.d(t,"a",(function(){return s}));var n=r(4),o=r.n(n),c=r(0),i=r(103);function a(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function u(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?a(Object(r),!0).forEach((function(t){o()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):a(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var s=function(){var e=Object(i.b)(),t=e.notices,r=e.createNotice,n=e.removeNotice,o=e.setIsSuppressed,a=Object(c.useRef)(t);Object(c.useEffect)((function(){a.current=t}),[t]);var s=Object(c.useMemo)((function(){return{hasNoticesOfType:function(e){return a.current.some((function(t){return t.type===e}))},removeNotices:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;a.current.forEach((function(t){null!==e&&t.status!==e||n(t.id)}))},removeNotice:n}}),[n]),l=Object(c.useMemo)((function(){return{addDefaultNotice:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};r("default",e,u({},t))},addErrorNotice:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};r("error",e,u({},t))},addWarningNotice:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};r("warning",e,u({},t))},addInfoNotice:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};r("info",e,u({},t))},addSuccessNotice:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};r("success",e,u({},t))}}}),[r]);return u(u(u({notices:t},s),l),{},{setIsSuppressed:o})}},,,,function(e,t){e.exports=window.wc.priceFormat},function(e,t,r){"use strict";function n(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}r.d(t,"a",(function(){return n}))},,,,,,function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));var n=r(59);function o(e,t){if(e){if("string"==typeof e)return Object(n.a)(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Object(n.a)(e,t):void 0}}},,function(e,t,r){var n=r(68);e.exports=function(e,t){if(e){if("string"==typeof e)return n(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?n(e,t):void 0}},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,r){"use strict";var n=r(14),o=r.n(n),c=r(4),i=r.n(c),a=r(23),u=r.n(a),s=r(126),l=r(6),f=r.n(l),p=(r(147),["className","value","currency","onValueChange","displayType"]);function d(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function m(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?d(Object(r),!0).forEach((function(t){i()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):d(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}t.a=function(e){var t=e.className,r=e.value,n=e.currency,c=e.onValueChange,i=e.displayType,a=void 0===i?"text":i,l=u()(e,p),d="string"==typeof r?parseInt(r,10):r;if(!Number.isFinite(d))return null;var b=d/Math.pow(10,n.minorUnit);if(!Number.isFinite(b))return null;var v=f()("wc-block-formatted-money-amount","wc-block-components-formatted-money-amount",t),h=m(m(m({},l),function(e){return{thousandSeparator:e.thousandSeparator,decimalSeparator:e.decimalSeparator,decimalScale:e.minorUnit,fixedDecimalScale:!0,prefix:e.prefix,suffix:e.suffix,isNumericString:!0}}(n)),{},{value:void 0,currency:void 0,onValueChange:void 0}),g=c?function(e){var t=e.value*Math.pow(10,n.minorUnit);c(t)}:function(){};return React.createElement(s.a,o()({className:v,displayType:a},h,{value:b,onValueChange:g}))}},,function(e,t){function r(t,n){return e.exports=r=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},e.exports.default=e.exports,e.exports.__esModule=!0,r(t,n)}e.exports=r,e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=window.wp.url},,function(e,t){e.exports=window.wp.warning},function(e,t){e.exports=window.wp.hooks},function(e,t,r){"use strict";var n=r(12),o=r(19),c=r(0),i=r(6),a=r.n(i),u=r(7),s=r(45),l=r.n(s),f=r(15),p=r(16),d=r(17),m=r(18),b=r(9),v=r(22),h=r(37),g=r(50),y=r(24),O=r(116),E=r(20);function j(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function _(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?j(Object(r),!0).forEach((function(t){Object(E.a)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):j(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function w(e,t,r,n,o,c,i){var a=t.width,u="rtl"===document.documentElement.dir;"left"===r&&u?r="right":"right"===r&&u&&(r="left"),"left"===n&&u?n="right":"right"===n&&u&&(n="left");var s=Math.round(e.left+e.width/2),l={popoverLeft:s,contentWidth:(s-a/2>0?a/2:s)+(s+a/2>window.innerWidth?window.innerWidth-s:a/2)},f=e.left;"right"===n?f=e.right:"middle"!==c&&(f=s);var p=e.right;"left"===n?p=e.left:"middle"!==c&&(p=s);var d,m={popoverLeft:f,contentWidth:f-a>0?a:f},b={popoverLeft:p,contentWidth:p+a>window.innerWidth?window.innerWidth-p:a},v=r,h=null;if(!o)if("center"===r&&l.contentWidth===a)v="center";else if("left"===r&&m.contentWidth===a)v="left";else if("right"===r&&b.contentWidth===a)v="right";else{var g="left"==(v=m.contentWidth>b.contentWidth?"left":"right")?m.contentWidth:b.contentWidth;h=g!==a?g:null}if(d="center"===v?l.popoverLeft:"left"===v?m.popoverLeft:b.popoverLeft,i){var y=i.getBoundingClientRect();d=Math.min(d,y.right-a)}return{xAxis:v,popoverLeft:d,contentWidth:h}}function S(e,t,r,n,o,c,i){var a=t.height;if(o){var u=(Object(h.getScrollContainer)(c)||document.body).getBoundingClientRect().top+a-i;if(e.top<=u)return{yAxis:r,popoverTop:Math.min(e.bottom,u)}}var s=e.top+e.height/2;"bottom"===n?s=e.bottom:"top"===n&&(s=e.top);var l={popoverTop:s,contentHeight:(s-a/2>0?a/2:s)+(s+a/2>window.innerHeight?window.innerHeight-s:a/2)},f={popoverTop:e.top,contentHeight:e.top-10-a>0?a:e.top-10},p={popoverTop:e.bottom,contentHeight:e.bottom+10+a>window.innerHeight?window.innerHeight-10-e.bottom:a},d=r,m=null;if(!o)if("middle"===r&&l.contentHeight===a)d="middle";else if("top"===r&&f.contentHeight===a)d="top";else if("bottom"===r&&p.contentHeight===a)d="bottom";else{var b="top"==(d=f.contentHeight>p.contentHeight?"top":"bottom")?f.contentHeight:p.contentHeight;m=b!==a?b:null}return{yAxis:d,popoverTop:"middle"===d?l.popoverTop:"top"===d?f.popoverTop:p.popoverTop,contentHeight:m}}var R=r(31),P=r(13);var k=Object(c.createContext)({focusHistory:[]}),C=k.Provider,x=k.Consumer;C.displayName="FocusReturnProvider",x.displayName="FocusReturnConsumer",c.Component;var T=Object(y.createHigherOrderComponent)((function e(t){if((n=t)instanceof c.Component||"function"==typeof n){var r=t;return e({})(r)}var n,o=t.onFocusReturn,i=void 0===o?u.stubTrue:o;return function(e){var t=function(t){Object(d.a)(a,t);var r,n,o=(r=a,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=Object(b.a)(r);if(n){var o=Object(b.a)(this).constructor;e=Reflect.construct(t,arguments,o)}else e=t.apply(this,arguments);return Object(m.a)(this,e)});function a(){var e;return Object(f.a)(this,a),(e=o.apply(this,arguments)).ownFocusedElements=new Set,e.activeElementOnMount=document.activeElement,e.setIsFocusedFalse=function(){return e.isFocused=!1},e.setIsFocusedTrue=function(t){e.ownFocusedElements.add(t.target),e.isFocused=!0},e}return Object(p.a)(a,[{key:"componentWillUnmount",value:function(){var e=this.activeElementOnMount,t=this.isFocused,r=this.ownFocusedElements;if(t&&!1!==i())for(var n,o=[].concat(Object(R.a)(u.without.apply(void 0,[this.props.focus.focusHistory].concat(Object(R.a)(r)))),[e]);n=o.pop();)if(document.body.contains(n))return void n.focus()}},{key:"render",value:function(){return Object(c.createElement)("div",{onFocus:this.setIsFocusedTrue,onBlur:this.setIsFocusedFalse},Object(c.createElement)(e,this.props.childProps))}}]),a}(c.Component);return function(e){return Object(c.createElement)(x,null,(function(r){return Object(c.createElement)(t,{childProps:e,focus:r})}))}}}),"withFocusReturn");var N=Object(y.createHigherOrderComponent)((function(e){return function(t){Object(d.a)(i,t);var r,n,o=(r=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=Object(b.a)(r);if(n){var o=Object(b.a)(this).constructor;e=Reflect.construct(t,arguments,o)}else e=t.apply(this,arguments);return Object(m.a)(this,e)});function i(){var e;return Object(f.a)(this,i),(e=o.apply(this,arguments)).focusContainRef=Object(c.createRef)(),e.handleTabBehaviour=e.handleTabBehaviour.bind(Object(P.a)(e)),e}return Object(p.a)(i,[{key:"handleTabBehaviour",value:function(e){if(e.keyCode===g.TAB){var t=h.focus.tabbable.find(this.focusContainRef.current);if(t.length){var r=t[0],n=t[t.length-1];e.shiftKey&&e.target===r?(e.preventDefault(),n.focus()):(e.shiftKey||e.target!==n)&&t.includes(e.target)||(e.preventDefault(),r.focus())}}}},{key:"render",value:function(){return Object(c.createElement)("div",{onKeyDown:this.handleTabBehaviour,ref:this.focusContainRef,tabIndex:"-1"},Object(c.createElement)(e,this.props))}}]),i}(c.Component)}),"withConstrainedTabbing"),A=r(89);var I=function(e){Object(d.a)(o,e);var t,r,n=(t=o,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,n=Object(b.a)(t);if(r){var o=Object(b.a)(this).constructor;e=Reflect.construct(n,arguments,o)}else e=n.apply(this,arguments);return Object(m.a)(this,e)});function o(){return Object(f.a)(this,o),n.apply(this,arguments)}return Object(p.a)(o,[{key:"handleFocusOutside",value:function(e){this.props.onFocusOutside(e)}},{key:"render",value:function(){return this.props.children}}]),o}(c.Component),D=Object(A.a)(I);function M(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=Object(b.a)(e);if(t){var o=Object(b.a)(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return Object(m.a)(this,r)}}var F=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.htmlDocument,r=void 0===t?document:t,n=e.className,o=void 0===n?"lockscroll":n,i=0,a=0;function u(e){var t=r.scrollingElement||r.body;e&&(a=t.scrollTop);var n=e?"add":"remove";t.classList[n](o),r.documentElement.classList[n](o),e||(t.scrollTop=a)}function s(){0===i&&u(!0),++i}function l(){1===i&&u(!1),--i}return function(e){Object(d.a)(r,e);var t=M(r);function r(){return Object(f.a)(this,r),t.apply(this,arguments)}return Object(p.a)(r,[{key:"componentDidMount",value:function(){s()}},{key:"componentWillUnmount",value:function(){l()}},{key:"render",value:function(){return null}}]),r}(c.Component)}();function L(e){e.stopPropagation()}var U=Object(c.forwardRef)((function(e,t){var r=e.children,i=Object(o.a)(e,["children"]);return Object(c.createElement)("div",Object(n.a)({},i,{ref:t,onMouseDown:L}),r)})),B=r(47);function V(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function q(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?V(Object(r),!0).forEach((function(t){Object(E.a)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):V(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function H(e){var t=Object(c.useContext)(B.a),r=t.slots[e]||{},n=t.fills[e],o=Object(c.useMemo)((function(){return n||[]}),[n]),i=Object(c.useCallback)((function(r){t.updateSlot(e,r)}),[e,t.updateSlot]),a=Object(c.useCallback)((function(r){t.unregisterSlot(e,r)}),[e,t.unregisterSlot]),u=Object(c.useCallback)((function(r){t.registerFill(e,r)}),[e,t.registerFill]),s=Object(c.useCallback)((function(r){t.unregisterFill(e,r)}),[e,t.unregisterFill]);return q(q({},r),{},{updateSlot:i,unregisterSlot:a,fills:o,registerFill:u,unregisterFill:s})}function G(e,t,r){return(G="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,r){var n=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=Object(b.a)(e)););return e}(e,t);if(n){var o=Object.getOwnPropertyDescriptor(n,t);return o.get?o.get.call(r):o.value}})(e,t,r||e)}r(25);var W=Object(c.createContext)({registerSlot:function(){},unregisterSlot:function(){},registerFill:function(){},unregisterFill:function(){},getSlot:function(){},getFills:function(){},subscribe:function(){}}),Y=(W.Provider,W.Consumer);c.Component;var K=function(e){Object(d.a)(o,e);var t,r,n=(t=o,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,n=Object(b.a)(t);if(r){var o=Object(b.a)(this).constructor;e=Reflect.construct(n,arguments,o)}else e=n.apply(this,arguments);return Object(m.a)(this,e)});function o(){var e;return Object(f.a)(this,o),(e=n.apply(this,arguments)).isUnmounted=!1,e.bindNode=e.bindNode.bind(Object(P.a)(e)),e}return Object(p.a)(o,[{key:"componentDidMount",value:function(){(0,this.props.registerSlot)(this.props.name,this)}},{key:"componentWillUnmount",value:function(){var e=this.props.unregisterSlot;this.isUnmounted=!0,e(this.props.name,this)}},{key:"componentDidUpdate",value:function(e){var t=this.props,r=t.name,n=t.unregisterSlot,o=t.registerSlot;e.name!==r&&(n(e.name),o(r,this))}},{key:"bindNode",value:function(e){this.node=e}},{key:"forceUpdate",value:function(){this.isUnmounted||G(Object(b.a)(o.prototype),"forceUpdate",this).call(this)}},{key:"render",value:function(){var e=this.props,t=e.children,r=e.name,n=e.fillProps,o=void 0===n?{}:n,i=e.getFills,a=Object(u.map)(i(r,this),(function(e){var t=e.occurrence,r=Object(u.isFunction)(e.children)?e.children(o):e.children;return c.Children.map(r,(function(e,r){if(!e||Object(u.isString)(e))return e;var n="".concat(t,"---").concat(e.key||r);return Object(c.cloneElement)(e,{key:n})}))})).filter(Object(u.negate)(c.isEmptyElement));return Object(c.createElement)(c.Fragment,null,Object(u.isFunction)(t)?t(a):a)}}]),o}(c.Component),z=function(e){return Object(c.createElement)(Y,null,(function(t){var r=t.registerSlot,o=t.unregisterSlot,i=t.getFills;return Object(c.createElement)(K,Object(n.a)({},e,{registerSlot:r,unregisterSlot:o,getFills:i}))}))},$=0;function Q(e){var t=e.name,r=e.children,n=e.registerFill,o=e.unregisterFill,i=function(e){var t=Object(c.useContext)(W),r=t.getSlot,n=t.subscribe,o=Object(c.useState)(r(e)),i=Object(v.a)(o,2),a=i[0],u=i[1];return Object(c.useEffect)((function(){return u(r(e)),n((function(){u(r(e))}))}),[e]),a}(t),a=Object(c.useRef)({name:t,children:r});return a.current.occurrence||(a.current.occurrence=++$),Object(c.useLayoutEffect)((function(){return n(t,a.current),function(){return o(t,a.current)}}),[]),Object(c.useLayoutEffect)((function(){a.current.children=r,i&&i.forceUpdate()}),[r]),Object(c.useLayoutEffect)((function(){t!==a.current.name&&(o(a.current.name,a.current),a.current.name=t,n(t,a.current))}),[t]),i&&i.node?(Object(u.isFunction)(r)&&(r=r(i.props.fillProps)),Object(c.createPortal)(r,i.node)):null}var X=function(e){return Object(c.createElement)(Y,null,(function(t){var r=t.registerFill,o=t.unregisterFill;return Object(c.createElement)(Q,Object(n.a)({},e,{registerFill:r,unregisterFill:o}))}))};function Z(e){var t=e.name,r=e.fillProps,i=void 0===r?{}:r,a=e.as,u=void 0===a?"div":a,s=Object(o.a)(e,["name","fillProps","as"]),l=Object(c.useContext)(B.a),f=Object(c.useRef)();return Object(c.useLayoutEffect)((function(){return l.registerSlot(t,f,i),function(){l.unregisterSlot(t,f)}}),[l.registerSlot,l.unregisterSlot,t]),Object(c.useLayoutEffect)((function(){l.updateSlot(t,i)})),Object(c.createElement)(u,Object(n.a)({ref:f},s))}function J(e){var t,r,n=e.name,o=e.children,i=H(n),a=Object(c.useRef)({rerender:(t=Object(c.useState)({}),r=Object(v.a)(t,2)[1],function(){return r({})})});return Object(c.useEffect)((function(){return i.registerFill(a),function(){i.unregisterFill(a)}}),[i.registerFill,i.unregisterFill]),i.ref&&i.ref.current?("function"==typeof o&&(o=o(i.fillProps)),Object(c.createPortal)(o,i.ref.current)):null}function ee(e){var t=e.bubblesVirtually,r=Object(o.a)(e,["bubblesVirtually"]);return t?Object(c.createElement)(Z,r):Object(c.createElement)(z,r)}function te(e){return Object(c.createElement)(c.Fragment,null,Object(c.createElement)(X,e),Object(c.createElement)(J,e))}function re(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function ne(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?re(Object(r),!0).forEach((function(t){Object(E.a)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):re(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function oe(e){var t=e.type,r=e.origin,n=void 0===r?function(e){return"appear"===e?"top":"left"}(t):r;if("appear"===t){var o,c=n.split(" "),i=Object(v.a)(c,2),u=i[0],s=i[1],l=void 0===s?"center":s;return a()("components-animate__appear",(o={},Object(E.a)(o,"is-from-"+l,"center"!==l),Object(E.a)(o,"is-from-"+u,"middle"!==u),o))}return"slide-in"===t?a()("components-animate__slide-in","is-from-"+n):"loading"===t?a()("components-animate__loading"):void 0}function ce(e){var t=e.type,r=e.options,n=void 0===r?{}:r;return(0,e.children)({className:oe(ne({type:t},n))})}var ie=N(T((function(e){return e.children})));function ae(e,t){var r,n=(r=t).ownerDocument.defaultView.getComputedStyle(r),o=n.paddingTop,c=n.paddingBottom,i=n.paddingLeft,a=n.paddingRight,u=o?parseInt(o,10):0,s=c?parseInt(c,10):0,l=i?parseInt(i,10):0,f=a?parseInt(a,10):0;return{x:e.left+l,y:e.top+u,width:e.width-l-f,height:e.height-u-s,left:e.left+l,right:e.right-f,top:e.top+u,bottom:e.bottom-s}}function ue(e,t,r){r?e.getAttribute(t)!==r&&e.setAttribute(t,r):e.hasAttribute(t)&&e.removeAttribute(t)}function se(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";e.style[t]!==r&&(e.style[t]=r)}function le(e,t,r){r?e.classList.contains(t)||e.classList.add(t):e.classList.contains(t)&&e.classList.remove(t)}var fe=function(e){var t=e.headerTitle,r=e.onClose,i=e.onKeyDown,u=e.children,s=e.className,f=e.noArrow,p=void 0===f||f,d=e.isAlternate,m=e.position,b=void 0===m?"bottom right":m,E=(e.range,e.focusOnMount),j=void 0===E?"firstElement":E,R=e.anchorRef,P=e.shouldAnchorIncludePadding,k=e.anchorRect,C=e.getAnchorRect,x=e.expandOnMobile,T=e.animate,N=void 0===T||T,A=e.onClickOutside,I=e.onFocusOutside,M=e.__unstableSticky,L=e.__unstableSlotName,B=void 0===L?"Popover":L,V=e.__unstableObserveElement,q=e.__unstableBoundaryParent,G=Object(o.a)(e,["headerTitle","onClose","onKeyDown","children","className","noArrow","isAlternate","position","range","focusOnMount","anchorRef","shouldAnchorIncludePadding","anchorRect","getAnchorRect","expandOnMobile","animate","onClickOutside","onFocusOutside","__unstableSticky","__unstableSlotName","__unstableObserveElement","__unstableBoundaryParent"]),W=Object(c.useRef)(null),Y=Object(c.useRef)(null),K=Object(c.useRef)(),z=Object(y.useViewportMatch)("medium","<"),$=Object(c.useState)(),Q=Object(v.a)($,2),X=Q[0],Z=Q[1],J=H(B),ee=x&&z,re=Object(y.useResizeObserver)(),ne=Object(v.a)(re,2),oe=ne[0],fe=ne[1];p=ee||p,Object(c.useLayoutEffect)((function(){if(ee)return le(K.current,"is-without-arrow",p),le(K.current,"is-alternate",d),ue(K.current,"data-x-axis"),ue(K.current,"data-y-axis"),se(K.current,"top"),se(K.current,"left"),se(Y.current,"maxHeight"),void se(Y.current,"maxWidth");var e=function(){if(K.current&&Y.current){var e=function(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]&&arguments[3],o=arguments.length>4?arguments[4]:void 0;if(t)return t;if(r){if(!e.current)return;return r(e.current)}if(!1!==n){if(!(n&&window.Range&&window.Element&&window.DOMRect))return;if(n instanceof window.Range)return Object(h.getRectangleFromRange)(n);if(n instanceof window.Element){var c=n.getBoundingClientRect();return o?c:ae(c,n)}var i=n.top,a=n.bottom,u=i.getBoundingClientRect(),s=a.getBoundingClientRect(),l=new window.DOMRect(u.left,u.top,u.width,s.bottom-u.top);return o?l:ae(l,n)}if(e.current){var f=e.current.parentNode,p=f.getBoundingClientRect();return o?p:ae(p,f)}}(W,k,C,R,P);if(e){var t,r,n=K.current,o=n.offsetParent,c=n.ownerDocument,i=0;if(o&&o!==c.body){var a=o.getBoundingClientRect();i=a.top,e=new window.DOMRect(e.left-a.left,e.top-a.top,e.width,e.height)}q&&(t=null===(r=K.current.closest(".popover-slot"))||void 0===r?void 0:r.parentNode);var u=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"top",n=arguments.length>3?arguments[3]:void 0,o=arguments.length>4?arguments[4]:void 0,c=arguments.length>5?arguments[5]:void 0,i=arguments.length>6?arguments[6]:void 0,a=r.split(" "),u=Object(v.a)(a,3),s=u[0],l=u[1],f=void 0===l?"center":l,p=u[2],d=S(e,t,s,p,n,o,c),m=w(e,t,f,p,n,d.yAxis,i);return _(_({},m),d)}(e,fe.height?fe:Y.current.getBoundingClientRect(),b,M,K.current,i,t),s=u.popoverTop,l=u.popoverLeft,f=u.xAxis,m=u.yAxis,g=u.contentHeight,y=u.contentWidth;"number"==typeof s&&"number"==typeof l&&(se(K.current,"top",s+"px"),se(K.current,"left",l+"px")),le(K.current,"is-without-arrow",p||"center"===f&&"middle"===m),le(K.current,"is-alternate",d),ue(K.current,"data-x-axis",f),ue(K.current,"data-y-axis",m),se(Y.current,"maxHeight","number"==typeof g?g+"px":""),se(Y.current,"maxWidth","number"==typeof y?y+"px":""),Z(({left:"right",right:"left"}[f]||"center")+" "+({top:"bottom",bottom:"top"}[m]||"middle"))}}};e();var t,r,n=window.setInterval(e,500),o=function(){window.cancelAnimationFrame(t),t=window.requestAnimationFrame(e)};return window.addEventListener("click",o),window.addEventListener("resize",e),window.addEventListener("scroll",e,!0),V&&(r=new window.MutationObserver(e)).observe(V,{attributes:!0}),function(){window.clearInterval(n),window.removeEventListener("resize",e),window.removeEventListener("scroll",e,!0),window.removeEventListener("click",o),window.cancelAnimationFrame(t),r&&r.disconnect()}}),[ee,k,C,R,P,b,fe,M,V,q]),function(e,t){Object(c.useEffect)((function(){var r=setTimeout((function(){if(e&&t.current)if("firstElement"!==e)"container"===e&&t.current.focus();else{var r=h.focus.tabbable.find(t.current)[0];r?r.focus():t.current.focus()}}),0);return function(){return clearTimeout(r)}}),[])}(j,Y);var pe=function(e){e.keyCode===g.ESCAPE&&r&&(e.stopPropagation(),r()),i&&i(e)},de=Object(c.createElement)(D,{onFocusOutside:function(e){if(I)I(e);else if(A){var t;try{t=new window.MouseEvent("click")}catch(e){(t=document.createEvent("MouseEvent")).initMouseEvent("click",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null)}Object.defineProperty(t,"target",{get:function(){return e.relatedTarget}}),l()("Popover onClickOutside prop",{alternative:"onFocusOutside"}),A(t)}else r&&r()}},Object(c.createElement)(ce,{type:N&&X?"appear":null,options:{origin:X}},(function(e){var o=e.className;return Object(c.createElement)(U,Object(n.a)({className:a()("components-popover",s,o,{"is-expanded":ee,"is-without-arrow":p,"is-alternate":d})},G,{onKeyDown:pe,ref:K}),ee&&Object(c.createElement)(F,null),ee&&Object(c.createElement)("div",{className:"components-popover__header"},Object(c.createElement)("span",{className:"components-popover__header-title"},t),Object(c.createElement)(ge,{className:"components-popover__close",icon:O.a,onClick:r})),Object(c.createElement)("div",{ref:Y,className:"components-popover__content",tabIndex:"-1"},Object(c.createElement)("div",{style:{position:"relative"}},oe,u)))})));return j&&(de=Object(c.createElement)(ie,null,de)),J.ref&&(de=Object(c.createElement)(te,{name:B},de)),R||k?de:Object(c.createElement)("span",{ref:W},de)};fe.Slot=function(e){var t=e.name,r=void 0===t?"Popover":t;return Object(c.createElement)(ee,{bubblesVirtually:!0,name:r,className:"popover-slot"})};var pe=fe,de=function(e){var t,r,n=e.shortcut,o=e.className;return n?(Object(u.isString)(n)&&(t=n),Object(u.isObject)(n)&&(t=n.display,r=n.ariaLabel),Object(c.createElement)("span",{className:o,"aria-label":r},t)):null};var me=function(e){Object(d.a)(o,e);var t,r,n=(t=o,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,n=Object(b.a)(t);if(r){var o=Object(b.a)(this).constructor;e=Reflect.construct(n,arguments,o)}else e=n.apply(this,arguments);return Object(m.a)(this,e)});function o(){var e;return Object(f.a)(this,o),(e=n.apply(this,arguments)).delayedSetIsOver=Object(u.debounce)((function(t){return e.setState({isOver:t})}),700),e.cancelIsMouseDown=e.createSetIsMouseDown(!1),e.isInMouseDown=!1,e.state={isOver:!1},e}return Object(p.a)(o,[{key:"componentWillUnmount",value:function(){this.delayedSetIsOver.cancel(),document.removeEventListener("mouseup",this.cancelIsMouseDown)}},{key:"emitToChild",value:function(e,t){var r=this.props.children;if(1===c.Children.count(r)){var n=c.Children.only(r);"function"==typeof n.props[e]&&n.props[e](t)}}},{key:"createToggleIsOver",value:function(e,t){var r=this;return function(n){if(r.emitToChild(e,n),!(n.currentTarget.disabled||"focus"===n.type&&r.isInMouseDown)){r.delayedSetIsOver.cancel();var o=Object(u.includes)(["focus","mouseenter"],n.type);o!==r.state.isOver&&(t?r.delayedSetIsOver(o):r.setState({isOver:o}))}}}},{key:"createSetIsMouseDown",value:function(e){var t=this;return function(r){t.emitToChild(e?"onMouseDown":"onMouseUp",r),document[e?"addEventListener":"removeEventListener"]("mouseup",t.cancelIsMouseDown),t.isInMouseDown=e}}},{key:"render",value:function(){var e=this.props,t=e.children,r=e.position,n=e.text,o=e.shortcut;if(1!==c.Children.count(t))return t;var i=c.Children.only(t),a=this.state.isOver;return Object(c.cloneElement)(i,{onMouseEnter:this.createToggleIsOver("onMouseEnter",!0),onMouseLeave:this.createToggleIsOver("onMouseLeave"),onClick:this.createToggleIsOver("onClick"),onFocus:this.createToggleIsOver("onFocus"),onBlur:this.createToggleIsOver("onBlur"),onMouseDown:this.createSetIsMouseDown(!0),children:Object(c.concatChildren)(i.props.children,a&&Object(c.createElement)(pe,{focusOnMount:!1,position:r,className:"components-tooltip","aria-hidden":"true",animate:!1,noArrow:!0},n,Object(c.createElement)(de,{className:"components-tooltip__shortcut",shortcut:o})))})}}]),o}(c.Component),be=r(91);function ve(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var he=["onMouseDown","onClick"],ge=t.a=Object(c.forwardRef)((function(e,t){var r=e.href,i=e.target,s=e.isPrimary,f=e.isSmall,p=e.isTertiary,d=e.isPressed,m=e.isBusy,b=e.isDefault,v=e.isSecondary,h=e.isLink,g=e.isDestructive,y=e.className,O=e.disabled,E=e.icon,j=e.iconSize,_=e.showTooltip,w=e.tooltipPosition,S=e.shortcut,R=e.label,P=e.children,k=e.__experimentalIsFocusable,C=Object(o.a)(e,["href","target","isPrimary","isSmall","isTertiary","isPressed","isBusy","isDefault","isSecondary","isLink","isDestructive","className","disabled","icon","iconSize","showTooltip","tooltipPosition","shortcut","label","children","__experimentalIsFocusable"]);b&&l()("Button isDefault prop",{alternative:"isSecondary"});var x=a()("components-button",y,{"is-secondary":b||v,"is-primary":s,"is-small":f,"is-tertiary":p,"is-pressed":d,"is-busy":m,"is-link":h,"is-destructive":g,"has-text":!!E&&!!P,"has-icon":!!E}),T=O&&!k,N=void 0===r||T?"button":"a",A="a"===N?{href:r,target:i}:{type:"button",disabled:T,"aria-pressed":d};if(O&&k){A["aria-disabled"]=!0;var I,D=function(e,t){var r;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return ve(e,void 0);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?ve(e,void 0):void 0}}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var c,i=!0,a=!1;return{s:function(){r=e[Symbol.iterator]()},n:function(){var e=r.next();return i=e.done,e},e:function(e){a=!0,c=e},f:function(){try{i||null==r.return||r.return()}finally{if(a)throw c}}}}(he);try{for(D.s();!(I=D.n()).done;)C[I.value]=function(e){e.stopPropagation(),e.preventDefault()}}catch(e){D.e(e)}finally{D.f()}}var M=!T&&(_&&R||S||!!R&&(!P||Object(u.isArray)(P)&&!P.length)&&!1!==_),F=Object(c.createElement)(N,Object(n.a)({},A,C,{className:x,"aria-label":C["aria-label"]||R,ref:t}),E&&Object(c.createElement)(be.a,{icon:E,size:j}),P);return M?Object(c.createElement)(me,{text:R,shortcut:S,position:w},F):F}))},function(e,t){e.exports=function(e,t){if(null==e)return{};var r,n,o={},c=Object.keys(e);for(n=0;n<c.length;n++)r=c[n],t.indexOf(r)>=0||(o[r]=e[r]);return o},e.exports.default=e.exports,e.exports.__esModule=!0},,function(e,t,r){"use strict";var n=r(80);function o(){}function c(){}c.resetWarningCache=o,e.exports=function(){function e(e,t,r,o,c,i){if(i!==n){var a=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw a.name="Invariant Violation",a}}function t(){return e}e.isRequired=e;var r={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:c,resetWarningCache:o};return r.PropTypes=r,r}},function(e,t,r){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},function(e,t){},function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));var n=r(3);function o(e,t,r){void 0===r&&(r={});var o=r.maxWait,c=Object(n.useRef)(null),i=Object(n.useRef)([]),a=r.leading,u=void 0===r.trailing||r.trailing,s=Object(n.useRef)(!1),l=Object(n.useRef)(null),f=Object(n.useRef)(!1),p=Object(n.useRef)(e);p.current=e;var d=Object(n.useCallback)((function(){clearTimeout(l.current),clearTimeout(c.current),c.current=null,i.current=[],l.current=null,s.current=!1}),[]);Object(n.useEffect)((function(){return f.current=!1,function(){f.current=!0}}),[]);var m=Object(n.useCallback)((function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];i.current=e,clearTimeout(l.current),s.current&&(s.current=!1),l.current||!a||s.current||(p.current.apply(p,e),s.current=!0),l.current=setTimeout((function(){var t=!0;a&&s.current&&(t=!1),d(),!f.current&&u&&t&&p.current.apply(p,e)}),t),o&&!c.current&&u&&(c.current=setTimeout((function(){var e=i.current;d(),f.current||p.current.apply(null,e)}),o))}),[o,t,d,a,u]),b=Object(n.useCallback)((function(){l.current&&(p.current.apply(null,i.current),d())}),[d]);return[m,d,b]}},function(e,t,r){"use strict";r.d(t,"n",(function(){return c})),r.d(t,"l",(function(){return i})),r.d(t,"k",(function(){return a})),r.d(t,"m",(function(){return u})),r.d(t,"i",(function(){return s})),r.d(t,"d",(function(){return l})),r.d(t,"f",(function(){return f})),r.d(t,"j",(function(){return p})),r.d(t,"c",(function(){return d})),r.d(t,"e",(function(){return m})),r.d(t,"g",(function(){return b})),r.d(t,"a",(function(){return v})),r.d(t,"h",(function(){return h})),r.d(t,"b",(function(){return g}));var n,o=r(2),c=Object(o.getSetting)("wcBlocksConfig",{buildPhase:1,pluginUrl:"",productCount:0,defaultAvatar:"",restApiRoutes:{},wordCountType:"words"}),i=c.pluginUrl+"images/",a=c.pluginUrl+"build/",u=c.buildPhase,s=null===(n=o.STORE_PAGES.shop)||void 0===n?void 0:n.permalink,l=(o.STORE_PAGES.checkout.id,o.STORE_PAGES.checkout.permalink),f=o.STORE_PAGES.privacy.permalink,p=(o.STORE_PAGES.privacy.title,o.STORE_PAGES.terms.permalink),d=(o.STORE_PAGES.terms.title,o.STORE_PAGES.cart.id,o.STORE_PAGES.cart.permalink),m=o.STORE_PAGES.myaccount.permalink?o.STORE_PAGES.myaccount.permalink:Object(o.getSetting)("wpLoginUrl","/wp-login.php"),b=Object(o.getSetting)("shippingCountries",{}),v=Object(o.getSetting)("allowedCountries",{}),h=Object(o.getSetting)("shippingStates",{}),g=Object(o.getSetting)("allowedStates",{})},function(e,t){e.exports=function(e){if(Array.isArray(e))return e},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,c=[],_n=!0,i=!1;try{for(r=r.call(e);!(_n=(n=r.next()).done)&&(c.push(n.value),!t||c.length!==t);_n=!0);}catch(e){i=!0,o=e}finally{try{_n||null==r.return||r.return()}finally{if(i)throw o}}return c}},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,r){"use strict";var n=r(4),o=r.n(n),c=r(5),i=r.n(c),a=r(2),u=r(1),s=r(49);function l(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function f(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?l(Object(r),!0).forEach((function(t){o()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):l(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var p=Object(a.getSetting)("countryLocale",{}),d=function(e){var t={};return void 0!==e.label&&(t.label=e.label),void 0!==e.required&&(t.required=e.required),void 0!==e.hidden&&(t.hidden=e.hidden),void 0===e.label||e.optionalLabel||(t.optionalLabel=Object(u.sprintf)(
/* translators: %s Field label. */
Object(u.__)("%s (optional)",'woocommerce'),e.label)),e.priority&&(Object(s.a)(e.priority)&&(t.index=e.priority),Object(s.c)(e.priority)&&(t.index=parseInt(e.priority,10))),e.hidden&&(t.required=!1),t},m=Object.entries(p).map((function(e){var t=i()(e,2),r=t[0],n=t[1];return[r,Object.entries(n).map((function(e){var t=i()(e,2),r=t[0],n=t[1];return[r,d(n)]})).reduce((function(e,t){var r=i()(t,2),n=r[0],o=r[1];return e[n]=o,e}),{})]})).reduce((function(e,t){var r=i()(t,2),n=r[0],o=r[1];return e[n]=o,e}),{});t.a=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",n=r&&void 0!==m[r]?m[r]:{};return e.map((function(e){var r=a.defaultAddressFields[e]||{},o=n[e]||{},c=t[e]||{};return f(f(f({key:e},r),o),c)})).sort((function(e,t){return e.index-t.index}))}},function(e,t,r){"use strict";function n(e,t){return(n=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}r.d(t,"a",(function(){return n}))},function(e,t,r){"use strict";var n=r(12),o=r(15),c=r(16),i=r(13),a=r(17),u=r(18),s=r(9),l=r(0),f=r(7),p=r(24);var d=["button","submit"];t.a=Object(p.createHigherOrderComponent)((function(e){return function(t){Object(a.a)(b,t);var r,p,m=(r=b,p=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=Object(s.a)(r);if(p){var n=Object(s.a)(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return Object(u.a)(this,e)});function b(){var e;return Object(o.a)(this,b),(e=m.apply(this,arguments)).bindNode=e.bindNode.bind(Object(i.a)(e)),e.cancelBlurCheck=e.cancelBlurCheck.bind(Object(i.a)(e)),e.queueBlurCheck=e.queueBlurCheck.bind(Object(i.a)(e)),e.normalizeButtonFocus=e.normalizeButtonFocus.bind(Object(i.a)(e)),e}return Object(c.a)(b,[{key:"componentWillUnmount",value:function(){this.cancelBlurCheck()}},{key:"bindNode",value:function(e){e?this.node=e:(delete this.node,this.cancelBlurCheck())}},{key:"queueBlurCheck",value:function(e){var t=this;e.persist(),this.preventBlurCheck||(this.blurCheckTimeout=setTimeout((function(){document.hasFocus()?"function"==typeof t.node.handleFocusOutside&&t.node.handleFocusOutside(e):e.preventDefault()}),0))}},{key:"cancelBlurCheck",value:function(){clearTimeout(this.blurCheckTimeout)}},{key:"normalizeButtonFocus",value:function(e){var t=e.type,r=e.target;Object(f.includes)(["mouseup","touchend"],t)?this.preventBlurCheck=!1:function(e){switch(e.nodeName){case"A":case"BUTTON":return!0;case"INPUT":return Object(f.includes)(d,e.type)}return!1}(r)&&(this.preventBlurCheck=!0)}},{key:"render",value:function(){return Object(l.createElement)("div",{onFocus:this.cancelBlurCheck,onMouseDown:this.normalizeButtonFocus,onMouseUp:this.normalizeButtonFocus,onTouchStart:this.normalizeButtonFocus,onTouchEnd:this.normalizeButtonFocus,onBlur:this.queueBlurCheck},Object(l.createElement)(e,Object(n.a)({ref:this.bindNode},this.props)))}}]),b}(l.Component)}),"withFocusOutside")},,function(e,t,r){"use strict";var n=r(20),o=r(12),c=r(19),i=r(0),a=r(34),u=function(e){var t=e.icon,r=e.className,n=Object(c.a)(e,["icon","className"]),a=["dashicon","dashicons","dashicons-"+t,r].filter(Boolean).join(" ");return Object(i.createElement)("span",Object(o.a)({className:a},n))};function s(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function l(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?s(Object(r),!0).forEach((function(t){Object(n.a)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):s(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}t.a=function(e){var t=e.icon,r=void 0===t?null:t,n=e.size,s=Object(c.a)(e,["icon","size"]);if("string"==typeof r)return Object(i.createElement)(u,Object(o.a)({icon:r},s));if(r&&u===r.type)return Object(i.cloneElement)(r,l({},s));var f=n||24;if("function"==typeof r)return r.prototype instanceof i.Component?Object(i.createElement)(r,l({size:f},s)):r(l({size:f},s));if(r&&("svg"===r.type||r.type===a.SVG)){var p=l(l({width:f,height:f},r.props),s);return Object(i.createElement)(a.SVG,p)}return Object(i.isValidElement)(r)?Object(i.cloneElement)(r,l({size:f},s)):r}},function(e,t,r){"use strict";r.d(t,"a",(function(){return c}));var n=r(5),o=r.n(n),c=function(e){return e.reduce((function(e,t){var r=o()(t,2),n=r[0],c=r[1];return e[n]=c,e}),{})}},function(e,t,r){"use strict";r.d(t,"b",(function(){return i})),r.d(t,"c",(function(){return a})),r.d(t,"a",(function(){return u}));var n=r(2),o=r(87),c=r(72),i=function(e){var t=e.country,r=void 0===t?"":t,n=e.state,o=void 0===n?"":n,c=e.city,i=void 0===c?"":c,a=e.postcode,u=void 0===a?"":a;return{country:r.trim(),state:o.trim(),city:i.trim(),postcode:u?u.replace(" ","").toUpperCase():""}},a=function(e){var t=e.email,r=void 0===t?"":t;return Object(c.isEmail)(r)?r.trim():""},u=function(e){var t=Object.keys(n.defaultAddressFields),r=Object(o.a)(t,{},e.country),c=Object.assign({},e);return r.forEach((function(t){var r=t.key,n=void 0===r?"":r,o=t.hidden;void 0!==o&&o&&function(e,t){return e in t}(n,e)&&(c[n]="")})),c}},function(e,t,r){var n=r(68);e.exports=function(e){if(Array.isArray(e))return n(e)},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=window.wp.autop},function(e,t,r){"use strict";r.d(t,"a",(function(){return s})),r.d(t,"b",(function(){return f}));var n,o=r(4),c=r.n(o),i=r(7);function a(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function u(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?a(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):a(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}!function(e){e.ADD_EVENT_CALLBACK="add_event_callback",e.REMOVE_EVENT_CALLBACK="remove_event_callback"}(n||(n={}));var s={addEventCallback:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:10;return{id:Object(i.uniqueId)(),type:n.ADD_EVENT_CALLBACK,eventType:e,callback:t,priority:r}},removeEventCallback:function(e,t){return{id:t,type:n.REMOVE_EVENT_CALLBACK,eventType:e}}},l={},f=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:l,t=arguments.length>1?arguments[1]:void 0,r=t.type,o=t.eventType,i=t.id,a=t.callback,s=t.priority,f=e.hasOwnProperty(o)?new Map(e[o]):new Map;switch(r){case n.ADD_EVENT_CALLBACK:return f.set(i,{priority:s,callback:a}),u(u({},e),{},c()({},o,f));case n.REMOVE_EVENT_CALLBACK:return f.delete(i),u(u({},e),{},c()({},o,f))}}},function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));var n=r(3);function o(e,t){var r=Object(n.useRef)();return Object(n.useEffect)((function(){r.current===e||t&&!t(e,r.current)||(r.current=e)}),[e,t]),r.current}},,,function(e,t){var r,n,o=e.exports={};function c(){throw new Error("setTimeout has not been defined")}function i(){throw new Error("clearTimeout has not been defined")}function a(e){if(r===setTimeout)return setTimeout(e,0);if((r===c||!r)&&setTimeout)return r=setTimeout,setTimeout(e,0);try{return r(e,0)}catch(t){try{return r.call(null,e,0)}catch(t){return r.call(this,e,0)}}}!function(){try{r="function"==typeof setTimeout?setTimeout:c}catch(e){r=c}try{n="function"==typeof clearTimeout?clearTimeout:i}catch(e){n=i}}();var u,s=[],l=!1,f=-1;function p(){l&&u&&(l=!1,u.length?s=u.concat(s):f=-1,s.length&&d())}function d(){if(!l){var e=a(p);l=!0;for(var t=s.length;t;){for(u=s,s=[];++f<t;)u&&u[f].run();f=-1,t=s.length}u=null,l=!1,function(e){if(n===clearTimeout)return clearTimeout(e);if((n===i||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(e);try{n(e)}catch(t){try{return n.call(null,e)}catch(t){return n.call(this,e)}}}(e)}}function m(e,t){this.fun=e,this.array=t}function b(){}o.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];s.push(new m(e,t)),1!==s.length||l||a(d)},m.prototype.run=function(){this.fun.apply(null,this.array)},o.title="browser",o.browser=!0,o.env={},o.argv=[],o.version="",o.versions={},o.on=b,o.addListener=b,o.once=b,o.off=b,o.removeListener=b,o.removeAllListeners=b,o.emit=b,o.prependListener=b,o.prependOnceListener=b,o.listeners=function(e){return[]},o.binding=function(e){throw new Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(e){throw new Error("process.chdir is not supported")},o.umask=function(){return 0}},function(e,t,r){"use strict";r.d(t,"b",(function(){return E})),r.d(t,"a",(function(){return j}));var n=r(4),o=r.n(n),c=r(5),i=r.n(c),a=(r(10),r(0)),u=r(11),s=r(52),l=r(36),f=r(14),p=r.n(f),d=r(6),m=r.n(d),b=r(153),v=(r(112),function(e){var t=e.status;switch(void 0===t?"default":t){case"error":return"woocommerce-error";case"success":return"woocommerce-message";case"info":case"warning":return"woocommerce-info"}return""}),h=function(e){var t=e.className,r=e.notices,n=e.removeNotice,o=r.filter((function(e){return"snackbar"!==e.type}));if(!o.length)return null;var c=m()(t,"wc-block-components-notices");return React.createElement("div",{className:c},o.map((function(e){return React.createElement(b.a,p()({key:"store-notice-"+e.id},e,{className:m()("wc-block-components-notices__notice",v(e)),onRemove:function(){e.isDismissible&&n(e.id)}}),e.content)})))};function g(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function y(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?g(Object(r),!0).forEach((function(t){o()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):g(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var O=Object(a.createContext)({notices:[],createNotice:function(e,t,r){},removeNotice:function(e,t){},setIsSuppressed:function(e){},context:"wc/core"}),E=function(){return Object(a.useContext)(O)},j=function(e){var t=e.children,r=e.className,n=void 0===r?"":r,o=e.createNoticeContainer,c=void 0===o||o,f=e.context,p=void 0===f?"wc/core":f,d=Object(u.useDispatch)("core/notices"),m=d.createNotice,b=d.removeNotice,v=Object(a.useState)(!1),g=i()(v,2),E=g[0],j=g[1],_=Object(s.a)().dispatchStoreEvent,w=Object(l.a)().isEditor,S=Object(a.useCallback)((function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};m(e,t,y(y({},r),{},{context:r.context||p})),_("store-notice-create",{status:e,content:t,options:r})}),[m,_,p]),R=Object(a.useCallback)((function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:p;b(e,t)}),[b,p]),P={notices:Object(u.useSelect)((function(e){return{notices:e("core/notices").getNotices(p)}}),[p]).notices,createNotice:S,removeNotice:R,context:p,setIsSuppressed:j},k=E?null:React.createElement(h,{className:n,notices:P.notices,removeNotice:P.removeNotice,isEditor:w});return React.createElement(O.Provider,{value:P},c&&k,t)}},,,function(e,t,r){"use strict";var n=r(6),o=r.n(n);r(184),t.a=function(e){var t=e.children,r=e.className;return React.createElement("div",{className:o()("wc-block-components-product-badge",r)},t)}},function(e,t,r){"use strict";r.d(t,"a",(function(){return d}));var n=r(14),o=r.n(n),c=r(4),i=r.n(c),a=r(0),u=r(44);function s(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function l(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?s(Object(r),!0).forEach((function(t){i()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):s(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var f=[".wp-block-woocommerce-cart"],p=function(e){var t=e.Block,r=e.containers,n=e.getProps,c=void 0===n?function(){return{}}:n,i=e.getErrorBoundaryProps,s=void 0===i?function(){return{}}:i;0!==r.length&&Array.prototype.forEach.call(r,(function(e,r){var n=c(e,r),i=s(e,r),f=l(l({},e.dataset),n.attributes||{});e.classList.remove("is-loading"),Object(a.render)(React.createElement(u.a,i,React.createElement(a.Suspense,{fallback:React.createElement("div",{className:"wc-block-placeholder"})},React.createElement(t,o()({},n,{attributes:f})))),e)}))},d=function(e){var t,r,n,o,c,i,a,u=document.body.querySelectorAll(f.join(","));t=l(l({},e),{},{wrappers:u}),r=t.Block,n=t.getProps,o=t.getErrorBoundaryProps,c=t.selector,i=t.wrappers,a=document.body.querySelectorAll(c),i.length>0&&Array.prototype.filter.call(a,(function(e){return!function(e,t){return Array.prototype.some.call(t,(function(t){return t.contains(e)&&!t.isSameNode(e)}))}(e,i)})),p({Block:r,containers:a,getProps:n,getErrorBoundaryProps:o}),Array.prototype.forEach.call(u,(function(t){t.addEventListener("wc-blocks_render_blocks_frontend",(function(){var r,n,o,c,i,a;n=(r=l(l({},e),{},{wrapper:t})).Block,o=r.getProps,c=r.getErrorBoundaryProps,i=r.selector,a=r.wrapper.querySelectorAll(i),p({Block:n,containers:a,getProps:o,getErrorBoundaryProps:c})}))}))}},,,,,function(e,t){},function(e,t){e.exports=window.wp.wordcount},,function(e,t,r){"use strict";r.d(t,"a",(function(){return i}));var n=r(3),o=r(82);function c(e,t){return e===t}function i(e,t,r){var i=r&&r.equalityFn?r.equalityFn:c,a=Object(n.useState)(e),u=a[0],s=a[1],l=Object(o.a)(Object(n.useCallback)((function(e){return s(e)}),[]),t,r),f=l[0],p=l[1],d=l[2],m=Object(n.useRef)(e);return Object(n.useEffect)((function(){i(m.current,e)||(f(e),m.current=e)}),[e,f,i]),[u,p,d]}},function(e,t,r){"use strict";var n=r(0),o=r(34),c=Object(n.createElement)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(n.createElement)(o.Path,{d:"M13 11.8l6.1-6.3-1-1-6.1 6.2-6.1-6.2-1 1 6.1 6.3-6.5 6.7 1 1 6.5-6.6 6.5 6.6 1-1z"}));t.a=c},,,,,,,,,function(e,t,r){"use strict";function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function o(e){return function(e){if(Array.isArray(e))return e}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return c(e,void 0);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?c(e,void 0):void 0}}(e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function c(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var i={normalizePrecision:function(e){var t=e.reduce((function(e,t){return Math.max(e.getPrecision(),t.getPrecision())}));return e.map((function(e){return e.getPrecision()!==t?e.convertPrecision(t):e}))},minimum:function(e){var t=o(e),r=t[0],n=t.slice(1),c=r;return n.forEach((function(e){c=c.lessThan(e)?c:e})),c},maximum:function(e){var t=o(e),r=t[0],n=t.slice(1),c=r;return n.forEach((function(e){c=c.greaterThan(e)?c:e})),c}};function a(e){return!isNaN(parseInt(e))&&isFinite(e)}function u(e){return e%2==0}function s(e){return a(e)&&!Number.isInteger(e)}function l(e){return Math.abs(e)%1==.5}function f(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};for(var r in t)e.setRequestHeader(r,t[r]);return e}function p(e){return void 0===e}function d(){var e={HALF_ODD:function(e){var t=Math.round(e);return l(e)&&u(t)?t-1:t},HALF_EVEN:function(e){var t=Math.round(e);return l(e)?u(t)?t:t-1:t},HALF_UP:function(e){return Math.round(e)},HALF_DOWN:function(e){return l(e)?Math.floor(e):Math.round(e)},HALF_TOWARDS_ZERO:function(e){return l(e)?Math.sign(e)*Math.floor(Math.abs(e)):Math.round(e)},HALF_AWAY_FROM_ZERO:function(e){return l(e)?Math.sign(e)*Math.ceil(Math.abs(e)):Math.round(e)},DOWN:function(e){return Math.floor(e)}};return{add:function(e,t){return e+t},subtract:function(e,t){return e-t},multiply:function(e,t){return s(e)||s(t)?function(e,t){var r=function(e){return Math.pow(10,function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=e.toString();if(t.indexOf("e-")>0)return parseInt(t.split("e-")[1]);var r=t.split(".")[1];return r?r.length:0}(e))},n=Math.max(r(e),r(t));return Math.round(e*n)*Math.round(t*n)/(n*n)}(e,t):e*t},divide:function(e,t){return e/t},modulo:function(e,t){return e%t},round:function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"HALF_EVEN";return e[r](t)}}}var m=d();function b(e){var t=/^(?:(\$|USD)?0(?:(,)0)?(\.)?(0+)?|0(?:(,)0)?(\.)?(0+)?\s?(dollar)?)$/gm.exec(e);return{getMatches:function(){return null!==t?t.slice(1).filter((function(e){return!p(e)})):[]},getMinimumFractionDigits:function(){var e=function(e){return"."===e};return p(this.getMatches().find(e))?0:this.getMatches()[m.add(this.getMatches().findIndex(e),1)].split("").length},getCurrencyDisplay:function(){return{USD:"code",dollar:"name",$:"symbol"}[this.getMatches().find((function(e){return"USD"===e||"dollar"===e||"$"===e}))]},getStyle:function(){return p(this.getCurrencyDisplay(this.getMatches()))?"decimal":"currency"},getUseGrouping:function(){return!p(this.getMatches().find((function(e){return","===e})))}}}function v(e){var t=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1?arguments[1]:void 0;for(var r in t)e=e.replace("{{".concat(r,"}}"),t[r]);return e};return{getExchangeRate:function(r,o){return(c=e.endpoint,!Boolean(c)||"object"!==n(c)&&"function"!=typeof c||"function"!=typeof c.then?function(r,n){return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return new Promise((function(r,n){var o=Object.assign(new XMLHttpRequest,{onreadystatechange:function(){4===o.readyState&&(o.status>=200&&o.status<400?r(JSON.parse(o.responseText)):n(new Error(o.statusText)))},onerror:function(){n(new Error("Network error"))}});o.open("GET",e,!0),f(o,t.headers),o.send()}))}(t(e.endpoint,{from:r,to:n}),{headers:e.headers})}(r,o):e.endpoint).then((function(c){return function e(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:".",o={};return Object.entries(t).forEach((function(t){if("object"===n(t[1])){var c=e(t[1]);Object.entries(c).forEach((function(e){o[t[0]+r+e[0]]=e[1]}))}else o[t[0]]=t[1]})),o}(c)[t(e.propertyPath,{from:r,to:o})]}));var c}}}function h(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Error;if(!e)throw new r(t)}function g(e){h(function(e){return a(e)&&e<=100&&e>=0}(e),"You must provide a numeric value between 0 and 100.",RangeError)}function y(e){h(Number.isInteger(e),"You must provide an integer.",TypeError)}var O=d(),E=Object.assign((function e(t){var r=Object.assign({},{amount:e.defaultAmount,currency:e.defaultCurrency,precision:e.defaultPrecision},t),n=r.amount,o=r.currency,c=r.precision;y(n),y(c);var i=e.globalLocale,a=e.globalFormat,u=e.globalRoundingMode,s=e.globalFormatRoundingMode,l=Object.assign({},e.globalExchangeRatesApi),f=function(t){var r=Object.assign({},Object.assign({},{amount:n,currency:o,precision:c},t),Object.assign({},{locale:this.locale},t));return Object.assign(e({amount:r.amount,currency:r.currency,precision:r.precision}),{locale:r.locale})},d=function(e){h(this.hasSameCurrency(e),"You must provide a Dinero instance with the same currency.",TypeError)};return{getAmount:function(){return n},getCurrency:function(){return o},getLocale:function(){return this.locale||i},setLocale:function(e){return f.call(this,{locale:e})},getPrecision:function(){return c},convertPrecision:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:s;return y(e),f.call(this,{amount:O.round(O.multiply(this.getAmount(),Math.pow(10,O.subtract(e,this.getPrecision()))),t),precision:e})},add:function(t){d.call(this,t);var r=e.normalizePrecision([this,t]);return f.call(this,{amount:O.add(r[0].getAmount(),r[1].getAmount()),precision:r[0].getPrecision()})},subtract:function(t){d.call(this,t);var r=e.normalizePrecision([this,t]);return f.call(this,{amount:O.subtract(r[0].getAmount(),r[1].getAmount()),precision:r[0].getPrecision()})},multiply:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:u;return f.call(this,{amount:O.round(O.multiply(this.getAmount(),e),t)})},divide:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:u;return f.call(this,{amount:O.round(O.divide(this.getAmount(),e),t)})},percentage:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:u;return g(e),this.multiply(O.divide(e,100),t)},allocate:function(e){var t=this;!function(e){h(function(e){return e.length>0&&e.every((function(e){return e>=0}))&&e.some((function(e){return e>0}))}(e),"You must provide a non-empty array of numeric values greater than 0.",TypeError)}(e);for(var r=e.reduce((function(e,t){return O.add(e,t)})),n=this.getAmount(),o=e.map((function(e){var o=Math.floor(O.divide(O.multiply(t.getAmount(),e),r));return n=O.subtract(n,o),f.call(t,{amount:o})})),c=0;n>0;)e[c]>0&&(o[c]=o[c].add(f.call(this,{amount:1})),n=O.subtract(n,1)),c+=1;return o},convert:function(e){var t=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=r.endpoint,o=void 0===n?l.endpoint:n,c=r.propertyPath,i=void 0===c?l.propertyPath||"rates.{{to}}":c,a=r.headers,s=void 0===a?l.headers:a,d=r.roundingMode,m=void 0===d?u:d,b=Object.assign({},{endpoint:o,propertyPath:i,headers:s,roundingMode:m});return v(b).getExchangeRate(this.getCurrency(),e).then((function(r){return h(!p(r),'No rate was found for the destination currency "'.concat(e,'".'),TypeError),f.call(t,{amount:O.round(O.multiply(t.getAmount(),parseFloat(r)),b.roundingMode),currency:e})}))},equalsTo:function(e){return this.hasSameAmount(e)&&this.hasSameCurrency(e)},lessThan:function(t){d.call(this,t);var r=e.normalizePrecision([this,t]);return r[0].getAmount()<r[1].getAmount()},lessThanOrEqual:function(t){d.call(this,t);var r=e.normalizePrecision([this,t]);return r[0].getAmount()<=r[1].getAmount()},greaterThan:function(t){d.call(this,t);var r=e.normalizePrecision([this,t]);return r[0].getAmount()>r[1].getAmount()},greaterThanOrEqual:function(t){d.call(this,t);var r=e.normalizePrecision([this,t]);return r[0].getAmount()>=r[1].getAmount()},isZero:function(){return 0===this.getAmount()},isPositive:function(){return this.getAmount()>=0},isNegative:function(){return this.getAmount()<0},hasSubUnits:function(){return 0!==O.modulo(this.getAmount(),Math.pow(10,c))},hasCents:function(){return 0!==O.modulo(this.getAmount(),Math.pow(10,c))},hasSameCurrency:function(e){return this.getCurrency()===e.getCurrency()},hasSameAmount:function(t){var r=e.normalizePrecision([this,t]);return r[0].getAmount()===r[1].getAmount()},toFormat:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:a,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:s,r=b(e);return this.toRoundedUnit(r.getMinimumFractionDigits(),t).toLocaleString(this.getLocale(),{currencyDisplay:r.getCurrencyDisplay(),useGrouping:r.getUseGrouping(),minimumFractionDigits:r.getMinimumFractionDigits(),style:r.getStyle(),currency:this.getCurrency()})},toUnit:function(){return O.divide(this.getAmount(),Math.pow(10,c))},toRoundedUnit:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:s,r=Math.pow(10,e);return O.divide(O.round(O.multiply(this.toUnit(),r),t),r)},toObject:function(){return{amount:n,currency:o,precision:c}},toJSON:function(){return this.toObject()}}}),{defaultAmount:0,defaultCurrency:"USD",defaultPrecision:2},{globalLocale:"en-US",globalFormat:"$0,0.00",globalRoundingMode:"HALF_EVEN",globalFormatRoundingMode:"HALF_AWAY_FROM_ZERO",globalExchangeRatesApi:{endpoint:void 0,headers:void 0,propertyPath:void 0}},i);t.a=E},function(e,t,r){"use strict";var n=r(3),o=r.n(n);function c(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function i(){return(i=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}function a(e){return(a=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function u(e,t){return(u=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function s(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function l(){}function f(){}f.resetWarningCache=l;var p=function(e,t){return function(e){e.exports=function(){function e(e,t,r,n,o,c){if("SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"!==c){var i=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw i.name="Invariant Violation",i}}function t(){return e}e.isRequired=e;var r={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:f,resetWarningCache:l};return r.PropTypes=r,r}()}(t={exports:{}}),t.exports}();function d(){}function m(e){return!!(e||"").match(/\d/)}function b(e){return null==e}function v(e){return e.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&")}function h(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r="-"===e[0],n=r&&t,o=(e=e.replace("-","")).split("."),c=o[0],i=o[1]||"";return{beforeDecimal:c,afterDecimal:i,hasNagation:r,addNegation:n}}function g(e,t,r){for(var n="",o=r?"0":"",c=0;c<=t-1;c++)n+=e[c]||o;return n}function y(e,t){if(e.value=e.value,null!==e){if(e.createTextRange){var r=e.createTextRange();return r.move("character",t),r.select(),!0}return e.selectionStart||0===e.selectionStart?(e.focus(),e.setSelectionRange(t,t),!0):(e.focus(),!1)}}function O(e,t,r){return Math.min(Math.max(e,t),r)}function E(e){return Math.max(e.selectionStart,e.selectionEnd)}var j={thousandSeparator:p.oneOfType([p.string,p.oneOf([!0])]),decimalSeparator:p.string,allowedDecimalSeparators:p.arrayOf(p.string),thousandsGroupStyle:p.oneOf(["thousand","lakh","wan"]),decimalScale:p.number,fixedDecimalScale:p.bool,displayType:p.oneOf(["input","text"]),prefix:p.string,suffix:p.string,format:p.oneOfType([p.string,p.func]),removeFormatting:p.func,mask:p.oneOfType([p.string,p.arrayOf(p.string)]),value:p.oneOfType([p.number,p.string]),defaultValue:p.oneOfType([p.number,p.string]),isNumericString:p.bool,customInput:p.elementType,allowNegative:p.bool,allowEmptyFormatting:p.bool,allowLeadingZeros:p.bool,onValueChange:p.func,onKeyDown:p.func,onMouseUp:p.func,onChange:p.func,onFocus:p.func,onBlur:p.func,type:p.oneOf(["text","tel","password"]),isAllowed:p.func,renderText:p.func,getInputRef:p.oneOfType([p.func,p.shape({current:p.any})])},_={displayType:"input",decimalSeparator:".",thousandsGroupStyle:"thousand",fixedDecimalScale:!1,prefix:"",suffix:"",allowNegative:!0,allowEmptyFormatting:!1,allowLeadingZeros:!1,isNumericString:!1,type:"text",onValueChange:d,onChange:d,onKeyDown:d,onMouseUp:d,onFocus:d,onBlur:d,isAllowed:function(){return!0}},w=function(e){function t(e){var r,n;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),r=!(n=a(t).call(this,e))||"object"!=typeof n&&"function"!=typeof n?s(this):n;var o=e.defaultValue;r.validateProps();var c=r.formatValueProp(o);return r.state={value:c,numAsString:r.removeFormatting(c)},r.selectionBeforeInput={selectionStart:0,selectionEnd:0},r.onChange=r.onChange.bind(s(r)),r.onKeyDown=r.onKeyDown.bind(s(r)),r.onMouseUp=r.onMouseUp.bind(s(r)),r.onFocus=r.onFocus.bind(s(r)),r.onBlur=r.onBlur.bind(s(r)),r}var r,n;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&u(e,t)}(t,e),r=t,(n=[{key:"componentDidUpdate",value:function(e){this.updateValueIfRequired(e)}},{key:"componentWillUnmount",value:function(){clearTimeout(this.focusTimeout)}},{key:"updateValueIfRequired",value:function(e){var t=this.props,r=this.state,n=this.focusedElm,o=r.value,c=r.numAsString,i=void 0===c?"":c;if(e!==t){this.validateProps();var a=this.formatNumString(i),u=b(t.value)?a:this.formatValueProp(),s=this.removeFormatting(u),l=parseFloat(s),f=parseFloat(i);(isNaN(l)&&isNaN(f)||l===f)&&a===o&&(null!==n||u===o)||this.updateValue({formattedValue:u,numAsString:s,input:n})}}},{key:"getFloatString",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=this.props.decimalScale,r=this.getSeparators(),n=r.decimalSeparator,o=this.getNumberRegex(!0),c="-"===e[0];c&&(e=e.replace("-","")),n&&0===t&&(e=e.split(n)[0]);var i=(e=(e.match(o)||[]).join("").replace(n,".")).indexOf(".");return-1!==i&&(e="".concat(e.substring(0,i),".").concat(e.substring(i+1,e.length).replace(new RegExp(v(n),"g"),""))),c&&(e="-"+e),e}},{key:"getNumberRegex",value:function(e,t){var r=this.props,n=r.format,o=r.decimalScale,c=this.getSeparators().decimalSeparator;return new RegExp("\\d"+(!c||0===o||t||n?"":"|"+v(c)),e?"g":void 0)}},{key:"getSeparators",value:function(){var e=this.props.decimalSeparator,t=this.props,r=t.thousandSeparator,n=t.allowedDecimalSeparators;return!0===r&&(r=","),n||(n=[e,"."]),{decimalSeparator:e,thousandSeparator:r,allowedDecimalSeparators:n}}},{key:"getMaskAtIndex",value:function(e){var t=this.props.mask,r=void 0===t?" ":t;return"string"==typeof r?r:r[e]||" "}},{key:"getValueObject",value:function(e,t){var r=parseFloat(t);return{formattedValue:e,value:t,floatValue:isNaN(r)?void 0:r}}},{key:"validateProps",value:function(){var e=this.props.mask,t=this.getSeparators(),r=t.decimalSeparator,n=t.thousandSeparator;if(r===n)throw new Error("\n          Decimal separator can't be same as thousand separator.\n          thousandSeparator: ".concat(n,' (thousandSeparator = {true} is same as thousandSeparator = ",")\n          decimalSeparator: ').concat(r," (default value for decimalSeparator is .)\n       "));if(e&&("string"===e?e:e.toString()).match(/\d/g))throw new Error("\n          Mask ".concat(e," should not contain numeric character;\n        "))}},{key:"setPatchedCaretPosition",value:function(e,t,r){y(e,t),setTimeout((function(){e.value===r&&y(e,t)}),0)}},{key:"correctCaretPosition",value:function(e,t,r){var n=this.props,o=n.prefix,c=n.suffix,i=n.format;if(""===e)return 0;if(t=O(t,0,e.length),!i){var a="-"===e[0];return O(t,o.length+(a?1:0),e.length-c.length)}if("function"==typeof i)return t;if("#"===i[t]&&m(e[t]))return t;if("#"===i[t-1]&&m(e[t-1]))return t;var u=i.indexOf("#");t=O(t,u,i.lastIndexOf("#")+1);for(var s=i.substring(t,i.length).indexOf("#"),l=t,f=t+(-1===s?0:s);l>u&&("#"!==i[l]||!m(e[l]));)l-=1;return!m(e[f])||"left"===r&&t!==u||t-l<f-t?m(e[l])?l+1:l:f}},{key:"getCaretPosition",value:function(e,t,r){var n,o,c=this.props.format,i=this.state.value,a=this.getNumberRegex(!0),u=(e.match(a)||[]).join(""),s=(t.match(a)||[]).join("");for(n=0,o=0;o<r;o++){var l=e[o]||"",f=t[n]||"";if((l.match(a)||l===f)&&("0"!==l||!f.match(a)||"0"===f||u.length===s.length)){for(;l!==t[n]&&n<t.length;)n++;n++}}return"string"!=typeof c||i||(n=t.length),this.correctCaretPosition(t,n)}},{key:"removePrefixAndSuffix",value:function(e){var t=this.props,r=t.format,n=t.prefix,o=t.suffix;if(!r&&e){var c="-"===e[0];c&&(e=e.substring(1,e.length));var i=(e=n&&0===e.indexOf(n)?e.substring(n.length,e.length):e).lastIndexOf(o);e=o&&-1!==i&&i===e.length-o.length?e.substring(0,i):e,c&&(e="-"+e)}return e}},{key:"removePatternFormatting",value:function(e){for(var t=this.props.format.split("#").filter((function(e){return""!==e})),r=0,n="",o=0,c=t.length;o<=c;o++){var i=t[o]||"",a=o===c?e.length:e.indexOf(i,r);if(-1===a){n=e;break}n+=e.substring(r,a),r=a+i.length}return(n.match(/\d/g)||[]).join("")}},{key:"removeFormatting",value:function(e){var t=this.props,r=t.format,n=t.removeFormatting;return e?(r?e="string"==typeof r?this.removePatternFormatting(e):"function"==typeof n?n(e):(e.match(/\d/g)||[]).join(""):(e=this.removePrefixAndSuffix(e),e=this.getFloatString(e)),e):e}},{key:"formatWithPattern",value:function(e){for(var t=this.props.format,r=0,n=t.split(""),o=0,c=t.length;o<c;o++)"#"===t[o]&&(n[o]=e[r]||this.getMaskAtIndex(r),r+=1);return n.join("")}},{key:"formatAsNumber",value:function(e){var t=this.props,r=t.decimalScale,n=t.fixedDecimalScale,o=t.prefix,c=t.suffix,i=t.allowNegative,a=t.thousandsGroupStyle,u=this.getSeparators(),s=u.thousandSeparator,l=u.decimalSeparator,f=-1!==e.indexOf(".")||r&&n,p=h(e,i),d=p.beforeDecimal,m=p.afterDecimal,b=p.addNegation;return void 0!==r&&(m=g(m,r,n)),s&&(d=function(e,t,r){var n=function(e){switch(e){case"lakh":return/(\d+?)(?=(\d\d)+(\d)(?!\d))(\.\d+)?/g;case"wan":return/(\d)(?=(\d{4})+(?!\d))/g;case"thousand":default:return/(\d)(?=(\d{3})+(?!\d))/g}}(r),o=e.search(/[1-9]/);return o=-1===o?e.length:o,e.substring(0,o)+e.substring(o,e.length).replace(n,"$1"+t)}(d,s,a)),o&&(d=o+d),c&&(m+=c),b&&(d="-"+d),d+(f&&l||"")+m}},{key:"formatNumString",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=this.props,r=t.format,n=t.allowEmptyFormatting,o=e;return""!==e||n?"-"!==e||r?"string"==typeof r?this.formatWithPattern(o):"function"==typeof r?r(o):this.formatAsNumber(o):"-":""}},{key:"formatValueProp",value:function(e){var t=this.props,r=t.format,n=t.decimalScale,o=t.fixedDecimalScale,c=t.allowEmptyFormatting,i=this.props,a=i.value,u=i.isNumericString,s=!(a=b(a)?e:a)&&0!==a;return s&&c&&(a=""),s&&!c?"":("number"==typeof a&&(a=a.toString(),u=!0),"Infinity"===a&&u&&(a=""),u&&!r&&"number"==typeof n&&(a=function(e,t,r){if(-1!==["","-"].indexOf(e))return e;var n=-1!==e.indexOf(".")&&t,o=h(e),c=o.beforeDecimal,i=o.afterDecimal,a=o.hasNagation,u=parseFloat("0.".concat(i||"0")).toFixed(t).split("."),s=c.split("").reverse().reduce((function(e,t,r){return e.length>r?(Number(e[0])+Number(t)).toString()+e.substring(1,e.length):t+e}),u[0]),l=g(u[1]||"",Math.min(t,i.length),r),f=n?".":"";return"".concat(a?"-":"").concat(s).concat(f).concat(l)}(a,n,o)),u?this.formatNumString(a):this.formatInput(a))}},{key:"formatNegation",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=this.props.allowNegative,r=new RegExp("(-)"),n=new RegExp("(-)(.)*(-)"),o=r.test(e),c=n.test(e);return e=e.replace(/-/g,""),o&&!c&&t&&(e="-"+e),e}},{key:"formatInput",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=this.props.format;return t||(e=this.removePrefixAndSuffix(e),e=this.formatNegation(e)),e=this.removeFormatting(e),this.formatNumString(e)}},{key:"isCharacterAFormat",value:function(e,t){var r=this.props,n=r.format,o=r.prefix,c=r.suffix,i=r.decimalScale,a=r.fixedDecimalScale,u=this.getSeparators().decimalSeparator;return"string"==typeof n&&"#"!==n[e]||!(n||!(e<o.length||e>=t.length-c.length||i&&a&&t[e]===u))}},{key:"checkIfFormatGotDeleted",value:function(e,t,r){for(var n=e;n<t;n++)if(this.isCharacterAFormat(n,r))return!0;return!1}},{key:"correctInputValue",value:function(e,t,r){var n=this.props,o=n.format,c=n.allowNegative,i=n.prefix,a=n.suffix,u=n.decimalScale,s=this.getSeparators(),l=s.allowedDecimalSeparators,f=s.decimalSeparator,p=this.state.numAsString||"",d=this.selectionBeforeInput,m=d.selectionStart,b=d.selectionEnd,v=function(e,t){for(var r=0,n=0,o=e.length,c=t.length;e[r]===t[r]&&r<o;)r++;for(;e[o-1-n]===t[c-1-n]&&c-n>r&&o-n>r;)n++;return{start:r,end:o-n}}(t,r),g=v.start,y=v.end;if(!o&&g===y&&-1!==l.indexOf(r[m])){var O=0===u?"":f;return r.substr(0,m)+O+r.substr(m+1,r.length)}var E=o?0:i.length,j=t.length-(o?0:a.length);if(r.length>t.length||!r.length||g===y||0===m&&b===t.length||m===E&&b===j)return r;if(this.checkIfFormatGotDeleted(g,y,t)&&(r=t),!o){var _=this.removeFormatting(r),w=h(_,c),S=w.beforeDecimal,R=w.afterDecimal,P=w.addNegation,k=e<r.indexOf(f)+1;if(_.length<p.length&&k&&""===S&&!parseFloat(R))return P?"-":""}return r}},{key:"updateValue",value:function(e){var t=e.formattedValue,r=e.input,n=e.setCaretPosition,o=void 0===n||n,c=e.numAsString,i=e.caretPos,a=this.props.onValueChange,u=this.state.value;if(r)if(o){if(!i){var s=e.inputValue||r.value,l=E(r);r.value=t,i=this.getCaretPosition(s,t,l)}this.setPatchedCaretPosition(r,i,t)}else r.value=t;void 0===c&&(c=this.removeFormatting(t)),t!==u&&(this.setState({value:t,numAsString:c}),a(this.getValueObject(t,c)))}},{key:"onChange",value:function(e){var t=e.target,r=t.value,n=this.state,o=this.props,c=o.isAllowed,i=n.value||"",a=E(t);r=this.correctInputValue(a,i,r);var u=this.formatInput(r)||"",s=this.removeFormatting(u);c(this.getValueObject(u,s))||(u=i),this.updateValue({formattedValue:u,numAsString:s,inputValue:r,input:t}),o.onChange(e)}},{key:"onBlur",value:function(e){var t=this.props,r=this.state,n=t.format,o=t.onBlur,c=t.allowLeadingZeros,i=r.numAsString,a=r.value;if(this.focusedElm=null,clearTimeout(this.focusTimeout),!n){isNaN(parseFloat(i))&&(i=""),c||(i=function(e){if(!e)return e;var t="-"===e[0];t&&(e=e.substring(1,e.length));var r=e.split("."),n=r[0].replace(/^0+/,"")||"0",o=r[1]||"";return"".concat(t?"-":"").concat(n).concat(o?".".concat(o):"")}(i));var u=this.formatNumString(i);if(u!==a)return this.updateValue({formattedValue:u,numAsString:i,input:e.target,setCaretPosition:!1}),void o(e)}o(e)}},{key:"onKeyDown",value:function(e){var t,r=e.target,n=e.key,o=r.selectionStart,c=r.selectionEnd,i=r.value,a=void 0===i?"":i,u=this.props,s=u.decimalScale,l=u.fixedDecimalScale,f=u.prefix,p=u.suffix,d=u.format,m=u.onKeyDown,b=void 0!==s&&l,v=this.getNumberRegex(!1,b),h=new RegExp("-"),g="string"==typeof d;if(this.selectionBeforeInput={selectionStart:o,selectionEnd:c},"ArrowLeft"===n||"Backspace"===n?t=o-1:"ArrowRight"===n?t=o+1:"Delete"===n&&(t=o),void 0!==t&&o===c){var y=t,O=g?d.indexOf("#"):f.length,E=g?d.lastIndexOf("#")+1:a.length-p.length;if("ArrowLeft"===n||"ArrowRight"===n){var j="ArrowLeft"===n?"left":"right";y=this.correctCaretPosition(a,t,j)}else if("Delete"!==n||v.test(a[t])||h.test(a[t])){if("Backspace"===n&&!v.test(a[t]))if(o<=O+1&&"-"===a[0]&&void 0===d){var _=a.substring(1);this.updateValue({formattedValue:_,caretPos:y,input:r})}else if(!h.test(a[t])){for(;!v.test(a[y-1])&&y>O;)y--;y=this.correctCaretPosition(a,y,"left")}}else for(;!v.test(a[y])&&y<E;)y++;(y!==t||t<O||t>E)&&(e.preventDefault(),this.setPatchedCaretPosition(r,y,a)),e.isUnitTestRun&&this.setPatchedCaretPosition(r,y,a),m(e)}else m(e)}},{key:"onMouseUp",value:function(e){var t=e.target,r=t.selectionStart,n=t.selectionEnd,o=t.value,c=void 0===o?"":o;if(r===n){var i=this.correctCaretPosition(c,r);i!==r&&this.setPatchedCaretPosition(t,i,c)}this.props.onMouseUp(e)}},{key:"onFocus",value:function(e){var t=this;e.persist(),this.focusedElm=e.target,this.focusTimeout=setTimeout((function(){var r=e.target,n=r.selectionStart,o=r.selectionEnd,c=r.value,i=void 0===c?"":c,a=t.correctCaretPosition(i,n);a===n||0===n&&o===i.length||t.setPatchedCaretPosition(r,a,i),t.props.onFocus(e)}),0)}},{key:"render",value:function(){var e,t,r,n=this.props,c=n.type,a=n.displayType,u=n.customInput,s=n.renderText,l=n.getInputRef,f=n.format,p=this.state.value,d=(e=this.props,t=j,r={},Object.keys(e).forEach((function(n){t[n]||(r[n]=e[n])})),r),m=i({inputMode:function(e){return e||!(navigator.platform&&/iPhone|iPod/.test(navigator.platform))}(f)?"numeric":void 0},d,{type:c,value:p,onChange:this.onChange,onKeyDown:this.onKeyDown,onMouseUp:this.onMouseUp,onFocus:this.onFocus,onBlur:this.onBlur});if("text"===a)return s?s(p)||null:o.a.createElement("span",i({},d,{ref:l}),p);if(u){var b=u;return o.a.createElement(b,i({},m,{ref:l}))}return o.a.createElement("input",i({},m,{ref:l}))}}])&&c(r.prototype,n),t}(o.a.Component);w.propTypes=j,w.defaultProps=_,t.a=w},function(e,t,r){"use strict";r.d(t,"b",(function(){return y})),r.d(t,"a",(function(){return O}));var n=r(21),o=r.n(n),c=r(4),i=r.n(c),a=r(23),u=r.n(a),s=r(5),l=r.n(s),f=r(0),p=r(7),d=r(25),m=r.n(d);function b(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function v(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?b(Object(r),!0).forEach((function(t){i()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):b(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function h(e){var t=function(e,t){if("object"!==o()(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!==o()(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===o()(t)?t:String(t)}var g=Object(f.createContext)({getValidationError:function(){return""},setValidationErrors:function(e){},clearValidationError:function(e){},clearAllValidationErrors:function(){},hideValidationError:function(){},showValidationError:function(){},showAllValidationErrors:function(){},hasValidationErrors:!1,getValidationErrorId:function(e){return e}}),y=function(){return Object(f.useContext)(g)},O=function(e){var t=e.children,r=Object(f.useState)({}),n=l()(r,2),o=n[0],c=n[1],a=Object(f.useCallback)((function(e){return o[e]}),[o]),s=Object(f.useCallback)((function(e){var t=o[e];return!t||t.hidden?"":"validate-error-".concat(e)}),[o]),d=Object(f.useCallback)((function(e){c((function(t){return t[e]?(t[e],u()(t,[e].map(h))):t}))}),[]),b=Object(f.useCallback)((function(){c({})}),[]),y=Object(f.useCallback)((function(e){e&&c((function(t){return e=Object(p.pickBy)(e,(function(e,r){return!("string"!=typeof e.message||t.hasOwnProperty(r)&&m()(t[r],e))})),0===Object.values(e).length?t:v(v({},t),e)}))}),[]),O=Object(f.useCallback)((function(e,t){c((function(r){if(!r.hasOwnProperty(e))return r;var n=v(v({},r[e]),t);return m()(r[e],n)?r:v(v({},r),{},i()({},e,n))}))}),[]),E={getValidationError:a,setValidationErrors:y,clearValidationError:d,clearAllValidationErrors:b,hideValidationError:Object(f.useCallback)((function(e){O(e,{hidden:!0})}),[O]),showValidationError:Object(f.useCallback)((function(e){O(e,{hidden:!1})}),[O]),showAllValidationErrors:Object(f.useCallback)((function(){c((function(e){var t={};return Object.keys(e).forEach((function(r){e[r].hidden&&(t[r]=v(v({},e[r]),{},{hidden:!1}))})),0===Object.values(t).length?e:v(v({},e),t)}))}),[]),hasValidationErrors:Object.keys(o).length>0,getValidationErrorId:s};return React.createElement(g.Provider,{value:E},t)}},function(e,t,r){"use strict";var n=r(0),o=r(8),c=r(11),i=r(83);t.a=function(e){return function(t){var r;return r=Object(n.useRef)(i.n.restApiRoutes||{}),Object(c.useSelect)((function(e,t){if(r.current){var n=e(o.SCHEMA_STORE_KEY),c=n.isResolving,i=n.hasFinishedResolution,a=t.dispatch(o.SCHEMA_STORE_KEY),u=a.receiveRoutes,s=a.startResolution,l=a.finishResolution;Object.keys(r.current).forEach((function(e){var t=r.current[e];c("getRoutes",[e])||i("getRoutes",[e])||(s("getRoutes",[e]),u(t,[e]),l("getRoutes",[e]))}))}}),[]),React.createElement(e,t)}}},,,,,,,,,function(e,t,r){"use strict";r.d(t,"a",(function(){return c})),r.d(t,"c",(function(){return i})),r.d(t,"b",(function(){return a}));var n,o=window.CustomEvent||null,c=function(e,t){var r=t.bubbles,n=void 0!==r&&r,c=t.cancelable,i=void 0!==c&&c,a=t.element,u=t.detail,s=void 0===u?{}:u;if(o){a||(a=document.body);var l=new o(e,{bubbles:n,cancelable:i,detail:s});a.dispatchEvent(l)}},i=function(){n&&clearTimeout(n),n=setTimeout((function(){c("wc_fragment_refresh",{bubbles:!0,cancelable:!0})}),50)},a=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if("function"!=typeof jQuery)return function(){};var o=function(){c(t,{bubbles:r,cancelable:n})};return jQuery(document).on(e,o),function(){return jQuery(document).off(e,o)}}},,,function(e,t,r){"use strict";var n=r(4),o=r.n(n),c=r(1),i=r(69),a=r(6),u=r.n(a),s=(r(10),r(58)),l=r(0),f=(r(183),function(e){var t=e.currency,r=e.maxPrice,n=e.minPrice,o=e.priceClassName,a=e.priceStyle;return React.createElement(React.Fragment,null,React.createElement("span",{className:"screen-reader-text"},Object(c.sprintf)(
/* translators: %1$s min price, %2$s max price */
Object(c.__)("Price between %1$s and %2$s",'woocommerce'),Object(s.formatPrice)(n),Object(s.formatPrice)(r))),React.createElement("span",{"aria-hidden":!0},React.createElement(i.a,{className:u()("wc-block-components-product-price__value",o),currency:t,value:n,style:a})," — ",React.createElement(i.a,{className:u()("wc-block-components-product-price__value",o),currency:t,value:r,style:a})))}),p=function(e){var t=e.currency,r=e.regularPriceClassName,n=e.regularPriceStyle,o=e.regularPrice,a=e.priceClassName,s=e.priceStyle,l=e.price;return React.createElement(React.Fragment,null,React.createElement("span",{className:"screen-reader-text"},Object(c.__)("Previous price:",'woocommerce')),React.createElement(i.a,{currency:t,renderText:function(e){return React.createElement("del",{className:u()("wc-block-components-product-price__regular",r),style:n},e)},value:o}),React.createElement("span",{className:"screen-reader-text"},Object(c.__)("Discounted price:",'woocommerce')),React.createElement(i.a,{currency:t,renderText:function(e){return React.createElement("ins",{className:u()("wc-block-components-product-price__value","is-discounted",a),style:s},e)},value:l}))};t.a=function(e){var t=e.align,r=e.className,n=e.currency,c=e.format,a=void 0===c?"<price/>":c,s=e.maxPrice,d=void 0===s?null:s,m=e.minPrice,b=void 0===m?null:m,v=e.price,h=void 0===v?null:v,g=e.priceClassName,y=e.priceStyle,O=e.regularPrice,E=e.regularPriceClassName,j=e.regularPriceStyle,_=u()(r,"price","wc-block-components-product-price",o()({},"wc-block-components-product-price--align-".concat(t),t));a.includes("<price/>")||(a="<price/>",console.error("Price formats need to include the `<price/>` tag."));var w=O&&h!==O,S=React.createElement("span",{className:u()("wc-block-components-product-price__value",g)});return w?S=React.createElement(p,{currency:n,price:h,priceClassName:g,priceStyle:y,regularPrice:O,regularPriceClassName:E,regularPriceStyle:j}):null!==b&&null!==d?S=React.createElement(f,{currency:n,maxPrice:d,minPrice:b,priceClassName:g,priceStyle:y}):null!==h&&(S=React.createElement(i.a,{className:u()("wc-block-components-product-price__value",g),currency:n,value:h,style:y})),React.createElement("span",{className:_},Object(l.createInterpolateElement)(a,{price:S}))}},,,,,,,function(e,t){},,,function(e,t,r){"use strict";var n=r(14),o=r.n(n),c=r(23),i=r.n(c),a=r(28),u=r(6),s=r.n(u),l=(r(182),["className","disabled","name","permalink"]);t.a=function(e){var t=e.className,r=void 0===t?"":t,n=e.disabled,c=void 0!==n&&n,u=e.name,f=e.permalink,p=void 0===f?"":f,d=i()(e,l),m=s()("wc-block-components-product-name",r);return c?React.createElement("span",o()({className:m},d,{dangerouslySetInnerHTML:{__html:Object(a.decodeEntities)(u)}})):React.createElement("a",o()({className:m,href:p},d,{dangerouslySetInnerHTML:{__html:Object(a.decodeEntities)(u)}}))}},function(e,t,r){"use strict";var n=r(0),o=r(113),c=r(97),i=function(e){var t=e.indexOf("</p>");return-1===t?e:e.substr(0,t+4)},a=function(e){return e.replace(/<\/?[a-z][^>]*?>/gi,"")},u=function(e,t){return e.replace(/[\s|\.\,]+$/i,"")+t},s=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"&hellip;",n=a(e),o=n.split(" ").splice(0,t).join(" ");return Object(c.autop)(u(o,r))},l=function(e,t){var r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"&hellip;",o=a(e),i=o.slice(0,t);if(r)return Object(c.autop)(u(i,n));var s=i.match(/([\s]+)/g),l=s?s.length:0,f=o.slice(0,t+l);return Object(c.autop)(u(f,n))};t.a=function(e){var t=e.source,r=e.maxLength,a=void 0===r?15:r,u=e.countType,f=void 0===u?"words":u,p=e.className,d=void 0===p?"":p,m=Object(n.useMemo)((function(){return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:15,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"words",n=Object(c.autop)(e),a=Object(o.count)(n,r);if(a<=t)return n;var u=i(n),f=Object(o.count)(u,r);return f<=t?u:"words"===r?s(u,t):l(u,t,"characters_including_spaces"===r)}(t,a,f)}),[t,a,f]);return React.createElement(n.RawHTML,{className:d},m)}},,function(e,t,r){"use strict";var n=r(0),o=r(7),c=r(6),i=r.n(c),a=r(1),u=r(33),s=r(116),l=r(76);t.a=function(e){var t=e.className,r=e.status,c=void 0===r?"info":r,f=e.children,p=e.spokenMessage,d=void 0===p?f:p,m=e.onRemove,b=void 0===m?o.noop:m,v=e.isDismissible,h=void 0===v||v,g=e.actions,y=void 0===g?[]:g,O=e.politeness,E=void 0===O?function(e){switch(e){case"success":case"warning":case"info":return"polite";case"error":default:return"assertive"}}(c):O,j=e.__unstableHTML;!function(e,t){var r="string"==typeof e?e:Object(n.renderToString)(e);Object(n.useEffect)((function(){r&&Object(u.speak)(r,t)}),[r,t])}(d,E);var _=i()(t,"components-notice","is-"+c,{"is-dismissible":h});return j&&(f=Object(n.createElement)(n.RawHTML,null,f)),Object(n.createElement)("div",{className:_},Object(n.createElement)("div",{className:"components-notice__content"},f,y.map((function(e,t){var r=e.className,o=e.label,c=e.isPrimary,a=e.noDefaultClasses,u=void 0!==a&&a,s=e.onClick,f=e.url;return Object(n.createElement)(l.a,{key:t,href:f,isPrimary:c,isSecondary:!u&&!f,isLink:!u&&!!f,onClick:f?void 0:s,className:i()("components-notice__action",r)},o)}))),h&&Object(n.createElement)(l.a,{className:"components-notice__dismiss",icon:s.a,label:Object(a.__)("Dismiss this notice"),onClick:b,showTooltip:!1}))}},,function(e,t,r){"use strict";var n=r(21),o=r.n(n),c=r(1),i=r(33),a=r(6),u=r.n(a),s=r(0),l=r(50),f=r(49);r(190),t.a=function(e){var t=e.className,r=e.quantity,n=void 0===r?1:r,a=e.minimum,p=void 0===a?1:a,d=e.maximum,m=e.onChange,b=void 0===m?function(){}:m,v=e.itemName,h=void 0===v?"":v,g=e.disabled,y=u()("wc-block-components-quantity-selector",t),O=void 0!==d,E=n>p,j=!O||n<d,_=Object(s.useCallback)((function(e){var t=void 0!==o()(e.key)?"ArrowDown"===e.key:e.keyCode===l.DOWN,r=void 0!==o()(e.key)?"ArrowUp"===e.key:e.keyCode===l.UP;t&&E&&(e.preventDefault(),b(n-1)),r&&j&&(e.preventDefault(),b(n+1))}),[n,b,j,E]);return React.createElement("div",{className:y},React.createElement("input",{className:"wc-block-components-quantity-selector__input",disabled:g,type:"number",step:"1",min:"0",value:n,onKeyDown:_,onChange:function(e){var t=Object(f.a)(e.target.value)&&e.target.value?parseInt(e.target.value,10):0;O&&(t=Math.min(t,d)),(t=Math.max(t,p))!==n&&b(t)},"aria-label":Object(c.sprintf)(
/* translators: %s refers to the item name in the cart. */
Object(c.__)("Quantity of %s in your cart.",'woocommerce'),h)}),React.createElement("button",{"aria-label":Object(c.__)("Reduce quantity",'woocommerce'),className:"wc-block-components-quantity-selector__button wc-block-components-quantity-selector__button--minus",disabled:g||!E,onClick:function(){var e=n-1;b(e),Object(i.speak)(Object(c.sprintf)(
/* translators: %s refers to the item name in the cart. */
Object(c.__)("Quantity reduced to %s.",'woocommerce'),e))}},"-"),React.createElement("button",{"aria-label":Object(c.__)("Increase quantity",'woocommerce'),disabled:g||!j,className:"wc-block-components-quantity-selector__button wc-block-components-quantity-selector__button--plus",onClick:function(){var e=n+1;b(e),Object(i.speak)(Object(c.sprintf)(
/* translators: %s refers to the item name in the cart. */
Object(c.__)("Quantity increased to %s.",'woocommerce'),e))}},"+"))}},,,,,,,,,,,,,,,,,function(e,t,r){"use strict";var n=r(46),o=r.n(n),c=r(1),i=r(0),a=r(23),u=r.n(a),s=r(6),l=r.n(s),f=r(33),p=r(155),d=r(140),m=r(150),b=r(278),v=r(52),h=r(32),g=r(266),y=r(267),O=r(268),E=r(279),j=r(269),_=r(58),w=r(26),S=r(125),R=r(49),P=r(2),k=["receiveCart"],C=function(e,t){return e.convertPrecision(t.minorUnit).getAmount()},x=function(e){return Object(w.mustContain)(e,"<price/>")},T=Object(i.forwardRef)((function(e,t){var r=e.lineItem,n=e.onRemove,o=void 0===n?function(){}:n,a=e.tabIndex,s=void 0===a?null:a,T=r.name,N=void 0===T?"":T,A=r.catalog_visibility,I=void 0===A?"visible":A,D=r.short_description,M=void 0===D?"":D,F=r.description,L=void 0===F?"":F,U=r.low_stock_remaining,B=void 0===U?null:U,V=r.show_backorder_badge,q=void 0!==V&&V,H=r.quantity_limit,G=void 0===H?99:H,W=r.permalink,Y=void 0===W?"":W,K=r.images,z=void 0===K?[]:K,$=r.variation,Q=void 0===$?[]:$,X=r.item_data,Z=void 0===X?[]:X,J=r.prices,ee=void 0===J?{currency_code:"USD",currency_minor_unit:2,currency_symbol:"$",currency_prefix:"$",currency_suffix:"",currency_decimal_separator:".",currency_thousand_separator:",",price:"0",regular_price:"0",sale_price:"0",price_range:null,raw_prices:{precision:6,price:"0",regular_price:"0",sale_price:"0"}}:J,te=r.totals,re=void 0===te?{currency_code:"USD",currency_minor_unit:2,currency_symbol:"$",currency_prefix:"$",currency_suffix:"",currency_decimal_separator:".",currency_thousand_separator:",",line_subtotal:"0",line_subtotal_tax:"0"}:te,ne=r.extensions,oe=Object(b.a)(r),ce=oe.quantity,ie=oe.setItemQuantity,ae=oe.removeItem,ue=oe.isPendingDelete,se=Object(v.a)().dispatchStoreEvent,le=Object(h.a)(),fe=(le.receiveCart,u()(le,k)),pe=Object(i.useMemo)((function(){return{context:"cart",cartItem:r,cart:fe}}),[r,fe]),de=Object(_.getCurrencyFromPriceResponse)(ee),me=Object(w.__experimentalApplyCheckoutFilter)({filterName:"itemName",defaultValue:N,extensions:ne,arg:pe}),be=Object(S.a)({amount:parseInt(ee.raw_prices.regular_price,10),precision:ee.raw_prices.precision}),ve=Object(S.a)({amount:parseInt(ee.raw_prices.price,10),precision:ee.raw_prices.precision}),he=be.subtract(ve),ge=he.multiply(ce),ye=Object(_.getCurrencyFromPriceResponse)(re),Oe=parseInt(re.line_subtotal,10);Object(P.getSetting)("displayCartPricesIncludingTax",!1)&&(Oe+=parseInt(re.line_subtotal_tax,10));var Ee=Object(S.a)({amount:Oe,precision:ye.minorUnit}),je=z.length?z[0]:{},_e="hidden"===I||"search"===I,we=Object(w.__experimentalApplyCheckoutFilter)({filterName:"cartItemPrice",defaultValue:"<price/>",extensions:ne,arg:pe,validation:x}),Se=Object(w.__experimentalApplyCheckoutFilter)({filterName:"subtotalPriceFormat",defaultValue:"<price/>",extensions:ne,arg:pe,validation:x}),Re=Object(w.__experimentalApplyCheckoutFilter)({filterName:"saleBadgePriceFormat",defaultValue:"<price/>",extensions:ne,arg:pe,validation:x});return React.createElement("tr",{className:l()("wc-block-cart-items__row",{"is-disabled":ue}),ref:t,tabIndex:s},React.createElement("td",{className:"wc-block-cart-item__image","aria-hidden":!Object(R.d)(je,"alt")||!je.alt},_e?React.createElement(g.a,{image:je}):React.createElement("a",{href:Y,tabIndex:-1},React.createElement(g.a,{image:je}))),React.createElement("td",{className:"wc-block-cart-item__product"},React.createElement(m.a,{disabled:ue||_e,name:me,permalink:Y}),q?React.createElement(y.a,null):!!B&&React.createElement(O.a,{lowStockRemaining:B}),React.createElement("div",{className:"wc-block-cart-item__prices"},React.createElement(d.a,{currency:de,regularPrice:C(be,de),price:C(ve,de),format:Se})),React.createElement(E.a,{currency:de,saleAmount:C(he,de),format:Re}),React.createElement(j.a,{shortDescription:M,fullDescription:L,itemData:Z,variation:Q}),React.createElement("div",{className:"wc-block-cart-item__quantity"},React.createElement(p.a,{disabled:ue,quantity:ce,maximum:G,onChange:function(e){ie(e),se("cart-set-item-quantity",{product:r,quantity:e})},itemName:me}),React.createElement("button",{className:"wc-block-cart-item__remove-link",onClick:function(){o(),ae(),se("cart-remove-item",{product:r,quantity:ce}),Object(f.speak)(Object(c.sprintf)(
/* translators: %s refers to the item name in the cart. */
Object(c.__)("%s has been removed from your cart.",'woocommerce'),me))},disabled:ue},Object(c.__)("Remove item",'woocommerce')))),React.createElement("td",{className:"wc-block-cart-item__total"},React.createElement("div",{className:"wc-block-cart-item__total-price-and-sale-badge-wrapper"},React.createElement(d.a,{currency:ye,format:we,price:Ee.getAmount()}),ce>1&&React.createElement(E.a,{currency:de,saleAmount:C(ge,de),format:Re}))))})),N=o()(Array(3)).map((function(_x,e){return React.createElement(T,{lineItem:{},key:e})})),A=function(e){var t={};return e.forEach((function(e){var r=e.key;t[r]=Object(i.createRef)()})),t};t.a=function(e){var t=e.lineItems,r=void 0===t?[]:t,n=e.isLoading,o=void 0!==n&&n,a=Object(i.useRef)(null),u=Object(i.useRef)(A(r));Object(i.useEffect)((function(){u.current=A(r)}),[r]);var s=function(e){return function(){null!=u&&u.current&&e&&u.current[e].current instanceof HTMLElement?u.current[e].current.focus():a.current instanceof HTMLElement&&a.current.focus()}},l=o?N:r.map((function(e,t){var n=r.length>t+1?r[t+1].key:null;return React.createElement(T,{key:e.key,lineItem:e,onRemove:s(n),ref:u.current[e.key],tabIndex:-1})}));return React.createElement("table",{className:"wc-block-cart-items",ref:a,tabIndex:-1},React.createElement("thead",null,React.createElement("tr",{className:"wc-block-cart-items__header"},React.createElement("th",{className:"wc-block-cart-items__header-image"},React.createElement("span",null,Object(c.__)("Product",'woocommerce'))),React.createElement("th",{className:"wc-block-cart-items__header-product"},React.createElement("span",null,Object(c.__)("Details",'woocommerce'))),React.createElement("th",{className:"wc-block-cart-items__header-total"},React.createElement("span",null,Object(c.__)("Total",'woocommerce'))))),React.createElement("tbody",null,l))}},,,,,,,,,,function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t){},,,,function(e,t){},function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));var n=r(98),o=function(e,t){return function(r){var o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10,c=n.a.addEventCallback(e,r,o);return t(c),function(){t(n.a.removeEventCallback(e,c.id))}}}},,function(e,t,r){"use strict";r.d(t,"a",(function(){return d})),r.d(t,"b",(function(){return m}));var n=r(21),o=r.n(n),c=r(39),i=r.n(c),a=r(27),u=r.n(a),s=function(e,t){return e[t]?Array.from(e[t].values()).sort((function(e,t){return e.priority-t.priority})):[]},l=r(35);function f(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return p(e,void 0);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?p(e,void 0):void 0}}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var c,i=!0,a=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return i=e.done,e},e:function(e){a=!0,c=e},f:function(){try{i||null==r.return||r.return()}finally{if(a)throw c}}}}function p(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var d=function(){var e=i()(u.a.mark((function e(t,r,n){var c,i,a,l,p,d;return u.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:c=s(t,r),i=[],a=f(c),e.prev=3,a.s();case 5:if((l=a.n()).done){e.next=19;break}return p=l.value,e.prev=7,e.next=10,Promise.resolve(p.callback(n));case 10:d=e.sent,"object"===o()(d)&&i.push(d),e.next=17;break;case 14:e.prev=14,e.t0=e.catch(7),console.error(e.t0);case 17:e.next=5;break;case 19:e.next=24;break;case 21:e.prev=21,e.t1=e.catch(3),a.e(e.t1);case 24:return e.prev=24,a.f(),e.finish(24);case 27:return e.abrupt("return",!i.length||i);case 28:case"end":return e.stop()}}),e,null,[[3,21,24,27],[7,14]])})));return function(_x,t,r){return e.apply(this,arguments)}}(),m=function(){var e=i()(u.a.mark((function e(t,r,n){var c,i,a,p,d,m;return u.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:c=[],i=s(t,r),a=f(i),e.prev=3,a.s();case 5:if((p=a.n()).done){e.next=28;break}return d=p.value,e.prev=7,e.next=10,Promise.resolve(d.callback(n));case 10:if(m=e.sent,"object"===o()(m)&&null!==m){e.next=13;break}return e.abrupt("continue",26);case 13:if(m.hasOwnProperty("type")){e.next=15;break}throw new Error("Returned objects from event emitter observers must return an object with a type property");case 15:if(!Object(l.a)(m)&&!Object(l.b)(m)){e.next=18;break}return c.push(m),e.abrupt("return",c);case 18:c.push(m),e.next=26;break;case 21:return e.prev=21,e.t0=e.catch(7),console.error(e.t0),c.push({type:"error"}),e.abrupt("return",c);case 26:e.next=5;break;case 28:e.next=33;break;case 30:e.prev=30,e.t1=e.catch(3),a.e(e.t1);case 33:return e.prev=33,a.f(),e.finish(33);case 36:return e.abrupt("return",c);case 37:case"end":return e.stop()}}),e,null,[[3,30,33,36],[7,21]])})));return function(t,r,n){return e.apply(this,arguments)}}()},,,,,,function(e,t,r){"use strict";var n=r(0),o=r(2),c=r(8),i=r(11),a=r(1);Object(a.__)("Unable to get cart data from the API.",'woocommerce'),t.a=function(e){return function(t){var r,a;return r=Object(n.useRef)(Object(o.getSetting)("preloadedApiRequests",{})),a=Object(i.useDispatch)(c.CART_STORE_KEY).setIsCartDataStale,Object(i.useSelect)((function(e,t){var n,o=null===(n=r.current["/wc/store/cart"])||void 0===n?void 0:n.body;if(o){var i=e(c.CART_STORE_KEY),u=i.isResolving,s=i.hasFinishedResolution,l=i.isCartDataStale;if(!l()&&!u("getCartData")&&!s("getCartData",[])){var f=window.localStorage.getItem("wc-blocks_cart_update_timestamp");if(f){var p=parseFloat(f),d=parseFloat(o.generated_timestamp);!isNaN(d)&&!isNaN(p)&&p>d&&a()}}var m,b=t.dispatch(c.CART_STORE_KEY),v=b.receiveCart,h=b.receiveError,g=b.startResolution,y=b.finishResolution;l()||u("getCartData",[])||s("getCartData",[])||(g("getCartData",[]),null!=o&&null!==(m=o.code)&&void 0!==m&&m.includes("error")?h(o):v(o),y("getCartData",[]))}}),[]),React.createElement(e,t)}}},,,,,,,,,,,,,,,,,,,,,,,,,,function(e,t){},,,,,,,,,,,,,,,,,,,,,,function(e,t){e.exports=window.wp.components},,,,,,,,,,,,,,,,,,,function(e,t,r){"use strict";var n=r(14),o=r.n(n),c=r(28),i=r(2);t.a=function(e){var t=e.image,r=void 0===t?{}:t,n={src:r.thumbnail||i.PLACEHOLDER_IMG_SRC,alt:Object(c.decodeEntities)(r.alt)||""};return React.createElement("img",o()({},n,{alt:n.alt}))}},function(e,t,r){"use strict";var n=r(1),o=r(106);t.a=function(){return React.createElement(o.a,{className:"wc-block-components-product-backorder-badge"},Object(n.__)("Available on backorder",'woocommerce'))}},function(e,t,r){"use strict";var n=r(1),o=r(106);t.a=function(e){var t=e.lowStockRemaining;return t?React.createElement(o.a,{className:"wc-block-components-product-low-stock-badge"},Object(n.sprintf)(
/* translators: %d stock amount (number of items in stock for product) */
Object(n.__)("%d left in stock",'woocommerce'),t)):null}},function(e,t,r){"use strict";var n=r(7),o=r(28),c=(r(186),function(e){var t=e.details,r=void 0===t?[]:t;return Array.isArray(r)?0===(r=r.filter((function(e){return!e.hidden}))).length?null:React.createElement("ul",{className:"wc-block-components-product-details"},r.map((function(e){var t=e.name?"wc-block-components-product-details__".concat(Object(n.kebabCase)(e.name)):"";return React.createElement("li",{key:e.name+(e.display||e.value),className:t},e.name&&React.createElement(React.Fragment,null,React.createElement("span",{className:"wc-block-components-product-details__name"},Object(o.decodeEntities)(e.name),":")," "),React.createElement("span",{className:"wc-block-components-product-details__value"},Object(o.decodeEntities)(e.display||e.value)))}))):null}),i=r(151),a=r(83),u=function(e){var t=e.className,r=e.shortDescription,n=void 0===r?"":r,o=e.fullDescription,c=n||(void 0===o?"":o);return c?React.createElement(i.a,{className:t,source:c,maxLength:15,countType:a.n.wordCountType||"words"}):null};r(185),t.a=function(e){var t=e.shortDescription,r=void 0===t?"":t,n=e.fullDescription,o=void 0===n?"":n,i=e.itemData,a=void 0===i?[]:i,s=e.variation,l=void 0===s?[]:s;return React.createElement("div",{className:"wc-block-components-product-metadata"},React.createElement(u,{className:"wc-block-components-product-metadata__description",shortDescription:r,fullDescription:o}),React.createElement(c,{details:a}),React.createElement(c,{details:l.map((function(e){var t=e.attribute;return{name:void 0===t?"":t,value:e.value}}))}))}},,,,,,,,,function(e,t,r){"use strict";r.d(t,"a",(function(){return m}));var n=r(5),o=r.n(n),c=r(11),i=r(0),a=r(8),u=r(115),s=r(99),l=r(137),f=r(49),p=r(32),d=r(48),m=function(e){var t={key:"",quantity:1};(function(e){return Object(f.b)(e)&&Object(f.d)(e,"key")&&Object(f.d)(e,"quantity")&&Object(f.c)(e.key)&&Object(f.a)(e.quantity)})(e)&&(t.key=e.key,t.quantity=e.quantity);var r=t.key,n=void 0===r?"":r,m=t.quantity,b=void 0===m?1:m,v=Object(p.a)().cartErrors,h=Object(d.b)().dispatchActions,g=Object(i.useState)(b),y=o()(g,2),O=y[0],E=y[1],j=Object(u.a)(O,400),_=o()(j,1)[0],w=Object(s.a)(_),S=Object(c.useDispatch)(a.CART_STORE_KEY),R=S.removeItemFromCart,P=S.changeCartItemQuantity,k=Object(c.useSelect)((function(e){if(!n)return{quantity:!1,delete:!1};var t=e(a.CART_STORE_KEY);return{quantity:t.isItemPendingQuantity(n),delete:t.isItemPendingDelete(n)}}),[n]),C=Object(i.useCallback)((function(){return n?R(n).then((function(){return Object(l.c)(),!0})):Promise.resolve(!1)}),[n,R]);return Object(i.useEffect)((function(){n&&Object(f.a)(w)&&Number.isFinite(w)&&w!==_&&P(n,_)}),[n,P,_,w]),Object(i.useEffect)((function(){return k.delete?h.incrementCalculating():h.decrementCalculating(),function(){k.delete&&h.decrementCalculating()}}),[h,k.delete]),Object(i.useEffect)((function(){return k.quantity||_!==O?h.incrementCalculating():h.decrementCalculating(),function(){(k.quantity||_!==O)&&h.decrementCalculating()}}),[h,k.quantity,_,O]),{isPendingDelete:k.delete,quantity:O,setItemQuantity:E,removeItem:C,cartItemQuantityErrors:v}}},function(e,t,r){"use strict";var n=r(0),o=r(1),c=r(69),i=r(106);t.a=function(e){var t=e.currency,r=e.saleAmount,a=e.format,u=void 0===a?"<price/>":a;if(!r||r<=0)return null;u.includes("<price/>")||(u="<price/>",console.error("Price formats need to include the `<price/>` tag."));var s=Object(o.sprintf)(
/* translators: %s will be replaced by the discount amount */
Object(o.__)("Save %s",'woocommerce'),u);return React.createElement(i.a,{className:"wc-block-components-sale-badge"},Object(n.createInterpolateElement)(s,{price:React.createElement(c.a,{currency:t,value:r})}))}},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(e,t){},,,,,,,,,function(e,t,r){"use strict";r.r(t);var n=r(107),o=r(23),c=r.n(o),i=r(199),a=r(128),u=["isDataOutdated"],s=r(5),l=r.n(s),f=r(6),p=r.n(f),d=r(1),m=r(0),b=r(11),v=r(137),h=r(32),g=r(247),y=r(115),O=(r(311),function(e){var t=e.children,r=e.className,n=e.isOpen,o=e.onClose,c=e.slideIn,i=void 0===c||c,a=e.slideOut,u=void 0===a||a,s=e.title,f=Object(y.a)(n,300),m=l()(f,1)[0];return n||!n&&m?React.createElement(g.Modal,{title:s,focusOnMount:!0,onRequestClose:o,className:p()(r,"wc-block-components-drawer"),overlayClassName:p()("wc-block-components-drawer__screen-overlay",{"wc-block-components-drawer__screen-overlay--is-hidden":!n,"wc-block-components-drawer__screen-overlay--with-slide-in":i,"wc-block-components-drawer__screen-overlay--with-slide-out":u}),closeButtonLabel:Object(d.__)("Close mini cart",'woocommerce')},t):null}),E=r(8),j=r(58),_=r(2),w=r(172),S=(r(225),function(e){var t=e.isPlaceholderOpen,r=void 0!==t&&t,n=Object(h.a)(),o=n.cartItems,c=n.cartItemsCount,i=n.cartIsLoading,a=n.cartTotals,u=Object(m.useState)(r),s=l()(u,2),f=s[0],g=s[1],y=Object(m.useRef)(null),S=Object(m.useState)(r),R=l()(S,2),P=R[0],k=R[1];Object(m.useEffect)((function(){var e=function(e){var t=e.detail;t&&t.preserveCartData||Object(b.dispatch)(E.CART_STORE_KEY).invalidateResolutionForStore(),k(!1),g(!0)},t=Object(v.b)("added_to_cart","wc-blocks_added_to_cart");return document.body.addEventListener("wc-blocks_added_to_cart",e),function(){t(),document.body.removeEventListener("wc-blocks_added_to_cart",e)}}),[]),Object(m.useEffect)((function(){f&&!i&&0===o.length&&y.current instanceof HTMLElement&&y.current.focus()}),[f,i,o.length,y]);var C=Object(_.getSetting)("displayCartPricesIncludingTax",!1)?parseInt(a.total_items,10)+parseInt(a.total_items_tax,10):a.total_items,x=Object(d.sprintf)(
/* translators: %1$d is the number of products in the cart. %2$s is the cart total */
Object(d._n)("%1$d item in cart, total price of %2$s","%1$d items in cart, total price of %2$s",c,'woocommerce'),c,Object(j.formatPrice)(C,Object(j.getCurrencyFromPriceResponse)(a))),T=i||0!==o.length?React.createElement(w.a,{lineItems:o,isLoading:i}):React.createElement("div",{className:"wc-block-mini-cart__empty-cart",tabIndex:-1,ref:y},Object(d.__)("Cart is empty",'woocommerce'));return React.createElement(React.Fragment,null,React.createElement("button",{className:"wc-block-mini-cart__button",onClick:function(){f||(g(!0),k(!1))},"aria-label":x},Object(d.sprintf)(
/* translators: %d is the count of items in the cart. */
Object(d._n)("%d item","%d items",c,'woocommerce'),c)),React.createElement(O,{className:p()("wc-block-mini-cart__drawer","is-mobile",{"is-loading":i}),title:i?Object(d.__)("Your cart",'woocommerce'):Object(d.sprintf)(
/* translators: %d is the count of items in the cart. */
Object(d._n)("Your cart (%d item)","Your cart (%d items)",c,'woocommerce'),c),isOpen:f,onClose:function(){g(!1)},slideIn:!P},T))});!function(){var e,t=null;if(document.activeElement&&document.activeElement.classList.contains("wc-block-mini-cart__button")&&document.activeElement.parentNode instanceof HTMLElement&&(t=document.activeElement.parentNode),Object(n.a)({selector:".wc-block-mini-cart",Block:(e=S,function(t){var r=t.isDataOutdated,n=c()(t,u),o=r?e:Object(i.a)(Object(a.a)(e));return React.createElement(o,n)}),getProps:function(e){return{isDataOutdated:e.dataset.isDataOutdated,isPlaceholderOpen:"true"===e.dataset.isPlaceholderOpen}}}),t instanceof HTMLElement&&!t.dataset.isPlaceholderOpen){var r=t.querySelector(".wc-block-mini-cart__button");r instanceof HTMLElement&&r.focus()}}()}]);woocommerce-blocks/build/all-reviews.js000064400000105131151335517640014240 0ustar00this.wc=this.wc||{},this.wc.blocks=this.wc.blocks||{},this.wc.blocks["all-reviews"]=function(e){function t(t){for(var n,a,i=t[0],s=t[1],l=t[2],b=0,d=[];b<i.length;b++)a=i[b],Object.prototype.hasOwnProperty.call(o,a)&&o[a]&&d.push(o[a][0]),o[a]=0;for(n in s)Object.prototype.hasOwnProperty.call(s,n)&&(e[n]=s[n]);for(u&&u(t);d.length;)d.shift()();return c.push.apply(c,l||[]),r()}function r(){for(var e,t=0;t<c.length;t++){for(var r=c[t],n=!0,i=1;i<r.length;i++){var s=r[i];0!==o[s]&&(n=!1)}n&&(c.splice(t--,1),e=a(a.s=r[0]))}return e}var n={},o={7:0},c=[];function a(t){if(n[t])return n[t].exports;var r=n[t]={i:t,l:!1,exports:{}};return e[t].call(r.exports,r,r.exports,a),r.l=!0,r.exports}a.m=e,a.c=n,a.d=function(e,t,r){a.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},a.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},a.t=function(e,t){if(1&t&&(e=a(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(a.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)a.d(r,n,function(t){return e[t]}.bind(null,n));return r},a.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return a.d(t,"a",t),t},a.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},a.p="";var i=window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[],s=i.push.bind(i);i.push=t,i=i.slice();for(var l=0;l<i.length;l++)t(i[l]);var u=s;return c.push([774,0]),r()}({0:function(e,t){e.exports=window.wp.element},1:function(e,t){e.exports=window.wp.i18n},106:function(e,t,r){"use strict";var n=r(0),o=r(1),c=(r(2),r(66)),a=r(150),i=r(6),s=r.n(i),l=r(4),u=r(52);r(153),t.a=function(e){var t=e.className,r=e.error,i=e.isLoading,b=e.onRetry;return Object(n.createElement)(l.Placeholder,{icon:Object(n.createElement)(c.a,{srcElement:a.a}),label:Object(o.__)("Sorry, an error occurred",'woocommerce'),className:s()("wc-block-api-error",t)},Object(n.createElement)(u.a,{error:r}),b&&Object(n.createElement)(n.Fragment,null,i?Object(n.createElement)(l.Spinner,null):Object(n.createElement)(l.Button,{isSecondary:!0,onClick:b},Object(o.__)("Retry",'woocommerce'))))}},11:function(e,t){e.exports=window.React},12:function(e,t){e.exports=window.wp.blockEditor},123:function(e,t){},144:function(e,t,r){"use strict";r.d(t,"a",(function(){return l})),r.d(t,"b",(function(){return u})),r.d(t,"c",(function(){return b}));var n=r(0),o=r(1),c=r(4),a=r(12),i=r(3),s=r(88),l=function(e,t){return Object(n.createElement)(a.BlockControls,null,Object(n.createElement)(c.ToolbarGroup,{controls:[{icon:"edit",title:Object(o.__)("Edit",'woocommerce'),onClick:function(){return t({editMode:!e})},isActive:e}]}))},u=function(e,t){var r=Object(i.getSetting)("showAvatars",!0),a=Object(i.getSetting)("reviewRatingsEnabled",!0);return Object(n.createElement)(n.Fragment,null,Object(n.createElement)(c.ToggleControl,{label:Object(o.__)("Product rating",'woocommerce'),checked:e.showReviewRating,onChange:function(){return t({showReviewRating:!e.showReviewRating})}}),e.showReviewRating&&!a&&Object(n.createElement)(c.Notice,{className:"wc-block-base-control-notice",isDismissible:!1},Object(n.createInterpolateElement)(Object(o.__)("Product rating is disabled in your <a>store settings</a>.",'woocommerce'),{a:Object(n.createElement)("a",{href:Object(i.getAdminLink)("admin.php?page=wc-settings&tab=products"),target:"_blank",rel:"noopener noreferrer"})})),Object(n.createElement)(c.ToggleControl,{label:Object(o.__)("Reviewer name",'woocommerce'),checked:e.showReviewerName,onChange:function(){return t({showReviewerName:!e.showReviewerName})}}),Object(n.createElement)(c.ToggleControl,{label:Object(o.__)("Image",'woocommerce'),checked:e.showReviewImage,onChange:function(){return t({showReviewImage:!e.showReviewImage})}}),Object(n.createElement)(c.ToggleControl,{label:Object(o.__)("Review date",'woocommerce'),checked:e.showReviewDate,onChange:function(){return t({showReviewDate:!e.showReviewDate})}}),Object(n.createElement)(c.ToggleControl,{label:Object(o.__)("Review content",'woocommerce'),checked:e.showReviewContent,onChange:function(){return t({showReviewContent:!e.showReviewContent})}}),e.showReviewImage&&Object(n.createElement)(n.Fragment,null,Object(n.createElement)(s.a,{label:Object(o.__)("Review image",'woocommerce'),value:e.imageType,options:[{label:Object(o.__)("Reviewer photo",'woocommerce'),value:"reviewer"},{label:Object(o.__)("Product",'woocommerce'),value:"product"}],onChange:function(e){return t({imageType:e})}}),"reviewer"===e.imageType&&!r&&Object(n.createElement)(c.Notice,{className:"wc-block-base-control-notice",isDismissible:!1},Object(n.createInterpolateElement)(Object(o.__)("Reviewer photo is disabled in your <a>site settings</a>.",'woocommerce'),{a:Object(n.createElement)("a",{href:Object(i.getAdminLink)("options-discussion.php"),target:"_blank",rel:"noopener noreferrer"})}))))},b=function(e,t){return Object(n.createElement)(n.Fragment,null,Object(n.createElement)(c.ToggleControl,{label:Object(o.__)("Order by",'woocommerce'),checked:e.showOrderby,onChange:function(){return t({showOrderby:!e.showOrderby})}}),Object(n.createElement)(c.SelectControl,{label:Object(o.__)("Order Product Reviews by",'woocommerce'),value:e.orderby,options:[{label:"Most recent",value:"most-recent"},{label:"Highest Rating",value:"highest-rating"},{label:"Lowest Rating",value:"lowest-rating"}],onChange:function(e){return t({orderby:e})}}),Object(n.createElement)(c.RangeControl,{label:Object(o.__)("Starting Number of Reviews",'woocommerce'),value:e.reviewsOnPageLoad,onChange:function(e){return t({reviewsOnPageLoad:e})},max:20,min:1}),Object(n.createElement)(c.ToggleControl,{label:Object(o.__)("Load more",'woocommerce'),checked:e.showLoadMore,onChange:function(){return t({showLoadMore:!e.showLoadMore})}}),e.showLoadMore&&Object(n.createElement)(c.RangeControl,{label:Object(o.__)("Load More Reviews",'woocommerce'),value:e.reviewsOnLoadMore,onChange:function(e){return t({reviewsOnLoadMore:e})},max:20,min:1}))}},15:function(e,t){e.exports=window.wp.apiFetch},150:function(e,t,r){"use strict";var n=r(0),o=r(28),c=Object(n.createElement)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(n.createElement)("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z"}));t.a=c},153:function(e,t){},156:function(e,t,r){"use strict";var n=r(0),o=(r(2),r(6)),c=r.n(o),a=r(41),i=r(21);r(216),t.a=Object(i.withInstanceId)((function(e){var t=e.className,r=e.instanceId,o=e.label,i=e.onChange,s=e.options,l=e.screenReaderLabel,u=e.readOnly,b=e.value,d="wc-block-components-sort-select__select-".concat(r);return Object(n.createElement)("div",{className:c()("wc-block-sort-select","wc-block-components-sort-select",t)},Object(n.createElement)(a.a,{label:o,screenReaderLabel:l,wrapperElement:"label",wrapperProps:{className:"wc-block-sort-select__label wc-block-components-sort-select__label",htmlFor:d}}),Object(n.createElement)("select",{id:d,className:"wc-block-sort-select__select wc-block-components-sort-select__select",onChange:i,readOnly:u,value:b},s.map((function(e){return Object(n.createElement)("option",{key:e.key,value:e.key},e.label)}))))}))},161:function(e,t,r){"use strict";r.d(t,"a",(function(){return c}));var n=r(1),o=r(37),c={attributes:{editMode:!1,imageType:"reviewer",orderby:"most-recent",reviewsOnLoadMore:10,reviewsOnPageLoad:10,showLoadMore:!0,showOrderby:!0,showReviewDate:!0,showReviewerName:!0,showReviewImage:!0,showReviewRating:!0,showReviewContent:!0,previewReviews:[{id:1,date_created:"2019-07-15T17:05:04",formatted_date_created:Object(n.__)("July 15, 2019",'woocommerce'),date_created_gmt:"2019-07-15T15:05:04",product_id:0,product_name:Object(n.__)("WordPress Pennant",'woocommerce'),product_permalink:"#",
/* translators: An example person name used for the block previews. */
reviewer:Object(n.__)("Alice",'woocommerce'),review:"<p>".concat(Object(n.__)("I bought this product last week and I'm very happy with it.",'woocommerce'),"</p>\n"),reviewer_avatar_urls:{48:o.o.defaultAvatar,96:o.o.defaultAvatar},rating:5,verified:!0},{id:2,date_created:"2019-07-12T12:39:39",formatted_date_created:Object(n.__)("July 12, 2019",'woocommerce'),date_created_gmt:"2019-07-12T10:39:39",product_id:0,product_name:Object(n.__)("WordPress Pennant",'woocommerce'),product_permalink:"#",
/* translators: An example person name used for the block previews. */
reviewer:Object(n.__)("Bob",'woocommerce'),review:"<p>".concat(Object(n.__)("This product is awesome, I love it!",'woocommerce'),"</p>\n"),reviewer_avatar_urls:{48:o.o.defaultAvatar,96:o.o.defaultAvatar},rating:null,verified:!1}]}}},192:function(e,t,r){"use strict";t.a={editMode:{type:"boolean",default:!0},imageType:{type:"string",default:"reviewer"},orderby:{type:"string",default:"most-recent"},reviewsOnLoadMore:{type:"number",default:10},reviewsOnPageLoad:{type:"number",default:10},showLoadMore:{type:"boolean",default:!0},showOrderby:{type:"boolean",default:!0},showReviewDate:{type:"boolean",default:!0},showReviewerName:{type:"boolean",default:!0},showReviewImage:{type:"boolean",default:!0},showReviewRating:{type:"boolean",default:!0},showReviewContent:{type:"boolean",default:!0},previewReviews:{type:"array",default:null}}},193:function(e,t,r){"use strict";var n=r(9),o=r.n(n),c=r(0),a=r(12),i=(r(215),r(85));t.a=function(e){var t=e.attributes;return Object(c.createElement)("div",o()({},a.useBlockProps.save({className:Object(i.a)(t)}),Object(i.b)(t)))}},199:function(e,t,r){"use strict";var n=r(0),o=r(1),c=(r(2),r(7)),a=r(4),i=r(12),s=r(17),l=r.n(s),u=r(18),b=r.n(u),d=r(19),p=r.n(d),w=r(20),m=r.n(w),v=r(10),g=r.n(v),f=r(11),h=r(3),O=r(106),y=r(41),j=(r(256),function(e){var t=e.onClick,r=e.label,o=e.screenReaderLabel;return Object(n.createElement)("div",{className:"wp-block-button wc-block-load-more wc-block-components-load-more"},Object(n.createElement)("button",{className:"wp-block-button__link",onClick:t},Object(n.createElement)(y.a,{label:r,screenReaderLabel:o})))});j.defaultProps={label:Object(o.__)("Load more",'woocommerce')};var _=j,k=r(156),R=(r(253),function(e){var t=e.onChange,r=e.readOnly,c=e.value;return Object(n.createElement)(k.a,{className:"wc-block-review-sort-select wc-block-components-review-sort-select",label:Object(o.__)("Order by",'woocommerce'),onChange:t,options:[{key:"most-recent",label:Object(o.__)("Most recent",'woocommerce')},{key:"highest-rating",label:Object(o.__)("Highest rating",'woocommerce')},{key:"lowest-rating",label:Object(o.__)("Lowest rating",'woocommerce')}],readOnly:r,screenReaderLabel:Object(o.__)("Order reviews by",'woocommerce'),value:c})}),E=r(5),P=r.n(E),S=r(6),C=r.n(S),N=r(13),T=r.n(N),x=r(236),L=r.n(x),A=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"...",n=L()(e,{suffix:r,limit:t});return n.html},M=function(e,t,r,n){var o=I(e,t,r);return A(e,o-n.length,n)},I=function(e,t,r){for(var n={start:0,middle:0,end:e.length};n.start<=n.end;)n.middle=Math.floor((n.start+n.end)/2),t.innerHTML=A(e,n.middle),n=D(n,t.clientHeight,r);return n.middle},D=function(e,t,r){return t<=r?e.start=e.middle+1:e.end=e.middle-1,e};var B=function(e){p()(c,e);var t,r,o=(t=c,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,n=g()(t);if(r){var o=g()(this).constructor;e=Reflect.construct(n,arguments,o)}else e=n.apply(this,arguments);return m()(this,e)});function c(e){var t;return l()(this,c),(t=o.apply(this,arguments)).state={isExpanded:!1,clampEnabled:null,content:e.children,summary:"."},t.reviewSummary=Object(f.createRef)(),t.reviewContent=Object(f.createRef)(),t.getButton=t.getButton.bind(T()(t)),t.onClick=t.onClick.bind(T()(t)),t}return b()(c,[{key:"componentDidMount",value:function(){if(this.props.children){var e=this.props,t=e.maxLines,r=e.ellipsis,n=(this.reviewSummary.current.clientHeight+1)*t+1,o=this.reviewContent.current.clientHeight+1>n;this.setState({clampEnabled:o}),o&&this.setState({summary:M(this.reviewContent.current.innerHTML,this.reviewSummary.current,n,r)})}}},{key:"getButton",value:function(){var e=this.state.isExpanded,t=this.props,r=t.className,o=t.lessText,c=t.moreText,a=e?o:c;if(a)return Object(n.createElement)("a",{href:"#more",className:r+"__read_more",onClick:this.onClick,"aria-expanded":!e,role:"button"},a)}},{key:"onClick",value:function(e){e.preventDefault();var t=this.state.isExpanded;this.setState({isExpanded:!t})}},{key:"render",value:function(){var e=this.props.className,t=this.state,r=t.content,o=t.summary,c=t.clampEnabled,a=t.isExpanded;return r?!1===c?Object(n.createElement)("div",{className:e},Object(n.createElement)("div",{ref:this.reviewContent},r)):Object(n.createElement)("div",{className:e},(!a||null===c)&&Object(n.createElement)("div",{ref:this.reviewSummary,"aria-hidden":a,dangerouslySetInnerHTML:{__html:o}}),(a||null===c)&&Object(n.createElement)("div",{ref:this.reviewContent,"aria-hidden":!a},r),this.getButton()):null}}]),c}(f.Component);B.defaultProps={maxLines:3,ellipsis:"&hellip;",moreText:Object(o.__)("Read more",'woocommerce'),lessText:Object(o.__)("Read less",'woocommerce'),className:"read-more-content"};var H=B;r(255);var G=function(e){var t=e.attributes,r=e.review,c=void 0===r?{}:r,a=t.imageType,i=t.showReviewDate,s=t.showReviewerName,l=t.showReviewImage,u=t.showReviewRating,b=t.showReviewContent,d=t.showProductName,p=c.rating,w=!Object.keys(c).length>0,m=Number.isFinite(p)&&u;return Object(n.createElement)("li",{className:C()("wc-block-review-list-item__item","wc-block-components-review-list-item__item",{"is-loading":w,"wc-block-components-review-list-item__item--has-image":l}),"aria-hidden":w},(d||i||s||l||m)&&Object(n.createElement)("div",{className:"wc-block-review-list-item__info wc-block-components-review-list-item__info"},l&&function(e,t,r){var c,a;return r||!e?Object(n.createElement)("div",{className:"wc-block-review-list-item__image wc-block-components-review-list-item__image"}):Object(n.createElement)("div",{className:"wc-block-review-list-item__image wc-block-components-review-list-item__image"},"product"===t?Object(n.createElement)("img",{"aria-hidden":"true",alt:(null===(c=e.product_image)||void 0===c?void 0:c.alt)||"",src:(null===(a=e.product_image)||void 0===a?void 0:a.thumbnail)||""}):Object(n.createElement)("img",{"aria-hidden":"true",alt:"",src:e.reviewer_avatar_urls[96]||""}),e.verified&&Object(n.createElement)("div",{className:"wc-block-review-list-item__verified wc-block-components-review-list-item__verified",title:Object(o.__)("Verified buyer",'woocommerce')},Object(o.__)("Verified buyer",'woocommerce')))}(c,a,w),(d||s||m||i)&&Object(n.createElement)("div",{className:"wc-block-review-list-item__meta wc-block-components-review-list-item__meta"},m&&function(e){var t=e.rating,r={width:t/5*100+"%"},c=Object(o.sprintf)(
/* translators: %f is referring to the average rating value */
Object(o.__)("Rated %f out of 5",'woocommerce'),t);return Object(n.createElement)("div",{className:"wc-block-review-list-item__rating wc-block-components-review-list-item__rating"},Object(n.createElement)("div",{className:"wc-block-review-list-item__rating__stars wc-block-components-review-list-item__rating__stars",role:"img","aria-label":c},Object(n.createElement)("span",{style:r},c)))}(c),d&&function(e){return Object(n.createElement)("div",{className:"wc-block-review-list-item__product wc-block-components-review-list-item__product"},Object(n.createElement)("a",{href:e.product_permalink,dangerouslySetInnerHTML:{__html:e.product_name}}))}(c),s&&function(e){var t=e.reviewer,r=void 0===t?"":t;return Object(n.createElement)("div",{className:"wc-block-review-list-item__author wc-block-components-review-list-item__author"},r)}(c),i&&function(e){var t=e.date_created,r=e.formatted_date_created;return Object(n.createElement)("time",{className:"wc-block-review-list-item__published-date wc-block-components-review-list-item__published-date",dateTime:t},r)}(c))),b&&function(e){return Object(n.createElement)(H,{maxLines:10,moreText:Object(o.__)("Read full review",'woocommerce'),lessText:Object(o.__)("Hide full review",'woocommerce'),className:"wc-block-review-list-item__text wc-block-components-review-list-item__text"},Object(n.createElement)("div",{dangerouslySetInnerHTML:{__html:e.review||""}}))}(c))};function F(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function V(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?F(Object(r),!0).forEach((function(t){P()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):F(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}r(254);var z=function(e){var t=e.attributes,r=e.reviews,o=Object(h.getSetting)("showAvatars",!0),c=Object(h.getSetting)("reviewRatingsEnabled",!0),a=(o||"product"===t.imageType)&&t.showReviewImage,i=c&&t.showReviewRating,s=V(V({},t),{},{showReviewImage:a,showReviewRating:i});return Object(n.createElement)("ul",{className:"wc-block-review-list wc-block-components-review-list"},0===r.length?Object(n.createElement)(G,{attributes:s}):r.map((function(e,t){return Object(n.createElement)(G,{key:e.id||t,attributes:s,review:e})})))},W=r(9),U=r.n(W),J=r(29),q=r.n(J),Y=r(22),K=r.n(Y),Q=r(34),X=r.n(Q),Z=r(85),$=r(42);var ee=function(e){var t=function(t){p()(a,t);var r,o,c=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=g()(r);if(o){var n=g()(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return m()(this,e)});function a(){var e;l()(this,a);for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return e=c.call.apply(c,[this].concat(r)),P()(T()(e),"isPreview",!!e.props.attributes.previewReviews),P()(T()(e),"delayedAppendReviews",e.props.delayFunction(e.appendReviews)),P()(T()(e),"isMounted",!1),P()(T()(e),"state",{error:null,loading:!0,reviews:e.isPreview?e.props.attributes.previewReviews:[],totalReviews:e.isPreview?e.props.attributes.previewReviews.length:0}),P()(T()(e),"setError",function(){var t=q()(K.a.mark((function t(r){var n,o;return K.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e.isMounted){t.next=2;break}return t.abrupt("return");case 2:return n=e.props.onReviewsLoadError,t.next=5,Object($.a)(r);case 5:o=t.sent,e.setState({reviews:[],loading:!1,error:o}),n(o);case 8:case"end":return t.stop()}}),t)})));return function(_x){return t.apply(this,arguments)}}()),e}return b()(a,[{key:"componentDidMount",value:function(){this.isMounted=!0,this.replaceReviews()}},{key:"componentDidUpdate",value:function(e){e.reviewsToDisplay<this.props.reviewsToDisplay?this.delayedAppendReviews():this.shouldReplaceReviews(e,this.props)&&this.replaceReviews()}},{key:"shouldReplaceReviews",value:function(e,t){return e.orderby!==t.orderby||e.order!==t.order||e.productId!==t.productId||!X()(e.categoryIds,t.categoryIds)}},{key:"componentWillUnmount",value:function(){this.isMounted=!1,this.delayedAppendReviews.cancel&&this.delayedAppendReviews.cancel()}},{key:"getArgs",value:function(e){var t=this.props,r=t.categoryIds,n=t.order,o=t.orderby,c=t.productId,a={order:n,orderby:o,per_page:t.reviewsToDisplay-e,offset:e};return r&&r.length&&(a.category_id=Array.isArray(r)?r.join(","):r),c&&(a.product_id=c),a}},{key:"replaceReviews",value:function(){if(!this.isPreview){var e=this.props.onReviewsReplaced;this.updateListOfReviews().then(e)}}},{key:"appendReviews",value:function(){if(!this.isPreview){var e=this.props,t=e.onReviewsAppended,r=e.reviewsToDisplay,n=this.state.reviews;r<=n.length||this.updateListOfReviews(n).then(t)}}},{key:"updateListOfReviews",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],r=this.props.reviewsToDisplay,n=this.state.totalReviews,o=Math.min(n,r)-t.length;return this.setState({loading:!0,reviews:t.concat(Array(o).fill({}))}),Object(Z.c)(this.getArgs(t.length)).then((function(r){var n=r.reviews,o=r.totalReviews;return e.isMounted&&e.setState({reviews:t.filter((function(e){return Object.keys(e).length})).concat(n),totalReviews:o,loading:!1,error:null}),{newReviews:n}})).catch(this.setError)}},{key:"render",value:function(){var t=this.props.reviewsToDisplay,r=this.state,o=r.error,c=r.loading,a=r.reviews,i=r.totalReviews;return Object(n.createElement)(e,U()({},this.props,{error:o,isLoading:c,reviews:a.slice(0,t),totalReviews:i}))}}]),a}(f.Component);P()(t,"defaultProps",{delayFunction:function(e){return e},onReviewsAppended:function(){},onReviewsLoadError:function(){},onReviewsReplaced:function(){}});var r=e.displayName,o=void 0===r?e.name||"Component":r;return t.displayName="WithReviews( ".concat(o," )"),t}(function(e){p()(i,e);var t,r,c=(t=i,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,n=g()(t);if(r){var o=g()(this).constructor;e=Reflect.construct(n,arguments,o)}else e=n.apply(this,arguments);return m()(this,e)});function i(){return l()(this,i),c.apply(this,arguments)}return b()(i,[{key:"render",value:function(){var e=this.props,t=e.attributes,r=e.error,c=e.isLoading,i=e.noReviewsPlaceholder,s=e.reviews,l=e.totalReviews;if(r)return Object(n.createElement)(O.a,{className:"wc-block-featured-product-error",error:r,isLoading:c});if(0===s.length&&!c)return Object(n.createElement)(i,{attributes:t});var u=Object(h.getSetting)("reviewRatingsEnabled",!0);return Object(n.createElement)(a.Disabled,null,t.showOrderby&&u&&Object(n.createElement)(R,{readOnly:!0,value:t.orderby}),Object(n.createElement)(z,{attributes:t,reviews:s}),t.showLoadMore&&l>s.length&&Object(n.createElement)(_,{screenReaderLabel:Object(o.__)("Load more reviews",'woocommerce')}))}}]),i}(f.Component));t.a=function(e){var t=e.attributes,r=e.icon,s=e.name,l=e.noReviewsPlaceholder,u=t.categoryIds,b=t.productId,d=t.reviewsOnPageLoad,p=t.showProductName,w=t.showReviewDate,m=t.showReviewerName,v=t.showReviewContent,g=t.showReviewImage,f=t.showReviewRating,h=Object(Z.d)(t.orderby),O=h.order,y=h.orderby,j=!(v||f||w||m||g||p),_=Object(i.useBlockProps)({className:Object(Z.a)(t)});return j?Object(n.createElement)(a.Placeholder,{icon:r,label:s},Object(o.__)("The content for this block is hidden due to block settings.",'woocommerce')):Object(n.createElement)("div",_,Object(n.createElement)(ee,{attributes:t,categoryIds:u,delayFunction:function(e){return Object(c.debounce)(e,400)},noReviewsPlaceholder:l,orderby:y,order:O,productId:b,reviewsToDisplay:d}))}},21:function(e,t){e.exports=window.wp.compose},215:function(e,t){},216:function(e,t){},22:function(e,t){e.exports=window.regeneratorRuntime},253:function(e,t){},254:function(e,t){},255:function(e,t){},256:function(e,t){},26:function(e,t){e.exports=window.wp.blocks},28:function(e,t){e.exports=window.wp.primitives},3:function(e,t){e.exports=window.wc.wcSettings},34:function(e,t){e.exports=window.wp.isShallowEqual},37:function(e,t,r){"use strict";r.d(t,"o",(function(){return c})),r.d(t,"m",(function(){return a})),r.d(t,"l",(function(){return i})),r.d(t,"n",(function(){return s})),r.d(t,"j",(function(){return l})),r.d(t,"e",(function(){return u})),r.d(t,"f",(function(){return b})),r.d(t,"g",(function(){return d})),r.d(t,"k",(function(){return p})),r.d(t,"c",(function(){return w})),r.d(t,"d",(function(){return m})),r.d(t,"h",(function(){return v})),r.d(t,"a",(function(){return g})),r.d(t,"i",(function(){return f})),r.d(t,"b",(function(){return h}));var n,o=r(3),c=Object(o.getSetting)("wcBlocksConfig",{buildPhase:1,pluginUrl:"",productCount:0,defaultAvatar:"",restApiRoutes:{},wordCountType:"words"}),a=c.pluginUrl+"images/",i=c.pluginUrl+"build/",s=c.buildPhase,l=null===(n=o.STORE_PAGES.shop)||void 0===n?void 0:n.permalink,u=o.STORE_PAGES.checkout.id,b=o.STORE_PAGES.checkout.permalink,d=o.STORE_PAGES.privacy.permalink,p=(o.STORE_PAGES.privacy.title,o.STORE_PAGES.terms.permalink),w=(o.STORE_PAGES.terms.title,o.STORE_PAGES.cart.id),m=o.STORE_PAGES.cart.permalink,v=(o.STORE_PAGES.myaccount.permalink?o.STORE_PAGES.myaccount.permalink:Object(o.getSetting)("wpLoginUrl","/wp-login.php"),Object(o.getSetting)("shippingCountries",{})),g=Object(o.getSetting)("allowedCountries",{}),f=Object(o.getSetting)("shippingStates",{}),h=Object(o.getSetting)("allowedStates",{})},4:function(e,t){e.exports=window.wp.components},41:function(e,t,r){"use strict";var n=r(5),o=r.n(n),c=r(0),a=r(6),i=r.n(a);function s(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function l(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?s(Object(r),!0).forEach((function(t){o()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):s(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}t.a=function(e){var t,r=e.label,n=e.screenReaderLabel,o=e.wrapperElement,a=e.wrapperProps,s=void 0===a?{}:a,u=null!=r,b=null!=n;return!u&&b?(t=o||"span",s=l(l({},s),{},{className:i()(s.className,"screen-reader-text")}),Object(c.createElement)(t,s,n)):(t=o||c.Fragment,u&&b&&r!==n?Object(c.createElement)(t,s,Object(c.createElement)("span",{"aria-hidden":"true"},r),Object(c.createElement)("span",{className:"screen-reader-text"},n)):Object(c.createElement)(t,s,r))}},42:function(e,t,r){"use strict";r.d(t,"a",(function(){return s})),r.d(t,"b",(function(){return l}));var n=r(29),o=r.n(n),c=r(22),a=r.n(c),i=r(1),s=function(){var e=o()(a.a.mark((function e(t){var r;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("function"!=typeof t.json){e.next=11;break}return e.prev=1,e.next=4,t.json();case 4:return r=e.sent,e.abrupt("return",{message:r.message,type:r.type||"api"});case 8:return e.prev=8,e.t0=e.catch(1),e.abrupt("return",{message:e.t0.message,type:"general"});case 11:return e.abrupt("return",{message:t.message,type:t.type||"general"});case 12:case"end":return e.stop()}}),e,null,[[1,8]])})));return function(_x){return e.apply(this,arguments)}}(),l=function(e){if(e.data&&"rest_invalid_param"===e.code){var t=Object.values(e.data.params);if(t[0])return t[0]}return(null==e?void 0:e.message)||Object(i.__)("Something went wrong. Please contact us to get assistance.",'woocommerce')}},48:function(e,t){e.exports=window.wp.escapeHtml},52:function(e,t,r){"use strict";var n=r(0),o=r(1),c=(r(2),r(48));t.a=function(e){var t,r,a,i=e.error;return Object(n.createElement)("div",{className:"wc-block-error-message"},(r=(t=i).message,a=t.type,r?"general"===a?Object(n.createElement)("span",null,Object(o.__)("The following error was returned",'woocommerce'),Object(n.createElement)("br",null),Object(n.createElement)("code",null,Object(c.escapeHTML)(r))):"api"===a?Object(n.createElement)("span",null,Object(o.__)("The following error was returned from the API",'woocommerce'),Object(n.createElement)("br",null),Object(n.createElement)("code",null,Object(c.escapeHTML)(r))):r:Object(o.__)("An unknown error occurred which prevented the block from being updated.",'woocommerce')))}},66:function(e,t,r){"use strict";var n=r(5),o=r.n(n),c=r(16),a=r.n(c),i=r(0),s=["srcElement","size"];function l(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}t.a=function(e){var t=e.srcElement,r=e.size,n=void 0===r?24:r,c=a()(e,s);return Object(i.isValidElement)(t)?Object(i.cloneElement)(t,function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?l(Object(r),!0).forEach((function(t){o()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):l(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({width:n,height:n},c)):null}},7:function(e,t){e.exports=window.lodash},774:function(e,t,r){e.exports=r(864)},85:function(e,t,r){"use strict";r.d(t,"d",(function(){return s})),r.d(t,"c",(function(){return l})),r.d(t,"a",(function(){return u})),r.d(t,"b",(function(){return b}));var n=r(15),o=r.n(n),c=r(6),a=r.n(c),i=r(3),s=function(e){if(Object(i.getSetting)("reviewRatingsEnabled",!0)){if("lowest-rating"===e)return{order:"asc",orderby:"rating"};if("highest-rating"===e)return{order:"desc",orderby:"rating"}}return{order:"desc",orderby:"date_gmt"}},l=function(e){return o()({path:"/wc/store/products/reviews?"+Object.entries(e).map((function(e){return e.join("=")})).join("&"),parse:!1}).then((function(e){return e.json().then((function(t){return{reviews:t,totalReviews:parseInt(e.headers.get("x-wp-total"),10)}}))}))},u=function(e){var t=e.className,r=e.categoryIds,n=e.productId,o=e.showReviewDate,c=e.showReviewerName,i=e.showReviewContent,s=e.showProductName,l=e.showReviewImage,u=e.showReviewRating,b="wc-block-all-reviews";return n&&(b="wc-block-reviews-by-product"),Array.isArray(r)&&(b="wc-block-reviews-by-category"),a()(b,t,{"has-image":l,"has-name":c,"has-date":o,"has-rating":u,"has-content":i,"has-product-name":s})},b=function(e){var t=e.categoryIds,r=e.imageType,n=e.orderby,o=e.productId,c={"data-image-type":r,"data-orderby":n,"data-reviews-on-page-load":e.reviewsOnPageLoad,"data-reviews-on-load-more":e.reviewsOnLoadMore,"data-show-load-more":e.showLoadMore,"data-show-orderby":e.showOrderby};return o&&(c["data-product-id"]=o),Array.isArray(t)&&(c["data-category-ids"]=t.join(",")),c}},864:function(e,t,r){"use strict";r.r(t);var n=r(5),o=r.n(n),c=r(0),a=r(1),i=r(26),s=r(66),l=r(28),u=Object(c.createElement)(l.SVG,{xmlns:"http://www.w3.org/2000/SVG",viewBox:"0 0 24 24"},Object(c.createElement)("path",{fill:"none",d:"M0 0h24v24H0V0z"}),Object(c.createElement)("path",{d:"M15 4v7H5.17l-.59.59-.58.58V4h11m1-2H3c-.55 0-1 .45-1 1v14l4-4h10c.55 0 1-.45 1-1V3c0-.55-.45-1-1-1zm5 4h-2v9H6v2c0 .55.45 1 1 1h11l4 4V7c0-.55-.45-1-1-1z"})),b=(r(215),r(12)),d=r(4),p=(r(2),r(199)),w=function(){return Object(c.createElement)(d.Placeholder,{className:"wc-block-all-reviews",icon:Object(c.createElement)(s.a,{srcElement:u,className:"block-editor-block-icon"}),label:Object(a.__)("All Reviews",'woocommerce')},Object(a.__)("This block shows a list of all product reviews. Your store does not have any reviews yet, but they will show up here when it does.",'woocommerce'))},m=r(144),v=r(192),g=r(193),f=r(161);function h(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function O(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?h(Object(r),!0).forEach((function(t){o()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):h(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}Object(i.registerBlockType)("woocommerce/all-reviews",{apiVersion:2,title:Object(a.__)("All Reviews",'woocommerce'),icon:{src:Object(c.createElement)(s.a,{srcElement:u}),foreground:"#96588a"},category:"woocommerce",keywords:[Object(a.__)("WooCommerce",'woocommerce')],description:Object(a.__)("Show a list of all product reviews.",'woocommerce'),supports:{html:!1,color:{background:!1},typography:{fontSize:!0}},example:O(O({},f.a),{},{attributes:O(O({},f.a.attributes),{},{showProductName:!0})}),attributes:O(O({},v.a),{},{showProductName:{type:"boolean",default:!0}}),transforms:{from:[{type:"block",blocks:["core/legacy-widget"],isMatch:function(e){var t=e.idBase,r=e.instance;return"woocommerce_recent_reviews"===t&&!(null==r||!r.raw)},transform:function(e){var t=e.instance;return Object(i.createBlock)("woocommerce/all-reviews",{reviewsOnPageLoad:t.raw.number,imageType:"product",showLoadMore:!1,showOrderby:!1,showReviewDate:!1,showReviewContent:!1})}}]},edit:function(e){var t=e.attributes,r=e.setAttributes;return Object(c.createElement)(c.Fragment,null,Object(c.createElement)(b.InspectorControls,{key:"inspector"},Object(c.createElement)(d.PanelBody,{title:Object(a.__)("Content",'woocommerce')},Object(c.createElement)(d.ToggleControl,{label:Object(a.__)("Product name",'woocommerce'),checked:t.showProductName,onChange:function(){return r({showProductName:!t.showProductName})}}),Object(m.b)(t,r)),Object(c.createElement)(d.PanelBody,{title:Object(a.__)("List Settings",'woocommerce')},Object(m.c)(t,r))),Object(c.createElement)(p.a,{attributes:t,icon:Object(c.createElement)(s.a,{icon:u,className:"block-editor-block-icon"}),name:Object(a.__)("All Reviews",'woocommerce'),noReviewsPlaceholder:w}))},save:g.a})},88:function(e,t,r){"use strict";var n=r(9),o=r.n(n),c=r(17),a=r.n(c),i=r(18),s=r.n(i),l=r(13),u=r.n(l),b=r(19),d=r.n(b),p=r(20),w=r.n(p),m=r(10),v=r.n(m),g=r(0),f=r(7),h=r(6),O=r.n(h),y=r(4),j=r(21);r(123);var _=function(e){d()(c,e);var t,r,n=(t=c,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,n=v()(t);if(r){var o=v()(this).constructor;e=Reflect.construct(n,arguments,o)}else e=n.apply(this,arguments);return w()(this,e)});function c(){var e;return a()(this,c),(e=n.apply(this,arguments)).onClick=e.onClick.bind(u()(e)),e}return s()(c,[{key:"onClick",value:function(e){this.props.onChange&&this.props.onChange(e.target.value)}},{key:"render",value:function(){var e,t=this,r=this.props,n=r.label,c=r.checked,a=r.instanceId,i=r.className,s=r.help,l=r.options,u=r.value,b="inspector-toggle-button-control-".concat(a);return s&&(e=Object(f.isFunction)(s)?s(c):s),Object(g.createElement)(y.BaseControl,{id:b,help:e,className:O()("components-toggle-button-control",i)},Object(g.createElement)("label",{id:b+"__label",htmlFor:b,className:"components-toggle-button-control__label"},n),Object(g.createElement)(y.ButtonGroup,{"aria-labelledby":b+"__label"},l.map((function(e,r){var c={};return u===e.value?(c.isPrimary=!0,c["aria-pressed"]=!0):(c.isSecondary=!0,c["aria-pressed"]=!1),Object(g.createElement)(y.Button,o()({key:"".concat(e.label,"-").concat(e.value,"-").concat(r),value:e.value,onClick:t.onClick,"aria-label":n+": "+e.label},c),e.label)}))))}}]),c}(g.Component);t.a=Object(j.withInstanceId)(_)}});woocommerce-blocks/build/price-filter-frontend.asset.php000064400000000364151335517640017503 0ustar00<?php return array('dependencies' => array('lodash', 'react', 'wc-blocks-data-store', 'wc-price-format', 'wc-settings', 'wp-data', 'wp-element', 'wp-i18n', 'wp-is-shallow-equal', 'wp-polyfill'), 'version' => '0623a5e0d8e5c7e9c3b0554563082953');woocommerce-blocks/build/cart-i2-frontend.asset.php000064400000000746151335517640016363 0ustar00<?php return array('dependencies' => array('lodash', 'react', 'wc-blocks-checkout', 'wc-blocks-data-store', 'wc-blocks-registry', 'wc-price-format', 'wc-settings', 'wp-a11y', 'wp-api-fetch', 'wp-autop', 'wp-compose', 'wp-data', 'wp-deprecated', 'wp-dom', 'wp-element', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-is-shallow-equal', 'wp-keycodes', 'wp-plugins', 'wp-polyfill', 'wp-primitives', 'wp-url', 'wp-warning', 'wp-wordcount'), 'version' => 'aa033ba81d2d3e8f40010fe3d15759fd');woocommerce-blocks/build/wc-blocks-registry.asset.php000064400000000213151335517640017024 0ustar00<?php return array('dependencies' => array('wp-deprecated', 'wp-element', 'wp-polyfill'), 'version' => 'ad243ea549878603947e589077b3e965');woocommerce-blocks/build/wc-blocks-editor-style-rtl.css000064400000331607151335517640017300 0ustar00@charset "UTF-8";:root{--wp-admin-theme-color:#007cba;--wp-admin-theme-color-darker-10:#006ba1;--wp-admin-theme-color-darker-20:#005a87}body.admin-color-light{--wp-admin-theme-color:#0085ba;--wp-admin-theme-color-darker-10:#0073a1;--wp-admin-theme-color-darker-20:#006187}body.admin-color-modern{--wp-admin-theme-color:#3858e9;--wp-admin-theme-color-darker-10:#2145e6;--wp-admin-theme-color-darker-20:#183ad6}body.admin-color-blue{--wp-admin-theme-color:#096484;--wp-admin-theme-color-darker-10:#07526c;--wp-admin-theme-color-darker-20:#064054}body.admin-color-coffee{--wp-admin-theme-color:#46403c;--wp-admin-theme-color-darker-10:#383330;--wp-admin-theme-color-darker-20:#2b2724}body.admin-color-ectoplasm{--wp-admin-theme-color:#523f6d;--wp-admin-theme-color-darker-10:#46365d;--wp-admin-theme-color-darker-20:#3a2c4d}body.admin-color-midnight{--wp-admin-theme-color:#e14d43;--wp-admin-theme-color-darker-10:#dd382d;--wp-admin-theme-color-darker-20:#d02c21}body.admin-color-ocean{--wp-admin-theme-color:#627c83;--wp-admin-theme-color-darker-10:#576e74;--wp-admin-theme-color-darker-20:#4c6066}body.admin-color-sunrise{--wp-admin-theme-color:#dd823b;--wp-admin-theme-color-darker-10:#d97426;--wp-admin-theme-color-darker-20:#c36922}.woocommerce-calendar{width:100%;background-color:#f0f0f0;border-top:1px solid #ccc;height:396px}.woocommerce-calendar.is-mobile{height:100%}.woocommerce-calendar__react-dates{width:100%;overflow-x:hidden}.woocommerce-calendar__react-dates .DayPicker{margin:0 auto}.woocommerce-calendar__react-dates .CalendarMonth_table{margin-top:10px}.woocommerce-calendar__react-dates .CalendarDay__selected_span{background:#007cba;background:var(--wp-admin-theme-color);border:1px solid #ccc}.woocommerce-calendar__react-dates .CalendarDay__selected_span:hover{background:#006ba1;background:var(--wp-admin-theme-color-darker-10);border:1px solid #f0f0f0}.woocommerce-calendar__react-dates .CalendarDay__selected{background:#005a87;background:var(--wp-admin-theme-color-darker-20);border:1px solid #ccc}.woocommerce-calendar__react-dates .CalendarDay__hovered_span,.woocommerce-calendar__react-dates .CalendarDay__selected:hover{background:#006ba1;background:var(--wp-admin-theme-color-darker-10);border:1px solid #f0f0f0}.woocommerce-calendar__react-dates .CalendarDay__hovered_span{color:#fff}.woocommerce-calendar__react-dates .CalendarDay__hovered_span:hover{color:#fff;background:#007cba;background:var(--wp-admin-theme-color)}.woocommerce-calendar__react-dates .CalendarDay__blocked_out_of_range{color:#ccc}.woocommerce-calendar__react-dates .CalendarMonth,.woocommerce-calendar__react-dates .CalendarMonthGrid,.woocommerce-calendar__react-dates .DayPicker,.woocommerce-calendar__react-dates .DayPicker_transitionContainer{background-color:#f0f0f0}.woocommerce-calendar__react-dates .DayPicker_weekHeader_li{color:#757575}.woocommerce-calendar__react-dates .DayPickerNavigation_button:focus{outline:2px solid #bfe7f3}.woocommerce-calendar__react-dates.is-core-datepicker .components-datetime__date{padding-right:0}.woocommerce-calendar__react-dates.is-core-datepicker .CalendarDay__default{background-color:transparent}.woocommerce-calendar__react-dates.is-core-datepicker .CalendarDay__selected{background:#533582;border:none}.woocommerce-calendar__inputs{padding:1em;width:100%;max-width:500px;display:-ms-grid;display:grid;-ms-grid-columns:43% 14% 43%;grid-template-columns:43% 14% 43%;margin:0 auto}.woocommerce-calendar__inputs .components-base-control{margin:0}.woocommerce-calendar__inputs-to{display:flex;align-items:center;justify-content:center;-ms-grid-column:2;grid-column-start:2}.woocommerce-calendar__input{position:relative}.woocommerce-calendar__input .dashicons-calendar{position:absolute;top:50%;transform:translateY(-50%);right:10px}.woocommerce-calendar__input .dashicons-calendar path{fill:#757575}.woocommerce-calendar__input:first-child{-ms-grid-column:1;grid-column-start:1}.woocommerce-calendar__input:last-child{-ms-grid-column:3;grid-column-start:3}.woocommerce-calendar__input.is-empty .dashicons-calendar path{fill:#757575}.woocommerce-calendar__input.is-error .dashicons-calendar path{fill:#d94f4f}.woocommerce-calendar__input.is-error .woocommerce-calendar__input-text{border:1px solid #d94f4f;box-shadow:inset 0 0 8px #d94f4f}.woocommerce-calendar__input.is-error .woocommerce-calendar__input-text:focus{box-shadow:inset 0 0 8px #d94f4f,0 0 6px rgba(30,140,190,.8)}.woocommerce-calendar__input .woocommerce-calendar__input-text{color:#757575;border-radius:3px;padding:10px 30px 10px 10px;width:100%;font-size:13px;font-size:.8125rem}.woocommerce-calendar__input .woocommerce-calendar__input-text:-ms-input-placeholder{color:#757575}.woocommerce-calendar__input .woocommerce-calendar__input-text::-moz-placeholder{color:#757575}.woocommerce-calendar__input .woocommerce-calendar__input-text::placeholder{color:#757575}.woocommerce-filters-date__content.is-mobile .woocommerce-calendar__input-error .components-popover__content{height:auto}.woocommerce-calendar__input-error{display:none}.is-error .woocommerce-calendar__input-text:focus+span .woocommerce-calendar__input-error{display:block;right:50%!important;position:absolute;top:auto!important}.woocommerce-calendar__input-error .components-popover__content{background-color:#757575;color:#fff;padding:.5em;border:none}.woocommerce-calendar__input-error.components-popover .components-popover__content{min-width:100px;width:100px;text-align:center}.woocommerce-calendar__input-error.components-popover:not(.no-arrow):not(.is-mobile).is-bottom:before{border-bottom-color:#757575;z-index:1;top:-6px}.woocommerce-calendar__input-error.components-popover:not(.no-arrow):not(.is-mobile).is-top:after{border-top-color:#757575;z-index:1;top:0}.woocommerce-calendar__date-picker-title{font-size:12px;font-size:.75rem;font-weight:100;text-transform:uppercase;text-align:center;color:#757575;width:100%;margin:0;padding:1em;background-color:#fff}.woocommerce-card{margin-bottom:24px;background:#fff;border-radius:3px;box-shadow:0 2px 1px -1px rgba(0,0,0,.2),0 1px 1px 0 rgba(0,0,0,.14),0 1px 3px 0 rgba(0,0,0,.12);transition:box-shadow .2s cubic-bezier(.4,1,.4,1)}@media (max-width:782px){.woocommerce-card{margin-bottom:12px;width:auto}}.woocommerce-card.is-inactive{background-color:#f6f7f7;box-shadow:none}.woocommerce-card__header{padding:16px;display:-ms-grid;display:grid;align-items:center;border-top-right-radius:3px;border-top-right-radius:4px}.has-action .woocommerce-card__header{-ms-grid-columns:auto 1fr;grid-template-columns:auto 1fr}.has-menu .woocommerce-card__header{-ms-grid-columns:auto 24px;grid-template-columns:auto 24px}.has-menu.has-action .woocommerce-card__header{grid-gap:12px;-ms-grid-columns:auto 1fr 24px;grid-template-columns:auto 1fr 24px}.woocommerce-card__header-item{-ms-grid-row-align:center}.woocommerce-card__header-item:first-child{-ms-grid-column:1;grid-column-start:1;-ms-grid-column-span:1;grid-column-end:2;-ms-grid-row:1;grid-row-start:1;-ms-grid-row-span:1;grid-row-end:2}.woocommerce-card__header-item:nth-child(2){-ms-grid-column:2;grid-column-start:2;-ms-grid-column-span:1;grid-column-end:3;-ms-grid-row:1;grid-row-start:1;-ms-grid-row-span:1;grid-row-end:2}.woocommerce-card__header-item:nth-child(3){-ms-grid-column:3;grid-column-start:3;-ms-grid-column-span:1;grid-column-end:4;-ms-grid-row:1;grid-row-start:1;-ms-grid-row-span:1;grid-row-end:2}.woocommerce-card__action,.woocommerce-card__menu{text-align:left}.woocommerce-card__body{padding:16px}.woocommerce-card__title{margin:0;font-size:24px;font-size:1.5rem;line-height:1.2;font-weight:400}.woocommerce-card__description{font-size:16px;font-size:1rem;line-height:1.5;color:#646970;margin-top:12px;margin-bottom:0;font-weight:400}.woocommerce-chart{margin-top:-16px;margin-bottom:24px;background:#fff;border:1px solid #e2e4e7;border-top:0}@media (max-width:782px){.woocommerce-chart{margin-right:-16px;margin-left:-16px;margin-bottom:12px;border-right:none;border-left:none;width:auto}}.woocommerce-chart .woocommerce-chart__header{min-height:50px;border-bottom:1px solid #e2e4e7;display:flex;flex-flow:row wrap;justify-content:space-between;align-items:center;width:100%}.woocommerce-chart .woocommerce-chart__header .woocommerce-chart__title{height:18px;color:#24292d;font-size:15px;font-weight:600;line-height:18px;margin-right:16px;margin-left:16px}.woocommerce-chart .woocommerce-chart__body{display:flex;flex-direction:row;justify-content:flex-start;align-items:flex-start;width:100%}.woocommerce-chart .woocommerce-chart__body.woocommerce-chart__body-column{flex-direction:column}.woocommerce-chart .woocommerce-chart__footer{width:100%}.woocommerce-chart-placeholder{-webkit-animation:loading-fade 1.6s ease-in-out infinite;animation:loading-fade 1.6s ease-in-out infinite;background-color:#f0f0f0;color:transparent;padding:0;width:100%;display:flex;align-items:center;justify-content:center}.woocommerce-chart-placeholder:after{content:"\00a0"}@media screen and (prefers-reduced-motion:reduce){.woocommerce-chart-placeholder{-webkit-animation:none;animation:none}}.woocommerce-chart-placeholder .components-spinner{margin:0}.woocommerce-chart__interval-select{align-items:start;border-left:1px solid #e2e4e7;display:flex;flex-direction:column;justify-content:center;margin:0 auto 0 0;min-height:50px;padding:8px 16px 0}@media (max-width:960px){.woocommerce-chart__interval-select{width:100%;order:1;margin-top:-8px;margin-right:0;padding-right:8px;border-left:0;min-height:0}}#wpbody .woocommerce-chart__interval-select .components-select-control__input{font-size:13px;font-size:.8125rem;border:0;box-shadow:none}#wpbody .woocommerce-chart__interval-select .components-select-control__input:not(:disabled):not([aria-disabled=true]):focus{background-color:#fff;color:#1e1e1e;box-shadow:inset 0 0 0 1px #757575,inset 0 0 0 2px #fff;outline:2px solid transparent;outline-offset:-2px}.woocommerce-chart__types{padding:0 8px;white-space:nowrap}.woocommerce-chart__type-button{background:transparent!important}.woocommerce-chart__type-button.components-button{color:#e2e4e7;display:inline-flex;padding:8px}.woocommerce-chart__type-button.components-button.woocommerce-chart__type-button-selected{color:#757575}@media (max-width:960px){.woocommerce-summary+.woocommerce-chart .woocommerce-chart__title{display:none}.woocommerce-summary+.woocommerce-chart .woocommerce-chart__interval-select{width:auto;order:0;margin-top:0}}.woocommerce-legend.has-total{padding-bottom:50px;position:relative}.woocommerce-legend.woocommerce-legend__direction-column{border-left:1px solid #ccc;min-width:320px}.woocommerce-chart__footer .woocommerce-legend.woocommerce-legend__direction-column{border-left:none}.woocommerce-legend__list{color:#24292d;display:flex;height:100%;margin:0}.woocommerce-legend__direction-column .woocommerce-legend__list{flex-direction:column;height:300px;overflow:auto}.woocommerce-chart__footer .woocommerce-legend__direction-column .woocommerce-legend__list{border-top:1px solid #ccc;height:100%;max-height:none;min-height:none}.has-total.woocommerce-legend__direction-column .woocommerce-legend__list{height:250px}.woocommerce-chart__footer .has-total.woocommerce-legend__direction-column .woocommerce-legend__list{height:auto;max-height:220px;min-height:none}.woocommerce-legend__direction-row .woocommerce-legend__list{flex-direction:row}.woocommerce-legend__item>button{display:flex;justify-content:center;align-items:center;background-color:#fff;color:#757575;cursor:pointer;display:inline-flex;flex-direction:row;flex-wrap:nowrap;justify-content:space-between;width:100%;border:none;padding:0}.woocommerce-legend__item>button .woocommerce-legend__item-container{display:flex;flex-direction:row;flex-wrap:nowrap;position:relative;padding:3px 24px 3px 0;font-size:13px;-webkit-user-select:none;-ms-user-select:none;-moz-user-select:none;user-select:none;width:100%}.woocommerce-legend__item>button .woocommerce-legend__item-container:hover input~.woocommerce-legend__item-checkmark{background-color:#e0e0e0}.woocommerce-legend__item>button .woocommerce-legend__item-container .woocommerce-legend__item-checkmark{border:1px solid #ccc;position:absolute;top:4px;right:0;height:16px;width:16px;background-color:#fff}.woocommerce-legend__item>button .woocommerce-legend__item-container .woocommerce-legend__item-checkmark:after{content:"";position:absolute;display:none}.woocommerce-legend__item>button .woocommerce-legend__item-container .woocommerce-legend__item-checkmark.woocommerce-legend__item-checkmark-checked{background-color:currentColor;border-color:currentColor}.woocommerce-legend__item>button .woocommerce-legend__item-container .woocommerce-legend__item-checkmark.woocommerce-legend__item-checkmark-checked:after{display:block;right:5px;top:2px;width:3px;height:6px;border:solid #fff;border-width:0 0 2px 2px;transform:rotate(-45deg)}.rtl .woocommerce-legend__item>button .woocommerce-legend__item-container .woocommerce-legend__item-checkmark.woocommerce-legend__item-checkmark-checked:after{transform:rotate(45deg) scaleX(-1)}.woocommerce-legend__item>button .woocommerce-legend__item-container .woocommerce-legend__item-total{margin-right:auto;font-weight:700}.woocommerce-legend__item>button:focus{outline:none}.woocommerce-legend__item>button:focus .woocommerce-legend__item-container .woocommerce-legend__item-checkmark{outline:2px solid #ccc}.woocommerce-legend__item>button:hover{background-color:#f0f0f0}.woocommerce-legend__direction-column .woocommerce-legend__item{margin:0;padding:0}.woocommerce-legend__direction-column .woocommerce-legend__item>button{min-height:36px;padding:0 17px;text-align:right}.woocommerce-legend__direction-column .woocommerce-legend__item:first-child{margin-top:12px}.woocommerce-legend__direction-column .woocommerce-legend__item:last-child:after{content:"";display:block;height:12px;width:100%}.woocommerce-legend__direction-row .woocommerce-legend__item{padding:0;margin:0}.woocommerce-legend__direction-row .woocommerce-legend__item>button{padding:0 17px}.woocommerce-legend__direction-row .woocommerce-legend__item>button .woocommerce-legend__item-container{height:50px;align-items:center}.woocommerce-legend__direction-row .woocommerce-legend__item>button .woocommerce-legend__item-container .woocommerce-legend__item-checkmark{top:17px}.woocommerce-legend__direction-row .woocommerce-legend__item>button .woocommerce-legend__item-container .woocommerce-legend__item-title{margin-left:17px}.woocommerce-legend__total{align-items:center;background:#fff;border-top:1px solid #ccc;bottom:0;color:#757575;display:flex;height:50px;justify-content:center;right:0;position:absolute;left:0;text-transform:uppercase}.woocommerce-legend__total:before{background:linear-gradient(-180deg,transparent,rgba(0,0,0,.2));bottom:100%;content:"";height:20px;right:0;opacity:0;pointer-events:none;position:absolute;left:0;transition:opacity .3s}.is-scrollable .woocommerce-legend__total:before{opacity:1}.woocommerce-chart__body-row .d3-chart__container{width:calc(100% - 320px)}.d3-chart__container{position:relative;width:100%}.d3-chart__container svg{overflow:visible}.d3-chart__container .d3-chart__empty-message{align-items:center;bottom:0;color:#757575;display:flex;font-size:18px;font-size:1.125rem;font-weight:700;justify-content:center;right:0;line-height:1.5;margin:0 auto;max-width:50%;padding-bottom:48px;pointer-events:none;position:absolute;left:0;top:0;text-align:center}@media (max-width:782px){.d3-chart__container .d3-chart__empty-message{font-size:13px;font-size:.8125rem}}.d3-chart__container .d3-chart__tooltip{border:1px solid #ccc;position:absolute;display:flex;min-width:324px;height:auto;background-color:#fff;text-align:right;padding:17px;box-shadow:0 3px 20px 0 rgba(18,24,30,.1),0 1px 3px 0 rgba(18,24,30,.1);flex-direction:column;flex-wrap:nowrap;justify-content:flex-start;pointer-events:none;visibility:hidden;z-index:1}@media (max-width:600px){.d3-chart__container .d3-chart__tooltip{min-width:auto;width:calc(100% - 48px)}}.d3-chart__container .d3-chart__tooltip h4{text-align:right;line-height:18px;width:100%;text-transform:uppercase;font-size:11px;color:#757575;margin-top:0}.d3-chart__container .d3-chart__tooltip ul{list-style:none;margin-bottom:2px;margin-top:2px;font-size:14px}.d3-chart__container .d3-chart__tooltip ul li{display:flex;flex-direction:row;flex-wrap:nowrap;justify-content:flex-start;align-items:center}.d3-chart__container .d3-chart__tooltip ul li.key-row{display:flex;flex-direction:row;justify-content:space-between;width:100%}.d3-chart__container .d3-chart__tooltip ul li.key-row .key-container{width:100%;min-width:100px}.d3-chart__container .d3-chart__tooltip ul li.key-row .key-container .key-color{display:inline-block;width:16px;height:16px;margin-left:8px}.d3-chart__container .d3-chart__tooltip ul li.key-row .key-container .key-key{margin-left:6px}.d3-chart__container .d3-chart__tooltip ul li.key-row .key-value{font-weight:600}.d3-chart__container .bargrouprect{shape-rendering:crispEdges}.d3-chart__container .grid .tick line{stroke:#f0f0f0;stroke-width:1;shape-rendering:crispEdges}.d3-chart__container .grid .tick:first-child line{stroke:#757575}.d3-chart__container .grid.with-positive-ticks .tick:last-child line{opacity:0}.d3-chart__container .tick{padding-top:10px;stroke-width:1}.d3-chart__container .y-axis{text-anchor:start}.d3-chart__container .y-axis.ticktext{fill:#757575}.d3-chart__container .axis-month .tick text,.d3-chart__container .y-axis .tick text{font-size:10px}.d3-chart__container .focus-grid line{stroke:rgba(0,0,0,.1);stroke-width:1px}.d3-chart__container .barfocus{fill:rgba(0,0,0,.1)}.d3-base{background:transparent;overflow-x:auto;overflow-y:hidden;position:relative;width:100%;height:100%}.woocommerce-count{border:1px solid;border-radius:10px;padding:0 8px;font-weight:700}.woocommerce-page .woocommerce-dropdown-button{background-color:#fff;position:relative;border:1px solid #757575;color:#1e1e1e;border-radius:4px;padding:0 0 0 40px;width:100%;height:auto}.woocommerce-page .woocommerce-dropdown-button:after{content:"";background:#1e1e1e;-webkit-mask:url(data:image/svg+xml;charset=US-ASCII,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M5%206l5%205%205-5%202%201-7%207-7-7%202-1z%22%20%2F%3E%3C%2Fsvg%3E) no-repeat right 0 top 55%;mask:url(data:image/svg+xml;charset=US-ASCII,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M5%206l5%205%205-5%202%201-7%207-7-7%202-1z%22%20%2F%3E%3C%2Fsvg%3E) no-repeat right 0 top 55%;position:absolute;left:14px;width:32px;height:48px}.woocommerce-page .woocommerce-dropdown-button.is-open:after{transform:translateX(-12px) translateY(2px) rotate(-180deg)}.woocommerce-page .woocommerce-dropdown-button.is-open,.woocommerce-page .woocommerce-dropdown-button:active,.woocommerce-page .woocommerce-dropdown-button:hover{color:#007cba;color:var(--wp-admin-theme-color)}.woocommerce-page .woocommerce-dropdown-button.is-open:after,.woocommerce-page .woocommerce-dropdown-button:active:after,.woocommerce-page .woocommerce-dropdown-button:hover:after{background:#007cba;background:var(--wp-admin-theme-color)}.woocommerce-page .woocommerce-dropdown-button.is-multi-line .woocommerce-dropdown-button__labels{flex-direction:column}.woocommerce-page .woocommerce-dropdown-button:not(:focus):not(.is-open){border-color:#757575}.woocommerce-dropdown-button__labels{text-align:right;padding:8px 12px;min-height:48px;display:flex;align-items:center;width:100%;justify-content:space-around}@media (max-width:400px){.woocommerce-dropdown-button__labels{min-height:46px}}.woocommerce-dropdown-button__labels span{width:100%;text-align:right}.woocommerce-dropdown-button__labels span:last-child{font-size:12px;font-size:.75rem;margin:0}.woocommerce-dropdown-button__labels span:first-child{font-size:13px;font-size:.8125rem;font-weight:600}@media (max-width:400px){.woocommerce-dropdown-button__labels span:last-child{font-size:10px;font-size:.625rem}.woocommerce-dropdown-button__labels span:first-child{font-size:12px;font-size:.75rem}}.woocommerce-ellipsis-menu{text-align:center}.woocommerce-ellipsis-menu__toggle{justify-content:center;vertical-align:middle;width:24px}.woocommerce-ellipsis-menu__toggle .dashicon{transform:rotate(-90deg)}.woocommerce-ellipsis-menu__popover{text-align:right}.woocommerce-ellipsis-menu__popover:not(.is-mobile):after,.woocommerce-ellipsis-menu__popover:not(.is-mobile):before{margin-right:-16px}.woocommerce-ellipsis-menu__popover .components-popover__content{width:182px;padding:2px}.woocommerce-ellipsis-menu__popover .woocommerce-ellipsis-menu__content{width:100%}.woocommerce-ellipsis-menu__popover .woocommerce-ellipsis-menu__item,.woocommerce-ellipsis-menu__popover .woocommerce-ellipsis-menu__title{padding:4px 12px}.woocommerce-ellipsis-menu__popover .woocommerce-ellipsis-menu__item{cursor:pointer;color:#757575}.woocommerce-ellipsis-menu__popover .woocommerce-ellipsis-menu__item:focus{box-shadow:inset 0 0 0 1px #6c7781,inset 0 0 0 2px #fff;outline:2px solid transparent;outline-offset:-2px}.woocommerce-ellipsis-menu__popover .woocommerce-ellipsis-menu__item .components-form-toggle{margin-left:8px}.woocommerce-ellipsis-menu__popover .components-base-control__label,.woocommerce-ellipsis-menu__popover .woocommerce-ellipsis-menu__title{color:#1e1e1e;padding-top:8px;padding-bottom:8px;font-size:15px;font-size:.9375rem;margin-bottom:4px}.woocommerce-ellipsis-menu__popover .components-toggle-control .components-base-control__field{margin:4px 0}.woocommerce-ellipsis-menu__popover .components-base-control{margin:0}.woocommerce-empty-content{margin-bottom:16px;text-align:center}.woocommerce-empty-content .woocommerce-empty-content__illustration{max-width:100%}.woocommerce-empty-content .woocommerce-empty-content__actions .components-button+.components-button{margin-right:16px}.woocommerce-filters-advanced{margin:24px 0}.woocommerce-filters-advanced .components-card__body{background-color:#f0f0f0}.woocommerce-filters-advanced .components-card__body.is-size-small:hover,.woocommerce-filters-advanced .components-card__body ul li:hover{background-color:#e0e0e0}.woocommerce-filters-advanced .components-select-control__input{height:38px;padding:0 8px 0 0;margin:0}.woocommerce-filters-advanced .components-card__header .components-base-control__field{margin-bottom:0}@media (max-width:782px){.woocommerce-filters-advanced{margin:16px 0;border:1px solid #ccc}}@media (max-width:400px){.woocommerce-filters-advanced{margin:12px 0}}.woocommerce-filters-advanced__title-select{width:70px;display:inline-block;margin:0 8px}.woocommerce-filters-advanced__list{margin:0}.woocommerce-filters-advanced__list-item{padding:0 0 0 16px;margin:0;display:-ms-grid;display:grid;-ms-grid-columns:1fr 40px;grid-template-columns:1fr 40px;border-bottom:1px solid #ccc}.woocommerce-filters-advanced__list-item:hover{background-color:#e0e0e0}.woocommerce-filters-advanced__list-item .woocommerce-filters-advanced__line-item:first-child{-ms-grid-column:1;grid-column-start:1;-ms-grid-column-span:1;grid-column-end:2;-ms-grid-row:1;grid-row-start:1;-ms-grid-row-span:1;grid-row-end:2}.woocommerce-filters-advanced__list-item .woocommerce-filters-advanced__line-item:nth-child(2){-ms-grid-column:2;grid-column-start:2;-ms-grid-column-span:1;grid-column-end:3;-ms-grid-row:1;grid-row-start:1;-ms-grid-row-span:1;grid-row-end:2}.woocommerce-filters-advanced__list-item fieldset{padding:8px 16px 8px 8px}.woocommerce-filters-advanced__list-item .woocommerce-filters-advanced__remove{width:40px;height:38px;-ms-grid-row-align:center;align-self:center;color:#757575;padding:8px}@media (max-width:400px){.woocommerce-filters-advanced__list-item .woocommerce-filters-advanced__remove{position:absolute;top:0;left:4px}}.woocommerce-filters-advanced__list-item .components-form-token-field{border-radius:4px}@media (max-width:400px){.woocommerce-filters-advanced__list-item{display:block;position:relative;padding:8px 0 0 8px}}.woocommerce-filters-advanced__add-filter{margin:0;display:block}.woocommerce-filters-advanced__add-filter div div{display:inline-block}.woocommerce-filters-advanced__add-filter .components-popover:not(.is-mobile) .components-popover__content{min-width:180px}.woocommerce-filters-advanced__add-filter .components-popover__content>div{width:100%}.woocommerce-filters-advanced__fieldset{display:flex;align-items:center}.woocommerce-filters-advanced__fieldset>div{padding:0 4px}@media (max-width:782px){.woocommerce-filters-advanced__fieldset>div{width:100%;padding:4px 0}}@media (max-width:782px){.woocommerce-filters-advanced__fieldset{display:block}}.woocommerce-filters-advanced__fieldset.is-english{display:-ms-grid;display:grid;-ms-grid-columns:100px 150px 1fr;grid-template-columns:100px 150px 1fr}.woocommerce-filters-advanced__fieldset.is-english .woocommerce-filters-advanced__fieldset-item:first-child{-ms-grid-column:1;grid-column-start:1;-ms-grid-column-span:1;grid-column-end:2;-ms-grid-row:1;grid-row-start:1;-ms-grid-row-span:1;grid-row-end:2}.woocommerce-filters-advanced__fieldset.is-english .woocommerce-filters-advanced__fieldset-item:nth-child(2){-ms-grid-column:2;grid-column-start:2;-ms-grid-column-span:1;grid-column-end:3;-ms-grid-row:1;grid-row-start:1;-ms-grid-row-span:1;grid-row-end:2}.woocommerce-filters-advanced__fieldset.is-english .woocommerce-filters-advanced__fieldset-item:nth-child(3){-ms-grid-column:3;grid-column-start:3;-ms-grid-column-span:1;grid-column-end:4;-ms-grid-row:1;grid-row-start:1;-ms-grid-row-span:1;grid-row-end:2}.woocommerce-filters-advanced__fieldset.is-english .woocommerce-filters-advanced__fieldset-item:first-child{display:flex;align-items:center}.woocommerce-filters-advanced__fieldset.is-english .woocommerce-filters-advanced__fieldset-item .components-base-control__field{margin-bottom:0}@media (max-width:782px){.woocommerce-filters-advanced__fieldset.is-english{display:block}}.woocommerce-filters-advanced__rule{width:150px}.woocommerce-filters-advanced__input{width:100%}.woocommerce-filters-advanced__input.woocommerce-search.woocommerce-select-control .woocommerce-select-control__control{height:38px}.woocommerce-filters-advanced__add-filter-dropdown{display:inline-block}.woocommerce-filters-advanced__add-button{align-items:center;color:#757575;padding:8px}.woocommerce-filters-advanced__add-button svg{fill:currentColor;margin:0 0 0 6px}.woocommerce-filters-advanced__controls .components-button{margin-left:16px}.woocommerce-filters-advanced__add-dropdown{padding:8px 0}.woocommerce-filters-advanced__add-dropdown li{margin:0}.woocommerce-filters-advanced__add-dropdown .components-button{width:100%;padding:8px}.woocommerce-filters-advanced__add-dropdown .components-button:hover{background-color:#e0e0e0}.woocommerce-filters-advanced__add-dropdown .components-button:not(:disabled):not([aria-disabled=true]):focus{background-color:#f0f0f0;box-shadow:none}.woocommerce-filters-advanced__input-range{align-items:center;display:-ms-grid;display:grid;-ms-grid-columns:1fr;grid-template-columns:1fr}.woocommerce-filters-advanced__input-range.is-between{-ms-grid-columns:1fr 36px 1fr;grid-template-columns:1fr 36px 1fr}.woocommerce-filters-advanced__input-range input{height:38px;margin:0}.woocommerce-filters-advanced__input-range .separator{text-align:center}.woocommerce-filters-advanced__attribute-fieldset{align-items:center;display:-ms-grid;display:grid;-ms-grid-columns:1fr 20px 1fr;grid-template-columns:1fr 20px 1fr}.woocommerce-filters-advanced__attribute-fieldset .woocommerce-filters-advanced__attribute-field-separator{padding:0 6px}.woocommerce-filters-date__content.is-mobile .components-popover__header{border:none;height:0}.woocommerce-filters-date__content.is-mobile .components-popover__close{transform:translateY(22px)}.woocommerce-filters-date__content.is-mobile .components-tab-panel__tab-content{height:calc(100% - 46px);overflow:auto}.woocommerce-filters-date__content.components-dropdown__content .components-popover__content>div{padding:0}.woocommerce-filters-date__tabs{height:calc(100% - 42px);border-top:1px solid #ccc}.woocommerce-filters-date__tabs .components-tab-panel__tabs{display:flex;justify-content:space-between}.woocommerce-filters-date__tabs .components-tab-panel__tabs .components-button{display:block;text-align:center;width:50%}.woocommerce-filters-date__tabs .components-tab-panel__tab-content{display:flex;flex-direction:column;align-items:center}.woocommerce-filters-date__tabs:first-child{-ms-grid-column:1;grid-column-start:1;-ms-grid-column-span:1;grid-column-end:2;-ms-grid-row:1;grid-row-start:1;-ms-grid-row-span:1;grid-row-end:2}.woocommerce-filters-date__tabs:nth-child(2){-ms-grid-column:2;grid-column-start:2;-ms-grid-column-span:1;grid-column-end:3;-ms-grid-row:1;grid-row-start:1;-ms-grid-row-span:1;grid-row-end:2}.woocommerce-filters-date__text{font-size:12px;font-size:.75rem;font-weight:100;text-transform:uppercase;text-align:center;color:#757575;width:100%;margin:0;padding:1em;background-color:#fff}.woocommerce-filters-date__content-controls{display:flex;flex-direction:column;width:100%;align-items:center;padding-bottom:1em;background-color:#fff}.woocommerce-filters-date__content-controls.is-custom{border-top:1px solid #ccc}.woocommerce-filters-date__button-group{padding-top:1em;display:flex;justify-content:center;width:100%}.woocommerce-filters-date__button-group .woocommerce-filters-date__button{justify-content:center;width:40%;height:34px;margin:0 12px}.woocommerce-filters-filter__content.is-mobile .components-popover__header-title{font-size:12px;font-size:.75rem;font-weight:100;text-transform:uppercase;text-align:center;color:#757575}.woocommerce-filters-filter__content.is-mobile .woocommerce-filters-filter__content-list-item:last-child{border-bottom:1px solid #ccc}.woocommerce-filters-filter__content-list{margin:0;width:100%;min-width:100%}.woocommerce-filters-filter__content-list-item{border:1px solid transparent;border-bottom-color:#ccc;margin:0}.woocommerce-filters-filter__content-list-item:last-child{border-bottom:1px solid transparent}.woocommerce-filters-filter__content-list-item.is-selected .woocommerce-filters-filter__button,.woocommerce-filters-filter__content-list-item.is-selected .woocommerce-filters-filter__button.components-button:not(:disabled):not([aria-disabled=true]):focus{background-color:#fff}.woocommerce-filters-filter__content-list-item.is-selected .woocommerce-filters-filter__button:before{content:"";width:8px;height:8px;background-color:#7f54b3;position:absolute;top:50%;right:1em;transform:translate(-50%,-50%)}.woocommerce-filters-filter__content-list-item .woocommerce-filters-filter__button{position:relative;align-items:center;display:flex;width:100%;padding:1em 3em 1em 1em;background-color:#f0f0f0;text-align:right}.woocommerce-filters-filter__content-list-item .woocommerce-filters-filter__button.components-button{color:#757575}.woocommerce-filters-filter__content-list-item .woocommerce-filters-filter__button:hover{background-color:#e0e0e0;color:#757575}.woocommerce-filters-filter__content-list-item .woocommerce-filters-filter__button.components-button:not(:disabled):not([aria-disabled=true]):focus{background-color:#f0f0f0}.woocommerce-filters-filter__content-list-item .woocommerce-filters-filter__button svg{position:absolute;right:1em}.woocommerce-filters .components-base-control__field{margin-bottom:0}@media (max-width:400px){.woocommerce-filters{margin-right:-8px;margin-left:-8px}}.woocommerce-filters__basic-filters{display:flex;margin-bottom:24px}@media (max-width:1280px){.woocommerce-filters__basic-filters{flex-direction:column}}@media (max-width:782px){.woocommerce-filters__basic-filters{margin-bottom:16px}}.woocommerce-filters__advanced-filters .components-card__body{background-color:#f0f0f0}.woocommerce-filters__advanced-filters .components-card__footer .components-button{margin-left:16px}.woocommerce-filters-filter{width:25%;padding:0 12px;min-height:82px;display:flex;flex-direction:column;justify-content:flex-end}.woocommerce-filters-filter:first-child{padding-right:0}.woocommerce-filters-filter:last-child{padding-left:0}@media (max-width:1440px){.woocommerce-filters-filter{width:33.3%}}@media (max-width:1280px){.woocommerce-filters-filter{width:50%;padding:0;min-height:78px}}@media (max-width:782px){.woocommerce-filters-filter{width:100%}}.woocommerce-filters-label{margin:7px 0;display:block}@media (max-width:1280px){.woocommerce-filters-label{margin:5px 0}}.woocommerce-filters-date__content .components-popover__content,.woocommerce-filters-filter__content .components-popover__content{width:320px;border:1px solid #ccc;background-color:#fff}.woocommerce-filters-date__content .woocommerce-calendar__input-error .components-popover__content,.woocommerce-filters-filter__content .woocommerce-calendar__input-error .components-popover__content{background-color:#757575}.woocommerce-filters-date__content.is-mobile .components-popover__content,.woocommerce-filters-filter__content.is-mobile .components-popover__content{width:100%;height:100%;border:none}.woocommerce-filters-filter__search .woocommerce-search__autocomplete-results{position:static}.woocommerce-filters-filter__search .woocommerce-search__inline-container{overflow:hidden}.woocommerce-filters-filter__search .woocommerce-search__inline-container:not(.is-active){border:none}.woocommerce-filters-advanced__list-item .components-base-control+.components-base-control{margin-bottom:0}.woocommerce-flag span{vertical-align:middle}.woocommerce-flag .woocommerce-flag__fallback{background:#f0f0f0;color:transparent;width:24px;height:18px;display:block;overflow:hidden}.woocommerce-gravatar{border-radius:50%}.woocommerce-image-upload .woocommerce-image-upload__image-preview{font-size:16px;margin-left:2em}.woocommerce-image-upload .woocommerce-image-upload__image-preview img{max-width:240px;height:auto}.woocommerce-image-upload .woocommerce-image-upload__add-image{margin:16px 0}.woocommerce-image-upload.has-image{display:flex;align-items:center}.woocommerce-list{margin:0;padding:0}a.woocommerce-list__item{color:inherit}.woocommerce-list__item{display:flex;align-items:center;margin-bottom:0;text-decoration:none;background-color:#fff}.woocommerce-list__item.has-gutters{padding:16px 24px}.woocommerce-list__item.has-action{cursor:pointer}.woocommerce-list__item:focus{box-shadow:inset 0 0 0 1px #006088,inset 0 0 0 2px #fff}.woocommerce-list__item:focus-visible{box-shadow:none}.woocommerce-list__item:not(.transitions-disabled).woocommerce-list__item-enter{opacity:0;max-height:0;transform:translateX(-50%)}.woocommerce-list__item:not(.transitions-disabled).woocommerce-list__item-enter-active{opacity:1;max-height:100vh;transform:translateX(0);transition:opacity .5s,transform .5s,max-height .5s}.woocommerce-list__item:not(.transitions-disabled).woocommerce-list__item-exit{opacity:1;max-height:100vh;transform:translateX(0)}.woocommerce-list__item:not(.transitions-disabled).woocommerce-list__item-exit-active{opacity:0;max-height:0;transform:translateX(-50%);transition:opacity .5s,transform .5s,max-height .5s}.woocommerce-list__item>.woocommerce-list__item-inner{text-decoration:none;width:100%;display:flex;align-items:center;padding:16px 24px}.woocommerce-list__item>.woocommerce-list__item-inner:focus{box-shadow:inset 0 0 0 1px #006088,inset 0 0 0 2px #fff}.woocommerce-list__item .woocommerce-list__item-title{color:#1d2327}.woocommerce-list__item .woocommerce-list__item-content{margin-top:4px;display:block;font-size:14px;line-height:20px;color:#50575d}.woocommerce-list__item .woocommerce-list__item-before{margin-left:20px;display:flex;align-items:center}.woocommerce-list__item .woocommerce-list__item-after{display:flex;align-items:center;margin-right:auto}.woocommerce-list__item:not(:first-child){border-top:1px solid #f0f0f0}.woocommerce-list__item:hover{background-color:#f0f0f0}.woocommerce-list__item:hover .woocommerce-list__item-title{color:#007cba;color:var(--wp-admin-theme-color)}.woocommerce-list__item:hover .woocommerce-list__item-before>svg{fill:#007cba;fill:var(--wp-admin-theme-color)}.woocommerce-list__item .woocommerce-list__item-title{color:#007cba;color:var(--wp-admin-theme-color)}.woocommerce-list__item .woocommerce-list__item-before>svg{fill:#007cba;fill:var(--wp-admin-theme-color)}.woocommerce-list__item .woocommerce-list__item-after>svg{fill:#1e1e1e}.woocommerce-list__item.is-complete .woocommerce-task__icon{background-color:#007cba;background-color:var(--wp-admin-theme-color)}.woocommerce-list__item.is-complete .woocommerce-list__item-title{color:#757575}.woocommerce-list__item.is-complete .woocommerce-list__item-content{display:none}.woocommerce-list__item-title{color:#2c3338}.woocommerce-list__item-content{color:#646970}.woocommerce-order-status{display:flex;align-items:center}.woocommerce-order-status__indicator{min-width:16px;width:16px;height:16px;display:block;background:#ccc;margin-left:8px;border-radius:50%;border:3px solid #f0f0f0}.woocommerce-order-status__indicator.is-processing{background:#4ab866;border-color:#93d5a4}.woocommerce-order-status__indicator.is-on-hold{background:#ffb900;border-color:#ffd566}.woocommerce-pagination{display:flex;flex-direction:row;flex-wrap:nowrap;justify-content:center;align-items:center}@media (max-width:782px){.woocommerce-pagination{flex-direction:column}}.woocommerce-pagination input{border-radius:4px}.woocommerce-pagination__page-arrows{display:flex;flex-direction:row}.woocommerce-pagination__page-arrows-buttons{display:inline-flex;align-items:baseline;border:1px solid #b5bfc9;border-radius:4px;background:#f0f2f4}.woocommerce-pagination__page-arrows-buttons .components-button{color:#24292d;height:30px;width:32px;justify-content:center}.woocommerce-pagination__page-arrows-buttons .components-button:not(:disabled):not([aria-disabled=true]):hover{color:#757575}.woocommerce-pagination__page-arrows-buttons button:first-child{border-top-left-radius:0;border-bottom-left-radius:0;border-left:2px solid #d3d9de}.woocommerce-pagination__page-arrows-buttons button:last-child{border-top-right-radius:0;border-bottom-right-radius:0}.woocommerce-pagination__page-arrows-buttons .woocommerce-pagination__link{padding:4px}.woocommerce-pagination__page-arrows-label{margin-top:8px;margin-left:8px}.woocommerce-pagination__page-picker{margin-right:16px}@media (max-width:782px){.woocommerce-pagination__page-picker{margin-top:16px;margin-right:0}}.woocommerce-pagination__page-picker .woocommerce-pagination__page-picker-input{margin-right:8px;width:60px;height:34px;box-shadow:none}.woocommerce-pagination__per-page-picker{margin-right:16px}@media (max-width:782px){.woocommerce-pagination__per-page-picker{margin-top:16px;margin-right:0}}.woocommerce-pagination__per-page-picker .components-base-control{margin-bottom:0}.woocommerce-pagination__per-page-picker .components-base-control .components-base-control__field{display:flex;flex-direction:row;align-items:baseline;margin-bottom:0}.woocommerce-pagination__per-page-picker .components-base-control .components-select-control__input{width:60px;height:34px;box-shadow:none}.woocommerce-pagination__per-page-picker .components-base-control .components-base-control__label{margin-left:8px}.woocommerce-pagination__page-picker-input.has-error,.woocommerce-pagination__page-picker-input.has-error:focus{border-color:#d94f4f;box-shadow:0 0 2px #d94f4f}.woocommerce-pill{border:1px solid #757575;border-radius:28px;color:#757575;display:inline-block;padding:4px 8px}@media (max-width:320px){.woocommerce-pill{font-size:11px}}.woocommerce-product-image{border-radius:2px}.woocommerce-rating{position:relative;vertical-align:middle;display:inline-block;overflow:hidden;white-space:nowrap}.woocommerce-rating .gridicon{fill:#e0e0e0}.woocommerce-rating .woocommerce-rating__star-outline{position:absolute;right:0;top:0;white-space:nowrap;overflow:hidden}.woocommerce-rating .woocommerce-rating__star-outline .gridicon{fill:#757575}.woocommerce-search.woocommerce-select-control{position:relative}.woocommerce-search.woocommerce-select-control .woocommerce-select-control__control-icon{position:absolute;top:50%;right:10px;transform:translateY(-50%);color:#ccc;font-size:20px}.woocommerce-search.woocommerce-select-control:not(.has-inline-tags) .woocommerce-tag{margin:8px 0 0 6px}.woocommerce-search.woocommerce-select-control .woocommerce-select-control__control{height:auto;font-size:13px;width:100%;padding:3px 36px 3px 2px;border-radius:4px;border:1px solid #757575;box-shadow:0 2px 6px rgba(0,0,0,.05)}.woocommerce-search.woocommerce-select-control .woocommerce-select-control__control.is-active{border-color:#007cba;border-color:var(--wp-admin-theme-color)}.woocommerce-search.woocommerce-select-control .components-base-control .woocommerce-select-control__control-input{margin:0;font-size:13px;min-height:auto}.woocommerce-search.woocommerce-select-control .components-base-control .woocommerce-select-control__control-input[type=number]::-webkit-inner-spin-button,.woocommerce-search.woocommerce-select-control .components-base-control .woocommerce-select-control__control-input[type=number]::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}.woocommerce-search.woocommerce-select-control .components-base-control .components-base-control__label{font-size:13px;color:#72777c;margin:0;width:calc(100% - 36px);top:50%;right:36px}.woocommerce-search.woocommerce-select-control.has-inline-tags .has-tags.components-base-control .components-base-control__label,.woocommerce-search.woocommerce-select-control .is-active.components-base-control .components-base-control__label,.woocommerce-search.woocommerce-select-control .with-value.components-base-control .components-base-control__label{display:none}.woocommerce-search.woocommerce-select-control .components-base-control .woocommerce-select-control__tags{margin:0}.woocommerce-search.woocommerce-select-control .components-base-control .woocommerce-tag{max-height:24px}.woocommerce-search.woocommerce-select-control .woocommerce-select-control__listbox{border:1px solid #ccc;top:38px}.woocommerce-search.woocommerce-select-control.is-static-results .woocommerce-select-control__listbox{position:static}.woocommerce-search.woocommerce-select-control .woocommerce-select-control__option{margin-bottom:0;display:flex;flex-direction:row;flex-grow:1;flex-shrink:0;align-items:center;padding:12px;color:#7f54b3;text-align:right;background:#f0f0f0;border-bottom:1px solid #f0f0f0;font-size:13px;min-height:43px}.woocommerce-search.woocommerce-select-control .woocommerce-select-control__option:last-of-type{border-bottom:none}.woocommerce-search.woocommerce-select-control .woocommerce-select-control__option:hover{box-shadow:none;color:#7f54b3;background:#e0e0e0}.woocommerce-search.woocommerce-select-control .woocommerce-select-control__option.is-selected,.woocommerce-search.woocommerce-select-control .woocommerce-select-control__option:active,.woocommerce-search.woocommerce-select-control .woocommerce-select-control__option:focus{color:#7f54b3;background:#fff;box-shadow:inset 0 0 0 1px #e0e0e0,inset 0 0 0 2px #24292d}.woocommerce-search.woocommerce-select-control .woocommerce-select-control__option .woocommerce-search__result-thumbnail{margin-left:12px}.woocommerce-search__result-name{text-decoration:underline}.woocommerce-search-list{width:100%;padding:0 0 16px;text-align:right}.woocommerce-search-list__selected{margin:16px 0;padding:16px 0 0;min-height:76px;border-top:1px solid #f0f0f0}.woocommerce-search-list__selected .woocommerce-search-list__selected-header{margin-bottom:8px}.woocommerce-search-list__selected .woocommerce-search-list__selected-header button{margin-right:12px}.woocommerce-search-list__selected .woocommerce-tag__text{max-width:13em}.woocommerce-search-list__selected ul{list-style:none}.woocommerce-search-list__selected ul li{float:right}.woocommerce-search-list__search{margin:16px 0;padding:16px 0 0;border-top:1px solid #f0f0f0}.woocommerce-search-list__search .components-base-control__field{margin-bottom:16px}.woocommerce-search-list__list{border:1px solid #e0e0e0;padding:0;max-height:17em;overflow-x:hidden;overflow-y:auto}.woocommerce-search-list__list li{margin-bottom:0}.woocommerce-search-list__list.is-loading,.woocommerce-search-list__list.is-not-found{padding:12px 0;text-align:center;border:none}.woocommerce-search-list__list.is-not-found .woocommerce-search-list__not-found-icon,.woocommerce-search-list__list.is-not-found .woocommerce-search-list__not-found-text{display:inline-block}.woocommerce-search-list__list.is-not-found .woocommerce-search-list__not-found-icon{margin-left:16px}.woocommerce-search-list__list.is-not-found .woocommerce-search-list__not-found-icon .gridicon{vertical-align:top;margin-top:-1px}.woocommerce-search-list__list .components-spinner{float:none;margin:0 auto}.woocommerce-search-list__list .components-menu-group__label{clip:rect(1px,1px,1px,1px);-webkit-clip-path:inset(50%);clip-path:inset(50%);height:1px;width:1px;margin:-1px;overflow:hidden;overflow-wrap:normal!important;word-wrap:normal!important}.woocommerce-search-list__list>[role=menu]{border:1px solid #f0f0f0;border-bottom:none}.woocommerce-search-list__list .woocommerce-search-list__item{display:flex;align-items:center;margin-bottom:0;padding:12px 16px;background:#fff;border-bottom:1px solid #f0f0f0;color:#757575}.woocommerce-search-list__list .woocommerce-search-list__item:active,.woocommerce-search-list__list .woocommerce-search-list__item:focus,.woocommerce-search-list__list .woocommerce-search-list__item:hover{background:#f0f0f0}.woocommerce-search-list__list .woocommerce-search-list__item:active,.woocommerce-search-list__list .woocommerce-search-list__item:focus{box-shadow:none}.woocommerce-search-list__list .woocommerce-search-list__item .woocommerce-search-list__item-input{margin:0 0 0 8px}.woocommerce-search-list__list .woocommerce-search-list__item .woocommerce-search-list__item-label{display:flex;flex:1}.woocommerce-search-list__list .woocommerce-search-list__item.depth-0+.depth-1{margin-top:-1px}.woocommerce-search-list__list .woocommerce-search-list__item:not(.depth-0){border-bottom:0!important}.woocommerce-search-list__list .woocommerce-search-list__item:not(.depth-0)+.depth-0{border-top:1px solid #f0f0f0}.woocommerce-search-list__list .woocommerce-search-list__item[class*=depth-] .woocommerce-search-list__item-label:before{margin-left:4px;content:"— — — — — "}.woocommerce-search-list__list .woocommerce-search-list__item.depth-0 .woocommerce-search-list__item-label:before{margin-left:0;content:""}.woocommerce-search-list__list .woocommerce-search-list__item.depth-1 .woocommerce-search-list__item-label:before{content:"— "}.woocommerce-search-list__list .woocommerce-search-list__item.depth-2 .woocommerce-search-list__item-label:before{content:"— — "}.woocommerce-search-list__list .woocommerce-search-list__item.depth-3 .woocommerce-search-list__item-label:before{content:"— — — "}.woocommerce-search-list__list .woocommerce-search-list__item.depth-4 .woocommerce-search-list__item-label:before{content:"— — — — "}.woocommerce-search-list__list .woocommerce-search-list__item .woocommerce-search-list__item-name{display:inline-block}.woocommerce-search-list__list .woocommerce-search-list__item .woocommerce-search-list__item-prefix{display:none;color:#757575}.woocommerce-search-list__list .woocommerce-search-list__item.is-searching .woocommerce-search-list__item-label,.woocommerce-search-list__list .woocommerce-search-list__item.is-skip-level .woocommerce-search-list__item-label{display:inline-block}.woocommerce-search-list__list .woocommerce-search-list__item.is-searching .woocommerce-search-list__item-prefix,.woocommerce-search-list__list .woocommerce-search-list__item.is-skip-level .woocommerce-search-list__item-prefix{display:inline}.woocommerce-search-list__list .woocommerce-search-list__item.is-searching .woocommerce-search-list__item-prefix:after,.woocommerce-search-list__list .woocommerce-search-list__item.is-skip-level .woocommerce-search-list__item-prefix:after{margin-left:4px;content:" ›"}.woocommerce-search-list__list .woocommerce-search-list__item.is-searching .woocommerce-search-list__item-name{color:#1e1e1e}.woocommerce-search-list__list .woocommerce-search-list__item.has-count>.components-menu-item__item{width:100%}.woocommerce-search-list__list .woocommerce-search-list__item .woocommerce-search-list__item-count{flex:0 1 auto;padding:2px 8px;border:1px solid #f0f0f0;border-radius:12px;font-size:.8em;line-height:1.4;color:#757575;background:#fff;white-space:nowrap}.woocommerce-search-list__list li:last-child .woocommerce-search-list__item{border-bottom:none}.woocommerce-search-list.is-compact .woocommerce-search-list__selected{margin:0 0 16px;padding:0;border-top:none;min-height:54px}.woocommerce-search-list.is-compact .woocommerce-search-list__search{margin:0 0 16px;padding:0;border-top:none}.woocommerce-section-header{padding:13px;border-bottom:none;display:flex;justify-content:space-between}@media (max-width:782px){.woocommerce-section-header{margin-right:-16px;margin-left:-16px;margin-bottom:12px;border-right:none;border-left:none;width:auto}}.woocommerce-section-header hr{-ms-grid-row-align:center;align-self:center;flex-grow:1;height:1px;margin:0 10px}@media (max-width:782px){.woocommerce-section-header.has-interval-select{position:relative;padding-bottom:30px}.woocommerce-section-header.has-interval-select .woocommerce-chart__interval-select{position:absolute;right:0;bottom:0;padding-right:6px}}.woocommerce-section-header__actions,.woocommerce-section-header__menu{text-align:left}.woocommerce-section-header__actions{display:flex;flex-grow:1;justify-content:flex-end}.woocommerce-section-header__actions .components-base-control{padding-top:0;min-height:34px}.woocommerce-section-header__actions .components-base-control .components-base-control__field{margin-bottom:0}.woocommerce-section-header__actions .components-base-control .components-base-control__field select{background:transparent}.woocommerce-ellipsis-menu__toggle{padding:0}.woocommerce-section-header__menu{display:flex;flex-direction:column;justify-content:center}.woocommerce-section-header__title{margin:0 0 0 16px;padding:3px 0;font-size:20px;font-size:1.25rem;line-height:2.2;font-weight:400}.woocommerce-segmented-selection{width:100%;color:#757575}.woocommerce-segmented-selection__container{width:100%;-ms-grid-columns:1fr 1fr;grid-template-columns:1fr 1fr;display:-ms-grid;display:grid;border-top:1px solid #ccc;border-bottom:1px solid #ccc;background-color:#ccc}.woocommerce-segmented-selection__item:nth-child(2n){border-right:1px solid #ccc;border-top:1px solid #ccc}.woocommerce-segmented-selection__item:nth-child(odd){border-top:1px solid #ccc}.woocommerce-segmented-selection__item:nth-child(-n+2){border-top:0}.woocommerce-segmented-selection__label{background-color:#f0f0f0;padding:12px 36px 12px 12px;position:relative;display:block;height:100%}.woocommerce-segmented-selection__label:active,.woocommerce-segmented-selection__label:hover{background-color:#e0e0e0}.woocommerce-segmented-selection__input{opacity:0;position:absolute;right:-9999px}.woocommerce-segmented-selection__input:active+label .woocommerce-segmented-selection__label{background-color:#e0e0e0}.woocommerce-segmented-selection__input:checked+label .woocommerce-segmented-selection__label{background-color:#fff;font-weight:600}.woocommerce-segmented-selection__input:checked+label .woocommerce-segmented-selection__label:before{content:"";width:8px;height:8px;background-color:#007cba;background-color:var(--wp-admin-theme-color);position:absolute;top:50%;transform:translate(20px,-50%)}.woocommerce-segmented-selection__input:focus+label .woocommerce-segmented-selection__label{box-shadow:inset 0 0 0 1px #24292d}.woocommerce-select-control{position:relative}.woocommerce-select-control .components-base-control{height:56px;display:flex;align-items:center;border:1px solid #a7aaad;border-radius:3px;background:#fff;padding:12px;position:relative}.woocommerce-select-control .components-base-control .woocommerce-select-control__tags{margin:12px 0 0 4px}.woocommerce-select-control .components-base-control .woocommerce-tag{max-height:20px}.woocommerce-select-control .components-base-control .components-base-control__field{display:flex;align-items:center;flex:1;margin-bottom:0;max-width:100%}.woocommerce-select-control .components-base-control .components-base-control__label{position:absolute;top:50%;transform:translateY(-50%);color:#646970;font-size:16px}.woocommerce-select-control .components-base-control .woocommerce-select-control__control-input{font-size:16px;border:0;box-shadow:none;color:#2c3338;margin:12px 0 0;padding-right:0;padding-left:0;width:100%;line-height:24px;text-align:right;letter-spacing:inherit;background:transparent}.woocommerce-select-control .components-base-control .woocommerce-select-control__control-input::-webkit-search-cancel-button{display:none}.woocommerce-select-control .components-base-control .woocommerce-select-control__control-input:focus{outline:none}.woocommerce-select-control .components-base-control i{color:#636d75;margin-left:12px;width:24px}.woocommerce-select-control .components-base-control.is-active{box-shadow:0 0 0 1px #006088;border-color:#006088}.woocommerce-select-control .components-base-control.has-tags .components-base-control__label,.woocommerce-select-control .components-base-control.with-value .components-base-control__label{font-size:12px;margin-top:-12px}.woocommerce-select-control .components-base-control.is-disabled{opacity:.5}.woocommerce-select-control .components-base-control.is-disabled .components-base-control__label{cursor:default}.woocommerce-select-control .woocommerce-select-control__autofill-input{position:absolute;z-index:-1}.woocommerce-select-control .woocommerce-select-control__tags{position:relative;margin:12px 0 0}.woocommerce-select-control .woocommerce-select-control__tags.has-clear{padding-left:24px}.woocommerce-select-control .woocommerce-tag{max-height:24px}.woocommerce-select-control .woocommerce-select-control__clear{position:absolute;left:10px;top:calc(50% - 10px)}.woocommerce-select-control .woocommerce-select-control__clear>.dashicon{color:#c9c9c9}.woocommerce-select-control .woocommerce-select-control__listbox{background:#fff;display:flex;flex-direction:column;align-items:stretch;box-shadow:0 3px 5px rgba(0,0,0,.2),0 1px 18px rgba(0,0,0,.12),0 6px 10px rgba(0,0,0,.14);border-radius:3px;position:absolute;right:0;left:0;top:57px;z-index:10;overflow-y:auto;max-height:350px}.woocommerce-select-control .woocommerce-select-control__listbox.is-static{position:static}.woocommerce-select-control .woocommerce-select-control__option{padding:16px;min-height:56px;font-size:16px;text-align:right}.woocommerce-select-control .woocommerce-select-control__option.is-selected,.woocommerce-select-control .woocommerce-select-control__option:hover{background:#f6f7f7}.woocommerce-select-control.is-searchable .components-base-control__label{right:48px}.woocommerce-select-control.is-searchable .components-base-control.is-active .components-base-control__label{font-size:12px;margin-top:-12px}.woocommerce-stepper .woocommerce-stepper__steps{display:flex;justify-content:space-around;margin-bottom:24px}.woocommerce-stepper .woocommerce-stepper__step{padding:8px;font-weight:400;position:relative}.woocommerce-stepper .woocommerce-stepper__step .woocommerce-stepper__step-label-wrapper{display:flex;text-align:right;border:0;background-color:transparent;padding:0}.woocommerce-stepper .woocommerce-stepper__step .woocommerce-stepper__step-label-wrapper:focus{outline:none;box-shadow:none}.woocommerce-stepper .woocommerce-stepper__step button.woocommerce-stepper__step-label-wrapper{cursor:pointer}.woocommerce-stepper .woocommerce-stepper__step .woocommerce-stepper__step-text{width:100%}.woocommerce-stepper .woocommerce-stepper__step .woocommerce-stepper__step-label{color:#1e1e1e;line-height:24px;font-size:16px}.woocommerce-stepper .woocommerce-stepper__step .woocommerce-stepper__step-description{display:none;font-size:14px;color:#757575;font-weight:400;margin-top:2px}.woocommerce-stepper .woocommerce-stepper__step .woocommerce-stepper__step-icon svg{display:none}.woocommerce-stepper .woocommerce-stepper__step .woocommerce-spinner{display:block;margin-left:12px;max-height:24px;min-width:24px;width:24px;border-radius:50%;background:#007cba;background:var(--wp-admin-theme-color)}.woocommerce-stepper .woocommerce-stepper__step .woocommerce-spinner__circle{stroke:#fff}.woocommerce-stepper .woocommerce-stepper__step.is-active .woocommerce-stepper__step-icon,.woocommerce-stepper .woocommerce-stepper__step.is-complete .woocommerce-stepper__step-icon{background:#007cba;background:var(--wp-admin-theme-color);color:#fff}.woocommerce-stepper .woocommerce-stepper__step.is-active .woocommerce-stepper__step-label,.woocommerce-stepper .woocommerce-stepper__step.is-complete .woocommerce-stepper__step-label{color:#1e1e1e}.woocommerce-stepper .woocommerce-stepper__step.is-active .woocommerce-stepper__step-icon{font-weight:600}.woocommerce-stepper .woocommerce-stepper__step.is-active .woocommerce-stepper__step-label{font-weight:600;margin:0}.woocommerce-stepper .woocommerce-stepper__step.is-complete .woocommerce-stepper__step-number{display:none}.woocommerce-stepper .woocommerce-stepper__step.is-complete svg{display:inline}.woocommerce-stepper .woocommerce-stepper__step-icon{font-size:16px;display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;min-width:24px;margin-left:12px;background:#f0f0f0;color:#757575;border-radius:50%}.woocommerce-stepper .woocommerce-stepper__step-divider{align-self:flex-start;flex-grow:1;border-bottom:1px solid #f0f0f0;margin-top:20px}.woocommerce-stepper .woocommerce-stepper__step-divider:last-child{display:none}@media (max-width:782px){.woocommerce-stepper .woocommerce-stepper__step-label{display:none;padding-top:24px}.woocommerce-stepper .woocommerce-stepper__step-icon{margin-left:0}}.woocommerce-stepper.is-vertical .woocommerce-stepper__steps{align-items:normal;flex-direction:column;margin-bottom:0}.woocommerce-stepper.is-vertical .woocommerce-stepper__step{padding-bottom:36px}.woocommerce-stepper.is-vertical .woocommerce-stepper__step:after{content:"";position:absolute;right:20px;top:40px;height:calc(100% - 40px);border-right:1px solid #f0f0f0}.woocommerce-stepper.is-vertical .woocommerce-stepper__step:last-child{padding-bottom:8px}.woocommerce-stepper.is-vertical .woocommerce-stepper__step:last-child:after{display:none}.woocommerce-stepper.is-vertical .woocommerce-stepper__step-label{display:initial}.woocommerce-stepper.is-vertical .woocommerce-stepper__step-icon{margin-left:12px}.woocommerce-stepper.is-vertical .woocommerce-stepper__step-description{display:block}.woocommerce-stepper.is-vertical .woocommerce-stepper_content{margin-top:16px;margin-right:36px}@-webkit-keyframes rotate{0%{transform:rotate(0deg)}to{transform:rotate(-270deg)}}@keyframes rotate{0%{transform:rotate(0deg)}to{transform:rotate(-270deg)}}@-webkit-keyframes growAndShrink{0%,to{stroke-dashoffset:200}50%{stroke-dashoffset:50;transform:rotate(-135deg)}to{transform:rotate(-450deg)}}@keyframes growAndShrink{0%,to{stroke-dashoffset:200}50%{stroke-dashoffset:50;transform:rotate(-135deg)}to{transform:rotate(-450deg)}}.woocommerce-spinner{-webkit-animation:rotate 2s linear infinite;animation:rotate 2s linear infinite;width:40px;min-width:40px;height:40px;max-height:40px}.woocommerce-spinner__circle{stroke-dasharray:200;stroke-dashoffset:0;transform-origin:center;-webkit-animation:growAndShrink 2s ease-in-out infinite;animation:growAndShrink 2s ease-in-out infinite;stroke:#1d2327}.woocommerce-summary{margin:16px 0;display:-ms-grid;display:grid;border-color:#e0e0e0;border-style:solid;border-width:1px 1px 0 0;background-color:#f0f0f0;box-shadow:inset 1px -1px 0 #e0e0e0;width:100%}@media (max-width:782px){.woocommerce-summary{border-width:0}.woocommerce-summary.is-placeholder{border-top:0}.woocommerce-summary .woocommerce-summary__item-container.is-placeholder{border-top:1px solid #e0e0e0}}.woocommerce-summary .components-popover:not(.components-tooltip){position:static!important;top:auto!important;right:auto!important;left:auto!important;bottom:auto!important;margin-top:0!important;margin-right:0}.woocommerce-summary .components-popover:not(.components-tooltip) .components-popover__header{display:none}.woocommerce-summary .components-popover:not(.components-tooltip) .components-popover__content{position:static;right:auto;left:auto;margin:0;width:100%;max-width:100%!important;max-height:100%!important;box-shadow:none;border:none;transform:none}.woocommerce-summary .components-popover:not(.components-tooltip) .components-popover__content .woocommerce-summary__item.is-selected{display:none}.components-popover__content .woocommerce-summary{max-height:100%;margin-top:0;margin-bottom:0;overflow-y:auto;border:none}.woocommerce-summary .woocommerce-summary__item-delta,.woocommerce-summary .woocommerce-summary__item-value{flex:1 0 auto}.woocommerce-summary .woocommerce-summary__item-delta{flex:0 1 auto;display:flex}.woocommerce-summary,.woocommerce-summary.has-1-items,.woocommerce-summary.has-one-item{-ms-grid-columns:1fr;grid-template-columns:1fr}.woocommerce-summary.has-2-items{-ms-grid-columns:(1fr)[2];grid-template-columns:repeat(2,1fr)}.woocommerce-summary.has-2-items .woocommerce-summary__item-container:nth-of-type(2n) .woocommerce-summary__item{border-left-color:#e0e0e0}.woocommerce-summary.has-2-items .woocommerce-summary__item-container:nth-of-type(odd):nth-last-of-type(-n+2) .woocommerce-summary__item,.woocommerce-summary.has-2-items .woocommerce-summary__item-container:nth-of-type(odd):nth-last-of-type(-n+2)~.woocommerce-summary__item-container .woocommerce-summary__item{border-bottom-color:#e0e0e0}.woocommerce-summary.has-3-items{-ms-grid-columns:(1fr)[3];grid-template-columns:repeat(3,1fr)}.woocommerce-summary.has-3-items .woocommerce-summary__item-container:nth-of-type(3n) .woocommerce-summary__item{border-left-color:#e0e0e0}.woocommerce-summary.has-3-items .woocommerce-summary__item-container:nth-of-type(3n+1):nth-last-of-type(-n+3) .woocommerce-summary__item,.woocommerce-summary.has-3-items .woocommerce-summary__item-container:nth-of-type(3n+1):nth-last-of-type(-n+3)~.woocommerce-summary__item-container .woocommerce-summary__item{border-bottom-color:#e0e0e0}.woocommerce-summary.has-4-items,.woocommerce-summary.has-7-items,.woocommerce-summary.has-8-items{-ms-grid-columns:(1fr)[4];grid-template-columns:repeat(4,1fr)}.woocommerce-summary.has-4-items .woocommerce-summary__item-container:nth-of-type(4n) .woocommerce-summary__item,.woocommerce-summary.has-7-items .woocommerce-summary__item-container:nth-of-type(4n) .woocommerce-summary__item,.woocommerce-summary.has-8-items .woocommerce-summary__item-container:nth-of-type(4n) .woocommerce-summary__item{border-left-color:#e0e0e0}.woocommerce-summary.has-4-items .woocommerce-summary__item-container:nth-of-type(4n+1):nth-last-of-type(-n+4) .woocommerce-summary__item,.woocommerce-summary.has-4-items .woocommerce-summary__item-container:nth-of-type(4n+1):nth-last-of-type(-n+4)~.woocommerce-summary__item-container .woocommerce-summary__item,.woocommerce-summary.has-7-items .woocommerce-summary__item-container:nth-of-type(4n+1):nth-last-of-type(-n+4) .woocommerce-summary__item,.woocommerce-summary.has-7-items .woocommerce-summary__item-container:nth-of-type(4n+1):nth-last-of-type(-n+4)~.woocommerce-summary__item-container .woocommerce-summary__item,.woocommerce-summary.has-8-items .woocommerce-summary__item-container:nth-of-type(4n+1):nth-last-of-type(-n+4) .woocommerce-summary__item,.woocommerce-summary.has-8-items .woocommerce-summary__item-container:nth-of-type(4n+1):nth-last-of-type(-n+4)~.woocommerce-summary__item-container .woocommerce-summary__item{border-bottom-color:#e0e0e0}.woocommerce-summary.has-5-items{-ms-grid-columns:(1fr)[5];grid-template-columns:repeat(5,1fr)}.woocommerce-summary.has-5-items .woocommerce-summary__item-container:nth-of-type(5n) .woocommerce-summary__item{border-left-color:#e0e0e0}.woocommerce-summary.has-5-items .woocommerce-summary__item-container:nth-of-type(5n+1):nth-last-of-type(-n+5) .woocommerce-summary__item,.woocommerce-summary.has-5-items .woocommerce-summary__item-container:nth-of-type(5n+1):nth-last-of-type(-n+5)~.woocommerce-summary__item-container .woocommerce-summary__item{border-bottom-color:#e0e0e0}.woocommerce-summary.has-5-items.is-placeholder .woocommerce-summary__item-prev-label,.woocommerce-summary.has-5-items .woocommerce-summary__item-value .woocommerce-summary__item-prev-label{margin-left:calc(100% - 80px)}@media (min-width:1441px){.woocommerce-summary.has-6-items{-ms-grid-columns:(1fr)[6];grid-template-columns:repeat(6,1fr)}.woocommerce-summary.has-6-items .woocommerce-summary__item-container:nth-of-type(6n) .woocommerce-summary__item{border-left-color:#e0e0e0}.woocommerce-summary.has-6-items .woocommerce-summary__item-container:nth-of-type(6n+1):nth-last-of-type(-n+6) .woocommerce-summary__item,.woocommerce-summary.has-6-items .woocommerce-summary__item-container:nth-of-type(6n+1):nth-last-of-type(-n+6)~.woocommerce-summary__item-container .woocommerce-summary__item{border-bottom-color:#e0e0e0}.woocommerce-summary.has-6-items.is-placeholder .woocommerce-summary__item-prev-label,.woocommerce-summary.has-6-items .woocommerce-summary__item-value .woocommerce-summary__item-prev-label{margin-left:calc(100% - 80px)}.woocommerce-summary.has-9-items,.woocommerce-summary.has-10-items{-ms-grid-columns:(1fr)[5];grid-template-columns:repeat(5,1fr)}.woocommerce-summary.has-9-items .woocommerce-summary__item-container:nth-of-type(5n) .woocommerce-summary__item,.woocommerce-summary.has-10-items .woocommerce-summary__item-container:nth-of-type(5n) .woocommerce-summary__item{border-left-color:#e0e0e0}.woocommerce-summary.has-9-items .woocommerce-summary__item-container:nth-of-type(5n+1):nth-last-of-type(-n+5) .woocommerce-summary__item,.woocommerce-summary.has-9-items .woocommerce-summary__item-container:nth-of-type(5n+1):nth-last-of-type(-n+5)~.woocommerce-summary__item-container .woocommerce-summary__item,.woocommerce-summary.has-10-items .woocommerce-summary__item-container:nth-of-type(5n+1):nth-last-of-type(-n+5) .woocommerce-summary__item,.woocommerce-summary.has-10-items .woocommerce-summary__item-container:nth-of-type(5n+1):nth-last-of-type(-n+5)~.woocommerce-summary__item-container .woocommerce-summary__item{border-bottom-color:#e0e0e0}.woocommerce-summary.has-9-items.is-placeholder .woocommerce-summary__item-prev-label,.woocommerce-summary.has-9-items .woocommerce-summary__item-value .woocommerce-summary__item-prev-label,.woocommerce-summary.has-10-items.is-placeholder .woocommerce-summary__item-prev-label,.woocommerce-summary.has-10-items .woocommerce-summary__item-value .woocommerce-summary__item-prev-label{margin-left:calc(100% - 80px)}}@media (max-width:1440px){.woocommerce-summary.has-4-items.is-placeholder .woocommerce-summary__item-prev-label,.woocommerce-summary.has-4-items .woocommerce-summary__item-value .woocommerce-summary__item-prev-label,.woocommerce-summary.has-7-items.is-placeholder .woocommerce-summary__item-prev-label,.woocommerce-summary.has-7-items .woocommerce-summary__item-value .woocommerce-summary__item-prev-label,.woocommerce-summary.has-8-items.is-placeholder .woocommerce-summary__item-prev-label,.woocommerce-summary.has-8-items .woocommerce-summary__item-value .woocommerce-summary__item-prev-label{margin-left:calc(100% - 80px)}.woocommerce-summary.has-6-items,.woocommerce-summary.has-9-items{-ms-grid-columns:(1fr)[3];grid-template-columns:repeat(3,1fr)}.woocommerce-summary.has-6-items .woocommerce-summary__item-container:nth-of-type(3n) .woocommerce-summary__item,.woocommerce-summary.has-9-items .woocommerce-summary__item-container:nth-of-type(3n) .woocommerce-summary__item{border-left-color:#e0e0e0}.woocommerce-summary.has-6-items .woocommerce-summary__item-container:nth-of-type(3n+1):nth-last-of-type(-n+3) .woocommerce-summary__item,.woocommerce-summary.has-6-items .woocommerce-summary__item-container:nth-of-type(3n+1):nth-last-of-type(-n+3)~.woocommerce-summary__item-container .woocommerce-summary__item,.woocommerce-summary.has-9-items .woocommerce-summary__item-container:nth-of-type(3n+1):nth-last-of-type(-n+3) .woocommerce-summary__item,.woocommerce-summary.has-9-items .woocommerce-summary__item-container:nth-of-type(3n+1):nth-last-of-type(-n+3)~.woocommerce-summary__item-container .woocommerce-summary__item{border-bottom-color:#e0e0e0}.woocommerce-summary.has-10-items{-ms-grid-columns:(1fr)[4];grid-template-columns:repeat(4,1fr)}.woocommerce-summary.has-10-items .woocommerce-summary__item-container:nth-of-type(4n) .woocommerce-summary__item{border-left-color:#e0e0e0}.woocommerce-summary.has-10-items .woocommerce-summary__item-container:nth-of-type(4n+1):nth-last-of-type(-n+4) .woocommerce-summary__item,.woocommerce-summary.has-10-items .woocommerce-summary__item-container:nth-of-type(4n+1):nth-last-of-type(-n+4)~.woocommerce-summary__item-container .woocommerce-summary__item{border-bottom-color:#e0e0e0}.woocommerce-summary.has-10-items.is-placeholder .woocommerce-summary__item-prev-label,.woocommerce-summary.has-10-items .woocommerce-summary__item-value .woocommerce-summary__item-prev-label{margin-left:calc(100% - 80px)}.woocommerce-summary.has-9-items .woocommerce-summary__item-container:nth-of-type(5n) .woocommerce-summary__item,.woocommerce-summary.has-10-items .woocommerce-summary__item-container:nth-of-type(5n) .woocommerce-summary__item{border-left-color:#e0e0e0}}@media (max-width:960px){.woocommerce-summary .woocommerce-summary__item{border-left-color:#e0e0e0}}@media (max-width:782px){.woocommerce-summary .woocommerce-summary__item-container{margin-right:-16px;margin-left:-16px;width:auto}.woocommerce-summary .woocommerce-summary__item-container .woocommerce-summary__item{border-left:none}.woocommerce-summary .components-popover.components-popover{margin-right:-16px;margin-left:-16px}.woocommerce-summary .components-popover.components-popover .woocommerce-summary__item-container{margin-right:0;margin-left:0}}.woocommerce-summary__item-container{margin-bottom:0}.woocommerce-summary__item-container:last-of-type .woocommerce-summary__item{border-bottom-color:#e0e0e0!important}.woocommerce-summary__item-container.is-dropdown-button{padding:0;list-style:none;border-left:1px solid #e0e0e0}.woocommerce-summary__item-container.is-dropdown-button .components-button{border-bottom:1px solid #e0e0e0;text-align:right;display:block}@media (max-width:782px){.woocommerce-summary__item-container.is-dropdown-button{border-left:none}}.woocommerce-summary__item-container.is-placeholder .woocommerce-summary__item{height:117px}.woocommerce-summary__item-container.is-placeholder .woocommerce-summary__item-label{-webkit-animation:loading-fade 1.6s ease-in-out infinite;animation:loading-fade 1.6s ease-in-out infinite;background-color:#f0f0f0;color:transparent;display:inline-block;height:20px;margin-top:2.2px;max-width:110px;width:70%}.woocommerce-summary__item-container.is-placeholder .woocommerce-summary__item-label:after{content:"\00a0"}@media screen and (prefers-reduced-motion:reduce){.woocommerce-summary__item-container.is-placeholder .woocommerce-summary__item-label{-webkit-animation:none;animation:none}}.woocommerce-summary__item-container.is-placeholder .woocommerce-summary__item-data{justify-content:space-between}.woocommerce-summary__item-container.is-placeholder .woocommerce-summary__item-value{-webkit-animation:loading-fade 1.6s ease-in-out infinite;animation:loading-fade 1.6s ease-in-out infinite;background-color:#f0f0f0;color:transparent;display:inline-block;height:28px;width:60px;max-width:60px}.woocommerce-summary__item-container.is-placeholder .woocommerce-summary__item-value:after{content:"\00a0"}@media screen and (prefers-reduced-motion:reduce){.woocommerce-summary__item-container.is-placeholder .woocommerce-summary__item-value{-webkit-animation:none;animation:none}}.woocommerce-summary__item-container.is-placeholder .woocommerce-summary__item-delta{-webkit-animation:loading-fade 1.6s ease-in-out infinite;animation:loading-fade 1.6s ease-in-out infinite;background-color:#f0f0f0;color:transparent;width:60px;border-radius:2px}.woocommerce-summary__item-container.is-placeholder .woocommerce-summary__item-delta:after{content:"\00a0"}@media screen and (prefers-reduced-motion:reduce){.woocommerce-summary__item-container.is-placeholder .woocommerce-summary__item-delta{-webkit-animation:none;animation:none}}.woocommerce-summary__item{display:flex;flex-direction:column;height:100%;padding:24px;background-color:#f8f9fa;border-bottom:1px solid #e0e0e0;border-left:1px solid #e0e0e0;line-height:1.4em;text-decoration:none;color:#1e1e1e}.woocommerce-summary__item.components-button{height:auto;padding:16px;align-items:normal}.woocommerce-summary__item:hover{background-color:#f0f0f0}.woocommerce-summary__item:hover,.woocommerce-summary__item:hover .woocommerce-summary__item-label{color:#007cba;color:var(--wp-admin-theme-color)}.woocommerce-summary__item:active{background-color:#f0f0f0}.woocommerce-summary__item:focus{box-shadow:inset 1px 1px 0 #757575,inset -1px -1px 0 #757575!important}.woocommerce-summary__item.is-selected:focus{box-shadow:inset 1px -1px 0 #757575,inset -1px 0 0 #757575,inset 0 4px 0 #007cba!important;box-shadow:inset 1px -1px 0 #757575,inset -1px 0 0 #757575,inset 0 4px 0 var(--wp-admin-theme-color)!important}.is-dropdown-button .woocommerce-summary__item{position:relative;width:100%;padding-left:56px}@media (max-width:782px){.is-dropdown-button .woocommerce-summary__item{border-left:none}}.woocommerce-summary__item .woocommerce-summary__item-data{display:flex;justify-content:space-between}.woocommerce-summary__item .woocommerce-summary__item-label{display:block;margin-bottom:16px;color:#757575}.woocommerce-summary__item .woocommerce-summary__item-value{margin-bottom:4px;font-weight:500;color:#1e1e1e}.woocommerce-summary__item .woocommerce-summary__item-delta{padding:5px;border-radius:3px;height:-webkit-min-content;height:-moz-min-content;height:min-content;background-color:#f0f0f0;color:#1e1e1e}.woocommerce-summary__item.is-selected{background:#fff;box-shadow:inset 0 4px 0 #007cba;box-shadow:inset 0 4px 0 var(--wp-admin-theme-color)}.woocommerce-summary__item.is-selected .woocommerce-summary__item-value{font-weight:600}.woocommerce-summary__item.is-selected .woocommerce-summary__item-delta{font-weight:400}.woocommerce-summary__item.is-good-trend .woocommerce-summary__item-delta{background-color:#4ab866;color:#fff}.woocommerce-summary__item.is-bad-trend .woocommerce-summary__item-delta{background-color:#d94f4f;color:#fff}.woocommerce-summary__item .woocommerce-summary__toggle{position:absolute;top:44px;left:16px;transition:transform .2s ease}@media screen and (prefers-reduced-motion:reduce){.woocommerce-summary__item .woocommerce-summary__toggle{transition:none}}.is-dropdown-expanded .woocommerce-summary__item .woocommerce-summary__toggle{transform:rotate(180deg)}.components-popover__content .woocommerce-summary__item .woocommerce-summary__item-delta,.components-popover__content .woocommerce-summary__item .woocommerce-summary__item-label,.components-popover__content .woocommerce-summary__item .woocommerce-summary__item-value{margin-bottom:0}.woocommerce-table{margin-bottom:40px}.woocommerce-table .woocommerce-table__actions{display:inline-flex;justify-content:flex-end;align-items:center}.woocommerce-table .woocommerce-table__actions>*{margin-left:16px}.woocommerce-table .woocommerce-table__actions>:last-child{margin-left:0}.woocommerce-table .woocommerce-table__actions>div{width:100%}.woocommerce-table .components-card__footer{flex-direction:column}.woocommerce-table .components-card__footer>*{padding-left:0}.woocommerce-table.is-empty{align-items:center;background:#f0f0f0;color:#757575;display:flex;height:calc(182px + 6.825rem);height:calc(17px + 1.1375rem + (33px + 1.1375rem)*var(--number-of-rows));justify-content:center;padding:16px;text-align:center}.woocommerce-table .woocommerce-pagination{margin-bottom:16px;z-index:1;background:#fff;position:relative}.woocommerce-table .components-card__header{align-items:center;text-align:right;display:-ms-grid;display:grid;width:100%;-ms-grid-columns:auto 1fr auto;grid-template-columns:auto 1fr auto}@media (max-width:960px){.woocommerce-table.has-search .woocommerce-table__actions{grid-gap:12px;-ms-grid-columns:auto 1fr;grid-template-columns:auto 1fr;-ms-grid-row:2;grid-row-start:2;-ms-grid-row-span:0;grid-row-end:2;-ms-grid-column:1;grid-column-start:1;-ms-grid-column-span:3;grid-column-end:4;margin:0}}.woocommerce-table .woocommerce-search .woocommerce-select-control__control{height:38px}.woocommerce-table .woocommerce-compare-button{padding:3px 12px;height:auto}.woocommerce-table .woocommerce-ellipsis-menu{justify-content:flex-end;display:flex}.woocommerce-table__caption{font-size:24px;font-size:1.5rem;text-align:right}.components-card__body{position:relative}.woocommerce-table__table{overflow-x:auto}.woocommerce-table__table:after,.woocommerce-table__table:before{content:"";position:absolute;top:0;width:60px;height:100%;opacity:0;pointer-events:none;transition:opacity .3s;z-index:1}.woocommerce-table__table:after{left:0;background:linear-gradient(-90deg,hsla(0,0%,100%,0),#fff)}.woocommerce-table__table:before{right:0;background:linear-gradient(-90deg,#fff,hsla(0,0%,100%,0))}.woocommerce-table__table.is-scrollable-left:before,.woocommerce-table__table.is-scrollable-right:after{opacity:1}.woocommerce-table__table table{border-collapse:collapse;width:100%}.woocommerce-table__table tr:focus-within,.woocommerce-table__table tr:hover{background-color:#e0e0e0}.woocommerce-table__table tr:focus-within td,.woocommerce-table__table tr:focus-within th,.woocommerce-table__table tr:hover td,.woocommerce-table__table tr:hover th{background:transparent}.woocommerce-table__empty-item,.woocommerce-table__header,.woocommerce-table__item{padding:16px 24px}.woocommerce-table__header,.woocommerce-table__item{font-size:13px;font-size:.8125rem;text-align:right;border-bottom:1px solid #e2e4e7}.woocommerce-table__header>a:only-child,.woocommerce-table__item>a:only-child{display:block}.woocommerce-table__header a:focus,.woocommerce-table__header a:hover,.woocommerce-table__item a:focus,.woocommerce-table__item a:hover{color:#533582}.woocommerce-table__header .is-placeholder,.woocommerce-table__item .is-placeholder{-webkit-animation:loading-fade 1.6s ease-in-out infinite;animation:loading-fade 1.6s ease-in-out infinite;background-color:#f0f0f0;color:transparent;display:inline-block;height:16px;max-width:120px;width:80%}.woocommerce-table__header .is-placeholder:after,.woocommerce-table__item .is-placeholder:after{content:"\00a0"}@media screen and (prefers-reduced-motion:reduce){.woocommerce-table__header .is-placeholder,.woocommerce-table__item .is-placeholder{-webkit-animation:none;animation:none}}.woocommerce-table__header:not(.is-left-aligned),.woocommerce-table__item:not(.is-left-aligned){text-align:left}.woocommerce-table__header:not(.is-left-aligned) button,.woocommerce-table__item:not(.is-left-aligned) button{justify-content:flex-end}.woocommerce-table__header.is-numeric .is-placeholder,.woocommerce-table__item.is-numeric .is-placeholder{max-width:40px}.woocommerce-table__header .is-negative,.woocommerce-table__item .is-negative{color:#d94f4f;font-weight:700}.woocommerce-table__header.is-sorted,.woocommerce-table__item.is-sorted{background-color:#f0f0f0}.woocommerce-table__header.is-checkbox-column,.woocommerce-table__item.is-checkbox-column{width:33px;max-width:33px;padding-left:0;padding-right:16px}.woocommerce-table__header.is-checkbox-column+th,.woocommerce-table__item.is-checkbox-column+th{border-right:0}.woocommerce-table tr:last-child .woocommerce-table__item{border-bottom:0}.woocommerce-table__empty-item{text-align:center;font-size:18px;font-size:1.125rem;color:#757575;font-weight:700}@media (max-width:782px){.woocommerce-table__empty-item{font-size:13px;font-size:.8125rem}}th.woocommerce-table__item{font-weight:400}.woocommerce-table__header{padding:8px 24px;background-color:#f8f9fa;font-weight:700;white-space:nowrap}.woocommerce-table__header.is-left-aligned.is-sortable{padding-right:16px}.woocommerce-table__header.is-left-aligned.is-sortable svg{display:inline-flex;order:1;margin-right:0}.woocommerce-table__header .components-button.is-button{height:auto;width:100%;padding:8px 0 8px 24px;vertical-align:middle;line-height:1;border:none;background:transparent!important;box-shadow:none!important;align-items:center}.woocommerce-table__header .components-button.is-button:active,.woocommerce-table__header .components-button.is-button:hover{box-shadow:none!important}.woocommerce-table__header.is-sortable{padding:0}.woocommerce-table__header.is-sortable svg{visibility:hidden;margin-right:4px}.woocommerce-table__header.is-sortable .components-button:focus svg,.woocommerce-table__header.is-sortable .components-button:hover svg,.woocommerce-table__header.is-sortable.is-sorted .components-button svg{visibility:visible}.woocommerce-table__summary{text-align:center;margin:0}.woocommerce-table__summary-item{display:inline-block;margin-bottom:0;margin-right:8px;margin-left:8px}.woocommerce-table__summary-item .woocommerce-table__summary-label,.woocommerce-table__summary-item .woocommerce-table__summary-value{display:inline-block}.woocommerce-table__summary-item .woocommerce-table__summary-label{margin-right:4px}.woocommerce-table__summary-item .woocommerce-table__summary-value{font-weight:600}.woocommerce-tag{display:inline-flex;margin:1px 0 1px 4px;overflow:hidden;vertical-align:middle}.woocommerce-tag .woocommerce-tag__remove,.woocommerce-tag .woocommerce-tag__text{display:inline-block;line-height:24px;background:#f0f0f0;transition:all .2s cubic-bezier(.4,1,.4,1)}.woocommerce-tag .woocommerce-tag__text{-ms-grid-row-align:center;align-self:center;padding:0 8px;border-radius:12px;color:#757575;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.woocommerce-tag.has-remove .woocommerce-tag__text{padding:0 8px 0 4px;border-radius:0 12px 12px 0}.woocommerce-tag .woocommerce-tag__remove{cursor:pointer;height:inherit;padding:0 2px;border-radius:12px 0 0 12px;color:#757575;line-height:10px;text-indent:0;height:24px}.woocommerce-tag .woocommerce-tag__remove:hover{color:#1e1e1e}.muriel-input-text{background:#fff;border:1px solid #a7aaad;border-radius:3px;height:56px;box-shadow:none;padding:12px 12px 4px;position:relative;box-shadow:0 2px 6px rgba(0,0,0,.05)}.muriel-input-text:hover{border-color:#787c82}.muriel-input-text label{color:#646970;font-size:14px;line-height:21px}.muriel-input-text label.components-base-control__label{margin:0}.muriel-input-text .components-text-control__input,.muriel-input-text .components-text-control__input[type=color],.muriel-input-text .components-text-control__input[type=date],.muriel-input-text .components-text-control__input[type=datetime-local],.muriel-input-text .components-text-control__input[type=datetime],.muriel-input-text .components-text-control__input[type=email],.muriel-input-text .components-text-control__input[type=month],.muriel-input-text .components-text-control__input[type=number],.muriel-input-text .components-text-control__input[type=password],.muriel-input-text .components-text-control__input[type=tel],.muriel-input-text .components-text-control__input[type=text],.muriel-input-text .components-text-control__input[type=time],.muriel-input-text .components-text-control__input[type=url],.muriel-input-text .components-text-control__input[type=week]{border:0;box-shadow:none;font-size:16px;line-height:21px;margin:0;padding:0;min-height:30px}.muriel-input-text .components-text-control__input:focus,.muriel-input-text .components-text-control__input[type=color]:focus,.muriel-input-text .components-text-control__input[type=date]:focus,.muriel-input-text .components-text-control__input[type=datetime-local]:focus,.muriel-input-text .components-text-control__input[type=datetime]:focus,.muriel-input-text .components-text-control__input[type=email]:focus,.muriel-input-text .components-text-control__input[type=month]:focus,.muriel-input-text .components-text-control__input[type=number]:focus,.muriel-input-text .components-text-control__input[type=password]:focus,.muriel-input-text .components-text-control__input[type=tel]:focus,.muriel-input-text .components-text-control__input[type=text]:focus,.muriel-input-text .components-text-control__input[type=time]:focus,.muriel-input-text .components-text-control__input[type=url]:focus,.muriel-input-text .components-text-control__input[type=week]:focus{box-shadow:none}.muriel-input-text.active{box-shadow:0 0 0 2px #007cba;box-shadow:0 0 0 2px var(--wp-admin-theme-color);border-color:transparent}.muriel-input-text.active input{color:#2c3338}.muriel-input-text.with-value .components-base-control__label{display:block;position:relative;top:-8px;width:100%;font-size:12px}.muriel-input-text.with-value input{color:#2c3338;position:relative;top:-12px}.muriel-input-text.empty label{display:none}.muriel-input-text.empty input{color:#646970}.muriel-input-text.has-error{box-shadow:none}.muriel-input-text.disabled label{display:none}.muriel-input-text.disabled input{color:#a7aaad}.muriel-input-text.disabled input:-ms-input-placeholder{opacity:1}.muriel-input-text.disabled input::-moz-placeholder{color:#a7aaad;opacity:1}.muriel-input-text.disabled input::placeholder{color:#a7aaad;opacity:1}.muriel-input-text.disabled input:-ms-input-placeholder{color:#a7aaad}.muriel-input-text.disabled input::-ms-input-placeholder{color:#a7aaad}.text-control-with-affixes{display:inline-flex;flex-direction:row;width:100%}.text-control-with-affixes input[type=email],.text-control-with-affixes input[type=number],.text-control-with-affixes input[type=password],.text-control-with-affixes input[type=text],.text-control-with-affixes input[type=url]{flex-grow:1;margin:0}.text-control-with-affixes input[type=email]:disabled,.text-control-with-affixes input[type=number]:disabled,.text-control-with-affixes input[type=password]:disabled,.text-control-with-affixes input[type=text]:disabled,.text-control-with-affixes input[type=url]:disabled{border-left-width:0}.text-control-with-affixes input[type=email]:disabled+.text-control-with-affixes__suffix,.text-control-with-affixes input[type=number]:disabled+.text-control-with-affixes__suffix,.text-control-with-affixes input[type=password]:disabled+.text-control-with-affixes__suffix,.text-control-with-affixes input[type=text]:disabled+.text-control-with-affixes__suffix,.text-control-with-affixes input[type=url]:disabled+.text-control-with-affixes__suffix{border-right:1px solid #f0f0f0}.text-control-with-affixes.text-control-with-prefix input{border-top-right-radius:0;border-bottom-right-radius:0}.text-control-with-affixes.text-control-with-suffix input{border-top-left-radius:0;border-bottom-left-radius:0}.text-control-with-affixes__prefix,.text-control-with-affixes__suffix{position:relative;background:#fff;border:1px solid #757575;color:#757575;padding:7px 14px;white-space:nowrap;flex:1 0 auto;font-size:14px;line-height:1.5}.disabled .text-control-with-affixes__prefix,.disabled .text-control-with-affixes__suffix{background:hsla(0,0%,100%,.5);border-color:hsla(0,0%,87.1%,.75);box-shadow:inset 0 1px 2px rgba(0,0,0,.04);color:rgba(51,51,51,.5)}.text-control-with-affixes__prefix{border-left:none;border-radius:0 4px 4px 0}.text-control-with-affixes__prefix+input[type=email]:disabled,.text-control-with-affixes__prefix+input[type=number]:disabled,.text-control-with-affixes__prefix+input[type=password]:disabled,.text-control-with-affixes__prefix+input[type=text]:disabled,.text-control-with-affixes__prefix+input[type=url]:disabled{border-right-color:#f0f0f0}.text-control-with-affixes__suffix{border-right:none;border-radius:4px 0 0 4px}.woocommerce-timeline ul{margin:0;padding-right:0;list-style-type:none}.woocommerce-timeline ul li{margin-bottom:0}.woocommerce-timeline .woocommerce-timeline-group .woocommerce-timeline-group__title{color:#1d2327;font-size:12px;font-weight:600;text-transform:uppercase;margin:0 0 16px;display:inline-block}.woocommerce-timeline .woocommerce-timeline-group hr{float:left;width:calc(100% - 40px);margin-bottom:16px;border:.5px solid #e3dfe2}.woocommerce-timeline .woocommerce-timeline-item .woocommerce-timeline-item__top-border{min-height:16px;border-right:1px solid #c3c4c7;margin:0 12px}.woocommerce-timeline .woocommerce-timeline-item .woocommerce-timeline-item__title{display:flex;align-items:center;flex-direction:row;justify-content:space-between;color:#2c3338}.woocommerce-timeline .woocommerce-timeline-item .woocommerce-timeline-item__title *{font-size:16px}.woocommerce-timeline .woocommerce-timeline-item .woocommerce-timeline-item__headline{display:flex;align-items:center;flex-direction:row;margin:8px 0}.woocommerce-timeline .woocommerce-timeline-item .woocommerce-timeline-item__headline *{margin:0}.woocommerce-timeline .woocommerce-timeline-item .woocommerce-timeline-item__headline>*{padding:0 16px}.woocommerce-timeline .woocommerce-timeline-item .woocommerce-timeline-item__headline svg{fill:#fff;padding:4px;background:#c3c4c7;border-radius:9999px;box-sizing:content-box;width:16px;height:16px}.woocommerce-timeline .woocommerce-timeline-item .woocommerce-timeline-item__headline svg.is-success{background:#4ab866}.woocommerce-timeline .woocommerce-timeline-item .woocommerce-timeline-item__headline svg.is-warning{background:#ffb900}.woocommerce-timeline .woocommerce-timeline-item .woocommerce-timeline-item__headline svg.is-error{background:#d94f4f}.woocommerce-timeline .woocommerce-timeline-item .woocommerce-timeline-item__timestamp{font-size:14px;line-height:16px}.woocommerce-timeline .woocommerce-timeline-item .woocommerce-timeline-item__body{display:flex;flex-direction:column;color:#50575e;margin:0 12px;padding:8px 36px;border-right:1px solid #c3c4c7}.woocommerce-timeline .woocommerce-timeline-item .woocommerce-timeline-item__body *{margin:0;font-size:14px}.woocommerce-timeline ul :last-child.woocommerce-timeline-group hr:last-child{display:none}.woocommerce-view-more-list{padding-right:4px;margin:0 4px 0 0;vertical-align:middle}.woocommerce-view-more-list__popover{margin:0;padding:16px;text-align:right}.woocommerce-view-more-list__popover__item{display:block;margin:16px 0}.woocommerce-view-more-list__popover__item:first-child{margin-top:0}.woocommerce-view-more-list__popover__item:last-child{margin-bottom:0}.woocommerce-web-preview{width:100%;display:flex;align-items:center;justify-content:center;background:#f6f7f7}.woocommerce-web-preview.is-loading .woocommerce-web-preview__iframe-wrapper{display:none}.woocommerce-web-preview .woocommerce-web-preview__iframe-wrapper{width:100%}.woocommerce-web-preview iframe{width:100%;height:100%;min-height:400px}.woocommerce-badge{background-color:#f0f0f0;border-radius:20px;display:inline-block;text-align:center;font-style:normal;font-weight:600;font-size:14px;line-height:27px;align-items:center;width:32px;height:28px}.woocommerce-component-settings .components-base-control{margin-top:16px;margin-bottom:16px;position:relative}.woocommerce-component-settings .components-base-control.has-error .components-base-control__help{right:0!important}.editor-block-preview__content{overflow:hidden}.components-placeholder__label .gridicon,.components-placeholder__label .material-icon{margin-left:1ch;fill:currentColor}.editor-styles-wrapper .wc-block-grid .wc-block-grid__products{list-style:none;margin:0 -8px 16px;padding:0}.editor-styles-wrapper .wc-block-grid .wc-block-grid__products .wc-block-grid__product{margin:0 0 24px}.editor-styles-wrapper .wc-block-grid.components-placeholder{padding:2em 1em}.editor-styles-wrapper .wc-block-grid.is-loading,.editor-styles-wrapper .wc-block-grid.is-not-found{display:block}.components-base-control+.wc-block-base-control-notice{margin:-16px 0 16px}.components-base-control+.wc-block-base-control-notice:last-child{margin:-16px 0 12px}.woocommerce-search-list__list.woocommerce-search-list__list{box-sizing:border-box;margin:0;padding:0}.woocommerce-search-list__selected.woocommerce-search-list__selected>ul{list-style:none;margin:0;padding:0}.theme-twentytwenty .wp-block .wc-block-active-filters__title,.theme-twentytwenty .wp-block .wc-block-attribute-filter__title,.theme-twentytwenty .wp-block .wc-block-grid__product-title,.theme-twentytwenty .wp-block .wc-block-price-filter__title,.theme-twentytwenty .wp-block .wc-block-stock-filter__title{font-size:1em}.wc-atomic-blocks-product__selection{width:100%}.wc-atomic-blocks-product__edit-card{padding:16px;border-top:1px solid #e0e0e0}.wc-atomic-blocks-product__edit-card .wc-atomic-blocks-product__edit-card-title{margin:0 0 16px}.wp-block-woocommerce-cart-express-payment-block{margin:14px 0 28px}.wp-block-woocommerce-cart-express-payment-block .components-placeholder__label svg{font-size:1em}.wp-block-woocommerce-cart-express-payment-block .wc-block-components-express-payment-continue-rule--checkout{margin-bottom:0}.wp-block-woocommerce-cart-express-payment-block.wp-block-woocommerce-cart-express-payment-block--has-express-payment-methods{padding:14px 0;margin:-14px 0 14px!important;position:relative}.wp-block-woocommerce-filled-cart-block .wc-block-components-sidebar-layout{display:block}.wp-block-woocommerce-filled-cart-block .block-editor-block-list__layout{display:flex;flex-flow:row wrap;align-items:flex-start}.wp-block-woocommerce-filled-cart-block .block-editor-block-list__layout>:first-child,.wp-block-woocommerce-filled-cart-block .wc-block-components-main>:first-child,.wp-block-woocommerce-filled-cart-block .wc-block-components-sidebar>:first-child{margin-top:0}.wp-block-woocommerce-filled-cart-block .wp-block-woocommerce-cart-items-block .block-editor-block-list__layout,.wp-block-woocommerce-filled-cart-block .wp-block-woocommerce-cart-totals-block .block-editor-block-list__layout{display:block}.wc-block-cart__page-notice{margin:0}.wp-block-woocommerce-cart.is-editor-preview{max-height:1000px;overflow:hidden}.wc-block-checkout__additional_fields{margin:1.5em 0 -1.5em}.wc-block-components-checkout-step__description-placeholder{opacity:.5}.wc-block-components-checkout-step__title{display:flex;width:100%}.wp-block-woocommerce-checkout-express-payment-block{margin:14px 0 28px}.wp-block-woocommerce-checkout-express-payment-block .components-placeholder__label svg{font-size:1em}.wp-block-woocommerce-checkout-express-payment-block .wc-block-components-express-payment-continue-rule--checkout{margin-bottom:0}.wp-block-woocommerce-checkout-express-payment-block.wp-block-woocommerce-checkout-express-payment-block--has-express-payment-methods{padding:14px 0;margin:-14px 0 14px!important;position:relative}.wp-block-woocommerce-checkout-express-payment-block-placeholder *{pointer-events:all}.wp-block-woocommerce-checkout-express-payment-block-placeholder .wp-block-woocommerce-checkout-express-payment-block-placeholder__description{display:block;margin:0 0 1em}.wp-block-woocommerce-checkout-order-note-block{margin-top:20px;margin-bottom:20px;padding-top:4px;padding-bottom:4px}.wp-block-woocommerce-checkout-order-note-block .wc-block-checkout__add-note{margin-top:0;margin-bottom:0}.wc-block-checkout__terms{margin:20px 0;padding-top:4px;padding-bottom:4px;display:flex;align-items:flex-start}.wc-block-checkout__terms .block-editor-rich-text__editable{vertical-align:middle;line-height:1.5em}.wc-block-components-checkbox{margin-left:16px}.wc-block-checkout__terms_notice .components-notice__action{margin-right:0}.wc-block-checkout__terms_notice-button{display:flex;flex-direction:row;align-items:center}.wc-block-checkout__terms_notice-button .wc-block-checkout__terms_notice-button__icon{margin-right:4px}.wp-block-woocommerce-checkout .wc-block-components-sidebar-layout{display:block}.wp-block-woocommerce-checkout .block-editor-block-list__layout{display:flex;flex-flow:row wrap;align-items:flex-start}.wp-block-woocommerce-checkout .block-editor-block-list__layout .wc-block-checkout__additional_fields{padding:0}.wp-block-woocommerce-checkout .block-editor-block-list__layout>:first-child,.wp-block-woocommerce-checkout .wc-block-components-main>:first-child,.wp-block-woocommerce-checkout .wc-block-components-sidebar>:first-child{margin-top:0}.wp-block-woocommerce-checkout .wp-block-woocommerce-checkout-fields-block .block-editor-block-list__layout,.wp-block-woocommerce-checkout .wp-block-woocommerce-checkout-totals-block .block-editor-block-list__layout{display:block}body.wc-lock-selected-block--move .block-editor-block-mover,body.wc-lock-selected-block--move .block-editor-block-mover__move-button-container,body.wc-lock-selected-block--remove .block-editor-block-settings-menu__popover .components-menu-group:last-child{display:none}body.wc-lock-selected-block--remove .block-editor-block-settings-menu__popover .components-menu-group:nth-last-child(2){margin-bottom:-12px}.wc-block-checkout__controls-text{color:#999;font-style:italic}.components-base-control--nested{padding-right:52px;margin-top:-12px}.wc-block-checkout__page-notice{margin:0}.components-panel__body-title .components-button{opacity:1}.wp-block-woocommerce-checkout.is-editor-preview{max-height:1000px;overflow:hidden}.wc-block-products .components-placeholder__instructions{border-bottom:1px solid #e0e2e6;width:100%;padding-bottom:1em;margin-bottom:2em}.wc-block-products .components-placeholder__label svg{fill:currentColor;margin-left:1ch}.wc-block-products .components-placeholder__fieldset{display:block}.wc-block-products .wc-block-products__add-product-button{margin:0 0 1em;vertical-align:middle;height:auto;padding:.5em 1em}.wc-block-products .wc-block-products__add-product-button svg{fill:currentColor;margin-right:.5ch;vertical-align:middle}.wc-block-products .wc-block-products__read_more_button{display:block;margin-bottom:1em}.wc-block-all-products .components-placeholder__fieldset{max-width:none;overflow:hidden}.wc-block-all-products .wc-block-all-products-grid-item-template{border-top:1px solid #e0e0e0;margin-top:20px;width:100%;overflow:hidden;text-align:center}.wc-block-all-products .wc-block-all-products-grid-item-template .components-tip{max-width:450px;margin:20px auto;text-align:right}.wc-block-all-products .wc-block-all-products-grid-item-template .components-tip p{margin:1em 0}.wc-block-all-products .wc-block-all-products-grid-item-template .wc-block-all-products__actions{display:flex;margin:20px auto;padding:1em 0 0;align-items:center;vertical-align:middle;max-width:450px}.wc-block-all-products .wc-block-all-products-grid-item-template .wc-block-all-products__actions .wc-block-all-products__done-button{margin:0;order:3;line-height:32px;height:auto}.wc-block-all-products .wc-block-all-products-grid-item-template .wc-block-all-products__actions .wc-block-all-products__cancel-button{margin:0 auto 0 1em;order:2}.wc-block-all-products .wc-block-all-products-grid-item-template .wc-block-all-products__actions .wc-block-all-products__reset-button{margin:0;order:1}.wc-block-all-products .wc-block-all-products-grid-item-template .wc-block-grid__products{margin:0 auto!important;text-align:center;position:relative;max-width:450px}.wc-block-all-products .wc-block-all-products-grid-item-template .wc-block-grid__product{padding:1px 20px;margin:0 auto;background:#fff;box-shadow:0 5px 7px -2px rgba(0,0,0,.2);position:static}.wc-block-all-products .wc-block-all-products-grid-item-template .wc-block-grid__product .wp-block-button__link{margin-top:0}.wc-block-all-products .wc-block-all-products-grid-item-template .wc-block-grid__product:after,.wc-block-all-products .wc-block-all-products-grid-item-template .wc-block-grid__product:before{content:"";background:#e0e0e0;display:block;position:absolute;width:100%;top:20px;bottom:20px}.wc-block-all-products .wc-block-all-products-grid-item-template .wc-block-grid__product:before{left:100%;margin-left:30px}.wc-block-all-products .wc-block-all-products-grid-item-template .wc-block-grid__product:after{right:100%;margin-right:30px}.components-base-control+.wc-block-reviews-by-product__notice{margin:-16px 0 16px}.components-base-control:nth-last-child(2)+.wc-block-reviews-by-product__notice{margin:-16px 0 12px}.wc-block-single-product__selection{width:100%}.wc-block-single-product__reset-layout{padding:0}.wc-block-single-product__reset-layout svg{margin-left:4px}.wc-block-single-product__edit-card{padding:16px;border-top:1px solid #e0e0e0}.wc-block-single-product__edit-card .wc-block-single-product__edit-card-title{margin:0 0 16px}.wc-block-editor-components-title{background-color:transparent}.wc-block-error-message{margin-bottom:16px;margin-top:8px}.wc-block-api-error .components-placeholder__fieldset{display:block}.wc-block-api-error .wc-block-error-message{margin-top:0}.wc-block-api-error .components-spinner{float:none}.wc-block-editor-components-external-link-card{display:flex;flex-direction:row;text-decoration:none;margin:24px 0;color:inherit;align-items:flex-start}.wc-block-editor-components-external-link-card+.wc-block-editor-components-external-link-card{margin-top:-8px}.wc-block-editor-components-external-link-card .wc-block-editor-components-external-link-card__content{flex:1 1 0;padding-left:16px}.wc-block-editor-components-external-link-card .wc-block-editor-components-external-link-card__title{font-weight:500;display:block}.wc-block-editor-components-external-link-card .wc-block-editor-components-external-link-card__description{color:#757575;display:block;font-size:.875em;margin-top:.5em}.wc-block-editor-components-external-link-card .wc-block-editor-components-external-link-card__icon{flex:0 0 24px;margin:0;text-align:left;color:inherit;vertical-align:top}.wc-block-feedback-prompt{background-color:#f7f7f7;border-top:1px solid #e0e0e0;margin:0 -16px;padding:24px;text-align:center}.wc-block-feedback-prompt .wc-block-feedback-prompt__title{margin:0 0 12px}.wc-block-feedback-prompt .wc-block-feedback-prompt__link{color:inherit}.wc-block-feedback-prompt .wc-block-feedback-prompt__link>.gridicon{vertical-align:text-bottom}.woocommerce-product-attributes__operator .components-base-control__help{border:0;clip:rect(1px,1px,1px,1px);-webkit-clip-path:inset(50%);clip-path:inset(50%);height:1px;margin:-1px;overflow:hidden;overflow-wrap:normal!important;word-wrap:normal!important;padding:0;position:absolute!important;width:1px}.woocommerce-product-attributes__operator .components-base-control__label{margin-bottom:0;margin-left:.5em}.woocommerce-search-list__item.woocommerce-product-attributes__item.is-searching .woocommerce-search-list__item-prefix:after,.woocommerce-search-list__item.woocommerce-product-attributes__item.is-skip-level .woocommerce-search-list__item-prefix:after{content:":"}.woocommerce-search-list__item.woocommerce-product-attributes__item.is-not-active:active,.woocommerce-search-list__item.woocommerce-product-attributes__item.is-not-active:focus,.woocommerce-search-list__item.woocommerce-product-attributes__item.is-not-active:hover{background:#fff}.woocommerce-search-list__item.woocommerce-product-attributes__item.is-loading{justify-content:center}.woocommerce-search-list__item.woocommerce-product-attributes__item.is-loading .components-spinner{margin-bottom:12px}.woocommerce-search-list__item.woocommerce-product-attributes__item.depth-0:after{margin-right:8px;content:"";height:24px;width:24px;background-image:url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M7.41 15.41L12 10.83l4.59 4.58L18 14l-6-6-6 6z" fill="%23757575" /></svg>');background-repeat:no-repeat;background-position:0;background-size:contain}.woocommerce-search-list__item.woocommerce-product-attributes__item.depth-0.is-selected:after{background-image:url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M7.41 8.59L12 13.17l4.59-4.58L18 10l-6 6-6-6 1.41-1.41z" fill="%23757575" /></svg>')}.woocommerce-search-list__item.woocommerce-product-attributes__item[disabled].depth-0:after{margin-right:0;width:auto;background:none}.woocommerce-product-categories__operator .components-base-control__help{border:0;clip:rect(1px,1px,1px,1px);-webkit-clip-path:inset(50%);clip-path:inset(50%);height:1px;margin:-1px;overflow:hidden;overflow-wrap:normal!important;word-wrap:normal!important;padding:0;position:absolute!important;width:1px}.woocommerce-product-categories__operator .components-base-control__label{margin-bottom:0;margin-left:.5em}.woocommerce-search-product__item .woocommerce-search-list__item-name .description{display:block}.woocommerce-search-product__item.is-searching .woocommerce-search-list__item-prefix:after,.woocommerce-search-product__item.is-skip-level .woocommerce-search-list__item-prefix:after{content:":"}.woocommerce-search-product__item.is-not-active:active,.woocommerce-search-product__item.is-not-active:focus,.woocommerce-search-product__item.is-not-active:hover{background:#fff}.woocommerce-search-product__item.is-loading{justify-content:center}.woocommerce-search-product__item.is-loading .components-spinner{margin-bottom:12px}.woocommerce-search-product__item.depth-0.is-variable:after{margin-right:8px;content:"";height:24px;width:24px;background-image:url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M7.41 8.59L12 13.17l4.59-4.58L18 10l-6 6-6-6 1.41-1.41z" fill="%23757575" /></svg>');background-repeat:no-repeat;background-position:0;background-size:contain}.woocommerce-search-product__item.depth-0.is-variable.is-selected:after{background-image:url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M7.41 15.41L12 10.83l4.59 4.58L18 14l-6-6-6 6z" fill="%23757575" /></svg>')}.woocommerce-product-tags__operator .components-base-control__help{border:0;clip:rect(1px,1px,1px,1px);-webkit-clip-path:inset(50%);clip-path:inset(50%);height:1px;margin:-1px;overflow:hidden;overflow-wrap:normal!important;word-wrap:normal!important;padding:0;position:absolute!important;width:1px}.woocommerce-product-tags__operator .components-base-control__label{margin-bottom:0;margin-left:.5em}.wc-block-text-toolbar-button{align-items:center}.wc-block-text-toolbar-button.is-toggled,.wc-block-text-toolbar-button.is-toggled:focus{background:#757575;color:#fff}.block-editor-block-toolbar__slot{flex-shrink:0}.components-toggle-button-control .components-base-control__field{flex-wrap:wrap}.components-toggle-button-control .components-toggle-button-control__label{width:100%;margin-bottom:8px;display:block}.components-toggle-button-control .components-base-control__help{margin-top:0}.wc-block-view-switch-control{text-align:right;background:#f0f2f3;box-shadow:0 0 0 13px #f0f2f3;margin:0 0 27px;visibility:hidden;color:#757575}.has-child-selected .wc-block-view-switch-control,.is-selected .wc-block-view-switch-control{visibility:visible}.wc-block-handpicked-products__selection,.wc-block-products-category__selection,.wc-block-reviews__selection{width:100%}.wc-block-products-category__cancel-button.is-tertiary{margin:1em auto 0}.wc-block-product-categories.wc-block-product-categories ul{margin-right:20px}.wc-block-product-categories .components-placeholder__label svg,.wc-block-product-on-sale .components-placeholder__label svg{margin-left:1ch;fill:currentColor}.wc-block-products-by-attribute__selection{width:100%}.wc-block-featured-product .components-resizable-box__handle{z-index:10}.wc-block-featured-product__message{margin-bottom:16px}.wc-block-featured-product__selection{width:100%}.wc-block-product-search__field.input-control{color:#828b96!important}.wc-block-product-search .wc-block-product-search__fields .block-editor-rich-text{flex-grow:1}.wc-block-product-tag__selection{width:100%}.wc-block-product-tag__cancel-button.is-tertiary{margin:1em auto 0}.wc-block-featured-category .components-resizable-box__handle{z-index:10}.wc-block-featured-category .components-placeholder__label svg{fill:currentColor;margin-left:1ch}.wc-block-featured-category__selection{width:100%}.components-disabled .wc-block-price-filter__range-input-wrapper .wc-block-price-filter__range-input::-webkit-slider-thumb{pointer-events:none}.components-disabled .wc-block-price-filter__range-input-wrapper .wc-block-price-filter__range-input::-moz-range-thumb{pointer-events:none}.components-disabled .wc-block-price-filter__range-input-wrapper .wc-block-price-filter__range-input::-ms-thumb{pointer-events:none}.wc-block-price-slider .components-placeholder__instructions{border-bottom:1px solid #e0e2e6;width:100%;padding-bottom:1em;margin-bottom:2em}.wc-block-price-slider .components-placeholder__label svg{fill:currentColor;margin-left:1ch}.wc-block-price-slider .components-placeholder__fieldset{display:block}.wc-block-price-slider .wc-block-price-slider__add-product-button{margin:0 0 1em;vertical-align:middle;height:auto;padding:.5em 1em}.wc-block-price-slider .wc-block-price-slider__add-product-button svg{fill:currentColor;margin-right:.5ch;vertical-align:middle}.wc-block-price-slider .wc-block-price-slider__read_more_button{display:block;margin-bottom:1em}.wc-block-attribute-filter .components-placeholder__instructions{border-bottom:1px solid #e0e2e6;width:100%;padding-bottom:1em;margin-bottom:2em}.wc-block-attribute-filter .components-placeholder__label svg{fill:currentColor;margin-left:1ch}.wc-block-attribute-filter .components-placeholder__fieldset{display:block}.wc-block-attribute-filter .woocommerce-search-list__search{border-top:0;margin-top:0;padding-top:0}.wc-block-attribute-filter .wc-block-attribute-filter__add-attribute-button{margin:0 0 1em;vertical-align:middle;height:auto;padding:.5em 1em}.wc-block-attribute-filter .wc-block-attribute-filter__add-attribute-button svg{fill:currentColor;margin-right:.5ch;vertical-align:middle}.wc-block-attribute-filter .wc-block-attribute-filter__read_more_button{display:block;margin-bottom:1em}@-webkit-keyframes loading-fade{0%{opacity:.7}50%{opacity:1}to{opacity:.7}}@keyframes loading-fade{0%{opacity:.7}50%{opacity:1}to{opacity:.7}}.wc-block-stock-filter .components-placeholder__instructions{border-bottom:1px solid #e0e2e6;width:100%;padding-bottom:1em;margin-bottom:2em}.wc-block-stock-filter .components-placeholder__label svg{fill:currentColor;margin-left:1ch}.wc-block-stock-filter .components-placeholder__fieldset{display:block}.wc-block-stock-filter .woocommerce-search-list__search{border-top:0;margin-top:0;padding-top:0}.wc-block-stock-filter .wc-block-stock-filter__add-stock-button{margin:0 0 1em;vertical-align:middle;height:auto;padding:.5em 1em}.wc-block-stock-filter .wc-block-stock-filter__add-stock-button svg{fill:currentColor;margin-right:.5ch;vertical-align:middle}.wc-block-stock-filter .wc-block-stock-filter__read_more_button{display:block;margin-bottom:1em}woocommerce-blocks/build/wc-payment-method-cod.js000064400000003717151335517640016122 0ustar00!function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=26)}({1:function(e,t){e.exports=window.wp.i18n},26:function(e,t,n){"use strict";n.r(t);var r,o=n(7),i=n(1),u=n(4),c=n(6),l=Object(u.getSetting)("cod_data",{}),a=Object(i.__)("Cash on delivery",'woocommerce'),s=Object(c.decodeEntities)(l.title)||a,d=function(){return Object(c.decodeEntities)(l.description||"")},f=function(e){var t=e.components.PaymentMethodLabel;return React.createElement(t,{text:s})},p={name:"cod",label:React.createElement(f,null),content:React.createElement(d,null),edit:React.createElement(d,null),canMakePayment:function(e){var t=e.cartNeedsShipping,n=e.selectedShippingMethods;if(!l.enableForVirtual&&!t)return!1;if(!l.enableForShippingMethods.length)return!0;var r=Object.values(n);return l.enableForShippingMethods.some((function(e){return r.some((function(t){return t.includes(e)}))}))},ariaLabel:s,supports:{features:null!==(r=null==l?void 0:l.supports)&&void 0!==r?r:[]}};Object(o.registerPaymentMethod)(p)},4:function(e,t){e.exports=window.wc.wcSettings},6:function(e,t){e.exports=window.wp.htmlEntities},7:function(e,t){e.exports=window.wc.wcBlocksRegistry}});woocommerce-blocks/build/wc-blocks.js000064400000021035151335517640013672 0ustar00this.wc=this.wc||{},this.wc.blocks=this.wc.blocks||{},this.wc.blocks["wc-blocks"]=function(t){function e(e){for(var o,i,s=e[0],u=e[1],a=e[2],f=0,p=[];f<s.length;f++)i=s[f],Object.prototype.hasOwnProperty.call(n,i)&&n[i]&&p.push(n[i][0]),n[i]=0;for(o in u)Object.prototype.hasOwnProperty.call(u,o)&&(t[o]=u[o]);for(l&&l(e);p.length;)p.shift()();return c.push.apply(c,a||[]),r()}function r(){for(var t,e=0;e<c.length;e++){for(var r=c[e],o=!0,s=1;s<r.length;s++){var u=r[s];0!==n[u]&&(o=!1)}o&&(c.splice(e--,1),t=i(i.s=r[0]))}return t}var o={},n={41:0},c=[];function i(e){if(o[e])return o[e].exports;var r=o[e]={i:e,l:!1,exports:{}};return t[e].call(r.exports,r,r.exports,i),r.l=!0,r.exports}i.m=t,i.c=o,i.d=function(t,e,r){i.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},i.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},i.t=function(t,e){if(1&e&&(t=i(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(i.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)i.d(r,o,function(e){return t[e]}.bind(null,o));return r},i.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return i.d(e,"a",e),e},i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},i.p="";var s=window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[],u=s.push.bind(s);s.push=e,s=s.slice();for(var a=0;a<s.length;a++)e(s[a]);var l=u;return c.push([860,0]),r()}({0:function(t,e){t.exports=window.wp.element},1:function(t,e){t.exports=window.wp.i18n},21:function(t,e){t.exports=window.wp.compose},26:function(t,e){t.exports=window.wp.blocks},28:function(t,e){t.exports=window.wp.primitives},55:function(t,e){t.exports=window.wp.hooks},581:function(t,e){},582:function(t,e){},66:function(t,e,r){"use strict";var o=r(5),n=r.n(o),c=r(16),i=r.n(c),s=r(0),u=["srcElement","size"];function a(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,o)}return r}e.a=function(t){var e=t.srcElement,r=t.size,o=void 0===r?24:r,c=i()(t,u);return Object(s.isValidElement)(e)?Object(s.cloneElement)(e,function(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?a(Object(r),!0).forEach((function(e){n()(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):a(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}({width:o,height:o},c)):null}},860:function(t,e,r){"use strict";r.r(e);var o=r(33),n=r.n(o),c=r(0),i=r(26),s=r(1),u=r(66),a=r(9),l=r.n(a),f=r(16),p=r.n(f),b=r(28),m=r(6),h=r.n(m),d=["className","height","width"],w=Object(c.createElement)((function(t){var e=t.className,r=t.height,o=t.width,n=p()(t,d);return Object(c.createElement)(b.SVG,l()({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 245 145",className:h()("woo-icon",e),width:o,height:r},n),Object(c.createElement)("path",{fill:"#96588A",d:"M22.76 0h199.1a22.77 22.77 0 0 1 22.8 22.76v75.92a22.77 22.77 0 0 1-22.78 22.78h-71.41l9.77 24-43.13-24H22.76C10.1946 121.449.011 111.2654 0 98.7V22.76C.011 10.1946 10.1946.011 22.76 0z"}),Object(c.createElement)("path",{fill:"#FFF",fillRule:"nonzero",d:"M12.32 20.63a8.16 8.16 0 0 1 6.25-3.09c5.0733-.36 7.9867 2.0333 8.74 7.18 3.14 20.86 6.4933 38.5633 10.06 53.11l21.92-41.69c2-3.76 4.49-5.76 7.52-6 4.3867-.3067 7.13 2.49 8.23 8.39a186 186 0 0 0 9.47 34.23c2.62-25.38 7.0133-43.7133 13.18-55a7.73 7.73 0 0 1 6.6-4.43 8.8 8.8 0 0 1 6.32 2 7.75 7.75 0 0 1 3.05 5.74 8.52 8.52 0 0 1-1 4.77c-3.9 7.24-7.12 19.28-9.66 36.12-2.48 16.2533-3.3967 28.9633-2.75 38.13a12.25 12.25 0 0 1-1.16 6.56 6.32 6.32 0 0 1-5.33 3.53c-2.6667.18-5.3033-1.0567-7.91-3.71-9.2933-9.54-16.6567-23.7267-22.09-42.56C57.3 76.7167 52.48 86.3333 49.3 92.76c-5.86 11.3333-10.89 17.13-15.09 17.39-2.7333.1933-5.0667-2.0933-7-6.86-5.1-13.0933-10.5833-38.4033-16.45-75.93a8.56 8.56 0 0 1 1.56-6.73zM227.23 36.34a23.17 23.17 0 0 0-16-11.59 26.25 26.25 0 0 0-5.42-.58c-9.5867 0-17.41 5-23.47 15a53 53 0 0 0-7.78 28.16c0 7.7333 1.6167 14.3333 4.85 19.8a23.15 23.15 0 0 0 16 11.59 26.28 26.28 0 0 0 5.42.59c9.68 0 17.5033-5 23.47-15A53.89 53.89 0 0 0 232.08 56c0-7.7333-1.6167-14.2867-4.85-19.66zm-12.61 27.72c-1.3733 6.56-3.9167 11.5-7.63 14.82-2.9267 2.6667-5.6133 3.7433-8.06 3.23-2.4467-.5133-4.4033-2.6667-5.87-6.46a25.68 25.68 0 0 1-1.76-9.09 35.9 35.9 0 0 1 .73-7.34 33 33 0 0 1 5.28-11.88c3.3333-4.8933 6.8067-6.9467 10.42-6.16 2.44.4867 4.3933 2.64 5.86 6.46a25.68 25.68 0 0 1 1.76 9.12 35.73 35.73 0 0 1-.73 7.33v-.03zM164.57 36.34a23.2 23.2 0 0 0-16-11.59 26.42 26.42 0 0 0-5.43-.58c-9.5933 0-17.4167 5-23.47 15a53 53 0 0 0-7.78 28.16c0 7.7333 1.6133 14.3333 4.84 19.8a23.19 23.19 0 0 0 16 11.59 26.44 26.44 0 0 0 5.43.59c9.68 0 17.5033-5 23.47-15A53.88 53.88 0 0 0 169.4 56c0-7.7333-1.6133-14.2867-4.84-19.66h.01zm-12.61 27.72c-1.3667 6.56-3.91 11.5-7.63 14.82-2.93 2.64-5.63 3.72-8.07 3.23-2.44-.49-4.4-2.64-5.86-6.46a25.7 25.7 0 0 1-1.77-9.09 35.9 35.9 0 0 1 .74-7.34 33 33 0 0 1 5.28-11.88c3.3333-4.8933 6.8067-6.9467 10.42-6.16 2.44.4867 4.3933 2.64 5.86 6.46a25.91 25.91 0 0 1 1.76 9.12 35.73 35.73 0 0 1-.73 7.33v-.03z"}))}),null),v=Object(c.createElement)(b.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(c.createElement)("path",{d:"M12 11a1 1 0 011 1 1 1 0 01-1 1 1 1 0 01-1-1 1 1 0 011-1M4.2 4.2c1.5-1.4 4.5-.8 7.8 1.4 3.3-2.2 6.4-2.8 7.8-1.4 1.4 1.5.8 4.5-1.4 7.8 2.2 3.3 2.8 6.4 1.4 7.8-1.4 1.4-4.6.8-7.8-1.4-3.3 2.2-6.3 2.8-7.8 1.4-1.4-1.4-.8-4.6 1.4-7.8-2.2-3.3-2.8-6.3-1.4-7.8m11.3 4.3a29 29 0 011.7 1.8c1.4-2 2-4 1.2-4.7-.8-.7-2.6-.2-4.7 1.2l1.8 1.7m-7 7a29 29 0 01-1.7-1.8c-1.4 2-2 4-1.2 4.7.8.7 2.6.2 4.7-1.2a29 29 0 01-1.8-1.7M5.6 5.6c-.7.8-.2 2.6 1.2 4.7a29 29 0 013.5-3.5c-2-1.4-4-2-4.7-1.2m4.3 8.5l2.1 2a28.1 28.1 0 004-4.1 28.1 28.1 0 00-4-4 28.1 28.1 0 00-4 4l1.9 2.1m8.5 4.3c.7-.8.2-2.6-1.2-4.7a29 29 0 01-3.5 3.5c2 1.4 4 2 4.7 1.2z"})),O=(r(581),r(582),r(17)),g=r.n(O),y=r(18),j=r.n(y),k=r(13),E=r.n(k),P=r(19),x=r.n(P),M=r(20),B=r.n(M),W=r(10),z=r.n(W),A=r(5),D=r.n(A),_=r(21),C=r(55);var S=Object(_.createHigherOrderComponent)((function(t){return function(e){x()(s,e);var r,o,n=(r=s,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=z()(r);if(o){var n=z()(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return B()(this,t)});function s(){var t;g()(this,s);for(var e=arguments.length,r=new Array(e),o=0;o<e;o++)r[o]=arguments[o];return t=n.call.apply(n,[this].concat(r)),D()(E()(t),"mounted",!1),t}return j()(s,[{key:"componentDidMount",value:function(){var t=this.props,e=t.block,r=t.setAttributes;e.name.startsWith("woocommerce/")&&r(this.getAttributesWithDefaults())}},{key:"componentDidUpdate",value:function(){this.props.block.name.startsWith("woocommerce/")&&!this.mounted&&(this.mounted=!0)}},{key:"getAttributesWithDefaults",value:function(){var t=Object(i.getBlockType)(this.props.block.name),e=this.props.attributes;return!this.mounted&&this.props.block.name.startsWith("woocommerce/")&&void 0!==t.attributes&&void 0!==t.defaults&&(e=Object.assign({},this.props.attributes||{}),Object.keys(t.attributes).map((function(r){return void 0===e[r]&&void 0!==t.defaults[r]&&(e[r]=t.defaults[r]),r}))),e}},{key:"render",value:function(){return Object(c.createElement)(t,l()({},this.props,{attributes:this.getAttributesWithDefaults()}))}}]),s}(c.Component)}),"withDefaultAttributes");Object(C.addFilter)("editor.BlockListBlock","woocommerce-blocks/block-list-block",S),Object(C.addFilter)("blocks.getBlockAttributes","woocommerce-blocks/get-block-attributes",(function(t,e){return e.name.startsWith("woocommerce/")&&Object.keys(e.attributes).map((function(r){return void 0===t[r]&&void 0!==e.defaults&&void 0!==e.defaults[r]&&(t[r]=e.defaults[r]),r})),t})),Object(i.setCategories)([].concat(n()(Object(i.getCategories)().filter((function(t){var e=t.slug;return"woocommerce"!==e&&"woocommerce-product-elements"!==e}))),[{slug:"woocommerce",title:Object(s.__)("WooCommerce",'woocommerce'),icon:Object(c.createElement)(u.a,{srcElement:w})},{slug:"woocommerce-product-elements",title:Object(s.__)("WooCommerce Product Elements",'woocommerce'),icon:Object(c.createElement)(u.a,{srcElement:v,style:{fill:"#874FB9"}})}]))}});woocommerce-blocks/build/featured-product.js000064400000100627151335517640015270 0ustar00this.wc=this.wc||{},this.wc.blocks=this.wc.blocks||{},this.wc.blocks["featured-product"]=function(e){function t(t){for(var n,i,a=t[0],u=t[1],s=t[2],d=0,p=[];d<a.length;d++)i=a[d],Object.prototype.hasOwnProperty.call(o,i)&&o[i]&&p.push(o[i][0]),o[i]=0;for(n in u)Object.prototype.hasOwnProperty.call(u,n)&&(e[n]=u[n]);for(l&&l(t);p.length;)p.shift()();return c.push.apply(c,s||[]),r()}function r(){for(var e,t=0;t<c.length;t++){for(var r=c[t],n=!0,a=1;a<r.length;a++){var u=r[a];0!==o[u]&&(n=!1)}n&&(c.splice(t--,1),e=i(i.s=r[0]))}return e}var n={},o={24:0},c=[];function i(t){if(n[t])return n[t].exports;var r=n[t]={i:t,l:!1,exports:{}};return e[t].call(r.exports,r,r.exports,i),r.l=!0,r.exports}i.m=e,i.c=n,i.d=function(e,t,r){i.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},i.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.t=function(e,t){if(1&t&&(e=i(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(i.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)i.d(r,n,function(t){return e[t]}.bind(null,n));return r},i.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(t,"a",t),t},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.p="";var a=window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[],u=a.push.bind(a);a.push=t,a=a.slice();for(var s=0;s<a.length;s++)t(a[s]);var l=u;return c.push([769,0]),r()}({0:function(e,t){e.exports=window.wp.element},1:function(e,t){e.exports=window.wp.i18n},106:function(e,t,r){"use strict";var n=r(0),o=r(1),c=(r(2),r(66)),i=r(150),a=r(6),u=r.n(a),s=r(4),l=r(52);r(153),t.a=function(e){var t=e.className,r=e.error,a=e.isLoading,d=e.onRetry;return Object(n.createElement)(s.Placeholder,{icon:Object(n.createElement)(c.a,{srcElement:i.a}),label:Object(o.__)("Sorry, an error occurred",'woocommerce'),className:u()("wc-block-api-error",t)},Object(n.createElement)(l.a,{error:r}),d&&Object(n.createElement)(n.Fragment,null,a?Object(n.createElement)(s.Spinner,null):Object(n.createElement)(s.Button,{isSecondary:!0,onClick:d},Object(o.__)("Retry",'woocommerce'))))}},11:function(e,t){e.exports=window.React},12:function(e,t){e.exports=window.wp.blockEditor},121:function(e,t){},122:function(e,t){e.exports=window.wp.coreData},131:function(e,t,r){"use strict";var n=r(9),o=r.n(n),c=r(16),i=r.n(c),a=r(0),u=r(49),s=r(4),l=r(6),d=r.n(l),p=["className","item","isSelected","isLoading","onSelect","disabled"];t.a=function(e){var t=e.className,r=e.item,n=e.isSelected,c=e.isLoading,l=e.onSelect,f=e.disabled,b=i()(e,p);return Object(a.createElement)(a.Fragment,null,Object(a.createElement)(u.c,o()({},b,{key:r.id,className:t,isSelected:n,item:r,onSelect:l,isSingle:!0,disabled:f})),n&&c&&Object(a.createElement)("div",{key:"loading",className:d()("woocommerce-search-list__item","woocommerce-product-attributes__item","depth-1","is-loading","is-not-active")},Object(a.createElement)(s.Spinner,null)))}},14:function(e,t){e.exports=window.wp.data},149:function(e,t,r){"use strict";var n=r(33),o=r.n(n),c=r(5),i=r.n(c),a=r(9),u=r.n(a),s=r(0),l=r(1),d=r(7),p=(r(2),r(49)),f=r(21),b=r(17),g=r.n(b),m=r(18),h=r.n(m),w=r(19),O=r.n(w),v=r(20),j=r.n(v),y=r(10),_=r.n(y);var k=Object(f.createHigherOrderComponent)((function(e){var t=function(t){O()(c,t);var r,n,o=(r=c,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=_()(r);if(n){var o=_()(this).constructor;e=Reflect.construct(t,arguments,o)}else e=t.apply(this,arguments);return j()(this,e)});function c(){return g()(this,c),o.apply(this,arguments)}return h()(c,[{key:"render",value:function(){var t=this.props.selected,r=null==t;return Object(s.createElement)(e,u()({},this.props,{selected:r?[]:[t]}))}}]),c}(s.Component);return t.defaultProps={selected:null},t}),"withTransformSingleSelectToMultipleSelect"),P=r(302),S=r(29),E=r.n(S),x=r(13),C=r.n(x),R=r(22),A=r.n(R),I=r(34),D=r.n(I),T=r(39),B=r(42);function L(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function M(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?L(Object(r),!0).forEach((function(t){i()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):L(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var N=Object(f.createHigherOrderComponent)((function(e){var t=function(t){O()(c,t);var r,n,o=(r=c,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=_()(r);if(n){var o=_()(this).constructor;e=Reflect.construct(t,arguments,o)}else e=t.apply(this,arguments);return j()(this,e)});function c(){var e;g()(this,c);for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return e=o.call.apply(o,[this].concat(r)),i()(C()(e),"state",{error:null,loading:!1,variations:{}}),i()(C()(e),"loadVariations",(function(){var t=e.props.products,r=e.state,n=r.loading,o=r.variations;if(!n){var c=e.getExpandedProduct();if(c&&!o[c]){var a=t.find((function(e){return e.id===c}));a.variations&&0!==a.variations.length?(e.setState({loading:!0}),Object(T.g)(c).then((function(t){var r=t.map((function(e){return M(M({},e),{},{parent:c})}));e.setState({variations:M(M({},e.state.variations),{},i()({},c,r)),loading:!1,error:null})})).catch(function(){var t=E()(A.a.mark((function t(r){var n;return A.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,Object(B.a)(r);case 2:n=t.sent,e.setState({variations:M(M({},e.state.variations),{},i()({},c,null)),loading:!1,error:n});case 4:case"end":return t.stop()}}),t)})));return function(_x){return t.apply(this,arguments)}}())):e.setState({variations:M(M({},e.state.variations),{},i()({},c,null)),loading:!1,error:null})}}})),e}return h()(c,[{key:"componentDidMount",value:function(){var e=this.props,t=e.selected,r=e.showVariations;t&&r&&this.loadVariations()}},{key:"componentDidUpdate",value:function(e){var t=this.props,r=t.isLoading,n=t.selected;t.showVariations&&(!D()(e.selected,n)||e.isLoading&&!r)&&this.loadVariations()}},{key:"isProductId",value:function(e){return this.props.products.some((function(t){return t.id===e}))}},{key:"findParentProduct",value:function(e){return this.props.products.filter((function(t){return t.variations&&t.variations.find((function(t){return t.id===e}))}))[0].id}},{key:"getExpandedProduct",value:function(){var e=this.props,t=e.isLoading,r=e.selected;if(!e.showVariations)return null;var n=r&&r.length?r[0]:null;return n?this.prevSelectedItem=n:this.prevSelectedItem&&(t||this.isProductId(this.prevSelectedItem)||(n=this.prevSelectedItem)),!t&&n?this.isProductId(n)?n:this.findParentProduct(n):null}},{key:"render",value:function(){var t=this.props,r=t.error,n=t.isLoading,o=this.state,c=o.error,i=o.loading,a=o.variations;return Object(s.createElement)(e,u()({},this.props,{error:c||r,expandedProduct:this.getExpandedProduct(),isLoading:n,variations:a,variationsLoading:i}))}}]),c}(s.Component);return i()(t,"defaultProps",{selected:[],showVariations:!1}),t}),"withProductVariations"),U=r(52),V=r(6),G=r.n(V),F=r(131);function H(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function z(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?H(Object(r),!0).forEach((function(t){i()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):H(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}r(214);var q={list:Object(l.__)("Products",'woocommerce'),noItems:Object(l.__)("Your store doesn't have any products.",'woocommerce'),search:Object(l.__)("Search for a product to display",'woocommerce'),updated:Object(l.__)("Product search results updated.",'woocommerce')},Q=function(e){var t=e.expandedProduct,r=e.error,n=e.instanceId,c=e.isCompact,i=e.isLoading,a=e.onChange,f=e.onSearch,b=e.products,g=e.renderItem,m=e.selected,h=e.showVariations,w=e.variations,O=e.variationsLoading;if(r)return Object(s.createElement)(U.a,{error:r});var v=w&&w[t]?w[t]:[],j=[].concat(o()(b),o()(v));return Object(s.createElement)(p.b,{className:"woocommerce-products",list:j,isCompact:c,isLoading:i,isSingle:!0,selected:j.filter((function(e){var t=e.id;return m.includes(t)})),onChange:a,renderItem:g||(h?function(e){var t=e.item,r=e.search,o=e.depth,c=void 0===o?0:o,a=e.isSelected,f=e.onSelect,b=t.variations&&Array.isArray(t.variations)?t.variations.length:0,g=G()("woocommerce-search-product__item","woocommerce-search-list__item","depth-".concat(c),"has-count",{"is-searching":r.length>0,"is-skip-level":0===c&&0!==t.parent,"is-variable":b>0});if(!t.breadcrumbs.length)return Object(s.createElement)(F.a,u()({},e,{className:G()(g,{"is-selected":a}),isSelected:a,item:t,onSelect:function(){return function(){f(t)()}},isLoading:i||O,countLabel:t.variations.length>0?Object(l.sprintf)(
/* translators: %1$d is the number of variations of a product product. */
Object(l.__)("%1$d variations",'woocommerce'),t.variations.length):null,name:"products-".concat(n),"aria-label":Object(l.sprintf)(
/* translators: %1$s is the product name, %2$d is the number of variations of that product. */
Object(l._n)("%1$s, has %2$d variation","%1$s, has %2$d variations",t.variations.length,'woocommerce'),t.name,t.variations.length)}));var m=Object(d.isEmpty)(t.variation)?e:z(z({},e),{},{item:z(z({},e.item),{},{name:t.variation}),"aria-label":"".concat(t.breadcrumbs[0],": ").concat(t.variation)});return Object(s.createElement)(p.c,u()({},m,{className:g,name:"variations-".concat(n)}))}:null),onSearch:f,messages:q,isHierarchical:!0})};Q.defaultProps={isCompact:!1,expandedProduct:null,selected:[],showVariations:!1},t.a=k(Object(P.a)(N(Object(f.withInstanceId)(Q))))},15:function(e,t){e.exports=window.wp.apiFetch},150:function(e,t,r){"use strict";var n=r(0),o=r(28),c=Object(n.createElement)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(n.createElement)("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z"}));t.a=c},153:function(e,t){},21:function(e,t){e.exports=window.wp.compose},214:function(e,t){},22:function(e,t){e.exports=window.regeneratorRuntime},23:function(e,t){e.exports=window.wp.url},25:function(e,t){e.exports=window.wp.htmlEntities},26:function(e,t){e.exports=window.wp.blocks},28:function(e,t){e.exports=window.wp.primitives},3:function(e,t){e.exports=window.wc.wcSettings},302:function(e,t,r){"use strict";var n=r(9),o=r.n(n),c=r(29),i=r.n(c),a=r(8),u=r.n(a),s=r(16),l=r.n(s),d=r(0),p=r(22),f=r.n(p),b=r(37),g=r(39),m=r(222),h=r(42),w=["selected"];t.a=function(e){return function(t){var r=t.selected,n=l()(t,w),c=Object(d.useState)(!0),a=u()(c,2),s=a[0],p=a[1],O=Object(d.useState)(null),v=u()(O,2),j=v[0],y=v[1],_=Object(d.useState)([]),k=u()(_,2),P=k[0],S=k[1],E=b.o.productCount>100,x=function(){var e=i()(f.a.mark((function e(t){var r;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Object(h.a)(t);case 2:r=e.sent,y(r),p(!1);case 5:case"end":return e.stop()}}),e)})));return function(_x){return e.apply(this,arguments)}}();Object(d.useEffect)((function(){Object(g.h)({selected:r}).then((function(e){S(e),p(!1)})).catch(x)}),[r]);var C=Object(m.a)((function(e){Object(g.h)({selected:r,search:e}).then((function(e){S(e),p(!1)})).catch(x)}),400),R=u()(C,1)[0],A=Object(d.useCallback)((function(e){p(!0),R(e)}),[p,R]);return Object(d.createElement)(e,o()({},n,{selected:r,error:j,products:P,isLoading:s,onSearch:E?A:null}))}}},31:function(e,t){e.exports=window.moment},34:function(e,t){e.exports=window.wp.isShallowEqual},36:function(e,t){e.exports=window.wp.dataControls},37:function(e,t,r){"use strict";r.d(t,"o",(function(){return c})),r.d(t,"m",(function(){return i})),r.d(t,"l",(function(){return a})),r.d(t,"n",(function(){return u})),r.d(t,"j",(function(){return s})),r.d(t,"e",(function(){return l})),r.d(t,"f",(function(){return d})),r.d(t,"g",(function(){return p})),r.d(t,"k",(function(){return f})),r.d(t,"c",(function(){return b})),r.d(t,"d",(function(){return g})),r.d(t,"h",(function(){return m})),r.d(t,"a",(function(){return h})),r.d(t,"i",(function(){return w})),r.d(t,"b",(function(){return O}));var n,o=r(3),c=Object(o.getSetting)("wcBlocksConfig",{buildPhase:1,pluginUrl:"",productCount:0,defaultAvatar:"",restApiRoutes:{},wordCountType:"words"}),i=c.pluginUrl+"images/",a=c.pluginUrl+"build/",u=c.buildPhase,s=null===(n=o.STORE_PAGES.shop)||void 0===n?void 0:n.permalink,l=o.STORE_PAGES.checkout.id,d=o.STORE_PAGES.checkout.permalink,p=o.STORE_PAGES.privacy.permalink,f=(o.STORE_PAGES.privacy.title,o.STORE_PAGES.terms.permalink),b=(o.STORE_PAGES.terms.title,o.STORE_PAGES.cart.id),g=o.STORE_PAGES.cart.permalink,m=(o.STORE_PAGES.myaccount.permalink?o.STORE_PAGES.myaccount.permalink:Object(o.getSetting)("wpLoginUrl","/wp-login.php"),Object(o.getSetting)("shippingCountries",{})),h=Object(o.getSetting)("allowedCountries",{}),w=Object(o.getSetting)("shippingStates",{}),O=Object(o.getSetting)("allowedStates",{})},39:function(e,t,r){"use strict";r.d(t,"h",(function(){return f})),r.d(t,"e",(function(){return b})),r.d(t,"b",(function(){return g})),r.d(t,"i",(function(){return m})),r.d(t,"f",(function(){return h})),r.d(t,"c",(function(){return w})),r.d(t,"d",(function(){return O})),r.d(t,"g",(function(){return v})),r.d(t,"a",(function(){return j}));var n=r(5),o=r.n(n),c=r(23),i=r(15),a=r.n(i),u=r(7),s=r(3),l=r(37);function d(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function p(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?d(Object(r),!0).forEach((function(t){o()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):d(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var f=function(e){var t=e.selected,r=void 0===t?[]:t,n=e.search,o=void 0===n?"":n,i=e.queryArgs,s=function(e){var t=e.selected,r=void 0===t?[]:t,n=e.search,o=void 0===n?"":n,i=e.queryArgs,a=void 0===i?{}:i,u=l.o.productCount>100,s={per_page:u?100:0,catalog_visibility:"any",search:o,orderby:"title",order:"asc"},d=[Object(c.addQueryArgs)("/wc/store/products",p(p({},s),a))];return u&&r.length&&d.push(Object(c.addQueryArgs)("/wc/store/products",{catalog_visibility:"any",include:r,per_page:0})),d}({selected:r,search:o,queryArgs:void 0===i?{}:i});return Promise.all(s.map((function(e){return a()({path:e})}))).then((function(e){return Object(u.uniqBy)(Object(u.flatten)(e),"id").map((function(e){return p(p({},e),{},{parent:0})}))})).catch((function(e){throw e}))},b=function(e){return a()({path:"/wc/store/products/".concat(e)})},g=function(){return a()({path:"wc/store/products/attributes"})},m=function(e){return a()({path:"wc/store/products/attributes/".concat(e,"/terms")})},h=function(e){var t=e.selected,r=function(e){var t=e.selected,r=void 0===t?[]:t,n=e.search,o=Object(s.getSetting)("limitTags",!1),i=[Object(c.addQueryArgs)("wc/store/products/tags",{per_page:o?100:0,orderby:o?"count":"name",order:o?"desc":"asc",search:n})];return o&&r.length&&i.push(Object(c.addQueryArgs)("wc/store/products/tags",{include:r})),i}({selected:void 0===t?[]:t,search:e.search});return Promise.all(r.map((function(e){return a()({path:e})}))).then((function(e){return Object(u.uniqBy)(Object(u.flatten)(e),"id")}))},w=function(e){return a()({path:Object(c.addQueryArgs)("wc/store/products/categories",p({per_page:0},e))})},O=function(e){return a()({path:"wc/store/products/categories/".concat(e)})},v=function(e){return a()({path:Object(c.addQueryArgs)("wc/store/products",{per_page:0,type:"variation",parent:e})})},j=function(e,t){if(!e.title.raw)return e.slug;var r=1===t.filter((function(t){return t.title.raw===e.title.raw})).length;return e.title.raw+(r?"":" - ".concat(e.slug))}},4:function(e,t){e.exports=window.wp.components},42:function(e,t,r){"use strict";r.d(t,"a",(function(){return u})),r.d(t,"b",(function(){return s}));var n=r(29),o=r.n(n),c=r(22),i=r.n(c),a=r(1),u=function(){var e=o()(i.a.mark((function e(t){var r;return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("function"!=typeof t.json){e.next=11;break}return e.prev=1,e.next=4,t.json();case 4:return r=e.sent,e.abrupt("return",{message:r.message,type:r.type||"api"});case 8:return e.prev=8,e.t0=e.catch(1),e.abrupt("return",{message:e.t0.message,type:"general"});case 11:return e.abrupt("return",{message:t.message,type:t.type||"general"});case 12:case"end":return e.stop()}}),e,null,[[1,8]])})));return function(_x){return e.apply(this,arguments)}}(),s=function(e){if(e.data&&"rest_invalid_param"===e.code){var t=Object.values(e.data.params);if(t[0])return t[0]}return(null==e?void 0:e.message)||Object(a.__)("Something went wrong. Please contact us to get assistance.",'woocommerce')}},46:function(e,t){e.exports=window.wp.keycodes},48:function(e,t){e.exports=window.wp.escapeHtml},481:function(e,t,r){"use strict";var n=r(9),o=r.n(n),c=r(29),i=r.n(c),a=r(17),u=r.n(a),s=r(18),l=r.n(s),d=r(13),p=r.n(d),f=r(19),b=r.n(f),g=r(20),m=r.n(g),h=r(10),w=r.n(h),O=r(5),v=r.n(O),j=r(0),y=r(22),_=r.n(y),k=r(21),P=r(39),S=r(42);var E=Object(k.createHigherOrderComponent)((function(e){return function(t){b()(a,t);var r,n,c=(r=a,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=w()(r);if(n){var o=w()(this).constructor;e=Reflect.construct(t,arguments,o)}else e=t.apply(this,arguments);return m()(this,e)});function a(){var e;u()(this,a);for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return e=c.call.apply(c,[this].concat(r)),v()(p()(e),"state",{error:null,loading:!1,product:"preview"===e.props.attributes.productId?e.props.attributes.previewProduct:null}),v()(p()(e),"loadProduct",(function(){var t=e.props.attributes.productId;"preview"!==t&&(t?(e.setState({loading:!0}),Object(P.e)(t).then((function(t){e.setState({product:t,loading:!1,error:null})})).catch(function(){var t=i()(_.a.mark((function t(r){var n;return _.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,Object(S.a)(r);case 2:n=t.sent,e.setState({product:null,loading:!1,error:n});case 4:case"end":return t.stop()}}),t)})));return function(_x){return t.apply(this,arguments)}}())):e.setState({product:null,loading:!1,error:null}))})),e}return l()(a,[{key:"componentDidMount",value:function(){this.loadProduct()}},{key:"componentDidUpdate",value:function(e){e.attributes.productId!==this.props.attributes.productId&&this.loadProduct()}},{key:"render",value:function(){var t=this.state,r=t.error,n=t.loading,c=t.product;return Object(j.createElement)(e,o()({},this.props,{error:r,getProduct:this.loadProduct,isLoading:n,product:c}))}}]),a}(j.Component)}),"withProduct");t.a=E},52:function(e,t,r){"use strict";var n=r(0),o=r(1),c=(r(2),r(48));t.a=function(e){var t,r,i,a=e.error;return Object(n.createElement)("div",{className:"wc-block-error-message"},(r=(t=a).message,i=t.type,r?"general"===i?Object(n.createElement)("span",null,Object(o.__)("The following error was returned",'woocommerce'),Object(n.createElement)("br",null),Object(n.createElement)("code",null,Object(c.escapeHTML)(r))):"api"===i?Object(n.createElement)("span",null,Object(o.__)("The following error was returned from the API",'woocommerce'),Object(n.createElement)("br",null),Object(n.createElement)("code",null,Object(c.escapeHTML)(r))):r:Object(o.__)("An unknown error occurred which prevented the block from being updated.",'woocommerce')))}},55:function(e,t){e.exports=window.wp.hooks},56:function(e,t){e.exports=window.wp.deprecated},66:function(e,t,r){"use strict";var n=r(5),o=r.n(n),c=r(16),i=r.n(c),a=r(0),u=["srcElement","size"];function s(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}t.a=function(e){var t=e.srcElement,r=e.size,n=void 0===r?24:r,c=i()(e,u);return Object(a.isValidElement)(t)?Object(a.cloneElement)(t,function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?s(Object(r),!0).forEach((function(t){o()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):s(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({width:n,height:n},c)):null}},7:function(e,t){e.exports=window.lodash},74:function(e,t){e.exports=window.wp.dom},769:function(e,t,r){e.exports=r(862)},770:function(e,t){},771:function(e,t){},772:function(e,t,r){"use strict";var n=r(0),o=r(28),c=Object(n.createElement)(o.SVG,{xmlns:"http://www.w3.org/2000/SVG",viewBox:"0 0 24 24"},Object(n.createElement)("path",{fill:"none",d:"M0 0h24v24H0V0z"}),Object(n.createElement)("path",{d:"M22 9.24l-7.19-.62L12 2 9.19 8.63 2 9.24l5.46 4.73L5.82 21 12 17.27 18.18 21l-1.63-7.03L22 9.24zM12 15.4l-3.76 2.27 1-4.28-3.32-2.88 4.38-.38L12 6.1l1.71 4.04 4.38.38-3.32 2.88 1 4.28L12 15.4z"}));t.a=c},773:function(e,t,r){"use strict";r.d(t,"a",(function(){return c}));var n=r(1),o=r(37),c=[{id:1,name:"WordPress Pennant",variation:"",permalink:"https://example.org",sku:"wp-pennant",short_description:Object(n.__)("Fly your WordPress banner with this beauty! Deck out your office space or add it to your kids walls. This banner will spruce up any space it’s hung!",'woocommerce'),description:"Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.",price:"7.99",price_html:'<span class="woocommerce-Price-amount amount"><span class="woocommerce-Price-currencySymbol">$</span>7.99</span>',images:[{id:1,src:o.m+"previews/pennant.jpg",thumbnail:o.m+"previews/pennant.jpg",name:"pennant-1.jpg",alt:"WordPress Pennant",srcset:"",sizes:""}],average_rating:5,review_count:1,prices:{currency_code:"GBP",decimal_separator:".",thousand_separator:",",decimals:2,price_prefix:"£",price_suffix:"",price:"7.99",regular_price:"9.99",sale_price:"7.99",price_range:null},add_to_cart:{text:Object(n.__)("Add to cart",'woocommerce'),description:Object(n.__)("Add to cart",'woocommerce')},has_options:!1,is_purchasable:!0,is_in_stock:!0,on_sale:!0}]},862:function(e,t,r){"use strict";r.r(t);var n=r(0),o=r(1),c=r(12),i=r(26),a=r(3),u=r(66),s=r(772),l=(r(770),r(771),r(773)),d={attributes:{contentAlign:"center",dimRatio:50,editMode:!1,height:Object(a.getSetting)("default_height",500),mediaSrc:"",showDesc:!0,productId:"preview",previewProduct:l.a[0]}},p=r(9),f=r.n(p),b=r(17),g=r.n(b),m=r(18),h=r.n(m),w=r(13),O=r.n(w),v=r(19),j=r.n(v),y=r(20),_=r.n(y),k=r(10),P=r.n(k),S=r(5),E=r.n(S),x=r(14),C=r(4),R=r(6),A=r.n(R),I=r(21),D=r(7),T=(r(2),r(149)),B=r(106),L=r(481);function M(e){return e&&e.images&&e.images.length&&e.images[0].src||""}function N(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function U(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?N(Object(r),!0).forEach((function(t){E()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):N(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var V=Object(I.compose)([L.a,Object(c.withColors)({overlayColor:"background-color"}),C.withSpokenMessages,Object(x.withSelect)((function(e,t,r){var n,o,c=t.clientId,i=r.dispatch,a=e("core/block-editor").getBlock(c),u=(null==a||null===(n=a.innerBlocks[0])||void 0===n?void 0:n.clientId)||"";return{updateBlockAttributes:function(e){u&&i("core/block-editor").updateBlockAttributes(u,e)},currentButtonAttributes:(null==a||null===(o=a.innerBlocks[0])||void 0===o?void 0:o.attributes)||{}}})),Object(I.createHigherOrderComponent)((function(e){return function(t){j()(i,t);var r,o,c=(r=i,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=P()(r);if(o){var n=P()(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return _()(this,e)});function i(){var e;g()(this,i);for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return e=c.call.apply(c,[this].concat(r)),E()(O()(e),"state",{doUrlUpdate:!1}),E()(O()(e),"triggerUrlUpdate",(function(){e.setState({doUrlUpdate:!0})})),e}return h()(i,[{key:"componentDidUpdate",value:function(){var e=this.props,t=e.attributes,r=e.updateBlockAttributes,n=e.currentButtonAttributes,o=e.product;this.state.doUrlUpdate&&!t.editMode&&null!=o&&o.permalink&&null!=n&&n.url&&o.permalink!==n.url&&(r(U(U({},n),{},{url:o.permalink})),this.setState({doUrlUpdate:!1}))}},{key:"render",value:function(){return Object(n.createElement)(e,f()({triggerUrlUpdate:this.triggerUrlUpdate},this.props))}}]),i}(n.Component)}),"withUpdateButtonAttributes")])((function(e){var t,r,i,l,d=e.attributes,p=e.debouncedSpeak,f=e.error,b=e.getProduct,g=e.isLoading,m=e.isSelected,h=e.overlayColor,w=e.product,O=e.setAttributes,v=e.setOverlayColor,j=e.triggerUrlUpdate,y=void 0===j?function(){}:j,_=function(){var e=d.contentAlign,t=d.editMode,r=d.mediaSrc,i=d.mediaId||function(e){return e&&e.images&&e.images.length&&e.images[0].id||0}(w);return Object(n.createElement)(c.BlockControls,null,Object(n.createElement)(c.AlignmentToolbar,{value:e,onChange:function(e){O({contentAlign:e})}}),Object(n.createElement)(c.MediaReplaceFlow,{mediaId:i,mediaURL:r,accept:"image/*",onSelect:function(e){O({mediaId:e.id,mediaSrc:e.url})},allowedTypes:["image"]}),Object(n.createElement)(C.ToolbarGroup,{controls:[{icon:"edit",title:Object(o.__)("Edit"),onClick:function(){return O({editMode:!t})},isActive:t}]}))},k=d.editMode;return f?Object(n.createElement)(B.a,{className:"wc-block-featured-product-error",error:f,isLoading:g,onRetry:b}):k?Object(n.createElement)(n.Fragment,null,_(),Object(n.createElement)(C.Placeholder,{icon:Object(n.createElement)(u.a,{srcElement:s.a}),label:Object(o.__)("Featured Product",'woocommerce'),className:"wc-block-featured-product"},Object(o.__)("Visually highlight a product or variation and encourage prompt action",'woocommerce'),Object(n.createElement)("div",{className:"wc-block-featured-product__selection"},Object(n.createElement)(T.a,{selected:d.productId||0,showVariations:!0,onChange:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=e[0]?e[0].id:0;O({productId:t,mediaId:0,mediaSrc:""}),y()}}),Object(n.createElement)(C.Button,{isPrimary:!0,onClick:function(){O({editMode:!1}),p(Object(o.__)("Showing Featured Product block preview.",'woocommerce'))}},Object(o.__)("Done",'woocommerce'))))):Object(n.createElement)(n.Fragment,null,_(),(t=d.mediaSrc||M(w),i=void 0===(r=d.focalPoint)?{x:.5,y:.5}:r,l="function"==typeof C.FocalPointPicker,Object(n.createElement)(c.InspectorControls,{key:"inspector"},Object(n.createElement)(C.PanelBody,{title:Object(o.__)("Content",'woocommerce')},Object(n.createElement)(C.ToggleControl,{label:Object(o.__)("Show description",'woocommerce'),checked:d.showDesc,onChange:function(){return O({showDesc:!d.showDesc})}}),Object(n.createElement)(C.ToggleControl,{label:Object(o.__)("Show price",'woocommerce'),checked:d.showPrice,onChange:function(){return O({showPrice:!d.showPrice})}})),Object(n.createElement)(c.PanelColorSettings,{title:Object(o.__)("Overlay",'woocommerce'),colorSettings:[{value:h.color,onChange:v,label:Object(o.__)("Overlay Color",'woocommerce')}]},!!t&&Object(n.createElement)(n.Fragment,null,Object(n.createElement)(C.RangeControl,{label:Object(o.__)("Background Opacity",'woocommerce'),value:d.dimRatio,onChange:function(e){return O({dimRatio:e})},min:0,max:100,step:10}),l&&Object(n.createElement)(C.FocalPointPicker,{label:Object(o.__)("Focal Point Picker"),url:t,value:i,onChange:function(e){return O({focalPoint:e})}}))))),w?function(){var e,t,r,i=d.className,u=d.contentAlign,s=d.dimRatio,l=d.focalPoint,p=d.height,f=d.showDesc,b=d.showPrice,v=A()("wc-block-featured-product",{"is-selected":m&&"preview"!==d.productId,"is-loading":!w&&g,"is-not-found":!w&&!g,"has-background-dim":0!==s},0===(e=s)||50===e?null:"has-background-dim-".concat(10*Math.round(e/10)),"center"!==u&&"has-".concat(u,"-content"),i),j=(t=d.mediaSrc||w,Object(D.isObject)(t)&&(t=M(t)),t?{backgroundImage:"url(".concat(t,")")}:{});if(h.color&&(j.backgroundColor=h.color),l){var y=100*l.x,_=100*l.y;j.backgroundPosition="".concat(y,"% ").concat(_,"%")}return Object(n.createElement)(C.ResizableBox,{className:v,size:{height:p},minHeight:Object(a.getSetting)("min_height",500),enable:{bottom:!0},onResizeStop:function(e,t,r){O({height:parseInt(r.style.height,10)})},style:j},Object(n.createElement)("div",{className:"wc-block-featured-product__wrapper"},Object(n.createElement)("h2",{className:"wc-block-featured-product__title",dangerouslySetInnerHTML:{__html:w.name}}),!Object(D.isEmpty)(w.variation)&&Object(n.createElement)("h3",{className:"wc-block-featured-product__variation",dangerouslySetInnerHTML:{__html:w.variation}}),f&&Object(n.createElement)("div",{className:"wc-block-featured-product__description",dangerouslySetInnerHTML:{__html:w.short_description}}),b&&Object(n.createElement)("div",{className:"wc-block-featured-product__price",dangerouslySetInnerHTML:{__html:w.price_html}}),Object(n.createElement)("div",{className:"wc-block-featured-product__link"},(r=A()("wp-block-button__link","is-style-fill"),"preview"===d.productId?Object(n.createElement)("div",{className:"wp-block-button aligncenter",style:{width:"100%"}},Object(n.createElement)(c.RichText.Content,{tagName:"a",className:r,href:w.permalink,title:d.linkText,style:{backgroundColor:"vivid-green-cyan",borderRadius:"5px"},value:d.linkText,target:w.permalink})):Object(n.createElement)(c.InnerBlocks,{template:[["core/button",{text:Object(o.__)("Shop now",'woocommerce'),url:w.permalink,align:"center"}]],templateLock:"all"})))))}():Object(n.createElement)(C.Placeholder,{className:"wc-block-featured-product",icon:Object(n.createElement)(u.a,{srcElement:s.a}),label:Object(o.__)("Featured Product",'woocommerce')},g?Object(n.createElement)(C.Spinner,null):Object(o.__)("No product is selected.",'woocommerce')))}));Object(i.registerBlockType)("woocommerce/featured-product",{title:Object(o.__)("Featured Product",'woocommerce'),icon:{src:Object(n.createElement)(u.a,{srcElement:s.a}),foreground:"#96588a"},category:"woocommerce",keywords:[Object(o.__)("WooCommerce",'woocommerce')],description:Object(o.__)("Visually highlight a product or variation and encourage prompt action.",'woocommerce'),supports:{align:["wide","full"],html:!1},example:d,attributes:{contentAlign:{type:"string",default:"center"},dimRatio:{type:"number",default:50},editMode:{type:"boolean",default:!0},focalPoint:{type:"object"},height:{type:"number",default:Object(a.getSetting)("default_height",500)},mediaId:{type:"number",default:0},mediaSrc:{type:"string",default:""},overlayColor:{type:"string"},customOverlayColor:{type:"string"},linkText:{type:"string",default:Object(o.__)("Shop now",'woocommerce')},productId:{type:"number"},showDesc:{type:"boolean",default:!0},showPrice:{type:"boolean",default:!0},previewProduct:{type:"object",default:null}},edit:function(e){return Object(n.createElement)(V,e)},save:function(){return Object(n.createElement)(c.InnerBlocks.Content,null)}})},87:function(e,t){e.exports=window.ReactDOM},89:function(e,t){e.exports=window.wp.viewport},96:function(e,t){e.exports=window.wp.date}});woocommerce-blocks/build/checkout-frontend.asset.php000064400000000746151335517640016727 0ustar00<?php return array('dependencies' => array('lodash', 'react', 'wc-blocks-checkout', 'wc-blocks-data-store', 'wc-blocks-registry', 'wc-price-format', 'wc-settings', 'wp-a11y', 'wp-api-fetch', 'wp-autop', 'wp-compose', 'wp-data', 'wp-deprecated', 'wp-dom', 'wp-element', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-is-shallow-equal', 'wp-keycodes', 'wp-plugins', 'wp-polyfill', 'wp-primitives', 'wp-url', 'wp-warning', 'wp-wordcount'), 'version' => '8ba0100596cdb1f0313b28809b3add5b');woocommerce-blocks/build/wc-blocks-style.css000064400000567146151335517640015226 0ustar00.wc-block-link-button{border:0;border-radius:0;margin:0;padding:0;vertical-align:baseline;color:inherit;font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;letter-spacing:inherit;line-height:inherit;text-decoration:inherit;text-transform:inherit;box-shadow:none;display:inline;text-shadow:none;text-decoration:underline}.wc-block-link-button,.wc-block-link-button:active,.wc-block-link-button:focus,.wc-block-link-button:hover{background:transparent}.wc-block-suspense-placeholder{-webkit-animation:loading-fade 1.2s ease-in-out infinite;animation:loading-fade 1.2s ease-in-out infinite;background-color:var(--global--color-primary,#e0e0e0)!important;color:var(--global--color-primary,#e0e0e0)!important;outline:0!important;border:0!important;box-shadow:none;pointer-events:none;max-width:100%}.wc-block-suspense-placeholder>*{visibility:hidden}@media screen and (prefers-reduced-motion:reduce){.wc-block-suspense-placeholder{-webkit-animation:none;animation:none}}.wc-block-suspense-placeholder:after{content:" "}.wc-block-grid__products .wc-block-grid__product-image{text-decoration:none;display:block;position:relative}.wc-block-grid__products .wc-block-grid__product-image a{text-decoration:none;border:0;outline:0;box-shadow:none}.wc-block-grid__products .wc-block-grid__product-image img{height:auto;width:100%}.wc-block-grid__products .wc-block-grid__product-image img[hidden]{display:none}.edit-post-visual-editor .editor-block-list__block .wc-block-grid__product-title,.editor-styles-wrapper .wc-block-grid__product-title,.wc-block-grid__product-title{font-family:inherit;line-height:1.2em;font-weight:700;padding:0;color:inherit;font-size:inherit;display:block}.wc-block-grid__product-price{display:block}.wc-block-grid__product-price .wc-block-grid__product-price__regular{margin-right:.5em}.wc-block-grid__product-add-to-cart.wp-block-button{word-break:break-word;white-space:normal}.wc-block-grid__product-add-to-cart.wp-block-button .wp-block-button__link{word-break:break-word;white-space:normal;margin:0 auto!important;display:inline-flex;justify-content:center;text-align:center;padding:.5em 1em;font-size:1em}.wc-block-grid__product-add-to-cart.wp-block-button .wp-block-button__link.loading{opacity:.25}.wc-block-grid__product-add-to-cart.wp-block-button .wp-block-button__link.added:after{font-family:WooCommerce;content:"";margin-left:.5em;display:inline-block;width:auto;height:auto}.wc-block-grid__product-add-to-cart.wp-block-button .wp-block-button__link.loading:after{font-family:WooCommerce;content:"";-webkit-animation:spin 2s linear infinite;animation:spin 2s linear infinite;margin-left:.5em;display:inline-block;width:auto;height:auto}.has-5-columns:not(.alignfull) .wc-block-grid__product-add-to-cart.wp-block-button .wp-block-button__link:after,.has-6-columns .wc-block-grid__product-add-to-cart.wp-block-button .wp-block-button__link:after,.has-7-columns .wc-block-grid__product-add-to-cart.wp-block-button .wp-block-button__link:after,.has-8-columns .wc-block-grid__product-add-to-cart.wp-block-button .wp-block-button__link:after,.has-9-columns .wc-block-grid__product-add-to-cart.wp-block-button .wp-block-button__link:after{content:"";margin:0}.wc-block-grid__product-rating{display:block}.wc-block-grid__product-rating .star-rating,.wc-block-grid__product-rating .wc-block-grid__product-rating__stars{overflow:hidden;position:relative;width:5.3em;height:1.618em;line-height:1.618;font-size:1em;font-family:star;font-weight:400;margin:0 auto;text-align:left}.wc-block-grid__product-rating .star-rating:before,.wc-block-grid__product-rating .wc-block-grid__product-rating__stars:before{content:"SSSSS";top:0;left:0;right:0;position:absolute;opacity:.5;color:#aaa;white-space:nowrap}.wc-block-grid__product-rating .star-rating span,.wc-block-grid__product-rating .wc-block-grid__product-rating__stars span{overflow:hidden;top:0;left:0;right:0;position:absolute;padding-top:1.5em}.wc-block-grid__product-rating .star-rating span:before,.wc-block-grid__product-rating .wc-block-grid__product-rating__stars span:before{content:"SSSSS";top:0;left:0;right:0;position:absolute;color:#000;white-space:nowrap}.wc-block-grid__product-onsale{font-size:.875em;padding:.25em .75em;display:inline-block;width:auto;border:1px solid #43454b;border-radius:3px;color:#43454b;background:#fff;text-align:center;text-transform:uppercase;font-weight:600;z-index:9;position:relative}.wc-block-grid__product .wc-block-grid__product-image,.wc-block-grid__product .wc-block-grid__product-title{margin:0 0 12px}.wc-block-grid__product .wc-block-grid__product-add-to-cart,.wc-block-grid__product .wc-block-grid__product-onsale,.wc-block-grid__product .wc-block-grid__product-price,.wc-block-grid__product .wc-block-grid__product-rating{margin:0 auto 12px}.theme-twentysixteen .wc-block-grid .price ins{color:#77a464}.theme-twentynineteen .wc-block-grid__product{font-size:.88889em}.theme-twentynineteen .wc-block-components-product-sale-badge,.theme-twentynineteen .wc-block-components-product-title,.theme-twentynineteen .wc-block-grid__product-onsale,.theme-twentynineteen .wc-block-grid__product-title{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Fira Sans,Droid Sans,Helvetica Neue,sans-serif}.theme-twentynineteen .wc-block-grid__product-title:before{display:none}.theme-twentynineteen .wc-block-components-product-sale-badge,.theme-twentynineteen .wc-block-grid__product-onsale{line-height:1}.theme-twentynineteen .editor-styles-wrapper .wp-block-button .wp-block-button__link:not(.has-text-color){color:#fff}.theme-twentytwenty .wc-block-grid__product-link{color:#000}.theme-twentytwenty .wc-block-components-product-title,.theme-twentytwenty .wc-block-grid__product-title{font-family:-apple-system,blinkmacsystemfont,Helvetica Neue,helvetica,sans-serif;color:#cd2653;font-size:1em}.theme-twentytwenty .wp-block-columns .wc-block-components-product-title{margin-top:0}.theme-twentytwenty .wc-block-components-product-price .woocommerce-Price-amount,.theme-twentytwenty .wc-block-components-product-price__value,.theme-twentytwenty .wc-block-grid__product-price .woocommerce-Price-amount,.theme-twentytwenty .wc-block-grid__product-price__value{font-family:-apple-system,blinkmacsystemfont,Helvetica Neue,helvetica,sans-serif;font-size:.9em}.theme-twentytwenty .wc-block-components-product-price del,.theme-twentytwenty .wc-block-grid__product-price del{opacity:.5}.theme-twentytwenty .wc-block-components-product-price ins,.theme-twentytwenty .wc-block-grid__product-price ins{text-decoration:none}.theme-twentytwenty .star-rating,.theme-twentytwenty .wc-block-grid__product-rating{font-size:.7em}.theme-twentytwenty .star-rating .wc-block-components-product-rating__stars,.theme-twentytwenty .star-rating .wc-block-grid__product-rating__stars,.theme-twentytwenty .wc-block-grid__product-rating .wc-block-components-product-rating__stars,.theme-twentytwenty .wc-block-grid__product-rating .wc-block-grid__product-rating__stars{line-height:1}.theme-twentytwenty .wc-block-components-product-button>.wp-block-button__link,.theme-twentytwenty .wc-block-grid__product-add-to-cart>.wp-block-button__link{font-family:-apple-system,blinkmacsystemfont,Helvetica Neue,helvetica,sans-serif}.theme-twentytwenty .wc-block-components-product-sale-badge,.theme-twentytwenty .wc-block-grid__products .wc-block-grid__product-onsale{background:#cd2653;color:#fff;font-family:-apple-system,blinkmacsystemfont,Helvetica Neue,helvetica,sans-serif;font-weight:700;letter-spacing:-.02em;line-height:1.2;text-transform:uppercase}.theme-twentytwenty .wc-block-grid__products .wc-block-components-product-sale-badge{position:static}.theme-twentytwenty .wc-block-grid__products .wc-block-grid__product-image .wc-block-components-product-sale-badge{position:absolute}.theme-twentytwenty .wc-block-grid__products .wc-block-grid__product-onsale:not(.wc-block-components-product-sale-badge){position:absolute;right:4px;top:4px;z-index:1}.theme-twentytwenty .wc-block-active-filters__title,.theme-twentytwenty .wc-block-attribute-filter__title,.theme-twentytwenty .wc-block-price-filter__title,.theme-twentytwenty .wc-block-stock-filter__title{font-size:1em}.theme-twentytwenty .wc-block-active-filters .wc-block-active-filters__clear-all{font-size:.75em}.theme-twentytwenty .wc-block-grid__product-add-to-cart.wp-block-button .wp-block-button__link{font-size:.75em;padding:.5em}@media only screen and (min-width:768px){.theme-twentytwenty .wc-block-grid__products .wc-block-grid__product-onsale{font-size:.875em;padding:.5em}}@media only screen and (min-width:1168px){.theme-twentytwenty .wc-block-grid__products .wc-block-grid__product-onsale{font-size:.875em;padding:.5em}}.screen-reader-text{border:0;clip:rect(1px,1px,1px,1px);-webkit-clip-path:inset(50%);clip-path:inset(50%);height:1px;margin:-1px;overflow:hidden;overflow-wrap:normal!important;word-wrap:normal!important;padding:0;position:absolute!important;width:1px}.screen-reader-text:focus{background-color:#fff;border-radius:3px;box-shadow:0 0 2px 2px rgba(0,0,0,.6);clip:auto!important;-webkit-clip-path:none;clip-path:none;color:#2b2d2f;display:block;font-size:.875rem;font-weight:700;height:auto;left:5px;line-height:normal;padding:15px 23px 14px;text-decoration:none;top:5px;width:auto;z-index:100000}.wc-block-components-product-add-to-cart-attribute-picker{margin:0;flex-basis:100%}.wc-block-components-product-add-to-cart-attribute-picker label{display:block;font-size:1em}.wc-block-components-product-add-to-cart-attribute-picker .wc-block-components-product-add-to-cart-attribute-picker__container{position:relative}.wc-block-components-product-add-to-cart-attribute-picker .wc-block-components-product-add-to-cart-attribute-picker__select{margin:0 0 .75em}.wc-block-components-product-add-to-cart-attribute-picker .wc-block-components-product-add-to-cart-attribute-picker__select select{min-width:60%;min-height:1.75em}.wc-block-components-product-add-to-cart-attribute-picker .wc-block-components-product-add-to-cart-attribute-picker__select.has-error{margin-bottom:24px}.wc-block-components-product-add-to-cart-attribute-picker .wc-block-components-product-add-to-cart-attribute-picker__select.has-error select{border-color:#cc1818}.wc-block-components-product-add-to-cart-attribute-picker .wc-block-components-product-add-to-cart-attribute-picker__select.has-error select:focus{outline-color:#cc1818}.wc-block-components-product-add-to-cart{margin:0;display:flex;flex-wrap:wrap}.wc-block-components-product-add-to-cart .wc-block-components-product-add-to-cart-button{margin:0 0 .75em}.wc-block-components-product-add-to-cart .wc-block-components-product-add-to-cart-button .wc-block-components-button__text{display:block}.wc-block-components-product-add-to-cart .wc-block-components-product-add-to-cart-button .wc-block-components-button__text>svg{fill:currentColor;vertical-align:top;width:1.5em;height:1.5em;margin:-.25em 0 -.25em .5em}.wc-block-components-product-add-to-cart .wc-block-components-product-add-to-cart-quantity{margin:0 1em .75em 0;flex-basis:5em;padding:.618em;background:#fff;border:1px solid #ccc;border-radius:2px;color:#43454b;box-shadow:inset 0 1px 1px rgba(0,0,0,.125);text-align:center}.is-loading .wc-block-components-product-add-to-cart .wc-block-components-product-add-to-cart-button,.is-loading .wc-block-components-product-add-to-cart .wc-block-components-product-add-to-cart-quantity,.wc-block-components-product-add-to-cart--placeholder .wc-block-components-product-add-to-cart-button,.wc-block-components-product-add-to-cart--placeholder .wc-block-components-product-add-to-cart-quantity{-webkit-animation:loading-fade 1.2s ease-in-out infinite;animation:loading-fade 1.2s ease-in-out infinite;background-color:var(--global--color-primary,#e0e0e0)!important;color:var(--global--color-primary,#e0e0e0)!important;outline:0!important;border:0!important;box-shadow:none;pointer-events:none;max-width:100%}.is-loading .wc-block-components-product-add-to-cart .wc-block-components-product-add-to-cart-button>*,.is-loading .wc-block-components-product-add-to-cart .wc-block-components-product-add-to-cart-quantity>*,.wc-block-components-product-add-to-cart--placeholder .wc-block-components-product-add-to-cart-button>*,.wc-block-components-product-add-to-cart--placeholder .wc-block-components-product-add-to-cart-quantity>*{visibility:hidden}@media screen and (prefers-reduced-motion:reduce){.is-loading .wc-block-components-product-add-to-cart .wc-block-components-product-add-to-cart-button,.is-loading .wc-block-components-product-add-to-cart .wc-block-components-product-add-to-cart-quantity,.wc-block-components-product-add-to-cart--placeholder .wc-block-components-product-add-to-cart-button,.wc-block-components-product-add-to-cart--placeholder .wc-block-components-product-add-to-cart-quantity{-webkit-animation:none;animation:none}}.wc-block-grid .wc-block-components-product-add-to-cart{justify-content:center}.wc-block-components-product-add-to-cart-notice{margin:0}.wp-block-button.wc-block-components-product-button{word-break:break-word;white-space:normal;margin-top:0;margin-bottom:12px}.wp-block-button.wc-block-components-product-button .wc-block-components-product-button__button{word-break:break-word;white-space:normal;margin:0 auto;display:inline-flex;justify-content:center}.wp-block-button.wc-block-components-product-button .wc-block-components-product-button__button--placeholder{-webkit-animation:loading-fade 1.2s ease-in-out infinite;animation:loading-fade 1.2s ease-in-out infinite;background-color:var(--global--color-primary,#e0e0e0)!important;color:var(--global--color-primary,#e0e0e0)!important;outline:0!important;border:0!important;box-shadow:none;pointer-events:none;max-width:100%;min-width:8em;min-height:3em}.wp-block-button.wc-block-components-product-button .wc-block-components-product-button__button--placeholder>*{visibility:hidden}@media screen and (prefers-reduced-motion:reduce){.wp-block-button.wc-block-components-product-button .wc-block-components-product-button__button--placeholder{-webkit-animation:none;animation:none}}.is-loading .wc-block-components-product-button>.wc-block-components-product-button__button{-webkit-animation:loading-fade 1.2s ease-in-out infinite;animation:loading-fade 1.2s ease-in-out infinite;background-color:var(--global--color-primary,#e0e0e0)!important;color:var(--global--color-primary,#e0e0e0)!important;outline:0!important;border:0!important;box-shadow:none;pointer-events:none;max-width:100%;min-width:8em;min-height:3em}.is-loading .wc-block-components-product-button>.wc-block-components-product-button__button>*{visibility:hidden}@media screen and (prefers-reduced-motion:reduce){.is-loading .wc-block-components-product-button>.wc-block-components-product-button__button{-webkit-animation:none;animation:none}}.theme-twentytwentyone .editor-styles-wrapper .wc-block-components-product-button .wp-block-button__link{background-color:var(--button--color-background);color:var(--button--color-text);border-color:var(--button--color-background)}.wc-block-components-product-category-list{margin-top:0;margin-bottom:.75em}.wc-block-components-product-category-list ul{margin:0;padding:0;display:inline}.wc-block-components-product-category-list ul li{display:inline;list-style:none}.wc-block-components-product-category-list ul li:after{content:", "}.wc-block-components-product-category-list ul li:last-child:after{content:""}.editor-styles-wrapper .wc-block-grid__products .wc-block-grid__product .wc-block-components-product-image,.wc-block-components-product-image{margin-top:0;margin-bottom:12px;text-decoration:none;display:block;position:relative}.editor-styles-wrapper .wc-block-grid__products .wc-block-grid__product .wc-block-components-product-image a,.wc-block-components-product-image a{text-decoration:none;border:0;outline:0;box-shadow:none}.editor-styles-wrapper .wc-block-grid__products .wc-block-grid__product .wc-block-components-product-image img,.wc-block-components-product-image img{vertical-align:middle;width:100%}.editor-styles-wrapper .wc-block-grid__products .wc-block-grid__product .wc-block-components-product-image img[hidden],.wc-block-components-product-image img[hidden]{display:none}.editor-styles-wrapper .wc-block-grid__products .wc-block-grid__product .wc-block-components-product-image .wc-block-components-product-sale-badge--align-left,.wc-block-components-product-image .wc-block-components-product-sale-badge--align-left{position:absolute;left:4px;top:4px;right:auto;margin:0}.editor-styles-wrapper .wc-block-grid__products .wc-block-grid__product .wc-block-components-product-image .wc-block-components-product-sale-badge--align-center,.wc-block-components-product-image .wc-block-components-product-sale-badge--align-center{position:absolute;top:4px;left:50%;right:auto;transform:translateX(-50%);margin:0}.editor-styles-wrapper .wc-block-grid__products .wc-block-grid__product .wc-block-components-product-image .wc-block-components-product-sale-badge--align-right,.wc-block-components-product-image .wc-block-components-product-sale-badge--align-right{position:absolute;right:4px;top:4px;left:auto;margin:0}.is-loading .wc-block-components-product-image{-webkit-animation:loading-fade 1.2s ease-in-out infinite;animation:loading-fade 1.2s ease-in-out infinite;background-color:var(--global--color-primary,#e0e0e0)!important;color:var(--global--color-primary,#e0e0e0)!important;outline:0!important;border:0!important;box-shadow:none;pointer-events:none;max-width:100%}.is-loading .wc-block-components-product-image>*{visibility:hidden}@media screen and (prefers-reduced-motion:reduce){.is-loading .wc-block-components-product-image{-webkit-animation:none;animation:none}}.wc-block-components-product-rating{display:block;margin-top:0;margin-bottom:12px}.wc-block-components-product-rating__stars{overflow:hidden;position:relative;width:5.3em;height:1.618em;line-height:1.618;font-size:1em;font-family:star;font-weight:400;margin:0 auto;text-align:left}.wc-block-components-product-rating__stars:before{content:"SSSSS";top:0;left:0;right:0;position:absolute;opacity:.5;color:#aaa;white-space:nowrap}.wc-block-components-product-rating__stars span{overflow:hidden;top:0;left:0;right:0;position:absolute;padding-top:1.5em}.wc-block-components-product-rating__stars span:before{content:"SSSSS";top:0;left:0;right:0;position:absolute;color:#000;white-space:nowrap}.wc-block-single-product .wc-block-components-product-rating__stars{margin:0}.wc-block-components-product-sale-badge{margin:0 auto 12px;font-size:.875em;padding:.25em .75em;display:inline-block;width:auto;border:1px solid #43454b;border-radius:3px;color:#43454b;background:#fff;text-align:center;text-transform:uppercase;font-weight:600;z-index:9;position:static}.wc-block-components-product-sku{margin-top:0;margin-bottom:12px;display:block;text-transform:uppercase;font-size:.875em}.wc-block-components-product-stock-indicator{margin-top:0;margin-bottom:.75em;display:block;font-size:.875em}.wc-block-components-product-stock-indicator--in-stock{color:#4ab866}.wc-block-components-product-stock-indicator--out-of-stock{color:#cc1818}.wc-block-components-product-stock-indicator--available-on-backorder,.wc-block-components-product-stock-indicator--low-stock{color:#f0b849}.wc-block-components-product-summary{margin-top:0;margin-bottom:12px}.is-loading .wc-block-components-product-summary:before{-webkit-animation:loading-fade 1.2s ease-in-out infinite;animation:loading-fade 1.2s ease-in-out infinite;background-color:var(--global--color-primary,#e0e0e0)!important;color:var(--global--color-primary,#e0e0e0)!important;outline:0!important;border:0!important;box-shadow:none;pointer-events:none;max-width:100%;content:".";display:block;width:100%;height:6em}.is-loading .wc-block-components-product-summary:before>*{visibility:hidden}@media screen and (prefers-reduced-motion:reduce){.is-loading .wc-block-components-product-summary:before{-webkit-animation:none;animation:none}}.wc-block-components-product-tag-list{margin-top:0;margin-bottom:.75em}.wc-block-components-product-tag-list ul{margin:0;padding:0;display:inline}.wc-block-components-product-tag-list ul li{display:inline;list-style:none}.wc-block-components-product-tag-list ul li:after{content:", "}.wc-block-components-product-tag-list ul li:last-child:after{content:""}.wc-block-components-product-title{margin-top:0;margin-bottom:12px}.wc-block-grid .wc-block-components-product-title{line-height:1.5;font-weight:700;padding:0;color:inherit;font-size:inherit;display:block}.is-loading .wc-block-components-product-title:before{-webkit-animation:loading-fade 1.2s ease-in-out infinite;animation:loading-fade 1.2s ease-in-out infinite;background-color:var(--global--color-primary,#e0e0e0)!important;color:var(--global--color-primary,#e0e0e0)!important;outline:0!important;border:0!important;box-shadow:none;pointer-events:none;max-width:100%;content:".";display:inline-block;width:7em}.is-loading .wc-block-components-product-title:before>*{visibility:hidden}@media screen and (prefers-reduced-motion:reduce){.is-loading .wc-block-components-product-title:before{-webkit-animation:none;animation:none}}.is-loading .wc-block-grid .wc-block-components-product-title:before{width:10em}.wc-block-components-product-title--align-left{text-align:left}.wc-block-components-product-title--align-center{text-align:center}.wc-block-components-product-title--align-right{text-align:right}.wc-block-components-error{display:flex;padding:40px 0;margin:40px 0;align-items:center;justify-content:center;flex-direction:column;color:#757575;text-align:center}.wc-block-components-error__header{font-size:2em;margin:0;color:#646970}.wc-block-components-error__image{width:25%;margin:0 0 24px}.wc-block-components-error__text{margin:1em 0 0;color:#8c8f94;font-size:1.25em;max-width:60ch}.wc-block-components-error__message{margin:1em auto 0;font-style:italic;color:#8c8f94;max-width:60ch}.wc-block-error__button{margin:40px 0 0}.wc-block-components-button:not(.is-link){color:inherit;font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;letter-spacing:inherit;line-height:inherit;text-decoration:inherit;text-transform:inherit;align-items:center;background-color:#1e1e1e;color:#fff;display:inline-flex;font-weight:700;min-height:3em;justify-content:center;line-height:1;padding:0 1em;text-align:center;text-decoration:none;text-transform:none;position:relative}.wc-block-components-button:not(.is-link):active,.wc-block-components-button:not(.is-link):disabled,.wc-block-components-button:not(.is-link):focus,.wc-block-components-button:not(.is-link):hover{background-color:#1e1e1e;color:#fff}.wc-block-components-button:not(.is-link) .wc-block-components-button__text{display:block}.wc-block-components-button:not(.is-link) .wc-block-components-button__text>svg{fill:currentColor}.wc-block-components-button:not(.is-link) .wc-block-components-spinner+.wc-block-components-button__text{visibility:hidden}.wc-block-components-form{counter-reset:checkout-step}.wc-block-components-form .wc-block-components-checkout-step{position:relative;border:none;padding:0 0 0 24px;background:none;margin:0}.is-mobile .wc-block-components-form .wc-block-components-checkout-step,.is-small .wc-block-components-form .wc-block-components-checkout-step{padding-left:0}.wc-block-components-checkout-step--disabled{opacity:.6}.wc-block-components-checkout-step__container{position:relative}.wc-block-components-checkout-step__content>*{margin-bottom:1em}.wc-block-components-checkout-step--with-step-number .wc-block-components-checkout-step__content>:last-child{margin-bottom:0;padding-bottom:1.5em}.wc-block-components-checkout-step__heading{display:flex;justify-content:space-between;align-content:center;flex-wrap:wrap;margin:.75em 0 1em;position:relative;align-items:center;gap:1em}.wc-block-components-checkout-step:first-child .wc-block-components-checkout-step__heading,.wc-block-components-express-payment-continue-rule+.wc-block-components-checkout-step .wc-block-components-checkout-step__heading{margin-top:0}.wc-block-components-checkout-step__title{margin:0 12px 0 0}.wc-block-components-checkout-step__heading-content{font-size:.75em}.wc-block-components-checkout-step__heading-content a{font-weight:700;color:inherit}.wc-block-components-checkout-step__description{font-size:.875em;line-height:1.25;margin-bottom:16px}.wc-block-components-checkout-step--with-step-number .wc-block-components-checkout-step__title:before{border:0;border-radius:0;margin:0;padding:0;vertical-align:baseline;background:transparent;counter-increment:checkout-step;content:" " counter(checkout-step) ".";content:" " counter(checkout-step) "."/"";position:absolute;width:24px;left:-24px;top:0;text-align:center;transform:translateX(-50%)}.wc-block-components-checkout-step--with-step-number .wc-block-components-checkout-step__container:after{content:"";height:100%;border-left:1px solid;opacity:.3;position:absolute;left:-24px;top:0}.is-mobile .wc-block-components-checkout-step--with-step-number .wc-block-components-checkout-step__title:before,.is-small .wc-block-components-checkout-step--with-step-number .wc-block-components-checkout-step__title:before{position:static;transform:none;left:auto;top:auto;content:counter(checkout-step) ". ";content:counter(checkout-step) ". "/""}.is-mobile .wc-block-components-checkout-step--with-step-number .wc-block-components-checkout-step__container:after,.is-small .wc-block-components-checkout-step--with-step-number .wc-block-components-checkout-step__container:after{content:unset}.editor-styles-wrapper .wp-block h4.wc-block-components-checkout-step__title{font-size:1em;line-height:24px;margin:0 12px 0 0}.wc-block-components-order-summary .wc-block-components-panel__button{padding-top:0;margin-top:0}.wc-block-components-order-summary .wc-block-components-panel__content{margin-bottom:0}.wc-block-components-order-summary__content{display:table;width:100%}.wc-block-components-order-summary-item{position:relative;font-size:.875em;display:flex;padding-bottom:1px;padding-top:16px;width:100%}.wc-block-components-order-summary-item:after{border-style:solid;border-width:0 0 1px;bottom:0;content:"";display:block;left:0;opacity:.3;pointer-events:none;position:absolute;right:0;top:0}.wc-block-components-order-summary-item:first-child{padding-top:0}.wc-block-components-order-summary-item:last-child>div{padding-bottom:0}.wc-block-components-order-summary-item:last-child:after{display:none}.wc-block-components-order-summary-item .wc-block-components-product-metadata{font-size:1em}.wc-block-components-order-summary-item__description,.wc-block-components-order-summary-item__image{display:table-cell;vertical-align:top}.wc-block-components-order-summary-item__image{width:48px;padding-bottom:16px;position:relative}.wc-block-components-order-summary-item__image>img{width:48px;max-width:48px}.wc-block-components-order-summary-item__quantity{align-items:center;background:#fff;border:2px solid;border-radius:1em;box-shadow:0 0 0 2px #fff;color:#000;display:flex;line-height:1;min-height:20px;padding:0 .4em;position:absolute;justify-content:center;min-width:20px;right:0;top:0;transform:translate(50%,-50%);white-space:nowrap;z-index:1}.wc-block-components-order-summary-item__description{padding-left:24px;padding-right:12px;padding-bottom:16px}.wc-block-components-order-summary-item__description .wc-block-components-product-metadata,.wc-block-components-order-summary-item__description p{line-height:1.375;margin-top:4px}.wc-block-components-order-summary-item__total-price{font-weight:700;margin-left:auto;text-align:right}.wc-block-components-order-summary-item__individual-prices{display:block}.wc-block-components-payment-method-icons{margin:0 0 14px;display:flex;flex-direction:row;flex-wrap:wrap;justify-content:center}.wc-block-components-payment-method-icons .wc-block-components-payment-method-icon{display:inline-block;margin:0 4px 2px;padding:0;width:auto;max-width:38px;height:24px;max-height:24px}.wc-block-components-payment-method-icons--align-left{justify-content:flex-start}.wc-block-components-payment-method-icons--align-left .wc-block-components-payment-method-icon{margin-left:0;margin-right:8px}.wc-block-components-payment-method-icons--align-right{justify-content:flex-end}.wc-block-components-payment-method-icons--align-right .wc-block-components-payment-method-icon{margin-right:0;margin-left:8px}.wc-block-components-payment-method-icons:last-child{margin-bottom:0}.is-mobile .wc-block-components-payment-method-icons .wc-block-components-payment-method-icon,.is-small .wc-block-components-payment-method-icons .wc-block-components-payment-method-icon{height:16px}.wc-block-components-payment-method-label--with-icon{display:inline-block;vertical-align:middle}.wc-block-components-payment-method-label--with-icon>img,.wc-block-components-payment-method-label--with-icon>svg{vertical-align:middle;margin:-2px 4px 0 0}.is-mobile .wc-block-components-payment-method-label--with-icon>img,.is-mobile .wc-block-components-payment-method-label--with-icon>svg,.is-small .wc-block-components-payment-method-label--with-icon>img,.is-small .wc-block-components-payment-method-label--with-icon>svg{display:none}.editor-styles-wrapper .wc-block-components-checkout-policies,.wc-block-components-checkout-policies{font-size:.75em;text-align:center;list-style:none outside;line-height:1;margin:24px 0}.wc-block-components-checkout-policies__item{list-style:none outside;display:inline-block;padding:0 .25em;margin:0}.wc-block-components-checkout-policies__item:not(:first-child){border-left:1px solid #ccc}.wc-block-components-checkout-policies__item>a{color:inherit;padding:0 .25em}.wc-block-components-product-badge{font-size:.75em;border-radius:2px;border:1px solid;display:inline-block;font-weight:600;padding:0 .66em;text-transform:uppercase;white-space:nowrap}.wc-block-components-product-details.wc-block-components-product-details{list-style:none;margin:.5em 0;padding:0}.wc-block-components-product-details.wc-block-components-product-details:last-of-type{margin-bottom:0}.wc-block-components-product-details.wc-block-components-product-details li{margin-left:0}.wc-block-components-product-details__name,.wc-block-components-product-details__value{display:inline-block}.is-large:not(.wc-block-checkout) .wc-block-components-product-details__name{font-weight:700}.wc-block-components-product-metadata{font-size:.75em}.wc-block-components-product-metadata .wc-block-components-product-metadata__description>p,.wc-block-components-product-metadata .wc-block-components-product-metadata__variation-data{margin:.25em 0}.wc-block-components-checkout-return-to-cart-button{box-shadow:none;color:inherit;padding-left:calc(24px + .25em);position:relative;text-decoration:none}.wc-block-components-checkout-return-to-cart-button svg{left:0;position:absolute;transform:translateY(-50%);top:50%}.wc-block-components-shipping-calculator-address{margin-bottom:0}.wc-block-components-shipping-calculator-address__button{width:100%;margin-top:1.5em}.wc-block-components-shipping-calculator{padding:.5em 0 .75em}.wc-block-components-shipping-rates-control__package .wc-block-components-panel__button{margin-bottom:0;margin-top:0;padding-bottom:.75em;padding-top:.75em}.wc-block-components-shipping-rates-control__package .wc-block-components-panel__content,.wc-block-components-shipping-rates-control__package .wc-block-components-radio-control,.wc-block-components-shipping-rates-control__package .wc-block-components-radio-control .wc-block-components-radio-control__option-layout,.wc-block-components-shipping-rates-control__package .wc-block-components-radio-control__option-layout{padding-bottom:0}.wc-block-components-shipping-rates-control__package-items{font-size:.875em;display:block;list-style:none;margin:0;padding:0}.wc-block-components-shipping-rates-control__package-item{overflow-wrap:anywhere;word-break:break-word;-ms-word-break:break-all;display:inline-block;margin:0;padding:0}.wc-block-components-shipping-rates-control__package-item:not(:last-child):after{content:", ";white-space:pre}.wc-block-components-totals-coupon .wc-block-components-panel__button{margin-top:0;padding-top:0}.wc-block-components-totals-coupon .wc-block-components-panel__content{padding-bottom:0}.wc-block-components-totals-coupon__form{display:flex;width:100%;margin-bottom:0}.wc-block-components-totals-coupon__form .wc-block-components-totals-coupon__input{margin-bottom:0;margin-top:0;flex-grow:1}.wc-block-components-totals-coupon__form .wc-block-components-totals-coupon__button{height:3em;flex-shrink:0;margin-left:8px;padding-left:24px;padding-right:24px;white-space:nowrap}.wc-block-components-totals-coupon__form .wc-block-components-totals-coupon__button.no-margin{margin:0}.wc-block-components-totals-coupon__content{flex-direction:column;position:relative}.wc-block-components-totals-discount__coupon-list{list-style:none;margin:0;padding:0}.wc-block-components-totals-discount .wc-block-components-totals-item__value{color:#4ab866}.wc-block-components-totals-footer-item .wc-block-components-totals-item__label,.wc-block-components-totals-footer-item .wc-block-components-totals-item__value{font-size:1.25em}.wc-block-components-totals-footer-item .wc-block-components-totals-item__label{font-weight:700}.wc-block-components-totals-footer-item .wc-block-components-totals-footer-item-tax{margin-bottom:0}.wc-block-components-totals-shipping fieldset.wc-block-components-totals-shipping__fieldset{background-color:transparent;margin:0;padding:0;border:0}.wc-block-components-totals-shipping .wc-block-components-totals-shipping__via{margin-bottom:16px}.wc-block-components-totals-shipping .wc-block-components-totals-shipping__options .wc-block-components-radio-control__description,.wc-block-components-totals-shipping .wc-block-components-totals-shipping__options .wc-block-components-radio-control__label,.wc-block-components-totals-shipping .wc-block-components-totals-shipping__options .wc-block-components-radio-control__secondary-description,.wc-block-components-totals-shipping .wc-block-components-totals-shipping__options .wc-block-components-radio-control__secondary-label{flex-basis:100%;text-align:left}.wc-block-components-totals-shipping .wc-block-components-shipping-rates-control__no-results-notice{margin:0 0 .75em}.wc-block-components-totals-shipping .wc-block-components-totals-shipping__change-address-button{border:0;border-radius:0;margin:0;padding:0;vertical-align:baseline;color:inherit;font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;letter-spacing:inherit;line-height:inherit;text-decoration:inherit;text-transform:inherit;background:transparent;box-shadow:none;display:inline;text-shadow:none;text-decoration:underline}.wc-block-components-totals-shipping .wc-block-components-totals-shipping__change-address-button:active,.wc-block-components-totals-shipping .wc-block-components-totals-shipping__change-address-button:focus,.wc-block-components-totals-shipping .wc-block-components-totals-shipping__change-address-button:hover{background:transparent;opacity:.8}.theme-twentytwentyone.theme-twentytwentyone.theme-twentytwentyone .wc-block-components-totals-shipping__change-address-button{border:0;border-radius:0;margin:0;padding:0;vertical-align:baseline;color:inherit;font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;letter-spacing:inherit;line-height:inherit;text-decoration:inherit;text-transform:inherit;background:transparent;box-shadow:none;display:inline;text-shadow:none;text-decoration:underline}.theme-twentytwentyone.theme-twentytwentyone.theme-twentytwentyone .wc-block-components-totals-shipping__change-address-button:active,.theme-twentytwentyone.theme-twentytwentyone.theme-twentytwentyone .wc-block-components-totals-shipping__change-address-button:focus,.theme-twentytwentyone.theme-twentytwentyone.theme-twentytwentyone .wc-block-components-totals-shipping__change-address-button:hover{background:transparent}.wc-block-components-checkbox{color:inherit;font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;letter-spacing:inherit;line-height:inherit;text-decoration:inherit;text-transform:inherit;align-items:flex-start;display:flex;position:relative;margin-top:1.5em}.wc-block-components-checkbox .wc-block-components-checkbox__input[type=checkbox]{font-size:1em;-webkit-appearance:none;-moz-appearance:none;appearance:none;border:2px solid #50575e;border-radius:2px;box-sizing:border-box;height:1.5em;width:1.5em;margin:0;min-height:24px;min-width:24px;overflow:hidden;position:static;vertical-align:middle;background-color:#fff}.wc-block-components-checkbox .wc-block-components-checkbox__input[type=checkbox]:checked{background:#fff;border-color:#50575e}.wc-block-components-checkbox .wc-block-components-checkbox__input[type=checkbox]:focus{outline:2px solid #50575e;outline-offset:2px}.wc-block-components-checkbox .wc-block-components-checkbox__input[type=checkbox]:after,.wc-block-components-checkbox .wc-block-components-checkbox__input[type=checkbox]:before{content:""}.wc-block-components-checkbox .wc-block-components-checkbox__input[type=checkbox]:not(:checked)+.wc-block-components-checkbox__mark{display:none}.has-dark-controls .wc-block-components-checkbox .wc-block-components-checkbox__input[type=checkbox]{border-color:hsla(0,0%,100%,.6);background-color:rgba(0,0,0,.1)}.has-dark-controls .wc-block-components-checkbox .wc-block-components-checkbox__input[type=checkbox]:checked{background:rgba(0,0,0,.1);border-color:hsla(0,0%,100%,.6)}.has-dark-controls .wc-block-components-checkbox .wc-block-components-checkbox__input[type=checkbox]:focus{outline:2px solid hsla(0,0%,100%,.6);outline-offset:2px}.wc-block-components-checkbox.has-error,.wc-block-components-checkbox.has-error a{color:#cc1818}.wc-block-components-checkbox.has-error .wc-block-components-checkbox__input,.wc-block-components-checkbox.has-error .wc-block-components-checkbox__input:active,.wc-block-components-checkbox.has-error .wc-block-components-checkbox__input:focus,.wc-block-components-checkbox.has-error .wc-block-components-checkbox__input:hover{border-color:#cc1818}.wc-block-components-checkbox.has-error .wc-block-components-checkbox__input:focus{outline:2px solid #cc1818;outline-offset:2px}.wc-block-components-checkbox .wc-block-components-checkbox__mark{fill:#000;position:absolute;margin-left:.1875em;margin-top:.0625em;width:1.125em;height:1.125em}.has-dark-controls .wc-block-components-checkbox .wc-block-components-checkbox__mark{fill:#fff}.wc-block-components-checkbox .wc-block-components-checkbox__label,.wc-block-components-checkbox>span{padding-left:16px;vertical-align:middle;line-height:1.5em}@media (-ms-high-contrast:none),screen and (-ms-high-contrast:active){.wc-block-components-checkbox__mark{display:none}}.theme-twentytwentyone .has-dark-controls .wc-block-components-checkbox__input[type=checkbox],.theme-twentytwentyone .wc-block-components-checkbox__input[type=checkbox]{background-color:#fff;border-color:var(--form--border-color);position:relative}.theme-twentytwentyone .has-dark-controls .wc-block-components-checkbox__input[type=checkbox]:checked,.theme-twentytwentyone .wc-block-components-checkbox__input[type=checkbox]:checked{background-color:#fff;border-color:var(--form--border-color)}.theme-twentytwentyone .wc-block-components-checkbox__mark{display:none}.editor-styles-wrapper .wc-block-components-checkbox-list,.wc-block-components-checkbox-list{margin:0;padding:0;list-style:none outside}.editor-styles-wrapper .wc-block-components-checkbox-list li,.wc-block-components-checkbox-list li{margin:0 0 4px;padding:0;list-style:none outside}.editor-styles-wrapper .wc-block-components-checkbox-list li.show-less button,.editor-styles-wrapper .wc-block-components-checkbox-list li.show-more button,.wc-block-components-checkbox-list li.show-less button,.wc-block-components-checkbox-list li.show-more button{background:none;border:none;padding:0;text-decoration:underline;cursor:pointer}.editor-styles-wrapper .wc-block-components-checkbox-list.is-loading li,.wc-block-components-checkbox-list.is-loading li{-webkit-animation:loading-fade 1.2s ease-in-out infinite;animation:loading-fade 1.2s ease-in-out infinite;background-color:var(--global--color-primary,#e0e0e0)!important;color:var(--global--color-primary,#e0e0e0)!important;outline:0!important;border:0!important;box-shadow:none;pointer-events:none;max-width:100%}.editor-styles-wrapper .wc-block-components-checkbox-list.is-loading li>*,.wc-block-components-checkbox-list.is-loading li>*{visibility:hidden}@media screen and (prefers-reduced-motion:reduce){.editor-styles-wrapper .wc-block-components-checkbox-list.is-loading li,.wc-block-components-checkbox-list.is-loading li{-webkit-animation:none;animation:none}}.wc-block-components-chip{color:inherit;font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;letter-spacing:inherit;line-height:inherit;text-decoration:inherit;text-transform:inherit;align-items:center;border:0;display:inline-flex;padding:.125em .5em .25em;margin:0 .365em .365em 0;border-radius:0;line-height:1;max-width:100%}.wc-block-components-chip,.wc-block-components-chip:active,.wc-block-components-chip:focus,.wc-block-components-chip:hover{background:#e0e0e0;color:#1e1e1e}.wc-block-components-chip.wc-block-components-chip--radius-small{border-radius:3px}.wc-block-components-chip.wc-block-components-chip--radius-medium{border-radius:.433em}.wc-block-components-chip.wc-block-components-chip--radius-large{border-radius:2em;padding-left:.75em;padding-right:.75em}.wc-block-components-chip .wc-block-components-chip__text{flex-grow:1}.wc-block-components-chip.is-removable{padding-right:.5em}.wc-block-components-chip.is-removable .wc-block-components-chip__text{padding-right:.25em}.wc-block-components-chip .wc-block-components-chip__remove{font-size:.75em;background:transparent;border:0;-webkit-appearance:none;-moz-appearance:none;appearance:none;padding:0}.wc-block-components-chip .wc-block-components-chip__remove-icon{vertical-align:middle}.theme-twentytwentyone .wc-block-components-chip,.theme-twentytwentyone .wc-block-components-chip:active,.theme-twentytwentyone .wc-block-components-chip:focus,.theme-twentytwentyone .wc-block-components-chip:hover{background:#fff}.theme-twentytwentyone .wc-block-components-chip:active button.wc-block-components-chip__remove:not(:hover):not(:active):not(.has-background),.theme-twentytwentyone .wc-block-components-chip:focus button.wc-block-components-chip__remove:not(:hover):not(:active):not(.has-background),.theme-twentytwentyone .wc-block-components-chip:hover button.wc-block-components-chip__remove:not(:hover):not(:active):not(.has-background),.theme-twentytwentyone .wc-block-components-chip button.wc-block-components-chip__remove:not(:hover):not(:active):not(.has-background){background:transparent}.wc-block-components-chip__remove:focus,.wc-block-components-chip__remove:hover,button.wc-block-components-chip:focus>.wc-block-components-chip__remove,button.wc-block-components-chip:hover>.wc-block-components-chip__remove{fill:#cc1818}.wc-block-components-chip__remove:disabled,button.wc-block-components-chip:disabled>.wc-block-components-chip__remove{fill:#949494;cursor:not-allowed}.wc-block-components-combobox .wc-block-components-combobox-control,.wc-block-components-form .wc-block-components-combobox .wc-block-components-combobox-control{color:inherit;font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;letter-spacing:inherit;line-height:inherit;text-decoration:inherit;text-transform:inherit;border:0;border-radius:0;margin:0;padding:0;vertical-align:baseline}.wc-block-components-combobox .wc-block-components-combobox-control .components-base-control__field,.wc-block-components-form .wc-block-components-combobox .wc-block-components-combobox-control .components-base-control__field{border:0;border-radius:0;margin:0;padding:0;vertical-align:baseline}.wc-block-components-combobox .wc-block-components-combobox-control .components-combobox-control__suggestions-container,.wc-block-components-form .wc-block-components-combobox .wc-block-components-combobox-control .components-combobox-control__suggestions-container{color:inherit;font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;letter-spacing:inherit;line-height:inherit;text-decoration:inherit;text-transform:inherit;border:0;border-radius:0;margin:0;padding:0;vertical-align:baseline;position:relative}.wc-block-components-combobox .wc-block-components-combobox-control input.components-combobox-control__input,.wc-block-components-form .wc-block-components-combobox .wc-block-components-combobox-control input.components-combobox-control__input{color:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;line-height:inherit;text-decoration:inherit;text-transform:inherit;font-size:1em;box-sizing:border-box;outline:inherit;border:1px solid #50575e;background:#fff;box-shadow:none;color:#2b2d2f;font-family:inherit;font-weight:400;height:3em;letter-spacing:inherit;line-height:1;padding:1.5em 16px .25em;text-align:left;text-overflow:ellipsis;text-transform:none;white-space:nowrap;width:100%;opacity:1;border-radius:4px}.wc-block-components-combobox .wc-block-components-combobox-control input.components-combobox-control__input:focus,.wc-block-components-combobox .wc-block-components-combobox-control input.components-combobox-control__input[aria-expanded=true],.wc-block-components-form .wc-block-components-combobox .wc-block-components-combobox-control input.components-combobox-control__input:focus,.wc-block-components-form .wc-block-components-combobox .wc-block-components-combobox-control input.components-combobox-control__input[aria-expanded=true]{background-color:#fff;color:#2b2d2f;outline:0;box-shadow:0 0 0 1px #50575e}.wc-block-components-combobox .wc-block-components-combobox-control input.components-combobox-control__input[aria-expanded=true],.wc-block-components-form .wc-block-components-combobox .wc-block-components-combobox-control input.components-combobox-control__input[aria-expanded=true]{border-bottom-right-radius:0;border-bottom-left-radius:0}.has-dark-controls .wc-block-components-combobox .wc-block-components-combobox-control input.components-combobox-control__input,.has-dark-controls .wc-block-components-form .wc-block-components-combobox .wc-block-components-combobox-control input.components-combobox-control__input{background-color:rgba(0,0,0,.1);border-color:hsla(0,0%,100%,.4);color:#fff}.has-dark-controls .wc-block-components-combobox .wc-block-components-combobox-control input.components-combobox-control__input:focus,.has-dark-controls .wc-block-components-form .wc-block-components-combobox .wc-block-components-combobox-control input.components-combobox-control__input:focus{background-color:rgba(0,0,0,.1);color:#fff;box-shadow:0 0 0 1px hsla(0,0%,100%,.4)}.wc-block-components-combobox .wc-block-components-combobox-control .components-form-token-field__suggestions-list,.wc-block-components-form .wc-block-components-combobox .wc-block-components-combobox-control .components-form-token-field__suggestions-list{position:absolute;z-index:10;background-color:#fff;border:1px solid #50575e;border-top:0;margin:3em 0 0;padding:0;max-height:300px;min-width:100%;overflow:auto;color:#2b2d2f}.has-dark-controls .wc-block-components-combobox .wc-block-components-combobox-control .components-form-token-field__suggestions-list,.has-dark-controls .wc-block-components-form .wc-block-components-combobox .wc-block-components-combobox-control .components-form-token-field__suggestions-list{background-color:#1e1e1e;color:#fff}.wc-block-components-combobox .wc-block-components-combobox-control .components-form-token-field__suggestions-list .components-form-token-field__suggestion,.wc-block-components-form .wc-block-components-combobox .wc-block-components-combobox-control .components-form-token-field__suggestions-list .components-form-token-field__suggestion{font-size:1em;color:#757575;cursor:default;list-style:none;margin:0;padding:.25em 16px}.wc-block-components-combobox .wc-block-components-combobox-control .components-form-token-field__suggestions-list .components-form-token-field__suggestion.is-selected,.wc-block-components-form .wc-block-components-combobox .wc-block-components-combobox-control .components-form-token-field__suggestions-list .components-form-token-field__suggestion.is-selected{background-color:#ddd}.has-dark-controls .wc-block-components-combobox .wc-block-components-combobox-control .components-form-token-field__suggestions-list .components-form-token-field__suggestion.is-selected,.has-dark-controls .wc-block-components-form .wc-block-components-combobox .wc-block-components-combobox-control .components-form-token-field__suggestions-list .components-form-token-field__suggestion.is-selected{background-color:rgba(0,0,0,.4)}.wc-block-components-combobox .wc-block-components-combobox-control .components-form-token-field__suggestions-list .components-form-token-field__suggestion.is-highlighted,.wc-block-components-combobox .wc-block-components-combobox-control .components-form-token-field__suggestions-list .components-form-token-field__suggestion:active,.wc-block-components-combobox .wc-block-components-combobox-control .components-form-token-field__suggestions-list .components-form-token-field__suggestion:focus,.wc-block-components-combobox .wc-block-components-combobox-control .components-form-token-field__suggestions-list .components-form-token-field__suggestion:hover,.wc-block-components-form .wc-block-components-combobox .wc-block-components-combobox-control .components-form-token-field__suggestions-list .components-form-token-field__suggestion.is-highlighted,.wc-block-components-form .wc-block-components-combobox .wc-block-components-combobox-control .components-form-token-field__suggestions-list .components-form-token-field__suggestion:active,.wc-block-components-form .wc-block-components-combobox .wc-block-components-combobox-control .components-form-token-field__suggestions-list .components-form-token-field__suggestion:focus,.wc-block-components-form .wc-block-components-combobox .wc-block-components-combobox-control .components-form-token-field__suggestions-list .components-form-token-field__suggestion:hover{background-color:#00669e;color:#fff}.wc-block-components-combobox .wc-block-components-combobox-control label.components-base-control__label,.wc-block-components-form .wc-block-components-combobox .wc-block-components-combobox-control label.components-base-control__label{color:inherit;font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;letter-spacing:inherit;line-height:inherit;text-decoration:inherit;text-transform:inherit;font-size:1em;line-height:1.375;position:absolute;transform:translateY(.75em);transform-origin:top left;transition:all .2s ease;color:#757575;z-index:1;margin:0 0 0 17px;overflow:hidden;text-overflow:ellipsis;max-width:calc(100% - 32px);white-space:nowrap}.has-dark-controls .wc-block-components-combobox .wc-block-components-combobox-control label.components-base-control__label,.has-dark-controls .wc-block-components-form .wc-block-components-combobox .wc-block-components-combobox-control label.components-base-control__label{color:hsla(0,0%,100%,.6)}@media screen and (prefers-reduced-motion:reduce){.wc-block-components-combobox .wc-block-components-combobox-control label.components-base-control__label,.wc-block-components-form .wc-block-components-combobox .wc-block-components-combobox-control label.components-base-control__label{transition:none}}.wc-block-components-combobox.is-active .wc-block-components-combobox-control label.components-base-control__label,.wc-block-components-combobox:focus-within .wc-block-components-combobox-control label.components-base-control__label,.wc-block-components-form .wc-block-components-combobox.is-active .wc-block-components-combobox-control label.components-base-control__label,.wc-block-components-form .wc-block-components-combobox:focus-within .wc-block-components-combobox-control label.components-base-control__label{transform:translateY(4px) scale(.75)}.wc-block-components-combobox.has-error .wc-block-components-combobox-control label.components-base-control__label,.wc-block-components-form .wc-block-components-combobox.has-error .wc-block-components-combobox-control label.components-base-control__label{color:#cc1818}.wc-block-components-combobox.has-error .wc-block-components-combobox-control input.components-combobox-control__input,.wc-block-components-combobox.has-error .wc-block-components-combobox-control input.components-combobox-control__input:active,.wc-block-components-combobox.has-error .wc-block-components-combobox-control input.components-combobox-control__input:focus,.wc-block-components-combobox.has-error .wc-block-components-combobox-control input.components-combobox-control__input:hover,.wc-block-components-form .wc-block-components-combobox.has-error .wc-block-components-combobox-control input.components-combobox-control__input,.wc-block-components-form .wc-block-components-combobox.has-error .wc-block-components-combobox-control input.components-combobox-control__input:active,.wc-block-components-form .wc-block-components-combobox.has-error .wc-block-components-combobox-control input.components-combobox-control__input:focus,.wc-block-components-form .wc-block-components-combobox.has-error .wc-block-components-combobox-control input.components-combobox-control__input:hover{border-color:#cc1818}.wc-block-components-combobox.has-error .wc-block-components-combobox-control input.components-combobox-control__input:focus,.wc-block-components-form .wc-block-components-combobox.has-error .wc-block-components-combobox-control input.components-combobox-control__input:focus{box-shadow:0 0 0 1px #cc1818}.wc-block-components-country-input{margin-top:1.5em}@-webkit-keyframes fadein{0%{opacity:0}to{opacity:1}}@keyframes fadein{0%{opacity:0}to{opacity:1}}@-webkit-keyframes slidein{0%{transform:translateX(0)}to{transform:translateX(-480px)}}@keyframes slidein{0%{transform:translateX(0)}to{transform:translateX(-480px)}}@media only screen and (max-width:480px){@-webkit-keyframes slidein{0%{transform:translateX(0)}to{transform:translateX(-100vw)}}@keyframes slidein{0%{transform:translateX(0)}to{transform:translateX(-100vw)}}}.wc-block-components-drawer__screen-overlay{background-color:rgba(95,95,95,.35);bottom:0;left:0;position:fixed;right:0;top:0;transition:opacity .3s;z-index:999;opacity:1}.wc-block-components-drawer__screen-overlay--with-slide-out{transition:opacity .3s}.wc-block-components-drawer__screen-overlay--with-slide-in{-webkit-animation-duration:.3s;animation-duration:.3s;-webkit-animation-name:fadein;animation-name:fadein}.wc-block-components-drawer__screen-overlay--is-hidden{pointer-events:none;opacity:0}.wc-block-components-drawer{position:relative;background:#fff;display:block;height:100%;left:100%;overflow:auto;position:fixed;right:0;top:0;transform:translateX(-480px);width:480px}.wc-block-components-drawer:after{border-style:solid;border-width:0 0 0 1px;bottom:0;content:"";display:block;left:0;opacity:.3;pointer-events:none;position:absolute;right:0;top:0}@media only screen and (max-width:480px){.wc-block-components-drawer{transform:translateX(-100vw);width:100vw}}.wc-block-components-drawer__screen-overlay--with-slide-out .wc-block-components-drawer{transition:transform .3s}.wc-block-components-drawer__screen-overlay--with-slide-in .wc-block-components-drawer{-webkit-animation-duration:.3s;animation-duration:.3s;-webkit-animation-name:slidein;animation-name:slidein}.wc-block-components-drawer__screen-overlay--is-hidden .wc-block-components-drawer{transform:translateX(0)}@media screen and (prefers-reduced-motion:reduce){.wc-block-components-drawer,.wc-block-components-drawer__screen-overlay{-webkit-animation-name:none!important;animation-name:none!important;transition:none!important}}.wc-block-components-drawer .components-modal__content{padding:40px 16px}.wc-block-components-drawer .components-modal__header{position:relative}.wc-block-components-drawer .components-modal__header .components-button{border:0;border-radius:0;vertical-align:baseline;background:transparent;position:absolute;right:0;top:0;padding:1em;margin:-1em}.wc-block-components-drawer .components-modal__header .components-button>span{border:0;clip:rect(1px,1px,1px,1px);-webkit-clip-path:inset(50%);clip-path:inset(50%);height:1px;margin:-1px;overflow:hidden;overflow-wrap:normal!important;word-wrap:normal!important;padding:0;position:absolute!important;width:1px}.wc-block-components-drawer .components-modal__header-heading{border:0;border-radius:0;margin:0;padding:0;vertical-align:baseline;font-size:1.25rem;word-break:break-word}.wc-block-components-dropdown-selector{max-width:300px;position:relative;width:100%}.wc-block-components-dropdown-selector__input-wrapper{background:#fff;border:1px solid #50575e;color:#2b2d2f;align-items:center;border-radius:4px;cursor:text;display:flex;flex-wrap:wrap;padding:2px 8px}.is-disabled .wc-block-components-dropdown-selector__input-wrapper{background-color:#e0e0e0}.is-multiple.has-checked>.wc-block-components-dropdown-selector__input-wrapper{padding:2px 4px}.is-open>.wc-block-components-dropdown-selector__input-wrapper{border-radius:4px 4px 0 0}.wc-block-components-dropdown-selector__input{font-size:.875em;line-height:1.2857142857;margin:.1875em 0;min-width:0;padding:.1875em 0}.is-single .wc-block-components-dropdown-selector__input{width:100%}.is-single .wc-block-components-dropdown-selector__input:active,.is-single .wc-block-components-dropdown-selector__input:focus,.is-single .wc-block-components-dropdown-selector__input:hover{outline:0}.is-single.has-checked.is-open .wc-block-components-dropdown-selector__input{margin-bottom:1.5px;margin-top:1.5px}.is-single.has-checked:not(.is-open) .wc-block-components-dropdown-selector__input{border:0;clip:rect(1px,1px,1px,1px);-webkit-clip-path:inset(50%);clip-path:inset(50%);height:1px;margin:-1px;overflow:hidden;overflow-wrap:normal!important;word-wrap:normal!important;padding:0;position:absolute!important;width:1px;position:absolute}.is-multiple .wc-block-components-dropdown-selector__input{flex:1;min-width:0}.is-multiple .wc-block-components-dropdown-selector__input,.is-single .wc-block-components-dropdown-selector__input:first-child{background:transparent;border:0}.is-multiple .wc-block-components-dropdown-selector__input:active,.is-multiple .wc-block-components-dropdown-selector__input:focus,.is-multiple .wc-block-components-dropdown-selector__input:hover,.is-single .wc-block-components-dropdown-selector__input:first-child:active,.is-single .wc-block-components-dropdown-selector__input:first-child:focus,.is-single .wc-block-components-dropdown-selector__input:first-child:hover{outline:0}.wc-block-components-dropdown-selector .wc-block-components-dropdown-selector__selected-value__label,.wc-block-components-dropdown-selector .wc-block-components-dropdown-selector__selected-value__remove{background-color:transparent;border:0;color:inherit;font-size:inherit;font-weight:inherit;text-transform:none}.wc-block-components-dropdown-selector .wc-block-components-dropdown-selector__selected-value__label:active,.wc-block-components-dropdown-selector .wc-block-components-dropdown-selector__selected-value__label:focus,.wc-block-components-dropdown-selector .wc-block-components-dropdown-selector__selected-value__label:hover,.wc-block-components-dropdown-selector .wc-block-components-dropdown-selector__selected-value__remove:active,.wc-block-components-dropdown-selector .wc-block-components-dropdown-selector__selected-value__remove:focus,.wc-block-components-dropdown-selector .wc-block-components-dropdown-selector__selected-value__remove:hover{background-color:transparent;text-decoration:none}.wc-block-components-dropdown-selector .wc-block-components-dropdown-selector__selected-value{font-size:.875em;align-items:center;color:#757575;display:inline-flex;margin:.1875em 0;padding:.1875em 0;width:100%}.wc-block-components-dropdown-selector .wc-block-components-dropdown-selector__selected-value__label{flex-grow:1;line-height:1.2857142857;padding:0;text-align:left}.wc-block-components-dropdown-selector .wc-block-components-dropdown-selector__selected-value__remove{background-color:transparent;border:0;display:inline-block;line-height:1;padding:0 0 0 .3em}.wc-block-components-dropdown-selector .wc-block-components-dropdown-selector__selected-value__remove>svg{display:block}.wc-block-components-dropdown-selector .wc-block-components-dropdown-selector__selected-chip{font-size:.875em;margin-top:.1875em;margin-bottom:.1875em;line-height:1.2857142857}.wc-block-components-dropdown-selector__list{background-color:#fff;margin:-1px 0 0;padding:0;position:absolute;left:0;right:0;top:100%;max-height:300px;overflow-y:auto;z-index:1}.wc-block-components-dropdown-selector__list:not(:empty){border:1px solid #9f9f9f}.wc-block-components-dropdown-selector__list-item{font-size:.875em;color:#757575;cursor:default;list-style:none;margin:0;padding:0 4px}.wc-block-components-dropdown-selector__list-item.is-selected{background-color:#ddd}.wc-block-components-dropdown-selector__list-item.is-highlighted,.wc-block-components-dropdown-selector__list-item:active,.wc-block-components-dropdown-selector__list-item:focus,.wc-block-components-dropdown-selector__list-item:hover{background-color:#00669e;color:#fff}.wc-filter-element-label-list-count{opacity:.6}.wc-filter-element-label-list-count:before{content:" ("}.wc-filter-element-label-list-count:after{content:")"}.wc-block-components-filter-submit-button{display:block;margin-left:auto;white-space:nowrap}.wc-block-components-formatted-money-amount{white-space:nowrap}.wc-block-components-load-more{text-align:center;width:100%}.wc-block-components-loading-mask{position:relative;min-height:34px;pointer-events:none}.wc-block-components-loading-mask .components-spinner{position:absolute;margin:0;top:50%;left:50%;transform:translate(-50%,-50%)}.wc-block-components-loading-mask .wc-block-components-loading-mask__children{opacity:.25}.wc-block-components-pagination{margin:0 auto 16px}.wc-block-components-pagination__ellipsis,.wc-block-components-pagination__page{font-size:1em;color:#333;display:inline-block;font-weight:400}.wc-block-components-pagination__page{border-color:transparent;padding:.3em .6em;min-width:2.2em}@media(max-width:782px){.wc-block-components-pagination__page{padding:.1em .2em;min-width:1.6em}}.wc-block-components-pagination__page:not(.toggle){background-color:transparent}.wc-block-components-pagination__ellipsis{padding:.3em}@media(max-width:782px){.wc-block-components-pagination__ellipsis{padding:.1em}}.wc-block-components-pagination__page--active[disabled]{color:#333;font-weight:700;opacity:1!important}.wc-block-components-pagination__page--active[disabled]:focus,.wc-block-components-pagination__page--active[disabled]:hover{background-color:inherit;color:#333;opacity:1!important}html[dir=rtl] .wc-block-components-pagination-page--arrow span{display:inline-block;transform:scaleX(-1)}.wc-block-components-price-slider{margin-bottom:24px}.wc-block-components-price-slider.wc-block-components-price-slider--has-filter-button .wc-block-components-price-slider__controls{justify-content:flex-end}.wc-block-components-price-slider.wc-block-components-price-slider--has-filter-button .wc-block-components-price-slider__controls .wc-block-components-price-slider__amount.wc-block-components-price-slider__amount--max{margin-left:0;margin-right:10px}.wc-block-components-price-slider.is-disabled .wc-block-components-price-slider__amount,.wc-block-components-price-slider.is-disabled .wc-block-components-price-slider__button,.wc-block-components-price-slider.is-disabled .wc-block-components-price-slider__range-input-wrapper,.wc-block-components-price-slider.is-loading .wc-block-components-price-slider__amount,.wc-block-components-price-slider.is-loading .wc-block-components-price-slider__button,.wc-block-components-price-slider.is-loading .wc-block-components-price-slider__range-input-wrapper{-webkit-animation:loading-fade 1.2s ease-in-out infinite;animation:loading-fade 1.2s ease-in-out infinite;background-color:var(--global--color-primary,#e0e0e0)!important;color:var(--global--color-primary,#e0e0e0)!important;outline:0!important;border:0!important;pointer-events:none;max-width:100%;box-shadow:none}.wc-block-components-price-slider.is-disabled .wc-block-components-price-slider__amount>*,.wc-block-components-price-slider.is-disabled .wc-block-components-price-slider__button>*,.wc-block-components-price-slider.is-disabled .wc-block-components-price-slider__range-input-wrapper>*,.wc-block-components-price-slider.is-loading .wc-block-components-price-slider__amount>*,.wc-block-components-price-slider.is-loading .wc-block-components-price-slider__button>*,.wc-block-components-price-slider.is-loading .wc-block-components-price-slider__range-input-wrapper>*{visibility:hidden}@media screen and (prefers-reduced-motion:reduce){.wc-block-components-price-slider.is-disabled .wc-block-components-price-slider__amount,.wc-block-components-price-slider.is-disabled .wc-block-components-price-slider__button,.wc-block-components-price-slider.is-disabled .wc-block-components-price-slider__range-input-wrapper,.wc-block-components-price-slider.is-loading .wc-block-components-price-slider__amount,.wc-block-components-price-slider.is-loading .wc-block-components-price-slider__button,.wc-block-components-price-slider.is-loading .wc-block-components-price-slider__range-input-wrapper{-webkit-animation:none;animation:none}}.wc-block-components-price-slider.is-disabled:not(.is-loading) .wc-block-components-price-slider__amount,.wc-block-components-price-slider.is-disabled:not(.is-loading) .wc-block-components-price-slider__button,.wc-block-components-price-slider.is-disabled:not(.is-loading) .wc-block-components-price-slider__range-input-wrapper{-webkit-animation:none;animation:none}.wc-block-components-price-slider__range-input-wrapper{padding:0;border:0;outline:none;background:transparent;-webkit-appearance:none;-moz-appearance:none;appearance:none;height:9px;clear:both;position:relative;box-shadow:inset 0 0 0 1px rgba(0,0,0,.1);background:#e1e1e1;margin:15px 0}.wc-block-components-price-slider__range-input-progress{height:9px;width:100%;position:absolute;left:0;top:0;--track-background:linear-gradient(90deg,transparent var(--low),var(--range-color) 0,var(--range-color) var(--high),transparent 0) no-repeat 0 100%/100% 100%;--range-color:#af7dd1;background:var(--track-background)}.wc-block-components-price-slider__controls{display:flex}.wc-block-components-price-slider__controls .wc-block-components-price-slider__amount{margin:0;border-radius:4px;width:auto;max-width:100px;min-width:0}.wc-block-components-price-slider__controls .wc-block-components-price-slider__amount.wc-block-components-price-slider__amount--min{margin-right:10px}.wc-block-components-price-slider__controls .wc-block-components-price-slider__amount.wc-block-components-price-slider__amount--max{margin-left:auto}.wc-block-components-price-slider__range-input{margin:0;padding:0;border:0;outline:none;background:transparent;-webkit-appearance:none;-moz-appearance:none;appearance:none;width:100%;height:0;display:block;position:relative;pointer-events:none;outline:none!important;position:absolute;left:0;top:0}.wc-block-components-price-slider__range-input::-webkit-slider-runnable-track{cursor:default;height:1px;outline:0;-webkit-appearance:none;-moz-appearance:none;appearance:none}.wc-block-components-price-slider__range-input::-webkit-slider-thumb{background-color:transparent;background-position:0 0;width:28px;height:23px;border:0;padding:0;vertical-align:top;cursor:pointer;z-index:20;pointer-events:auto;background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='56' height='46' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cg clip-path='url(%23clip0)'%3E%3Cpath d='M25.318 9.942L16.9 3.8c-1.706-1.228-3.64-1.899-5.686-1.787H11.1c-4.89.335-8.985 4.356-9.099 9.27C1.888 16.645 6.21 21 11.67 21h.113c1.82 0 3.64-.67 5.118-1.787l8.417-6.255c.91-.893.91-2.234 0-3.016v0z' fill='%23fff' stroke='%23757575'/%3E%3Cpath d='M13 7v9m-3-9v9-9z' stroke='%23B8B8B8'/%3E%3Cpath d='M25.318 9.942L16.9 3.8c-1.706-1.228-3.64-1.899-5.686-1.787H11.1c-4.89.335-8.985 4.356-9.099 9.27C1.888 16.645 6.21 21 11.67 21h.113c1.82 0 3.64-.67 5.118-1.787l8.417-6.255c.91-.893.91-2.234 0-3.016v0z' fill='%23fff' stroke='%23757575'/%3E%3Cpath d='M13 7v9m-3-9v9-9z' stroke='%23B8B8B8'/%3E%3Cpath d='M25.318 32.942L16.9 26.8c-1.706-1.228-3.64-1.899-5.686-1.787H11.1c-4.89.335-8.985 4.356-9.099 9.27C1.888 39.645 6.21 44 11.67 44h.113c1.82 0 3.64-.67 5.118-1.787l8.417-6.255c.91-.893.91-2.234 0-3.016v0z' fill='%23F8F3F7' stroke='%23fff' stroke-opacity='.75' stroke-width='3'/%3E%3Cpath d='M25.318 32.942L16.9 26.8c-1.706-1.228-3.64-1.899-5.686-1.787H11.1c-4.89.335-8.985 4.356-9.099 9.27C1.888 39.645 6.21 44 11.67 44h.113c1.82 0 3.64-.67 5.118-1.787l8.417-6.255c.91-.893.91-2.234 0-3.016v0zM13 30v9m-3-9v9-9z' stroke='%23757575'/%3E%3Cpath d='M30.682 9.942L39.1 3.8c1.706-1.228 3.64-1.899 5.686-1.787h.114c4.89.335 8.985 4.356 9.099 9.27C54.112 16.645 49.79 21 44.33 21h-.113c-1.82 0-3.64-.67-5.118-1.787l-8.417-6.255c-.91-.893-.91-2.234 0-3.016v0z' fill='%23fff' stroke='%23757575'/%3E%3Cpath d='M43 7v9m3-9v9-9z' stroke='%23B8B8B8'/%3E%3Cpath d='M30.682 32.942L39.1 26.8c1.706-1.228 3.64-1.899 5.686-1.787h.114c4.89.335 8.985 4.356 9.099 9.27C54.112 39.645 49.79 44 44.33 44h-.113c-1.82 0-3.64-.67-5.118-1.787l-8.417-6.255c-.91-.893-.91-2.234 0-3.016v0z' fill='%23F8F3F7' stroke='%23fff' stroke-opacity='.75' stroke-width='3'/%3E%3Cpath d='M30.682 32.942L39.1 26.8c1.706-1.228 3.64-1.899 5.686-1.787h.114c4.89.335 8.985 4.356 9.099 9.27C54.112 39.645 49.79 44 44.33 44h-.113c-1.82 0-3.64-.67-5.118-1.787l-8.417-6.255c-.91-.893-.91-2.234 0-3.016v0zM43 30v9m3-9v9-9z' stroke='%23757575'/%3E%3C/g%3E%3Cdefs%3E%3CclipPath id='clip0'%3E%3Cpath fill='%23fff' d='M0 0h56v46H0z'/%3E%3C/clipPath%3E%3C/defs%3E%3C/svg%3E");-webkit-transition:transform .2s ease-in-out;transition:transform .2s ease-in-out;-webkit-appearance:none;-moz-appearance:none;appearance:none;margin:-6px 0 0}.wc-block-components-price-slider__range-input::-webkit-slider-thumb:hover{background-position-y:-23px;transform:scale(1.1)}.wc-block-components-price-slider__range-input::-webkit-slider-progress{margin:0;padding:0;border:0;outline:none;background:transparent;-webkit-appearance:none;-moz-appearance:none;appearance:none}.wc-block-components-price-slider__range-input::-moz-focus-outer{border:0}.wc-block-components-price-slider__range-input::-moz-range-track{cursor:default;height:1px;outline:0;-webkit-appearance:none;-moz-appearance:none;appearance:none}.wc-block-components-price-slider__range-input::-moz-range-progress{margin:0;padding:0;border:0;outline:none;background:transparent;-webkit-appearance:none;-moz-appearance:none;appearance:none}.wc-block-components-price-slider__range-input::-moz-range-thumb{background-color:transparent;background-position:0 0;width:28px;height:23px;border:0;padding:0;margin:0;vertical-align:top;cursor:pointer;z-index:20;pointer-events:auto;background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='56' height='46' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cg clip-path='url(%23clip0)'%3E%3Cpath d='M25.318 9.942L16.9 3.8c-1.706-1.228-3.64-1.899-5.686-1.787H11.1c-4.89.335-8.985 4.356-9.099 9.27C1.888 16.645 6.21 21 11.67 21h.113c1.82 0 3.64-.67 5.118-1.787l8.417-6.255c.91-.893.91-2.234 0-3.016v0z' fill='%23fff' stroke='%23757575'/%3E%3Cpath d='M13 7v9m-3-9v9-9z' stroke='%23B8B8B8'/%3E%3Cpath d='M25.318 9.942L16.9 3.8c-1.706-1.228-3.64-1.899-5.686-1.787H11.1c-4.89.335-8.985 4.356-9.099 9.27C1.888 16.645 6.21 21 11.67 21h.113c1.82 0 3.64-.67 5.118-1.787l8.417-6.255c.91-.893.91-2.234 0-3.016v0z' fill='%23fff' stroke='%23757575'/%3E%3Cpath d='M13 7v9m-3-9v9-9z' stroke='%23B8B8B8'/%3E%3Cpath d='M25.318 32.942L16.9 26.8c-1.706-1.228-3.64-1.899-5.686-1.787H11.1c-4.89.335-8.985 4.356-9.099 9.27C1.888 39.645 6.21 44 11.67 44h.113c1.82 0 3.64-.67 5.118-1.787l8.417-6.255c.91-.893.91-2.234 0-3.016v0z' fill='%23F8F3F7' stroke='%23fff' stroke-opacity='.75' stroke-width='3'/%3E%3Cpath d='M25.318 32.942L16.9 26.8c-1.706-1.228-3.64-1.899-5.686-1.787H11.1c-4.89.335-8.985 4.356-9.099 9.27C1.888 39.645 6.21 44 11.67 44h.113c1.82 0 3.64-.67 5.118-1.787l8.417-6.255c.91-.893.91-2.234 0-3.016v0zM13 30v9m-3-9v9-9z' stroke='%23757575'/%3E%3Cpath d='M30.682 9.942L39.1 3.8c1.706-1.228 3.64-1.899 5.686-1.787h.114c4.89.335 8.985 4.356 9.099 9.27C54.112 16.645 49.79 21 44.33 21h-.113c-1.82 0-3.64-.67-5.118-1.787l-8.417-6.255c-.91-.893-.91-2.234 0-3.016v0z' fill='%23fff' stroke='%23757575'/%3E%3Cpath d='M43 7v9m3-9v9-9z' stroke='%23B8B8B8'/%3E%3Cpath d='M30.682 32.942L39.1 26.8c1.706-1.228 3.64-1.899 5.686-1.787h.114c4.89.335 8.985 4.356 9.099 9.27C54.112 39.645 49.79 44 44.33 44h-.113c-1.82 0-3.64-.67-5.118-1.787l-8.417-6.255c-.91-.893-.91-2.234 0-3.016v0z' fill='%23F8F3F7' stroke='%23fff' stroke-opacity='.75' stroke-width='3'/%3E%3Cpath d='M30.682 32.942L39.1 26.8c1.706-1.228 3.64-1.899 5.686-1.787h.114c4.89.335 8.985 4.356 9.099 9.27C54.112 39.645 49.79 44 44.33 44h-.113c-1.82 0-3.64-.67-5.118-1.787l-8.417-6.255c-.91-.893-.91-2.234 0-3.016v0zM43 30v9m3-9v9-9z' stroke='%23757575'/%3E%3C/g%3E%3Cdefs%3E%3CclipPath id='clip0'%3E%3Cpath fill='%23fff' d='M0 0h56v46H0z'/%3E%3C/clipPath%3E%3C/defs%3E%3C/svg%3E");-moz-transition:transform .2s ease-in-out;transition:transform .2s ease-in-out;-webkit-appearance:none;-moz-appearance:none;appearance:none}.wc-block-components-price-slider__range-input::-moz-range-thumb:hover{background-position-y:-23px;transform:scale(1.1)}.wc-block-components-price-slider__range-input::-ms-thumb{background-color:transparent;background-position:0 0;width:28px;height:23px;border:0;padding:0;margin:0;vertical-align:top;cursor:pointer;z-index:20;pointer-events:auto;background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='56' height='46' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cg clip-path='url(%23clip0)'%3E%3Cpath d='M25.318 9.942L16.9 3.8c-1.706-1.228-3.64-1.899-5.686-1.787H11.1c-4.89.335-8.985 4.356-9.099 9.27C1.888 16.645 6.21 21 11.67 21h.113c1.82 0 3.64-.67 5.118-1.787l8.417-6.255c.91-.893.91-2.234 0-3.016v0z' fill='%23fff' stroke='%23757575'/%3E%3Cpath d='M13 7v9m-3-9v9-9z' stroke='%23B8B8B8'/%3E%3Cpath d='M25.318 9.942L16.9 3.8c-1.706-1.228-3.64-1.899-5.686-1.787H11.1c-4.89.335-8.985 4.356-9.099 9.27C1.888 16.645 6.21 21 11.67 21h.113c1.82 0 3.64-.67 5.118-1.787l8.417-6.255c.91-.893.91-2.234 0-3.016v0z' fill='%23fff' stroke='%23757575'/%3E%3Cpath d='M13 7v9m-3-9v9-9z' stroke='%23B8B8B8'/%3E%3Cpath d='M25.318 32.942L16.9 26.8c-1.706-1.228-3.64-1.899-5.686-1.787H11.1c-4.89.335-8.985 4.356-9.099 9.27C1.888 39.645 6.21 44 11.67 44h.113c1.82 0 3.64-.67 5.118-1.787l8.417-6.255c.91-.893.91-2.234 0-3.016v0z' fill='%23F8F3F7' stroke='%23fff' stroke-opacity='.75' stroke-width='3'/%3E%3Cpath d='M25.318 32.942L16.9 26.8c-1.706-1.228-3.64-1.899-5.686-1.787H11.1c-4.89.335-8.985 4.356-9.099 9.27C1.888 39.645 6.21 44 11.67 44h.113c1.82 0 3.64-.67 5.118-1.787l8.417-6.255c.91-.893.91-2.234 0-3.016v0zM13 30v9m-3-9v9-9z' stroke='%23757575'/%3E%3Cpath d='M30.682 9.942L39.1 3.8c1.706-1.228 3.64-1.899 5.686-1.787h.114c4.89.335 8.985 4.356 9.099 9.27C54.112 16.645 49.79 21 44.33 21h-.113c-1.82 0-3.64-.67-5.118-1.787l-8.417-6.255c-.91-.893-.91-2.234 0-3.016v0z' fill='%23fff' stroke='%23757575'/%3E%3Cpath d='M43 7v9m3-9v9-9z' stroke='%23B8B8B8'/%3E%3Cpath d='M30.682 32.942L39.1 26.8c1.706-1.228 3.64-1.899 5.686-1.787h.114c4.89.335 8.985 4.356 9.099 9.27C54.112 39.645 49.79 44 44.33 44h-.113c-1.82 0-3.64-.67-5.118-1.787l-8.417-6.255c-.91-.893-.91-2.234 0-3.016v0z' fill='%23F8F3F7' stroke='%23fff' stroke-opacity='.75' stroke-width='3'/%3E%3Cpath d='M30.682 32.942L39.1 26.8c1.706-1.228 3.64-1.899 5.686-1.787h.114c4.89.335 8.985 4.356 9.099 9.27C54.112 39.645 49.79 44 44.33 44h-.113c-1.82 0-3.64-.67-5.118-1.787l-8.417-6.255c-.91-.893-.91-2.234 0-3.016v0zM43 30v9m3-9v9-9z' stroke='%23757575'/%3E%3C/g%3E%3Cdefs%3E%3CclipPath id='clip0'%3E%3Cpath fill='%23fff' d='M0 0h56v46H0z'/%3E%3C/clipPath%3E%3C/defs%3E%3C/svg%3E");-ms-transition:transform .2s ease-in-out;transition:transform .2s ease-in-out;-webkit-appearance:none;-moz-appearance:none;appearance:none}.wc-block-components-price-slider__range-input::-ms-thumb:hover{background-position-y:-23px;transform:scale(1.1)}.wc-block-components-price-slider__range-input:focus::-webkit-slider-thumb{background-position-y:-23px;transform:scale(1.1)}.wc-block-components-price-slider__range-input:focus::-moz-range-thumb{background-position-y:-23px;transform:scale(1.1)}.wc-block-components-price-slider__range-input:focus::-ms-thumb{background-position-y:-23px;transform:scale(1.1)}.wc-block-components-price-slider__range-input.wc-block-components-price-slider__range-input--min{z-index:21}.wc-block-components-price-slider__range-input.wc-block-components-price-slider__range-input--min::-webkit-slider-thumb{margin-left:-2px;background-position-x:left}.wc-block-components-price-slider__range-input.wc-block-components-price-slider__range-input--min::-moz-range-thumb{background-position-x:left;transform:translate(-2px,4px)}.wc-block-components-price-slider__range-input.wc-block-components-price-slider__range-input--min::-ms-thumb{background-position-x:left}.wc-block-components-price-slider__range-input.wc-block-components-price-slider__range-input--max{z-index:20}.wc-block-components-price-slider__range-input.wc-block-components-price-slider__range-input--max::-webkit-slider-thumb{background-position-x:right;margin-left:2px}.wc-block-components-price-slider__range-input.wc-block-components-price-slider__range-input--max::-moz-range-thumb{background-position-x:right;transform:translate(2px,4px)}.wc-block-components-price-slider__range-input.wc-block-components-price-slider__range-input--max::-ms-thumb{background-position-x:right}.rtl .wc-block-components-price-slider__range-input-progress{--track-background:linear-gradient(270deg,transparent var(--low),var(--range-color) 0,var(--range-color) var(--high),transparent 0) no-repeat 0 100%/100% 100%;--range-color:#af7dd1;background:var(--track-background)}@media (-ms-high-contrast:none),screen and (-ms-high-contrast:active){.wc-block-components-price-slider__range-input-wrapper{background:transparent;box-shadow:none;height:24px}.wc-block-components-price-slider__range-input-progress{background:#af7dd1;width:100%;top:7px}.wc-block-components-price-slider__range-input{height:24px;pointer-events:auto}.wc-block-components-price-slider__range-input::-ms-track{background:transparent;border-color:transparent;border-width:7px 0;color:transparent}.wc-block-components-price-slider__range-input::-ms-fill-lower{background:#e1e1e1;box-shadow:inset 0 0 0 1px #b8b8b8}.wc-block-components-price-slider__range-input::-ms-fill-upper{background:transparent}.wc-block-components-price-slider__range-input::-ms-tooltip{display:none}.wc-block-components-price-slider__range-input::-ms-thumb{transform:translate(1px);pointer-events:auto}.wc-block-components-price-slider__range-input--max::-ms-fill-upper{background:#e1e1e1;box-shadow:inset 0 0 0 1px #b8b8b8}.wc-block-components-price-slider__range-input--max::-ms-fill-lower{background:transparent}.wc-block-components-price-slider.is-disabled .wc-block-components-price-slider__range-input-wrapper,.wc-block-components-price-slider.is-loading .wc-block-components-price-slider__range-input-wrapper{-webkit-animation:loading-fade 1.2s ease-in-out infinite;animation:loading-fade 1.2s ease-in-out infinite;background-color:var(--global--color-primary,#e0e0e0)!important;color:var(--global--color-primary,#e0e0e0)!important;outline:0!important;border:0!important;pointer-events:none;max-width:100%;box-shadow:none}.wc-block-components-price-slider.is-disabled .wc-block-components-price-slider__range-input-wrapper>*,.wc-block-components-price-slider.is-loading .wc-block-components-price-slider__range-input-wrapper>*{visibility:hidden}}@media screen and (-ms-high-contrast:active)and (prefers-reduced-motion:reduce),screen and (-ms-high-contrast:none)and (prefers-reduced-motion:reduce){.wc-block-components-price-slider.is-disabled .wc-block-components-price-slider__range-input-wrapper,.wc-block-components-price-slider.is-loading .wc-block-components-price-slider__range-input-wrapper{-webkit-animation:none;animation:none}}@media (-ms-high-contrast:none),screen and (-ms-high-contrast:active){.wc-block-components-price-slider.is-disabled:not(.is-loading) .wc-block-components-price-slider__range-input-wrapper{-webkit-animation:none;animation:none}}@supports(-ms-ime-align:auto){.wc-block-components-price-slider__range-input-wrapper{background:transparent;box-shadow:none;height:24px}.wc-block-components-price-slider__range-input-progress{background:#af7dd1;width:100%;top:7px}.wc-block-components-price-slider__range-input{height:24px;pointer-events:auto}.wc-block-components-price-slider__range-input::-ms-track{background:transparent;border-color:transparent;border-width:7px 0;color:transparent}.wc-block-components-price-slider__range-input::-ms-fill-lower{background:#e1e1e1;box-shadow:inset 0 0 0 1px #b8b8b8}.wc-block-components-price-slider__range-input::-ms-fill-upper{background:transparent}.wc-block-components-price-slider__range-input::-ms-tooltip{display:none}.wc-block-components-price-slider__range-input::-ms-thumb{transform:translate(1px);pointer-events:auto}.wc-block-components-price-slider__range-input--max::-ms-fill-upper{background:#e1e1e1;box-shadow:inset 0 0 0 1px #b8b8b8}.wc-block-components-price-slider__range-input--max::-ms-fill-lower{background:transparent}.wc-block-components-price-slider.is-disabled .wc-block-components-price-slider__range-input-wrapper,.wc-block-components-price-slider.is-loading .wc-block-components-price-slider__range-input-wrapper{-webkit-animation:loading-fade 1.2s ease-in-out infinite;animation:loading-fade 1.2s ease-in-out infinite;background-color:var(--global--color-primary,#e0e0e0)!important;color:var(--global--color-primary,#e0e0e0)!important;outline:0!important;border:0!important;pointer-events:none;max-width:100%;box-shadow:none}.wc-block-components-price-slider.is-disabled .wc-block-components-price-slider__range-input-wrapper>*,.wc-block-components-price-slider.is-loading .wc-block-components-price-slider__range-input-wrapper>*{visibility:hidden}@media screen and (prefers-reduced-motion:reduce){.wc-block-components-price-slider.is-disabled .wc-block-components-price-slider__range-input-wrapper,.wc-block-components-price-slider.is-loading .wc-block-components-price-slider__range-input-wrapper{-webkit-animation:none;animation:none}}.wc-block-components-price-slider.is-disabled:not(.is-loading) .wc-block-components-price-slider__range-input-wrapper{-webkit-animation:none;animation:none}}.theme-twentytwentyone .wc-block-components-price-slider__range-input-wrapper{background:transparent;border:3px solid;box-sizing:border-box}.theme-twentytwentyone .wc-block-components-price-slider__range-input-progress{--range-color:currentColor;margin:-3px}.theme-twentytwentyone .wc-block-price-filter__range-input{background:transparent;margin:-3px;width:calc(100% + 6px)}.theme-twentytwentyone .wc-block-price-filter__range-input:focus::-webkit-slider-thumb,.theme-twentytwentyone .wc-block-price-filter__range-input:hover::-webkit-slider-thumb{filter:none}.theme-twentytwentyone .wc-block-price-filter__range-input:focus::-moz-range-thumb,.theme-twentytwentyone .wc-block-price-filter__range-input:hover::-moz-range-thumb{filter:none}.theme-twentytwentyone .wc-block-price-filter__range-input:focus::-ms-thumb,.theme-twentytwentyone .wc-block-price-filter__range-input:hover::-ms-thumb{filter:none}.theme-twentytwentyone .wc-block-price-filter__range-input::-webkit-slider-thumb{margin-top:-9px}.theme-twentytwentyone .wc-block-price-filter__range-input.wc-block-components-price-slider__range-input--max::-moz-range-thumb{transform:translate(2px,1px)}.theme-twentytwentyone .wc-block-price-filter__range-input.wc-block-components-price-slider__range-input--min::-moz-range-thumb{transform:translate(-2px,1px)}.theme-twentytwentyone .wc-block-price-filter__range-input::-ms-track{border-color:transparent!important}@media (-ms-high-contrast:none),screen and (-ms-high-contrast:active){.theme-twentytwentyone .wc-block-components-price-slider__range-input-wrapper{border:0;height:auto;position:relative;height:50px}.theme-twentytwentyone .wc-block-components-price-slider__range-input-progress{display:none}.theme-twentytwentyone .wc-block-price-filter__range-input{height:100%;margin:0;width:100%}}.wc-block-components-product-sort-select{margin-bottom:24px;text-align:left}@-webkit-keyframes spin{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}@keyframes spin{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}.wc-block-grid{text-align:center}.wc-block-grid__no-products{padding:40px;text-align:center;width:100%}.wc-block-grid__no-products .wc-block-grid__no-products-image{max-width:150px;margin:0 auto 1em;display:block;color:inherit}.wc-block-grid__no-products .wc-block-grid__no-products-title{display:block;margin:0;font-weight:700}.wc-block-grid__no-products .wc-block-grid__no-products-description{display:block;margin:.25em 0 1em}.wc-block-grid__products{display:flex;flex-wrap:wrap;padding:0;margin:0 -8px 16px;background-clip:padding-box}.wc-block-grid__product{box-sizing:border-box;padding:0;margin:0;float:none;width:auto;position:relative;text-align:center;border-left:8px solid transparent;border-right:8px solid transparent;border-bottom:16px solid transparent;list-style:none}.wc-block-grid__product.wc-block-grid__product{box-sizing:border-box}.theme-twentytwenty .wc-block-grid.has-aligned-buttons .wc-block-grid__product,.wc-block-grid.has-aligned-buttons .wc-block-grid__product{display:flex;flex-direction:column}.theme-twentytwenty .wc-block-grid.has-aligned-buttons .wc-block-grid__product>:last-child,.wc-block-grid.has-aligned-buttons .wc-block-grid__product>:last-child{margin-top:auto;margin-bottom:0;padding-bottom:12px}.theme-twentytwenty .wc-block-grid.has-1-columns .wc-block-grid__product,.wc-block-grid.has-1-columns .wc-block-grid__product{flex:1 0 100%;max-width:100%}.theme-twentytwenty .wc-block-grid.has-2-columns .wc-block-grid__product,.wc-block-grid.has-2-columns .wc-block-grid__product{flex:1 0 50%;max-width:50%}.theme-twentytwenty .wc-block-grid.has-3-columns .wc-block-grid__product,.wc-block-grid.has-3-columns .wc-block-grid__product{flex:1 0 33.33333%;max-width:33.3333333333%}.theme-twentytwenty .wc-block-grid.has-4-columns .wc-block-grid__product,.wc-block-grid.has-4-columns .wc-block-grid__product{flex:1 0 25%;max-width:25%}.theme-twentytwenty .wc-block-grid.has-5-columns .wc-block-grid__product,.wc-block-grid.has-5-columns .wc-block-grid__product{flex:1 0 20%;max-width:20%}.theme-twentytwenty .wc-block-grid.has-6-columns .wc-block-grid__product,.wc-block-grid.has-6-columns .wc-block-grid__product{flex:1 0 16.66667%;max-width:16.6666666667%}.theme-twentytwenty .wc-block-grid.has-7-columns .wc-block-grid__product,.wc-block-grid.has-7-columns .wc-block-grid__product{flex:1 0 14.28571%;max-width:14.2857142857%}.theme-twentytwenty .wc-block-grid.has-8-columns .wc-block-grid__product,.wc-block-grid.has-8-columns .wc-block-grid__product{flex:1 0 12.5%;max-width:12.5%}.theme-twentytwenty .wc-block-grid.has-6-columns .wc-block-grid__product,.wc-block-grid.has-6-columns .wc-block-grid__product{font-size:.5em}.theme-twentytwenty .wc-block-grid.has-5-columns .wc-block-grid__product,.theme-twentytwenty .wc-block-grid.has-6-columns.alignfull .wc-block-grid__product,.wc-block-grid.has-5-columns .wc-block-grid__product,.wc-block-grid.has-6-columns.alignfull .wc-block-grid__product{font-size:.58em}.theme-twentytwenty .wc-block-grid.has-4-columns:not(.alignwide):not(.alignfull) .wc-block-grid__product,.theme-twentytwenty .wc-block-grid.has-5-columns.alignfull .wc-block-grid__product,.wc-block-grid.has-4-columns:not(.alignwide):not(.alignfull) .wc-block-grid__product,.wc-block-grid.has-5-columns.alignfull .wc-block-grid__product{font-size:.75em}.theme-twentytwenty .wc-block-grid.has-3-columns:not(.alignwide):not(.alignfull),.wc-block-grid.has-3-columns:not(.alignwide):not(.alignfull){font-size:.92em}@media(max-width:480px){.wc-block-grid.has-2-columns .wc-block-grid__products{display:block}.wc-block-grid.has-2-columns .wc-block-grid__product{margin-left:auto;margin-right:auto;flex:1 0 100%;max-width:100%;padding:0}.wc-block-grid.has-3-columns .wc-block-grid__products{display:block}.wc-block-grid.has-3-columns .wc-block-grid__product{margin-left:auto;margin-right:auto;flex:1 0 100%;max-width:100%;padding:0}.wc-block-grid.has-4-columns .wc-block-grid__products{display:block}.wc-block-grid.has-4-columns .wc-block-grid__product{margin-left:auto;margin-right:auto;flex:1 0 100%;max-width:100%;padding:0}.wc-block-grid.has-5-columns .wc-block-grid__products{display:block}.wc-block-grid.has-5-columns .wc-block-grid__product{margin-left:auto;margin-right:auto;flex:1 0 100%;max-width:100%;padding:0}.wc-block-grid.has-6-columns .wc-block-grid__products{display:block}.wc-block-grid.has-6-columns .wc-block-grid__product{margin-left:auto;margin-right:auto;flex:1 0 100%;max-width:100%;padding:0}.wc-block-grid.has-7-columns .wc-block-grid__products{display:block}.wc-block-grid.has-7-columns .wc-block-grid__product{margin-left:auto;margin-right:auto;flex:1 0 100%;max-width:100%;padding:0}.wc-block-grid.has-8-columns .wc-block-grid__products{display:block}.wc-block-grid.has-8-columns .wc-block-grid__product{margin-left:auto;margin-right:auto;flex:1 0 100%;max-width:100%;padding:0}}@media(min-width:481px)and (max-width:600px){.wc-block-grid.has-2-columns .wc-block-grid__product{flex:1 0 50%;max-width:50%;padding:0;margin:0 0 24px}.wc-block-grid.has-2-columns .wc-block-grid__product:nth-child(odd){padding-right:8px}.wc-block-grid.has-2-columns .wc-block-grid__product:nth-child(2n){padding-left:8px}.wc-block-grid.has-2-columns .wc-block-grid__product:nth-child(2n) .wc-block-grid__product-onsale{left:8px}.wc-block-grid.has-3-columns .wc-block-grid__product{flex:1 0 50%;max-width:50%;padding:0;margin:0 0 24px}.wc-block-grid.has-3-columns .wc-block-grid__product:nth-child(odd){padding-right:8px}.wc-block-grid.has-3-columns .wc-block-grid__product:nth-child(2n){padding-left:8px}.wc-block-grid.has-3-columns .wc-block-grid__product:nth-child(2n) .wc-block-grid__product-onsale{left:8px}.wc-block-grid.has-4-columns .wc-block-grid__product{flex:1 0 50%;max-width:50%;padding:0;margin:0 0 24px}.wc-block-grid.has-4-columns .wc-block-grid__product:nth-child(odd){padding-right:8px}.wc-block-grid.has-4-columns .wc-block-grid__product:nth-child(2n){padding-left:8px}.wc-block-grid.has-4-columns .wc-block-grid__product:nth-child(2n) .wc-block-grid__product-onsale{left:8px}.wc-block-grid.has-5-columns .wc-block-grid__product{flex:1 0 50%;max-width:50%;padding:0;margin:0 0 24px}.wc-block-grid.has-5-columns .wc-block-grid__product:nth-child(odd){padding-right:8px}.wc-block-grid.has-5-columns .wc-block-grid__product:nth-child(2n){padding-left:8px}.wc-block-grid.has-5-columns .wc-block-grid__product:nth-child(2n) .wc-block-grid__product-onsale{left:8px}.wc-block-grid.has-6-columns .wc-block-grid__product{flex:1 0 50%;max-width:50%;padding:0;margin:0 0 24px}.wc-block-grid.has-6-columns .wc-block-grid__product:nth-child(odd){padding-right:8px}.wc-block-grid.has-6-columns .wc-block-grid__product:nth-child(2n){padding-left:8px}.wc-block-grid.has-6-columns .wc-block-grid__product:nth-child(2n) .wc-block-grid__product-onsale{left:8px}.wc-block-grid.has-7-columns .wc-block-grid__product{flex:1 0 50%;max-width:50%;padding:0;margin:0 0 24px}.wc-block-grid.has-7-columns .wc-block-grid__product:nth-child(odd){padding-right:8px}.wc-block-grid.has-7-columns .wc-block-grid__product:nth-child(2n){padding-left:8px}.wc-block-grid.has-7-columns .wc-block-grid__product:nth-child(2n) .wc-block-grid__product-onsale{left:8px}.wc-block-grid.has-8-columns .wc-block-grid__product{flex:1 0 50%;max-width:50%;padding:0;margin:0 0 24px}.wc-block-grid.has-8-columns .wc-block-grid__product:nth-child(odd){padding-right:8px}.wc-block-grid.has-8-columns .wc-block-grid__product:nth-child(2n){padding-left:8px}.wc-block-grid.has-8-columns .wc-block-grid__product:nth-child(2n) .wc-block-grid__product-onsale{left:8px}}.wc-block-components-product-name{font-size:1em;overflow-wrap:anywhere;word-break:break-word;-ms-word-break:break-all}.wc-block-components-product-price--align-left{display:block;text-align:left}.wc-block-components-product-price--align-center{display:block;text-align:center}.wc-block-components-product-price--align-right{display:block;text-align:right}.wc-block-components-product-price__value.is-discounted{margin-left:.5em}.is-loading .wc-block-components-product-price:before{-webkit-animation:loading-fade 1.2s ease-in-out infinite;animation:loading-fade 1.2s ease-in-out infinite;background-color:var(--global--color-primary,#e0e0e0)!important;color:var(--global--color-primary,#e0e0e0)!important;outline:0!important;border:0!important;box-shadow:none;pointer-events:none;max-width:100%;content:".";display:inline-block;width:5em}.is-loading .wc-block-components-product-price:before>*{visibility:hidden}@media screen and (prefers-reduced-motion:reduce){.is-loading .wc-block-components-product-price:before{-webkit-animation:none;animation:none}}.wc-block-components-quantity-selector{display:flex;width:107px;border:1px solid #ddd;background:#fff;border-radius:4px;box-sizing:content-box;margin:0 0 .25em}.has-dark-controls .wc-block-components-quantity-selector{background-color:transparent;border-color:hsla(0,0%,100%,.4)}.wc-block-components-quantity-selector input.wc-block-components-quantity-selector__input{font-size:1em;order:2;min-width:40px;flex:1 1 auto;border:0;padding:.4em 0;margin:0;text-align:center;background:transparent;box-shadow:none;color:#000;line-height:1;vertical-align:middle;-moz-appearance:textfield}.wc-block-components-quantity-selector input.wc-block-components-quantity-selector__input:focus{background:#f0f0f0;outline:1px solid #ddd}.wc-block-components-quantity-selector input.wc-block-components-quantity-selector__input:disabled{color:#949494}.has-dark-controls .wc-block-components-quantity-selector input.wc-block-components-quantity-selector__input{color:#fff;background:transparent}.has-dark-controls .wc-block-components-quantity-selector input.wc-block-components-quantity-selector__input:focus{background:transparent}.has-dark-controls .wc-block-components-quantity-selector input.wc-block-components-quantity-selector__input:disabled{color:hsla(0,0%,100%,.3)}.wc-block-components-quantity-selector input::-webkit-inner-spin-button,.wc-block-components-quantity-selector input::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}.wc-block-components-quantity-selector .wc-block-components-quantity-selector__button{border:0;padding:0;margin:0;background:none transparent;box-shadow:none;font-size:1em;min-width:30px;cursor:pointer;color:#1e1e1e;font-style:normal;text-align:center;text-decoration:none}.wc-block-components-quantity-selector .wc-block-components-quantity-selector__button:focus{outline:2px solid #ddd}.wc-block-components-quantity-selector .wc-block-components-quantity-selector__button:focus,.wc-block-components-quantity-selector .wc-block-components-quantity-selector__button:hover{border:0;padding:0;margin:0;background:none transparent;box-shadow:none;color:#1e1e1e}.wc-block-components-quantity-selector .wc-block-components-quantity-selector__button:focus:focus,.wc-block-components-quantity-selector .wc-block-components-quantity-selector__button:hover:focus{outline:2px solid #ddd}.wc-block-components-quantity-selector .wc-block-components-quantity-selector__button:disabled{color:#949494;cursor:default;border:0;padding:0;margin:0;background:none transparent;box-shadow:none}.wc-block-components-quantity-selector .wc-block-components-quantity-selector__button:disabled:focus{outline:2px solid #ddd}.has-dark-controls .wc-block-components-quantity-selector .wc-block-components-quantity-selector__button,.has-dark-controls .wc-block-components-quantity-selector .wc-block-components-quantity-selector__button:focus,.has-dark-controls .wc-block-components-quantity-selector .wc-block-components-quantity-selector__button:hover{color:#fff}.has-dark-controls .wc-block-components-quantity-selector .wc-block-components-quantity-selector__button:disabled{color:hsla(0,0%,100%,.3)}.wc-block-components-quantity-selector>.wc-block-components-quantity-selector__button--minus{order:1}.wc-block-components-quantity-selector>.wc-block-components-quantity-selector__button--plus{order:3}.theme-twentyseventeen .wc-block-components-quantity-selector .wc-block-components-quantity-selector__button:focus,.theme-twentyseventeen .wc-block-components-quantity-selector .wc-block-components-quantity-selector__button:hover{background:none transparent}.wc-block-components-radio-control__option{color:inherit;font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;letter-spacing:inherit;line-height:inherit;text-decoration:inherit;text-transform:inherit;display:block;margin:1em 0;padding:0 0 0 2.5em;position:relative}.wc-block-components-radio-control__option:first-child{margin-top:0}.wc-block-components-radio-control__option:last-child{margin-bottom:0}.wc-block-components-radio-control__option-layout{display:table;width:100%}.wc-block-components-radio-control__option .wc-block-components-radio-control__option-layout:after{display:none}.wc-block-components-radio-control__description-group,.wc-block-components-radio-control__label-group{display:table-row}.wc-block-components-radio-control__description-group>span,.wc-block-components-radio-control__label-group>span{display:table-cell}.wc-block-components-radio-control__description-group .wc-block-components-radio-control__secondary-description,.wc-block-components-radio-control__description-group .wc-block-components-radio-control__secondary-label,.wc-block-components-radio-control__label-group .wc-block-components-radio-control__secondary-description,.wc-block-components-radio-control__label-group .wc-block-components-radio-control__secondary-label{text-align:right;min-width:50%}.wc-block-components-radio-control__label,.wc-block-components-radio-control__secondary-label{line-height:max(1.5rem,24px)}.wc-block-components-radio-control__description,.wc-block-components-radio-control__secondary-description{font-size:.875em;line-height:20px}.wc-block-components-radio-control .wc-block-components-radio-control__input{-webkit-appearance:none;-moz-appearance:none;appearance:none;background:#fff;border:2px solid #50575e;border-radius:50%;display:inline-block;height:1.5em;min-height:24px;min-width:24px;width:1.5em;position:absolute;left:0;top:50%;transform:translateY(-50%)}.wc-block-components-radio-control .wc-block-components-radio-control__input:checked:before{background:#000;border-radius:50%;content:"";display:block;height:.75em;left:50%;margin:0;min-height:12px;min-width:12px;position:absolute;top:50%;transform:translate(-50%,-50%);width:.75em}.has-dark-controls .wc-block-components-radio-control .wc-block-components-radio-control__input{border-color:hsla(0,0%,100%,.6);background-color:rgba(0,0,0,.1)}.has-dark-controls .wc-block-components-radio-control .wc-block-components-radio-control__input:checked:before{background:#fff}.theme-twentytwentyone .wc-block-components-radio-control .wc-block-components-radio-control__input:checked{border-width:2px}.theme-twentytwentyone .wc-block-components-radio-control .wc-block-components-radio-control__input:checked:before{background-color:var(--form--color-text)}.theme-twentytwentyone .wc-block-components-radio-control .wc-block-components-radio-control__input:after{display:none}.is-loading .wc-block-components-review-list-item__text{-webkit-animation:loading-fade 1.2s ease-in-out infinite;animation:loading-fade 1.2s ease-in-out infinite;background-color:var(--global--color-primary,#e0e0e0)!important;color:var(--global--color-primary,#e0e0e0)!important;outline:0!important;border:0!important;box-shadow:none;pointer-events:none;max-width:100%;display:block;width:60%}.is-loading .wc-block-components-review-list-item__text>*{visibility:hidden}@media screen and (prefers-reduced-motion:reduce){.is-loading .wc-block-components-review-list-item__text{-webkit-animation:none;animation:none}}.is-loading .wc-block-components-review-list-item__text:after{content:" "}.is-loading .wc-block-components-review-list-item__info .wc-block-components-review-list-item__image{-webkit-animation:loading-fade 1.2s ease-in-out infinite;animation:loading-fade 1.2s ease-in-out infinite;background-color:var(--global--color-primary,#e0e0e0)!important;color:var(--global--color-primary,#e0e0e0)!important;outline:0!important;border:0!important;box-shadow:none;pointer-events:none;max-width:100%}.is-loading .wc-block-components-review-list-item__info .wc-block-components-review-list-item__image>*{visibility:hidden}@media screen and (prefers-reduced-motion:reduce){.is-loading .wc-block-components-review-list-item__info .wc-block-components-review-list-item__image{-webkit-animation:none;animation:none}}.is-loading .wc-block-components-review-list-item__info .wc-block-components-review-list-item__image:after{content:" "}.is-loading .wc-block-components-review-list-item__info .wc-block-components-review-list-item__meta .wc-block-components-review-list-item__author{-webkit-animation:loading-fade 1.2s ease-in-out infinite;animation:loading-fade 1.2s ease-in-out infinite;background-color:var(--global--color-primary,#e0e0e0)!important;color:var(--global--color-primary,#e0e0e0)!important;outline:0!important;border:0!important;box-shadow:none;pointer-events:none;max-width:100%;font-size:1em;width:80px}.is-loading .wc-block-components-review-list-item__info .wc-block-components-review-list-item__meta .wc-block-components-review-list-item__author>*{visibility:hidden}@media screen and (prefers-reduced-motion:reduce){.is-loading .wc-block-components-review-list-item__info .wc-block-components-review-list-item__meta .wc-block-components-review-list-item__author{-webkit-animation:none;animation:none}}.is-loading .wc-block-components-review-list-item__info .wc-block-components-review-list-item__meta .wc-block-components-review-list-item__author:after{content:" "}.is-loading .wc-block-components-review-list-item__info .wc-block-components-review-list-item__meta .wc-block-components-review-list-item__product,.is-loading .wc-block-components-review-list-item__info .wc-block-components-review-list-item__meta .wc-block-components-review-list-item__rating .wc-block-components-review-list-item__rating__stars>span{display:none}.is-loading .wc-block-components-review-list-item__info .wc-block-components-review-list-item__published-date{-webkit-animation:loading-fade 1.2s ease-in-out infinite;animation:loading-fade 1.2s ease-in-out infinite;background-color:var(--global--color-primary,#e0e0e0)!important;color:var(--global--color-primary,#e0e0e0)!important;outline:0!important;border:0!important;box-shadow:none;pointer-events:none;max-width:100%;height:1em;width:120px}.is-loading .wc-block-components-review-list-item__info .wc-block-components-review-list-item__published-date>*{visibility:hidden}@media screen and (prefers-reduced-motion:reduce){.is-loading .wc-block-components-review-list-item__info .wc-block-components-review-list-item__published-date{-webkit-animation:none;animation:none}}.is-loading .wc-block-components-review-list-item__info .wc-block-components-review-list-item__published-date:after{content:" "}.editor-styles-wrapper .wc-block-components-review-list-item__item,.wc-block-components-review-list-item__item{margin:0 0 48px;list-style:none}.wc-block-components-review-list-item__info{display:-ms-grid;display:grid;-ms-grid-columns:1fr;grid-template-columns:1fr;margin-bottom:24px}.wc-block-components-review-list-item__meta{-ms-grid-column:1;grid-column:1;-ms-grid-row:1;grid-row:1}.wc-block-components-review-list-item__item--has-image .wc-block-components-review-list-item__info{-ms-grid-columns:calc(3em + 16px) 1fr;grid-template-columns:calc(3em + 16px) 1fr}.wc-block-components-review-list-item__item--has-image .wc-block-components-review-list-item__meta{-ms-grid-column:2;grid-column:2}.wc-block-components-review-list-item__image{align-items:center;display:flex;height:3em;-ms-grid-column:1;grid-column:1;-ms-grid-row:1;-ms-grid-row-span:2;grid-row:1/3;justify-content:center;position:relative;width:3em}.wc-block-components-review-list-item__image>img{display:block;max-height:100%;-o-object-fit:contain;object-fit:contain}.wc-block-components-review-list-item__verified{width:21px;height:21px;text-indent:21px;margin:0;line-height:21px;overflow:hidden;position:absolute;right:-7px;bottom:-7px}.wc-block-components-review-list-item__verified:before{width:21px;height:21px;background:transparent url('data:image/svg+xml;utf8,%3Csvg xmlns="http://www.w3.org/2000/svg" width="21" height="21" fill="none"%3E%3Ccircle cx="10.5" cy="10.5" r="10.5" fill="%23fff"/%3E%3Cpath fill="%23008A21" fill-rule="evenodd" d="M2.1667 10.5003c0-4.6 3.7333-8.3333 8.3333-8.3333s8.3334 3.7333 8.3334 8.3333S15.1 18.8337 10.5 18.8337s-8.3333-3.7334-8.3333-8.3334zm2.5 0l4.1666 4.1667 7.5001-7.5-1.175-1.1833-6.325 6.325-2.9917-2.9834-1.175 1.175z" clip-rule="evenodd"/%3E%3Cmask id="a" width="17" height="17" x="2" y="2" maskUnits="userSpaceOnUse"%3E%3Cpath fill="%23fff" fill-rule="evenodd" d="M2.1667 10.5003c0-4.6 3.7333-8.3333 8.3333-8.3333s8.3334 3.7333 8.3334 8.3333S15.1 18.8337 10.5 18.8337s-8.3333-3.7334-8.3333-8.3334zm2.5 0l4.1666 4.1667 7.5001-7.5-1.175-1.1833-6.325 6.325-2.9917-2.9834-1.175 1.175z" clip-rule="evenodd"/%3E%3C/mask%3E%3Cg mask="url(%23a)"%3E%3Cpath fill="%23008A21" d="M.5.5h20v20H.5z"/%3E%3C/g%3E%3C/svg%3E') 50% no-repeat;display:block;content:""}.wc-block-components-review-list-item__meta{display:flex;align-items:center;flex-flow:row wrap}.wc-block-components-review-list-item__meta:after{order:3;content:"";flex-basis:100%}.wc-block-components-review-list-item__author,.wc-block-components-review-list-item__product{display:block;font-weight:700;order:1;margin-right:8px}.wc-block-components-review-list-item__product+.wc-block-components-review-list-item__author{font-weight:400;order:4}.wc-block-components-review-list-item__published-date{order:5}.wc-block-components-review-list-item__product+.wc-block-components-review-list-item__author+.wc-block-components-review-list-item__published-date{padding-left:8px;position:relative}.wc-block-components-review-list-item__product+.wc-block-components-review-list-item__author+.wc-block-components-review-list-item__published-date:before{content:"";display:inline-block;margin-left:-8px;border-right:1px solid;opacity:.5;height:1em;vertical-align:middle;position:absolute;top:calc(50% + .1em);transform:translateY(-50%)}.wc-block-components-review-list-item__author:first-child+.wc-block-components-review-list-item__published-date:before,.wc-block-components-review-list-item__rating+.wc-block-components-review-list-item__author+.wc-block-components-review-list-item__published-date:before{display:none}.wc-block-components-review-list-item__rating{order:2}.wc-block-components-review-list-item__rating>.wc-block-components-review-list-item__rating__stars{font-size:1em;display:block;top:0;overflow:hidden;position:relative;height:1em;line-height:1;width:5.3em;font-family:star;font-weight:400}.wc-block-components-review-list-item__rating>.wc-block-components-review-list-item__rating__stars:before{content:"SSSSS";opacity:.25;float:left;top:0;left:0;position:absolute}.wc-block-components-review-list-item__rating>.wc-block-components-review-list-item__rating__stars span{overflow:hidden;float:left;top:0;left:0;position:absolute;padding-top:1.5em}.wc-block-components-review-list-item__rating>.wc-block-components-review-list-item__rating__stars span:before{content:"SSSSS";top:0;position:absolute;left:0;color:#e6a237}.wc-block-components-review-list-item__text p{font-size:inherit}.wc-block-components-review-list.wc-block-components-review-list{margin:0}.wc-block-components-review-sort-select{text-align:right}.wc-block-components-sidebar-layout{display:flex;flex-wrap:wrap;margin:0 auto 16px;position:relative}.wc-block-components-sidebar-layout .wc-block-components-main{box-sizing:border-box;margin:0;padding-right:3.7735849057%;width:65%}.wc-block-components-sidebar{box-sizing:border-box;margin:0;padding-left:2.2641509434%;width:35%}.wc-block-components-sidebar .wc-block-components-panel>h2{font-size:1em;border:0;border-radius:0;margin:0;padding:0;vertical-align:baseline}.is-medium.wc-block-components-sidebar-layout,.is-mobile.wc-block-components-sidebar-layout,.is-small.wc-block-components-sidebar-layout{flex-direction:column;margin:0 auto 16px}.is-medium.wc-block-components-sidebar-layout .wc-block-components-main,.is-medium.wc-block-components-sidebar-layout .wc-block-components-sidebar,.is-mobile.wc-block-components-sidebar-layout .wc-block-components-main,.is-mobile.wc-block-components-sidebar-layout .wc-block-components-sidebar,.is-small.wc-block-components-sidebar-layout .wc-block-components-main,.is-small.wc-block-components-sidebar-layout .wc-block-components-sidebar{padding:0;width:100%}.is-large .wc-block-components-sidebar .wc-block-components-panel,.is-large .wc-block-components-sidebar .wc-block-components-totals-item{padding-left:16px;padding-right:16px}.is-large .wc-block-components-sidebar .wc-block-components-panel .wc-block-components-totals-item{padding:0}.wc-block-components-sidebar .wc-block-components-panel>h2{color:inherit;font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;letter-spacing:inherit;line-height:inherit;text-decoration:inherit;text-transform:inherit}.wc-block-components-sidebar .wc-block-components-panel>h2 .wc-block-components-panel__button{font-weight:400}.theme-twentytwenty .wc-block-components-sidebar .wc-block-components-panel>h2{font-size:1.25em;border:0;border-radius:0;margin:0;padding:0;vertical-align:baseline}.wc-block-components-sort-select{margin-bottom:12px}.wc-block-components-sort-select__label{margin-right:12px;display:inline-block;font-weight:400}.wc-block-components-sort-select__select{font-size:inherit;width:-webkit-max-content;width:-moz-max-content;width:max-content}.wc-block-components-spinner{position:absolute;width:100%;height:100%;color:inherit;box-sizing:content-box;text-align:center;font-size:1.25em}.wc-block-components-spinner:after{content:" ";position:absolute;top:50%;left:50%;margin:-.5em 0 0 -.5em;width:1em;height:1em;box-sizing:border-box;transform-origin:50% 50%;transform:translateZ(0) scale(.5);-webkit-backface-visibility:hidden;backface-visibility:hidden;border-radius:50%;border:.2em solid;border-left:.2em solid transparent;-webkit-animation:wc-block-components-spinner__animation 1s linear infinite;animation:wc-block-components-spinner__animation 1s linear infinite}@-webkit-keyframes wc-block-components-spinner__animation{0%{-webkit-animation-timing-function:cubic-bezier(.5856,.0703,.4143,.9297);animation-timing-function:cubic-bezier(.5856,.0703,.4143,.9297);transform:rotate(0deg)}to{transform:rotate(1turn)}}@keyframes wc-block-components-spinner__animation{0%{-webkit-animation-timing-function:cubic-bezier(.5856,.0703,.4143,.9297);animation-timing-function:cubic-bezier(.5856,.0703,.4143,.9297);transform:rotate(0deg)}to{transform:rotate(1turn)}}.wc-block-components-state-input{margin-top:1.5em}.wc-block-components-tabs .wc-block-components-tabs__list{display:flex;flex-direction:row;flex-wrap:wrap;width:100%}.wc-block-components-tabs .wc-block-components-tabs__list>.wc-block-components-tabs__item{border:none;flex:auto;background:transparent;padding:12px 16px;color:inherit;outline-offset:-1px;text-align:center;transition:box-shadow .1s linear;box-shadow:inset 0 -1px currentColor;border-radius:0}.wc-block-components-tabs .wc-block-components-tabs__list>.wc-block-components-tabs__item.is-active{box-shadow:inset 0 -3px currentColor;font-weight:600;position:relative}.wc-block-components-tabs .wc-block-components-tabs__list>.wc-block-components-tabs__item:focus{outline-offset:-1px;outline:1px dotted currentColor}.wc-block-components-tabs .wc-block-components-tabs__list>.wc-block-components-tabs__item:active,.wc-block-components-tabs .wc-block-components-tabs__list>.wc-block-components-tabs__item:hover{background:transparent}.wc-block-components-tabs .wc-block-components-tabs__list>.wc-block-components-tabs__item .wc-block-components-tabs__item-content{font-size:1em;line-height:1;width:-webkit-fit-content;width:-moz-fit-content;width:fit-content;display:inline-block;font-weight:700}.wc-block-components-tabs .wc-block-components-tabs__list>.wc-block-components-tabs__item .wc-block-components-tabs__item-content>img,.wc-block-components-tabs .wc-block-components-tabs__list>.wc-block-components-tabs__item .wc-block-components-tabs__item-content>svg{height:1.2em;vertical-align:middle;margin:.2em 0 -.2em}.wc-block-components-tabs .wc-block-components-tabs__list>.wc-block-components-tabs__item .wc-block-components-tabs__item-content .wc-block-components-payment-method-icons{margin:.2em 0 -.2em}.wc-block-components-tabs .wc-block-components-tabs__list>.wc-block-components-tabs__item .wc-block-components-tabs__item-content .wc-block-components-payment-method-icons .wc-block-components-payment-method-icon{height:1.2em;vertical-align:middle}.wc-block-components-tabs .wc-block-components-tabs__content{padding:16px 0;text-transform:none}.wc-block-components-form .wc-block-components-text-input,.wc-block-components-text-input{position:relative;margin-top:1.5em;white-space:nowrap}.wc-block-components-form .wc-block-components-text-input label,.wc-block-components-text-input label{color:inherit;font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;letter-spacing:inherit;line-height:inherit;text-decoration:inherit;text-transform:inherit;font-size:1em;position:absolute;transform:translateY(.75em);left:0;top:0;transform-origin:top left;line-height:1.375;color:#757575;transition:transform .2s ease;margin:0 0 0 17px;overflow:hidden;text-overflow:ellipsis;max-width:calc(100% - 32px);cursor:text}.has-dark-controls .wc-block-components-form .wc-block-components-text-input label,.has-dark-controls .wc-block-components-text-input label{color:hsla(0,0%,100%,.6)}@media screen and (prefers-reduced-motion:reduce){.wc-block-components-form .wc-block-components-text-input label,.wc-block-components-text-input label{transition:none}}.wc-block-components-form .wc-block-components-text-input input:-webkit-autofill+label,.wc-block-components-text-input input:-webkit-autofill+label{transform:translateY(4px) scale(.75)}.wc-block-components-form .wc-block-components-text-input.is-active label,.wc-block-components-text-input.is-active label{transform:translateY(4px) scale(.75)}.wc-block-components-form .wc-block-components-text-input input[type=email],.wc-block-components-form .wc-block-components-text-input input[type=number],.wc-block-components-form .wc-block-components-text-input input[type=tel],.wc-block-components-form .wc-block-components-text-input input[type=text],.wc-block-components-form .wc-block-components-text-input input[type=url],.wc-block-components-text-input input[type=email],.wc-block-components-text-input input[type=number],.wc-block-components-text-input input[type=tel],.wc-block-components-text-input input[type=text],.wc-block-components-text-input input[type=url]{font-size:1em;background-color:#fff;padding:.75em 16px;border-radius:4px;border:1px solid #50575e;width:100%;line-height:1.375;font-family:inherit;margin:0;box-sizing:border-box;height:3em;min-height:0;color:#2b2d2f}.wc-block-components-form .wc-block-components-text-input input[type=email]:focus,.wc-block-components-form .wc-block-components-text-input input[type=number]:focus,.wc-block-components-form .wc-block-components-text-input input[type=tel]:focus,.wc-block-components-form .wc-block-components-text-input input[type=text]:focus,.wc-block-components-form .wc-block-components-text-input input[type=url]:focus,.wc-block-components-text-input input[type=email]:focus,.wc-block-components-text-input input[type=number]:focus,.wc-block-components-text-input input[type=tel]:focus,.wc-block-components-text-input input[type=text]:focus,.wc-block-components-text-input input[type=url]:focus{background-color:#fff;color:#2b2d2f;outline:0;box-shadow:0 0 0 1px #50575e}.has-dark-controls .wc-block-components-form .wc-block-components-text-input input[type=email],.has-dark-controls .wc-block-components-form .wc-block-components-text-input input[type=number],.has-dark-controls .wc-block-components-form .wc-block-components-text-input input[type=tel],.has-dark-controls .wc-block-components-form .wc-block-components-text-input input[type=text],.has-dark-controls .wc-block-components-form .wc-block-components-text-input input[type=url],.has-dark-controls .wc-block-components-text-input input[type=email],.has-dark-controls .wc-block-components-text-input input[type=number],.has-dark-controls .wc-block-components-text-input input[type=tel],.has-dark-controls .wc-block-components-text-input input[type=text],.has-dark-controls .wc-block-components-text-input input[type=url]{background-color:rgba(0,0,0,.1);border-color:hsla(0,0%,100%,.4);color:#fff}.has-dark-controls .wc-block-components-form .wc-block-components-text-input input[type=email]:focus,.has-dark-controls .wc-block-components-form .wc-block-components-text-input input[type=number]:focus,.has-dark-controls .wc-block-components-form .wc-block-components-text-input input[type=tel]:focus,.has-dark-controls .wc-block-components-form .wc-block-components-text-input input[type=text]:focus,.has-dark-controls .wc-block-components-form .wc-block-components-text-input input[type=url]:focus,.has-dark-controls .wc-block-components-text-input input[type=email]:focus,.has-dark-controls .wc-block-components-text-input input[type=number]:focus,.has-dark-controls .wc-block-components-text-input input[type=tel]:focus,.has-dark-controls .wc-block-components-text-input input[type=text]:focus,.has-dark-controls .wc-block-components-text-input input[type=url]:focus{background-color:rgba(0,0,0,.1);color:#fff;box-shadow:0 0 0 1px hsla(0,0%,100%,.4)}.wc-block-components-form .wc-block-components-text-input input[type=number],.wc-block-components-text-input input[type=number]{-moz-appearance:textfield}.wc-block-components-form .wc-block-components-text-input input[type=number]::-webkit-inner-spin-button,.wc-block-components-form .wc-block-components-text-input input[type=number]::-webkit-outer-spin-button,.wc-block-components-text-input input[type=number]::-webkit-inner-spin-button,.wc-block-components-text-input input[type=number]::-webkit-outer-spin-button{-webkit-appearance:none;appearance:none;margin:0}.wc-block-components-form .wc-block-components-text-input.is-active input[type=email],.wc-block-components-form .wc-block-components-text-input.is-active input[type=number],.wc-block-components-form .wc-block-components-text-input.is-active input[type=tel],.wc-block-components-form .wc-block-components-text-input.is-active input[type=text],.wc-block-components-form .wc-block-components-text-input.is-active input[type=url],.wc-block-components-text-input.is-active input[type=email],.wc-block-components-text-input.is-active input[type=number],.wc-block-components-text-input.is-active input[type=tel],.wc-block-components-text-input.is-active input[type=text],.wc-block-components-text-input.is-active input[type=url]{padding:1.5em 0 .25em 16px}.wc-block-components-form .wc-block-components-text-input.has-error input,.wc-block-components-form .wc-block-components-text-input.has-error input:active,.wc-block-components-form .wc-block-components-text-input.has-error input:focus,.wc-block-components-form .wc-block-components-text-input.has-error input:hover,.wc-block-components-text-input.has-error input,.wc-block-components-text-input.has-error input:active,.wc-block-components-text-input.has-error input:focus,.wc-block-components-text-input.has-error input:hover{border-color:#cc1818}.wc-block-components-form .wc-block-components-text-input.has-error input:focus,.wc-block-components-text-input.has-error input:focus{box-shadow:0 0 0 1px #cc1818}.wc-block-components-form .wc-block-components-text-input.has-error label,.wc-block-components-text-input.has-error label{color:#cc1818}.wc-block-components-form .wc-block-components-text-input:only-child,.wc-block-components-text-input:only-child{margin-top:0}.wc-block-components-textarea{font-size:1em;background-color:#fff;border:1px solid #50575e;border-radius:4px;color:#2b2d2f;font-family:inherit;line-height:1.375;margin:0;padding:.75em 16px;width:100%}.has-dark-controls .wc-block-components-textarea{background-color:rgba(0,0,0,.1);border-color:hsla(0,0%,100%,.4);color:#fff}.has-dark-controls .wc-block-components-textarea::-moz-placeholder{color:hsla(0,0%,100%,.6)}.has-dark-controls .wc-block-components-textarea:-ms-input-placeholder{color:hsla(0,0%,100%,.6)}.has-dark-controls .wc-block-components-textarea::placeholder{color:hsla(0,0%,100%,.6)}.theme-twentytwentyone .has-dark-controls .wc-block-components-textarea{background-color:rgba(0,0,0,.1);color:#fff}.theme-twentytwenty .wc-block-components-title.wc-block-components-title,.wc-block-components-title.wc-block-components-title{border:0;border-radius:0;margin:0;padding:0;vertical-align:baseline;font-size:1.25em;word-break:break-word}.wc-block-components-notices{display:block;margin-bottom:2em}.wc-block-components-notices .wc-block-components-notices__notice{margin:0;display:flex;flex-wrap:nowrap}.wc-block-components-notices .wc-block-components-notices__notice .components-notice__dismiss{background:transparent none;padding:0;margin:0 0 0 auto;border:0;outline:0;color:currentColor}.wc-block-components-notices .wc-block-components-notices__notice .components-notice__dismiss svg{fill:currentColor;vertical-align:text-top}.wc-block-components-notices .wc-block-components-notices__notice+.wc-block-components-notices__notice{margin-top:1em}.theme-twentytwenty .wc-block-components-notices__notice,.theme-twentytwentyone .wc-block-components-notices__notice{padding:1.5rem 3rem}.wc-block-components-notices__snackbar{position:fixed;bottom:20px;left:16px;width:auto}@media(max-width:782px){.wc-block-components-notices__snackbar{position:fixed;top:10px;left:0;bottom:auto}}@media(max-width:782px){.wc-block-components-notices__snackbar .components-snackbar-list__notice-container{margin-left:10px;margin-right:10px}}.wc-block-components-validation-error{font-size:.75em;color:#cc1818;max-width:100%;white-space:normal}.wc-block-components-validation-error>p{margin:0;padding:0}.wc-block-components-select+.wc-block-components-validation-error{margin-bottom:24px}.with-scroll-to-top__scroll-point{position:relative;top:-36px}.is-medium .wc-block-cart__sidebar,.is-mobile .wc-block-cart__sidebar,.is-small .wc-block-cart__sidebar{margin-bottom:24px;order:0}.wc-block-cart__submit{position:relative}.wc-block-cart__submit-container{padding-bottom:16px}.wc-block-cart__submit-button{width:100%;margin:0 0 16px}.wc-block-cart__submit-button:last-child{margin-bottom:0}.is-medium .wc-block-cart__submit-container:not(.wc-block-cart__submit-container--sticky),.is-mobile .wc-block-cart__submit-container:not(.wc-block-cart__submit-container--sticky),.is-small .wc-block-cart__submit-container:not(.wc-block-cart__submit-container--sticky){padding-left:0;padding-right:0;padding-top:0}@media(min-width:783px){.wc-block-cart__submit-container--sticky{display:none}}@media(max-width:782px){.wc-block-cart__submit-container--sticky{background:#fff;bottom:0;left:0;padding:16px;position:fixed;width:100%;z-index:9999}.wc-block-cart__submit-container--sticky:before{box-shadow:0 -10px 20px 10px currentColor;color:hsla(0,0%,80%,.5);content:"";height:100%;left:0;position:absolute;right:0;top:0}}.editor-styles-wrapper .wc-block-cart__empty-cart__title,.wc-block-cart__empty-cart__title{font-size:inherit}.wc-block-cart .wc-block-components-shipping-calculator{white-space:nowrap}.wc-block-cart .wc-block-components-address-form .wc-block-components-country-input:first-of-type,.wc-block-cart .wc-block-components-address-form .wc-block-components-state-input:first-of-type,.wc-block-cart .wc-block-components-address-form .wc-block-components-text-input:first-of-type{margin-top:0}table.wc-block-cart-items,table.wc-block-cart-items td,table.wc-block-cart-items th{background:none!important;border:0;margin:0}.editor-styles-wrapper table.wc-block-cart-items,table.wc-block-cart-items{width:100%}.editor-styles-wrapper table.wc-block-cart-items .wc-block-cart-items__header,table.wc-block-cart-items .wc-block-cart-items__header{font-size:.75em;text-transform:uppercase}.editor-styles-wrapper table.wc-block-cart-items .wc-block-cart-items__header .wc-block-cart-items__header-image,table.wc-block-cart-items .wc-block-cart-items__header .wc-block-cart-items__header-image{width:100px}.editor-styles-wrapper table.wc-block-cart-items .wc-block-cart-items__header .wc-block-cart-items__header-product,table.wc-block-cart-items .wc-block-cart-items__header .wc-block-cart-items__header-product{visibility:hidden}.editor-styles-wrapper table.wc-block-cart-items .wc-block-cart-items__header .wc-block-cart-items__header-total,table.wc-block-cart-items .wc-block-cart-items__header .wc-block-cart-items__header-total{width:100px;text-align:right}.editor-styles-wrapper table.wc-block-cart-items .wc-block-cart-items__row .wc-block-cart-item__image img,table.wc-block-cart-items .wc-block-cart-items__row .wc-block-cart-item__image img{width:100%;margin:0}.editor-styles-wrapper table.wc-block-cart-items .wc-block-cart-items__row .wc-block-cart-item__quantity .wc-block-cart-item__remove-link,table.wc-block-cart-items .wc-block-cart-items__row .wc-block-cart-item__quantity .wc-block-cart-item__remove-link{border:0;border-radius:0;margin:0;padding:0;vertical-align:baseline;color:inherit;font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;letter-spacing:inherit;line-height:inherit;text-decoration:inherit;text-transform:inherit;background:transparent;box-shadow:none;display:inline;text-shadow:none;text-decoration:underline;font-size:.75em;text-transform:none;white-space:nowrap}.editor-styles-wrapper table.wc-block-cart-items .wc-block-cart-items__row .wc-block-cart-item__quantity .wc-block-cart-item__remove-link:active,.editor-styles-wrapper table.wc-block-cart-items .wc-block-cart-items__row .wc-block-cart-item__quantity .wc-block-cart-item__remove-link:focus,.editor-styles-wrapper table.wc-block-cart-items .wc-block-cart-items__row .wc-block-cart-item__quantity .wc-block-cart-item__remove-link:hover,table.wc-block-cart-items .wc-block-cart-items__row .wc-block-cart-item__quantity .wc-block-cart-item__remove-link:active,table.wc-block-cart-items .wc-block-cart-items__row .wc-block-cart-item__quantity .wc-block-cart-item__remove-link:focus,table.wc-block-cart-items .wc-block-cart-items__row .wc-block-cart-item__quantity .wc-block-cart-item__remove-link:hover{background:transparent}.editor-styles-wrapper table.wc-block-cart-items .wc-block-cart-items__row .wc-block-components-product-name,table.wc-block-cart-items .wc-block-cart-items__row .wc-block-components-product-name{display:block;max-width:-webkit-max-content;max-width:-moz-max-content;max-width:max-content}.editor-styles-wrapper table.wc-block-cart-items .wc-block-cart-items__row .wc-block-cart-item__total,table.wc-block-cart-items .wc-block-cart-items__row .wc-block-cart-item__total{font-size:1em;text-align:right;line-height:inherit}.editor-styles-wrapper table.wc-block-cart-items .wc-block-cart-items__row .wc-block-components-product-metadata,table.wc-block-cart-items .wc-block-cart-items__row .wc-block-components-product-metadata{margin-bottom:.75em}.editor-styles-wrapper table.wc-block-cart-items .wc-block-cart-items__row.is-disabled,table.wc-block-cart-items .wc-block-cart-items__row.is-disabled{opacity:.5;pointer-events:none;transition:opacity .2s ease}.wc-block-cart .wc-block-components-totals-footer-item,.wc-block-cart .wc-block-components-totals-taxes{margin:0}.wc-block-cart--is-loading h2 span,.wc-block-cart--is-loading th span,.wc-block-mini-cart__drawer.is-loading h2 span,.wc-block-mini-cart__drawer.is-loading th span{-webkit-animation:loading-fade 1.2s ease-in-out infinite;animation:loading-fade 1.2s ease-in-out infinite;background-color:var(--global--color-primary,#e0e0e0)!important;color:var(--global--color-primary,#e0e0e0)!important;outline:0!important;border:0!important;box-shadow:none;pointer-events:none;max-width:100%;min-width:84px;display:inline-block}.wc-block-cart--is-loading h2 span>*,.wc-block-cart--is-loading th span>*,.wc-block-mini-cart__drawer.is-loading h2 span>*,.wc-block-mini-cart__drawer.is-loading th span>*{visibility:hidden}@media screen and (prefers-reduced-motion:reduce){.wc-block-cart--is-loading h2 span,.wc-block-cart--is-loading th span,.wc-block-mini-cart__drawer.is-loading h2 span,.wc-block-mini-cart__drawer.is-loading th span{-webkit-animation:none;animation:none}}.wc-block-cart--is-loading h2 span:after,.wc-block-cart--is-loading th span:after,.wc-block-mini-cart__drawer.is-loading h2 span:after,.wc-block-mini-cart__drawer.is-loading th span:after{content:" "}.wc-block-cart--is-loading h2 span,.wc-block-mini-cart__drawer.is-loading h2 span{min-width:33%}.wc-block-cart--is-loading .wc-block-components-product-metadata,.wc-block-cart--is-loading .wc-block-components-product-price,.wc-block-cart--is-loading .wc-block-components-quantity-selector,.wc-block-mini-cart__drawer.is-loading .wc-block-components-product-metadata,.wc-block-mini-cart__drawer.is-loading .wc-block-components-product-price,.wc-block-mini-cart__drawer.is-loading .wc-block-components-quantity-selector{-webkit-animation:loading-fade 1.2s ease-in-out infinite;animation:loading-fade 1.2s ease-in-out infinite;background-color:var(--global--color-primary,#e0e0e0)!important;color:var(--global--color-primary,#e0e0e0)!important;outline:0!important;border:0!important;box-shadow:none;pointer-events:none;max-width:100%}.wc-block-cart--is-loading .wc-block-components-product-metadata>*,.wc-block-cart--is-loading .wc-block-components-product-price>*,.wc-block-cart--is-loading .wc-block-components-quantity-selector>*,.wc-block-mini-cart__drawer.is-loading .wc-block-components-product-metadata>*,.wc-block-mini-cart__drawer.is-loading .wc-block-components-product-price>*,.wc-block-mini-cart__drawer.is-loading .wc-block-components-quantity-selector>*{visibility:hidden}@media screen and (prefers-reduced-motion:reduce){.wc-block-cart--is-loading .wc-block-components-product-metadata,.wc-block-cart--is-loading .wc-block-components-product-price,.wc-block-cart--is-loading .wc-block-components-quantity-selector,.wc-block-mini-cart__drawer.is-loading .wc-block-components-product-metadata,.wc-block-mini-cart__drawer.is-loading .wc-block-components-product-price,.wc-block-mini-cart__drawer.is-loading .wc-block-components-quantity-selector{-webkit-animation:none;animation:none}}.wc-block-cart--is-loading .wc-block-components-product-name,.wc-block-mini-cart__drawer.is-loading .wc-block-components-product-name{-webkit-animation:loading-fade 1.2s ease-in-out infinite;animation:loading-fade 1.2s ease-in-out infinite;background-color:var(--global--color-primary,#e0e0e0)!important;color:var(--global--color-primary,#e0e0e0)!important;outline:0!important;border:0!important;box-shadow:none;pointer-events:none;max-width:100%;min-width:84px;display:inline-block}.wc-block-cart--is-loading .wc-block-components-product-name>*,.wc-block-mini-cart__drawer.is-loading .wc-block-components-product-name>*{visibility:hidden}@media screen and (prefers-reduced-motion:reduce){.wc-block-cart--is-loading .wc-block-components-product-name,.wc-block-mini-cart__drawer.is-loading .wc-block-components-product-name{-webkit-animation:none;animation:none}}.wc-block-cart--is-loading .wc-block-components-product-name:after,.wc-block-mini-cart__drawer.is-loading .wc-block-components-product-name:after{content:" "}.wc-block-cart--is-loading .wc-block-components-product-metadata,.wc-block-mini-cart__drawer.is-loading .wc-block-components-product-metadata{margin-top:.25em;min-width:8em}.wc-block-cart--is-loading .wc-block-cart-item__remove-link,.wc-block-mini-cart__drawer.is-loading .wc-block-cart-item__remove-link{visibility:hidden}.wc-block-cart--is-loading .wc-block-cart-item__image>a,.wc-block-mini-cart__drawer.is-loading .wc-block-cart-item__image>a{-webkit-animation:loading-fade 1.2s ease-in-out infinite;animation:loading-fade 1.2s ease-in-out infinite;background-color:var(--global--color-primary,#e0e0e0)!important;color:var(--global--color-primary,#e0e0e0)!important;outline:0!important;border:0!important;box-shadow:none;pointer-events:none;max-width:100%;display:block}.wc-block-cart--is-loading .wc-block-cart-item__image>a>*,.wc-block-mini-cart__drawer.is-loading .wc-block-cart-item__image>a>*{visibility:hidden}@media screen and (prefers-reduced-motion:reduce){.wc-block-cart--is-loading .wc-block-cart-item__image>a,.wc-block-mini-cart__drawer.is-loading .wc-block-cart-item__image>a{-webkit-animation:none;animation:none}}.wc-block-cart--is-loading .wc-block-components-product-price,.wc-block-mini-cart__drawer.is-loading .wc-block-components-product-price{max-width:3em;display:block;margin-top:.25em}.wc-block-cart--is-loading .wc-block-components-product-price:after,.wc-block-mini-cart__drawer.is-loading .wc-block-components-product-price:after{content:" "}.wc-block-cart--is-loading .wc-block-cart__sidebar .components-card,.wc-block-mini-cart__drawer.is-loading .wc-block-cart__sidebar .components-card{-webkit-animation:loading-fade 1.2s ease-in-out infinite;animation:loading-fade 1.2s ease-in-out infinite;background-color:var(--global--color-primary,#e0e0e0)!important;color:var(--global--color-primary,#e0e0e0)!important;outline:0!important;border:0!important;box-shadow:none;pointer-events:none;max-width:100%;min-height:460px}.wc-block-cart--is-loading .wc-block-cart__sidebar .components-card>*,.wc-block-mini-cart__drawer.is-loading .wc-block-cart__sidebar .components-card>*{visibility:hidden}@media screen and (prefers-reduced-motion:reduce){.wc-block-cart--is-loading .wc-block-cart__sidebar .components-card,.wc-block-mini-cart__drawer.is-loading .wc-block-cart__sidebar .components-card{-webkit-animation:none;animation:none}}.wc-block-cart--is-loading .wc-block-cart__sidebar .components-card:after,.wc-block-mini-cart__drawer.is-loading .wc-block-cart__sidebar .components-card:after{content:" "}.wc-block-components-sidebar-layout.wc-block-cart--skeleton{display:none}.is-loading+.wc-block-components-sidebar-layout.wc-block-cart--skeleton{display:flex}.wc-block-cart-item__total-price-and-sale-badge-wrapper{display:flex;flex-direction:column;align-items:flex-end}.wc-block-cart-item__total-price-and-sale-badge-wrapper .wc-block-components-sale-badge{margin-top:4px}.is-medium.wc-block-cart .wc-block-components-sidebar .wc-block-cart__totals-title,.is-mobile .wc-block-cart-item__total .wc-block-components-sale-badge,.is-mobile.wc-block-cart .wc-block-components-sidebar .wc-block-cart__totals-title,.is-small .wc-block-cart-item__total .wc-block-components-sale-badge,.is-small.wc-block-cart .wc-block-components-sidebar .wc-block-cart__totals-title{display:none}.is-medium table.wc-block-cart-items td,.is-mobile table.wc-block-cart-items td,.is-small table.wc-block-cart-items td{padding:0}.is-medium table.wc-block-cart-items .wc-block-cart-item__remove-link,.is-medium table.wc-block-cart-items .wc-block-cart-items__header,.is-mobile table.wc-block-cart-items .wc-block-cart-item__remove-link,.is-mobile table.wc-block-cart-items .wc-block-cart-items__header,.is-small table.wc-block-cart-items .wc-block-cart-item__remove-link,.is-small table.wc-block-cart-items .wc-block-cart-items__header{display:none}.is-medium table.wc-block-cart-items .wc-block-cart-items__row,.is-mobile table.wc-block-cart-items .wc-block-cart-items__row,.is-small table.wc-block-cart-items .wc-block-cart-items__row{position:relative;display:-ms-grid;display:grid;-ms-grid-columns:80px 132px;grid-template-columns:80px 132px;padding:16px 0}.is-medium table.wc-block-cart-items .wc-block-cart-items__row:after,.is-mobile table.wc-block-cart-items .wc-block-cart-items__row:after,.is-small table.wc-block-cart-items .wc-block-cart-items__row:after{border-style:solid;border-width:0 0 1px;bottom:0;content:"";display:block;left:0;opacity:.3;pointer-events:none;position:absolute;right:0;top:0}.is-medium table.wc-block-cart-items .wc-block-cart-items__row .wc-block-cart-item__image,.is-mobile table.wc-block-cart-items .wc-block-cart-items__row .wc-block-cart-item__image,.is-small table.wc-block-cart-items .wc-block-cart-items__row .wc-block-cart-item__image{-ms-grid-column:1;grid-column-start:1;-ms-grid-row:1;grid-row-start:1;padding-right:16px}.is-medium table.wc-block-cart-items .wc-block-cart-items__row .wc-block-cart-item__product,.is-mobile table.wc-block-cart-items .wc-block-cart-items__row .wc-block-cart-item__product,.is-small table.wc-block-cart-items .wc-block-cart-items__row .wc-block-cart-item__product{-ms-grid-column:2;grid-column-start:2;-ms-grid-column-span:2;grid-column-end:4;-ms-grid-row:1;grid-row-start:1;-ms-grid-column-align:stretch;justify-self:stretch;padding:0 16px 16px 0}.is-medium table.wc-block-cart-items .wc-block-cart-items__row .wc-block-cart-item__quantity,.is-mobile table.wc-block-cart-items .wc-block-cart-items__row .wc-block-cart-item__quantity,.is-small table.wc-block-cart-items .wc-block-cart-items__row .wc-block-cart-item__quantity{-ms-grid-column:1;grid-column-start:1;-ms-grid-row:2;grid-row-start:2;vertical-align:bottom;padding-right:16px;-ms-grid-row-align:end;align-self:end;padding-top:16px}.is-medium table.wc-block-cart-items .wc-block-cart-items__row .wc-block-cart-item__total,.is-mobile table.wc-block-cart-items .wc-block-cart-items__row .wc-block-cart-item__total,.is-small table.wc-block-cart-items .wc-block-cart-items__row .wc-block-cart-item__total{-ms-grid-row:1;grid-row-start:1}.is-medium table.wc-block-cart-items .wc-block-cart-items__row .wc-block-cart-item__total .wc-block-components-formatted-money-amount,.is-mobile table.wc-block-cart-items .wc-block-cart-items__row .wc-block-cart-item__total .wc-block-components-formatted-money-amount,.is-small table.wc-block-cart-items .wc-block-cart-items__row .wc-block-cart-item__total .wc-block-components-formatted-money-amount{display:inline-block}.is-large.wc-block-cart .wc-block-cart-items{position:relative}.is-large.wc-block-cart .wc-block-cart-items:after{border-style:solid;border-width:0 0 1px;bottom:0;content:"";display:block;left:0;opacity:.3;pointer-events:none;position:absolute;right:0;top:0}.is-large.wc-block-cart .wc-block-cart-items th{padding:.25rem 16px .25rem 0;white-space:nowrap}.is-large.wc-block-cart .wc-block-cart-items td{position:relative;padding:16px 0 16px 16px;vertical-align:top}.is-large.wc-block-cart .wc-block-cart-items td:after{border-style:solid;border-width:1px 0 0;bottom:0;content:"";display:block;left:0;opacity:.3;pointer-events:none;position:absolute;right:0;top:0}.is-large.wc-block-cart .wc-block-cart-items th:last-child{padding-right:0}.is-large.wc-block-cart .wc-block-cart-items td:last-child{padding-right:16px}.is-large.wc-block-cart .wc-block-components-radio-control__input{left:0}.is-large.wc-block-cart .wc-block-cart__totals-title{border:0;border-radius:0;margin:0;vertical-align:baseline;color:inherit;font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;letter-spacing:inherit;line-height:inherit;text-decoration:inherit;text-transform:inherit;box-shadow:none;display:inline;background:transparent;font-size:.75em;display:block;font-weight:600;padding:.25rem 0;text-align:right;text-transform:uppercase}.is-large.wc-block-cart .wc-block-components-sidebar .wc-block-components-shipping-calculator,.is-large.wc-block-cart .wc-block-components-sidebar .wc-block-components-shipping-rates-control__package:not(.wc-block-components-panel){padding-left:16px;padding-right:16px}.is-large.wc-block-cart .wc-block-cart__payment-options{padding:16px}.wp-block-woocommerce-cart.is-loading{display:none}.wp-block-woocommerce-cart{margin-bottom:3em}.wc-block-checkout-error{padding:40px;text-align:center;width:100%}.wc-block-checkout-error .wc-block-checkout-error__image{max-width:150px;margin:0 auto 1em;display:block;color:inherit}.wc-block-checkout-error .wc-block-checkout-error__title{display:block;margin:0;font-weight:700}.wc-block-checkout-error .wc-block-checkout-error__description{display:block;margin:.25em 0 1em}.wc-block-checkout-empty{padding:40px;text-align:center;width:100%}.wc-block-checkout-empty .wc-block-checkout-empty__image{max-width:150px;margin:0 auto 1em;display:block;color:inherit}.wc-block-checkout-empty .wc-block-checkout-empty__title{display:block;margin:0;font-weight:700}.wc-block-checkout-empty .wc-block-checkout-empty__description{display:block;margin:.25em 0 1em}.wc-block-checkout__actions{display:flex;justify-content:space-between;align-items:center}.wc-block-checkout__actions .wc-block-components-checkout-place-order-button{width:50%;padding:1em;height:auto}.wc-block-checkout__actions .wc-block-components-checkout-place-order-button .wc-block-components-button__text{line-height:24px}.wc-block-checkout__actions .wc-block-components-checkout-place-order-button .wc-block-components-button__text>svg{fill:#fff;vertical-align:top}.is-mobile .wc-block-checkout__actions .wc-block-components-checkout-return-to-cart-button{display:none}.is-mobile .wc-block-checkout__actions .wc-block-components-checkout-place-order-button{width:100%}.is-large .wc-block-checkout__actions{position:relative;padding:1.5em 0}.is-large .wc-block-checkout__actions:after{border-style:solid;border-width:1px 0 0;bottom:0;content:"";display:block;left:0;opacity:.3;pointer-events:none;position:absolute;right:0;top:0}.wc-block-checkout__form{margin:0;max-width:100%}.is-medium .wc-block-checkout__main,.is-mobile .wc-block-checkout__main,.is-small .wc-block-checkout__main{order:1}.is-large .wc-block-checkout__billing-fields .wc-block-components-address-form,.is-large .wc-block-checkout__shipping-fields .wc-block-components-address-form,.is-medium .wc-block-checkout__billing-fields .wc-block-components-address-form,.is-medium .wc-block-checkout__shipping-fields .wc-block-components-address-form,.is-small .wc-block-checkout__billing-fields .wc-block-components-address-form,.is-small .wc-block-checkout__shipping-fields .wc-block-components-address-form{margin-left:-6px;margin-right:-6px}.is-large .wc-block-checkout__billing-fields .wc-block-components-address-form:after,.is-large .wc-block-checkout__shipping-fields .wc-block-components-address-form:after,.is-medium .wc-block-checkout__billing-fields .wc-block-components-address-form:after,.is-medium .wc-block-checkout__shipping-fields .wc-block-components-address-form:after,.is-small .wc-block-checkout__billing-fields .wc-block-components-address-form:after,.is-small .wc-block-checkout__shipping-fields .wc-block-components-address-form:after{content:"";clear:both;display:block}.is-large .wc-block-checkout__billing-fields .wc-block-components-address-form .wc-block-components-country-input,.is-large .wc-block-checkout__billing-fields .wc-block-components-address-form .wc-block-components-state-input,.is-large .wc-block-checkout__billing-fields .wc-block-components-address-form .wc-block-components-text-input,.is-large .wc-block-checkout__shipping-fields .wc-block-components-address-form .wc-block-components-country-input,.is-large .wc-block-checkout__shipping-fields .wc-block-components-address-form .wc-block-components-state-input,.is-large .wc-block-checkout__shipping-fields .wc-block-components-address-form .wc-block-components-text-input,.is-medium .wc-block-checkout__billing-fields .wc-block-components-address-form .wc-block-components-country-input,.is-medium .wc-block-checkout__billing-fields .wc-block-components-address-form .wc-block-components-state-input,.is-medium .wc-block-checkout__billing-fields .wc-block-components-address-form .wc-block-components-text-input,.is-medium .wc-block-checkout__shipping-fields .wc-block-components-address-form .wc-block-components-country-input,.is-medium .wc-block-checkout__shipping-fields .wc-block-components-address-form .wc-block-components-state-input,.is-medium .wc-block-checkout__shipping-fields .wc-block-components-address-form .wc-block-components-text-input,.is-small .wc-block-checkout__billing-fields .wc-block-components-address-form .wc-block-components-country-input,.is-small .wc-block-checkout__billing-fields .wc-block-components-address-form .wc-block-components-state-input,.is-small .wc-block-checkout__billing-fields .wc-block-components-address-form .wc-block-components-text-input,.is-small .wc-block-checkout__shipping-fields .wc-block-components-address-form .wc-block-components-country-input,.is-small .wc-block-checkout__shipping-fields .wc-block-components-address-form .wc-block-components-state-input,.is-small .wc-block-checkout__shipping-fields .wc-block-components-address-form .wc-block-components-text-input{float:left;margin-left:6px;margin-right:6px;position:relative;width:calc(50% - 12px)}.is-large .wc-block-checkout__billing-fields .wc-block-components-address-form .wc-block-components-country-input:first-of-type,.is-large .wc-block-checkout__billing-fields .wc-block-components-address-form .wc-block-components-country-input:nth-of-type(2),.is-large .wc-block-checkout__billing-fields .wc-block-components-address-form .wc-block-components-state-input:first-of-type,.is-large .wc-block-checkout__billing-fields .wc-block-components-address-form .wc-block-components-state-input:nth-of-type(2),.is-large .wc-block-checkout__billing-fields .wc-block-components-address-form .wc-block-components-text-input:first-of-type,.is-large .wc-block-checkout__billing-fields .wc-block-components-address-form .wc-block-components-text-input:nth-of-type(2),.is-large .wc-block-checkout__shipping-fields .wc-block-components-address-form .wc-block-components-country-input:first-of-type,.is-large .wc-block-checkout__shipping-fields .wc-block-components-address-form .wc-block-components-country-input:nth-of-type(2),.is-large .wc-block-checkout__shipping-fields .wc-block-components-address-form .wc-block-components-state-input:first-of-type,.is-large .wc-block-checkout__shipping-fields .wc-block-components-address-form .wc-block-components-state-input:nth-of-type(2),.is-large .wc-block-checkout__shipping-fields .wc-block-components-address-form .wc-block-components-text-input:first-of-type,.is-large .wc-block-checkout__shipping-fields .wc-block-components-address-form .wc-block-components-text-input:nth-of-type(2),.is-medium .wc-block-checkout__billing-fields .wc-block-components-address-form .wc-block-components-country-input:first-of-type,.is-medium .wc-block-checkout__billing-fields .wc-block-components-address-form .wc-block-components-country-input:nth-of-type(2),.is-medium .wc-block-checkout__billing-fields .wc-block-components-address-form .wc-block-components-state-input:first-of-type,.is-medium .wc-block-checkout__billing-fields .wc-block-components-address-form .wc-block-components-state-input:nth-of-type(2),.is-medium .wc-block-checkout__billing-fields .wc-block-components-address-form .wc-block-components-text-input:first-of-type,.is-medium .wc-block-checkout__billing-fields .wc-block-components-address-form .wc-block-components-text-input:nth-of-type(2),.is-medium .wc-block-checkout__shipping-fields .wc-block-components-address-form .wc-block-components-country-input:first-of-type,.is-medium .wc-block-checkout__shipping-fields .wc-block-components-address-form .wc-block-components-country-input:nth-of-type(2),.is-medium .wc-block-checkout__shipping-fields .wc-block-components-address-form .wc-block-components-state-input:first-of-type,.is-medium .wc-block-checkout__shipping-fields .wc-block-components-address-form .wc-block-components-state-input:nth-of-type(2),.is-medium .wc-block-checkout__shipping-fields .wc-block-components-address-form .wc-block-components-text-input:first-of-type,.is-medium .wc-block-checkout__shipping-fields .wc-block-components-address-form .wc-block-components-text-input:nth-of-type(2),.is-small .wc-block-checkout__billing-fields .wc-block-components-address-form .wc-block-components-country-input:first-of-type,.is-small .wc-block-checkout__billing-fields .wc-block-components-address-form .wc-block-components-country-input:nth-of-type(2),.is-small .wc-block-checkout__billing-fields .wc-block-components-address-form .wc-block-components-state-input:first-of-type,.is-small .wc-block-checkout__billing-fields .wc-block-components-address-form .wc-block-components-state-input:nth-of-type(2),.is-small .wc-block-checkout__billing-fields .wc-block-components-address-form .wc-block-components-text-input:first-of-type,.is-small .wc-block-checkout__billing-fields .wc-block-components-address-form .wc-block-components-text-input:nth-of-type(2),.is-small .wc-block-checkout__shipping-fields .wc-block-components-address-form .wc-block-components-country-input:first-of-type,.is-small .wc-block-checkout__shipping-fields .wc-block-components-address-form .wc-block-components-country-input:nth-of-type(2),.is-small .wc-block-checkout__shipping-fields .wc-block-components-address-form .wc-block-components-state-input:first-of-type,.is-small .wc-block-checkout__shipping-fields .wc-block-components-address-form .wc-block-components-state-input:nth-of-type(2),.is-small .wc-block-checkout__shipping-fields .wc-block-components-address-form .wc-block-components-text-input:first-of-type,.is-small .wc-block-checkout__shipping-fields .wc-block-components-address-form .wc-block-components-text-input:nth-of-type(2){margin-top:0}.is-large .wc-block-checkout__billing-fields .wc-block-components-address-form .wc-block-components-address-form__address_1,.is-large .wc-block-checkout__billing-fields .wc-block-components-address-form .wc-block-components-address-form__address_2,.is-large .wc-block-checkout__billing-fields .wc-block-components-address-form .wc-block-components-address-form__company,.is-large .wc-block-checkout__shipping-fields .wc-block-components-address-form .wc-block-components-address-form__address_1,.is-large .wc-block-checkout__shipping-fields .wc-block-components-address-form .wc-block-components-address-form__address_2,.is-large .wc-block-checkout__shipping-fields .wc-block-components-address-form .wc-block-components-address-form__company,.is-medium .wc-block-checkout__billing-fields .wc-block-components-address-form .wc-block-components-address-form__address_1,.is-medium .wc-block-checkout__billing-fields .wc-block-components-address-form .wc-block-components-address-form__address_2,.is-medium .wc-block-checkout__billing-fields .wc-block-components-address-form .wc-block-components-address-form__company,.is-medium .wc-block-checkout__shipping-fields .wc-block-components-address-form .wc-block-components-address-form__address_1,.is-medium .wc-block-checkout__shipping-fields .wc-block-components-address-form .wc-block-components-address-form__address_2,.is-medium .wc-block-checkout__shipping-fields .wc-block-components-address-form .wc-block-components-address-form__company,.is-small .wc-block-checkout__billing-fields .wc-block-components-address-form .wc-block-components-address-form__address_1,.is-small .wc-block-checkout__billing-fields .wc-block-components-address-form .wc-block-components-address-form__address_2,.is-small .wc-block-checkout__billing-fields .wc-block-components-address-form .wc-block-components-address-form__company,.is-small .wc-block-checkout__shipping-fields .wc-block-components-address-form .wc-block-components-address-form__address_1,.is-small .wc-block-checkout__shipping-fields .wc-block-components-address-form .wc-block-components-address-form__address_2,.is-small .wc-block-checkout__shipping-fields .wc-block-components-address-form .wc-block-components-address-form__company{width:calc(100% - 12px)}.is-large .wc-block-checkout__billing-fields .wc-block-components-address-form .wc-block-components-checkbox,.is-large .wc-block-checkout__shipping-fields .wc-block-components-address-form .wc-block-components-checkbox,.is-medium .wc-block-checkout__billing-fields .wc-block-components-address-form .wc-block-components-checkbox,.is-medium .wc-block-checkout__shipping-fields .wc-block-components-address-form .wc-block-components-checkbox,.is-small .wc-block-checkout__billing-fields .wc-block-components-address-form .wc-block-components-checkbox,.is-small .wc-block-checkout__shipping-fields .wc-block-components-address-form .wc-block-components-checkbox{clear:both}.components-placeholder.wc-block-checkout__no-shipping-placeholder{margin-bottom:16px}.components-placeholder.wc-block-checkout__no-shipping-placeholder *{pointer-events:all}.components-placeholder.wc-block-checkout__no-shipping-placeholder .components-placeholder__fieldset{display:block}.components-placeholder.wc-block-checkout__no-shipping-placeholder .components-placeholder__fieldset .components-button{background-color:#1e1e1e;color:#fff}.components-placeholder.wc-block-checkout__no-shipping-placeholder .components-placeholder__fieldset .wc-block-checkout__no-shipping-placeholder-description{display:block;margin:.25em 0 1em}.wc-block-checkout__shipping-option .wc-block-components-radio-control__option{position:relative;margin:0;padding:.75em 0 .75em 2.5em}.wc-block-checkout__shipping-option .wc-block-components-radio-control__option:after{border-style:solid;border-width:0 0 1px;bottom:0;content:"";display:block;left:0;opacity:.3;pointer-events:none;position:absolute;right:0;top:0}.wc-block-checkout__shipping-option .wc-block-components-shipping-rates-control__no-results-notice{margin:.75em 0}.wc-block-checkout__terms{margin:1.5em 0;text-align:justify}.wc-block-checkout__terms textarea{top:-5px;position:relative}.wc-block-checkout__terms.wc-block-checkout__terms--disabled{opacity:.6}.wc-block-checkout__sidebar .wc-block-components-product-name{display:block;color:inherit;flex-grow:1;flex-basis:0}.wc-block-checkout__sidebar .wc-block-components-totals-footer-item,.wc-block-checkout__sidebar .wc-block-components-totals-taxes{margin:0;padding:0}.is-medium .wc-block-checkout__sidebar,.is-mobile .wc-block-checkout__sidebar,.is-small .wc-block-checkout__sidebar{margin-bottom:24px;order:0}.wc-block-checkout__add-note{margin:1.5em 0}.is-medium .wc-block-checkout__add-note,.is-mobile .wc-block-checkout__add-note,.is-small .wc-block-checkout__add-note{position:relative;margin-bottom:1em;margin-top:1em;padding:1em 0}.is-medium .wc-block-checkout__add-note:after,.is-mobile .wc-block-checkout__add-note:after,.is-small .wc-block-checkout__add-note:after{border-style:solid;border-width:1px 0;bottom:0;content:"";display:block;left:0;opacity:.3;pointer-events:none;position:absolute;right:0;top:0}.wc-block-checkout__add-note .wc-block-components-textarea{margin-top:16px}.wc-block-checkout__order-notes.wc-block-components-checkout-step{padding-left:0}.wp-block-woocommerce-checkout{margin:0}.wp-block-woocommerce-checkout .with-scroll-to-top__scroll-point{top:-96px}.wp-block-woocommerce-checkout.is-loading{display:flex;flex-wrap:wrap;margin:0 auto 16px;position:relative}.wp-block-woocommerce-checkout.is-loading .wp-block-woocommerce-checkout-totals-block{width:35%;padding-left:2.2641509434%}.wp-block-woocommerce-checkout.is-loading .wp-block-woocommerce-checkout-fields-block{width:65%;padding-right:3.7735849057%}.wp-block-woocommerce-checkout.is-loading .wp-block-woocommerce-checkout-fields-block,.wp-block-woocommerce-checkout.is-loading .wp-block-woocommerce-checkout-totals-block{box-sizing:border-box;margin:0}.wp-block-woocommerce-checkout.is-loading .wp-block-woocommerce-checkout-fields-block>div,.wp-block-woocommerce-checkout.is-loading .wp-block-woocommerce-checkout-totals-block>div{-webkit-animation:loading-fade 1.2s ease-in-out infinite;animation:loading-fade 1.2s ease-in-out infinite;background-color:var(--global--color-primary,#e0e0e0)!important;color:var(--global--color-primary,#e0e0e0)!important;outline:0!important;border:0!important;box-shadow:none;pointer-events:none;max-width:100%;margin:0 0 1.5em;display:none}.wp-block-woocommerce-checkout.is-loading .wp-block-woocommerce-checkout-fields-block>div>*,.wp-block-woocommerce-checkout.is-loading .wp-block-woocommerce-checkout-totals-block>div>*{visibility:hidden}@media screen and (prefers-reduced-motion:reduce){.wp-block-woocommerce-checkout.is-loading .wp-block-woocommerce-checkout-fields-block>div,.wp-block-woocommerce-checkout.is-loading .wp-block-woocommerce-checkout-totals-block>div{-webkit-animation:none;animation:none}}.wp-block-woocommerce-checkout.is-loading .wp-block-woocommerce-checkout-fields-block .wp-block-woocommerce-checkout-contact-information-block,.wp-block-woocommerce-checkout.is-loading .wp-block-woocommerce-checkout-fields-block .wp-block-woocommerce-checkout-payment-block,.wp-block-woocommerce-checkout.is-loading .wp-block-woocommerce-checkout-totals-block .wp-block-woocommerce-checkout-contact-information-block,.wp-block-woocommerce-checkout.is-loading .wp-block-woocommerce-checkout-totals-block .wp-block-woocommerce-checkout-payment-block{min-height:10em;display:block}.wp-block-woocommerce-checkout.is-loading .wp-block-woocommerce-checkout-fields-block .wp-block-woocommerce-checkout-shipping-address-block,.wp-block-woocommerce-checkout.is-loading .wp-block-woocommerce-checkout-totals-block .wp-block-woocommerce-checkout-shipping-address-block{min-height:24em;display:block}.wp-block-woocommerce-checkout.is-loading .wp-block-woocommerce-checkout-fields-block .wp-block-woocommerce-checkout-actions-block,.wp-block-woocommerce-checkout.is-loading .wp-block-woocommerce-checkout-totals-block .wp-block-woocommerce-checkout-actions-block{width:50%;min-height:4em;margin-left:50%;display:block}.wp-block-woocommerce-checkout.is-loading .wp-block-woocommerce-checkout-fields-block .wp-block-woocommerce-checkout-order-summary-block,.wp-block-woocommerce-checkout.is-loading .wp-block-woocommerce-checkout-totals-block .wp-block-woocommerce-checkout-order-summary-block{min-height:47em;display:block}.wp-block-woocommerce-checkout.is-loading .wp-block-woocommerce-checkout-fields-block .wc-block-components-panel>h2,.wp-block-woocommerce-checkout.is-loading .wp-block-woocommerce-checkout-totals-block .wc-block-components-panel>h2{font-size:1em;border:0;border-radius:0;margin:0;padding:0;vertical-align:baseline;color:inherit;font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;letter-spacing:inherit;line-height:inherit;text-decoration:inherit;text-transform:inherit}.wp-block-woocommerce-checkout.is-loading .wp-block-woocommerce-checkout-fields-block .wc-block-components-panel>h2 .wc-block-components-panel__button,.wp-block-woocommerce-checkout.is-loading .wp-block-woocommerce-checkout-totals-block .wc-block-components-panel>h2 .wc-block-components-panel__button{font-weight:400}.wp-block-woocommerce-checkout.is-loading .wp-block-woocommerce-checkout-fields-block .wc-block-components-panel,.wp-block-woocommerce-checkout.is-loading .wp-block-woocommerce-checkout-fields-block .wc-block-components-totals-item,.wp-block-woocommerce-checkout.is-loading .wp-block-woocommerce-checkout-totals-block .wc-block-components-panel,.wp-block-woocommerce-checkout.is-loading .wp-block-woocommerce-checkout-totals-block .wc-block-components-totals-item{padding-left:16px;padding-right:16px}@media only screen and (max-width:700px){.wp-block-woocommerce-checkout.is-loading{flex-direction:column;margin:0 auto 16px}.wp-block-woocommerce-checkout.is-loading .wp-block-woocommerce-checkout-fields-block,.wp-block-woocommerce-checkout.is-loading .wp-block-woocommerce-checkout-totals-block{padding:0;width:100%}.wp-block-woocommerce-checkout.is-loading .wp-block-woocommerce-checkout-totals-block .wc-block-components-panel,.wp-block-woocommerce-checkout.is-loading .wp-block-woocommerce-checkout-totals-block .wc-block-components-totals-item{padding-left:0;padding-right:0}}.theme-twentytwenty .wp-block-woocommerce-checkout.is-loading .wp-block-woocommerce-checkout-totals-block .wc-block-components-panel>h2{font-size:1.25em;border:0;border-radius:0;margin:0;padding:0;vertical-align:baseline}.modal-open .wc-block-mini-cart__button{pointer-events:none}.wc-block-mini-cart__drawer{font-size:1rem}.wc-block-components-express-payment{margin:auto;position:relative}.wc-block-components-express-payment .wc-block-components-express-payment__event-buttons{list-style:none;display:flex;flex-direction:row;flex-wrap:wrap;width:100%;padding:0;margin:0;overflow:hidden;text-align:center}.wc-block-components-express-payment .wc-block-components-express-payment__event-buttons>li{margin:0}.wc-block-components-express-payment .wc-block-components-express-payment__event-buttons>li>img{width:100%;height:48px}.wc-block-components-express-payment--checkout{margin-top:5px}.wc-block-components-express-payment--checkout .wc-block-components-express-payment__title-container{display:flex;flex-direction:row;left:0;position:absolute;right:0;top:-5px;vertical-align:middle}.wc-block-components-express-payment--checkout .wc-block-components-express-payment__title-container:before{border-left:1px solid;border-top:1px solid;border-radius:5px 0 0 0;content:"";display:block;height:4px;margin-right:12px;opacity:.3;pointer-events:none;width:10px}.wc-block-components-express-payment--checkout .wc-block-components-express-payment__title-container:after{border-right:1px solid;border-top:1px solid;border-radius:0 5px 0 0;content:"";display:block;height:4px;margin-left:12px;opacity:.3;pointer-events:none;flex-grow:1}.wc-block-components-express-payment--checkout .wc-block-components-express-payment__title{flex-grow:0;transform:translateY(-50%)}.wc-block-components-express-payment--checkout .wc-block-components-express-payment__content{position:relative;padding:1.5em 23px}.wc-block-components-express-payment--checkout .wc-block-components-express-payment__content:after{border-style:solid;border-width:0 1px 1px;bottom:0;content:"";display:block;left:0;opacity:.3;pointer-events:none;position:absolute;right:0;top:0;border-radius:0 0 5px 5px}.wc-block-components-express-payment--checkout .wc-block-components-express-payment__content>p{margin-bottom:1em}.wc-block-components-express-payment--checkout .wc-block-components-express-payment__event-buttons>li{display:inline-block;width:50%}.wc-block-components-express-payment--checkout .wc-block-components-express-payment__event-buttons>li:nth-child(2n){padding-left:8px}.wc-block-components-express-payment--checkout .wc-block-components-express-payment__event-buttons>li:nth-child(odd){padding-right:8px}.wc-block-components-express-payment--cart .wc-block-components-express-payment__event-buttons>li{padding-bottom:16px;text-align:center;width:100%}.wc-block-components-express-payment--cart .wc-block-components-express-payment__event-buttons>li:last-child{padding-bottom:0}.wc-block-components-express-payment-continue-rule{display:flex;align-items:center;text-align:center;padding:0 24px;margin:24px 0}.wc-block-components-express-payment-continue-rule:before{margin-right:10px}.wc-block-components-express-payment-continue-rule:after{margin-left:10px}.wc-block-components-express-payment-continue-rule:after,.wc-block-components-express-payment-continue-rule:before{content:" ";flex:1;border-bottom:1px solid;opacity:.3}.wc-block-components-express-payment-continue-rule--cart{margin:16px 0;text-transform:uppercase}.theme-twentynineteen .wc-block-components-express-payment__title:before{display:none}.theme-twentytwenty .wc-block-components-express-payment .wc-block-components-express-payment__title{padding-left:12px;padding-right:12px}.components-placeholder.wc-block-checkout__no-payment-methods-placeholder{margin-bottom:16px}.components-placeholder.wc-block-checkout__no-payment-methods-placeholder *{pointer-events:all}.components-placeholder.wc-block-checkout__no-payment-methods-placeholder .components-placeholder__fieldset{display:block}.components-placeholder.wc-block-checkout__no-payment-methods-placeholder .components-placeholder__fieldset .components-button{background-color:#1e1e1e;color:#fff}.components-placeholder.wc-block-checkout__no-payment-methods-placeholder .components-placeholder__fieldset .wc-block-checkout__no-payment-methods-placeholder-description{display:block;margin:.25em 0 1em}.components-notice.wc-block-checkout__no-payment-methods-notice{margin-bottom:16px}.wc-block-card-elements{display:flex;width:100%}.wc-block-card-elements .wc-block-components-validation-error{position:static}.wc-block-gateway-container{position:relative;margin-bottom:1.5em;white-space:nowrap}.wc-block-gateway-container.wc-card-number-element{flex-basis:15em;flex-grow:1;min-width:min(15em,60%)}.wc-block-gateway-container.wc-card-expiry-element{flex-basis:7em;margin-left:12px;min-width:min(7em,calc(24% - 12px))}.wc-block-gateway-container.wc-card-cvc-element{flex-basis:7em;margin-left:12px;min-width:min(5em,calc(16% - 12px))}.wc-block-gateway-container .wc-block-gateway-input{font-size:1em;line-height:1.375;background-color:#fff;padding:.75em 0 .75em 16px;border-radius:4px;border:1px solid #50575e;width:100%;font-family:inherit;margin:0;box-sizing:border-box;height:3em;color:#2b2d2f;cursor:text}.wc-block-gateway-container .wc-block-gateway-input:focus,.wc-block-gateway-container:focus{background-color:#fff}.wc-block-gateway-container label{color:inherit;font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;letter-spacing:inherit;line-height:inherit;text-decoration:inherit;text-transform:inherit;font-size:1em;line-height:1.375;position:absolute;transform:translateY(.75em);left:0;top:0;transform-origin:top left;color:#757575;transition:transform .2s ease;margin:0 0 0 17px;overflow:hidden;text-overflow:ellipsis;max-width:calc(100% - 24px);cursor:text}@media screen and (prefers-reduced-motion:reduce){.wc-block-gateway-container label{transition:none}}.wc-block-gateway-container.wc-inline-card-element label{margin-left:calc(24px + 1.5em)}.wc-block-gateway-container.wc-inline-card-element .wc-block-gateway-input.focused.empty+label,.wc-block-gateway-container.wc-inline-card-element .wc-block-gateway-input:not(.empty)+label{margin-left:16px;transform:translateY(4px) scale(.75)}.wc-block-gateway-container.wc-inline-card-element+.wc-block-components-validation-error{position:static;margin-top:-24px}.wc-block-gateway-container .wc-block-gateway-input.focused.empty,.wc-block-gateway-container .wc-block-gateway-input:not(.empty){padding:1.5em 0 .25em 16px}.wc-block-gateway-container .wc-block-gateway-input.focused.empty+label,.wc-block-gateway-container .wc-block-gateway-input:not(.empty)+label{transform:translateY(4px) scale(.75)}.wc-block-gateway-container .wc-block-gateway-input.has-error{border-color:#cc1818}.wc-block-gateway-container .wc-block-gateway-input.has-error:focus{outline-color:#cc1818}.wc-block-gateway-container .wc-block-gateway-input.has-error+label{color:#cc1818}.is-large .wc-card-cvc-element .wc-block-components-validation-error>p,.is-large .wc-card-expiry-element .wc-block-components-validation-error>p,.is-medium .wc-card-cvc-element .wc-block-components-validation-error>p,.is-medium .wc-card-expiry-element .wc-block-components-validation-error>p{line-height:16px;padding-top:4px}.is-mobile .wc-card-cvc-element .wc-block-components-validation-error>p,.is-mobile .wc-card-expiry-element .wc-block-components-validation-error>p,.is-small .wc-card-cvc-element .wc-block-components-validation-error>p,.is-small .wc-card-expiry-element .wc-block-components-validation-error>p{min-height:28px}.wc-block-components-checkout-payment-methods *{pointer-events:all}.is-mobile .wc-block-card-elements,.is-small .wc-block-card-elements{flex-wrap:wrap}.is-mobile .wc-block-gateway-container.wc-card-number-element,.is-small .wc-block-gateway-container.wc-card-number-element{flex-basis:100%}.is-mobile .wc-block-gateway-container.wc-card-expiry-element,.is-small .wc-block-gateway-container.wc-card-expiry-element{flex-basis:calc(50% - 8px);margin-left:0;margin-right:8px}.is-mobile .wc-block-gateway-container.wc-card-cvc-element,.is-small .wc-block-gateway-container.wc-card-cvc-element{flex-basis:calc(50% - 8px);margin-left:8px}.wc-block-checkout__payment-method .wc-block-components-radio-control__option{padding-left:56px}.wc-block-checkout__payment-method .wc-block-components-radio-control__option:after{content:none}.wc-block-checkout__payment-method .wc-block-components-radio-control__option .wc-block-components-radio-control__input{left:16px}.wc-block-checkout__payment-method .wc-block-components-radio-control__option,.wc-block-checkout__payment-method .wc-block-components-radio-control__option:first-child,.wc-block-checkout__payment-method .wc-block-components-radio-control__option:last-child{margin:0;padding-bottom:1em;padding-top:1em}.wc-block-checkout__payment-method .wc-block-components-radio-control__option-checked{font-weight:700}.wc-block-checkout__payment-method .wc-block-components-radio-control-accordion-option,.wc-block-checkout__payment-method .wc-block-components-radio-control__option{position:relative}.wc-block-checkout__payment-method .wc-block-components-radio-control-accordion-option:after,.wc-block-checkout__payment-method .wc-block-components-radio-control__option:after{border-style:solid;border-width:1px 1px 0;bottom:0;content:"";display:block;left:0;opacity:.3;pointer-events:none;position:absolute;right:0;top:0}.wc-block-checkout__payment-method .wc-block-components-radio-control-accordion-option:last-child:after,.wc-block-checkout__payment-method .wc-block-components-radio-control__option:last-child:after{border-width:1px}.wc-block-checkout__payment-method .wc-block-components-radio-control-accordion-option .wc-block-components-radio-control__option:after{border-width:0}.wc-block-checkout__payment-method .wc-block-components-radio-control-accordion-option .wc-block-components-radio-control__label{display:flex;align-items:center;justify-content:flex-start}.wc-block-checkout__payment-method .wc-block-components-radio-control-accordion-option .wc-block-components-radio-control__label img{height:24px;max-height:24px;-o-object-fit:contain;object-fit:contain;-o-object-position:left;object-position:left}.wc-block-checkout__payment-method .wc-block-components-radio-control.disable-radio-control .wc-block-components-radio-control__option{padding-left:16px}.wc-block-checkout__payment-method .wc-block-components-radio-control.disable-radio-control .wc-block-components-radio-control__input{display:none}.wc-block-checkout__payment-method .wc-block-components-checkout-step__description-payments-aligned{padding-top:14px;height:28px}.wc-block-components-radio-control-accordion-content{padding:0 16px 1em}.wc-block-components-radio-control-accordion-content:empty{display:none}.wc-block-checkout__order-notes .wc-block-components-checkout-step__content{padding-bottom:0}.wc-block-components-panel.has-border{position:relative}.wc-block-components-panel.has-border:after{border-style:solid;border-width:1px 0;bottom:0;content:"";display:block;left:0;opacity:.3;pointer-events:none;position:absolute;right:0;top:0}.wc-block-components-panel.has-border+.wc-block-components-panel.has-border:after{border-top-width:0}.wc-block-components-panel.has-border.no-top-border{position:relative}.wc-block-components-panel.has-border.no-top-border:after{border-style:solid;bottom:0;content:"";display:block;left:0;opacity:.3;pointer-events:none;position:absolute;right:0;top:0;border-width:0 0 1px}.wc-block-components-panel__button{border:0;border-radius:0;vertical-align:baseline;height:auto;line-height:1;margin:.375em 0 0;padding:.375em 32px 0 0;position:relative;text-align:left;width:100%;word-break:break-word}.wc-block-components-panel__button[aria-expanded=true]{padding-bottom:.375em;margin-bottom:.375em}.wc-block-components-panel__button,.wc-block-components-panel__button:active,.wc-block-components-panel__button:focus,.wc-block-components-panel__button:hover{color:inherit;font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;letter-spacing:inherit;line-height:inherit;text-decoration:inherit;text-transform:inherit;background:transparent;box-shadow:none}.wc-block-components-panel__button>.wc-block-components-panel__button-icon{fill:currentColor;position:absolute;right:0;top:50%;transform:translateY(-50%);width:auto}.wc-block-components-panel__content{padding-bottom:1em}.wc-block-components-panel__content[hidden]{display:none}.theme-twentytwentyone.theme-twentytwentyone.theme-twentytwentyone .wc-block-components-panel__button{background-color:inherit;color:inherit}.theme-twentyseventeen .wc-block-components-panel__button,.theme-twentytwenty .wc-block-components-panel__button{background:none transparent;color:inherit}.theme-twentyseventeen .wc-block-components-panel__button.wc-block-components-panel__button:focus,.theme-twentyseventeen .wc-block-components-panel__button.wc-block-components-panel__button:hover,.theme-twentytwenty .wc-block-components-panel__button.wc-block-components-panel__button:focus,.theme-twentytwenty .wc-block-components-panel__button.wc-block-components-panel__button:hover{background:none transparent}.wc-block-components-totals-item{display:flex;flex-wrap:wrap;margin:.75em 0 0;width:100%}.wc-block-components-totals-item:first-child{margin-top:0}.wc-block-components-totals-item__label{flex-grow:1}.wc-block-components-totals-item__value{font-weight:700;white-space:nowrap}.wc-block-components-totals-item__description{font-size:.875em;width:100%}.wc-block-components-totals-item.wc-block-components-totals-taxes__grouped-rate{margin:4px 0}.wc-block-components-totals-item.wc-block-components-totals-taxes__grouped-rate:first-child{margin-top:0}.wc-block-components-totals-item.wc-block-components-totals-taxes__grouped-rate:last-child{margin-bottom:0}.wc-block-components-totals-wrapper{position:relative;padding:16px 0}.wc-block-components-totals-wrapper:after{border-style:solid;border-width:1px 0 0;bottom:0;content:"";display:block;left:0;opacity:.3;pointer-events:none;position:absolute;right:0;top:0}.wc-block-components-totals-wrapper.has-bottom-border:after{border-bottom-width:1px}.wc-block-components-totals-wrapper.slot-wrapper{padding:0}.wc-block-components-totals-wrapper.slot-wrapper>*>*{position:relative;padding:16px 0}.wc-block-components-totals-wrapper.slot-wrapper>*>:after{border-style:solid;border-width:0 0 1px;bottom:0;content:"";display:block;left:0;opacity:.3;pointer-events:none;position:absolute;right:0;top:0}.wc-block-components-totals-wrapper.slot-wrapper>*>:last-child:after{border-bottom-width:0}.wc-block-components-discounts-meta .wc-block-components-totals-wrapper:first-child{position:relative}.wc-block-components-discounts-meta .wc-block-components-totals-wrapper:first-child:after{border-style:solid;border-width:1px 0 0;bottom:0;content:"";display:block;left:0;opacity:.3;pointer-events:none;position:absolute;right:0;top:0}.wc-block-product-categories{margin-bottom:1em}.wc-block-product-categories.is-dropdown{display:flex}.wc-block-product-categories select{margin-right:.5em}.wc-block-product-categories-list--has-images{list-style:none outside}.wc-block-product-categories-list--has-images .wc-block-product-categories-list-item{margin:4px 0 4px 60px;list-style:none outside;clear:both}.wc-block-product-categories-list--has-images .wc-block-product-categories-list-item ul{margin:4px 0 0}.wc-block-product-categories-list--has-images .wc-block-product-categories-list-item__image{max-width:50px;display:inline-block;padding:0;margin:0 .5em 0 -60px;position:relative;vertical-align:middle;border:1px solid #eee}.wc-block-product-categories-list--has-images .wc-block-product-categories-list-item__image img{display:block;height:auto;margin:0;max-width:100%;padding:0}.wc-block-product-categories-list-item-count:before{content:" ("}.wc-block-product-categories-list-item-count:after{content:")"}.wp-block-woocommerce-product-categories.is-loading .wc-block-product-categories__placeholder{display:inline-block;height:1em;width:50%;min-width:200px;background:currentColor;opacity:.2}.wc-block-product-categories__button{display:flex;align-items:center;margin:0;padding:0 .5em;position:relative;overflow:hidden}.wc-block-product-categories__button svg{fill:currentColor;outline:none}.rtl .wc-block-product-categories__button svg{transform:rotate(180deg)}.wc-block-product-categories__button:active{color:currentColor}.wc-block-product-categories__button:disabled,.wc-block-product-categories__button[aria-disabled=true]{cursor:default;opacity:.3}.wc-block-product-categories__button:disabled:focus,.wc-block-product-categories__button[aria-disabled=true]:focus{box-shadow:none}.wc-block-featured-product{position:relative;background-color:#1e1e1e;background-size:cover;background-position:50%;width:100%;margin:0 0 1.5em}.wc-block-featured-product,.wc-block-featured-product .wc-block-featured-product__wrapper{display:flex;justify-content:center;align-items:center;flex-wrap:wrap;align-content:center}.wc-block-featured-product .wc-block-featured-product__wrapper{overflow:hidden;height:100%}.wc-block-featured-product.has-left-content{justify-content:flex-start}.wc-block-featured-product.has-left-content .wc-block-featured-product__description,.wc-block-featured-product.has-left-content .wc-block-featured-product__price,.wc-block-featured-product.has-left-content .wc-block-featured-product__title,.wc-block-featured-product.has-left-content .wc-block-featured-product__variation{margin-left:0;text-align:left}.wc-block-featured-product.has-right-content{justify-content:flex-end}.wc-block-featured-product.has-right-content .wc-block-featured-product__description,.wc-block-featured-product.has-right-content .wc-block-featured-product__price,.wc-block-featured-product.has-right-content .wc-block-featured-product__title,.wc-block-featured-product.has-right-content .wc-block-featured-product__variation{margin-right:0;text-align:right}.wc-block-featured-product .wc-block-featured-product__description,.wc-block-featured-product .wc-block-featured-product__price,.wc-block-featured-product .wc-block-featured-product__title,.wc-block-featured-product .wc-block-featured-product__variation{color:#fff;line-height:1.25;margin-bottom:0;text-align:center}.wc-block-featured-product .wc-block-featured-product__description a,.wc-block-featured-product .wc-block-featured-product__description a:active,.wc-block-featured-product .wc-block-featured-product__description a:focus,.wc-block-featured-product .wc-block-featured-product__description a:hover,.wc-block-featured-product .wc-block-featured-product__price a,.wc-block-featured-product .wc-block-featured-product__price a:active,.wc-block-featured-product .wc-block-featured-product__price a:focus,.wc-block-featured-product .wc-block-featured-product__price a:hover,.wc-block-featured-product .wc-block-featured-product__title a,.wc-block-featured-product .wc-block-featured-product__title a:active,.wc-block-featured-product .wc-block-featured-product__title a:focus,.wc-block-featured-product .wc-block-featured-product__title a:hover,.wc-block-featured-product .wc-block-featured-product__variation a,.wc-block-featured-product .wc-block-featured-product__variation a:active,.wc-block-featured-product .wc-block-featured-product__variation a:focus,.wc-block-featured-product .wc-block-featured-product__variation a:hover{color:#fff}.wc-block-featured-product .wc-block-featured-product__description,.wc-block-featured-product .wc-block-featured-product__link,.wc-block-featured-product .wc-block-featured-product__price,.wc-block-featured-product .wc-block-featured-product__title,.wc-block-featured-product .wc-block-featured-product__variation{width:100%;padding:16px 48px 0;z-index:1}.wc-block-featured-product .wc-block-featured-product__title,.wc-block-featured-product .wc-block-featured-product__variation{margin-top:0;border:0}.wc-block-featured-product .wc-block-featured-product__title:before,.wc-block-featured-product .wc-block-featured-product__variation:before{display:none}.wc-block-featured-product .wc-block-featured-product__variation{font-style:italic;padding-top:0}.wc-block-featured-product .wc-block-featured-product__description p{margin:0;line-height:1.5em}.wc-block-featured-product .wp-block-button.aligncenter{text-align:center}.wc-block-featured-product.has-background-dim:before{content:"";position:absolute;top:0;left:0;bottom:0;right:0;background-color:inherit;opacity:.5;z-index:1}.wc-block-featured-product.has-background-dim.has-background-dim-10:before{opacity:.1}.wc-block-featured-product.has-background-dim.has-background-dim-20:before{opacity:.2}.wc-block-featured-product.has-background-dim.has-background-dim-30:before{opacity:.3}.wc-block-featured-product.has-background-dim.has-background-dim-40:before{opacity:.4}.wc-block-featured-product.has-background-dim.has-background-dim-50:before{opacity:.5}.wc-block-featured-product.has-background-dim.has-background-dim-60:before{opacity:.6}.wc-block-featured-product.has-background-dim.has-background-dim-70:before{opacity:.7}.wc-block-featured-product.has-background-dim.has-background-dim-80:before{opacity:.8}.wc-block-featured-product.has-background-dim.has-background-dim-90:before{opacity:.9}.wc-block-featured-product.has-background-dim.has-background-dim-100:before{opacity:1}.wc-block-featured-product.alignleft,.wc-block-featured-product.alignright{max-width:290px;width:100%}.wc-block-featured-product:after{display:block;content:"";font-size:0;min-height:inherit}@supports((position:-webkit-sticky) or (position:sticky)){.wc-block-featured-product:after{content:none}}.wc-block-featured-product.aligncenter,.wc-block-featured-product.alignleft,.wc-block-featured-product.alignright,.wc-block-product-search .wc-block-product-search__fields{display:flex}.wc-block-product-search .wc-block-product-search__field{padding:6px 8px;line-height:1.8;flex-grow:1}.wc-block-product-search .wc-block-product-search__button{display:flex;align-items:center;margin:0 0 0 6px;cursor:pointer;padding:0 .5em;position:relative;overflow:hidden}.wc-block-product-search .wc-block-product-search__button svg{fill:currentColor;outline:none}.rtl .wc-block-product-search .wc-block-product-search__button svg{transform:rotate(180deg)}.wc-block-product-search .wc-block-product-search__button:active{color:currentColor}.wc-block-product-search .wc-block-product-search__button:disabled,.wc-block-product-search .wc-block-product-search__button[aria-disabled=true]{cursor:default;opacity:.3}.wc-block-product-search .wc-block-product-search__button:disabled:focus,.wc-block-product-search .wc-block-product-search__button[aria-disabled=true]:focus{box-shadow:none}.wc-block-featured-category{position:relative;background-color:#1e1e1e;background-size:cover;background-position:50%;width:100%;margin:0 0 1.5em;display:flex;justify-content:center;align-items:center;flex-wrap:wrap;align-content:center}.wc-block-featured-category .wc-block-featured-category__wrapper{overflow:hidden;height:100%;display:flex;justify-content:center;align-items:center;flex-wrap:wrap;align-content:center}.wc-block-featured-category.has-left-content{justify-content:flex-start}.wc-block-featured-category.has-left-content .wc-block-featured-category__description,.wc-block-featured-category.has-left-content .wc-block-featured-category__price,.wc-block-featured-category.has-left-content .wc-block-featured-category__title{margin-left:0;text-align:left}.wc-block-featured-category.has-right-content{justify-content:flex-end}.wc-block-featured-category.has-right-content .wc-block-featured-category__description,.wc-block-featured-category.has-right-content .wc-block-featured-category__price,.wc-block-featured-category.has-right-content .wc-block-featured-category__title{margin-right:0;text-align:right}.wc-block-featured-category .wc-block-featured-category__description,.wc-block-featured-category .wc-block-featured-category__price,.wc-block-featured-category .wc-block-featured-category__title{color:#fff;line-height:1.25;margin-bottom:0;text-align:center}.wc-block-featured-category .wc-block-featured-category__description a,.wc-block-featured-category .wc-block-featured-category__description a:active,.wc-block-featured-category .wc-block-featured-category__description a:focus,.wc-block-featured-category .wc-block-featured-category__description a:hover,.wc-block-featured-category .wc-block-featured-category__price a,.wc-block-featured-category .wc-block-featured-category__price a:active,.wc-block-featured-category .wc-block-featured-category__price a:focus,.wc-block-featured-category .wc-block-featured-category__price a:hover,.wc-block-featured-category .wc-block-featured-category__title a,.wc-block-featured-category .wc-block-featured-category__title a:active,.wc-block-featured-category .wc-block-featured-category__title a:focus,.wc-block-featured-category .wc-block-featured-category__title a:hover{color:#fff}.wc-block-featured-category .wc-block-featured-category__description,.wc-block-featured-category .wc-block-featured-category__link,.wc-block-featured-category .wc-block-featured-category__price,.wc-block-featured-category .wc-block-featured-category__title{width:100%;padding:0 48px 16px;z-index:1}.wc-block-featured-category .wc-block-featured-category__title{margin-top:0}.wc-block-featured-category .wc-block-featured-category__title:before{display:none}.wc-block-featured-category .wc-block-featured-category__description p{margin:0}.wc-block-featured-category .wp-block-button.aligncenter{text-align:center}.wc-block-featured-category.has-background-dim:before{content:"";position:absolute;top:0;left:0;bottom:0;right:0;background-color:inherit;opacity:.5;z-index:1}.wc-block-featured-category.has-background-dim.has-background-dim-10:before{opacity:.1}.wc-block-featured-category.has-background-dim.has-background-dim-20:before{opacity:.2}.wc-block-featured-category.has-background-dim.has-background-dim-30:before{opacity:.3}.wc-block-featured-category.has-background-dim.has-background-dim-40:before{opacity:.4}.wc-block-featured-category.has-background-dim.has-background-dim-50:before{opacity:.5}.wc-block-featured-category.has-background-dim.has-background-dim-60:before{opacity:.6}.wc-block-featured-category.has-background-dim.has-background-dim-70:before{opacity:.7}.wc-block-featured-category.has-background-dim.has-background-dim-80:before{opacity:.8}.wc-block-featured-category.has-background-dim.has-background-dim-90:before{opacity:.9}.wc-block-featured-category.has-background-dim.has-background-dim-100:before{opacity:1}.wc-block-featured-category.alignleft,.wc-block-featured-category.alignright{max-width:290px;width:100%}.wc-block-featured-category:after{display:block;content:"";font-size:0;min-height:inherit}@supports((position:-webkit-sticky) or (position:sticky)){.wc-block-featured-category:after{content:none}}.wc-block-featured-category.aligncenter,.wc-block-featured-category.alignleft,.wc-block-featured-category.alignright{display:flex}.wc-block-attribute-filter{margin-bottom:24px}.wc-block-attribute-filter.style-dropdown{display:flex;gap:16px}.wc-block-attribute-filter .wc-block-attribute-filter-list{margin:0;width:100%}.wc-block-attribute-filter .wc-block-attribute-filter-list li{text-decoration:underline}.wc-block-attribute-filter .wc-block-attribute-filter-list li label{cursor:pointer}.wc-block-attribute-filter .wc-block-attribute-filter-list li input{cursor:pointer;display:inline-block}.wc-block-attribute-filter .wc-block-attribute-filter-dropdown{flex-grow:1;max-width:unset;width:0}.wc-block-attribute-filter .is-single .wc-block-attribute-filter-list-count,.wc-block-attribute-filter .wc-block-dropdown-selector .wc-block-dropdown-selector__list .wc-block-attribute-filter-list-count{opacity:.6}.wc-block-attribute-filter .wc-block-components-dropdown-selector__input-wrapper{height:100%}.wc-block-stock-filter{margin-bottom:24px}.wc-block-stock-filter .wc-block-stock-filter-list{margin:0}.wc-block-stock-filter .wc-block-stock-filter-list li{text-decoration:underline}.wc-block-stock-filter .wc-block-stock-filter-list li label{cursor:pointer}.wc-block-stock-filter .wc-block-stock-filter-list li input{cursor:pointer;display:inline-block}.wc-block-stock-filter .is-single,.wc-block-stock-filter .wc-block-dropdown-selector .wc-block-dropdown-selector__list{opacity:.6}.wc-block-stock-filter .wc-block-stock-filter__button{margin-top:8px}@-webkit-keyframes loading-fade{0%{opacity:.7}50%{opacity:1}to{opacity:.7}}@keyframes loading-fade{0%{opacity:.7}50%{opacity:1}to{opacity:.7}}.wc-block-active-filters{margin-bottom:24px;overflow:hidden}.wc-block-active-filters .wc-block-active-filters__clear-all{font-size:1em;float:right;border:none;padding:0;text-decoration:underline;cursor:pointer}.wc-block-active-filters .wc-block-active-filters__clear-all,.wc-block-active-filters .wc-block-active-filters__clear-all:active,.wc-block-active-filters .wc-block-active-filters__clear-all:focus,.wc-block-active-filters .wc-block-active-filters__clear-all:hover{background:transparent;color:inherit}.wc-block-active-filters .wc-block-active-filters__list{margin:0 0 4px;padding:0;list-style:none outside;clear:both}.wc-block-active-filters .wc-block-active-filters__list li{margin:0;padding:0;list-style:none outside;clear:both}.wc-block-active-filters .wc-block-active-filters__list li ul{margin:0;padding:0;list-style:none outside}.wc-block-active-filters .wc-block-active-filters__list li:first-child .wc-block-active-filters__list-item-type{margin:0}.wc-block-active-filters .wc-block-active-filters__list-item-type{font-size:.75em;text-transform:uppercase;letter-spacing:.1em;margin:16px 0 0;display:block}.wc-block-active-filters .wc-block-active-filters__list-item-operator{font-weight:400;font-style:italic}.wc-block-active-filters .wc-block-active-filters__list-item-name{font-weight:700;display:block;position:relative;padding:0 16px 0 0}.wc-block-active-filters .wc-block-active-filters__list-item-remove{background:transparent;border:0;-webkit-appearance:none;-moz-appearance:none;appearance:none;height:16px;width:16px;padding:0;position:absolute;right:0;top:50%;margin:-8px 0 0;color:currentColor}.wc-block-active-filters .wc-block-active-filters__list--chips li,.wc-block-active-filters .wc-block-active-filters__list--chips ul{display:inline}.wc-block-active-filters .wc-block-active-filters__list--chips .wc-block-active-filters__list-item-type{display:none}.wc-block-active-filters .wc-block-active-filters__list--chips .wc-block-components-chip{font-size:.875em;margin-top:.1875em;margin-bottom:.1875em}woocommerce-blocks/build/reviews-by-product.js000064400000145214151335517640015566 0ustar00this.wc=this.wc||{},this.wc.blocks=this.wc.blocks||{},this.wc.blocks["reviews-by-product"]=function(e){function t(t){for(var n,i,a=t[0],s=t[1],u=t[2],d=0,p=[];d<a.length;d++)i=a[d],Object.prototype.hasOwnProperty.call(o,i)&&o[i]&&p.push(o[i][0]),o[i]=0;for(n in s)Object.prototype.hasOwnProperty.call(s,n)&&(e[n]=s[n]);for(l&&l(t);p.length;)p.shift()();return c.push.apply(c,u||[]),r()}function r(){for(var e,t=0;t<c.length;t++){for(var r=c[t],n=!0,a=1;a<r.length;a++){var s=r[a];0!==o[s]&&(n=!1)}n&&(c.splice(t--,1),e=i(i.s=r[0]))}return e}var n={},o={38:0},c=[];function i(t){if(n[t])return n[t].exports;var r=n[t]={i:t,l:!1,exports:{}};return e[t].call(r.exports,r,r.exports,i),r.l=!0,r.exports}i.m=e,i.c=n,i.d=function(e,t,r){i.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},i.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.t=function(e,t){if(1&t&&(e=i(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(i.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)i.d(r,n,function(t){return e[t]}.bind(null,n));return r},i.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(t,"a",t),t},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.p="";var a=window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[],s=a.push.bind(a);a.push=t,a=a.slice();for(var u=0;u<a.length;u++)t(a[u]);var l=s;return c.push([775,0]),r()}({0:function(e,t){e.exports=window.wp.element},1:function(e,t){e.exports=window.wp.i18n},106:function(e,t,r){"use strict";var n=r(0),o=r(1),c=(r(2),r(66)),i=r(150),a=r(6),s=r.n(a),u=r(4),l=r(52);r(153),t.a=function(e){var t=e.className,r=e.error,a=e.isLoading,d=e.onRetry;return Object(n.createElement)(u.Placeholder,{icon:Object(n.createElement)(c.a,{srcElement:i.a}),label:Object(o.__)("Sorry, an error occurred",'woocommerce'),className:s()("wc-block-api-error",t)},Object(n.createElement)(l.a,{error:r}),d&&Object(n.createElement)(n.Fragment,null,a?Object(n.createElement)(u.Spinner,null):Object(n.createElement)(u.Button,{isSecondary:!0,onClick:d},Object(o.__)("Retry",'woocommerce'))))}},11:function(e,t){e.exports=window.React},12:function(e,t){e.exports=window.wp.blockEditor},121:function(e,t){},122:function(e,t){e.exports=window.wp.coreData},123:function(e,t){},131:function(e,t,r){"use strict";var n=r(9),o=r.n(n),c=r(16),i=r.n(c),a=r(0),s=r(49),u=r(4),l=r(6),d=r.n(l),p=["className","item","isSelected","isLoading","onSelect","disabled"];t.a=function(e){var t=e.className,r=e.item,n=e.isSelected,c=e.isLoading,l=e.onSelect,b=e.disabled,w=i()(e,p);return Object(a.createElement)(a.Fragment,null,Object(a.createElement)(s.c,o()({},w,{key:r.id,className:t,isSelected:n,item:r,onSelect:l,isSingle:!0,disabled:b})),n&&c&&Object(a.createElement)("div",{key:"loading",className:d()("woocommerce-search-list__item","woocommerce-product-attributes__item","depth-1","is-loading","is-not-active")},Object(a.createElement)(u.Spinner,null)))}},14:function(e,t){e.exports=window.wp.data},144:function(e,t,r){"use strict";r.d(t,"a",(function(){return u})),r.d(t,"b",(function(){return l})),r.d(t,"c",(function(){return d}));var n=r(0),o=r(1),c=r(4),i=r(12),a=r(3),s=r(88),u=function(e,t){return Object(n.createElement)(i.BlockControls,null,Object(n.createElement)(c.ToolbarGroup,{controls:[{icon:"edit",title:Object(o.__)("Edit",'woocommerce'),onClick:function(){return t({editMode:!e})},isActive:e}]}))},l=function(e,t){var r=Object(a.getSetting)("showAvatars",!0),i=Object(a.getSetting)("reviewRatingsEnabled",!0);return Object(n.createElement)(n.Fragment,null,Object(n.createElement)(c.ToggleControl,{label:Object(o.__)("Product rating",'woocommerce'),checked:e.showReviewRating,onChange:function(){return t({showReviewRating:!e.showReviewRating})}}),e.showReviewRating&&!i&&Object(n.createElement)(c.Notice,{className:"wc-block-base-control-notice",isDismissible:!1},Object(n.createInterpolateElement)(Object(o.__)("Product rating is disabled in your <a>store settings</a>.",'woocommerce'),{a:Object(n.createElement)("a",{href:Object(a.getAdminLink)("admin.php?page=wc-settings&tab=products"),target:"_blank",rel:"noopener noreferrer"})})),Object(n.createElement)(c.ToggleControl,{label:Object(o.__)("Reviewer name",'woocommerce'),checked:e.showReviewerName,onChange:function(){return t({showReviewerName:!e.showReviewerName})}}),Object(n.createElement)(c.ToggleControl,{label:Object(o.__)("Image",'woocommerce'),checked:e.showReviewImage,onChange:function(){return t({showReviewImage:!e.showReviewImage})}}),Object(n.createElement)(c.ToggleControl,{label:Object(o.__)("Review date",'woocommerce'),checked:e.showReviewDate,onChange:function(){return t({showReviewDate:!e.showReviewDate})}}),Object(n.createElement)(c.ToggleControl,{label:Object(o.__)("Review content",'woocommerce'),checked:e.showReviewContent,onChange:function(){return t({showReviewContent:!e.showReviewContent})}}),e.showReviewImage&&Object(n.createElement)(n.Fragment,null,Object(n.createElement)(s.a,{label:Object(o.__)("Review image",'woocommerce'),value:e.imageType,options:[{label:Object(o.__)("Reviewer photo",'woocommerce'),value:"reviewer"},{label:Object(o.__)("Product",'woocommerce'),value:"product"}],onChange:function(e){return t({imageType:e})}}),"reviewer"===e.imageType&&!r&&Object(n.createElement)(c.Notice,{className:"wc-block-base-control-notice",isDismissible:!1},Object(n.createInterpolateElement)(Object(o.__)("Reviewer photo is disabled in your <a>site settings</a>.",'woocommerce'),{a:Object(n.createElement)("a",{href:Object(a.getAdminLink)("options-discussion.php"),target:"_blank",rel:"noopener noreferrer"})}))))},d=function(e,t){return Object(n.createElement)(n.Fragment,null,Object(n.createElement)(c.ToggleControl,{label:Object(o.__)("Order by",'woocommerce'),checked:e.showOrderby,onChange:function(){return t({showOrderby:!e.showOrderby})}}),Object(n.createElement)(c.SelectControl,{label:Object(o.__)("Order Product Reviews by",'woocommerce'),value:e.orderby,options:[{label:"Most recent",value:"most-recent"},{label:"Highest Rating",value:"highest-rating"},{label:"Lowest Rating",value:"lowest-rating"}],onChange:function(e){return t({orderby:e})}}),Object(n.createElement)(c.RangeControl,{label:Object(o.__)("Starting Number of Reviews",'woocommerce'),value:e.reviewsOnPageLoad,onChange:function(e){return t({reviewsOnPageLoad:e})},max:20,min:1}),Object(n.createElement)(c.ToggleControl,{label:Object(o.__)("Load more",'woocommerce'),checked:e.showLoadMore,onChange:function(){return t({showLoadMore:!e.showLoadMore})}}),e.showLoadMore&&Object(n.createElement)(c.RangeControl,{label:Object(o.__)("Load More Reviews",'woocommerce'),value:e.reviewsOnLoadMore,onChange:function(e){return t({reviewsOnLoadMore:e})},max:20,min:1}))}},149:function(e,t,r){"use strict";var n=r(33),o=r.n(n),c=r(5),i=r.n(c),a=r(9),s=r.n(a),u=r(0),l=r(1),d=r(7),p=(r(2),r(49)),b=r(21),w=r(17),f=r.n(w),v=r(18),m=r.n(v),g=r(19),h=r.n(g),O=r(20),y=r.n(O),j=r(10),_=r.n(j);var k=Object(b.createHigherOrderComponent)((function(e){var t=function(t){h()(c,t);var r,n,o=(r=c,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=_()(r);if(n){var o=_()(this).constructor;e=Reflect.construct(t,arguments,o)}else e=t.apply(this,arguments);return y()(this,e)});function c(){return f()(this,c),o.apply(this,arguments)}return m()(c,[{key:"render",value:function(){var t=this.props.selected,r=null==t;return Object(u.createElement)(e,s()({},this.props,{selected:r?[]:[t]}))}}]),c}(u.Component);return t.defaultProps={selected:null},t}),"withTransformSingleSelectToMultipleSelect"),E=r(302),R=r(29),P=r.n(R),S=r(13),C=r.n(S),x=r(22),L=r.n(x),N=r(34),I=r.n(N),T=r(39),D=r(42);function A(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function M(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?A(Object(r),!0).forEach((function(t){i()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):A(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var B=Object(b.createHigherOrderComponent)((function(e){var t=function(t){h()(c,t);var r,n,o=(r=c,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=_()(r);if(n){var o=_()(this).constructor;e=Reflect.construct(t,arguments,o)}else e=t.apply(this,arguments);return y()(this,e)});function c(){var e;f()(this,c);for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return e=o.call.apply(o,[this].concat(r)),i()(C()(e),"state",{error:null,loading:!1,variations:{}}),i()(C()(e),"loadVariations",(function(){var t=e.props.products,r=e.state,n=r.loading,o=r.variations;if(!n){var c=e.getExpandedProduct();if(c&&!o[c]){var a=t.find((function(e){return e.id===c}));a.variations&&0!==a.variations.length?(e.setState({loading:!0}),Object(T.g)(c).then((function(t){var r=t.map((function(e){return M(M({},e),{},{parent:c})}));e.setState({variations:M(M({},e.state.variations),{},i()({},c,r)),loading:!1,error:null})})).catch(function(){var t=P()(L.a.mark((function t(r){var n;return L.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,Object(D.a)(r);case 2:n=t.sent,e.setState({variations:M(M({},e.state.variations),{},i()({},c,null)),loading:!1,error:n});case 4:case"end":return t.stop()}}),t)})));return function(_x){return t.apply(this,arguments)}}())):e.setState({variations:M(M({},e.state.variations),{},i()({},c,null)),loading:!1,error:null})}}})),e}return m()(c,[{key:"componentDidMount",value:function(){var e=this.props,t=e.selected,r=e.showVariations;t&&r&&this.loadVariations()}},{key:"componentDidUpdate",value:function(e){var t=this.props,r=t.isLoading,n=t.selected;t.showVariations&&(!I()(e.selected,n)||e.isLoading&&!r)&&this.loadVariations()}},{key:"isProductId",value:function(e){return this.props.products.some((function(t){return t.id===e}))}},{key:"findParentProduct",value:function(e){return this.props.products.filter((function(t){return t.variations&&t.variations.find((function(t){return t.id===e}))}))[0].id}},{key:"getExpandedProduct",value:function(){var e=this.props,t=e.isLoading,r=e.selected;if(!e.showVariations)return null;var n=r&&r.length?r[0]:null;return n?this.prevSelectedItem=n:this.prevSelectedItem&&(t||this.isProductId(this.prevSelectedItem)||(n=this.prevSelectedItem)),!t&&n?this.isProductId(n)?n:this.findParentProduct(n):null}},{key:"render",value:function(){var t=this.props,r=t.error,n=t.isLoading,o=this.state,c=o.error,i=o.loading,a=o.variations;return Object(u.createElement)(e,s()({},this.props,{error:c||r,expandedProduct:this.getExpandedProduct(),isLoading:n,variations:a,variationsLoading:i}))}}]),c}(u.Component);return i()(t,"defaultProps",{selected:[],showVariations:!1}),t}),"withProductVariations"),H=r(52),V=r(6),G=r.n(V),F=r(131);function z(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function $(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?z(Object(r),!0).forEach((function(t){i()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):z(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}r(214);var U={list:Object(l.__)("Products",'woocommerce'),noItems:Object(l.__)("Your store doesn't have any products.",'woocommerce'),search:Object(l.__)("Search for a product to display",'woocommerce'),updated:Object(l.__)("Product search results updated.",'woocommerce')},q=function(e){var t=e.expandedProduct,r=e.error,n=e.instanceId,c=e.isCompact,i=e.isLoading,a=e.onChange,b=e.onSearch,w=e.products,f=e.renderItem,v=e.selected,m=e.showVariations,g=e.variations,h=e.variationsLoading;if(r)return Object(u.createElement)(H.a,{error:r});var O=g&&g[t]?g[t]:[],y=[].concat(o()(w),o()(O));return Object(u.createElement)(p.b,{className:"woocommerce-products",list:y,isCompact:c,isLoading:i,isSingle:!0,selected:y.filter((function(e){var t=e.id;return v.includes(t)})),onChange:a,renderItem:f||(m?function(e){var t=e.item,r=e.search,o=e.depth,c=void 0===o?0:o,a=e.isSelected,b=e.onSelect,w=t.variations&&Array.isArray(t.variations)?t.variations.length:0,f=G()("woocommerce-search-product__item","woocommerce-search-list__item","depth-".concat(c),"has-count",{"is-searching":r.length>0,"is-skip-level":0===c&&0!==t.parent,"is-variable":w>0});if(!t.breadcrumbs.length)return Object(u.createElement)(F.a,s()({},e,{className:G()(f,{"is-selected":a}),isSelected:a,item:t,onSelect:function(){return function(){b(t)()}},isLoading:i||h,countLabel:t.variations.length>0?Object(l.sprintf)(
/* translators: %1$d is the number of variations of a product product. */
Object(l.__)("%1$d variations",'woocommerce'),t.variations.length):null,name:"products-".concat(n),"aria-label":Object(l.sprintf)(
/* translators: %1$s is the product name, %2$d is the number of variations of that product. */
Object(l._n)("%1$s, has %2$d variation","%1$s, has %2$d variations",t.variations.length,'woocommerce'),t.name,t.variations.length)}));var v=Object(d.isEmpty)(t.variation)?e:$($({},e),{},{item:$($({},e.item),{},{name:t.variation}),"aria-label":"".concat(t.breadcrumbs[0],": ").concat(t.variation)});return Object(u.createElement)(p.c,s()({},v,{className:f,name:"variations-".concat(n)}))}:null),onSearch:b,messages:U,isHierarchical:!0})};q.defaultProps={isCompact:!1,expandedProduct:null,selected:[],showVariations:!1},t.a=k(Object(E.a)(B(Object(b.withInstanceId)(q))))},15:function(e,t){e.exports=window.wp.apiFetch},150:function(e,t,r){"use strict";var n=r(0),o=r(28),c=Object(n.createElement)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(n.createElement)("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z"}));t.a=c},153:function(e,t){},156:function(e,t,r){"use strict";var n=r(0),o=(r(2),r(6)),c=r.n(o),i=r(41),a=r(21);r(216),t.a=Object(a.withInstanceId)((function(e){var t=e.className,r=e.instanceId,o=e.label,a=e.onChange,s=e.options,u=e.screenReaderLabel,l=e.readOnly,d=e.value,p="wc-block-components-sort-select__select-".concat(r);return Object(n.createElement)("div",{className:c()("wc-block-sort-select","wc-block-components-sort-select",t)},Object(n.createElement)(i.a,{label:o,screenReaderLabel:u,wrapperElement:"label",wrapperProps:{className:"wc-block-sort-select__label wc-block-components-sort-select__label",htmlFor:p}}),Object(n.createElement)("select",{id:p,className:"wc-block-sort-select__select wc-block-components-sort-select__select",onChange:a,readOnly:l,value:d},s.map((function(e){return Object(n.createElement)("option",{key:e.key,value:e.key},e.label)}))))}))},161:function(e,t,r){"use strict";r.d(t,"a",(function(){return c}));var n=r(1),o=r(37),c={attributes:{editMode:!1,imageType:"reviewer",orderby:"most-recent",reviewsOnLoadMore:10,reviewsOnPageLoad:10,showLoadMore:!0,showOrderby:!0,showReviewDate:!0,showReviewerName:!0,showReviewImage:!0,showReviewRating:!0,showReviewContent:!0,previewReviews:[{id:1,date_created:"2019-07-15T17:05:04",formatted_date_created:Object(n.__)("July 15, 2019",'woocommerce'),date_created_gmt:"2019-07-15T15:05:04",product_id:0,product_name:Object(n.__)("WordPress Pennant",'woocommerce'),product_permalink:"#",
/* translators: An example person name used for the block previews. */
reviewer:Object(n.__)("Alice",'woocommerce'),review:"<p>".concat(Object(n.__)("I bought this product last week and I'm very happy with it.",'woocommerce'),"</p>\n"),reviewer_avatar_urls:{48:o.o.defaultAvatar,96:o.o.defaultAvatar},rating:5,verified:!0},{id:2,date_created:"2019-07-12T12:39:39",formatted_date_created:Object(n.__)("July 12, 2019",'woocommerce'),date_created_gmt:"2019-07-12T10:39:39",product_id:0,product_name:Object(n.__)("WordPress Pennant",'woocommerce'),product_permalink:"#",
/* translators: An example person name used for the block previews. */
reviewer:Object(n.__)("Bob",'woocommerce'),review:"<p>".concat(Object(n.__)("This product is awesome, I love it!",'woocommerce'),"</p>\n"),reviewer_avatar_urls:{48:o.o.defaultAvatar,96:o.o.defaultAvatar},rating:null,verified:!1}]}}},192:function(e,t,r){"use strict";t.a={editMode:{type:"boolean",default:!0},imageType:{type:"string",default:"reviewer"},orderby:{type:"string",default:"most-recent"},reviewsOnLoadMore:{type:"number",default:10},reviewsOnPageLoad:{type:"number",default:10},showLoadMore:{type:"boolean",default:!0},showOrderby:{type:"boolean",default:!0},showReviewDate:{type:"boolean",default:!0},showReviewerName:{type:"boolean",default:!0},showReviewImage:{type:"boolean",default:!0},showReviewRating:{type:"boolean",default:!0},showReviewContent:{type:"boolean",default:!0},previewReviews:{type:"array",default:null}}},193:function(e,t,r){"use strict";var n=r(9),o=r.n(n),c=r(0),i=r(12),a=(r(215),r(85));t.a=function(e){var t=e.attributes;return Object(c.createElement)("div",o()({},i.useBlockProps.save({className:Object(a.a)(t)}),Object(a.b)(t)))}},199:function(e,t,r){"use strict";var n=r(0),o=r(1),c=(r(2),r(7)),i=r(4),a=r(12),s=r(17),u=r.n(s),l=r(18),d=r.n(l),p=r(19),b=r.n(p),w=r(20),f=r.n(w),v=r(10),m=r.n(v),g=r(11),h=r(3),O=r(106),y=r(41),j=(r(256),function(e){var t=e.onClick,r=e.label,o=e.screenReaderLabel;return Object(n.createElement)("div",{className:"wp-block-button wc-block-load-more wc-block-components-load-more"},Object(n.createElement)("button",{className:"wp-block-button__link",onClick:t},Object(n.createElement)(y.a,{label:r,screenReaderLabel:o})))});j.defaultProps={label:Object(o.__)("Load more",'woocommerce')};var _=j,k=r(156),E=(r(253),function(e){var t=e.onChange,r=e.readOnly,c=e.value;return Object(n.createElement)(k.a,{className:"wc-block-review-sort-select wc-block-components-review-sort-select",label:Object(o.__)("Order by",'woocommerce'),onChange:t,options:[{key:"most-recent",label:Object(o.__)("Most recent",'woocommerce')},{key:"highest-rating",label:Object(o.__)("Highest rating",'woocommerce')},{key:"lowest-rating",label:Object(o.__)("Lowest rating",'woocommerce')}],readOnly:r,screenReaderLabel:Object(o.__)("Order reviews by",'woocommerce'),value:c})}),R=r(5),P=r.n(R),S=r(6),C=r.n(S),x=r(13),L=r.n(x),N=r(236),I=r.n(N),T=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"...",n=I()(e,{suffix:r,limit:t});return n.html},D=function(e,t,r,n){var o=A(e,t,r);return T(e,o-n.length,n)},A=function(e,t,r){for(var n={start:0,middle:0,end:e.length};n.start<=n.end;)n.middle=Math.floor((n.start+n.end)/2),t.innerHTML=T(e,n.middle),n=M(n,t.clientHeight,r);return n.middle},M=function(e,t,r){return t<=r?e.start=e.middle+1:e.end=e.middle-1,e};var B=function(e){b()(c,e);var t,r,o=(t=c,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,n=m()(t);if(r){var o=m()(this).constructor;e=Reflect.construct(n,arguments,o)}else e=n.apply(this,arguments);return f()(this,e)});function c(e){var t;return u()(this,c),(t=o.apply(this,arguments)).state={isExpanded:!1,clampEnabled:null,content:e.children,summary:"."},t.reviewSummary=Object(g.createRef)(),t.reviewContent=Object(g.createRef)(),t.getButton=t.getButton.bind(L()(t)),t.onClick=t.onClick.bind(L()(t)),t}return d()(c,[{key:"componentDidMount",value:function(){if(this.props.children){var e=this.props,t=e.maxLines,r=e.ellipsis,n=(this.reviewSummary.current.clientHeight+1)*t+1,o=this.reviewContent.current.clientHeight+1>n;this.setState({clampEnabled:o}),o&&this.setState({summary:D(this.reviewContent.current.innerHTML,this.reviewSummary.current,n,r)})}}},{key:"getButton",value:function(){var e=this.state.isExpanded,t=this.props,r=t.className,o=t.lessText,c=t.moreText,i=e?o:c;if(i)return Object(n.createElement)("a",{href:"#more",className:r+"__read_more",onClick:this.onClick,"aria-expanded":!e,role:"button"},i)}},{key:"onClick",value:function(e){e.preventDefault();var t=this.state.isExpanded;this.setState({isExpanded:!t})}},{key:"render",value:function(){var e=this.props.className,t=this.state,r=t.content,o=t.summary,c=t.clampEnabled,i=t.isExpanded;return r?!1===c?Object(n.createElement)("div",{className:e},Object(n.createElement)("div",{ref:this.reviewContent},r)):Object(n.createElement)("div",{className:e},(!i||null===c)&&Object(n.createElement)("div",{ref:this.reviewSummary,"aria-hidden":i,dangerouslySetInnerHTML:{__html:o}}),(i||null===c)&&Object(n.createElement)("div",{ref:this.reviewContent,"aria-hidden":!i},r),this.getButton()):null}}]),c}(g.Component);B.defaultProps={maxLines:3,ellipsis:"&hellip;",moreText:Object(o.__)("Read more",'woocommerce'),lessText:Object(o.__)("Read less",'woocommerce'),className:"read-more-content"};var H=B;r(255);var V=function(e){var t=e.attributes,r=e.review,c=void 0===r?{}:r,i=t.imageType,a=t.showReviewDate,s=t.showReviewerName,u=t.showReviewImage,l=t.showReviewRating,d=t.showReviewContent,p=t.showProductName,b=c.rating,w=!Object.keys(c).length>0,f=Number.isFinite(b)&&l;return Object(n.createElement)("li",{className:C()("wc-block-review-list-item__item","wc-block-components-review-list-item__item",{"is-loading":w,"wc-block-components-review-list-item__item--has-image":u}),"aria-hidden":w},(p||a||s||u||f)&&Object(n.createElement)("div",{className:"wc-block-review-list-item__info wc-block-components-review-list-item__info"},u&&function(e,t,r){var c,i;return r||!e?Object(n.createElement)("div",{className:"wc-block-review-list-item__image wc-block-components-review-list-item__image"}):Object(n.createElement)("div",{className:"wc-block-review-list-item__image wc-block-components-review-list-item__image"},"product"===t?Object(n.createElement)("img",{"aria-hidden":"true",alt:(null===(c=e.product_image)||void 0===c?void 0:c.alt)||"",src:(null===(i=e.product_image)||void 0===i?void 0:i.thumbnail)||""}):Object(n.createElement)("img",{"aria-hidden":"true",alt:"",src:e.reviewer_avatar_urls[96]||""}),e.verified&&Object(n.createElement)("div",{className:"wc-block-review-list-item__verified wc-block-components-review-list-item__verified",title:Object(o.__)("Verified buyer",'woocommerce')},Object(o.__)("Verified buyer",'woocommerce')))}(c,i,w),(p||s||f||a)&&Object(n.createElement)("div",{className:"wc-block-review-list-item__meta wc-block-components-review-list-item__meta"},f&&function(e){var t=e.rating,r={width:t/5*100+"%"},c=Object(o.sprintf)(
/* translators: %f is referring to the average rating value */
Object(o.__)("Rated %f out of 5",'woocommerce'),t);return Object(n.createElement)("div",{className:"wc-block-review-list-item__rating wc-block-components-review-list-item__rating"},Object(n.createElement)("div",{className:"wc-block-review-list-item__rating__stars wc-block-components-review-list-item__rating__stars",role:"img","aria-label":c},Object(n.createElement)("span",{style:r},c)))}(c),p&&function(e){return Object(n.createElement)("div",{className:"wc-block-review-list-item__product wc-block-components-review-list-item__product"},Object(n.createElement)("a",{href:e.product_permalink,dangerouslySetInnerHTML:{__html:e.product_name}}))}(c),s&&function(e){var t=e.reviewer,r=void 0===t?"":t;return Object(n.createElement)("div",{className:"wc-block-review-list-item__author wc-block-components-review-list-item__author"},r)}(c),a&&function(e){var t=e.date_created,r=e.formatted_date_created;return Object(n.createElement)("time",{className:"wc-block-review-list-item__published-date wc-block-components-review-list-item__published-date",dateTime:t},r)}(c))),d&&function(e){return Object(n.createElement)(H,{maxLines:10,moreText:Object(o.__)("Read full review",'woocommerce'),lessText:Object(o.__)("Hide full review",'woocommerce'),className:"wc-block-review-list-item__text wc-block-components-review-list-item__text"},Object(n.createElement)("div",{dangerouslySetInnerHTML:{__html:e.review||""}}))}(c))};function G(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function F(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?G(Object(r),!0).forEach((function(t){P()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):G(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}r(254);var z=function(e){var t=e.attributes,r=e.reviews,o=Object(h.getSetting)("showAvatars",!0),c=Object(h.getSetting)("reviewRatingsEnabled",!0),i=(o||"product"===t.imageType)&&t.showReviewImage,a=c&&t.showReviewRating,s=F(F({},t),{},{showReviewImage:i,showReviewRating:a});return Object(n.createElement)("ul",{className:"wc-block-review-list wc-block-components-review-list"},0===r.length?Object(n.createElement)(V,{attributes:s}):r.map((function(e,t){return Object(n.createElement)(V,{key:e.id||t,attributes:s,review:e})})))},$=r(9),U=r.n($),q=r(29),W=r.n(q),Q=r(22),J=r.n(Q),Y=r(34),K=r.n(Y),X=r(85),Z=r(42);var ee=function(e){var t=function(t){b()(i,t);var r,o,c=(r=i,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=m()(r);if(o){var n=m()(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return f()(this,e)});function i(){var e;u()(this,i);for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return e=c.call.apply(c,[this].concat(r)),P()(L()(e),"isPreview",!!e.props.attributes.previewReviews),P()(L()(e),"delayedAppendReviews",e.props.delayFunction(e.appendReviews)),P()(L()(e),"isMounted",!1),P()(L()(e),"state",{error:null,loading:!0,reviews:e.isPreview?e.props.attributes.previewReviews:[],totalReviews:e.isPreview?e.props.attributes.previewReviews.length:0}),P()(L()(e),"setError",function(){var t=W()(J.a.mark((function t(r){var n,o;return J.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e.isMounted){t.next=2;break}return t.abrupt("return");case 2:return n=e.props.onReviewsLoadError,t.next=5,Object(Z.a)(r);case 5:o=t.sent,e.setState({reviews:[],loading:!1,error:o}),n(o);case 8:case"end":return t.stop()}}),t)})));return function(_x){return t.apply(this,arguments)}}()),e}return d()(i,[{key:"componentDidMount",value:function(){this.isMounted=!0,this.replaceReviews()}},{key:"componentDidUpdate",value:function(e){e.reviewsToDisplay<this.props.reviewsToDisplay?this.delayedAppendReviews():this.shouldReplaceReviews(e,this.props)&&this.replaceReviews()}},{key:"shouldReplaceReviews",value:function(e,t){return e.orderby!==t.orderby||e.order!==t.order||e.productId!==t.productId||!K()(e.categoryIds,t.categoryIds)}},{key:"componentWillUnmount",value:function(){this.isMounted=!1,this.delayedAppendReviews.cancel&&this.delayedAppendReviews.cancel()}},{key:"getArgs",value:function(e){var t=this.props,r=t.categoryIds,n=t.order,o=t.orderby,c=t.productId,i={order:n,orderby:o,per_page:t.reviewsToDisplay-e,offset:e};return r&&r.length&&(i.category_id=Array.isArray(r)?r.join(","):r),c&&(i.product_id=c),i}},{key:"replaceReviews",value:function(){if(!this.isPreview){var e=this.props.onReviewsReplaced;this.updateListOfReviews().then(e)}}},{key:"appendReviews",value:function(){if(!this.isPreview){var e=this.props,t=e.onReviewsAppended,r=e.reviewsToDisplay,n=this.state.reviews;r<=n.length||this.updateListOfReviews(n).then(t)}}},{key:"updateListOfReviews",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],r=this.props.reviewsToDisplay,n=this.state.totalReviews,o=Math.min(n,r)-t.length;return this.setState({loading:!0,reviews:t.concat(Array(o).fill({}))}),Object(X.c)(this.getArgs(t.length)).then((function(r){var n=r.reviews,o=r.totalReviews;return e.isMounted&&e.setState({reviews:t.filter((function(e){return Object.keys(e).length})).concat(n),totalReviews:o,loading:!1,error:null}),{newReviews:n}})).catch(this.setError)}},{key:"render",value:function(){var t=this.props.reviewsToDisplay,r=this.state,o=r.error,c=r.loading,i=r.reviews,a=r.totalReviews;return Object(n.createElement)(e,U()({},this.props,{error:o,isLoading:c,reviews:i.slice(0,t),totalReviews:a}))}}]),i}(g.Component);P()(t,"defaultProps",{delayFunction:function(e){return e},onReviewsAppended:function(){},onReviewsLoadError:function(){},onReviewsReplaced:function(){}});var r=e.displayName,o=void 0===r?e.name||"Component":r;return t.displayName="WithReviews( ".concat(o," )"),t}(function(e){b()(a,e);var t,r,c=(t=a,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,n=m()(t);if(r){var o=m()(this).constructor;e=Reflect.construct(n,arguments,o)}else e=n.apply(this,arguments);return f()(this,e)});function a(){return u()(this,a),c.apply(this,arguments)}return d()(a,[{key:"render",value:function(){var e=this.props,t=e.attributes,r=e.error,c=e.isLoading,a=e.noReviewsPlaceholder,s=e.reviews,u=e.totalReviews;if(r)return Object(n.createElement)(O.a,{className:"wc-block-featured-product-error",error:r,isLoading:c});if(0===s.length&&!c)return Object(n.createElement)(a,{attributes:t});var l=Object(h.getSetting)("reviewRatingsEnabled",!0);return Object(n.createElement)(i.Disabled,null,t.showOrderby&&l&&Object(n.createElement)(E,{readOnly:!0,value:t.orderby}),Object(n.createElement)(z,{attributes:t,reviews:s}),t.showLoadMore&&u>s.length&&Object(n.createElement)(_,{screenReaderLabel:Object(o.__)("Load more reviews",'woocommerce')}))}}]),a}(g.Component));t.a=function(e){var t=e.attributes,r=e.icon,s=e.name,u=e.noReviewsPlaceholder,l=t.categoryIds,d=t.productId,p=t.reviewsOnPageLoad,b=t.showProductName,w=t.showReviewDate,f=t.showReviewerName,v=t.showReviewContent,m=t.showReviewImage,g=t.showReviewRating,h=Object(X.d)(t.orderby),O=h.order,y=h.orderby,j=!(v||g||w||f||m||b),_=Object(a.useBlockProps)({className:Object(X.a)(t)});return j?Object(n.createElement)(i.Placeholder,{icon:r,label:s},Object(o.__)("The content for this block is hidden due to block settings.",'woocommerce')):Object(n.createElement)("div",_,Object(n.createElement)(ee,{attributes:t,categoryIds:l,delayFunction:function(e){return Object(c.debounce)(e,400)},noReviewsPlaceholder:u,orderby:y,order:O,productId:d,reviewsToDisplay:p}))}},21:function(e,t){e.exports=window.wp.compose},214:function(e,t){},215:function(e,t){},216:function(e,t){},22:function(e,t){e.exports=window.regeneratorRuntime},23:function(e,t){e.exports=window.wp.url},237:function(e,t,r){"use strict";var n=r(0),o=r(28),c=Object(n.createElement)(o.SVG,{xmlns:"http://www.w3.org/2000/SVG",viewBox:"0 0 24 24"},Object(n.createElement)("path",{fill:"none",d:"M0 0h24v24H0V0z"}),Object(n.createElement)("path",{d:"M21.99 4c0-1.1-.89-2-1.99-2H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h14l4 4-.01-18zM20 4v13.17L18.83 16H4V4h16zM6 12h12v2H6zm0-3h12v2H6zm0-3h12v2H6z"}));t.a=c},25:function(e,t){e.exports=window.wp.htmlEntities},253:function(e,t){},254:function(e,t){},255:function(e,t){},256:function(e,t){},26:function(e,t){e.exports=window.wp.blocks},28:function(e,t){e.exports=window.wp.primitives},3:function(e,t){e.exports=window.wc.wcSettings},302:function(e,t,r){"use strict";var n=r(9),o=r.n(n),c=r(29),i=r.n(c),a=r(8),s=r.n(a),u=r(16),l=r.n(u),d=r(0),p=r(22),b=r.n(p),w=r(37),f=r(39),v=r(222),m=r(42),g=["selected"];t.a=function(e){return function(t){var r=t.selected,n=l()(t,g),c=Object(d.useState)(!0),a=s()(c,2),u=a[0],p=a[1],h=Object(d.useState)(null),O=s()(h,2),y=O[0],j=O[1],_=Object(d.useState)([]),k=s()(_,2),E=k[0],R=k[1],P=w.o.productCount>100,S=function(){var e=i()(b.a.mark((function e(t){var r;return b.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Object(m.a)(t);case 2:r=e.sent,j(r),p(!1);case 5:case"end":return e.stop()}}),e)})));return function(_x){return e.apply(this,arguments)}}();Object(d.useEffect)((function(){Object(f.h)({selected:r}).then((function(e){R(e),p(!1)})).catch(S)}),[r]);var C=Object(v.a)((function(e){Object(f.h)({selected:r,search:e}).then((function(e){R(e),p(!1)})).catch(S)}),400),x=s()(C,1)[0],L=Object(d.useCallback)((function(e){p(!0),x(e)}),[p,x]);return Object(d.createElement)(e,o()({},n,{selected:r,error:y,products:E,isLoading:u,onSearch:P?L:null}))}}},31:function(e,t){e.exports=window.moment},34:function(e,t){e.exports=window.wp.isShallowEqual},36:function(e,t){e.exports=window.wp.dataControls},37:function(e,t,r){"use strict";r.d(t,"o",(function(){return c})),r.d(t,"m",(function(){return i})),r.d(t,"l",(function(){return a})),r.d(t,"n",(function(){return s})),r.d(t,"j",(function(){return u})),r.d(t,"e",(function(){return l})),r.d(t,"f",(function(){return d})),r.d(t,"g",(function(){return p})),r.d(t,"k",(function(){return b})),r.d(t,"c",(function(){return w})),r.d(t,"d",(function(){return f})),r.d(t,"h",(function(){return v})),r.d(t,"a",(function(){return m})),r.d(t,"i",(function(){return g})),r.d(t,"b",(function(){return h}));var n,o=r(3),c=Object(o.getSetting)("wcBlocksConfig",{buildPhase:1,pluginUrl:"",productCount:0,defaultAvatar:"",restApiRoutes:{},wordCountType:"words"}),i=c.pluginUrl+"images/",a=c.pluginUrl+"build/",s=c.buildPhase,u=null===(n=o.STORE_PAGES.shop)||void 0===n?void 0:n.permalink,l=o.STORE_PAGES.checkout.id,d=o.STORE_PAGES.checkout.permalink,p=o.STORE_PAGES.privacy.permalink,b=(o.STORE_PAGES.privacy.title,o.STORE_PAGES.terms.permalink),w=(o.STORE_PAGES.terms.title,o.STORE_PAGES.cart.id),f=o.STORE_PAGES.cart.permalink,v=(o.STORE_PAGES.myaccount.permalink?o.STORE_PAGES.myaccount.permalink:Object(o.getSetting)("wpLoginUrl","/wp-login.php"),Object(o.getSetting)("shippingCountries",{})),m=Object(o.getSetting)("allowedCountries",{}),g=Object(o.getSetting)("shippingStates",{}),h=Object(o.getSetting)("allowedStates",{})},39:function(e,t,r){"use strict";r.d(t,"h",(function(){return b})),r.d(t,"e",(function(){return w})),r.d(t,"b",(function(){return f})),r.d(t,"i",(function(){return v})),r.d(t,"f",(function(){return m})),r.d(t,"c",(function(){return g})),r.d(t,"d",(function(){return h})),r.d(t,"g",(function(){return O})),r.d(t,"a",(function(){return y}));var n=r(5),o=r.n(n),c=r(23),i=r(15),a=r.n(i),s=r(7),u=r(3),l=r(37);function d(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function p(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?d(Object(r),!0).forEach((function(t){o()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):d(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var b=function(e){var t=e.selected,r=void 0===t?[]:t,n=e.search,o=void 0===n?"":n,i=e.queryArgs,u=function(e){var t=e.selected,r=void 0===t?[]:t,n=e.search,o=void 0===n?"":n,i=e.queryArgs,a=void 0===i?{}:i,s=l.o.productCount>100,u={per_page:s?100:0,catalog_visibility:"any",search:o,orderby:"title",order:"asc"},d=[Object(c.addQueryArgs)("/wc/store/products",p(p({},u),a))];return s&&r.length&&d.push(Object(c.addQueryArgs)("/wc/store/products",{catalog_visibility:"any",include:r,per_page:0})),d}({selected:r,search:o,queryArgs:void 0===i?{}:i});return Promise.all(u.map((function(e){return a()({path:e})}))).then((function(e){return Object(s.uniqBy)(Object(s.flatten)(e),"id").map((function(e){return p(p({},e),{},{parent:0})}))})).catch((function(e){throw e}))},w=function(e){return a()({path:"/wc/store/products/".concat(e)})},f=function(){return a()({path:"wc/store/products/attributes"})},v=function(e){return a()({path:"wc/store/products/attributes/".concat(e,"/terms")})},m=function(e){var t=e.selected,r=function(e){var t=e.selected,r=void 0===t?[]:t,n=e.search,o=Object(u.getSetting)("limitTags",!1),i=[Object(c.addQueryArgs)("wc/store/products/tags",{per_page:o?100:0,orderby:o?"count":"name",order:o?"desc":"asc",search:n})];return o&&r.length&&i.push(Object(c.addQueryArgs)("wc/store/products/tags",{include:r})),i}({selected:void 0===t?[]:t,search:e.search});return Promise.all(r.map((function(e){return a()({path:e})}))).then((function(e){return Object(s.uniqBy)(Object(s.flatten)(e),"id")}))},g=function(e){return a()({path:Object(c.addQueryArgs)("wc/store/products/categories",p({per_page:0},e))})},h=function(e){return a()({path:"wc/store/products/categories/".concat(e)})},O=function(e){return a()({path:Object(c.addQueryArgs)("wc/store/products",{per_page:0,type:"variation",parent:e})})},y=function(e,t){if(!e.title.raw)return e.slug;var r=1===t.filter((function(t){return t.title.raw===e.title.raw})).length;return e.title.raw+(r?"":" - ".concat(e.slug))}},4:function(e,t){e.exports=window.wp.components},41:function(e,t,r){"use strict";var n=r(5),o=r.n(n),c=r(0),i=r(6),a=r.n(i);function s(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function u(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?s(Object(r),!0).forEach((function(t){o()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):s(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}t.a=function(e){var t,r=e.label,n=e.screenReaderLabel,o=e.wrapperElement,i=e.wrapperProps,s=void 0===i?{}:i,l=null!=r,d=null!=n;return!l&&d?(t=o||"span",s=u(u({},s),{},{className:a()(s.className,"screen-reader-text")}),Object(c.createElement)(t,s,n)):(t=o||c.Fragment,l&&d&&r!==n?Object(c.createElement)(t,s,Object(c.createElement)("span",{"aria-hidden":"true"},r),Object(c.createElement)("span",{className:"screen-reader-text"},n)):Object(c.createElement)(t,s,r))}},42:function(e,t,r){"use strict";r.d(t,"a",(function(){return s})),r.d(t,"b",(function(){return u}));var n=r(29),o=r.n(n),c=r(22),i=r.n(c),a=r(1),s=function(){var e=o()(i.a.mark((function e(t){var r;return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("function"!=typeof t.json){e.next=11;break}return e.prev=1,e.next=4,t.json();case 4:return r=e.sent,e.abrupt("return",{message:r.message,type:r.type||"api"});case 8:return e.prev=8,e.t0=e.catch(1),e.abrupt("return",{message:e.t0.message,type:"general"});case 11:return e.abrupt("return",{message:t.message,type:t.type||"general"});case 12:case"end":return e.stop()}}),e,null,[[1,8]])})));return function(_x){return e.apply(this,arguments)}}(),u=function(e){if(e.data&&"rest_invalid_param"===e.code){var t=Object.values(e.data.params);if(t[0])return t[0]}return(null==e?void 0:e.message)||Object(a.__)("Something went wrong. Please contact us to get assistance.",'woocommerce')}},46:function(e,t){e.exports=window.wp.keycodes},48:function(e,t){e.exports=window.wp.escapeHtml},481:function(e,t,r){"use strict";var n=r(9),o=r.n(n),c=r(29),i=r.n(c),a=r(17),s=r.n(a),u=r(18),l=r.n(u),d=r(13),p=r.n(d),b=r(19),w=r.n(b),f=r(20),v=r.n(f),m=r(10),g=r.n(m),h=r(5),O=r.n(h),y=r(0),j=r(22),_=r.n(j),k=r(21),E=r(39),R=r(42);var P=Object(k.createHigherOrderComponent)((function(e){return function(t){w()(a,t);var r,n,c=(r=a,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=g()(r);if(n){var o=g()(this).constructor;e=Reflect.construct(t,arguments,o)}else e=t.apply(this,arguments);return v()(this,e)});function a(){var e;s()(this,a);for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return e=c.call.apply(c,[this].concat(r)),O()(p()(e),"state",{error:null,loading:!1,product:"preview"===e.props.attributes.productId?e.props.attributes.previewProduct:null}),O()(p()(e),"loadProduct",(function(){var t=e.props.attributes.productId;"preview"!==t&&(t?(e.setState({loading:!0}),Object(E.e)(t).then((function(t){e.setState({product:t,loading:!1,error:null})})).catch(function(){var t=i()(_.a.mark((function t(r){var n;return _.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,Object(R.a)(r);case 2:n=t.sent,e.setState({product:null,loading:!1,error:n});case 4:case"end":return t.stop()}}),t)})));return function(_x){return t.apply(this,arguments)}}())):e.setState({product:null,loading:!1,error:null}))})),e}return l()(a,[{key:"componentDidMount",value:function(){this.loadProduct()}},{key:"componentDidUpdate",value:function(e){e.attributes.productId!==this.props.attributes.productId&&this.loadProduct()}},{key:"render",value:function(){var t=this.state,r=t.error,n=t.loading,c=t.product;return Object(y.createElement)(e,o()({},this.props,{error:r,getProduct:this.loadProduct,isLoading:n,product:c}))}}]),a}(y.Component)}),"withProduct");t.a=P},52:function(e,t,r){"use strict";var n=r(0),o=r(1),c=(r(2),r(48));t.a=function(e){var t,r,i,a=e.error;return Object(n.createElement)("div",{className:"wc-block-error-message"},(r=(t=a).message,i=t.type,r?"general"===i?Object(n.createElement)("span",null,Object(o.__)("The following error was returned",'woocommerce'),Object(n.createElement)("br",null),Object(n.createElement)("code",null,Object(c.escapeHTML)(r))):"api"===i?Object(n.createElement)("span",null,Object(o.__)("The following error was returned from the API",'woocommerce'),Object(n.createElement)("br",null),Object(n.createElement)("code",null,Object(c.escapeHTML)(r))):r:Object(o.__)("An unknown error occurred which prevented the block from being updated.",'woocommerce')))}},55:function(e,t){e.exports=window.wp.hooks},56:function(e,t){e.exports=window.wp.deprecated},66:function(e,t,r){"use strict";var n=r(5),o=r.n(n),c=r(16),i=r.n(c),a=r(0),s=["srcElement","size"];function u(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}t.a=function(e){var t=e.srcElement,r=e.size,n=void 0===r?24:r,c=i()(e,s);return Object(a.isValidElement)(t)?Object(a.cloneElement)(t,function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?u(Object(r),!0).forEach((function(t){o()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):u(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({width:n,height:n},c)):null}},7:function(e,t){e.exports=window.lodash},74:function(e,t){e.exports=window.wp.dom},775:function(e,t,r){e.exports=r(872)},85:function(e,t,r){"use strict";r.d(t,"d",(function(){return s})),r.d(t,"c",(function(){return u})),r.d(t,"a",(function(){return l})),r.d(t,"b",(function(){return d}));var n=r(15),o=r.n(n),c=r(6),i=r.n(c),a=r(3),s=function(e){if(Object(a.getSetting)("reviewRatingsEnabled",!0)){if("lowest-rating"===e)return{order:"asc",orderby:"rating"};if("highest-rating"===e)return{order:"desc",orderby:"rating"}}return{order:"desc",orderby:"date_gmt"}},u=function(e){return o()({path:"/wc/store/products/reviews?"+Object.entries(e).map((function(e){return e.join("=")})).join("&"),parse:!1}).then((function(e){return e.json().then((function(t){return{reviews:t,totalReviews:parseInt(e.headers.get("x-wp-total"),10)}}))}))},l=function(e){var t=e.className,r=e.categoryIds,n=e.productId,o=e.showReviewDate,c=e.showReviewerName,a=e.showReviewContent,s=e.showProductName,u=e.showReviewImage,l=e.showReviewRating,d="wc-block-all-reviews";return n&&(d="wc-block-reviews-by-product"),Array.isArray(r)&&(d="wc-block-reviews-by-category"),i()(d,t,{"has-image":u,"has-name":c,"has-date":o,"has-rating":l,"has-content":a,"has-product-name":s})},d=function(e){var t=e.categoryIds,r=e.imageType,n=e.orderby,o=e.productId,c={"data-image-type":r,"data-orderby":n,"data-reviews-on-page-load":e.reviewsOnPageLoad,"data-reviews-on-load-more":e.reviewsOnLoadMore,"data-show-load-more":e.showLoadMore,"data-show-orderby":e.showOrderby};return o&&(c["data-product-id"]=o),Array.isArray(t)&&(c["data-category-ids"]=t.join(",")),c}},87:function(e,t){e.exports=window.ReactDOM},872:function(e,t,r){"use strict";r.r(t);var n=r(5),o=r.n(n),c=r(0),i=r(1),a=r(26),s=r(66),u=r(237),l=(r(215),r(9)),d=r.n(l),p=r(12),b=r(4),w=r(49),f=(r(2),r(149)),v=r(199),m=r(106),g=r(481),h=Object(g.a)((function(e){var t=e.error,r=e.getProduct,n=e.isLoading,o=e.product;if(t)return Object(c.createElement)(m.a,{className:"wc-block-featured-product-error",error:t,isLoading:n,onRetry:r});var a=!o||n?Object(c.createElement)(b.Spinner,null):Object(i.sprintf)(
/* translators: %s is the product name. */
Object(i.__)("This block lists reviews for a selected product. %s doesn't have any reviews yet, but they will show up here when it does.",'woocommerce'),o.name);return Object(c.createElement)(b.Placeholder,{className:"wc-block-reviews-by-product",icon:Object(c.createElement)(s.a,{srcElement:u.a,className:"block-editor-block-icon"}),label:Object(i.__)("Reviews by Product",'woocommerce')},a)})),O=r(144),y=Object(b.withSpokenMessages)((function(e){var t=e.attributes,r=e.debouncedSpeak,n=e.setAttributes,o=t.editMode,a=function(e){var t=e.item,r=void 0===t?0:t;return Object(c.createElement)(w.c,d()({},e,{countLabel:Object(i.sprintf)(
/* translators: %d is the review count. */
Object(i._n)("%d review","%d reviews",r.review_count,'woocommerce'),r.review_count),"aria-label":Object(i.sprintf)(
/* translators: %1$s is the item name, and %2$d is the number of reviews for the item. */
Object(i._n)("%1$s, has %2$d review","%1$s, has %2$d reviews",r.review_count,'woocommerce'),r.name,r.review_count)}))};return!t.productId||o?Object(c.createElement)(b.Placeholder,{icon:Object(c.createElement)(s.a,{icon:u.a,className:"block-editor-block-icon"}),label:Object(i.__)("Reviews by Product",'woocommerce'),className:"wc-block-reviews-by-product"},Object(i.__)("Show reviews of your product to build trust",'woocommerce'),Object(c.createElement)("div",{className:"wc-block-reviews__selection"},Object(c.createElement)(f.a,{selected:t.productId||0,onChange:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=e[0]?e[0].id:0;n({productId:t})},queryArgs:{orderby:"comment_count",order:"desc"},renderItem:a}),Object(c.createElement)(b.Button,{isPrimary:!0,onClick:function(){n({editMode:!1}),r(Object(i.__)("Showing Reviews by Product block preview.",'woocommerce'))}},Object(i.__)("Done",'woocommerce')))):Object(c.createElement)(c.Fragment,null,Object(O.a)(o,n),Object(c.createElement)(p.InspectorControls,{key:"inspector"},Object(c.createElement)(b.PanelBody,{title:Object(i.__)("Product",'woocommerce'),initialOpen:!1},Object(c.createElement)(f.a,{selected:t.productId||0,onChange:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=e[0]?e[0].id:0;n({productId:t})},renderItem:a,isCompact:!0})),Object(c.createElement)(b.PanelBody,{title:Object(i.__)("Content",'woocommerce')},Object(O.b)(t,n)),Object(c.createElement)(b.PanelBody,{title:Object(i.__)("List Settings",'woocommerce')},Object(O.c)(t,n))),Object(c.createElement)(v.a,{attributes:t,icon:Object(c.createElement)(s.a,{icon:u.a,className:"block-editor-block-icon"}),name:Object(i.__)("Reviews by Product",'woocommerce'),noReviewsPlaceholder:h}))})),j=r(192),_=r(193),k=r(161);function E(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function R(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?E(Object(r),!0).forEach((function(t){o()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):E(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}Object(a.registerBlockType)("woocommerce/reviews-by-product",{apiVersion:2,title:Object(i.__)("Reviews by Product",'woocommerce'),icon:{src:Object(c.createElement)(s.a,{srcElement:u.a}),foreground:"#96588a"},category:"woocommerce",keywords:[Object(i.__)("WooCommerce",'woocommerce')],description:Object(i.__)("Show reviews of your products to build trust.",'woocommerce'),supports:{html:!1,color:{background:!1},typography:{fontSize:!0}},example:R(R({},k.a),{},{attributes:R(R({},k.a.attributes),{},{productId:1})}),attributes:R(R({},j.a),{},{productId:{type:"number"}}),edit:function(e){return Object(c.createElement)(y,e)},save:_.a})},88:function(e,t,r){"use strict";var n=r(9),o=r.n(n),c=r(17),i=r.n(c),a=r(18),s=r.n(a),u=r(13),l=r.n(u),d=r(19),p=r.n(d),b=r(20),w=r.n(b),f=r(10),v=r.n(f),m=r(0),g=r(7),h=r(6),O=r.n(h),y=r(4),j=r(21);r(123);var _=function(e){p()(c,e);var t,r,n=(t=c,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,n=v()(t);if(r){var o=v()(this).constructor;e=Reflect.construct(n,arguments,o)}else e=n.apply(this,arguments);return w()(this,e)});function c(){var e;return i()(this,c),(e=n.apply(this,arguments)).onClick=e.onClick.bind(l()(e)),e}return s()(c,[{key:"onClick",value:function(e){this.props.onChange&&this.props.onChange(e.target.value)}},{key:"render",value:function(){var e,t=this,r=this.props,n=r.label,c=r.checked,i=r.instanceId,a=r.className,s=r.help,u=r.options,l=r.value,d="inspector-toggle-button-control-".concat(i);return s&&(e=Object(g.isFunction)(s)?s(c):s),Object(m.createElement)(y.BaseControl,{id:d,help:e,className:O()("components-toggle-button-control",a)},Object(m.createElement)("label",{id:d+"__label",htmlFor:d,className:"components-toggle-button-control__label"},n),Object(m.createElement)(y.ButtonGroup,{"aria-labelledby":d+"__label"},u.map((function(e,r){var c={};return l===e.value?(c.isPrimary=!0,c["aria-pressed"]=!0):(c.isSecondary=!0,c["aria-pressed"]=!1),Object(m.createElement)(y.Button,o()({key:"".concat(e.label,"-").concat(e.value,"-").concat(r),value:e.value,onClick:t.onClick,"aria-label":n+": "+e.label},c),e.label)}))))}}]),c}(m.Component);t.a=Object(j.withInstanceId)(_)},89:function(e,t){e.exports=window.wp.viewport},96:function(e,t){e.exports=window.wp.date}});woocommerce-blocks/build/single-product-frontend.asset.php000064400000001055151335517640020053 0ustar00<?php return array('dependencies' => array('lodash', 'react', 'wc-blocks-checkout', 'wc-blocks-data-store', 'wc-blocks-registry', 'wc-blocks-shared-context', 'wc-blocks-shared-hocs', 'wc-price-format', 'wc-settings', 'wp-a11y', 'wp-api-fetch', 'wp-autop', 'wp-block-editor', 'wp-blocks', 'wp-compose', 'wp-data', 'wp-deprecated', 'wp-dom', 'wp-element', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-is-shallow-equal', 'wp-keycodes', 'wp-polyfill', 'wp-primitives', 'wp-url', 'wp-warning', 'wp-wordcount'), 'version' => 'f8213cf11fee6be50fa751f0ecc16fd8');woocommerce-blocks/build/cart-i2.js000064400000553515151335517640013264 0ustar00this.wc=this.wc||{},this.wc.blocks=this.wc.blocks||{},this.wc.blocks["cart-i2"]=function(e){function t(t){for(var n,a,i=t[0],s=t[1],u=t[2],p=0,d=[];p<i.length;p++)a=i[p],Object.prototype.hasOwnProperty.call(c,a)&&c[a]&&d.push(c[a][0]),c[a]=0;for(n in s)Object.prototype.hasOwnProperty.call(s,n)&&(e[n]=s[n]);for(l&&l(t);d.length;)d.shift()();return o.push.apply(o,u||[]),r()}function r(){for(var e,t=0;t<o.length;t++){for(var r=o[t],n=!0,i=1;i<r.length;i++){var s=r[i];0!==c[s]&&(n=!1)}n&&(o.splice(t--,1),e=a(a.s=r[0]))}return e}var n={},c={21:0,1:0},o=[];function a(t){if(n[t])return n[t].exports;var r=n[t]={i:t,l:!1,exports:{}};return e[t].call(r.exports,r,r.exports,a),r.l=!0,r.exports}a.m=e,a.c=n,a.d=function(e,t,r){a.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},a.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},a.t=function(e,t){if(1&t&&(e=a(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(a.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)a.d(r,n,function(t){return e[t]}.bind(null,n));return r},a.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return a.d(t,"a",t),t},a.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},a.p="";var i=window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[],s=i.push.bind(i);i.push=t,i=i.slice();for(var u=0;u<i.length;u++)t(i[u]);var l=s;return o.push([841,0]),r()}({0:function(e,t){e.exports=window.wp.element},1:function(e,t){e.exports=window.wp.i18n},11:function(e,t){e.exports=window.React},110:function(e,t,r){"use strict";var n=r(0),c=r(6),o=r.n(c);r(262),t.a=function(e){var t=e.children,r=e.className;return Object(n.createElement)("div",{className:o()("wc-block-components-product-badge",r)},t)}},113:function(e,t,r){"use strict";var n=r(5),c=r.n(n),o=r(8),a=r.n(o),i=r(3),s=r(1),u=r(72);function l(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function p(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?l(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):l(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var d=Object(i.getSetting)("countryLocale",{}),b=function(e){var t={};return void 0!==e.label&&(t.label=e.label),void 0!==e.required&&(t.required=e.required),void 0!==e.hidden&&(t.hidden=e.hidden),void 0===e.label||e.optionalLabel||(t.optionalLabel=Object(s.sprintf)(
/* translators: %s Field label. */
Object(s.__)("%s (optional)",'woocommerce'),e.label)),e.priority&&(Object(u.a)(e.priority)&&(t.index=e.priority),Object(u.c)(e.priority)&&(t.index=parseInt(e.priority,10))),e.hidden&&(t.required=!1),t},m=Object.entries(d).map((function(e){var t=a()(e,2),r=t[0],n=t[1];return[r,Object.entries(n).map((function(e){var t=a()(e,2),r=t[0],n=t[1];return[r,b(n)]})).reduce((function(e,t){var r=a()(t,2),n=r[0],c=r[1];return e[n]=c,e}),{})]})).reduce((function(e,t){var r=a()(t,2),n=r[0],c=r[1];return e[n]=c,e}),{});t.a=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",n=r&&void 0!==m[r]?m[r]:{};return e.map((function(e){var r=i.defaultAddressFields[e]||{},c=n[e]||{},o=t[e]||{};return p(p(p({key:e},r),c),o)})).sort((function(e,t){return e.index-t.index}))}},114:function(e,t,r){"use strict";var n=r(0);r(209),t.a=function(){return Object(n.createElement)("span",{className:"wc-block-components-spinner","aria-hidden":"true"})}},119:function(e,t){e.exports=window.wp.wordcount},12:function(e,t){e.exports=window.wp.blockEditor},124:function(e,t,r){"use strict";var n=r(5),c=r.n(n),o=r(0),a=r(1),i=r(53),s=r(6),u=r.n(s),l=(r(2),r(47)),p=(r(206),function(e){var t=e.currency,r=e.maxPrice,n=e.minPrice,c=e.priceClassName,s=e.priceStyle;return Object(o.createElement)(o.Fragment,null,Object(o.createElement)("span",{className:"screen-reader-text"},Object(a.sprintf)(
/* translators: %1$s min price, %2$s max price */
Object(a.__)("Price between %1$s and %2$s",'woocommerce'),Object(l.formatPrice)(n),Object(l.formatPrice)(r))),Object(o.createElement)("span",{"aria-hidden":!0},Object(o.createElement)(i.a,{className:u()("wc-block-components-product-price__value",c),currency:t,value:n,style:s})," — ",Object(o.createElement)(i.a,{className:u()("wc-block-components-product-price__value",c),currency:t,value:r,style:s})))}),d=function(e){var t=e.currency,r=e.regularPriceClassName,n=e.regularPriceStyle,c=e.regularPrice,s=e.priceClassName,l=e.priceStyle,p=e.price;return Object(o.createElement)(o.Fragment,null,Object(o.createElement)("span",{className:"screen-reader-text"},Object(a.__)("Previous price:",'woocommerce')),Object(o.createElement)(i.a,{currency:t,renderText:function(e){return Object(o.createElement)("del",{className:u()("wc-block-components-product-price__regular",r),style:n},e)},value:c}),Object(o.createElement)("span",{className:"screen-reader-text"},Object(a.__)("Discounted price:",'woocommerce')),Object(o.createElement)(i.a,{currency:t,renderText:function(e){return Object(o.createElement)("ins",{className:u()("wc-block-components-product-price__value","is-discounted",s),style:l},e)},value:p}))};t.a=function(e){var t=e.align,r=e.className,n=e.currency,a=e.format,s=void 0===a?"<price/>":a,l=e.maxPrice,b=void 0===l?null:l,m=e.minPrice,f=void 0===m?null:m,O=e.price,g=void 0===O?null:O,h=e.priceClassName,v=e.priceStyle,j=e.regularPrice,E=e.regularPriceClassName,y=e.regularPriceStyle,_=u()(r,"price","wc-block-components-product-price",c()({},"wc-block-components-product-price--align-".concat(t),t));s.includes("<price/>")||(s="<price/>",console.error("Price formats need to include the `<price/>` tag."));var w=j&&g!==j,k=Object(o.createElement)("span",{className:u()("wc-block-components-product-price__value",h)});return w?k=Object(o.createElement)(d,{currency:n,price:g,priceClassName:h,priceStyle:v,regularPrice:j,regularPriceClassName:E,regularPriceStyle:y}):null!==f&&null!==b?k=Object(o.createElement)(p,{currency:n,maxPrice:b,minPrice:f,priceClassName:h,priceStyle:v}):null!==g&&(k=Object(o.createElement)(i.a,{className:u()("wc-block-components-product-price__value",h),currency:n,value:g,style:v})),Object(o.createElement)("span",{className:_},Object(o.createInterpolateElement)(s,{price:k}))}},125:function(e,t,r){"use strict";var n=r(17),c=r.n(n),o=r(18),a=r.n(o),i=r(13),s=r.n(i),u=r(19),l=r.n(u),p=r(20),d=r.n(p),b=r(10),m=r.n(b),f=r(5),O=r.n(f),g=r(0),h=(r(2),r(11)),v=r(1),j=r(37),E=function(e){var t=e.imageUrl,r=void 0===t?"".concat(j.m,"/block-error.svg"):t,n=e.header,c=void 0===n?Object(v.__)("Oops!",'woocommerce'):n,o=e.text,a=void 0===o?Object(v.__)("There was an error loading the content.",'woocommerce'):o,i=e.errorMessage,s=e.errorMessagePrefix,u=void 0===s?Object(v.__)("Error:",'woocommerce'):s,l=e.button;return Object(g.createElement)("div",{className:"wc-block-error wc-block-components-error"},r&&Object(g.createElement)("img",{className:"wc-block-error__image wc-block-components-error__image",src:r,alt:""}),Object(g.createElement)("div",{className:"wc-block-error__content wc-block-components-error__content"},c&&Object(g.createElement)("p",{className:"wc-block-error__header wc-block-components-error__header"},c),a&&Object(g.createElement)("p",{className:"wc-block-error__text wc-block-components-error__text"},a),i&&Object(g.createElement)("p",{className:"wc-block-error__message wc-block-components-error__message"},u?u+" ":"",i),l&&Object(g.createElement)("p",{className:"wc-block-error__button wc-block-components-error__button"},l)))};r(218);var y=function(e){l()(o,e);var t,r,n=(t=o,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,n=m()(t);if(r){var c=m()(this).constructor;e=Reflect.construct(n,arguments,c)}else e=n.apply(this,arguments);return d()(this,e)});function o(){var e;c()(this,o);for(var t=arguments.length,r=new Array(t),a=0;a<t;a++)r[a]=arguments[a];return e=n.call.apply(n,[this].concat(r)),O()(s()(e),"state",{errorMessage:"",hasError:!1}),e}return a()(o,[{key:"render",value:function(){var e=this.props,t=e.header,r=e.imageUrl,n=e.showErrorMessage,c=e.text,o=e.errorMessagePrefix,a=e.renderError,i=e.button,s=this.state,u=s.errorMessage;return s.hasError?"function"==typeof a?a({errorMessage:u}):Object(g.createElement)(E,{errorMessage:n?u:null,header:t,imageUrl:r,text:c,errorMessagePrefix:o,button:i}):this.props.children}}],[{key:"getDerivedStateFromError",value:function(e){return void 0!==e.statusText&&void 0!==e.status?{errorMessage:Object(g.createElement)(g.Fragment,null,Object(g.createElement)("strong",null,e.status),": ",e.statusText),hasError:!0}:{errorMessage:e.message,hasError:!0}}}]),o}(h.Component);y.defaultProps={showErrorMessage:!0},t.a=y},126:function(e,t,r){"use strict";r.d(t,"a",(function(){return u})),r.d(t,"b",(function(){return p}));var n,c=r(5),o=r.n(c),a=r(7);function i(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function s(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?i(Object(r),!0).forEach((function(t){o()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):i(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}!function(e){e.ADD_EVENT_CALLBACK="add_event_callback",e.REMOVE_EVENT_CALLBACK="remove_event_callback"}(n||(n={}));var u={addEventCallback:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:10;return{id:Object(a.uniqueId)(),type:n.ADD_EVENT_CALLBACK,eventType:e,callback:t,priority:r}},removeEventCallback:function(e,t){return{id:t,type:n.REMOVE_EVENT_CALLBACK,eventType:e}}},l={},p=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:l,t=arguments.length>1?arguments[1]:void 0,r=t.type,c=t.eventType,a=t.id,i=t.callback,u=t.priority,p=e.hasOwnProperty(c)?new Map(e[c]):new Map;switch(r){case n.ADD_EVENT_CALLBACK:return p.set(a,{priority:u,callback:i}),s(s({},e),{},o()({},c,p));case n.REMOVE_EVENT_CALLBACK:return p.delete(a),s(s({},e),{},o()({},c,p))}}},127:function(e,t,r){"use strict";r.d(t,"a",(function(){return a}));var n=r(8),c=r.n(n),o=r(0),a=function(){var e=Object(o.useState)(),t=c()(e,2)[1];return Object(o.useCallback)((function(e){t((function(){throw e}))}),[])}},129:function(e,t,r){"use strict";var n=r(0);t.a=function(e){var t=e.label,r=e.secondaryLabel,c=e.description,o=e.secondaryDescription,a=e.id;return Object(n.createElement)("div",{className:"wc-block-components-radio-control__option-layout"},Object(n.createElement)("div",{className:"wc-block-components-radio-control__label-group"},t&&Object(n.createElement)("span",{id:a&&"".concat(a,"__label"),className:"wc-block-components-radio-control__label"},t),r&&Object(n.createElement)("span",{id:a&&"".concat(a,"__secondary-label"),className:"wc-block-components-radio-control__secondary-label"},r)),Object(n.createElement)("div",{className:"wc-block-components-radio-control__description-group"},c&&Object(n.createElement)("span",{id:a&&"".concat(a,"__description"),className:"wc-block-components-radio-control__description"},c),o&&Object(n.createElement)("span",{id:a&&"".concat(a,"__secondary-description"),className:"wc-block-components-radio-control__secondary-description"},o)))}},132:function(e,t,r){"use strict";r.d(t,"b",(function(){return v})),r.d(t,"a",(function(){return j}));var n=r(38),c=r.n(n),o=r(5),a=r.n(o),i=r(16),s=r.n(i),u=r(8),l=r.n(u),p=r(0),d=r(7),b=r(34),m=r.n(b);function f(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function O(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?f(Object(r),!0).forEach((function(t){a()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):f(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function g(e){var t=function(e,t){if("object"!==c()(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!==c()(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===c()(t)?t:String(t)}var h=Object(p.createContext)({getValidationError:function(){return""},setValidationErrors:function(e){},clearValidationError:function(e){},clearAllValidationErrors:function(){},hideValidationError:function(){},showValidationError:function(){},showAllValidationErrors:function(){},hasValidationErrors:!1,getValidationErrorId:function(e){return e}}),v=function(){return Object(p.useContext)(h)},j=function(e){var t=e.children,r=Object(p.useState)({}),n=l()(r,2),c=n[0],o=n[1],i=Object(p.useCallback)((function(e){return c[e]}),[c]),u=Object(p.useCallback)((function(e){var t=c[e];return!t||t.hidden?"":"validate-error-".concat(e)}),[c]),b=Object(p.useCallback)((function(e){o((function(t){return t[e]?(t[e],s()(t,[e].map(g))):t}))}),[]),f=Object(p.useCallback)((function(){o({})}),[]),v=Object(p.useCallback)((function(e){e&&o((function(t){return e=Object(d.pickBy)(e,(function(e,r){return!("string"!=typeof e.message||t.hasOwnProperty(r)&&m()(t[r],e))})),0===Object.values(e).length?t:O(O({},t),e)}))}),[]),j=Object(p.useCallback)((function(e,t){o((function(r){if(!r.hasOwnProperty(e))return r;var n=O(O({},r[e]),t);return m()(r[e],n)?r:O(O({},r),{},a()({},e,n))}))}),[]),E={getValidationError:i,setValidationErrors:v,clearValidationError:b,clearAllValidationErrors:f,hideValidationError:Object(p.useCallback)((function(e){j(e,{hidden:!0})}),[j]),showValidationError:Object(p.useCallback)((function(e){j(e,{hidden:!1})}),[j]),showAllValidationErrors:Object(p.useCallback)((function(){o((function(e){var t={};return Object.keys(e).forEach((function(r){e[r].hidden&&(t[r]=O(O({},e[r]),{},{hidden:!1}))})),0===Object.values(t).length?e:O(O({},e),t)}))}),[]),hasValidationErrors:Object.keys(c).length>0,getValidationErrorId:u};return Object(p.createElement)(h.Provider,{value:E},t)}},134:function(e,t,r){"use strict";r.d(t,"a",(function(){return i}));var n=r(14),c=r(0),o=r(24),a=r(127),i=function(){var e=Object(a.a)(),t=Object(n.useDispatch)(o.CART_STORE_KEY).selectShippingRate;return{selectShippingRate:Object(c.useCallback)((function(r,n){t(r,n).catch((function(t){e(t)}))}),[e,t]),isSelectingRate:Object(n.useSelect)((function(e){return e(o.CART_STORE_KEY).isShippingRateBeingSelected()}),[])}}},135:function(e,t,r){"use strict";var n=r(9),c=r.n(n),o=r(16),a=r.n(o),i=r(0),s=r(6),u=r.n(s),l=(r(2),r(260),["children","className","headingLevel"]);t.a=function(e){var t=e.children,r=e.className,n=e.headingLevel,o=a()(e,l),s=u()("wc-block-components-title",r),p="h".concat(n);return Object(i.createElement)(p,c()({className:s},o),t)}},136:function(e,t,r){"use strict";r.d(t,"a",(function(){return c}));var n=r(11);function c(e,t){var r=Object(n.useRef)();return Object(n.useEffect)((function(){r.current===e||t&&!t(e,r.current)||(r.current=e)}),[e,t]),r.current}},14:function(e,t){e.exports=window.wp.data},140:function(e,t,r){"use strict";var n=r(5),c=r.n(n),o=r(0),a=r(6),i=r.n(a),s=r(129);t.a=function(e){var t,r=e.checked,n=e.name,a=e.onChange,u=e.option,l=u.value,p=u.label,d=u.description,b=u.secondaryLabel,m=u.secondaryDescription;return Object(o.createElement)("label",{className:i()("wc-block-components-radio-control__option",{"wc-block-components-radio-control__option-checked":r}),htmlFor:"".concat(n,"-").concat(l)},Object(o.createElement)("input",{id:"".concat(n,"-").concat(l),className:"wc-block-components-radio-control__input",type:"radio",name:n,value:l,onChange:function(e){return a(e.target.value)},checked:r,"aria-describedby":i()((t={},c()(t,"".concat(n,"-").concat(l,"__label"),p),c()(t,"".concat(n,"-").concat(l,"__secondary-label"),b),c()(t,"".concat(n,"-").concat(l,"__description"),d),c()(t,"".concat(n,"-").concat(l,"__secondary-description"),m),t))}),Object(o.createElement)(s.a,{id:"".concat(n,"-").concat(l),label:p,secondaryLabel:b,description:d,secondaryDescription:m}))}},141:function(e,t,r){"use strict";r.d(t,"b",(function(){return E})),r.d(t,"a",(function(){return y}));var n=r(5),c=r.n(n),o=r(8),a=r.n(o),i=r(0),s=(r(2),r(14)),u=r(68),l=r(63),p=r(9),d=r.n(p),b=r(6),m=r.n(b),f=r(890),O=(r(207),function(e){var t=e.status;switch(void 0===t?"default":t){case"error":return"woocommerce-error";case"success":return"woocommerce-message";case"info":case"warning":return"woocommerce-info"}return""}),g=function(e){var t=e.className,r=e.notices,n=e.removeNotice,c=r.filter((function(e){return"snackbar"!==e.type}));if(!c.length)return null;var o=m()(t,"wc-block-components-notices");return Object(i.createElement)("div",{className:o},c.map((function(e){return Object(i.createElement)(f.a,d()({key:"store-notice-"+e.id},e,{className:m()("wc-block-components-notices__notice",O(e)),onRemove:function(){e.isDismissible&&n(e.id)}}),e.content)})))};function h(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function v(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?h(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):h(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var j=Object(i.createContext)({notices:[],createNotice:function(e,t,r){},removeNotice:function(e,t){},setIsSuppressed:function(e){},context:"wc/core"}),E=function(){return Object(i.useContext)(j)},y=function(e){var t=e.children,r=e.className,n=void 0===r?"":r,c=e.createNoticeContainer,o=void 0===c||c,p=e.context,d=void 0===p?"wc/core":p,b=Object(s.useDispatch)("core/notices"),m=b.createNotice,f=b.removeNotice,O=Object(i.useState)(!1),h=a()(O,2),E=h[0],y=h[1],_=Object(u.a)().dispatchStoreEvent,w=Object(l.b)().isEditor,k=Object(i.useCallback)((function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};m(e,t,v(v({},r),{},{context:r.context||d})),_("store-notice-create",{status:e,content:t,options:r})}),[m,_,d]),S=Object(i.useCallback)((function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:d;f(e,t)}),[f,d]),C={notices:Object(s.useSelect)((function(e){return{notices:e("core/notices").getNotices(d)}}),[d]).notices,createNotice:k,removeNotice:S,context:d,setIsSuppressed:y},P=E?null:Object(i.createElement)(g,{className:n,notices:C.notices,removeNotice:C.removeNotice,isEditor:w});return Object(i.createElement)(j.Provider,{value:C},o&&P,t)}},142:function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));var n=r(8),c=r.n(n),o=function(e){return e.reduce((function(e,t){var r=c()(t,2),n=r[0],o=r[1];return e[n]=o,e}),{})}},15:function(e,t){e.exports=window.wp.apiFetch},154:function(e,t,r){"use strict";var n=r(9),c=r.n(n),o=r(16),a=r.n(o),i=r(0),s=r(25),u=r(6),l=r.n(u),p=(r(205),["className","disabled","name","permalink"]);t.a=function(e){var t=e.className,r=void 0===t?"":t,n=e.disabled,o=void 0!==n&&n,u=e.name,d=e.permalink,b=void 0===d?"":d,m=a()(e,p),f=l()("wc-block-components-product-name",r);return o?Object(i.createElement)("span",c()({className:f},m,{dangerouslySetInnerHTML:{__html:Object(s.decodeEntities)(u)}})):Object(i.createElement)("a",c()({className:f,href:b},m,{dangerouslySetInnerHTML:{__html:Object(s.decodeEntities)(u)}}))}},155:function(e,t,r){"use strict";var n=r(0),c=r(119),o=r(91),a=function(e){var t=e.indexOf("</p>");return-1===t?e:e.substr(0,t+4)},i=function(e){return e.replace(/<\/?[a-z][^>]*?>/gi,"")},s=function(e,t){return e.replace(/[\s|\.\,]+$/i,"")+t},u=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"&hellip;",n=i(e),c=n.split(" ").splice(0,t).join(" ");return Object(o.autop)(s(c,r))},l=function(e,t){var r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"&hellip;",c=i(e),a=c.slice(0,t);if(r)return Object(o.autop)(s(a,n));var u=a.match(/([\s]+)/g),l=u?u.length:0,p=c.slice(0,t+l);return Object(o.autop)(s(p,n))};t.a=function(e){var t=e.source,r=e.maxLength,i=void 0===r?15:r,s=e.countType,p=void 0===s?"words":s,d=e.className,b=void 0===d?"":d,m=Object(n.useMemo)((function(){return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:15,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"words",n=Object(o.autop)(e),i=Object(c.count)(n,r);if(i<=t)return n;var s=a(n),p=Object(c.count)(s,r);return p<=t?s:"words"===r?u(s,t):l(s,t,"characters_including_spaces"===r)}(t,i,p)}),[t,i,p]);return Object(n.createElement)(n.RawHTML,{className:b},m)}},158:function(e,t,r){"use strict";var n=r(0),c=r(28),o=Object(n.createElement)(c.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(n.createElement)("mask",{id:"external-mask",width:"24",height:"24",x:"0",y:"0",maskUnits:"userSpaceOnUse"},Object(n.createElement)("path",{fill:"#fff",d:"M6.3431 6.3431v1.994l7.8984.0072-8.6055 8.6054 1.4142 1.4143 8.6055-8.6055.0071 7.8984h1.994V6.3431H6.3431z"})),Object(n.createElement)("g",{mask:"url(#external-mask)"},Object(n.createElement)("path",{d:"M0 0h24v24H0z"})));t.a=o},159:function(e,t,r){"use strict";r.d(t,"c",(function(){return o})),r.d(t,"d",(function(){return a})),r.d(t,"a",(function(){return i})),r.d(t,"b",(function(){return s}));var n=r(26),c=r(37),o=function(e,t){if(c.n>2)return Object(n.registerBlockType)(e,t)},a=function(e,t){if(c.n>1)return Object(n.registerBlockType)(e,t)},i=function(){return c.n>2},s=function(){return c.n>1}},162:function(e,t,r){"use strict";r.d(t,"b",(function(){return a})),r.d(t,"c",(function(){return i})),r.d(t,"a",(function(){return s}));var n=r(3),c=r(113),o=r(23),a=function(e){var t=e.country,r=void 0===t?"":t,n=e.state,c=void 0===n?"":n,o=e.city,a=void 0===o?"":o,i=e.postcode,s=void 0===i?"":i;return{country:r.trim(),state:c.trim(),city:a.trim(),postcode:s?s.replace(" ","").toUpperCase():""}},i=function(e){var t=e.email,r=void 0===t?"":t;return Object(o.isEmail)(r)?r.trim():""},s=function(e){var t=Object.keys(n.defaultAddressFields),r=Object(c.a)(t,{},e.country),o=Object.assign({},e);return r.forEach((function(t){var r=t.key,n=void 0===r?"":r,c=t.hidden;void 0!==c&&c&&function(e,t){return e in t}(n,e)&&(o[n]="")})),o}},163:function(e,t,r){"use strict";r.d(t,"b",(function(){return a})),r.d(t,"a",(function(){return i}));var n=r(62),c=r(174),o=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=Object(c.b)(),r=t.paymentMethods,o=t.expressPaymentMethods,a=t.paymentMethodsInitialized,i=t.expressPaymentMethodsInitialized,s=Object(n.a)(r),u=Object(n.a)(o);return{paymentMethods:e?u:s,isInitialized:e?i:a}},a=function(){return o(!1)},i=function(){return o(!0)}},167:function(e,t,r){"use strict";var n=r(0),c=r(6),o=r.n(c),a=r(21),i=r(140);r(272),t.a=Object(a.withInstanceId)((function(e){var t=e.className,r=e.instanceId,c=e.id,a=e.selected,s=e.onChange,u=e.options,l=void 0===u?[]:u,p=c||r;return l.length&&Object(n.createElement)("div",{className:o()("wc-block-components-radio-control",t)},l.map((function(e){return Object(n.createElement)(i.a,{key:"".concat(p,"-").concat(e.value),name:"radio-control-".concat(p),checked:e.value===a,option:e,onChange:function(t){s(t),"function"==typeof e.onChange&&e.onChange(t)}})})))}))},168:function(e,t,r){"use strict";var n=r(17),c=r.n(n),o=r(18),a=r.n(o),i=r(13),s=r.n(i),u=r(19),l=r.n(u),p=r(20),d=r.n(p),b=r(10),m=r.n(b),f=r(5),O=r.n(f),g=r(0),h=r(1),v=r(11),j=(r(2),r(3)),E=r(44);var y=function(e){l()(o,e);var t,r,n=(t=o,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,n=m()(t);if(r){var c=m()(this).constructor;e=Reflect.construct(n,arguments,c)}else e=n.apply(this,arguments);return d()(this,e)});function o(){var e;c()(this,o);for(var t=arguments.length,r=new Array(t),a=0;a<t;a++)r[a]=arguments[a];return e=n.call.apply(n,[this].concat(r)),O()(s()(e),"state",{errorMessage:"",hasError:!1}),e}return a()(o,[{key:"render",value:function(){var e=this.state,t=e.hasError,r=e.errorMessage,n=this.props.isEditor;if(t){var c=Object(h.__)("This site is experiencing difficulties with this payment method. Please contact the owner of the site for assistance.",'woocommerce');(n||j.CURRENT_USER_IS_ADMIN)&&(c=r||Object(h.__)("There was an error with this payment method. Please verify it's configured correctly.",'woocommerce'));var o=[{id:"0",content:c,isDismissible:!1,status:"error"}];return Object(g.createElement)(E.StoreNoticesContainer,{notices:o})}return this.props.children}}],[{key:"getDerivedStateFromError",value:function(e){return{errorMessage:e.message,hasError:!0}}}]),o}(v.Component);y.defaultProps={isEditor:!1},t.a=y},169:function(e,t,r){"use strict";var n=r(9),c=r.n(n),o=r(5),a=r.n(o),i=r(0),s=r(6),u=r.n(s),l=function(e){return"wc-block-components-payment-method-icon wc-block-components-payment-method-icon--".concat(e)},p=function(e){var t=e.id,r=e.src,n=void 0===r?null:r,c=e.alt,o=void 0===c?"":c;return n?Object(i.createElement)("img",{className:l(t),src:n,alt:o}):null},d=r(37),b=[{id:"alipay",alt:"Alipay",src:d.m+"payment-methods/alipay.svg"},{id:"amex",alt:"American Express",src:d.m+"payment-methods/amex.svg"},{id:"bancontact",alt:"Bancontact",src:d.m+"payment-methods/bancontact.svg"},{id:"diners",alt:"Diners Club",src:d.m+"payment-methods/diners.svg"},{id:"discover",alt:"Discover",src:d.m+"payment-methods/discover.svg"},{id:"eps",alt:"EPS",src:d.m+"payment-methods/eps.svg"},{id:"giropay",alt:"Giropay",src:d.m+"payment-methods/giropay.svg"},{id:"ideal",alt:"iDeal",src:d.m+"payment-methods/ideal.svg"},{id:"jcb",alt:"JCB",src:d.m+"payment-methods/jcb.svg"},{id:"laser",alt:"Laser",src:d.m+"payment-methods/laser.svg"},{id:"maestro",alt:"Maestro",src:d.m+"payment-methods/maestro.svg"},{id:"mastercard",alt:"Mastercard",src:d.m+"payment-methods/mastercard.svg"},{id:"multibanco",alt:"Multibanco",src:d.m+"payment-methods/multibanco.svg"},{id:"p24",alt:"Przelewy24",src:d.m+"payment-methods/p24.svg"},{id:"sepa",alt:"Sepa",src:d.m+"payment-methods/sepa.svg"},{id:"sofort",alt:"Sofort",src:d.m+"payment-methods/sofort.svg"},{id:"unionpay",alt:"Union Pay",src:d.m+"payment-methods/unionpay.svg"},{id:"visa",alt:"Visa",src:d.m+"payment-methods/visa.svg"},{id:"wechat",alt:"WeChat",src:d.m+"payment-methods/wechat.svg"}],m=r(38),f=r.n(m),O=r(72);function g(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function h(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?g(Object(r),!0).forEach((function(t){a()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):g(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}r(275),t.a=function(e){var t=e.icons,r=void 0===t?[]:t,n=e.align,o=void 0===n?"center":n,a=function(e){var t={};return e.forEach((function(e){var r={};"string"==typeof e&&(r={id:e,alt:e,src:null}),"object"===f()(e)&&(r={id:e.id||"",alt:e.alt||"",src:e.src||null}),r.id&&Object(O.c)(r.id)&&!t[r.id]&&(t[r.id]=r)})),Object.values(t)}(r);if(0===a.length)return null;var s=u()("wc-block-components-payment-method-icons",{"wc-block-components-payment-method-icons--align-left":"left"===o,"wc-block-components-payment-method-icons--align-right":"right"===o});return Object(i.createElement)("div",{className:s},a.map((function(e){var t,r=h(h({},e),(t=e.id,b.find((function(e){return e.id===t}))||{}));return Object(i.createElement)(p,c()({key:"payment-method-icon-"+e.id},r))})))}},174:function(e,t,r){"use strict";r.d(t,"b",(function(){return Z})),r.d(t,"a",(function(){return ee}));var n,c,o=r(33),a=r.n(o),i=r(8),s=r.n(i),u=r(0);!function(e){e.PRISTINE="pristine",e.STARTED="started",e.PROCESSING="processing",e.ERROR="has_error",e.FAILED="failed",e.SUCCESS="success",e.COMPLETE="complete"}(n||(n={})),function(e){e.SET_REGISTERED_PAYMENT_METHODS="set_registered_payment_methods",e.SET_REGISTERED_EXPRESS_PAYMENT_METHODS="set_registered_express_payment_methods",e.SET_SHOULD_SAVE_PAYMENT_METHOD="set_should_save_payment_method"}(c||(c={}));var l={currentStatus:n.PRISTINE,shouldSavePaymentMethod:!1,paymentMethodData:{payment_method:""},hasSavedToken:!1,errorMessage:"",paymentMethods:{},expressPaymentMethods:{}},p={setPaymentStatus:function(){return{pristine:function(){},started:function(){},processing:function(){},completed:function(){},error:function(e){},failed:function(e,t){},success:function(e,t){}}},currentStatus:{isPristine:!0,isStarted:!1,isProcessing:!1,isFinished:!1,hasError:!1,hasFailed:!1,isSuccessful:!1,isDoingExpressPayment:!1},paymentStatuses:n,paymentMethodData:{},errorMessage:"",activePaymentMethod:"",setActivePaymentMethod:function(){},activeSavedToken:"",setActiveSavedToken:function(){},customerPaymentMethods:{},paymentMethods:{},expressPaymentMethods:{},paymentMethodsInitialized:!1,expressPaymentMethodsInitialized:!1,onPaymentProcessing:function(){return function(){return function(){}}},setExpressPaymentError:function(){},isExpressPaymentMethodActive:!1,setShouldSavePayment:function(){},shouldSavePayment:!1},d=r(5),b=r.n(d),m=r(38),f=r.n(m);function O(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function g(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?O(Object(r),!0).forEach((function(t){b()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):O(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var h=function(e){return!("object"!==f()(e)||!e.isSavedToken)},v=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:l,t=arguments.length>1?arguments[1]:void 0,r=t.type,o=t.paymentMethodData,a=t.shouldSavePaymentMethod,i=void 0!==a&&a,s=t.errorMessage,u=void 0===s?"":s,p=t.paymentMethods,d=void 0===p?{}:p;switch(r){case n.STARTED:return g(g({},e),{},{currentStatus:n.STARTED,paymentMethodData:o||e.paymentMethodData,hasSavedToken:h(o||e.paymentMethodData)});case n.ERROR:return e.currentStatus!==n.ERROR?g(g({},e),{},{currentStatus:n.ERROR,errorMessage:u||e.errorMessage}):e;case n.FAILED:return e.currentStatus!==n.FAILED?g(g({},e),{},{currentStatus:n.FAILED,paymentMethodData:o||e.paymentMethodData,errorMessage:u||e.errorMessage}):e;case n.SUCCESS:return e.currentStatus!==n.SUCCESS?g(g({},e),{},{currentStatus:n.SUCCESS,paymentMethodData:o||e.paymentMethodData,hasSavedToken:h(o||e.paymentMethodData)}):e;case n.PROCESSING:return e.currentStatus!==n.PROCESSING?g(g({},e),{},{currentStatus:n.PROCESSING,errorMessage:""}):e;case n.COMPLETE:return e.currentStatus!==n.COMPLETE?g(g({},e),{},{currentStatus:n.COMPLETE}):e;case n.PRISTINE:return g(g({},l),{},{currentStatus:n.PRISTINE,paymentMethods:g({},e.paymentMethods),expressPaymentMethods:g({},e.expressPaymentMethods),shouldSavePaymentMethod:e.shouldSavePaymentMethod});case c.SET_REGISTERED_PAYMENT_METHODS:return g(g({},e),{},{paymentMethods:d});case c.SET_REGISTERED_EXPRESS_PAYMENT_METHODS:return g(g({},e),{},{expressPaymentMethods:d});case c.SET_SHOULD_SAVE_PAYMENT_METHOD:return g(g({},e),{},{shouldSavePaymentMethod:i})}},j=r(29),E=r.n(j),y=r(22),_=r.n(y),w=r(1),k=r(60),S=r(62),C=r(3),P=r(222),R=r(63),x=r(75),N=r(67),I=r(43),T=r(59),M=r(50);function A(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function D(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?A(Object(r),!0).forEach((function(t){b()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):A(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var L=function(e,t,r,n){var c=Object(u.useState)(!1),o=s()(c,2),a=o[0],i=o[1],l=Object(R.b)().isEditor,p=Object(x.b)().selectedRates,d=Object(N.b)(),m=d.billingData,O=d.shippingAddress,g=Object(S.a)(p),h=Object(S.a)(r),v=Object(I.a)(),j=v.cartTotals,y=v.cartNeedsShipping,k=v.paymentRequirements,M=Object(u.useRef)({cart:v,cartTotals:j,cartNeedsShipping:y,billingData:m,shippingAddress:O,selectedShippingMethods:g,paymentRequirements:k}),A=Object(T.a)().addErrorNotice;Object(u.useEffect)((function(){M.current={cart:v,cartTotals:j,cartNeedsShipping:y,billingData:m,shippingAddress:O,selectedShippingMethods:g,paymentRequirements:k}}),[v,j,y,m,O,g,k]);var L=Object(u.useCallback)(E()(_.a.mark((function r(){var c,o,a,s,u,p,d;return _.a.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:c={},o=function(e){c=D(D({},c),{},b()({},e.name,e))},a=0;case 3:if(!(a<h.length)){r.next=29;break}if(s=h[a],u=t[s]){r.next=8;break}return r.abrupt("continue",26);case 8:if(r.prev=8,!l){r.next=13;break}r.t0=!0,r.next=16;break;case 13:return r.next=15,Promise.resolve(u.canMakePayment(M.current));case 15:r.t0=r.sent;case 16:if(!(p=r.t0)){r.next=21;break}if("object"!==f()(p)||null===p||!p.error){r.next=20;break}throw new Error(p.error.message);case 20:o(u);case 21:r.next=26;break;case 23:r.prev=23,r.t1=r.catch(8),(C.CURRENT_USER_IS_ADMIN||l)&&(d=Object(w.sprintf)(
/* translators: %s the id of the payment method being registered (bank transfer, Stripe...) */
Object(w.__)("There was an error registering the payment method with id '%s': ",'woocommerce'),u.paymentMethodId),A("".concat(d," ").concat(r.t1),{context:n,id:"wc-".concat(u.paymentMethodId,"-registration-error")}));case 26:a++,r.next=3;break;case 29:e(c),i(!0);case 31:case"end":return r.stop()}}),r,null,[[8,23]])}))),[A,e,l,n,h,t]),B=Object(P.a)(L,500),V=s()(B,1)[0];return Object(u.useEffect)((function(){V()}),[V,v,g,m]),a},B=function(e){return{type:e}},V=function(e){return{type:n.ERROR,errorMessage:e}},F=function(e){var t=e.errorMessage,r=e.paymentMethodData;return{type:n.FAILED,errorMessage:t,paymentMethodData:r}},U=function(e){var t=e.paymentMethodData;return{type:n.SUCCESS,paymentMethodData:t}},z=function(e){var t=e.paymentMethodData;return{type:n.STARTED,paymentMethodData:t}},G=function(e){return{type:c.SET_REGISTERED_PAYMENT_METHODS,paymentMethods:e}},q=function(e){return{type:c.SET_REGISTERED_EXPRESS_PAYMENT_METHODS,paymentMethods:e}},H=function(e){return{type:c.SET_SHOULD_SAVE_PAYMENT_METHOD,shouldSavePaymentMethod:e}},Y=r(68),W=r(57),$=r(126),K=r(321),X=r(322),Q=r(132),J=Object(u.createContext)(p),Z=function(){return Object(u.useContext)(J)},ee=function(e){var t,r=e.children,c=Object(W.b)(),o=c.isProcessing,i=c.isIdle,p=c.isCalculating,d=c.hasError,b=Object(R.b)(),m=b.isEditor,O=b.getPreviewData,g=Object(Q.b)().setValidationErrors,h=Object(T.a)(),j=h.addErrorNotice,E=h.removeNotice,y=Object(M.c)(),_=y.isSuccessResponse,w=y.isErrorResponse,S=y.isFailResponse,P=y.noticeContexts,I=Object(u.useReducer)($.b,{}),A=s()(I,2),D=A[0],Z=(t=A[1],Object(u.useMemo)((function(){return{onPaymentProcessing:Object(K.a)("payment_processing",t)}}),[t])).onPaymentProcessing,ee=Object(u.useRef)(D);Object(u.useEffect)((function(){ee.current=D}),[D]);var te,re,ne,ce=Object(u.useReducer)(v,l),oe=s()(ce,2),ae=oe[0],ie=(te=oe[1],re=Object(N.b)().setBillingData,ne=Object(x.b)().setShippingAddress,{dispatchActions:Object(u.useMemo)((function(){return{setRegisteredPaymentMethods:function(e){te(G(e))},setRegisteredExpressPaymentMethods:function(e){te(q(e))},setShouldSavePayment:function(e){te(H(e))}}}),[te]),setPaymentStatus:Object(u.useCallback)((function(){return{pristine:function(){return te(B(n.PRISTINE))},started:function(e){te(z({paymentMethodData:e}))},processing:function(){return te(B(n.PROCESSING))},completed:function(){return te(B(n.COMPLETE))},error:function(e){return te(V(e))},failed:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;r&&re(r),te(F({errorMessage:e||"",paymentMethodData:t||{}}))},success:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;t&&re(t),void 0!==f()(r)&&null!=r&&r.address&&ne(r.address),te(U({paymentMethodData:e}))}}}),[te,re,ne])}),se=ie.dispatchActions,ue=ie.setPaymentStatus,le=function(e){var t=Object(k.getPaymentMethods)(),r=Object(M.c)().noticeContexts,n=new Set([].concat(a()(Object(C.getSetting)("paymentGatewaySortOrder",[])),a()(Object.keys(t))));return L(e,t,Array.from(n),r.PAYMENTS)}(se.setRegisteredPaymentMethods),pe=function(e){var t=Object(k.getExpressPaymentMethods)(),r=Object(M.c)().noticeContexts;return L(e,t,Object.keys(t),r.EXPRESS_PAYMENTS)}(se.setRegisteredExpressPaymentMethods),de=function(){var e=Object(Y.a)().dispatchCheckoutEvent,t=Object(u.useState)(""),r=s()(t,2),n=r[0],c=r[1],o=Object(u.useState)(""),a=s()(o,2),i=a[0],l=a[1];return Object(u.useEffect)((function(){e("set-active-payment-method",{activePaymentMethod:n})}),[e,n]),{activePaymentMethod:n,activeSavedToken:i,setActivePaymentMethod:c,setActiveSavedToken:l}}(),be=de.activePaymentMethod,me=de.activeSavedToken,fe=de.setActivePaymentMethod,Oe=de.setActiveSavedToken,ge=Object(u.useMemo)((function(){return m?O("previewSavedPaymentMethods"):le?function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(0===Object.keys(e).length)return{};var t=Object(C.getSetting)("customerPaymentMethods",{}),r=Object.keys(t),n={};return r.forEach((function(r){var c=t[r].filter((function(t){var r,n=t.method.gateway;return n in e&&(null===(r=e[n].supports)||void 0===r?void 0:r.showSavedCards)}));c.length&&(n[r]=c)})),n}(ae.paymentMethods):{}}),[m,O,le,ae.paymentMethods]),he=Object(u.useCallback)((function(e){e?j(e,{id:"wc-express-payment-error",context:P.EXPRESS_PAYMENTS}):E("wc-express-payment-error",P.EXPRESS_PAYMENTS)}),[j,P.EXPRESS_PAYMENTS,E]),ve=Object.keys(ae.expressPaymentMethods).includes(be),je=Object(u.useMemo)((function(){return{isPristine:ae.currentStatus===n.PRISTINE,isStarted:ae.currentStatus===n.STARTED,isProcessing:ae.currentStatus===n.PROCESSING,isFinished:[n.ERROR,n.FAILED,n.SUCCESS].includes(ae.currentStatus),hasError:ae.currentStatus===n.ERROR,hasFailed:ae.currentStatus===n.FAILED,isSuccessful:ae.currentStatus===n.SUCCESS,isDoingExpressPayment:ae.currentStatus!==n.PRISTINE&&ve}}),[ae.currentStatus,ve]);Object(u.useEffect)((function(){var e=Object.keys(ae.paymentMethods),t=[].concat(a()(e),a()(Object.keys(ae.expressPaymentMethods)));le&&e.length&&fe((function(e){return e&&t.includes(e)?e:(ue().pristine(),Object.keys(ae.paymentMethods)[0])}))}),[le,ae.paymentMethods,ae.expressPaymentMethods,fe,ue]),Object(u.useEffect)((function(){!o||d||p||je.isFinished||ue().processing()}),[o,d,p,je.isFinished,ue]),Object(u.useEffect)((function(){i&&!je.isSuccessful&&ue().pristine()}),[i,je.isSuccessful,ue]),Object(u.useEffect)((function(){d&&je.isSuccessful&&!ae.hasSavedToken&&ue().pristine()}),[d,je.isSuccessful,ae.hasSavedToken,ue]),Object(u.useEffect)((function(){je.isProcessing&&(E("wc-payment-error",P.PAYMENTS),Object(X.b)(ee.current,"payment_processing",{}).then((function(e){var t,r,n,c,o,a,i,s;if(e.forEach((function(e){_(e)&&(t=e),(w(e)||S(e))&&(r=e)})),t&&!r)ue().success(null===(n=t)||void 0===n||null===(c=n.meta)||void 0===c?void 0:c.paymentMethodData,null===(o=t)||void 0===o||null===(a=o.meta)||void 0===a?void 0:a.billingData,null===(i=t)||void 0===i||null===(s=i.meta)||void 0===s?void 0:s.shippingData);else if(r&&S(r)){var u,l,p,d,b,m;r.message&&r.message.length&&j(r.message,{id:"wc-payment-error",isDismissible:!1,context:(null===(m=r)||void 0===m?void 0:m.messageContext)||P.PAYMENTS}),ue().failed(null===(u=r)||void 0===u?void 0:u.message,null===(l=r)||void 0===l||null===(p=l.meta)||void 0===p?void 0:p.paymentMethodData,null===(d=r)||void 0===d||null===(b=d.meta)||void 0===b?void 0:b.billingData)}else if(r){var f,O;r.message&&r.message.length&&j(r.message,{id:"wc-payment-error",isDismissible:!1,context:(null===(O=r)||void 0===O?void 0:O.messageContext)||P.PAYMENTS}),ue().error(r.message),g(null===(f=r)||void 0===f?void 0:f.validationErrors)}else ue().success()})))}),[je.isProcessing,g,ue,E,P.PAYMENTS,_,S,w,j]);var Ee={setPaymentStatus:ue,currentStatus:je,paymentStatuses:n,paymentMethodData:ae.paymentMethodData,errorMessage:ae.errorMessage,activePaymentMethod:be,setActivePaymentMethod:fe,activeSavedToken:me,setActiveSavedToken:Oe,onPaymentProcessing:Z,customerPaymentMethods:ge,paymentMethods:ae.paymentMethods,expressPaymentMethods:ae.expressPaymentMethods,paymentMethodsInitialized:le,expressPaymentMethodsInitialized:pe,setExpressPaymentError:he,isExpressPaymentMethodActive:ve,shouldSavePayment:ae.shouldSavePaymentMethod,setShouldSavePayment:se.setShouldSavePayment};return Object(u.createElement)(J.Provider,{value:Ee},r)}},175:function(e,t){},179:function(e,t){},189:function(e,t){},190:function(e,t){},191:function(e,t){e.exports=window.wp.warning},195:function(e,t,r){"use strict";var n=r(33),c=r.n(n),o=r(0),a=r(1),i=r(4),s=r(14),u=r(39);t.a=function(e){var t=e.setPageId,r=e.pageId,n=e.labels,l=Object(s.useSelect)((function(e){return e("core").getEntityRecords("postType","page",{status:"publish",orderby:"title",order:"asc",per_page:100})}),[])||null;return l?Object(o.createElement)(i.PanelBody,{title:n.title},Object(o.createElement)(i.SelectControl,{label:Object(a.__)("Link to",'woocommerce'),value:r,options:[{label:n.default,value:0}].concat(c()(l.map((function(e){return{label:Object(u.a)(e,l),value:parseInt(e.id,10)}})))),onChange:function(e){return t(parseInt(e,10))}})):null}},196:function(e,t,r){"use strict";r.d(t,"a",(function(){return u}));var n=r(0),c=r(1),o=(r(2),r(66)),a=r(237),i=r(158),s=(r(258),function(e){var t=e.text,r=e.url,s=void 0===r?"https://ideas.woocommerce.com/forums/133476-woocommerce?category_id=384565":r;return Object(n.createElement)("div",{className:"wc-block-feedback-prompt"},Object(n.createElement)(o.a,{srcElement:a.a}),Object(n.createElement)("h2",{className:"wc-block-feedback-prompt__title"},Object(c.__)("Feedback?",'woocommerce')),Object(n.createElement)("p",{className:"wc-block-feedback-prompt__text"},t),Object(n.createElement)("a",{href:s,className:"wc-block-feedback-prompt__link",rel:"noreferrer noopener",target:"_blank"},Object(c.__)("Give us your feedback.",'woocommerce'),Object(n.createElement)(o.a,{srcElement:i.a,size:16})))}),u=function(){return Object(n.createElement)(s,{text:Object(c.__)("We are currently working on improving our cart and checkout blocks to provide merchants with the tools and customization options they need.",'woocommerce'),url:"https://github.com/woocommerce/woocommerce-gutenberg-products-block/issues/new?template=--cart-checkout-feedback.md"})}},197:function(e,t){e.exports=window.wp.plugins},198:function(e,t,r){"use strict";var n=r(5),c=r.n(n),o=r(8),a=r.n(o),i=r(0),s=r(1),u=r(283),l=r(163),p=r(63),d=r(174),b=r(56),m=r.n(b),f=r(168);function O(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function g(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?O(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):O(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}t.a=function(){var e=Object(p.b)().isEditor,t=Object(d.b)(),r=t.setActivePaymentMethod,n=t.setExpressPaymentError,c=t.activePaymentMethod,o=t.paymentMethodData,b=t.setPaymentStatus,O=Object(u.a)(),h=Object(l.a)().paymentMethods,v=Object(i.useRef)(c),j=Object(i.useRef)(o),E=Object(i.useCallback)((function(e){return function(){v.current=c,j.current=o,b().started({}),r(e)}}),[c,o,r,b]),y=Object(i.useCallback)((function(){b().pristine(),r(v.current),j.current.isSavedToken&&b().started(j.current)}),[r,b]),_=Object(i.useCallback)((function(e){b().error(e),n(e),r(v.current),j.current.isSavedToken&&b().started(j.current)}),[r,b,n]),w=Object(i.useCallback)((function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";m()("Express Payment Methods should use the provided onError handler instead.",{alternative:"onError",plugin:"woocommerce-gutenberg-products-block",link:"https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/4228"}),e?_(e):n("")}),[n,_]),k=Object.entries(h),S=k.length>0?k.map((function(t){var r=a()(t,2),n=r[0],c=r[1],o=e?c.edit:c.content;return Object(i.isValidElement)(o)?Object(i.createElement)("li",{key:n,id:"express-payment-method-".concat(n)},Object(i.cloneElement)(o,g(g({},O),{},{onClick:E(n),onClose:y,onError:_,setExpressPaymentError:w}))):null})):Object(i.createElement)("li",{key:"noneRegistered"},Object(s.__)("No registered Payment Methods",'woocommerce'));return Object(i.createElement)(f.a,{isEditor:e},Object(i.createElement)("ul",{className:"wc-block-components-express-payment__event-buttons"},S))}},200:function(e,t,r){"use strict";var n=r(16),c=r.n(n),o=r(0),a=r(1),i=r(64),s=r(83),u=r(27),l=r(500),p=r(43),d=r(63),b=r(6),m=r.n(b),f=r(25),O=r(41),g=r(8),h=r.n(g),v=r(34),j=r.n(v),E=r(134),y=r(68),_=function(e){var t;return null===(t=e.find((function(e){return e.selected})))||void 0===t?void 0:t.rate_id},w=r(167),k=r(129),S=r(47),C=r(53),P=r(3),R=function(e){var t=Object(P.getSetting)("displayCartPricesIncludingTax",!1)?parseInt(e.price,10)+parseInt(e.taxes,10):parseInt(e.price,10);return{label:Object(f.decodeEntities)(e.name),value:e.rate_id,description:Object(o.createElement)(o.Fragment,null,Number.isFinite(t)&&Object(o.createElement)(C.a,{currency:Object(S.getCurrencyFromPriceResponse)(e),value:t}),Number.isFinite(t)&&e.delivery_time?" — ":null,Object(f.decodeEntities)(e.delivery_time))}},x=function(e){var t=e.className,r=e.noResultsMessage,n=e.onSelectRate,c=e.rates,a=e.renderOption,i=void 0===a?R:a,s=e.selected;if(0===c.length)return r;if(c.length>1)return Object(o.createElement)(w.a,{className:t,onChange:function(e){n(e)},selected:s,options:c.map(i)});var u=i(c[0]),l=u.label,p=u.secondaryLabel,d=u.description,b=u.secondaryDescription;return Object(o.createElement)(k.a,{label:l,secondaryLabel:p,description:d,secondaryDescription:b})},N=(r(271),function(e){var t=e.packageId,r=e.className,n=e.noResultsMessage,c=e.renderOption,i=e.packageData,s=e.collapsible,l=void 0!==s&&s,p=e.collapse,d=void 0!==p&&p,b=e.showItems,g=void 0!==b&&b,v=function(e,t){var r=Object(y.a)().dispatchCheckoutEvent,n=Object(E.a)(),c=n.selectShippingRate,a=n.isSelectingRate,i=Object(o.useState)((function(){return _(t)})),s=h()(i,2),u=s[0],l=s[1],p=Object(o.useRef)(t);return Object(o.useEffect)((function(){j()(p.current,t)||(p.current=t,l(_(t)))}),[t]),{selectShippingRate:Object(o.useCallback)((function(t){l(t),c(t,e),r("set-selected-shipping-rate",{shippingRateId:t})}),[e,c,r]),selectedShippingRate:u,isSelectingRate:a}}(t,i.shipping_rates),w=v.selectShippingRate,k=v.selectedShippingRate,S=Object(o.createElement)(o.Fragment,null,(g||l)&&Object(o.createElement)("div",{className:"wc-block-components-shipping-rates-control__package-title"},i.name),g&&Object(o.createElement)("ul",{className:"wc-block-components-shipping-rates-control__package-items"},Object.values(i.items).map((function(e){var t=Object(f.decodeEntities)(e.name),r=e.quantity;return Object(o.createElement)("li",{key:e.key,className:"wc-block-components-shipping-rates-control__package-item"},Object(o.createElement)(O.a,{label:r>1?"".concat(t," × ").concat(r):"".concat(t),screenReaderLabel:Object(a.sprintf)(
/* translators: %1$s name of the product (ie: Sunglasses), %2$d number of units in the current cart package */
Object(a._n)("%1$s (%2$d unit)","%1$s (%2$d units)",r,'woocommerce'),t,r)}))})))),C=Object(o.createElement)(x,{className:r,noResultsMessage:n,rates:i.shipping_rates,onSelectRate:w,selected:k,renderOption:c});return l?Object(o.createElement)(u.Panel,{className:"wc-block-components-shipping-rates-control__package",initialOpen:!d,title:S},C):Object(o.createElement)("div",{className:m()("wc-block-components-shipping-rates-control__package",r)},S,C)}),I=["package_id"],T=["extensions","receiveCart"],M=function(e){var t=e.packages,r=e.collapse,n=e.showItems,a=e.collapsible,i=e.noResultsMessage,s=e.renderOption;return t.length?Object(o.createElement)(o.Fragment,null,t.map((function(e){var t=e.package_id,u=c()(e,I);return Object(o.createElement)(N,{key:t,packageId:t,packageData:u,collapsible:a,collapse:r,showItems:n,noResultsMessage:i,renderOption:s})}))):null};t.a=function(e){var t=e.shippingRates,r=e.shippingRatesLoading,n=e.className,b=e.collapsible,m=void 0!==b&&b,f=e.noResultsMessage,O=e.renderOption;Object(o.useEffect)((function(){if(!r){var e=Object(l.a)(t),n=Object(l.b)(t);1===e?Object(i.speak)(Object(a.sprintf)(
/* translators: %d number of shipping options found. */
Object(a._n)("%d shipping option was found.","%d shipping options were found.",n,'woocommerce'),n)):Object(i.speak)(Object(a.sprintf)(
/* translators: %d number of shipping packages packages. */
Object(a._n)("Shipping option searched for %d package.","Shipping options searched for %d packages.",e,'woocommerce'),e)+" "+Object(a.sprintf)(
/* translators: %d number of shipping options available. */
Object(a._n)("%d shipping option was found","%d shipping options were found",n,'woocommerce'),n))}}),[r,t]);var g=Object(p.a)(),h=g.extensions,v=(g.receiveCart,{className:n,collapsible:m,noResultsMessage:f,renderOption:O,extensions:h,cart:c()(g,T),components:{ShippingRatesControlPackage:N}}),j=Object(d.b)().isEditor;return Object(o.createElement)(s.a,{isLoading:r,screenReaderLabel:Object(a.__)("Loading shipping rates…",'woocommerce'),showSpinner:!0},j?Object(o.createElement)(M,{packages:t,noResultsMessage:f,renderOption:O}):Object(o.createElement)(o.Fragment,null,Object(o.createElement)(u.ExperimentalOrderShippingPackages.Slot,v),Object(o.createElement)(u.ExperimentalOrderShippingPackages,null,Object(o.createElement)(M,{packages:t,noResultsMessage:f,renderOption:O}))))}},201:function(e,t,r){"use strict";r.d(t,"a",(function(){return g}));var n=r(5),c=r.n(n),o=r(1),a=r(14),i=r(24),s=r(25),u=r(43),l=r(0);r(8),r(2),r(899),r(6),r(27),r(68),r(63);var p=Object(l.createContext)({notices:[],createSnackbarNotice:function(e,t){},removeSnackbarNotice:function(e,t){},setIsSuppressed:function(e){},context:"wc/core"});function d(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function b(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?d(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):d(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var m=r(132),f=r(59);function O(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}var g=function(){var e=Object(u.a)(),t=e.cartCoupons,r=e.cartIsLoading,n=Object(f.a)().addErrorNotice,d=function(){var e=Object(l.useContext)(p),t=e.notices,r=e.createSnackbarNotice,n=e.removeSnackbarNotice,c=e.setIsSuppressed,o=Object(l.useRef)(t);Object(l.useEffect)((function(){o.current=t}),[t]);var a=Object(l.useMemo)((function(){return{removeNotices:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;o.current.forEach((function(t){null!==e&&t.status!==e||n(t.id)}))},removeSnackbarNotice:n}}),[n]),i=Object(l.useMemo)((function(){return{addSnackbarNotice:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};r(e,t)}}}),[r]);return b(b(b({notices:t},a),i),{},{setIsSuppressed:c})}().addSnackbarNotice,g=Object(m.b)().setValidationErrors;return function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?O(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):O(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({appliedCoupons:t,isLoading:r},Object(a.useSelect)((function(e,t){var r=t.dispatch,c=e(i.CART_STORE_KEY),a=c.isApplyingCoupon(),u=c.isRemovingCoupon(),l=r(i.CART_STORE_KEY),p=l.applyCoupon,b=l.removeCoupon,m=l.receiveApplyingCoupon;return{applyCoupon:function(e){p(e).then((function(t){!0===t&&d(Object(o.sprintf)(
/* translators: %s coupon code. */
Object(o.__)('Coupon code "%s" has been applied to your cart.','woocommerce'),e),{id:"coupon-form"})})).catch((function(e){g({coupon:{message:Object(s.decodeEntities)(e.message),hidden:!1}}),m("")}))},removeCoupon:function(e){b(e).then((function(t){!0===t&&d(Object(o.sprintf)(
/* translators: %s coupon code. */
Object(o.__)('Coupon code "%s" has been removed from your cart.','woocommerce'),e),{id:"coupon-form"})})).catch((function(e){n(e.message,{id:"coupon-form"}),m("")}))},isApplyingCoupon:a,isRemovingCoupon:u}}),[n,d]))}},205:function(e,t){},206:function(e,t){},207:function(e,t){},208:function(e,t){},209:function(e,t){},21:function(e,t){e.exports=window.wp.compose},210:function(e,t){},218:function(e,t){},22:function(e,t){e.exports=window.regeneratorRuntime},220:function(e,t,r){"use strict";var n=r(9),c=r.n(n),o=r(16),a=r.n(o),i=r(0),s=(r(2),r(6)),u=r.n(s),l=r(1),p=r(66),d=r(305),b=(r(179),["text","screenReaderText","element","className","radius","children"]),m=function(e){var t=e.text,r=e.screenReaderText,n=void 0===r?"":r,o=e.element,s=void 0===o?"li":o,l=e.className,p=void 0===l?"":l,d=e.radius,m=void 0===d?"small":d,f=e.children,O=void 0===f?null:f,g=a()(e,b),h=s,v=u()(p,"wc-block-components-chip","wc-block-components-chip--radius-"+m),j=Boolean(n&&n!==t);return Object(i.createElement)(h,c()({className:v},g),Object(i.createElement)("span",{"aria-hidden":j,className:"wc-block-components-chip__text"},t),j&&Object(i.createElement)("span",{className:"screen-reader-text"},n),O)},f=["ariaLabel","className","disabled","onRemove","removeOnAnyClick","text","screenReaderText"];t.a=function(e){var t=e.ariaLabel,r=void 0===t?"":t,n=e.className,o=void 0===n?"":n,s=e.disabled,b=void 0!==s&&s,O=e.onRemove,g=void 0===O?function(){}:O,h=e.removeOnAnyClick,v=void 0!==h&&h,j=e.text,E=e.screenReaderText,y=void 0===E?"":E,_=a()(e,f),w=v?"span":"button";if(!r){var k=y&&"string"==typeof y?y:j;r="string"!=typeof k?
/* translators: Remove chip. */
Object(l.__)("Remove",'woocommerce'):Object(l.sprintf)(
/* translators: %s text of the chip to remove. */
Object(l.__)('Remove "%s"','woocommerce'),k)}var S={"aria-label":r,disabled:b,onClick:g,onKeyDown:function(e){"Backspace"!==e.key&&"Delete"!==e.key||g()}},C=v?S:{},P=v?{"aria-hidden":!0}:S;return Object(i.createElement)(m,c()({},_,C,{className:u()(o,"is-removable"),element:v?"button":_.element,screenReaderText:y,text:j}),Object(i.createElement)(w,c()({className:"wc-block-components-chip__remove"},P),Object(i.createElement)(p.a,{className:"wc-block-components-chip__remove-icon",srcElement:d.a,size:16})))}},23:function(e,t){e.exports=window.wp.url},234:function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));var n=r(0),c=(r(2),r(132)),o=(r(210),function(e){var t=e.errorMessage,r=void 0===t?"":t,o=e.propertyName,a=void 0===o?"":o,i=e.elementId,s=void 0===i?"":i,u=Object(c.b)(),l=u.getValidationError,p=u.getValidationErrorId;if(!r||"string"!=typeof r){var d=l(a)||{};if(!d.message||d.hidden)return null;r=d.message}return Object(n.createElement)("div",{className:"wc-block-components-validation-error",role:"alert"},Object(n.createElement)("p",{id:p(s)},r))})},235:function(e,t,r){"use strict";r.d(t,"a",(function(){return I}));var n=r(0),c=r(197),o=r(3),a=r(125),i=r(174),s=r(75),u=r(67),l=r(57),p=r(29),d=r.n(p),b=r(5),m=r.n(b),f=r(8),O=r.n(f),g=r(22),h=r.n(g),v=r(1),j=r(15),E=r.n(j),y=r(162),_=r(42),w=function(e,t,r){var n=Object.keys(e).map((function(t){return{key:t,value:e[t]}}),[]),c="wc-".concat(r,"-new-payment-method");return n.push({key:c,value:t}),n},k=function(e,t){E.a.setNonce&&"function"==typeof E.a.setNonce&&E.a.setNonce(e),null!=e&&e.get("X-WC-Store-API-User")&&t.setCustomerId(parseInt(e.get("X-WC-Store-API-User")||"0",10))},S=r(132),C=r(43),P=r(59);function R(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function x(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?R(Object(r),!0).forEach((function(t){m()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):R(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var N=function(){var e=Object(l.b)(),t=e.hasError,r=e.onCheckoutValidationBeforeProcessing,c=e.dispatchActions,o=e.redirectUrl,a=e.isProcessing,p=e.isBeforeProcessing,b=e.isComplete,m=e.orderNotes,f=e.shouldCreateAccount,g=e.extensionData,j=Object(S.b)().hasValidationErrors,R=Object(s.b)().shippingErrorStatus,N=Object(u.b)(),I=N.billingData,T=N.shippingAddress,M=Object(C.a)(),A=M.cartNeedsPayment,D=M.receiveCart,L=Object(i.b)(),B=L.activePaymentMethod,V=L.isExpressPaymentMethodActive,F=L.currentStatus,U=L.paymentMethodData,z=L.expressPaymentMethods,G=L.paymentMethods,q=L.shouldSavePayment,H=Object(P.a)(),Y=H.addErrorNotice,W=H.removeNotice,$=H.setIsSuppressed,K=Object(n.useRef)(I),X=Object(n.useRef)(T),Q=Object(n.useRef)(o),J=Object(n.useState)(!1),Z=O()(J,2),ee=Z[0],te=Z[1],re=Object(n.useMemo)((function(){var e,t=x(x({},z),G);return null==t||null===(e=t[B])||void 0===e?void 0:e.paymentMethodId}),[B,z,G]),ne=j&&!V||F.hasError||R.hasError,ce=!t&&!ne&&(F.isSuccessful||!A)&&a;Object(n.useEffect)((function(){$(V)}),[V,$]),Object(n.useEffect)((function(){ne===t||!a&&!p||V||c.setHasError(ne)}),[ne,t,a,p,V,c]),Object(n.useEffect)((function(){K.current=I,X.current=T,Q.current=o}),[I,T,o]);var oe=Object(n.useCallback)((function(){return!j&&(F.hasError?{errorMessage:Object(v.__)("There was a problem with your payment option.",'woocommerce')}:!R.hasError||{errorMessage:Object(v.__)("There was a problem with your shipping option.",'woocommerce')})}),[j,F.hasError,R.hasError]);Object(n.useEffect)((function(){var e;return V||(e=r(oe,0)),function(){V||e()}}),[r,oe,V]),Object(n.useEffect)((function(){Q.current&&(window.location.href=Q.current)}),[b]);var ae=Object(n.useCallback)(d()(h.a.mark((function e(){var t,r;return h.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!ee){e.next=2;break}return e.abrupt("return");case 2:te(!0),W("checkout"),t=A?{payment_method:re,payment_data:w(U,q,B)}:{},r=x(x({billing_address:Object(y.a)(K.current),shipping_address:Object(y.a)(X.current),customer_note:m,should_create_account:f},t),{},{extensions:x({},g)}),E()({path:"/wc/store/checkout",method:"POST",data:r,cache:"no-store",parse:!1}).then((function(e){if(k(e.headers,c),!e.ok)throw new Error(e);return e.json()})).then((function(e){c.setAfterProcessing(e),te(!1)})).catch((function(e){k(e.headers,c),e.json().then((function(e){var t,r,n;null!==(t=e.data)&&void 0!==t&&t.cart&&D(e.data.cart),Y(Object(_.b)(e),{id:"checkout"}),null===(r=e.additional_errors)||void 0===r||null===(n=r.forEach)||void 0===n||n.call(r,(function(e){Y(e.message,{id:e.error_code})})),c.setHasError(!0),c.setAfterProcessing(e),te(!1)}))}));case 7:case"end":return e.stop()}}),e)}))),[ee,W,m,f,A,re,U,q,B,g,c,Y,D]);return Object(n.useEffect)((function(){ce&&!ee&&ae()}),[ae,ce,ee]),null},I=function(e){var t=e.children,r=e.isCart,p=void 0!==r&&r,d=e.redirectUrl;return Object(n.createElement)(l.a,{redirectUrl:d,isCart:p},Object(n.createElement)(u.a,null,Object(n.createElement)(s.a,null,Object(n.createElement)(i.a,null,t,Object(n.createElement)(a.a,{renderError:o.CURRENT_USER_IS_ADMIN?null:function(){return null}},Object(n.createElement)(c.PluginArea,{scope:"woocommerce-checkout"})),Object(n.createElement)(N,null)))))}},237:function(e,t,r){"use strict";var n=r(0),c=r(28),o=Object(n.createElement)(c.SVG,{xmlns:"http://www.w3.org/2000/SVG",viewBox:"0 0 24 24"},Object(n.createElement)("path",{fill:"none",d:"M0 0h24v24H0V0z"}),Object(n.createElement)("path",{d:"M21.99 4c0-1.1-.89-2-1.99-2H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h14l4 4-.01-18zM20 4v13.17L18.83 16H4V4h16zM6 12h12v2H6zm0-3h12v2H6zm0-3h12v2H6z"}));t.a=o},24:function(e,t){e.exports=window.wc.wcBlocksData},25:function(e,t){e.exports=window.wp.htmlEntities},258:function(e,t){},259:function(e,t){},26:function(e,t){e.exports=window.wp.blocks},260:function(e,t){},261:function(e,t){},262:function(e,t){},263:function(e,t){},264:function(e,t){},265:function(e,t){},266:function(e,t){},267:function(e,t){},268:function(e,t){},269:function(e,t){},27:function(e,t){e.exports=window.wc.blocksCheckout},270:function(e,t){},271:function(e,t){},272:function(e,t){},273:function(e,t){},274:function(e,t){},275:function(e,t){},276:function(e,t){},28:function(e,t){e.exports=window.wp.primitives},281:function(e,t,r){"use strict";var n=r(38),c=r.n(n),o=r(0),a=r(1),i=r(64),s=r(6),u=r.n(s),l=r(46),p=r(72);r(365),t.a=function(e){var t=e.className,r=e.quantity,n=void 0===r?1:r,s=e.minimum,d=void 0===s?1:s,b=e.maximum,m=e.onChange,f=void 0===m?function(){}:m,O=e.itemName,g=void 0===O?"":O,h=e.disabled,v=u()("wc-block-components-quantity-selector",t),j=void 0!==b,E=n>d,y=!j||n<b,_=Object(o.useCallback)((function(e){var t=void 0!==c()(e.key)?"ArrowDown"===e.key:e.keyCode===l.DOWN,r=void 0!==c()(e.key)?"ArrowUp"===e.key:e.keyCode===l.UP;t&&E&&(e.preventDefault(),f(n-1)),r&&y&&(e.preventDefault(),f(n+1))}),[n,f,y,E]);return Object(o.createElement)("div",{className:v},Object(o.createElement)("input",{className:"wc-block-components-quantity-selector__input",disabled:h,type:"number",step:"1",min:"0",value:n,onKeyDown:_,onChange:function(e){var t=Object(p.a)(e.target.value)&&e.target.value?parseInt(e.target.value,10):0;j&&(t=Math.min(t,b)),(t=Math.max(t,d))!==n&&f(t)},"aria-label":Object(a.sprintf)(
/* translators: %s refers to the item name in the cart. */
Object(a.__)("Quantity of %s in your cart.",'woocommerce'),g)}),Object(o.createElement)("button",{"aria-label":Object(a.__)("Reduce quantity",'woocommerce'),className:"wc-block-components-quantity-selector__button wc-block-components-quantity-selector__button--minus",disabled:h||!E,onClick:function(){var e=n-1;f(e),Object(i.speak)(Object(a.sprintf)(
/* translators: %s refers to the item name in the cart. */
Object(a.__)("Quantity reduced to %s.",'woocommerce'),e))}},"-"),Object(o.createElement)("button",{"aria-label":Object(a.__)("Increase quantity",'woocommerce'),disabled:h||!y,className:"wc-block-components-quantity-selector__button wc-block-components-quantity-selector__button--plus",onClick:function(){var e=n+1;f(e),Object(i.speak)(Object(a.sprintf)(
/* translators: %s refers to the item name in the cart. */
Object(a.__)("Quantity increased to %s.",'woocommerce'),e))}},"+"))}},283:function(e,t,r){"use strict";r.d(t,"a",(function(){return x}));var n=r(1),c=r(47),o=r(0),a=r(6),i=r.n(a),s=r(28),u=Object(o.createElement)(s.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(o.createElement)("path",{fill:"none",d:"M0 0h24v24H0z"}),Object(o.createElement)("path",{d:"M4 10h3v7H4zM10.5 10h3v7h-3zM2 19h20v3H2zM17 10h3v7h-3zM12 1L2 6v2h20V6z"})),l=r(303),p=r(502),d=Object(o.createElement)(s.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(o.createElement)("g",{fill:"none",fillRule:"evenodd"},Object(o.createElement)("path",{d:"M0 0h24v24H0z"}),Object(o.createElement)("path",{fill:"#000",fillRule:"nonzero",d:"M17.3 8v1c1 .2 1.4.9 1.4 1.7h-1c0-.6-.3-1-1-1-.8 0-1.3.4-1.3.9 0 .4.3.6 1.4 1 1 .2 2 .6 2 1.9 0 .9-.6 1.4-1.5 1.5v1H16v-1c-.9-.1-1.6-.7-1.7-1.7h1c0 .6.4 1 1.3 1 1 0 1.2-.5 1.2-.8 0-.4-.2-.8-1.3-1.1-1.3-.3-2.1-.8-2.1-1.8 0-.9.7-1.5 1.6-1.6V8h1.3zM12 10v1H6v-1h6zm2-2v1H6V8h8zM2 4v16h20V4H2zm2 14V6h16v12H4z"}),Object(o.createElement)("path",{stroke:"#000",strokeLinecap:"round",d:"M6 16c2.6 0 3.9-3 1.7-3-2 0-1 3 1.5 3 1 0 1-.8 2.8-.8"}))),b=r(66),m=r(72),f=(r(276),{bank:u,bill:l.a,card:p.a,checkPayment:d}),O=function(e){var t=e.icon,r=void 0===t?"":t,n=e.text,c=void 0===n?"":n,a=!!r,s=Object(o.useCallback)((function(e){return a&&Object(m.c)(e)&&Object(m.d)(f,e)}),[a]),u=i()("wc-block-components-payment-method-label",{"wc-block-components-payment-method-label--with-icon":a});return Object(o.createElement)("span",{className:u},s(r)?Object(o.createElement)(b.a,{srcElement:f[r]}):r,c)},g=r(169),h=r(3),v=r(56),j=r.n(v),E=r(234),y=r(43),_=r(201),w=r(50),k=r(57),S=r(174),C=r(75),P=r(67),R=function(e,t){var r=[],c=function(t,r){var n=r+"_tax",c=Object(m.d)(e,r)&&Object(m.c)(e[r])?parseInt(e[r],10):0;return{key:r,label:t,value:c,valueWithTax:c+(Object(m.d)(e,n)&&Object(m.c)(e[n])?parseInt(e[n],10):0)}};return r.push(c(Object(n.__)("Subtotal:",'woocommerce'),"total_items")),r.push(c(Object(n.__)("Fees:",'woocommerce'),"total_fees")),r.push(c(Object(n.__)("Discount:",'woocommerce'),"total_discount")),r.push({key:"total_tax",label:Object(n.__)("Taxes:",'woocommerce'),value:parseInt(e.total_tax,10),valueWithTax:parseInt(e.total_tax,10)}),t&&r.push(c(Object(n.__)("Shipping:",'woocommerce'),"total_shipping")),r},x=function(){var e=Object(k.b)(),t=e.isCalculating,r=e.isComplete,a=e.isIdle,i=e.isProcessing,s=e.onCheckoutBeforeProcessing,u=e.onCheckoutValidationBeforeProcessing,l=e.onCheckoutAfterProcessingWithSuccess,p=e.onCheckoutAfterProcessingWithError,d=e.onSubmit,b=e.customerId,m=Object(S.b)(),f=m.currentStatus,v=m.activePaymentMethod,x=m.onPaymentProcessing,N=m.setExpressPaymentError,I=m.shouldSavePayment,T=Object(C.b)(),M=T.shippingErrorStatus,A=T.shippingErrorTypes,D=T.shippingRates,L=T.shippingRatesLoading,B=T.selectedRates,V=T.setSelectedRates,F=T.isSelectingRate,U=T.onShippingRateSuccess,z=T.onShippingRateFail,G=T.onShippingRateSelectSuccess,q=T.onShippingRateSelectFail,H=T.needsShipping,Y=Object(P.b)(),W=Y.billingData,$=Y.shippingAddress,K=Y.setShippingAddress,X=Object(y.a)().cartTotals,Q=Object(_.a)().appliedCoupons,J=Object(w.c)(),Z=J.noticeContexts,ee=J.responseTypes,te=Object(o.useRef)(R(X,H)),re=Object(o.useRef)({label:Object(n.__)("Total",'woocommerce'),value:parseInt(X.total_price,10)});Object(o.useEffect)((function(){te.current=R(X,H),re.current={label:Object(n.__)("Total",'woocommerce'),value:parseInt(X.total_price,10)}}),[X,H]);var ne=Object(o.useCallback)((function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";j()("setExpressPaymentError should only be used by Express Payment Methods (using the provided onError handler).",{alternative:"",plugin:"woocommerce-gutenberg-products-block",link:"https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/4228"}),N(e)}),[N]);return{activePaymentMethod:v,billing:{billingData:W,cartTotal:re.current,currency:Object(c.getCurrencyFromPriceResponse)(X),cartTotalItems:te.current,displayPricesIncludingTax:Object(h.getSetting)("displayCartPricesIncludingTax",!1),appliedCoupons:Q,customerId:b},checkoutStatus:{isCalculating:t,isComplete:r,isIdle:a,isProcessing:i},components:{ValidationInputError:E.a,PaymentMethodIcons:g.a,PaymentMethodLabel:O},emitResponse:{noticeContexts:Z,responseTypes:ee},eventRegistration:{onCheckoutBeforeProcessing:s,onCheckoutValidationBeforeProcessing:u,onCheckoutAfterProcessingWithSuccess:l,onCheckoutAfterProcessingWithError:p,onShippingRateSuccess:U,onShippingRateFail:z,onShippingRateSelectSuccess:G,onShippingRateSelectFail:q,onPaymentProcessing:x},onSubmit:d,paymentStatus:f,setExpressPaymentError:ne,shippingData:{shippingRates:D,shippingRatesLoading:L,selectedRates:B,setSelectedRates:V,isSelectingRate:F,shippingAddress:$,setShippingAddress:K,needsShipping:H},shippingStatus:{shippingErrorStatus:M,shippingErrorTypes:A},shouldSavePayment:I}}},285:function(e,t,r){"use strict";r.d(t,"b",(function(){return l})),r.d(t,"a",(function(){return p}));var n=r(8),c=r.n(n),o=r(0),a=(r(2),r(21)),i=r(6),s=r.n(i),u=Object(o.createContext)({hasContainerWidth:!1,containerClassName:"",isMobile:!1,isSmall:!1,isMedium:!1,isLarge:!1}),l=function(){return Object(o.useContext)(u)},p=function(e){var t=e.children,r=e.className,n=void 0===r?"":r,i=function(){var e=Object(a.useResizeObserver)(),t=c()(e,2),r=t[0],n=t[1].width,o="";return n>700?o="is-large":n>520?o="is-medium":n>400?o="is-small":n&&(o="is-mobile"),[r,o]}(),l=c()(i,2),p=l[0],d=l[1],b={hasContainerWidth:""!==d,containerClassName:d,isMobile:"is-mobile"===d,isSmall:"is-small"===d,isMedium:"is-medium"===d,isLarge:"is-large"===d};return Object(o.createElement)(u.Provider,{value:b},Object(o.createElement)("div",{className:s()(n,d)},p,t))}},286:function(e,t,r){"use strict";var n=r(9),c=r.n(n),o=r(5),a=r.n(o),i=r(8),s=r.n(i),u=r(16),l=r.n(u),p=r(0),d=r(1),b=r(11),m=r(6),f=r.n(m),O=r(132),g=r(57),h=r(234),v=r(21),j=r(72),E=r(41),y=(r(189),["className","id","type","ariaLabel","ariaDescribedBy","label","screenReaderLabel","disabled","help","autoCapitalize","autoComplete","value","onChange","required","onBlur","feedback"]),_=Object(b.forwardRef)((function(e,t){var r=e.className,n=e.id,o=e.type,a=void 0===o?"text":o,i=e.ariaLabel,u=e.ariaDescribedBy,d=e.label,b=e.screenReaderLabel,m=e.disabled,O=e.help,g=e.autoCapitalize,h=void 0===g?"off":g,v=e.autoComplete,j=void 0===v?"off":v,_=e.value,w=void 0===_?"":_,k=e.onChange,S=e.required,C=void 0!==S&&S,P=e.onBlur,R=void 0===P?function(){}:P,x=e.feedback,N=l()(e,y),I=Object(p.useState)(!1),T=s()(I,2),M=T[0],A=T[1];return Object(p.createElement)("div",{className:f()("wc-block-components-text-input",r,{"is-active":M||w})},Object(p.createElement)("input",c()({type:a,id:n,value:w,ref:t,autoCapitalize:h,autoComplete:j,onChange:function(e){k(e.target.value)},onFocus:function(){return A(!0)},onBlur:function(e){R(e.target.value),A(!1)},"aria-label":i||d,disabled:m,"aria-describedby":O&&!u?n+"__help":u,required:C},N)),Object(p.createElement)(E.a,{label:d,screenReaderLabel:b||d,wrapperElement:"label",wrapperProps:{htmlFor:n},htmlFor:n}),!!O&&Object(p.createElement)("p",{id:n+"__help",className:"wc-block-components-text-input__help"},O),x)})),w=["className","instanceId","id","ariaDescribedBy","errorId","validateOnMount","focusOnMount","onChange","showError","errorMessage"];t.a=Object(v.withInstanceId)((function(e){var t=e.className,r=e.instanceId,n=e.id,o=e.ariaDescribedBy,i=e.errorId,u=e.validateOnMount,m=void 0===u||u,v=e.focusOnMount,E=void 0!==v&&v,y=e.onChange,k=e.showError,S=void 0===k||k,C=e.errorMessage,P=void 0===C?"":C,R=l()(e,w),x=Object(b.useState)(!0),N=s()(x,2),I=N[0],T=N[1],M=Object(b.useRef)(null),A=Object(O.b)(),D=A.getValidationError,L=A.hideValidationError,B=A.setValidationErrors,V=A.clearValidationError,F=A.getValidationErrorId,U=Object(g.b)().isBeforeProcessing,z=void 0!==n?n:"textinput-"+r,G=void 0!==i?i:z,q=Object(b.useCallback)((function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=M.current||null;if(t){t.value=t.value.trim();var r=t.checkValidity();r?V(G):B(a()({},G,{message:t.validationMessage||Object(d.__)("Invalid value.",'woocommerce'),hidden:e}))}}),[V,G,B]);Object(b.useEffect)((function(){var e;I&&(E&&(null===(e=M.current)||void 0===e||e.focus()),T(!1))}),[E,I,T]),Object(b.useEffect)((function(){I&&(m&&q(),T(!1))}),[I,T,m,q]),Object(b.useEffect)((function(){U&&q()}),[U,q]),Object(b.useEffect)((function(){return function(){V(G)}}),[V,G]);var H=D(G)||{};Object(j.c)(P)&&""!==P&&(H.message=P);var Y=H.message&&!H.hidden,W=S&&Y&&F(G)?F(G):o;return Object(p.createElement)(_,c()({className:f()(t,{"has-error":Y}),"aria-invalid":!0===Y,id:z,onBlur:function(){q(!1)},feedback:S&&Object(p.createElement)(h.a,{errorMessage:P,propertyName:G}),ref:M,onChange:function(e){L(G),y(e)},ariaDescribedBy:W},R))}))},3:function(e,t){e.exports=window.wc.wcSettings},303:function(e,t,r){"use strict";var n=r(0),c=r(28),o=Object(n.createElement)(c.SVG,{xmlns:"http://www.w3.org/2000/SVG",viewBox:"0 0 24 24"},Object(n.createElement)("path",{fill:"none",d:"M0 0h24v24H0V0z"}),Object(n.createElement)("path",{d:"M11 17h2v-1h1c.55 0 1-.45 1-1v-3c0-.55-.45-1-1-1h-3v-1h4V8h-2V7h-2v1h-1c-.55 0-1 .45-1 1v3c0 .55.45 1 1 1h3v1H9v2h2v1zm9-13H4c-1.11 0-1.99.89-1.99 2L2 18c0 1.11.89 2 2 2h16c1.11 0 2-.89 2-2V6c0-1.11-.89-2-2-2zm0 14H4V6h16v12z"}));t.a=o},305:function(e,t,r){"use strict";var n=r(9),c=r.n(n),o=r(16),a=r.n(o),i=r(0),s=r(28),u=["className","size"],l=Object(i.createElement)((function(e){var t=e.className,r=e.size,n=a()(e,u);return Object(i.createElement)(s.SVG,c()({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",className:t,width:r,height:r},n),Object(i.createElement)("path",{d:"M14.95 6.46L11.41 10l3.54 3.54-1.41 1.41L10 11.42l-3.53 3.53-1.42-1.42L8.58 10 5.05 6.47l1.42-1.42L10 8.58l3.54-3.53z"}))}),null);t.a=l},307:function(e,t,r){"use strict";var n=r(9),c=r.n(n),o=r(0),a=r(25),i=r(3);t.a=function(e){var t=e.image,r=void 0===t?{}:t,n={src:r.thumbnail||i.PLACEHOLDER_IMG_SRC,alt:Object(a.decodeEntities)(r.alt)||""};return Object(o.createElement)("img",c()({},n,{alt:n.alt}))}},308:function(e,t,r){"use strict";var n=r(0),c=r(1),o=r(110);t.a=function(){return Object(n.createElement)(o.a,{className:"wc-block-components-product-backorder-badge"},Object(c.__)("Available on backorder",'woocommerce'))}},309:function(e,t,r){"use strict";var n=r(0),c=r(1),o=r(110);t.a=function(e){var t=e.lowStockRemaining;return t?Object(n.createElement)(o.a,{className:"wc-block-components-product-low-stock-badge"},Object(c.sprintf)(
/* translators: %d stock amount (number of items in stock for product) */
Object(c.__)("%d left in stock",'woocommerce'),t)):null}},311:function(e,t,r){"use strict";var n=r(0),c=r(7),o=r(25),a=(r(264),function(e){var t=e.details,r=void 0===t?[]:t;return Array.isArray(r)?0===(r=r.filter((function(e){return!e.hidden}))).length?null:Object(n.createElement)("ul",{className:"wc-block-components-product-details"},r.map((function(e){var t=e.name?"wc-block-components-product-details__".concat(Object(c.kebabCase)(e.name)):"";return Object(n.createElement)("li",{key:e.name+(e.display||e.value),className:t},e.name&&Object(n.createElement)(n.Fragment,null,Object(n.createElement)("span",{className:"wc-block-components-product-details__name"},Object(o.decodeEntities)(e.name),":")," "),Object(n.createElement)("span",{className:"wc-block-components-product-details__value"},Object(o.decodeEntities)(e.display||e.value)))}))):null}),i=r(155),s=r(37),u=function(e){var t=e.className,r=e.shortDescription,c=void 0===r?"":r,o=e.fullDescription,a=c||(void 0===o?"":o);return a?Object(n.createElement)(i.a,{className:t,source:a,maxLength:15,countType:s.o.wordCountType||"words"}):null};r(263),t.a=function(e){var t=e.shortDescription,r=void 0===t?"":t,c=e.fullDescription,o=void 0===c?"":c,i=e.itemData,s=void 0===i?[]:i,l=e.variation,p=void 0===l?[]:l;return Object(n.createElement)("div",{className:"wc-block-components-product-metadata"},Object(n.createElement)(u,{className:"wc-block-components-product-metadata__description",shortDescription:r,fullDescription:o}),Object(n.createElement)(a,{details:s}),Object(n.createElement)(a,{details:p.map((function(e){var t=e.attribute;return{name:void 0===t?"":t,value:e.value}}))}))}},321:function(e,t,r){"use strict";r.d(t,"a",(function(){return c}));var n=r(126),c=function(e,t){return function(r){var c=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10,o=n.a.addEventCallback(e,r,c);return t(o),function(){t(n.a.removeEventCallback(e,o.id))}}}},322:function(e,t,r){"use strict";r.d(t,"a",(function(){return b})),r.d(t,"b",(function(){return m}));var n=r(38),c=r.n(n),o=r(29),a=r.n(o),i=r(22),s=r.n(i),u=function(e,t){return e[t]?Array.from(e[t].values()).sort((function(e,t){return e.priority-t.priority})):[]},l=r(50);function p(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return d(e,void 0);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?d(e,void 0):void 0}}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,c=function(){};return{s:c,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:c}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,i=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){i=!0,o=e},f:function(){try{a||null==r.return||r.return()}finally{if(i)throw o}}}}function d(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var b=function(){var e=a()(s.a.mark((function e(t,r,n){var o,a,i,l,d,b;return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:o=u(t,r),a=[],i=p(o),e.prev=3,i.s();case 5:if((l=i.n()).done){e.next=19;break}return d=l.value,e.prev=7,e.next=10,Promise.resolve(d.callback(n));case 10:b=e.sent,"object"===c()(b)&&a.push(b),e.next=17;break;case 14:e.prev=14,e.t0=e.catch(7),console.error(e.t0);case 17:e.next=5;break;case 19:e.next=24;break;case 21:e.prev=21,e.t1=e.catch(3),i.e(e.t1);case 24:return e.prev=24,i.f(),e.finish(24);case 27:return e.abrupt("return",!a.length||a);case 28:case"end":return e.stop()}}),e,null,[[3,21,24,27],[7,14]])})));return function(_x,t,r){return e.apply(this,arguments)}}(),m=function(){var e=a()(s.a.mark((function e(t,r,n){var o,a,i,d,b,m;return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:o=[],a=u(t,r),i=p(a),e.prev=3,i.s();case 5:if((d=i.n()).done){e.next=28;break}return b=d.value,e.prev=7,e.next=10,Promise.resolve(b.callback(n));case 10:if(m=e.sent,"object"===c()(m)&&null!==m){e.next=13;break}return e.abrupt("continue",26);case 13:if(m.hasOwnProperty("type")){e.next=15;break}throw new Error("Returned objects from event emitter observers must return an object with a type property");case 15:if(!Object(l.a)(m)&&!Object(l.b)(m)){e.next=18;break}return o.push(m),e.abrupt("return",o);case 18:o.push(m),e.next=26;break;case 21:return e.prev=21,e.t0=e.catch(7),console.error(e.t0),o.push({type:"error"}),e.abrupt("return",o);case 26:e.next=5;break;case 28:e.next=33;break;case 30:e.prev=30,e.t1=e.catch(3),i.e(e.t1);case 33:return e.prev=33,i.f(),e.finish(33);case 36:return e.abrupt("return",o);case 37:case"end":return e.stop()}}),e,null,[[3,30,33,36],[7,21]])})));return function(t,r,n){return e.apply(this,arguments)}}()},34:function(e,t){e.exports=window.wp.isShallowEqual},361:function(e,t,r){"use strict";var n=r(0),c=r(28),o=Object(n.createElement)(c.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(n.createElement)("path",{fill:"none",d:"M0 0h24v24H0V0z"}),Object(n.createElement)("path",{d:"M15.55 13c.75 0 1.41-.41 1.75-1.03l3.58-6.49c.37-.66-.11-1.48-.87-1.48H5.21l-.94-2H1v2h2l3.6 7.59-1.35 2.44C4.52 15.37 5.48 17 7 17h12v-2H7l1.1-2h7.45zM6.16 6h12.15l-2.76 5H8.53L6.16 6zM7 18c-1.1 0-1.99.9-1.99 2S5.9 22 7 22s2-.9 2-2-.9-2-2-2zm10 0c-1.1 0-1.99.9-1.99 2s.89 2 1.99 2 2-.9 2-2-.9-2-2-2z"}));t.a=o},365:function(e,t){},369:function(e,t,r){"use strict";r.d(t,"a",(function(){return o})),r.d(t,"c",(function(){return a})),r.d(t,"b",(function(){return i}));var n,c=window.CustomEvent||null,o=function(e,t){var r=t.bubbles,n=void 0!==r&&r,o=t.cancelable,a=void 0!==o&&o,i=t.element,s=t.detail,u=void 0===s?{}:s;if(c){i||(i=document.body);var l=new c(e,{bubbles:n,cancelable:a,detail:u});i.dispatchEvent(l)}},a=function(){n&&clearTimeout(n),n=setTimeout((function(){o("wc_fragment_refresh",{bubbles:!0,cancelable:!0})}),50)},i=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if("function"!=typeof jQuery)return function(){};var c=function(){o(t,{bubbles:r,cancelable:n})};return jQuery(document).on(e,c),function(){return jQuery(document).off(e,c)}}},37:function(e,t,r){"use strict";r.d(t,"o",(function(){return o})),r.d(t,"m",(function(){return a})),r.d(t,"l",(function(){return i})),r.d(t,"n",(function(){return s})),r.d(t,"j",(function(){return u})),r.d(t,"e",(function(){return l})),r.d(t,"f",(function(){return p})),r.d(t,"g",(function(){return d})),r.d(t,"k",(function(){return b})),r.d(t,"c",(function(){return m})),r.d(t,"d",(function(){return f})),r.d(t,"h",(function(){return O})),r.d(t,"a",(function(){return g})),r.d(t,"i",(function(){return h})),r.d(t,"b",(function(){return v}));var n,c=r(3),o=Object(c.getSetting)("wcBlocksConfig",{buildPhase:1,pluginUrl:"",productCount:0,defaultAvatar:"",restApiRoutes:{},wordCountType:"words"}),a=o.pluginUrl+"images/",i=o.pluginUrl+"build/",s=o.buildPhase,u=null===(n=c.STORE_PAGES.shop)||void 0===n?void 0:n.permalink,l=c.STORE_PAGES.checkout.id,p=c.STORE_PAGES.checkout.permalink,d=c.STORE_PAGES.privacy.permalink,b=(c.STORE_PAGES.privacy.title,c.STORE_PAGES.terms.permalink),m=(c.STORE_PAGES.terms.title,c.STORE_PAGES.cart.id),f=c.STORE_PAGES.cart.permalink,O=(c.STORE_PAGES.myaccount.permalink?c.STORE_PAGES.myaccount.permalink:Object(c.getSetting)("wpLoginUrl","/wp-login.php"),Object(c.getSetting)("shippingCountries",{})),g=Object(c.getSetting)("allowedCountries",{}),h=Object(c.getSetting)("shippingStates",{}),v=Object(c.getSetting)("allowedStates",{})},371:function(e,t,r){"use strict";r.d(t,"a",(function(){return i}));var n=r(8),c=r.n(n),o=r(0),a={bottom:0,left:0,opacity:0,pointerEvents:"none",position:"absolute",right:0,top:0,zIndex:-1},i=function(){var e=Object(o.useState)(""),t=c()(e,2),r=t[0],n=t[1],i=Object(o.useRef)(null),s=Object(o.useRef)(new IntersectionObserver((function(e){e[0].isIntersecting?n("visible"):n(e[0].boundingClientRect.top>0?"below":"above")}),{threshold:1}));return Object(o.useLayoutEffect)((function(){var e=i.current,t=s.current;return e&&t.observe(e),function(){t.unobserve(e)}}),[]),[Object(o.createElement)("div",{"aria-hidden":!0,ref:i,style:a}),r]}},39:function(e,t,r){"use strict";r.d(t,"h",(function(){return b})),r.d(t,"e",(function(){return m})),r.d(t,"b",(function(){return f})),r.d(t,"i",(function(){return O})),r.d(t,"f",(function(){return g})),r.d(t,"c",(function(){return h})),r.d(t,"d",(function(){return v})),r.d(t,"g",(function(){return j})),r.d(t,"a",(function(){return E}));var n=r(5),c=r.n(n),o=r(23),a=r(15),i=r.n(a),s=r(7),u=r(3),l=r(37);function p(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function d(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?p(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):p(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var b=function(e){var t=e.selected,r=void 0===t?[]:t,n=e.search,c=void 0===n?"":n,a=e.queryArgs,u=function(e){var t=e.selected,r=void 0===t?[]:t,n=e.search,c=void 0===n?"":n,a=e.queryArgs,i=void 0===a?{}:a,s=l.o.productCount>100,u={per_page:s?100:0,catalog_visibility:"any",search:c,orderby:"title",order:"asc"},p=[Object(o.addQueryArgs)("/wc/store/products",d(d({},u),i))];return s&&r.length&&p.push(Object(o.addQueryArgs)("/wc/store/products",{catalog_visibility:"any",include:r,per_page:0})),p}({selected:r,search:c,queryArgs:void 0===a?{}:a});return Promise.all(u.map((function(e){return i()({path:e})}))).then((function(e){return Object(s.uniqBy)(Object(s.flatten)(e),"id").map((function(e){return d(d({},e),{},{parent:0})}))})).catch((function(e){throw e}))},m=function(e){return i()({path:"/wc/store/products/".concat(e)})},f=function(){return i()({path:"wc/store/products/attributes"})},O=function(e){return i()({path:"wc/store/products/attributes/".concat(e,"/terms")})},g=function(e){var t=e.selected,r=function(e){var t=e.selected,r=void 0===t?[]:t,n=e.search,c=Object(u.getSetting)("limitTags",!1),a=[Object(o.addQueryArgs)("wc/store/products/tags",{per_page:c?100:0,orderby:c?"count":"name",order:c?"desc":"asc",search:n})];return c&&r.length&&a.push(Object(o.addQueryArgs)("wc/store/products/tags",{include:r})),a}({selected:void 0===t?[]:t,search:e.search});return Promise.all(r.map((function(e){return i()({path:e})}))).then((function(e){return Object(s.uniqBy)(Object(s.flatten)(e),"id")}))},h=function(e){return i()({path:Object(o.addQueryArgs)("wc/store/products/categories",d({per_page:0},e))})},v=function(e){return i()({path:"wc/store/products/categories/".concat(e)})},j=function(e){return i()({path:Object(o.addQueryArgs)("wc/store/products",{per_page:0,type:"variation",parent:e})})},E=function(e,t){if(!e.title.raw)return e.slug;var r=1===t.filter((function(t){return t.title.raw===e.title.raw})).length;return e.title.raw+(r?"":" - ".concat(e.slug))}},4:function(e,t){e.exports=window.wp.components},41:function(e,t,r){"use strict";var n=r(5),c=r.n(n),o=r(0),a=r(6),i=r.n(a);function s(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function u(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?s(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):s(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}t.a=function(e){var t,r=e.label,n=e.screenReaderLabel,c=e.wrapperElement,a=e.wrapperProps,s=void 0===a?{}:a,l=null!=r,p=null!=n;return!l&&p?(t=c||"span",s=u(u({},s),{},{className:i()(s.className,"screen-reader-text")}),Object(o.createElement)(t,s,n)):(t=c||o.Fragment,l&&p&&r!==n?Object(o.createElement)(t,s,Object(o.createElement)("span",{"aria-hidden":"true"},r),Object(o.createElement)("span",{className:"screen-reader-text"},n)):Object(o.createElement)(t,s,r))}},42:function(e,t,r){"use strict";r.d(t,"a",(function(){return s})),r.d(t,"b",(function(){return u}));var n=r(29),c=r.n(n),o=r(22),a=r.n(o),i=r(1),s=function(){var e=c()(a.a.mark((function e(t){var r;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("function"!=typeof t.json){e.next=11;break}return e.prev=1,e.next=4,t.json();case 4:return r=e.sent,e.abrupt("return",{message:r.message,type:r.type||"api"});case 8:return e.prev=8,e.t0=e.catch(1),e.abrupt("return",{message:e.t0.message,type:"general"});case 11:return e.abrupt("return",{message:t.message,type:t.type||"general"});case 12:case"end":return e.stop()}}),e,null,[[1,8]])})));return function(_x){return e.apply(this,arguments)}}(),u=function(e){if(e.data&&"rest_invalid_param"===e.code){var t=Object.values(e.data.params);if(t[0])return t[0]}return(null==e?void 0:e.message)||Object(i.__)("Something went wrong. Please contact us to get assistance.",'woocommerce')}},43:function(e,t,r){"use strict";r.d(t,"a",(function(){return y}));var n=r(8),c=r.n(n),o=r(5),a=r.n(o),i=r(7),s=r(0),u=r(24),l=r(14),p=r(25),d=r(142),b=r(162),m=r(63);function f(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function O(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?f(Object(r),!0).forEach((function(t){a()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):f(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var g={first_name:"",last_name:"",company:"",address_1:"",address_2:"",city:"",state:"",postcode:"",country:"",phone:""},h=O(O({},g),{},{email:""}),v={total_items:"",total_items_tax:"",total_fees:"",total_fees_tax:"",total_discount:"",total_discount_tax:"",total_shipping:"",total_shipping_tax:"",total_price:"",total_tax:"",tax_lines:u.EMPTY_TAX_LINES,currency_code:"",currency_symbol:"",currency_minor_unit:2,currency_decimal_separator:"",currency_thousand_separator:"",currency_prefix:"",currency_suffix:""},j=function(e){return Object(d.a)(Object.entries(e).map((function(e){var t=c()(e,2),r=t[0],n=t[1];return[r,Object(p.decodeEntities)(n)]})))},E={cartCoupons:u.EMPTY_CART_COUPONS,cartItems:u.EMPTY_CART_ITEMS,cartFees:u.EMPTY_CART_FEES,cartItemsCount:0,cartItemsWeight:0,cartNeedsPayment:!0,cartNeedsShipping:!0,cartItemErrors:u.EMPTY_CART_ITEM_ERRORS,cartTotals:v,cartIsLoading:!0,cartErrors:u.EMPTY_CART_ERRORS,billingAddress:h,shippingAddress:g,shippingRates:u.EMPTY_SHIPPING_RATES,shippingRatesLoading:!1,cartHasCalculatedShipping:!1,paymentRequirements:u.EMPTY_PAYMENT_REQUIREMENTS,receiveCart:function(){},extensions:u.EMPTY_EXTENSIONS},y=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{shouldSelect:!0},t=Object(m.b)(),r=t.isEditor,n=t.previewData,c=null==n?void 0:n.previewCart,o=e.shouldSelect,a=Object(s.useRef)(),p=Object(l.useSelect)((function(e,t){var n=t.dispatch;if(!o)return E;if(r)return{cartCoupons:c.coupons,cartItems:c.items,cartFees:c.fees,cartItemsCount:c.items_count,cartItemsWeight:c.items_weight,cartNeedsPayment:c.needs_payment,cartNeedsShipping:c.needs_shipping,cartItemErrors:u.EMPTY_CART_ITEM_ERRORS,cartTotals:c.totals,cartIsLoading:!1,cartErrors:u.EMPTY_CART_ERRORS,billingAddress:h,shippingAddress:g,extensions:u.EMPTY_EXTENSIONS,shippingRates:c.shipping_rates,shippingRatesLoading:!1,cartHasCalculatedShipping:c.has_calculated_shipping,paymentRequirements:c.paymentRequirements,receiveCart:"function"==typeof(null==c?void 0:c.receiveCart)?c.receiveCart:function(){}};var a=e(u.CART_STORE_KEY),i=a.getCartData(),s=a.getCartErrors(),l=a.getCartTotals(),p=!a.hasFinishedResolution("getCartData"),d=a.isCustomerDataUpdating(),m=n(u.CART_STORE_KEY).receiveCart,f=j(i.billingAddress),v=i.needsShipping?j(i.shippingAddress):f,y=i.fees.length>0?i.fees.map((function(e){return j(e)})):u.EMPTY_CART_FEES;return{cartCoupons:i.coupons.length>0?i.coupons.map((function(e){return O(O({},e),{},{label:e.code})})):u.EMPTY_CART_COUPONS,cartItems:i.items,cartFees:y,cartItemsCount:i.itemsCount,cartItemsWeight:i.itemsWeight,cartNeedsPayment:i.needsPayment,cartNeedsShipping:i.needsShipping,cartItemErrors:i.errors,cartTotals:l,cartIsLoading:p,cartErrors:s,billingAddress:Object(b.a)(f),shippingAddress:Object(b.a)(v),extensions:i.extensions,shippingRates:i.shippingRates,shippingRatesLoading:d,cartHasCalculatedShipping:i.hasCalculatedShipping,paymentRequirements:i.paymentRequirements,receiveCart:m}}),[o]);return a.current&&Object(i.isEqual)(a.current,p)||(a.current=p),a.current}},44:function(e,t,r){},46:function(e,t){e.exports=window.wp.keycodes},47:function(e,t){e.exports=window.wc.priceFormat},494:function(e,t,r){"use strict";var n=r(0),c=r(6),o=r.n(c),a=(r(2),r(285));r(261),t.a=function(e){var t=e.children,r=e.className;return Object(n.createElement)(a.a,{className:o()("wc-block-components-sidebar-layout",r)},t)}},495:function(e,t,r){"use strict";var n=r(0),c=r(6),o=r.n(c);r(2),t.a=function(e){var t=e.children,r=e.className;return Object(n.createElement)("div",{className:o()("wc-block-components-main",r)},t)}},496:function(e,t,r){"use strict";var n=r(0),c=r(6),o=r.n(c);r(2),t.a=function(e){var t=e.children,r=e.className;return Object(n.createElement)("div",{className:o()("wc-block-components-sidebar",r)},t)}},497:function(e,t,r){"use strict";var n=r(0),c=r(1),o=r(83),a=r(220),i=(r(2),r(27)),s=r(3),u=(r(265),{context:"summary"});t.a=function(e){var t=e.cartCoupons,r=void 0===t?[]:t,l=e.currency,p=e.isRemovingCoupon,d=e.removeCoupon,b=e.values,m=b.total_discount,f=b.total_discount_tax,O=parseInt(m,10);if(!O&&0===r.length)return null;var g=parseInt(f,10),h=Object(s.getSetting)("displayCartPricesIncludingTax",!1)?O+g:O,v=Object(i.__experimentalApplyCheckoutFilter)({arg:u,filterName:"coupons",defaultValue:r});return Object(n.createElement)(i.TotalsItem,{className:"wc-block-components-totals-discount",currency:l,description:0!==v.length&&Object(n.createElement)(o.a,{screenReaderLabel:Object(c.__)("Removing coupon…",'woocommerce'),isLoading:p,showSpinner:!1},Object(n.createElement)("ul",{className:"wc-block-components-totals-discount__coupon-list"},v.map((function(e){return Object(n.createElement)(a.a,{key:"coupon-"+e.code,className:"wc-block-components-totals-discount__coupon-list-item",text:e.label,screenReaderText:Object(c.sprintf)(
/* translators: %s Coupon code. */
Object(c.__)("Coupon: %s",'woocommerce'),e.label),disabled:p,onRemove:function(){d(e.code)},radius:"large",ariaLabel:Object(c.sprintf)(
/* translators: %s is a coupon code. */
Object(c.__)('Remove coupon "%s"','woocommerce'),e.label)})})))),label:h?Object(c.__)("Discount",'woocommerce'):Object(c.__)("Coupons",'woocommerce'),value:h?-1*h:"-"})}},498:function(e,t,r){"use strict";var n=r(8),c=r.n(n),o=r(0),a=r(1),i=r(90),s=r(286),u=r(41),l=r(83),p=(r(2),r(21)),d=r(132),b=r(234),m=r(27);r(266),t.a=Object(p.withInstanceId)((function(e){var t=e.instanceId,r=e.isLoading,n=void 0!==r&&r,p=e.initialOpen,f=void 0!==p&&p,O=e.onSubmit,g=void 0===O?function(){}:O,h=Object(o.useState)(""),v=c()(h,2),j=v[0],E=v[1],y=Object(o.useRef)(!1),_=Object(d.b)(),w=_.getValidationError,k=_.getValidationErrorId,S=w("coupon");Object(o.useEffect)((function(){y.current!==n&&(n||!j||S||E(""),y.current=n)}),[n,j,S]);var C="wc-block-components-totals-coupon__input-".concat(t);return Object(o.createElement)(m.Panel,{className:"wc-block-components-totals-coupon",hasBorder:!1,initialOpen:f,title:Object(o.createElement)(u.a,{label:Object(a.__)("Coupon code",'woocommerce'),screenReaderLabel:Object(a.__)("Apply a coupon code",'woocommerce'),htmlFor:C})},Object(o.createElement)(l.a,{screenReaderLabel:Object(a.__)("Applying coupon…",'woocommerce'),isLoading:n,showSpinner:!1},Object(o.createElement)("div",{className:"wc-block-components-totals-coupon__content"},Object(o.createElement)("form",{className:"wc-block-components-totals-coupon__form"},Object(o.createElement)(s.a,{id:C,errorId:"coupon",className:"wc-block-components-totals-coupon__input",label:Object(a.__)("Enter code",'woocommerce'),value:j,ariaDescribedBy:k(C),onChange:function(e){E(e)},validateOnMount:!1,focusOnMount:!0,showError:!1}),Object(o.createElement)(i.a,{className:"wc-block-components-totals-coupon__button",disabled:n||!j,showSpinner:n,onClick:function(e){e.preventDefault(),g(j)},type:"submit"},Object(a.__)("Apply",'woocommerce'))),Object(o.createElement)(b.a,{propertyName:"coupon",elementId:C}))))}))},50:function(e,t,r){"use strict";r.d(t,"a",(function(){return s})),r.d(t,"b",(function(){return u})),r.d(t,"c",(function(){return p}));var n,c,o=r(72);!function(e){e.SUCCESS="success",e.FAIL="failure",e.ERROR="error"}(n||(n={})),function(e){e.PAYMENTS="wc/payment-area",e.EXPRESS_PAYMENTS="wc/express-payment-area"}(c||(c={}));var a=function(e,t){return Object(o.b)(e)&&"type"in e&&e.type===t},i=function(e){return a(e,n.SUCCESS)},s=function(e){return a(e,n.ERROR)},u=function(e){return a(e,n.FAIL)},l=function(e){return!Object(o.b)(e)||void 0===e.retry||!0===e.retry},p=function(){return{responseTypes:n,noticeContexts:c,shouldRetry:l,isSuccessResponse:i,isErrorResponse:s,isFailResponse:u}}},500:function(e,t,r){"use strict";r.d(t,"a",(function(){return n})),r.d(t,"b",(function(){return c}));var n=function(e){return e.length},c=function(e){return e.reduce((function(e,t){return e+t.shipping_rates.length}),0)}},501:function(e,t,r){"use strict";var n=r(16),c=r.n(n),o=r(0),a=r(1),i=r(53),s=(r(2),r(27)),u=r(43),l=r(3),p=(r(273),["receiveCart"]);t.a=function(e){var t=e.currency,r=e.values,n=Object(l.getSetting)("taxesEnabled",!0)&&Object(l.getSetting)("displayCartPricesIncludingTax",!1),d=r.total_price,b=r.total_tax,m=Object(u.a)(),f=(m.receiveCart,c()(m,p)),O=Object(s.__experimentalApplyCheckoutFilter)({filterName:"totalLabel",defaultValue:Object(a.__)("Total",'woocommerce'),extensions:f.extensions,arg:{cart:f}}),g=parseInt(b,10);return Object(o.createElement)(s.TotalsItem,{className:"wc-block-components-totals-footer-item",currency:t,label:O,value:parseInt(d,10),description:n&&0!==g&&Object(o.createElement)("p",{className:"wc-block-components-totals-footer-item-tax"},Object(o.createInterpolateElement)(Object(a.__)("Including <TaxAmount/> in taxes",'woocommerce'),{TaxAmount:Object(o.createElement)(i.a,{className:"wc-block-components-totals-footer-item-tax-value",currency:t,value:g})}))})}},502:function(e,t,r){"use strict";var n=r(0),c=r(28),o=Object(n.createElement)(c.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(n.createElement)("path",{fill:"none",d:"M0 0h24v24H0V0z"}),Object(n.createElement)("path",{fill:"currentColor",d:"M20 4H4c-1.11 0-1.99.89-1.99 2L2 18c0 1.11.89 2 2 2h16c1.11 0 2-.89 2-2V6c0-1.11-.89-2-2-2zm0 14H4v-6h16v6zm0-10H4V6h16v2z"}));t.a=o},504:function(e,t,r){"use strict";var n=r(5),c=r.n(n),o=r(0),a=r(286),i=r(9),s=r.n(i),u=r(37),l=r(1),p=r(25),d=r(6),b=r.n(d),m=r(21),f=r(898),O=r(132),g=r(234),h=r(72),v=(r(269),Object(m.withInstanceId)((function(e){var t=e.id,r=e.className,n=e.label,a=e.onChange,i=e.options,s=e.value,u=e.required,p=void 0!==u&&u,d=e.errorMessage,m=void 0===d?Object(l.__)("Please select a value.",'woocommerce'):d,v=e.errorId,j=e.instanceId,E=void 0===j?"0":j,y=e.autoComplete,_=void 0===y?"off":y,w=Object(O.b)(),k=w.getValidationError,S=w.setValidationErrors,C=w.clearValidationError,P=Object(o.useRef)(null),R=t||"control-"+E,x=v||R,N=k(x)||{message:"",hidden:!1};return Object(o.useEffect)((function(){return!p||s?C(x):S(c()({},x,{message:m,hidden:!0})),function(){C(x)}}),[C,s,x,m,p,S]),Object(o.createElement)("div",{id:R,className:b()("wc-block-components-combobox",r,{"is-active":s,"has-error":N.message&&!N.hidden}),ref:P},Object(o.createElement)(f.a,{className:"wc-block-components-combobox-control",label:n,onChange:a,onFilterValueChange:function(e){if(e.length){var t=Object(h.b)(P.current)?P.current.ownerDocument.activeElement:void 0;if(t&&Object(h.b)(P.current)&&P.current.contains(t))return;var r=e.toLocaleUpperCase(),n=i.find((function(e){return e.label.toLocaleUpperCase().startsWith(r)||e.value.toLocaleUpperCase()===r}));n&&a(n.value)}},options:i,value:s||"",allowReset:!1,autoComplete:_,"aria-invalid":N.message&&!N.hidden}),Object(o.createElement)(g.a,{propertyName:x}))}))),j=(r(268),function(e){var t=e.className,r=e.countries,n=e.id,c=e.label,a=e.onChange,i=e.value,s=void 0===i?"":i,u=e.autoComplete,d=void 0===u?"off":u,m=e.required,f=void 0!==m&&m,O=e.errorId,g=e.errorMessage,h=void 0===g?Object(l.__)("Please select a country.",'woocommerce'):g,j=Object(o.useMemo)((function(){return Object.keys(r).map((function(e){return{value:e,label:Object(p.decodeEntities)(r[e])}}))}),[r]);return Object(o.createElement)("div",{className:b()(t,"wc-block-components-country-input")},Object(o.createElement)(v,{id:n,label:c,onChange:a,options:j,value:s,errorId:O,errorMessage:h,required:f,autoComplete:d}),"off"!==d&&Object(o.createElement)("input",{type:"text","aria-hidden":!0,autoComplete:d,value:s,onChange:function(e){var t=e.target.value.toLocaleUpperCase(),r=j.find((function(e){return 2!==t.length&&e.label.toLocaleUpperCase()===t||2===t.length&&e.value.toLocaleUpperCase()===t}));a(r?r.value:"")},style:{minHeight:"0",height:"0",border:"0",padding:"0",position:"absolute"},tabIndex:-1}))}),E=function(e){return Object(o.createElement)(j,s()({countries:u.h},e))},y=function(e){return Object(o.createElement)(j,s()({countries:u.a},e))},_=(r(270),function(e,t){var r=t.find((function(t){return t.label.toLocaleUpperCase()===e.toLocaleUpperCase()||t.value.toLocaleUpperCase()===e.toLocaleUpperCase()}));return r?r.value:""}),w=function(e){var t=e.className,r=e.id,n=e.states,c=e.country,i=e.label,s=e.onChange,u=e.autoComplete,d=void 0===u?"off":u,m=e.value,f=void 0===m?"":m,O=e.required,g=void 0!==O&&O,h=n[c],j=Object(o.useMemo)((function(){return h?Object.keys(h).map((function(e){return{value:e,label:Object(p.decodeEntities)(h[e])}})):[]}),[h]),E=Object(o.useCallback)((function(e){s(j.length>0?_(e,j):e)}),[s,j]),y=Object(o.useRef)(f);return Object(o.useEffect)((function(){y.current!==f&&(y.current=f)}),[f]),Object(o.useEffect)((function(){if(j.length>0&&y.current){var e=_(y.current,j);e!==y.current&&E(e)}}),[j,E]),j.length>0?Object(o.createElement)(o.Fragment,null,Object(o.createElement)(v,{className:b()(t,"wc-block-components-state-input"),id:r,label:i,onChange:E,options:j,value:f,errorMessage:Object(l.__)("Please select a state.",'woocommerce'),required:g,autoComplete:d}),"off"!==d&&Object(o.createElement)("input",{type:"text","aria-hidden":!0,autoComplete:d,value:f,onChange:function(e){return E(e.target.value)},style:{minHeight:"0",height:"0",border:"0",padding:"0",position:"absolute"},tabIndex:-1})):Object(o.createElement)(a.a,{className:t,id:r,label:i,onChange:E,autoComplete:d,value:f,required:g})},k=function(e){return Object(o.createElement)(w,s()({states:u.i},e))},S=function(e){return Object(o.createElement)(w,s()({states:u.b},e))},C=r(62),P=r(3),R=r(113);function x(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function N(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?x(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):x(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}t.a=Object(m.withInstanceId)((function(e){var t=e.id,r=e.fields,n=void 0===r?Object.keys(P.defaultAddressFields):r,i=e.fieldConfig,s=void 0===i?{}:i,u=e.instanceId,p=e.onChange,d=e.type,b=void 0===d?"shipping":d,m=e.values,f=Object(O.b)(),g=f.getValidationError,h=f.setValidationErrors,v=f.clearValidationError,j=Object(C.a)(n),_=g("shipping-missing-country")||{},w=Object(o.useMemo)((function(){return Object(R.a)(j,s,m.country)}),[j,s,m.country]);return Object(o.useEffect)((function(){w.forEach((function(e){e.hidden&&m[e.key]&&p(N(N({},m),{},c()({},e.key,"")))}))}),[w,p,m]),Object(o.useEffect)((function(){"shipping"===b&&function(e,t,r,n){n||e.country||!(e.city||e.state||e.postcode)||t({"shipping-missing-country":{message:Object(l.__)("Please select a country to calculate rates.",'woocommerce'),hidden:!1}}),n&&e.country&&r("shipping-missing-country")}(m,h,v,!!_.message&&!_.hidden)}),[m,_.message,_.hidden,h,v,b]),t=t||u,Object(o.createElement)("div",{id:t,className:"wc-block-components-address-form"},w.map((function(e){if(e.hidden)return null;if("country"===e.key){var r="shipping"===b?E:y;return Object(o.createElement)(r,{key:e.key,id:"".concat(t,"-").concat(e.key),label:e.required?e.label:e.optionalLabel,value:m.country,autoComplete:e.autocomplete,onChange:function(e){return p(N(N({},m),{},{country:e,state:""}))},errorId:"shipping"===b?"shipping-missing-country":null,errorMessage:e.errorMessage,required:e.required})}if("state"===e.key){var n="shipping"===b?k:S;return Object(o.createElement)(n,{key:e.key,id:"".concat(t,"-").concat(e.key),country:m.country,label:e.required?e.label:e.optionalLabel,value:m.state,autoComplete:e.autocomplete,onChange:function(e){return p(N(N({},m),{},{state:e}))},errorMessage:e.errorMessage,required:e.required})}return Object(o.createElement)(a.a,{key:e.key,id:"".concat(t,"-").concat(e.key),className:"wc-block-components-address-form__".concat(e.key),label:e.required?e.label:e.optionalLabel,value:m[e.key],autoCapitalize:e.autocapitalize,autoComplete:e.autocomplete,onChange:function(t){return p(N(N({},m),{},c()({},e.key,t)))},errorMessage:e.errorMessage,required:e.required})})))}))},510:function(e,t,r){"use strict";var n=r(9),c=r.n(n),o=r(8),a=r.n(o),i=r(0),s=r(6),u=r.n(s),l=r(1),p=r(43),d=r(27),b=r(3),m=function(e){var t=e.selectedShippingRates;return Object(i.createElement)("div",{className:"wc-block-components-totals-item__description wc-block-components-totals-shipping__via"},Object(l.__)("via",'woocommerce')," ",t.join(", "))},f=r(890),O=r(200),g=function(e){var t=e.hasRates,r=e.shippingRates,n=e.shippingRatesLoading,c=t?Object(l.__)("Shipping options",'woocommerce'):Object(l.__)("Choose a shipping option",'woocommerce');return Object(i.createElement)("fieldset",{className:"wc-block-components-totals-shipping__fieldset"},Object(i.createElement)("legend",{className:"screen-reader-text"},c),Object(i.createElement)(O.a,{className:"wc-block-components-totals-shipping__options",collapsible:!0,noResultsMessage:Object(i.createElement)(f.a,{isDismissible:!1,className:u()("wc-block-components-shipping-rates-control__no-results-notice","woocommerce-error")},Object(l.__)("No shipping options were found.",'woocommerce')),shippingRates:r,shippingRatesLoading:n}))},h=r(75),v=r(90),j=r(34),E=r.n(j),y=r(132),_=(r(190),r(504)),w=function(e){var t=e.address,r=e.onUpdate,n=e.addressFields,c=Object(i.useState)(t),o=a()(c,2),s=o[0],u=o[1],p=Object(y.b)(),d=p.hasValidationErrors,b=p.showAllValidationErrors;return Object(i.createElement)("form",{className:"wc-block-components-shipping-calculator-address"},Object(i.createElement)(_.a,{fields:n,onChange:u,values:s}),Object(i.createElement)(v.a,{className:"wc-block-components-shipping-calculator-address__button",disabled:E()(s,t),onClick:function(e){if(e.preventDefault(),b(),!d)return r(s)},type:"submit"},Object(l.__)("Update",'woocommerce')))},k=function(e){var t=e.onUpdate,r=void 0===t?function(){}:t,n=e.addressFields,c=void 0===n?["country","state","city","postcode"]:n,o=Object(h.b)(),a=o.shippingAddress,s=o.setShippingAddress;return Object(i.createElement)("div",{className:"wc-block-components-shipping-calculator"},Object(i.createElement)(w,{address:a,addressFields:c,onUpdate:function(e){s(e),r(e)}}))},S=r(38),C=r.n(S),P=r(25),R=function(e){var t=e.address;if(0===Object.values(t).length)return null;var r=Object(b.getSetting)("shippingCountries",{}),n=Object(b.getSetting)("shippingStates",{}),c="string"==typeof r[t.country]?Object(P.decodeEntities)(r[t.country]):"",o="object"===C()(n[t.country])&&"string"==typeof n[t.country][t.state]?Object(P.decodeEntities)(n[t.country][t.state]):t.state,a=[];a.push(t.postcode.toUpperCase()),a.push(t.city),a.push(o),a.push(c);var s=a.filter(Boolean).join(", ");return s?Object(i.createElement)("span",{className:"wc-block-components-shipping-address"},Object(l.sprintf)(
/* translators: %s location. */
Object(l.__)("Shipping to %s",'woocommerce'),s)+" "):null},x=(r(267),function(e){var t=e.label,r=void 0===t?Object(l.__)("Calculate",'woocommerce'):t,n=e.isShippingCalculatorOpen,c=e.setIsShippingCalculatorOpen;return Object(i.createElement)("button",{className:"wc-block-components-totals-shipping__change-address-button",onClick:function(){c(!n)},"aria-expanded":n},r)}),N=function(e){var t=e.showCalculator,r=e.isShippingCalculatorOpen,n=e.setIsShippingCalculatorOpen,c=e.shippingAddress;return Object(i.createElement)(i.Fragment,null,Object(i.createElement)(R,{address:c}),t&&Object(i.createElement)(x,{label:Object(l.__)("(change address)",'woocommerce'),isShippingCalculatorOpen:r,setIsShippingCalculatorOpen:n}))},I=function(e){var t=e.showCalculator,r=e.isShippingCalculatorOpen,n=e.setIsShippingCalculatorOpen;return t?Object(i.createElement)(x,{isShippingCalculatorOpen:r,setIsShippingCalculatorOpen:n}):Object(i.createElement)("em",null,Object(l.__)("Calculated during checkout",'woocommerce'))};t.a=function(e){var t=e.currency,r=e.values,n=e.showCalculator,o=void 0===n||n,s=e.showRateSelector,f=void 0===s||s,O=e.className,h=Object(i.useState)(!1),v=a()(h,2),j=v[0],E=v[1],y=Object(p.a)(),_=y.shippingAddress,w=y.cartHasCalculatedShipping,S=y.shippingRates,C=y.shippingRatesLoading,P=Object(b.getSetting)("displayCartPricesIncludingTax",!1)?parseInt(r.total_shipping,10)+parseInt(r.total_shipping_tax,10):parseInt(r.total_shipping,10),R=S.some((function(e){return e.shipping_rates.length}))||P,x={isShippingCalculatorOpen:j,setIsShippingCalculatorOpen:E},T=S.flatMap((function(e){return e.shipping_rates.filter((function(e){return e.selected})).flatMap((function(e){return e.name}))}));return Object(i.createElement)("div",{className:u()("wc-block-components-totals-shipping",O)},Object(i.createElement)(d.TotalsItem,{label:Object(l.__)("Shipping",'woocommerce'),value:w?P:Object(i.createElement)(I,c()({showCalculator:o},x)),description:Object(i.createElement)(i.Fragment,null,w&&Object(i.createElement)(i.Fragment,null,Object(i.createElement)(m,{selectedShippingRates:T}),Object(i.createElement)(N,c()({shippingAddress:_,showCalculator:o},x)))),currency:t}),o&&j&&Object(i.createElement)(k,{onUpdate:function(){E(!1)}}),f&&w&&Object(i.createElement)(g,{hasRates:R,shippingRates:S,shippingRatesLoading:C}))}},517:function(e,t,r){"use strict";r.d(t,"a",(function(){return f}));var n=r(8),c=r.n(n),o=r(0),a=r(4),i=r(1),s=r(3),u=r(33),l=r.n(u),p=[],d=r(9),b=r.n(d),m=function(e){return Object(o.createElement)("div",b()({className:"edit-post-welcome-guide__image edit-post-welcome-guide__image__prm-np",style:{display:"flex",justifyContent:"center",alignItems:"center"}},e),Object(o.createElement)("svg",{height:"120",viewBox:"0 0 170 120",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Object(o.createElement)("g",{filter:"url(#filter0_ddd)"},Object(o.createElement)("rect",{x:"5.5",y:"18",width:"159",height:"96",rx:"3",fill:"white"}),Object(o.createElement)("rect",{x:"24.5",y:"4",width:"51",height:"22",rx:"3",fill:"white"}),Object(o.createElement)("rect",{x:"94.5",y:"4",width:"51",height:"22",rx:"3",fill:"white"})),Object(o.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M48.8908 42H125.078C129.899 42 133.802 45.9231 133.802 50.7692V80C133.802 84.8462 129.899 88.7692 125.078 88.7692H97.756L101.506 98L85.0135 88.7692H48.929C44.1076 88.7692 40.2045 84.8462 40.2045 80V50.7692C40.1662 45.9615 44.0693 42 48.8908 42Z",fill:"#7F54B3"}),Object(o.createElement)("path",{d:"M44.8709 50.723C45.4039 50.0175 46.2033 49.6462 47.2693 49.5719C49.2108 49.4234 50.3149 50.3145 50.5814 52.2453C51.7615 60.0056 53.0559 66.5778 54.4264 71.9617L62.7637 56.4782C63.5251 55.0673 64.4768 54.3246 65.6189 54.2504C67.294 54.139 68.3219 55.1786 68.7406 57.3694C69.6924 62.3077 70.9106 66.5035 72.3573 70.0681C73.3471 60.6369 75.0222 53.8419 77.3825 49.6462C77.9535 48.6065 78.7911 48.0867 79.8951 48.0124C80.7707 47.9382 81.5702 48.1981 82.2935 48.755C83.0168 49.312 83.3975 50.0175 83.4736 50.8715C83.5117 51.5398 83.3975 52.0968 83.0929 52.6538C81.6082 55.3272 80.39 59.82 79.4002 66.0579C78.4484 72.1102 78.1058 76.8258 78.3342 80.2047C78.4104 81.133 78.2581 81.9499 77.8774 82.6553C77.4205 83.4722 76.7353 83.9178 75.8597 83.9921C74.8699 84.0663 73.842 83.6207 72.8522 82.6182C69.3117 79.0908 66.4945 73.8183 64.4388 66.8006C61.9642 71.5533 60.1369 75.1178 58.9567 77.4942C56.7106 81.69 54.8071 83.8435 53.2082 83.9549C52.1803 84.0292 51.3047 83.1752 50.5433 81.3929C48.6017 76.5288 46.5079 67.1347 44.2618 53.2107C44.1476 52.2453 44.3379 51.3913 44.8709 50.723Z",fill:"white"}),Object(o.createElement)("path",{d:"M126.922 56.5426C125.536 54.1968 123.495 52.7819 120.761 52.2234C120.029 52.0745 119.336 52 118.681 52C114.985 52 111.981 53.8617 109.632 57.5851C107.63 60.75 106.629 64.25 106.629 68.0851C106.629 70.9521 107.245 73.4096 108.477 75.4574C109.863 77.8032 111.904 79.2181 114.638 79.7766C115.37 79.9255 116.063 80 116.717 80C120.453 80 123.456 78.1383 125.767 74.4149C127.769 71.2128 128.77 67.7128 128.77 63.8777C128.77 60.9734 128.154 58.5532 126.922 56.5426ZM122.07 66.8564C121.531 69.3138 120.568 71.1383 119.143 72.367C118.027 73.3351 116.987 73.7447 116.024 73.5585C115.1 73.3723 114.33 72.5904 113.752 71.1383C113.29 69.984 113.059 68.8298 113.059 67.75C113.059 66.8192 113.136 65.8883 113.329 65.0319C113.675 63.5053 114.33 62.016 115.37 60.6011C116.64 58.7766 117.988 58.0319 119.374 58.2925C120.299 58.4787 121.069 59.2606 121.646 60.7128C122.108 61.867 122.339 63.0213 122.339 64.1011C122.339 65.0691 122.224 66 122.07 66.8564Z",fill:"white"}),Object(o.createElement)("path",{d:"M102.767 56.5426C101.381 54.1968 99.3018 52.7819 96.6063 52.2234C95.8747 52.0745 95.1816 52 94.5269 52C90.8303 52 87.8267 53.8617 85.4778 57.5851C83.4755 60.75 82.4743 64.25 82.4743 68.0851C82.4743 70.9521 83.0904 73.4096 84.3226 75.4574C85.7089 77.8032 87.7497 79.2181 90.4837 79.7766C91.2153 79.9255 91.9085 80 92.5631 80C96.2983 80 99.3018 78.1383 101.612 74.4149C103.615 71.2128 104.616 67.7128 104.616 63.8777C104.616 60.9734 104 58.5532 102.767 56.5426ZM97.9155 66.8564C97.3765 69.3138 96.4138 71.1383 94.989 72.367C93.8723 73.3351 92.8326 73.7447 91.87 73.5585C90.9458 73.3723 90.1757 72.5904 89.5981 71.1383C89.136 69.984 88.9049 68.8298 88.9049 67.75C88.9049 66.8192 88.9819 65.8883 89.1745 65.0319C89.521 63.5053 90.1757 62.016 91.2153 60.6011C92.4861 58.7766 93.8338 58.0319 95.2201 58.2925C96.1442 58.4787 96.9144 59.2606 97.492 60.7128C97.9541 61.867 98.1851 63.0213 98.1851 64.1011C98.1851 65.0691 98.1081 66 97.9155 66.8564Z",fill:"white"}),Object(o.createElement)("defs",null,Object(o.createElement)("filter",{id:"filter0_ddd",x:"0.5",y:"0",width:"169",height:"120",filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB"},Object(o.createElement)("feFlood",{floodOpacity:"0",result:"BackgroundImageFix"}),Object(o.createElement)("feColorMatrix",{in:"SourceAlpha",type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"}),Object(o.createElement)("feOffset",{dy:"1"}),Object(o.createElement)("feGaussianBlur",{stdDeviation:"1.5"}),Object(o.createElement)("feColorMatrix",{type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.2 0"}),Object(o.createElement)("feBlend",{mode:"normal",in2:"BackgroundImageFix",result:"effect1_dropShadow"}),Object(o.createElement)("feColorMatrix",{in:"SourceAlpha",type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"}),Object(o.createElement)("feOffset",{dy:"1"}),Object(o.createElement)("feGaussianBlur",{stdDeviation:"2.5"}),Object(o.createElement)("feColorMatrix",{type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.12 0"}),Object(o.createElement)("feBlend",{mode:"normal",in2:"effect1_dropShadow",result:"effect2_dropShadow"}),Object(o.createElement)("feColorMatrix",{in:"SourceAlpha",type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"}),Object(o.createElement)("feOffset",{dy:"2"}),Object(o.createElement)("feGaussianBlur",{stdDeviation:"1"}),Object(o.createElement)("feColorMatrix",{type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.14 0"}),Object(o.createElement)("feBlend",{mode:"normal",in2:"effect2_dropShadow",result:"effect3_dropShadow"}),Object(o.createElement)("feBlend",{mode:"normal",in:"SourceGraphic",in2:"effect3_dropShadow",result:"shape"})))))};function f(e){var t=function(e){var t=function(e,t){var r=Object(o.useState)((function(){var r=window.localStorage.getItem(e);if(r)try{return JSON.parse(r)}catch(t){console.error("Value for key '".concat(e,"' could not be retrieved from localStorage because it can't be parsed."))}return t})),n=c()(r,2),a=n[0],i=n[1];return Object(o.useEffect)((function(){try{window.localStorage.setItem(e,JSON.stringify(a))}catch(t){console.error("Value for key '".concat(e,"' could not be saved in localStorage because it can't be converted into a string."))}}),[e,a]),[a,i]}("wc-blocks_dismissed_compatibility_notices",p),r=c()(t,2),n=r[0],a=r[1],i=Object(o.useState)(!1),s=c()(i,2),u=s[0],d=s[1],b=n.includes(e);return Object(o.useEffect)((function(){d(!b)}),[b]),[u,function(){var t=new Set(n);t.add(e),a(l()(t))}]}(e.blockName),r=c()(t,2),n=r[0],u=r[1];return Object(s.isWpVersion)("5.4","<=")||!n?null:Object(o.createElement)(a.Guide,{className:"edit-post-welcome-guide",contentLabel:Object(i.__)("Compatibility notice",'woocommerce'),onFinish:function(){return u()},finishButtonText:Object(i.__)("Got it!",'woocommerce'),pages:[{image:Object(o.createElement)(m,null),content:Object(o.createElement)(o.Fragment,null,Object(o.createElement)("h1",{className:"edit-post-welcome-guide__heading"},Object(i.__)("Compatibility notice",'woocommerce')),Object(o.createElement)("p",{className:"edit-post-welcome-guide__text"},Object(o.createInterpolateElement)(Object(i.__)("This block may not be compatible with <em>all</em> checkout extensions and integrations.",'woocommerce'),{em:Object(o.createElement)("em",null)})),Object(o.createElement)("p",{className:"edit-post-welcome-guide__text"},Object(o.createInterpolateElement)(Object(i.__)("We recommend reviewing our <a>expanding list</a> of compatible extensions prior to using this block on a live store.",'woocommerce'),{a:Object(o.createElement)("a",{href:"https://docs.woocommerce.com/document/cart-checkout-blocks-support-status/",target:"_blank",rel:"noopener noreferrer"})})))}]})}},518:function(e,t,r){"use strict";r.d(t,"a",(function(){return s}));var n=r(1),c=r(37),o=r(3),a=[{destination:{address_1:"",address_2:"",city:"",state:"",postcode:"",country:""},package_id:0,name:Object(n.__)("Shipping",'woocommerce'),items:[{key:"33e75ff09dd601bbe69f351039152189",name:Object(n._x)("Beanie with Logo","example product in Cart Block",'woocommerce'),quantity:2},{key:"6512bd43d9caa6e02c990b0a82652dca",name:Object(n._x)("Beanie","example product in Cart Block",'woocommerce'),quantity:1}],shipping_rates:[{currency_code:"USD",currency_symbol:"$",currency_minor_unit:2,currency_decimal_separator:".",currency_thousand_separator:",",currency_prefix:"$",currency_suffix:"",name:Object(n.__)("Free shipping",'woocommerce'),description:"",delivery_time:"",price:"000",taxes:"0",rate_id:"free_shipping:1",instance_id:0,meta_data:[],method_id:"flat_rate",selected:!0},{currency_code:"USD",currency_symbol:"$",currency_minor_unit:2,currency_decimal_separator:".",currency_thousand_separator:",",currency_prefix:"$",currency_suffix:"",name:Object(n.__)("Local pickup",'woocommerce'),description:"",delivery_time:"",price:"200",taxes:"0",rate_id:"local_pickup:1",instance_id:1,meta_data:[],method_id:"local_pickup",selected:!1}]}],i=Object(o.getSetting)("displayCartPricesIncludingTax",!1),s={coupons:[],shipping_rates:Object(o.getSetting)("shippingMethodsExist",!1)?a:[],items:[{key:"1",id:1,quantity:2,name:Object(n.__)("Beanie",'woocommerce'),short_description:Object(n.__)("Warm hat for winter",'woocommerce'),description:"Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.",sku:"woo-beanie",permalink:"https://example.org",low_stock_remaining:2,backorders_allowed:!1,show_backorder_badge:!1,sold_individually:!1,images:[{id:10,src:c.m+"previews/beanie.jpg",thumbnail:c.m+"previews/beanie.jpg",srcset:"",sizes:"",name:"",alt:""}],variation:[{attribute:Object(n.__)("Color",'woocommerce'),value:Object(n.__)("Yellow",'woocommerce')},{attribute:Object(n.__)("Size",'woocommerce'),value:Object(n.__)("Small",'woocommerce')}],prices:{currency_code:"USD",currency_symbol:"$",currency_minor_unit:2,currency_decimal_separator:".",currency_thousand_separator:",",currency_prefix:"$",currency_suffix:"",price:i?"800":"640",regular_price:i?"800":"640",sale_price:i?"800":"640",raw_prices:{precision:6,price:i?"8000000":"6400000",regular_price:i?"8000000":"6400000",sale_price:i?"8000000":"6400000"}},totals:{currency_code:"USD",currency_symbol:"$",currency_minor_unit:2,currency_decimal_separator:".",currency_thousand_separator:",",currency_prefix:"$",currency_suffix:"",line_subtotal:i?"1600":"1280",line_subtotal_tax:"0",line_total:"1600",line_total_tax:i?"0":"320"},extensions:{}},{key:"2",id:2,quantity:1,name:Object(n.__)("Cap",'woocommerce'),short_description:Object(n.__)("Lightweight baseball cap",'woocommerce'),description:"Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.",sku:"woo-cap",permalink:"https://example.org",backorders_allowed:!1,show_backorder_badge:!1,sold_individually:!1,images:[{id:11,src:c.m+"previews/cap.jpg",thumbnail:c.m+"previews/cap.jpg",srcset:"",sizes:"",name:"",alt:""}],variation:[{attribute:Object(n.__)("Color",'woocommerce'),value:Object(n.__)("Orange",'woocommerce')}],prices:{currency_code:"USD",currency_symbol:"$",currency_minor_unit:2,currency_decimal_separator:".",currency_thousand_separator:",",currency_prefix:"$",currency_suffix:"",price:i?"1400":"1120",regular_price:i?"1600":"1280",sale_price:i?"1400":"1120",raw_prices:{precision:6,price:i?"14000000":"11200000",regular_price:i?"16000000":"12800000",sale_price:i?"14000000":"11200000"}},totals:{currency_code:"USD",currency_symbol:"$",currency_minor_unit:2,currency_decimal_separator:".",currency_thousand_separator:",",currency_prefix:"$",currency_suffix:"",line_subtotal:i?"1400":"1120",line_subtotal_tax:i?"0":"280",line_total:"1400",line_total_tax:i?"0":"280"},extensions:{}}],fees:[],items_count:3,items_weight:0,needs_payment:!0,needs_shipping:Object(o.getSetting)("shippingEnabled",!0),has_calculated_shipping:!0,shipping_address:{first_name:"",last_name:"",company:"",address_1:"",address_2:"",city:"",state:"",postcode:"",country:"",phone:""},billing_address:{first_name:"",last_name:"",company:"",address_1:"",address_2:"",city:"",state:"",postcode:"",country:"",email:"",phone:""},totals:{currency_code:"USD",currency_symbol:"$",currency_minor_unit:2,currency_decimal_separator:".",currency_thousand_separator:",",currency_prefix:"$",currency_suffix:"",total_items:i?"3000":"2400",total_items_tax:"0",total_fees:"0",total_fees_tax:"0",total_discount:"0",total_discount_tax:"0",total_shipping:"0",total_shipping_tax:"0",total_tax:"600",total_price:"3000",tax_lines:[{name:Object(n.__)("Sales tax",'woocommerce'),rate:"20%",price:600}]},errors:[],payment_requirements:["products"],generated_timestamp:Date.now(),extensions:{}}},53:function(e,t,r){"use strict";var n=r(9),c=r.n(n),o=r(5),a=r.n(o),i=r(16),s=r.n(i),u=r(0),l=r(166),p=r(6),d=r.n(p),b=(r(175),["className","value","currency","onValueChange","displayType"]);function m(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function f(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?m(Object(r),!0).forEach((function(t){a()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):m(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}t.a=function(e){var t=e.className,r=e.value,n=e.currency,o=e.onValueChange,a=e.displayType,i=void 0===a?"text":a,p=s()(e,b),m="string"==typeof r?parseInt(r,10):r;if(!Number.isFinite(m))return null;var O=m/Math.pow(10,n.minorUnit);if(!Number.isFinite(O))return null;var g=d()("wc-block-formatted-money-amount","wc-block-components-formatted-money-amount",t),h=f(f(f({},p),function(e){return{thousandSeparator:e.thousandSeparator,decimalSeparator:e.decimalSeparator,decimalScale:e.minorUnit,fixedDecimalScale:!0,prefix:e.prefix,suffix:e.suffix,isNumericString:!0}}(n)),{},{value:void 0,currency:void 0,onValueChange:void 0}),v=o?function(e){var t=e.value*Math.pow(10,n.minorUnit);o(t)}:function(){};return Object(u.createElement)(l.a,c()({className:g,displayType:i},h,{value:O,onValueChange:v}))}},547:function(e){e.exports=JSON.parse('{"name":"woocommerce/filled-cart-block","version":"1.0.0","title":"Filled Cart","description":"Contains blocks that are displayed when the cart contains products.","category":"woocommerce","supports":{"align":false,"html":false,"multiple":false,"reusable":false,"inserter":false},"attributes":{"lock":{"type":"object","default":{"remove":true,"move":true}}},"parent":["woocommerce/cart-i2"],"textdomain":'woocommerce',"apiVersion":2}')},548:function(e){e.exports=JSON.parse('{"name":"woocommerce/cart-items-block","version":"1.0.0","title":"Cart Items block","description":"Column containing cart items.","category":"woocommerce","supports":{"align":false,"html":false,"multiple":false,"reusable":false,"inserter":false},"attributes":{"lock":{"type":"object","default":{"remove":true,"move":true}}},"parent":["woocommerce/filled-cart-block"],"textdomain":'woocommerce',"apiVersion":2}')},549:function(e){e.exports=JSON.parse('{"name":"woocommerce/cart-line-items-block","version":"1.0.0","title":"Cart Line Items","description":"Block containing current line items in Cart.","category":"woocommerce","supports":{"align":false,"html":false,"multiple":false,"reusable":false,"inserter":false},"attributes":{"lock":{"type":"object","default":{"remove":true,"move":true}}},"parent":["woocommerce/cart-items-block"],"textdomain":'woocommerce',"apiVersion":2}')},55:function(e,t){e.exports=window.wp.hooks},550:function(e){e.exports=JSON.parse('{"name":"woocommerce/cart-totals-block","version":"1.0.0","title":"Cart Totals","description":"Column containing the cart totals.","category":"woocommerce","supports":{"align":false,"html":false,"multiple":false,"reusable":false,"inserter":false},"attributes":{"checkbox":{"type":"boolean","default":false},"text":{"type":"string","required":false},"lock":{"type":"object","default":{"remove":true}}},"parent":["woocommerce/filled-cart-block"],"textdomain":'woocommerce',"apiVersion":2}')},551:function(e){e.exports=JSON.parse('{"name":"woocommerce/cart-order-summary-block","version":"1.0.0","title":"Order Summary","description":"Show customers a summary of their order.","category":"woocommerce","supports":{"align":false,"html":false,"multiple":false,"reusable":false,"inserter":false},"attributes":{"lock":{"type":"object","default":{"remove":true,"move":true}}},"parent":["woocommerce/cart-totals-block"],"textdomain":'woocommerce',"apiVersion":2}')},552:function(e){e.exports=JSON.parse('{"name":"woocommerce/cart-express-payment-block","version":"1.0.0","title":"Express Checkout","description":"Provide an express payment option for your customers.","category":"woocommerce","supports":{"align":false,"html":false,"multiple":false,"reusable":false,"inserter":false},"attributes":{"lock":{"type":"object","default":{"remove":true,"move":true}}},"parent":["woocommerce/cart-totals-block"],"textdomain":'woocommerce',"apiVersion":2}')},553:function(e){e.exports=JSON.parse('{"name":"woocommerce/proceed-to-checkout-block","version":"1.0.0","title":"Proceed to checkout","description":"Allow customers proceed to Checkout.","category":"woocommerce","supports":{"align":false,"html":false,"multiple":false,"reusable":false,"inserter":false},"attributes":{"lock":{"default":{"remove":true,"move":true}}},"parent":["woocommerce/cart-totals-block"],"textdomain":'woocommerce',"apiVersion":2}')},554:function(e,t,r){"use strict";(function(e){var n=r(8),c=r.n(n),o=r(0),a=r(1),i=r(169),s=r(90),u=r(37),l=r(57),p=r(163),d=r(371),b=(r(846),function(e){return Object.values(e).reduce((function(e,t){return null!==t.icons&&(e=e.concat(t.icons)),e}),[])});t.a=function(t){var r=t.link,n=Object(l.b)().isCalculating,m=Object(d.a)(),f=c()(m,2),O=f[0],g=f[1],h=Object(o.useState)(!1),v=c()(h,2),j=v[0],E=v[1],y=Object(p.b)().paymentMethods;Object(o.useEffect)((function(){if("function"==typeof e.addEventListener&&"function"==typeof e.removeEventListener){var t=function(){E(!1)};return e.addEventListener("pageshow",t),function(){e.removeEventListener("pageshow",t)}}}),[]);var _=Object(o.createElement)(o.Fragment,null,Object(o.createElement)(s.a,{className:"wc-block-cart__submit-button",href:r||u.f,disabled:n,onClick:function(){return E(!0)},showSpinner:j},Object(a.__)("Proceed to Checkout",'woocommerce')),Object(o.createElement)(i.a,{icons:b(y)}));return Object(o.createElement)("div",{className:"wc-block-cart__submit"},O,Object(o.createElement)("div",{className:"wc-block-cart__submit-container"},_),"below"===g&&Object(o.createElement)("div",{className:"wc-block-cart__submit-container wc-block-cart__submit-container--sticky"},_))}}).call(this,r(225))},555:function(e){e.exports=JSON.parse('{"name":"woocommerce/empty-cart-block","version":"1.0.0","title":"Empty Cart","description":"Contains blocks that are displayed when the cart is empty.","category":"woocommerce","supports":{"align":false,"html":false,"multiple":false,"reusable":false,"inserter":false},"attributes":{"lock":{"type":"object","default":{"remove":true,"move":true}}},"parent":["woocommerce/cart-i2"],"textdomain":'woocommerce',"apiVersion":2}')},56:function(e,t){e.exports=window.wp.deprecated},57:function(e,t,r){"use strict";r.d(t,"b",(function(){return L})),r.d(t,"a",(function(){return B}));var n,c=r(8),o=r.n(c),a=r(0),i=r(1),s=r(136),u=r(56),l=r.n(u),p=r(72);!function(e){e.SET_IDLE="set_idle",e.SET_PRISTINE="set_pristine",e.SET_REDIRECT_URL="set_redirect_url",e.SET_COMPLETE="set_checkout_complete",e.SET_BEFORE_PROCESSING="set_before_processing",e.SET_AFTER_PROCESSING="set_after_processing",e.SET_PROCESSING_RESPONSE="set_processing_response",e.SET_PROCESSING="set_checkout_is_processing",e.SET_HAS_ERROR="set_checkout_has_error",e.SET_NO_ERROR="set_checkout_no_error",e.SET_CUSTOMER_ID="set_checkout_customer_id",e.SET_ORDER_ID="set_checkout_order_id",e.SET_ORDER_NOTES="set_checkout_order_notes",e.INCREMENT_CALCULATING="increment_calculating",e.DECREMENT_CALCULATING="decrement_calculating",e.SET_SHOULD_CREATE_ACCOUNT="set_should_create_account",e.SET_EXTENSION_DATA="set_extension_data"}(n||(n={}));var d,b,m=function(){return{type:n.SET_IDLE}},f=function(e){return{type:n.SET_REDIRECT_URL,redirectUrl:e}},O=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{type:n.SET_COMPLETE,data:e}},g=function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return{type:e?n.SET_HAS_ERROR:n.SET_NO_ERROR}},h=r(5),v=r.n(h),j=r(3);function E(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}!function(e){e.PRISTINE="pristine",e.IDLE="idle",e.PROCESSING="processing",e.COMPLETE="complete",e.BEFORE_PROCESSING="before_processing",e.AFTER_PROCESSING="after_processing"}(b||(b={}));var y=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?E(Object(r),!0).forEach((function(t){v()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):E(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({order_id:0,customer_id:0},(null===(d=Object(j.getSetting)("preloadedApiRequests",{})["/wc/store/checkout"])||void 0===d?void 0:d.body)||{}),_={redirectUrl:"",status:b.PRISTINE,hasError:!1,calculatingCount:0,orderId:y.order_id,orderNotes:"",customerId:y.customer_id,shouldCreateAccount:!1,processingResponse:null,extensionData:{}};function w(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function k(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?w(Object(r),!0).forEach((function(t){v()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):w(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var S=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:_,t=arguments.length>1?arguments[1]:void 0,r=t.redirectUrl,c=t.type,o=t.customerId,a=t.orderId,i=t.orderNotes,s=t.extensionData,u=t.shouldCreateAccount,l=t.data,p=e;switch(c){case n.SET_PRISTINE:p=_;break;case n.SET_IDLE:p=e.status!==b.IDLE?k(k({},e),{},{status:b.IDLE}):e;break;case n.SET_REDIRECT_URL:p=void 0!==r&&r!==e.redirectUrl?k(k({},e),{},{redirectUrl:r}):e;break;case n.SET_PROCESSING_RESPONSE:p=k(k({},e),{},{processingResponse:l});break;case n.SET_COMPLETE:p=e.status!==b.COMPLETE?k(k({},e),{},{status:b.COMPLETE,redirectUrl:void 0!==l&&"string"==typeof l.redirectUrl&&l.redirectUrl?l.redirectUrl:e.redirectUrl}):e;break;case n.SET_PROCESSING:p=!1===(p=e.status!==b.PROCESSING?k(k({},e),{},{status:b.PROCESSING,hasError:!1}):e).hasError?p:k(k({},p),{},{hasError:!1});break;case n.SET_BEFORE_PROCESSING:p=e.status!==b.BEFORE_PROCESSING?k(k({},e),{},{status:b.BEFORE_PROCESSING,hasError:!1}):e;break;case n.SET_AFTER_PROCESSING:p=e.status!==b.AFTER_PROCESSING?k(k({},e),{},{status:b.AFTER_PROCESSING}):e;break;case n.SET_HAS_ERROR:p=e.hasError?e:k(k({},e),{},{hasError:!0}),p=e.status===b.PROCESSING||e.status===b.BEFORE_PROCESSING?k(k({},p),{},{status:b.IDLE}):p;break;case n.SET_NO_ERROR:p=e.hasError?k(k({},e),{},{hasError:!1}):e;break;case n.INCREMENT_CALCULATING:p=k(k({},e),{},{calculatingCount:e.calculatingCount+1});break;case n.DECREMENT_CALCULATING:p=k(k({},e),{},{calculatingCount:Math.max(0,e.calculatingCount-1)});break;case n.SET_CUSTOMER_ID:p=void 0!==o?k(k({},e),{},{customerId:o}):e;break;case n.SET_ORDER_ID:p=void 0!==a?k(k({},e),{},{orderId:a}):e;break;case n.SET_SHOULD_CREATE_ACCOUNT:void 0!==u&&u!==e.shouldCreateAccount&&(p=k(k({},e),{},{shouldCreateAccount:u}));break;case n.SET_ORDER_NOTES:void 0!==i&&e.orderNotes!==i&&(p=k(k({},e),{},{orderNotes:i}));break;case n.SET_EXTENSION_DATA:void 0!==s&&e.extensionData!==s&&(p=k(k({},e),{},{extensionData:s}))}return p!==e&&c!==n.SET_PRISTINE&&p.status===b.PRISTINE&&(p.status=b.IDLE),p},C=r(25),P=r(126),R=r(321),x=r(322),N=r(132),I=r(59),T=r(68),M=r(14),A=r(50),D=Object(a.createContext)({dispatchActions:{resetCheckout:function(){},setRedirectUrl:function(e){},setHasError:function(e){},setAfterProcessing:function(e){},incrementCalculating:function(){},decrementCalculating:function(){},setCustomerId:function(e){},setOrderId:function(e){},setOrderNotes:function(e){},setExtensionData:function(e){}},onSubmit:function(){},isComplete:!1,isIdle:!1,isCalculating:!1,isProcessing:!1,isBeforeProcessing:!1,isAfterProcessing:!1,hasError:!1,redirectUrl:"",orderId:0,orderNotes:"",customerId:0,onCheckoutAfterProcessingWithSuccess:function(){return function(){}},onCheckoutAfterProcessingWithError:function(){return function(){}},onCheckoutBeforeProcessing:function(){return function(){}},onCheckoutValidationBeforeProcessing:function(){return function(){}},hasOrder:!1,isCart:!1,shouldCreateAccount:!1,setShouldCreateAccount:function(e){},extensionData:{}}),L=function(){return Object(a.useContext)(D)},B=function(e){var t=e.children,r=e.redirectUrl,c=e.isCart,u=void 0!==c&&c;_.redirectUrl=r;var d,h=Object(a.useReducer)(S,_),v=o()(h,2),j=v[0],E=v[1],y=Object(N.b)().setValidationErrors,w=Object(I.a)(),k=w.addErrorNotice,L=w.removeNotices,B=Object(T.a)().dispatchCheckoutEvent,V=j.calculatingCount>0,F=Object(A.c)(),U=F.isSuccessResponse,z=F.isErrorResponse,G=F.isFailResponse,q=F.shouldRetry,H=(d=Object(A.c)().noticeContexts,{checkoutNotices:Object(M.useSelect)((function(e){return e("core/notices").getNotices("wc/checkout")}),[]),expressPaymentNotices:Object(M.useSelect)((function(e){return e("core/notices").getNotices(d.EXPRESS_PAYMENTS)}),[d.EXPRESS_PAYMENTS]),paymentNotices:Object(M.useSelect)((function(e){return e("core/notices").getNotices(d.PAYMENTS)}),[d.PAYMENTS])}),Y=H.checkoutNotices,W=H.paymentNotices,$=H.expressPaymentNotices,K=Object(a.useReducer)(P.b,{}),X=o()(K,2),Q=X[0],J=X[1],Z=Object(a.useRef)(Q),ee=function(e){return Object(a.useMemo)((function(){return{onCheckoutAfterProcessingWithSuccess:Object(R.a)("checkout_after_processing_with_success",e),onCheckoutAfterProcessingWithError:Object(R.a)("checkout_after_processing_with_error",e),onCheckoutValidationBeforeProcessing:Object(R.a)("checkout_validation_before_processing",e)}}),[e])}(J),te=ee.onCheckoutAfterProcessingWithSuccess,re=ee.onCheckoutAfterProcessingWithError,ne=ee.onCheckoutValidationBeforeProcessing;Object(a.useEffect)((function(){Z.current=Q}),[Q]);var ce=Object(a.useMemo)((function(){return function(){return l()("onCheckoutBeforeProcessing",{alternative:"onCheckoutValidationBeforeProcessing",plugin:"WooCommerce Blocks"}),ne.apply(void 0,arguments)}}),[ne]),oe=Object(a.useMemo)((function(){return{resetCheckout:function(){E({type:n.SET_PRISTINE})},setRedirectUrl:function(e){E(f(e))},setHasError:function(e){E(g(e))},incrementCalculating:function(){E({type:n.INCREMENT_CALCULATING})},decrementCalculating:function(){E({type:n.DECREMENT_CALCULATING})},setCustomerId:function(e){var t;E((t=e,{type:n.SET_CUSTOMER_ID,customerId:t}))},setOrderId:function(e){E(function(e){return{type:n.SET_ORDER_ID,orderId:e}}(e))},setOrderNotes:function(e){E(function(e){return{type:n.SET_ORDER_NOTES,orderNotes:e}}(e))},setExtensionData:function(e){E(function(e){return{type:n.SET_EXTENSION_DATA,extensionData:e}}(e))},setAfterProcessing:function(e){var t,r=function(e){var t={message:"",paymentStatus:"",redirectUrl:"",paymentDetails:{}};return"payment_result"in e&&(t.paymentStatus=e.payment_result.payment_status,t.redirectUrl=e.payment_result.redirect_url,e.payment_result.hasOwnProperty("payment_details")&&Array.isArray(e.payment_result.payment_details)&&e.payment_result.payment_details.forEach((function(e){var r=e.key,n=e.value;t.paymentDetails[r]=Object(C.decodeEntities)(n)}))),"message"in e&&(t.message=Object(C.decodeEntities)(e.message)),!t.message&&"data"in e&&"status"in e.data&&e.data.status>299&&(t.message=Object(i.__)("Something went wrong. Please contact us to get assistance.",'woocommerce')),t}(e);r.redirectUrl&&E(f(r.redirectUrl)),E((t=r,{type:n.SET_PROCESSING_RESPONSE,data:t})),E({type:n.SET_AFTER_PROCESSING})}}}),[]);Object(a.useEffect)((function(){j.status===b.BEFORE_PROCESSING&&(L("error"),Object(x.a)(Z.current,"checkout_validation_before_processing",{}).then((function(e){!0!==e?(Array.isArray(e)&&e.forEach((function(e){var t=e.errorMessage,r=e.validationErrors;k(t),y(r)})),E(m()),E(g())):E({type:n.SET_PROCESSING})})))}),[j.status,y,k,L,E]);var ae=Object(s.a)(j.status),ie=Object(s.a)(j.hasError);Object(a.useEffect)((function(){if((j.status!==ae||j.hasError!==ie)&&j.status===b.AFTER_PROCESSING){var e={redirectUrl:j.redirectUrl,orderId:j.orderId,customerId:j.customerId,orderNotes:j.orderNotes,processingResponse:j.processingResponse};j.hasError?Object(x.b)(Z.current,"checkout_after_processing_with_error",e).then((function(t){var r=function(e){var t=null;return e.forEach((function(e){if((z(e)||G(e))&&e.message){var r=e.messageContext?{context:e.messageContext}:void 0;t=e,k(e.message,r)}})),t}(t);if(null!==r)q(r)?E(m()):E(O(r));else{if(!(Y.some((function(e){return"error"===e.status}))||$.some((function(e){return"error"===e.status}))||W.some((function(e){return"error"===e.status})))){var n,c=(null===(n=e.processingResponse)||void 0===n?void 0:n.message)||Object(i.__)("Something went wrong. Please contact us to get assistance.",'woocommerce');k(c,{id:"checkout"})}E(m())}})):Object(x.b)(Z.current,"checkout_after_processing_with_success",e).then((function(e){var t=null,r=null;if(e.forEach((function(e){U(e)&&(t=e),(z(e)||G(e))&&(r=e)})),t&&!r)E(O(t));else if(Object(p.b)(r)){if(r.message){var n=r.messageContext?{context:r.messageContext}:void 0;k(r.message,n)}q(r)?E(g(!0)):E(O(r))}else E(O())}))}}),[j.status,j.hasError,j.redirectUrl,j.orderId,j.customerId,j.orderNotes,j.processingResponse,ae,ie,oe,k,z,G,U,q,Y,$,W]);var se={onSubmit:Object(a.useCallback)((function(){B("submit"),E({type:n.SET_BEFORE_PROCESSING})}),[B]),isComplete:j.status===b.COMPLETE,isIdle:j.status===b.IDLE,isCalculating:V,isProcessing:j.status===b.PROCESSING,isBeforeProcessing:j.status===b.BEFORE_PROCESSING,isAfterProcessing:j.status===b.AFTER_PROCESSING,hasError:j.hasError,redirectUrl:j.redirectUrl,onCheckoutBeforeProcessing:ce,onCheckoutValidationBeforeProcessing:ne,onCheckoutAfterProcessingWithSuccess:te,onCheckoutAfterProcessingWithError:re,dispatchActions:oe,isCart:u,orderId:j.orderId,hasOrder:!!j.orderId,customerId:j.customerId,orderNotes:j.orderNotes,shouldCreateAccount:j.shouldCreateAccount,setShouldCreateAccount:function(e){return E((t=e,{type:n.SET_SHOULD_CREATE_ACCOUNT,shouldCreateAccount:t}));var t},extensionData:j.extensionData};return Object(a.createElement)(D.Provider,{value:se},t)}},59:function(e,t,r){"use strict";r.d(t,"a",(function(){return u}));var n=r(5),c=r.n(n),o=r(0),a=r(141);function i(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function s(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?i(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):i(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var u=function(){var e=Object(a.b)(),t=e.notices,r=e.createNotice,n=e.removeNotice,c=e.setIsSuppressed,i=Object(o.useRef)(t);Object(o.useEffect)((function(){i.current=t}),[t]);var u=Object(o.useMemo)((function(){return{hasNoticesOfType:function(e){return i.current.some((function(t){return t.type===e}))},removeNotices:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;i.current.forEach((function(t){null!==e&&t.status!==e||n(t.id)}))},removeNotice:n}}),[n]),l=Object(o.useMemo)((function(){return{addDefaultNotice:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};r("default",e,s({},t))},addErrorNotice:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};r("error",e,s({},t))},addWarningNotice:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};r("warning",e,s({},t))},addInfoNotice:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};r("info",e,s({},t))},addSuccessNotice:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};r("success",e,s({},t))}}}),[r]);return s(s(s({notices:t},u),l),{},{setIsSuppressed:c})}},60:function(e,t){e.exports=window.wc.wcBlocksRegistry},62:function(e,t,r){"use strict";r.d(t,"a",(function(){return a}));var n=r(0),c=r(34),o=r.n(c);function a(e){var t=Object(n.useRef)(e);return o()(e,t.current)||(t.current=e),t.current}},63:function(e,t,r){"use strict";r.d(t,"b",(function(){return a})),r.d(t,"a",(function(){return i}));var n=r(0),c=r(14),o=Object(n.createContext)({isEditor:!1,currentPostId:0,previewData:{},getPreviewData:function(){}}),a=function(){return Object(n.useContext)(o)},i=function(e){var t=e.children,r=e.currentPostId,a=void 0===r?0:r,i=e.previewData,s=void 0===i?{}:i,u=Object(c.useSelect)((function(e){return a||e("core/editor").getCurrentPostId()}),[a]),l=Object(n.useCallback)((function(e){return e in s?s[e]:{}}),[s]),p={isEditor:!0,currentPostId:u,previewData:s,getPreviewData:l};return Object(n.createElement)(o.Provider,{value:p},t)}},64:function(e,t){e.exports=window.wp.a11y},66:function(e,t,r){"use strict";var n=r(5),c=r.n(n),o=r(16),a=r.n(o),i=r(0),s=["srcElement","size"];function u(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}t.a=function(e){var t=e.srcElement,r=e.size,n=void 0===r?24:r,o=a()(e,s);return Object(i.isValidElement)(t)?Object(i.cloneElement)(t,function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?u(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):u(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({width:n,height:n},o)):null}},67:function(e,t,r){"use strict";r.d(t,"b",(function(){return _})),r.d(t,"a",(function(){return w}));var n=r(8),c=r.n(n),o=r(0),a=r(3),i=r(5),s=r.n(i),u=r(14),l=r(24),p=r(287),d=r(34),b=r.n(d),m=r(162),f=r(42),O=r(43),g=r(59);function h(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function v(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?h(Object(r),!0).forEach((function(t){s()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):h(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var j=function(e,t){return!(!function(e){return"email"in e}(t)||Object(m.c)(t)===Object(m.c)(e))||!!t.country&&!b()(Object(m.b)(e),Object(m.b)(t))},E=r(57),y=Object(o.createContext)({billingData:{first_name:"",last_name:"",company:"",address_1:"",address_2:"",city:"",state:"",postcode:"",country:"",email:"",phone:""},shippingAddress:{first_name:"",last_name:"",company:"",address_1:"",address_2:"",city:"",state:"",postcode:"",country:"",phone:""},setBillingData:function(){return null},setShippingAddress:function(){return null},shippingAsBilling:!0,setShippingAsBilling:function(){return null}}),_=function(){return Object(o.useContext)(y)},w=function(e){var t=e.children,r=function(){var e=Object(u.useDispatch)(l.CART_STORE_KEY).updateCustomerData,t=Object(g.a)(),r=t.addErrorNotice,n=t.removeNotice,a=Object(O.a)(),i=a.billingAddress,s=a.shippingAddress,d=Object(o.useState)({billingData:i,shippingAddress:s}),m=c()(d,2),h=m[0],E=m[1],y=Object(o.useRef)(h),_=Object(p.a)(h,1e3,{equalityFn:function(e,t){return b()(e.billingData,t.billingData)&&b()(e.shippingAddress,t.shippingAddress)}}),w=c()(_,1)[0],k=Object(o.useCallback)((function(e){E((function(t){return v(v({},t),{},{billingData:v(v({},t.billingData),e)})}))}),[]),S=Object(o.useCallback)((function(e){E((function(t){return v(v({},t),{},{shippingAddress:v(v({},t.shippingAddress),e)})}))}),[]);return Object(o.useEffect)((function(){(j(y.current.billingData,w.billingData)||j(y.current.shippingAddress,w.shippingAddress))&&(y.current=w,e({billing_address:w.billingData,shipping_address:w.shippingAddress}).then((function(){n("checkout")})).catch((function(e){r(Object(f.b)(e),{id:"checkout"})})))}),[w,r,n,e]),{billingData:h.billingData,shippingAddress:h.shippingAddress,setBillingData:k,setShippingAddress:S}}(),n=r.billingData,i=r.shippingAddress,s=r.setBillingData,d=r.setShippingAddress,m=Object(O.a)().cartNeedsShipping,h=Object(E.b)().customerId,_=Object(o.useState)((function(){return m&&(!h||(e=i,t=n,Object.keys(a.defaultAddressFields).every((function(r){return e[r]===t[r]}))));var e,t})),w=c()(_,2),k=w[0],S=w[1],C={billingData:n,shippingAddress:i,setBillingData:s,setShippingAddress:d,shippingAsBilling:k,setShippingAsBilling:S};return Object(o.createElement)(y.Provider,{value:C},t)}},68:function(e,t,r){"use strict";r.d(t,"a",(function(){return l}));var n=r(5),c=r.n(n),o=r(55),a=r(0),i=r(43);function s(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function u(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?s(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):s(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var l=function(){var e=Object(i.a)(),t=Object(a.useRef)(e);return Object(a.useEffect)((function(){t.current=e}),[e]),{dispatchStoreEvent:Object(a.useCallback)((function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};try{Object(o.doAction)("experimental__woocommerce_blocks-".concat(e),t)}catch(e){console.error(e)}}),[]),dispatchCheckoutEvent:Object(a.useCallback)((function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};try{Object(o.doAction)("experimental__woocommerce_blocks-checkout-".concat(e),u(u({},r),{},{storeCart:t.current}))}catch(e){console.error(e)}}),[])}}},7:function(e,t){e.exports=window.lodash},72:function(e,t,r){"use strict";r.d(t,"a",(function(){return n})),r.d(t,"c",(function(){return c})),r.d(t,"b",(function(){return o})),r.d(t,"d",(function(){return a}));var n=function(e){return"number"==typeof e},c=function(e){return"string"==typeof e},o=function(e){return!function(e){return null===e}(e)&&e instanceof Object&&e.constructor===Object};function a(e,t){return o(e)&&t in e}},74:function(e,t){e.exports=window.wp.dom},75:function(e,t,r){"use strict";r.d(t,"b",(function(){return R})),r.d(t,"a",(function(){return x}));var n=r(5),c=r.n(n),o=r(8),a=r.n(o),i=r(0),s=r(34),u=r.n(s),l=r(142),p=function(e){return Object(l.a)(e.map((function(e){var t;return[e.package_id,null===(t=e.shipping_rates.find((function(e){return e.selected})))||void 0===t?void 0:t.rate_id]})))},d={NONE:"none",INVALID_ADDRESS:"invalid_address",UNKNOWN:"unknown_error"},b={INVALID_COUNTRY:"woocommerce_rest_cart_shipping_rates_invalid_country",MISSING_COUNTRY:"woocommerce_rest_cart_shipping_rates_missing_country",INVALID_STATE:"woocommerce_rest_cart_shipping_rates_invalid_state"},m={shippingErrorStatus:{isPristine:!0,isValid:!1,hasInvalidAddress:!1,hasError:!1},dispatchErrorStatus:function(){return null},shippingErrorTypes:d,shippingRates:[],shippingRatesLoading:!1,selectedRates:[],setSelectedRates:function(){return null},shippingAddress:{first_name:"",last_name:"",company:"",address_1:"",address_2:"",city:"",state:"",postcode:"",country:""},setShippingAddress:function(){return null},onShippingRateSuccess:function(){return null},onShippingRateFail:function(){return null},onShippingRateSelectSuccess:function(){return null},onShippingRateSelectFail:function(){return null},needsShipping:!1},f=function(e,t){var r=t.type;return Object.values(d).includes(r)?r:e},O=r(126),g=r(321),h=function(e){return{onSuccess:Object(g.a)("shipping_rates_success",e),onFail:Object(g.a)("shipping_rates_fail",e),onSelectSuccess:Object(g.a)("shipping_rate_select_success",e),onSelectFail:Object(g.a)("shipping_rate_select_fail",e)}},v=r(322),j=r(57),E=r(67),y=r(43),_=r(134);function w(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}var k=d.NONE,S=d.INVALID_ADDRESS,C=d.UNKNOWN,P=Object(i.createContext)(m),R=function(){return Object(i.useContext)(P)},x=function(e){var t=e.children,r=Object(j.b)().dispatchActions,n=Object(E.b)(),o=n.shippingAddress,s=n.setShippingAddress,l=Object(y.a)(),m=l.cartNeedsShipping,g=l.cartHasCalculatedShipping,R=l.shippingRates,x=l.shippingRatesLoading,N=l.cartErrors,I=Object(_.a)(),T=I.selectShippingRate,M=I.isSelectingRate,A=Object(i.useReducer)(f,k),D=a()(A,2),L=D[0],B=D[1],V=Object(i.useReducer)(O.b,{}),F=a()(V,2),U=F[0],z=F[1],G=Object(i.useRef)(U),q=Object(i.useMemo)((function(){return{onShippingRateSuccess:h(z).onSuccess,onShippingRateFail:h(z).onFail,onShippingRateSelectSuccess:h(z).onSelectSuccess,onShippingRateSelectFail:h(z).onSelectFail}}),[z]);Object(i.useEffect)((function(){G.current=U}),[U]);var H=Object(i.useRef)((function(){return p(R)}));Object(i.useEffect)((function(){var e=p(R);u()(H.current,e)||(H.current=e)}),[R]),Object(i.useEffect)((function(){x?r.incrementCalculating():r.decrementCalculating()}),[x,r]),Object(i.useEffect)((function(){M?r.incrementCalculating():r.decrementCalculating()}),[M,r]),Object(i.useEffect)((function(){N.length>0&&N.some((function(e){return!(!e.code||!Object.values(b).includes(e.code))}))?B({type:S}):B({type:k})}),[N]);var Y=Object(i.useMemo)((function(){return{isPristine:L===k,isValid:L===k,hasInvalidAddress:L===S,hasError:L===C||L===S}}),[L]);Object(i.useEffect)((function(){x||0!==R.length&&!Y.hasError||Object(v.a)(G.current,"shipping_rates_fail",{hasInvalidAddress:Y.hasInvalidAddress,hasError:Y.hasError})}),[R,x,Y.hasError,Y.hasInvalidAddress]),Object(i.useEffect)((function(){!x&&R.length>0&&!Y.hasError&&Object(v.a)(G.current,"shipping_rates_success",R)}),[R,x,Y.hasError]),Object(i.useEffect)((function(){M||(Y.hasError?Object(v.a)(G.current,"shipping_rate_select_fail",{hasError:Y.hasError,hasInvalidAddress:Y.hasInvalidAddress}):Object(v.a)(G.current,"shipping_rate_select_success",H.current))}),[M,Y.hasError,Y.hasInvalidAddress]);var W=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?w(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):w(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({shippingErrorStatus:Y,dispatchErrorStatus:B,shippingErrorTypes:d,shippingRates:R,shippingRatesLoading:x,selectedRates:H.current,setSelectedRates:T,isSelectingRate:M,shippingAddress:o,setShippingAddress:s,needsShipping:m,hasCalculatedShipping:g},q);return Object(i.createElement)(i.Fragment,null,Object(i.createElement)(P.Provider,{value:W},t))}},812:function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));var n=r(0),c=r(235),o=function(e){var t=e.children,r=e.redirectUrl;return Object(n.createElement)(c.a,{isCart:!0,redirectUrl:r},t)}},814:function(e,t,r){"use strict";r.d(t,"a",(function(){return m}));var n=r(8),c=r.n(n),o=r(14),a=r(0),i=r(24),s=r(287),u=r(136),l=r(369),p=r(72),d=r(43),b=r(57),m=function(e){var t={key:"",quantity:1};(function(e){return Object(p.b)(e)&&Object(p.d)(e,"key")&&Object(p.d)(e,"quantity")&&Object(p.c)(e.key)&&Object(p.a)(e.quantity)})(e)&&(t.key=e.key,t.quantity=e.quantity);var r=t.key,n=void 0===r?"":r,m=t.quantity,f=void 0===m?1:m,O=Object(d.a)().cartErrors,g=Object(b.b)().dispatchActions,h=Object(a.useState)(f),v=c()(h,2),j=v[0],E=v[1],y=Object(s.a)(j,400),_=c()(y,1)[0],w=Object(u.a)(_),k=Object(o.useDispatch)(i.CART_STORE_KEY),S=k.removeItemFromCart,C=k.changeCartItemQuantity,P=Object(o.useSelect)((function(e){if(!n)return{quantity:!1,delete:!1};var t=e(i.CART_STORE_KEY);return{quantity:t.isItemPendingQuantity(n),delete:t.isItemPendingDelete(n)}}),[n]),R=Object(a.useCallback)((function(){return n?S(n).then((function(){return Object(l.c)(),!0})):Promise.resolve(!1)}),[n,S]);return Object(a.useEffect)((function(){n&&Object(p.a)(w)&&Number.isFinite(w)&&w!==_&&C(n,_)}),[n,C,_,w]),Object(a.useEffect)((function(){return P.delete?g.incrementCalculating():g.decrementCalculating(),function(){P.delete&&g.decrementCalculating()}}),[g,P.delete]),Object(a.useEffect)((function(){return P.quantity||_!==j?g.incrementCalculating():g.decrementCalculating(),function(){(P.quantity||_!==j)&&g.decrementCalculating()}}),[g,P.quantity,_,j]),{isPendingDelete:P.delete,quantity:j,setItemQuantity:E,removeItem:R,cartItemQuantityErrors:O}}},815:function(e,t,r){"use strict";var n=r(0),c=r(1),o=r(53),a=r(110);t.a=function(e){var t=e.currency,r=e.saleAmount,i=e.format,s=void 0===i?"<price/>":i;if(!r||r<=0)return null;s.includes("<price/>")||(s="<price/>",console.error("Price formats need to include the `<price/>` tag."));var u=Object(c.sprintf)(
/* translators: %s will be replaced by the discount amount */
Object(c.__)("Save %s",'woocommerce'),s);return Object(n.createElement)(a.a,{className:"wc-block-components-sale-badge"},Object(n.createInterpolateElement)(u,{price:Object(n.createElement)(o.a,{currency:t,value:r})}))}},818:function(e,t,r){"use strict";var n=r(0),c=r(1),o=r(163),a=r(50),i=r(57),s=r(174),u=r(141),l=r(83),p=r(198);r(274),t.a=function(){var e=Object(o.a)(),t=e.paymentMethods,r=e.isInitialized,d=Object(a.c)().noticeContexts,b=Object(i.b)(),m=b.isCalculating,f=b.isProcessing,O=b.isAfterProcessing,g=b.isBeforeProcessing,h=b.isComplete,v=b.hasError,j=Object(s.b)().currentStatus;if(!r||r&&0===Object.keys(t).length)return null;var E=f||O||g||h&&!v;return Object(n.createElement)(n.Fragment,null,Object(n.createElement)(l.a,{isLoading:m||E||j.isDoingExpressPayment},Object(n.createElement)("div",{className:"wc-block-components-express-payment wc-block-components-express-payment--cart"},Object(n.createElement)("div",{className:"wc-block-components-express-payment__content"},Object(n.createElement)(u.a,{context:d.EXPRESS_PAYMENTS},Object(n.createElement)(p.a,null))))),Object(n.createElement)("div",{className:"wc-block-components-express-payment-continue-rule wc-block-components-express-payment-continue-rule--cart"},Object(c.__)("Or",'woocommerce')))}},83:function(e,t,r){"use strict";var n=r(0),c=r(1),o=(r(2),r(6)),a=r.n(o),i=(r(259),r(114));t.a=function(e){var t=e.children,r=e.className,o=e.screenReaderLabel,s=e.showSpinner,u=void 0!==s&&s,l=e.isLoading,p=void 0===l||l;return Object(n.createElement)("div",{className:a()(r,{"wc-block-components-loading-mask":p})},p&&u&&Object(n.createElement)(i.a,null),Object(n.createElement)("div",{className:a()({"wc-block-components-loading-mask__children":p}),"aria-hidden":p},t),p&&Object(n.createElement)("span",{className:"screen-reader-text"},o||Object(c.__)("Loading…",'woocommerce')))}},833:function(e,t,r){"use strict";var n=r(0),c=r(28),o=Object(n.createElement)(c.SVG,{xmlns:"http://www.w3.org/2000/SVG",viewBox:"0 0 24 24",fill:"none"},Object(n.createElement)("path",{stroke:"currentColor",strokeWidth:"1.5",fill:"none",d:"M6 3.75h12c.69 0 1.25.56 1.25 1.25v14c0 .69-.56 1.25-1.25 1.25H6c-.69 0-1.25-.56-1.25-1.25V5c0-.69.56-1.25 1.25-1.25z"}),Object(n.createElement)("path",{fill:"currentColor",fillRule:"evenodd",d:"M6.9 7.5A1.1 1.1 0 018 6.4h8a1.1 1.1 0 011.1 1.1v2a1.1 1.1 0 01-1.1 1.1H8a1.1 1.1 0 01-1.1-1.1v-2zm1.2.1v1.8h7.8V7.6H8.1z",clipRule:"evenodd"}),Object(n.createElement)("path",{fill:"currentColor",d:"M8.5 12h1v1h-1v-1zM8.5 14h1v1h-1v-1zM8.5 16h1v1h-1v-1zM11.5 12h1v1h-1v-1zM11.5 14h1v1h-1v-1zM11.5 16h1v1h-1v-1zM14.5 12h1v1h-1v-1zM14.5 14h1v1h-1v-1zM14.5 16h1v1h-1v-1z"}));t.a=o},841:function(e,t,r){e.exports=r(853)},842:function(e,t){},843:function(e,t){},844:function(e,t){},845:function(e,t){},846:function(e,t){},847:function(e,t){},853:function(e,t,r){"use strict";r.r(t);var n=r(0),c=r(1),o=r(66),a=r(361),i=r(159),s=r(6),u=r.n(s),l=r(196),p=r(12),d=r(4),b=r(517),m=r(37),f=r(125),O=r(63),g=r(812),h=r(3),v=r(518),j=r(28),E=Object(n.createElement)(j.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(n.createElement)("g",{fill:"none",fillRule:"evenodd"},Object(n.createElement)("path",{d:"M0 0h24v24H0z"}),Object(n.createElement)("path",{fill:"currentColor",fillRule:"nonzero",d:"M15.55 13c.75 0 1.41-.41 1.75-1.03l3.58-6.49A.996.996 0 0 0 20.01 4H5.21l-.94-2H1v2h2l3.6 7.59-1.35 2.44C4.52 15.37 5.48 17 7 17h12v-2H7l1.1-2h7.45ZM7 18c-1.1 0-1.99.9-1.99 2S5.9 22 7 22s2-.9 2-2-.9-2-2-2Zm10 0c-1.1 0-1.99.9-1.99 2s.89 2 1.99 2 2-.9 2-2-.9-2-2-2Z"}))," "),y=Object(n.createElement)(j.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(n.createElement)("path",{d:"M22.7 22.7l-20-20L2 2l-.7-.7L0 2.5 4.4 7l2.2 4.7L5.2 14A2 2 0 007 17h7.5l1.3 1.4a2 2 0 102.8 2.8l2.9 2.8 1.2-1.3zM7.4 15a.2.2 0 01-.2-.3l.9-1.7h2.4l2 2h-5zm8.2-2a2 2 0 001.7-1l3.6-6.5.1-.5c0-.6-.4-1-1-1H6.5l9 9zM7 18a2 2 0 100 4 2 2 0 000-4z"}),Object(n.createElement)("path",{fill:"none",d:"M0 0h24v24H0z"})),_=(r(847),r(5)),w=r.n(_),k=r(74),S=r(14),C=r(46),P=r(55),R=r(26);function x(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function N(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?x(Object(r),!0).forEach((function(t){w()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):x(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var I=function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];t?window.document.body.classList.add(e):window.document.body.classList.remove(e)},T=function(e){var t=e.ref,r=Object(P.hasFilter)("blocks.registerBlockType","core/lock/addAttribute"),c=t.current;return Object(n.useEffect)((function(){if(c&&!r)return c.addEventListener("keydown",e,{capture:!0,passive:!1}),function(){c.removeEventListener("keydown",e,{capture:!0})};function e(e){var t=e.keyCode,r=e.target;if(r instanceof HTMLElement&&(t===C.BACKSPACE||t===C.DELETE)&&!Object(k.isTextField)(r)){var n=r;void 0!==n.dataset.block&&function(e){var t,r,n,c,o;if(!e)return!1;var a=(0,Object(S.select)(p.store).getBlock)(e);if("boolean"==typeof(null==a||null===(t=a.attributes)||void 0===t||null===(r=t.lock)||void 0===r?void 0:r.remove))return a.attributes.lock.remove;var i,s,u,l=Object(R.getBlockType)(a.name);return"boolean"==typeof(null==l||null===(n=l.attributes)||void 0===n||null===(c=n.lock)||void 0===c||null===(o=c.default)||void 0===o?void 0:o.remove)&&(null==l||null===(i=l.attributes)||void 0===i||null===(s=i.lock)||void 0===s||null===(u=s.default)||void 0===u?void 0:u.remove)}(n.dataset.block)&&(e.preventDefault(),e.stopPropagation(),e.stopImmediatePropagation())}}}),[c,r])},M=r(8),A=r.n(M),D=Object(n.createElement)(j.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(n.createElement)("path",{fill:"none",d:"M0 0h24v24H0V0z"}),Object(n.createElement)("path",{d:"M12 6a9.77 9.77 0 0 1 8.82 5.5C19.17 14.87 15.79 17 12 17s-7.17-2.13-8.82-5.5A9.77 9.77 0 0 1 12 6m0-2C7 4 2.73 7.11 1 11.5 2.73 15.89 7 19 12 19s9.27-3.11 11-7.5C21.27 7.11 17 4 12 4zm0 5a2.5 2.5 0 0 1 0 5 2.5 2.5 0 0 1 0-5m0-2c-2.48 0-4.5 2.02-4.5 4.5S9.52 16 12 16s4.5-2.02 4.5-4.5S14.48 7 12 7z"}));function L(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function B(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?L(Object(r),!0).forEach((function(t){w()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):L(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var V=Object(n.createContext)({currentView:""}),F=function(){return Object(n.useContext)(V)};Object(P.hasFilter)("blocks.registerBlockType","core/lock/addAttribute")||Object(S.subscribe)((function(){var e,t,r,n,c=Object(S.select)(p.store);if(c){var o=c.getSelectedBlock();o&&(I("wc-lock-selected-block--remove",!(null==o||null===(e=o.attributes)||void 0===e||null===(t=e.lock)||void 0===t||!t.remove)),I("wc-lock-selected-block--move",!(null==o||null===(r=o.attributes)||void 0===r||null===(n=r.lock)||void 0===n||!n.move)))}}));var U=["woocommerce/filled-cart-block","woocommerce/empty-cart-block"],z=function(e){var t=e.attributes,r=e.setAttributes,o=t.isShippingCalculatorEnabled,a=t.showRateAfterTaxName,i=Object(O.b)().currentPostId;return Object(n.createElement)(p.InspectorControls,null,i!==m.c&&Object(n.createElement)(d.Notice,{className:"wc-block-cart__page-notice",isDismissible:!1,status:"warning"},Object(n.createInterpolateElement)(Object(c.__)("If you would like to use this block as your default cart you must update your <a>page settings in WooCommerce</a>.",'woocommerce'),{a:Object(n.createElement)("a",{href:Object(h.getAdminLink)("admin.php?page=wc-settings&tab=advanced"),target:"_blank",rel:"noopener noreferrer"})})),Object(h.getSetting)("shippingEnabled",!0)&&Object(n.createElement)(d.PanelBody,{title:Object(c.__)("Shipping rates",'woocommerce')},Object(n.createElement)(d.ToggleControl,{label:Object(c.__)("Shipping calculator",'woocommerce'),help:Object(c.__)("Allow customers to estimate shipping by entering their address.",'woocommerce'),checked:o,onChange:function(){return r({isShippingCalculatorEnabled:!o})}})),Object(h.getSetting)("taxesEnabled")&&Object(h.getSetting)("displayItemizedTaxes",!1)&&!Object(h.getSetting)("displayCartPricesIncludingTax",!1)&&Object(n.createElement)(d.PanelBody,{title:Object(c.__)("Taxes",'woocommerce')},Object(n.createElement)(d.ToggleControl,{label:Object(c.__)("Show rate after tax name",'woocommerce'),help:Object(c.__)("Show the percentage rate alongside each tax line in the summary.",'woocommerce'),checked:a,onChange:function(){return r({showRateAfterTaxName:!a})}})),Object(n.createElement)(l.a,null))},G=(r(842),{isPreview:{type:"boolean",default:!1,save:!1},isShippingCalculatorEnabled:{type:"boolean",default:Object(h.getSetting)("isShippingCalculatorEnabled",!0)},checkoutPageId:{type:"number",default:0},hasDarkControls:{type:"boolean",default:Object(h.getSetting)("hasDarkEditorStyleSupport",!1)},showRateAfterTaxName:{type:"boolean",default:!0}}),q=r(9),H=r.n(q),Y=r(27),W=r(494),$=function(e){var t=e.clientId,r=e.template,c=Object(n.useRef)(r),o=Object(S.useDispatch)("core/block-editor").insertBlock,a=Object(S.useSelect)((function(e){return{innerBlocks:e("core/block-editor").getBlocks(t),templateTypes:c.current.map((function(e){return Object(R.getBlockType)(e)}))}}),[t,c]),i=a.innerBlocks,s=a.templateTypes;Object(n.useLayoutEffect)((function(){t&&s.forEach((function(e){if(e&&(s=e.attributes,Boolean((null===(n=s.lock)||void 0===n?void 0:n.remove)||(null===(c=s.lock)||void 0===c||null===(a=c.default)||void 0===a?void 0:a.remove)))&&!i.find((function(t){return t.name===e.name}))){var r=Object(R.createBlock)(e.name);o(r,i.length,t,!1)}var n,c,a,s}))}),[t,i,o,s])},K=r(33),X=r.n(K),Q=["core/paragraph","core/image","core/separator"],J=function(e){return[].concat(X()(Object(R.getBlockTypes)().filter((function(t){return((null==t?void 0:t.parent)||[]).includes(e)})).map((function(e){return e.name}))),Q)},Z=r(16),ee=r.n(Z),te=["children"],re=function(e){var t=e.children,r=ee()(e,te),c=Object(p.useBlockProps)(r);return Object(n.createElement)("div",c,t)},ne=(r(843),r(547));Object(i.d)(ne,{icon:{src:Object(n.createElement)(o.a,{srcElement:E}),foreground:"#874FB9"},edit:function(e){var t=e.clientId,r=Object(p.useBlockProps)(),c=F().currentView,o=J(Y.innerBlockAreas.FILLED_CART);return $({clientId:t,template:o}),Object(n.createElement)("div",H()({},r,{hidden:"woocommerce/filled-cart-block"!==c}),Object(n.createElement)(re,null,Object(n.createElement)(W.a,{className:"wc-block-cart"},Object(n.createElement)(p.InnerBlocks,{allowedBlocks:o,templateLock:!1}))))},save:function(){return Object(n.createElement)("div",p.useBlockProps.save(),Object(n.createElement)(p.InnerBlocks.Content,null))}});var ce=r(892),oe=r(893),ae=r(495),ie=r(548);Object(i.d)(ie,{icon:{src:Object(n.createElement)(ce.a,{icon:oe.a}),foreground:"#874FB9"},edit:function(e){var t=e.clientId,r=Object(p.useBlockProps)(),c=J(Y.innerBlockAreas.CART_ITEMS);return $({clientId:t,template:c}),Object(n.createElement)(ae.a,{className:"wc-block-cart__main"},Object(n.createElement)("div",r,Object(n.createElement)(p.InnerBlocks,{allowedBlocks:c,templateLock:!1,renderAppender:p.InnerBlocks.ButtonBlockAppender})))},save:function(){return Object(n.createElement)("div",p.useBlockProps.save(),Object(n.createElement)(p.InnerBlocks.Content,null))}});var se=r(43),ue=r(281),le=r(124),pe=r(154),de=r(814),be=r(68),me=r(307),fe=r(308),Oe=r(309),ge=r(815),he=r(311),ve=r(47),je=r(151),Ee=r(72),ye=["receiveCart"],_e=function(e,t){return e.convertPrecision(t.minorUnit).getAmount()},we=function(e){return Object(Y.mustContain)(e,"<price/>")},ke=function(e){var t=e.lineItem,r=t.name,o=void 0===r?"":r,a=t.catalog_visibility,i=void 0===a?"visible":a,s=t.short_description,l=void 0===s?"":s,p=t.description,d=void 0===p?"":p,b=t.low_stock_remaining,m=void 0===b?null:b,f=t.show_backorder_badge,O=void 0!==f&&f,g=t.quantity_limit,v=void 0===g?99:g,j=t.permalink,E=void 0===j?"":j,y=t.images,_=void 0===y?[]:y,w=t.variation,k=void 0===w?[]:w,S=t.item_data,C=void 0===S?[]:S,P=t.prices,R=void 0===P?{currency_code:"USD",currency_minor_unit:2,currency_symbol:"$",currency_prefix:"$",currency_suffix:"",currency_decimal_separator:".",currency_thousand_separator:",",price:"0",regular_price:"0",sale_price:"0",price_range:null,raw_prices:{precision:6,price:"0",regular_price:"0",sale_price:"0"}}:P,x=t.totals,N=void 0===x?{currency_code:"USD",currency_minor_unit:2,currency_symbol:"$",currency_prefix:"$",currency_suffix:"",currency_decimal_separator:".",currency_thousand_separator:",",line_subtotal:"0",line_subtotal_tax:"0"}:x,I=t.extensions,T=Object(de.a)(t),M=T.quantity,A=T.setItemQuantity,D=T.removeItem,L=T.isPendingDelete,B=Object(be.a)().dispatchStoreEvent,V=Object(se.a)(),F=(V.receiveCart,ee()(V,ye)),U=Object(n.useMemo)((function(){return{context:"cart",cartItem:t,cart:F}}),[t,F]),z=Object(ve.getCurrencyFromPriceResponse)(R),G=Object(Y.__experimentalApplyCheckoutFilter)({filterName:"itemName",defaultValue:o,extensions:I,arg:U}),q=Object(je.a)({amount:parseInt(R.raw_prices.regular_price,10),precision:R.raw_prices.precision}),H=Object(je.a)({amount:parseInt(R.raw_prices.price,10),precision:R.raw_prices.precision}),W=q.subtract(H),$=W.multiply(M),K=Object(ve.getCurrencyFromPriceResponse)(N),X=parseInt(N.line_subtotal,10);Object(h.getSetting)("displayCartPricesIncludingTax",!1)&&(X+=parseInt(N.line_subtotal_tax,10));var Q=Object(je.a)({amount:X,precision:K.minorUnit}),J=_.length?_[0]:{},Z="hidden"===i||"search"===i,te=Object(Y.__experimentalApplyCheckoutFilter)({filterName:"cartItemPrice",defaultValue:"<price/>",extensions:I,arg:U,validation:we}),re=Object(Y.__experimentalApplyCheckoutFilter)({filterName:"subtotalPriceFormat",defaultValue:"<price/>",extensions:I,arg:U,validation:we}),ne=Object(Y.__experimentalApplyCheckoutFilter)({filterName:"saleBadgePriceFormat",defaultValue:"<price/>",extensions:I,arg:U,validation:we});return Object(n.createElement)("tr",{className:u()("wc-block-cart-items__row",{"is-disabled":L})},Object(n.createElement)("td",{className:"wc-block-cart-item__image","aria-hidden":!Object(Ee.d)(J,"alt")||!J.alt},Z?Object(n.createElement)(me.a,{image:J}):Object(n.createElement)("a",{href:E,tabIndex:-1},Object(n.createElement)(me.a,{image:J}))),Object(n.createElement)("td",{className:"wc-block-cart-item__product"},Object(n.createElement)(pe.a,{disabled:L||Z,name:G,permalink:E}),O?Object(n.createElement)(fe.a,null):!!m&&Object(n.createElement)(Oe.a,{lowStockRemaining:m}),Object(n.createElement)("div",{className:"wc-block-cart-item__prices"},Object(n.createElement)(le.a,{currency:z,regularPrice:_e(q,z),price:_e(H,z),format:re})),Object(n.createElement)(ge.a,{currency:z,saleAmount:_e(W,z),format:ne}),Object(n.createElement)(he.a,{shortDescription:l,fullDescription:d,itemData:C,variation:k}),Object(n.createElement)("div",{className:"wc-block-cart-item__quantity"},Object(n.createElement)(ue.a,{disabled:L,quantity:M,maximum:v,onChange:function(e){A(e),B("cart-set-item-quantity",{product:t,quantity:e})},itemName:G}),Object(n.createElement)("button",{className:"wc-block-cart-item__remove-link",onClick:function(){D(),B("cart-remove-item",{product:t,quantity:M})},disabled:L},Object(c.__)("Remove item",'woocommerce')))),Object(n.createElement)("td",{className:"wc-block-cart-item__total"},Object(n.createElement)("div",{className:"wc-block-cart-item__total-price-and-sale-badge-wrapper"},Object(n.createElement)(le.a,{currency:K,format:te,price:Q.getAmount()}),M>1&&Object(n.createElement)(ge.a,{currency:z,saleAmount:_e($,z),format:ne}))))},Se=X()(Array(3)).map((function(_x,e){return Object(n.createElement)(ke,{lineItem:{},key:e})})),Ce=function(e){var t=e.lineItems,r=void 0===t?[]:t,o=e.isLoading,a=void 0!==o&&o?Se:r.map((function(e){return Object(n.createElement)(ke,{key:e.key,lineItem:e})}));return Object(n.createElement)("table",{className:"wc-block-cart-items"},Object(n.createElement)("thead",null,Object(n.createElement)("tr",{className:"wc-block-cart-items__header"},Object(n.createElement)("th",{className:"wc-block-cart-items__header-image"},Object(n.createElement)("span",null,Object(c.__)("Product",'woocommerce'))),Object(n.createElement)("th",{className:"wc-block-cart-items__header-product"},Object(n.createElement)("span",null,Object(c.__)("Details",'woocommerce'))),Object(n.createElement)("th",{className:"wc-block-cart-items__header-total"},Object(n.createElement)("span",null,Object(c.__)("Total",'woocommerce'))))),Object(n.createElement)("tbody",null,a))},Pe=function(){var e=Object(se.a)(),t=e.cartItems,r=e.cartIsLoading;return Object(n.createElement)(Ce,{lineItems:t,isLoading:r})},Re=r(549);Object(i.d)(Re,{icon:{src:Object(n.createElement)(ce.a,{icon:oe.a}),foreground:"#874FB9"},edit:function(){var e=Object(p.useBlockProps)();return Object(n.createElement)("div",e,Object(n.createElement)(Pe,null))},save:function(){return Object(n.createElement)("div",p.useBlockProps.save())}});var xe=r(496),Ne=(r(844),r(550));Object(i.d)(Ne,{icon:{src:Object(n.createElement)(ce.a,{icon:oe.a}),foreground:"#874FB9"},edit:function(e){var t=e.clientId,r=Object(p.useBlockProps)(),c=J(Y.innerBlockAreas.CART_TOTALS);return $({clientId:t,template:c}),Object(n.createElement)(xe.a,{className:"wc-block-cart__sidebar"},Object(n.createElement)("div",r,Object(n.createElement)(p.InnerBlocks,{allowedBlocks:c,templateLock:!1})))},save:function(){return Object(n.createElement)("div",p.useBlockProps.save(),Object(n.createElement)(p.InnerBlocks.Content,null))}});var Ie=r(833),Te=r(497),Me=r(498),Ae=r(510),De=r(501),Le=r(201),Be=r(135),Ve=["extensions"],Fe=function(e){var t=e.showRateAfterTaxName,r=void 0!==t&&t,o=e.isShippingCalculatorEnabled,a=void 0===o||o,i=Object(se.a)(),s=i.cartFees,u=i.cartTotals,l=i.cartNeedsShipping,p=Object(Le.a)(),d=p.applyCoupon,b=p.removeCoupon,m=p.isApplyingCoupon,f=p.isRemovingCoupon,O=p.appliedCoupons,g=Object(ve.getCurrencyFromPriceResponse)(u),v=Object(se.a)(),j=v.extensions,E=ee()(v,Ve),y={extensions:j,cart:E},_={extensions:j,cart:E};return Object(n.createElement)(n.Fragment,null,Object(n.createElement)(Be.a,{headingLevel:"2",className:"wc-block-cart__totals-title"},Object(c.__)("Cart totals",'woocommerce')),Object(n.createElement)(Y.TotalsWrapper,null,Object(n.createElement)(Y.Subtotal,{currency:g,values:u}),Object(n.createElement)(Y.TotalsFees,{currency:g,cartFees:s}),Object(n.createElement)(Te.a,{cartCoupons:O,currency:g,isRemovingCoupon:f,removeCoupon:b,values:u})),Object(h.getSetting)("couponsEnabled",!0)&&Object(n.createElement)(Y.TotalsWrapper,null,Object(n.createElement)(Me.a,{onSubmit:d,isLoading:m})),Object(n.createElement)(Y.ExperimentalDiscountsMeta.Slot,_),l&&Object(n.createElement)(Y.TotalsWrapper,null,Object(n.createElement)(Ae.a,{showCalculator:a,showRateSelector:!0,values:u,currency:g})),!Object(h.getSetting)("displayCartPricesIncludingTax",!1)&&parseInt(u.total_tax,10)>0&&Object(n.createElement)(Y.TotalsWrapper,null,Object(n.createElement)(Y.TotalsTaxes,{showRateAfterTaxName:r,currency:g,values:u})),Object(n.createElement)(Y.TotalsWrapper,null,Object(n.createElement)(De.a,{currency:g,values:u})),Object(n.createElement)(Y.ExperimentalOrderMeta.Slot,y))},Ue={showRateAfterTaxName:{type:"boolean",default:Object(h.getSetting)("displayCartPricesIncludingTax",!1)},lock:{type:"object",default:{move:!0,remove:!0}}},ze=r(551);Object(i.d)(ze,{icon:{src:Object(n.createElement)(o.a,{srcElement:Ie.a}),foreground:"#874FB9"},attributes:Ue,edit:function(e){var t=e.attributes,r=e.setAttributes,o=t.showRateAfterTaxName,a=t.isShippingCalculatorEnabled,i=Object(p.useBlockProps)(),s=Object(h.getSetting)("taxesEnabled"),u=Object(h.getSetting)("displayItemizedTaxes",!1),l=Object(h.getSetting)("displayCartPricesIncludingTax",!1);return Object(n.createElement)("div",i,Object(n.createElement)(p.InspectorControls,null,Object(h.getSetting)("shippingEnabled",!0)&&Object(n.createElement)(d.PanelBody,{title:Object(c.__)("Shipping rates",'woocommerce')},Object(n.createElement)(d.ToggleControl,{label:Object(c.__)("Shipping calculator",'woocommerce'),help:Object(c.__)("Allow customers to estimate shipping by entering their address.",'woocommerce'),checked:a,onChange:function(){return r({isShippingCalculatorEnabled:!a})}})),s&&u&&!l&&Object(n.createElement)(d.PanelBody,{title:Object(c.__)("Taxes",'woocommerce')},Object(n.createElement)(d.ToggleControl,{label:Object(c.__)("Show rate after tax name",'woocommerce'),help:Object(c.__)("Show the percentage rate alongside each tax line in the summary.",'woocommerce'),checked:o,onChange:function(){return r({showRateAfterTaxName:!o})}}))),Object(n.createElement)(d.Disabled,null,Object(n.createElement)(Fe,{showRateAfterTaxName:t.showRateAfterTaxName,isShippingCalculatorEnabled:t.isShippingCalculatorEnabled})))},save:function(){return Object(n.createElement)("div",p.useBlockProps.save())}});var Ge=r(502),qe=r(891),He=r(182),Ye=r(163),We=r(818),$e=function(){return Object(se.a)().cartNeedsPayment?Object(n.createElement)("div",{className:"wc-block-cart__payment-options"},Object(n.createElement)(We.a,null)):null},Ke=(r(845),function(){return Object(n.createElement)(qe.a,{icon:Object(n.createElement)(o.a,{srcElement:Ge.a}),label:Object(c.__)("Express Checkout",'woocommerce'),className:"wp-block-woocommerce-checkout-express-payment-block-placeholder"},Object(n.createElement)("span",{className:"wp-block-woocommerce-checkout-express-payment-block-placeholder__description"},Object(c.__)("Your store doesn't have any Payment Methods that support the Express Checkout Block. If they are added, they will be shown here.",'woocommerce')),Object(n.createElement)(He.a,{isPrimary:!0,href:"".concat(h.ADMIN_URL,"admin.php?page=wc-settings&tab=checkout"),target:"_blank",rel:"noopener noreferrer",className:"wp-block-woocommerce-checkout-express-payment-block-placeholder__button"},Object(c.__)("Configure Payment Methods",'woocommerce')))}),Xe=r(552);Object(i.d)(Xe,{icon:{src:Object(n.createElement)(o.a,{srcElement:Ge.a}),foreground:"#874FB9"},edit:function(){var e=Object(Ye.a)(),t=e.paymentMethods,r=e.isInitialized,c=Object.keys(t).length>0,o=Object(p.useBlockProps)({className:u()({"wp-block-woocommerce-cart-express-payment-block--has-express-payment-methods":c})});return r?Object(n.createElement)("div",o,c?Object(n.createElement)($e,null):Object(n.createElement)(Ke,null)):null},save:function(){return Object(n.createElement)("div",p.useBlockProps.save())}});var Qe=r(896),Je=r(195),Ze=r(554),et=function(e){var t=e.checkoutPageId;return Object(n.createElement)(Ze.a,{link:Object(h.getSetting)("page-"+t,!1)})},tt=r(553);Object(i.d)(tt,{icon:{src:Object(n.createElement)(ce.a,{icon:Qe.a}),foreground:"#874FB9"},attributes:{checkoutPageId:{type:"number",default:0},lock:{type:"object",default:{move:!0,remove:!0}}},edit:function(e){var t=e.attributes,r=e.setAttributes,o=Object(p.useBlockProps)(),a=t.checkoutPageId,i=void 0===a?0:a,s=Object(n.useRef)(i).current,u=Object(S.useSelect)((function(e){return s||e("core/editor").getCurrentPostId()}),[s]);return Object(n.createElement)("div",o,Object(n.createElement)(p.InspectorControls,null,!(u===m.c&&0===s)&&Object(n.createElement)(Je.a,{pageId:i,setPageId:function(e){return r({checkoutPageId:e})},labels:{title:Object(c.__)("Proceed to Checkout button",'woocommerce'),default:Object(c.__)("WooCommerce Checkout Page",'woocommerce')}})),Object(n.createElement)(d.Disabled,null,Object(n.createElement)(et,{checkoutPageId:i})))},save:function(){return Object(n.createElement)("div",p.useBlockProps.save())}});var rt=r(555);Object(i.d)(rt,{icon:{src:Object(n.createElement)(o.a,{srcElement:y}),foreground:"#874FB9"},edit:function(e){var t=e.clientId,r=Object(p.useBlockProps)(),c=F().currentView,o=J(Y.innerBlockAreas.EMPTY_CART);return $({clientId:t,template:o}),Object(n.createElement)("div",H()({},r,{hidden:"woocommerce/empty-cart-block"!==c}),"This is the empty cart block.",Object(n.createElement)(p.InnerBlocks,{allowedBlocks:o,templateLock:!1}))},save:function(){return Object(n.createElement)("div",p.useBlockProps.save(),Object(n.createElement)(p.InnerBlocks.Content,null))}});var nt={title:Object(c.__)("Cart i2",'woocommerce'),icon:{src:Object(n.createElement)(o.a,{srcElement:a.a}),foreground:"#96588a"},category:"woocommerce",keywords:[Object(c.__)("WooCommerce",'woocommerce')],description:Object(c.__)("Shopping cart.",'woocommerce'),supports:{align:!1,html:!1,multiple:!1,__experimentalExposeControlsToChildren:!0},example:{attributes:{isPreview:!0}},attributes:G,edit:function(e){var t=e.className,r=e.attributes,a=e.setAttributes,i=function(e,t){var r=t[0],a=Object(n.useState)(r),i=A()(a,2),s=i[0],u=i[1],l=Object(S.useDispatch)("core/block-editor").selectBlock,b=Object(S.select)(p.store).getBlock;return{currentView:s.view,component:function(){return Object(n.createElement)(d.Toolbar,null,Object(n.createElement)(d.ToolbarDropdownMenu,{label:Object(c.__)("Switch view",'woocommerce'),text:s.label,icon:Object(n.createElement)(o.a,{srcElement:D,style:{marginRight:"8px"}}),controls:t.map((function(t){return B(B({},t),{},{title:t.label,onClick:function(){var r;u(t),l((null===(r=b(e).innerBlocks.find((function(e){return e.name===t.view})))||void 0===r?void 0:r.clientId)||e)}})}))}))}}}(e.clientId,[{view:"woocommerce/filled-cart-block",label:Object(c.__)("Filled Cart",'woocommerce'),icon:Object(n.createElement)(o.a,{srcElement:E})},{view:"woocommerce/empty-cart-block",label:Object(c.__)("Empty Cart",'woocommerce'),icon:Object(n.createElement)(o.a,{srcElement:y})}]),s=i.currentView,l=i.component,m=u()({"has-dark-controls":r.hasDarkControls}),h=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=Object(n.useRef)(),r=Object(p.useBlockProps)(N({ref:t},e));return T({ref:t}),r}({className:u()(t,"wp-block-woocommerce-cart",{"is-editor-preview":r.isPreview})});return Object(n.createElement)("div",h,Object(n.createElement)(f.a,{header:Object(c.__)("Cart Block Error",'woocommerce'),text:Object(c.__)("There was an error whilst rendering the cart block. If this problem continues, try re-creating the block.",'woocommerce'),showErrorMessage:!0,errorMessagePrefix:Object(c.__)("Error message:",'woocommerce')},Object(n.createElement)(O.a,{previewData:{previewCart:v.a}},Object(n.createElement)(z,{attributes:r,setAttributes:a}),Object(n.createElement)(p.BlockControls,{__experimentalShareWithChildBlocks:!0},Object(n.createElement)(l,null)),Object(n.createElement)(V.Provider,{value:{currentView:s}},Object(n.createElement)(g.a,null,Object(n.createElement)("div",{className:m},Object(n.createElement)(p.InnerBlocks,{allowedBlocks:U,template:[["woocommerce/filled-cart-block",{},[["woocommerce/cart-items-block",{},[["woocommerce/cart-line-items-block",{},[]]]],["woocommerce/cart-totals-block",{},[["woocommerce/cart-order-summary-block",{},[]],["woocommerce/cart-express-payment-block",{},[]],["woocommerce/proceed-to-checkout-block",{},[]]]]]],["woocommerce/empty-cart-block",{},[]]],templateLock:"insert"})))))),Object(n.createElement)(b.a,{blockName:"cart"}))},save:function(){return Object(n.createElement)("div",p.useBlockProps.save({className:"wc-block-cart is-loading"}),Object(n.createElement)(p.InnerBlocks.Content,null))}};Object(i.d)("woocommerce/cart-i2",nt)},90:function(e,t,r){"use strict";var n=r(9),c=r.n(n),o=r(16),a=r.n(o),i=r(0),s=r(182),u=r(6),l=r.n(u),p=r(114),d=(r(208),["className","showSpinner","children"]);t.a=function(e){var t=e.className,r=e.showSpinner,n=void 0!==r&&r,o=e.children,u=a()(e,d),b=l()("wc-block-components-button",t,{"wc-block-components-button--loading":n});return Object(i.createElement)(s.a,c()({className:b},u),n&&Object(i.createElement)(p.a,null),Object(i.createElement)("span",{className:"wc-block-components-button__text"},o))}},91:function(e,t){e.exports=window.wp.autop}});woocommerce-blocks/build/product-categories.asset.php000064400000000370151335517640017101 0ustar00<?php return array('dependencies' => array('lodash', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-element', 'wp-i18n', 'wp-polyfill', 'wp-primitives', 'wp-server-side-render'), 'version' => '4771baf5b0fa49f8d1e7a3929126dcce');woocommerce-blocks/build/wc-settings.asset.php000064400000000203151335517640015540 0ustar00<?php return array('dependencies' => array('wp-hooks', 'wp-i18n', 'wp-polyfill'), 'version' => '2bfda872b981f41f43ad8cea9284c109');woocommerce-blocks/build/vendors--cart-blocks/line-items--checkout-blocks/order-summary-frontend.js000064400000023711151335517640027574 0ustar00(window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[5],{125:function(t,n,r){"use strict";function e(t){return(e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function o(t){return function(t){if(Array.isArray(t))return t}(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||function(t,n){if(t){if("string"==typeof t)return i(t,void 0);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?i(t,void 0):void 0}}(t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function i(t,n){(null==n||n>t.length)&&(n=t.length);for(var r=0,e=new Array(n);r<n;r++)e[r]=t[r];return e}var u={normalizePrecision:function(t){var n=t.reduce((function(t,n){return Math.max(t.getPrecision(),n.getPrecision())}));return t.map((function(t){return t.getPrecision()!==n?t.convertPrecision(n):t}))},minimum:function(t){var n=o(t),r=n[0],e=n.slice(1),i=r;return e.forEach((function(t){i=i.lessThan(t)?i:t})),i},maximum:function(t){var n=o(t),r=n[0],e=n.slice(1),i=r;return e.forEach((function(t){i=i.greaterThan(t)?i:t})),i}};function a(t){return!isNaN(parseInt(t))&&isFinite(t)}function c(t){return t%2==0}function s(t){return a(t)&&!Number.isInteger(t)}function l(t){return Math.abs(t)%1==.5}function f(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};for(var r in n)t.setRequestHeader(r,n[r]);return t}function h(t){return void 0===t}function d(){var t={HALF_ODD:function(t){var n=Math.round(t);return l(t)&&c(n)?n-1:n},HALF_EVEN:function(t){var n=Math.round(t);return l(t)?c(n)?n:n-1:n},HALF_UP:function(t){return Math.round(t)},HALF_DOWN:function(t){return l(t)?Math.floor(t):Math.round(t)},HALF_TOWARDS_ZERO:function(t){return l(t)?Math.sign(t)*Math.floor(Math.abs(t)):Math.round(t)},HALF_AWAY_FROM_ZERO:function(t){return l(t)?Math.sign(t)*Math.ceil(Math.abs(t)):Math.round(t)},DOWN:function(t){return Math.floor(t)}};return{add:function(t,n){return t+n},subtract:function(t,n){return t-n},multiply:function(t,n){return s(t)||s(n)?function(t,n){var r=function(t){return Math.pow(10,function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,n=t.toString();if(n.indexOf("e-")>0)return parseInt(n.split("e-")[1]);var r=n.split(".")[1];return r?r.length:0}(t))},e=Math.max(r(t),r(n));return Math.round(t*e)*Math.round(n*e)/(e*e)}(t,n):t*n},divide:function(t,n){return t/n},modulo:function(t,n){return t%n},round:function(n){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"HALF_EVEN";return t[r](n)}}}var g=d();function m(t){var n=/^(?:(\$|USD)?0(?:(,)0)?(\.)?(0+)?|0(?:(,)0)?(\.)?(0+)?\s?(dollar)?)$/gm.exec(t);return{getMatches:function(){return null!==n?n.slice(1).filter((function(t){return!h(t)})):[]},getMinimumFractionDigits:function(){var t=function(t){return"."===t};return h(this.getMatches().find(t))?0:this.getMatches()[g.add(this.getMatches().findIndex(t),1)].split("").length},getCurrencyDisplay:function(){return{USD:"code",dollar:"name",$:"symbol"}[this.getMatches().find((function(t){return"USD"===t||"dollar"===t||"$"===t}))]},getStyle:function(){return h(this.getCurrencyDisplay(this.getMatches()))?"decimal":"currency"},getUseGrouping:function(){return!h(this.getMatches().find((function(t){return","===t})))}}}function v(t){var n=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",n=arguments.length>1?arguments[1]:void 0;for(var r in n)t=t.replace("{{".concat(r,"}}"),n[r]);return t};return{getExchangeRate:function(r,o){return(i=t.endpoint,!Boolean(i)||"object"!==e(i)&&"function"!=typeof i||"function"!=typeof i.then?function(r,e){return function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return new Promise((function(r,e){var o=Object.assign(new XMLHttpRequest,{onreadystatechange:function(){4===o.readyState&&(o.status>=200&&o.status<400?r(JSON.parse(o.responseText)):e(new Error(o.statusText)))},onerror:function(){e(new Error("Network error"))}});o.open("GET",t,!0),f(o,n.headers),o.send()}))}(n(t.endpoint,{from:r,to:e}),{headers:t.headers})}(r,o):t.endpoint).then((function(i){return function t(n){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:".",o={};return Object.entries(n).forEach((function(n){if("object"===e(n[1])){var i=t(n[1]);Object.entries(i).forEach((function(t){o[n[0]+r+t[0]]=t[1]}))}else o[n[0]]=n[1]})),o}(i)[n(t.propertyPath,{from:r,to:o})]}));var i}}}function p(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Error;if(!t)throw new r(n)}function y(t){p(function(t){return a(t)&&t<=100&&t>=0}(t),"You must provide a numeric value between 0 and 100.",RangeError)}function b(t){p(Number.isInteger(t),"You must provide an integer.",TypeError)}var A=d(),M=Object.assign((function t(n){var r=Object.assign({},{amount:t.defaultAmount,currency:t.defaultCurrency,precision:t.defaultPrecision},n),e=r.amount,o=r.currency,i=r.precision;b(e),b(i);var u=t.globalLocale,a=t.globalFormat,c=t.globalRoundingMode,s=t.globalFormatRoundingMode,l=Object.assign({},t.globalExchangeRatesApi),f=function(n){var r=Object.assign({},Object.assign({},{amount:e,currency:o,precision:i},n),Object.assign({},{locale:this.locale},n));return Object.assign(t({amount:r.amount,currency:r.currency,precision:r.precision}),{locale:r.locale})},d=function(t){p(this.hasSameCurrency(t),"You must provide a Dinero instance with the same currency.",TypeError)};return{getAmount:function(){return e},getCurrency:function(){return o},getLocale:function(){return this.locale||u},setLocale:function(t){return f.call(this,{locale:t})},getPrecision:function(){return i},convertPrecision:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:s;return b(t),f.call(this,{amount:A.round(A.multiply(this.getAmount(),Math.pow(10,A.subtract(t,this.getPrecision()))),n),precision:t})},add:function(n){d.call(this,n);var r=t.normalizePrecision([this,n]);return f.call(this,{amount:A.add(r[0].getAmount(),r[1].getAmount()),precision:r[0].getPrecision()})},subtract:function(n){d.call(this,n);var r=t.normalizePrecision([this,n]);return f.call(this,{amount:A.subtract(r[0].getAmount(),r[1].getAmount()),precision:r[0].getPrecision()})},multiply:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:c;return f.call(this,{amount:A.round(A.multiply(this.getAmount(),t),n)})},divide:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:c;return f.call(this,{amount:A.round(A.divide(this.getAmount(),t),n)})},percentage:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:c;return y(t),this.multiply(A.divide(t,100),n)},allocate:function(t){var n=this;!function(t){p(function(t){return t.length>0&&t.every((function(t){return t>=0}))&&t.some((function(t){return t>0}))}(t),"You must provide a non-empty array of numeric values greater than 0.",TypeError)}(t);for(var r=t.reduce((function(t,n){return A.add(t,n)})),e=this.getAmount(),o=t.map((function(t){var o=Math.floor(A.divide(A.multiply(n.getAmount(),t),r));return e=A.subtract(e,o),f.call(n,{amount:o})})),i=0;e>0;)t[i]>0&&(o[i]=o[i].add(f.call(this,{amount:1})),e=A.subtract(e,1)),i+=1;return o},convert:function(t){var n=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},e=r.endpoint,o=void 0===e?l.endpoint:e,i=r.propertyPath,u=void 0===i?l.propertyPath||"rates.{{to}}":i,a=r.headers,s=void 0===a?l.headers:a,d=r.roundingMode,g=void 0===d?c:d,m=Object.assign({},{endpoint:o,propertyPath:u,headers:s,roundingMode:g});return v(m).getExchangeRate(this.getCurrency(),t).then((function(r){return p(!h(r),'No rate was found for the destination currency "'.concat(t,'".'),TypeError),f.call(n,{amount:A.round(A.multiply(n.getAmount(),parseFloat(r)),m.roundingMode),currency:t})}))},equalsTo:function(t){return this.hasSameAmount(t)&&this.hasSameCurrency(t)},lessThan:function(n){d.call(this,n);var r=t.normalizePrecision([this,n]);return r[0].getAmount()<r[1].getAmount()},lessThanOrEqual:function(n){d.call(this,n);var r=t.normalizePrecision([this,n]);return r[0].getAmount()<=r[1].getAmount()},greaterThan:function(n){d.call(this,n);var r=t.normalizePrecision([this,n]);return r[0].getAmount()>r[1].getAmount()},greaterThanOrEqual:function(n){d.call(this,n);var r=t.normalizePrecision([this,n]);return r[0].getAmount()>=r[1].getAmount()},isZero:function(){return 0===this.getAmount()},isPositive:function(){return this.getAmount()>=0},isNegative:function(){return this.getAmount()<0},hasSubUnits:function(){return 0!==A.modulo(this.getAmount(),Math.pow(10,i))},hasCents:function(){return 0!==A.modulo(this.getAmount(),Math.pow(10,i))},hasSameCurrency:function(t){return this.getCurrency()===t.getCurrency()},hasSameAmount:function(n){var r=t.normalizePrecision([this,n]);return r[0].getAmount()===r[1].getAmount()},toFormat:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:a,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:s,r=m(t);return this.toRoundedUnit(r.getMinimumFractionDigits(),n).toLocaleString(this.getLocale(),{currencyDisplay:r.getCurrencyDisplay(),useGrouping:r.getUseGrouping(),minimumFractionDigits:r.getMinimumFractionDigits(),style:r.getStyle(),currency:this.getCurrency()})},toUnit:function(){return A.divide(this.getAmount(),Math.pow(10,i))},toRoundedUnit:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:s,r=Math.pow(10,t);return A.divide(A.round(A.multiply(this.toUnit(),r),n),r)},toObject:function(){return{amount:e,currency:o,precision:i}},toJSON:function(){return this.toObject()}}}),{defaultAmount:0,defaultCurrency:"USD",defaultPrecision:2},{globalLocale:"en-US",globalFormat:"$0,0.00",globalRoundingMode:"HALF_EVEN",globalFormatRoundingMode:"HALF_AWAY_FROM_ZERO",globalExchangeRatesApi:{endpoint:void 0,headers:void 0,propertyPath:void 0}},u);n.a=M}}]);order-summary--checkout-blocks/billing-address--checkout-blocks/order-summary---eb4d2cec-frontend.js000064400000033352151335517640040160 0ustar00woocommerce-blocks/build/vendors--cart-blocks(window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[2],{210:function(e,t,o){"use strict";var n=o(12),r=o(19),i=o(0),c=o(6),s=o.n(c),l=o(145);t.a=Object(i.forwardRef)((function(e,t){var o=e.className,c=Object(r.a)(e,["className"]),a=s()("components-flex__block",o);return Object(i.createElement)(l.a,Object(n.a)({},c,{className:a,ref:t}))}))},222:function(e,t,o){"use strict";e.exports=o(270)},270:function(e,t,o){"use strict";var n=o(271);e.exports=function(e,t,o){o=o||{},9===t.nodeType&&(t=n.getWindow(t));var r=o.allowHorizontalScroll,i=o.onlyScrollIfNeeded,c=o.alignWithTop,s=o.alignWithLeft,l=o.offsetTop||0,a=o.offsetLeft||0,u=o.offsetBottom||0,f=o.offsetRight||0;r=void 0===r||r;var d=n.isWindow(t),p=n.offset(e),h=n.outerHeight(e),v=n.outerWidth(e),b=void 0,m=void 0,g=void 0,y=void 0,w=void 0,O=void 0,j=void 0,x=void 0,k=void 0,L=void 0;d?(j=t,L=n.height(j),k=n.width(j),x={left:n.scrollLeft(j),top:n.scrollTop(j)},w={left:p.left-x.left-a,top:p.top-x.top-l},O={left:p.left+v-(x.left+k)+f,top:p.top+h-(x.top+L)+u},y=x):(b=n.offset(t),m=t.clientHeight,g=t.clientWidth,y={left:t.scrollLeft,top:t.scrollTop},w={left:p.left-(b.left+(parseFloat(n.css(t,"borderLeftWidth"))||0))-a,top:p.top-(b.top+(parseFloat(n.css(t,"borderTopWidth"))||0))-l},O={left:p.left+v-(b.left+g+(parseFloat(n.css(t,"borderRightWidth"))||0))+f,top:p.top+h-(b.top+m+(parseFloat(n.css(t,"borderBottomWidth"))||0))+u}),w.top<0||O.top>0?!0===c?n.scrollTop(t,y.top+w.top):!1===c?n.scrollTop(t,y.top+O.top):w.top<0?n.scrollTop(t,y.top+w.top):n.scrollTop(t,y.top+O.top):i||((c=void 0===c||!!c)?n.scrollTop(t,y.top+w.top):n.scrollTop(t,y.top+O.top)),r&&(w.left<0||O.left>0?!0===s?n.scrollLeft(t,y.left+w.left):!1===s?n.scrollLeft(t,y.left+O.left):w.left<0?n.scrollLeft(t,y.left+w.left):n.scrollLeft(t,y.left+O.left):i||((s=void 0===s||!!s)?n.scrollLeft(t,y.left+w.left):n.scrollLeft(t,y.left+O.left)))}},271:function(e,t,o){"use strict";var n=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var o=arguments[t];for(var n in o)Object.prototype.hasOwnProperty.call(o,n)&&(e[n]=o[n])}return e},r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};function i(e,t){var o=e["page"+(t?"Y":"X")+"Offset"],n="scroll"+(t?"Top":"Left");if("number"!=typeof o){var r=e.document;"number"!=typeof(o=r.documentElement[n])&&(o=r.body[n])}return o}function c(e){return i(e)}function s(e){return i(e,!0)}function l(e){var t=function(e){var t,o=void 0,n=void 0,r=e.ownerDocument,i=r.body,c=r&&r.documentElement;return o=(t=e.getBoundingClientRect()).left,n=t.top,{left:o-=c.clientLeft||i.clientLeft||0,top:n-=c.clientTop||i.clientTop||0}}(e),o=e.ownerDocument,n=o.defaultView||o.parentWindow;return t.left+=c(n),t.top+=s(n),t}var a=new RegExp("^("+/[\-+]?(?:\d*\.|)\d+(?:[eE][\-+]?\d+|)/.source+")(?!px)[a-z%]+$","i"),u=/^(top|right|bottom|left)$/,f="left",d=void 0;function p(e,t){for(var o=0;o<e.length;o++)t(e[o])}function h(e){return"border-box"===d(e,"boxSizing")}"undefined"!=typeof window&&(d=window.getComputedStyle?function(e,t,o){var n="",r=e.ownerDocument,i=o||r.defaultView.getComputedStyle(e,null);return i&&(n=i.getPropertyValue(t)||i[t]),n}:function(e,t){var o=e.currentStyle&&e.currentStyle[t];if(a.test(o)&&!u.test(t)){var n=e.style,r=n[f],i=e.runtimeStyle[f];e.runtimeStyle[f]=e.currentStyle[f],n[f]="fontSize"===t?"1em":o||0,o=n.pixelLeft+"px",n[f]=r,e.runtimeStyle[f]=i}return""===o?"auto":o});var v=["margin","border","padding"];function b(e,t,o){var n={},r=e.style,i=void 0;for(i in t)t.hasOwnProperty(i)&&(n[i]=r[i],r[i]=t[i]);for(i in o.call(e),t)t.hasOwnProperty(i)&&(r[i]=n[i])}function m(e,t,o){var n=0,r=void 0,i=void 0,c=void 0;for(i=0;i<t.length;i++)if(r=t[i])for(c=0;c<o.length;c++){var s;s="border"===r?r+o[c]+"Width":r+o[c],n+=parseFloat(d(e,s))||0}return n}function g(e){return null!=e&&e==e.window}var y={};function w(e,t,o){if(g(e))return"width"===t?y.viewportWidth(e):y.viewportHeight(e);if(9===e.nodeType)return"width"===t?y.docWidth(e):y.docHeight(e);var n="width"===t?["Left","Right"]:["Top","Bottom"],r="width"===t?e.offsetWidth:e.offsetHeight,i=(d(e),h(e)),c=0;(null==r||r<=0)&&(r=void 0,(null==(c=d(e,t))||Number(c)<0)&&(c=e.style[t]||0),c=parseFloat(c)||0),void 0===o&&(o=i?1:-1);var s=void 0!==r||i,l=r||c;if(-1===o)return s?l-m(e,["border","padding"],n):c;if(s){var a=2===o?-m(e,["border"],n):m(e,["margin"],n);return l+(1===o?0:a)}return c+m(e,v.slice(o),n)}p(["Width","Height"],(function(e){y["doc"+e]=function(t){var o=t.document;return Math.max(o.documentElement["scroll"+e],o.body["scroll"+e],y["viewport"+e](o))},y["viewport"+e]=function(t){var o="client"+e,n=t.document,r=n.body,i=n.documentElement[o];return"CSS1Compat"===n.compatMode&&i||r&&r[o]||i}}));var O={position:"absolute",visibility:"hidden",display:"block"};function j(e){var t=void 0,o=arguments;return 0!==e.offsetWidth?t=w.apply(void 0,o):b(e,O,(function(){t=w.apply(void 0,o)})),t}function x(e,t,o){var n=o;if("object"!==(void 0===t?"undefined":r(t)))return void 0!==n?("number"==typeof n&&(n+="px"),void(e.style[t]=n)):d(e,t);for(var i in t)t.hasOwnProperty(i)&&x(e,i,t[i])}p(["width","height"],(function(e){var t=e.charAt(0).toUpperCase()+e.slice(1);y["outer"+t]=function(t,o){return t&&j(t,e,o?0:1)};var o="width"===e?["Left","Right"]:["Top","Bottom"];y[e]=function(t,n){return void 0===n?t&&j(t,e,-1):t?(d(t),h(t)&&(n+=m(t,["padding","border"],o)),x(t,e,n)):void 0}})),e.exports=n({getWindow:function(e){var t=e.ownerDocument||e;return t.defaultView||t.parentWindow},offset:function(e,t){if(void 0===t)return l(e);!function(e,t){"static"===x(e,"position")&&(e.style.position="relative");var o=l(e),n={},r=void 0,i=void 0;for(i in t)t.hasOwnProperty(i)&&(r=parseFloat(x(e,i))||0,n[i]=r+t[i]-o[i]);x(e,n)}(e,t)},isWindow:g,each:p,css:x,clone:function(e){var t={};for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o]);if(e.overflow)for(var o in e)e.hasOwnProperty(o)&&(t.overflow[o]=e.overflow[o]);return t},scrollLeft:function(e,t){if(g(e)){if(void 0===t)return c(e);window.scrollTo(t,s(e))}else{if(void 0===t)return e.scrollLeft;e.scrollLeft=t}},scrollTop:function(e,t){if(g(e)){if(void 0===t)return s(e);window.scrollTo(c(e),t)}else{if(void 0===t)return e.scrollTop;e.scrollTop=t}},viewportWidth:0,viewportHeight:0},y)},340:function(e,t,o){"use strict";var n=o(0),r=o(6),i=o.n(r),c=o(7),s=o(1),l=o(24),a=o(50),u=o(33),f=o(34),d=Object(n.createElement)(f.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(n.createElement)(f.Path,{d:"M12 13.06l3.712 3.713 1.061-1.06L13.061 12l3.712-3.712-1.06-1.06L12 10.938 8.288 7.227l-1.061 1.06L10.939 12l-3.712 3.712 1.06 1.061L12 13.061z"})),p=o(12),h=o(19),v=o(15),b=o(16),m=o(13),g=o(17),y=o(18),w=o(9);var O=function(e){Object(g.a)(c,e);var t,o,r=(t=c,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,n=Object(w.a)(t);if(o){var r=Object(w.a)(this).constructor;e=Reflect.construct(n,arguments,r)}else e=n.apply(this,arguments);return Object(y.a)(this,e)});function c(){var e;return Object(v.a)(this,c),(e=r.apply(this,arguments)).onChange=e.onChange.bind(Object(m.a)(e)),e.bindInput=e.bindInput.bind(Object(m.a)(e)),e}return Object(b.a)(c,[{key:"focus",value:function(){this.input.focus()}},{key:"hasFocus",value:function(){return this.input===this.input.ownerDocument.activeElement}},{key:"bindInput",value:function(e){this.input=e}},{key:"onChange",value:function(e){this.props.onChange({value:e.target.value})}},{key:"render",value:function(){var e=this.props,t=e.value,o=e.isExpanded,r=e.instanceId,c=e.selectedSuggestionIndex,s=e.className,l=Object(h.a)(e,["value","isExpanded","instanceId","selectedSuggestionIndex","className"]),a=t?t.length+1:0;return Object(n.createElement)("input",Object(p.a)({ref:this.bindInput,id:"components-form-token-input-".concat(r),type:"text"},l,{value:t||"",onChange:this.onChange,size:a,className:i()(s,"components-form-token-field__input"),autoComplete:"off",role:"combobox","aria-expanded":o,"aria-autocomplete":"list","aria-owns":o?"components-form-token-suggestions-".concat(r):void 0,"aria-activedescendant":-1!==c?"components-form-token-suggestions-".concat(r,"-").concat(c):void 0,"aria-describedby":"components-form-token-suggestions-howto-".concat(r)}))}}]),c}(n.Component),j=o(222),x=o.n(j);var k=function(e){Object(g.a)(s,e);var t,o,r=(t=s,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,n=Object(w.a)(t);if(o){var r=Object(w.a)(this).constructor;e=Reflect.construct(n,arguments,r)}else e=n.apply(this,arguments);return Object(y.a)(this,e)});function s(){var e;return Object(v.a)(this,s),(e=r.apply(this,arguments)).handleMouseDown=e.handleMouseDown.bind(Object(m.a)(e)),e.bindList=e.bindList.bind(Object(m.a)(e)),e}return Object(b.a)(s,[{key:"componentDidUpdate",value:function(){var e=this;this.props.selectedIndex>-1&&this.props.scrollIntoView&&(this.scrollingIntoView=!0,x()(this.list.children[this.props.selectedIndex],this.list,{onlyScrollIfNeeded:!0}),this.props.setTimeout((function(){e.scrollingIntoView=!1}),100))}},{key:"bindList",value:function(e){this.list=e}},{key:"handleHover",value:function(e){var t=this;return function(){t.scrollingIntoView||t.props.onHover(e)}}},{key:"handleClick",value:function(e){var t=this;return function(){t.props.onSelect(e)}}},{key:"handleMouseDown",value:function(e){e.preventDefault()}},{key:"computeSuggestionMatch",value:function(e){var t=this.props.displayTransform(this.props.match||"").toLocaleLowerCase();if(0===t.length)return null;var o=(e=this.props.displayTransform(e)).toLocaleLowerCase().indexOf(t);return{suggestionBeforeMatch:e.substring(0,o),suggestionMatch:e.substring(o,o+t.length),suggestionAfterMatch:e.substring(o+t.length)}}},{key:"render",value:function(){var e=this;return Object(n.createElement)("ul",{ref:this.bindList,className:"components-form-token-field__suggestions-list",id:"components-form-token-suggestions-".concat(this.props.instanceId),role:"listbox"},Object(c.map)(this.props.suggestions,(function(t,o){var r=e.computeSuggestionMatch(t),c=i()("components-form-token-field__suggestion",{"is-selected":o===e.props.selectedIndex});return Object(n.createElement)("li",{id:"components-form-token-suggestions-".concat(e.props.instanceId,"-").concat(o),role:"option",className:c,key:e.props.displayTransform(t),onMouseDown:e.handleMouseDown,onClick:e.handleClick(t),onMouseEnter:e.handleHover(t),"aria-selected":o===e.props.selectedIndex},r?Object(n.createElement)("span",{"aria-label":e.props.displayTransform(t)},r.suggestionBeforeMatch,Object(n.createElement)("strong",{className:"components-form-token-field__suggestion-match"},r.suggestionMatch),r.suggestionAfterMatch):e.props.displayTransform(t))})))}}]),s}(n.Component);k.defaultProps={match:"",onHover:function(){},onSelect:function(){},suggestions:Object.freeze([])};var L=Object(l.withSafeTimeout)(k),S=o(220),E=o(76),T=o(218),I=o(210),C=o(211),W=o(89);const _=Object(W.a)(class extends n.Component{handleFocusOutside(e){this.props.onFocusOutside(e)}render(){return this.props.children}});t.a=function e({value:t,label:o,options:r,onChange:f,onFilterValueChange:p=c.noop,hideLabelFromVision:h,help:v,allowReset:b=!0,className:m,messages:g={selected:Object(s.__)("Item selected.")}}){var y;const w=r.find(e=>e.value===t),j=null!==(y=null==w?void 0:w.label)&&void 0!==y?y:"",x=Object(l.useInstanceId)(e),[k,W]=Object(n.useState)(w||null),[R,N]=Object(n.useState)(!1),[D,M]=Object(n.useState)(!1),[F,P]=Object(n.useState)(""),H=Object(n.useRef)(),V=Object(n.useMemo)(()=>{const e=[],t=[],o=Object(c.deburr)(F.toLocaleLowerCase());return r.forEach(n=>{const r=Object(c.deburr)(n.label).toLocaleLowerCase().indexOf(o);0===r?e.push(n):r>0&&t.push(n)}),e.concat(t)},[F,r,t]),B=e=>{f(e.value),Object(u.speak)(g.selected,"assertive"),W(e),P(""),N(!1)},z=(e=1)=>{let t=V.indexOf(k)+e;t<0?t=V.length-1:t>=V.length&&(t=0),W(V[t]),N(!0)};return Object(n.useEffect)(()=>{const e=V.length>0,t=V.indexOf(k)>0;e&&!t&&W(V[0])},[V,k]),Object(n.useEffect)(()=>{const e=V.length>0;if(R){const t=e?Object(s.sprintf)(
/* translators: %d: number of results. */
Object(s._n)("%d result found, use up and down arrow keys to navigate.","%d results found, use up and down arrow keys to navigate.",V.length),V.length):Object(s.__)("No results.");Object(u.speak)(t,"polite")}},[V,R]),Object(n.createElement)(_,{onFocusOutside:()=>{N(!1)}},Object(n.createElement)(S.a,{className:i()(m,"components-combobox-control"),tabIndex:"-1",label:o,id:"components-form-token-input-"+x,hideLabelFromVision:h,help:v},Object(n.createElement)("div",{className:"components-combobox-control__suggestions-container",tabIndex:"-1",onKeyDown:e=>{let t=!1;if(!e.defaultPrevented){switch(e.keyCode){case a.ENTER:k&&(B(k),t=!0);break;case a.UP:z(-1),t=!0;break;case a.DOWN:z(1),t=!0;break;case a.ESCAPE:N(!1),W(null),t=!0}t&&e.preventDefault()}}},Object(n.createElement)(T.a,null,Object(n.createElement)(I.a,null,Object(n.createElement)(O,{className:"components-combobox-control__input",instanceId:x,ref:H,value:R?F:j,"aria-label":j?`${j}, ${o}`:null,onFocus:()=>{M(!0),N(!0),p(""),P("")},onBlur:()=>{M(!1)},isExpanded:R,selectedSuggestionIndex:V.indexOf(k),onChange:e=>{const t=e.value;P(t),p(t),D&&N(!0)}})),b&&Object(n.createElement)(C.a,null,Object(n.createElement)(E.a,{className:"components-combobox-control__reset",icon:d,disabled:!t,onClick:()=>{f(null),H.current.input.focus()},label:Object(s.__)("Reset")}))),R&&Object(n.createElement)(L,{instanceId:x,match:{label:F},displayTransform:e=>e.label,suggestions:V,selectedIndex:V.indexOf(k),onHover:W,onSelect:B,scrollIntoView:!0}))))}}}]);woocommerce-blocks/build/product-on-sale.asset.php000064400000000746151335517640016321 0ustar00<?php return array('dependencies' => array('lodash', 'moment', 'react', 'react-dom', 'wc-settings', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-data-controls', 'wp-date', 'wp-deprecated', 'wp-dom', 'wp-element', 'wp-escape-html', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-keycodes', 'wp-polyfill', 'wp-primitives', 'wp-server-side-render', 'wp-url', 'wp-viewport'), 'version' => 'a074c6a9a2f9e2d08b79d8798a414283');woocommerce-blocks/build/all-products-frontend.asset.php000064400000001027151335517640017524 0ustar00<?php return array('dependencies' => array('lodash', 'react', 'wc-blocks-data-store', 'wc-blocks-registry', 'wc-blocks-shared-context', 'wc-blocks-shared-hocs', 'wc-price-format', 'wc-settings', 'wp-a11y', 'wp-api-fetch', 'wp-autop', 'wp-block-editor', 'wp-blocks', 'wp-compose', 'wp-data', 'wp-deprecated', 'wp-dom', 'wp-element', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-is-shallow-equal', 'wp-keycodes', 'wp-polyfill', 'wp-primitives', 'wp-url', 'wp-warning', 'wp-wordcount'), 'version' => '76bb8df518c6beffbbaf42fd2494d3aa');woocommerce-blocks/assets/js/payment-method-extensions/payment-methods/bacs/index.js000064400000002457151335517640025121 0ustar00/**
 * External dependencies
 */
import { registerPaymentMethod } from '@woocommerce/blocks-registry';
import { __ } from '@wordpress/i18n';
import { getSetting } from '@woocommerce/settings';
import { decodeEntities } from '@wordpress/html-entities';

/**
 * Internal dependencies
 */
import { PAYMENT_METHOD_NAME } from './constants';

const settings = getSetting( 'bacs_data', {} );
const defaultLabel = __(
	'Direct bank transfer',
	'woocommerce'
);
const label = decodeEntities( settings.title ) || defaultLabel;

/**
 * @typedef {import('@woocommerce/type-defs/registered-payment-method-props').RegisteredPaymentMethodProps} RegisteredPaymentMethodProps
 */

/**
 * Content component
 */
const Content = () => {
	return decodeEntities( settings.description || '' );
};

/**
 * Label component
 *
 * @param {*} props Props from payment API.
 */
const Label = ( props ) => {
	const { PaymentMethodLabel } = props.components;
	return <PaymentMethodLabel text={ label } />;
};

/**
 * Bank transfer (BACS) payment method config object.
 */
const bankTransferPaymentMethod = {
	name: PAYMENT_METHOD_NAME,
	label: <Label />,
	content: <Content />,
	edit: <Content />,
	canMakePayment: () => true,
	ariaLabel: label,
	supports: {
		features: settings?.supports ?? [],
	},
};

registerPaymentMethod( bankTransferPaymentMethod );
woocommerce-blocks/assets/js/payment-method-extensions/payment-methods/bacs/constants.js000064400000000053151335517640026014 0ustar00export const PAYMENT_METHOD_NAME = 'bacs';
woocommerce-blocks/assets/js/payment-method-extensions/payment-methods/paypal/index.js000064400000002305151335517640025467 0ustar00/**
 * External dependencies
 */
import { registerPaymentMethod } from '@woocommerce/blocks-registry';
import { __ } from '@wordpress/i18n';
import { getSetting, WC_ASSET_URL } from '@woocommerce/settings';
import { decodeEntities } from '@wordpress/html-entities';

/**
 * Internal dependencies
 */
import { PAYMENT_METHOD_NAME } from './constants';

const settings = getSetting( 'paypal_data', {} );

/**
 * @typedef {import('@woocommerce/type-defs/registered-payment-method-props').RegisteredPaymentMethodProps} RegisteredPaymentMethodProps
 */

/**
 * Content component
 */
const Content = () => {
	return decodeEntities( settings.description || '' );
};

const paypalPaymentMethod = {
	name: PAYMENT_METHOD_NAME,
	label: (
		<img
			src={ `${ WC_ASSET_URL }/images/paypal.png` }
			alt={ decodeEntities(
				settings.title || __( 'PayPal', 'woocommerce' )
			) }
		/>
	),
	placeOrderButtonLabel: __(
		'Proceed to PayPal',
		'woocommerce'
	),
	content: <Content />,
	edit: <Content />,
	canMakePayment: () => true,
	ariaLabel: decodeEntities(
		settings.title ||
			__( 'Payment via PayPal', 'woocommerce' )
	),
	supports: {
		features: settings.supports ?? [],
	},
};

registerPaymentMethod( paypalPaymentMethod );
woocommerce-blocks/assets/js/payment-method-extensions/payment-methods/paypal/constants.js000064400000000055151335517640026374 0ustar00export const PAYMENT_METHOD_NAME = 'paypal';
woocommerce-blocks/assets/js/payment-method-extensions/payment-methods/stripe/index.js000064400000001127151335517640025510 0ustar00/**
 * External dependencies
 */
import {
	registerPaymentMethod,
	registerExpressPaymentMethod,
} from '@woocommerce/blocks-registry';

/**
 * Internal dependencies
 */
import stripeCcPaymentMethod from './credit-card';
import paymentRequestPaymentMethod from './payment-request';
import { getStripeServerData } from './stripe-utils';

// Register Stripe Credit Card.
registerPaymentMethod( stripeCcPaymentMethod );

// Register Stripe Payment Request (Apple/Chrome Pay) if enabled.
if ( getStripeServerData().allowPaymentRequest ) {
	registerExpressPaymentMethod( paymentRequestPaymentMethod );
}
assets/js/payment-method-extensions/payment-methods/stripe/credit-card/constants.js000064400000000055151335517640030516 0ustar00woocommerce-blocksexport const PAYMENT_METHOD_NAME = 'stripe';
assets/js/payment-method-extensions/payment-methods/stripe/credit-card/elements.js000064400000010663151335517640030324 0ustar00woocommerce-blocks/**
 * External dependencies
 */
import { useState } from '@wordpress/element';
import { __ } from '@wordpress/i18n';
import {
	CardElement,
	CardNumberElement,
	CardExpiryElement,
	CardCvcElement,
} from '@stripe/react-stripe-js';

/**
 * Internal dependencies
 */
import { useElementOptions } from './use-element-options';

/** @typedef {import('react')} React */

const baseTextInputStyles = 'wc-block-gateway-input';

/**
 * InlineCard component
 *
 * @param {Object} props Incoming props for the component.
 * @param {React.ReactElement} props.inputErrorComponent
 * @param {function(any):any} props.onChange
 */
export const InlineCard = ( {
	inputErrorComponent: ValidationInputError,
	onChange,
} ) => {
	const [ isEmpty, setIsEmpty ] = useState( true );
	const { options, onActive, error, setError } = useElementOptions( {
		hidePostalCode: true,
	} );
	const errorCallback = ( event ) => {
		if ( event.error ) {
			setError( event.error.message );
		} else {
			setError( '' );
		}
		setIsEmpty( event.empty );
		onChange( event );
	};
	return (
		<>
			<div className="wc-block-gateway-container wc-inline-card-element">
				<CardElement
					id="wc-stripe-inline-card-element"
					className={ baseTextInputStyles }
					options={ options }
					onBlur={ () => onActive( isEmpty ) }
					onFocus={ () => onActive( isEmpty ) }
					onChange={ errorCallback }
				/>
				<label htmlFor="wc-stripe-inline-card-element">
					{ __(
						'Credit Card Information',
						'woocommerce'
					) }
				</label>
			</div>
			<ValidationInputError errorMessage={ error } />
		</>
	);
};

/**
 * CardElements component.
 *
 * @param {Object} props
 * @param {function(any):any} props.onChange
 * @param {React.ReactElement} props.inputErrorComponent
 */
export const CardElements = ( {
	onChange,
	inputErrorComponent: ValidationInputError,
} ) => {
	const [ isEmpty, setIsEmpty ] = useState( {
		cardNumber: true,
		cardExpiry: true,
		cardCvc: true,
	} );
	const {
		options: cardNumOptions,
		onActive: cardNumOnActive,
		error: cardNumError,
		setError: cardNumSetError,
	} = useElementOptions( { showIcon: false } );
	const {
		options: cardExpiryOptions,
		onActive: cardExpiryOnActive,
		error: cardExpiryError,
		setError: cardExpirySetError,
	} = useElementOptions();
	const {
		options: cardCvcOptions,
		onActive: cardCvcOnActive,
		error: cardCvcError,
		setError: cardCvcSetError,
	} = useElementOptions();
	const errorCallback = ( errorSetter, elementId ) => ( event ) => {
		if ( event.error ) {
			errorSetter( event.error.message );
		} else {
			errorSetter( '' );
		}
		setIsEmpty( { ...isEmpty, [ elementId ]: event.empty } );
		onChange( event );
	};
	return (
		<div className="wc-block-card-elements">
			<div className="wc-block-gateway-container wc-card-number-element">
				<CardNumberElement
					onChange={ errorCallback( cardNumSetError, 'cardNumber' ) }
					options={ cardNumOptions }
					className={ baseTextInputStyles }
					id="wc-stripe-card-number-element"
					onFocus={ () => cardNumOnActive( isEmpty.cardNumber ) }
					onBlur={ () => cardNumOnActive( isEmpty.cardNumber ) }
				/>
				<label htmlFor="wc-stripe-card-number-element">
					{ __( 'Card Number', 'woo-gutenberg-product-blocks' ) }
				</label>
				<ValidationInputError errorMessage={ cardNumError } />
			</div>
			<div className="wc-block-gateway-container wc-card-expiry-element">
				<CardExpiryElement
					onChange={ errorCallback(
						cardExpirySetError,
						'cardExpiry'
					) }
					options={ cardExpiryOptions }
					className={ baseTextInputStyles }
					onFocus={ () => cardExpiryOnActive( isEmpty.cardExpiry ) }
					onBlur={ () => cardExpiryOnActive( isEmpty.cardExpiry ) }
					id="wc-stripe-card-expiry-element"
				/>
				<label htmlFor="wc-stripe-card-expiry-element">
					{ __( 'Expiry Date', 'woo-gutenberg-product-blocks' ) }
				</label>
				<ValidationInputError errorMessage={ cardExpiryError } />
			</div>
			<div className="wc-block-gateway-container wc-card-cvc-element">
				<CardCvcElement
					onChange={ errorCallback( cardCvcSetError, 'cardCvc' ) }
					options={ cardCvcOptions }
					className={ baseTextInputStyles }
					onFocus={ () => cardCvcOnActive( isEmpty.cardCvc ) }
					onBlur={ () => cardCvcOnActive( isEmpty.cardCvc ) }
					id="wc-stripe-card-code-element"
				/>
				<label htmlFor="wc-stripe-card-code-element">
					{ __( 'CVV/CVC', 'woo-gutenberg-product-blocks' ) }
				</label>
				<ValidationInputError errorMessage={ cardCvcError } />
			</div>
		</div>
	);
};
assets/js/payment-method-extensions/payment-methods/stripe/credit-card/use-checkout-subscriptions.js000064400000006023151335517640034007 0ustar00woocommerce-blocks/**
 * External dependencies
 */
import { useEffect, useCallback, useState } from '@wordpress/element';

/**
 * Internal dependencies
 */
import { getErrorMessageForTypeAndCode } from '../stripe-utils';
import { usePaymentIntents } from './use-payment-intents';
import { usePaymentProcessing } from './use-payment-processing';

/**
 * @typedef {import('@woocommerce/type-defs/registered-payment-method-props').EventRegistrationProps} EventRegistrationProps
 * @typedef {import('@woocommerce/type-defs/registered-payment-method-props').BillingDataProps} BillingDataProps
 * @typedef {import('@woocommerce/type-defs/registered-payment-method-props').EmitResponseProps} EmitResponseProps
 * @typedef {import('../stripe-utils/type-defs').Stripe} Stripe
 * @typedef {import('react').Dispatch<string>} SourceIdDispatch
 */

/**
 * A custom hook for the Stripe processing and event observer logic.
 *
 * @param {EventRegistrationProps} eventRegistration Event registration functions.
 * @param {BillingDataProps}       billing           Various billing data items.
 * @param {string}                 sourceId          Current set stripe source id.
 * @param {SourceIdDispatch}       setSourceId       Setter for stripe source id.
 * @param {EmitResponseProps}      emitResponse      Various helpers for usage with observer
 *                                                   response objects.
 * @param {Stripe}                 stripe            The stripe.js object.
 *
 * @return {function(Object):Object} Returns a function for handling stripe error.
 */
export const useCheckoutSubscriptions = (
	eventRegistration,
	billing,
	sourceId,
	setSourceId,
	emitResponse,
	stripe
) => {
	const [ error, setError ] = useState( '' );
	const onStripeError = useCallback( ( event ) => {
		const type = event.error.type;
		const code = event.error.code || '';
		const message =
			getErrorMessageForTypeAndCode( type, code ) ?? event.error.message;
		setError( message );
		return message;
	}, [] );
	const {
		onCheckoutAfterProcessingWithSuccess,
		onPaymentProcessing,
		onCheckoutAfterProcessingWithError,
	} = eventRegistration;
	usePaymentIntents(
		stripe,
		onCheckoutAfterProcessingWithSuccess,
		setSourceId,
		emitResponse
	);
	usePaymentProcessing(
		onStripeError,
		error,
		stripe,
		billing,
		emitResponse,
		sourceId,
		setSourceId,
		onPaymentProcessing
	);
	// hook into and register callbacks for events.
	useEffect( () => {
		const onError = ( { processingResponse } ) => {
			if ( processingResponse?.paymentDetails?.errorMessage ) {
				return {
					type: emitResponse.responseTypes.ERROR,
					message: processingResponse.paymentDetails.errorMessage,
					messageContext: emitResponse.noticeContexts.PAYMENTS,
				};
			}
			// so we don't break the observers.
			return true;
		};
		const unsubscribeAfterProcessing = onCheckoutAfterProcessingWithError(
			onError
		);
		return () => {
			unsubscribeAfterProcessing();
		};
	}, [
		onCheckoutAfterProcessingWithError,
		emitResponse.noticeContexts.PAYMENTS,
		emitResponse.responseTypes.ERROR,
	] );
	return onStripeError;
};
woocommerce-blocks/assets/js/payment-method-extensions/payment-methods/stripe/credit-card/index.js000064400000003203151335517640027666 0ustar00/**
 * External dependencies
 */
import { __ } from '@wordpress/i18n';
import { useEffect, useState } from '@wordpress/element';

/**
 * Internal dependencies
 */
import { getStripeServerData, loadStripe } from '../stripe-utils';
import { StripeCreditCard, getStripeCreditCardIcons } from './payment-method';
import { PAYMENT_METHOD_NAME } from './constants';

const stripePromise = loadStripe();

const StripeComponent = ( props ) => {
	const [ errorMessage, setErrorMessage ] = useState( '' );

	useEffect( () => {
		Promise.resolve( stripePromise ).then( ( { error } ) => {
			if ( error ) {
				setErrorMessage( error.message );
			}
		} );
	}, [ setErrorMessage ] );

	useEffect( () => {
		if ( errorMessage ) {
			throw new Error( errorMessage );
		}
	}, [ errorMessage ] );

	return <StripeCreditCard stripe={ stripePromise } { ...props } />;
};

const StripeLabel = ( props ) => {
	const { PaymentMethodLabel } = props.components;

	const labelText = getStripeServerData().title
		? getStripeServerData().title
		: __( 'Credit / Debit Card', 'woocommerce' );

	return <PaymentMethodLabel text={ labelText } />;
};

const cardIcons = getStripeCreditCardIcons();
const stripeCcPaymentMethod = {
	name: PAYMENT_METHOD_NAME,
	label: <StripeLabel />,
	content: <StripeComponent />,
	edit: <StripeComponent />,
	icons: cardIcons,
	canMakePayment: () => stripePromise,
	ariaLabel: __(
		'Stripe Credit Card payment method',
		'woocommerce'
	),
	supports: {
		showSavedCards: getStripeServerData().showSavedCards,
		showSaveOption: getStripeServerData().showSaveOption,
		features: getStripeServerData()?.supports ?? [],
	},
};

export default stripeCcPaymentMethod;
assets/js/payment-method-extensions/payment-methods/stripe/credit-card/payment-method.js000064400000004243151335517640031440 0ustar00woocommerce-blocks/**
 * External dependencies
 */
import { Elements, useStripe } from '@stripe/react-stripe-js';
import { useState } from '@wordpress/element';

/**
 * Internal dependencies
 */
import { getStripeServerData } from '../stripe-utils';
import { useCheckoutSubscriptions } from './use-checkout-subscriptions';
import { InlineCard, CardElements } from './elements';

/**
 * @typedef {import('../stripe-utils/type-defs').Stripe} Stripe
 * @typedef {import('../stripe-utils/type-defs').StripePaymentRequest} StripePaymentRequest
 * @typedef {import('@woocommerce/type-defs/registered-payment-method-props').RegisteredPaymentMethodProps} RegisteredPaymentMethodProps
 */

export const getStripeCreditCardIcons = () => {
	return Object.entries( getStripeServerData().icons ).map(
		( [ id, { src, alt } ] ) => {
			return {
				id,
				src,
				alt,
			};
		}
	);
};

/**
 * Stripe Credit Card component
 *
 * @param {RegisteredPaymentMethodProps} props Incoming props
 */
const CreditCardComponent = ( {
	billing,
	eventRegistration,
	emitResponse,
	components,
} ) => {
	const { ValidationInputError, PaymentMethodIcons } = components;
	const [ sourceId, setSourceId ] = useState( '' );
	const stripe = useStripe();
	const onStripeError = useCheckoutSubscriptions(
		eventRegistration,
		billing,
		sourceId,
		setSourceId,
		emitResponse,
		stripe
	);
	const onChange = ( paymentEvent ) => {
		if ( paymentEvent.error ) {
			onStripeError( paymentEvent );
		}
		setSourceId( '0' );
	};
	const cardIcons = getStripeCreditCardIcons();

	const renderedCardElement = getStripeServerData().inline_cc_form ? (
		<InlineCard
			onChange={ onChange }
			inputErrorComponent={ ValidationInputError }
		/>
	) : (
		<CardElements
			onChange={ onChange }
			inputErrorComponent={ ValidationInputError }
		/>
	);
	return (
		<>
			{ renderedCardElement }
			{ PaymentMethodIcons && cardIcons.length && (
				<PaymentMethodIcons icons={ cardIcons } align="left" />
			) }
		</>
	);
};

export const StripeCreditCard = ( props ) => {
	const { locale } = getStripeServerData().button;
	const { stripe } = props;

	return (
		<Elements stripe={ stripe } locale={ locale }>
			<CreditCardComponent { ...props } />
		</Elements>
	);
};
assets/js/payment-method-extensions/payment-methods/stripe/credit-card/use-element-options.js000064400000005447151335517640032430 0ustar00woocommerce-blocks/**
 * External dependencies
 */
import { useState, useEffect, useCallback } from '@wordpress/element';

/**
 * @typedef {import('../stripe-utils/type-defs').StripeElementOptions} StripeElementOptions
 */

/**
 * Returns the value of a specific CSS property for the element matched by the provided selector.
 *
 * @param {string} selector     CSS selector that matches the element to query.
 * @param {string} property     Name of the property to retrieve the style
 *                              value from.
 * @param {string} defaultValue Fallback value if the value for the property
 *                              could not be retrieved.
 *
 * @return {string} The style value of that property in the document element.
 */
const getComputedStyle = ( selector, property, defaultValue ) => {
	let elementStyle = {};

	if (
		typeof document === 'object' &&
		typeof document.querySelector === 'function' &&
		typeof window.getComputedStyle === 'function'
	) {
		const element = document.querySelector( selector );
		if ( element ) {
			elementStyle = window.getComputedStyle( element );
		}
	}

	return elementStyle[ property ] || defaultValue;
};

/**
 * Default options for the stripe elements.
 */
const elementOptions = {
	style: {
		base: {
			iconColor: '#666EE8',
			color: '#31325F',
			fontSize: getComputedStyle(
				'.wc-block-checkout',
				'fontSize',
				'16px'
			),
			lineHeight: 1.375, // With a font-size of 16px, line-height will be 22px.
			'::placeholder': {
				color: '#fff',
			},
		},
	},
	classes: {
		focus: 'focused',
		empty: 'empty',
		invalid: 'has-error',
	},
};

/**
 * A custom hook handling options implemented on the stripe elements.
 *
 * @param {Object} [overloadedOptions] An array of extra options to merge with
 *                                     the options provided for the element.
 *
 * @return {StripeElementOptions}  The stripe element options interface
 */
export const useElementOptions = ( overloadedOptions ) => {
	const [ isActive, setIsActive ] = useState( false );
	const [ options, setOptions ] = useState( {
		...elementOptions,
		...overloadedOptions,
	} );
	const [ error, setError ] = useState( '' );

	useEffect( () => {
		const color = isActive ? '#CFD7E0' : '#fff';

		setOptions( ( prevOptions ) => {
			const showIcon =
				typeof prevOptions.showIcon !== 'undefined'
					? { showIcon: isActive }
					: {};
			return {
				...prevOptions,
				style: {
					...prevOptions.style,
					base: {
						...prevOptions.style.base,
						'::placeholder': {
							color,
						},
					},
				},
				...showIcon,
			};
		} );
	}, [ isActive ] );

	const onActive = useCallback(
		( isEmpty ) => {
			if ( ! isEmpty ) {
				setIsActive( true );
			} else {
				setIsActive( ( prevActive ) => ! prevActive );
			}
		},
		[ setIsActive ]
	);
	return { options, onActive, error, setError };
};
assets/js/payment-method-extensions/payment-methods/stripe/credit-card/use-payment-intents.js000064400000005710151335517640032436 0ustar00woocommerce-blocks/**
 * External dependencies
 */
import { useEffect } from '@wordpress/element';

/**
 * @typedef {import('@woocommerce/type-defs/registered-payment-method-props').EmitResponseProps} EmitResponseProps
 * @typedef {import('../stripe-utils/type-defs').Stripe} Stripe
 */

/**
 * Opens the modal for PaymentIntent authorizations.
 *
 * @param {Object}           params                Params object.
 * @param {Stripe}           params.stripe         The stripe object.
 * @param {Object}           params.paymentDetails The payment details from the
 *                                                 server after checkout processing.
 * @param {string}           params.errorContext   Context where errors will be added.
 * @param {string}           params.errorType      Type of error responses.
 * @param {string}           params.successType    Type of success responses.
 */
const openIntentModal = ( {
	stripe,
	paymentDetails,
	errorContext,
	errorType,
	successType,
} ) => {
	const checkoutResponse = { type: successType };
	if (
		! paymentDetails.setup_intent &&
		! paymentDetails.payment_intent_secret
	) {
		return checkoutResponse;
	}
	const isSetupIntent = !! paymentDetails.setupIntent;
	const verificationUrl = paymentDetails.verification_endpoint;
	const intentSecret = isSetupIntent
		? paymentDetails.setup_intent
		: paymentDetails.payment_intent_secret;
	return stripe[ isSetupIntent ? 'confirmCardSetup' : 'confirmCardPayment' ](
		intentSecret
	)
		.then( function ( response ) {
			if ( response.error ) {
				throw response.error;
			}
			const intent =
				response[ isSetupIntent ? 'setupIntent' : 'paymentIntent' ];
			if (
				intent.status !== 'requires_capture' &&
				intent.status !== 'succeeded'
			) {
				return checkoutResponse;
			}
			checkoutResponse.redirectUrl = verificationUrl;
			return checkoutResponse;
		} )
		.catch( function ( error ) {
			checkoutResponse.type = errorType;
			checkoutResponse.message = error.message;
			checkoutResponse.retry = true;
			checkoutResponse.messageContext = errorContext;
			// Reports back to the server.
			window.fetch( verificationUrl + '&is_ajax' );
			return checkoutResponse;
		} );
};

export const usePaymentIntents = (
	stripe,
	subscriber,
	setSourceId,
	emitResponse
) => {
	useEffect( () => {
		const unsubscribe = subscriber( async ( { processingResponse } ) => {
			const paymentDetails = processingResponse.paymentDetails || {};
			const response = await openIntentModal( {
				stripe,
				paymentDetails,
				errorContext: emitResponse.noticeContexts.PAYMENTS,
				errorType: emitResponse.responseTypes.ERROR,
				successType: emitResponse.responseTypes.SUCCESS,
			} );
			if (
				response.type === emitResponse.responseTypes.ERROR &&
				response.retry
			) {
				setSourceId( '0' );
			}

			return response;
		} );
		return () => unsubscribe();
	}, [
		subscriber,
		emitResponse.noticeContexts.PAYMENTS,
		emitResponse.responseTypes.ERROR,
		emitResponse.responseTypes.SUCCESS,
		setSourceId,
		stripe,
	] );
};
assets/js/payment-method-extensions/payment-methods/stripe/credit-card/use-payment-processing.js000064400000011222151335517640033121 0ustar00woocommerce-blocks/**
 * External dependencies
 */
import { useEffect } from '@wordpress/element';
import {
	CardElement,
	CardNumberElement,
	useElements,
} from '@stripe/react-stripe-js';

/**
 * Internal dependencies
 */
import { PAYMENT_METHOD_NAME } from './constants';
import {
	getStripeServerData,
	getErrorMessageForTypeAndCode,
} from '../stripe-utils';
import { errorTypes } from '../stripe-utils/constants';

/**
 * @typedef {import('@stripe/stripe-js').Stripe} Stripe
 * @typedef {import('@woocommerce/type-defs/registered-payment-method-props').EventRegistrationProps} EventRegistrationProps
 * @typedef {import('@woocommerce/type-defs/registered-payment-method-props').BillingDataProps} BillingDataProps
 * @typedef {import('@woocommerce/type-defs/registered-payment-method-props').EmitResponseProps} EmitResponseProps
 * @typedef {import('react').Dispatch<string>} SourceIdDispatch
 */

/**
 * @typedef {function(function():any):function():void} EventRegistration
 */

/**
 * A custom hook that registers stripe payment processing with the
 * onPaymentProcessing event from checkout.
 *
 * @param {function(any):string} onStripeError       Sets an error for stripe.
 * @param {string}               error               Any set error message (an empty string if no
 *                                                   error).
 * @param {Stripe}               stripe              The stripe utility
 * @param {BillingDataProps}     billing             Various billing data items.
 * @param {EmitResponseProps}    emitResponse        Various helpers for usage with observer
 *                                                   response objects.
 * @param {string}               sourceId            Current set stripe source id.
 * @param {SourceIdDispatch}     setSourceId         Setter for stripe source id.
 * @param {EventRegistration}    onPaymentProcessing The event emitter for processing payment.
 */
export const usePaymentProcessing = (
	onStripeError,
	error,
	stripe,
	billing,
	emitResponse,
	sourceId,
	setSourceId,
	onPaymentProcessing
) => {
	const elements = useElements();
	// hook into and register callbacks for events
	useEffect( () => {
		const createSource = async ( ownerInfo ) => {
			const elementToGet = getStripeServerData().inline_cc_form
				? CardElement
				: CardNumberElement;
			return await stripe.createSource(
				// @ts-ignore
				elements?.getElement( elementToGet ),
				{
					type: 'card',
					owner: ownerInfo,
				}
			);
		};
		const onSubmit = async () => {
			try {
				const billingData = billing.billingData;
				// if there's an error return that.
				if ( error ) {
					return {
						type: emitResponse.responseTypes.ERROR,
						message: error,
					};
				}
				// use token if it's set.
				if ( sourceId !== '' && sourceId !== '0' ) {
					return {
						type: emitResponse.responseTypes.SUCCESS,
						meta: {
							paymentMethodData: {
								paymentMethod: PAYMENT_METHOD_NAME,
								paymentRequestType: 'cc',
								stripe_source: sourceId,
							},
							billingData,
						},
					};
				}
				const ownerInfo = {
					address: {
						line1: billingData.address_1,
						line2: billingData.address_2,
						city: billingData.city,
						state: billingData.state,
						postal_code: billingData.postcode,
						country: billingData.country,
					},
				};
				if ( billingData.phone ) {
					ownerInfo.phone = billingData.phone;
				}
				if ( billingData.email ) {
					ownerInfo.email = billingData.email;
				}
				if ( billingData.first_name || billingData.last_name ) {
					ownerInfo.name = `${ billingData.first_name } ${ billingData.last_name }`;
				}

				const response = await createSource( ownerInfo );
				if ( response.error ) {
					return {
						type: emitResponse.responseTypes.ERROR,
						message: onStripeError( response ),
					};
				}
				if ( ! response.source || ! response.source.id ) {
					throw new Error(
						getErrorMessageForTypeAndCode( errorTypes.API_ERROR )
					);
				}
				setSourceId( response.source.id );
				return {
					type: emitResponse.responseTypes.SUCCESS,
					meta: {
						paymentMethodData: {
							stripe_source: response.source.id,
							paymentMethod: PAYMENT_METHOD_NAME,
							paymentRequestType: 'cc',
						},
						billingData,
					},
				};
			} catch ( e ) {
				return {
					type: emitResponse.responseTypes.ERROR,
					message: e,
				};
			}
		};
		const unsubscribeProcessing = onPaymentProcessing( onSubmit );
		return () => {
			unsubscribeProcessing();
		};
	}, [
		onPaymentProcessing,
		billing.billingData,
		stripe,
		sourceId,
		setSourceId,
		onStripeError,
		error,
		emitResponse.noticeContexts.PAYMENTS,
		emitResponse.responseTypes.ERROR,
		emitResponse.responseTypes.SUCCESS,
		elements,
	] );
};
assets/js/payment-method-extensions/payment-methods/stripe/payment-request/use-initialization.js000064400000014725151335517640033316 0ustar00woocommerce-blocks/**
 * External dependencies
 */
import { useEffect, useState, useRef, useCallback } from '@wordpress/element';
import { useStripe } from '@stripe/react-stripe-js';
import { getSetting } from '@woocommerce/settings';
import { __ } from '@wordpress/i18n';
import isShallowEqual from '@wordpress/is-shallow-equal';

/**
 * Internal dependencies
 */
import {
	getPaymentRequest,
	updatePaymentRequest,
	canDoPaymentRequest,
	normalizeShippingAddressForCheckout,
	normalizeShippingOptionSelectionsForCheckout,
	getStripeServerData,
	pluckAddress,
	normalizeShippingOptions,
} from '../stripe-utils';
import { useEventHandlers } from './use-event-handlers';

/**
 * @typedef {import('../stripe-utils/type-defs').StripePaymentRequest} StripePaymentRequest
 */

export const useInitialization = ( {
	billing,
	shippingData,
	setExpressPaymentError,
	onClick,
	onClose,
	onSubmit,
} ) => {
	const stripe = useStripe();
	/**
	 * @type {[ StripePaymentRequest|null, function( StripePaymentRequest ):void]}
	 */
	// @ts-ignore
	const [ paymentRequest, setPaymentRequest ] = useState( null );
	const [ isFinished, setIsFinished ] = useState( false );
	const [ isProcessing, setIsProcessing ] = useState( false );
	const [ canMakePayment, setCanMakePayment ] = useState( false );
	const [ paymentRequestType, setPaymentRequestType ] = useState( '' );
	const currentShipping = useRef( shippingData );
	const {
		paymentRequestEventHandlers,
		clearPaymentRequestEventHandler,
		setPaymentRequestEventHandler,
	} = useEventHandlers();

	// Update refs when any change.
	useEffect( () => {
		currentShipping.current = shippingData;
	}, [ shippingData ] );

	// Create the initial paymentRequest object. Note, we can't do anything if stripe isn't available yet or we have zero total.
	useEffect( () => {
		if (
			! stripe ||
			! billing.cartTotal.value ||
			isFinished ||
			isProcessing ||
			paymentRequest
		) {
			return;
		}
		const pr = getPaymentRequest( {
			total: billing.cartTotal,
			currencyCode: billing.currency.code.toLowerCase(),
			countryCode: getSetting( 'baseLocation', {} )?.country,
			shippingRequired: shippingData.needsShipping,
			cartTotalItems: billing.cartTotalItems,
			stripe,
		} );
		canDoPaymentRequest( pr ).then( ( result ) => {
			setPaymentRequest( pr );
			setPaymentRequestType( result.requestType || '' );
			setCanMakePayment( result.canPay );
		} );
	}, [
		billing.cartTotal,
		billing.currency.code,
		shippingData.needsShipping,
		billing.cartTotalItems,
		stripe,
		isProcessing,
		isFinished,
		paymentRequest,
	] );

	// When the payment button is clicked, update the request and show it.
	const onButtonClick = useCallback( () => {
		setIsProcessing( true );
		setIsFinished( false );
		setExpressPaymentError( '' );
		updatePaymentRequest( {
			// @ts-ignore
			paymentRequest,
			total: billing.cartTotal,
			currencyCode: billing.currency.code.toLowerCase(),
			cartTotalItems: billing.cartTotalItems,
		} );
		onClick();
	}, [
		onClick,
		paymentRequest,
		setExpressPaymentError,
		billing.cartTotal,
		billing.currency.code,
		billing.cartTotalItems,
	] );

	const abortPayment = useCallback( ( paymentMethod ) => {
		paymentMethod.complete( 'fail' );
		setIsProcessing( false );
		setIsFinished( true );
	}, [] );

	const completePayment = useCallback( ( paymentMethod ) => {
		paymentMethod.complete( 'success' );
		setIsFinished( true );
		setIsProcessing( false );
	}, [] );

	// whenever paymentRequest changes, hook in event listeners.
	useEffect( () => {
		const noop = { removeAllListeners: () => void null };
		let shippingAddressChangeEvent = noop,
			shippingOptionChangeEvent = noop,
			sourceChangeEvent = noop,
			cancelChangeEvent = noop;

		if ( paymentRequest ) {
			const cancelHandler = () => {
				setIsFinished( false );
				setIsProcessing( false );
				setPaymentRequest( null );
				onClose();
			};

			const shippingAddressChangeHandler = ( event ) => {
				const newShippingAddress = normalizeShippingAddressForCheckout(
					event.shippingAddress
				);
				if (
					isShallowEqual(
						pluckAddress( newShippingAddress ),
						pluckAddress( currentShipping.current.shippingAddress )
					)
				) {
					// the address is the same so no change needed.
					event.updateWith( {
						status: 'success',
						shippingOptions: normalizeShippingOptions(
							currentShipping.current.shippingRates
						),
					} );
				} else {
					// the address is different so let's set the new address and
					// register the handler to be picked up by the shipping rate
					// change event.
					currentShipping.current.setShippingAddress(
						normalizeShippingAddressForCheckout(
							event.shippingAddress
						)
					);
					setPaymentRequestEventHandler(
						'shippingAddressChange',
						event
					);
				}
			};

			const shippingOptionChangeHandler = ( event ) => {
				currentShipping.current.setSelectedRates(
					normalizeShippingOptionSelectionsForCheckout(
						event.shippingOption
					)
				);
				setPaymentRequestEventHandler( 'shippingOptionChange', event );
			};

			const sourceHandler = ( paymentMethod ) => {
				if (
					// eslint-disable-next-line no-undef
					! getStripeServerData().allowPrepaidCard &&
					paymentMethod.source.card.funding
				) {
					setExpressPaymentError(
						__(
							"Sorry, we're not accepting prepaid cards at this time.",
							'woocommerce-gateway-stripe'
						)
					);
					return;
				}
				setPaymentRequestEventHandler( 'sourceEvent', paymentMethod );
				// kick off checkout processing step.
				onSubmit();
			};

			// @ts-ignore
			shippingAddressChangeEvent = paymentRequest.on(
				'shippingaddresschange',
				shippingAddressChangeHandler
			);
			// @ts-ignore
			shippingOptionChangeEvent = paymentRequest.on(
				'shippingoptionchange',
				shippingOptionChangeHandler
			);
			// @ts-ignore
			sourceChangeEvent = paymentRequest.on( 'source', sourceHandler );
			// @ts-ignore
			cancelChangeEvent = paymentRequest.on( 'cancel', cancelHandler );
		}

		return () => {
			if ( paymentRequest ) {
				shippingAddressChangeEvent.removeAllListeners();
				shippingOptionChangeEvent.removeAllListeners();
				sourceChangeEvent.removeAllListeners();
				cancelChangeEvent.removeAllListeners();
			}
		};
	}, [
		paymentRequest,
		canMakePayment,
		isProcessing,
		setPaymentRequestEventHandler,
		setExpressPaymentError,
		onSubmit,
		onClose,
	] );

	return {
		paymentRequest,
		paymentRequestEventHandlers,
		clearPaymentRequestEventHandler,
		isProcessing,
		canMakePayment,
		onButtonClick,
		abortPayment,
		completePayment,
		paymentRequestType,
	};
};
assets/js/payment-method-extensions/payment-methods/stripe/payment-request/apple-pay-preview.js000064400000004776151335517640033051 0ustar00woocommerce-blocksexport const applePayImage =
	"data:image/svg+xml,%3Csvg width='264' height='48' viewBox='0 0 264 48' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Crect width='264' height='48' rx='3' fill='black'/%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M125.114 16.6407C125.682 15.93 126.067 14.9756 125.966 14C125.135 14.0415 124.121 14.549 123.533 15.2602C123.006 15.8693 122.539 16.8641 122.661 17.7983C123.594 17.8797 124.526 17.3317 125.114 16.6407Z' fill='white'/%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M125.955 17.982C124.601 17.9011 123.448 18.7518 122.801 18.7518C122.154 18.7518 121.163 18.0224 120.092 18.0421C118.696 18.0629 117.402 18.8524 116.694 20.1079C115.238 22.6196 116.31 26.3453 117.726 28.3909C118.414 29.4028 119.242 30.5174 120.334 30.4769C121.366 30.4365 121.77 29.8087 123.024 29.8087C124.277 29.8087 124.641 30.4769 125.733 30.4567C126.865 30.4365 127.573 29.4443 128.261 28.4313C129.049 27.2779 129.373 26.1639 129.393 26.1027C129.373 26.0825 127.209 25.2515 127.189 22.7606C127.169 20.6751 128.888 19.6834 128.969 19.6217C127.998 18.1847 126.481 18.0224 125.955 17.982Z' fill='white'/%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M136.131 23.1804H138.834C140.886 23.1804 142.053 22.0752 142.053 20.1592C142.053 18.2432 140.886 17.1478 138.845 17.1478H136.131V23.1804ZM139.466 15.1582C142.411 15.1582 144.461 17.1903 144.461 20.1483C144.461 23.1172 142.369 25.1596 139.392 25.1596H136.131V30.3498H133.775V15.1582H139.466Z' fill='white'/%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M152.198 26.224V25.3712L149.579 25.5397C148.106 25.6341 147.339 26.182 147.339 27.14C147.339 28.0664 148.138 28.6667 149.39 28.6667C150.988 28.6667 152.198 27.6449 152.198 26.224ZM145.046 27.2032C145.046 25.2551 146.529 24.1395 149.263 23.971L152.198 23.7922V22.9498C152.198 21.7181 151.388 21.0442 149.947 21.0442C148.758 21.0442 147.896 21.6548 147.717 22.5916H145.592C145.656 20.6232 147.507 19.1914 150.01 19.1914C152.703 19.1914 154.459 20.602 154.459 22.7917V30.351H152.282V28.5298H152.229C151.609 29.719 150.241 30.4666 148.758 30.4666C146.571 30.4666 145.046 29.1612 145.046 27.2032Z' fill='white'/%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M156.461 34.4145V32.5934C156.608 32.6141 156.965 32.6354 157.155 32.6354C158.196 32.6354 158.785 32.1932 159.142 31.0564L159.353 30.3824L155.366 19.3281H157.827L160.604 28.298H160.657L163.434 19.3281H165.832L161.698 30.9402C160.752 33.6038 159.668 34.4778 157.376 34.4778C157.197 34.4778 156.618 34.4565 156.461 34.4145Z' fill='white'/%3E%3C/svg%3E%0A";
assets/js/payment-method-extensions/payment-methods/stripe/payment-request/index.js000064400000004203151335517640030572 0ustar00woocommerce-blocks/**
 * External dependencies
 */
import { getSetting } from '@woocommerce/settings';

/**
 * Internal dependencies
 */
import { PAYMENT_METHOD_NAME } from './constants';
import { PaymentRequestExpress } from './payment-request-express';
import { applePayImage } from './apple-pay-preview';
import { getStripeServerData, loadStripe } from '../stripe-utils';

const ApplePayPreview = () => <img src={ applePayImage } alt="" />;

const canPayStripePromise = loadStripe();
const componentStripePromise = loadStripe();

let isStripeInitialized = false,
	canPay = false;

// Initialise stripe API client and determine if payment method can be used
// in current environment (e.g. geo + shopper has payment settings configured).
function paymentRequestAvailable( { currencyCode, totalPrice } ) {
	// Stripe only supports carts of greater value than 30 cents.
	if ( totalPrice < 30 ) {
		return false;
	}

	// If we've already initialised, return the cached results.
	if ( isStripeInitialized ) {
		return canPay;
	}

	return canPayStripePromise.then( ( stripe ) => {
		if ( stripe === null ) {
			isStripeInitialized = true;
			return canPay;
		}
		if ( stripe.error && stripe.error instanceof Error ) {
			throw stripe.error;
		}
		// Do a test payment to confirm if payment method is available.
		const paymentRequest = stripe.paymentRequest( {
			total: {
				label: 'Total',
				amount: totalPrice,
				pending: true,
			},
			country: getSetting( 'baseLocation', {} )?.country,
			currency: currencyCode,
		} );
		return paymentRequest.canMakePayment().then( ( result ) => {
			canPay = !! result;
			isStripeInitialized = true;
			return canPay;
		} );
	} );
}

const paymentRequestPaymentMethod = {
	name: PAYMENT_METHOD_NAME,
	content: <PaymentRequestExpress stripe={ componentStripePromise } />,
	edit: <ApplePayPreview />,
	canMakePayment: ( cartData ) =>
		paymentRequestAvailable( {
			currencyCode: cartData?.cartTotals?.currency_code?.toLowerCase(),
			totalPrice: parseInt( cartData?.cartTotals?.total_price || 0, 10 ),
		} ),
	paymentMethodId: 'stripe',
	supports: {
		features: getStripeServerData()?.supports ?? [],
	},
};

export default paymentRequestPaymentMethod;
assets/js/payment-method-extensions/payment-methods/stripe/payment-request/constants.js000064400000000263151335517640031501 0ustar00woocommerce-blocksexport const PAYMENT_METHOD_NAME = 'payment_request';

export const DEFAULT_STRIPE_EVENT_HANDLERS = {
	shippingAddressChange: null,
	shippingOptionChange: null,
	source: null,
};
js/payment-method-extensions/payment-methods/stripe/payment-request/payment-request-express.js000064400000004773151335517640034331 0ustar00woocommerce-blocks/assets/**
 * External dependencies
 */
import { Elements, PaymentRequestButtonElement } from '@stripe/react-stripe-js';

/**
 * Internal dependencies
 */
import { getStripeServerData } from '../stripe-utils';
import { useInitialization } from './use-initialization';
import { useCheckoutSubscriptions } from './use-checkout-subscriptions';

/**
 * @typedef {import('../stripe-utils/type-defs').Stripe} Stripe
 * @typedef {import('../stripe-utils/type-defs').StripePaymentRequest} StripePaymentRequest
 * @typedef {import('@woocommerce/type-defs/registered-payment-method-props').RegisteredPaymentMethodProps} RegisteredPaymentMethodProps
 */

/**
 * @typedef {Object} WithStripe
 *
 * @property {Stripe} [stripe] Stripe api (might not be present)
 */

/**
 * @typedef {RegisteredPaymentMethodProps & WithStripe} StripeRegisteredPaymentMethodProps
 */

/**
 * PaymentRequestExpressComponent
 *
 * @param {StripeRegisteredPaymentMethodProps} props Incoming props
 */
const PaymentRequestExpressComponent = ( {
	shippingData,
	billing,
	eventRegistration,
	onSubmit,
	setExpressPaymentError,
	emitResponse,
	onClick,
	onClose,
} ) => {
	const {
		paymentRequest,
		paymentRequestEventHandlers,
		clearPaymentRequestEventHandler,
		isProcessing,
		canMakePayment,
		onButtonClick,
		abortPayment,
		completePayment,
		paymentRequestType,
	} = useInitialization( {
		billing,
		shippingData,
		setExpressPaymentError,
		onClick,
		onClose,
		onSubmit,
	} );
	useCheckoutSubscriptions( {
		canMakePayment,
		isProcessing,
		eventRegistration,
		paymentRequestEventHandlers,
		clearPaymentRequestEventHandler,
		billing,
		shippingData,
		emitResponse,
		paymentRequestType,
		completePayment,
		abortPayment,
	} );

	// locale is not a valid value for the paymentRequestButton style.
	const { theme } = getStripeServerData().button;

	const paymentRequestButtonStyle = {
		paymentRequestButton: {
			type: 'default',
			theme,
			height: '48px',
		},
	};

	return canMakePayment && paymentRequest ? (
		<PaymentRequestButtonElement
			onClick={ onButtonClick }
			options={ {
				// @ts-ignore
				style: paymentRequestButtonStyle,
				// @ts-ignore
				paymentRequest,
			} }
		/>
	) : null;
};

/**
 * PaymentRequestExpress with stripe provider
 *
 * @param {StripeRegisteredPaymentMethodProps} props
 */
export const PaymentRequestExpress = ( props ) => {
	const { locale } = getStripeServerData().button;
	const { stripe } = props;
	return (
		<Elements stripe={ stripe } locale={ locale }>
			<PaymentRequestExpressComponent { ...props } />
		</Elements>
	);
};
js/payment-method-extensions/payment-methods/stripe/payment-request/use-checkout-subscriptions.js000064400000020766151335517640035003 0ustar00woocommerce-blocks/assets/**
 * External dependencies
 */
import { useEffect, useRef } from '@wordpress/element';

/**
 * Internal dependencies
 */
import {
	normalizeShippingOptions,
	getTotalPaymentItem,
	normalizeLineItems,
	getBillingData,
	getPaymentMethodData,
	getShippingData,
} from '../stripe-utils';

/**
 * @typedef {import('@woocommerce/type-defs/registered-payment-method-props').EventRegistrationProps} EventRegistrationProps
 * @typedef {import('@woocommerce/type-defs/registered-payment-method-props').BillingDataProps} BillingDataProps
 * @typedef {import('@woocommerce/type-defs/registered-payment-method-props').ShippingDataProps} ShippingDataProps
 * @typedef {import('@woocommerce/type-defs/registered-payment-method-props').EmitResponseProps} EmitResponseProps
 */

/**
 * @param {Object} props
 *
 * @param {boolean}                props.canMakePayment                  Whether the payment request
 *                                                                       can make payment or not.
 * @param {boolean}                props.isProcessing                    Whether the express payment
 *                                                                       method is processing or not.
 * @param {EventRegistrationProps} props.eventRegistration               Various functions for
 *                                                                       registering observers to
 *                                                                       events.
 * @param {Object}                 props.paymentRequestEventHandlers     Cached handlers registered
 *                                                                       for paymentRequest events.
 * @param {function(string):void}  props.clearPaymentRequestEventHandler Clears the cached payment
 *                                                                       request event handler.
 * @param {BillingDataProps}       props.billing
 * @param {ShippingDataProps}      props.shippingData
 * @param {EmitResponseProps}      props.emitResponse
 * @param {string}                 props.paymentRequestType              The derived payment request
 *                                                                       type for the express
 *                                                                       payment being processed.
 * @param {function(any):void}     props.completePayment                 This is a callback
 *                                                                       receiving the source event
 *                                                                       and setting it to
 *                                                                       successful payment.
 * @param {function(any,string):any}     props.abortPayment                    This is a callback
 *                                                                       receiving the source
 *                                                                       event and setting it to
 *                                                                       failed payment.
 */
export const useCheckoutSubscriptions = ( {
	canMakePayment,
	isProcessing,
	eventRegistration,
	paymentRequestEventHandlers,
	clearPaymentRequestEventHandler,
	billing,
	shippingData,
	emitResponse,
	paymentRequestType,
	completePayment,
	abortPayment,
} ) => {
	const {
		onShippingRateSuccess,
		onShippingRateFail,
		onShippingRateSelectSuccess,
		onShippingRateSelectFail,
		onPaymentProcessing,
		onCheckoutAfterProcessingWithSuccess,
		onCheckoutAfterProcessingWithError,
	} = eventRegistration;
	const { noticeContexts, responseTypes } = emitResponse;
	const eventHandlers = useRef( paymentRequestEventHandlers );
	const currentBilling = useRef( billing );
	const currentShipping = useRef( shippingData );
	const currentPaymentRequestType = useRef( paymentRequestType );

	useEffect( () => {
		eventHandlers.current = paymentRequestEventHandlers;
		currentBilling.current = billing;
		currentShipping.current = shippingData;
		currentPaymentRequestType.current = paymentRequestType;
	}, [
		paymentRequestEventHandlers,
		billing,
		shippingData,
		paymentRequestType,
	] );

	// subscribe to events.
	useEffect( () => {
		const onShippingRatesEvent = ( shippingRates ) => {
			const handlers = eventHandlers.current;
			const billingData = currentBilling.current;
			if ( handlers.shippingAddressChange && isProcessing ) {
				handlers.shippingAddressChange.updateWith( {
					status: 'success',
					shippingOptions: normalizeShippingOptions( shippingRates ),
					total: getTotalPaymentItem( billingData.cartTotal ),
					displayItems: normalizeLineItems(
						billingData.cartTotalItems
					),
				} );
				clearPaymentRequestEventHandler( 'shippingAddressChange' );
			}
		};
		const onShippingRatesEventFail = ( currentErrorStatus ) => {
			const handlers = eventHandlers.current;
			if ( handlers.shippingAddressChange && isProcessing ) {
				handlers.shippingAddressChange.updateWith( {
					status: currentErrorStatus.hasInvalidAddress
						? 'invalid_shipping_address'
						: 'fail',
					shippingOptions: [],
				} );
			}
			clearPaymentRequestEventHandler( 'shippingAddressChange' );
		};
		const onShippingSelectedRate = ( forSuccess = true ) => () => {
			const handlers = eventHandlers.current;
			const shipping = currentShipping.current;
			const billingData = currentBilling.current;
			if (
				handlers.shippingOptionChange &&
				! shipping.isSelectingRate &&
				isProcessing
			) {
				const updateObject = forSuccess
					? {
							status: 'success',
							total: getTotalPaymentItem( billingData.cartTotal ),
							displayItems: normalizeLineItems(
								billingData.cartTotalItems
							),
					  }
					: {
							status: 'fail',
					  };
				handlers.shippingOptionChange.updateWith( updateObject );
				clearPaymentRequestEventHandler( 'shippingOptionChange' );
			}
		};
		const onProcessingPayment = () => {
			const handlers = eventHandlers.current;
			if ( handlers.sourceEvent && isProcessing ) {
				const response = {
					type: responseTypes.SUCCESS,
					meta: {
						billingData: getBillingData( handlers.sourceEvent ),
						paymentMethodData: getPaymentMethodData(
							handlers.sourceEvent,
							currentPaymentRequestType.current
						),
						shippingData: getShippingData( handlers.sourceEvent ),
					},
				};
				return response;
			}
			return { type: responseTypes.SUCCESS };
		};
		const onCheckoutComplete = ( checkoutResponse ) => {
			const handlers = eventHandlers.current;
			let response = { type: responseTypes.SUCCESS };
			if ( handlers.sourceEvent && isProcessing ) {
				const {
					paymentStatus,
					paymentDetails,
				} = checkoutResponse.processingResponse;
				if ( paymentStatus === responseTypes.SUCCESS ) {
					completePayment( handlers.sourceEvent );
				}
				if (
					paymentStatus === responseTypes.ERROR ||
					paymentStatus === responseTypes.FAIL
				) {
					abortPayment( handlers.sourceEvent );
					response = {
						type: responseTypes.ERROR,
						message: paymentDetails?.errorMessage,
						messageContext: noticeContexts.EXPRESS_PAYMENTS,
						retry: true,
					};
				}
				clearPaymentRequestEventHandler( 'sourceEvent' );
			}
			return response;
		};
		if ( canMakePayment && isProcessing ) {
			const unsubscribeShippingRateSuccess = onShippingRateSuccess(
				onShippingRatesEvent
			);
			const unsubscribeShippingRateFail = onShippingRateFail(
				onShippingRatesEventFail
			);
			const unsubscribeShippingRateSelectSuccess = onShippingRateSelectSuccess(
				onShippingSelectedRate()
			);
			const unsubscribeShippingRateSelectFail = onShippingRateSelectFail(
				onShippingRatesEventFail
			);
			const unsubscribePaymentProcessing = onPaymentProcessing(
				onProcessingPayment
			);
			const unsubscribeCheckoutCompleteSuccess = onCheckoutAfterProcessingWithSuccess(
				onCheckoutComplete
			);
			const unsubscribeCheckoutCompleteFail = onCheckoutAfterProcessingWithError(
				onCheckoutComplete
			);
			return () => {
				unsubscribeCheckoutCompleteFail();
				unsubscribeCheckoutCompleteSuccess();
				unsubscribePaymentProcessing();
				unsubscribeShippingRateFail();
				unsubscribeShippingRateSuccess();
				unsubscribeShippingRateSelectSuccess();
				unsubscribeShippingRateSelectFail();
			};
		}
		return undefined;
	}, [
		canMakePayment,
		isProcessing,
		onShippingRateSuccess,
		onShippingRateFail,
		onShippingRateSelectSuccess,
		onShippingRateSelectFail,
		onPaymentProcessing,
		onCheckoutAfterProcessingWithSuccess,
		onCheckoutAfterProcessingWithError,
		responseTypes,
		noticeContexts,
		completePayment,
		abortPayment,
		clearPaymentRequestEventHandler,
	] );
};
assets/js/payment-method-extensions/payment-methods/stripe/payment-request/use-event-handlers.js000064400000002116151335517640033175 0ustar00woocommerce-blocks/**
 * External dependencies
 */
import { useState, useCallback } from '@wordpress/element';

/**
 * Internal dependencies
 */
import { DEFAULT_STRIPE_EVENT_HANDLERS } from './constants';

/**
 * A utility hook for maintaining an event handler cache.
 */
export const useEventHandlers = () => {
	const [ paymentRequestEventHandlers, setEventHandlers ] = useState(
		DEFAULT_STRIPE_EVENT_HANDLERS
	);

	const setPaymentRequestEventHandler = useCallback(
		( eventName, handler ) => {
			setEventHandlers( ( prevEventHandlers ) => {
				return {
					...prevEventHandlers,
					[ eventName ]: handler,
				};
			} );
		},
		[ setEventHandlers ]
	);

	const clearPaymentRequestEventHandler = useCallback(
		( eventName ) => {
			// @ts-ignore
			setEventHandlers( ( prevEventHandlers ) => {
				// @ts-ignore
				// eslint-disable-next-line no-unused-vars
				const { [ eventName ]: __, ...newHandlers } = prevEventHandlers;
				return newHandlers;
			} );
		},
		[ setEventHandlers ]
	);
	return {
		paymentRequestEventHandlers,
		setPaymentRequestEventHandler,
		clearPaymentRequestEventHandler,
	};
};
assets/js/payment-method-extensions/payment-methods/stripe/stripe-utils/load-stripe.js000064400000000746151335517640031217 0ustar00woocommerce-blocks/**
 * External dependencies
 */
import { loadStripe } from '@stripe/stripe-js';

/**
 * Internal dependencies
 */
import { getApiKey } from './utils';

const stripePromise = () =>
	new Promise( ( resolve ) => {
		try {
			resolve( loadStripe( getApiKey() ) );
		} catch ( error ) {
			// In order to avoid showing console error publicly to users,
			// we resolve instead of rejecting when there is an error.
			resolve( { error } );
		}
	} );

export { stripePromise as loadStripe };
assets/js/payment-method-extensions/payment-methods/stripe/stripe-utils/constants.js000064400000001622151335517640031002 0ustar00woocommerce-blocksexport const errorTypes = {
	INVALID_EMAIL: 'email_invalid',
	INVALID_REQUEST: 'invalid_request_error',
	API_CONNECTION: 'api_connection_error',
	API_ERROR: 'api_error',
	AUTHENTICATION_ERROR: 'authentication_error',
	RATE_LIMIT_ERROR: 'rate_limit_error',
	CARD_ERROR: 'card_error',
	VALIDATION_ERROR: 'validation_error',
};

export const errorCodes = {
	INVALID_NUMBER: 'invalid_number',
	INVALID_EXPIRY_MONTH: 'invalid_expiry_month',
	INVALID_EXPIRY_YEAR: 'invalid_expiry_year',
	INVALID_CVC: 'invalid_cvc',
	INCORRECT_NUMBER: 'incorrect_number',
	INCOMPLETE_NUMBER: 'incomplete_number',
	INCOMPLETE_CVC: 'incomplete_cvc',
	INCOMPLETE_EXPIRY: 'incomplete_expiry',
	EXPIRED_CARD: 'expired_card',
	INCORRECT_CVC: 'incorrect_cvc',
	INCORRECT_ZIP: 'incorrect_zip',
	INVALID_EXPIRY_YEAR_PAST: 'invalid_expiry_year_past',
	CARD_DECLINED: 'card_declined',
	MISSING: 'missing',
	PROCESSING_ERROR: 'processing_error',
};
assets/js/payment-method-extensions/payment-methods/stripe/stripe-utils/normalize.js000064400000013165151335517640030773 0ustar00woocommerce-blocks/**
 * @typedef {import('./type-defs').StripePaymentItem} StripePaymentItem
 * @typedef {import('./type-defs').StripeShippingOption} StripeShippingOption
 * @typedef {import('./type-defs').StripeShippingAddress} StripeShippingAddress
 * @typedef {import('./type-defs').StripePaymentResponse} StripePaymentResponse
 * @typedef {import('@woocommerce/type-defs/registered-payment-method-props').PreparedCartTotalItem} CartTotalItem
 * @typedef {import('@woocommerce/type-defs/cart').CartShippingOption} CartShippingOption
 * @typedef {import('@woocommerce/type-defs/shipping').ShippingAddress} CartShippingAddress
 * @typedef {import('@woocommerce/type-defs/billing').BillingData} CartBillingAddress
 */

/**
 * Normalizes incoming cart total items for use as a displayItems with the
 * Stripe api.
 *
 * @param {CartTotalItem[]} cartTotalItems CartTotalItems to normalize
 * @param {boolean}         pending        Whether to mark items as pending or
 *                                         not
 *
 * @return {StripePaymentItem[]} An array of PaymentItems
 */
const normalizeLineItems = ( cartTotalItems, pending = false ) => {
	return cartTotalItems
		.map( ( cartTotalItem ) => {
			return cartTotalItem.value
				? {
						amount: cartTotalItem.value,
						label: cartTotalItem.label,
						pending,
				  }
				: false;
		} )
		.filter( Boolean );
};

/**
 * Normalizes incoming cart shipping option items for use as shipping options
 * with the Stripe api.
 *
 * @param {CartShippingOption[]}  shippingOptions An array of CartShippingOption items.
 *
 * @return {StripeShippingOption[]}  An array of Stripe shipping option items.
 */
const normalizeShippingOptions = ( shippingOptions ) => {
	const rates = shippingOptions[ 0 ].shipping_rates;
	return rates.map( ( rate ) => {
		return {
			id: rate.rate_id,
			label: rate.name,
			detail: rate.description,
			amount: parseInt( rate.price, 10 ),
		};
	} );
};

/**
 * Normalize shipping address information from stripe's address object to
 * the cart shipping address object shape.
 *
 * @param {StripeShippingAddress} shippingAddress Stripe's shipping address item
 *
 * @return {CartShippingAddress} The shipping address in the shape expected by
 * the cart.
 */
const normalizeShippingAddressForCheckout = ( shippingAddress ) => {
	const address = {
		first_name: shippingAddress.recipient
			.split( ' ' )
			.slice( 0, 1 )
			.join( ' ' ),
		last_name: shippingAddress.recipient
			.split( ' ' )
			.slice( 1 )
			.join( ' ' ),
		company: '',
		address_1:
			typeof shippingAddress.addressLine[ 0 ] === 'undefined'
				? ''
				: shippingAddress.addressLine[ 0 ],
		address_2:
			typeof shippingAddress.addressLine[ 1 ] === 'undefined'
				? ''
				: shippingAddress.addressLine[ 1 ],
		city: shippingAddress.city,
		state: shippingAddress.region,
		country: shippingAddress.country,
		postcode: shippingAddress.postalCode.replace( ' ', '' ),
	};
	return address;
};

/**
 * Normalizes shipping option shape selection from Stripe's shipping option
 * object to the expected shape for cart shipping option selections.
 *
 * @param {StripeShippingOption} shippingOption The customer's selected shipping
 *                                              option.
 *
 * @return {string[]}  An array of ids (in this case will just be one)
 */
const normalizeShippingOptionSelectionsForCheckout = ( shippingOption ) => {
	return shippingOption.id;
};

/**
 * Returns the billing data extracted from the stripe payment response to the
 * CartBillingData shape.
 *
 * @param {StripePaymentResponse} paymentResponse Stripe's payment response
 *                                                object.
 *
 * @return {CartBillingAddress} The cart billing data
 */
const getBillingData = ( paymentResponse ) => {
	const source = paymentResponse.source;
	const name = source && source.owner.name;
	const billing = source && source.owner.address;
	const payerEmail = paymentResponse.payerEmail || '';
	const payerPhone = paymentResponse.payerPhone || '';
	return {
		first_name: name ? name.split( ' ' ).slice( 0, 1 ).join( ' ' ) : '',
		last_name: name ? name.split( ' ' ).slice( 1 ).join( ' ' ) : '',
		email: ( source && source.owner.email ) || payerEmail,
		phone:
			( source && source.owner.phone ) ||
			payerPhone.replace( '/[() -]/g', '' ),
		country: ( billing && billing.country ) || '',
		address_1: ( billing && billing.line1 ) || '',
		address_2: ( billing && billing.line2 ) || '',
		city: ( billing && billing.city ) || '',
		state: ( billing && billing.state ) || '',
		postcode: ( billing && billing.postal_code ) || '',
		company: '',
	};
};

/**
 * This returns extra payment method data to add to the payment method update
 * request made by the checkout processor.
 *
 * @param {StripePaymentResponse} paymentResponse    A stripe payment response
 *                                                   object.
 * @param {string}                paymentRequestType The payment request type
 *                                                   used for payment.
 *
 * @return {Object} An object with the extra payment data.
 */
const getPaymentMethodData = ( paymentResponse, paymentRequestType ) => {
	return {
		payment_method: 'stripe',
		stripe_source: paymentResponse.source
			? paymentResponse.source.id
			: null,
		payment_request_type: paymentRequestType,
	};
};

const getShippingData = ( paymentResponse ) => {
	return paymentResponse.shippingAddress
		? {
				address: normalizeShippingAddressForCheckout(
					paymentResponse.shippingAddress
				),
		  }
		: null;
};

export {
	normalizeLineItems,
	normalizeShippingOptions,
	normalizeShippingAddressForCheckout,
	normalizeShippingOptionSelectionsForCheckout,
	getBillingData,
	getPaymentMethodData,
	getShippingData,
};
assets/js/payment-method-extensions/payment-methods/stripe/stripe-utils/type-defs.js000064400000046017151335517640030675 0ustar00woocommerce-blocks/**
 * Stripe PaymentItem object
 *
 * @typedef {Object} StripePaymentItem
 *
 * @property {string}   label     The label for the payment item.
 * @property {number}   amount    The amount for the payment item (in subunits)
 * @property {boolean}  [pending] Whether or not the amount is pending update on
 *                                recalculation.
 */

/**
 * Stripe ShippingOption object
 *
 * @typedef {Object} StripeShippingOption
 *
 * @property {string} id     A unique ID for the shipping option.
 * @property {string} label  A short label for the shipping option.
 * @property {string} detail A longer description for the shipping option.
 * @property {number} amount The amount to show for the shipping option
 *                           (in subunits)
 */

/**
 * @typedef {Object} StripeShippingAddress
 *
 * @property {string}  country             Two letter country code, capitalized
 *                                         (ISO3166 alpha-2).
 * @property {Array}   addressLine         An array of address line items.
 * @property {string}  region              The most coarse subdivision of a
 *                                         country. (state etc)
 * @property {string}  city                The name of a city, town, village etc.
 * @property {string}  postalCode          The postal or ZIP code.
 * @property {string}  recipient           The name of the recipient.
 * @property {string}  phone               The phone number of the recipient.
 * @property {string}  [sortingCode]       The sorting code as used in France.
 *                                         Not present on Apple platforms.
 * @property {string}  [dependentLocality] A logical subdivision of a city.
 *                                         Not present on Apple platforms.
 */

/**
 * @typedef {Object} StripeBillingDetails
 *
 * @property {Object} address             The billing address
 * @property {string} address.city        The billing address city
 * @property {string} address.country     The billing address country
 * @property {string} address.line1       The first line for the address
 * @property {string} address.line2       The second line fro the address
 * @property {string} address.postal_code The postal/zip code
 * @property {string} address.state       The state
 * @property {string} email               The billing email
 * @property {string} name                The billing name
 * @property {string} phone               The billing phone
 * @property {Object} [verified_address]  The verified address of the owner.
 * @property {string} [verified_email]    Provided by the payment provider.
 * @property {string} [verified_phone]    Provided by the payment provider.
 * @property {string} [verified_name]     Provided by the payment provider.
 */

/**
 * @typedef {Object} StripeBillingCard
 *
 * @property {string} brand                            The card brand
 * @property {Object} checks                           Various security checks
 * @property {string} checks.address_line1_check       If an address line1 was
 *                                                     provided, results of the
 *                                                     check.
 * @property {string} checks.address_postal_code_check If a postal code was
 *                                                     provided, results of the
 *                                                     check.
 * @property {string} checks.cvc_check                 If CVC provided, results
 *                                                     of the check.
 * @property {string} country                          Two-letter ISO code for
 *                                                     the country on the card.
 * @property {number} exp_month                        Two-digit number for
 *                                                     card expiry month.
 * @property {number} exp_year                         Two-digit number for
 *                                                     card expiry year.
 * @property {string} fingerprint                      Uniquely identifies this
 *                                                     particular card number
 * @property {string} funding                          The card funding type
 * @property {Object} generated_from                   Details of the original
 *                                                     PaymentMethod that
 *                                                     created this object.
 * @property {string} last4                            The last 4 digits of the
 *                                                     card
 * @property {Object} three_d_secure_usage             Contains details on how
 *                                                     this card may be used for
 *                                                     3d secure
 * @property {Object} wallet                           If this card is part of a
 *                                                     card wallet, this
 *                                                     contains the details of
 *                                                     the card wallet.
 */

/**
 * @typedef {Object} StripePaymentMethod
 *
 * @property {string}               id               Unique identifier for the
 *                                                   object
 * @property {StripeBillingDetails} billing_details  The billing details for the
 *                                                   payment method
 * @property {StripeBillingCard}    card             Details on the card used to
 *                                                   pay
 * @property {string}               customer         The ID of the customer to
 *                                                   which this payment method
 *                                                   is saved.
 * @property {Object}               metadata         Set of key-value pairs that
 *                                                   can be attached to the
 *                                                   object.
 * @property {string}               type             Type of payment method
 * @property {string}               object           The type of object. Always
 *                                                   'payment_method'. Can use
 *                                                   to validate!
 * @property {Object}               card_present     If this is a card present
 *                                                   payment method, contains
 *                                                   details about that card
 * @property {number}               created          The timestamp for when the
 *                                                   card was created.
 * @property {Object}               fpx              If this is an fpx payment
 *                                                   method, contains details
 *                                                   about it.
 * @property {Object}               ideal            If this is an ideal payment
 *                                                   method, contains details
 *                                                   about it.
 * @property {boolean}              livemode         True if the object exists
 *                                                   in live mode or if in test
 *                                                   mode.
 * @property {Object}               sepa_debit       If this is a sepa_debit
 *                                                   payment method, contains
 *                                                   details about it.
 */

/**
 * @typedef {Object} StripeSource
 *
 * @property {string}               id                    Unique identifier for
 *                                                        object
 * @property {number}               amount                A positive number in
 *                                                        the smallest currency
 *                                                        unit.
 * @property {string}               currency              The three-letter ISO
 *                                                        code for the currency
 * @property {string}               customer              The ID of the customer
 *                                                        to which this source
 *                                                        is attached.
 * @property {Object}               metadata              Arbitrary key-value
 *                                                        pairs that can be
 *                                                        attached.
 * @property {StripeBillingDetails} owner                 Information about the
 *                                                        owner of the payment
 *                                                        made.
 * @property {Object}               [redirect]            Information related to
 *                                                        the redirect flow
 *                                                        (present if the source
 *                                                        is authenticated by
 *                                                        redirect)
 * @property {string}               statement_descriptor  Extra information
 *                                                        about a source (will
 *                                                        appear on customer's
 *                                                        statement)
 * @property {string}               status                The status of the
 *                                                        source.
 * @property {string}               type                  The type of the source
 *                                                        (it is a payment
 *                                                        method type)
 * @property {string}               object                Value is "source" can
 *                                                        be used to validate.
 * @property {string}               client_secret         The client secret of
 *                                                        the source. Used for
 *                                                        client-side retrieval
 *                                                        using a publishable
 *                                                        key.
 * @property {Object}               [code_verification]   Information related to
 *                                                        the code verification
 *                                                        flow.
 * @property {number}               created               When the source object
 *                                                        was instantiated
 *                                                        (timestamp).
 * @property {string}               flow                  The authentication
 *                                                        flow of the source.
 * @property {boolean}              livemode              If true then payment
 *                                                        is made in live mode
 *                                                        otherwise test mode.
 * @property {Object}               [receiver]            Information related to
 *                                                        the receiver flow.
 * @property {Object}               source_order          Information about the
 *                                                        items and shipping
 *                                                        associated with the
 *                                                        source.
 * @property {string}               usage                 Whether source should
 *                                                        be reusable or not.
 */

/**
 * @typedef {Object} StripePaymentResponse
 *
 * @property {Object}                 token             A stripe token object
 * @property {StripePaymentMethod}    paymentMethod     The stripe payment method
 *                                                      object
 * @property {?StripeSource}          source            Present if this was the
 *                                                      result of a source event
 *                                                      listener
 * @property {Function}               complete          Call this when the token
 *                                                      data has been processed.
 * @property {string}                 [payerName]       The customer's name.
 * @property {string}                 [payerEmail]      The customer's email.
 * @property {string}                 [payerPhone]      The customer's phone.
 * @property {StripeShippingAddress}  [shippingAddress] The final shipping
 *                                                      address the customer
 *                                                      indicated
 * @property {StripeShippingOption}   [shippingOption]  The final shipping
 *                                                      option the customer
 *                                                      selected.
 * @property {string}                 methodName        The unique name of the
 *                                                      payment handler the
 *                                                      customer chose to
 *                                                      authorize payment
 */

/**
 * @typedef {Object} StripePaymentRequestOptions The configuration of stripe
 *                                               payment request options to
 *                                               pass in.
 *
 * @property {string}                 country           Two-letter (ISO)
 *                                                      country code.
 * @property {string}                 currency          Three letter currency
 *                                                      code.
 * @property {StripePaymentItem}      total             Shown to the customer.
 * @property {StripePaymentItem[]}    displayItems      Line items shown to the
 *                                                      customer.
 * @property {boolean}                requestPayerName  Whether or not to
 *                                                      collect the payer's
 *                                                      name.
 * @property {boolean}                requestPayerEmail Whether or not to
 *                                                      collect the payer's
 *                                                      email.
 * @property {boolean}                requestPayerPhone Whether or not to
 *                                                      collect the payer's
 *                                                      phone.
 * @property {boolean}                requestShipping   Whether to collect
 *                                                      shipping address.
 * @property {StripeShippingOption[]} shippingOptions   Available shipping
 *                                                      options.
 */

/**
 * @typedef {Object} StripePaymentRequest Stripe payment request object.
 *
 * @property {function():Promise} canMakePayment Returns a promise that resolves
 *                                               with an object detailing if a
 *                                               browser payment API is
 *                                               available.
 * @property {function()}         show           Shows the browser's payment
 *                                               interface (called automatically
 *                                               if payment request button in
 *                                               use)
 * @property {function()}         update         Used to update a PaymentRequest
 *                                               object.
 * @property {function()}         on             For registering callbacks on
 *                                               payment request events.
 */

/**
 * @typedef {Object} Stripe Stripe api object.
 * @property {any} api Various api properties
 */

/**
 * @typedef {Object} CreditCardIcon
 *
 * @property {string} url  Url to icon.
 * @property {string} alt  Alt text for icon.
 */

/* eslint-disable jsdoc/valid-types */
// [k:string]:CreditCardIcon triggers the above rule even though VSCode interprets it fine.
/**
 * @typedef {Object} StripeServerData
 *
 * @property {string}                      stripeTotalLabel     The string used for payment
 *                                                              descriptor.
 * @property {string}                      publicKey            The public api key for stripe
 *                                                              requests.
 * @property {boolean}                     allowPrepaidCard     True means that prepaid cards
 *                                                              can be used for payment.
 * @property {Object}                      button               Contains button styles
 * @property {string}                      button.type          The type of button.
 * @property {string}                      button.theme         The theme for the button.
 * @property {string}                      button.height        The height (in pixels) for
 *                                                              the button.
 * @property {string}                      button.locale        The locale to use for stripe
 *                                                              elements.
 * @property {boolean}                     inline_cc_form       Whether stripe cc should use
 *                                                              inline cc
 *                                                              form or separate inputs.
 * @property {{[k:string]:CreditCardIcon}} icons                Contains supported cc icons.
 * @property {boolean}                     showSavedCards       Used to indicate whether saved cards
 *                                                              can be used.
 * @property {boolean}                     showSaveOption       Used to indicate whether the option to
 *                                                              save card can be displayed.
 * @property {boolean}                     allowPaymentRequest  True if merchant has enabled payment
 *                                                              request (Chrome/Apple Pay).
 * @property {Object}                      supports             List of features supported by the payment gateway
 */
/* eslint-enable jsdoc/valid-types */

/**
 * @typedef {Object} StripeElementOptions
 *
 * @property {Object}            options  The configuration object for stripe
 *                                        elements.
 * @property {function(boolean)} onActive A callback for setting whether an
 *                                        element is active or not. "Active"
 *                                        means it's not empty.
 * @property {string}            error    Any error message from the stripe
 *                                        element.
 * @property {function(string)}  setError A callback for setting an error
 *                                        message.
 */

export {};
woocommerce-blocks/assets/js/payment-method-extensions/payment-methods/stripe/stripe-utils/index.js000064400000000125151335517640030151 0ustar00export * from './normalize';
export * from './utils';
export * from './load-stripe';
woocommerce-blocks/assets/js/payment-method-extensions/payment-methods/stripe/stripe-utils/utils.js000064400000020667151335517640030217 0ustar00/**
 * External dependencies
 */
import { getSetting } from '@woocommerce/settings';
import { __ } from '@wordpress/i18n';

/**
 * Internal dependencies
 */
import { normalizeLineItems } from './normalize';
import { errorTypes, errorCodes } from './constants';

/**
 * @typedef {import('./type-defs').StripeServerData} StripeServerData
 * @typedef {import('./type-defs').StripePaymentItem} StripePaymentItem
 * @typedef {import('./type-defs').StripePaymentRequest} StripePaymentRequest
 * @typedef {import('@woocommerce/type-defs/registered-payment-method-props').PreparedCartTotalItem} CartTotalItem
 */

/**
 * Stripe data comes form the server passed on a global object.
 *
 * @return  {StripeServerData} Stripe server data.
 */
const getStripeServerData = () => {
	const stripeServerData = getSetting( 'stripe_data', null );
	if ( ! stripeServerData ) {
		throw new Error( 'Stripe initialization data is not available' );
	}
	return stripeServerData;
};

/**
 * Returns the public api key for the stripe payment method
 *
 * @throws Error
 * @return {string} The public api key for the stripe payment method.
 */
const getApiKey = () => {
	const apiKey = getStripeServerData().publicKey;
	if ( ! apiKey ) {
		throw new Error(
			'There is no api key available for stripe. Make sure it is available on the wc.stripe_data.stripe.key property.'
		);
	}
	return apiKey;
};

/**
 * The total PaymentItem object used for the stripe PaymentRequest object.
 *
 * @param {CartTotalItem} total  The total amount.
 *
 * @return {StripePaymentItem} The PaymentItem object used for stripe.
 */
const getTotalPaymentItem = ( total ) => {
	return {
		label:
			getStripeServerData().stripeTotalLabel ||
			__( 'Total', 'woocommerce' ),
		amount: total.value,
	};
};

/**
 * Returns a stripe payment request object
 *
 * @param {Object}          config                  A configuration object for
 *                                                  getting the payment request.
 * @param {Object}          config.stripe           The stripe api.
 * @param {CartTotalItem}   config.total            The amount for the total
 *                                                  (in subunits) provided by
 *                                                  checkout/cart.
 * @param {string}          config.currencyCode     The currency code provided
 *                                                  by checkout/cart.
 * @param {string}          config.countryCode      The country code provided by
 *                                                  checkout/cart.
 * @param {boolean}         config.shippingRequired Whether or not shipping is
 *                                                  required.
 * @param {CartTotalItem[]} config.cartTotalItems   Array of line items provided
 *                                                  by checkout/cart.
 *
 * @return {StripePaymentRequest} A stripe payment request object
 */
const getPaymentRequest = ( {
	stripe,
	total,
	currencyCode,
	countryCode,
	shippingRequired,
	cartTotalItems,
} ) => {
	const options = {
		total: getTotalPaymentItem( total ),
		currency: currencyCode,
		country: countryCode || 'US',
		requestPayerName: true,
		requestPayerEmail: true,
		requestPayerPhone: true,
		requestShipping: shippingRequired,
		displayItems: normalizeLineItems( cartTotalItems ),
	};
	return stripe.paymentRequest( options );
};

/**
 * Utility function for updating the Stripe PaymentRequest object
 *
 * @param {Object}               update                An object containing the
 *                                                     things needed for the
 *                                                     update
 * @param {StripePaymentRequest} update.paymentRequest A Stripe payment request
 *                                                     object
 * @param {CartTotalItem}        update.total          A total line item.
 * @param {string}               update.currencyCode   The currency code for the
 *                                                     amount provided.
 * @param {CartTotalItem[]}      update.cartTotalItems An array of line items
 *                                                     provided by the
 *                                                     cart/checkout.
 */
const updatePaymentRequest = ( {
	paymentRequest,
	total,
	currencyCode,
	cartTotalItems,
} ) => {
	paymentRequest.update( {
		total: getTotalPaymentItem( total ),
		currency: currencyCode,
		displayItems: normalizeLineItems( cartTotalItems ),
	} );
};

/**
 * Returns whether or not the current session can do apple pay.
 *
 * @param {StripePaymentRequest} paymentRequest A Stripe PaymentRequest instance.
 *
 * @return {Promise<Object>}  True means apple pay can be done.
 */
const canDoPaymentRequest = ( paymentRequest ) => {
	return new Promise( ( resolve ) => {
		paymentRequest.canMakePayment().then( ( result ) => {
			if ( result ) {
				const paymentRequestType = result.applePay
					? 'apple_pay'
					: 'payment_request_api';
				resolve( { canPay: true, requestType: paymentRequestType } );
				return;
			}
			resolve( { canPay: false } );
		} );
	} );
};

const isNonFriendlyError = ( type ) =>
	[
		errorTypes.INVALID_REQUEST,
		errorTypes.API_CONNECTION,
		errorTypes.API_ERROR,
		errorTypes.AUTHENTICATION_ERROR,
		errorTypes.RATE_LIMIT_ERROR,
	].includes( type );

const getErrorMessageForCode = ( code ) => {
	const messages = {
		[ errorCodes.INVALID_NUMBER ]: __(
			'The card number is not a valid credit card number.',
			'woocommerce-gateway-stripe'
		),
		[ errorCodes.INVALID_EXPIRY_MONTH ]: __(
			'The card expiration month is invalid.',
			'woocommerce-gateway-stripe'
		),
		[ errorCodes.INVALID_EXPIRY_YEAR ]: __(
			'The card expiration year is invalid.',
			'woocommerce-gateway-stripe'
		),
		[ errorCodes.INVALID_CVC ]: __(
			'The card security code is invalid.',
			'woocommerce-gateway-stripe'
		),
		[ errorCodes.INCORRECT_NUMBER ]: __(
			'The card number is incorrect.',
			'woocommerce-gateway-stripe'
		),
		[ errorCodes.INCOMPLETE_NUMBER ]: __(
			'The card number is incomplete.',
			'woocommerce-gateway-stripe'
		),
		[ errorCodes.INCOMPLETE_CVC ]: __(
			'The card security code is incomplete.',
			'woocommerce-gateway-stripe'
		),
		[ errorCodes.INCOMPLETE_EXPIRY ]: __(
			'The card expiration date is incomplete.',
			'woocommerce-gateway-stripe'
		),
		[ errorCodes.EXPIRED_CARD ]: __(
			'The card has expired.',
			'woocommerce-gateway-stripe'
		),
		[ errorCodes.INCORRECT_CVC ]: __(
			'The card security code is incorrect.',
			'woocommerce-gateway-stripe'
		),
		[ errorCodes.INCORRECT_ZIP ]: __(
			'The card zip code failed validation.',
			'woocommerce-gateway-stripe'
		),
		[ errorCodes.INVALID_EXPIRY_YEAR_PAST ]: __(
			'The card expiration year is in the past',
			'woocommerce-gateway-stripe'
		),
		[ errorCodes.CARD_DECLINED ]: __(
			'The card was declined.',
			'woocommerce-gateway-stripe'
		),
		[ errorCodes.MISSING ]: __(
			'There is no card on a customer that is being charged.',
			'woocommerce-gateway-stripe'
		),
		[ errorCodes.PROCESSING_ERROR ]: __(
			'An error occurred while processing the card.',
			'woocommerce-gateway-stripe'
		),
	};
	return messages[ code ] || null;
};

const getErrorMessageForTypeAndCode = ( type, code = '' ) => {
	switch ( type ) {
		case errorTypes.INVALID_EMAIL:
			return __(
				'Invalid email address, please correct and try again.',
				'woo-gutenberg-product-blocks'
			);
		case isNonFriendlyError( type ):
			return __(
				'Unable to process this payment, please try again or use alternative method.',
				'woo-gutenberg-product-blocks'
			);
		case errorTypes.CARD_ERROR:
			return getErrorMessageForCode( code );
		case errorTypes.VALIDATION_ERROR:
			return ''; // These are shown inline.
	}
	return null;
};

/**
 * pluckAddress takes a full address object and returns relevant fields for calculating
 * shipping, so we can track when one of them change to update rates.
 *
 * @param {Object} address          An object containing all address information
 * @param {string} address.country
 * @param {string} address.state
 * @param {string} address.city
 * @param {string} address.postcode
 *
 * @return {Object} pluckedAddress  An object containing shipping address that are needed to fetch an address.
 */
const pluckAddress = ( { country, state, city, postcode } ) => ( {
	country,
	state,
	city,
	postcode: postcode.replace( ' ', '' ).toUpperCase(),
} );

export {
	getStripeServerData,
	getApiKey,
	getTotalPaymentItem,
	getPaymentRequest,
	updatePaymentRequest,
	canDoPaymentRequest,
	getErrorMessageForTypeAndCode,
	pluckAddress,
};
woocommerce-blocks/assets/js/payment-method-extensions/payment-methods/cod/index.js000064400000005125151335517640024751 0ustar00/**
 * External dependencies
 */
import { registerPaymentMethod } from '@woocommerce/blocks-registry';
import { __ } from '@wordpress/i18n';
import { getSetting } from '@woocommerce/settings';
import { decodeEntities } from '@wordpress/html-entities';

/**
 * Internal dependencies
 */
import { PAYMENT_METHOD_NAME } from './constants';

const settings = getSetting( 'cod_data', {} );
const defaultLabel = __( 'Cash on delivery', 'woocommerce' );
const label = decodeEntities( settings.title ) || defaultLabel;

/**
 * @typedef {import('@woocommerce/type-defs/registered-payment-method-props').RegisteredPaymentMethodProps} RegisteredPaymentMethodProps
 */

/**
 * Content component
 */
const Content = () => {
	return decodeEntities( settings.description || '' );
};

/**
 * Label component
 *
 * @param {*} props Props from payment API.
 */
const Label = ( props ) => {
	const { PaymentMethodLabel } = props.components;
	return <PaymentMethodLabel text={ label } />;
};

/**
 * Determine whether COD is available for this cart/order.
 *
 * @param {Object} props Incoming props for the component.
 * @param {boolean} props.cartNeedsShipping True if the cart contains any physical/shippable products.
 * @param {boolean} props.selectedShippingMethods
 *
 * @return {boolean}  True if COD payment method should be displayed as a payment option.
 */
const canMakePayment = ( { cartNeedsShipping, selectedShippingMethods } ) => {
	if ( ! settings.enableForVirtual && ! cartNeedsShipping ) {
		// Store doesn't allow COD for virtual orders AND
		// order doesn't contain any shippable products.
		return false;
	}

	if ( ! settings.enableForShippingMethods.length ) {
		// Store does not limit COD to specific shipping methods.
		return true;
	}

	// Look for a supported shipping method in the user's selected
	// shipping methods. If one is found, then COD is allowed.
	const selectedMethods = Object.values( selectedShippingMethods );
	// supported shipping methods might be global (eg. "Any flat rate"), hence
	// this is doing a `String.prototype.includes` match vs a `Array.prototype.includes` match.
	return settings.enableForShippingMethods.some( ( shippingMethodId ) => {
		return selectedMethods.some( ( selectedMethod ) => {
			return selectedMethod.includes( shippingMethodId );
		} );
	} );
};

/**
 * Cash on Delivery (COD) payment method config object.
 */
const cashOnDeliveryPaymentMethod = {
	name: PAYMENT_METHOD_NAME,
	label: <Label />,
	content: <Content />,
	edit: <Content />,
	canMakePayment,
	ariaLabel: label,
	supports: {
		features: settings?.supports ?? [],
	},
};

registerPaymentMethod( cashOnDeliveryPaymentMethod );
woocommerce-blocks/assets/js/payment-method-extensions/payment-methods/cod/constants.js000064400000000052151335517640025650 0ustar00export const PAYMENT_METHOD_NAME = 'cod';
woocommerce-blocks/assets/js/payment-method-extensions/payment-methods/cheque/constants.js000064400000000055151335517640026360 0ustar00export const PAYMENT_METHOD_NAME = 'cheque';
woocommerce-blocks/assets/js/payment-method-extensions/payment-methods/cheque/index.js000064400000002434151335517640025456 0ustar00/**
 * External dependencies
 */
import { registerPaymentMethod } from '@woocommerce/blocks-registry';
import { __ } from '@wordpress/i18n';
import { getSetting } from '@woocommerce/settings';
import { decodeEntities } from '@wordpress/html-entities';

/**
 * Internal dependencies
 */
import { PAYMENT_METHOD_NAME } from './constants';

const settings = getSetting( 'cheque_data', {} );
const defaultLabel = __( 'Check payment', 'woocommerce' );
const label = decodeEntities( settings.title ) || defaultLabel;

/**
 * @typedef {import('@woocommerce/type-defs/registered-payment-method-props').RegisteredPaymentMethodProps} RegisteredPaymentMethodProps
 */

/**
 * Content component
 */
const Content = () => {
	return decodeEntities( settings.description || '' );
};

/**
 * Label component
 *
 * @param {*} props Props from payment API.
 */
const Label = ( props ) => {
	const { PaymentMethodLabel } = props.components;
	return <PaymentMethodLabel text={ label } />;
};

/**
 * Cheque payment method config object.
 */
const offlineChequePaymentMethod = {
	name: PAYMENT_METHOD_NAME,
	label: <Label />,
	content: <Content />,
	edit: <Content />,
	canMakePayment: () => true,
	ariaLabel: label,
	supports: {
		features: settings?.supports ?? [],
	},
};

registerPaymentMethod( offlineChequePaymentMethod );
woocommerce-blocks/assets/js/blocks/product-categories/block.js000064400000010745151335517640021005 0ustar00/**
 * External dependencies
 */
import { __ } from '@wordpress/i18n';
import { InspectorControls } from '@wordpress/block-editor';
import ServerSideRender from '@wordpress/server-side-render';
import PropTypes from 'prop-types';
import {
	Disabled,
	PanelBody,
	ToggleControl,
	Placeholder,
} from '@wordpress/components';
import { Icon, list } from '@woocommerce/icons';
import ToggleButtonControl from '@woocommerce/editor-components/toggle-button-control';

const EmptyPlaceholder = () => (
	<Placeholder
		icon={ <Icon srcElement={ list } /> }
		label={ __(
			'Product Categories List',
			'woocommerce'
		) }
		className="wc-block-product-categories"
	>
		{ __(
			"This block shows product categories for your store. To use it, you'll first need to create a product and assign it to a category.",
			'woocommerce'
		) }
	</Placeholder>
);

/**
 * Component displaying the categories as dropdown or list.
 *
 * @param {Object} props Incoming props for the component.
 * @param {Object} props.attributes Incoming block attributes.
 * @param {function(any):any} props.setAttributes Setter for block attributes.
 * @param {string} props.name Name for block.
 */
const ProductCategoriesBlock = ( { attributes, setAttributes, name } ) => {
	const getInspectorControls = () => {
		const {
			hasCount,
			hasImage,
			hasEmpty,
			isDropdown,
			isHierarchical,
		} = attributes;

		return (
			<InspectorControls key="inspector">
				<PanelBody
					title={ __(
						'List Settings',
						'woocommerce'
					) }
					initialOpen
				>
					<ToggleButtonControl
						label={ __(
							'Display style',
							'woocommerce'
						) }
						value={ isDropdown ? 'dropdown' : 'list' }
						options={ [
							{
								label: __(
									'List',
									'woocommerce'
								),
								value: 'list',
							},
							{
								label: __(
									'Dropdown',
									'woocommerce'
								),
								value: 'dropdown',
							},
						] }
						onChange={ ( value ) =>
							setAttributes( {
								isDropdown: value === 'dropdown',
							} )
						}
					/>
				</PanelBody>
				<PanelBody
					title={ __( 'Content', 'woocommerce' ) }
					initialOpen
				>
					<ToggleControl
						label={ __(
							'Show product count',
							'woocommerce'
						) }
						help={
							hasCount
								? __(
										'Product count is visible.',
										'woocommerce'
								  )
								: __(
										'Product count is hidden.',
										'woocommerce'
								  )
						}
						checked={ hasCount }
						onChange={ () =>
							setAttributes( { hasCount: ! hasCount } )
						}
					/>
					{ ! isDropdown && (
						<ToggleControl
							label={ __(
								'Show category images',
								'woocommerce'
							) }
							help={
								hasImage
									? __(
											'Category images are visible.',
											'woocommerce'
									  )
									: __(
											'Category images are hidden.',
											'woocommerce'
									  )
							}
							checked={ hasImage }
							onChange={ () =>
								setAttributes( { hasImage: ! hasImage } )
							}
						/>
					) }
					<ToggleControl
						label={ __(
							'Show hierarchy',
							'woocommerce'
						) }
						help={
							isHierarchical
								? __(
										'Hierarchy is visible.',
										'woocommerce'
								  )
								: __(
										'Hierarchy is hidden.',
										'woocommerce'
								  )
						}
						checked={ isHierarchical }
						onChange={ () =>
							setAttributes( {
								isHierarchical: ! isHierarchical,
							} )
						}
					/>
					<ToggleControl
						label={ __(
							'Show empty categories',
							'woocommerce'
						) }
						help={
							hasEmpty
								? __(
										'Empty categories are visible.',
										'woocommerce'
								  )
								: __(
										'Empty categories are hidden.',
										'woocommerce'
								  )
						}
						checked={ hasEmpty }
						onChange={ () =>
							setAttributes( { hasEmpty: ! hasEmpty } )
						}
					/>
				</PanelBody>
			</InspectorControls>
		);
	};

	return (
		<>
			{ getInspectorControls() }
			<Disabled>
				<ServerSideRender
					block={ name }
					attributes={ attributes }
					EmptyResponsePlaceholder={ EmptyPlaceholder }
				/>
			</Disabled>
		</>
	);
};

ProductCategoriesBlock.propTypes = {
	/**
	 * The attributes for this block
	 */
	attributes: PropTypes.object.isRequired,
	/**
	 * The register block name.
	 */
	name: PropTypes.string.isRequired,
	/**
	 * A callback to update attributes
	 */
	setAttributes: PropTypes.func.isRequired,
};

export default ProductCategoriesBlock;
woocommerce-blocks/assets/js/blocks/product-categories/style.scss000064400000002747151335517640021415 0ustar00.wc-block-product-categories {
	margin-bottom: 1em;

	&.is-dropdown {
		display: flex;
	}

	select {
		margin-right: 0.5em;
	}
}

.wc-block-product-categories-list--has-images {
	list-style: none outside;

	.wc-block-product-categories-list-item {
		margin: 4px 0 4px 60px;
		list-style: none outside;
		clear: both;

		ul {
			margin: 4px 0 0;
		}
	}

	.wc-block-product-categories-list-item__image {
		max-width: 50px;
		display: inline-block;
		position: relative;
		padding: 0;
		margin: 0;
		margin-right: 0.5em;
		margin-left: -60px;
		position: relative;
		vertical-align: middle;
		border: 1px solid #eee;

		img {
			display: block;
			height: auto;
			margin: 0;
			max-width: 100%;
			padding: 0;
		}
	}
}

.wc-block-product-categories-list-item-count::before {
	content: " (";
}

.wc-block-product-categories-list-item-count::after {
	content: ")";
}

.wp-block-woocommerce-product-categories.is-loading .wc-block-product-categories__placeholder {
	display: inline-block;
	height: 1em;
	width: 50%;
	min-width: 200px;
	background: currentColor;
	opacity: 0.2;
}

.wc-block-product-categories__button {
	display: flex;
	align-items: center;
	margin: 0;
	padding: 0 0.5em;
	position: relative;
	overflow: hidden;

	svg {
		fill: currentColor;
		outline: none;
		.rtl & {
			transform: rotate(180deg);
		}
	}
	&:active {
		color: currentColor;
	}
	&:disabled,
	&[aria-disabled="true"] {
		cursor: default;
		opacity: 0.3;
	}
	&[aria-disabled="true"]:focus,
	&:disabled:focus {
		box-shadow: none;
	}
}
woocommerce-blocks/assets/js/blocks/product-categories/index.js000064400000010052151335517640021011 0ustar00/**
 * External dependencies
 */
import { __ } from '@wordpress/i18n';
import { createBlock, registerBlockType } from '@wordpress/blocks';
import { Icon, list } from '@woocommerce/icons';

/**
 * Internal dependencies
 */
import './editor.scss';
import './style.scss';
import Block from './block.js';

registerBlockType( 'woocommerce/product-categories', {
	title: __( 'Product Categories List', 'woocommerce' ),
	icon: {
		src: <Icon srcElement={ list } />,
		foreground: '#96588a',
	},
	category: 'woocommerce',
	keywords: [ __( 'WooCommerce', 'woocommerce' ) ],
	description: __(
		'Show all product categories as a list or dropdown.',
		'woocommerce'
	),
	supports: {
		align: [ 'wide', 'full' ],
		html: false,
	},
	example: {
		attributes: {
			hasCount: true,
			hasImage: false,
		},
	},
	attributes: {
		/**
		 * Alignment of the block.
		 */
		align: {
			type: 'string',
		},

		/**
		 * Whether to show the product count in each category.
		 */
		hasCount: {
			type: 'boolean',
			default: true,
		},

		/**
		 * Whether to show the category image in each category.
		 */
		hasImage: {
			type: 'boolean',
			default: false,
		},

		/**
		 * Whether to show empty categories in the list.
		 */
		hasEmpty: {
			type: 'boolean',
			default: false,
		},

		/**
		 * Whether to display product categories as a dropdown (true) or list (false).
		 */
		isDropdown: {
			type: 'boolean',
			default: false,
		},

		/**
		 * Whether the product categories should display with hierarchy.
		 */
		isHierarchical: {
			type: 'boolean',
			default: true,
		},
	},

	transforms: {
		from: [
			{
				type: 'block',
				blocks: [ 'core/legacy-widget' ],
				// We can't transform if raw instance isn't shown in the REST API.
				isMatch: ( { idBase, instance } ) =>
					idBase === 'woocommerce_product_categories' &&
					!! instance?.raw,
				transform: ( { instance } ) =>
					createBlock( 'woocommerce/product-categories', {
						hasCount: !! instance.raw.count,
						hasEmpty: ! instance.raw.hide_empty,
						isDropdown: !! instance.raw.dropdown,
						isHierarchical: !! instance.raw.hierarchical,
					} ),
			},
		],
	},

	deprecated: [
		{
			// Deprecate HTML save method in favor of dynamic rendering.
			attributes: {
				hasCount: {
					type: 'boolean',
					default: true,
					source: 'attribute',
					selector: 'div',
					attribute: 'data-has-count',
				},
				hasEmpty: {
					type: 'boolean',
					default: false,
					source: 'attribute',
					selector: 'div',
					attribute: 'data-has-empty',
				},
				isDropdown: {
					type: 'boolean',
					default: false,
					source: 'attribute',
					selector: 'div',
					attribute: 'data-is-dropdown',
				},
				isHierarchical: {
					type: 'boolean',
					default: true,
					source: 'attribute',
					selector: 'div',
					attribute: 'data-is-hierarchical',
				},
			},
			migrate( attributes ) {
				return attributes;
			},
			save( props ) {
				const {
					hasCount,
					hasEmpty,
					isDropdown,
					isHierarchical,
				} = props.attributes;
				const data = {};
				if ( hasCount ) {
					data[ 'data-has-count' ] = true;
				}
				if ( hasEmpty ) {
					data[ 'data-has-empty' ] = true;
				}
				if ( isDropdown ) {
					data[ 'data-is-dropdown' ] = true;
				}
				if ( isHierarchical ) {
					data[ 'data-is-hierarchical' ] = true;
				}
				return (
					<div className="is-loading" { ...data }>
						{ isDropdown ? (
							<span
								aria-hidden
								className="wc-block-product-categories__placeholder"
							/>
						) : (
							<ul aria-hidden>
								<li>
									<span className="wc-block-product-categories__placeholder" />
								</li>
								<li>
									<span className="wc-block-product-categories__placeholder" />
								</li>
								<li>
									<span className="wc-block-product-categories__placeholder" />
								</li>
							</ul>
						) }
					</div>
				);
			},
		},
	],

	/**
	 * Renders and manages the block.
	 *
	 * @param {Object} props Props to pass to block.
	 */
	edit( props ) {
		return <Block { ...props } />;
	},

	/**
	 * Save nothing; rendered by server.
	 */
	save() {
		return null;
	},
} );
woocommerce-blocks/assets/js/blocks/product-categories/editor.scss000064400000000311151335517640021524 0ustar00.wc-block-product-categories.wc-block-product-categories ul {
	margin-left: 20px;
}
.wc-block-product-categories {
	.components-placeholder__label svg {
		margin-right: 1ch;
		fill: currentColor;
	}
}
woocommerce-blocks/assets/js/blocks/product-search/editor.scss000064400000000303151335517640020645 0ustar00.wc-block-product-search__field.input-control {
	color: #828b96 !important;
}
.wc-block-product-search {
	.wc-block-product-search__fields {
		.block-editor-rich-text {
			flex-grow: 1;
		}
	}
}
woocommerce-blocks/assets/js/blocks/product-search/block.js000064400000004207151335517640020121 0ustar00/**
 * External dependencies
 */
import { __ } from '@wordpress/i18n';
import classnames from 'classnames';
import PropTypes from 'prop-types';
import { HOME_URL } from '@woocommerce/settings';

/**
 * Internal dependencies
 */
import './editor.scss';
import './style.scss';

/**
 * Component displaying a product search form.
 *
 * @param {Object} props Incoming props for the component.
 * @param {Object} props.attributes Incoming block attributes.
 * @param {string} props.attributes.label
 * @param {string} props.attributes.placeholder
 * @param {string} props.attributes.formId
 * @param {string} props.attributes.className
 * @param {boolean} props.attributes.hasLabel
 * @param {string} props.attributes.align
 */
const ProductSearchBlock = ( {
	attributes: { label, placeholder, formId, className, hasLabel, align },
} ) => {
	const classes = classnames(
		'wc-block-product-search',
		align ? 'align' + align : '',
		className
	);

	return (
		<div className={ classes }>
			<form role="search" method="get" action={ HOME_URL }>
				<label
					htmlFor={ formId }
					className={
						hasLabel
							? 'wc-block-product-search__label'
							: 'wc-block-product-search__label screen-reader-text'
					}
				>
					{ label }
				</label>
				<div className="wc-block-product-search__fields">
					<input
						type="search"
						id={ formId }
						className="wc-block-product-search__field"
						placeholder={ placeholder }
						name="s"
					/>
					<input type="hidden" name="post_type" value="product" />
					<button
						type="submit"
						className="wc-block-product-search__button"
						label={ __( 'Search', 'woocommerce' ) }
					>
						<svg
							aria-hidden="true"
							role="img"
							focusable="false"
							className="dashicon dashicons-arrow-right-alt2"
							xmlns="http://www.w3.org/2000/svg"
							width="20"
							height="20"
							viewBox="0 0 20 20"
						>
							<path d="M6 15l5-5-5-5 1-2 7 7-7 7z" />
						</svg>
					</button>
				</div>
			</form>
		</div>
	);
};

ProductSearchBlock.propTypes = {
	/**
	 * The attributes for this block.
	 */
	attributes: PropTypes.object.isRequired,
};

export default ProductSearchBlock;
woocommerce-blocks/assets/js/blocks/product-search/style.scss000064400000001230151335517640020517 0ustar00.wc-block-product-search {
	.wc-block-product-search__fields {
		display: flex;
	}
	.wc-block-product-search__field {
		padding: 6px 8px;
		line-height: 1.8;
		flex-grow: 1;
	}
	.wc-block-product-search__button {
		display: flex;
		align-items: center;
		margin: 0 0 0 6px;
		cursor: pointer;
		padding: 0 0.5em;
		position: relative;
		overflow: hidden;
		svg {
			fill: currentColor;
			outline: none;
			.rtl & {
				transform: rotate(180deg);
			}
		}
		&:active {
			color: currentColor;
		}
		&:disabled,
		&[aria-disabled="true"] {
			cursor: default;
			opacity: 0.3;
		}
		&[aria-disabled="true"]:focus,
		&:disabled:focus {
			box-shadow: none;
		}
	}
}
woocommerce-blocks/assets/js/blocks/product-search/index.js000064400000003617151335517640020142 0ustar00/**
 * External dependencies
 */
import { __ } from '@wordpress/i18n';
import { createBlock, registerBlockType } from '@wordpress/blocks';
import { Icon, search } from '@woocommerce/icons';
/**
 * Internal dependencies
 */
import './style.scss';
import './editor.scss';
import Block from './block.js';
import edit from './edit.js';

const attributes = {
	/**
	 * Whether to show the field label.
	 */
	hasLabel: {
		type: 'boolean',
		default: true,
	},

	/**
	 * Search field label.
	 */
	label: {
		type: 'string',
		default: __( 'Search', 'woocommerce' ),
	},

	/**
	 * Search field placeholder.
	 */
	placeholder: {
		type: 'string',
		default: __( 'Search products…', 'woocommerce' ),
	},

	/**
	 * Store the instance ID.
	 */
	formId: {
		type: 'string',
		default: '',
	},
};

registerBlockType( 'woocommerce/product-search', {
	title: __( 'Product Search', 'woocommerce' ),
	icon: {
		src: <Icon srcElement={ search } />,
		foreground: '#96588a',
	},
	category: 'woocommerce',
	keywords: [ __( 'WooCommerce', 'woocommerce' ) ],
	description: __(
		'A search box to allow customers to search for products by keyword.',
		'woocommerce'
	),
	supports: {
		align: [ 'wide', 'full' ],
	},
	example: {
		attributes: {
			hasLabel: true,
		},
	},
	attributes,
	transforms: {
		from: [
			{
				type: 'block',
				blocks: [ 'core/legacy-widget' ],
				// We can't transform if raw instance isn't shown in the REST API.
				isMatch: ( { idBase, instance } ) =>
					idBase === 'woocommerce_product_search' && !! instance?.raw,
				transform: ( { instance } ) =>
					createBlock( 'woocommerce/product-search', {
						label:
							instance.raw.title === ''
								? __( 'Search', 'woocommerce' )
								: instance.raw.title,
					} ),
			},
		],
	},
	deprecated: [
		{
			attributes,
			save( props ) {
				return (
					<div>
						<Block { ...props } />
					</div>
				);
			},
		},
	],
	edit,
	save() {
		return null;
	},
} );
woocommerce-blocks/assets/js/blocks/product-search/edit.js000064400000006701151335517640017755 0ustar00/**
 * External dependencies
 */
import { __ } from '@wordpress/i18n';
import classnames from 'classnames';
import PropTypes from 'prop-types';
import { InspectorControls, PlainText } from '@wordpress/block-editor';
import { PanelBody, ToggleControl, TextControl } from '@wordpress/components';
import { withInstanceId } from '@wordpress/compose';
import { useEffect } from '@wordpress/element';

/**
 * Internal dependencies
 */
import './editor.scss';
import './style.scss';

/**
 * Component displaying a product search form.
 *
 * @param {Object} props Incoming props for the component.
 * @param {Object} props.attributes Incoming block attributes.
 * @param {string} props.attributes.label
 * @param {string} props.attributes.placeholder
 * @param {string} props.attributes.formId
 * @param {string} props.attributes.className
 * @param {boolean} props.attributes.hasLabel
 * @param {string} props.attributes.align
 * @param {string} props.instanceId
 * @param {function(any):any} props.setAttributes Setter for block attributes.
 */
const Edit = ( {
	attributes: { label, placeholder, formId, className, hasLabel, align },
	instanceId,
	setAttributes,
} ) => {
	const classes = classnames(
		'wc-block-product-search',
		align ? 'align' + align : '',
		className
	);

	useEffect( () => {
		if ( ! formId ) {
			setAttributes( {
				formId: `wc-block-product-search-${ instanceId }`,
			} );
		}
	}, [ formId, setAttributes, instanceId ] );

	return (
		<>
			<InspectorControls key="inspector">
				<PanelBody
					title={ __( 'Content', 'woocommerce' ) }
					initialOpen
				>
					<ToggleControl
						label={ __(
							'Show search field label',
							'woocommerce'
						) }
						help={
							hasLabel
								? __(
										'Label is visible.',
										'woocommerce'
								  )
								: __(
										'Label is hidden.',
										'woocommerce'
								  )
						}
						checked={ hasLabel }
						onChange={ () =>
							setAttributes( { hasLabel: ! hasLabel } )
						}
					/>
				</PanelBody>
			</InspectorControls>
			<div className={ classes }>
				{ !! hasLabel && (
					<PlainText
						className="wc-block-product-search__label"
						value={ label }
						onChange={ ( value ) =>
							setAttributes( { label: value } )
						}
					/>
				) }
				<div className="wc-block-product-search__fields">
					<TextControl
						className="wc-block-product-search__field input-control"
						value={ placeholder }
						onChange={ ( value ) =>
							setAttributes( { placeholder: value } )
						}
					/>
					<button
						type="submit"
						className="wc-block-product-search__button"
						label={ __( 'Search', 'woocommerce' ) }
						onClick={ ( e ) => e.preventDefault() }
						tabIndex="-1"
					>
						<svg
							aria-hidden="true"
							role="img"
							focusable="false"
							className="dashicon dashicons-arrow-right-alt2"
							xmlns="http://www.w3.org/2000/svg"
							width="20"
							height="20"
							viewBox="0 0 20 20"
						>
							<path d="M6 15l5-5-5-5 1-2 7 7-7 7z" />
						</svg>
					</button>
				</div>
			</div>
		</>
	);
};

Edit.propTypes = {
	/**
	 * The attributes for this block.
	 */
	attributes: PropTypes.object.isRequired,
	/**
	 * A unique ID for identifying the label for the select dropdown.
	 */
	instanceId: PropTypes.number,
	/**
	 * Whether it's in the editor or frontend display.
	 */
	isEditor: PropTypes.bool,
	/**
	 * A callback to update attributes.
	 */
	setAttributes: PropTypes.func,
};

export default withInstanceId( Edit );
woocommerce-blocks/assets/js/blocks/handpicked-products/block.js000064400000011566151335517640021137 0ustar00/**
 * External dependencies
 */
import { __ } from '@wordpress/i18n';
import { BlockControls, InspectorControls } from '@wordpress/block-editor';
import ServerSideRender from '@wordpress/server-side-render';
import {
	Button,
	Disabled,
	PanelBody,
	Placeholder,
	RangeControl,
	ToolbarGroup,
	withSpokenMessages,
	ToggleControl,
} from '@wordpress/components';
import { Component } from '@wordpress/element';
import PropTypes from 'prop-types';
import { getSetting } from '@woocommerce/settings';
import GridContentControl from '@woocommerce/editor-components/grid-content-control';
import ProductsControl from '@woocommerce/editor-components/products-control';
import ProductOrderbyControl from '@woocommerce/editor-components/product-orderby-control';
import { gridBlockPreview } from '@woocommerce/resource-previews';
import { Icon, widgets } from '@woocommerce/icons';

/**
 * Component to handle edit mode of "Hand-picked Products".
 */
class ProductsBlock extends Component {
	getInspectorControls() {
		const { attributes, setAttributes } = this.props;
		const {
			columns,
			contentVisibility,
			orderby,
			alignButtons,
		} = attributes;

		return (
			<InspectorControls key="inspector">
				<PanelBody
					title={ __( 'Layout', 'woocommerce' ) }
					initialOpen
				>
					<RangeControl
						label={ __(
							'Columns',
							'woocommerce'
						) }
						value={ columns }
						onChange={ ( value ) =>
							setAttributes( { columns: value } )
						}
						min={ getSetting( 'min_columns', 1 ) }
						max={ getSetting( 'max_columns', 6 ) }
					/>
					<ToggleControl
						label={ __(
							'Align Buttons',
							'woocommerce'
						) }
						help={
							alignButtons
								? __(
										'Buttons are aligned vertically.',
										'woocommerce'
								  )
								: __(
										'Buttons follow content.',
										'woocommerce'
								  )
						}
						checked={ alignButtons }
						onChange={ () =>
							setAttributes( { alignButtons: ! alignButtons } )
						}
					/>
				</PanelBody>
				<PanelBody
					title={ __( 'Content', 'woocommerce' ) }
					initialOpen
				>
					<GridContentControl
						settings={ contentVisibility }
						onChange={ ( value ) =>
							setAttributes( { contentVisibility: value } )
						}
					/>
				</PanelBody>
				<PanelBody
					title={ __( 'Order By', 'woocommerce' ) }
					initialOpen={ false }
				>
					<ProductOrderbyControl
						setAttributes={ setAttributes }
						value={ orderby }
					/>
				</PanelBody>
				<PanelBody
					title={ __( 'Products', 'woocommerce' ) }
					initialOpen={ false }
				>
					<ProductsControl
						selected={ attributes.products }
						onChange={ ( value = [] ) => {
							const ids = value.map( ( { id } ) => id );
							setAttributes( { products: ids } );
						} }
						isCompact={ true }
					/>
				</PanelBody>
			</InspectorControls>
		);
	}

	renderEditMode() {
		const { attributes, debouncedSpeak, setAttributes } = this.props;
		const onDone = () => {
			setAttributes( { editMode: false } );
			debouncedSpeak(
				__(
					'Showing Hand-picked Products block preview.',
					'woocommerce'
				)
			);
		};

		return (
			<Placeholder
				icon={ <Icon srcElement={ widgets } /> }
				label={ __(
					'Hand-picked Products',
					'woocommerce'
				) }
				className="wc-block-products-grid wc-block-handpicked-products"
			>
				{ __(
					'Display a selection of hand-picked products in a grid.',
					'woocommerce'
				) }
				<div className="wc-block-handpicked-products__selection">
					<ProductsControl
						selected={ attributes.products }
						onChange={ ( value = [] ) => {
							const ids = value.map( ( { id } ) => id );
							setAttributes( { products: ids } );
						} }
					/>
					<Button isPrimary onClick={ onDone }>
						{ __( 'Done', 'woocommerce' ) }
					</Button>
				</div>
			</Placeholder>
		);
	}

	render() {
		const { attributes, name, setAttributes } = this.props;
		const { editMode } = attributes;

		if ( attributes.isPreview ) {
			return gridBlockPreview;
		}

		return (
			<>
				<BlockControls>
					<ToolbarGroup
						controls={ [
							{
								icon: 'edit',
								title: __( 'Edit' ),
								onClick: () =>
									setAttributes( { editMode: ! editMode } ),
								isActive: editMode,
							},
						] }
					/>
				</BlockControls>
				{ this.getInspectorControls() }
				{ editMode ? (
					this.renderEditMode()
				) : (
					<Disabled>
						<ServerSideRender
							block={ name }
							attributes={ attributes }
						/>
					</Disabled>
				) }
			</>
		);
	}
}

ProductsBlock.propTypes = {
	/**
	 * The attributes for this block
	 */
	attributes: PropTypes.object.isRequired,
	/**
	 * The register block name.
	 */
	name: PropTypes.string.isRequired,
	/**
	 * A callback to update attributes
	 */
	setAttributes: PropTypes.func.isRequired,
	// from withSpokenMessages
	debouncedSpeak: PropTypes.func.isRequired,
};

export default withSpokenMessages( ProductsBlock );
woocommerce-blocks/assets/js/blocks/handpicked-products/editor.scss000064400000000073151335517640021661 0ustar00.wc-block-handpicked-products__selection {
	width: 100%;
}
woocommerce-blocks/assets/js/blocks/handpicked-products/index.js000064400000003762151335517640021153 0ustar00/**
 * External dependencies
 */
import { __ } from '@wordpress/i18n';
import { registerBlockType } from '@wordpress/blocks';
import { getSetting } from '@woocommerce/settings';
import { Icon, widgets } from '@woocommerce/icons';

/**
 * Internal dependencies
 */
import './editor.scss';
import Block from './block';

registerBlockType( 'woocommerce/handpicked-products', {
	title: __( 'Hand-picked Products', 'woocommerce' ),
	icon: {
		src: <Icon srcElement={ widgets } />,
		foreground: '#96588a',
	},
	category: 'woocommerce',
	keywords: [
		__( 'Handpicked Products', 'woocommerce' ),
		__( 'WooCommerce', 'woocommerce' ),
	],
	description: __(
		'Display a selection of hand-picked products in a grid.',
		'woocommerce'
	),
	supports: {
		align: [ 'wide', 'full' ],
		html: false,
	},
	example: {
		attributes: {
			isPreview: true,
		},
	},
	attributes: {
		/**
		 * Alignment of product grid
		 */
		align: {
			type: 'string',
		},

		/**
		 * Number of columns.
		 */
		columns: {
			type: 'number',
			default: getSetting( 'default_columns', 3 ),
		},

		/**
		 * Toggle for edit mode in the block preview.
		 */
		editMode: {
			type: 'boolean',
			default: true,
		},

		/**
		 * Content visibility setting
		 */
		contentVisibility: {
			type: 'object',
			default: {
				title: true,
				price: true,
				rating: true,
				button: true,
			},
		},

		/**
		 * How to order the products: 'date', 'popularity', 'price_asc', 'price_desc' 'rating', 'title'.
		 */
		orderby: {
			type: 'string',
			default: 'date',
		},

		/**
		 * The list of product IDs to display
		 */
		products: {
			type: 'array',
			default: [],
		},

		/**
		 * How to align cart buttons.
		 */
		alignButtons: {
			type: 'boolean',
			default: false,
		},

		/**
		 * Are we previewing?
		 */
		isPreview: {
			type: 'boolean',
			default: false,
		},
	},

	/**
	 * Renders and manages the block.
	 *
	 * @param {Object} props Props to pass to block.
	 */
	edit( props ) {
		return <Block { ...props } />;
	},

	save() {
		return null;
	},
} );
woocommerce-blocks/assets/js/blocks/product-category/index.js000064400000003346151335517640020511 0ustar00/**
 * External dependencies
 */
import { __ } from '@wordpress/i18n';
import { createBlock, registerBlockType } from '@wordpress/blocks';
import { without } from 'lodash';
import { Icon, folder } from '@woocommerce/icons';

/**
 * Internal dependencies
 */
import './editor.scss';
import Block from './block';
import sharedAttributes, {
	sharedAttributeBlockTypes,
} from '../../utils/shared-attributes';

/**
 * Register and run the "Products by Category" block.
 */
registerBlockType( 'woocommerce/product-category', {
	title: __( 'Products by Category', 'woocommerce' ),
	icon: {
		src: <Icon srcElement={ folder } />,
		foreground: '#96588a',
	},
	category: 'woocommerce',
	keywords: [ __( 'WooCommerce', 'woocommerce' ) ],
	description: __(
		'Display a grid of products from your selected categories.',
		'woocommerce'
	),
	supports: {
		align: [ 'wide', 'full' ],
		html: false,
	},
	example: {
		attributes: {
			isPreview: true,
		},
	},
	attributes: {
		...sharedAttributes,

		/**
		 * Toggle for edit mode in the block preview.
		 */
		editMode: {
			type: 'boolean',
			default: true,
		},

		/**
		 * How to order the products: 'date', 'popularity', 'price_asc', 'price_desc' 'rating', 'title'.
		 */
		orderby: {
			type: 'string',
			default: 'date',
		},
	},

	transforms: {
		from: [
			{
				type: 'block',
				blocks: without(
					sharedAttributeBlockTypes,
					'woocommerce/product-category'
				),
				transform: ( attributes ) =>
					createBlock( 'woocommerce/product-category', {
						...attributes,
						editMode: false,
					} ),
			},
		],
	},

	/**
	 * Renders and manages the block.
	 *
	 * @param {Object} props Props to pass to block.
	 */
	edit( props ) {
		return <Block { ...props } />;
	},

	save() {
		return null;
	},
} );
woocommerce-blocks/assets/js/blocks/product-category/block.js000064400000016440151335517640020473 0ustar00/**
 * External dependencies
 */
import { __ } from '@wordpress/i18n';
import { BlockControls, InspectorControls } from '@wordpress/block-editor';
import ServerSideRender from '@wordpress/server-side-render';
import {
	Button,
	Disabled,
	PanelBody,
	Placeholder,
	ToolbarGroup,
	withSpokenMessages,
} from '@wordpress/components';
import { Component } from '@wordpress/element';
import PropTypes from 'prop-types';
import GridContentControl from '@woocommerce/editor-components/grid-content-control';
import GridLayoutControl from '@woocommerce/editor-components/grid-layout-control';
import ProductCategoryControl from '@woocommerce/editor-components/product-category-control';
import ProductOrderbyControl from '@woocommerce/editor-components/product-orderby-control';
import { gridBlockPreview } from '@woocommerce/resource-previews';
import { Icon, folder } from '@woocommerce/icons';
import { getSetting } from '@woocommerce/settings';

const EmptyPlaceholder = () => (
	<Placeholder
		icon={ <Icon srcElement={ folder } /> }
		label={ __( 'Products by Category', 'woocommerce' ) }
		className="wc-block-products-grid wc-block-products-category"
	>
		{ __(
			'No products were found that matched your selection.',
			'woocommerce'
		) }
	</Placeholder>
);

/**
 * Component to handle edit mode of "Products by Category".
 */
class ProductByCategoryBlock extends Component {
	static propTypes = {
		/**
		 * The attributes for this block
		 */
		attributes: PropTypes.object.isRequired,
		/**
		 * The register block name.
		 */
		name: PropTypes.string.isRequired,
		/**
		 * A callback to update attributes
		 */
		setAttributes: PropTypes.func.isRequired,

		// from withSpokenMessages
		debouncedSpeak: PropTypes.func.isRequired,
	};

	state = {
		changedAttributes: {},
		isEditing: false,
	};

	componentDidMount() {
		const { attributes } = this.props;

		if ( ! attributes.categories.length ) {
			// We've removed all selected categories, or no categories have been selected yet.
			this.setState( { isEditing: true } );
		}
	}

	startEditing = () => {
		this.setState( {
			isEditing: true,
			changedAttributes: {},
		} );
	};

	stopEditing = () => {
		this.setState( {
			isEditing: false,
			changedAttributes: {},
		} );
	};

	/**
	 * Set changed attributes to state.
	 *
	 * @param {Object} attributes List of attributes to set.
	 */
	setChangedAttributes = ( attributes ) => {
		this.setState( ( prevState ) => {
			return {
				changedAttributes: {
					...prevState.changedAttributes,
					...attributes,
				},
			};
		} );
	};

	save = () => {
		const { changedAttributes } = this.state;
		const { setAttributes } = this.props;

		setAttributes( changedAttributes );
		this.stopEditing();
	};

	getInspectorControls() {
		const { attributes, setAttributes } = this.props;
		const { isEditing } = this.state;
		const {
			columns,
			catOperator,
			contentVisibility,
			orderby,
			rows,
			alignButtons,
		} = attributes;

		return (
			<InspectorControls key="inspector">
				<PanelBody
					title={ __(
						'Product Category',
						'woocommerce'
					) }
					initialOpen={
						! attributes.categories.length && ! isEditing
					}
				>
					<ProductCategoryControl
						selected={ attributes.categories }
						onChange={ ( value = [] ) => {
							const ids = value.map( ( { id } ) => id );
							const changes = { categories: ids };

							// Changes in the sidebar save instantly and overwrite any unsaved changes.
							setAttributes( changes );
							this.setChangedAttributes( changes );
						} }
						operator={ catOperator }
						onOperatorChange={ ( value = 'any' ) => {
							const changes = { catOperator: value };
							setAttributes( changes );
							this.setChangedAttributes( changes );
						} }
						isCompact={ true }
					/>
				</PanelBody>
				<PanelBody
					title={ __( 'Layout', 'woocommerce' ) }
					initialOpen
				>
					<GridLayoutControl
						columns={ columns }
						rows={ rows }
						alignButtons={ alignButtons }
						setAttributes={ setAttributes }
						minColumns={ getSetting( 'min_columns', 1 ) }
						maxColumns={ getSetting( 'max_columns', 6 ) }
						minRows={ getSetting( 'min_rows', 1 ) }
						maxRows={ getSetting( 'max_rows', 6 ) }
					/>
				</PanelBody>
				<PanelBody
					title={ __( 'Content', 'woocommerce' ) }
					initialOpen
				>
					<GridContentControl
						settings={ contentVisibility }
						onChange={ ( value ) =>
							setAttributes( { contentVisibility: value } )
						}
					/>
				</PanelBody>
				<PanelBody
					title={ __( 'Order By', 'woocommerce' ) }
					initialOpen={ false }
				>
					<ProductOrderbyControl
						setAttributes={ setAttributes }
						value={ orderby }
					/>
				</PanelBody>
			</InspectorControls>
		);
	}

	renderEditMode() {
		const { attributes, debouncedSpeak } = this.props;
		const { changedAttributes } = this.state;
		const currentAttributes = { ...attributes, ...changedAttributes };
		const onDone = () => {
			this.save();
			debouncedSpeak(
				__(
					'Showing Products by Category block preview.',
					'woocommerce'
				)
			);
		};
		const onCancel = () => {
			this.stopEditing();
			debouncedSpeak(
				__(
					'Showing Products by Category block preview.',
					'woocommerce'
				)
			);
		};

		return (
			<Placeholder
				icon={ <Icon srcElement={ folder } /> }
				label={ __(
					'Products by Category',
					'woocommerce'
				) }
				className="wc-block-products-grid wc-block-products-category"
			>
				{ __(
					'Display a grid of products from your selected categories.',
					'woocommerce'
				) }
				<div className="wc-block-products-category__selection">
					<ProductCategoryControl
						selected={ currentAttributes.categories }
						onChange={ ( value = [] ) => {
							const ids = value.map( ( { id } ) => id );
							this.setChangedAttributes( { categories: ids } );
						} }
						operator={ currentAttributes.catOperator }
						onOperatorChange={ ( value = 'any' ) =>
							this.setChangedAttributes( { catOperator: value } )
						}
					/>
					<Button isPrimary onClick={ onDone }>
						{ __( 'Done', 'woocommerce' ) }
					</Button>
					<Button
						className="wc-block-products-category__cancel-button"
						isTertiary
						onClick={ onCancel }
					>
						{ __( 'Cancel', 'woocommerce' ) }
					</Button>
				</div>
			</Placeholder>
		);
	}

	renderViewMode() {
		const { attributes, name } = this.props;
		const hasCategories = attributes.categories.length;

		return (
			<Disabled>
				{ hasCategories ? (
					<ServerSideRender
						block={ name }
						attributes={ attributes }
						EmptyResponsePlaceholder={ EmptyPlaceholder }
					/>
				) : (
					__(
						'Select at least one category to display its products.',
						'woocommerce'
					)
				) }
			</Disabled>
		);
	}

	render() {
		const { isEditing } = this.state;
		const { attributes } = this.props;

		if ( attributes.isPreview ) {
			return gridBlockPreview;
		}

		return (
			<>
				<BlockControls>
					<ToolbarGroup
						controls={ [
							{
								icon: 'edit',
								title: __( 'Edit' ),
								onClick: () =>
									isEditing
										? this.stopEditing()
										: this.startEditing(),
								isActive: isEditing,
							},
						] }
					/>
				</BlockControls>
				{ this.getInspectorControls() }
				{ isEditing ? this.renderEditMode() : this.renderViewMode() }
			</>
		);
	}
}

export default withSpokenMessages( ProductByCategoryBlock );
woocommerce-blocks/assets/js/blocks/product-category/editor.scss000064400000000212151335517640021214 0ustar00.wc-block-products-category__selection {
	width: 100%;
}

.wc-block-products-category__cancel-button.is-tertiary {
	margin: 1em auto 0;
}
woocommerce-blocks/assets/js/blocks/product-on-sale/editor.scss000064400000000162151335517640020741 0ustar00.wc-block-product-on-sale {
	.components-placeholder__label svg {
		margin-right: 1ch;
		fill: currentColor;
	}
}
woocommerce-blocks/assets/js/blocks/product-on-sale/index.js000064400000002755151335517640020235 0ustar00/**
 * External dependencies
 */
import { __ } from '@wordpress/i18n';
import { createBlock, registerBlockType } from '@wordpress/blocks';
import { without } from 'lodash';
import { Icon, tag } from '@woocommerce/icons';
/**
 * Internal dependencies
 */
import Block from './block';
import './editor.scss';
import sharedAttributes, {
	sharedAttributeBlockTypes,
} from '../../utils/shared-attributes';

registerBlockType( 'woocommerce/product-on-sale', {
	title: __( 'On Sale Products', 'woocommerce' ),
	icon: {
		src: <Icon srcElement={ tag } />,
		foreground: '#96588a',
	},
	category: 'woocommerce',
	keywords: [ __( 'WooCommerce', 'woocommerce' ) ],
	description: __(
		'Display a grid of products currently on sale.',
		'woocommerce'
	),
	supports: {
		align: [ 'wide', 'full' ],
		html: false,
	},
	attributes: {
		...sharedAttributes,

		/**
		 * How to order the products: 'date', 'popularity', 'price_asc', 'price_desc' 'rating', 'title'.
		 */
		orderby: {
			type: 'string',
			default: 'date',
		},
	},
	example: {
		attributes: {
			isPreview: true,
		},
	},
	transforms: {
		from: [
			{
				type: 'block',
				blocks: without(
					sharedAttributeBlockTypes,
					'woocommerce/product-on-sale'
				),
				transform: ( attributes ) =>
					createBlock( 'woocommerce/product-on-sale', attributes ),
			},
		],
	},

	/**
	 * Renders and manages the block.
	 *
	 * @param {Object} props Props to pass to block.
	 */
	edit( props ) {
		return <Block { ...props } />;
	},

	save() {
		return null;
	},
} );
woocommerce-blocks/assets/js/blocks/product-on-sale/block.js000064400000007161151335517640020214 0ustar00/**
 * External dependencies
 */
import { __ } from '@wordpress/i18n';
import { Component } from '@wordpress/element';
import { Disabled, PanelBody, Placeholder } from '@wordpress/components';
import { InspectorControls } from '@wordpress/block-editor';
import ServerSideRender from '@wordpress/server-side-render';
import PropTypes from 'prop-types';
import GridContentControl from '@woocommerce/editor-components/grid-content-control';
import GridLayoutControl from '@woocommerce/editor-components/grid-layout-control';
import ProductCategoryControl from '@woocommerce/editor-components/product-category-control';
import ProductOrderbyControl from '@woocommerce/editor-components/product-orderby-control';
import { gridBlockPreview } from '@woocommerce/resource-previews';
import { Icon, tag } from '@woocommerce/icons';
import { getSetting } from '@woocommerce/settings';

const EmptyPlaceholder = () => (
	<Placeholder
		icon={ <Icon srcElement={ tag } /> }
		label={ __( 'On Sale Products', 'woocommerce' ) }
		className="wc-block-product-on-sale"
	>
		{ __(
			'This block shows on-sale products. There are currently no discounted products in your store.',
			'woocommerce'
		) }
	</Placeholder>
);

/**
 * Component to handle edit mode of "On Sale Products".
 */
class ProductOnSaleBlock extends Component {
	getInspectorControls() {
		const { attributes, setAttributes } = this.props;
		const {
			categories,
			catOperator,
			columns,
			contentVisibility,
			rows,
			orderby,
			alignButtons,
		} = attributes;

		return (
			<InspectorControls key="inspector">
				<PanelBody
					title={ __( 'Layout', 'woocommerce' ) }
					initialOpen
				>
					<GridLayoutControl
						columns={ columns }
						rows={ rows }
						alignButtons={ alignButtons }
						setAttributes={ setAttributes }
						minColumns={ getSetting( 'min_columns', 1 ) }
						maxColumns={ getSetting( 'max_columns', 6 ) }
						minRows={ getSetting( 'min_rows', 1 ) }
						maxRows={ getSetting( 'max_rows', 6 ) }
					/>
				</PanelBody>
				<PanelBody
					title={ __( 'Content', 'woocommerce' ) }
					initialOpen
				>
					<GridContentControl
						settings={ contentVisibility }
						onChange={ ( value ) =>
							setAttributes( { contentVisibility: value } )
						}
					/>
				</PanelBody>
				<PanelBody
					title={ __( 'Order By', 'woocommerce' ) }
					initialOpen={ false }
				>
					<ProductOrderbyControl
						setAttributes={ setAttributes }
						value={ orderby }
					/>
				</PanelBody>
				<PanelBody
					title={ __(
						'Filter by Product Category',
						'woocommerce'
					) }
					initialOpen={ false }
				>
					<ProductCategoryControl
						selected={ categories }
						onChange={ ( value = [] ) => {
							const ids = value.map( ( { id } ) => id );
							setAttributes( { categories: ids } );
						} }
						operator={ catOperator }
						onOperatorChange={ ( value = 'any' ) =>
							setAttributes( { catOperator: value } )
						}
					/>
				</PanelBody>
			</InspectorControls>
		);
	}

	render() {
		const { attributes, name } = this.props;

		if ( attributes.isPreview ) {
			return gridBlockPreview;
		}

		return (
			<>
				{ this.getInspectorControls() }
				<Disabled>
					<ServerSideRender
						block={ name }
						attributes={ attributes }
						EmptyResponsePlaceholder={ EmptyPlaceholder }
					/>
				</Disabled>
			</>
		);
	}
}

ProductOnSaleBlock.propTypes = {
	/**
	 * The attributes for this block
	 */
	attributes: PropTypes.object.isRequired,
	/**
	 * The register block name.
	 */
	name: PropTypes.string.isRequired,
	/**
	 * A callback to update attributes
	 */
	setAttributes: PropTypes.func.isRequired,
};

export default ProductOnSaleBlock;
woocommerce-blocks/assets/js/blocks/product-best-sellers/index.js000064400000002542151335517640021275 0ustar00/**
 * External dependencies
 */
import { __ } from '@wordpress/i18n';
import { without } from 'lodash';
import { Icon, stonks } from '@woocommerce/icons';
import { createBlock, registerBlockType } from '@wordpress/blocks';

/**
 * Internal dependencies
 */
import Block from './block';
import sharedAttributes, {
	sharedAttributeBlockTypes,
} from '../../utils/shared-attributes';

registerBlockType( 'woocommerce/product-best-sellers', {
	title: __( 'Best Selling Products', 'woocommerce' ),
	icon: {
		src: <Icon srcElement={ stonks } />,
		foreground: '#96588a',
	},
	category: 'woocommerce',
	keywords: [ __( 'WooCommerce', 'woocommerce' ) ],
	description: __(
		'Display a grid of your all-time best selling products.',
		'woocommerce'
	),
	supports: {
		align: [ 'wide', 'full' ],
		html: false,
	},
	example: {
		attributes: {
			isPreview: true,
		},
	},
	attributes: {
		...sharedAttributes,
	},

	transforms: {
		from: [
			{
				type: 'block',
				blocks: without(
					sharedAttributeBlockTypes,
					'woocommerce/product-best-sellers'
				),
				transform: ( attributes ) =>
					createBlock(
						'woocommerce/product-best-sellers',
						attributes
					),
			},
		],
	},

	/**
	 * Renders and manages the block.
	 *
	 * @param {Object} props Props to pass to block.
	 */
	edit( props ) {
		return <Block { ...props } />;
	},

	save() {
		return null;
	},
} );
woocommerce-blocks/assets/js/blocks/product-best-sellers/block.js000064400000005620151335517640021260 0ustar00/**
 * External dependencies
 */
import { __ } from '@wordpress/i18n';
import { Component } from '@wordpress/element';
import { Disabled, PanelBody } from '@wordpress/components';
import { InspectorControls } from '@wordpress/block-editor';
import ServerSideRender from '@wordpress/server-side-render';
import PropTypes from 'prop-types';
import GridContentControl from '@woocommerce/editor-components/grid-content-control';
import GridLayoutControl from '@woocommerce/editor-components/grid-layout-control';
import ProductCategoryControl from '@woocommerce/editor-components/product-category-control';
import { gridBlockPreview } from '@woocommerce/resource-previews';
import { getSetting } from '@woocommerce/settings';

/**
 * Component to handle edit mode of "Best Selling Products".
 */
class ProductBestSellersBlock extends Component {
	getInspectorControls() {
		const { attributes, setAttributes } = this.props;
		const {
			categories,
			catOperator,
			columns,
			contentVisibility,
			rows,
			alignButtons,
		} = attributes;

		return (
			<InspectorControls key="inspector">
				<PanelBody
					title={ __( 'Layout', 'woocommerce' ) }
					initialOpen
				>
					<GridLayoutControl
						columns={ columns }
						rows={ rows }
						alignButtons={ alignButtons }
						setAttributes={ setAttributes }
						minColumns={ getSetting( 'min_columns', 1 ) }
						maxColumns={ getSetting( 'max_columns', 6 ) }
						minRows={ getSetting( 'min_rows', 1 ) }
						maxRows={ getSetting( 'max_rows', 6 ) }
					/>
				</PanelBody>
				<PanelBody
					title={ __( 'Content', 'woocommerce' ) }
					initialOpen
				>
					<GridContentControl
						settings={ contentVisibility }
						onChange={ ( value ) =>
							setAttributes( { contentVisibility: value } )
						}
					/>
				</PanelBody>
				<PanelBody
					title={ __(
						'Filter by Product Category',
						'woocommerce'
					) }
					initialOpen={ false }
				>
					<ProductCategoryControl
						selected={ categories }
						onChange={ ( value = [] ) => {
							const ids = value.map( ( { id } ) => id );
							setAttributes( { categories: ids } );
						} }
						operator={ catOperator }
						onOperatorChange={ ( value = 'any' ) =>
							setAttributes( { catOperator: value } )
						}
					/>
				</PanelBody>
			</InspectorControls>
		);
	}

	render() {
		const { attributes, name } = this.props;

		if ( attributes.isPreview ) {
			return gridBlockPreview;
		}

		return (
			<>
				{ this.getInspectorControls() }
				<Disabled>
					<ServerSideRender
						block={ name }
						attributes={ attributes }
					/>
				</Disabled>
			</>
		);
	}
}

ProductBestSellersBlock.propTypes = {
	/**
	 * The attributes for this block
	 */
	attributes: PropTypes.object.isRequired,
	/**
	 * The register block name.
	 */
	name: PropTypes.string.isRequired,
	/**
	 * A callback to update attributes
	 */
	setAttributes: PropTypes.func.isRequired,
};

export default ProductBestSellersBlock;
woocommerce-blocks/assets/js/blocks/product-tag/block.js000064400000017044151335517640017432 0ustar00/**
 * External dependencies
 */
import { __ } from '@wordpress/i18n';
import { BlockControls, InspectorControls } from '@wordpress/block-editor';
import ServerSideRender from '@wordpress/server-side-render';
import {
	Button,
	Disabled,
	PanelBody,
	Placeholder,
	ToolbarGroup,
	withSpokenMessages,
} from '@wordpress/components';
import { Component } from '@wordpress/element';
import PropTypes from 'prop-types';
import GridContentControl from '@woocommerce/editor-components/grid-content-control';
import GridLayoutControl from '@woocommerce/editor-components/grid-layout-control';
import ProductTagControl from '@woocommerce/editor-components/product-tag-control';
import ProductOrderbyControl from '@woocommerce/editor-components/product-orderby-control';
import { Icon, more } from '@woocommerce/icons';
import { gridBlockPreview } from '@woocommerce/resource-previews';
import { getSetting } from '@woocommerce/settings';

/**
 * Component to handle edit mode of "Products by Tag".
 */
class ProductsByTagBlock extends Component {
	constructor() {
		super( ...arguments );
		this.state = {
			changedAttributes: {},
			isEditing: false,
		};

		this.startEditing = this.startEditing.bind( this );
		this.stopEditing = this.stopEditing.bind( this );
		this.setChangedAttributes = this.setChangedAttributes.bind( this );
		this.save = this.save.bind( this );
	}

	componentDidMount() {
		const { attributes } = this.props;

		if ( ! attributes.tags.length ) {
			// We've removed all selected categories, or no categories have been selected yet.
			this.setState( { isEditing: true } );
		}
	}

	startEditing() {
		this.setState( {
			isEditing: true,
			changedAttributes: {},
		} );
	}

	stopEditing() {
		this.setState( {
			isEditing: false,
			changedAttributes: {},
		} );
	}

	setChangedAttributes( attributes ) {
		this.setState( ( prevState ) => {
			return {
				changedAttributes: {
					...prevState.changedAttributes,
					...attributes,
				},
			};
		} );
	}

	save() {
		const { changedAttributes } = this.state;
		const { setAttributes } = this.props;

		setAttributes( changedAttributes );
		this.stopEditing();
	}

	getInspectorControls() {
		const { attributes, setAttributes } = this.props;
		const { isEditing } = this.state;
		const {
			columns,
			tagOperator,
			contentVisibility,
			orderby,
			rows,
			alignButtons,
		} = attributes;

		return (
			<InspectorControls key="inspector">
				<PanelBody
					title={ __(
						'Product Tag',
						'woocommerce'
					) }
					initialOpen={ ! attributes.tags.length && ! isEditing }
				>
					<ProductTagControl
						selected={ attributes.tags }
						onChange={ ( value = [] ) => {
							const ids = value.map( ( { id } ) => id );
							setAttributes( { tags: ids } );
						} }
						operator={ tagOperator }
						onOperatorChange={ ( value = 'any' ) =>
							setAttributes( { tagOperator: value } )
						}
						isCompact={ true }
					/>
				</PanelBody>
				<PanelBody
					title={ __( 'Layout', 'woocommerce' ) }
					initialOpen
				>
					<GridLayoutControl
						columns={ columns }
						rows={ rows }
						alignButtons={ alignButtons }
						setAttributes={ setAttributes }
						minColumns={ getSetting( 'min_columns', 1 ) }
						maxColumns={ getSetting( 'max_columns', 6 ) }
						minRows={ getSetting( 'min_rows', 1 ) }
						maxRows={ getSetting( 'max_rows', 6 ) }
					/>
				</PanelBody>
				<PanelBody
					title={ __( 'Content', 'woocommerce' ) }
					initialOpen
				>
					<GridContentControl
						settings={ contentVisibility }
						onChange={ ( value ) =>
							setAttributes( { contentVisibility: value } )
						}
					/>
				</PanelBody>
				<PanelBody
					title={ __( 'Order By', 'woocommerce' ) }
					initialOpen={ false }
				>
					<ProductOrderbyControl
						setAttributes={ setAttributes }
						value={ orderby }
					/>
				</PanelBody>
			</InspectorControls>
		);
	}

	renderEditMode() {
		const { attributes, debouncedSpeak } = this.props;
		const { changedAttributes } = this.state;
		const currentAttributes = { ...attributes, ...changedAttributes };
		const onDone = () => {
			this.save();
			debouncedSpeak(
				__(
					'Showing Products by Tag block preview.',
					'woocommerce'
				)
			);
		};
		const onCancel = () => {
			this.stopEditing();
			debouncedSpeak(
				__(
					'Showing Products by Tag block preview.',
					'woocommerce'
				)
			);
		};

		return (
			<Placeholder
				icon={
					<Icon
						srcElement={ more }
						className="block-editor-block-icon"
					/>
				}
				label={ __(
					'Products by Tag',
					'woocommerce'
				) }
				className="wc-block-products-grid wc-block-product-tag"
			>
				{ __(
					'Display a grid of products from your selected tags.',
					'woocommerce'
				) }
				<div className="wc-block-product-tag__selection">
					<ProductTagControl
						selected={ currentAttributes.tags }
						onChange={ ( value = [] ) => {
							const ids = value.map( ( { id } ) => id );
							this.setChangedAttributes( { tags: ids } );
						} }
						operator={ currentAttributes.tagOperator }
						onOperatorChange={ ( value = 'any' ) =>
							this.setChangedAttributes( { tagOperator: value } )
						}
					/>
					<Button isPrimary onClick={ onDone }>
						{ __( 'Done', 'woocommerce' ) }
					</Button>
					<Button
						className="wc-block-product-tag__cancel-button"
						isTertiary
						onClick={ onCancel }
					>
						{ __( 'Cancel', 'woocommerce' ) }
					</Button>
				</div>
			</Placeholder>
		);
	}

	renderViewMode() {
		const { attributes, name } = this.props;
		const selectedTags = attributes.tags.length;

		return (
			<Disabled>
				{ selectedTags ? (
					<ServerSideRender
						block={ name }
						attributes={ attributes }
					/>
				) : (
					<Placeholder
						icon={
							<Icon
								icon={ more }
								className="block-editor-block-icon"
							/>
						}
						label={ __(
							'Products by Tag',
							'woocommerce'
						) }
						className="wc-block-products-grid wc-block-product-tag"
					>
						{ __(
							'This block displays products from selected tags. Select at least one tag to display its products.',
							'woocommerce'
						) }
					</Placeholder>
				) }
			</Disabled>
		);
	}

	render() {
		const { isEditing } = this.state;
		const { attributes } = this.props;

		if ( attributes.isPreview ) {
			return gridBlockPreview;
		}

		return getSetting( 'hasTags', true ) ? (
			<>
				<BlockControls>
					<ToolbarGroup
						controls={ [
							{
								icon: 'edit',
								title: __( 'Edit' ),
								onClick: () =>
									isEditing
										? this.stopEditing()
										: this.startEditing(),
								isActive: isEditing,
							},
						] }
					/>
				</BlockControls>
				{ this.getInspectorControls() }
				{ isEditing ? this.renderEditMode() : this.renderViewMode() }
			</>
		) : (
			<Placeholder
				icon={
					<Icon icon={ more } className="block-editor-block-icon" />
				}
				label={ __(
					'Products by Tag',
					'woocommerce'
				) }
				className="wc-block-products-grid wc-block-product-tag"
			>
				{ __(
					"This block displays products from selected tags. In order to preview this you'll first need to create a product and assign it some tags.",
					'woocommerce'
				) }
			</Placeholder>
		);
	}
}

ProductsByTagBlock.propTypes = {
	/**
	 * The attributes for this block
	 */
	attributes: PropTypes.object.isRequired,
	/**
	 * The register block name.
	 */
	name: PropTypes.string.isRequired,
	/**
	 * A callback to update attributes
	 */
	setAttributes: PropTypes.func.isRequired,
	/**
	 * From withSpokenMessages
	 */
	debouncedSpeak: PropTypes.func.isRequired,
};

export default withSpokenMessages( ProductsByTagBlock );
woocommerce-blocks/assets/js/blocks/product-tag/editor.scss000064400000000176151335517640020163 0ustar00.wc-block-product-tag__selection {
	width: 100%;
}

.wc-block-product-tag__cancel-button.is-tertiary {
	margin: 1em auto 0;
}
woocommerce-blocks/assets/js/blocks/product-tag/index.js000064400000004103151335517640017437 0ustar00/**
 * External dependencies
 */
import { __ } from '@wordpress/i18n';
import { registerBlockType } from '@wordpress/blocks';
import { getSetting } from '@woocommerce/settings';
import { Icon, more } from '@woocommerce/icons';

/**
 * Internal dependencies
 */
import './editor.scss';
import Block from './block';

/**
 * Register and run the "Products by Tag" block.
 */
registerBlockType( 'woocommerce/product-tag', {
	title: __( 'Products by Tag', 'woocommerce' ),
	icon: {
		src: <Icon srcElement={ more } />,
		foreground: '#96588a',
	},
	category: 'woocommerce',
	keywords: [ __( 'WooCommerce', 'woocommerce' ) ],
	description: __(
		'Display a grid of products with selected tags.',
		'woocommerce'
	),
	supports: {
		align: [ 'wide', 'full' ],
		html: false,
	},
	example: {
		attributes: {
			isPreview: true,
		},
	},
	attributes: {
		/**
		 * Number of columns.
		 */
		columns: {
			type: 'number',
			default: getSetting( 'default_columns', 3 ),
		},

		/**
		 * Number of rows.
		 */
		rows: {
			type: 'number',
			default: getSetting( 'default_rows', 3 ),
		},

		/**
		 * How to align cart buttons.
		 */
		alignButtons: {
			type: 'boolean',
			default: false,
		},

		/**
		 * Content visibility setting
		 */
		contentVisibility: {
			type: 'object',
			default: {
				title: true,
				price: true,
				rating: true,
				button: true,
			},
		},

		/**
		 * Product tags, used to display only products with the given tags.
		 */
		tags: {
			type: 'array',
			default: [],
		},

		/**
		 * Product tags operator, used to restrict to products in all or any selected tags.
		 */
		tagOperator: {
			type: 'string',
			default: 'any',
		},

		/**
		 * How to order the products: 'date', 'popularity', 'price_asc', 'price_desc' 'rating', 'title'.
		 */
		orderby: {
			type: 'string',
			default: 'date',
		},

		/**
		 * Are we previewing?
		 */
		isPreview: {
			type: 'boolean',
			default: false,
		},
	},

	/**
	 * Renders and manages the block.
	 *
	 * @param {Object} props Props to pass to block.
	 */
	edit( props ) {
		return <Block { ...props } />;
	},

	save() {
		return null;
	},
} );
woocommerce-blocks/assets/js/blocks/active-filters/index.js000064400000002715151335517640020136 0ustar00/**
 * External dependencies
 */
import { __ } from '@wordpress/i18n';
import { registerBlockType } from '@wordpress/blocks';
import { Icon, toggle } from '@woocommerce/icons';
import classNames from 'classnames';

/**
 * Internal dependencies
 */
import edit from './edit.js';

registerBlockType( 'woocommerce/active-filters', {
	title: __( 'Active Product Filters', 'woocommerce' ),
	icon: {
		src: <Icon srcElement={ toggle } />,
		foreground: '#96588a',
	},
	category: 'woocommerce',
	keywords: [ __( 'WooCommerce', 'woocommerce' ) ],
	description: __(
		'Show the currently active product filters. Works in combination with the All Products and filters blocks.',
		'woocommerce'
	),
	supports: {
		html: false,
		multiple: false,
	},
	example: {
		attributes: {},
	},
	attributes: {
		displayStyle: {
			type: 'string',
			default: 'list',
		},
		heading: {
			type: 'string',
			default: __( 'Active filters', 'woocommerce' ),
		},
		headingLevel: {
			type: 'number',
			default: 3,
		},
	},
	edit,
	// Save the props to post content.
	save( { attributes } ) {
		const { className, displayStyle, heading, headingLevel } = attributes;
		const data = {
			'data-display-style': displayStyle,
			'data-heading': heading,
			'data-heading-level': headingLevel,
		};
		return (
			<div
				className={ classNames( 'is-loading', className ) }
				{ ...data }
			>
				<span
					aria-hidden
					className="wc-block-active-product-filters__placeholder"
				/>
			</div>
		);
	},
} );
woocommerce-blocks/assets/js/blocks/active-filters/active-attribute-filters.js000064400000004256151335517640023753 0ustar00/**
 * External dependencies
 */
import {
	useCollection,
	useQueryStateByKey,
} from '@woocommerce/base-context/hooks';
import { decodeEntities } from '@wordpress/html-entities';
import { __ } from '@wordpress/i18n';

/**
 * Internal dependencies
 */
import { renderRemovableListItem } from './utils';
import { removeAttributeFilterBySlug } from '../../utils/attributes-query';

/**
 * Component that renders active attribute (terms) filters.
 *
 * @param {Object} props Incoming props for the component.
 * @param {Object} props.attributeObject The attribute object.
 * @param {Array} props.slugs The slugs for attributes.
 * @param {string} props.operator The operator for the filter.
 * @param {string} props.displayStyle The style used for displaying the filters.
 */
const ActiveAttributeFilters = ( {
	attributeObject = {},
	slugs = [],
	operator = 'in',
	displayStyle,
} ) => {
	const { results, isLoading } = useCollection( {
		namespace: '/wc/store',
		resourceName: 'products/attributes/terms',
		resourceValues: [ attributeObject.id ],
	} );

	const [ productAttributes, setProductAttributes ] = useQueryStateByKey(
		'attributes',
		[]
	);

	if ( isLoading ) {
		return null;
	}

	const attributeLabel = attributeObject.label;

	return (
		<li>
			<span className="wc-block-active-filters__list-item-type">
				{ attributeLabel }:
			</span>
			<ul>
				{ slugs.map( ( slug, index ) => {
					const termObject = results.find( ( term ) => {
						return term.slug === slug;
					} );

					if ( ! termObject ) {
						return null;
					}

					let prefix = '';

					if ( index > 0 && operator === 'and' ) {
						prefix = (
							<span className="wc-block-active-filters__list-item-operator">
								{ __( 'and', 'woocommerce' ) }
							</span>
						);
					}

					return renderRemovableListItem( {
						type: attributeLabel,
						name: decodeEntities( termObject.name || slug ),
						prefix,
						removeCallback: () => {
							removeAttributeFilterBySlug(
								productAttributes,
								setProductAttributes,
								attributeObject,
								slug
							);
						},
						showLabel: false,
						displayStyle,
					} );
				} ) }
			</ul>
		</li>
	);
};

export default ActiveAttributeFilters;
woocommerce-blocks/assets/js/blocks/active-filters/style.scss000064400000003164151335517640020525 0ustar00.wc-block-active-filters {
	margin-bottom: $gap-large;
	overflow: hidden;

	.wc-block-active-filters__clear-all {
		@include font-size(regular);
		float: right;
		border: none;
		padding: 0;
		text-decoration: underline;
		cursor: pointer;

		&,
		&:hover,
		&:focus,
		&:active {
			background: transparent;
			color: inherit;
		}
	}

	.wc-block-active-filters__list {
		margin: 0 0 $gap-smallest;
		padding: 0;
		list-style: none outside;
		clear: both;

		li {
			margin: 0;
			padding: 0;
			list-style: none outside;
			clear: both;

			ul {
				margin: 0;
				padding: 0;
				list-style: none outside;
			}

			&:first-child {
				.wc-block-active-filters__list-item-type {
					margin: 0;
				}
			}
		}
	}

	.wc-block-active-filters__list-item-type {
		@include font-size(smaller);
		text-transform: uppercase;
		letter-spacing: 0.1em;
		margin: $gap 0 0;
		display: block;
	}

	.wc-block-active-filters__list-item-operator {
		font-weight: normal;
		font-style: italic;
	}

	.wc-block-active-filters__list-item-name {
		font-weight: bold;
		display: block;
		position: relative;
		padding: 0 16px 0 0;
	}

	.wc-block-active-filters__list-item-remove {
		background: transparent;
		border: 0;
		appearance: none;
		height: 16px;
		width: 16px;
		padding: 0;
		position: absolute;
		right: 0;
		top: 50%;
		margin: -8px 0 0 0;
		color: currentColor;
	}

	.wc-block-active-filters__list--chips {
		ul,
		li {
			display: inline;
		}

		.wc-block-active-filters__list-item-type {
			display: none;
		}

		.wc-block-components-chip {
			@include font-size(small);
			margin-top: em($gap-small*0.25);
			margin-bottom: em($gap-small*0.25);
		}
	}
}
woocommerce-blocks/assets/js/blocks/active-filters/frontend.js000064400000001027151335517640020641 0ustar00/**
 * External dependencies
 */
import { withRestApiHydration } from '@woocommerce/block-hocs';
import { renderFrontend } from '@woocommerce/base-utils';

/**
 * Internal dependencies
 */
import Block from './block.js';

const getProps = ( el ) => {
	return {
		attributes: {
			displayStyle: el.dataset.displayStyle,
			heading: el.dataset.heading,
			headingLevel: el.dataset.headingLevel || 3,
		},
	};
};

renderFrontend( {
	selector: '.wp-block-woocommerce-active-filters',
	Block: withRestApiHydration( Block ),
	getProps,
} );
woocommerce-blocks/assets/js/blocks/active-filters/block.js000064400000012007151335517640020114 0ustar00/**
 * External dependencies
 */
import { __ } from '@wordpress/i18n';
import { useQueryStateByKey } from '@woocommerce/base-context/hooks';
import { getSetting } from '@woocommerce/settings';
import { useMemo } from '@wordpress/element';
import classnames from 'classnames';
import PropTypes from 'prop-types';
import Label from '@woocommerce/base-components/label';

/**
 * Internal dependencies
 */
import './style.scss';
import { getAttributeFromTaxonomy } from '../../utils/attributes';
import { formatPriceRange, renderRemovableListItem } from './utils';
import ActiveAttributeFilters from './active-attribute-filters';

/**
 * Component displaying active filters.
 *
 * @param {Object} props Incoming props for the component.
 * @param {Object} props.attributes Incoming attributes for the block.
 * @param {boolean} props.isEditor Whether or not in the editor context.
 */
const ActiveFiltersBlock = ( {
	attributes: blockAttributes,
	isEditor = false,
} ) => {
	const [ productAttributes, setProductAttributes ] = useQueryStateByKey(
		'attributes',
		[]
	);
	const [ productStockStatus, setProductStockStatus ] = useQueryStateByKey(
		'stock_status',
		[]
	);
	const [ minPrice, setMinPrice ] = useQueryStateByKey( 'min_price' );
	const [ maxPrice, setMaxPrice ] = useQueryStateByKey( 'max_price' );

	const STOCK_STATUS_OPTIONS = getSetting( 'stockStatusOptions', [] );
	const activeStockStatusFilters = useMemo( () => {
		if ( productStockStatus.length > 0 ) {
			return productStockStatus.map( ( slug ) => {
				return renderRemovableListItem( {
					type: __( 'Stock Status', 'woocommerce' ),
					name: STOCK_STATUS_OPTIONS[ slug ],
					removeCallback: () => {
						const newStatuses = productStockStatus.filter(
							( status ) => {
								return status !== slug;
							}
						);
						setProductStockStatus( newStatuses );
					},
					displayStyle: blockAttributes.displayStyle,
				} );
			} );
		}
	}, [
		STOCK_STATUS_OPTIONS,
		productStockStatus,
		setProductStockStatus,
		blockAttributes.displayStyle,
	] );

	const activePriceFilters = useMemo( () => {
		if ( ! Number.isFinite( minPrice ) && ! Number.isFinite( maxPrice ) ) {
			return null;
		}
		return renderRemovableListItem( {
			type: __( 'Price', 'woocommerce' ),
			name: formatPriceRange( minPrice, maxPrice ),
			removeCallback: () => {
				setMinPrice( undefined );
				setMaxPrice( undefined );
			},
			displayStyle: blockAttributes.displayStyle,
		} );
	}, [
		minPrice,
		maxPrice,
		blockAttributes.displayStyle,
		setMinPrice,
		setMaxPrice,
	] );

	const activeAttributeFilters = useMemo( () => {
		return productAttributes.map( ( attribute ) => {
			const attributeObject = getAttributeFromTaxonomy(
				attribute.attribute
			);
			return (
				<ActiveAttributeFilters
					attributeObject={ attributeObject }
					displayStyle={ blockAttributes.displayStyle }
					slugs={ attribute.slug }
					key={ attribute.attribute }
					operator={ attribute.operator }
				/>
			);
		} );
	}, [ productAttributes, blockAttributes.displayStyle ] );

	const hasFilters = () => {
		return (
			productAttributes.length > 0 ||
			productStockStatus.length > 0 ||
			Number.isFinite( minPrice ) ||
			Number.isFinite( maxPrice )
		);
	};

	if ( ! hasFilters() && ! isEditor ) {
		return null;
	}

	const TagName = `h${ blockAttributes.headingLevel }`;
	const listClasses = classnames( 'wc-block-active-filters__list', {
		'wc-block-active-filters__list--chips':
			blockAttributes.displayStyle === 'chips',
	} );

	return (
		<>
			{ ! isEditor && blockAttributes.heading && (
				<TagName className="wc-block-active-filters__title">
					{ blockAttributes.heading }
				</TagName>
			) }
			<div className="wc-block-active-filters">
				<ul className={ listClasses }>
					{ isEditor ? (
						<>
							{ renderRemovableListItem( {
								type: __(
									'Size',
									'woocommerce'
								),
								name: __(
									'Small',
									'woocommerce'
								),
								displayStyle: blockAttributes.displayStyle,
							} ) }
							{ renderRemovableListItem( {
								type: __(
									'Color',
									'woocommerce'
								),
								name: __(
									'Blue',
									'woocommerce'
								),
								displayStyle: blockAttributes.displayStyle,
							} ) }
						</>
					) : (
						<>
							{ activePriceFilters }
							{ activeStockStatusFilters }
							{ activeAttributeFilters }
						</>
					) }
				</ul>
				<button
					className="wc-block-active-filters__clear-all"
					onClick={ () => {
						setMinPrice( undefined );
						setMaxPrice( undefined );
						setProductAttributes( [] );
						setProductStockStatus( [] );
					} }
				>
					<Label
						label={ __(
							'Clear All',
							'woocommerce'
						) }
						screenReaderLabel={ __(
							'Clear All Filters',
							'woocommerce'
						) }
					/>
				</button>
			</div>
		</>
	);
};

ActiveFiltersBlock.propTypes = {
	/**
	 * The attributes for this block.
	 */
	attributes: PropTypes.object.isRequired,
	/**
	 * Whether it's in the editor or frontend display.
	 */
	isEditor: PropTypes.bool,
};

export default ActiveFiltersBlock;
woocommerce-blocks/assets/js/blocks/active-filters/edit.js000064400000004174151335517640017755 0ustar00/**
 * External dependencies
 */
import { __ } from '@wordpress/i18n';
import { InspectorControls } from '@wordpress/block-editor';
import { Disabled, PanelBody, withSpokenMessages } from '@wordpress/components';
import HeadingToolbar from '@woocommerce/editor-components/heading-toolbar';
import BlockTitle from '@woocommerce/editor-components/block-title';
import ToggleButtonControl from '@woocommerce/editor-components/toggle-button-control';

/**
 * Internal dependencies
 */
import Block from './block.js';

const Edit = ( { attributes, setAttributes } ) => {
	const { className, displayStyle, heading, headingLevel } = attributes;

	const getInspectorControls = () => {
		return (
			<InspectorControls key="inspector">
				<PanelBody
					title={ __(
						'Block Settings',
						'woocommerce'
					) }
				>
					<ToggleButtonControl
						label={ __(
							'Display Style',
							'woocommerce'
						) }
						value={ displayStyle }
						options={ [
							{
								label: __(
									'List',
									'woocommerce'
								),
								value: 'list',
							},
							{
								/* translators: "Chips" is a tag-like display style for chosen attributes. */
								label: __(
									'Chips',
									'woocommerce'
								),
								value: 'chips',
							},
						] }
						onChange={ ( value ) =>
							setAttributes( {
								displayStyle: value,
							} )
						}
					/>
					<p>
						{ __(
							'Heading Level',
							'woocommerce'
						) }
					</p>
					<HeadingToolbar
						isCollapsed={ false }
						minLevel={ 2 }
						maxLevel={ 7 }
						selectedLevel={ headingLevel }
						onChange={ ( newLevel ) =>
							setAttributes( { headingLevel: newLevel } )
						}
					/>
				</PanelBody>
			</InspectorControls>
		);
	};

	return (
		<div className={ className }>
			{ getInspectorControls() }
			<BlockTitle
				className="wc-block-active-filters__title"
				headingLevel={ headingLevel }
				heading={ heading }
				onChange={ ( value ) => setAttributes( { heading: value } ) }
			/>
			<Disabled>
				<Block attributes={ attributes } isEditor={ true } />
			</Disabled>
		</div>
	);
};

export default withSpokenMessages( Edit );
woocommerce-blocks/assets/js/blocks/active-filters/utils.js000064400000006606151335517640020172 0ustar00/**
 * External dependencies
 */
import { __, sprintf } from '@wordpress/i18n';
import { formatPrice } from '@woocommerce/price-format';
import { RemovableChip } from '@woocommerce/base-components/chip';
import Label from '@woocommerce/base-components/label';

/**
 * Format a min/max price range to display.
 *
 * @param {number} minPrice The min price, if set.
 * @param {number} maxPrice The max price, if set.
 */
export const formatPriceRange = ( minPrice, maxPrice ) => {
	if ( Number.isFinite( minPrice ) && Number.isFinite( maxPrice ) ) {
		return sprintf(
			/* translators: %1$s min price, %2$s max price */
			__( 'Between %1$s and %2$s', 'woocommerce' ),
			formatPrice( minPrice ),
			formatPrice( maxPrice )
		);
	}

	if ( Number.isFinite( minPrice ) ) {
		return sprintf(
			/* translators: %s min price */
			__( 'From %s', 'woocommerce' ),
			formatPrice( minPrice )
		);
	}

	return sprintf(
		/* translators: %s max price */
		__( 'Up to %s', 'woocommerce' ),
		formatPrice( maxPrice )
	);
};

/**
 * Render a removable item in the active filters block list.
 *
 * @param {Object}   listItem                  The removable item to render.
 * @param {string}   listItem.type             Type string.
 * @param {string}   listItem.name             Name string.
 * @param {string}   listItem.prefix           Prefix shown before item name.
 * @param {Function} listItem.removeCallback   Callback to remove item.
 * @param {string}   listItem.displayStyle     Whether it's a list or chips.
 * @param {boolean}  [listItem.showLabel=true] Should the label be shown for
 *                                             this item?
 */
export const renderRemovableListItem = ( {
	type,
	name,
	prefix,
	removeCallback = () => {},
	showLabel = true,
	displayStyle,
} ) => {
	const prefixedName = prefix ? (
		<>
			{ prefix }
			&nbsp;
			{ name }
		</>
	) : (
		name
	);
	const removeText = sprintf(
		/* translators: %s attribute value used in the filter. For example: yellow, green, small, large. */
		__( 'Remove %s filter', 'woocommerce' ),
		name
	);

	return (
		<li
			className="wc-block-active-filters__list-item"
			key={ type + ':' + name }
		>
			{ showLabel && (
				<span className="wc-block-active-filters__list-item-type">
					{ type + ': ' }
				</span>
			) }
			{ displayStyle === 'chips' ? (
				<RemovableChip
					element="span"
					text={ prefixedName }
					onRemove={ removeCallback }
					radius="large"
					ariaLabel={ removeText }
				/>
			) : (
				<span className="wc-block-active-filters__list-item-name">
					{ prefixedName }
					<button
						className="wc-block-active-filters__list-item-remove"
						onClick={ removeCallback }
					>
						<svg
							width="16"
							height="16"
							viewBox="0 0 16 16"
							fill="none"
							xmlns="http://www.w3.org/2000/svg"
						>
							<ellipse
								cx="8"
								cy="8"
								rx="8"
								ry="8"
								transform="rotate(-180 8 8)"
								fill="currentColor"
								fillOpacity="0.7"
							/>
							<rect
								x="10.636"
								y="3.94983"
								width="2"
								height="9.9466"
								transform="rotate(45 10.636 3.94983)"
								fill="white"
							/>
							<rect
								x="12.0503"
								y="11.0209"
								width="2"
								height="9.9466"
								transform="rotate(135 12.0503 11.0209)"
								fill="white"
							/>
						</svg>

						<Label screenReaderLabel={ removeText } />
					</button>
				</span>
			) }
		</li>
	);
};
woocommerce-blocks/assets/js/blocks/stock-filter/editor.scss000064400000001326151335517640020336 0ustar00.wc-block-stock-filter {
	.components-placeholder__instructions {
		border-bottom: 1px solid #e0e2e6;
		width: 100%;
		padding-bottom: 1em;
		margin-bottom: 2em;
	}
	.components-placeholder__label svg {
		fill: currentColor;
		margin-right: 1ch;
	}
	.components-placeholder__fieldset {
		display: block; /* Disable flex box */
	}
	.woocommerce-search-list__search {
		border-top: 0;
		margin-top: 0;
		padding-top: 0;
	}
	.wc-block-stock-filter__add-stock-button {
		margin: 0 0 1em;
		vertical-align: middle;
		height: auto;
		padding: 0.5em 1em;

		svg {
			fill: currentColor;
			margin-left: 0.5ch;
			vertical-align: middle;
		}
	}
	.wc-block-stock-filter__read_more_button {
		display: block;
		margin-bottom: 1em;
	}
}
woocommerce-blocks/assets/js/blocks/stock-filter/test/__snapshots__/block.js.snap000064400000010046151335517640024337 0ustar00// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`Testing stock filter renders the stock filter block 1`] = `
<div>
  <div
    class="wc-block-stock-filter"
  >
    <ul
      class="wc-block-checkbox-list wc-block-components-checkbox-list wc-block-stock-filter-list"
    >
      <li>
        <input
          id="instock"
          type="checkbox"
          value="instock"
        />
        <label
          for="instock"
        >
          In stock
        </label>
      </li>
      <li>
        <input
          id="onbackorder"
          type="checkbox"
          value="onbackorder"
        />
        <label
          for="onbackorder"
        >
          On backorder
        </label>
      </li>
      <li>
        <input
          id="outofstock"
          type="checkbox"
          value="outofstock"
        />
        <label
          for="outofstock"
        >
          Out of stock
        </label>
      </li>
    </ul>
  </div>
</div>
`;

exports[`Testing stock filter renders the stock filter block with the filter button 1`] = `
<div>
  <div
    class="wc-block-stock-filter"
  >
    <ul
      class="wc-block-checkbox-list wc-block-components-checkbox-list wc-block-stock-filter-list"
    >
      <li>
        <input
          id="instock"
          type="checkbox"
          value="instock"
        />
        <label
          for="instock"
        >
          In stock
        </label>
      </li>
      <li>
        <input
          id="onbackorder"
          type="checkbox"
          value="onbackorder"
        />
        <label
          for="onbackorder"
        >
          On backorder
        </label>
      </li>
      <li>
        <input
          id="outofstock"
          type="checkbox"
          value="outofstock"
        />
        <label
          for="outofstock"
        >
          Out of stock
        </label>
      </li>
    </ul>
    <button
      class="wc-block-filter-submit-button wc-block-components-filter-submit-button wc-block-stock-filter__button"
      type="submit"
    >
      <span
        aria-hidden="true"
      >
        Go
      </span>
      <span
        class="screen-reader-text"
      >
        Apply filter
      </span>
    </button>
  </div>
</div>
`;

exports[`Testing stock filter renders the stock filter block with the product counts 1`] = `
<div>
  <div
    class="wc-block-stock-filter"
  >
    <ul
      class="wc-block-checkbox-list wc-block-components-checkbox-list wc-block-stock-filter-list"
    >
      <li>
        <input
          id="instock"
          type="checkbox"
          value="instock"
        />
        <label
          for="instock"
        >
          In stock
          <span
            class="wc-filter-element-label-list-count"
          >
            <span
              aria-hidden="true"
            >
              18
            </span>
            <span
              class="screen-reader-text"
            >
              18 products
            </span>
          </span>
        </label>
      </li>
      <li>
        <input
          id="onbackorder"
          type="checkbox"
          value="onbackorder"
        />
        <label
          for="onbackorder"
        >
          On backorder
          <span
            class="wc-filter-element-label-list-count"
          >
            <span
              aria-hidden="true"
            >
              5
            </span>
            <span
              class="screen-reader-text"
            >
              5 products
            </span>
          </span>
        </label>
      </li>
      <li>
        <input
          id="outofstock"
          type="checkbox"
          value="outofstock"
        />
        <label
          for="outofstock"
        >
          Out of stock
          <span
            class="wc-filter-element-label-list-count"
          >
            <span
              aria-hidden="true"
            >
              1
            </span>
            <span
              class="screen-reader-text"
            >
              1 product
            </span>
          </span>
        </label>
      </li>
    </ul>
  </div>
</div>
`;
woocommerce-blocks/assets/js/blocks/stock-filter/test/block.js000064400000003271151335517640020563 0ustar00/**
 * Internal dependencies
 */

/**
 * External dependencies
 */
import { render } from '@testing-library/react';
import { default as fetchMock } from 'jest-fetch-mock';

/**
 * Internal dependencies
 */
import Block from '../block';
import { allSettings } from '../../../settings/shared/settings-init';

const mockResults = {
	stock_status_counts: [
		{ status: 'instock', count: '18' },
		{ status: 'outofstock', count: '1' },
		{ status: 'onbackorder', count: '5' },
	],
};

jest.mock( '@woocommerce/base-context/hooks', () => {
	return {
		...jest.requireActual( '@woocommerce/base-context/hooks' ),
		useCollectionData: () => ( { isLoading: false, results: mockResults } ),
	};
} );

const StockFilterBlock = ( props ) => <Block { ...props } />;
describe( 'Testing stock filter', () => {
	beforeEach( () => {
		allSettings.stockStatusOptions = {
			instock: 'In stock',
			outofstock: 'Out of stock',
			onbackorder: 'On backorder',
		};
	} );

	afterEach( () => {
		fetchMock.resetMocks();
	} );

	it( 'renders the stock filter block', async () => {
		const { container } = render(
			<StockFilterBlock attributes={ { isPreview: false } } />
		);
		expect( container ).toMatchSnapshot();
	} );

	it( 'renders the stock filter block with the filter button', async () => {
		const { container } = render(
			<StockFilterBlock
				attributes={ { isPreview: false, showFilterButton: true } }
			/>
		);
		expect( container ).toMatchSnapshot();
	} );

	it( 'renders the stock filter block with the product counts', async () => {
		const { container } = render(
			<StockFilterBlock
				attributes={ {
					isPreview: false,
					showCounts: true,
				} }
			/>
		);
		expect( container ).toMatchSnapshot();
	} );
} );
woocommerce-blocks/assets/js/blocks/stock-filter/block.js000064400000016751151335517640017613 0ustar00/**
 * External dependencies
 */
import { __, sprintf } from '@wordpress/i18n';
import { speak } from '@wordpress/a11y';
import { usePrevious, useShallowEqual } from '@woocommerce/base-hooks';
import {
	useQueryStateByKey,
	useQueryStateByContext,
	useCollectionData,
} from '@woocommerce/base-context/hooks';
import { getSetting } from '@woocommerce/settings';
import { useCallback, useEffect, useState, useMemo } from '@wordpress/element';
import CheckboxList from '@woocommerce/base-components/checkbox-list';
import FilterSubmitButton from '@woocommerce/base-components/filter-submit-button';
import Label from '@woocommerce/base-components/filter-element-label';
import isShallowEqual from '@wordpress/is-shallow-equal';
import { decodeEntities } from '@wordpress/html-entities';

/**
 * Internal dependencies
 */
import { previewOptions } from './preview';
import './style.scss';

/**
 * Component displaying an stock status filter.
 *
 * @param {Object} props Incoming props for the component.
 * @param {Object} props.attributes Incoming block attributes.
 * @param {boolean} props.isEditor
 */
const StockStatusFilterBlock = ( {
	attributes: blockAttributes,
	isEditor = false,
} ) => {
	const [ hideOutOfStockItems ] = useState(
		getSetting( 'hideOutOfStockItems', false )
	);
	const [ { outofstock, ...otherStockStatusOptions } ] = useState(
		getSetting( 'stockStatusOptions', {} )
	);
	const [ STOCK_STATUS_OPTIONS ] = useState(
		hideOutOfStockItems
			? otherStockStatusOptions
			: { outofstock, ...otherStockStatusOptions }
	);

	const [ checked, setChecked ] = useState( [] );
	const [ displayedOptions, setDisplayedOptions ] = useState(
		blockAttributes.isPreview ? previewOptions : []
	);
	// Filter added to handle if there are slugs without a corresponding name defined.
	const [ initialOptions ] = useState(
		Object.entries( STOCK_STATUS_OPTIONS )
			.map( ( [ slug, name ] ) => ( { slug, name } ) )
			.filter( ( status ) => !! status.name )
			.sort( ( a, b ) => a.slug.localeCompare( b.slug ) )
	);

	const [ queryState ] = useQueryStateByContext();
	const [
		productStockStatusQuery,
		setProductStockStatusQuery,
	] = useQueryStateByKey( 'stock_status', [] );

	const {
		results: filteredCounts,
		isLoading: filteredCountsLoading,
	} = useCollectionData( {
		queryStock: true,
		queryState,
	} );

	/**
	 * Get count data about a given status by slug.
	 */
	const getFilteredStock = useCallback(
		( slug ) => {
			if ( ! filteredCounts.stock_status_counts ) {
				return null;
			}
			return filteredCounts.stock_status_counts.find(
				( { status, count } ) =>
					status === slug && Number( count ) !== 0
			);
		},
		[ filteredCounts ]
	);

	/**
	 * Compare intersection of all stock statuses and filtered counts to get a list of options to display.
	 */
	useEffect( () => {
		/**
		 * Checks if a status slug is in the query state.
		 *
		 * @param {string} queryStatus The status slug to check.
		 */
		const isStockStatusInQueryState = ( queryStatus ) => {
			if ( ! queryState?.stock_status ) {
				return false;
			}
			return queryState.stock_status.some( ( { status = [] } ) =>
				status.includes( queryStatus )
			);
		};

		if ( filteredCountsLoading || blockAttributes.isPreview ) {
			return;
		}

		const newOptions = initialOptions
			.map( ( status ) => {
				const filteredStock = getFilteredStock( status.slug );

				if (
					! filteredStock &&
					! checked.includes( status.slug ) &&
					! isStockStatusInQueryState( status.slug )
				) {
					return null;
				}

				const count = filteredStock ? Number( filteredStock.count ) : 0;

				return {
					value: status.slug,
					name: decodeEntities( status.name ),
					label: (
						<Label
							name={ decodeEntities( status.name ) }
							count={ blockAttributes.showCounts ? count : null }
						/>
					),
				};
			} )
			.filter( Boolean );

		setDisplayedOptions( newOptions );
	}, [
		blockAttributes.showCounts,
		blockAttributes.isPreview,
		filteredCountsLoading,
		getFilteredStock,
		checked,
		queryState.stock_status,
		initialOptions,
	] );

	const onSubmit = useCallback(
		( isChecked ) => {
			if ( isEditor ) {
				return;
			}
			if ( isChecked ) {
				setProductStockStatusQuery( checked );
			}
		},
		[ isEditor, setProductStockStatusQuery, checked ]
	);

	// Track checked STATE changes - if state changes, update the query.
	useEffect( () => {
		if ( ! blockAttributes.showFilterButton ) {
			onSubmit( checked );
		}
	}, [ blockAttributes.showFilterButton, checked, onSubmit ] );

	const checkedQuery = useMemo( () => {
		return productStockStatusQuery;
	}, [ productStockStatusQuery ] );

	const currentCheckedQuery = useShallowEqual( checkedQuery );
	const previousCheckedQuery = usePrevious( currentCheckedQuery );
	// Track Stock query changes so the block reflects current filters.
	useEffect( () => {
		if (
			! isShallowEqual( previousCheckedQuery, currentCheckedQuery ) && // Checked query changed.
			! isShallowEqual( checked, currentCheckedQuery ) // Checked query doesn't match the UI.
		) {
			setChecked( currentCheckedQuery );
		}
	}, [ checked, currentCheckedQuery, previousCheckedQuery ] );

	/**
	 * When a checkbox in the list changes, update state.
	 */
	const onChange = useCallback(
		( checkedValue ) => {
			const getFilterNameFromValue = ( filterValue ) => {
				const { name } = displayedOptions.find(
					( option ) => option.value === filterValue
				);

				return name;
			};

			const announceFilterChange = ( { filterAdded, filterRemoved } ) => {
				const filterAddedName = filterAdded
					? getFilterNameFromValue( filterAdded )
					: null;
				const filterRemovedName = filterRemoved
					? getFilterNameFromValue( filterRemoved )
					: null;
				if ( filterAddedName ) {
					speak(
						sprintf(
							/* translators: %s stock statuses (for example: 'instock'...) */
							__(
								'%s filter added.',
								'woocommerce'
							),
							filterAddedName
						)
					);
				} else if ( filterRemovedName ) {
					speak(
						sprintf(
							/* translators: %s stock statuses (for example:'instock'...) */
							__(
								'%s filter removed.',
								'woocommerce'
							),
							filterRemovedName
						)
					);
				}
			};

			const previouslyChecked = checked.includes( checkedValue );

			const newChecked = checked.filter(
				( value ) => value !== checkedValue
			);

			if ( ! previouslyChecked ) {
				newChecked.push( checkedValue );
				newChecked.sort();
				announceFilterChange( { filterAdded: checkedValue } );
			} else {
				announceFilterChange( { filterRemoved: checkedValue } );
			}

			setChecked( newChecked );
		},
		[ checked, displayedOptions ]
	);

	if ( displayedOptions.length === 0 ) {
		return null;
	}

	const TagName = `h${ blockAttributes.headingLevel }`;
	const isLoading = ! blockAttributes.isPreview && ! STOCK_STATUS_OPTIONS;
	const isDisabled = ! blockAttributes.isPreview && filteredCountsLoading;

	return (
		<>
			{ ! isEditor && blockAttributes.heading && (
				<TagName className="wc-block-stock-filter__title">
					{ blockAttributes.heading }
				</TagName>
			) }
			<div className="wc-block-stock-filter">
				<CheckboxList
					className={ 'wc-block-stock-filter-list' }
					options={ displayedOptions }
					checked={ checked }
					onChange={ onChange }
					isLoading={ isLoading }
					isDisabled={ isDisabled }
				/>
				{ blockAttributes.showFilterButton && (
					<FilterSubmitButton
						className="wc-block-stock-filter__button"
						disabled={ isLoading || isDisabled }
						onClick={ () => onSubmit( checked ) }
					/>
				) }
			</div>
		</>
	);
};

export default StockStatusFilterBlock;
woocommerce-blocks/assets/js/blocks/stock-filter/style.scss000064400000000635151335517640020212 0ustar00.wc-block-stock-filter {
	margin-bottom: $gap-large;

	.wc-block-stock-filter-list {
		margin: 0;

		li {
			text-decoration: underline;

			label {
				cursor: pointer;
			}

			input {
				cursor: pointer;
				display: inline-block;
			}
		}
	}

	.is-single,
	.wc-block-dropdown-selector .wc-block-dropdown-selector__list {
		opacity: 0.6;
	}

	.wc-block-stock-filter__button {
		margin-top: $gap-smaller;
	}
}
woocommerce-blocks/assets/js/blocks/stock-filter/frontend.js000064400000001131151335517640020322 0ustar00/**
 * External dependencies
 */
import { withRestApiHydration } from '@woocommerce/block-hocs';
import { renderFrontend } from '@woocommerce/base-utils';

/**
 * Internal dependencies
 */
import Block from './block.js';

const getProps = ( el ) => {
	return {
		attributes: {
			showCounts: el.dataset.showCounts === 'true',
			heading: el.dataset.heading,
			headingLevel: el.dataset.headingLevel || 3,
			showFilterButton: el.dataset.showFilterButton === 'true',
		},
	};
};

renderFrontend( {
	selector: '.wp-block-woocommerce-stock-filter',
	Block: withRestApiHydration( Block ),
	getProps,
} );
woocommerce-blocks/assets/js/blocks/stock-filter/index.js000064400000003417151335517640017623 0ustar00/**
 * External dependencies
 */
import { __ } from '@wordpress/i18n';
import { registerBlockType } from '@wordpress/blocks';
import { Icon, server } from '@woocommerce/icons';
import classNames from 'classnames';

/**
 * Internal dependencies
 */
import edit from './edit.js';

registerBlockType( 'woocommerce/stock-filter', {
	title: __( 'Filter Products by Stock', 'woocommerce' ),
	icon: {
		src: <Icon srcElement={ server } />,
		foreground: '#96588a',
	},
	category: 'woocommerce',
	keywords: [ __( 'WooCommerce', 'woocommerce' ) ],
	description: __(
		'Allow customers to filter the grid by products stock status. Works in combination with the All Products block.',
		'woocommerce'
	),
	supports: {
		html: false,
		multiple: false,
	},
	example: {
		attributes: {
			isPreview: true,
		},
	},
	attributes: {
		heading: {
			type: 'string',
			default: __(
				'Filter by stock status',
				'woocommerce'
			),
		},
		headingLevel: {
			type: 'number',
			default: 3,
		},
		showCounts: {
			type: 'boolean',
			default: true,
		},
		showFilterButton: {
			type: 'boolean',
			default: false,
		},
		/**
		 * Are we previewing?
		 */
		isPreview: {
			type: 'boolean',
			default: false,
		},
	},
	edit,
	// Save the props to post content.
	save( { attributes } ) {
		const {
			className,
			showCounts,
			heading,
			headingLevel,
			showFilterButton,
		} = attributes;
		const data = {
			'data-show-counts': showCounts,
			'data-heading': heading,
			'data-heading-level': headingLevel,
		};
		if ( showFilterButton ) {
			data[ 'data-show-filter-button' ] = showFilterButton;
		}
		return (
			<div
				className={ classNames( 'is-loading', className ) }
				{ ...data }
			>
				<span
					aria-hidden
					className="wc-block-product-stock-filter__placeholder"
				/>
			</div>
		);
	},
} );
woocommerce-blocks/assets/js/blocks/stock-filter/preview.js000064400000000677151335517640020202 0ustar00/**
 * External dependencies
 */
import Label from '@woocommerce/base-components/filter-element-label';

export const previewOptions = [
	{
		value: 'preview-1',
		name: 'In Stock',
		label: <Label name="In Stock" count={ 3 } />,
	},
	{
		value: 'preview-2',
		name: 'Out of sotck',
		label: <Label name="Out of stock" count={ 3 } />,
	},
	{
		value: 'preview-3',
		name: 'On backorder',
		label: <Label name="On backorder" count={ 2 } />,
	},
];
woocommerce-blocks/assets/js/blocks/stock-filter/edit.js000064400000005332151335517640017437 0ustar00/**
 * External dependencies
 */
import { __ } from '@wordpress/i18n';
import classnames from 'classnames';
import { InspectorControls } from '@wordpress/block-editor';
import {
	Disabled,
	PanelBody,
	ToggleControl,
	withSpokenMessages,
} from '@wordpress/components';
import HeadingToolbar from '@woocommerce/editor-components/heading-toolbar';
import BlockTitle from '@woocommerce/editor-components/block-title';

/**
 * Internal dependencies
 */
import Block from './block.js';
import './editor.scss';

const Edit = ( { attributes, setAttributes } ) => {
	const {
		className,
		heading,
		headingLevel,
		showCounts,
		showFilterButton,
	} = attributes;

	const getInspectorControls = () => {
		return (
			<InspectorControls key="inspector">
				<PanelBody
					title={ __( 'Content', 'woocommerce' ) }
				>
					<ToggleControl
						label={ __(
							'Product count',
							'woocommerce'
						) }
						help={
							showCounts
								? __(
										'Product count is visible.',
										'woocommerce'
								  )
								: __(
										'Product count is hidden.',
										'woocommerce'
								  )
						}
						checked={ showCounts }
						onChange={ () =>
							setAttributes( {
								showCounts: ! showCounts,
							} )
						}
					/>
					<p>
						{ __(
							'Heading Level',
							'woocommerce'
						) }
					</p>
					<HeadingToolbar
						isCollapsed={ false }
						minLevel={ 2 }
						maxLevel={ 7 }
						selectedLevel={ headingLevel }
						onChange={ ( newLevel ) =>
							setAttributes( { headingLevel: newLevel } )
						}
					/>
				</PanelBody>
				<PanelBody
					title={ __(
						'Block Settings',
						'woocommerce'
					) }
				>
					<ToggleControl
						label={ __(
							'Filter button',
							'woocommerce'
						) }
						help={
							showFilterButton
								? __(
										'Products will only update when the button is pressed.',
										'woocommerce'
								  )
								: __(
										'Products will update as options are selected.',
										'woocommerce'
								  )
						}
						checked={ showFilterButton }
						onChange={ ( value ) =>
							setAttributes( {
								showFilterButton: value,
							} )
						}
					/>
				</PanelBody>
			</InspectorControls>
		);
	};

	return (
		<>
			{ getInspectorControls() }
			{
				<div
					className={ classnames(
						'wc-block-stock-filter',
						className
					) }
				>
					<BlockTitle
						className="wc-block-stock-filter__title"
						headingLevel={ headingLevel }
						heading={ heading }
						onChange={ ( value ) =>
							setAttributes( { heading: value } )
						}
					/>
					<Disabled>
						<Block attributes={ attributes } isEditor={ true } />
					</Disabled>
				</div>
			}
		</>
	);
};

export default withSpokenMessages( Edit );
woocommerce-blocks/assets/js/blocks/reviews/example.js000064400000000707151335517640017224 0ustar00/**
 * External dependencies
 */
import { previewReviews } from '@woocommerce/resource-previews';

export const example = {
	attributes: {
		editMode: false,
		imageType: 'reviewer',
		orderby: 'most-recent',
		reviewsOnLoadMore: 10,
		reviewsOnPageLoad: 10,
		showLoadMore: true,
		showOrderby: true,
		showReviewDate: true,
		showReviewerName: true,
		showReviewImage: true,
		showReviewRating: true,
		showReviewContent: true,
		previewReviews,
	},
};
woocommerce-blocks/assets/js/blocks/reviews/frontend.js000064400000001507151335517640017407 0ustar00/**
 * External dependencies
 */
import { renderFrontend } from '@woocommerce/base-utils';

/**
 * Internal dependencies
 */
import FrontendContainerBlock from './frontend-container-block.js';

const selector = `
	.wp-block-woocommerce-all-reviews,
	.wp-block-woocommerce-reviews-by-product,
	.wp-block-woocommerce-reviews-by-category
`;

const getProps = ( el ) => {
	return {
		attributes: {
			showReviewDate: el.classList.contains( 'has-date' ),
			showReviewerName: el.classList.contains( 'has-name' ),
			showReviewImage: el.classList.contains( 'has-image' ),
			showReviewRating: el.classList.contains( 'has-rating' ),
			showReviewContent: el.classList.contains( 'has-content' ),
			showProductName: el.classList.contains( 'has-product-name' ),
		},
	};
};

renderFrontend( { selector, Block: FrontendContainerBlock, getProps } );
woocommerce-blocks/assets/js/blocks/reviews/utils.js000064400000004476151335517640016740 0ustar00/**
 * External dependencies
 */
import apiFetch from '@wordpress/api-fetch';
import classNames from 'classnames';
import { getSetting } from '@woocommerce/settings';

export const getSortArgs = ( sortValue ) => {
	const reviewRatingsEnabled = getSetting( 'reviewRatingsEnabled', true );

	if ( reviewRatingsEnabled ) {
		if ( sortValue === 'lowest-rating' ) {
			return {
				order: 'asc',
				orderby: 'rating',
			};
		}
		if ( sortValue === 'highest-rating' ) {
			return {
				order: 'desc',
				orderby: 'rating',
			};
		}
	}

	return {
		order: 'desc',
		orderby: 'date_gmt',
	};
};

export const getReviews = ( args ) => {
	return apiFetch( {
		path:
			'/wc/store/products/reviews?' +
			Object.entries( args )
				.map( ( arg ) => arg.join( '=' ) )
				.join( '&' ),
		parse: false,
	} ).then( ( response ) => {
		return response.json().then( ( reviews ) => {
			const totalReviews = parseInt(
				response.headers.get( 'x-wp-total' ),
				10
			);
			return { reviews, totalReviews };
		} );
	} );
};

export const getBlockClassName = ( attributes ) => {
	const {
		className,
		categoryIds,
		productId,
		showReviewDate,
		showReviewerName,
		showReviewContent,
		showProductName,
		showReviewImage,
		showReviewRating,
	} = attributes;

	let blockClassName = 'wc-block-all-reviews';

	if ( productId ) {
		blockClassName = 'wc-block-reviews-by-product';
	}

	if ( Array.isArray( categoryIds ) ) {
		blockClassName = 'wc-block-reviews-by-category';
	}

	return classNames( blockClassName, className, {
		'has-image': showReviewImage,
		'has-name': showReviewerName,
		'has-date': showReviewDate,
		'has-rating': showReviewRating,
		'has-content': showReviewContent,
		'has-product-name': showProductName,
	} );
};

export const getDataAttrs = ( attributes ) => {
	const {
		categoryIds,
		imageType,
		orderby,
		productId,
		reviewsOnPageLoad,
		reviewsOnLoadMore,
		showLoadMore,
		showOrderby,
	} = attributes;

	const data = {
		'data-image-type': imageType,
		'data-orderby': orderby,
		'data-reviews-on-page-load': reviewsOnPageLoad,
		'data-reviews-on-load-more': reviewsOnLoadMore,
		'data-show-load-more': showLoadMore,
		'data-show-orderby': showOrderby,
	};

	if ( productId ) {
		data[ 'data-product-id' ] = productId;
	}

	if ( Array.isArray( categoryIds ) ) {
		data[ 'data-category-ids' ] = categoryIds.join( ',' );
	}

	return data;
};
woocommerce-blocks/assets/js/blocks/reviews/edit-utils.js000064400000012600151335517640017647 0ustar00/**
 * External dependencies
 */
import { __ } from '@wordpress/i18n';
import { createInterpolateElement } from '@wordpress/element';
import {
	Notice,
	ToggleControl,
	ToolbarGroup,
	RangeControl,
	SelectControl,
} from '@wordpress/components';
import { BlockControls } from '@wordpress/block-editor';
import { getAdminLink, getSetting } from '@woocommerce/settings';
import ToggleButtonControl from '@woocommerce/editor-components/toggle-button-control';

export const getBlockControls = ( editMode, setAttributes ) => (
	<BlockControls>
		<ToolbarGroup
			controls={ [
				{
					icon: 'edit',
					title: __( 'Edit', 'woocommerce' ),
					onClick: () => setAttributes( { editMode: ! editMode } ),
					isActive: editMode,
				},
			] }
		/>
	</BlockControls>
);

export const getSharedReviewContentControls = ( attributes, setAttributes ) => {
	const showAvatars = getSetting( 'showAvatars', true );
	const reviewRatingsEnabled = getSetting( 'reviewRatingsEnabled', true );
	return (
		<>
			<ToggleControl
				label={ __( 'Product rating', 'woocommerce' ) }
				checked={ attributes.showReviewRating }
				onChange={ () =>
					setAttributes( {
						showReviewRating: ! attributes.showReviewRating,
					} )
				}
			/>
			{ attributes.showReviewRating && ! reviewRatingsEnabled && (
				<Notice
					className="wc-block-base-control-notice"
					isDismissible={ false }
				>
					{ createInterpolateElement(
						__(
							'Product rating is disabled in your <a>store settings</a>.',
							'woocommerce'
						),
						{
							a: (
								// eslint-disable-next-line jsx-a11y/anchor-has-content
								<a
									href={ getAdminLink(
										'admin.php?page=wc-settings&tab=products'
									) }
									target="_blank"
									rel="noopener noreferrer"
								/>
							),
						}
					) }
				</Notice>
			) }
			<ToggleControl
				label={ __( 'Reviewer name', 'woocommerce' ) }
				checked={ attributes.showReviewerName }
				onChange={ () =>
					setAttributes( {
						showReviewerName: ! attributes.showReviewerName,
					} )
				}
			/>
			<ToggleControl
				label={ __( 'Image', 'woocommerce' ) }
				checked={ attributes.showReviewImage }
				onChange={ () =>
					setAttributes( {
						showReviewImage: ! attributes.showReviewImage,
					} )
				}
			/>
			<ToggleControl
				label={ __( 'Review date', 'woocommerce' ) }
				checked={ attributes.showReviewDate }
				onChange={ () =>
					setAttributes( {
						showReviewDate: ! attributes.showReviewDate,
					} )
				}
			/>
			<ToggleControl
				label={ __( 'Review content', 'woocommerce' ) }
				checked={ attributes.showReviewContent }
				onChange={ () =>
					setAttributes( {
						showReviewContent: ! attributes.showReviewContent,
					} )
				}
			/>
			{ attributes.showReviewImage && (
				<>
					<ToggleButtonControl
						label={ __(
							'Review image',
							'woocommerce'
						) }
						value={ attributes.imageType }
						options={ [
							{
								label: __(
									'Reviewer photo',
									'woocommerce'
								),
								value: 'reviewer',
							},
							{
								label: __(
									'Product',
									'woocommerce'
								),
								value: 'product',
							},
						] }
						onChange={ ( value ) =>
							setAttributes( { imageType: value } )
						}
					/>
					{ attributes.imageType === 'reviewer' && ! showAvatars && (
						<Notice
							className="wc-block-base-control-notice"
							isDismissible={ false }
						>
							{ createInterpolateElement(
								__(
									'Reviewer photo is disabled in your <a>site settings</a>.',
									'woocommerce'
								),
								{
									a: (
										// eslint-disable-next-line jsx-a11y/anchor-has-content
										<a
											href={ getAdminLink(
												'options-discussion.php'
											) }
											target="_blank"
											rel="noopener noreferrer"
										/>
									),
								}
							) }
						</Notice>
					) }
				</>
			) }
		</>
	);
};

export const getSharedReviewListControls = ( attributes, setAttributes ) => {
	const minPerPage = 1;
	const maxPerPage = 20;

	return (
		<>
			<ToggleControl
				label={ __( 'Order by', 'woocommerce' ) }
				checked={ attributes.showOrderby }
				onChange={ () =>
					setAttributes( { showOrderby: ! attributes.showOrderby } )
				}
			/>
			<SelectControl
				label={ __(
					'Order Product Reviews by',
					'woocommerce'
				) }
				value={ attributes.orderby }
				options={ [
					{ label: 'Most recent', value: 'most-recent' },
					{ label: 'Highest Rating', value: 'highest-rating' },
					{ label: 'Lowest Rating', value: 'lowest-rating' },
				] }
				onChange={ ( orderby ) => setAttributes( { orderby } ) }
			/>
			<RangeControl
				label={ __(
					'Starting Number of Reviews',
					'woocommerce'
				) }
				value={ attributes.reviewsOnPageLoad }
				onChange={ ( reviewsOnPageLoad ) =>
					setAttributes( { reviewsOnPageLoad } )
				}
				max={ maxPerPage }
				min={ minPerPage }
			/>
			<ToggleControl
				label={ __( 'Load more', 'woocommerce' ) }
				checked={ attributes.showLoadMore }
				onChange={ () =>
					setAttributes( { showLoadMore: ! attributes.showLoadMore } )
				}
			/>
			{ attributes.showLoadMore && (
				<RangeControl
					label={ __(
						'Load More Reviews',
						'woocommerce'
					) }
					value={ attributes.reviewsOnLoadMore }
					onChange={ ( reviewsOnLoadMore ) =>
						setAttributes( { reviewsOnLoadMore } )
					}
					max={ maxPerPage }
					min={ minPerPage }
				/>
			) }
		</>
	);
};
woocommerce-blocks/assets/js/blocks/reviews/all-reviews/edit.js000064400000004314151335517640020746 0ustar00/**
 * External dependencies
 */
import { __ } from '@wordpress/i18n';
import { InspectorControls } from '@wordpress/block-editor';
import { PanelBody, ToggleControl } from '@wordpress/components';
import PropTypes from 'prop-types';
import { Icon, discussion } from '@woocommerce/icons';

/**
 * Internal dependencies
 */
import EditorContainerBlock from '../editor-container-block.js';
import NoReviewsPlaceholder from './no-reviews-placeholder.js';
import {
	getSharedReviewContentControls,
	getSharedReviewListControls,
} from '../edit-utils.js';

/**
 * Component to handle edit mode of "All Reviews".
 *
 * @param {Object} props Incoming props for the component.
 * @param {Object} props.attributes Incoming block attributes.
 * @param {function(any):any} props.setAttributes Setter for block attributes.
 */
const AllReviewsEditor = ( { attributes, setAttributes } ) => {
	const getInspectorControls = () => {
		return (
			<InspectorControls key="inspector">
				<PanelBody
					title={ __( 'Content', 'woocommerce' ) }
				>
					<ToggleControl
						label={ __(
							'Product name',
							'woocommerce'
						) }
						checked={ attributes.showProductName }
						onChange={ () =>
							setAttributes( {
								showProductName: ! attributes.showProductName,
							} )
						}
					/>
					{ getSharedReviewContentControls(
						attributes,
						setAttributes
					) }
				</PanelBody>
				<PanelBody
					title={ __(
						'List Settings',
						'woocommerce'
					) }
				>
					{ getSharedReviewListControls( attributes, setAttributes ) }
				</PanelBody>
			</InspectorControls>
		);
	};

	return (
		<>
			{ getInspectorControls() }
			<EditorContainerBlock
				attributes={ attributes }
				icon={
					<Icon
						icon={ discussion }
						className="block-editor-block-icon"
					/>
				}
				name={ __( 'All Reviews', 'woocommerce' ) }
				noReviewsPlaceholder={ NoReviewsPlaceholder }
			/>
		</>
	);
};

AllReviewsEditor.propTypes = {
	/**
	 * The attributes for this block.
	 */
	attributes: PropTypes.object.isRequired,
	/**
	 * The register block name.
	 */
	name: PropTypes.string.isRequired,
	/**
	 * A callback to update attributes.
	 */
	setAttributes: PropTypes.func.isRequired,
};

export default AllReviewsEditor;
woocommerce-blocks/assets/js/blocks/reviews/all-reviews/index.js000064400000003357151335517640021136 0ustar00/**
 * External dependencies
 */
import { __ } from '@wordpress/i18n';
import { createBlock, registerBlockType } from '@wordpress/blocks';
import { Icon, discussion } from '@woocommerce/icons';

/**
 * Internal dependencies
 */
import '../editor.scss';
import edit from './edit';
import sharedAttributes from '../attributes';
import save from '../save.js';
import { example } from '../example';

/**
 * Register and run the "All Reviews" block.
 * This block lists all product reviews.
 */
registerBlockType( 'woocommerce/all-reviews', {
	apiVersion: 2,
	title: __( 'All Reviews', 'woocommerce' ),
	icon: {
		src: <Icon srcElement={ discussion } />,
		foreground: '#96588a',
	},
	category: 'woocommerce',
	keywords: [ __( 'WooCommerce', 'woocommerce' ) ],
	description: __(
		'Show a list of all product reviews.',
		'woocommerce'
	),
	supports: {
		html: false,
		color: {
			background: false,
		},
		typography: {
			fontSize: true,
		},
	},
	example: {
		...example,
		attributes: {
			...example.attributes,
			showProductName: true,
		},
	},
	attributes: {
		...sharedAttributes,
		/**
		 * Show the product name.
		 */
		showProductName: {
			type: 'boolean',
			default: true,
		},
	},

	transforms: {
		from: [
			{
				type: 'block',
				blocks: [ 'core/legacy-widget' ],
				// We can't transform if raw instance isn't shown in the REST API.
				isMatch: ( { idBase, instance } ) =>
					idBase === 'woocommerce_recent_reviews' && !! instance?.raw,
				transform: ( { instance } ) =>
					createBlock( 'woocommerce/all-reviews', {
						reviewsOnPageLoad: instance.raw.number,
						imageType: 'product',
						showLoadMore: false,
						showOrderby: false,
						showReviewDate: false,
						showReviewContent: false,
					} ),
			},
		],
	},

	edit,
	save,
} );
woocommerce-blocks/assets/js/blocks/reviews/all-reviews/no-reviews-placeholder.js000064400000001254151335517640024377 0ustar00/**
 * External dependencies
 */
import { __ } from '@wordpress/i18n';
import { Placeholder } from '@wordpress/components';
import { Icon, discussion } from '@woocommerce/icons';

const NoCategoryReviewsPlaceholder = () => {
	return (
		<Placeholder
			className="wc-block-all-reviews"
			icon={
				<Icon
					srcElement={ discussion }
					className="block-editor-block-icon"
				/>
			}
			label={ __( 'All Reviews', 'woocommerce' ) }
		>
			{ __(
				'This block shows a list of all product reviews. Your store does not have any reviews yet, but they will show up here when it does.',
				'woocommerce'
			) }
		</Placeholder>
	);
};

export default NoCategoryReviewsPlaceholder;
woocommerce-blocks/assets/js/blocks/reviews/attributes.js000064400000002526151335517640017760 0ustar00export default {
	/**
	 * Toggle for edit mode in the block preview.
	 */
	editMode: {
		type: 'boolean',
		default: true,
	},

	/**
	 * Whether to display the reviewer or product image.
	 */
	imageType: {
		type: 'string',
		default: 'reviewer',
	},

	/**
	 * Order to use for the reviews listing.
	 */
	orderby: {
		type: 'string',
		default: 'most-recent',
	},

	/**
	 * Number of reviews to add when clicking on load more.
	 */
	reviewsOnLoadMore: {
		type: 'number',
		default: 10,
	},

	/**
	 * Number of reviews to display on page load.
	 */
	reviewsOnPageLoad: {
		type: 'number',
		default: 10,
	},

	/**
	 * Show the load more button.
	 */
	showLoadMore: {
		type: 'boolean',
		default: true,
	},

	/**
	 * Show the order by selector.
	 */
	showOrderby: {
		type: 'boolean',
		default: true,
	},

	/**
	 * Show the review date.
	 */
	showReviewDate: {
		type: 'boolean',
		default: true,
	},

	/**
	 * Show the reviewer name.
	 */
	showReviewerName: {
		type: 'boolean',
		default: true,
	},

	/**
	 * Show the review image..
	 */
	showReviewImage: {
		type: 'boolean',
		default: true,
	},

	/**
	 * Show the product rating.
	 */
	showReviewRating: {
		type: 'boolean',
		default: true,
	},

	/**
	 * Show the product content.
	 */
	showReviewContent: {
		type: 'boolean',
		default: true,
	},

	previewReviews: {
		type: 'array',
		default: null,
	},
};
woocommerce-blocks/assets/js/blocks/reviews/reviews-by-product/edit.js000064400000011070151335517640022263 0ustar00/**
 * External dependencies
 */
import { __, _n, sprintf } from '@wordpress/i18n';
import { InspectorControls } from '@wordpress/block-editor';
import {
	Button,
	PanelBody,
	Placeholder,
	withSpokenMessages,
} from '@wordpress/components';
import { SearchListItem } from '@woocommerce/components';
import PropTypes from 'prop-types';
import ProductControl from '@woocommerce/editor-components/product-control';
import { Icon, comment } from '@woocommerce/icons';

/**
 * Internal dependencies
 */
import EditorContainerBlock from '../editor-container-block.js';
import NoReviewsPlaceholder from './no-reviews-placeholder.js';
import {
	getBlockControls,
	getSharedReviewContentControls,
	getSharedReviewListControls,
} from '../edit-utils.js';

/**
 * Component to handle edit mode of "Reviews by Product".
 *
 * @param {Object} props Incoming props for the component.
 * @param {Object} props.attributes Incoming block attributes.
 * @param {function(any):any} props.debouncedSpeak
 * @param {function(any):any} props.setAttributes Setter for block attributes.
 */
const ReviewsByProductEditor = ( {
	attributes,
	debouncedSpeak,
	setAttributes,
} ) => {
	const { editMode, productId } = attributes;

	const renderProductControlItem = ( args ) => {
		const { item = 0 } = args;

		return (
			<SearchListItem
				{ ...args }
				countLabel={ sprintf(
					/* translators: %d is the review count. */
					_n(
						'%d review',
						'%d reviews',
						item.review_count,
						'woocommerce'
					),
					item.review_count
				) }
				aria-label={ sprintf(
					/* translators: %1$s is the item name, and %2$d is the number of reviews for the item. */
					_n(
						'%1$s, has %2$d review',
						'%1$s, has %2$d reviews',
						item.review_count,
						'woocommerce'
					),
					item.name,
					item.review_count
				) }
			/>
		);
	};

	const getInspectorControls = () => {
		return (
			<InspectorControls key="inspector">
				<PanelBody
					title={ __( 'Product', 'woocommerce' ) }
					initialOpen={ false }
				>
					<ProductControl
						selected={ attributes.productId || 0 }
						onChange={ ( value = [] ) => {
							const id = value[ 0 ] ? value[ 0 ].id : 0;
							setAttributes( { productId: id } );
						} }
						renderItem={ renderProductControlItem }
						isCompact={ true }
					/>
				</PanelBody>
				<PanelBody
					title={ __( 'Content', 'woocommerce' ) }
				>
					{ getSharedReviewContentControls(
						attributes,
						setAttributes
					) }
				</PanelBody>
				<PanelBody
					title={ __(
						'List Settings',
						'woocommerce'
					) }
				>
					{ getSharedReviewListControls( attributes, setAttributes ) }
				</PanelBody>
			</InspectorControls>
		);
	};

	const renderEditMode = () => {
		const onDone = () => {
			setAttributes( { editMode: false } );
			debouncedSpeak(
				__(
					'Showing Reviews by Product block preview.',
					'woocommerce'
				)
			);
		};

		return (
			<Placeholder
				icon={
					<Icon
						icon={ comment }
						className="block-editor-block-icon"
					/>
				}
				label={ __(
					'Reviews by Product',
					'woocommerce'
				) }
				className="wc-block-reviews-by-product"
			>
				{ __(
					'Show reviews of your product to build trust',
					'woocommerce'
				) }
				<div className="wc-block-reviews__selection">
					<ProductControl
						selected={ attributes.productId || 0 }
						onChange={ ( value = [] ) => {
							const id = value[ 0 ] ? value[ 0 ].id : 0;
							setAttributes( { productId: id } );
						} }
						queryArgs={ {
							orderby: 'comment_count',
							order: 'desc',
						} }
						renderItem={ renderProductControlItem }
					/>
					<Button isPrimary onClick={ onDone }>
						{ __( 'Done', 'woocommerce' ) }
					</Button>
				</div>
			</Placeholder>
		);
	};

	if ( ! productId || editMode ) {
		return renderEditMode();
	}

	return (
		<>
			{ getBlockControls( editMode, setAttributes ) }
			{ getInspectorControls() }
			<EditorContainerBlock
				attributes={ attributes }
				icon={
					<Icon
						icon={ comment }
						className="block-editor-block-icon"
					/>
				}
				name={ __(
					'Reviews by Product',
					'woocommerce'
				) }
				noReviewsPlaceholder={ NoReviewsPlaceholder }
			/>
		</>
	);
};

ReviewsByProductEditor.propTypes = {
	/**
	 * The attributes for this block.
	 */
	attributes: PropTypes.object.isRequired,
	/**
	 * The register block name.
	 */
	name: PropTypes.string.isRequired,
	/**
	 * A callback to update attributes.
	 */
	setAttributes: PropTypes.func.isRequired,
	// from withSpokenMessages
	debouncedSpeak: PropTypes.func.isRequired,
};

export default withSpokenMessages( ReviewsByProductEditor );
woocommerce-blocks/assets/js/blocks/reviews/reviews-by-product/editor.scss000064400000000302151335517640023157 0ustar00.components-base-control {
	+ .wc-block-reviews-by-product__notice {
		margin: -$gap 0 $gap;
	}

	&:nth-last-child(2) + .wc-block-reviews-by-product__notice {
		margin: -$gap 0 $gap-small;
	}
}
woocommerce-blocks/assets/js/blocks/reviews/reviews-by-product/no-reviews-placeholder.js000064400000002763151335517640025725 0ustar00/**
 * External dependencies
 */
import { __, sprintf } from '@wordpress/i18n';
import { Placeholder, Spinner } from '@wordpress/components';
import PropTypes from 'prop-types';
import ErrorPlaceholder from '@woocommerce/editor-components/error-placeholder';
import { Icon, comment } from '@woocommerce/icons';
import { withProduct } from '@woocommerce/block-hocs';

const NoReviewsPlaceholder = ( { error, getProduct, isLoading, product } ) => {
	const renderApiError = () => (
		<ErrorPlaceholder
			className="wc-block-featured-product-error"
			error={ error }
			isLoading={ isLoading }
			onRetry={ getProduct }
		/>
	);

	if ( error ) {
		return renderApiError();
	}

	const content =
		! product || isLoading ? (
			<Spinner />
		) : (
			sprintf(
				/* translators: %s is the product name. */
				__(
					"This block lists reviews for a selected product. %s doesn't have any reviews yet, but they will show up here when it does.",
					'woocommerce'
				),
				product.name
			)
		);

	return (
		<Placeholder
			className="wc-block-reviews-by-product"
			icon={
				<Icon
					srcElement={ comment }
					className="block-editor-block-icon"
				/>
			}
			label={ __( 'Reviews by Product', 'woocommerce' ) }
		>
			{ content }
		</Placeholder>
	);
};

NoReviewsPlaceholder.propTypes = {
	// from withProduct
	error: PropTypes.object,
	isLoading: PropTypes.bool,
	product: PropTypes.shape( {
		name: PropTypes.node,
		review_count: PropTypes.number,
	} ),
};

export default withProduct( NoReviewsPlaceholder );
woocommerce-blocks/assets/js/blocks/reviews/reviews-by-product/index.js000064400000002526151335517640022453 0ustar00/**
 * External dependencies
 */
import { __ } from '@wordpress/i18n';
import { registerBlockType } from '@wordpress/blocks';
import { Icon, comment } from '@woocommerce/icons';
/**
 * Internal dependencies
 */
import '../editor.scss';
import Editor from './edit';
import sharedAttributes from '../attributes';
import save from '../save.js';
import { example } from '../example';

/**
 * Register and run the "Reviews by Product" block.
 */
registerBlockType( 'woocommerce/reviews-by-product', {
	apiVersion: 2,
	title: __( 'Reviews by Product', 'woocommerce' ),
	icon: {
		src: <Icon srcElement={ comment } />,
		foreground: '#96588a',
	},
	category: 'woocommerce',
	keywords: [ __( 'WooCommerce', 'woocommerce' ) ],
	description: __(
		'Show reviews of your products to build trust.',
		'woocommerce'
	),
	supports: {
		html: false,
		color: {
			background: false,
		},
		typography: {
			fontSize: true,
		},
	},
	example: {
		...example,
		attributes: {
			...example.attributes,
			productId: 1,
		},
	},
	attributes: {
		...sharedAttributes,
		/**
		 * The id of the product to load reviews for.
		 */
		productId: {
			type: 'number',
		},
	},

	/**
	 * Renders and manages the block.
	 *
	 * @param {Object} props Props to pass to block.
	 */
	edit( props ) {
		return <Editor { ...props } />;
	},

	/**
	 * Save the props to post content.
	 */
	save,
} );
woocommerce-blocks/assets/js/blocks/reviews/editor-container-block.js000064400000003475151335517640022134 0ustar00/**
 * External dependencies
 */
import { __ } from '@wordpress/i18n';
import PropTypes from 'prop-types';
import { debounce } from 'lodash';
import { Placeholder } from '@wordpress/components';
import { useBlockProps } from '@wordpress/block-editor';

/**
 * Internal dependencies
 */
import EditorBlock from './editor-block.js';
import { getBlockClassName, getSortArgs } from './utils.js';

const EditorContainerBlock = ( {
	attributes,
	icon,
	name,
	noReviewsPlaceholder,
} ) => {
	const {
		categoryIds,
		productId,
		reviewsOnPageLoad,
		showProductName,
		showReviewDate,
		showReviewerName,
		showReviewContent,
		showReviewImage,
		showReviewRating,
	} = attributes;
	const { order, orderby } = getSortArgs( attributes.orderby );
	const isAllContentHidden =
		! showReviewContent &&
		! showReviewRating &&
		! showReviewDate &&
		! showReviewerName &&
		! showReviewImage &&
		! showProductName;

	const blockProps = useBlockProps( {
		className: getBlockClassName( attributes ),
	} );

	if ( isAllContentHidden ) {
		return (
			<Placeholder icon={ icon } label={ name }>
				{ __(
					'The content for this block is hidden due to block settings.',
					'woocommerce'
				) }
			</Placeholder>
		);
	}

	return (
		<div { ...blockProps }>
			<EditorBlock
				attributes={ attributes }
				categoryIds={ categoryIds }
				delayFunction={ ( callback ) => debounce( callback, 400 ) }
				noReviewsPlaceholder={ noReviewsPlaceholder }
				orderby={ orderby }
				order={ order }
				productId={ productId }
				reviewsToDisplay={ reviewsOnPageLoad }
			/>
		</div>
	);
};

EditorContainerBlock.propTypes = {
	attributes: PropTypes.object.isRequired,
	icon: PropTypes.node.isRequired,
	name: PropTypes.string.isRequired,
	noReviewsPlaceholder: PropTypes.element.isRequired,
	className: PropTypes.string,
};

export default EditorContainerBlock;
woocommerce-blocks/assets/js/blocks/reviews/frontend-container-block.js000064400000004721151335517640022460 0ustar00/**
 * External dependencies
 */
import { __, _n, sprintf } from '@wordpress/i18n';
import { speak } from '@wordpress/a11y';
import { Component } from 'react';
import PropTypes from 'prop-types';

/**
 * Internal dependencies
 */
import { getSortArgs } from './utils';
import FrontendBlock from './frontend-block';

/**
 * Container of the block rendered in the frontend.
 */
class FrontendContainerBlock extends Component {
	constructor() {
		super( ...arguments );
		const { attributes } = this.props;

		this.state = {
			orderby: attributes.orderby,
			reviewsToDisplay: parseInt( attributes.reviewsOnPageLoad, 10 ),
		};

		this.onAppendReviews = this.onAppendReviews.bind( this );
		this.onChangeOrderby = this.onChangeOrderby.bind( this );
	}

	onAppendReviews() {
		const { attributes } = this.props;
		const { reviewsToDisplay } = this.state;

		this.setState( {
			reviewsToDisplay:
				reviewsToDisplay + parseInt( attributes.reviewsOnLoadMore, 10 ),
		} );
	}

	onChangeOrderby( event ) {
		const { attributes } = this.props;

		this.setState( {
			orderby: event.target.value,
			reviewsToDisplay: parseInt( attributes.reviewsOnPageLoad, 10 ),
		} );
	}

	onReviewsAppended( { newReviews } ) {
		speak(
			sprintf(
				/* translators: %d is the count of reviews loaded. */
				_n(
					'%d review loaded.',
					'%d reviews loaded.',
					newReviews.length,
					'woocommerce'
				),
				newReviews.length
			)
		);
	}

	onReviewsReplaced() {
		speak( __( 'Reviews list updated.', 'woocommerce' ) );
	}

	onReviewsLoadError() {
		speak(
			__(
				'There was an error loading the reviews.',
				'woocommerce'
			)
		);
	}

	render() {
		const { attributes } = this.props;
		const { categoryIds, productId } = attributes;
		const { reviewsToDisplay } = this.state;
		const { order, orderby } = getSortArgs( this.state.orderby );

		return (
			<FrontendBlock
				attributes={ attributes }
				categoryIds={ categoryIds }
				onAppendReviews={ this.onAppendReviews }
				onChangeOrderby={ this.onChangeOrderby }
				onReviewsAppended={ this.onReviewsAppended }
				onReviewsLoadError={ this.onReviewsLoadError }
				onReviewsReplaced={ this.onReviewsReplaced }
				order={ order }
				orderby={ orderby }
				productId={ productId }
				reviewsToDisplay={ reviewsToDisplay }
				sortSelectValue={ this.state.orderby }
			/>
		);
	}
}

FrontendContainerBlock.propTypes = {
	/**
	 * The attributes for this block.
	 */
	attributes: PropTypes.object.isRequired,
};

export default FrontendContainerBlock;
woocommerce-blocks/assets/js/blocks/reviews/save.js000064400000000623151335517640016524 0ustar00/**
 * External dependencies
 */
import { useBlockProps } from '@wordpress/block-editor';

/**
 * Internal dependencies
 */
import './editor.scss';
import { getBlockClassName, getDataAttrs } from './utils.js';

export default ( { attributes } ) => {
	return (
		<div
			{ ...useBlockProps.save( {
				className: getBlockClassName( attributes ),
			} ) }
			{ ...getDataAttrs( attributes ) }
		/>
	);
};
woocommerce-blocks/assets/js/blocks/reviews/frontend-block.js000064400000003537151335517640020504 0ustar00/**
 * External dependencies
 */
import { __ } from '@wordpress/i18n';
import PropTypes from 'prop-types';
import { getSetting } from '@woocommerce/settings';
import LoadMoreButton from '@woocommerce/base-components/load-more-button';
import {
	ReviewList,
	ReviewSortSelect,
} from '@woocommerce/base-components/reviews';
import withReviews from '@woocommerce/base-hocs/with-reviews';

/**
 * Block rendered in the frontend.
 *
 * @param {Object} props Incoming props for the component.
 * @param {Object} props.attributes Incoming block attributes.
 * @param {function(any):any} props.onAppendReviews Function called when appending review.
 * @param {function(any):any} props.onChangeOrderby
 * @param {Array} props.reviews
 * @param {string} props.sortSelectValue
 * @param {number} props.totalReviews
 */
const FrontendBlock = ( {
	attributes,
	onAppendReviews,
	onChangeOrderby,
	reviews,
	sortSelectValue,
	totalReviews,
} ) => {
	if ( reviews.length === 0 ) {
		return null;
	}

	const reviewRatingsEnabled = getSetting( 'reviewRatingsEnabled', true );

	return (
		<>
			{ attributes.showOrderby !== 'false' && reviewRatingsEnabled && (
				<ReviewSortSelect
					value={ sortSelectValue }
					onChange={ onChangeOrderby }
				/>
			) }
			<ReviewList attributes={ attributes } reviews={ reviews } />
			{ attributes.showLoadMore !== 'false' &&
				totalReviews > reviews.length && (
					<LoadMoreButton
						onClick={ onAppendReviews }
						screenReaderLabel={ __(
							'Load more reviews',
							'woocommerce'
						) }
					/>
				) }
		</>
	);
};

FrontendBlock.propTypes = {
	/**
	 * The attributes for this block.
	 */
	attributes: PropTypes.object.isRequired,
	onAppendReviews: PropTypes.func,
	onChangeArgs: PropTypes.func,
	// from withReviewsattributes
	reviews: PropTypes.array,
	totalReviews: PropTypes.number,
};

export default withReviews( FrontendBlock );
woocommerce-blocks/assets/js/blocks/reviews/editor-block.js000064400000003447151335517640020153 0ustar00/**
 * External dependencies
 */
import { __ } from '@wordpress/i18n';
import { Component } from 'react';
import PropTypes from 'prop-types';
import { Disabled } from '@wordpress/components';
import { getSetting } from '@woocommerce/settings';
import ErrorPlaceholder from '@woocommerce/editor-components/error-placeholder';
import LoadMoreButton from '@woocommerce/base-components/load-more-button';
import {
	ReviewList,
	ReviewSortSelect,
} from '@woocommerce/base-components/reviews';
import withReviews from '@woocommerce/base-hocs/with-reviews';

/**
 * Block rendered in the editor.
 */
class EditorBlock extends Component {
	static propTypes = {
		/**
		 * The attributes for this block.
		 */
		attributes: PropTypes.object.isRequired,
		// from withReviews
		reviews: PropTypes.array,
		totalReviews: PropTypes.number,
	};

	render() {
		const {
			attributes,
			error,
			isLoading,
			noReviewsPlaceholder: NoReviewsPlaceholder,
			reviews,
			totalReviews,
		} = this.props;

		if ( error ) {
			return (
				<ErrorPlaceholder
					className="wc-block-featured-product-error"
					error={ error }
					isLoading={ isLoading }
				/>
			);
		}

		if ( reviews.length === 0 && ! isLoading ) {
			return <NoReviewsPlaceholder attributes={ attributes } />;
		}

		const reviewRatingsEnabled = getSetting( 'reviewRatingsEnabled', true );

		return (
			<Disabled>
				{ attributes.showOrderby && reviewRatingsEnabled && (
					<ReviewSortSelect readOnly value={ attributes.orderby } />
				) }
				<ReviewList attributes={ attributes } reviews={ reviews } />
				{ attributes.showLoadMore && totalReviews > reviews.length && (
					<LoadMoreButton
						screenReaderLabel={ __(
							'Load more reviews',
							'woocommerce'
						) }
					/>
				) }
			</Disabled>
		);
	}
}

export default withReviews( EditorBlock );
woocommerce-blocks/assets/js/blocks/reviews/reviews-by-category/no-reviews-placeholder.js000064400000001311151335517640026046 0ustar00/**
 * External dependencies
 */
import { __ } from '@wordpress/i18n';
import { Placeholder } from '@wordpress/components';
import { Icon, review } from '@woocommerce/icons';
const NoReviewsPlaceholder = () => {
	return (
		<Placeholder
			className="wc-block-reviews-by-category"
			icon={
				<Icon
					srcElement={ review }
					className="block-editor-block-icon"
				/>
			}
			label={ __(
				'Reviews by Category',
				'woocommerce'
			) }
		>
			{ __(
				'This block lists reviews for products from selected categories. The selected categories do not have any reviews yet, but they will show up here when they do.',
				'woocommerce'
			) }
		</Placeholder>
	);
};

export default NoReviewsPlaceholder;
woocommerce-blocks/assets/js/blocks/reviews/reviews-by-category/index.js000064400000002735151335517640022612 0ustar00/**
 * External dependencies
 */
import { __ } from '@wordpress/i18n';
import { registerBlockType } from '@wordpress/blocks';
import { Icon, review } from '@woocommerce/icons';

/**
 * Internal dependencies
 */
import Editor from './edit';
import sharedAttributes from '../attributes';
import save from '../save.js';
import { example } from '../example';

/**
 * Register and run the "Reviews by category" block.
 */
registerBlockType( 'woocommerce/reviews-by-category', {
	apiVersion: 2,
	title: __( 'Reviews by Category', 'woocommerce' ),
	icon: {
		src: <Icon srcElement={ review } />,
		foreground: '#96588a',
	},
	category: 'woocommerce',
	keywords: [ __( 'WooCommerce', 'woocommerce' ) ],
	description: __(
		'Show product reviews from specific categories.',
		'woocommerce'
	),
	supports: {
		html: false,
		color: {
			background: false,
		},
		typography: {
			fontSize: true,
		},
	},
	example: {
		...example,
		attributes: {
			...example.attributes,
			categoryIds: [ 1 ],
			showProductName: true,
		},
	},
	attributes: {
		...sharedAttributes,
		/**
		 * The ids of the categories to load reviews for.
		 */
		categoryIds: {
			type: 'array',
			default: [],
		},
		/**
		 * Show the product name.
		 */
		showProductName: {
			type: 'boolean',
			default: true,
		},
	},

	/**
	 * Renders and manages the block.
	 *
	 * @param {Object} props Props to pass to block.
	 */
	edit( props ) {
		return <Editor { ...props } />;
	},

	/**
	 * Save the props to post content.
	 */
	save,
} );
woocommerce-blocks/assets/js/blocks/reviews/reviews-by-category/edit.js000064400000010123151335517640022416 0ustar00/**
 * External dependencies
 */
import { __ } from '@wordpress/i18n';
import { InspectorControls } from '@wordpress/block-editor';
import {
	Button,
	PanelBody,
	Placeholder,
	ToggleControl,
	withSpokenMessages,
} from '@wordpress/components';
import PropTypes from 'prop-types';
import ProductCategoryControl from '@woocommerce/editor-components/product-category-control';
import { Icon, review } from '@woocommerce/icons';

/**
 * Internal dependencies
 */
import EditorContainerBlock from '../editor-container-block.js';
import NoReviewsPlaceholder from './no-reviews-placeholder.js';
import {
	getBlockControls,
	getSharedReviewContentControls,
	getSharedReviewListControls,
} from '../edit-utils.js';

/**
 * Component to handle edit mode of "Reviews by Category".
 *
 * @param {Object} props Incoming props for the component.
 * @param {Object} props.attributes Incoming block attributes.
 * @param {function(any):any} props.debouncedSpeak
 * @param {function(any):any} props.setAttributes Setter for block attributes.
 */
const ReviewsByCategoryEditor = ( {
	attributes,
	debouncedSpeak,
	setAttributes,
} ) => {
	const { editMode, categoryIds } = attributes;

	const getInspectorControls = () => {
		return (
			<InspectorControls key="inspector">
				<PanelBody
					title={ __( 'Category', 'woocommerce' ) }
					initialOpen={ false }
				>
					<ProductCategoryControl
						selected={ attributes.categoryIds }
						onChange={ ( value = [] ) => {
							const ids = value.map( ( { id } ) => id );
							setAttributes( { categoryIds: ids } );
						} }
						isCompact={ true }
						showReviewCount={ true }
					/>
				</PanelBody>
				<PanelBody
					title={ __( 'Content', 'woocommerce' ) }
				>
					<ToggleControl
						label={ __(
							'Product name',
							'woocommerce'
						) }
						checked={ attributes.showProductName }
						onChange={ () =>
							setAttributes( {
								showProductName: ! attributes.showProductName,
							} )
						}
					/>
					{ getSharedReviewContentControls(
						attributes,
						setAttributes
					) }
				</PanelBody>
				<PanelBody
					title={ __(
						'List Settings',
						'woocommerce'
					) }
				>
					{ getSharedReviewListControls( attributes, setAttributes ) }
				</PanelBody>
			</InspectorControls>
		);
	};

	const renderEditMode = () => {
		const onDone = () => {
			setAttributes( { editMode: false } );
			debouncedSpeak(
				__(
					'Showing Reviews by Category block preview.',
					'woocommerce'
				)
			);
		};

		return (
			<Placeholder
				icon={
					<Icon
						srcElement={ review }
						className="block-editor-block-icon"
					/>
				}
				label={ __(
					'Reviews by Category',
					'woocommerce'
				) }
				className="wc-block-reviews-by-category"
			>
				{ __(
					'Show product reviews from specific categories.',
					'woocommerce'
				) }
				<div className="wc-block-reviews__selection">
					<ProductCategoryControl
						selected={ attributes.categoryIds }
						onChange={ ( value = [] ) => {
							const ids = value.map( ( { id } ) => id );
							setAttributes( { categoryIds: ids } );
						} }
						showReviewCount={ true }
					/>
					<Button isPrimary onClick={ onDone }>
						{ __( 'Done', 'woocommerce' ) }
					</Button>
				</div>
			</Placeholder>
		);
	};

	if ( ! categoryIds || editMode ) {
		return renderEditMode();
	}

	return (
		<>
			{ getBlockControls( editMode, setAttributes ) }
			{ getInspectorControls() }
			<EditorContainerBlock
				attributes={ attributes }
				icon={
					<Icon
						srcElement={ review }
						className="block-editor-block-icon"
					/>
				}
				name={ __(
					'Reviews by Category',
					'woocommerce'
				) }
				noReviewsPlaceholder={ NoReviewsPlaceholder }
			/>
		</>
	);
};

ReviewsByCategoryEditor.propTypes = {
	/**
	 * The attributes for this block.
	 */
	attributes: PropTypes.object.isRequired,
	/**
	 * The register block name.
	 */
	name: PropTypes.string.isRequired,
	/**
	 * A callback to update attributes.
	 */
	setAttributes: PropTypes.func.isRequired,
	// from withSpokenMessages
	debouncedSpeak: PropTypes.func.isRequired,
};

export default withSpokenMessages( ReviewsByCategoryEditor );
woocommerce-blocks/assets/js/blocks/reviews/editor.scss000064400000000057151335517640017414 0ustar00.wc-block-reviews__selection {
	width: 100%;
}
woocommerce-blocks/assets/js/blocks/products/utils.js000064400000001062151335517640017103 0ustar00/**
 * External dependencies
 */
import classNames from 'classnames';

export const getBlockClassName = ( blockClassName, attributes ) => {
	const { className, contentVisibility } = attributes;

	return classNames( blockClassName, className, {
		'has-image': contentVisibility && contentVisibility.image,
		'has-title': contentVisibility && contentVisibility.title,
		'has-rating': contentVisibility && contentVisibility.rating,
		'has-price': contentVisibility && contentVisibility.price,
		'has-button': contentVisibility && contentVisibility.button,
	} );
};
woocommerce-blocks/assets/js/blocks/products/all-products/frontend.js000064400000001363151335517640022177 0ustar00/**
 * External dependencies
 */
import { withRestApiHydration } from '@woocommerce/block-hocs';
import { StoreNoticesProvider } from '@woocommerce/base-context';
import { renderFrontend } from '@woocommerce/base-utils';

/**
 * Internal dependencies
 */
import Block from './block';

/**
 * Wrapper component to supply the notice provider.
 *
 * @param {*} props
 */
const AllProductsFrontend = ( props ) => {
	return (
		<StoreNoticesProvider context="wc/all-products">
			<Block { ...props } />
		</StoreNoticesProvider>
	);
};

const getProps = ( el ) => ( {
	attributes: JSON.parse( el.dataset.attributes ),
} );

renderFrontend( {
	selector: '.wp-block-woocommerce-all-products',
	Block: withRestApiHydration( AllProductsFrontend ),
	getProps,
} );
woocommerce-blocks/assets/js/blocks/products/all-products/block.js000064400000002056151335517640021452 0ustar00/**
 * External dependencies
 */
import { Component } from 'react';
import PropTypes from 'prop-types';
import { ProductListContainer } from '@woocommerce/base-components/product-list';
import { InnerBlockLayoutContextProvider } from '@woocommerce/shared-context';
import { gridBlockPreview } from '@woocommerce/resource-previews';

/**
 * The All Products Block.
 */
class Block extends Component {
	static propTypes = {
		/**
		 * The attributes for this block.
		 */
		attributes: PropTypes.object.isRequired,
	};

	render() {
		const { attributes, urlParameterSuffix } = this.props;

		if ( attributes.isPreview ) {
			return gridBlockPreview;
		}

		/**
		 * Todo classes
		 *
		 * wp-block-{$this->block_name},
		 * wc-block-{$this->block_name},
		 */
		return (
			<InnerBlockLayoutContextProvider
				parentName="woocommerce/all-products"
				parentClassName="wc-block-grid"
			>
				<ProductListContainer
					attributes={ attributes }
					urlParameterSuffix={ urlParameterSuffix }
				/>
			</InnerBlockLayoutContextProvider>
		);
	}
}

export default Block;
woocommerce-blocks/assets/js/blocks/products/all-products/editor.scss000064400000004135151335517640022205 0ustar00.wc-block-products {
	.components-placeholder__instructions {
		border-bottom: 1px solid #e0e2e6;
		width: 100%;
		padding-bottom: 1em;
		margin-bottom: 2em;
	}
	.components-placeholder__label svg {
		fill: currentColor;
		margin-right: 1ch;
	}
	.components-placeholder__fieldset {
		display: block; /* Disable flex box */
	}
	.wc-block-products__add-product-button {
		margin: 0 0 1em;
		vertical-align: middle;
		height: auto;
		padding: 0.5em 1em;

		svg {
			fill: currentColor;
			margin-left: 0.5ch;
			vertical-align: middle;
		}
	}
	.wc-block-products__read_more_button {
		display: block;
		margin-bottom: 1em;
	}
}

// Edit view for product list.
.wc-block-all-products {
	.components-placeholder__fieldset {
		max-width: initial;
		overflow: hidden;
	}
	.wc-block-all-products-grid-item-template {
		border-top: 1px solid $gray-200;
		margin-top: 20px;
		width: 100%;
		overflow: hidden;
		text-align: center;

		.components-tip {
			max-width: 450px;
			margin: 20px auto;
			text-align: left;

			p {
				margin: 1em 0;
			}
		}

		.wc-block-all-products__actions {
			display: flex;
			margin: 20px auto;
			padding: 1em 0 0;
			align-items: center;
			vertical-align: middle;
			max-width: 450px;
			.wc-block-all-products__done-button {
				margin: 0;
				order: 3;
				line-height: 32px;
				height: auto;
			}
			.wc-block-all-products__cancel-button {
				margin: 0 1em 0 auto;
				order: 2;
			}
			.wc-block-all-products__reset-button {
				margin: 0;
				order: 1;
			}
		}

		.wc-block-grid__products {
			margin: 0 auto !important;
			text-align: center;
			position: relative;
			max-width: 450px;
		}
		.wc-block-grid__product {
			padding: 1px 20px;
			margin: 0 auto;
			background: #fff;
			box-shadow: 0 5px 7px -2px rgba(0, 0, 0, 0.2);
			position: static;

			.wp-block-button__link {
				margin-top: 0;
			}

			&::before,
			&::after {
				content: "";
				background: $gray-200;
				display: block;
				position: absolute;
				width: 100%;
				top: 20px;
				bottom: 20px;
			}
			&::before {
				right: 100%;
				margin-right: 30px;
			}
			&::after {
				left: 100%;
				margin-left: 30px;
			}
		}
	}
}
woocommerce-blocks/assets/js/blocks/products/all-products/edit.js000064400000017330151335517640021306 0ustar00/**
 * External dependencies
 */
import { __ } from '@wordpress/i18n';
import { createBlock } from '@wordpress/blocks';
import {
	BlockControls,
	InnerBlocks,
	InspectorControls,
} from '@wordpress/block-editor';
import { withDispatch, withSelect } from '@wordpress/data';
import {
	PanelBody,
	withSpokenMessages,
	Placeholder,
	Button,
	ToolbarGroup,
	Disabled,
	Tip,
} from '@wordpress/components';
import { Component } from '@wordpress/element';
import { compose } from '@wordpress/compose';
import PropTypes from 'prop-types';
import { Icon, grid } from '@woocommerce/icons';
import GridLayoutControl from '@woocommerce/editor-components/grid-layout-control';
import {
	InnerBlockLayoutContextProvider,
	ProductDataContextProvider,
} from '@woocommerce/shared-context';
import { getBlockMap } from '@woocommerce/atomic-utils';
import { previewProducts } from '@woocommerce/resource-previews';
import { getSetting } from '@woocommerce/settings';
import { blocksConfig } from '@woocommerce/block-settings';

/**
 * Internal dependencies
 */
import { getBlockClassName } from '../utils';
import {
	renderHiddenContentPlaceholder,
	renderNoProductsPlaceholder,
} from '../edit-utils';
import {
	DEFAULT_PRODUCT_LIST_LAYOUT,
	getProductLayoutConfig,
} from '../base-utils';
import { getSharedContentControls, getSharedListControls } from '../edit';
import Block from './block';
import './editor.scss';

/**
 * Component to handle edit mode of "All Products".
 */
class Editor extends Component {
	static propTypes = {
		/**
		 * The attributes for this block.
		 */
		attributes: PropTypes.object.isRequired,
		/**
		 * A callback to update attributes.
		 */
		setAttributes: PropTypes.func.isRequired,
		/**
		 * From withSpokenMessages.
		 */
		debouncedSpeak: PropTypes.func.isRequired,
	};

	state = {
		isEditing: false,
		innerBlocks: [],
	};

	blockMap = getBlockMap( 'woocommerce/all-products' );

	componentDidMount = () => {
		const { block } = this.props;
		this.setState( { innerBlocks: block.innerBlocks } );
	};

	getTitle = () => {
		return __( 'All Products', 'woocommerce' );
	};

	getIcon = () => {
		return <Icon srcElement={ grid } />;
	};

	togglePreview = () => {
		const { debouncedSpeak } = this.props;

		this.setState( { isEditing: ! this.state.isEditing } );

		if ( ! this.state.isEditing ) {
			debouncedSpeak(
				__(
					'Showing All Products block preview.',
					'woocommerce'
				)
			);
		}
	};

	getInspectorControls = () => {
		const { attributes, setAttributes } = this.props;
		const { columns, rows, alignButtons } = attributes;

		return (
			<InspectorControls key="inspector">
				<PanelBody
					title={ __(
						'Layout Settings',
						'woocommerce'
					) }
					initialOpen
				>
					<GridLayoutControl
						columns={ columns }
						rows={ rows }
						alignButtons={ alignButtons }
						setAttributes={ setAttributes }
						minColumns={ getSetting( 'min_columns', 1 ) }
						maxColumns={ getSetting( 'max_columns', 6 ) }
						minRows={ getSetting( 'min_rows', 1 ) }
						maxRows={ getSetting( 'max_rows', 6 ) }
					/>
				</PanelBody>
				<PanelBody
					title={ __(
						'Content Settings',
						'woocommerce'
					) }
				>
					{ getSharedContentControls( attributes, setAttributes ) }
					{ getSharedListControls( attributes, setAttributes ) }
				</PanelBody>
			</InspectorControls>
		);
	};

	getBlockControls = () => {
		const { isEditing } = this.state;

		return (
			<BlockControls>
				<ToolbarGroup
					controls={ [
						{
							icon: 'edit',
							title: __( 'Edit', 'woocommerce' ),
							onClick: () => this.togglePreview(),
							isActive: isEditing,
						},
					] }
				/>
			</BlockControls>
		);
	};

	renderEditMode = () => {
		const onDone = () => {
			const { block, setAttributes } = this.props;
			setAttributes( {
				layoutConfig: getProductLayoutConfig( block.innerBlocks ),
			} );
			this.setState( { innerBlocks: block.innerBlocks } );
			this.togglePreview();
		};

		const onCancel = () => {
			const { block, replaceInnerBlocks } = this.props;
			const { innerBlocks } = this.state;
			replaceInnerBlocks( block.clientId, innerBlocks, false );
			this.togglePreview();
		};

		const onReset = () => {
			const { block, replaceInnerBlocks } = this.props;
			const newBlocks = [];
			DEFAULT_PRODUCT_LIST_LAYOUT.map( ( [ name, attributes ] ) => {
				newBlocks.push( createBlock( name, attributes ) );
				return true;
			} );
			replaceInnerBlocks( block.clientId, newBlocks, false );
			this.setState( { innerBlocks: block.innerBlocks } );
		};

		const InnerBlockProps = {
			template: this.props.attributes.layoutConfig,
			templateLock: false,
			allowedBlocks: Object.keys( this.blockMap ),
		};

		if ( this.props.attributes.layoutConfig.length !== 0 ) {
			InnerBlockProps.renderAppender = false;
		}

		return (
			<Placeholder icon={ this.getIcon() } label={ this.getTitle() }>
				{ __(
					'Display all products from your store as a grid.',
					'woocommerce'
				) }
				<div className="wc-block-all-products-grid-item-template">
					<Tip>
						{ __(
							'Edit the blocks inside the preview below to change the content displayed for each product within the product grid.',
							'woocommerce'
						) }
					</Tip>
					<InnerBlockLayoutContextProvider
						parentName="woocommerce/all-products"
						parentClassName="wc-block-grid"
					>
						<div className="wc-block-grid wc-block-layout has-1-columns">
							<ul className="wc-block-grid__products">
								<li className="wc-block-grid__product">
									<ProductDataContextProvider
										product={ previewProducts[ 0 ] }
									>
										<InnerBlocks { ...InnerBlockProps } />
									</ProductDataContextProvider>
								</li>
							</ul>
						</div>
					</InnerBlockLayoutContextProvider>
					<div className="wc-block-all-products__actions">
						<Button
							className="wc-block-all-products__done-button"
							isPrimary
							onClick={ onDone }
						>
							{ __( 'Done', 'woocommerce' ) }
						</Button>
						<Button
							className="wc-block-all-products__cancel-button"
							isTertiary
							onClick={ onCancel }
						>
							{ __( 'Cancel', 'woocommerce' ) }
						</Button>
						<Button
							className="wc-block-all-products__reset-button"
							icon={ <Icon srcElement={ grid } /> }
							label={ __(
								'Reset layout to default',
								'woocommerce'
							) }
							onClick={ onReset }
						>
							{ __(
								'Reset Layout',
								'woocommerce'
							) }
						</Button>
					</div>
				</div>
			</Placeholder>
		);
	};

	renderViewMode = () => {
		const { attributes } = this.props;
		const { layoutConfig } = attributes;
		const hasContent = layoutConfig && layoutConfig.length !== 0;
		const blockTitle = this.getTitle();
		const blockIcon = this.getIcon();

		if ( ! hasContent ) {
			return renderHiddenContentPlaceholder( blockTitle, blockIcon );
		}

		return (
			<Disabled>
				<Block attributes={ attributes } />
			</Disabled>
		);
	};

	render = () => {
		const { attributes } = this.props;
		const { isEditing } = this.state;
		const blockTitle = this.getTitle();
		const blockIcon = this.getIcon();

		if ( blocksConfig.productCount === 0 ) {
			return renderNoProductsPlaceholder( blockTitle, blockIcon );
		}

		return (
			<div
				className={ getBlockClassName(
					'wc-block-all-products',
					attributes
				) }
			>
				{ this.getBlockControls() }
				{ this.getInspectorControls() }
				{ isEditing ? this.renderEditMode() : this.renderViewMode() }
			</div>
		);
	};
}

export default compose(
	withSpokenMessages,
	withSelect( ( select, { clientId } ) => {
		const { getBlock } = select( 'core/block-editor' );
		return {
			block: getBlock( clientId ),
		};
	} ),
	withDispatch( ( dispatch ) => {
		const { replaceInnerBlocks } = dispatch( 'core/block-editor' );
		return {
			replaceInnerBlocks,
		};
	} )
)( Editor );
woocommerce-blocks/assets/js/blocks/products/all-products/index.js000064400000004306151335517640021467 0ustar00/**
 * External dependencies
 */
import { __ } from '@wordpress/i18n';
import { InnerBlocks } from '@wordpress/block-editor';
import { registerBlockType } from '@wordpress/blocks';
import { Icon, grid } from '@woocommerce/icons';
import '@woocommerce/atomic-blocks';

/**
 * Internal dependencies
 */
import Editor from './edit';
import { attributes as sharedAttributes, defaults } from '../attributes';
import { getBlockClassName } from '../utils.js';

export const blockSettings = {
	title: __( 'All Products', 'woocommerce' ),
	icon: {
		src: <Icon srcElement={ grid } />,
		foreground: '#96588a',
	},
	category: 'woocommerce',
	keywords: [ __( 'WooCommerce', 'woocommerce' ) ],
	description: __(
		'Display products from your store in a grid layout.',
		'woocommerce'
	),
	supports: {
		align: [ 'wide', 'full' ],
		html: false,
		multiple: false,
	},
	example: {
		attributes: {
			isPreview: true,
		},
	},
	attributes: sharedAttributes,
	defaults,
	/**
	 * Renders and manages the block.
	 *
	 * @param {Object} props Props to pass to block.
	 */
	edit( props ) {
		return <Editor { ...props } />;
	},
	// Save the props to post content.
	save( { attributes } ) {
		const dataAttributes = {};
		Object.keys( attributes )
			.sort()
			.forEach( ( key ) => {
				dataAttributes[ key ] = attributes[ key ];
			} );
		const data = {
			'data-attributes': JSON.stringify( dataAttributes ),
		};
		return (
			<div
				className={ getBlockClassName(
					'wc-block-all-products',
					attributes
				) }
				{ ...data }
			>
				<InnerBlocks.Content />
			</div>
		);
	},
};

/**
 * Register and run the "All Products" block.
 */
registerBlockType( 'woocommerce/all-products', {
	...blockSettings,
	/**
	 * Deprecation rule to handle the previous default rows which was 1 instead of 3.
	 */
	deprecated: [
		{
			attributes: Object.assign( {}, blockSettings.attributes, {
				rows: { type: 'number', default: 1 },
			} ),
			save( { attributes } ) {
				const data = {
					'data-attributes': JSON.stringify( attributes ),
				};
				return (
					<div
						className={ getBlockClassName(
							'wc-block-all-products',
							attributes
						) }
						{ ...data }
					>
						<InnerBlocks.Content />
					</div>
				);
			},
		},
	],
} );
woocommerce-blocks/assets/js/blocks/products/edit.js000064400000002654151335517640016700 0ustar00/**
 * External dependencies
 */
import { __ } from '@wordpress/i18n';
import { ToggleControl, SelectControl } from '@wordpress/components';

export const getSharedContentControls = ( attributes, setAttributes ) => {
	const { contentVisibility } = attributes;
	return (
		<ToggleControl
			label={ __(
				'Show Sorting Dropdown',
				'woocommerce'
			) }
			checked={ contentVisibility.orderBy }
			onChange={ () =>
				setAttributes( {
					contentVisibility: {
						...contentVisibility,
						orderBy: ! contentVisibility.orderBy,
					},
				} )
			}
		/>
	);
};

export const getSharedListControls = ( attributes, setAttributes ) => {
	return (
		<SelectControl
			label={ __( 'Order Products By', 'woocommerce' ) }
			value={ attributes.orderby }
			options={ [
				{
					label: __(
						'Default sorting (menu order)',
						'woocommerce'
					),
					value: 'menu_order',
				},
				{
					label: __( 'Popularity', 'woocommerce' ),
					value: 'popularity',
				},
				{
					label: __(
						'Average rating',
						'woocommerce'
					),
					value: 'rating',
				},
				{
					label: __( 'Latest', 'woocommerce' ),
					value: 'date',
				},
				{
					label: __(
						'Price: low to high',
						'woocommerce'
					),
					value: 'price',
				},
				{
					label: __(
						'Price: high to low',
						'woocommerce'
					),
					value: 'price-desc',
				},
			] }
			onChange={ ( orderby ) => setAttributes( { orderby } ) }
		/>
	);
};
woocommerce-blocks/assets/js/blocks/products/base-utils.js000064400000001421151335517640020012 0ustar00/**
 * The default layout built from the default template.
 */
export const DEFAULT_PRODUCT_LIST_LAYOUT = [
	[ 'woocommerce/product-image' ],
	[ 'woocommerce/product-title' ],
	[ 'woocommerce/product-price' ],
	[ 'woocommerce/product-rating' ],
	[ 'woocommerce/product-button' ],
];

/**
 * Converts innerblocks to a list of layout configs.
 *
 * @param {Object[]} innerBlocks Inner block components.
 */
export const getProductLayoutConfig = ( innerBlocks ) => {
	if ( ! innerBlocks || innerBlocks.length === 0 ) {
		return [];
	}

	return innerBlocks.map( ( block ) => {
		return [
			block.name,
			{
				...block.attributes,
				product: undefined,
				children:
					block.innerBlocks.length > 0
						? getProductLayoutConfig( block.innerBlocks )
						: [],
			},
		];
	} );
};
woocommerce-blocks/assets/js/blocks/products/edit-utils.js000064400000002347151335517640020035 0ustar00/**
 * External dependencies
 */
import { __ } from '@wordpress/i18n';
import { Button, Placeholder } from '@wordpress/components';
import { ADMIN_URL } from '@woocommerce/settings';
import { Icon, external } from '@woocommerce/icons';

export const renderNoProductsPlaceholder = ( blockTitle, blockIcon ) => (
	<Placeholder
		className="wc-block-products"
		icon={ blockIcon }
		label={ blockTitle }
	>
		<p>
			{ __(
				"You haven't published any products to list here yet.",
				'woocommerce'
			) }
		</p>
		<Button
			className="wc-block-products__add-product-button"
			isSecondary
			href={ ADMIN_URL + 'post-new.php?post_type=product' }
		>
			{ __( 'Add new product', 'woocommerce' ) + ' ' }
			<Icon srcElement={ external } />
		</Button>
		<Button
			className="wc-block-products__read_more_button"
			isTertiary
			href="https://docs.woocommerce.com/document/managing-products/"
		>
			{ __( 'Learn more', 'woocommerce' ) }
		</Button>
	</Placeholder>
);

export const renderHiddenContentPlaceholder = ( blockTitle, blockIcon ) => (
	<Placeholder
		className="wc-block-products"
		icon={ blockIcon }
		label={ blockTitle }
	>
		{ __(
			'The content for this block is hidden due to block settings.',
			'woocommerce'
		) }
	</Placeholder>
);
woocommerce-blocks/assets/js/blocks/products/attributes.js000064400000001761151335517640020137 0ustar00/**
 * External dependencies
 */
import { getSetting } from '@woocommerce/settings';

/**
 * Internal dependencies
 */
import { DEFAULT_PRODUCT_LIST_LAYOUT } from './base-utils';

export const defaults = {
	columns: getSetting( 'default_columns', 3 ),
	rows: getSetting( 'default_rows', 3 ),
	alignButtons: false,
	contentVisibility: {
		orderBy: true,
	},
	orderby: 'date',
	layoutConfig: DEFAULT_PRODUCT_LIST_LAYOUT,
	isPreview: false,
};

export const attributes = {
	/**
	 * Number of columns.
	 */
	columns: {
		type: 'number',
	},
	/**
	 * Number of rows.
	 */
	rows: {
		type: 'number',
	},
	/**
	 * How to align cart buttons.
	 */
	alignButtons: {
		type: 'boolean',
	},
	/**
	 * Content visibility setting
	 */
	contentVisibility: {
		type: 'object',
	},
	/**
	 * Order to use for the products listing.
	 */
	orderby: {
		type: 'string',
	},
	/**
	 * Layout config.
	 */
	layoutConfig: {
		type: 'array',
	},
	/**
	 * Are we previewing?
	 */
	isPreview: {
		type: 'boolean',
		default: false,
	},
};
woocommerce-blocks/assets/js/blocks/price-filter/block.js000064400000012275151335517640017567 0ustar00/**
 * External dependencies
 */
import { usePrevious } from '@woocommerce/base-hooks';
import {
	useQueryStateByKey,
	useQueryStateByContext,
	useCollectionData,
} from '@woocommerce/base-context/hooks';
import { useCallback, useState, useEffect } from '@wordpress/element';
import PriceSlider from '@woocommerce/base-components/price-slider';
import { useDebouncedCallback } from 'use-debounce';
import PropTypes from 'prop-types';
import { getCurrencyFromPriceResponse } from '@woocommerce/price-format';

/**
 * Internal dependencies
 */
import usePriceConstraints from './use-price-constraints.js';

/**
 * Component displaying a price filter.
 *
 * @param {Object} props Component props.
 * @param {Object} props.attributes Incoming block attributes.
 * @param {boolean} props.isEditor Whether in editor context or not.
 */
const PriceFilterBlock = ( { attributes, isEditor = false } ) => {
	const [ minPriceQuery, setMinPriceQuery ] = useQueryStateByKey(
		'min_price',
		null
	);
	const [ maxPriceQuery, setMaxPriceQuery ] = useQueryStateByKey(
		'max_price',
		null
	);
	const [ queryState ] = useQueryStateByContext();
	const { results, isLoading } = useCollectionData( {
		queryPrices: true,
		queryState,
	} );

	const [ minPrice, setMinPrice ] = useState();
	const [ maxPrice, setMaxPrice ] = useState();

	const currency = getCurrencyFromPriceResponse( results.price_range );

	const { minConstraint, maxConstraint } = usePriceConstraints( {
		minPrice: results.price_range
			? results.price_range.min_price
			: undefined,
		maxPrice: results.price_range
			? results.price_range.max_price
			: undefined,
		minorUnit: currency.minorUnit,
	} );

	// Updates the query based on slider values.
	const onSubmit = useCallback(
		( newMinPrice, newMaxPrice ) => {
			setMinPriceQuery(
				newMinPrice === minConstraint ? undefined : newMinPrice
			);
			setMaxPriceQuery(
				newMaxPrice === maxConstraint ? undefined : newMaxPrice
			);
		},
		[ minConstraint, maxConstraint, setMinPriceQuery, setMaxPriceQuery ]
	);

	// Updates the query after a short delay.
	const [ debouncedUpdateQuery ] = useDebouncedCallback( onSubmit, 500 );

	// Callback when slider or input fields are changed.
	const onChange = useCallback(
		( prices ) => {
			if ( prices[ 0 ] !== minPrice ) {
				setMinPrice( prices[ 0 ] );
			}
			if ( prices[ 1 ] !== maxPrice ) {
				setMaxPrice( prices[ 1 ] );
			}
		},
		[ minPrice, maxPrice, setMinPrice, setMaxPrice ]
	);

	// Track price STATE changes - if state changes, update the query.
	useEffect( () => {
		if ( ! attributes.showFilterButton ) {
			debouncedUpdateQuery( minPrice, maxPrice );
		}
	}, [
		minPrice,
		maxPrice,
		attributes.showFilterButton,
		debouncedUpdateQuery,
	] );

	// Track price query/price constraint changes so the slider reflects current filters.
	const previousMinPriceQuery = usePrevious( minPriceQuery );
	const previousMaxPriceQuery = usePrevious( maxPriceQuery );
	const previousMinConstraint = usePrevious( minConstraint );
	const previousMaxConstraint = usePrevious( maxConstraint );
	useEffect( () => {
		if (
			! Number.isFinite( minPrice ) ||
			( minPriceQuery !== previousMinPriceQuery && // minPrice from query changed
				minPriceQuery !== minPrice ) || // minPrice from query doesn't match the UI min price
			( minConstraint !== previousMinConstraint && // minPrice from query changed
				minConstraint !== minPrice ) // minPrice from query doesn't match the UI min price
		) {
			setMinPrice(
				Number.isFinite( minPriceQuery ) ? minPriceQuery : minConstraint
			);
		}
		if (
			! Number.isFinite( maxPrice ) ||
			( maxPriceQuery !== previousMaxPriceQuery && // maxPrice from query changed
				maxPriceQuery !== maxPrice ) || // maxPrice from query doesn't match the UI max price
			( maxConstraint !== previousMaxConstraint && // maxPrice from query changed
				maxConstraint !== maxPrice ) // maxPrice from query doesn't match the UI max price
		) {
			setMaxPrice(
				Number.isFinite( maxPriceQuery ) ? maxPriceQuery : maxConstraint
			);
		}
	}, [
		minPrice,
		maxPrice,
		minPriceQuery,
		maxPriceQuery,
		minConstraint,
		maxConstraint,
		previousMinConstraint,
		previousMaxConstraint,
		previousMinPriceQuery,
		previousMaxPriceQuery,
	] );

	if (
		! isLoading &&
		( minConstraint === null ||
			maxConstraint === null ||
			minConstraint === maxConstraint )
	) {
		return null;
	}

	const TagName = `h${ attributes.headingLevel }`;

	return (
		<>
			{ ! isEditor && attributes.heading && (
				<TagName className="wc-block-price-filter__title">
					{ attributes.heading }
				</TagName>
			) }
			<div className="wc-block-price-slider">
				<PriceSlider
					minConstraint={ minConstraint }
					maxConstraint={ maxConstraint }
					minPrice={ minPrice }
					maxPrice={ maxPrice }
					currency={ currency }
					showInputFields={ attributes.showInputFields }
					showFilterButton={ attributes.showFilterButton }
					onChange={ onChange }
					onSubmit={ () => onSubmit( minPrice, maxPrice ) }
					isLoading={ isLoading }
				/>
			</div>
		</>
	);
};

PriceFilterBlock.propTypes = {
	/**
	 * The attributes for this block.
	 */
	attributes: PropTypes.object.isRequired,
	/**
	 * Whether it's in the editor or frontend display.
	 */
	isEditor: PropTypes.bool,
};

export default PriceFilterBlock;
woocommerce-blocks/assets/js/blocks/price-filter/constants.js000064400000000114151335517640020476 0ustar00export const ROUND_UP = 'ROUND_UP';
export const ROUND_DOWN = 'ROUND_DOWN';
woocommerce-blocks/assets/js/blocks/price-filter/frontend.js000064400000001024151335517640020302 0ustar00/**
 * External dependencies
 */
import { withRestApiHydration } from '@woocommerce/block-hocs';
import { renderFrontend } from '@woocommerce/base-utils';

/**
 * Internal dependencies
 */
import Block from './block.js';

const getProps = ( el ) => {
	return {
		attributes: {
			showInputFields: el.dataset.showinputfields === 'true',
			showFilterButton: el.dataset.showfilterbutton === 'true',
		},
	};
};

renderFrontend( {
	selector: '.wp-block-woocommerce-price-filter',
	Block: withRestApiHydration( Block ),
	getProps,
} );
woocommerce-blocks/assets/js/blocks/price-filter/index.js000064400000003153151335517640017577 0ustar00/**
 * External dependencies
 */
import { __ } from '@wordpress/i18n';
import { registerBlockType } from '@wordpress/blocks';
import classNames from 'classnames';
import { Icon, bill } from '@woocommerce/icons';

/**
 * Internal dependencies
 */
import edit from './edit.js';

registerBlockType( 'woocommerce/price-filter', {
	title: __( 'Filter Products by Price', 'woocommerce' ),
	icon: {
		src: <Icon srcElement={ bill } />,
		foreground: '#96588a',
	},
	category: 'woocommerce',
	keywords: [ __( 'WooCommerce', 'woocommerce' ) ],
	description: __(
		'Allow customers to filter the products by choosing a lower or upper price limit. Works in combination with the All Products block.',
		'woocommerce'
	),
	supports: {
		html: false,
		multiple: false,
	},
	example: {},
	attributes: {
		showInputFields: {
			type: 'boolean',
			default: true,
		},
		showFilterButton: {
			type: 'boolean',
			default: false,
		},
		heading: {
			type: 'string',
			default: __( 'Filter by price', 'woocommerce' ),
		},
		headingLevel: {
			type: 'number',
			default: 3,
		},
	},

	edit,

	// Save the props to post content.
	save( { attributes } ) {
		const {
			className,
			showInputFields,
			showFilterButton,
			heading,
			headingLevel,
		} = attributes;
		const data = {
			'data-showinputfields': showInputFields,
			'data-showfilterbutton': showFilterButton,
			'data-heading': heading,
			'data-heading-level': headingLevel,
		};
		return (
			<div
				className={ classNames( 'is-loading', className ) }
				{ ...data }
			>
				<span
					aria-hidden
					className="wc-block-product-categories__placeholder"
				/>
			</div>
		);
	},
} );
woocommerce-blocks/assets/js/blocks/price-filter/edit.js000064400000007577151335517640017433 0ustar00/**
 * External dependencies
 */
import { __ } from '@wordpress/i18n';
import { InspectorControls } from '@wordpress/block-editor';
import {
	Placeholder,
	Disabled,
	PanelBody,
	ToggleControl,
	Button,
} from '@wordpress/components';
import { getAdminLink } from '@woocommerce/settings';
import { blocksConfig } from '@woocommerce/block-settings';
import HeadingToolbar from '@woocommerce/editor-components/heading-toolbar';
import BlockTitle from '@woocommerce/editor-components/block-title';
import ToggleButtonControl from '@woocommerce/editor-components/toggle-button-control';
import { Icon, bill, external } from '@woocommerce/icons';

/**
 * Internal dependencies
 */
import Block from './block.js';
import './editor.scss';

export default function ( { attributes, setAttributes } ) {
	const {
		className,
		heading,
		headingLevel,
		showInputFields,
		showFilterButton,
	} = attributes;

	const getInspectorControls = () => {
		return (
			<InspectorControls key="inspector">
				<PanelBody
					title={ __(
						'Block Settings',
						'woocommerce'
					) }
				>
					<ToggleButtonControl
						label={ __(
							'Price Range',
							'woocommerce'
						) }
						value={ showInputFields ? 'editable' : 'text' }
						options={ [
							{
								label: __(
									'Editable',
									'woocommerce'
								),
								value: 'editable',
							},
							{
								label: __(
									'Text',
									'woocommerce'
								),
								value: 'text',
							},
						] }
						onChange={ ( value ) =>
							setAttributes( {
								showInputFields: value === 'editable',
							} )
						}
					/>
					<ToggleControl
						label={ __(
							'Filter button',
							'woocommerce'
						) }
						help={
							showFilterButton
								? __(
										'Products will only update when the button is pressed.',
										'woocommerce'
								  )
								: __(
										'Products will update when the slider is moved.',
										'woocommerce'
								  )
						}
						checked={ showFilterButton }
						onChange={ () =>
							setAttributes( {
								showFilterButton: ! showFilterButton,
							} )
						}
					/>
					<p>
						{ __(
							'Heading Level',
							'woocommerce'
						) }
					</p>
					<HeadingToolbar
						isCollapsed={ false }
						minLevel={ 2 }
						maxLevel={ 7 }
						selectedLevel={ headingLevel }
						onChange={ ( newLevel ) =>
							setAttributes( { headingLevel: newLevel } )
						}
					/>
				</PanelBody>
			</InspectorControls>
		);
	};

	const noProductsPlaceholder = () => (
		<Placeholder
			className="wc-block-price-slider"
			icon={ <Icon srcElement={ bill } /> }
			label={ __(
				'Filter Products by Price',
				'woocommerce'
			) }
			instructions={ __(
				'Display a slider to filter products in your store by price.',
				'woocommerce'
			) }
		>
			<p>
				{ __(
					"Products with prices are needed for filtering by price. You haven't created any products yet.",
					'woocommerce'
				) }
			</p>
			<Button
				className="wc-block-price-slider__add-product-button"
				isSecondary
				href={ getAdminLink( 'post-new.php?post_type=product' ) }
			>
				{ __( 'Add new product', 'woocommerce' ) +
					' ' }
				<Icon srcElement={ external } />
			</Button>
			<Button
				className="wc-block-price-slider__read_more_button"
				isTertiary
				href="https://docs.woocommerce.com/document/managing-products/"
			>
				{ __( 'Learn more', 'woocommerce' ) }
			</Button>
		</Placeholder>
	);

	return (
		<>
			{ blocksConfig.productCount === 0 ? (
				noProductsPlaceholder()
			) : (
				<div className={ className }>
					{ getInspectorControls() }
					<BlockTitle
						className="wc-block-price-filter__title"
						headingLevel={ headingLevel }
						heading={ heading }
						onChange={ ( value ) =>
							setAttributes( { heading: value } )
						}
					/>
					<Disabled>
						<Block attributes={ attributes } isEditor={ true } />
					</Disabled>
				</div>
			) }
		</>
	);
}
woocommerce-blocks/assets/js/blocks/price-filter/editor.scss000064400000001571151335517640020317 0ustar00.components-disabled .wc-block-price-filter__range-input-wrapper .wc-block-price-filter__range-input {
	&::-webkit-slider-thumb {
		pointer-events: none;
	}
	&::-moz-range-thumb {
		pointer-events: none;
	}
	&::-ms-thumb {
		pointer-events: none;
	}
}
.wc-block-price-slider {
	.components-placeholder__instructions {
		border-bottom: 1px solid #e0e2e6;
		width: 100%;
		padding-bottom: 1em;
		margin-bottom: 2em;
	}
	.components-placeholder__label svg {
		fill: currentColor;
		margin-right: 1ch;
	}
	.components-placeholder__fieldset {
		display: block; /* Disable flex box */
	}
	.wc-block-price-slider__add-product-button {
		margin: 0 0 1em;
		vertical-align: middle;
		height: auto;
		padding: 0.5em 1em;

		svg {
			fill: currentColor;
			margin-left: 0.5ch;
			vertical-align: middle;
		}
	}
	.wc-block-price-slider__read_more_button {
		display: block;
		margin-bottom: 1em;
	}
}
woocommerce-blocks/assets/js/blocks/price-filter/test/use-price-constraints.js000064400000005063151335517640023712 0ustar00/**
 * External dependencies
 */
import TestRenderer from 'react-test-renderer';

/**
 * Internal dependencies
 */
import { usePriceConstraint } from '../use-price-constraints';
import { ROUND_UP, ROUND_DOWN } from '../constants';

describe( 'usePriceConstraints', () => {
	const TestComponent = ( { price } ) => {
		const maxPriceConstraint = usePriceConstraint( price, 2, ROUND_UP );
		const minPriceConstraint = usePriceConstraint( price, 2, ROUND_DOWN );
		return (
			<div
				minPriceConstraint={ minPriceConstraint }
				maxPriceConstraint={ maxPriceConstraint }
			/>
		);
	};

	it( 'max price constraint should be updated when new price is set', () => {
		const renderer = TestRenderer.create(
			<TestComponent price={ 1000 } />
		);
		const container = renderer.root.findByType( 'div' );

		expect( container.props.maxPriceConstraint ).toBe( 1000 );

		renderer.update( <TestComponent price={ 2000 } /> );

		expect( container.props.maxPriceConstraint ).toBe( 2000 );
	} );

	it( 'min price constraint should be updated when new price is set', () => {
		const renderer = TestRenderer.create(
			<TestComponent price={ 1000 } />
		);
		const container = renderer.root.findByType( 'div' );

		expect( container.props.minPriceConstraint ).toBe( 1000 );

		renderer.update( <TestComponent price={ 2000 } /> );

		expect( container.props.minPriceConstraint ).toBe( 2000 );
	} );

	it( 'previous price constraint should be preserved when new price is not a infinite number', () => {
		const renderer = TestRenderer.create(
			<TestComponent price={ 1000 } />
		);
		const container = renderer.root.findByType( 'div' );

		expect( container.props.maxPriceConstraint ).toBe( 1000 );

		renderer.update( <TestComponent price={ Infinity } /> );

		expect( container.props.maxPriceConstraint ).toBe( 1000 );
	} );

	it( 'max price constraint should be higher if the price is decimal', () => {
		const renderer = TestRenderer.create(
			<TestComponent price={ 1099 } />
		);
		const container = renderer.root.findByType( 'div' );

		expect( container.props.maxPriceConstraint ).toBe( 2000 );

		renderer.update( <TestComponent price={ 1999 } /> );

		expect( container.props.maxPriceConstraint ).toBe( 2000 );
	} );

	it( 'min price constraint should be lower if the price is decimal', () => {
		const renderer = TestRenderer.create( <TestComponent price={ 999 } /> );
		const container = renderer.root.findByType( 'div' );

		expect( container.props.minPriceConstraint ).toBe( 0 );

		renderer.update( <TestComponent price={ 1999 } /> );

		expect( container.props.minPriceConstraint ).toBe( 1000 );
	} );
} );
woocommerce-blocks/assets/js/blocks/price-filter/use-price-constraints.js000064400000002366151335517640022736 0ustar00/**
 * External dependencies
 */
import { usePrevious } from '@woocommerce/base-hooks';

/**
 * Internal dependencies
 */
import { ROUND_UP, ROUND_DOWN } from './constants';

/**
 * Return the price constraint.
 *
 * @param {number} price Price in minor unit, e.g. cents.
 * @param {number} minorUnit Price minor unit (number of digits after the decimal separator).
 * @param {ROUND_UP|ROUND_DOWN} direction Rounding flag whether we round up or down.
 */
export const usePriceConstraint = ( price, minorUnit, direction ) => {
	const step = 10 * 10 ** minorUnit;
	let currentConstraint;
	if ( direction === ROUND_UP ) {
		currentConstraint = isNaN( price )
			? null
			: Math.ceil( parseFloat( price, 10 ) / step ) * step;
	} else if ( direction === ROUND_DOWN ) {
		currentConstraint = isNaN( price )
			? null
			: Math.floor( parseFloat( price, 10 ) / step ) * step;
	}

	const previousConstraint = usePrevious(
		currentConstraint,
		Number.isFinite
	);
	return Number.isFinite( currentConstraint )
		? currentConstraint
		: previousConstraint;
};

export default ( { minPrice, maxPrice, minorUnit } ) => {
	return {
		minConstraint: usePriceConstraint( minPrice, minorUnit, ROUND_DOWN ),
		maxConstraint: usePriceConstraint( maxPrice, minorUnit, ROUND_UP ),
	};
};
woocommerce-blocks/assets/js/blocks/featured-product/example.js000064400000000625151335517640021014 0ustar00/**
 * External dependencies
 */
import { getSetting } from '@woocommerce/settings';
import { previewProducts } from '@woocommerce/resource-previews';

export const example = {
	attributes: {
		contentAlign: 'center',
		dimRatio: 50,
		editMode: false,
		height: getSetting( 'default_height', 500 ),
		mediaSrc: '',
		showDesc: true,
		productId: 'preview',
		previewProduct: previewProducts[ 0 ],
	},
};
woocommerce-blocks/assets/js/blocks/featured-product/style.scss000064400000005566151335517640021071 0ustar00.wc-block-featured-product {
	position: relative;
	background-color: $gray-900;
	background-size: cover;
	background-position: center center;
	width: 100%;
	margin: 0 0 1.5em 0;
	display: flex;
	justify-content: center;
	align-items: center;
	flex-wrap: wrap;
	align-content: center;

	.wc-block-featured-product__wrapper {
		overflow: hidden;
		height: 100%;
		display: flex;
		justify-content: center;
		align-items: center;
		flex-wrap: wrap;
		align-content: center;
	}

	&.has-left-content {
		justify-content: flex-start;

		.wc-block-featured-product__title,
		.wc-block-featured-product__variation,
		.wc-block-featured-product__description,
		.wc-block-featured-product__price {
			margin-left: 0;
			text-align: left;
		}
	}

	&.has-right-content {
		justify-content: flex-end;

		.wc-block-featured-product__title,
		.wc-block-featured-product__variation,
		.wc-block-featured-product__description,
		.wc-block-featured-product__price {
			margin-right: 0;
			text-align: right;
		}
	}

	.wc-block-featured-product__title,
	.wc-block-featured-product__variation,
	.wc-block-featured-product__description,
	.wc-block-featured-product__price {
		color: $white;
		line-height: 1.25;
		margin-bottom: 0;
		text-align: center;

		a,
		a:hover,
		a:focus,
		a:active {
			color: $white;
		}
	}

	.wc-block-featured-product__title,
	.wc-block-featured-product__variation,
	.wc-block-featured-product__description,
	.wc-block-featured-product__price,
	.wc-block-featured-product__link {
		width: 100%;
		padding: 16px 48px 0 48px;
		z-index: 1;
	}

	.wc-block-featured-product__title,
	.wc-block-featured-product__variation {
		margin-top: 0;
		border: 0;

		&::before {
			display: none;
		}
	}

	.wc-block-featured-product__variation {
		font-style: italic;
		padding-top: 0;
	}

	.wc-block-featured-product__description {
		p {
			margin: 0;
			line-height: 1.5em;
		}
	}

	.wp-block-button.aligncenter {
		text-align: center;
	}

	&.has-background-dim::before {
		content: "";
		position: absolute;
		top: 0;
		left: 0;
		bottom: 0;
		right: 0;
		background-color: inherit;
		opacity: 0.5;
		z-index: 1;
	}

	@for $i from 1 through 10 {
		&.has-background-dim.has-background-dim-#{ $i * 10 }::before {
			opacity: $i * 0.1;
		}
	}

	// Apply max-width to floated items that have no intrinsic width
	&.alignleft,
	&.alignright {
		max-width: $content-width * 0.5;
		width: 100%;
	}

	// Using flexbox without an assigned height property breaks vertical center alignment in IE11.
	// Appending an empty ::after element tricks IE11 into giving the cover image an implicit height, which sidesteps this issue.
	&::after {
		display: block;
		content: "";
		font-size: 0;
		min-height: inherit;

		// IE doesn't support flex so omit that.
		@supports (position: sticky) {
			content: none;
		}
	}

	// Aligned cover blocks should not use our global alignment rules
	&.aligncenter,
	&.alignleft,
	&.alignright {
		display: flex;
	}
}
woocommerce-blocks/assets/js/blocks/featured-product/block.js000064400000030341151335517640020451 0ustar00/**
 * External dependencies
 */
import { __ } from '@wordpress/i18n';
import {
	AlignmentToolbar,
	BlockControls,
	InnerBlocks,
	InspectorControls,
	MediaReplaceFlow,
	PanelColorSettings,
	withColors,
	RichText,
} from '@wordpress/block-editor';
import { withSelect } from '@wordpress/data';
import {
	Button,
	FocalPointPicker,
	PanelBody,
	Placeholder,
	RangeControl,
	ResizableBox,
	Spinner,
	ToggleControl,
	ToolbarGroup,
	withSpokenMessages,
} from '@wordpress/components';
import classnames from 'classnames';
import { Component } from '@wordpress/element';
import { compose, createHigherOrderComponent } from '@wordpress/compose';
import { isEmpty } from 'lodash';
import PropTypes from 'prop-types';
import { getSetting } from '@woocommerce/settings';
import ProductControl from '@woocommerce/editor-components/product-control';
import ErrorPlaceholder from '@woocommerce/editor-components/error-placeholder';
import { withProduct } from '@woocommerce/block-hocs';
import { Icon, star } from '@woocommerce/icons';

/**
 * Internal dependencies
 */
import { dimRatioToClass, getBackgroundImageStyles } from './utils';
import {
	getImageSrcFromProduct,
	getImageIdFromProduct,
} from '../../utils/products';

/**
 * Component to handle edit mode of "Featured Product".
 *
 * @param {Object} props Incoming props for the component.
 * @param {Object} props.attributes Incoming block attributes.
 * @param {function(any):any} props.debouncedSpeak Function for delayed speak.
 * @param {string} props.error Error message.
 * @param {function(any):any} props.getProduct Function for getting the product.
 * @param {boolean} props.isLoading Whether product is loading or not.
 * @param {boolean} props.isSelected Whether block is selected or not.
 * @param {Object} props.overlayColor Overlay color object.
 * @param {Object} props.product Product object.
 * @param {function(any):any} props.setAttributes Setter for attributes.
 * @param {function(any):any} props.setOverlayColor Setter for overlay color.
 * @param {function():any} props.triggerUrlUpdate Function for triggering a url update for product.
 */
const FeaturedProduct = ( {
	attributes,
	debouncedSpeak,
	error,
	getProduct,
	isLoading,
	isSelected,
	overlayColor,
	product,
	setAttributes,
	setOverlayColor,
	triggerUrlUpdate = () => void null,
} ) => {
	const renderApiError = () => (
		<ErrorPlaceholder
			className="wc-block-featured-product-error"
			error={ error }
			isLoading={ isLoading }
			onRetry={ getProduct }
		/>
	);

	const renderEditMode = () => {
		const onDone = () => {
			setAttributes( { editMode: false } );
			debouncedSpeak(
				__(
					'Showing Featured Product block preview.',
					'woocommerce'
				)
			);
		};

		return (
			<>
				{ getBlockControls() }
				<Placeholder
					icon={ <Icon srcElement={ star } /> }
					label={ __(
						'Featured Product',
						'woocommerce'
					) }
					className="wc-block-featured-product"
				>
					{ __(
						'Visually highlight a product or variation and encourage prompt action',
						'woocommerce'
					) }
					<div className="wc-block-featured-product__selection">
						<ProductControl
							selected={ attributes.productId || 0 }
							showVariations
							onChange={ ( value = [] ) => {
								const id = value[ 0 ] ? value[ 0 ].id : 0;
								setAttributes( {
									productId: id,
									mediaId: 0,
									mediaSrc: '',
								} );
								triggerUrlUpdate();
							} }
						/>
						<Button isPrimary onClick={ onDone }>
							{ __( 'Done', 'woocommerce' ) }
						</Button>
					</div>
				</Placeholder>
			</>
		);
	};

	const getBlockControls = () => {
		const { contentAlign, editMode, mediaSrc } = attributes;
		const mediaId = attributes.mediaId || getImageIdFromProduct( product );

		return (
			<BlockControls>
				<AlignmentToolbar
					value={ contentAlign }
					onChange={ ( nextAlign ) => {
						setAttributes( { contentAlign: nextAlign } );
					} }
				/>
				<MediaReplaceFlow
					mediaId={ mediaId }
					mediaURL={ mediaSrc }
					accept="image/*"
					onSelect={ ( media ) => {
						setAttributes( {
							mediaId: media.id,
							mediaSrc: media.url,
						} );
					} }
					allowedTypes={ [ 'image' ] }
				/>

				<ToolbarGroup
					controls={ [
						{
							icon: 'edit',
							title: __( 'Edit' ),
							onClick: () =>
								setAttributes( { editMode: ! editMode } ),
							isActive: editMode,
						},
					] }
				/>
			</BlockControls>
		);
	};

	const getInspectorControls = () => {
		const url = attributes.mediaSrc || getImageSrcFromProduct( product );
		const { focalPoint = { x: 0.5, y: 0.5 } } = attributes;
		// FocalPointPicker was introduced in Gutenberg 5.0 (WordPress 5.2),
		// so we need to check if it exists before using it.
		const focalPointPickerExists = typeof FocalPointPicker === 'function';

		return (
			<InspectorControls key="inspector">
				<PanelBody
					title={ __( 'Content', 'woocommerce' ) }
				>
					<ToggleControl
						label={ __(
							'Show description',
							'woocommerce'
						) }
						checked={ attributes.showDesc }
						onChange={
							// prettier-ignore
							() => setAttributes( { showDesc: ! attributes.showDesc } )
						}
					/>
					<ToggleControl
						label={ __(
							'Show price',
							'woocommerce'
						) }
						checked={ attributes.showPrice }
						onChange={
							// prettier-ignore
							() => setAttributes( { showPrice: ! attributes.showPrice } )
						}
					/>
				</PanelBody>
				<PanelColorSettings
					title={ __( 'Overlay', 'woocommerce' ) }
					colorSettings={ [
						{
							value: overlayColor.color,
							onChange: setOverlayColor,
							label: __(
								'Overlay Color',
								'woocommerce'
							),
						},
					] }
				>
					{ !! url && (
						<>
							<RangeControl
								label={ __(
									'Background Opacity',
									'woocommerce'
								) }
								value={ attributes.dimRatio }
								onChange={ ( ratio ) =>
									setAttributes( { dimRatio: ratio } )
								}
								min={ 0 }
								max={ 100 }
								step={ 10 }
							/>
							{ focalPointPickerExists && (
								<FocalPointPicker
									label={ __( 'Focal Point Picker' ) }
									url={ url }
									value={ focalPoint }
									onChange={ ( value ) =>
										setAttributes( { focalPoint: value } )
									}
								/>
							) }
						</>
					) }
				</PanelColorSettings>
			</InspectorControls>
		);
	};

	const renderProduct = () => {
		const {
			className,
			contentAlign,
			dimRatio,
			focalPoint,
			height,
			showDesc,
			showPrice,
		} = attributes;
		const classes = classnames(
			'wc-block-featured-product',
			{
				'is-selected': isSelected && attributes.productId !== 'preview',
				'is-loading': ! product && isLoading,
				'is-not-found': ! product && ! isLoading,
				'has-background-dim': dimRatio !== 0,
			},
			dimRatioToClass( dimRatio ),
			contentAlign !== 'center' && `has-${ contentAlign }-content`,
			className
		);

		const style = getBackgroundImageStyles(
			attributes.mediaSrc || product
		);

		if ( overlayColor.color ) {
			style.backgroundColor = overlayColor.color;
		}
		if ( focalPoint ) {
			const bgPosX = focalPoint.x * 100;
			const bgPosY = focalPoint.y * 100;
			style.backgroundPosition = `${ bgPosX }% ${ bgPosY }%`;
		}

		const onResizeStop = ( event, direction, elt ) => {
			setAttributes( { height: parseInt( elt.style.height, 10 ) } );
		};

		return (
			<ResizableBox
				className={ classes }
				size={ { height } }
				minHeight={ getSetting( 'min_height', 500 ) }
				enable={ { bottom: true } }
				onResizeStop={ onResizeStop }
				style={ style }
			>
				<div className="wc-block-featured-product__wrapper">
					<h2
						className="wc-block-featured-product__title"
						dangerouslySetInnerHTML={ {
							__html: product.name,
						} }
					/>
					{ ! isEmpty( product.variation ) && (
						<h3
							className="wc-block-featured-product__variation"
							dangerouslySetInnerHTML={ {
								__html: product.variation,
							} }
						/>
					) }
					{ showDesc && (
						<div
							className="wc-block-featured-product__description"
							dangerouslySetInnerHTML={ {
								__html: product.short_description,
							} }
						/>
					) }
					{ showPrice && (
						<div
							className="wc-block-featured-product__price"
							dangerouslySetInnerHTML={ {
								__html: product.price_html,
							} }
						/>
					) }
					<div className="wc-block-featured-product__link">
						{ renderButton() }
					</div>
				</div>
			</ResizableBox>
		);
	};

	const renderButton = () => {
		const buttonClasses = classnames(
			'wp-block-button__link',
			'is-style-fill'
		);
		const buttonStyle = {
			backgroundColor: 'vivid-green-cyan',
			borderRadius: '5px',
		};
		const wrapperStyle = {
			width: '100%',
		};
		return attributes.productId === 'preview' ? (
			<div className="wp-block-button aligncenter" style={ wrapperStyle }>
				<RichText.Content
					tagName="a"
					className={ buttonClasses }
					href={ product.permalink }
					title={ attributes.linkText }
					style={ buttonStyle }
					value={ attributes.linkText }
					target={ product.permalink }
				/>
			</div>
		) : (
			<InnerBlocks
				template={ [
					[
						'core/button',
						{
							text: __(
								'Shop now',
								'woocommerce'
							),
							url: product.permalink,
							align: 'center',
						},
					],
				] }
				templateLock="all"
			/>
		);
	};

	const renderNoProduct = () => (
		<Placeholder
			className="wc-block-featured-product"
			icon={ <Icon srcElement={ star } /> }
			label={ __( 'Featured Product', 'woocommerce' ) }
		>
			{ isLoading ? (
				<Spinner />
			) : (
				__( 'No product is selected.', 'woocommerce' )
			) }
		</Placeholder>
	);

	const { editMode } = attributes;

	if ( error ) {
		return renderApiError();
	}

	if ( editMode ) {
		return renderEditMode();
	}

	return (
		<>
			{ getBlockControls() }
			{ getInspectorControls() }
			{ product ? renderProduct() : renderNoProduct() }
		</>
	);
};

FeaturedProduct.propTypes = {
	/**
	 * The attributes for this block.
	 */
	attributes: PropTypes.object.isRequired,
	/**
	 * Whether this block is currently active.
	 */
	isSelected: PropTypes.bool.isRequired,
	/**
	 * The register block name.
	 */
	name: PropTypes.string.isRequired,
	/**
	 * A callback to update attributes.
	 */
	setAttributes: PropTypes.func.isRequired,
	// from withProduct
	error: PropTypes.object,
	getProduct: PropTypes.func,
	isLoading: PropTypes.bool,
	product: PropTypes.shape( {
		name: PropTypes.node,
		variation: PropTypes.node,
		description: PropTypes.node,
		price_html: PropTypes.node,
		permalink: PropTypes.string,
	} ),
	// from withColors
	overlayColor: PropTypes.object,
	setOverlayColor: PropTypes.func.isRequired,
	// from withSpokenMessages
	debouncedSpeak: PropTypes.func.isRequired,
	triggerUrlUpdate: PropTypes.func,
};

export default compose( [
	withProduct,
	withColors( { overlayColor: 'background-color' } ),
	withSpokenMessages,
	withSelect( ( select, { clientId }, { dispatch } ) => {
		const Block = select( 'core/block-editor' ).getBlock( clientId );
		const buttonBlockId = Block?.innerBlocks[ 0 ]?.clientId || '';
		const currentButtonAttributes =
			Block?.innerBlocks[ 0 ]?.attributes || {};
		const updateBlockAttributes = ( attributes ) => {
			if ( buttonBlockId ) {
				dispatch( 'core/block-editor' ).updateBlockAttributes(
					buttonBlockId,
					attributes
				);
			}
		};
		return { updateBlockAttributes, currentButtonAttributes };
	} ),
	createHigherOrderComponent( ( ProductComponent ) => {
		class WrappedComponent extends Component {
			state = {
				doUrlUpdate: false,
			};
			componentDidUpdate() {
				const {
					attributes,
					updateBlockAttributes,
					currentButtonAttributes,
					product,
				} = this.props;
				if (
					this.state.doUrlUpdate &&
					! attributes.editMode &&
					product?.permalink &&
					currentButtonAttributes?.url &&
					product.permalink !== currentButtonAttributes.url
				) {
					updateBlockAttributes( {
						...currentButtonAttributes,
						url: product.permalink,
					} );
					this.setState( { doUrlUpdate: false } );
				}
			}
			triggerUrlUpdate = () => {
				this.setState( { doUrlUpdate: true } );
			};
			render() {
				return (
					<ProductComponent
						triggerUrlUpdate={ this.triggerUrlUpdate }
						{ ...this.props }
					/>
				);
			}
		}
		return WrappedComponent;
	}, 'withUpdateButtonAttributes' ),
] )( FeaturedProduct );
woocommerce-blocks/assets/js/blocks/featured-product/utils.js000064400000002102151335517640020511 0ustar00/**
 * External dependencies
 */
import { isObject } from 'lodash';

/**
 * Internal dependencies
 */
import { getImageSrcFromProduct } from '../../utils/products';

/**
 * Generate a style object given either a product object or URL to an image.
 *
 * @param {Object|string} url A product object as returned from the API, or an image URL.
 * @return {Object} A style object with a backgroundImage set (if a valid image is provided).
 */
function getBackgroundImageStyles( url ) {
	// If `url` is an object, it's actually a product.
	if ( isObject( url ) ) {
		url = getImageSrcFromProduct( url );
	}
	if ( url ) {
		return { backgroundImage: `url(${ url })` };
	}
	return {};
}

/**
 * Convert the selected ratio to the correct background class.
 *
 * @param {number} ratio Selected opacity from 0 to 100.
 * @return {string} The class name, if applicable (not used for ratio 0 or 50).
 */
function dimRatioToClass( ratio ) {
	return ratio === 0 || ratio === 50
		? null
		: `has-background-dim-${ 10 * Math.round( ratio / 10 ) }`;
}

export { getBackgroundImageStyles, dimRatioToClass };
woocommerce-blocks/assets/js/blocks/featured-product/editor.scss000064400000000315151335517640021202 0ustar00.wc-block-featured-product {
	.components-resizable-box__handle {
		z-index: 10;
	}
}
.wc-block-featured-product__message {
	margin-bottom: 16px;
}

.wc-block-featured-product__selection {
	width: 100%;
}
woocommerce-blocks/assets/js/blocks/featured-product/index.js000064400000005341151335517640020470 0ustar00/**
 * External dependencies
 */
import { __ } from '@wordpress/i18n';
import { InnerBlocks } from '@wordpress/block-editor';
import { registerBlockType } from '@wordpress/blocks';
import { getSetting } from '@woocommerce/settings';
import { Icon, star } from '@woocommerce/icons';

/**
 * Internal dependencies
 */
import './style.scss';
import './editor.scss';
import { example } from './example';
import Block from './block';

/**
 * Register and run the "Featured Product" block.
 */
registerBlockType( 'woocommerce/featured-product', {
	title: __( 'Featured Product', 'woocommerce' ),
	icon: {
		src: <Icon srcElement={ star } />,
		foreground: '#96588a',
	},
	category: 'woocommerce',
	keywords: [ __( 'WooCommerce', 'woocommerce' ) ],
	description: __(
		'Visually highlight a product or variation and encourage prompt action.',
		'woocommerce'
	),
	supports: {
		align: [ 'wide', 'full' ],
		html: false,
	},
	example,
	attributes: {
		/**
		 * Alignment of content inside block.
		 */
		contentAlign: {
			type: 'string',
			default: 'center',
		},

		/**
		 * Percentage opacity of overlay.
		 */
		dimRatio: {
			type: 'number',
			default: 50,
		},

		/**
		 * Toggle for edit mode in the block preview.
		 */
		editMode: {
			type: 'boolean',
			default: true,
		},

		/**
		 * Focus point for the background image
		 */
		focalPoint: {
			type: 'object',
		},

		/**
		 * A fixed height for the block.
		 */
		height: {
			type: 'number',
			default: getSetting( 'default_height', 500 ),
		},

		/**
		 * ID for a custom image, overriding the product's featured image.
		 */
		mediaId: {
			type: 'number',
			default: 0,
		},

		/**
		 * URL for a custom image, overriding the product's featured image.
		 */
		mediaSrc: {
			type: 'string',
			default: '',
		},

		/**
		 * The overlay color, from the color list.
		 */
		overlayColor: {
			type: 'string',
		},

		/**
		 * The overlay color, if a custom color value.
		 */
		customOverlayColor: {
			type: 'string',
		},

		/**
		 * Text for the product link.
		 */
		linkText: {
			type: 'string',
			default: __( 'Shop now', 'woocommerce' ),
		},

		/**
		 * The product ID to display.
		 */
		productId: {
			type: 'number',
		},

		/**
		 * Show the product description.
		 */
		showDesc: {
			type: 'boolean',
			default: true,
		},

		/**
		 * Show the product price.
		 */
		showPrice: {
			type: 'boolean',
			default: true,
		},

		/**
		 * Product preview.
		 */
		previewProduct: {
			type: 'object',
			default: null,
		},
	},

	/**
	 * Renders and manages the block.
	 *
	 * @param {Object} props Props to pass to block.
	 */
	edit( props ) {
		return <Block { ...props } />;
	},

	/**
	 * Block content is rendered in PHP, not via save function.
	 */
	save() {
		return <InnerBlocks.Content />;
	},
} );
woocommerce-blocks/assets/js/blocks/product-top-rated/block.js000064400000005604151335517640020555 0ustar00/**
 * External dependencies
 */
import { __ } from '@wordpress/i18n';
import { Component } from '@wordpress/element';
import { Disabled, PanelBody } from '@wordpress/components';
import { InspectorControls } from '@wordpress/block-editor';
import ServerSideRender from '@wordpress/server-side-render';
import PropTypes from 'prop-types';
import GridContentControl from '@woocommerce/editor-components/grid-content-control';
import GridLayoutControl from '@woocommerce/editor-components/grid-layout-control';
import ProductCategoryControl from '@woocommerce/editor-components/product-category-control';
import { gridBlockPreview } from '@woocommerce/resource-previews';
import { getSetting } from '@woocommerce/settings';

/**
 * Component to handle edit mode of "Top Rated Products".
 */
class ProductTopRatedBlock extends Component {
	getInspectorControls() {
		const { attributes, setAttributes } = this.props;
		const {
			categories,
			catOperator,
			columns,
			contentVisibility,
			rows,
			alignButtons,
		} = attributes;

		return (
			<InspectorControls key="inspector">
				<PanelBody
					title={ __( 'Layout', 'woocommerce' ) }
					initialOpen
				>
					<GridLayoutControl
						columns={ columns }
						rows={ rows }
						alignButtons={ alignButtons }
						setAttributes={ setAttributes }
						minColumns={ getSetting( 'min_columns', 1 ) }
						maxColumns={ getSetting( 'max_columns', 6 ) }
						minRows={ getSetting( 'min_rows', 1 ) }
						maxRows={ getSetting( 'max_rows', 6 ) }
					/>
				</PanelBody>
				<PanelBody
					title={ __( 'Content', 'woocommerce' ) }
					initialOpen
				>
					<GridContentControl
						settings={ contentVisibility }
						onChange={ ( value ) =>
							setAttributes( { contentVisibility: value } )
						}
					/>
				</PanelBody>
				<PanelBody
					title={ __(
						'Filter by Product Category',
						'woocommerce'
					) }
					initialOpen={ false }
				>
					<ProductCategoryControl
						selected={ categories }
						onChange={ ( value = [] ) => {
							const ids = value.map( ( { id } ) => id );
							setAttributes( { categories: ids } );
						} }
						operator={ catOperator }
						onOperatorChange={ ( value = 'any' ) =>
							setAttributes( { catOperator: value } )
						}
					/>
				</PanelBody>
			</InspectorControls>
		);
	}

	render() {
		const { name, attributes } = this.props;

		if ( attributes.isPreview ) {
			return gridBlockPreview;
		}

		return (
			<>
				{ this.getInspectorControls() }
				<Disabled>
					<ServerSideRender
						block={ name }
						attributes={ attributes }
					/>
				</Disabled>
			</>
		);
	}
}

ProductTopRatedBlock.propTypes = {
	/**
	 * The attributes for this block
	 */
	attributes: PropTypes.object.isRequired,
	/**
	 * The register block name.
	 */
	name: PropTypes.string.isRequired,
	/**
	 * A callback to update attributes
	 */
	setAttributes: PropTypes.func.isRequired,
};

export default ProductTopRatedBlock;
woocommerce-blocks/assets/js/blocks/product-top-rated/index.js000064400000002501151335517640020563 0ustar00/**
 * External dependencies
 */
import { __ } from '@wordpress/i18n';
import { createBlock, registerBlockType } from '@wordpress/blocks';
import { Icon, thumbUp } from '@woocommerce/icons';
import { without } from 'lodash';

/**
 * Internal dependencies
 */
import Block from './block';
import sharedAttributes, {
	sharedAttributeBlockTypes,
} from '../../utils/shared-attributes';

const blockTypeName = 'woocommerce/product-top-rated';

registerBlockType( blockTypeName, {
	title: __( 'Top Rated Products', 'woocommerce' ),
	icon: {
		src: <Icon srcElement={ thumbUp } />,
		foreground: '#96588a',
	},
	category: 'woocommerce',
	keywords: [ __( 'WooCommerce', 'woocommerce' ) ],
	description: __(
		'Display a grid of your top rated products.',
		'woocommerce'
	),
	supports: {
		align: [ 'wide', 'full' ],
		html: false,
	},
	example: {
		attributes: {
			isPreview: true,
		},
	},
	attributes: {
		...sharedAttributes,
	},

	transforms: {
		from: [
			{
				type: 'block',
				blocks: without( sharedAttributeBlockTypes, blockTypeName ),
				transform: ( attributes ) =>
					createBlock( 'woocommerce/product-top-rated', attributes ),
			},
		],
	},

	/**
	 * Renders and manages the block.
	 *
	 * @param {Object} props Props to pass to block.
	 */
	edit( props ) {
		return <Block { ...props } />;
	},

	save() {
		return null;
	},
} );
woocommerce-blocks/assets/js/blocks/attribute-filter/style.scss000064400000001234151335517640021066 0ustar00.wc-block-attribute-filter {
	margin-bottom: $gap-large;

	&.style-dropdown {
		display: flex;
		gap: $gap;
	}

	.wc-block-attribute-filter-list {
		margin: 0;
		width: 100%;

		li {
			text-decoration: underline;

			label {
				cursor: pointer;
			}

			input {
				cursor: pointer;
				display: inline-block;
			}
		}
	}

	.wc-block-attribute-filter-dropdown {
		flex-grow: 1;
		max-width: unset;
		width: 0;
	}

	.is-single .wc-block-attribute-filter-list-count,
	.wc-block-dropdown-selector .wc-block-dropdown-selector__list .wc-block-attribute-filter-list-count {
		opacity: 0.6;
	}

	.wc-block-components-dropdown-selector__input-wrapper {
		height: 100%;
	}
}
woocommerce-blocks/assets/js/blocks/attribute-filter/edit.js000064400000021114151335517640020313 0ustar00/**
 * External dependencies
 */
import { __, sprintf, _n } from '@wordpress/i18n';
import { useState } from '@wordpress/element';
import { InspectorControls, BlockControls } from '@wordpress/block-editor';
import {
	Placeholder,
	Disabled,
	PanelBody,
	ToggleControl,
	Button,
	ToolbarGroup,
	withSpokenMessages,
} from '@wordpress/components';
import { Icon, server, external } from '@woocommerce/icons';
import { SearchListControl } from '@woocommerce/components';
import { mapValues, toArray, sortBy } from 'lodash';
import { getAdminLink, getSetting } from '@woocommerce/settings';
import HeadingToolbar from '@woocommerce/editor-components/heading-toolbar';
import BlockTitle from '@woocommerce/editor-components/block-title';
import ToggleButtonControl from '@woocommerce/editor-components/toggle-button-control';

/**
 * Internal dependencies
 */
import Block from './block.js';
import './editor.scss';

const ATTRIBUTES = getSetting( 'attributes', [] );

const Edit = ( { attributes, setAttributes, debouncedSpeak } ) => {
	const {
		attributeId,
		className,
		displayStyle,
		heading,
		headingLevel,
		isPreview,
		queryType,
		showCounts,
		showFilterButton,
	} = attributes;

	const [ isEditing, setIsEditing ] = useState(
		! attributeId && ! isPreview
	);

	const getBlockControls = () => {
		return (
			<BlockControls>
				<ToolbarGroup
					controls={ [
						{
							icon: 'edit',
							title: __( 'Edit', 'woocommerce' ),
							onClick: () => setIsEditing( ! isEditing ),
							isActive: isEditing,
						},
					] }
				/>
			</BlockControls>
		);
	};

	const getInspectorControls = () => {
		return (
			<InspectorControls key="inspector">
				<PanelBody
					title={ __( 'Content', 'woocommerce' ) }
				>
					<ToggleControl
						label={ __(
							'Product count',
							'woocommerce'
						) }
						help={
							showCounts
								? __(
										'Product count is visible.',
										'woocommerce'
								  )
								: __(
										'Product count is hidden.',
										'woocommerce'
								  )
						}
						checked={ showCounts }
						onChange={ () =>
							setAttributes( {
								showCounts: ! showCounts,
							} )
						}
					/>
					<p>
						{ __(
							'Heading Level',
							'woocommerce'
						) }
					</p>
					<HeadingToolbar
						isCollapsed={ false }
						minLevel={ 2 }
						maxLevel={ 7 }
						selectedLevel={ headingLevel }
						onChange={ ( newLevel ) =>
							setAttributes( { headingLevel: newLevel } )
						}
					/>
				</PanelBody>
				<PanelBody
					title={ __(
						'Block Settings',
						'woocommerce'
					) }
				>
					<ToggleButtonControl
						label={ __(
							'Query Type',
							'woocommerce'
						) }
						help={
							queryType === 'and'
								? __(
										'Products that have all of the selected attributes will be shown.',
										'woocommerce'
								  )
								: __(
										'Products that have any of the selected attributes will be shown.',
										'woocommerce'
								  )
						}
						value={ queryType }
						options={ [
							{
								label: __(
									'And',
									'woocommerce'
								),
								value: 'and',
							},
							{
								label: __(
									'Or',
									'woocommerce'
								),
								value: 'or',
							},
						] }
						onChange={ ( value ) =>
							setAttributes( {
								queryType: value,
							} )
						}
					/>
					<ToggleButtonControl
						label={ __(
							'Display Style',
							'woocommerce'
						) }
						value={ displayStyle }
						options={ [
							{
								label: __(
									'List',
									'woocommerce'
								),
								value: 'list',
							},
							{
								label: __(
									'Dropdown',
									'woocommerce'
								),
								value: 'dropdown',
							},
						] }
						onChange={ ( value ) =>
							setAttributes( {
								displayStyle: value,
							} )
						}
					/>
					<ToggleControl
						label={ __(
							'Filter button',
							'woocommerce'
						) }
						help={
							showFilterButton
								? __(
										'Products will only update when the button is pressed.',
										'woocommerce'
								  )
								: __(
										'Products will update as options are selected.',
										'woocommerce'
								  )
						}
						checked={ showFilterButton }
						onChange={ ( value ) =>
							setAttributes( {
								showFilterButton: value,
							} )
						}
					/>
				</PanelBody>
				<PanelBody
					title={ __(
						'Filter Products by Attribute',
						'woocommerce'
					) }
					initialOpen={ false }
				>
					{ renderAttributeControl( { isCompact: true } ) }
				</PanelBody>
			</InspectorControls>
		);
	};

	const noAttributesPlaceholder = () => (
		<Placeholder
			className="wc-block-attribute-filter"
			icon={ <Icon srcElement={ server } /> }
			label={ __(
				'Filter Products by Attribute',
				'woocommerce'
			) }
			instructions={ __(
				'Display a list of filters based on a chosen attribute.',
				'woocommerce'
			) }
		>
			<p>
				{ __(
					"Attributes are needed for filtering your products. You haven't created any attributes yet.",
					'woocommerce'
				) }
			</p>
			<Button
				className="wc-block-attribute-filter__add-attribute-button"
				isSecondary
				href={ getAdminLink(
					'edit.php?post_type=product&page=product_attributes'
				) }
			>
				{ __( 'Add new attribute', 'woocommerce' ) +
					' ' }
				<Icon srcElement={ external } />
			</Button>
			<Button
				className="wc-block-attribute-filter__read_more_button"
				isTertiary
				href="https://docs.woocommerce.com/document/managing-product-taxonomies/"
			>
				{ __( 'Learn more', 'woocommerce' ) }
			</Button>
		</Placeholder>
	);

	const onDone = () => {
		setIsEditing( false );
		debouncedSpeak(
			__(
				'Showing Filter Products by Attribute block preview.',
				'woocommerce'
			)
		);
	};

	const onChange = ( selected ) => {
		if ( ! selected || ! selected.length ) {
			return;
		}

		const selectedId = selected[ 0 ].id;
		const productAttribute = ATTRIBUTES.find(
			( attribute ) => attribute.attribute_id === selectedId.toString()
		);

		if ( ! productAttribute || attributeId === selectedId ) {
			return;
		}

		const attributeName = productAttribute.attribute_label;

		setAttributes( {
			attributeId: selectedId,
			heading: sprintf(
				/* translators: %s attribute name. */
				__( 'Filter by %s', 'woocommerce' ),
				attributeName
			),
		} );
	};

	const renderAttributeControl = ( { isCompact } ) => {
		const messages = {
			clear: __(
				'Clear selected attribute',
				'woocommerce'
			),
			list: __( 'Product Attributes', 'woocommerce' ),
			noItems: __(
				"Your store doesn't have any product attributes.",
				'woocommerce'
			),
			search: __(
				'Search for a product attribute:',
				'woocommerce'
			),
			selected: ( n ) =>
				sprintf(
					/* translators: %d is the number of attributes selected. */
					_n(
						'%d attribute selected',
						'%d attributes selected',
						n,
						'woocommerce'
					),
					n
				),
			updated: __(
				'Product attribute search results updated.',
				'woocommerce'
			),
		};

		const list = sortBy(
			toArray(
				mapValues( ATTRIBUTES, ( item ) => {
					return {
						id: parseInt( item.attribute_id, 10 ),
						name: item.attribute_label,
					};
				} )
			),
			'name'
		);

		return (
			<SearchListControl
				className="woocommerce-product-attributes"
				list={ list }
				selected={ list.filter( ( { id } ) => id === attributeId ) }
				onChange={ onChange }
				messages={ messages }
				isSingle
				isCompact={ isCompact }
			/>
		);
	};

	const renderEditMode = () => {
		return (
			<Placeholder
				className="wc-block-attribute-filter"
				icon={ <Icon srcElement={ server } /> }
				label={ __(
					'Filter Products by Attribute',
					'woocommerce'
				) }
				instructions={ __(
					'Display a list of filters based on a chosen attribute.',
					'woocommerce'
				) }
			>
				<div className="wc-block-attribute-filter__selection">
					{ renderAttributeControl( { isCompact: false } ) }
					<Button isPrimary onClick={ onDone }>
						{ __( 'Done', 'woocommerce' ) }
					</Button>
				</div>
			</Placeholder>
		);
	};

	return Object.keys( ATTRIBUTES ).length === 0 ? (
		noAttributesPlaceholder()
	) : (
		<>
			{ getBlockControls() }
			{ getInspectorControls() }
			{ isEditing ? (
				renderEditMode()
			) : (
				<div className={ className }>
					<BlockTitle
						className="wc-block-attribute-filter__title"
						headingLevel={ headingLevel }
						heading={ heading }
						onChange={ ( value ) =>
							setAttributes( { heading: value } )
						}
					/>
					<Disabled>
						<Block attributes={ attributes } isEditor />
					</Disabled>
				</div>
			) }
		</>
	);
};

export default withSpokenMessages( Edit );
woocommerce-blocks/assets/js/blocks/attribute-filter/preview.js000064400000001006151335517640021045 0ustar00/**
 * External dependencies
 */
import Label from '@woocommerce/base-components/filter-element-label';

export const previewOptions = [
	{
		value: 'preview-1',
		name: 'Blue',
		label: <Label name="Blue" count={ 3 } />,
	},
	{
		value: 'preview-2',
		name: 'Green',
		label: <Label name="Green" count={ 3 } />,
	},
	{
		value: 'preview-3',
		name: 'Red',
		label: <Label name="Red" count={ 2 } />,
	},
];

export const previewAttributeObject = {
	id: 0,
	name: 'preview',
	taxonomy: 'preview',
	label: 'Preview',
};
woocommerce-blocks/assets/js/blocks/attribute-filter/editor.scss000064400000001346151335517640021220 0ustar00.wc-block-attribute-filter {
	.components-placeholder__instructions {
		border-bottom: 1px solid #e0e2e6;
		width: 100%;
		padding-bottom: 1em;
		margin-bottom: 2em;
	}
	.components-placeholder__label svg {
		fill: currentColor;
		margin-right: 1ch;
	}
	.components-placeholder__fieldset {
		display: block; /* Disable flex box */
	}
	.woocommerce-search-list__search {
		border-top: 0;
		margin-top: 0;
		padding-top: 0;
	}
	.wc-block-attribute-filter__add-attribute-button {
		margin: 0 0 1em;
		vertical-align: middle;
		height: auto;
		padding: 0.5em 1em;

		svg {
			fill: currentColor;
			margin-left: 0.5ch;
			vertical-align: middle;
		}
	}
	.wc-block-attribute-filter__read_more_button {
		display: block;
		margin-bottom: 1em;
	}
}
woocommerce-blocks/assets/js/blocks/attribute-filter/block.js000064400000023542151335517640020467 0ustar00/**
 * External dependencies
 */
import { __, sprintf } from '@wordpress/i18n';
import { speak } from '@wordpress/a11y';
import { usePrevious, useShallowEqual } from '@woocommerce/base-hooks';
import {
	useCollection,
	useQueryStateByKey,
	useQueryStateByContext,
	useCollectionData,
} from '@woocommerce/base-context/hooks';
import { useCallback, useEffect, useState, useMemo } from '@wordpress/element';
import CheckboxList from '@woocommerce/base-components/checkbox-list';
import DropdownSelector from '@woocommerce/base-components/dropdown-selector';
import Label from '@woocommerce/base-components/filter-element-label';
import FilterSubmitButton from '@woocommerce/base-components/filter-submit-button';
import isShallowEqual from '@wordpress/is-shallow-equal';
import { decodeEntities } from '@wordpress/html-entities';

/**
 * Internal dependencies
 */
import { getAttributeFromID } from '../../utils/attributes';
import { updateAttributeFilter } from '../../utils/attributes-query';
import { previewAttributeObject, previewOptions } from './preview';
import './style.scss';

/**
 * Component displaying an attribute filter.
 *
 * @param {Object} props Incoming props for the component.
 * @param {Object} props.attributes Incoming block attributes.
 * @param {boolean} props.isEditor
 */
const AttributeFilterBlock = ( {
	attributes: blockAttributes,
	isEditor = false,
} ) => {
	const attributeObject =
		blockAttributes.isPreview && ! blockAttributes.attributeId
			? previewAttributeObject
			: getAttributeFromID( blockAttributes.attributeId );

	const [ checked, setChecked ] = useState( [] );
	const [ displayedOptions, setDisplayedOptions ] = useState(
		blockAttributes.isPreview && ! blockAttributes.attributeId
			? previewOptions
			: []
	);

	const [ queryState ] = useQueryStateByContext();
	const [
		productAttributesQuery,
		setProductAttributesQuery,
	] = useQueryStateByKey( 'attributes', [] );

	const {
		results: attributeTerms,
		isLoading: attributeTermsLoading,
	} = useCollection( {
		namespace: '/wc/store',
		resourceName: 'products/attributes/terms',
		resourceValues: [ attributeObject.id ],
		shouldSelect: blockAttributes.attributeId > 0,
	} );

	const filterAvailableTerms =
		blockAttributes.displayStyle !== 'dropdown' &&
		blockAttributes.queryType === 'and';
	const {
		results: filteredCounts,
		isLoading: filteredCountsLoading,
	} = useCollectionData( {
		queryAttribute: {
			taxonomy: attributeObject.taxonomy,
			queryType: blockAttributes.queryType,
		},
		queryState: {
			...queryState,
			attributes: filterAvailableTerms ? queryState.attributes : null,
		},
	} );

	/**
	 * Get count data about a given term by ID.
	 */
	const getFilteredTerm = useCallback(
		( id ) => {
			if ( ! filteredCounts.attribute_counts ) {
				return null;
			}
			return filteredCounts.attribute_counts.find(
				( { term } ) => term === id
			);
		},
		[ filteredCounts ]
	);

	/**
	 * Compare intersection of all terms and filtered counts to get a list of options to display.
	 */
	useEffect( () => {
		/**
		 * Checks if a term slug is in the query state.
		 *
		 * @param {string} termSlug The term of the slug to check.
		 */
		const isTermInQueryState = ( termSlug ) => {
			if ( ! queryState?.attributes ) {
				return false;
			}
			return queryState.attributes.some(
				( { attribute, slug = [] } ) =>
					attribute === attributeObject.taxonomy &&
					slug.includes( termSlug )
			);
		};

		if ( attributeTermsLoading || filteredCountsLoading ) {
			return;
		}

		const newOptions = attributeTerms
			.map( ( term ) => {
				const filteredTerm = getFilteredTerm( term.id );

				// If there is no match this term doesn't match the current product collection - only render if checked.
				if (
					! filteredTerm &&
					! checked.includes( term.slug ) &&
					! isTermInQueryState( term.slug )
				) {
					return null;
				}

				const count = filteredTerm ? filteredTerm.count : 0;

				return {
					value: term.slug,
					name: decodeEntities( term.name ),
					label: (
						<Label
							name={ decodeEntities( term.name ) }
							count={ blockAttributes.showCounts ? count : null }
						/>
					),
				};
			} )
			.filter( Boolean );

		setDisplayedOptions( newOptions );
	}, [
		attributeObject.taxonomy,
		attributeTerms,
		attributeTermsLoading,
		blockAttributes.showCounts,
		filteredCountsLoading,
		getFilteredTerm,
		checked,
		queryState.attributes,
	] );

	const checkedQuery = useMemo( () => {
		return productAttributesQuery
			.filter(
				( { attribute } ) => attribute === attributeObject.taxonomy
			)
			.flatMap( ( { slug } ) => slug );
	}, [ productAttributesQuery, attributeObject.taxonomy ] );

	const currentCheckedQuery = useShallowEqual( checkedQuery );
	const previousCheckedQuery = usePrevious( currentCheckedQuery );
	// Track ATTRIBUTES QUERY changes so the block reflects current filters.
	useEffect( () => {
		if (
			! isShallowEqual( previousCheckedQuery, currentCheckedQuery ) && // checked query changed
			! isShallowEqual( checked, currentCheckedQuery ) // checked query doesn't match the UI
		) {
			setChecked( currentCheckedQuery );
			if ( ! blockAttributes.showFilterButton ) {
				onSubmit( currentCheckedQuery );
			}
		}
	}, [
		checked,
		currentCheckedQuery,
		previousCheckedQuery,
		onSubmit,
		blockAttributes.showFilterButton,
	] );

	/**
	 * Returns an array of term objects that have been chosen via the checkboxes.
	 */
	const getSelectedTerms = useCallback(
		( newChecked ) => {
			return attributeTerms.reduce( ( acc, term ) => {
				if ( newChecked.includes( term.slug ) ) {
					acc.push( term );
				}
				return acc;
			}, [] );
		},
		[ attributeTerms ]
	);

	const onSubmit = useCallback(
		( isChecked ) => {
			if ( isEditor ) {
				return;
			}

			updateAttributeFilter(
				productAttributesQuery,
				setProductAttributesQuery,
				attributeObject,
				getSelectedTerms( isChecked ),
				blockAttributes.queryType === 'or' ? 'in' : 'and'
			);
		},
		[
			isEditor,
			productAttributesQuery,
			setProductAttributesQuery,
			attributeObject,
			getSelectedTerms,
			blockAttributes.queryType,
		]
	);

	const multiple =
		blockAttributes.displayStyle !== 'dropdown' ||
		blockAttributes.queryType === 'or';

	/**
	 * When a checkbox in the list changes, update state.
	 */
	const onChange = useCallback(
		( checkedValue ) => {
			const getFilterNameFromValue = ( filterValue ) => {
				const { name } = displayedOptions.find(
					( option ) => option.value === filterValue
				);

				return name;
			};

			const announceFilterChange = ( { filterAdded, filterRemoved } ) => {
				const filterAddedName = filterAdded
					? getFilterNameFromValue( filterAdded )
					: null;
				const filterRemovedName = filterRemoved
					? getFilterNameFromValue( filterRemoved )
					: null;
				if ( filterAddedName && filterRemovedName ) {
					speak(
						sprintf(
							/* translators: %1$s and %2$s are attribute terms (for example: 'red', 'blue', 'large'...). */
							__(
								'%1$s filter replaced with %2$s.',
								'woocommerce'
							),
							filterAddedName,
							filterRemovedName
						)
					);
				} else if ( filterAddedName ) {
					speak(
						sprintf(
							/* translators: %s attribute term (for example: 'red', 'blue', 'large'...) */
							__(
								'%s filter added.',
								'woocommerce'
							),
							filterAddedName
						)
					);
				} else if ( filterRemovedName ) {
					speak(
						sprintf(
							/* translators: %s attribute term (for example: 'red', 'blue', 'large'...) */
							__(
								'%s filter removed.',
								'woocommerce'
							),
							filterRemovedName
						)
					);
				}
			};

			const previouslyChecked = checked.includes( checkedValue );
			let newChecked;

			if ( ! multiple ) {
				newChecked = previouslyChecked ? [] : [ checkedValue ];
				const filterAdded = previouslyChecked ? null : checkedValue;
				const filterRemoved =
					checked.length === 1 ? checked[ 0 ] : null;
				announceFilterChange( { filterAdded, filterRemoved } );
			} else {
				newChecked = checked.filter(
					( value ) => value !== checkedValue
				);

				if ( ! previouslyChecked ) {
					newChecked.push( checkedValue );
					newChecked.sort();
					announceFilterChange( { filterAdded: checkedValue } );
				} else {
					announceFilterChange( { filterRemoved: checkedValue } );
				}
			}

			setChecked( newChecked );
			if ( ! blockAttributes.showFilterButton ) {
				onSubmit( newChecked );
			}
		},
		[
			checked,
			displayedOptions,
			multiple,
			onSubmit,
			blockAttributes.showFilterButton,
		]
	);

	if ( displayedOptions.length === 0 && ! attributeTermsLoading ) {
		return null;
	}

	const TagName = `h${ blockAttributes.headingLevel }`;
	const isLoading = ! blockAttributes.isPreview && attributeTermsLoading;
	const isDisabled = ! blockAttributes.isPreview && filteredCountsLoading;

	return (
		<>
			{ ! isEditor && blockAttributes.heading && (
				<TagName className="wc-block-attribute-filter__title">
					{ blockAttributes.heading }
				</TagName>
			) }
			<div
				className={ `wc-block-attribute-filter style-${ blockAttributes.displayStyle }` }
			>
				{ blockAttributes.displayStyle === 'dropdown' ? (
					<DropdownSelector
						attributeLabel={ attributeObject.label }
						checked={ checked }
						className={ 'wc-block-attribute-filter-dropdown' }
						inputLabel={ blockAttributes.heading }
						isLoading={ isLoading }
						multiple={ multiple }
						onChange={ onChange }
						options={ displayedOptions }
					/>
				) : (
					<CheckboxList
						className={ 'wc-block-attribute-filter-list' }
						options={ displayedOptions }
						checked={ checked }
						onChange={ onChange }
						isLoading={ isLoading }
						isDisabled={ isDisabled }
					/>
				) }
				{ blockAttributes.showFilterButton && (
					<FilterSubmitButton
						className="wc-block-attribute-filter__button"
						disabled={ isLoading || isDisabled }
						onClick={ () => onSubmit( checked ) }
					/>
				) }
			</div>
		</>
	);
};

export default AttributeFilterBlock;
woocommerce-blocks/assets/js/blocks/attribute-filter/frontend.js000064400000001350151335517640021205 0ustar00/**
 * External dependencies
 */
import { withRestApiHydration } from '@woocommerce/block-hocs';
import { renderFrontend } from '@woocommerce/base-utils';

/**
 * Internal dependencies
 */
import Block from './block.js';

const getProps = ( el ) => {
	return {
		attributes: {
			attributeId: parseInt( el.dataset.attributeId || 0, 10 ),
			showCounts: el.dataset.showCounts === 'true',
			queryType: el.dataset.queryType,
			heading: el.dataset.heading,
			headingLevel: el.dataset.headingLevel || 3,
			displayStyle: el.dataset.displayStyle,
			showFilterButton: el.dataset.showFilterButton === 'true',
		},
	};
};

renderFrontend( {
	selector: '.wp-block-woocommerce-attribute-filter',
	Block: withRestApiHydration( Block ),
	getProps,
} );
woocommerce-blocks/assets/js/blocks/attribute-filter/index.js000064400000004213151335517640020476 0ustar00/**
 * External dependencies
 */
import { __ } from '@wordpress/i18n';
import { registerBlockType } from '@wordpress/blocks';
import { Icon, server } from '@woocommerce/icons';
import classNames from 'classnames';

/**
 * Internal dependencies
 */
import edit from './edit.js';

registerBlockType( 'woocommerce/attribute-filter', {
	title: __( 'Filter Products by Attribute', 'woocommerce' ),
	icon: {
		src: <Icon srcElement={ server } />,
		foreground: '#96588a',
	},
	category: 'woocommerce',
	keywords: [ __( 'WooCommerce', 'woocommerce' ) ],
	description: __(
		'Allow customers to filter the grid by product attribute, such as color. Works in combination with the All Products block.',
		'woocommerce'
	),
	supports: {
		html: false,
	},
	example: {
		attributes: {
			isPreview: true,
		},
	},
	attributes: {
		attributeId: {
			type: 'number',
			default: 0,
		},
		showCounts: {
			type: 'boolean',
			default: true,
		},
		queryType: {
			type: 'string',
			default: 'or',
		},
		heading: {
			type: 'string',
			default: __(
				'Filter by attribute',
				'woocommerce'
			),
		},
		headingLevel: {
			type: 'number',
			default: 3,
		},
		displayStyle: {
			type: 'string',
			default: 'list',
		},
		showFilterButton: {
			type: 'boolean',
			default: false,
		},
		/**
		 * Are we previewing?
		 */
		isPreview: {
			type: 'boolean',
			default: false,
		},
	},
	edit,
	// Save the props to post content.
	save( { attributes } ) {
		const {
			className,
			showCounts,
			queryType,
			attributeId,
			heading,
			headingLevel,
			displayStyle,
			showFilterButton,
		} = attributes;
		const data = {
			'data-attribute-id': attributeId,
			'data-show-counts': showCounts,
			'data-query-type': queryType,
			'data-heading': heading,
			'data-heading-level': headingLevel,
		};
		if ( displayStyle !== 'list' ) {
			data[ 'data-display-style' ] = displayStyle;
		}
		if ( showFilterButton ) {
			data[ 'data-show-filter-button' ] = showFilterButton;
		}
		return (
			<div
				className={ classNames( 'is-loading', className ) }
				{ ...data }
			>
				<span
					aria-hidden
					className="wc-block-product-attribute-filter__placeholder"
				/>
			</div>
		);
	},
} );
woocommerce-blocks/assets/js/blocks/single-product/edit/editor.scss000064400000000455151335517640021616 0ustar00.wc-block-single-product__selection {
	width: 100%;
}
.wc-block-single-product__reset-layout {
	padding: 0;

	svg {
		margin-right: 4px;
	}
}
.wc-block-single-product__edit-card {
	padding: 16px;
	border-top: 1px solid $gray-200;

	.wc-block-single-product__edit-card-title {
		margin: 0 0 $gap;
	}
}
woocommerce-blocks/assets/js/blocks/single-product/edit/api-error.js000064400000001102151335517640021657 0ustar00/**
 * External dependencies
 */
import ErrorPlaceholder from '@woocommerce/editor-components/error-placeholder';

/**
 * Shown when there is an API error getting a product.
 *
 * @param {Object} props Incoming props for the component.
 * @param {string} props.error
 * @param {boolean} props.isLoading
 * @param {function(any):any} props.getProduct
 */
const ApiError = ( { error, isLoading, getProduct } ) => (
	<ErrorPlaceholder
		className="wc-block-single-product-error"
		error={ error }
		isLoading={ isLoading }
		onRetry={ getProduct }
	/>
);

export default ApiError;
woocommerce-blocks/assets/js/blocks/single-product/edit/shared-product-control.js000064400000001263151335517640024371 0ustar00/**
 * External dependencies
 */
import ProductControl from '@woocommerce/editor-components/product-control';

/**
 * Allows a product to be selected for display.
 *
 * @param {Object} props Incoming props for the component.
 * @param {Object} props.attributes Incoming block attributes.
 * @param {function(any):any} props.setAttributes Setter for block attributes.
 */
const SharedProductControl = ( { attributes, setAttributes } ) => (
	<ProductControl
		selected={ attributes.productId || 0 }
		showVariations
		onChange={ ( value = [] ) => {
			const id = value[ 0 ] ? value[ 0 ].id : 0;
			setAttributes( {
				productId: id,
			} );
		} }
	/>
);

export default SharedProductControl;
woocommerce-blocks/assets/js/blocks/single-product/edit/index.js000064400000006166151335517640021105 0ustar00/**
 * External dependencies
 */
import { __ } from '@wordpress/i18n';
import { useState } from '@wordpress/element';
import { Placeholder, Button, PanelBody } from '@wordpress/components';
import { withProduct } from '@woocommerce/block-hocs';
import BlockErrorBoundary from '@woocommerce/base-components/block-error-boundary';
import EditProductLink from '@woocommerce/editor-components/edit-product-link';
import { singleProductBlockPreview } from '@woocommerce/resource-previews';
import { InspectorControls } from '@wordpress/block-editor';

/**
 * Internal dependencies
 */
import './editor.scss';
import ApiError from './api-error';
import SharedProductControl from './shared-product-control';
import EditorBlockControls from './editor-block-controls';
import LayoutEditor from './layout-editor';
import { BLOCK_TITLE, BLOCK_ICON, BLOCK_DESCRIPTION } from '../constants';

/**
 * Component to handle edit mode of the "Single Product Block".
 *
 * @param {Object} props Incoming props for the component.
 * @param {string} props.className
 * @param {Object} props.attributes Incoming block attributes.
 * @param {function(any):any} props.setAttributes Setter for block attributes.
 * @param {string} props.error
 * @param {function(any):any} props.getProduct
 * @param {Object} props.product
 * @param {boolean} props.isLoading
 * @param {string} props.clientId
 */
const Editor = ( {
	className,
	attributes,
	setAttributes,
	error,
	getProduct,
	product,
	isLoading,
	clientId,
} ) => {
	const { productId, isPreview } = attributes;
	const [ isEditing, setIsEditing ] = useState( ! productId );

	if ( isPreview ) {
		return singleProductBlockPreview;
	}

	if ( error ) {
		return (
			<ApiError
				error={ error }
				isLoading={ isLoading }
				getProduct={ getProduct }
			/>
		);
	}

	return (
		<div className={ className }>
			<BlockErrorBoundary
				header={ __(
					'Single Product Block Error',
					'woocommerce'
				) }
			>
				<EditorBlockControls
					setIsEditing={ setIsEditing }
					isEditing={ isEditing }
				/>
				{ isEditing ? (
					<Placeholder
						icon={ BLOCK_ICON }
						label={ BLOCK_TITLE }
						className="wc-block-single-product"
					>
						{ BLOCK_DESCRIPTION }
						<div className="wc-block-single-product__selection">
							<SharedProductControl
								attributes={ attributes }
								setAttributes={ setAttributes }
							/>
							<Button
								isSecondary
								onClick={ () => {
									setIsEditing( false );
								} }
							>
								{ __( 'Done', 'woocommerce' ) }
							</Button>
						</div>
					</Placeholder>
				) : (
					<>
						<InspectorControls>
							<PanelBody
								title={ __(
									'Product',
									'woocommerce'
								) }
								initialOpen={ false }
							>
								<SharedProductControl
									attributes={ attributes }
									setAttributes={ setAttributes }
								/>
							</PanelBody>
						</InspectorControls>
						<EditProductLink productId={ productId } />
						<LayoutEditor
							clientId={ clientId }
							product={ product }
							isLoading={ isLoading }
						/>
					</>
				) }
			</BlockErrorBoundary>
		</div>
	);
};

export default withProduct( Editor );
woocommerce-blocks/assets/js/blocks/single-product/edit/editor-block-controls.js000064400000001344151335517640024206 0ustar00/**
 * External dependencies
 */
import { __ } from '@wordpress/i18n';
import { BlockControls } from '@wordpress/block-editor';
import { ToolbarGroup } from '@wordpress/components';

/**
 * Adds controls to the editor toolbar.
 *
 * @param {Object} props Incoming props for the component.
 * @param {boolean} props.isEditing
 * @param {function(boolean):any} props.setIsEditing
 */
const EditorBlockControls = ( { isEditing, setIsEditing } ) => {
	return (
		<BlockControls>
			<ToolbarGroup
				controls={ [
					{
						icon: 'edit',
						title: __( 'Edit', 'woocommerce' ),
						onClick: () => setIsEditing( ! isEditing ),
						isActive: isEditing,
					},
				] }
			/>
		</BlockControls>
	);
};

export default EditorBlockControls;
woocommerce-blocks/assets/js/blocks/single-product/edit/layout-editor.js000064400000004431151335517640022570 0ustar00/**
 * External dependencies
 */
import { __ } from '@wordpress/i18n';
import { useCallback } from '@wordpress/element';
import { useDispatch } from '@wordpress/data';
import { InnerBlocks, InspectorControls } from '@wordpress/block-editor';
import {
	InnerBlockLayoutContextProvider,
	ProductDataContextProvider,
} from '@woocommerce/shared-context';
import { createBlocksFromTemplate } from '@woocommerce/atomic-utils';
import { PanelBody, Button } from '@wordpress/components';
import { Icon, restore } from '@woocommerce/icons';

/**
 * Internal dependencies
 */
import {
	BLOCK_NAME,
	DEFAULT_INNER_BLOCKS,
	ALLOWED_INNER_BLOCKS,
} from '../constants';

/**
 * Component to handle edit mode of the "Single Product Block".
 *
 * @param {Object} props Incoming props for the component.
 * @param {boolean} props.isLoading
 * @param {Object} props.product
 * @param {string} props.clientId
 */
const LayoutEditor = ( { isLoading, product, clientId } ) => {
	const baseClassName = 'wc-block-single-product wc-block-layout';
	const { replaceInnerBlocks } = useDispatch( 'core/block-editor' );

	const resetInnerBlocks = useCallback( () => {
		replaceInnerBlocks(
			clientId,
			createBlocksFromTemplate( DEFAULT_INNER_BLOCKS ),
			false
		);
	}, [ clientId, replaceInnerBlocks ] );

	return (
		<InnerBlockLayoutContextProvider
			parentName={ BLOCK_NAME }
			parentClassName={ baseClassName }
		>
			<ProductDataContextProvider
				product={ product }
				isLoading={ isLoading }
			>
				<InspectorControls>
					<PanelBody
						title={ __( 'Layout', 'woocommerce' ) }
						initialOpen={ true }
					>
						<Button
							label={ __(
								'Reset layout to default',
								'woocommerce'
							) }
							onClick={ resetInnerBlocks }
							isTertiary
							className="wc-block-single-product__reset-layout"
						>
							<Icon srcElement={ restore } />{ ' ' }
							{ __(
								'Reset layout',
								'woocommerce'
							) }
						</Button>
					</PanelBody>
				</InspectorControls>
				<div className={ baseClassName }>
					<InnerBlocks
						template={ DEFAULT_INNER_BLOCKS }
						allowedBlocks={ ALLOWED_INNER_BLOCKS }
						templateLock={ false }
						renderAppender={ false }
					/>
				</div>
			</ProductDataContextProvider>
		</InnerBlockLayoutContextProvider>
	);
};

export default LayoutEditor;
woocommerce-blocks/assets/js/blocks/single-product/block.js000064400000003015151335517640020131 0ustar00/**
 * External dependencies
 */
import { useEffect } from '@wordpress/element';
import { withProduct } from '@woocommerce/block-hocs';
import {
	InnerBlockLayoutContextProvider,
	ProductDataContextProvider,
} from '@woocommerce/shared-context';
import { StoreNoticesProvider } from '@woocommerce/base-context';
import { useStoreEvents } from '@woocommerce/base-context/hooks';

/**
 * Internal dependencies
 */
import { BLOCK_NAME } from './constants';

/** @typedef {import('react')} React */

/**
 * The Single Product Block.
 *
 * @param {Object} props Incoming props for the component.
 * @param {boolean} props.isLoading
 * @param {Object} props.product
 * @param {React.ReactChildren} props.children
 */
const Block = ( { isLoading, product, children } ) => {
	const { dispatchStoreEvent } = useStoreEvents();
	const className = 'wc-block-single-product wc-block-layout';
	const noticeContext = `woocommerce/single-product/${ product?.id || 0 }`;

	useEffect( () => {
		dispatchStoreEvent( 'product-render', {
			product,
			listName: BLOCK_NAME,
		} );
	}, [ product, dispatchStoreEvent ] );

	return (
		<InnerBlockLayoutContextProvider
			parentName={ BLOCK_NAME }
			parentClassName={ className }
		>
			<ProductDataContextProvider
				product={ product }
				isLoading={ isLoading }
			>
				<StoreNoticesProvider context={ noticeContext }>
					<div className={ className }>{ children }</div>
				</StoreNoticesProvider>
			</ProductDataContextProvider>
		</InnerBlockLayoutContextProvider>
	);
};

export default withProduct( Block );
woocommerce-blocks/assets/js/blocks/single-product/frontend.js000064400000001220151335517640020652 0ustar00/**
 * External dependencies
 */
import { getValidBlockAttributes } from '@woocommerce/base-utils';
import {
	getBlockMap,
	renderParentBlock,
	renderStandaloneBlocks,
} from '@woocommerce/atomic-utils';

/**
 * Internal dependencies
 */
import Block from './block';
import blockAttributes from './attributes';
import { BLOCK_NAME } from './constants';

const getProps = ( el ) => {
	return {
		attributes: getValidBlockAttributes( blockAttributes, el.dataset ),
	};
};

renderParentBlock( {
	Block,
	blockName: BLOCK_NAME,
	selector: '.wp-block-woocommerce-single-product',
	getProps,
	blockMap: getBlockMap( BLOCK_NAME ),
} );

renderStandaloneBlocks();
woocommerce-blocks/assets/js/blocks/single-product/constants.js000064400000002406151335517640021056 0ustar00/**
 * External dependencies
 */
import { __ } from '@wordpress/i18n';
import { Icon, reader } from '@woocommerce/icons';
import { getBlockMap } from '@woocommerce/atomic-utils';

export const BLOCK_NAME = 'woocommerce/single-product';
export const BLOCK_TITLE = __(
	'Single Product',
	'woocommerce'
);
export const BLOCK_ICON = <Icon srcElement={ reader } />;
export const BLOCK_DESCRIPTION = __(
	'Display a single product.',
	'woocommerce'
);

export const DEFAULT_INNER_BLOCKS = [
	[
		'core/columns',
		{},
		[
			[
				'core/column',
				{},
				[ [ 'woocommerce/product-image', { showSaleBadge: false } ] ],
			],
			[
				'core/column',
				{},
				[
					[ 'woocommerce/product-sale-badge' ],
					[ 'woocommerce/product-title', { headingLevel: 2 } ],
					[ 'woocommerce/product-rating' ],
					[ 'woocommerce/product-price' ],
					[ 'woocommerce/product-summary' ],
					[ 'woocommerce/product-stock-indicator' ],
					[
						'woocommerce/product-add-to-cart',
						{ showFormElements: true },
					],
					[ 'woocommerce/product-sku' ],
					[ 'woocommerce/product-category-list' ],
					[ 'woocommerce/product-tag-list' ],
				],
			],
		],
	],
];

export const ALLOWED_INNER_BLOCKS = [
	'core/columns',
	'core/column',
	...Object.keys( getBlockMap( BLOCK_NAME ) ),
];
woocommerce-blocks/assets/js/blocks/single-product/attributes.js000064400000000371151335517640021227 0ustar00/**
 * Internal dependencies
 */
export const blockAttributes = {
	isPreview: {
		type: 'boolean',
		default: false,
		save: false,
	},
	/**
	 * The product ID to display.
	 */
	productId: {
		type: 'number',
	},
};

export default blockAttributes;
woocommerce-blocks/assets/js/blocks/single-product/save.js000064400000000465151335517640020003 0ustar00/**
 * External dependencies
 */
import { InnerBlocks } from '@wordpress/block-editor';
import classnames from 'classnames';

const Save = ( { attributes } ) => {
	return (
		<div className={ classnames( 'is-loading', attributes.className ) }>
			<InnerBlocks.Content />
		</div>
	);
};

export default Save;
woocommerce-blocks/assets/js/blocks/single-product/index.js000064400000001412151335517640020145 0ustar00/**
 * External dependencies
 */
import { __ } from '@wordpress/i18n';
import { registerExperimentalBlockType } from '@woocommerce/block-settings';

/**
 * Internal dependencies
 */
import edit from './edit';
import save from './save';
import attributes from './attributes';
import {
	BLOCK_NAME,
	BLOCK_TITLE,
	BLOCK_ICON,
	BLOCK_DESCRIPTION,
} from './constants';

const settings = {
	title: BLOCK_TITLE,
	icon: {
		src: BLOCK_ICON,
		foreground: '#96588a',
	},
	category: 'woocommerce',
	keywords: [ __( 'WooCommerce', 'woocommerce' ) ],
	description: BLOCK_DESCRIPTION,
	supports: {
		align: [ 'wide', 'full' ],
		html: false,
	},
	example: {
		attributes: {
			isPreview: true,
		},
	},
	attributes,
	edit,
	save,
};

registerExperimentalBlockType( BLOCK_NAME, settings );
woocommerce-blocks/assets/js/blocks/product-new/index.js000064400000002452151335517640017462 0ustar00/**
 * External dependencies
 */
import { __ } from '@wordpress/i18n';
import { createBlock, registerBlockType } from '@wordpress/blocks';
import { without } from 'lodash';
import { Icon, exclamation } from '@woocommerce/icons';

/**
 * Internal dependencies
 */
import Block from './block';
import sharedAttributes, {
	sharedAttributeBlockTypes,
} from '../../utils/shared-attributes';

registerBlockType( 'woocommerce/product-new', {
	title: __( 'Newest Products', 'woocommerce' ),
	icon: {
		src: <Icon srcElement={ exclamation } />,
		foreground: '#96588a',
	},
	category: 'woocommerce',
	keywords: [ __( 'WooCommerce', 'woocommerce' ) ],
	description: __(
		'Display a grid of your newest products.',
		'woocommerce'
	),
	supports: {
		align: [ 'wide', 'full' ],
		html: false,
	},
	attributes: {
		...sharedAttributes,
	},
	example: {
		attributes: {
			isPreview: true,
		},
	},
	transforms: {
		from: [
			{
				type: 'block',
				blocks: without(
					sharedAttributeBlockTypes,
					'woocommerce/product-new'
				),
				transform: ( attributes ) =>
					createBlock( 'woocommerce/product-new', attributes ),
			},
		],
	},

	/**
	 * Renders and manages the block.
	 *
	 * @param {Object} props Props to pass to block.
	 */
	edit( props ) {
		return <Block { ...props } />;
	},

	save() {
		return null;
	},
} );
woocommerce-blocks/assets/js/blocks/product-new/block.js000064400000005573151335517640017454 0ustar00/**
 * External dependencies
 */
import { __ } from '@wordpress/i18n';
import { Component } from '@wordpress/element';
import { Disabled, PanelBody } from '@wordpress/components';
import { InspectorControls } from '@wordpress/block-editor';
import ServerSideRender from '@wordpress/server-side-render';
import PropTypes from 'prop-types';
import GridContentControl from '@woocommerce/editor-components/grid-content-control';
import GridLayoutControl from '@woocommerce/editor-components/grid-layout-control';
import ProductCategoryControl from '@woocommerce/editor-components/product-category-control';
import { gridBlockPreview } from '@woocommerce/resource-previews';
import { getSetting } from '@woocommerce/settings';

/**
 * Component to handle edit mode of "Newest Products".
 */
class ProductNewestBlock extends Component {
	getInspectorControls() {
		const { attributes, setAttributes } = this.props;
		const {
			categories,
			catOperator,
			columns,
			contentVisibility,
			rows,
			alignButtons,
		} = attributes;

		return (
			<InspectorControls key="inspector">
				<PanelBody
					title={ __( 'Layout', 'woocommerce' ) }
					initialOpen
				>
					<GridLayoutControl
						columns={ columns }
						rows={ rows }
						alignButtons={ alignButtons }
						setAttributes={ setAttributes }
						minColumns={ getSetting( 'min_columns', 1 ) }
						maxColumns={ getSetting( 'max_columns', 6 ) }
						minRows={ getSetting( 'min_rows', 1 ) }
						maxRows={ getSetting( 'max_rows', 6 ) }
					/>
				</PanelBody>
				<PanelBody
					title={ __( 'Content', 'woocommerce' ) }
					initialOpen
				>
					<GridContentControl
						settings={ contentVisibility }
						onChange={ ( value ) =>
							setAttributes( { contentVisibility: value } )
						}
					/>
				</PanelBody>
				<PanelBody
					title={ __(
						'Filter by Product Category',
						'woocommerce'
					) }
					initialOpen={ false }
				>
					<ProductCategoryControl
						selected={ categories }
						onChange={ ( value = [] ) => {
							const ids = value.map( ( { id } ) => id );
							setAttributes( { categories: ids } );
						} }
						operator={ catOperator }
						onOperatorChange={ ( value = 'any' ) =>
							setAttributes( { catOperator: value } )
						}
					/>
				</PanelBody>
			</InspectorControls>
		);
	}

	render() {
		const { attributes, name } = this.props;

		if ( attributes.isPreview ) {
			return gridBlockPreview;
		}

		return (
			<>
				{ this.getInspectorControls() }
				<Disabled>
					<ServerSideRender
						block={ name }
						attributes={ attributes }
					/>
				</Disabled>
			</>
		);
	}
}

ProductNewestBlock.propTypes = {
	/**
	 * The attributes for this block
	 */
	attributes: PropTypes.object.isRequired,
	/**
	 * The register block name.
	 */
	name: PropTypes.string.isRequired,
	/**
	 * A callback to update attributes
	 */
	setAttributes: PropTypes.func.isRequired,
};

export default ProductNewestBlock;
woocommerce-blocks/assets/js/blocks/cart-checkout/payment-methods/test/payment-methods.js000064400000006656151335517640026065 0ustar00/**
 * External dependencies
 */
import { render, screen, fireEvent, waitFor } from '@testing-library/react';
import {
	registerPaymentMethod,
	__experimentalDeRegisterPaymentMethod,
} from '@woocommerce/blocks-registry';
import {
	PaymentMethodDataProvider,
	usePaymentMethodDataContext,
} from '@woocommerce/base-context';

/**
 * Internal dependencies
 */
import * as useStoreCartHook from '../../../../base/context/hooks/cart/use-store-cart';

// Somewhere in your test case or test suite
useStoreCartHook.useStoreCart = jest
	.fn()
	.mockReturnValue( useStoreCartHook.defaultCartData );

/**
 * Internal dependencies
 */
import PaymentMethods from '../payment-methods';

jest.mock( '../saved-payment-method-options', () => ( { onChange } ) => {
	return (
		<>
			<span>Saved payment method options</span>
			<button onClick={ () => onChange( '0' ) }>Select saved</button>
		</>
	);
} );

jest.mock(
	'@woocommerce/base-components/radio-control-accordion',
	() => ( { onChange } ) => (
		<>
			<span>Payment method options</span>
			<button onClick={ () => onChange( 'stripe' ) }>
				Select new payment
			</button>
		</>
	)
);

const registerMockPaymentMethods = () => {
	[ 'stripe' ].forEach( ( name ) => {
		registerPaymentMethod( {
			name,
			label: name,
			content: <div>A payment method</div>,
			edit: <div>A payment method</div>,
			icons: null,
			canMakePayment: () => true,
			supports: {
				showSavedCards: true,
				showSaveOption: true,
				features: [ 'products' ],
			},
			ariaLabel: name,
		} );
	} );
};

const resetMockPaymentMethods = () => {
	[ 'stripe' ].forEach( ( name ) => {
		__experimentalDeRegisterPaymentMethod( name );
	} );
};

describe( 'PaymentMethods', () => {
	test( 'should show no payment methods component when there are no payment methods', async () => {
		render(
			<PaymentMethodDataProvider>
				<PaymentMethods />
			</PaymentMethodDataProvider>
		);

		await waitFor( () => {
			const noPaymentMethods = screen.queryAllByText(
				/no payment methods available/
			);
			// We might get more than one match because the `speak()` function
			// creates an extra `div` with the notice contents used for a11y.
			expect( noPaymentMethods.length ).toBeGreaterThanOrEqual( 1 );
		} );
	} );

	test( 'selecting new payment method', async () => {
		const ShowActivePaymentMethod = () => {
			const {
				activePaymentMethod,
				activeSavedToken,
			} = usePaymentMethodDataContext();
			return (
				<>
					<div>
						{ 'Active Payment Method: ' + activePaymentMethod }
					</div>
					<div>{ 'Active Saved Token: ' + activeSavedToken }</div>
				</>
			);
		};

		registerMockPaymentMethods();
		render(
			<PaymentMethodDataProvider>
				<PaymentMethods />
				<ShowActivePaymentMethod />
			</PaymentMethodDataProvider>
		);

		await waitFor( () => {
			const savedPaymentMethodOptions = screen.queryByText(
				/Saved payment method options/
			);
			const paymentMethodOptions = screen.queryByText(
				/Payment method options/
			);
			expect( savedPaymentMethodOptions ).not.toBeNull();
			expect( paymentMethodOptions ).not.toBeNull();
			const savedToken = screen.queryByText(
				/Active Payment Method: stripe/
			);
			expect( savedToken ).toBeNull();
		} );

		fireEvent.click( screen.getByText( 'Select new payment' ) );

		await waitFor( () => {
			const activePaymentMethod = screen.queryByText(
				/Active Payment Method: stripe/
			);
			expect( activePaymentMethod ).not.toBeNull();
		} );

		resetMockPaymentMethods();
	} );
} );
woocommerce-blocks/assets/js/blocks/cart-checkout/payment-methods/saved-payment-method-options.js000064400000011762151335517640027506 0ustar00/**
 * External dependencies
 */
import {
	useEffect,
	useRef,
	useCallback,
	cloneElement,
} from '@wordpress/element';
import { __, sprintf } from '@wordpress/i18n';
import { usePaymentMethodDataContext } from '@woocommerce/base-context';
import RadioControl from '@woocommerce/base-components/radio-control';
import {
	usePaymentMethodInterface,
	usePaymentMethods,
} from '@woocommerce/base-context/hooks';
import { getPaymentMethods } from '@woocommerce/blocks-registry';

/**
 * @typedef {import('@woocommerce/type-defs/contexts').CustomerPaymentMethod} CustomerPaymentMethod
 * @typedef {import('@woocommerce/type-defs/contexts').PaymentStatusDispatch} PaymentStatusDispatch
 */

/**
 * Returns the option object for a cc or echeck saved payment method token.
 *
 * @param {CustomerPaymentMethod} savedPaymentMethod
 * @param {function(string):void} setActivePaymentMethod
 * @param {PaymentStatusDispatch} setPaymentStatus
 * @return {Object} An option objects to use for RadioControl.
 */
const getCcOrEcheckPaymentMethodOption = (
	{ method, expires, tokenId },
	setActivePaymentMethod,
	setPaymentStatus
) => {
	return {
		value: tokenId + '',
		label: sprintf(
			/* translators: %1$s is referring to the payment method brand, %2$s is referring to the last 4 digits of the payment card, %3$s is referring to the expiry date.  */
			__(
				'%1$s ending in %2$s (expires %3$s)',
				'woo-gutenberg-product-blocks'
			),
			method.brand,
			method.last4,
			expires
		),
		name: `wc-saved-payment-method-token-${ tokenId }`,
		onChange: ( token ) => {
			const savedTokenKey = `wc-${ method.gateway }-payment-token`;
			setActivePaymentMethod( method.gateway );
			setPaymentStatus().started( {
				payment_method: method.gateway,
				[ savedTokenKey ]: token + '',
				isSavedToken: true,
			} );
		},
	};
};

/**
 * Returns the option object for any non specific saved payment method.
 *
 * @param {CustomerPaymentMethod} savedPaymentMethod
 * @param {function(string):void} setActivePaymentMethod
 * @param {PaymentStatusDispatch} setPaymentStatus
 *
 * @return {Object} An option objects to use for RadioControl.
 */
const getDefaultPaymentMethodOptions = (
	{ method, tokenId },
	setActivePaymentMethod,
	setPaymentStatus
) => {
	return {
		value: tokenId + '',
		label: sprintf(
			/* translators: %s is the name of the payment method gateway. */
			__( 'Saved token for %s', 'woocommerce' ),
			method.gateway
		),
		name: `wc-saved-payment-method-token-${ tokenId }`,
		onChange: ( token ) => {
			const savedTokenKey = `wc-${ method.gateway }-payment-token`;
			setActivePaymentMethod( method.gateway );
			setPaymentStatus().started( {
				payment_method: method.gateway,
				[ savedTokenKey ]: token + '',
				isSavedToken: true,
			} );
		},
	};
};

const SavedPaymentMethodOptions = () => {
	const {
		setPaymentStatus,
		customerPaymentMethods,
		activePaymentMethod,
		setActivePaymentMethod,
		activeSavedToken,
		setActiveSavedToken,
	} = usePaymentMethodDataContext();
	const standardMethods = getPaymentMethods();
	const { paymentMethods } = usePaymentMethods();
	const paymentMethodInterface = usePaymentMethodInterface();

	/**
	 * @type      {Object} Options
	 * @property  {Array}  current  The current options on the type.
	 */
	const currentOptions = useRef( [] );

	const updateToken = useCallback(
		( token ) => {
			setActiveSavedToken( token );
		},
		[ setActiveSavedToken ]
	);

	useEffect( () => {
		const types = Object.keys( customerPaymentMethods );
		const options = types
			.flatMap( ( type ) => {
				const typeMethods = customerPaymentMethods[ type ];
				return typeMethods.map( ( paymentMethod ) => {
					const option =
						type === 'cc' || type === 'echeck'
							? getCcOrEcheckPaymentMethodOption(
									paymentMethod,
									setActivePaymentMethod,
									setPaymentStatus
							  )
							: getDefaultPaymentMethodOptions(
									paymentMethod,
									setActivePaymentMethod,
									setPaymentStatus
							  );
					if (
						! activePaymentMethod &&
						paymentMethod.is_default &&
						activeSavedToken === ''
					) {
						updateToken( paymentMethod.tokenId + '' );
						option.onChange( paymentMethod.tokenId );
					}
					return option;
				} );
			} )
			.filter( Boolean );
		currentOptions.current = options;
	}, [
		customerPaymentMethods,
		updateToken,
		activeSavedToken,
		activePaymentMethod,
		setActivePaymentMethod,
		setPaymentStatus,
		standardMethods,
	] );

	const savedPaymentMethodHandler =
		!! activeSavedToken &&
		paymentMethods[ activePaymentMethod ] &&
		paymentMethods[ activePaymentMethod ]?.savedTokenComponent
			? cloneElement(
					paymentMethods[ activePaymentMethod ]?.savedTokenComponent,
					{ token: activeSavedToken, ...paymentMethodInterface }
			  )
			: null;

	return currentOptions.current.length > 0 ? (
		<>
			<RadioControl
				id={ 'wc-payment-method-saved-tokens' }
				selected={ activeSavedToken }
				onChange={ updateToken }
				options={ currentOptions.current }
			/>
			{ savedPaymentMethodHandler }
		</>
	) : null;
};

export default SavedPaymentMethodOptions;
woocommerce-blocks/assets/js/blocks/cart-checkout/payment-methods/payment-method-options.js000064400000004661151335517640026406 0ustar00/**
 * External dependencies
 */
import {
	usePaymentMethods,
	usePaymentMethodInterface,
	useEmitResponse,
	useStoreNotices,
} from '@woocommerce/base-context/hooks';
import { cloneElement } from '@wordpress/element';
import {
	useEditorContext,
	usePaymentMethodDataContext,
} from '@woocommerce/base-context';
import classNames from 'classnames';
import RadioControlAccordion from '@woocommerce/base-components/radio-control-accordion';

/**
 * Internal dependencies
 */
import PaymentMethodCard from './payment-method-card';

/**
 * Component used to render all non-saved payment method options.
 *
 * @return {*} The rendered component.
 */
const PaymentMethodOptions = () => {
	const {
		setActivePaymentMethod,
		activeSavedToken,
		setActiveSavedToken,
		isExpressPaymentMethodActive,
		customerPaymentMethods,
	} = usePaymentMethodDataContext();
	const { paymentMethods } = usePaymentMethods();
	const {
		activePaymentMethod,
		...paymentMethodInterface
	} = usePaymentMethodInterface();
	const { noticeContexts } = useEmitResponse();
	const { removeNotice } = useStoreNotices();
	const { isEditor } = useEditorContext();

	const options = Object.keys( paymentMethods ).map( ( name ) => {
		const { edit, content, label, supports } = paymentMethods[ name ];
		const component = isEditor ? edit : content;
		return {
			value: name,
			label:
				typeof label === 'string'
					? label
					: cloneElement( label, {
							components: paymentMethodInterface.components,
					  } ),
			name: `wc-saved-payment-method-token-${ name }`,
			content: (
				<PaymentMethodCard showSaveOption={ supports.showSaveOption }>
					{ cloneElement( component, {
						activePaymentMethod,
						...paymentMethodInterface,
					} ) }
				</PaymentMethodCard>
			),
		};
	} );

	const updateToken = ( value ) => {
		setActivePaymentMethod( value );
		setActiveSavedToken( '' );
		removeNotice( 'wc-payment-error', noticeContexts.PAYMENTS );
	};

	const isSinglePaymentMethod =
		Object.keys( customerPaymentMethods ).length === 0 &&
		Object.keys( paymentMethods ).length === 1;

	const singleOptionClass = classNames( {
		'disable-radio-control': isSinglePaymentMethod,
	} );

	return isExpressPaymentMethodActive ? null : (
		<RadioControlAccordion
			id={ 'wc-payment-method-options' }
			className={ singleOptionClass }
			selected={ activeSavedToken ? null : activePaymentMethod }
			onChange={ updateToken }
			options={ options }
		/>
	);
};

export default PaymentMethodOptions;
assets/js/blocks/cart-checkout/payment-methods/express-payment/cart-express-payment.js000064400000003751151335517640031141 0ustar00woocommerce-blocks/**
 * External dependencies
 */
import { __ } from '@wordpress/i18n';
import {
	useEmitResponse,
	useExpressPaymentMethods,
} from '@woocommerce/base-context/hooks';
import {
	StoreNoticesProvider,
	useCheckoutContext,
	usePaymentMethodDataContext,
} from '@woocommerce/base-context';
import LoadingMask from '@woocommerce/base-components/loading-mask';

/**
 * Internal dependencies
 */
import ExpressPaymentMethods from '../express-payment-methods';
import './style.scss';

const CartExpressPayment = () => {
	const { paymentMethods, isInitialized } = useExpressPaymentMethods();
	const { noticeContexts } = useEmitResponse();
	const {
		isCalculating,
		isProcessing,
		isAfterProcessing,
		isBeforeProcessing,
		isComplete,
		hasError,
	} = useCheckoutContext();
	const { currentStatus: paymentStatus } = usePaymentMethodDataContext();

	if (
		! isInitialized ||
		( isInitialized && Object.keys( paymentMethods ).length === 0 )
	) {
		return null;
	}

	// Set loading state for express payment methods when payment or checkout is in progress.
	const checkoutProcessing =
		isProcessing ||
		isAfterProcessing ||
		isBeforeProcessing ||
		( isComplete && ! hasError );

	return (
		<>
			<LoadingMask
				isLoading={
					isCalculating ||
					checkoutProcessing ||
					paymentStatus.isDoingExpressPayment
				}
			>
				<div className="wc-block-components-express-payment wc-block-components-express-payment--cart">
					<div className="wc-block-components-express-payment__content">
						<StoreNoticesProvider
							context={ noticeContexts.EXPRESS_PAYMENTS }
						>
							<ExpressPaymentMethods />
						</StoreNoticesProvider>
					</div>
				</div>
			</LoadingMask>
			<div className="wc-block-components-express-payment-continue-rule wc-block-components-express-payment-continue-rule--cart">
				{ /* translators: Shown in the Cart block between the express payment methods and the Proceed to Checkout button */ }
				{ __( 'Or', 'woocommerce' ) }
			</div>
		</>
	);
};

export default CartExpressPayment;
woocommerce-blocks/assets/js/blocks/cart-checkout/payment-methods/express-payment/style.scss000064400000006023151335517640026617 0ustar00$border-width: 1px;
$border-radius: 5px;

.wc-block-components-express-payment {
	margin: auto;
	position: relative;

	.wc-block-components-express-payment__event-buttons {
		list-style: none;
		display: flex;
		flex-direction: row;
		flex-wrap: wrap;
		width: 100%;
		padding: 0;
		margin: 0;
		overflow: hidden;
		text-align: center;

		> li {
			margin: 0;

			> img {
				width: 100%;
				height: 48px;
			}
		}
	}
}

.wc-block-components-express-payment--checkout {
	margin-top: $border-radius;

	.wc-block-components-express-payment__title-container {
		display: flex;
		flex-direction: row;
		left: 0;
		position: absolute;
		right: 0;
		top: -$border-radius;
		vertical-align: middle;

		// Pseudo-elements used to show the border before and after the title.
		&::before {
			border-left: $border-width solid currentColor;
			border-top: $border-width solid currentColor;
			border-radius: $border-radius 0 0 0;
			content: "";
			display: block;
			height: $border-radius - $border-width;
			margin-right: $gap-small;
			opacity: 0.3;
			pointer-events: none;
			width: #{$gap-large - $gap-small - $border-width * 2};
		}

		&::after {
			border-right: $border-width solid currentColor;
			border-top: $border-width solid currentColor;
			border-radius: 0 $border-radius 0 0;
			content: "";
			display: block;
			height: $border-radius - $border-width;
			margin-left: $gap-small;
			opacity: 0.3;
			pointer-events: none;
			flex-grow: 1;
		}
	}

	.wc-block-components-express-payment__title {
		flex-grow: 0;
		transform: translateY(-50%);
	}

	.wc-block-components-express-payment__content {
		@include with-translucent-border(0 $border-width $border-width);
		padding: em($gap-large) #{$gap-large - $border-width};

		&::after {
			border-radius: 0 0 $border-radius $border-radius;
		}

		> p {
			margin-bottom: em($gap);
		}
	}

	.wc-block-components-express-payment__event-buttons {
		> li {
			display: inline-block;
			width: 50%;
		}

		> li:nth-child(even) {
			padding-left: $gap-smaller;
		}

		> li:nth-child(odd) {
			padding-right: $gap-smaller;
		}
	}
}

.wc-block-components-express-payment--cart {
	.wc-block-components-express-payment__event-buttons {
		> li {
			padding-bottom: $gap;
			text-align: center;
			width: 100%;

			&:last-child {
				padding-bottom: 0;
			}
		}
	}
}

.wc-block-components-express-payment-continue-rule {
	display: flex;
	align-items: center;
	text-align: center;
	padding: 0 $gap-large;
	margin: $gap-large 0;

	&::before {
		margin-right: 10px;
	}
	&::after {
		margin-left: 10px;
	}
	&::before,
	&::after {
		content: " ";
		flex: 1;
		border-bottom: 1px solid;
		opacity: 0.3;
	}
}

.wc-block-components-express-payment-continue-rule--cart {
	margin: $gap 0;
	text-transform: uppercase;
}

.theme-twentynineteen {
	.wc-block-components-express-payment__title::before {
		display: none;
	}
}

// For Twenty Twenty we need to increase specificity of the title.
.theme-twentytwenty {
	.wc-block-components-express-payment .wc-block-components-express-payment__title {
		padding-left: $gap-small;
		padding-right: $gap-small;
	}
}
woocommerce-blocks/assets/js/blocks/cart-checkout/payment-methods/express-payment/index.js000064400000000236151335517640026227 0ustar00export { default as CartExpressPayment } from './cart-express-payment.js';
export { default as CheckoutExpressPayment } from './checkout-express-payment.js';
assets/js/blocks/cart-checkout/payment-methods/express-payment/checkout-express-payment.js000064400000005413151335517640032012 0ustar00woocommerce-blocks/**
 * External dependencies
 */
import { __ } from '@wordpress/i18n';
import {
	useEmitResponse,
	useExpressPaymentMethods,
} from '@woocommerce/base-context/hooks';
import {
	StoreNoticesProvider,
	useCheckoutContext,
	usePaymentMethodDataContext,
	useEditorContext,
} from '@woocommerce/base-context';
import Title from '@woocommerce/base-components/title';
import LoadingMask from '@woocommerce/base-components/loading-mask';
import { CURRENT_USER_IS_ADMIN } from '@woocommerce/settings';

/**
 * Internal dependencies
 */
import ExpressPaymentMethods from '../express-payment-methods';
import './style.scss';

const CheckoutExpressPayment = () => {
	const {
		isCalculating,
		isProcessing,
		isAfterProcessing,
		isBeforeProcessing,
		isComplete,
		hasError,
	} = useCheckoutContext();
	const { currentStatus: paymentStatus } = usePaymentMethodDataContext();
	const { paymentMethods, isInitialized } = useExpressPaymentMethods();
	const { isEditor } = useEditorContext();
	const { noticeContexts } = useEmitResponse();

	if (
		! isInitialized ||
		( isInitialized && Object.keys( paymentMethods ).length === 0 )
	) {
		// Make sure errors are shown in the editor and for admins. For example,
		// when a payment method fails to register.
		if ( isEditor || CURRENT_USER_IS_ADMIN ) {
			return (
				<StoreNoticesProvider
					context={ noticeContexts.EXPRESS_PAYMENTS }
				></StoreNoticesProvider>
			);
		}
		return null;
	}

	// Set loading state for express payment methods when payment or checkout is in progress.
	const checkoutProcessing =
		isProcessing ||
		isAfterProcessing ||
		isBeforeProcessing ||
		( isComplete && ! hasError );

	return (
		<>
			<LoadingMask
				isLoading={
					isCalculating ||
					checkoutProcessing ||
					paymentStatus.isDoingExpressPayment
				}
			>
				<div className="wc-block-components-express-payment wc-block-components-express-payment--checkout">
					<div className="wc-block-components-express-payment__title-container">
						<Title
							className="wc-block-components-express-payment__title"
							headingLevel="2"
						>
							{ __(
								'Express checkout',
								'woocommerce'
							) }
						</Title>
					</div>
					<div className="wc-block-components-express-payment__content">
						<StoreNoticesProvider
							context={ noticeContexts.EXPRESS_PAYMENTS }
						>
							<p>
								{ __(
									'In a hurry? Use one of our express checkout options:',
									'woocommerce'
								) }
							</p>
							<ExpressPaymentMethods />
						</StoreNoticesProvider>
					</div>
				</div>
			</LoadingMask>
			<div className="wc-block-components-express-payment-continue-rule wc-block-components-express-payment-continue-rule--checkout">
				{ __( 'Or continue below', 'woocommerce' ) }
			</div>
		</>
	);
};

export default CheckoutExpressPayment;
woocommerce-blocks/assets/js/blocks/cart-checkout/payment-methods/payment-method-error-boundary.js000064400000002661151335517640027663 0ustar00/**
 * External dependencies
 */
import { __ } from '@wordpress/i18n';
import { Component } from 'react';
import PropTypes from 'prop-types';
import { CURRENT_USER_IS_ADMIN } from '@woocommerce/settings';
import { StoreNoticesContainer } from '@woocommerce/base-context';

class PaymentMethodErrorBoundary extends Component {
	state = { errorMessage: '', hasError: false };

	static getDerivedStateFromError( error ) {
		return {
			errorMessage: error.message,
			hasError: true,
		};
	}

	render() {
		const { hasError, errorMessage } = this.state;
		const { isEditor } = this.props;

		if ( hasError ) {
			let errorText = __(
				'This site is experiencing difficulties with this payment method. Please contact the owner of the site for assistance.',
				'woocommerce'
			);
			if ( isEditor || CURRENT_USER_IS_ADMIN ) {
				if ( errorMessage ) {
					errorText = errorMessage;
				} else {
					errorText = __(
						"There was an error with this payment method. Please verify it's configured correctly.",
						'woocommerce'
					);
				}
			}
			const notices = [
				{
					id: '0',
					content: errorText,
					isDismissible: false,
					status: 'error',
				},
			];
			return <StoreNoticesContainer notices={ notices } />;
		}

		return this.props.children;
	}
}

PaymentMethodErrorBoundary.propTypes = {
	isEditor: PropTypes.bool,
};

PaymentMethodErrorBoundary.defaultProps = {
	isEditor: false,
};

export default PaymentMethodErrorBoundary;
woocommerce-blocks/assets/js/blocks/cart-checkout/payment-methods/payment-methods.js000064400000002624151335517640025075 0ustar00/**
 * External dependencies
 */
import { usePaymentMethods } from '@woocommerce/base-context/hooks';
import { __ } from '@wordpress/i18n';
import Label from '@woocommerce/base-components/label';
import { usePaymentMethodDataContext } from '@woocommerce/base-context';

/**
 * Internal dependencies
 */
import NoPaymentMethods from './no-payment-methods';
import PaymentMethodOptions from './payment-method-options';
import SavedPaymentMethodOptions from './saved-payment-method-options';

/**
 * PaymentMethods component.
 *
 * @return {*} The rendered component.
 */
const PaymentMethods = () => {
	const { isInitialized, paymentMethods } = usePaymentMethods();
	const { customerPaymentMethods } = usePaymentMethodDataContext();

	if ( isInitialized && Object.keys( paymentMethods ).length === 0 ) {
		return <NoPaymentMethods />;
	}

	return (
		<>
			<SavedPaymentMethodOptions />
			{ Object.keys( customerPaymentMethods ).length > 0 && (
				<Label
					label={ __(
						'Use another payment method.',
						'woocommerce'
					) }
					screenReaderLabel={ __(
						'Other available payment methods',
						'woocommerce'
					) }
					wrapperElement="p"
					wrapperProps={ {
						className: [
							'wc-block-components-checkout-step__description wc-block-components-checkout-step__description-payments-aligned',
						],
					} }
				/>
			) }
			<PaymentMethodOptions />
		</>
	);
};

export default PaymentMethods;
woocommerce-blocks/assets/js/blocks/cart-checkout/payment-methods/index.js000064400000000464151335517640023066 0ustar00export { default as PaymentMethods } from './payment-methods';
export { default as ExpressPaymentMethods } from './express-payment-methods';
export { CartExpressPayment, CheckoutExpressPayment } from './express-payment';
export { default as SavedPaymentMethodOptions } from './saved-payment-method-options';
woocommerce-blocks/assets/js/blocks/cart-checkout/payment-methods/payment-method-card.js000064400000003250151335517640025615 0ustar00/**
 * External dependencies
 */
import { __ } from '@wordpress/i18n';
import {
	useCheckoutContext,
	useEditorContext,
	usePaymentMethodDataContext,
} from '@woocommerce/base-context';
import CheckboxControl from '@woocommerce/base-components/checkbox-control';
import PropTypes from 'prop-types';

/**
 * Internal dependencies
 */
import PaymentMethodErrorBoundary from './payment-method-error-boundary';

/**
 * Component used to render the contents of a payment method card.
 *
 * @param {Object}  props                Incoming props for the component.
 * @param {boolean} props.showSaveOption Whether that payment method allows saving
 *                                       the data for future purchases.
 * @param {Object}  props.children       Content of the payment method card.
 *
 * @return {*} The rendered component.
 */
const PaymentMethodCard = ( { children, showSaveOption } ) => {
	const { isEditor } = useEditorContext();
	const {
		shouldSavePayment,
		setShouldSavePayment,
	} = usePaymentMethodDataContext();
	const { customerId } = useCheckoutContext();

	return (
		<PaymentMethodErrorBoundary isEditor={ isEditor }>
			{ children }
			{ customerId > 0 && showSaveOption && (
				<CheckboxControl
					className="wc-block-components-payment-methods__save-card-info"
					label={ __(
						'Save payment information to my account for future purchases.',
						'woocommerce'
					) }
					checked={ shouldSavePayment }
					onChange={ () =>
						setShouldSavePayment( ! shouldSavePayment )
					}
				/>
			) }
		</PaymentMethodErrorBoundary>
	);
};

PaymentMethodCard.propTypes = {
	showSaveOption: PropTypes.bool,
	children: PropTypes.node,
};

export default PaymentMethodCard;
woocommerce-blocks/assets/js/blocks/cart-checkout/payment-methods/no-payment-methods/style.scss000064400000001027151335517640027202 0ustar00.components-placeholder.wc-block-checkout__no-payment-methods-placeholder {
	margin-bottom: $gap;

	* {
		pointer-events: all; // Overrides parent disabled component in editor context
	}

	.components-placeholder__fieldset {
		display: block;

		.components-button {
			background-color: $gray-900;
			color: $white;
		}

		.wc-block-checkout__no-payment-methods-placeholder-description {
			display: block;
			margin: 0.25em 0 1em 0;
		}
	}
}

.components-notice.wc-block-checkout__no-payment-methods-notice {
	margin-bottom: $gap;
}
woocommerce-blocks/assets/js/blocks/cart-checkout/payment-methods/no-payment-methods/index.js000064400000003732151335517640026617 0ustar00/**
 * External dependencies
 */
import { __ } from '@wordpress/i18n';
import { Placeholder, Button, Notice } from 'wordpress-components';
import { Icon, card } from '@woocommerce/icons';
import { ADMIN_URL } from '@woocommerce/settings';
import { useEditorContext } from '@woocommerce/base-context';
import classnames from 'classnames';

/**
 * Internal dependencies
 */
import './style.scss';

/**
 * Render content when no payment methods are found depending on context.
 */
const NoPaymentMethods = () => {
	const { isEditor } = useEditorContext();

	return isEditor ? (
		<NoPaymentMethodsPlaceholder />
	) : (
		<NoPaymentMethodsNotice />
	);
};

/**
 * Renders a placeholder in the editor.
 */
const NoPaymentMethodsPlaceholder = () => {
	return (
		<Placeholder
			icon={ <Icon srcElement={ card } /> }
			label={ __( 'Payment methods', 'woocommerce' ) }
			className="wc-block-checkout__no-payment-methods-placeholder"
		>
			<span className="wc-block-checkout__no-payment-methods-placeholder-description">
				{ __(
					'Your store does not have any payment methods configured that support the checkout block. Once you have configured a compatible payment method (e.g. Stripe) it will be shown here.',
					'woocommerce'
				) }
			</span>
			<Button
				isSecondary
				href={ `${ ADMIN_URL }admin.php?page=wc-settings&tab=checkout` }
				target="_blank"
				rel="noopener noreferrer"
			>
				{ __(
					'Configure Payment Methods',
					'woocommerce'
				) }
			</Button>
		</Placeholder>
	);
};

/**
 * Renders a notice on the frontend.
 */
const NoPaymentMethodsNotice = () => {
	return (
		<Notice
			isDismissible={ false }
			className={ classnames(
				'wc-block-checkout__no-payment-methods-notice',
				'woocommerce-message',
				'woocommerce-error'
			) }
		>
			{ __(
				'There are no payment methods available. This may be an error on our side. Please contact us if you need any help placing your order.',
				'woocommerce'
			) }
		</Notice>
	);
};

export default NoPaymentMethods;
woocommerce-blocks/assets/js/blocks/cart-checkout/payment-methods/express-payment-methods.js000064400000011330151335517640026556 0ustar00/**
 * External dependencies
 */
import { __ } from '@wordpress/i18n';
import {
	useExpressPaymentMethods,
	usePaymentMethodInterface,
} from '@woocommerce/base-context/hooks';
import {
	cloneElement,
	isValidElement,
	useCallback,
	useRef,
} from '@wordpress/element';
import {
	useEditorContext,
	usePaymentMethodDataContext,
} from '@woocommerce/base-context';
import deprecated from '@wordpress/deprecated';

/**
 * Internal dependencies
 */
import PaymentMethodErrorBoundary from './payment-method-error-boundary';

const ExpressPaymentMethods = () => {
	const { isEditor } = useEditorContext();
	const {
		setActivePaymentMethod,
		setExpressPaymentError,
		activePaymentMethod,
		paymentMethodData,
		setPaymentStatus,
	} = usePaymentMethodDataContext();
	const paymentMethodInterface = usePaymentMethodInterface();
	const { paymentMethods } = useExpressPaymentMethods();
	const previousActivePaymentMethod = useRef( activePaymentMethod );
	const previousPaymentMethodData = useRef( paymentMethodData );

	/**
	 * onExpressPaymentClick should be triggered when the express payment button is clicked.
	 *
	 * This will store the previous active payment method, set the express method as active, and set the payment status to started.
	 */
	const onExpressPaymentClick = useCallback(
		( paymentMethodId ) => () => {
			previousActivePaymentMethod.current = activePaymentMethod;
			previousPaymentMethodData.current = paymentMethodData;
			setPaymentStatus().started( {} );
			setActivePaymentMethod( paymentMethodId );
		},
		[
			activePaymentMethod,
			paymentMethodData,
			setActivePaymentMethod,
			setPaymentStatus,
		]
	);

	/**
	 * onExpressPaymentClose should be triggered when the express payment process is cancelled or closed.
	 *
	 * This restores the active method and returns the state to pristine.
	 */
	const onExpressPaymentClose = useCallback( () => {
		setPaymentStatus().pristine();
		setActivePaymentMethod( previousActivePaymentMethod.current );
		if ( previousPaymentMethodData.current.isSavedToken ) {
			setPaymentStatus().started( previousPaymentMethodData.current );
		}
	}, [ setActivePaymentMethod, setPaymentStatus ] );

	/**
	 * onExpressPaymentError should be triggered when the express payment process errors.
	 *
	 * This shows an error message then restores the active method and returns the state to pristine.
	 */
	const onExpressPaymentError = useCallback(
		( errorMessage ) => {
			setPaymentStatus().error( errorMessage );
			setExpressPaymentError( errorMessage );
			setActivePaymentMethod( previousActivePaymentMethod.current );
			if ( previousPaymentMethodData.current.isSavedToken ) {
				setPaymentStatus().started( previousPaymentMethodData.current );
			}
		},
		[ setActivePaymentMethod, setPaymentStatus, setExpressPaymentError ]
	);

	/**
	 * Calling setExpressPaymentError directly is deprecated.
	 */
	const deprecatedSetExpressPaymentError = useCallback(
		( errorMessage = '' ) => {
			deprecated(
				'Express Payment Methods should use the provided onError handler instead.',
				{
					alternative: 'onError',
					plugin: 'woocommerce-gutenberg-products-block',
					link:
						'https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/4228',
				}
			);
			if ( errorMessage ) {
				onExpressPaymentError( errorMessage );
			} else {
				setExpressPaymentError( '' );
			}
		},
		[ setExpressPaymentError, onExpressPaymentError ]
	);

	/**
	 * @todo Find a way to Memoize Express Payment Method Content
	 *
	 * Payment method content could potentially become a bottleneck if lots of logic is ran in the content component. It
	 * Currently re-renders excessively but is not easy to useMemo because paymentMethodInterface could become stale.
	 * paymentMethodInterface itself also updates on most renders.
	 */
	const entries = Object.entries( paymentMethods );
	const content =
		entries.length > 0 ? (
			entries.map( ( [ id, paymentMethod ] ) => {
				const expressPaymentMethod = isEditor
					? paymentMethod.edit
					: paymentMethod.content;
				return isValidElement( expressPaymentMethod ) ? (
					<li key={ id } id={ `express-payment-method-${ id }` }>
						{ cloneElement( expressPaymentMethod, {
							...paymentMethodInterface,
							onClick: onExpressPaymentClick( id ),
							onClose: onExpressPaymentClose,
							onError: onExpressPaymentError,
							setExpressPaymentError: deprecatedSetExpressPaymentError,
						} ) }
					</li>
				) : null;
			} )
		) : (
			<li key="noneRegistered">
				{ __(
					'No registered Payment Methods',
					'woocommerce'
				) }
			</li>
		);

	return (
		<PaymentMethodErrorBoundary isEditor={ isEditor }>
			<ul className="wc-block-components-express-payment__event-buttons">
				{ content }
			</ul>
		</PaymentMethodErrorBoundary>
	);
};

export default ExpressPaymentMethods;
woocommerce-blocks/assets/js/blocks/cart-checkout/payment-methods/style.scss000064400000013102151335517640023447 0ustar00.wc-block-card-elements {
	display: flex;
	width: 100%;

	.wc-block-components-validation-error {
		position: static;
	}
}

.wc-block-gateway-container {
	position: relative;
	margin-bottom: em($gap-large);
	white-space: nowrap;

	&.wc-card-number-element {
		flex-basis: 15em;
		flex-grow: 1;
		// Currently, min() CSS function calls need to be wrapped with unquote.
		min-width: unquote("min(15em, 60%)");
	}

	&.wc-card-expiry-element {
		flex-basis: 7em;
		margin-left: $gap-small;
		min-width: unquote("min(7em, calc(24% - #{$gap-small}))");
	}

	&.wc-card-cvc-element {
		flex-basis: 7em;
		margin-left: $gap-small;
		// Notice the min width ems value is smaller than flex-basis. That's because
		// by default we want it to have the same width as `expiry-element`, but
		// if available space is scarce, `cvc-element` should get smaller faster.
		min-width: unquote("min(5em, calc(16% - #{$gap-small}))");
	}

	.wc-block-gateway-input {
		@include font-size(regular);
		line-height: 1.375; // =22px when font-size is 16px.
		background-color: #fff;
		padding: em($gap-small) 0 em($gap-small) $gap;
		border-radius: 4px;
		border: 1px solid $input-border-gray;
		width: 100%;
		font-family: inherit;
		margin: 0;
		box-sizing: border-box;
		height: 3em;
		color: $input-text-active;
		cursor: text;

		&:focus {
			background-color: #fff;
		}
	}

	&:focus {
		background-color: #fff;
	}

	label {
		@include reset-typography();
		@include font-size(regular);
		line-height: 1.375; // =22px when font-size is 16px.
		position: absolute;
		transform: translateY(0.75em);
		left: 0;
		top: 0;
		transform-origin: top left;
		color: $gray-700;
		transition: transform 200ms ease;
		margin: 0 0 0 #{$gap + 1px};
		overflow: hidden;
		text-overflow: ellipsis;
		max-width: calc(100% - #{$gap + $gap-smaller});
		cursor: text;

		@media screen and (prefers-reduced-motion: reduce) {
			transition: none;
		}
	}

	&.wc-inline-card-element {
		label {
			// $gap is the padding of the input box, 1.5em the width of the card
			// icon and $gap-smaller the space between the card
			// icon and the label.
			margin-left: calc(#{$gap + $gap-smaller} + 1.5em);
		}
		.wc-block-gateway-input.focused.empty,
		.wc-block-gateway-input:not(.empty) {
			& + label {
				margin-left: $gap;
				transform: translateY(#{$gap-smallest}) scale(0.75);
			}
		}
		& + .wc-block-components-validation-error {
			position: static;
			margin-top: -$gap-large;
		}
	}

	.wc-block-gateway-input.focused.empty,
	.wc-block-gateway-input:not(.empty) {
		padding: em($gap-large) 0 em($gap-smallest) $gap;
		& + label {
			transform: translateY(#{$gap-smallest}) scale(0.75);
		}
	}

	.wc-block-gateway-input.has-error {
		border-color: $alert-red;
		&:focus {
			outline-color: $alert-red;
		}
	}

	.wc-block-gateway-input.has-error + label {
		color: $alert-red;
	}
}

// These elements have available space below, so we can display errors with a
// larger line height.
.is-medium,
.is-large {
	.wc-card-expiry-element,
	.wc-card-cvc-element {
		.wc-block-components-validation-error > p {
			line-height: 16px;
			padding-top: 4px;
		}
	}
}

.is-mobile,
.is-small {
	.wc-card-expiry-element,
	.wc-card-cvc-element {
		.wc-block-components-validation-error > p {
			min-height: 28px;
		}
	}
}

.wc-block-components-checkout-payment-methods * {
	pointer-events: all; // Overrides parent disabled component in editor context
}

.is-mobile,
.is-small {
	.wc-block-card-elements {
		flex-wrap: wrap;
	}

	.wc-block-gateway-container.wc-card-number-element {
		flex-basis: 100%;
	}

	.wc-block-gateway-container.wc-card-expiry-element {
		flex-basis: calc(50% - #{$gap-smaller});
		margin-left: 0;
		margin-right: $gap-smaller;
	}

	.wc-block-gateway-container.wc-card-cvc-element {
		flex-basis: calc(50% - #{$gap-smaller});
		margin-left: $gap-smaller;
	}
}

.wc-block-checkout__payment-method {
	.wc-block-components-radio-control__option {
		padding-left: 56px;

		&::after {
			content: none;
		}

		.wc-block-components-radio-control__input {
			left: 16px;
		}
	}

	// We need to add the first-child and last-child pseudoclasses for specificity.
	.wc-block-components-radio-control__option,
	.wc-block-components-radio-control__option:first-child,
	.wc-block-components-radio-control__option:last-child {
		margin: 0;
		padding-bottom: em($gap);
		padding-top: em($gap);
	}

	.wc-block-components-radio-control__option-checked {
		font-weight: bold;
	}

	.wc-block-components-radio-control-accordion-option,
	.wc-block-components-radio-control__option {
		@include with-translucent-border(1px 1px 0 1px);
	}

	.wc-block-components-radio-control__option:last-child::after,
	.wc-block-components-radio-control-accordion-option:last-child::after {
		border-width: 1px;
	}

	.wc-block-components-radio-control-accordion-option {
		.wc-block-components-radio-control__option::after {
			border-width: 0;
		}
		.wc-block-components-radio-control__label {
			display: flex;
			align-items: center;
			justify-content: flex-start;
		}
		.wc-block-components-radio-control__label img {
			height: 24px;
			max-height: 24px;
			object-fit: contain;
			object-position: left;
		}
	}

	.wc-block-components-radio-control.disable-radio-control {
		.wc-block-components-radio-control__option {
			padding-left: 16px;
		}

		.wc-block-components-radio-control__input {
			display: none;
		}
	}

	.wc-block-components-checkout-step__description-payments-aligned {
		padding-top: 14px;
		height: 28px;
	}

}

.wc-block-components-radio-control-accordion-content {
	padding: 0 $gap em($gap) $gap;

	&:empty {
		display: none;
	}
}

.wc-block-checkout__order-notes {
	.wc-block-components-checkout-step__content {
		padding-bottom: 0;
	}
}
woocommerce-blocks/assets/js/blocks/cart-checkout/cart-i2/types.ts000064400000000436151335517640021257 0ustar00export type InnerBlockTemplate = [
	string,
	Record< string, unknown >,
	InnerBlockTemplate[] | undefined
];

export interface Attributes {
	isPreview: boolean;
	isShippingCalculatorEnabled: boolean;
	hasDarkControls: boolean;
	showRateAfterTaxName: boolean;
	checkoutPageId: number;
}
woocommerce-blocks/assets/js/blocks/cart-checkout/cart-i2/index.js000064400000001714151335517640021210 0ustar00/**
 * External dependencies
 */
import { __ } from '@wordpress/i18n';
import { Icon, cart } from '@woocommerce/icons';
import { registerFeaturePluginBlockType } from '@woocommerce/block-settings';

/**
 * Internal dependencies
 */
import { Edit, Save } from './edit';
import './style.scss';
import { blockName, blockAttributes } from './attributes';
import './inner-blocks';

/**
 * Register and run the Cart block.
 */
const settings = {
	title: __( 'Cart i2', 'woocommerce' ),
	icon: {
		src: <Icon srcElement={ cart } />,
		foreground: '#96588a',
	},
	category: 'woocommerce',
	keywords: [ __( 'WooCommerce', 'woocommerce' ) ],
	description: __( 'Shopping cart.', 'woocommerce' ),
	supports: {
		align: false,
		html: false,
		multiple: false,
		__experimentalExposeControlsToChildren: true,
	},
	example: {
		attributes: {
			isPreview: true,
		},
	},
	attributes: blockAttributes,
	edit: Edit,
	save: Save,
};

registerFeaturePluginBlockType( blockName, settings );
woocommerce-blocks/assets/js/blocks/cart-checkout/cart-i2/empty-cart-edit/index.js000064400000003370151335517640024220 0ustar00/**
 * External dependencies
 */
import { __, sprintf } from '@wordpress/i18n';
import { InnerBlocks } from '@wordpress/block-editor';
import { SHOP_URL } from '@woocommerce/block-settings';
import PropTypes from 'prop-types';

/**
 * Internal dependencies
 */
import iconDataUri from './icon-data-uri.js';
import './style.scss';

const templateItemBrowseStore = SHOP_URL
	? [
			'core/paragraph',
			{
				align: 'center',
				content: sprintf(
					/* translators: %s is the link to the store product directory. */
					__(
						'<a href="%s">Browse store</a>.',
						'woocommerce'
					),
					SHOP_URL
				),
				dropCap: false,
			},
	  ]
	: null;

const templateItems = [
	[
		'core/image',
		{
			align: 'center',
			url: iconDataUri,
			sizeSlug: 'small',
		},
	],
	[
		'core/heading',
		{
			textAlign: 'center',
			content: __(
				'Your cart is currently empty!',
				'woocommerce'
			),
			level: 2,
			className: 'wc-block-cart__empty-cart__title',
		},
	],
	templateItemBrowseStore,
	[
		'core/separator',
		{
			className: 'is-style-dots',
		},
	],
	[
		'core/heading',
		{
			textAlign: 'center',
			content: __( 'New in store', 'woocommerce' ),
			level: 2,
		},
	],
	[
		'woocommerce/product-new',
		{
			columns: 3,
			rows: 1,
		},
	],
].filter( Boolean );

/**
 * Component to handle edit mode for the Cart block when cart is empty.
 *
 * @param {Object} props Incoming props for the component.
 * @param {boolean} props.hidden Whether this component is hidden or not.
 */
const EmptyCartEdit = ( { hidden = false } ) => {
	return (
		<div hidden={ hidden }>
			<InnerBlocks
				templateInsertUpdatesSelection={ false }
				template={ templateItems }
			/>
		</div>
	);
};

EmptyCartEdit.propTypes = {
	hidden: PropTypes.bool,
};

export default EmptyCartEdit;
woocommerce-blocks/assets/js/blocks/cart-checkout/cart-i2/empty-cart-edit/icon-data-uri.js000064400000002731151335517640025545 0ustar00export default 'data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzgiIGhlaWdodD0iMzgiIHZpZXdCb3g9IjAgMCAzOCAzOCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTE5IDBDOC41MDQwMyAwIDAgOC41MDQwMyAwIDE5QzAgMjkuNDk2IDguNTA0MDMgMzggMTkgMzhDMjkuNDk2IDM4IDM4IDI5LjQ5NiAzOCAxOUMzOCA4LjUwNDAzIDI5LjQ5NiAwIDE5IDBaTTI1LjEyOSAxMi44NzFDMjYuNDg1MSAxMi44NzEgMjcuNTgwNiAxMy45NjY1IDI3LjU4MDYgMTUuMzIyNkMyNy41ODA2IDE2LjY3ODYgMjYuNDg1MSAxNy43NzQyIDI1LjEyOSAxNy43NzQyQzIzLjc3MyAxNy43NzQyIDIyLjY3NzQgMTYuNjc4NiAyMi42Nzc0IDE1LjMyMjZDMjIuNjc3NCAxMy45NjY1IDIzLjc3MyAxMi44NzEgMjUuMTI5IDEyLjg3MVpNMTEuNjQ1MiAzMS4yNTgxQzkuNjE0OTIgMzEuMjU4MSA3Ljk2Nzc0IDI5LjY0OTIgNy45Njc3NCAyNy42NTczQzcuOTY3NzQgMjYuMTI1IDEwLjE1MTIgMjMuMDI5OCAxMS4xNTQ4IDIxLjY5NjhDMTEuNCAyMS4zNjczIDExLjg5MDMgMjEuMzY3MyAxMi4xMzU1IDIxLjY5NjhDMTMuMTM5MSAyMy4wMjk4IDE1LjMyMjYgMjYuMTI1IDE1LjMyMjYgMjcuNjU3M0MxNS4zMjI2IDI5LjY0OTIgMTMuNjc1NCAzMS4yNTgxIDExLjY0NTIgMzEuMjU4MVpNMTIuODcxIDE3Ljc3NDJDMTEuNTE0OSAxNy43NzQyIDEwLjQxOTQgMTYuNjc4NiAxMC40MTk0IDE1LjMyMjZDMTAuNDE5NCAxMy45NjY1IDExLjUxNDkgMTIuODcxIDEyLjg3MSAxMi44NzFDMTQuMjI3IDEyLjg3MSAxNS4zMjI2IDEzLjk2NjUgMTUuMzIyNiAxNS4zMjI2QzE1LjMyMjYgMTYuNjc4NiAxNC4yMjcgMTcuNzc0MiAxMi44NzEgMTcuNzc0MlpNMjUuOTEwNSAyOS41ODc5QzI0LjE5NDQgMjcuNTM0NyAyMS42NzM4IDI2LjM1NDggMTkgMjYuMzU0OEMxNy4zNzU4IDI2LjM1NDggMTcuMzc1OCAyMy45MDMyIDE5IDIzLjkwMzJDMjIuNDAxNiAyMy45MDMyIDI1LjYxMTcgMjUuNDA0OCAyNy43ODc1IDI4LjAyNUMyOC44NDQ4IDI5LjI4MTUgMjYuOTI5NCAzMC44MjE0IDI1LjkxMDUgMjkuNTg3OVoiIGZpbGw9ImJsYWNrIi8+Cjwvc3ZnPgo=';
woocommerce-blocks/assets/js/blocks/cart-checkout/cart-i2/empty-cart-edit/style.scss000064400000000165151335517640024607 0ustar00.wc-block-cart__empty-cart__title,
.editor-styles-wrapper .wc-block-cart__empty-cart__title {
	font-size: inherit;
}
woocommerce-blocks/assets/js/blocks/cart-checkout/cart-i2/full-cart/cart-line-items-table.tsx000064400000002627151335517640026262 0ustar00/**
 * External dependencies
 */
import { __ } from '@wordpress/i18n';
import { CartResponseItem } from '@woocommerce/type-defs/cart-response';

/**
 * Internal dependencies
 */
import CartLineItemRow from './cart-line-item-row';

const placeholderRows = [ ...Array( 3 ) ].map( ( _x, i ) => (
	<CartLineItemRow lineItem={ {} } key={ i } />
) );

interface CartLineItemsTableProps {
	lineItems: CartResponseItem[];
	isLoading: boolean;
}

const CartLineItemsTable = ( {
	lineItems = [],
	isLoading = false,
}: CartLineItemsTableProps ): JSX.Element => {
	const products = isLoading
		? placeholderRows
		: lineItems.map( ( lineItem ) => {
				return (
					<CartLineItemRow
						key={ lineItem.key }
						lineItem={ lineItem }
					/>
				);
		  } );

	return (
		<table className="wc-block-cart-items">
			<thead>
				<tr className="wc-block-cart-items__header">
					<th className="wc-block-cart-items__header-image">
						<span>
							{ __( 'Product', 'woo-gutenberg-products-block' ) }
						</span>
					</th>
					<th className="wc-block-cart-items__header-product">
						<span>
							{ __( 'Details', 'woo-gutenberg-products-block' ) }
						</span>
					</th>
					<th className="wc-block-cart-items__header-total">
						<span>
							{ __( 'Total', 'woo-gutenberg-products-block' ) }
						</span>
					</th>
				</tr>
			</thead>
			<tbody>{ products }</tbody>
		</table>
	);
};

export default CartLineItemsTable;
woocommerce-blocks/assets/js/blocks/cart-checkout/cart-i2/full-cart/index.tsx000064400000012225151335517640023302 0ustar00/**
 * External dependencies
 */
import { __ } from '@wordpress/i18n';
import {
	TotalsCoupon,
	TotalsDiscount,
	TotalsFooterItem,
	TotalsShipping,
} from '@woocommerce/base-components/cart-checkout';
import {
	Subtotal,
	TotalsFees,
	TotalsTaxes,
	TotalsWrapper,
	ExperimentalOrderMeta,
	ExperimentalDiscountsMeta,
} from '@woocommerce/blocks-checkout';
import { getCurrencyFromPriceResponse } from '@woocommerce/price-format';
import {
	useStoreCartCoupons,
	useStoreCart,
	useStoreNotices,
} from '@woocommerce/base-context/hooks';
import classnames from 'classnames';
import {
	Sidebar,
	SidebarLayout,
	Main,
} from '@woocommerce/base-components/sidebar-layout';
import Title from '@woocommerce/base-components/title';
import { getSetting } from '@woocommerce/settings';
import { useEffect } from '@wordpress/element';
import { decodeEntities } from '@wordpress/html-entities';

/**
 * Internal dependencies
 */
import CheckoutButton from '../checkout-button';
import CartLineItemsTitle from './cart-line-items-title';
import CartLineItemsTable from './cart-line-items-table';
import { CartExpressPayment } from '../../payment-methods';
import './style.scss';

interface CartAttributes {
	hasDarkControls: boolean;
	isShippingCalculatorEnabled: boolean;
	checkoutPageId: number;
	isPreview: boolean;
	showRateAfterTaxName: boolean;
}

interface CartProps {
	attributes: CartAttributes;
}
/**
 * Component that renders the Cart block when user has something in cart aka "full".
 *
 * @param {Object} props Incoming props for the component.
 * @param {Object} props.attributes Incoming attributes for block.
 */
const Cart = ( { attributes }: CartProps ): JSX.Element => {
	const {
		isShippingCalculatorEnabled,
		hasDarkControls,
		showRateAfterTaxName,
	} = attributes;

	const {
		cartItems,
		cartFees,
		cartTotals,
		cartIsLoading,
		cartItemsCount,
		cartItemErrors,
		cartNeedsPayment,
		cartNeedsShipping,
	} = useStoreCart();

	const {
		applyCoupon,
		removeCoupon,
		isApplyingCoupon,
		isRemovingCoupon,
		appliedCoupons,
	} = useStoreCartCoupons();

	const { addErrorNotice } = useStoreNotices();

	// Ensures any cart errors listed in the API response get shown.
	useEffect( () => {
		cartItemErrors.forEach( ( error ) => {
			addErrorNotice( decodeEntities( error.message ), {
				isDismissible: true,
				id: error.code,
			} );
		} );
	}, [ addErrorNotice, cartItemErrors ] );

	const totalsCurrency = getCurrencyFromPriceResponse( cartTotals );

	const cartClassName = classnames( 'wc-block-cart', {
		'wc-block-cart--is-loading': cartIsLoading,
		'has-dark-controls': hasDarkControls,
	} );

	// Prepare props to pass to the ExperimentalOrderMeta slot fill.
	// We need to pluck out receiveCart.
	// eslint-disable-next-line no-unused-vars
	const { extensions, ...cart } = useStoreCart();
	const slotFillProps = {
		extensions,
		cart,
	};

	const discountsSlotFillProps = {
		extensions,
		cart,
	};

	return (
		<>
			<CartLineItemsTitle itemCount={ cartItemsCount } />
			<SidebarLayout className={ cartClassName }>
				<Main className="wc-block-cart__main">
					<CartLineItemsTable
						lineItems={ cartItems }
						isLoading={ cartIsLoading }
					/>
				</Main>
				<Sidebar className="wc-block-cart__sidebar">
					<Title
						headingLevel="2"
						className="wc-block-cart__totals-title"
					>
						{ __( 'Cart totals', 'woo-gutenberg-products-block' ) }
					</Title>
					<TotalsWrapper>
						<Subtotal
							currency={ totalsCurrency }
							values={ cartTotals }
						/>
						<TotalsFees
							currency={ totalsCurrency }
							cartFees={ cartFees }
						/>
						<TotalsDiscount
							cartCoupons={ appliedCoupons }
							currency={ totalsCurrency }
							isRemovingCoupon={ isRemovingCoupon }
							removeCoupon={ removeCoupon }
							values={ cartTotals }
						/>
					</TotalsWrapper>
					{ getSetting( 'couponsEnabled', true ) && (
						<TotalsWrapper>
							<TotalsCoupon
								onSubmit={ applyCoupon }
								isLoading={ isApplyingCoupon }
							/>
						</TotalsWrapper>
					) }
					<ExperimentalDiscountsMeta.Slot
						{ ...discountsSlotFillProps }
					/>
					{ cartNeedsShipping && (
						<TotalsWrapper>
							<TotalsShipping
								showCalculator={ isShippingCalculatorEnabled }
								showRateSelector={ true }
								values={ cartTotals }
								currency={ totalsCurrency }
							/>
						</TotalsWrapper>
					) }
					{ ! getSetting( 'displayCartPricesIncludingTax', false ) &&
						parseInt( cartTotals.total_tax, 10 ) > 0 && (
							<TotalsWrapper>
								<TotalsTaxes
									showRateAfterTaxName={
										showRateAfterTaxName
									}
									currency={ totalsCurrency }
									values={ cartTotals }
								/>
							</TotalsWrapper>
						) }
					<TotalsWrapper>
						<TotalsFooterItem
							currency={ totalsCurrency }
							values={ cartTotals }
						/>
					</TotalsWrapper>

					<ExperimentalOrderMeta.Slot { ...slotFillProps } />

					<div className="wc-block-cart__payment-options">
						{ cartNeedsPayment && <CartExpressPayment /> }
						<CheckoutButton
							link={ getSetting(
								'page-' + attributes?.checkoutPageId,
								false
							) }
						/>
					</div>
				</Sidebar>
			</SidebarLayout>
		</>
	);
};

export default Cart;
woocommerce-blocks/assets/js/blocks/cart-checkout/cart-i2/full-cart/cart-line-item-row.tsx000064400000020050151335517640025605 0ustar00/**
 * External dependencies
 */
import classnames from 'classnames';
import { __ } from '@wordpress/i18n';
import QuantitySelector from '@woocommerce/base-components/quantity-selector';
import ProductPrice from '@woocommerce/base-components/product-price';
import ProductName from '@woocommerce/base-components/product-name';
import {
	useStoreCartItemQuantity,
	useStoreEvents,
	useStoreCart,
} from '@woocommerce/base-context/hooks';
import {
	ProductBackorderBadge,
	ProductImage,
	ProductLowStockBadge,
	ProductMetadata,
	ProductSaleBadge,
} from '@woocommerce/base-components/cart-checkout';
import {
	getCurrencyFromPriceResponse,
	Currency,
} from '@woocommerce/price-format';
import {
	__experimentalApplyCheckoutFilter,
	mustContain,
} from '@woocommerce/blocks-checkout';
import Dinero from 'dinero.js';
import { useMemo } from '@wordpress/element';
import type { CartItem } from '@woocommerce/type-defs/cart';
import { objectHasProp } from '@woocommerce/types';
import { getSetting } from '@woocommerce/settings';

/**
 * Convert a Dinero object with precision to store currency minor unit.
 *
 * @param {Dinero} priceObject Price object to convert.
 * @param {Object} currency    Currency data.
 * @return {number} Amount with new minor unit precision.
 */
const getAmountFromRawPrice = (
	priceObject: Dinero.Dinero,
	currency: Currency
) => {
	return priceObject.convertPrecision( currency.minorUnit ).getAmount();
};

const productPriceValidation = ( value ) => mustContain( value, '<price/>' );

/**
 * Cart line item table row component.
 *
 * @param {Object} props
 * @param {CartItem|Object} props.lineItem
 */
const CartLineItemRow = ( {
	lineItem,
}: {
	lineItem: CartItem | Record< string, never >;
} ): JSX.Element => {
	const {
		name: initialName = '',
		catalog_visibility: catalogVisibility = 'visible',
		short_description: shortDescription = '',
		description: fullDescription = '',
		low_stock_remaining: lowStockRemaining = null,
		show_backorder_badge: showBackorderBadge = false,
		quantity_limit: quantityLimit = 99,
		permalink = '',
		images = [],
		variation = [],
		item_data: itemData = [],
		prices = {
			currency_code: 'USD',
			currency_minor_unit: 2,
			currency_symbol: '$',
			currency_prefix: '$',
			currency_suffix: '',
			currency_decimal_separator: '.',
			currency_thousand_separator: ',',
			price: '0',
			regular_price: '0',
			sale_price: '0',
			price_range: null,
			raw_prices: {
				precision: 6,
				price: '0',
				regular_price: '0',
				sale_price: '0',
			},
		},
		totals = {
			currency_code: 'USD',
			currency_minor_unit: 2,
			currency_symbol: '$',
			currency_prefix: '$',
			currency_suffix: '',
			currency_decimal_separator: '.',
			currency_thousand_separator: ',',
			line_subtotal: '0',
			line_subtotal_tax: '0',
		},
		extensions,
	} = lineItem;

	const {
		quantity,
		setItemQuantity,
		removeItem,
		isPendingDelete,
	} = useStoreCartItemQuantity( lineItem );
	const { dispatchStoreEvent } = useStoreEvents();

	// Prepare props to pass to the __experimentalApplyCheckoutFilter filter.
	// We need to pluck out receiveCart.
	// eslint-disable-next-line no-unused-vars
	const { receiveCart, ...cart } = useStoreCart();
	const arg = useMemo(
		() => ( {
			context: 'cart',
			cartItem: lineItem,
			cart,
		} ),
		[ lineItem, cart ]
	);
	const priceCurrency = getCurrencyFromPriceResponse( prices );
	const name = __experimentalApplyCheckoutFilter( {
		filterName: 'itemName',
		defaultValue: initialName,
		extensions,
		arg,
	} );

	const regularAmountSingle = Dinero( {
		amount: parseInt( prices.raw_prices.regular_price, 10 ),
		precision: prices.raw_prices.precision,
	} );
	const purchaseAmountSingle = Dinero( {
		amount: parseInt( prices.raw_prices.price, 10 ),
		precision: prices.raw_prices.precision,
	} );
	const saleAmountSingle = regularAmountSingle.subtract(
		purchaseAmountSingle
	);
	const saleAmount = saleAmountSingle.multiply( quantity );
	const totalsCurrency = getCurrencyFromPriceResponse( totals );
	let lineSubtotal = parseInt( totals.line_subtotal, 10 );
	if ( getSetting( 'displayCartPricesIncludingTax', false ) ) {
		lineSubtotal += parseInt( totals.line_subtotal_tax, 10 );
	}
	const subtotalPrice = Dinero( {
		amount: lineSubtotal,
		precision: totalsCurrency.minorUnit,
	} );

	const firstImage = images.length ? images[ 0 ] : {};
	const isProductHiddenFromCatalog =
		catalogVisibility === 'hidden' || catalogVisibility === 'search';

	// Allow extensions to filter how the price is displayed. Ie: prepending or appending some values.

	const productPriceFormat = __experimentalApplyCheckoutFilter( {
		filterName: 'cartItemPrice',
		defaultValue: '<price/>',
		extensions,
		arg,
		validation: productPriceValidation,
	} );

	const subtotalPriceFormat = __experimentalApplyCheckoutFilter( {
		filterName: 'subtotalPriceFormat',
		defaultValue: '<price/>',
		extensions,
		arg,
		validation: productPriceValidation,
	} );

	const saleBadgePriceFormat = __experimentalApplyCheckoutFilter( {
		filterName: 'saleBadgePriceFormat',
		defaultValue: '<price/>',
		extensions,
		arg,
		validation: productPriceValidation,
	} );

	return (
		<tr
			className={ classnames( 'wc-block-cart-items__row', {
				'is-disabled': isPendingDelete,
			} ) }
		>
			{ /* If the image has no alt text, this link is unnecessary and can be hidden. */ }
			<td
				className="wc-block-cart-item__image"
				aria-hidden={
					! objectHasProp( firstImage, 'alt' ) || ! firstImage.alt
				}
			>
				{ /* We don't need to make it focusable, because product name has the same link. */ }
				{ isProductHiddenFromCatalog ? (
					<ProductImage image={ firstImage } />
				) : (
					<a href={ permalink } tabIndex={ -1 }>
						<ProductImage image={ firstImage } />
					</a>
				) }
			</td>
			<td className="wc-block-cart-item__product">
				<ProductName
					disabled={ isPendingDelete || isProductHiddenFromCatalog }
					name={ name }
					permalink={ permalink }
				/>
				{ showBackorderBadge ? (
					<ProductBackorderBadge />
				) : (
					!! lowStockRemaining && (
						<ProductLowStockBadge
							lowStockRemaining={ lowStockRemaining }
						/>
					)
				) }

				<div className="wc-block-cart-item__prices">
					<ProductPrice
						currency={ priceCurrency }
						regularPrice={ getAmountFromRawPrice(
							regularAmountSingle,
							priceCurrency
						) }
						price={ getAmountFromRawPrice(
							purchaseAmountSingle,
							priceCurrency
						) }
						format={ subtotalPriceFormat }
					/>
				</div>

				<ProductSaleBadge
					currency={ priceCurrency }
					saleAmount={ getAmountFromRawPrice(
						saleAmountSingle,
						priceCurrency
					) }
					format={ saleBadgePriceFormat }
				/>

				<ProductMetadata
					shortDescription={ shortDescription }
					fullDescription={ fullDescription }
					itemData={ itemData }
					variation={ variation }
				/>

				<div className="wc-block-cart-item__quantity">
					<QuantitySelector
						disabled={ isPendingDelete }
						quantity={ quantity }
						maximum={ quantityLimit }
						onChange={ ( newQuantity ) => {
							setItemQuantity( newQuantity );
							dispatchStoreEvent( 'cart-set-item-quantity', {
								product: lineItem,
								quantity: newQuantity,
							} );
						} }
						itemName={ name }
					/>
					<button
						className="wc-block-cart-item__remove-link"
						onClick={ () => {
							removeItem();
							dispatchStoreEvent( 'cart-remove-item', {
								product: lineItem,
								quantity,
							} );
						} }
						disabled={ isPendingDelete }
					>
						{ __( 'Remove item', 'woo-gutenberg-products-block' ) }
					</button>
				</div>
			</td>
			<td className="wc-block-cart-item__total">
				<div className="wc-block-cart-item__total-price-and-sale-badge-wrapper">
					<ProductPrice
						currency={ totalsCurrency }
						format={ productPriceFormat }
						price={ subtotalPrice.getAmount() }
					/>

					{ quantity > 1 && (
						<ProductSaleBadge
							currency={ priceCurrency }
							saleAmount={ getAmountFromRawPrice(
								saleAmount,
								priceCurrency
							) }
							format={ saleBadgePriceFormat }
						/>
					) }
				</div>
			</td>
		</tr>
	);
};

export default CartLineItemRow;
woocommerce-blocks/assets/js/blocks/cart-checkout/cart-i2/full-cart/style.scss000064400000012143151335517640023467 0ustar00.wc-block-cart {
	.wc-block-components-shipping-calculator {
		white-space: nowrap;
	}

	.wc-block-components-address-form {
		.wc-block-components-text-input,
		.wc-block-components-country-input,
		.wc-block-components-state-input {
			&:first-of-type {
				margin-top: 0;
			}
		}
	}
}

table.wc-block-cart-items,
table.wc-block-cart-items th,
table.wc-block-cart-items td {
	// Override Storefront theme gray table background.
	background: none !important;
	// Remove borders on default themes.
	border: 0;
	margin: 0;
}

.editor-styles-wrapper table.wc-block-cart-items,
table.wc-block-cart-items {
	width: 100%;

	.wc-block-cart-items__header {
		@include font-size(smaller);
		text-transform: uppercase;

		.wc-block-cart-items__header-image {
			width: 100px;
		}
		.wc-block-cart-items__header-product {
			visibility: hidden;
		}
		.wc-block-cart-items__header-total {
			width: 100px;
			text-align: right;
		}
	}
	.wc-block-cart-items__row {
		.wc-block-cart-item__image img {
			width: 100%;
			margin: 0;
		}
		.wc-block-cart-item__quantity {
			.wc-block-cart-item__remove-link {
				@include link-button;
				@include font-size(smaller);

				text-transform: none;
				white-space: nowrap;
			}
		}
		.wc-block-components-product-name {
			display: block;
			max-width: max-content;
		}
		.wc-block-cart-item__total {
			@include font-size(regular);
			text-align: right;
			line-height: inherit;
		}
		.wc-block-components-product-metadata {
			margin-bottom: 0.75em;
		}

		&.is-disabled {
			opacity: 0.5;
			pointer-events: none;
			transition: opacity 200ms ease;
		}
	}
}

.wc-block-cart {
	.wc-block-components-totals-taxes,
	.wc-block-components-totals-footer-item {
		margin: 0;
	}
}

// Loading placeholder state.
.wc-block-cart--is-loading,
.wc-block-mini-cart__drawer.is-loading {
	th span,
	h2 span {
		@include placeholder();
		@include force-content();
		min-width: 84px;
		display: inline-block;
	}
	h2 span {
		min-width: 33%;
	}
	.wc-block-components-product-price,
	.wc-block-components-product-metadata,
	.wc-block-components-quantity-selector {
		@include placeholder();
	}
	.wc-block-components-product-name {
		@include placeholder();
		@include force-content();
		min-width: 84px;
		display: inline-block;
	}
	.wc-block-components-product-metadata {
		margin-top: 0.25em;
		min-width: 8em;
	}
	.wc-block-cart-item__remove-link {
		visibility: hidden;
	}
	.wc-block-cart-item__image > a {
		@include placeholder();
		display: block;
	}
	.wc-block-components-product-price {
		@include force-content();
		max-width: 3em;
		display: block;
		margin-top: 0.25em;
	}
	.wc-block-cart__sidebar .components-card {
		@include placeholder();
		@include force-content();
		min-height: 460px;
	}
}
.wc-block-components-sidebar-layout.wc-block-cart--skeleton {
	display: none;
}
.is-loading + .wc-block-components-sidebar-layout.wc-block-cart--skeleton {
	display: flex;
}

.wc-block-cart-item__total-price-and-sale-badge-wrapper {
	display: flex;
	flex-direction: column;
	align-items: flex-end;

	.wc-block-components-sale-badge {
		margin-top: $gap-smallest;
	}
}

.is-small,
.is-mobile {
	.wc-block-cart-item__total {
		.wc-block-components-sale-badge {
			display: none;
		}
	}
}

.is-medium,
.is-small,
.is-mobile {
	&.wc-block-cart {
		.wc-block-components-sidebar {
			.wc-block-cart__totals-title {
				display: none;
			}
		}
	}
	table.wc-block-cart-items {
		td {
			padding: 0;
		}
		.wc-block-cart-items__header {
			display: none;
		}
		.wc-block-cart-item__remove-link {
			display: none;
		}
		.wc-block-cart-items__row {
			@include with-translucent-border(0 0 1px);
			display: grid;
			grid-template-columns: 80px 132px;
			padding: $gap 0;

			.wc-block-cart-item__image {
				grid-column-start: 1;
				grid-row-start: 1;
				padding-right: $gap;
			}
			.wc-block-cart-item__product {
				grid-column-start: 2;
				grid-column-end: 4;
				grid-row-start: 1;
				justify-self: stretch;
				padding: 0 $gap $gap 0;
			}
			.wc-block-cart-item__quantity {
				grid-column-start: 1;
				grid-row-start: 2;
				vertical-align: bottom;
				padding-right: $gap;
				align-self: end;
				padding-top: $gap;
			}
			.wc-block-cart-item__total {
				grid-row-start: 1;

				.wc-block-components-formatted-money-amount {
					display: inline-block;
				}
			}
		}
	}
}

.is-large.wc-block-cart {
	.wc-block-cart-items {
		@include with-translucent-border(0 0 1px);

		th {
			padding: 0.25rem $gap 0.25rem 0;
			white-space: nowrap;
		}
		td {
			@include with-translucent-border(1px 0 0);
			padding: $gap 0 $gap $gap;
			vertical-align: top;
		}
		th:last-child {
			padding-right: 0;
		}
		td:last-child {
			padding-right: $gap;
		}
	}

	.wc-block-components-radio-control__input {
		left: 0;
	}

	.wc-block-cart__totals-title {
		@include text-heading();
		@include font-size(smaller);
		display: block;
		font-weight: 600;
		padding: 0.25rem 0;
		text-align: right;
		text-transform: uppercase;
	}

	.wc-block-components-sidebar {
		.wc-block-components-shipping-calculator,
		.wc-block-components-shipping-rates-control__package:not(.wc-block-components-panel) {
			padding-left: $gap;
			padding-right: $gap;
		}
	}

	.wc-block-cart__payment-options {
		padding: $gap;
	}
}
woocommerce-blocks/assets/js/blocks/cart-checkout/cart-i2/full-cart/cart-line-items-title.tsx000064400000001036151335517640026305 0ustar00/**
 * External dependencies
 */
import { _n, sprintf } from '@wordpress/i18n';
import Title from '@woocommerce/base-components/title';

const CartLineItemsTitle = ( {
	itemCount = 1,
}: {
	itemCount: number;
} ): JSX.Element => {
	return (
		<Title headingLevel="2">
			{ sprintf(
				/* translators: %d is the count of items in the cart. */
				_n(
					'Your cart (%d item)',
					'Your cart (%d items)',
					itemCount,
					'woo-gutenberg-products-block'
				),
				itemCount
			) }
		</Title>
	);
};

export default CartLineItemsTitle;
woocommerce-blocks/assets/js/blocks/cart-checkout/cart-i2/frontend.js000064400000003000151335517640021706 0ustar00/**
 * External dependencies
 */
import {
	withStoreCartApiHydration,
	withRestApiHydration,
} from '@woocommerce/block-hocs';
import { getValidBlockAttributes } from '@woocommerce/base-utils';
import { Children, cloneElement, isValidElement } from '@wordpress/element';
import { useStoreCart } from '@woocommerce/base-context';
import { useValidation } from '@woocommerce/base-context/hooks';
import { getRegisteredBlockComponents } from '@woocommerce/blocks-registry';

import { renderParentBlock } from '@woocommerce/atomic-utils';

/**
 * Internal dependencies
 */
import './inner-blocks/register-components';
import Block from './block';
import { blockName, blockAttributes } from './attributes';

const getProps = ( el ) => {
	return {
		attributes: getValidBlockAttributes(
			blockAttributes,
			!! el ? el.dataset : {}
		),
	};
};

const Wrapper = ( { children } ) => {
	// we need to pluck out receiveCart.
	// eslint-disable-next-line no-unused-vars
	const { extensions, receiveCart, ...cart } = useStoreCart();
	const validation = useValidation();
	return Children.map( children, ( child ) => {
		if ( isValidElement( child ) ) {
			const componentProps = {
				extensions,
				cart,
				validation,
			};
			return cloneElement( child, componentProps );
		}
		return child;
	} );
};

renderParentBlock( {
	Block: withStoreCartApiHydration( withRestApiHydration( Block ) ),
	blockName,
	selector: '.wp-block-woocommerce-cart-i2',
	getProps,
	blockMap: getRegisteredBlockComponents( blockName ),
	blockWrapper: Wrapper,
} );
woocommerce-blocks/assets/js/blocks/cart-checkout/cart-i2/edit.tsx000064400000015240151335517640021227 0ustar00/* tslint:disable */
/**
 * External dependencies
 */
import classnames from 'classnames';
import { __ } from '@wordpress/i18n';
import { CartCheckoutFeedbackPrompt } from '@woocommerce/editor-components/feedback-prompt';
import {
	useBlockProps,
	InnerBlocks,
	InspectorControls,
	BlockControls,
} from '@wordpress/block-editor';
import { PanelBody, ToggleControl, Notice } from '@wordpress/components';
import { CartCheckoutCompatibilityNotice } from '@woocommerce/editor-components/compatibility-notices';
import { CART_PAGE_ID } from '@woocommerce/block-settings';
import BlockErrorBoundary from '@woocommerce/base-components/block-error-boundary';
import {
	EditorProvider,
	useEditorContext,
	CartProvider,
} from '@woocommerce/base-context';
import { createInterpolateElement } from '@wordpress/element';
import { getAdminLink, getSetting } from '@woocommerce/settings';
import { previewCart } from '@woocommerce/resource-previews';
import { Icon, filledCart, removeCart } from '@woocommerce/icons';

/**
 * Internal dependencies
 */
import './editor.scss';
import { addClassToBody, useBlockPropsWithLocking } from './hacks';
import { useViewSwitcher } from './use-view-switcher';
import type { Attributes } from './types';
import { CartBlockContext } from './context';

// This is adds a class to body to signal if the selected block is locked
addClassToBody();

// Array of allowed block names.
const ALLOWED_BLOCKS: string[] = [
	'woocommerce/filled-cart-block',
	'woocommerce/empty-cart-block',
];

const BlockSettings = ( {
	attributes,
	setAttributes,
}: {
	attributes: Attributes;
	setAttributes: ( attributes: Record< string, unknown > ) => undefined;
} ): JSX.Element => {
	const { isShippingCalculatorEnabled, showRateAfterTaxName } = attributes;
	const { currentPostId } = useEditorContext();
	return (
		<InspectorControls>
			{ currentPostId !== CART_PAGE_ID && (
				<Notice
					className="wc-block-cart__page-notice"
					isDismissible={ false }
					status="warning"
				>
					{ createInterpolateElement(
						__(
							'If you would like to use this block as your default cart you must update your <a>page settings in WooCommerce</a>.',
							'woo-gutenberg-products-block'
						),
						{
							a: (
								// eslint-disable-next-line jsx-a11y/anchor-has-content
								<a
									href={ getAdminLink(
										'admin.php?page=wc-settings&tab=advanced'
									) }
									target="_blank"
									rel="noopener noreferrer"
								/>
							),
						}
					) }
				</Notice>
			) }
			{ getSetting( 'shippingEnabled', true ) && (
				<PanelBody
					title={ __(
						'Shipping rates',
						'woo-gutenberg-products-block'
					) }
				>
					<ToggleControl
						label={ __(
							'Shipping calculator',
							'woo-gutenberg-products-block'
						) }
						help={ __(
							'Allow customers to estimate shipping by entering their address.',
							'woo-gutenberg-products-block'
						) }
						checked={ isShippingCalculatorEnabled }
						onChange={ () =>
							setAttributes( {
								isShippingCalculatorEnabled: ! isShippingCalculatorEnabled,
							} )
						}
					/>
				</PanelBody>
			) }
			{ getSetting( 'taxesEnabled' ) &&
				getSetting( 'displayItemizedTaxes', false ) &&
				! getSetting( 'displayCartPricesIncludingTax', false ) && (
					<PanelBody
						title={ __( 'Taxes', 'woo-gutenberg-products-block' ) }
					>
						<ToggleControl
							label={ __(
								'Show rate after tax name',
								'woo-gutenberg-products-block'
							) }
							help={ __(
								'Show the percentage rate alongside each tax line in the summary.',
								'woo-gutenberg-products-block'
							) }
							checked={ showRateAfterTaxName }
							onChange={ () =>
								setAttributes( {
									showRateAfterTaxName: ! showRateAfterTaxName,
								} )
							}
						/>
					</PanelBody>
				) }
			<CartCheckoutFeedbackPrompt />
		</InspectorControls>
	);
};

/**
 * Component to handle edit mode of "Cart Block".
 */
export const Edit = ( {
	className,
	attributes,
	setAttributes,
	clientId,
}: {
	className: string;
	attributes: Attributes;
	setAttributes: ( attributes: Record< string, unknown > ) => undefined;
	clientId: string;
} ): JSX.Element => {
	const { currentView, component: ViewSwitcherComponent } = useViewSwitcher(
		clientId,
		[
			{
				view: 'woocommerce/filled-cart-block',
				label: __( 'Filled Cart', 'woo-gutenberg-products-block' ),
				icon: <Icon srcElement={ filledCart } />,
			},
			{
				view: 'woocommerce/empty-cart-block',
				label: __( 'Empty Cart', 'woo-gutenberg-products-block' ),
				icon: <Icon srcElement={ removeCart } />,
			},
		]
	);
	const cartClassName = classnames( {
		'has-dark-controls': attributes.hasDarkControls,
	} );
	const defaultInnerBlocksTemplate = [
		[
			'woocommerce/filled-cart-block',
			{},
			[
				[
					'woocommerce/cart-items-block',
					{},
					[ [ 'woocommerce/cart-line-items-block', {}, [] ] ],
				],
				[
					'woocommerce/cart-totals-block',
					{},
					[
						[ 'woocommerce/cart-order-summary-block', {}, [] ],
						[ 'woocommerce/cart-express-payment-block', {}, [] ],
						[ 'woocommerce/proceed-to-checkout-block', {}, [] ],
					],
				],
			],
		],
		[ 'woocommerce/empty-cart-block', {}, [] ],
	];
	const blockProps = useBlockPropsWithLocking( {
		className: classnames( className, 'wp-block-woocommerce-cart', {
			'is-editor-preview': attributes.isPreview,
		} ),
	} );

	return (
		<div { ...blockProps }>
			<BlockErrorBoundary
				header={ __(
					'Cart Block Error',
					'woo-gutenberg-products-block'
				) }
				text={ __(
					'There was an error whilst rendering the cart block. If this problem continues, try re-creating the block.',
					'woo-gutenberg-products-block'
				) }
				showErrorMessage={ true }
				errorMessagePrefix={ __(
					'Error message:',
					'woo-gutenberg-products-block'
				) }
			>
				<EditorProvider previewData={ { previewCart } }>
					<BlockSettings
						attributes={ attributes }
						setAttributes={ setAttributes }
					/>
					<BlockControls __experimentalShareWithChildBlocks>
						<ViewSwitcherComponent />
					</BlockControls>
					<CartBlockContext.Provider
						value={ {
							currentView,
						} }
					>
						<CartProvider>
							<div className={ cartClassName }>
								<InnerBlocks
									allowedBlocks={ ALLOWED_BLOCKS }
									template={ defaultInnerBlocksTemplate }
									templateLock="insert"
								/>
							</div>
						</CartProvider>
					</CartBlockContext.Provider>
				</EditorProvider>
			</BlockErrorBoundary>
			<CartCheckoutCompatibilityNotice blockName="cart" />
		</div>
	);
};

export const Save = (): JSX.Element => {
	return (
		<div
			{ ...useBlockProps.save( {
				className: 'wc-block-cart is-loading',
			} ) }
		>
			<InnerBlocks.Content />
		</div>
	);
};
woocommerce-blocks/assets/js/blocks/cart-checkout/cart-i2/style.scss000064400000000157151335517640021600 0ustar00.wp-block-woocommerce-cart.is-loading {
	display: none;
}

.wp-block-woocommerce-cart {
	margin-bottom: 3em;
}
woocommerce-blocks/assets/js/blocks/cart-checkout/cart-i2/block.js000064400000006143151335517640021174 0ustar00/**
 * External dependencies
 */
import { __ } from '@wordpress/i18n';
import { CART_STORE_KEY as storeKey } from '@woocommerce/block-data';
import { dispatch } from '@wordpress/data';
import { useStoreCart } from '@woocommerce/base-context/hooks';
import { useEffect } from '@wordpress/element';
import LoadingMask from '@woocommerce/base-components/loading-mask';
import { ValidationContextProvider } from '@woocommerce/base-context';
import { CURRENT_USER_IS_ADMIN } from '@woocommerce/settings';
import BlockErrorBoundary from '@woocommerce/base-components/block-error-boundary';
import { translateJQueryEventToNative } from '@woocommerce/base-utils';
import withScrollToTop from '@woocommerce/base-hocs/with-scroll-to-top';
import {
	StoreNoticesProvider,
	StoreSnackbarNoticesProvider,
	CartProvider,
} from '@woocommerce/base-context/providers';
import { SlotFillProvider } from '@woocommerce/blocks-checkout';

const reloadPage = () => void window.location.reload( true );

const Cart = ( { children } ) => {
	const { cartIsLoading } = useStoreCart();

	return (
		<LoadingMask showSpinner={ true } isLoading={ cartIsLoading }>
			<ValidationContextProvider>{ children }</ValidationContextProvider>
		</LoadingMask>
	);
};

const ScrollOnError = ( { scrollToTop } ) => {
	useEffect( () => {
		const invalidateCartData = () => {
			dispatch( storeKey ).invalidateResolutionForStore();
			scrollToTop();
		};

		// Make it so we can read jQuery events triggered by WC Core elements.
		const removeJQueryAddedToCartEvent = translateJQueryEventToNative(
			'added_to_cart',
			'wc-blocks_added_to_cart'
		);
		const removeJQueryRemovedFromCartEvent = translateJQueryEventToNative(
			'removed_from_cart',
			'wc-blocks_removed_from_cart'
		);

		document.body.addEventListener(
			'wc-blocks_added_to_cart',
			invalidateCartData
		);
		document.body.addEventListener(
			'wc-blocks_removed_from_cart',
			invalidateCartData
		);

		return () => {
			removeJQueryAddedToCartEvent();
			removeJQueryRemovedFromCartEvent();

			document.body.removeEventListener(
				'wc-blocks_added_to_cart',
				invalidateCartData
			);
			document.body.removeEventListener(
				'wc-blocks_removed_from_cart',
				invalidateCartData
			);
		};
	}, [ scrollToTop ] );

	return null;
};
const Block = ( { attributes, children, scrollToTop } ) => (
	<BlockErrorBoundary
		header={ __( 'Something went wrong…', 'woocommerce' ) }
		text={ __(
			'The cart has encountered an unexpected error. If the error persists, please get in touch with us for help.',
			'woocommerce'
		) }
		button={
			<button className="wc-block-button" onClick={ reloadPage }>
				{ __( 'Reload the page', 'woocommerce' ) }
			</button>
		}
		showErrorMessage={ CURRENT_USER_IS_ADMIN }
	>
		<StoreSnackbarNoticesProvider context="wc/cart">
			<StoreNoticesProvider context="wc/cart">
				<SlotFillProvider>
					<CartProvider>
						<Cart attributes={ attributes }>{ children }</Cart>
						<ScrollOnError scrollToTop={ scrollToTop } />
					</CartProvider>
				</SlotFillProvider>
			</StoreNoticesProvider>
		</StoreSnackbarNoticesProvider>
	</BlockErrorBoundary>
);
export default withScrollToTop( Block );
woocommerce-blocks/assets/js/blocks/cart-checkout/cart-i2/hacks.ts000064400000011345151335517640021205 0ustar00/**
 * HACKS
 *
 * This file contains functionality to "lock" blocks i.e. to prevent blocks being moved or deleted. This needs to be
 * kept in place until native support for locking is available in WordPress (estimated WordPress 5.9).
 */

/**
 * @todo Remove custom block locking (requires native WordPress support)
 */

/**
 * External dependencies
 */
import {
	useBlockProps,
	store as blockEditorStore,
} from '@wordpress/block-editor';
import { isTextField } from '@wordpress/dom';
import { subscribe, select as _select } from '@wordpress/data';
import { useEffect, useRef } from '@wordpress/element';
import { MutableRefObject } from 'react';
import { BACKSPACE, DELETE } from '@wordpress/keycodes';
import { hasFilter } from '@wordpress/hooks';
import { getBlockType } from '@wordpress/blocks';
/**
 * Toggle class on body.
 *
 * @param {string} className CSS Class name.
 * @param {boolean} add True to add, false to remove.
 */
const toggleBodyClass = ( className: string, add = true ) => {
	if ( add ) {
		window.document.body.classList.add( className );
	} else {
		window.document.body.classList.remove( className );
	}
};

/**
 * addClassToBody
 *
 * This components watches the current selected block and adds a class name to the body if that block is locked. If the
 * current block is not locked, it removes the class name. The appended body class is used to hide UI elements to prevent
 * the block from being deleted.
 *
 * We use a component so we can react to changes in the store.
 */
export const addClassToBody = (): void => {
	if ( ! hasFilter( 'blocks.registerBlockType', 'core/lock/addAttribute' ) ) {
		subscribe( () => {
			const blockEditorSelect = _select( blockEditorStore );

			if ( ! blockEditorSelect ) {
				return;
			}

			const selectedBlock = blockEditorSelect.getSelectedBlock();

			if ( ! selectedBlock ) {
				return;
			}

			toggleBodyClass(
				'wc-lock-selected-block--remove',
				!! selectedBlock?.attributes?.lock?.remove
			);

			toggleBodyClass(
				'wc-lock-selected-block--move',
				!! selectedBlock?.attributes?.lock?.move
			);
		} );
	}
};

const isBlockLocked = ( clientId: string ): boolean => {
	if ( ! clientId ) {
		return false;
	}
	const { getBlock } = _select( blockEditorStore );
	const block = getBlock( clientId );
	// If lock.remove is defined at the block instance (not using the default value)
	// Then we use it.
	if ( typeof block?.attributes?.lock?.remove === 'boolean' ) {
		return block.attributes.lock.remove;
	}

	// If we don't have lock on the block instance, we check the type
	const blockType = getBlockType( block.name );
	if ( typeof blockType?.attributes?.lock?.default?.remove === 'boolean' ) {
		return blockType?.attributes?.lock?.default?.remove;
	}
	// If nothing is defined, return false
	return false;
};

/**
 * This is a hook we use in conjunction with useBlockProps. Its goal is to check if of the block's children is locked and being deleted.
 * It will stop the keydown event from propagating to stop it from being deleted via the keyboard.
 *
 */
const useLockedChildren = ( {
	ref,
}: {
	ref: MutableRefObject< HTMLElement | undefined >;
} ): void => {
	const lockInCore = hasFilter(
		'blocks.registerBlockType',
		'core/lock/addAttribute'
	);

	const node = ref.current;
	return useEffect( () => {
		if ( ! node || lockInCore ) {
			return;
		}
		function onKeyDown( event: KeyboardEvent ) {
			const { keyCode, target } = event;

			if ( ! ( target instanceof HTMLElement ) ) {
				return;
			}
			// We're not trying to delete something here.
			if ( keyCode !== BACKSPACE && keyCode !== DELETE ) {
				return;
			}

			// We're in a field, so we should let text be deleted.
			if ( isTextField( target ) ) {
				return;
			}

			// Typecast to fix issue with isTextField.
			const targetNode = target as HTMLElement;

			// Our target isn't a block.
			if ( targetNode.dataset.block === undefined ) {
				return;
			}

			const clientId = targetNode.dataset.block;
			const isLocked = isBlockLocked( clientId );
			// Prevent the keyboard event from propogating if it supports locking.
			if ( isLocked ) {
				event.preventDefault();
				event.stopPropagation();
				event.stopImmediatePropagation();
			}
		}
		node.addEventListener( 'keydown', onKeyDown, {
			capture: true,
			passive: false,
		} );

		return () => {
			node.removeEventListener( 'keydown', onKeyDown, {
				capture: true,
			} );
		};
	}, [ node, lockInCore ] );
};

/**
 * This hook is a light wrapper to useBlockProps, it wraps that hook plus useLockBlock to pass data between them.
 */
export const useBlockPropsWithLocking = (
	props: Record< string, unknown > = {}
): Record< string, unknown > => {
	const ref = useRef< HTMLElement >();
	const blockProps = useBlockProps( { ref, ...props } );
	useLockedChildren( {
		ref,
	} );
	return blockProps;
};
woocommerce-blocks/assets/js/blocks/cart-checkout/cart-i2/editor.scss000064400000000630151335517640021722 0ustar00.wc-block-cart__page-notice {
	margin: 0;
}

body.wc-lock-selected-block--move {
	.block-editor-block-mover__move-button-container,
	.block-editor-block-mover {
		display: none;
	}
}

body.wc-lock-selected-block--remove {
	.block-editor-block-settings-menu__popover {
		.components-menu-group:last-child {
			display: none;
		}
		.components-menu-group:nth-last-child(2) {
			margin-bottom: -12px;
		}
	}
}

woocommerce-blocks/assets/js/blocks/cart-checkout/cart-i2/use-forced-layout.ts000064400000003064151335517640023462 0ustar00/**
 * External dependencies
 */
import { useLayoutEffect, useRef } from '@wordpress/element';
import { useSelect, useDispatch } from '@wordpress/data';
import {
	createBlock,
	getBlockType,
	Block,
	AttributeSource,
} from '@wordpress/blocks';

const isBlockLocked = ( {
	attributes,
}: {
	attributes: Record< string, AttributeSource.Attribute >;
} ) => Boolean( attributes.lock?.remove || attributes.lock?.default?.remove );

export const useForcedLayout = ( {
	clientId,
	template,
}: {
	clientId: string;
	template: Array< string >;
} ): void => {
	const currentTemplate = useRef( template );
	const { insertBlock } = useDispatch( 'core/block-editor' );
	const { innerBlocks, templateTypes } = useSelect(
		( select ) => {
			return {
				innerBlocks: select( 'core/block-editor' ).getBlocks(
					clientId
				),
				templateTypes: currentTemplate.current.map( ( blockName ) =>
					getBlockType( blockName )
				),
			};
		},
		[ clientId, currentTemplate ]
	);
	/**
	 * If the current inner blocks differ from the registered blocks, push the differences.
	 *
	 */
	useLayoutEffect( () => {
		if ( ! clientId ) {
			return;
		}
		// Missing check to see if registered block is 'forced'
		templateTypes.forEach( ( block: Block | undefined ) => {
			if (
				block &&
				isBlockLocked( block ) &&
				! innerBlocks.find(
					( { name }: { name: string } ) => name === block.name
				)
			) {
				const newBlock = createBlock( block.name );
				insertBlock( newBlock, innerBlocks.length, clientId, false );
			}
		} );
	}, [ clientId, innerBlocks, insertBlock, templateTypes ] );
};
woocommerce-blocks/assets/js/blocks/cart-checkout/cart-i2/editor-utils.ts000064400000001016151335517640022532 0ustar00/**
 * External dependencies
 */
import { getBlockTypes } from '@wordpress/blocks';

// List of core block types to allow in inner block areas.
const coreBlockTypes = [ 'core/paragraph', 'core/image', 'core/separator' ];

/**
 * Gets a list of allowed blocks types under a specific parent block type.
 */
export const getAllowedBlocks = ( block: string ): string[] => [
	...getBlockTypes()
		.filter( ( blockType ) =>
			( blockType?.parent || [] ).includes( block )
		)
		.map( ( { name } ) => name ),
	...coreBlockTypes,
];
woocommerce-blocks/assets/js/blocks/cart-checkout/cart-i2/use-view-switcher.tsx000064400000002750151335517640023676 0ustar00/**
 * External dependencies
 */
import { __ } from '@wordpress/i18n';
import { useState } from '@wordpress/element';
import { useDispatch, select } from '@wordpress/data';
import { Toolbar, ToolbarDropdownMenu } from '@wordpress/components';
import { Icon, eye } from '@woocommerce/icons';
import { store as blockEditorStore } from '@wordpress/block-editor';

interface View {
	view: string;
	label: string;
	icon: string | JSX.Element;
}

export const useViewSwitcher = (
	clientId: string,
	views: View[]
): {
	currentView: string;
	component: () => JSX.Element;
} => {
	const initialView = views[ 0 ];
	const [ currentView, setCurrentView ] = useState( initialView );
	const { selectBlock } = useDispatch( 'core/block-editor' );
	const { getBlock } = select( blockEditorStore );

	const ViewSwitcherComponent = () => (
		<Toolbar>
			<ToolbarDropdownMenu
				label={ __( 'Switch view', 'woo-gutenberg-products-block' ) }
				text={ currentView.label }
				icon={
					<Icon srcElement={ eye } style={ { marginRight: '8px' } } />
				}
				controls={ views.map( ( view ) => ( {
					...view,
					title: view.label,
					onClick: () => {
						setCurrentView( view );
						selectBlock(
							getBlock( clientId ).innerBlocks.find(
								( block: { name: string } ) =>
									block.name === view.view
							)?.clientId || clientId
						);
					},
				} ) ) }
			/>
		</Toolbar>
	);

	return {
		currentView: currentView.view,
		component: ViewSwitcherComponent,
	};
};

export default useViewSwitcher;
woocommerce-blocks/assets/js/blocks/cart-checkout/cart-i2/context.ts000064400000000636151335517640021601 0ustar00/**
 * External dependencies
 */
import { createContext, useContext } from '@wordpress/element';

/**
 * Context consumed by inner blocks.
 */
export type CartBlockContextProps = {
	currentView: string;
};

export const CartBlockContext = createContext< CartBlockContextProps >( {
	currentView: '',
} );

export const useCartBlockContext = (): CartBlockContextProps => {
	return useContext( CartBlockContext );
};
woocommerce-blocks/assets/js/blocks/cart-checkout/cart-i2/checkout-button/index.tsx000064400000006136151335517640024533 0ustar00/**
 * External dependencies
 */
import { __ } from '@wordpress/i18n';
import { useState, useEffect } from '@wordpress/element';
import { PaymentMethodIcons } from '@woocommerce/base-components/cart-checkout';
import Button from '@woocommerce/base-components/button';
import { CHECKOUT_URL } from '@woocommerce/block-settings';
import { useCheckoutContext } from '@woocommerce/base-context';
import { usePaymentMethods } from '@woocommerce/base-context/hooks';
import { usePositionRelativeToViewport } from '@woocommerce/base-hooks';

/**
 * Internal dependencies
 */
import './style.scss';
import type PaymentMethodConfig from '../../../../blocks-registry/payment-methods/payment-method-config';

const getIconsFromPaymentMethods = (
	paymentMethods: PaymentMethodConfig[]
) => {
	return Object.values( paymentMethods ).reduce( ( acc, paymentMethod ) => {
		if ( paymentMethod.icons !== null ) {
			acc = acc.concat( paymentMethod.icons );
		}
		return acc;
	}, [] );
};

/**
 * Checkout button rendered in the full cart page.
 *
 * @param {Object} props Incoming props for the component.
 * @param {string} props.link What the button is linked to.
 */
const CheckoutButton = ( { link }: { link: string } ): JSX.Element => {
	const { isCalculating } = useCheckoutContext();
	const [
		positionReferenceElement,
		positionRelativeToViewport,
	] = usePositionRelativeToViewport();
	const [ showSpinner, setShowSpinner ] = useState( false );
	const { paymentMethods } = usePaymentMethods();

	useEffect( () => {
		// Add a listener to remove the spinner on the checkout button, so the saved page snapshot does not
		// contain the spinner class. See https://archive.is/lOEW0 for why this is needed for Safari.

		if (
			typeof global.addEventListener !== 'function' ||
			typeof global.removeEventListener !== 'function'
		) {
			return;
		}

		const hideSpinner = () => {
			setShowSpinner( false );
		};

		global.addEventListener( 'pageshow', hideSpinner );

		return () => {
			global.removeEventListener( 'pageshow', hideSpinner );
		};
	}, [] );

	const submitContainerContents = (
		<>
			<Button
				className="wc-block-cart__submit-button"
				href={ link || CHECKOUT_URL }
				disabled={ isCalculating }
				onClick={ () => setShowSpinner( true ) }
				showSpinner={ showSpinner }
			>
				{ __( 'Proceed to Checkout', 'woo-gutenberg-products-block' ) }
			</Button>
			<PaymentMethodIcons
				icons={ getIconsFromPaymentMethods( paymentMethods ) }
			/>
		</>
	);

	return (
		<div className="wc-block-cart__submit">
			{ positionReferenceElement }
			{ /* The non-sticky container must always be visible because it gives height to its parent, which is required to calculate when it becomes visible in the viewport. */ }
			<div className="wc-block-cart__submit-container">
				{ submitContainerContents }
			</div>
			{ /* If the positionReferenceElement is below the viewport, display the sticky container. */ }
			{ positionRelativeToViewport === 'below' && (
				<div className="wc-block-cart__submit-container wc-block-cart__submit-container--sticky">
					{ submitContainerContents }
				</div>
			) }
		</div>
	);
};

export default CheckoutButton;
woocommerce-blocks/assets/js/blocks/cart-checkout/cart-i2/checkout-button/style.scss000064400000001576151335517640024724 0ustar00.wc-block-cart__submit {
	position: relative;
}

.wc-block-cart__submit-container {
	padding-bottom: $gap;
}

.wc-block-cart__submit-button {
	width: 100%;
	margin: 0 0 $gap;

	&:last-child {
		margin-bottom: 0;
	}
}

.is-mobile,
.is-small,
.is-medium {
	.wc-block-cart__submit-container:not(.wc-block-cart__submit-container--sticky) {
		padding-left: 0;
		padding-right: 0;
		padding-top: 0;
	}
}

@include breakpoint(">782px") {
	.wc-block-cart__submit-container--sticky {
		display: none;
	}
}

@include breakpoint("<782px") {
	.wc-block-cart__submit-container--sticky {
		background: $white;
		bottom: 0;
		left: 0;
		padding: $gap;
		position: fixed;
		width: 100%;
		z-index: 9999;

		&::before {
			box-shadow: 0 -10px 20px 10px currentColor;
			color: transparentize($gray-400, 0.5);
			content: "";
			height: 100%;
			left: 0;
			position: absolute;
			right: 0;
			top: 0;
		}
	}
}

woocommerce-blocks/assets/js/blocks/cart-checkout/cart-i2/columns/columns-block.tsx000064400000000446151335517640024534 0ustar00/**
 * External dependencies
 */
import { useBlockProps } from '@wordpress/block-editor';

export const Columns = ( {
	children,
	...props
}: {
	children?: React.ReactNode;
} ): JSX.Element => {
	const blockProps = useBlockProps( props );

	return <div { ...blockProps }>{ children }</div>;
};
woocommerce-blocks/assets/js/blocks/cart-checkout/cart-i2/columns/index.ts000064400000000041151335517640022672 0ustar00export * from './columns-block';
assets/js/blocks/cart-checkout/cart-i2/inner-blocks/cart-order-summary-block/block.json000064400000001025151335517640030657 0ustar00woocommerce-blocks{
	"name": "woocommerce/cart-order-summary-block",
	"version": "1.0.0",
	"title": "Order Summary",
	"description": "Show customers a summary of their order.",
	"category": "woocommerce",
	"supports": {
		"align": false,
		"html": false,
		"multiple": false,
		"reusable": false,
		"inserter": false
	},
	"attributes": {
		"lock": {
			"type": "object",
			"default": {
				"remove": true,
				"move": true
			}
		}
	},
	"parent": [ "woocommerce/cart-totals-block" ],
	"textdomain": "woo-gutenberg-products-block",
	"apiVersion": 2
}
assets/js/blocks/cart-checkout/cart-i2/inner-blocks/cart-order-summary-block/block.tsx000064400000005656151335517640030542 0ustar00woocommerce-blocks/**
 * External dependencies
 */
import { __ } from '@wordpress/i18n';
import {
	TotalsCoupon,
	TotalsDiscount,
	TotalsFooterItem,
	TotalsShipping,
} from '@woocommerce/base-components/cart-checkout';
import {
	Subtotal,
	TotalsFees,
	TotalsTaxes,
	TotalsWrapper,
	ExperimentalOrderMeta,
	ExperimentalDiscountsMeta,
} from '@woocommerce/blocks-checkout';
import { getCurrencyFromPriceResponse } from '@woocommerce/price-format';
import {
	useStoreCartCoupons,
	useStoreCart,
} from '@woocommerce/base-context/hooks';
import { getSetting } from '@woocommerce/settings';
import Title from '@woocommerce/base-components/title';

/**
 * Internal dependencies
 */

const Block = ( {
	showRateAfterTaxName = false,
	isShippingCalculatorEnabled = true,
}: {
	showRateAfterTaxName: boolean;
	isShippingCalculatorEnabled: boolean;
} ): JSX.Element => {
	const { cartFees, cartTotals, cartNeedsShipping } = useStoreCart();

	const {
		applyCoupon,
		removeCoupon,
		isApplyingCoupon,
		isRemovingCoupon,
		appliedCoupons,
	} = useStoreCartCoupons();

	const totalsCurrency = getCurrencyFromPriceResponse( cartTotals );

	// Prepare props to pass to the ExperimentalOrderMeta slot fill.
	// We need to pluck out receiveCart.
	// eslint-disable-next-line no-unused-vars
	const { extensions, ...cart } = useStoreCart();
	const slotFillProps = {
		extensions,
		cart,
	};

	const discountsSlotFillProps = {
		extensions,
		cart,
	};

	return (
		<>
			<Title headingLevel="2" className="wc-block-cart__totals-title">
				{ __( 'Cart totals', 'woo-gutenberg-products-block' ) }
			</Title>
			<TotalsWrapper>
				<Subtotal currency={ totalsCurrency } values={ cartTotals } />
				<TotalsFees currency={ totalsCurrency } cartFees={ cartFees } />
				<TotalsDiscount
					cartCoupons={ appliedCoupons }
					currency={ totalsCurrency }
					isRemovingCoupon={ isRemovingCoupon }
					removeCoupon={ removeCoupon }
					values={ cartTotals }
				/>
			</TotalsWrapper>
			{ getSetting( 'couponsEnabled', true ) && (
				<TotalsWrapper>
					<TotalsCoupon
						onSubmit={ applyCoupon }
						isLoading={ isApplyingCoupon }
					/>
				</TotalsWrapper>
			) }
			<ExperimentalDiscountsMeta.Slot { ...discountsSlotFillProps } />
			{ cartNeedsShipping && (
				<TotalsWrapper>
					<TotalsShipping
						showCalculator={ isShippingCalculatorEnabled }
						showRateSelector={ true }
						values={ cartTotals }
						currency={ totalsCurrency }
					/>
				</TotalsWrapper>
			) }
			{ ! getSetting( 'displayCartPricesIncludingTax', false ) &&
				parseInt( cartTotals.total_tax, 10 ) > 0 && (
					<TotalsWrapper>
						<TotalsTaxes
							showRateAfterTaxName={ showRateAfterTaxName }
							currency={ totalsCurrency }
							values={ cartTotals }
						/>
					</TotalsWrapper>
				) }
			<TotalsWrapper>
				<TotalsFooterItem
					currency={ totalsCurrency }
					values={ cartTotals }
				/>
			</TotalsWrapper>

			<ExperimentalOrderMeta.Slot { ...slotFillProps } />
		</>
	);
};

export default Block;
assets/js/blocks/cart-checkout/cart-i2/inner-blocks/cart-order-summary-block/attributes.tsx000064400000000454151335517640031625 0ustar00woocommerce-blocks/**
 * External dependencies
 */
import { getSetting } from '@woocommerce/settings';

export default {
	showRateAfterTaxName: {
		type: 'boolean',
		default: getSetting( 'displayCartPricesIncludingTax', false ),
	},
	lock: {
		type: 'object',
		default: {
			move: true,
			remove: true,
		},
	},
};
assets/js/blocks/cart-checkout/cart-i2/inner-blocks/cart-order-summary-block/edit.tsx000064400000005253151335517640030366 0ustar00woocommerce-blocks/**
 * External dependencies
 */
import { __ } from '@wordpress/i18n';
import { useBlockProps, InspectorControls } from '@wordpress/block-editor';
import { Disabled, PanelBody, ToggleControl } from '@wordpress/components';
import { getSetting } from '@woocommerce/settings';

/**
 * Internal dependencies
 */
import Block from './block';

export const Edit = ( {
	attributes,
	setAttributes,
}: {
	attributes: {
		showRateAfterTaxName: boolean;
		isShippingCalculatorEnabled: boolean;
		lock: {
			move: boolean;
			remove: boolean;
		};
	};
	setAttributes: ( attributes: Record< string, unknown > ) => void;
} ): JSX.Element => {
	const { showRateAfterTaxName, isShippingCalculatorEnabled } = attributes;
	const blockProps = useBlockProps();
	const taxesEnabled = getSetting( 'taxesEnabled' ) as boolean;
	const displayItemizedTaxes = getSetting(
		'displayItemizedTaxes',
		false
	) as boolean;
	const displayCartPricesIncludingTax = getSetting(
		'displayCartPricesIncludingTax',
		false
	) as boolean;
	return (
		<div { ...blockProps }>
			<InspectorControls>
				{ getSetting( 'shippingEnabled', true ) && (
					<PanelBody
						title={ __(
							'Shipping rates',
							'woo-gutenberg-products-block'
						) }
					>
						<ToggleControl
							label={ __(
								'Shipping calculator',
								'woo-gutenberg-products-block'
							) }
							help={ __(
								'Allow customers to estimate shipping by entering their address.',
								'woo-gutenberg-products-block'
							) }
							checked={ isShippingCalculatorEnabled }
							onChange={ () =>
								setAttributes( {
									isShippingCalculatorEnabled: ! isShippingCalculatorEnabled,
								} )
							}
						/>
					</PanelBody>
				) }
				{ taxesEnabled &&
					displayItemizedTaxes &&
					! displayCartPricesIncludingTax && (
						<PanelBody
							title={ __(
								'Taxes',
								'woo-gutenberg-products-block'
							) }
						>
							<ToggleControl
								label={ __(
									'Show rate after tax name',
									'woo-gutenberg-products-block'
								) }
								help={ __(
									'Show the percentage rate alongside each tax line in the summary.',
									'woo-gutenberg-products-block'
								) }
								checked={ showRateAfterTaxName }
								onChange={ () =>
									setAttributes( {
										showRateAfterTaxName: ! showRateAfterTaxName,
									} )
								}
							/>
						</PanelBody>
					) }
			</InspectorControls>
			<Disabled>
				<Block
					showRateAfterTaxName={ attributes.showRateAfterTaxName }
					isShippingCalculatorEnabled={
						attributes.isShippingCalculatorEnabled
					}
				/>
			</Disabled>
		</div>
	);
};

export const Save = (): JSX.Element => {
	return <div { ...useBlockProps.save() } />;
};
assets/js/blocks/cart-checkout/cart-i2/inner-blocks/cart-order-summary-block/index.tsx000064400000000733151335517640030546 0ustar00woocommerce-blocks/**
 * External dependencies
 */
import { Icon, totals } from '@woocommerce/icons';
import { registerFeaturePluginBlockType } from '@woocommerce/block-settings';

/**
 * Internal dependencies
 */
import { Edit, Save } from './edit';
import attributes from './attributes';
import metadata from './block.json';

registerFeaturePluginBlockType( metadata, {
	icon: {
		src: <Icon srcElement={ totals } />,
		foreground: '#874FB9',
	},
	attributes,
	edit: Edit,
	save: Save,
} );
assets/js/blocks/cart-checkout/cart-i2/inner-blocks/proceed-to-checkout-block/edit.tsx000064400000003411151335517640030467 0ustar00woocommerce-blocks/**
 * External dependencies
 */
import { useRef } from '@wordpress/element';
import { useSelect } from '@wordpress/data';
import { __ } from '@wordpress/i18n';
import { InspectorControls, useBlockProps } from '@wordpress/block-editor';
import PageSelector from '@woocommerce/editor-components/page-selector';
import { Disabled } from '@wordpress/components';
import { CART_PAGE_ID } from '@woocommerce/block-settings';
/**
 * Internal dependencies
 */
import Block from './block';
export const Edit = ( {
	attributes,
	setAttributes,
}: {
	attributes: {
		checkoutPageId: number;
	};
	setAttributes: ( attributes: Record< string, unknown > ) => void;
} ): JSX.Element => {
	const blockProps = useBlockProps();
	const { checkoutPageId = 0 } = attributes;
	const { current: savedCheckoutPageId } = useRef( checkoutPageId );
	const currentPostId = useSelect(
		( select ) => {
			if ( ! savedCheckoutPageId ) {
				const store = select( 'core/editor' );
				return store.getCurrentPostId();
			}
			return savedCheckoutPageId;
		},
		[ savedCheckoutPageId ]
	);

	return (
		<div { ...blockProps }>
			<InspectorControls>
				{ ! (
					currentPostId === CART_PAGE_ID && savedCheckoutPageId === 0
				) && (
					<PageSelector
						pageId={ checkoutPageId }
						setPageId={ ( id ) =>
							setAttributes( { checkoutPageId: id } )
						}
						labels={ {
							title: __(
								'Proceed to Checkout button',
								'woo-gutenberg-products-block'
							),
							default: __(
								'WooCommerce Checkout Page',
								'woo-gutenberg-products-block'
							),
						} }
					/>
				) }
			</InspectorControls>
			<Disabled>
				<Block checkoutPageId={ checkoutPageId } />
			</Disabled>
		</div>
	);
};

export const Save = (): JSX.Element => {
	return <div { ...useBlockProps.save() } />;
};
assets/js/blocks/cart-checkout/cart-i2/inner-blocks/proceed-to-checkout-block/index.tsx000064400000000723151335517640030654 0ustar00woocommerce-blocks/**
 * External dependencies
 */
import { Icon, button } from '@wordpress/icons';
import { registerFeaturePluginBlockType } from '@woocommerce/block-settings';

/**
 * Internal dependencies
 */
import attributes from './attributes';
import { Edit, Save } from './edit';
import metadata from './block.json';

registerFeaturePluginBlockType( metadata, {
	icon: {
		src: <Icon icon={ button } />,
		foreground: '#874FB9',
	},
	attributes,
	edit: Edit,
	save: Save,
} );
assets/js/blocks/cart-checkout/cart-i2/inner-blocks/proceed-to-checkout-block/attributes.tsx000064400000000234151335517640031730 0ustar00woocommerce-blocksexport default {
	checkoutPageId: {
		type: 'number',
		default: 0,
	},
	lock: {
		type: 'object',
		default: {
			move: true,
			remove: true,
		},
	},
};
assets/js/blocks/cart-checkout/cart-i2/inner-blocks/proceed-to-checkout-block/block.json000064400000001003151335517640030762 0ustar00woocommerce-blocks{
	"name": "woocommerce/proceed-to-checkout-block",
	"version": "1.0.0",
	"title": "Proceed to checkout",
	"description": "Allow customers proceed to Checkout.",
	"category": "woocommerce",
	"supports": {
		"align": false,
		"html": false,
		"multiple": false,
		"reusable": false,
		"inserter": false
	},
	"attributes": {
		"lock": {
			"default": {
				"remove": true,
				"move": true
			}
		}
	},
	"parent": [ "woocommerce/cart-totals-block" ],
	"textdomain": "woo-gutenberg-products-block",
	"apiVersion": 2
}
assets/js/blocks/cart-checkout/cart-i2/inner-blocks/proceed-to-checkout-block/block.tsx000064400000000574151335517640030643 0ustar00woocommerce-blocks/**
 * External dependencies
 */
import { getSetting } from '@woocommerce/settings';

/**
 * Internal dependencies
 */
import CheckoutButton from '../../checkout-button';

const Block = ( {
	checkoutPageId,
}: {
	checkoutPageId: number;
} ): JSX.Element => {
	return (
		<CheckoutButton
			link={ getSetting( 'page-' + checkoutPageId, false ) }
		/>
	);
};

export default Block;
assets/js/blocks/cart-checkout/cart-i2/inner-blocks/proceed-to-checkout-block/frontend.tsx000064400000000434151335517640031363 0ustar00woocommerce-blocks/**
 * External dependencies
 */
import withFilteredAttributes from '@woocommerce/base-hocs/with-filtered-attributes';

/**
 * Internal dependencies
 */
import Block from './block';
import attributes from './attributes';

export default withFilteredAttributes( attributes )( Block );
assets/js/blocks/cart-checkout/cart-i2/inner-blocks/cart-line-items-block/block.tsx000064400000000641151335517640027767 0ustar00woocommerce-blocks/**
 * External dependencies
 */
import { useStoreCart } from '@woocommerce/base-context/hooks';
/**
 * Internal dependencies
 */
import CartLineItemsTable from '../../full-cart/cart-line-items-table';

const Block = (): JSX.Element => {
	const { cartItems, cartIsLoading } = useStoreCart();
	return (
		<CartLineItemsTable
			lineItems={ cartItems }
			isLoading={ cartIsLoading }
		/>
	);
};

export default Block;
assets/js/blocks/cart-checkout/cart-i2/inner-blocks/cart-line-items-block/edit.tsx000064400000000604151335517640027621 0ustar00woocommerce-blocks/**
 * External dependencies
 */
import { useBlockProps } from '@wordpress/block-editor';

/**
 * Internal dependencies
 */
import Block from './block';

export const Edit = (): JSX.Element => {
	const blockProps = useBlockProps();

	return (
		<div { ...blockProps }>
			<Block />
		</div>
	);
};

export const Save = (): JSX.Element => {
	return <div { ...useBlockProps.save() } />;
};
assets/js/blocks/cart-checkout/cart-i2/inner-blocks/cart-line-items-block/block.json000064400000001027151335517640030121 0ustar00woocommerce-blocks{
	"name": "woocommerce/cart-line-items-block",
	"version": "1.0.0",
	"title": "Cart Line Items",
	"description": "Block containing current line items in Cart.",
	"category": "woocommerce",
	"supports": {
		"align": false,
		"html": false,
		"multiple": false,
		"reusable": false,
		"inserter": false
	},
	"attributes": {
		"lock": {
			"type": "object",
			"default": {
				"remove": true,
				"move": true
			}
		}
	},
	"parent": [ "woocommerce/cart-items-block" ],
	"textdomain": "woo-gutenberg-products-block",
	"apiVersion": 2
}
assets/js/blocks/cart-checkout/cart-i2/inner-blocks/cart-line-items-block/index.tsx000064400000000637151335517640030011 0ustar00woocommerce-blocks/**
 * External dependencies
 */
import { Icon, column } from '@wordpress/icons';
import { registerFeaturePluginBlockType } from '@woocommerce/block-settings';

/**
 * Internal dependencies
 */
import { Edit, Save } from './edit';
import metadata from './block.json';

registerFeaturePluginBlockType( metadata, {
	icon: {
		src: <Icon icon={ column } />,
		foreground: '#874FB9',
	},
	edit: Edit,
	save: Save,
} );
woocommerce-blocks/assets/js/blocks/cart-checkout/cart-i2/inner-blocks/filled-cart-block/edit.tsx000064400000002347151335517640027077 0ustar00/**
 * External dependencies
 */
import { useBlockProps, InnerBlocks } from '@wordpress/block-editor';
import { innerBlockAreas } from '@woocommerce/blocks-checkout';
import { SidebarLayout } from '@woocommerce/base-components/sidebar-layout';

/**
 * Internal dependencies
 */
import { useForcedLayout } from '../../use-forced-layout';
import { getAllowedBlocks } from '../../editor-utils';
import { Columns } from './../../columns';
import './editor.scss';
import { useCartBlockContext } from '../../context';

export const Edit = ( { clientId }: { clientId: string } ): JSX.Element => {
	const blockProps = useBlockProps();
	const { currentView } = useCartBlockContext();
	const allowedBlocks = getAllowedBlocks( innerBlockAreas.FILLED_CART );

	useForcedLayout( {
		clientId,
		template: allowedBlocks,
	} );
	return (
		<div
			{ ...blockProps }
			hidden={ currentView !== 'woocommerce/filled-cart-block' }
		>
			<Columns>
				<SidebarLayout className={ 'wc-block-cart' }>
					<InnerBlocks
						allowedBlocks={ allowedBlocks }
						templateLock={ false }
					/>
				</SidebarLayout>
			</Columns>
		</div>
	);
};

export const Save = (): JSX.Element => {
	return (
		<div { ...useBlockProps.save() }>
			<InnerBlocks.Content />
		</div>
	);
};
woocommerce-blocks/assets/js/blocks/cart-checkout/cart-i2/inner-blocks/filled-cart-block/block.json000064400000001035151335517640027370 0ustar00{
	"name": "woocommerce/filled-cart-block",
	"version": "1.0.0",
	"title": "Filled Cart",
	"description": "Contains blocks that are displayed when the cart contains products.",
	"category": "woocommerce",
	"supports": {
		"align": false,
		"html": false,
		"multiple": false,
		"reusable": false,
		"inserter": false
	},
	"attributes": {
		"lock": {
			"type": "object",
			"default": {
				"remove": true,
				"move": true
			}
		}
	},
	"parent": [ "woocommerce/cart-i2" ],
	"textdomain": "woo-gutenberg-products-block",
	"apiVersion": 2
}
woocommerce-blocks/assets/js/blocks/cart-checkout/cart-i2/inner-blocks/filled-cart-block/index.tsx000064400000000657151335517640027263 0ustar00/**
 * External dependencies
 */
import { Icon, filledCart } from '@woocommerce/icons';
import { registerFeaturePluginBlockType } from '@woocommerce/block-settings';

/**
 * Internal dependencies
 */
import { Edit, Save } from './edit';
import metadata from './block.json';

registerFeaturePluginBlockType( metadata, {
	icon: {
		src: <Icon srcElement={ filledCart } />,
		foreground: '#874FB9',
	},
	edit: Edit,
	save: Save,
} );
assets/js/blocks/cart-checkout/cart-i2/inner-blocks/filled-cart-block/frontend.tsx000064400000002244151335517640027706 0ustar00woocommerce-blocks/**
 * External dependencies
 */
import classnames from 'classnames';
import { SidebarLayout } from '@woocommerce/base-components/sidebar-layout';
import { useStoreCart, useStoreNotices } from '@woocommerce/base-context/hooks';
import { useEffect } from '@wordpress/element';
import { decodeEntities } from '@wordpress/html-entities';

const FrontendBlock = ( {
	children,
}: {
	children: JSX.Element;
} ): JSX.Element | null => {
	const { cartItems, cartIsLoading, cartItemErrors } = useStoreCart();
	const { addErrorNotice } = useStoreNotices();

	// Ensures any cart errors listed in the API response get shown.
	useEffect( () => {
		cartItemErrors.forEach( ( error ) => {
			addErrorNotice( decodeEntities( error.message ), {
				isDismissible: true,
				id: error.code,
			} );
		} );
	}, [ addErrorNotice, cartItemErrors ] );
	// @todo pass attributes to inner most blocks.
	const hasDarkControls = false;
	if ( cartIsLoading || cartItems.length >= 1 ) {
		return (
			<SidebarLayout
				className={ classnames( 'wc-block-cart', {
					'has-dark-controls': hasDarkControls,
				} ) }
			>
				{ children }
			</SidebarLayout>
		);
	}
	return null;
};

export default FrontendBlock;
woocommerce-blocks/assets/js/blocks/cart-checkout/cart-i2/inner-blocks/filled-cart-block/editor.scss000064400000000760151335517640027572 0ustar00.wp-block-woocommerce-filled-cart-block {
	.wc-block-components-sidebar-layout {
		display: block;
	}
	.block-editor-block-list__layout {
		display: flex;
		flex-flow: row wrap;
		align-items: flex-start;
	}
	.wc-block-components-main,
	.wc-block-components-sidebar,
	.block-editor-block-list__layout {
		> :first-child {
			margin-top: 0;
		}
	}
	.wp-block-woocommerce-cart-totals-block,
	.wp-block-woocommerce-cart-items-block {
		.block-editor-block-list__layout {
			display: block;
		}
	}
}
assets/js/blocks/cart-checkout/cart-i2/inner-blocks/cart-express-payment-block/block.tsx000064400000000712151335517640031064 0ustar00woocommerce-blocks/**
 * External dependencies
 */
import { useStoreCart } from '@woocommerce/base-context/hooks';

/**
 * Internal dependencies
 */
import { CartExpressPayment } from '../../../payment-methods';

const Block = (): JSX.Element | null => {
	const { cartNeedsPayment } = useStoreCart();

	if ( ! cartNeedsPayment ) {
		return null;
	}

	return (
		<div className="wc-block-cart__payment-options">
			<CartExpressPayment />
		</div>
	);
};

export default Block;
assets/js/blocks/cart-checkout/cart-i2/inner-blocks/cart-express-payment-block/block.json000064400000001047151335517640031221 0ustar00woocommerce-blocks{
	"name": "woocommerce/cart-express-payment-block",
	"version": "1.0.0",
	"title": "Express Checkout",
	"description": "Provide an express payment option for your customers.",
	"category": "woocommerce",
	"supports": {
		"align": false,
		"html": false,
		"multiple": false,
		"reusable": false,
		"inserter": false
	},
	"attributes": {
		"lock": {
			"type": "object",
			"default": {
				"remove": true,
				"move": true
			}
		}
	},
	"parent": [ "woocommerce/cart-totals-block" ],
	"textdomain": "woo-gutenberg-products-block",
	"apiVersion": 2
}
assets/js/blocks/cart-checkout/cart-i2/inner-blocks/cart-express-payment-block/editor.scss000064400000001353151335517640031417 0ustar00woocommerce-blocks// Adjust padding and margins in the editor to improve selected block outlines.
.wp-block-woocommerce-cart-express-payment-block {
	margin: 14px 0 28px;

	.components-placeholder__label svg {
		font-size: 1em;
	}

	.wc-block-components-express-payment-continue-rule--checkout {
		margin-bottom: 0;
	}

	&.wp-block-woocommerce-cart-express-payment-block--has-express-payment-methods {
		padding: 14px 0;
		margin: -14px 0 14px 0 !important;
		position: relative;
	}
}

.wp-block-woocommerce-checkout-express-payment-block-placeholder {
	* {
		pointer-events: all; // Overrides parent disabled component in editor context
	}

	.wp-block-woocommerce-checkout-express-payment-block-placeholder__description {
		display: block;
		margin: 0 0 1em;
	}
}
assets/js/blocks/cart-checkout/cart-i2/inner-blocks/cart-express-payment-block/edit.tsx000064400000004143151335517640030721 0ustar00woocommerce-blocks/**
 * External dependencies
 */
import { __ } from '@wordpress/i18n';
import { useBlockProps } from '@wordpress/block-editor';
import { Placeholder, Button } from 'wordpress-components';
import { useExpressPaymentMethods } from '@woocommerce/base-context/hooks';
import { Icon, card } from '@woocommerce/icons';
import { ADMIN_URL } from '@woocommerce/settings';
import classnames from 'classnames';

/**
 * Internal dependencies
 */
import Block from './block';
import './editor.scss';

/**
 * Renders a placeholder in the editor.
 */
const NoExpressPaymentMethodsPlaceholder = () => {
	return (
		<Placeholder
			icon={ <Icon srcElement={ card } /> }
			label={ __( 'Express Checkout', 'woo-gutenberg-products-block' ) }
			className="wp-block-woocommerce-checkout-express-payment-block-placeholder"
		>
			<span className="wp-block-woocommerce-checkout-express-payment-block-placeholder__description">
				{ __(
					"Your store doesn't have any Payment Methods that support the Express Checkout Block. If they are added, they will be shown here.",
					'woo-gutenberg-products-block'
				) }
			</span>
			<Button
				isPrimary
				href={ `${ ADMIN_URL }admin.php?page=wc-settings&tab=checkout` }
				target="_blank"
				rel="noopener noreferrer"
				className="wp-block-woocommerce-checkout-express-payment-block-placeholder__button"
			>
				{ __(
					'Configure Payment Methods',
					'woo-gutenberg-products-block'
				) }
			</Button>
		</Placeholder>
	);
};

export const Edit = (): JSX.Element | null => {
	const { paymentMethods, isInitialized } = useExpressPaymentMethods();
	const hasExpressPaymentMethods = Object.keys( paymentMethods ).length > 0;
	const blockProps = useBlockProps( {
		className: classnames( {
			'wp-block-woocommerce-cart-express-payment-block--has-express-payment-methods': hasExpressPaymentMethods,
		} ),
	} );

	if ( ! isInitialized ) {
		return null;
	}

	return (
		<div { ...blockProps }>
			{ hasExpressPaymentMethods ? (
				<Block />
			) : (
				<NoExpressPaymentMethodsPlaceholder />
			) }
		</div>
	);
};

export const Save = (): JSX.Element => {
	return <div { ...useBlockProps.save() } />;
};
assets/js/blocks/cart-checkout/cart-i2/inner-blocks/cart-express-payment-block/index.tsx000064400000000643151335517640031104 0ustar00woocommerce-blocks/**
 * External dependencies
 */
import { Icon, card } from '@woocommerce/icons';
import { registerFeaturePluginBlockType } from '@woocommerce/block-settings';

/**
 * Internal dependencies
 */
import { Edit, Save } from './edit';
import metadata from './block.json';

registerFeaturePluginBlockType( metadata, {
	icon: {
		src: <Icon srcElement={ card } />,
		foreground: '#874FB9',
	},
	edit: Edit,
	save: Save,
} );
woocommerce-blocks/assets/js/blocks/cart-checkout/cart-i2/inner-blocks/register-components.ts000064400000005532151335517640026512 0ustar00/**
 * External dependencies
 */
import { lazy } from '@wordpress/element';
import { WC_BLOCKS_BUILD_URL } from '@woocommerce/block-settings';
import { registerCheckoutBlock } from '@woocommerce/blocks-checkout';

// Modify webpack publicPath at runtime based on location of WordPress Plugin.
// eslint-disable-next-line no-undef,camelcase
__webpack_public_path__ = WC_BLOCKS_BUILD_URL;

/**
 * Internal dependencies
 */
import filledCartMetadata from './filled-cart-block/block.json';
import emptyCartMetadata from './empty-cart-block/block.json';
import cartItemsMetadata from './cart-items-block/block.json';
import cartExpressPaymentMetadata from './cart-express-payment-block/block.json';
import cartLineItemsMetadata from './cart-line-items-block/block.json';
import cartOrderSummaryMetadata from './cart-order-summary-block/block.json';
import cartTotalsMetadata from './cart-totals-block/block.json';
import cartProceedToCheckoutMetadata from './proceed-to-checkout-block/block.json';

registerCheckoutBlock( {
	metadata: filledCartMetadata,
	component: lazy( () =>
		import(
			/* webpackChunkName: "cart-blocks/filled-cart" */ './filled-cart-block/frontend'
		)
	),
} );
registerCheckoutBlock( {
	metadata: emptyCartMetadata,
	component: lazy( () =>
		import(
			/* webpackChunkName: "cart-blocks/empty-cart" */ './empty-cart-block/frontend'
		)
	),
} );
registerCheckoutBlock( {
	metadata: filledCartMetadata,
	component: lazy( () =>
		import(
			/* webpackChunkName: "cart-blocks/filled-cart" */ './filled-cart-block/frontend'
		)
	),
} );
registerCheckoutBlock( {
	metadata: emptyCartMetadata,
	component: lazy( () =>
		import(
			/* webpackChunkName: "cart-blocks/empty-cart" */ './empty-cart-block/frontend'
		)
	),
} );
registerCheckoutBlock( {
	metadata: cartItemsMetadata,
	component: lazy( () =>
		import(
			/* webpackChunkName: "cart-blocks/items" */ './cart-items-block/frontend'
		)
	),
} );

registerCheckoutBlock( {
	metadata: cartLineItemsMetadata,
	component: lazy( () =>
		import(
			/* webpackChunkName: "cart-blocks/line-items" */ './cart-line-items-block/block'
		)
	),
} );

registerCheckoutBlock( {
	metadata: cartTotalsMetadata,
	component: lazy( () =>
		import(
			/* webpackChunkName: "cart-blocks/totals" */ './cart-totals-block/frontend'
		)
	),
} );

registerCheckoutBlock( {
	metadata: cartOrderSummaryMetadata,
	component: lazy( () =>
		import(
			/* webpackChunkName: "cart-blocks/order-summary" */ './cart-order-summary-block/block'
		)
	),
} );

registerCheckoutBlock( {
	metadata: cartExpressPaymentMetadata,
	component: lazy( () =>
		import(
			/* webpackChunkName: "cart-blocks/express-payment" */ './cart-express-payment-block/block'
		)
	),
} );

registerCheckoutBlock( {
	metadata: cartProceedToCheckoutMetadata,
	component: lazy( () =>
		import(
			/* webpackChunkName: "cart-blocks/checkout-button" */ './proceed-to-checkout-block/frontend'
		)
	),
} );
woocommerce-blocks/assets/js/blocks/cart-checkout/cart-i2/inner-blocks/cart-items-block/edit.tsx000064400000001770151335517640026760 0ustar00/**
 * External dependencies
 */
import { useBlockProps, InnerBlocks } from '@wordpress/block-editor';
import { Main } from '@woocommerce/base-components/sidebar-layout';
import { innerBlockAreas } from '@woocommerce/blocks-checkout';

/**
 * Internal dependencies
 */
import { useForcedLayout } from '../../use-forced-layout';
import { getAllowedBlocks } from '../../editor-utils';

export const Edit = ( { clientId }: { clientId: string } ): JSX.Element => {
	const blockProps = useBlockProps();
	const allowedBlocks = getAllowedBlocks( innerBlockAreas.CART_ITEMS );

	useForcedLayout( {
		clientId,
		template: allowedBlocks,
	} );
	return (
		<Main className="wc-block-cart__main">
			<div { ...blockProps }>
				<InnerBlocks
					allowedBlocks={ allowedBlocks }
					templateLock={ false }
					renderAppender={ InnerBlocks.ButtonBlockAppender }
				/>
			</div>
		</Main>
	);
};

export const Save = (): JSX.Element => {
	return (
		<div { ...useBlockProps.save() }>
			<InnerBlocks.Content />
		</div>
	);
};
woocommerce-blocks/assets/js/blocks/cart-checkout/cart-i2/inner-blocks/cart-items-block/block.json000064400000001005151335517640027247 0ustar00{
	"name": "woocommerce/cart-items-block",
	"version": "1.0.0",
	"title": "Cart Items block",
	"description": "Column containing cart items.",
	"category": "woocommerce",
	"supports": {
		"align": false,
		"html": false,
		"multiple": false,
		"reusable": false,
		"inserter": false
	},
	"attributes": {
		"lock": {
			"type": "object",
			"default": {
				"remove": true,
				"move": true
			}
		}
	},
	"parent": [ "woocommerce/filled-cart-block" ],
	"textdomain": "woo-gutenberg-products-block",
	"apiVersion": 2
}
woocommerce-blocks/assets/js/blocks/cart-checkout/cart-i2/inner-blocks/cart-items-block/index.tsx000064400000000637151335517640027143 0ustar00/**
 * External dependencies
 */
import { Icon, column } from '@wordpress/icons';
import { registerFeaturePluginBlockType } from '@woocommerce/block-settings';

/**
 * Internal dependencies
 */
import { Edit, Save } from './edit';
import metadata from './block.json';

registerFeaturePluginBlockType( metadata, {
	icon: {
		src: <Icon icon={ column } />,
		foreground: '#874FB9',
	},
	edit: Edit,
	save: Save,
} );
woocommerce-blocks/assets/js/blocks/cart-checkout/cart-i2/inner-blocks/cart-items-block/frontend.tsx000064400000000443151335517640027646 0ustar00/**
 * External dependencies
 */
import { Main } from '@woocommerce/base-components/sidebar-layout';

const FrontendBlock = ( {
	children,
}: {
	children: JSX.Element;
} ): JSX.Element => {
	return <Main className="wc-block-cart__main">{ children }</Main>;
};

export default FrontendBlock;
woocommerce-blocks/assets/js/blocks/cart-checkout/cart-i2/inner-blocks/cart-totals-block/style.scss000064400000000155151335517640027511 0ustar00.is-mobile,
.is-small,
.is-medium {
	.wc-block-cart__sidebar {
		margin-bottom: $gap-large;
		order: 0;
	}
}
woocommerce-blocks/assets/js/blocks/cart-checkout/cart-i2/inner-blocks/cart-totals-block/edit.tsx000064400000001745151335517640027147 0ustar00/**
 * External dependencies
 */
import { useBlockProps, InnerBlocks } from '@wordpress/block-editor';
import { Sidebar } from '@woocommerce/base-components/sidebar-layout';
import { innerBlockAreas } from '@woocommerce/blocks-checkout';

/**
 * Internal dependencies
 */
import './style.scss';
import { useForcedLayout } from '../../use-forced-layout';
import { getAllowedBlocks } from '../../editor-utils';

export const Edit = ( { clientId }: { clientId: string } ): JSX.Element => {
	const blockProps = useBlockProps();
	const allowedBlocks = getAllowedBlocks( innerBlockAreas.CART_TOTALS );

	useForcedLayout( {
		clientId,
		template: allowedBlocks,
	} );

	return (
		<Sidebar className="wc-block-cart__sidebar">
			<div { ...blockProps }>
				<InnerBlocks
					allowedBlocks={ allowedBlocks }
					templateLock={ false }
				/>
			</div>
		</Sidebar>
	);
};

export const Save = (): JSX.Element => {
	return (
		<div { ...useBlockProps.save() }>
			<InnerBlocks.Content />
		</div>
	);
};
assets/js/blocks/cart-checkout/cart-i2/inner-blocks/cart-totals-block/frontend.tsx000064400000000550151335517640027753 0ustar00woocommerce-blocks/**
 * External dependencies
 */
import { Sidebar } from '@woocommerce/base-components/sidebar-layout';

/**
 * Internal dependencies
 */
import './style.scss';

const FrontendBlock = ( {
	children,
}: {
	children: JSX.Element;
} ): JSX.Element => {
	return <Sidebar className="wc-block-cart__sidebar">{ children }</Sidebar>;
};

export default FrontendBlock;
woocommerce-blocks/assets/js/blocks/cart-checkout/cart-i2/inner-blocks/cart-totals-block/index.tsx000064400000000637151335517640027330 0ustar00/**
 * External dependencies
 */
import { Icon, column } from '@wordpress/icons';
import { registerFeaturePluginBlockType } from '@woocommerce/block-settings';

/**
 * Internal dependencies
 */
import { Edit, Save } from './edit';
import metadata from './block.json';

registerFeaturePluginBlockType( metadata, {
	icon: {
		src: <Icon icon={ column } />,
		foreground: '#874FB9',
	},
	edit: Edit,
	save: Save,
} );
woocommerce-blocks/assets/js/blocks/cart-checkout/cart-i2/inner-blocks/cart-totals-block/block.json000064400000001156151335517640027443 0ustar00{
	"name": "woocommerce/cart-totals-block",
	"version": "1.0.0",
	"title": "Cart Totals",
	"description": "Column containing the cart totals.",
	"category": "woocommerce",
	"supports": {
		"align": false,
		"html": false,
		"multiple": false,
		"reusable": false,
		"inserter": false
	},
	"attributes": {
		"checkbox": {
			"type": "boolean",
			"default": false
		},
		"text": {
			"type": "string",
			"required": false
		},
		"lock": {
			"type": "object",
			"default": {
				"remove": true
			}
		}
	},
	"parent": [ "woocommerce/filled-cart-block" ],
	"textdomain": "woo-gutenberg-products-block",
	"apiVersion": 2
}
woocommerce-blocks/assets/js/blocks/cart-checkout/cart-i2/inner-blocks/index.tsx000064400000000453151335517640023777 0ustar00/**
 * Internal dependencies
 */
import './filled-cart-block';
import './cart-items-block';
import './cart-line-items-block';
import './cart-totals-block';
import './cart-order-summary-block';
import './cart-express-payment-block';
import './proceed-to-checkout-block';
import './empty-cart-block';
woocommerce-blocks/assets/js/blocks/cart-checkout/cart-i2/inner-blocks/empty-cart-block/block.json000064400000001022151335517640027263 0ustar00{
	"name": "woocommerce/empty-cart-block",
	"version": "1.0.0",
	"title": "Empty Cart",
	"description": "Contains blocks that are displayed when the cart is empty.",
	"category": "woocommerce",
	"supports": {
		"align": false,
		"html": false,
		"multiple": false,
		"reusable": false,
		"inserter": false
	},
	"attributes": {
		"lock": {
			"type": "object",
			"default": {
				"remove": true,
				"move": true
			}
		}
	},
	"parent": [ "woocommerce/cart-i2" ],
	"textdomain": "woo-gutenberg-products-block",
	"apiVersion": 2
}
woocommerce-blocks/assets/js/blocks/cart-checkout/cart-i2/inner-blocks/empty-cart-block/edit.tsx000064400000002015151335517640026766 0ustar00/**
 * External dependencies
 */
import { useBlockProps, InnerBlocks } from '@wordpress/block-editor';
import { innerBlockAreas } from '@woocommerce/blocks-checkout';

/**
 * Internal dependencies
 */
import { useForcedLayout } from '../../use-forced-layout';
import { getAllowedBlocks } from '../../editor-utils';
import { useCartBlockContext } from '../../context';

export const Edit = ( { clientId }: { clientId: string } ): JSX.Element => {
	const blockProps = useBlockProps();
	const { currentView } = useCartBlockContext();
	const allowedBlocks = getAllowedBlocks( innerBlockAreas.EMPTY_CART );

	useForcedLayout( {
		clientId,
		template: allowedBlocks,
	} );

	return (
		<div
			{ ...blockProps }
			hidden={ currentView !== 'woocommerce/empty-cart-block' }
		>
			This is the empty cart block.
			<InnerBlocks
				allowedBlocks={ allowedBlocks }
				templateLock={ false }
			/>
		</div>
	);
};

export const Save = (): JSX.Element => {
	return (
		<div { ...useBlockProps.save() }>
			<InnerBlocks.Content />
		</div>
	);
};
woocommerce-blocks/assets/js/blocks/cart-checkout/cart-i2/inner-blocks/empty-cart-block/frontend.tsx000064400000001217151335517640027663 0ustar00/**
 * External dependencies
 */
import { useStoreCart } from '@woocommerce/base-context/hooks';
import { useEffect } from '@wordpress/element';
import { dispatchEvent } from '@woocommerce/base-utils';

const FrontendBlock = ( {
	children,
}: {
	children: JSX.Element;
} ): JSX.Element | null => {
	const { cartItems, cartIsLoading } = useStoreCart();
	useEffect( () => {
		dispatchEvent( 'wc-blocks_render_blocks_frontend', {
			element: document.body.querySelector(
				'.wp-block-woocommerce-cart'
			),
		} );
	}, [] );
	if ( ! cartIsLoading && cartItems.length === 0 ) {
		return <>{ children }</>;
	}
	return null;
};

export default FrontendBlock;
woocommerce-blocks/assets/js/blocks/cart-checkout/cart-i2/inner-blocks/empty-cart-block/index.tsx000064400000000657151335517640027162 0ustar00/**
 * External dependencies
 */
import { Icon, removeCart } from '@woocommerce/icons';
import { registerFeaturePluginBlockType } from '@woocommerce/block-settings';

/**
 * Internal dependencies
 */
import { Edit, Save } from './edit';
import metadata from './block.json';

registerFeaturePluginBlockType( metadata, {
	icon: {
		src: <Icon srcElement={ removeCart } />,
		foreground: '#874FB9',
	},
	edit: Edit,
	save: Save,
} );
woocommerce-blocks/assets/js/blocks/cart-checkout/cart-i2/attributes.js000064400000001105151335517640022261 0ustar00/**
 * External dependencies
 */
import { getSetting } from '@woocommerce/settings';

export const blockName = 'woocommerce/cart-i2';
export const blockAttributes = {
	isPreview: {
		type: 'boolean',
		default: false,
		save: false,
	},
	isShippingCalculatorEnabled: {
		type: 'boolean',
		default: getSetting( 'isShippingCalculatorEnabled', true ),
	},
	checkoutPageId: {
		type: 'number',
		default: 0,
	},
	hasDarkControls: {
		type: 'boolean',
		default: getSetting( 'hasDarkEditorStyleSupport', false ),
	},
	showRateAfterTaxName: {
		type: 'boolean',
		default: true,
	},
};
woocommerce-blocks/assets/js/blocks/cart-checkout/cart/index.js000064400000002206151335517640020675 0ustar00/**
 * External dependencies
 */
import { __ } from '@wordpress/i18n';
import { InnerBlocks } from '@wordpress/block-editor';
import { Icon, cart } from '@woocommerce/icons';
import classnames from 'classnames';
import { registerFeaturePluginBlockType } from '@woocommerce/block-settings';
/**
 * Internal dependencies
 */
import edit from './edit';
import './style.scss';
import blockAttributes from './attributes';

/**
 * Register and run the Cart block.
 */
const settings = {
	title: __( 'Cart', 'woocommerce' ),
	icon: {
		src: <Icon srcElement={ cart } />,
		foreground: '#96588a',
	},
	category: 'woocommerce',
	keywords: [ __( 'WooCommerce', 'woocommerce' ) ],
	description: __( 'Shopping cart.', 'woocommerce' ),
	supports: {
		align: [ 'wide', 'full' ],
		html: false,
		multiple: false,
	},
	example: {
		attributes: {
			isPreview: true,
		},
	},
	attributes: blockAttributes,
	edit,

	// Save the props to post content.
	save( { attributes } ) {
		return (
			<div className={ classnames( 'is-loading', attributes.className ) }>
				<InnerBlocks.Content />
			</div>
		);
	},
};

registerFeaturePluginBlockType( 'woocommerce/cart', settings );
woocommerce-blocks/assets/js/blocks/cart-checkout/cart/test/__snapshots__/block.js.snap000064400000225242151335517640025424 0ustar00// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`Testing cart Contains a Taxes section if Core options are set to show it 1`] = `
<div>
  <div
    aria-hidden="true"
    class="with-scroll-to-top__scroll-point"
  />
  <div
    class=""
  >
    <div
      aria-hidden="false"
      class=""
    >
      <h2
        class="wc-block-components-title"
      >
        Your cart (3 items)
      </h2>
      <div
        class="wc-block-components-sidebar-layout wc-block-cart"
      >
        <iframe
          aria-hidden="true"
          frameborder="0"
          src="about:blank"
          style="display: block; opacity: 0; position: absolute; top: 0px; left: 0px; height: 100%; width: 100%; overflow: hidden; pointer-events: none; z-index: -1;"
          tabindex="-1"
        />
        <div
          class="wc-block-components-main wc-block-cart__main"
        >
          <table
            class="wc-block-cart-items"
            tabindex="-1"
          >
            <thead>
              <tr
                class="wc-block-cart-items__header"
              >
                <th
                  class="wc-block-cart-items__header-image"
                >
                  <span>
                    Product
                  </span>
                </th>
                <th
                  class="wc-block-cart-items__header-product"
                >
                  <span>
                    Details
                  </span>
                </th>
                <th
                  class="wc-block-cart-items__header-total"
                >
                  <span>
                    Total
                  </span>
                </th>
              </tr>
            </thead>
            <tbody>
              <tr
                class="wc-block-cart-items__row"
                tabindex="-1"
              >
                <td
                  aria-hidden="true"
                  class="wc-block-cart-item__image"
                >
                  <a
                    href="https://example.org"
                    tabindex="-1"
                  >
                    <img
                      alt=""
                      src="images/previews/beanie.jpg"
                    />
                  </a>
                </td>
                <td
                  class="wc-block-cart-item__product"
                >
                  <a
                    class="wc-block-components-product-name"
                    href="https://example.org"
                  >
                    Beanie
                  </a>
                  <div
                    class="wc-block-components-product-badge wc-block-components-product-low-stock-badge"
                  >
                    2 left in stock
                  </div>
                  <div
                    class="wc-block-cart-item__prices"
                  >
                    <span
                      class="price wc-block-components-product-price"
                    >
                      <span
                        class="wc-block-formatted-money-amount wc-block-components-formatted-money-amount wc-block-components-product-price__value"
                      >
                        $6.40
                      </span>
                    </span>
                  </div>
                  <div
                    class="wc-block-components-product-metadata"
                  >
                    <div
                      class="wc-block-components-product-metadata__description"
                    >
                      <p>
                        Warm hat for winter
                      </p>
                      

                    </div>
                    <ul
                      class="wc-block-components-product-details"
                    >
                      <li
                        class="wc-block-components-product-details__color"
                      >
                        <span
                          class="wc-block-components-product-details__name"
                        >
                          Color
                          :
                        </span>
                         
                        <span
                          class="wc-block-components-product-details__value"
                        >
                          Yellow
                        </span>
                      </li>
                      <li
                        class="wc-block-components-product-details__size"
                      >
                        <span
                          class="wc-block-components-product-details__name"
                        >
                          Size
                          :
                        </span>
                         
                        <span
                          class="wc-block-components-product-details__value"
                        >
                          Small
                        </span>
                      </li>
                    </ul>
                  </div>
                  <div
                    class="wc-block-cart-item__quantity"
                  >
                    <div
                      class="wc-block-components-quantity-selector"
                    >
                      <input
                        aria-label="Quantity of Beanie in your cart."
                        class="wc-block-components-quantity-selector__input"
                        min="0"
                        step="1"
                        type="number"
                        value="1"
                      />
                      <button
                        aria-label="Reduce quantity"
                        class="wc-block-components-quantity-selector__button wc-block-components-quantity-selector__button--minus"
                        disabled=""
                      >
                        -
                      </button>
                      <button
                        aria-label="Increase quantity"
                        class="wc-block-components-quantity-selector__button wc-block-components-quantity-selector__button--plus"
                      >
                        +
                      </button>
                    </div>
                    <button
                      class="wc-block-cart-item__remove-link"
                    >
                      Remove item
                    </button>
                  </div>
                </td>
                <td
                  class="wc-block-cart-item__total"
                >
                  <div
                    class="wc-block-cart-item__total-price-and-sale-badge-wrapper"
                  >
                    <span
                      class="price wc-block-components-product-price"
                    >
                      <span
                        class="wc-block-formatted-money-amount wc-block-components-formatted-money-amount wc-block-components-product-price__value"
                      >
                        $12.80
                      </span>
                    </span>
                  </div>
                </td>
              </tr>
              <tr
                class="wc-block-cart-items__row"
                tabindex="-1"
              >
                <td
                  aria-hidden="true"
                  class="wc-block-cart-item__image"
                >
                  <a
                    href="https://example.org"
                    tabindex="-1"
                  >
                    <img
                      alt=""
                      src="images/previews/cap.jpg"
                    />
                  </a>
                </td>
                <td
                  class="wc-block-cart-item__product"
                >
                  <a
                    class="wc-block-components-product-name"
                    href="https://example.org"
                  >
                    Cap
                  </a>
                  <div
                    class="wc-block-cart-item__prices"
                  >
                    <span
                      class="price wc-block-components-product-price"
                    >
                      <span
                        class="screen-reader-text"
                      >
                        Previous price:
                      </span>
                      <del
                        class="wc-block-components-product-price__regular"
                      >
                        $12.80
                      </del>
                      <span
                        class="screen-reader-text"
                      >
                        Discounted price:
                      </span>
                      <ins
                        class="wc-block-components-product-price__value is-discounted"
                      >
                        $11.20
                      </ins>
                    </span>
                  </div>
                  <div
                    class="wc-block-components-product-badge wc-block-components-sale-badge"
                  >
                    Save 
                    <span
                      class="wc-block-formatted-money-amount wc-block-components-formatted-money-amount"
                    >
                      $1.60
                    </span>
                  </div>
                  <div
                    class="wc-block-components-product-metadata"
                  >
                    <div
                      class="wc-block-components-product-metadata__description"
                    >
                      <p>
                        Lightweight baseball cap
                      </p>
                      

                    </div>
                    <ul
                      class="wc-block-components-product-details"
                    >
                      <li
                        class="wc-block-components-product-details__color"
                      >
                        <span
                          class="wc-block-components-product-details__name"
                        >
                          Color
                          :
                        </span>
                         
                        <span
                          class="wc-block-components-product-details__value"
                        >
                          Orange
                        </span>
                      </li>
                    </ul>
                  </div>
                  <div
                    class="wc-block-cart-item__quantity"
                  >
                    <div
                      class="wc-block-components-quantity-selector"
                    >
                      <input
                        aria-label="Quantity of Cap in your cart."
                        class="wc-block-components-quantity-selector__input"
                        min="0"
                        step="1"
                        type="number"
                        value="1"
                      />
                      <button
                        aria-label="Reduce quantity"
                        class="wc-block-components-quantity-selector__button wc-block-components-quantity-selector__button--minus"
                        disabled=""
                      >
                        -
                      </button>
                      <button
                        aria-label="Increase quantity"
                        class="wc-block-components-quantity-selector__button wc-block-components-quantity-selector__button--plus"
                      >
                        +
                      </button>
                    </div>
                    <button
                      class="wc-block-cart-item__remove-link"
                    >
                      Remove item
                    </button>
                  </div>
                </td>
                <td
                  class="wc-block-cart-item__total"
                >
                  <div
                    class="wc-block-cart-item__total-price-and-sale-badge-wrapper"
                  >
                    <span
                      class="price wc-block-components-product-price"
                    >
                      <span
                        class="wc-block-formatted-money-amount wc-block-components-formatted-money-amount wc-block-components-product-price__value"
                      >
                        $11.20
                      </span>
                    </span>
                  </div>
                </td>
              </tr>
            </tbody>
          </table>
        </div>
        <div
          class="wc-block-components-sidebar wc-block-cart__sidebar"
        >
          <h2
            class="wc-block-components-title wc-block-cart__totals-title"
          >
            Cart totals
          </h2>
          <div
            class="wc-block-components-totals-wrapper"
          >
            <div
              class="wc-block-components-totals-item"
            >
              <span
                class="wc-block-components-totals-item__label"
              >
                Subtotal
              </span>
              <span
                class="wc-block-formatted-money-amount wc-block-components-formatted-money-amount wc-block-components-totals-item__value"
              >
                $24.00
              </span>
              <div
                class="wc-block-components-totals-item__description"
              />
            </div>
          </div>
          <div
            class="wc-block-components-totals-wrapper"
          >
            <div
              class="wc-block-components-totals-coupon wc-block-components-panel"
            >
              <div>
                <button
                  aria-expanded="false"
                  class="wc-block-components-panel__button"
                >
                  <svg
                    aria-hidden="true"
                    class="wc-block-components-panel__button-icon"
                    focusable="false"
                    height="24"
                    role="img"
                    viewBox="0 0 24 24"
                    width="24"
                    xmlns="http://www.w3.org/2000/svg"
                  >
                    <path
                      d="M17 9.4L12 14 7 9.4l-1 1.2 6 5.4 6-5.4z"
                    />
                  </svg>
                  <span
                    aria-hidden="true"
                  >
                    Coupon code
                  </span>
                  <span
                    class="screen-reader-text"
                  >
                    Apply a coupon code
                  </span>
                </button>
              </div>
            </div>
          </div>
          <div
            class="wc-block-components-totals-wrapper"
          >
            <div
              class="wc-block-components-totals-shipping"
            >
              <div
                class="wc-block-components-totals-item"
              >
                <span
                  class="wc-block-components-totals-item__label"
                >
                  Shipping
                </span>
                <span
                  class="wc-block-formatted-money-amount wc-block-components-formatted-money-amount wc-block-components-totals-item__value"
                >
                  $0.00
                </span>
                <div
                  class="wc-block-components-totals-item__description"
                >
                  <div
                    class="wc-block-components-totals-item__description wc-block-components-totals-shipping__via"
                  >
                    via
                     
                    Free shipping
                  </div>
                </div>
              </div>
              <fieldset
                class="wc-block-components-totals-shipping__fieldset"
              >
                <legend
                  class="screen-reader-text"
                >
                  Shipping options
                </legend>
                <div
                  class=""
                >
                  <div
                    aria-hidden="false"
                    class=""
                  >
                    <div
                      class="wc-block-components-shipping-rates-control wc-block-components-totals-shipping__options"
                    >
                      <div
                        class="wc-block-components-shipping-rates-control__package wc-block-components-panel"
                      >
                        <div>
                          <button
                            aria-expanded="true"
                            class="wc-block-components-panel__button"
                          >
                            <svg
                              aria-hidden="true"
                              class="wc-block-components-panel__button-icon"
                              focusable="false"
                              height="24"
                              role="img"
                              viewBox="0 0 24 24"
                              width="24"
                              xmlns="http://www.w3.org/2000/svg"
                            >
                              <path
                                d="M12 8l-6 5.4 1 1.2 5-4.6 5 4.6 1-1.2z"
                              />
                            </svg>
                            <div
                              class="wc-block-components-shipping-rates-control__package-title"
                            >
                              Shipping
                            </div>
                          </button>
                        </div>
                        <div
                          class="wc-block-components-panel__content"
                        >
                          <div
                            class="wc-block-components-radio-control"
                          >
                            <label
                              class="wc-block-components-radio-control__option wc-block-components-radio-control__option-checked"
                              for="radio-control-1-free_shipping:1"
                            >
                              <input
                                aria-describedby="radio-control-1-free_shipping:1__label radio-control-1-free_shipping:1__description"
                                checked=""
                                class="wc-block-components-radio-control__input"
                                id="radio-control-1-free_shipping:1"
                                name="radio-control-1"
                                type="radio"
                                value="free_shipping:1"
                              />
                              <div
                                class="wc-block-components-radio-control__option-layout"
                              >
                                <div
                                  class="wc-block-components-radio-control__label-group"
                                >
                                  <span
                                    class="wc-block-components-radio-control__label"
                                    id="radio-control-1-free_shipping:1__label"
                                  >
                                    Free shipping
                                  </span>
                                </div>
                                <div
                                  class="wc-block-components-radio-control__description-group"
                                >
                                  <span
                                    class="wc-block-components-radio-control__description"
                                    id="radio-control-1-free_shipping:1__description"
                                  >
                                    <span
                                      class="wc-block-formatted-money-amount wc-block-components-formatted-money-amount"
                                    >
                                      $0.00
                                    </span>
                                    
                                  </span>
                                </div>
                              </div>
                            </label>
                            <label
                              class="wc-block-components-radio-control__option"
                              for="radio-control-1-local_pickup:1"
                            >
                              <input
                                aria-describedby="radio-control-1-local_pickup:1__label radio-control-1-local_pickup:1__description"
                                class="wc-block-components-radio-control__input"
                                id="radio-control-1-local_pickup:1"
                                name="radio-control-1"
                                type="radio"
                                value="local_pickup:1"
                              />
                              <div
                                class="wc-block-components-radio-control__option-layout"
                              >
                                <div
                                  class="wc-block-components-radio-control__label-group"
                                >
                                  <span
                                    class="wc-block-components-radio-control__label"
                                    id="radio-control-1-local_pickup:1__label"
                                  >
                                    Local pickup
                                  </span>
                                </div>
                                <div
                                  class="wc-block-components-radio-control__description-group"
                                >
                                  <span
                                    class="wc-block-components-radio-control__description"
                                    id="radio-control-1-local_pickup:1__description"
                                  >
                                    <span
                                      class="wc-block-formatted-money-amount wc-block-components-formatted-money-amount"
                                    >
                                      $2.00
                                    </span>
                                    
                                  </span>
                                </div>
                              </div>
                            </label>
                          </div>
                        </div>
                      </div>
                    </div>
                  </div>
                </div>
              </fieldset>
            </div>
          </div>
          <div
            class="wc-block-components-totals-wrapper"
          >
            <div
              class="wc-block-components-totals-item wc-block-components-totals-taxes"
            >
              <span
                class="wc-block-components-totals-item__label"
              >
                Taxes
              </span>
              <span
                class="wc-block-formatted-money-amount wc-block-components-formatted-money-amount wc-block-components-totals-item__value"
              >
                $6.00
              </span>
              <div
                class="wc-block-components-totals-item__description"
              />
            </div>
          </div>
          <div
            class="wc-block-components-totals-wrapper"
          >
            <div
              class="wc-block-components-totals-item wc-block-components-totals-footer-item"
            >
              <span
                class="wc-block-components-totals-item__label"
              >
                Total
              </span>
              <span
                class="wc-block-formatted-money-amount wc-block-components-formatted-money-amount wc-block-components-totals-item__value"
              >
                $30.00
              </span>
              <div
                class="wc-block-components-totals-item__description"
              />
            </div>
          </div>
          <div
            class="wc-block-cart__payment-options"
          >
            <div
              class="wc-block-cart__submit"
            >
              <div
                aria-hidden="true"
                style="bottom: 0px; left: 0px; opacity: 0; pointer-events: none; position: absolute; right: 0px; top: 0px; z-index: -1;"
              />
              <div
                class="wc-block-cart__submit-container"
              >
                <a
                  class="components-button wc-block-components-button wc-block-cart__submit-button"
                  href=""
                >
                  <span
                    class="wc-block-components-button__text"
                  >
                    Proceed to Checkout
                  </span>
                </a>
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</div>
`;

exports[`Testing cart Shows individual tax lines if the store is set to do so 1`] = `
<div>
  <div
    aria-hidden="true"
    class="with-scroll-to-top__scroll-point"
  />
  <div
    class=""
  >
    <div
      aria-hidden="false"
      class=""
    >
      <h2
        class="wc-block-components-title"
      >
        Your cart (3 items)
      </h2>
      <div
        class="wc-block-components-sidebar-layout wc-block-cart"
      >
        <iframe
          aria-hidden="true"
          frameborder="0"
          src="about:blank"
          style="display: block; opacity: 0; position: absolute; top: 0px; left: 0px; height: 100%; width: 100%; overflow: hidden; pointer-events: none; z-index: -1;"
          tabindex="-1"
        />
        <div
          class="wc-block-components-main wc-block-cart__main"
        >
          <table
            class="wc-block-cart-items"
            tabindex="-1"
          >
            <thead>
              <tr
                class="wc-block-cart-items__header"
              >
                <th
                  class="wc-block-cart-items__header-image"
                >
                  <span>
                    Product
                  </span>
                </th>
                <th
                  class="wc-block-cart-items__header-product"
                >
                  <span>
                    Details
                  </span>
                </th>
                <th
                  class="wc-block-cart-items__header-total"
                >
                  <span>
                    Total
                  </span>
                </th>
              </tr>
            </thead>
            <tbody>
              <tr
                class="wc-block-cart-items__row"
                tabindex="-1"
              >
                <td
                  aria-hidden="true"
                  class="wc-block-cart-item__image"
                >
                  <a
                    href="https://example.org"
                    tabindex="-1"
                  >
                    <img
                      alt=""
                      src="images/previews/beanie.jpg"
                    />
                  </a>
                </td>
                <td
                  class="wc-block-cart-item__product"
                >
                  <a
                    class="wc-block-components-product-name"
                    href="https://example.org"
                  >
                    Beanie
                  </a>
                  <div
                    class="wc-block-components-product-badge wc-block-components-product-low-stock-badge"
                  >
                    2 left in stock
                  </div>
                  <div
                    class="wc-block-cart-item__prices"
                  >
                    <span
                      class="price wc-block-components-product-price"
                    >
                      <span
                        class="wc-block-formatted-money-amount wc-block-components-formatted-money-amount wc-block-components-product-price__value"
                      >
                        $6.40
                      </span>
                    </span>
                  </div>
                  <div
                    class="wc-block-components-product-metadata"
                  >
                    <div
                      class="wc-block-components-product-metadata__description"
                    >
                      <p>
                        Warm hat for winter
                      </p>
                      

                    </div>
                    <ul
                      class="wc-block-components-product-details"
                    >
                      <li
                        class="wc-block-components-product-details__color"
                      >
                        <span
                          class="wc-block-components-product-details__name"
                        >
                          Color
                          :
                        </span>
                         
                        <span
                          class="wc-block-components-product-details__value"
                        >
                          Yellow
                        </span>
                      </li>
                      <li
                        class="wc-block-components-product-details__size"
                      >
                        <span
                          class="wc-block-components-product-details__name"
                        >
                          Size
                          :
                        </span>
                         
                        <span
                          class="wc-block-components-product-details__value"
                        >
                          Small
                        </span>
                      </li>
                    </ul>
                  </div>
                  <div
                    class="wc-block-cart-item__quantity"
                  >
                    <div
                      class="wc-block-components-quantity-selector"
                    >
                      <input
                        aria-label="Quantity of Beanie in your cart."
                        class="wc-block-components-quantity-selector__input"
                        min="0"
                        step="1"
                        type="number"
                        value="1"
                      />
                      <button
                        aria-label="Reduce quantity"
                        class="wc-block-components-quantity-selector__button wc-block-components-quantity-selector__button--minus"
                        disabled=""
                      >
                        -
                      </button>
                      <button
                        aria-label="Increase quantity"
                        class="wc-block-components-quantity-selector__button wc-block-components-quantity-selector__button--plus"
                      >
                        +
                      </button>
                    </div>
                    <button
                      class="wc-block-cart-item__remove-link"
                    >
                      Remove item
                    </button>
                  </div>
                </td>
                <td
                  class="wc-block-cart-item__total"
                >
                  <div
                    class="wc-block-cart-item__total-price-and-sale-badge-wrapper"
                  >
                    <span
                      class="price wc-block-components-product-price"
                    >
                      <span
                        class="wc-block-formatted-money-amount wc-block-components-formatted-money-amount wc-block-components-product-price__value"
                      >
                        $12.80
                      </span>
                    </span>
                  </div>
                </td>
              </tr>
              <tr
                class="wc-block-cart-items__row"
                tabindex="-1"
              >
                <td
                  aria-hidden="true"
                  class="wc-block-cart-item__image"
                >
                  <a
                    href="https://example.org"
                    tabindex="-1"
                  >
                    <img
                      alt=""
                      src="images/previews/cap.jpg"
                    />
                  </a>
                </td>
                <td
                  class="wc-block-cart-item__product"
                >
                  <a
                    class="wc-block-components-product-name"
                    href="https://example.org"
                  >
                    Cap
                  </a>
                  <div
                    class="wc-block-cart-item__prices"
                  >
                    <span
                      class="price wc-block-components-product-price"
                    >
                      <span
                        class="screen-reader-text"
                      >
                        Previous price:
                      </span>
                      <del
                        class="wc-block-components-product-price__regular"
                      >
                        $12.80
                      </del>
                      <span
                        class="screen-reader-text"
                      >
                        Discounted price:
                      </span>
                      <ins
                        class="wc-block-components-product-price__value is-discounted"
                      >
                        $11.20
                      </ins>
                    </span>
                  </div>
                  <div
                    class="wc-block-components-product-badge wc-block-components-sale-badge"
                  >
                    Save 
                    <span
                      class="wc-block-formatted-money-amount wc-block-components-formatted-money-amount"
                    >
                      $1.60
                    </span>
                  </div>
                  <div
                    class="wc-block-components-product-metadata"
                  >
                    <div
                      class="wc-block-components-product-metadata__description"
                    >
                      <p>
                        Lightweight baseball cap
                      </p>
                      

                    </div>
                    <ul
                      class="wc-block-components-product-details"
                    >
                      <li
                        class="wc-block-components-product-details__color"
                      >
                        <span
                          class="wc-block-components-product-details__name"
                        >
                          Color
                          :
                        </span>
                         
                        <span
                          class="wc-block-components-product-details__value"
                        >
                          Orange
                        </span>
                      </li>
                    </ul>
                  </div>
                  <div
                    class="wc-block-cart-item__quantity"
                  >
                    <div
                      class="wc-block-components-quantity-selector"
                    >
                      <input
                        aria-label="Quantity of Cap in your cart."
                        class="wc-block-components-quantity-selector__input"
                        min="0"
                        step="1"
                        type="number"
                        value="1"
                      />
                      <button
                        aria-label="Reduce quantity"
                        class="wc-block-components-quantity-selector__button wc-block-components-quantity-selector__button--minus"
                        disabled=""
                      >
                        -
                      </button>
                      <button
                        aria-label="Increase quantity"
                        class="wc-block-components-quantity-selector__button wc-block-components-quantity-selector__button--plus"
                      >
                        +
                      </button>
                    </div>
                    <button
                      class="wc-block-cart-item__remove-link"
                    >
                      Remove item
                    </button>
                  </div>
                </td>
                <td
                  class="wc-block-cart-item__total"
                >
                  <div
                    class="wc-block-cart-item__total-price-and-sale-badge-wrapper"
                  >
                    <span
                      class="price wc-block-components-product-price"
                    >
                      <span
                        class="wc-block-formatted-money-amount wc-block-components-formatted-money-amount wc-block-components-product-price__value"
                      >
                        $11.20
                      </span>
                    </span>
                  </div>
                </td>
              </tr>
            </tbody>
          </table>
        </div>
        <div
          class="wc-block-components-sidebar wc-block-cart__sidebar"
        >
          <h2
            class="wc-block-components-title wc-block-cart__totals-title"
          >
            Cart totals
          </h2>
          <div
            class="wc-block-components-totals-wrapper"
          >
            <div
              class="wc-block-components-totals-item"
            >
              <span
                class="wc-block-components-totals-item__label"
              >
                Subtotal
              </span>
              <span
                class="wc-block-formatted-money-amount wc-block-components-formatted-money-amount wc-block-components-totals-item__value"
              >
                $24.00
              </span>
              <div
                class="wc-block-components-totals-item__description"
              />
            </div>
          </div>
          <div
            class="wc-block-components-totals-wrapper"
          >
            <div
              class="wc-block-components-totals-coupon wc-block-components-panel"
            >
              <div>
                <button
                  aria-expanded="false"
                  class="wc-block-components-panel__button"
                >
                  <svg
                    aria-hidden="true"
                    class="wc-block-components-panel__button-icon"
                    focusable="false"
                    height="24"
                    role="img"
                    viewBox="0 0 24 24"
                    width="24"
                    xmlns="http://www.w3.org/2000/svg"
                  >
                    <path
                      d="M17 9.4L12 14 7 9.4l-1 1.2 6 5.4 6-5.4z"
                    />
                  </svg>
                  <span
                    aria-hidden="true"
                  >
                    Coupon code
                  </span>
                  <span
                    class="screen-reader-text"
                  >
                    Apply a coupon code
                  </span>
                </button>
              </div>
            </div>
          </div>
          <div
            class="wc-block-components-totals-wrapper"
          >
            <div
              class="wc-block-components-totals-shipping"
            >
              <div
                class="wc-block-components-totals-item"
              >
                <span
                  class="wc-block-components-totals-item__label"
                >
                  Shipping
                </span>
                <span
                  class="wc-block-formatted-money-amount wc-block-components-formatted-money-amount wc-block-components-totals-item__value"
                >
                  $0.00
                </span>
                <div
                  class="wc-block-components-totals-item__description"
                >
                  <div
                    class="wc-block-components-totals-item__description wc-block-components-totals-shipping__via"
                  >
                    via
                     
                    Free shipping
                  </div>
                </div>
              </div>
              <fieldset
                class="wc-block-components-totals-shipping__fieldset"
              >
                <legend
                  class="screen-reader-text"
                >
                  Shipping options
                </legend>
                <div
                  class=""
                >
                  <div
                    aria-hidden="false"
                    class=""
                  >
                    <div
                      class="wc-block-components-shipping-rates-control wc-block-components-totals-shipping__options"
                    >
                      <div
                        class="wc-block-components-shipping-rates-control__package wc-block-components-panel"
                      >
                        <div>
                          <button
                            aria-expanded="true"
                            class="wc-block-components-panel__button"
                          >
                            <svg
                              aria-hidden="true"
                              class="wc-block-components-panel__button-icon"
                              focusable="false"
                              height="24"
                              role="img"
                              viewBox="0 0 24 24"
                              width="24"
                              xmlns="http://www.w3.org/2000/svg"
                            >
                              <path
                                d="M12 8l-6 5.4 1 1.2 5-4.6 5 4.6 1-1.2z"
                              />
                            </svg>
                            <div
                              class="wc-block-components-shipping-rates-control__package-title"
                            >
                              Shipping
                            </div>
                          </button>
                        </div>
                        <div
                          class="wc-block-components-panel__content"
                        >
                          <div
                            class="wc-block-components-radio-control"
                          >
                            <label
                              class="wc-block-components-radio-control__option wc-block-components-radio-control__option-checked"
                              for="radio-control-2-free_shipping:1"
                            >
                              <input
                                aria-describedby="radio-control-2-free_shipping:1__label radio-control-2-free_shipping:1__description"
                                checked=""
                                class="wc-block-components-radio-control__input"
                                id="radio-control-2-free_shipping:1"
                                name="radio-control-2"
                                type="radio"
                                value="free_shipping:1"
                              />
                              <div
                                class="wc-block-components-radio-control__option-layout"
                              >
                                <div
                                  class="wc-block-components-radio-control__label-group"
                                >
                                  <span
                                    class="wc-block-components-radio-control__label"
                                    id="radio-control-2-free_shipping:1__label"
                                  >
                                    Free shipping
                                  </span>
                                </div>
                                <div
                                  class="wc-block-components-radio-control__description-group"
                                >
                                  <span
                                    class="wc-block-components-radio-control__description"
                                    id="radio-control-2-free_shipping:1__description"
                                  >
                                    <span
                                      class="wc-block-formatted-money-amount wc-block-components-formatted-money-amount"
                                    >
                                      $0.00
                                    </span>
                                    
                                  </span>
                                </div>
                              </div>
                            </label>
                            <label
                              class="wc-block-components-radio-control__option"
                              for="radio-control-2-local_pickup:1"
                            >
                              <input
                                aria-describedby="radio-control-2-local_pickup:1__label radio-control-2-local_pickup:1__description"
                                class="wc-block-components-radio-control__input"
                                id="radio-control-2-local_pickup:1"
                                name="radio-control-2"
                                type="radio"
                                value="local_pickup:1"
                              />
                              <div
                                class="wc-block-components-radio-control__option-layout"
                              >
                                <div
                                  class="wc-block-components-radio-control__label-group"
                                >
                                  <span
                                    class="wc-block-components-radio-control__label"
                                    id="radio-control-2-local_pickup:1__label"
                                  >
                                    Local pickup
                                  </span>
                                </div>
                                <div
                                  class="wc-block-components-radio-control__description-group"
                                >
                                  <span
                                    class="wc-block-components-radio-control__description"
                                    id="radio-control-2-local_pickup:1__description"
                                  >
                                    <span
                                      class="wc-block-formatted-money-amount wc-block-components-formatted-money-amount"
                                    >
                                      $2.00
                                    </span>
                                    
                                  </span>
                                </div>
                              </div>
                            </label>
                          </div>
                        </div>
                      </div>
                    </div>
                  </div>
                </div>
              </fieldset>
            </div>
          </div>
          <div
            class="wc-block-components-totals-wrapper"
          >
            <div
              class="wc-block-components-totals-taxes"
            >
              <div
                class="wc-block-components-totals-item wc-block-components-totals-taxes__grouped-rate"
              >
                <span
                  class="wc-block-components-totals-item__label"
                >
                  Sales tax
                </span>
                <span
                  class="wc-block-formatted-money-amount wc-block-components-formatted-money-amount wc-block-components-totals-item__value"
                >
                  $6.00
                </span>
                <div
                  class="wc-block-components-totals-item__description"
                />
              </div>
               
            </div>
          </div>
          <div
            class="wc-block-components-totals-wrapper"
          >
            <div
              class="wc-block-components-totals-item wc-block-components-totals-footer-item"
            >
              <span
                class="wc-block-components-totals-item__label"
              >
                Total
              </span>
              <span
                class="wc-block-formatted-money-amount wc-block-components-formatted-money-amount wc-block-components-totals-item__value"
              >
                $30.00
              </span>
              <div
                class="wc-block-components-totals-item__description"
              />
            </div>
          </div>
          <div
            class="wc-block-cart__payment-options"
          >
            <div
              class="wc-block-cart__submit"
            >
              <div
                aria-hidden="true"
                style="bottom: 0px; left: 0px; opacity: 0; pointer-events: none; position: absolute; right: 0px; top: 0px; z-index: -1;"
              />
              <div
                class="wc-block-cart__submit-container"
              >
                <a
                  class="components-button wc-block-components-button wc-block-cart__submit-button"
                  href=""
                >
                  <span
                    class="wc-block-components-button__text"
                  >
                    Proceed to Checkout
                  </span>
                </a>
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</div>
`;

exports[`Testing cart Shows rate percentages after tax lines if the block is set to do so 1`] = `
<div>
  <div
    aria-hidden="true"
    class="with-scroll-to-top__scroll-point"
  />
  <div
    class=""
  >
    <div
      aria-hidden="false"
      class=""
    >
      <h2
        class="wc-block-components-title"
      >
        Your cart (3 items)
      </h2>
      <div
        class="wc-block-components-sidebar-layout wc-block-cart"
      >
        <iframe
          aria-hidden="true"
          frameborder="0"
          src="about:blank"
          style="display: block; opacity: 0; position: absolute; top: 0px; left: 0px; height: 100%; width: 100%; overflow: hidden; pointer-events: none; z-index: -1;"
          tabindex="-1"
        />
        <div
          class="wc-block-components-main wc-block-cart__main"
        >
          <table
            class="wc-block-cart-items"
            tabindex="-1"
          >
            <thead>
              <tr
                class="wc-block-cart-items__header"
              >
                <th
                  class="wc-block-cart-items__header-image"
                >
                  <span>
                    Product
                  </span>
                </th>
                <th
                  class="wc-block-cart-items__header-product"
                >
                  <span>
                    Details
                  </span>
                </th>
                <th
                  class="wc-block-cart-items__header-total"
                >
                  <span>
                    Total
                  </span>
                </th>
              </tr>
            </thead>
            <tbody>
              <tr
                class="wc-block-cart-items__row"
                tabindex="-1"
              >
                <td
                  aria-hidden="true"
                  class="wc-block-cart-item__image"
                >
                  <a
                    href="https://example.org"
                    tabindex="-1"
                  >
                    <img
                      alt=""
                      src="images/previews/beanie.jpg"
                    />
                  </a>
                </td>
                <td
                  class="wc-block-cart-item__product"
                >
                  <a
                    class="wc-block-components-product-name"
                    href="https://example.org"
                  >
                    Beanie
                  </a>
                  <div
                    class="wc-block-components-product-badge wc-block-components-product-low-stock-badge"
                  >
                    2 left in stock
                  </div>
                  <div
                    class="wc-block-cart-item__prices"
                  >
                    <span
                      class="price wc-block-components-product-price"
                    >
                      <span
                        class="wc-block-formatted-money-amount wc-block-components-formatted-money-amount wc-block-components-product-price__value"
                      >
                        $6.40
                      </span>
                    </span>
                  </div>
                  <div
                    class="wc-block-components-product-metadata"
                  >
                    <div
                      class="wc-block-components-product-metadata__description"
                    >
                      <p>
                        Warm hat for winter
                      </p>
                      

                    </div>
                    <ul
                      class="wc-block-components-product-details"
                    >
                      <li
                        class="wc-block-components-product-details__color"
                      >
                        <span
                          class="wc-block-components-product-details__name"
                        >
                          Color
                          :
                        </span>
                         
                        <span
                          class="wc-block-components-product-details__value"
                        >
                          Yellow
                        </span>
                      </li>
                      <li
                        class="wc-block-components-product-details__size"
                      >
                        <span
                          class="wc-block-components-product-details__name"
                        >
                          Size
                          :
                        </span>
                         
                        <span
                          class="wc-block-components-product-details__value"
                        >
                          Small
                        </span>
                      </li>
                    </ul>
                  </div>
                  <div
                    class="wc-block-cart-item__quantity"
                  >
                    <div
                      class="wc-block-components-quantity-selector"
                    >
                      <input
                        aria-label="Quantity of Beanie in your cart."
                        class="wc-block-components-quantity-selector__input"
                        min="0"
                        step="1"
                        type="number"
                        value="1"
                      />
                      <button
                        aria-label="Reduce quantity"
                        class="wc-block-components-quantity-selector__button wc-block-components-quantity-selector__button--minus"
                        disabled=""
                      >
                        -
                      </button>
                      <button
                        aria-label="Increase quantity"
                        class="wc-block-components-quantity-selector__button wc-block-components-quantity-selector__button--plus"
                      >
                        +
                      </button>
                    </div>
                    <button
                      class="wc-block-cart-item__remove-link"
                    >
                      Remove item
                    </button>
                  </div>
                </td>
                <td
                  class="wc-block-cart-item__total"
                >
                  <div
                    class="wc-block-cart-item__total-price-and-sale-badge-wrapper"
                  >
                    <span
                      class="price wc-block-components-product-price"
                    >
                      <span
                        class="wc-block-formatted-money-amount wc-block-components-formatted-money-amount wc-block-components-product-price__value"
                      >
                        $12.80
                      </span>
                    </span>
                  </div>
                </td>
              </tr>
              <tr
                class="wc-block-cart-items__row"
                tabindex="-1"
              >
                <td
                  aria-hidden="true"
                  class="wc-block-cart-item__image"
                >
                  <a
                    href="https://example.org"
                    tabindex="-1"
                  >
                    <img
                      alt=""
                      src="images/previews/cap.jpg"
                    />
                  </a>
                </td>
                <td
                  class="wc-block-cart-item__product"
                >
                  <a
                    class="wc-block-components-product-name"
                    href="https://example.org"
                  >
                    Cap
                  </a>
                  <div
                    class="wc-block-cart-item__prices"
                  >
                    <span
                      class="price wc-block-components-product-price"
                    >
                      <span
                        class="screen-reader-text"
                      >
                        Previous price:
                      </span>
                      <del
                        class="wc-block-components-product-price__regular"
                      >
                        $12.80
                      </del>
                      <span
                        class="screen-reader-text"
                      >
                        Discounted price:
                      </span>
                      <ins
                        class="wc-block-components-product-price__value is-discounted"
                      >
                        $11.20
                      </ins>
                    </span>
                  </div>
                  <div
                    class="wc-block-components-product-badge wc-block-components-sale-badge"
                  >
                    Save 
                    <span
                      class="wc-block-formatted-money-amount wc-block-components-formatted-money-amount"
                    >
                      $1.60
                    </span>
                  </div>
                  <div
                    class="wc-block-components-product-metadata"
                  >
                    <div
                      class="wc-block-components-product-metadata__description"
                    >
                      <p>
                        Lightweight baseball cap
                      </p>
                      

                    </div>
                    <ul
                      class="wc-block-components-product-details"
                    >
                      <li
                        class="wc-block-components-product-details__color"
                      >
                        <span
                          class="wc-block-components-product-details__name"
                        >
                          Color
                          :
                        </span>
                         
                        <span
                          class="wc-block-components-product-details__value"
                        >
                          Orange
                        </span>
                      </li>
                    </ul>
                  </div>
                  <div
                    class="wc-block-cart-item__quantity"
                  >
                    <div
                      class="wc-block-components-quantity-selector"
                    >
                      <input
                        aria-label="Quantity of Cap in your cart."
                        class="wc-block-components-quantity-selector__input"
                        min="0"
                        step="1"
                        type="number"
                        value="1"
                      />
                      <button
                        aria-label="Reduce quantity"
                        class="wc-block-components-quantity-selector__button wc-block-components-quantity-selector__button--minus"
                        disabled=""
                      >
                        -
                      </button>
                      <button
                        aria-label="Increase quantity"
                        class="wc-block-components-quantity-selector__button wc-block-components-quantity-selector__button--plus"
                      >
                        +
                      </button>
                    </div>
                    <button
                      class="wc-block-cart-item__remove-link"
                    >
                      Remove item
                    </button>
                  </div>
                </td>
                <td
                  class="wc-block-cart-item__total"
                >
                  <div
                    class="wc-block-cart-item__total-price-and-sale-badge-wrapper"
                  >
                    <span
                      class="price wc-block-components-product-price"
                    >
                      <span
                        class="wc-block-formatted-money-amount wc-block-components-formatted-money-amount wc-block-components-product-price__value"
                      >
                        $11.20
                      </span>
                    </span>
                  </div>
                </td>
              </tr>
            </tbody>
          </table>
        </div>
        <div
          class="wc-block-components-sidebar wc-block-cart__sidebar"
        >
          <h2
            class="wc-block-components-title wc-block-cart__totals-title"
          >
            Cart totals
          </h2>
          <div
            class="wc-block-components-totals-wrapper"
          >
            <div
              class="wc-block-components-totals-item"
            >
              <span
                class="wc-block-components-totals-item__label"
              >
                Subtotal
              </span>
              <span
                class="wc-block-formatted-money-amount wc-block-components-formatted-money-amount wc-block-components-totals-item__value"
              >
                $24.00
              </span>
              <div
                class="wc-block-components-totals-item__description"
              />
            </div>
          </div>
          <div
            class="wc-block-components-totals-wrapper"
          >
            <div
              class="wc-block-components-totals-coupon wc-block-components-panel"
            >
              <div>
                <button
                  aria-expanded="false"
                  class="wc-block-components-panel__button"
                >
                  <svg
                    aria-hidden="true"
                    class="wc-block-components-panel__button-icon"
                    focusable="false"
                    height="24"
                    role="img"
                    viewBox="0 0 24 24"
                    width="24"
                    xmlns="http://www.w3.org/2000/svg"
                  >
                    <path
                      d="M17 9.4L12 14 7 9.4l-1 1.2 6 5.4 6-5.4z"
                    />
                  </svg>
                  <span
                    aria-hidden="true"
                  >
                    Coupon code
                  </span>
                  <span
                    class="screen-reader-text"
                  >
                    Apply a coupon code
                  </span>
                </button>
              </div>
            </div>
          </div>
          <div
            class="wc-block-components-totals-wrapper"
          >
            <div
              class="wc-block-components-totals-shipping"
            >
              <div
                class="wc-block-components-totals-item"
              >
                <span
                  class="wc-block-components-totals-item__label"
                >
                  Shipping
                </span>
                <span
                  class="wc-block-formatted-money-amount wc-block-components-formatted-money-amount wc-block-components-totals-item__value"
                >
                  $0.00
                </span>
                <div
                  class="wc-block-components-totals-item__description"
                >
                  <div
                    class="wc-block-components-totals-item__description wc-block-components-totals-shipping__via"
                  >
                    via
                     
                    Free shipping
                  </div>
                </div>
              </div>
              <fieldset
                class="wc-block-components-totals-shipping__fieldset"
              >
                <legend
                  class="screen-reader-text"
                >
                  Shipping options
                </legend>
                <div
                  class=""
                >
                  <div
                    aria-hidden="false"
                    class=""
                  >
                    <div
                      class="wc-block-components-shipping-rates-control wc-block-components-totals-shipping__options"
                    >
                      <div
                        class="wc-block-components-shipping-rates-control__package wc-block-components-panel"
                      >
                        <div>
                          <button
                            aria-expanded="true"
                            class="wc-block-components-panel__button"
                          >
                            <svg
                              aria-hidden="true"
                              class="wc-block-components-panel__button-icon"
                              focusable="false"
                              height="24"
                              role="img"
                              viewBox="0 0 24 24"
                              width="24"
                              xmlns="http://www.w3.org/2000/svg"
                            >
                              <path
                                d="M12 8l-6 5.4 1 1.2 5-4.6 5 4.6 1-1.2z"
                              />
                            </svg>
                            <div
                              class="wc-block-components-shipping-rates-control__package-title"
                            >
                              Shipping
                            </div>
                          </button>
                        </div>
                        <div
                          class="wc-block-components-panel__content"
                        >
                          <div
                            class="wc-block-components-radio-control"
                          >
                            <label
                              class="wc-block-components-radio-control__option wc-block-components-radio-control__option-checked"
                              for="radio-control-3-free_shipping:1"
                            >
                              <input
                                aria-describedby="radio-control-3-free_shipping:1__label radio-control-3-free_shipping:1__description"
                                checked=""
                                class="wc-block-components-radio-control__input"
                                id="radio-control-3-free_shipping:1"
                                name="radio-control-3"
                                type="radio"
                                value="free_shipping:1"
                              />
                              <div
                                class="wc-block-components-radio-control__option-layout"
                              >
                                <div
                                  class="wc-block-components-radio-control__label-group"
                                >
                                  <span
                                    class="wc-block-components-radio-control__label"
                                    id="radio-control-3-free_shipping:1__label"
                                  >
                                    Free shipping
                                  </span>
                                </div>
                                <div
                                  class="wc-block-components-radio-control__description-group"
                                >
                                  <span
                                    class="wc-block-components-radio-control__description"
                                    id="radio-control-3-free_shipping:1__description"
                                  >
                                    <span
                                      class="wc-block-formatted-money-amount wc-block-components-formatted-money-amount"
                                    >
                                      $0.00
                                    </span>
                                    
                                  </span>
                                </div>
                              </div>
                            </label>
                            <label
                              class="wc-block-components-radio-control__option"
                              for="radio-control-3-local_pickup:1"
                            >
                              <input
                                aria-describedby="radio-control-3-local_pickup:1__label radio-control-3-local_pickup:1__description"
                                class="wc-block-components-radio-control__input"
                                id="radio-control-3-local_pickup:1"
                                name="radio-control-3"
                                type="radio"
                                value="local_pickup:1"
                              />
                              <div
                                class="wc-block-components-radio-control__option-layout"
                              >
                                <div
                                  class="wc-block-components-radio-control__label-group"
                                >
                                  <span
                                    class="wc-block-components-radio-control__label"
                                    id="radio-control-3-local_pickup:1__label"
                                  >
                                    Local pickup
                                  </span>
                                </div>
                                <div
                                  class="wc-block-components-radio-control__description-group"
                                >
                                  <span
                                    class="wc-block-components-radio-control__description"
                                    id="radio-control-3-local_pickup:1__description"
                                  >
                                    <span
                                      class="wc-block-formatted-money-amount wc-block-components-formatted-money-amount"
                                    >
                                      $2.00
                                    </span>
                                    
                                  </span>
                                </div>
                              </div>
                            </label>
                          </div>
                        </div>
                      </div>
                    </div>
                  </div>
                </div>
              </fieldset>
            </div>
          </div>
          <div
            class="wc-block-components-totals-wrapper"
          >
            <div
              class="wc-block-components-totals-taxes"
            >
              <div
                class="wc-block-components-totals-item wc-block-components-totals-taxes__grouped-rate"
              >
                <span
                  class="wc-block-components-totals-item__label"
                >
                  Sales tax 20%
                </span>
                <span
                  class="wc-block-formatted-money-amount wc-block-components-formatted-money-amount wc-block-components-totals-item__value"
                >
                  $6.00
                </span>
                <div
                  class="wc-block-components-totals-item__description"
                />
              </div>
               
            </div>
          </div>
          <div
            class="wc-block-components-totals-wrapper"
          >
            <div
              class="wc-block-components-totals-item wc-block-components-totals-footer-item"
            >
              <span
                class="wc-block-components-totals-item__label"
              >
                Total
              </span>
              <span
                class="wc-block-formatted-money-amount wc-block-components-formatted-money-amount wc-block-components-totals-item__value"
              >
                $30.00
              </span>
              <div
                class="wc-block-components-totals-item__description"
              />
            </div>
          </div>
          <div
            class="wc-block-cart__payment-options"
          >
            <div
              class="wc-block-cart__submit"
            >
              <div
                aria-hidden="true"
                style="bottom: 0px; left: 0px; opacity: 0; pointer-events: none; position: absolute; right: 0px; top: 0px; z-index: -1;"
              />
              <div
                class="wc-block-cart__submit-container"
              >
                <a
                  class="components-button wc-block-components-button wc-block-cart__submit-button"
                  href=""
                >
                  <span
                    class="wc-block-components-button__text"
                  >
                    Proceed to Checkout
                  </span>
                </a>
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</div>
`;
woocommerce-blocks/assets/js/blocks/cart-checkout/cart/test/block.js000064400000011737151335517640021650 0ustar00/**
 * External dependencies
 */
import { render, screen, waitFor } from '@testing-library/react';
import { previewCart } from '@woocommerce/resource-previews';
import { dispatch } from '@wordpress/data';
import { CART_STORE_KEY as storeKey } from '@woocommerce/block-data';
import { SlotFillProvider } from '@woocommerce/blocks-checkout';
import { default as fetchMock } from 'jest-fetch-mock';

/**
 * Internal dependencies
 */
import Block from '../block';
import { defaultCartState } from '../../../../data/default-states';
import { allSettings } from '../../../../settings/shared/settings-init';

const CartBlock = ( props ) => (
	<SlotFillProvider>
		<Block { ...props } />
	</SlotFillProvider>
);
describe( 'Testing cart', () => {
	beforeEach( async () => {
		fetchMock.mockResponse( ( req ) => {
			if ( req.url.match( /wc\/store\/cart/ ) ) {
				return Promise.resolve( JSON.stringify( previewCart ) );
			}
			return Promise.resolve( '' );
		} );
		// need to clear the store resolution state between tests.
		await dispatch( storeKey ).invalidateResolutionForStore();
		await dispatch( storeKey ).receiveCart( defaultCartState.cartData );
	} );

	afterEach( () => {
		fetchMock.resetMocks();
	} );

	it( 'renders cart if there are items in the cart', async () => {
		render(
			<CartBlock
				emptyCart={ null }
				attributes={ {
					isShippingCalculatorEnabled: false,
				} }
			/>
		);
		await waitFor( () => expect( fetchMock ).toHaveBeenCalled() );
		expect(
			screen.getByText( /Proceed to Checkout/i )
		).toBeInTheDocument();

		expect( fetchMock ).toHaveBeenCalledTimes( 1 );
		// ["`select` control in `@wordpress/data-controls` is deprecated. Please use built-in `resolveSelect` control in `@wordpress/data` instead."]
		expect( console ).toHaveWarned();
	} );

	it( 'Contains a Taxes section if Core options are set to show it', async () => {
		allSettings.displayCartPricesIncludingTax = false;
		// The criteria for showing the Taxes section is:
		// Display prices during basket and checkout: 'Excluding tax'.
		const { container } = render(
			<CartBlock
				emptyCart={ null }
				attributes={ {
					isShippingCalculatorEnabled: false,
				} }
			/>
		);
		await waitFor( () => expect( fetchMock ).toHaveBeenCalled() );
		expect( container ).toMatchSnapshot();
	} );

	it( 'Shows individual tax lines if the store is set to do so', async () => {
		allSettings.displayCartPricesIncludingTax = false;
		allSettings.displayItemizedTaxes = true;
		// The criteria for showing the lines in the Taxes section is:
		// Display prices during basket and checkout: 'Excluding tax'.
		// Display tax totals: 'Itemized';
		const { container } = render(
			<CartBlock
				emptyCart={ null }
				attributes={ {
					isShippingCalculatorEnabled: false,
				} }
			/>
		);
		await waitFor( () => expect( fetchMock ).toHaveBeenCalled() );
		expect( container ).toMatchSnapshot();
	} );

	it( 'Shows rate percentages after tax lines if the block is set to do so', async () => {
		allSettings.displayCartPricesIncludingTax = false;
		allSettings.displayItemizedTaxes = true;
		// The criteria for showing the lines in the Taxes section is:
		// Display prices during basket and checkout: 'Excluding tax'.
		// Display tax totals: 'Itemized';
		const { container } = render(
			<CartBlock
				emptyCart={ null }
				attributes={ {
					showRateAfterTaxName: true,
					isShippingCalculatorEnabled: false,
				} }
			/>
		);
		await waitFor( () => expect( fetchMock ).toHaveBeenCalled() );
		expect( container ).toMatchSnapshot();
	} );

	it( 'renders empty cart if there are no items in the cart', async () => {
		fetchMock.mockResponse( ( req ) => {
			if ( req.url.match( /wc\/store\/cart/ ) ) {
				return Promise.resolve(
					JSON.stringify( defaultCartState.cartData )
				);
			}
			return Promise.resolve( '' );
		} );
		render(
			<CartBlock
				emptyCart={ '<div>Empty Cart</div>' }
				attributes={ {
					isShippingCalculatorEnabled: false,
				} }
			/>
		);

		await waitFor( () => expect( fetchMock ).toHaveBeenCalled() );
		expect( screen.getByText( /Empty Cart/i ) ).toBeInTheDocument();
		expect( fetchMock ).toHaveBeenCalledTimes( 1 );
	} );

	it( 'renders correct cart line subtotal when currency has 0 decimals', async () => {
		fetchMock.mockResponse( ( req ) => {
			if ( req.url.match( /wc\/store\/cart/ ) ) {
				const cart = {
					...previewCart,
					// Make it so there is only one item to simplify things.
					items: [
						{
							...previewCart.items[ 0 ],
							totals: {
								...previewCart.items[ 0 ].totals,
								// Change price format so there are no decimals.
								currency_minor_unit: 0,
								currency_prefix: '',
								currency_suffix: '€',
								line_subtotal: '16',
								line_total: '18',
							},
						},
					],
				};

				return Promise.resolve( JSON.stringify( cart ) );
			}
		} );
		render( <CartBlock emptyCart={ null } attributes={ {} } /> );

		await waitFor( () => expect( fetchMock ).toHaveBeenCalled() );
		expect( screen.getAllByRole( 'cell' )[ 1 ] ).toHaveTextContent( '16€' );
	} );
} );
woocommerce-blocks/assets/js/blocks/cart-checkout/cart/checkout-button/style.scss000064400000001576151335517640024414 0ustar00.wc-block-cart__submit {
	position: relative;
}

.wc-block-cart__submit-container {
	padding-bottom: $gap;
}

.wc-block-cart__submit-button {
	width: 100%;
	margin: 0 0 $gap;

	&:last-child {
		margin-bottom: 0;
	}
}

.is-mobile,
.is-small,
.is-medium {
	.wc-block-cart__submit-container:not(.wc-block-cart__submit-container--sticky) {
		padding-left: 0;
		padding-right: 0;
		padding-top: 0;
	}
}

@include breakpoint(">782px") {
	.wc-block-cart__submit-container--sticky {
		display: none;
	}
}

@include breakpoint("<782px") {
	.wc-block-cart__submit-container--sticky {
		background: $white;
		bottom: 0;
		left: 0;
		padding: $gap;
		position: fixed;
		width: 100%;
		z-index: 9999;

		&::before {
			box-shadow: 0 -10px 20px 10px currentColor;
			color: transparentize($gray-400, 0.5);
			content: "";
			height: 100%;
			left: 0;
			position: absolute;
			right: 0;
			top: 0;
		}
	}
}

woocommerce-blocks/assets/js/blocks/cart-checkout/cart/checkout-button/index.tsx000064400000006227151335517640024224 0ustar00/**
 * External dependencies
 */
import { __ } from '@wordpress/i18n';
import { useState, useEffect } from '@wordpress/element';
import { PaymentMethodIcons } from '@woocommerce/base-components/cart-checkout';
import Button from '@woocommerce/base-components/button';
import { CHECKOUT_URL } from '@woocommerce/block-settings';
import { useCheckoutContext } from '@woocommerce/base-context';
import { usePaymentMethods } from '@woocommerce/base-context/hooks';
import { usePositionRelativeToViewport } from '@woocommerce/base-hooks';
import type {
	PaymentMethods,
	PaymentMethodIcons as PaymentMethodIconsType,
} from '@woocommerce/type-defs/payments';

/**
 * Internal dependencies
 */
import './style.scss';

const getIconsFromPaymentMethods = (
	paymentMethods: PaymentMethods
): PaymentMethodIconsType => {
	return Object.values( paymentMethods ).reduce( ( acc, paymentMethod ) => {
		if ( paymentMethod.icons !== null ) {
			acc = acc.concat( paymentMethod.icons );
		}
		return acc;
	}, [] as PaymentMethodIconsType );
};

/**
 * Checkout button rendered in the full cart page.
 *
 * @param {Object} props Incoming props for the component.
 * @param {string} props.link What the button is linked to.
 */
const CheckoutButton = ( { link }: { link: string } ): JSX.Element => {
	const { isCalculating } = useCheckoutContext();
	const [
		positionReferenceElement,
		positionRelativeToViewport,
	] = usePositionRelativeToViewport();
	const [ showSpinner, setShowSpinner ] = useState( false );
	const { paymentMethods } = usePaymentMethods();

	useEffect( () => {
		// Add a listener to remove the spinner on the checkout button, so the saved page snapshot does not
		// contain the spinner class. See https://archive.is/lOEW0 for why this is needed for Safari.

		if (
			typeof global.addEventListener !== 'function' ||
			typeof global.removeEventListener !== 'function'
		) {
			return;
		}

		const hideSpinner = () => {
			setShowSpinner( false );
		};

		global.addEventListener( 'pageshow', hideSpinner );

		return () => {
			global.removeEventListener( 'pageshow', hideSpinner );
		};
	}, [] );

	const submitContainerContents = (
		<>
			<Button
				className="wc-block-cart__submit-button"
				href={ link || CHECKOUT_URL }
				disabled={ isCalculating }
				onClick={ () => setShowSpinner( true ) }
				showSpinner={ showSpinner }
			>
				{ __( 'Proceed to Checkout', 'woo-gutenberg-products-block' ) }
			</Button>
			<PaymentMethodIcons
				icons={ getIconsFromPaymentMethods( paymentMethods ) }
			/>
		</>
	);

	return (
		<div className="wc-block-cart__submit">
			{ positionReferenceElement }
			{ /* The non-sticky container must always be visible because it gives height to its parent, which is required to calculate when it becomes visible in the viewport. */ }
			<div className="wc-block-cart__submit-container">
				{ submitContainerContents }
			</div>
			{ /* If the positionReferenceElement is below the viewport, display the sticky container. */ }
			{ positionRelativeToViewport === 'below' && (
				<div className="wc-block-cart__submit-container wc-block-cart__submit-container--sticky">
					{ submitContainerContents }
				</div>
			) }
		</div>
	);
};

export default CheckoutButton;
woocommerce-blocks/assets/js/blocks/cart-checkout/cart/style.scss000064400000000157151335517640021270 0ustar00.wp-block-woocommerce-cart.is-loading {
	display: none;
}

.wp-block-woocommerce-cart {
	margin-bottom: 3em;
}
woocommerce-blocks/assets/js/blocks/cart-checkout/cart/frontend.js000064400000003517151335517640021413 0ustar00/**
 * External dependencies
 */
import {
	withStoreCartApiHydration,
	withRestApiHydration,
} from '@woocommerce/block-hocs';
import { __ } from '@wordpress/i18n';
import {
	StoreNoticesProvider,
	StoreSnackbarNoticesProvider,
	CartProvider,
} from '@woocommerce/base-context/providers';
import { SlotFillProvider } from '@woocommerce/blocks-checkout';
import { CURRENT_USER_IS_ADMIN } from '@woocommerce/settings';
import {
	renderFrontend,
	getValidBlockAttributes,
} from '@woocommerce/base-utils';
/**
 * Internal dependencies
 */
import Block from './block.js';
import blockAttributes from './attributes';

const reloadPage = () => void window.location.reload( true );
/**
 * Wrapper component to supply API data and show empty cart view as needed.
 *
 * @param {*} props
 */
const CartFrontend = ( props ) => {
	return (
		<StoreSnackbarNoticesProvider context="wc/cart">
			<StoreNoticesProvider context="wc/cart">
				<SlotFillProvider>
					<CartProvider>
						<Block { ...props } />
					</CartProvider>
				</SlotFillProvider>
			</StoreNoticesProvider>
		</StoreSnackbarNoticesProvider>
	);
};

const getProps = ( el ) => {
	return {
		emptyCart: el.innerHTML,
		attributes: getValidBlockAttributes( blockAttributes, el.dataset ),
	};
};

const getErrorBoundaryProps = () => {
	return {
		header: __( 'Something went wrong…', 'woocommerce' ),
		text: __(
			'The cart has encountered an unexpected error. If the error persists, please get in touch with us for help.',
			'woocommerce'
		),
		showErrorMessage: CURRENT_USER_IS_ADMIN,
		button: (
			<button className="wc-block-button" onClick={ reloadPage }>
				{ __( 'Reload the page', 'woocommerce' ) }
			</button>
		),
	};
};

renderFrontend( {
	selector: '.wp-block-woocommerce-cart',
	Block: withStoreCartApiHydration( withRestApiHydration( CartFrontend ) ),
	getProps,
	getErrorBoundaryProps,
} );
woocommerce-blocks/assets/js/blocks/cart-checkout/cart/full-cart/cart-line-items-title.tsx000064400000001036151335517640025775 0ustar00/**
 * External dependencies
 */
import { _n, sprintf } from '@wordpress/i18n';
import Title from '@woocommerce/base-components/title';

const CartLineItemsTitle = ( {
	itemCount = 1,
}: {
	itemCount: number;
} ): JSX.Element => {
	return (
		<Title headingLevel="2">
			{ sprintf(
				/* translators: %d is the count of items in the cart. */
				_n(
					'Your cart (%d item)',
					'Your cart (%d items)',
					itemCount,
					'woo-gutenberg-products-block'
				),
				itemCount
			) }
		</Title>
	);
};

export default CartLineItemsTitle;
woocommerce-blocks/assets/js/blocks/cart-checkout/cart/full-cart/cart-line-item-row.tsx000064400000021447151335517640025310 0ustar00/**
 * External dependencies
 */
import classnames from 'classnames';
import { __, sprintf } from '@wordpress/i18n';
import { speak } from '@wordpress/a11y';
import QuantitySelector from '@woocommerce/base-components/quantity-selector';
import ProductPrice from '@woocommerce/base-components/product-price';
import ProductName from '@woocommerce/base-components/product-name';
import {
	useStoreCartItemQuantity,
	useStoreEvents,
	useStoreCart,
} from '@woocommerce/base-context/hooks';
import {
	ProductBackorderBadge,
	ProductImage,
	ProductLowStockBadge,
	ProductMetadata,
	ProductSaleBadge,
} from '@woocommerce/base-components/cart-checkout';
import {
	getCurrencyFromPriceResponse,
	Currency,
} from '@woocommerce/price-format';
import {
	__experimentalApplyCheckoutFilter,
	mustContain,
} from '@woocommerce/blocks-checkout';
import Dinero from 'dinero.js';
import { forwardRef, useMemo } from '@wordpress/element';
import type { CartItem } from '@woocommerce/type-defs/cart';
import { objectHasProp } from '@woocommerce/types';
import { getSetting } from '@woocommerce/settings';

/**
 * Convert a Dinero object with precision to store currency minor unit.
 *
 * @param {Dinero} priceObject Price object to convert.
 * @param {Object} currency    Currency data.
 * @return {number} Amount with new minor unit precision.
 */
const getAmountFromRawPrice = (
	priceObject: Dinero.Dinero,
	currency: Currency
) => {
	return priceObject.convertPrecision( currency.minorUnit ).getAmount();
};

const productPriceValidation = ( value ) => mustContain( value, '<price/>' );

interface CartLineItemRowProps {
	lineItem: CartItem | Record< string, never >;
	onRemove?: () => void;
	tabIndex?: number;
}

/**
 * Cart line item table row component.
 */
const CartLineItemRow = forwardRef< HTMLTableRowElement, CartLineItemRowProps >(
	(
		{ lineItem, onRemove = () => void null, tabIndex = null },
		ref
	): JSX.Element => {
		const {
			name: initialName = '',
			catalog_visibility: catalogVisibility = 'visible',
			short_description: shortDescription = '',
			description: fullDescription = '',
			low_stock_remaining: lowStockRemaining = null,
			show_backorder_badge: showBackorderBadge = false,
			quantity_limit: quantityLimit = 99,
			permalink = '',
			images = [],
			variation = [],
			item_data: itemData = [],
			prices = {
				currency_code: 'USD',
				currency_minor_unit: 2,
				currency_symbol: '$',
				currency_prefix: '$',
				currency_suffix: '',
				currency_decimal_separator: '.',
				currency_thousand_separator: ',',
				price: '0',
				regular_price: '0',
				sale_price: '0',
				price_range: null,
				raw_prices: {
					precision: 6,
					price: '0',
					regular_price: '0',
					sale_price: '0',
				},
			},
			totals = {
				currency_code: 'USD',
				currency_minor_unit: 2,
				currency_symbol: '$',
				currency_prefix: '$',
				currency_suffix: '',
				currency_decimal_separator: '.',
				currency_thousand_separator: ',',
				line_subtotal: '0',
				line_subtotal_tax: '0',
			},
			extensions,
		} = lineItem;

		const {
			quantity,
			setItemQuantity,
			removeItem,
			isPendingDelete,
		} = useStoreCartItemQuantity( lineItem );
		const { dispatchStoreEvent } = useStoreEvents();

		// Prepare props to pass to the __experimentalApplyCheckoutFilter filter.
		// We need to pluck out receiveCart.
		// eslint-disable-next-line no-unused-vars
		const { receiveCart, ...cart } = useStoreCart();
		const arg = useMemo(
			() => ( {
				context: 'cart',
				cartItem: lineItem,
				cart,
			} ),
			[ lineItem, cart ]
		);
		const priceCurrency = getCurrencyFromPriceResponse( prices );
		const name = __experimentalApplyCheckoutFilter( {
			filterName: 'itemName',
			defaultValue: initialName,
			extensions,
			arg,
		} );

		const regularAmountSingle = Dinero( {
			amount: parseInt( prices.raw_prices.regular_price, 10 ),
			precision: prices.raw_prices.precision,
		} );
		const purchaseAmountSingle = Dinero( {
			amount: parseInt( prices.raw_prices.price, 10 ),
			precision: prices.raw_prices.precision,
		} );
		const saleAmountSingle = regularAmountSingle.subtract(
			purchaseAmountSingle
		);
		const saleAmount = saleAmountSingle.multiply( quantity );
		const totalsCurrency = getCurrencyFromPriceResponse( totals );
		let lineSubtotal = parseInt( totals.line_subtotal, 10 );
		if ( getSetting( 'displayCartPricesIncludingTax', false ) ) {
			lineSubtotal += parseInt( totals.line_subtotal_tax, 10 );
		}
		const subtotalPrice = Dinero( {
			amount: lineSubtotal,
			precision: totalsCurrency.minorUnit,
		} );

		const firstImage = images.length ? images[ 0 ] : {};
		const isProductHiddenFromCatalog =
			catalogVisibility === 'hidden' || catalogVisibility === 'search';

		// Allow extensions to filter how the price is displayed. Ie: prepending or appending some values.

		const productPriceFormat = __experimentalApplyCheckoutFilter( {
			filterName: 'cartItemPrice',
			defaultValue: '<price/>',
			extensions,
			arg,
			validation: productPriceValidation,
		} );

		const subtotalPriceFormat = __experimentalApplyCheckoutFilter( {
			filterName: 'subtotalPriceFormat',
			defaultValue: '<price/>',
			extensions,
			arg,
			validation: productPriceValidation,
		} );

		const saleBadgePriceFormat = __experimentalApplyCheckoutFilter( {
			filterName: 'saleBadgePriceFormat',
			defaultValue: '<price/>',
			extensions,
			arg,
			validation: productPriceValidation,
		} );

		return (
			<tr
				className={ classnames( 'wc-block-cart-items__row', {
					'is-disabled': isPendingDelete,
				} ) }
				ref={ ref }
				tabIndex={ tabIndex }
			>
				{ /* If the image has no alt text, this link is unnecessary and can be hidden. */ }
				<td
					className="wc-block-cart-item__image"
					aria-hidden={
						! objectHasProp( firstImage, 'alt' ) || ! firstImage.alt
					}
				>
					{ /* We don't need to make it focusable, because product name has the same link. */ }
					{ isProductHiddenFromCatalog ? (
						<ProductImage image={ firstImage } />
					) : (
						<a href={ permalink } tabIndex={ -1 }>
							<ProductImage image={ firstImage } />
						</a>
					) }
				</td>
				<td className="wc-block-cart-item__product">
					<ProductName
						disabled={
							isPendingDelete || isProductHiddenFromCatalog
						}
						name={ name }
						permalink={ permalink }
					/>
					{ showBackorderBadge ? (
						<ProductBackorderBadge />
					) : (
						!! lowStockRemaining && (
							<ProductLowStockBadge
								lowStockRemaining={ lowStockRemaining }
							/>
						)
					) }

					<div className="wc-block-cart-item__prices">
						<ProductPrice
							currency={ priceCurrency }
							regularPrice={ getAmountFromRawPrice(
								regularAmountSingle,
								priceCurrency
							) }
							price={ getAmountFromRawPrice(
								purchaseAmountSingle,
								priceCurrency
							) }
							format={ subtotalPriceFormat }
						/>
					</div>

					<ProductSaleBadge
						currency={ priceCurrency }
						saleAmount={ getAmountFromRawPrice(
							saleAmountSingle,
							priceCurrency
						) }
						format={ saleBadgePriceFormat }
					/>

					<ProductMetadata
						shortDescription={ shortDescription }
						fullDescription={ fullDescription }
						itemData={ itemData }
						variation={ variation }
					/>

					<div className="wc-block-cart-item__quantity">
						<QuantitySelector
							disabled={ isPendingDelete }
							quantity={ quantity }
							maximum={ quantityLimit }
							onChange={ ( newQuantity ) => {
								setItemQuantity( newQuantity );
								dispatchStoreEvent( 'cart-set-item-quantity', {
									product: lineItem,
									quantity: newQuantity,
								} );
							} }
							itemName={ name }
						/>
						<button
							className="wc-block-cart-item__remove-link"
							onClick={ () => {
								onRemove();
								removeItem();
								dispatchStoreEvent( 'cart-remove-item', {
									product: lineItem,
									quantity,
								} );
								speak(
									sprintf(
										/* translators: %s refers to the item name in the cart. */
										__(
											'%s has been removed from your cart.',
											'woo-gutenberg-products-block'
										),
										name
									)
								);
							} }
							disabled={ isPendingDelete }
						>
							{ __(
								'Remove item',
								'woo-gutenberg-products-block'
							) }
						</button>
					</div>
				</td>
				<td className="wc-block-cart-item__total">
					<div className="wc-block-cart-item__total-price-and-sale-badge-wrapper">
						<ProductPrice
							currency={ totalsCurrency }
							format={ productPriceFormat }
							price={ subtotalPrice.getAmount() }
						/>

						{ quantity > 1 && (
							<ProductSaleBadge
								currency={ priceCurrency }
								saleAmount={ getAmountFromRawPrice(
									saleAmount,
									priceCurrency
								) }
								format={ saleBadgePriceFormat }
							/>
						) }
					</div>
				</td>
			</tr>
		);
	}
);

export default CartLineItemRow;
woocommerce-blocks/assets/js/blocks/cart-checkout/cart/full-cart/style.scss000064400000012143151335517640023157 0ustar00.wc-block-cart {
	.wc-block-components-shipping-calculator {
		white-space: nowrap;
	}

	.wc-block-components-address-form {
		.wc-block-components-text-input,
		.wc-block-components-country-input,
		.wc-block-components-state-input {
			&:first-of-type {
				margin-top: 0;
			}
		}
	}
}

table.wc-block-cart-items,
table.wc-block-cart-items th,
table.wc-block-cart-items td {
	// Override Storefront theme gray table background.
	background: none !important;
	// Remove borders on default themes.
	border: 0;
	margin: 0;
}

.editor-styles-wrapper table.wc-block-cart-items,
table.wc-block-cart-items {
	width: 100%;

	.wc-block-cart-items__header {
		@include font-size(smaller);
		text-transform: uppercase;

		.wc-block-cart-items__header-image {
			width: 100px;
		}
		.wc-block-cart-items__header-product {
			visibility: hidden;
		}
		.wc-block-cart-items__header-total {
			width: 100px;
			text-align: right;
		}
	}
	.wc-block-cart-items__row {
		.wc-block-cart-item__image img {
			width: 100%;
			margin: 0;
		}
		.wc-block-cart-item__quantity {
			.wc-block-cart-item__remove-link {
				@include link-button;
				@include font-size(smaller);

				text-transform: none;
				white-space: nowrap;
			}
		}
		.wc-block-components-product-name {
			display: block;
			max-width: max-content;
		}
		.wc-block-cart-item__total {
			@include font-size(regular);
			text-align: right;
			line-height: inherit;
		}
		.wc-block-components-product-metadata {
			margin-bottom: 0.75em;
		}

		&.is-disabled {
			opacity: 0.5;
			pointer-events: none;
			transition: opacity 200ms ease;
		}
	}
}

.wc-block-cart {
	.wc-block-components-totals-taxes,
	.wc-block-components-totals-footer-item {
		margin: 0;
	}
}

// Loading placeholder state.
.wc-block-cart--is-loading,
.wc-block-mini-cart__drawer.is-loading {
	th span,
	h2 span {
		@include placeholder();
		@include force-content();
		min-width: 84px;
		display: inline-block;
	}
	h2 span {
		min-width: 33%;
	}
	.wc-block-components-product-price,
	.wc-block-components-product-metadata,
	.wc-block-components-quantity-selector {
		@include placeholder();
	}
	.wc-block-components-product-name {
		@include placeholder();
		@include force-content();
		min-width: 84px;
		display: inline-block;
	}
	.wc-block-components-product-metadata {
		margin-top: 0.25em;
		min-width: 8em;
	}
	.wc-block-cart-item__remove-link {
		visibility: hidden;
	}
	.wc-block-cart-item__image > a {
		@include placeholder();
		display: block;
	}
	.wc-block-components-product-price {
		@include force-content();
		max-width: 3em;
		display: block;
		margin-top: 0.25em;
	}
	.wc-block-cart__sidebar .components-card {
		@include placeholder();
		@include force-content();
		min-height: 460px;
	}
}
.wc-block-components-sidebar-layout.wc-block-cart--skeleton {
	display: none;
}
.is-loading + .wc-block-components-sidebar-layout.wc-block-cart--skeleton {
	display: flex;
}

.wc-block-cart-item__total-price-and-sale-badge-wrapper {
	display: flex;
	flex-direction: column;
	align-items: flex-end;

	.wc-block-components-sale-badge {
		margin-top: $gap-smallest;
	}
}

.is-small,
.is-mobile {
	.wc-block-cart-item__total {
		.wc-block-components-sale-badge {
			display: none;
		}
	}
}

.is-medium,
.is-small,
.is-mobile {
	&.wc-block-cart {
		.wc-block-components-sidebar {
			.wc-block-cart__totals-title {
				display: none;
			}
		}
	}
	table.wc-block-cart-items {
		td {
			padding: 0;
		}
		.wc-block-cart-items__header {
			display: none;
		}
		.wc-block-cart-item__remove-link {
			display: none;
		}
		.wc-block-cart-items__row {
			@include with-translucent-border(0 0 1px);
			display: grid;
			grid-template-columns: 80px 132px;
			padding: $gap 0;

			.wc-block-cart-item__image {
				grid-column-start: 1;
				grid-row-start: 1;
				padding-right: $gap;
			}
			.wc-block-cart-item__product {
				grid-column-start: 2;
				grid-column-end: 4;
				grid-row-start: 1;
				justify-self: stretch;
				padding: 0 $gap $gap 0;
			}
			.wc-block-cart-item__quantity {
				grid-column-start: 1;
				grid-row-start: 2;
				vertical-align: bottom;
				padding-right: $gap;
				align-self: end;
				padding-top: $gap;
			}
			.wc-block-cart-item__total {
				grid-row-start: 1;

				.wc-block-components-formatted-money-amount {
					display: inline-block;
				}
			}
		}
	}
}

.is-large.wc-block-cart {
	.wc-block-cart-items {
		@include with-translucent-border(0 0 1px);

		th {
			padding: 0.25rem $gap 0.25rem 0;
			white-space: nowrap;
		}
		td {
			@include with-translucent-border(1px 0 0);
			padding: $gap 0 $gap $gap;
			vertical-align: top;
		}
		th:last-child {
			padding-right: 0;
		}
		td:last-child {
			padding-right: $gap;
		}
	}

	.wc-block-components-radio-control__input {
		left: 0;
	}

	.wc-block-cart__totals-title {
		@include text-heading();
		@include font-size(smaller);
		display: block;
		font-weight: 600;
		padding: 0.25rem 0;
		text-align: right;
		text-transform: uppercase;
	}

	.wc-block-components-sidebar {
		.wc-block-components-shipping-calculator,
		.wc-block-components-shipping-rates-control__package:not(.wc-block-components-panel) {
			padding-left: $gap;
			padding-right: $gap;
		}
	}

	.wc-block-cart__payment-options {
		padding: $gap;
	}
}
woocommerce-blocks/assets/js/blocks/cart-checkout/cart/full-cart/cart-line-items-table.tsx000064400000004746151335517640025756 0ustar00/**
 * External dependencies
 */
import { __ } from '@wordpress/i18n';
import { CartResponseItem } from '@woocommerce/type-defs/cart-response';
import { createRef, useEffect, useRef } from '@wordpress/element';
import type { RefObject } from 'react';

/**
 * Internal dependencies
 */
import CartLineItemRow from './cart-line-item-row';

const placeholderRows = [ ...Array( 3 ) ].map( ( _x, i ) => (
	<CartLineItemRow lineItem={ {} } key={ i } />
) );

interface CartLineItemsTableProps {
	lineItems: CartResponseItem[];
	isLoading: boolean;
}

const setRefs = ( lineItems: CartResponseItem[] ) => {
	const refs = {} as Record< string, RefObject< HTMLTableRowElement > >;
	lineItems.forEach( ( { key } ) => {
		refs[ key ] = createRef();
	} );
	return refs;
};

const CartLineItemsTable = ( {
	lineItems = [],
	isLoading = false,
}: CartLineItemsTableProps ): JSX.Element => {
	const tableRef = useRef< HTMLTableElement | null >( null );
	const rowRefs = useRef( setRefs( lineItems ) );
	useEffect( () => {
		rowRefs.current = setRefs( lineItems );
	}, [ lineItems ] );

	const onRemoveRow = ( nextItemKey: string | null ) => () => {
		if (
			rowRefs?.current &&
			nextItemKey &&
			rowRefs.current[ nextItemKey ].current instanceof HTMLElement
		) {
			( rowRefs.current[ nextItemKey ].current as HTMLElement ).focus();
		} else if ( tableRef.current instanceof HTMLElement ) {
			tableRef.current.focus();
		}
	};

	const products = isLoading
		? placeholderRows
		: lineItems.map( ( lineItem, i ) => {
				const nextItemKey =
					lineItems.length > i + 1 ? lineItems[ i + 1 ].key : null;
				return (
					<CartLineItemRow
						key={ lineItem.key }
						lineItem={ lineItem }
						onRemove={ onRemoveRow( nextItemKey ) }
						ref={ rowRefs.current[ lineItem.key ] }
						tabIndex={ -1 }
					/>
				);
		  } );

	return (
		<table className="wc-block-cart-items" ref={ tableRef } tabIndex={ -1 }>
			<thead>
				<tr className="wc-block-cart-items__header">
					<th className="wc-block-cart-items__header-image">
						<span>
							{ __( 'Product', 'woo-gutenberg-products-block' ) }
						</span>
					</th>
					<th className="wc-block-cart-items__header-product">
						<span>
							{ __( 'Details', 'woo-gutenberg-products-block' ) }
						</span>
					</th>
					<th className="wc-block-cart-items__header-total">
						<span>
							{ __( 'Total', 'woo-gutenberg-products-block' ) }
						</span>
					</th>
				</tr>
			</thead>
			<tbody>{ products }</tbody>
		</table>
	);
};

export default CartLineItemsTable;
woocommerce-blocks/assets/js/blocks/cart-checkout/cart/full-cart/index.tsx000064400000012242151335517640022771 0ustar00/**
 * External dependencies
 */
import { __ } from '@wordpress/i18n';
import {
	TotalsCoupon,
	TotalsDiscount,
	TotalsFooterItem,
	TotalsShipping,
} from '@woocommerce/base-components/cart-checkout';
import {
	Subtotal,
	TotalsFees,
	TotalsTaxes,
	TotalsWrapper,
	ExperimentalOrderMeta,
	ExperimentalDiscountsMeta,
} from '@woocommerce/blocks-checkout';
import { getCurrencyFromPriceResponse } from '@woocommerce/price-format';
import {
	useStoreCartCoupons,
	useStoreCart,
	useStoreNotices,
} from '@woocommerce/base-context/hooks';
import classnames from 'classnames';
import {
	Sidebar,
	SidebarLayout,
	Main,
} from '@woocommerce/base-components/sidebar-layout';
import Title from '@woocommerce/base-components/title';
import { getSetting } from '@woocommerce/settings';
import { useEffect } from '@wordpress/element';
import { decodeEntities } from '@wordpress/html-entities';

/**
 * Internal dependencies
 */
import CheckoutButton from '../checkout-button';
import CartLineItemsTitle from './cart-line-items-title';
import CartLineItemsTable from './cart-line-items-table';
import { CartExpressPayment } from '../../payment-methods';
import './style.scss';

interface CartAttributes {
	hasDarkControls: boolean;
	isShippingCalculatorEnabled: boolean;
	checkoutPageId: number;
	isPreview: boolean;
	showRateAfterTaxName: boolean;
}

interface CartProps {
	attributes: CartAttributes;
}
/**
 * Component that renders the Cart block when user has something in cart aka "full".
 *
 * @param {Object} props Incoming props for the component.
 * @param {Object} props.attributes Incoming attributes for block.
 */
const Cart = ( { attributes }: CartProps ): JSX.Element => {
	const {
		isShippingCalculatorEnabled,
		hasDarkControls,
		showRateAfterTaxName,
	} = attributes;

	const {
		cartItems,
		cartFees,
		cartTotals,
		cartIsLoading,
		cartItemsCount,
		cartItemErrors,
		cartNeedsPayment,
		cartNeedsShipping,
	} = useStoreCart();

	const {
		applyCoupon,
		removeCoupon,
		isApplyingCoupon,
		isRemovingCoupon,
		appliedCoupons,
	} = useStoreCartCoupons();

	const { addErrorNotice } = useStoreNotices();

	// Ensures any cart errors listed in the API response get shown.
	useEffect( () => {
		cartItemErrors.forEach( ( error ) => {
			addErrorNotice( decodeEntities( error.message ), {
				isDismissible: true,
				id: error.code,
			} );
		} );
	}, [ addErrorNotice, cartItemErrors ] );

	const totalsCurrency = getCurrencyFromPriceResponse( cartTotals );

	const cartClassName = classnames( 'wc-block-cart', {
		'wc-block-cart--is-loading': cartIsLoading,
		'has-dark-controls': hasDarkControls,
	} );

	// Prepare props to pass to the ExperimentalOrderMeta slot fill.
	// We need to pluck out receiveCart.
	// eslint-disable-next-line no-unused-vars
	const { extensions, receiveCart, ...cart } = useStoreCart();
	const slotFillProps = {
		extensions,
		cart,
	};

	const discountsSlotFillProps = {
		extensions,
		cart,
	};

	return (
		<>
			<CartLineItemsTitle itemCount={ cartItemsCount } />
			<SidebarLayout className={ cartClassName }>
				<Main className="wc-block-cart__main">
					<CartLineItemsTable
						lineItems={ cartItems }
						isLoading={ cartIsLoading }
					/>
				</Main>
				<Sidebar className="wc-block-cart__sidebar">
					<Title
						headingLevel="2"
						className="wc-block-cart__totals-title"
					>
						{ __( 'Cart totals', 'woo-gutenberg-products-block' ) }
					</Title>
					<TotalsWrapper>
						<Subtotal
							currency={ totalsCurrency }
							values={ cartTotals }
						/>
						<TotalsFees
							currency={ totalsCurrency }
							cartFees={ cartFees }
						/>
						<TotalsDiscount
							cartCoupons={ appliedCoupons }
							currency={ totalsCurrency }
							isRemovingCoupon={ isRemovingCoupon }
							removeCoupon={ removeCoupon }
							values={ cartTotals }
						/>
					</TotalsWrapper>
					{ getSetting( 'couponsEnabled', true ) && (
						<TotalsWrapper>
							<TotalsCoupon
								onSubmit={ applyCoupon }
								isLoading={ isApplyingCoupon }
							/>
						</TotalsWrapper>
					) }
					<ExperimentalDiscountsMeta.Slot
						{ ...discountsSlotFillProps }
					/>
					{ cartNeedsShipping && (
						<TotalsWrapper>
							<TotalsShipping
								showCalculator={ isShippingCalculatorEnabled }
								showRateSelector={ true }
								values={ cartTotals }
								currency={ totalsCurrency }
							/>
						</TotalsWrapper>
					) }
					{ ! getSetting( 'displayCartPricesIncludingTax', false ) &&
						parseInt( cartTotals.total_tax, 10 ) > 0 && (
							<TotalsWrapper>
								<TotalsTaxes
									showRateAfterTaxName={
										showRateAfterTaxName
									}
									currency={ totalsCurrency }
									values={ cartTotals }
								/>
							</TotalsWrapper>
						) }
					<TotalsWrapper>
						<TotalsFooterItem
							currency={ totalsCurrency }
							values={ cartTotals }
						/>
					</TotalsWrapper>

					<ExperimentalOrderMeta.Slot { ...slotFillProps } />

					<div className="wc-block-cart__payment-options">
						{ cartNeedsPayment && <CartExpressPayment /> }
						<CheckoutButton
							link={ getSetting(
								'page-' + attributes?.checkoutPageId,
								false
							) }
						/>
					</div>
				</Sidebar>
			</SidebarLayout>
		</>
	);
};

export default Cart;
woocommerce-blocks/assets/js/blocks/cart-checkout/cart/editor.scss000064400000000206151335517640021411 0ustar00.wc-block-cart__page-notice {
	margin: 0;
}

.wp-block-woocommerce-cart.is-editor-preview {
	max-height: 1000px;
	overflow: hidden;
}
woocommerce-blocks/assets/js/blocks/cart-checkout/cart/attributes.js000064400000001057151335517640021757 0ustar00/**
 * External dependencies
 */
import { getSetting } from '@woocommerce/settings';

const blockAttributes = {
	isPreview: {
		type: 'boolean',
		default: false,
		save: false,
	},
	isShippingCalculatorEnabled: {
		type: 'boolean',
		default: getSetting( 'isShippingCalculatorEnabled', true ),
	},
	checkoutPageId: {
		type: 'number',
		default: 0,
	},
	hasDarkControls: {
		type: 'boolean',
		default: getSetting( 'hasDarkEditorStyleSupport', false ),
	},
	showRateAfterTaxName: {
		type: 'boolean',
		default: true,
	},
};

export default blockAttributes;
woocommerce-blocks/assets/js/blocks/cart-checkout/cart/block.js000064400000004644151335517640020670 0ustar00/**
 * External dependencies
 */
import { CART_STORE_KEY as storeKey } from '@woocommerce/block-data';
import { dispatch } from '@wordpress/data';
import { useStoreCart } from '@woocommerce/base-context/hooks';
import { useEffect, RawHTML } from '@wordpress/element';
import LoadingMask from '@woocommerce/base-components/loading-mask';
import { ValidationContextProvider } from '@woocommerce/base-context';
import {
	dispatchEvent,
	translateJQueryEventToNative,
} from '@woocommerce/base-utils';
import withScrollToTop from '@woocommerce/base-hocs/with-scroll-to-top';

/**
 * Internal dependencies
 */
import FullCart from './full-cart';

const EmptyCart = ( { content } ) => {
	useEffect( () => {
		dispatchEvent( 'wc-blocks_render_blocks_frontend', {
			element: document.body.querySelector(
				'.wp-block-woocommerce-cart'
			),
		} );
	}, [] );
	return <RawHTML>{ content }</RawHTML>;
};

const Block = ( { emptyCart, attributes, scrollToTop } ) => {
	const { cartItems, cartIsLoading } = useStoreCart();

	useEffect( () => {
		const invalidateCartData = ( e ) => {
			const eventDetail = e.detail;
			if ( ! eventDetail || ! eventDetail.preserveCartData ) {
				dispatch( storeKey ).invalidateResolutionForStore();
			}
			scrollToTop();
		};

		// Make it so we can read jQuery events triggered by WC Core elements.
		const removeJQueryAddedToCartEvent = translateJQueryEventToNative(
			'added_to_cart',
			'wc-blocks_added_to_cart'
		);
		const removeJQueryRemovedFromCartEvent = translateJQueryEventToNative(
			'removed_from_cart',
			'wc-blocks_removed_from_cart'
		);

		document.body.addEventListener(
			'wc-blocks_added_to_cart',
			invalidateCartData
		);
		document.body.addEventListener(
			'wc-blocks_removed_from_cart',
			invalidateCartData
		);

		return () => {
			removeJQueryAddedToCartEvent();
			removeJQueryRemovedFromCartEvent();

			document.body.removeEventListener(
				'wc-blocks_added_to_cart',
				invalidateCartData
			);
			document.body.removeEventListener(
				'wc-blocks_removed_from_cart',
				invalidateCartData
			);
		};
	}, [ scrollToTop ] );

	return (
		<>
			{ ! cartIsLoading && cartItems.length === 0 ? (
				<EmptyCart content={ emptyCart } />
			) : (
				<LoadingMask showSpinner={ true } isLoading={ cartIsLoading }>
					<ValidationContextProvider>
						<FullCart attributes={ attributes } />
					</ValidationContextProvider>
				</LoadingMask>
			) }
		</>
	);
};

export default withScrollToTop( Block );
woocommerce-blocks/assets/js/blocks/cart-checkout/cart/empty-cart-edit/style.scss000064400000000165151335517640024277 0ustar00.wc-block-cart__empty-cart__title,
.editor-styles-wrapper .wc-block-cart__empty-cart__title {
	font-size: inherit;
}
woocommerce-blocks/assets/js/blocks/cart-checkout/cart/empty-cart-edit/icon-data-uri.js000064400000002731151335517640025235 0ustar00export default 'data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzgiIGhlaWdodD0iMzgiIHZpZXdCb3g9IjAgMCAzOCAzOCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTE5IDBDOC41MDQwMyAwIDAgOC41MDQwMyAwIDE5QzAgMjkuNDk2IDguNTA0MDMgMzggMTkgMzhDMjkuNDk2IDM4IDM4IDI5LjQ5NiAzOCAxOUMzOCA4LjUwNDAzIDI5LjQ5NiAwIDE5IDBaTTI1LjEyOSAxMi44NzFDMjYuNDg1MSAxMi44NzEgMjcuNTgwNiAxMy45NjY1IDI3LjU4MDYgMTUuMzIyNkMyNy41ODA2IDE2LjY3ODYgMjYuNDg1MSAxNy43NzQyIDI1LjEyOSAxNy43NzQyQzIzLjc3MyAxNy43NzQyIDIyLjY3NzQgMTYuNjc4NiAyMi42Nzc0IDE1LjMyMjZDMjIuNjc3NCAxMy45NjY1IDIzLjc3MyAxMi44NzEgMjUuMTI5IDEyLjg3MVpNMTEuNjQ1MiAzMS4yNTgxQzkuNjE0OTIgMzEuMjU4MSA3Ljk2Nzc0IDI5LjY0OTIgNy45Njc3NCAyNy42NTczQzcuOTY3NzQgMjYuMTI1IDEwLjE1MTIgMjMuMDI5OCAxMS4xNTQ4IDIxLjY5NjhDMTEuNCAyMS4zNjczIDExLjg5MDMgMjEuMzY3MyAxMi4xMzU1IDIxLjY5NjhDMTMuMTM5MSAyMy4wMjk4IDE1LjMyMjYgMjYuMTI1IDE1LjMyMjYgMjcuNjU3M0MxNS4zMjI2IDI5LjY0OTIgMTMuNjc1NCAzMS4yNTgxIDExLjY0NTIgMzEuMjU4MVpNMTIuODcxIDE3Ljc3NDJDMTEuNTE0OSAxNy43NzQyIDEwLjQxOTQgMTYuNjc4NiAxMC40MTk0IDE1LjMyMjZDMTAuNDE5NCAxMy45NjY1IDExLjUxNDkgMTIuODcxIDEyLjg3MSAxMi44NzFDMTQuMjI3IDEyLjg3MSAxNS4zMjI2IDEzLjk2NjUgMTUuMzIyNiAxNS4zMjI2QzE1LjMyMjYgMTYuNjc4NiAxNC4yMjcgMTcuNzc0MiAxMi44NzEgMTcuNzc0MlpNMjUuOTEwNSAyOS41ODc5QzI0LjE5NDQgMjcuNTM0NyAyMS42NzM4IDI2LjM1NDggMTkgMjYuMzU0OEMxNy4zNzU4IDI2LjM1NDggMTcuMzc1OCAyMy45MDMyIDE5IDIzLjkwMzJDMjIuNDAxNiAyMy45MDMyIDI1LjYxMTcgMjUuNDA0OCAyNy43ODc1IDI4LjAyNUMyOC44NDQ4IDI5LjI4MTUgMjYuOTI5NCAzMC44MjE0IDI1LjkxMDUgMjkuNTg3OVoiIGZpbGw9ImJsYWNrIi8+Cjwvc3ZnPgo=';
woocommerce-blocks/assets/js/blocks/cart-checkout/cart/empty-cart-edit/index.js000064400000003370151335517640023710 0ustar00/**
 * External dependencies
 */
import { __, sprintf } from '@wordpress/i18n';
import { InnerBlocks } from '@wordpress/block-editor';
import { SHOP_URL } from '@woocommerce/block-settings';
import PropTypes from 'prop-types';

/**
 * Internal dependencies
 */
import iconDataUri from './icon-data-uri.js';
import './style.scss';

const templateItemBrowseStore = SHOP_URL
	? [
			'core/paragraph',
			{
				align: 'center',
				content: sprintf(
					/* translators: %s is the link to the store product directory. */
					__(
						'<a href="%s">Browse store</a>.',
						'woocommerce'
					),
					SHOP_URL
				),
				dropCap: false,
			},
	  ]
	: null;

const templateItems = [
	[
		'core/image',
		{
			align: 'center',
			url: iconDataUri,
			sizeSlug: 'small',
		},
	],
	[
		'core/heading',
		{
			textAlign: 'center',
			content: __(
				'Your cart is currently empty!',
				'woocommerce'
			),
			level: 2,
			className: 'wc-block-cart__empty-cart__title',
		},
	],
	templateItemBrowseStore,
	[
		'core/separator',
		{
			className: 'is-style-dots',
		},
	],
	[
		'core/heading',
		{
			textAlign: 'center',
			content: __( 'New in store', 'woocommerce' ),
			level: 2,
		},
	],
	[
		'woocommerce/product-new',
		{
			columns: 3,
			rows: 1,
		},
	],
].filter( Boolean );

/**
 * Component to handle edit mode for the Cart block when cart is empty.
 *
 * @param {Object} props Incoming props for the component.
 * @param {boolean} props.hidden Whether this component is hidden or not.
 */
const EmptyCartEdit = ( { hidden = false } ) => {
	return (
		<div hidden={ hidden }>
			<InnerBlocks
				templateInsertUpdatesSelection={ false }
				template={ templateItems }
			/>
		</div>
	);
};

EmptyCartEdit.propTypes = {
	hidden: PropTypes.bool,
};

export default EmptyCartEdit;
woocommerce-blocks/assets/js/blocks/cart-checkout/cart/edit.js000064400000014604151335517640020520 0ustar00/**
 * External dependencies
 */
import classnames from 'classnames';
import { __ } from '@wordpress/i18n';
import { CartCheckoutFeedbackPrompt } from '@woocommerce/editor-components/feedback-prompt';
import { InspectorControls } from '@wordpress/block-editor';
import {
	Disabled,
	PanelBody,
	ToggleControl,
	Notice,
} from '@wordpress/components';
import PropTypes from 'prop-types';
import { CartCheckoutCompatibilityNotice } from '@woocommerce/editor-components/compatibility-notices';
import ViewSwitcher from '@woocommerce/editor-components/view-switcher';
import PageSelector from '@woocommerce/editor-components/page-selector';
import { CART_PAGE_ID } from '@woocommerce/block-settings';
import BlockErrorBoundary from '@woocommerce/base-components/block-error-boundary';
import {
	EditorProvider,
	useEditorContext,
	CartProvider,
} from '@woocommerce/base-context';
import { createInterpolateElement, useRef } from '@wordpress/element';
import { getAdminLink, getSetting } from '@woocommerce/settings';
import { previewCart } from '@woocommerce/resource-previews';

/**
 * Internal dependencies
 */
import Block from './block.js';
import EmptyCartEdit from './empty-cart-edit';
import './editor.scss';

const BlockSettings = ( { attributes, setAttributes } ) => {
	const {
		isShippingCalculatorEnabled,
		checkoutPageId,
		hasDarkControls,
		showRateAfterTaxName,
	} = attributes;
	const { currentPostId } = useEditorContext();
	const { current: savedCheckoutPageId } = useRef( checkoutPageId );
	return (
		<InspectorControls>
			{ currentPostId !== CART_PAGE_ID && (
				<Notice
					className="wc-block-cart__page-notice"
					isDismissible={ false }
					status="warning"
				>
					{ createInterpolateElement(
						__(
							'If you would like to use this block as your default cart you must update your <a>page settings in WooCommerce</a>.',
							'woocommerce'
						),
						{
							a: (
								// eslint-disable-next-line jsx-a11y/anchor-has-content
								<a
									href={ getAdminLink(
										'admin.php?page=wc-settings&tab=advanced'
									) }
									target="_blank"
									rel="noopener noreferrer"
								/>
							),
						}
					) }
				</Notice>
			) }
			{ getSetting( 'shippingEnabled', true ) && (
				<PanelBody
					title={ __(
						'Shipping rates',
						'woocommerce'
					) }
				>
					<ToggleControl
						label={ __(
							'Shipping calculator',
							'woocommerce'
						) }
						help={ __(
							'Allow customers to estimate shipping by entering their address.',
							'woocommerce'
						) }
						checked={ isShippingCalculatorEnabled }
						onChange={ () =>
							setAttributes( {
								isShippingCalculatorEnabled: ! isShippingCalculatorEnabled,
							} )
						}
					/>
				</PanelBody>
			) }
			{ getSetting( 'taxesEnabled' ) &&
				getSetting( 'displayItemizedTaxes', false ) &&
				! getSetting( 'displayCartPricesIncludingTax', false ) && (
					<PanelBody
						title={ __( 'Taxes', 'woocommerce' ) }
					>
						<ToggleControl
							label={ __(
								'Show rate after tax name',
								'woocommerce'
							) }
							help={ __(
								'Show the percentage rate alongside each tax line in the summary.',
								'woocommerce'
							) }
							checked={ showRateAfterTaxName }
							onChange={ () =>
								setAttributes( {
									showRateAfterTaxName: ! showRateAfterTaxName,
								} )
							}
						/>
					</PanelBody>
				) }
			{ ! (
				currentPostId === CART_PAGE_ID && savedCheckoutPageId === 0
			) && (
				<PageSelector
					pageId={ checkoutPageId }
					setPageId={ ( id ) =>
						setAttributes( { checkoutPageId: id } )
					}
					labels={ {
						title: __(
							'Proceed to Checkout button',
							'woocommerce'
						),
						default: __(
							'WooCommerce Checkout Page',
							'woocommerce'
						),
					} }
				/>
			) }
			<PanelBody title={ __( 'Style', 'woocommerce' ) }>
				<ToggleControl
					label={ __(
						'Dark mode inputs',
						'woocommerce'
					) }
					help={ __(
						'Inputs styled specifically for use on dark background colors.',
						'woocommerce'
					) }
					checked={ hasDarkControls }
					onChange={ () =>
						setAttributes( {
							hasDarkControls: ! hasDarkControls,
						} )
					}
				/>
			</PanelBody>
			<CartCheckoutFeedbackPrompt />
		</InspectorControls>
	);
};

/**
 * Component to handle edit mode of "Cart Block".
 *
 * Note: We need to always render `<InnerBlocks>` in the editor. Otherwise,
 *       if the user saves the page without having triggered the 'Empty Cart'
 *       view, inner blocks would not be saved and they wouldn't be visible
 *       in the frontend.
 *
 * @param {Object} props Incoming props for the component.
 * @param {string} props.className CSS class used.
 * @param {Object} props.attributes Attributes available.
 * @param {function(any):any} props.setAttributes Setter for attributes.
 */
const CartEditor = ( { className, attributes, setAttributes } ) => {
	return (
		<div
			className={ classnames( className, 'wp-block-woocommerce-cart', {
				'is-editor-preview': attributes.isPreview,
			} ) }
		>
			<ViewSwitcher
				label={ __( 'Edit', 'woocommerce' ) }
				views={ [
					{
						value: 'full',
						name: __( 'Full Cart', 'woocommerce' ),
					},
					{
						value: 'empty',
						name: __(
							'Empty Cart',
							'woocommerce'
						),
					},
				] }
				defaultView={ 'full' }
				render={ ( currentView ) => (
					<BlockErrorBoundary
						header={ __(
							'Cart Block Error',
							'woocommerce'
						) }
						text={ __(
							'There was an error whilst rendering the cart block. If this problem continues, try re-creating the block.',
							'woocommerce'
						) }
						showErrorMessage={ true }
						errorMessagePrefix={ __(
							'Error message:',
							'woocommerce'
						) }
					>
						{ currentView === 'full' && (
							<>
								<EditorProvider previewData={ { previewCart } }>
									<BlockSettings
										attributes={ attributes }
										setAttributes={ setAttributes }
									/>
									<Disabled>
										<CartProvider>
											<Block attributes={ attributes } />
										</CartProvider>
									</Disabled>
								</EditorProvider>
								<EmptyCartEdit hidden={ true } />
							</>
						) }
						{ currentView === 'empty' && <EmptyCartEdit /> }
					</BlockErrorBoundary>
				) }
			/>
			<CartCheckoutCompatibilityNotice blockName="cart" />
		</div>
	);
};

CartEditor.propTypes = {
	className: PropTypes.string,
};

export default CartEditor;
woocommerce-blocks/assets/js/blocks/cart-checkout/mini-cart/block.tsx000064400000010574151335517640022023 0ustar00/**
 * External dependencies
 */
import classNames from 'classnames';
import { __, _n, sprintf } from '@wordpress/i18n';
import { useState, useEffect, useRef } from '@wordpress/element';
import { dispatch } from '@wordpress/data';
import { translateJQueryEventToNative } from '@woocommerce/base-utils';
import { useStoreCart } from '@woocommerce/base-context/hooks';
import Drawer from '@woocommerce/base-components/drawer';
import { CART_STORE_KEY as storeKey } from '@woocommerce/block-data';
import {
	formatPrice,
	getCurrencyFromPriceResponse,
} from '@woocommerce/price-format';
import { getSetting } from '@woocommerce/settings';

/**
 * Internal dependencies
 */
import CartLineItemsTable from '../cart/full-cart/cart-line-items-table';
import './style.scss';

interface MiniCartBlockProps {
	isPlaceholderOpen?: boolean;
}

const MiniCartBlock = ( {
	isPlaceholderOpen = false,
}: MiniCartBlockProps ): JSX.Element => {
	const {
		cartItems,
		cartItemsCount,
		cartIsLoading,
		cartTotals,
	} = useStoreCart();
	const [ isOpen, setIsOpen ] = useState< boolean >( isPlaceholderOpen );
	const emptyCartRef = useRef< HTMLDivElement | null >( null );
	// We already rendered the HTML drawer placeholder, so we want to skip the
	// slide in animation.
	const [ skipSlideIn, setSkipSlideIn ] = useState< boolean >(
		isPlaceholderOpen
	);

	useEffect( () => {
		const openMiniCartAndRefreshData = ( e ) => {
			const eventDetail = e.detail;
			if ( ! eventDetail || ! eventDetail.preserveCartData ) {
				dispatch( storeKey ).invalidateResolutionForStore();
			}
			setSkipSlideIn( false );
			setIsOpen( true );
		};

		// Make it so we can read jQuery events triggered by WC Core elements.
		const removeJQueryAddedToCartEvent = translateJQueryEventToNative(
			'added_to_cart',
			'wc-blocks_added_to_cart'
		);

		document.body.addEventListener(
			'wc-blocks_added_to_cart',
			openMiniCartAndRefreshData
		);

		return () => {
			removeJQueryAddedToCartEvent();

			document.body.removeEventListener(
				'wc-blocks_added_to_cart',
				openMiniCartAndRefreshData
			);
		};
	}, [] );

	useEffect( () => {
		// If the cart has been completely emptied, move focus to empty cart
		// element.
		if ( isOpen && ! cartIsLoading && cartItems.length === 0 ) {
			if ( emptyCartRef.current instanceof HTMLElement ) {
				emptyCartRef.current.focus();
			}
		}
	}, [ isOpen, cartIsLoading, cartItems.length, emptyCartRef ] );

	const subTotal = getSetting( 'displayCartPricesIncludingTax', false )
		? parseInt( cartTotals.total_items, 10 ) +
		  parseInt( cartTotals.total_items_tax, 10 )
		: cartTotals.total_items;

	const ariaLabel = sprintf(
		/* translators: %1$d is the number of products in the cart. %2$s is the cart total */
		_n(
			'%1$d item in cart, total price of %2$s',
			'%1$d items in cart, total price of %2$s',
			cartItemsCount,
			'woo-gutenberg-products-block'
		),
		cartItemsCount,
		formatPrice( subTotal, getCurrencyFromPriceResponse( cartTotals ) )
	);

	const contents =
		! cartIsLoading && cartItems.length === 0 ? (
			<div
				className="wc-block-mini-cart__empty-cart"
				tabIndex={ -1 }
				ref={ emptyCartRef }
			>
				{ __( 'Cart is empty', 'woo-gutenberg-products-block' ) }
			</div>
		) : (
			<CartLineItemsTable
				lineItems={ cartItems }
				isLoading={ cartIsLoading }
			/>
		);

	return (
		<>
			<button
				className="wc-block-mini-cart__button"
				onClick={ () => {
					if ( ! isOpen ) {
						setIsOpen( true );
						setSkipSlideIn( false );
					}
				} }
				aria-label={ ariaLabel }
			>
				{ sprintf(
					/* translators: %d is the count of items in the cart. */
					_n(
						'%d item',
						'%d items',
						cartItemsCount,
						'woo-gutenberg-products-block'
					),
					cartItemsCount
				) }
			</button>
			<Drawer
				className={ classNames(
					'wc-block-mini-cart__drawer',
					'is-mobile',
					{
						'is-loading': cartIsLoading,
					}
				) }
				title={
					cartIsLoading
						? __( 'Your cart', 'woo-gutenberg-products-block' )
						: sprintf(
								/* translators: %d is the count of items in the cart. */
								_n(
									'Your cart (%d item)',
									'Your cart (%d items)',
									cartItemsCount,
									'woo-gutenberg-products-block'
								),
								cartItemsCount
						  )
				}
				isOpen={ isOpen }
				onClose={ () => {
					setIsOpen( false );
				} }
				slideIn={ ! skipSlideIn }
			>
				{ contents }
			</Drawer>
		</>
	);
};

export default MiniCartBlock;
woocommerce-blocks/assets/js/blocks/cart-checkout/mini-cart/style.scss000064400000000265151335517640022222 0ustar00.modal-open .wc-block-mini-cart__button {
	pointer-events: none;
}

// Reset font size so it doesn't depend on drawer's ancestors.
.wc-block-mini-cart__drawer {
	font-size: 1rem;
}
woocommerce-blocks/assets/js/blocks/cart-checkout/mini-cart/with-mini-cart-conditional-hydration.tsx000064400000001656151335517640030066 0ustar00/**
 * External dependencies
 */
import {
	withStoreCartApiHydration,
	withRestApiHydration,
} from '@woocommerce/block-hocs';

interface MiniCartBlockInterface {
	// Signals whether the cart data is outdated. That happens when
	// opening the mini cart after adding a product to the cart.
	isDataOutdated?: boolean;
	// Signals that the HTML placeholder drawer has been opened. Needed
	// to know whether we have to skip the slide in animation.
	isPlaceholderOpen?: boolean;
}

// Custom HOC to conditionally hydrate API data depending on the isDataOutdated
// prop.
export default (
	OriginalComponent: ( component: MiniCartBlockInterface ) => JSX.Element
) => {
	return ( {
		isDataOutdated,
		...props
	}: MiniCartBlockInterface ): JSX.Element => {
		const Component = isDataOutdated
			? OriginalComponent
			: withStoreCartApiHydration(
					withRestApiHydration( OriginalComponent )
			  );
		return <Component { ...props } />;
	};
};
woocommerce-blocks/assets/js/blocks/cart-checkout/mini-cart/edit.tsx000064400000001273151335517640021652 0ustar00/**
 * External dependencies
 */
import { _n, sprintf } from '@wordpress/i18n';
import { useBlockProps } from '@wordpress/block-editor';
import type { ReactElement } from 'react';

const MiniCartBlock = (): ReactElement => {
	const blockProps = useBlockProps( {
		className: 'wc-block-mini-cart',
	} );

	const productCount = 0;

	return (
		<div { ...blockProps }>
			<button className="wc-block-mini-cart__button">
				{ sprintf(
					/* translators: %d is the number of products in the cart. */
					_n(
						'%d product',
						'%d products',
						productCount,
						'woo-gutenberg-products-block'
					),
					productCount
				) }
			</button>
		</div>
	);
};

export default MiniCartBlock;
woocommerce-blocks/assets/js/blocks/cart-checkout/mini-cart/component-frontend.tsx000064400000002731151335517640024544 0ustar00/**
 * External dependencies
 */
import { renderFrontend } from '@woocommerce/base-utils';

/**
 * Internal dependencies
 */
import withMiniCartConditionalHydration from './with-mini-cart-conditional-hydration';
import MiniCartBlock from './block';
import './style.scss';

const renderMiniCartFrontend = () => {
	// Check if button is focused. In that case, we want to refocus it after we
	// replace it with the React equivalent.
	let focusedMiniCartBlock: HTMLElement | null = null;
	/* eslint-disable @wordpress/no-global-active-element */
	if (
		document.activeElement &&
		document.activeElement.classList.contains(
			'wc-block-mini-cart__button'
		) &&
		document.activeElement.parentNode instanceof HTMLElement
	) {
		focusedMiniCartBlock = document.activeElement.parentNode;
	}
	/* eslint-enable @wordpress/no-global-active-element */

	renderFrontend( {
		selector: '.wc-block-mini-cart',
		Block: withMiniCartConditionalHydration( MiniCartBlock ),
		getProps: ( el: HTMLElement ) => ( {
			isDataOutdated: el.dataset.isDataOutdated,
			isPlaceholderOpen: el.dataset.isPlaceholderOpen === 'true',
		} ),
	} );

	// Refocus previously focused button if drawer is not open.
	if (
		focusedMiniCartBlock instanceof HTMLElement &&
		! focusedMiniCartBlock.dataset.isPlaceholderOpen
	) {
		const innerButton = focusedMiniCartBlock.querySelector(
			'.wc-block-mini-cart__button'
		);
		if ( innerButton instanceof HTMLElement ) {
			innerButton.focus();
		}
	}
};

renderMiniCartFrontend();
woocommerce-blocks/assets/js/blocks/cart-checkout/mini-cart/frontend.ts000064400000006750151335517640022361 0ustar00/**
 * External dependencies
 */
import { getSetting } from '@woocommerce/settings';
import preloadScript from '@woocommerce/base-utils/preload-script';
import lazyLoadScript from '@woocommerce/base-utils/lazy-load-script';
import { translateJQueryEventToNative } from '@woocommerce/base-utils/legacy-events';

interface dependencyData {
	src: string;
	version?: string;
	after?: string;
	before?: string;
	translations?: string;
}

// eslint-disable-next-line @wordpress/no-global-event-listener
window.onload = () => {
	const miniCartBlocks = document.querySelectorAll( '.wc-block-mini-cart' );
	let wasLoadScriptsCalled = false;

	if ( miniCartBlocks.length === 0 ) {
		return;
	}

	const dependencies = getSetting(
		'mini_cart_block_frontend_dependencies',
		{}
	) as Record< string, dependencyData >;

	// Preload scripts
	for ( const dependencyHandle in dependencies ) {
		const dependency = dependencies[ dependencyHandle ];
		preloadScript( {
			handle: dependencyHandle,
			...dependency,
		} );
	}

	// Make it so we can read jQuery events triggered by WC Core elements.
	const removeJQueryAddingToCartEvent = translateJQueryEventToNative(
		'adding_to_cart',
		'wc-blocks_adding_to_cart'
	);
	const removeJQueryAddedToCartEvent = translateJQueryEventToNative(
		'added_to_cart',
		'wc-blocks_added_to_cart'
	);

	const loadScripts = async () => {
		// Ensure we only call loadScripts once.
		if ( wasLoadScriptsCalled ) {
			return;
		}
		wasLoadScriptsCalled = true;

		// Remove adding to cart event handler.
		document.body.removeEventListener(
			'wc-blocks_adding_to_cart',
			loadScripts
		);
		removeJQueryAddingToCartEvent();

		// Lazy load scripts.
		for ( const dependencyHandle in dependencies ) {
			const dependency = dependencies[ dependencyHandle ];
			await lazyLoadScript( {
				handle: dependencyHandle,
				...dependency,
			} );
		}
	};

	document.body.addEventListener( 'wc-blocks_adding_to_cart', loadScripts );

	miniCartBlocks.forEach( ( miniCartBlock, i ) => {
		if ( ! ( miniCartBlock instanceof HTMLElement ) ) {
			return;
		}

		const miniCartButton = miniCartBlock.querySelector(
			'.wc-block-mini-cart__button'
		);
		const miniCartDrawerPlaceholderOverlay = miniCartBlock.querySelector(
			'.wc-block-components-drawer__screen-overlay'
		);

		if ( ! miniCartButton || ! miniCartDrawerPlaceholderOverlay ) {
			// Markup is not correct, abort.
			return;
		}

		const showContents = () => {
			if ( ! wasLoadScriptsCalled ) {
				loadScripts();
			}
			document.body.removeEventListener(
				'wc-blocks_added_to_cart',
				// eslint-disable-next-line @typescript-eslint/no-use-before-define
				showContentsAndUpdate
			);
			miniCartBlock.dataset.isPlaceholderOpen = 'true';
			miniCartDrawerPlaceholderOverlay.classList.add(
				'wc-block-components-drawer__screen-overlay--with-slide-in'
			);
			miniCartDrawerPlaceholderOverlay.classList.remove(
				'wc-block-components-drawer__screen-overlay--is-hidden'
			);
			removeJQueryAddedToCartEvent();
		};

		const showContentsAndUpdate = () => {
			miniCartBlock.dataset.isDataOutdated = 'true';
			showContents();
		};

		miniCartButton.addEventListener( 'mouseover', loadScripts );
		miniCartButton.addEventListener( 'focus', loadScripts );
		miniCartButton.addEventListener( 'click', showContents );

		// There might be more than one Mini Cart block in the page. Make sure
		// only one opens when adding a product to the cart.
		if ( i === 0 ) {
			document.body.addEventListener(
				'wc-blocks_added_to_cart',
				showContentsAndUpdate
			);
		}
	} );
};
woocommerce-blocks/assets/js/blocks/cart-checkout/mini-cart/index.tsx000064400000001632151335517640022033 0ustar00/**
 * External dependencies
 */
import { __ } from '@wordpress/i18n';
import { Icon, cart } from '@woocommerce/icons';
import { registerExperimentalBlockType } from '@woocommerce/block-settings';

/**
 * Internal dependencies
 */
import edit from './edit';

const settings = {
	apiVersion: 2,
	title: __( 'Mini Cart', 'woo-gutenberg-products-block' ),
	icon: {
		src: <Icon srcElement={ cart } />,
		foreground: '#96588a',
	},
	category: 'woocommerce',
	keywords: [ __( 'WooCommerce', 'woo-gutenberg-products-block' ) ],
	description: __(
		'Display a mini cart widget.',
		'woo-gutenberg-products-block'
	),
	supports: {
		html: false,
		multiple: false,
	},
	example: {
		attributes: {
			isPreview: true,
		},
	},
	attributes: {
		isPreview: {
			type: 'boolean',
			default: false,
			save: false,
		},
	},

	edit,

	save() {
		return null;
	},
};

registerExperimentalBlockType( 'woocommerce/mini-cart', settings );
woocommerce-blocks/assets/js/blocks/cart-checkout/checkout/columns/index.ts000064400000000041151335517640023236 0ustar00export * from './columns-block';
woocommerce-blocks/assets/js/blocks/cart-checkout/checkout/columns/columns-block.tsx000064400000000446151335517640025100 0ustar00/**
 * External dependencies
 */
import { useBlockProps } from '@wordpress/block-editor';

export const Columns = ( {
	children,
	...props
}: {
	children?: React.ReactNode;
} ): JSX.Element => {
	const blockProps = useBlockProps( props );

	return <div { ...blockProps }>{ children }</div>;
};
woocommerce-blocks/assets/js/blocks/cart-checkout/checkout/context.ts000064400000002265151335517640022145 0ustar00/**
 * External dependencies
 */
import { createContext, useContext } from '@wordpress/element';

/**
 * Context consumed by inner blocks.
 */
export type CheckoutBlockContextProps = {
	allowCreateAccount: boolean;
	showCompanyField: boolean;
	showApartmentField: boolean;
	showPhoneField: boolean;
	requireCompanyField: boolean;
	requirePhoneField: boolean;
};

export type CheckoutBlockControlsContextProps = {
	addressFieldControls: () => JSX.Element | null;
	accountControls: () => JSX.Element | null;
};

export const CheckoutBlockContext = createContext< CheckoutBlockContextProps >(
	{
		allowCreateAccount: false,
		showCompanyField: false,
		showApartmentField: false,
		showPhoneField: false,
		requireCompanyField: false,
		requirePhoneField: false,
	}
);

export const CheckoutBlockControlsContext = createContext<
	CheckoutBlockControlsContextProps
>( {
	addressFieldControls: () => null,
	accountControls: () => null,
} );

export const useCheckoutBlockContext = (): CheckoutBlockContextProps => {
	return useContext( CheckoutBlockContext );
};

export const useCheckoutBlockControlsContext = (): CheckoutBlockControlsContextProps => {
	return useContext( CheckoutBlockControlsContext );
};
woocommerce-blocks/assets/js/blocks/cart-checkout/checkout/use-forced-layout.ts000064400000003064151335517640024026 0ustar00/**
 * External dependencies
 */
import { useLayoutEffect, useRef } from '@wordpress/element';
import { useSelect, useDispatch } from '@wordpress/data';
import {
	createBlock,
	getBlockType,
	Block,
	AttributeSource,
} from '@wordpress/blocks';

const isBlockLocked = ( {
	attributes,
}: {
	attributes: Record< string, AttributeSource.Attribute >;
} ) => Boolean( attributes.lock?.remove || attributes.lock?.default?.remove );

export const useForcedLayout = ( {
	clientId,
	template,
}: {
	clientId: string;
	template: Array< string >;
} ): void => {
	const currentTemplate = useRef( template );
	const { insertBlock } = useDispatch( 'core/block-editor' );
	const { innerBlocks, templateTypes } = useSelect(
		( select ) => {
			return {
				innerBlocks: select( 'core/block-editor' ).getBlocks(
					clientId
				),
				templateTypes: currentTemplate.current.map( ( blockName ) =>
					getBlockType( blockName )
				),
			};
		},
		[ clientId, currentTemplate ]
	);
	/**
	 * If the current inner blocks differ from the registered blocks, push the differences.
	 *
	 */
	useLayoutEffect( () => {
		if ( ! clientId ) {
			return;
		}
		// Missing check to see if registered block is 'forced'
		templateTypes.forEach( ( block: Block | undefined ) => {
			if (
				block &&
				isBlockLocked( block ) &&
				! innerBlocks.find(
					( { name }: { name: string } ) => name === block.name
				)
			) {
				const newBlock = createBlock( block.name );
				insertBlock( newBlock, innerBlocks.length, clientId, false );
			}
		} );
	}, [ clientId, innerBlocks, insertBlock, templateTypes ] );
};
woocommerce-blocks/assets/js/blocks/cart-checkout/checkout/hacks.ts000064400000011345151335517640021551 0ustar00/**
 * HACKS
 *
 * This file contains functionality to "lock" blocks i.e. to prevent blocks being moved or deleted. This needs to be
 * kept in place until native support for locking is available in WordPress (estimated WordPress 5.9).
 */

/**
 * @todo Remove custom block locking (requires native WordPress support)
 */

/**
 * External dependencies
 */
import {
	useBlockProps,
	store as blockEditorStore,
} from '@wordpress/block-editor';
import { isTextField } from '@wordpress/dom';
import { subscribe, select as _select } from '@wordpress/data';
import { useEffect, useRef } from '@wordpress/element';
import { MutableRefObject } from 'react';
import { BACKSPACE, DELETE } from '@wordpress/keycodes';
import { hasFilter } from '@wordpress/hooks';
import { getBlockType } from '@wordpress/blocks';
/**
 * Toggle class on body.
 *
 * @param {string} className CSS Class name.
 * @param {boolean} add True to add, false to remove.
 */
const toggleBodyClass = ( className: string, add = true ) => {
	if ( add ) {
		window.document.body.classList.add( className );
	} else {
		window.document.body.classList.remove( className );
	}
};

/**
 * addClassToBody
 *
 * This components watches the current selected block and adds a class name to the body if that block is locked. If the
 * current block is not locked, it removes the class name. The appended body class is used to hide UI elements to prevent
 * the block from being deleted.
 *
 * We use a component so we can react to changes in the store.
 */
export const addClassToBody = (): void => {
	if ( ! hasFilter( 'blocks.registerBlockType', 'core/lock/addAttribute' ) ) {
		subscribe( () => {
			const blockEditorSelect = _select( blockEditorStore );

			if ( ! blockEditorSelect ) {
				return;
			}

			const selectedBlock = blockEditorSelect.getSelectedBlock();

			if ( ! selectedBlock ) {
				return;
			}

			toggleBodyClass(
				'wc-lock-selected-block--remove',
				!! selectedBlock?.attributes?.lock?.remove
			);

			toggleBodyClass(
				'wc-lock-selected-block--move',
				!! selectedBlock?.attributes?.lock?.move
			);
		} );
	}
};

const isBlockLocked = ( clientId: string ): boolean => {
	if ( ! clientId ) {
		return false;
	}
	const { getBlock } = _select( blockEditorStore );
	const block = getBlock( clientId );
	// If lock.remove is defined at the block instance (not using the default value)
	// Then we use it.
	if ( typeof block?.attributes?.lock?.remove === 'boolean' ) {
		return block.attributes.lock.remove;
	}

	// If we don't have lock on the block instance, we check the type
	const blockType = getBlockType( block.name );
	if ( typeof blockType?.attributes?.lock?.default?.remove === 'boolean' ) {
		return blockType?.attributes?.lock?.default?.remove;
	}
	// If nothing is defined, return false
	return false;
};

/**
 * This is a hook we use in conjunction with useBlockProps. Its goal is to check if of the block's children is locked and being deleted.
 * It will stop the keydown event from propagating to stop it from being deleted via the keyboard.
 *
 */
const useLockedChildren = ( {
	ref,
}: {
	ref: MutableRefObject< HTMLElement | undefined >;
} ): void => {
	const lockInCore = hasFilter(
		'blocks.registerBlockType',
		'core/lock/addAttribute'
	);

	const node = ref.current;
	return useEffect( () => {
		if ( ! node || lockInCore ) {
			return;
		}
		function onKeyDown( event: KeyboardEvent ) {
			const { keyCode, target } = event;

			if ( ! ( target instanceof HTMLElement ) ) {
				return;
			}
			// We're not trying to delete something here.
			if ( keyCode !== BACKSPACE && keyCode !== DELETE ) {
				return;
			}

			// We're in a field, so we should let text be deleted.
			if ( isTextField( target ) ) {
				return;
			}

			// Typecast to fix issue with isTextField.
			const targetNode = target as HTMLElement;

			// Our target isn't a block.
			if ( targetNode.dataset.block === undefined ) {
				return;
			}

			const clientId = targetNode.dataset.block;
			const isLocked = isBlockLocked( clientId );
			// Prevent the keyboard event from propogating if it supports locking.
			if ( isLocked ) {
				event.preventDefault();
				event.stopPropagation();
				event.stopImmediatePropagation();
			}
		}
		node.addEventListener( 'keydown', onKeyDown, {
			capture: true,
			passive: false,
		} );

		return () => {
			node.removeEventListener( 'keydown', onKeyDown, {
				capture: true,
			} );
		};
	}, [ node, lockInCore ] );
};

/**
 * This hook is a light wrapper to useBlockProps, it wraps that hook plus useLockBlock to pass data between them.
 */
export const useBlockPropsWithLocking = (
	props: Record< string, unknown > = {}
): Record< string, unknown > => {
	const ref = useRef< HTMLElement >();
	const blockProps = useBlockProps( { ref, ...props } );
	useLockedChildren( {
		ref,
	} );
	return blockProps;
};
woocommerce-blocks/assets/js/blocks/cart-checkout/checkout/attributes.ts000064400000002130151335517640022636 0ustar00/**
 * External dependencies
 */
import { getSetting } from '@woocommerce/settings';

export const blockName = 'woocommerce/checkout';
export const blockAttributes = {
	isPreview: {
		type: 'boolean',
		default: false,
		save: false,
	},
	hasDarkControls: {
		type: 'boolean',
		default: getSetting( 'hasDarkEditorStyleSupport', false ),
	},
	showCompanyField: {
		type: 'boolean',
		default: false,
	},
	requireCompanyField: {
		type: 'boolean',
		default: false,
	},
	allowCreateAccount: {
		type: 'boolean',
		default: false,
	},
	showApartmentField: {
		type: 'boolean',
		default: true,
	},
	showPhoneField: {
		type: 'boolean',
		default: true,
	},
	requirePhoneField: {
		type: 'boolean',
		default: false,
	},
	// Deprecated - here for v1 migration support
	showOrderNotes: {
		type: 'boolean',
		default: true,
	},
	showPolicyLinks: {
		type: 'boolean',
		default: true,
	},
	showReturnToCart: {
		type: 'boolean',
		default: true,
	},
	cartPageId: {
		type: 'number',
		default: 0,
	},
	showRateAfterTaxName: {
		type: 'boolean',
		default: getSetting( 'displayCartPricesIncludingTax', false ),
	},
};
assets/js/blocks/cart-checkout/checkout/inner-blocks/checkout-payment-block/attributes.tsx000064400000000617151335517640031715 0ustar00woocommerce-blocks/**
 * External dependencies
 */
import { __ } from '@wordpress/i18n';

/**
 * Internal dependencies
 */
import formStepAttributes from '../../form-step/attributes';

export default {
	...formStepAttributes( {
		defaultTitle: __( 'Payment options', 'woo-gutenberg-products-block' ),
		defaultDescription: '',
	} ),
	lock: {
		type: 'object',
		default: {
			move: true,
			remove: true,
		},
	},
};
assets/js/blocks/cart-checkout/checkout/inner-blocks/checkout-payment-block/index.tsx000064400000000727151335517640030640 0ustar00woocommerce-blocks/**
 * External dependencies
 */
import { Icon, card } from '@woocommerce/icons';
import { registerFeaturePluginBlockType } from '@woocommerce/block-settings';

/**
 * Internal dependencies
 */
import { Edit, Save } from './edit';
import attributes from './attributes';
import metadata from './block.json';

registerFeaturePluginBlockType( metadata, {
	icon: {
		src: <Icon srcElement={ card } />,
		foreground: '#874FB9',
	},
	attributes,
	edit: Edit,
	save: Save,
} );
assets/js/blocks/cart-checkout/checkout/inner-blocks/checkout-payment-block/block.json000064400000001020151335517640030741 0ustar00woocommerce-blocks{
	"name": "woocommerce/checkout-payment-block",
	"version": "1.0.0",
	"title": "Payment Options",
	"description": "Payment options for your store.",
	"category": "woocommerce",
	"supports": {
		"align": false,
		"html": false,
		"multiple": false,
		"reusable": false,
		"inserter": false
	},
	"attributes": {
		"lock": {
			"type": "object",
			"default": {
				"remove": true,
				"move": true
			}
		}
	},
	"parent": [ "woocommerce/checkout-fields-block" ],
	"textdomain": "woo-gutenberg-products-block",
	"apiVersion": 2
}
assets/js/blocks/cart-checkout/checkout/inner-blocks/checkout-payment-block/frontend.tsx000064400000002405151335517640031343 0ustar00woocommerce-blocks/**
 * External dependencies
 */
import { useStoreCart, useEmitResponse } from '@woocommerce/base-context/hooks';
import withFilteredAttributes from '@woocommerce/base-hocs/with-filtered-attributes';
import { FormStep } from '@woocommerce/base-components/cart-checkout';
import {
	useCheckoutContext,
	StoreNoticesProvider,
} from '@woocommerce/base-context';

/**
 * Internal dependencies
 */
import Block from './block';
import attributes from './attributes';

const FrontendBlock = ( {
	title,
	description,
	showStepNumber,
	children,
}: {
	title: string;
	description: string;
	showStepNumber: boolean;
	children: JSX.Element;
} ) => {
	const { isProcessing: checkoutIsProcessing } = useCheckoutContext();
	const { cartNeedsPayment } = useStoreCart();
	const { noticeContexts } = useEmitResponse();

	if ( ! cartNeedsPayment ) {
		return null;
	}
	return (
		<FormStep
			id="payment-method"
			disabled={ checkoutIsProcessing }
			className="wc-block-checkout__payment-method"
			title={ title }
			description={ description }
			showStepNumber={ showStepNumber }
		>
			<StoreNoticesProvider context={ noticeContexts.PAYMENTS }>
				<Block />
			</StoreNoticesProvider>
			{ children }
		</FormStep>
	);
};

export default withFilteredAttributes( attributes )( FrontendBlock );
assets/js/blocks/cart-checkout/checkout/inner-blocks/checkout-payment-block/block.tsx000064400000000763151335517640030623 0ustar00woocommerce-blocks/**
 * External dependencies
 */
import { StoreNoticesProvider } from '@woocommerce/base-context';
import { useEmitResponse } from '@woocommerce/base-context/hooks';

/**
 * Internal dependencies
 */
import { PaymentMethods } from '../../../payment-methods';

const Block = (): JSX.Element | null => {
	const { noticeContexts } = useEmitResponse();

	return (
		<StoreNoticesProvider context={ noticeContexts.PAYMENTS }>
			<PaymentMethods />
		</StoreNoticesProvider>
	);
};

export default Block;
assets/js/blocks/cart-checkout/checkout/inner-blocks/checkout-payment-block/edit.tsx000064400000004216151335517640030453 0ustar00woocommerce-blocks/**
 * External dependencies
 */
import { __ } from '@wordpress/i18n';
import { InspectorControls, useBlockProps } from '@wordpress/block-editor';
import { PanelBody, Disabled, ExternalLink } from '@wordpress/components';
import { ADMIN_URL, getSetting } from '@woocommerce/settings';
import ExternalLinkCard from '@woocommerce/editor-components/external-link-card';
import { innerBlockAreas } from '@woocommerce/blocks-checkout';

/**
 * Internal dependencies
 */
import {
	FormStepBlock,
	FormStepBlockProps,
	AdditionalFields,
	AdditionalFieldsContent,
} from '../../form-step';
import Block from './block';

type paymentAdminLink = {
	id: number;
	title: string;
	description: string;
};

export const Edit = ( props: FormStepBlockProps ): JSX.Element => {
	const globalPaymentMethods = getSetting(
		'globalPaymentMethods'
	) as paymentAdminLink[];

	return (
		<FormStepBlock
			{ ...props }
			className="wc-block-checkout__payment-method"
		>
			<InspectorControls>
				{ globalPaymentMethods.length > 0 && (
					<PanelBody
						title={ __(
							'Methods',
							'woo-gutenberg-products-block'
						) }
					>
						<p className="wc-block-checkout__controls-text">
							{ __(
								'You currently have the following payment integrations active.',
								'woo-gutenberg-products-block'
							) }
						</p>
						{ globalPaymentMethods.map( ( method ) => {
							return (
								<ExternalLinkCard
									key={ method.id }
									href={ `${ ADMIN_URL }admin.php?page=wc-settings&tab=checkout&section=${ method.id }` }
									title={ method.title }
									description={ method.description }
								/>
							);
						} ) }
						<ExternalLink
							href={ `${ ADMIN_URL }admin.php?page=wc-settings&tab=checkout` }
						>
							{ __(
								'Manage payment methods',
								'woo-gutenberg-products-block'
							) }
						</ExternalLink>
					</PanelBody>
				) }
			</InspectorControls>
			<Disabled>
				<Block />
			</Disabled>
			<AdditionalFields block={ innerBlockAreas.PAYMENT_METHODS } />
		</FormStepBlock>
	);
};

export const Save = (): JSX.Element => {
	return (
		<div { ...useBlockProps.save() }>
			<AdditionalFieldsContent />
		</div>
	);
};
assets/js/blocks/cart-checkout/checkout/inner-blocks/checkout-shipping-methods-block/block.tsx000064400000005672151335517640032434 0ustar00woocommerce-blocks/**
 * External dependencies
 */
import { __ } from '@wordpress/i18n';
import { ShippingRatesControl } from '@woocommerce/base-components/cart-checkout';
import { getShippingRatesPackageCount } from '@woocommerce/base-utils';
import { getCurrencyFromPriceResponse } from '@woocommerce/price-format';
import FormattedMonetaryAmount from '@woocommerce/base-components/formatted-monetary-amount';
import {
	useEditorContext,
	useShippingDataContext,
} from '@woocommerce/base-context';
import { decodeEntities } from '@wordpress/html-entities';
import { Notice } from 'wordpress-components';
import classnames from 'classnames';
import { getSetting } from '@woocommerce/settings';
import type { PackageRateOption } from '@woocommerce/type-defs/shipping';
import type { CartShippingPackageShippingRate } from '@woocommerce/type-defs/cart';

/**
 * Internal dependencies
 */
import NoShippingPlaceholder from './no-shipping-placeholder';
import './style.scss';

/**
 * Renders a shipping rate control option.
 *
 * @param {Object} option Shipping Rate.
 */
const renderShippingRatesControlOption = (
	option: CartShippingPackageShippingRate
): PackageRateOption => {
	const priceWithTaxes = getSetting( 'displayCartPricesIncludingTax', false )
		? parseInt( option.price, 10 ) + parseInt( option.taxes, 10 )
		: parseInt( option.price, 10 );
	return {
		label: decodeEntities( option.name ),
		value: option.rate_id,
		description: decodeEntities( option.description ),
		secondaryLabel: (
			<FormattedMonetaryAmount
				currency={ getCurrencyFromPriceResponse( option ) }
				value={ priceWithTaxes }
			/>
		),
		secondaryDescription: decodeEntities( option.delivery_time ),
	};
};

const Block = (): JSX.Element | null => {
	const { isEditor } = useEditorContext();
	const {
		shippingRates,
		shippingRatesLoading,
		needsShipping,
		hasCalculatedShipping,
	} = useShippingDataContext();

	if ( ! needsShipping ) {
		return null;
	}

	const shippingRatesPackageCount = getShippingRatesPackageCount(
		shippingRates
	);

	if (
		! isEditor &&
		! hasCalculatedShipping &&
		! shippingRatesPackageCount
	) {
		return (
			<p>
				{ __(
					'Shipping options will be displayed here after entering your full shipping address.',
					'woo-gutenberg-products-block'
				) }
			</p>
		);
	}

	return (
		<>
			{ isEditor && ! shippingRatesPackageCount ? (
				<NoShippingPlaceholder />
			) : (
				<ShippingRatesControl
					noResultsMessage={
						<Notice
							isDismissible={ false }
							className={ classnames(
								'wc-block-components-shipping-rates-control__no-results-notice',
								'woocommerce-error'
							) }
						>
							{ __(
								'There are no shipping options available. Please check your shipping address.',
								'woo-gutenberg-products-block'
							) }
						</Notice>
					}
					renderOption={ renderShippingRatesControlOption }
					shippingRates={ shippingRates }
					shippingRatesLoading={ shippingRatesLoading }
				/>
			) }
		</>
	);
};

export default Block;
assets/js/blocks/cart-checkout/checkout/inner-blocks/checkout-shipping-methods-block/frontend.tsx000064400000002365151335517640033155 0ustar00woocommerce-blocks/**
 * External dependencies
 */
import withFilteredAttributes from '@woocommerce/base-hocs/with-filtered-attributes';
import { FormStep } from '@woocommerce/base-components/cart-checkout';
import { useCheckoutContext } from '@woocommerce/base-context';
import { useCheckoutAddress } from '@woocommerce/base-context/hooks';

/**
 * Internal dependencies
 */
import Block from './block';
import attributes from './attributes';

const FrontendBlock = ( {
	title,
	description,
	showStepNumber,
	children,
}: {
	title: string;
	description: string;
	requireCompanyField: boolean;
	requirePhoneField: boolean;
	showApartmentField: boolean;
	showCompanyField: boolean;
	showPhoneField: boolean;
	showStepNumber: boolean;
	children: JSX.Element;
} ) => {
	const { isProcessing: checkoutIsProcessing } = useCheckoutContext();
	const { showShippingFields } = useCheckoutAddress();

	if ( ! showShippingFields ) {
		return null;
	}

	return (
		<FormStep
			id="shipping-option"
			disabled={ checkoutIsProcessing }
			className="wc-block-checkout__shipping-option"
			title={ title }
			description={ description }
			showStepNumber={ showStepNumber }
		>
			<Block />
			{ children }
		</FormStep>
	);
};

export default withFilteredAttributes( attributes )( FrontendBlock );
assets/js/blocks/cart-checkout/checkout/inner-blocks/checkout-shipping-methods-block/block.json000064400000001033151335517640032552 0ustar00woocommerce-blocks{
	"name": "woocommerce/checkout-shipping-methods-block",
	"version": "1.0.0",
	"title": "Shipping Options",
	"description": "Shipping options for your store.",
	"category": "woocommerce",
	"supports": {
		"align": false,
		"html": false,
		"multiple": false,
		"reusable": false,
		"inserter": false
	},
	"attributes": {
		"lock": {
			"type": "object",
			"default": {
				"remove": true,
				"move": true
			}
		}
	},
	"parent": [ "woocommerce/checkout-fields-block" ],
	"textdomain": "woo-gutenberg-products-block",
	"apiVersion": 2
}
assets/js/blocks/cart-checkout/checkout/inner-blocks/checkout-shipping-methods-block/attributes.tsx000064400000000720151335517640033515 0ustar00woocommerce-blocks/**
 * External dependencies
 */
import { __ } from '@wordpress/i18n';

/**
 * Internal dependencies
 */
import formStepAttributes from '../../form-step/attributes';

export default {
	...formStepAttributes( {
		defaultTitle: __( 'Shipping options', 'woo-gutenberg-products-block' ),
		defaultDescription: '',
	} ),
	allowCreateAccount: {
		type: 'boolean',
		default: false,
	},
	lock: {
		type: 'object',
		default: {
			move: true,
			remove: true,
		},
	},
};
assets/js/blocks/cart-checkout/checkout/inner-blocks/checkout-shipping-methods-block/edit.tsx000064400000006416151335517640032264 0ustar00woocommerce-blocks/**
 * External dependencies
 */
import { __ } from '@wordpress/i18n';
import { InspectorControls, useBlockProps } from '@wordpress/block-editor';
import { PanelBody, Disabled, ExternalLink } from '@wordpress/components';
import { ADMIN_URL, getSetting } from '@woocommerce/settings';
import ExternalLinkCard from '@woocommerce/editor-components/external-link-card';
import { innerBlockAreas } from '@woocommerce/blocks-checkout';

/**
 * Internal dependencies
 */
import {
	FormStepBlock,
	AdditionalFields,
	AdditionalFieldsContent,
} from '../../form-step';
import Block from './block';

type shippingAdminLink = {
	id: number;
	title: string;
	description: string;
};

export const Edit = ( {
	attributes,
	setAttributes,
}: {
	attributes: {
		title: string;
		description: string;
		showStepNumber: boolean;
		allowCreateAccount: boolean;
	};
	setAttributes: ( attributes: Record< string, unknown > ) => void;
} ): JSX.Element => {
	const globalShippingMethods = getSetting(
		'globalShippingMethods'
	) as shippingAdminLink[];
	const activeShippingZones = getSetting(
		'activeShippingZones'
	) as shippingAdminLink[];

	return (
		<FormStepBlock
			attributes={ attributes }
			setAttributes={ setAttributes }
		>
			<InspectorControls>
				{ globalShippingMethods.length > 0 && (
					<PanelBody
						title={ __(
							'Methods',
							'woo-gutenberg-products-block'
						) }
					>
						<p className="wc-block-checkout__controls-text">
							{ __(
								'You currently have the following shipping integrations active.',
								'woo-gutenberg-products-block'
							) }
						</p>
						{ globalShippingMethods.map( ( method ) => {
							return (
								<ExternalLinkCard
									key={ method.id }
									href={ `${ ADMIN_URL }admin.php?page=wc-settings&tab=shipping&section=${ method.id }` }
									title={ method.title }
									description={ method.description }
								/>
							);
						} ) }
						<ExternalLink
							href={ `${ ADMIN_URL }admin.php?page=wc-settings&tab=shipping` }
						>
							{ __(
								'Manage shipping methods',
								'woo-gutenberg-products-block'
							) }
						</ExternalLink>
					</PanelBody>
				) }
				{ activeShippingZones.length && (
					<PanelBody
						title={ __( 'Zones', 'woo-gutenberg-products-block' ) }
					>
						<p className="wc-block-checkout__controls-text">
							{ __(
								'You currently have the following shipping zones active.',
								'woo-gutenberg-products-block'
							) }
						</p>
						{ activeShippingZones.map( ( zone ) => {
							return (
								<ExternalLinkCard
									key={ zone.id }
									href={ `${ ADMIN_URL }admin.php?page=wc-settings&tab=shipping&zone_id=${ zone.id }` }
									title={ zone.title }
									description={ zone.description }
								/>
							);
						} ) }
						<ExternalLink
							href={ `${ ADMIN_URL }admin.php?page=wc-settings&tab=shipping` }
						>
							{ __(
								'Manage shipping zones',
								'woo-gutenberg-products-block'
							) }
						</ExternalLink>
					</PanelBody>
				) }
			</InspectorControls>
			<Disabled>
				<Block />
			</Disabled>
			<AdditionalFields block={ innerBlockAreas.SHIPPING_METHODS } />
		</FormStepBlock>
	);
};

export const Save = (): JSX.Element => {
	return (
		<div { ...useBlockProps.save() }>
			<AdditionalFieldsContent />
		</div>
	);
};
assets/js/blocks/cart-checkout/checkout/inner-blocks/checkout-shipping-methods-block/style.scss000064400000000462151335517640032627 0ustar00woocommerce-blocks.wc-block-checkout__shipping-option {
	.wc-block-components-radio-control__option {
		@include with-translucent-border(0 0 1px);
		margin: 0;
		padding: em($gap-small) 0 em($gap-small) em($gap-largest);
	}

	.wc-block-components-shipping-rates-control__no-results-notice {
		margin: em($gap-small) 0;
	}
}
cart-checkout/checkout/inner-blocks/checkout-shipping-methods-block/no-shipping-placeholder/index.js000064400000002051151335517640036746 0ustar00woocommerce-blocks/assets/js/blocks/**
 * External dependencies
 */
import { __ } from '@wordpress/i18n';
import { Placeholder, Button } from 'wordpress-components';
import { Icon, truck } from '@woocommerce/icons';
import { ADMIN_URL } from '@woocommerce/settings';

/**
 * Internal dependencies
 */
import './style.scss';

const NoShippingPlaceholder = () => {
	return (
		<Placeholder
			icon={ <Icon srcElement={ truck } /> }
			label={ __( 'Shipping options', 'woocommerce' ) }
			className="wc-block-checkout__no-shipping-placeholder"
		>
			<span className="wc-block-checkout__no-shipping-placeholder-description">
				{ __(
					'Your store does not have any Shipping Options configured. Once you have added your Shipping Options they will appear here.',
					'woocommerce'
				) }
			</span>
			<Button
				isSecondary
				href={ `${ ADMIN_URL }admin.php?page=wc-settings&tab=shipping` }
				target="_blank"
				rel="noopener noreferrer"
			>
				{ __(
					'Configure Shipping Options',
					'woocommerce'
				) }
			</Button>
		</Placeholder>
	);
};

export default NoShippingPlaceholder;
checkout/inner-blocks/checkout-shipping-methods-block/no-shipping-placeholder/style.scss000064400000000656151335517640037347 0ustar00woocommerce-blocks/assets/js/blocks/cart-checkout.components-placeholder.wc-block-checkout__no-shipping-placeholder {
	margin-bottom: $gap;

	* {
		pointer-events: all; // Overrides parent disabled component in editor context
	}

	.components-placeholder__fieldset {
		display: block;

		.components-button {
			background-color: $gray-900;
			color: $white;
		}

		.wc-block-checkout__no-shipping-placeholder-description {
			display: block;
			margin: 0.25em 0 1em 0;
		}
	}
}
assets/js/blocks/cart-checkout/checkout/inner-blocks/checkout-shipping-methods-block/index.tsx000064400000000731151335517640032440 0ustar00woocommerce-blocks/**
 * External dependencies
 */
import { Icon, truck } from '@woocommerce/icons';
import { registerFeaturePluginBlockType } from '@woocommerce/block-settings';

/**
 * Internal dependencies
 */
import { Edit, Save } from './edit';
import attributes from './attributes';
import metadata from './block.json';

registerFeaturePluginBlockType( metadata, {
	icon: {
		src: <Icon srcElement={ truck } />,
		foreground: '#874FB9',
	},
	attributes,
	edit: Edit,
	save: Save,
} );
assets/js/blocks/cart-checkout/checkout/inner-blocks/checkout-terms-block/edit.tsx000064400000010527151335517640030132 0ustar00woocommerce-blocks/**
 * External dependencies
 */
import { __ } from '@wordpress/i18n';
import {
	useBlockProps,
	RichText,
	InspectorControls,
} from '@wordpress/block-editor';
import CheckboxControl from '@woocommerce/base-components/checkbox-control';
import { PanelBody, ToggleControl, Notice } from '@wordpress/components';
import { PRIVACY_URL, TERMS_URL } from '@woocommerce/block-settings';
import { ADMIN_URL } from '@woocommerce/settings';
import { Icon, external } from '@wordpress/icons';

/**
 * Internal dependencies
 */
import './editor.scss';
import { termsConsentDefaultText, termsCheckboxDefaultText } from './constants';

export const Edit = ( {
	attributes: { checkbox, text },
	setAttributes,
}: {
	attributes: { text: string; checkbox: boolean };
	setAttributes: ( attributes: Record< string, unknown > ) => void;
} ): JSX.Element => {
	const blockProps = useBlockProps();

	const defaultText = checkbox
		? termsCheckboxDefaultText
		: termsConsentDefaultText;

	const currentText = text || defaultText;
	return (
		<div { ...blockProps }>
			<InspectorControls>
				<PanelBody
					title={ __(
						'Display options',
						'woo-gutenberg-products-block'
					) }
				>
					<ToggleControl
						label={ __(
							'Require checkbox',
							'woo-gutenberg-products-block'
						) }
						checked={ checkbox }
						onChange={ () =>
							setAttributes( {
								checkbox: ! checkbox,
							} )
						}
					/>
				</PanelBody>
			</InspectorControls>
			<div className="wc-block-checkout__terms">
				{ checkbox ? (
					<>
						<CheckboxControl
							id="terms-condition"
							checked={ false }
						/>
						<RichText
							value={ currentText }
							onChange={ ( value ) =>
								setAttributes( { text: value } )
							}
						/>
					</>
				) : (
					<RichText
						tagName="span"
						value={ currentText }
						onChange={ ( value ) =>
							setAttributes( { text: value } )
						}
					/>
				) }
			</div>
			{ /* Show this notice if a terms page or a privacy page is not setup. */ }
			{ ( ! TERMS_URL || ! PRIVACY_URL ) && (
				<Notice
					className="wc-block-checkout__terms_notice"
					status="warning"
					isDismissible={ false }
					actions={ [
						! TERMS_URL && {
							className: 'wc-block-checkout__terms_notice-button',
							label: (
								<>
									{ __(
										'Setup a Terms and Conditions page',
										'woo-gutenberg-products-block'
									) }
									<Icon
										icon={ external }
										size={ 16 }
										className="wc-block-checkout__terms_notice-button__icon"
									/>
								</>
							),

							onClick: () =>
								window.open(
									`${ ADMIN_URL }admin.php?page=wc-settings&tab=advanced`,
									'_blank'
								),
						},
						! PRIVACY_URL && {
							className: 'wc-block-checkout__terms_notice-button',
							label: (
								<>
									{ __(
										'Setup a Privacy Policy page',
										'woo-gutenberg-products-block'
									) }
									<Icon
										size={ 16 }
										icon={ external }
										className="wc-block-checkout__terms_notice-button__icon"
									/>
								</>
							),
							onClick: () =>
								window.open(
									`${ ADMIN_URL }options-privacy.php`,
									'_blank'
								),
						},
					].filter( Boolean ) }
				>
					<p>
						{ __(
							"You don't seem to have a Terms and Conditions and/or a Privacy Policy pages setup.",
							'woo-gutenberg-products-block'
						) }
					</p>
				</Notice>
			) }
			{ /* Show this notice if we have both a terms and privacy pages, but they're not present in the text. */ }
			{ TERMS_URL &&
				PRIVACY_URL &&
				! (
					currentText.includes( TERMS_URL ) &&
					currentText.includes( PRIVACY_URL )
				) && (
					<Notice
						className="wc-block-checkout__terms_notice"
						status="warning"
						isDismissible={ false }
						actions={
							termsConsentDefaultText !== text
								? [
										{
											label: __(
												'Restore default text',
												'woo-gutenberg-products-block'
											),
											onClick: () =>
												setAttributes( { text: '' } ),
										},
								  ]
								: []
						}
					>
						<p>
							{ __(
								'Ensure you add links to your policy pages in this section.',
								'woo-gutenberg-products-block'
							) }
						</p>
					</Notice>
				) }
		</div>
	);
};

export const Save = (): JSX.Element => {
	return <div { ...useBlockProps.save() } />;
};
assets/js/blocks/cart-checkout/checkout/inner-blocks/checkout-terms-block/index.tsx000064400000000652151335517640030312 0ustar00woocommerce-blocks/**
 * External dependencies
 */
import { Icon, asterisk } from '@woocommerce/icons';
import { registerFeaturePluginBlockType } from '@woocommerce/block-settings';
/**
 * Internal dependencies
 */
import { Edit, Save } from './edit';
import metadata from './block.json';

registerFeaturePluginBlockType( metadata, {
	icon: {
		src: <Icon srcElement={ asterisk } />,
		foreground: '#874FB9',
	},
	edit: Edit,
	save: Save,
} );
assets/js/blocks/cart-checkout/checkout/inner-blocks/checkout-terms-block/editor.scss000064400000001165151335517640030626 0ustar00woocommerce-blocks// Adjust padding and margins in the editor to improve selected block outlines.
.wc-block-checkout__terms {
	margin: 20px 0;
	padding-top: 4px;
	padding-bottom: 4px;
	display: flex;
	align-items: flex-start;

	.block-editor-rich-text__editable {
		vertical-align: middle;
		line-height: em(24px);
	}
}

.wc-block-components-checkbox {
	margin-right: $gap;
}

.wc-block-checkout__terms_notice .components-notice__action {
	margin-left: 0;
}

.wc-block-checkout__terms_notice-button {
	display: flex;
	flex-direction: row;
	align-items: center;

	.wc-block-checkout__terms_notice-button__icon {
		margin-left: $gap-smallest;
	}
}

assets/js/blocks/cart-checkout/checkout/inner-blocks/checkout-terms-block/style.scss000064400000000265151335517640030500 0ustar00woocommerce-blocks.wc-block-checkout__terms {
	margin: 1.5em 0;
	text-align: justify;

	textarea {
		top: -5px;
		position: relative;
	}

	&.wc-block-checkout__terms--disabled {
		opacity: 0.6;
	}
}
assets/js/blocks/cart-checkout/checkout/inner-blocks/checkout-terms-block/constants.js000064400000002075151335517640031016 0ustar00woocommerce-blocks/**
 * External dependencies
 */
import { __, sprintf } from '@wordpress/i18n';
import { PRIVACY_URL, TERMS_URL } from '@woocommerce/block-settings';

const termsPageLink = TERMS_URL
	? `<a href="${ TERMS_URL }">${ __(
			'Terms and Conditions',
			'woo-gutenberg-product-blocks'
	  ) }</a>`
	: __( 'Terms and Conditions', 'woo-gutenberg-product-blocks' );

const privacyPageLink = PRIVACY_URL
	? `<a href="${ PRIVACY_URL }">${ __(
			'Privacy Policy',
			'woo-gutenberg-product-blocks'
	  ) }</a>`
	: __( 'Privacy Policy', 'woo-gutenberg-product-blocks' );

export const termsConsentDefaultText = sprintf(
	/* translators: %1$s terms page link, %2$s privacy page link. */
	__(
		'By proceeding with your purchase you agree to our %1$s and %2$s',
		'woo-gutenberg-product-blocks'
	),
	termsPageLink,
	privacyPageLink
);

export const termsCheckboxDefaultText = sprintf(
	/* translators: %1$s terms page link, %2$s privacy page link. */
	__(
		'You must accept our %1$s and %2$s to continue with your purchase.',
		'woo-gutenberg-product-blocks'
	),
	termsPageLink,
	privacyPageLink
);
assets/js/blocks/cart-checkout/checkout/inner-blocks/checkout-terms-block/frontend.tsx000064400000004540151335517640031022 0ustar00woocommerce-blocks/**
 * External dependencies
 */
import { __ } from '@wordpress/i18n';
import classnames from 'classnames';
import { useState, useEffect } from '@wordpress/element';
import CheckboxControl from '@woocommerce/base-components/checkbox-control';
import { useCheckoutSubmit } from '@woocommerce/base-context/hooks';
import { withInstanceId } from '@wordpress/compose';
import type { ValidationData } from '@woocommerce/type-defs/contexts';
/**
 * Internal dependencies
 */
import { termsConsentDefaultText, termsCheckboxDefaultText } from './constants';
import './style.scss';

const FrontendBlock = ( {
	text,
	checkbox,
	instanceId,
	validation,
}: {
	text: string;
	checkbox: boolean;
	instanceId: string;
	validation: ValidationData;
} ): JSX.Element => {
	const [ checked, setChecked ] = useState( false );

	const { isDisabled } = useCheckoutSubmit();

	const validationErrorId = 'terms-and-conditions-' + instanceId;
	const {
		getValidationError,
		setValidationErrors,
		clearValidationError,
	} = validation;

	const error = getValidationError( validationErrorId ) || {};
	const hasError = error.message && ! error.hidden;

	// Track validation errors for this input.
	useEffect( () => {
		if ( ! checkbox ) {
			return;
		}
		if ( checked ) {
			clearValidationError( validationErrorId );
		} else {
			setValidationErrors( {
				[ validationErrorId ]: {
					message: __(
						'Please read and accept the terms and conditions.',
						'woo-gutenberg-products-block'
					),
					hidden: true,
				},
			} );
		}
		return () => {
			clearValidationError( validationErrorId );
		};
	}, [
		checkbox,
		checked,
		validationErrorId,
		clearValidationError,
		setValidationErrors,
	] );

	return (
		<div
			className={ classnames( 'wc-block-checkout__terms', {
				'wc-block-checkout__terms--disabled': isDisabled,
			} ) }
		>
			{ checkbox ? (
				<>
					<CheckboxControl
						id="terms-and-conditions"
						checked={ checked }
						onChange={ () => setChecked( ( value ) => ! value ) }
						hasError={ hasError }
						disabled={ isDisabled }
					>
						<span
							dangerouslySetInnerHTML={ {
								__html: text || termsCheckboxDefaultText,
							} }
						/>
					</CheckboxControl>
				</>
			) : (
				<span
					dangerouslySetInnerHTML={ {
						__html: text || termsConsentDefaultText,
					} }
				/>
			) }
		</div>
	);
};

export default withInstanceId( FrontendBlock );
assets/js/blocks/cart-checkout/checkout/inner-blocks/checkout-terms-block/block.json000064400000001100151335517640030415 0ustar00woocommerce-blocks{
	"name": "woocommerce/checkout-terms-block",
	"version": "1.0.0",
	"title": "Terms and Conditions",
	"description": "Ensure customers agree to your terms and conditions and privacy policy.",
	"category": "woocommerce",
	"supports": {
		"align": false,
		"html": false,
		"multiple": false,
		"reusable": false
	},
	"attributes": {
		"checkbox": {
			"type": "boolean",
			"default": false
		},
		"text": {
			"type": "string",
			"required": false
		}
	},
	"parent": [ "woocommerce/checkout-fields-block" ],
	"textdomain": "woo-gutenberg-products-block",
	"apiVersion": 2
}
woocommerce-blocks/assets/js/blocks/cart-checkout/checkout/inner-blocks/index.tsx000064400000000770151335517640024345 0ustar00/**
 * Internal dependencies
 */
import './checkout-fields-block';
import './checkout-totals-block';
import './checkout-shipping-address-block';
import './checkout-terms-block';
import './checkout-contact-information-block';
import './checkout-billing-address-block';
import './checkout-actions-block';
import './checkout-order-note-block';
import './checkout-order-summary-block';
import './checkout-payment-block';
import './checkout-express-payment-block';
import './checkout-shipping-methods-block';
assets/js/blocks/cart-checkout/checkout/inner-blocks/checkout-totals-block/style.scss000064400000000603151335517640030650 0ustar00woocommerce-blocks.wc-block-checkout__sidebar {
	.wc-block-components-product-name {
		display: block;
		color: inherit;
		flex-grow: 1;
		// Required by IE11.
		flex-basis: 0;
	}
	.wc-block-components-totals-taxes,
	.wc-block-components-totals-footer-item {
		margin: 0;
		padding: 0;
	}
}

.is-mobile,
.is-small,
.is-medium {
	.wc-block-checkout__sidebar {
		margin-bottom: $gap-large;
		order: 0;
	}
}
assets/js/blocks/cart-checkout/checkout/inner-blocks/checkout-totals-block/edit.tsx000064400000001755151335517640030311 0ustar00woocommerce-blocks/**
 * External dependencies
 */
import { useBlockProps, InnerBlocks } from '@wordpress/block-editor';
import { Sidebar } from '@woocommerce/base-components/sidebar-layout';
import { innerBlockAreas } from '@woocommerce/blocks-checkout';

/**
 * Internal dependencies
 */
import './style.scss';
import { useForcedLayout } from '../../use-forced-layout';
import { getAllowedBlocks } from '../../editor-utils';

export const Edit = ( { clientId }: { clientId: string } ): JSX.Element => {
	const blockProps = useBlockProps();
	const allowedBlocks = getAllowedBlocks( innerBlockAreas.CHECKOUT_TOTALS );

	useForcedLayout( {
		clientId,
		template: allowedBlocks,
	} );

	return (
		<Sidebar className="wc-block-checkout__sidebar">
			<div { ...blockProps }>
				<InnerBlocks
					allowedBlocks={ allowedBlocks }
					templateLock={ false }
				/>
			</div>
		</Sidebar>
	);
};

export const Save = (): JSX.Element => {
	return (
		<div { ...useBlockProps.save() }>
			<InnerBlocks.Content />
		</div>
	);
};
assets/js/blocks/cart-checkout/checkout/inner-blocks/checkout-totals-block/block.json000064400000001043151335517640030577 0ustar00woocommerce-blocks{
	"name": "woocommerce/checkout-totals-block",
	"version": "1.0.0",
	"title": "Checkout Totals",
	"description": "Column containing the checkout totals.",
	"category": "woocommerce",
	"supports": {
		"align": false,
		"html": false,
		"multiple": false,
		"reusable": false,
		"inserter": false
	},
	"attributes": {
		"checkbox": {
			"type": "boolean",
			"default": false
		},
		"text": {
			"type": "string",
			"required": false
		}
	},
	"parent": [ "woocommerce/checkout" ],
	"textdomain": "woo-gutenberg-products-block",
	"apiVersion": 2
}
assets/js/blocks/cart-checkout/checkout/inner-blocks/checkout-totals-block/index.tsx000064400000000637151335517640030471 0ustar00woocommerce-blocks/**
 * External dependencies
 */
import { Icon, column } from '@wordpress/icons';
import { registerFeaturePluginBlockType } from '@woocommerce/block-settings';

/**
 * Internal dependencies
 */
import { Edit, Save } from './edit';
import metadata from './block.json';

registerFeaturePluginBlockType( metadata, {
	icon: {
		src: <Icon icon={ column } />,
		foreground: '#874FB9',
	},
	edit: Edit,
	save: Save,
} );
assets/js/blocks/cart-checkout/checkout/inner-blocks/checkout-totals-block/frontend.tsx000064400000000563151335517640031177 0ustar00woocommerce-blocks/**
 * External dependencies
 */
import { Sidebar } from '@woocommerce/base-components/sidebar-layout';

/**
 * Internal dependencies
 */
import './style.scss';

const FrontendBlock = ( {
	children,
}: {
	children: JSX.Element;
} ): JSX.Element => {
	return (
		<Sidebar className="wc-block-checkout__sidebar">{ children }</Sidebar>
	);
};

export default FrontendBlock;
assets/js/blocks/cart-checkout/checkout/inner-blocks/checkout-express-payment-block/block.tsx000064400000000616151335517640032307 0ustar00woocommerce-blocks/**
 * External dependencies
 */
import { useStoreCart } from '@woocommerce/base-context/hooks';

/**
 * Internal dependencies
 */
import { CheckoutExpressPayment } from '../../../payment-methods';

const Block = (): JSX.Element | null => {
	const { cartNeedsPayment } = useStoreCart();

	if ( ! cartNeedsPayment ) {
		return null;
	}

	return <CheckoutExpressPayment />;
};

export default Block;
assets/js/blocks/cart-checkout/checkout/inner-blocks/checkout-express-payment-block/block.json000064400000001057151335517640032442 0ustar00woocommerce-blocks{
	"name": "woocommerce/checkout-express-payment-block",
	"version": "1.0.0",
	"title": "Express Checkout",
	"description": "Provide an express payment option for your customers.",
	"category": "woocommerce",
	"supports": {
		"align": false,
		"html": false,
		"multiple": false,
		"reusable": false,
		"inserter": false
	},
	"attributes": {
		"lock": {
			"type": "object",
			"default": {
				"remove": true,
				"move": true
			}
		}
	},
	"parent": [ "woocommerce/checkout-fields-block" ],
	"textdomain": "woo-gutenberg-products-block",
	"apiVersion": 2
}
assets/js/blocks/cart-checkout/checkout/inner-blocks/checkout-express-payment-block/edit.tsx000064400000004324151335517640032142 0ustar00woocommerce-blocks/**
 * External dependencies
 */
import { __ } from '@wordpress/i18n';
import { useBlockProps } from '@wordpress/block-editor';
import { Placeholder, Button } from 'wordpress-components';
import { useExpressPaymentMethods } from '@woocommerce/base-context/hooks';
import { Icon, card } from '@woocommerce/icons';
import { ADMIN_URL } from '@woocommerce/settings';
import classnames from 'classnames';

/**
 * Internal dependencies
 */
import Block from './block';
import './editor.scss';

/**
 * Renders a placeholder in the editor.
 */
const NoExpressPaymentMethodsPlaceholder = () => {
	return (
		<Placeholder
			icon={ <Icon srcElement={ card } /> }
			label={ __( 'Express Checkout', 'woo-gutenberg-products-block' ) }
			className="wp-block-woocommerce-checkout-express-payment-block-placeholder"
		>
			<span className="wp-block-woocommerce-checkout-express-payment-block-placeholder__description">
				{ __(
					"Your store doesn't have any Payment Methods that support the Express Checkout Block. If they are added, they will be shown here.",
					'woo-gutenberg-products-block'
				) }
			</span>
			<Button
				isPrimary
				href={ `${ ADMIN_URL }admin.php?page=wc-settings&tab=checkout` }
				target="_blank"
				rel="noopener noreferrer"
				className="wp-block-woocommerce-checkout-express-payment-block-placeholder__button"
			>
				{ __(
					'Configure Payment Methods',
					'woo-gutenberg-products-block'
				) }
			</Button>
		</Placeholder>
	);
};

export const Edit = ( {
	attributes,
}: {
	attributes: {
		lock: {
			move: boolean;
			remove: boolean;
		};
	};
} ): JSX.Element | null => {
	const { paymentMethods, isInitialized } = useExpressPaymentMethods();
	const hasExpressPaymentMethods = Object.keys( paymentMethods ).length > 0;
	const blockProps = useBlockProps( {
		className: classnames( {
			'wp-block-woocommerce-checkout-express-payment-block--has-express-payment-methods': hasExpressPaymentMethods,
		} ),
		attributes,
	} );

	if ( ! isInitialized ) {
		return null;
	}

	return (
		<div { ...blockProps }>
			{ hasExpressPaymentMethods ? (
				<Block />
			) : (
				<NoExpressPaymentMethodsPlaceholder />
			) }
		</div>
	);
};

export const Save = (): JSX.Element => {
	return <div { ...useBlockProps.save() } />;
};
assets/js/blocks/cart-checkout/checkout/inner-blocks/checkout-express-payment-block/index.tsx000064400000000643151335517640032324 0ustar00woocommerce-blocks/**
 * External dependencies
 */
import { Icon, card } from '@woocommerce/icons';
import { registerFeaturePluginBlockType } from '@woocommerce/block-settings';

/**
 * Internal dependencies
 */
import { Edit, Save } from './edit';
import metadata from './block.json';

registerFeaturePluginBlockType( metadata, {
	icon: {
		src: <Icon srcElement={ card } />,
		foreground: '#874FB9',
	},
	edit: Edit,
	save: Save,
} );
assets/js/blocks/cart-checkout/checkout/inner-blocks/checkout-express-payment-block/editor.scss000064400000001363151335517640032640 0ustar00woocommerce-blocks// Adjust padding and margins in the editor to improve selected block outlines.
.wp-block-woocommerce-checkout-express-payment-block {
	margin: 14px 0 28px;

	.components-placeholder__label svg {
		font-size: 1em;
	}

	.wc-block-components-express-payment-continue-rule--checkout {
		margin-bottom: 0;
	}

	&.wp-block-woocommerce-checkout-express-payment-block--has-express-payment-methods {
		padding: 14px 0;
		margin: -14px 0 14px 0 !important;
		position: relative;
	}
}

.wp-block-woocommerce-checkout-express-payment-block-placeholder {
	* {
		pointer-events: all; // Overrides parent disabled component in editor context
	}

	.wp-block-woocommerce-checkout-express-payment-block-placeholder__description {
		display: block;
		margin: 0 0 1em;
	}
}
assets/js/blocks/cart-checkout/checkout/inner-blocks/checkout-billing-address-block/edit.tsx000064400000003205151335517640032036 0ustar00woocommerce-blocks/**
 * External dependencies
 */
import { useBlockProps } from '@wordpress/block-editor';
import { useCheckoutAddress } from '@woocommerce/base-context/hooks';
import { innerBlockAreas } from '@woocommerce/blocks-checkout';

/**
 * Internal dependencies
 */
import {
	FormStepBlock,
	AdditionalFields,
	AdditionalFieldsContent,
} from '../../form-step';
import {
	useCheckoutBlockContext,
	useCheckoutBlockControlsContext,
} from '../../context';
import Block from './block';

export const Edit = ( {
	attributes,
	setAttributes,
}: {
	attributes: {
		title: string;
		description: string;
		showStepNumber: boolean;
	};
	setAttributes: ( attributes: Record< string, unknown > ) => void;
} ): JSX.Element | null => {
	const {
		showCompanyField,
		showApartmentField,
		requireCompanyField,
		showPhoneField,
		requirePhoneField,
	} = useCheckoutBlockContext();
	const {
		addressFieldControls: Controls,
	} = useCheckoutBlockControlsContext();
	const { showBillingFields } = useCheckoutAddress();

	if ( ! showBillingFields ) {
		return null;
	}

	return (
		<FormStepBlock
			setAttributes={ setAttributes }
			attributes={ attributes }
			className="wc-block-checkout__billing-fields"
		>
			<Controls />
			<Block
				showCompanyField={ showCompanyField }
				showApartmentField={ showApartmentField }
				requireCompanyField={ requireCompanyField }
				showPhoneField={ showPhoneField }
				requirePhoneField={ requirePhoneField }
			/>
			<AdditionalFields block={ innerBlockAreas.BILLING_ADDRESS } />
		</FormStepBlock>
	);
};

export const Save = (): JSX.Element => {
	return (
		<div { ...useBlockProps.save() }>
			<AdditionalFieldsContent />
		</div>
	);
};
assets/js/blocks/cart-checkout/checkout/inner-blocks/checkout-billing-address-block/index.tsx000064400000000735151335517640032225 0ustar00woocommerce-blocks/**
 * External dependencies
 */
import { Icon, address } from '@woocommerce/icons';
import { registerFeaturePluginBlockType } from '@woocommerce/block-settings';

/**
 * Internal dependencies
 */
import { Edit, Save } from './edit';
import attributes from './attributes';
import metadata from './block.json';

registerFeaturePluginBlockType( metadata, {
	icon: {
		src: <Icon srcElement={ address } />,
		foreground: '#874FB9',
	},
	attributes,
	edit: Edit,
	save: Save,
} );
assets/js/blocks/cart-checkout/checkout/inner-blocks/checkout-billing-address-block/block.tsx000064400000004141151335517640032203 0ustar00woocommerce-blocks/**
 * External dependencies
 */
import { useMemo, useEffect, Fragment } from '@wordpress/element';
import { Disabled } from 'wordpress-components';
import {
	useCheckoutAddress,
	useStoreEvents,
	useEditorContext,
} from '@woocommerce/base-context';
import { AddressForm } from '@woocommerce/base-components/cart-checkout';

/**
 * Internal dependencies
 */
import PhoneNumber from '../../phone-number';

const Block = ( {
	showCompanyField = false,
	showApartmentField = false,
	showPhoneField = false,
	requireCompanyField = false,
	requirePhoneField = false,
}: {
	showCompanyField: boolean;
	showApartmentField: boolean;
	showPhoneField: boolean;
	requireCompanyField: boolean;
	requirePhoneField: boolean;
} ): JSX.Element => {
	const {
		defaultAddressFields,
		billingFields,
		setBillingFields,
		setPhone,
	} = useCheckoutAddress();
	const { dispatchCheckoutEvent } = useStoreEvents();
	const { isEditor } = useEditorContext();

	// Clears data if fields are hidden.
	useEffect( () => {
		if ( ! showPhoneField ) {
			setPhone( '' );
		}
	}, [ showPhoneField, setPhone ] );

	const addressFieldsConfig = useMemo( () => {
		return {
			company: {
				hidden: ! showCompanyField,
				required: requireCompanyField,
			},
			address_2: {
				hidden: ! showApartmentField,
			},
		};
	}, [ showCompanyField, requireCompanyField, showApartmentField ] );

	const AddressFormWrapperComponent = isEditor ? Disabled : Fragment;

	return (
		<AddressFormWrapperComponent>
			<AddressForm
				id="billing"
				type="billing"
				onChange={ ( values: Record< string, unknown > ) => {
					setBillingFields( values );
					dispatchCheckoutEvent( 'set-billing-address' );
				} }
				values={ billingFields }
				fields={ Object.keys( defaultAddressFields ) }
				fieldConfig={ addressFieldsConfig }
			/>
			{ showPhoneField && (
				<PhoneNumber
					isRequired={ requirePhoneField }
					value={ billingFields.phone }
					onChange={ ( value ) => {
						setPhone( value );
						dispatchCheckoutEvent( 'set-phone-number', {
							step: 'billing',
						} );
					} }
				/>
			) }
		</AddressFormWrapperComponent>
	);
};

export default Block;
assets/js/blocks/cart-checkout/checkout/inner-blocks/checkout-billing-address-block/frontend.tsx000064400000003034151335517640032730 0ustar00woocommerce-blocks/**
 * External dependencies
 */
import withFilteredAttributes from '@woocommerce/base-hocs/with-filtered-attributes';
import { FormStep } from '@woocommerce/base-components/cart-checkout';
import { useCheckoutContext } from '@woocommerce/base-context';
import { useCheckoutAddress } from '@woocommerce/base-context/hooks';

/**
 * Internal dependencies
 */
import Block from './block';
import attributes from './attributes';
import { useCheckoutBlockContext } from '../../context';

const FrontendBlock = ( {
	title,
	description,
	showStepNumber,
	children,
}: {
	title: string;
	description: string;
	showStepNumber: boolean;
	children: JSX.Element;
} ): JSX.Element | null => {
	const { isProcessing: checkoutIsProcessing } = useCheckoutContext();
	const { showBillingFields } = useCheckoutAddress();
	const {
		requireCompanyField,
		requirePhoneField,
		showApartmentField,
		showCompanyField,
		showPhoneField,
	} = useCheckoutBlockContext();

	if ( ! showBillingFields ) {
		return null;
	}

	return (
		<FormStep
			id="billing-fields"
			disabled={ checkoutIsProcessing }
			className="wc-block-checkout__billing-fields"
			title={ title }
			description={ description }
			showStepNumber={ showStepNumber }
		>
			<Block
				requireCompanyField={ requireCompanyField }
				showApartmentField={ showApartmentField }
				showCompanyField={ showCompanyField }
				showPhoneField={ showPhoneField }
				requirePhoneField={ requirePhoneField }
			/>
			{ children }
		</FormStep>
	);
};

export default withFilteredAttributes( attributes )( FrontendBlock );
assets/js/blocks/cart-checkout/checkout/inner-blocks/checkout-billing-address-block/block.json000064400000001041151335517640032332 0ustar00woocommerce-blocks{
	"name": "woocommerce/checkout-billing-address-block",
	"version": "1.0.0",
	"title": "Billing Address",
	"description": "Collect your customer's billing address.",
	"category": "woocommerce",
	"supports": {
		"align": false,
		"html": false,
		"multiple": false,
		"reusable": false,
		"inserter": false
	},
	"attributes": {
		"lock": {
			"type": "object",
			"default": {
				"remove": true,
				"move": true
			}
		}
	},
	"parent": [ "woocommerce/checkout-fields-block" ],
	"textdomain": "woo-gutenberg-products-block",
	"apiVersion": 2
}
assets/js/blocks/cart-checkout/checkout/inner-blocks/checkout-billing-address-block/attributes.tsx000064400000000770151335517640033303 0ustar00woocommerce-blocks/**
 * External dependencies
 */
import { __ } from '@wordpress/i18n';

/**
 * Internal dependencies
 */
import formStepAttributes from '../../form-step/attributes';

export default {
	...formStepAttributes( {
		defaultTitle: __( 'Billing address', 'woo-gutenberg-products-block' ),
		defaultDescription: __(
			'Enter the address that matches your card or payment method.',
			'woo-gutenberg-products-block'
		),
	} ),
	lock: {
		type: 'object',
		default: {
			move: true,
			remove: true,
		},
	},
};
assets/js/blocks/cart-checkout/checkout/inner-blocks/checkout-contact-information-block/block.tsx000064400000003057151335517640033123 0ustar00woocommerce-blocks/**
 * External dependencies
 */
import { __ } from '@wordpress/i18n';
import { ValidatedTextInput } from '@woocommerce/base-components/text-input';
import {
	useCheckoutContext,
	useCheckoutAddress,
	useStoreEvents,
} from '@woocommerce/base-context';
import { getSetting } from '@woocommerce/settings';
import CheckboxControl from '@woocommerce/base-components/checkbox-control';

/**
 * Internal dependencies
 */

const Block = ( {
	allowCreateAccount,
}: {
	allowCreateAccount: boolean;
} ): JSX.Element => {
	const {
		customerId,
		shouldCreateAccount,
		setShouldCreateAccount,
	} = useCheckoutContext();
	const { billingFields, setEmail } = useCheckoutAddress();
	const { dispatchCheckoutEvent } = useStoreEvents();

	const onChangeEmail = ( value ) => {
		setEmail( value );
		dispatchCheckoutEvent( 'set-email-address' );
	};

	const createAccountUI = ! customerId &&
		allowCreateAccount &&
		getSetting( 'checkoutAllowsGuest', false ) &&
		getSetting( 'checkoutAllowsSignup', false ) && (
			<CheckboxControl
				className="wc-block-checkout__create-account"
				label={ __(
					'Create an account?',
					'woo-gutenberg-products-block'
				) }
				checked={ shouldCreateAccount }
				onChange={ ( value ) => setShouldCreateAccount( value ) }
			/>
		);

	return (
		<>
			<ValidatedTextInput
				id="email"
				type="email"
				label={ __( 'Email address', 'woo-gutenberg-products-block' ) }
				value={ billingFields.email }
				autoComplete="email"
				onChange={ onChangeEmail }
				required={ true }
			/>
			{ createAccountUI }
		</>
	);
};

export default Block;
assets/js/blocks/cart-checkout/checkout/inner-blocks/checkout-contact-information-block/block.json000064400000001055151335517640033252 0ustar00woocommerce-blocks{
	"name": "woocommerce/checkout-contact-information-block",
	"version": "1.0.0",
	"title": "Contact Information",
	"description": "Collect your customer's contact information.",
	"category": "woocommerce",
	"supports": {
		"align": false,
		"html": false,
		"multiple": false,
		"reusable": false,
		"inserter": false
	},
	"attributes": {
		"lock": {
			"type": "object",
			"default": {
				"remove": true,
				"move": true
			}
		}
	},
	"parent": [ "woocommerce/checkout-fields-block" ],
	"textdomain": "woo-gutenberg-products-block",
	"apiVersion": 2
}
js/blocks/cart-checkout/checkout/inner-blocks/checkout-contact-information-block/login-prompt.js000064400000001334151335517640034252 0ustar00woocommerce-blocks/assets/**
 * External dependencies
 */
import { __ } from '@wordpress/i18n';
import { getSetting } from '@woocommerce/settings';
import { useCheckoutContext } from '@woocommerce/base-context';
import { LOGIN_URL } from '@woocommerce/block-settings';

const LOGIN_TO_CHECKOUT_URL = `${ LOGIN_URL }?redirect_to=${ encodeURIComponent(
	window.location.href
) }`;

const LoginPrompt = () => {
	const { customerId } = useCheckoutContext();

	if ( ! getSetting( 'checkoutShowLoginReminder', true ) || customerId ) {
		return null;
	}

	return (
		<>
			{ __(
				'Already have an account? ',
				'woocommerce'
			) }
			<a href={ LOGIN_TO_CHECKOUT_URL }>
				{ __( 'Log in.', 'woocommerce' ) }
			</a>
		</>
	);
};

export default LoginPrompt;
assets/js/blocks/cart-checkout/checkout/inner-blocks/checkout-contact-information-block/edit.tsx000064400000002342151335517640032752 0ustar00woocommerce-blocks/**
 * External dependencies
 */
import { useBlockProps } from '@wordpress/block-editor';
import { Disabled } from '@wordpress/components';
import { innerBlockAreas } from '@woocommerce/blocks-checkout';

/**
 * Internal dependencies
 */
import {
	FormStepBlock,
	AdditionalFields,
	AdditionalFieldsContent,
} from '../../form-step';
import Block from './block';
import {
	useCheckoutBlockContext,
	useCheckoutBlockControlsContext,
} from '../../context';

export const Edit = ( {
	attributes,
	setAttributes,
}: {
	attributes: {
		title: string;
		description: string;
		showStepNumber: boolean;
	};
	setAttributes: ( attributes: Record< string, unknown > ) => void;
} ): JSX.Element => {
	const { allowCreateAccount } = useCheckoutBlockContext();
	const { accountControls: Controls } = useCheckoutBlockControlsContext();
	return (
		<FormStepBlock
			attributes={ attributes }
			setAttributes={ setAttributes }
		>
			<Controls />
			<Disabled>
				<Block allowCreateAccount={ allowCreateAccount } />
			</Disabled>
			<AdditionalFields block={ innerBlockAreas.CONTACT_INFORMATION } />
		</FormStepBlock>
	);
};

export const Save = (): JSX.Element => {
	return (
		<div { ...useBlockProps.save() }>
			<AdditionalFieldsContent />
		</div>
	);
};
js/blocks/cart-checkout/checkout/inner-blocks/checkout-contact-information-block/attributes.tsx000064400000001017151335517640034211 0ustar00woocommerce-blocks/assets/**
 * External dependencies
 */
import { __ } from '@wordpress/i18n';

/**
 * Internal dependencies
 */
import formStepAttributes from '../../form-step/attributes';

export default {
	...formStepAttributes( {
		defaultTitle: __(
			'Contact information',
			'woo-gutenberg-products-block'
		),
		defaultDescription: __(
			"We'll use this email to send you details and updates about your order.",
			'woo-gutenberg-products-block'
		),
	} ),
	lock: {
		type: 'object',
		default: {
			remove: true,
			move: true,
		},
	},
};
assets/js/blocks/cart-checkout/checkout/inner-blocks/checkout-contact-information-block/frontend.tsx000064400000002313151335517640033642 0ustar00woocommerce-blocks/**
 * External dependencies
 */
import withFilteredAttributes from '@woocommerce/base-hocs/with-filtered-attributes';
import { FormStep } from '@woocommerce/base-components/cart-checkout';
import { useCheckoutContext } from '@woocommerce/base-context';

/**
 * Internal dependencies
 */
import Block from './block';
import attributes from './attributes';
import LoginPrompt from './login-prompt';
import { useCheckoutBlockContext } from '../../context';

const FrontendBlock = ( {
	title,
	description,
	showStepNumber,
	children,
}: {
	title: string;
	description: string;
	allowCreateAccount: boolean;
	showStepNumber: boolean;
	children: JSX.Element;
} ) => {
	const { isProcessing: checkoutIsProcessing } = useCheckoutContext();
	const { allowCreateAccount } = useCheckoutBlockContext();

	return (
		<FormStep
			id="contact-fields"
			disabled={ checkoutIsProcessing }
			className="wc-block-checkout__contact-fields"
			title={ title }
			description={ description }
			showStepNumber={ showStepNumber }
			stepHeadingContent={ () => <LoginPrompt /> }
		>
			<Block allowCreateAccount={ allowCreateAccount } />
			{ children }
		</FormStep>
	);
};

export default withFilteredAttributes( attributes )( FrontendBlock );
assets/js/blocks/cart-checkout/checkout/inner-blocks/checkout-contact-information-block/index.tsx000064400000000735151335517640033140 0ustar00woocommerce-blocks/**
 * External dependencies
 */
import { Icon, contact } from '@woocommerce/icons';
import { registerFeaturePluginBlockType } from '@woocommerce/block-settings';

/**
 * Internal dependencies
 */
import { Edit, Save } from './edit';
import attributes from './attributes';
import metadata from './block.json';

registerFeaturePluginBlockType( metadata, {
	icon: {
		src: <Icon srcElement={ contact } />,
		foreground: '#874FB9',
	},
	attributes,
	edit: Edit,
	save: Save,
} );
assets/js/blocks/cart-checkout/checkout/inner-blocks/checkout-order-summary-block/block.tsx000064400000005266151335517640031757 0ustar00woocommerce-blocks/**
 * External dependencies
 */
import {
	OrderSummary,
	TotalsCoupon,
	TotalsDiscount,
	TotalsFooterItem,
	TotalsShipping,
} from '@woocommerce/base-components/cart-checkout';
import {
	Subtotal,
	TotalsFees,
	TotalsTaxes,
	ExperimentalOrderMeta,
	TotalsWrapper,
} from '@woocommerce/blocks-checkout';

import { getCurrencyFromPriceResponse } from '@woocommerce/price-format';
import { useShippingDataContext } from '@woocommerce/base-context';
import {
	useStoreCartCoupons,
	useStoreCart,
} from '@woocommerce/base-context/hooks';
import { getSetting } from '@woocommerce/settings';

/**
 * Internal dependencies
 */

const Block = ( {
	showRateAfterTaxName = false,
}: {
	showRateAfterTaxName: boolean;
} ): JSX.Element => {
	const { cartItems, cartTotals, cartCoupons, cartFees } = useStoreCart();
	const {
		applyCoupon,
		removeCoupon,
		isApplyingCoupon,
		isRemovingCoupon,
	} = useStoreCartCoupons();

	const { needsShipping } = useShippingDataContext();
	const totalsCurrency = getCurrencyFromPriceResponse( cartTotals );

	// Prepare props to pass to the ExperimentalOrderMeta slot fill.
	// We need to pluck out receiveCart.
	// eslint-disable-next-line no-unused-vars
	const { extensions, receiveCart, ...cart } = useStoreCart();
	const slotFillProps = {
		extensions,
		cart,
	};

	return (
		<>
			<TotalsWrapper>
				<OrderSummary cartItems={ cartItems } />
			</TotalsWrapper>
			<TotalsWrapper>
				<Subtotal currency={ totalsCurrency } values={ cartTotals } />
				<TotalsFees currency={ totalsCurrency } cartFees={ cartFees } />
				<TotalsDiscount
					cartCoupons={ cartCoupons }
					currency={ totalsCurrency }
					isRemovingCoupon={ isRemovingCoupon }
					removeCoupon={ removeCoupon }
					values={ cartTotals }
				/>
			</TotalsWrapper>
			{ getSetting( 'couponsEnabled', true ) && (
				<TotalsWrapper>
					<TotalsCoupon
						onSubmit={ applyCoupon }
						initialOpen={ false }
						isLoading={ isApplyingCoupon }
					/>
				</TotalsWrapper>
			) }
			{ needsShipping && (
				<TotalsWrapper>
					<TotalsShipping
						showCalculator={ false }
						showRateSelector={ false }
						values={ cartTotals }
						currency={ totalsCurrency }
					/>
				</TotalsWrapper>
			) }
			{ ! getSetting( 'displayCartPricesIncludingTax', false ) &&
				parseInt( cartTotals.total_tax, 10 ) > 0 && (
					<TotalsWrapper>
						<TotalsTaxes
							currency={ totalsCurrency }
							showRateAfterTaxName={ showRateAfterTaxName }
							values={ cartTotals }
						/>
					</TotalsWrapper>
				) }
			<TotalsWrapper>
				<TotalsFooterItem
					currency={ totalsCurrency }
					values={ cartTotals }
				/>
			</TotalsWrapper>
			<ExperimentalOrderMeta.Slot { ...slotFillProps } />
		</>
	);
};

export default Block;
assets/js/blocks/cart-checkout/checkout/inner-blocks/checkout-order-summary-block/attributes.tsx000064400000000454151335517640033045 0ustar00woocommerce-blocks/**
 * External dependencies
 */
import { getSetting } from '@woocommerce/settings';

export default {
	showRateAfterTaxName: {
		type: 'boolean',
		default: getSetting( 'displayCartPricesIncludingTax', false ),
	},
	lock: {
		type: 'object',
		default: {
			move: true,
			remove: true,
		},
	},
};
assets/js/blocks/cart-checkout/checkout/inner-blocks/checkout-order-summary-block/block.json000064400000001013151335517640032074 0ustar00woocommerce-blocks{
	"name": "woocommerce/checkout-order-summary-block",
	"version": "1.0.0",
	"title": "Order Summary",
	"description": "Show customers a summary of their order.",
	"category": "woocommerce",
	"supports": {
		"align": false,
		"html": false,
		"multiple": false,
		"reusable": false,
		"inserter": false
	},
	"attributes": {
		"lock": {
			"type": "object",
			"default": {
				"remove": true
			}
		}
	},
	"parent": [ "woocommerce/checkout-totals-block" ],
	"textdomain": "woo-gutenberg-products-block",
	"apiVersion": 2
}
assets/js/blocks/cart-checkout/checkout/inner-blocks/checkout-order-summary-block/edit.tsx000064400000003557151335517640031613 0ustar00woocommerce-blocks/**
 * External dependencies
 */
import { __ } from '@wordpress/i18n';
import { useBlockProps, InspectorControls } from '@wordpress/block-editor';
import { Disabled, PanelBody, ToggleControl } from '@wordpress/components';
import { getSetting } from '@woocommerce/settings';

/**
 * Internal dependencies
 */
import Block from './block';

export const Edit = ( {
	attributes,
	setAttributes,
}: {
	attributes: {
		showRateAfterTaxName: boolean;
		lock: {
			move: boolean;
			remove: boolean;
		};
	};
	setAttributes: ( attributes: Record< string, unknown > ) => void;
} ): JSX.Element => {
	const blockProps = useBlockProps();
	const taxesEnabled = getSetting( 'taxesEnabled' ) as boolean;
	const displayItemizedTaxes = getSetting(
		'displayItemizedTaxes',
		false
	) as boolean;
	const displayCartPricesIncludingTax = getSetting(
		'displayCartPricesIncludingTax',
		false
	) as boolean;
	return (
		<div { ...blockProps }>
			<InspectorControls>
				{ taxesEnabled &&
					displayItemizedTaxes &&
					! displayCartPricesIncludingTax && (
						<PanelBody
							title={ __(
								'Taxes',
								'woo-gutenberg-products-block'
							) }
						>
							<ToggleControl
								label={ __(
									'Show rate after tax name',
									'woo-gutenberg-products-block'
								) }
								help={ __(
									'Show the percentage rate alongside each tax line in the summary.',
									'woo-gutenberg-products-block'
								) }
								checked={ attributes.showRateAfterTaxName }
								onChange={ () =>
									setAttributes( {
										showRateAfterTaxName: ! attributes.showRateAfterTaxName,
									} )
								}
							/>
						</PanelBody>
					) }
			</InspectorControls>
			<Disabled>
				<Block
					showRateAfterTaxName={ attributes.showRateAfterTaxName }
				/>
			</Disabled>
		</div>
	);
};

export const Save = (): JSX.Element => {
	return <div { ...useBlockProps.save() } />;
};
assets/js/blocks/cart-checkout/checkout/inner-blocks/checkout-order-summary-block/index.tsx000064400000000733151335517640031766 0ustar00woocommerce-blocks/**
 * External dependencies
 */
import { Icon, totals } from '@woocommerce/icons';
import { registerFeaturePluginBlockType } from '@woocommerce/block-settings';

/**
 * Internal dependencies
 */
import { Edit, Save } from './edit';
import attributes from './attributes';
import metadata from './block.json';

registerFeaturePluginBlockType( metadata, {
	icon: {
		src: <Icon srcElement={ totals } />,
		foreground: '#874FB9',
	},
	attributes,
	edit: Edit,
	save: Save,
} );
assets/js/blocks/cart-checkout/checkout/inner-blocks/checkout-shipping-address-block/frontend.tsx000064400000003014151335517640033127 0ustar00woocommerce-blocks/**
 * External dependencies
 */
import withFilteredAttributes from '@woocommerce/base-hocs/with-filtered-attributes';
import { FormStep } from '@woocommerce/base-components/cart-checkout';
import { useCheckoutContext } from '@woocommerce/base-context';
import { useCheckoutAddress } from '@woocommerce/base-context/hooks';

/**
 * Internal dependencies
 */
import Block from './block';
import attributes from './attributes';
import { useCheckoutBlockContext } from '../../context';

const FrontendBlock = ( {
	title,
	description,
	showStepNumber,
	children,
}: {
	title: string;
	description: string;
	showStepNumber: boolean;
	children: JSX.Element;
} ) => {
	const { isProcessing: checkoutIsProcessing } = useCheckoutContext();
	const { showShippingFields } = useCheckoutAddress();
	const {
		requireCompanyField,
		requirePhoneField,
		showApartmentField,
		showCompanyField,
		showPhoneField,
	} = useCheckoutBlockContext();

	if ( ! showShippingFields ) {
		return null;
	}

	return (
		<FormStep
			id="shipping-fields"
			disabled={ checkoutIsProcessing }
			className="wc-block-checkout__shipping-fields"
			title={ title }
			description={ description }
			showStepNumber={ showStepNumber }
		>
			<Block
				requireCompanyField={ requireCompanyField }
				requirePhoneField={ requirePhoneField }
				showApartmentField={ showApartmentField }
				showCompanyField={ showCompanyField }
				showPhoneField={ showPhoneField }
			/>
			{ children }
		</FormStep>
	);
};

export default withFilteredAttributes( attributes )( FrontendBlock );
assets/js/blocks/cart-checkout/checkout/inner-blocks/checkout-shipping-address-block/block.json000064400000001044151335517640032536 0ustar00woocommerce-blocks{
	"name": "woocommerce/checkout-shipping-address-block",
	"version": "1.0.0",
	"title": "Shipping Address",
	"description": "Collect your customer's shipping address.",
	"category": "woocommerce",
	"supports": {
		"align": false,
		"html": false,
		"multiple": false,
		"reusable": false,
		"inserter": false
	},
	"attributes": {
		"lock": {
			"type": "object",
			"default": {
				"remove": true,
				"move": true
			}
		}
	},
	"parent": [ "woocommerce/checkout-fields-block" ],
	"textdomain": "woo-gutenberg-products-block",
	"apiVersion": 2
}
assets/js/blocks/cart-checkout/checkout/inner-blocks/checkout-shipping-address-block/attributes.tsx000064400000000764151335517640033507 0ustar00woocommerce-blocks/**
 * External dependencies
 */
import { __ } from '@wordpress/i18n';

/**
 * Internal dependencies
 */
import formStepAttributes from '../../form-step/attributes';

export default {
	...formStepAttributes( {
		defaultTitle: __( 'Shipping address', 'woo-gutenberg-products-block' ),
		defaultDescription: __(
			'Enter the address where you want your order delivered.',
			'woo-gutenberg-products-block'
		),
	} ),
	lock: {
		type: 'object',
		default: {
			move: true,
			remove: true,
		},
	},
};
assets/js/blocks/cart-checkout/checkout/inner-blocks/checkout-shipping-address-block/index.tsx000064400000000735151335517640032426 0ustar00woocommerce-blocks/**
 * External dependencies
 */
import { Icon, address } from '@woocommerce/icons';
import { registerFeaturePluginBlockType } from '@woocommerce/block-settings';

/**
 * Internal dependencies
 */
import { Edit, Save } from './edit';
import attributes from './attributes';
import metadata from './block.json';

registerFeaturePluginBlockType( metadata, {
	icon: {
		src: <Icon srcElement={ address } />,
		foreground: '#874FB9',
	},
	attributes,
	edit: Edit,
	save: Save,
} );
assets/js/blocks/cart-checkout/checkout/inner-blocks/checkout-shipping-address-block/block.tsx000064400000005222151335517640032405 0ustar00woocommerce-blocks/**
 * External dependencies
 */
import { __ } from '@wordpress/i18n';
import { useMemo, useEffect, Fragment } from '@wordpress/element';
import { Disabled } from 'wordpress-components';
import { AddressForm } from '@woocommerce/base-components/cart-checkout';
import {
	useCheckoutAddress,
	useStoreEvents,
	useEditorContext,
} from '@woocommerce/base-context';
import CheckboxControl from '@woocommerce/base-components/checkbox-control';

/**
 * Internal dependencies
 */
import PhoneNumber from '../../phone-number';

const Block = ( {
	showCompanyField = false,
	showApartmentField = false,
	showPhoneField = false,
	requireCompanyField = false,
	requirePhoneField = false,
}: {
	showCompanyField: boolean;
	showApartmentField: boolean;
	showPhoneField: boolean;
	requireCompanyField: boolean;
	requirePhoneField: boolean;
} ): JSX.Element => {
	const {
		defaultAddressFields,
		setShippingFields,
		shippingFields,
		setShippingAsBilling,
		shippingAsBilling,
		setShippingPhone,
	} = useCheckoutAddress();
	const { dispatchCheckoutEvent } = useStoreEvents();
	const { isEditor } = useEditorContext();

	// Clears data if fields are hidden.
	useEffect( () => {
		if ( ! showPhoneField ) {
			setShippingPhone( '' );
		}
	}, [ showPhoneField, setShippingPhone ] );

	const addressFieldsConfig = useMemo( () => {
		return {
			company: {
				hidden: ! showCompanyField,
				required: requireCompanyField,
			},
			address_2: {
				hidden: ! showApartmentField,
			},
		};
	}, [ showCompanyField, requireCompanyField, showApartmentField ] );

	const AddressFormWrapperComponent = isEditor ? Disabled : Fragment;

	return (
		<>
			<AddressFormWrapperComponent>
				<AddressForm
					id="shipping"
					type="shipping"
					onChange={ ( values: Record< string, unknown > ) => {
						setShippingFields( values );
						dispatchCheckoutEvent( 'set-shipping-address' );
					} }
					values={ shippingFields }
					fields={ Object.keys( defaultAddressFields ) }
					fieldConfig={ addressFieldsConfig }
				/>
				{ showPhoneField && (
					<PhoneNumber
						id="shipping-phone"
						isRequired={ requirePhoneField }
						value={ shippingFields.phone }
						onChange={ ( value ) => {
							setShippingPhone( value );
							dispatchCheckoutEvent( 'set-phone-number', {
								step: 'shipping',
							} );
						} }
					/>
				) }
			</AddressFormWrapperComponent>
			<CheckboxControl
				className="wc-block-checkout__use-address-for-billing"
				label={ __(
					'Use same address for billing',
					'woo-gutenberg-products-block'
				) }
				checked={ shippingAsBilling }
				onChange={ ( checked: boolean ) =>
					setShippingAsBilling( checked )
				}
			/>
		</>
	);
};

export default Block;
assets/js/blocks/cart-checkout/checkout/inner-blocks/checkout-shipping-address-block/edit.tsx000064400000002723151335517640032243 0ustar00woocommerce-blocks/**
 * External dependencies
 */
import { useBlockProps } from '@wordpress/block-editor';
import { innerBlockAreas } from '@woocommerce/blocks-checkout';

/**
 * Internal dependencies
 */
import {
	FormStepBlock,
	AdditionalFields,
	AdditionalFieldsContent,
} from '../../form-step';
import {
	useCheckoutBlockContext,
	useCheckoutBlockControlsContext,
} from '../../context';
import Block from './block';

export const Edit = ( {
	attributes,
	setAttributes,
}: {
	attributes: {
		title: string;
		description: string;
		showStepNumber: boolean;
	};
	setAttributes: ( attributes: Record< string, unknown > ) => void;
} ): JSX.Element => {
	const {
		showCompanyField,
		showApartmentField,
		requireCompanyField,
		showPhoneField,
		requirePhoneField,
	} = useCheckoutBlockContext();
	const {
		addressFieldControls: Controls,
	} = useCheckoutBlockControlsContext();
	return (
		<FormStepBlock
			setAttributes={ setAttributes }
			attributes={ attributes }
			className="wc-block-checkout__shipping-fields"
		>
			<Controls />
			<Block
				showCompanyField={ showCompanyField }
				showApartmentField={ showApartmentField }
				requireCompanyField={ requireCompanyField }
				showPhoneField={ showPhoneField }
				requirePhoneField={ requirePhoneField }
			/>
			<AdditionalFields block={ innerBlockAreas.SHIPPING_ADDRESS } />
		</FormStepBlock>
	);
};

export const Save = (): JSX.Element => {
	return (
		<div { ...useBlockProps.save() }>
			<AdditionalFieldsContent />
		</div>
	);
};
woocommerce-blocks/assets/js/blocks/cart-checkout/checkout/inner-blocks/register-components.ts000064400000007734151335517640027064 0ustar00/**
 * External dependencies
 */
import { lazy } from '@wordpress/element';
import { WC_BLOCKS_BUILD_URL } from '@woocommerce/block-settings';
import { registerCheckoutBlock } from '@woocommerce/blocks-checkout';

// Modify webpack publicPath at runtime based on location of WordPress Plugin.
// eslint-disable-next-line no-undef,camelcase
__webpack_public_path__ = WC_BLOCKS_BUILD_URL;

/**
 * Internal dependencies
 */
import checkoutActionsMetadata from './checkout-actions-block/block.json';
import checkoutBillingAddressMetadata from './checkout-billing-address-block/block.json';
import checkoutContactInformationMetadata from './checkout-contact-information-block/block.json';
import checkoutExpressPaymentMetadata from './checkout-express-payment-block/block.json';
import checkoutFieldsMetadata from './checkout-fields-block/block.json';
import checkoutOrderNoteMetadata from './checkout-order-note-block/block.json';
import checkoutOrderSummaryMetadata from './checkout-order-summary-block/block.json';
import checkoutPaymentMetadata from './checkout-payment-block/block.json';
import checkoutShippingAddressMetadata from './checkout-shipping-address-block/block.json';
import checkoutShippingMethodsMetadata from './checkout-shipping-methods-block/block.json';
import checkoutTermsMetadata from './checkout-terms-block/block.json';
import checkoutTotalsMetadata from './checkout-totals-block/block.json';

// @todo When forcing all blocks at once, they will append based on the order they are registered. Introduce formal sorting param.
registerCheckoutBlock( {
	metadata: checkoutFieldsMetadata,
	component: lazy( () =>
		import(
			/* webpackChunkName: "checkout-blocks/fields" */ './checkout-fields-block/frontend'
		)
	),
} );

registerCheckoutBlock( {
	metadata: checkoutExpressPaymentMetadata,
	component: lazy( () =>
		import(
			/* webpackChunkName: "checkout-blocks/express-payment" */ './checkout-express-payment-block/block'
		)
	),
} );

registerCheckoutBlock( {
	metadata: checkoutContactInformationMetadata,
	component: lazy( () =>
		import(
			/* webpackChunkName: "checkout-blocks/contact-information" */ './checkout-contact-information-block/frontend'
		)
	),
} );

registerCheckoutBlock( {
	metadata: checkoutShippingAddressMetadata,
	component: lazy( () =>
		import(
			/* webpackChunkName: "checkout-blocks/shipping-address" */ './checkout-shipping-address-block/frontend'
		)
	),
} );

registerCheckoutBlock( {
	metadata: checkoutBillingAddressMetadata,
	component: lazy( () =>
		import(
			/* webpackChunkName: "checkout-blocks/billing-address" */ './checkout-billing-address-block/frontend'
		)
	),
} );

registerCheckoutBlock( {
	metadata: checkoutShippingMethodsMetadata,
	component: lazy( () =>
		import(
			/* webpackChunkName: "checkout-blocks/shipping-methods" */ './checkout-shipping-methods-block/frontend'
		)
	),
} );

registerCheckoutBlock( {
	metadata: checkoutPaymentMetadata,
	component: lazy( () =>
		import(
			/* webpackChunkName: "checkout-blocks/payment" */ './checkout-payment-block/frontend'
		)
	),
} );

registerCheckoutBlock( {
	metadata: checkoutOrderNoteMetadata,
	component: lazy( () =>
		import(
			/* webpackChunkName: "checkout-blocks/order-note" */ './checkout-order-note-block/block'
		)
	),
} );

registerCheckoutBlock( {
	metadata: checkoutTermsMetadata,
	component: lazy( () =>
		import(
			/* webpackChunkName: "checkout-blocks/terms" */ './checkout-terms-block/frontend'
		)
	),
} );

registerCheckoutBlock( {
	metadata: checkoutActionsMetadata,
	component: lazy( () =>
		import(
			/* webpackChunkName: "checkout-blocks/actions" */ './checkout-actions-block/frontend'
		)
	),
} );

registerCheckoutBlock( {
	metadata: checkoutTotalsMetadata,
	component: lazy( () =>
		import(
			/* webpackChunkName: "checkout-blocks/totals" */ './checkout-totals-block/frontend'
		)
	),
} );

registerCheckoutBlock( {
	metadata: checkoutOrderSummaryMetadata,
	component: lazy( () =>
		import(
			/* webpackChunkName: "checkout-blocks/order-summary" */ './checkout-order-summary-block/block'
		)
	),
} );
assets/js/blocks/cart-checkout/checkout/inner-blocks/checkout-order-note-block/block.json000064400000001034151335517640031347 0ustar00woocommerce-blocks{
	"name": "woocommerce/checkout-order-note-block",
	"version": "1.0.0",
	"title": "Order Note",
	"description": "Allow customers to add a note to their order.",
	"category": "woocommerce",
	"supports": {
		"align": false,
		"html": false,
		"multiple": false,
		"reusable": false,
		"inserter": false
	},
	"attributes": {
		"lock": {
			"type": "object",
			"default": {
				"remove": true,
				"move": true
			}
		}
	},
	"parent": [ "woocommerce/checkout-fields-block" ],
	"textdomain": "woo-gutenberg-products-block",
	"apiVersion": 2
}
assets/js/blocks/cart-checkout/checkout/inner-blocks/checkout-order-note-block/block.tsx000064400000002200151335517640031210 0ustar00woocommerce-blocks/**
 * External dependencies
 */
import { __ } from '@wordpress/i18n';
import { FormStep } from '@woocommerce/base-components/cart-checkout';
import {
	useCheckoutContext,
	useShippingDataContext,
} from '@woocommerce/base-context';

/**
 * Internal dependencies
 */
import CheckoutOrderNotes from '../../order-notes';

const Block = (): JSX.Element => {
	const { needsShipping } = useShippingDataContext();
	const {
		isProcessing: checkoutIsProcessing,
		orderNotes,
		dispatchActions,
	} = useCheckoutContext();
	const { setOrderNotes } = dispatchActions;

	return (
		<FormStep
			id="order-notes"
			showStepNumber={ false }
			className="wc-block-checkout__order-notes"
			disabled={ checkoutIsProcessing }
		>
			<CheckoutOrderNotes
				disabled={ checkoutIsProcessing }
				onChange={ setOrderNotes }
				placeholder={
					needsShipping
						? __(
								'Notes about your order, e.g. special notes for delivery.',
								'woo-gutenberg-products-block'
						  )
						: __(
								'Notes about your order.',
								'woo-gutenberg-products-block'
						  )
				}
				value={ orderNotes }
			/>
		</FormStep>
	);
};

export default Block;
assets/js/blocks/cart-checkout/checkout/inner-blocks/checkout-order-note-block/edit.tsx000064400000000753151335517640031056 0ustar00woocommerce-blocks/**
 * External dependencies
 */
import { useBlockProps } from '@wordpress/block-editor';
import { Disabled } from '@wordpress/components';

/**
 * Internal dependencies
 */
import Block from './block';
import './editor.scss';

export const Edit = (): JSX.Element => {
	const blockProps = useBlockProps();
	return (
		<div { ...blockProps }>
			<Disabled>
				<Block />
			</Disabled>
		</div>
	);
};

export const Save = (): JSX.Element => {
	return <div { ...useBlockProps.save() } />;
};
assets/js/blocks/cart-checkout/checkout/inner-blocks/checkout-order-note-block/editor.scss000064400000000437151335517640031553 0ustar00woocommerce-blocks// Adjust padding and margins in the editor to improve selected block outlines.
.wp-block-woocommerce-checkout-order-note-block {
	margin-top: 20px;
	margin-bottom: 20px;
	padding-top: 4px;
	padding-bottom: 4px;

	.wc-block-checkout__add-note {
		margin-top: 0;
		margin-bottom: 0;
	}
}
assets/js/blocks/cart-checkout/checkout/inner-blocks/checkout-order-note-block/index.tsx000064400000000645151335517640031240 0ustar00woocommerce-blocks/**
 * External dependencies
 */
import { Icon, notes } from '@woocommerce/icons';
import { registerFeaturePluginBlockType } from '@woocommerce/block-settings';

/**
 * Internal dependencies
 */
import { Edit, Save } from './edit';
import metadata from './block.json';

registerFeaturePluginBlockType( metadata, {
	icon: {
		src: <Icon srcElement={ notes } />,
		foreground: '#874FB9',
	},
	edit: Edit,
	save: Save,
} );
assets/js/blocks/cart-checkout/checkout/inner-blocks/checkout-actions-block/index.tsx000064400000000723151335517640030617 0ustar00woocommerce-blocks/**
 * External dependencies
 */
import { Icon, button } from '@wordpress/icons';
import { registerFeaturePluginBlockType } from '@woocommerce/block-settings';

/**
 * Internal dependencies
 */
import attributes from './attributes';
import { Edit, Save } from './edit';
import metadata from './block.json';

registerFeaturePluginBlockType( metadata, {
	icon: {
		src: <Icon icon={ button } />,
		foreground: '#874FB9',
	},
	attributes,
	edit: Edit,
	save: Save,
} );
assets/js/blocks/cart-checkout/checkout/inner-blocks/checkout-actions-block/edit.tsx000064400000004455151335517640030443 0ustar00woocommerce-blocks/**
 * External dependencies
 */
import { useRef } from '@wordpress/element';
import { useSelect } from '@wordpress/data';
import { __ } from '@wordpress/i18n';
import { InspectorControls, useBlockProps } from '@wordpress/block-editor';
import PageSelector from '@woocommerce/editor-components/page-selector';
import { PanelBody, ToggleControl, Disabled } from '@wordpress/components';
import { CHECKOUT_PAGE_ID } from '@woocommerce/block-settings';
/**
 * Internal dependencies
 */
import Block from './block';

export const Edit = ( {
	attributes,
	setAttributes,
}: {
	attributes: {
		showReturnToCart: boolean;
		cartPageId: number;
	};
	setAttributes: ( attributes: Record< string, unknown > ) => void;
} ): JSX.Element => {
	const blockProps = useBlockProps();
	const { cartPageId = 0, showReturnToCart = true } = attributes;
	const { current: savedCartPageId } = useRef( cartPageId );
	const currentPostId = useSelect(
		( select ) => {
			if ( ! savedCartPageId ) {
				const store = select( 'core/editor' );
				return store.getCurrentPostId();
			}
			return savedCartPageId;
		},
		[ savedCartPageId ]
	);

	return (
		<div { ...blockProps }>
			<InspectorControls>
				<PanelBody
					title={ __(
						'Account options',
						'woo-gutenberg-products-block'
					) }
				>
					<ToggleControl
						label={ __(
							'Show a "Return to Cart" link',
							'woo-gutenberg-products-block'
						) }
						checked={ showReturnToCart }
						onChange={ () =>
							setAttributes( {
								showReturnToCart: ! showReturnToCart,
							} )
						}
					/>
				</PanelBody>
				{ showReturnToCart &&
					! (
						currentPostId === CHECKOUT_PAGE_ID &&
						savedCartPageId === 0
					) && (
						<PageSelector
							pageId={ cartPageId }
							setPageId={ ( id: number ) =>
								setAttributes( { cartPageId: id } )
							}
							labels={ {
								title: __(
									'Return to Cart button',
									'woo-gutenberg-products-block'
								),
								default: __(
									'WooCommerce Cart Page',
									'woo-gutenberg-products-block'
								),
							} }
						/>
					) }
			</InspectorControls>
			<Disabled>
				<Block
					showReturnToCart={ showReturnToCart }
					cartPageId={ cartPageId }
				/>
			</Disabled>
		</div>
	);
};

export const Save = (): JSX.Element => {
	return <div { ...useBlockProps.save() } />;
};
assets/js/blocks/cart-checkout/checkout/inner-blocks/checkout-actions-block/style.scss000064400000001217151335517640031004 0ustar00woocommerce-blocks.wc-block-checkout__actions {
	display: flex;
	justify-content: space-between;
	align-items: center;

	.wc-block-components-checkout-place-order-button {
		width: 50%;
		padding: 1em;
		height: auto;

		.wc-block-components-button__text {
			line-height: 24px;

			> svg {
				fill: $white;
				vertical-align: top;
			}
		}
	}
}

.is-mobile {
	.wc-block-checkout__actions {
		.wc-block-components-checkout-return-to-cart-button {
			display: none;
		}

		.wc-block-components-checkout-place-order-button {
			width: 100%;
		}
	}
}

.is-large {
	.wc-block-checkout__actions {
		@include with-translucent-border(1px 0 0);
		padding: em($gap-large) 0;
	}
}
assets/js/blocks/cart-checkout/checkout/inner-blocks/checkout-actions-block/frontend.tsx000064400000000434151335517640031326 0ustar00woocommerce-blocks/**
 * External dependencies
 */
import withFilteredAttributes from '@woocommerce/base-hocs/with-filtered-attributes';

/**
 * Internal dependencies
 */
import Block from './block';
import attributes from './attributes';

export default withFilteredAttributes( attributes )( Block );
assets/js/blocks/cart-checkout/checkout/inner-blocks/checkout-actions-block/block.json000064400000001016151335517640030731 0ustar00woocommerce-blocks{
	"name": "woocommerce/checkout-actions-block",
	"version": "1.0.0",
	"title": "Actions",
	"description": "Allow customers to place their order.",
	"category": "woocommerce",
	"supports": {
		"align": false,
		"html": false,
		"multiple": false,
		"reusable": false,
		"inserter": false
	},
	"attributes": {
		"lock": {
			"type": "object",
			"default": {
				"remove": true,
				"move": true
			}
		}
	},
	"parent": [ "woocommerce/checkout-fields-block" ],
	"textdomain": "woo-gutenberg-products-block",
	"apiVersion": 2
}
assets/js/blocks/cart-checkout/checkout/inner-blocks/checkout-actions-block/attributes.tsx000064400000000325151335517640031674 0ustar00woocommerce-blocksexport default {
	cartPageId: {
		type: 'number',
		default: 0,
	},
	showReturnToCart: {
		type: 'boolean',
		default: true,
	},
	lock: {
		type: 'object',
		default: {
			move: true,
			remove: true,
		},
	},
};
assets/js/blocks/cart-checkout/checkout/inner-blocks/checkout-actions-block/block.tsx000064400000001144151335517640030600 0ustar00woocommerce-blocks/**
 * External dependencies
 */
import { getSetting } from '@woocommerce/settings';
import {
	PlaceOrderButton,
	ReturnToCartButton,
} from '@woocommerce/base-components/cart-checkout';

/**
 * Internal dependencies
 */
import './style.scss';

const Block = ( {
	cartPageId,
	showReturnToCart,
}: {
	cartPageId: number;
	showReturnToCart: boolean;
} ): JSX.Element => {
	return (
		<div className="wc-block-checkout__actions">
			{ showReturnToCart && (
				<ReturnToCartButton
					link={ getSetting( 'page-' + cartPageId, false ) }
				/>
			) }
			<PlaceOrderButton />
		</div>
	);
};

export default Block;
assets/js/blocks/cart-checkout/checkout/inner-blocks/checkout-fields-block/style.scss000064400000002024151335517640030607 0ustar00woocommerce-blocks.wc-block-checkout__form {
	margin: 0;
	max-width: 100%;
}
.is-mobile,
.is-small,
.is-medium {
	.wc-block-checkout__main {
		order: 1;
	}
}
.is-small,
.is-medium,
.is-large {
	.wc-block-checkout__shipping-fields,
	.wc-block-checkout__billing-fields {
		.wc-block-components-address-form {
			margin-left: #{-$gap-small * 0.5};
			margin-right: #{-$gap-small * 0.5};

			&::after {
				content: "";
				clear: both;
				display: block;
			}

			.wc-block-components-text-input,
			.wc-block-components-country-input,
			.wc-block-components-state-input {
				float: left;
				margin-left: #{$gap-small * 0.5};
				margin-right: #{$gap-small * 0.5};
				position: relative;
				width: calc(50% - #{$gap-small});

				&:nth-of-type(2),
				&:first-of-type {
					margin-top: 0;
				}
			}

			.wc-block-components-address-form__company,
			.wc-block-components-address-form__address_1,
			.wc-block-components-address-form__address_2 {
				width: calc(100% - #{$gap-small});
			}

			.wc-block-components-checkbox {
				clear: both;
			}
		}
	}
}
assets/js/blocks/cart-checkout/checkout/inner-blocks/checkout-fields-block/frontend.tsx000064400000000701151335517640031131 0ustar00woocommerce-blocks/**
 * External dependencies
 */
import { Main } from '@woocommerce/base-components/sidebar-layout';

/**
 * Internal dependencies
 */
import './style.scss';

const FrontendBlock = ( {
	children,
}: {
	children: JSX.Element;
} ): JSX.Element => {
	return (
		<Main className="wc-block-checkout__main">
			<form className="wc-block-components-form wc-block-checkout__form">
				{ children }
			</form>
		</Main>
	);
};

export default FrontendBlock;
assets/js/blocks/cart-checkout/checkout/inner-blocks/checkout-fields-block/index.tsx000064400000000637151335517640030431 0ustar00woocommerce-blocks/**
 * External dependencies
 */
import { Icon, column } from '@wordpress/icons';
import { registerFeaturePluginBlockType } from '@woocommerce/block-settings';

/**
 * Internal dependencies
 */
import { Edit, Save } from './edit';
import metadata from './block.json';

registerFeaturePluginBlockType( metadata, {
	icon: {
		src: <Icon icon={ column } />,
		foreground: '#874FB9',
	},
	edit: Edit,
	save: Save,
} );
assets/js/blocks/cart-checkout/checkout/inner-blocks/checkout-fields-block/block.json000064400000001015151335517640030536 0ustar00woocommerce-blocks{
	"name": "woocommerce/checkout-fields-block",
	"version": "1.0.0",
	"title": "Checkout Fields",
	"description": "Column containing checkout address fields.",
	"category": "woocommerce",
	"supports": {
		"align": false,
		"html": false,
		"multiple": false,
		"reusable": false,
		"inserter": false
	},
	"attributes": {
		"lock": {
			"type": "object",
			"default": {
				"remove": true,
				"move": true
			}
		}
	},
	"parent": [ "woocommerce/checkout" ],
	"textdomain": "woo-gutenberg-products-block",
	"apiVersion": 2
}
assets/js/blocks/cart-checkout/checkout/inner-blocks/checkout-fields-block/edit.tsx000064400000002427151335517640030246 0ustar00woocommerce-blocks/**
 * External dependencies
 */
import { useBlockProps, InnerBlocks } from '@wordpress/block-editor';
import { Main } from '@woocommerce/base-components/sidebar-layout';
import { innerBlockAreas } from '@woocommerce/blocks-checkout';

/**
 * Internal dependencies
 */
import { useCheckoutBlockControlsContext } from '../../context';
import { useForcedLayout } from '../../use-forced-layout';
import { getAllowedBlocks } from '../../editor-utils';
import './style.scss';

export const Edit = ( { clientId }: { clientId: string } ): JSX.Element => {
	const blockProps = useBlockProps();
	const allowedBlocks = getAllowedBlocks( innerBlockAreas.CHECKOUT_FIELDS );

	const {
		addressFieldControls: Controls,
	} = useCheckoutBlockControlsContext();

	useForcedLayout( {
		clientId,
		template: allowedBlocks,
	} );
	return (
		<Main className="wc-block-checkout__main">
			<div { ...blockProps }>
				<Controls />
				<form className="wc-block-components-form wc-block-checkout__form">
					<InnerBlocks
						allowedBlocks={ allowedBlocks }
						templateLock={ false }
						renderAppender={ InnerBlocks.ButtonBlockAppender }
					/>
				</form>
			</div>
		</Main>
	);
};

export const Save = (): JSX.Element => {
	return (
		<div { ...useBlockProps.save() }>
			<InnerBlocks.Content />
		</div>
	);
};
woocommerce-blocks/assets/js/blocks/cart-checkout/checkout/utils.ts000064400000000735151335517640021621 0ustar00/**
 * External dependencies
 */
import { LOGIN_URL } from '@woocommerce/block-settings';
import { getSetting } from '@woocommerce/settings';

export const LOGIN_TO_CHECKOUT_URL = `${ LOGIN_URL }?redirect_to=${ encodeURIComponent(
	window.location.href
) }`;

export const isLoginRequired = ( customerId: number ): boolean => {
	return ! customerId && ! getSetting( 'checkoutAllowsGuest', false );
};

export const reloadPage = (): void => void window.location.reload( true );
woocommerce-blocks/assets/js/blocks/cart-checkout/checkout/styles/editor.scss000064400000002404151335517640023612 0ustar00.wp-block-woocommerce-checkout {
	.wc-block-components-sidebar-layout {
		display: block;
	}
	.block-editor-block-list__layout {
		display: flex;
		flex-flow: row wrap;
		align-items: flex-start;

		.wc-block-checkout__additional_fields {
			padding: 0;
		}
	}
	.wc-block-components-main,
	.wc-block-components-sidebar,
	.block-editor-block-list__layout {
		> :first-child {
			margin-top: 0;
		}
	}
	.wp-block-woocommerce-checkout-totals-block,
	.wp-block-woocommerce-checkout-fields-block {
		.block-editor-block-list__layout {
			display: block;
		}
	}
}

body.wc-lock-selected-block--move {
	.block-editor-block-mover__move-button-container,
	.block-editor-block-mover {
		display: none;
	}
}

body.wc-lock-selected-block--remove {
	.block-editor-block-settings-menu__popover {
		.components-menu-group:last-child {
			display: none;
		}
		.components-menu-group:nth-last-child(2) {
			margin-bottom: -12px;
		}
	}
}

.wc-block-checkout__controls-text {
	color: #999;
	font-style: italic;
}

.components-base-control--nested {
	padding-left: 52px;
	margin-top: -12px;
}

.wc-block-checkout__page-notice {
	margin: 0;
}

.components-panel__body-title .components-button {
	opacity: 1;
}

.wp-block-woocommerce-checkout.is-editor-preview {
	max-height: 1000px;
	overflow: hidden;
}
woocommerce-blocks/assets/js/blocks/cart-checkout/checkout/styles/style.scss000064400000004402151335517640023464 0ustar00.wp-block-woocommerce-checkout {
	margin: 0;

	.with-scroll-to-top__scroll-point {
		top: -96px;
	}
}

.wp-block-woocommerce-checkout.is-loading {
	display: flex;
	flex-wrap: wrap;
	margin: 0 auto $gap;
	position: relative;
	.wp-block-woocommerce-checkout-totals-block {
		width: 35%;
		padding-left: percentage(math.div($gap-large, 1060px));
	}
	.wp-block-woocommerce-checkout-fields-block {
		width: 65%;
		padding-right: percentage(math.div($gap-largest, 1060px)); // ~1060px is the default width of the content area in Storefront.
	}
	.wp-block-woocommerce-checkout-totals-block,
	.wp-block-woocommerce-checkout-fields-block {
		box-sizing: border-box;
		margin: 0;

		> div {
			@include placeholder();
			margin: 0 0 1.5em 0;
			display: none;
		}
		.wp-block-woocommerce-checkout-contact-information-block,
		.wp-block-woocommerce-checkout-payment-block {
			min-height: 10em;
			display: block;
		}
		.wp-block-woocommerce-checkout-shipping-address-block {
			min-height: 24em;
			display: block;
		}
		.wp-block-woocommerce-checkout-actions-block {
			width: 50%;
			min-height: 4em;
			margin-left: 50%;
			display: block;
		}
		.wp-block-woocommerce-checkout-order-summary-block {
			min-height: 47em;
			display: block;
		}
		.wc-block-components-panel > h2 {
			@include font-size(regular);
			@include reset-box();
			@include reset-typography();
			.wc-block-components-panel__button {
				font-weight: 400;
			}
		}
		.wc-block-components-totals-item,
		.wc-block-components-panel {
			padding-left: $gap;
			padding-right: $gap;
		}
	}
}
// Skeleton is shown before mobile classes are appended.
@media only screen and (max-width: 700px) {
	.wp-block-woocommerce-checkout.is-loading {
		flex-direction: column;
		margin: 0 auto $gap;

		.wp-block-woocommerce-checkout-fields-block {
			padding: 0;
			width: 100%;
		}
		.wp-block-woocommerce-checkout-totals-block {
			padding: 0;
			width: 100%;
			.wc-block-components-totals-item,
			.wc-block-components-panel {
				padding-left: 0;
				padding-right: 0;
			}
		}
	}
}

// For Twenty Twenty we need to increase specificity a bit more.
.theme-twentytwenty .wp-block-woocommerce-checkout.is-loading {
	.wp-block-woocommerce-checkout-totals-block .wc-block-components-panel > h2 {
		@include font-size(large);
		@include reset-box();
	}
}
woocommerce-blocks/assets/js/blocks/cart-checkout/checkout/index.tsx000064400000002361151335517640021755 0ustar00/**
 * External dependencies
 */
import { __ } from '@wordpress/i18n';
import classnames from 'classnames';
import { Icon, fields } from '@woocommerce/icons';
import { registerFeaturePluginBlockType } from '@woocommerce/block-settings';

/**
 * Internal dependencies
 */
import { Edit, Save } from './edit';
import { blockName, blockAttributes } from './attributes';
import './inner-blocks';

const settings = {
	title: __( 'Checkout', 'woo-gutenberg-products-block' ),
	icon: {
		src: <Icon srcElement={ fields } />,
		foreground: '#874FB9',
	},
	category: 'woocommerce',
	keywords: [ __( 'WooCommerce', 'woo-gutenberg-products-block' ) ],
	description: __(
		'Display a checkout form so your customers can submit orders.',
		'woo-gutenberg-products-block'
	),
	supports: {
		align: [ 'wide', 'full' ],
		html: false,
		multiple: false,
	},
	attributes: blockAttributes,
	apiVersion: 2,
	edit: Edit,
	save: Save,
	// Migrates v1 to v2 checkout.
	deprecated: [
		{
			attributes: blockAttributes,
			save( { attributes }: { attributes: { className: string } } ) {
				return (
					<div
						className={ classnames(
							'is-loading',
							attributes.className
						) }
					/>
				);
			},
		},
	],
};

registerFeaturePluginBlockType( blockName, settings );
woocommerce-blocks/assets/js/blocks/cart-checkout/checkout/empty-cart/index.js000064400000002013151335517640023632 0ustar00/**
 * External dependencies
 */
import { __ } from '@wordpress/i18n';
import { SHOP_URL } from '@woocommerce/block-settings';
import { Icon, cart } from '@woocommerce/icons';

/**
 * Internal dependencies
 */
import './style.scss';

const EmptyCart = () => {
	return (
		<div className="wc-block-checkout-empty">
			<Icon
				className="wc-block-checkout-empty__image"
				alt=""
				srcElement={ cart }
				size={ 100 }
			/>
			<strong className="wc-block-checkout-empty__title">
				{ __( 'Your cart is empty!', 'woocommerce' ) }
			</strong>
			<p className="wc-block-checkout-empty__description">
				{ __(
					"Checkout is not available whilst your cart is empty—please take a look through our store and come back when you're ready to place an order.",
					'woocommerce'
				) }
			</p>
			{ SHOP_URL && (
				<span className="wp-block-button">
					<a href={ SHOP_URL } className="wp-block-button__link">
						{ __( 'Browse store', 'woocommerce' ) }
					</a>
				</span>
			) }
		</div>
	);
};

export default EmptyCart;
woocommerce-blocks/assets/js/blocks/cart-checkout/checkout/empty-cart/style.scss000064400000000577151335517640024237 0ustar00.wc-block-checkout-empty {
	padding: $gap-largest;
	text-align: center;
	width: 100%;

	.wc-block-checkout-empty__image {
		max-width: 150px;
		margin: 0 auto 1em;
		display: block;
		color: inherit;
	}
	.wc-block-checkout-empty__title {
		display: block;
		margin: 0;
		font-weight: bold;
	}
	.wc-block-checkout-empty__description {
		display: block;
		margin: 0.25em 0 1em 0;
	}
}
woocommerce-blocks/assets/js/blocks/cart-checkout/checkout/checkout-order-error/index.js000064400000006550151335517640025624 0ustar00/**
 * External dependencies
 */
import { __ } from '@wordpress/i18n';
import { CART_URL } from '@woocommerce/block-settings';
import { Icon, removeCart } from '@woocommerce/icons';
import { getSetting } from '@woocommerce/settings';
import { decodeEntities } from '@wordpress/html-entities';

/**
 * Internal dependencies
 */
import './style.scss';
import {
	PRODUCT_OUT_OF_STOCK,
	PRODUCT_NOT_PURCHASABLE,
	PRODUCT_NOT_ENOUGH_STOCK,
	PRODUCT_SOLD_INDIVIDUALLY,
	GENERIC_CART_ITEM_ERROR,
} from './constants';

const cartItemErrorCodes = [
	PRODUCT_OUT_OF_STOCK,
	PRODUCT_NOT_PURCHASABLE,
	PRODUCT_NOT_ENOUGH_STOCK,
	PRODUCT_SOLD_INDIVIDUALLY,
	GENERIC_CART_ITEM_ERROR,
];

/**
 * When an order was not created for the checkout, for example, when an item
 * was out of stock, this component will be shown instead of the checkout form.
 *
 * The error message is derived by the hydrated API request passed to the
 * checkout block.
 */
const CheckoutOrderError = () => {
	const preloadedApiRequests = getSetting( 'preloadedApiRequests', {} );
	const checkoutData = {
		code: '',
		message: '',
		...( preloadedApiRequests[ '/wc/store/checkout' ]?.body || {} ),
	};

	const errorData = {
		code: checkoutData.code || 'unknown',
		message:
			decodeEntities( checkoutData.message ) ||
			__(
				'There was a problem checking out. Please try again. If the problem persists, please get in touch with us so we can assist.',
				'woocommerce'
			),
	};

	return (
		<div className="wc-block-checkout-error">
			<Icon
				className="wc-block-checkout-error__image"
				alt=""
				srcElement={ removeCart }
				size={ 100 }
			/>
			<ErrorTitle errorData={ errorData } />
			<ErrorMessage errorData={ errorData } />
			<ErrorButton errorData={ errorData } />
		</div>
	);
};

/**
 * Get the error message to display.
 *
 * @param {Object} props Incoming props for the component.
 * @param {Object} props.errorData Object containing code and message.
 */
const ErrorTitle = ( { errorData } ) => {
	let heading = __( 'Checkout error', 'woocommerce' );

	if ( cartItemErrorCodes.includes( errorData.code ) ) {
		heading = __(
			'There is a problem with your cart',
			'woocommerce'
		);
	}

	return (
		<strong className="wc-block-checkout-error_title">{ heading }</strong>
	);
};

/**
 * Get the error message to display.
 *
 * @param {Object} props Incoming props for the component.
 * @param {Object} props.errorData Object containing code and message.
 */
const ErrorMessage = ( { errorData } ) => {
	let message = errorData.message;

	if ( cartItemErrorCodes.includes( errorData.code ) ) {
		message =
			message +
			' ' +
			__(
				'Please edit your cart and try again.',
				'woocommerce'
			);
	}

	return <p className="wc-block-checkout-error__description">{ message }</p>;
};

/**
 * Get the CTA button to display.
 *
 * @param {Object} props Incoming props for the component.
 * @param {Object} props.errorData Object containing code and message.
 */
const ErrorButton = ( { errorData } ) => {
	let buttonText = __( 'Retry', 'woocommerce' );
	let buttonUrl = 'javascript:window.location.reload(true)';

	if ( cartItemErrorCodes.includes( errorData.code ) ) {
		buttonText = __( 'Edit your cart', 'woocommerce' );
		buttonUrl = CART_URL;
	}

	return (
		<span className="wp-block-button">
			<a href={ buttonUrl } className="wp-block-button__link">
				{ buttonText }
			</a>
		</span>
	);
};

export default CheckoutOrderError;
woocommerce-blocks/assets/js/blocks/cart-checkout/checkout/checkout-order-error/constants.js000064400000000637151335517640026531 0ustar00export const PRODUCT_OUT_OF_STOCK = 'woocommerce_product_out_of_stock';
export const PRODUCT_NOT_PURCHASABLE =
	'woocommerce_rest_cart_product_is_not_purchasable';
export const PRODUCT_NOT_ENOUGH_STOCK =
	'woocommerce_rest_cart_product_no_stock';
export const PRODUCT_SOLD_INDIVIDUALLY =
	'woocommerce_rest_cart_product_sold_individually';
export const GENERIC_CART_ITEM_ERROR = 'woocommerce_rest_cart_item_error';
woocommerce-blocks/assets/js/blocks/cart-checkout/checkout/checkout-order-error/style.scss000064400000000577151335517640026217 0ustar00.wc-block-checkout-error {
	padding: $gap-largest;
	text-align: center;
	width: 100%;

	.wc-block-checkout-error__image {
		max-width: 150px;
		margin: 0 auto 1em;
		display: block;
		color: inherit;
	}
	.wc-block-checkout-error__title {
		display: block;
		margin: 0;
		font-weight: bold;
	}
	.wc-block-checkout-error__description {
		display: block;
		margin: 0.25em 0 1em 0;
	}
}
woocommerce-blocks/assets/js/blocks/cart-checkout/checkout/phone-number/index.tsx000064400000001335151335517640024354 0ustar00/**
 * External dependencies
 */
import { __ } from '@wordpress/i18n';
import { ValidatedTextInput } from '@woocommerce/base-components/text-input';

/**
 * Renders a phone number input.
 */
const PhoneNumber = ( {
	id = 'phone',
	isRequired = false,
	value = '',
	onChange,
}: {
	id?: string;
	isRequired: boolean;
	value: string;
	onChange: ( value: string ) => void;
} ): JSX.Element => {
	return (
		<ValidatedTextInput
			id={ id }
			type="tel"
			autoComplete="tel"
			required={ isRequired }
			label={
				isRequired
					? __( 'Phone', 'woo-gutenberg-products-block' )
					: __( 'Phone (optional)', 'woo-gutenberg-products-block' )
			}
			value={ value }
			onChange={ onChange }
		/>
	);
};

export default PhoneNumber;
woocommerce-blocks/assets/js/blocks/cart-checkout/checkout/block.tsx000064400000011644151335517640021744 0ustar00/**
 * External dependencies
 */
import { __ } from '@wordpress/i18n';
import classnames from 'classnames';
import { createInterpolateElement, useEffect } from '@wordpress/element';
import { useStoreCart, useStoreNotices } from '@woocommerce/base-context/hooks';
import {
	useCheckoutContext,
	useValidationContext,
	ValidationContextProvider,
	StoreNoticesProvider,
	CheckoutProvider,
} from '@woocommerce/base-context';
import { StoreSnackbarNoticesProvider } from '@woocommerce/base-context/providers';
import BlockErrorBoundary from '@woocommerce/base-components/block-error-boundary';
import { SidebarLayout } from '@woocommerce/base-components/sidebar-layout';
import { CURRENT_USER_IS_ADMIN, getSetting } from '@woocommerce/settings';
import { SlotFillProvider } from '@woocommerce/blocks-checkout';
import withScrollToTop from '@woocommerce/base-hocs/with-scroll-to-top';

/**
 * Internal dependencies
 */
import './styles/style.scss';
import EmptyCart from './empty-cart';
import CheckoutOrderError from './checkout-order-error';
import { LOGIN_TO_CHECKOUT_URL, isLoginRequired, reloadPage } from './utils';
import type { Attributes } from './types';
import { CheckoutBlockContext } from './context';

const LoginPrompt = () => {
	return (
		<>
			{ __(
				'You must be logged in to checkout. ',
				'woo-gutenberg-products-block'
			) }
			<a href={ LOGIN_TO_CHECKOUT_URL }>
				{ __(
					'Click here to log in.',
					'woo-gutenberg-products-block'
				) }
			</a>
		</>
	);
};

const Checkout = ( {
	attributes,
	children,
}: {
	attributes: Attributes;
	children: React.ReactChildren;
} ): JSX.Element => {
	const { hasOrder, customerId } = useCheckoutContext();
	const { cartItems, cartIsLoading } = useStoreCart();

	const {
		allowCreateAccount,
		showCompanyField,
		requireCompanyField,
		showApartmentField,
		showPhoneField,
		requirePhoneField,
	} = attributes;

	if ( ! cartIsLoading && cartItems.length === 0 ) {
		return <EmptyCart />;
	}

	if ( ! hasOrder ) {
		return <CheckoutOrderError />;
	}

	if (
		isLoginRequired( customerId ) &&
		allowCreateAccount &&
		getSetting( 'checkoutAllowsSignup', false )
	) {
		<LoginPrompt />;
	}

	return (
		<CheckoutBlockContext.Provider
			value={ {
				allowCreateAccount,
				showCompanyField,
				requireCompanyField,
				showApartmentField,
				showPhoneField,
				requirePhoneField,
			} }
		>
			{ children }
		</CheckoutBlockContext.Provider>
	);
};

const ScrollOnError = ( {
	scrollToTop,
}: {
	scrollToTop: ( props: Record< string, unknown > ) => void;
} ): null => {
	const { hasNoticesOfType } = useStoreNotices();
	const {
		hasError: checkoutHasError,
		isIdle: checkoutIsIdle,
	} = useCheckoutContext();
	const {
		hasValidationErrors,
		showAllValidationErrors,
	} = useValidationContext();

	const hasErrorsToDisplay =
		checkoutIsIdle &&
		checkoutHasError &&
		( hasValidationErrors || hasNoticesOfType( 'default' ) );

	useEffect( () => {
		let scrollToTopTimeout: number;
		if ( hasErrorsToDisplay ) {
			showAllValidationErrors();
			// Scroll after a short timeout to allow a re-render. This will allow focusableSelector to match updated components.
			scrollToTopTimeout = window.setTimeout( () => {
				scrollToTop( {
					focusableSelector: 'input:invalid, .has-error input',
				} );
			}, 50 );
		}
		return () => {
			clearTimeout( scrollToTopTimeout );
		};
	}, [ hasErrorsToDisplay, scrollToTop, showAllValidationErrors ] );

	return null;
};

const Block = ( {
	attributes,
	children,
	scrollToTop,
}: {
	attributes: Attributes;
	children: React.ReactChildren;
	scrollToTop: ( props: Record< string, unknown > ) => void;
} ): JSX.Element => (
	<BlockErrorBoundary
		header={ __( 'Something went wrong…', 'woo-gutenberg-products-block' ) }
		text={ createInterpolateElement(
			__(
				'The checkout has encountered an unexpected error. <button>Try reloading the page</button>. If the error persists, please get in touch with us so we can assist.',
				'woo-gutenberg-products-block'
			),
			{
				button: (
					<button
						className="wc-block-link-button"
						onClick={ reloadPage }
					/>
				),
			}
		) }
		showErrorMessage={ CURRENT_USER_IS_ADMIN }
	>
		<StoreSnackbarNoticesProvider context="wc/checkout">
			<StoreNoticesProvider context="wc/checkout">
				<ValidationContextProvider>
					{ /* SlotFillProvider need to be defined before CheckoutProvider so fills have the SlotFill context ready when they mount. */ }
					<SlotFillProvider>
						<CheckoutProvider>
							<SidebarLayout
								className={ classnames( 'wc-block-checkout', {
									'has-dark-controls':
										attributes.hasDarkControls,
								} ) }
							>
								<Checkout attributes={ attributes }>
									{ children }
								</Checkout>
								<ScrollOnError scrollToTop={ scrollToTop } />
							</SidebarLayout>
						</CheckoutProvider>
					</SlotFillProvider>
				</ValidationContextProvider>
			</StoreNoticesProvider>
		</StoreSnackbarNoticesProvider>
	</BlockErrorBoundary>
);

export default withScrollToTop( Block );
woocommerce-blocks/assets/js/blocks/cart-checkout/checkout/form-step/additional-fields.tsx000064400000001414151335517640026134 0ustar00/**
 * External dependencies
 */
import { InnerBlocks, useBlockProps } from '@wordpress/block-editor';

/**
 * Internal dependencies
 */
import './editor.scss';
import { useForcedLayout } from '../use-forced-layout';
import { getAllowedBlocks } from '../editor-utils';

export const AdditionalFields = ( {
	block,
}: {
	// Name of the parent block.
	block: string;
} ): JSX.Element => {
	const { 'data-block': clientId } = useBlockProps();
	const allowedBlocks = getAllowedBlocks( block );

	useForcedLayout( {
		clientId,
		template: allowedBlocks,
	} );

	return (
		<div className="wc-block-checkout__additional_fields">
			<InnerBlocks allowedBlocks={ allowedBlocks } />
		</div>
	);
};

export const AdditionalFieldsContent = (): JSX.Element => (
	<InnerBlocks.Content />
);
woocommerce-blocks/assets/js/blocks/cart-checkout/checkout/form-step/form-step-block.tsx000064400000004534151335517640025572 0ustar00/**
 * External dependencies
 */
import { __ } from '@wordpress/i18n';
import classnames from 'classnames';
import {
	PlainText,
	InspectorControls,
	useBlockProps,
} from '@wordpress/block-editor';
import { PanelBody, ToggleControl } from '@wordpress/components';

/**
 * Internal dependencies
 */
import FormStepHeading from './form-step-heading';
export interface FormStepBlockProps {
	attributes: { title: string; description: string; showStepNumber: boolean };
	setAttributes: ( attributes: Record< string, unknown > ) => void;
	className?: string;
	children?: React.ReactNode;
	lock?: { move: boolean; remove: boolean };
}

/**
 * Form Step Block for use in the editor.
 */
export const FormStepBlock = ( {
	attributes,
	setAttributes,
	className = '',
	children,
}: FormStepBlockProps ): JSX.Element => {
	const { title = '', description = '', showStepNumber = true } = attributes;
	const blockProps = useBlockProps( {
		className: classnames( 'wc-block-components-checkout-step', className, {
			'wc-block-components-checkout-step--with-step-number': showStepNumber,
		} ),
	} );
	return (
		<div { ...blockProps }>
			<InspectorControls>
				<PanelBody
					title={ __(
						'Form Step Options',
						'woo-gutenberg-products-block'
					) }
				>
					<ToggleControl
						label={ __(
							'Show step number',
							'woo-gutenberg-products-block'
						) }
						checked={ showStepNumber }
						onChange={ () =>
							setAttributes( {
								showStepNumber: ! showStepNumber,
							} )
						}
					/>
				</PanelBody>
			</InspectorControls>
			<FormStepHeading>
				<PlainText
					className={ '' }
					value={ title }
					onChange={ ( value ) => setAttributes( { title: value } ) }
				/>
			</FormStepHeading>
			<div className="wc-block-components-checkout-step__container">
				<p className="wc-block-components-checkout-step__description">
					<PlainText
						className={
							! description
								? 'wc-block-components-checkout-step__description-placeholder'
								: ''
						}
						value={ description }
						placeholder={ __(
							'Optional text for this form step.',
							'woo-gutenberg-products-block'
						) }
						onChange={ ( value ) =>
							setAttributes( {
								description: value,
							} )
						}
					/>
				</p>
				<div className="wc-block-components-checkout-step__content">
					{ children }
				</div>
			</div>
		</div>
	);
};
woocommerce-blocks/assets/js/blocks/cart-checkout/checkout/form-step/attributes.ts000064400000001225151335517640024556 0ustar00/**
 * External dependencies
 */
import { __ } from '@wordpress/i18n';

const attributes = ( {
	defaultTitle = __( 'Step', 'woo-gutenberg-products-block' ),
	defaultDescription = __(
		'Step description text.',
		'woo-gutenberg-products-block'
	),
	defaultShowStepNumber = true,
}: {
	defaultTitle: string;
	defaultDescription: string;
	defaultShowStepNumber?: boolean;
} ): Record< string, Record< string, unknown > > => ( {
	title: {
		type: 'string',
		default: defaultTitle,
	},
	description: {
		type: 'string',
		default: defaultDescription,
	},
	showStepNumber: {
		type: 'boolean',
		default: defaultShowStepNumber,
	},
} );

export default attributes;
woocommerce-blocks/assets/js/blocks/cart-checkout/checkout/form-step/editor.scss000064400000000340151335517640024200 0ustar00
.wc-block-checkout__additional_fields {
	margin: 1.5em 0 -1.5em;
}
.wc-block-components-checkout-step__description-placeholder {
	opacity: 0.5;
}

.wc-block-components-checkout-step__title {
	display: flex;
	width: 100%;
}
woocommerce-blocks/assets/js/blocks/cart-checkout/checkout/form-step/index.tsx000064400000000213151335517640023663 0ustar00export * from './attributes';
export * from './form-step-block';
export * from './form-step-heading';
export * from './additional-fields';
woocommerce-blocks/assets/js/blocks/cart-checkout/checkout/form-step/form-step-heading.tsx000064400000001226151335517640026072 0ustar00/**
 * External dependencies
 */
import Title from '@woocommerce/base-components/title';

/**
 * Step Heading Component
 */
const FormStepHeading = ( {
	children,
	stepHeadingContent,
}: {
	children: JSX.Element;
	stepHeadingContent?: JSX.Element;
} ): JSX.Element => (
	<div className="wc-block-components-checkout-step__heading">
		<Title
			aria-hidden="true"
			className="wc-block-components-checkout-step__title"
			headingLevel="2"
		>
			{ children }
		</Title>
		{ !! stepHeadingContent && (
			<span className="wc-block-components-checkout-step__heading-content">
				{ stepHeadingContent }
			</span>
		) }
	</div>
);

export default FormStepHeading;
woocommerce-blocks/assets/js/blocks/cart-checkout/checkout/order-notes/style.scss000064400000000647151335517640024411 0ustar00.wc-block-checkout__add-note {
	margin: em($gap-large) 0;
}

.is-mobile,
.is-small,
.is-medium {
	.wc-block-checkout__add-note {
		@include with-translucent-border(1px 0);
		margin-bottom: em($gap);
		margin-top: em($gap);
		padding: em($gap) 0;
	}
}

.wc-block-checkout__add-note .wc-block-components-textarea {
	margin-top: $gap;
}

.wc-block-checkout__order-notes.wc-block-components-checkout-step {
	padding-left: 0;
}
woocommerce-blocks/assets/js/blocks/cart-checkout/checkout/order-notes/index.js000064400000003614151335517640024016 0ustar00/**
 * External dependencies
 */
import { __ } from '@wordpress/i18n';
import { useState } from '@wordpress/element';
import CheckboxControl from '@woocommerce/base-components/checkbox-control';
import Textarea from '@woocommerce/base-components/textarea';
import PropTypes from 'prop-types';

/**
 * Internal dependencies
 */
import './style.scss';

const CheckoutOrderNotes = ( { disabled, onChange, placeholder, value } ) => {
	const [ withOrderNotes, setWithOrderNotes ] = useState( false );
	// Store order notes when the textarea is hidden. This allows us to recover
	// text entered previously by the user when the checkbox is re-enabled
	// while keeping the context clean if the checkbox is disabled.
	const [ hiddenOrderNotesText, setHiddenOrderNotesText ] = useState( '' );

	return (
		<div className="wc-block-checkout__add-note">
			<CheckboxControl
				disabled={ disabled }
				label={ __(
					'Add a note to your order',
					'woocommerce'
				) }
				checked={ withOrderNotes }
				onChange={ ( isChecked ) => {
					setWithOrderNotes( isChecked );
					if ( isChecked ) {
						// When re-enabling the checkbox, store in context the
						// order notes value previously stored in the component
						// state.
						if ( value !== hiddenOrderNotesText ) {
							onChange( hiddenOrderNotesText );
						}
					} else {
						// When un-checking the checkbox, clear the order notes
						// value in the context but store it in the component
						// state.
						onChange( '' );
						setHiddenOrderNotesText( value );
					}
				} }
			/>
			{ withOrderNotes && (
				<Textarea
					disabled={ disabled }
					onTextChange={ onChange }
					placeholder={ placeholder }
					value={ value }
				/>
			) }
		</div>
	);
};

Textarea.propTypes = {
	onTextChange: PropTypes.func.isRequired,
	disabled: PropTypes.bool,
	placeholder: PropTypes.string,
	value: PropTypes.string,
};

export default CheckoutOrderNotes;
woocommerce-blocks/assets/js/blocks/cart-checkout/checkout/types.ts000064400000000755151335517640021627 0ustar00export type InnerBlockTemplate = [
	string,
	Record< string, unknown >,
	InnerBlockTemplate[] | undefined
];

export interface Attributes {
	allowCreateAccount: boolean;
	hasDarkControls: boolean;
	showCompanyField: boolean;
	showApartmentField: boolean;
	showPhoneField: boolean;
	requireCompanyField: boolean;
	requirePhoneField: boolean;
	// Deprecated.
	showOrderNotes: boolean;
	showPolicyLinks: boolean;
	showReturnToCart: boolean;
	showRateAfterTaxName: boolean;
	cartPageId: number;
}
woocommerce-blocks/assets/js/blocks/cart-checkout/checkout/frontend.tsx000064400000003470151335517640022467 0ustar00/**
 * External dependencies
 */
import { Children, cloneElement, isValidElement } from '@wordpress/element';
import { getValidBlockAttributes } from '@woocommerce/base-utils';
import { useStoreCart } from '@woocommerce/base-context';
import {
	useCheckoutExtensionData,
	useValidation,
} from '@woocommerce/base-context/hooks';
import { getRegisteredBlockComponents } from '@woocommerce/blocks-registry';
import {
	withStoreCartApiHydration,
	withRestApiHydration,
} from '@woocommerce/block-hocs';
import { renderParentBlock } from '@woocommerce/atomic-utils';

/**
 * Internal dependencies
 */
import './inner-blocks/register-components';
import Block from './block';
import { blockName, blockAttributes } from './attributes';

const getProps = ( el: Element ) => {
	return {
		attributes: getValidBlockAttributes(
			blockAttributes,
			/* eslint-disable @typescript-eslint/no-explicit-any */
			( el instanceof HTMLElement ? el.dataset : {} ) as any
		),
	};
};

const Wrapper = ( {
	children,
}: {
	children: React.ReactChildren;
} ): React.ReactNode => {
	// we need to pluck out receiveCart.
	// eslint-disable-next-line no-unused-vars
	const { extensions, receiveCart, ...cart } = useStoreCart();
	const checkoutExtensionData = useCheckoutExtensionData();
	const validation = useValidation();
	return Children.map( children, ( child ) => {
		if ( isValidElement( child ) ) {
			const componentProps = {
				extensions,
				cart,
				checkoutExtensionData,
				validation,
			};
			return cloneElement( child, componentProps );
		}
		return child;
	} );
};

renderParentBlock( {
	Block: withStoreCartApiHydration( withRestApiHydration( Block ) ),
	blockName,
	selector: '.wp-block-woocommerce-checkout',
	getProps,
	blockMap: getRegisteredBlockComponents( blockName ) as Record<
		string,
		React.ReactNode
	>,
	blockWrapper: Wrapper,
} );
woocommerce-blocks/assets/js/blocks/cart-checkout/checkout/edit.tsx000064400000020044151335517640021571 0ustar00/**
 * External dependencies
 */
import { __ } from '@wordpress/i18n';
import classnames from 'classnames';
import {
	InnerBlocks,
	useBlockProps,
	InspectorControls,
} from '@wordpress/block-editor';
import { SidebarLayout } from '@woocommerce/base-components/sidebar-layout';
import {
	CheckoutProvider,
	EditorProvider,
	useEditorContext,
} from '@woocommerce/base-context';
import {
	previewCart,
	previewSavedPaymentMethods,
} from '@woocommerce/resource-previews';
import {
	PanelBody,
	ToggleControl,
	CheckboxControl,
	Notice,
} from '@wordpress/components';
import { CartCheckoutFeedbackPrompt } from '@woocommerce/editor-components/feedback-prompt';
import { CHECKOUT_PAGE_ID } from '@woocommerce/block-settings';
import { createInterpolateElement } from '@wordpress/element';
import { getAdminLink } from '@woocommerce/settings';
import { CartCheckoutCompatibilityNotice } from '@woocommerce/editor-components/compatibility-notices';

/**
 * Internal dependencies
 */
import './styles/editor.scss';
import { Columns } from './columns';
import { addClassToBody, useBlockPropsWithLocking } from './hacks';
import { CheckoutBlockContext, CheckoutBlockControlsContext } from './context';
import type { Attributes } from './types';

// This is adds a class to body to signal if the selected block is locked
addClassToBody();

// Array of allowed block names.
const ALLOWED_BLOCKS: string[] = [
	'woocommerce/checkout-fields-block',
	'woocommerce/checkout-totals-block',
];

const BlockSettings = ( {
	attributes,
	setAttributes,
}: {
	attributes: Attributes;
	setAttributes: ( attributes: Record< string, unknown > ) => undefined;
} ): JSX.Element => {
	const { hasDarkControls } = attributes;
	const { currentPostId } = useEditorContext();

	return (
		<InspectorControls>
			{ currentPostId !== CHECKOUT_PAGE_ID && (
				<Notice
					className="wc-block-checkout__page-notice"
					isDismissible={ false }
					status="warning"
				>
					{ createInterpolateElement(
						__(
							'If you would like to use this block as your default checkout you must update your <a>page settings in WooCommerce</a>.',
							'woo-gutenberg-products-block'
						),
						{
							a: (
								// eslint-disable-next-line jsx-a11y/anchor-has-content
								<a
									href={ getAdminLink(
										'admin.php?page=wc-settings&tab=advanced'
									) }
									target="_blank"
									rel="noopener noreferrer"
								/>
							),
						}
					) }
				</Notice>
			) }
			<PanelBody title={ __( 'Style', 'woo-gutenberg-products-block' ) }>
				<ToggleControl
					label={ __(
						'Dark mode inputs',
						'woo-gutenberg-products-block'
					) }
					help={ __(
						'Inputs styled specifically for use on dark background colors.',
						'woo-gutenberg-products-block'
					) }
					checked={ hasDarkControls }
					onChange={ () =>
						setAttributes( {
							hasDarkControls: ! hasDarkControls,
						} )
					}
				/>
			</PanelBody>
			<CartCheckoutFeedbackPrompt />
		</InspectorControls>
	);
};

export const Edit = ( {
	attributes,
	setAttributes,
}: {
	attributes: Attributes;
	setAttributes: ( attributes: Record< string, unknown > ) => undefined;
} ): JSX.Element => {
	const {
		allowCreateAccount,
		showCompanyField,
		requireCompanyField,
		showApartmentField,
		showPhoneField,
		requirePhoneField,
		showOrderNotes,
		showPolicyLinks,
		showReturnToCart,
		showRateAfterTaxName,
		cartPageId,
	} = attributes;

	const defaultInnerBlocksTemplate = [
		[
			'woocommerce/checkout-fields-block',
			{},
			[
				[ 'woocommerce/checkout-express-payment-block', {}, [] ],
				[ 'woocommerce/checkout-contact-information-block', {}, [] ],
				[ 'woocommerce/checkout-shipping-address-block', {}, [] ],
				[ 'woocommerce/checkout-billing-address-block', {}, [] ],
				[ 'woocommerce/checkout-shipping-methods-block', {}, [] ],
				[ 'woocommerce/checkout-payment-block', {}, [] ],
				showOrderNotes
					? [ 'woocommerce/checkout-order-note-block', {}, [] ]
					: false,
				showPolicyLinks
					? [ 'woocommerce/checkout-terms-block', {}, [] ]
					: false,
				[
					'woocommerce/checkout-actions-block',
					{
						showReturnToCart,
						cartPageId,
					},
					[],
				],
			].filter( Boolean ),
		],
		[
			'woocommerce/checkout-totals-block',
			{},
			[
				[
					'woocommerce/checkout-order-summary-block',
					{
						showRateAfterTaxName,
					},
					[],
				],
			],
		],
	];

	const toggleAttribute = ( key: keyof Attributes ): void => {
		const newAttributes = {} as Partial< Attributes >;
		newAttributes[ key ] = ! ( attributes[ key ] as boolean );
		setAttributes( newAttributes );
	};

	const accountControls = (): JSX.Element => (
		<InspectorControls>
			<PanelBody
				title={ __(
					'Account options',
					'woo-gutenberg-products-block'
				) }
			>
				<ToggleControl
					label={ __(
						'Allow shoppers to sign up for a user account during checkout',
						'woo-gutenberg-products-block'
					) }
					checked={ allowCreateAccount }
					onChange={ () =>
						setAttributes( {
							allowCreateAccount: ! allowCreateAccount,
						} )
					}
				/>
			</PanelBody>
		</InspectorControls>
	);

	const addressFieldControls = (): JSX.Element => (
		<InspectorControls>
			<PanelBody
				title={ __( 'Address Fields', 'woo-gutenberg-products-block' ) }
			>
				<p className="wc-block-checkout__controls-text">
					{ __(
						'Show or hide fields in the checkout address forms.',
						'woo-gutenberg-products-block'
					) }
				</p>
				<ToggleControl
					label={ __( 'Company', 'woo-gutenberg-products-block' ) }
					checked={ showCompanyField }
					onChange={ () => toggleAttribute( 'showCompanyField' ) }
				/>
				{ showCompanyField && (
					<CheckboxControl
						label={ __(
							'Require company name?',
							'woo-gutenberg-products-block'
						) }
						checked={ requireCompanyField }
						onChange={ () =>
							toggleAttribute( 'requireCompanyField' )
						}
						className="components-base-control--nested"
					/>
				) }
				<ToggleControl
					label={ __(
						'Apartment, suite, etc.',
						'woo-gutenberg-products-block'
					) }
					checked={ showApartmentField }
					onChange={ () => toggleAttribute( 'showApartmentField' ) }
				/>
				<ToggleControl
					label={ __( 'Phone', 'woo-gutenberg-products-block' ) }
					checked={ showPhoneField }
					onChange={ () => toggleAttribute( 'showPhoneField' ) }
				/>
				{ showPhoneField && (
					<CheckboxControl
						label={ __(
							'Require phone number?',
							'woo-gutenberg-products-block'
						) }
						checked={ requirePhoneField }
						onChange={ () =>
							toggleAttribute( 'requirePhoneField' )
						}
						className="components-base-control--nested"
					/>
				) }
			</PanelBody>
		</InspectorControls>
	);
	const blockProps = useBlockPropsWithLocking();
	return (
		<div { ...blockProps }>
			<EditorProvider
				previewData={ { previewCart, previewSavedPaymentMethods } }
			>
				<BlockSettings
					attributes={ attributes }
					setAttributes={ setAttributes }
				/>
				<CheckoutProvider>
					<Columns>
						<SidebarLayout
							className={ classnames( 'wc-block-checkout', {
								'has-dark-controls': attributes.hasDarkControls,
							} ) }
						>
							<CheckoutBlockControlsContext.Provider
								value={ {
									addressFieldControls,
									accountControls,
								} }
							>
								<CheckoutBlockContext.Provider
									value={ {
										allowCreateAccount,
										showCompanyField,
										requireCompanyField,
										showApartmentField,
										showPhoneField,
										requirePhoneField,
									} }
								>
									<InnerBlocks
										allowedBlocks={ ALLOWED_BLOCKS }
										template={ defaultInnerBlocksTemplate }
										templateLock="insert"
									/>
								</CheckoutBlockContext.Provider>
							</CheckoutBlockControlsContext.Provider>
						</SidebarLayout>
					</Columns>
				</CheckoutProvider>
			</EditorProvider>
			<CartCheckoutCompatibilityNotice blockName="checkout" />
		</div>
	);
};

export const Save = (): JSX.Element => {
	return (
		<div
			{ ...useBlockProps.save( {
				className: 'wc-block-checkout is-loading',
			} ) }
		>
			<InnerBlocks.Content />
		</div>
	);
};
woocommerce-blocks/assets/js/blocks/cart-checkout/checkout/editor-utils.ts000064400000001016151335517640023076 0ustar00/**
 * External dependencies
 */
import { getBlockTypes } from '@wordpress/blocks';

// List of core block types to allow in inner block areas.
const coreBlockTypes = [ 'core/paragraph', 'core/image', 'core/separator' ];

/**
 * Gets a list of allowed blocks types under a specific parent block type.
 */
export const getAllowedBlocks = ( block: string ): string[] => [
	...getBlockTypes()
		.filter( ( blockType ) =>
			( blockType?.parent || [] ).includes( block )
		)
		.map( ( { name } ) => name ),
	...coreBlockTypes,
];
woocommerce-blocks/assets/js/blocks/products-by-attribute/index.js000064400000004332151335517640021466 0ustar00/**
 * External dependencies
 */
import { __ } from '@wordpress/i18n';
import { Icon, tags } from '@woocommerce/icons';
import { registerBlockType } from '@wordpress/blocks';
import { getSetting } from '@woocommerce/settings';

/**
 * Internal dependencies
 */
import './editor.scss';
import Block from './block';

const blockTypeName = 'woocommerce/products-by-attribute';

registerBlockType( blockTypeName, {
	title: __( 'Products by Attribute', 'woocommerce' ),
	icon: {
		src: <Icon srcElement={ tags } />,
		foreground: '#96588a',
	},
	category: 'woocommerce',
	keywords: [ __( 'WooCommerce', 'woocommerce' ) ],
	description: __(
		'Display a grid of products with selected attributes.',
		'woocommerce'
	),
	supports: {
		align: [ 'wide', 'full' ],
		html: false,
	},
	example: {
		attributes: {
			isPreview: true,
		},
	},
	attributes: {
		/**
		 * Product attributes, used to display only products with the given attributes.
		 */
		attributes: {
			type: 'array',
			default: [],
		},

		/**
		 * Product attribute operator, used to restrict to products in all or any selected attributes.
		 */
		attrOperator: {
			type: 'string',
			default: 'any',
		},

		/**
		 * Number of columns.
		 */
		columns: {
			type: 'number',
			default: getSetting( 'default_columns', 3 ),
		},

		/**
		 * Toggle for edit mode in the block preview.
		 */
		editMode: {
			type: 'boolean',
			default: true,
		},

		/**
		 * Content visibility setting
		 */
		contentVisibility: {
			type: 'object',
			default: {
				title: true,
				price: true,
				rating: true,
				button: true,
			},
		},

		/**
		 * How to order the products: 'date', 'popularity', 'price_asc', 'price_desc' 'rating', 'title'.
		 */
		orderby: {
			type: 'string',
			default: 'date',
		},

		/**
		 * Number of rows.
		 */
		rows: {
			type: 'number',
			default: getSetting( 'default_rows', 3 ),
		},

		/**
		 * How to align cart buttons.
		 */
		alignButtons: {
			type: 'boolean',
			default: false,
		},

		/**
		 * Are we previewing?
		 */
		isPreview: {
			type: 'boolean',
			default: false,
		},
	},

	/**
	 * Renders and manages the block.
	 *
	 * @param {Object} props Props to pass to block.
	 */
	edit( props ) {
		return <Block { ...props } />;
	},

	save() {
		return null;
	},
} );
woocommerce-blocks/assets/js/blocks/products-by-attribute/block.js000064400000012351151335517640021451 0ustar00/**
 * External dependencies
 */
import { __ } from '@wordpress/i18n';
import { BlockControls, InspectorControls } from '@wordpress/block-editor';
import ServerSideRender from '@wordpress/server-side-render';
import {
	Button,
	Disabled,
	PanelBody,
	Placeholder,
	ToolbarGroup,
	withSpokenMessages,
} from '@wordpress/components';
import { Component } from '@wordpress/element';
import { Icon, tags } from '@woocommerce/icons';
import PropTypes from 'prop-types';
import GridContentControl from '@woocommerce/editor-components/grid-content-control';
import GridLayoutControl from '@woocommerce/editor-components/grid-layout-control';
import ProductAttributeTermControl from '@woocommerce/editor-components/product-attribute-term-control';
import ProductOrderbyControl from '@woocommerce/editor-components/product-orderby-control';
import { gridBlockPreview } from '@woocommerce/resource-previews';
import { getSetting } from '@woocommerce/settings';

/**
 * Component to handle edit mode of "Products by Attribute".
 */
class ProductsByAttributeBlock extends Component {
	getInspectorControls() {
		const { setAttributes } = this.props;
		const {
			attributes,
			attrOperator,
			columns,
			contentVisibility,
			orderby,
			rows,
			alignButtons,
		} = this.props.attributes;

		return (
			<InspectorControls key="inspector">
				<PanelBody
					title={ __( 'Layout', 'woocommerce' ) }
					initialOpen
				>
					<GridLayoutControl
						columns={ columns }
						rows={ rows }
						alignButtons={ alignButtons }
						setAttributes={ setAttributes }
						minColumns={ getSetting( 'min_columns', 1 ) }
						maxColumns={ getSetting( 'max_columns', 6 ) }
						minRows={ getSetting( 'min_rows', 1 ) }
						maxRows={ getSetting( 'max_rows', 6 ) }
					/>
				</PanelBody>
				<PanelBody
					title={ __( 'Content', 'woocommerce' ) }
					initialOpen
				>
					<GridContentControl
						settings={ contentVisibility }
						onChange={ ( value ) =>
							setAttributes( { contentVisibility: value } )
						}
					/>
				</PanelBody>
				<PanelBody
					title={ __(
						'Filter by Product Attribute',
						'woocommerce'
					) }
					initialOpen={ false }
				>
					<ProductAttributeTermControl
						selected={ attributes }
						onChange={ ( value = [] ) => {
							const result = value.map(
								( { id, attr_slug: attributeSlug } ) => ( {
									id,
									attr_slug: attributeSlug,
								} )
							);
							setAttributes( { attributes: result } );
						} }
						operator={ attrOperator }
						onOperatorChange={ ( value = 'any' ) =>
							setAttributes( { attrOperator: value } )
						}
						isCompact={ true }
					/>
				</PanelBody>
				<PanelBody
					title={ __( 'Order By', 'woocommerce' ) }
					initialOpen={ false }
				>
					<ProductOrderbyControl
						setAttributes={ setAttributes }
						value={ orderby }
					/>
				</PanelBody>
			</InspectorControls>
		);
	}

	renderEditMode() {
		const { debouncedSpeak, setAttributes } = this.props;
		const blockAttributes = this.props.attributes;
		const onDone = () => {
			setAttributes( { editMode: false } );
			debouncedSpeak(
				__(
					'Showing Products by Attribute block preview.',
					'woocommerce'
				)
			);
		};

		return (
			<Placeholder
				icon={ <Icon srcElement={ tags } /> }
				label={ __(
					'Products by Attribute',
					'woocommerce'
				) }
				className="wc-block-products-grid wc-block-products-by-attribute"
			>
				{ __(
					'Display a grid of products from your selected attributes.',
					'woocommerce'
				) }
				<div className="wc-block-products-by-attribute__selection">
					<ProductAttributeTermControl
						selected={ blockAttributes.attributes }
						onChange={ ( value = [] ) => {
							const result = value.map(
								( { id, attr_slug: attributeSlug } ) => ( {
									id,
									attr_slug: attributeSlug,
								} )
							);
							setAttributes( { attributes: result } );
						} }
						operator={ blockAttributes.attrOperator }
						onOperatorChange={ ( value = 'any' ) =>
							setAttributes( { attrOperator: value } )
						}
					/>
					<Button isPrimary onClick={ onDone }>
						{ __( 'Done', 'woocommerce' ) }
					</Button>
				</div>
			</Placeholder>
		);
	}

	render() {
		const { attributes, name, setAttributes } = this.props;
		const { editMode } = attributes;

		if ( attributes.isPreview ) {
			return gridBlockPreview;
		}

		return (
			<>
				<BlockControls>
					<ToolbarGroup
						controls={ [
							{
								icon: 'edit',
								title: __( 'Edit' ),
								onClick: () =>
									setAttributes( { editMode: ! editMode } ),
								isActive: editMode,
							},
						] }
					/>
				</BlockControls>
				{ this.getInspectorControls() }
				{ editMode ? (
					this.renderEditMode()
				) : (
					<Disabled>
						<ServerSideRender
							block={ name }
							attributes={ attributes }
						/>
					</Disabled>
				) }
			</>
		);
	}
}

ProductsByAttributeBlock.propTypes = {
	/**
	 * The attributes for this block
	 */
	attributes: PropTypes.object.isRequired,
	/**
	 * The register block name.
	 */
	name: PropTypes.string.isRequired,
	/**
	 * A callback to update attributes
	 */
	setAttributes: PropTypes.func.isRequired,
	// from withSpokenMessages
	debouncedSpeak: PropTypes.func.isRequired,
};

export default withSpokenMessages( ProductsByAttributeBlock );
woocommerce-blocks/assets/js/blocks/products-by-attribute/editor.scss000064400000000075151335517640022204 0ustar00.wc-block-products-by-attribute__selection {
	width: 100%;
}
woocommerce-blocks/assets/js/blocks/featured-category/example.js000064400000000633151335517640021150 0ustar00/**
 * External dependencies
 */
import { getSetting } from '@woocommerce/settings';
import { previewCategories } from '@woocommerce/resource-previews';

export const example = {
	attributes: {
		contentAlign: 'center',
		dimRatio: 50,
		editMode: false,
		height: getSetting( 'default_height', 500 ),
		mediaSrc: '',
		showDesc: true,
		categoryId: 'preview',
		previewCategory: previewCategories[ 0 ],
	},
};
woocommerce-blocks/assets/js/blocks/featured-category/style.scss000064400000005104151335517640021212 0ustar00.wc-block-featured-category {
	position: relative;
	background-color: $gray-900;
	background-size: cover;
	background-position: center center;
	width: 100%;
	margin: 0 0 1.5em 0;
	display: flex;
	justify-content: center;
	align-items: center;
	flex-wrap: wrap;
	align-content: center;

	.wc-block-featured-category__wrapper {
		overflow: hidden;
		height: 100%;
		display: flex;
		justify-content: center;
		align-items: center;
		flex-wrap: wrap;
		align-content: center;
	}

	&.has-left-content {
		justify-content: flex-start;

		.wc-block-featured-category__title,
		.wc-block-featured-category__description,
		.wc-block-featured-category__price {
			margin-left: 0;
			text-align: left;
		}
	}

	&.has-right-content {
		justify-content: flex-end;

		.wc-block-featured-category__title,
		.wc-block-featured-category__description,
		.wc-block-featured-category__price {
			margin-right: 0;
			text-align: right;
		}
	}

	.wc-block-featured-category__title,
	.wc-block-featured-category__description,
	.wc-block-featured-category__price {
		color: $white;
		line-height: 1.25;
		margin-bottom: 0;
		text-align: center;

		a,
		a:hover,
		a:focus,
		a:active {
			color: $white;
		}
	}

	.wc-block-featured-category__title,
	.wc-block-featured-category__description,
	.wc-block-featured-category__price,
	.wc-block-featured-category__link {
		width: 100%;
		padding: 0 48px 16px 48px;
		z-index: 1;
	}

	.wc-block-featured-category__title {
		margin-top: 0;

		&::before {
			display: none;
		}
	}

	.wc-block-featured-category__description {
		p {
			margin: 0;
		}
	}

	.wp-block-button.aligncenter {
		text-align: center;
	}

	&.has-background-dim::before {
		content: "";
		position: absolute;
		top: 0;
		left: 0;
		bottom: 0;
		right: 0;
		background-color: inherit;
		opacity: 0.5;
		z-index: 1;
	}

	@for $i from 1 through 10 {
		&.has-background-dim.has-background-dim-#{ $i * 10 }::before {
			opacity: $i * 0.1;
		}
	}

	// Apply max-width to floated items that have no intrinsic width
	&.alignleft,
	&.alignright {
		max-width: $content-width * 0.5;
		width: 100%;
	}

	// Using flexbox without an assigned height property breaks vertical center alignment in IE11.
	// Appending an empty ::after element tricks IE11 into giving the cover image an implicit height, which sidesteps this issue.
	&::after {
		display: block;
		content: "";
		font-size: 0;
		min-height: inherit;

		// IE doesn't support flex so omit that.
		@supports (position: sticky) {
			content: none;
		}
	}

	// Aligned cover blocks should not use our global alignment rules
	&.aligncenter,
	&.alignleft,
	&.alignright {
		display: flex;
	}
}
woocommerce-blocks/assets/js/blocks/featured-category/block.js000064400000027004151335517640020610 0ustar00/**
 * External dependencies
 */
import { __ } from '@wordpress/i18n';
import {
	AlignmentToolbar,
	BlockControls,
	InnerBlocks,
	InspectorControls,
	MediaReplaceFlow,
	PanelColorSettings,
	withColors,
	RichText,
} from '@wordpress/block-editor';
import {
	Button,
	FocalPointPicker,
	PanelBody,
	Placeholder,
	RangeControl,
	ResizableBox,
	Spinner,
	ToggleControl,
	ToolbarGroup,
	withSpokenMessages,
} from '@wordpress/components';
import classnames from 'classnames';
import { Component } from '@wordpress/element';
import { withSelect } from '@wordpress/data';
import { compose, createHigherOrderComponent } from '@wordpress/compose';
import PropTypes from 'prop-types';
import { getSetting } from '@woocommerce/settings';
import { Icon, folderStarred } from '@woocommerce/icons';
import ProductCategoryControl from '@woocommerce/editor-components/product-category-control';
import ErrorPlaceholder from '@woocommerce/editor-components/error-placeholder';

/**
 * Internal dependencies
 */
import {
	dimRatioToClass,
	getBackgroundImageStyles,
	getCategoryImageId,
	getCategoryImageSrc,
} from './utils';
import { withCategory } from '../../hocs';

/**
 * Component to handle edit mode of "Featured Category".
 *
 * @param {Object} props Incoming props for the component.
 * @param {Object} props.attributes Incoming block attributes.
 * @param {boolean} props.isSelected Whether block is selected or not.
 * @param {function(any):any} props.setAttributes Function for setting new attributes.
 * @param {string} props.error Error message
 * @param {function(any):any} props.getCategory Function for getting category details.
 * @param {boolean} props.isLoading Whether loading or not.
 * @param {Object} props.category The product category object.
 * @param {Object} props.overlayColor Overlay color object for content.
 * @param {function(any):any} props.setOverlayColor Setter for overlay color.
 * @param {function(any):any} props.debouncedSpeak Function for delayed speak.
 * @param {function():void} props.triggerUrlUpdate Function to update Shop now button Url.
 */
const FeaturedCategory = ( {
	attributes,
	isSelected,
	setAttributes,
	error,
	getCategory,
	isLoading,
	category,
	overlayColor,
	setOverlayColor,
	debouncedSpeak,
	triggerUrlUpdate = () => void null,
} ) => {
	const renderApiError = () => (
		<ErrorPlaceholder
			className="wc-block-featured-category-error"
			error={ error }
			isLoading={ isLoading }
			onRetry={ getCategory }
		/>
	);

	const getBlockControls = () => {
		const { contentAlign, mediaSrc } = attributes;
		const mediaId = attributes.mediaId || getCategoryImageId( category );

		return (
			<BlockControls>
				<AlignmentToolbar
					value={ contentAlign }
					onChange={ ( nextAlign ) => {
						setAttributes( { contentAlign: nextAlign } );
					} }
				/>
				<MediaReplaceFlow
					mediaId={ mediaId }
					mediaURL={ mediaSrc }
					accept="image/*"
					onSelect={ ( media ) => {
						setAttributes( {
							mediaId: media.id,
							mediaSrc: media.url,
						} );
					} }
					allowedTypes={ [ 'image' ] }
				/>
				<ToolbarGroup
					controls={ [
						{
							icon: 'edit',
							title: __( 'Edit' ),
							onClick: () =>
								setAttributes( { editMode: ! editMode } ),
							isActive: editMode,
						},
					] }
				/>
			</BlockControls>
		);
	};

	const getInspectorControls = () => {
		const url = attributes.mediaSrc || getCategoryImageSrc( category );
		const { focalPoint = { x: 0.5, y: 0.5 } } = attributes;
		// FocalPointPicker was introduced in Gutenberg 5.0 (WordPress 5.2),
		// so we need to check if it exists before using it.
		const focalPointPickerExists = typeof FocalPointPicker === 'function';

		return (
			<InspectorControls key="inspector">
				<PanelBody
					title={ __( 'Content', 'woocommerce' ) }
				>
					<ToggleControl
						label={ __(
							'Show description',
							'woocommerce'
						) }
						checked={ attributes.showDesc }
						onChange={ () =>
							setAttributes( { showDesc: ! attributes.showDesc } )
						}
					/>
				</PanelBody>
				<PanelColorSettings
					title={ __( 'Overlay', 'woocommerce' ) }
					colorSettings={ [
						{
							value: overlayColor.color,
							onChange: setOverlayColor,
							label: __(
								'Overlay Color',
								'woocommerce'
							),
						},
					] }
				>
					{ !! url && (
						<>
							<RangeControl
								label={ __(
									'Background Opacity',
									'woocommerce'
								) }
								value={ attributes.dimRatio }
								onChange={ ( ratio ) =>
									setAttributes( { dimRatio: ratio } )
								}
								min={ 0 }
								max={ 100 }
								step={ 10 }
							/>
							{ focalPointPickerExists && (
								<FocalPointPicker
									label={ __( 'Focal Point Picker' ) }
									url={ url }
									value={ focalPoint }
									onChange={ ( value ) =>
										setAttributes( { focalPoint: value } )
									}
								/>
							) }
						</>
					) }
				</PanelColorSettings>
			</InspectorControls>
		);
	};

	const renderEditMode = () => {
		const onDone = () => {
			setAttributes( { editMode: false } );
			debouncedSpeak(
				__(
					'Showing Featured Product block preview.',
					'woocommerce'
				)
			);
		};

		return (
			<Placeholder
				icon={ <Icon srcElement={ folderStarred } /> }
				label={ __(
					'Featured Category',
					'woocommerce'
				) }
				className="wc-block-featured-category"
			>
				{ __(
					'Visually highlight a product category and encourage prompt action.',
					'woocommerce'
				) }
				<div className="wc-block-featured-category__selection">
					<ProductCategoryControl
						selected={ [ attributes.categoryId ] }
						onChange={ ( value = [] ) => {
							const id = value[ 0 ] ? value[ 0 ].id : 0;
							setAttributes( {
								categoryId: id,
								mediaId: 0,
								mediaSrc: '',
							} );
							triggerUrlUpdate();
						} }
						isSingle
					/>
					<Button isPrimary onClick={ onDone }>
						{ __( 'Done', 'woocommerce' ) }
					</Button>
				</div>
			</Placeholder>
		);
	};

	const renderButton = () => {
		const buttonClasses = classnames(
			'wp-block-button__link',
			'is-style-fill'
		);
		const buttonStyle = {
			backgroundColor: 'vivid-green-cyan',
			borderRadius: '5px',
		};
		const wrapperStyle = {
			width: '100%',
		};
		return attributes.categoryId === 'preview' ? (
			<div className="wp-block-button aligncenter" style={ wrapperStyle }>
				<RichText.Content
					tagName="a"
					className={ buttonClasses }
					href={ category.permalink }
					title={ attributes.linkText }
					style={ buttonStyle }
					value={ attributes.linkText }
					target={ category.permalink }
				/>
			</div>
		) : (
			<InnerBlocks
				template={ [
					[
						'core/button',
						{
							text: __(
								'Shop now',
								'woocommerce'
							),
							url: category.permalink,
							align: 'center',
						},
					],
				] }
				templateLock="all"
			/>
		);
	};

	const renderCategory = () => {
		const {
			className,
			contentAlign,
			dimRatio,
			focalPoint,
			height,
			showDesc,
		} = attributes;
		const classes = classnames(
			'wc-block-featured-category',
			{
				'is-selected': isSelected && attributes.productId !== 'preview',
				'is-loading': ! category && isLoading,
				'is-not-found': ! category && ! isLoading,
				'has-background-dim': dimRatio !== 0,
			},
			dimRatioToClass( dimRatio ),
			contentAlign !== 'center' && `has-${ contentAlign }-content`,
			className
		);
		const mediaSrc = attributes.mediaSrc || getCategoryImageSrc( category );
		const style = !! category ? getBackgroundImageStyles( mediaSrc ) : {};
		if ( overlayColor.color ) {
			style.backgroundColor = overlayColor.color;
		}
		if ( focalPoint ) {
			const bgPosX = focalPoint.x * 100;
			const bgPosY = focalPoint.y * 100;
			style.backgroundPosition = `${ bgPosX }% ${ bgPosY }%`;
		}

		const onResizeStop = ( event, direction, elt ) => {
			setAttributes( { height: parseInt( elt.style.height, 10 ) } );
		};

		return (
			<ResizableBox
				className={ classes }
				size={ { height } }
				minHeight={ getSetting( 'min_height', 500 ) }
				enable={ { bottom: true } }
				onResizeStop={ onResizeStop }
				style={ style }
			>
				<div className="wc-block-featured-category__wrapper">
					<h2
						className="wc-block-featured-category__title"
						dangerouslySetInnerHTML={ {
							__html: category.name,
						} }
					/>
					{ showDesc && (
						<div
							className="wc-block-featured-category__description"
							dangerouslySetInnerHTML={ {
								__html: category.description,
							} }
						/>
					) }
					<div className="wc-block-featured-category__link">
						{ renderButton() }
					</div>
				</div>
			</ResizableBox>
		);
	};

	const renderNoCategory = () => (
		<Placeholder
			className="wc-block-featured-category"
			icon={ <Icon srcElement={ folderStarred } /> }
			label={ __( 'Featured Category', 'woocommerce' ) }
		>
			{ isLoading ? (
				<Spinner />
			) : (
				__(
					'No product category is selected.',
					'woocommerce'
				)
			) }
		</Placeholder>
	);

	const { editMode } = attributes;

	if ( error ) {
		return renderApiError();
	}

	if ( editMode ) {
		return renderEditMode();
	}

	return (
		<>
			{ getBlockControls() }
			{ getInspectorControls() }
			{ category ? renderCategory() : renderNoCategory() }
		</>
	);
};

FeaturedCategory.propTypes = {
	/**
	 * The attributes for this block.
	 */
	attributes: PropTypes.object.isRequired,
	/**
	 * Whether this block is currently active.
	 */
	isSelected: PropTypes.bool.isRequired,
	/**
	 * The register block name.
	 */
	name: PropTypes.string.isRequired,
	/**
	 * A callback to update attributes.
	 */
	setAttributes: PropTypes.func.isRequired,
	// from withCategory
	error: PropTypes.object,
	getCategory: PropTypes.func,
	isLoading: PropTypes.bool,
	category: PropTypes.shape( {
		name: PropTypes.node,
		description: PropTypes.node,
		permalink: PropTypes.string,
	} ),
	// from withColors
	overlayColor: PropTypes.object,
	setOverlayColor: PropTypes.func.isRequired,
	// from withSpokenMessages
	debouncedSpeak: PropTypes.func.isRequired,
	triggerUrlUpdate: PropTypes.func,
};

export default compose( [
	withCategory,
	withColors( { overlayColor: 'background-color' } ),
	withSpokenMessages,
	withSelect( ( select, { clientId }, { dispatch } ) => {
		const Block = select( 'core/block-editor' ).getBlock( clientId );
		const buttonBlockId = Block?.innerBlocks[ 0 ]?.clientId || '';
		const currentButtonAttributes =
			Block?.innerBlocks[ 0 ]?.attributes || {};
		const updateBlockAttributes = ( attributes ) => {
			if ( buttonBlockId ) {
				dispatch( 'core/block-editor' ).updateBlockAttributes(
					buttonBlockId,
					attributes
				);
			}
		};
		return { updateBlockAttributes, currentButtonAttributes };
	} ),
	createHigherOrderComponent( ( ProductComponent ) => {
		class WrappedComponent extends Component {
			state = {
				doUrlUpdate: false,
			};
			componentDidUpdate() {
				const {
					attributes,
					updateBlockAttributes,
					currentButtonAttributes,
					category,
				} = this.props;
				if (
					this.state.doUrlUpdate &&
					! attributes.editMode &&
					category?.permalink &&
					currentButtonAttributes?.url &&
					category.permalink !== currentButtonAttributes.url
				) {
					updateBlockAttributes( {
						...currentButtonAttributes,
						url: category.permalink,
					} );
					this.setState( { doUrlUpdate: false } );
				}
			}
			triggerUrlUpdate = () => {
				this.setState( { doUrlUpdate: true } );
			};
			render() {
				return (
					<ProductComponent
						triggerUrlUpdate={ this.triggerUrlUpdate }
						{ ...this.props }
					/>
				);
			}
		}
		return WrappedComponent;
	}, 'withUpdateButtonAttributes' ),
] )( FeaturedCategory );
woocommerce-blocks/assets/js/blocks/featured-category/utils.js000064400000003037151335517640020656 0ustar00/**
 * External dependencies
 */
import { isObject } from 'lodash';

/**
 * Get the src from a category object, unless null (no image).
 *
 * @param {Object|null} category A product category object from the API.
 * @return {string} The src of the category image.
 */
function getCategoryImageSrc( category ) {
	if ( category && isObject( category.image ) ) {
		return category.image.src;
	}
	return '';
}

/**
 * Get the attachment ID from a category object, unless null (no image).
 *
 * @param {Object|null} category A product category object from the API.
 * @return {number} The id of the category image.
 */
function getCategoryImageId( category ) {
	if ( category && isObject( category.image ) ) {
		return category.image.id;
	}
	return 0;
}

/**
 * Generate a style object given either a product category image from the API or URL to an image.
 *
 * @param {string} url An image URL.
 * @return {Object} A style object with a backgroundImage set (if a valid image is provided).
 */
function getBackgroundImageStyles( url ) {
	if ( url ) {
		return { backgroundImage: `url(${ url })` };
	}
	return {};
}

/**
 * Convert the selected ratio to the correct background class.
 *
 * @param {number} ratio Selected opacity from 0 to 100.
 * @return {string} The class name, if applicable (not used for ratio 0 or 50).
 */
function dimRatioToClass( ratio ) {
	return ratio === 0 || ratio === 50
		? null
		: `has-background-dim-${ 10 * Math.round( ratio / 10 ) }`;
}

export {
	getCategoryImageSrc,
	getCategoryImageId,
	getBackgroundImageStyles,
	dimRatioToClass,
};
woocommerce-blocks/assets/js/blocks/featured-category/editor.scss000064400000000345151335517640021342 0ustar00.wc-block-featured-category {
	.components-resizable-box__handle {
		z-index: 10;
	}

	.components-placeholder__label svg {
		fill: currentColor;
		margin-right: 1ch;
	}
}
.wc-block-featured-category__selection {
	width: 100%;
}
woocommerce-blocks/assets/js/blocks/featured-category/index.js000064400000005224151335517640020625 0ustar00/**
 * External dependencies
 */
import { __ } from '@wordpress/i18n';
import { InnerBlocks } from '@wordpress/block-editor';
import { registerBlockType } from '@wordpress/blocks';
import { getSetting } from '@woocommerce/settings';
import { Icon, folderStarred } from '@woocommerce/icons';

/**
 * Internal dependencies
 */
import './style.scss';
import './editor.scss';
import Block from './block';
import { example } from './example';

/**
 * Register and run the "Featured Category" block.
 */
registerBlockType( 'woocommerce/featured-category', {
	title: __( 'Featured Category', 'woocommerce' ),
	icon: {
		src: <Icon srcElement={ folderStarred } />,
		foreground: '#96588a',
	},
	category: 'woocommerce',
	keywords: [ __( 'WooCommerce', 'woocommerce' ) ],
	description: __(
		'Visually highlight a product category and encourage prompt action.',
		'woocommerce'
	),
	supports: {
		align: [ 'wide', 'full' ],
		html: false,
	},
	example,
	attributes: {
		/**
		 * Alignment of content inside block.
		 */
		contentAlign: {
			type: 'string',
			default: 'center',
		},

		/**
		 * Percentage opacity of overlay.
		 */
		dimRatio: {
			type: 'number',
			default: 50,
		},

		/**
		 * Toggle for edit mode in the block preview.
		 */
		editMode: {
			type: 'boolean',
			default: true,
		},

		/**
		 * Focus point for the background image
		 */
		focalPoint: {
			type: 'object',
		},

		/**
		 * A fixed height for the block.
		 */
		height: {
			type: 'number',
			default: getSetting( 'default_height', 500 ),
		},

		/**
		 * ID for a custom image, overriding the product's featured image.
		 */
		mediaId: {
			type: 'number',
			default: 0,
		},

		/**
		 * URL for a custom image, overriding the product's featured image.
		 */
		mediaSrc: {
			type: 'string',
			default: '',
		},

		/**
		 * The overlay color, from the color list.
		 */
		overlayColor: {
			type: 'string',
		},

		/**
		 * The overlay color, if a custom color value.
		 */
		customOverlayColor: {
			type: 'string',
		},

		/**
		 * Text for the category link.
		 */
		linkText: {
			type: 'string',
			default: __( 'Shop now', 'woocommerce' ),
		},

		/**
		 * The category ID to display.
		 */
		categoryId: {
			type: 'number',
		},

		/**
		 * Show the category description.
		 */
		showDesc: {
			type: 'boolean',
			default: true,
		},

		/**
		 * Category preview.
		 */
		previewCategory: {
			type: 'object',
			default: null,
		},
	},

	/**
	 * Renders and manages the block.
	 *
	 * @param {Object} props Props to pass to block.
	 */
	edit( props ) {
		return <Block { ...props } />;
	},

	/**
	 * Block content is rendered in PHP, not via save function.
	 */
	save() {
		return <InnerBlocks.Content />;
	},
} );
woocommerce-blocks/assets/js/atomic/utils/block-styling.js000064400000000345151335517640020023 0ustar00/**
 * External dependencies
 */
import { isFeaturePluginBuild } from '@woocommerce/block-settings';

export const gatedStyledText = ( { color, fontSize } ) =>
	isFeaturePluginBuild()
		? {
				color,
				fontSize,
		  }
		: {};
woocommerce-blocks/assets/js/atomic/utils/index.js000064400000000304151335517640016344 0ustar00export * from './get-block-map';
export * from './create-blocks-from-template';
export * from './render-parent-block';
export * from './block-styling';
export * from './render-standalone-blocks';
woocommerce-blocks/assets/js/atomic/utils/get-block-map.js000064400000000631151335517640017662 0ustar00/**
 * External dependencies
 */
import { getRegisteredBlockComponents } from '@woocommerce/blocks-registry';

/**
 * Internal dependencies
 */
import '../blocks/component-init';

/**
 * Map named Blocks to defined React Components to render on the frontend.
 *
 * @param {string} blockName Name of the parent block.
 */
export const getBlockMap = ( blockName ) =>
	getRegisteredBlockComponents( blockName );
woocommerce-blocks/assets/js/atomic/utils/render-standalone-blocks.js000064400000001022151335517640022113 0ustar00/**
 * External dependencies
 */
import { renderFrontend } from '@woocommerce/base-utils';

/**
 * Internal dependencies
 */
import { getBlockMap } from './get-block-map';

export const renderStandaloneBlocks = () => {
	const blockMap = getBlockMap( '' );

	Object.keys( blockMap ).forEach( ( blockName ) => {
		const selector = '.wp-block-' + blockName.replace( '/', '-' );

		const getProps = ( el ) => {
			return el.dataset;
		};

		renderFrontend( {
			Block: blockMap[ blockName ],
			selector,
			getProps,
		} );
	} );
};
woocommerce-blocks/assets/js/atomic/utils/render-parent-block.tsx000064400000020130151335517640021274 0ustar00/**
 * External dependencies
 */
import { renderFrontend } from '@woocommerce/base-utils';
import {
	Fragment,
	Suspense,
	isValidElement,
	cloneElement,
} from '@wordpress/element';
import parse from 'html-react-parser';
import {
	getRegisteredBlocks,
	hasInnerBlocks,
} from '@woocommerce/blocks-checkout';

/**
 * This file contains logic used on the frontend to convert DOM elements (saved by the block editor) to React
 * Components. These components are registered using registerBlockComponent() and registerCheckoutBlock() and map 1:1
 * to a block by name.
 *
 * Blocks using this system will have their blockName stored as a data attribute, for example:
 * 		<div data-block-name="woocommerce/product-title"></div>
 *
 * This block name is then read, and using the map, dynamically converted to a real React Component.
 *
 * @see registerBlockComponent
 * @see registerCheckoutBlock
 */

/**
 * Gets a component from the block map for a given block name, or returns null if a component is not registered.
 */
const getBlockComponentFromMap = (
	block: string,
	blockMap: Record< string, React.ReactNode >
): React.ElementType | null => {
	return block && blockMap[ block ]
		? ( blockMap[ block ] as React.ElementType )
		: null;
};

/**
 * Render forced blocks which are missing from the template.
 *
 * Forced blocks are registered in registerCheckoutBlock. If a block is forced, it will be inserted in the editor
 * automatically, however, until that happens they may be missing from the frontend. To fix this, we look up what blocks
 * are registered as forced, and then append them here if they are missing.
 *
 * @see registerCheckoutBlock
 */
const renderForcedBlocks = (
	block: string,
	blockMap: Record< string, React.ReactNode >,
	// Current children from the parent (siblings of the forced block)
	blockChildren: HTMLCollection | null
) => {
	if ( ! hasInnerBlocks( block ) ) {
		return null;
	}

	const currentBlocks = blockChildren
		? ( Array.from( blockChildren )
				.map( ( element: Element ) =>
					element instanceof HTMLElement
						? element?.dataset.blockName || null
						: null
				)
				.filter( Boolean ) as string[] )
		: [];

	const forcedBlocks = getRegisteredBlocks( block ).filter(
		( { blockName, force } ) =>
			force === true && ! currentBlocks.includes( blockName )
	);

	return forcedBlocks.map(
		( { blockName, component }, index: number ): JSX.Element | null => {
			const ForcedComponent = component
				? component
				: getBlockComponentFromMap( blockName, blockMap );
			return ForcedComponent ? (
				<ForcedComponent key={ `${ blockName }_forced_${ index }` } />
			) : null;
		}
	);
};

/**
 * Recursively replace block markup in the DOM with React Components.
 */
const renderInnerBlocks = ( {
	// This is the parent block we're working within (see renderParentBlock)
	block,
	// This is the map of blockNames->components
	blockMap,
	// Component which inner blocks are wrapped with.
	blockWrapper,
	// The children from the DOM we're currently iterating over.
	children,
	// Current depth of the children. Used to ensure keys are unique.
	depth = 1,
}: {
	// Block (parent) being rendered. Used for inner block component mapping.
	block: string;
	// Map of block names to block components for children.
	blockMap: Record< string, React.ReactNode >;
	// Wrapper for inner components.
	blockWrapper?: React.ElementType;
	// Elements from the DOM being converted to components.
	children: HTMLCollection | NodeList;
	// Depth within the DOM hierarchy.
	depth?: number;
} ): ( JSX.Element | null )[] | null => {
	if ( ! children || children.length === 0 ) {
		return null;
	}
	return Array.from( children ).map( ( element: Element, index: number ) => {
		/**
		 * This will grab the blockName from the data- attributes stored in block markup. Without a blockName, we cannot
		 * convert the HTMLElement to a React component.
		 */
		const { blockName = '', ...componentProps } = {
			key: `${ block }_${ depth }_${ index }`,
			...( element instanceof HTMLElement ? element.dataset : {} ),
		};

		const InnerBlockComponent = getBlockComponentFromMap(
			blockName,
			blockMap
		);

		/**
		 * If the component cannot be found, or blockName is missing, return the original element. This also ensures
		 * that children within the element are processed also, since it may be an element containing block markup.
		 *
		 * Note we use childNodes rather than children so that text nodes are also rendered.
		 */
		if ( ! InnerBlockComponent ) {
			const parsedElement = parse(
				element?.outerHTML || element?.textContent || ''
			);

			// Returns text nodes without manipulation.
			if ( typeof parsedElement === 'string' && !! parsedElement ) {
				return parsedElement;
			}

			// Do not render invalid elements.
			if ( ! isValidElement( parsedElement ) ) {
				return null;
			}

			const renderedChildren = element.childNodes.length
				? renderInnerBlocks( {
						block,
						blockMap,
						children: element.childNodes,
						depth: depth + 1,
						blockWrapper,
				  } )
				: undefined;

			return renderedChildren
				? cloneElement(
						parsedElement,
						componentProps,
						renderedChildren
				  )
				: cloneElement( parsedElement, componentProps );
		}

		// This will wrap inner blocks with the provided wrapper. If no wrapper is provided, we default to Fragment.
		const InnerBlockComponentWrapper = blockWrapper
			? blockWrapper
			: Fragment;

		return (
			<Suspense
				key={ `${ block }_${ depth }_${ index }_suspense` }
				fallback={ <div className="wc-block-placeholder" /> }
			>
				<InnerBlockComponentWrapper>
					<InnerBlockComponent { ...componentProps }>
						{
							/**
							 * Within this Inner Block Component we also need to recursively render it's children. This
							 * is done here with a depth+1. The same block map and parent is used, but we pass new
							 * children from this element.
							 */
							renderInnerBlocks( {
								block,
								blockMap,
								children: element.children,
								depth: depth + 1,
								blockWrapper,
							} )
						}
						{
							/**
							 * In addition to the inner blocks, we may also need to render FORCED blocks which have not
							 * yet been added to the inner block template. We do this by comparing the current children
							 * to the list of registered forced blocks.
							 *
							 * @see registerCheckoutBlock
							 */
							renderForcedBlocks(
								blockName,
								blockMap,
								element.children
							)
						}
					</InnerBlockComponent>
				</InnerBlockComponentWrapper>
			</Suspense>
		);
	} );
};

/**
 * Render a parent block on the frontend.
 *
 * This is the main entry point used on the frontend to convert Block Markup (with inner blocks) in the DOM to React
 * Components.
 *
 * This uses renderFrontend(). The difference is, renderFrontend renders a single block, but renderParentBlock() also
 * handles inner blocks by recursively running over children from the DOM.
 *
 * @see renderInnerBlocks
 * @see renderFrontend
 */
export const renderParentBlock = ( {
	Block,
	selector,
	blockName,
	getProps = () => ( {} ),
	blockMap,
	blockWrapper,
}: {
	// Parent Block Name. Used for inner block component mapping.
	blockName: string;
	// Map of block names to block components for children.
	blockMap: Record< string, React.ReactNode >;
	// Wrapper for inner components.
	blockWrapper?: React.ElementType;
	// React component to use as a replacement.
	Block: React.FunctionComponent;
	// CSS selector to match the elements to replace.
	selector: string;
	// Function to generate the props object for the block.
	getProps: ( el: Element, i: number ) => Record< string, unknown >;
} ): void => {
	/**
	 * In addition to getProps, we need to render and return the children. This adds children to props.
	 */
	const getPropsWithChildren = ( element: Element, i: number ) => {
		const children = renderInnerBlocks( {
			block: blockName,
			blockMap,
			children: element.children || [],
			blockWrapper,
		} );
		return { ...getProps( element, i ), children };
	};
	/**
	 * The only difference between using renderParentBlock and renderFrontend is that here we provide children.
	 */
	renderFrontend( {
		Block,
		selector,
		getProps: getPropsWithChildren,
	} );
};
woocommerce-blocks/assets/js/atomic/utils/create-blocks-from-template.js000064400000000720151335517640022527 0ustar00/**
 * External dependencies
 */
import { createBlock } from '@wordpress/blocks';

/**
 * Creates blocks for a given inner blocks Template.
 *
 * @param {Array} template Inner Blocks Template.
 */
export const createBlocksFromTemplate = ( template ) => {
	return template.map( ( [ name, atts = {}, innerBlocks = [] ] ) => {
		const children = innerBlocks
			? createBlocksFromTemplate( innerBlocks )
			: [];
		return createBlock( name, atts, children );
	} );
};
woocommerce-blocks/assets/js/atomic/blocks/component-init.js000064400000005647151335517640020334 0ustar00/**
 * External dependencies
 */
import { registerBlockComponent } from '@woocommerce/blocks-registry';
import { lazy } from '@wordpress/element';
import { WC_BLOCKS_BUILD_URL } from '@woocommerce/block-settings';

// Modify webpack publicPath at runtime based on location of WordPress Plugin.
// eslint-disable-next-line no-undef,camelcase
__webpack_public_path__ = WC_BLOCKS_BUILD_URL;

registerBlockComponent( {
	blockName: 'woocommerce/product-price',
	component: lazy( () =>
		import(
			/* webpackChunkName: "atomic-block-components/price" */ './product-elements/price/block'
		)
	),
} );

registerBlockComponent( {
	blockName: 'woocommerce/product-image',
	component: lazy( () =>
		import(
			/* webpackChunkName: "atomic-block-components/image" */ './product-elements/image/frontend'
		)
	),
} );

registerBlockComponent( {
	blockName: 'woocommerce/product-title',
	component: lazy( () =>
		import(
			/* webpackChunkName: "atomic-block-components/title" */ './product-elements/title/frontend'
		)
	),
} );

registerBlockComponent( {
	blockName: 'woocommerce/product-rating',
	component: lazy( () =>
		import(
			/* webpackChunkName: "atomic-block-components/rating" */ './product-elements/rating/block'
		)
	),
} );

registerBlockComponent( {
	blockName: 'woocommerce/product-button',
	component: lazy( () =>
		import(
			/* webpackChunkName: "atomic-block-components/button" */ './product-elements/button/block'
		)
	),
} );

registerBlockComponent( {
	blockName: 'woocommerce/product-summary',
	component: lazy( () =>
		import(
			/* webpackChunkName: "atomic-block-components/summary" */ './product-elements/summary/block'
		)
	),
} );

registerBlockComponent( {
	blockName: 'woocommerce/product-sale-badge',
	component: lazy( () =>
		import(
			/* webpackChunkName: "atomic-block-components/sale-badge" */ './product-elements/sale-badge/block'
		)
	),
} );

registerBlockComponent( {
	blockName: 'woocommerce/product-sku',
	component: lazy( () =>
		import(
			/* webpackChunkName: "atomic-block-components/sku" */ './product-elements/sku/block'
		)
	),
} );

registerBlockComponent( {
	blockName: 'woocommerce/product-category-list',
	component: lazy( () =>
		import(
			/* webpackChunkName: "atomic-block-components/category-list" */ './product-elements/category-list/block'
		)
	),
} );

registerBlockComponent( {
	blockName: 'woocommerce/product-tag-list',
	component: lazy( () =>
		import(
			/* webpackChunkName: "atomic-block-components/tag-list" */ './product-elements/tag-list/block'
		)
	),
} );

registerBlockComponent( {
	blockName: 'woocommerce/product-stock-indicator',
	component: lazy( () =>
		import(
			/* webpackChunkName: "atomic-block-components/stock-indicator" */ './product-elements/stock-indicator/block'
		)
	),
} );

registerBlockComponent( {
	blockName: 'woocommerce/product-add-to-cart',
	component: lazy( () =>
		import(
			/* webpackChunkName: "atomic-block-components/add-to-cart" */ './product-elements/add-to-cart/frontend'
		)
	),
} );
woocommerce-blocks/assets/js/atomic/blocks/product-elements/price/block.js000064400000010612151335517640023043 0ustar00/**
 * External dependencies
 */
import PropTypes from 'prop-types';
import classnames from 'classnames';
import ProductPrice from '@woocommerce/base-components/product-price';
import { getCurrencyFromPriceResponse } from '@woocommerce/price-format';
import {
	useInnerBlockLayoutContext,
	useProductDataContext,
} from '@woocommerce/shared-context';
import { getColorClassName, getFontSizeClass } from '@wordpress/block-editor';
import { isFeaturePluginBuild } from '@woocommerce/block-settings';
import { withProductDataContext } from '@woocommerce/shared-hocs';

/**
 * Product Price Block Component.
 *
 * @param {Object} props                          Incoming props.
 * @param {string} [props.className]              CSS Class name for the component.
 * @param {string} [props.align]                  Text alignment.
 * @param {string} [props.fontSize]               Normal Price font size name.
 * @param {number} [props.customFontSize]         Normal Price custom font size.
 * @param {string} [props.saleFontSize]           Original Price font size name.
 * @param {number} [props.customSaleFontSize]     Original Price custom font size.
 * @param {string} [props.color]                  Normal Price text color.
 * @param {string} [props.customColor]            Normal Price custom text color.
 * @param {string} [props.saleColor]              Original Price text color.
 * @param {string} [props.customSaleColor]        Original Price custom text color.
 * context will be used if this is not provided.
 * @return {*} The component.
 */
const Block = ( {
	className,
	align,
	fontSize,
	customFontSize,
	saleFontSize,
	customSaleFontSize,
	color,
	customColor,
	saleColor,
	customSaleColor,
} ) => {
	const { parentClassName } = useInnerBlockLayoutContext();
	const { product } = useProductDataContext();

	const wrapperClassName = classnames( className, {
		[ `${ parentClassName }__product-price` ]: parentClassName,
	} );

	if ( ! product.id ) {
		return <ProductPrice align={ align } className={ wrapperClassName } />;
	}

	const colorClass = getColorClassName( 'color', color );
	const fontSizeClass = getFontSizeClass( fontSize );
	const saleColorClass = getColorClassName( 'color', saleColor );
	const saleFontSizeClass = getFontSizeClass( saleFontSize );

	const classes = classnames( {
		'has-text-color': color || customColor,
		'has-font-size': fontSize || customFontSize,
		[ colorClass ]: colorClass,
		[ fontSizeClass ]: fontSizeClass,
	} );

	const saleClasses = classnames( {
		'has-text-color': saleColor || customSaleColor,
		'has-font-size': saleFontSize || customSaleFontSize,
		[ saleColorClass ]: saleColorClass,
		[ saleFontSizeClass ]: saleFontSizeClass,
	} );

	const style = {
		color: customColor,
		fontSize: customFontSize,
	};

	const saleStyle = {
		color: customSaleColor,
		fontSize: customSaleFontSize,
	};

	const prices = product.prices;
	const currency = getCurrencyFromPriceResponse( prices );
	const isOnSale = prices.price !== prices.regular_price;
	const priceClassName = isOnSale
		? classnames( {
				[ `${ parentClassName }__product-price__value` ]: parentClassName,
				[ saleClasses ]: isFeaturePluginBuild(),
		  } )
		: classnames( {
				[ `${ parentClassName }__product-price__value` ]: parentClassName,
				[ classes ]: isFeaturePluginBuild(),
		  } );
	const priceStyle = isOnSale ? saleStyle : style;

	return (
		<ProductPrice
			align={ align }
			className={ wrapperClassName }
			currency={ currency }
			price={ prices.price }
			priceClassName={ priceClassName }
			priceStyle={ isFeaturePluginBuild() ? priceStyle : {} }
			// Range price props
			minPrice={ prices?.price_range?.min_amount }
			maxPrice={ prices?.price_range?.max_amount }
			// This is the regular or original price when the `price` value is a sale price.
			regularPrice={ prices.regular_price }
			regularPriceClassName={ classnames( {
				[ `${ parentClassName }__product-price__regular` ]: parentClassName,
				[ classes ]: isFeaturePluginBuild(),
			} ) }
			regularPriceStyle={ isFeaturePluginBuild() ? style : {} }
		/>
	);
};

Block.propTypes = {
	className: PropTypes.string,
	product: PropTypes.object,
	align: PropTypes.string,
	fontSize: PropTypes.string,
	customFontSize: PropTypes.number,
	saleFontSize: PropTypes.string,
	customSaleFontSize: PropTypes.number,
	color: PropTypes.string,
	customColor: PropTypes.string,
	saleColor: PropTypes.string,
	customSaleColor: PropTypes.string,
};

export default withProductDataContext( Block );
woocommerce-blocks/assets/js/atomic/blocks/product-elements/price/constants.js000064400000000517151335517640023770 0ustar00/**
 * External dependencies
 */
import { __ } from '@wordpress/i18n';
import { bill, Icon } from '@woocommerce/icons';

export const BLOCK_TITLE = __(
	'Product Price',
	'woocommerce'
);
export const BLOCK_ICON = <Icon srcElement={ bill } />;
export const BLOCK_DESCRIPTION = __(
	'Display the price of a product.',
	'woocommerce'
);
woocommerce-blocks/assets/js/atomic/blocks/product-elements/price/edit.js000064400000005531151335517640022702 0ustar00/**
 * External dependencies
 */
import { __ } from '@wordpress/i18n';
import { PanelBody, BaseControl } from '@wordpress/components';
import { compose } from '@wordpress/compose';
import {
	InspectorControls,
	BlockControls,
	AlignmentToolbar,
	withColors,
	ColorPalette,
	FontSizePicker,
	withFontSizes,
} from '@wordpress/block-editor';
import { isFeaturePluginBuild } from '@woocommerce/block-settings';
/**
 * Internal dependencies
 */
import Block from './block';
import withProductSelector from '../shared/with-product-selector';
import { BLOCK_TITLE, BLOCK_ICON } from './constants';

const TextControl = ( {
	fontSize,
	setFontSize,
	color,
	setColor,
	colorLabel,
} ) => (
	<>
		<FontSizePicker value={ fontSize.size } onChange={ setFontSize } />
		{ /* ColorPalette doesn't accept an id. */
		/* eslint-disable-next-line @wordpress/no-base-control-with-label-without-id */ }
		<BaseControl label={ colorLabel }>
			<ColorPalette
				value={ color.color }
				onChange={ setColor }
				label={ __( 'Color' ) }
			/>
		</BaseControl>
	</>
);
const PriceEdit = ( {
	fontSize,
	saleFontSize,
	setFontSize,
	setSaleFontSize,
	color,
	saleColor,
	setColor,
	setSaleColor,
	attributes,
	setAttributes,
} ) => {
	const { align } = attributes;
	return (
		<>
			{ isFeaturePluginBuild() && (
				<BlockControls>
					<AlignmentToolbar
						value={ align }
						onChange={ ( nextAlign ) => {
							setAttributes( { align: nextAlign } );
						} }
					/>
				</BlockControls>
			) }
			<InspectorControls>
				{ isFeaturePluginBuild() && (
					<>
						<PanelBody
							title={ __(
								'Price',
								'woocommerce'
							) }
						>
							<TextControl
								color={ color }
								setColor={ setColor }
								fontSize={ fontSize }
								setFontSize={ setFontSize }
								colorLabel={ __(
									'Color',
									'woocommerce'
								) }
							/>
						</PanelBody>
						<PanelBody
							title={ __(
								'Sale price',
								'woocommerce'
							) }
						>
							<TextControl
								color={ saleColor }
								setColor={ setSaleColor }
								fontSize={ saleFontSize }
								setFontSize={ setSaleFontSize }
								colorLabel={ __(
									'Color',
									'woocommerce'
								) }
							/>
						</PanelBody>
					</>
				) }
			</InspectorControls>
			<Block { ...attributes } />
		</>
	);
};

const Price = isFeaturePluginBuild()
	? compose( [
			withFontSizes( 'fontSize' ),
			withFontSizes( 'saleFontSize' ),
			withFontSizes( 'originalFontSize' ),
			withColors( 'color', { textColor: 'color' } ),
			withColors( 'saleColor', { textColor: 'saleColor' } ),
			withColors( 'originalColor', { textColor: 'originalColor' } ),
			withProductSelector( {
				icon: BLOCK_ICON,
				label: BLOCK_TITLE,
				description: __(
					'Choose a product to display its price.',
					'woocommerce'
				),
			} ),
	  ] )( PriceEdit )
	: PriceEdit;

export default Price;
woocommerce-blocks/assets/js/atomic/blocks/product-elements/price/attributes.js000064400000001224151335517640024136 0ustar00/**
 * External dependencies
 */
import { isFeaturePluginBuild } from '@woocommerce/block-settings';

let blockAttributes = {
	productId: {
		type: 'number',
		default: 0,
	},
};

if ( isFeaturePluginBuild() ) {
	blockAttributes = {
		...blockAttributes,
		align: {
			type: 'string',
		},
		fontSize: {
			type: 'string',
		},
		customFontSize: {
			type: 'number',
		},
		saleFontSize: {
			type: 'string',
		},
		customSaleFontSize: {
			type: 'number',
		},
		color: {
			type: 'string',
		},
		saleColor: {
			type: 'string',
		},
		customColor: {
			type: 'string',
		},
		customSaleColor: {
			type: 'string',
		},
	};
}
export default blockAttributes;
woocommerce-blocks/assets/js/atomic/blocks/product-elements/price/index.js000064400000001051151335517640023055 0ustar00/**
 * External dependencies
 */
import { registerBlockType } from '@wordpress/blocks';

/**
 * Internal dependencies
 */
import sharedConfig from '../shared/config';
import edit from './edit';
import attributes from './attributes';
import {
	BLOCK_TITLE as title,
	BLOCK_ICON as icon,
	BLOCK_DESCRIPTION as description,
} from './constants';

const blockConfig = {
	title,
	description,
	icon: {
		src: icon,
		foreground: '#874FB9',
	},
	attributes,
	edit,
};

registerBlockType( 'woocommerce/product-price', {
	...sharedConfig,
	...blockConfig,
} );
woocommerce-blocks/assets/js/atomic/blocks/product-elements/button/constants.js000064400000000635151335517640024202 0ustar00/**
 * External dependencies
 */
import { __ } from '@wordpress/i18n';
import { cart, Icon } from '@woocommerce/icons';

export const BLOCK_TITLE = __(
	'Add to Cart Button',
	'woocommerce'
);
export const BLOCK_ICON = <Icon srcElement={ cart } />;
export const BLOCK_DESCRIPTION = __(
	'Display a call to action button which either adds the product to the cart, or links to the product page.',
	'woocommerce'
);
woocommerce-blocks/assets/js/atomic/blocks/product-elements/button/block.js000064400000006271151335517640023262 0ustar00/**
 * External dependencies
 */
import PropTypes from 'prop-types';
import classnames from 'classnames';
import { __, _n, sprintf } from '@wordpress/i18n';
import {
	useStoreEvents,
	useStoreAddToCart,
} from '@woocommerce/base-context/hooks';
import { decodeEntities } from '@wordpress/html-entities';
import {
	useInnerBlockLayoutContext,
	useProductDataContext,
} from '@woocommerce/shared-context';
import { withProductDataContext } from '@woocommerce/shared-hocs';

/**
 * Internal dependencies
 */
import './style.scss';

/**
 * Product Button Block Component.
 *
 * @param {Object} props             Incoming props.
 * @param {string} [props.className] CSS Class name for the component.
 * @return {*} The component.
 */
const Block = ( { className } ) => {
	const { parentClassName } = useInnerBlockLayoutContext();
	const { product } = useProductDataContext();

	return (
		<div
			className={ classnames(
				className,
				'wp-block-button',
				'wc-block-components-product-button',
				{
					[ `${ parentClassName }__product-add-to-cart` ]: parentClassName,
				}
			) }
		>
			{ product.id ? (
				<AddToCartButton product={ product } />
			) : (
				<AddToCartButtonPlaceholder />
			) }
		</div>
	);
};

const AddToCartButton = ( { product } ) => {
	const {
		id,
		permalink,
		add_to_cart: productCartDetails,
		has_options: hasOptions,
		is_purchasable: isPurchasable,
		is_in_stock: isInStock,
	} = product;
	const { dispatchStoreEvent } = useStoreEvents();
	const { cartQuantity, addingToCart, addToCart } = useStoreAddToCart( id );

	const addedToCart = Number.isFinite( cartQuantity ) && cartQuantity > 0;
	const allowAddToCart = ! hasOptions && isPurchasable && isInStock;
	const buttonAriaLabel = decodeEntities(
		productCartDetails?.description || ''
	);
	const buttonText = addedToCart
		? sprintf(
				/* translators: %s number of products in cart. */
				_n(
					'%d in cart',
					'%d in cart',
					cartQuantity,
					'woocommerce'
				),
				cartQuantity
		  )
		: decodeEntities(
				productCartDetails?.text ||
					__( 'Add to cart', 'woocommerce' )
		  );

	const ButtonTag = allowAddToCart ? 'button' : 'a';
	const buttonProps = {};

	if ( ! allowAddToCart ) {
		buttonProps.href = permalink;
		buttonProps.rel = 'nofollow';
		buttonProps.onClick = () => {
			dispatchStoreEvent( 'product-view-link', {
				product,
			} );
		};
	} else {
		buttonProps.onClick = () => {
			addToCart();
			dispatchStoreEvent( 'cart-add-item', {
				product,
			} );
		};
	}

	return (
		<ButtonTag
			aria-label={ buttonAriaLabel }
			className={ classnames(
				'wp-block-button__link',
				'add_to_cart_button',
				'wc-block-components-product-button__button',
				{
					loading: addingToCart,
					added: addedToCart,
				}
			) }
			disabled={ addingToCart }
			{ ...buttonProps }
		>
			{ buttonText }
		</ButtonTag>
	);
};

const AddToCartButtonPlaceholder = () => {
	return (
		<button
			className={ classnames(
				'wp-block-button__link',
				'add_to_cart_button',
				'wc-block-components-product-button__button',
				'wc-block-components-product-button__button--placeholder'
			) }
			disabled={ true }
		/>
	);
};

Block.propTypes = {
	className: PropTypes.string,
};

export default withProductDataContext( Block );
woocommerce-blocks/assets/js/atomic/blocks/product-elements/button/attributes.js000064400000000167151335517640024354 0ustar00export const blockAttributes = {
	productId: {
		type: 'number',
		default: 0,
	},
};

export default blockAttributes;
woocommerce-blocks/assets/js/atomic/blocks/product-elements/button/edit.js000064400000001136151335517640023110 0ustar00/**
 * External dependencies
 */
import { __ } from '@wordpress/i18n';
import { Disabled } from '@wordpress/components';

/**
 * Internal dependencies
 */
import Block from './block';
import withProductSelector from '../shared/with-product-selector';
import { BLOCK_TITLE, BLOCK_ICON } from './constants';

const Edit = ( { attributes } ) => {
	return (
		<Disabled>
			<Block { ...attributes } />
		</Disabled>
	);
};

export default withProductSelector( {
	icon: BLOCK_ICON,
	label: BLOCK_TITLE,
	description: __(
		'Choose a product to display its add to cart button.',
		'woocommerce'
	),
} )( Edit );
woocommerce-blocks/assets/js/atomic/blocks/product-elements/button/style.scss000064400000001617151335517640023666 0ustar00.wp-block-button.wc-block-components-product-button {
	word-break: break-word;
	white-space: normal;
	margin-top: 0;
	margin-bottom: $gap-small;

	.wc-block-components-product-button__button {
		word-break: break-word;
		white-space: normal;
		margin: 0 auto;
		display: inline-flex;
		justify-content: center;
	}

	.wc-block-components-product-button__button--placeholder {
		@include placeholder();
		min-width: 8em;
		min-height: 3em;
	}
}

.is-loading .wc-block-components-product-button > .wc-block-components-product-button__button {
	@include placeholder();
	min-width: 8em;
	min-height: 3em;
}


.theme-twentytwentyone {
	// Prevent buttons appearing disabled in the editor.
	.editor-styles-wrapper .wc-block-components-product-button .wp-block-button__link {
		background-color: var(--button--color-background);
		color: var(--button--color-text);
		border-color: var(--button--color-background);
	}
}
woocommerce-blocks/assets/js/atomic/blocks/product-elements/button/index.js000064400000001052151335517640023267 0ustar00/**
 * External dependencies
 */
import { registerBlockType } from '@wordpress/blocks';

/**
 * Internal dependencies
 */
import sharedConfig from '../shared/config';
import attributes from './attributes';
import edit from './edit';
import {
	BLOCK_TITLE as title,
	BLOCK_ICON as icon,
	BLOCK_DESCRIPTION as description,
} from './constants';

const blockConfig = {
	title,
	description,
	icon: {
		src: icon,
		foreground: '#874FB9',
	},
	attributes,
	edit,
};

registerBlockType( 'woocommerce/product-button', {
	...sharedConfig,
	...blockConfig,
} );
woocommerce-blocks/assets/js/atomic/blocks/product-elements/title/style.scss000064400000001325151335517640023470 0ustar00.wc-block-components-product-title {
	margin-top: 0;
	margin-bottom: $gap-small;
}
.wc-block-grid .wc-block-components-product-title {
	line-height: 1.5;
	font-weight: 700;
	padding: 0;
	color: inherit;
	font-size: inherit;
	display: block;
}
.is-loading {
	.wc-block-components-product-title::before {
		@include placeholder();
		content: ".";
		display: inline-block;
		width: 7em;
	}
	.wc-block-grid .wc-block-components-product-title::before {
		width: 10em;
	}
}

/*rtl:begin:ignore*/
.wc-block-components-product-title--align-left {
	text-align: left;
}
.wc-block-components-product-title--align-center {
	text-align: center;
}
.wc-block-components-product-title--align-right {
	text-align: right;
}
/*rtl:end:ignore*/
woocommerce-blocks/assets/js/atomic/blocks/product-elements/title/block.js000064400000007135151335517640023070 0ustar00/**
 * External dependencies
 */
import PropTypes from 'prop-types';
import classnames from 'classnames';
import {
	useInnerBlockLayoutContext,
	useProductDataContext,
} from '@woocommerce/shared-context';
import { getColorClassName, getFontSizeClass } from '@wordpress/block-editor';
import { isFeaturePluginBuild } from '@woocommerce/block-settings';
import { gatedStyledText } from '@woocommerce/atomic-utils';
import { withProductDataContext } from '@woocommerce/shared-hocs';
import ProductName from '@woocommerce/base-components/product-name';
import { useStoreEvents } from '@woocommerce/base-context/hooks';

/**
 * Internal dependencies
 */
import './style.scss';

/**
 * Product Title Block Component.
 *
 * @param {Object}  props                  Incoming props.
 * @param {string}  [props.className]      CSS Class name for the component.
 * @param {number}  [props.headingLevel]   Heading level (h1, h2 etc)
 * @param {boolean} [props.showProductLink]    Whether or not to display a link to the product page.
 * @param {string}  [props.align]          Title alignment.
 * @param {string}  [props.color]          Title color name.
 * @param {string}  [props.customColor]    Custom title color value.
 * @param {string}  [props.fontSize]       Title font size name.
 * @param {number } [props.customFontSize] Custom font size value.
 * will be used if this is not provided.
 * @return {*} The component.
 */
export const Block = ( {
	className,
	headingLevel = 2,
	showProductLink = true,
	align,
	color,
	customColor,
	fontSize,
	customFontSize,
} ) => {
	const { parentClassName } = useInnerBlockLayoutContext();
	const { product } = useProductDataContext();
	const { dispatchStoreEvent } = useStoreEvents();
	const TagName = `h${ headingLevel }`;

	const colorClass = getColorClassName( 'color', color );
	const fontSizeClass = getFontSizeClass( fontSize );

	const titleClasses = classnames( {
		'has-text-color': color || customColor,
		'has-font-size': fontSize || customFontSize,
		[ colorClass ]: colorClass,
		[ fontSizeClass ]: fontSizeClass,
	} );

	if ( ! product.id ) {
		return (
			<TagName
				// @ts-ignore
				className={ classnames(
					className,
					'wc-block-components-product-title',
					{
						[ `${ parentClassName }__product-title` ]: parentClassName,
						[ `wc-block-components-product-title--align-${ align }` ]:
							align && isFeaturePluginBuild(),
						[ titleClasses ]: isFeaturePluginBuild(),
					}
				) }
				style={ gatedStyledText( {
					color: customColor,
					fontSize: customFontSize,
				} ) }
			/>
		);
	}

	return (
		// @ts-ignore
		<TagName
			className={ classnames(
				className,
				'wc-block-components-product-title',
				{
					[ `${ parentClassName }__product-title` ]: parentClassName,
					[ `wc-block-components-product-title--align-${ align }` ]:
						align && isFeaturePluginBuild(),
				}
			) }
		>
			<ProductName
				className={ classnames( {
					[ titleClasses ]: isFeaturePluginBuild(),
				} ) }
				disabled={ ! showProductLink }
				name={ product.name }
				permalink={ product.permalink }
				rel={ showProductLink ? 'nofollow' : null }
				style={ gatedStyledText( {
					color: customColor,
					fontSize: customFontSize,
				} ) }
				onClick={ () => {
					dispatchStoreEvent( 'product-view-link', {
						product,
					} );
				} }
			/>
		</TagName>
	);
};

Block.propTypes = {
	className: PropTypes.string,
	headingLevel: PropTypes.number,
	showProductLink: PropTypes.bool,
	align: PropTypes.string,
	color: PropTypes.string,
	customColor: PropTypes.string,
	fontSize: PropTypes.string,
	customFontSize: PropTypes.number,
};

export default withProductDataContext( Block );
woocommerce-blocks/assets/js/atomic/blocks/product-elements/title/constants.js000064400000000527151335517640024010 0ustar00/**
 * External dependencies
 */
import { __ } from '@wordpress/i18n';
import { bookmark, Icon } from '@woocommerce/icons';

export const BLOCK_TITLE = __(
	'Product Title',
	'woocommerce'
);
export const BLOCK_ICON = <Icon srcElement={ bookmark } />;
export const BLOCK_DESCRIPTION = __(
	'Display the title of a product.',
	'woocommerce'
);
woocommerce-blocks/assets/js/atomic/blocks/product-elements/title/edit.js000064400000005435151335517640022724 0ustar00/**
 * External dependencies
 */
import { __ } from '@wordpress/i18n';
import { Disabled, PanelBody, ToggleControl } from '@wordpress/components';
import { compose } from '@wordpress/compose';
import {
	InspectorControls,
	BlockControls,
	AlignmentToolbar,
	withColors,
	PanelColorSettings,
	FontSizePicker,
	withFontSizes,
} from '@wordpress/block-editor';
import { isFeaturePluginBuild } from '@woocommerce/block-settings';
import HeadingToolbar from '@woocommerce/editor-components/heading-toolbar';

/**
 * Internal dependencies
 */
import Block from './block';
import withProductSelector from '../shared/with-product-selector';
import { BLOCK_TITLE, BLOCK_ICON } from './constants';

const TitleEdit = ( {
	color,
	fontSize,
	setFontSize,
	setColor,
	attributes,
	setAttributes,
} ) => {
	const { headingLevel, showProductLink, align } = attributes;
	return (
		<>
			<BlockControls>
				<HeadingToolbar
					isCollapsed={ true }
					minLevel={ 1 }
					maxLevel={ 7 }
					selectedLevel={ headingLevel }
					onChange={ ( newLevel ) =>
						setAttributes( { headingLevel: newLevel } )
					}
				/>
				{ isFeaturePluginBuild() && (
					<AlignmentToolbar
						value={ align }
						onChange={ ( newAlign ) => {
							setAttributes( { align: newAlign } );
						} }
					/>
				) }
			</BlockControls>
			<InspectorControls>
				<PanelBody
					title={ __( 'Content', 'woocommerce' ) }
				>
					<ToggleControl
						label={ __(
							'Link to Product Page',
							'woocommerce'
						) }
						help={ __(
							'Links the image to the single product listing.',
							'woocommerce'
						) }
						checked={ showProductLink }
						onChange={ () =>
							setAttributes( {
								showProductLink: ! showProductLink,
							} )
						}
					/>
				</PanelBody>
				{ isFeaturePluginBuild() && (
					<>
						<PanelBody
							title={ __(
								'Text settings',
								'woocommerce'
							) }
						>
							<FontSizePicker
								value={ fontSize.size }
								onChange={ setFontSize }
							/>
						</PanelBody>
						<PanelColorSettings
							title={ __(
								'Color settings',
								'woocommerce'
							) }
							colorSettings={ [
								{
									value: color.color,
									onChange: setColor,
									label: __(
										'Text color',
										'woocommerce'
									),
								},
							] }
						></PanelColorSettings>
					</>
				) }
			</InspectorControls>
			<Disabled>
				<Block { ...attributes } />
			</Disabled>
		</>
	);
};

const Title = isFeaturePluginBuild()
	? compose( [
			withFontSizes( 'fontSize' ),
			withColors( 'color', { textColor: 'color' } ),
			withProductSelector( {
				icon: BLOCK_ICON,
				label: BLOCK_TITLE,
				description: __(
					'Choose a product to display its title.',
					'woocommerce'
				),
			} ),
	  ] )( TitleEdit )
	: TitleEdit;

export default Title;
woocommerce-blocks/assets/js/atomic/blocks/product-elements/title/attributes.js000064400000001127151335517640024157 0ustar00/**
 * External dependencies
 */
import { isFeaturePluginBuild } from '@woocommerce/block-settings';

let blockAttributes = {
	headingLevel: {
		type: 'number',
		default: 2,
	},
	showProductLink: {
		type: 'boolean',
		default: true,
	},
	productId: {
		type: 'number',
		default: 0,
	},
};

if ( isFeaturePluginBuild() ) {
	blockAttributes = {
		...blockAttributes,
		align: {
			type: 'string',
		},
		color: {
			type: 'string',
		},
		customColor: {
			type: 'string',
		},
		fontSize: {
			type: 'string',
		},
		customFontSize: {
			type: 'number',
		},
	};
}
export default blockAttributes;
woocommerce-blocks/assets/js/atomic/blocks/product-elements/title/frontend.js000064400000000434151335517640023610 0ustar00/**
 * External dependencies
 */
import withFilteredAttributes from '@woocommerce/base-hocs/with-filtered-attributes';

/**
 * Internal dependencies
 */
import Block from './block';
import attributes from './attributes';

export default withFilteredAttributes( attributes )( Block );
woocommerce-blocks/assets/js/atomic/blocks/product-elements/title/index.js000064400000001051151335517640023074 0ustar00/**
 * External dependencies
 */
import { registerBlockType } from '@wordpress/blocks';

/**
 * Internal dependencies
 */
import sharedConfig from '../shared/config';
import attributes from './attributes';
import edit from './edit';
import {
	BLOCK_TITLE as title,
	BLOCK_ICON as icon,
	BLOCK_DESCRIPTION as description,
} from './constants';

const blockConfig = {
	title,
	description,
	icon: {
		src: icon,
		foreground: '#874FB9',
	},
	attributes,
	edit,
};

registerBlockType( 'woocommerce/product-title', {
	...sharedConfig,
	...blockConfig,
} );
woocommerce-blocks/assets/js/atomic/blocks/product-elements/rating/edit.js000064400000000774151335517640023070 0ustar00/**
 * External dependencies
 */
import { __ } from '@wordpress/i18n';

/**
 * Internal dependencies
 */
import Block from './block';
import withProductSelector from '../shared/with-product-selector';
import { BLOCK_TITLE, BLOCK_ICON } from './constants';

const Edit = ( { attributes } ) => {
	return <Block { ...attributes } />;
};
export default withProductSelector( {
	icon: BLOCK_ICON,
	label: BLOCK_TITLE,
	description: __(
		'Choose a product to display its rating.',
		'woocommerce'
	),
} )( Edit );
woocommerce-blocks/assets/js/atomic/blocks/product-elements/rating/constants.js000064400000000531151335517640024146 0ustar00/**
 * External dependencies
 */
import { __ } from '@wordpress/i18n';
import { star, Icon } from '@woocommerce/icons';

export const BLOCK_TITLE = __(
	'Product Rating',
	'woocommerce'
);
export const BLOCK_ICON = <Icon srcElement={ star } />;
export const BLOCK_DESCRIPTION = __(
	'Display the average rating of a product.',
	'woocommerce'
);
woocommerce-blocks/assets/js/atomic/blocks/product-elements/rating/index.js000064400000001052151335517640023240 0ustar00/**
 * External dependencies
 */
import { registerBlockType } from '@wordpress/blocks';

/**
 * Internal dependencies
 */
import sharedConfig from '../shared/config';
import attributes from './attributes';
import edit from './edit';
import {
	BLOCK_TITLE as title,
	BLOCK_ICON as icon,
	BLOCK_DESCRIPTION as description,
} from './constants';

const blockConfig = {
	title,
	description,
	icon: {
		src: icon,
		foreground: '#874FB9',
	},
	attributes,
	edit,
};

registerBlockType( 'woocommerce/product-rating', {
	...sharedConfig,
	...blockConfig,
} );
woocommerce-blocks/assets/js/atomic/blocks/product-elements/rating/attributes.js000064400000000167151335517640024325 0ustar00export const blockAttributes = {
	productId: {
		type: 'number',
		default: 0,
	},
};

export default blockAttributes;
woocommerce-blocks/assets/js/atomic/blocks/product-elements/rating/style.scss000064400000001627151335517640023640 0ustar00.wc-block-components-product-rating {
	display: block;
	margin-top: 0;
	margin-bottom: $gap-small;

	&__stars {
		overflow: hidden;
		position: relative;
		width: 5.3em;
		height: 1.618em;
		line-height: 1.618;
		font-size: 1em;
		/* stylelint-disable-next-line font-family-no-missing-generic-family-keyword */
		font-family: star;
		font-weight: 400;
		margin: 0 auto;
		text-align: left;

		&::before {
			content: "\53\53\53\53\53";
			top: 0;
			left: 0;
			right: 0;
			position: absolute;
			opacity: 0.5;
			color: #aaa;
			white-space: nowrap;
		}
		span {
			overflow: hidden;
			top: 0;
			left: 0;
			right: 0;
			position: absolute;
			padding-top: 1.5em;
		}
		span::before {
			content: "\53\53\53\53\53";
			top: 0;
			left: 0;
			right: 0;
			position: absolute;
			color: #000;
			white-space: nowrap;
		}
	}
}
.wc-block-single-product {
	.wc-block-components-product-rating__stars {
		margin: 0;
	}
}
woocommerce-blocks/assets/js/atomic/blocks/product-elements/rating/block.js000064400000003324151335517640023227 0ustar00/**
 * External dependencies
 */
import PropTypes from 'prop-types';
import { __, sprintf } from '@wordpress/i18n';
import classnames from 'classnames';
import {
	useInnerBlockLayoutContext,
	useProductDataContext,
} from '@woocommerce/shared-context';
import { withProductDataContext } from '@woocommerce/shared-hocs';

/**
 * Internal dependencies
 */
import './style.scss';

/**
 * Product Rating Block Component.
 *
 * @param {Object} props             Incoming props.
 * @param {string} [props.className] CSS Class name for the component.
 * @return {*} The component.
 */
const Block = ( { className } ) => {
	const { parentClassName } = useInnerBlockLayoutContext();
	const { product } = useProductDataContext();
	const rating = getAverageRating( product );

	if ( ! rating ) {
		return null;
	}

	const starStyle = {
		width: ( rating / 5 ) * 100 + '%',
	};

	const ratingText = sprintf(
		/* translators: %f is referring to the average rating value */
		__( 'Rated %f out of 5', 'woocommerce' ),
		rating
	);

	return (
		<div
			className={ classnames(
				className,
				'wc-block-components-product-rating',
				{
					[ `${ parentClassName }__product-rating` ]: parentClassName,
				}
			) }
		>
			<div
				className={ classnames(
					'wc-block-components-product-rating__stars',
					`${ parentClassName }__product-rating__stars`
				) }
				role="img"
				aria-label={ ratingText }
			>
				<span style={ starStyle }>{ ratingText }</span>
			</div>
		</div>
	);
};

const getAverageRating = ( product ) => {
	const rating = parseFloat( product.average_rating );

	return Number.isFinite( rating ) && rating > 0 ? rating : 0;
};

Block.propTypes = {
	className: PropTypes.string,
};

export default withProductDataContext( Block );
woocommerce-blocks/assets/js/atomic/blocks/product-elements/shared/with-product-selector.js000064400000004454151335517640026373 0ustar00/**
 * External dependencies
 */
import { __ } from '@wordpress/i18n';
import { useState } from '@wordpress/element';
import ProductControl from '@woocommerce/editor-components/product-control';
import { Placeholder, Button, ToolbarGroup } from '@wordpress/components';
import { BlockControls } from '@wordpress/block-editor';
import TextToolbarButton from '@woocommerce/editor-components/text-toolbar-button';
import { useProductDataContext } from '@woocommerce/shared-context';

/**
 * Internal dependencies
 */
import './editor.scss';

/**
 * This HOC shows a product selection interface if context is not present in the editor.
 *
 * @param {Object} selectorArgs Options for the selector.
 *
 */
const withProductSelector = ( selectorArgs ) => ( OriginalComponent ) => {
	return ( props ) => {
		const productDataContext = useProductDataContext();
		const { attributes, setAttributes } = props;
		const { productId } = attributes;
		const [ isEditing, setIsEditing ] = useState( ! productId );

		if ( productDataContext.hasContext ) {
			return <OriginalComponent { ...props } />;
		}

		return (
			<>
				{ isEditing ? (
					<Placeholder
						icon={ selectorArgs.icon || '' }
						label={ selectorArgs.label || '' }
						className="wc-atomic-blocks-product"
					>
						{ !! selectorArgs.description && (
							<div>{ selectorArgs.description }</div>
						) }
						<div className="wc-atomic-blocks-product__selection">
							<ProductControl
								selected={ productId || 0 }
								showVariations
								onChange={ ( value = [] ) => {
									setAttributes( {
										productId: value[ 0 ]
											? value[ 0 ].id
											: 0,
									} );
								} }
							/>
							<Button
								isSecondary
								disabled={ ! productId }
								onClick={ () => {
									setIsEditing( false );
								} }
							>
								{ __( 'Done', 'woocommerce' ) }
							</Button>
						</div>
					</Placeholder>
				) : (
					<>
						<BlockControls>
							<ToolbarGroup>
								<TextToolbarButton
									onClick={ () => setIsEditing( true ) }
								>
									{ __(
										'Switch product…',
										'woocommerce'
									) }
								</TextToolbarButton>
							</ToolbarGroup>
						</BlockControls>
						<OriginalComponent { ...props } />
					</>
				) }
			</>
		);
	};
};

export default withProductSelector;
woocommerce-blocks/assets/js/atomic/blocks/product-elements/shared/config.tsx000064400000001745151335517640023573 0ustar00/**
 * External dependencies
 */
import { __ } from '@wordpress/i18n';
import { Icon, grid } from '@woocommerce/icons';
import { isExperimentalBuild } from '@woocommerce/block-settings';
import type { BlockConfiguration } from '@wordpress/blocks';
/**
 * Internal dependencies
 */
import save from '../save';

/**
 * Holds default config for this collection of blocks.
 * attributes and title are omitted here as these are added on an individual block level.
 */
const sharedConfig: Omit< BlockConfiguration, 'attributes' | 'title' > = {
	category: 'woocommerce-product-elements',
	keywords: [ __( 'WooCommerce', 'woo-gutenberg-products-block' ) ],
	icon: {
		src: <Icon srcElement={ grid } />,
		foreground: '#96588a',
	},
	supports: {
		html: false,
	},
	parent: isExperimentalBuild()
		? undefined
		: [ '@woocommerce/all-products', '@woocommerce/single-product' ],
	save,
	deprecated: [
		{
			attributes: {},
			save(): null {
				return null;
			},
		},
	],
};

export default sharedConfig;
woocommerce-blocks/assets/js/atomic/blocks/product-elements/shared/editor.scss000064400000000330151335517640023736 0ustar00.wc-atomic-blocks-product__selection {
	width: 100%;
}
.wc-atomic-blocks-product__edit-card {
	padding: 16px;
	border-top: 1px solid $gray-200;

	.wc-atomic-blocks-product__edit-card-title {
		margin: 0 0 $gap;
	}
}
woocommerce-blocks/assets/js/atomic/blocks/product-elements/stock-indicator/style.scss000064400000000465151335517640025450 0ustar00.wc-block-components-product-stock-indicator {
	margin-top: 0;
	margin-bottom: em($gap-small);
	display: block;
	@include font-size(small);

	&--in-stock {
		color: $in-stock-color;
	}
	&--out-of-stock {
		color: $no-stock-color;
	}
	&--low-stock,
	&--available-on-backorder {
		color: $low-stock-color;
	}
}
woocommerce-blocks/assets/js/atomic/blocks/product-elements/stock-indicator/edit.js000064400000001166151335517640024675 0ustar00/**
 * External dependencies
 */
import { __ } from '@wordpress/i18n';
import EditProductLink from '@woocommerce/editor-components/edit-product-link';

/**
 * Internal dependencies
 */
import Block from './block';
import withProductSelector from '../shared/with-product-selector';
import { BLOCK_TITLE, BLOCK_ICON } from './constants';

const Edit = ( { attributes } ) => {
	return (
		<>
			<EditProductLink />
			<Block { ...attributes } />
		</>
	);
};

export default withProductSelector( {
	icon: BLOCK_ICON,
	label: BLOCK_TITLE,
	description: __(
		'Choose a product to display its stock.',
		'woocommerce'
	),
} )( Edit );
woocommerce-blocks/assets/js/atomic/blocks/product-elements/stock-indicator/attributes.js000064400000000167151335517640026136 0ustar00export const blockAttributes = {
	productId: {
		type: 'number',
		default: 0,
	},
};

export default blockAttributes;
woocommerce-blocks/assets/js/atomic/blocks/product-elements/stock-indicator/constants.js000064400000000525151335517640025762 0ustar00/**
 * External dependencies
 */
import { __ } from '@wordpress/i18n';
import { box, Icon } from '@woocommerce/icons';

export const BLOCK_TITLE = __(
	'Product Stock Indicator',
	'woocommerce'
);
export const BLOCK_ICON = <Icon srcElement={ box } />;
export const BLOCK_DESCRIPTION = __(
	'Display product stock status.',
	'woocommerce'
);
woocommerce-blocks/assets/js/atomic/blocks/product-elements/stock-indicator/index.js000064400000001125151335517640025052 0ustar00/**
 * External dependencies
 */
import { registerExperimentalBlockType } from '@woocommerce/block-settings';

/**
 * Internal dependencies
 */
import sharedConfig from '../shared/config';
import attributes from './attributes';
import edit from './edit';
import {
	BLOCK_TITLE as title,
	BLOCK_ICON as icon,
	BLOCK_DESCRIPTION as description,
} from './constants';

const blockConfig = {
	title,
	description,
	icon: {
		src: icon,
		foreground: '#874FB9',
	},
	attributes,
	edit,
};

registerExperimentalBlockType( 'woocommerce/product-stock-indicator', {
	...sharedConfig,
	...blockConfig,
} );
woocommerce-blocks/assets/js/atomic/blocks/product-elements/stock-indicator/block.js000064400000004050151335517640025035 0ustar00/**
 * External dependencies
 */
import { __, sprintf } from '@wordpress/i18n';
import PropTypes from 'prop-types';
import classnames from 'classnames';
import {
	useInnerBlockLayoutContext,
	useProductDataContext,
} from '@woocommerce/shared-context';
import { withProductDataContext } from '@woocommerce/shared-hocs';

/**
 * Internal dependencies
 */
import './style.scss';

/**
 * Product Stock Indicator Block Component.
 *
 * @param {Object} props             Incoming props.
 * @param {string} [props.className] CSS Class name for the component.
 * @return {*} The component.
 */
const Block = ( { className } ) => {
	const { parentClassName } = useInnerBlockLayoutContext();
	const { product } = useProductDataContext();

	if ( ! product.id || ! product.is_purchasable ) {
		return null;
	}

	const inStock = !! product.is_in_stock;
	const lowStock = product.low_stock_remaining;
	const isBackordered = product.is_on_backorder;

	return (
		<div
			className={ classnames(
				className,
				'wc-block-components-product-stock-indicator',
				{
					[ `${ parentClassName }__stock-indicator` ]: parentClassName,
					'wc-block-components-product-stock-indicator--in-stock': inStock,
					'wc-block-components-product-stock-indicator--out-of-stock': ! inStock,
					'wc-block-components-product-stock-indicator--low-stock': !! lowStock,
					'wc-block-components-product-stock-indicator--available-on-backorder': !! isBackordered,
				}
			) }
		>
			{ lowStock
				? lowStockText( lowStock )
				: stockText( inStock, isBackordered ) }
		</div>
	);
};

const lowStockText = ( lowStock ) => {
	return sprintf(
		/* translators: %d stock amount (number of items in stock for product) */
		__( '%d left in stock', 'woocommerce' ),
		lowStock
	);
};

const stockText = ( inStock, isBackordered ) => {
	if ( isBackordered ) {
		return __( 'Available on backorder', 'woocommerce' );
	}

	return inStock
		? __( 'In Stock', 'woocommerce' )
		: __( 'Out of Stock', 'woocommerce' );
};

Block.propTypes = {
	className: PropTypes.string,
};

export default withProductDataContext( Block );
woocommerce-blocks/assets/js/atomic/blocks/product-elements/category-list/block.js000064400000002613151335517640024531 0ustar00/**
 * External dependencies
 */
import { __ } from '@wordpress/i18n';
import PropTypes from 'prop-types';
import classnames from 'classnames';
import {
	useInnerBlockLayoutContext,
	useProductDataContext,
} from '@woocommerce/shared-context';
import { isEmpty } from 'lodash';
import { withProductDataContext } from '@woocommerce/shared-hocs';

/**
 * Internal dependencies
 */
import './style.scss';

/**
 * Product Category Block Component.
 *
 * @param {Object} props             Incoming props.
 * @param {string} [props.className] CSS Class name for the component.
 * @return {*} The component.
 */
const Block = ( { className } ) => {
	const { parentClassName } = useInnerBlockLayoutContext();
	const { product } = useProductDataContext();

	if ( isEmpty( product.categories ) ) {
		return null;
	}

	return (
		<div
			className={ classnames(
				className,
				'wc-block-components-product-category-list',
				{
					[ `${ parentClassName }__product-category-list` ]: parentClassName,
				}
			) }
		>
			{ __( 'Categories:', 'woocommerce' ) }{ ' ' }
			<ul>
				{ Object.values( product.categories ).map(
					( { name, link, slug } ) => {
						return (
							<li key={ `category-list-item-${ slug }` }>
								<a href={ link }>{ name }</a>
							</li>
						);
					}
				) }
			</ul>
		</div>
	);
};

Block.propTypes = {
	className: PropTypes.string,
};

export default withProductDataContext( Block );
woocommerce-blocks/assets/js/atomic/blocks/product-elements/category-list/attributes.js000064400000000167151335517640025627 0ustar00export const blockAttributes = {
	productId: {
		type: 'number',
		default: 0,
	},
};

export default blockAttributes;
woocommerce-blocks/assets/js/atomic/blocks/product-elements/category-list/edit.js000064400000001313151335517640024360 0ustar00/**
 * External dependencies
 */
import { __ } from '@wordpress/i18n';
import { Disabled } from '@wordpress/components';
import EditProductLink from '@woocommerce/editor-components/edit-product-link';

/**
 * Internal dependencies
 */
import Block from './block';
import withProductSelector from '../shared/with-product-selector';
import { BLOCK_TITLE, BLOCK_ICON } from './constants';

const Edit = ( { attributes } ) => {
	return (
		<>
			<EditProductLink />
			<Disabled>
				<Block { ...attributes } />
			</Disabled>
		</>
	);
};

export default withProductSelector( {
	icon: BLOCK_ICON,
	label: BLOCK_TITLE,
	description: __(
		'Choose a product to display its categories.',
		'woocommerce'
	),
} )( Edit );
woocommerce-blocks/assets/js/atomic/blocks/product-elements/category-list/constants.js000064400000000560151335517640025452 0ustar00/**
 * External dependencies
 */
import { __ } from '@wordpress/i18n';
import { folder, Icon } from '@woocommerce/icons';

export const BLOCK_TITLE = __(
	'Product Category List',
	'woocommerce'
);
export const BLOCK_ICON = <Icon srcElement={ folder } />;
export const BLOCK_DESCRIPTION = __(
	'Display a list of categories belonging to a product.',
	'woocommerce'
);
woocommerce-blocks/assets/js/atomic/blocks/product-elements/category-list/style.scss000064400000000437151335517640025140 0ustar00.wc-block-components-product-category-list {
	margin-top: 0;
	margin-bottom: em($gap-small);

	ul {
		margin: 0;
		padding: 0;
		display: inline;

		li {
			display: inline;
			list-style: none;
		}

		li::after {
			content: ", ";
		}

		li:last-child::after {
			content: "";
		}
	}
}
woocommerce-blocks/assets/js/atomic/blocks/product-elements/category-list/index.js000064400000001123151335517640024541 0ustar00/**
 * External dependencies
 */
import { registerExperimentalBlockType } from '@woocommerce/block-settings';

/**
 * Internal dependencies
 */
import sharedConfig from '../shared/config';
import attributes from './attributes';
import edit from './edit';
import {
	BLOCK_TITLE as title,
	BLOCK_ICON as icon,
	BLOCK_DESCRIPTION as description,
} from './constants';

const blockConfig = {
	title,
	description,
	icon: {
		src: icon,
		foreground: '#874FB9',
	},
	attributes,
	edit,
};

registerExperimentalBlockType( 'woocommerce/product-category-list', {
	...sharedConfig,
	...blockConfig,
} );
woocommerce-blocks/assets/js/atomic/blocks/product-elements/summary/attributes.js000064400000000167151335517640024536 0ustar00export const blockAttributes = {
	productId: {
		type: 'number',
		default: 0,
	},
};

export default blockAttributes;
woocommerce-blocks/assets/js/atomic/blocks/product-elements/summary/index.js000064400000001053151335517640023452 0ustar00/**
 * External dependencies
 */
import { registerBlockType } from '@wordpress/blocks';

/**
 * Internal dependencies
 */
import sharedConfig from '../shared/config';
import attributes from './attributes';
import edit from './edit';
import {
	BLOCK_TITLE as title,
	BLOCK_ICON as icon,
	BLOCK_DESCRIPTION as description,
} from './constants';

const blockConfig = {
	title,
	description,
	icon: {
		src: icon,
		foreground: '#874FB9',
	},
	attributes,
	edit,
};

registerBlockType( 'woocommerce/product-summary', {
	...sharedConfig,
	...blockConfig,
} );
woocommerce-blocks/assets/js/atomic/blocks/product-elements/summary/constants.js000064400000000540151335517640024357 0ustar00/**
 * External dependencies
 */
import { __ } from '@wordpress/i18n';
import { notes, Icon } from '@woocommerce/icons';

export const BLOCK_TITLE = __(
	'Product Summary',
	'woocommerce'
);
export const BLOCK_ICON = <Icon srcElement={ notes } />;
export const BLOCK_DESCRIPTION = __(
	'Display a short description about a product.',
	'woocommerce'
);
woocommerce-blocks/assets/js/atomic/blocks/product-elements/summary/style.scss000064400000000347151335517640024047 0ustar00.wc-block-components-product-summary {
	margin-top: 0;
	margin-bottom: $gap-small;
}
.is-loading .wc-block-components-product-summary::before {
	@include placeholder();
	content: ".";
	display: block;
	width: 100%;
	height: 6em;
}
woocommerce-blocks/assets/js/atomic/blocks/product-elements/summary/edit.js000064400000001010151335517640023261 0ustar00/**
 * External dependencies
 */
import { __ } from '@wordpress/i18n';

/**
 * Internal dependencies
 */
import Block from './block';
import withProductSelector from '../shared/with-product-selector';
import { BLOCK_TITLE, BLOCK_ICON } from './constants';

const Edit = ( { attributes } ) => {
	return <Block { ...attributes } />;
};

export default withProductSelector( {
	icon: BLOCK_ICON,
	label: BLOCK_TITLE,
	description: __(
		'Choose a product to display its short description.',
		'woocommerce'
	),
} )( Edit );
woocommerce-blocks/assets/js/atomic/blocks/product-elements/summary/block.js000064400000003037151335517640023441 0ustar00/**
 * External dependencies
 */
import PropTypes from 'prop-types';
import classnames from 'classnames';
import Summary from '@woocommerce/base-components/summary';
import { blocksConfig } from '@woocommerce/block-settings';
import {
	useInnerBlockLayoutContext,
	useProductDataContext,
} from '@woocommerce/shared-context';
import { withProductDataContext } from '@woocommerce/shared-hocs';

/**
 * Internal dependencies
 */
import './style.scss';

/**
 * Product Summary Block Component.
 *
 * @param {Object} props             Incoming props.
 * @param {string} [props.className] CSS Class name for the component.
 * @return {*} The component.
 */
const Block = ( { className } ) => {
	const { parentClassName } = useInnerBlockLayoutContext();
	const { product } = useProductDataContext();

	if ( ! product ) {
		return (
			<div
				className={ classnames(
					className,
					`wc-block-components-product-summary`,
					{
						[ `${ parentClassName }__product-summary` ]: parentClassName,
					}
				) }
			/>
		);
	}

	const source = product.short_description
		? product.short_description
		: product.description;

	if ( ! source ) {
		return null;
	}

	return (
		<Summary
			className={ classnames(
				className,
				`wc-block-components-product-summary`,
				{
					[ `${ parentClassName }__product-summary` ]: parentClassName,
				}
			) }
			source={ source }
			maxLength={ 150 }
			countType={ blocksConfig.wordCountType || 'words' }
		/>
	);
};

Block.propTypes = {
	className: PropTypes.string,
};

export default withProductDataContext( Block );
woocommerce-blocks/assets/js/atomic/blocks/product-elements/add-to-cart/style.scss000064400000002055151335517640024447 0ustar00.wc-block-components-product-add-to-cart {
	margin: 0;
	display: flex;
	flex-wrap: wrap;

	.wc-block-components-product-add-to-cart-button {
		margin: 0 0 em($gap-small) 0;

		.wc-block-components-button__text {
			display: block;

			> svg {
				fill: currentColor;
				vertical-align: top;
				width: 1.5em;
				height: 1.5em;
				margin: -0.25em 0 -0.25em 0.5em;
			}
		}
	}

	.wc-block-components-product-add-to-cart-quantity {
		margin: 0 1em em($gap-small) 0;
		flex-basis: 5em;
		padding: 0.618em;
		background: $white;
		border: 1px solid #ccc;
		border-radius: 2px;
		color: #43454b;
		box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.125);
		text-align: center;
	}
}

.is-loading .wc-block-components-product-add-to-cart,
.wc-block-components-product-add-to-cart--placeholder {
	.wc-block-components-product-add-to-cart-quantity,
	.wc-block-components-product-add-to-cart-button {
		@include placeholder();
	}
}

.wc-block-grid .wc-block-components-product-add-to-cart {
	justify-content: center;
}

.wc-block-components-product-add-to-cart-notice {
	margin: 0;
}
woocommerce-blocks/assets/js/atomic/blocks/product-elements/add-to-cart/edit.js000064400000004235151335517640023677 0ustar00/**
 * External dependencies
 */
import { __ } from '@wordpress/i18n';
import EditProductLink from '@woocommerce/editor-components/edit-product-link';
import { useProductDataContext } from '@woocommerce/shared-context';
import classnames from 'classnames';
import {
	Disabled,
	PanelBody,
	ToggleControl,
	Notice,
} from '@wordpress/components';
import { InspectorControls } from '@wordpress/block-editor';
import { productSupportsAddToCartForm } from '@woocommerce/base-utils';

/**
 * Internal dependencies
 */
import './style.scss';
import Block from './block';
import withProductSelector from '../shared/with-product-selector';
import { BLOCK_TITLE, BLOCK_ICON } from './constants';

const Edit = ( { attributes, setAttributes } ) => {
	const { product } = useProductDataContext();
	const { className, showFormElements } = attributes;

	return (
		<div
			className={ classnames(
				className,
				'wc-block-components-product-add-to-cart'
			) }
		>
			<EditProductLink productId={ product.id } />
			<InspectorControls>
				<PanelBody
					title={ __( 'Layout', 'woocommerce' ) }
				>
					{ productSupportsAddToCartForm( product ) ? (
						<ToggleControl
							label={ __(
								'Display form elements',
								'woocommerce'
							) }
							help={ __(
								'Depending on product type, allow customers to select a quantity, variations etc.',
								'woocommerce'
							) }
							checked={ showFormElements }
							onChange={ () =>
								setAttributes( {
									showFormElements: ! showFormElements,
								} )
							}
						/>
					) : (
						<Notice
							className="wc-block-components-product-add-to-cart-notice"
							isDismissible={ false }
							status="info"
						>
							{ __(
								'This product does not support the block based add to cart form. A link to the product page will be shown instead.',
								'woocommerce'
							) }
						</Notice>
					) }
				</PanelBody>
			</InspectorControls>
			<Disabled>
				<Block { ...attributes } />
			</Disabled>
		</div>
	);
};

export default withProductSelector( {
	icon: BLOCK_ICON,
	label: BLOCK_TITLE,
	description: __(
		'Choose a product to display its add to cart form.',
		'woocommerce'
	),
} )( Edit );
woocommerce-blocks/assets/js/atomic/blocks/product-elements/add-to-cart/index.js000064400000001121151335517640024050 0ustar00/**
 * External dependencies
 */
import { registerExperimentalBlockType } from '@woocommerce/block-settings';

/**
 * Internal dependencies
 */
import sharedConfig from '../shared/config';
import edit from './edit';
import attributes from './attributes';
import {
	BLOCK_TITLE as title,
	BLOCK_ICON as icon,
	BLOCK_DESCRIPTION as description,
} from './constants';

const blockConfig = {
	title,
	description,
	icon: {
		src: icon,
		foreground: '#874FB9',
	},
	edit,
	attributes,
};

registerExperimentalBlockType( 'woocommerce/product-add-to-cart', {
	...sharedConfig,
	...blockConfig,
} );
woocommerce-blocks/assets/js/atomic/blocks/product-elements/add-to-cart/constants.js000064400000000600151335517640024756 0ustar00/**
 * External dependencies
 */
import { __ } from '@wordpress/i18n';
import { cart, Icon } from '@woocommerce/icons';

export const BLOCK_TITLE = __( 'Add to Cart', 'woocommerce' );
export const BLOCK_ICON = <Icon srcElement={ cart } />;
export const BLOCK_DESCRIPTION = __(
	'Displays an add to cart button. Optionally displays other add to cart form elements.',
	'woocommerce'
);
woocommerce-blocks/assets/js/atomic/blocks/product-elements/add-to-cart/shared/quantity-input.js000064400000001506151335517640027231 0ustar00/**
 * Quantity Input Component.
 *
 * @param {Object}         props          Incoming props for component
 * @param {boolean}        props.disabled Whether input is disabled or not.
 * @param {number}         props.min      Minimum value for input.
 * @param {number}         props.max      Maximum value for input.
 * @param {number}         props.value    Value for input.
 * @param {function():any} props.onChange Function to call on input change event.
 */
const QuantityInput = ( { disabled, min, max, value, onChange } ) => {
	return (
		<input
			className="wc-block-components-product-add-to-cart-quantity"
			type="number"
			value={ value }
			min={ min }
			max={ max }
			hidden={ max === 1 }
			disabled={ disabled }
			onChange={ ( e ) => {
				onChange( e.target.value );
			} }
		/>
	);
};

export default QuantityInput;
woocommerce-blocks/assets/js/atomic/blocks/product-elements/add-to-cart/shared/add-to-cart-button.js000064400000010512151335517640027623 0ustar00/**
 * External dependencies
 */
import { __, _n, sprintf } from '@wordpress/i18n';
import Button from '@woocommerce/base-components/button';
import { Icon, done as doneIcon } from '@woocommerce/icons';
import { useState, useEffect } from '@wordpress/element';
import { useAddToCartFormContext } from '@woocommerce/base-context';
import {
	useStoreEvents,
	useStoreAddToCart,
} from '@woocommerce/base-context/hooks';
import { useInnerBlockLayoutContext } from '@woocommerce/shared-context';

/**
 * Add to Cart Form Button Component.
 */
const AddToCartButton = () => {
	const {
		showFormElements,
		productIsPurchasable,
		productHasOptions,
		product,
		productType,
		isDisabled,
		isProcessing,
		eventRegistration,
		hasError,
		dispatchActions,
	} = useAddToCartFormContext();
	const { parentName } = useInnerBlockLayoutContext();
	const { dispatchStoreEvent } = useStoreEvents();
	const { cartQuantity } = useStoreAddToCart( product.id || 0 );
	const [ addedToCart, setAddedToCart ] = useState( false );
	const addToCartButtonData = product.add_to_cart || {
		url: '',
		text: '',
	};

	// Subscribe to emitter for after processing.
	useEffect( () => {
		const onSuccess = () => {
			if ( ! hasError ) {
				setAddedToCart( true );
			}
			return true;
		};
		const unsubscribeProcessing = eventRegistration.onAddToCartAfterProcessingWithSuccess(
			onSuccess,
			0
		);
		return () => {
			unsubscribeProcessing();
		};
	}, [ eventRegistration, hasError ] );

	/**
	 * We can show a real button if we are:
	 *
	 *  	a) Showing a full add to cart form.
	 * 		b) The product doesn't have options and can therefore be added directly to the cart.
	 * 		c) The product is purchasable.
	 *
	 * Otherwise we show a link instead.
	 */
	const showButton =
		( showFormElements ||
			( ! productHasOptions && productType === 'simple' ) ) &&
		productIsPurchasable;

	return showButton ? (
		<ButtonComponent
			className="wc-block-components-product-add-to-cart-button"
			quantityInCart={ cartQuantity }
			isDisabled={ isDisabled }
			isProcessing={ isProcessing }
			isDone={ addedToCart }
			onClick={ () => {
				dispatchActions.submitForm();
				dispatchStoreEvent( 'cart-add-item', {
					product,
					listName: parentName,
				} );
			} }
		/>
	) : (
		<LinkComponent
			className="wc-block-components-product-add-to-cart-button"
			href={ addToCartButtonData.url }
			text={
				addToCartButtonData.text ||
				__( 'View Product', 'woocommerce' )
			}
			onClick={ () => {
				dispatchStoreEvent( 'product-view-link', {
					product,
					listName: parentName,
				} );
			} }
		/>
	);
};

/**
 * Button component for non-purchasable products.
 *
 * @param {Object} props           Incoming props.
 * @param {string} props.className Css classnames.
 * @param {string} props.href      Link for button.
 * @param {string} props.text      Text content for button.
 * @param {function():any} props.onClick Callback to execute when button is clicked.
 */
const LinkComponent = ( { className, href, text, onClick } ) => {
	return (
		<Button
			className={ className }
			href={ href }
			onClick={ onClick }
			rel="nofollow"
		>
			{ text }
		</Button>
	);
};

/**
 * Button for purchasable products.
 *
 * @param {Object} props                 Incoming props for component
 * @param {string} props.className       Incoming css class name.
 * @param {number} props.quantityInCart  Quantity of item in cart.
 * @param {boolean} props.isProcessing   Whether processing action is occurring.
 * @param {boolean} props.isDisabled     Whether the button is disabled or not.
 * @param {boolean} props.isDone         Whether processing is done.
 * @param {function():any} props.onClick Callback to execute when button is clicked.
 */
const ButtonComponent = ( {
	className,
	quantityInCart,
	isProcessing,
	isDisabled,
	isDone,
	onClick,
} ) => {
	return (
		<Button
			className={ className }
			disabled={ isDisabled }
			showSpinner={ isProcessing }
			onClick={ onClick }
		>
			{ isDone && quantityInCart > 0
				? sprintf(
						/* translators: %s number of products in cart. */
						_n(
							'%d in cart',
							'%d in cart',
							quantityInCart,
							'woocommerce'
						),
						quantityInCart
				  )
				: __( 'Add to cart', 'woocommerce' ) }
			{ !! isDone && (
				<Icon
					srcElement={ doneIcon }
					alt={ __( 'Done', 'woocommerce' ) }
				/>
			) }
		</Button>
	);
};

export default AddToCartButton;
woocommerce-blocks/assets/js/atomic/blocks/product-elements/add-to-cart/shared/index.js000064400000000307151335517640025323 0ustar00export { default as AddToCartButton } from './add-to-cart-button';
export { default as QuantityInput } from './quantity-input';
export { default as ProductUnavailable } from './product-unavailable';
assets/js/atomic/blocks/product-elements/add-to-cart/shared/product-unavailable.js000064400000000524151335517640030077 0ustar00woocommerce-blocks/**
 * External dependencies
 */
import { __ } from '@wordpress/i18n';

const ProductUnavailable = ( {
	reason = __(
		'Sorry, this product cannot be purchased.',
		'woocommerce'
	),
} ) => {
	return (
		<div className="wc-block-components-product-add-to-cart-unavailable">
			{ reason }
		</div>
	);
};

export default ProductUnavailable;
assets/js/atomic/blocks/product-elements/add-to-cart/product-types/grouped/index.js000064400000000277151335517640030273 0ustar00woocommerce-blocks/**
 * Internal dependencies
 */
import GroupList from './group-list';

/**
 * Grouped Product Add To Cart Form
 */
const Grouped = () => {
	return <GroupList />;
};

export default Grouped;
assets/js/atomic/blocks/product-elements/add-to-cart/product-types/grouped/group-list/index.js000064400000000510151335517640032366 0ustar00woocommerce-blocks/**
 * External dependencies
 */
import { Placeholder } from 'wordpress-components';

const GroupedProducts = () => {
	return (
		<Placeholder className="wc-block-components-product-add-to-cart-group-list">
			This is a placeholder for the grouped products form element.
		</Placeholder>
	);
};

export default GroupedProducts;
product-elements/add-to-cart/product-types/variable/variation-attributes/attribute-select-control.js000064400000003673151335517640040425 0ustar00woocommerce-blocks/assets/js/atomic/blocks/**
 * External dependencies
 */
import { __ } from '@wordpress/i18n';
import { decodeEntities } from '@wordpress/html-entities';
import { SelectControl } from 'wordpress-components';
import { useEffect } from 'react';
import classnames from 'classnames';
import {
	ValidationInputError,
	useValidationContext,
} from '@woocommerce/base-context';

// Default option for select boxes.
const selectAnOption = {
	value: '',
	label: __( 'Select an option', 'woocommerce' ),
};

/**
 * VariationAttributeSelect component.
 *
 * @param {*} props Component props.
 */
const AttributeSelectControl = ( {
	attributeName,
	options = [],
	value = '',
	onChange = () => {},
	errorMessage = __(
		'Please select a value.',
		'woocommerce'
	),
} ) => {
	const {
		getValidationError,
		setValidationErrors,
		clearValidationError,
	} = useValidationContext();
	const errorId = attributeName;
	const error = getValidationError( errorId ) || {};

	useEffect( () => {
		if ( value ) {
			clearValidationError( errorId );
		} else {
			setValidationErrors( {
				[ errorId ]: {
					message: errorMessage,
					hidden: true,
				},
			} );
		}
	}, [
		value,
		errorId,
		errorMessage,
		clearValidationError,
		setValidationErrors,
	] );

	// Remove validation errors when unmounted.
	useEffect( () => () => void clearValidationError( errorId ), [
		errorId,
		clearValidationError,
	] );

	return (
		<div className="wc-block-components-product-add-to-cart-attribute-picker__container">
			<SelectControl
				label={ decodeEntities( attributeName ) }
				value={ value || '' }
				options={ [ selectAnOption, ...options ] }
				onChange={ onChange }
				required={ true }
				className={ classnames(
					'wc-block-components-product-add-to-cart-attribute-picker__select',
					{
						'has-error': error.message && ! error.hidden,
					}
				) }
			/>
			<ValidationInputError
				propertyName={ errorId }
				elementId={ errorId }
			/>
		</div>
	);
};

export default AttributeSelectControl;
atomic/blocks/product-elements/add-to-cart/product-types/variable/variation-attributes/test/index.js000064400000022126151335517640035547 0ustar00woocommerce-blocks/assets/js/**
 * Internal dependencies
 */
import {
	getAttributes,
	getVariationAttributes,
	getVariationsMatchingSelectedAttributes,
	getVariationMatchingSelectedAttributes,
	getActiveSelectControlOptions,
	getDefaultAttributes,
} from '../utils';

const rawAttributeData = [
	{
		id: 1,
		name: 'Color',
		taxonomy: 'pa_color',
		has_variations: true,
		terms: [
			{
				id: 22,
				name: 'Blue',
				slug: 'blue',
				default: true,
			},
			{
				id: 23,
				name: 'Green',
				slug: 'green',
				default: false,
			},
			{
				id: 24,
				name: 'Red',
				slug: 'red',
				default: false,
			},
		],
	},
	{
		id: 0,
		name: 'Logo',
		taxonomy: null,
		has_variations: true,
		terms: [
			{
				id: 0,
				name: 'Yes',
				slug: 'Yes',
				default: true,
			},
			{
				id: 0,
				name: 'No',
				slug: 'No',
				default: false,
			},
		],
	},
	{
		id: 0,
		name: 'Non-variable attribute',
		taxonomy: null,
		has_variations: false,
		terms: [
			{
				id: 0,
				name: 'Test',
				slug: 'Test',
				default: false,
			},
			{
				id: 0,
				name: 'Test 2',
				slug: 'Test 2',
				default: false,
			},
		],
	},
];

const rawVariations = [
	{
		id: 35,
		attributes: [
			{
				name: 'Color',
				value: 'blue',
			},
			{
				name: 'Logo',
				value: 'Yes',
			},
		],
	},
	{
		id: 28,
		attributes: [
			{
				name: 'Color',
				value: 'red',
			},
			{
				name: 'Logo',
				value: 'No',
			},
		],
	},
	{
		id: 29,
		attributes: [
			{
				name: 'Color',
				value: 'green',
			},
			{
				name: 'Logo',
				value: 'No',
			},
		],
	},
	{
		id: 30,
		attributes: [
			{
				name: 'Color',
				value: 'blue',
			},
			{
				name: 'Logo',
				value: 'No',
			},
		],
	},
];

const formattedAttributes = {
	Color: {
		id: 1,
		name: 'Color',
		taxonomy: 'pa_color',
		has_variations: true,
		terms: [
			{
				id: 22,
				name: 'Blue',
				slug: 'blue',
				default: true,
			},
			{
				id: 23,
				name: 'Green',
				slug: 'green',
				default: false,
			},
			{
				id: 24,
				name: 'Red',
				slug: 'red',
				default: false,
			},
		],
	},
	Size: {
		id: 2,
		name: 'Size',
		taxonomy: 'pa_size',
		has_variations: true,
		terms: [
			{
				id: 25,
				name: 'Large',
				slug: 'large',
				default: false,
			},
			{
				id: 26,
				name: 'Medium',
				slug: 'medium',
				default: true,
			},
			{
				id: 27,
				name: 'Small',
				slug: 'small',
				default: false,
			},
		],
	},
};

describe( 'Testing utils', () => {
	describe( 'Testing getAttributes()', () => {
		it( 'returns empty object if there are no attributes', () => {
			const attributes = getAttributes( null );
			expect( attributes ).toStrictEqual( {} );
		} );
		it( 'returns list of attributes when given valid data', () => {
			const attributes = getAttributes( rawAttributeData );
			expect( attributes ).toStrictEqual( {
				Color: {
					id: 1,
					name: 'Color',
					taxonomy: 'pa_color',
					has_variations: true,
					terms: [
						{
							id: 22,
							name: 'Blue',
							slug: 'blue',
							default: true,
						},
						{
							id: 23,
							name: 'Green',
							slug: 'green',
							default: false,
						},
						{
							id: 24,
							name: 'Red',
							slug: 'red',
							default: false,
						},
					],
				},
				Logo: {
					id: 0,
					name: 'Logo',
					taxonomy: null,
					has_variations: true,
					terms: [
						{
							id: 0,
							name: 'Yes',
							slug: 'Yes',
							default: true,
						},
						{
							id: 0,
							name: 'No',
							slug: 'No',
							default: false,
						},
					],
				},
			} );
		} );
	} );
	describe( 'Testing getVariationAttributes()', () => {
		it( 'returns empty object if there are no variations', () => {
			const variationAttributes = getVariationAttributes( null );
			expect( variationAttributes ).toStrictEqual( {} );
		} );
		it( 'returns list of attribute names and value pairs when given valid data', () => {
			const variationAttributes = getVariationAttributes( rawVariations );
			expect( variationAttributes ).toStrictEqual( {
				'id:35': {
					id: 35,
					attributes: {
						Color: 'blue',
						Logo: 'Yes',
					},
				},
				'id:28': {
					id: 28,
					attributes: {
						Color: 'red',
						Logo: 'No',
					},
				},
				'id:29': {
					id: 29,
					attributes: {
						Color: 'green',
						Logo: 'No',
					},
				},
				'id:30': {
					id: 30,
					attributes: {
						Color: 'blue',
						Logo: 'No',
					},
				},
			} );
		} );
	} );
	describe( 'Testing getVariationsMatchingSelectedAttributes()', () => {
		const attributes = getAttributes( rawAttributeData );
		const variationAttributes = getVariationAttributes( rawVariations );

		it( 'returns all variations, in the correct order, if no selections have been made yet', () => {
			const selectedAttributes = {};
			const matches = getVariationsMatchingSelectedAttributes(
				attributes,
				variationAttributes,
				selectedAttributes
			);
			expect( matches ).toStrictEqual( [ 35, 28, 29, 30 ] );
		} );

		it( 'returns correct subset of variations after a selection', () => {
			const selectedAttributes = {
				Color: 'blue',
			};
			const matches = getVariationsMatchingSelectedAttributes(
				attributes,
				variationAttributes,
				selectedAttributes
			);
			expect( matches ).toStrictEqual( [ 35, 30 ] );
		} );

		it( 'returns correct subset of variations after all selections', () => {
			const selectedAttributes = {
				Color: 'blue',
				Logo: 'No',
			};
			const matches = getVariationsMatchingSelectedAttributes(
				attributes,
				variationAttributes,
				selectedAttributes
			);
			expect( matches ).toStrictEqual( [ 30 ] );
		} );

		it( 'returns no results if selection does not match or is invalid', () => {
			const selectedAttributes = {
				Color: 'brown',
			};
			const matches = getVariationsMatchingSelectedAttributes(
				attributes,
				variationAttributes,
				selectedAttributes
			);
			expect( matches ).toStrictEqual( [] );
		} );
	} );
	describe( 'Testing getVariationMatchingSelectedAttributes()', () => {
		const attributes = getAttributes( rawAttributeData );
		const variationAttributes = getVariationAttributes( rawVariations );

		it( 'returns first match if no selections have been made yet', () => {
			const selectedAttributes = {};
			const matches = getVariationMatchingSelectedAttributes(
				attributes,
				variationAttributes,
				selectedAttributes
			);
			expect( matches ).toStrictEqual( 35 );
		} );

		it( 'returns first match after single selection', () => {
			const selectedAttributes = {
				Color: 'blue',
			};
			const matches = getVariationMatchingSelectedAttributes(
				attributes,
				variationAttributes,
				selectedAttributes
			);
			expect( matches ).toStrictEqual( 35 );
		} );

		it( 'returns correct match after all selections', () => {
			const selectedAttributes = {
				Color: 'blue',
				Logo: 'No',
			};
			const matches = getVariationMatchingSelectedAttributes(
				attributes,
				variationAttributes,
				selectedAttributes
			);
			expect( matches ).toStrictEqual( 30 );
		} );

		it( 'returns no match if invalid', () => {
			const selectedAttributes = {
				Color: 'brown',
			};
			const matches = getVariationMatchingSelectedAttributes(
				attributes,
				variationAttributes,
				selectedAttributes
			);
			expect( matches ).toStrictEqual( 0 );
		} );
	} );
	describe( 'Testing getActiveSelectControlOptions()', () => {
		const attributes = getAttributes( rawAttributeData );
		const variationAttributes = getVariationAttributes( rawVariations );

		it( 'returns all possible options if no selections have been made yet', () => {
			const selectedAttributes = {};
			const controlOptions = getActiveSelectControlOptions(
				attributes,
				variationAttributes,
				selectedAttributes
			);
			expect( controlOptions ).toStrictEqual( {
				Color: [
					{
						value: 'blue',
						label: 'Blue',
					},
					{
						value: 'green',
						label: 'Green',
					},
					{
						value: 'red',
						label: 'Red',
					},
				],
				Logo: [
					{
						value: 'Yes',
						label: 'Yes',
					},
					{
						value: 'No',
						label: 'No',
					},
				],
			} );
		} );

		it( 'returns only valid options if color is selected', () => {
			const selectedAttributes = {
				Color: 'green',
			};
			const controlOptions = getActiveSelectControlOptions(
				attributes,
				variationAttributes,
				selectedAttributes
			);
			expect( controlOptions ).toStrictEqual( {
				Color: [
					{
						value: 'blue',
						label: 'Blue',
					},
					{
						value: 'green',
						label: 'Green',
					},
					{
						value: 'red',
						label: 'Red',
					},
				],
				Logo: [
					{
						value: 'No',
						label: 'No',
					},
				],
			} );
		} );
	} );
	describe( 'Testing getDefaultAttributes()', () => {
		const defaultAttributes = getDefaultAttributes( formattedAttributes );

		it( 'should return default attributes in the format that is ready for setting state', () => {
			expect( defaultAttributes ).toStrictEqual( {
				Color: 'blue',
				Size: 'medium',
			} );
		} );

		it( 'should return an empty object if given unexpected values', () => {
			expect( getDefaultAttributes( [] ) ).toStrictEqual( {} );
			expect( getDefaultAttributes( null ) ).toStrictEqual( {} );
			expect( getDefaultAttributes( undefined ) ).toStrictEqual( {} );
		} );
	} );
} );
js/atomic/blocks/product-elements/add-to-cart/product-types/variable/variation-attributes/index.js000064400000001617151335517640034572 0ustar00woocommerce-blocks/assets/**
 * Internal dependencies
 */
import './style.scss';
import AttributePicker from './attribute-picker';
import { getAttributes, getVariationAttributes } from './utils';

/**
 * VariationAttributes component.
 *
 * @param {Object} props             Incoming props
 * @param {Object} props.product     Product
 * @param {Object} props.dispatchers An object where values are dispatching functions.
 */
const VariationAttributes = ( { product, dispatchers } ) => {
	const attributes = getAttributes( product.attributes );
	const variationAttributes = getVariationAttributes( product.variations );
	if (
		Object.keys( attributes ).length === 0 ||
		variationAttributes.length === 0
	) {
		return null;
	}

	return (
		<AttributePicker
			attributes={ attributes }
			variationAttributes={ variationAttributes }
			setRequestParams={ dispatchers.setRequestParams }
		/>
	);
};

export default VariationAttributes;
js/atomic/blocks/product-elements/add-to-cart/product-types/variable/variation-attributes/style.scss000064400000001067151335517640035161 0ustar00woocommerce-blocks/assets.wc-block-components-product-add-to-cart-attribute-picker {
	margin: 0;
	flex-basis: 100%;

	label {
		display: block;
		@include font-size(regular);
	}

	.wc-block-components-product-add-to-cart-attribute-picker__container {
		position: relative;
	}

	.wc-block-components-product-add-to-cart-attribute-picker__select {
		margin: 0 0 em($gap-small) 0;

		select {
			min-width: 60%;
			min-height: 1.75em;
		}

		&.has-error {
			margin-bottom: $gap-large;

			select {
				border-color: $alert-red;
				&:focus {
					outline-color: $alert-red;
				}
			}
		}
	}
}
blocks/product-elements/add-to-cart/product-types/variable/variation-attributes/attribute-picker.js000064400000006061151335517640036737 0ustar00woocommerce-blocks/assets/js/atomic/**
 * External dependencies
 */
import { useState, useEffect, useMemo } from '@wordpress/element';
import { useShallowEqual } from '@woocommerce/base-hooks';

/**
 * Internal dependencies
 */
import AttributeSelectControl from './attribute-select-control';
import {
	getVariationMatchingSelectedAttributes,
	getActiveSelectControlOptions,
	getDefaultAttributes,
} from './utils';

/**
 * AttributePicker component.
 *
 * @param {*} props Component props.
 */
const AttributePicker = ( {
	attributes,
	variationAttributes,
	setRequestParams,
} ) => {
	const currentAttributes = useShallowEqual( attributes );
	const currentVariationAttributes = useShallowEqual( variationAttributes );
	const [ variationId, setVariationId ] = useState( 0 );
	const [ selectedAttributes, setSelectedAttributes ] = useState( {} );
	const [ hasSetDefaults, setHasSetDefaults ] = useState( false );

	// Get options for each attribute picker.
	const filteredAttributeOptions = useMemo( () => {
		return getActiveSelectControlOptions(
			currentAttributes,
			currentVariationAttributes,
			selectedAttributes
		);
	}, [ selectedAttributes, currentAttributes, currentVariationAttributes ] );

	// Set default attributes as selected.
	useEffect( () => {
		if ( ! hasSetDefaults ) {
			const defaultAttributes = getDefaultAttributes( attributes );
			if ( defaultAttributes ) {
				setSelectedAttributes( {
					...defaultAttributes,
				} );
			}
			setHasSetDefaults( true );
		}
	}, [ selectedAttributes, attributes, hasSetDefaults ] );

	// Select variations when selections are change.
	useEffect( () => {
		const hasSelectedAllAttributes =
			Object.values( selectedAttributes ).filter(
				( selected ) => selected !== ''
			).length === Object.keys( currentAttributes ).length;

		if ( hasSelectedAllAttributes ) {
			setVariationId(
				getVariationMatchingSelectedAttributes(
					currentAttributes,
					currentVariationAttributes,
					selectedAttributes
				)
			);
		} else if ( variationId > 0 ) {
			// Unset variation when form is incomplete.
			setVariationId( 0 );
		}
	}, [
		selectedAttributes,
		variationId,
		currentAttributes,
		currentVariationAttributes,
	] );

	// Set requests params as variation ID and data changes.
	useEffect( () => {
		setRequestParams( {
			id: variationId,
			variation: Object.keys( selectedAttributes ).map(
				( attributeName ) => {
					return {
						attribute: attributeName,
						value: selectedAttributes[ attributeName ],
					};
				}
			),
		} );
	}, [ setRequestParams, variationId, selectedAttributes ] );

	return (
		<div className="wc-block-components-product-add-to-cart-attribute-picker">
			{ Object.keys( currentAttributes ).map( ( attributeName ) => (
				<AttributeSelectControl
					key={ attributeName }
					attributeName={ attributeName }
					options={ filteredAttributeOptions[ attributeName ] }
					value={ selectedAttributes[ attributeName ] }
					onChange={ ( selected ) => {
						setSelectedAttributes( {
							...selectedAttributes,
							[ attributeName ]: selected,
						} );
					} }
				/>
			) ) }
		</div>
	);
};

export default AttributePicker;
js/atomic/blocks/product-elements/add-to-cart/product-types/variable/variation-attributes/utils.js000064400000016007151335517640034622 0ustar00woocommerce-blocks/assets/**
 * External dependencies
 */
import { keyBy } from 'lodash';
import { decodeEntities } from '@wordpress/html-entities';
import { isObject } from '@woocommerce/types';

/**
 * Key an array of attributes by name,
 *
 * @param {Object} attributes Attributes array.
 */
export const getAttributes = ( attributes ) => {
	return attributes
		? keyBy(
				Object.values( attributes ).filter(
					( { has_variations: hasVariations } ) => hasVariations
				),
				'name'
		  )
		: {};
};

/**
 * Format variations from the API into a map of just the attribute names and values.
 *
 * Note, each item is keyed by the variation ID with an id: prefix. This is to prevent the object
 * being reordered when iterated.
 *
 * @param {Object} variations List of Variation objects and attributes keyed by variation ID.
 */
export const getVariationAttributes = ( variations ) => {
	if ( ! variations ) {
		return {};
	}

	const attributesMap = {};

	variations.forEach( ( { id, attributes } ) => {
		attributesMap[ `id:${ id }` ] = {
			id,
			attributes: attributes.reduce( ( acc, { name, value } ) => {
				acc[ name ] = value;
				return acc;
			}, {} ),
		};
	} );

	return attributesMap;
};

/**
 * Given a list of variations and a list of attribute values, return variations which match.
 *
 * Allows an attribute to be excluded by name. This is used to filter displayed options for
 * individual attribute selects.
 *
 * @param {Object} attributes List of attribute names and terms.
 * @param {Object} variationAttributes Attributes for each variation keyed by variation ID.
 * @param {Object} selectedAttributes Attribute Name Value pairs of current selections by the user.
 * @return {Array} List of matching variation IDs.
 */
export const getVariationsMatchingSelectedAttributes = (
	attributes,
	variationAttributes,
	selectedAttributes
) => {
	const variationIds = Object.values( variationAttributes ).map(
		( { id: variationId } ) => {
			return variationId;
		}
	);

	// If nothing is selected yet, just return all variations.
	if (
		Object.values( selectedAttributes ).every( ( value ) => value === '' )
	) {
		return variationIds;
	}

	const attributeNames = Object.keys( attributes );

	return variationIds.filter( ( variationId ) =>
		attributeNames.every( ( attributeName ) => {
			const selectedAttribute = selectedAttributes[ attributeName ] || '';
			const variationAttribute =
				variationAttributes[ 'id:' + variationId ].attributes[
					attributeName
				];

			// If there is no selected attribute, consider this a match.
			if ( selectedAttribute === '' ) {
				return true;
			}
			// If the variation attributes for this attribute are set to null, it matches all values.
			if ( variationAttribute === null ) {
				return true;
			}
			// Otherwise, only match if the selected values are the same.
			return variationAttribute === selectedAttribute;
		} )
	);
};

/**
 * Given a list of variations and a list of attribute values, returns the first matched variation ID.
 *
 * @param {Object} attributes List of attribute names and terms.
 * @param {Object} variationAttributes Attributes for each variation keyed by variation ID.
 * @param {Object} selectedAttributes Attribute Name Value pairs of current selections by the user.
 * @return {number} Variation ID.
 */
export const getVariationMatchingSelectedAttributes = (
	attributes,
	variationAttributes,
	selectedAttributes
) => {
	const matchingVariationIds = getVariationsMatchingSelectedAttributes(
		attributes,
		variationAttributes,
		selectedAttributes
	);
	return matchingVariationIds[ 0 ] || 0;
};

/**
 * Given a list of terms, filter them and return valid options for the select boxes.
 *
 * @see getActiveSelectControlOptions
 * @param {Object} attributeTerms List of attribute term objects.
 * @param {?Array} validAttributeTerms Valid values if selections have been made already.
 * @return {Array} Value/Label pairs of select box options.
 */
const getValidSelectControlOptions = (
	attributeTerms,
	validAttributeTerms = null
) => {
	return Object.values( attributeTerms )
		.map( ( { name, slug } ) => {
			if (
				validAttributeTerms === null ||
				validAttributeTerms.includes( null ) ||
				validAttributeTerms.includes( slug )
			) {
				return {
					value: slug,
					label: decodeEntities( name ),
				};
			}
			return null;
		} )
		.filter( Boolean );
};

/**
 * Given a list of terms, filter them and return active options for the select boxes. This factors in
 * which options should be hidden due to current selections.
 *
 * @param {Object} attributes List of attribute names and terms.
 * @param {Object} variationAttributes Attributes for each variation keyed by variation ID.
 * @param {Object} selectedAttributes Attribute Name Value pairs of current selections by the user.
 * @return {Object} Select box options.
 */
export const getActiveSelectControlOptions = (
	attributes,
	variationAttributes,
	selectedAttributes
) => {
	const options = {};
	const attributeNames = Object.keys( attributes );
	const hasSelectedAttributes =
		Object.values( selectedAttributes ).filter( Boolean ).length > 0;

	attributeNames.forEach( ( attributeName ) => {
		const currentAttribute = attributes[ attributeName ];
		const selectedAttributesExcludingCurrentAttribute = {
			...selectedAttributes,
			[ attributeName ]: null,
		};
		// This finds matching variations for selected attributes apart from this one. This will be
		// used to get valid attribute terms of the current attribute narrowed down by those matching
		// variation IDs. For example, if I had Large Blue Shirts and Medium Red Shirts, I want to only
		// show Red shirts if Medium is selected.
		const matchingVariationIds = hasSelectedAttributes
			? getVariationsMatchingSelectedAttributes(
					attributes,
					variationAttributes,
					selectedAttributesExcludingCurrentAttribute
			  )
			: null;
		// Uses the above matching variation IDs to get the attributes from just those variations.
		const validAttributeTerms =
			matchingVariationIds !== null
				? matchingVariationIds.map(
						( varId ) =>
							variationAttributes[ 'id:' + varId ].attributes[
								attributeName
							]
				  )
				: null;
		// Intersects attributes with valid attributes.
		options[ attributeName ] = getValidSelectControlOptions(
			currentAttribute.terms,
			validAttributeTerms
		);
	} );

	return options;
};

/**
 * Return the default values of the given attributes in a format ready to be set in state.
 *
 * @param {Object} attributes List of attribute names and terms.
 * @return {Object} Default attributes.
 */
export const getDefaultAttributes = ( attributes = {} ) => {
	if ( ! isObject( attributes ) ) {
		return {};
	}

	const attributeNames = Object.keys( attributes );
	const defaultsToSet = {};

	if ( attributeNames.length === 0 ) {
		return defaultsToSet;
	}

	attributeNames.forEach( ( attributeName ) => {
		const currentAttribute = attributes[ attributeName ];
		const defaultValue = currentAttribute.terms.filter(
			( term ) => term.default
		);
		if ( defaultValue.length > 0 ) {
			defaultsToSet[ currentAttribute.name ] = defaultValue[ 0 ]?.slug;
		}
	} );

	return defaultsToSet;
};
assets/js/atomic/blocks/product-elements/add-to-cart/product-types/variable/index.js000064400000002176151335517640030413 0ustar00woocommerce-blocks/**
 * External dependencies
 */
import { __ } from '@wordpress/i18n';
import { useAddToCartFormContext } from '@woocommerce/base-context';

/**
 * Internal dependencies
 */
import {
	AddToCartButton,
	QuantityInput,
	ProductUnavailable,
} from '../../shared';
import VariationAttributes from './variation-attributes';

/**
 * Variable Product Add To Cart Form
 */
const Variable = () => {
	const {
		product,
		quantity,
		minQuantity,
		maxQuantity,
		dispatchActions,
		isDisabled,
	} = useAddToCartFormContext();

	if ( product.id && ! product.is_purchasable ) {
		return <ProductUnavailable />;
	}

	if ( product.id && ! product.is_in_stock ) {
		return (
			<ProductUnavailable
				reason={ __(
					'This product is currently out of stock and cannot be purchased.',
					'woocommerce'
				) }
			/>
		);
	}

	return (
		<>
			<VariationAttributes
				product={ product }
				dispatchers={ dispatchActions }
			/>
			<QuantityInput
				value={ quantity }
				min={ minQuantity }
				max={ maxQuantity }
				disabled={ isDisabled }
				onChange={ dispatchActions.setQuantity }
			/>
			<AddToCartButton />
		</>
	);
};

export default Variable;
woocommerce-blocks/assets/js/atomic/blocks/product-elements/add-to-cart/product-types/index.js000064400000000372151335517640026701 0ustar00export { default as SimpleProductForm } from './simple';
export { default as VariableProductForm } from './variable/index';
export { default as ExternalProductForm } from './external';
export { default as GroupedProductForm } from './grouped/index';
woocommerce-blocks/assets/js/atomic/blocks/product-elements/add-to-cart/product-types/simple.js000064400000001735151335517640027067 0ustar00/**
 * External dependencies
 */
import { __ } from '@wordpress/i18n';
import { useAddToCartFormContext } from '@woocommerce/base-context';

/**
 * Internal dependencies
 */
import { AddToCartButton, QuantityInput, ProductUnavailable } from '../shared';

/**
 * Simple Product Add To Cart Form
 */
const Simple = () => {
	const {
		product,
		quantity,
		minQuantity,
		maxQuantity,
		dispatchActions,
		isDisabled,
	} = useAddToCartFormContext();

	if ( product.id && ! product.is_purchasable ) {
		return <ProductUnavailable />;
	}

	if ( product.id && ! product.is_in_stock ) {
		return (
			<ProductUnavailable
				reason={ __(
					'This product is currently out of stock and cannot be purchased.',
					'woocommerce'
				) }
			/>
		);
	}

	return (
		<>
			<QuantityInput
				value={ quantity }
				min={ minQuantity }
				max={ maxQuantity }
				disabled={ isDisabled }
				onChange={ dispatchActions.setQuantity }
			/>
			<AddToCartButton />
		</>
	);
};

export default Simple;
woocommerce-blocks/assets/js/atomic/blocks/product-elements/add-to-cart/product-types/external.js000064400000000336151335517640027414 0ustar00/**
 * Internal dependencies
 */
import AddToCartButton from '../shared/add-to-cart-button';

/**
 * External Product Add To Cart Form
 */
const External = () => {
	return <AddToCartButton />;
};

export default External;
woocommerce-blocks/assets/js/atomic/blocks/product-elements/add-to-cart/frontend.js000064400000000434151335517640024566 0ustar00/**
 * External dependencies
 */
import withFilteredAttributes from '@woocommerce/base-hocs/with-filtered-attributes';

/**
 * Internal dependencies
 */
import Block from './block';
import attributes from './attributes';

export default withFilteredAttributes( attributes )( Block );
woocommerce-blocks/assets/js/atomic/blocks/product-elements/add-to-cart/block.js000064400000004063151335517640024043 0ustar00/**
 * External dependencies
 */
import PropTypes from 'prop-types';
import classnames from 'classnames';
import {
	AddToCartFormContextProvider,
	useAddToCartFormContext,
} from '@woocommerce/base-context';
import { useProductDataContext } from '@woocommerce/shared-context';
import { isEmpty } from 'lodash';
import { withProductDataContext } from '@woocommerce/shared-hocs';

/**
 * Internal dependencies
 */
import './style.scss';
import { AddToCartButton } from './shared';
import {
	SimpleProductForm,
	VariableProductForm,
	ExternalProductForm,
	GroupedProductForm,
} from './product-types';

/**
 * Product Add to Form Block Component.
 *
 * @param {Object} props                     Incoming props.
 * @param {string} [props.className]         CSS Class name for the component.
 * @param {boolean} [props.showFormElements] Should form elements be shown?
 * @return {*} The component.
 */
const Block = ( { className, showFormElements } ) => {
	const { product } = useProductDataContext();
	const componentClass = classnames(
		className,
		'wc-block-components-product-add-to-cart',
		{
			'wc-block-components-product-add-to-cart--placeholder': isEmpty(
				product
			),
		}
	);

	return (
		<AddToCartFormContextProvider
			product={ product }
			showFormElements={ showFormElements }
		>
			<div className={ componentClass }>
				<AddToCartForm />
			</div>
		</AddToCartFormContextProvider>
	);
};

/**
 * Renders the add to cart form using useAddToCartFormContext.
 */
const AddToCartForm = () => {
	const { showFormElements, productType } = useAddToCartFormContext();

	if ( showFormElements ) {
		if ( productType === 'variable' ) {
			return <VariableProductForm />;
		}
		if ( productType === 'grouped' ) {
			return <GroupedProductForm />;
		}
		if ( productType === 'external' ) {
			return <ExternalProductForm />;
		}
		if ( productType === 'simple' || productType === 'variation' ) {
			return <SimpleProductForm />;
		}
		return null;
	}

	return <AddToCartButton />;
};

Block.propTypes = {
	className: PropTypes.string,
};

export default withProductDataContext( Block );
woocommerce-blocks/assets/js/atomic/blocks/product-elements/add-to-cart/attributes.js000064400000000265151335517640025137 0ustar00export const blockAttributes = {
	showFormElements: {
		type: 'boolean',
		default: false,
	},
	productId: {
		type: 'number',
		default: 0,
	},
};

export default blockAttributes;
woocommerce-blocks/assets/js/atomic/blocks/product-elements/save.js000064400000000334151335517640021605 0ustar00/**
 * External dependencies
 */
import classnames from 'classnames';

const save = ( { attributes } ) => {
	return (
		<div className={ classnames( 'is-loading', attributes.className ) } />
	);
};

export default save;
woocommerce-blocks/assets/js/atomic/blocks/product-elements/tag-list/constants.js000064400000000537151335517640024414 0ustar00/**
 * External dependencies
 */
import { __ } from '@wordpress/i18n';
import { tag, Icon } from '@woocommerce/icons';

export const BLOCK_TITLE = __(
	'Product Tag List',
	'woocommerce'
);
export const BLOCK_ICON = <Icon srcElement={ tag } />;
export const BLOCK_DESCRIPTION = __(
	'Display a list of tags belonging to a product.',
	'woocommerce'
);
woocommerce-blocks/assets/js/atomic/blocks/product-elements/tag-list/style.scss000064400000000432151335517640024071 0ustar00.wc-block-components-product-tag-list {
	margin-top: 0;
	margin-bottom: em($gap-small);

	ul {
		margin: 0;
		padding: 0;
		display: inline;

		li {
			display: inline;
			list-style: none;
		}

		li::after {
			content: ", ";
		}

		li:last-child::after {
			content: "";
		}
	}
}
woocommerce-blocks/assets/js/atomic/blocks/product-elements/tag-list/edit.js000064400000001305151335517640023317 0ustar00/**
 * External dependencies
 */
import { __ } from '@wordpress/i18n';
import { Disabled } from '@wordpress/components';
import EditProductLink from '@woocommerce/editor-components/edit-product-link';

/**
 * Internal dependencies
 */
import Block from './block';
import withProductSelector from '../shared/with-product-selector';
import { BLOCK_TITLE, BLOCK_ICON } from './constants';

const Edit = ( { attributes } ) => {
	return (
		<>
			<EditProductLink />
			<Disabled>
				<Block { ...attributes } />
			</Disabled>
		</>
	);
};

export default withProductSelector( {
	icon: BLOCK_ICON,
	label: BLOCK_TITLE,
	description: __(
		'Choose a product to display its tags.',
		'woocommerce'
	),
} )( Edit );
woocommerce-blocks/assets/js/atomic/blocks/product-elements/tag-list/block.js000064400000002552151335517640023471 0ustar00/**
 * External dependencies
 */
import { __ } from '@wordpress/i18n';
import PropTypes from 'prop-types';
import classnames from 'classnames';
import {
	useInnerBlockLayoutContext,
	useProductDataContext,
} from '@woocommerce/shared-context';
import { isEmpty } from 'lodash';
import { withProductDataContext } from '@woocommerce/shared-hocs';

/**
 * Internal dependencies
 */
import './style.scss';

/**
 * Product Tag List Block Component.
 *
 * @param {Object} props             Incoming props.
 * @param {string} [props.className] CSS Class name for the component.
 * @return {*} The component.
 */
const Block = ( { className } ) => {
	const { parentClassName } = useInnerBlockLayoutContext();
	const { product } = useProductDataContext();

	if ( isEmpty( product.tags ) ) {
		return null;
	}

	return (
		<div
			className={ classnames(
				className,
				'wc-block-components-product-tag-list',
				{
					[ `${ parentClassName }__product-tag-list` ]: parentClassName,
				}
			) }
		>
			{ __( 'Tags:', 'woocommerce' ) }{ ' ' }
			<ul>
				{ Object.values( product.tags ).map(
					( { name, link, slug } ) => {
						return (
							<li key={ `tag-list-item-${ slug }` }>
								<a href={ link }>{ name }</a>
							</li>
						);
					}
				) }
			</ul>
		</div>
	);
};

Block.propTypes = {
	className: PropTypes.string,
};

export default withProductDataContext( Block );
woocommerce-blocks/assets/js/atomic/blocks/product-elements/tag-list/index.js000064400000001116151335517640023501 0ustar00/**
 * External dependencies
 */
import { registerExperimentalBlockType } from '@woocommerce/block-settings';

/**
 * Internal dependencies
 */
import sharedConfig from '../shared/config';
import attributes from './attributes';
import edit from './edit';
import {
	BLOCK_TITLE as title,
	BLOCK_ICON as icon,
	BLOCK_DESCRIPTION as description,
} from './constants';

const blockConfig = {
	title,
	description,
	icon: {
		src: icon,
		foreground: '#874FB9',
	},
	attributes,
	edit,
};

registerExperimentalBlockType( 'woocommerce/product-tag-list', {
	...sharedConfig,
	...blockConfig,
} );
woocommerce-blocks/assets/js/atomic/blocks/product-elements/tag-list/attributes.js000064400000000167151335517640024565 0ustar00export const blockAttributes = {
	productId: {
		type: 'number',
		default: 0,
	},
};

export default blockAttributes;
woocommerce-blocks/assets/js/atomic/blocks/product-elements/sale-badge/block.js000064400000002755151335517640023736 0ustar00/**
 * External dependencies
 */
import PropTypes from 'prop-types';
import { __ } from '@wordpress/i18n';
import classnames from 'classnames';
import Label from '@woocommerce/base-components/label';
import {
	useInnerBlockLayoutContext,
	useProductDataContext,
} from '@woocommerce/shared-context';
import { withProductDataContext } from '@woocommerce/shared-hocs';

/**
 * Internal dependencies
 */
import './style.scss';

/**
 * Product Sale Badge Block Component.
 *
 * @param {Object} props             Incoming props.
 * @param {string} [props.className] CSS Class name for the component.
 * @param {string} [props.align]     Alignment of the badge.
 * @return {*} The component.
 */
const Block = ( { className, align } ) => {
	const { parentClassName } = useInnerBlockLayoutContext();
	const { product } = useProductDataContext();

	if ( ! product.id || ! product.on_sale ) {
		return null;
	}

	const alignClass =
		typeof align === 'string'
			? `wc-block-components-product-sale-badge--align-${ align }`
			: '';

	return (
		<div
			className={ classnames(
				'wc-block-components-product-sale-badge',
				className,
				alignClass,
				{
					[ `${ parentClassName }__product-onsale` ]: parentClassName,
				}
			) }
		>
			<Label
				label={ __( 'Sale', 'woocommerce' ) }
				screenReaderLabel={ __(
					'Product on sale',
					'woocommerce'
				) }
			/>
		</div>
	);
};

Block.propTypes = {
	className: PropTypes.string,
	align: PropTypes.string,
};

export default withProductDataContext( Block );
woocommerce-blocks/assets/js/atomic/blocks/product-elements/sale-badge/index.js000064400000001116151335517640023741 0ustar00/**
 * External dependencies
 */
import { registerBlockType } from '@wordpress/blocks';

/**
 * Internal dependencies
 */
import sharedConfig from '../shared/config';
import attributes from './attributes';
import edit from './edit';
import {
	BLOCK_TITLE as title,
	BLOCK_ICON as icon,
	BLOCK_DESCRIPTION as description,
} from './constants';

const blockConfig = {
	title,
	description,
	icon: {
		src: icon,
		foreground: '#874FB9',
	},
	supports: {
		html: false,
	},
	attributes,
	edit,
};

registerBlockType( 'woocommerce/product-sale-badge', {
	...sharedConfig,
	...blockConfig,
} );
woocommerce-blocks/assets/js/atomic/blocks/product-elements/sale-badge/edit.js000064400000001001151335517640023550 0ustar00/**
 * External dependencies
 */
import { __ } from '@wordpress/i18n';

/**
 * Internal dependencies
 */
import Block from './block';
import withProductSelector from '../shared/with-product-selector';
import { BLOCK_TITLE, BLOCK_ICON } from './constants';

const Edit = ( { attributes } ) => {
	return <Block { ...attributes } />;
};

export default withProductSelector( {
	icon: BLOCK_ICON,
	label: BLOCK_TITLE,
	description: __(
		'Choose a product to display its sale-badge.',
		'woocommerce'
	),
} )( Edit );
woocommerce-blocks/assets/js/atomic/blocks/product-elements/sale-badge/attributes.js000064400000000167151335517640025025 0ustar00export const blockAttributes = {
	productId: {
		type: 'number',
		default: 0,
	},
};

export default blockAttributes;
woocommerce-blocks/assets/js/atomic/blocks/product-elements/sale-badge/style.scss000064400000000557151335517640024341 0ustar00.wc-block-components-product-sale-badge {
	margin: 0 auto $gap-small;
	@include font-size(small);
	padding: em($gap-smallest) em($gap-small);
	display: inline-block;
	width: auto;
	border: 1px solid #43454b;
	border-radius: 3px;
	color: #43454b;
	background: #fff;
	text-align: center;
	text-transform: uppercase;
	font-weight: 600;
	z-index: 9;
	position: static;
}
woocommerce-blocks/assets/js/atomic/blocks/product-elements/sale-badge/constants.js000064400000000542151335517640024650 0ustar00/**
 * External dependencies
 */
import { __ } from '@wordpress/i18n';
import { tag, Icon } from '@woocommerce/icons';

export const BLOCK_TITLE = __(
	'On-Sale Badge',
	'woocommerce'
);
export const BLOCK_ICON = <Icon srcElement={ tag } />;
export const BLOCK_DESCRIPTION = __(
	'Displays an on-sale badge if the product is on-sale.',
	'woocommerce'
);
woocommerce-blocks/assets/js/atomic/blocks/product-elements/sku/edit.js000064400000001164151335517640022400 0ustar00/**
 * External dependencies
 */
import { __ } from '@wordpress/i18n';
import EditProductLink from '@woocommerce/editor-components/edit-product-link';

/**
 * Internal dependencies
 */
import Block from './block';
import withProductSelector from '../shared/with-product-selector';
import { BLOCK_TITLE, BLOCK_ICON } from './constants';

const Edit = ( { attributes } ) => {
	return (
		<>
			<EditProductLink />
			<Block { ...attributes } />
		</>
	);
};

export default withProductSelector( {
	icon: BLOCK_ICON,
	label: BLOCK_TITLE,
	description: __(
		'Choose a product to display its SKU.',
		'woocommerce'
	),
} )( Edit );
woocommerce-blocks/assets/js/atomic/blocks/product-elements/sku/style.scss000064400000000232151335517640023145 0ustar00.wc-block-components-product-sku {
	margin-top: 0;
	margin-bottom: $gap-small;
	display: block;
	text-transform: uppercase;
	@include font-size(small);
}
woocommerce-blocks/assets/js/atomic/blocks/product-elements/sku/attributes.js000064400000000167151335517640023643 0ustar00export const blockAttributes = {
	productId: {
		type: 'number',
		default: 0,
	},
};

export default blockAttributes;
woocommerce-blocks/assets/js/atomic/blocks/product-elements/sku/index.js000064400000001111151335517640022552 0ustar00/**
 * External dependencies
 */
import { registerExperimentalBlockType } from '@woocommerce/block-settings';

/**
 * Internal dependencies
 */
import sharedConfig from '../shared/config';
import attributes from './attributes';
import edit from './edit';
import {
	BLOCK_TITLE as title,
	BLOCK_ICON as icon,
	BLOCK_DESCRIPTION as description,
} from './constants';

const blockConfig = {
	title,
	description,
	icon: {
		src: icon,
		foreground: '#874FB9',
	},
	attributes,
	edit,
};

registerExperimentalBlockType( 'woocommerce/product-sku', {
	...sharedConfig,
	...blockConfig,
} );
woocommerce-blocks/assets/js/atomic/blocks/product-elements/sku/constants.js000064400000000517151335517640023470 0ustar00/**
 * External dependencies
 */
import { __ } from '@wordpress/i18n';
import { barcode, Icon } from '@woocommerce/icons';

export const BLOCK_TITLE = __( 'Product SKU', 'woocommerce' );
export const BLOCK_ICON = <Icon srcElement={ barcode } />;
export const BLOCK_DESCRIPTION = __(
	'Display the SKU of a product.',
	'woocommerce'
);
woocommerce-blocks/assets/js/atomic/blocks/product-elements/sku/block.js000064400000002167151335517640022551 0ustar00/**
 * External dependencies
 */
import { __ } from '@wordpress/i18n';
import PropTypes from 'prop-types';
import classnames from 'classnames';
import {
	useInnerBlockLayoutContext,
	useProductDataContext,
} from '@woocommerce/shared-context';
import { withProductDataContext } from '@woocommerce/shared-hocs';

/**
 * Internal dependencies
 */
import './style.scss';

/**
 * Product SKU Block Component.
 *
 * @param {Object} props             Incoming props.
 * @param {string} [props.className] CSS Class name for the component.
 * @return {*} The component.
 */
const Block = ( { className } ) => {
	const { parentClassName } = useInnerBlockLayoutContext();
	const { product } = useProductDataContext();
	const sku = product.sku;

	if ( ! sku ) {
		return null;
	}

	return (
		<div
			className={ classnames(
				className,
				'wc-block-components-product-sku',
				{
					[ `${ parentClassName }__product-sku` ]: parentClassName,
				}
			) }
		>
			{ __( 'SKU:', 'woocommerce' ) }{ ' ' }
			<strong>{ sku }</strong>
		</div>
	);
};

Block.propTypes = {
	className: PropTypes.string,
};

export default withProductDataContext( Block );
woocommerce-blocks/assets/js/atomic/blocks/product-elements/image/index.js000064400000001051151335517640023035 0ustar00/**
 * External dependencies
 */
import { registerBlockType } from '@wordpress/blocks';

/**
 * Internal dependencies
 */
import sharedConfig from '../shared/config';
import attributes from './attributes';
import edit from './edit';
import {
	BLOCK_TITLE as title,
	BLOCK_ICON as icon,
	BLOCK_DESCRIPTION as description,
} from './constants';

const blockConfig = {
	title,
	description,
	icon: {
		src: icon,
		foreground: '#874FB9',
	},
	attributes,
	edit,
};

registerBlockType( 'woocommerce/product-image', {
	...sharedConfig,
	...blockConfig,
} );
woocommerce-blocks/assets/js/atomic/blocks/product-elements/image/attributes.js000064400000000550151335517640024117 0ustar00export const blockAttributes = {
	showProductLink: {
		type: 'boolean',
		default: true,
	},
	showSaleBadge: {
		type: 'boolean',
		default: true,
	},
	saleBadgeAlign: {
		type: 'string',
		default: 'right',
	},
	imageSizing: {
		type: 'string',
		default: 'full-size',
	},
	productId: {
		type: 'number',
		default: 0,
	},
};

export default blockAttributes;
woocommerce-blocks/assets/js/atomic/blocks/product-elements/image/frontend.js000064400000000434151335517640023551 0ustar00/**
 * External dependencies
 */
import withFilteredAttributes from '@woocommerce/base-hocs/with-filtered-attributes';

/**
 * Internal dependencies
 */
import Block from './block';
import attributes from './attributes';

export default withFilteredAttributes( attributes )( Block );
woocommerce-blocks/assets/js/atomic/blocks/product-elements/image/block.js000064400000007431151335517640023030 0ustar00/**
 * External dependencies
 */
import PropTypes from 'prop-types';
import { useState, Fragment } from '@wordpress/element';
import { __, sprintf } from '@wordpress/i18n';
import classnames from 'classnames';
import { PLACEHOLDER_IMG_SRC } from '@woocommerce/settings';
import {
	useInnerBlockLayoutContext,
	useProductDataContext,
} from '@woocommerce/shared-context';
import { withProductDataContext } from '@woocommerce/shared-hocs';
import { useStoreEvents } from '@woocommerce/base-context/hooks';

/**
 * Internal dependencies
 */
import ProductSaleBadge from './../sale-badge/block';
import './style.scss';

/**
 * Product Image Block Component.
 *
 * @param {Object} props                  Incoming props.
 * @param {string} [props.className]      CSS Class name for the component.
 * @param {string} [props.imageSizing]    Size of image to use.
 * @param {boolean} [props.showProductLink]   Whether or not to display a link to the product page.
 * @param {boolean} [props.showSaleBadge] Whether or not to display the on sale badge.
 * @param {string} [props.saleBadgeAlign] How should the sale badge be aligned if displayed.
 * @return {*} The component.
 */
export const Block = ( {
	className,
	imageSizing = 'full-size',
	showProductLink = true,
	showSaleBadge,
	saleBadgeAlign = 'right',
} ) => {
	const { parentClassName } = useInnerBlockLayoutContext();
	const { product } = useProductDataContext();
	const [ imageLoaded, setImageLoaded ] = useState( false );
	const { dispatchStoreEvent } = useStoreEvents();

	if ( ! product.id ) {
		return (
			<div
				className={ classnames(
					className,
					'wc-block-components-product-image',
					'wc-block-components-product-image--placeholder',
					{
						[ `${ parentClassName }__product-image` ]: parentClassName,
					}
				) }
			>
				<ImagePlaceholder />
			</div>
		);
	}
	const hasProductImages = !! product.images.length;
	const image = hasProductImages ? product.images[ 0 ] : null;
	const ParentComponent = showProductLink ? 'a' : Fragment;
	const anchorLabel = sprintf(
		/* translators: %s is referring to the product name */
		__( 'Link to %s', 'woocommerce' ),
		product.name
	);
	const anchorProps = {
		href: product.permalink,
		rel: 'nofollow',
		...( ! hasProductImages && { 'aria-label': anchorLabel } ),
		onClick: () => {
			dispatchStoreEvent( 'product-view-link', {
				product,
			} );
		},
	};

	return (
		<div
			className={ classnames(
				className,
				'wc-block-components-product-image',
				{
					[ `${ parentClassName }__product-image` ]: parentClassName,
				}
			) }
		>
			<ParentComponent { ...( showProductLink && anchorProps ) }>
				{ !! showSaleBadge && (
					<ProductSaleBadge
						align={ saleBadgeAlign }
						product={ product }
					/>
				) }
				<Image
					fallbackAlt={ product.name }
					image={ image }
					onLoad={ () => setImageLoaded( true ) }
					loaded={ imageLoaded }
					showFullSize={ imageSizing !== 'cropped' }
				/>
			</ParentComponent>
		</div>
	);
};

const ImagePlaceholder = () => {
	return (
		<img src={ PLACEHOLDER_IMG_SRC } alt="" width={ 500 } height={ 500 } />
	);
};

const Image = ( { image, onLoad, loaded, showFullSize, fallbackAlt } ) => {
	const { thumbnail, src, srcset, sizes, alt } = image || {};
	const imageProps = {
		alt: alt || fallbackAlt,
		onLoad,
		hidden: ! loaded,
		src: thumbnail,
		...( showFullSize && { src, srcSet: srcset, sizes } ),
	};

	return (
		<>
			{ imageProps.src && (
				/* eslint-disable-next-line jsx-a11y/alt-text */
				<img data-testid="product-image" { ...imageProps } />
			) }
			{ ! loaded && <ImagePlaceholder /> }
		</>
	);
};

Block.propTypes = {
	className: PropTypes.string,
	fallbackAlt: PropTypes.string,
	showProductLink: PropTypes.bool,
	showSaleBadge: PropTypes.bool,
	saleBadgeAlign: PropTypes.string,
};

export default withProductDataContext( Block );
woocommerce-blocks/assets/js/atomic/blocks/product-elements/image/test/block.test.js000064400000007754151335517640024775 0ustar00/**
 * External dependencies
 */
import { render, fireEvent } from '@testing-library/react';
import { ProductDataContextProvider } from '@woocommerce/shared-context';

/**
 * Internal dependencies
 */
import { Block } from '../block';

jest.mock( '@woocommerce/block-settings', () => ( {
	__esModule: true,
	PLACEHOLDER_IMG_SRC: 'placeholder.jpg',
} ) );

const productWithoutImages = {
	name: 'Test product',
	id: 1,
	fallbackAlt: 'Test product',
	permalink: 'http://test.com/product/test-product/',
	images: [],
};

const productWithImages = {
	name: 'Test product',
	id: 1,
	fallbackAlt: 'Test product',
	permalink: 'http://test.com/product/test-product/',
	images: [
		{
			id: 56,
			src: 'logo-1.jpg',
			thumbnail: 'logo-1-324x324.jpg',
			srcset:
				'logo-1.jpg 800w, logo-1-300x300.jpg 300w, logo-1-150x150.jpg 150w, logo-1-768x767.jpg 768w, logo-1-324x324.jpg 324w, logo-1-416x415.jpg 416w, logo-1-100x100.jpg 100w',
			sizes: '(max-width: 800px) 100vw, 800px',
			name: 'logo-1.jpg',
			alt: '',
		},
		{
			id: 55,
			src: 'beanie-with-logo-1.jpg',
			thumbnail: 'beanie-with-logo-1-324x324.jpg',
			srcset:
				'beanie-with-logo-1.jpg 800w, beanie-with-logo-1-300x300.jpg 300w, beanie-with-logo-1-150x150.jpg 150w, beanie-with-logo-1-768x768.jpg 768w, beanie-with-logo-1-324x324.jpg 324w, beanie-with-logo-1-416x416.jpg 416w, beanie-with-logo-1-100x100.jpg 100w',
			sizes: '(max-width: 800px) 100vw, 800px',
			name: 'beanie-with-logo-1.jpg',
			alt: '',
		},
	],
};

describe( 'Product Image Block', () => {
	describe( 'with product link', () => {
		test( 'should render an anchor with the product image', () => {
			const component = render(
				<ProductDataContextProvider product={ productWithImages }>
					<Block showProductLink={ true } />
				</ProductDataContextProvider>
			);

			// use testId as alt is added after image is loaded
			const image = component.getByTestId( 'product-image' );
			fireEvent.load( image );

			const productImage = component.getByAltText(
				productWithImages.name
			);
			expect( productImage.getAttribute( 'src' ) ).toBe(
				productWithImages.images[ 0 ].src
			);

			const anchor = productImage.closest( 'a' );
			expect( anchor.getAttribute( 'href' ) ).toBe(
				productWithImages.permalink
			);
		} );

		test( 'should render an anchor with the placeholder image', () => {
			const component = render(
				<ProductDataContextProvider product={ productWithoutImages }>
					<Block showProductLink={ true } />
				</ProductDataContextProvider>
			);

			const placeholderImage = component.getByAltText( '' );
			expect( placeholderImage.getAttribute( 'src' ) ).toBe(
				'placeholder.jpg'
			);

			const anchor = placeholderImage.closest( 'a' );
			expect( anchor.getAttribute( 'href' ) ).toBe(
				productWithoutImages.permalink
			);
			expect( anchor.getAttribute( 'aria-label' ) ).toBe(
				`Link to ${ productWithoutImages.name }`
			);
		} );
	} );

	describe( 'without product link', () => {
		test( 'should render the product image without an anchor wrapper', () => {
			const component = render(
				<ProductDataContextProvider product={ productWithImages }>
					<Block showProductLink={ false } />
				</ProductDataContextProvider>
			);
			const image = component.getByTestId( 'product-image' );
			fireEvent.load( image );

			const productImage = component.getByAltText(
				productWithImages.name
			);
			expect( productImage.getAttribute( 'src' ) ).toBe(
				productWithImages.images[ 0 ].src
			);

			const anchor = productImage.closest( 'a' );
			expect( anchor ).toBe( null );
		} );

		test( 'should render the placeholder image without an anchor wrapper', () => {
			const component = render(
				<ProductDataContextProvider product={ productWithoutImages }>
					<Block showProductLink={ false } />
				</ProductDataContextProvider>
			);

			const placeholderImage = component.getByAltText( '' );
			expect( placeholderImage.getAttribute( 'src' ) ).toBe(
				'placeholder.jpg'
			);

			const anchor = placeholderImage.closest( 'a' );
			expect( anchor ).toBe( null );
		} );
	} );
} );
woocommerce-blocks/assets/js/atomic/blocks/product-elements/image/style.scss000064400000001671151335517640023435 0ustar00.editor-styles-wrapper .wc-block-grid__products .wc-block-grid__product .wc-block-components-product-image,
.wc-block-components-product-image {
	margin-top: 0;
	margin-bottom: $gap-small;
	text-decoration: none;
	display: block;
	position: relative;

	a {
		text-decoration: none;
		border: 0;
		outline: 0;
		box-shadow: none;
	}

	img {
		vertical-align: middle;
		width: 100%;

		&[hidden] {
			display: none;
		}
	}

	.wc-block-components-product-sale-badge {
		&--align-left {
			position: absolute;
			left: $gap-smaller*0.5;
			top: $gap-smaller*0.5;
			right: auto;
			margin: 0;
		}
		&--align-center {
			position: absolute;
			top: $gap-smaller*0.5;
			left: 50%;
			right: auto;
			transform: translateX(-50%);
			margin: 0;
		}
		&--align-right {
			position: absolute;
			right: $gap-smaller*0.5;
			top: $gap-smaller*0.5;
			left: auto;
			margin: 0;
		}
	}
}

.is-loading .wc-block-components-product-image {
	@include placeholder();
}
woocommerce-blocks/assets/js/atomic/blocks/product-elements/image/edit.js000064400000006703151335517640022664 0ustar00/**
 * External dependencies
 */
import { __ } from '@wordpress/i18n';
import { Disabled, PanelBody, ToggleControl } from '@wordpress/components';
import { InspectorControls } from '@wordpress/block-editor';
import { createInterpolateElement } from '@wordpress/element';
import ToggleButtonControl from '@woocommerce/editor-components/toggle-button-control';
import { getAdminLink } from '@woocommerce/settings';

/**
 * Internal dependencies
 */
import Block from './block';
import withProductSelector from '../shared/with-product-selector';
import { BLOCK_TITLE, BLOCK_ICON } from './constants';

const Edit = ( { attributes, setAttributes } ) => {
	const {
		showProductLink,
		imageSizing,
		showSaleBadge,
		saleBadgeAlign,
	} = attributes;

	return (
		<>
			<InspectorControls>
				<PanelBody
					title={ __( 'Content', 'woocommerce' ) }
				>
					<ToggleControl
						label={ __(
							'Link to Product Page',
							'woocommerce'
						) }
						help={ __(
							'Links the image to the single product listing.',
							'woocommerce'
						) }
						checked={ showProductLink }
						onChange={ () =>
							setAttributes( {
								showProductLink: ! showProductLink,
							} )
						}
					/>
					<ToggleControl
						label={ __(
							'Show On-Sale Badge',
							'woocommerce'
						) }
						help={ __(
							'Overlay a "sale" badge if the product is on-sale.',
							'woocommerce'
						) }
						checked={ showSaleBadge }
						onChange={ () =>
							setAttributes( {
								showSaleBadge: ! showSaleBadge,
							} )
						}
					/>
					{ showSaleBadge && (
						<ToggleButtonControl
							label={ __(
								'Sale Badge Alignment',
								'woocommerce'
							) }
							value={ saleBadgeAlign }
							options={ [
								{
									label: __(
										'Left',
										'woocommerce'
									),
									value: 'left',
								},
								{
									label: __(
										'Center',
										'woocommerce'
									),
									value: 'center',
								},
								{
									label: __(
										'Right',
										'woocommerce'
									),
									value: 'right',
								},
							] }
							onChange={ ( value ) =>
								setAttributes( { saleBadgeAlign: value } )
							}
						/>
					) }
					<ToggleButtonControl
						label={ __(
							'Image Sizing',
							'woocommerce'
						) }
						help={ createInterpolateElement(
							__(
								'Product image cropping can be modified in the <a>Customizer</a>.',
								'woocommerce'
							),
							{
								a: (
									// eslint-disable-next-line jsx-a11y/anchor-has-content
									<a
										href={ `${ getAdminLink(
											'customize.php'
										) }?autofocus[panel]=woocommerce&autofocus[section]=woocommerce_product_images` }
										target="_blank"
										rel="noopener noreferrer"
									/>
								),
							}
						) }
						value={ imageSizing }
						options={ [
							{
								label: __(
									'Full Size',
									'woocommerce'
								),
								value: 'full-size',
							},
							{
								label: __(
									'Cropped',
									'woocommerce'
								),
								value: 'cropped',
							},
						] }
						onChange={ ( value ) =>
							setAttributes( { imageSizing: value } )
						}
					/>
				</PanelBody>
			</InspectorControls>
			<Disabled>
				<Block { ...attributes } />
			</Disabled>
		</>
	);
};

export default withProductSelector( {
	icon: BLOCK_ICON,
	label: BLOCK_TITLE,
	description: __(
		'Choose a product to display its image.',
		'woocommerce'
	),
} )( Edit );
woocommerce-blocks/assets/js/atomic/blocks/product-elements/image/constants.js000064400000000520151335517640023742 0ustar00/**
 * External dependencies
 */
import { __ } from '@wordpress/i18n';
import { image, Icon } from '@woocommerce/icons';

export const BLOCK_TITLE = __(
	'Product Image',
	'woocommerce'
);
export const BLOCK_ICON = <Icon srcElement={ image } />;
export const BLOCK_DESCRIPTION = __(
	'Display the main product image',
	'woocommerce'
);
woocommerce-blocks/assets/js/atomic/blocks/index.js000064400000000747151335517640016474 0ustar00/**
 * Internal dependencies
 */
import './product-elements/title';
import './product-elements/price';
import './product-elements/image';
import './product-elements/rating';
import './product-elements/button';
import './product-elements/summary';
import './product-elements/sale-badge';
import './product-elements/sku';
import './product-elements/category-list';
import './product-elements/tag-list';
import './product-elements/stock-indicator';
import './product-elements/add-to-cart';
woocommerce-blocks/assets/js/index.js000064400000001437151335517640013740 0ustar00/**
 * External dependencies
 */
import { getCategories, setCategories } from '@wordpress/blocks';
import { __ } from '@wordpress/i18n';
import { woo, atom, Icon } from '@woocommerce/icons';

/**
 * Internal dependencies
 */
import '../css/editor.scss';
import '../css/style.scss';
import './filters/block-list-block';
import './filters/get-block-attributes';

setCategories( [
	...getCategories().filter(
		( { slug } ) =>
			slug !== 'woocommerce' && slug !== 'woocommerce-product-elements'
	),
	{
		slug: 'woocommerce',
		title: __( 'WooCommerce', 'woocommerce' ),
		icon: <Icon srcElement={ woo } />,
	},
	{
		slug: 'woocommerce-product-elements',
		title: __(
			'WooCommerce Product Elements',
			'woocommerce'
		),
		icon: <Icon srcElement={ atom } style={ { fill: '#874FB9' } } />,
	},
] );
woocommerce-blocks/assets/js/editor-components/product-control/index.js000064400000011705151335517640022546 0ustar00/**
 * External dependencies
 */
import { __, _n, sprintf } from '@wordpress/i18n';
import { isEmpty } from 'lodash';
import PropTypes from 'prop-types';
import { SearchListControl, SearchListItem } from '@woocommerce/components';
import { withInstanceId } from '@wordpress/compose';
import {
	withProductVariations,
	withSearchedProducts,
	withTransformSingleSelectToMultipleSelect,
} from '@woocommerce/block-hocs';
import ErrorMessage from '@woocommerce/editor-components/error-placeholder/error-message.js';
import classNames from 'classnames';
import ExpandableSearchListItem from '@woocommerce/editor-components/expandable-search-list-item/expandable-search-list-item.tsx';

/**
 * Internal dependencies
 */
import './style.scss';

const messages = {
	list: __( 'Products', 'woocommerce' ),
	noItems: __(
		"Your store doesn't have any products.",
		'woocommerce'
	),
	search: __(
		'Search for a product to display',
		'woocommerce'
	),
	updated: __(
		'Product search results updated.',
		'woocommerce'
	),
};

const ProductControl = ( {
	expandedProduct,
	error,
	instanceId,
	isCompact,
	isLoading,
	onChange,
	onSearch,
	products,
	renderItem,
	selected,
	showVariations,
	variations,
	variationsLoading,
} ) => {
	const renderItemWithVariations = ( args ) => {
		const { item, search, depth = 0, isSelected, onSelect } = args;
		const variationsCount =
			item.variations && Array.isArray( item.variations )
				? item.variations.length
				: 0;
		const classes = classNames(
			'woocommerce-search-product__item',
			'woocommerce-search-list__item',
			`depth-${ depth }`,
			'has-count',
			{
				'is-searching': search.length > 0,
				'is-skip-level': depth === 0 && item.parent !== 0,
				'is-variable': variationsCount > 0,
			}
		);

		// Top level items custom rendering based on SearchListItem.
		if ( ! item.breadcrumbs.length ) {
			return (
				<ExpandableSearchListItem
					{ ...args }
					className={ classNames( classes, {
						'is-selected': isSelected,
					} ) }
					isSelected={ isSelected }
					item={ item }
					onSelect={ () => {
						return () => {
							onSelect( item )();
						};
					} }
					isLoading={ isLoading || variationsLoading }
					countLabel={
						item.variations.length > 0
							? sprintf(
									/* translators: %1$d is the number of variations of a product product. */
									__(
										'%1$d variations',
										'woocommerce'
									),
									item.variations.length
							  )
							: null
					}
					name={ `products-${ instanceId }` }
					aria-label={ sprintf(
						/* translators: %1$s is the product name, %2$d is the number of variations of that product. */
						_n(
							'%1$s, has %2$d variation',
							'%1$s, has %2$d variations',
							item.variations.length,
							'woocommerce'
						),
						item.name,
						item.variations.length
					) }
				/>
			);
		}

		const itemArgs = isEmpty( item.variation )
			? args
			: {
					...args,
					item: {
						...args.item,
						name: item.variation,
					},
					'aria-label': `${ item.breadcrumbs[ 0 ] }: ${ item.variation }`,
			  };

		return (
			<SearchListItem
				{ ...itemArgs }
				className={ classes }
				name={ `variations-${ instanceId }` }
			/>
		);
	};

	const getRenderItemFunc = () => {
		if ( renderItem ) {
			return renderItem;
		} else if ( showVariations ) {
			return renderItemWithVariations;
		}
		return null;
	};

	if ( error ) {
		return <ErrorMessage error={ error } />;
	}

	const currentVariations =
		variations && variations[ expandedProduct ]
			? variations[ expandedProduct ]
			: [];
	const currentList = [ ...products, ...currentVariations ];

	return (
		<SearchListControl
			className="woocommerce-products"
			list={ currentList }
			isCompact={ isCompact }
			isLoading={ isLoading }
			isSingle
			selected={ currentList.filter( ( { id } ) =>
				selected.includes( id )
			) }
			onChange={ onChange }
			renderItem={ getRenderItemFunc() }
			onSearch={ onSearch }
			messages={ messages }
			isHierarchical
		/>
	);
};

ProductControl.propTypes = {
	/**
	 * Callback to update the selected products.
	 */
	onChange: PropTypes.func.isRequired,
	isCompact: PropTypes.bool,
	/**
	 * The ID of the currently expanded product.
	 */
	expandedProduct: PropTypes.number,
	/**
	 * Callback to search products by their name.
	 */
	onSearch: PropTypes.func,
	/**
	 * Query args to pass to getProducts.
	 */
	queryArgs: PropTypes.object,
	/**
	 * Callback to render each item in the selection list, allows any custom object-type rendering.
	 */
	renderItem: PropTypes.func,
	/**
	 * The ID of the currently selected item (product or variation).
	 */
	selected: PropTypes.arrayOf( PropTypes.number ),
	/**
	 * Whether to show variations in the list of items available.
	 */
	showVariations: PropTypes.bool,
};

ProductControl.defaultProps = {
	isCompact: false,
	expandedProduct: null,
	selected: [],
	showVariations: false,
};

export default withTransformSingleSelectToMultipleSelect(
	withSearchedProducts(
		withProductVariations( withInstanceId( ProductControl ) )
	)
);
woocommerce-blocks/assets/js/editor-components/product-control/style.scss000064400000002220151335517640023126 0ustar00.woocommerce-search-product__item {
	.woocommerce-search-list__item-name {
		.description {
			display: block;
		}
	}

	&.is-searching,
	&.is-skip-level {
		.woocommerce-search-list__item-prefix::after {
			content: ":";
		}
	}

	&.is-not-active {
		&:hover,
		&:active,
		&:focus {
			background: $white;
		}
	}

	&.is-loading {
		justify-content: center;

		.components-spinner {
			margin-bottom: $gap-small;
		}
	}

	&.depth-0.is-variable::after {
		margin-left: $gap-smaller;
		content: "";
		height: $gap-large;
		width: $gap-large;
		background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M7.41 8.59L12 13.17l4.59-4.58L18 10l-6 6-6-6 1.41-1.41z" fill="#{encode-color($gray-700)}" /></svg>');
		background-repeat: no-repeat;
		background-position: center right;
		background-size: contain;
	}

	&.depth-0.is-variable.is-selected::after {
		background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M7.41 15.41L12 10.83l4.59 4.58L18 14l-6-6-6 6z" fill="#{encode-color($gray-700)}" /></svg>');
	}
}
woocommerce-blocks/assets/js/editor-components/page-selector/index.js000064400000002064151335517640022140 0ustar00/**
 * External dependencies
 */
import { __ } from '@wordpress/i18n';
import { PanelBody, SelectControl } from '@wordpress/components';
import { useSelect } from '@wordpress/data';
/**
 * Internal dependencies
 */
import { formatTitle } from '../utils';

const PageSelector = ( { setPageId, pageId, labels } ) => {
	const pages =
		useSelect( ( select ) => {
			return select( 'core' ).getEntityRecords( 'postType', 'page', {
				status: 'publish',
				orderby: 'title',
				order: 'asc',
				per_page: 100,
			} );
		}, [] ) || null;
	if ( pages ) {
		return (
			<PanelBody title={ labels.title }>
				<SelectControl
					label={ __( 'Link to', 'woocommerce' ) }
					value={ pageId }
					options={ [
						{
							label: labels.default,
							value: 0,
						},
						...pages.map( ( page ) => {
							return {
								label: formatTitle( page, pages ),
								value: parseInt( page.id, 10 ),
							};
						} ),
					] }
					onChange={ ( value ) => setPageId( parseInt( value, 10 ) ) }
				/>
			</PanelBody>
		);
	}
	return null;
};

export default PageSelector;
woocommerce-blocks/assets/js/editor-components/external-link-card/index.tsx000064400000002412151335517640023271 0ustar00/**
 * External dependencies
 */
import { __ } from '@wordpress/i18n';
import { Icon, external } from '@wordpress/icons';
import { VisuallyHidden } from '@wordpress/components';

/**
 * Internal dependencies
 */
import './editor.scss';

/**
 * Show a link that displays a title, description, and optional icon. Links are opened in a new tab.
 */
const ExternalLinkCard = ( {
	href,
	title,
	description,
}: {
	href: string;
	title: string;
	description?: string;
} ): JSX.Element => {
	return (
		<a
			href={ href }
			className="wc-block-editor-components-external-link-card"
			target="_blank"
			rel="noreferrer"
		>
			<span className="wc-block-editor-components-external-link-card__content">
				<strong className="wc-block-editor-components-external-link-card__title">
					{ title }
				</strong>
				{ description && (
					<span className="wc-block-editor-components-external-link-card__description">
						{ description }
					</span>
				) }
			</span>
			<VisuallyHidden as="span">
				{
					/* translators: accessibility text */
					__( '(opens in a new tab)', 'woo-gutenberg-products-block' )
				}
			</VisuallyHidden>
			<Icon
				icon={ external }
				className="wc-block-editor-components-external-link-card__icon"
			/>
		</a>
	);
};

export default ExternalLinkCard;
woocommerce-blocks/assets/js/editor-components/external-link-card/editor.scss000064400000001411151335517640023603 0ustar00.wc-block-editor-components-external-link-card {
	display: flex;
	flex-direction: row;
	text-decoration: none;
	margin: $gap-large 0;
	color: inherit;
	align-items: flex-start;

	& + .wc-block-editor-components-external-link-card {
		margin-top: -($gap-large - $gap);
	}
	.wc-block-editor-components-external-link-card__content {
		flex: 1 1 0;
		padding-right: $gap;
	}
	.wc-block-editor-components-external-link-card__title {
		font-weight: 500;
		display: block;
	}
	.wc-block-editor-components-external-link-card__description {
		color: $gray-700;
		display: block;
		@include font-size(small);
		margin-top: 0.5em;
	}
	.wc-block-editor-components-external-link-card__icon {
		flex: 0 0 24px;
		margin: 0;
		text-align: right;
		color: inherit;
		vertical-align: top;
	}
}
woocommerce-blocks/assets/js/editor-components/external-link-card/stories/index.js000064400000000512151335517640024556 0ustar00/**
 * Internal dependencies
 */
import ExternalLinkCard from '../';

export default {
	title: 'WooCommerce Blocks/editor-components/ExternalLinkCard',
	component: ExternalLinkCard,
};

export const Default = () => (
	<ExternalLinkCard
		href="#link"
		title="Card Title"
		description="This is a description of the link."
	/>
);
woocommerce-blocks/assets/js/editor-components/edit-product-link/index.js000064400000002523151335517640022744 0ustar00/**
 * External dependencies
 */
import { __ } from '@wordpress/i18n';
import { Icon, external } from '@woocommerce/icons';
import { ADMIN_URL } from '@woocommerce/settings';
import { InspectorControls } from '@wordpress/block-editor';
import { useProductDataContext } from '@woocommerce/shared-context';

/**
 * Component to render an edit product link in the sidebar.
 *
 * @param {Object} props Component props.
 */
const EditProductLink = ( props ) => {
	const productDataContext = useProductDataContext();
	const product = productDataContext.product || {};
	const productId = product.id || props.productId || 0;

	if ( ! productId ) {
		return null;
	}

	return (
		<InspectorControls>
			<div className="wc-block-single-product__edit-card">
				<div className="wc-block-single-product__edit-card-title">
					<a
						href={ `${ ADMIN_URL }post.php?post=${ productId }&action=edit` }
						target="_blank"
						rel="noopener noreferrer"
					>
						{ __(
							"Edit this product's details",
							'woocommerce'
						) }
						<Icon srcElement={ external } size={ 16 } />
					</a>
				</div>
				<div className="wc-block-single-product__edit-card-description">
					{ __(
						'Edit details such as title, price, description and more.',
						'woocommerce'
					) }
				</div>
			</div>
		</InspectorControls>
	);
};

export default EditProductLink;
woocommerce-blocks/assets/js/editor-components/heading-toolbar/index.js000064400000002300151335517640022436 0ustar00/**
 * External dependencies
 */
import { range } from 'lodash';
import { __, sprintf } from '@wordpress/i18n';
import { Component } from '@wordpress/element';
import { ToolbarGroup } from '@wordpress/components';

/**
 * Internal dependencies
 */
import HeadingLevelIcon from './heading-level-icon';

/**
 * HeadingToolbar component.
 *
 * Allows the heading level to be chosen for a title block.
 */
class HeadingToolbar extends Component {
	createLevelControl( targetLevel, selectedLevel, onChange ) {
		const isActive = targetLevel === selectedLevel;
		return {
			icon: <HeadingLevelIcon level={ targetLevel } />,
			/* translators: %s: heading level e.g: "2", "3", "4" */
			title: sprintf( __( 'Heading %d' ), targetLevel ),
			isActive,
			onClick: () => onChange( targetLevel ),
		};
	}

	render() {
		const {
			isCollapsed = true,
			minLevel,
			maxLevel,
			selectedLevel,
			onChange,
		} = this.props;

		return (
			<ToolbarGroup
				isCollapsed={ isCollapsed }
				icon={ <HeadingLevelIcon level={ selectedLevel } /> }
				controls={ range( minLevel, maxLevel ).map( ( index ) =>
					this.createLevelControl( index, selectedLevel, onChange )
				) }
			/>
		);
	}
}

export default HeadingToolbar;
woocommerce-blocks/assets/js/editor-components/heading-toolbar/heading-level-icon.js000064400000005040151335517640024765 0ustar00/**
 * External dependencies
 */
import { Path, SVG } from '@wordpress/components';

export default function HeadingLevelIcon( { level } ) {
	const levelToPath = {
		1: 'M9 5h2v10H9v-4H5v4H3V5h2v4h4V5zm6.6 0c-.6.9-1.5 1.7-2.6 2v1h2v7h2V5h-1.4z',
		2: 'M7 5h2v10H7v-4H3v4H1V5h2v4h4V5zm8 8c.5-.4.6-.6 1.1-1.1.4-.4.8-.8 1.2-1.3.3-.4.6-.8.9-1.3.2-.4.3-.8.3-1.3 0-.4-.1-.9-.3-1.3-.2-.4-.4-.7-.8-1-.3-.3-.7-.5-1.2-.6-.5-.2-1-.2-1.5-.2-.4 0-.7 0-1.1.1-.3.1-.7.2-1 .3-.3.1-.6.3-.9.5-.3.2-.6.4-.8.7l1.2 1.2c.3-.3.6-.5 1-.7.4-.2.7-.3 1.2-.3s.9.1 1.3.4c.3.3.5.7.5 1.1 0 .4-.1.8-.4 1.1-.3.5-.6.9-1 1.2-.4.4-1 .9-1.6 1.4-.6.5-1.4 1.1-2.2 1.6V15h8v-2H15z',
		3: 'M12.1 12.2c.4.3.8.5 1.2.7.4.2.9.3 1.4.3.5 0 1-.1 1.4-.3.3-.1.5-.5.5-.8 0-.2 0-.4-.1-.6-.1-.2-.3-.3-.5-.4-.3-.1-.7-.2-1-.3-.5-.1-1-.1-1.5-.1V9.1c.7.1 1.5-.1 2.2-.4.4-.2.6-.5.6-.9 0-.3-.1-.6-.4-.8-.3-.2-.7-.3-1.1-.3-.4 0-.8.1-1.1.3-.4.2-.7.4-1.1.6l-1.2-1.4c.5-.4 1.1-.7 1.6-.9.5-.2 1.2-.3 1.8-.3.5 0 1 .1 1.6.2.4.1.8.3 1.2.5.3.2.6.5.8.8.2.3.3.7.3 1.1 0 .5-.2.9-.5 1.3-.4.4-.9.7-1.5.9v.1c.6.1 1.2.4 1.6.8.4.4.7.9.7 1.5 0 .4-.1.8-.3 1.2-.2.4-.5.7-.9.9-.4.3-.9.4-1.3.5-.5.1-1 .2-1.6.2-.8 0-1.6-.1-2.3-.4-.6-.2-1.1-.6-1.6-1l1.1-1.4zM7 9H3V5H1v10h2v-4h4v4h2V5H7v4z',
		4: 'M9 15H7v-4H3v4H1V5h2v4h4V5h2v10zm10-2h-1v2h-2v-2h-5v-2l4-6h3v6h1v2zm-3-2V7l-2.8 4H16z',
		5: 'M12.1 12.2c.4.3.7.5 1.1.7.4.2.9.3 1.3.3.5 0 1-.1 1.4-.4.4-.3.6-.7.6-1.1 0-.4-.2-.9-.6-1.1-.4-.3-.9-.4-1.4-.4H14c-.1 0-.3 0-.4.1l-.4.1-.5.2-1-.6.3-5h6.4v1.9h-4.3L14 8.8c.2-.1.5-.1.7-.2.2 0 .5-.1.7-.1.5 0 .9.1 1.4.2.4.1.8.3 1.1.6.3.2.6.6.8.9.2.4.3.9.3 1.4 0 .5-.1 1-.3 1.4-.2.4-.5.8-.9 1.1-.4.3-.8.5-1.3.7-.5.2-1 .3-1.5.3-.8 0-1.6-.1-2.3-.4-.6-.2-1.1-.6-1.6-1-.1-.1 1-1.5 1-1.5zM9 15H7v-4H3v4H1V5h2v4h4V5h2v10z',
		6: 'M9 15H7v-4H3v4H1V5h2v4h4V5h2v10zm8.6-7.5c-.2-.2-.5-.4-.8-.5-.6-.2-1.3-.2-1.9 0-.3.1-.6.3-.8.5l-.6.9c-.2.5-.2.9-.2 1.4.4-.3.8-.6 1.2-.8.4-.2.8-.3 1.3-.3.4 0 .8 0 1.2.2.4.1.7.3 1 .6.3.3.5.6.7.9.2.4.3.8.3 1.3s-.1.9-.3 1.4c-.2.4-.5.7-.8 1-.4.3-.8.5-1.2.6-1 .3-2 .3-3 0-.5-.2-1-.5-1.4-.9-.4-.4-.8-.9-1-1.5-.2-.6-.3-1.3-.3-2.1s.1-1.6.4-2.3c.2-.6.6-1.2 1-1.6.4-.4.9-.7 1.4-.9.6-.3 1.1-.4 1.7-.4.7 0 1.4.1 2 .3.5.2 1 .5 1.4.8 0 .1-1.3 1.4-1.3 1.4zm-2.4 5.8c.2 0 .4 0 .6-.1.2 0 .4-.1.5-.2.1-.1.3-.3.4-.5.1-.2.1-.5.1-.7 0-.4-.1-.8-.4-1.1-.3-.2-.7-.3-1.1-.3-.3 0-.7.1-1 .2-.4.2-.7.4-1 .7 0 .3.1.7.3 1 .1.2.3.4.4.6.2.1.3.3.5.3.2.1.5.2.7.1z',
	};
	if ( ! levelToPath.hasOwnProperty( level ) ) {
		return null;
	}

	return (
		<SVG
			width="20"
			height="20"
			viewBox="0 0 20 20"
			xmlns="http://www.w3.org/2000/svg"
		>
			<Path d={ levelToPath[ level ] } />
		</SVG>
	);
}
woocommerce-blocks/assets/js/editor-components/grid-content-control/index.js000064400000004516151335517640023465 0ustar00/**
 * External dependencies
 */
import { __ } from '@wordpress/i18n';
import PropTypes from 'prop-types';
import { ToggleControl } from '@wordpress/components';

/**
 * A combination of toggle controls for content visibility in product grids.
 *
 * @param {Object} props Incoming props for the component.
 * @param {function(any):any} props.onChange
 * @param {Object} props.settings
 */
const GridContentControl = ( { onChange, settings } ) => {
	const { button, price, rating, title } = settings;
	return (
		<>
			<ToggleControl
				label={ __( 'Product title', 'woocommerce' ) }
				help={
					title
						? __(
								'Product title is visible.',
								'woocommerce'
						  )
						: __(
								'Product title is hidden.',
								'woocommerce'
						  )
				}
				checked={ title }
				onChange={ () => onChange( { ...settings, title: ! title } ) }
			/>
			<ToggleControl
				label={ __( 'Product price', 'woocommerce' ) }
				help={
					price
						? __(
								'Product price is visible.',
								'woocommerce'
						  )
						: __(
								'Product price is hidden.',
								'woocommerce'
						  )
				}
				checked={ price }
				onChange={ () => onChange( { ...settings, price: ! price } ) }
			/>
			<ToggleControl
				label={ __( 'Product rating', 'woocommerce' ) }
				help={
					rating
						? __(
								'Product rating is visible.',
								'woocommerce'
						  )
						: __(
								'Product rating is hidden.',
								'woocommerce'
						  )
				}
				checked={ rating }
				onChange={ () => onChange( { ...settings, rating: ! rating } ) }
			/>
			<ToggleControl
				label={ __(
					'Add to Cart button',
					'woocommerce'
				) }
				help={
					button
						? __(
								'Add to Cart button is visible.',
								'woocommerce'
						  )
						: __(
								'Add to Cart button is hidden.',
								'woocommerce'
						  )
				}
				checked={ button }
				onChange={ () => onChange( { ...settings, button: ! button } ) }
			/>
		</>
	);
};

GridContentControl.propTypes = {
	/**
	 * The current title visibility.
	 */
	settings: PropTypes.shape( {
		button: PropTypes.bool.isRequired,
		price: PropTypes.bool.isRequired,
		rating: PropTypes.bool.isRequired,
		title: PropTypes.bool.isRequired,
	} ).isRequired,
	/**
	 * Callback to update the layout settings.
	 */
	onChange: PropTypes.func.isRequired,
};

export default GridContentControl;
woocommerce-blocks/assets/js/editor-components/error-placeholder/error-message.js000064400000002401151335517640024456 0ustar00/**
 * External dependencies
 */
import { __ } from '@wordpress/i18n';
import PropTypes from 'prop-types';
import { escapeHTML } from '@wordpress/escape-html';

const getErrorMessage = ( { message, type } ) => {
	if ( ! message ) {
		return __(
			'An unknown error occurred which prevented the block from being updated.',
			'woocommerce'
		);
	}

	if ( type === 'general' ) {
		return (
			<span>
				{ __(
					'The following error was returned',
					'woocommerce'
				) }
				<br />
				<code>{ escapeHTML( message ) }</code>
			</span>
		);
	}

	if ( type === 'api' ) {
		return (
			<span>
				{ __(
					'The following error was returned from the API',
					'woocommerce'
				) }
				<br />
				<code>{ escapeHTML( message ) }</code>
			</span>
		);
	}

	return message;
};

const ErrorMessage = ( { error } ) => (
	<div className="wc-block-error-message">{ getErrorMessage( error ) }</div>
);

ErrorMessage.propTypes = {
	/**
	 * The error object.
	 */
	error: PropTypes.shape( {
		/**
		 * Human-readable error message to display.
		 */
		message: PropTypes.node,
		/**
		 * Context in which the error was triggered. That will determine how the error is displayed to the user.
		 */
		type: PropTypes.oneOf( [ 'api', 'general' ] ),
	} ),
};

export default ErrorMessage;
woocommerce-blocks/assets/js/editor-components/error-placeholder/editor.scss000064400000000361151335517640023533 0ustar00.wc-block-error-message {
	margin-bottom: 16px;
	margin-top: 8px;
}

.wc-block-api-error {
	.components-placeholder__fieldset {
		display: block;
	}

	.wc-block-error-message {
		margin-top: 0;
	}

	.components-spinner {
		float: none;
	}
}
woocommerce-blocks/assets/js/editor-components/error-placeholder/stories/index.js000064400000000550151335517640024505 0ustar00/**
 * Internal dependencies
 */
import ErrorPlaceholder from '../';

export default {
	title: 'WooCommerce Blocks/editor-components/ErrorPlaceholder',
	component: ErrorPlaceholder,
};

export const Default = () => (
	<ErrorPlaceholder
		error={ {
			message:
				'Unfortunately, we seem to have encountered a slight problem',
			type: 'general',
		} }
	/>
);
woocommerce-blocks/assets/js/editor-components/error-placeholder/index.js000064400000003063151335517640023017 0ustar00/**
 * External dependencies
 */
import { __ } from '@wordpress/i18n';
import PropTypes from 'prop-types';
import { Icon, notice } from '@woocommerce/icons';
import classNames from 'classnames';
import { Button, Placeholder, Spinner } from '@wordpress/components';

/**
 * Internal dependencies
 */
import ErrorMessage from './error-message.js';
import './editor.scss';

const ErrorPlaceholder = ( { className, error, isLoading, onRetry } ) => (
	<Placeholder
		icon={ <Icon srcElement={ notice } /> }
		label={ __(
			'Sorry, an error occurred',
			'woocommerce'
		) }
		className={ classNames( 'wc-block-api-error', className ) }
	>
		<ErrorMessage error={ error } />
		{ onRetry && (
			<>
				{ isLoading ? (
					<Spinner />
				) : (
					<Button isSecondary onClick={ onRetry }>
						{ __( 'Retry', 'woocommerce' ) }
					</Button>
				) }
			</>
		) }
	</Placeholder>
);

ErrorPlaceholder.propTypes = {
	/**
	 * Classname to add to placeholder in addition to the defaults.
	 */
	className: PropTypes.string,
	/**
	 * The error object.
	 */
	error: PropTypes.shape( {
		/**
		 * Human-readable error message to display.
		 */
		message: PropTypes.node,
		/**
		 * Context in which the error was triggered. That will determine how the error is displayed to the user.
		 */
		type: PropTypes.oneOf( [ 'api', 'general' ] ),
	} ),
	/**
	 * Whether there is a request running, so the 'Retry' button is hidden and
	 * a spinner is shown instead.
	 */
	isLoading: PropTypes.bool,
	/**
	 * Callback to retry an action.
	 */
	onRetry: PropTypes.func,
};

export default ErrorPlaceholder;
woocommerce-blocks/assets/js/editor-components/utils/index.js000064400000013757151335517640020561 0ustar00/* eslint-disable you-dont-need-lodash-underscore/flatten -- until we have an alternative to uniqBy we'll keep flatten to avoid potential introduced bugs with alternatives */
/**
 * External dependencies
 */
import { addQueryArgs } from '@wordpress/url';
import apiFetch from '@wordpress/api-fetch';
import { flatten, uniqBy } from 'lodash';
import { getSetting } from '@woocommerce/settings';
import { blocksConfig } from '@woocommerce/block-settings';

/**
 * Get product query requests for the Store API.
 *
 * @param {Object} request A query object with the list of selected products and search term.
 * @param {number[]} request.selected Currently selected products.
 * @param {string=} request.search Search string.
 * @param {(Record<string, unknown>)=} request.queryArgs Query args to pass in.
 */
const getProductsRequests = ( {
	selected = [],
	search = '',
	queryArgs = {},
} ) => {
	const isLargeCatalog = blocksConfig.productCount > 100;
	const defaultArgs = {
		per_page: isLargeCatalog ? 100 : 0,
		catalog_visibility: 'any',
		search,
		orderby: 'title',
		order: 'asc',
	};
	const requests = [
		addQueryArgs( '/wc/store/products', { ...defaultArgs, ...queryArgs } ),
	];

	// If we have a large catalog, we might not get all selected products in the first page.
	if ( isLargeCatalog && selected.length ) {
		requests.push(
			addQueryArgs( '/wc/store/products', {
				catalog_visibility: 'any',
				include: selected,
				per_page: 0,
			} )
		);
	}

	return requests;
};

/**
 * Get a promise that resolves to a list of products from the Store API.
 *
 * @param {Object} request A query object with the list of selected products and search term.
 * @param {number[]} request.selected Currently selected products.
 * @param {string=} request.search Search string.
 * @param {(Record<string, unknown>)=} request.queryArgs Query args to pass in.
 * @return {Promise<unknown>} Promise resolving to a Product list.
 * @throws Exception if there is an error.
 */
export const getProducts = ( {
	selected = [],
	search = '',
	queryArgs = {},
} ) => {
	const requests = getProductsRequests( { selected, search, queryArgs } );

	return Promise.all( requests.map( ( path ) => apiFetch( { path } ) ) )
		.then( ( data ) => {
			const products = uniqBy( flatten( data ), 'id' );
			const list = products.map( ( product ) => ( {
				...product,
				parent: 0,
			} ) );
			return list;
		} )
		.catch( ( e ) => {
			throw e;
		} );
};

/**
 * Get a promise that resolves to a product object from the Store API.
 *
 * @param {number} productId Id of the product to retrieve.
 */
export const getProduct = ( productId ) => {
	return apiFetch( {
		path: `/wc/store/products/${ productId }`,
	} );
};

/**
 * Get a promise that resolves to a list of attribute objects from the Store API.
 */
export const getAttributes = () => {
	return apiFetch( {
		path: `wc/store/products/attributes`,
	} );
};

/**
 * Get a promise that resolves to a list of attribute term objects from the Store API.
 *
 * @param {number} attribute Id of the attribute to retrieve terms for.
 */
export const getTerms = ( attribute ) => {
	return apiFetch( {
		path: `wc/store/products/attributes/${ attribute }/terms`,
	} );
};

/**
 * Get product tag query requests for the Store API.
 *
 * @param {Object} request A query object with the list of selected products and search term.
 * @param {Array} request.selected Currently selected tags.
 * @param {string} request.search Search string.
 */
const getProductTagsRequests = ( { selected = [], search } ) => {
	const limitTags = getSetting( 'limitTags', false );
	const requests = [
		addQueryArgs( `wc/store/products/tags`, {
			per_page: limitTags ? 100 : 0,
			orderby: limitTags ? 'count' : 'name',
			order: limitTags ? 'desc' : 'asc',
			search,
		} ),
	];

	// If we have a large catalog, we might not get all selected products in the first page.
	if ( limitTags && selected.length ) {
		requests.push(
			addQueryArgs( `wc/store/products/tags`, {
				include: selected,
			} )
		);
	}

	return requests;
};

/**
 * Get a promise that resolves to a list of tags from the Store API.
 *
 * @param {Object} props A query object with the list of selected products and search term.
 * @param {Array} props.selected
 * @param {string} props.search
 */
export const getProductTags = ( { selected = [], search } ) => {
	const requests = getProductTagsRequests( { selected, search } );

	return Promise.all( requests.map( ( path ) => apiFetch( { path } ) ) ).then(
		( data ) => {
			return uniqBy( flatten( data ), 'id' );
		}
	);
};

/**
 * Get a promise that resolves to a list of category objects from the Store API.
 *
 * @param {Object} queryArgs Query args to pass in.
 */
export const getCategories = ( queryArgs ) => {
	return apiFetch( {
		path: addQueryArgs( `wc/store/products/categories`, {
			per_page: 0,
			...queryArgs,
		} ),
	} );
};

/**
 * Get a promise that resolves to a category object from the API.
 *
 * @param {number} categoryId Id of the product to retrieve.
 */
export const getCategory = ( categoryId ) => {
	return apiFetch( {
		path: `wc/store/products/categories/${ categoryId }`,
	} );
};

/**
 * Get a promise that resolves to a list of variation objects from the Store API.
 *
 * @param {number} product Product ID.
 */
export const getProductVariations = ( product ) => {
	return apiFetch( {
		path: addQueryArgs( `wc/store/products`, {
			per_page: 0,
			type: 'variation',
			parent: product,
		} ),
	} );
};

/**
 * Given a page object and an array of page, format the title.
 *
 * @param  {Object} page           Page object.
 * @param  {Object} page.title     Page title object.
 * @param  {string} page.title.raw Page title.
 * @param  {string} page.slug      Page slug.
 * @param  {Array}  pages          Array of all pages.
 * @return {string}                Formatted page title to display.
 */
export const formatTitle = ( page, pages ) => {
	if ( ! page.title.raw ) {
		return page.slug;
	}
	const isUnique =
		pages.filter( ( p ) => p.title.raw === page.title.raw ).length === 1;
	return page.title.raw + ( ! isUnique ? ` - ${ page.slug }` : '' );
};
woocommerce-blocks/assets/js/editor-components/grid-layout-control/index.js000064400000005000151335517640023315 0ustar00/**
 * External dependencies
 */
import { __ } from '@wordpress/i18n';
import { clamp } from 'lodash';
import PropTypes from 'prop-types';
import { RangeControl, ToggleControl } from '@wordpress/components';

/**
 * A combination of range controls for product grid layout settings.
 *
 * @param {Object} props Incoming props for the component.
 * @param {number} props.columns
 * @param {number} props.rows
 * @param {function(any):any} props.setAttributes Setter for block attributes.
 * @param {string} props.alignButtons
 * @param {number} props.minColumns
 * @param {number} props.maxColumns
 * @param {number} props.minRows
 * @param {number} props.maxRows
 */
const GridLayoutControl = ( {
	columns,
	rows,
	setAttributes,
	alignButtons,
	minColumns = 1,
	maxColumns = 6,
	minRows = 1,
	maxRows = 6,
} ) => {
	return (
		<>
			<RangeControl
				label={ __( 'Columns', 'woocommerce' ) }
				value={ columns }
				onChange={ ( value ) => {
					const newValue = clamp( value, minColumns, maxColumns );
					setAttributes( {
						columns: Number.isNaN( newValue ) ? '' : newValue,
					} );
				} }
				min={ minColumns }
				max={ maxColumns }
			/>
			<RangeControl
				label={ __( 'Rows', 'woocommerce' ) }
				value={ rows }
				onChange={ ( value ) => {
					const newValue = clamp( value, minRows, maxRows );
					setAttributes( {
						rows: Number.isNaN( newValue ) ? '' : newValue,
					} );
				} }
				min={ minRows }
				max={ maxRows }
			/>
			<ToggleControl
				label={ __(
					'Align Last Block',
					'woocommerce'
				) }
				help={
					alignButtons
						? __(
								'The last inner block will be aligned vertically.',
								'woocommerce'
						  )
						: __(
								'The last inner block will follow other content.',
								'woocommerce'
						  )
				}
				checked={ alignButtons }
				onChange={ () =>
					setAttributes( { alignButtons: ! alignButtons } )
				}
			/>
		</>
	);
};

GridLayoutControl.propTypes = {
	// The current columns count.
	columns: PropTypes.oneOfType( [ PropTypes.number, PropTypes.string ] )
		.isRequired,
	// The current rows count.
	rows: PropTypes.oneOfType( [ PropTypes.number, PropTypes.string ] )
		.isRequired,
	// Whether or not buttons are aligned horizontally across items.
	alignButtons: PropTypes.bool.isRequired,
	// Callback to update the layout settings.
	setAttributes: PropTypes.func.isRequired,
	// Min and max constraints.
	minColumns: PropTypes.number,
	maxColumns: PropTypes.number,
	minRows: PropTypes.number,
	maxRows: PropTypes.number,
};

export default GridLayoutControl;
woocommerce-blocks/assets/js/editor-components/products-control/index.js000064400000005130151335517640022724 0ustar00/**
 * External dependencies
 */
import { __, _n, sprintf } from '@wordpress/i18n';
import { SearchListControl } from '@woocommerce/components';
import PropTypes from 'prop-types';
import { withSearchedProducts } from '@woocommerce/block-hocs';
import ErrorMessage from '@woocommerce/editor-components/error-placeholder/error-message.js';

/**
 * The products control exposes a custom selector for searching and selecting
 * products.
 *
 * @param {Object} props Component props.
 * @param {string} props.error
 * @param {Function} props.onChange  Callback fired when the selected item changes
 * @param {Function} props.onSearch  Callback fired when a search is triggered
 * @param {Array}    props.selected  An array of selected products.
 * @param {Array}    props.products  An array of products to select from.
 * @param {boolean}  props.isLoading Whether or not the products are being loaded.
 * @param {boolean}  props.isCompact Whether or not the control should have compact styles.
 *
 * @return {Function} A functional component.
 */
const ProductsControl = ( {
	error,
	onChange,
	onSearch,
	selected,
	products,
	isLoading,
	isCompact,
} ) => {
	const messages = {
		clear: __( 'Clear all products', 'woocommerce' ),
		list: __( 'Products', 'woocommerce' ),
		noItems: __(
			"Your store doesn't have any products.",
			'woocommerce'
		),
		search: __(
			'Search for products to display',
			'woocommerce'
		),
		selected: ( n ) =>
			sprintf(
				/* translators: %d is the number of selected products. */
				_n(
					'%d product selected',
					'%d products selected',
					n,
					'woocommerce'
				),
				n
			),
		updated: __(
			'Product search results updated.',
			'woocommerce'
		),
	};

	if ( error ) {
		return <ErrorMessage error={ error } />;
	}

	return (
		<SearchListControl
			className="woocommerce-products"
			list={ products.map( ( product ) => {
				const formattedSku = product.sku
					? ' (' + product.sku + ')'
					: '';
				return {
					...product,
					name: `${ product.name }${ formattedSku }`,
				};
			} ) }
			isCompact={ isCompact }
			isLoading={ isLoading }
			selected={ products.filter( ( { id } ) =>
				selected.includes( id )
			) }
			onSearch={ onSearch }
			onChange={ onChange }
			messages={ messages }
		/>
	);
};

ProductsControl.propTypes = {
	onChange: PropTypes.func.isRequired,
	onSearch: PropTypes.func,
	selected: PropTypes.array,
	products: PropTypes.array,
	isCompact: PropTypes.bool,
	isLoading: PropTypes.bool,
};

ProductsControl.defaultProps = {
	selected: [],
	products: [],
	isCompact: false,
	isLoading: true,
};

export default withSearchedProducts( ProductsControl );
woocommerce-blocks/assets/js/editor-components/product-orderby-control/index.js000064400000003202151335517640024203 0ustar00/**
 * External dependencies
 */
import { __ } from '@wordpress/i18n';
import { SelectControl } from '@wordpress/components';
import PropTypes from 'prop-types';

/**
 * A pre-configured SelectControl for product orderby settings.
 *
 * @param {Object} props Incoming props for the component.
 * @param {string} props.value
 * @param {function(any):any} props.setAttributes Setter for block attributes.
 */
const ProductOrderbyControl = ( { value, setAttributes } ) => {
	return (
		<SelectControl
			label={ __( 'Order products by', 'woocommerce' ) }
			value={ value }
			options={ [
				{
					label: __(
						'Newness - newest first',
						'woocommerce'
					),
					value: 'date',
				},
				{
					label: __(
						'Price - low to high',
						'woocommerce'
					),
					value: 'price_asc',
				},
				{
					label: __(
						'Price - high to low',
						'woocommerce'
					),
					value: 'price_desc',
				},
				{
					label: __(
						'Rating - highest first',
						'woocommerce'
					),
					value: 'rating',
				},
				{
					label: __(
						'Sales - most first',
						'woocommerce'
					),
					value: 'popularity',
				},
				{
					label: __(
						'Title - alphabetical',
						'woocommerce'
					),
					value: 'title',
				},
				{
					label: __( 'Menu Order', 'woocommerce' ),
					value: 'menu_order',
				},
			] }
			onChange={ ( orderby ) => setAttributes( { orderby } ) }
		/>
	);
};

ProductOrderbyControl.propTypes = {
	/**
	 * Callback to update the order setting.
	 */
	setAttributes: PropTypes.func.isRequired,
	/**
	 * The selected order setting.
	 */
	value: PropTypes.string.isRequired,
};

export default ProductOrderbyControl;
woocommerce-blocks/assets/js/editor-components/product-tag-control/style.scss000064400000000273151335517640023705 0ustar00.woocommerce-product-tags__operator {
	.components-base-control__help {
		@include visually-hidden;
	}

	.components-base-control__label {
		margin-bottom: 0;
		margin-right: 0.5em;
	}
}
woocommerce-blocks/assets/js/editor-components/product-tag-control/index.js000064400000011267151335517640023322 0ustar00/**
 * External dependencies
 */
import { __, _n, sprintf } from '@wordpress/i18n';
import { Component } from '@wordpress/element';
import { debounce } from 'lodash';
import PropTypes from 'prop-types';
import { SearchListControl, SearchListItem } from '@woocommerce/components';
import { SelectControl } from '@wordpress/components';
import { getSetting } from '@woocommerce/settings';
import classNames from 'classnames';

/**
 * Internal dependencies
 */
import { getProductTags } from '../utils';
import './style.scss';

/**
 * Component to handle searching and selecting product tags.
 */
class ProductTagControl extends Component {
	constructor() {
		super( ...arguments );
		this.state = {
			list: [],
			loading: true,
		};
		this.renderItem = this.renderItem.bind( this );
		this.debouncedOnSearch = debounce( this.onSearch.bind( this ), 400 );
	}

	componentDidMount() {
		const { selected } = this.props;

		getProductTags( { selected } )
			.then( ( list ) => {
				this.setState( { list, loading: false } );
			} )
			.catch( () => {
				this.setState( { list: [], loading: false } );
			} );
	}

	onSearch( search ) {
		const { selected } = this.props;
		this.setState( { loading: true } );

		getProductTags( { selected, search } )
			.then( ( list ) => {
				this.setState( { list, loading: false } );
			} )
			.catch( () => {
				this.setState( { list: [], loading: false } );
			} );
	}

	renderItem( args ) {
		const { item, search, depth = 0 } = args;

		const accessibleName = ! item.breadcrumbs.length
			? item.name
			: `${ item.breadcrumbs.join( ', ' ) }, ${ item.name }`;

		return (
			<SearchListItem
				className={ classNames(
					'woocommerce-product-tags__item',
					'has-count',
					{
						'is-searching': search.length > 0,
						'is-skip-level': depth === 0 && item.parent !== 0,
					}
				) }
				{ ...args }
				aria-label={ sprintf(
					/* translators: %1$d is the count of products, %2$s is the name of the tag. */
					_n(
						'%1$d product tagged as %2$s',
						'%1$d products tagged as %2$s',
						item.count,
						'woocommerce'
					),
					item.count,
					accessibleName
				) }
			/>
		);
	}

	render() {
		const { list, loading } = this.state;
		const {
			isCompact,
			onChange,
			onOperatorChange,
			operator,
			selected,
		} = this.props;

		const messages = {
			clear: __(
				'Clear all product tags',
				'woocommerce'
			),
			list: __( 'Product Tags', 'woocommerce' ),
			noItems: __(
				"Your store doesn't have any product tags.",
				'woocommerce'
			),
			search: __(
				'Search for product tags',
				'woocommerce'
			),
			selected: ( n ) =>
				sprintf(
					/* translators: %d is the count of selected tags. */
					_n(
						'%d tag selected',
						'%d tags selected',
						n,
						'woocommerce'
					),
					n
				),
			updated: __(
				'Tag search results updated.',
				'woocommerce'
			),
		};

		const limitTags = getSetting( 'limitTags', false );

		return (
			<>
				<SearchListControl
					className="woocommerce-product-tags"
					list={ list }
					isLoading={ loading }
					selected={ selected
						.map( ( id ) =>
							list.find( ( listItem ) => listItem.id === id )
						)
						.filter( Boolean ) }
					onChange={ onChange }
					onSearch={ limitTags ? this.debouncedOnSearch : null }
					renderItem={ this.renderItem }
					messages={ messages }
					isCompact={ isCompact }
					isHierarchical
				/>
				{ !! onOperatorChange && (
					<div hidden={ selected.length < 2 }>
						<SelectControl
							className="woocommerce-product-tags__operator"
							label={ __(
								'Display products matching',
								'woocommerce'
							) }
							help={ __(
								'Pick at least two tags to use this setting.',
								'woocommerce'
							) }
							value={ operator }
							onChange={ onOperatorChange }
							options={ [
								{
									label: __(
										'Any selected tags',
										'woocommerce'
									),
									value: 'any',
								},
								{
									label: __(
										'All selected tags',
										'woocommerce'
									),
									value: 'all',
								},
							] }
						/>
					</div>
				) }
			</>
		);
	}
}

ProductTagControl.propTypes = {
	/**
	 * Callback to update the selected product categories.
	 */
	onChange: PropTypes.func.isRequired,
	/**
	 * Callback to update the category operator. If not passed in, setting is not used.
	 */
	onOperatorChange: PropTypes.func,
	/**
	 * Setting for whether products should match all or any selected categories.
	 */
	operator: PropTypes.oneOf( [ 'all', 'any' ] ),
	/**
	 * The list of currently selected tags.
	 */
	selected: PropTypes.array.isRequired,
	isCompact: PropTypes.bool,
};

ProductTagControl.defaultProps = {
	isCompact: false,
	operator: 'any',
};

export default ProductTagControl;
woocommerce-blocks/assets/js/editor-components/text-toolbar-button/style.scss000064400000000420151335517640023725 0ustar00.wc-block-text-toolbar-button {
	align-items: center;

	&.is-toggled,
	&.is-toggled:focus {
		background: $gray-700;
		color: $white;
	}
}
.block-editor-block-toolbar__slot {
	// prevents text toolbar items shrinking to avoid other buttons overlapping.
	flex-shrink: 0;
}
woocommerce-blocks/assets/js/editor-components/text-toolbar-button/index.js000064400000000623151335517640023342 0ustar00/**
 * External dependencies
 */
import { Button } from '@wordpress/components';
import classnames from 'classnames';

/**
 * Internal dependencies
 */
import './style.scss';

function TextToolbarButton( { className = '', ...props } ) {
	const classes = classnames( 'wc-block-text-toolbar-button', className );
	return <Button className={ classes } { ...props } />;
}

export default TextToolbarButton;
woocommerce-blocks/assets/js/editor-components/block-title/editor.scss000064400000000557151335517640022342 0ustar00// Ensure textarea bg color is transparent for block titles.
// Some themes (e.g. Twenty Twenty) set a non-white background for the editor, and Gutenberg sets white background for text inputs, creating this issue.
// https://github.com/woocommerce/woocommerce-gutenberg-products-block/issues/1204
.wc-block-editor-components-title {
	background-color: transparent;
}
woocommerce-blocks/assets/js/editor-components/block-title/index.js000064400000002332151335517640021615 0ustar00/**
 * External dependencies
 */
import PropTypes from 'prop-types';
import { PlainText } from '@wordpress/block-editor';
import { withInstanceId } from '@wordpress/compose';
import { __ } from '@wordpress/i18n';

/**
 * Internal dependencies
 */
import './editor.scss';

const BlockTitle = ( {
	className,
	headingLevel,
	onChange,
	heading,
	instanceId,
} ) => {
	const TagName = `h${ headingLevel }`;
	return (
		<TagName className={ className }>
			<label
				className="screen-reader-text"
				htmlFor={ `block-title-${ instanceId }` }
			>
				{ __( 'Block title', 'woocommerce' ) }
			</label>
			<PlainText
				id={ `block-title-${ instanceId }` }
				className="wc-block-editor-components-title"
				value={ heading }
				onChange={ onChange }
			/>
		</TagName>
	);
};

BlockTitle.propTypes = {
	/**
	 * Classname to add to title in addition to the defaults.
	 */
	className: PropTypes.string,
	/**
	 * The value of the heading.
	 */
	value: PropTypes.string,
	/**
	 * Callback to update the attribute when text is changed.
	 */
	onChange: PropTypes.func,
	/**
	 * Level of the heading tag (1, 2, 3... will render <h1>, <h2>, <h3>... elements).
	 */
	headingLevel: PropTypes.number,
};

export default withInstanceId( BlockTitle );
woocommerce-blocks/assets/js/editor-components/toggle-button-control/index.js000064400000003705151335517640023661 0ustar00/**
 * External dependencies
 */
import { isFunction } from 'lodash';
import classnames from 'classnames';
import { BaseControl, ButtonGroup, Button } from '@wordpress/components';
import { Component } from '@wordpress/element';
import { withInstanceId } from '@wordpress/compose';

/**
 * Internal dependencies
 */
import './style.scss';

class ToggleButtonControl extends Component {
	constructor() {
		super( ...arguments );

		this.onClick = this.onClick.bind( this );
	}

	onClick( event ) {
		if ( this.props.onChange ) {
			this.props.onChange( event.target.value );
		}
	}

	render() {
		const {
			label,
			checked,
			instanceId,
			className,
			help,
			options,
			value,
		} = this.props;
		const id = `inspector-toggle-button-control-${ instanceId }`;

		let helpLabel;

		if ( help ) {
			helpLabel = isFunction( help ) ? help( checked ) : help;
		}

		return (
			<BaseControl
				id={ id }
				help={ helpLabel }
				className={ classnames(
					'components-toggle-button-control',
					className
				) }
			>
				<label
					id={ id + '__label' }
					htmlFor={ id }
					className="components-toggle-button-control__label"
				>
					{ label }
				</label>
				<ButtonGroup aria-labelledby={ id + '__label' }>
					{ options.map( ( option, index ) => {
						const buttonArgs = {};

						// Change button depending on pressed state.
						if ( value === option.value ) {
							buttonArgs.isPrimary = true;
							buttonArgs[ 'aria-pressed' ] = true;
						} else {
							buttonArgs.isSecondary = true;
							buttonArgs[ 'aria-pressed' ] = false;
						}

						return (
							<Button
								key={ `${ option.label }-${ option.value }-${ index }` }
								value={ option.value }
								onClick={ this.onClick }
								aria-label={ label + ': ' + option.label }
								{ ...buttonArgs }
							>
								{ option.label }
							</Button>
						);
					} ) }
				</ButtonGroup>
			</BaseControl>
		);
	}
}

export default withInstanceId( ToggleButtonControl );
woocommerce-blocks/assets/js/editor-components/toggle-button-control/screenshot.png000064400000100175151335517640025076 0ustar00�PNG


IHDRS�6HiCCPICC ProfileH��WXS��[RIh�H	��ҫ�Z����J�	AĮ,���ElXE��Z��E���������*oR@��{�;�7��9s�ʝ���N
O*�Cuȗ�"CY���Y�N�=��@�ǗK���1����@���.J��W��|�x�3r~>��K�RYD_���^ U��`�K�8[�K�8S�+U6I	�w@��x�l����U�φ<�w v��t��E<�Q��ϟ���8d~Ó�7��!N/{�kQ	9L,���f���ߒ���aM$�JP��v'wj�� �d��A��{�@e1J)����)_΁=����^X4ĦGH�bc4��,qb�B�"q7I�H(O�p�Ȧ&�
�,���m��Tq�����l
���;��X������Sb!ֆ�)�M�V�`6�"N젍L����b�$2T͏MΒE$h�e��z�E"17V��
DIQ��|�*#���v� �P>>f��0,\];vU(I�ԋuHB4���y�{�*̋T� 6�&j|�� �x�� >I�'�����/1��(��SA��4��_��2�
��E��HU�H�5�?!��_�jV
���V}uY��B�G.xq>�y�B�%��~��?��a�yp(�cCM�F��e�ZÉa�(b�7���<^C�p�}q��l����	�	7	��S�d���cA���9�ۚq;�ꅇ⁐r�L���0�������\Y����ᛮk�(��2�Bq��S�I�k�E��o;��5s�������s��ޣ���a�s�I�vk,�8֌]Ǝ*��*�]���%��Ʌ<���ib*;)w�w�v���+)ߏ�3U:C&�����/dq%��#X�n~(�Gԯ��L�¼�U����p��}�e��9n%��.n!�����+d�j���e́5p���oB@8�@H�a�Ep=�t0���,k@����`���p���Up܃��<��-�G���b�X ��3�"AH8�$ iH��H2Y��#+�*d3R���FN"�v�.��F^!Q���j��B}Q6�&���ltZ���K�J�ݍ6�'�K�M�}��a�˜�%�b,KDz06+�*�Z�k��:ց�`p"�Y�\�Qx2�ǧ�s�%x�o�O���Gx/��@'��	�.a<!�0�PJ� l'"������H$2��D�ӈ9ę�%�Ľ��vb'��D"��I��8�T@*%�#�&']#u�ޓ��dwr9�,!/ W�w��������)�[�?%�"�̠,�l��P�P�(�T=�=5��D͡ΧVR�g������������i���iUj��:��H�M��D��&���������t:ݎBO�З�������#������ڍ�״_�Ptlu�:�u�u*t�\��ѥ���rty�st�u�����c������-�ۥwA�>I�N?\_�_��E��~'cX38>c!c+��ˀh`o�5�1(7�c�f�k�o�i�bXdXmx԰��1�\fss?���0�a�a�a��5�6��p�#�Q��^��F�Y��ƹ�+�����&N&�L��l09c�3�`x�p����f��:�&��4�bzٴ���,�Lj���Y�9�<�<�|��1�n�E���b��q�?X�,6+�U�:��4���TXn�l�췲�J�Z`���5���:�z�u�u����X�Y6�6��Rl}mE�km�پ���K��Ѯ��=׾ؾ���!�a�C��
G���c��zǫN����ȩ��3���,v^��>�0�o�dD��.4�K�K�ˣ�̑1#�l�b�ͨ�Q+F�����5�u��=7}�1n�Z�^�;��ݫ�ox�="<�z4{��t�zn�����W��goo�w�w���O�O��m_�x�%��~�~s���}�/���W�K@n���g��GGo�h����
���l��
~b"�����a�f�u
��
}�������"�����Óë�FXEdG�G�FzEΌ<E���Zu�k��s븽c|��s:��]�8�)F�2;f쪱�cmc%�Mq ��*�A�}���_��ŏ��$�-aV¹DF��]�o�B��%�KvHV$���LL�Ky���2�c����_J3I�5���Sҷ��M��fB�D���oM��T4��d��y��Nљ›r �����+�/�W����f�d��9�����jA�0P�R�4+0keֳ��U�ݢ`Q��G�W�_�D�l�y���#w /5oo>9?#��D_�+9=�|j��v���T�1�ښi��h�v9"�$o.0����
�
��OO�~�H�HRty�ӌ�3�Go�����l�e9k��G�ٳ7�A�d�i�k=�dn׼�y;�S���u�낕�,L]�RbV2�����K�Ke���q�"|�xQ�b���)�],w-�(������On?U�4�4ki�2�e��K��Z�b�J���+;W�]ո���l��5S�\��ظ��V���2��y�ͺ��>U��nV�V�1�Y\�n�`��
!6�m,�q�xӝ͑�k�j+��ny�5e�m��궛l/�y�dG�΄���|��v��ZV��+�wO�}uO؞����{�{��}�}�����[�h8h{���PY#�8���I��ќ��~x��֖��C���e��#�G
�.;F=Vrl�x���='�Ov�Ni�wj���ǝn;}�و��α�?x����/�^l��}����C�z�z�ͻ��ϕ�~W[�G��|���gopo\�{��V�;�'��#���n�ݗ���o�}���*�>����vxw}������:���������	�I�S��u�ܟ��DŽ?��K�������g���
��r�ޮ������6~���־���o���+{o�~���>�~|�?��S�g��-_������d<է������`\�:A}�S	�>���OX}T�7�N�<��8���`�O���zx
�ȳ<��\4x�!�xm��ϲ�������d�pb��|�"<l�S����{�7s�{{_�	pHYs%%IR$�@IDATx�]�U�K���A@PAZ0E@D�B�OlDT�EJ0A����o����w��Wp�3�w��=�ߘ93sf�l޺�1/Z%E@PE@�b�F��u芀"�(��"�B@ z�(��"�D3*D��ױ+��"�(.T0p����"�(�@4#��A4_}�"�(��"�B@ z�(��"�D3*D��ױ+��"�(.T0p����"�(�@4#��A4_}�"�(��"�B@ z�(��"�D3*D��ױ+��"�(.T0p����"�(�@4#��A4_}�"�(��"�B@ z�(��"�D3*D��ױ+��"�(.T0p����"�(�@4#��A4_}�"�(��"�B@ z�(��"�D3*D��ױ+��"�(.T0p����"�(�@4#��A4_}�"�(��"�B@ z�(��"�D3*D��ױ+��"�(.T0p����"�(�@4#��A4_}�"�(��"�B@ z�(��"�D3*D��ױ+��"�(.T0p����"�(�@4#��A4_}�"�(��"�B@ z�(��"�D3*D��ױ+��"�(.T0p����"�(�@4#��A4_}�"�(��"�B@ z�(��"�D3*D��ױ+��"�(.һ�S��C�i�ĩ�1cj۪e˚����ǟgѹs�R�rT�L�KڗHj\q����}U�Ԁ@�	c��H;vm��i�@��T�Dq*Q�()\�ҥK+�$���;�5�7s�1cF��]K9uI�#F}e�mѬ�
	��[�Ҭ��"�$a'̝��� ޡeΜ�{�>�U�Z�y5C�"0g��~�Fʟ?�z�)֮ۘ(��"����``��L���ቓ'i��=��?o�N�<EC�FW_u%�x�eʔ�ɋ�;ڷ�̜mAK��+���Χ�+WS��T0H9��fE@P.
a+�\����a��}4���h������C�s�nwwț;WN��JȠ��"�(��"��[������|=��q�1�u;�m۾#��BI8v�8�۰��l�N�N�
�H@��{���.�'�u�?p�֬]O�v���}ڑ�ԕ�2gΜ�-[�ӆ����cI�.�˟9{�����"�(�@�[�A|C�Z�;��/���d�x�Կ�S�����o�o��x�y*^��s;����:p�P@z������b����|��mqKjߦ}<b4-X�����R�j��^ʖ-a+ �x��0�~�9�1�H�5�]N��s`�=�C��%0��E���</Y��w�^O=g�niڈ�v�=�|�IÿKk�mȒ��2wvhC
�]�wy�?~�9޹k7u�9�{Y���Wiæ-�ԀMZ��=wup��;�}�킞��]Y�
�t�?,�������ZT��*���R��ق����"�(��8��=0iy�^��>0�vϼG����y��XB*C0�5Z�lE@}gyF
:z�8
x�5���_�P�t�>,Z��z>�,�)�J�ۋC�!߲�����N_ӤIC���n���c��M���N����u���Y��b�˱���5��4n�d��3g|�8	֎`^�dq���4͞��9e��+���	�o��a�P������z��G�6o
(���"�(q#��k_Y��%�7�j����sĘ�N��g����w���ժ�1f��W3n�9��'����2�*˱:�mAE2f�/��֘�=F�2�^|�)wQ��Q_���7�sU*U�͚P�bEi���4�ۂ��g�����=d�5mԀ~�s����?�M�[bՍ� �1��	�D�������o��j�0�K����X(@?�O�J77iH�r样�"Lo���a�hk�3��:��)tc��ݔ	�@#Q�tI9e�G��u�7��뮮C���[BS�󬹦����Mʕ��G�Д~&!���gA�*���SE@@ �7p@��;(V��өm�w�+,]���߫�T�bys�=[6j�&:ϳ�?�^h�X�,�M�/�B��>Ji9�j~���S��f���8u����G�%�/r��do�O��i�RԽ�&��`/ÐW�Z��R�<e͚Ũ���B4	�o��)�l�bh}��Ԍ�B�ԭMY�<�_hھc��G���ʐ…
J1g��zF0@�[0��/��|�F������t��x�3t0� �<�`Wʒ%�qP�VBD��5�y��(��"7mJ��
��p����~��bd���+[���А�Ϛ��P��u��
��r��S����$�k;�K�?MO�z�
$��:��m!�n�3�m̤E��s�)��
e�f�-f
̹�b|�2�q��d�b&�<�p�I��B�};�yq�a�f:t��9թc;G(���ա�s���"�(�@h�p���]���̙#G����^h��'�0;�~E��'�m1#.h	#v>05�`�rǬ:�������:�0o�ܵdz�^o�m�ۜ0�o�G8�By���6|	`��c�dP��	0E�e2���6n@�	p�l3B��
h�� �,�o�l�Z$v�J@ez�(�@� �̀a���,�
��1���	�m��S��=�*\��g�$��{��5��इ�Ͱݻg�q�G0!�J��|���;�یf��j���|`�l�p��@�0y��m�X��	���[�:F0@�\\Ĝ`kVB�n��\��Ӑ��~*)��"���@ě���0�Bc�
q
�A��i��o�e�`�B`�?�4��@IΥ������8Ӂ��QV]x�/��Č�k�7 !T�T	�����C�տ�NJ�>�:���6K��N�j��3L
� �m�_�Y�����`YJ��"�(�!�����P��8ʵos��Ae��=�1;�rE8�aM=��U��id��f���[V9���jլF�I�$&M�.���c�Y�/�1#ԪQ��q2���/`y#~��?s|�٣�ժ����L� C�	�(��F!'�
�'���Z�}���}���QE@�������%�BpBK,! ��'�[x)���5�����9�z�*���H�����+ֿ.@(@=9@P0�j@�����"�4i�w�z%�$���T��^��$��N��!P�C'�	���[r�<05�JE����,���SE@��6m�J��}����؎�׸?��B4����:+k9^:(t>H��O?��D �|��qpĨqNҵW'L���i���@#��Ҹ_�}~X��8��V��T����.���	�	�=p!�NqL�W1b:A��k�i�����B%�<�\�w��
vy�r~�w?����4�cE()��"���@ؚp�"8�	���lڼ�g�[��@8��G�&����4��5h��o�ÎT�W��o�.^F#�|��qy�Jξ��|Ͼ0�:���ض��I`�����h'�%}���Ayr��e�pH��o'��[h�^"B�&��S���*���]��*)]�t���������k�"/J���a�GЭ�in3�#��<œp��SEB�(�����L0�<ڷ?u��3U�'X尜c> �h04���Y�)��"a+�q|�i���k4PM#��m���g�!�2f�`��8�}������&0}̌��U΂���]��(��aˇ�L��3�p Dp!�r�U	�,5bA`�/���M��&����|`���=��*�w!!�%�<s�9�~X��ѻ�Ig�oV�QP�h7pJ�
��_�z+Hok}+��k��(��"agJ�k��1�M�o��z��g��*�O��A���^؏�a!0^7a%�"�aV���銪�ʣ.B�"�cG���Ҧ
��w��3�k�,�.��R��
�$��
b���%�X�Ѕ?r��}}���l<�WhG��(�9j��:'L@��֎7�B�賗��<�A��ZIPE t�l޺�����Y.�j##�|���8����Zޫ��>�Ǩ��Ԫ�|��J�/�+�1Bap^u#
����IB�g�B%�!���;&;�y��7�Z4h>��f	,#���A�O�8y���Ǖ�	6����K���4�J�EE�W��
>����@iӤ5!���1Q�i!E@P���5%\�kF;��-<��Q>.�@(uH��ET�<^['��Z��
B��U���O��<��Ɖ0?B�����LS��C(@eX~Z�Dqww�XPE �D�`�@��*����i��m4s�<�^�>�J‘V�^k�^BS�AP��-ñ��'E@P�"��Co/e����p5e����U�Ȩ�(��"^�`���������H6|6�켅W����8��R��$V��5�p·-�5Mb�Z\PE %�j�ÔT�TE@P"���"y4�wE@PE@H*$	>-�(��"��.T0H]�SG�(��"�$	��VE@PR*��멣QE@P���
I�O+��"�(�R���(��"�(IB@�$���E@P�ԅ�
��z�hE@P�$!��A���Š�"�(�@�B@��u=u4��"�(�@�P� I�iaE@PE u!��A꺞:E@PE I�`�$���"�(��"��P� u]O�"�(��"�$T0H|ZXPE@H]�`�����FPE@H*$	>-�(��"��.҇�p����-\KK����·c�Oa�@��Y��èG�E@�&ҧOOY�f��9sR��#~�a%��u���3-ܼ;��\$�g���]�ƴE@Pb#p��Y:|���+Y�$e̘1v�I	+���O��M�Oe�D�3/Q��Di�D���K���Ŧ٪U�^���ԁ��e��>J���̙3t��	ڹs�6m�D�˗�$}I�F���`��hᦝ���)��ň2gS� 9��֡(��"��dȐ��ʖ-K؇�`׮])�fJV6����W�ƙ��3i¦[)��֭(��"��H�.*TȌ�A�R�p�%��0̒=R��~+��"�D9Y�d1?~<b�����s>U[�7�v\P�hG�#��F0�T�ߊ�"�(�@jB@��t5u,��"�(�@P� �jqE@PE 5!��Aj��:E@PE ��`�D��"�(��"��P� 5]M�"�(��"�DT0H"�Z\PE@HM�շR�I˅\~L�{���_PE %�^�����]?�uPf|)-�o�8��9���'��_$}P
cp��`�;��"��1�'�a��=�c�F@�f�Ҧ#��RZ�O)!@#`Yt�o'��BHMf���~���7�uB
�-�,�A�	�#��'E@P.2�%���7�:A�{��13��-f�``��sf�fC&�y����
��������l�,�����z��c�|[L����:3�p�}����k��/�K'X&�Z�"�(�@�#=�̰��WǏ�P��`�<�M�6
�gv
�k#�>Ɍ-K��9}rrڄpr���	A$[.���6�=~�*��L�vjA'N��._L��r�|�0X\6t4L���b���������i ��~*!�COo49�3�?������/jذ!]~���ӱ���iXNk���Ь�xmذ�~���P�5i�$B��W��3�S�;�K������%8����!Jw�,�{�Mt}�T:_nʞ�g�L�N��
{�ok�R����4
gO弌�V�&��l���<���64Ƥ���`p�8��՚�.l��~�F���)�|3�,�����|�$,$�<�8'X 8���I���']���e��~���_����y����Z�x�۶m�ٳg���i˖-t��Iʜ93+V�J�.M
4�%J� ��<x��
fZ��裏>��}�w
7���w��Acǎ5��'k/��2�Y�&u�Ё�uIn(*�����;��~��Y�dI# �t�vB�����޽{�`��!�ϟ����zj֬�X)8�_03���<�V8�|�3���4�
M�L��b̯C�*��Ѵ`3>��@N�xY�'@a�(l43<0=�!��g�(!��#�ܼ6]]�0m�w����C�����J�9�=�]��Y��%e�����3�1�K�MB@�(��8k?�5BM��9��g�P��,��V�|4���~��"'#h���?ӨQ�b��ڵk�y:v�h^>�2&C‘#Gh�ĉ��ƍS�"E���K_�ԩSiܸq�:���/��ܹs���T�L�Xy"-!�#`6~�x§��U��h׮]4h� :z�M�A�s�N��oh�̙4x�`ʞ�͛J��n���~���fG�
4桶�d|m�ôl�nN�"���e9)-3��Y3�_��G���B��_法C�b�@��pRh�à?
��+ҍ�k0�7L�h
XP�tu*�m9y��
��c�(��}����;o��g��C_�`������LY�(�v�-�6�!�8�X,�)�p�@:~���{����1Bk8��A��Q��W�[��~$y���������7�|����_�c�}�/_�
,H{��5k�^J������,YBO>�$×����T�j�X�A�ܹ��G5�h/"A[�t���jk`{��1��f���_��x㍈���}��������.x
�z��iӦQٲe#B[M������J��n��r��I��L�<��G�����<��A)6��O�dᎰ�����Z8|n��t���rk��/��lZ�E<w/ș�$�܌F���-,�bF���*�0�2��"���[0AT�f?��~M�ifʰÃ��M�5���7Ȑ�V�:H����Յ	9�r},4��g8?3�[>.8.�Çy�����A��ٯ��~n��i8
y���y���'Y�f%6��&#tq=,peb�O�M�*wrm;p��������h'��T[(�ҥ5j�(� �͛G��I_�l���T�~�X�R:᪫�"�"�>��S��/���1�Hp~뭷��Ι3�n��f9Q�H���Xz衈���>�ȝw���v��t�7��?n�$F!d�˗�ɣ;1x��cNF�.�-3�7�hJ0�v<JEz�I+w�ZLP��Y��a�*��-ڴ�W0eJ����}�_�i��,(����[8�1ʓ!
�\���İB����0k#��3�3,�A��#x���g���5;D�4�~f�Μ�1���q���͗1-��V���gF|ڿ���@��z�<�mc%~�-�)�2�֠E�T�hJ�|P&#�x0s"pX *[ �#��>��xz�ۙ豏�ˣ��[̨>��s�w�<�P���գ�:y���K3Cq�؁��N��.��ݻwӦM����|�sJbZ�@xq�W�&h\:w��$A3�t��C���1ڻ��v�w�Db�ʋoIb�X�h�)���ܔ-[6jݺ������H��`Y��zZ�<ܨ��@�O'�)��.[߬\+���a�ׇh޳]M���kP�Q�xQ��<[��Կ���\��^�G�֡��_ව�L�G�&��*z�,���iʐ.F����x��u���������M���;44�M��f�e5�������
�nK-jT��,�a��v�[�Kk��f�p�d���R��駥��i��ZQA֎�������t~���_���%��8�#!�w2��}��4�v���K��&��Y#�`�{e�jըR�Jq6�Z�j�…�Kj8;	��ٓ�Lo��jӦ
�1��BƊ�Lݻw'�ȄЏ�#Gʡپ����q�=�nݺ�'�0f
�o߾N�پ}��l@ ��p�����>���<|�pc��s��"�Y�(U���x�c`U/(�
�<y��Ӂ,G %�}�R�_�xqz饗��	�bE�DE���~���`��aӌ3?4\��w��=z4���Oƣ���>3i�?���
S�P֬Y��������#�<b��Ԇ���1���y�v�J�\s�T��m�*U��V��_AHP2�L������f�P�"�(���g�5})K�`f
����3m�-��<{n�ʟ�+Vl�1F��k�*l;f�����iQ�^�����B�0�M��8K�0�ǂ�F#c����>��`]��HCyh!X((�=�z���]9@(@����
^F�^}��][ŧ���h�;����)�;�
P�-���?�5Z�Y@�,�B�^e��LZ��*��#�q��+��|������ի��q��~\;v��+Wd��9f�/��"��P��`ԋ/6/��/d3pI���yi�N��p�{�����}L�����~������?�
���s��P	���3�+��ҳ�}
*�'��1�G\�����p]�;a„��®��8͸��s¿c�rͽ�@KԧO�bA�I]�O�nl�����rob�~  ���Y�f�0d��꫍�m0�2^���R&Z��Sc�
�=l��T�)�\�9�6�l�
3^q��{�ü�ڃ_�o��,T��*S� ,+���Ъ�9?j�b�m��
jR�Z��e�����WU�q�����5}Z�ԫ�&N�9K7e�t�w3s���6�>T�����o{��"Xb9x�\��b#U,����|5�(Q�v���]���<��[�E��E�h،t��I�R�=ذ�.p�u��4q	�����"Fl|�)HC{���S��	Wb����A�3�I�s��,��(P��z�y����A�0�mۖ
.l^�0?���|�a�ȇeVW\q�Q��rĻ�ۤ�<fI�^Ҷ=��:u�g�u���_|a^�𧀦㦛n�i��}��aׅ��j�*��
�\���!�K_��6��#�+�a�~�=���	f����$�,���!X���k&3v�Qڷoo�C�Q����:fh�p/�!�<��0
��K^Z+4�{��
MܩS��R`q���Z�I*A ��$�B���9U�F u
`���Ǻ�T�}?-ٲ���������Ұ�xZ2y�媗(�{�8bS�w������=�3����ȍ���M`z���4�/�9��h3��A�l���l���l�5�~�>�6�Y�����W���8E%z�M�N�f����6� (�Y�hQ��1Y���%�6��0PS����S�o~���uS�����י��HL�o=,�8��zP�#p��Œ�Lp�TB���Ba���񒔗��n�Cu����=QiXn5?�@��V�X�y��8��Gy��5/z9�ok/��M(����h��V�����EMl���G�bSJN?�������)}�DJ���^�:�6�3cƌ13w����n��@���� W�\NZ(�b&/N~��eq�>�6�&�_Ж H����+�&�bh��oh�C!���@ ���6�iӦ� ��z�%���NeC��˳j]h��=>&	&n���a��!
-��L�O�
�W^NY�u�O(��ƶRDJ�Hx���vb�?V8���3n�ɬ0��?�届�I�v��I@0x�qm�܀�|BVK�,�<�N}NjP����1�|���t�} �P��P?���l'4C8-�s*f8�,����bNG�^$��O��2^� �7]�tq�9�(���<ٓ�d�!@�� Z�li��R^�b�}����@!�\{��cF���+�@{�(�D���`���Ƨ]�v�uJ��
 \/'?����aw���=�5k�W�$�,�T�;�+� X�>�1�>�_f�m�R0R�``F�c仏�g��
�f_�|���c
;HϾ�P�Ǧ��,bf�0�1fgFj�����'/b󁟮*]��d���K��Z�&G]/��-�<��B�!‡(��P��M9�}^�x�c#�޹ϔΞ����#��vfLp?�Ud�?'�Ξ�������]cǃP�غ��Q"b���$��v�f�^/!�t�^��k�E}**�P�
�N{�r�
�LB������ِ��ŌAh�ψ�`ן��.uޔ��0�`Nz0����y�E��T�R�	�)]���ra?�}L B5ʊ`���0G<���*����V�,�wHH�ѐ7�
`V`�`Vih�f�:�Zq6	8fH�6��}H��X��yj�,���a�0���ٴ��a�G��A��R:v^d턟��9�#v{���:�/�n)k�~
@�<��`ª���fM�E���P�-Q�]��>���Q��`���g��6#��m0��
�B�	!���W�����`&�QHH_���`�]�	�B�WK�H�oF@�z����Э[7
�h��)uA�!�k�0+� `%v)�]/e%J\��Ƚt)�#<s0K`ub18Єx��g�I�&�}�p��I�͌��o���yN�%��\6�a�Ǻޯ�V
/�`�3�p����αu���Mq��XU���2G�)l�}��њ�#/�Pg/�O�6�v��O@���/��0��o�ᆘ���Ō���	�^�C#�Bm+y#�:09h`��5��T*I��8�a��M��V0�{���W}���+
�~[����.�?_	�
ԇU����'�d]�C,-DP�0aI�o�`�'@�a��OkB8#�!��Fh8��b�v�.�x^�fUo�{E�<�#����`9���BX�%��#��iĹ+��q����[iiv;OJ�C��5���nѢ�j�*�������}_���`	�z0MO��^��%��q�G(+��h-��K�4�?��%a��h
`Ts��H���
&�e.�w��YZ��'��~�Vf��0!�"⫋�c�	�7���0^�
�{��0B����H�8��a興x��"�!��)����޸�/�fàM\�6��e�p��"���܆�n\�7D^<�G۬��A�*򩢏�bA�#1mJy�Ə���Yxvǧ5�y��j�����ܽ�W����bΒ�]���%���^�}1?�5�������9�R�����^Ҹ���J	�߸qcP���g���NB�§&'���1.�M*q	qՑ�ϥb��a�L��������1�
c6�(�t���8�?Ұ�_WBY�-��@��V5+�;�C�ut�H��踛���=| �0��Y3f�¹��Tj�%^��&���;K��Z褾t[#�OF�� ���Z;B�/�6�.�i'�w�B��:1�bI�!,,�a�#F��ʏP��f0��B��}ێ�z�Ն�V�zus��-H؎�ԭ�+W�S)��C��Ap�ԩS��y1H��B�,7!��܋q9�J�	w�`���/bŸ11��j[�$u�e��ǁ��"db���͛Ms0�Y!���̩R)��£�J���s�&���Z�a�_�ʥh��Khʢ5��%��tm5'����d--LJ� `���^M�u;
�����8�_��[�E�ѬZF %O⨆t�M���������C�pL��$�t'3h�f̌��f�b�����mT��6�̒���ݛN�C�Wl4Z���\C�ё�E��{8��i[�����>'�v_$-�֟ٳ�gbК����x��%�.��D�ʕ3_7Ē*�@�%av���q�xÞ�� P�رcM(����&�cA��Q��q����3�ׂm�z���:�Ə9��?����Kr탉����P�6�ʾ��1��{)��#��a;G��ҥKT8Lq_�z�n(
#��
�0x�ns�Z�hnԨ���S>\�����a�拸�{خ+9�!P�S�xN`�L"��E<��!J�y�沫[�W0�@�g���1�����p���ݚS��Y�τ�~/�kh~&��BC������,�dN˳~��j3]_���`�
��3���q��[ƒF������8��"B�,
��`����×
���O�^��.˖�����M�eb6�c��t�4�?�*!p��I�*�:���$yB� �O`�2v~������n���K2��j<��A��`&�u�|���>""�v^���;�0q,�#�p���Zfr�
��%~��Ľ�2e
��5j8Z���>�u�����ڃ0��+o8���}�Q�B"b�nj�n ��p��g�ԩS	?]>��;k�1�2|��-��h[bd�q�A��18���������` �^�/�7�$_>���}�7u*&fTP�ga���2�d�nçҭo~e"�8"
"�a��Y��h�9�0Sf���~ô�|9��e!4�M 4xү���P��:+�x;�#!��+8�6�f��<��pih�QΖ�69M}�5 ��V�n��
{R�?���j��o@��q$��9d4K3���g����r`�ݚk���NX2�9��rJޏ@��!�}��\��̑��Ʒ����-�:s��M�#�!��dw�L�=��La���H��f�(�hs^k��Tv/��/��^��^�"�.c��\rRJ֝���+��#`����-C�	�ϋ���"8vB�LC f+/�K�.m|B0#��
�!��aQ�K��=�},��go�A���A�
�|�w��F�b��@�l޺���E���Gi�ϔKWK���K���|2��M���2�n�T�W)�7Jk����If�A(c��[���;,�v[z�U���~J���Ν�U�E�x;m;��`���cCf�|6����� �����<�?|��`�
�>�w��1�_������a�Vn��C.�4�2y�q���(�s�i�}�ruAX23m
XU4k^x������}����8�Θ�.�1d�:�s[��X���a�)��F^L���r;�^u~�R�Lh�����aV�*<~pF�/�P_�x�A{�r�^�q�Gڅ�cȈP�QJ�� �.�������>D$
�/8�
c�s����!�#/A XYI�M�70i%�^�z�k_�5�|J��	�y�>_I��Ox�#��E1C3_d�-��Ne�M[���-�� 0CN���_[C�_��y�E��祑;���IK6��#��~�I#/��h���r,��9}���a!��6f����>�<�*���y0v0_v?CS�m��GqN����P��}���a�b&/���>z�G(�֍���߈�(�/����q.9��y�3~�O�#v?^T��q
���,AKl�q�I�%�伏�2f��Yz|=�}����cՋ�y��L����3X�Δn?����/�cZfR`�P�c%f�pa�u7�q:��R�W���u9���C�&u:��a�\�9/�B��$ ��YV��"���G���p�Ɍ��3#���ԁ6�?Äy+�}@�r�cق��漿o��1ۢ>V�SF��s���E@P���D�
�ce�	��-�0u?Ǿ0sV��}�����s>0a��c��(��X���E� ɏ-�1I�4!��E.p(�U�9�2�?-���9��<N��w0f���?���!xzFPE�� e��d0D��Y��N�s����l8�0C�|��o�E��o7��cm�q��gaÞ�;��"ع`}�����p{9�ں�$6�W9W���+=��

{,<ɕ��"�oG`eLJ�@r#����b�Y�}ҿ�<������ʝ4鿯|��l�`���Tܣ�Or$�oIH<Xˮ�$��UŤ֭�B�0��j&��dh����%
B��SE@P�F@���	<A 
�γ��YY`�0G�=,=RE@�DT0H�Ú�p�PL	mC�+��"�(��
�AM�(��"�D�WRE@P��@��tR� ү��_PE l�v�t.Ď��`�1=��$ؐ�H�+��"�(����5(�oU���F0��h~>����"�(��"!@ 8r�mܸ��k�Ή�	��ۯ�H7�$:��c�w��%E D�kf!f�l��'zy¢�!"�/S��)��H���<qS�U�?�|��2�s��������7��[PE 4 �'���g��s�RXMˇ�o@O|3ǧ9ص1R1�~+��"�D0%�8��Z&%K���ч��(6�X�<{7�v[�=p#b�"�(�@jF���+F�˗��9BnS��[w�|T�(��E@PE �+�AT_	�"�(��"�`A��(��"��*�˕�~(��"�(a��
ap���"�(�@� ��A�\	�"�(��"�`A��(��"��*�˕�~(��"�(a��
ap���"�(�@� ��A�\	�"�(��"�`A��(��"��*�˕�~(��"�(a��
ap���"�(�@� ��A�\	�"�(��"�`A��(��"��*�˕�~(��"�(a��
ap���"�(�@� ��A�\	�"�(��"�`A��(��"��*�˕�~(��"�(a��
ap���"�(�@� ��A�\	�"�(��"�`A��(��"��*�˕�~(��"�(a�@�0�C�t���c4g���Z5��…
��Ή'�ۉ���3g�]��;Wΐ�&4��h���h�BԲ�M�.��j	�09�oڼ��,_i�lҨ>eʘ19�Z׆��i����M�P��������ӎ��)G�lԠ�5���D�2�ƚH�"�XX
?�<�V�_�	A�X�"ԡmSd����ŗߘ��Ŋ$H0���t���Ϧ��ӧ��}�$�	����Ӻ�M���ӵuk'��fN^~���5�7S)�Ţ�͠_��4w�7\�f��D�ӑ_Ҿ��8��R�`McM�[&l�K�`����J(J�ϝs��\��ٯP����N+��o%�n�D`�*�}S�`��:k_�j���O��e����S��˯�3e�^u%U�T!Q�$g���ӟ����=ҩc�X�;q����c��t���(^��P/Vߒ;�R�5�Ǣ���7P���Q����ҁ��L���˟/_�kxM�ZN��h���EY�dv�C�i٬�1#�eSBۖ�B)��<=�F��F`uk_��z�`�8s�,�ܵ�TT�|٤Wb
�X+�w�~��r�r!���l��D
 �L�R�\rJ�>}7�GZ�q��r��`�v�g��*\�kz��y����ֽ(������$;a)�d��Μ3�>���ޥ�턛>�?�6o�fNW�X>X���$�-���}HISE�uE�o�䌹r"��pw�v+��xL$��LT��k�;�*U�x–Ө�NR�t��ڴe���Br��uN�/�7o�����H.�X�u'�K��k���Ę��{8v��E��ӦM��fx�v�s\W��y)[֬^]N���n3�={���c�	���8V9r�U��&���&M��,x�nd�"�
P�L�<�ٲm;�O��hPB�����ܷ�\oR��m~��9���B&�T�+T:x�0�ٳ��r���䎳�J����ݸ
�ڽ�N�:MŊ�>N����Ip�ŵ�L9L�T[�@�x�$�x+�!�}rW��#P0�r��4'R�o`�زm���S(t����|�}�2g�~n���kb�
�jB�Z���I���3�IDAT����e<3��c1�N���ǎѮ�{��q��.�I1yF��Z"F0�/��c�l(�m�R%h��#������O8�ڴ��no�2֋/�G�>k�=ح��w�<1r�8ڰ�7[���=wu����.I!m�5�>1��}ƕ�m�ٻ�F����������EӮesjѬI,,�/�i?͢�1?�����.wQ�l����Ӑ����^��0��6π��Z�:�ўJ�(f^p��%t��)s�av��̱��Ӹ�i����{Yz��.���!�}���e�g�i��U@�e���l+�"0͉S��?� '��]��-My
S6�*b��?i�#���[�1�+��/�������[=�X��<��\��B\Fc�1U��
��1t˓�2���o`�90��4iX��֐A���{�G�gL�+y���}q꒝�~����&
���'��޾��{�ϿK�$�L�=էժQ���*�+cʌ?)��aߞ�@Q����|7�11�yLj�t�@5�].If���γ#'��?Xvi�'�ƝL����NR�z���o'N��s�9����-��۴�%��a�k�ަ��.�'��x���y��;�����?��s��d������V��T�rE��Z�`��ΛZ�?m��ض�reJ�۲�h�q�cͲE[(@:l�����d��J�(��r��_z=�ᖓ�臾����.��mmF�Y�Pr��u����%�=0b�$���pi��>r��|�Esލ^����~�q�r
���^�-Y��^~�]3zj����%B�#�;|J�V���!Mhɲ<��b	8/�Cޢ�3fK�����f[ٳe���{���"�E�>����b14��9s_���9��{m�;�0��[�d��a�e�>O4x��3���]ybq‹Z��̹�i�?\����Q�}��K��.���\Q������M���"�/[��u���'�.{�����.�e���pʽ|��Q�@�L@���s/:~SR�|��>�%������?��CCv{�fo1�����%�c������Y��D�$�=�{�?�Eh�� �
AHp�8�"�07ay8��FЇ��2����[�N��Vb�FZj���`��P0՝��v��N�Y�N��ժY�<h�U��?k�S��\V��dQ�d�`��>6M@��|�mT�fu��w�r��>77��#FQ=��"O($�%�
`���G|�Ciű�]SǨ%�'#�\��75��yb[�C��s/;/�2�JR��Mف�$���g��5�zx���g4�߀!�ؐ'�{�lO5�_NKY �z�d#�Ù���r77ihR��CB�	��R��1��05`&/�Y8nh-����3�\��c�f���%e��0��K���#�t�`��y�%X�YG�~��܁�o��Tl�=�2�ڐ��Z��nڼ���%�+f������b��0��.'5af�(Mŭ�41j�u����Q��`2�M��nk}�ӧ���b���f756��<��=�	��i˒��E����#Gv�M
n�nok*���5�caV>�ކ��'S0ȿW_�Og�A����k
���z��0{���?l�³s����r�_/",�Ž��շ��Ǩ��"4ml@Y�f�禃��ٷ�~�gT��~��h(�v��$�� d��u[��f?���I�X1�0x�#@�U��]�M&x�>1ڼ�[�X��U;�O�h�1�/3��A�L�����s��i��^D��9�;ڷ�j�W&��~����3�k����2��T���!�7_|��X�g�>樕��*8<<"��"�b��ug:�u���Ɗ��U!��D����lf(���*z̖@��dJ�%3R����Ɍ��=饡�U��D0s�����|�^'�l�o��<=��I���e�e�vB�!�ǽz<�+.j�S��f�B
�������z��� y�~�٥�\�.+Ԩ�u��=Lc��h^6s�aT����-f���;C4 �o��[��^�����������چ��d�Fp@]S٤bv�-��V�u�\^)c;Ă)A{&8ACbI��� ��y�g@?B!���١�>�2ujՌe3N
n�:�^E_gΙgV��k�.†?��'�|�}�k|2!ȵ���q��֖�T���8Y`„��W�0iv^$@� �&MZ��`�E
$<�0��AQ�A%�f�Bx���&���ľw�'t�o
��
 �!���1eY��I?8���z�pk���	��M���9l��'8A���;�W��u�̉�9^/|Aʤ�mD���|��q^���c�	�������^�xA�ĉ�>f� �	̾�
Ҍg���"��$4���n;)і�u
c��	(Z�0���+f��j;��A�~<�@G(�<x�=$x�rA7oq��D�*��K�)[�ZU�5��ޮ�s��	`�)^~��Bf� 0F�@@����ȳa�lB"�w[��P �!Ԭ~���#
�3�ខ6A�{�]g�f/[��pұc�k�Jmavj̐�� �.Z��0+0-̦���*��	u���M�V�l�|ݎdI�
��&p����5�zx�o���̋�=�	����'��6P{Y�3�������T*�0���&0"�M�>_���i?�6I��	��%�|��ľw;V��%�l��P }�s-����.7��5��i��x�)}A� ���2�W:f��d��g�;�'�[��0��}	��6��@l{x��,.؅���(}��a۪f07!�9�ypa���<S����E���w��+[����%O)�֕�����}�<N-��d�B�h��c󷙳�6q!�v��4�t�}�:I���6-�4BH�6c�l1��ٵgO@z\��X[�#�a��PN�:6�Œm�����>�`�kG'Yq��_f 0O{��}��q���d���͛�9:�u�>M
N�ۦ-��/�,�3;�'tG�F˕�U4���BR<�`�Gh`�>Ag�q�I�ǵ]i�)mAN���~��K{�k/º�X���۴e+�ݻ�@�$k��)fP�mf�r��N��{M�k���NR�:��}����>�l���5%�`��Ch�p������+V�$��%4c֯�{���̂sЮA������7ӕ���'�S�6�C���tDTw��5Xw������ͺ��a)ˏ`�-��?���F��������l�^@l�*��8v��*1�MJ��n^̐�1��nʏ懗����ۗW�(݊�M�6��fK�6S�z1�W�;�9�4�lmm��e�,��(���W�u6�d����(�P"��r���1�+9���x�n��+_�L�+��`��m�i��/�JRp�FC��_��?!dk�*ymJ
nv?��N�BO�zؓ�||}�:��ʽ
�h�B��§I��7��3�&~%�8p��*�\���qaK�+��C	}�$e����r,�#yVp��t��c	��L�[�N4x�&�*Ѝ
����`���#��A�Ī\㫯�e̜�c2D���֬�1
�����O(�x����~��b�oy��}ofd�*����ޏ<@v�E��׾����n��W���S��~�mT��|�y�SB�2,��}4�����.8���057��yKU]�t)Iv���6�������e�p*�؁}U^�Y��E����B�
a�Ɍ�����W�x�I,8��E��y�&'��� �o�,�-�I���&u'{�	^���(y�m|}���|J�@�`,�ڰ4�r�K�SX�[��)�BC��5K:�3�~wc��$�GA�sR_|ۄ�w�2V�Ѐ�e��lɎ"�Z4���x�D�&���X�8"�o�"V�
�o&Lq&x6�
�֠�O��!�
�҄�VZ���ҵ���[�B��yK~@���b�bV8�,;�ls��z����G#�׸��em��Af�>H��jK�O@�V����i�"��s�i8�5��*�_�i;�d��낋�[&��A_y����Dp�0�����^VBp�`�N\��%�[�����I����L^�8�dj����m�v�C����lF��_㷑�DhF�r?k?�t1� ��*�7�'7�!�l�B��j�&fu���6�>�y��m�e0Ҿ��V�y�oNE(�s�����.���y�``��#3d�{�p.>J�{'�cE`��!&��ߣ�Df�aJg8>ci.���#z"����J(��	#�\��q�\��C��$�G��ʬp1�D����>FQ���^/���\�$n�#�l'�w2ӊ��G��l˔
�L��v��}�u �f�|8Nj[^uB/`�]��LJ�h�����؂���p�I���hl|m*e"8�;�	�g����N/�I��#�Z�V`>*«,�D �����reb �>�g{��{��"<)8�8}�r�z�������X���0+�`��hް�Mf�Җl����������?<c�`x�ħ��J~�k���q|d�rB����}^�ŹreKa�$
�#m&t��X�>�,�p��׌�s�Y>��mʑݷ�ر4�ۉ�m"�ɂ���-p��ҁMO���a^��ˎ�
��K!�:"����F��.^v���E2E�`��fF�J�c��Ֆ߁�B}��&b�]�>��A�8��B!��BC��n�JD��ϞYI���q��J[N�_|�u,&	���ޗ�t;�����WHV�D���ďCf�R�laC����z�N�J2K��6���[8o��-��G�Qc�ˮ��'4ҠO��3ei�-ق
���&̌e��g��u3�8���� {	���P�!��l��].)�!��'�� �+[0��~�c7����''c�1���S#�qm���uoK>�m��݁P�nB�0��{ݧ��r�-a�]��qb�;I+� �(����n��/���$C�j~�Yh?d�l�Y�iX�ڀ��x6�܌��:&�n(��NF�AX�h&�d0���0\��) �?.=n6,��5���vc��W�2�Z�#0k�U��k�$�^��x��U����6	!x����xѼ����%��bk��Y
ƋH{}��cV��.Y|��Mr�������D� �gG?0M��t��q���/:�ԃ%~bZ���ROBl�T��*V`ԃ^y�`sfx�;8I�OY��	�E�ݮW2�|f��ځic|Xj+��P�g�{�݉�I�p��um��PB�
��85�s�'7`#�nq�>��#f����}�&>��(X���t�B���
�!q`ű�����:@��ؾ$��	�v�#�nk����ٳ1}�|�7f�0���Pb�;I+��֛��aE	��A��^*�̠W�w��n`�((·��L�Ȁ0����d��D��w$�/\g���@!1��M�Az�X���$�祖��m;lť���;ڠ0,خ�%��yY�߼|(Ȑ7���:�$o�D��S<��>����"��#�7#�;�P�ԙ�O���&}z>�,Ο�,�};���gD�<��[���#^� �I�禺��f���.=�=����_�XK�$�d�"3�ωV`Z��w�dֈc�N�bd�^��k(c��.ص�w����d?oI�b9^e!��z���ty�Jf?1��p���6�!|����á̦��d���}�9��;B��am�L���8p{&��km�I�0F�os�� �S�����h����1~�r�R@�?1��B�օ�*�?7�q���wr,�
V��	ƒ<�x�d��X�������0��y��a�w4QXk�eW�,���e*��e ]�����~u�{yn
���*Kfp��?�L� ;��}޽&#�t�!��Bۏ<�շ���c��
�)�x�ټ��˞3o8�<tog��K8m�f����
#�� k��>��Kp@��8�������'����v���F�u�~���F�Y�+���P�(�����T�0�v���З8Up�6��}�#^������ԍ�}Ҏ�)�MN2N��Į7�}DK��Vfm(W�t)lJn��=��g�,�I4Ra�k�:�aI��B铻�}��]M�I����~�I~����t�#L����rO(�ަ�̈́��v�^��{���NR�*m#�6�;<�n����~��1����~�g�B8j;�8 "-X�(�c�xy`�)ή��wx5��Pa�Km�i6o�q�*n9���A&�x0���0?,*�?��4�\���D[0!��i�;^���;wbQ�R6%��?
�1K��)�\HuVP���f����d��^1��jhآ�F0�P�R�o~��~K*n�b!�B���BP���;"�Ṵ��d
x�'4P�����<�����v�i�����a�]&��1���K 1�����6���R��`�R�j��@"��"|���|�^"j�"��"�$
��6%$mhZZ�<�[0�()��"p)P��R��m*��#ԶC�GVMRE ��U	)6j�XCΜ9�{י�]W��0�vIP��1����cTE@PBD@M	!��E@P�h@@�h��:FE@PE DT0(ͦ(��"�D*D�U�1*��"�(!"��A�@i6E@PE P� ���QPE@BJ�)��"�(р�
�p�u���"�(�@��`"P�MPE@�T0����cTE@PBD@���l��"�(�@4 ��A4\e�"�(��""a�u�
7Ӳ��)
䖦�(mڋ'���,:w��.Y��V�"���m�歴d�J��&��S��#k���yA�M�P���"�(�"�����y��E�ҥ�f75u<I�w�A1�+SO�fMS�`��O�Ь���q��(E6�O�A������7�ك��+��%E l����`J+Ji�@opqh��NC�+�w�#igӖ�4s�<��V��L�����+V��-T���.c�z©S��˯�3�^u%U�T!��ɘsŪ5�6\�����N�kU��"�R��/۽���1W�P.���Y�*�@���˕�����`�nqK��9{�v��m�+�/�&���z6y	�eJ�
�`2�<u���T�xq��d�V�(a���3�'`��6lrr_l�%3�ٳQ�9�~D�Ϊ5�Lw3g�Dyr�������5�K��zM���R�K#d�׳by.ѭ��*�����Z�cl@�B�2�.��m;X흞
��y�̙3�s�:{�+Z�2ġfE��l1��k\��o?�">rԨ�s�/b݆��1��a��>�������<�m�(_���E�;~�v��K�2e�…
�|]�V�?q���w�2׻@����$�28��)ڽg���z�t�B)����c�������H��/��P�C��ܹrz���+�p��݂<�x��7�m��v?p��Mh� (�,�Eu�����"���`�b��^
�j�Fx���i��u�R�A/��Z�Jm[6ʈ��Xel�k�m�
4}���y��N�<LpL�v�T�9w�����m[�BmXmo��8v�8u��۴?x����~��`����<���Vf_��b��ѾϚC�C�`u�8MJ�%�VP����[�4��ww4�+��8�e���Cަ�+W9c�x���l3�"0��s�3�Ӿ��4�u�t{��,��u0���˜y��CN]m]��������i��]R�l���ч�5Ba�	>����&��](
�k?�43��+�V���/@{�O������!P�5d�9?��������8���=��Д}��D�o�r'
;<�v7]ue��t9���"�
J��wS~��?Lw���l|�tg�֔#GvIҭ"�(��4%��;�q�~�y�c��5��1x�ݏ</�I?РW�$�P�̨��ܴj��!�n&�v�Fz��<kn@_�Z	���^"̼�2e�Y!�Mⴆ��G��Oӄ�?�4�Фa�X���7�N��2�Kʮ�p�=[6�g6�ϛ�����w�SFv����w�#fpn�yf͝��'��$��y<�-��,u�����&�~����a��
Pvæ-����'U9۵�c���m+�LK���g_x� 	y�Wr�ҥJ8���f�={�!P�d(W����U��_�% á�Gh���Ө��:��U,4�J�,���#��J�_f�J��B'N��$�*��"`;���C����s�сn��Fjp�5����.YF#G�3/��.�/�ժ�|�����1j��֪Q���3f�u�0�{�*j�y�҆Zw��!��A����`��x%�=>1�6&~?͙�����O�Ƅ�A�=���a3�,'lڨA�3�n�;���Z��q�u}qe��[�.��+m��t�`���L�f,�~�i�)�2r}��u�a�:�*���`u����.�9��>ju���S.�0�g
�m;v�lŋ����Q��h9��̚G�7n2���A��:�}4|�Y֊��Y���۱PW�N2c�8e������w^�,Y2�c�_���>i��f6�d�9� `�
aKg��]S���`!N_|��I���]t�?��;f�@��۵jN%�5�-���cL=���X����p$�f�%�X� �5���KeK��/s����W�g�1ܣ�Y�h�Rc��<u:���B�J��"���` ��$}}0@�}S��@�|���3Y��E0�Kr�c�(
y�Y����w�g��0/0��l��}	���C�+�٨̺��r! ���ey6.�eh+l�?��p�̌möi�?9�m���Gp��o��}&+l�%�������;C��f5�ukQ��z��bv��'�@`&�h���岂S.��x�7u���)�C����`MA���wG(�Y�rz�Wwg�]�"��FV{?3�UZ�Zh�p�����z�kl���=DC��|��3�Dќ�L��+}&+�l�{M�ԝ�)���	SL�/"��C�}m#C�Z5�Fښ�1	\�%X�<���|n�q=^�D�=Y�mS�g����O�'3��Ͼ��
��[j��<ջ�s T���<w��`>SRE�F �L	���96�s�y`�š}!ؽ��7�m�P yԻFv���@}ad�`��BD[(0��N��/�bQ�P��Y�.T�B`hbʀ�d�����4��lfg����{��m��"El|ok��
�<W��W�!ϼO;���A@�@���֎�K��R��x���9��z?�#H~ı�ƚ�p
?�㐙4��q�'Nwvh#�8�IX�n���=�c�&�^�5q�
�`!����LS?�%�P��f�=@۵
L"��='X��s�����<�°M�땁��6���<��(ы@�i�:��~0��A{�njKh�?d����8�˝D�9�jn!8�	�K$m�`���%�qs\;����V=cFʖ-����G�6�� 0�b�
���~�4̘���,ڵ�_[`*�`"�c���B(ߖ͚�}���'N�sl�R��"C�����Y>��}������ڱ� �>4;�ve`��!�v}���E
9�b�@���^o<����@p�?_^�iGШX�{��8y�jU+�*�hK@�ssӆf��(�〿�m�</N��A�V�j����C�.Ի��0p_\̀a��*�@� V�f�7�f7�����}�\�����IS��`;�s`���8����]��WBp��0`�������J�s�h����엽�lk�����v~Y�{8����[��˭rv��0\�2��x�U�k]�8���)����u�,���UW�@R,�g��k�Rf��������-۶�C�S���4i|�=����K�2��j��c��U�+�<�#�/h�ڷi�h^
�"�D=a%�عۙ�V(_&�Łs��$ܯ��⊱m:>�U�"@Ӏ���Ilm�D��tq0���D�*h������s ^�	!{F_�D�XE�D'�ʕ��:��u2f&���BXJ��hP������*�I*�?h12�,&>���#X�K�'P֝�>祝�E�i0���v�g!.ڹ{�9m�,����`�Z�l���N��NsLW���Y�t=�T/ʒ9�3����"�Da%�����7.T� {�U��5�Zzs"�kx#�m�7�@9x9/�	 ��ů�2K=�>[�ng��
$S��>�/��o܄��|���+����?aV��C�q�=K��";�mR��"?q������p�s���$��g�r�V-�g��2X�"dG&GS\/��H>ٮ�]p
݂�-��KA��Vhm/��d�
��:�k�e��k�"��j�8SB`�*�\h�&4��(���@l�᜺�;X�'d/�4l�%���1Nҵuk�}0Xa�[��Y'S<;�! K��/�*��b�)3@wu3f�u�׿���9���;v��~;ќ�M9�1	���g
��-%9�-p��q���je��ffnո����8�V�v������nܼų
���0��ĉ(R8Fp�'��KT0HH#���O�K�I��� u	S�v�� ���%8 ]��b+d��V�,���reb�T�y{��B�o��$#�"�(n�J0���Nf�v��}<�q��C^� �p���9��)͞�Jy����C�!{YY%�m�����-]�r؂)}�/�{9�g����-y�?Ȏm"�U�b�NJ
��z�#8<
I�r,[�%��c�yle�����6�;�k3��	��<
��L�i��)A��}aG�J�:���B;Ic�2@I���86nݾ#Fo������f-����ڷ�I�.$����|P��p�B/̰S�,ɴ��z�6�KJ�|���g�h'�AB/���N`��(ы@ؘ_���ŅU���];�e��
O`�(�҃�GB���C�a�0�Ͻ8���j5���ݼ�U�q�b�����/�!WJ�m#��
�B
*,(jL%�BZ���R	F�QWqQ�Т��BQ\(�D��l춥�;�9>��s��z�����{�ܹ����̙yN����jZ�S�J�k�f�%�$�)�w�H����+���)���L�?>Q2�?�k̀n��6��v�@+�5Ul��zg�6��ʗ��X^��<�+@�6���>����/�_�w��U��WB�U}��Q��Z�X�:/l�U�:v4� 喜|G��W3/������iз�#�y]�Rr���vzv�J��
�>9�Y��B��&��cg�z�k��?�絒��v�讆vo]�E��rL��`2�%^|��ï/��GIڎ�ϙ3I�lN}�U}�g�֋���>Ĝ���jW��nO���r�O��T=��/{�N������ؘC���g�L�?:Q�r=rtqM�h�9�ʁ�������|�]u�����1��5������N�6��u֬_�U]��4�O�L���;��j>]���Z.h��k��l��3�O
�P)�PfG��?V�H�v
V�
g�h[0��K9��jz����ۧY����7����Y9�ـj�FΜ�{c4˶�Ѵ��}UY�=��m�Ѣ��gߟ�[�3��}����v�冼��l(����O7mK+.����n�S���:S��Y~�L_�^x.a�&��;&|_�a-:�̚��X����ь���O�L��P�'���l8����p��6E�����K���~@��/�I����nT�Vf��J{�L����Y)��}��B�hjYekǵy���l�׿W�9�_z(�D����C���+�B��D=߼�R�خ����������`��e7X�3L_�r�ζr��V{X�Ԡ��i�޻�Ϩ_�4�)�t�5y\�+��_�`�hq��'���>Ŵ^Wzc�G	��;��>Yx��5���e�O�N{�m����@�䣙
+[���z�����ow���ř���.�6˝�m���n��߮9�S@���Lʎ�/���%}R�#���.o�m�ĸ�O؀�V~����x�U��m����]ږ�3�A����j5�<2��,�_�Z��8�h`�g���_��zZ��A��m�/�Mڒ��6�iYO�t}�Κ�L8{�l���c�ϫ=��Y����|��]�7_��u`_o�J��G�JǬ53̀g���2�r.���zW^�fw��O�l2�
���<F�KW`��K��o� ���	~�=|m�E � ,@`Ju ��,@`Pr��v@��A�@��J�=ڎ �@��A0(�!� P��AɽG�@ 0�:@J 0(��h; ����T� �@�%�mG@ X�� ��@(Y����ޣ� ��R �%��{�@�`�`P�C@�d��{��#� ,@`Ju ��,@`Pr��v@��A�@��J�=ڎ �@��A0(�!� P��AɽG�@ 0�:@J 0(��h; ����T� �@�%�mG@ X�� ��@(Y����ޣ� ��R �%��{�@�`�`P�C@�d��{��#� ,@`Ju ��,@`Pr��v@��A�@��J�=ڎ �@��A0(�!� P��AɽG�@ 0�:@J8��|%h�]eIEND�B`�woocommerce-blocks/assets/js/editor-components/toggle-button-control/style.scss000064400000000373151335517640024247 0ustar00.components-toggle-button-control {
	.components-base-control__field {
		flex-wrap: wrap;
	}
	.components-toggle-button-control__label {
		width: 100%;
		margin-bottom: 8px;
		display: block;
	}
	.components-base-control__help {
		margin-top: 0;
	}
}
woocommerce-blocks/assets/js/editor-components/compatibility-notices/index.tsx000064400000000066151335517640024123 0ustar00export * from './cart-checkout-compatibility-notice';
assets/js/editor-components/compatibility-notices/cart-checkout-compatibility-notice.tsx000064400000004322151335517640031616 0ustar00woocommerce-blocks/**
 * External dependencies
 */
import { Guide } from '@wordpress/components';
import { __ } from '@wordpress/i18n';
import { createInterpolateElement } from '@wordpress/element';
import { isWpVersion } from '@woocommerce/settings';
import type { ReactElement } from 'react';

/**
 * Internal dependencies
 */
import { useCompatibilityNotice } from './use-compatibility-notice';
import WooImage from './woo-image';

interface CartCheckoutCompatibilityNoticeProps {
	blockName: 'cart' | 'checkout';
}

export function CartCheckoutCompatibilityNotice( {
	blockName,
}: CartCheckoutCompatibilityNoticeProps ): ReactElement | null {
	const [ isVisible, dismissNotice ] = useCompatibilityNotice( blockName );

	if ( isWpVersion( '5.4', '<=' ) || ! isVisible ) {
		return null;
	}

	return (
		<Guide
			className="edit-post-welcome-guide"
			contentLabel={ __(
				'Compatibility notice',
				'woo-gutenberg-products-block'
			) }
			onFinish={ () => dismissNotice() }
			finishButtonText={ __( 'Got it!', 'woo-gutenberg-products-block' ) }
			pages={ [
				{
					image: <WooImage />,
					content: (
						<>
							<h1 className="edit-post-welcome-guide__heading">
								{ __(
									'Compatibility notice',
									'woo-gutenberg-products-block'
								) }
							</h1>
							<p className="edit-post-welcome-guide__text">
								{ createInterpolateElement(
									__(
										'This block may not be compatible with <em>all</em> checkout extensions and integrations.',
										'woo-gutenberg-products-block'
									),
									{
										em: <em />,
									}
								) }
							</p>
							<p className="edit-post-welcome-guide__text">
								{ createInterpolateElement(
									__(
										'We recommend reviewing our <a>expanding list</a> of compatible extensions prior to using this block on a live store.',
										'woo-gutenberg-products-block'
									),
									{
										a: (
											// eslint-disable-next-line jsx-a11y/anchor-has-content
											<a
												href="https://docs.woocommerce.com/document/cart-checkout-blocks-support-status/"
												target="_blank"
												rel="noopener noreferrer"
											/>
										),
									}
								) }
							</p>
						</>
					),
				},
			] }
		/>
	);
}
woocommerce-blocks/assets/js/editor-components/compatibility-notices/woo-image.js000064400000013175151335517640024503 0ustar00const WooImage = ( props ) => (
	<div
		className="edit-post-welcome-guide__image edit-post-welcome-guide__image__prm-np"
		style={ {
			display: 'flex',
			justifyContent: 'center',
			alignItems: 'center',
		} }
		{ ...props }
	>
		<svg
			height="120"
			viewBox="0 0 170 120"
			fill="none"
			xmlns="http://www.w3.org/2000/svg"
		>
			<g filter="url(#filter0_ddd)">
				<rect
					x="5.5"
					y="18"
					width="159"
					height="96"
					rx="3"
					fill="white"
				/>
				<rect
					x="24.5"
					y="4"
					width="51"
					height="22"
					rx="3"
					fill="white"
				/>
				<rect
					x="94.5"
					y="4"
					width="51"
					height="22"
					rx="3"
					fill="white"
				/>
			</g>
			<path
				fillRule="evenodd"
				clipRule="evenodd"
				d="M48.8908 42H125.078C129.899 42 133.802 45.9231 133.802 50.7692V80C133.802 84.8462 129.899 88.7692 125.078 88.7692H97.756L101.506 98L85.0135 88.7692H48.929C44.1076 88.7692 40.2045 84.8462 40.2045 80V50.7692C40.1662 45.9615 44.0693 42 48.8908 42Z"
				fill="#7F54B3"
			/>
			<path
				d="M44.8709 50.723C45.4039 50.0175 46.2033 49.6462 47.2693 49.5719C49.2108 49.4234 50.3149 50.3145 50.5814 52.2453C51.7615 60.0056 53.0559 66.5778 54.4264 71.9617L62.7637 56.4782C63.5251 55.0673 64.4768 54.3246 65.6189 54.2504C67.294 54.139 68.3219 55.1786 68.7406 57.3694C69.6924 62.3077 70.9106 66.5035 72.3573 70.0681C73.3471 60.6369 75.0222 53.8419 77.3825 49.6462C77.9535 48.6065 78.7911 48.0867 79.8951 48.0124C80.7707 47.9382 81.5702 48.1981 82.2935 48.755C83.0168 49.312 83.3975 50.0175 83.4736 50.8715C83.5117 51.5398 83.3975 52.0968 83.0929 52.6538C81.6082 55.3272 80.39 59.82 79.4002 66.0579C78.4484 72.1102 78.1058 76.8258 78.3342 80.2047C78.4104 81.133 78.2581 81.9499 77.8774 82.6553C77.4205 83.4722 76.7353 83.9178 75.8597 83.9921C74.8699 84.0663 73.842 83.6207 72.8522 82.6182C69.3117 79.0908 66.4945 73.8183 64.4388 66.8006C61.9642 71.5533 60.1369 75.1178 58.9567 77.4942C56.7106 81.69 54.8071 83.8435 53.2082 83.9549C52.1803 84.0292 51.3047 83.1752 50.5433 81.3929C48.6017 76.5288 46.5079 67.1347 44.2618 53.2107C44.1476 52.2453 44.3379 51.3913 44.8709 50.723Z"
				fill="white"
			/>
			<path
				d="M126.922 56.5426C125.536 54.1968 123.495 52.7819 120.761 52.2234C120.029 52.0745 119.336 52 118.681 52C114.985 52 111.981 53.8617 109.632 57.5851C107.63 60.75 106.629 64.25 106.629 68.0851C106.629 70.9521 107.245 73.4096 108.477 75.4574C109.863 77.8032 111.904 79.2181 114.638 79.7766C115.37 79.9255 116.063 80 116.717 80C120.453 80 123.456 78.1383 125.767 74.4149C127.769 71.2128 128.77 67.7128 128.77 63.8777C128.77 60.9734 128.154 58.5532 126.922 56.5426ZM122.07 66.8564C121.531 69.3138 120.568 71.1383 119.143 72.367C118.027 73.3351 116.987 73.7447 116.024 73.5585C115.1 73.3723 114.33 72.5904 113.752 71.1383C113.29 69.984 113.059 68.8298 113.059 67.75C113.059 66.8192 113.136 65.8883 113.329 65.0319C113.675 63.5053 114.33 62.016 115.37 60.6011C116.64 58.7766 117.988 58.0319 119.374 58.2925C120.299 58.4787 121.069 59.2606 121.646 60.7128C122.108 61.867 122.339 63.0213 122.339 64.1011C122.339 65.0691 122.224 66 122.07 66.8564Z"
				fill="white"
			/>
			<path
				d="M102.767 56.5426C101.381 54.1968 99.3018 52.7819 96.6063 52.2234C95.8747 52.0745 95.1816 52 94.5269 52C90.8303 52 87.8267 53.8617 85.4778 57.5851C83.4755 60.75 82.4743 64.25 82.4743 68.0851C82.4743 70.9521 83.0904 73.4096 84.3226 75.4574C85.7089 77.8032 87.7497 79.2181 90.4837 79.7766C91.2153 79.9255 91.9085 80 92.5631 80C96.2983 80 99.3018 78.1383 101.612 74.4149C103.615 71.2128 104.616 67.7128 104.616 63.8777C104.616 60.9734 104 58.5532 102.767 56.5426ZM97.9155 66.8564C97.3765 69.3138 96.4138 71.1383 94.989 72.367C93.8723 73.3351 92.8326 73.7447 91.87 73.5585C90.9458 73.3723 90.1757 72.5904 89.5981 71.1383C89.136 69.984 88.9049 68.8298 88.9049 67.75C88.9049 66.8192 88.9819 65.8883 89.1745 65.0319C89.521 63.5053 90.1757 62.016 91.2153 60.6011C92.4861 58.7766 93.8338 58.0319 95.2201 58.2925C96.1442 58.4787 96.9144 59.2606 97.492 60.7128C97.9541 61.867 98.1851 63.0213 98.1851 64.1011C98.1851 65.0691 98.1081 66 97.9155 66.8564Z"
				fill="white"
			/>
			<defs>
				<filter
					id="filter0_ddd"
					x="0.5"
					y="0"
					width="169"
					height="120"
					filterUnits="userSpaceOnUse"
					colorInterpolationFilters="sRGB"
				>
					<feFlood floodOpacity="0" result="BackgroundImageFix" />
					<feColorMatrix
						in="SourceAlpha"
						type="matrix"
						values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"
					/>
					<feOffset dy="1" />
					<feGaussianBlur stdDeviation="1.5" />
					<feColorMatrix
						type="matrix"
						values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.2 0"
					/>
					<feBlend
						mode="normal"
						in2="BackgroundImageFix"
						result="effect1_dropShadow"
					/>
					<feColorMatrix
						in="SourceAlpha"
						type="matrix"
						values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"
					/>
					<feOffset dy="1" />
					<feGaussianBlur stdDeviation="2.5" />
					<feColorMatrix
						type="matrix"
						values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.12 0"
					/>
					<feBlend
						mode="normal"
						in2="effect1_dropShadow"
						result="effect2_dropShadow"
					/>
					<feColorMatrix
						in="SourceAlpha"
						type="matrix"
						values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"
					/>
					<feOffset dy="2" />
					<feGaussianBlur stdDeviation="1" />
					<feColorMatrix
						type="matrix"
						values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.14 0"
					/>
					<feBlend
						mode="normal"
						in2="effect2_dropShadow"
						result="effect3_dropShadow"
					/>
					<feBlend
						mode="normal"
						in="SourceGraphic"
						in2="effect3_dropShadow"
						result="shape"
					/>
				</filter>
			</defs>
		</svg>
	</div>
);

export default WooImage;
woocommerce-blocks/assets/js/editor-components/compatibility-notices/use-compatibility-notice.ts000064400000001776151335517640027557 0ustar00/**
 * External dependencies
 */
import { useEffect, useState } from '@wordpress/element';
import { useLocalStorageState } from '@woocommerce/base-hooks';

const initialDismissedNotices: string[] = [];

export const useCompatibilityNotice = (
	blockName: string
): [ boolean, () => void ] => {
	const [ dismissedNotices, setDismissedNotices ] = useLocalStorageState(
		`wc-blocks_dismissed_compatibility_notices`,
		initialDismissedNotices
	);
	const [ isVisible, setIsVisible ] = useState( false );

	const isDismissed = dismissedNotices.includes( blockName );
	const dismissNotice = () => {
		const dismissedNoticesSet = new Set( dismissedNotices );
		dismissedNoticesSet.add( blockName );
		setDismissedNotices( [ ...dismissedNoticesSet ] );
	};

	// This ensures the modal is not loaded on first render. This is required so
	// Gutenberg doesn't steal the focus from the Guide and focuses the block.
	useEffect( () => {
		setIsVisible( ! isDismissed );
	}, [ isDismissed ] );

	return [ isVisible, dismissNotice ];
};
woocommerce-blocks/assets/js/editor-components/view-switcher/index.js000064400000003757151335517640022220 0ustar00/**
 * External dependencies
 */
import { __ } from '@wordpress/i18n';
import PropTypes from 'prop-types';
import classnames from 'classnames';
import { ButtonGroup, Button } from '@wordpress/components';
import { useState } from '@wordpress/element';
import { withInstanceId } from '@wordpress/compose';

/**
 * Internal dependencies
 */
import './editor.scss';

const ViewSwitcher = ( {
	className,
	label = __( 'View', 'woocommerce' ),
	views,
	defaultView,
	instanceId,
	render,
} ) => {
	const [ currentView, setCurrentView ] = useState( defaultView );
	const classes = classnames( className, 'wc-block-view-switch-control' );
	const htmlId = 'wc-block-view-switch-control-' + instanceId;

	return (
		<>
			<div className={ classes }>
				<label
					htmlFor={ htmlId }
					className="wc-block-view-switch-control__label"
				>
					{ label + ': ' }
				</label>
				<ButtonGroup id={ htmlId }>
					{ views.map( ( view ) => (
						<Button
							key={ view.value }
							isPrimary={ currentView === view.value }
							aria-pressed={ currentView === view.value }
							onMouseDown={ () => {
								if ( currentView !== view.value ) {
									setCurrentView( view.value );
								}
							} }
							onClick={ () => {
								if ( currentView !== view.value ) {
									setCurrentView( view.value );
								}
							} }
						>
							{ view.name }
						</Button>
					) ) }
				</ButtonGroup>
			</div>
			{ render( currentView ) }
		</>
	);
};

ViewSwitcher.propTypes = {
	/**
	 * Custom class name to add to component.
	 */
	className: PropTypes.string,
	/**
	 * List of views.
	 */
	views: PropTypes.arrayOf(
		PropTypes.shape( {
			name: PropTypes.string.isRequired,
			value: PropTypes.string.isRequired,
		} )
	).isRequired,
	/**
	 * The default selected view.
	 */
	defaultView: PropTypes.string.isRequired,
	/**
	 * Render prop for selected views.
	 */
	render: PropTypes.func.isRequired,
	// from withInstanceId
	instanceId: PropTypes.number.isRequired,
};

export default withInstanceId( ViewSwitcher );
woocommerce-blocks/assets/js/editor-components/view-switcher/editor.scss000064400000000410151335517640022715 0ustar00.wc-block-view-switch-control {
	text-align: left;
	background: #f0f2f3;
	box-shadow: 0 0 0 13px #f0f2f3;
	margin: 0 0 27px;
	visibility: hidden;
	color: $gray-700;
}
.has-child-selected,
.is-selected {
	.wc-block-view-switch-control {
		visibility: visible;
	}
}
woocommerce-blocks/assets/js/editor-components/product-attribute-term-control/index.js000064400000013340151335517640025511 0ustar00/**
 * External dependencies
 */
import { __, _n, sprintf } from '@wordpress/i18n';
import PropTypes from 'prop-types';
import { SearchListControl, SearchListItem } from '@woocommerce/components';
import { SelectControl } from '@wordpress/components';
import { withInstanceId } from '@wordpress/compose';
import { withAttributes } from '@woocommerce/block-hocs';
import ErrorMessage from '@woocommerce/editor-components/error-placeholder/error-message.js';
import classNames from 'classnames';
import ExpandableSearchListItem from '@woocommerce/editor-components/expandable-search-list-item/expandable-search-list-item.tsx';

/**
 * Internal dependencies
 */
import './style.scss';

const ProductAttributeTermControl = ( {
	attributes,
	error,
	expandedAttribute,
	onChange,
	onExpandAttribute,
	onOperatorChange,
	instanceId,
	isCompact,
	isLoading,
	operator,
	selected,
	termsAreLoading,
	termsList,
} ) => {
	const renderItem = ( args ) => {
		const { item, search, depth = 0 } = args;
		const classes = [
			'woocommerce-product-attributes__item',
			'woocommerce-search-list__item',
			{
				'is-searching': search.length > 0,
				'is-skip-level': depth === 0 && item.parent !== 0,
			},
		];

		if ( ! item.breadcrumbs.length ) {
			const isSelected = expandedAttribute === item.id;
			return (
				<ExpandableSearchListItem
					{ ...args }
					className={ classNames( ...classes, {
						'is-selected': isSelected,
					} ) }
					isSelected={ isSelected }
					item={ item }
					isLoading={ termsAreLoading }
					disabled={ item.count === '0' }
					onSelect={ ( { id } ) => {
						return () => {
							onChange( [] );
							onExpandAttribute( id );
						};
					} }
					name={ `attributes-${ instanceId }` }
					countLabel={ sprintf(
						/* translators: %d is the count of terms. */
						_n(
							'%d term',
							'%d terms',
							item.count,
							'woocommerce'
						),
						item.count
					) }
					aria-label={ sprintf(
						/* translators: %1$s is the item name, %2$d is the count of terms for the item. */
						_n(
							'%1$s, has %2$d term',
							'%1$s, has %2$d terms',
							item.count,
							'woocommerce'
						),
						item.name,
						item.count
					) }
				/>
			);
		}

		const itemName = `${ item.breadcrumbs[ 0 ] }: ${ item.name }`;

		return (
			<SearchListItem
				{ ...args }
				name={ `terms-${ instanceId }` }
				className={ classNames( ...classes, 'has-count' ) }
				countLabel={ sprintf(
					/* translators: %d is the count of products. */
					_n(
						'%d product',
						'%d products',
						item.count,
						'woocommerce'
					),
					item.count
				) }
				aria-label={ sprintf(
					/* translators: %1$s is the attribute name, %2$d is the count of products for that attribute. */
					_n(
						'%1$s, has %2$d product',
						'%1$s, has %2$d products',
						item.count,
						'woocommerce'
					),
					itemName,
					item.count
				) }
			/>
		);
	};

	const currentTerms = termsList[ expandedAttribute ] || [];
	const currentList = [ ...attributes, ...currentTerms ];

	const messages = {
		clear: __(
			'Clear all product attributes',
			'woocommerce'
		),
		list: __( 'Product Attributes', 'woocommerce' ),
		noItems: __(
			"Your store doesn't have any product attributes.",
			'woocommerce'
		),
		search: __(
			'Search for product attributes',
			'woocommerce'
		),
		selected: ( n ) =>
			sprintf(
				/* translators: %d is the count of attributes selected. */
				_n(
					'%d attribute selected',
					'%d attributes selected',
					n,
					'woocommerce'
				),
				n
			),
		updated: __(
			'Product attribute search results updated.',
			'woocommerce'
		),
	};

	if ( error ) {
		return <ErrorMessage error={ error } />;
	}

	return (
		<>
			<SearchListControl
				className="woocommerce-product-attributes"
				list={ currentList }
				isLoading={ isLoading }
				selected={ selected
					.map( ( { id } ) =>
						currentList.find(
							( currentListItem ) => currentListItem.id === id
						)
					)
					.filter( Boolean ) }
				onChange={ onChange }
				renderItem={ renderItem }
				messages={ messages }
				isCompact={ isCompact }
				isHierarchical
			/>
			{ !! onOperatorChange && (
				<div hidden={ selected.length < 2 }>
					<SelectControl
						className="woocommerce-product-attributes__operator"
						label={ __(
							'Display products matching',
							'woocommerce'
						) }
						help={ __(
							'Pick at least two attributes to use this setting.',
							'woocommerce'
						) }
						value={ operator }
						onChange={ onOperatorChange }
						options={ [
							{
								label: __(
									'Any selected attributes',
									'woocommerce'
								),
								value: 'any',
							},
							{
								label: __(
									'All selected attributes',
									'woocommerce'
								),
								value: 'all',
							},
						] }
					/>
				</div>
			) }
		</>
	);
};

ProductAttributeTermControl.propTypes = {
	/**
	 * Callback to update the selected product attributes.
	 */
	onChange: PropTypes.func.isRequired,
	/**
	 * Callback to update the category operator. If not passed in, setting is not used.
	 */
	onOperatorChange: PropTypes.func,
	/**
	 * Setting for whether products should match all or any selected categories.
	 */
	operator: PropTypes.oneOf( [ 'all', 'any' ] ),
	/**
	 * The list of currently selected attribute slug/ID pairs.
	 */
	selected: PropTypes.array.isRequired,
	// from withAttributes
	attributes: PropTypes.array,
	error: PropTypes.object,
	expandedAttribute: PropTypes.number,
	onExpandAttribute: PropTypes.func,
	isCompact: PropTypes.bool,
	isLoading: PropTypes.bool,
	termsAreLoading: PropTypes.bool,
	termsList: PropTypes.object,
};

ProductAttributeTermControl.defaultProps = {
	isCompact: false,
	operator: 'any',
};

export default withAttributes( withInstanceId( ProductAttributeTermControl ) );
woocommerce-blocks/assets/js/editor-components/product-attribute-term-control/style.scss000064400000002540151335517640026101 0ustar00.woocommerce-product-attributes__operator {
	.components-base-control__help {
		@include visually-hidden;
	}

	.components-base-control__label {
		margin-bottom: 0;
		margin-right: 0.5em;
	}
}

.woocommerce-search-list__item.woocommerce-product-attributes__item {
	&.is-searching,
	&.is-skip-level {
		.woocommerce-search-list__item-prefix::after {
			content: ":";
		}
	}

	&.is-not-active {
		&:hover,
		&:active,
		&:focus {
			background: $white;
		}
	}

	&.is-loading {
		justify-content: center;

		.components-spinner {
			margin-bottom: $gap-small;
		}
	}

	&.depth-0::after {
		margin-left: $gap-smaller;
		content: "";
		height: $gap-large;
		width: $gap-large;
		background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M7.41 15.41L12 10.83l4.59 4.58L18 14l-6-6-6 6z" fill="#{encode-color($gray-700)}" /></svg>');
		background-repeat: no-repeat;
		background-position: center right;
		background-size: contain;
	}

	&.depth-0.is-selected::after {
		background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M7.41 8.59L12 13.17l4.59-4.58L18 10l-6 6-6-6 1.41-1.41z" fill="#{encode-color($gray-700)}" /></svg>');
	}

	&[disabled].depth-0::after {
		margin-left: 0;
		width: auto;
		background: none;
	}
}
assets/js/editor-components/expandable-search-list-item/expandable-search-list-item.tsx000064400000002136151335517640031150 0ustar00woocommerce-blocks/**
 * External dependencies
 */
import { SearchListItem } from '@woocommerce/components';
import { Spinner } from '@wordpress/components';
import classNames from 'classnames';

interface SearchListItem {
	id: string;
}

interface ExpandableSearchListItemProps {
	className?: string;
	item: SearchListItem;
	isSelected: boolean;
	isLoading: boolean;
	onSelect: () => void;
	disabled: boolean;
}

const ExpandableSearchListItem = ( {
	className,
	item,
	isSelected,
	isLoading,
	onSelect,
	disabled,
	...rest
}: ExpandableSearchListItemProps ): JSX.Element => {
	return (
		<>
			<SearchListItem
				{ ...rest }
				key={ item.id }
				className={ className }
				isSelected={ isSelected }
				item={ item }
				onSelect={ onSelect }
				isSingle
				disabled={ disabled }
			/>
			{ isSelected && isLoading && (
				<div
					key="loading"
					className={ classNames(
						'woocommerce-search-list__item',
						'woocommerce-product-attributes__item',
						'depth-1',
						'is-loading',
						'is-not-active'
					) }
				>
					<Spinner />
				</div>
			) }
		</>
	);
};

export default ExpandableSearchListItem;
woocommerce-blocks/assets/js/editor-components/product-category-control/index.js000064400000011367151335517640024365 0ustar00/**
 * External dependencies
 */
import { __, _n, sprintf } from '@wordpress/i18n';
import PropTypes from 'prop-types';
import { SearchListControl, SearchListItem } from '@woocommerce/components';
import { SelectControl } from '@wordpress/components';
import { withCategories } from '@woocommerce/block-hocs';
import ErrorMessage from '@woocommerce/editor-components/error-placeholder/error-message.js';
import classNames from 'classnames';

/**
 * Internal dependencies
 */
import './style.scss';

const ProductCategoryControl = ( {
	categories,
	error,
	isLoading,
	onChange,
	onOperatorChange,
	operator,
	selected,
	isCompact,
	isSingle,
	showReviewCount,
} ) => {
	const renderItem = ( args ) => {
		const { item, search, depth = 0 } = args;

		const accessibleName = ! item.breadcrumbs.length
			? item.name
			: `${ item.breadcrumbs.join( ', ' ) }, ${ item.name }`;

		const listItemAriaLabel = showReviewCount
			? sprintf(
					/* translators: %1$s is the item name, %2$d is the count of reviews for the item. */
					_n(
						'%1$s, has %2$d review',
						'%1$s, has %2$d reviews',
						item.review_count,
						'woocommerce'
					),
					accessibleName,
					item.review_count
			  )
			: sprintf(
					/* translators: %1$s is the item name, %2$d is the count of products for the item. */
					_n(
						'%1$s, has %2$d product',
						'%1$s, has %2$d products',
						item.count,
						'woocommerce'
					),
					accessibleName,
					item.count
			  );

		const listItemCountLabel = showReviewCount
			? sprintf(
					/* translators: %d is the count of reviews. */
					_n(
						'%d review',
						'%d reviews',
						item.review_count,
						'woocommerce'
					),
					item.review_count
			  )
			: sprintf(
					/* translators: %d is the count of products. */
					_n(
						'%d product',
						'%d products',
						item.count,
						'woocommerce'
					),
					item.count
			  );
		return (
			<SearchListItem
				className={ classNames(
					'woocommerce-product-categories__item',
					'has-count',
					{
						'is-searching': search.length > 0,
						'is-skip-level': depth === 0 && item.parent !== 0,
					}
				) }
				{ ...args }
				countLabel={ listItemCountLabel }
				aria-label={ listItemAriaLabel }
			/>
		);
	};

	const messages = {
		clear: __(
			'Clear all product categories',
			'woocommerce'
		),
		list: __( 'Product Categories', 'woocommerce' ),
		noItems: __(
			"Your store doesn't have any product categories.",
			'woocommerce'
		),
		search: __(
			'Search for product categories',
			'woocommerce'
		),
		selected: ( n ) =>
			sprintf(
				/* translators: %d is the count of selected categories. */
				_n(
					'%d category selected',
					'%d categories selected',
					n,
					'woocommerce'
				),
				n
			),
		updated: __(
			'Category search results updated.',
			'woocommerce'
		),
	};

	if ( error ) {
		return <ErrorMessage error={ error } />;
	}

	return (
		<>
			<SearchListControl
				className="woocommerce-product-categories"
				list={ categories }
				isLoading={ isLoading }
				selected={ selected
					.map( ( id ) =>
						categories.find( ( category ) => category.id === id )
					)
					.filter( Boolean ) }
				onChange={ onChange }
				renderItem={ renderItem }
				messages={ messages }
				isCompact={ isCompact }
				isHierarchical
				isSingle={ isSingle }
			/>
			{ !! onOperatorChange && (
				<div hidden={ selected.length < 2 }>
					<SelectControl
						className="woocommerce-product-categories__operator"
						label={ __(
							'Display products matching',
							'woocommerce'
						) }
						help={ __(
							'Pick at least two categories to use this setting.',
							'woocommerce'
						) }
						value={ operator }
						onChange={ onOperatorChange }
						options={ [
							{
								label: __(
									'Any selected categories',
									'woocommerce'
								),
								value: 'any',
							},
							{
								label: __(
									'All selected categories',
									'woocommerce'
								),
								value: 'all',
							},
						] }
					/>
				</div>
			) }
		</>
	);
};

ProductCategoryControl.propTypes = {
	/**
	 * Callback to update the selected product categories.
	 */
	onChange: PropTypes.func.isRequired,
	/**
	 * Callback to update the category operator. If not passed in, setting is not used.
	 */
	onOperatorChange: PropTypes.func,
	/**
	 * Setting for whether products should match all or any selected categories.
	 */
	operator: PropTypes.oneOf( [ 'all', 'any' ] ),
	/**
	 * The list of currently selected category IDs.
	 */
	selected: PropTypes.array.isRequired,
	isCompact: PropTypes.bool,
	/**
	 * Allow only a single selection. Defaults to false.
	 */
	isSingle: PropTypes.bool,
};

ProductCategoryControl.defaultProps = {
	operator: 'any',
	isCompact: false,
	isSingle: false,
};

export default withCategories( ProductCategoryControl );
woocommerce-blocks/assets/js/editor-components/product-category-control/style.scss000064400000000301151335517640024737 0ustar00.woocommerce-product-categories__operator {
	.components-base-control__help {
		@include visually-hidden;
	}

	.components-base-control__label {
		margin-bottom: 0;
		margin-right: 0.5em;
	}
}
woocommerce-blocks/assets/js/editor-components/feedback-prompt/index.js000064400000003024151335517640022446 0ustar00/**
 * External dependencies
 */
import { __ } from '@wordpress/i18n';
import PropTypes from 'prop-types';
import { Icon, comment, external } from '@woocommerce/icons';

/**
 * Internal dependencies
 */
import './style.scss';

/**
 * Component to render a Feedback prompt in the sidebar.
 *
 * @param {Object} props Incoming props for the component.
 * @param {string} props.text
 * @param {string} props.url
 */
const FeedbackPrompt = ( {
	text,
	url = 'https://ideas.woocommerce.com/forums/133476-woocommerce?category_id=384565',
} ) => {
	return (
		<div className="wc-block-feedback-prompt">
			<Icon srcElement={ comment } />
			<h2 className="wc-block-feedback-prompt__title">
				{ __( 'Feedback?', 'woocommerce' ) }
			</h2>
			<p className="wc-block-feedback-prompt__text">{ text }</p>
			<a
				href={ url }
				className="wc-block-feedback-prompt__link"
				rel="noreferrer noopener"
				target="_blank"
			>
				{ __(
					'Give us your feedback.',
					'woocommerce'
				) }
				<Icon srcElement={ external } size={ 16 } />
			</a>
		</div>
	);
};

FeedbackPrompt.propTypes = {
	text: PropTypes.string,
	url: PropTypes.string,
};

export default FeedbackPrompt;

export const CartCheckoutFeedbackPrompt = () => (
	<FeedbackPrompt
		text={ __(
			'We are currently working on improving our cart and checkout blocks to provide merchants with the tools and customization options they need.',
			'woocommerce'
		) }
		url="https://github.com/woocommerce/woocommerce-gutenberg-products-block/issues/new?template=--cart-checkout-feedback.md"
	/>
);
woocommerce-blocks/assets/js/editor-components/feedback-prompt/style.scss000064400000000513151335517640023036 0ustar00.wc-block-feedback-prompt {
	background-color: #f7f7f7;
	border-top: 1px solid $gray-200;
	margin: 0 -16px 0;
	padding: $gap-large;
	text-align: center;

	.wc-block-feedback-prompt__title {
		margin: 0 0 $gap-small;
	}

	.wc-block-feedback-prompt__link {
		color: inherit;

		> .gridicon {
			vertical-align: text-bottom;
		}
	}
}
woocommerce-blocks/assets/js/extensions/google-analytics/index.ts000064400000015627151335517640021420 0ustar00/**
 * External dependencies
 */
import { __ } from '@wordpress/i18n';
import { addAction } from '@wordpress/hooks';
import type {
	ProductResponseItem,
	CartResponseItem,
	StoreCart,
} from '@woocommerce/types';

/**
 * Internal dependencies
 */
import { namespace, actionPrefix } from './constants';
import {
	getProductFieldObject,
	getProductImpressionObject,
	trackEvent,
	trackCheckoutStep,
	trackCheckoutOption,
} from './utils';

/**
 * Track customer progress through steps of the checkout. Triggers the event when the step changes:
 * 	1 - Contact information
 * 	2 - Shipping address
 * 	3 - Billing address
 * 	4 - Shipping options
 * 	5 - Payment options
 *
 * @summary Track checkout progress with begin_checkout and checkout_progress
 * @see https://developers.google.com/analytics/devguides/collection/gtagjs/enhanced-ecommerce#1_measure_checkout_steps
 */
addAction(
	`${ actionPrefix }-checkout-render-checkout-form`,
	namespace,
	trackCheckoutStep( 0 )
);
addAction(
	`${ actionPrefix }-checkout-set-email-address`,
	namespace,
	trackCheckoutStep( 1 )
);
addAction(
	`${ actionPrefix }-checkout-set-shipping-address`,
	namespace,
	trackCheckoutStep( 2 )
);
addAction(
	`${ actionPrefix }-checkout-set-billing-address`,
	namespace,
	trackCheckoutStep( 3 )
);
addAction(
	`${ actionPrefix }-checkout-set-phone-number`,
	namespace,
	( { step, ...rest }: { step: string; storeCart: StoreCart } ): void => {
		trackCheckoutStep( step === 'shipping' ? 2 : 3 )( rest );
	}
);

/**
 * Choose a shipping rate
 *
 * @summary Track the shipping rate being set using set_checkout_option
 * @see https://developers.google.com/analytics/devguides/collection/gtagjs/enhanced-ecommerce#2_measure_checkout_options
 */
addAction(
	`${ actionPrefix }-checkout-set-selected-shipping-rate`,
	namespace,
	( { shippingRateId }: { shippingRateId: string } ): void => {
		trackCheckoutOption( {
			step: 4,
			option: __( 'Shipping Method', 'woo-gutenberg-products-block' ),
			value: shippingRateId,
		} )();
	}
);

/**
 * Choose a payment method
 *
 * @summary Track the payment method being set using set_checkout_option
 * @see https://developers.google.com/analytics/devguides/collection/gtagjs/enhanced-ecommerce#2_measure_checkout_options
 */
addAction(
	`${ actionPrefix }-checkout-set-active-payment-method`,
	namespace,
	( { paymentMethodSlug }: { paymentMethodSlug: string } ): void => {
		trackCheckoutOption( {
			step: 5,
			option: __( 'Payment Method', 'woo-gutenberg-products-block' ),
			value: paymentMethodSlug,
		} )();
	}
);

/**
 * Add Payment Information
 *
 * This event signifies a user has submitted their payment information. Note, this is used to indicate checkout
 * submission, not `purchase` which is triggered on the thanks page.
 *
 * @summary Track the add_payment_info event
 * @see https://developers.google.com/gtagjs/reference/ga4-events#add_payment_info
 */
addAction( `${ actionPrefix }-checkout-submit`, namespace, (): void => {
	trackEvent( 'add_payment_info' );
} );

/**
 * Add to cart.
 *
 * This event signifies that an item was added to a cart for purchase.
 *
 * @summary Track the add_to_cart event
 * @see https://developers.google.com/gtagjs/reference/ga4-events#add_to_cart
 */
addAction(
	`${ actionPrefix }-cart-add-item`,
	namespace,
	( {
		product,
		quantity = 1,
	}: {
		product: ProductResponseItem;
		quantity: number;
	} ): void => {
		trackEvent( 'add_to_cart', {
			event_category: 'ecommerce',
			event_label: __( 'Add to Cart', 'woo-gutenberg-products-block' ),
			items: [ getProductFieldObject( product, quantity ) ],
		} );
	}
);

/**
 * Remove item from the cart
 *
 * @summary Track the remove_from_cart event
 * @see https://developers.google.com/gtagjs/reference/ga4-events#remove_from_cart
 */
addAction(
	`${ actionPrefix }-cart-remove-item`,
	namespace,
	( {
		product,
		quantity = 1,
	}: {
		product: CartResponseItem;
		quantity: number;
	} ): void => {
		trackEvent( 'remove_from_cart', {
			event_category: 'ecommerce',
			event_label: __(
				'Remove Cart Item',
				'woo-gutenberg-products-block'
			),
			items: [ getProductFieldObject( product, quantity ) ],
		} );
	}
);

/**
 * Change cart item quantities
 *
 * @summary Custom change_cart_quantity event.
 */
addAction(
	`${ actionPrefix }-cart-set-item-quantity`,
	namespace,
	( {
		product,
		quantity = 1,
	}: {
		product: CartResponseItem;
		quantity: number;
	} ): void => {
		trackEvent( 'change_cart_quantity', {
			event_category: 'ecommerce',
			event_label: __(
				'Change Cart Item Quantity',
				'woo-gutenberg-products-block'
			),
			items: [ getProductFieldObject( product, quantity ) ],
		} );
	}
);

/**
 * Product List View
 *
 * @summary Track the view_item_list event
 * @see https://developers.google.com/gtagjs/reference/ga4-events#view_item_list
 */
addAction(
	`${ actionPrefix }-product-list-render`,
	namespace,
	( {
		products,
		listName = __( 'Product List', 'woo-gutenberg-products-block' ),
	}: {
		products: Array< ProductResponseItem >;
		listName: string;
	} ): void => {
		if ( products.length === 0 ) {
			return;
		}
		trackEvent( 'view_item_list', {
			event_category: 'engagement',
			event_label: __(
				'Viewing products',
				'woo-gutenberg-products-block'
			),
			items: products.map( ( product, index ) => ( {
				...getProductImpressionObject( product, listName ),
				list_position: index + 1,
			} ) ),
		} );
	}
);

/**
 * Product View Link Clicked
 *
 * @summary Track the select_content event
 * @see https://developers.google.com/gtagjs/reference/ga4-events#select_content
 */
addAction(
	`${ actionPrefix }-product-view-link`,
	namespace,
	( {
		product,
		listName,
	}: {
		product: ProductResponseItem;
		listName: string;
	} ): void => {
		trackEvent( 'select_content', {
			content_type: 'product',
			items: [ getProductImpressionObject( product, listName ) ],
		} );
	}
);

/**
 * Product Search
 *
 * @summary Track the search event
 * @see https://developers.google.com/gtagjs/reference/ga4-events#search
 */
addAction(
	`${ actionPrefix }-product-search`,
	namespace,
	( { searchTerm }: { searchTerm: string } ): void => {
		trackEvent( 'search', {
			search_term: searchTerm,
		} );
	}
);

/**
 * Single Product View
 *
 * @summary Track the view_item event
 * @see https://developers.google.com/gtagjs/reference/ga4-events#view_item
 */
addAction(
	`${ actionPrefix }-product-render`,
	namespace,
	( {
		product,
		listName,
	}: {
		product: ProductResponseItem;
		listName: string;
	} ): void => {
		if ( product ) {
			trackEvent( 'view_item', {
				items: [ getProductImpressionObject( product, listName ) ],
			} );
		}
	}
);

/**
 * Track notices as Exception events.
 *
 * @summary Track the exception event
 * @see https://developers.google.com/analytics/devguides/collection/gtagjs/exceptions
 */
addAction(
	`${ actionPrefix }-store-notice-create`,
	namespace,
	( { status, content }: { status: string; content: string } ): void => {
		if ( status === 'error' ) {
			trackEvent( 'exception', {
				description: content,
				fatal: false,
			} );
		}
	}
);
woocommerce-blocks/assets/js/extensions/google-analytics/constants.ts000064400000000171151335517640022311 0ustar00export const namespace = 'woocommerce-google-analytics';
export const actionPrefix = 'experimental__woocommerce_blocks';
woocommerce-blocks/assets/js/extensions/google-analytics/utils.ts000064400000005534151335517640021445 0ustar00/**
 * External dependencies
 */
import type {
	ProductResponseItem,
	CartResponseItem,
	StoreCart,
} from '@woocommerce/types';

interface ImpressionItem extends Gtag.Item {
	list_name?: string;
}

/**
 * Formats data into the productFieldObject shape.
 *
 * @see https://developers.google.com/analytics/devguides/collection/gtagjs/enhanced-ecommerce#product-data
 */
export const getProductFieldObject = (
	product: ProductResponseItem | CartResponseItem,
	quantity: number | undefined
): Gtag.Item => {
	const productIdentifier = product.sku ? product.sku : '#' + product.id;
	const productCategory =
		'categories' in product && product.categories.length
			? product.categories[ 0 ].name
			: '';
	return {
		id: productIdentifier,
		name: product.name,
		quantity,
		category: productCategory,
		price: (
			parseInt( product.prices.price, 10 ) /
			10 ** product.prices.currency_minor_unit
		).toString(),
	};
};

/**
 * Formats data into the impressionFieldObject shape.
 *
 * @see https://developers.google.com/analytics/devguides/collection/gtagjs/enhanced-ecommerce#impression-data
 */
export const getProductImpressionObject = (
	product: ProductResponseItem,
	listName: string
): ImpressionItem => {
	const productIdentifier = product.sku ? product.sku : '#' + product.id;
	const productCategory = product.categories.length
		? product.categories[ 0 ].name
		: '';
	return {
		id: productIdentifier,
		name: product.name,
		list_name: listName,
		category: productCategory,
		price: (
			parseInt( product.prices.price, 10 ) /
			10 ** product.prices.currency_minor_unit
		).toString(),
	};
};

/**
 * Track an event using the global gtag function.
 */
export const trackEvent = (
	eventName: Gtag.EventNames | string,
	eventParams?: Gtag.ControlParams | Gtag.EventParams | Gtag.CustomParams
): void => {
	if ( typeof gtag !== 'function' ) {
		throw new Error( 'Function gtag not implemented.' );
	}
	// eslint-disable-next-line no-console
	console.log( `Tracking event ${ eventName }` );
	window.gtag( 'event', eventName, eventParams );
};

let currentStep = -1;

export const trackCheckoutStep = ( step: number ) => ( {
	storeCart,
}: {
	storeCart: StoreCart;
} ): void => {
	if ( currentStep === step ) {
		return;
	}
	trackEvent( step === 0 ? 'begin_checkout' : 'checkout_progress', {
		items: storeCart.cartItems.map( getProductFieldObject ),
		coupon: storeCart.cartCoupons[ 0 ]?.code || '',
		currency: storeCart.cartTotals.currency_code,
		value: (
			parseInt( storeCart.cartTotals.total_price, 10 ) /
			10 ** storeCart.cartTotals.currency_minor_unit
		).toString(),
		checkout_step: step,
	} );
	currentStep = step;
};

export const trackCheckoutOption = ( {
	step,
	option,
	value,
}: {
	step: number;
	option: string;
	value: string;
} ) => (): void => {
	trackEvent( 'set_checkout_option', {
		checkout_step: step,
		checkout_option: option,
		value,
	} );
	currentStep = step;
};
woocommerce-blocks/assets/js/base/utils/address.ts000064400000005143151335517640016340 0ustar00/**
 * External dependencies
 */
import { defaultAddressFields } from '@woocommerce/settings';
import prepareAddressFields from '@woocommerce/base-components/cart-checkout/address-form/prepare-address-fields';
import { isEmail } from '@wordpress/url';
import type {
	CartResponseBillingAddress,
	CartResponseShippingAddress,
} from '@woocommerce/types';

/**
 * pluckAddress takes a full address object and returns relevant fields for calculating
 * shipping, so we can track when one of them change to update rates.
 *
 * @param {Object} address          An object containing all address information
 * @param {string} address.country  The country.
 * @param {string} address.state    The state.
 * @param {string} address.city     The city.
 * @param {string} address.postcode The postal code.
 *
 * @return {Object} pluckedAddress  An object containing shipping address that are needed to fetch an address.
 */
export const pluckAddress = ( {
	country = '',
	state = '',
	city = '',
	postcode = '',
}: CartResponseBillingAddress | CartResponseShippingAddress ): {
	country: string;
	state: string;
	city: string;
	postcode: string;
} => ( {
	country: country.trim(),
	state: state.trim(),
	city: city.trim(),
	postcode: postcode ? postcode.replace( ' ', '' ).toUpperCase() : '',
} );

/**
 * pluckEmail takes a full address object and returns only the email address, if set and valid. Otherwise returns an empty string.
 *
 * @param {Object} address       An object containing all address information
 * @param {string} address.email The email address.
 * @return {string} The email address.
 */
export const pluckEmail = ( {
	email = '',
}: CartResponseBillingAddress ): string =>
	isEmail( email ) ? email.trim() : '';

/**
 * Type-guard.
 */
const isValidAddressKey = (
	key: string,
	address: CartResponseBillingAddress | CartResponseShippingAddress
): key is keyof typeof address => {
	return key in address;
};

/**
 * Sets fields to an empty string in an address if they are hidden by the settings in countryLocale.
 *
 * @param {Object} address The address to empty fields from.
 * @return {Object} The address with hidden fields values removed.
 */
export const emptyHiddenAddressFields = <
	T extends CartResponseBillingAddress | CartResponseShippingAddress
>(
	address: T
): T => {
	const fields = Object.keys( defaultAddressFields );
	const addressFields = prepareAddressFields( fields, {}, address.country );
	const newAddress = Object.assign( {}, address ) as T;

	addressFields.forEach( ( { key = '', hidden = false } ) => {
		if ( hidden && isValidAddressKey( key, address ) ) {
			newAddress[ key ] = '';
		}
	} );

	return newAddress;
};
woocommerce-blocks/assets/js/base/utils/lazy-load-script.ts000064400000006676151335517640020125 0ustar00/**
 * External dependencies
 */
import { isString } from '@woocommerce/types';

interface lazyLoadScriptParams {
	handle: string;
	src: string;
	version?: string;
	after?: string;
	before?: string;
	translations?: string;
}

interface appendScriptAttributesParam {
	id: string;
	innerHTML?: string;
	onerror?: OnErrorEventHandlerNonNull;
	onload?: () => void;
	src?: string;
}

/**
 * In WP, registered scripts are loaded into the page with an element like this:
 * `<script src='...' id='[SCRIPT_ID]'></script>`
 * This function checks whether an element matching that selector exists.
 * Useful to know if a script has already been appended to the page.
 */
const isScriptTagInDOM = ( scriptId: string ): boolean => {
	const scriptElements = document.querySelectorAll( `script#${ scriptId }` );
	return scriptElements.length > 0;
};

/**
 * Appends a script element to the document body if a script with the same id
 * doesn't exist.
 */
const appendScript = ( attributes: appendScriptAttributesParam ): void => {
	// Abort if id is not valid or a script with the same id exists.
	if ( ! isString( attributes.id ) || isScriptTagInDOM( attributes.id ) ) {
		return;
	}
	const scriptElement = document.createElement( 'script' );
	for ( const attr in attributes ) {
		// We could technically be iterating over inherited members here, so
		// if this is the case we should skip it.
		if ( ! attributes.hasOwnProperty( attr ) ) {
			continue;
		}
		const key = attr as keyof appendScriptAttributesParam;

		// Skip the keys that aren't strings, because TS can't be sure which
		// key in the scriptElement object we're assigning to.
		if ( key === 'onload' || key === 'onerror' ) {
			continue;
		}

		// This assignment stops TS complaining about the value maybe being
		// undefined following the isString check below.
		const value = attributes[ key ];
		if ( isString( value ) ) {
			scriptElement[ key ] = value;
		}
	}

	// Now that we've assigned all the strings, we can explicitly assign to the
	// function keys.
	if ( typeof attributes.onload === 'function' ) {
		scriptElement.onload = attributes.onload;
	}
	if ( typeof attributes.onerror === 'function' ) {
		scriptElement.onerror = attributes.onerror;
	}
	document.body.appendChild( scriptElement );
};

/**
 * Appends a `<script>` tag to the document body based on the src and handle
 * parameters. In addition, it appends additional script tags to load the code
 * needed for translations and any before and after inline scripts. See these
 * documentation pages for more information:
 *
 * https://developer.wordpress.org/reference/functions/wp_set_script_translations/
 * https://developer.wordpress.org/reference/functions/wp_add_inline_script/
 */
const lazyLoadScript = ( {
	handle,
	src,
	version,
	after,
	before,
	translations,
}: lazyLoadScriptParams ): Promise< void > => {
	return new Promise( ( resolve, reject ) => {
		if ( isScriptTagInDOM( `${ handle }-js` ) ) {
			resolve();
		}

		if ( translations ) {
			appendScript( {
				id: `${ handle }-js-translations`,
				innerHTML: translations,
			} );
		}
		if ( before ) {
			appendScript( {
				id: `${ handle }-js-before`,
				innerHTML: before,
			} );
		}

		const onload = () => {
			if ( after ) {
				appendScript( {
					id: `${ handle }-js-after`,
					innerHTML: after,
				} );
			}
			resolve();
		};

		appendScript( {
			id: `${ handle }-js`,
			onerror: reject,
			onload,
			src: version ? `${ src }?ver=${ version }` : src,
		} );
	} );
};

export default lazyLoadScript;
woocommerce-blocks/assets/js/base/utils/from-entries-polyfill.ts000064400000000644151335517640021156 0ustar00/**
 * A polyfill for Object.fromEntries function.
 *
 * @param {Array<[string, unknown]>} array Array to be turned back to object
 * @return {Record< string, unknown >} the newly created object
 */
export const fromEntriesPolyfill = (
	array: Array< [ string, unknown ] >
): Record< string, unknown > =>
	array.reduce< Record< string, unknown > >( ( obj, [ key, val ] ) => {
		obj[ key ] = val;
		return obj;
	}, {} );
woocommerce-blocks/assets/js/base/utils/shipping-rates.js000064400000001066151335517640017636 0ustar00/**
 * Get the number of packages in a shippingRates array.
 *
 * @param {Array} shippingRates Shipping rates and packages array.
 */
export const getShippingRatesPackageCount = ( shippingRates ) => {
	return shippingRates.length;
};

/**
 * Get the number of rates in a shippingRates array.
 *
 * @param {Array} shippingRates Shipping rates and packages array.
 */
export const getShippingRatesRateCount = ( shippingRates ) => {
	return shippingRates.reduce( function ( count, shippingPackage ) {
		return count + shippingPackage.shipping_rates.length;
	}, 0 );
};
woocommerce-blocks/assets/js/base/utils/index.js000064400000000504151335517640016004 0ustar00export * from './errors';
export * from './address';
export * from './shipping-rates';
export * from './legacy-events';
export * from './render-frontend';
export * from './get-valid-block-attributes';
export * from './product-data';
export * from './derive-selected-shipping-rates';
export * from './from-entries-polyfill';
woocommerce-blocks/assets/js/base/utils/get-valid-block-attributes.js000064400000002066151335517640022032 0ustar00/**
 * Given some block attributes, gets attributes from the dataset or uses defaults.
 *
 * @param {Object} blockAttributes Object containing block attributes.
 * @param {Array} rawAttributes Dataset from DOM.
 * @return {Array} Array of parsed attributes.
 */
export const getValidBlockAttributes = ( blockAttributes, rawAttributes ) => {
	const attributes = [];

	Object.keys( blockAttributes ).forEach( ( key ) => {
		if ( typeof rawAttributes[ key ] !== 'undefined' ) {
			switch ( blockAttributes[ key ].type ) {
				case 'boolean':
					attributes[ key ] =
						rawAttributes[ key ] !== 'false' &&
						rawAttributes[ key ] !== false;
					break;
				case 'number':
					attributes[ key ] = parseInt( rawAttributes[ key ], 10 );
					break;
				case 'array':
				case 'object':
					attributes[ key ] = JSON.parse( rawAttributes[ key ] );
					break;
				default:
					attributes[ key ] = rawAttributes[ key ];
					break;
			}
		} else {
			attributes[ key ] = blockAttributes[ key ].default;
		}
	} );

	return attributes;
};

export default getValidBlockAttributes;
woocommerce-blocks/assets/js/base/utils/errors.js000064400000003110151335517640016205 0ustar00/**
 * External dependencies
 */
import { __ } from '@wordpress/i18n';

/**
 * Given a JS error or a fetch response error, parse and format it so it can be displayed to the user.
 *
 * @param  {Object}   error           Error object.
 * @param  {Function} [error.json]    If a json method is specified, it will try parsing the error first.
 * @param  {string}   [error.message] If a message is specified, it will be shown to the user.
 * @param  {string}   [error.type]    The context in which the error was triggered.
 * @return {Promise<{message:string;type:string;}>}   Error object containing a message and type.
 */
export const formatError = async ( error ) => {
	if ( typeof error.json === 'function' ) {
		try {
			const parsedError = await error.json();
			return {
				message: parsedError.message,
				type: parsedError.type || 'api',
			};
		} catch ( e ) {
			return {
				message: e.message,
				type: 'general',
			};
		}
	}

	return {
		message: error.message,
		type: error.type || 'general',
	};
};

/**
 * Given an API response object, formats the error message into something more human readable.
 *
 * @param  {Object}   response           Response object.
 * @return {string}   Error message.
 */
export const formatStoreApiErrorMessage = ( response ) => {
	if ( response.data && response.code === 'rest_invalid_param' ) {
		const invalidParams = Object.values( response.data.params );
		if ( invalidParams[ 0 ] ) {
			return invalidParams[ 0 ];
		}
	}

	return (
		response?.message ||
		__(
			'Something went wrong. Please contact us to get assistance.',
			'woocommerce'
		)
	);
};
woocommerce-blocks/assets/js/base/utils/render-frontend.js000064400000015273151335517640020002 0ustar00/**
 * External dependencies
 */
import { render, Suspense } from '@wordpress/element';
import BlockErrorBoundary from '@woocommerce/base-components/block-error-boundary';

// Some blocks take care of rendering their inner blocks automatically. For
// example, the empty cart. In those cases, we don't want to trigger the render
// function of inner components on load. Instead, the wrapper block can trigger
// the event `wc-blocks_render_blocks_frontend` to render its inner blocks.
const selectorsToSkipOnLoad = [ '.wp-block-woocommerce-cart' ];

// Given an element and a list of wrappers, check if the element is inside at
// least one of the wrappers.
const isElementInsideWrappers = ( el, wrappers ) => {
	return Array.prototype.some.call(
		wrappers,
		( wrapper ) => wrapper.contains( el ) && ! wrapper.isSameNode( el )
	);
};

/**
 * Renders a block component in each `containers` node.
 *
 * @param {Object}    props                         Render props.
 * @param {Function}  props.Block                   React component to use as a
 *                                                  replacement.
 * @param {NodeList}  props.containers              Containers to replace with
 *                                                  the Block component.
 * @param {Function}  [props.getProps]              Function to generate the
 *                                                  props object for the block.
 * @param {Function}  [props.getErrorBoundaryProps] Function to generate the
 *                                                  props object for the error
 *                                                  boundary.
 */
const renderBlockInContainers = ( {
	Block,
	containers,
	getProps = () => ( {} ),
	getErrorBoundaryProps = () => ( {} ),
} ) => {
	if ( containers.length === 0 ) {
		return;
	}

	// Use Array.forEach for IE11 compatibility.
	Array.prototype.forEach.call( containers, ( el, i ) => {
		const props = getProps( el, i );
		const errorBoundaryProps = getErrorBoundaryProps( el, i );
		const attributes = {
			...el.dataset,
			...( props.attributes || {} ),
		};
		el.classList.remove( 'is-loading' );

		render(
			<BlockErrorBoundary { ...errorBoundaryProps }>
				<Suspense fallback={ <div className="wc-block-placeholder" /> }>
					<Block { ...props } attributes={ attributes } />
				</Suspense>
			</BlockErrorBoundary>,
			el
		);
	} );
};

/**
 * Renders the block frontend in the elements matched by the selector which are
 * outside the wrapper elements.
 *
 * @param {Object}    props                         Render props.
 * @param {Function}  props.Block                   React component to use as a
 *                                                  replacement.
 * @param {string}    props.selector                CSS selector to match the
 *                                                  elements to replace.
 * @param {Function}  [props.getProps]              Function to generate the
 *                                                  props object for the block.
 * @param {Function}  [props.getErrorBoundaryProps] Function to generate the
 *                                                  props object for the error
 *                                                  boundary.
 * @param {NodeList}  props.wrappers                All elements matched by the
 *                                                  selector which are inside
 *                                                  the wrapper will be ignored.
 */
const renderBlockOutsideWrappers = ( {
	Block,
	getProps,
	getErrorBoundaryProps,
	selector,
	wrappers,
} ) => {
	const containers = document.body.querySelectorAll( selector );
	// Filter out blocks inside the wrappers.
	if ( wrappers.length > 0 ) {
		Array.prototype.filter.call( containers, ( el ) => {
			return ! isElementInsideWrappers( el, wrappers );
		} );
	}
	renderBlockInContainers( {
		Block,
		containers,
		getProps,
		getErrorBoundaryProps,
	} );
};

/**
 * Renders the block frontend in the elements matched by the selector inside the
 * wrapper element.
 *
 * @param {Object}    props                         Render props.
 * @param {Function}  props.Block                   React component to use as a
 *                                                  replacement.
 * @param {string}    props.selector                CSS selector to match the
 *                                                  elements to replace.
 * @param {Function}  [props.getProps]              Function to generate the
 *                                                  props object for the block.
 * @param {Function}  [props.getErrorBoundaryProps] Function to generate the
 *                                                  props object for the error
 *                                                  boundary.
 * @param {Element}   props.wrapper                 Wrapper element to query the
 *                                                  selector inside.
 */
const renderBlockInsideWrapper = ( {
	Block,
	getProps,
	getErrorBoundaryProps,
	selector,
	wrapper,
} ) => {
	const containers = wrapper.querySelectorAll( selector );
	renderBlockInContainers( {
		Block,
		containers,
		getProps,
		getErrorBoundaryProps,
	} );
};

/**
 * Renders the block frontend on page load. If the block is contained inside a
 * wrapper element that should be excluded from initial load, it adds the
 * appropriate event listeners to render the block when the
 * `blocks_render_blocks_frontend` event is triggered.
 *
 * @param {Object}    props                         Render props.
 * @param {Function}  props.Block                   React component to use as a
 *                                                  replacement.
 * @param {string}    props.selector                CSS selector to match the
 *                                                  elements to replace.
 * @param {Function}  [props.getProps]              Function to generate the
 *                                                  props object for the block.
 * @param {Function}  [props.getErrorBoundaryProps] Function to generate the
 *                                                  props object for the error
 *                                                  boundary.
 */
export const renderFrontend = ( props ) => {
	const wrappersToSkipOnLoad = document.body.querySelectorAll(
		selectorsToSkipOnLoad.join( ',' )
	);
	renderBlockOutsideWrappers( {
		...props,
		wrappers: wrappersToSkipOnLoad,
	} );
	// For each wrapper, add an event listener to render the inner blocks when
	// `wc-blocks_render_blocks_frontend` event is triggered.
	Array.prototype.forEach.call( wrappersToSkipOnLoad, ( wrapper ) => {
		wrapper.addEventListener( 'wc-blocks_render_blocks_frontend', () => {
			renderBlockInsideWrapper( { ...props, wrapper } );
		} );
	} );
};

export default renderFrontend;
woocommerce-blocks/assets/js/base/utils/product-data.js000064400000002060151335517640017263 0ustar00/**
 * Check a product object to see if it can be purchased.
 *
 * @param {Object} product Product object.
 * @return {boolean} True if purchasable.
 */
export const productIsPurchasable = ( product ) => {
	return product.is_purchasable || false;
};

/**
 * Check if the product is supported by the blocks add to cart form.
 *
 * @param {Object} product Product object.
 * @return {boolean} True if supported.
 */
export const productSupportsAddToCartForm = ( product ) => {
	/**
	 * @todo Define supported product types for add to cart form.
	 *
	 * When introducing the form-element registration system, include a method of defining if a
	 * product type has support.
	 *
	 * If, as an example, we went with an inner block system for the add to cart form, we could allow
	 * a type to be registered along with it's default Block template. Registered types would then be
	 * picked up here, as well as the core types which would be defined elsewhere.
	 */
	const supportedTypes = [ 'simple', 'variable' ];

	return supportedTypes.includes( product.type || 'simple' );
};
woocommerce-blocks/assets/js/base/utils/legacy-events.ts000064400000005250151335517640017460 0ustar00/**
 * External dependencies
 */
import type { AddToCartEventDetail } from '@woocommerce/type-defs/events';

const CustomEvent = window.CustomEvent || null;

interface DispatchedEventProperties {
	// Whether the event bubbles.
	bubbles?: boolean;
	// Whether the event is cancelable.
	cancelable?: boolean;
	// See https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent/detail
	detail?: unknown;
	// Element that dispatches the event. By default, the body.
	element?: Element | null;
}

/**
 * Wrapper function to dispatch an event.
 */
export const dispatchEvent = (
	name: string,
	{
		bubbles = false,
		cancelable = false,
		element,
		detail = {},
	}: DispatchedEventProperties
): void => {
	if ( ! CustomEvent ) {
		return;
	}
	if ( ! element ) {
		element = document.body;
	}
	const event = new CustomEvent( name, {
		bubbles,
		cancelable,
		detail,
	} );
	element.dispatchEvent( event );
};

let fragmentRequestTimeoutId: ReturnType< typeof setTimeout >;

// This is a hack to trigger cart updates till we migrate to block based cart
// that relies on the store, see
// https://github.com/woocommerce/woocommerce-gutenberg-products-block/issues/1247
export const triggerFragmentRefresh = (): void => {
	if ( fragmentRequestTimeoutId ) {
		clearTimeout( fragmentRequestTimeoutId );
	}
	fragmentRequestTimeoutId = setTimeout( () => {
		dispatchEvent( 'wc_fragment_refresh', {
			bubbles: true,
			cancelable: true,
		} );
	}, 50 );
};

export const triggerAddingToCartEvent = (): void => {
	dispatchEvent( 'wc-blocks_adding_to_cart', {
		bubbles: true,
		cancelable: true,
	} );
};

export const triggerAddedToCartEvent = ( {
	preserveCartData = false,
}: AddToCartEventDetail ): void => {
	dispatchEvent( 'wc-blocks_added_to_cart', {
		bubbles: true,
		cancelable: true,
		detail: { preserveCartData },
	} );
};

/**
 * Function that listens to a jQuery event and dispatches a native JS event.
 * Useful to convert WC Core events into events that can be read by blocks.
 *
 * Returns a function to remove the jQuery event handler. Ideally it should be
 * used when the component is unmounted.
 */
export const translateJQueryEventToNative = (
	// Name of the jQuery event to listen to.
	jQueryEventName: string,
	// Name of the native event to dispatch.
	nativeEventName: string,
	// Whether the event bubbles.
	bubbles = false,
	// Whether the event is cancelable.
	cancelable = false
): ( () => void ) => {
	if ( typeof jQuery !== 'function' ) {
		return () => void null;
	}

	const eventDispatcher = () => {
		dispatchEvent( nativeEventName, { bubbles, cancelable } );
	};

	jQuery( document ).on( jQueryEventName, eventDispatcher );
	return () => jQuery( document ).off( jQueryEventName, eventDispatcher );
};
woocommerce-blocks/assets/js/base/utils/preload-script.ts000064400000001365151335517640017645 0ustar00interface preloadScriptParams {
	handle: string;
	src: string;
	version?: string;
}

/**
 * Appends a `<link>` tag to the document head to preload a script based on the
 * src and handle parameters.
 */
const preloadScript = ( {
	handle,
	src,
	version,
}: preloadScriptParams ): void => {
	const handleScriptElements = document.querySelectorAll(
		`#${ handle }-js, #${ handle }-js-prefetch`
	);

	if ( handleScriptElements.length === 0 ) {
		const prefetchLink = document.createElement( 'link' );
		prefetchLink.href = version ? `${ src }?ver=${ version }` : src;
		prefetchLink.rel = 'preload';
		prefetchLink.as = 'script';
		prefetchLink.id = `${ handle }-js-prefetch`;
		document.head.appendChild( prefetchLink );
	}
};

export default preloadScript;
woocommerce-blocks/assets/js/base/utils/test/address.ts000064400000001246151335517640017317 0ustar00/**
 * External dependencies
 */
import { emptyHiddenAddressFields } from '@woocommerce/base-utils';

describe( 'emptyHiddenAddressFields', () => {
	it( "Removes state from an address where the country doesn't use states", () => {
		const address = {
			first_name: 'Jonny',
			last_name: 'Awesome',
			company: 'WordPress',
			address_1: '123 Address Street',
			address_2: 'Address 2',
			city: 'Vienna',
			postcode: '1120',
			country: 'AT',
			state: 'CA', // This should be removed.
			email: 'jonny.awesome@email.com',
			phone: '',
		};
		const filteredAddress = emptyHiddenAddressFields( address );
		expect( filteredAddress ).toHaveProperty( 'state', '' );
	} );
} );
woocommerce-blocks/assets/js/base/utils/test/errors.js000064400000001652151335517640017175 0ustar00/**
 * Internal dependencies
 */
import { formatError } from '../errors';

describe( 'formatError', () => {
	test( 'should format general errors', async () => {
		const error = await formatError( {
			message: 'Lorem Ipsum',
		} );
		const expectedError = {
			message: 'Lorem Ipsum',
			type: 'general',
		};

		expect( error ).toEqual( expectedError );
	} );

	test( 'should format API errors', async () => {
		const error = await formatError( {
			json: () => Promise.resolve( { message: 'Lorem Ipsum' } ),
		} );
		const expectedError = {
			message: 'Lorem Ipsum',
			type: 'api',
		};

		expect( error ).toEqual( expectedError );
	} );

	test( 'should format JSON parse errors', async () => {
		const error = await formatError( {
			json: () => Promise.reject( { message: 'Lorem Ipsum' } ),
		} );
		const expectedError = {
			message: 'Lorem Ipsum',
			type: 'general',
		};

		expect( error ).toEqual( expectedError );
	} );
} );
woocommerce-blocks/assets/js/base/utils/derive-selected-shipping-rates.js000064400000001153151335517640022675 0ustar00/**
 * Internal dependencies
 */
import { fromEntriesPolyfill } from './from-entries-polyfill';

/**
 * Get an array of selected shipping rates keyed by Package ID.
 *
 * @param {Array} shippingRates Array of shipping rates.
 * @return {Object} Object containing the package IDs and selected rates in the format: { [packageId:string]: rateId:string }
 */
export const deriveSelectedShippingRates = ( shippingRates ) =>
	fromEntriesPolyfill(
		shippingRates.map(
			( { package_id: packageId, shipping_rates: packageRates } ) => [
				packageId,
				packageRates.find( ( rate ) => rate.selected )?.rate_id,
			]
		)
	);
woocommerce-blocks/assets/js/base/hooks/use-container-queries.ts000064400000002445151335517640021127 0ustar00/**
 * External dependencies
 */
import { useResizeObserver } from '@wordpress/compose';

/**
 * Returns a resizeListener element and a class name based on its width.
 * Class names are based on the smaller of the breakpoints:
 * https://github.com/WordPress/gutenberg/tree/master/packages/viewport#usage
 * Values are also based on those breakpoints minus ~80px which is approximately
 * the left + right margin in Storefront with a font-size of 16px.
 * _Note: `useContainerQueries` will return an empty class name `` until after
 * first render_
 *
 * @return {Array} An array of {Element} `resizeListener` and {string} `className`.
 *
 * @example
 *
 * ```js
 * const App = () => {
 * 	const [ resizeListener, containerClassName ] = useContainerQueries();
 *
 * 	return (
 * 		<div className={ containerClassName }>
 * 			{ resizeListener }
 * 			Your content here
 * 		</div>
 * 	);
 * };
 * ```
 */
export const useContainerQueries = (): [ React.ReactElement, string ] => {
	const [ resizeListener, { width } ] = useResizeObserver();

	let className = '';
	if ( width > 700 ) {
		className = 'is-large';
	} else if ( width > 520 ) {
		className = 'is-medium';
	} else if ( width > 400 ) {
		className = 'is-small';
	} else if ( width ) {
		className = 'is-mobile';
	}

	return [ resizeListener, className ];
};
woocommerce-blocks/assets/js/base/hooks/use-position-relative-to-viewport.js000064400000004226151335517640023431 0ustar00/**
 * External dependencies
 */
import { useRef, useLayoutEffect, useState } from '@wordpress/element';

/** @typedef {import('react')} React */

/** @type {React.CSSProperties} */
const style = {
	bottom: 0,
	left: 0,
	opacity: 0,
	pointerEvents: 'none',
	position: 'absolute',
	right: 0,
	top: 0,
	zIndex: -1,
};

/**
 * Returns an element and a string (`above`, `visible` or `below`) based on the
 * element position relative to the viewport.
 * _Note: `usePositionRelativeToViewport` will return an empty position (``)
 * until after first render_
 *
 * @return {Array} An array of {Element} `referenceElement` and {string} `positionRelativeToViewport`.
 *
 * @example
 *
 * ```js
 * const App = () => {
 * 	const [ referenceElement, positionRelativeToViewport ] = useContainerQueries();
 *
 * 	return (
 * 		<>
 * 			{ referenceElement }
 * 			{ positionRelativeToViewport === 'below' && <p>Reference element is below the viewport.</p> }
 * 			{ positionRelativeToViewport === 'visible' && <p>Reference element is visible in the viewport.</p> }
 * 			{ positionRelativeToViewport === 'above' && <p>Reference element is above the viewport.</p> }
 * 		</>
 * 	);
 * };
 * ```
 */
export const usePositionRelativeToViewport = () => {
	const [
		positionRelativeToViewport,
		setPositionRelativeToViewport,
	] = useState( '' );
	const referenceElementRef = useRef( null );
	const intersectionObserver = useRef(
		new IntersectionObserver(
			( entries ) => {
				if ( entries[ 0 ].isIntersecting ) {
					setPositionRelativeToViewport( 'visible' );
				} else {
					setPositionRelativeToViewport(
						entries[ 0 ].boundingClientRect.top > 0
							? 'below'
							: 'above'
					);
				}
			},
			{ threshold: 1.0 }
		)
	);

	useLayoutEffect( () => {
		const referenceElementNode = referenceElementRef.current;
		const observer = intersectionObserver.current;

		if ( referenceElementNode ) {
			observer.observe( referenceElementNode );
		}

		return () => {
			observer.unobserve( referenceElementNode );
		};
	}, [] );

	const referenceElement = (
		<div aria-hidden={ true } ref={ referenceElementRef } style={ style } />
	);

	return [ referenceElement, positionRelativeToViewport ];
};
woocommerce-blocks/assets/js/base/hooks/use-throw-error.ts000064400000000775151335517640017770 0ustar00/**
 * External dependencies
 */
import { useState, useCallback } from '@wordpress/element';

/**
 * Helper method for throwing an error in a React Hook.
 *
 * @see https://github.com/facebook/react/issues/14981
 *
 * @return {function(Object)} A function receiving the error that will be thrown.
 */
export const useThrowError = (): ( ( error: Error ) => void ) => {
	const [ , setState ] = useState();
	return useCallback( ( error: Error ): void => {
		setState( () => {
			throw error;
		} );
	}, [] );
};
woocommerce-blocks/assets/js/base/hooks/use-shallow-equal.ts000064400000001404151335517640020242 0ustar00/**
 * External dependencies
 */
import { useRef } from '@wordpress/element';
import isShallowEqual from '@wordpress/is-shallow-equal';

/**
 * A custom hook that compares the provided value across renders and returns the
 * previous instance if shallow equality with previous instance exists.
 *
 * This is particularly useful when non-primitive types are used as
 * dependencies for react hooks.
 *
 * @param {*} value Value to keep the same if satisfies shallow equality.
 *
 * @return {*} The previous cached instance of the value if the current has  shallow equality with it.
 */
export function useShallowEqual< T >( value: T ): T {
	const ref = useRef< T >( value );
	if ( ! isShallowEqual( value, ref.current ) ) {
		ref.current = value;
	}
	return ref.current;
}
woocommerce-blocks/assets/js/base/hooks/test/use-position-relative-to-viewport.js000064400000004030151335517640024401 0ustar00/**
 * External dependencies
 */
import { render, screen, act } from '@testing-library/react';

/**
 * Internal dependencies
 */
import { usePositionRelativeToViewport } from '../use-position-relative-to-viewport';

describe( 'usePositionRelativeToViewport', () => {
	function setup() {
		const TestComponent = () => {
			const [
				referenceElement,
				positionRelativeToViewport,
			] = usePositionRelativeToViewport();

			return (
				<>
					{ referenceElement }
					{ positionRelativeToViewport === 'below' && (
						<p data-testid="below"></p>
					) }
					{ positionRelativeToViewport === 'visible' && (
						<p data-testid="visible"></p>
					) }
					{ positionRelativeToViewport === 'above' && (
						<p data-testid="above"></p>
					) }
				</>
			);
		};

		return render( <TestComponent /> );
	}

	it( "calls IntersectionObserver's `observe` and `unobserve` events", async () => {
		const observe = jest.fn();
		const unobserve = jest.fn();

		// @ts-ignore
		IntersectionObserver = jest.fn( () => ( {
			observe,
			unobserve,
		} ) );

		const { unmount } = setup();

		expect( observe ).toHaveBeenCalled();
		unmount();
		expect( unobserve ).toHaveBeenCalled();
	} );

	it.each`
		position       | isIntersecting | top
		${ 'visible' } | ${ true }      | ${ 0 }
		${ 'below' }   | ${ false }     | ${ 10 }
		${ 'above' }   | ${ false }     | ${ 0 }
		${ 'above' }   | ${ false }     | ${ -10 }
	`(
		"position relative to viewport is '$position' with isIntersecting=$isIntersecting and top=$top",
		( { position, isIntersecting, top } ) => {
			let intersectionObserverCallback = ( entries ) => entries;

			// @ts-ignore
			IntersectionObserver = jest.fn( ( callback ) => {
				// @ts-ignore
				intersectionObserverCallback = callback;

				return {
					observe: () => void null,
					unobserve: () => void null,
				};
			} );

			setup();

			act( () => {
				intersectionObserverCallback( [
					{ isIntersecting, boundingClientRect: { top } },
				] );
			} );

			expect( screen.getAllByTestId( position ) ).toHaveLength( 1 );
		}
	);
} );
woocommerce-blocks/assets/js/base/hooks/test/use-previous.js000064400000005006151335517640020307 0ustar00/**
 * External dependencies
 */
import TestRenderer, { act } from 'react-test-renderer';

/**
 * Internal dependencies
 */
import { usePrevious } from '../use-previous';

describe( 'usePrevious', () => {
	const TestComponent = ( { testValue, validation } ) => {
		const previousValue = usePrevious( testValue, validation );
		return <div testValue={ testValue } previousValue={ previousValue } />;
	};

	let renderer;
	beforeEach( () => ( renderer = null ) );

	it( 'should be undefined at first pass', () => {
		act( () => {
			renderer = TestRenderer.create( <TestComponent testValue={ 1 } /> );
		} );
		const testValue = renderer.root.findByType( 'div' ).props.testValue;
		const testPreviousValue = renderer.root.findByType( 'div' ).props
			.previousValue;

		expect( testValue ).toBe( 1 );
		expect( testPreviousValue ).toBe( undefined );
	} );

	it( 'test new and previous value', () => {
		let testValue;
		let testPreviousValue;
		act( () => {
			renderer = TestRenderer.create( <TestComponent testValue={ 1 } /> );
		} );

		act( () => {
			renderer.update( <TestComponent testValue={ 2 } /> );
		} );
		testValue = renderer.root.findByType( 'div' ).props.testValue;
		testPreviousValue = renderer.root.findByType( 'div' ).props
			.previousValue;
		expect( testValue ).toBe( 2 );
		expect( testPreviousValue ).toBe( 1 );

		act( () => {
			renderer.update( <TestComponent testValue={ 3 } /> );
		} );
		testValue = renderer.root.findByType( 'div' ).props.testValue;
		testPreviousValue = renderer.root.findByType( 'div' ).props
			.previousValue;
		expect( testValue ).toBe( 3 );
		expect( testPreviousValue ).toBe( 2 );
	} );

	it( 'should not update value if validation fails', () => {
		let testValue;
		let testPreviousValue;
		act( () => {
			renderer = TestRenderer.create(
				<TestComponent testValue={ 1 } validation={ Number.isFinite } />
			);
		} );

		act( () => {
			renderer.update(
				<TestComponent testValue="abc" validation={ Number.isFinite } />
			);
		} );
		testValue = renderer.root.findByType( 'div' ).props.testValue;
		testPreviousValue = renderer.root.findByType( 'div' ).props
			.previousValue;
		expect( testValue ).toBe( 'abc' );
		expect( testPreviousValue ).toBe( 1 );

		act( () => {
			renderer.update(
				<TestComponent testValue={ 3 } validation={ Number.isFinite } />
			);
		} );
		testValue = renderer.root.findByType( 'div' ).props.testValue;
		testPreviousValue = renderer.root.findByType( 'div' ).props
			.previousValue;
		expect( testValue ).toBe( 3 );
		expect( testPreviousValue ).toBe( 1 );
	} );
} );
woocommerce-blocks/assets/js/base/hooks/test/use-shallow-equal.js000064400000005404151335517640021213 0ustar00/**
 * External dependencies
 */
import TestRenderer, { act } from 'react-test-renderer';

/**
 * Internal dependencies
 */
import { useShallowEqual } from '../use-shallow-equal';

describe( 'useShallowEqual', () => {
	const TestComponent = ( { testValue } ) => {
		const newValue = useShallowEqual( testValue );
		return <div newValue={ newValue } />;
	};
	let renderer;
	beforeEach( () => ( renderer = null ) );
	it.each`
		testValueA                  | aType         | testValueB                  | bType
		${ { a: 'b', foo: 'bar' } } | ${ 'object' } | ${ { foo: 'bar', a: 'b' } } | ${ 'object' }
		${ [ 'b', 'bar' ] }         | ${ 'array' }  | ${ [ 'b', 'bar' ] }         | ${ 'array' }
		${ 1 }                      | ${ 'number' } | ${ 1 }                      | ${ 'number' }
		${ '1' }                    | ${ 'string' } | ${ '1' }                    | ${ 'string' }
		${ true }                   | ${ 'bool' }   | ${ true }                   | ${ 'bool' }
	`(
		'$testValueA ($aType) and $testValueB ($bType) are expected to be equal',
		( { testValueA, testValueB } ) => {
			let testPropValue;
			act( () => {
				renderer = TestRenderer.create(
					<TestComponent testValue={ testValueA } />
				);
			} );
			testPropValue = renderer.root.findByType( 'div' ).props.newValue;
			expect( testPropValue ).toBe( testValueA );
			// do update
			act( () => {
				renderer.update( <TestComponent testValue={ testValueB } /> );
			} );
			testPropValue = renderer.root.findByType( 'div' ).props.newValue;
			expect( testPropValue ).toBe( testValueA );
		}
	);

	it.each`
		testValueA                  | aType         | testValueB                  | bType
		${ { a: 'b', foo: 'bar' } } | ${ 'object' } | ${ { foo: 'bar', a: 'c' } } | ${ 'object' }
		${ [ 'b', 'bar' ] }         | ${ 'array' }  | ${ [ 'bar', 'b' ] }         | ${ 'array' }
		${ 1 }                      | ${ 'number' } | ${ '1' }                    | ${ 'string' }
		${ 1 }                      | ${ 'number' } | ${ 2 }                      | ${ 'number' }
		${ 1 }                      | ${ 'number' } | ${ true }                   | ${ 'bool' }
		${ 0 }                      | ${ 'number' } | ${ false }                  | ${ 'bool' }
	`(
		'$testValueA ($aType) and $testValueB ($bType) are expected to not be equal',
		( { testValueA, testValueB } ) => {
			let testPropValue;
			act( () => {
				renderer = TestRenderer.create(
					<TestComponent testValue={ testValueA } />
				);
			} );
			testPropValue = renderer.root.findByType( 'div' ).props.newValue;
			expect( testPropValue ).toBe( testValueA );
			// do update
			act( () => {
				renderer.update( <TestComponent testValue={ testValueB } /> );
			} );
			testPropValue = renderer.root.findByType( 'div' ).props.newValue;
			expect( testPropValue ).toBe( testValueB );
		}
	);
} );
woocommerce-blocks/assets/js/base/hooks/use-previous.ts000064400000001301151335517640017334 0ustar00/**
 * External dependencies
 */
import { useRef, useEffect } from 'react';

interface Validation< T > {
	( value: T, previousValue: T | undefined ): boolean;
}
/**
 * Use Previous based on https://usehooks.com/usePrevious/.
 *
 * @param {*}    value
 * @param {Function} [validation] Function that needs to validate for the value
 *                                to be updated.
 */
export function usePrevious< T >(
	value: T,
	validation?: Validation< T >
): T | undefined {
	const ref = useRef< T >();

	useEffect( () => {
		if (
			ref.current !== value &&
			( ! validation || validation( value, ref.current ) )
		) {
			ref.current = value;
		}
	}, [ value, validation ] );

	return ref.current;
}
woocommerce-blocks/assets/js/base/hooks/index.js000064400000000361151335517640015770 0ustar00export * from './use-container-queries';
export * from './use-local-storage-state';
export * from './use-position-relative-to-viewport';
export * from './use-previous';
export * from './use-shallow-equal';
export * from './use-throw-error';
woocommerce-blocks/assets/js/base/hooks/use-local-storage-state.ts000064400000001706151335517640021343 0ustar00/**
 * External dependencies
 */
import { useEffect, useState } from '@wordpress/element';

export const useLocalStorageState = < T >(
	key: string,
	initialValue: T
): [ T, ( arg0: T ) => void ] => {
	const [ state, setState ] = useState< T >( () => {
		const valueInLocalStorage = window.localStorage.getItem( key );
		if ( valueInLocalStorage ) {
			try {
				return JSON.parse( valueInLocalStorage );
			} catch {
				// eslint-disable-next-line no-console
				console.error(
					`Value for key '${ key }' could not be retrieved from localStorage because it can't be parsed.`
				);
			}
		}
		return initialValue;
	} );
	useEffect( () => {
		try {
			window.localStorage.setItem( key, JSON.stringify( state ) );
		} catch {
			// eslint-disable-next-line no-console
			console.error(
				`Value for key '${ key }' could not be saved in localStorage because it can't be converted into a string.`
			);
		}
	}, [ key, state ] );

	return [ state, setState ];
};
woocommerce-blocks/assets/js/base/components/load-more-button/style.scss000064400000000106151335517640022607 0ustar00.wc-block-components-load-more {
	text-align: center;
	width: 100%;
}
woocommerce-blocks/assets/js/base/components/load-more-button/index.js000064400000001445151335517640022226 0ustar00/**
 * External dependencies
 */
import { __ } from '@wordpress/i18n';
import PropTypes from 'prop-types';
import Label from '@woocommerce/base-components/label';

/**
 * Internal dependencies
 */
import './style.scss';

export const LoadMoreButton = ( { onClick, label, screenReaderLabel } ) => {
	return (
		<div className="wp-block-button wc-block-load-more wc-block-components-load-more">
			<button className="wp-block-button__link" onClick={ onClick }>
				<Label
					label={ label }
					screenReaderLabel={ screenReaderLabel }
				/>
			</button>
		</div>
	);
};

LoadMoreButton.propTypes = {
	label: PropTypes.string,
	onClick: PropTypes.func,
	screenReaderLabel: PropTypes.string,
};

LoadMoreButton.defaultProps = {
	label: __( 'Load more', 'woocommerce' ),
};

export default LoadMoreButton;
woocommerce-blocks/assets/js/base/components/filter-element-label/index.js000064400000001676151335517640023035 0ustar00/**
 * External dependencies
 */
import { _n, sprintf } from '@wordpress/i18n';
import Label from '@woocommerce/base-components/label';

/**
 * Internal dependencies
 */
import './style.scss';

/**
 * The label for an filter elements.
 *
 * @param {Object} props Incoming props for the component.
 * @param {string} props.name The name for the label.
 * @param {number} props.count The count of products this status is attached to.
 */
const FilterElementLabel = ( { name, count } ) => {
	return (
		<>
			{ name }
			{ Number.isFinite( count ) && (
				<Label
					label={ count }
					screenReaderLabel={ sprintf(
						/* translators: %s number of products. */
						_n(
							'%s product',
							'%s products',
							count,
							'woocommerce'
						),
						count
					) }
					wrapperElement="span"
					wrapperProps={ {
						className: 'wc-filter-element-label-list-count',
					} }
				/>
			) }
		</>
	);
};

export default FilterElementLabel;
woocommerce-blocks/assets/js/base/components/filter-element-label/style.scss000064400000000167151335517640023417 0ustar00.wc-filter-element-label-list-count {
	&::before {
		content: " (";
	}
	&::after {
		content: ")";
	}
	opacity: 0.6;
}
woocommerce-blocks/assets/js/base/components/filter-submit-button/index.js000064400000002173151335517640023134 0ustar00/**
 * External dependencies
 */
import { __ } from '@wordpress/i18n';
import PropTypes from 'prop-types';
import classNames from 'classnames';
import Label from '@woocommerce/base-components/label';

/**
 * Internal dependencies
 */
import './style.scss';

const FilterSubmitButton = ( {
	className,
	disabled,
	/* translators: Submit button text for filters. */
	label = __( 'Go', 'woocommerce' ),
	onClick,
	screenReaderLabel = __( 'Apply filter', 'woocommerce' ),
} ) => {
	return (
		<button
			type="submit"
			className={ classNames(
				'wc-block-filter-submit-button',
				'wc-block-components-filter-submit-button',
				className
			) }
			disabled={ disabled }
			onClick={ onClick }
		>
			<Label label={ label } screenReaderLabel={ screenReaderLabel } />
		</button>
	);
};

FilterSubmitButton.propTypes = {
	className: PropTypes.string,
	/**
	 * Is the button disabled?
	 */
	disabled: PropTypes.bool,
	/**
	 * On click callback.
	 */
	onClick: PropTypes.func.isRequired,
	label: PropTypes.string,
	screenReaderLabel: PropTypes.string,
};

FilterSubmitButton.defaultProps = {
	disabled: false,
};

export default FilterSubmitButton;
woocommerce-blocks/assets/js/base/components/filter-submit-button/style.scss000064400000000151151335517640023516 0ustar00.wc-block-components-filter-submit-button {
	display: block;
	margin-left: auto;
	white-space: nowrap;
}
woocommerce-blocks/assets/js/base/components/spinner/index.tsx000064400000000307151335517640020712 0ustar00/**
 * Internal dependencies
 */
import './style.scss';

const Spinner = (): JSX.Element => {
	return <span className="wc-block-components-spinner" aria-hidden="true" />;
};

export default Spinner;
woocommerce-blocks/assets/js/base/components/spinner/style.scss000064400000001437151335517640021105 0ustar00.wc-block-components-spinner {
	position: absolute;
	width: 100%;
	height: 100%;
	color: inherit;
	box-sizing: content-box;
	text-align: center;
	font-size: 1.25em;

	&::after {
		content: " ";
		position: absolute;
		top: 50%;
		left: 50%;
		margin: -0.5em 0 0 -0.5em;
		width: 1em;
		height: 1em;
		box-sizing: border-box;
		transform-origin: 50% 50%;
		transform: translateZ(0) scale(0.5);
		backface-visibility: hidden;
		border-radius: 50%;
		border: 0.2em solid currentColor;
		border-left-color: transparent;
		animation: wc-block-components-spinner__animation 1s infinite linear;
	}
}

@keyframes wc-block-components-spinner__animation {
	0% {
		animation-timing-function: cubic-bezier(0.5856, 0.0703, 0.4143, 0.9297);
		transform: rotate(0deg);
	}
	100% {
		transform: rotate(360deg);
	}
}
woocommerce-blocks/assets/js/base/components/product-price/stories/index.js000064400000002443151335517640023305 0ustar00/**
 * External dependencies
 */
import { number, select } from '@storybook/addon-knobs';
import { currencyKnob } from '@woocommerce/knobs';

/**
 * Internal dependencies
 */
import ProductPrice from '../';

export default {
	title: 'WooCommerce Blocks/@base-components/ProductPrice',
	component: ProductPrice,
};

export const standard = () => {
	const align = select( 'Align', [ 'left', 'center', 'right' ], 'left' );
	const currency = currencyKnob();
	const price = number( 'Price', 4000 );

	return (
		<ProductPrice align={ align } currency={ currency } price={ price } />
	);
};

export const sale = () => {
	const align = select( 'Align', [ 'left', 'center', 'right' ], 'left' );
	const currency = currencyKnob();
	const price = number( 'Price', 3000 );
	const regularPrice = number( 'Regular price', 4000 );

	return (
		<ProductPrice
			align={ align }
			currency={ currency }
			price={ price }
			regularPrice={ regularPrice }
		/>
	);
};

export const range = () => {
	const align = select( 'Align', [ 'left', 'center', 'right' ], 'left' );
	const currency = currencyKnob();
	const minPrice = number( 'Min price', 3000 );
	const maxPrice = number( 'Max price', 5000 );

	return (
		<ProductPrice
			align={ align }
			currency={ currency }
			minPrice={ minPrice }
			maxPrice={ maxPrice }
		/>
	);
};
woocommerce-blocks/assets/js/base/components/product-price/test/index.js000064400000002435151335517640022575 0ustar00/**
 * External dependencies
 */
import TestRenderer from 'react-test-renderer';

/**
 * Internal dependencies
 */
import ProductPrice from '../index';

describe( 'ProductPrice', () => {
	const currency = {
		code: 'GBP',
		currency_code: 'GBP',
		currency_decimal_separator: '.',
		currency_minor_unit: 2,
		currency_prefix: '£',
		currency_suffix: '',
		currency_symbol: '£',
		currency_thousand_separator: ',',
		decimalSeparator: '.',
		minorUnit: 2,
		prefix: '£',
		price: '61400',
		price_range: null,
		raw_prices: {
			precision: 6,
			price: '614000000',
			regular_price: '614000000',
			sale_price: '614000000',
		},
		regular_price: '61400',
		sale_price: '61400',
		suffix: '',
		symbol: '£',
		thousandSeparator: ',',
	};

	test( 'should use default price if no format is provided', () => {
		const component = TestRenderer.create(
			<ProductPrice
				price={ 50 }
				regularPrice={ 100 }
				currency={ currency }
			/>
		);

		expect( component.toJSON() ).toMatchSnapshot();
	} );

	test( 'should apply the format if one is provided', () => {
		const component = TestRenderer.create(
			<ProductPrice
				price={ 50 }
				regularPrice={ 100 }
				currency={ currency }
				format="pre price <price/> Test format"
			/>
		);

		expect( component.toJSON() ).toMatchSnapshot();
	} );
} );
woocommerce-blocks/assets/js/base/components/product-price/test/__snapshots__/index.js.snap000064400000002054151335517640026350 0ustar00// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`ProductPrice should apply the format if one is provided 1`] = `
<span
  className="price wc-block-components-product-price"
>
  pre price 
  <span
    className="screen-reader-text"
  >
    Previous price:
  </span>
  <del
    className="wc-block-components-product-price__regular"
  >
    £1.00
  </del>
  <span
    className="screen-reader-text"
  >
    Discounted price:
  </span>
  <ins
    className="wc-block-components-product-price__value is-discounted"
  >
    £0.50
  </ins>
   Test format
</span>
`;

exports[`ProductPrice should use default price if no format is provided 1`] = `
<span
  className="price wc-block-components-product-price"
>
  <span
    className="screen-reader-text"
  >
    Previous price:
  </span>
  <del
    className="wc-block-components-product-price__regular"
  >
    £1.00
  </del>
  <span
    className="screen-reader-text"
  >
    Discounted price:
  </span>
  <ins
    className="wc-block-components-product-price__value is-discounted"
  >
    £0.50
  </ins>
</span>
`;
woocommerce-blocks/assets/js/base/components/product-price/index.js000064400000011320151335517640021607 0ustar00/**
 * External dependencies
 */
import { __, sprintf } from '@wordpress/i18n';
import FormattedMonetaryAmount from '@woocommerce/base-components/formatted-monetary-amount';
import classNames from 'classnames';
import PropTypes from 'prop-types';
import { formatPrice } from '@woocommerce/price-format';
import { createInterpolateElement } from '@wordpress/element';

/**
 * Internal dependencies
 */
import './style.scss';

const PriceRange = ( {
	currency,
	maxPrice,
	minPrice,
	priceClassName,
	priceStyle,
} ) => {
	return (
		<>
			<span className="screen-reader-text">
				{ sprintf(
					/* translators: %1$s min price, %2$s max price */
					__(
						'Price between %1$s and %2$s',
						'woocommerce'
					),
					formatPrice( minPrice ),
					formatPrice( maxPrice )
				) }
			</span>
			<span aria-hidden={ true }>
				<FormattedMonetaryAmount
					className={ classNames(
						'wc-block-components-product-price__value',
						priceClassName
					) }
					currency={ currency }
					value={ minPrice }
					style={ priceStyle }
				/>
				&nbsp;&mdash;&nbsp;
				<FormattedMonetaryAmount
					className={ classNames(
						'wc-block-components-product-price__value',
						priceClassName
					) }
					currency={ currency }
					value={ maxPrice }
					style={ priceStyle }
				/>
			</span>
		</>
	);
};

const SalePrice = ( {
	currency,
	regularPriceClassName,
	regularPriceStyle,
	regularPrice,
	priceClassName,
	priceStyle,
	price,
} ) => {
	return (
		<>
			<span className="screen-reader-text">
				{ __( 'Previous price:', 'woocommerce' ) }
			</span>
			<FormattedMonetaryAmount
				currency={ currency }
				renderText={ ( value ) => (
					<del
						className={ classNames(
							'wc-block-components-product-price__regular',
							regularPriceClassName
						) }
						style={ regularPriceStyle }
					>
						{ value }
					</del>
				) }
				value={ regularPrice }
			/>
			<span className="screen-reader-text">
				{ __( 'Discounted price:', 'woocommerce' ) }
			</span>
			<FormattedMonetaryAmount
				currency={ currency }
				renderText={ ( value ) => (
					<ins
						className={ classNames(
							'wc-block-components-product-price__value',
							'is-discounted',
							priceClassName
						) }
						style={ priceStyle }
					>
						{ value }
					</ins>
				) }
				value={ price }
			/>
		</>
	);
};

const ProductPrice = ( {
	align,
	className,
	currency,
	format = '<price/>',
	maxPrice = null,
	minPrice = null,
	price = null,
	priceClassName,
	priceStyle,
	regularPrice,
	regularPriceClassName,
	regularPriceStyle,
} ) => {
	const wrapperClassName = classNames(
		className,
		'price',
		'wc-block-components-product-price',
		{
			[ `wc-block-components-product-price--align-${ align }` ]: align,
		}
	);

	if ( ! format.includes( '<price/>' ) ) {
		format = '<price/>';
		// eslint-disable-next-line no-console
		console.error( 'Price formats need to include the `<price/>` tag.' );
	}

	const isDiscounted = regularPrice && price !== regularPrice;
	let priceComponent = (
		<span
			className={ classNames(
				'wc-block-components-product-price__value',
				priceClassName
			) }
		/>
	);

	if ( isDiscounted ) {
		priceComponent = (
			<SalePrice
				currency={ currency }
				price={ price }
				priceClassName={ priceClassName }
				priceStyle={ priceStyle }
				regularPrice={ regularPrice }
				regularPriceClassName={ regularPriceClassName }
				regularPriceStyle={ regularPriceStyle }
			/>
		);
	} else if ( minPrice !== null && maxPrice !== null ) {
		priceComponent = (
			<PriceRange
				currency={ currency }
				maxPrice={ maxPrice }
				minPrice={ minPrice }
				priceClassName={ priceClassName }
				priceStyle={ priceStyle }
			/>
		);
	} else if ( price !== null ) {
		priceComponent = (
			<FormattedMonetaryAmount
				className={ classNames(
					'wc-block-components-product-price__value',
					priceClassName
				) }
				currency={ currency }
				value={ price }
				style={ priceStyle }
			/>
		);
	}

	return (
		<span className={ wrapperClassName }>
			{ createInterpolateElement( format, {
				price: priceComponent,
			} ) }
		</span>
	);
};

ProductPrice.propTypes = {
	align: PropTypes.oneOf( [ 'left', 'center', 'right' ] ),
	className: PropTypes.string,
	currency: PropTypes.object,
	format: PropTypes.string,
	price: PropTypes.oneOfType( [ PropTypes.number, PropTypes.string ] ),
	priceClassName: PropTypes.string,
	priceStyle: PropTypes.object,
	// Range price props
	maxPrice: PropTypes.oneOfType( [ PropTypes.number, PropTypes.string ] ),
	minPrice: PropTypes.oneOfType( [ PropTypes.number, PropTypes.string ] ),
	// On sale price props
	regularPrice: PropTypes.oneOfType( [ PropTypes.number, PropTypes.string ] ),
	regularPriceClassName: PropTypes.string,
	regularPriceStyle: PropTypes.object,
};

export default ProductPrice;
woocommerce-blocks/assets/js/base/components/product-price/style.scss000064400000001041151335517640022176 0ustar00/*rtl:begin:ignore*/
.wc-block-components-product-price--align-left {
	display: block;
	text-align: left;
}
.wc-block-components-product-price--align-center {
	display: block;
	text-align: center;
}
.wc-block-components-product-price--align-right {
	display: block;
	text-align: right;
}
/*rtl:end:ignore*/

.wc-block-components-product-price__value {
	&.is-discounted {
		margin-left: 0.5em;
	}
}

.is-loading {
	.wc-block-components-product-price::before {
		@include placeholder();
		content: ".";
		display: inline-block;
		width: 5em;
	}
}
woocommerce-blocks/assets/js/base/components/product-name/stories/index.js000064400000000712151335517640023120 0ustar00/**
 * External dependencies
 */
import { boolean } from '@storybook/addon-knobs';

/**
 * Internal dependencies
 */
import ProductName from '../';

export default {
	title: 'WooCommerce Blocks/@base-components/cart-checkout/ProductName',
	component: ProductName,
};

export const Default = () => {
	const disabled = boolean( 'disabled', false );

	return (
		<ProductName
			disabled={ disabled }
			name={ 'Test product' }
			permalink={ '/' }
		/>
	);
};
woocommerce-blocks/assets/js/base/components/product-name/test/index.js000064400000002170151335517640022407 0ustar00/**
 * External dependencies
 */
import TestRenderer from 'react-test-renderer';

/**
 * Internal dependencies
 */
import ProductName from '..';

describe( 'ProductName', () => {
	test( 'should not render a link if disabled is true', () => {
		const component = TestRenderer.create(
			<ProductName disabled={ true } name="Test product" permalink="/" />
		);

		expect( component.toJSON() ).toMatchSnapshot();
	} );

	test( 'should render a link if disabled is false', () => {
		const component = TestRenderer.create(
			<ProductName disabled={ false } name="Test product" permalink="/" />
		);

		expect( component.toJSON() ).toMatchSnapshot();
	} );

	test( 'should render a link if disabled is not defined', () => {
		const component = TestRenderer.create(
			<ProductName name="Test product" permalink="/" />
		);

		expect( component.toJSON() ).toMatchSnapshot();
	} );

	test( 'should merge classes and props', () => {
		const component = TestRenderer.create(
			<ProductName
				className="lorem-ipsum"
				name="Test product"
				permalink="/"
				rel="nofollow"
			/>
		);

		expect( component.toJSON() ).toMatchSnapshot();
	} );
} );
woocommerce-blocks/assets/js/base/components/product-name/test/__snapshots__/index.js.snap000064400000001666151335517640026176 0ustar00// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`ProductName should merge classes and props 1`] = `
<a
  className="wc-block-components-product-name lorem-ipsum"
  dangerouslySetInnerHTML={
    Object {
      "__html": "Test product",
    }
  }
  href="/"
  rel="nofollow"
/>
`;

exports[`ProductName should not render a link if disabled is true 1`] = `
<span
  className="wc-block-components-product-name"
  dangerouslySetInnerHTML={
    Object {
      "__html": "Test product",
    }
  }
/>
`;

exports[`ProductName should render a link if disabled is false 1`] = `
<a
  className="wc-block-components-product-name"
  dangerouslySetInnerHTML={
    Object {
      "__html": "Test product",
    }
  }
  href="/"
/>
`;

exports[`ProductName should render a link if disabled is not defined 1`] = `
<a
  className="wc-block-components-product-name"
  dangerouslySetInnerHTML={
    Object {
      "__html": "Test product",
    }
  }
  href="/"
/>
`;
woocommerce-blocks/assets/js/base/components/product-name/style.scss000064400000000141151335517640022014 0ustar00.wc-block-components-product-name {
	@include font-size(regular);
	@include wrap-break-word();
}
woocommerce-blocks/assets/js/base/components/product-name/index.tsx000064400000001702151335517640021632 0ustar00/**
 * External dependencies
 */
import { decodeEntities } from '@wordpress/html-entities';
import classnames from 'classnames';

/**
 * Internal dependencies
 */
import './style.scss';

/**
 * Render the Product name.
 *
 * The store API runs titles through `wp_kses_post()` which removes dangerous HTML tags, so using it inside `dangerouslySetInnerHTML` is considered safe.
 */
export default ( {
	className = '',
	disabled = false,
	name,
	permalink = '',
	...props
}: {
	className?: string;
	disabled?: boolean;
	name: string;
	permalink?: string;
} ): JSX.Element => {
	const classes = classnames( 'wc-block-components-product-name', className );
	return disabled ? (
		<span
			className={ classes }
			{ ...props }
			dangerouslySetInnerHTML={ {
				__html: decodeEntities( name ),
			} }
		/>
	) : (
		<a
			className={ classes }
			href={ permalink }
			{ ...props }
			dangerouslySetInnerHTML={ {
				__html: decodeEntities( name ),
			} }
		/>
	);
};
woocommerce-blocks/assets/js/base/components/country-input/shipping-country-input.tsx000064400000000650151335517640025445 0ustar00/**
 * External dependencies
 */
import { SHIPPING_COUNTRIES } from '@woocommerce/block-settings';

/**
 * Internal dependencies
 */
import CountryInput from './country-input';
import { CountryInputProps } from './CountryInputProps';

const ShippingCountryInput = ( props: CountryInputProps ): JSX.Element => {
	return <CountryInput countries={ SHIPPING_COUNTRIES } { ...props } />;
};

export default ShippingCountryInput;
woocommerce-blocks/assets/js/base/components/country-input/index.ts000064400000000321151335517640021700 0ustar00export { default as CountryInput } from './country-input';
export { default as BillingCountryInput } from './billing-country-input';
export { default as ShippingCountryInput } from './shipping-country-input';
woocommerce-blocks/assets/js/base/components/country-input/billing-country-input.tsx000064400000000651151335517640025245 0ustar00/**
 * External dependencies
 */
import { ALLOWED_COUNTRIES } from '@woocommerce/block-settings';

/**
 * Internal dependencies
 */
import CountryInput from './country-input';
import type { CountryInputProps } from './CountryInputProps';

const BillingCountryInput = ( props: CountryInputProps ): JSX.Element => {
	return <CountryInput countries={ ALLOWED_COUNTRIES } { ...props } />;
};

export default BillingCountryInput;
woocommerce-blocks/assets/js/base/components/country-input/country-input.tsx000064400000003701151335517640023626 0ustar00/**
 * External dependencies
 */
import { useMemo } from '@wordpress/element';
import { __ } from '@wordpress/i18n';
import { decodeEntities } from '@wordpress/html-entities';
import classnames from 'classnames';

/**
 * Internal dependencies
 */
import Combobox from '../combobox';
import './style.scss';
import type { CountryInputWithCountriesProps } from './CountryInputProps';

const CountryInput = ( {
	className,
	countries,
	id,
	label,
	onChange,
	value = '',
	autoComplete = 'off',
	required = false,
	errorId,
	errorMessage = __(
		'Please select a country.',
		'woo-gutenberg-products-block'
	),
}: CountryInputWithCountriesProps ): JSX.Element => {
	const options = useMemo(
		() =>
			Object.keys( countries ).map( ( key ) => ( {
				value: key,
				label: decodeEntities( countries[ key ] ),
			} ) ),
		[ countries ]
	);

	return (
		<div
			className={ classnames(
				className,
				'wc-block-components-country-input'
			) }
		>
			<Combobox
				id={ id }
				label={ label }
				onChange={ onChange }
				options={ options }
				value={ value }
				errorId={ errorId }
				errorMessage={ errorMessage }
				required={ required }
				autoComplete={ autoComplete }
			/>
			{ autoComplete !== 'off' && (
				<input
					type="text"
					aria-hidden={ true }
					autoComplete={ autoComplete }
					value={ value }
					onChange={ ( event ) => {
						const textValue = event.target.value.toLocaleUpperCase();
						const foundOption = options.find(
							( option ) =>
								( textValue.length !== 2 &&
									option.label.toLocaleUpperCase() ===
										textValue ) ||
								( textValue.length === 2 &&
									option.value.toLocaleUpperCase() ===
										textValue )
						);
						onChange( foundOption ? foundOption.value : '' );
					} }
					style={ {
						minHeight: '0',
						height: '0',
						border: '0',
						padding: '0',
						position: 'absolute',
					} }
					tabIndex={ -1 }
				/>
			) }
		</div>
	);
};

export default CountryInput;
woocommerce-blocks/assets/js/base/components/country-input/stories/index.js000064400000002466151335517640023372 0ustar00/**
 * External dependencies
 */
import { text } from '@storybook/addon-knobs';
import { useState, useEffect } from '@wordpress/element';
import {
	ValidationContextProvider,
	useValidationContext,
} from '@woocommerce/base-context';

/**
 * Internal dependencies
 */
import { CountryInput } from '../';
import { countries as exampleCountries } from './countries-filler';

export default {
	title: 'WooCommerce Blocks/@base-components/CountryInput',
	component: CountryInput,
};

const StoryComponent = ( { label, errorMessage } ) => {
	const [ selectedCountry, selectCountry ] = useState();
	const {
		setValidationErrors,
		clearValidationError,
	} = useValidationContext();
	useEffect( () => {
		setValidationErrors( { country: errorMessage } );
	}, [ errorMessage, setValidationErrors ] );
	const updateCountry = ( country ) => {
		clearValidationError( 'country' );
		selectCountry( country );
	};
	return (
		<CountryInput
			countries={ exampleCountries }
			label={ label }
			value={ selectedCountry }
			onChange={ updateCountry }
		/>
	);
};

export const Default = () => {
	const label = text( 'Input Label', 'Countries:' );
	const errorMessage = text( 'Error Message', '' );
	return (
		<ValidationContextProvider>
			<StoryComponent label={ label } errorMessage={ errorMessage } />
		</ValidationContextProvider>
	);
};
woocommerce-blocks/assets/js/base/components/country-input/stories/countries-filler.js000064400000011276151335517640025550 0ustar00export const countries = {
	AX: '&#197;land Islands',
	AF: 'Afghanistan',
	AL: 'Albania',
	DZ: 'Algeria',
	AS: 'American Samoa',
	AD: 'Andorra',
	AO: 'Angola',
	AI: 'Anguilla',
	AQ: 'Antarctica',
	AG: 'Antigua and Barbuda',
	AR: 'Argentina',
	AM: 'Armenia',
	AW: 'Aruba',
	AU: 'Australia',
	AT: 'Austria',
	AZ: 'Azerbaijan',
	BS: 'Bahamas',
	BH: 'Bahrain',
	BD: 'Bangladesh',
	BB: 'Barbados',
	BY: 'Belarus',
	PW: 'Belau',
	BE: 'Belgium',
	BZ: 'Belize',
	BJ: 'Benin',
	BM: 'Bermuda',
	BT: 'Bhutan',
	BO: 'Bolivia',
	BQ: 'Bonaire, Saint Eustatius and Saba',
	BA: 'Bosnia and Herzegovina',
	BW: 'Botswana',
	BV: 'Bouvet Island',
	BR: 'Brazil',
	IO: 'British Indian Ocean Territory',
	BN: 'Brunei',
	BG: 'Bulgaria',
	BF: 'Burkina Faso',
	BI: 'Burundi',
	KH: 'Cambodia',
	CM: 'Cameroon',
	CA: 'Canada',
	CV: 'Cape Verde',
	KY: 'Cayman Islands',
	CF: 'Central African Republic',
	TD: 'Chad',
	CL: 'Chile',
	CN: 'China',
	CX: 'Christmas Island',
	CC: 'Cocos (Keeling) Islands',
	CO: 'Colombia',
	KM: 'Comoros',
	CG: 'Congo (Brazzaville)',
	CD: 'Congo (Kinshasa)',
	CK: 'Cook Islands',
	CR: 'Costa Rica',
	HR: 'Croatia',
	CU: 'Cuba',
	CW: 'Cura&ccedil;ao',
	CY: 'Cyprus',
	CZ: 'Czech Republic',
	DK: 'Denmark',
	DJ: 'Djibouti',
	DM: 'Dominica',
	DO: 'Dominican Republic',
	EC: 'Ecuador',
	EG: 'Egypt',
	SV: 'El Salvador',
	GQ: 'Equatorial Guinea',
	ER: 'Eritrea',
	EE: 'Estonia',
	ET: 'Ethiopia',
	FK: 'Falkland Islands',
	FO: 'Faroe Islands',
	FJ: 'Fiji',
	FI: 'Finland',
	FR: 'France',
	GF: 'French Guiana',
	PF: 'French Polynesia',
	TF: 'French Southern Territories',
	GA: 'Gabon',
	GM: 'Gambia',
	GE: 'Georgia',
	DE: 'Germany',
	GH: 'Ghana',
	GI: 'Gibraltar',
	GR: 'Greece',
	GL: 'Greenland',
	GD: 'Grenada',
	GP: 'Guadeloupe',
	GU: 'Guam',
	GT: 'Guatemala',
	GG: 'Guernsey',
	GN: 'Guinea',
	GW: 'Guinea-Bissau',
	GY: 'Guyana',
	HT: 'Haiti',
	HM: 'Heard Island and McDonald Islands',
	HN: 'Honduras',
	HK: 'Hong Kong',
	HU: 'Hungary',
	IS: 'Iceland',
	IN: 'India',
	ID: 'Indonesia',
	IR: 'Iran',
	IQ: 'Iraq',
	IE: 'Ireland',
	IM: 'Isle of Man',
	IL: 'Israel',
	IT: 'Italy',
	CI: 'Ivory Coast',
	JM: 'Jamaica',
	JP: 'Japan',
	JE: 'Jersey',
	JO: 'Jordan',
	KZ: 'Kazakhstan',
	KE: 'Kenya',
	KI: 'Kiribati',
	KW: 'Kuwait',
	KG: 'Kyrgyzstan',
	LA: 'Laos',
	LV: 'Latvia',
	LB: 'Lebanon',
	LS: 'Lesotho',
	LR: 'Liberia',
	LY: 'Libya',
	LI: 'Liechtenstein',
	LT: 'Lithuania',
	LU: 'Luxembourg',
	MO: 'Macao',
	MG: 'Madagascar',
	MW: 'Malawi',
	MY: 'Malaysia',
	MV: 'Maldives',
	ML: 'Mali',
	MT: 'Malta',
	MH: 'Marshall Islands',
	MQ: 'Martinique',
	MR: 'Mauritania',
	MU: 'Mauritius',
	YT: 'Mayotte',
	MX: 'Mexico',
	FM: 'Micronesia',
	MD: 'Moldova',
	MC: 'Monaco',
	MN: 'Mongolia',
	ME: 'Montenegro',
	MS: 'Montserrat',
	MA: 'Morocco',
	MZ: 'Mozambique',
	MM: 'Myanmar',
	NA: 'Namibia',
	NR: 'Nauru',
	NP: 'Nepal',
	NL: 'Netherlands',
	NC: 'New Caledonia',
	NZ: 'New Zealand',
	NI: 'Nicaragua',
	NE: 'Niger',
	NG: 'Nigeria',
	NU: 'Niue',
	NF: 'Norfolk Island',
	KP: 'North Korea',
	MK: 'North Macedonia',
	MP: 'Northern Mariana Islands',
	NO: 'Norway',
	OM: 'Oman',
	PK: 'Pakistan',
	PS: 'Palestinian Territory',
	PA: 'Panama',
	PG: 'Papua New Guinea',
	PY: 'Paraguay',
	PE: 'Peru',
	PH: 'Philippines',
	PN: 'Pitcairn',
	PL: 'Poland',
	PT: 'Portugal',
	PR: 'Puerto Rico',
	QA: 'Qatar',
	RE: 'Reunion',
	RO: 'Romania',
	RU: 'Russia',
	RW: 'Rwanda',
	ST: 'S&atilde;o Tom&eacute; and Pr&iacute;ncipe',
	BL: 'Saint Barth&eacute;lemy',
	SH: 'Saint Helena',
	KN: 'Saint Kitts and Nevis',
	LC: 'Saint Lucia',
	SX: 'Saint Martin (Dutch part)',
	MF: 'Saint Martin (French part)',
	PM: 'Saint Pierre and Miquelon',
	VC: 'Saint Vincent and the Grenadines',
	WS: 'Samoa',
	SM: 'San Marino',
	SA: 'Saudi Arabia',
	SN: 'Senegal',
	RS: 'Serbia',
	SC: 'Seychelles',
	SL: 'Sierra Leone',
	SG: 'Singapore',
	SK: 'Slovakia',
	SI: 'Slovenia',
	SB: 'Solomon Islands',
	SO: 'Somalia',
	ZA: 'South Africa',
	GS: 'South Georgia/Sandwich Islands',
	KR: 'South Korea',
	SS: 'South Sudan',
	ES: 'Spain',
	LK: 'Sri Lanka',
	SD: 'Sudan',
	SR: 'Suriname',
	SJ: 'Svalbard and Jan Mayen',
	SZ: 'Swaziland',
	SE: 'Sweden',
	CH: 'Switzerland',
	SY: 'Syria',
	TW: 'Taiwan',
	TJ: 'Tajikistan',
	TZ: 'Tanzania',
	TH: 'Thailand',
	TL: 'Timor-Leste',
	TG: 'Togo',
	TK: 'Tokelau',
	TO: 'Tonga',
	TT: 'Trinidad and Tobago',
	TN: 'Tunisia',
	TR: 'Turkey',
	TM: 'Turkmenistan',
	TC: 'Turks and Caicos Islands',
	TV: 'Tuvalu',
	UG: 'Uganda',
	UA: 'Ukraine',
	AE: 'United Arab Emirates',
	GB: 'United Kingdom (UK)',
	US: 'United States (US)',
	UM: 'United States (US) Minor Outlying Islands',
	UY: 'Uruguay',
	UZ: 'Uzbekistan',
	VU: 'Vanuatu',
	VA: 'Vatican',
	VE: 'Venezuela',
	VN: 'Vietnam',
	VG: 'Virgin Islands (British)',
	VI: 'Virgin Islands (US)',
	WF: 'Wallis and Futuna',
	EH: 'Western Sahara',
	YE: 'Yemen',
	ZM: 'Zambia',
	ZW: 'Zimbabwe',
};
woocommerce-blocks/assets/js/base/components/country-input/style.scss000064400000000104151335517640022255 0ustar00.wc-block-components-country-input {
	margin-top: em($gap-large);
}
woocommerce-blocks/assets/js/base/components/country-input/CountryInputProps.ts000064400000000556151335517640024312 0ustar00export interface CountryInputProps {
	className?: string;
	label: string;
	id: string;
	autoComplete?: string;
	value: string;
	onChange: ( value: string ) => void;
	required?: boolean;
	errorMessage?: string;
	errorId: null | 'shipping-missing-country';
}

export type CountryInputWithCountriesProps = CountryInputProps & {
	countries: Record< string, string >;
};
woocommerce-blocks/assets/js/base/components/form/index.js000064400000001064151335517640017776 0ustar00/**
 * External dependencies
 */
import classnames from 'classnames';
import PropTypes from 'prop-types';

const Form = ( {
	className,
	children,
	onSubmit = ( event ) => void event,
} ) => {
	const formOnSubmit = ( event ) => {
		event.preventDefault();
		onSubmit( event );
	};

	return (
		<form
			className={ classnames( 'wc-block-components-form', className ) }
			onSubmit={ formOnSubmit }
		>
			{ children }
		</form>
	);
};

Form.propTypes = {
	className: PropTypes.string,
	children: PropTypes.node,
	onSubmit: PropTypes.func,
};

export default Form;
woocommerce-blocks/assets/js/base/components/cart-checkout/shipping-rates-control/index.tsx000064400000013033151335517640026403 0ustar00/**
 * External dependencies
 */
import { __, _n, sprintf } from '@wordpress/i18n';
import { useEffect } from '@wordpress/element';
import { speak } from '@wordpress/a11y';
import LoadingMask from '@woocommerce/base-components/loading-mask';
import { ExperimentalOrderShippingPackages } from '@woocommerce/blocks-checkout';
import {
	getShippingRatesPackageCount,
	getShippingRatesRateCount,
} from '@woocommerce/base-utils';
import { useStoreCart, useEditorContext } from '@woocommerce/base-context';
import { CartResponseShippingRate } from '@woocommerce/type-defs/cart-response';
import { ReactElement } from 'react';

/**
 * Internal dependencies
 */
import ShippingRatesControlPackage, {
	PackageRateRenderOption,
} from '../shipping-rates-control-package';

interface PackagesProps {
	packages: CartResponseShippingRate[];
	collapse?: boolean;
	collapsible?: boolean;
	showItems?: boolean;
	noResultsMessage: ReactElement;
	renderOption: PackageRateRenderOption;
}

/**
 * Renders multiple packages within the slotfill.
 *
 * @param {Object} props Incoming props.
 * @param {Array} props.packages Array of packages.
 * @param {boolean} props.collapsible If the package should be rendered as a
 * @param {ReactElement} props.noResultsMessage Rendered when there are no rates in a package.
 * collapsible panel.
 * @param {boolean} props.collapse If the panel should be collapsed by default,
 * only works if collapsible is true.
 * @param {boolean} props.showItems If we should items below the package name.
 * @param {PackageRateRenderOption} [props.renderOption] Function to render a shipping rate.
 * @return {JSX.Element|null} Rendered components.
 */
const Packages = ( {
	packages,
	collapse,
	showItems,
	collapsible,
	noResultsMessage,
	renderOption,
}: PackagesProps ): JSX.Element | null => {
	// If there are no packages, return nothing.
	if ( ! packages.length ) {
		return null;
	}
	return (
		<>
			{ packages.map( ( { package_id: packageId, ...packageData } ) => (
				<ShippingRatesControlPackage
					key={ packageId }
					packageId={ packageId }
					packageData={ packageData }
					collapsible={ collapsible }
					collapse={ collapse }
					showItems={ showItems }
					noResultsMessage={ noResultsMessage }
					renderOption={ renderOption }
				/>
			) ) }
		</>
	);
};

interface ShippingRatesControlProps {
	collapsible?: boolean;
	shippingRates: CartResponseShippingRate[];
	className?: string;
	shippingRatesLoading: boolean;
	noResultsMessage: ReactElement;
	renderOption: PackageRateRenderOption;
}
/**
 * Renders the shipping rates control element.
 *
 * @param {Object} props Incoming props.
 * @param {Array} props.shippingRates Array of packages containing shipping rates.
 * @param {boolean} props.shippingRatesLoading True when rates are being loaded.
 * @param {string} props.className Class name for package rates.
 * @param {boolean} [props.collapsible] If true, when multiple packages are rendered they can be toggled open and closed.
 * @param {ReactElement} props.noResultsMessage Rendered when there are no packages.
 * @param {Function} [props.renderOption] Function to render a shipping rate.
 */
const ShippingRatesControl = ( {
	shippingRates,
	shippingRatesLoading,
	className,
	collapsible = false,
	noResultsMessage,
	renderOption,
}: ShippingRatesControlProps ): JSX.Element => {
	useEffect( () => {
		if ( shippingRatesLoading ) {
			return;
		}
		const packageCount = getShippingRatesPackageCount( shippingRates );
		const shippingOptions = getShippingRatesRateCount( shippingRates );
		if ( packageCount === 1 ) {
			speak(
				sprintf(
					/* translators: %d number of shipping options found. */
					_n(
						'%d shipping option was found.',
						'%d shipping options were found.',
						shippingOptions,
						'woo-gutenberg-products-block'
					),
					shippingOptions
				)
			);
		} else {
			speak(
				sprintf(
					/* translators: %d number of shipping packages packages. */
					_n(
						'Shipping option searched for %d package.',
						'Shipping options searched for %d packages.',
						packageCount,
						'woo-gutenberg-products-block'
					),
					packageCount
				) +
					' ' +
					sprintf(
						/* translators: %d number of shipping options available. */
						_n(
							'%d shipping option was found',
							'%d shipping options were found',
							shippingOptions,
							'woo-gutenberg-products-block'
						),
						shippingOptions
					)
			);
		}
	}, [ shippingRatesLoading, shippingRates ] );

	// Prepare props to pass to the ExperimentalOrderShippingPackages slot fill.
	// We need to pluck out receiveCart.
	// eslint-disable-next-line no-unused-vars
	const { extensions, receiveCart, ...cart } = useStoreCart();
	const slotFillProps = {
		className,
		collapsible,
		noResultsMessage,
		renderOption,
		extensions,
		cart,
		components: {
			ShippingRatesControlPackage,
		},
	};
	const { isEditor } = useEditorContext();

	return (
		<LoadingMask
			isLoading={ shippingRatesLoading }
			screenReaderLabel={ __(
				'Loading shipping rates…',
				'woo-gutenberg-products-block'
			) }
			showSpinner={ true }
		>
			{ isEditor ? (
				<Packages
					packages={ shippingRates }
					noResultsMessage={ noResultsMessage }
					renderOption={ renderOption }
				/>
			) : (
				<>
					<ExperimentalOrderShippingPackages.Slot
						{ ...slotFillProps }
					/>
					<ExperimentalOrderShippingPackages>
						<Packages
							packages={ shippingRates }
							noResultsMessage={ noResultsMessage }
							renderOption={ renderOption }
						/>
					</ExperimentalOrderShippingPackages>
				</>
			) }
		</LoadingMask>
	);
};

export default ShippingRatesControl;
woocommerce-blocks/assets/js/base/components/cart-checkout/return-to-cart-button/style.scss000064400000000404151335517640026353 0ustar00.wc-block-components-checkout-return-to-cart-button {
	box-shadow: none;
	color: inherit;
	padding-left: calc(24px + 0.25em);
	position: relative;
	text-decoration: none;

	svg {
		left: 0;
		position: absolute;
		transform: translateY(-50%);
		top: 50%;
	}
}
woocommerce-blocks/assets/js/base/components/cart-checkout/return-to-cart-button/index.js000064400000001022151335517640025760 0ustar00/**
 * External dependencies
 */
import { __ } from '@wordpress/i18n';
import { CART_URL } from '@woocommerce/block-settings';
import { Icon, arrowBack } from '@woocommerce/icons';

/**
 * Internal dependencies
 */
import './style.scss';

const ReturnToCartButton = ( { link } ) => {
	return (
		<a
			href={ link || CART_URL }
			className="wc-block-components-checkout-return-to-cart-button"
		>
			<Icon srcElement={ arrowBack } />
			{ __( 'Return to Cart', 'woocommerce' ) }
		</a>
	);
};

export default ReturnToCartButton;
woocommerce-blocks/assets/js/base/components/cart-checkout/address-form/index.ts000064400000000071151335517640024164 0ustar00export { default as AddressForm } from './address-form';
woocommerce-blocks/assets/js/base/components/cart-checkout/address-form/prepare-address-fields.ts000064400000010113151335517640027400 0ustar00/** @typedef { import('@woocommerce/type-defs/address-fields').CountryAddressFields } CountryAddressFields */

/**
 * External dependencies
 */
import {
	AddressField,
	AddressFields,
	CountryAddressFields,
	defaultAddressFields,
	getSetting,
	KeyedAddressField,
	LocaleSpecificAddressField,
} from '@woocommerce/settings';
import { __, sprintf } from '@wordpress/i18n';
import { isNumber, isString } from '@woocommerce/types';

/**
 * This is locale data from WooCommerce countries class. This doesn't match the shape of the new field data blocks uses,
 * but we can import part of it to set which fields are required.
 *
 * This supports new properties such as optionalLabel which are not used by core (yet).
 */
const coreLocale = getSetting< CountryAddressFields >( 'countryLocale', {} );

/**
 * Gets props from the core locale, then maps them to the shape we require in the client.
 *
 * Ignores "class", "type", "placeholder", and "autocomplete" props from core.
 *
 * @param {Object} localeField Locale fields from WooCommerce.
 * @return {Object} Supported locale fields.
 */
const getSupportedCoreLocaleProps = (
	localeField: LocaleSpecificAddressField
): Partial< AddressField > => {
	const fields: Partial< AddressField > = {};

	if ( localeField.label !== undefined ) {
		fields.label = localeField.label;
	}

	if ( localeField.required !== undefined ) {
		fields.required = localeField.required;
	}

	if ( localeField.hidden !== undefined ) {
		fields.hidden = localeField.hidden;
	}

	if ( localeField.label !== undefined && ! localeField.optionalLabel ) {
		fields.optionalLabel = sprintf(
			/* translators: %s Field label. */
			__( '%s (optional)', 'woo-gutenberg-products-block' ),
			localeField.label
		);
	}

	if ( localeField.priority ) {
		if ( isNumber( localeField.priority ) ) {
			fields.index = localeField.priority;
		}
		if ( isString( localeField.priority ) ) {
			fields.index = parseInt( localeField.priority, 10 );
		}
	}

	if ( localeField.hidden ) {
		fields.required = false;
	}

	return fields;
};

const countryAddressFields: CountryAddressFields = Object.entries( coreLocale )
	.map( ( [ country, countryLocale ] ) => [
		country,
		Object.entries( countryLocale )
			.map( ( [ localeFieldKey, localeField ] ) => [
				localeFieldKey,
				getSupportedCoreLocaleProps( localeField ),
			] )
			.reduce( ( obj, [ key, val ] ) => {
				// eslint-disable-next-line @typescript-eslint/ban-ts-comment
				// @ts-ignore - Ignoring because it should be fine as long as the data from the server is correct. TS won't catch it anyway if it's not.
				obj[ key ] = val;
				return obj;
			}, {} ),
	] )
	.reduce( ( obj, [ key, val ] ) => {
		// eslint-disable-next-line @typescript-eslint/ban-ts-comment
		// @ts-ignore - Ignoring because it should be fine as long as the data from the server is correct. TS won't catch it anyway if it's not.
		obj[ key ] = val;
		return obj;
	}, {} );

/**
 * Combines address fields, including fields from the locale, and sorts them by index.
 *
 * @param {Array} fields List of field keys--only address fields matching these will be returned.
 * @param {Object} fieldConfigs Fields config contains field specific overrides at block level which may, for example, hide a field.
 * @param {string} addressCountry Address country code. If unknown, locale fields will not be merged.
 * @return {CountryAddressFields} Object containing address fields.
 */
const prepareAddressFields = (
	fields: ( keyof AddressFields )[],
	fieldConfigs: Record< string, Partial< AddressField > >,
	addressCountry = ''
): KeyedAddressField[] => {
	const localeConfigs: AddressFields =
		addressCountry && countryAddressFields[ addressCountry ] !== undefined
			? countryAddressFields[ addressCountry ]
			: ( {} as AddressFields );

	return fields
		.map( ( field ) => {
			const defaultConfig = defaultAddressFields[ field ] || {};
			const localeConfig = localeConfigs[ field ] || {};
			const fieldConfig = fieldConfigs[ field ] || {};

			return {
				key: field,
				...defaultConfig,
				...localeConfig,
				...fieldConfig,
			};
		} )
		.sort( ( a, b ) => a.index - b.index );
};

export default prepareAddressFields;
woocommerce-blocks/assets/js/base/components/cart-checkout/address-form/test/index.js000064400000011310151335517640025127 0ustar00/**
 * External dependencies
 */
import { render, screen } from '@testing-library/react';
import userEvent from '@testing-library/user-event';
import { CheckoutProvider } from '@woocommerce/base-context';
import { useCheckoutAddress } from '@woocommerce/base-context/hooks';

/**
 * Internal dependencies
 */
import AddressForm from '../address-form';

const renderInCheckoutProvider = ( ui, options = {} ) => {
	const Wrapper = ( { children } ) => {
		return <CheckoutProvider>{ children }</CheckoutProvider>;
	};
	return render( ui, { wrapper: Wrapper, ...options } );
};

// Countries used in testing addresses must be in the wcSettings global.
// See: tests/js/setup-globals.js
const primaryAddress = {
	country: 'United Kingdom',
	countryKey: 'GB',
	city: 'London',
	state: 'Greater London',
	postcode: 'ABCD',
};
const secondaryAddress = {
	country: 'Austria', // We use Austria because it doesn't have states.
	countryKey: 'AU',
	city: 'Vienna',
	postcode: 'DCBA',
};
const tertiaryAddress = {
	country: 'Canada', // We use Canada because it has a select for the state.
	countryKey: 'CA',
	city: 'Toronto',
	state: 'Ontario',
	postcode: 'EFGH',
};

const countryRegExp = /country/i;
const cityRegExp = /city/i;
const stateRegExp = /county|province|state/i;
const postalCodeRegExp = /postal code|postcode|zip/i;

const inputAddress = async ( {
	country = null,
	city = null,
	state = null,
	postcode = null,
} ) => {
	if ( country ) {
		const countryInput = screen.getByLabelText( countryRegExp );
		userEvent.type( countryInput, country + '{arrowdown}{enter}' );
	}
	if ( city ) {
		const cityInput = screen.getByLabelText( cityRegExp );
		userEvent.type( cityInput, city );
	}
	if ( state ) {
		const stateButton = screen.queryByRole( 'combobox', {
			name: stateRegExp,
		} );
		// State input might be a select or a text input.
		if ( stateButton ) {
			userEvent.click( stateButton );
			userEvent.click( screen.getByRole( 'option', { name: state } ) );
		} else {
			const stateInput = screen.getByLabelText( stateRegExp );
			userEvent.type( stateInput, state );
		}
	}
	if ( postcode ) {
		const postcodeInput = screen.getByLabelText( postalCodeRegExp );
		userEvent.type( postcodeInput, postcode );
	}
};

describe( 'AddressForm Component', () => {
	const WrappedAddressForm = ( { type } ) => {
		const {
			defaultAddressFields,
			setShippingFields,
			shippingFields,
		} = useCheckoutAddress();

		return (
			<AddressForm
				type={ type }
				onChange={ setShippingFields }
				values={ shippingFields }
				fields={ Object.keys( defaultAddressFields ) }
			/>
		);
	};
	const ShippingFields = () => {
		const { shippingFields } = useCheckoutAddress();

		return (
			<ul>
				{ Object.keys( shippingFields ).map( ( key ) => (
					<li key={ key }>{ key + ': ' + shippingFields[ key ] }</li>
				) ) }
			</ul>
		);
	};

	it( 'updates context value when interacting with form elements', () => {
		renderInCheckoutProvider(
			<>
				<WrappedAddressForm type="shipping" />
				<ShippingFields />
			</>
		);

		inputAddress( primaryAddress );

		expect( screen.getByText( /country/ ) ).toHaveTextContent(
			`country: ${ primaryAddress.countryKey }`
		);
		expect( screen.getByText( /city/ ) ).toHaveTextContent(
			`city: ${ primaryAddress.city }`
		);
		expect( screen.getByText( /state/ ) ).toHaveTextContent(
			`state: ${ primaryAddress.state }`
		);
		expect( screen.getByText( /postcode/ ) ).toHaveTextContent(
			`postcode: ${ primaryAddress.postcode }`
		);
	} );

	it( 'input fields update when changing the country', () => {
		renderInCheckoutProvider( <WrappedAddressForm type="shipping" /> );

		inputAddress( primaryAddress );

		// Verify correct labels are used.
		expect( screen.getByLabelText( /City/ ) ).toBeInTheDocument();
		expect( screen.getByLabelText( /County/ ) ).toBeInTheDocument();
		expect( screen.getByLabelText( /Postcode/ ) ).toBeInTheDocument();

		inputAddress( secondaryAddress );

		// Verify state input has been removed.
		expect( screen.queryByText( stateRegExp ) ).not.toBeInTheDocument();

		inputAddress( tertiaryAddress );

		// Verify postal code input label changed.
		expect( screen.getByLabelText( /Postal code/ ) ).toBeInTheDocument();
	} );

	it( 'input values are reset after changing the country', () => {
		renderInCheckoutProvider( <WrappedAddressForm type="shipping" /> );

		inputAddress( secondaryAddress );
		// Only update `country` to verify other values are reset.
		inputAddress( { country: primaryAddress.country } );
		expect( screen.getByLabelText( stateRegExp ).value ).toBe( '' );

		// Repeat the test with an address which has a select for the state.
		inputAddress( tertiaryAddress );
		inputAddress( { country: primaryAddress.country } );
		expect( screen.getByLabelText( stateRegExp ).value ).toBe( '' );
	} );
} );
woocommerce-blocks/assets/js/base/components/cart-checkout/address-form/address-form.tsx000064400000014367151335517640025650 0ustar00/**
 * External dependencies
 */
import PropTypes from 'prop-types';
import { ValidatedTextInput } from '@woocommerce/base-components/text-input';
import {
	BillingCountryInput,
	ShippingCountryInput,
} from '@woocommerce/base-components/country-input';
import {
	BillingStateInput,
	ShippingStateInput,
} from '@woocommerce/base-components/state-input';
import { useValidationContext } from '@woocommerce/base-context';
import { useEffect, useMemo } from '@wordpress/element';
import { __ } from '@wordpress/i18n';
import { withInstanceId } from '@wordpress/compose';
import { useShallowEqual } from '@woocommerce/base-hooks';
import {
	AddressField,
	AddressFields,
	AddressType,
	defaultAddressFields,
	EnteredAddress,
} from '@woocommerce/settings';

/**
 * Internal dependencies
 */
import prepareAddressFields from './prepare-address-fields';

// If it's the shipping address form and the user starts entering address
// values without having set the country first, show an error.
const validateShippingCountry = (
	values: EnteredAddress,
	setValidationErrors: ( errors: Record< string, unknown > ) => void,
	clearValidationError: ( error: string ) => void,
	hasValidationError: boolean
): void => {
	if (
		! hasValidationError &&
		! values.country &&
		( values.city || values.state || values.postcode )
	) {
		setValidationErrors( {
			'shipping-missing-country': {
				message: __(
					'Please select a country to calculate rates.',
					'woo-gutenberg-products-block'
				),
				hidden: false,
			},
		} );
	}
	if ( hasValidationError && values.country ) {
		clearValidationError( 'shipping-missing-country' );
	}
};

interface AddressFormProps {
	id: string;
	instanceId: string;
	fields: ( keyof AddressFields )[];
	fieldConfig: Record< keyof AddressFields, Partial< AddressField > >;
	onChange: ( newValue: EnteredAddress ) => void;
	type: AddressType;
	values: EnteredAddress;
}
/**
 * Checkout address form.
 *
 * @param {Object} props Incoming props for component.
 * @param {string} props.id Id for component.
 * @param {Array}  props.fields Array of fields in form.
 * @param {Object} props.fieldConfig Field configuration for fields in form.
 * @param {string} props.instanceId Unique id for form.
 * @param {function(any):any} props.onChange Function to all for an form onChange event.
 * @param {string} props.type Type of form.
 * @param {Object} props.values Values for fields.
 */
const AddressForm = ( {
	id,
	fields = ( Object.keys(
		defaultAddressFields
	) as unknown ) as ( keyof AddressFields )[],
	fieldConfig = {} as Record< keyof AddressFields, Partial< AddressField > >,
	instanceId,
	onChange,
	type = 'shipping',
	values,
}: AddressFormProps ): JSX.Element => {
	const {
		getValidationError,
		setValidationErrors,
		clearValidationError,
	} = useValidationContext();

	const currentFields = useShallowEqual( fields );

	const countryValidationError = ( getValidationError(
		'shipping-missing-country'
	) || {} ) as {
		message: string;
		hidden: boolean;
	};

	const addressFormFields = useMemo( () => {
		return prepareAddressFields(
			currentFields,
			fieldConfig,
			values.country
		);
	}, [ currentFields, fieldConfig, values.country ] );

	// Clear values for hidden fields.
	useEffect( () => {
		addressFormFields.forEach( ( field ) => {
			if ( field.hidden && values[ field.key ] ) {
				onChange( {
					...values,
					[ field.key ]: '',
				} );
			}
		} );
	}, [ addressFormFields, onChange, values ] );

	useEffect( () => {
		if ( type === 'shipping' ) {
			validateShippingCountry(
				values,
				setValidationErrors,
				clearValidationError,
				!! countryValidationError.message &&
					! countryValidationError.hidden
			);
		}
	}, [
		values,
		countryValidationError.message,
		countryValidationError.hidden,
		setValidationErrors,
		clearValidationError,
		type,
	] );

	id = id || instanceId;

	return (
		<div id={ id } className="wc-block-components-address-form">
			{ addressFormFields.map( ( field ) => {
				if ( field.hidden ) {
					return null;
				}

				if ( field.key === 'country' ) {
					const Tag =
						type === 'shipping'
							? ShippingCountryInput
							: BillingCountryInput;
					return (
						<Tag
							key={ field.key }
							id={ `${ id }-${ field.key }` }
							label={
								field.required
									? field.label
									: field.optionalLabel
							}
							value={ values.country }
							autoComplete={ field.autocomplete }
							onChange={ ( newValue ) =>
								onChange( {
									...values,
									country: newValue,
									state: '',
								} )
							}
							errorId={
								type === 'shipping'
									? 'shipping-missing-country'
									: null
							}
							errorMessage={ field.errorMessage }
							required={ field.required }
						/>
					);
				}

				if ( field.key === 'state' ) {
					const Tag =
						type === 'shipping'
							? ShippingStateInput
							: BillingStateInput;
					return (
						<Tag
							key={ field.key }
							id={ `${ id }-${ field.key }` }
							country={ values.country }
							label={
								field.required
									? field.label
									: field.optionalLabel
							}
							value={ values.state }
							autoComplete={ field.autocomplete }
							onChange={ ( newValue ) =>
								onChange( {
									...values,
									state: newValue,
								} )
							}
							errorMessage={ field.errorMessage }
							required={ field.required }
						/>
					);
				}

				return (
					<ValidatedTextInput
						key={ field.key }
						id={ `${ id }-${ field.key }` }
						className={ `wc-block-components-address-form__${ field.key }` }
						label={
							field.required ? field.label : field.optionalLabel
						}
						value={ values[ field.key ] }
						autoCapitalize={ field.autocapitalize }
						autoComplete={ field.autocomplete }
						onChange={ ( newValue: string ) =>
							onChange( {
								...values,
								[ field.key ]: newValue,
							} )
						}
						errorMessage={ field.errorMessage }
						required={ field.required }
					/>
				);
			} ) }
		</div>
	);
};

AddressForm.propTypes = {
	onChange: PropTypes.func.isRequired,
	values: PropTypes.object.isRequired,
	fields: PropTypes.arrayOf(
		PropTypes.oneOf( Object.keys( defaultAddressFields ) )
	),
	fieldConfig: PropTypes.object,
	type: PropTypes.oneOf( [ 'billing', 'shipping' ] ),
};

export default withInstanceId( AddressForm );
woocommerce-blocks/assets/js/base/components/cart-checkout/order-summary/style.scss000064400000003503151335517640024765 0ustar00.wc-block-components-order-summary {

	.wc-block-components-panel__button {
		padding-top: 0;
		margin-top: 0;
	}

	.wc-block-components-panel__content {
		margin-bottom: 0;
	}
}

.wc-block-components-order-summary__content {
	display: table;
	width: 100%;
}

.wc-block-components-order-summary-item {
	@include with-translucent-border(0 0 1px);
	@include font-size(small);
	display: flex;
	padding-bottom: 1px;
	padding-top: $gap;
	width: 100%;

	&:first-child {
		padding-top: 0;
	}

	&:last-child {
		> div {
			padding-bottom: 0;
		}

		&::after {
			display: none;
		}
	}

	.wc-block-components-product-metadata {
		@include font-size(regular);
	}
}

.wc-block-components-order-summary-item__image,
.wc-block-components-order-summary-item__description {
	display: table-cell;
	vertical-align: top;
}

.wc-block-components-order-summary-item__image {
	width: #{$gap-large * 2};
	padding-bottom: $gap;
	position: relative;

	> img {
		width: #{$gap-large * 2};
		max-width: #{$gap-large * 2};
	}
}

.wc-block-components-order-summary-item__quantity {
	align-items: center;
	background: #fff;
	border: 2px solid;
	border-radius: 1em;
	box-shadow: 0 0 0 2px #fff;
	color: #000;
	display: flex;
	line-height: 1;
	min-height: 20px;
	padding: 0 0.4em;
	position: absolute;
	justify-content: center;
	min-width: 20px;
	right: 0;
	top: 0;
	transform: translate(50%, -50%);
	white-space: nowrap;
	z-index: 1;
}

.wc-block-components-order-summary-item__description {
	padding-left: $gap-large;
	padding-right: $gap-small;
	padding-bottom: $gap;

	p,
	.wc-block-components-product-metadata {
		line-height: 1.375;
		margin-top: #{ ($gap-large - $gap) * 0.5 };
	}
}

.wc-block-components-order-summary-item__total-price {
	font-weight: bold;
	margin-left: auto;
	text-align: right;
}


.wc-block-components-order-summary-item__individual-prices {
	display: block;
}
woocommerce-blocks/assets/js/base/components/cart-checkout/order-summary/test/index.js000064400000001734151335517640025360 0ustar00/**
 * External dependencies
 */
import { render, screen } from '@testing-library/react';
import { previewCart } from '@woocommerce/resource-previews';

/**
 * Internal dependencies
 */
import OrderSummary from '../index';

jest.mock( '@woocommerce/base-context', () => ( {
	...jest.requireActual( '@woocommerce/base-context' ),
	useContainerWidthContext: () => ( {
		isLarge: true,
		hasContainerWidth: true,
	} ),
} ) );

describe( 'Order Summary', () => {
	it( 'renders correct cart line subtotal when currency has 0 decimals', async () => {
		render(
			<OrderSummary
				cartItems={ [
					{
						...previewCart.items[ 0 ],
						totals: {
							...previewCart.items[ 0 ].totals,
							// Change price format so there are no decimals.
							currency_minor_unit: 0,
							currency_prefix: '',
							currency_suffix: '€',
							line_subtotal: '16',
							line_total: '18',
						},
					},
				] }
			/>
		);

		expect( screen.getByText( '16€' ) ).toBeTruthy();
	} );
} );
woocommerce-blocks/assets/js/base/components/cart-checkout/order-summary/index.js000064400000002262151335517640024376 0ustar00/**
 * External dependencies
 */
import { __ } from '@wordpress/i18n';
import PropTypes from 'prop-types';
import { useContainerWidthContext } from '@woocommerce/base-context';
import { Panel } from '@woocommerce/blocks-checkout';

/**
 * Internal dependencies
 */
import OrderSummaryItem from './order-summary-item.js';
import './style.scss';

const OrderSummary = ( { cartItems = [] } ) => {
	const { isLarge, hasContainerWidth } = useContainerWidthContext();

	if ( ! hasContainerWidth ) {
		return null;
	}

	return (
		<Panel
			className="wc-block-components-order-summary"
			initialOpen={ isLarge }
			hasBorder={ false }
			title={
				<span className="wc-block-components-order-summary__button-text">
					{ __( 'Order summary', 'woocommerce' ) }
				</span>
			}
			titleTag="h2"
		>
			<div className="wc-block-components-order-summary__content">
				{ cartItems.map( ( cartItem ) => {
					return (
						<OrderSummaryItem
							key={ cartItem.key }
							cartItem={ cartItem }
						/>
					);
				} ) }
			</div>
		</Panel>
	);
};

OrderSummary.propTypes = {
	cartItems: PropTypes.arrayOf(
		PropTypes.shape( { key: PropTypes.string.isRequired } )
	),
};

export default OrderSummary;
woocommerce-blocks/assets/js/base/components/cart-checkout/order-summary/order-summary-item.js000064400000013305151335517640027031 0ustar00/**
 * External dependencies
 */
import { sprintf, _n } from '@wordpress/i18n';
import Label from '@woocommerce/base-components/label';
import ProductPrice from '@woocommerce/base-components/product-price';
import ProductName from '@woocommerce/base-components/product-name';
import {
	getCurrencyFromPriceResponse,
	formatPrice,
} from '@woocommerce/price-format';
import {
	__experimentalApplyCheckoutFilter,
	mustContain,
} from '@woocommerce/blocks-checkout';
import PropTypes from 'prop-types';
import Dinero from 'dinero.js';
import { getSetting } from '@woocommerce/settings';
import { useMemo } from '@wordpress/element';
import { useStoreCart } from '@woocommerce/base-context/hooks';

/**
 * Internal dependencies
 */
import ProductBackorderBadge from '../product-backorder-badge';
import ProductImage from '../product-image';
import ProductLowStockBadge from '../product-low-stock-badge';
import ProductMetadata from '../product-metadata';

const productPriceValidation = ( value ) => mustContain( value, '<price/>' );

const OrderSummaryItem = ( { cartItem } ) => {
	const {
		images,
		low_stock_remaining: lowStockRemaining,
		show_backorder_badge: showBackorderBadge,
		name: initialName,
		permalink,
		prices,
		quantity,
		short_description: shortDescription,
		description: fullDescription,
		item_data: itemData,
		variation,
		totals,
		extensions,
	} = cartItem;

	// Prepare props to pass to the __experimentalApplyCheckoutFilter filter.
	// We need to pluck out receiveCart.
	// eslint-disable-next-line no-unused-vars
	const { receiveCart, ...cart } = useStoreCart();

	const arg = useMemo(
		() => ( {
			context: 'summary',
			cartItem,
			cart,
		} ),
		[ cartItem, cart ]
	);

	const priceCurrency = getCurrencyFromPriceResponse( prices );

	const name = __experimentalApplyCheckoutFilter( {
		filterName: 'itemName',
		defaultValue: initialName,
		extensions,
		arg,
	} );

	const regularPriceSingle = Dinero( {
		amount: parseInt( prices.raw_prices.regular_price, 10 ),
		precision: parseInt( prices.raw_prices.precision, 10 ),
	} )
		.convertPrecision( priceCurrency.minorUnit )
		.getAmount();
	const priceSingle = Dinero( {
		amount: parseInt( prices.raw_prices.price, 10 ),
		precision: parseInt( prices.raw_prices.precision, 10 ),
	} )
		.convertPrecision( priceCurrency.minorUnit )
		.getAmount();
	const totalsCurrency = getCurrencyFromPriceResponse( totals );

	let lineSubtotal = parseInt( totals.line_subtotal, 10 );
	if ( getSetting( 'displayCartPricesIncludingTax', false ) ) {
		lineSubtotal += parseInt( totals.line_subtotal_tax, 10 );
	}
	const subtotalPrice = Dinero( {
		amount: lineSubtotal,
		precision: totalsCurrency.minorUnit,
	} ).getAmount();
	const subtotalPriceFormat = __experimentalApplyCheckoutFilter( {
		filterName: 'subtotalPriceFormat',
		defaultValue: '<price/>',
		extensions,
		arg,
		validation: productPriceValidation,
	} );

	// Allow extensions to filter how the price is displayed. Ie: prepending or appending some values.
	const productPriceFormat = __experimentalApplyCheckoutFilter( {
		filterName: 'cartItemPrice',
		defaultValue: '<price/>',
		extensions,
		arg,
		validation: productPriceValidation,
	} );

	return (
		<div className="wc-block-components-order-summary-item">
			<div className="wc-block-components-order-summary-item__image">
				<div className="wc-block-components-order-summary-item__quantity">
					<Label
						label={ quantity }
						screenReaderLabel={ sprintf(
							/* translators: %d number of products of the same type in the cart */
							_n(
								'%d item',
								'%d items',
								quantity,
								'woocommerce'
							),
							quantity
						) }
					/>
				</div>
				<ProductImage image={ images.length ? images[ 0 ] : {} } />
			</div>
			<div className="wc-block-components-order-summary-item__description">
				<ProductName
					disabled={ true }
					name={ name }
					permalink={ permalink }
				/>
				<ProductPrice
					currency={ priceCurrency }
					price={ priceSingle }
					regularPrice={ regularPriceSingle }
					className="wc-block-components-order-summary-item__individual-prices"
					priceClassName="wc-block-components-order-summary-item__individual-price"
					regularPriceClassName="wc-block-components-order-summary-item__regular-individual-price"
					format={ subtotalPriceFormat }
				/>
				{ showBackorderBadge ? (
					<ProductBackorderBadge />
				) : (
					!! lowStockRemaining && (
						<ProductLowStockBadge
							lowStockRemaining={ lowStockRemaining }
						/>
					)
				) }
				<ProductMetadata
					shortDescription={ shortDescription }
					fullDescription={ fullDescription }
					itemData={ itemData }
					variation={ variation }
				/>
			</div>
			<span className="screen-reader-text">
				{ sprintf(
					/* translators: %1$d is the number of items, %2$s is the item name and %3$s is the total price including the currency symbol. */
					_n(
						'Total price for %1$d %2$s item: %3$s',
						'Total price for %1$d %2$s items: %3$s',
						quantity,
						'woocommerce'
					),
					quantity,
					name,
					formatPrice( subtotalPrice, totalsCurrency )
				) }
			</span>
			<div
				className="wc-block-components-order-summary-item__total-price"
				aria-hidden="true"
			>
				<ProductPrice
					currency={ totalsCurrency }
					format={ productPriceFormat }
					price={ subtotalPrice }
				/>
			</div>
		</div>
	);
};

OrderSummaryItem.propTypes = {
	cartItems: PropTypes.shape( {
		images: PropTypes.array,
		low_stock_remaining: PropTypes.number,
		name: PropTypes.string.isRequired,
		permalink: PropTypes.string,
		prices: PropTypes.shape( {
			price: PropTypes.string,
			regular_price: PropTypes.string,
		} ),
		quantity: PropTypes.number,
		summary: PropTypes.string,
		variation: PropTypes.array,
	} ),
};

export default OrderSummaryItem;
assets/js/base/components/cart-checkout/shipping-rates-control-package/package-rates.tsx000064400000003000151335517640031306 0ustar00woocommerce-blocks/**
 * External dependencies
 */
import RadioControl, {
	RadioControlOptionLayout,
} from '@woocommerce/base-components/radio-control';
import type { PackageRateOption } from '@woocommerce/type-defs/shipping';
import type { ReactElement } from 'react';
import type { CartShippingPackageShippingRate } from '@woocommerce/type-defs/cart';

/**
 * Internal dependencies
 */
import { renderPackageRateOption } from './render-package-rate-option';

interface PackageRates {
	onSelectRate: ( selectedRateId: string ) => void;
	rates: CartShippingPackageShippingRate[];
	renderOption?: (
		option: CartShippingPackageShippingRate
	) => PackageRateOption;
	className?: string;
	noResultsMessage: ReactElement;
	selected?: string;
}

const PackageRates = ( {
	className,
	noResultsMessage,
	onSelectRate,
	rates,
	renderOption = renderPackageRateOption,
	selected,
}: PackageRates ): ReactElement => {
	if ( rates.length === 0 ) {
		return noResultsMessage;
	}

	if ( rates.length > 1 ) {
		return (
			<RadioControl
				className={ className }
				onChange={ ( selectedRateId: string ) => {
					onSelectRate( selectedRateId );
				} }
				selected={ selected }
				options={ rates.map( renderOption ) }
			/>
		);
	}

	const {
		label,
		secondaryLabel,
		description,
		secondaryDescription,
	} = renderOption( rates[ 0 ] );

	return (
		<RadioControlOptionLayout
			label={ label }
			secondaryLabel={ secondaryLabel }
			description={ description }
			secondaryDescription={ secondaryDescription }
		/>
	);
};

export default PackageRates;
woocommerce-blocks/assets/js/base/components/cart-checkout/shipping-rates-control-package/style.scss000064400000002103151335517640030156 0ustar00.wc-block-components-shipping-rates-control__package {
	.wc-block-components-panel__button {
		margin-bottom: 0;
		margin-top: 0;
		padding-bottom: em($gap-small);
		padding-top: em($gap-small);
	}

	// Remove panel padding because we are adding bottom padding to `.wc-block-components-radio-control`
	// and `.wc-block-components-radio-control__option-layout` in the next ruleset.
	.wc-block-components-panel__content {
		padding-bottom: 0;
	}

	.wc-block-components-radio-control,
	.wc-block-components-radio-control__option-layout {
		padding-bottom: 0;
	}

	.wc-block-components-radio-control .wc-block-components-radio-control__option-layout {
		padding-bottom: 0;
	}
}

.wc-block-components-shipping-rates-control__package-items {
	@include font-size(small);
	display: block;
	list-style: none;
	margin: 0;
	padding: 0;
}

.wc-block-components-shipping-rates-control__package-item {
	@include wrap-break-word();
	display: inline-block;
	margin: 0;
	padding: 0;
}

.wc-block-components-shipping-rates-control__package-item:not(:last-child)::after {
	content: ", ";
	white-space: pre;
}
woocommerce-blocks/assets/js/base/components/cart-checkout/shipping-rates-control-package/index.tsx000064400000007056151335517640030004 0ustar00/**
 * External dependencies
 */
import classNames from 'classnames';
import { _n, sprintf } from '@wordpress/i18n';
import { decodeEntities } from '@wordpress/html-entities';
import type { ReactElement } from 'react';
import type { PackageRateOption } from '@woocommerce/type-defs/shipping';
import { Panel } from '@woocommerce/blocks-checkout';
import Label from '@woocommerce/base-components/label';
import { useSelectShippingRate } from '@woocommerce/base-context/hooks';
import type { CartShippingPackageShippingRate } from '@woocommerce/type-defs/cart';

/**
 * Internal dependencies
 */
import PackageRates from './package-rates';
import './style.scss';

interface PackageItem {
	name: string;
	key: string;
	quantity: number;
}

interface Destination {
	address_1: string;
	address_2: string;
	city: string;
	state: string;
	postcode: string;
	country: string;
}

export interface PackageData {
	destination: Destination;
	name: string;
	shipping_rates: CartShippingPackageShippingRate[];
	items: PackageItem[];
}

export type PackageRateRenderOption = (
	option: CartShippingPackageShippingRate
) => PackageRateOption;

interface PackageProps {
	/* PackageId can be a string, WooCommerce Subscriptions uses strings for example, but WooCommerce core uses numbers */
	packageId: string | number;
	renderOption: PackageRateRenderOption;
	collapse?: boolean;
	packageData: PackageData;
	className?: string;
	collapsible?: boolean;
	noResultsMessage: ReactElement;
	showItems?: boolean;
}

export const ShippingRatesControlPackage = ( {
	packageId,
	className,
	noResultsMessage,
	renderOption,
	packageData,
	collapsible = false,
	collapse = false,
	showItems = false,
}: PackageProps ): ReactElement => {
	const { selectShippingRate, selectedShippingRate } = useSelectShippingRate(
		packageId,
		packageData.shipping_rates
	);

	const header = (
		<>
			{ ( showItems || collapsible ) && (
				<div className="wc-block-components-shipping-rates-control__package-title">
					{ packageData.name }
				</div>
			) }
			{ showItems && (
				<ul className="wc-block-components-shipping-rates-control__package-items">
					{ Object.values( packageData.items ).map( ( v ) => {
						const name = decodeEntities( v.name );
						const quantity = v.quantity;
						return (
							<li
								key={ v.key }
								className="wc-block-components-shipping-rates-control__package-item"
							>
								<Label
									label={
										quantity > 1
											? `${ name } × ${ quantity }`
											: `${ name }`
									}
									screenReaderLabel={ sprintf(
										/* translators: %1$s name of the product (ie: Sunglasses), %2$d number of units in the current cart package */
										_n(
											'%1$s (%2$d unit)',
											'%1$s (%2$d units)',
											quantity,
											'woo-gutenberg-products-block'
										),
										name,
										quantity
									) }
								/>
							</li>
						);
					} ) }
				</ul>
			) }
		</>
	);
	const body = (
		<PackageRates
			className={ className }
			noResultsMessage={ noResultsMessage }
			rates={ packageData.shipping_rates }
			onSelectRate={ selectShippingRate }
			selected={ selectedShippingRate }
			renderOption={ renderOption }
		/>
	);
	if ( collapsible ) {
		return (
			<Panel
				className="wc-block-components-shipping-rates-control__package"
				initialOpen={ ! collapse }
				title={ header }
			>
				{ body }
			</Panel>
		);
	}
	return (
		<div
			className={ classNames(
				'wc-block-components-shipping-rates-control__package',
				className
			) }
		>
			{ header }
			{ body }
		</div>
	);
};

export default ShippingRatesControlPackage;
js/base/components/cart-checkout/shipping-rates-control-package/render-package-rate-option.tsx000064400000002452151335517640033720 0ustar00woocommerce-blocks/assets/**
 * External dependencies
 */
import { decodeEntities } from '@wordpress/html-entities';
import { getCurrencyFromPriceResponse } from '@woocommerce/price-format';
import FormattedMonetaryAmount from '@woocommerce/base-components/formatted-monetary-amount';
import type { PackageRateOption } from '@woocommerce/type-defs/shipping';
import { getSetting } from '@woocommerce/settings';
import { CartShippingPackageShippingRate } from '@woocommerce/type-defs/cart';

/**
 * Default render function for package rate options.
 *
 * @param {Object} rate Rate data.
 */
export const renderPackageRateOption = (
	rate: CartShippingPackageShippingRate
): PackageRateOption => {
	const priceWithTaxes: number = getSetting(
		'displayCartPricesIncludingTax',
		false
	)
		? parseInt( rate.price, 10 ) + parseInt( rate.taxes, 10 )
		: parseInt( rate.price, 10 );

	return {
		label: decodeEntities( rate.name ),
		value: rate.rate_id,
		description: (
			<>
				{ Number.isFinite( priceWithTaxes ) && (
					<FormattedMonetaryAmount
						currency={ getCurrencyFromPriceResponse( rate ) }
						value={ priceWithTaxes }
					/>
				) }
				{ Number.isFinite( priceWithTaxes ) && rate.delivery_time
					? ' — '
					: null }
				{ decodeEntities( rate.delivery_time ) }
			</>
		),
	};
};

export default renderPackageRateOption;
woocommerce-blocks/assets/js/base/components/cart-checkout/payment-method-icons/utils.ts000064400000001617151335517640025702 0ustar00/**
 * External dependencies
 */
import type {
	PaymentMethodIcon,
	PaymentMethodIcons,
} from '@woocommerce/type-defs/payments';
import { isString } from '@woocommerce/types';

/**
 * For an array of icons, normalize into objects and remove duplicates.
 */
export const normalizeIconConfig = (
	icons: PaymentMethodIcons
): PaymentMethodIcon[] => {
	const normalizedIcons: Record< string, PaymentMethodIcon > = {};

	icons.forEach( ( raw ) => {
		let icon: Partial< PaymentMethodIcon > = {};

		if ( typeof raw === 'string' ) {
			icon = {
				id: raw,
				alt: raw,
				src: null,
			};
		}

		if ( typeof raw === 'object' ) {
			icon = {
				id: raw.id || '',
				alt: raw.alt || '',
				src: raw.src || null,
			};
		}

		if ( icon.id && isString( icon.id ) && ! normalizedIcons[ icon.id ] ) {
			normalizedIcons[ icon.id ] = <PaymentMethodIcon>icon;
		}
	} );

	return Object.values( normalizedIcons );
};
woocommerce-blocks/assets/js/base/components/cart-checkout/payment-method-icons/index.tsx000064400000003125151335517640026035 0ustar00/**
 * External dependencies
 */
import classnames from 'classnames';
import type { PaymentMethodIcons as PaymentMethodIconsType } from '@woocommerce/type-defs/payments';

/**
 * Internal dependencies
 */
import PaymentMethodIcon from './payment-method-icon';
import { getCommonIconProps } from './common-icons';
import { normalizeIconConfig } from './utils';
import './style.scss';

interface PaymentMethodIconsProps {
	icons: PaymentMethodIconsType;
	align?: 'left' | 'right' | 'center';
}
/**
 * For a given list of icons, render each as a list item, using common icons
 * where available.
 *
 * @param {Object} props       Component props.
 * @param {Array}  props.icons Array of icons object configs or ids as strings.
 * @param {string} props.align How to align the icon.
 */
export const PaymentMethodIcons = ( {
	icons = [],
	align = 'center',
}: PaymentMethodIconsProps ): JSX.Element | null => {
	const iconConfigs = normalizeIconConfig( icons );

	if ( iconConfigs.length === 0 ) {
		return null;
	}

	const containerClass = classnames(
		'wc-block-components-payment-method-icons',
		{
			'wc-block-components-payment-method-icons--align-left':
				align === 'left',
			'wc-block-components-payment-method-icons--align-right':
				align === 'right',
		}
	);

	return (
		<div className={ containerClass }>
			{ iconConfigs.map( ( icon ) => {
				const iconProps = {
					...icon,
					...getCommonIconProps( icon.id ),
				};
				return (
					<PaymentMethodIcon
						key={ 'payment-method-icon-' + icon.id }
						{ ...iconProps }
					/>
				);
			} ) }
		</div>
	);
};

export default PaymentMethodIcons;
assets/js/base/components/cart-checkout/payment-method-icons/payment-method-icon.tsx000064400000001544151335517640030533 0ustar00woocommerce-blocks/**
 * Get a class name for an icon.
 *
 * @param {string} id Icon ID.
 */
const getIconClassName = ( id: string ): string => {
	return `wc-block-components-payment-method-icon wc-block-components-payment-method-icon--${ id }`;
};

interface PaymentMethodIconProps {
	id: string;
	src?: string | null;
	alt?: string;
}
/**
 * Return an element for an icon.
 *
 * @param {Object}      props     Incoming props for component.
 * @param {string}      props.id  Id for component.
 * @param {string|null} props.src Optional src value for icon.
 * @param {string}      props.alt Optional alt value for icon.
 */
const PaymentMethodIcon = ( {
	id,
	src = null,
	alt = '',
}: PaymentMethodIconProps ): JSX.Element | null => {
	if ( ! src ) {
		return null;
	}
	return <img className={ getIconClassName( id ) } src={ src } alt={ alt } />;
};

export default PaymentMethodIcon;
woocommerce-blocks/assets/js/base/components/cart-checkout/payment-method-icons/common-icons.ts000064400000004654151335517640027147 0ustar00/**
 * External dependencies
 */
import { WC_BLOCKS_IMAGE_URL } from '@woocommerce/block-settings';
import type { PaymentMethodIcon } from '@woocommerce/type-defs/payments';

/**
 * Array of common assets.
 */
export const commonIcons: PaymentMethodIcon[] = [
	{
		id: 'alipay',
		alt: 'Alipay',
		src: WC_BLOCKS_IMAGE_URL + 'payment-methods/alipay.svg',
	},
	{
		id: 'amex',
		alt: 'American Express',
		src: WC_BLOCKS_IMAGE_URL + 'payment-methods/amex.svg',
	},
	{
		id: 'bancontact',
		alt: 'Bancontact',
		src: WC_BLOCKS_IMAGE_URL + 'payment-methods/bancontact.svg',
	},
	{
		id: 'diners',
		alt: 'Diners Club',
		src: WC_BLOCKS_IMAGE_URL + 'payment-methods/diners.svg',
	},
	{
		id: 'discover',
		alt: 'Discover',
		src: WC_BLOCKS_IMAGE_URL + 'payment-methods/discover.svg',
	},
	{
		id: 'eps',
		alt: 'EPS',
		src: WC_BLOCKS_IMAGE_URL + 'payment-methods/eps.svg',
	},
	{
		id: 'giropay',
		alt: 'Giropay',
		src: WC_BLOCKS_IMAGE_URL + 'payment-methods/giropay.svg',
	},
	{
		id: 'ideal',
		alt: 'iDeal',
		src: WC_BLOCKS_IMAGE_URL + 'payment-methods/ideal.svg',
	},
	{
		id: 'jcb',
		alt: 'JCB',
		src: WC_BLOCKS_IMAGE_URL + 'payment-methods/jcb.svg',
	},
	{
		id: 'laser',
		alt: 'Laser',
		src: WC_BLOCKS_IMAGE_URL + 'payment-methods/laser.svg',
	},
	{
		id: 'maestro',
		alt: 'Maestro',
		src: WC_BLOCKS_IMAGE_URL + 'payment-methods/maestro.svg',
	},
	{
		id: 'mastercard',
		alt: 'Mastercard',
		src: WC_BLOCKS_IMAGE_URL + 'payment-methods/mastercard.svg',
	},
	{
		id: 'multibanco',
		alt: 'Multibanco',
		src: WC_BLOCKS_IMAGE_URL + 'payment-methods/multibanco.svg',
	},
	{
		id: 'p24',
		alt: 'Przelewy24',
		src: WC_BLOCKS_IMAGE_URL + 'payment-methods/p24.svg',
	},
	{
		id: 'sepa',
		alt: 'Sepa',
		src: WC_BLOCKS_IMAGE_URL + 'payment-methods/sepa.svg',
	},
	{
		id: 'sofort',
		alt: 'Sofort',
		src: WC_BLOCKS_IMAGE_URL + 'payment-methods/sofort.svg',
	},
	{
		id: 'unionpay',
		alt: 'Union Pay',
		src: WC_BLOCKS_IMAGE_URL + 'payment-methods/unionpay.svg',
	},
	{
		id: 'visa',
		alt: 'Visa',
		src: WC_BLOCKS_IMAGE_URL + 'payment-methods/visa.svg',
	},
	{
		id: 'wechat',
		alt: 'WeChat',
		src: WC_BLOCKS_IMAGE_URL + 'payment-methods/wechat.svg',
	},
];

/**
 * For a given ID, see if a common icon exists and return it's props.
 *
 * @param {string} id Icon ID.
 */
export const getCommonIconProps = (
	id: string
): PaymentMethodIcon | Record< string, unknown > => {
	return (
		commonIcons.find( ( icon ) => {
			return icon.id === id;
		} ) || {}
	);
};
woocommerce-blocks/assets/js/base/components/cart-checkout/payment-method-icons/style.scss000064400000001440151335517640026221 0ustar00.wc-block-components-payment-method-icons {
	margin: 0 0 #{$gap - 2px};
	display: flex;
	flex-direction: row;
	flex-wrap: wrap;
	justify-content: center;

	.wc-block-components-payment-method-icon {
		display: inline-block;
		margin: 0 4px 2px;
		padding: 0;
		width: auto;
		max-width: 38px;
		height: 24px;
		max-height: 24px;
	}

	&--align-left {
		justify-content: flex-start;

		.wc-block-components-payment-method-icon {
			margin-left: 0;
			margin-right: 8px;
		}
	}

	&--align-right {
		justify-content: flex-end;

		.wc-block-components-payment-method-icon {
			margin-right: 0;
			margin-left: 8px;
		}
	}

	&:last-child {
		margin-bottom: 0;
	}
}

.is-mobile,
.is-small {
	.wc-block-components-payment-method-icons {
		.wc-block-components-payment-method-icon {
			height: 16px;
		}
	}
}
woocommerce-blocks/assets/js/base/components/cart-checkout/form-step/index.js000064400000004132151335517640023502 0ustar00/**
 * External dependencies
 */
import classnames from 'classnames';
import PropTypes from 'prop-types';
import Title from '@woocommerce/base-components/title';

/**
 * Internal dependencies
 */
import './style.scss';

const StepHeading = ( { title, stepHeadingContent } ) => (
	<div className="wc-block-components-checkout-step__heading">
		<Title
			aria-hidden="true"
			className="wc-block-components-checkout-step__title"
			headingLevel="2"
		>
			{ title }
		</Title>
		{ !! stepHeadingContent && (
			<span className="wc-block-components-checkout-step__heading-content">
				{ stepHeadingContent }
			</span>
		) }
	</div>
);

const FormStep = ( {
	id,
	className,
	title,
	legend,
	description,
	children,
	disabled = false,
	showStepNumber = true,
	stepHeadingContent = () => {},
} ) => {
	// If the form step doesn't have a legend or title, render a <div> instead
	// of a <fieldset>.
	const Element = legend || title ? 'fieldset' : 'div';

	return (
		<Element
			className={ classnames(
				className,
				'wc-block-components-checkout-step',
				{
					'wc-block-components-checkout-step--with-step-number': showStepNumber,
					'wc-block-components-checkout-step--disabled': disabled,
				}
			) }
			id={ id }
			disabled={ disabled }
		>
			{ !! ( legend || title ) && (
				<legend className="screen-reader-text">
					{ legend || title }
				</legend>
			) }
			{ !! title && (
				<StepHeading
					title={ title }
					stepHeadingContent={ stepHeadingContent() }
				/>
			) }
			<div className="wc-block-components-checkout-step__container">
				{ !! description && (
					<p className="wc-block-components-checkout-step__description">
						{ description }
					</p>
				) }
				<div className="wc-block-components-checkout-step__content">
					{ children }
				</div>
			</div>
		</Element>
	);
};

FormStep.propTypes = {
	id: PropTypes.string,
	className: PropTypes.string,
	title: PropTypes.string,
	description: PropTypes.string,
	children: PropTypes.node,
	showStepNumber: PropTypes.bool,
	stepHeadingContent: PropTypes.func,
	disabled: PropTypes.bool,
	legend: PropTypes.string,
};

export default FormStep;
assets/js/base/components/cart-checkout/form-step/test/__snapshots__/index.js.snap000064400000013545151335517640030170 0ustar00woocommerce-blocks// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`FormStep fieldset legend should default to legend prop when title and legend are defined 1`] = `
<fieldset
  className="wc-block-components-checkout-step wc-block-components-checkout-step--with-step-number"
  disabled={false}
>
  <legend
    className="screen-reader-text"
  >
    Lorem Ipsum 2
  </legend>
  <div
    className="wc-block-components-checkout-step__heading"
  >
    <h2
      aria-hidden="true"
      className="wc-block-components-title wc-block-components-checkout-step__title"
    >
      Lorem Ipsum
    </h2>
  </div>
  <div
    className="wc-block-components-checkout-step__container"
  >
    <div
      className="wc-block-components-checkout-step__content"
    >
      Dolor sit amet
    </div>
  </div>
</fieldset>
`;

exports[`FormStep should apply id and className props 1`] = `
<div
  className="my-classname wc-block-components-checkout-step wc-block-components-checkout-step--with-step-number"
  disabled={false}
  id="my-id"
>
  <div
    className="wc-block-components-checkout-step__container"
  >
    <div
      className="wc-block-components-checkout-step__content"
    >
      Dolor sit amet
    </div>
  </div>
</div>
`;

exports[`FormStep should remove step number CSS class if prop is false 1`] = `
<fieldset
  className="wc-block-components-checkout-step"
  disabled={false}
>
  <legend
    className="screen-reader-text"
  >
    Lorem Ipsum
  </legend>
  <div
    className="wc-block-components-checkout-step__heading"
  >
    <h2
      aria-hidden="true"
      className="wc-block-components-title wc-block-components-checkout-step__title"
    >
      Lorem Ipsum
    </h2>
  </div>
  <div
    className="wc-block-components-checkout-step__container"
  >
    <div
      className="wc-block-components-checkout-step__content"
    >
      Dolor sit amet
    </div>
  </div>
</fieldset>
`;

exports[`FormStep should render a div if no title or legend is provided 1`] = `
<div
  className="wc-block-components-checkout-step wc-block-components-checkout-step--with-step-number"
  disabled={false}
>
  <div
    className="wc-block-components-checkout-step__container"
  >
    <div
      className="wc-block-components-checkout-step__content"
    >
      Dolor sit amet
    </div>
  </div>
</div>
`;

exports[`FormStep should render a fieldset if a legend is provided 1`] = `
<fieldset
  className="wc-block-components-checkout-step wc-block-components-checkout-step--with-step-number"
  disabled={false}
>
  <legend
    className="screen-reader-text"
  >
    Lorem Ipsum 2
  </legend>
  <div
    className="wc-block-components-checkout-step__container"
  >
    <div
      className="wc-block-components-checkout-step__content"
    >
      Dolor sit amet
    </div>
  </div>
</fieldset>
`;

exports[`FormStep should render a fieldset with heading if a title is provided 1`] = `
<fieldset
  className="wc-block-components-checkout-step wc-block-components-checkout-step--with-step-number"
  disabled={false}
>
  <legend
    className="screen-reader-text"
  >
    Lorem Ipsum
  </legend>
  <div
    className="wc-block-components-checkout-step__heading"
  >
    <h2
      aria-hidden="true"
      className="wc-block-components-title wc-block-components-checkout-step__title"
    >
      Lorem Ipsum
    </h2>
  </div>
  <div
    className="wc-block-components-checkout-step__container"
  >
    <div
      className="wc-block-components-checkout-step__content"
    >
      Dolor sit amet
    </div>
  </div>
</fieldset>
`;

exports[`FormStep should render step description 1`] = `
<fieldset
  className="wc-block-components-checkout-step wc-block-components-checkout-step--with-step-number"
  disabled={false}
>
  <legend
    className="screen-reader-text"
  >
    Lorem Ipsum
  </legend>
  <div
    className="wc-block-components-checkout-step__heading"
  >
    <h2
      aria-hidden="true"
      className="wc-block-components-title wc-block-components-checkout-step__title"
    >
      Lorem Ipsum
    </h2>
  </div>
  <div
    className="wc-block-components-checkout-step__container"
  >
    <p
      className="wc-block-components-checkout-step__description"
    >
      This is the description
    </p>
    <div
      className="wc-block-components-checkout-step__content"
    >
      Dolor sit amet
    </div>
  </div>
</fieldset>
`;

exports[`FormStep should render step heading content 1`] = `
<fieldset
  className="wc-block-components-checkout-step wc-block-components-checkout-step--with-step-number"
  disabled={false}
>
  <legend
    className="screen-reader-text"
  >
    Lorem Ipsum
  </legend>
  <div
    className="wc-block-components-checkout-step__heading"
  >
    <h2
      aria-hidden="true"
      className="wc-block-components-title wc-block-components-checkout-step__title"
    >
      Lorem Ipsum
    </h2>
    <span
      className="wc-block-components-checkout-step__heading-content"
    >
      <span>
        Some context to render next to the heading
      </span>
    </span>
  </div>
  <div
    className="wc-block-components-checkout-step__container"
  >
    <div
      className="wc-block-components-checkout-step__content"
    >
      Dolor sit amet
    </div>
  </div>
</fieldset>
`;

exports[`FormStep should set disabled prop to the fieldset element when disabled is true 1`] = `
<fieldset
  className="wc-block-components-checkout-step wc-block-components-checkout-step--with-step-number wc-block-components-checkout-step--disabled"
  disabled={true}
>
  <legend
    className="screen-reader-text"
  >
    Lorem Ipsum
  </legend>
  <div
    className="wc-block-components-checkout-step__heading"
  >
    <h2
      aria-hidden="true"
      className="wc-block-components-title wc-block-components-checkout-step__title"
    >
      Lorem Ipsum
    </h2>
  </div>
  <div
    className="wc-block-components-checkout-step__container"
  >
    <div
      className="wc-block-components-checkout-step__content"
    >
      Dolor sit amet
    </div>
  </div>
</fieldset>
`;
woocommerce-blocks/assets/js/base/components/cart-checkout/form-step/test/index.js000064400000004757151335517640024476 0ustar00/**
 * External dependencies
 */
import TestRenderer from 'react-test-renderer';

/**
 * Internal dependencies
 */
import FormStep from '..';

describe( 'FormStep', () => {
	test( 'should render a div if no title or legend is provided', () => {
		const component = TestRenderer.create(
			<FormStep>Dolor sit amet</FormStep>
		);

		expect( component.toJSON() ).toMatchSnapshot();
	} );

	test( 'should apply id and className props', () => {
		const component = TestRenderer.create(
			<FormStep id="my-id" className="my-classname">
				Dolor sit amet
			</FormStep>
		);

		expect( component.toJSON() ).toMatchSnapshot();
	} );

	test( 'should render a fieldset if a legend is provided', () => {
		const component = TestRenderer.create(
			<FormStep legend="Lorem Ipsum 2">Dolor sit amet</FormStep>
		);

		expect( component.toJSON() ).toMatchSnapshot();
	} );

	test( 'should render a fieldset with heading if a title is provided', () => {
		const component = TestRenderer.create(
			<FormStep title="Lorem Ipsum">Dolor sit amet</FormStep>
		);

		expect( component.toJSON() ).toMatchSnapshot();
	} );

	test( 'fieldset legend should default to legend prop when title and legend are defined', () => {
		const component = TestRenderer.create(
			<FormStep title="Lorem Ipsum" legend="Lorem Ipsum 2">
				Dolor sit amet
			</FormStep>
		);

		expect( component.toJSON() ).toMatchSnapshot();
	} );

	test( 'should remove step number CSS class if prop is false', () => {
		const component = TestRenderer.create(
			<FormStep title="Lorem Ipsum" showStepNumber={ false }>
				Dolor sit amet
			</FormStep>
		);

		expect( component.toJSON() ).toMatchSnapshot();
	} );

	test( 'should render step heading content', () => {
		const component = TestRenderer.create(
			<FormStep
				title="Lorem Ipsum"
				stepHeadingContent={ () => (
					<span>Some context to render next to the heading</span>
				) }
			>
				Dolor sit amet
			</FormStep>
		);

		expect( component.toJSON() ).toMatchSnapshot();
	} );

	test( 'should render step description', () => {
		const component = TestRenderer.create(
			<FormStep title="Lorem Ipsum" description="This is the description">
				Dolor sit amet
			</FormStep>
		);

		expect( component.toJSON() ).toMatchSnapshot();
	} );

	test( 'should set disabled prop to the fieldset element when disabled is true', () => {
		const component = TestRenderer.create(
			<FormStep title="Lorem Ipsum" disabled={ true }>
				Dolor sit amet
			</FormStep>
		);

		expect( component.toJSON() ).toMatchSnapshot();
	} );
} );
woocommerce-blocks/assets/js/base/components/cart-checkout/form-step/style.scss000064400000005323151335517640024075 0ustar00.wc-block-components-form {
	counter-reset: checkout-step;
}

.wc-block-components-form .wc-block-components-checkout-step {
	position: relative;
	border: none;
	padding: 0 0 0 $gap-large;
	background: none;
	margin: 0;

	.is-mobile &,
	.is-small & {
		padding-left: 0;
	}
}

.wc-block-components-checkout-step--disabled {
	opacity: 0.6;
}

.wc-block-components-checkout-step__container {
	position: relative;
}

.wc-block-components-checkout-step__content > * {
	margin-bottom: em($gap);
}
.wc-block-components-checkout-step--with-step-number .wc-block-components-checkout-step__content > :last-child {
	margin-bottom: 0;
	padding-bottom: em($gap-large);
}

.wc-block-components-checkout-step__heading {
	display: flex;
	justify-content: space-between;
	align-content: center;
	flex-wrap: wrap;
	margin: em($gap-small) 0 em($gap);
	position: relative;
	align-items: center;
	gap: em($gap);

	.wc-block-components-express-payment-continue-rule + .wc-block-components-checkout-step & {
		margin-top: 0;
	}
}

.wc-block-components-checkout-step:first-child .wc-block-components-checkout-step__heading {
	margin-top: 0;
}

.wc-block-components-checkout-step__title {
	margin: 0 $gap-small 0 0;
}

.wc-block-components-checkout-step__heading-content {
	@include font-size(smaller);

	a {
		font-weight: bold;
		color: inherit;
	}
}

.wc-block-components-checkout-step__description {
	@include font-size(small);
	line-height: 1.25;
	margin-bottom: $gap;
}

.wc-block-components-checkout-step--with-step-number {
	.wc-block-components-checkout-step__title::before {
		@include reset-box();
		background: transparent;
		counter-increment: checkout-step;
		content: "\00a0" counter(checkout-step) ".";
		content: "\00a0" counter(checkout-step) "." / "";
		position: absolute;
		width: $gap-large;
		left: -$gap-large;
		top: 0;
		text-align: center;
		transform: translateX(-50%);

		.is-mobile &,
		.is-small & {
			position: static;
			transform: none;
			left: auto;
			top: auto;
			content: counter(checkout-step) ".\00a0";
			content: counter(checkout-step) ".\00a0" / "";
		}
	}

	.wc-block-components-checkout-step__container::after {
		content: "";
		height: 100%;
		border-left: 1px solid;
		opacity: 0.3;
		position: absolute;
		left: -$gap-large;
		top: 0;
	}

	.is-mobile &,
	.is-small & {
		.wc-block-components-checkout-step__title::before {
			position: static;
			transform: none;
			left: auto;
			top: auto;
			content: counter(checkout-step) ".\00a0";
			content: counter(checkout-step) ".\00a0" / "";
		}
		.wc-block-components-checkout-step__container::after {
			content: unset;
		}
	}
}

.editor-styles-wrapper {
	.wp-block h4.wc-block-components-checkout-step__title {
		@include font-size(regular);
		line-height: 24px;
		margin: 0 $gap-small 0 0;
	}
}
woocommerce-blocks/assets/js/base/components/cart-checkout/totals/coupon/stories/index.js000064400000002250151335517640026066 0ustar00/**
 * External dependencies
 */
import { text, boolean } from '@storybook/addon-knobs';
import {
	useValidationContext,
	ValidationContextProvider,
} from '@woocommerce/base-context';

/**
 * Internal dependencies
 */
import TotalsCoupon from '../';

export default {
	title:
		'WooCommerce Blocks/@base-components/cart-checkout/totals/TotalsCoupon',
	component: TotalsCoupon,
};

const StoryComponent = ( { validCoupon, isLoading, invalidCouponText } ) => {
	const { setValidationErrors } = useValidationContext();
	const onSubmit = ( coupon ) => {
		if ( coupon !== validCoupon ) {
			setValidationErrors( { coupon: invalidCouponText } );
		}
	};
	return <TotalsCoupon isLoading={ isLoading } onSubmit={ onSubmit } />;
};

export const Default = () => {
	const validCoupon = text( 'A valid coupon code', 'validcoupon' );
	const invalidCouponText = text(
		'Error message for invalid code',
		'Invalid coupon code.'
	);
	const isLoading = boolean( 'Toggle isLoading state', false );
	return (
		<ValidationContextProvider>
			<StoryComponent
				validCoupon={ validCoupon }
				isLoading={ isLoading }
				invalidCouponText={ invalidCouponText }
			/>
		</ValidationContextProvider>
	);
};
woocommerce-blocks/assets/js/base/components/cart-checkout/totals/coupon/index.js000064400000006111151335517640024376 0ustar00/**
 * External dependencies
 */
import { __ } from '@wordpress/i18n';
import { useState, useEffect, useRef } from '@wordpress/element';
import Button from '@woocommerce/base-components/button';
import { ValidatedTextInput } from '@woocommerce/base-components/text-input';
import Label from '@woocommerce/base-components/label';
import LoadingMask from '@woocommerce/base-components/loading-mask';
import PropTypes from 'prop-types';
import { withInstanceId } from '@wordpress/compose';
import {
	ValidationInputError,
	useValidationContext,
} from '@woocommerce/base-context';
import { Panel } from '@woocommerce/blocks-checkout';

/**
 * Internal dependencies
 */
import './style.scss';

const TotalsCoupon = ( {
	instanceId,
	isLoading = false,
	initialOpen = false,
	onSubmit = () => {},
} ) => {
	const [ couponValue, setCouponValue ] = useState( '' );
	const currentIsLoading = useRef( false );
	const { getValidationError, getValidationErrorId } = useValidationContext();
	const validationError = getValidationError( 'coupon' );

	useEffect( () => {
		if ( currentIsLoading.current !== isLoading ) {
			if ( ! isLoading && couponValue && ! validationError ) {
				setCouponValue( '' );
			}
			currentIsLoading.current = isLoading;
		}
	}, [ isLoading, couponValue, validationError ] );

	const textInputId = `wc-block-components-totals-coupon__input-${ instanceId }`;

	return (
		<Panel
			className="wc-block-components-totals-coupon"
			hasBorder={ false }
			initialOpen={ initialOpen }
			title={
				<Label
					label={ __(
						'Coupon code',
						'woocommerce'
					) }
					screenReaderLabel={ __(
						'Apply a coupon code',
						'woocommerce'
					) }
					htmlFor={ textInputId }
				/>
			}
		>
			<LoadingMask
				screenReaderLabel={ __(
					'Applying coupon…',
					'woocommerce'
				) }
				isLoading={ isLoading }
				showSpinner={ false }
			>
				<div className="wc-block-components-totals-coupon__content">
					<form className="wc-block-components-totals-coupon__form">
						<ValidatedTextInput
							id={ textInputId }
							errorId="coupon"
							className="wc-block-components-totals-coupon__input"
							label={ __(
								'Enter code',
								'woocommerce'
							) }
							value={ couponValue }
							ariaDescribedBy={ getValidationErrorId(
								textInputId
							) }
							onChange={ ( newCouponValue ) => {
								setCouponValue( newCouponValue );
							} }
							validateOnMount={ false }
							focusOnMount={ true }
							showError={ false }
						/>
						<Button
							className="wc-block-components-totals-coupon__button"
							disabled={ isLoading || ! couponValue }
							showSpinner={ isLoading }
							onClick={ ( e ) => {
								e.preventDefault();
								onSubmit( couponValue );
							} }
							type="submit"
						>
							{ __( 'Apply', 'woocommerce' ) }
						</Button>
					</form>
					<ValidationInputError
						propertyName="coupon"
						elementId={ textInputId }
					/>
				</div>
			</LoadingMask>
		</Panel>
	);
};

TotalsCoupon.propTypes = {
	onSubmit: PropTypes.func,
	isLoading: PropTypes.bool,
};

export default withInstanceId( TotalsCoupon );
woocommerce-blocks/assets/js/base/components/cart-checkout/totals/coupon/style.scss000064400000001346151335517640024773 0ustar00.wc-block-components-totals-coupon {

	.wc-block-components-panel__button {
		margin-top: 0;
		padding-top: 0;
	}

	.wc-block-components-panel__content {
		padding-bottom: 0;
	}
}

.wc-block-components-totals-coupon__form {
	display: flex;
	width: 100%;
	margin-bottom: 0;

	.wc-block-components-totals-coupon__input {
		margin-bottom: 0;
		margin-top: 0;
		flex-grow: 1;
	}

	.wc-block-components-totals-coupon__button {
		height: em(48px);
		flex-shrink: 0;
		margin-left: $gap-smaller;
		padding-left: $gap-large;
		padding-right: $gap-large;
		white-space: nowrap;
	}

	.wc-block-components-totals-coupon__button.no-margin {
		margin: 0;
	}
}

.wc-block-components-totals-coupon__content {
	flex-direction: column;
	position: relative;
}
woocommerce-blocks/assets/js/base/components/cart-checkout/totals/index.js000064400000000341151335517640023072 0ustar00export { default as TotalsCoupon } from './coupon';
export { default as TotalsDiscount } from './discount';
export { default as TotalsFooterItem } from './footer-item';
export { default as TotalsShipping } from './shipping';
woocommerce-blocks/assets/js/base/components/cart-checkout/totals/discount/stories/index.js000064400000001632151335517640026416 0ustar00/**
 * External dependencies
 */
import { text, boolean } from '@storybook/addon-knobs';
import { currencyKnob } from '@woocommerce/knobs';

/**
 * Internal dependencies
 */
import TotalsDiscount from '../';

export default {
	title:
		'WooCommerce Blocks/@base-components/cart-checkout/totals/TotalsDiscount',
	component: TotalsDiscount,
};

export const Default = () => {
	const cartCoupons = [ { code: 'COUPON' } ];
	const currency = currencyKnob();
	const isRemovingCoupon = boolean( 'Toggle isRemovingCoupon state', false );
	const totalDiscount = text( 'Total discount', '1000' );
	const totalDiscountTax = text( 'Total discount tax', '200' );

	return (
		<TotalsDiscount
			cartCoupons={ cartCoupons }
			currency={ currency }
			isRemovingCoupon={ isRemovingCoupon }
			removeCoupon={ () => void null }
			values={ {
				total_discount: totalDiscount,
				total_discount_tax: totalDiscountTax,
			} }
		/>
	);
};
woocommerce-blocks/assets/js/base/components/cart-checkout/totals/discount/style.scss000064400000000315151335517640025313 0ustar00.wc-block-components-totals-discount__coupon-list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.wc-block-components-totals-discount .wc-block-components-totals-item__value {
	color: $discount-color;
}
woocommerce-blocks/assets/js/base/components/cart-checkout/totals/discount/index.js000064400000006114151335517640024726 0ustar00/**
 * External dependencies
 */
import { __, sprintf } from '@wordpress/i18n';
import LoadingMask from '@woocommerce/base-components/loading-mask';
import { RemovableChip } from '@woocommerce/base-components/chip';
import PropTypes from 'prop-types';
import {
	__experimentalApplyCheckoutFilter,
	TotalsItem,
} from '@woocommerce/blocks-checkout';
import { getSetting } from '@woocommerce/settings';

/**
 * Internal dependencies
 */
import './style.scss';

const filteredCartCouponsFilterArg = {
	context: 'summary',
};

const TotalsDiscount = ( {
	cartCoupons = [],
	currency,
	isRemovingCoupon,
	removeCoupon,
	values,
} ) => {
	const {
		total_discount: totalDiscount,
		total_discount_tax: totalDiscountTax,
	} = values;
	const discountValue = parseInt( totalDiscount, 10 );

	if ( ! discountValue && cartCoupons.length === 0 ) {
		return null;
	}

	const discountTaxValue = parseInt( totalDiscountTax, 10 );
	const discountTotalValue = getSetting(
		'displayCartPricesIncludingTax',
		false
	)
		? discountValue + discountTaxValue
		: discountValue;

	const filteredCartCoupons = __experimentalApplyCheckoutFilter( {
		arg: filteredCartCouponsFilterArg,
		filterName: 'coupons',
		defaultValue: cartCoupons,
	} );

	return (
		<TotalsItem
			className="wc-block-components-totals-discount"
			currency={ currency }
			description={
				filteredCartCoupons.length !== 0 && (
					<LoadingMask
						screenReaderLabel={ __(
							'Removing coupon…',
							'woocommerce'
						) }
						isLoading={ isRemovingCoupon }
						showSpinner={ false }
					>
						<ul className="wc-block-components-totals-discount__coupon-list">
							{ filteredCartCoupons.map( ( cartCoupon ) => {
								return (
									<RemovableChip
										key={ 'coupon-' + cartCoupon.code }
										className="wc-block-components-totals-discount__coupon-list-item"
										text={ cartCoupon.label }
										screenReaderText={ sprintf(
											/* translators: %s Coupon code. */
											__(
												'Coupon: %s',
												'woocommerce'
											),
											cartCoupon.label
										) }
										disabled={ isRemovingCoupon }
										onRemove={ () => {
											removeCoupon( cartCoupon.code );
										} }
										radius="large"
										ariaLabel={ sprintf(
											/* translators: %s is a coupon code. */
											__(
												'Remove coupon "%s"',
												'woocommerce'
											),
											cartCoupon.label
										) }
									/>
								);
							} ) }
						</ul>
					</LoadingMask>
				)
			}
			label={
				!! discountTotalValue
					? __( 'Discount', 'woocommerce' )
					: __( 'Coupons', 'woocommerce' )
			}
			value={ discountTotalValue ? discountTotalValue * -1 : '-' }
		/>
	);
};

TotalsDiscount.propTypes = {
	cartCoupons: PropTypes.arrayOf(
		PropTypes.shape( {
			code: PropTypes.string.isRequired,
		} )
	),
	currency: PropTypes.object.isRequired,
	isRemovingCoupon: PropTypes.bool.isRequired,
	removeCoupon: PropTypes.func.isRequired,
	values: PropTypes.shape( {
		total_discount: PropTypes.string,
		total_discount_tax: PropTypes.string,
	} ).isRequired,
};

export default TotalsDiscount;
woocommerce-blocks/assets/js/base/components/cart-checkout/totals/footer-item/index.js000064400000004107151335517640025330 0ustar00/**
 * External dependencies
 */
import { __ } from '@wordpress/i18n';
import { createInterpolateElement } from '@wordpress/element';
import FormattedMonetaryAmount from '@woocommerce/base-components/formatted-monetary-amount';
import PropTypes from 'prop-types';
import {
	__experimentalApplyCheckoutFilter,
	TotalsItem,
} from '@woocommerce/blocks-checkout';
import { useStoreCart } from '@woocommerce/base-context/hooks';
import { getSetting } from '@woocommerce/settings';

/**
 * Internal dependencies
 */
import './style.scss';

const TotalsFooterItem = ( { currency, values } ) => {
	const SHOW_TAXES =
		getSetting( 'taxesEnabled', true ) &&
		getSetting( 'displayCartPricesIncludingTax', false );

	const { total_price: totalPrice, total_tax: totalTax } = values;

	// Prepare props to pass to the __experimentalApplyCheckoutFilter filter.
	// We need to pluck out receiveCart.
	// eslint-disable-next-line no-unused-vars
	const { receiveCart, ...cart } = useStoreCart();
	const label = __experimentalApplyCheckoutFilter( {
		filterName: 'totalLabel',
		defaultValue: __( 'Total', 'woocommerce' ),
		extensions: cart.extensions,
		arg: { cart },
	} );

	const parsedTaxValue = parseInt( totalTax, 10 );

	return (
		<TotalsItem
			className="wc-block-components-totals-footer-item"
			currency={ currency }
			label={ label }
			value={ parseInt( totalPrice, 10 ) }
			description={
				SHOW_TAXES &&
				parsedTaxValue !== 0 && (
					<p className="wc-block-components-totals-footer-item-tax">
						{ createInterpolateElement(
							__(
								'Including <TaxAmount/> in taxes',
								'woocommerce'
							),
							{
								TaxAmount: (
									<FormattedMonetaryAmount
										className="wc-block-components-totals-footer-item-tax-value"
										currency={ currency }
										value={ parsedTaxValue }
									/>
								),
							}
						) }
					</p>
				)
			}
		/>
	);
};

TotalsFooterItem.propTypes = {
	currency: PropTypes.object.isRequired,
	values: PropTypes.shape( {
		total_price: PropTypes.string,
		total_tax: PropTypes.string,
	} ).isRequired,
};

export default TotalsFooterItem;
woocommerce-blocks/assets/js/base/components/cart-checkout/totals/footer-item/stories/index.js000064400000001205151335517640027014 0ustar00/**
 * External dependencies
 */
import { text } from '@storybook/addon-knobs';
import { currencyKnob } from '@woocommerce/knobs';

/**
 * Internal dependencies
 */
import TotalsFooterItem from '../';

export default {
	title:
		'WooCommerce Blocks/@base-components/cart-checkout/totals/TotalsFooterItem',
	component: TotalsFooterItem,
};

export const Default = () => {
	const currency = currencyKnob();
	const totalPrice = text( 'Total price', '1200' );
	const totalTax = text( 'Total tax', '200' );

	return (
		<TotalsFooterItem
			currency={ currency }
			values={ {
				total_price: totalPrice,
				total_tax: totalTax,
			} }
		/>
	);
};
assets/js/base/components/cart-checkout/totals/footer-item/test/__snapshots__/index.js.snap000064400000003763151335517640032015 0ustar00woocommerce-blocks// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`TotalsFooterItem Does not show the "including %s of tax" line if tax is 0 1`] = `
<div>
  <div
    class="wc-block-components-totals-item wc-block-components-totals-footer-item"
  >
    <span
      class="wc-block-components-totals-item__label"
    >
      Total
    </span>
    <span
      class="wc-block-formatted-money-amount wc-block-components-formatted-money-amount wc-block-components-totals-item__value"
    >
      £85.00
    </span>
    <div
      class="wc-block-components-totals-item__description"
    />
  </div>
</div>
`;

exports[`TotalsFooterItem Does not show the "including %s of tax" line if tax is disabled 1`] = `
<div>
  <div
    class="wc-block-components-totals-item wc-block-components-totals-footer-item"
  >
    <span
      class="wc-block-components-totals-item__label"
    >
      Total
    </span>
    <span
      class="wc-block-formatted-money-amount wc-block-components-formatted-money-amount wc-block-components-totals-item__value"
    >
      £85.00
    </span>
    <div
      class="wc-block-components-totals-item__description"
    />
  </div>
</div>
`;

exports[`TotalsFooterItem Shows the "including %s of tax" line if tax is greater than 0 1`] = `
<div>
  <div
    class="wc-block-components-totals-item wc-block-components-totals-footer-item"
  >
    <span
      class="wc-block-components-totals-item__label"
    >
      Total
    </span>
    <span
      class="wc-block-formatted-money-amount wc-block-components-formatted-money-amount wc-block-components-totals-item__value"
    >
      £85.00
    </span>
    <div
      class="wc-block-components-totals-item__description"
    >
      <p
        class="wc-block-components-totals-footer-item-tax"
      >
        Including 
        <span
          class="wc-block-formatted-money-amount wc-block-components-formatted-money-amount wc-block-components-totals-footer-item-tax-value"
        >
          £1.00
        </span>
         in taxes
      </p>
    </div>
  </div>
</div>
`;
woocommerce-blocks/assets/js/base/components/cart-checkout/totals/footer-item/test/index.js000064400000004006151335517640026305 0ustar00/**
 * External dependencies
 */
import { render } from '@testing-library/react';

/**
 * Internal dependencies
 */
import TotalsFooterItem from '../index';
import { allSettings } from '../../../../../../settings/shared/settings-init';

describe( 'TotalsFooterItem', () => {
	beforeEach( () => {
		allSettings.taxesEnabled = true;
		allSettings.displayCartPricesIncludingTax = true;
	} );
	const currency = {
		code: 'GBP',
		decimalSeparator: '.',
		minorUnit: 2,
		prefix: '£',
		suffix: '',
		symbol: '£',
		thousandSeparator: ',',
	};

	const values = {
		currency_code: 'GBP',
		currency_decimal_separator: '.',
		currency_minor_unit: 2,
		currency_prefix: '£',
		currency_suffix: '',
		currency_symbol: '£',
		currency_thousand_separator: ',',
		tax_lines: [],
		length: 2,
		total_discount: '0',
		total_discount_tax: '0',
		total_fees: '0',
		total_fees_tax: '0',
		total_items: '7100',
		total_items_tax: '0',
		total_price: '8500',
		total_shipping: '0',
		total_shipping_tax: '0',
		total_tax: '0',
	};

	it( 'Does not show the "including %s of tax" line if tax is 0', () => {
		const { container } = render(
			<TotalsFooterItem currency={ currency } values={ values } />
		);
		expect( container ).toMatchSnapshot();
	} );

	it( 'Does not show the "including %s of tax" line if tax is disabled', () => {
		allSettings.taxesEnabled = false;
		/* This shouldn't ever happen if taxes are disabled, but this is to test whether the taxesEnabled setting works */
		const valuesWithTax = {
			...values,
			total_tax: '100',
			total_items_tax: '100',
		};
		const { container } = render(
			<TotalsFooterItem currency={ currency } values={ valuesWithTax } />
		);
		expect( container ).toMatchSnapshot();
	} );

	it( 'Shows the "including %s of tax" line if tax is greater than 0', () => {
		const valuesWithTax = {
			...values,
			total_tax: '100',
			total_items_tax: '100',
		};
		const { container } = render(
			<TotalsFooterItem currency={ currency } values={ valuesWithTax } />
		);
		expect( container ).toMatchSnapshot();
	} );
} );
woocommerce-blocks/assets/js/base/components/cart-checkout/totals/footer-item/style.scss000064400000000453151335517640025720 0ustar00.wc-block-components-totals-footer-item {
	.wc-block-components-totals-item__value,
	.wc-block-components-totals-item__label {
		@include font-size(large);
	}

	.wc-block-components-totals-item__label {
		font-weight: 700;
	}

	.wc-block-components-totals-footer-item-tax {
		margin-bottom: 0;
	}
}
woocommerce-blocks/assets/js/base/components/cart-checkout/totals/shipping/shipping-rate-selector.js000064400000002250151335517640030175 0ustar00/**
 * External dependencies
 */
import { __ } from '@wordpress/i18n';
import { Notice } from 'wordpress-components';
import classnames from 'classnames';

/**
 * Internal dependencies
 */
import ShippingRatesControl from '../../shipping-rates-control';

const ShippingRateSelector = ( {
	hasRates,
	shippingRates,
	shippingRatesLoading,
} ) => {
	const legend = hasRates
		? __( 'Shipping options', 'woocommerce' )
		: __( 'Choose a shipping option', 'woocommerce' );
	return (
		<fieldset className="wc-block-components-totals-shipping__fieldset">
			<legend className="screen-reader-text">{ legend }</legend>
			<ShippingRatesControl
				className="wc-block-components-totals-shipping__options"
				collapsible={ true }
				noResultsMessage={
					<Notice
						isDismissible={ false }
						className={ classnames(
							'wc-block-components-shipping-rates-control__no-results-notice',
							'woocommerce-error'
						) }
					>
						{ __(
							'No shipping options were found.',
							'woocommerce'
						) }
					</Notice>
				}
				shippingRates={ shippingRates }
				shippingRatesLoading={ shippingRatesLoading }
			/>
		</fieldset>
	);
};

export default ShippingRateSelector;
woocommerce-blocks/assets/js/base/components/cart-checkout/totals/shipping/index.tsx000064400000012441151335517640025121 0ustar00/**
 * External dependencies
 */
import classnames from 'classnames';
import { __ } from '@wordpress/i18n';
import { useState } from '@wordpress/element';
import { useStoreCart } from '@woocommerce/base-context/hooks';
import { TotalsItem } from '@woocommerce/blocks-checkout';
import type { Currency } from '@woocommerce/price-format';
import type { ReactElement } from 'react';
import { getSetting, EnteredAddress } from '@woocommerce/settings';
import { ShippingVia } from '@woocommerce/base-components/cart-checkout/totals/shipping/shipping-via';

/**
 * Internal dependencies
 */
import ShippingRateSelector from './shipping-rate-selector';
import hasShippingRate from './has-shipping-rate';
import ShippingCalculator from '../../shipping-calculator';
import ShippingLocation from '../../shipping-location';
import './style.scss';

interface CalculatorButtonProps {
	label?: string;
	isShippingCalculatorOpen: boolean;
	setIsShippingCalculatorOpen: ( isShippingCalculatorOpen: boolean ) => void;
}

const CalculatorButton = ( {
	label = __( 'Calculate', 'woo-gutenberg-products-block' ),
	isShippingCalculatorOpen,
	setIsShippingCalculatorOpen,
}: CalculatorButtonProps ): ReactElement => {
	return (
		<button
			className="wc-block-components-totals-shipping__change-address-button"
			onClick={ () => {
				setIsShippingCalculatorOpen( ! isShippingCalculatorOpen );
			} }
			aria-expanded={ isShippingCalculatorOpen }
		>
			{ label }
		</button>
	);
};

interface ShippingAddressProps {
	showCalculator: boolean;
	isShippingCalculatorOpen: boolean;
	setIsShippingCalculatorOpen: CalculatorButtonProps[ 'setIsShippingCalculatorOpen' ];
	shippingAddress: EnteredAddress;
}

const ShippingAddress = ( {
	showCalculator,
	isShippingCalculatorOpen,
	setIsShippingCalculatorOpen,
	shippingAddress,
}: ShippingAddressProps ): ReactElement | null => {
	return (
		<>
			<ShippingLocation address={ shippingAddress } />
			{ showCalculator && (
				<CalculatorButton
					label={ __(
						'(change address)',
						'woo-gutenberg-products-block'
					) }
					isShippingCalculatorOpen={ isShippingCalculatorOpen }
					setIsShippingCalculatorOpen={ setIsShippingCalculatorOpen }
				/>
			) }
		</>
	);
};

interface NoShippingPlaceholderProps {
	showCalculator: boolean;
	isShippingCalculatorOpen: boolean;
	setIsShippingCalculatorOpen: CalculatorButtonProps[ 'setIsShippingCalculatorOpen' ];
}

const NoShippingPlaceholder = ( {
	showCalculator,
	isShippingCalculatorOpen,
	setIsShippingCalculatorOpen,
}: NoShippingPlaceholderProps ): ReactElement => {
	if ( ! showCalculator ) {
		return (
			<em>
				{ __(
					'Calculated during checkout',
					'woo-gutenberg-products-block'
				) }
			</em>
		);
	}

	return (
		<CalculatorButton
			isShippingCalculatorOpen={ isShippingCalculatorOpen }
			setIsShippingCalculatorOpen={ setIsShippingCalculatorOpen }
		/>
	);
};

interface TotalShippingProps {
	currency: Currency;
	values: {
		total_shipping: string;
		total_shipping_tax: string;
	}; // Values in use
	showCalculator?: boolean; //Whether to display the rate selector below the shipping total.
	showRateSelector?: boolean; // Whether to show shipping calculator or not.
	className?: string;
}

const TotalsShipping = ( {
	currency,
	values,
	showCalculator = true,
	showRateSelector = true,
	className,
}: TotalShippingProps ): ReactElement => {
	const [ isShippingCalculatorOpen, setIsShippingCalculatorOpen ] = useState(
		false
	);
	const {
		shippingAddress,
		cartHasCalculatedShipping,
		shippingRates,
		shippingRatesLoading,
	} = useStoreCart();

	const totalShippingValue = getSetting(
		'displayCartPricesIncludingTax',
		false
	)
		? parseInt( values.total_shipping, 10 ) +
		  parseInt( values.total_shipping_tax, 10 )
		: parseInt( values.total_shipping, 10 );
	const hasRates = hasShippingRate( shippingRates ) || totalShippingValue;
	const calculatorButtonProps = {
		isShippingCalculatorOpen,
		setIsShippingCalculatorOpen,
	};

	const selectedShippingRates = shippingRates.flatMap(
		( shippingPackage ) => {
			return shippingPackage.shipping_rates
				.filter( ( rate ) => rate.selected )
				.flatMap( ( rate ) => rate.name );
		}
	);

	return (
		<div
			className={ classnames(
				'wc-block-components-totals-shipping',
				className
			) }
		>
			<TotalsItem
				label={ __( 'Shipping', 'woo-gutenberg-products-block' ) }
				value={
					cartHasCalculatedShipping ? (
						totalShippingValue
					) : (
						<NoShippingPlaceholder
							showCalculator={ showCalculator }
							{ ...calculatorButtonProps }
						/>
					)
				}
				description={
					<>
						{ cartHasCalculatedShipping && (
							<>
								<ShippingVia
									selectedShippingRates={
										selectedShippingRates
									}
								/>
								<ShippingAddress
									shippingAddress={ shippingAddress }
									showCalculator={ showCalculator }
									{ ...calculatorButtonProps }
								/>
							</>
						) }
					</>
				}
				currency={ currency }
			/>
			{ showCalculator && isShippingCalculatorOpen && (
				<ShippingCalculator
					onUpdate={ () => {
						setIsShippingCalculatorOpen( false );
					} }
				/>
			) }
			{ showRateSelector && cartHasCalculatedShipping && (
				<ShippingRateSelector
					hasRates={ hasRates }
					shippingRates={ shippingRates }
					shippingRatesLoading={ shippingRatesLoading }
				/>
			) }
		</div>
	);
};

export default TotalsShipping;
woocommerce-blocks/assets/js/base/components/cart-checkout/totals/shipping/shipping-via.tsx000064400000000644151335517640026412 0ustar00/**
 * External dependencies
 */
import { __ } from '@wordpress/i18n';

export const ShippingVia = ( {
	selectedShippingRates,
}: {
	selectedShippingRates: string[];
} ): JSX.Element => {
	return (
		<div className="wc-block-components-totals-item__description wc-block-components-totals-shipping__via">
			{ __( 'via', 'woo-gutenberg-products-block' ) }{ ' ' }
			{ selectedShippingRates.join( ', ' ) }
		</div>
	);
};
woocommerce-blocks/assets/js/base/components/cart-checkout/totals/shipping/style.scss000064400000002017151335517640025305 0ustar00.wc-block-components-totals-shipping {
	// Added extra label for specificity.
	fieldset.wc-block-components-totals-shipping__fieldset {
		background-color: transparent;
		margin: 0;
		padding: 0;
		border: 0;
	}

	.wc-block-components-totals-shipping__via {
		margin-bottom: $gap;
	}

	.wc-block-components-totals-shipping__options {
		.wc-block-components-radio-control__label,
		.wc-block-components-radio-control__description,
		.wc-block-components-radio-control__secondary-label,
		.wc-block-components-radio-control__secondary-description {
			flex-basis: 100%;
			text-align: left;
		}
	}

	.wc-block-components-shipping-rates-control__no-results-notice {
		margin: 0 0 em($gap-small);
	}

	.wc-block-components-totals-shipping__change-address-button {
		@include link-button();

		&:hover,
		&:focus,
		&:active {
			opacity: 0.8;
		}
	}
}

// Extra classes for specificity.
.theme-twentytwentyone.theme-twentytwentyone.theme-twentytwentyone .wc-block-components-totals-shipping__change-address-button {
	@include link-button();
}
woocommerce-blocks/assets/js/base/components/cart-checkout/totals/shipping/has-shipping-rate.js000064400000000642151335517640027133 0ustar00/**
 * Searches an array of packages/rates to see if there are actually any rates
 * available.
 *
 * @param {Array} shippingRatePackages An array of packages and rates.
 * @return {boolean} True if a rate exists.
 */
const hasShippingRate = ( shippingRatePackages ) => {
	return shippingRatePackages.some(
		( shippingRatePackage ) => shippingRatePackage.shipping_rates.length
	);
};

export default hasShippingRate;
woocommerce-blocks/assets/js/base/components/cart-checkout/totals/shipping/stories/index.js000064400000001550151335517640026406 0ustar00/**
 * External dependencies
 */
import { boolean, text } from '@storybook/addon-knobs';
import { currencyKnob } from '@woocommerce/knobs';

/**
 * Internal dependencies
 */
import TotalsShipping from '../';

export default {
	title: 'WooCommerce Blocks/@blocks-checkout/TotalsShipping',
	component: TotalsShipping,
};

export const Default = () => {
	const currency = currencyKnob();
	const showCalculator = boolean( 'Show calculator', true );
	const showRateSelector = boolean( 'Show rate selector', true );
	const totalShipping = text( 'Total shipping', '1000' );
	const totalShippingTax = text( 'Total shipping tax', '200' );

	return (
		<TotalsShipping
			currency={ currency }
			showCalculator={ showCalculator }
			showRateSelector={ showRateSelector }
			values={ {
				total_shipping: totalShipping,
				total_shipping_tax: totalShippingTax,
			} }
		/>
	);
};
woocommerce-blocks/assets/js/base/components/cart-checkout/policies/style.scss000064400000000726151335517640023772 0ustar00.editor-styles-wrapper .wc-block-components-checkout-policies,
.wc-block-components-checkout-policies {
	@include font-size(smaller);
	text-align: center;
	list-style: none outside;
	line-height: 1;
	margin: $gap-large 0;
}

.wc-block-components-checkout-policies__item {
	list-style: none outside;
	display: inline-block;
	padding: 0 0.25em;
	margin: 0;

	&:not(:first-child) {
		border-left: 1px solid $gray-400;
	}

	> a {
		color: inherit;
		padding: 0 0.25em;
	}
}
woocommerce-blocks/assets/js/base/components/cart-checkout/policies/index.tsx000064400000002247151335517640023604 0ustar00/**
 * External dependencies
 */
import { __ } from '@wordpress/i18n';
import {
	PRIVACY_URL,
	TERMS_URL,
	PRIVACY_PAGE_NAME,
	TERMS_PAGE_NAME,
} from '@woocommerce/block-settings';
import { decodeEntities } from '@wordpress/html-entities';

/**
 * Internal dependencies
 */
import './style.scss';

const Policies = (): JSX.Element => {
	return (
		<ul className="wc-block-components-checkout-policies">
			{ PRIVACY_URL && (
				<li className="wc-block-components-checkout-policies__item">
					<a
						href={ PRIVACY_URL }
						target="_blank"
						rel="noopener noreferrer"
					>
						{ PRIVACY_PAGE_NAME
							? decodeEntities( PRIVACY_PAGE_NAME )
							: __(
									'Privacy Policy',
									'woo-gutenberg-products-block'
							  ) }
					</a>
				</li>
			) }
			{ TERMS_URL && (
				<li className="wc-block-components-checkout-policies__item">
					<a
						href={ TERMS_URL }
						target="_blank"
						rel="noopener noreferrer"
					>
						{ TERMS_PAGE_NAME
							? decodeEntities( TERMS_PAGE_NAME )
							: __(
									'Terms and Conditions',
									'woo-gutenberg-products-block'
							  ) }
					</a>
				</li>
			) }
		</ul>
	);
};

export default Policies;
woocommerce-blocks/assets/js/base/components/cart-checkout/product-metadata/index.tsx000064400000002141151335517640025224 0ustar00/**
 * External dependencies
 */
import { ProductResponseItemData } from '@woocommerce/type-defs/product-response';
import { CartVariationItem } from '@woocommerce/type-defs/cart';

/**
 * Internal dependencies
 */
import ProductDetails from '../product-details';
import ProductSummary from '../product-summary';
import './style.scss';

interface ProductMetadataProps {
	shortDescription?: string;
	fullDescription?: string;
	itemData: ProductResponseItemData[];
	variation?: CartVariationItem[];
}

const ProductMetadata = ( {
	shortDescription = '',
	fullDescription = '',
	itemData = [],
	variation = [],
}: ProductMetadataProps ): JSX.Element => {
	return (
		<div className="wc-block-components-product-metadata">
			<ProductSummary
				className="wc-block-components-product-metadata__description"
				shortDescription={ shortDescription }
				fullDescription={ fullDescription }
			/>
			<ProductDetails details={ itemData } />
			<ProductDetails
				details={ variation.map( ( { attribute = '', value } ) => ( {
					name: attribute,
					value,
				} ) ) }
			/>
		</div>
	);
};

export default ProductMetadata;
woocommerce-blocks/assets/js/base/components/cart-checkout/product-metadata/style.scss000064400000000322151335517640025411 0ustar00.wc-block-components-product-metadata {
	@include font-size(smaller);

	.wc-block-components-product-metadata__description > p,
	.wc-block-components-product-metadata__variation-data {
		margin: 0.25em 0;
	}
}
woocommerce-blocks/assets/js/base/components/cart-checkout/product-summary/index.tsx000064400000002044151335517640025143 0ustar00/**
 * External dependencies
 */
import Summary from '@woocommerce/base-components/summary';
import { blocksConfig } from '@woocommerce/block-settings';

interface ProductSummaryProps {
	className?: string;
	shortDescription?: string;
	fullDescription?: string;
}
/**
 * Returns an element containing a summary of the product.
 *
 * @param {Object} props                  Incoming props for the component.
 * @param {string} props.className        CSS class name used.
 * @param {string} props.shortDescription Short description for the product.
 * @param {string} props.fullDescription  Full description for the product.
 */
const ProductSummary = ( {
	className,
	shortDescription = '',
	fullDescription = '',
}: ProductSummaryProps ): JSX.Element | null => {
	const source = shortDescription ? shortDescription : fullDescription;

	if ( ! source ) {
		return null;
	}

	return (
		<Summary
			className={ className }
			source={ source }
			maxLength={ 15 }
			countType={ blocksConfig.wordCountType || 'words' }
		/>
	);
};

export default ProductSummary;
woocommerce-blocks/assets/js/base/components/cart-checkout/payment-method-label/style.scss000064400000000457151335517640026174 0ustar00.wc-block-components-payment-method-label--with-icon {
	display: inline-block;
	vertical-align: middle;
	> img,
	> svg {
		vertical-align: middle;
		margin: -2px 4px 0 0;
	}
}

.is-mobile,
.is-small {
	.wc-block-components-payment-method-label--with-icon {
		> img,
		> svg {
			display: none;
		}
	}
}
woocommerce-blocks/assets/js/base/components/cart-checkout/payment-method-label/index.tsx000064400000003237151335517640026005 0ustar00/**
 * External dependencies
 */
import classnames from 'classnames';
import { Icon, bank, bill, card, checkPayment } from '@woocommerce/icons';
import { isString, objectHasProp } from '@woocommerce/types';
import { useCallback } from '@wordpress/element';

/**
 * Internal dependencies
 */
import './style.scss';

interface NamedIcons {
	bank: JSX.Element;
	bill: JSX.Element;
	card: JSX.Element;
	checkPayment: JSX.Element;
}

const namedIcons: NamedIcons = {
	bank,
	bill,
	card,
	checkPayment,
};

interface PaymentMethodLabelProps {
	icon: '' | keyof NamedIcons | SVGElement;
	text: string;
}

/**
 * Exposed to payment methods for the label shown on checkout. Allows icons to be added as well as
 * text.
 *
 * @param {Object} props Component props.
 * @param {*} props.icon Show an icon beside the text if provided. Can be a string to use a named
 *                       icon, or an SVG element.
 * @param {string} props.text Text shown next to icon.
 */
export const PaymentMethodLabel = ( {
	icon = '',
	text = '',
}: PaymentMethodLabelProps ): JSX.Element => {
	const hasIcon = !! icon;
	const hasNamedIcon = useCallback(
		(
			iconToCheck: '' | keyof NamedIcons | SVGElement
		): iconToCheck is keyof NamedIcons =>
			hasIcon &&
			isString( iconToCheck ) &&
			objectHasProp( namedIcons, iconToCheck ),
		[ hasIcon ]
	);
	const className = classnames( 'wc-block-components-payment-method-label', {
		'wc-block-components-payment-method-label--with-icon': hasIcon,
	} );

	return (
		<span className={ className }>
			{ hasNamedIcon( icon ) ? (
				<Icon srcElement={ namedIcons[ icon ] } />
			) : (
				icon
			) }
			{ text }
		</span>
	);
};

export default PaymentMethodLabel;
woocommerce-blocks/assets/js/base/components/cart-checkout/shipping-calculator/style.scss000064400000000414151335517640026125 0ustar00.wc-block-components-shipping-calculator-address {
	margin-bottom: 0;
}

.wc-block-components-shipping-calculator-address__button {
	width: 100%;
	margin-top: em($gap-large);
}

.wc-block-components-shipping-calculator {
	padding: em($gap-smaller) 0 em($gap-small);
}
woocommerce-blocks/assets/js/base/components/cart-checkout/shipping-calculator/index.tsx000064400000001760151335517640025744 0ustar00/**
 * External dependencies
 */
import { useShippingDataContext } from '@woocommerce/base-context';
import type { EnteredAddress } from '@woocommerce/settings';

/**
 * Internal dependencies
 */
import ShippingCalculatorAddress from './address';
import './style.scss';

interface ShippingCalculatorProps {
	onUpdate?: ( newAddress: EnteredAddress ) => void;
	addressFields?: Partial< keyof EnteredAddress >[];
}

const ShippingCalculator = ( {
	onUpdate = () => {
		/* Do nothing */
	},
	addressFields = [ 'country', 'state', 'city', 'postcode' ],
}: ShippingCalculatorProps ): JSX.Element => {
	const { shippingAddress, setShippingAddress } = useShippingDataContext();
	return (
		<div className="wc-block-components-shipping-calculator">
			<ShippingCalculatorAddress
				address={ shippingAddress }
				addressFields={ addressFields }
				onUpdate={ ( newAddress ) => {
					setShippingAddress( newAddress );
					onUpdate( newAddress );
				} }
			/>
		</div>
	);
};

export default ShippingCalculator;
woocommerce-blocks/assets/js/base/components/cart-checkout/shipping-calculator/address.tsx000064400000003233151335517640026257 0ustar00/**
 * External dependencies
 */
import { __ } from '@wordpress/i18n';
import Button from '@woocommerce/base-components/button';
import { useState } from '@wordpress/element';
import isShallowEqual from '@wordpress/is-shallow-equal';
import { useValidationContext } from '@woocommerce/base-context';
import type { EnteredAddress, AddressFields } from '@woocommerce/settings';

/**
 * Internal dependencies
 */
import './style.scss';
import { AddressForm } from '../address-form';

interface ShippingCalculatorAddressProps {
	address: EnteredAddress;
	onUpdate: ( address: EnteredAddress ) => void;
	addressFields: Partial< keyof AddressFields >[];
}
const ShippingCalculatorAddress = ( {
	address: initialAddress,
	onUpdate,
	addressFields,
}: ShippingCalculatorAddressProps ): JSX.Element => {
	const [ address, setAddress ] = useState( initialAddress );
	const {
		hasValidationErrors,
		showAllValidationErrors,
	} = useValidationContext();

	const validateSubmit = () => {
		showAllValidationErrors();
		return ! hasValidationErrors;
	};

	return (
		<form className="wc-block-components-shipping-calculator-address">
			<AddressForm
				fields={ addressFields }
				onChange={ setAddress }
				values={ address }
			/>
			<Button
				className="wc-block-components-shipping-calculator-address__button"
				disabled={ isShallowEqual( address, initialAddress ) }
				onClick={ ( e ) => {
					e.preventDefault();
					const isAddressValid = validateSubmit();
					if ( isAddressValid ) {
						return onUpdate( address );
					}
				} }
				type="submit"
			>
				{ __( 'Update', 'woo-gutenberg-products-block' ) }
			</Button>
		</form>
	);
};

export default ShippingCalculatorAddress;
woocommerce-blocks/assets/js/base/components/cart-checkout/product-image/index.tsx000064400000001252151335517640024530 0ustar00/**
 * External dependencies
 */
import { decodeEntities } from '@wordpress/html-entities';
import { PLACEHOLDER_IMG_SRC } from '@woocommerce/settings';

interface ProductImageProps {
	image: { alt?: string; thumbnail?: string };
}
/**
 * Formats and returns an image element.
 *
 * @param {Object} props       Incoming props for the component.
 * @param {Object} props.image Image properties.
 */
const ProductImage = ( { image = {} }: ProductImageProps ): JSX.Element => {
	const imageProps = {
		src: image.thumbnail || PLACEHOLDER_IMG_SRC,
		alt: decodeEntities( image.alt ) || '',
	};

	return <img { ...imageProps } alt={ imageProps.alt } />;
};

export default ProductImage;
woocommerce-blocks/assets/js/base/components/cart-checkout/index.js000064400000002401151335517640021563 0ustar00export * from './address-form';
export { default as FormStep } from './form-step';
export { default as OrderSummary } from './order-summary';
export { default as PlaceOrderButton } from './place-order-button';
export { default as Policies } from './policies';
export { default as ProductBackorderBadge } from './product-backorder-badge';
export { default as ProductDetails } from './product-details';
export { default as ProductImage } from './product-image';
export { default as ProductLowStockBadge } from './product-low-stock-badge';
export { default as ProductSummary } from './product-summary';
export { default as ProductMetadata } from './product-metadata';
export { default as ProductSaleBadge } from './product-sale-badge';
export { default as ReturnToCartButton } from './return-to-cart-button';
export { default as ShippingCalculator } from './shipping-calculator';
export { default as ShippingLocation } from './shipping-location';
export { default as ShippingRatesControl } from './shipping-rates-control';
export { default as ShippingRatesControlPackage } from './shipping-rates-control-package';
export { default as PaymentMethodIcons } from './payment-method-icons';
export { default as PaymentMethodLabel } from './payment-method-label';
export * from './totals';
woocommerce-blocks/assets/js/base/components/cart-checkout/product-details/test/index.js000064400000002663151335517640025657 0ustar00/**
 * External dependencies
 */
import TestRenderer from 'react-test-renderer';

/**
 * Internal dependencies
 */
import ProductDetails from '..';

describe( 'ProductDetails', () => {
	test( 'should render details', () => {
		const details = [
			{ name: 'Lorem', value: 'Ipsum' },
			{ name: 'LOREM', value: 'Ipsum', display: 'IPSUM' },
			{ value: 'Ipsum' },
		];
		const component = TestRenderer.create(
			<ProductDetails details={ details } />
		);

		expect( component.toJSON() ).toMatchSnapshot();
	} );

	test( 'should not render hidden details', () => {
		const details = [
			{ name: 'Lorem', value: 'Ipsum', hidden: true },
			{ name: 'LOREM', value: 'Ipsum', display: 'IPSUM' },
		];
		const component = TestRenderer.create(
			<ProductDetails details={ details } />
		);

		expect( component.toJSON() ).toMatchSnapshot();
	} );

	test( 'should not rendering anything if all details are hidden', () => {
		const details = [
			{ name: 'Lorem', value: 'Ipsum', hidden: true },
			{ name: 'LOREM', value: 'Ipsum', display: 'IPSUM', hidden: true },
		];
		const component = TestRenderer.create(
			<ProductDetails details={ details } />
		);

		expect( component.toJSON() ).toMatchSnapshot();
	} );

	test( 'should not rendering anything if details is an empty array', () => {
		const details = [];
		const component = TestRenderer.create(
			<ProductDetails details={ details } />
		);

		expect( component.toJSON() ).toMatchSnapshot();
	} );
} );
assets/js/base/components/cart-checkout/product-details/test/__snapshots__/index.js.snap000064400000002733151335517640031354 0ustar00woocommerce-blocks// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`ProductDetails should not render hidden details 1`] = `
<ul
  className="wc-block-components-product-details"
>
  <li
    className="wc-block-components-product-details__lorem"
  >
    <span
      className="wc-block-components-product-details__name"
    >
      LOREM
      :
    </span>
     
    <span
      className="wc-block-components-product-details__value"
    >
      IPSUM
    </span>
  </li>
</ul>
`;

exports[`ProductDetails should not rendering anything if all details are hidden 1`] = `null`;

exports[`ProductDetails should not rendering anything if details is an empty array 1`] = `null`;

exports[`ProductDetails should render details 1`] = `
<ul
  className="wc-block-components-product-details"
>
  <li
    className="wc-block-components-product-details__lorem"
  >
    <span
      className="wc-block-components-product-details__name"
    >
      Lorem
      :
    </span>
     
    <span
      className="wc-block-components-product-details__value"
    >
      Ipsum
    </span>
  </li>
  <li
    className="wc-block-components-product-details__lorem"
  >
    <span
      className="wc-block-components-product-details__name"
    >
      LOREM
      :
    </span>
     
    <span
      className="wc-block-components-product-details__value"
    >
      IPSUM
    </span>
  </li>
  <li
    className=""
  >
    <span
      className="wc-block-components-product-details__value"
    >
      Ipsum
    </span>
  </li>
</ul>
`;
woocommerce-blocks/assets/js/base/components/cart-checkout/product-details/index.tsx000064400000002617151335517640025101 0ustar00/**
 * External dependencies
 */
import { kebabCase } from 'lodash';
import { decodeEntities } from '@wordpress/html-entities';
import type { ProductResponseItemData } from '@woocommerce/type-defs/product-response';

/**
 * Internal dependencies
 */
import './style.scss';

interface ProductDetailsProps {
	details: ProductResponseItemData[];
}
// Component to display cart item data and variations.
const ProductDetails = ( {
	details = [],
}: ProductDetailsProps ): JSX.Element | null => {
	if ( ! Array.isArray( details ) ) {
		return null;
	}

	details = details.filter( ( detail ) => ! detail.hidden );

	if ( details.length === 0 ) {
		return null;
	}

	return (
		<ul className="wc-block-components-product-details">
			{ details.map( ( detail ) => {
				const className = detail.name
					? `wc-block-components-product-details__${ kebabCase(
							detail.name
					  ) }`
					: '';
				return (
					<li
						key={ detail.name + ( detail.display || detail.value ) }
						className={ className }
					>
						{ detail.name && (
							<>
								<span className="wc-block-components-product-details__name">
									{ decodeEntities( detail.name ) }:
								</span>{ ' ' }
							</>
						) }
						<span className="wc-block-components-product-details__value">
							{ decodeEntities( detail.display || detail.value ) }
						</span>
					</li>
				);
			} ) }
		</ul>
	);
};

export default ProductDetails;
woocommerce-blocks/assets/js/base/components/cart-checkout/product-details/style.scss000064400000000761151335517640025265 0ustar00// Extra class added for specificity so styles are applied in the editor.
.wc-block-components-product-details.wc-block-components-product-details {
	list-style: none;
	margin: 0.5em 0;
	padding: 0;

	&:last-of-type {
		margin-bottom: 0;
	}

	li {
		margin-left: 0;
	}
}

.wc-block-components-product-details__name,
.wc-block-components-product-details__value {
	display: inline-block;
}

.is-large:not(.wc-block-checkout) {
	.wc-block-components-product-details__name {
		font-weight: bold;
	}
}
woocommerce-blocks/assets/js/base/components/cart-checkout/product-sale-badge/index.tsx000064400000003067151335517640025440 0ustar00/**
 * External dependencies
 */
import { createInterpolateElement } from '@wordpress/element';
import { __, sprintf } from '@wordpress/i18n';
import FormattedMonetaryAmount from '@woocommerce/base-components/formatted-monetary-amount';
import type { Currency } from '@woocommerce/price-format';

/**
 * Internal dependencies
 */
import ProductBadge from '../product-badge';

interface ProductSaleBadgeProps {
	currency: Currency;
	saleAmount: number;
	format: string;
}
/**
 * ProductSaleBadge
 *
 * @param {Object} props            Incoming props.
 * @param {Object} props.currency   Currency object.
 * @param {number} props.saleAmount Discounted amount.
 * @param {string} [props.format]   Format to change the price.
 * @return {*} The component.
 */
const ProductSaleBadge = ( {
	currency,
	saleAmount,
	format = '<price/>',
}: ProductSaleBadgeProps ): JSX.Element | null => {
	if ( ! saleAmount || saleAmount <= 0 ) {
		return null;
	}
	if ( ! format.includes( '<price/>' ) ) {
		format = '<price/>';
		// eslint-disable-next-line no-console
		console.error( 'Price formats need to include the `<price/>` tag.' );
	}

	const formattedMessage = sprintf(
		/* translators: %s will be replaced by the discount amount */
		__( `Save %s`, 'woo-gutenberg-products-block' ),
		format
	);

	return (
		<ProductBadge className="wc-block-components-sale-badge">
			{ createInterpolateElement( formattedMessage, {
				price: (
					<FormattedMonetaryAmount
						currency={ currency }
						value={ saleAmount }
					/>
				),
			} ) }
		</ProductBadge>
	);
};

export default ProductSaleBadge;
woocommerce-blocks/assets/js/base/components/cart-checkout/product-badge/style.scss000064400000000337151335517640024701 0ustar00.wc-block-components-product-badge {
	@include font-size(smaller);
	border-radius: 2px;
	border: 1px solid;
	display: inline-block;
	font-weight: 600;
	padding: 0 0.66em;
	text-transform: uppercase;
	white-space: nowrap;
}
woocommerce-blocks/assets/js/base/components/cart-checkout/product-badge/index.tsx000064400000000771151335517640024515 0ustar00/**
 * External dependencies
 */
import classNames from 'classnames';
import type { ReactNode } from 'react';

/**
 * Internal dependencies
 */
import './style.scss';

interface ProductBadgeProps {
	children?: ReactNode;
	className?: string;
}
const ProductBadge = ( {
	children,
	className,
}: ProductBadgeProps ): JSX.Element => {
	return (
		<div
			className={ classNames(
				'wc-block-components-product-badge',
				className
			) }
		>
			{ children }
		</div>
	);
};

export default ProductBadge;
woocommerce-blocks/assets/js/base/components/cart-checkout/shipping-location/index.tsx000064400000003500151335517640025415 0ustar00/**
 * External dependencies
 */
import { __, sprintf } from '@wordpress/i18n';
import { EnteredAddress, getSetting } from '@woocommerce/settings';
import { decodeEntities } from '@wordpress/html-entities';

interface ShippingLocationProps {
	address: EnteredAddress;
}

/**
 * Shows a formatted shipping location.
 *
 * @param {Object} props Incoming props for the component.
 * @param {Object} props.address Incoming address information.
 */
const ShippingLocation = ( {
	address,
}: ShippingLocationProps ): JSX.Element | null => {
	// we bail early if we don't have an address.
	if ( Object.values( address ).length === 0 ) {
		return null;
	}
	const shippingCountries = getSetting( 'shippingCountries', {} ) as Record<
		string,
		string
	>;
	const shippingStates = getSetting( 'shippingStates', {} ) as Record<
		string,
		Record< string, string >
	>;
	const formattedCountry =
		typeof shippingCountries[ address.country ] === 'string'
			? decodeEntities( shippingCountries[ address.country ] )
			: '';

	const formattedState =
		typeof shippingStates[ address.country ] === 'object' &&
		typeof shippingStates[ address.country ][ address.state ] === 'string'
			? decodeEntities(
					shippingStates[ address.country ][ address.state ]
			  )
			: address.state;

	const addressParts = [];

	addressParts.push( address.postcode.toUpperCase() );
	addressParts.push( address.city );
	addressParts.push( formattedState );
	addressParts.push( formattedCountry );

	const formattedLocation = addressParts.filter( Boolean ).join( ', ' );

	if ( ! formattedLocation ) {
		return null;
	}

	return (
		<span className="wc-block-components-shipping-address">
			{ sprintf(
				/* translators: %s location. */
				__( 'Shipping to %s', 'woo-gutenberg-products-block' ),
				formattedLocation
			) + ' ' }
		</span>
	);
};

export default ShippingLocation;
woocommerce-blocks/assets/js/base/components/cart-checkout/product-low-stock-badge/index.tsx000064400000001641151335517640026432 0ustar00/**
 * External dependencies
 */
import { __, sprintf } from '@wordpress/i18n';

/**
 * Internal dependencies
 */
import ProductBadge from '../product-badge';

interface ProductLowStockBadgeProps {
	lowStockRemaining: number | null;
}
/**
 * Returns a low stock badge.
 *
 * @param {Object}  props                   Incoming props for the component.
 * @param {number} props.lowStockRemaining Whether or not there is low stock remaining.
 */
const ProductLowStockBadge = ( {
	lowStockRemaining,
}: ProductLowStockBadgeProps ): JSX.Element | null => {
	if ( ! lowStockRemaining ) {
		return null;
	}

	return (
		<ProductBadge className="wc-block-components-product-low-stock-badge">
			{ sprintf(
				/* translators: %d stock amount (number of items in stock for product) */
				__( '%d left in stock', 'woo-gutenberg-products-block' ),
				lowStockRemaining
			) }
		</ProductBadge>
	);
};

export default ProductLowStockBadge;
woocommerce-blocks/assets/js/base/components/cart-checkout/product-backorder-badge/index.tsx000064400000000711151335517640026441 0ustar00/**
 * External dependencies
 */
import { __ } from '@wordpress/i18n';

/**
 * Internal dependencies
 */
import ProductBadge from '../product-badge';

/**
 * Returns a backorder badge.
 */
const ProductBackorderBadge = (): JSX.Element => {
	return (
		<ProductBadge className="wc-block-components-product-backorder-badge">
			{ __( 'Available on backorder', 'woo-gutenberg-products-block' ) }
		</ProductBadge>
	);
};

export default ProductBackorderBadge;
woocommerce-blocks/assets/js/base/components/cart-checkout/place-order-button/index.tsx000064400000001625151335517640025502 0ustar00/**
 * External dependencies
 */
import { __ } from '@wordpress/i18n';
import { useCheckoutSubmit } from '@woocommerce/base-context/hooks';
import { Icon, done } from '@woocommerce/icons';
import Button from '@woocommerce/base-components/button';

const PlaceOrderButton = (): JSX.Element => {
	const {
		submitButtonText,
		onSubmit,
		isCalculating,
		isDisabled,
		waitingForProcessing,
		waitingForRedirect,
	} = useCheckoutSubmit();

	return (
		<Button
			className="wc-block-components-checkout-place-order-button"
			onClick={ onSubmit }
			disabled={
				isCalculating ||
				isDisabled ||
				waitingForProcessing ||
				waitingForRedirect
			}
			showSpinner={ waitingForProcessing }
		>
			{ waitingForRedirect ? (
				<Icon
					srcElement={ done }
					alt={ __( 'Done', 'woo-gutenberg-products-block' ) }
				/>
			) : (
				submitButtonText
			) }
		</Button>
	);
};

export default PlaceOrderButton;
woocommerce-blocks/assets/js/base/components/formatted-monetary-amount/style.scss000064400000000106151335517640024541 0ustar00.wc-block-components-formatted-money-amount {
	white-space: nowrap;
}
woocommerce-blocks/assets/js/base/components/formatted-monetary-amount/index.tsx000064400000004732151335517640024364 0ustar00/**
 * External dependencies
 */
import NumberFormat, {
	NumberFormatValues,
	NumberFormatProps,
} from 'react-number-format';
import classNames from 'classnames';
import type { Currency } from '@woocommerce/price-format';
import type { ReactElement } from 'react';

/**
 * Internal dependencies
 */
import './style.scss';

interface FormattedMonetaryAmountProps {
	className?: string;
	displayType?: NumberFormatProps[ 'displayType' ];
	value: number | string; // Value of money amount.
	currency: Currency | Record< string, never >; // Currency configuration object.
	onValueChange?: ( unit: number ) => void; // Function to call when value changes.
}

/**
 * Formats currency data into the expected format for NumberFormat.
 */
const currencyToNumberFormat = (
	currency: FormattedMonetaryAmountProps[ 'currency' ]
) => {
	return {
		thousandSeparator: currency.thousandSeparator,
		decimalSeparator: currency.decimalSeparator,
		decimalScale: currency.minorUnit,
		fixedDecimalScale: true,
		prefix: currency.prefix,
		suffix: currency.suffix,
		isNumericString: true,
	};
};

/**
 * FormattedMonetaryAmount component.
 *
 * Takes a price and returns a formatted price using the NumberFormat component.
 */
const FormattedMonetaryAmount = ( {
	className,
	value: rawValue,
	currency,
	onValueChange,
	displayType = 'text',
	...props
}: FormattedMonetaryAmountProps ): ReactElement | null => {
	const value =
		typeof rawValue === 'string' ? parseInt( rawValue, 10 ) : rawValue;

	if ( ! Number.isFinite( value ) ) {
		return null;
	}

	const priceValue = value / 10 ** currency.minorUnit;

	if ( ! Number.isFinite( priceValue ) ) {
		return null;
	}

	const classes = classNames(
		'wc-block-formatted-money-amount',
		'wc-block-components-formatted-money-amount',
		className
	);
	const numberFormatProps = {
		...props,
		...currencyToNumberFormat( currency ),
		value: undefined,
		currency: undefined,
		onValueChange: undefined,
	};

	// Wrapper for NumberFormat onValueChange which handles subunit conversion.
	const onValueChangeWrapper = onValueChange
		? ( values: NumberFormatValues ) => {
				const minorUnitValue =
					( ( values.value as unknown ) as number ) *
					10 ** currency.minorUnit;
				onValueChange( minorUnitValue );
		  }
		: () => {
				/* not used */
		  };

	return (
		<NumberFormat
			className={ classes }
			displayType={ displayType }
			{ ...numberFormatProps }
			value={ priceValue }
			onValueChange={ onValueChangeWrapper }
		/>
	);
};

export default FormattedMonetaryAmount;
woocommerce-blocks/assets/js/base/components/quantity-selector/index.tsx000064400000007260151335517640022735 0ustar00/**
 * External dependencies
 */
import { __, sprintf } from '@wordpress/i18n';
import { speak } from '@wordpress/a11y';
import classNames from 'classnames';
import { useCallback } from '@wordpress/element';
import { DOWN, UP } from '@wordpress/keycodes';
import { isNumber } from '@woocommerce/types';

/**
 * Internal dependencies
 */
import './style.scss';

interface QuantitySelectorProps {
	className?: string;
	quantity?: number;
	minimum?: number;
	maximum: number;
	onChange: ( newQuantity: number ) => void;
	itemName?: string;
	disabled: boolean;
}

const QuantitySelector = ( {
	className,
	quantity = 1,
	minimum = 1,
	maximum,
	onChange = () => {
		/* Do nothing. */
	},
	itemName = '',
	disabled,
}: QuantitySelectorProps ): JSX.Element => {
	const classes = classNames(
		'wc-block-components-quantity-selector',
		className
	);

	const hasMaximum = typeof maximum !== 'undefined';
	const canDecrease = quantity > minimum;
	const canIncrease = ! hasMaximum || quantity < maximum;

	/**
	 * Handles keyboard up and down keys to change quantity value.
	 *
	 * @param {Object} event event data.
	 */
	const quantityInputOnKeyDown = useCallback(
		( event ) => {
			const isArrowDown =
				typeof event.key !== undefined
					? event.key === 'ArrowDown'
					: event.keyCode === DOWN;
			const isArrowUp =
				typeof event.key !== undefined
					? event.key === 'ArrowUp'
					: event.keyCode === UP;

			if ( isArrowDown && canDecrease ) {
				event.preventDefault();
				onChange( quantity - 1 );
			}

			if ( isArrowUp && canIncrease ) {
				event.preventDefault();
				onChange( quantity + 1 );
			}
		},
		[ quantity, onChange, canIncrease, canDecrease ]
	);

	return (
		<div className={ classes }>
			<input
				className="wc-block-components-quantity-selector__input"
				disabled={ disabled }
				type="number"
				step="1"
				min="0"
				value={ quantity }
				onKeyDown={ quantityInputOnKeyDown }
				onChange={ ( event ) => {
					let value =
						! isNumber( event.target.value ) || ! event.target.value
							? 0
							: parseInt( event.target.value, 10 );
					if ( hasMaximum ) {
						value = Math.min( value, maximum );
					}
					value = Math.max( value, minimum );
					if ( value !== quantity ) {
						onChange( value );
					}
				} }
				aria-label={ sprintf(
					/* translators: %s refers to the item name in the cart. */
					__(
						'Quantity of %s in your cart.',
						'woo-gutenberg-products-block'
					),
					itemName
				) }
			/>
			<button
				aria-label={ __(
					'Reduce quantity',
					'woo-gutenberg-products-block'
				) }
				className="wc-block-components-quantity-selector__button wc-block-components-quantity-selector__button--minus"
				disabled={ disabled || ! canDecrease }
				onClick={ () => {
					const newQuantity = quantity - 1;
					onChange( newQuantity );
					speak(
						sprintf(
							/* translators: %s refers to the item name in the cart. */
							__(
								'Quantity reduced to %s.',
								'woo-gutenberg-products-block'
							),
							newQuantity
						)
					);
				} }
			>
				&#65293;
			</button>
			<button
				aria-label={ __(
					'Increase quantity',
					'woo-gutenberg-products-block'
				) }
				disabled={ disabled || ! canIncrease }
				className="wc-block-components-quantity-selector__button wc-block-components-quantity-selector__button--plus"
				onClick={ () => {
					const newQuantity = quantity + 1;
					onChange( newQuantity );
					speak(
						sprintf(
							/* translators: %s refers to the item name in the cart. */
							__(
								'Quantity increased to %s.',
								'woo-gutenberg-products-block'
							),
							newQuantity
						)
					);
				} }
			>
				&#65291;
			</button>
		</div>
	);
};

export default QuantitySelector;
woocommerce-blocks/assets/js/base/components/quantity-selector/stories/index.js000064400000001126151335517640024216 0ustar00/**
 * External dependencies
 */
import { boolean } from '@storybook/addon-knobs';
import { useState } from 'react';

/**
 * Internal dependencies
 */
import QuantitySelector from '../';

export default {
	title: 'WooCommerce Blocks/@base-components/QuantitySelector',
	component: QuantitySelector,
};

export const Default = () => {
	const [ quantity, changeQuantity ] = useState();

	return (
		<div style={ { width: 100 } }>
			<QuantitySelector
				disabled={ boolean( 'Disabled', false ) }
				quantity={ quantity }
				onChange={ changeQuantity }
				itemName="widgets"
			/>
		</div>
	);
};
woocommerce-blocks/assets/js/base/components/quantity-selector/style.scss000064400000004242151335517640023120 0ustar00@mixin reset-button {
	border: 0;
	padding: 0;
	margin: 0;
	background: none transparent;
	box-shadow: none;

	&:focus {
		outline: 2px solid $gray-300;
	}
}

.wc-block-components-quantity-selector {
	display: flex;
	width: 107px;
	border: 1px solid $gray-300;
	background: #fff;
	border-radius: 4px;
	// needed so that buttons fill the container.
	box-sizing: content-box;
	margin: 0 0 0.25em 0;

	.has-dark-controls & {
		background-color: transparent;
		border-color: $input-border-dark;
	}

	// Extra label for specificity needed in the editor.
	input.wc-block-components-quantity-selector__input {
		@include font-size(regular);
		order: 2;
		min-width: 40px;
		flex: 1 1 auto;
		border: 0;
		padding: 0.4em 0;
		margin: 0;
		text-align: center;
		background: transparent;
		box-shadow: none;
		color: #000;
		line-height: 1;
		vertical-align: middle;
		-moz-appearance: textfield;

		&:focus {
			background: $gray-100;
			outline: 1px solid $gray-300;
		}
		&:disabled {
			color: $gray-600;
		}

		.has-dark-controls & {
			color: $input-text-dark;
			background: transparent;

			&:focus {
				background: transparent;
			}
			&:disabled {
				color: $input-disabled-dark;
			}
		}
	}
	input::-webkit-outer-spin-button,
	input::-webkit-inner-spin-button {
		-webkit-appearance: none;
		margin: 0;
	}

	.wc-block-components-quantity-selector__button {
		@include reset-button;
		@include font-size(regular);
		min-width: 30px;
		cursor: pointer;
		color: $gray-900;
		font-style: normal;
		text-align: center;
		text-decoration: none;

		&:hover,
		&:focus {
			@include reset-button;
			color: $gray-900;
		}
		&:disabled {
			color: $gray-600;
			cursor: default;
			@include reset-button;
		}

		.has-dark-controls & {
			color: $input-text-dark;

			&:hover,
			&:focus {
				color: $input-text-dark;
			}
			&:disabled {
				color: $input-disabled-dark;
			}
		}
	}

	> .wc-block-components-quantity-selector__button--minus {
		order: 1;
	}

	> .wc-block-components-quantity-selector__button--plus {
		order: 3;
	}
}

.theme-twentyseventeen {
	.wc-block-components-quantity-selector .wc-block-components-quantity-selector__button {
		&:hover,
		&:focus {
			background: none transparent;
		}
	}
}
woocommerce-blocks/assets/js/base/components/radio-control/option-layout.tsx000064400000002537151335517640023533 0ustar00/**
 * External dependencies
 */
import type { ReactElement } from 'react';
import type { PackageRateOption } from '@woocommerce/type-defs/shipping';

const OptionLayout = ( {
	label,
	secondaryLabel,
	description,
	secondaryDescription,
	id,
}: Partial< PackageRateOption > ): ReactElement => {
	return (
		<div className="wc-block-components-radio-control__option-layout">
			<div className="wc-block-components-radio-control__label-group">
				{ label && (
					<span
						id={ id && `${ id }__label` }
						className="wc-block-components-radio-control__label"
					>
						{ label }
					</span>
				) }
				{ secondaryLabel && (
					<span
						id={ id && `${ id }__secondary-label` }
						className="wc-block-components-radio-control__secondary-label"
					>
						{ secondaryLabel }
					</span>
				) }
			</div>
			<div className="wc-block-components-radio-control__description-group">
				{ description && (
					<span
						id={ id && `${ id }__description` }
						className="wc-block-components-radio-control__description"
					>
						{ description }
					</span>
				) }
				{ secondaryDescription && (
					<span
						id={ id && `${ id }__secondary-description` }
						className="wc-block-components-radio-control__secondary-description"
					>
						{ secondaryDescription }
					</span>
				) }
			</div>
		</div>
	);
};

export default OptionLayout;
woocommerce-blocks/assets/js/base/components/radio-control/option.js000064400000002507151335517640022013 0ustar00/**
 * External dependencies
 */
import classnames from 'classnames';

/**
 * Internal dependencies
 */
import OptionLayout from './option-layout';

const Option = ( { checked, name, onChange, option } ) => {
	const {
		value,
		label,
		description,
		secondaryLabel,
		secondaryDescription,
	} = option;
	const onChangeValue = ( event ) => onChange( event.target.value );

	return (
		<label
			className={ classnames(
				'wc-block-components-radio-control__option',
				{
					'wc-block-components-radio-control__option-checked': checked,
				}
			) }
			htmlFor={ `${ name }-${ value }` }
		>
			<input
				id={ `${ name }-${ value }` }
				className="wc-block-components-radio-control__input"
				type="radio"
				name={ name }
				value={ value }
				onChange={ onChangeValue }
				checked={ checked }
				aria-describedby={ classnames( {
					[ `${ name }-${ value }__label` ]: label,
					[ `${ name }-${ value }__secondary-label` ]: secondaryLabel,
					[ `${ name }-${ value }__description` ]: description,
					[ `${ name }-${ value }__secondary-description` ]: secondaryDescription,
				} ) }
			/>
			<OptionLayout
				id={ `${ name }-${ value }` }
				label={ label }
				secondaryLabel={ secondaryLabel }
				description={ description }
				secondaryDescription={ secondaryDescription }
			/>
		</label>
	);
};

export default Option;
woocommerce-blocks/assets/js/base/components/radio-control/style.scss000064400000004671151335517640022206 0ustar00.wc-block-components-radio-control__option {
	@include reset-typography();
	display: block;
	margin: em($gap) 0;
	padding: 0 0 0 em($gap-largest);
	position: relative;

	&:first-child {
		margin-top: 0;
	}
	&:last-child {
		margin-bottom: 0;
	}
}

.wc-block-components-radio-control__option-layout {
	display: table;
	width: 100%;
}

.wc-block-components-radio-control__option .wc-block-components-radio-control__option-layout {
	&::after {
		display: none;
	}
}

.wc-block-components-radio-control__label-group,
.wc-block-components-radio-control__description-group {
	display: table-row;

	> span {
		display: table-cell;
	}

	.wc-block-components-radio-control__secondary-label,
	.wc-block-components-radio-control__secondary-description {
		text-align: right;
		min-width: 50%;
	}
}

.wc-block-components-radio-control__label,
.wc-block-components-radio-control__secondary-label {
	// Currently, max() CSS function calls need to be wrapped with unquote.
	// See: https://github.com/sass/sass/issues/2378#issuecomment-367490840
	// These values should be the same as the control input height.
	line-height: unquote("max(1.5rem, 24px)");
}

.wc-block-components-radio-control__description,
.wc-block-components-radio-control__secondary-description {
	@include font-size(small);
	line-height: 20px;
}

// Extra class for specificity.
.wc-block-components-radio-control {
	.wc-block-components-radio-control__input {
		appearance: none;
		background: #fff;
		border: 2px solid $input-border-gray;
		border-radius: 50%;
		display: inline-block;
		height: em(24px); // =1.5rem
		min-height: 24px;
		min-width: 24px;
		width: em(24px);
		// The code belows centers the input vertically.
		position: absolute;
		left: 0;
		top: 50%;
		transform: translate(0, -50%);

		&:checked::before {
			background: #000;
			border-radius: 50%;
			content: "";
			display: block;
			height: em(12px);
			left: 50%;
			margin: 0;
			min-height: 12px;
			min-width: 12px;
			position: absolute;
			top: 50%;
			transform: translate(-50%, -50%);
			width: em(12px);
		}

		.has-dark-controls & {
			border-color: $controls-border-dark;
			background-color: $input-background-dark;

			&:checked::before {
				background: $input-text-dark;
			}
		}
	}
}

.theme-twentytwentyone {
	.wc-block-components-radio-control .wc-block-components-radio-control__input {
		&:checked {
			border-width: 2px;

			&::before {
				background-color: var(--form--color-text);
			}
		}

		&::after {
			display: none;
		}
	}
}
woocommerce-blocks/assets/js/base/components/radio-control/index.js000064400000002105151335517640021604 0ustar00/**
 * External dependencies
 */
import classnames from 'classnames';
import { withInstanceId } from '@wordpress/compose';

/**
 * Internal dependencies
 */
import RadioControlOption from './option';
import './style.scss';

const RadioControl = ( {
	className,
	instanceId,
	id,
	selected,
	onChange,
	options = [],
} ) => {
	const radioControlId = id || instanceId;

	return (
		options.length && (
			<div
				className={ classnames(
					'wc-block-components-radio-control',
					className
				) }
			>
				{ options.map( ( option ) => (
					<RadioControlOption
						key={ `${ radioControlId }-${ option.value }` }
						name={ `radio-control-${ radioControlId }` }
						checked={ option.value === selected }
						option={ option }
						onChange={ ( value ) => {
							onChange( value );
							if ( typeof option.onChange === 'function' ) {
								option.onChange( value );
							}
						} }
					/>
				) ) }
			</div>
		)
	);
};

export default withInstanceId( RadioControl );
export { RadioControlOption };
export { default as RadioControlOptionLayout } from './option-layout';
woocommerce-blocks/assets/js/base/components/state-input/index.ts000064400000000305151335517640021317 0ustar00export { default as StateInput } from './state-input';
export { default as BillingStateInput } from './billing-state-input';
export { default as ShippingStateInput } from './shipping-state-input';
woocommerce-blocks/assets/js/base/components/state-input/state-input.tsx000064400000006153151335517640022664 0ustar00/**
 * External dependencies
 */
import { __ } from '@wordpress/i18n';
import { decodeEntities } from '@wordpress/html-entities';
import { useCallback, useMemo, useEffect, useRef } from '@wordpress/element';
import classnames from 'classnames';

/**
 * Internal dependencies
 */
import { ValidatedTextInput } from '../text-input';
import Combobox from '../combobox';
import './style.scss';
import type { StateInputWithStatesProps } from './StateInputProps';

const optionMatcher = (
	value: string,
	options: { label: string; value: string }[]
): string => {
	const foundOption = options.find(
		( option ) =>
			option.label.toLocaleUpperCase() === value.toLocaleUpperCase() ||
			option.value.toLocaleUpperCase() === value.toLocaleUpperCase()
	);
	return foundOption ? foundOption.value : '';
};

const StateInput = ( {
	className,
	id,
	states,
	country,
	label,
	onChange,
	autoComplete = 'off',
	value = '',
	required = false,
}: StateInputWithStatesProps ): JSX.Element => {
	const countryStates = states[ country ];
	const options = useMemo(
		() =>
			countryStates
				? Object.keys( countryStates ).map( ( key ) => ( {
						value: key,
						label: decodeEntities( countryStates[ key ] ),
				  } ) )
				: [],
		[ countryStates ]
	);

	/**
	 * Handles state selection onChange events. Finds a matching state by key or value.
	 */
	const onChangeState = useCallback(
		( stateValue: string ) => {
			onChange(
				options.length > 0
					? optionMatcher( stateValue, options )
					: stateValue
			);
		},
		[ onChange, options ]
	);

	/**
	 * Track value changes.
	 */
	const valueRef = useRef< string >( value );

	useEffect( () => {
		if ( valueRef.current !== value ) {
			valueRef.current = value;
		}
	}, [ value ] );

	/**
	 * If given a list of options, ensure the value matches those options or trigger change.
	 */
	useEffect( () => {
		if ( options.length > 0 && valueRef.current ) {
			const match = optionMatcher( valueRef.current, options );
			if ( match !== valueRef.current ) {
				onChangeState( match );
			}
		}
	}, [ options, onChangeState ] );

	if ( options.length > 0 ) {
		return (
			<>
				<Combobox
					className={ classnames(
						className,
						'wc-block-components-state-input'
					) }
					id={ id }
					label={ label }
					onChange={ onChangeState }
					options={ options }
					value={ value }
					errorMessage={ __(
						'Please select a state.',
						'woo-gutenberg-products-block'
					) }
					required={ required }
					autoComplete={ autoComplete }
				/>
				{ autoComplete !== 'off' && (
					<input
						type="text"
						aria-hidden={ true }
						autoComplete={ autoComplete }
						value={ value }
						onChange={ ( event ) =>
							onChangeState( event.target.value )
						}
						style={ {
							minHeight: '0',
							height: '0',
							border: '0',
							padding: '0',
							position: 'absolute',
						} }
						tabIndex={ -1 }
					/>
				) }
			</>
		);
	}

	return (
		<ValidatedTextInput
			className={ className }
			id={ id }
			label={ label }
			onChange={ onChangeState }
			autoComplete={ autoComplete }
			value={ value }
			required={ required }
		/>
	);
};

export default StateInput;
woocommerce-blocks/assets/js/base/components/state-input/billing-state-input.tsx000064400000000620151335517640024273 0ustar00/**
 * External dependencies
 */
import { ALLOWED_STATES } from '@woocommerce/block-settings';

/**
 * Internal dependencies
 */
import StateInput from './state-input';
import type { StateInputProps } from './StateInputProps';

const BillingStateInput = ( props: StateInputProps ): JSX.Element => {
	return <StateInput states={ ALLOWED_STATES } { ...props } />;
};

export default BillingStateInput;
woocommerce-blocks/assets/js/base/components/state-input/style.scss000064400000000102151335517640021670 0ustar00.wc-block-components-state-input {
	margin-top: em($gap-large);
}
woocommerce-blocks/assets/js/base/components/state-input/StateInputProps.ts000064400000000531151335517640023335 0ustar00export interface StateInputProps {
	className?: string;
	label: string;
	id: string;
	autoComplete?: string;
	value: string;
	country: string;
	onChange: ( value: string ) => void;
	required?: boolean;
	errorMessage?: string;
}

export type StateInputWithStatesProps = StateInputProps & {
	states: Record< string, Record< string, string > >;
};
woocommerce-blocks/assets/js/base/components/state-input/shipping-state-input.tsx000064400000000624151335517640024500 0ustar00/**
 * External dependencies
 */
import { SHIPPING_STATES } from '@woocommerce/block-settings';

/**
 * Internal dependencies
 */
import StateInput from './state-input';
import type { StateInputProps } from './StateInputProps';

const ShippingStateInput = ( props: StateInputProps ): JSX.Element => {
	return <StateInput states={ SHIPPING_STATES } { ...props } />;
};

export default ShippingStateInput;
woocommerce-blocks/assets/js/base/components/chip/chip.js000064400000003520151335517640017571 0ustar00/**
 * External dependencies
 */
import PropTypes from 'prop-types';
import classNames from 'classnames';

/**
 * Internal dependencies
 */
import './style.scss';

/** @typedef {import('react')} React */

/**
 * Component used to render a "chip" -- a list item containing some text.
 *
 * Each chip defaults to a list element but this can be customized by providing
 * a wrapperElement.
 *
 * @param {Object} props Incoming props for the component.
 * @param {string} props.text Text for chip content.
 * @param {string} props.screenReaderText Screenreader text for the content.
 * @param {string} props.element The element type for the chip.
 * @param {string} props.className CSS class used.
 * @param {string} props.radius Radius size.
 * @param {React.ReactChildren|null} props.children React children.
 * @param {Object} props.props Rest of props passed through to component.
 */
const Chip = ( {
	text,
	screenReaderText = '',
	element = 'li',
	className = '',
	radius = 'small',
	children = null,
	...props
} ) => {
	const Wrapper = element;
	const wrapperClassName = classNames(
		className,
		'wc-block-components-chip',
		'wc-block-components-chip--radius-' + radius
	);

	const showScreenReaderText = Boolean(
		screenReaderText && screenReaderText !== text
	);

	return (
		// @ts-ignore
		<Wrapper className={ wrapperClassName } { ...props }>
			<span
				aria-hidden={ showScreenReaderText }
				className="wc-block-components-chip__text"
			>
				{ text }
			</span>
			{ showScreenReaderText && (
				<span className="screen-reader-text">{ screenReaderText }</span>
			) }
			{ children }
		</Wrapper>
	);
};

Chip.propTypes = {
	text: PropTypes.node.isRequired,
	screenReaderText: PropTypes.string,
	element: PropTypes.elementType,
	className: PropTypes.string,
	radius: PropTypes.oneOf( [ 'none', 'small', 'medium', 'large' ] ),
};

export default Chip;
woocommerce-blocks/assets/js/base/components/chip/removable-chip.js000064400000005352151335517640021550 0ustar00/**
 * External dependencies
 */
import PropTypes from 'prop-types';
import classNames from 'classnames';
import { __, sprintf } from '@wordpress/i18n';
import { Icon, noAlt } from '@woocommerce/icons';

/**
 * Internal dependencies
 */
import Chip from './chip.js';

/**
 * Component used to render a "chip" -- an item containing some text with
 * an X button to remove/dismiss each chip.
 *
 * @param {Object} props Incoming props for the component.
 * @param {string} props.ariaLabel Aria label content.
 * @param {string} props.className CSS class used.
 * @param {boolean} props.disabled Whether action is disabled or not.
 * @param {function():any} props.onRemove Function to call when remove event is fired.
 * @param {boolean} props.removeOnAnyClick Whether to expand click area for remove event.
 * @param {string} props.text The text for the chip.
 * @param {string} props.screenReaderText The screen reader text for the chip.
 * @param {Object} props.props Rest of props passed into component.
 */
const RemovableChip = ( {
	ariaLabel = '',
	className = '',
	disabled = false,
	onRemove = () => void null,
	removeOnAnyClick = false,
	text,
	screenReaderText = '',
	...props
} ) => {
	const RemoveElement = removeOnAnyClick ? 'span' : 'button';

	if ( ! ariaLabel ) {
		const ariaLabelText =
			screenReaderText && typeof screenReaderText === 'string'
				? screenReaderText
				: text;
		ariaLabel =
			typeof ariaLabelText !== 'string'
				? /* translators: Remove chip. */
				  __( 'Remove', 'woocommerce' )
				: sprintf(
						/* translators: %s text of the chip to remove. */
						__( 'Remove "%s"', 'woocommerce' ),
						ariaLabelText
				  );
	}

	const clickableElementProps = {
		'aria-label': ariaLabel,
		disabled,
		onClick: onRemove,
		onKeyDown: ( e ) => {
			if ( e.key === 'Backspace' || e.key === 'Delete' ) {
				onRemove();
			}
		},
	};

	const chipProps = removeOnAnyClick ? clickableElementProps : {};
	const removeProps = removeOnAnyClick
		? { 'aria-hidden': true }
		: clickableElementProps;

	return (
		<Chip
			{ ...props }
			{ ...chipProps }
			className={ classNames( className, 'is-removable' ) }
			element={ removeOnAnyClick ? 'button' : props.element }
			screenReaderText={ screenReaderText }
			text={ text }
		>
			<RemoveElement
				className="wc-block-components-chip__remove"
				{ ...removeProps }
			>
				<Icon
					className="wc-block-components-chip__remove-icon"
					srcElement={ noAlt }
					size={ 16 }
				/>
			</RemoveElement>
		</Chip>
	);
};

RemovableChip.propTypes = {
	text: PropTypes.node.isRequired,
	ariaLabel: PropTypes.string,
	className: PropTypes.string,
	disabled: PropTypes.bool,
	onRemove: PropTypes.func,
	removeOnAnyClick: PropTypes.bool,
	screenReaderText: PropTypes.string,
};

export default RemovableChip;
woocommerce-blocks/assets/js/base/components/chip/style.scss000064400000003400151335517640020342 0ustar00.wc-block-components-chip {
	@include reset-typography();
	align-items: center;
	border: 0;
	display: inline-flex;
	padding: em($gap-smallest * 0.5) 0.5em em($gap-smallest);
	margin: 0 0.365em 0.365em 0;
	border-radius: 0;
	line-height: 1;
	max-width: 100%;

	// Chip might be a button, so we need to override theme styles.
	&,
	&:hover,
	&:focus,
	&:active {
		background: $gray-200;
		color: $gray-900;
	}

	&.wc-block-components-chip--radius-small {
		border-radius: 3px;
	}
	&.wc-block-components-chip--radius-medium {
		border-radius: 0.433em;
	}
	&.wc-block-components-chip--radius-large {
		border-radius: 2em;
		padding-left: 0.75em;
		padding-right: 0.75em;
	}
	.wc-block-components-chip__text {
		flex-grow: 1;
	}
	&.is-removable {
		padding-right: 0.5em;
	}
	&.is-removable .wc-block-components-chip__text {
		padding-right: 0.25em;
	}
	.wc-block-components-chip__remove {
		@include font-size(smaller);
		background: transparent;
		border: 0;
		appearance: none;
		padding: 0;
	}

	.wc-block-components-chip__remove-icon {
		vertical-align: middle;
	}
}

.theme-twentytwentyone {
	.wc-block-components-chip,
	.wc-block-components-chip:active,
	.wc-block-components-chip:focus,
	.wc-block-components-chip:hover {
		background: #fff;
		button.wc-block-components-chip__remove:not(:hover):not(:active):not(.has-background) {
			background: transparent;
		}
	}
}

button.wc-block-components-chip:hover > .wc-block-components-chip__remove,
button.wc-block-components-chip:focus > .wc-block-components-chip__remove,
.wc-block-components-chip__remove:hover,
.wc-block-components-chip__remove:focus {
	fill: $alert-red;
}

button.wc-block-components-chip:disabled > .wc-block-components-chip__remove,
.wc-block-components-chip__remove:disabled {
	fill: $gray-600;
	cursor: not-allowed;
}
woocommerce-blocks/assets/js/base/components/chip/index.js000064400000000147151335517640017757 0ustar00export { default as Chip } from './chip';
export { default as RemovableChip } from './removable-chip';
woocommerce-blocks/assets/js/base/components/chip/stories/index.js000064400000001757151335517640021457 0ustar00/**
 * External dependencies
 */
import { text, select, boolean } from '@storybook/addon-knobs';

/**
 * Internal dependencies
 */
import * as components from '../';

export default {
	title: 'WooCommerce Blocks/@base-components/Chip',
	component: Chip,
};

const radii = [ 'none', 'small', 'medium', 'large' ];

export const Chip = () => (
	<components.Chip
		text={ text( 'Text', 'example' ) }
		radius={ select( 'Radius', radii ) }
		screenReaderText={ text(
			'Screen reader text',
			'Example screen reader text'
		) }
		element={ select( 'Element', [ 'li', 'div', 'span' ], 'li' ) }
	/>
);

export const RemovableChip = () => (
	<components.RemovableChip
		text={ text( 'Text', 'example' ) }
		radius={ select( 'Radius', radii ) }
		screenReaderText={ text(
			'Screen reader text',
			'Example screen reader text'
		) }
		disabled={ boolean( 'Disabled', false ) }
		removeOnAnyClick={ boolean( 'Remove on any click', false ) }
		element={ select( 'Element', [ 'li', 'div', 'span' ], 'li' ) }
	/>
);
woocommerce-blocks/assets/js/base/components/chip/test/__snapshots__/index.js.snap000064400000015665151335517640024527 0ustar00// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`Chip should render children nodes 1`] = `
<li
  className="wc-block-components-chip wc-block-components-chip--radius-small"
>
  <span
    aria-hidden={false}
    className="wc-block-components-chip__text"
  >
    Test
  </span>
  Lorem Ipsum
</li>
`;

exports[`Chip should render defined radius 1`] = `
<li
  className="wc-block-components-chip wc-block-components-chip--radius-large"
>
  <span
    aria-hidden={false}
    className="wc-block-components-chip__text"
  >
    Test
  </span>
</li>
`;

exports[`Chip should render nodes as the text 1`] = `
<li
  className="wc-block-components-chip wc-block-components-chip--radius-small"
>
  <span
    aria-hidden={false}
    className="wc-block-components-chip__text"
  >
    <h1>
      Test
    </h1>
  </span>
</li>
`;

exports[`Chip should render screen reader text 1`] = `
<li
  className="wc-block-components-chip wc-block-components-chip--radius-small"
>
  <span
    aria-hidden={true}
    className="wc-block-components-chip__text"
  >
    Test
  </span>
  <span
    className="screen-reader-text"
  >
    Test 2
  </span>
</li>
`;

exports[`Chip should render text 1`] = `
<li
  className="wc-block-components-chip wc-block-components-chip--radius-small"
>
  <span
    aria-hidden={false}
    className="wc-block-components-chip__text"
  >
    Test
  </span>
</li>
`;

exports[`Chip with custom wrapper should render a chip made up of a div instead of a li 1`] = `
<div
  className="wc-block-components-chip wc-block-components-chip--radius-small"
>
  <span
    aria-hidden={false}
    className="wc-block-components-chip__text"
  >
    Test
  </span>
</div>
`;

exports[`RemovableChip should render custom aria label 1`] = `
<li
  className="is-removable wc-block-components-chip wc-block-components-chip--radius-small"
>
  <span
    aria-hidden={false}
    className="wc-block-components-chip__text"
  >
    <h1>
      Test
    </h1>
  </span>
  <button
    aria-label="Aria test"
    className="wc-block-components-chip__remove"
    disabled={false}
    onClick={[Function]}
    onKeyDown={[Function]}
  >
    <svg
      aria-hidden={true}
      className="wc-block-components-chip__remove-icon"
      focusable={false}
      height={16}
      role="img"
      viewBox="0 0 20 20"
      width={16}
      xmlns="http://www.w3.org/2000/svg"
    >
      <path
        d="M14.95 6.46L11.41 10l3.54 3.54-1.41 1.41L10 11.42l-3.53 3.53-1.42-1.42L8.58 10 5.05 6.47l1.42-1.42L10 8.58l3.54-3.53z"
      />
    </svg>
  </button>
</li>
`;

exports[`RemovableChip should render default aria label if text is a node 1`] = `
<li
  className="is-removable wc-block-components-chip wc-block-components-chip--radius-small"
>
  <span
    aria-hidden={true}
    className="wc-block-components-chip__text"
  >
    <h1>
      Test
    </h1>
  </span>
  <span
    className="screen-reader-text"
  >
    Test 2
  </span>
  <button
    aria-label="Remove \\"Test 2\\""
    className="wc-block-components-chip__remove"
    disabled={false}
    onClick={[Function]}
    onKeyDown={[Function]}
  >
    <svg
      aria-hidden={true}
      className="wc-block-components-chip__remove-icon"
      focusable={false}
      height={16}
      role="img"
      viewBox="0 0 20 20"
      width={16}
      xmlns="http://www.w3.org/2000/svg"
    >
      <path
        d="M14.95 6.46L11.41 10l3.54 3.54-1.41 1.41L10 11.42l-3.53 3.53-1.42-1.42L8.58 10 5.05 6.47l1.42-1.42L10 8.58l3.54-3.53z"
      />
    </svg>
  </button>
</li>
`;

exports[`RemovableChip should render screen reader text aria label 1`] = `
<li
  className="is-removable wc-block-components-chip wc-block-components-chip--radius-small"
>
  <span
    aria-hidden={true}
    className="wc-block-components-chip__text"
  >
    Test
  </span>
  <span
    className="screen-reader-text"
  >
    Test 2
  </span>
  <button
    aria-label="Remove \\"Test 2\\""
    className="wc-block-components-chip__remove"
    disabled={false}
    onClick={[Function]}
    onKeyDown={[Function]}
  >
    <svg
      aria-hidden={true}
      className="wc-block-components-chip__remove-icon"
      focusable={false}
      height={16}
      role="img"
      viewBox="0 0 20 20"
      width={16}
      xmlns="http://www.w3.org/2000/svg"
    >
      <path
        d="M14.95 6.46L11.41 10l3.54 3.54-1.41 1.41L10 11.42l-3.53 3.53-1.42-1.42L8.58 10 5.05 6.47l1.42-1.42L10 8.58l3.54-3.53z"
      />
    </svg>
  </button>
</li>
`;

exports[`RemovableChip should render text and the remove button 1`] = `
<li
  className="is-removable wc-block-components-chip wc-block-components-chip--radius-small"
>
  <span
    aria-hidden={false}
    className="wc-block-components-chip__text"
  >
    Test
  </span>
  <button
    aria-label="Remove \\"Test\\""
    className="wc-block-components-chip__remove"
    disabled={false}
    onClick={[Function]}
    onKeyDown={[Function]}
  >
    <svg
      aria-hidden={true}
      className="wc-block-components-chip__remove-icon"
      focusable={false}
      height={16}
      role="img"
      viewBox="0 0 20 20"
      width={16}
      xmlns="http://www.w3.org/2000/svg"
    >
      <path
        d="M14.95 6.46L11.41 10l3.54 3.54-1.41 1.41L10 11.42l-3.53 3.53-1.42-1.42L8.58 10 5.05 6.47l1.42-1.42L10 8.58l3.54-3.53z"
      />
    </svg>
  </button>
</li>
`;

exports[`RemovableChip should render with disabled remove button 1`] = `
<li
  className="is-removable wc-block-components-chip wc-block-components-chip--radius-small"
>
  <span
    aria-hidden={false}
    className="wc-block-components-chip__text"
  >
    Test
  </span>
  <button
    aria-label="Remove \\"Test\\""
    className="wc-block-components-chip__remove"
    disabled={true}
    onClick={[Function]}
    onKeyDown={[Function]}
  >
    <svg
      aria-hidden={true}
      className="wc-block-components-chip__remove-icon"
      focusable={false}
      height={16}
      role="img"
      viewBox="0 0 20 20"
      width={16}
      xmlns="http://www.w3.org/2000/svg"
    >
      <path
        d="M14.95 6.46L11.41 10l3.54 3.54-1.41 1.41L10 11.42l-3.53 3.53-1.42-1.42L8.58 10 5.05 6.47l1.42-1.42L10 8.58l3.54-3.53z"
      />
    </svg>
  </button>
</li>
`;

exports[`RemovableChip with removeOnAnyClick should be a button when removeOnAnyClick is set to true 1`] = `
<button
  aria-label="Remove \\"Test\\""
  className="is-removable wc-block-components-chip wc-block-components-chip--radius-small"
  disabled={false}
  onClick={[Function]}
  onKeyDown={[Function]}
>
  <span
    aria-hidden={false}
    className="wc-block-components-chip__text"
  >
    Test
  </span>
  <span
    aria-hidden={true}
    className="wc-block-components-chip__remove"
  >
    <svg
      aria-hidden={true}
      className="wc-block-components-chip__remove-icon"
      focusable={false}
      height={16}
      role="img"
      viewBox="0 0 20 20"
      width={16}
      xmlns="http://www.w3.org/2000/svg"
    >
      <path
        d="M14.95 6.46L11.41 10l3.54 3.54-1.41 1.41L10 11.42l-3.53 3.53-1.42-1.42L8.58 10 5.05 6.47l1.42-1.42L10 8.58l3.54-3.53z"
      />
    </svg>
  </span>
</button>
`;
woocommerce-blocks/assets/js/base/components/chip/test/index.js000064400000005402151335517640020735 0ustar00/**
 * External dependencies
 */
import TestRenderer from 'react-test-renderer';

/**
 * Internal dependencies
 */
import { Chip, RemovableChip } from '..';

describe( 'Chip', () => {
	test( 'should render text', () => {
		const component = TestRenderer.create( <Chip text="Test" /> );

		expect( component.toJSON() ).toMatchSnapshot();
	} );

	test( 'should render nodes as the text', () => {
		const component = TestRenderer.create(
			<Chip text={ <h1>Test</h1> } />
		);

		expect( component.toJSON() ).toMatchSnapshot();
	} );

	test( 'should render defined radius', () => {
		const component = TestRenderer.create(
			<Chip text="Test" radius="large" />
		);

		expect( component.toJSON() ).toMatchSnapshot();
	} );

	test( 'should render screen reader text', () => {
		const component = TestRenderer.create(
			<Chip text="Test" screenReaderText="Test 2" />
		);

		expect( component.toJSON() ).toMatchSnapshot();
	} );

	test( 'should render children nodes', () => {
		const component = TestRenderer.create(
			<Chip text="Test">Lorem Ipsum</Chip>
		);

		expect( component.toJSON() ).toMatchSnapshot();
	} );

	describe( 'with custom wrapper', () => {
		test( 'should render a chip made up of a div instead of a li', () => {
			const component = TestRenderer.create(
				<Chip text="Test" element="div" />
			);

			expect( component.toJSON() ).toMatchSnapshot();
		} );
	} );
} );

describe( 'RemovableChip', () => {
	test( 'should render text and the remove button', () => {
		const component = TestRenderer.create( <RemovableChip text="Test" /> );

		expect( component.toJSON() ).toMatchSnapshot();
	} );

	test( 'should render with disabled remove button', () => {
		const component = TestRenderer.create(
			<RemovableChip text="Test" disabled={ true } />
		);

		expect( component.toJSON() ).toMatchSnapshot();
	} );

	test( 'should render custom aria label', () => {
		const component = TestRenderer.create(
			<RemovableChip text={ <h1>Test</h1> } ariaLabel="Aria test" />
		);

		expect( component.toJSON() ).toMatchSnapshot();
	} );

	test( 'should render default aria label if text is a node', () => {
		const component = TestRenderer.create(
			<RemovableChip text={ <h1>Test</h1> } screenReaderText="Test 2" />
		);

		expect( component.toJSON() ).toMatchSnapshot();
	} );

	test( 'should render screen reader text aria label', () => {
		const component = TestRenderer.create(
			<RemovableChip text="Test" screenReaderText="Test 2" />
		);

		expect( component.toJSON() ).toMatchSnapshot();
	} );

	describe( 'with removeOnAnyClick', () => {
		test( 'should be a button when removeOnAnyClick is set to true', () => {
			const component = TestRenderer.create(
				<RemovableChip text="Test" removeOnAnyClick={ true } />
			);

			expect( component.toJSON() ).toMatchSnapshot();
		} );
	} );
} );
woocommerce-blocks/assets/js/base/components/button/style.scss000064400000001206151335517640020734 0ustar00.wc-block-components-button:not(.is-link) {
	@include reset-typography();
	align-items: center;
	background-color: $gray-900;
	color: $white;
	display: inline-flex;
	font-weight: bold;
	min-height: 3em;
	justify-content: center;
	line-height: 1;
	padding: 0 em($gap);
	text-align: center;
	text-decoration: none;
	text-transform: none;
	position: relative;

	&:disabled,
	&:hover,
	&:focus,
	&:active {
		background-color: $gray-900;
		color: $white;
	}

	.wc-block-components-button__text {
		display: block;

		> svg {
			fill: currentColor;
		}
	}
	.wc-block-components-spinner + .wc-block-components-button__text {
		visibility: hidden;
	}
}
woocommerce-blocks/assets/js/base/components/button/index.tsx000064400000001777151335517640020563 0ustar00/**
 * External dependencies
 */
import { Button as WPButton } from 'wordpress-components';
import type { ReactNode } from 'react';
import classNames from 'classnames';
import Spinner from '@woocommerce/base-components/spinner';

/**
 * Internal dependencies
 */
import './style.scss';

interface ButtonProps extends WPButton.ButtonProps {
	className?: string;
	showSpinner?: boolean;
	children?: ReactNode;
}

/**
 * Component that visually renders a button but semantically might be `<button>` or `<a>` depending
 * on the props.
 */
const Button = ( {
	className,
	showSpinner = false,
	children,
	...props
}: ButtonProps ): JSX.Element => {
	const buttonClassName = classNames(
		'wc-block-components-button',
		className,
		{
			'wc-block-components-button--loading': showSpinner,
		}
	);

	return (
		<WPButton className={ buttonClassName } { ...props }>
			{ showSpinner && <Spinner /> }
			<span className="wc-block-components-button__text">
				{ children }
			</span>
		</WPButton>
	);
};

export default Button;
woocommerce-blocks/assets/js/base/components/button/stories/index.js000064400000000322151335517640022032 0ustar00/**
 * Internal dependencies
 */
import Button from '../';

export default {
	title: 'WooCommerce Blocks/@base-components/Button',
	component: Button,
};

export const Default = () => <Button>Buy now</Button>;
woocommerce-blocks/assets/js/base/components/combobox/style.scss000064400000006762151335517640021245 0ustar00.wc-block-components-form .wc-block-components-combobox,
.wc-block-components-combobox {
	.wc-block-components-combobox-control {
		@include reset-typography();
		@include reset-box();

		.components-base-control__field {
			@include reset-box();
		}
		.components-combobox-control__suggestions-container {
			@include reset-typography();
			@include reset-box();
			position: relative;
		}
		input.components-combobox-control__input {
			@include reset-typography();
			@include font-size(regular);

			box-sizing: border-box;
			outline: inherit;
			border: 1px solid $input-border-gray;
			background: #fff;
			box-shadow: none;
			color: $input-text-active;
			font-family: inherit;
			font-weight: normal;
			height: 3em;
			letter-spacing: inherit;
			line-height: 1;
			padding: em($gap-large) $gap em($gap-smallest);
			text-align: left;
			text-overflow: ellipsis;
			text-transform: none;
			white-space: nowrap;
			width: 100%;
			opacity: initial;
			border-radius: 4px;

			&[aria-expanded="true"],
			&:focus {
				background-color: #fff;
				color: $input-text-active;
				outline: 0;
				box-shadow: 0 0 0 1px $input-border-gray;
			}

			&[aria-expanded="true"] {
				border-bottom-right-radius: 0;
				border-bottom-left-radius: 0;
			}

			.has-dark-controls & {
				background-color: $input-background-dark;
				border-color: $input-border-dark;
				color: $input-text-dark;

				&:focus {
					background-color: $input-background-dark;
					color: $input-text-dark;
					box-shadow: 0 0 0 1px $input-border-dark;
				}
			}
		}
		.components-form-token-field__suggestions-list {
			position: absolute;
			z-index: 10;
			background-color: $select-dropdown-light;
			border: 1px solid $input-border-gray;
			border-top: 0;
			margin: 3em 0 0 0;
			padding: 0;
			max-height: 300px;
			min-width: 100%;
			overflow: auto;
			color: $input-text-active;

			.has-dark-controls & {
				background-color: $select-dropdown-dark;
				color: $input-text-dark;
			}

			.components-form-token-field__suggestion {
				@include font-size(regular);
				color: $gray-700;
				cursor: default;
				list-style: none;
				margin: 0;
				padding: em($gap-smallest) $gap;

				&.is-selected {
					background-color: $gray-300;
					.has-dark-controls & {
						background-color: $select-item-dark;
					}
				}

				&:hover,
				&:focus,
				&.is-highlighted,
				&:active {
					background-color: #00669e;
					color: #fff;

				}
			}
		}

		label.components-base-control__label {
			@include reset-typography();
			@include font-size(regular);
			line-height: 1.375; // =22px when font-size is 16px.
			position: absolute;
			transform: translateY(0.75em);
			transform-origin: top left;
			transition: all 200ms ease;
			color: $gray-700;
			z-index: 1;
			margin: 0 0 0 #{$gap + 1px};
			overflow: hidden;
			text-overflow: ellipsis;
			max-width: calc(100% - #{2 * $gap});
			white-space: nowrap;

			.has-dark-controls & {
				color: $input-placeholder-dark;
			}
			@media screen and (prefers-reduced-motion: reduce) {
				transition: none;
			}
		}
	}

	&.is-active,
	&:focus-within {
		.wc-block-components-combobox-control label.components-base-control__label {
			transform: translateY(#{$gap-smallest}) scale(0.75);
		}
	}

	&.has-error {
		.wc-block-components-combobox-control {
			label.components-base-control__label {
				color: $alert-red;
			}
			input.components-combobox-control__input {
				&,
				&:hover,
				&:focus,
				&:active {
					border-color: $alert-red;
				}
				&:focus {
					box-shadow: 0 0 0 1px $alert-red;
				}
			}
		}
	}
}
woocommerce-blocks/assets/js/base/components/combobox/index.tsx000064400000007052151335517640021050 0ustar00/**
 * External dependencies
 */
import classnames from 'classnames';
import { __ } from '@wordpress/i18n';
import { useEffect, useRef } from '@wordpress/element';
import { withInstanceId } from '@wordpress/compose';
import { ComboboxControl } from 'wordpress-components';
import {
	ValidationInputError,
	useValidationContext,
} from '@woocommerce/base-context';
import { isObject } from '@woocommerce/types';

/**
 * Internal dependencies
 */
import './style.scss';

export interface ComboboxControlOption {
	label: string;
	value: string;
}

/**
 * Wrapper for the WordPress ComboboxControl which supports validation.
 */
const Combobox = ( {
	id,
	className,
	label,
	onChange,
	options,
	value,
	required = false,
	errorMessage = __(
		'Please select a value.',
		'woo-gutenberg-products-block'
	),
	errorId: incomingErrorId,
	instanceId = '0',
	autoComplete = 'off',
}: {
	id: string;
	className: string;
	label: string;
	onChange: ( filterValue: string ) => void;
	options: ComboboxControlOption[];
	value: string;
	required: boolean;
	errorMessage: string;
	errorId: string;
	instanceId: string;
	autoComplete: string;
} ): JSX.Element => {
	const {
		getValidationError,
		setValidationErrors,
		clearValidationError,
	} = useValidationContext();

	const controlRef = useRef< HTMLDivElement >( null );
	const controlId = id || 'control-' + instanceId;
	const errorId = incomingErrorId || controlId;
	const error = ( getValidationError( errorId ) || {
		message: '',
		hidden: false,
	} ) as {
		message: string;
		hidden: boolean;
	};

	useEffect( () => {
		if ( ! required || value ) {
			clearValidationError( errorId );
		} else {
			setValidationErrors( {
				[ errorId ]: {
					message: errorMessage,
					hidden: true,
				},
			} );
		}
		return () => {
			clearValidationError( errorId );
		};
	}, [
		clearValidationError,
		value,
		errorId,
		errorMessage,
		required,
		setValidationErrors,
	] );

	// @todo Remove patch for ComboboxControl once https://github.com/WordPress/gutenberg/pull/33928 is released
	// Also see https://github.com/WordPress/gutenberg/pull/34090
	return (
		<div
			id={ controlId }
			className={ classnames( 'wc-block-components-combobox', className, {
				'is-active': value,
				'has-error': error.message && ! error.hidden,
			} ) }
			ref={ controlRef }
		>
			<ComboboxControl
				className={ 'wc-block-components-combobox-control' }
				label={ label }
				onChange={ onChange }
				onFilterValueChange={ ( filterValue: string ) => {
					if ( filterValue.length ) {
						// If we have a value and the combobox is not focussed, this could be from browser autofill.
						const activeElement = isObject( controlRef.current )
							? controlRef.current.ownerDocument.activeElement
							: undefined;

						if (
							activeElement &&
							isObject( controlRef.current ) &&
							controlRef.current.contains( activeElement )
						) {
							return;
						}

						// Try to match.
						const normalizedFilterValue = filterValue.toLocaleUpperCase();
						const foundOption = options.find(
							( option ) =>
								option.label
									.toLocaleUpperCase()
									.startsWith( normalizedFilterValue ) ||
								option.value.toLocaleUpperCase() ===
									normalizedFilterValue
						);
						if ( foundOption ) {
							onChange( foundOption.value );
						}
					}
				} }
				options={ options }
				value={ value || '' }
				allowReset={ false }
				autoComplete={ autoComplete }
				aria-invalid={ error.message && ! error.hidden }
			/>
			<ValidationInputError propertyName={ errorId } />
		</div>
	);
};

export default withInstanceId( Combobox );
woocommerce-blocks/assets/js/base/components/textarea/index.js000064400000001337151335517640020653 0ustar00/**
 * External dependencies
 */
import classnames from 'classnames';
import PropTypes from 'prop-types';

/**
 * Internal dependencies
 */
import './style.scss';

const Textarea = ( {
	className = '',
	disabled = false,
	onTextChange,
	placeholder,
	value = '',
} ) => {
	return (
		<textarea
			className={ classnames(
				'wc-block-components-textarea',
				className
			) }
			disabled={ disabled }
			onChange={ ( event ) => {
				onTextChange( event.target.value );
			} }
			placeholder={ placeholder }
			rows={ 2 }
			value={ value }
		/>
	);
};

Textarea.propTypes = {
	onTextChange: PropTypes.func.isRequired,
	disabled: PropTypes.bool,
	placeholder: PropTypes.string,
	value: PropTypes.string,
};

export default Textarea;
woocommerce-blocks/assets/js/base/components/textarea/style.scss000064400000001223151335517640021235 0ustar00.wc-block-components-textarea {
	@include font-size(regular);
	background-color: #fff;
	border: 1px solid $input-border-gray;
	border-radius: 4px;
	color: $input-text-active;
	font-family: inherit;
	line-height: 1.375; // =22px when font-size is 16px.
	margin: 0;
	padding: em($gap-small) $gap;
	width: 100%;

	.has-dark-controls & {
		background-color: $input-background-dark;
		border-color: $input-border-dark;
		color: $input-text-dark;

		&::placeholder {
			color: $input-placeholder-dark;
		}
	}
}

.theme-twentytwentyone {
	.has-dark-controls .wc-block-components-textarea {
		background-color: $input-background-dark;
		color: $input-text-dark;
	}
}
woocommerce-blocks/assets/js/base/components/drawer/index.tsx000064400000002552151335517640020524 0ustar00/**
 * External dependencies
 */
import { __ } from '@wordpress/i18n';
import { Modal } from '@wordpress/components';
import { useDebounce } from 'use-debounce';
import classNames from 'classnames';

/**
 * Internal dependencies
 */
import './style.scss';

interface DrawerProps {
	children: JSX.Element;
	className?: string;
	isOpen: boolean;
	onClose: () => void;
	slideIn?: boolean;
	slideOut?: boolean;
	title: string;
}

const Drawer = ( {
	children,
	className,
	isOpen,
	onClose,
	slideIn = true,
	slideOut = true,
	title,
}: DrawerProps ): JSX.Element | null => {
	const [ debouncedIsOpen ] = useDebounce< boolean >( isOpen, 300 );
	const isClosing = ! isOpen && debouncedIsOpen;

	if ( ! isOpen && ! isClosing ) {
		return null;
	}

	return (
		<Modal
			title={ title }
			focusOnMount={ true }
			onRequestClose={ onClose }
			className={ classNames( className, 'wc-block-components-drawer' ) }
			overlayClassName={ classNames(
				'wc-block-components-drawer__screen-overlay',
				{
					'wc-block-components-drawer__screen-overlay--is-hidden': ! isOpen,
					'wc-block-components-drawer__screen-overlay--with-slide-in': slideIn,
					'wc-block-components-drawer__screen-overlay--with-slide-out': slideOut,
				}
			) }
			closeButtonLabel={ __(
				'Close mini cart',
				'woo-gutenberg-products-block'
			) }
		>
			{ children }
		</Modal>
	);
};

export default Drawer;
woocommerce-blocks/assets/js/base/components/drawer/style.scss000064400000005703151335517640020713 0ustar00$drawer-animation-duration: 0.3s;
$drawer-width: 480px;
$drawer-width-mobile: 100vw;

@keyframes fadein {
	from {
		opacity: 0;
	}

	to {
		opacity: 1;
	}
}

@keyframes slidein {
	from {
		transform: translateX(0);
	}

	to {
		transform: translateX(-$drawer-width);
	}
}

@media only screen and (max-width: 480px) {
	@keyframes slidein {
		from {
			transform: translateX(0);
		}

		to {
			transform: translateX(-$drawer-width-mobile);
		}
	}
}

.wc-block-components-drawer__screen-overlay {
	background-color: rgba(95, 95, 95, 0.35);
	bottom: 0;
	left: 0;
	position: fixed;
	right: 0;
	top: 0;
	transition: opacity $drawer-animation-duration;
	z-index: 999;
	opacity: 1;
}

.wc-block-components-drawer__screen-overlay--with-slide-out {
	transition: opacity $drawer-animation-duration;
}

// We can't use transition for the slide-in animation because the element
// doesn't exist in the DOM when not open. Instead, use an animation that
// is triggered when the element is appended to the DOM.
.wc-block-components-drawer__screen-overlay--with-slide-in {
	animation-duration: $drawer-animation-duration;
	animation-name: fadein;
}

.wc-block-components-drawer__screen-overlay--is-hidden {
	pointer-events: none;
	opacity: 0;
}

.wc-block-components-drawer {
	@include with-translucent-border(0 0 0 1px);
	background: #fff;
	display: block;
	height: 100%;
	left: 100%;
	overflow: auto;
	position: fixed;
	right: 0;
	top: 0;
	transform: translateX(-$drawer-width);
	width: $drawer-width;

	@media only screen and (max-width: 480px) {
		transform: translateX(-$drawer-width-mobile);
		width: $drawer-width-mobile;
	}
}

.wc-block-components-drawer__screen-overlay--with-slide-out .wc-block-components-drawer {
	transition: transform $drawer-animation-duration;
}

.wc-block-components-drawer__screen-overlay--with-slide-in .wc-block-components-drawer {
	animation-duration: $drawer-animation-duration;
	animation-name: slidein;
}

.wc-block-components-drawer__screen-overlay--is-hidden .wc-block-components-drawer {
	transform: translateX(0);
}

@media screen and (prefers-reduced-motion: reduce) {
	.wc-block-components-drawer__screen-overlay {
		animation-name: none !important;
		transition: none !important;
	}
	.wc-block-components-drawer {
		animation-name: none !important;
		transition: none !important;
	}
}

.wc-block-components-drawer .components-modal__content {
	padding: $gap-largest $gap;
}

.wc-block-components-drawer .components-modal__header {
	position: relative;

	// Close button.
	.components-button {
		@include reset-box();
		background: transparent;
		position: absolute;
		right: 0;
		top: 0;
		// Increase clickable area.
		padding: 1em;
		margin: -1em;

		> span {
			@include visually-hidden();
		}
	}
}

// Same styles as `Title` component.
.wc-block-components-drawer .components-modal__header-heading {
	@include reset-box();
	// We need the font size to be in rem so it doesn't change depending on the parent element.
	@include font-size(large, 1rem);
	word-break: break-word;
}
woocommerce-blocks/assets/js/base/components/tabs/style.scss000064400000002347151335517640020361 0ustar00.wc-block-components-tabs {
	.wc-block-components-tabs__list {
		display: flex;
		flex-direction: row;
		flex-wrap: wrap;
		width: 100%;
		> .wc-block-components-tabs__item {
			border: none;
			flex: auto;
			background: transparent;
			padding: $gap-small $gap;
			color: inherit;
			outline-offset: -1px;
			text-align: center;
			transition: box-shadow 0.1s linear;
			box-shadow: inset 0 -1px currentColor;
			border-radius: 0;
			&.is-active {
				box-shadow: inset 0 -3px currentColor;
				font-weight: 600;
				position: relative;
			}
			&:focus {
				outline-offset: -1px;
				outline: 1px dotted currentColor;
			}
			&:hover,
			&:active {
				background: transparent;
			}
			.wc-block-components-tabs__item-content {
				@include font-size(regular);
				line-height: 1;
				width: fit-content;
				display: inline-block;
				font-weight: bold;

				> img,
				> svg {
					height: 1.2em;
					vertical-align: middle;
					margin: 0.2em 0 -0.2em;
				}

				.wc-block-components-payment-method-icons {
					margin: 0.2em 0 -0.2em;

					.wc-block-components-payment-method-icon {
						height: 1.2em;
						vertical-align: middle;
					}
				}
			}
		}
	}
	.wc-block-components-tabs__content {
		padding: $gap 0;
		text-transform: none;
	}
}
woocommerce-blocks/assets/js/base/components/tabs/index.js000064400000003623151335517640017767 0ustar00/**
 * External dependencies
 */
import { withInstanceId } from '@wordpress/compose';
import classnames from 'classnames';
import { __ } from '@wordpress/i18n';
import { useTabState, Tab, TabList, TabPanel } from 'reakit/Tab';
/**
 * Internal dependencies
 */
import './style.scss';

const Tabs = ( {
	className,
	onSelect = () => null,
	tabs,
	activeClass = 'is-active',
	initialTabName,
	ariaLabel = __( 'Tabbed Content', 'woocommerce' ),
	instanceId,
	id,
} ) => {
	const initialTab = initialTabName
		? { selectedId: `${ instanceId }-${ initialTabName }` }
		: undefined;
	const tabState = useTabState( initialTab );
	if ( tabs.length === 0 ) {
		return null;
	}
	return (
		<div className={ classnames( 'wc-block-components-tabs', className ) }>
			<TabList
				{ ...tabState }
				id={ id }
				className={ 'wc-block-components-tabs__list' }
				aria-label={ ariaLabel }
			>
				{ tabs.map( ( { name, title, ariaLabel: tabAriaLabel } ) => (
					<Tab
						{ ...tabState }
						id={ `${ instanceId }-${ name }` }
						manual={ true }
						className={ classnames(
							'wc-block-components-tabs__item',
							{
								[ activeClass ]:
									// reakit uses the ID as the selectedId
									`${ instanceId }-${ name }` ===
									tabState.selectedId,
							}
						) }
						onClick={ () => onSelect( name ) }
						type="button"
						key={ name }
						aria-label={ tabAriaLabel }
					>
						<span className="wc-block-components-tabs__item-content">
							{ title }
						</span>
					</Tab>
				) ) }
			</TabList>

			{ tabs.map( ( { name, content } ) => (
				<TabPanel
					{ ...tabState }
					key={ name }
					id={ `${ instanceId }-${ name }-view` }
					tabId={ `${ instanceId }-${ name }` }
					className="wc-block-components-tabs__content"
				>
					{ tabState.selectedId === `${ instanceId }-${ name }` &&
						content }
				</TabPanel>
			) ) }
		</div>
	);
};

export default withInstanceId( Tabs );
woocommerce-blocks/assets/js/base/components/sidebar-layout/index.js000064400000000227151335517640021757 0ustar00export { default as Sidebar } from './sidebar';
export { default as Main } from './main';
export { default as SidebarLayout } from './sidebar-layout';
woocommerce-blocks/assets/js/base/components/sidebar-layout/sidebar.js000064400000000552151335517640022262 0ustar00/**
 * External dependencies
 */
import classNames from 'classnames';
import PropTypes from 'prop-types';

const Sidebar = ( { children, className } ) => {
	return (
		<div
			className={ classNames( 'wc-block-components-sidebar', className ) }
		>
			{ children }
		</div>
	);
};

Sidebar.propTypes = {
	className: PropTypes.string,
};

export default Sidebar;
woocommerce-blocks/assets/js/base/components/sidebar-layout/main.js000064400000000530151335517640021571 0ustar00/**
 * External dependencies
 */
import classNames from 'classnames';
import PropTypes from 'prop-types';

const Main = ( { children, className } ) => {
	return (
		<div className={ classNames( 'wc-block-components-main', className ) }>
			{ children }
		</div>
	);
};

Main.propTypes = {
	className: PropTypes.string,
};

export default Main;
woocommerce-blocks/assets/js/base/components/sidebar-layout/style.scss000064400000002665151335517640022357 0ustar00.wc-block-components-sidebar-layout {
	display: flex;
	flex-wrap: wrap;
	margin: 0 auto $gap;
	position: relative;

	.wc-block-components-main {
		box-sizing: border-box;
		margin: 0;
		padding-right: percentage(math.div($gap-largest, 1060px)); // ~1060px is the default width of the content area in Storefront.
		width: 65%;
	}
}

.wc-block-components-sidebar {
	box-sizing: border-box;
	margin: 0;
	padding-left: percentage(math.div($gap-large, 1060px));
	width: 35%;

	.wc-block-components-panel > h2 {
		@include font-size(regular);
		@include reset-box();
	}
}

.is-medium,
.is-small,
.is-mobile {
	&.wc-block-components-sidebar-layout {
		flex-direction: column;
		margin: 0 auto $gap;

		.wc-block-components-main {
			padding: 0;
			width: 100%;
		}
		.wc-block-components-sidebar {
			padding: 0;
			width: 100%;
		}
	}
}

.is-large {
	.wc-block-components-sidebar {
		.wc-block-components-totals-item,
		.wc-block-components-panel {
			padding-left: $gap;
			padding-right: $gap;
		}

		.wc-block-components-panel {
			.wc-block-components-totals-item {
				padding: 0;
			}
		}
	}
}

.wc-block-components-sidebar .wc-block-components-panel > h2 {
	@include reset-typography();
	.wc-block-components-panel__button {
		font-weight: 400;
	}
}

// For Twenty Twenty we need to increase specificity a bit more.
.theme-twentytwenty {
	.wc-block-components-sidebar .wc-block-components-panel > h2 {
		@include font-size(large);
		@include reset-box();
	}
}
woocommerce-blocks/assets/js/base/components/sidebar-layout/sidebar-layout.js000064400000001106151335517640023571 0ustar00/**
 * External dependencies
 */
import classNames from 'classnames';
import PropTypes from 'prop-types';
import { ContainerWidthContextProvider } from '@woocommerce/base-context';

/**
 * Internal dependencies
 */
import './style.scss';

const SidebarLayout = ( { children, className } ) => {
	return (
		<ContainerWidthContextProvider
			className={ classNames(
				'wc-block-components-sidebar-layout',
				className
			) }
		>
			{ children }
		</ContainerWidthContextProvider>
	);
};

SidebarLayout.propTypes = {
	className: PropTypes.string,
};

export default SidebarLayout;
woocommerce-blocks/assets/js/base/components/reviews/review-list/style.scss000064400000000203151335517640023353 0ustar00// Duplicate class for specificity in the editor.
.wc-block-components-review-list.wc-block-components-review-list {
	margin: 0;
}
woocommerce-blocks/assets/js/base/components/reviews/review-list/index.js000064400000002211151335517640022764 0ustar00/**
 * External dependencies
 */
import PropTypes from 'prop-types';
import { getSetting } from '@woocommerce/settings';

/**
 * Internal dependencies
 */
import ReviewListItem from '../review-list-item';
import './style.scss';

const ReviewList = ( { attributes, reviews } ) => {
	const showAvatars = getSetting( 'showAvatars', true );
	const reviewRatingsEnabled = getSetting( 'reviewRatingsEnabled', true );
	const showReviewImage =
		( showAvatars || attributes.imageType === 'product' ) &&
		attributes.showReviewImage;
	const showReviewRating =
		reviewRatingsEnabled && attributes.showReviewRating;
	const attrs = {
		...attributes,
		showReviewImage,
		showReviewRating,
	};

	return (
		<ul className="wc-block-review-list wc-block-components-review-list">
			{ reviews.length === 0 ? (
				<ReviewListItem attributes={ attrs } />
			) : (
				reviews.map( ( review, i ) => (
					<ReviewListItem
						key={ review.id || i }
						attributes={ attrs }
						review={ review }
					/>
				) )
			) }
		</ul>
	);
};

ReviewList.propTypes = {
	attributes: PropTypes.object.isRequired,
	reviews: PropTypes.array.isRequired,
};

export default ReviewList;
woocommerce-blocks/assets/js/base/components/reviews/review-sort-select/style.scss000064400000000100151335517640024640 0ustar00.wc-block-components-review-sort-select {
	text-align: right;
}
woocommerce-blocks/assets/js/base/components/reviews/review-sort-select/index.js000064400000002164151335517640024264 0ustar00/**
 * External dependencies
 */
import { __ } from '@wordpress/i18n';
import PropTypes from 'prop-types';
import SortSelect from '@woocommerce/base-components/sort-select';

/**
 * Internal dependencies
 */
import './style.scss';

const ReviewSortSelect = ( { onChange, readOnly, value } ) => {
	return (
		<SortSelect
			className="wc-block-review-sort-select wc-block-components-review-sort-select"
			label={ __( 'Order by', 'woocommerce' ) }
			onChange={ onChange }
			options={ [
				{
					key: 'most-recent',
					label: __( 'Most recent', 'woocommerce' ),
				},
				{
					key: 'highest-rating',
					label: __(
						'Highest rating',
						'woocommerce'
					),
				},
				{
					key: 'lowest-rating',
					label: __(
						'Lowest rating',
						'woocommerce'
					),
				},
			] }
			readOnly={ readOnly }
			screenReaderLabel={ __(
				'Order reviews by',
				'woocommerce'
			) }
			value={ value }
		/>
	);
};

ReviewSortSelect.propTypes = {
	onChange: PropTypes.func,
	readOnly: PropTypes.bool,
	value: PropTypes.oneOf( [
		'most-recent',
		'highest-rating',
		'lowest-rating',
	] ),
};

export default ReviewSortSelect;
woocommerce-blocks/assets/js/base/components/reviews/index.js000064400000000273151335517640020520 0ustar00export { default as ReviewList } from './review-list';
export { default as ReviewListItem } from './review-list-item';
export { default as ReviewSortSelect } from './review-sort-select';
woocommerce-blocks/assets/js/base/components/reviews/review-list-item/index.js000064400000012626151335517640023733 0ustar00/**
 * External dependencies
 */
import { __, sprintf } from '@wordpress/i18n';
import PropTypes from 'prop-types';
import classNames from 'classnames';
import ReadMore from '@woocommerce/base-components/read-more';

/**
 * Internal dependencies
 */
import './style.scss';

function getReviewImage( review, imageType, isLoading ) {
	if ( isLoading || ! review ) {
		return (
			<div className="wc-block-review-list-item__image wc-block-components-review-list-item__image" />
		);
	}

	return (
		<div className="wc-block-review-list-item__image wc-block-components-review-list-item__image">
			{ imageType === 'product' ? (
				<img
					aria-hidden="true"
					alt={ review.product_image?.alt || '' }
					src={ review.product_image?.thumbnail || '' }
				/>
			) : (
				<img
					aria-hidden="true"
					alt=""
					src={ review.reviewer_avatar_urls[ '96' ] || '' }
				/>
			) }
			{ review.verified && (
				<div
					className="wc-block-review-list-item__verified wc-block-components-review-list-item__verified"
					title={ __(
						'Verified buyer',
						'woocommerce'
					) }
				>
					{ __( 'Verified buyer', 'woocommerce' ) }
				</div>
			) }
		</div>
	);
}

function getReviewContent( review ) {
	return (
		<ReadMore
			maxLines={ 10 }
			moreText={ __(
				'Read full review',
				'woocommerce'
			) }
			lessText={ __(
				'Hide full review',
				'woocommerce'
			) }
			className="wc-block-review-list-item__text wc-block-components-review-list-item__text"
		>
			<div
				dangerouslySetInnerHTML={ {
					// `content` is the `review` parameter returned by the `reviews` endpoint.
					// It's filtered with `wp_filter_post_kses()`, which removes dangerous HTML tags,
					// so using it inside `dangerouslySetInnerHTML` is safe.
					__html: review.review || '',
				} }
			/>
		</ReadMore>
	);
}

function getReviewProductName( review ) {
	return (
		<div className="wc-block-review-list-item__product wc-block-components-review-list-item__product">
			<a
				href={ review.product_permalink }
				dangerouslySetInnerHTML={ {
					// `product_name` might have html entities for things like
					// emdash. So to display properly we need to allow the
					// browser to render.
					__html: review.product_name,
				} }
			/>
		</div>
	);
}

function getReviewerName( review ) {
	const { reviewer = '' } = review;
	return (
		<div className="wc-block-review-list-item__author wc-block-components-review-list-item__author">
			{ reviewer }
		</div>
	);
}

function getReviewDate( review ) {
	const {
		date_created: dateCreated,
		formatted_date_created: formattedDateCreated,
	} = review;
	return (
		<time
			className="wc-block-review-list-item__published-date wc-block-components-review-list-item__published-date"
			dateTime={ dateCreated }
		>
			{ formattedDateCreated }
		</time>
	);
}

function getReviewRating( review ) {
	const { rating } = review;
	const starStyle = {
		width: ( rating / 5 ) * 100 + '%' /* stylelint-disable-line */,
	};
	const ratingText = sprintf(
		/* translators: %f is referring to the average rating value */
		__( 'Rated %f out of 5', 'woocommerce' ),
		rating
	);
	return (
		<div className="wc-block-review-list-item__rating wc-block-components-review-list-item__rating">
			<div
				className="wc-block-review-list-item__rating__stars wc-block-components-review-list-item__rating__stars"
				role="img"
				aria-label={ ratingText }
			>
				<span style={ starStyle }>{ ratingText }</span>
			</div>
		</div>
	);
}

const ReviewListItem = ( { attributes, review = {} } ) => {
	const {
		imageType,
		showReviewDate,
		showReviewerName,
		showReviewImage,
		showReviewRating: showReviewRatingAttr,
		showReviewContent,
		showProductName,
	} = attributes;
	const { rating } = review;
	const isLoading = ! Object.keys( review ).length > 0;
	const showReviewRating = Number.isFinite( rating ) && showReviewRatingAttr;

	return (
		<li
			className={ classNames(
				'wc-block-review-list-item__item',
				'wc-block-components-review-list-item__item',
				{
					'is-loading': isLoading,
					'wc-block-components-review-list-item__item--has-image': showReviewImage,
				}
			) }
			aria-hidden={ isLoading }
		>
			{ ( showProductName ||
				showReviewDate ||
				showReviewerName ||
				showReviewImage ||
				showReviewRating ) && (
				<div className="wc-block-review-list-item__info wc-block-components-review-list-item__info">
					{ showReviewImage &&
						getReviewImage( review, imageType, isLoading ) }
					{ ( showProductName ||
						showReviewerName ||
						showReviewRating ||
						showReviewDate ) && (
						<div className="wc-block-review-list-item__meta wc-block-components-review-list-item__meta">
							{ showReviewRating && getReviewRating( review ) }
							{ showProductName &&
								getReviewProductName( review ) }
							{ showReviewerName && getReviewerName( review ) }
							{ showReviewDate && getReviewDate( review ) }
						</div>
					) }
				</div>
			) }
			{ showReviewContent && getReviewContent( review ) }
		</li>
	);
};

ReviewListItem.propTypes = {
	attributes: PropTypes.object.isRequired,
	review: PropTypes.object,
};

/**
 * BE AWARE. ReviewListItem expects product data that is equivalent to what is
 * made available for output in a public view. Thus content that may contain
 * html data is not sanitized further.
 *
 * Currently the following data is trusted (assumed to already be sanitized):
 * - `review.review` (review content)
 * - `review.product_name` (the product title)
 */
export default ReviewListItem;
woocommerce-blocks/assets/js/base/components/reviews/review-list-item/style.scss000064400000012434151335517640024320 0ustar00.is-loading {
	.wc-block-components-review-list-item__text {
		@include placeholder();
		@include force-content();
		display: block;
		width: 60%;
	}

	.wc-block-components-review-list-item__info {
		.wc-block-components-review-list-item__image {
			@include placeholder();
			@include force-content();
		}

		.wc-block-components-review-list-item__meta {
			.wc-block-components-review-list-item__author {
				@include placeholder();
				@include font-size(regular);
				@include force-content();
				width: 80px;
			}

			.wc-block-components-review-list-item__product {
				display: none;
			}

			.wc-block-components-review-list-item__rating {
				.wc-block-components-review-list-item__rating__stars > span {
					display: none;
				}
			}
		}

		.wc-block-components-review-list-item__published-date {
			@include placeholder();
			@include force-content();
			height: 1em;
			width: 120px;
		}
	}
}

.editor-styles-wrapper .wc-block-components-review-list-item__item,
.wc-block-components-review-list-item__item {
	margin: 0 0 $gap-large * 2;
	list-style: none;
}

.wc-block-components-review-list-item__info {
	display: grid;
	grid-template-columns: 1fr;
	margin-bottom: $gap-large;
}

.wc-block-components-review-list-item__meta {
	grid-column: 1;
	grid-row: 1;
}

.wc-block-components-review-list-item__item--has-image {
	.wc-block-components-review-list-item__info {
		grid-template-columns: calc(3em + #{$gap}) 1fr;
	}
	.wc-block-components-review-list-item__meta {
		grid-column: 2;
	}
}

.wc-block-components-review-list-item__image {
	align-items: center;
	display: flex;
	height: 3em;
	grid-column: 1;
	grid-row: 1 / 3;
	justify-content: center;
	position: relative;
	width: 3em;

	> img {
		display: block;
		max-height: 100%;
		object-fit: contain;
	}
}

.wc-block-components-review-list-item__verified {
	width: 21px;
	height: 21px;
	text-indent: 21px;
	margin: 0;
	line-height: 21px;
	overflow: hidden;
	position: absolute;
	right: -7px;
	bottom: -7px;

	&::before {
		width: 21px;
		height: 21px;
		background: transparent url('data:image/svg+xml;utf8,%3Csvg xmlns="http://www.w3.org/2000/svg" width="21" height="21" fill="none"%3E%3Ccircle cx="10.5" cy="10.5" r="10.5" fill="%23fff"/%3E%3Cpath fill="%23008A21" fill-rule="evenodd" d="M2.1667 10.5003c0-4.6 3.7333-8.3333 8.3333-8.3333s8.3334 3.7333 8.3334 8.3333S15.1 18.8337 10.5 18.8337s-8.3333-3.7334-8.3333-8.3334zm2.5 0l4.1666 4.1667 7.5001-7.5-1.175-1.1833-6.325 6.325-2.9917-2.9834-1.175 1.175z" clip-rule="evenodd"/%3E%3Cmask id="a" width="17" height="17" x="2" y="2" maskUnits="userSpaceOnUse"%3E%3Cpath fill="%23fff" fill-rule="evenodd" d="M2.1667 10.5003c0-4.6 3.7333-8.3333 8.3333-8.3333s8.3334 3.7333 8.3334 8.3333S15.1 18.8337 10.5 18.8337s-8.3333-3.7334-8.3333-8.3334zm2.5 0l4.1666 4.1667 7.5001-7.5-1.175-1.1833-6.325 6.325-2.9917-2.9834-1.175 1.175z" clip-rule="evenodd"/%3E%3C/mask%3E%3Cg mask="url(%23a)"%3E%3Cpath fill="%23008A21" d="M.5.5h20v20H.5z"/%3E%3C/g%3E%3C/svg%3E') center center no-repeat; /* stylelint-disable-line */
		display: block;
		content: "";
	}
}

.wc-block-components-review-list-item__meta {
	display: flex;
	align-items: center;
	flex-flow: row wrap;

	&::after {
		// Force wrap after star rating.
		order: 3;
		content: "";
		flex-basis: 100%;
	}
}

.wc-block-components-review-list-item__product {
	display: block;
	font-weight: bold;
	order: 1;
	margin-right: $gap*0.5;
}

.wc-block-components-review-list-item__author {
	display: block;
	font-weight: bold;
	order: 1;
	margin-right: $gap*0.5;
}

.wc-block-components-review-list-item__product + .wc-block-components-review-list-item__author {
	font-weight: normal;
	order: 4;
}

.wc-block-components-review-list-item__published-date {
	order: 5;
}

.wc-block-components-review-list-item__product + .wc-block-components-review-list-item__author + .wc-block-components-review-list-item__published-date {
	padding-left: $gap/2;
	position: relative;

	&::before {
		content: "";
		display: inline-block;
		margin-left: -$gap*0.5;
		border-right: 1px solid currentColor;
		opacity: 0.5;
		height: 1em;
		vertical-align: middle;
		position: absolute;
		top: calc(50% + 0.1em);
		transform: translateY(-50%);
	}
}

.wc-block-components-review-list-item__author:first-child + .wc-block-components-review-list-item__published-date,
.wc-block-components-review-list-item__rating + .wc-block-components-review-list-item__author + .wc-block-components-review-list-item__published-date {
	&::before {
		display: none;
	}
}

.wc-block-components-review-list-item__rating {
	order: 2;

	> .wc-block-components-review-list-item__rating__stars {
		@include font-size(regular);
		display: block;
		top: 0;
		overflow: hidden;
		position: relative;
		height: 1em;
		line-height: 1;
		width: 5.3em;
		font-family: star; /* stylelint-disable-line */
		font-weight: 400;
	}

	> .wc-block-components-review-list-item__rating__stars::before {
		content: "\53\53\53\53\53";
		opacity: 0.25;
		float: left;
		top: 0;
		left: 0;
		position: absolute;
	}

	> .wc-block-components-review-list-item__rating__stars span {
		overflow: hidden;
		float: left;
		top: 0;
		left: 0;
		position: absolute;
		padding-top: 1.5em;
	}

	> .wc-block-components-review-list-item__rating__stars span::before {
		content: "\53\53\53\53\53";
		top: 0;
		position: absolute;
		left: 0;
		color: #e6a237;
	}
}

.wc-block-components-review-list-item__text p {
	font-size: inherit;
}
woocommerce-blocks/assets/js/base/components/title/index.js000064400000002063151335517640020154 0ustar00/**
 * External dependencies
 */
import classNames from 'classnames';
import PropTypes from 'prop-types';

/**
 * Internal dependencies
 */
import './style.scss';

/** @typedef {import('react')} React */

/**
 * Component that renders a block title.
 *
 * @param {Object} props Incoming props for the component.
 * @param {React.ReactNode} [props.children] Children elements this component wraps.
 * @param {string} [props.className] CSS class used.
 * @param {string} props.headingLevel Heading level for title.
 * @param {Object} [props.props] Rest of props passed through to component.
 */
const Title = ( { children, className, headingLevel, ...props } ) => {
	const buttonClassName = classNames(
		'wc-block-components-title',
		className
	);
	const TagName = `h${ headingLevel }`;

	return (
		<TagName className={ buttonClassName } { ...props }>
			{ children }
		</TagName>
	);
};

Title.propTypes = {
	headingLevel: PropTypes.oneOf( [ '1', '2', '3', '4', '5', '6' ] )
		.isRequired,
	className: PropTypes.string,
	children: PropTypes.node,
};

export default Title;
woocommerce-blocks/assets/js/base/components/title/style.scss000064400000000644151335517640020547 0ustar00// Extra class for specificity to overwrite editor styles.
.wc-block-components-title.wc-block-components-title {
	@include reset-box();
	@include font-size(large);
	word-break: break-word;
}

// For Twenty Twenty we need to increase specificity a bit more.
.theme-twentytwenty {
	.wc-block-components-title.wc-block-components-title {
		@include reset-box();
		@include font-size(large);
		word-break: break-word;
	}
}
woocommerce-blocks/assets/js/base/components/dropdown-selector/menu.js000064400000002416151335517640022344 0ustar00/**
 * External dependencies
 */
import { __, sprintf } from '@wordpress/i18n';
import classNames from 'classnames';

const DropdownSelectorMenu = ( {
	checked,
	getItemProps,
	getMenuProps,
	highlightedIndex,
	options,
} ) => {
	return (
		<ul
			{ ...getMenuProps( {
				className:
					'wc-block-dropdown-selector__list wc-block-components-dropdown-selector__list',
			} ) }
		>
			{ options.map( ( option, index ) => {
				const selected = checked.includes( option.value );
				return (
					// eslint-disable-next-line react/jsx-key
					<li
						{ ...getItemProps( {
							key: option.value,
							className: classNames(
								'wc-block-dropdown-selector__list-item',
								'wc-block-components-dropdown-selector__list-item',
								{
									'is-selected': selected,
									'is-highlighted':
										highlightedIndex === index,
								}
							),
							index,
							item: option.value,
							'aria-label': selected
								? sprintf(
										/* translators: %s is referring to the filter option being removed. */
										__(
											'Remove %s filter',
											'woocommerce'
										),
										option.name
								  )
								: null,
						} ) }
					>
						{ option.label }
					</li>
				);
			} ) }
		</ul>
	);
};

export default DropdownSelectorMenu;
woocommerce-blocks/assets/js/base/components/dropdown-selector/selected-value.js000064400000003224151335517640024300 0ustar00/**
 * External dependencies
 */
import { __, sprintf } from '@wordpress/i18n';
import { useEffect, useRef } from '@wordpress/element';
import { Icon, noAlt } from '@woocommerce/icons';

const DropdownSelectorSelectedValue = ( { onClick, onRemoveItem, option } ) => {
	const labelRef = useRef( null );

	useEffect( () => {
		labelRef.current.focus();
	}, [ labelRef ] );

	return (
		<div className="wc-block-dropdown-selector__selected-value wc-block-components-dropdown-selector__selected-value">
			<button
				ref={ labelRef }
				className="wc-block-dropdown-selector__selected-value__label wc-block-components-dropdown-selector__selected-value__label"
				onClick={ ( e ) => {
					e.stopPropagation();
					onClick( option.value );
				} }
				aria-label={ sprintf(
					/* translators: %s attribute value used in the filter. For example: yellow, green, small, large. */
					__(
						'Replace current %s filter',
						'woocommerce'
					),
					option.name
				) }
			>
				{ option.label }
			</button>
			<button
				className="wc-block-dropdown-selector__selected-value__remove wc-block-components-dropdown-selector__selected-value__remove"
				onClick={ () => {
					onRemoveItem( option.value );
				} }
				onKeyDown={ ( e ) => {
					if ( e.key === 'Backspace' || e.key === 'Delete' ) {
						onRemoveItem( option.value );
					}
				} }
				aria-label={ sprintf(
					/* translators: %s attribute value used in the filter. For example: yellow, green, small, large. */
					__( 'Remove %s filter', 'woocommerce' ),
					option.name
				) }
			>
				<Icon srcElement={ noAlt } size={ 16 } />
			</button>
		</div>
	);
};

export default DropdownSelectorSelectedValue;
woocommerce-blocks/assets/js/base/components/dropdown-selector/input.js000064400000001162151335517640022534 0ustar00const DropdownSelectorInput = ( {
	checked,
	getInputProps,
	inputRef,
	isDisabled,
	onFocus,
	onRemoveItem,
	placeholder,
	tabIndex,
	value,
} ) => {
	return (
		<input
			{ ...getInputProps( {
				ref: inputRef,
				className:
					'wc-block-dropdown-selector__input wc-block-components-dropdown-selector__input',
				disabled: isDisabled,
				onFocus,
				onKeyDown( e ) {
					if (
						e.key === 'Backspace' &&
						! value &&
						checked.length > 0
					) {
						onRemoveItem( checked[ checked.length - 1 ] );
					}
				},
				placeholder,
				tabIndex,
			} ) }
		/>
	);
};

export default DropdownSelectorInput;
woocommerce-blocks/assets/js/base/components/dropdown-selector/input-wrapper.js000064400000000634151335517640024215 0ustar00const DropdownSelectorInputWrapper = ( { children, onClick } ) => {
	return (
		/* eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-static-element-interactions */
		<div
			className="wc-block-dropdown-selector__input-wrapper wc-block-components-dropdown-selector__input-wrapper"
			onClick={ onClick }
		>
			{ children }
		</div>
	);
};

export default DropdownSelectorInputWrapper;
woocommerce-blocks/assets/js/base/components/dropdown-selector/style.scss000064400000006675151335517640023112 0ustar00// 18px is the minimum input field line-height and 14px is the font-size of
// the drop down selector elements.

$dropdown-selector-line-height: math.div(18, 14);

.wc-block-components-dropdown-selector {
	max-width: 300px;
	position: relative;
	width: 100%;
}

.wc-block-components-dropdown-selector__input-wrapper {
	background: #fff;
	border: 1px solid $input-border-gray;
	color: $input-text-active;
	align-items: center;
	border-radius: 4px;
	cursor: text;
	display: flex;
	flex-wrap: wrap;
	padding: 2px $gap-smaller;

	.is-disabled & {
		background-color: $gray-200;
	}

	.is-multiple.has-checked > & {
		padding: 2px $gap-smallest;
	}

	.is-open > & {
		border-radius: 4px 4px 0 0;
	}
}

.wc-block-components-dropdown-selector__input {
	@include font-size(small);
	line-height: $dropdown-selector-line-height;
	margin: em($gap-small*0.25) 0;
	min-width: 0;
	padding: em($gap-smallest * 0.75) 0 em($gap-smallest * 0.75);

	.is-single & {
		width: 100%;

		&:hover,
		&:focus,
		&:active {
			outline: 0;
		}
	}

	.is-single.has-checked.is-open & {
		margin-bottom: 1.5px;
		margin-top: 1.5px;
	}

	.is-single.has-checked:not(.is-open) & {
		@include visually-hidden();
		// Fixes an issue in Firefox that `flex: wrap` in the container was making
		// this element to still occupy one line.
		position: absolute;
	}

	.is-multiple & {
		flex: 1;
		min-width: 0;
	}
}

// Visually hide the input
.is-single .wc-block-components-dropdown-selector__input:first-child,
.is-multiple .wc-block-components-dropdown-selector__input {
	background: transparent;
	border: 0;

	&:hover,
	&:focus,
	&:active {
		outline: 0;
	}
}

.wc-block-components-dropdown-selector {
	// Reset <button> styles
	.wc-block-components-dropdown-selector__selected-value__label,
	.wc-block-components-dropdown-selector__selected-value__remove {
		background-color: transparent;
		border: 0;
		color: inherit;
		font-size: inherit;
		font-weight: inherit;
		text-transform: initial;

		&:hover,
		&:focus,
		&:active {
			background-color: transparent;
			text-decoration: none;
		}
	}

	.wc-block-components-dropdown-selector__selected-value {
		@include font-size(small);
		align-items: center;
		color: $gray-700;
		display: inline-flex;
		margin: em($gap-small*0.25) 0;
		padding: em($gap-smallest * 0.75) 0 em($gap-smallest * 0.75);
		width: 100%;
	}

	.wc-block-components-dropdown-selector__selected-value__label {
		flex-grow: 1;
		line-height: $dropdown-selector-line-height;
		padding: 0;
		text-align: left;
	}

	.wc-block-components-dropdown-selector__selected-value__remove {
		background-color: transparent;
		border: 0;
		display: inline-block;
		line-height: 1;
		padding: 0 0 0 0.3em;

		> svg {
			display: block;
		}
	}

	.wc-block-components-dropdown-selector__selected-chip {
		@include font-size(small);
		margin-top: em($gap-small*0.25);
		margin-bottom: em($gap-small*0.25);
		line-height: $dropdown-selector-line-height;
	}
}

.wc-block-components-dropdown-selector__list {
	background-color: #fff;
	margin: -1px 0 0;
	padding: 0;
	position: absolute;
	left: 0;
	right: 0;
	top: 100%;
	max-height: 300px;
	overflow-y: auto;
	z-index: 1;

	&:not(:empty) {
		border: 1px solid #9f9f9f;
	}
}

.wc-block-components-dropdown-selector__list-item {
	@include font-size(small);
	color: $gray-700;
	cursor: default;
	list-style: none;
	margin: 0;
	padding: 0 $gap-smallest;

	&.is-selected {
		background-color: $gray-300;
	}

	&:hover,
	&:focus,
	&.is-highlighted,
	&:active {
		background-color: #00669e;
		color: #fff;
	}
}
woocommerce-blocks/assets/js/base/components/dropdown-selector/selected-chip.js000064400000001314151335517640024105 0ustar00/**
 * External dependencies
 */
import { __, sprintf } from '@wordpress/i18n';
import { RemovableChip } from '@woocommerce/base-components/chip';

const DropdownSelectorSelectedChip = ( { onRemoveItem, option } ) => {
	return (
		<RemovableChip
			className="wc-block-dropdown-selector__selected-chip wc-block-components-dropdown-selector__selected-chip"
			removeOnAnyClick={ true }
			onRemove={ () => {
				onRemoveItem( option.value );
			} }
			ariaLabel={ sprintf(
				/* translators: %s is referring to the filter option being removed. */
				__( 'Remove %s filter', 'woocommerce' ),
				option.name
			) }
			text={ option.label }
			radius="large"
		/>
	);
};

export default DropdownSelectorSelectedChip;
woocommerce-blocks/assets/js/base/components/dropdown-selector/index.js000064400000013055151335517640022510 0ustar00/**
 * External dependencies
 */
import PropTypes from 'prop-types';
import { useCallback, useRef } from '@wordpress/element';
import classNames from 'classnames';
import Downshift from 'downshift';
import { __, sprintf } from '@wordpress/i18n';

/**
 * Internal dependencies
 */
import DropdownSelectorInput from './input';
import DropdownSelectorInputWrapper from './input-wrapper';
import DropdownSelectorMenu from './menu';
import DropdownSelectorSelectedChip from './selected-chip';
import DropdownSelectorSelectedValue from './selected-value';
import './style.scss';

/**
 * Component used to show an input box with a dropdown with suggestions.
 *
 * @param {Object} props Incoming props for the component.
 * @param {string} props.attributeLabel Label for the attributes.
 * @param {string} props.className CSS class used.
 * @param {Array} props.checked Which items are checked.
 * @param {string} props.inputLabel Label used for the input.
 * @param {boolean} props.isDisabled Whether the input is disabled or not.
 * @param {boolean} props.isLoading Whether the input is loading.
 * @param {boolean} props.multiple Whether multi-select is allowed.
 * @param {function():any} props.onChange Function to be called when onChange event fires.
 * @param {Array} props.options The option values to show in the select.
 */
const DropdownSelector = ( {
	attributeLabel = '',
	className,
	checked = [],
	inputLabel = '',
	isDisabled = false,
	isLoading = false,
	multiple = false,
	onChange = () => {},
	options = [],
} ) => {
	const inputRef = useRef( null );

	const classes = classNames(
		className,
		'wc-block-dropdown-selector',
		'wc-block-components-dropdown-selector',
		{
			'is-disabled': isDisabled,
			'is-loading': isLoading,
		}
	);

	/**
	 * State reducer for the downshift component.
	 * See: https://github.com/downshift-js/downshift#statereducer
	 */
	const stateReducer = useCallback(
		( state, changes ) => {
			switch ( changes.type ) {
				case Downshift.stateChangeTypes.keyDownEnter:
				case Downshift.stateChangeTypes.clickItem:
					return {
						...changes,
						highlightedIndex: state.highlightedIndex,
						isOpen: multiple,
						inputValue: '',
					};
				case Downshift.stateChangeTypes.blurInput:
				case Downshift.stateChangeTypes.mouseUp:
					return {
						...changes,
						inputValue: state.inputValue,
					};
				default:
					return changes;
			}
		},
		[ multiple ]
	);

	return (
		<Downshift
			onChange={ onChange }
			selectedItem={ null }
			stateReducer={ stateReducer }
		>
			{ ( {
				getInputProps,
				getItemProps,
				getLabelProps,
				getMenuProps,
				highlightedIndex,
				inputValue,
				isOpen,
				openMenu,
			} ) => (
				<div
					className={ classNames( classes, {
						'is-multiple': multiple,
						'is-single': ! multiple,
						'has-checked': checked.length > 0,
						'is-open': isOpen,
					} ) }
				>
					{ /* eslint-disable-next-line jsx-a11y/label-has-for */ }
					<label
						{ ...getLabelProps( {
							className: 'screen-reader-text',
						} ) }
					>
						{ inputLabel }
					</label>
					<DropdownSelectorInputWrapper
						isOpen={ isOpen }
						onClick={ () => inputRef.current.focus() }
					>
						{ checked.map( ( value ) => {
							const option = options.find(
								( o ) => o.value === value
							);
							const onRemoveItem = ( val ) => {
								onChange( val );
								inputRef.current.focus();
							};
							return multiple ? (
								<DropdownSelectorSelectedChip
									key={ value }
									onRemoveItem={ onRemoveItem }
									option={ option }
								/>
							) : (
								<DropdownSelectorSelectedValue
									key={ value }
									onClick={ () => inputRef.current.focus() }
									onRemoveItem={ onRemoveItem }
									option={ option }
								/>
							);
						} ) }
						<DropdownSelectorInput
							checked={ checked }
							getInputProps={ getInputProps }
							inputRef={ inputRef }
							isDisabled={ isDisabled }
							onFocus={ openMenu }
							onRemoveItem={ ( val ) => {
								onChange( val );
								inputRef.current.focus();
							} }
							placeholder={
								checked.length > 0 && multiple
									? null
									: sprintf(
											/* translators: %s attribute name. */
											__(
												'Any %s',
												'woocommerce'
											),
											attributeLabel
									  )
							}
							tabIndex={
								// When it's a single selector and there is one element selected,
								// we make the input non-focusable with the keyboard because it's
								// visually hidden. The input is still rendered, though, because it
								// must be possible to focus it when pressing the select value chip.
								! multiple && checked.length > 0 ? '-1' : '0'
							}
							value={ inputValue }
						/>
					</DropdownSelectorInputWrapper>
					{ isOpen && ! isDisabled && (
						<DropdownSelectorMenu
							checked={ checked }
							getItemProps={ getItemProps }
							getMenuProps={ getMenuProps }
							highlightedIndex={ highlightedIndex }
							options={ options.filter(
								( option ) =>
									! inputValue ||
									option.value.startsWith( inputValue )
							) }
						/>
					) }
				</div>
			) }
		</Downshift>
	);
};

DropdownSelector.propTypes = {
	attributeLabel: PropTypes.string,
	checked: PropTypes.array,
	className: PropTypes.string,
	inputLabel: PropTypes.string,
	isDisabled: PropTypes.bool,
	isLoading: PropTypes.bool,
	limit: PropTypes.number,
	onChange: PropTypes.func,
	options: PropTypes.arrayOf(
		PropTypes.shape( {
			label: PropTypes.node.isRequired,
			value: PropTypes.string.isRequired,
		} )
	),
};

export default DropdownSelector;
woocommerce-blocks/assets/js/base/components/sort-select/index.js000064400000004524151335517640021303 0ustar00/**
 * External dependencies
 */
import PropTypes from 'prop-types';
import classNames from 'classnames';
import Label from '@woocommerce/base-components/label';
import { withInstanceId } from '@wordpress/compose';

/**
 * Internal dependencies
 */
import './style.scss';

/**
 * Component used for 'Order by' selectors, which renders a label
 * and a <select> with the options provided in the props.
 *
 * @param {Object} props Incoming props for the component.
 * @param {string} props.className CSS class used.
 * @param {string} props.instanceId Unique id for component instance.
 * @param {string} props.label Label for the select.
 * @param {function():any} props.onChange Function to call on the change event.
 * @param {Array} props.options Option values for the select.
 * @param {string} props.screenReaderLabel Screen reader label.
 * @param {boolean} props.readOnly Whether the select is read only or not.
 * @param {string} props.value The selected value.
 */
const SortSelect = ( {
	className,
	instanceId,
	label,
	onChange,
	options,
	screenReaderLabel,
	readOnly,
	value,
} ) => {
	const selectId = `wc-block-components-sort-select__select-${ instanceId }`;

	return (
		<div
			className={ classNames(
				'wc-block-sort-select',
				'wc-block-components-sort-select',
				className
			) }
		>
			<Label
				label={ label }
				screenReaderLabel={ screenReaderLabel }
				wrapperElement="label"
				wrapperProps={ {
					className:
						'wc-block-sort-select__label wc-block-components-sort-select__label',
					htmlFor: selectId,
				} }
			/>
			<select // eslint-disable-line jsx-a11y/no-onchange
				id={ selectId }
				className="wc-block-sort-select__select wc-block-components-sort-select__select"
				onChange={ onChange }
				readOnly={ readOnly }
				value={ value }
			>
				{ options.map( ( option ) => (
					<option key={ option.key } value={ option.key }>
						{ option.label }
					</option>
				) ) }
			</select>
		</div>
	);
};

SortSelect.propTypes = {
	label: PropTypes.string,
	onChange: PropTypes.func,
	options: PropTypes.arrayOf(
		PropTypes.shape( {
			key: PropTypes.string.isRequired,
			label: PropTypes.string.isRequired,
		} )
	),
	readOnly: PropTypes.bool,
	screenReaderLabel: PropTypes.string,
	value: PropTypes.string,
	// from withInstanceId
	instanceId: PropTypes.number.isRequired,
};

export default withInstanceId( SortSelect );
woocommerce-blocks/assets/js/base/components/sort-select/style.scss000064400000000417151335517640021670 0ustar00.wc-block-components-sort-select {
	margin-bottom: $gap-small;
}

.wc-block-components-sort-select__label {
	margin-right: $gap-small;
	display: inline-block;
	font-weight: normal;
}

.wc-block-components-sort-select__select {
	font-size: inherit;
	width: max-content;
}
woocommerce-blocks/assets/js/base/components/checkbox-list/index.js000064400000010372151335517640021574 0ustar00/**
 * External dependencies
 */
import { __, _n, sprintf } from '@wordpress/i18n';
import PropTypes from 'prop-types';
import { Fragment, useMemo, useState } from '@wordpress/element';
import classNames from 'classnames';

/**
 * Internal dependencies
 */
import './style.scss';

/**
 * Component used to show a list of checkboxes in a group.
 *
 * @param {Object} props Incoming props for the component.
 * @param {string} props.className CSS class used.
 * @param {function(string):any} props.onChange Function called when inputs change.
 * @param {Array} props.options Options for list.
 * @param {Array} props.checked Which items are checked.
 * @param {boolean} props.isLoading If loading or not.
 * @param {boolean} props.isDisabled If inputs are disabled or not.
 * @param {number} props.limit Whether to limit the number of inputs showing.
 */
const CheckboxList = ( {
	className,
	onChange = () => {},
	options = [],
	checked = [],
	isLoading = false,
	isDisabled = false,
	limit = 10,
} ) => {
	const [ showExpanded, setShowExpanded ] = useState( false );

	const placeholder = useMemo( () => {
		return [ ...Array( 5 ) ].map( ( x, i ) => (
			<li
				key={ i }
				style={ {
					/* stylelint-disable */
					width: Math.floor( Math.random() * 75 ) + 25 + '%',
				} }
			/>
		) );
	}, [] );

	const renderedShowMore = useMemo( () => {
		const optionCount = options.length;
		const remainingOptionsCount = optionCount - limit;
		return (
			! showExpanded && (
				<li key="show-more" className="show-more">
					<button
						onClick={ () => {
							setShowExpanded( true );
						} }
						aria-expanded={ false }
						aria-label={ sprintf(
							/* translators: %s is referring the remaining count of options */
							_n(
								'Show %s more option',
								'Show %s more options',
								remainingOptionsCount,
								'woocommerce'
							),
							remainingOptionsCount
						) }
					>
						{ sprintf(
							/* translators: %s number of options to reveal. */
							_n(
								'Show %s more',
								'Show %s more',
								remainingOptionsCount,
								'woocommerce'
							),
							remainingOptionsCount
						) }
					</button>
				</li>
			)
		);
	}, [ options, limit, showExpanded ] );

	const renderedShowLess = useMemo( () => {
		return (
			showExpanded && (
				<li key="show-less" className="show-less">
					<button
						onClick={ () => {
							setShowExpanded( false );
						} }
						aria-expanded={ true }
						aria-label={ __(
							'Show less options',
							'woocommerce'
						) }
					>
						{ __( 'Show less', 'woocommerce' ) }
					</button>
				</li>
			)
		);
	}, [ showExpanded ] );

	const renderedOptions = useMemo( () => {
		// Truncate options if > the limit + 5.
		const optionCount = options.length;
		const shouldTruncateOptions = optionCount > limit + 5;
		return (
			<>
				{ options.map( ( option, index ) => (
					<Fragment key={ option.value }>
						<li
							{ ...( shouldTruncateOptions &&
								! showExpanded &&
								index >= limit && { hidden: true } ) }
						>
							<input
								type="checkbox"
								id={ option.value }
								value={ option.value }
								onChange={ ( event ) => {
									onChange( event.target.value );
								} }
								checked={ checked.includes( option.value ) }
								disabled={ isDisabled }
							/>
							<label htmlFor={ option.value }>
								{ option.label }
							</label>
						</li>
						{ shouldTruncateOptions &&
							index === limit - 1 &&
							renderedShowMore }
					</Fragment>
				) ) }
				{ shouldTruncateOptions && renderedShowLess }
			</>
		);
	}, [
		options,
		onChange,
		checked,
		showExpanded,
		limit,
		renderedShowLess,
		renderedShowMore,
		isDisabled,
	] );

	const classes = classNames(
		'wc-block-checkbox-list',
		'wc-block-components-checkbox-list',
		{
			'is-loading': isLoading,
		},
		className
	);

	return (
		<ul className={ classes }>
			{ isLoading ? placeholder : renderedOptions }
		</ul>
	);
};

CheckboxList.propTypes = {
	onChange: PropTypes.func,
	options: PropTypes.arrayOf(
		PropTypes.shape( {
			label: PropTypes.node.isRequired,
			value: PropTypes.string.isRequired,
		} )
	),
	checked: PropTypes.array,
	className: PropTypes.string,
	isLoading: PropTypes.bool,
	isDisabled: PropTypes.bool,
	limit: PropTypes.number,
};

export default CheckboxList;
woocommerce-blocks/assets/js/base/components/checkbox-list/style.scss000064400000000673151335517640022167 0ustar00.editor-styles-wrapper .wc-block-components-checkbox-list,
.wc-block-components-checkbox-list {
	margin: 0;
	padding: 0;
	list-style: none outside;

	li {
		margin: 0 0 $gap-smallest;
		padding: 0;
		list-style: none outside;
	}

	li.show-more,
	li.show-less {
		button {
			background: none;
			border: none;
			padding: 0;
			text-decoration: underline;
			cursor: pointer;
		}
	}

	&.is-loading {
		li {
			@include placeholder();
		}
	}
}
woocommerce-blocks/assets/js/base/components/checkbox-control/style.scss000064400000004711151335517640022671 0ustar00.wc-block-components-checkbox {
	@include reset-typography();
	align-items: flex-start;
	display: flex;
	position: relative;
	margin-top: em($gap-large);

	.wc-block-components-checkbox__input[type="checkbox"] {
		font-size: 1em;
		appearance: none;
		border: 2px solid $input-border-gray;
		border-radius: 2px;
		box-sizing: border-box;
		height: em(24px);
		width: em(24px);
		margin: 0;
		min-height: 24px;
		min-width: 24px;
		overflow: hidden;
		position: static;
		vertical-align: middle;
		background-color: #fff;

		&:checked {
			background: #fff;
			border-color: $input-border-gray;
		}

		&:focus {
			outline: 2px solid $input-border-gray;
			outline-offset: 2px;
		}

		&::before,
		&::after {
			content: "";
		}

		&:not(:checked) + .wc-block-components-checkbox__mark {
			display: none;
		}

		.has-dark-controls & {
			border-color: $controls-border-dark;
			background-color: $input-background-dark;

			&:checked {
				background: $input-background-dark;
				border-color: $controls-border-dark;
			}

			&:focus {
				outline: 2px solid $controls-border-dark;
				outline-offset: 2px;
			}
		}
	}

	&.has-error {
		color: $alert-red;

		a {
			color: $alert-red;
		}
		.wc-block-components-checkbox__input {
			&,
			&:hover,
			&:focus,
			&:active {
				border-color: $alert-red;
			}
			&:focus {
				outline: 2px solid $alert-red;
				outline-offset: 2px;
			}
		}
	}

	.wc-block-components-checkbox__mark {
		fill: #000;
		position: absolute;
		margin-left: em(3px);
		margin-top: em(1px);
		width: em(18px);
		height: em(18px);

		.has-dark-controls & {
			fill: #fff;
		}
	}

	> span,
	.wc-block-components-checkbox__label {
		padding-left: $gap;
		vertical-align: middle;
		line-height: em(24px);
	}
}

// Hack to hide the check mark in IE11
// See comment: https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/2320/#issuecomment-621936576
@include ie11() {
	.wc-block-components-checkbox__mark {
		display: none;
	}
}

.theme-twentytwentyone {
	.wc-block-components-checkbox__input[type="checkbox"],
	.has-dark-controls .wc-block-components-checkbox__input[type="checkbox"] {
		background-color: #fff;
		border-color: var(--form--border-color);
		position: relative;
	}

	.wc-block-components-checkbox__input[type="checkbox"]:checked,
	.has-dark-controls
	.wc-block-components-checkbox__input[type="checkbox"]:checked {
		background-color: #fff;
		border-color: var(--form--border-color);
	}

	.wc-block-components-checkbox__mark {
		display: none;
	}
}
woocommerce-blocks/assets/js/base/components/checkbox-control/stories/index.js000064400000001031151335517640023761 0ustar00/**
 * External dependencies
 */
import { text } from '@storybook/addon-knobs';
import { useState } from 'react';

/**
 * Internal dependencies
 */
import CheckboxControl from '../';

export default {
	title: 'WooCommerce Blocks/@base-components/CheckboxControl',
	component: CheckboxControl,
};

export const Default = () => {
	const [ checked, setChecked ] = useState( false );

	return (
		<CheckboxControl
			label={ text( 'Label', 'Yes please' ) }
			checked={ checked }
			onChange={ ( value ) => setChecked( value ) }
		/>
	);
};
woocommerce-blocks/assets/js/base/components/checkbox-control/index.tsx000064400000002724151335517640022505 0ustar00/**
 * External dependencies
 */
import { withInstanceId } from '@wordpress/compose';
import classNames from 'classnames';

/**
 * Internal dependencies
 */
import './style.scss';

type CheckboxControlProps = {
	className?: string;
	label?: string;
	id?: string;
	instanceId: string;
	onChange: ( value: boolean ) => void;
	children: React.ReactChildren;
	hasError: boolean;
};

/**
 * Component used to show a checkbox control with styles.
 */
const CheckboxControl = ( {
	className,
	label,
	id,
	instanceId,
	onChange,
	children,
	hasError = false,
	...rest
}: CheckboxControlProps ): JSX.Element => {
	const checkboxId = id || `checkbox-control-${ instanceId }`;

	return (
		<label
			className={ classNames(
				'wc-block-components-checkbox',
				{
					'has-error': hasError,
				},
				className
			) }
			htmlFor={ checkboxId }
		>
			<input
				id={ checkboxId }
				className="wc-block-components-checkbox__input"
				type="checkbox"
				onChange={ ( event ) => onChange( event.target.checked ) }
				aria-invalid={ hasError === true }
				{ ...rest }
			/>
			<svg
				className="wc-block-components-checkbox__mark"
				aria-hidden="true"
				xmlns="http://www.w3.org/2000/svg"
				viewBox="0 0 24 20"
			>
				<path d="M9 16.2L4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4L9 16.2z" />
			</svg>
			{ label && (
				<span className="wc-block-components-checkbox__label">
					{ label }
				</span>
			) }
			{ children }
		</label>
	);
};

export default withInstanceId( CheckboxControl );
woocommerce-blocks/assets/js/base/components/summary/index.tsx000064400000002071151335517640020731 0ustar00/**
 * External dependencies
 */
import { RawHTML, useMemo } from '@wordpress/element';
import { WordCountType } from '@woocommerce/block-settings';

/**
 * Internal dependencies
 */
import { generateSummary } from './utils';

interface SummaryProps {
	className?: string;
	source: string;
	maxLength?: number;
	countType?: WordCountType;
}
/**
 * Summary component.
 *
 * @param {Object} props Component props.
 * @param {string} props.source Source text.
 * @param {number} props.maxLength Max length of the summary, using countType.
 * @param {string} props.countType One of words, characters_excluding_spaces, or characters_including_spaces.
 * @param {string} props.className Class name for rendered component.
 */
export const Summary = ( {
	source,
	maxLength = 15,
	countType = 'words',
	className = '',
}: SummaryProps ): JSX.Element => {
	const summaryText = useMemo( () => {
		return generateSummary( source, maxLength, countType );
	}, [ source, maxLength, countType ] );

	return <RawHTML className={ className }>{ summaryText }</RawHTML>;
};

export default Summary;
woocommerce-blocks/assets/js/base/components/summary/test/index.js000064400000010047151335517640021510 0ustar00/**
 * Internal dependencies
 */
import { generateSummary } from '../utils';

describe( 'Summary Component', () => {
	describe( 'Test the generateSummary utility', () => {
		const testContent =
			'<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p><p>Ut enim ad minim veniam, quis <strong>nostrud</strong> exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.</p><p>Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.</p><p>Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>';

		it( 'Default', async () => {
			const result = generateSummary( testContent );

			expect( result.trim() ).toEqual(
				'<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore&hellip;</p>'
			);
		} );
		it( 'No max words - return full description', async () => {
			const result = generateSummary( testContent, 100000 );

			expect( result.trim() ).toEqual(
				'<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p>\n<p>Ut enim ad minim veniam, quis <strong>nostrud</strong> exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.</p>\n<p>Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.</p>\n<p>Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>'
			);
		} );
		it( 'Limit to 3 words', async () => {
			const result = generateSummary( testContent, 3 );

			expect( result.trim() ).toEqual(
				'<p>Lorem ipsum dolor&hellip;</p>'
			);
		} );
		it( 'Limit to 1 word', async () => {
			const result = generateSummary( testContent, 1 );

			expect( result.trim() ).toEqual( '<p>Lorem&hellip;</p>' );
		} );
		it( 'Limit to 15 characters, including spaces.', async () => {
			const result = generateSummary(
				testContent,
				15,
				'characters_including_spaces'
			);

			expect( result.trim() ).toEqual( '<p>Lorem ipsum dol&hellip;</p>' );
		} );
		it( 'Limit to 15 characters, excluding spaces.', async () => {
			const result = generateSummary(
				testContent,
				15,
				'characters_excluding_spaces'
			);

			expect( result.trim() ).toEqual(
				'<p>Lorem ipsum dolor&hellip;</p>'
			);
		} );
	} );
	describe( 'Test the generateSummary utility with HTML tags in strings', () => {
		const testContent =
			'<p>Lorem <strong class="classname">ipsum</strong> dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor.</p>';

		it( 'Limit string to 10 characters', async () => {
			const result = generateSummary(
				testContent,
				10,
				'characters_excluding_spaces'
			);

			expect( result.trim() ).toEqual( '<p>Lorem ipsum&hellip;</p>' );
		} );
		it( 'Limit string to 5 words', async () => {
			const result = generateSummary( testContent, 5, 'words' );

			expect( result.trim() ).toEqual(
				'<p>Lorem ipsum dolor sit amet&hellip;</p>'
			);
		} );
		it( 'First paragraph only - tags are not stripped.', async () => {
			const result = generateSummary( testContent, 9999, 'words' );

			expect( result.trim() ).toEqual(
				'<p>Lorem <strong class="classname">ipsum</strong> dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor.</p>'
			);
		} );
	} );
	describe( 'Test the generateSummary utility with special chars', () => {
		const testContent =
			'<p>我不知道这是否行得通。</p><p>我是用中文写的说明,因此我们可以测试如何修剪产品摘要中的单词。</p>';

		it( 'Default', async () => {
			const result = generateSummary(
				testContent,
				15,
				'characters_excluding_spaces'
			);

			expect( result.trim() ).toEqual( '<p>我不知道这是否行得通。</p>' );
		} );
		it( 'Limit to 3 words', async () => {
			const result = generateSummary(
				testContent,
				3,
				'characters_excluding_spaces'
			);

			expect( result.trim() ).toEqual( '<p>我不知&hellip;</p>' );
		} );
	} );
} );
woocommerce-blocks/assets/js/base/components/summary/utils.js000064400000006722151335517640020567 0ustar00/**
 * External dependencies
 */
import { count } from '@wordpress/wordcount';
import { autop } from '@wordpress/autop';

/**
 * Generates the summary text from a string of text.
 *
 * @param {string} source Source text.
 * @param {number} maxLength Limit number of countType returned if text has multiple paragraphs.
 * @param {string} countType What is being counted. One of words, characters_excluding_spaces, or characters_including_spaces.
 * @return {string} Generated summary.
 */
export const generateSummary = (
	source,
	maxLength = 15,
	countType = 'words'
) => {
	const sourceWithParagraphs = autop( source );
	const sourceWordCount = count( sourceWithParagraphs, countType );

	if ( sourceWordCount <= maxLength ) {
		return sourceWithParagraphs;
	}

	const firstParagraph = getFirstParagraph( sourceWithParagraphs );
	const firstParagraphWordCount = count( firstParagraph, countType );

	if ( firstParagraphWordCount <= maxLength ) {
		return firstParagraph;
	}

	if ( countType === 'words' ) {
		return trimWords( firstParagraph, maxLength );
	}

	return trimCharacters(
		firstParagraph,
		maxLength,
		countType === 'characters_including_spaces'
	);
};

/**
 * Get first paragraph from some HTML text, or return whole string.
 *
 * @param {string} source Source text.
 * @return {string} First paragraph found in string.
 */
const getFirstParagraph = ( source ) => {
	const pIndex = source.indexOf( '</p>' );

	if ( pIndex === -1 ) {
		return source;
	}

	return source.substr( 0, pIndex + 4 );
};

/**
 * Remove HTML tags from a string.
 *
 * @param {string} htmlString String to remove tags from.
 * @return {string} Plain text string.
 */
const removeTags = ( htmlString ) => {
	const tagsRegExp = /<\/?[a-z][^>]*?>/gi;
	return htmlString.replace( tagsRegExp, '' );
};

/**
 * Remove trailing punctuation and append some characters to a string.
 *
 * @param {string} text Text to append to.
 * @param {string} moreText  Text to append.
 * @return {string} String with appended characters.
 */
const appendMoreText = ( text, moreText ) => {
	return text.replace( /[\s|\.\,]+$/i, '' ) + moreText;
};

/**
 * Limit words in string and returned trimmed version.
 *
 * @param {string} text Text to trim.
 * @param {number} maxLength Number of countType to limit to.
 * @param {string} moreText Appended to the trimmed string.
 * @return {string} Trimmed string.
 */
const trimWords = ( text, maxLength, moreText = '&hellip;' ) => {
	const textToTrim = removeTags( text );
	const trimmedText = textToTrim
		.split( ' ' )
		.splice( 0, maxLength )
		.join( ' ' );

	return autop( appendMoreText( trimmedText, moreText ) );
};

/**
 * Limit characters in string and returned trimmed version.
 *
 * @param {string} text Text to trim.
 * @param {number} maxLength Number of countType to limit to.
 * @param {boolean} includeSpaces Should spaces be included in the count.
 * @param {string} moreText Appended to the trimmed string.
 * @return {string} Trimmed string.
 */
const trimCharacters = (
	text,
	maxLength,
	includeSpaces = true,
	moreText = '&hellip;'
) => {
	const textToTrim = removeTags( text );
	const trimmedText = textToTrim.slice( 0, maxLength );

	if ( includeSpaces ) {
		return autop( appendMoreText( trimmedText, moreText ) );
	}

	const matchSpaces = trimmedText.match( /([\s]+)/g );
	const spaceCount = matchSpaces ? matchSpaces.length : 0;
	const trimmedTextExcludingSpaces = textToTrim.slice(
		0,
		maxLength + spaceCount
	);

	return autop( appendMoreText( trimmedTextExcludingSpaces, moreText ) );
};
woocommerce-blocks/assets/js/base/components/text-input/validated-text-input.tsx000064400000010357151335517640024330 0ustar00/**
 * External dependencies
 */
import { __ } from '@wordpress/i18n';
import { useCallback, useRef, useEffect, useState } from 'react';
import classnames from 'classnames';
import {
	ValidationInputError,
	useValidationContext,
	useCheckoutContext,
} from '@woocommerce/base-context';
import { withInstanceId } from '@wordpress/compose';
import { isString } from '@woocommerce/types';

/**
 * Internal dependencies
 */
import TextInput from './text-input';
import './style.scss';

interface ValidatedTextInputPropsWithId {
	instanceId?: string;
	id: string;
}

interface ValidatedTextInputPropsWithInstanceId {
	instanceId: string;
	id?: string;
}

type ValidatedTextInputProps = (
	| ValidatedTextInputPropsWithId
	| ValidatedTextInputPropsWithInstanceId
 ) & {
	className?: string;
	ariaDescribedBy?: string;
	errorId?: string;
	validateOnMount?: boolean;
	focusOnMount?: boolean;
	showError?: boolean;
	errorMessage?: string;
	onChange: ( newValue: string ) => void;
};

const ValidatedTextInput = ( {
	className,
	instanceId,
	id,
	ariaDescribedBy,
	errorId,
	validateOnMount = true,
	focusOnMount = false,
	onChange,
	showError = true,
	errorMessage: passedErrorMessage = '',
	...rest
}: ValidatedTextInputProps ) => {
	const [ isPristine, setIsPristine ] = useState( true );
	const inputRef = useRef< HTMLInputElement >( null );
	const {
		getValidationError,
		hideValidationError,
		setValidationErrors,
		clearValidationError,
		getValidationErrorId,
	} = useValidationContext();

	const { isBeforeProcessing } = useCheckoutContext();

	const textInputId =
		typeof id !== 'undefined' ? id : 'textinput-' + instanceId;
	const errorIdString = errorId !== undefined ? errorId : textInputId;

	const validateInput = useCallback(
		( errorsHidden = true ) => {
			const inputObject = inputRef.current || null;
			if ( ! inputObject ) {
				return;
			}
			// Trim white space before validation.
			inputObject.value = inputObject.value.trim();
			const inputIsValid = inputObject.checkValidity();
			if ( inputIsValid ) {
				clearValidationError( errorIdString );
			} else {
				setValidationErrors( {
					[ errorIdString ]: {
						message:
							inputObject.validationMessage ||
							__(
								'Invalid value.',
								'woo-gutenberg-products-block'
							),
						hidden: errorsHidden,
					},
				} );
			}
		},
		[ clearValidationError, errorIdString, setValidationErrors ]
	);

	useEffect( () => {
		if ( isPristine ) {
			if ( focusOnMount ) {
				inputRef.current?.focus();
			}
			setIsPristine( false );
		}
	}, [ focusOnMount, isPristine, setIsPristine ] );

	useEffect( () => {
		if ( isPristine ) {
			if ( validateOnMount ) {
				validateInput();
			}
			setIsPristine( false );
		}
	}, [ isPristine, setIsPristine, validateOnMount, validateInput ] );

	/**
	 * @todo Remove extra validation call after refactoring the validation system.
	 */
	useEffect( () => {
		if ( isBeforeProcessing ) {
			validateInput();
		}
	}, [ isBeforeProcessing, validateInput ] );
	// Remove validation errors when unmounted.
	useEffect( () => {
		return () => {
			clearValidationError( errorIdString );
		};
	}, [ clearValidationError, errorIdString ] );

	// @todo - When useValidationContext is converted to TypeScript, remove this cast and use the correct type.
	const errorMessage = ( getValidationError( errorIdString ) || {} ) as {
		message?: string;
		hidden?: boolean;
	};
	if ( isString( passedErrorMessage ) && passedErrorMessage !== '' ) {
		errorMessage.message = passedErrorMessage;
	}
	const hasError = errorMessage.message && ! errorMessage.hidden;
	const describedBy =
		showError && hasError && getValidationErrorId( errorIdString )
			? getValidationErrorId( errorIdString )
			: ariaDescribedBy;

	return (
		<TextInput
			className={ classnames( className, {
				'has-error': hasError,
			} ) }
			aria-invalid={ hasError === true }
			id={ textInputId }
			onBlur={ () => {
				validateInput( false );
			} }
			feedback={
				showError && (
					<ValidationInputError
						errorMessage={ passedErrorMessage }
						propertyName={ errorIdString }
					/>
				)
			}
			ref={ inputRef }
			onChange={ ( val ) => {
				hideValidationError( errorIdString );
				onChange( val );
			} }
			ariaDescribedBy={ describedBy }
			{ ...rest }
		/>
	);
};

export default withInstanceId( ValidatedTextInput );
woocommerce-blocks/assets/js/base/components/text-input/text-input.tsx000064400000004336151335517640022375 0ustar00/**
 * External dependencies
 */
import { forwardRef, InputHTMLAttributes } from 'react';
import classnames from 'classnames';
import { useState } from '@wordpress/element';

/**
 * Internal dependencies
 */
import Label from '../label';
import './style.scss';

interface TextInputProps
	extends Omit<
		InputHTMLAttributes< HTMLInputElement >,
		'onChange' | 'onBlur'
	> {
	id: string;
	ariaLabel?: string;
	label?: string;
	ariaDescribedBy?: string;
	screenReaderLabel?: string;
	help?: string;
	feedback?: boolean | JSX.Element;
	autoComplete?: string;
	onChange: ( newValue: string ) => void;
	onBlur?: ( newValue: string ) => void;
}

const TextInput = forwardRef< HTMLInputElement, TextInputProps >(
	(
		{
			className,
			id,
			type = 'text',
			ariaLabel,
			ariaDescribedBy,
			label,
			screenReaderLabel,
			disabled,
			help,
			autoCapitalize = 'off',
			autoComplete = 'off',
			value = '',
			onChange,
			required = false,
			onBlur = () => {
				/* Do nothing */
			},
			feedback,
			...rest
		},
		ref
	) => {
		const [ isActive, setIsActive ] = useState( false );

		return (
			<div
				className={ classnames(
					'wc-block-components-text-input',
					className,
					{
						'is-active': isActive || value,
					}
				) }
			>
				<input
					type={ type }
					id={ id }
					value={ value }
					ref={ ref }
					autoCapitalize={ autoCapitalize }
					autoComplete={ autoComplete }
					onChange={ ( event ) => {
						onChange( event.target.value );
					} }
					onFocus={ () => setIsActive( true ) }
					onBlur={ ( event ) => {
						onBlur( event.target.value );
						setIsActive( false );
					} }
					aria-label={ ariaLabel || label }
					disabled={ disabled }
					aria-describedby={
						!! help && ! ariaDescribedBy
							? id + '__help'
							: ariaDescribedBy
					}
					required={ required }
					{ ...rest }
				/>
				<Label
					label={ label }
					screenReaderLabel={ screenReaderLabel || label }
					wrapperElement="label"
					wrapperProps={ {
						htmlFor: id,
					} }
					htmlFor={ id }
				/>
				{ !! help && (
					<p
						id={ id + '__help' }
						className="wc-block-components-text-input__help"
					>
						{ help }
					</p>
				) }
				{ feedback }
			</div>
		);
	}
);

export default TextInput;
woocommerce-blocks/assets/js/base/components/text-input/index.ts000064400000000175151335517640021170 0ustar00export { default as TextInput } from './text-input';
export { default as ValidatedTextInput } from './validated-text-input';
woocommerce-blocks/assets/js/base/components/text-input/style.scss000064400000004540151335517640021546 0ustar00.wc-block-components-form .wc-block-components-text-input,
.wc-block-components-text-input {
	position: relative;
	margin-top: em($gap-large);
	white-space: nowrap;

	label {
		@include reset-typography();
		@include font-size(regular);
		position: absolute;
		transform: translateY(0.75em);
		left: 0;
		top: 0;
		transform-origin: top left;
		line-height: 1.375; // =22px when font-size is 16px.
		color: $gray-700;
		transition: transform 200ms ease;
		margin: 0 0 0 #{$gap + 1px};
		overflow: hidden;
		text-overflow: ellipsis;
		max-width: calc(100% - #{2 * $gap});
		cursor: text;

		.has-dark-controls & {
			color: $input-placeholder-dark;
		}
		@media screen and (prefers-reduced-motion: reduce) {
			transition: none;
		}
	}

	input:-webkit-autofill + label {
		transform: translateY(#{$gap-smallest}) scale(0.75);
	}

	&.is-active label {
		transform: translateY(#{$gap-smallest}) scale(0.75);
	}

	input[type="tel"],
	input[type="url"],
	input[type="text"],
	input[type="number"],
	input[type="email"] {
		@include font-size(regular);
		background-color: #fff;
		padding: em($gap-small) $gap;
		border-radius: 4px;
		border: 1px solid $input-border-gray;
		width: 100%;
		line-height: 1.375; // =22px when font-size is 16px.
		font-family: inherit;
		margin: 0;
		box-sizing: border-box;
		height: 3em;
		min-height: 0;
		color: $input-text-active;

		&:focus {
			background-color: #fff;
			color: $input-text-active;
			outline: 0;
			box-shadow: 0 0 0 1px $input-border-gray;
		}

		.has-dark-controls & {
			background-color: $input-background-dark;
			border-color: $input-border-dark;
			color: $input-text-dark;

			&:focus {
				background-color: $input-background-dark;
				color: $input-text-dark;
				box-shadow: 0 0 0 1px $input-border-dark;
			}
		}
	}

	input[type="number"] {
		-moz-appearance: textfield;

		&::-webkit-outer-spin-button,
		&::-webkit-inner-spin-button {
			appearance: none;
			margin: 0;
		}
	}

	&.is-active input[type="tel"],
	&.is-active input[type="url"],
	&.is-active input[type="text"],
	&.is-active input[type="number"],
	&.is-active input[type="email"] {
		padding: em($gap-large) 0 em($gap-smallest) $gap;
	}

	&.has-error input {
		&,
		&:hover,
		&:focus,
		&:active {
			border-color: $alert-red;
		}
		&:focus {
			box-shadow: 0 0 0 1px $alert-red;
		}
	}

	&.has-error label {
		color: $alert-red;
	}

	&:only-child {
		margin-top: 0;
	}
}
woocommerce-blocks/assets/js/base/components/radio-control-accordion/index.js000064400000003133151335517640023545 0ustar00/**
 * External dependencies
 */
import classnames from 'classnames';
import { withInstanceId } from '@wordpress/compose';

/**
 * Internal dependencies
 */
import RadioControlOption from '../radio-control/option';

const RadioControlAccordion = ( {
	className,
	instanceId,
	id,
	selected,
	onChange,
	options = [],
} ) => {
	const radioControlId = id || instanceId;

	return (
		options.length && (
			<div
				className={ classnames(
					'wc-block-components-radio-control',
					className
				) }
			>
				{ options.map( ( option ) => {
					const hasOptionContent =
						typeof option === 'object' && 'content' in option;
					const checked = option.value === selected;
					return (
						<div
							className="wc-block-components-radio-control-accordion-option"
							key={ option.value }
						>
							<RadioControlOption
								name={ `radio-control-${ radioControlId }` }
								checked={ checked }
								option={ option }
								onChange={ ( value ) => {
									onChange( value );
									if (
										typeof option.onChange === 'function'
									) {
										option.onChange( value );
									}
								} }
							/>
							{ hasOptionContent && checked && (
								<div
									className={ classnames(
										'wc-block-components-radio-control-accordion-content',
										{
											'wc-block-components-radio-control-accordion-content-hide': ! checked,
										}
									) }
								>
									{ option.content }
								</div>
							) }
						</div>
					);
				} ) }
			</div>
		)
	);
};

export default withInstanceId( RadioControlAccordion );
export { RadioControlAccordion };
woocommerce-blocks/assets/js/base/components/block-error-boundary/index.js000064400000004357151335517640023105 0ustar00/**
 * External dependencies
 */
import PropTypes from 'prop-types';
import { Component } from 'react';

/**
 * Internal dependencies
 */
import BlockError from './block-error';
import './style.scss';

class BlockErrorBoundary extends Component {
	state = { errorMessage: '', hasError: false };

	static getDerivedStateFromError( error ) {
		if (
			typeof error.statusText !== 'undefined' &&
			typeof error.status !== 'undefined'
		) {
			return {
				errorMessage: (
					<>
						<strong>{ error.status }</strong>:&nbsp;
						{ error.statusText }
					</>
				),
				hasError: true,
			};
		}

		return { errorMessage: error.message, hasError: true };
	}

	render() {
		const {
			header,
			imageUrl,
			showErrorMessage,
			text,
			errorMessagePrefix,
			renderError,
			button,
		} = this.props;
		const { errorMessage, hasError } = this.state;

		if ( hasError ) {
			if ( typeof renderError === 'function' ) {
				return renderError( { errorMessage } );
			}
			return (
				<BlockError
					errorMessage={ showErrorMessage ? errorMessage : null }
					header={ header }
					imageUrl={ imageUrl }
					text={ text }
					errorMessagePrefix={ errorMessagePrefix }
					button={ button }
				/>
			);
		}

		return this.props.children;
	}
}

BlockErrorBoundary.propTypes = {
	/**
	 * Text to display as the heading of the error block.
	 * If it's `null` or an empty string, no header will be displayed.
	 * If it's not defined, the default header will be used.
	 */
	header: PropTypes.string,
	/**
	 * URL of the image to display.
	 * If it's `null` or an empty string, no image will be displayed.
	 * If it's not defined, the default image will be used.
	 */
	imageUrl: PropTypes.string,
	/**
	 * Whether to display the JS error message.
	 */
	showErrorMessage: PropTypes.bool,
	/**
	 * Text to display in the error block below the header.
	 * If it's `null` or an empty string, nothing will be displayed.
	 * If it's not defined, the default text will be used.
	 */
	text: PropTypes.node,
	/**
	 * Text preceeding the error message.
	 */
	errorMessagePrefix: PropTypes.string,
	/**
	 * Render function to show a custom error component.
	 */
	renderError: PropTypes.func,
};

BlockErrorBoundary.defaultProps = {
	showErrorMessage: true,
};

export default BlockErrorBoundary;
woocommerce-blocks/assets/js/base/components/block-error-boundary/style.scss000064400000001276151335517640023472 0ustar00.wc-block-components-error {
	display: flex;
	padding: $gap-largest 0;
	margin: $gap-largest 0;
	align-items: center;
	justify-content: center;
	flex-direction: column;
	color: $gray-700;
	text-align: center;
}
.wc-block-components-error__header {
	@include font-size(larger);
	margin: 0;
	color: $studio-gray-50;
}
.wc-block-components-error__image {
	width: 25%;
	margin: 0 0 $gap-large 0;
}
.wc-block-components-error__text {
	margin: 1em 0 0;
	color: $studio-gray-30;
	@include font-size(large);
	max-width: 60ch;
}
.wc-block-components-error__message {
	margin: 1em auto 0;
	font-style: italic;
	color: $studio-gray-30;
	max-width: 60ch;
}
.wc-block-error__button {
	margin: $gap-largest 0 0 0;
}
woocommerce-blocks/assets/js/base/components/block-error-boundary/block-error.js000064400000004354151335517640024214 0ustar00/**
 * External dependencies
 */
import { __ } from '@wordpress/i18n';
import PropTypes from 'prop-types';
import { WC_BLOCKS_IMAGE_URL } from '@woocommerce/block-settings';

const BlockError = ( {
	imageUrl = `${ WC_BLOCKS_IMAGE_URL }/block-error.svg`,
	header = __( 'Oops!', 'woocommerce' ),
	text = __(
		'There was an error loading the content.',
		'woocommerce'
	),
	errorMessage,
	errorMessagePrefix = __( 'Error:', 'woocommerce' ),
	button,
} ) => {
	return (
		<div className="wc-block-error wc-block-components-error">
			{ imageUrl && (
				<img
					className="wc-block-error__image wc-block-components-error__image"
					src={ imageUrl }
					alt=""
				/>
			) }
			<div className="wc-block-error__content wc-block-components-error__content">
				{ header && (
					<p className="wc-block-error__header wc-block-components-error__header">
						{ header }
					</p>
				) }
				{ text && (
					<p className="wc-block-error__text wc-block-components-error__text">
						{ text }
					</p>
				) }
				{ errorMessage && (
					<p className="wc-block-error__message wc-block-components-error__message">
						{ errorMessagePrefix ? errorMessagePrefix + ' ' : '' }
						{ errorMessage }
					</p>
				) }
				{ button && (
					<p className="wc-block-error__button wc-block-components-error__button">
						{ button }
					</p>
				) }
			</div>
		</div>
	);
};

BlockError.propTypes = {
	/**
	 * Error message to display below the content.
	 */
	errorMessage: PropTypes.node,
	/**
	 * Text to display as the heading of the error block.
	 * If it's `null` or an empty string, no header will be displayed.
	 * If it's not defined, the default header will be used.
	 */
	header: PropTypes.string,
	/**
	 * URL of the image to display.
	 * If it's `null` or an empty string, no image will be displayed.
	 * If it's not defined, the default image will be used.
	 */
	imageUrl: PropTypes.string,
	/**
	 * Text to display in the error block below the header.
	 * If it's `null` or an empty string, nothing will be displayed.
	 * If it's not defined, the default text will be used.
	 */
	text: PropTypes.node,
	/**
	 * Text preceeding the error message.
	 */
	errorMessagePrefix: PropTypes.string,
	/**
	 * Button cta.
	 */
	button: PropTypes.node,
};

export default BlockError;
woocommerce-blocks/assets/js/base/components/product-list/product-list-item/index.js000064400000002057151335517640025054 0ustar00/**
 * External dependencies
 */
import PropTypes from 'prop-types';
import classnames from 'classnames';
import { useInnerBlockLayoutContext } from '@woocommerce/shared-context';
import { withInstanceId } from '@wordpress/compose';

/**
 * Internal dependencies
 */
import { renderProductLayout } from './utils';

const ProductListItem = ( { product, attributes, instanceId } ) => {
	const { layoutConfig } = attributes;
	const { parentClassName, parentName } = useInnerBlockLayoutContext();
	const isLoading = Object.keys( product ).length === 0;
	const classes = classnames(
		`${ parentClassName }__product`,
		'wc-block-layout',
		{
			'is-loading': isLoading,
		}
	);

	return (
		<li className={ classes } aria-hidden={ isLoading }>
			{ renderProductLayout(
				parentName,
				product,
				layoutConfig,
				instanceId
			) }
		</li>
	);
};

ProductListItem.propTypes = {
	attributes: PropTypes.object.isRequired,
	product: PropTypes.object,
	// from withInstanceId
	instanceId: PropTypes.number.isRequired,
};

export default withInstanceId( ProductListItem );
woocommerce-blocks/assets/js/base/components/product-list/product-list-item/utils.js000064400000002541151335517640025103 0ustar00/**
 * External dependencies
 */
import { getBlockMap } from '@woocommerce/atomic-utils';
import { Suspense } from '@wordpress/element';

/**
 * Maps a layout config into atomic components.
 *
 * @param {string} blockName Name of the parent block. Used to get extension children.
 * @param {Object} product Product object to pass to atomic components.
 * @param {Object[]} layoutConfig Object with component data.
 * @param {number} componentId Parent component ID needed for key generation.
 */
export const renderProductLayout = (
	blockName,
	product,
	layoutConfig,
	componentId
) => {
	if ( ! layoutConfig ) {
		return;
	}

	const blockMap = getBlockMap( blockName );

	return layoutConfig.map( ( [ name, props = {} ], index ) => {
		let children = [];

		if ( !! props.children && props.children.length > 0 ) {
			children = renderProductLayout(
				blockName,
				product,
				props.children,
				componentId
			);
		}

		const LayoutComponent = blockMap[ name ];

		if ( ! LayoutComponent ) {
			return null;
		}

		const productID = product.id || 0;
		const keyParts = [ 'layout', name, index, componentId, productID ];

		return (
			<Suspense
				key={ keyParts.join( '_' ) }
				fallback={ <div className="wc-block-placeholder" /> }
			>
				<LayoutComponent
					{ ...props }
					children={ children }
					product={ product }
				/>
			</Suspense>
		);
	} );
};
woocommerce-blocks/assets/js/base/components/product-list/index.js000064400000000170151335517640021461 0ustar00export { default as ProductList } from './product-list';
export { default as ProductListContainer } from './container';
woocommerce-blocks/assets/js/base/components/product-list/container.js000064400000002017151335517640022336 0ustar00/**
 * External dependencies
 */
import { useState, useEffect } from '@wordpress/element';
import PropTypes from 'prop-types';

/**
 * Internal dependencies
 */
import ProductList from './product-list';

const ProductListContainer = ( { attributes } ) => {
	const [ currentPage, setPage ] = useState( 1 );
	const [ currentSort, setSort ] = useState( attributes.orderby );
	useEffect( () => {
		// if default sort is changed in editor
		setSort( attributes.orderby );
	}, [ attributes.orderby ] );
	const onPageChange = ( newPage ) => {
		setPage( newPage );
	};
	const onSortChange = ( event ) => {
		const newSortValue = event.target.value;
		setSort( newSortValue );
		setPage( 1 );
	};

	return (
		<ProductList
			attributes={ attributes }
			currentPage={ currentPage }
			onPageChange={ onPageChange }
			onSortChange={ onSortChange }
			sortValue={ currentSort }
		/>
	);
};

ProductListContainer.propTypes = {
	attributes: PropTypes.object.isRequired,
	hideOutOfStockItems: PropTypes.bool,
};

export default ProductListContainer;
woocommerce-blocks/assets/js/base/components/product-list/style.scss000064400000005326151335517640022061 0ustar00@keyframes spin {
	from {
		transform: rotate(0deg);
	}
	to {
		transform: rotate(360deg);
	}
}

.wc-block-grid {
	text-align: center;
}

.wc-block-grid__no-products {
	padding: $gap-largest;
	text-align: center;
	width: 100%;

	.wc-block-grid__no-products-image {
		max-width: 150px;
		margin: 0 auto 1em;
		display: block;
		color: inherit;
	}
	.wc-block-grid__no-products-title {
		display: block;
		margin: 0;
		font-weight: bold;
	}
	.wc-block-grid__no-products-description {
		display: block;
		margin: 0.25em 0 1em 0;
	}
}

.wc-block-grid__products {
	display: flex;
	flex-wrap: wrap;
	padding: 0;
	margin: 0 (-$gap*0.5) $gap;
	background-clip: padding-box;
}

.wc-block-grid__product {
	box-sizing: border-box;
	padding: 0;
	margin: 0;
	float: none;
	width: auto;
	position: relative;
	text-align: center;
	border-left: $gap*0.5 solid transparent;
	border-right: $gap*0.5 solid transparent;
	border-bottom: $gap solid transparent;
	list-style: none;
}

// Increased specificity necessary as Gutenberg's generic reset overrides box sizing
.wc-block-grid__product.wc-block-grid__product {
	box-sizing: border-box;
}

.theme-twentytwenty .wc-block-grid,
.wc-block-grid {
	&.has-aligned-buttons {
		.wc-block-grid__product {
			display: flex;
			flex-direction: column;
		}
		.wc-block-grid__product > :last-child {
			margin-top: auto;
			margin-bottom: 0;
			padding-bottom: $gap-small;
		}
	}
	@for $i from 1 to 9 {
		&.has-#{$i}-columns .wc-block-grid__product {
			flex: 1 0 calc(#{ math.div(100%, $i) });
			max-width: math.div(100%, $i);
		}
	}
	// Adjust font size as more cols are added.
	&.has-6-columns .wc-block-grid__product {
		font-size: 0.5em;
	}
	&.has-6-columns.alignfull,
	&.has-5-columns {
		.wc-block-grid__product {
			font-size: 0.58em;
		}
	}
	&.has-5-columns.alignfull,
	&.has-4-columns:not(.alignwide):not(.alignfull) {
		.wc-block-grid__product {
			font-size: 0.75em;
		}
	}
	&.has-3-columns:not(.alignwide):not(.alignfull) {
		font-size: 0.92em;
	}
}

@include breakpoint("<480px") {
	.wc-block-grid {
		@for $i from 2 to 9 {
			&.has-#{$i}-columns {
				.wc-block-grid__products {
					display: block;
				}
				.wc-block-grid__product {
					margin-left: auto;
					margin-right: auto;
					flex: 1 0 100%;
					max-width: 100%;
					padding: 0;
				}
			}
		}
	}
}

@include breakpoint("480px-600px") {
	.wc-block-grid {
		@for $i from 2 to 9 {
			&.has-#{$i}-columns {
				.wc-block-grid__product {
					flex: 1 0 50%;
					max-width: 50%;
					padding: 0;
					margin: 0 0 $gap-large 0;
				}
				.wc-block-grid__product:nth-child(odd) {
					padding-right: $gap*0.5;
				}
				.wc-block-grid__product:nth-child(even) {
					padding-left: $gap*0.5;
					.wc-block-grid__product-onsale {
						left: $gap*0.5;
					}
				}
			}
		}
	}
}
woocommerce-blocks/assets/js/base/components/product-list/product-list.js000064400000015212151335517640023006 0ustar00/**
 * External dependencies
 */
import { __, _n, sprintf } from '@wordpress/i18n';
import { isEqual } from 'lodash';
import PropTypes from 'prop-types';
import classnames from 'classnames';
import Pagination from '@woocommerce/base-components/pagination';
import { useEffect } from '@wordpress/element';
import { usePrevious } from '@woocommerce/base-hooks';
import {
	useStoreEvents,
	useStoreProducts,
	useSynchronizedQueryState,
	useQueryStateByKey,
} from '@woocommerce/base-context/hooks';
import withScrollToTop from '@woocommerce/base-hocs/with-scroll-to-top';
import { useInnerBlockLayoutContext } from '@woocommerce/shared-context';
import { speak } from '@wordpress/a11y';

/**
 * Internal dependencies
 */
import NoProducts from './no-products';
import NoMatchingProducts from './no-matching-products';
import ProductSortSelect from './product-sort-select';
import ProductListItem from './product-list-item';
import './style.scss';

const generateQuery = ( { sortValue, currentPage, attributes } ) => {
	const { columns, rows } = attributes;
	const getSortArgs = ( orderName ) => {
		switch ( orderName ) {
			case 'menu_order':
			case 'popularity':
			case 'rating':
			case 'price':
				return {
					orderby: orderName,
					order: 'asc',
				};
			case 'price-desc':
				return {
					orderby: 'price',
					order: 'desc',
				};
			case 'date':
				return {
					orderby: 'date',
					order: 'desc',
				};
		}
	};

	return {
		...getSortArgs( sortValue ),
		catalog_visibility: 'catalog',
		per_page: columns * rows,
		page: currentPage,
	};
};

/**
 * Given a query state, returns the same query without the attributes related to
 * pagination and sorting.
 *
 * @param {Object} query Query to extract the attributes from.
 *
 * @return {Object} Same query without pagination and sorting attributes.
 */

const extractPaginationAndSortAttributes = ( query ) => {
	/* eslint-disable-next-line no-unused-vars */
	const { order, orderby, page, per_page: perPage, ...totalQuery } = query;
	return totalQuery || {};
};

const announceLoadingCompletion = ( totalProducts ) => {
	if ( ! Number.isFinite( totalProducts ) ) {
		return;
	}

	if ( totalProducts === 0 ) {
		speak( __( 'No products found', 'woocommerce' ) );
	} else {
		speak(
			sprintf(
				/* translators: %s is an integer higher than 0 (1, 2, 3...) */
				_n(
					'%d product found',
					'%d products found',
					totalProducts,
					'woocommerce'
				),
				totalProducts
			)
		);
	}
};

const areQueryTotalsDifferent = (
	{ totalQuery: nextQuery, totalProducts: nextProducts },
	{ totalQuery: currentQuery } = {}
) => ! isEqual( nextQuery, currentQuery ) && Number.isFinite( nextProducts );

const ProductList = ( {
	attributes,
	currentPage,
	onPageChange,
	onSortChange,
	sortValue,
	scrollToTop,
} ) => {
	// These are possible filters.
	const [ productAttributes, setProductAttributes ] = useQueryStateByKey(
		'attributes',
		[]
	);
	const [ productStockStatus, setProductStockStatus ] = useQueryStateByKey(
		'stock_status',
		[]
	);
	const [ minPrice, setMinPrice ] = useQueryStateByKey( 'min_price' );
	const [ maxPrice, setMaxPrice ] = useQueryStateByKey( 'max_price' );

	const [ queryState ] = useSynchronizedQueryState(
		generateQuery( {
			attributes,
			sortValue,
			currentPage,
		} )
	);
	const { products, totalProducts, productsLoading } = useStoreProducts(
		queryState
	);
	const { parentClassName, parentName } = useInnerBlockLayoutContext();
	const totalQuery = extractPaginationAndSortAttributes( queryState );
	const { dispatchStoreEvent } = useStoreEvents();

	// Only update previous query totals if the query is different and the total number of products is a finite number.
	const previousQueryTotals = usePrevious(
		{ totalQuery, totalProducts },
		areQueryTotalsDifferent
	);

	// If the product list changes, trigger an event.
	useEffect( () => {
		dispatchStoreEvent( 'product-list-render', {
			products,
			listName: parentName,
		} );
	}, [ products, parentName, dispatchStoreEvent ] );

	// If query state (excluding pagination/sorting attributes) changed, reset pagination to the first page.
	useEffect( () => {
		if ( isEqual( totalQuery, previousQueryTotals?.totalQuery ) ) {
			return;
		}
		onPageChange( 1 );

		// Make sure there was a previous query, so we don't announce it on page load.
		if ( previousQueryTotals?.totalQuery ) {
			announceLoadingCompletion( totalProducts );
		}
	}, [
		previousQueryTotals?.totalQuery,
		totalProducts,
		onPageChange,
		totalQuery,
	] );

	const onPaginationChange = ( newPage ) => {
		scrollToTop( { focusableSelector: 'a, button' } );
		onPageChange( newPage );
	};

	const getClassnames = () => {
		const { columns, rows, alignButtons, align } = attributes;
		const alignClass = typeof align !== 'undefined' ? 'align' + align : '';

		return classnames(
			parentClassName,
			alignClass,
			'has-' + columns + '-columns',
			{
				'has-multiple-rows': rows > 1,
				'has-aligned-buttons': alignButtons,
			}
		);
	};

	const { contentVisibility } = attributes;
	const perPage = attributes.columns * attributes.rows;
	const totalPages =
		! Number.isFinite( totalProducts ) &&
		Number.isFinite( previousQueryTotals?.totalProducts ) &&
		isEqual( totalQuery, previousQueryTotals?.totalQuery )
			? Math.ceil( previousQueryTotals.totalProducts / perPage )
			: Math.ceil( totalProducts / perPage );
	const listProducts = products.length
		? products
		: Array.from( { length: perPage } );
	const hasProducts = products.length !== 0 || productsLoading;
	const hasFilters =
		productAttributes.length > 0 ||
		productStockStatus.length > 0 ||
		Number.isFinite( minPrice ) ||
		Number.isFinite( maxPrice );

	return (
		<div className={ getClassnames() }>
			{ contentVisibility.orderBy && hasProducts && (
				<ProductSortSelect
					onChange={ onSortChange }
					value={ sortValue }
				/>
			) }
			{ ! hasProducts && hasFilters && (
				<NoMatchingProducts
					resetCallback={ () => {
						setProductAttributes( [] );
						setProductStockStatus( [] );
						setMinPrice( null );
						setMaxPrice( null );
					} }
				/>
			) }
			{ ! hasProducts && ! hasFilters && <NoProducts /> }
			{ hasProducts && (
				<ul className={ `${ parentClassName }__products` }>
					{ listProducts.map( ( product = {}, i ) => (
						<ProductListItem
							key={ product.id || i }
							attributes={ attributes }
							product={ product }
						/>
					) ) }
				</ul>
			) }
			{ totalPages > 1 && (
				<Pagination
					currentPage={ currentPage }
					onPageChange={ onPaginationChange }
					totalPages={ totalPages }
				/>
			) }
		</div>
	);
};

ProductList.propTypes = {
	attributes: PropTypes.object.isRequired,
	// From withScrollToTop.
	scrollToTop: PropTypes.func,
};

export default withScrollToTop( ProductList );
woocommerce-blocks/assets/js/base/components/product-list/product-sort-select/index.js000064400000002614151335517640025410 0ustar00/**
 * External dependencies
 */
import { __ } from '@wordpress/i18n';
import PropTypes from 'prop-types';
import SortSelect from '@woocommerce/base-components/sort-select';

/**
 * Internal dependencies
 */
import './style.scss';

const ProductSortSelect = ( { onChange, readOnly, value } ) => {
	return (
		<SortSelect
			className="wc-block-product-sort-select wc-block-components-product-sort-select"
			name="orderby"
			onChange={ onChange }
			options={ [
				{
					key: 'menu_order',
					label: __(
						'Default sorting',
						'woocommerce'
					),
				},
				{
					key: 'popularity',
					label: __( 'Popularity', 'woocommerce' ),
				},
				{
					key: 'rating',
					label: __(
						'Average rating',
						'woocommerce'
					),
				},
				{
					key: 'date',
					label: __( 'Latest', 'woocommerce' ),
				},
				{
					key: 'price',
					label: __(
						'Price: low to high',
						'woocommerce'
					),
				},
				{
					key: 'price-desc',
					label: __(
						'Price: high to low',
						'woocommerce'
					),
				},
			] }
			readOnly={ readOnly }
			screenReaderLabel={ __(
				'Order products by',
				'woocommerce'
			) }
			value={ value }
		/>
	);
};

ProductSortSelect.propTypes = {
	onChange: PropTypes.func,
	readOnly: PropTypes.bool,
	value: PropTypes.oneOf( [
		'menu_order',
		'popularity',
		'rating',
		'date',
		'price',
		'price-desc',
	] ),
};

export default ProductSortSelect;
woocommerce-blocks/assets/js/base/components/product-list/product-sort-select/style.scss000064400000000134151335517640025773 0ustar00.wc-block-components-product-sort-select {
	margin-bottom: $gap-large;
	text-align: left;
}
woocommerce-blocks/assets/js/base/components/product-list/no-matching-products.js000064400000001716151335517640024426 0ustar00/**
 * External dependencies
 */
import { __ } from '@wordpress/i18n';
import { useInnerBlockLayoutContext } from '@woocommerce/shared-context';
import { Icon, search } from '@woocommerce/icons';

const NoMatchingProducts = ( { resetCallback = () => {} } ) => {
	const { parentClassName } = useInnerBlockLayoutContext();
	return (
		<div className={ `${ parentClassName }__no-products` }>
			<Icon
				className={ `${ parentClassName }__no-products-image` }
				alt=""
				srcElement={ search }
				size={ 100 }
			/>
			<strong className={ `${ parentClassName }__no-products-title` }>
				{ __( 'No products found', 'woocommerce' ) }
			</strong>
			<p className={ `${ parentClassName }__no-products-description` }>
				{ __(
					'We were unable to find any results based on your search.',
					'woocommerce'
				) }
			</p>
			<button onClick={ resetCallback }>
				{ __( 'Reset Search', 'woocommerce' ) }
			</button>
		</div>
	);
};

export default NoMatchingProducts;
woocommerce-blocks/assets/js/base/components/product-list/no-products.js000064400000001470151335517640022633 0ustar00/**
 * External dependencies
 */
import { __ } from '@wordpress/i18n';
import { useInnerBlockLayoutContext } from '@woocommerce/shared-context';
import { Icon, notice } from '@woocommerce/icons';

const NoProducts = () => {
	const { parentClassName } = useInnerBlockLayoutContext();
	return (
		<div className={ `${ parentClassName }__no-products` }>
			<Icon
				className={ `${ parentClassName }__no-products-image` }
				alt=""
				srcElement={ notice }
				size={ 100 }
			/>
			<strong className={ `${ parentClassName }__no-products-title` }>
				{ __( 'No products', 'woocommerce' ) }
			</strong>
			<p className={ `${ parentClassName }__no-products-description` }>
				{ __(
					'There are currently no products available to display.',
					'woocommerce'
				) }
			</p>
		</div>
	);
};

export default NoProducts;
woocommerce-blocks/assets/js/base/components/label/test/index.js000064400000003530151335517640021071 0ustar00/**
 * External dependencies
 */
import TestRenderer from 'react-test-renderer';

/**
 * Internal dependencies
 */
import Label from '../';

describe( 'Label', () => {
	describe( 'without wrapperElement', () => {
		test( 'should render both label and screen reader label', () => {
			const component = TestRenderer.create(
				<Label label="Lorem" screenReaderLabel="Ipsum" />
			);

			expect( component.toJSON() ).toMatchSnapshot();
		} );

		test( 'should render only the label', () => {
			const component = TestRenderer.create( <Label label="Lorem" /> );

			expect( component.toJSON() ).toMatchSnapshot();
		} );

		test( 'should render only the screen reader label', () => {
			const component = TestRenderer.create(
				<Label screenReaderLabel="Ipsum" />
			);

			expect( component.toJSON() ).toMatchSnapshot();
		} );
	} );

	describe( 'with wrapperElement', () => {
		test( 'should render both label and screen reader label', () => {
			const component = TestRenderer.create(
				<Label
					label="Lorem"
					screenReaderLabel="Ipsum"
					wrapperElement="label"
					wrapperProps={ {
						className: 'foo-bar',
						'data-foo': 'bar',
					} }
				/>
			);

			expect( component.toJSON() ).toMatchSnapshot();
		} );

		test( 'should render only the label', () => {
			const component = TestRenderer.create(
				<Label
					label="Lorem"
					wrapperElement="label"
					wrapperProps={ {
						className: 'foo-bar',
						'data-foo': 'bar',
					} }
				/>
			);

			expect( component.toJSON() ).toMatchSnapshot();
		} );

		test( 'should render only the screen reader label', () => {
			const component = TestRenderer.create(
				<Label
					screenReaderLabel="Ipsum"
					wrapperElement="label"
					wrapperProps={ {
						className: 'foo-bar',
						'data-foo': 'bar',
					} }
				/>
			);

			expect( component.toJSON() ).toMatchSnapshot();
		} );
	} );
} );
woocommerce-blocks/assets/js/base/components/label/test/__snapshots__/index.js.snap000064400000002115151335517640024645 0ustar00// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`Label with wrapperElement should render both label and screen reader label 1`] = `
<label
  className="foo-bar"
  data-foo="bar"
>
  <span
    aria-hidden="true"
  >
    Lorem
  </span>
  <span
    className="screen-reader-text"
  >
    Ipsum
  </span>
</label>
`;

exports[`Label with wrapperElement should render only the label 1`] = `
<label
  className="foo-bar"
  data-foo="bar"
>
  Lorem
</label>
`;

exports[`Label with wrapperElement should render only the screen reader label 1`] = `
<label
  className="foo-bar screen-reader-text"
  data-foo="bar"
>
  Ipsum
</label>
`;

exports[`Label without wrapperElement should render both label and screen reader label 1`] = `
Array [
  <span
    aria-hidden="true"
  >
    Lorem
  </span>,
  <span
    className="screen-reader-text"
  >
    Ipsum
  </span>,
]
`;

exports[`Label without wrapperElement should render only the label 1`] = `"Lorem"`;

exports[`Label without wrapperElement should render only the screen reader label 1`] = `
<span
  className="screen-reader-text"
>
  Ipsum
</span>
`;
woocommerce-blocks/assets/js/base/components/label/index.tsx000064400000002742151335517640020320 0ustar00/**
 * External dependencies
 */
import { Fragment } from '@wordpress/element';
import classNames from 'classnames';
import type { ReactElement, HTMLProps } from 'react';

interface LabelProps extends HTMLProps< HTMLElement > {
	label?: string;
	screenReaderLabel?: string;
	wrapperElement?: string;
	wrapperProps?: HTMLProps< HTMLElement >;
}

/**
 * Component used to render an accessible text given a label and/or a
 * screenReaderLabel. The wrapper element and wrapper props can also be
 * specified via props.
 *
 */
const Label = ( {
	label,
	screenReaderLabel,
	wrapperElement,
	wrapperProps = {},
}: LabelProps ): ReactElement => {
	let Wrapper;

	const hasLabel = typeof label !== 'undefined' && label !== null;
	const hasScreenReaderLabel =
		typeof screenReaderLabel !== 'undefined' && screenReaderLabel !== null;

	if ( ! hasLabel && hasScreenReaderLabel ) {
		Wrapper = wrapperElement || 'span';
		wrapperProps = {
			...wrapperProps,
			className: classNames(
				wrapperProps.className,
				'screen-reader-text'
			),
		};

		return <Wrapper { ...wrapperProps }>{ screenReaderLabel }</Wrapper>;
	}

	Wrapper = wrapperElement || Fragment;

	if ( hasLabel && hasScreenReaderLabel && label !== screenReaderLabel ) {
		return (
			<Wrapper { ...wrapperProps }>
				<span aria-hidden="true">{ label }</span>
				<span className="screen-reader-text">
					{ screenReaderLabel }
				</span>
			</Wrapper>
		);
	}

	return <Wrapper { ...wrapperProps }>{ label }</Wrapper>;
};

export default Label;
woocommerce-blocks/assets/js/base/components/loading-mask/style.scss000064400000000453151335517640021772 0ustar00.wc-block-components-loading-mask {
	position: relative;
	min-height: 18px + $gap;
	pointer-events: none;

	.components-spinner {
		position: absolute;
		margin: 0;
		top: 50%;
		left: 50%;
		transform: translate(-50%, -50%);
	}

	.wc-block-components-loading-mask__children {
		opacity: 0.25;
	}
}
woocommerce-blocks/assets/js/base/components/loading-mask/index.js000064400000002145151335517640021402 0ustar00/**
 * External dependencies
 */
import { __ } from '@wordpress/i18n';
import PropTypes from 'prop-types';
import classNames from 'classnames';

/**
 * Internal dependencies
 */
import './style.scss';
import Spinner from '../spinner';

// @todo Find a way to block buttons/form components when LoadingMask isLoading
const LoadingMask = ( {
	children,
	className,
	screenReaderLabel,
	showSpinner = false,
	isLoading = true,
} ) => {
	return (
		<div
			className={ classNames( className, {
				'wc-block-components-loading-mask': isLoading,
			} ) }
		>
			{ isLoading && showSpinner && <Spinner /> }
			<div
				className={ classNames( {
					'wc-block-components-loading-mask__children': isLoading,
				} ) }
				aria-hidden={ isLoading }
			>
				{ children }
			</div>
			{ isLoading && (
				<span className="screen-reader-text">
					{ screenReaderLabel ||
						__( 'Loading…', 'woocommerce' ) }
				</span>
			) }
		</div>
	);
};

LoadingMask.propTypes = {
	className: PropTypes.string,
	screenReaderLabel: PropTypes.string,
	showSpinner: PropTypes.bool,
	isLoading: PropTypes.bool,
};

export default LoadingMask;
woocommerce-blocks/assets/js/base/components/price-slider/index.js000064400000027452151335517640021426 0ustar00/**
 * External dependencies
 */
import { __ } from '@wordpress/i18n';
import {
	useState,
	useEffect,
	useCallback,
	useMemo,
	useRef,
} from '@wordpress/element';
import PropTypes from 'prop-types';
import classnames from 'classnames';
import FormattedMonetaryAmount from '@woocommerce/base-components/formatted-monetary-amount';
import { isObject } from '@woocommerce/types';

/**
 * Internal dependencies
 */
import './style.scss';
import { constrainRangeSliderValues } from './constrain-range-slider-values';
import FilterSubmitButton from '../filter-submit-button';

/**
 * Price slider component.
 *
 * @param {Object} props Component props.
 * @param {number} props.minPrice Minimum price for slider.
 * @param {number} props.maxPrice Maximum price for slider.
 * @param {number} props.minConstraint Minimum constraint.
 * @param {number} props.maxConstraint Maximum constraint.
 * @param {function(any):any} props.onChange Function to call on the change event.
 * @param {number} props.step What step values the slider uses.
 * @param {Object} props.currency Currency configuration object.
 * @param {boolean} props.showInputFields Whether to show input fields for the values or not.
 * @param {boolean} props.showFilterButton Whether to show the filter button for the slider.
 * @param {boolean} props.isLoading Whether values are loading or not.
 * @param {function():any} props.onSubmit Function to call when submit event fires.
 */
const PriceSlider = ( {
	minPrice,
	maxPrice,
	minConstraint,
	maxConstraint,
	onChange = () => {},
	step,
	currency,
	showInputFields = true,
	showFilterButton = false,
	isLoading = false,
	onSubmit = () => {},
} ) => {
	const minRange = useRef();
	const maxRange = useRef();

	// We want step to default to 10 major units, e.g. $10.
	const stepValue = step ? step : 10 * 10 ** currency.minorUnit;

	const [ minPriceInput, setMinPriceInput ] = useState( minPrice );
	const [ maxPriceInput, setMaxPriceInput ] = useState( maxPrice );

	useEffect( () => {
		setMinPriceInput( minPrice );
	}, [ minPrice ] );

	useEffect( () => {
		setMaxPriceInput( maxPrice );
	}, [ maxPrice ] );

	/**
	 * Checks if the min and max constraints are valid.
	 */
	const hasValidConstraints = useMemo( () => {
		return isFinite( minConstraint ) && isFinite( maxConstraint );
	}, [ minConstraint, maxConstraint ] );

	/**
	 * Handles styles for the shaded area of the range slider.
	 */
	const progressStyles = useMemo( () => {
		if (
			! isFinite( minPrice ) ||
			! isFinite( maxPrice ) ||
			! hasValidConstraints
		) {
			return {
				'--low': '0%',
				'--high': '100%',
			};
		}

		const low =
			Math.round(
				100 *
					( ( minPrice - minConstraint ) /
						( maxConstraint - minConstraint ) )
			) - 0.5;
		const high =
			Math.round(
				100 *
					( ( maxPrice - minConstraint ) /
						( maxConstraint - minConstraint ) )
			) + 0.5;

		return {
			'--low': low + '%',
			'--high': high + '%',
		};
	}, [
		minPrice,
		maxPrice,
		minConstraint,
		maxConstraint,
		hasValidConstraints,
	] );

	/**
	 * Works around an IE issue where only one range selector is visible by changing the display order
	 * based on the mouse position.
	 *
	 * @param {Object} event event data.
	 */
	const findClosestRange = useCallback(
		( event ) => {
			if ( isLoading || ! hasValidConstraints ) {
				return;
			}
			const bounds = event.target.getBoundingClientRect();
			const x = event.clientX - bounds.left;
			const minWidth = minRange.current.offsetWidth;
			const minValue = minRange.current.value;
			const maxWidth = maxRange.current.offsetWidth;
			const maxValue = maxRange.current.value;

			const minX = minWidth * ( minValue / maxConstraint );
			const maxX = maxWidth * ( maxValue / maxConstraint );

			const minXDiff = Math.abs( x - minX );
			const maxXDiff = Math.abs( x - maxX );

			/**
			 * The default z-index in the stylesheet as 20. 20 vs 21 is just for determining which range
			 * slider should be at the front and has no meaning beyond
			 */
			if ( minXDiff > maxXDiff ) {
				minRange.current.style.zIndex = 20;
				maxRange.current.style.zIndex = 21;
			} else {
				minRange.current.style.zIndex = 21;
				maxRange.current.style.zIndex = 20;
			}
		},
		[ isLoading, maxConstraint, hasValidConstraints ]
	);

	/**
	 * Called when the slider is dragged.
	 *
	 * @param {Object} event Event object.
	 */
	const rangeInputOnChange = useCallback(
		( event ) => {
			const isMin = event.target.classList.contains(
				'wc-block-price-filter__range-input--min'
			);
			const targetValue = event.target.value;
			const currentValues = isMin
				? [
						Math.round( targetValue / stepValue ) * stepValue,
						maxPrice,
				  ]
				: [
						minPrice,
						Math.round( targetValue / stepValue ) * stepValue,
				  ];
			const values = constrainRangeSliderValues(
				currentValues,
				minConstraint,
				maxConstraint,
				stepValue,
				isMin
			);
			onChange( [
				parseInt( values[ 0 ], 10 ),
				parseInt( values[ 1 ], 10 ),
			] );
		},
		[
			onChange,
			minPrice,
			maxPrice,
			minConstraint,
			maxConstraint,
			stepValue,
		]
	);

	/**
	 * Called when a price input loses focus - commit changes to slider.
	 *
	 * @param {Object} event Event object.
	 */
	const priceInputOnBlur = useCallback(
		( event ) => {
			// Only refresh when finished editing the min and max fields.
			if (
				event.relatedTarget &&
				event.relatedTarget.classList &&
				event.relatedTarget.classList.contains(
					'wc-block-price-filter__amount'
				)
			) {
				return;
			}
			const isMin = event.target.classList.contains(
				'wc-block-price-filter__amount--min'
			);
			const values = constrainRangeSliderValues(
				[ minPriceInput, maxPriceInput ],
				null,
				null,
				stepValue,
				isMin
			);
			onChange( [
				parseInt( values[ 0 ], 10 ),
				parseInt( values[ 1 ], 10 ),
			] );
		},
		[ onChange, stepValue, minPriceInput, maxPriceInput ]
	);

	const classes = classnames(
		'wc-block-price-filter',
		'wc-block-components-price-slider',
		showInputFields && 'wc-block-price-filter--has-input-fields',
		showInputFields && 'wc-block-components-price-slider--has-input-fields',
		showFilterButton && 'wc-block-price-filter--has-filter-button',
		showFilterButton &&
			'wc-block-components-price-slider--has-filter-button',
		isLoading && 'is-loading',
		! hasValidConstraints && 'is-disabled'
	);

	const activeElement = isObject( minRange.current )
		? minRange.current.ownerDocument.activeElement
		: undefined;
	const minRangeStep =
		activeElement && activeElement === minRange.current ? stepValue : 1;
	const maxRangeStep =
		activeElement && activeElement === maxRange.current ? stepValue : 1;

	const ariaReadableMinPrice = minPriceInput / 10 ** currency.minorUnit;
	const ariaReadableMaxPrice = maxPriceInput / 10 ** currency.minorUnit;

	return (
		<div className={ classes }>
			<div
				className="wc-block-price-filter__range-input-wrapper wc-block-components-price-slider__range-input-wrapper"
				onMouseMove={ findClosestRange }
				onFocus={ findClosestRange }
			>
				{ hasValidConstraints && (
					<div aria-hidden={ showInputFields }>
						<div
							className="wc-block-price-filter__range-input-progress wc-block-components-price-slider__range-input-progress"
							style={ progressStyles }
						/>
						<input
							type="range"
							className="wc-block-price-filter__range-input wc-block-price-filter__range-input--min wc-block-components-price-slider__range-input wc-block-components-price-slider__range-input--min"
							aria-label={ __(
								'Filter products by minimum price',
								'woocommerce'
							) }
							aria-valuetext={ ariaReadableMinPrice }
							value={
								Number.isFinite( minPrice )
									? minPrice
									: minConstraint
							}
							onChange={ rangeInputOnChange }
							step={ minRangeStep }
							min={ minConstraint }
							max={ maxConstraint }
							ref={ minRange }
							disabled={ isLoading }
							tabIndex={ showInputFields ? '-1' : '0' }
						/>
						<input
							type="range"
							className="wc-block-price-filter__range-input wc-block-price-filter__range-input--max wc-block-components-price-slider__range-input wc-block-components-price-slider__range-input--max"
							aria-label={ __(
								'Filter products by maximum price',
								'woocommerce'
							) }
							aria-valuetext={ ariaReadableMaxPrice }
							value={
								Number.isFinite( maxPrice )
									? maxPrice
									: maxConstraint
							}
							onChange={ rangeInputOnChange }
							step={ maxRangeStep }
							min={ minConstraint }
							max={ maxConstraint }
							ref={ maxRange }
							disabled={ isLoading }
							tabIndex={ showInputFields ? '-1' : '0' }
						/>
					</div>
				) }
			</div>
			<div className="wc-block-price-filter__controls wc-block-components-price-slider__controls">
				{ showInputFields && (
					<>
						<FormattedMonetaryAmount
							currency={ currency }
							displayType="input"
							className="wc-block-price-filter__amount wc-block-price-filter__amount--min wc-block-form-text-input wc-block-components-price-slider__amount wc-block-components-price-slider__amount--min"
							aria-label={ __(
								'Filter products by minimum price',
								'woocommerce'
							) }
							onValueChange={ ( value ) => {
								if ( value === minPriceInput ) {
									return;
								}
								setMinPriceInput( value );
							} }
							onBlur={ priceInputOnBlur }
							disabled={ isLoading || ! hasValidConstraints }
							value={ minPriceInput }
						/>
						<FormattedMonetaryAmount
							currency={ currency }
							displayType="input"
							className="wc-block-price-filter__amount wc-block-price-filter__amount--max wc-block-form-text-input wc-block-components-price-slider__amount wc-block-components-price-slider__amount--max"
							aria-label={ __(
								'Filter products by maximum price',
								'woocommerce'
							) }
							onValueChange={ ( value ) => {
								if ( value === maxPriceInput ) {
									return;
								}
								setMaxPriceInput( value );
							} }
							onBlur={ priceInputOnBlur }
							disabled={ isLoading || ! hasValidConstraints }
							value={ maxPriceInput }
						/>
					</>
				) }
				{ ! showInputFields &&
					! isLoading &&
					Number.isFinite( minPrice ) &&
					Number.isFinite( maxPrice ) && (
						<div className="wc-block-price-filter__range-text wc-block-components-price-slider__range-text">
							{ __( 'Price', 'woocommerce' ) }
							: &nbsp;
							<FormattedMonetaryAmount
								currency={ currency }
								value={ minPrice }
							/>
							&nbsp;&ndash;&nbsp;
							<FormattedMonetaryAmount
								currency={ currency }
								value={ maxPrice }
							/>
						</div>
					) }
				{ showFilterButton && (
					<FilterSubmitButton
						className="wc-block-price-filter__button wc-block-components-price-slider__button"
						disabled={ isLoading || ! hasValidConstraints }
						onClick={ onSubmit }
						screenReaderLabel={ __(
							'Apply price filter',
							'woocommerce'
						) }
					/>
				) }
			</div>
		</div>
	);
};

PriceSlider.propTypes = {
	/**
	 * Callback fired when prices changes.
	 */
	onChange: PropTypes.func.isRequired,
	/**
	 * Callback fired when the filter button is pressed.
	 */
	onSubmit: PropTypes.func,
	/**
	 * Min value.
	 */
	minPrice: PropTypes.number,
	/**
	 * Max value.
	 */
	maxPrice: PropTypes.number,
	/**
	 * Minimum allowed price.
	 */
	minConstraint: PropTypes.number,
	/**
	 * Maximum allowed price.
	 */
	maxConstraint: PropTypes.number,
	/**
	 * Step for slider inputs.
	 */
	step: PropTypes.number,
	/**
	 * Currency data used for formatting prices.
	 */
	currency: PropTypes.object.isRequired,
	/**
	 * Whether or not to show input fields above the slider.
	 */
	showInputFields: PropTypes.bool,
	/**
	 * Whether or not to show filter button above the slider.
	 */
	showFilterButton: PropTypes.bool,
	/**
	 * Whether or not to show filter button above the slider.
	 */
	isLoading: PropTypes.bool,
};

export default PriceSlider;
woocommerce-blocks/assets/js/base/components/price-slider/test/constrain-range-slider-values.js000064400000004017151335517640027135 0ustar00/**
 * Internal dependencies
 */
import { constrainRangeSliderValues } from '../constrain-range-slider-values';

describe( 'constrainRangeSliderValues', () => {
	test.each`
		values                | min       | max       | step    | isMin      | expected
		${ [ 20, 60 ] }       | ${ 0 }    | ${ 70 }   | ${ 10 } | ${ true }  | ${ [ 20, 60 ] }
		${ [ 20, 60 ] }       | ${ 20 }   | ${ 60 }   | ${ 10 } | ${ true }  | ${ [ 20, 60 ] }
		${ [ 20, 60 ] }       | ${ 30 }   | ${ 50 }   | ${ 10 } | ${ true }  | ${ [ 30, 50 ] }
		${ [ 50, 50 ] }       | ${ 20 }   | ${ 60 }   | ${ 10 } | ${ true }  | ${ [ 50, 60 ] }
		${ [ 50, 50 ] }       | ${ 20 }   | ${ 60 }   | ${ 10 } | ${ false } | ${ [ 40, 50 ] }
		${ [ 20, 60 ] }       | ${ null } | ${ null } | ${ 10 } | ${ true }  | ${ [ 20, 60 ] }
		${ [ null, null ] }   | ${ 20 }   | ${ 60 }   | ${ 10 } | ${ true }  | ${ [ 20, 60 ] }
		${ [ '20', '60' ] }   | ${ 30 }   | ${ 50 }   | ${ 10 } | ${ true }  | ${ [ 30, 50 ] }
		${ [ -60, -20 ] }     | ${ -70 }  | ${ 0 }    | ${ 10 } | ${ true }  | ${ [ -60, -20 ] }
		${ [ -60, -20 ] }     | ${ -60 }  | ${ -20 }  | ${ 10 } | ${ true }  | ${ [ -60, -20 ] }
		${ [ -60, -20 ] }     | ${ -50 }  | ${ -30 }  | ${ 10 } | ${ true }  | ${ [ -50, -30 ] }
		${ [ -50, -50 ] }     | ${ -60 }  | ${ -20 }  | ${ 10 } | ${ true }  | ${ [ -50, -40 ] }
		${ [ -50, -50 ] }     | ${ -60 }  | ${ -20 }  | ${ 10 } | ${ false } | ${ [ -60, -50 ] }
		${ [ -60, -20 ] }     | ${ null } | ${ null } | ${ 10 } | ${ true }  | ${ [ -60, -20 ] }
		${ [ null, null ] }   | ${ -60 }  | ${ -20 }  | ${ 10 } | ${ true }  | ${ [ -60, -20 ] }
		${ [ '-60', '-20' ] } | ${ -50 }  | ${ -30 }  | ${ 10 } | ${ true }  | ${ [ -50, -30 ] }
	`(
		`correctly sets prices to its constraints with arguments values: $values, min: $min, max: $max, step: $step and isMin: $isMin`,
		( { values, min, max, step, isMin, expected } ) => {
			const constrainedValues = constrainRangeSliderValues(
				values,
				min,
				max,
				step,
				isMin
			);

			expect( constrainedValues ).toEqual( expected );
		}
	);
} );
woocommerce-blocks/assets/js/base/components/price-slider/stories/index.js000064400000001530151335517640023103 0ustar00/**
 * External dependencies
 */
import { useState } from '@wordpress/element';

/**
 * Internal dependencies
 */
import PriceSlider from '../';

export default {
	title: 'WooCommerce Blocks/@base-components/PriceSlider',
	component: PriceSlider,
};

export const Default = () => {
	// PriceSlider expects client to update min & max price, i.e. is a controlled component
	const [ min, setMin ] = useState( 1000 );
	const [ max, setMax ] = useState( 5000 );
	return (
		<PriceSlider
			minPrice={ min }
			maxPrice={ max }
			onChange={ ( values ) => {
				setMin( values[ 0 ] );
				setMax( values[ 1 ] );
			} }
			minConstraint={ 1000 }
			maxConstraint={ 5000 }
			step={ 250 }
			currency={ {
				code: 'nzd',
				symbol: '$',
				thousandSeparator: ' ',
				decimalSeparator: '.',
				minorUnit: 2,
				prefix: '$',
				suffix: '',
			} }
		/>
	);
};
woocommerce-blocks/assets/js/base/components/price-slider/style.scss000064400000024307151335517640022012 0ustar00/* stylelint-disable */
@mixin thumb {
	background-color: transparent;
	background-position: 0 0;
	width: 28px;
	height: 23px;
	border: 0;
	padding: 0;
	margin: 0;
	vertical-align: top;
	cursor: pointer;
	z-index: 20;
	pointer-events: auto;
	background-image: url("data:image/svg+xml,%3Csvg width='56' height='46' viewBox='0 0 56 46' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cg clip-path='url(%23clip0)'%3E%3Cpath d='M25.3176 9.9423L16.9013 3.7991C15.1953 2.5706 13.2618 1.9003 11.2146 2.0121H11.1009C6.21029 2.3471 2.11589 6.3681 2.00219 11.2827C1.88849 16.644 6.21019 21 11.6696 21H11.7833C13.603 21 15.4228 20.3298 16.9013 19.213L25.3176 12.958C26.2275 12.0645 26.2275 10.7242 25.3176 9.9423V9.9423Z' fill='white' stroke='%23757575'/%3E%3Cpath d='M13 7V16M10 7V16V7Z' stroke='%23B8B8B8'/%3E%3Cpath d='M25.3176 9.94227L16.9013 3.79907C15.1953 2.57057 13.2618 1.90027 11.2146 2.01207H11.1009C6.21029 2.34707 2.11589 6.36807 2.00219 11.2827C1.88849 16.644 6.21019 21 11.6696 21H11.7833C13.603 21 15.4228 20.3298 16.9013 19.213L25.3176 12.958C26.2275 12.0645 26.2275 10.7242 25.3176 9.94227V9.94227Z' fill='white' stroke='%23757575'/%3E%3Cpath d='M13 7V16M10 7V16V7Z' stroke='%23B8B8B8'/%3E%3Cpath d='M25.3176 32.9423L16.9013 26.7991C15.1953 25.5706 13.2618 24.9003 11.2146 25.0121H11.1009C6.21029 25.347 2.11589 29.368 2.00219 34.2827C1.88849 39.644 6.21019 44 11.6696 44H11.7833C13.603 44 15.4228 43.3298 16.9013 42.213L25.3176 35.958C26.2275 35.0645 26.2275 33.7242 25.3176 32.9423V32.9423Z' fill='%23F8F3F7' stroke='white' stroke-opacity='0.75' stroke-width='3'/%3E%3Cpath d='M25.3176 32.9423L16.9013 26.7991C15.1953 25.5706 13.2618 24.9003 11.2146 25.0121H11.1009C6.21029 25.347 2.11589 29.368 2.00219 34.2827C1.88849 39.644 6.21019 44 11.6696 44H11.7833C13.603 44 15.4228 43.3298 16.9013 42.213L25.3176 35.958C26.2275 35.0645 26.2275 33.7242 25.3176 32.9423V32.9423Z' stroke='%23757575'/%3E%3Cpath d='M13 30V39M10 30V39V30Z' stroke='%23757575'/%3E%3Cpath d='M30.6824 9.94227L39.0987 3.79907C40.8047 2.57057 42.7382 1.90027 44.7854 2.01207H44.8991C49.7897 2.34707 53.8841 6.36807 53.9978 11.2827C54.1115 16.644 49.7898 21 44.3304 21H44.2167C42.397 21 40.5772 20.3298 39.0987 19.213L30.6824 12.958C29.7725 12.0645 29.7725 10.7242 30.6824 9.94227V9.94227Z' fill='white' stroke='%23757575'/%3E%3Cpath d='M43 6.99997V16M46 6.99997V16V6.99997Z' stroke='%23B8B8B8'/%3E%3Cpath d='M30.6824 32.9423L39.0987 26.7991C40.8047 25.5706 42.7382 24.9003 44.7854 25.0121H44.8991C49.7897 25.347 53.8841 29.368 53.9978 34.2827C54.1115 39.644 49.7898 44 44.3304 44H44.2167C42.397 44 40.5772 43.3298 39.0987 42.213L30.6824 35.958C29.7725 35.0645 29.7725 33.7242 30.6824 32.9423V32.9423Z' fill='%23F8F3F7' stroke='white' stroke-opacity='0.75' stroke-width='3'/%3E%3Cpath d='M30.6824 32.9423L39.0987 26.7991C40.8047 25.5706 42.7382 24.9003 44.7854 25.0121H44.8991C49.7897 25.347 53.8841 29.368 53.9978 34.2827C54.1115 39.644 49.7898 44 44.3304 44H44.2167C42.397 44 40.5772 43.3298 39.0987 42.213L30.6824 35.958C29.7725 35.0645 29.7725 33.7242 30.6824 32.9423V32.9423Z' stroke='%23757575'/%3E%3Cpath d='M43 30V39M46 30V39V30Z' stroke='%23757575'/%3E%3C/g%3E%3Cdefs%3E%3CclipPath id='clip0'%3E%3Crect width='56' height='46' fill='white'/%3E%3C/clipPath%3E%3C/defs%3E%3C/svg%3E%0A");

	transition: transform .2s ease-in-out;
	-webkit-appearance: none;
	-moz-appearance: none;
	appearance: none;

	&:hover {
		@include thumbFocus;
	}
}
@mixin thumbFocus {
	background-position-y: -23px;
	transform: scale(1.1);
}
/* stylelint-enable */
@mixin track {
	cursor: default;
	height: 1px; /* Required for Samsung internet based browsers */
	outline: 0;
	-webkit-appearance: none;
	-moz-appearance: none;
	appearance: none;
}
@mixin reset {
	margin: 0;
	padding: 0;
	border: 0;
	outline: none;
	background: transparent;
	-webkit-appearance: none;
	-moz-appearance: none;
	appearance: none;
}

.wc-block-components-price-slider {
	margin-bottom: $gap-large;

	&.wc-block-components-price-slider--has-filter-button {
		.wc-block-components-price-slider__controls {
			justify-content: flex-end;

			.wc-block-components-price-slider__amount.wc-block-components-price-slider__amount--max {
				margin-left: 0;
				margin-right: 10px;
			}
		}
	}

	&.is-loading,
	&.is-disabled {
		.wc-block-components-price-slider__range-input-wrapper,
		.wc-block-components-price-slider__amount,
		.wc-block-components-price-slider__button {
			@include placeholder();
			box-shadow: none;
		}
	}

	&.is-disabled:not(.is-loading) {
		.wc-block-components-price-slider__range-input-wrapper,
		.wc-block-components-price-slider__amount,
		.wc-block-components-price-slider__button {
			animation: none;
		}
	}
}

.wc-block-components-price-slider__range-input-wrapper {
	@include reset;
	height: 9px;
	clear: both;
	position: relative;
	box-shadow: 0 0 0 1px inset rgba(0, 0, 0, 0.1);
	background: #e1e1e1;
	margin: 15px 0;
}

.wc-block-components-price-slider__range-input-progress {
	height: 9px;
	width: 100%;
	position: absolute;
	left: 0;
	top: 0;
	--track-background: linear-gradient(to right, transparent var(--low), var(--range-color) 0, var(--range-color) var(--high), transparent 0) no-repeat 0 100% / 100% 100%;
	--range-color: #{$studio-woocommerce-purple-30};
	/*rtl:ignore*/
	background: var(--track-background);
}

.wc-block-components-price-slider__controls {
	display: flex;

	.wc-block-components-price-slider__amount {
		margin: 0;
		border-radius: 4px;
		width: auto;
		max-width: 100px;
		min-width: 0;

		&.wc-block-components-price-slider__amount--min {
			margin-right: 10px;
		}
		&.wc-block-components-price-slider__amount--max {
			margin-left: auto;
		}
	}
}
.wc-block-components-price-slider__range-input {
	@include reset;
	width: 100%;
	height: 0;
	display: block;
	position: relative;
	pointer-events: none;
	outline: none !important;
	position: absolute;
	left: 0;
	top: 0;

	&::-webkit-slider-runnable-track {
		@include track;
	}
	&::-webkit-slider-thumb {
		@include thumb;
		margin: -6px 0 0 0;
	}
	&::-webkit-slider-progress {
		@include reset;
	}

	&::-moz-focus-outer {
		border: 0;
	}
	&::-moz-range-track {
		@include track;
	}
	&::-moz-range-progress {
		@include reset;
	}
	&::-moz-range-thumb {
		@include thumb;
	}

	&::-ms-thumb {
		@include thumb;
	}

	&:focus {
		&::-webkit-slider-thumb {
			@include thumbFocus;
		}
		&::-moz-range-thumb {
			@include thumbFocus;
		}
		&::-ms-thumb {
			@include thumbFocus;
		}
	}

	&.wc-block-components-price-slider__range-input--min {
		z-index: 21;

		&::-webkit-slider-thumb {
			margin-left: -2px;
			background-position-x: left;
		}
		&::-moz-range-thumb {
			background-position-x: left;
			transform: translate(-2px, 4px);
		}
		&::-ms-thumb {
			background-position-x: left;
		}
	}

	&.wc-block-components-price-slider__range-input--max {
		z-index: 20;

		&::-webkit-slider-thumb {
			background-position-x: right;
			margin-left: 2px;
		}
		&::-moz-range-thumb {
			background-position-x: right;
			transform: translate(2px, 4px);
		}
		&::-ms-thumb {
			background-position-x: right;
		}
	}
}

.rtl {
	.wc-block-components-price-slider__range-input-progress {
		--track-background: linear-gradient(to left, transparent var(--low), var(--range-color) 0, var(--range-color) var(--high), transparent 0) no-repeat 0 100% / 100% 100%;
		--range-color: #{$studio-woocommerce-purple-30};
		background: var(--track-background);
	}
}

@mixin ie-fixes() {
	.wc-block-components-price-slider__range-input-wrapper {
		background: transparent;
		box-shadow: none;
		height: 24px;
	}
	.wc-block-components-price-slider__range-input-progress {
		background: #{$studio-woocommerce-purple-30};
		width: 100%;
		top: 7px;
	}
	.wc-block-components-price-slider__range-input {
		height: 24px;
		pointer-events: auto;

		&::-ms-track {
			/*remove bg colour from the track, we'll use ms-fill-lower and ms-fill-upper instead */
			background: transparent;

			/*leave room for the larger thumb to overflow with a transparent border */
			border-color: transparent;
			border-width: 7px 0;

			/*remove default tick marks*/
			color: transparent;
		}
		&::-ms-fill-lower {
			background: #e1e1e1;
			box-shadow: 0 0 0 1px inset #b8b8b8;
		}
		&::-ms-fill-upper {
			background: transparent;
		}
		&::-ms-tooltip {
			display: none;
		}
		&::-ms-thumb {
			transform: translate(1px, 0);
			pointer-events: auto;
		}
	}
	.wc-block-components-price-slider__range-input--max {
		&::-ms-fill-upper {
			background: #e1e1e1;
			box-shadow: 0 0 0 1px inset #b8b8b8;
		}
		&::-ms-fill-lower {
			background: transparent;
		}
	}

	.wc-block-components-price-slider {
		&.is-loading,
		&.is-disabled {
			.wc-block-components-price-slider__range-input-wrapper {
				@include placeholder();
				box-shadow: none;
			}
		}

		&.is-disabled:not(.is-loading) {
			.wc-block-components-price-slider__range-input-wrapper {
				animation: none;
			}
		}
	}
}

/* IE 11 will not support multi-range slider due to poor pointer-events support on the thumb. Reverts to 2 sliders. */
@include ie11() {
	@include ie-fixes();
}

// Targets Edge <= 18.
@supports (-ms-ime-align:auto) {
	@include ie-fixes();
}

.theme-twentytwentyone {
	$border-width: 3px;

	.wc-block-components-price-slider__range-input-wrapper {
		background: transparent;
		border: $border-width solid currentColor;
		box-sizing: border-box;
	}

	.wc-block-components-price-slider__range-input-progress {
		--range-color: currentColor;
		margin: -$border-width;
	}

	.wc-block-price-filter__range-input {
		background: transparent;
		margin: -$border-width;
		width: calc(100% + #{$border-width * 2});

		&:hover,
		&:focus {
			&::-webkit-slider-thumb {
				filter: none;
			}
			&::-moz-range-thumb {
				filter: none;
			}
			&::-ms-thumb {
				filter: none;
			}
		}

		&::-webkit-slider-thumb {
			margin-top: -9px;
		}

		&.wc-block-components-price-slider__range-input--max::-moz-range-thumb {
			transform: translate(2px, 1px);
		}

		&.wc-block-components-price-slider__range-input--min::-moz-range-thumb {
			transform: translate(-2px, 1px);
		}

		&::-ms-track {
			border-color: transparent !important;
		}
	}

	@include ie11() {
		.wc-block-components-price-slider__range-input-wrapper {
			border: 0;
			height: auto;
			position: relative;
			height: 50px;
		}

		.wc-block-components-price-slider__range-input-progress {
			display: none;
		}

		.wc-block-price-filter__range-input {
			height: 100%;
			margin: 0;
			width: 100%;
		}
	}
}
woocommerce-blocks/assets/js/base/components/price-slider/constrain-range-slider-values.js000064400000002566151335517640026165 0ustar00/**
 * Validate a min and max value for a range slider against defined constraints (min, max, step).
 *
 * @param {Array} values Array containing min and max values.
 * @param {number|null} min Min allowed value for the sliders.
 * @param {number|null} max Max allowed value for the sliders.
 * @param {number} step Step value for the sliders.
 * @param {boolean} isMin Whether we're currently interacting with the min range slider or not, so we update the correct values.
 * @return {Array} Validated and updated min/max values that fit within the range slider constraints.
 */
export const constrainRangeSliderValues = (
	values,
	min,
	max,
	step = 1,
	isMin = false
) => {
	let minValue = parseInt( values[ 0 ], 10 );
	let maxValue = parseInt( values[ 1 ], 10 );

	if ( ! Number.isFinite( minValue ) ) {
		minValue = min || 0;
	}

	if ( ! Number.isFinite( maxValue ) ) {
		maxValue = max || step;
	}

	if ( Number.isFinite( min ) && min > minValue ) {
		minValue = min;
	}

	if ( Number.isFinite( max ) && max <= minValue ) {
		minValue = max - step;
	}

	if ( Number.isFinite( min ) && min >= maxValue ) {
		maxValue = min + step;
	}

	if ( Number.isFinite( max ) && max < maxValue ) {
		maxValue = max;
	}

	if ( ! isMin && minValue >= maxValue ) {
		minValue = maxValue - step;
	}

	if ( isMin && maxValue <= minValue ) {
		maxValue = minValue + step;
	}

	return [ minValue, maxValue ];
};
woocommerce-blocks/assets/js/base/components/pagination/style.scss000064400000002265151335517640021560 0ustar00.wc-block-components-pagination {
	margin: 0 auto $gap;
}

.wc-block-components-pagination__page,
.wc-block-components-pagination__ellipsis {
	@include font-size(regular);
	color: #333;
	display: inline-block;
	font-weight: normal;
}

.wc-block-components-pagination__page {
	border-color: transparent;
	padding: 0.3em 0.6em;
	min-width: 2.2em;

	@include breakpoint("<782px") {
		padding: 0.1em 0.2em;
		min-width: 1.6em;
	}

	// Twenty Twenty register a background color for buttons that is too specific
	// and broad at the same time `button:not(.toggle)` so we're engaing in a
	// specify war with them here.
	// https://github.com/woocommerce/woocommerce-gutenberg-products-block/issues/1203
	&:not(.toggle) {
		background-color: transparent;
	}
}

.wc-block-components-pagination__ellipsis {
	padding: 0.3em;

	@include breakpoint("<782px") {
		padding: 0.1em;
	}
}

.wc-block-components-pagination__page--active[disabled] {
	color: #333;
	font-weight: bold;
	opacity: 1 !important;

	&:hover,
	&:focus {
		background-color: inherit;
		color: #333;
		opacity: 1 !important;
	}
}

html[dir="rtl"] .wc-block-components-pagination-page--arrow span {
	display: inline-block;
	transform: scale(-1, 1);
}
woocommerce-blocks/assets/js/base/components/pagination/utils.js000064400000002103151335517640021210 0ustar00/**
 * Given the number of pages to display, the current page and the total pages,
 * returns the min and max index of the pages to display in the pagination component.
 *
 * @param {number} pagesToDisplay Maximum number of pages to display in the pagination component.
 * @param {number} currentPage Page currently visible.
 * @param {number} totalPages Total pages available.
 * @return {Object} Object containing the min and max index to display in the pagination component.
 */
export const getIndexes = ( pagesToDisplay, currentPage, totalPages ) => {
	if ( totalPages <= 2 ) {
		return { minIndex: null, maxIndex: null };
	}
	const extraPagesToDisplay = pagesToDisplay - 1;
	const tentativeMinIndex = Math.max(
		Math.floor( currentPage - extraPagesToDisplay / 2 ),
		2
	);
	const maxIndex = Math.min(
		Math.ceil(
			currentPage +
				( extraPagesToDisplay - ( currentPage - tentativeMinIndex ) )
		),
		totalPages - 1
	);
	const minIndex = Math.max(
		Math.floor(
			currentPage - ( extraPagesToDisplay - ( maxIndex - currentPage ) )
		),
		2
	);

	return { minIndex, maxIndex };
};
woocommerce-blocks/assets/js/base/components/pagination/index.js000064400000013337151335517640021172 0ustar00/**
 * External dependencies
 */
import { __, sprintf } from '@wordpress/i18n';
import PropTypes from 'prop-types';
import classNames from 'classnames';
import Label from '@woocommerce/base-components/label';

/**
 * Internal dependencies
 */
import { getIndexes } from './utils.js';
import './style.scss';

const Pagination = ( {
	currentPage,
	displayFirstAndLastPages,
	displayNextAndPreviousArrows,
	pagesToDisplay,
	onPageChange,
	totalPages,
} ) => {
	let { minIndex, maxIndex } = getIndexes(
		pagesToDisplay,
		currentPage,
		totalPages
	);
	const showFirstPage = displayFirstAndLastPages && Boolean( minIndex !== 1 );
	const showLastPage =
		displayFirstAndLastPages && Boolean( maxIndex !== totalPages );
	const showFirstPageEllipsis =
		displayFirstAndLastPages && Boolean( minIndex > 3 );
	const showLastPageEllipsis =
		displayFirstAndLastPages && Boolean( maxIndex < totalPages - 2 );

	// Handle the cases where there would be an ellipsis replacing one single page
	if ( showFirstPage && minIndex === 3 ) {
		minIndex = minIndex - 1;
	}
	if ( showLastPage && maxIndex === totalPages - 2 ) {
		maxIndex = maxIndex + 1;
	}

	const pages = [];
	if ( minIndex && maxIndex ) {
		for ( let i = minIndex; i <= maxIndex; i++ ) {
			pages.push( i );
		}
	}

	return (
		<div className="wc-block-pagination wc-block-components-pagination">
			<Label
				screenReaderLabel={ __(
					'Navigate to another page',
					'woocommerce'
				) }
			/>
			{ displayNextAndPreviousArrows && (
				<button
					className="wc-block-pagination-page wc-block-components-pagination__page wc-block-components-pagination-page--arrow"
					onClick={ () => onPageChange( currentPage - 1 ) }
					title={ __(
						'Previous page',
						'woocommerce'
					) }
					disabled={ currentPage <= 1 }
				>
					<Label
						label="&larr;"
						screenReaderLabel={ __(
							'Previous page',
							'woocommerce'
						) }
					/>
				</button>
			) }
			{ showFirstPage && (
				<button
					className={ classNames(
						'wc-block-pagination-page',
						'wc-block-components-pagination__page',
						{
							'wc-block-pagination-page--active':
								currentPage === 1,
							'wc-block-components-pagination__page--active':
								currentPage === 1,
						}
					) }
					onClick={ () => onPageChange( 1 ) }
					disabled={ currentPage === 1 }
				>
					<Label
						label={ 1 }
						screenReaderLabel={ sprintf(
							/* translators: %d is the page number (1, 2, 3...). */
							__( 'Page %d', 'woocommerce' ),
							1
						) }
					/>
				</button>
			) }
			{ showFirstPageEllipsis && (
				<span
					className="wc-block-pagination-ellipsis wc-block-components-pagination__ellipsis"
					aria-hidden="true"
				>
					{ __( '…', 'woocommerce' ) }
				</span>
			) }
			{ pages.map( ( page ) => {
				return (
					<button
						key={ page }
						className={ classNames(
							'wc-block-pagination-page',
							'wc-block-components-pagination__page',
							{
								'wc-block-pagination-page--active':
									currentPage === page,
								'wc-block-components-pagination__page--active':
									currentPage === page,
							}
						) }
						onClick={
							currentPage === page
								? null
								: () => onPageChange( page )
						}
						disabled={ currentPage === page }
					>
						<Label
							label={ page }
							screenReaderLabel={ sprintf(
								/* translators: %d is the page number (1, 2, 3...). */
								__( 'Page %d', 'woocommerce' ),
								page
							) }
						/>
					</button>
				);
			} ) }
			{ showLastPageEllipsis && (
				<span
					className="wc-block-pagination-ellipsis wc-block-components-pagination__ellipsis"
					aria-hidden="true"
				>
					{ __( '…', 'woocommerce' ) }
				</span>
			) }
			{ showLastPage && (
				<button
					className={ classNames(
						'wc-block-pagination-page',
						'wc-block-components-pagination__page',
						{
							'wc-block-pagination-page--active':
								currentPage === totalPages,
							'wc-block-components-pagination__page--active':
								currentPage === totalPages,
						}
					) }
					onClick={ () => onPageChange( totalPages ) }
					disabled={ currentPage === totalPages }
				>
					<Label
						label={ totalPages }
						screenReaderLabel={ sprintf(
							/* translators: %d is the page number (1, 2, 3...). */
							__( 'Page %d', 'woocommerce' ),
							totalPages
						) }
					/>
				</button>
			) }
			{ displayNextAndPreviousArrows && (
				<button
					className="wc-block-pagination-page wc-block-components-pagination__page wc-block-components-pagination-page--arrow"
					onClick={ () => onPageChange( currentPage + 1 ) }
					title={ __( 'Next page', 'woocommerce' ) }
					disabled={ currentPage >= totalPages }
				>
					<Label
						label="&rarr;"
						screenReaderLabel={ __(
							'Next page',
							'woocommerce'
						) }
					/>
				</button>
			) }
		</div>
	);
};

Pagination.propTypes = {
	/**
	 * Number of the page currently being displayed.
	 */
	currentPage: PropTypes.number.isRequired,
	/**
	 * Total number of pages.
	 */
	totalPages: PropTypes.number.isRequired,
	/**
	 * Displays first and last pages if they are not in the current range of pages displayed.
	 */
	displayFirstAndLastPages: PropTypes.bool,
	/**
	 * Displays arrows to navigate to the previous and next pages.
	 */
	displayNextAndPreviousArrows: PropTypes.bool,
	/**
	 * Callback function called when the user triggers a page change.
	 */
	onPageChange: PropTypes.func,
	/**
	 * Number of pages to display at the same time, including the active page
	 * and the pages displayed before and after it. It doesn't include the first
	 * and last pages.
	 */
	pagesToDisplay: PropTypes.number,
};

Pagination.defaultProps = {
	displayFirstAndLastPages: true,
	displayNextAndPreviousArrows: true,
	pagesToDisplay: 3,
};

export default Pagination;
woocommerce-blocks/assets/js/base/components/pagination/test/index.js000064400000001646151335517640022151 0ustar00/**
 * Internal dependencies
 */
import { getIndexes } from '../utils.js';

describe( 'getIndexes', () => {
	describe( 'when on the first page', () => {
		test( 'indexes include the first pages available', () => {
			expect( getIndexes( 5, 1, 100 ) ).toEqual( {
				minIndex: 2,
				maxIndex: 6,
			} );
		} );

		test( 'indexes are null if there are 2 pages or less', () => {
			expect( getIndexes( 5, 1, 1 ) ).toEqual( {
				minIndex: null,
				maxIndex: null,
			} );
		} );
	} );

	describe( 'when on a page in the middle', () => {
		test( 'indexes include pages before and after the current page', () => {
			expect( getIndexes( 5, 50, 100 ) ).toEqual( {
				minIndex: 48,
				maxIndex: 52,
			} );
		} );
	} );

	describe( 'when on the last page', () => {
		test( 'indexes include the last pages available', () => {
			expect( getIndexes( 5, 100, 100 ) ).toEqual( {
				minIndex: 95,
				maxIndex: 99,
			} );
		} );
	} );
} );
woocommerce-blocks/assets/js/base/components/read-more/index.js000064400000006711151335517640020712 0ustar00/**
 * External dependencies
 */
import React, { createRef, Component } from 'react';
import PropTypes from 'prop-types';
import { __ } from '@wordpress/i18n';

/**
 * Internal dependencies
 */
import { clampLines } from './utils';

/**
 * Show text based content, limited to a number of lines, with a read more link.
 *
 * Based on https://github.com/zoltantothcom/react-clamp-lines.
 */
class ReadMore extends Component {
	constructor( props ) {
		super( ...arguments );

		this.state = {
			/**
			 * This is true when read more has been pressed and the full review is shown.
			 */
			isExpanded: false,
			/**
			 * True if we are clamping content. False if the review is short. Null during init.
			 */
			clampEnabled: null,
			/**
			 * Content is passed in via children.
			 */
			content: props.children,
			/**
			 * Summary content generated from content HTML.
			 */
			summary: '.',
		};

		this.reviewSummary = createRef();
		this.reviewContent = createRef();
		this.getButton = this.getButton.bind( this );
		this.onClick = this.onClick.bind( this );
	}

	componentDidMount() {
		if ( this.props.children ) {
			const { maxLines, ellipsis } = this.props;

			const lineHeight = this.reviewSummary.current.clientHeight + 1;
			const reviewHeight = this.reviewContent.current.clientHeight + 1;
			const maxHeight = lineHeight * maxLines + 1;
			const clampEnabled = reviewHeight > maxHeight;

			this.setState( {
				clampEnabled,
			} );

			if ( clampEnabled ) {
				this.setState( {
					summary: clampLines(
						this.reviewContent.current.innerHTML,
						this.reviewSummary.current,
						maxHeight,
						ellipsis
					),
				} );
			}
		}
	}

	getButton() {
		const { isExpanded } = this.state;
		const { className, lessText, moreText } = this.props;

		const buttonText = isExpanded ? lessText : moreText;

		if ( ! buttonText ) {
			return;
		}

		return (
			<a
				href="#more"
				className={ className + '__read_more' }
				onClick={ this.onClick }
				aria-expanded={ ! isExpanded }
				role="button"
			>
				{ buttonText }
			</a>
		);
	}

	/**
	 * Handles the click event for the read more/less button.
	 *
	 * @param {Object} e event
	 */
	onClick( e ) {
		e.preventDefault();

		const { isExpanded } = this.state;

		this.setState( {
			isExpanded: ! isExpanded,
		} );
	}

	render() {
		const { className } = this.props;
		const { content, summary, clampEnabled, isExpanded } = this.state;

		if ( ! content ) {
			return null;
		}

		if ( clampEnabled === false ) {
			return (
				<div className={ className }>
					<div ref={ this.reviewContent }>{ content }</div>
				</div>
			);
		}

		return (
			<div className={ className }>
				{ ( ! isExpanded || clampEnabled === null ) && (
					<div
						ref={ this.reviewSummary }
						aria-hidden={ isExpanded }
						dangerouslySetInnerHTML={ {
							__html: summary,
						} }
					/>
				) }
				{ ( isExpanded || clampEnabled === null ) && (
					<div
						ref={ this.reviewContent }
						aria-hidden={ ! isExpanded }
					>
						{ content }
					</div>
				) }
				{ this.getButton() }
			</div>
		);
	}
}

ReadMore.propTypes = {
	children: PropTypes.node.isRequired,
	maxLines: PropTypes.number,
	ellipsis: PropTypes.string,
	moreText: PropTypes.string,
	lessText: PropTypes.string,
	className: PropTypes.string,
};

ReadMore.defaultProps = {
	maxLines: 3,
	ellipsis: '&hellip;',
	moreText: __( 'Read more', 'woocommerce' ),
	lessText: __( 'Read less', 'woocommerce' ),
	className: 'read-more-content',
};

export default ReadMore;
woocommerce-blocks/assets/js/base/components/read-more/utils.js000064400000004761151335517640020746 0ustar00/**
 * External dependencies
 */
import trimHtml from 'trim-html';

/**
 * Truncate some HTML content to a given length.
 *
 * @param {string} html HTML that will be truncated.
 * @param {number} length Length to truncate the string to.
 * @param {string} ellipsis Character to append to truncated content.
 */
export const truncateHtml = ( html, length, ellipsis = '...' ) => {
	const trimmed = trimHtml( html, {
		suffix: ellipsis,
		limit: length,
	} );

	return trimmed.html;
};

/**
 * Clamp lines calculates the height of a line of text and then limits it to the
 * value of the lines prop. Content is updated once limited.
 *
 * @param {string} originalContent Content to be clamped.
 * @param {Object} targetElement Element which will contain the clamped content.
 * @param {number} maxHeight Max height of the clamped content.
 * @param {string} ellipsis Character to append to clamped content.
 * @return {string} clamped content
 */
export const clampLines = (
	originalContent,
	targetElement,
	maxHeight,
	ellipsis
) => {
	const length = calculateLength( originalContent, targetElement, maxHeight );

	return truncateHtml( originalContent, length - ellipsis.length, ellipsis );
};

/**
 * Calculate how long the content can be based on the maximum number of lines allowed, and client height.
 *
 * @param {string} originalContent Content to be clamped.
 * @param {Object} targetElement Element which will contain the clamped content.
 * @param {number} maxHeight Max height of the clamped content.
 */
const calculateLength = ( originalContent, targetElement, maxHeight ) => {
	let markers = {
		start: 0,
		middle: 0,
		end: originalContent.length,
	};

	while ( markers.start <= markers.end ) {
		markers.middle = Math.floor( ( markers.start + markers.end ) / 2 );

		// We set the innerHTML directly in the DOM here so we can reliably check the clientHeight later in moveMarkers.
		targetElement.innerHTML = truncateHtml(
			originalContent,
			markers.middle
		);

		markers = moveMarkers( markers, targetElement.clientHeight, maxHeight );
	}

	return markers.middle;
};

/**
 * Move string markers. Used by calculateLength.
 *
 * @param {Object} markers Markers for clamped content.
 * @param {number} currentHeight Current height of clamped content.
 * @param {number} maxHeight Max height of the clamped content.
 */
const moveMarkers = ( markers, currentHeight, maxHeight ) => {
	if ( currentHeight <= maxHeight ) {
		markers.start = markers.middle + 1;
	} else {
		markers.end = markers.middle - 1;
	}

	return markers;
};
woocommerce-blocks/assets/js/base/components/read-more/stories/index.js000064400000002543151335517640022401 0ustar00/**
 * Internal dependencies
 */
import ReadMore from '../';

export default {
	title: 'WooCommerce Blocks/@base-components/ReadMore',
	component: ReadMore,
};

export const Default = () => (
	<ReadMore maxLines={ 2 }>
		<h1>
			No! Alderaan is peaceful. We have no weapons. You can&apos;t
			possibly…
		</h1>
		<p>
			As you wish. But with the blast shield down, I can&apos;t even see!
			How am I supposed to fight? Look, I ain&apos;t in this for your
			revolution, and I&apos;m not in it for you, Princess. I expect to be
			well paid. I&apos;m in it for the money.
		</p>
		<p>
			You mean it controls your actions?
			<strong>
				{ ' ' }
				She must have hidden the plans in the escape pod.
			</strong>{ ' ' }
			<em>
				Send a detachment down to retrieve them, and see to it
				personally, Commander.
			</em>
			There&apos;ll be no one to stop us this time!
		</p>
		<h2>Escape is not his plan. I must face him, alone.</h2>
		<ol>
			<li>Partially, but it also obeys your commands.</li>
			<li>
				Leave that to me. Send a distress signal, and inform the Senate
				that all on board were killed.
			</li>
			<li>
				A tremor in the Force. The last time I felt it was in the
				presence of my old master.
			</li>
		</ol>
		<aside>
			<a href="http://fillerama.io">
				Content from http://fillerama.io &quot;Star Wars&quot;
			</a>
		</aside>
	</ReadMore>
);
woocommerce-blocks/assets/js/base/components/read-more/test/index.js000064400000004632151335517640021671 0ustar00/**
 * Internal dependencies
 */
import { truncateHtml } from '../utils';
const shortContent =
	'<p>Lorem ipsum dolor sit amet, <strong>consectetur.</strong>.</p>';

const longContent =
	'<p>Lorem ipsum dolor sit amet, <strong>consectetur adipiscing elit. Nullam a condimentum diam.</strong> Donec finibus enim eros, et lobortis magna varius quis. Nulla lacinia tellus ac neque aliquet, in porttitor metus interdum. Maecenas vestibulum nisi et auctor vestibulum. Maecenas vehicula, lacus et pellentesque tempor, orci nulla mattis purus, id porttitor augue magna et metus. Aenean hendrerit aliquet massa ac convallis. Mauris vestibulum neque in condimentum porttitor. Donec viverra, orci a accumsan vehicula, dui massa lobortis lorem, et cursus est purus pulvinar elit. Vestibulum vitae tincidunt ex, ut vulputate nisi.</p>' +
	'<p>Morbi tristique iaculis felis, sed porta urna tincidunt vitae. Etiam nisl sem, eleifend non varius quis, placerat a arcu. Donec consectetur nunc at orci fringilla pulvinar. Nam hendrerit tellus in est aliquet varius id in diam. Donec eu ullamcorper ante. Ut ultricies, felis vel sodales aliquet, nibh massa vestibulum ipsum, sed dignissim mi nunc eget lacus. Curabitur mattis placerat magna a aliquam. Nullam diam elit, cursus nec erat ullamcorper, tempor eleifend mauris. Nunc placerat nunc ut enim ornare tempus. Fusce porta molestie ante eget faucibus. Fusce eu lectus sit amet diam auctor lacinia et in diam. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Mauris eu lacus lobortis, faucibus est vel, pulvinar odio. Duis feugiat tortor quis dui euismod varius.</p>';

describe( 'ReadMore Component', () => {
	describe( 'Test the truncateHtml function', () => {
		it( 'Truncate long HTML content to length of 10', () => {
			const truncatedContent = truncateHtml( longContent, 10 );

			expect( truncatedContent ).toEqual( '<p>Lorem ipsum...</p>' );
		} );
		it( 'Truncate long HTML content, but avoid cutting off HTML tags.', () => {
			const truncatedContent = truncateHtml( longContent, 40 );

			expect( truncatedContent ).toEqual(
				'<p>Lorem ipsum dolor sit amet, <strong>consectetur...</strong></p>'
			);
		} );
		it( 'No need to truncate short HTML content.', () => {
			const truncatedContent = truncateHtml( shortContent, 100 );

			expect( truncatedContent ).toEqual(
				'<p>Lorem ipsum dolor sit amet, <strong>consectetur.</strong>.</p>'
			);
		} );
	} );
} );
woocommerce-blocks/assets/js/base/context/utils.js000064400000003256151335517640016370 0ustar00/**
 * This is an assertion utility for validating that the incoming value prop
 * value on a given context provider is valid and throws an error if it isn't.
 *
 * Note: this asserts values that are expected to be an object.
 *
 * The validationMap is expected to be an object in the following shape.
 *
 * {
 *   [expectedPropertyName<String>]: {
 *     required: [expectedRequired<Boolean>]
 *     type: [expectedType<String>]
 *   }
 * }
 *
 * @param {string} contextName   The name of the context provider being
 *                               validated.
 * @param {Object} validationMap A map for validating the incoming value against.
 * @param {Object} value         The value being validated.
 *
 * @throws {Error}
 */
export const assertValidContextValue = (
	contextName,
	validationMap,
	value
) => {
	if ( typeof value !== 'object' ) {
		throw new Error(
			`${ contextName } expects an object for its context value`
		);
	}
	const errors = [];
	for ( const expectedProperty in validationMap ) {
		if (
			validationMap[ expectedProperty ].required &&
			typeof value[ expectedProperty ] === 'undefined'
		) {
			errors.push(
				`The ${ expectedProperty } is required and is not present.`
			);
		} else if (
			typeof value[ expectedProperty ] !== 'undefined' &&
			typeof value[ expectedProperty ] !==
				validationMap[ expectedProperty ].type
		) {
			errors.push(
				`The ${ expectedProperty } must be of ${
					validationMap[ expectedProperty ].type
				} and instead was ${ typeof value[ expectedProperty ] }`
			);
		}
	}
	if ( errors.length > 0 ) {
		throw new Error(
			`There was a problem with the value passed in on ${ contextName }:\n ${ errors.join(
				'\n'
			) }`
		);
	}
};
woocommerce-blocks/assets/js/base/context/test/utils.js000064400000002001151335517640017332 0ustar00/**
 * Internal dependencies
 */
import { assertValidContextValue } from '../utils';

describe( 'assertValidContextValue', () => {
	const contextName = 'testContext';
	const validationMap = {
		cheeseburger: {
			required: false,
			type: 'string',
		},
		amountKetchup: {
			required: true,
			type: 'number',
		},
	};
	it.each`
		testValue
		${ {} }
		${ 10 }
		${ { amountKetchup: '10' } }
	`(
		'The value of $testValue is expected to trigger an Error',
		( { testValue } ) => {
			const invokeTest = () => {
				assertValidContextValue(
					contextName,
					validationMap,
					testValue
				);
			};
			expect( invokeTest ).toThrow();
		}
	);
	it.each`
		testValue
		${ { amountKetchup: 20 } }
		${ { cheeseburger: 'fries', amountKetchup: 20 } }
	`(
		'The value of $testValue is not expected to trigger an Error',
		( { testValue } ) => {
			const invokeTest = () => {
				assertValidContextValue(
					contextName,
					validationMap,
					testValue
				);
			};
			expect( invokeTest ).not.toThrow();
		}
	);
} );
woocommerce-blocks/assets/js/base/context/event-emit/emitter-callback.ts000064400000000760151335517650022520 0ustar00/**
 * Internal dependencies
 */
import { actions } from './reducer';
import type { ActionType, ActionCallbackType } from './types';

export const emitterCallback = (
	type: string,
	observerDispatch: React.Dispatch< ActionType >
) => ( callback: ActionCallbackType, priority = 10 ): ( () => void ) => {
	const action = actions.addEventCallback( type, callback, priority );
	observerDispatch( action );
	return () => {
		observerDispatch( actions.removeEventCallback( type, action.id ) );
	};
};
woocommerce-blocks/assets/js/base/context/event-emit/index.ts000064400000000164151335517650020422 0ustar00export * from './reducer';
export * from './emitters';
export * from './emitter-callback';
export * from './types';
woocommerce-blocks/assets/js/base/context/event-emit/emitters.ts000064400000006645151335517650021161 0ustar00/**
 * Internal dependencies
 */
import { getObserversByPriority } from './utils';
import type { EventObserversType } from './types';
import { isErrorResponse, isFailResponse } from '../hooks/use-emit-response';

/**
 * Emits events on registered observers for the provided type and passes along
 * the provided data.
 *
 * This event emitter will silently catch promise errors, but doesn't care
 * otherwise if any errors are caused by observers. So events that do care
 * should use `emitEventWithAbort` instead.
 *
 * @param {Object} observers The registered observers to omit to.
 * @param {string} eventType The event type being emitted.
 * @param {*}      data      Data passed along to the observer when it is invoked.
 *
 * @return {Promise} A promise that resolves to true after all observers have executed.
 */
export const emitEvent = async (
	observers: EventObserversType,
	eventType: string,
	data: unknown
): Promise< unknown > => {
	const observersByType = getObserversByPriority( observers, eventType );
	const observerResponses = [];
	for ( const observer of observersByType ) {
		try {
			const observerResponse = await Promise.resolve(
				observer.callback( data )
			);
			if ( typeof observerResponse === 'object' ) {
				observerResponses.push( observerResponse );
			}
		} catch ( e ) {
			// we don't care about errors blocking execution, but will console.error for troubleshooting.
			// eslint-disable-next-line no-console
			console.error( e );
		}
	}
	return observerResponses.length ? observerResponses : true;
};

/**
 * Emits events on registered observers for the provided type and passes along
 * the provided data. This event emitter will abort if an observer throws an
 * error or if the response includes an object with an error type property.
 *
 * Any successful observer responses before abort will be included in the returned package.
 *
 * @param {Object} observers The registered observers to omit to.
 * @param {string} eventType The event type being emitted.
 * @param {*}      data      Data passed along to the observer when it is invoked.
 *
 * @return {Promise} Returns a promise that resolves to either boolean, or an array of responses
 *                   from registered observers that were invoked up to the point of an error.
 */
export const emitEventWithAbort = async (
	observers: EventObserversType,
	eventType: string,
	data: unknown
): Promise< Array< unknown > > => {
	const observerResponses = [];
	const observersByType = getObserversByPriority( observers, eventType );
	for ( const observer of observersByType ) {
		try {
			const response = await Promise.resolve( observer.callback( data ) );
			if ( typeof response !== 'object' || response === null ) {
				continue;
			}
			if ( ! response.hasOwnProperty( 'type' ) ) {
				throw new Error(
					'Returned objects from event emitter observers must return an object with a type property'
				);
			}
			if ( isErrorResponse( response ) || isFailResponse( response ) ) {
				observerResponses.push( response );
				// early abort.
				return observerResponses;
			}
			// all potential abort conditions have been considered push the
			// response to the array.
			observerResponses.push( response );
		} catch ( e ) {
			// We don't handle thrown errors but just console.log for troubleshooting.
			// eslint-disable-next-line no-console
			console.error( e );
			observerResponses.push( { type: 'error' } );
			return observerResponses;
		}
	}
	return observerResponses;
};
woocommerce-blocks/assets/js/base/context/event-emit/types.ts000064400000001010151335517650020446 0ustar00export enum ACTION {
	ADD_EVENT_CALLBACK = 'add_event_callback',
	REMOVE_EVENT_CALLBACK = 'remove_event_callback',
}

export type ActionCallbackType = ( ...args: unknown[] ) => unknown;

export type ActionType = {
	type: ACTION;
	eventType: string;
	id: string;
	callback?: ActionCallbackType;
	priority?: number;
};

export type ObserverType = { priority: number; callback: ActionCallbackType };
export type ObserversType = Map< string, ObserverType >;
export type EventObserversType = Record< string, ObserversType >;
woocommerce-blocks/assets/js/base/context/event-emit/test/emitters.js000064400000007561151335517650022124 0ustar00/**
 * Internal dependencies
 */
import { emitEvent, emitEventWithAbort } from '../emitters';

describe( 'Testing emitters', () => {
	let observerMocks = {};
	let observerA;
	let observerB;
	let observerPromiseWithResolvedValue;
	beforeEach( () => {
		observerA = jest.fn().mockReturnValue( true );
		observerB = jest.fn().mockReturnValue( true );
		observerPromiseWithResolvedValue = jest.fn().mockResolvedValue( 10 );
		observerMocks = new Map( [
			[ 'observerA', { priority: 10, callback: observerA } ],
			[ 'observerB', { priority: 10, callback: observerB } ],
			[
				'observerReturnValue',
				{ priority: 10, callback: jest.fn().mockReturnValue( 10 ) },
			],
			[
				'observerPromiseWithReject',
				{
					priority: 10,
					callback: jest.fn().mockRejectedValue( 'an error' ),
				},
			],
			[
				'observerPromiseWithResolvedValue',
				{ priority: 10, callback: observerPromiseWithResolvedValue },
			],
			[
				'observerSuccessType',
				{
					priority: 10,
					callback: jest.fn().mockReturnValue( { type: 'success' } ),
				},
			],
		] );
	} );
	describe( 'Testing emitEvent()', () => {
		it( 'invokes all observers', async () => {
			const observers = { test: observerMocks };
			const response = await emitEvent( observers, 'test', 'foo' );
			expect( console ).toHaveErroredWith( 'an error' );
			expect( observerA ).toHaveBeenCalledTimes( 1 );
			expect( observerB ).toHaveBeenCalledWith( 'foo' );
			expect( response ).toEqual( [ { type: 'success' } ] );
		} );
	} );
	describe( 'Testing emitEventWithAbort()', () => {
		it( 'does not abort on any return value other than an object with an error or fail type property', async () => {
			observerMocks.delete( 'observerPromiseWithReject' );
			const observers = { test: observerMocks };
			const response = await emitEventWithAbort(
				observers,
				'test',
				'foo'
			);
			expect( console ).not.toHaveErrored();
			expect( observerB ).toHaveBeenCalledTimes( 1 );
			expect( observerPromiseWithResolvedValue ).toHaveBeenCalled();
			expect( response ).toEqual( [ { type: 'success' } ] );
		} );
		it( 'Aborts on a return value with an object that has a a fail type property', async () => {
			const validObjectResponse = jest
				.fn()
				.mockReturnValue( { type: 'failure' } );
			observerMocks.set( 'observerValidObject', {
				priority: 5,
				callback: validObjectResponse,
			} );
			const observers = { test: observerMocks };
			const response = await emitEventWithAbort(
				observers,
				'test',
				'foo'
			);
			expect( console ).not.toHaveErrored();
			expect( validObjectResponse ).toHaveBeenCalledTimes( 1 );
			expect( observerPromiseWithResolvedValue ).not.toHaveBeenCalled();
			expect( response ).toEqual( [ { type: 'failure' } ] );
		} );
		it( 'throws an error on an object returned from observer without a type property', async () => {
			const failingObjectResponse = jest.fn().mockReturnValue( {} );
			observerMocks.set( 'observerInvalidObject', {
				priority: 5,
				callback: failingObjectResponse,
			} );
			const observers = { test: observerMocks };
			const response = await emitEventWithAbort(
				observers,
				'test',
				'foo'
			);
			expect( console ).toHaveErrored();
			expect( failingObjectResponse ).toHaveBeenCalledTimes( 1 );
			expect( observerPromiseWithResolvedValue ).not.toHaveBeenCalled();
			expect( response ).toEqual( [ { type: 'error' } ] );
		} );
	} );
	describe( 'Test Priority', () => {
		it( 'executes observers in expected order by priority', async () => {
			const a = jest.fn();
			const b = jest.fn().mockReturnValue( { type: 'error' } );
			const observers = {
				test: new Map( [
					[ 'observerA', { priority: 200, callback: a } ],
					[ 'observerB', { priority: 10, callback: b } ],
				] ),
			};
			await emitEventWithAbort( observers, 'test', 'foo' );
			expect( console ).not.toHaveErrored();
			expect( b ).toHaveBeenCalledTimes( 1 );
			expect( a ).not.toHaveBeenCalled();
		} );
	} );
} );
woocommerce-blocks/assets/js/base/context/event-emit/utils.ts000064400000000561151335517650020454 0ustar00/**
 * Internal dependencies
 */
import type { EventObserversType, ObserverType } from './types';

export const getObserversByPriority = (
	observers: EventObserversType,
	eventType: string
): ObserverType[] => {
	return observers[ eventType ]
		? Array.from( observers[ eventType ].values() ).sort( ( a, b ) => {
				return a.priority - b.priority;
		  } )
		: [];
};
woocommerce-blocks/assets/js/base/context/event-emit/reducer.ts000064400000002303151335517650020741 0ustar00/**
 * External dependencies
 */
import { uniqueId } from 'lodash';

/**
 * Internal dependencies
 */
import {
	ACTION,
	ActionType,
	ActionCallbackType,
	EventObserversType,
} from './types';

export const actions = {
	addEventCallback: (
		eventType: string,
		callback: ActionCallbackType,
		priority = 10
	): ActionType => {
		return {
			id: uniqueId(),
			type: ACTION.ADD_EVENT_CALLBACK,
			eventType,
			callback,
			priority,
		};
	},
	removeEventCallback: ( eventType: string, id: string ): ActionType => {
		return {
			id,
			type: ACTION.REMOVE_EVENT_CALLBACK,
			eventType,
		};
	},
};

const initialState = {} as EventObserversType;

/**
 * Handles actions for emitters
 */
export const reducer = (
	state = initialState,
	{ type, eventType, id, callback, priority }: ActionType
): typeof initialState => {
	const newEvents = state.hasOwnProperty( eventType )
		? new Map( state[ eventType ] )
		: new Map();
	switch ( type ) {
		case ACTION.ADD_EVENT_CALLBACK:
			newEvents.set( id, { priority, callback } );
			return {
				...state,
				[ eventType ]: newEvents,
			};
		case ACTION.REMOVE_EVENT_CALLBACK:
			newEvents.delete( id );
			return {
				...state,
				[ eventType ]: newEvents,
			};
	}
};
woocommerce-blocks/assets/js/base/context/hooks/use-customer-data.ts000064400000012165151335517650021727 0ustar00/**
 * External dependencies
 */
import { useDispatch } from '@wordpress/data';
import { useEffect, useState, useCallback, useRef } from '@wordpress/element';
import { CART_STORE_KEY as storeKey } from '@woocommerce/block-data';
import { useDebounce } from 'use-debounce';
import isShallowEqual from '@wordpress/is-shallow-equal';
import {
	formatStoreApiErrorMessage,
	pluckAddress,
	pluckEmail,
} from '@woocommerce/base-utils';
import type {
	CartResponseBillingAddress,
	CartResponseShippingAddress,
} from '@woocommerce/types';

declare type CustomerData = {
	billingData: CartResponseBillingAddress;
	shippingAddress: CartResponseShippingAddress;
};

/**
 * Internal dependencies
 */
import { useStoreCart } from './cart/use-store-cart';
import { useStoreNotices } from './use-store-notices';

function instanceOfCartResponseBillingAddress(
	address: CartResponseBillingAddress | CartResponseShippingAddress
): address is CartResponseBillingAddress {
	return 'email' in address;
}

/**
 * Does a shallow compare of important address data to determine if the cart needs updating on the server.
 *
 * This takes the current and previous address into account, as well as the billing email field.
 *
 * @param {Object} previousAddress An object containing all previous address information
 * @param {Object} address An object containing all address information
 *
 * @return {boolean} True if the store needs updating due to changed data.
 */
const shouldUpdateAddressStore = <
	T extends CartResponseBillingAddress | CartResponseShippingAddress
>(
	previousAddress: T,
	address: T
): boolean => {
	if (
		instanceOfCartResponseBillingAddress( address ) &&
		pluckEmail( address ) !==
			pluckEmail( previousAddress as CartResponseBillingAddress )
	) {
		return true;
	}

	return (
		!! address.country &&
		! isShallowEqual(
			pluckAddress( previousAddress ),
			pluckAddress( address )
		)
	);
};

/**
 * This is a custom hook for syncing customer address data (billing and shipping) with the server.
 */
export const useCustomerData = (): {
	billingData: CartResponseBillingAddress;
	shippingAddress: CartResponseShippingAddress;
	setBillingData: ( data: CartResponseBillingAddress ) => void;
	setShippingAddress: ( data: CartResponseShippingAddress ) => void;
} => {
	const { updateCustomerData } = useDispatch( storeKey );
	const { addErrorNotice, removeNotice } = useStoreNotices();

	// Grab the initial values from the store cart hook.
	const {
		billingAddress: initialBillingAddress,
		shippingAddress: initialShippingAddress,
	}: Omit< CustomerData, 'billingData' > & {
		billingAddress: CartResponseBillingAddress;
	} = useStoreCart();

	// State of customer data is tracked here from this point, using the initial values from the useStoreCart hook.
	const [ customerData, setCustomerData ] = useState< CustomerData >( {
		billingData: initialBillingAddress,
		shippingAddress: initialShippingAddress,
	} );

	// Store values last sent to the server in a ref to avoid requests unless important fields are changed.
	const previousCustomerData = useRef< CustomerData >( customerData );

	// Debounce updates to the customerData state so it's not triggered excessively.
	const [ debouncedCustomerData ] = useDebounce( customerData, 1000, {
		// Default equalityFn is prevData === newData.
		equalityFn: ( prevData, newData ) => {
			return (
				isShallowEqual( prevData.billingData, newData.billingData ) &&
				isShallowEqual(
					prevData.shippingAddress,
					newData.shippingAddress
				)
			);
		},
	} );

	/**
	 * Set billing data.
	 *
	 * Contains special handling for email so those fields are not overwritten if simply updating address.
	 */
	const setBillingData = useCallback( ( newData ) => {
		setCustomerData( ( prevState ) => {
			return {
				...prevState,
				billingData: {
					...prevState.billingData,
					...newData,
				},
			};
		} );
	}, [] );

	/**
	 * Set shipping data.
	 */
	const setShippingAddress = useCallback( ( newData ) => {
		setCustomerData( ( prevState ) => {
			return {
				...prevState,
				shippingAddress: {
					...prevState.shippingAddress,
					...newData,
				},
			};
		} );
	}, [] );

	/**
	 * This pushes changes to the API when the local state differs from the address in the cart.
	 */
	useEffect( () => {
		// Only push updates when enough fields are populated.
		if (
			! shouldUpdateAddressStore(
				previousCustomerData.current.billingData,
				debouncedCustomerData.billingData
			) &&
			! shouldUpdateAddressStore(
				previousCustomerData.current.shippingAddress,
				debouncedCustomerData.shippingAddress
			)
		) {
			return;
		}
		previousCustomerData.current = debouncedCustomerData;
		updateCustomerData( {
			billing_address: debouncedCustomerData.billingData,
			shipping_address: debouncedCustomerData.shippingAddress,
		} )
			.then( () => {
				removeNotice( 'checkout' );
			} )
			.catch( ( response ) => {
				addErrorNotice( formatStoreApiErrorMessage( response ), {
					id: 'checkout',
				} );
			} );
	}, [
		debouncedCustomerData,
		addErrorNotice,
		removeNotice,
		updateCustomerData,
	] );
	return {
		billingData: customerData.billingData,
		shippingAddress: customerData.shippingAddress,
		setBillingData,
		setShippingAddress,
	};
};
woocommerce-blocks/assets/js/base/context/hooks/use-checkout-address.js000064400000006347151335517650022402 0ustar00/**
 * External dependencies
 */
import { defaultAddressFields } from '@woocommerce/settings';
import { useEffect, useCallback, useRef } from '@wordpress/element';

/**
 * Internal dependencies
 */
import {
	useShippingDataContext,
	useCustomerDataContext,
} from '../providers/cart-checkout';

/**
 * Custom hook for exposing address related functionality for the checkout address form.
 */
export const useCheckoutAddress = () => {
	const { needsShipping } = useShippingDataContext();
	const {
		billingData,
		setBillingData,
		shippingAddress,
		setShippingAddress,
		shippingAsBilling,
		setShippingAsBilling,
	} = useCustomerDataContext();

	const currentShippingAsBilling = useRef( shippingAsBilling );
	const previousBillingData = useRef( billingData );

	/**
	 * Sets shipping address data, and also billing if using the same address.
	 */
	const setShippingFields = useCallback(
		( value ) => {
			setShippingAddress( value );

			if ( shippingAsBilling ) {
				setBillingData( value );
			}
		},
		[ shippingAsBilling, setShippingAddress, setBillingData ]
	);

	/**
	 * Sets billing address data, and also shipping if shipping is disabled.
	 */
	const setBillingFields = useCallback(
		( value ) => {
			setBillingData( value );

			if ( ! needsShipping ) {
				setShippingAddress( value );
			}
		},
		[ needsShipping, setShippingAddress, setBillingData ]
	);

	// When the "Use same address" checkbox is toggled we need to update the current billing address to reflect this.
	// This either sets the billing address to the shipping address, or restores the billing address to it's previous state.
	useEffect( () => {
		if ( currentShippingAsBilling.current !== shippingAsBilling ) {
			if ( shippingAsBilling ) {
				previousBillingData.current = billingData;
				setBillingData( shippingAddress );
			} else {
				const {
					// We need to pluck out email from previous billing data because they can be empty, causing the current email to get emptied. See issue #4155
					/* eslint-disable no-unused-vars */
					email,
					/* eslint-enable no-unused-vars */
					...billingAddress
				} = previousBillingData.current;

				setBillingData( {
					...billingAddress,
				} );
			}
			currentShippingAsBilling.current = shippingAsBilling;
		}
	}, [ shippingAsBilling, setBillingData, shippingAddress, billingData ] );

	const setEmail = useCallback(
		( value ) =>
			void setBillingData( {
				email: value,
			} ),
		[ setBillingData ]
	);

	const setPhone = useCallback(
		( value ) =>
			void setBillingData( {
				phone: value,
			} ),
		[ setBillingData ]
	);

	const setShippingPhone = useCallback(
		( value ) =>
			void setShippingFields( {
				phone: value,
			} ),
		[ setShippingFields ]
	);

	// Note that currentShippingAsBilling is returned rather than the current state of shippingAsBilling--this is so that
	// the billing fields are not rendered before sync (billing field values are debounced and would be outdated)
	return {
		defaultAddressFields,
		shippingFields: shippingAddress,
		setShippingFields,
		billingFields: billingData,
		setBillingFields,
		setEmail,
		setPhone,
		setShippingPhone,
		shippingAsBilling,
		setShippingAsBilling,
		showShippingFields: needsShipping,
		showBillingFields:
			! needsShipping || ! currentShippingAsBilling.current,
	};
};
woocommerce-blocks/assets/js/base/context/hooks/use-store-products.js000064400000002675151335517650022147 0ustar00/**
 * Internal dependencies
 */
import { useCollectionHeader, useCollection } from './collections';

/**
 * This is a custom hook that is wired up to the `wc/store/collections` data
 * store for the `wc/store/products` route. Given a query object, this
 * will ensure a component is kept up to date with the products matching that
 * query in the store state.
 *
 * @param {Object} query   An object containing any query arguments to be
 *                         included with the collection request for the
 *                         products. Does not have to be included.
 *
 * @return {Object} This hook will return an object with three properties:
 *                  - products        An array of product objects.
 *                  - totalProducts   The total number of products that match
 *                                    the given query parameters.
 *                  - productsLoading A boolean indicating whether the products
 *                                    are still loading or not.
 */
export const useStoreProducts = ( query ) => {
	const collectionOptions = {
		namespace: '/wc/store',
		resourceName: 'products',
	};
	const { results: products, isLoading: productsLoading } = useCollection( {
		...collectionOptions,
		query,
	} );
	const { value: totalProducts } = useCollectionHeader( 'x-wp-total', {
		...collectionOptions,
		query,
	} );
	return {
		products,
		totalProducts: parseInt( totalProducts, 10 ),
		productsLoading,
	};
};
woocommerce-blocks/assets/js/base/context/hooks/index.js000064400000001103151335517650017450 0ustar00export * from './cart';
export * from './collections';
export * from './shipping';
export * from './payment-methods';
export * from './use-store-notices';
export * from './use-store-events';
export * from './use-query-state';
export * from './use-store-products';
export * from './use-store-add-to-cart';
export * from './use-customer-data';
export * from './use-checkout-address';
export * from './use-checkout-notices';
export * from './use-checkout-submit';
export * from './use-emit-response';
export * from './use-checkout-extension-data';
export * from './use-validation';
woocommerce-blocks/assets/js/base/context/hooks/test/use-query-state.js000064400000017561151335517650022414 0ustar00/**
 * External dependencies
 */
import TestRenderer, { act } from 'react-test-renderer';
import { createRegistry, RegistryProvider } from '@wordpress/data';
import { QUERY_STATE_STORE_KEY as storeKey } from '@woocommerce/block-data';

/**
 * Internal dependencies
 */
import {
	useQueryStateByContext,
	useQueryStateByKey,
	useSynchronizedQueryState,
} from '../use-query-state';

jest.mock( '@woocommerce/block-data', () => ( {
	__esModule: true,
	QUERY_STATE_STORE_KEY: 'test/store',
} ) );

describe( 'Testing Query State Hooks', () => {
	let registry, mocks;
	beforeAll( () => {
		registry = createRegistry();
		mocks = {};
	} );
	/**
	 * Test helper to return a tuple containing the expected query value and the
	 * expected query state action creator from the given rendered test instance.
	 *
	 * @param {Object} testRenderer   An instance of the created test component.
	 *
	 * @return {Array} A tuple containing the expected query value as the first
	 *                 element and the expected query action creator as the
	 *                 second argument.
	 */
	const getProps = ( testRenderer ) => {
		const props = testRenderer.root.findByType( 'div' ).props;
		return [ props.queryState, props.setQueryState ];
	};

	/**
	 * Returns the given component wrapped in the registry provider for
	 * instantiating using the TestRenderer using the current prepared registry
	 * for the TestRenderer to instantiate with.
	 *
	 * @param {*}      Component The test component to wrap.
	 * @param {Object} props     Props to feed the wrapped component.
	 *
	 * @return {*} Wrapped component.
	 */
	const getWrappedComponent = ( Component, props ) => (
		<RegistryProvider value={ registry }>
			<Component { ...props } />
		</RegistryProvider>
	);

	/**
	 * Returns a TestComponent for the provided hook to test with, and the
	 * expected PropKeys for obtaining the values to be fed to the hook as
	 * arguments.
	 *
	 * @param {Function} hookTested      The hook being tested to use in the
	 *                                   test comopnent.
	 * @param {Array}    propKeysForArgs An array of keys for the props that
	 *                                   will be used on the test component that
	 *                                   will have values fed to the tested
	 *                                   hook.
	 *
	 * @return {*}  A component ready for testing with!
	 */
	const getTestComponent = ( hookTested, propKeysForArgs ) => ( props ) => {
		const args = propKeysForArgs.map( ( key ) => props[ key ] );
		const [ queryValue, setQueryValue ] = hookTested( ...args );
		return (
			<div queryState={ queryValue } setQueryState={ setQueryValue } />
		);
	};

	/**
	 * A helper for setting up the `mocks` object and the `registry` mock before
	 * each test.
	 *
	 * @param {string} actionMockName   This should be the name of the action
	 *                                  that the hook returns. This will be
	 *                                  mocked using `mocks.action` when
	 *                                  registered in the mock registry.
	 * @param {string} selectorMockName This should be the mame of the selector
	 *                                  that the hook uses. This will be mocked
	 *                                  using `mocks.selector` when registered
	 *                                  in the mock registry.
	 */
	const setupMocks = ( actionMockName, selectorMockName ) => {
		mocks.action = jest.fn().mockReturnValue( { type: 'testAction' } );
		mocks.selector = jest.fn().mockReturnValue( { foo: 'bar' } );
		registry.registerStore( storeKey, {
			reducer: () => ( {} ),
			actions: {
				[ actionMockName ]: mocks.action,
			},
			selectors: {
				[ selectorMockName ]: mocks.selector,
			},
		} );
	};
	describe( 'useQueryStateByContext', () => {
		const TestComponent = getTestComponent( useQueryStateByContext, [
			'context',
		] );
		let renderer;
		beforeEach( () => {
			renderer = null;
			setupMocks( 'setValueForQueryContext', 'getValueForQueryContext' );
		} );
		afterEach( () => {
			act( () => {
				renderer.unmount();
			} );
		} );
		it(
			'calls useSelect with the provided context and returns expected' +
				' values',
			() => {
				const { action, selector } = mocks;
				act( () => {
					renderer = TestRenderer.create(
						getWrappedComponent( TestComponent, {
							context: 'test-context',
						} )
					);
				} );
				const [ queryState, setQueryState ] = getProps( renderer );
				// the {} is because all selectors are called internally in the
				// registry with the first argument being the state which is empty.
				expect( selector ).toHaveBeenLastCalledWith(
					{},
					'test-context',
					undefined
				);
				expect( queryState ).toEqual( { foo: 'bar' } );
				expect( action ).not.toHaveBeenCalled();

				//execute dispatcher and make sure it's called.
				act( () => {
					setQueryState( { foo: 'bar' } );
				} );
				expect( action ).toHaveBeenCalledWith( 'test-context', {
					foo: 'bar',
				} );
			}
		);
	} );
	describe( 'useQueryStateByKey', () => {
		const TestComponent = getTestComponent( useQueryStateByKey, [
			'queryKey',
			undefined,
			'context',
		] );
		let renderer;
		beforeEach( () => {
			renderer = null;
			setupMocks( 'setQueryValue', 'getValueForQueryKey' );
		} );
		afterEach( () => {
			act( () => {
				renderer.unmount();
			} );
		} );
		it(
			'calls useSelect with the provided context and returns expected' +
				' values',
			() => {
				const { selector, action } = mocks;
				act( () => {
					renderer = TestRenderer.create(
						getWrappedComponent( TestComponent, {
							context: 'test-context',
							queryKey: 'someValue',
						} )
					);
				} );
				const [ queryState, setQueryState ] = getProps( renderer );
				// the {} is because all selectors are called internally in the
				// registry with the first argument being the state which is empty.
				expect( selector ).toHaveBeenLastCalledWith(
					{},
					'test-context',
					'someValue',
					undefined
				);
				expect( queryState ).toEqual( { foo: 'bar' } );
				expect( action ).not.toHaveBeenCalled();

				//execute dispatcher and make sure it's called.
				act( () => {
					setQueryState( { foo: 'bar' } );
				} );
				expect( action ).toHaveBeenCalledWith(
					'test-context',
					'someValue',
					{ foo: 'bar' }
				);
			}
		);
	} );
	// Note: these tests only add partial coverage because the state is not
	// actually updated by the action dispatch via our mocks.
	describe( 'useSynchronizedQueryState', () => {
		const TestComponent = getTestComponent( useSynchronizedQueryState, [
			'synchronizedQuery',
			'context',
		] );
		const initialQuery = { a: 'b' };
		let renderer;
		beforeEach( () => {
			setupMocks( 'setValueForQueryContext', 'getValueForQueryContext' );
		} );
		it( 'returns provided query state on initial render', () => {
			const { action, selector } = mocks;
			act( () => {
				renderer = TestRenderer.create(
					getWrappedComponent( TestComponent, {
						context: 'test-context',
						synchronizedQuery: initialQuery,
					} )
				);
			} );
			const [ queryState ] = getProps( renderer );
			expect( queryState ).toBe( initialQuery );
			expect( selector ).toHaveBeenLastCalledWith(
				{},
				'test-context',
				undefined
			);
			expect( action ).toHaveBeenCalledWith( 'test-context', {
				foo: 'bar',
				a: 'b',
			} );
		} );
		it( 'returns merged queryState on subsequent render', () => {
			act( () => {
				renderer.update(
					getWrappedComponent( TestComponent, {
						context: 'test-context',
						synchronizedQuery: initialQuery,
					} )
				);
			} );
			// note our test doesn't interact with an actual reducer so the
			// store state is not updated. Here we're just verifying that
			// what is is returned by the state selector mock is returned.
			// However we DO expect this to be a new object.
			const [ queryState ] = getProps( renderer );
			expect( queryState ).not.toBe( initialQuery );
			expect( queryState ).toEqual( { foo: 'bar' } );
		} );
	} );
} );
woocommerce-blocks/assets/js/base/context/hooks/test/use-store-notices.js000064400000003171151335517650022717 0ustar00/**
 * External dependencies
 */
import { render, act } from '@testing-library/react';
import { StoreNoticesProvider } from '@woocommerce/base-context';

/**
 * Internal dependencies
 */
import { useStoreNotices } from '../use-store-notices';

describe( 'useStoreNotices', () => {
	function setup() {
		const returnVal = {};

		function TestComponent() {
			Object.assign( returnVal, useStoreNotices() );

			return null;
		}

		render(
			<StoreNoticesProvider>
				<TestComponent />
			</StoreNoticesProvider>
		);

		return returnVal;
	}

	test( 'allows adding and removing notices and checking if there are notices of a specific type', () => {
		const storeNoticesData = setup();

		// Assert initial state.
		expect( storeNoticesData.notices ).toEqual( [] );
		expect( storeNoticesData.hasNoticesOfType( 'default' ) ).toBe( false );

		// Add error notice.
		act( () => {
			storeNoticesData.addErrorNotice( 'Error notice' );
		} );

		expect( storeNoticesData.notices.length ).toBe( 1 );
		expect( storeNoticesData.hasNoticesOfType( 'default' ) ).toBe( true );

		expect( storeNoticesData.notices.length ).toBe( 1 );
		expect( storeNoticesData.hasNoticesOfType( 'default' ) ).toBe( true );

		// Remove error notice.
		act( () => {
			storeNoticesData.removeNotices( 'error' );
		} );

		expect( storeNoticesData.notices.length ).toBe( 0 );
		expect( storeNoticesData.hasNoticesOfType( 'default' ) ).toBe( false );

		// Remove all remaining notices.
		act( () => {
			storeNoticesData.removeNotices();
		} );

		expect( storeNoticesData.notices.length ).toBe( 0 );
		expect( storeNoticesData.hasNoticesOfType( 'default' ) ).toBe( false );
	} );
} );
woocommerce-blocks/assets/js/base/context/hooks/test/use-store-snackbar-notices.js000064400000002212151335517650024474 0ustar00/**
 * External dependencies
 */
import { render, act } from '@testing-library/react';
import { StoreSnackbarNoticesProvider } from '@woocommerce/base-context/providers';

/**
 * Internal dependencies
 */
import { useStoreSnackbarNotices } from '../use-store-snackbar-notices';

describe( 'useStoreNoticesWithSnackbar', () => {
	function setup() {
		const returnVal = {};

		function TestComponent() {
			Object.assign( returnVal, useStoreSnackbarNotices() );

			return null;
		}

		render(
			<StoreSnackbarNoticesProvider>
				<TestComponent />
			</StoreSnackbarNoticesProvider>
		);

		return returnVal;
	}

	test( 'allows adding and removing notices and checking if there are notices of a specific type', () => {
		const storeNoticesData = setup();

		// Assert initial state.
		expect( storeNoticesData.notices ).toEqual( [] );

		// Add snackbar notice.
		act( () => {
			storeNoticesData.addSnackbarNotice( 'Snackbar notice' );
		} );

		expect( storeNoticesData.notices.length ).toBe( 1 );

		// Remove all remaining notices.
		act( () => {
			storeNoticesData.removeNotices();
		} );

		expect( storeNoticesData.notices.length ).toBe( 0 );
	} );
} );
woocommerce-blocks/assets/js/base/context/hooks/test/use-store-products.js000064400000005557151335517650023130 0ustar00/**
 * External dependencies
 */
import TestRenderer, { act } from 'react-test-renderer';
import { createRegistry, RegistryProvider } from '@wordpress/data';
import { COLLECTIONS_STORE_KEY as storeKey } from '@woocommerce/block-data';

/**
 * Internal dependencies
 */
import { useStoreProducts } from '../use-store-products';

jest.mock( '@woocommerce/block-data', () => ( {
	__esModule: true,
	COLLECTIONS_STORE_KEY: 'test/store',
} ) );

describe( 'useStoreProducts', () => {
	let registry, mocks, renderer;
	const getProps = ( testRenderer ) => {
		const {
			products,
			totalProducts,
			productsLoading,
		} = testRenderer.root.findByType( 'div' ).props;
		return {
			products,
			totalProducts,
			productsLoading,
		};
	};

	const getWrappedComponents = ( Component, props ) => (
		<RegistryProvider value={ registry }>
			<Component { ...props } />
		</RegistryProvider>
	);

	const getTestComponent = () => ( { query } ) => {
		const items = useStoreProducts( query );
		return <div { ...items } />;
	};

	const setUpMocks = () => {
		mocks = {
			selectors: {
				getCollectionError: jest.fn().mockReturnValue( false ),
				getCollection: jest
					.fn()
					.mockImplementation( () => ( { foo: 'bar' } ) ),
				getCollectionHeader: jest.fn().mockReturnValue( 22 ),
				hasFinishedResolution: jest.fn().mockReturnValue( true ),
			},
		};
		registry.registerStore( storeKey, {
			reducer: () => ( {} ),
			selectors: mocks.selectors,
		} );
	};

	beforeEach( () => {
		registry = createRegistry();
		mocks = {};
		renderer = null;
		setUpMocks();
	} );
	it(
		'should return expected behaviour for equivalent query on props ' +
			'across renders',
		() => {
			const TestComponent = getTestComponent();
			act( () => {
				renderer = TestRenderer.create(
					getWrappedComponents( TestComponent, {
						query: { bar: 'foo' },
					} )
				);
			} );
			const { products } = getProps( renderer );
			// rerender
			act( () => {
				renderer.update(
					getWrappedComponents( TestComponent, {
						query: { bar: 'foo' },
					} )
				);
			} );
			// re-render should result in same products object because although
			// query-state is a different instance, it's still equivalent.
			const { products: newProducts } = getProps( renderer );
			expect( newProducts ).toBe( products );
			// now let's change the query passed through to verify new object
			// is created.
			// remember this won't actually change the results because the mock
			// selector is returning an equivalent object when it is called,
			// however it SHOULD be a new object instance.
			act( () => {
				renderer.update(
					getWrappedComponents( TestComponent, {
						query: { foo: 'bar' },
					} )
				);
			} );
			const { products: productsVerification } = getProps( renderer );
			expect( productsVerification ).not.toBe( products );
			expect( productsVerification ).toEqual( products );
			renderer.unmount();
		}
	);
} );
woocommerce-blocks/assets/js/base/context/hooks/test/use-checkout-submit.js000064400000002717151335517650023234 0ustar00/**
 * External dependencies
 */
import TestRenderer, { act } from 'react-test-renderer';
import { createRegistry, RegistryProvider } from '@wordpress/data';

/**
 * Internal dependencies
 */
import { useCheckoutSubmit } from '../use-checkout-submit';

const mockUseCheckoutContext = {
	onSubmit: jest.fn(),
};
const mockUsePaymentMethodDataContext = {
	activePaymentMethod: '',
	currentStatus: {
		isDoingExpressPayment: false,
	},
};

jest.mock( '../../providers/cart-checkout/checkout-state', () => ( {
	useCheckoutContext: () => mockUseCheckoutContext,
} ) );

jest.mock( '../../providers/cart-checkout/payment-methods', () => ( {
	usePaymentMethodDataContext: () => mockUsePaymentMethodDataContext,
} ) );

describe( 'useCheckoutSubmit', () => {
	let registry, renderer;

	const getWrappedComponents = ( Component ) => (
		<RegistryProvider value={ registry }>
			<Component />
		</RegistryProvider>
	);

	const getTestComponent = () => () => {
		const data = useCheckoutSubmit();
		return <div { ...data } />;
	};

	beforeEach( () => {
		registry = createRegistry();
		renderer = null;
	} );

	it( 'onSubmit calls the correct action in the checkout context', () => {
		const TestComponent = getTestComponent();

		act( () => {
			renderer = TestRenderer.create(
				getWrappedComponents( TestComponent )
			);
		} );

		const { onSubmit } = renderer.root.findByType( 'div' ).props;

		onSubmit();

		expect( mockUseCheckoutContext.onSubmit ).toHaveBeenCalledTimes( 1 );
	} );
} );
woocommerce-blocks/assets/js/base/context/hooks/use-store-notices.ts000064400000005455151335517650021761 0ustar00/**
 * External dependencies
 */
import { useMemo, useRef, useEffect } from '@wordpress/element';

/**
 * Internal dependencies
 */
import { useStoreNoticesContext } from '../providers/store-notices/context';

type WPNoticeAction = {
	label: string;
	url?: string;
	onClick?: () => void;
};

type WPNotice = {
	id: string;
	status: 'success' | 'info' | 'error' | 'warning';
	content: string;
	spokenMessage: string;
	// eslint-disable-next-line @typescript-eslint/naming-convention
	__unstableHTML: string;
	isDismissible: boolean;
	type: 'default' | 'snackbar';
	speak: boolean;
	actions: WPNoticeAction[];
};

type NoticeOptions = {
	id: string;
	type?: string;
	isDismissible: boolean;
};

type NoticeCreator = ( text: string, noticeProps: NoticeOptions ) => void;

export const useStoreNotices = (): {
	notices: WPNotice[];
	hasNoticesOfType: ( type: string ) => boolean;
	removeNotices: ( status: string | null ) => void;
	removeNotice: ( id: string, context: string ) => void;
	addDefaultNotice: NoticeCreator;
	addErrorNotice: NoticeCreator;
	addWarningNotice: NoticeCreator;
	addInfoNotice: NoticeCreator;
	addSuccessNotice: NoticeCreator;
	setIsSuppressed: ( isSuppressed: boolean ) => void;
} => {
	const {
		notices,
		createNotice,
		removeNotice,
		setIsSuppressed,
	} = useStoreNoticesContext();
	// Added to a ref so the surface for notices doesn't change frequently
	// and thus can be used as dependencies on effects.
	const currentNotices = useRef( notices );

	// Update notices ref whenever they change
	useEffect( () => {
		currentNotices.current = notices;
	}, [ notices ] );

	const noticesApi = useMemo(
		() => ( {
			hasNoticesOfType: ( type: 'default' | 'snackbar' ): boolean => {
				return currentNotices.current.some(
					( notice ) => notice.type === type
				);
			},
			removeNotices: ( status = null ) => {
				currentNotices.current.forEach( ( notice ) => {
					if ( status === null || notice.status === status ) {
						removeNotice( notice.id );
					}
				} );
			},
			removeNotice,
		} ),
		[ removeNotice ]
	);

	const noticeCreators = useMemo(
		() => ( {
			addDefaultNotice: ( text: string, noticeProps = {} ) =>
				void createNotice( 'default', text, {
					...noticeProps,
				} ),
			addErrorNotice: ( text: string, noticeProps = {} ) =>
				void createNotice( 'error', text, {
					...noticeProps,
				} ),
			addWarningNotice: ( text: string, noticeProps = {} ) =>
				void createNotice( 'warning', text, {
					...noticeProps,
				} ),
			addInfoNotice: ( text: string, noticeProps = {} ) =>
				void createNotice( 'info', text, {
					...noticeProps,
				} ),
			addSuccessNotice: ( text: string, noticeProps = {} ) =>
				void createNotice( 'success', text, {
					...noticeProps,
				} ),
		} ),
		[ createNotice ]
	);

	return {
		notices,
		...noticesApi,
		...noticeCreators,
		setIsSuppressed,
	};
};
woocommerce-blocks/assets/js/base/context/hooks/use-checkout-notices.js000064400000002352151335517650022411 0ustar00/**
 * External dependencies
 */
import { useSelect } from '@wordpress/data';

/**
 * Internal dependencies
 */
import { useEmitResponse } from './use-emit-response';

/**
 * @typedef {import('@woocommerce/type-defs/contexts').StoreNoticeObject} StoreNoticeObject
 * @typedef {import('@woocommerce/type-defs/hooks').CheckoutNotices} CheckoutNotices
 */

/**
 * A hook that returns all notices visible in the Checkout block.
 *
 * @return {CheckoutNotices} Notices from the checkout form or payment methods.
 */
export const useCheckoutNotices = () => {
	const { noticeContexts } = useEmitResponse();

	/**
	 * @type {StoreNoticeObject[]}
	 */
	const checkoutNotices = useSelect(
		( select ) => select( 'core/notices' ).getNotices( 'wc/checkout' ),
		[]
	);

	/**
	 * @type {StoreNoticeObject[]}
	 */
	const expressPaymentNotices = useSelect(
		( select ) =>
			select( 'core/notices' ).getNotices(
				noticeContexts.EXPRESS_PAYMENTS
			),
		[ noticeContexts.EXPRESS_PAYMENTS ]
	);

	/**
	 * @type {StoreNoticeObject[]}
	 */
	const paymentNotices = useSelect(
		( select ) =>
			select( 'core/notices' ).getNotices( noticeContexts.PAYMENTS ),
		[ noticeContexts.PAYMENTS ]
	);

	return {
		checkoutNotices,
		expressPaymentNotices,
		paymentNotices,
	};
};
woocommerce-blocks/assets/js/base/context/hooks/shipping/use-select-shipping-rates.ts000064400000003241151335517650025205 0ustar00/**
 * External dependencies
 */
import { useDispatch, useSelect } from '@wordpress/data';
import { useCallback } from '@wordpress/element';
import { CART_STORE_KEY as storeKey } from '@woocommerce/block-data';
import { useThrowError } from '@woocommerce/base-hooks';

/**
 * This is a custom hook for selecting shipping rates
 *
 * @return {Object} This hook will return an object with these properties:
 * 		- selectShippingRate: A function that immediately returns the selected rate and dispatches an action generator.
 *		- isSelectingRate: True when rates are being resolved to the API.
 */
export const useSelectShippingRates = (): {
	selectShippingRate: (
		newShippingRateId: string,
		packageId: string | number
	) => unknown;
	isSelectingRate: boolean;
} => {
	const throwError = useThrowError();
	const { selectShippingRate } = ( useDispatch( storeKey ) as {
		selectShippingRate: unknown;
	} ) as {
		selectShippingRate: (
			newShippingRateId: string,
			packageId: string | number
		) => Promise< unknown >;
	};

	// Sets a rate for a package in state (so changes are shown right away to consumers of the hook) and in the stores.
	const setRate = useCallback(
		( newShippingRateId, packageId ) => {
			selectShippingRate( newShippingRateId, packageId ).catch(
				( error ) => {
					// we throw this error because an error on selecting a rate is problematic.
					throwError( error );
				}
			);
		},
		[ throwError, selectShippingRate ]
	);

	// See if rates are being selected.
	const isSelectingRate = useSelect< boolean >( ( select ) => {
		return select( storeKey ).isShippingRateBeingSelected();
	}, [] );

	return {
		selectShippingRate: setRate,
		isSelectingRate,
	};
};
woocommerce-blocks/assets/js/base/context/hooks/shipping/use-select-shipping-rate.ts000064400000006154151335517650025030 0ustar00/**
 * External dependencies
 */
import { useState, useEffect, useRef, useCallback } from '@wordpress/element';
import isShallowEqual from '@wordpress/is-shallow-equal';
import { CartShippingPackageShippingRate } from '@woocommerce/type-defs/cart';

/**
 * Internal dependencies
 */
import { useSelectShippingRates } from './use-select-shipping-rates';
import { useStoreEvents } from '../use-store-events';

/**
 * Selected rates are derived by looping over the shipping rates.
 *
 * @param {Array} shippingRates Array of shipping rates.
 * @return {string} Selected rate id.
 */
// This will find the selected rate ID in an array of shipping rates.
const deriveSelectedRateId = (
	shippingRates: CartShippingPackageShippingRate[]
) => shippingRates.find( ( rate ) => rate.selected )?.rate_id;

/**
 * This is a custom hook for tracking selected shipping rates for a package and selecting a rate. State is used so
 * changes are reflected in the UI instantly.
 *
 * @param {string} packageId Package ID to select rates for.
 * @param {Array} shippingRates an array of packages with shipping rates.
 * @return {Object} This hook will return an object with these properties:
 * 		- selectShippingRate: A function that immediately returns the selected rate and dispatches an action generator.
 * 		- selectedShippingRate: The selected rate id.
 *		- isSelectingRate: True when rates are being resolved to the API.
 */
export const useSelectShippingRate = (
	packageId: string | number,
	shippingRates: CartShippingPackageShippingRate[]
): {
	selectShippingRate: ( newShippingRateId: string ) => unknown;
	selectedShippingRate: string | undefined;
	isSelectingRate: boolean;
} => {
	const { dispatchCheckoutEvent } = useStoreEvents();

	// Rates are selected via the shipping data context provider.
	const { selectShippingRate, isSelectingRate } = useSelectShippingRates();

	// Selected rates are stored in state. This allows shipping rates changes to be shown in the UI instantly.
	// Defaults to the currently selected rate_id.
	const [ selectedShippingRate, setSelectedShippingRate ] = useState( () =>
		deriveSelectedRateId( shippingRates )
	);

	// This ref is used to track when changes come in via the props. When the incoming shipping rates change, update our local state if there are changes to selected methods.
	const currentShippingRates = useRef( shippingRates );
	useEffect( () => {
		if ( ! isShallowEqual( currentShippingRates.current, shippingRates ) ) {
			currentShippingRates.current = shippingRates;
			setSelectedShippingRate( deriveSelectedRateId( shippingRates ) );
		}
	}, [ shippingRates ] );

	// Sets a rate for a package in state (so changes are shown right away to consumers of the hook) and in the stores.
	const setPackageRateId = useCallback(
		( newShippingRateId ) => {
			setSelectedShippingRate( newShippingRateId );
			selectShippingRate( newShippingRateId, packageId );
			dispatchCheckoutEvent( 'set-selected-shipping-rate', {
				shippingRateId: newShippingRateId,
			} );
		},
		[ packageId, selectShippingRate, dispatchCheckoutEvent ]
	);

	return {
		selectShippingRate: setPackageRateId,
		selectedShippingRate,
		isSelectingRate,
	};
};
woocommerce-blocks/assets/js/base/context/hooks/shipping/index.js000064400000000131151335517650021271 0ustar00export * from './use-select-shipping-rate';
export * from './use-select-shipping-rates';
woocommerce-blocks/assets/js/base/context/hooks/use-store-add-to-cart.ts000064400000005322151335517650022405 0ustar00/**
 * External dependencies
 */
import { useState, useEffect, useRef } from '@wordpress/element';
import { useDispatch } from '@wordpress/data';
import { CART_STORE_KEY as storeKey } from '@woocommerce/block-data';
import { decodeEntities } from '@wordpress/html-entities';
import type { CartItem } from '@woocommerce/types';

/**
 * Internal dependencies
 */
import { useStoreCart } from './cart/use-store-cart';
import { useStoreNotices } from './use-store-notices';

/**
 * @typedef {import('@woocommerce/type-defs/hooks').StoreCartItemAddToCart} StoreCartItemAddToCart
 */

interface StoreAddToCart {
	cartQuantity: number;
	addingToCart: boolean;
	cartIsLoading: boolean;
	addToCart: ( quantity?: number ) => Promise< boolean >;
}
/**
 * Get the quantity of a product in the cart.
 *
 * @param {Object} cartItems Array of items.
 * @param {number} productId  The product id to look for.
 * @return {number} Quantity in the cart.
 */
const getQuantityFromCartItems = (
	cartItems: Array< CartItem >,
	productId: number
): number => {
	const productItem = cartItems.find( ( { id } ) => id === productId );

	return productItem ? productItem.quantity : 0;
};

/**
 * A custom hook for exposing cart related data for a given product id and an
 * action for adding a single quantity of the product _to_ the cart.
 *
 *
 * @param {number} productId  The product id to be added to the cart.
 *
 * @return {StoreCartItemAddToCart} An object exposing data and actions relating
 *                                  to add to cart functionality.
 */
export const useStoreAddToCart = ( productId: number ): StoreAddToCart => {
	const { addItemToCart } = useDispatch( storeKey );
	const { cartItems, cartIsLoading } = useStoreCart();
	const { addErrorNotice, removeNotice } = useStoreNotices();

	const [ addingToCart, setAddingToCart ] = useState( false );
	const currentCartItemQuantity = useRef(
		getQuantityFromCartItems( cartItems, productId )
	);

	const addToCart = ( quantity = 1 ) => {
		setAddingToCart( true );
		return addItemToCart( productId, quantity )
			.then( () => {
				removeNotice( 'add-to-cart' );
			} )
			.catch( ( error ) => {
				addErrorNotice( decodeEntities( error.message ), {
					context: 'wc/all-products',
					id: 'add-to-cart',
					isDismissible: true,
				} );
			} )
			.finally( () => {
				setAddingToCart( false );
			} );
	};

	useEffect( () => {
		const quantity = getQuantityFromCartItems( cartItems, productId );

		if ( quantity !== currentCartItemQuantity.current ) {
			currentCartItemQuantity.current = quantity;
		}
	}, [ cartItems, productId ] );

	return {
		cartQuantity: Number.isFinite( currentCartItemQuantity.current )
			? currentCartItemQuantity.current
			: 0,
		addingToCart,
		cartIsLoading,
		addToCart,
	};
};
woocommerce-blocks/assets/js/base/context/hooks/use-store-events.ts000064400000003363151335517650021615 0ustar00/**
 * External dependencies
 */
import { doAction } from '@wordpress/hooks';
import { useCallback, useRef, useEffect } from '@wordpress/element';

/**
 * Internal dependencies
 */
import { useStoreCart } from './cart/use-store-cart';

type StoreEvent = (
	eventName: string,
	eventParams?: Partial< Record< string, unknown > >
) => void;

/**
 * Abstraction on top of @wordpress/hooks for dispatching events via doAction for 3rd parties to hook into.
 */
export const useStoreEvents = (): {
	dispatchStoreEvent: StoreEvent;
	dispatchCheckoutEvent: StoreEvent;
} => {
	const storeCart = useStoreCart();
	const currentStoreCart = useRef( storeCart );

	// Track the latest version of the cart so we can use the current value in our callback function below without triggering
	// other useEffect hooks using dispatchCheckoutEvent as a dependency.
	useEffect( () => {
		currentStoreCart.current = storeCart;
	}, [ storeCart ] );

	const dispatchStoreEvent = useCallback( ( eventName, eventParams = {} ) => {
		try {
			doAction(
				`experimental__woocommerce_blocks-${ eventName }`,
				eventParams
			);
		} catch ( e ) {
			// We don't handle thrown errors but just console.log for troubleshooting.
			// eslint-disable-next-line no-console
			console.error( e );
		}
	}, [] );

	const dispatchCheckoutEvent = useCallback(
		( eventName, eventParams = {} ) => {
			try {
				doAction(
					`experimental__woocommerce_blocks-checkout-${ eventName }`,
					{
						...eventParams,
						storeCart: currentStoreCart.current,
					}
				);
			} catch ( e ) {
				// We don't handle thrown errors but just console.log for troubleshooting.
				// eslint-disable-next-line no-console
				console.error( e );
			}
		},
		[]
	);

	return { dispatchStoreEvent, dispatchCheckoutEvent };
};
woocommerce-blocks/assets/js/base/context/hooks/use-store-snackbar-notices.js000064400000002332151335517650023520 0ustar00/**
 * External dependencies
 */
import { useMemo, useRef, useEffect } from '@wordpress/element';
import { useStoreSnackbarNoticesContext } from '@woocommerce/base-context/providers';

export const useStoreSnackbarNotices = () => {
	const {
		notices,
		createSnackbarNotice,
		removeSnackbarNotice,
		setIsSuppressed,
	} = useStoreSnackbarNoticesContext();
	// Added to a ref so the surface for notices doesn't change frequently
	// and thus can be used as dependencies on effects.
	const currentNotices = useRef( notices );

	// Update notices ref whenever they change
	useEffect( () => {
		currentNotices.current = notices;
	}, [ notices ] );

	const noticesApi = useMemo(
		() => ( {
			removeNotices: ( status = null ) => {
				currentNotices.current.forEach( ( notice ) => {
					if ( status === null || notice.status === status ) {
						removeSnackbarNotice( notice.id );
					}
				} );
			},
			removeSnackbarNotice,
		} ),
		[ removeSnackbarNotice ]
	);

	const noticeCreators = useMemo(
		() => ( {
			addSnackbarNotice: ( text, noticeProps = {} ) => {
				createSnackbarNotice( text, noticeProps );
			},
		} ),
		[ createSnackbarNotice ]
	);

	return {
		notices,
		...noticesApi,
		...noticeCreators,
		setIsSuppressed,
	};
};
woocommerce-blocks/assets/js/base/context/hooks/use-emit-response.ts000064400000002576151335517650021756 0ustar00/**
 * External dependencies
 */
import { isObject } from '@woocommerce/types';

export enum responseTypes {
	SUCCESS = 'success',
	FAIL = 'failure',
	ERROR = 'error',
}

export enum noticeContexts {
	PAYMENTS = 'wc/payment-area',
	EXPRESS_PAYMENTS = 'wc/express-payment-area',
}

export interface ResponseType extends Record< string, unknown > {
	type: responseTypes;
	retry?: boolean;
}

const isResponseOf = (
	response: unknown,
	type: string
): response is ResponseType => {
	return isObject( response ) && 'type' in response && response.type === type;
};

export const isSuccessResponse = (
	response: unknown
): response is ResponseType => {
	return isResponseOf( response, responseTypes.SUCCESS );
};

export const isErrorResponse = (
	response: unknown
): response is ResponseType => {
	return isResponseOf( response, responseTypes.ERROR );
};

export const isFailResponse = (
	response: unknown
): response is ResponseType => {
	return isResponseOf( response, responseTypes.FAIL );
};

export const shouldRetry = ( response: unknown ): boolean => {
	return (
		! isObject( response ) ||
		typeof response.retry === 'undefined' ||
		response.retry === true
	);
};

/**
 * A custom hook exposing response utilities for emitters.
 */
export const useEmitResponse = () =>
	( {
		responseTypes,
		noticeContexts,
		shouldRetry,
		isSuccessResponse,
		isErrorResponse,
		isFailResponse,
	} as const );
woocommerce-blocks/assets/js/base/context/hooks/collections/test/use-collection.js000064400000017500151335517650024573 0ustar00/**
 * External dependencies
 */
import TestRenderer, { act } from 'react-test-renderer';
import { createRegistry, RegistryProvider } from '@wordpress/data';
import { Component as ReactComponent } from '@wordpress/element';
import { COLLECTIONS_STORE_KEY as storeKey } from '@woocommerce/block-data';

/**
 * Internal dependencies
 */
import { useCollection } from '../use-collection';

jest.mock( '@woocommerce/block-data', () => ( {
	__esModule: true,
	COLLECTIONS_STORE_KEY: 'test/store',
} ) );

class TestErrorBoundary extends ReactComponent {
	constructor( props ) {
		super( props );
		this.state = { hasError: false, error: {} };
	}
	static getDerivedStateFromError( error ) {
		// Update state so the next render will show the fallback UI.
		return { hasError: true, error };
	}

	render() {
		if ( this.state.hasError ) {
			return <div error={ this.state.error } />;
		}

		return this.props.children;
	}
}

describe( 'useCollection', () => {
	let registry, mocks, renderer;
	const getProps = ( testRenderer ) => {
		const { results, isLoading } = testRenderer.root.findByType(
			'div'
		).props;
		return {
			results,
			isLoading,
		};
	};

	const getWrappedComponents = ( Component, props ) => (
		<RegistryProvider value={ registry }>
			<TestErrorBoundary>
				<Component { ...props } />
			</TestErrorBoundary>
		</RegistryProvider>
	);

	const getTestComponent = () => ( { options } ) => {
		const items = useCollection( options );
		return <div { ...items } />;
	};

	const setUpMocks = () => {
		mocks = {
			selectors: {
				getCollectionError: jest.fn().mockReturnValue( false ),
				getCollection: jest
					.fn()
					.mockImplementation( () => ( { foo: 'bar' } ) ),
				hasFinishedResolution: jest.fn().mockReturnValue( true ),
			},
		};
		registry.registerStore( storeKey, {
			reducer: () => ( {} ),
			selectors: mocks.selectors,
		} );
	};

	beforeEach( () => {
		registry = createRegistry();
		mocks = {};
		renderer = null;
		setUpMocks();
	} );
	it(
		'should throw an error if an options object is provided without ' +
			'a namespace property',
		() => {
			const TestComponent = getTestComponent();
			act( () => {
				renderer = TestRenderer.create(
					getWrappedComponents( TestComponent, {
						options: {
							resourceName: 'products',
							query: { bar: 'foo' },
						},
					} )
				);
			} );
			const props = renderer.root.findByType( 'div' ).props;
			expect( props.error.message ).toMatch( /options object/ );
			expect( console ).toHaveErrored( /your React components:/ );
			renderer.unmount();
		}
	);
	it(
		'should throw an error if an options object is provided without ' +
			'a resourceName property',
		() => {
			const TestComponent = getTestComponent();
			act( () => {
				renderer = TestRenderer.create(
					getWrappedComponents( TestComponent, {
						options: {
							namespace: 'test/store',
							query: { bar: 'foo' },
						},
					} )
				);
			} );
			const props = renderer.root.findByType( 'div' ).props;
			expect( props.error.message ).toMatch( /options object/ );
			expect( console ).toHaveErrored( /your React components:/ );
			renderer.unmount();
		}
	);
	it(
		'should return expected behaviour for equivalent query on props ' +
			'across renders',
		() => {
			const TestComponent = getTestComponent();
			act( () => {
				renderer = TestRenderer.create(
					getWrappedComponents( TestComponent, {
						options: {
							namespace: 'test/store',
							resourceName: 'products',
							query: { bar: 'foo' },
						},
					} )
				);
			} );
			const { results } = getProps( renderer );
			// rerender
			act( () => {
				renderer.update(
					getWrappedComponents( TestComponent, {
						options: {
							namespace: 'test/store',
							resourceName: 'products',
							query: { bar: 'foo' },
						},
					} )
				);
			} );
			// re-render should result in same products object because although
			// query-state is a different instance, it's still equivalent.
			const { results: newResults } = getProps( renderer );
			expect( newResults ).toBe( results );
			// now let's change the query passed through to verify new object
			// is created.
			// remember this won't actually change the results because the mock
			// selector is returning an equivalent object when it is called,
			// however it SHOULD be a new object instance.
			act( () => {
				renderer.update(
					getWrappedComponents( TestComponent, {
						options: {
							namespace: 'test/store',
							resourceName: 'products',
							query: { foo: 'bar' },
						},
					} )
				);
			} );
			const { results: resultsVerification } = getProps( renderer );
			expect( resultsVerification ).not.toBe( results );
			expect( resultsVerification ).toEqual( results );
			renderer.unmount();
		}
	);
	it(
		'should return expected behaviour for equivalent resourceValues on' +
			' props across renders',
		() => {
			const TestComponent = getTestComponent();
			act( () => {
				renderer = TestRenderer.create(
					getWrappedComponents( TestComponent, {
						options: {
							namespace: 'test/store',
							resourceName: 'products',
							resourceValues: [ 10, 20 ],
						},
					} )
				);
			} );
			const { results } = getProps( renderer );
			// rerender
			act( () => {
				renderer.update(
					getWrappedComponents( TestComponent, {
						options: {
							namespace: 'test/store',
							resourceName: 'products',
							resourceValues: [ 10, 20 ],
						},
					} )
				);
			} );
			// re-render should result in same products object because although
			// query-state is a different instance, it's still equivalent.
			const { results: newResults } = getProps( renderer );
			expect( newResults ).toBe( results );
			// now let's change the query passed through to verify new object
			// is created.
			// remember this won't actually change the results because the mock
			// selector is returning an equivalent object when it is called,
			// however it SHOULD be a new object instance.
			act( () => {
				renderer.update(
					getWrappedComponents( TestComponent, {
						options: {
							namespace: 'test/store',
							resourceName: 'products',
							resourceValues: [ 20, 10 ],
						},
					} )
				);
			} );
			const { results: resultsVerification } = getProps( renderer );
			expect( resultsVerification ).not.toBe( results );
			expect( resultsVerification ).toEqual( results );
			renderer.unmount();
		}
	);
	it( 'should return previous query results if `shouldSelect` is false', () => {
		mocks.selectors.getCollection.mockImplementation(
			( state, ...args ) => {
				return args;
			}
		);
		const TestComponent = getTestComponent();
		act( () => {
			renderer = TestRenderer.create(
				getWrappedComponents( TestComponent, {
					options: {
						namespace: 'test/store',
						resourceName: 'products',
						resourceValues: [ 10, 20 ],
					},
				} )
			);
		} );
		const { results } = getProps( renderer );
		// rerender but with shouldSelect to false
		act( () => {
			renderer.update(
				getWrappedComponents( TestComponent, {
					options: {
						namespace: 'test/store',
						resourceName: 'productsb',
						resourceValues: [ 10, 30 ],
						shouldSelect: false,
					},
				} )
			);
		} );
		const { results: results2 } = getProps( renderer );
		expect( results2 ).toBe( results );
		// expect 2 calls because internally, useSelect invokes callback twice
		// on mount.
		expect( mocks.selectors.getCollection ).toHaveBeenCalledTimes( 2 );

		// rerender again but set shouldSelect to true again and we should see
		// new results
		act( () => {
			renderer.update(
				getWrappedComponents( TestComponent, {
					options: {
						namespace: 'test/store',
						resourceName: 'productsb',
						resourceValues: [ 10, 30 ],
						shouldSelect: true,
					},
				} )
			);
		} );
		const { results: results3 } = getProps( renderer );
		expect( results3 ).not.toEqual( results );
		expect( results3 ).toEqual( [
			'test/store',
			'productsb',
			{},
			[ 10, 30 ],
		] );
	} );
} );
woocommerce-blocks/assets/js/base/context/hooks/collections/use-collection.js000064400000007112151335517650023612 0ustar00/**
 * External dependencies
 */
import { COLLECTIONS_STORE_KEY as storeKey } from '@woocommerce/block-data';
import { useSelect } from '@wordpress/data';
import { useRef } from '@wordpress/element';
import { useShallowEqual, useThrowError } from '@woocommerce/base-hooks';

/**
 * This is a custom hook that is wired up to the `wc/store/collections` data
 * store. Given a collections option object, this will ensure a component is
 * kept up to date with the collection matching that query in the store state.
 *
 * @throws {Object} Throws an exception object if there was a problem with the
 * 					API request, to be picked up by BlockErrorBoundry.
 *
 * @param {Object} options                  An object declaring the various
 *                                          collection arguments.
 * @param {string} options.namespace        The namespace for the collection.
 *                                          Example: `'/wc/blocks'`
 * @param {string} options.resourceName     The name of the resource for the
 *                                          collection. Example:
 *                                          `'products/attributes'`
 * @param {Array}  [options.resourceValues] An array of values (in correct order)
 *                                          that are substituted in the route
 *                                          placeholders for the collection route.
 *                                          Example: `[10, 20]`
 * @param {Object} [options.query]          An object of key value pairs for the
 *                                          query to execute on the collection
 *                                          Example:
 *                                         `{ order: 'ASC', order_by: 'price' }`
 * @param {boolean} [options.shouldSelect]  If false, the previous results will be
 *                                          returned and internal selects will not
 *                                          fire.
 *
 * @return {Object} This hook will return an object with two properties:
 *                  - results   An array of collection items returned.
 *                  - isLoading A boolean indicating whether the collection is
 *                              loading (true) or not.
 */
export const useCollection = ( options ) => {
	const {
		namespace,
		resourceName,
		resourceValues = [],
		query = {},
		shouldSelect = true,
	} = options;
	if ( ! namespace || ! resourceName ) {
		throw new Error(
			'The options object must have valid values for the namespace and ' +
				'the resource properties.'
		);
	}
	const currentResults = useRef( { results: [], isLoading: true } );
	// ensure we feed the previous reference if it's equivalent
	const currentQuery = useShallowEqual( query );
	const currentResourceValues = useShallowEqual( resourceValues );
	const throwError = useThrowError();
	const results = useSelect(
		( select ) => {
			if ( ! shouldSelect ) {
				return null;
			}
			const store = select( storeKey );
			const args = [
				namespace,
				resourceName,
				currentQuery,
				currentResourceValues,
			];
			const error = store.getCollectionError( ...args );

			if ( error ) {
				throwError( error );
			}

			return {
				results: store.getCollection( ...args ),
				isLoading: ! store.hasFinishedResolution(
					'getCollection',
					args
				),
			};
		},
		[
			namespace,
			resourceName,
			currentResourceValues,
			currentQuery,
			shouldSelect,
		]
	);
	// if selector was not bailed, then update current results. Otherwise return
	// previous results
	if ( results !== null ) {
		currentResults.current = results;
	}
	return currentResults.current;
};
woocommerce-blocks/assets/js/base/context/hooks/collections/use-collection-data.js000064400000007164151335517650024530 0ustar00/**
 * External dependencies
 */
import { useState, useEffect, useMemo } from '@wordpress/element';
import { useDebounce } from 'use-debounce';
import { sortBy } from 'lodash';
import { useShallowEqual } from '@woocommerce/base-hooks';

/**
 * Internal dependencies
 */
import { useQueryStateByContext, useQueryStateByKey } from '../use-query-state';
import { useCollection } from './use-collection';
import { useQueryStateContext } from '../../providers/query-state-context';

const buildCollectionDataQuery = ( collectionDataQueryState ) => {
	const query = collectionDataQueryState;

	if ( collectionDataQueryState.calculate_attribute_counts ) {
		query.calculate_attribute_counts = sortBy(
			collectionDataQueryState.calculate_attribute_counts.map(
				( { taxonomy, queryType } ) => {
					return {
						taxonomy,
						query_type: queryType,
					};
				}
			),
			[ 'taxonomy', 'query_type' ]
		);
	}

	return query;
};

export const useCollectionData = ( {
	queryAttribute,
	queryPrices,
	queryStock,
	queryState,
} ) => {
	let context = useQueryStateContext();
	context = `${ context }-collection-data`;

	const [ collectionDataQueryState ] = useQueryStateByContext( context );
	const [
		calculateAttributesQueryState,
		setCalculateAttributesQueryState,
	] = useQueryStateByKey( 'calculate_attribute_counts', [], context );
	const [
		calculatePriceRangeQueryState,
		setCalculatePriceRangeQueryState,
	] = useQueryStateByKey( 'calculate_price_range', null, context );
	const [
		calculateStockStatusQueryState,
		setCalculateStockStatusQueryState,
	] = useQueryStateByKey( 'calculate_stock_status_counts', null, context );

	const currentQueryAttribute = useShallowEqual( queryAttribute || {} );
	const currentQueryPrices = useShallowEqual( queryPrices );
	const currentQueryStock = useShallowEqual( queryStock );

	useEffect( () => {
		if (
			typeof currentQueryAttribute === 'object' &&
			Object.keys( currentQueryAttribute ).length
		) {
			const foundAttribute = calculateAttributesQueryState.find(
				( attribute ) => {
					return (
						attribute.taxonomy === currentQueryAttribute.taxonomy
					);
				}
			);

			if ( ! foundAttribute ) {
				setCalculateAttributesQueryState( [
					...calculateAttributesQueryState,
					currentQueryAttribute,
				] );
			}
		}
	}, [
		currentQueryAttribute,
		calculateAttributesQueryState,
		setCalculateAttributesQueryState,
	] );

	useEffect( () => {
		if (
			calculatePriceRangeQueryState !== currentQueryPrices &&
			currentQueryPrices !== undefined
		) {
			setCalculatePriceRangeQueryState( currentQueryPrices );
		}
	}, [
		currentQueryPrices,
		setCalculatePriceRangeQueryState,
		calculatePriceRangeQueryState,
	] );

	useEffect( () => {
		if (
			calculateStockStatusQueryState !== currentQueryStock &&
			currentQueryStock !== undefined
		) {
			setCalculateStockStatusQueryState( currentQueryStock );
		}
	}, [
		currentQueryStock,
		setCalculateStockStatusQueryState,
		calculateStockStatusQueryState,
	] );

	// Defer the select query so all collection-data query vars can be gathered.
	const [ shouldSelect, setShouldSelect ] = useState( false );
	const [ debouncedShouldSelect ] = useDebounce( shouldSelect, 200 );

	if ( ! shouldSelect ) {
		setShouldSelect( true );
	}

	const collectionDataQueryVars = useMemo( () => {
		return buildCollectionDataQuery( collectionDataQueryState );
	}, [ collectionDataQueryState ] );

	return useCollection( {
		namespace: '/wc/store',
		resourceName: 'products/collection-data',
		query: {
			...queryState,
			page: undefined,
			per_page: undefined,
			orderby: undefined,
			order: undefined,
			...collectionDataQueryVars,
		},
		shouldSelect: debouncedShouldSelect,
	} );
};
woocommerce-blocks/assets/js/base/context/hooks/collections/use-collection-header.js000064400000006165151335517650025047 0ustar00/**
 * External dependencies
 */
import { COLLECTIONS_STORE_KEY as storeKey } from '@woocommerce/block-data';
import { useSelect } from '@wordpress/data';
import { useShallowEqual } from '@woocommerce/base-hooks';

/**
 * This is a custom hook that is wired up to the `wc/store/collections` data
 * store. Given a header key and a collections option object, this will ensure a
 * component is kept up to date with the collection header value matching that
 * query in the store state.
 *
 * @param {string} headerKey              Used to indicate which header value to
 *                                        return for the given collection query.
 *                                        Example: `'x-wp-total'`
 * @param {Object} options                An object declaring the various
 *                                        collection arguments.
 * @param {string} options.namespace      The namespace for the collection.
 *                                        Example: `'/wc/blocks'`
 * @param {string} options.resourceName   The name of the resource for the
 *                                        collection. Example:
 *                                        `'products/attributes'`
 * @param {Array}  options.resourceValues An array of values (in correct order)
 *                                        that are substituted in the route
 *                                        placeholders for the collection route.
 *                                        Example: `[10, 20]`
 * @param {Object} options.query          An object of key value pairs for the
 *                                        query to execute on the collection
 *                                        (optional). Example:
 *                                        `{ order: 'ASC', order_by: 'price' }`
 *
 * @return {Object} This hook will return an object with two properties:
 *                  - value     Whatever value is attached to the specified
 *                              header.
 *                  - isLoading A boolean indicating whether the header is
 *                              loading (true) or not.
 */
export const useCollectionHeader = ( headerKey, options ) => {
	const {
		namespace,
		resourceName,
		resourceValues = [],
		query = {},
	} = options;
	if ( ! namespace || ! resourceName ) {
		throw new Error(
			'The options object must have valid values for the namespace and ' +
				'the resource name properties.'
		);
	}
	// ensure we feed the previous reference if it's equivalent
	const currentQuery = useShallowEqual( query );
	const currentResourceValues = useShallowEqual( resourceValues );
	const { value, isLoading = true } = useSelect(
		( select ) => {
			const store = select( storeKey );
			// filter out query if it is undefined.
			const args = [
				headerKey,
				namespace,
				resourceName,
				currentQuery,
				currentResourceValues,
			];
			return {
				value: store.getCollectionHeader( ...args ),
				isLoading: store.hasFinishedResolution(
					'getCollectionHeader',
					args
				),
			};
		},
		[
			headerKey,
			namespace,
			resourceName,
			currentResourceValues,
			currentQuery,
		]
	);
	return {
		value,
		isLoading,
	};
};
woocommerce-blocks/assets/js/base/context/hooks/collections/index.js000064400000000162151335517650021772 0ustar00export * from './use-collection-data';
export * from './use-collection-header';
export * from './use-collection';
woocommerce-blocks/assets/js/base/context/hooks/use-query-state.js000064400000012771151335517650021433 0ustar00/**
 * External dependencies
 */
import { QUERY_STATE_STORE_KEY as storeKey } from '@woocommerce/block-data';
import { useSelect, useDispatch } from '@wordpress/data';
import { useRef, useEffect, useCallback } from '@wordpress/element';
import isShallowEqual from '@wordpress/is-shallow-equal';
import { useShallowEqual, usePrevious } from '@woocommerce/base-hooks';

/**
 * Internal dependencies
 */

import { useQueryStateContext } from '../providers/query-state-context';

/**
 * A custom hook that exposes the current query state and a setter for the query
 * state store for the given context.
 *
 * "Query State" is a wp.data store that keeps track of an arbitrary object of
 * query keys and their values.
 *
 * @param {string} [context] What context to retrieve the query state for. If not
 *                           provided, this hook will attempt to get the context
 *                           from the query state context provided by the
 *                           QueryStateContextProvider
 *
 * @return {Array} An array that has two elements. The first element is the
 *                 query state value for the given context.  The second element
 *                 is a dispatcher function for setting the query state.
 */
export const useQueryStateByContext = ( context ) => {
	const queryStateContext = useQueryStateContext();
	context = context || queryStateContext;
	const queryState = useSelect(
		( select ) => {
			const store = select( storeKey );
			return store.getValueForQueryContext( context, undefined );
		},
		[ context ]
	);
	const { setValueForQueryContext } = useDispatch( storeKey );
	const setQueryState = useCallback(
		( value ) => {
			setValueForQueryContext( context, value );
		},
		[ context, setValueForQueryContext ]
	);

	return [ queryState, setQueryState ];
};

/**
 * A custom hook that exposes the current query state value and a setter for the
 * given context and query key.
 *
 * "Query State" is a wp.data store that keeps track of an arbitrary object of
 * query keys and their values.
 *
 * @param {*}      queryKey       The specific query key to retrieve the value for.
 * @param {*}      [defaultValue] Default value if query does not exist.
 * @param {string} [context]      What context to retrieve the query state for. If
 *                                not provided will attempt to use what is provided
 *                                by query state context.
 *
 * @return {*}  Whatever value is set at the query state index using the
 *              provided context and query key.
 */
export const useQueryStateByKey = ( queryKey, defaultValue, context ) => {
	const queryStateContext = useQueryStateContext();
	context = context || queryStateContext;
	const queryValue = useSelect(
		( select ) => {
			const store = select( storeKey );
			return store.getValueForQueryKey( context, queryKey, defaultValue );
		},
		[ context, queryKey ]
	);

	const { setQueryValue } = useDispatch( storeKey );
	const setQueryValueByKey = useCallback(
		( value ) => {
			setQueryValue( context, queryKey, value );
		},
		[ context, queryKey, setQueryValue ]
	);

	return [ queryValue, setQueryValueByKey ];
};

/**
 * A custom hook that works similarly to useQueryStateByContext. However, this
 * hook allows for synchronizing with a provided queryState object.
 *
 * This hook does the following things with the provided `synchronizedQuery`
 * object:
 *
 * - whenever synchronizedQuery varies between renders, the queryState will be
 *   updated to a merged object of the internal queryState and the provided
 *   object.  Note, any values from the same properties between objects will
 *   be set from synchronizedQuery.
 * - if there are no changes between renders, then the existing internal
 *   queryState is always returned.
 * - on initial render, the synchronizedQuery value is returned.
 *
 * Typically, this hook would be used in a scenario where there may be external
 * triggers for updating the query state (i.e. initial population of query
 * state by hydration or component attributes, or routing url changes that
 * affect query state).
 *
 * @param {Object} synchronizedQuery A provided query state object to
 *                                   synchronize internal query state with.
 * @param {string} [context]         What context to retrieve the query state
 *                                   for. If not provided, will be pulled from
 *                                   the QueryStateContextProvider in the tree.
 */
export const useSynchronizedQueryState = ( synchronizedQuery, context ) => {
	const queryStateContext = useQueryStateContext();
	context = context || queryStateContext;
	const [ queryState, setQueryState ] = useQueryStateByContext( context );
	const currentQueryState = useShallowEqual( queryState );
	const currentSynchronizedQuery = useShallowEqual( synchronizedQuery );
	const previousSynchronizedQuery = usePrevious( currentSynchronizedQuery );
	// used to ensure we allow initial synchronization to occur before
	// returning non-synced state.
	const isInitialized = useRef( false );
	// update queryState anytime incoming synchronizedQuery changes
	useEffect( () => {
		if (
			! isShallowEqual(
				previousSynchronizedQuery,
				currentSynchronizedQuery
			)
		) {
			setQueryState(
				Object.assign( {}, currentQueryState, currentSynchronizedQuery )
			);
			isInitialized.current = true;
		}
	}, [
		currentQueryState,
		currentSynchronizedQuery,
		previousSynchronizedQuery,
		setQueryState,
	] );
	return isInitialized.current
		? [ queryState, setQueryState ]
		: [ synchronizedQuery, setQueryState ];
};
woocommerce-blocks/assets/js/base/context/hooks/payment-methods/test/use-payment-method-interface.js000064400000002246151335517650030132 0ustar00/**
 * Internal dependencies
 */
import { prepareTotalItems } from '../utils';

describe( 'prepareTotalItems', () => {
	const fixture = {
		total_items: '200',
		total_items_tax: '20',
		total_fees: '100',
		total_fees_tax: '10',
		total_discount: '350',
		total_discount_tax: '50',
		total_shipping: '50',
		total_shipping_tax: '5',
		total_tax: '30',
	};
	const expected = [
		{
			key: 'total_items',
			label: 'Subtotal:',
			value: 200,
			valueWithTax: 220,
		},
		{
			key: 'total_fees',
			label: 'Fees:',
			value: 100,
			valueWithTax: 110,
		},
		{
			key: 'total_discount',
			label: 'Discount:',
			value: 350,
			valueWithTax: 400,
		},
		{
			key: 'total_tax',
			label: 'Taxes:',
			value: 30,
			valueWithTax: 30,
		},
	];
	const expectedWithShipping = [
		...expected,
		{
			key: 'total_shipping',
			label: 'Shipping:',
			value: 50,
			valueWithTax: 55,
		},
	];
	it( 'returns expected values when needsShipping is false', () => {
		expect( prepareTotalItems( fixture, false ) ).toEqual( expected );
	} );
	it( 'returns expected values when needsShipping is true', () => {
		expect( prepareTotalItems( fixture, true ) ).toEqual(
			expectedWithShipping
		);
	} );
} );
woocommerce-blocks/assets/js/base/context/hooks/payment-methods/index.js000064400000000163151335517650022573 0ustar00export { usePaymentMethodInterface } from './use-payment-method-interface';
export * from './use-payment-methods';
woocommerce-blocks/assets/js/base/context/hooks/payment-methods/use-payment-method-interface.ts000064400000010762151335517650027167 0ustar00/**
 * External dependencies
 */
import { __ } from '@wordpress/i18n';
import { getCurrencyFromPriceResponse } from '@woocommerce/price-format';
import { useCallback, useEffect, useRef } from '@wordpress/element';
import PaymentMethodLabel from '@woocommerce/base-components/cart-checkout/payment-method-label';
import PaymentMethodIcons from '@woocommerce/base-components/cart-checkout/payment-method-icons';
import { getSetting } from '@woocommerce/settings';
import deprecated from '@wordpress/deprecated';

/**
 * Internal dependencies
 */
import { ValidationInputError } from '../../providers/validation';
import { useStoreCart } from '../cart/use-store-cart';
import { useStoreCartCoupons } from '../cart/use-store-cart-coupons';
import { useEmitResponse } from '../use-emit-response';
import { useCheckoutContext } from '../../providers/cart-checkout/checkout-state';
import { usePaymentMethodDataContext } from '../../providers/cart-checkout/payment-methods';
import { useShippingDataContext } from '../../providers/cart-checkout/shipping';
import { useCustomerDataContext } from '../../providers/cart-checkout/customer';
import { prepareTotalItems } from './utils';

/**
 * Returns am interface to use as payment method props.
 */
export const usePaymentMethodInterface = (): Record< string, unknown > => {
	const {
		isCalculating,
		isComplete,
		isIdle,
		isProcessing,
		onCheckoutBeforeProcessing,
		onCheckoutValidationBeforeProcessing,
		onCheckoutAfterProcessingWithSuccess,
		onCheckoutAfterProcessingWithError,
		onSubmit,
		customerId,
	} = useCheckoutContext();
	const {
		currentStatus,
		activePaymentMethod,
		onPaymentProcessing,
		setExpressPaymentError,
		shouldSavePayment,
	} = usePaymentMethodDataContext();
	const {
		shippingErrorStatus,
		shippingErrorTypes,
		shippingRates,
		shippingRatesLoading,
		selectedRates,
		setSelectedRates,
		isSelectingRate,
		onShippingRateSuccess,
		onShippingRateFail,
		onShippingRateSelectSuccess,
		onShippingRateSelectFail,
		needsShipping,
	} = useShippingDataContext();
	const {
		billingData,
		shippingAddress,
		setShippingAddress,
	} = useCustomerDataContext();
	const { cartTotals } = useStoreCart();
	const { appliedCoupons } = useStoreCartCoupons();
	const { noticeContexts, responseTypes } = useEmitResponse();
	const currentCartTotals = useRef(
		prepareTotalItems( cartTotals, needsShipping )
	);
	const currentCartTotal = useRef( {
		label: __( 'Total', 'woo-gutenberg-products-block' ),
		value: parseInt( cartTotals.total_price, 10 ),
	} );

	useEffect( () => {
		currentCartTotals.current = prepareTotalItems(
			cartTotals,
			needsShipping
		);
		currentCartTotal.current = {
			label: __( 'Total', 'woo-gutenberg-products-block' ),
			value: parseInt( cartTotals.total_price, 10 ),
		};
	}, [ cartTotals, needsShipping ] );

	const deprecatedSetExpressPaymentError = useCallback(
		( errorMessage = '' ) => {
			deprecated(
				'setExpressPaymentError should only be used by Express Payment Methods (using the provided onError handler).',
				{
					alternative: '',
					plugin: 'woocommerce-gutenberg-products-block',
					link:
						'https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/4228',
				}
			);
			setExpressPaymentError( errorMessage );
		},
		[ setExpressPaymentError ]
	);

	return {
		activePaymentMethod,
		billing: {
			billingData,
			cartTotal: currentCartTotal.current,
			currency: getCurrencyFromPriceResponse( cartTotals ),
			cartTotalItems: currentCartTotals.current,
			displayPricesIncludingTax: getSetting(
				'displayCartPricesIncludingTax',
				false
			) as boolean,
			appliedCoupons,
			customerId,
		},
		checkoutStatus: {
			isCalculating,
			isComplete,
			isIdle,
			isProcessing,
		},
		components: {
			ValidationInputError,
			PaymentMethodIcons,
			PaymentMethodLabel,
		},
		emitResponse: {
			noticeContexts,
			responseTypes,
		},
		eventRegistration: {
			onCheckoutBeforeProcessing,
			onCheckoutValidationBeforeProcessing,
			onCheckoutAfterProcessingWithSuccess,
			onCheckoutAfterProcessingWithError,
			onShippingRateSuccess,
			onShippingRateFail,
			onShippingRateSelectSuccess,
			onShippingRateSelectFail,
			onPaymentProcessing,
		},
		onSubmit,
		paymentStatus: currentStatus,
		setExpressPaymentError: deprecatedSetExpressPaymentError,
		shippingData: {
			shippingRates,
			shippingRatesLoading,
			selectedRates,
			setSelectedRates,
			isSelectingRate,
			shippingAddress,
			setShippingAddress,
			needsShipping,
		},
		shippingStatus: {
			shippingErrorStatus,
			shippingErrorTypes,
		},
		shouldSavePayment,
	};
};
woocommerce-blocks/assets/js/base/context/hooks/payment-methods/utils.ts000064400000003434151335517650022642 0ustar00/**
 * External dependencies
 */
import { __ } from '@wordpress/i18n';
import {
	CartResponseTotals,
	objectHasProp,
	isString,
} from '@woocommerce/types';

export interface CartTotalItem {
	key: string;
	label: string;
	value: number;
	valueWithTax: number;
}

/**
 * Prepares the total items into a shape usable for display as passed on to
 * registered payment methods.
 *
 * @param {Object} totals Current cart total items
 * @param {boolean} needsShipping Whether or not shipping is needed.
 */
export const prepareTotalItems = (
	totals: CartResponseTotals,
	needsShipping: boolean
): CartTotalItem[] => {
	const newTotals = [];

	const factory = ( label: string, property: string ): CartTotalItem => {
		const taxProperty = property + '_tax';
		const value =
			objectHasProp( totals, property ) && isString( totals[ property ] )
				? parseInt( totals[ property ] as string, 10 )
				: 0;
		const tax =
			objectHasProp( totals, taxProperty ) &&
			isString( totals[ taxProperty ] )
				? parseInt( totals[ taxProperty ] as string, 10 )
				: 0;
		return {
			key: property,
			label,
			value,
			valueWithTax: value + tax,
		};
	};

	newTotals.push(
		factory(
			__( 'Subtotal:', 'woo-gutenberg-products-block' ),
			'total_items'
		)
	);

	newTotals.push(
		factory( __( 'Fees:', 'woo-gutenberg-products-block' ), 'total_fees' )
	);

	newTotals.push(
		factory(
			__( 'Discount:', 'woo-gutenberg-products-block' ),
			'total_discount'
		)
	);

	newTotals.push( {
		key: 'total_tax',
		label: __( 'Taxes:', 'woo-gutenberg-products-block' ),
		value: parseInt( totals.total_tax, 10 ),
		valueWithTax: parseInt( totals.total_tax, 10 ),
	} );

	if ( needsShipping ) {
		newTotals.push(
			factory(
				__( 'Shipping:', 'woo-gutenberg-products-block' ),
				'total_shipping'
			)
		);
	}

	return newTotals;
};
woocommerce-blocks/assets/js/base/context/hooks/payment-methods/use-payment-methods.ts000064400000002507151335517650025412 0ustar00/**
 * External dependencies
 */
import { useShallowEqual } from '@woocommerce/base-hooks';
import type {
	PaymentMethods,
	ExpressPaymentMethods,
} from '@woocommerce/type-defs/payments';

/**
 * Internal dependencies
 */
import { usePaymentMethodDataContext } from '../../providers/cart-checkout/payment-methods';

interface PaymentMethodState {
	paymentMethods: PaymentMethods;
	isInitialized: boolean;
}
interface ExpressPaymentMethodState {
	paymentMethods: ExpressPaymentMethods;
	isInitialized: boolean;
}

const usePaymentMethodState = (
	express = false
): PaymentMethodState | ExpressPaymentMethodState => {
	const {
		paymentMethods,
		expressPaymentMethods,
		paymentMethodsInitialized,
		expressPaymentMethodsInitialized,
	} = usePaymentMethodDataContext();

	const currentPaymentMethods = useShallowEqual( paymentMethods );
	const currentExpressPaymentMethods = useShallowEqual(
		expressPaymentMethods
	);

	return {
		paymentMethods: express
			? currentExpressPaymentMethods
			: currentPaymentMethods,
		isInitialized: express
			? expressPaymentMethodsInitialized
			: paymentMethodsInitialized,
	};
};

export const usePaymentMethods = ():
	| PaymentMethodState
	| ExpressPaymentMethodState => usePaymentMethodState( false );
export const useExpressPaymentMethods = (): ExpressPaymentMethodState =>
	usePaymentMethodState( true );
woocommerce-blocks/assets/js/base/context/hooks/cart/use-store-cart.ts000064400000015164151335517650022175 0ustar00/** @typedef { import('@woocommerce/type-defs/hooks').StoreCart } StoreCart */

/**
 * External dependencies
 */
import { isEqual } from 'lodash';
import { useRef } from '@wordpress/element';
import {
	CART_STORE_KEY as storeKey,
	EMPTY_CART_COUPONS,
	EMPTY_CART_ITEMS,
	EMPTY_CART_FEES,
	EMPTY_CART_ITEM_ERRORS,
	EMPTY_CART_ERRORS,
	EMPTY_SHIPPING_RATES,
	EMPTY_TAX_LINES,
	EMPTY_PAYMENT_REQUIREMENTS,
	EMPTY_EXTENSIONS,
} from '@woocommerce/block-data';
import { useSelect } from '@wordpress/data';
import { decodeEntities } from '@wordpress/html-entities';
import type {
	StoreCart,
	CartResponseTotals,
	CartResponseFeeItem,
	CartResponseBillingAddress,
	CartResponseShippingAddress,
	CartResponseCouponItem,
	CartResponseCoupons,
} from '@woocommerce/types';
import {
	emptyHiddenAddressFields,
	fromEntriesPolyfill,
} from '@woocommerce/base-utils';

/**
 * Internal dependencies
 */
import { useEditorContext } from '../../providers/editor-context';

declare module '@wordpress/html-entities' {
	// eslint-disable-next-line @typescript-eslint/no-shadow
	export function decodeEntities< T >( coupon: T ): T;
}
const defaultShippingAddress: CartResponseShippingAddress = {
	first_name: '',
	last_name: '',
	company: '',
	address_1: '',
	address_2: '',
	city: '',
	state: '',
	postcode: '',
	country: '',
	phone: '',
};

const defaultBillingAddress: CartResponseBillingAddress = {
	...defaultShippingAddress,
	email: '',
};

const defaultCartTotals: CartResponseTotals = {
	total_items: '',
	total_items_tax: '',
	total_fees: '',
	total_fees_tax: '',
	total_discount: '',
	total_discount_tax: '',
	total_shipping: '',
	total_shipping_tax: '',
	total_price: '',
	total_tax: '',
	tax_lines: EMPTY_TAX_LINES,
	currency_code: '',
	currency_symbol: '',
	currency_minor_unit: 2,
	currency_decimal_separator: '',
	currency_thousand_separator: '',
	currency_prefix: '',
	currency_suffix: '',
};

const decodeValues = (
	object: Record< string, unknown >
): Record< string, unknown > =>
	fromEntriesPolyfill(
		Object.entries( object ).map( ( [ key, value ] ) => [
			key,
			decodeEntities( value ),
		] )
	);

/**
 * @constant
 * @type  {StoreCart} Object containing cart data.
 */
export const defaultCartData: StoreCart = {
	cartCoupons: EMPTY_CART_COUPONS,
	cartItems: EMPTY_CART_ITEMS,
	cartFees: EMPTY_CART_FEES,
	cartItemsCount: 0,
	cartItemsWeight: 0,
	cartNeedsPayment: true,
	cartNeedsShipping: true,
	cartItemErrors: EMPTY_CART_ITEM_ERRORS,
	cartTotals: defaultCartTotals,
	cartIsLoading: true,
	cartErrors: EMPTY_CART_ERRORS,
	billingAddress: defaultBillingAddress,
	shippingAddress: defaultShippingAddress,
	shippingRates: EMPTY_SHIPPING_RATES,
	shippingRatesLoading: false,
	cartHasCalculatedShipping: false,
	paymentRequirements: EMPTY_PAYMENT_REQUIREMENTS,
	receiveCart: () => undefined,
	extensions: EMPTY_EXTENSIONS,
};

/**
 * This is a custom hook that is wired up to the `wc/store/cart` data
 * store.
 *
 * @param {Object} options                An object declaring the various
 *                                        collection arguments.
 * @param {boolean} options.shouldSelect  If false, the previous results will be
 *                                        returned and internal selects will not
 *                                        fire.
 *
 * @return {StoreCart} Object containing cart data.
 */

export const useStoreCart = (
	options: { shouldSelect: boolean } = { shouldSelect: true }
): StoreCart => {
	const { isEditor, previewData } = useEditorContext();
	const previewCart = previewData?.previewCart;
	const { shouldSelect } = options;
	const currentResults = useRef();
	const results: StoreCart = useSelect(
		( select, { dispatch } ) => {
			if ( ! shouldSelect ) {
				return defaultCartData;
			}

			if ( isEditor ) {
				return {
					cartCoupons: previewCart.coupons,
					cartItems: previewCart.items,
					cartFees: previewCart.fees,
					cartItemsCount: previewCart.items_count,
					cartItemsWeight: previewCart.items_weight,
					cartNeedsPayment: previewCart.needs_payment,
					cartNeedsShipping: previewCart.needs_shipping,
					cartItemErrors: EMPTY_CART_ITEM_ERRORS,
					cartTotals: previewCart.totals,
					cartIsLoading: false,
					cartErrors: EMPTY_CART_ERRORS,
					billingAddress: defaultBillingAddress,
					shippingAddress: defaultShippingAddress,
					extensions: EMPTY_EXTENSIONS,
					shippingRates: previewCart.shipping_rates,
					shippingRatesLoading: false,
					cartHasCalculatedShipping:
						previewCart.has_calculated_shipping,
					paymentRequirements: previewCart.paymentRequirements,
					receiveCart:
						typeof previewCart?.receiveCart === 'function'
							? previewCart.receiveCart
							: () => undefined,
				};
			}

			const store = select( storeKey );
			const cartData = store.getCartData();
			const cartErrors = store.getCartErrors();
			const cartTotals = store.getCartTotals();
			const cartIsLoading = ! store.hasFinishedResolution(
				'getCartData'
			);
			const shippingRatesLoading = store.isCustomerDataUpdating();
			const { receiveCart } = dispatch( storeKey );
			const billingAddress = decodeValues( cartData.billingAddress );
			const shippingAddress = cartData.needsShipping
				? decodeValues( cartData.shippingAddress )
				: billingAddress;
			const cartFees =
				cartData.fees.length > 0
					? cartData.fees.map( ( fee: CartResponseFeeItem ) =>
							decodeValues( fee )
					  )
					: EMPTY_CART_FEES;

			// Add a text property to the coupon to allow extensions to modify
			// the text used to display the coupon, without affecting the
			// functionality when it comes to removing the coupon.
			const cartCoupons: CartResponseCoupons =
				cartData.coupons.length > 0
					? cartData.coupons.map(
							( coupon: CartResponseCouponItem ) => ( {
								...coupon,
								label: coupon.code,
							} )
					  )
					: EMPTY_CART_COUPONS;

			return {
				cartCoupons,
				cartItems: cartData.items,
				cartFees,
				cartItemsCount: cartData.itemsCount,
				cartItemsWeight: cartData.itemsWeight,
				cartNeedsPayment: cartData.needsPayment,
				cartNeedsShipping: cartData.needsShipping,
				cartItemErrors: cartData.errors,
				cartTotals,
				cartIsLoading,
				cartErrors,
				billingAddress: emptyHiddenAddressFields( billingAddress ),
				shippingAddress: emptyHiddenAddressFields( shippingAddress ),
				extensions: cartData.extensions,
				shippingRates: cartData.shippingRates,
				shippingRatesLoading,
				cartHasCalculatedShipping: cartData.hasCalculatedShipping,
				paymentRequirements: cartData.paymentRequirements,
				receiveCart,
			};
		},
		[ shouldSelect ]
	);

	if (
		! currentResults.current ||
		! isEqual( currentResults.current, results )
	) {
		currentResults.current = results;
	}

	return currentResults.current;
};
woocommerce-blocks/assets/js/base/context/hooks/cart/test/use-store-cart-item-quantity.js000064400000011325151335517650025745 0ustar00/**
 * External dependencies
 */
import TestRenderer, { act } from 'react-test-renderer';
import { createRegistry, RegistryProvider } from '@wordpress/data';
import { CART_STORE_KEY as storeKey } from '@woocommerce/block-data';

/**
 * Internal dependencies
 */
import * as mockUseStoreCart from '../use-store-cart';
import { useStoreCartItemQuantity } from '../use-store-cart-item-quantity';

jest.mock( '../use-store-cart', () => ( {
	useStoreCart: jest.fn(),
} ) );

jest.mock( '@woocommerce/block-data', () => ( {
	__esModule: true,
	CART_STORE_KEY: 'test/store',
} ) );

// Make debounce instantaneous.
jest.mock( 'use-debounce', () => ( {
	useDebounce: ( a ) => [ a ],
} ) );

describe( 'useStoreCartItemQuantity', () => {
	let registry, renderer;

	const getWrappedComponents = ( Component ) => (
		<RegistryProvider value={ registry }>
			<Component />
		</RegistryProvider>
	);

	const getTestComponent = ( options ) => () => {
		const props = useStoreCartItemQuantity( options );
		return <div { ...props } />;
	};

	let mockRemoveItemFromCart;
	let mockChangeCartItemQuantity;
	const setupMocks = ( { isPendingDelete, isPendingQuantity } ) => {
		mockRemoveItemFromCart = jest
			.fn()
			.mockReturnValue( { type: 'removeItemFromCartAction' } );
		mockChangeCartItemQuantity = jest
			.fn()
			.mockReturnValue( { type: 'changeCartItemQuantityAction' } );
		registry.registerStore( storeKey, {
			reducer: () => ( {} ),
			actions: {
				removeItemFromCart: mockRemoveItemFromCart,
				changeCartItemQuantity: mockChangeCartItemQuantity,
			},
			selectors: {
				isItemPendingDelete: jest
					.fn()
					.mockReturnValue( isPendingDelete ),
				isItemPendingQuantity: jest
					.fn()
					.mockReturnValue( isPendingQuantity ),
			},
		} );
	};

	beforeEach( () => {
		registry = createRegistry();
		renderer = null;
	} );

	afterEach( () => {
		mockRemoveItemFromCart.mockReset();
		mockChangeCartItemQuantity.mockReset();
	} );

	describe( 'with no errors and not pending', () => {
		beforeEach( () => {
			setupMocks( { isPendingDelete: false, isPendingQuantity: false } );
			mockUseStoreCart.useStoreCart.mockReturnValue( {
				cartErrors: {},
			} );
		} );

		it( 'update quantity value should happen instantly', () => {
			const TestComponent = getTestComponent( {
				key: '123',
				quantity: 1,
			} );

			act( () => {
				renderer = TestRenderer.create(
					getWrappedComponents( TestComponent )
				);
			} );

			const { setItemQuantity, quantity } = renderer.root.findByType(
				'div'
			).props;

			expect( quantity ).toBe( 1 );

			act( () => {
				setItemQuantity( 2 );
			} );

			const { quantity: newQuantity } = renderer.root.findByType(
				'div'
			).props;

			expect( newQuantity ).toBe( 2 );
		} );

		it( 'removeItem should call the dispatch action', () => {
			const TestComponent = getTestComponent( {
				key: '123',
				quantity: 1,
			} );

			act( () => {
				renderer = TestRenderer.create(
					getWrappedComponents( TestComponent )
				);
			} );

			const { removeItem } = renderer.root.findByType( 'div' ).props;

			act( () => {
				removeItem();
			} );

			expect( mockRemoveItemFromCart ).toHaveBeenCalledWith( '123' );
		} );

		it( 'setItemQuantity should call the dispatch action', () => {
			const TestComponent = getTestComponent( {
				key: '123',
				quantity: 1,
			} );

			act( () => {
				renderer = TestRenderer.create(
					getWrappedComponents( TestComponent )
				);
			} );

			const { setItemQuantity } = renderer.root.findByType( 'div' ).props;

			act( () => {
				setItemQuantity( 2 );
			} );

			expect( mockChangeCartItemQuantity.mock.calls ).toEqual( [
				[ '123', 2 ],
			] );
		} );
	} );

	it( 'should expose store errors', () => {
		const mockCartErrors = [ { message: 'Test error' } ];
		setupMocks( { isPendingDelete: false, isPendingQuantity: false } );
		mockUseStoreCart.useStoreCart.mockReturnValue( {
			cartErrors: mockCartErrors,
		} );

		const TestComponent = getTestComponent( {
			key: '123',
			quantity: 1,
		} );

		act( () => {
			renderer = TestRenderer.create(
				getWrappedComponents( TestComponent )
			);
		} );

		const { cartItemQuantityErrors } = renderer.root.findByType(
			'div'
		).props;

		expect( cartItemQuantityErrors ).toEqual( mockCartErrors );
	} );

	it( 'isPendingDelete should depend on the value provided by the store', () => {
		setupMocks( { isPendingDelete: true, isPendingQuantity: false } );
		mockUseStoreCart.useStoreCart.mockReturnValue( {
			cartErrors: {},
		} );

		const TestComponent = getTestComponent( {
			key: '123',
			quantity: 1,
		} );

		act( () => {
			renderer = TestRenderer.create(
				getWrappedComponents( TestComponent )
			);
		} );

		const { isPendingDelete } = renderer.root.findByType( 'div' ).props;

		expect( isPendingDelete ).toBe( true );
	} );
} );
woocommerce-blocks/assets/js/base/context/hooks/cart/test/use-store-cart.js000064400000012750151335517650023140 0ustar00/**
 * External dependencies
 */
import TestRenderer, { act } from 'react-test-renderer';
import { createRegistry, RegistryProvider } from '@wordpress/data';
import { previewCart } from '@woocommerce/resource-previews';
import { CART_STORE_KEY as storeKey } from '@woocommerce/block-data';

/**
 * Internal dependencies
 */
import { defaultCartData, useStoreCart } from '../use-store-cart';
import { useEditorContext } from '../../../providers/editor-context';

jest.mock( '../../../providers/editor-context', () => ( {
	useEditorContext: jest.fn(),
} ) );

jest.mock( '@woocommerce/block-data', () => ( {
	...jest.requireActual( '@woocommerce/block-data' ),
	__esModule: true,
	CART_STORE_KEY: 'test/store',
} ) );

describe( 'useStoreCart', () => {
	let registry, renderer;

	const receiveCartMock = () => {};

	const previewCartData = {
		cartCoupons: previewCart.coupons,
		cartItems: previewCart.items,
		cartFees: previewCart.fees,
		cartItemsCount: previewCart.items_count,
		cartItemsWeight: previewCart.items_weight,
		cartNeedsPayment: previewCart.needs_payment,
		cartNeedsShipping: previewCart.needs_shipping,
		cartTotals: previewCart.totals,
		cartIsLoading: false,
		cartItemErrors: [],
		cartErrors: [],
		billingAddress: {
			first_name: '',
			last_name: '',
			company: '',
			address_1: '',
			address_2: '',
			city: '',
			state: '',
			postcode: '',
			country: '',
			email: '',
			phone: '',
		},
		shippingAddress: {
			first_name: '',
			last_name: '',
			company: '',
			address_1: '',
			address_2: '',
			city: '',
			state: '',
			postcode: '',
			country: '',
			phone: '',
		},
		shippingRates: previewCart.shipping_rates,
		extensions: {},
		shippingRatesLoading: false,
		cartHasCalculatedShipping: true,
	};

	const mockCartItems = [ { key: '1', id: 1, name: 'Lorem Ipsum' } ];
	const mockShippingAddress = {
		city: 'New York',
	};
	const mockCartData = {
		coupons: [],
		items: mockCartItems,
		fees: [],
		itemsCount: 1,
		itemsWeight: 10,
		needsPayment: true,
		needsShipping: true,
		billingAddress: {},
		shippingAddress: mockShippingAddress,
		shippingRates: [],
		hasCalculatedShipping: true,
		extensions: {},
		errors: [],
		receiveCart: undefined,
		paymentRequirements: [],
	};
	const mockCartTotals = {
		currency_code: 'USD',
	};
	const mockCartIsLoading = false;
	const mockCartErrors = [];
	const mockStoreCartData = {
		cartCoupons: [],
		cartItems: mockCartItems,
		cartItemErrors: [],
		cartItemsCount: 1,
		cartItemsWeight: 10,
		cartNeedsPayment: true,
		cartNeedsShipping: true,
		cartTotals: mockCartTotals,
		cartIsLoading: mockCartIsLoading,
		cartErrors: mockCartErrors,
		cartFees: [],
		billingAddress: {},
		shippingAddress: mockShippingAddress,
		shippingRates: [],
		extensions: {},
		shippingRatesLoading: false,
		cartHasCalculatedShipping: true,
		receiveCart: undefined,
		paymentRequirements: [],
	};

	const getWrappedComponents = ( Component ) => (
		<RegistryProvider value={ registry }>
			<Component />
		</RegistryProvider>
	);

	const getTestComponent = ( options ) => () => {
		const { receiveCart, ...results } = useStoreCart( options );
		return <div results={ results } receiveCart={ receiveCart } />;
	};

	const setUpMocks = () => {
		const mocks = {
			selectors: {
				getCartData: jest.fn().mockReturnValue( mockCartData ),
				getCartErrors: jest.fn().mockReturnValue( mockCartErrors ),
				getCartTotals: jest.fn().mockReturnValue( mockCartTotals ),
				hasFinishedResolution: jest
					.fn()
					.mockReturnValue( ! mockCartIsLoading ),
				isCustomerDataUpdating: jest.fn().mockReturnValue( false ),
			},
		};
		registry.registerStore( storeKey, {
			reducer: () => ( {} ),
			selectors: mocks.selectors,
		} );
	};

	beforeEach( () => {
		registry = createRegistry();
		renderer = null;
		setUpMocks();
	} );

	afterEach( () => {
		useEditorContext.mockReset();
	} );

	describe( 'in frontend', () => {
		beforeEach( () => {
			useEditorContext.mockReturnValue( {
				isEditor: false,
			} );
		} );

		it( 'return default data when shouldSelect is false', () => {
			const TestComponent = getTestComponent( { shouldSelect: false } );

			act( () => {
				renderer = TestRenderer.create(
					getWrappedComponents( TestComponent )
				);
			} );

			const { results, receiveCart } = renderer.root.findByType(
				'div'
			).props;
			const {
				receiveCart: defaultReceiveCart,
				...remaining
			} = defaultCartData;
			expect( results ).toEqual( remaining );
			expect( receiveCart ).toEqual( defaultReceiveCart );
		} );

		it( 'return store data when shouldSelect is true', () => {
			const TestComponent = getTestComponent( { shouldSelect: true } );

			act( () => {
				renderer = TestRenderer.create(
					getWrappedComponents( TestComponent )
				);
			} );

			const { results, receiveCart } = renderer.root.findByType(
				'div'
			).props;

			expect( results ).toEqual( mockStoreCartData );
			expect( receiveCart ).toBeUndefined();
		} );
	} );

	describe( 'in editor', () => {
		beforeEach( () => {
			useEditorContext.mockReturnValue( {
				isEditor: true,
				previewData: {
					previewCart: {
						...previewCart,
						receiveCart: receiveCartMock,
					},
				},
			} );
		} );

		it( 'return preview data in editor', () => {
			const TestComponent = getTestComponent();

			act( () => {
				renderer = TestRenderer.create(
					getWrappedComponents( TestComponent )
				);
			} );

			const { results, receiveCart } = renderer.root.findByType(
				'div'
			).props;

			expect( results ).toEqual( previewCartData );
			expect( receiveCart ).toEqual( receiveCartMock );
		} );
	} );
} );
woocommerce-blocks/assets/js/base/context/hooks/cart/use-store-cart-coupons.ts000064400000007031151335517650023653 0ustar00/** @typedef { import('@woocommerce/type-defs/hooks').StoreCartCoupon } StoreCartCoupon */

/**
 * External dependencies
 */
import { __, sprintf } from '@wordpress/i18n';
import { useSelect } from '@wordpress/data';
import { CART_STORE_KEY as storeKey } from '@woocommerce/block-data';
import { decodeEntities } from '@wordpress/html-entities';
import type { StoreCartCoupon } from '@woocommerce/types';

/**
 * Internal dependencies
 */
import { useStoreCart } from './use-store-cart';
import { useStoreSnackbarNotices } from '../use-store-snackbar-notices';
import { useValidationContext } from '../../providers/validation';
import { useStoreNotices } from '../use-store-notices';

/**
 * This is a custom hook for loading the Store API /cart/coupons endpoint and an
 * action for adding a coupon _to_ the cart.
 * See also: https://github.com/woocommerce/woocommerce-gutenberg-products-block/tree/trunk/src/RestApi/StoreApi
 *
 * @return {StoreCartCoupon} An object exposing data and actions from/for the
 * store api /cart/coupons endpoint.
 */
export const useStoreCartCoupons = (): StoreCartCoupon => {
	const { cartCoupons, cartIsLoading } = useStoreCart();
	const { addErrorNotice } = useStoreNotices();
	const { addSnackbarNotice } = useStoreSnackbarNotices();
	const { setValidationErrors } = useValidationContext();

	const results: Pick<
		StoreCartCoupon,
		'applyCoupon' | 'removeCoupon' | 'isApplyingCoupon' | 'isRemovingCoupon'
	> = useSelect(
		( select, { dispatch } ) => {
			const store = select( storeKey );
			const isApplyingCoupon = store.isApplyingCoupon();
			const isRemovingCoupon = store.isRemovingCoupon();
			const {
				applyCoupon,
				removeCoupon,
				receiveApplyingCoupon,
			}: {
				applyCoupon: ( coupon: string ) => Promise< boolean >;
				removeCoupon: ( coupon: string ) => Promise< boolean >;
				receiveApplyingCoupon: ( coupon: string ) => void;
			} = dispatch( storeKey );

			const applyCouponWithNotices = ( couponCode: string ) => {
				applyCoupon( couponCode )
					.then( ( result ) => {
						if ( result === true ) {
							addSnackbarNotice(
								sprintf(
									/* translators: %s coupon code. */
									__(
										'Coupon code "%s" has been applied to your cart.',
										'woo-gutenberg-products-block'
									),
									couponCode
								),
								{
									id: 'coupon-form',
								}
							);
						}
					} )
					.catch( ( error ) => {
						setValidationErrors( {
							coupon: {
								message: decodeEntities( error.message ),
								hidden: false,
							},
						} );
						// Finished handling the coupon.
						receiveApplyingCoupon( '' );
					} );
			};

			const removeCouponWithNotices = ( couponCode: string ) => {
				removeCoupon( couponCode )
					.then( ( result ) => {
						if ( result === true ) {
							addSnackbarNotice(
								sprintf(
									/* translators: %s coupon code. */
									__(
										'Coupon code "%s" has been removed from your cart.',
										'woo-gutenberg-products-block'
									),
									couponCode
								),
								{
									id: 'coupon-form',
								}
							);
						}
					} )
					.catch( ( error ) => {
						addErrorNotice( error.message, {
							id: 'coupon-form',
						} );
						// Finished handling the coupon.
						receiveApplyingCoupon( '' );
					} );
			};

			return {
				applyCoupon: applyCouponWithNotices,
				removeCoupon: removeCouponWithNotices,
				isApplyingCoupon,
				isRemovingCoupon,
			};
		},
		[ addErrorNotice, addSnackbarNotice ]
	);

	return {
		appliedCoupons: cartCoupons,
		isLoading: cartIsLoading,
		...results,
	};
};
woocommerce-blocks/assets/js/base/context/hooks/cart/use-store-cart-item-quantity.ts000064400000010337151335517650025002 0ustar00/**
 * External dependencies
 */
import { useSelect, useDispatch } from '@wordpress/data';
import { useCallback, useState, useEffect } from '@wordpress/element';
import { CART_STORE_KEY as storeKey } from '@woocommerce/block-data';
import { useDebounce } from 'use-debounce';
import { usePrevious } from '@woocommerce/base-hooks';
import { triggerFragmentRefresh } from '@woocommerce/base-utils';
import {
	CartItem,
	StoreCartItemQuantity,
	isNumber,
	isObject,
	isString,
	objectHasProp,
} from '@woocommerce/types';

/**
 * Internal dependencies
 */
import { useStoreCart } from './use-store-cart';
import { useCheckoutContext } from '../../providers/cart-checkout';

/**
 * Ensures the object passed has props key: string and quantity: number
 */
const cartItemHasQuantityAndKey = (
	cartItem: unknown /* Object that may have quantity and key */
): cartItem is Partial< CartItem > =>
	isObject( cartItem ) &&
	objectHasProp( cartItem, 'key' ) &&
	objectHasProp( cartItem, 'quantity' ) &&
	isString( cartItem.key ) &&
	isNumber( cartItem.quantity );

/**
 * This is a custom hook for loading the Store API /cart/ endpoint and actions for removing or changing item quantity.
 *
 * @see https://github.com/woocommerce/woocommerce-gutenberg-products-block/tree/trunk/src/RestApi/StoreApi
 *
 * @param {CartItem} cartItem      The cartItem to get quantity info from and will have quantity updated on.
 * @return {StoreCartItemQuantity} An object exposing data and actions relating to cart items.
 */
export const useStoreCartItemQuantity = (
	cartItem: CartItem | Record< string, unknown >
): StoreCartItemQuantity => {
	const verifiedCartItem = { key: '', quantity: 1 };

	if ( cartItemHasQuantityAndKey( cartItem ) ) {
		verifiedCartItem.key = cartItem.key;
		verifiedCartItem.quantity = cartItem.quantity;
	}
	const {
		key: cartItemKey = '',
		quantity: cartItemQuantity = 1,
	} = verifiedCartItem;
	const { cartErrors } = useStoreCart();
	const { dispatchActions } = useCheckoutContext();

	// Store quantity in hook state. This is used to keep the UI updated while server request is updated.
	const [ quantity, setQuantity ] = useState< number >( cartItemQuantity );
	const [ debouncedQuantity ] = useDebounce< number >( quantity, 400 );
	const previousDebouncedQuantity = usePrevious( debouncedQuantity );
	const { removeItemFromCart, changeCartItemQuantity } = useDispatch(
		storeKey
	);

	// Track when things are already pending updates.
	const isPending = useSelect(
		( select ) => {
			if ( ! cartItemKey ) {
				return {
					quantity: false,
					delete: false,
				};
			}
			const store = select( storeKey );
			return {
				quantity: store.isItemPendingQuantity( cartItemKey ),
				delete: store.isItemPendingDelete( cartItemKey ),
			};
		},
		[ cartItemKey ]
	);

	const removeItem = useCallback( () => {
		return cartItemKey
			? removeItemFromCart( cartItemKey ).then( () => {
					triggerFragmentRefresh();
					return true;
			  } )
			: Promise.resolve( false );
	}, [ cartItemKey, removeItemFromCart ] );

	// Observe debounced quantity value, fire action to update server on change.
	useEffect( () => {
		if (
			cartItemKey &&
			isNumber( previousDebouncedQuantity ) &&
			Number.isFinite( previousDebouncedQuantity ) &&
			previousDebouncedQuantity !== debouncedQuantity
		) {
			changeCartItemQuantity( cartItemKey, debouncedQuantity );
		}
	}, [
		cartItemKey,
		changeCartItemQuantity,
		debouncedQuantity,
		previousDebouncedQuantity,
	] );

	useEffect( () => {
		if ( isPending.delete ) {
			dispatchActions.incrementCalculating();
		} else {
			dispatchActions.decrementCalculating();
		}
		return () => {
			if ( isPending.delete ) {
				dispatchActions.decrementCalculating();
			}
		};
	}, [ dispatchActions, isPending.delete ] );

	useEffect( () => {
		if ( isPending.quantity || debouncedQuantity !== quantity ) {
			dispatchActions.incrementCalculating();
		} else {
			dispatchActions.decrementCalculating();
		}
		return () => {
			if ( isPending.quantity || debouncedQuantity !== quantity ) {
				dispatchActions.decrementCalculating();
			}
		};
	}, [ dispatchActions, isPending.quantity, debouncedQuantity, quantity ] );

	return {
		isPendingDelete: isPending.delete,
		quantity,
		setItemQuantity: setQuantity,
		removeItem,
		cartItemQuantityErrors: cartErrors,
	};
};
woocommerce-blocks/assets/js/base/context/hooks/cart/index.ts000064400000000174151335517650020422 0ustar00export * from './use-store-cart';
export * from './use-store-cart-coupons';
export * from './use-store-cart-item-quantity';
woocommerce-blocks/assets/js/base/context/hooks/use-validation.ts000064400000002746151335517650021315 0ustar00/**
 * External dependencies
 */
import { useCallback } from '@wordpress/element';
import type {
	ValidationData,
	ValidationContextError,
} from '@woocommerce/type-defs/contexts';

/**
 * Internal dependencies
 */
import { useValidationContext } from '../providers/validation/';

/**
 * Custom hook for setting for adding errors to the validation system.
 */
export const useValidation = (): ValidationData => {
	const {
		hasValidationErrors,
		getValidationError,
		clearValidationError,
		hideValidationError,
		setValidationErrors,
	} = useValidationContext();
	const prefix = 'extensions-errors';

	return {
		hasValidationErrors,
		getValidationError: useCallback(
			( validationErrorId: string ) =>
				getValidationError( `${ prefix }-${ validationErrorId }` ),
			[ getValidationError ]
		),
		clearValidationError: useCallback(
			( validationErrorId: string ) =>
				clearValidationError( `${ prefix }-${ validationErrorId }` ),
			[ clearValidationError ]
		),
		hideValidationError: useCallback(
			( validationErrorId: string ) =>
				hideValidationError( `${ prefix }-${ validationErrorId }` ),
			[ hideValidationError ]
		),
		setValidationErrors: useCallback(
			( errorsObject: Record< string, ValidationContextError > ) =>
				setValidationErrors(
					Object.fromEntries(
						Object.entries(
							errorsObject
						).map( ( [ validationErrorId, error ] ) => [
							`${ prefix }-${ validationErrorId }`,
							error,
						] )
					)
				),
			[ setValidationErrors ]
		),
	};
};
woocommerce-blocks/assets/js/base/context/hooks/use-checkout-submit.js000064400000002423151335517650022247 0ustar00/**
 * External dependencies
 */
import { __ } from '@wordpress/i18n';

/**
 * Internal dependencies
 */
import { useCheckoutContext } from '../providers/cart-checkout/checkout-state';
import { usePaymentMethodDataContext } from '../providers/cart-checkout/payment-methods';
import { usePaymentMethods } from './payment-methods/use-payment-methods';

/**
 * Returns the submitButtonText, onSubmit interface from the checkout context,
 * and an indication of submission status.
 */
export const useCheckoutSubmit = () => {
	const {
		onSubmit,
		isCalculating,
		isBeforeProcessing,
		isProcessing,
		isAfterProcessing,
		isComplete,
		hasError,
	} = useCheckoutContext();
	const { paymentMethods = {} } = usePaymentMethods();
	const {
		activePaymentMethod,
		currentStatus: paymentStatus,
	} = usePaymentMethodDataContext();
	const paymentMethod = paymentMethods[ activePaymentMethod ] || {};
	const waitingForProcessing =
		isProcessing || isAfterProcessing || isBeforeProcessing;
	const waitingForRedirect = isComplete && ! hasError;

	return {
		submitButtonText:
			paymentMethod?.placeOrderButtonLabel ||
			__( 'Place Order', 'woocommerce' ),
		onSubmit,
		isCalculating,
		isDisabled: isProcessing || paymentStatus.isDoingExpressPayment,
		waitingForProcessing,
		waitingForRedirect,
	};
};
woocommerce-blocks/assets/js/base/context/hooks/use-checkout-extension-data.ts000064400000002632151335517650023703 0ustar00/**
 * External dependencies
 */
import { useCallback, useEffect, useRef } from '@wordpress/element';
import isShallowEqual from '@wordpress/is-shallow-equal';

/**
 * Internal dependencies
 */
import { useCheckoutContext } from '../providers/cart-checkout/checkout-state';
import type { CheckoutStateContextState } from '../providers/cart-checkout/checkout-state/types';

/**
 * Custom hook for setting custom checkout data which is passed to the wc/store/checkout endpoint when processing orders.
 */
export const useCheckoutExtensionData = (): {
	extensionData: CheckoutStateContextState[ 'extensionData' ];
	setExtensionData: (
		namespace: string,
		key: string,
		value: unknown
	) => void;
} => {
	const { dispatchActions, extensionData } = useCheckoutContext();
	const extensionDataRef = useRef( extensionData );

	useEffect( () => {
		if ( ! isShallowEqual( extensionData, extensionDataRef.current ) ) {
			extensionDataRef.current = extensionData;
		}
	}, [ extensionData ] );

	const setExtensionDataWithNamespace = useCallback(
		( namespace, key, value ) => {
			const currentData = extensionDataRef.current[ namespace ] || {};
			dispatchActions.setExtensionData( {
				...extensionDataRef.current,
				[ namespace ]: {
					...currentData,
					[ key ]: value,
				},
			} );
		},
		[ dispatchActions ]
	);

	return {
		extensionData: extensionDataRef.current,
		setExtensionData: setExtensionDataWithNamespace,
	};
};
woocommerce-blocks/assets/js/base/context/providers/editor-context.js000064400000003251151335517650022211 0ustar00/**
 * External dependencies
 */
import { createContext, useContext, useCallback } from '@wordpress/element';
import { useSelect } from '@wordpress/data';

/**
 * @typedef {import('@woocommerce/type-defs/contexts').EditorDataContext} EditorDataContext
 * @typedef {import('@woocommerce/type-defs/cart').CartData} CartData
 */

const EditorContext = createContext( {
	isEditor: false,
	currentPostId: 0,
	previewData: {},
	getPreviewData: () => void null,
} );

/**
 * @return {EditorDataContext} Returns the editor data context value
 */
export const useEditorContext = () => {
	return useContext( EditorContext );
};

/**
 * Editor provider
 *
 * @param {Object} props                 Incoming props for the provider.
 * @param {*}      props.children        The children being wrapped.
 * @param {Object} [props.previewData]   The preview data for editor.
 * @param {number} [props.currentPostId] The post being edited.
 */
export const EditorProvider = ( {
	children,
	currentPostId = 0,
	previewData = {},
} ) => {
	/**
	 * @type {number} editingPostId
	 */
	const editingPostId = useSelect(
		( select ) => {
			if ( ! currentPostId ) {
				const store = select( 'core/editor' );
				return store.getCurrentPostId();
			}
			return currentPostId;
		},
		[ currentPostId ]
	);

	const getPreviewData = useCallback(
		( name ) => {
			if ( name in previewData ) {
				return previewData[ name ];
			}
			return {};
		},
		[ previewData ]
	);

	/**
	 * @type {EditorDataContext}
	 */
	const editorData = {
		isEditor: true,
		currentPostId: editingPostId,
		previewData,
		getPreviewData,
	};

	return (
		<EditorContext.Provider value={ editorData }>
			{ children }
		</EditorContext.Provider>
	);
};
woocommerce-blocks/assets/js/base/context/providers/query-state-context.js000064400000001250151335517650023203 0ustar00/**
 * External dependencies
 */
import { createContext, useContext } from '@wordpress/element';

/**
 * Query state context is the index for used for a query state store. By
 * exposing this via context, it allows for all children blocks to be
 * synchronized to the same query state defined by the parent in the tree.
 *
 * Defaults to 'page' for general global query state shared among all blocks
 * in a view.
 *
 * @member  {Object}  QueryStateContext A react context object
 */
const QueryStateContext = createContext( 'page' );

export const useQueryStateContext = () => useContext( QueryStateContext );
export const QueryStateContextProvider = QueryStateContext.Provider;
assets/js/base/context/providers/store-notices/components/store-notices-container.js000064400000003061151335517650030722 0ustar00woocommerce-blocks/**
 * External dependencies
 */
import PropTypes from 'prop-types';
import classnames from 'classnames';
import { Notice } from 'wordpress-components';

/**
 * Internal dependencies
 */
import './style.scss';

const getWooClassName = ( { status = 'default' } ) => {
	switch ( status ) {
		case 'error':
			return 'woocommerce-error';
		case 'success':
			return 'woocommerce-message';
		case 'info':
		case 'warning':
			return 'woocommerce-info';
	}
	return '';
};

const StoreNoticesContainer = ( { className, notices, removeNotice } ) => {
	const regularNotices = notices.filter(
		( notice ) => notice.type !== 'snackbar'
	);

	if ( ! regularNotices.length ) {
		return null;
	}

	const wrapperClass = classnames( className, 'wc-block-components-notices' );

	return (
		<div className={ wrapperClass }>
			{ regularNotices.map( ( props ) => (
				<Notice
					key={ 'store-notice-' + props.id }
					{ ...props }
					className={ classnames(
						'wc-block-components-notices__notice',
						getWooClassName( props )
					) }
					onRemove={ () => {
						if ( props.isDismissible ) {
							removeNotice( props.id );
						}
					} }
				>
					{ props.content }
				</Notice>
			) ) }
		</div>
	);
};

StoreNoticesContainer.propTypes = {
	className: PropTypes.string,
	notices: PropTypes.arrayOf(
		PropTypes.shape( {
			content: PropTypes.string.isRequired,
			id: PropTypes.string.isRequired,
			status: PropTypes.string.isRequired,
			isDismissible: PropTypes.bool,
			type: PropTypes.oneOf( [ 'default', 'snackbar' ] ),
		} )
	),
};

export default StoreNoticesContainer;
woocommerce-blocks/assets/js/base/context/providers/store-notices/components/style.scss000064400000001325151335517650025723 0ustar00.wc-block-components-notices {
	display: block;
	margin-bottom: 2em;
	.wc-block-components-notices__notice {
		margin: 0;
		display: flex;
		flex-wrap: nowrap;
		.components-notice__dismiss {
			background: transparent none;
			padding: 0;
			margin: 0 0 0 auto;
			border: 0;
			outline: 0;
			color: currentColor;
			svg {
				fill: currentColor;
				vertical-align: text-top;
			}
		}
	}
	.wc-block-components-notices__notice + .wc-block-components-notices__notice {
		margin-top: 1em;
	}
}

// @todo Either move notice style fixes to Woo core, or take full control over notice component styling in blocks.
.theme-twentytwentyone,
.theme-twentytwenty {
	.wc-block-components-notices__notice {
		padding: 1.5rem 3rem;
	}
}
woocommerce-blocks/assets/js/base/context/providers/store-notices/context.js000064400000006470151335517650023531 0ustar00/**
 * External dependencies
 */
import PropTypes from 'prop-types';
import {
	createContext,
	useContext,
	useCallback,
	useState,
} from '@wordpress/element';
import { useSelect, useDispatch } from '@wordpress/data';

/**
 * Internal dependencies
 */
import { useStoreEvents } from '../../hooks/use-store-events';
import { useEditorContext } from '../editor-context';
import StoreNoticesContainer from './components/store-notices-container';

/**
 * @typedef {import('@woocommerce/type-defs/contexts').NoticeContext} NoticeContext
 * @typedef {import('react')} React
 */

const StoreNoticesContext = createContext( {
	notices: [],
	createNotice: ( status, text, props ) => void { status, text, props },
	removeNotice: ( id, ctxt ) => void { id, ctxt },
	setIsSuppressed: ( val ) => void { val },
	context: 'wc/core',
} );

/**
 * Returns the notices context values.
 *
 * @return {NoticeContext} The notice context value from the notice context.
 */
export const useStoreNoticesContext = () => {
	return useContext( StoreNoticesContext );
};

/**
 * Provides an interface for blocks to add notices to the frontend UI.
 *
 * Statuses map to https://github.com/WordPress/gutenberg/tree/master/packages/components/src/notice
 *  - Default (no status)
 *  - Error
 *  - Warning
 *  - Info
 *  - Success
 *
 * @param {Object} props Incoming props for the component.
 * @param {JSX.Element} props.children The Elements wrapped by this component.
 * @param {string} [props.className] CSS class used.
 * @param {boolean} [props.createNoticeContainer] Whether to create a notice container or not.
 * @param {string} [props.context] The notice context for notices being rendered.
 */
export const StoreNoticesProvider = ( {
	children,
	className = '',
	createNoticeContainer = true,
	context = 'wc/core',
} ) => {
	const { createNotice, removeNotice } = useDispatch( 'core/notices' );
	const [ isSuppressed, setIsSuppressed ] = useState( false );
	const { dispatchStoreEvent } = useStoreEvents();
	const { isEditor } = useEditorContext();

	const createNoticeWithContext = useCallback(
		( status = 'default', content = '', options = {} ) => {
			createNotice( status, content, {
				...options,
				context: options.context || context,
			} );
			dispatchStoreEvent( 'store-notice-create', {
				status,
				content,
				options,
			} );
		},
		[ createNotice, dispatchStoreEvent, context ]
	);

	const removeNoticeWithContext = useCallback(
		( id, ctxt = context ) => {
			removeNotice( id, ctxt );
		},
		[ removeNotice, context ]
	);

	const { notices } = useSelect(
		( select ) => {
			return {
				notices: select( 'core/notices' ).getNotices( context ),
			};
		},
		[ context ]
	);

	const contextValue = {
		notices,
		createNotice: createNoticeWithContext,
		removeNotice: removeNoticeWithContext,
		context,
		setIsSuppressed,
	};

	const noticeOutput = isSuppressed ? null : (
		<StoreNoticesContainer
			className={ className }
			notices={ contextValue.notices }
			removeNotice={ contextValue.removeNotice }
			isEditor={ isEditor }
		/>
	);

	return (
		<StoreNoticesContext.Provider value={ contextValue }>
			{ createNoticeContainer && noticeOutput }
			{ children }
		</StoreNoticesContext.Provider>
	);
};

StoreNoticesProvider.propTypes = {
	className: PropTypes.string,
	createNoticeContainer: PropTypes.bool,
	children: PropTypes.node,
	context: PropTypes.string,
};
woocommerce-blocks/assets/js/base/context/providers/store-notices/index.js000064400000000121151335517650023137 0ustar00export * from './components/store-notices-container';
export * from './context';
woocommerce-blocks/assets/js/base/context/providers/index.js000064400000000504151335517650020346 0ustar00export * from './editor-context';
export * from './add-to-cart-form';
export * from './cart-checkout';
export * from './store-notices';
export * from './store-snackbar-notices';
export * from './validation';
export * from './container-width-context';
export * from './editor-context';
export * from './query-state-context';
woocommerce-blocks/assets/js/base/context/providers/cart-checkout/checkout-provider.js000064400000003533151335517650025435 0ustar00/**
 * External dependencies
 */
import { PluginArea } from '@wordpress/plugins';
import { CURRENT_USER_IS_ADMIN } from '@woocommerce/settings';
import BlockErrorBoundary from '@woocommerce/base-components/block-error-boundary';
/**
 * Internal dependencies
 */
import { PaymentMethodDataProvider } from './payment-methods';
import { ShippingDataProvider } from './shipping';
import { CustomerDataProvider } from './customer';
import { CheckoutStateProvider } from './checkout-state';
import CheckoutProcessor from './checkout-processor';

/**
 * Checkout provider
 * This wraps the checkout and provides an api interface for the checkout to
 * children via various hooks.
 *
 * @param {Object}  props               Incoming props for the provider.
 * @param {Object}  props.children      The children being wrapped.
 * @param {boolean} [props.isCart]      Whether it's rendered in the Cart
 *                                      component.
 * @param {string}  [props.redirectUrl] Initialize what the checkout will
 *                                      redirect to after successful
 *                                      submit.
 */
export const CheckoutProvider = ( {
	children,
	isCart = false,
	redirectUrl,
} ) => {
	return (
		<CheckoutStateProvider redirectUrl={ redirectUrl } isCart={ isCart }>
			<CustomerDataProvider>
				<ShippingDataProvider>
					<PaymentMethodDataProvider>
						{ children }
						{ /* If the current user is an admin, we let BlockErrorBoundary render
								the error, or we simply die silently. */ }
						<BlockErrorBoundary
							renderError={
								CURRENT_USER_IS_ADMIN ? null : () => null
							}
						>
							<PluginArea scope="woocommerce-checkout" />
						</BlockErrorBoundary>
						<CheckoutProcessor />
					</PaymentMethodDataProvider>
				</ShippingDataProvider>
			</CustomerDataProvider>
		</CheckoutStateProvider>
	);
};
woocommerce-blocks/assets/js/base/context/providers/cart-checkout/payment-methods/reducer.ts000064400000005462151335517650026564 0ustar00/**
 * Internal dependencies
 */
import {
	ACTION,
	STATUS,
	DEFAULT_PAYMENT_DATA_CONTEXT_STATE,
} from './constants';
import type { PaymentMethodDataContextState } from './types';
import type { ActionType } from './actions';

const hasSavedPaymentToken = (
	paymentMethodData: Record< string, unknown > | undefined
): boolean => {
	return !! (
		typeof paymentMethodData === 'object' && paymentMethodData.isSavedToken
	);
};

/**
 * Reducer for payment data state
 */
const reducer = (
	state = DEFAULT_PAYMENT_DATA_CONTEXT_STATE,
	{
		type,
		paymentMethodData,
		shouldSavePaymentMethod = false,
		errorMessage = '',
		paymentMethods = {},
	}: ActionType
): PaymentMethodDataContextState => {
	switch ( type ) {
		case STATUS.STARTED:
			return {
				...state,
				currentStatus: STATUS.STARTED,
				paymentMethodData: paymentMethodData || state.paymentMethodData,
				hasSavedToken: hasSavedPaymentToken(
					paymentMethodData || state.paymentMethodData
				),
			};
		case STATUS.ERROR:
			return state.currentStatus !== STATUS.ERROR
				? {
						...state,
						currentStatus: STATUS.ERROR,
						errorMessage: errorMessage || state.errorMessage,
				  }
				: state;
		case STATUS.FAILED:
			return state.currentStatus !== STATUS.FAILED
				? {
						...state,
						currentStatus: STATUS.FAILED,
						paymentMethodData:
							paymentMethodData || state.paymentMethodData,
						errorMessage: errorMessage || state.errorMessage,
				  }
				: state;
		case STATUS.SUCCESS:
			return state.currentStatus !== STATUS.SUCCESS
				? {
						...state,
						currentStatus: STATUS.SUCCESS,
						paymentMethodData:
							paymentMethodData || state.paymentMethodData,
						hasSavedToken: hasSavedPaymentToken(
							paymentMethodData || state.paymentMethodData
						),
				  }
				: state;
		case STATUS.PROCESSING:
			return state.currentStatus !== STATUS.PROCESSING
				? {
						...state,
						currentStatus: STATUS.PROCESSING,
						errorMessage: '',
				  }
				: state;
		case STATUS.COMPLETE:
			return state.currentStatus !== STATUS.COMPLETE
				? {
						...state,
						currentStatus: STATUS.COMPLETE,
				  }
				: state;

		case STATUS.PRISTINE:
			return {
				...DEFAULT_PAYMENT_DATA_CONTEXT_STATE,
				currentStatus: STATUS.PRISTINE,
				// keep payment method registration state
				paymentMethods: {
					...state.paymentMethods,
				},
				expressPaymentMethods: {
					...state.expressPaymentMethods,
				},
				shouldSavePaymentMethod: state.shouldSavePaymentMethod,
			};
		case ACTION.SET_REGISTERED_PAYMENT_METHODS:
			return {
				...state,
				paymentMethods,
			};
		case ACTION.SET_REGISTERED_EXPRESS_PAYMENT_METHODS:
			return {
				...state,
				expressPaymentMethods: paymentMethods,
			};
		case ACTION.SET_SHOULD_SAVE_PAYMENT_METHOD:
			return {
				...state,
				shouldSavePaymentMethod,
			};
	}
};

export default reducer;
assets/js/base/context/providers/cart-checkout/payment-methods/use-payment-method-registration.ts000064400000016052151335517650033306 0ustar00woocommerce-blocks/**
 * External dependencies
 */
import { __, sprintf } from '@wordpress/i18n';
import {
	getPaymentMethods,
	getExpressPaymentMethods,
} from '@woocommerce/blocks-registry';
import { useState, useEffect, useRef, useCallback } from '@wordpress/element';
import { useShallowEqual } from '@woocommerce/base-hooks';
import { CURRENT_USER_IS_ADMIN, getSetting } from '@woocommerce/settings';
import type {
	PaymentMethods,
	ExpressPaymentMethods,
	PaymentMethodConfigInstance,
	ExpressPaymentMethodConfigInstance,
} from '@woocommerce/type-defs/payments';
import { useDebouncedCallback } from 'use-debounce';

/**
 * Internal dependencies
 */
import { useEditorContext } from '../../editor-context';
import { useShippingDataContext } from '../shipping';
import { useCustomerDataContext } from '../customer';
import { useStoreCart } from '../../../hooks/cart/use-store-cart';
import { useStoreNotices } from '../../../hooks/use-store-notices';
import { useEmitResponse } from '../../../hooks/use-emit-response';
import type { PaymentMethodsDispatcherType } from './types';

/**
 * This hook handles initializing registered payment methods and exposing all
 * registered payment methods that can be used in the current environment (via
 * the payment method's `canMakePayment` property).
 *
 * @param  {function(Object):undefined} dispatcher               A dispatcher for setting registered payment methods to an external state.
 * @param  {Object}                     registeredPaymentMethods Registered payment methods to process.
 * @param  {Array}                      paymentMethodsSortOrder  Array of payment method names to sort by. This should match keys of registeredPaymentMethods.
 * @param  {string}                     noticeContext            Id of the context to append notices to.
 *
 * @return {boolean} Whether the payment methods have been initialized or not. True when all payment methods have been initialized.
 */
const usePaymentMethodRegistration = (
	dispatcher: PaymentMethodsDispatcherType,
	registeredPaymentMethods: PaymentMethods | ExpressPaymentMethods,
	paymentMethodsSortOrder: string[],
	noticeContext: string
) => {
	const [ isInitialized, setIsInitialized ] = useState( false );
	const { isEditor } = useEditorContext();
	const { selectedRates } = useShippingDataContext();
	const { billingData, shippingAddress } = useCustomerDataContext();
	const selectedShippingMethods = useShallowEqual( selectedRates );
	const paymentMethodsOrder = useShallowEqual( paymentMethodsSortOrder );
	const cart = useStoreCart();
	const { cartTotals, cartNeedsShipping, paymentRequirements } = cart;
	const canPayArgument = useRef( {
		cart,
		cartTotals,
		cartNeedsShipping,
		billingData,
		shippingAddress,
		selectedShippingMethods,
		paymentRequirements,
	} );
	const { addErrorNotice } = useStoreNotices();

	useEffect( () => {
		canPayArgument.current = {
			cart,
			cartTotals,
			cartNeedsShipping,
			billingData,
			shippingAddress,
			selectedShippingMethods,
			paymentRequirements,
		};
	}, [
		cart,
		cartTotals,
		cartNeedsShipping,
		billingData,
		shippingAddress,
		selectedShippingMethods,
		paymentRequirements,
	] );

	const refreshCanMakePayments = useCallback( async () => {
		let availablePaymentMethods = {};

		const addAvailablePaymentMethod = (
			paymentMethod:
				| PaymentMethodConfigInstance
				| ExpressPaymentMethodConfigInstance
		) => {
			availablePaymentMethods = {
				...availablePaymentMethods,
				[ paymentMethod.name ]: paymentMethod,
			};
		};

		for ( let i = 0; i < paymentMethodsOrder.length; i++ ) {
			const paymentMethodName = paymentMethodsOrder[ i ];
			const paymentMethod = registeredPaymentMethods[ paymentMethodName ];
			if ( ! paymentMethod ) {
				continue;
			}

			// See if payment method should be available. This always evaluates to true in the editor context.
			try {
				const canPay = isEditor
					? true
					: await Promise.resolve(
							paymentMethod.canMakePayment(
								canPayArgument.current
							)
					  );

				if ( canPay ) {
					if (
						typeof canPay === 'object' &&
						canPay !== null &&
						canPay.error
					) {
						throw new Error( canPay.error.message );
					}

					addAvailablePaymentMethod( paymentMethod );
				}
			} catch ( e ) {
				if ( CURRENT_USER_IS_ADMIN || isEditor ) {
					const errorText = sprintf(
						/* translators: %s the id of the payment method being registered (bank transfer, Stripe...) */
						__(
							`There was an error registering the payment method with id '%s': `,
							'woo-gutenberg-products-block'
						),
						paymentMethod.paymentMethodId
					);
					addErrorNotice( `${ errorText } ${ e }`, {
						context: noticeContext,
						id: `wc-${ paymentMethod.paymentMethodId }-registration-error`,
					} );
				}
			}
		}

		// Re-dispatch available payment methods to store.
		dispatcher( availablePaymentMethods );

		// Note: some payment methods use the `canMakePayment` callback to initialize / setup.
		// Example: Stripe CC, Stripe Payment Request.
		// That's why we track "is initialized" state here.
		setIsInitialized( true );
	}, [
		addErrorNotice,
		dispatcher,
		isEditor,
		noticeContext,
		paymentMethodsOrder,
		registeredPaymentMethods,
	] );

	const [ debouncedRefreshCanMakePayments ] = useDebouncedCallback(
		refreshCanMakePayments,
		500
	);

	// Determine which payment methods are available initially and whenever
	// shipping methods, cart or the billing data change.
	// Some payment methods (e.g. COD) can be disabled for specific shipping methods.
	useEffect( () => {
		debouncedRefreshCanMakePayments();
	}, [
		debouncedRefreshCanMakePayments,
		cart,
		selectedShippingMethods,
		billingData,
	] );

	return isInitialized;
};

/**
 * Custom hook for setting up payment methods (standard, non-express).
 *
 * @param  {function(Object):undefined} dispatcher
 *
 * @return {boolean} True when standard payment methods have been initialized.
 */
export const usePaymentMethods = (
	dispatcher: PaymentMethodsDispatcherType
): boolean => {
	const standardMethods: PaymentMethods = getPaymentMethods() as PaymentMethods;
	const { noticeContexts } = useEmitResponse();
	// Ensure all methods are present in order.
	// Some payment methods may not be present in paymentGatewaySortOrder if they
	// depend on state, e.g. COD can depend on shipping method.
	const displayOrder = new Set( [
		...( getSetting( 'paymentGatewaySortOrder', [] ) as [  ] ),
		...Object.keys( standardMethods ),
	] );
	return usePaymentMethodRegistration(
		dispatcher,
		standardMethods,
		Array.from( displayOrder ),
		noticeContexts.PAYMENTS
	);
};

/**
 * Custom hook for setting up express payment methods.
 *
 * @param  {function(Object):undefined} dispatcher
 *
 * @return {boolean} True when express payment methods have been initialized.
 */
export const useExpressPaymentMethods = (
	dispatcher: PaymentMethodsDispatcherType
): boolean => {
	const expressMethods: ExpressPaymentMethods = getExpressPaymentMethods() as ExpressPaymentMethods;
	const { noticeContexts } = useEmitResponse();
	return usePaymentMethodRegistration(
		dispatcher,
		expressMethods,
		Object.keys( expressMethods ),
		noticeContexts.EXPRESS_PAYMENTS
	);
};
assets/js/base/context/providers/cart-checkout/payment-methods/payment-method-data-context.tsx000064400000024277151335517650032575 0ustar00woocommerce-blocks/**
 * External dependencies
 */
import {
	createContext,
	useContext,
	useReducer,
	useCallback,
	useRef,
	useEffect,
	useMemo,
} from '@wordpress/element';

/**
 * Internal dependencies
 */
import type {
	CustomerPaymentMethods,
	PaymentMethodDataContextType,
} from './types';
import {
	STATUS,
	DEFAULT_PAYMENT_DATA_CONTEXT_STATE,
	DEFAULT_PAYMENT_METHOD_DATA,
} from './constants';
import reducer from './reducer';
import {
	usePaymentMethods,
	useExpressPaymentMethods,
} from './use-payment-method-registration';
import { usePaymentMethodDataDispatchers } from './use-payment-method-dispatchers';
import { useActivePaymentMethod } from './use-active-payment-method';
import { useCheckoutContext } from '../checkout-state';
import { useEditorContext } from '../../editor-context';
import {
	EMIT_TYPES,
	useEventEmitters,
	emitEventWithAbort,
	reducer as emitReducer,
} from './event-emit';
import { useValidationContext } from '../../validation';
import { useStoreNotices } from '../../../hooks/use-store-notices';
import { useEmitResponse } from '../../../hooks/use-emit-response';
import { getCustomerPaymentMethods } from './utils';

const PaymentMethodDataContext = createContext( DEFAULT_PAYMENT_METHOD_DATA );

export const usePaymentMethodDataContext = (): PaymentMethodDataContextType => {
	return useContext( PaymentMethodDataContext );
};

/**
 * PaymentMethodDataProvider is automatically included in the CheckoutDataProvider.
 *
 * This provides the api interface (via the context hook) for payment method status and data.
 *
 * @param {Object} props          Incoming props for provider
 * @param {Object} props.children The wrapped components in this provider.
 */
export const PaymentMethodDataProvider = ( {
	children,
}: {
	children: React.ReactChildren;
} ): JSX.Element => {
	const {
		isProcessing: checkoutIsProcessing,
		isIdle: checkoutIsIdle,
		isCalculating: checkoutIsCalculating,
		hasError: checkoutHasError,
	} = useCheckoutContext();
	const { isEditor, getPreviewData } = useEditorContext();
	const { setValidationErrors } = useValidationContext();
	const { addErrorNotice, removeNotice } = useStoreNotices();
	const {
		isSuccessResponse,
		isErrorResponse,
		isFailResponse,
		noticeContexts,
	} = useEmitResponse();
	const [ observers, observerDispatch ] = useReducer( emitReducer, {} );
	const { onPaymentProcessing } = useEventEmitters( observerDispatch );
	const currentObservers = useRef( observers );

	// ensure observers are always current.
	useEffect( () => {
		currentObservers.current = observers;
	}, [ observers ] );

	const [ paymentData, dispatch ] = useReducer(
		reducer,
		DEFAULT_PAYMENT_DATA_CONTEXT_STATE
	);
	const {
		dispatchActions,
		setPaymentStatus,
	} = usePaymentMethodDataDispatchers( dispatch );

	const paymentMethodsInitialized = usePaymentMethods(
		dispatchActions.setRegisteredPaymentMethods
	);

	const expressPaymentMethodsInitialized = useExpressPaymentMethods(
		dispatchActions.setRegisteredExpressPaymentMethods
	);

	const {
		activePaymentMethod,
		activeSavedToken,
		setActivePaymentMethod,
		setActiveSavedToken,
	} = useActivePaymentMethod();

	const customerPaymentMethods = useMemo( (): CustomerPaymentMethods => {
		if ( isEditor ) {
			return getPreviewData(
				'previewSavedPaymentMethods'
			) as CustomerPaymentMethods;
		}
		return paymentMethodsInitialized
			? getCustomerPaymentMethods( paymentData.paymentMethods )
			: {};
	}, [
		isEditor,
		getPreviewData,
		paymentMethodsInitialized,
		paymentData.paymentMethods,
	] );

	const setExpressPaymentError = useCallback(
		( message ) => {
			if ( message ) {
				addErrorNotice( message, {
					id: 'wc-express-payment-error',
					context: noticeContexts.EXPRESS_PAYMENTS,
				} );
			} else {
				removeNotice(
					'wc-express-payment-error',
					noticeContexts.EXPRESS_PAYMENTS
				);
			}
		},
		[ addErrorNotice, noticeContexts.EXPRESS_PAYMENTS, removeNotice ]
	);

	const isExpressPaymentMethodActive = Object.keys(
		paymentData.expressPaymentMethods
	).includes( activePaymentMethod );

	const currentStatus = useMemo(
		() => ( {
			isPristine: paymentData.currentStatus === STATUS.PRISTINE,
			isStarted: paymentData.currentStatus === STATUS.STARTED,
			isProcessing: paymentData.currentStatus === STATUS.PROCESSING,
			isFinished: [
				STATUS.ERROR,
				STATUS.FAILED,
				STATUS.SUCCESS,
			].includes( paymentData.currentStatus ),
			hasError: paymentData.currentStatus === STATUS.ERROR,
			hasFailed: paymentData.currentStatus === STATUS.FAILED,
			isSuccessful: paymentData.currentStatus === STATUS.SUCCESS,
			isDoingExpressPayment:
				paymentData.currentStatus !== STATUS.PRISTINE &&
				isExpressPaymentMethodActive,
		} ),
		[ paymentData.currentStatus, isExpressPaymentMethodActive ]
	);

	// Update the active (selected) payment method when it is empty, or invalid.
	useEffect( () => {
		const paymentMethodKeys = Object.keys( paymentData.paymentMethods );
		const allPaymentMethodKeys = [
			...paymentMethodKeys,
			...Object.keys( paymentData.expressPaymentMethods ),
		];
		if ( ! paymentMethodsInitialized || ! paymentMethodKeys.length ) {
			return;
		}

		setActivePaymentMethod( ( currentActivePaymentMethod ) => {
			// If there's no active payment method, or the active payment method has
			// been removed (e.g. COD vs shipping methods), set one as active.
			// Note: It's possible that the active payment method might be an
			// express payment method. So registered express payment methods are
			// included in the check here.
			if (
				! currentActivePaymentMethod ||
				! allPaymentMethodKeys.includes( currentActivePaymentMethod )
			) {
				setPaymentStatus().pristine();
				return Object.keys( paymentData.paymentMethods )[ 0 ];
			}
			return currentActivePaymentMethod;
		} );
	}, [
		paymentMethodsInitialized,
		paymentData.paymentMethods,
		paymentData.expressPaymentMethods,
		setActivePaymentMethod,
		setPaymentStatus,
	] );

	// flip payment to processing if checkout processing is complete, there are no errors, and payment status is started.
	useEffect( () => {
		if (
			checkoutIsProcessing &&
			! checkoutHasError &&
			! checkoutIsCalculating &&
			! currentStatus.isFinished
		) {
			setPaymentStatus().processing();
		}
	}, [
		checkoutIsProcessing,
		checkoutHasError,
		checkoutIsCalculating,
		currentStatus.isFinished,
		setPaymentStatus,
	] );

	// When checkout is returned to idle, set payment status to pristine but only if payment status is already not finished.
	useEffect( () => {
		if ( checkoutIsIdle && ! currentStatus.isSuccessful ) {
			setPaymentStatus().pristine();
		}
	}, [ checkoutIsIdle, currentStatus.isSuccessful, setPaymentStatus ] );

	// if checkout has an error and payment is not being made with a saved token and payment status is success, then let's sync payment status back to pristine.
	useEffect( () => {
		if (
			checkoutHasError &&
			currentStatus.isSuccessful &&
			! paymentData.hasSavedToken
		) {
			setPaymentStatus().pristine();
		}
	}, [
		checkoutHasError,
		currentStatus.isSuccessful,
		paymentData.hasSavedToken,
		setPaymentStatus,
	] );

	useEffect( () => {
		// Note: the nature of this event emitter is that it will bail on any
		// observer that returns a response that !== true. However, this still
		// allows for other observers that return true for continuing through
		// to the next observer (or bailing if there's a problem).
		if ( currentStatus.isProcessing ) {
			removeNotice( 'wc-payment-error', noticeContexts.PAYMENTS );
			emitEventWithAbort(
				currentObservers.current,
				EMIT_TYPES.PAYMENT_PROCESSING,
				{}
			).then( ( observerResponses ) => {
				let successResponse, errorResponse;
				observerResponses.forEach( ( response ) => {
					if ( isSuccessResponse( response ) ) {
						// the last observer response always "wins" for success.
						successResponse = response;
					}
					if (
						isErrorResponse( response ) ||
						isFailResponse( response )
					) {
						errorResponse = response;
					}
				} );
				if ( successResponse && ! errorResponse ) {
					setPaymentStatus().success(
						successResponse?.meta?.paymentMethodData,
						successResponse?.meta?.billingData,
						successResponse?.meta?.shippingData
					);
				} else if ( errorResponse && isFailResponse( errorResponse ) ) {
					if (
						errorResponse.message &&
						errorResponse.message.length
					) {
						addErrorNotice( errorResponse.message, {
							id: 'wc-payment-error',
							isDismissible: false,
							context:
								errorResponse?.messageContext ||
								noticeContexts.PAYMENTS,
						} );
					}
					setPaymentStatus().failed(
						errorResponse?.message,
						errorResponse?.meta?.paymentMethodData,
						errorResponse?.meta?.billingData
					);
				} else if ( errorResponse ) {
					if (
						errorResponse.message &&
						errorResponse.message.length
					) {
						addErrorNotice( errorResponse.message, {
							id: 'wc-payment-error',
							isDismissible: false,
							context:
								errorResponse?.messageContext ||
								noticeContexts.PAYMENTS,
						} );
					}
					setPaymentStatus().error( errorResponse.message );
					setValidationErrors( errorResponse?.validationErrors );
				} else {
					// otherwise there are no payment methods doing anything so
					// just consider success
					setPaymentStatus().success();
				}
			} );
		}
	}, [
		currentStatus.isProcessing,
		setValidationErrors,
		setPaymentStatus,
		removeNotice,
		noticeContexts.PAYMENTS,
		isSuccessResponse,
		isFailResponse,
		isErrorResponse,
		addErrorNotice,
	] );

	const paymentContextData: PaymentMethodDataContextType = {
		setPaymentStatus,
		currentStatus,
		paymentStatuses: STATUS,
		paymentMethodData: paymentData.paymentMethodData,
		errorMessage: paymentData.errorMessage,
		activePaymentMethod,
		setActivePaymentMethod,
		activeSavedToken,
		setActiveSavedToken,
		onPaymentProcessing,
		customerPaymentMethods,
		paymentMethods: paymentData.paymentMethods,
		expressPaymentMethods: paymentData.expressPaymentMethods,
		paymentMethodsInitialized,
		expressPaymentMethodsInitialized,
		setExpressPaymentError,
		isExpressPaymentMethodActive,
		shouldSavePayment: paymentData.shouldSavePaymentMethod,
		setShouldSavePayment: dispatchActions.setShouldSavePayment,
	};

	return (
		<PaymentMethodDataContext.Provider value={ paymentContextData }>
			{ children }
		</PaymentMethodDataContext.Provider>
	);
};
woocommerce-blocks/assets/js/base/context/providers/cart-checkout/payment-methods/event-emit.ts000064400000002404151335517650027201 0ustar00/**
 * External dependencies
 */
import { useMemo } from '@wordpress/element';

/**
 * Internal dependencies
 */
import {
	reducer,
	emitEvent,
	emitEventWithAbort,
	emitterCallback,
	ActionType,
} from '../../../event-emit';

const EMIT_TYPES = {
	PAYMENT_PROCESSING: 'payment_processing',
};

type EventEmittersType = Record< string, ReturnType< typeof emitterCallback > >;

/**
 * Receives a reducer dispatcher and returns an object with the
 * various event emitters for the payment processing events.
 *
 * Calling the event registration function with the callback will register it
 * for the event emitter and will return a dispatcher for removing the
 * registered callback (useful for implementation in `useEffect`).
 *
 * @param {Function} observerDispatch The emitter reducer dispatcher.
 * @return {Object} An object with the various payment event emitter registration functions
 */
const useEventEmitters = (
	observerDispatch: React.Dispatch< ActionType >
): EventEmittersType => {
	const eventEmitters = useMemo(
		() => ( {
			onPaymentProcessing: emitterCallback(
				EMIT_TYPES.PAYMENT_PROCESSING,
				observerDispatch
			),
		} ),
		[ observerDispatch ]
	);
	return eventEmitters;
};

export { EMIT_TYPES, useEventEmitters, reducer, emitEvent, emitEventWithAbort };
woocommerce-blocks/assets/js/base/context/providers/cart-checkout/payment-methods/utils.ts000064400000002221151335517650026261 0ustar00/**
 * External dependencies
 */
import { getSetting } from '@woocommerce/settings';

/**
 * Internal dependencies
 */
import type { PaymentMethods, CustomerPaymentMethod } from './types';

/**
 * Gets the payment methods saved for the current user after filtering out disabled ones.
 */
export const getCustomerPaymentMethods = (
	availablePaymentMethods: PaymentMethods = {}
): Record< string, CustomerPaymentMethod > => {
	if ( Object.keys( availablePaymentMethods ).length === 0 ) {
		return {};
	}
	const customerPaymentMethods = getSetting( 'customerPaymentMethods', {} );
	const paymentMethodKeys = Object.keys( customerPaymentMethods );
	const enabledCustomerPaymentMethods = {} as Record<
		string,
		CustomerPaymentMethod
	>;
	paymentMethodKeys.forEach( ( type ) => {
		const methods = customerPaymentMethods[ type ].filter(
			( {
				method: { gateway },
			}: {
				method: {
					gateway: string;
				};
			} ) =>
				gateway in availablePaymentMethods &&
				availablePaymentMethods[ gateway ].supports?.showSavedCards
		);
		if ( methods.length ) {
			enabledCustomerPaymentMethods[ type ] = methods;
		}
	} );
	return enabledCustomerPaymentMethods;
};
assets/js/base/context/providers/cart-checkout/payment-methods/use-payment-method-dispatchers.ts000064400000005041151335517650033101 0ustar00woocommerce-blocks/**
 * External dependencies
 */
import { useCallback, useMemo } from '@wordpress/element';

/**
 * Internal dependencies
 */
import { actions, ActionType } from './actions';
import { STATUS } from './constants';
import { useCustomerDataContext } from '../customer';
import { useShippingDataContext } from '../shipping';
import type {
	PaymentStatusDispatchers,
	PaymentMethodDispatchers,
} from './types';

export const usePaymentMethodDataDispatchers = (
	dispatch: React.Dispatch< ActionType >
): {
	dispatchActions: PaymentMethodDispatchers;
	setPaymentStatus: () => PaymentStatusDispatchers;
} => {
	const { setBillingData } = useCustomerDataContext();
	const { setShippingAddress } = useShippingDataContext();

	const dispatchActions = useMemo(
		(): PaymentMethodDispatchers => ( {
			setRegisteredPaymentMethods: ( paymentMethods ) =>
				void dispatch(
					actions.setRegisteredPaymentMethods( paymentMethods )
				),
			setRegisteredExpressPaymentMethods: ( paymentMethods ) =>
				void dispatch(
					actions.setRegisteredExpressPaymentMethods( paymentMethods )
				),
			setShouldSavePayment: ( shouldSave ) =>
				void dispatch(
					actions.setShouldSavePaymentMethod( shouldSave )
				),
		} ),
		[ dispatch ]
	);

	const setPaymentStatus = useCallback(
		(): PaymentStatusDispatchers => ( {
			pristine: () => dispatch( actions.statusOnly( STATUS.PRISTINE ) ),
			started: ( paymentMethodData ) => {
				dispatch(
					actions.started( {
						paymentMethodData,
					} )
				);
			},
			processing: () =>
				dispatch( actions.statusOnly( STATUS.PROCESSING ) ),
			completed: () => dispatch( actions.statusOnly( STATUS.COMPLETE ) ),
			error: ( errorMessage ) =>
				dispatch( actions.error( errorMessage ) ),
			failed: (
				errorMessage,
				paymentMethodData,
				billingData = undefined
			) => {
				if ( billingData ) {
					setBillingData( billingData );
				}
				dispatch(
					actions.failed( {
						errorMessage: errorMessage || '',
						paymentMethodData: paymentMethodData || {},
					} )
				);
			},
			success: (
				paymentMethodData,
				billingData = undefined,
				shippingData = undefined
			) => {
				if ( billingData ) {
					setBillingData( billingData );
				}
				if (
					typeof shippingData !== undefined &&
					shippingData?.address
				) {
					setShippingAddress(
						shippingData.address as Record< string, unknown >
					);
				}
				dispatch(
					actions.success( {
						paymentMethodData,
					} )
				);
			},
		} ),
		[ dispatch, setBillingData, setShippingAddress ]
	);

	return {
		dispatchActions,
		setPaymentStatus,
	};
};
woocommerce-blocks/assets/js/base/context/providers/cart-checkout/payment-methods/types.ts000064400000011276151335517650026277 0ustar00/**
 * External dependencies
 */
import {
	PaymentMethodConfiguration,
	PaymentMethods,
	ExpressPaymentMethods,
} from '@woocommerce/type-defs/payments';
import type {
	EmptyObjectType,
	ObjectType,
} from '@woocommerce/type-defs/objects';
/**
 * Internal dependencies
 */
import type { emitterCallback } from '../../../event-emit';
import { STATUS } from './constants';

export interface CustomerPaymentMethod {
	method: PaymentMethodConfiguration;
	expires: string;
	is_default: boolean;
	tokenId: number;
	actions: ObjectType;
}
export type CustomerPaymentMethods =
	| Record< string, CustomerPaymentMethod >
	| EmptyObjectType;

export type PaymentMethodDispatchers = {
	setRegisteredPaymentMethods: ( paymentMethods: PaymentMethods ) => void;
	setRegisteredExpressPaymentMethods: (
		paymentMethods: ExpressPaymentMethods
	) => void;
	setShouldSavePayment: ( shouldSave: boolean ) => void;
};

export interface PaymentStatusDispatchers {
	pristine: () => void;
	started: ( paymentMethodData?: ObjectType | EmptyObjectType ) => void;
	processing: () => void;
	completed: () => void;
	error: ( error: string ) => void;
	failed: (
		error?: string,
		paymentMethodData?: ObjectType | EmptyObjectType,
		billingData?: ObjectType | EmptyObjectType
	) => void;
	success: (
		paymentMethodData?: ObjectType | EmptyObjectType,
		billingData?: ObjectType | EmptyObjectType,
		shippingData?: ObjectType | EmptyObjectType
	) => void;
}

export interface PaymentMethodDataContextState {
	currentStatus: STATUS;
	shouldSavePaymentMethod: boolean;
	paymentMethodData: ObjectType | EmptyObjectType;
	hasSavedToken: boolean;
	errorMessage: string;
	paymentMethods: PaymentMethods;
	expressPaymentMethods: ExpressPaymentMethods;
}

export type PaymentMethodCurrentStatusType = {
	// If true then the payment method state in checkout is pristine.
	isPristine: boolean;
	// If true then the payment method has been initialized and has started.
	isStarted: boolean;
	// If true then the payment method is processing payment.
	isProcessing: boolean;
	// If true then the payment method is in a finished state (which may mean it's status is either error, failed, or success).
	isFinished: boolean;
	// If true then the payment method is in an error state.
	hasError: boolean;
	// If true then the payment method has failed (usually indicates a problem with the payment method used, not logic error).
	hasFailed: boolean;
	// If true then the payment method has completed it's processing successfully.
	isSuccessful: boolean;
	// If true, an express payment is in progress.
	isDoingExpressPayment: boolean;
};

export type PaymentMethodDataContextType = {
	// Sets the payment status for the payment method.
	setPaymentStatus: () => PaymentStatusDispatchers;
	// The current payment status.
	currentStatus: PaymentMethodCurrentStatusType;
	// An object of payment status constants.
	paymentStatuses: ObjectType;
	// Arbitrary data to be passed along for processing by the payment method on the server.
	paymentMethodData: ObjectType | EmptyObjectType;
	// An error message provided by the payment method if there is an error.
	errorMessage: string;
	// The active payment method slug.
	activePaymentMethod: string;
	// A function for setting the active payment method.
	setActivePaymentMethod: ( paymentMethod: string ) => void;
	// Current active token.
	activeSavedToken: string;
	// A function for setting the active payment method token.
	setActiveSavedToken: ( activeSavedToken: string ) => void;
	// Returns the customer payment for the customer if it exists.
	customerPaymentMethods:
		| Record< string, CustomerPaymentMethod >
		| EmptyObjectType;
	// Registered payment methods.
	paymentMethods: PaymentMethods;
	// Registered express payment methods.
	expressPaymentMethods: ExpressPaymentMethods;
	// True when all registered payment methods have been initialized.
	paymentMethodsInitialized: boolean;
	// True when all registered express payment methods have been initialized.
	expressPaymentMethodsInitialized: boolean;
	// Event registration callback for registering observers for the payment processing event.
	onPaymentProcessing: ReturnType< typeof emitterCallback >;
	// A function used by express payment methods to indicate an error for checkout to handle. It receives an error message string. Does not change payment status.
	setExpressPaymentError: ( error: string ) => void;
	// True if an express payment method is active.
	isExpressPaymentMethodActive: boolean;
	// A function used to set the shouldSavePayment value.
	setShouldSavePayment: ( shouldSavePayment: boolean ) => void;
	// True means that the configured payment method option is saved for the customer.
	shouldSavePayment: boolean;
};

export type PaymentMethodsDispatcherType = (
	paymentMethods: PaymentMethods
) => undefined;
assets/js/base/context/providers/cart-checkout/payment-methods/test/payment-method-data-context.js000064400000015734151335517650033350 0ustar00woocommerce-blocks/**
 * External dependencies
 */
import { render, screen, fireEvent, waitFor } from '@testing-library/react';
import { previewCart } from '@woocommerce/resource-previews';
import { dispatch } from '@wordpress/data';
import { CART_STORE_KEY as storeKey } from '@woocommerce/block-data';
import {
	registerPaymentMethod,
	registerExpressPaymentMethod,
	__experimentalDeRegisterPaymentMethod,
	__experimentalDeRegisterExpressPaymentMethod,
} from '@woocommerce/blocks-registry';
import { default as fetchMock } from 'jest-fetch-mock';

/**
 * Internal dependencies
 */
import {
	usePaymentMethodDataContext,
	PaymentMethodDataProvider,
} from '../payment-method-data-context';
import {
	CheckoutExpressPayment,
	SavedPaymentMethodOptions,
} from '../../../../../../blocks/cart-checkout/payment-methods';
import { defaultCartState } from '../../../../../../data/default-states';

jest.mock( '@woocommerce/settings', () => {
	const originalModule = jest.requireActual( '@woocommerce/settings' );

	return {
		// @ts-ignore We know @woocommerce/settings is an object.
		...originalModule,
		getSetting: ( setting, ...rest ) => {
			if ( setting === 'customerPaymentMethods' ) {
				return {
					cc: [
						{
							method: {
								gateway: 'stripe',
								last4: '4242',
								brand: 'Visa',
							},
							expires: '12/22',
							is_default: true,
							tokenId: 1,
						},
					],
				};
			}
			return originalModule.getSetting( setting, ...rest );
		},
	};
} );

const registerMockPaymentMethods = () => {
	[ 'cheque', 'bacs' ].forEach( ( name ) => {
		registerPaymentMethod( {
			name,
			label: name,
			content: <div>A payment method</div>,
			edit: <div>A payment method</div>,
			icons: null,
			canMakePayment: () => true,
			supports: {
				features: [ 'products' ],
			},
			ariaLabel: name,
		} );
	} );
	[ 'stripe' ].forEach( ( name ) => {
		registerPaymentMethod( {
			name,
			label: name,
			content: <div>A payment method</div>,
			edit: <div>A payment method</div>,
			icons: null,
			canMakePayment: () => true,
			supports: {
				showSavedCards: true,
				showSaveOption: true,
				features: [ 'products' ],
			},
			ariaLabel: name,
		} );
	} );
	[ 'express-payment' ].forEach( ( name ) => {
		const Content = ( {
			onClose = () => void null,
			onClick = () => void null,
		} ) => {
			return (
				<>
					<button onClick={ onClick }>
						{ name + ' express payment method' }
					</button>
					<button onClick={ onClose }>
						{ name + ' express payment method close' }
					</button>
				</>
			);
		};
		registerExpressPaymentMethod( {
			name,
			content: <Content />,
			edit: <div>An express payment method</div>,
			canMakePayment: () => true,
			paymentMethodId: name,
			supports: {
				features: [ 'products' ],
			},
		} );
	} );
};

const resetMockPaymentMethods = () => {
	[ 'cheque', 'bacs', 'stripe' ].forEach( ( name ) => {
		__experimentalDeRegisterPaymentMethod( name );
	} );
	[ 'express-payment' ].forEach( ( name ) => {
		__experimentalDeRegisterExpressPaymentMethod( name );
	} );
};

describe( 'Testing Payment Method Data Context Provider', () => {
	beforeEach( async () => {
		registerMockPaymentMethods();
		fetchMock.mockResponse( ( req ) => {
			if ( req.url.match( /wc\/store\/cart/ ) ) {
				return Promise.resolve( JSON.stringify( previewCart ) );
			}
			return Promise.resolve( '' );
		} );
		// need to clear the store resolution state between tests.
		await dispatch( storeKey ).invalidateResolutionForStore();
		await dispatch( storeKey ).receiveCart( defaultCartState.cartData );
	} );
	afterEach( async () => {
		resetMockPaymentMethods();
		fetchMock.resetMocks();
	} );
	it( 'toggles active payment method correctly for express payment activation and close', async () => {
		const TriggerActiveExpressPaymentMethod = () => {
			const { activePaymentMethod } = usePaymentMethodDataContext();
			return (
				<>
					<CheckoutExpressPayment />
					{ 'Active Payment Method: ' + activePaymentMethod }
				</>
			);
		};
		const TestComponent = () => {
			return (
				<PaymentMethodDataProvider>
					<TriggerActiveExpressPaymentMethod />
				</PaymentMethodDataProvider>
			);
		};
		render( <TestComponent /> );
		// should initialize by default the first payment method.
		await waitFor( () => {
			const activePaymentMethod = screen.queryByText(
				/Active Payment Method: cheque/
			);
			expect( activePaymentMethod ).not.toBeNull();
		} );
		// Express payment method clicked.
		fireEvent.click(
			screen.getByText( 'express-payment express payment method' )
		);
		await waitFor( () => {
			const activePaymentMethod = screen.queryByText(
				/Active Payment Method: express-payment/
			);
			expect( activePaymentMethod ).not.toBeNull();
		} );
		// Express payment method closed.
		fireEvent.click(
			screen.getByText( 'express-payment express payment method close' )
		);
		await waitFor( () => {
			const activePaymentMethod = screen.queryByText(
				/Active Payment Method: cheque/
			);
			expect( activePaymentMethod ).not.toBeNull();
		} );
		// ["`select` control in `@wordpress/data-controls` is deprecated. Please use built-in `resolveSelect` control in `@wordpress/data` instead."]
		expect( console ).toHaveWarned();
	} );

	it( 'resets saved payment method data after starting and closing an express payment method', async () => {
		const TriggerActiveExpressPaymentMethod = () => {
			const {
				activePaymentMethod,
				paymentMethodData,
			} = usePaymentMethodDataContext();
			return (
				<>
					<CheckoutExpressPayment />
					<SavedPaymentMethodOptions onChange={ () => void null } />
					{ 'Active Payment Method: ' + activePaymentMethod }
					{ paymentMethodData[ 'wc-stripe-payment-token' ] && (
						<span>Stripe token</span>
					) }
				</>
			);
		};
		const TestComponent = () => {
			return (
				<PaymentMethodDataProvider>
					<TriggerActiveExpressPaymentMethod />
				</PaymentMethodDataProvider>
			);
		};
		render( <TestComponent /> );
		// Should initialize by default the default saved payment method.
		await waitFor( () => {
			const activePaymentMethod = screen.queryByText(
				/Active Payment Method: stripe/
			);
			const stripeToken = screen.queryByText( /Stripe token/ );
			expect( activePaymentMethod ).not.toBeNull();
			expect( stripeToken ).not.toBeNull();
		} );
		// Express payment method clicked.
		fireEvent.click(
			screen.getByText( 'express-payment express payment method' )
		);
		await waitFor( () => {
			const activePaymentMethod = screen.queryByText(
				/Active Payment Method: express-payment/
			);
			const stripeToken = screen.queryByText( /Stripe token/ );
			expect( activePaymentMethod ).not.toBeNull();
			expect( stripeToken ).toBeNull();
		} );
		// Express payment method closed.
		fireEvent.click(
			screen.getByText( 'express-payment express payment method close' )
		);
		await waitFor( () => {
			const activePaymentMethod = screen.queryByText(
				/Active Payment Method: stripe/
			);
			const stripeToken = screen.queryByText( /Stripe token/ );
			expect( activePaymentMethod ).not.toBeNull();
			expect( stripeToken ).not.toBeNull();
		} );
	} );
} );
woocommerce-blocks/assets/js/base/context/providers/cart-checkout/payment-methods/actions.ts000064400000003524151335517650026570 0ustar00/**
 * External dependencies
 */
import {
	PaymentMethods,
	ExpressPaymentMethods,
} from '@woocommerce/type-defs/payments';

/**
 * Internal dependencies
 */
import { ACTION, STATUS } from './constants';

export interface ActionType {
	type: ACTION | STATUS;
	errorMessage?: string;
	paymentMethodData?: Record< string, unknown >;
	paymentMethods?: PaymentMethods | ExpressPaymentMethods;
	shouldSavePaymentMethod?: boolean;
}

/**
 * All the actions that can be dispatched for payment methods.
 */
export const actions = {
	statusOnly: ( type: STATUS ): { type: STATUS } => ( { type } as const ),
	error: ( errorMessage: string ): ActionType =>
		( {
			type: STATUS.ERROR,
			errorMessage,
		} as const ),
	failed: ( {
		errorMessage,
		paymentMethodData,
	}: {
		errorMessage: string;
		paymentMethodData: Record< string, unknown >;
	} ): ActionType =>
		( {
			type: STATUS.FAILED,
			errorMessage,
			paymentMethodData,
		} as const ),
	success: ( {
		paymentMethodData,
	}: {
		paymentMethodData?: Record< string, unknown >;
	} ): ActionType =>
		( {
			type: STATUS.SUCCESS,
			paymentMethodData,
		} as const ),
	started: ( {
		paymentMethodData,
	}: {
		paymentMethodData?: Record< string, unknown >;
	} ): ActionType =>
		( {
			type: STATUS.STARTED,
			paymentMethodData,
		} as const ),
	setRegisteredPaymentMethods: (
		paymentMethods: PaymentMethods
	): ActionType =>
		( {
			type: ACTION.SET_REGISTERED_PAYMENT_METHODS,
			paymentMethods,
		} as const ),
	setRegisteredExpressPaymentMethods: (
		paymentMethods: ExpressPaymentMethods
	): ActionType =>
		( {
			type: ACTION.SET_REGISTERED_EXPRESS_PAYMENT_METHODS,
			paymentMethods,
		} as const ),
	setShouldSavePaymentMethod: (
		shouldSavePaymentMethod: boolean
	): ActionType =>
		( {
			type: ACTION.SET_SHOULD_SAVE_PAYMENT_METHOD,
			shouldSavePaymentMethod,
		} as const ),
};

export default actions;
assets/js/base/context/providers/cart-checkout/payment-methods/use-active-payment-method.ts000064400000002132151335517650032041 0ustar00woocommerce-blocks/**
 * External dependencies
 */
import { useState, useEffect } from '@wordpress/element';

/**
 * Internal dependencies
 */
import { useStoreEvents } from '../../../hooks/use-store-events';

export const useActivePaymentMethod = (): {
	activePaymentMethod: string;
	activeSavedToken: string;
	setActivePaymentMethod: React.Dispatch< React.SetStateAction< string > >;
	setActiveSavedToken: ( token: string ) => void;
} => {
	const { dispatchCheckoutEvent } = useStoreEvents();

	// The active payment method - e.g. Stripe CC or BACS.
	const [ activePaymentMethod, setActivePaymentMethod ] = useState( '' );

	// If a previously saved payment method is active, the token for that method. For example, a for a Stripe CC card saved to user account.
	const [ activeSavedToken, setActiveSavedToken ] = useState( '' );

	// Trigger event on change.
	useEffect( () => {
		dispatchCheckoutEvent( 'set-active-payment-method', {
			activePaymentMethod,
		} );
	}, [ dispatchCheckoutEvent, activePaymentMethod ] );

	return {
		activePaymentMethod,
		activeSavedToken,
		setActivePaymentMethod,
		setActiveSavedToken,
	};
};
woocommerce-blocks/assets/js/base/context/providers/cart-checkout/payment-methods/index.ts000064400000000153151335517650026232 0ustar00export {
	PaymentMethodDataProvider,
	usePaymentMethodDataContext,
} from './payment-method-data-context';
woocommerce-blocks/assets/js/base/context/providers/cart-checkout/payment-methods/constants.ts000064400000004230151335517650027137 0ustar00/**
 * Internal dependencies
 */
import type {
	PaymentMethodDataContextType,
	PaymentMethodDataContextState,
} from './types';

export enum STATUS {
	PRISTINE = 'pristine',
	STARTED = 'started',
	PROCESSING = 'processing',
	ERROR = 'has_error',
	FAILED = 'failed',
	SUCCESS = 'success',
	COMPLETE = 'complete',
}

export enum ACTION {
	SET_REGISTERED_PAYMENT_METHODS = 'set_registered_payment_methods',
	SET_REGISTERED_EXPRESS_PAYMENT_METHODS = 'set_registered_express_payment_methods',
	SET_SHOULD_SAVE_PAYMENT_METHOD = 'set_should_save_payment_method',
}

// Note - if fields are added/shape is changed, you may want to update PRISTINE reducer clause to preserve your new field.
export const DEFAULT_PAYMENT_DATA_CONTEXT_STATE: PaymentMethodDataContextState = {
	currentStatus: STATUS.PRISTINE,
	shouldSavePaymentMethod: false,
	paymentMethodData: {
		payment_method: '',
	},
	hasSavedToken: false,
	errorMessage: '',
	paymentMethods: {},
	expressPaymentMethods: {},
};

export const DEFAULT_PAYMENT_METHOD_DATA: PaymentMethodDataContextType = {
	setPaymentStatus: () => ( {
		pristine: () => void null,
		started: () => void null,
		processing: () => void null,
		completed: () => void null,
		error: ( errorMessage: string ) => void errorMessage,
		failed: ( errorMessage, paymentMethodData ) =>
			void [ errorMessage, paymentMethodData ],
		success: ( paymentMethodData, billingData ) =>
			void [ paymentMethodData, billingData ],
	} ),
	currentStatus: {
		isPristine: true,
		isStarted: false,
		isProcessing: false,
		isFinished: false,
		hasError: false,
		hasFailed: false,
		isSuccessful: false,
		isDoingExpressPayment: false,
	},
	paymentStatuses: STATUS,
	paymentMethodData: {},
	errorMessage: '',
	activePaymentMethod: '',
	setActivePaymentMethod: () => void null,
	activeSavedToken: '',
	setActiveSavedToken: () => void null,
	customerPaymentMethods: {},
	paymentMethods: {},
	expressPaymentMethods: {},
	paymentMethodsInitialized: false,
	expressPaymentMethodsInitialized: false,
	onPaymentProcessing: () => () => () => void null,
	setExpressPaymentError: () => void null,
	isExpressPaymentMethodActive: false,
	setShouldSavePayment: () => void null,
	shouldSavePayment: false,
};
woocommerce-blocks/assets/js/base/context/providers/cart-checkout/index.js000064400000000340151335517650023100 0ustar00export * from './payment-methods';
export * from './shipping';
export * from './customer';
export * from './checkout-state';
export * from './cart';
export * from './checkout-processor';
export * from './checkout-provider';
woocommerce-blocks/assets/js/base/context/providers/cart-checkout/shipping/constants.js000064400000002770151335517650025637 0ustar00/**
 * @typedef {import('@woocommerce/type-defs/contexts').ShippingErrorTypes} ShippingErrorTypes
 * @typedef {import('@woocommerce/type-defs/shipping').ShippingAddress} ShippingAddress
 * @typedef {import('@woocommerce/type-defs/contexts').ShippingDataContext} ShippingDataContext
 */

/**
 * @type {ShippingErrorTypes}
 */
export const ERROR_TYPES = {
	NONE: 'none',
	INVALID_ADDRESS: 'invalid_address',
	UNKNOWN: 'unknown_error',
};

export const shippingErrorCodes = {
	INVALID_COUNTRY: 'woocommerce_rest_cart_shipping_rates_invalid_country',
	MISSING_COUNTRY: 'woocommerce_rest_cart_shipping_rates_missing_country',
	INVALID_STATE: 'woocommerce_rest_cart_shipping_rates_invalid_state',
};

/**
 * @type {ShippingAddress}
 */
export const DEFAULT_SHIPPING_ADDRESS = {
	first_name: '',
	last_name: '',
	company: '',
	address_1: '',
	address_2: '',
	city: '',
	state: '',
	postcode: '',
	country: '',
};

/**
 * @type {ShippingDataContext}
 */
export const DEFAULT_SHIPPING_CONTEXT_DATA = {
	shippingErrorStatus: {
		isPristine: true,
		isValid: false,
		hasInvalidAddress: false,
		hasError: false,
	},
	dispatchErrorStatus: () => null,
	shippingErrorTypes: ERROR_TYPES,
	shippingRates: [],
	shippingRatesLoading: false,
	selectedRates: [],
	setSelectedRates: () => null,
	shippingAddress: DEFAULT_SHIPPING_ADDRESS,
	setShippingAddress: () => null,
	onShippingRateSuccess: () => null,
	onShippingRateFail: () => null,
	onShippingRateSelectSuccess: () => null,
	onShippingRateSelectFail: () => null,
	needsShipping: false,
};
woocommerce-blocks/assets/js/base/context/providers/cart-checkout/shipping/reducers.js000064400000000644151335517650025435 0ustar00/**
 * Internal dependencies
 */
import { ERROR_TYPES } from './constants';

/**
 * Reducer for shipping status state
 *
 * @param {string} state  The current status.
 * @param {Object} action The incoming action.
 * @param {string} action.type The type of action.
 */
export const errorStatusReducer = ( state, { type } ) => {
	if ( Object.values( ERROR_TYPES ).includes( type ) ) {
		return type;
	}
	return state;
};
woocommerce-blocks/assets/js/base/context/providers/cart-checkout/shipping/event-emit.js000064400000002445151335517650025677 0ustar00/**
 * Internal dependencies
 */
import { emitterCallback, reducer, emitEvent } from '../../../event-emit';

const EMIT_TYPES = {
	SHIPPING_RATES_SUCCESS: 'shipping_rates_success',
	SHIPPING_RATES_FAIL: 'shipping_rates_fail',
	SHIPPING_RATE_SELECT_SUCCESS: 'shipping_rate_select_success',
	SHIPPING_RATE_SELECT_FAIL: 'shipping_rate_select_fail',
};

/**
 * Receives a reducer dispatcher and returns an object with the onSuccess and
 * onFail callback registration points for the shipping option emit events.
 *
 * Calling the event registration function with the callback will register it
 * for the event emitter and will return a dispatcher for removing the
 * registered callback (useful for implementation in `useEffect`).
 *
 * @param {Function} dispatcher A reducer dispatcher
 * @return {Object} An object with `onSuccess` and `onFail` emitter registration.
 */
const emitterObservers = ( dispatcher ) => ( {
	onSuccess: emitterCallback( EMIT_TYPES.SHIPPING_RATES_SUCCESS, dispatcher ),
	onFail: emitterCallback( EMIT_TYPES.SHIPPING_RATES_FAIL, dispatcher ),
	onSelectSuccess: emitterCallback(
		EMIT_TYPES.SHIPPING_RATE_SELECT_SUCCESS,
		dispatcher
	),
	onSelectFail: emitterCallback(
		EMIT_TYPES.SHIPPING_RATE_SELECT_FAIL,
		dispatcher
	),
} );

export { EMIT_TYPES, emitterObservers, reducer, emitEvent };
woocommerce-blocks/assets/js/base/context/providers/cart-checkout/shipping/index.js000064400000014131151335517650024724 0ustar00/**
 * External dependencies
 */
import {
	createContext,
	useContext,
	useReducer,
	useEffect,
	useMemo,
	useRef,
} from '@wordpress/element';
import isShallowEqual from '@wordpress/is-shallow-equal';
import { deriveSelectedShippingRates } from '@woocommerce/base-utils';

/**
 * Internal dependencies
 */
import { ERROR_TYPES, DEFAULT_SHIPPING_CONTEXT_DATA } from './constants';
import { hasInvalidShippingAddress } from './utils';
import { errorStatusReducer } from './reducers';
import {
	EMIT_TYPES,
	emitterObservers,
	reducer as emitReducer,
	emitEvent,
} from './event-emit';
import { useCheckoutContext } from '../checkout-state';
import { useCustomerDataContext } from '../customer';
import { useStoreCart } from '../../../hooks/cart/use-store-cart';
import { useSelectShippingRates } from '../../../hooks/shipping/use-select-shipping-rates';

/**
 * @typedef {import('@woocommerce/type-defs/contexts').ShippingDataContext} ShippingDataContext
 * @typedef {import('react')} React
 */

const { NONE, INVALID_ADDRESS, UNKNOWN } = ERROR_TYPES;
const ShippingDataContext = createContext( DEFAULT_SHIPPING_CONTEXT_DATA );

/**
 * @return {ShippingDataContext} Returns data and functions related to shipping methods.
 */
export const useShippingDataContext = () => {
	return useContext( ShippingDataContext );
};

/**
 * The shipping data provider exposes the interface for shipping in the checkout/cart.
 *
 * @param {Object} props Incoming props for provider
 * @param {React.ReactElement} props.children
 */
export const ShippingDataProvider = ( { children } ) => {
	const { dispatchActions } = useCheckoutContext();
	const { shippingAddress, setShippingAddress } = useCustomerDataContext();
	const {
		cartNeedsShipping: needsShipping,
		cartHasCalculatedShipping: hasCalculatedShipping,
		shippingRates,
		shippingRatesLoading,
		cartErrors,
	} = useStoreCart();
	const { selectShippingRate, isSelectingRate } = useSelectShippingRates();
	const [ shippingErrorStatus, dispatchErrorStatus ] = useReducer(
		errorStatusReducer,
		NONE
	);
	const [ observers, observerDispatch ] = useReducer( emitReducer, {} );
	const currentObservers = useRef( observers );
	const eventObservers = useMemo(
		() => ( {
			onShippingRateSuccess: emitterObservers( observerDispatch )
				.onSuccess,
			onShippingRateFail: emitterObservers( observerDispatch ).onFail,
			onShippingRateSelectSuccess: emitterObservers( observerDispatch )
				.onSelectSuccess,
			onShippingRateSelectFail: emitterObservers( observerDispatch )
				.onSelectFail,
		} ),
		[ observerDispatch ]
	);

	// set observers on ref so it's always current.
	useEffect( () => {
		currentObservers.current = observers;
	}, [ observers ] );

	// set selected rates on ref so it's always current.
	const selectedRates = useRef( () =>
		deriveSelectedShippingRates( shippingRates )
	);
	useEffect( () => {
		const derivedSelectedRates = deriveSelectedShippingRates(
			shippingRates
		);
		if ( ! isShallowEqual( selectedRates.current, derivedSelectedRates ) ) {
			selectedRates.current = derivedSelectedRates;
		}
	}, [ shippingRates ] );

	// increment/decrement checkout calculating counts when shipping is loading.
	useEffect( () => {
		if ( shippingRatesLoading ) {
			dispatchActions.incrementCalculating();
		} else {
			dispatchActions.decrementCalculating();
		}
	}, [ shippingRatesLoading, dispatchActions ] );

	// increment/decrement checkout calculating counts when shipping rates are being selected.
	useEffect( () => {
		if ( isSelectingRate ) {
			dispatchActions.incrementCalculating();
		} else {
			dispatchActions.decrementCalculating();
		}
	}, [ isSelectingRate, dispatchActions ] );

	// set shipping error status if there are shipping error codes
	useEffect( () => {
		if (
			cartErrors.length > 0 &&
			hasInvalidShippingAddress( cartErrors )
		) {
			dispatchErrorStatus( { type: INVALID_ADDRESS } );
		} else {
			dispatchErrorStatus( { type: NONE } );
		}
	}, [ cartErrors ] );

	const currentErrorStatus = useMemo(
		() => ( {
			isPristine: shippingErrorStatus === NONE,
			isValid: shippingErrorStatus === NONE,
			hasInvalidAddress: shippingErrorStatus === INVALID_ADDRESS,
			hasError:
				shippingErrorStatus === UNKNOWN ||
				shippingErrorStatus === INVALID_ADDRESS,
		} ),
		[ shippingErrorStatus ]
	);

	// emit events.
	useEffect( () => {
		if (
			! shippingRatesLoading &&
			( shippingRates.length === 0 || currentErrorStatus.hasError )
		) {
			emitEvent(
				currentObservers.current,
				EMIT_TYPES.SHIPPING_RATES_FAIL,
				{
					hasInvalidAddress: currentErrorStatus.hasInvalidAddress,
					hasError: currentErrorStatus.hasError,
				}
			);
		}
	}, [
		shippingRates,
		shippingRatesLoading,
		currentErrorStatus.hasError,
		currentErrorStatus.hasInvalidAddress,
	] );

	useEffect( () => {
		if (
			! shippingRatesLoading &&
			shippingRates.length > 0 &&
			! currentErrorStatus.hasError
		) {
			emitEvent(
				currentObservers.current,
				EMIT_TYPES.SHIPPING_RATES_SUCCESS,
				shippingRates
			);
		}
	}, [ shippingRates, shippingRatesLoading, currentErrorStatus.hasError ] );

	// emit shipping rate selection events.
	useEffect( () => {
		if ( isSelectingRate ) {
			return;
		}
		if ( currentErrorStatus.hasError ) {
			emitEvent(
				currentObservers.current,
				EMIT_TYPES.SHIPPING_RATE_SELECT_FAIL,
				{
					hasError: currentErrorStatus.hasError,
					hasInvalidAddress: currentErrorStatus.hasInvalidAddress,
				}
			);
		} else {
			emitEvent(
				currentObservers.current,
				EMIT_TYPES.SHIPPING_RATE_SELECT_SUCCESS,
				selectedRates.current
			);
		}
	}, [
		isSelectingRate,
		currentErrorStatus.hasError,
		currentErrorStatus.hasInvalidAddress,
	] );

	/**
	 * @type {ShippingDataContext}
	 */
	const ShippingData = {
		shippingErrorStatus: currentErrorStatus,
		dispatchErrorStatus,
		shippingErrorTypes: ERROR_TYPES,
		shippingRates,
		shippingRatesLoading,
		selectedRates: selectedRates.current,
		setSelectedRates: selectShippingRate,
		isSelectingRate,
		shippingAddress,
		setShippingAddress,
		needsShipping,
		hasCalculatedShipping,
		...eventObservers,
	};

	return (
		<>
			<ShippingDataContext.Provider value={ ShippingData }>
				{ children }
			</ShippingDataContext.Provider>
		</>
	);
};
woocommerce-blocks/assets/js/base/context/providers/cart-checkout/shipping/utils.js000064400000000472151335517650024760 0ustar00/**
 * Internal dependencies
 */
import { shippingErrorCodes } from './constants';

export const hasInvalidShippingAddress = ( errors ) => {
	return errors.some( ( error ) => {
		if (
			error.code &&
			Object.values( shippingErrorCodes ).includes( error.code )
		) {
			return true;
		}
		return false;
	} );
};
woocommerce-blocks/assets/js/base/context/providers/cart-checkout/customer/index.js000064400000005447151335517650024756 0ustar00/**
 * External dependencies
 */
import { createContext, useContext, useState } from '@wordpress/element';
import { defaultAddressFields } from '@woocommerce/settings';

/**
 * Internal dependencies
 */
import { useCustomerData } from '../../../hooks/use-customer-data';
import { useCheckoutContext } from '../checkout-state';
import { useStoreCart } from '../../../hooks/cart/use-store-cart';

/**
 * @typedef {import('@woocommerce/type-defs/contexts').CustomerDataContext} CustomerDataContext
 * @typedef {import('@woocommerce/type-defs/billing').BillingData} BillingData
 * @typedef {import('@woocommerce/type-defs/shipping').ShippingAddress} ShippingAddress
 */

/**
 * @type {BillingData}
 */
const defaultBillingData = {
	first_name: '',
	last_name: '',
	company: '',
	address_1: '',
	address_2: '',
	city: '',
	state: '',
	postcode: '',
	country: '',
	email: '',
	phone: '',
};

/**
 * @type {ShippingAddress}
 */
export const defaultShippingAddress = {
	first_name: '',
	last_name: '',
	company: '',
	address_1: '',
	address_2: '',
	city: '',
	state: '',
	postcode: '',
	country: '',
	phone: '',
};

/**
 * Creates CustomerDataContext
 */
const CustomerDataContext = createContext( {
	billingData: defaultBillingData,
	shippingAddress: defaultShippingAddress,
	setBillingData: () => null,
	setShippingAddress: () => null,
	shippingAsBilling: true,
	setShippingAsBilling: () => null,
} );

/**
 * @return {CustomerDataContext} Returns data and functions related to customer billing and shipping addresses.
 */
export const useCustomerDataContext = () => {
	return useContext( CustomerDataContext );
};

/**
 * Compare two addresses and see if they are the same.
 *
 * @param {Object} address1 First address.
 * @param {Object} address2 Second address.
 */
const isSameAddress = ( address1, address2 ) => {
	return Object.keys( defaultAddressFields ).every(
		( field ) => address1[ field ] === address2[ field ]
	);
};

/**
 * Customer Data context provider.
 *
 * @param {Object}  props          Incoming props for the provider.
 * @param {Object}  props.children The children being wrapped.
 */
export const CustomerDataProvider = ( { children } ) => {
	const {
		billingData,
		shippingAddress,
		setBillingData,
		setShippingAddress,
	} = useCustomerData();
	const { cartNeedsShipping: needsShipping } = useStoreCart();
	const { customerId } = useCheckoutContext();
	const [ shippingAsBilling, setShippingAsBilling ] = useState(
		() =>
			needsShipping &&
			( ! customerId || isSameAddress( shippingAddress, billingData ) )
	);

	/**
	 * @type {CustomerDataContext}
	 */
	const contextValue = {
		billingData,
		shippingAddress,
		setBillingData,
		setShippingAddress,
		shippingAsBilling,
		setShippingAsBilling,
	};

	return (
		<CustomerDataContext.Provider value={ contextValue }>
			{ children }
		</CustomerDataContext.Provider>
	);
};
woocommerce-blocks/assets/js/base/context/providers/cart-checkout/cart/index.js000064400000001332151335517650024033 0ustar00/**
 * Internal dependencies
 */
import { CheckoutProvider } from '../checkout-provider';

/**
 * Cart provider
 * This wraps the Cart and provides an api interface for the Cart to
 * children via various hooks.
 *
 * @param {Object}  props               Incoming props for the provider.
 * @param {Object}  [props.children]    The children being wrapped.
 * @param {string}  [props.redirectUrl] Initialize what the cart will
 *                                      redirect to after successful
 *                                      submit.
 */
export const CartProvider = ( { children, redirectUrl } ) => {
	return (
		<CheckoutProvider isCart={ true } redirectUrl={ redirectUrl }>
			{ children }
		</CheckoutProvider>
	);
};
woocommerce-blocks/assets/js/base/context/providers/cart-checkout/checkout-state/index.tsx000064400000027406151335517650026241 0ustar00/**
 * External dependencies
 */
import {
	createContext,
	useContext,
	useReducer,
	useRef,
	useMemo,
	useEffect,
	useCallback,
} from '@wordpress/element';
import { __ } from '@wordpress/i18n';
import { usePrevious } from '@woocommerce/base-hooks';
import deprecated from '@wordpress/deprecated';
import { isObject } from '@woocommerce/types';

/**
 * Internal dependencies
 */
import { actions } from './actions';
import { reducer } from './reducer';
import { getPaymentResultFromCheckoutResponse } from './utils';
import {
	DEFAULT_STATE,
	STATUS,
	DEFAULT_CHECKOUT_STATE_DATA,
} from './constants';
import type {
	CheckoutStateDispatchActions,
	CheckoutStateContextType,
} from './types';
import {
	EMIT_TYPES,
	useEventEmitters,
	emitEvent,
	emitEventWithAbort,
	reducer as emitReducer,
} from './event-emit';
import { useValidationContext } from '../../validation';
import { useStoreNotices } from '../../../hooks/use-store-notices';
import { useStoreEvents } from '../../../hooks/use-store-events';
import { useCheckoutNotices } from '../../../hooks/use-checkout-notices';
import { useEmitResponse } from '../../../hooks/use-emit-response';

/**
 * @typedef {import('@woocommerce/type-defs/contexts').CheckoutDataContext} CheckoutDataContext
 */

const CheckoutContext = createContext( DEFAULT_CHECKOUT_STATE_DATA );

export const useCheckoutContext = (): CheckoutStateContextType => {
	return useContext( CheckoutContext );
};

/**
 * Checkout state provider
 * This provides an API interface exposing checkout state for use with cart or checkout blocks.
 *
 * @param {Object}  props                     Incoming props for the provider.
 * @param {Object}  props.children            The children being wrapped.
 * @param {string}  props.redirectUrl         Initialize what the checkout will redirect to after successful submit.
 * @param {boolean} props.isCart              If context provider is being used in cart context.
 */
export const CheckoutStateProvider = ( {
	children,
	redirectUrl,
	isCart = false,
}: {
	children: React.ReactChildren;
	redirectUrl: string;
	isCart: boolean;
} ): JSX.Element => {
	// note, this is done intentionally so that the default state now has
	// the redirectUrl for when checkout is reset to PRISTINE state.
	DEFAULT_STATE.redirectUrl = redirectUrl;
	const [ checkoutState, dispatch ] = useReducer( reducer, DEFAULT_STATE );
	const { setValidationErrors } = useValidationContext();
	const { addErrorNotice, removeNotices } = useStoreNotices();
	const { dispatchCheckoutEvent } = useStoreEvents();
	const isCalculating = checkoutState.calculatingCount > 0;
	const {
		isSuccessResponse,
		isErrorResponse,
		isFailResponse,
		shouldRetry,
	} = useEmitResponse();
	const {
		checkoutNotices,
		paymentNotices,
		expressPaymentNotices,
	} = useCheckoutNotices();

	const [ observers, observerDispatch ] = useReducer( emitReducer, {} );
	const currentObservers = useRef( observers );
	const {
		onCheckoutAfterProcessingWithSuccess,
		onCheckoutAfterProcessingWithError,
		onCheckoutValidationBeforeProcessing,
	} = useEventEmitters( observerDispatch );

	// set observers on ref so it's always current.
	useEffect( () => {
		currentObservers.current = observers;
	}, [ observers ] );

	/**
	 * @deprecated use onCheckoutValidationBeforeProcessing instead
	 *
	 * To prevent the deprecation message being shown at render time
	 * we need an extra function between useMemo and event emitters
	 * so that the deprecated message gets shown only at invocation time.
	 * (useMemo calls the passed function at render time)
	 * See: https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/4039/commits/a502d1be8828848270993264c64220731b0ae181
	 */
	const onCheckoutBeforeProcessing = useMemo( () => {
		return function (
			...args: Parameters< typeof onCheckoutValidationBeforeProcessing >
		) {
			deprecated( 'onCheckoutBeforeProcessing', {
				alternative: 'onCheckoutValidationBeforeProcessing',
				plugin: 'WooCommerce Blocks',
			} );
			return onCheckoutValidationBeforeProcessing( ...args );
		};
	}, [ onCheckoutValidationBeforeProcessing ] );

	const dispatchActions = useMemo(
		(): CheckoutStateDispatchActions => ( {
			resetCheckout: () => void dispatch( actions.setPristine() ),
			setRedirectUrl: ( url ) =>
				void dispatch( actions.setRedirectUrl( url ) ),
			setHasError: ( hasError ) =>
				void dispatch( actions.setHasError( hasError ) ),
			incrementCalculating: () =>
				void dispatch( actions.incrementCalculating() ),
			decrementCalculating: () =>
				void dispatch( actions.decrementCalculating() ),
			setCustomerId: ( id ) =>
				void dispatch( actions.setCustomerId( id ) ),
			setOrderId: ( orderId ) =>
				void dispatch( actions.setOrderId( orderId ) ),
			setOrderNotes: ( orderNotes ) =>
				void dispatch( actions.setOrderNotes( orderNotes ) ),
			setExtensionData: ( extensionData ) =>
				void dispatch( actions.setExtensionData( extensionData ) ),
			setAfterProcessing: ( response ) => {
				const paymentResult = getPaymentResultFromCheckoutResponse(
					response
				);

				if ( paymentResult.redirectUrl ) {
					dispatch(
						actions.setRedirectUrl( paymentResult.redirectUrl )
					);
				}
				dispatch( actions.setProcessingResponse( paymentResult ) );
				dispatch( actions.setAfterProcessing() );
			},
		} ),
		[]
	);

	// emit events.
	useEffect( () => {
		const status = checkoutState.status;
		if ( status === STATUS.BEFORE_PROCESSING ) {
			removeNotices( 'error' );
			emitEvent(
				currentObservers.current,
				EMIT_TYPES.CHECKOUT_VALIDATION_BEFORE_PROCESSING,
				{}
			).then( ( response ) => {
				if ( response !== true ) {
					if ( Array.isArray( response ) ) {
						response.forEach(
							( { errorMessage, validationErrors } ) => {
								addErrorNotice( errorMessage );
								setValidationErrors( validationErrors );
							}
						);
					}
					dispatch( actions.setIdle() );
					dispatch( actions.setHasError() );
				} else {
					dispatch( actions.setProcessing() );
				}
			} );
		}
	}, [
		checkoutState.status,
		setValidationErrors,
		addErrorNotice,
		removeNotices,
		dispatch,
	] );

	const previousStatus = usePrevious( checkoutState.status );
	const previousHasError = usePrevious( checkoutState.hasError );

	useEffect( () => {
		if (
			checkoutState.status === previousStatus &&
			checkoutState.hasError === previousHasError
		) {
			return;
		}

		const handleErrorResponse = ( observerResponses: unknown[] ) => {
			let errorResponse = null;
			observerResponses.forEach( ( response ) => {
				if (
					isErrorResponse( response ) ||
					isFailResponse( response )
				) {
					if ( response.message ) {
						const errorOptions = response.messageContext
							? { context: response.messageContext }
							: undefined;
						errorResponse = response;
						addErrorNotice( response.message, errorOptions );
					}
				}
			} );
			return errorResponse;
		};

		if ( checkoutState.status === STATUS.AFTER_PROCESSING ) {
			const data = {
				redirectUrl: checkoutState.redirectUrl,
				orderId: checkoutState.orderId,
				customerId: checkoutState.customerId,
				orderNotes: checkoutState.orderNotes,
				processingResponse: checkoutState.processingResponse,
			};
			if ( checkoutState.hasError ) {
				// allow payment methods or other things to customize the error
				// with a fallback if nothing customizes it.
				emitEventWithAbort(
					currentObservers.current,
					EMIT_TYPES.CHECKOUT_AFTER_PROCESSING_WITH_ERROR,
					data
				).then( ( observerResponses ) => {
					const errorResponse = handleErrorResponse(
						observerResponses
					);
					if ( errorResponse !== null ) {
						// irrecoverable error so set complete
						if ( ! shouldRetry( errorResponse ) ) {
							dispatch( actions.setComplete( errorResponse ) );
						} else {
							dispatch( actions.setIdle() );
						}
					} else {
						const hasErrorNotices =
							checkoutNotices.some(
								( notice: { status: string } ) =>
									notice.status === 'error'
							) ||
							expressPaymentNotices.some(
								( notice: { status: string } ) =>
									notice.status === 'error'
							) ||
							paymentNotices.some(
								( notice: { status: string } ) =>
									notice.status === 'error'
							);
						if ( ! hasErrorNotices ) {
							// no error handling in place by anything so let's fall
							// back to default
							const message =
								data.processingResponse?.message ||
								__(
									'Something went wrong. Please contact us to get assistance.',
									'woo-gutenberg-products-block'
								);
							addErrorNotice( message, {
								id: 'checkout',
							} );
						}

						dispatch( actions.setIdle() );
					}
				} );
			} else {
				emitEventWithAbort(
					currentObservers.current,
					EMIT_TYPES.CHECKOUT_AFTER_PROCESSING_WITH_SUCCESS,
					data
				).then( ( observerResponses: unknown[] ) => {
					let successResponse = null as null | Record<
						string,
						unknown
					>;
					let errorResponse = null as null | Record<
						string,
						unknown
					>;

					observerResponses.forEach( ( response ) => {
						if ( isSuccessResponse( response ) ) {
							// the last observer response always "wins" for success.
							successResponse = response;
						}
						if (
							isErrorResponse( response ) ||
							isFailResponse( response )
						) {
							errorResponse = response;
						}
					} );

					if ( successResponse && ! errorResponse ) {
						dispatch( actions.setComplete( successResponse ) );
					} else if ( isObject( errorResponse ) ) {
						if ( errorResponse.message ) {
							const errorOptions = errorResponse.messageContext
								? { context: errorResponse.messageContext }
								: undefined;
							addErrorNotice(
								errorResponse.message,
								errorOptions
							);
						}
						if ( ! shouldRetry( errorResponse ) ) {
							dispatch( actions.setComplete( errorResponse ) );
						} else {
							// this will set an error which will end up
							// triggering the onCheckoutAfterProcessingWithError emitter.
							// and then setting checkout to IDLE state.
							dispatch( actions.setHasError( true ) );
						}
					} else {
						// nothing hooked in had any response type so let's just
						// consider successful
						dispatch( actions.setComplete() );
					}
				} );
			}
		}
	}, [
		checkoutState.status,
		checkoutState.hasError,
		checkoutState.redirectUrl,
		checkoutState.orderId,
		checkoutState.customerId,
		checkoutState.orderNotes,
		checkoutState.processingResponse,
		previousStatus,
		previousHasError,
		dispatchActions,
		addErrorNotice,
		isErrorResponse,
		isFailResponse,
		isSuccessResponse,
		shouldRetry,
		checkoutNotices,
		expressPaymentNotices,
		paymentNotices,
	] );

	const onSubmit = useCallback( () => {
		dispatchCheckoutEvent( 'submit' );
		dispatch( actions.setBeforeProcessing() );
	}, [ dispatchCheckoutEvent ] );

	const checkoutData: CheckoutStateContextType = {
		onSubmit,
		isComplete: checkoutState.status === STATUS.COMPLETE,
		isIdle: checkoutState.status === STATUS.IDLE,
		isCalculating,
		isProcessing: checkoutState.status === STATUS.PROCESSING,
		isBeforeProcessing: checkoutState.status === STATUS.BEFORE_PROCESSING,
		isAfterProcessing: checkoutState.status === STATUS.AFTER_PROCESSING,
		hasError: checkoutState.hasError,
		redirectUrl: checkoutState.redirectUrl,
		onCheckoutBeforeProcessing,
		onCheckoutValidationBeforeProcessing,
		onCheckoutAfterProcessingWithSuccess,
		onCheckoutAfterProcessingWithError,
		dispatchActions,
		isCart,
		orderId: checkoutState.orderId,
		hasOrder: !! checkoutState.orderId,
		customerId: checkoutState.customerId,
		orderNotes: checkoutState.orderNotes,
		shouldCreateAccount: checkoutState.shouldCreateAccount,
		setShouldCreateAccount: ( value ) =>
			dispatch( actions.setShouldCreateAccount( value ) ),
		extensionData: checkoutState.extensionData,
	};
	return (
		<CheckoutContext.Provider value={ checkoutData }>
			{ children }
		</CheckoutContext.Provider>
	);
};
woocommerce-blocks/assets/js/base/context/providers/cart-checkout/checkout-state/actions.ts000064400000005472151335517650026401 0ustar00/**
 * Internal dependencies
 */
import type { PaymentResultDataType, CheckoutStateContextState } from './types';

export enum ACTION {
	SET_IDLE = 'set_idle',
	SET_PRISTINE = 'set_pristine',
	SET_REDIRECT_URL = 'set_redirect_url',
	SET_COMPLETE = 'set_checkout_complete',
	SET_BEFORE_PROCESSING = 'set_before_processing',
	SET_AFTER_PROCESSING = 'set_after_processing',
	SET_PROCESSING_RESPONSE = 'set_processing_response',
	SET_PROCESSING = 'set_checkout_is_processing',
	SET_HAS_ERROR = 'set_checkout_has_error',
	SET_NO_ERROR = 'set_checkout_no_error',
	SET_CUSTOMER_ID = 'set_checkout_customer_id',
	SET_ORDER_ID = 'set_checkout_order_id',
	SET_ORDER_NOTES = 'set_checkout_order_notes',
	INCREMENT_CALCULATING = 'increment_calculating',
	DECREMENT_CALCULATING = 'decrement_calculating',
	SET_SHOULD_CREATE_ACCOUNT = 'set_should_create_account',
	SET_EXTENSION_DATA = 'set_extension_data',
}

export interface ActionType extends Partial< CheckoutStateContextState > {
	type: ACTION;
	data?:
		| Record< string, unknown >
		| Record< string, never >
		| PaymentResultDataType;
}

/**
 * All the actions that can be dispatched for the checkout.
 */
export const actions = {
	setPristine: () =>
		( {
			type: ACTION.SET_PRISTINE,
		} as const ),
	setIdle: () =>
		( {
			type: ACTION.SET_IDLE,
		} as const ),
	setProcessing: () =>
		( {
			type: ACTION.SET_PROCESSING,
		} as const ),
	setRedirectUrl: ( redirectUrl: string ) =>
		( {
			type: ACTION.SET_REDIRECT_URL,
			redirectUrl,
		} as const ),
	setProcessingResponse: ( data: PaymentResultDataType ) =>
		( {
			type: ACTION.SET_PROCESSING_RESPONSE,
			data,
		} as const ),
	setComplete: ( data: Record< string, unknown > = {} ) =>
		( {
			type: ACTION.SET_COMPLETE,
			data,
		} as const ),
	setBeforeProcessing: () =>
		( {
			type: ACTION.SET_BEFORE_PROCESSING,
		} as const ),
	setAfterProcessing: () =>
		( {
			type: ACTION.SET_AFTER_PROCESSING,
		} as const ),
	setHasError: ( hasError = true ) =>
		( {
			type: hasError ? ACTION.SET_HAS_ERROR : ACTION.SET_NO_ERROR,
		} as const ),
	incrementCalculating: () =>
		( {
			type: ACTION.INCREMENT_CALCULATING,
		} as const ),
	decrementCalculating: () =>
		( {
			type: ACTION.DECREMENT_CALCULATING,
		} as const ),
	setCustomerId: ( customerId: number ) =>
		( {
			type: ACTION.SET_CUSTOMER_ID,
			customerId,
		} as const ),
	setOrderId: ( orderId: number ) =>
		( {
			type: ACTION.SET_ORDER_ID,
			orderId,
		} as const ),
	setShouldCreateAccount: ( shouldCreateAccount: boolean ) =>
		( {
			type: ACTION.SET_SHOULD_CREATE_ACCOUNT,
			shouldCreateAccount,
		} as const ),
	setOrderNotes: ( orderNotes: string ) =>
		( {
			type: ACTION.SET_ORDER_NOTES,
			orderNotes,
		} as const ),
	setExtensionData: (
		extensionData: Record< string, Record< string, unknown > >
	) =>
		( {
			type: ACTION.SET_EXTENSION_DATA,
			extensionData,
		} as const ),
};
woocommerce-blocks/assets/js/base/context/providers/cart-checkout/checkout-state/event-emit.ts000064400000003412151335517650027006 0ustar00/**
 * External dependencies
 */
import { useMemo } from '@wordpress/element';

/**
 * Internal dependencies
 */
import {
	emitterCallback,
	reducer,
	emitEvent,
	emitEventWithAbort,
	ActionType,
} from '../../../event-emit';

const EMIT_TYPES = {
	CHECKOUT_VALIDATION_BEFORE_PROCESSING:
		'checkout_validation_before_processing',
	CHECKOUT_AFTER_PROCESSING_WITH_SUCCESS:
		'checkout_after_processing_with_success',
	CHECKOUT_AFTER_PROCESSING_WITH_ERROR:
		'checkout_after_processing_with_error',
};

type EventEmittersType = Record< string, ReturnType< typeof emitterCallback > >;

/**
 * Receives a reducer dispatcher and returns an object with the
 * various event emitters for the payment processing events.
 *
 * Calling the event registration function with the callback will register it
 * for the event emitter and will return a dispatcher for removing the
 * registered callback (useful for implementation in `useEffect`).
 *
 * @param {Function} observerDispatch The emitter reducer dispatcher.
 * @return {Object} An object with the various payment event emitter registration functions
 */
const useEventEmitters = (
	observerDispatch: React.Dispatch< ActionType >
): EventEmittersType => {
	const eventEmitters = useMemo(
		() => ( {
			onCheckoutAfterProcessingWithSuccess: emitterCallback(
				EMIT_TYPES.CHECKOUT_AFTER_PROCESSING_WITH_SUCCESS,
				observerDispatch
			),
			onCheckoutAfterProcessingWithError: emitterCallback(
				EMIT_TYPES.CHECKOUT_AFTER_PROCESSING_WITH_ERROR,
				observerDispatch
			),
			onCheckoutValidationBeforeProcessing: emitterCallback(
				EMIT_TYPES.CHECKOUT_VALIDATION_BEFORE_PROCESSING,
				observerDispatch
			),
		} ),
		[ observerDispatch ]
	);
	return eventEmitters;
};

export { EMIT_TYPES, useEventEmitters, reducer, emitEvent, emitEventWithAbort };
woocommerce-blocks/assets/js/base/context/providers/cart-checkout/checkout-state/utils.ts000064400000003165151335517650026076 0ustar00/**
 * External dependencies
 */
import { __ } from '@wordpress/i18n';
import { decodeEntities } from '@wordpress/html-entities';

/**
 * Internal dependencies
 */
import type { PaymentResultDataType, CheckoutResponse } from './types';

/**
 * Prepares the payment_result data from the server checkout endpoint response.
 */
export const getPaymentResultFromCheckoutResponse = (
	response: CheckoutResponse
): PaymentResultDataType => {
	const paymentResult = {
		message: '',
		paymentStatus: '',
		redirectUrl: '',
		paymentDetails: {},
	} as PaymentResultDataType;

	// payment_result is present in successful responses.
	if ( 'payment_result' in response ) {
		paymentResult.paymentStatus = response.payment_result.payment_status;
		paymentResult.redirectUrl = response.payment_result.redirect_url;

		if (
			response.payment_result.hasOwnProperty( 'payment_details' ) &&
			Array.isArray( response.payment_result.payment_details )
		) {
			response.payment_result.payment_details.forEach(
				( { key, value }: { key: string; value: string } ) => {
					paymentResult.paymentDetails[ key ] = decodeEntities(
						value
					);
				}
			);
		}
	}

	// message is present in error responses.
	if ( 'message' in response ) {
		paymentResult.message = decodeEntities( response.message );
	}

	// If there was an error code but no message, set a default message.
	if (
		! paymentResult.message &&
		'data' in response &&
		'status' in response.data &&
		response.data.status > 299
	) {
		paymentResult.message = __(
			'Something went wrong. Please contact us to get assistance.',
			'woo-gutenberg-products-block'
		);
	}

	return paymentResult;
};
woocommerce-blocks/assets/js/base/context/providers/cart-checkout/checkout-state/types.ts000064400000011003151335517650026070 0ustar00/**
 * Internal dependencies
 */
import { STATUS } from './constants';
import type { emitterCallback } from '../../../event-emit';

export interface CheckoutResponseError {
	code: string;
	message: string;
	data: {
		status: number;
	};
}

export interface CheckoutResponseSuccess {
	// eslint-disable-next-line camelcase
	payment_result: {
		// eslint-disable-next-line camelcase
		payment_status: 'success' | 'failure' | 'pending' | 'error';
		// eslint-disable-next-line camelcase
		payment_details: Record< string, string > | Record< string, never >;
		// eslint-disable-next-line camelcase
		redirect_url: string;
	};
}

export type CheckoutResponse = CheckoutResponseSuccess | CheckoutResponseError;

export interface PaymentResultDataType {
	message: string;
	paymentStatus: string;
	paymentDetails: Record< string, string > | Record< string, never >;
	redirectUrl: string;
}

type extensionDataNamespace = string;
type extensionDataItem = Record< string, unknown >;
export type extensionData = Record< extensionDataNamespace, extensionDataItem >;

export interface CheckoutStateContextState {
	redirectUrl: string;
	status: STATUS;
	hasError: boolean;
	calculatingCount: number;
	orderId: number;
	orderNotes: string;
	customerId: number;
	shouldCreateAccount: boolean;
	processingResponse: PaymentResultDataType | null;
	extensionData: extensionData;
}

export type CheckoutStateDispatchActions = {
	resetCheckout: () => void;
	setRedirectUrl: ( url: string ) => void;
	setHasError: ( hasError: boolean ) => void;
	setAfterProcessing: ( response: CheckoutResponse ) => void;
	incrementCalculating: () => void;
	decrementCalculating: () => void;
	setCustomerId: ( id: number ) => void;
	setOrderId: ( id: number ) => void;
	setOrderNotes: ( orderNotes: string ) => void;
	setExtensionData: ( extensionData: extensionData ) => void;
};

export type CheckoutStateContextType = {
	// Dispatch actions to the checkout provider.
	dispatchActions: CheckoutStateDispatchActions;
	// Submits the checkout and begins processing.
	onSubmit: () => void;
	// True when checkout is complete and ready for redirect.
	isComplete: boolean;
	// True when the checkout state has changed and checkout has no activity.
	isIdle: boolean;
	// True when something in the checkout is resulting in totals being calculated.
	isCalculating: boolean;
	// True when checkout has been submitted and is being processed. Note, payment related processing happens during this state. When payment status is success, processing happens on the server.
	isProcessing: boolean;
	// True during any observers executing logic before checkout processing (eg. validation).
	isBeforeProcessing: boolean;
	// True when checkout status is AFTER_PROCESSING.
	isAfterProcessing: boolean;
	// Used to register a callback that will fire after checkout has been processed and there are no errors.
	onCheckoutAfterProcessingWithSuccess: ReturnType< typeof emitterCallback >;
	// Used to register a callback that will fire when the checkout has been processed and has an error.
	onCheckoutAfterProcessingWithError: ReturnType< typeof emitterCallback >;
	// Deprecated in favour of onCheckoutValidationBeforeProcessing.
	onCheckoutBeforeProcessing: ReturnType< typeof emitterCallback >;
	// Used to register a callback that will fire when the checkout has been submitted before being sent off to the server.
	onCheckoutValidationBeforeProcessing: ReturnType< typeof emitterCallback >;
	// Set if user account should be created.
	setShouldCreateAccount: ( shouldCreateAccount: boolean ) => void;
	// True when the checkout has a draft order from the API.
	hasOrder: boolean;
	// When true, means the provider is providing data for the cart.
	isCart: boolean;
	// True when the checkout is in an error state. Whatever caused the error (validation/payment method) will likely have triggered a notice.
	hasError: CheckoutStateContextState[ 'hasError' ];
	// This is the url that checkout will redirect to when it's ready.
	redirectUrl: CheckoutStateContextState[ 'redirectUrl' ];
	// This is the ID for the draft order if one exists.
	orderId: CheckoutStateContextState[ 'orderId' ];
	// Order notes introduced by the user in the checkout form.
	orderNotes: CheckoutStateContextState[ 'orderNotes' ];
	// This is the ID of the customer the draft order belongs to.
	customerId: CheckoutStateContextState[ 'customerId' ];
	// Should a user account be created?
	shouldCreateAccount: CheckoutStateContextState[ 'shouldCreateAccount' ];
	// Custom checkout data passed to the store API on processing.
	extensionData: CheckoutStateContextState[ 'extensionData' ];
};
woocommerce-blocks/assets/js/base/context/providers/cart-checkout/checkout-state/constants.ts000064400000005223151335517650026747 0ustar00/**
 * External dependencies
 */
import { getSetting } from '@woocommerce/settings';

/**
 * Internal dependencies
 */
import type {
	CheckoutStateContextType,
	CheckoutStateContextState,
} from './types';

export enum STATUS {
	// Checkout is in it's initialized state.
	PRISTINE = 'pristine',
	// When checkout state has changed but there is no activity happening.
	IDLE = 'idle',
	// After BEFORE_PROCESSING status emitters have finished successfully. Payment processing is started on this checkout status.
	PROCESSING = 'processing',
	// After the AFTER_PROCESSING event emitters have completed. This status triggers the checkout redirect.
	COMPLETE = 'complete',
	// This is the state before checkout processing begins after the checkout button has been pressed/submitted.
	BEFORE_PROCESSING = 'before_processing',
	// After server side checkout processing is completed this status is set
	AFTER_PROCESSING = 'after_processing',
}

const preloadedApiRequests = getSetting( 'preloadedApiRequests', {} ) as Record<
	string,
	{ body: Record< string, unknown > }
>;

const checkoutData = {
	order_id: 0,
	customer_id: 0,
	...( preloadedApiRequests[ '/wc/store/checkout' ]?.body || {} ),
};

export const DEFAULT_CHECKOUT_STATE_DATA: CheckoutStateContextType = {
	dispatchActions: {
		resetCheckout: () => void null,
		setRedirectUrl: ( url ) => void url,
		setHasError: ( hasError ) => void hasError,
		setAfterProcessing: ( response ) => void response,
		incrementCalculating: () => void null,
		decrementCalculating: () => void null,
		setCustomerId: ( id ) => void id,
		setOrderId: ( id ) => void id,
		setOrderNotes: ( orderNotes ) => void orderNotes,
		setExtensionData: ( extensionData ) => void extensionData,
	},
	onSubmit: () => void null,
	isComplete: false,
	isIdle: false,
	isCalculating: false,
	isProcessing: false,
	isBeforeProcessing: false,
	isAfterProcessing: false,
	hasError: false,
	redirectUrl: '',
	orderId: 0,
	orderNotes: '',
	customerId: 0,
	onCheckoutAfterProcessingWithSuccess: () => () => void null,
	onCheckoutAfterProcessingWithError: () => () => void null,
	onCheckoutBeforeProcessing: () => () => void null, // deprecated for onCheckoutValidationBeforeProcessing
	onCheckoutValidationBeforeProcessing: () => () => void null,
	hasOrder: false,
	isCart: false,
	shouldCreateAccount: false,
	setShouldCreateAccount: ( value ) => void value,
	extensionData: {},
};

export const DEFAULT_STATE: CheckoutStateContextState = {
	redirectUrl: '',
	status: STATUS.PRISTINE,
	hasError: false,
	calculatingCount: 0,
	orderId: checkoutData.order_id,
	orderNotes: '',
	customerId: checkoutData.customer_id,
	shouldCreateAccount: false,
	processingResponse: null,
	extensionData: {},
};
woocommerce-blocks/assets/js/base/context/providers/cart-checkout/checkout-state/reducer.ts000064400000010323151335517650026361 0ustar00/**
 * Internal dependencies
 */
import { DEFAULT_STATE, STATUS } from './constants';
import { ActionType, ACTION } from './actions';
import type { CheckoutStateContextState, PaymentResultDataType } from './types';

/**
 * Reducer for the checkout state
 */
export const reducer = (
	state = DEFAULT_STATE,
	{
		redirectUrl,
		type,
		customerId,
		orderId,
		orderNotes,
		extensionData,
		shouldCreateAccount,
		data,
	}: ActionType
): CheckoutStateContextState => {
	let newState = state;
	switch ( type ) {
		case ACTION.SET_PRISTINE:
			newState = DEFAULT_STATE;
			break;
		case ACTION.SET_IDLE:
			newState =
				state.status !== STATUS.IDLE
					? {
							...state,
							status: STATUS.IDLE,
					  }
					: state;
			break;
		case ACTION.SET_REDIRECT_URL:
			newState =
				redirectUrl !== undefined && redirectUrl !== state.redirectUrl
					? {
							...state,
							redirectUrl,
					  }
					: state;
			break;
		case ACTION.SET_PROCESSING_RESPONSE:
			newState = {
				...state,
				processingResponse: data as PaymentResultDataType,
			};
			break;

		case ACTION.SET_COMPLETE:
			newState =
				state.status !== STATUS.COMPLETE
					? {
							...state,
							status: STATUS.COMPLETE,
							// @todo Investigate why redirectURL could be non-truthy and whether this would cause a bug if multiple gateways were used for payment e.g. 1st set the redirect URL but failed, and then the 2nd did not provide a redirect URL and succeeded.
							redirectUrl:
								data !== undefined &&
								typeof data.redirectUrl === 'string' &&
								data.redirectUrl
									? data.redirectUrl
									: state.redirectUrl,
					  }
					: state;
			break;
		case ACTION.SET_PROCESSING:
			newState =
				state.status !== STATUS.PROCESSING
					? {
							...state,
							status: STATUS.PROCESSING,
							hasError: false,
					  }
					: state;
			// clear any error state.
			newState =
				newState.hasError === false
					? newState
					: { ...newState, hasError: false };
			break;
		case ACTION.SET_BEFORE_PROCESSING:
			newState =
				state.status !== STATUS.BEFORE_PROCESSING
					? {
							...state,
							status: STATUS.BEFORE_PROCESSING,
							hasError: false,
					  }
					: state;
			break;
		case ACTION.SET_AFTER_PROCESSING:
			newState =
				state.status !== STATUS.AFTER_PROCESSING
					? {
							...state,
							status: STATUS.AFTER_PROCESSING,
					  }
					: state;
			break;
		case ACTION.SET_HAS_ERROR:
			newState = state.hasError
				? state
				: {
						...state,
						hasError: true,
				  };
			newState =
				state.status === STATUS.PROCESSING ||
				state.status === STATUS.BEFORE_PROCESSING
					? {
							...newState,
							status: STATUS.IDLE,
					  }
					: newState;
			break;
		case ACTION.SET_NO_ERROR:
			newState = state.hasError
				? {
						...state,
						hasError: false,
				  }
				: state;
			break;
		case ACTION.INCREMENT_CALCULATING:
			newState = {
				...state,
				calculatingCount: state.calculatingCount + 1,
			};
			break;
		case ACTION.DECREMENT_CALCULATING:
			newState = {
				...state,
				calculatingCount: Math.max( 0, state.calculatingCount - 1 ),
			};
			break;
		case ACTION.SET_CUSTOMER_ID:
			newState =
				customerId !== undefined
					? {
							...state,
							customerId,
					  }
					: state;
			break;
		case ACTION.SET_ORDER_ID:
			newState =
				orderId !== undefined
					? {
							...state,
							orderId,
					  }
					: state;
			break;
		case ACTION.SET_SHOULD_CREATE_ACCOUNT:
			if (
				shouldCreateAccount !== undefined &&
				shouldCreateAccount !== state.shouldCreateAccount
			) {
				newState = {
					...state,
					shouldCreateAccount,
				};
			}
			break;
		case ACTION.SET_ORDER_NOTES:
			if ( orderNotes !== undefined && state.orderNotes !== orderNotes ) {
				newState = {
					...state,
					orderNotes,
				};
			}
			break;
		case ACTION.SET_EXTENSION_DATA:
			if (
				extensionData !== undefined &&
				state.extensionData !== extensionData
			) {
				newState = {
					...state,
					extensionData,
				};
			}
			break;
	}
	// automatically update state to idle from pristine as soon as it
	// initially changes.
	if (
		newState !== state &&
		type !== ACTION.SET_PRISTINE &&
		newState.status === STATUS.PRISTINE
	) {
		newState.status = STATUS.IDLE;
	}
	return newState;
};
woocommerce-blocks/assets/js/base/context/providers/cart-checkout/checkout-processor.js000064400000015670151335517650025627 0ustar00/**
 * External dependencies
 */
import { __ } from '@wordpress/i18n';
import triggerFetch from '@wordpress/api-fetch';
import {
	useEffect,
	useRef,
	useCallback,
	useState,
	useMemo,
} from '@wordpress/element';
import {
	emptyHiddenAddressFields,
	formatStoreApiErrorMessage,
} from '@woocommerce/base-utils';

/**
 * Internal dependencies
 */
import { preparePaymentData, processCheckoutResponseHeaders } from './utils';
import { useCheckoutContext } from './checkout-state';
import { useShippingDataContext } from './shipping';
import { useCustomerDataContext } from './customer';
import { usePaymentMethodDataContext } from './payment-methods';
import { useValidationContext } from '../validation';
import { useStoreCart } from '../../hooks/cart/use-store-cart';
import { useStoreNotices } from '../../hooks/use-store-notices';

/**
 * CheckoutProcessor component.
 *
 * Subscribes to checkout context and triggers processing via the API.
 */
const CheckoutProcessor = () => {
	const {
		hasError: checkoutHasError,
		onCheckoutValidationBeforeProcessing,
		dispatchActions,
		redirectUrl,
		isProcessing: checkoutIsProcessing,
		isBeforeProcessing: checkoutIsBeforeProcessing,
		isComplete: checkoutIsComplete,
		orderNotes,
		shouldCreateAccount,
		extensionData,
	} = useCheckoutContext();
	const { hasValidationErrors } = useValidationContext();
	const { shippingErrorStatus } = useShippingDataContext();
	const { billingData, shippingAddress } = useCustomerDataContext();
	const { cartNeedsPayment, receiveCart } = useStoreCart();
	const {
		activePaymentMethod,
		isExpressPaymentMethodActive,
		currentStatus: currentPaymentStatus,
		paymentMethodData,
		expressPaymentMethods,
		paymentMethods,
		shouldSavePayment,
	} = usePaymentMethodDataContext();
	const { addErrorNotice, removeNotice, setIsSuppressed } = useStoreNotices();
	const currentBillingData = useRef( billingData );
	const currentShippingAddress = useRef( shippingAddress );
	const currentRedirectUrl = useRef( redirectUrl );
	const [ isProcessingOrder, setIsProcessingOrder ] = useState( false );

	const paymentMethodId = useMemo( () => {
		const merged = { ...expressPaymentMethods, ...paymentMethods };
		return merged?.[ activePaymentMethod ]?.paymentMethodId;
	}, [ activePaymentMethod, expressPaymentMethods, paymentMethods ] );

	const checkoutWillHaveError =
		( hasValidationErrors && ! isExpressPaymentMethodActive ) ||
		currentPaymentStatus.hasError ||
		shippingErrorStatus.hasError;

	const paidAndWithoutErrors =
		! checkoutHasError &&
		! checkoutWillHaveError &&
		( currentPaymentStatus.isSuccessful || ! cartNeedsPayment ) &&
		checkoutIsProcessing;

	// If express payment method is active, let's suppress notices
	useEffect( () => {
		setIsSuppressed( isExpressPaymentMethodActive );
	}, [ isExpressPaymentMethodActive, setIsSuppressed ] );

	// Determine if checkout has an error.
	useEffect( () => {
		if (
			checkoutWillHaveError !== checkoutHasError &&
			( checkoutIsProcessing || checkoutIsBeforeProcessing ) &&
			! isExpressPaymentMethodActive
		) {
			dispatchActions.setHasError( checkoutWillHaveError );
		}
	}, [
		checkoutWillHaveError,
		checkoutHasError,
		checkoutIsProcessing,
		checkoutIsBeforeProcessing,
		isExpressPaymentMethodActive,
		dispatchActions,
	] );

	useEffect( () => {
		currentBillingData.current = billingData;
		currentShippingAddress.current = shippingAddress;
		currentRedirectUrl.current = redirectUrl;
	}, [ billingData, shippingAddress, redirectUrl ] );

	const checkValidation = useCallback( () => {
		if ( hasValidationErrors ) {
			return false;
		}
		if ( currentPaymentStatus.hasError ) {
			return {
				errorMessage: __(
					'There was a problem with your payment option.',
					'woocommerce'
				),
			};
		}
		if ( shippingErrorStatus.hasError ) {
			return {
				errorMessage: __(
					'There was a problem with your shipping option.',
					'woocommerce'
				),
			};
		}

		return true;
	}, [
		hasValidationErrors,
		currentPaymentStatus.hasError,
		shippingErrorStatus.hasError,
	] );

	useEffect( () => {
		let unsubscribeProcessing;
		if ( ! isExpressPaymentMethodActive ) {
			unsubscribeProcessing = onCheckoutValidationBeforeProcessing(
				checkValidation,
				0
			);
		}
		return () => {
			if ( ! isExpressPaymentMethodActive ) {
				unsubscribeProcessing();
			}
		};
	}, [
		onCheckoutValidationBeforeProcessing,
		checkValidation,
		isExpressPaymentMethodActive,
	] );

	// redirect when checkout is complete and there is a redirect url.
	useEffect( () => {
		if ( currentRedirectUrl.current ) {
			window.location.href = currentRedirectUrl.current;
		}
	}, [ checkoutIsComplete ] );

	const processOrder = useCallback( async () => {
		if ( isProcessingOrder ) {
			return;
		}
		setIsProcessingOrder( true );
		removeNotice( 'checkout' );

		const paymentData = cartNeedsPayment
			? {
					payment_method: paymentMethodId,
					payment_data: preparePaymentData(
						paymentMethodData,
						shouldSavePayment,
						activePaymentMethod
					),
			  }
			: {};

		const data = {
			billing_address: emptyHiddenAddressFields(
				currentBillingData.current
			),
			shipping_address: emptyHiddenAddressFields(
				currentShippingAddress.current
			),
			customer_note: orderNotes,
			should_create_account: shouldCreateAccount,
			...paymentData,
			extensions: { ...extensionData },
		};

		triggerFetch( {
			path: '/wc/store/checkout',
			method: 'POST',
			data,
			cache: 'no-store',
			parse: false,
		} )
			.then( ( response ) => {
				processCheckoutResponseHeaders(
					response.headers,
					dispatchActions
				);
				if ( ! response.ok ) {
					throw new Error( response );
				}
				return response.json();
			} )
			.then( ( response ) => {
				dispatchActions.setAfterProcessing( response );
				setIsProcessingOrder( false );
			} )
			.catch( ( fetchResponse ) => {
				processCheckoutResponseHeaders(
					fetchResponse.headers,
					dispatchActions
				);
				fetchResponse.json().then( ( response ) => {
					// If updated cart state was returned, update the store.
					if ( response.data?.cart ) {
						receiveCart( response.data.cart );
					}
					addErrorNotice( formatStoreApiErrorMessage( response ), {
						id: 'checkout',
					} );
					response.additional_errors?.forEach?.(
						( additionalError ) => {
							addErrorNotice( additionalError.message, {
								id: additionalError.error_code,
							} );
						}
					);
					dispatchActions.setHasError( true );
					dispatchActions.setAfterProcessing( response );
					setIsProcessingOrder( false );
				} );
			} );
	}, [
		isProcessingOrder,
		removeNotice,
		orderNotes,
		shouldCreateAccount,
		cartNeedsPayment,
		paymentMethodId,
		paymentMethodData,
		shouldSavePayment,
		activePaymentMethod,
		extensionData,
		dispatchActions,
		addErrorNotice,
		receiveCart,
	] );

	// process order if conditions are good.
	useEffect( () => {
		if ( paidAndWithoutErrors && ! isProcessingOrder ) {
			processOrder();
		}
	}, [ processOrder, paidAndWithoutErrors, isProcessingOrder ] );

	return null;
};

export default CheckoutProcessor;
woocommerce-blocks/assets/js/base/context/providers/cart-checkout/utils.ts000064400000003571151335517650023154 0ustar00/**
 * External dependencies
 */
import triggerFetch from '@wordpress/api-fetch';

/**
 * Internal dependencies
 */
import type { CheckoutStateDispatchActions } from './checkout-state/types';

/**
 * Utility function for preparing payment data for the request.
 */
export const preparePaymentData = (
	//Arbitrary payment data provided by the payment method.
	paymentData: Record< string, unknown >,
	//Whether to save the payment method info to user account.
	shouldSave: boolean,
	//The current active payment method.
	activePaymentMethod: string
): { key: string; value: unknown }[] => {
	const apiData = Object.keys( paymentData ).map( ( property ) => {
		const value = paymentData[ property ];
		return { key: property, value };
	}, [] );
	const savePaymentMethodKey = `wc-${ activePaymentMethod }-new-payment-method`;
	apiData.push( {
		key: savePaymentMethodKey,
		value: shouldSave,
	} );
	return apiData;
};

/**
 * Process headers from an API response an dispatch updates.
 */
export const processCheckoutResponseHeaders = (
	headers: Headers,
	dispatchActions: CheckoutStateDispatchActions
): void => {
	if (
		// eslint-disable-next-line @typescript-eslint/ban-ts-comment
		// @ts-ignore -- this does exist because it's monkey patched in
		// middleware/store-api-nonce.
		triggerFetch.setNonce &&
		// eslint-disable-next-line @typescript-eslint/ban-ts-comment
		// @ts-ignore -- this does exist because it's monkey patched in
		// middleware/store-api-nonce.
		typeof triggerFetch.setNonce === 'function'
	) {
		// eslint-disable-next-line @typescript-eslint/ban-ts-comment
		// @ts-ignore -- this does exist because it's monkey patched in
		// middleware/store-api-nonce.
		triggerFetch.setNonce( headers );
	}

	// Update user using headers.
	if ( headers?.get( 'X-WC-Store-API-User' ) ) {
		dispatchActions.setCustomerId(
			parseInt( headers.get( 'X-WC-Store-API-User' ) || '0', 10 )
		);
	}
};
woocommerce-blocks/assets/js/base/context/providers/container-width-context.js000064400000003474151335517650024031 0ustar00/**
 * External dependencies
 */
import PropTypes from 'prop-types';
import { createContext, useContext } from '@wordpress/element';
import { useContainerQueries } from '@woocommerce/base-hooks';
import classNames from 'classnames';

/**
 * @typedef {import('@woocommerce/type-defs/contexts').ContainerWidthContext} ContainerWidthContext
 * @typedef {import('react')} React
 */

const ContainerWidthContext = createContext( {
	hasContainerWidth: false,
	containerClassName: '',
	isMobile: false,
	isSmall: false,
	isMedium: false,
	isLarge: false,
} );

/**
 * @return {ContainerWidthContext} Returns the container width context value
 */
export const useContainerWidthContext = () => {
	return useContext( ContainerWidthContext );
};

/**
 * Provides an interface to useContainerQueries so children can see what size is being used by the
 * container.
 *
 * @param {Object} props Incoming props for the component.
 * @param {React.ReactChildren} props.children React elements wrapped by the component.
 * @param {string} props.className CSS class in use.
 */
export const ContainerWidthContextProvider = ( {
	children,
	className = '',
} ) => {
	const [ resizeListener, containerClassName ] = useContainerQueries();

	const contextValue = {
		hasContainerWidth: containerClassName !== '',
		containerClassName,
		isMobile: containerClassName === 'is-mobile',
		isSmall: containerClassName === 'is-small',
		isMedium: containerClassName === 'is-medium',
		isLarge: containerClassName === 'is-large',
	};

	/**
	 * @type {ContainerWidthContext}
	 */
	return (
		<ContainerWidthContext.Provider value={ contextValue }>
			<div className={ classNames( className, containerClassName ) }>
				{ resizeListener }
				{ children }
			</div>
		</ContainerWidthContext.Provider>
	);
};

ContainerWidthContextProvider.propTypes = {
	children: PropTypes.node,
};
woocommerce-blocks/assets/js/base/context/providers/add-to-cart-form/index.js000064400000000066151335517650023411 0ustar00export * from './form';
export * from './form-state';
woocommerce-blocks/assets/js/base/context/providers/add-to-cart-form/form/submit/index.js000064400000006707151335517650025667 0ustar00/**
 * External dependencies
 */
import { __ } from '@wordpress/i18n';
import triggerFetch from '@wordpress/api-fetch';
import { useEffect, useCallback, useState } from '@wordpress/element';
import { decodeEntities } from '@wordpress/html-entities';

/**
 * Internal dependencies
 */
import { useAddToCartFormContext } from '../../form-state';
import { useValidationContext } from '../../../validation';
import { useStoreCart } from '../../../../hooks/cart/use-store-cart';
import { useStoreNotices } from '../../../../hooks/use-store-notices';

/**
 * FormSubmit.
 *
 * Subscribes to add to cart form context and triggers processing via the API.
 */
const FormSubmit = () => {
	const {
		dispatchActions,
		product,
		quantity,
		eventRegistration,
		hasError,
		isProcessing,
		requestParams,
	} = useAddToCartFormContext();
	const {
		hasValidationErrors,
		showAllValidationErrors,
	} = useValidationContext();
	const { addErrorNotice, removeNotice } = useStoreNotices();
	const { receiveCart } = useStoreCart();
	const [ isSubmitting, setIsSubmitting ] = useState( false );
	const doSubmit = ! hasError && isProcessing;

	const checkValidationContext = useCallback( () => {
		if ( hasValidationErrors ) {
			showAllValidationErrors();
			return {
				type: 'error',
			};
		}
		return true;
	}, [ hasValidationErrors, showAllValidationErrors ] );

	// Subscribe to emitter before processing.
	useEffect( () => {
		const unsubscribeProcessing = eventRegistration.onAddToCartBeforeProcessing(
			checkValidationContext,
			0
		);
		return () => {
			unsubscribeProcessing();
		};
	}, [ eventRegistration, checkValidationContext ] );

	// Triggers form submission to the API.
	const submitFormCallback = useCallback( () => {
		setIsSubmitting( true );
		removeNotice( 'add-to-cart' );

		const fetchData = {
			id: product.id || 0,
			quantity,
			...requestParams,
		};

		triggerFetch( {
			path: '/wc/store/cart/add-item',
			method: 'POST',
			data: fetchData,
			cache: 'no-store',
			parse: false,
		} )
			.then( ( fetchResponse ) => {
				// Update nonce.
				triggerFetch.setNonce( fetchResponse.headers );

				// Handle response.
				fetchResponse.json().then( function ( response ) {
					if ( ! fetchResponse.ok ) {
						// We received an error response.
						if ( response.body && response.body.message ) {
							addErrorNotice(
								decodeEntities( response.body.message ),
								{
									id: 'add-to-cart',
								}
							);
						} else {
							addErrorNotice(
								__(
									'Something went wrong. Please contact us to get assistance.',
									'woocommerce'
								),
								{
									id: 'add-to-cart',
								}
							);
						}
						dispatchActions.setHasError();
					} else {
						receiveCart( response );
					}
					dispatchActions.setAfterProcessing( response );
					setIsSubmitting( false );
				} );
			} )
			.catch( ( error ) => {
				error.json().then( function ( response ) {
					// If updated cart state was returned, also update that.
					if ( response.data?.cart ) {
						receiveCart( response.data.cart );
					}
					dispatchActions.setHasError();
					dispatchActions.setAfterProcessing( response );
					setIsSubmitting( false );
				} );
			} );
	}, [
		product,
		addErrorNotice,
		removeNotice,
		receiveCart,
		dispatchActions,
		quantity,
		requestParams,
	] );

	useEffect( () => {
		if ( doSubmit && ! isSubmitting ) {
			submitFormCallback();
		}
	}, [ doSubmit, submitFormCallback, isSubmitting ] );

	return null;
};

export default FormSubmit;
woocommerce-blocks/assets/js/base/context/providers/add-to-cart-form/form/index.js000064400000001766151335517650024364 0ustar00/**
 * Internal dependencies
 */
import { AddToCartFormStateContextProvider } from '../form-state';
import { ValidationContextProvider } from '../../validation';
import FormSubmit from './submit';

/**
 * Add to cart form provider.
 *
 * This wraps the add to cart form and provides an api interface for children via various hooks.
 *
 * @param {Object}  props                    Incoming props for the provider.
 * @param {Object}  props.children           The children being wrapped.
 * @param {Object} [props.product]           The product for which the form belongs to.
 * @param {boolean} [props.showFormElements] Should form elements be shown.
 */
export const AddToCartFormContextProvider = ( {
	children,
	product,
	showFormElements,
} ) => {
	return (
		<ValidationContextProvider>
			<AddToCartFormStateContextProvider
				product={ product }
				showFormElements={ showFormElements }
			>
				{ children }
				<FormSubmit />
			</AddToCartFormStateContextProvider>
		</ValidationContextProvider>
	);
};
woocommerce-blocks/assets/js/base/context/providers/add-to-cart-form/form-state/constants.js000064400000001551151335517650026377 0ustar00/**
 * @type {import("@woocommerce/type-defs/add-to-cart-form").AddToCartFormStatusConstants}
 */
export const STATUS = {
	PRISTINE: 'pristine',
	IDLE: 'idle',
	DISABLED: 'disabled',
	PROCESSING: 'processing',
	BEFORE_PROCESSING: 'before_processing',
	AFTER_PROCESSING: 'after_processing',
};

export const DEFAULT_STATE = {
	status: STATUS.PRISTINE,
	hasError: false,
	quantity: 1,
	processingResponse: null,
	requestParams: {},
};
export const ACTION_TYPES = {
	SET_PRISTINE: 'set_pristine',
	SET_IDLE: 'set_idle',
	SET_DISABLED: 'set_disabled',
	SET_PROCESSING: 'set_processing',
	SET_BEFORE_PROCESSING: 'set_before_processing',
	SET_AFTER_PROCESSING: 'set_after_processing',
	SET_PROCESSING_RESPONSE: 'set_processing_response',
	SET_HAS_ERROR: 'set_has_error',
	SET_NO_ERROR: 'set_no_error',
	SET_QUANTITY: 'set_quantity',
	SET_REQUEST_PARAMS: 'set_request_params',
};
woocommerce-blocks/assets/js/base/context/providers/add-to-cart-form/form-state/reducer.js000064400000005544151335517650026022 0ustar00/**
 * Internal dependencies
 */
import { ACTION_TYPES, DEFAULT_STATE, STATUS } from './constants';

const {
	SET_PRISTINE,
	SET_IDLE,
	SET_DISABLED,
	SET_PROCESSING,
	SET_BEFORE_PROCESSING,
	SET_AFTER_PROCESSING,
	SET_PROCESSING_RESPONSE,
	SET_HAS_ERROR,
	SET_NO_ERROR,
	SET_QUANTITY,
	SET_REQUEST_PARAMS,
} = ACTION_TYPES;

const {
	PRISTINE,
	IDLE,
	DISABLED,
	PROCESSING,
	BEFORE_PROCESSING,
	AFTER_PROCESSING,
} = STATUS;

/**
 * Reducer for the checkout state
 *
 * @param {Object} state  Current state.
 * @param {Object} action Incoming action object.
 * @param {number} action.quantity Incoming quantity.
 * @param {string} action.type Type of action.
 * @param {Object} action.data Incoming payload for action.
 */
export const reducer = ( state = DEFAULT_STATE, { quantity, type, data } ) => {
	let newState;
	switch ( type ) {
		case SET_PRISTINE:
			newState = DEFAULT_STATE;
			break;
		case SET_IDLE:
			newState =
				state.status !== IDLE
					? {
							...state,
							status: IDLE,
					  }
					: state;
			break;
		case SET_DISABLED:
			newState =
				state.status !== DISABLED
					? {
							...state,
							status: DISABLED,
					  }
					: state;
			break;
		case SET_QUANTITY:
			newState =
				quantity !== state.quantity
					? {
							...state,
							quantity,
					  }
					: state;
			break;
		case SET_REQUEST_PARAMS:
			newState = {
				...state,
				requestParams: {
					...state.requestParams,
					...data,
				},
			};
			break;
		case SET_PROCESSING_RESPONSE:
			newState = {
				...state,
				processingResponse: data,
			};
			break;
		case SET_PROCESSING:
			newState =
				state.status !== PROCESSING
					? {
							...state,
							status: PROCESSING,
							hasError: false,
					  }
					: state;
			// clear any error state.
			newState =
				newState.hasError === false
					? newState
					: { ...newState, hasError: false };
			break;
		case SET_BEFORE_PROCESSING:
			newState =
				state.status !== BEFORE_PROCESSING
					? {
							...state,
							status: BEFORE_PROCESSING,
							hasError: false,
					  }
					: state;
			break;
		case SET_AFTER_PROCESSING:
			newState =
				state.status !== AFTER_PROCESSING
					? {
							...state,
							status: AFTER_PROCESSING,
					  }
					: state;
			break;
		case SET_HAS_ERROR:
			newState = state.hasError
				? state
				: {
						...state,
						hasError: true,
				  };
			newState =
				state.status === PROCESSING ||
				state.status === BEFORE_PROCESSING
					? {
							...newState,
							status: IDLE,
					  }
					: newState;
			break;
		case SET_NO_ERROR:
			newState = state.hasError
				? {
						...state,
						hasError: false,
				  }
				: state;
			break;
	}
	// automatically update state to idle from pristine as soon as it initially changes.
	if (
		newState !== state &&
		type !== SET_PRISTINE &&
		newState.status === PRISTINE
	) {
		newState.status = IDLE;
	}
	return newState;
};
woocommerce-blocks/assets/js/base/context/providers/add-to-cart-form/form-state/event-emit.js000064400000002570151335517650026442 0ustar00/**
 * Internal dependencies
 */
import {
	emitterCallback,
	reducer,
	emitEvent,
	emitEventWithAbort,
} from '../../../event-emit';

const EMIT_TYPES = {
	ADD_TO_CART_BEFORE_PROCESSING: 'add_to_cart_before_processing',
	ADD_TO_CART_AFTER_PROCESSING_WITH_SUCCESS:
		'add_to_cart_after_processing_with_success',
	ADD_TO_CART_AFTER_PROCESSING_WITH_ERROR:
		'add_to_cart_after_processing_with_error',
};

/**
 * Receives a reducer dispatcher and returns an object with the callback registration function for
 * the add to cart emit events.
 *
 * Calling the event registration function with the callback will register it for the event emitter
 * and will return a dispatcher for removing the registered callback (useful for implementation
 * in `useEffect`).
 *
 * @param {Function} dispatcher The emitter reducer dispatcher.
 *
 * @return {Object} An object with the add to cart form emitter registration
 */
const emitterObservers = ( dispatcher ) => ( {
	onAddToCartAfterProcessingWithSuccess: emitterCallback(
		EMIT_TYPES.ADD_TO_CART_AFTER_PROCESSING_WITH_SUCCESS,
		dispatcher
	),
	onAddToCartProcessingWithError: emitterCallback(
		EMIT_TYPES.ADD_TO_CART_AFTER_PROCESSING_WITH_ERROR,
		dispatcher
	),
	onAddToCartBeforeProcessing: emitterCallback(
		EMIT_TYPES.ADD_TO_CART_BEFORE_PROCESSING,
		dispatcher
	),
} );

export { EMIT_TYPES, emitterObservers, reducer, emitEvent, emitEventWithAbort };
woocommerce-blocks/assets/js/base/context/providers/add-to-cart-form/form-state/actions.js000064400000002107151335517650026021 0ustar00/**
 * Internal dependencies
 */
import { ACTION_TYPES } from './constants';

const {
	SET_PRISTINE,
	SET_IDLE,
	SET_DISABLED,
	SET_PROCESSING,
	SET_BEFORE_PROCESSING,
	SET_AFTER_PROCESSING,
	SET_PROCESSING_RESPONSE,
	SET_HAS_ERROR,
	SET_NO_ERROR,
	SET_QUANTITY,
	SET_REQUEST_PARAMS,
} = ACTION_TYPES;

/**
 * All the actions that can be dispatched for the checkout.
 */
export const actions = {
	setPristine: () => ( {
		type: SET_PRISTINE,
	} ),
	setIdle: () => ( {
		type: SET_IDLE,
	} ),
	setDisabled: () => ( {
		type: SET_DISABLED,
	} ),
	setProcessing: () => ( {
		type: SET_PROCESSING,
	} ),
	setBeforeProcessing: () => ( {
		type: SET_BEFORE_PROCESSING,
	} ),
	setAfterProcessing: () => ( {
		type: SET_AFTER_PROCESSING,
	} ),
	setProcessingResponse: ( data ) => ( {
		type: SET_PROCESSING_RESPONSE,
		data,
	} ),
	setHasError: ( hasError = true ) => {
		const type = hasError ? SET_HAS_ERROR : SET_NO_ERROR;
		return { type };
	},
	setQuantity: ( quantity ) => ( {
		type: SET_QUANTITY,
		quantity,
	} ),
	setRequestParams: ( data ) => ( {
		type: SET_REQUEST_PARAMS,
		data,
	} ),
};
woocommerce-blocks/assets/js/base/context/providers/add-to-cart-form/form-state/index.js000064400000022222151335517650025470 0ustar00/**
 * External dependencies
 */
import {
	createContext,
	useContext,
	useReducer,
	useMemo,
	useEffect,
} from '@wordpress/element';
import { __ } from '@wordpress/i18n';
import { useShallowEqual } from '@woocommerce/base-hooks';
import {
	productIsPurchasable,
	productSupportsAddToCartForm,
} from '@woocommerce/base-utils';

/**
 * Internal dependencies
 */
import { actions } from './actions';
import { reducer } from './reducer';
import { DEFAULT_STATE, STATUS } from './constants';
import {
	EMIT_TYPES,
	emitterObservers,
	emitEvent,
	emitEventWithAbort,
	reducer as emitReducer,
} from './event-emit';
import { useValidationContext } from '../../validation';
import { useStoreNotices } from '../../../hooks/use-store-notices';
import { useEmitResponse } from '../../../hooks/use-emit-response';

/**
 * @typedef {import('@woocommerce/type-defs/add-to-cart-form').AddToCartFormDispatchActions} AddToCartFormDispatchActions
 * @typedef {import('@woocommerce/type-defs/add-to-cart-form').AddToCartFormEventRegistration} AddToCartFormEventRegistration
 * @typedef {import('@woocommerce/type-defs/contexts').AddToCartFormContext} AddToCartFormContext
 */

const AddToCartFormContext = createContext( {
	product: {},
	productType: 'simple',
	productIsPurchasable: true,
	productHasOptions: false,
	supportsFormElements: true,
	showFormElements: false,
	quantity: 0,
	minQuantity: 1,
	maxQuantity: 99,
	requestParams: {},
	isIdle: false,
	isDisabled: false,
	isProcessing: false,
	isBeforeProcessing: false,
	isAfterProcessing: false,
	hasError: false,
	eventRegistration: {
		onAddToCartAfterProcessingWithSuccess: ( callback ) => void callback,
		onAddToCartAfterProcessingWithError: ( callback ) => void callback,
		onAddToCartBeforeProcessing: ( callback ) => void callback,
	},
	dispatchActions: {
		resetForm: () => void null,
		submitForm: () => void null,
		setQuantity: ( quantity ) => void quantity,
		setHasError: ( hasError ) => void hasError,
		setAfterProcessing: ( response ) => void response,
		setRequestParams: ( data ) => void data,
	},
} );

/**
 * @return {AddToCartFormContext} Returns the add to cart form data context value
 */
export const useAddToCartFormContext = () => {
	// @ts-ignore
	return useContext( AddToCartFormContext );
};

/**
 * Add to cart form state provider.
 *
 * This provides provides an api interface exposing add to cart form state.
 *
 * @param {Object}  props                    Incoming props for the provider.
 * @param {Object}  props.children           The children being wrapped.
 * @param {Object} [props.product]           The product for which the form belongs to.
 * @param {boolean} [props.showFormElements] Should form elements be shown.
 */
export const AddToCartFormStateContextProvider = ( {
	children,
	product,
	showFormElements,
} ) => {
	const [ addToCartFormState, dispatch ] = useReducer(
		reducer,
		DEFAULT_STATE
	);
	const [ observers, observerDispatch ] = useReducer( emitReducer, {} );
	const currentObservers = useShallowEqual( observers );
	const { addErrorNotice, removeNotices } = useStoreNotices();
	const { setValidationErrors } = useValidationContext();
	const {
		isSuccessResponse,
		isErrorResponse,
		isFailResponse,
	} = useEmitResponse();

	/**
	 * @type {AddToCartFormEventRegistration}
	 */
	const eventRegistration = useMemo(
		() => ( {
			onAddToCartAfterProcessingWithSuccess: emitterObservers(
				observerDispatch
			).onAddToCartAfterProcessingWithSuccess,
			onAddToCartAfterProcessingWithError: emitterObservers(
				observerDispatch
			).onAddToCartAfterProcessingWithError,
			onAddToCartBeforeProcessing: emitterObservers( observerDispatch )
				.onAddToCartBeforeProcessing,
		} ),
		[ observerDispatch ]
	);

	/**
	 * @type {AddToCartFormDispatchActions}
	 */
	const dispatchActions = useMemo(
		() => ( {
			resetForm: () => void dispatch( actions.setPristine() ),
			submitForm: () => void dispatch( actions.setBeforeProcessing() ),
			setQuantity: ( quantity ) =>
				void dispatch( actions.setQuantity( quantity ) ),
			setHasError: ( hasError ) =>
				void dispatch( actions.setHasError( hasError ) ),
			setRequestParams: ( data ) =>
				void dispatch( actions.setRequestParams( data ) ),
			setAfterProcessing: ( response ) => {
				dispatch( actions.setProcessingResponse( response ) );
				void dispatch( actions.setAfterProcessing() );
			},
		} ),
		[]
	);

	/**
	 * This Effect is responsible for disabling or enabling the form based on the provided product.
	 */
	useEffect( () => {
		const status = addToCartFormState.status;
		const willBeDisabled =
			! product.id || ! productIsPurchasable( product );

		if ( status === STATUS.DISABLED && ! willBeDisabled ) {
			dispatch( actions.setIdle() );
		} else if ( status !== STATUS.DISABLED && willBeDisabled ) {
			dispatch( actions.setDisabled() );
		}
	}, [ addToCartFormState.status, product, dispatch ] );

	/**
	 * This Effect performs events before processing starts.
	 */
	useEffect( () => {
		const status = addToCartFormState.status;

		if ( status === STATUS.BEFORE_PROCESSING ) {
			removeNotices( 'error' );
			emitEvent(
				currentObservers,
				EMIT_TYPES.ADD_TO_CART_BEFORE_PROCESSING,
				{}
			).then( ( response ) => {
				if ( response !== true ) {
					if ( Array.isArray( response ) ) {
						response.forEach(
							( { errorMessage, validationErrors } ) => {
								if ( errorMessage ) {
									addErrorNotice( errorMessage );
								}
								if ( validationErrors ) {
									setValidationErrors( validationErrors );
								}
							}
						);
					}
					dispatch( actions.setIdle() );
				} else {
					dispatch( actions.setProcessing() );
				}
			} );
		}
	}, [
		addToCartFormState.status,
		setValidationErrors,
		addErrorNotice,
		removeNotices,
		dispatch,
		currentObservers,
	] );

	/**
	 * This Effect performs events after processing is complete.
	 */
	useEffect( () => {
		if ( addToCartFormState.status === STATUS.AFTER_PROCESSING ) {
			// @todo: This data package differs from what is passed through in
			// the checkout state context. Should we introduce a "context"
			// property in the data package for this emitted event so that
			// observers are able to know what context the event is firing in?
			const data = {
				processingResponse: addToCartFormState.processingResponse,
			};

			const handleErrorResponse = ( observerResponses ) => {
				let handled = false;
				observerResponses.forEach( ( response ) => {
					const { message, messageContext } = response;
					if (
						( isErrorResponse( response ) ||
							isFailResponse( response ) ) &&
						message
					) {
						const errorOptions = messageContext
							? { context: messageContext }
							: undefined;
						handled = true;
						addErrorNotice( message, errorOptions );
					}
				} );
				return handled;
			};

			if ( addToCartFormState.hasError ) {
				// allow things to customize the error with a fallback if nothing customizes it.
				emitEventWithAbort(
					currentObservers,
					EMIT_TYPES.ADD_TO_CART_AFTER_PROCESSING_WITH_ERROR,
					data
				).then( ( observerResponses ) => {
					if ( ! handleErrorResponse( observerResponses ) ) {
						// no error handling in place by anything so let's fall back to default
						const message =
							data.processingResponse?.message ||
							__(
								'Something went wrong. Please contact us to get assistance.',
								'woocommerce'
							);
						addErrorNotice( message, {
							id: 'add-to-cart',
						} );
					}
					dispatch( actions.setIdle() );
				} );
				return;
			}

			emitEventWithAbort(
				currentObservers,
				EMIT_TYPES.ADD_TO_CART_AFTER_PROCESSING_WITH_SUCCESS,
				data
			).then( ( observerResponses ) => {
				if ( handleErrorResponse( observerResponses ) ) {
					// this will set an error which will end up
					// triggering the onAddToCartAfterProcessingWithError emitter.
					// and then setting to IDLE state.
					dispatch( actions.setHasError( true ) );
				} else {
					dispatch( actions.setIdle() );
				}
			} );
		}
	}, [
		addToCartFormState.status,
		addToCartFormState.hasError,
		addToCartFormState.processingResponse,
		dispatchActions,
		addErrorNotice,
		isErrorResponse,
		isFailResponse,
		isSuccessResponse,
		currentObservers,
	] );

	const supportsFormElements = productSupportsAddToCartForm( product );

	/**
	 * @type {AddToCartFormContext}
	 */
	const contextData = {
		product,
		productType: product.type || 'simple',
		productIsPurchasable: productIsPurchasable( product ),
		productHasOptions: product.has_options || false,
		supportsFormElements,
		showFormElements: showFormElements && supportsFormElements,
		quantity: addToCartFormState.quantity,
		minQuantity: 1,
		maxQuantity: product.quantity_limit || 99,
		requestParams: addToCartFormState.requestParams,
		isIdle: addToCartFormState.status === STATUS.IDLE,
		isDisabled: addToCartFormState.status === STATUS.DISABLED,
		isProcessing: addToCartFormState.status === STATUS.PROCESSING,
		isBeforeProcessing:
			addToCartFormState.status === STATUS.BEFORE_PROCESSING,
		isAfterProcessing:
			addToCartFormState.status === STATUS.AFTER_PROCESSING,
		hasError: addToCartFormState.hasError,
		eventRegistration,
		dispatchActions,
	};
	return (
		<AddToCartFormContext.Provider
			// @ts-ignore
			value={ contextData }
		>
			{ children }
		</AddToCartFormContext.Provider>
	);
};
woocommerce-blocks/assets/js/base/context/providers/validation/index.js000064400000000071151335517650022477 0ustar00export * from './context';
export * from './components';
assets/js/base/context/providers/validation/components/validation-input-error/style.scss000064400000000417151335517650031617 0ustar00woocommerce-blocks.wc-block-components-validation-error {
	@include font-size(smaller);
	color: $alert-red;
	max-width: 100%;
	white-space: normal;

	> p {
		margin: 0;
		padding: 0;
	}
}

.wc-block-components-select + .wc-block-components-validation-error {
	margin-bottom: $gap-large;
}
assets/js/base/context/providers/validation/components/validation-input-error/index.js000064400000001645151335517650031233 0ustar00woocommerce-blocks/**
 * External dependencies
 */
import PropTypes from 'prop-types';

/**
 * Internal dependencies
 */
import { useValidationContext } from '../../context';
import './style.scss';

export const ValidationInputError = ( {
	errorMessage = '',
	propertyName = '',
	elementId = '',
} ) => {
	const { getValidationError, getValidationErrorId } = useValidationContext();

	if ( ! errorMessage || typeof errorMessage !== 'string' ) {
		const error = getValidationError( propertyName ) || {};
		if ( error.message && ! error.hidden ) {
			errorMessage = error.message;
		} else {
			return null;
		}
	}

	return (
		<div className="wc-block-components-validation-error" role="alert">
			<p id={ getValidationErrorId( elementId ) }>{ errorMessage }</p>
		</div>
	);
};

ValidationInputError.propTypes = {
	errorMessage: PropTypes.string,
	propertyName: PropTypes.string,
	elementId: PropTypes.string,
};

export default ValidationInputError;
woocommerce-blocks/assets/js/base/context/providers/validation/components/index.js000064400000000052151335517650024663 0ustar00export * from './validation-input-error';
woocommerce-blocks/assets/js/base/context/providers/validation/context.js000064400000014721151335517650023063 0ustar00/**
 * External dependencies
 */
import {
	createContext,
	useCallback,
	useContext,
	useState,
} from '@wordpress/element';
import { pickBy } from 'lodash';
import isShallowEqual from '@wordpress/is-shallow-equal';

/**
 * @typedef { import('@woocommerce/type-defs/contexts').ValidationContext } ValidationContext
 * @typedef {import('react')} React
 */

const ValidationContext = createContext( {
	getValidationError: () => '',
	setValidationErrors: ( errors ) => void errors,
	clearValidationError: ( property ) => void property,
	clearAllValidationErrors: () => void null,
	hideValidationError: () => void null,
	showValidationError: () => void null,
	showAllValidationErrors: () => void null,
	hasValidationErrors: false,
	getValidationErrorId: ( errorId ) => errorId,
} );

/**
 * @return {ValidationContext} The context values for the validation context.
 */
export const useValidationContext = () => {
	return useContext( ValidationContext );
};

/**
 * Validation context provider
 *
 * Any children of this context will be exposed to validation state and helpers
 * for tracking validation.
 *
 * @param {Object} props Incoming props for the component.
 * @param {JSX.Element} props.children What react elements are wrapped by this component.
 */
export const ValidationContextProvider = ( { children } ) => {
	const [ validationErrors, updateValidationErrors ] = useState( {} );

	/**
	 * This retrieves any validation error message that exists in state for the
	 * given property name.
	 *
	 * @param {string} property The property the error message is for.
	 *
	 * @return {Object} The error object for the given property.
	 */
	const getValidationError = useCallback(
		( property ) => validationErrors[ property ],
		[ validationErrors ]
	);

	/**
	 * Provides an id for the validation error that can be used to fill out
	 * aria-describedby attribute values.
	 *
	 * @param {string} errorId The input css id the validation error is related
	 *                         to.
	 * @return {string} The id to use for the validation error container.
	 */
	const getValidationErrorId = useCallback(
		( errorId ) => {
			const error = validationErrors[ errorId ];
			if ( ! error || error.hidden ) {
				return '';
			}
			return `validate-error-${ errorId }`;
		},
		[ validationErrors ]
	);

	/**
	 * Clears any validation error that exists in state for the given property
	 * name.
	 *
	 * @param {string} property  The name of the property to clear if exists in
	 *                           validation error state.
	 */
	const clearValidationError = useCallback(
		/**
		 * Callback that is memoized.
		 *
		 * @param {string} property
		 */
		( property ) => {
			updateValidationErrors(
				/**
				 * Callback for validation Errors handling.
				 *
				 * @param {Object} prevErrors
				 */
				( prevErrors ) => {
					if ( ! prevErrors[ property ] ) {
						return prevErrors;
					}

					const {
						// eslint-disable-next-line no-unused-vars -- this is intentional to omit the dynamic property from the returned object.
						[ property ]: clearedProperty,
						...newErrors
					} = prevErrors;
					return newErrors;
				}
			);
		},
		[]
	);

	/**
	 * Clears the entire validation error state.
	 */
	const clearAllValidationErrors = useCallback(
		() => void updateValidationErrors( {} ),
		[]
	);

	/**
	 * Used to record new validation errors in the state.
	 *
	 * @param {Object} newErrors An object where keys are the property names the
	 *                           validation error is for and values are the
	 *                           validation error message displayed to the user.
	 */
	const setValidationErrors = useCallback( ( newErrors ) => {
		if ( ! newErrors ) {
			return;
		}
		updateValidationErrors( ( prevErrors ) => {
			newErrors = pickBy( newErrors, ( error, property ) => {
				if ( typeof error.message !== 'string' ) {
					return false;
				}
				if ( prevErrors.hasOwnProperty( property ) ) {
					return ! isShallowEqual( prevErrors[ property ], error );
				}
				return true;
			} );
			if ( Object.values( newErrors ).length === 0 ) {
				return prevErrors;
			}
			return {
				...prevErrors,
				...newErrors,
			};
		} );
	}, [] );

	/**
	 * Used to update a validation error.
	 *
	 * @param {string} property The name of the property to update.
	 * @param {Object} newError New validation error object.
	 */
	const updateValidationError = useCallback( ( property, newError ) => {
		updateValidationErrors( ( prevErrors ) => {
			if ( ! prevErrors.hasOwnProperty( property ) ) {
				return prevErrors;
			}
			const updatedError = {
				...prevErrors[ property ],
				...newError,
			};
			return isShallowEqual( prevErrors[ property ], updatedError )
				? prevErrors
				: {
						...prevErrors,
						[ property ]: updatedError,
				  };
		} );
	}, [] );

	/**
	 * Given a property name and if an associated error exists, it sets its
	 * `hidden` value to true.
	 *
	 * @param {string} property  The name of the property to set the `hidden`
	 *                           value to true.
	 */
	const hideValidationError = useCallback(
		( property ) =>
			void updateValidationError( property, {
				hidden: true,
			} ),
		[ updateValidationError ]
	);

	/**
	 * Given a property name and if an associated error exists, it sets its
	 * `hidden` value to false.
	 *
	 * @param {string} property  The name of the property to set the `hidden`
	 *                           value to false.
	 */
	const showValidationError = useCallback(
		( property ) =>
			void updateValidationError( property, {
				hidden: false,
			} ),
		[ updateValidationError ]
	);

	/**
	 * Sets the `hidden` value of all errors to `false`.
	 */
	const showAllValidationErrors = useCallback(
		() =>
			void updateValidationErrors( ( prevErrors ) => {
				const updatedErrors = {};

				Object.keys( prevErrors ).forEach( ( property ) => {
					if ( prevErrors[ property ].hidden ) {
						updatedErrors[ property ] = {
							...prevErrors[ property ],
							hidden: false,
						};
					}
				} );

				if ( Object.values( updatedErrors ).length === 0 ) {
					return prevErrors;
				}

				return {
					...prevErrors,
					...updatedErrors,
				};
			} ),
		[]
	);

	const context = {
		getValidationError,
		setValidationErrors,
		clearValidationError,
		clearAllValidationErrors,
		hideValidationError,
		showValidationError,
		showAllValidationErrors,
		hasValidationErrors: Object.keys( validationErrors ).length > 0,
		getValidationErrorId,
	};

	return (
		<ValidationContext.Provider value={ context }>
			{ children }
		</ValidationContext.Provider>
	);
};
woocommerce-blocks/assets/js/base/context/providers/store-snackbar-notices/components/style.scss000064400000000515151335517650027505 0ustar00.wc-block-components-notices__snackbar {
	position: fixed;
	bottom: 20px;
	left: 16px;
	width: auto;

	@include breakpoint("<782px") {
		position: fixed;
		top: 10px;
		left: 0;
		bottom: auto;
	}

	.components-snackbar-list__notice-container {
		@include breakpoint("<782px") {
			margin-left: 10px;
			margin-right: 10px;
		}
	}
}
assets/js/base/context/providers/store-snackbar-notices/components/snackbar-notices-container.js000064400000002235151335517650033136 0ustar00woocommerce-blocks/**
 * External dependencies
 */
import { SnackbarList } from 'wordpress-components';
import classnames from 'classnames';
import { __experimentalApplyCheckoutFilter } from '@woocommerce/blocks-checkout';

const EMPTY_SNACKBAR_NOTICES = {};

const SnackbarNoticesContainer = ( {
	className,
	notices,
	removeNotice,
	isEditor,
} ) => {
	if ( isEditor ) {
		return null;
	}

	const snackbarNotices = notices.filter(
		( notice ) => notice.type === 'snackbar'
	);

	const noticeVisibility =
		snackbarNotices.length > 0
			? snackbarNotices.reduce( ( acc, { content } ) => {
					acc[ content ] = true;
					return acc;
			  }, {} )
			: EMPTY_SNACKBAR_NOTICES;

	const filteredNotices = __experimentalApplyCheckoutFilter( {
		filterName: 'snackbarNoticeVisibility',
		defaultValue: noticeVisibility,
	} );

	const visibleNotices = snackbarNotices.filter(
		( notice ) => filteredNotices[ notice.content ] === true
	);

	const wrapperClass = classnames(
		className,
		'wc-block-components-notices__snackbar'
	);

	return (
		<SnackbarList
			notices={ visibleNotices }
			className={ wrapperClass }
			onRemove={ removeNotice }
		/>
	);
};

export default SnackbarNoticesContainer;
woocommerce-blocks/assets/js/base/context/providers/store-snackbar-notices/context.js000064400000006242151335517650025310 0ustar00/**
 * External dependencies
 */
import PropTypes from 'prop-types';
import {
	createContext,
	useContext,
	useCallback,
	useState,
} from '@wordpress/element';
import { useSelect, useDispatch } from '@wordpress/data';
import SnackbarNoticesContainer from '@woocommerce/base-context/providers/store-snackbar-notices/components/snackbar-notices-container';

/**
 * Internal dependencies
 */
import { useStoreEvents } from '../../hooks/use-store-events';
import { useEditorContext } from '../editor-context';

/**
 * @typedef {import('@woocommerce/type-defs/contexts').NoticeContext} NoticeContext
 * @typedef {import('react')} React
 */

const StoreSnackbarNoticesContext = createContext( {
	notices: [],
	createSnackbarNotice: ( content, options ) => void { content, options },
	removeSnackbarNotice: ( id, ctxt ) => void { id, ctxt },
	setIsSuppressed: ( val ) => void { val },
	context: 'wc/core',
} );

/**
 * Returns the notices context values.
 *
 * @return {NoticeContext} The notice context value from the notice context.
 */
export const useStoreSnackbarNoticesContext = () => {
	return useContext( StoreSnackbarNoticesContext );
};

/**
 * Provides an interface for blocks to add notices to the frontend UI.
 *
 * Statuses map to https://github.com/WordPress/gutenberg/tree/master/packages/components/src/notice
 *  - Default (no status)
 *  - Error
 *  - Warning
 *  - Info
 *  - Success
 *
 * @param {Object} props Incoming props for the component.
 * @param {React.ReactChildren} props.children The Elements wrapped by this component.
 * @param {string} props.context The notice context for notices being rendered.
 */
export const StoreSnackbarNoticesProvider = ( {
	children,
	context = 'wc/core',
} ) => {
	const { createNotice, removeNotice } = useDispatch( 'core/notices' );
	const [ isSuppressed, setIsSuppressed ] = useState( false );
	const { dispatchStoreEvent } = useStoreEvents();
	const { isEditor } = useEditorContext();

	const createSnackbarNotice = useCallback(
		( content = '', options = {} ) => {
			createNotice( 'default', content, {
				...options,
				type: 'snackbar',
				context: options.context || context,
			} );
			dispatchStoreEvent( 'store-notice-create', {
				status: 'default',
				content,
				options,
			} );
		},
		[ createNotice, dispatchStoreEvent, context ]
	);

	const removeSnackbarNotice = useCallback(
		( id, ctxt = context ) => {
			removeNotice( id, ctxt );
		},
		[ removeNotice, context ]
	);

	const { notices } = useSelect(
		( select ) => {
			return {
				notices: select( 'core/notices' ).getNotices( context ),
			};
		},
		[ context ]
	);

	const contextValue = {
		notices,
		createSnackbarNotice,
		removeSnackbarNotice,
		context,
		setIsSuppressed,
	};

	const snackbarNoticeOutput = isSuppressed ? null : (
		<SnackbarNoticesContainer
			notices={ contextValue.notices }
			removeNotice={ contextValue.removeSnackbarNotice }
			isEditor={ isEditor }
		/>
	);

	return (
		<StoreSnackbarNoticesContext.Provider value={ contextValue }>
			{ children }
			{ snackbarNoticeOutput }
		</StoreSnackbarNoticesContext.Provider>
	);
};

StoreSnackbarNoticesProvider.propTypes = {
	className: PropTypes.string,
	children: PropTypes.node,
	context: PropTypes.string,
};
woocommerce-blocks/assets/js/base/context/providers/store-snackbar-notices/index.ts000064400000000033151335517650024735 0ustar00export * from './context';
woocommerce-blocks/assets/js/base/context/index.ts000064400000000124151335517650016341 0ustar00export * from './event-emit';
export * from './hooks';
export * from './providers';
woocommerce-blocks/assets/js/base/hocs/with-scroll-to-top/style.scss000064400000000117151335517650021660 0ustar00.with-scroll-to-top__scroll-point {
	position: relative;
	top: -$gap-larger;
}
woocommerce-blocks/assets/js/base/hocs/with-scroll-to-top/index.tsx000064400000003704151335517650021477 0ustar00/**
 * External dependencies
 */
import { useRef } from '@wordpress/element';

/**
 * Internal dependencies
 */
import './style.scss';

interface ScrollToTopProps {
	focusableSelector?: string;
}

const maybeScrollToTop = ( scrollPoint: HTMLElement ): void => {
	if ( ! scrollPoint ) {
		return;
	}

	const yPos = scrollPoint.getBoundingClientRect().bottom;
	const isScrollPointVisible = yPos >= 0 && yPos <= window.innerHeight;

	if ( ! isScrollPointVisible ) {
		scrollPoint.scrollIntoView();
	}
};

const moveFocusToElement = (
	scrollPoint: HTMLElement,
	focusableSelector: string
): void => {
	const focusableElements =
		scrollPoint.parentElement?.querySelectorAll( focusableSelector ) || [];

	if ( focusableElements.length ) {
		const targetElement = focusableElements[ 0 ] as HTMLElement;
		maybeScrollToTop( targetElement );
		targetElement?.focus();
	} else {
		maybeScrollToTop( scrollPoint );
	}
};

const scrollToHTMLElement = (
	scrollPoint: HTMLElement,
	options: ScrollToTopProps
): void => {
	const { focusableSelector } = options || {};

	if ( ! window || ! Number.isFinite( window.innerHeight ) ) {
		return;
	}

	if ( focusableSelector ) {
		moveFocusToElement( scrollPoint, focusableSelector );
	} else {
		maybeScrollToTop( scrollPoint );
	}
};

/**
 * HOC that provides a function to scroll to the top of the component.
 */
const withScrollToTop = (
	OriginalComponent: React.FunctionComponent< Record< string, unknown > >
) => {
	return ( props: Record< string, unknown > ): JSX.Element => {
		const scrollPointRef = useRef< HTMLDivElement >( null );
		const scrollToTop = ( args: ScrollToTopProps ) => {
			if ( scrollPointRef.current !== null ) {
				scrollToHTMLElement( scrollPointRef.current, args );
			}
		};
		return (
			<>
				<div
					className="with-scroll-to-top__scroll-point"
					ref={ scrollPointRef }
					aria-hidden
				/>
				<OriginalComponent { ...props } scrollToTop={ scrollToTop } />
			</>
		);
	};
};

export default withScrollToTop;
woocommerce-blocks/assets/js/base/hocs/with-scroll-to-top/test/index.js000064400000004250151335517650022251 0ustar00/**
 * External dependencies
 */
import TestRenderer from 'react-test-renderer';

/**
 * Internal dependencies
 */
import withScrollToTop from '../index';

const TestComponent = withScrollToTop( ( props ) => (
	<span { ...props }>
		<button />
	</span>
) );

const focusedMock = jest.fn();
const scrollIntoViewMock = jest.fn();

const mockedButton = {
	focus: focusedMock,
	scrollIntoView: scrollIntoViewMock,
};
const render = ( { inView } ) => {
	const getBoundingClientRect = () => ( {
		bottom: inView ? 0 : -10,
	} );
	return TestRenderer.create( <TestComponent />, {
		createNodeMock: ( element ) => {
			if ( element.type === 'button' ) {
				return {
					...mockedButton,
					getBoundingClientRect,
				};
			}
			if ( element.type === 'div' ) {
				return {
					getBoundingClientRect,
					parentElement: {
						querySelectorAll: () => [
							{ ...mockedButton, getBoundingClientRect },
						],
					},
					scrollIntoView: scrollIntoViewMock,
				};
			}
			return null;
		},
	} );
};

describe( 'withScrollToTop Component', () => {
	afterEach( () => {
		focusedMock.mockReset();
		scrollIntoViewMock.mockReset();
	} );

	describe( 'if component is not in view', () => {
		beforeEach( () => {
			const renderer = render( { inView: false } );
			const props = renderer.root.findByType( 'span' ).props;
			props.scrollToTop( { focusableSelector: 'button' } );
		} );

		it( 'scrolls to top of the component when scrollToTop is called', () => {
			expect( scrollIntoViewMock ).toHaveBeenCalledTimes( 1 );
		} );

		it( 'moves focus to top of the component when scrollToTop is called', () => {
			expect( focusedMock ).toHaveBeenCalledTimes( 1 );
		} );
	} );

	describe( 'if component is in view', () => {
		beforeEach( () => {
			const renderer = render( { inView: true } );
			const props = renderer.root.findByType( 'span' ).props;
			props.scrollToTop( { focusableSelector: 'button' } );
		} );

		it( "doesn't scroll to top of the component when scrollToTop is called", () => {
			expect( scrollIntoViewMock ).toHaveBeenCalledTimes( 0 );
		} );

		it( 'moves focus to top of the component when scrollToTop is called', () => {
			expect( focusedMock ).toHaveBeenCalledTimes( 1 );
		} );
	} );
} );
woocommerce-blocks/assets/js/base/hocs/with-reviews.js000064400000012336151335517650017135 0ustar00/**
 * External dependencies
 */
import { Component } from 'react';
import PropTypes from 'prop-types';
import isShallowEqual from '@wordpress/is-shallow-equal';

/**
 * Internal dependencies
 */
import { getReviews } from '../../blocks/reviews/utils';
import { formatError } from '../utils/errors.js';

/**
 * HOC that queries reviews for a component.
 *
 * @param {Function} OriginalComponent Component being wrapped.
 */
const withReviews = ( OriginalComponent ) => {
	class WrappedComponent extends Component {
		static propTypes = {
			order: PropTypes.oneOf( [ 'asc', 'desc' ] ).isRequired,
			orderby: PropTypes.string.isRequired,
			reviewsToDisplay: PropTypes.number.isRequired,
			categoryIds: PropTypes.oneOfType( [
				PropTypes.string,
				PropTypes.array,
			] ),
			delayFunction: PropTypes.func,
			onReviewsAppended: PropTypes.func,
			onReviewsLoadError: PropTypes.func,
			onReviewsReplaced: PropTypes.func,
			productId: PropTypes.oneOfType( [
				PropTypes.string,
				PropTypes.number,
			] ),
		};

		static defaultProps = {
			delayFunction: ( f ) => f,
			onReviewsAppended: () => {},
			onReviewsLoadError: () => {},
			onReviewsReplaced: () => {},
		};

		isPreview = !! this.props.attributes.previewReviews;

		delayedAppendReviews = this.props.delayFunction( this.appendReviews );

		isMounted = false;

		state = {
			error: null,
			loading: true,
			reviews: this.isPreview ? this.props.attributes.previewReviews : [],
			totalReviews: this.isPreview
				? this.props.attributes.previewReviews.length
				: 0,
		};

		componentDidMount() {
			this.isMounted = true;
			this.replaceReviews();
		}

		componentDidUpdate( prevProps ) {
			if ( prevProps.reviewsToDisplay < this.props.reviewsToDisplay ) {
				// Since this attribute might be controlled via something with
				// short intervals between value changes, this allows for optionally
				// delaying review fetches via the provided delay function.
				this.delayedAppendReviews();
			} else if ( this.shouldReplaceReviews( prevProps, this.props ) ) {
				this.replaceReviews();
			}
		}

		shouldReplaceReviews( prevProps, nextProps ) {
			return (
				prevProps.orderby !== nextProps.orderby ||
				prevProps.order !== nextProps.order ||
				prevProps.productId !== nextProps.productId ||
				! isShallowEqual( prevProps.categoryIds, nextProps.categoryIds )
			);
		}

		componentWillUnmount() {
			this.isMounted = false;

			if ( this.delayedAppendReviews.cancel ) {
				this.delayedAppendReviews.cancel();
			}
		}

		getArgs( reviewsToSkip ) {
			const {
				categoryIds,
				order,
				orderby,
				productId,
				reviewsToDisplay,
			} = this.props;
			const args = {
				order,
				orderby,
				per_page: reviewsToDisplay - reviewsToSkip,
				offset: reviewsToSkip,
			};

			if ( categoryIds && categoryIds.length ) {
				args.category_id = Array.isArray( categoryIds )
					? categoryIds.join( ',' )
					: categoryIds;
			}

			if ( productId ) {
				args.product_id = productId;
			}

			return args;
		}

		replaceReviews() {
			if ( this.isPreview ) {
				return;
			}

			const { onReviewsReplaced } = this.props;
			this.updateListOfReviews().then( onReviewsReplaced );
		}

		appendReviews() {
			if ( this.isPreview ) {
				return;
			}

			const { onReviewsAppended, reviewsToDisplay } = this.props;
			const { reviews } = this.state;

			// Given that this function is delayed, props might have been updated since
			// it was called so we need to check again if fetching new reviews is necessary.
			if ( reviewsToDisplay <= reviews.length ) {
				return;
			}

			this.updateListOfReviews( reviews ).then( onReviewsAppended );
		}

		updateListOfReviews( oldReviews = [] ) {
			const { reviewsToDisplay } = this.props;
			const { totalReviews } = this.state;
			const reviewsToLoad =
				Math.min( totalReviews, reviewsToDisplay ) - oldReviews.length;

			this.setState( {
				loading: true,
				reviews: oldReviews.concat( Array( reviewsToLoad ).fill( {} ) ),
			} );

			return getReviews( this.getArgs( oldReviews.length ) )
				.then(
					( {
						reviews: newReviews,
						totalReviews: newTotalReviews,
					} ) => {
						if ( this.isMounted ) {
							this.setState( {
								reviews: oldReviews
									.filter(
										( review ) =>
											Object.keys( review ).length
									)
									.concat( newReviews ),
								totalReviews: newTotalReviews,
								loading: false,
								error: null,
							} );
						}

						return { newReviews };
					}
				)
				.catch( this.setError );
		}

		setError = async ( e ) => {
			if ( ! this.isMounted ) {
				return;
			}
			const { onReviewsLoadError } = this.props;
			const error = await formatError( e );

			this.setState( { reviews: [], loading: false, error } );

			onReviewsLoadError( error );
		};

		render() {
			const { reviewsToDisplay } = this.props;
			const { error, loading, reviews, totalReviews } = this.state;

			return (
				<OriginalComponent
					{ ...this.props }
					error={ error }
					isLoading={ loading }
					reviews={ reviews.slice( 0, reviewsToDisplay ) }
					totalReviews={ totalReviews }
				/>
			);
		}
	}

	const {
		displayName = OriginalComponent.name || 'Component',
	} = OriginalComponent;
	WrappedComponent.displayName = `WithReviews( ${ displayName } )`;

	return WrappedComponent;
};

export default withReviews;
woocommerce-blocks/assets/js/base/hocs/test/with-reviews.js000064400000007713151335517650020117 0ustar00/**
 * External dependencies
 */
import TestRenderer from 'react-test-renderer';

/**
 * Internal dependencies
 */
import withReviews from '../with-reviews';
import * as mockUtils from '../../../blocks/reviews/utils';
import * as mockBaseUtils from '../../utils/errors';

jest.mock( '../../../blocks/reviews/utils', () => ( {
	getSortArgs: () => ( {
		order: 'desc',
		orderby: 'date_gmt',
	} ),
	getReviews: jest.fn(),
} ) );

jest.mock( '../../utils/errors', () => ( {
	formatError: jest.fn(),
} ) );

const mockReviews = [
	{ reviewer: 'Alice', review: 'Lorem ipsum', rating: 2 },
	{ reviewer: 'Bob', review: 'Dolor sit amet', rating: 3 },
	{ reviewer: 'Carol', review: 'Consectetur adipiscing elit', rating: 5 },
];
const defaultArgs = {
	offset: 0,
	order: 'desc',
	orderby: 'date_gmt',
	per_page: 2,
	product_id: 1,
};
const TestComponent = withReviews( ( props ) => {
	return (
		<div
			error={ props.error }
			getReviews={ props.getReviews }
			appendReviews={ props.appendReviews }
			onChangeArgs={ props.onChangeArgs }
			isLoading={ props.isLoading }
			reviews={ props.reviews }
			totalReviews={ props.totalReviews }
		/>
	);
} );
const render = () => {
	return TestRenderer.create(
		<TestComponent
			attributes={ {} }
			order="desc"
			orderby="date_gmt"
			productId={ 1 }
			reviewsToDisplay={ 2 }
		/>
	);
};

describe( 'withReviews Component', () => {
	let renderer;
	afterEach( () => {
		mockUtils.getReviews.mockReset();
	} );

	describe( 'lifecycle events', () => {
		beforeEach( () => {
			mockUtils.getReviews
				.mockImplementationOnce( () =>
					Promise.resolve( {
						reviews: mockReviews.slice( 0, 2 ),
						totalReviews: mockReviews.length,
					} )
				)
				.mockImplementationOnce( () =>
					Promise.resolve( {
						reviews: mockReviews.slice( 2, 3 ),
						totalReviews: mockReviews.length,
					} )
				);
			renderer = render();
		} );

		it( 'getReviews is called on mount with default args', () => {
			const { getReviews } = mockUtils;

			expect( getReviews ).toHaveBeenCalledWith( defaultArgs );
			expect( getReviews ).toHaveBeenCalledTimes( 1 );
		} );

		it( 'getReviews is called on component update', () => {
			const { getReviews } = mockUtils;
			renderer.update(
				<TestComponent
					order="desc"
					orderby="date_gmt"
					productId={ 1 }
					reviewsToDisplay={ 3 }
				/>
			);

			expect( getReviews ).toHaveBeenNthCalledWith( 2, {
				...defaultArgs,
				offset: 2,
				per_page: 1,
			} );
			expect( getReviews ).toHaveBeenCalledTimes( 2 );
		} );
	} );

	describe( 'when the API returns product data', () => {
		beforeEach( () => {
			mockUtils.getReviews.mockImplementation( () =>
				Promise.resolve( {
					reviews: mockReviews.slice( 0, 2 ),
					totalReviews: mockReviews.length,
				} )
			);
			renderer = render();
		} );

		it( 'sets reviews based on API response', () => {
			const props = renderer.root.findByType( 'div' ).props;

			expect( props.error ).toBeNull();
			expect( props.isLoading ).toBe( false );
			expect( props.reviews ).toEqual( mockReviews.slice( 0, 2 ) );
			expect( props.totalReviews ).toEqual( mockReviews.length );
		} );
	} );

	describe( 'when the API returns an error', () => {
		const error = { message: 'There was an error.' };
		const getReviewsPromise = Promise.reject( error );
		const formattedError = { message: 'There was an error.', type: 'api' };

		beforeEach( () => {
			mockUtils.getReviews.mockImplementation( () => getReviewsPromise );
			mockBaseUtils.formatError.mockImplementation(
				() => formattedError
			);
			renderer = render();
		} );

		test( 'sets the error prop', async () => {
			await expect( () => getReviewsPromise() ).toThrow();

			const { formatError } = mockBaseUtils;
			const props = renderer.root.findByType( 'div' ).props;

			expect( formatError ).toHaveBeenCalledWith( error );
			expect( formatError ).toHaveBeenCalledTimes( 1 );
			expect( props.error ).toEqual( formattedError );
			expect( props.isLoading ).toBe( false );
			expect( props.reviews ).toEqual( [] );
		} );
	} );
} );
woocommerce-blocks/assets/js/base/hocs/with-filtered-attributes.js000064400000001136151335517650021427 0ustar00/**
 * External dependencies
 */
import { getValidBlockAttributes } from '@woocommerce/base-utils';

/**
 * HOC that filters given attributes by valid block attribute values, or uses defaults if undefined.
 *
 * @param {Object} blockAttributes Component being wrapped.
 */
const withFilteredAttributes = ( blockAttributes ) => ( OriginalComponent ) => {
	return ( ownProps ) => {
		const validBlockAttributes = getValidBlockAttributes(
			blockAttributes,
			ownProps
		);

		return (
			<OriginalComponent { ...ownProps } { ...validBlockAttributes } />
		);
	};
};

export default withFilteredAttributes;
woocommerce-blocks/assets/js/data/query-state/selectors.js000064400000003076151335517650020032 0ustar00/**
 * Internal dependencies
 */
import { getStateForContext } from './utils';

/**
 * Selector for retrieving a specific query-state for the given context.
 *
 * @param {Object} state    Current state.
 * @param {string} context  Context for the query-state being retrieved.
 * @param {string} queryKey Key for the specific query-state item.
 * @param {*} defaultValue  Default value for the query-state key if it doesn't
 *                          currently exist in state.
 *
 * @return {*} The currently stored value or the defaultValue if not present.
 */
export const getValueForQueryKey = (
	state,
	context,
	queryKey,
	defaultValue = {}
) => {
	let stateContext = getStateForContext( state, context );
	if ( stateContext === null ) {
		return defaultValue;
	}
	stateContext = JSON.parse( stateContext );
	return typeof stateContext[ queryKey ] !== 'undefined'
		? stateContext[ queryKey ]
		: defaultValue;
};

/**
 * Selector for retrieving the query-state for the given context.
 *
 * @param {Object} state   The current state.
 * @param {string} context The context for the query-state being retrieved.
 * @param {*} defaultValue The default value to return if there is no state for
 *                         the given context.
 *
 * @return {*} The currently stored query-state for the given context or
 *             defaultValue if not present in state.
 */
export const getValueForQueryContext = (
	state,
	context,
	defaultValue = {}
) => {
	const stateContext = getStateForContext( state, context );
	return stateContext === null ? defaultValue : JSON.parse( stateContext );
};
woocommerce-blocks/assets/js/data/query-state/action-types.js000064400000000203151335517650020433 0ustar00export const ACTION_TYPES = {
	SET_QUERY_KEY_VALUE: 'SET_QUERY_KEY_VALUE',
	SET_QUERY_CONTEXT_VALUE: 'SET_QUERY_CONTEXT_VALUE',
};
woocommerce-blocks/assets/js/data/query-state/index.js000064400000000602151335517650017126 0ustar00/**
 * External dependencies
 */
import { registerStore } from '@wordpress/data';

/**
 * Internal dependencies
 */
import { STORE_KEY } from './constants';
import * as selectors from './selectors';
import * as actions from './actions';
import reducer from './reducers';

registerStore( STORE_KEY, {
	reducer,
	actions,
	selectors,
} );

export const QUERY_STATE_STORE_KEY = STORE_KEY;
woocommerce-blocks/assets/js/data/query-state/test/reducers.js000064400000006035151335517650020620 0ustar00/**
 * External dependencies
 */
import deepFreeze from 'deep-freeze';

/**
 * Internal dependencies
 */
import queryStateReducer from '../reducers';
import { setQueryValue, setValueForQueryContext } from '../actions';

describe( 'queryStateReducer', () => {
	const originalState = deepFreeze( {
		contexta: JSON.stringify( {
			foo: 'bar',
			cheese: 'pizza',
		} ),
	} );
	it(
		'returns original state when the action is not of the type being ' +
			'processed',
		() => {
			expect(
				queryStateReducer( originalState, { type: 'invalid' } )
			).toBe( originalState );
		}
	);
	describe( 'SET_QUERY_KEY_VALUE action', () => {
		it(
			'returns original state when incoming query-state key value ' +
				'matches what is already in the state',
			() => {
				expect(
					queryStateReducer(
						originalState,
						setQueryValue( 'contexta', 'foo', 'bar' )
					)
				).toBe( originalState );
			}
		);
		it(
			'returns new state when incoming query-state key exist ' +
				'but the value is a new value',
			() => {
				const newState = queryStateReducer(
					originalState,
					setQueryValue( 'contexta', 'foo', 'zed' )
				);
				expect( newState ).not.toBe( originalState );
				expect( newState ).toEqual( {
					contexta: JSON.stringify( {
						foo: 'zed',
						cheese: 'pizza',
					} ),
				} );
			}
		);
		it(
			'returns new state when incoming query-state key does not ' +
				'exist',
			() => {
				const newState = queryStateReducer(
					originalState,
					setQueryValue( 'contexta', 'burger', 'pizza' )
				);
				expect( newState ).not.toBe( originalState );
				expect( newState ).toEqual( {
					contexta: JSON.stringify( {
						foo: 'bar',
						cheese: 'pizza',
						burger: 'pizza',
					} ),
				} );
			}
		);
	} );
	describe( 'SET_QUERY_CONTEXT_VALUE action', () => {
		it(
			'returns original state when incoming context value matches ' +
				'what is already in the state',
			() => {
				expect(
					queryStateReducer(
						originalState,
						setValueForQueryContext( 'contexta', {
							foo: 'bar',
							cheese: 'pizza',
						} )
					)
				).toBe( originalState );
			}
		);
		it(
			'returns new state when incoming context value is different ' +
				'than what is already in the state',
			() => {
				const newState = queryStateReducer(
					originalState,
					setValueForQueryContext( 'contexta', {
						bar: 'foo',
						pizza: 'cheese',
					} )
				);
				expect( newState ).not.toBe( originalState );
				expect( newState ).toEqual( {
					contexta: JSON.stringify( {
						bar: 'foo',
						pizza: 'cheese',
					} ),
				} );
			}
		);
		it(
			'returns new state when incoming context does not exist in the ' +
				'state',
			() => {
				const newState = queryStateReducer(
					originalState,
					setValueForQueryContext( 'contextb', {
						foo: 'bar',
					} )
				);
				expect( newState ).not.toBe( originalState );
				expect( newState ).toEqual( {
					contexta: JSON.stringify( {
						foo: 'bar',
						cheese: 'pizza',
					} ),
					contextb: JSON.stringify( {
						foo: 'bar',
					} ),
				} );
			}
		);
	} );
} );
woocommerce-blocks/assets/js/data/query-state/test/selectors.js000064400000002550151335517650021005 0ustar00/**
 * External dependencies
 */
import deepFreeze from 'deep-freeze';

/**
 * Internal dependencies
 */
import { getValueForQueryKey, getValueForQueryContext } from '../selectors';

const testState = deepFreeze( {
	contexta: JSON.stringify( {
		foo: 'bar',
		cheese: 'pizza',
	} ),
} );

describe( 'getValueForQueryKey', () => {
	it(
		'returns provided default value when there is no state for the ' +
			'given context',
		() => {
			expect(
				getValueForQueryKey( testState, 'invalid', 'foo', 42 )
			).toBe( 42 );
		}
	);
	it(
		'returns provided default value when there is no value for the ' +
			'given context and queryKey',
		() => {
			expect(
				getValueForQueryKey( testState, 'contexta', 'pizza', 42 )
			).toBe( 42 );
		}
	);
	it( 'returns expected value when context and queryKey exist', () => {
		expect( getValueForQueryKey( testState, 'contexta', 'foo', 42 ) ).toBe(
			'bar'
		);
	} );
} );

describe( 'getValueForQueryContext', () => {
	it(
		'returns provided default value when there is no state for the ' +
			'given context',
		() => {
			expect( getValueForQueryContext( testState, 'invalid', 42 ) ).toBe(
				42
			);
		}
	);
	it(
		'returns expected value when selecting a context that exists in ' +
			'state',
		() => {
			expect(
				getValueForQueryContext( testState, 'contexta', 42 )
			).toEqual( JSON.parse( testState.contexta ) );
		}
	);
} );
woocommerce-blocks/assets/js/data/query-state/utils.js000064400000000210151335517650017152 0ustar00export const getStateForContext = ( state, context ) => {
	return typeof state[ context ] === 'undefined' ? null : state[ context ];
};
woocommerce-blocks/assets/js/data/query-state/constants.js000064400000000061151335517650020032 0ustar00export const STORE_KEY = 'wc/store/query-state';
woocommerce-blocks/assets/js/data/query-state/actions.js000064400000001650151335517650017463 0ustar00/**
 * Internal dependencies
 */
import { ACTION_TYPES as types } from './action-types';

/**
 * Action creator for setting a single query-state value for a given context.
 *
 * @param {string} context  Context for query state being stored.
 * @param {string} queryKey Key for query item.
 * @param {*}      value    The value for the query item.
 *
 * @return {Object} The action object.
 */
export const setQueryValue = ( context, queryKey, value ) => {
	return {
		type: types.SET_QUERY_KEY_VALUE,
		context,
		queryKey,
		value,
	};
};

/**
 * Action creator for setting query-state for a given context.
 *
 * @param {string} context Context for query state being stored.
 * @param {*}      value   Query state being stored for the given context.
 *
 * @return {Object} The action object.
 */
export const setValueForQueryContext = ( context, value ) => {
	return {
		type: types.SET_QUERY_CONTEXT_VALUE,
		context,
		value,
	};
};
woocommerce-blocks/assets/js/data/query-state/reducers.js000064400000002146151335517650017640 0ustar00/**
 * Internal dependencies
 */
import { ACTION_TYPES as types } from './action-types';
import { getStateForContext } from './utils';

/**
 * Reducer for processing actions related to the query state store.
 *
 * @param {Object} state  Current state in store.
 * @param {Object} action Action being processed.
 */
const queryStateReducer = ( state = {}, action ) => {
	const { type, context, queryKey, value } = action;
	const prevState = getStateForContext( state, context );
	let newState;
	switch ( type ) {
		case types.SET_QUERY_KEY_VALUE:
			const prevStateObject =
				prevState !== null ? JSON.parse( prevState ) : {};

			// mutate it and JSON.stringify to compare
			prevStateObject[ queryKey ] = value;
			newState = JSON.stringify( prevStateObject );

			if ( prevState !== newState ) {
				state = {
					...state,
					[ context ]: newState,
				};
			}
			break;
		case types.SET_QUERY_CONTEXT_VALUE:
			newState = JSON.stringify( value );
			if ( prevState !== newState ) {
				state = {
					...state,
					[ context ]: newState,
				};
			}
			break;
	}
	return state;
};

export default queryStateReducer;
woocommerce-blocks/assets/js/data/cart/actions.ts000064400000033025151335517650016144 0ustar00/**
 * External dependencies
 */
import { select } from '@wordpress/data-controls';
import type {
	Cart,
	CartResponse,
	CartResponseItem,
	CartBillingAddress,
	CartShippingAddress,
	ExtensionCartUpdateArgs,
} from '@woocommerce/types';
import { ReturnOrGeneratorYieldUnion } from '@automattic/data-stores';
import { camelCase, mapKeys } from 'lodash';
import type { AddToCartEventDetail } from '@woocommerce/type-defs/events';

/**
 * Internal dependencies
 */
import { ACTION_TYPES as types } from './action-types';
import { STORE_KEY as CART_STORE_KEY } from './constants';
import { apiFetchWithHeaders } from '../shared-controls';
import type { ResponseError } from '../types';

/**
 * Returns an action object used in updating the store with the provided items
 * retrieved from a request using the given querystring.
 *
 * This is a generic response action.
 *
 * @param  {CartResponse}      response
 */
export const receiveCart = (
	response: CartResponse
): { type: string; response: Cart } => {
	const cart = ( mapKeys( response, ( _, key ) =>
		camelCase( key )
	) as unknown ) as Cart;
	return {
		type: types.RECEIVE_CART,
		response: cart,
	};
};

/**
 * Returns an action object used for receiving customer facing errors from the API.
 *
 * @param   {ResponseError|null} [error=null]     An error object containing the error
 *                                         message and response code.
 * @param   {boolean}       [replace=true] Should existing errors be replaced,
 *                                         or should the error be appended.
 */
export const receiveError = (
	error: ResponseError | null = null,
	replace = true
) =>
	( {
		type: replace ? types.REPLACE_ERRORS : types.RECEIVE_ERROR,
		error,
	} as const );

/**
 * Returns an action object used to track when a coupon is applying.
 *
 * @param  {string} [couponCode] Coupon being added.
 */
export const receiveApplyingCoupon = ( couponCode: string ) =>
	( {
		type: types.APPLYING_COUPON,
		couponCode,
	} as const );

/**
 * Returns an action object used to track when a coupon is removing.
 *
 * @param   {string} [couponCode] Coupon being removed..
 */
export const receiveRemovingCoupon = ( couponCode: string ) =>
	( {
		type: types.REMOVING_COUPON,
		couponCode,
	} as const );

/**
 * Returns an action object for updating a single cart item in the store.
 *
 * @param  {CartResponseItem} [response=null] A cart item API response.
 */
export const receiveCartItem = ( response: CartResponseItem | null = null ) =>
	( {
		type: types.RECEIVE_CART_ITEM,
		cartItem: response,
	} as const );

/**
 * Returns an action object to indicate if the specified cart item quantity is
 * being updated.
 *
 * @param   {string}  cartItemKey              Cart item being updated.
 * @param   {boolean} [isPendingQuantity=true] Flag for update state; true if API
 *                                             request is pending.
 */
export const itemIsPendingQuantity = (
	cartItemKey: string,
	isPendingQuantity = true
) =>
	( {
		type: types.ITEM_PENDING_QUANTITY,
		cartItemKey,
		isPendingQuantity,
	} as const );

/**
 * Returns an action object to remove a cart item from the store.
 *
 * @param   {string}  cartItemKey            Cart item to remove.
 * @param   {boolean} [isPendingDelete=true] Flag for update state; true if API
 *                                           request is pending.
 */
export const itemIsPendingDelete = (
	cartItemKey: string,
	isPendingDelete = true
) =>
	( {
		type: types.RECEIVE_REMOVED_ITEM,
		cartItemKey,
		isPendingDelete,
	} as const );
/**
 * Returns an action object to mark the cart data in the store as stale.
 *
 * @param   {boolean} [isCartDataStale=true] Flag to mark cart data as stale; true if
 * 											 lastCartUpdate timestamp is newer than the
 * 											 one in wcSettings.
 */
export const setIsCartDataStale = ( isCartDataStale = true ) =>
	( {
		type: types.SET_IS_CART_DATA_STALE,
		isCartDataStale,
	} as const );

/**
 * Returns an action object used to track when customer data is being updated
 * (billing and/or shipping).
 */
export const updatingCustomerData = ( isResolving: boolean ) =>
	( {
		type: types.UPDATING_CUSTOMER_DATA,
		isResolving,
	} as const );

/**
 * Returns an action object used to track whether the shipping rate is being
 * selected or not.
 *
 * @param  {boolean} isResolving True if shipping rate is being selected.
 */
export const shippingRatesBeingSelected = ( isResolving: boolean ) =>
	( {
		type: types.UPDATING_SELECTED_SHIPPING_RATE,
		isResolving,
	} as const );

/**
 * Returns an action object for updating legacy cart fragments.
 */
export const updateCartFragments = () =>
	( {
		type: types.UPDATE_LEGACY_CART_FRAGMENTS,
	} as const );

/**
 * Triggers an adding to cart event so other blocks can update accordingly.
 */
export const triggerAddingToCartEvent = () =>
	( {
		type: types.TRIGGER_ADDING_TO_CART_EVENT,
	} as const );

/**
 * Triggers an added to cart event so other blocks can update accordingly.
 */
export const triggerAddedToCartEvent = ( {
	preserveCartData,
}: AddToCartEventDetail ) =>
	( {
		type: types.TRIGGER_ADDED_TO_CART_EVENT,
		preserveCartData,
	} as const );

/**
 * POSTs to the /cart/extensions endpoint with the data supplied by the extension.
 *
 * @param {Object} args The data to be posted to the endpoint
 */
export function* applyExtensionCartUpdate(
	args: ExtensionCartUpdateArgs
): Generator< unknown, CartResponse, { response: CartResponse } > {
	try {
		const { response } = yield apiFetchWithHeaders( {
			path: '/wc/store/cart/extensions',
			method: 'POST',
			data: { namespace: args.namespace, data: args.data },
			cache: 'no-store',
		} );
		yield receiveCart( response );
		yield updateCartFragments();
		return response;
	} catch ( error ) {
		yield receiveError( error );
		// If updated cart state was returned, also update that.
		if ( error.data?.cart ) {
			yield receiveCart( error.data.cart );
		}

		// Re-throw the error.
		throw error;
	}
}

/**
 * Applies a coupon code and either invalidates caches, or receives an error if
 * the coupon cannot be applied.
 *
 * @param  {string} couponCode The coupon code to apply to the cart.
 * @throws            Will throw an error if there is an API problem.
 */
export function* applyCoupon(
	couponCode: string
): Generator< unknown, boolean, { response: CartResponse } > {
	yield receiveApplyingCoupon( couponCode );

	try {
		const { response } = yield apiFetchWithHeaders( {
			path: '/wc/store/cart/apply-coupon',
			method: 'POST',
			data: {
				code: couponCode,
			},
			cache: 'no-store',
		} );

		yield receiveCart( response );
		yield receiveApplyingCoupon( '' );
		yield updateCartFragments();
	} catch ( error ) {
		yield receiveError( error );
		yield receiveApplyingCoupon( '' );

		// If updated cart state was returned, also update that.
		if ( error.data?.cart ) {
			yield receiveCart( error.data.cart );
		}

		// Re-throw the error.
		throw error;
	}

	return true;
}

/**
 * Removes a coupon code and either invalidates caches, or receives an error if
 * the coupon cannot be removed.
 *
 * @param  {string} couponCode The coupon code to remove from the cart.
 * @throws            Will throw an error if there is an API problem.
 */
export function* removeCoupon(
	couponCode: string
): Generator< unknown, boolean, { response: CartResponse } > {
	yield receiveRemovingCoupon( couponCode );

	try {
		const { response } = yield apiFetchWithHeaders( {
			path: '/wc/store/cart/remove-coupon',
			method: 'POST',
			data: {
				code: couponCode,
			},
			cache: 'no-store',
		} );

		yield receiveCart( response );
		yield receiveRemovingCoupon( '' );
		yield updateCartFragments();
	} catch ( error ) {
		yield receiveError( error );
		yield receiveRemovingCoupon( '' );

		// If updated cart state was returned, also update that.
		if ( error.data?.cart ) {
			yield receiveCart( error.data.cart );
		}

		// Re-throw the error.
		throw error;
	}

	return true;
}

/**
 * Adds an item to the cart:
 * - Calls API to add item.
 * - If successful, yields action to add item from store.
 * - If error, yields action to store error.
 *
 * @param  {number} productId    Product ID to add to cart.
 * @param  {number} [quantity=1] Number of product ID being added to cart.
 * @throws           Will throw an error if there is an API problem.
 */
export function* addItemToCart(
	productId: number,
	quantity = 1
): Generator< unknown, void, { response: CartResponse } > {
	try {
		yield triggerAddingToCartEvent();
		const { response } = yield apiFetchWithHeaders( {
			path: `/wc/store/cart/add-item`,
			method: 'POST',
			data: {
				id: productId,
				quantity,
			},
			cache: 'no-store',
		} );

		yield receiveCart( response );
		yield triggerAddedToCartEvent( { preserveCartData: true } );
		yield updateCartFragments();
	} catch ( error ) {
		yield receiveError( error );

		// If updated cart state was returned, also update that.
		if ( error.data?.cart ) {
			yield receiveCart( error.data.cart );
		}

		// Re-throw the error.
		throw error;
	}
}

/**
 * Removes specified item from the cart:
 * - Calls API to remove item.
 * - If successful, yields action to remove item from store.
 * - If error, yields action to store error.
 * - Sets cart item as pending while API request is in progress.
 *
 * @param {string} cartItemKey Cart item being updated.
 */
export function* removeItemFromCart(
	cartItemKey: string
): Generator< unknown, void, { response: CartResponse } > {
	yield itemIsPendingDelete( cartItemKey );

	try {
		const { response } = yield apiFetchWithHeaders( {
			path: `/wc/store/cart/remove-item`,
			data: {
				key: cartItemKey,
			},
			method: 'POST',
			cache: 'no-store',
		} );

		yield receiveCart( response );
		yield updateCartFragments();
	} catch ( error ) {
		yield receiveError( error );

		// If updated cart state was returned, also update that.
		if ( error.data?.cart ) {
			yield receiveCart( error.data.cart );
		}
	}
	yield itemIsPendingDelete( cartItemKey, false );
}

/**
 * Persists a quantity change the for specified cart item:
 * - Calls API to set quantity.
 * - If successful, yields action to update store.
 * - If error, yields action to store error.
 *
 * @param {string} cartItemKey Cart item being updated.
 * @param {number} quantity    Specified (new) quantity.
 */
export function* changeCartItemQuantity(
	cartItemKey: string,
	quantity: number
	// eslint-disable-next-line @typescript-eslint/no-explicit-any -- unclear how to represent multiple different yields as type
): Generator< unknown, void, any > {
	const cartItem = yield select( CART_STORE_KEY, 'getCartItem', cartItemKey );
	yield itemIsPendingQuantity( cartItemKey );

	if ( cartItem?.quantity === quantity ) {
		return;
	}
	try {
		const { response } = yield apiFetchWithHeaders( {
			path: '/wc/store/cart/update-item',
			method: 'POST',
			data: {
				key: cartItemKey,
				quantity,
			},
			cache: 'no-store',
		} );

		yield receiveCart( response );
		yield updateCartFragments();
	} catch ( error ) {
		yield receiveError( error );

		// If updated cart state was returned, also update that.
		if ( error.data?.cart ) {
			yield receiveCart( error.data.cart );
		}
	}
	yield itemIsPendingQuantity( cartItemKey, false );
}

/**
 * Selects a shipping rate.
 *
 * @param {string}          rateId      The id of the rate being selected.
 * @param {number | string} [packageId] The key of the packages that we will
 *   select within.
 */
export function* selectShippingRate(
	rateId: string,
	packageId = 0
): Generator< unknown, boolean, { response: CartResponse } > {
	try {
		yield shippingRatesBeingSelected( true );
		const { response } = yield apiFetchWithHeaders( {
			path: `/wc/store/cart/select-shipping-rate`,
			method: 'POST',
			data: {
				package_id: packageId,
				rate_id: rateId,
			},
			cache: 'no-store',
		} );

		yield receiveCart( response );
	} catch ( error ) {
		yield receiveError( error );
		yield shippingRatesBeingSelected( false );

		// If updated cart state was returned, also update that.
		if ( error.data?.cart ) {
			yield receiveCart( error.data.cart );
		}

		// Re-throw the error.
		throw error;
	}
	yield shippingRatesBeingSelected( false );
	return true;
}

type BillingAddressShippingAddress = {
	billing_address: CartBillingAddress;
	shipping_address: CartShippingAddress;
};

/**
 * Updates the shipping and/or billing address for the customer and returns an
 * updated cart.
 *
 * @param {BillingAddressShippingAddress} customerData Address data to be updated; can contain both
 *   billing_address and shipping_address.
 */
export function* updateCustomerData(
	customerData: BillingAddressShippingAddress
): Generator< unknown, boolean, { response: CartResponse } > {
	yield updatingCustomerData( true );

	try {
		const { response } = yield apiFetchWithHeaders( {
			path: '/wc/store/cart/update-customer',
			method: 'POST',
			data: customerData,
			cache: 'no-store',
		} );

		yield receiveCart( response );
	} catch ( error ) {
		yield receiveError( error );
		yield updatingCustomerData( false );

		// If updated cart state was returned, also update that.
		if ( error.data?.cart ) {
			yield receiveCart( error.data.cart );
		}

		// rethrow error.
		throw error;
	}

	yield updatingCustomerData( false );
	return true;
}

export type CartAction = ReturnOrGeneratorYieldUnion<
	| typeof receiveCart
	| typeof receiveError
	| typeof receiveApplyingCoupon
	| typeof receiveRemovingCoupon
	| typeof receiveCartItem
	| typeof itemIsPendingQuantity
	| typeof itemIsPendingDelete
	| typeof updatingCustomerData
	| typeof shippingRatesBeingSelected
	| typeof setIsCartDataStale
	| typeof updateCustomerData
	| typeof removeItemFromCart
	| typeof changeCartItemQuantity
	| typeof addItemToCart
	| typeof updateCartFragments
>;
woocommerce-blocks/assets/js/data/cart/controls.js000064400000001156151335517650016335 0ustar00/**
 * External dependencies
 */
import {
	triggerFragmentRefresh,
	triggerAddedToCartEvent,
	triggerAddingToCartEvent,
} from '@woocommerce/base-utils';

/**
 * Default export for registering the controls with the store.
 *
 * @return {Object} An object with the controls to register with the store on the controls property of the registration object.
 */
export const controls = {
	UPDATE_LEGACY_CART_FRAGMENTS() {
		triggerFragmentRefresh();
	},
	TRIGGER_ADDING_TO_CART_EVENT() {
		triggerAddingToCartEvent();
	},
	TRIGGER_ADDED_TO_CART_EVENT( preserveCartData ) {
		triggerAddedToCartEvent( preserveCartData );
	},
};
woocommerce-blocks/assets/js/data/cart/selectors.ts000064400000010656151335517650016514 0ustar00/**
 * External dependencies
 */
import type { Cart, CartTotals, CartMeta, CartItem } from '@woocommerce/types';

/**
 * Internal dependencies
 */
import { CartState, defaultCartState } from '../default-states';
import type { ResponseError } from '../types';

/**
 * Retrieves cart data from state.
 *
 * @param {CartState} state The current state.
 * @return {Cart} The data to return.
 */
export const getCartData = ( state: CartState ): Cart => {
	return state.cartData;
};

/**
 * Retrieves cart totals from state.
 *
 * @param {CartState} state The current state.
 * @return {CartTotals} The data to return.
 */
export const getCartTotals = ( state: CartState ): CartTotals => {
	return state.cartData.totals || defaultCartState.cartData.totals;
};

/**
 * Retrieves cart meta from state.
 *
 * @param {CartState} state The current state.
 * @return {CartMeta} The data to return.
 */
export const getCartMeta = ( state: CartState ): CartMeta => {
	return state.metaData || defaultCartState.metaData;
};

/**
 * Retrieves cart errors from state.
 *
 * @param {CartState} state The current state.
 * @return {Array<ResponseError>} Array of errors.
 */
export const getCartErrors = ( state: CartState ): Array< ResponseError > => {
	return state.errors;
};

/**
 * Returns true if any coupon is being applied.
 *
 * @param {CartState} state The current state.
 * @return {boolean} True if a coupon is being applied.
 */
export const isApplyingCoupon = ( state: CartState ): boolean => {
	return !! state.metaData.applyingCoupon;
};

/**
 * Returns true if cart is stale, false if it is not.
 *
 * @param {CartState} state The current state.
 * @return {boolean} True if the cart data is stale.
 */
export const isCartDataStale = ( state: CartState ): boolean => {
	return state.metaData.isCartDataStale;
};

/**
 * Retrieves the coupon code currently being applied.
 *
 * @param {CartState} state The current state.
 * @return {string} The data to return.
 */
export const getCouponBeingApplied = ( state: CartState ): string => {
	return state.metaData.applyingCoupon || '';
};

/**
 * Returns true if any coupon is being removed.
 *
 * @param {CartState} state The current state.
 * @return {boolean} True if a coupon is being removed.
 */
export const isRemovingCoupon = ( state: CartState ): boolean => {
	return !! state.metaData.removingCoupon;
};

/**
 * Retrieves the coupon code currently being removed.
 *
 * @param {CartState} state The current state.
 * @return {string} The data to return.
 */
export const getCouponBeingRemoved = ( state: CartState ): string => {
	return state.metaData.removingCoupon || '';
};

/**
 * Returns cart item matching specified key.
 *
 * @param {CartState} state The current state.
 * @param {string} cartItemKey Key for a cart item.
 * @return {CartItem | void} Cart item object, or undefined if not found.
 */
export const getCartItem = (
	state: CartState,
	cartItemKey: string
): CartItem | void => {
	return state.cartData.items.find(
		( cartItem ) => cartItem.key === cartItemKey
	);
};

/**
 * Returns true if the specified cart item quantity is being updated.
 *
 * @param {CartState} state The current state.
 * @param {string} cartItemKey Key for a cart item.
 * @return {boolean} True if a item has a pending request to be updated.
 */
export const isItemPendingQuantity = (
	state: CartState,
	cartItemKey: string
): boolean => {
	return state.cartItemsPendingQuantity.includes( cartItemKey );
};

/**
 * Returns true if the specified cart item quantity is being updated.
 *
 * @param {CartState} state The current state.
 * @param {string} cartItemKey Key for a cart item.
 * @return {boolean} True if a item has a pending request to be updated.
 */
export const isItemPendingDelete = (
	state: CartState,
	cartItemKey: string
): boolean => {
	return state.cartItemsPendingDelete.includes( cartItemKey );
};
/**
 * Retrieves if the address is being applied for shipping.
 *
 * @param {CartState} state The current state.
 * @return {boolean} are shipping rates loading.
 */
export const isCustomerDataUpdating = ( state: CartState ): boolean => {
	return !! state.metaData.updatingCustomerData;
};

/**
 * Retrieves if the shipping rate selection is being persisted.
 *
 * @param {CartState} state The current state.
 *
 * @return {boolean} True if the shipping rate selection is being persisted to
 *                   the server.
 */
export const isShippingRateBeingSelected = ( state: CartState ): boolean => {
	return !! state.metaData.updatingSelectedRate;
};
woocommerce-blocks/assets/js/data/cart/action-types.ts000064400000001306151335517650017120 0ustar00export const ACTION_TYPES = {
	RECEIVE_CART: 'RECEIVE_CART',
	RECEIVE_ERROR: 'RECEIVE_ERROR',
	REPLACE_ERRORS: 'REPLACE_ERRORS',
	APPLYING_COUPON: 'APPLYING_COUPON',
	REMOVING_COUPON: 'REMOVING_COUPON',
	RECEIVE_CART_ITEM: 'RECEIVE_CART_ITEM',
	ITEM_PENDING_QUANTITY: 'ITEM_PENDING_QUANTITY',
	SET_IS_CART_DATA_STALE: 'SET_IS_CART_DATA_STALE',
	RECEIVE_REMOVED_ITEM: 'RECEIVE_REMOVED_ITEM',
	UPDATING_CUSTOMER_DATA: 'UPDATING_CUSTOMER_DATA',
	UPDATING_SELECTED_SHIPPING_RATE: 'UPDATING_SELECTED_SHIPPING_RATE',
	UPDATE_LEGACY_CART_FRAGMENTS: 'UPDATE_LEGACY_CART_FRAGMENTS',
	TRIGGER_ADDING_TO_CART_EVENT: 'TRIGGER_ADDING_TO_CART_EVENT',
	TRIGGER_ADDED_TO_CART_EVENT: 'TRIGGER_ADDED_TO_CART_EVENT',
} as const;
woocommerce-blocks/assets/js/data/cart/index.ts000064400000002033151335517650015606 0ustar00/**
 * External dependencies
 */
import { registerStore } from '@wordpress/data';
import { controls as dataControls } from '@wordpress/data-controls';
import type { SelectFromMap, DispatchFromMap } from '@automattic/data-stores';
/**
 * Internal dependencies
 */
import { STORE_KEY } from './constants';
import * as selectors from './selectors';
import * as actions from './actions';
import * as resolvers from './resolvers';
import reducer, { State } from './reducers';
import { controls as sharedControls } from '../shared-controls';
import { controls } from './controls';

registerStore< State >( STORE_KEY, {
	reducer,
	actions,
	// eslint-disable-next-line @typescript-eslint/no-explicit-any
	controls: { ...dataControls, ...sharedControls, ...controls } as any,
	selectors,
	resolvers,
} );

export const CART_STORE_KEY = STORE_KEY;

declare module '@wordpress/data' {
	function dispatch(
		key: typeof CART_STORE_KEY
	): DispatchFromMap< typeof actions >;
	function select(
		key: typeof CART_STORE_KEY
	): SelectFromMap< typeof selectors >;
}
woocommerce-blocks/assets/js/data/cart/reducers.ts000064400000007553151335517650016327 0ustar00/**
 * External dependencies
 */
import type { CartItem } from '@woocommerce/types';
import type { Reducer } from 'redux';

/**
 * Internal dependencies
 */
import { ACTION_TYPES as types } from './action-types';
import { defaultCartState, CartState } from '../default-states';
import { EMPTY_CART_ERRORS } from '../constants';
import type { CartAction } from './actions';

/**
 * Sub-reducer for cart items array.
 *
 * @param   {Array<CartItem>}  state   cartData.items state slice.
 * @param   {CartAction}  action  Action object.
 */
const cartItemsReducer = (
	state: Array< CartItem > = [],
	action: Partial< CartAction >
) => {
	switch ( action.type ) {
		case types.RECEIVE_CART_ITEM:
			// Replace specified cart element with the new data from server.
			return state.map( ( cartItem ) => {
				if ( cartItem.key === action.cartItem?.key ) {
					return action.cartItem;
				}
				return cartItem;
			} );
	}
	return state;
};

/**
 * Reducer for receiving items related to the cart.
 *
 * @param   {CartState}  state   The current state in the store.
 * @param   {CartAction}  action  Action object.
 *
 * @return  {CartState}          New or existing state.
 */
const reducer: Reducer< CartState > = (
	state = defaultCartState,
	action: Partial< CartAction >
) => {
	switch ( action.type ) {
		case types.RECEIVE_ERROR:
			if ( action.error ) {
				state = {
					...state,
					errors: state.errors.concat( action.error ),
				};
			}
			break;
		case types.REPLACE_ERRORS:
			if ( action.error ) {
				state = {
					...state,
					errors: [ action.error ],
				};
			}
			break;
		case types.RECEIVE_CART:
			if ( action.response ) {
				state = {
					...state,
					errors: EMPTY_CART_ERRORS,
					cartData: action.response,
				};
			}
			break;
		case types.APPLYING_COUPON:
			if ( action.couponCode || action.couponCode === '' ) {
				state = {
					...state,
					metaData: {
						...state.metaData,
						applyingCoupon: action.couponCode,
					},
				};
			}
			break;
		case types.REMOVING_COUPON:
			if ( action.couponCode || action.couponCode === '' ) {
				state = {
					...state,
					metaData: {
						...state.metaData,
						removingCoupon: action.couponCode,
					},
				};
			}
			break;

		case types.ITEM_PENDING_QUANTITY:
			// Remove key by default - handles isQuantityPending==false
			// and prevents duplicates when isQuantityPending===true.
			const keysPendingQuantity = state.cartItemsPendingQuantity.filter(
				( key ) => key !== action.cartItemKey
			);
			if ( action.isPendingQuantity && action.cartItemKey ) {
				keysPendingQuantity.push( action.cartItemKey );
			}
			state = {
				...state,
				cartItemsPendingQuantity: keysPendingQuantity,
			};
			break;
		case types.RECEIVE_REMOVED_ITEM:
			const keysPendingDelete = state.cartItemsPendingDelete.filter(
				( key ) => key !== action.cartItemKey
			);
			if ( action.isPendingDelete && action.cartItemKey ) {
				keysPendingDelete.push( action.cartItemKey );
			}
			state = {
				...state,
				cartItemsPendingDelete: keysPendingDelete,
			};
			break;
		// Delegate to cartItemsReducer.
		case types.RECEIVE_CART_ITEM:
			state = {
				...state,
				errors: EMPTY_CART_ERRORS,
				cartData: {
					...state.cartData,
					items: cartItemsReducer( state.cartData.items, action ),
				},
			};
			break;
		case types.UPDATING_CUSTOMER_DATA:
			state = {
				...state,
				metaData: {
					...state.metaData,
					updatingCustomerData: !! action.isResolving,
				},
			};
			break;
		case types.UPDATING_SELECTED_SHIPPING_RATE:
			state = {
				...state,
				metaData: {
					...state.metaData,
					updatingSelectedRate: !! action.isResolving,
				},
			};
			break;
		case types.SET_IS_CART_DATA_STALE:
			state = {
				...state,
				metaData: {
					...state.metaData,
					isCartDataStale: action.isCartDataStale,
				},
			};
			break;
	}
	return state;
};

export type State = ReturnType< typeof reducer >;

export default reducer;
woocommerce-blocks/assets/js/data/cart/test/resolvers.js000064400000003004151335517650017467 0ustar00/**
 * Internal dependencies
 */
import { getCartData } from '../resolvers';
import { receiveCart, receiveError } from '../actions';
import { CART_API_ERROR } from '../constants';

jest.mock( '@wordpress/data-controls' );

describe( 'getCartData', () => {
	describe( 'yields with expected responses', () => {
		let fulfillment;
		const rewind = () => ( fulfillment = getCartData() );
		test(
			'when apiFetch returns a valid response, yields expected ' +
				'action',
			() => {
				rewind();
				fulfillment.next( 'https://example.org' );
				const { value } = fulfillment.next( {
					coupons: [],
					items: [],
					fees: [],
					itemsCount: 0,
					itemsWeight: 0,
					needsShipping: true,
					totals: {},
				} );
				expect( value ).toEqual(
					receiveCart( {
						coupons: [],
						items: [],
						fees: [],
						itemsCount: 0,
						itemsWeight: 0,
						needsShipping: true,
						totals: {},
					} )
				);
				const { done } = fulfillment.next();
				expect( done ).toBe( true );
			}
		);
	} );
	describe( 'yields with expected response when there is an error', () => {
		let fulfillment;
		const rewind = () => ( fulfillment = getCartData() );
		test(
			'when apiFetch returns a valid response, yields expected ' +
				'action',
			() => {
				rewind();
				fulfillment.next( 'https://example.org' );
				const { value } = fulfillment.next( undefined );
				expect( value ).toEqual( receiveError( CART_API_ERROR ) );
				const { done } = fulfillment.next();
				expect( done ).toBe( true );
			}
		);
	} );
} );
woocommerce-blocks/assets/js/data/cart/test/reducers.js000064400000005127151335517650017267 0ustar00/**
 * External dependencies
 */
import deepFreeze from 'deep-freeze';

/**
 * Internal dependencies
 */
import cartReducer from '../reducers';
import { ACTION_TYPES as types } from '../action-types';

describe( 'cartReducer', () => {
	const originalState = deepFreeze( {
		cartData: {
			coupons: [],
			items: [],
			fees: [],
			itemsCount: 0,
			itemsWeight: 0,
			needsShipping: true,
			totals: {},
		},
		metaData: {},
		errors: [
			{
				code: '100',
				message: 'Test Error',
				data: {},
			},
		],
	} );
	it( 'sets expected state when a cart is received', () => {
		const testAction = {
			type: types.RECEIVE_CART,
			response: {
				coupons: [],
				items: [],
				fees: [],
				itemsCount: 0,
				itemsWeight: 0,
				needsShipping: true,
				totals: {},
			},
		};
		const newState = cartReducer( originalState, testAction );
		expect( newState ).not.toBe( originalState );
		expect( newState.cartData ).toEqual( {
			coupons: [],
			items: [],
			fees: [],
			itemsCount: 0,
			itemsWeight: 0,
			needsShipping: true,
			totals: {},
		} );
	} );
	it( 'sets expected state when errors are replaced', () => {
		const testAction = {
			type: types.REPLACE_ERRORS,
			error: {
				code: '101',
				message: 'Test Error',
				data: {},
			},
		};
		const newState = cartReducer( originalState, testAction );
		expect( newState ).not.toBe( originalState );
		expect( newState.errors ).toEqual( [
			{
				code: '101',
				message: 'Test Error',
				data: {},
			},
		] );
	} );
	it( 'sets expected state when an error is added', () => {
		const testAction = {
			type: types.RECEIVE_ERROR,
			error: {
				code: '101',
				message: 'Test Error',
				data: {},
			},
		};
		const newState = cartReducer( originalState, testAction );
		expect( newState ).not.toBe( originalState );
		expect( newState.errors ).toEqual( [
			{
				code: '100',
				message: 'Test Error',
				data: {},
			},
			{
				code: '101',
				message: 'Test Error',
				data: {},
			},
		] );
	} );
	it( 'sets expected state when a coupon is applied', () => {
		const testAction = {
			type: types.APPLYING_COUPON,
			couponCode: 'APPLYME',
		};
		const newState = cartReducer( originalState, testAction );
		expect( newState ).not.toBe( originalState );
		expect( newState.metaData.applyingCoupon ).toEqual( 'APPLYME' );
	} );
	it( 'sets expected state when a coupon is removed', () => {
		const testAction = {
			type: types.REMOVING_COUPON,
			couponCode: 'REMOVEME',
		};
		const newState = cartReducer( originalState, testAction );
		expect( newState ).not.toBe( originalState );
		expect( newState.metaData.removingCoupon ).toEqual( 'REMOVEME' );
	} );
} );
woocommerce-blocks/assets/js/data/cart/test/selectors.js000064400000015451151335517650017457 0ustar00/**
 * Internal dependencies
 */
import {
	getCartData,
	getCartTotals,
	getCartMeta,
	getCartErrors,
	isApplyingCoupon,
	getCouponBeingApplied,
	isRemovingCoupon,
	getCouponBeingRemoved,
} from '../selectors';

const state = {
	cartData: {
		coupons: [
			{
				code: 'test',
				totals: {
					currency_code: 'GBP',
					currency_symbol: '£',
					currency_minor_unit: 2,
					currency_decimal_separator: '.',
					currency_thousand_separator: ',',
					currency_prefix: '£',
					currency_suffix: '',
					total_discount: '583',
					total_discount_tax: '117',
				},
			},
		],
		items: [
			{
				key: '1f0e3dad99908345f7439f8ffabdffc4',
				id: 19,
				quantity: 1,
				name: 'Album',
				short_description: '<p>This is a simple, virtual product.</p>',
				description:
					'<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum sagittis orci ac odio dictum tincidunt. Donec ut metus leo. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Sed luctus, dui eu sagittis sodales, nulla nibh sagittis augue, vel porttitor diam enim non metus. Vestibulum aliquam augue neque. Phasellus tincidunt odio eget ullamcorper efficitur. Cras placerat ut turpis pellentesque vulputate. Nam sed consequat tortor. Curabitur finibus sapien dolor. Ut eleifend tellus nec erat pulvinar dignissim. Nam non arcu purus. Vivamus et massa massa.</p>',
				sku: 'woo-album',
				low_stock_remaining: null,
				permalink: 'http://local.wordpress.test/product/album/',
				images: [
					{
						id: 48,
						src:
							'http://local.wordpress.test/wp-content/uploads/2019/12/album-1.jpg',
						thumbnail:
							'http://local.wordpress.test/wp-content/uploads/2019/12/album-1-324x324.jpg',
						srcset:
							'http://local.wordpress.test/wp-content/uploads/2019/12/album-1.jpg 800w, http://local.wordpress.test/wp-content/uploads/2019/12/album-1-324x324.jpg 324w, http://local.wordpress.test/wp-content/uploads/2019/12/album-1-100x100.jpg 100w, http://local.wordpress.test/wp-content/uploads/2019/12/album-1-416x416.jpg 416w, http://local.wordpress.test/wp-content/uploads/2019/12/album-1-300x300.jpg 300w, http://local.wordpress.test/wp-content/uploads/2019/12/album-1-150x150.jpg 150w, http://local.wordpress.test/wp-content/uploads/2019/12/album-1-768x768.jpg 768w',
						sizes: '(max-width: 800px) 100vw, 800px',
						name: 'album-1.jpg',
						alt: '',
					},
				],
				variation: [],
				totals: {
					currency_code: 'GBP',
					currency_symbol: '£',
					currency_minor_unit: 2,
					currency_decimal_separator: '.',
					currency_thousand_separator: ',',
					currency_prefix: '£',
					currency_suffix: '',
					line_subtotal: '1250',
					line_subtotal_tax: '250',
					line_total: '1000',
					line_total_tax: '200',
				},
			},
			{
				key: '6512bd43d9caa6e02c990b0a82652dca',
				id: 11,
				quantity: 1,
				name: 'Beanie',
				short_description: '<p>This is a simple product.</p>',
				description:
					'<p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.</p>',
				sku: 'woo-beanie',
				low_stock_remaining: null,
				permalink: 'http://local.wordpress.test/product/beanie/',
				images: [
					{
						id: 40,
						src:
							'http://local.wordpress.test/wp-content/uploads/2019/12/beanie-2.jpg',
						thumbnail:
							'http://local.wordpress.test/wp-content/uploads/2019/12/beanie-2-324x324.jpg',
						srcset:
							'http://local.wordpress.test/wp-content/uploads/2019/12/beanie-2.jpg 801w, http://local.wordpress.test/wp-content/uploads/2019/12/beanie-2-324x324.jpg 324w, http://local.wordpress.test/wp-content/uploads/2019/12/beanie-2-100x100.jpg 100w, http://local.wordpress.test/wp-content/uploads/2019/12/beanie-2-416x416.jpg 416w, http://local.wordpress.test/wp-content/uploads/2019/12/beanie-2-300x300.jpg 300w, http://local.wordpress.test/wp-content/uploads/2019/12/beanie-2-150x150.jpg 150w, http://local.wordpress.test/wp-content/uploads/2019/12/beanie-2-768x768.jpg 768w',
						sizes: '(max-width: 801px) 100vw, 801px',
						name: 'beanie-2.jpg',
						alt: '',
					},
				],
				variation: [],
				totals: {
					currency_code: 'GBP',
					currency_symbol: '£',
					currency_minor_unit: 2,
					currency_decimal_separator: '.',
					currency_thousand_separator: ',',
					currency_prefix: '£',
					currency_suffix: '',
					line_subtotal: '1667',
					line_subtotal_tax: '333',
					line_total: '1333',
					line_total_tax: '267',
				},
			},
		],
		items_count: 2,
		items_weight: 0,
		needs_payment: true,
		needs_shipping: true,
		totals: {
			currency_code: 'GBP',
			currency_symbol: '£',
			currency_minor_unit: 2,
			currency_decimal_separator: '.',
			currency_thousand_separator: ',',
			currency_prefix: '£',
			currency_suffix: '',
			total_items: '2917',
			total_items_tax: '583',
			total_fees: '0',
			total_fees_tax: '0',
			total_discount: '583',
			total_discount_tax: '117',
			total_shipping: '2000',
			total_shipping_tax: '400',
			total_price: '5200',
			total_tax: '867',
			tax_lines: [
				{
					name: 'Tax',
					price: '867',
				},
			],
		},
	},
	metaData: {
		applyingCoupon: 'test-coupon',
		removingCoupon: 'test-coupon2',
	},
	errors: [
		{
			code: '100',
			message: 'Test Error',
			data: {},
		},
	],
};

describe( 'getCartData', () => {
	it( 'returns expected values for items existing in state', () => {
		expect( getCartData( state ) ).toEqual( state.cartData );
	} );
} );

describe( 'getCartTotals', () => {
	it( 'returns expected values for items existing in state', () => {
		expect( getCartTotals( state ) ).toEqual( state.cartData.totals );
	} );
} );

describe( 'getCartMeta', () => {
	it( 'returns expected values for items existing in state', () => {
		expect( getCartMeta( state ) ).toEqual( state.metaData );
	} );
} );

describe( 'getCartErrors', () => {
	it( 'returns expected values for items existing in state', () => {
		expect( getCartErrors( state ) ).toEqual( state.errors );
	} );
} );

describe( 'isApplyingCoupon', () => {
	it( 'returns expected values for items existing in state', () => {
		expect( isApplyingCoupon( state ) ).toEqual( true );
	} );
} );

describe( 'getCouponBeingApplied', () => {
	it( 'returns expected values for items existing in state', () => {
		expect( getCouponBeingApplied( state ) ).toEqual(
			state.metaData.applyingCoupon
		);
	} );
} );

describe( 'isRemovingCoupon', () => {
	it( 'returns expected values for items existing in state', () => {
		expect( isRemovingCoupon( state ) ).toEqual( true );
	} );
} );

describe( 'getCouponBeingRemoved', () => {
	it( 'returns expected values for items existing in state', () => {
		expect( getCouponBeingRemoved( state ) ).toEqual(
			state.metaData.removingCoupon
		);
	} );
} );
woocommerce-blocks/assets/js/data/cart/resolvers.ts000064400000001442151335517650016526 0ustar00/**
 * External dependencies
 */
import { select, apiFetch } from '@wordpress/data-controls';
import { CartResponse, Cart } from '@woocommerce/types';

/**
 * Internal dependencies
 */
import { receiveCart, receiveError } from './actions';
import { STORE_KEY, CART_API_ERROR } from './constants';

/**
 * Resolver for retrieving all cart data.
 */
export function* getCartData(): Generator< unknown, void, CartResponse > {
	const cartData = yield apiFetch( {
		path: '/wc/store/cart',
		method: 'GET',
		cache: 'no-store',
	} );

	if ( ! cartData ) {
		yield receiveError( CART_API_ERROR );
		return;
	}

	yield receiveCart( cartData );
}

/**
 * Resolver for retrieving cart totals.
 */
export function* getCartTotals(): Generator< unknown, void, Cart > {
	yield select( STORE_KEY, 'getCartData' );
}
woocommerce-blocks/assets/js/data/cart/constants.ts000064400000000571151335517650016520 0ustar00/**
 * External dependencies
 */
import { __ } from '@wordpress/i18n';

export const STORE_KEY = 'wc/store/cart';
export const CART_API_ERROR = {
	code: 'cart_api_error',
	message: __(
		'Unable to get cart data from the API.',
		'woo-gutenberg-products-block'
	),
	data: {
		status: 500,
	},
};
export const LAST_CART_UPDATE_TIMESTAMP_KEY = 'wc-blocks_cart_update_timestamp';
woocommerce-blocks/assets/js/data/index.ts000064400000000501151335517650014653 0ustar00/**
 * External dependencies
 */
import '@wordpress/notices';

/**
 * Internal dependencies
 */
export { SCHEMA_STORE_KEY } from './schema';
export { COLLECTIONS_STORE_KEY } from './collections';
export { CART_STORE_KEY } from './cart';
export { QUERY_STATE_STORE_KEY } from './query-state';
export * from './constants';
woocommerce-blocks/assets/js/data/utils/has-in-state.js000064400000000573151335517650017200 0ustar00/**
 * External dependencies
 */
import { has } from 'lodash';

/**
 * Utility for returning whether the given path exists in the state.
 *
 * @param {Object} state The state being checked
 * @param {Array}  path  The path to check
 *
 * @return {boolean} True means this exists in the state.
 */
export default function hasInState( state, path ) {
	return has( state, path );
}
woocommerce-blocks/assets/js/data/utils/index.js000064400000000161151335517650016003 0ustar00export { default as hasInState } from './has-in-state';
export { default as updateState } from './update-state';
woocommerce-blocks/assets/js/data/utils/update-state.js000064400000000734151335517650017302 0ustar00/**
 * External dependencies
 */
import { setWith, clone } from 'lodash';

/**
 * Utility for updating state and only cloning objects in the path that changed.
 *
 * @param {Object} state The state being updated
 * @param {Array}  path  The path being updated
 * @param {*}      value The value to update for the path
 *
 * @return {Object} The new state
 */
export default function updateState( state, path, value ) {
	return setWith( clone( state ), path, value, clone );
}
woocommerce-blocks/assets/js/data/schema/test/selectors.js000064400000006645151335517650017773 0ustar00/**
 * External dependencies
 */
import deepFreeze from 'deep-freeze';

/**
 * Internal dependencies
 */
import { getRoute, getRoutes } from '../selectors';

const mockHasFinishedResolution = jest.fn().mockReturnValue( false );
jest.mock( '@wordpress/data', () => ( {
	__esModule: true,
	createRegistrySelector: ( callback ) =>
		callback( () => ( {
			hasFinishedResolution: mockHasFinishedResolution,
		} ) ),
} ) );

const testState = deepFreeze( {
	routes: {
		'wc/blocks': {
			'products/attributes': {
				'wc/blocks/products/attributes': [],
			},
			'products/attributes/terms': {
				'wc/blocks/products/attributes/{attribute_id}/terms/{id}': [
					'attribute_id',
					'id',
				],
			},
		},
	},
} );

describe( 'getRoute', () => {
	const invokeTest = ( namespace, resourceName, ids = [] ) => () => {
		return getRoute( testState, namespace, resourceName, ids );
	};
	describe( 'with throwing errors', () => {
		beforeEach( () => mockHasFinishedResolution.mockReturnValue( true ) );
		it( 'throws an error if there is no route for the given namespace', () => {
			expect( invokeTest( 'invalid' ) ).toThrowError( /given namespace/ );
		} );
		it(
			'throws an error if there are routes for the given namespace, but no ' +
				'route for the given resource',
			() => {
				expect( invokeTest( 'wc/blocks', 'invalid' ) ).toThrowError();
			}
		);
		it(
			'throws an error if there are routes for the given namespace and ' +
				'resource name, but no routes for the given ids',
			() => {
				expect(
					invokeTest( 'wc/blocks', 'products/attributes', [ 10 ] )
				).toThrowError( /number of ids you included/ );
			}
		);
	} );
	describe( 'with no throwing of errors if resolution has not finished', () => {
		beforeEach( () => mockHasFinishedResolution.mockReturnValue( false ) );
		it.each`
			description                                                                                  | args
			${ 'is no route for the given namespace' }                                                   | ${ [ 'invalid' ] }
			${ 'are no routes for the given namespace, but no route for the given resource' }            | ${ [ 'wc/blocks', 'invalid' ] }
			${ 'are routes for the given namespace and resource name, but no routes for the given ids' } | ${ [ 'wc/blocks', 'products/attributes', [ 10 ] ] }
		`( 'does not throw an error if there $description', ( { args } ) => {
			expect( invokeTest( ...args ) ).not.toThrowError();
		} );
	} );
	describe( 'returns expected value for given valid arguments', () => {
		test( 'when there is a route with no placeholders', () => {
			expect( invokeTest( 'wc/blocks', 'products/attributes' )() ).toBe(
				'wc/blocks/products/attributes'
			);
		} );
		test( 'when there is a route with placeholders', () => {
			expect(
				invokeTest( 'wc/blocks', 'products/attributes/terms', [
					10,
					20,
				] )()
			).toBe( 'wc/blocks/products/attributes/10/terms/20' );
		} );
	} );
} );

describe( 'getRoutes', () => {
	const invokeTest = ( namespace ) => () => {
		return getRoutes( testState, namespace );
	};
	it( 'throws an error if there is no route for the given namespace', () => {
		mockHasFinishedResolution.mockReturnValue( true );
		expect( invokeTest( 'invalid' ) ).toThrowError( /given namespace/ );
	} );
	it( 'returns expected routes for given namespace', () => {
		expect( invokeTest( 'wc/blocks' )() ).toEqual( [
			'wc/blocks/products/attributes',
			'wc/blocks/products/attributes/{attribute_id}/terms/{id}',
		] );
	} );
} );
woocommerce-blocks/assets/js/data/schema/test/reducers.js000064400000003574151335517650017602 0ustar00/**
 * External dependencies
 */
import deepFreeze from 'deep-freeze';

/**
 * Internal dependencies
 */
import { receiveRoutes } from '../reducers';
import { ACTION_TYPES as types } from '../action-types';

describe( 'receiveRoutes', () => {
	it( 'returns original state when action type is not a match', () => {
		expect( receiveRoutes( undefined, { type: 'invalid' } ) ).toEqual( {} );
	} );
	it( 'returns original state when the given endpoints already exists', () => {
		const routes = [
			'wc/blocks/products/attributes',
			'wc/blocks/products/attributes/(?P<attribute_id>[d]+)/terms/(?P<id>[d]+)',
		];
		const originalState = deepFreeze( {
			'wc/blocks': {
				'products/attributes': {
					'wc/blocks/products/attributes': [],
				},
				'products/attributes/terms': {
					'wc/blocks/products/attributes/{attribute_id}/terms/{id}': [
						'attribute_id',
						'id',
					],
				},
			},
		} );
		const newState = receiveRoutes( originalState, {
			type: types.RECEIVE_MODEL_ROUTES,
			namespace: 'wc/blocks',
			routes,
		} );
		expect( newState ).toBe( originalState );
	} );
	it( 'returns expected state when new route added', () => {
		const action = {
			type: types.RECEIVE_MODEL_ROUTES,
			namespace: 'wc/blocks',
			routes: [ 'wc/blocks/products/attributes' ],
		};
		const originalState = deepFreeze( {
			'wc/blocks': {
				'products/attributes/terms': {
					'wc/blocks/products/attributes/{attribute_id}/terms/{id}': [
						'attribute_id',
						'id',
					],
				},
			},
		} );
		const newState = receiveRoutes( originalState, action );
		expect( newState ).not.toBe( originalState );
		expect( newState ).toEqual( {
			'wc/blocks': {
				'products/attributes': {
					'wc/blocks/products/attributes': [],
				},
				'products/attributes/terms': {
					'wc/blocks/products/attributes/{attribute_id}/terms/{id}': [
						'attribute_id',
						'id',
					],
				},
			},
		} );
	} );
} );
woocommerce-blocks/assets/js/data/schema/test/utils.js000064400000005721151335517650017122 0ustar00/**
 * Internal dependencies
 */
import {
	extractResourceNameFromRoute,
	getRouteIds,
	simplifyRouteWithId,
} from '../utils';

describe( 'extractResourceNameFromRoute', () => {
	it.each`
		namespace        | route                                                                            | expected
		${ 'wc/blocks' } | ${ 'wc/blocks/products' }                                                        | ${ 'products' }
		${ 'wc/other' }  | ${ 'wc/blocks/product' }                                                         | ${ 'wc/blocks/product' }
		${ 'wc/blocks' } | ${ 'wc/blocks/products/attributes/(?P<attribute_id>[\\d]+)' }                    | ${ 'products/attributes' }
		${ 'wc/blocks' } | ${ 'wc/blocks/products/attributes/(?P<attribute_id>[\\d]+)/terms' }              | ${ 'products/attributes/terms' }
		${ 'wc/blocks' } | ${ 'wc/blocks/products/attributes/(?P<attribute_id>[\\d]+)/terms/(?P<id>[d]+)' } | ${ 'products/attributes/terms' }
	`(
		'returns "$expected" when namespace is "$namespace" and route is "$route"',
		( { namespace, route, expected } ) => {
			expect( extractResourceNameFromRoute( namespace, route ) ).toBe(
				expected
			);
		}
	);
} );

describe( 'getRouteIds', () => {
	it.each`
		route                                                                              | expected
		${ 'wc/blocks/products' }                                                          | ${ [] }
		${ 'wc/blocks/products/(?P<id>[\\d]+)' }                                           | ${ [ 'id' ] }
		${ 'wc/blocks/products/attributes/(?P<attribute_id>[\\d]+)/terms/(?P<id>[\\d]+)' } | ${ [ 'attribute_id', 'id' ] }
	`(
		'returns "$expected" when route is "$route"',
		( { route, expected } ) => {
			expect( getRouteIds( route ) ).toEqual( expected );
		}
	);
} );

describe( 'simplifyRouteWithId', () => {
	it.each`
		route                                                                              | matchIds                      | expected
		${ 'wc/blocks/products' }                                                          | ${ [] }                       | ${ 'wc/blocks/products' }
		${ 'wc/blocks/products/attributes/(?P<attribute_id>[\\d]+)' }                      | ${ [ 'attribute_id' ] }       | ${ 'wc/blocks/products/attributes/{attribute_id}' }
		${ 'wc/blocks/products/attributes/(?P<attribute_id>[\\d]+)/terms' }                | ${ [ 'attribute_id' ] }       | ${ 'wc/blocks/products/attributes/{attribute_id}/terms' }
		${ 'wc/blocks/products/attributes/(?P<attribute_id>[\\d]+)/terms/(?P<id>[\\d]+)' } | ${ [ 'attribute_id', 'id' ] } | ${ 'wc/blocks/products/attributes/{attribute_id}/terms/{id}' }
		${ 'wc/blocks/products/attributes/(?P<attribute_id>[\\d]+)/terms/(?P<id>[\\d]+)' } | ${ [ 'id', 'attribute_id' ] } | ${ 'wc/blocks/products/attributes/{attribute_id}/terms/{id}' }
	`(
		'returns "$expected" when route is "$route" and matchIds is "$matchIds"',
		( { route, matchIds, expected } ) => {
			expect( simplifyRouteWithId( route, matchIds ) ).toBe( expected );
		}
	);
} );
woocommerce-blocks/assets/js/data/schema/test/resolvers.js000064400000002751151335517650020006 0ustar00/**
 * External dependencies
 */
import { select, apiFetch } from '@wordpress/data-controls';

/**
 * Internal dependencies
 */
import { getRoute, getRoutes } from '../resolvers';
import { receiveRoutes } from '../actions';
import { STORE_KEY } from '../constants';

jest.mock( '@wordpress/data-controls' );

describe( 'getRoute', () => {
	it( 'yields select control response', () => {
		const fulfillment = getRoute( 'wc/blocks' );
		fulfillment.next();
		expect( select ).toHaveBeenCalledWith(
			STORE_KEY,
			'getRoutes',
			'wc/blocks'
		);
		const { done } = fulfillment.next();
		expect( done ).toBe( true );
	} );
} );
describe( 'getRoutes', () => {
	describe( 'yields with expected responses', () => {
		let fulfillment;
		const rewind = () => ( fulfillment = getRoutes( 'wc/blocks' ) );
		test( 'with apiFetch control invoked', () => {
			rewind();
			fulfillment.next();
			expect( apiFetch ).toHaveBeenCalledWith( { path: 'wc/blocks' } );
		} );
		test( 'with receiveRoutes action with valid response', () => {
			const testResponse = {
				routes: {
					'/wc/blocks/products/attributes': [],
				},
			};
			const { value } = fulfillment.next( testResponse );
			expect( value ).toEqual(
				receiveRoutes( Object.keys( testResponse.routes ), 'wc/blocks' )
			);
		} );
		test( 'with receiveRoutesAction with invalid response', () => {
			rewind();
			fulfillment.next();
			const { value } = fulfillment.next( {} );
			expect( value ).toEqual( receiveRoutes( [], 'wc/blocks' ) );
		} );
	} );
} );
woocommerce-blocks/assets/js/data/schema/selectors.js000064400000010626151335517650017006 0ustar00/**
 * External dependencies
 */
import { sprintf } from '@wordpress/i18n';
import { createRegistrySelector } from '@wordpress/data';

/**
 * Internal dependencies
 */
import { STORE_KEY } from './constants';

/**
 * Returns the requested route for the given arguments.
 *
 * @param {Object} state        The original state.
 * @param {string} namespace    The namespace for the route.
 * @param {string} resourceName The resource being requested
 *                              (eg. products/attributes)
 * @param {Array}  [ids]        This is for any ids that might be implemented in
 *                              the route request. It is not for any query
 *                              parameters.
 *
 * Ids example:
 * If you are looking for the route for a single product on the `wc/blocks`
 * namespace, then you'd have `[ 20 ]` as the ids.  This would produce something
 * like `/wc/blocks/products/20`
 *
 *
 * @throws {Error}  If there is no route for the given arguments, then this will
 *                  throw
 *
 * @return {string} The route if it is available.
 */
export const getRoute = createRegistrySelector(
	( select ) => ( state, namespace, resourceName, ids = [] ) => {
		const hasResolved = select(
			STORE_KEY
		).hasFinishedResolution( 'getRoutes', [ namespace ] );
		state = state.routes;
		let error = '';
		if ( ! state[ namespace ] ) {
			error = sprintf(
				'There is no route for the given namespace (%s) in the store',
				namespace
			);
		} else if ( ! state[ namespace ][ resourceName ] ) {
			error = sprintf(
				'There is no route for the given resource name (%s) in the store',
				resourceName
			);
		}
		if ( error !== '' ) {
			if ( hasResolved ) {
				throw new Error( error );
			}
			return '';
		}
		const route = getRouteFromResourceEntries(
			state[ namespace ][ resourceName ],
			ids
		);
		if ( route === '' ) {
			if ( hasResolved ) {
				throw new Error(
					sprintf(
						'While there is a route for the given namespace (%1$s) and resource name (%2$s), there is no route utilizing the number of ids you included in the select arguments. The available routes are: (%3$s)',
						namespace,
						resourceName,
						JSON.stringify( state[ namespace ][ resourceName ] )
					)
				);
			}
		}
		return route;
	}
);

/**
 * Return all the routes for a given namespace.
 *
 * @param {Object} state     The current state.
 * @param {string} namespace The namespace to return routes for.
 *
 * @return {Array} An array of all routes for the given namespace.
 */
export const getRoutes = createRegistrySelector(
	( select ) => ( state, namespace ) => {
		const hasResolved = select(
			STORE_KEY
		).hasFinishedResolution( 'getRoutes', [ namespace ] );
		const routes = state.routes[ namespace ];
		if ( ! routes ) {
			if ( hasResolved ) {
				throw new Error(
					sprintf(
						'There is no route for the given namespace (%s) in the store',
						namespace
					)
				);
			}
			return [];
		}
		let namespaceRoutes = [];
		for ( const resourceName in routes ) {
			namespaceRoutes = [
				...namespaceRoutes,
				...Object.keys( routes[ resourceName ] ),
			];
		}
		return namespaceRoutes;
	}
);

/**
 * Returns the route from the given slice of the route state.
 *
 * @param {Object} stateSlice This will be a slice of the route state from a
 *                            given namespace and resource name.
 * @param {Array} [ids=[]]  Any id references that are to be replaced in
 *                            route placeholders.
 *
 * @return {string}  The route or an empty string if nothing found.
 */
const getRouteFromResourceEntries = ( stateSlice, ids = [] ) => {
	// convert to array for easier discovery
	stateSlice = Object.entries( stateSlice );
	const match = stateSlice.find( ( [ , idNames ] ) => {
		return ids.length === idNames.length;
	} );
	const [ matchingRoute, routePlaceholders ] = match || [];
	// if we have a matching route, let's return it.
	if ( matchingRoute ) {
		return ids.length === 0
			? matchingRoute
			: assembleRouteWithPlaceholders(
					matchingRoute,
					routePlaceholders,
					ids
			  );
	}
	return '';
};

/**
 * For a given route, route parts and ids,
 *
 * @param {string} route
 * @param {Array}  routePlaceholders
 * @param {Array}  ids
 *
 * @return {string} Assembled route.
 */
const assembleRouteWithPlaceholders = ( route, routePlaceholders, ids ) => {
	routePlaceholders.forEach( ( part, index ) => {
		route = route.replace( `{${ part }}`, ids[ index ] );
	} );
	return route;
};
woocommerce-blocks/assets/js/data/schema/action-types.js000064400000000120151335517650017406 0ustar00export const ACTION_TYPES = {
	RECEIVE_MODEL_ROUTES: 'RECEIVE_MODEL_ROUTES',
};
woocommerce-blocks/assets/js/data/schema/utils.js000064400000003674151335517650016150 0ustar00/**
 * This returns a resource name string as an index for a given route.
 *
 * For example:
 * /wc/blocks/products/attributes/(?P<id>[\d]+)/terms
 * returns
 * /products/attributes/terms
 *
 * @param {string} namespace
 * @param {string} route
 *
 * @return {string} The resource name extracted from the route.
 */
export const extractResourceNameFromRoute = ( namespace, route ) => {
	route = route.replace( `${ namespace }/`, '' );
	return route.replace( /\/\(\?P\<[a-z_]*\>\[\\*[a-z]\]\+\)/g, '' );
};

/**
 * Returns an array of the identifier for the named capture groups in a given
 * route.
 *
 * For example, if the route was this:
 * /wc/blocks/products/attributes/(?P<attribute_id>[\d]+)/terms/(?P<id>[\d]+)
 *
 * ...then the following would get returned
 * [ 'attribute_id', 'id' ]
 *
 * @param  {string} route - The route to extract identifier names from.
 *
 * @return {Array}  An array of named route identifier names.
 */
export const getRouteIds = ( route ) => {
	const matches = route.match( /\<[a-z_]*\>/g );
	if ( ! Array.isArray( matches ) || matches.length === 0 ) {
		return [];
	}
	return matches.map( ( match ) => match.replace( /<|>/g, '' ) );
};

/**
 * This replaces regex placeholders in routes with the relevant named string
 * found in the matchIds.
 *
 * Something like:
 * /wc/blocks/products/attributes/(?P<attribute_id>[\d]+)/terms/(?P<id>[\d]+)
 *
 * ..ends up as:
 * /wc/blocks/products/attributes/{attribute_id}/terms/{id}
 *
 * @param {string} route     The route to manipulate
 * @param {Array}  matchIds  An array of named ids ( [ attribute_id, id ] )
 *
 * @return {string} The route with new id placeholders
 */
export const simplifyRouteWithId = ( route, matchIds ) => {
	if ( ! Array.isArray( matchIds ) || matchIds.length === 0 ) {
		return route;
	}
	matchIds.forEach( ( matchId ) => {
		const expression = `\\(\\?P<${ matchId }>.*?\\)`;
		route = route.replace( new RegExp( expression ), `{${ matchId }}` );
	} );
	return route;
};
woocommerce-blocks/assets/js/data/schema/actions.js000064400000001065151335517650016440 0ustar00/**
 * Internal dependencies
 */
import { ACTION_TYPES as types } from './action-types.js';
import { API_BLOCK_NAMESPACE } from '../constants';

/**
 * Returns an action object used to update the store with the provided list
 * of model routes.
 *
 * @param   {Object}  routes  An array of routes to add to the store state.
 * @param   {string}  namespace
 *
 * @return  {Object}             The action object.
 */
export function receiveRoutes( routes, namespace = API_BLOCK_NAMESPACE ) {
	return {
		type: types.RECEIVE_MODEL_ROUTES,
		routes,
		namespace,
	};
}
woocommerce-blocks/assets/js/data/schema/constants.js000064400000000163151335517650017012 0ustar00/**
 * Identifier key for this store reducer.
 *
 * @type {string}
 */
export const STORE_KEY = 'wc/store/schema';
woocommerce-blocks/assets/js/data/schema/resolvers.js000064400000002041151335517650017017 0ustar00/**
 * External dependencies
 */
import { select, apiFetch } from '@wordpress/data-controls';

/**
 * Internal dependencies
 */
import { receiveRoutes } from './actions';
import { STORE_KEY } from './constants';

/**
 * Resolver for the getRoute selector.
 *
 * Note: All this essentially does is ensure the routes for the given namespace
 * have been resolved.
 *
 * @param {string} namespace  The namespace of the route being resolved.
 */
export function* getRoute( namespace ) {
	// we call this simply to do any resolution of all endpoints if necessary.
	// allows for jit population of routes for a given namespace.
	yield select( STORE_KEY, 'getRoutes', namespace );
}

/**
 * Resolver for the getRoutes selector.
 *
 * @param {string} namespace  The namespace of the routes being resolved.
 */
export function* getRoutes( namespace ) {
	const routeResponse = yield apiFetch( { path: namespace } );
	const routes =
		routeResponse && routeResponse.routes
			? Object.keys( routeResponse.routes )
			: [];
	yield receiveRoutes( routes, namespace );
}
woocommerce-blocks/assets/js/data/schema/index.js000064400000000763151335517650016113 0ustar00/**
 * External dependencies
 */
import { registerStore } from '@wordpress/data';
import { controls } from '@wordpress/data-controls';

/**
 * Internal dependencies
 */
import { STORE_KEY } from './constants';
import * as selectors from './selectors';
import * as actions from './actions';
import * as resolvers from './resolvers';
import reducer from './reducers';

registerStore( STORE_KEY, {
	reducer,
	actions,
	controls,
	selectors,
	resolvers,
} );

export const SCHEMA_STORE_KEY = STORE_KEY;
woocommerce-blocks/assets/js/data/schema/reducers.js000064400000002364151335517650016617 0ustar00/**
 * External dependencies
 */
import { combineReducers } from '@wordpress/data';

/**
 * Internal dependencies
 */
import { ACTION_TYPES as types } from './action-types';
import {
	extractResourceNameFromRoute,
	getRouteIds,
	simplifyRouteWithId,
} from './utils';
import { hasInState, updateState } from '../utils';

/**
 * Reducer for routes
 *
 * @param {Object} state  The current state.
 * @param {Object} action The action object for parsing.
 *
 * @return {Object} The new (or original) state.
 */
export const receiveRoutes = ( state = {}, action ) => {
	const { type, routes, namespace } = action;
	if ( type === types.RECEIVE_MODEL_ROUTES ) {
		routes.forEach( ( route ) => {
			const resourceName = extractResourceNameFromRoute(
				namespace,
				route
			);
			if ( resourceName && resourceName !== namespace ) {
				const routeIdNames = getRouteIds( route );
				const savedRoute = simplifyRouteWithId( route, routeIdNames );
				if (
					! hasInState( state, [
						namespace,
						resourceName,
						savedRoute,
					] )
				) {
					state = updateState(
						state,
						[ namespace, resourceName, savedRoute ],
						routeIdNames
					);
				}
			}
		} );
	}
	return state;
};

export default combineReducers( {
	routes: receiveRoutes,
} );
woocommerce-blocks/assets/js/data/shared-controls.ts000064400000012260151335517650016660 0ustar00/**
 * External dependencies
 */
import { __ } from '@wordpress/i18n';
import triggerFetch, { APIFetchOptions } from '@wordpress/api-fetch';
import DataLoader from 'dataloader';
import { isWpVersion } from '@woocommerce/settings';

/**
 * Internal dependencies
 */
import {
	assertBatchResponseIsValid,
	assertResponseIsValid,
	ApiResponse,
} from './types';

/**
 * Dispatched a control action for triggering an api fetch call with no parsing.
 * Typically this would be used in scenarios where headers are needed.
 *
 * @param {APIFetchOptions} options The options for the API request.
 */
export const apiFetchWithHeaders = ( options: APIFetchOptions ) =>
	( {
		type: 'API_FETCH_WITH_HEADERS',
		options,
	} as const );

const EMPTY_OBJECT = {};

/**
 * Error thrown when JSON cannot be parsed.
 */
const invalidJsonError = {
	code: 'invalid_json',
	message: __(
		'The response is not a valid JSON response.',
		'woo-gutenberg-products-block'
	),
};

const setNonceOnFetch = ( headers: Headers ): void => {
	if (
		// eslint-disable-next-line @typescript-eslint/ban-ts-comment
		// @ts-ignore -- this does exist because it's monkey patched in
		// middleware/store-api-nonce.
		triggerFetch.setNonce &&
		// eslint-disable-next-line @typescript-eslint/ban-ts-comment
		// @ts-ignore -- this does exist because it's monkey patched in
		// middleware/store-api-nonce.
		typeof triggerFetch.setNonce === 'function'
	) {
		// eslint-disable-next-line @typescript-eslint/ban-ts-comment
		// @ts-ignore -- this does exist because it's monkey patched in
		// middleware/store-api-nonce.
		triggerFetch.setNonce( headers );
	} else {
		// eslint-disable-next-line no-console
		console.error(
			'The monkey patched function on APIFetch, "setNonce", is not present, likely another plugin or some other code has removed this augmentation'
		);
	}
};

/**
 * Trigger a fetch from the API using the batch endpoint.
 */
const triggerBatchFetch = ( keys: readonly APIFetchOptions[] ) => {
	return triggerFetch( {
		path: `/wc/store/batch`,
		method: 'POST',
		data: {
			requests: keys.map( ( request: APIFetchOptions ) => {
				return {
					...request,
					body: request?.data,
				};
			} ),
		},
	} ).then( ( response: unknown ) => {
		assertBatchResponseIsValid( response );
		return keys.map(
			( key, index: number ) =>
				response.responses[ index ] || EMPTY_OBJECT
		);
	} );
};

/**
 * In ms, how long we should wait for requests to batch.
 *
 * DataLoader collects all requests over this window of time (and as a consequence, adds this amount of latency).
 */
const triggerBatchFetchDelay = 300;

/**
 * DataLoader instance for triggerBatchFetch.
 */
const triggerBatchFetchLoader = new DataLoader( triggerBatchFetch, {
	batchScheduleFn: ( callback: () => void ) =>
		setTimeout( callback, triggerBatchFetchDelay ),
	cache: false,
	maxBatchSize: 25,
} );

/**
 * Trigger a fetch from the API using the batch endpoint.
 *
 * @param {APIFetchOptions} request Request object containing API request.
 */
const batchFetch = async ( request: APIFetchOptions ) => {
	return await triggerBatchFetchLoader.load( request );
};

/**
 * Default export for registering the controls with the store.
 *
 * @return {Object} An object with the controls to register with the store on
 *                  the controls property of the registration object.
 */
export const controls = {
	API_FETCH_WITH_HEADERS: ( {
		options,
	}: ReturnType< typeof apiFetchWithHeaders > ): Promise< unknown > => {
		return new Promise( ( resolve, reject ) => {
			// GET Requests cannot be batched.
			if (
				! options.method ||
				options.method === 'GET' ||
				isWpVersion( '5.6', '<' )
			) {
				// Parse is disabled here to avoid returning just the body--we also need headers.
				triggerFetch( {
					...options,
					parse: false,
				} )
					.then( ( fetchResponse ) => {
						fetchResponse
							.json()
							.then( ( response ) => {
								resolve( {
									response,
									headers: fetchResponse.headers,
								} );
								setNonceOnFetch( fetchResponse.headers );
							} )
							.catch( () => {
								reject( invalidJsonError );
							} );
					} )
					.catch( ( errorResponse ) => {
						setNonceOnFetch( errorResponse.headers );
						if ( typeof errorResponse.json === 'function' ) {
							// Parse error response before rejecting it.
							errorResponse
								.json()
								.then( ( error: unknown ) => {
									reject( error );
								} )
								.catch( () => {
									reject( invalidJsonError );
								} );
						} else {
							reject( errorResponse.message );
						}
					} );
			} else {
				batchFetch( options )
					.then( ( response: ApiResponse ) => {
						assertResponseIsValid( response );

						if ( response.status >= 200 && response.status < 300 ) {
							resolve( {
								response: response.body,
								headers: response.headers,
							} );
							setNonceOnFetch( response.headers );
						}

						// Status code indicates error.
						throw response;
					} )
					.catch( ( errorResponse: ApiResponse ) => {
						if ( errorResponse.headers ) {
							setNonceOnFetch( errorResponse.headers );
						}
						if ( errorResponse.body ) {
							reject( errorResponse.body );
						} else {
							reject();
						}
					} );
			}
		} );
	},
};
woocommerce-blocks/assets/js/data/types.ts000064400000001503151335517650014713 0ustar00export interface ResponseError {
	code: string;
	message: string;
	data: {
		status: number;
		[ key: string ]: unknown;
	};
}

export interface ApiResponse {
	body: Record< string, unknown >;
	headers: Headers;
	status: number;
}

export function assertBatchResponseIsValid(
	response: unknown
): asserts response is {
	responses: ApiResponse[];
	headers: Headers;
} {
	if (
		typeof response === 'object' &&
		response !== null &&
		response.hasOwnProperty( 'responses' )
	) {
		return;
	}
	throw new Error( 'Response not valid' );
}

export function assertResponseIsValid(
	response: unknown
): asserts response is ApiResponse {
	if (
		typeof response === 'object' &&
		response !== null &&
		response.hasOwnProperty( 'body' ) &&
		response.hasOwnProperty( 'headers' )
	) {
		return;
	}
	throw new Error( 'Response not valid' );
}
woocommerce-blocks/assets/js/data/collections/actions.js000064400000004245151335517650017521 0ustar00/**
 * Internal dependencies
 */
import { ACTION_TYPES as types } from './action-types';

let Headers = window.Headers || null;
Headers = Headers
	? new Headers()
	: { get: () => undefined, has: () => undefined };

/**
 * Returns an action object used in updating the store with the provided items
 * retrieved from a request using the given querystring.
 *
 * This is a generic response action.
 *
 * @param {string}   namespace        The namespace for the collection route.
 * @param {string}   resourceName     The resource name for the collection route.
 * @param {string}   [queryString=''] The query string for the collection
 * @param {Array}    [ids=[]]         An array of ids (in correct order) for the
 *                                    model.
 * @param {Object}   [response={}]    An object containing the response from the
 *                                    collection request.
 * @param {Array<*>} response.items	An array of items for the given collection.
 * @param {Headers}  response.headers A Headers object from the response
 *                                    link https://developer.mozilla.org/en-US/docs/Web/API/Headers
 * @param {boolean}     [replace=false]  If true, signals to replace the current
 *                                    items in the state with the provided
 *                                    items.
 * @return {
 * 	{
 * 		type: string,
 * 		namespace: string,
 * 		resourceName: string,
 * 		queryString: string,
 * 		ids: Array<*>,
 * 		items: Array<*>,
 *	}
 * } Object for action.
 */
export function receiveCollection(
	namespace,
	resourceName,
	queryString = '',
	ids = [],
	response = { items: [], headers: Headers },
	replace = false
) {
	return {
		type: replace ? types.RESET_COLLECTION : types.RECEIVE_COLLECTION,
		namespace,
		resourceName,
		queryString,
		ids,
		response,
	};
}

export function receiveCollectionError(
	namespace,
	resourceName,
	queryString,
	ids,
	error
) {
	return {
		type: 'ERROR',
		namespace,
		resourceName,
		queryString,
		ids,
		response: {
			items: [],
			headers: Headers,
			error,
		},
	};
}

export function receiveLastModified( timestamp ) {
	return {
		type: types.RECEIVE_LAST_MODIFIED,
		timestamp,
	};
}
woocommerce-blocks/assets/js/data/collections/reducers.js000064400000003262151335517650017673 0ustar00/**
 * Internal dependencies
 */
import { ACTION_TYPES as types } from './action-types';
import { hasInState, updateState } from '../utils';

/**
 * Reducer for receiving items to a collection.
 *
 * @param   {Object}  state   The current state in the store.
 * @param   {Object}  action  Action object.
 *
 * @return  {Object}          New or existing state depending on if there are
 *                            any changes.
 */
const receiveCollection = ( state = {}, action ) => {
	// Update last modified and previous last modified values.
	if ( action.type === types.RECEIVE_LAST_MODIFIED ) {
		if ( action.timestamp === state.lastModified ) {
			return state;
		}
		return {
			...state,
			lastModified: action.timestamp,
		};
	}

	// When invalidating data, remove stored values from state.
	if ( action.type === types.INVALIDATE_RESOLUTION_FOR_STORE ) {
		return {};
	}

	const { type, namespace, resourceName, queryString, response } = action;
	// ids are stringified so they can be used as an index.
	const ids = action.ids ? JSON.stringify( action.ids ) : '[]';
	switch ( type ) {
		case types.RECEIVE_COLLECTION:
			if (
				hasInState( state, [
					namespace,
					resourceName,
					ids,
					queryString,
				] )
			) {
				return state;
			}
			state = updateState(
				state,
				[ namespace, resourceName, ids, queryString ],
				response
			);
			break;
		case types.RESET_COLLECTION:
			state = updateState(
				state,
				[ namespace, resourceName, ids, queryString ],
				response
			);
			break;
		case types.ERROR:
			state = updateState(
				state,
				[ namespace, resourceName, ids, queryString ],
				response
			);
			break;
	}
	return state;
};

export default receiveCollection;
woocommerce-blocks/assets/js/data/collections/resolvers.js000064400000005663151335517650020112 0ustar00/**
 * External dependencies
 */
import { select, dispatch } from '@wordpress/data-controls';
import { addQueryArgs } from '@wordpress/url';

/**
 * Internal dependencies
 */
import { receiveCollection, receiveCollectionError } from './actions';
import { STORE_KEY as SCHEMA_STORE_KEY } from '../schema/constants';
import { STORE_KEY, DEFAULT_EMPTY_ARRAY } from './constants';
import { apiFetchWithHeaders } from '../shared-controls';

/**
 * Check if the store needs invalidating due to a change in last modified headers.
 *
 * @param {number} timestamp Last update timestamp.
 */
function* invalidateModifiedCollection( timestamp ) {
	const lastModified = yield select( STORE_KEY, 'getCollectionLastModified' );

	if ( ! lastModified ) {
		yield dispatch( STORE_KEY, 'receiveLastModified', timestamp );
	} else if ( timestamp > lastModified ) {
		yield dispatch( STORE_KEY, 'invalidateResolutionForStore' );
		yield dispatch( STORE_KEY, 'receiveLastModified', timestamp );
	}
}

/**
 * Resolver for retrieving a collection via a api route.
 *
 * @param {string} namespace
 * @param {string} resourceName
 * @param {Object} query
 * @param {Array}  ids
 */
export function* getCollection( namespace, resourceName, query, ids ) {
	const route = yield select(
		SCHEMA_STORE_KEY,
		'getRoute',
		namespace,
		resourceName,
		ids
	);
	const queryString = addQueryArgs( '', query );
	if ( ! route ) {
		yield receiveCollection( namespace, resourceName, queryString, ids );
		return;
	}

	try {
		const {
			response = DEFAULT_EMPTY_ARRAY,
			headers,
		} = yield apiFetchWithHeaders( { path: route + queryString } );

		if ( headers && headers.get && headers.has( 'last-modified' ) ) {
			// Do any invalidation before the collection is received to prevent
			// this query running again.
			yield invalidateModifiedCollection(
				parseInt( headers.get( 'last-modified' ), 10 )
			);
		}

		yield receiveCollection( namespace, resourceName, queryString, ids, {
			items: response,
			headers,
		} );
	} catch ( error ) {
		yield receiveCollectionError(
			namespace,
			resourceName,
			queryString,
			ids,
			error
		);
	}
}

/**
 * Resolver for retrieving a specific collection header for the given arguments
 *
 * Note: This triggers the `getCollection` resolver if it hasn't been resolved
 * yet.
 *
 * @param {string} header
 * @param {string} namespace
 * @param {string} resourceName
 * @param {Object} query
 * @param {Array}  ids
 */
export function* getCollectionHeader(
	header,
	namespace,
	resourceName,
	query,
	ids
) {
	// feed the correct number of args in for the select so we don't resolve
	// unnecessarily. Any undefined args will be excluded. This is important
	// because resolver resolution is cached by both number and value of args.
	const args = [ namespace, resourceName, query, ids ].filter(
		( arg ) => typeof arg !== 'undefined'
	);
	//we call this simply to do any resolution of the collection if necessary.
	yield select( STORE_KEY, 'getCollection', ...args );
}
woocommerce-blocks/assets/js/data/collections/test/resolvers.js000064400000007670151335517650021071 0ustar00/**
 * External dependencies
 */
import { select } from '@wordpress/data-controls';

/**
 * Internal dependencies
 */
import { getCollection, getCollectionHeader } from '../resolvers';
import { receiveCollection } from '../actions';
import { STORE_KEY as SCHEMA_STORE_KEY } from '../../schema/constants';
import { STORE_KEY } from '../constants';
import { apiFetchWithHeaders } from '../../shared-controls';

jest.mock( '@wordpress/data-controls' );

describe( 'getCollection', () => {
	describe( 'yields with expected responses', () => {
		let fulfillment;
		const testArgs = [
			'wc/blocks',
			'products',
			{ foo: 'bar' },
			[ 20, 30 ],
		];
		const rewind = () => ( fulfillment = getCollection( ...testArgs ) );
		test( 'with getRoute call invoked to retrieve route', () => {
			rewind();
			fulfillment.next();
			expect( select ).toHaveBeenCalledWith(
				SCHEMA_STORE_KEY,
				'getRoute',
				testArgs[ 0 ],
				testArgs[ 1 ],
				testArgs[ 3 ]
			);
		} );
		test(
			'when no route is retrieved, yields receiveCollection and ' +
				'returns',
			() => {
				const { value } = fulfillment.next();
				const expected = receiveCollection(
					'wc/blocks',
					'products',
					'?foo=bar',
					[ 20, 30 ],
					{
						items: [],
						headers: {
							get: () => undefined,
							has: () => undefined,
						},
					}
				);
				expect( value.type ).toBe( expected.type );
				expect( value.namespace ).toBe( expected.namespace );
				expect( value.resourceName ).toBe( expected.resourceName );
				expect( value.queryString ).toBe( expected.queryString );
				expect( value.ids ).toEqual( expected.ids );
				expect( Object.keys( value.response ) ).toEqual(
					Object.keys( expected.response )
				);
				const { done } = fulfillment.next();
				expect( done ).toBe( true );
			}
		);
		test(
			'when route is retrieved, yields apiFetchWithHeaders control action with ' +
				'expected route',
			() => {
				rewind();
				fulfillment.next();
				const { value } = fulfillment.next( 'https://example.org' );
				expect( value ).toEqual(
					apiFetchWithHeaders( {
						path: 'https://example.org?foo=bar',
					} )
				);
			}
		);
		test(
			'when apiFetchWithHeaders does not return a valid response, ' +
				'yields expected action',
			() => {
				const { value } = fulfillment.next( {} );
				expect( value ).toEqual(
					receiveCollection(
						'wc/blocks',
						'products',
						'?foo=bar',
						[ 20, 30 ],
						{ items: [], headers: undefined }
					)
				);
			}
		);
		test(
			'when apiFetch returns a valid response, yields expected ' +
				'action',
			() => {
				rewind();
				fulfillment.next();
				fulfillment.next( 'https://example.org' );
				const { value } = fulfillment.next( {
					response: [ '42', 'cheeseburgers' ],
					headers: { foo: 'bar' },
				} );
				expect( value ).toEqual(
					receiveCollection(
						'wc/blocks',
						'products',
						'?foo=bar',
						[ 20, 30 ],
						{
							items: [ '42', 'cheeseburgers' ],
							headers: { foo: 'bar' },
						}
					)
				);
				const { done } = fulfillment.next();
				expect( done ).toBe( true );
			}
		);
	} );
} );

describe( 'getCollectionHeader', () => {
	let fulfillment;
	const rewind = ( ...testArgs ) =>
		( fulfillment = getCollectionHeader( ...testArgs ) );
	it( 'yields expected select control when called with less args', () => {
		rewind( 'x-wp-total', '/wc/blocks', 'products' );
		const { value } = fulfillment.next();
		expect( value ).toEqual(
			select( STORE_KEY, 'getCollection', '/wc/blocks', 'products' )
		);
	} );
	it( 'yields expected select control when called with all args', () => {
		const args = [
			'x-wp-total',
			'/wc/blocks',
			'products/attributes',
			{ sort: 'ASC' },
			[ 10 ],
		];
		rewind( ...args );
		const { value } = fulfillment.next();
		expect( value ).toEqual(
			select(
				STORE_KEY,
				'/wc/blocks',
				'products/attributes',
				{ sort: 'ASC' },
				[ 10 ]
			)
		);
		const { done } = fulfillment.next();
		expect( done ).toBe( true );
	} );
} );
woocommerce-blocks/assets/js/data/collections/test/reducers.js000064400000005155151335517650020655 0ustar00/**
 * External dependencies
 */
import deepFreeze from 'deep-freeze';

/**
 * Internal dependencies
 */
import receiveCollection from '../reducers';
import { ACTION_TYPES as types } from '../action-types';

describe( 'receiveCollection', () => {
	const originalState = deepFreeze( {
		'wc/blocks': {
			products: {
				'[]': {
					'?someQuery=2': {
						items: [ 'foo' ],
						headers: { 'x-wp-total': 22 },
					},
				},
			},
		},
	} );
	it(
		'returns original state when there is already an entry in the state ' +
			'for the given arguments',
		() => {
			const testAction = {
				type: types.RECEIVE_COLLECTION,
				namespace: 'wc/blocks',
				resourceName: 'products',
				queryString: '?someQuery=2',
				response: {
					items: [ 'bar' ],
					headers: { foo: 'bar' },
				},
			};
			expect( receiveCollection( originalState, testAction ) ).toBe(
				originalState
			);
		}
	);
	it(
		'returns new state when items exist in collection but the type is ' +
			'for a reset',
		() => {
			const testAction = {
				type: types.RESET_COLLECTION,
				namespace: 'wc/blocks',
				resourceName: 'products',
				queryString: '?someQuery=2',
				response: {
					items: [ 'cheeseburger' ],
					headers: { foo: 'bar' },
				},
			};
			const newState = receiveCollection( originalState, testAction );
			expect( newState ).not.toBe( originalState );
			expect(
				newState[ 'wc/blocks' ].products[ '[]' ][ '?someQuery=2' ]
			).toEqual( {
				items: [ 'cheeseburger' ],
				headers: { foo: 'bar' },
			} );
		}
	);
	it( 'returns new state when items do not exist in collection yet', () => {
		const testAction = {
			type: types.RECEIVE_COLLECTION,
			namespace: 'wc/blocks',
			resourceName: 'products',
			queryString: '?someQuery=3',
			response: { items: [ 'cheeseburger' ], headers: { foo: 'bar' } },
		};
		const newState = receiveCollection( originalState, testAction );
		expect( newState ).not.toBe( originalState );
		expect(
			newState[ 'wc/blocks' ].products[ '[]' ][ '?someQuery=3' ]
		).toEqual( { items: [ 'cheeseburger' ], headers: { foo: 'bar' } } );
	} );
	it( 'sets expected state when ids are passed in', () => {
		const testAction = {
			type: types.RECEIVE_COLLECTION,
			namespace: 'wc/blocks',
			resourceName: 'products/attributes',
			queryString: '?something',
			response: { items: [ 10, 20 ], headers: { foo: 'bar' } },
			ids: [ 30, 42 ],
		};
		const newState = receiveCollection( originalState, testAction );
		expect( newState ).not.toBe( originalState );
		expect(
			newState[ 'wc/blocks' ][ 'products/attributes' ][ '[30,42]' ][
				'?something'
			]
		).toEqual( { items: [ 10, 20 ], headers: { foo: 'bar' } } );
	} );
} );
woocommerce-blocks/assets/js/data/collections/test/selectors.js000064400000005403151335517650021040 0ustar00/**
 * Internal dependencies
 */
import { getCollection, getCollectionHeader } from '../selectors';

const getHeaderMock = ( total ) => {
	const headers = { total };
	return {
		get: ( key ) => headers[ key ] || null,
		has: ( key ) => !! headers[ key ],
	};
};

const state = {
	'wc/blocks': {
		products: {
			'[]': {
				'?someQuery=2': {
					items: [ 'foo' ],
					headers: getHeaderMock( 22 ),
				},
			},
		},
		'products/attributes': {
			'[10]': {
				'?someQuery=2': {
					items: [ 'bar' ],
					headers: getHeaderMock( 42 ),
				},
			},
		},
		'products/attributes/terms': {
			'[10,20]': {
				'?someQuery=10': {
					items: [ 42 ],
					headers: getHeaderMock( 12 ),
				},
			},
		},
	},
};

describe( 'getCollection', () => {
	it( 'returns empty array when namespace does not exist in state', () => {
		expect( getCollection( state, 'invalid', 'products' ) ).toEqual( [] );
	} );
	it( 'returns empty array when resourceName does not exist in state', () => {
		expect( getCollection( state, 'wc/blocks', 'invalid' ) ).toEqual( [] );
	} );
	it( 'returns empty array when query does not exist in state', () => {
		expect( getCollection( state, 'wc/blocks', 'products' ) ).toEqual( [] );
	} );
	it( 'returns empty array when ids do not exist in state', () => {
		expect(
			getCollection(
				state,
				'wc/blocks',
				'products/attributes',
				'?someQuery=2',
				[ 20 ]
			)
		).toEqual( [] );
	} );
	describe( 'returns expected values for items existing in state', () => {
		test.each`
			resourceName                     | ids             | query                  | expected
			${ 'products' }                  | ${ [] }         | ${ { someQuery: 2 } }  | ${ [ 'foo' ] }
			${ 'products/attributes' }       | ${ [ 10 ] }     | ${ { someQuery: 2 } }  | ${ [ 'bar' ] }
			${ 'products/attributes/terms' } | ${ [ 10, 20 ] } | ${ { someQuery: 10 } } | ${ [ 42 ] }
		`(
			'for "$resourceName", "$ids", and "$query"',
			( { resourceName, ids, query, expected } ) => {
				expect(
					getCollection(
						state,
						'wc/blocks',
						resourceName,
						query,
						ids
					)
				).toEqual( expected );
			}
		);
	} );
} );

describe( 'getCollectionHeader', () => {
	it(
		'returns undefined when there are headers but the specific header ' +
			'does not exist',
		() => {
			expect(
				getCollectionHeader(
					state,
					'invalid',
					'wc/blocks',
					'products',
					{
						someQuery: 2,
					}
				)
			).toBeUndefined();
		}
	);
	it( 'returns null when there are no headers for the given arguments', () => {
		expect( getCollectionHeader( state, 'wc/blocks', 'invalid' ) ).toBe(
			null
		);
	} );
	it( 'returns expected header when it exists', () => {
		expect(
			getCollectionHeader( state, 'total', 'wc/blocks', 'products', {
				someQuery: 2,
			} )
		).toBe( 22 );
	} );
} );
woocommerce-blocks/assets/js/data/collections/constants.js000064400000000130151335517650020062 0ustar00export const STORE_KEY = 'wc/store/collections';
export const DEFAULT_EMPTY_ARRAY = [];
woocommerce-blocks/assets/js/data/collections/action-types.js000064400000000372151335517650020475 0ustar00export const ACTION_TYPES = {
	RECEIVE_COLLECTION: 'RECEIVE_COLLECTION',
	RESET_COLLECTION: 'RESET_COLLECTION',
	ERROR: 'ERROR',
	RECEIVE_LAST_MODIFIED: 'RECEIVE_LAST_MODIFIED',
	INVALIDATE_RESOLUTION_FOR_STORE: 'INVALIDATE_RESOLUTION_FOR_STORE',
};
woocommerce-blocks/assets/js/data/collections/selectors.js000064400000007220151335517650020060 0ustar00/**
 * External dependencies
 */
import { addQueryArgs } from '@wordpress/url';

/**
 * Internal dependencies
 */
import { hasInState } from '../utils';
import { DEFAULT_EMPTY_ARRAY } from './constants';

const getFromState = ( {
	state,
	namespace,
	resourceName,
	query,
	ids,
	type = 'items',
	fallback = DEFAULT_EMPTY_ARRAY,
} ) => {
	// prep ids and query for state retrieval
	ids = JSON.stringify( ids );
	query = query !== null ? addQueryArgs( '', query ) : '';
	if ( hasInState( state, [ namespace, resourceName, ids, query, type ] ) ) {
		return state[ namespace ][ resourceName ][ ids ][ query ][ type ];
	}
	return fallback;
};

const getCollectionHeaders = (
	state,
	namespace,
	resourceName,
	query = null,
	ids = DEFAULT_EMPTY_ARRAY
) => {
	return getFromState( {
		state,
		namespace,
		resourceName,
		query,
		ids,
		type: 'headers',
		fallback: undefined,
	} );
};

/**
 * Retrieves the collection items from the state for the given arguments.
 *
 * @param {Object} state        The current collections state.
 * @param {string} namespace    The namespace for the collection.
 * @param {string} resourceName The resource name for the collection.
 * @param {Object} [query=null] The query for the collection request.
 * @param {Array}  [ids=[]]     Any ids for the collection request (these are
 *                              values that would be added to the route for a
 *                              route with id placeholders)
 * @return {Array} an array of items stored in the collection.
 */
export const getCollection = (
	state,
	namespace,
	resourceName,
	query = null,
	ids = DEFAULT_EMPTY_ARRAY
) => {
	return getFromState( { state, namespace, resourceName, query, ids } );
};

export const getCollectionError = (
	state,
	namespace,
	resourceName,
	query = null,
	ids = DEFAULT_EMPTY_ARRAY
) => {
	return getFromState( {
		state,
		namespace,
		resourceName,
		query,
		ids,
		type: 'error',
		fallback: null,
	} );
};

/**
 * This selector enables retrieving a specific header value from a given
 * collection request.
 *
 * Example:
 *
 * ```js
 * const totalProducts = wp.data.select( COLLECTION_STORE_KEY )
 *   .getCollectionHeader( '/wc/blocks', 'products', 'x-wp-total' )
 * ```
 *
 * @param {string} state        The current collection state.
 * @param {string} header       The header to retrieve.
 * @param {string} namespace    The namespace for the collection.
 * @param {string} resourceName The model name for the collection.
 * @param {Object} [query=null] The query object on the collection request.
 * @param {Array}  [ids=[]]     Any ids for the collection request (these are
 *                              values that would be added to the route for a
 *                              route with id placeholders)
 *
 * @return {*|null} The value for the specified header, null if there are no
 * headers available and undefined if the header does not exist for the
 * collection.
 */
export const getCollectionHeader = (
	state,
	header,
	namespace,
	resourceName,
	query = null,
	ids = DEFAULT_EMPTY_ARRAY
) => {
	const headers = getCollectionHeaders(
		state,
		namespace,
		resourceName,
		query,
		ids
	);
	// Can't just do a truthy check because `getCollectionHeaders` resolver
	// invokes the `getCollection` selector to trigger the resolution of the
	// collection request. Its fallback is an empty array.
	if ( headers && headers.get ) {
		return headers.has( header ) ? headers.get( header ) : undefined;
	}
	return null;
};

/**
 * Gets the last modified header for the collection.
 *
 * @param {string} state The current collection state.
 * @return {number} Timestamp.
 */
export const getCollectionLastModified = ( state ) => {
	return state.lastModified || 0;
};
woocommerce-blocks/assets/js/data/collections/index.js000064400000001131151335517650017157 0ustar00/**
 * External dependencies
 */
import { registerStore } from '@wordpress/data';
import { controls as dataControls } from '@wordpress/data-controls';

/**
 * Internal dependencies
 */
import { STORE_KEY } from './constants';
import * as selectors from './selectors';
import * as actions from './actions';
import * as resolvers from './resolvers';
import reducer from './reducers';
import { controls } from '../shared-controls';

registerStore( STORE_KEY, {
	reducer,
	actions,
	controls: { ...dataControls, ...controls },
	selectors,
	resolvers,
} );

export const COLLECTIONS_STORE_KEY = STORE_KEY;
woocommerce-blocks/assets/js/data/default-states.ts000064400000004275151335517650016505 0ustar00/**
 * External dependencies
 */
import type { Cart, CartMeta } from '@woocommerce/types';

/**
 * Internal dependencies
 */
import {
	EMPTY_CART_COUPONS,
	EMPTY_CART_ITEMS,
	EMPTY_CART_FEES,
	EMPTY_CART_ITEM_ERRORS,
	EMPTY_CART_ERRORS,
	EMPTY_SHIPPING_RATES,
	EMPTY_TAX_LINES,
	EMPTY_PAYMENT_REQUIREMENTS,
	EMPTY_EXTENSIONS,
} from './constants';
import type { ResponseError } from './types';

export interface CartState {
	cartItemsPendingQuantity: Array< string >;
	cartItemsPendingDelete: Array< string >;
	cartData: Cart;
	metaData: CartMeta;
	errors: Array< ResponseError >;
}

export const EMPTY_PENDING_QUANTITY: [  ] = [];
export const EMPTY_PENDING_DELETE: [  ] = [];

export const defaultCartState: CartState = {
	cartItemsPendingQuantity: EMPTY_PENDING_QUANTITY,
	cartItemsPendingDelete: EMPTY_PENDING_DELETE,
	cartData: {
		coupons: EMPTY_CART_COUPONS,
		shippingRates: EMPTY_SHIPPING_RATES,
		shippingAddress: {
			first_name: '',
			last_name: '',
			company: '',
			address_1: '',
			address_2: '',
			city: '',
			state: '',
			postcode: '',
			country: '',
			phone: '',
		},
		billingAddress: {
			first_name: '',
			last_name: '',
			company: '',
			address_1: '',
			address_2: '',
			city: '',
			state: '',
			postcode: '',
			country: '',
			phone: '',
			email: '',
		},
		items: EMPTY_CART_ITEMS,
		itemsCount: 0,
		itemsWeight: 0,
		needsShipping: true,
		needsPayment: false,
		hasCalculatedShipping: true,
		fees: EMPTY_CART_FEES,
		totals: {
			currency_code: '',
			currency_symbol: '',
			currency_minor_unit: 2,
			currency_decimal_separator: '.',
			currency_thousand_separator: ',',
			currency_prefix: '',
			currency_suffix: '',
			total_items: '0',
			total_items_tax: '0',
			total_fees: '0',
			total_fees_tax: '0',
			total_discount: '0',
			total_discount_tax: '0',
			total_shipping: '0',
			total_shipping_tax: '0',
			total_price: '0',
			total_tax: '0',
			tax_lines: EMPTY_TAX_LINES,
		},
		errors: EMPTY_CART_ITEM_ERRORS,
		paymentRequirements: EMPTY_PAYMENT_REQUIREMENTS,
		extensions: EMPTY_EXTENSIONS,
	},
	metaData: {
		updatingCustomerData: false,
		updatingSelectedRate: false,
		applyingCoupon: '',
		removingCoupon: '',
		isCartDataStale: false,
	},
	errors: EMPTY_CART_ERRORS,
};
woocommerce-blocks/assets/js/data/constants.ts000064400000001067151335517650015570 0ustar00/**
 * REST API namespace for rest requests against blocks namespace.
 *
 * @member  {string}
 */
export const API_BLOCK_NAMESPACE = 'wc/blocks';

export const EMPTY_CART_COUPONS: [  ] = [];
export const EMPTY_CART_ITEMS: [  ] = [];
export const EMPTY_CART_FEES: [  ] = [];
export const EMPTY_CART_ITEM_ERRORS: [  ] = [];
export const EMPTY_CART_ERRORS: [  ] = [];
export const EMPTY_SHIPPING_RATES: [  ] = [];
export const EMPTY_PAYMENT_REQUIREMENTS: [  ] = [];
export const EMPTY_EXTENSIONS: Record< string, unknown > = {};
export const EMPTY_TAX_LINES: [  ] = [];
woocommerce-blocks/assets/js/shared/hocs/index.js000064400000000055151335517650016136 0ustar00export * from './with-product-data-context';
woocommerce-blocks/assets/js/shared/hocs/with-product-data-context.js000064400000003652151335517650022057 0ustar00/**
 * External dependencies
 */
import apiFetch from '@wordpress/api-fetch';
import {
	ProductDataContextProvider,
	useProductDataContext,
} from '@woocommerce/shared-context';
import { useState, useEffect } from '@wordpress/element';

/**
 * Loads the product from the API and adds to the context provider.
 *
 * @param {Object} props Component props.
 */
const OriginalComponentWithContext = ( props ) => {
	const { productId, OriginalComponent } = props;
	const [ product, setProduct ] = useState( null );
	const [ isLoading, setIsLoading ] = useState( true );

	useEffect( () => {
		if ( !! props.product ) {
			setProduct( props.product );
			setIsLoading( false );
		}
	}, [ props.product ] );

	useEffect( () => {
		if ( productId > 0 ) {
			setIsLoading( true );
			apiFetch( {
				path: `/wc/store/products/${ productId }`,
			} )
				.then( ( receivedProduct ) => {
					setProduct( receivedProduct );
				} )
				.catch( async () => {
					setProduct( null );
				} )
				.finally( () => {
					setIsLoading( false );
				} );
		}
	}, [ productId ] );

	if ( ! isLoading && ! product ) {
		return null;
	}

	return (
		<ProductDataContextProvider product={ product } isLoading={ isLoading }>
			<OriginalComponent { ...props } />
		</ProductDataContextProvider>
	);
};

/**
 * This HOC sees if the Block is wrapped in Product Data Context, and if not, wraps it with context
 * based on the productId attribute, if set.
 *
 * @param {Function} OriginalComponent Component being wrapped.
 */
export const withProductDataContext = ( OriginalComponent ) => {
	return ( props ) => {
		const productDataContext = useProductDataContext();

		// If a product prop was provided, use this as the context for the tree.
		if ( !! props.product || ! productDataContext.hasContext ) {
			return (
				<OriginalComponentWithContext
					{ ...props }
					OriginalComponent={ OriginalComponent }
				/>
			);
		}

		return <OriginalComponent { ...props } />;
	};
};
woocommerce-blocks/assets/js/shared/context/index.js000064400000000126151335517650016665 0ustar00export * from './inner-block-layout-context';
export * from './product-data-context';
woocommerce-blocks/assets/js/shared/context/product-data-context.js000064400000003525151335517650021635 0ustar00/**
 * External dependencies
 */
import PropTypes from 'prop-types';
import { createContext, useContext } from '@wordpress/element';

/**
 * Default product shape matching API response.
 */
const defaultProductData = {
	id: 0,
	name: '',
	parent: 0,
	type: 'simple',
	variation: '',
	permalink: '',
	sku: '',
	short_description: '',
	description: '',
	on_sale: false,
	prices: {
		currency_code: 'USD',
		currency_symbol: '$',
		currency_minor_unit: 2,
		currency_decimal_separator: '.',
		currency_thousand_separator: ',',
		currency_prefix: '$',
		currency_suffix: '',
		price: '0',
		regular_price: '0',
		sale_price: '0',
		price_range: null,
	},
	price_html: '',
	average_rating: '0',
	review_count: 0,
	images: [],
	categories: [],
	tags: [],
	attributes: [],
	variations: [],
	has_options: false,
	is_purchasable: false,
	is_in_stock: false,
	is_on_backorder: false,
	low_stock_remaining: null,
	sold_individually: false,
	quantity_limit: 99,
	add_to_cart: {
		text: 'Add to cart',
		description: 'Add to cart',
		url: '',
	},
};

/**
 * This context is used to pass product data down to all children blocks in a given tree.
 *
 * @member {Object} ProductDataContext A react context object
 */
const ProductDataContext = createContext( {
	product: defaultProductData,
	hasContext: false,
} );

export const useProductDataContext = () => useContext( ProductDataContext );

export const ProductDataContextProvider = ( {
	product = null,
	children,
	isLoading = false,
} ) => {
	const contextValue = {
		product: product || defaultProductData,
		hasContext: true,
	};

	return (
		<ProductDataContext.Provider value={ contextValue }>
			{ isLoading ? (
				<div className="is-loading">{ children }</div>
			) : (
				children
			) }
		</ProductDataContext.Provider>
	);
};

ProductDataContextProvider.propTypes = {
	children: PropTypes.node,
	product: PropTypes.object,
};
woocommerce-blocks/assets/js/shared/context/inner-block-layout-context.js000064400000002073151335517650022761 0ustar00/**
 * External dependencies
 */
import PropTypes from 'prop-types';
import { createContext, useContext } from '@wordpress/element';

/**
 * This context is a configuration object used for connecting
 * all children blocks in a given tree contained in the context with information
 * about the parent block. Typically this is used for extensibility features.
 *
 * @member {Object} InnerBlockLayoutContext A react context object
 */
const InnerBlockLayoutContext = createContext( {
	parentName: '',
	parentClassName: '',
	isLoading: false,
} );

export const useInnerBlockLayoutContext = () =>
	useContext( InnerBlockLayoutContext );

export const InnerBlockLayoutContextProvider = ( {
	parentName = '',
	parentClassName = '',
	children,
} ) => {
	const contextValue = {
		parentName,
		parentClassName,
	};
	return (
		<InnerBlockLayoutContext.Provider value={ contextValue }>
			{ children }
		</InnerBlockLayoutContext.Provider>
	);
};

InnerBlockLayoutContextProvider.propTypes = {
	children: PropTypes.node,
	parentName: PropTypes.string,
	parentClassName: PropTypes.string,
};
woocommerce-blocks/assets/js/hocs/with-product.js000064400000003403151335517650016212 0ustar00/**
 * External dependencies
 */
import { Component } from '@wordpress/element';
import { createHigherOrderComponent } from '@wordpress/compose';
import { getProduct } from '@woocommerce/editor-components/utils';

/**
 * Internal dependencies
 */
import { formatError } from '../base/utils/errors.js';

/**
 * HOC that queries a product for a component.
 *
 * @param {Function} OriginalComponent Component being wrapped.
 */
const withProduct = createHigherOrderComponent( ( OriginalComponent ) => {
	return class WrappedComponent extends Component {
		state = {
			error: null,
			loading: false,
			product:
				this.props.attributes.productId === 'preview'
					? this.props.attributes.previewProduct
					: null,
		};

		componentDidMount() {
			this.loadProduct();
		}

		componentDidUpdate( prevProps ) {
			if (
				prevProps.attributes.productId !==
				this.props.attributes.productId
			) {
				this.loadProduct();
			}
		}

		loadProduct = () => {
			const { productId } = this.props.attributes;

			if ( productId === 'preview' ) {
				return;
			}

			if ( ! productId ) {
				this.setState( { product: null, loading: false, error: null } );
				return;
			}

			this.setState( { loading: true } );

			getProduct( productId )
				.then( ( product ) => {
					this.setState( { product, loading: false, error: null } );
				} )
				.catch( async ( e ) => {
					const error = await formatError( e );

					this.setState( { product: null, loading: false, error } );
				} );
		};

		render() {
			const { error, loading, product } = this.state;

			return (
				<OriginalComponent
					{ ...this.props }
					error={ error }
					getProduct={ this.loadProduct }
					isLoading={ loading }
					product={ product }
				/>
			);
		}
	};
}, 'withProduct' );

export default withProduct;
woocommerce-blocks/assets/js/hocs/with-product-variations.js000064400000010660151335517650020372 0ustar00/**
 * External dependencies
 */
import { Component } from '@wordpress/element';
import { createHigherOrderComponent } from '@wordpress/compose';
import PropTypes from 'prop-types';
import isShallowEqual from '@wordpress/is-shallow-equal';
import { getProductVariations } from '@woocommerce/editor-components/utils';

/**
 * Internal dependencies
 */
import { formatError } from '../base/utils/errors.js';

/**
 * HOC that queries variations for a component.
 *
 * @param {Function} OriginalComponent Component being wrapped.
 */
const withProductVariations = createHigherOrderComponent(
	( OriginalComponent ) => {
		class WrappedComponent extends Component {
			state = {
				error: null,
				loading: false,
				variations: {},
			};

			componentDidMount() {
				const { selected, showVariations } = this.props;

				if ( selected && showVariations ) {
					this.loadVariations();
				}
			}

			componentDidUpdate( prevProps ) {
				const { isLoading, selected, showVariations } = this.props;

				if (
					showVariations &&
					( ! isShallowEqual( prevProps.selected, selected ) ||
						( prevProps.isLoading && ! isLoading ) )
				) {
					this.loadVariations();
				}
			}

			loadVariations = () => {
				const { products } = this.props;
				const { loading, variations } = this.state;

				if ( loading ) {
					return;
				}

				const expandedProduct = this.getExpandedProduct();

				if ( ! expandedProduct || variations[ expandedProduct ] ) {
					return;
				}

				const productDetails = products.find(
					( findProduct ) => findProduct.id === expandedProduct
				);

				if (
					! productDetails.variations ||
					productDetails.variations.length === 0
				) {
					this.setState( {
						variations: {
							...this.state.variations,
							[ expandedProduct ]: null,
						},
						loading: false,
						error: null,
					} );
					return;
				}

				this.setState( { loading: true } );

				getProductVariations( expandedProduct )
					.then( ( expandedProductVariations ) => {
						const newVariations = expandedProductVariations.map(
							( variation ) => ( {
								...variation,
								parent: expandedProduct,
							} )
						);
						this.setState( {
							variations: {
								...this.state.variations,
								[ expandedProduct ]: newVariations,
							},
							loading: false,
							error: null,
						} );
					} )
					.catch( async ( e ) => {
						const error = await formatError( e );

						this.setState( {
							variations: {
								...this.state.variations,
								[ expandedProduct ]: null,
							},
							loading: false,
							error,
						} );
					} );
			};

			isProductId( itemId ) {
				const { products } = this.props;
				return products.some( ( p ) => p.id === itemId );
			}

			findParentProduct( variationId ) {
				const { products } = this.props;
				const parentProduct = products.filter(
					( p ) =>
						p.variations &&
						p.variations.find( ( { id } ) => id === variationId )
				);
				return parentProduct[ 0 ].id;
			}

			getExpandedProduct() {
				const { isLoading, selected, showVariations } = this.props;

				if ( ! showVariations ) {
					return null;
				}

				let selectedItem =
					selected && selected.length ? selected[ 0 ] : null;

				// If there is no selected item, check if there was one in the past, so we
				// can keep the same product expanded.
				if ( selectedItem ) {
					this.prevSelectedItem = selectedItem;
				} else if ( this.prevSelectedItem ) {
					// If previous selected item was a variation
					if (
						! isLoading &&
						! this.isProductId( this.prevSelectedItem )
					) {
						selectedItem = this.prevSelectedItem;
					}
				}

				if ( ! isLoading && selectedItem ) {
					return this.isProductId( selectedItem )
						? selectedItem
						: this.findParentProduct( selectedItem );
				}

				return null;
			}

			render() {
				const { error: propsError, isLoading } = this.props;
				const { error, loading, variations } = this.state;

				return (
					<OriginalComponent
						{ ...this.props }
						error={ error || propsError }
						expandedProduct={ this.getExpandedProduct() }
						isLoading={ isLoading }
						variations={ variations }
						variationsLoading={ loading }
					/>
				);
			}

			static propTypes = {
				selected: PropTypes.array,
				showVariations: PropTypes.bool,
			};

			static defaultProps = {
				selected: [],
				showVariations: false,
			};
		}
		return WrappedComponent;
	},
	'withProductVariations'
);

export default withProductVariations;
woocommerce-blocks/assets/js/hocs/with-categories.js000064400000002675151335517650016671 0ustar00/**
 * External dependencies
 */
import { Component } from '@wordpress/element';
import { createHigherOrderComponent } from '@wordpress/compose';
import { getCategories } from '@woocommerce/editor-components/utils';

/**
 * Internal dependencies
 */
import { formatError } from '../base/utils/errors.js';

/**
 * HOC that queries categories for a component.
 *
 * @param {Function} OriginalComponent Component being wrapped.
 */
const withCategories = createHigherOrderComponent( ( OriginalComponent ) => {
	return class WrappedComponent extends Component {
		constructor() {
			super( ...arguments );
			this.state = {
				error: null,
				loading: false,
				categories: [],
			};
			this.loadCategories = this.loadCategories.bind( this );
		}

		componentDidMount() {
			this.loadCategories();
		}

		loadCategories() {
			this.setState( { loading: true } );

			getCategories()
				.then( ( categories ) => {
					this.setState( {
						categories,
						loading: false,
						error: null,
					} );
				} )
				.catch( async ( e ) => {
					const error = await formatError( e );

					this.setState( {
						categories: [],
						loading: false,
						error,
					} );
				} );
		}

		render() {
			const { error, loading, categories } = this.state;

			return (
				<OriginalComponent
					{ ...this.props }
					error={ error }
					isLoading={ loading }
					categories={ categories }
				/>
			);
		}
	};
}, 'withCategories' );

export default withCategories;
woocommerce-blocks/assets/js/hocs/with-searched-products.tsx000064400000004273151335517650020361 0ustar00/**
 * External dependencies
 */
import { useEffect, useState, useCallback } from '@wordpress/element';
import { blocksConfig } from '@woocommerce/block-settings';
import { getProducts } from '@woocommerce/editor-components/utils';
import { useDebouncedCallback } from 'use-debounce';
import type { ProductResponseItem } from '@woocommerce/types';

/**
 * Internal dependencies
 */
import { formatError } from '../base/utils/errors.js';

/**
 * A higher order component that enhances the provided component with products from a search query.
 */
const withSearchedProducts = (
	OriginalComponent: React.FunctionComponent< Record< string, unknown > >
) => {
	return ( { selected, ...props }: { selected: number[] } ): JSX.Element => {
		const [ isLoading, setIsLoading ] = useState( true );
		const [ error, setError ] = useState< {
			message: string;
			type: string;
		} | null >( null );
		const [ productsList, setProductsList ] = useState<
			ProductResponseItem[]
		>( [] );
		const isLargeCatalog = blocksConfig.productCount > 100;

		const setErrorState = async ( e: {
			message: string;
			type: string;
		} ) => {
			const formattedError = ( await formatError( e ) ) as {
				message: string;
				type: string;
			};
			setError( formattedError );
			setIsLoading( false );
		};

		useEffect( () => {
			getProducts( { selected } )
				.then( ( results ) => {
					setProductsList( results as ProductResponseItem[] );
					setIsLoading( false );
				} )
				.catch( setErrorState );
		}, [ selected ] );

		const [ debouncedSearch ] = useDebouncedCallback(
			( search: string ) => {
				getProducts( { selected, search } )
					.then( ( results ) => {
						setProductsList( results as ProductResponseItem[] );
						setIsLoading( false );
					} )
					.catch( setErrorState );
			},
			400
		);

		const onSearch = useCallback(
			( search: string ) => {
				setIsLoading( true );
				debouncedSearch( search );
			},
			[ setIsLoading, debouncedSearch ]
		);

		return (
			<OriginalComponent
				{ ...props }
				selected={ selected }
				error={ error }
				products={ productsList }
				isLoading={ isLoading }
				onSearch={ isLargeCatalog ? onSearch : null }
			/>
		);
	};
};

export default withSearchedProducts;
woocommerce-blocks/assets/js/hocs/test/with-product.js000064400000006676151335517650017210 0ustar00/**
 * External dependencies
 */
import TestRenderer from 'react-test-renderer';
import * as mockUtils from '@woocommerce/editor-components/utils';

/**
 * Internal dependencies
 */
import withProduct from '../with-product';
import * as mockBaseUtils from '../../base/utils/errors';

jest.mock( '@woocommerce/editor-components/utils', () => ( {
	getProduct: jest.fn(),
} ) );

jest.mock( '../../base/utils/errors', () => ( {
	formatError: jest.fn(),
} ) );

const mockProduct = { name: 'T-Shirt' };
const attributes = { productId: 1 };
const TestComponent = withProduct( ( props ) => {
	return (
		<div
			error={ props.error }
			getProduct={ props.getProduct }
			isLoading={ props.isLoading }
			product={ props.product }
		/>
	);
} );
const render = () => {
	return TestRenderer.create( <TestComponent attributes={ attributes } /> );
};

describe( 'withProduct Component', () => {
	let renderer;
	afterEach( () => {
		mockUtils.getProduct.mockReset();
	} );

	describe( 'lifecycle events', () => {
		beforeEach( () => {
			mockUtils.getProduct.mockImplementation( () => Promise.resolve() );
			renderer = render();
		} );

		it( 'getProduct is called on mount with passed in product id', () => {
			const { getProduct } = mockUtils;

			expect( getProduct ).toHaveBeenCalledWith( attributes.productId );
			expect( getProduct ).toHaveBeenCalledTimes( 1 );
		} );

		it( 'getProduct is called on component update', () => {
			const { getProduct } = mockUtils;
			const newAttributes = { ...attributes, productId: 2 };
			renderer.update( <TestComponent attributes={ newAttributes } /> );

			expect( getProduct ).toHaveBeenNthCalledWith(
				2,
				newAttributes.productId
			);
			expect( getProduct ).toHaveBeenCalledTimes( 2 );
		} );

		it( 'getProduct is hooked to the prop', () => {
			const { getProduct } = mockUtils;
			const props = renderer.root.findByType( 'div' ).props;

			props.getProduct();

			expect( getProduct ).toHaveBeenCalledTimes( 2 );
		} );
	} );

	describe( 'when the API returns product data', () => {
		beforeEach( () => {
			mockUtils.getProduct.mockImplementation( ( productId ) =>
				Promise.resolve( { ...mockProduct, id: productId } )
			);
			renderer = render();
		} );

		it( 'sets the product props', () => {
			const props = renderer.root.findByType( 'div' ).props;

			expect( props.error ).toBeNull();
			expect( typeof props.getProduct ).toBe( 'function' );
			expect( props.isLoading ).toBe( false );
			expect( props.product ).toEqual( {
				...mockProduct,
				id: attributes.productId,
			} );
		} );
	} );

	describe( 'when the API returns an error', () => {
		const error = { message: 'There was an error.' };
		const getProductPromise = Promise.reject( error );
		const formattedError = { message: 'There was an error.', type: 'api' };

		beforeEach( () => {
			mockUtils.getProduct.mockImplementation( () => getProductPromise );
			mockBaseUtils.formatError.mockImplementation(
				() => formattedError
			);
			renderer = render();
		} );

		test( 'sets the error prop', async () => {
			await expect( () => getProductPromise() ).toThrow();

			const { formatError } = mockBaseUtils;
			const props = renderer.root.findByType( 'div' ).props;

			expect( formatError ).toHaveBeenCalledWith( error );
			expect( formatError ).toHaveBeenCalledTimes( 1 );
			expect( props.error ).toEqual( formattedError );
			expect( typeof props.getProduct ).toBe( 'function' );
			expect( props.isLoading ).toBe( false );
			expect( props.product ).toBeNull();
		} );
	} );
} );
woocommerce-blocks/assets/js/hocs/test/with-category.js000064400000006763151335517650017342 0ustar00/**
 * External dependencies
 */
import TestRenderer from 'react-test-renderer';
import * as mockUtils from '@woocommerce/editor-components/utils';

/**
 * Internal dependencies
 */
import withCategory from '../with-category';
import * as mockBaseUtils from '../../base/utils/errors';

jest.mock( '@woocommerce/editor-components/utils', () => ( {
	getCategory: jest.fn(),
} ) );

jest.mock( '../../base/utils/errors', () => ( {
	formatError: jest.fn(),
} ) );

const mockCategory = { name: 'Clothing' };
const attributes = { categoryId: 1 };
const TestComponent = withCategory( ( props ) => {
	return (
		<div
			error={ props.error }
			getCategory={ props.getCategory }
			isLoading={ props.isLoading }
			category={ props.category }
		/>
	);
} );
const render = () => {
	return TestRenderer.create( <TestComponent attributes={ attributes } /> );
};

describe( 'withCategory Component', () => {
	let renderer;
	afterEach( () => {
		mockUtils.getCategory.mockReset();
	} );

	describe( 'lifecycle events', () => {
		beforeEach( () => {
			mockUtils.getCategory.mockImplementation( () => Promise.resolve() );
			renderer = render();
		} );

		it( 'getCategory is called on mount with passed in category id', () => {
			const { getCategory } = mockUtils;

			expect( getCategory ).toHaveBeenCalledWith( attributes.categoryId );
			expect( getCategory ).toHaveBeenCalledTimes( 1 );
		} );

		it( 'getCategory is called on component update', () => {
			const { getCategory } = mockUtils;
			const newAttributes = { ...attributes, categoryId: 2 };
			renderer.update( <TestComponent attributes={ newAttributes } /> );

			expect( getCategory ).toHaveBeenNthCalledWith(
				2,
				newAttributes.categoryId
			);
			expect( getCategory ).toHaveBeenCalledTimes( 2 );
		} );

		it( 'getCategory is hooked to the prop', () => {
			const { getCategory } = mockUtils;
			const props = renderer.root.findByType( 'div' ).props;

			props.getCategory();

			expect( getCategory ).toHaveBeenCalledTimes( 2 );
		} );
	} );

	describe( 'when the API returns category data', () => {
		beforeEach( () => {
			mockUtils.getCategory.mockImplementation( ( categoryId ) =>
				Promise.resolve( { ...mockCategory, id: categoryId } )
			);
			renderer = render();
		} );

		it( 'sets the category props', () => {
			const props = renderer.root.findByType( 'div' ).props;

			expect( props.error ).toBeNull();
			expect( typeof props.getCategory ).toBe( 'function' );
			expect( props.isLoading ).toBe( false );
			expect( props.category ).toEqual( {
				...mockCategory,
				id: attributes.categoryId,
			} );
		} );
	} );

	describe( 'when the API returns an error', () => {
		const error = { message: 'There was an error.' };
		const getCategoryPromise = Promise.reject( error );
		const formattedError = { message: 'There was an error.', type: 'api' };

		beforeEach( () => {
			mockUtils.getCategory.mockImplementation(
				() => getCategoryPromise
			);
			mockBaseUtils.formatError.mockImplementation(
				() => formattedError
			);
			renderer = render();
		} );

		test( 'sets the error prop', async () => {
			await expect( () => getCategoryPromise() ).toThrow();

			const { formatError } = mockBaseUtils;
			const props = renderer.root.findByType( 'div' ).props;

			expect( formatError ).toHaveBeenCalledWith( error );
			expect( formatError ).toHaveBeenCalledTimes( 1 );
			expect( props.error ).toEqual( formattedError );
			expect( typeof props.getCategory ).toBe( 'function' );
			expect( props.isLoading ).toBe( false );
			expect( props.category ).toBeNull();
		} );
	} );
} );
woocommerce-blocks/assets/js/hocs/test/with-transform-single-select-to-multiple-select.js000064400000002045151335517650026007 0ustar00/**
 * External dependencies
 */
import TestRenderer from 'react-test-renderer';

/**
 * Internal dependencies
 */
import withTransformSingleSelectToMultipleSelect from '../with-transform-single-select-to-multiple-select';

const TestComponent = withTransformSingleSelectToMultipleSelect( ( props ) => {
	return <div selected={ props.selected } />;
} );

describe( 'withTransformSingleSelectToMultipleSelect Component', () => {
	describe( 'when the API returns an error', () => {
		it( 'converts the selected value into an array', () => {
			const selected = 123;
			const renderer = TestRenderer.create(
				<TestComponent selected={ selected } />
			);
			const props = renderer.root.findByType( 'div' ).props;
			expect( props.selected ).toEqual( [ selected ] );
		} );

		it( 'passes an empty array as the selected prop if selected was null', () => {
			const renderer = TestRenderer.create(
				<TestComponent selected={ null } />
			);
			const props = renderer.root.findByType( 'div' ).props;
			expect( props.selected ).toEqual( [] );
		} );
	} );
} );
woocommerce-blocks/assets/js/hocs/test/with-categories.js000064400000005140151335517650017636 0ustar00/**
 * External dependencies
 */
import TestRenderer from 'react-test-renderer';
import * as mockUtils from '@woocommerce/editor-components/utils';

/**
 * Internal dependencies
 */
import withCategories from '../with-categories';
import * as mockBaseUtils from '../../base/utils/errors';

jest.mock( '@woocommerce/editor-components/utils', () => ( {
	getCategories: jest.fn(),
} ) );

jest.mock( '../../base/utils/errors', () => ( {
	formatError: jest.fn(),
} ) );

const mockCategories = [
	{ id: 1, name: 'Clothing' },
	{ id: 2, name: 'Food' },
];
const TestComponent = withCategories( ( props ) => {
	return (
		<div
			error={ props.error }
			isLoading={ props.isLoading }
			categories={ props.categories }
		/>
	);
} );
const render = () => {
	return TestRenderer.create( <TestComponent /> );
};

describe( 'withCategories Component', () => {
	let renderer;
	afterEach( () => {
		mockUtils.getCategories.mockReset();
	} );

	describe( 'lifecycle events', () => {
		beforeEach( () => {
			mockUtils.getCategories.mockImplementation( () =>
				Promise.resolve()
			);
			renderer = render();
		} );

		it( 'getCategories is called on mount', () => {
			const { getCategories } = mockUtils;
			expect( getCategories ).toHaveBeenCalledTimes( 1 );
		} );
	} );

	describe( 'when the API returns categories data', () => {
		beforeEach( () => {
			mockUtils.getCategories.mockImplementation( () =>
				Promise.resolve( mockCategories )
			);
			renderer = render();
		} );

		it( 'sets the categories props', () => {
			const props = renderer.root.findByType( 'div' ).props;

			expect( props.error ).toBeNull();
			expect( props.isLoading ).toBe( false );
			expect( props.categories ).toEqual( mockCategories );
		} );
	} );

	describe( 'when the API returns an error', () => {
		const error = { message: 'There was an error.' };
		const getCategoriesPromise = Promise.reject( error );
		const formattedError = { message: 'There was an error.', type: 'api' };

		beforeEach( () => {
			mockUtils.getCategories.mockImplementation(
				() => getCategoriesPromise
			);
			mockBaseUtils.formatError.mockImplementation(
				() => formattedError
			);
			renderer = render();
		} );

		test( 'sets the error prop', async () => {
			await expect( () => getCategoriesPromise() ).toThrow();

			const { formatError } = mockBaseUtils;
			const props = renderer.root.findByType( 'div' ).props;

			expect( formatError ).toHaveBeenCalledWith( error );
			expect( formatError ).toHaveBeenCalledTimes( 1 );
			expect( props.error ).toEqual( formattedError );
			expect( props.isLoading ).toBe( false );
			expect( props.categories ).toEqual( [] );
		} );
	} );
} );
woocommerce-blocks/assets/js/hocs/test/with-product-variations.js000064400000011276151335517650021355 0ustar00/**
 * External dependencies
 */
import TestRenderer from 'react-test-renderer';
import * as mockUtils from '@woocommerce/editor-components/utils';

/**
 * Internal dependencies
 */
import withProductVariations from '../with-product-variations';
import * as mockBaseUtils from '../../base/utils/errors';

jest.mock( '@woocommerce/editor-components/utils', () => ( {
	getProductVariations: jest.fn(),
} ) );

jest.mock( '../../base/utils/errors', () => ( {
	formatError: jest.fn(),
} ) );

const mockProducts = [
	{ id: 1, name: 'Hoodie', variations: [ { id: 3 }, { id: 4 } ] },
	{ id: 2, name: 'Backpack' },
];
const mockVariations = [
	{ id: 3, name: 'Blue' },
	{ id: 4, name: 'Red' },
];
const TestComponent = withProductVariations( ( props ) => {
	return (
		<div
			error={ props.error }
			expandedProduct={ props.expandedProduct }
			isLoading={ props.isLoading }
			variations={ props.variations }
			variationsLoading={ props.variationsLoading }
		/>
	);
} );
const render = () => {
	return TestRenderer.create(
		<TestComponent
			error={ null }
			isLoading={ false }
			products={ mockProducts }
			selected={ [ 1 ] }
			showVariations={ true }
		/>
	);
};

describe( 'withProductVariations Component', () => {
	let renderer;
	afterEach( () => {
		mockUtils.getProductVariations.mockReset();
	} );

	describe( 'lifecycle events', () => {
		beforeEach( () => {
			mockUtils.getProductVariations.mockImplementation( () =>
				Promise.resolve( mockVariations )
			);
		} );

		it( 'getProductVariations is called on mount', () => {
			renderer = render();
			const { getProductVariations } = mockUtils;

			expect( getProductVariations ).toHaveBeenCalledWith( 1 );
			expect( getProductVariations ).toHaveBeenCalledTimes( 1 );
		} );

		it( 'getProductVariations is called on component update', () => {
			renderer = TestRenderer.create(
				<TestComponent
					error={ null }
					isLoading={ false }
					products={ mockProducts }
				/>
			);
			const { getProductVariations } = mockUtils;

			expect( getProductVariations ).toHaveBeenCalledTimes( 0 );

			renderer.update(
				<TestComponent
					error={ null }
					isLoading={ false }
					products={ mockProducts }
					selected={ [ 1 ] }
					showVariations={ true }
				/>
			);

			expect( getProductVariations ).toHaveBeenCalledWith( 1 );
			expect( getProductVariations ).toHaveBeenCalledTimes( 1 );
		} );

		it( 'getProductVariations is not called if selected product has no variations', () => {
			TestRenderer.create(
				<TestComponent
					error={ null }
					isLoading={ false }
					products={ mockProducts }
					selected={ [ 2 ] }
					showVariations={ true }
				/>
			);
			const { getProductVariations } = mockUtils;

			expect( getProductVariations ).toHaveBeenCalledTimes( 0 );
		} );

		it( 'getProductVariations is called if selected product is a variation', () => {
			TestRenderer.create(
				<TestComponent
					error={ null }
					isLoading={ false }
					products={ mockProducts }
					selected={ [ 3 ] }
					showVariations={ true }
				/>
			);
			const { getProductVariations } = mockUtils;

			expect( getProductVariations ).toHaveBeenCalledWith( 1 );
			expect( getProductVariations ).toHaveBeenCalledTimes( 1 );
		} );
	} );

	describe( 'when the API returns variations data', () => {
		beforeEach( () => {
			mockUtils.getProductVariations.mockImplementation( () =>
				Promise.resolve( mockVariations )
			);
			renderer = render();
		} );

		it( 'sets the variations props', () => {
			const props = renderer.root.findByType( 'div' ).props;
			const expectedVariations = {
				1: [
					{ id: 3, name: 'Blue', parent: 1 },
					{ id: 4, name: 'Red', parent: 1 },
				],
			};

			expect( props.error ).toBeNull();
			expect( props.isLoading ).toBe( false );
			expect( props.variations ).toEqual( expectedVariations );
		} );
	} );

	describe( 'when the API returns an error', () => {
		const error = { message: 'There was an error.' };
		const getProductVariationsPromise = Promise.reject( error );
		const formattedError = { message: 'There was an error.', type: 'api' };

		beforeEach( () => {
			mockUtils.getProductVariations.mockImplementation(
				() => getProductVariationsPromise
			);
			mockBaseUtils.formatError.mockImplementation(
				() => formattedError
			);
			renderer = render();
		} );

		test( 'sets the error prop', async () => {
			await expect( () => getProductVariationsPromise() ).toThrow();

			const { formatError } = mockBaseUtils;
			const props = renderer.root.findByType( 'div' ).props;

			expect( formatError ).toHaveBeenCalledWith( error );
			expect( formatError ).toHaveBeenCalledTimes( 1 );
			expect( props.error ).toEqual( formattedError );
			expect( props.isLoading ).toBe( false );
			expect( props.variations ).toEqual( { 1: null } );
		} );
	} );
} );
woocommerce-blocks/assets/js/hocs/test/with-searched-products.js000064400000004073151335517650021134 0ustar00/**
 * External dependencies
 */
import TestRenderer, { act } from 'react-test-renderer';
import * as mockUtils from '@woocommerce/editor-components/utils';
import * as mockUseDebounce from 'use-debounce';

/**
 * Internal dependencies
 */
import withSearchedProducts from '../with-searched-products';

jest.mock( '@woocommerce/block-settings', () => ( {
	__esModule: true,
	blocksConfig: {
		productCount: 101,
	},
} ) );

// Mock the getProducts values for tests.
mockUtils.getProducts = jest.fn().mockImplementation( () =>
	Promise.resolve( [
		{ id: 10, name: 'foo', parent: 0 },
		{ id: 20, name: 'bar', parent: 0 },
	] )
);

// Add a mock implementation of debounce for testing so we can spy on the onSearch call.
mockUseDebounce.useDebouncedCallback = jest
	.fn()
	.mockImplementation( ( search ) => [
		() => mockUtils.getProducts( search ),
	] );

describe( 'withSearchedProducts Component', () => {
	const { getProducts } = mockUtils;
	afterEach( () => {
		mockUseDebounce.useDebouncedCallback.mockClear();
		mockUtils.getProducts.mockClear();
	} );
	const TestComponent = withSearchedProducts(
		( { selected, products, isLoading, onSearch } ) => {
			return (
				<div
					products={ products }
					selected={ selected }
					isLoading={ isLoading }
					onSearch={ onSearch }
				/>
			);
		}
	);
	describe( 'lifecycle tests', () => {
		const selected = [ 10 ];
		let props, renderer;

		act( () => {
			renderer = TestRenderer.create(
				<TestComponent selected={ selected } />
			);
		} );

		it( 'has expected values for props', () => {
			props = renderer.root.findByType( 'div' ).props;
			expect( props.selected ).toEqual( selected );
			expect( props.products ).toEqual( [
				{ id: 10, name: 'foo', parent: 0 },
				{ id: 20, name: 'bar', parent: 0 },
			] );
		} );

		it( 'debounce and getProducts is called on search event', async () => {
			props = renderer.root.findByType( 'div' ).props;

			act( () => {
				props.onSearch();
			} );

			expect( mockUseDebounce.useDebouncedCallback ).toHaveBeenCalled();
			expect( getProducts ).toHaveBeenCalledTimes( 1 );
		} );
	} );
} );
woocommerce-blocks/assets/js/hocs/with-store-cart-api-hydration.js000064400000005107151335517650021366 0ustar00/**
 * External dependencies
 */
import { useRef } from '@wordpress/element';
import { getSetting } from '@woocommerce/settings';
import { CART_STORE_KEY } from '@woocommerce/block-data';
import { useSelect, useDispatch } from '@wordpress/data';

/**
 * Internal dependencies
 */
import { LAST_CART_UPDATE_TIMESTAMP_KEY } from '../data/cart/constants';

/**
 * Hydrate Cart API data.
 *
 * Makes cart data available without an API request to wc/store/cart/.
 */
const useStoreCartApiHydration = () => {
	const preloadedApiRequests = useRef(
		getSetting( 'preloadedApiRequests', {} )
	);
	const { setIsCartDataStale } = useDispatch( CART_STORE_KEY );

	useSelect( ( select, registry ) => {
		const cartData = preloadedApiRequests.current[ '/wc/store/cart' ]?.body;

		if ( ! cartData ) {
			return;
		}

		const { isResolving, hasFinishedResolution, isCartDataStale } = select(
			CART_STORE_KEY
		);

		/**
		 * This should only execute once. When the code further down the file executes
		 * then the condition directly below this comment should never evaluate to true
		 * on subsequent executions. Because of this localStorage.getItem won't be
		 * called multiple times.
		 */
		if (
			! isCartDataStale() &&
			! isResolving( 'getCartData' ) &&
			! hasFinishedResolution( 'getCartData', [] )
		) {
			const lastCartUpdateRaw = window.localStorage.getItem(
				LAST_CART_UPDATE_TIMESTAMP_KEY
			);

			if ( lastCartUpdateRaw ) {
				const lastCartUpdate = parseFloat( lastCartUpdateRaw );
				const cartGeneratedTimestamp = parseFloat(
					cartData.generated_timestamp
				);

				const needsUpdateFromAPI =
					! isNaN( cartGeneratedTimestamp ) &&
					! isNaN( lastCartUpdate ) &&
					lastCartUpdate > cartGeneratedTimestamp;

				if ( needsUpdateFromAPI ) {
					setIsCartDataStale();
				}
			}
		}
		const {
			receiveCart,
			receiveError,
			startResolution,
			finishResolution,
		} = registry.dispatch( CART_STORE_KEY );

		if (
			! isCartDataStale() &&
			! isResolving( 'getCartData', [] ) &&
			! hasFinishedResolution( 'getCartData', [] )
		) {
			startResolution( 'getCartData', [] );
			if ( cartData?.code?.includes( 'error' ) ) {
				receiveError( cartData );
			} else {
				receiveCart( cartData );
			}
			finishResolution( 'getCartData', [] );
		}
	}, [] );
};

/**
 * HOC that calls the useStoreCartApiHydration hook.
 *
 * @param {Function} OriginalComponent Component being wrapped.
 */
const withStoreCartApiHydration = ( OriginalComponent ) => {
	return ( props ) => {
		useStoreCartApiHydration();
		return <OriginalComponent { ...props } />;
	};
};

export default withStoreCartApiHydration;
woocommerce-blocks/assets/js/hocs/with-rest-api-hydration.js000064400000002665151335517650020266 0ustar00/**
 * External dependencies
 */
import { useRef } from '@wordpress/element';
import { SCHEMA_STORE_KEY } from '@woocommerce/block-data';
import { useSelect } from '@wordpress/data';
import { blocksConfig } from '@woocommerce/block-settings';

/**
 * Hydrate Rest API data from settings to reduce the number of API requests needed.
 */
const useRestApiHydration = () => {
	const restApiRoutes = useRef( blocksConfig.restApiRoutes || {} );

	useSelect( ( select, registry ) => {
		if ( ! restApiRoutes.current ) {
			return;
		}

		const { isResolving, hasFinishedResolution } = select(
			SCHEMA_STORE_KEY
		);
		const {
			receiveRoutes,
			startResolution,
			finishResolution,
		} = registry.dispatch( SCHEMA_STORE_KEY );

		Object.keys( restApiRoutes.current ).forEach( ( namespace ) => {
			const routes = restApiRoutes.current[ namespace ];
			if (
				! isResolving( 'getRoutes', [ namespace ] ) &&
				! hasFinishedResolution( 'getRoutes', [ namespace ] )
			) {
				startResolution( 'getRoutes', [ namespace ] );
				receiveRoutes( routes, [ namespace ] );
				finishResolution( 'getRoutes', [ namespace ] );
			}
		} );
	}, [] );
};

/**
 * HOC that calls the useRestApiHydration hook.
 *
 * @param {Function} OriginalComponent Component being wrapped.
 */
const withRestApiHydration = ( OriginalComponent ) => {
	return ( props ) => {
		useRestApiHydration();
		return <OriginalComponent { ...props } />;
	};
};

export default withRestApiHydration;
woocommerce-blocks/assets/js/hocs/with-category.js000064400000003637151335517650016360 0ustar00/**
 * External dependencies
 */
import { Component } from '@wordpress/element';
import { createHigherOrderComponent } from '@wordpress/compose';
import { getCategory } from '@woocommerce/editor-components/utils';

/**
 * Internal dependencies
 */
import { formatError } from '../base/utils/errors.js';

/**
 * HOC that queries a category for a component.
 *
 * @param {Function} OriginalComponent Component being wrapped.
 */
const withCategory = createHigherOrderComponent( ( OriginalComponent ) => {
	return class WrappedComponent extends Component {
		constructor() {
			super( ...arguments );
			this.state = {
				error: null,
				loading: false,
				category:
					this.props.attributes.categoryId === 'preview'
						? this.props.attributes.previewCategory
						: null,
			};
			this.loadCategory = this.loadCategory.bind( this );
		}

		componentDidMount() {
			this.loadCategory();
		}

		componentDidUpdate( prevProps ) {
			if (
				prevProps.attributes.categoryId !==
				this.props.attributes.categoryId
			) {
				this.loadCategory();
			}
		}

		loadCategory() {
			const { categoryId } = this.props.attributes;

			if ( categoryId === 'preview' ) {
				return;
			}

			if ( ! categoryId ) {
				this.setState( {
					category: null,
					loading: false,
					error: null,
				} );
				return;
			}

			this.setState( { loading: true } );

			getCategory( categoryId )
				.then( ( category ) => {
					this.setState( { category, loading: false, error: null } );
				} )
				.catch( async ( e ) => {
					const error = await formatError( e );

					this.setState( { category: null, loading: false, error } );
				} );
		}

		render() {
			const { error, loading, category } = this.state;

			return (
				<OriginalComponent
					{ ...this.props }
					error={ error }
					getCategory={ this.loadCategory }
					isLoading={ loading }
					category={ category }
				/>
			);
		}
	};
}, 'withCategory' );

export default withCategory;
woocommerce-blocks/assets/js/hocs/with-transform-single-select-to-multiple-select.js000064400000002016151335517650025026 0ustar00/**
 * External dependencies
 */
import { Component } from '@wordpress/element';
import { createHigherOrderComponent } from '@wordpress/compose';
import PropTypes from 'prop-types';

/**
 * HOC that transforms a single select to a multiple select.
 *
 * @param {Function} OriginalComponent Component being wrapped.
 */
const withTransformSingleSelectToMultipleSelect = createHigherOrderComponent(
	( OriginalComponent ) => {
		class WrappedComponent extends Component {
			render() {
				const { selected } = this.props;
				const isNil = selected === null || selected === undefined;
				return (
					<OriginalComponent
						{ ...this.props }
						selected={ isNil ? [] : [ selected ] }
					/>
				);
			}
		}
		WrappedComponent.propTypes = {
			selected: PropTypes.oneOfType( [
				PropTypes.number,
				PropTypes.string,
			] ),
		};
		WrappedComponent.defaultProps = {
			selected: null,
		};
		return WrappedComponent;
	},
	'withTransformSingleSelectToMultipleSelect'
);

export default withTransformSingleSelectToMultipleSelect;
woocommerce-blocks/assets/js/hocs/index.js000064400000001253151335517650014671 0ustar00export { default as withAttributes } from './with-attributes';
export { default as withCategories } from './with-categories';
export { default as withCategory } from './with-category';
export { default as withProduct } from './with-product';
export { default as withProductVariations } from './with-product-variations';
export { default as withSearchedProducts } from './with-searched-products';
export { default as withTransformSingleSelectToMultipleSelect } from './with-transform-single-select-to-multiple-select';
export { default as withStoreCartApiHydration } from './with-store-cart-api-hydration';
export { default as withRestApiHydration } from './with-rest-api-hydration';
woocommerce-blocks/assets/js/hocs/with-attributes.js000064400000006137151335517650016727 0ustar00/**
 * External dependencies
 */
import { useState, useEffect } from '@wordpress/element';
import { getAttributes, getTerms } from '@woocommerce/editor-components/utils';

/**
 * Internal dependencies
 */
import { formatError } from '../base/utils/errors.js';

/**
 * Get attribute data (name, taxonomy etc) from server data.
 *
 * @param {number} attributeId Attribute ID to look for.
 * @param {Array|null} attributeList List of attributes.
 * @param {string} matchField Field to match on. e.g. id or slug.
 */
const getAttributeData = ( attributeId, attributeList, matchField = 'id' ) => {
	return Array.isArray( attributeList )
		? attributeList.find( ( attr ) => attr[ matchField ] === attributeId )
		: null;
};

/**
 * HOC that calls the useAttributes hook.
 *
 * @param {Function} OriginalComponent Component being wrapped.
 */
const withAttributes = ( OriginalComponent ) => {
	return ( props ) => {
		const { selected = [] } = props;
		const selectedSlug = selected.length ? selected[ 0 ].attr_slug : null;
		const [ attributes, setAttributes ] = useState( null );
		const [ expandedAttribute, setExpandedAttribute ] = useState( 0 );
		const [ termsList, setTermsList ] = useState( {} );
		const [ loading, setLoading ] = useState( true );
		const [ termsLoading, setTermsLoading ] = useState( false );
		const [ error, setError ] = useState( null );

		useEffect( () => {
			if ( attributes === null ) {
				getAttributes()
					.then( ( newAttributes ) => {
						newAttributes = newAttributes.map( ( attribute ) => ( {
							...attribute,
							parent: 0,
						} ) );

						setAttributes( newAttributes );

						if ( selectedSlug ) {
							const selectedAttributeFromTerm = getAttributeData(
								selectedSlug,
								newAttributes,
								'taxonomy'
							);

							if ( selectedAttributeFromTerm ) {
								setExpandedAttribute(
									selectedAttributeFromTerm.id
								);
							}
						}
					} )
					.catch( async ( e ) => {
						setError( await formatError( e ) );
					} )
					.finally( () => {
						setLoading( false );
					} );
			}
		}, [ attributes, selectedSlug ] );

		useEffect( () => {
			const attributeData = getAttributeData(
				expandedAttribute,
				attributes
			);

			if ( ! attributeData ) {
				return;
			}

			setTermsLoading( true );

			getTerms( expandedAttribute )
				.then( ( newTerms ) => {
					newTerms = newTerms.map( ( term ) => ( {
						...term,
						parent: expandedAttribute,
						attr_slug: attributeData.taxonomy,
					} ) );

					setTermsList( ( previousTermsList ) => ( {
						...previousTermsList,
						[ expandedAttribute ]: newTerms,
					} ) );
				} )
				.catch( async ( e ) => {
					setError( await formatError( e ) );
				} )
				.finally( () => {
					setTermsLoading( false );
				} );
		}, [ expandedAttribute, attributes ] );

		return (
			<OriginalComponent
				{ ...props }
				attributes={ attributes || [] }
				error={ error }
				expandedAttribute={ expandedAttribute }
				onExpandAttribute={ setExpandedAttribute }
				isLoading={ loading }
				termsAreLoading={ termsLoading }
				termsList={ termsList }
			/>
		);
	};
};

export default withAttributes;
woocommerce-blocks/assets/js/middleware/index.js000064400000000125151335517650016047 0ustar00/**
 * Internal dependencies
 */
import './store-api-nonce';
import './cart-update';
woocommerce-blocks/assets/js/middleware/cart-update.ts000064400000003340151335517650017165 0ustar00/**
 * External dependencies
 */
import apiFetch, { APIFetchOptions } from '@wordpress/api-fetch';

/**
 * Internal dependencies
 */
import { LAST_CART_UPDATE_TIMESTAMP_KEY } from '../data/cart/constants';

/**
 * Checks if this request is a POST to the wc/store/cart endpoint.
 */
const isCartUpdatePostRequest = ( options: APIFetchOptions ) => {
	const url = options.url || options.path || '';
	const method = options.method || 'GET';

	// Return false if there is no endpoint provided, or the request is not a POST request.
	if ( ! url || method !== 'POST' ) {
		return false;
	}

	const cartRegExp = /wc\/store\/cart\//;
	const batchRegExp = /wc\/store\/batch/;

	const isCart = cartRegExp.exec( url ) !== null;
	const isBatch = batchRegExp.exec( url ) !== null;

	if ( isCart ) {
		return true;
	}

	if ( isBatch ) {
		const requests = options?.data?.requests || [];

		return requests.some( ( request: { path: string } ) => {
			const requestUrl = request.path || '';

			return cartRegExp.exec( requestUrl ) !== null;
		} );
	}

	return false;
};

/**
 * Middleware which saves the time that the cart was last modified in
 * the browser's Local Storage
 *
 * @param {Object}   options Fetch options.
 * @param {Function} next    The next middleware or fetchHandler to call.
 *
 * @return {*} The evaluated result of the remaining middleware chain.
 */
const cartUpdateMiddleware = (
	options: APIFetchOptions,
	/* eslint-disable @typescript-eslint/no-explicit-any */
	next: ( arg0: APIFetchOptions, arg1: any ) => any
) => {
	if ( isCartUpdatePostRequest( options ) ) {
		window.localStorage.setItem(
			LAST_CART_UPDATE_TIMESTAMP_KEY,
			( Date.now() / 1000 ).toString()
		);
	}
	return next( options, next );
};

apiFetch.use( cartUpdateMiddleware );
woocommerce-blocks/assets/js/middleware/store-api-nonce.js000064400000006452151335517650017754 0ustar00/**
 * External dependencies
 */
import apiFetch from '@wordpress/api-fetch';

// Stores the current nonce for the middleware.
let currentNonce = '';
let currentTimestamp = 0;

try {
	const storedNonceValue = window.localStorage.getItem( 'storeApiNonce' );
	const storedNonce = storedNonceValue ? JSON.parse( storedNonceValue ) : {};
	currentNonce = storedNonce?.nonce || '';
	currentTimestamp = storedNonce?.timestamp || 0;
} catch {
	// We can ignore an error from JSON parse.
}

/**
 * Returns whether or not this is a wc/store API request.
 *
 * @param {Object} options Fetch options.
 *
 * @return {boolean} Returns true if this is a store request.
 */
const isStoreApiRequest = ( options ) => {
	const url = options.url || options.path;
	if ( ! url || ! options.method || options.method === 'GET' ) {
		return false;
	}
	return /wc\/store\//.exec( url ) !== null;
};

/**
 * Set the current nonce from a header object.
 *
 * @param {Object} headers Headers object.
 */
const setNonce = ( headers ) => {
	const nonce =
		typeof headers?.get === 'function'
			? headers.get( 'X-WC-Store-API-Nonce' )
			: headers[ 'X-WC-Store-API-Nonce' ];
	const timestamp =
		typeof headers?.get === 'function'
			? headers.get( 'X-WC-Store-API-Nonce-Timestamp' )
			: headers[ 'X-WC-Store-API-Nonce-Timestamp' ];

	if ( nonce ) {
		updateNonce( nonce, timestamp );
	}
};

/**
 * Updates the stored nonce within localStorage so it is persisted between page loads.
 *
 * @param {string} nonce Incoming nonce string.
 * @param {number} timestamp Timestamp from server of nonce.
 */
const updateNonce = ( nonce, timestamp ) => {
	// If the "new" nonce matches the current nonce, we don't need to update.
	if ( nonce === currentNonce ) {
		return;
	}

	// Only update the nonce if newer. It might be coming from cache.
	if ( currentTimestamp && timestamp < currentTimestamp ) {
		return;
	}

	currentNonce = nonce;
	currentTimestamp = timestamp || Date.now() / 1000; // Convert ms to seconds to match php time()

	// Update the persisted values.
	window.localStorage.setItem(
		'storeApiNonce',
		JSON.stringify( {
			nonce: currentNonce,
			timestamp: currentTimestamp,
		} )
	);
};

const appendNonceHeader = ( request ) => {
	const headers = request.headers || {};
	request.headers = {
		...headers,
		'X-WC-Store-API-Nonce': currentNonce,
	};
	return request;
};

/**
 * Nonce middleware which appends the current nonce to store API requests.
 *
 * @param {Object}   options Fetch options.
 * @param {Function} next    The next middleware or fetchHandler to call.
 * @return {*} The evaluated result of the remaining middleware chain.
 */
const storeNonceMiddleware = ( options, next ) => {
	if ( isStoreApiRequest( options ) ) {
		options = appendNonceHeader( options );

		// Add nonce to sub-requests
		if ( Array.isArray( options?.data?.requests ) ) {
			options.data.requests = options.data.requests.map(
				appendNonceHeader
			);
		}
	}
	return next( options, next );
};

apiFetch.use( storeNonceMiddleware );
apiFetch.setNonce = setNonce;

updateNonce(
	// @ts-ignore wcBlocksMiddlewareConfig is window global cache for the initial nonce initialized from hydration.
	wcBlocksMiddlewareConfig.storeApiNonce,
	// @ts-ignore wcBlocksMiddlewareConfig is window global cache for the initial nonce initialized from hydration.
	wcBlocksMiddlewareConfig.storeApiNonceTimestamp
);
woocommerce-blocks/assets/js/global.d.ts000064400000000123151335517650014315 0ustar00// eslint-disable-next-line camelcase
declare let __webpack_public_path__: string;
woocommerce-blocks/assets/js/settings/blocks/feature-flags.ts000064400000003200151335517650020474 0ustar00/**
 * External dependencies
 */
import {
	registerBlockType,
	Block,
	BlockConfiguration,
} from '@wordpress/blocks';

/**
 * Internal dependencies
 */
import { WC_BLOCKS_PHASE } from './constants';

/**
 * Registers a new experimental block provided a unique name and an object defining its
 * behavior. Once registered, the block is made available as an option to any
 * editor interface where blocks are implemented.
 */
export const registerExperimentalBlockType = (
	blockNameOrMetadata: string | BlockConfiguration,
	settings: Record< string, unknown >
): Block | undefined => {
	if ( WC_BLOCKS_PHASE > 2 ) {
		return registerBlockType( blockNameOrMetadata, settings );
	}
};

/**
 * Registers a new feature plugin block provided a unique name and an object
 * defining its behavior. Once registered, the block is made available as an
 * option to any editor interface where blocks are implemented.
 */
export const registerFeaturePluginBlockType = (
	blockNameOrMetadata: string | BlockConfiguration,
	settings: Record< string, unknown >
): Block | undefined => {
	if ( WC_BLOCKS_PHASE > 1 ) {
		return registerBlockType( blockNameOrMetadata, settings );
	}
};

/**
 * Checks if we're executing the code in an experimental build mode.
 *
 * @return {boolean} True if this is an experimental build, false otherwise.
 */
export const isExperimentalBuild = (): boolean => WC_BLOCKS_PHASE > 2;

/**
 * Checks if we're executing the code in an feature plugin or experimental build mode.
 *
 * @return {boolean} True if this is an experimental or feature plugin build, false otherwise.
 */
export const isFeaturePluginBuild = (): boolean => WC_BLOCKS_PHASE > 1;
woocommerce-blocks/assets/js/settings/blocks/constants.ts000064400000003467151335517650020002 0ustar00/**
 * External dependencies
 */
import { getSetting, STORE_PAGES } from '@woocommerce/settings';

export type WordCountType =
	| 'words'
	| 'characters_excluding_spaces'
	| 'characters_including_spaces';

interface WcBlocksConfig {
	buildPhase: number;
	pluginUrl: string;
	productCount: number;
	defaultAvatar: string;
	restApiRoutes: Record< string, string[] >;
	wordCountType: WordCountType;
}

export const blocksConfig = getSetting( 'wcBlocksConfig', {
	buildPhase: 1,
	pluginUrl: '',
	productCount: 0,
	defaultAvatar: '',
	restApiRoutes: {},
	wordCountType: 'words',
} ) as WcBlocksConfig;

export const WC_BLOCKS_IMAGE_URL = blocksConfig.pluginUrl + 'images/';
export const WC_BLOCKS_BUILD_URL = blocksConfig.pluginUrl + 'build/';
export const WC_BLOCKS_PHASE = blocksConfig.buildPhase;
export const SHOP_URL = STORE_PAGES.shop?.permalink;
export const CHECKOUT_PAGE_ID = STORE_PAGES.checkout.id;
export const CHECKOUT_URL = STORE_PAGES.checkout.permalink;
export const PRIVACY_URL = STORE_PAGES.privacy.permalink;
export const PRIVACY_PAGE_NAME = STORE_PAGES.privacy.title;
export const TERMS_URL = STORE_PAGES.terms.permalink;
export const TERMS_PAGE_NAME = STORE_PAGES.terms.title;
export const CART_PAGE_ID = STORE_PAGES.cart.id;
export const CART_URL = STORE_PAGES.cart.permalink;
export const LOGIN_URL = STORE_PAGES.myaccount.permalink
	? STORE_PAGES.myaccount.permalink
	: getSetting( 'wpLoginUrl', '/wp-login.php' );
export const SHIPPING_COUNTRIES = getSetting< Record< string, string > >(
	'shippingCountries',
	{}
);
export const ALLOWED_COUNTRIES = getSetting< Record< string, string > >(
	'allowedCountries',
	{}
);
export const SHIPPING_STATES = getSetting<
	Record< string, Record< string, string > >
>( 'shippingStates', {} );
export const ALLOWED_STATES = getSetting< Record< string, string > >(
	'allowedStates',
	{}
);
woocommerce-blocks/assets/js/settings/blocks/index.ts000064400000000137151335517650017064 0ustar00/**
 * Internal dependencies
 */
export * from './constants';
export * from './feature-flags';
woocommerce-blocks/assets/js/settings/shared/utils.ts000064400000005423151335517650017111 0ustar00/**
 * External dependencies
 */
import compareVersions from 'compare-versions';

/**
 * Internal dependencies
 */
import { allSettings } from './settings-init';

/**
 * Retrieves a setting value from the setting state.
 *
 * If a setting with key `name` does not exist or is undefined,
 * the `fallback` will be returned instead. An optional `filter`
 * callback can be passed to format the returned value.
 */
export const getSetting = < T >(
	name: string,
	fallback: unknown = false,
	filter = ( val: unknown, fb: unknown ) =>
		typeof val !== 'undefined' ? val : fb
): T => {
	const value = name in allSettings ? allSettings[ name ] : fallback;
	return filter( value, fallback ) as T;
};

/**
 * Note: this attempts to coerce the wpVersion to a semver for comparison
 * This will result in dropping any beta/rc values.
 *
 * `5.3-beta1-4252` would get converted to `5.3.0-rc.4252`
 * `5.3-beta1` would get converted to `5.3.0-rc`.
 * `5.3` would not be touched.
 *
 * For the purpose of these comparisons all pre-release versions are normalized
 * to `rc`.
 *
 * @param {string} setting Setting name (e.g. wpVersion or wcVersion).
 * @param {string} version Version to compare.
 * @param {compareVersions.CompareOperator} operator Comparison operator.
 */
const compareVersionSettingIgnorePrerelease = (
	setting: string,
	version: string,
	operator: compareVersions.CompareOperator
): boolean => {
	const settingValue = getSetting( setting, '' ) as string;
	let replacement = settingValue.replace( /-[a-zA-Z0-9]*[\-]*/, '.0-rc.' );
	replacement = replacement.endsWith( '.' )
		? replacement.substring( 0, replacement.length - 1 )
		: replacement;
	return compareVersions.compare( replacement, version, operator );
};

/**
 * Compare the current WP version with the provided `version` param using the
 * `operator`.
 *
 * For example `isWpVersion( '5.6', '<=' )` returns true if the site WP version
 * is smaller or equal than `5.6` .
 */
export const isWpVersion = (
	version: string,
	operator: compareVersions.CompareOperator = '='
): boolean => {
	return compareVersionSettingIgnorePrerelease(
		'wpVersion',
		version,
		operator
	);
};

/**
 * Compare the current WC version with the provided `version` param using the
 * `operator`.
 *
 * For example `isWcVersion( '4.9.0', '<=' )` returns true if the site WC version
 * is smaller or equal than `4.9`.
 */
export const isWcVersion = (
	version: string,
	operator: compareVersions.CompareOperator = '='
): boolean => {
	return compareVersionSettingIgnorePrerelease(
		'wcVersion',
		version,
		operator
	);
};

/**
 * Returns a string with the site's wp-admin URL appended. JS version of `admin_url`.
 *
 * @param {string} path Relative path.
 * @return {string} Full admin URL.
 */
export const getAdminLink = ( path: string ): string =>
	getSetting( 'adminUrl' ) + path;
woocommerce-blocks/assets/js/settings/shared/default-constants.ts000064400000001660151335517650021406 0ustar00/**
 * Internal dependencies
 */
import { allSettings } from './settings-init';

/**
 * This exports all default core settings as constants.
 */
export const ADMIN_URL = allSettings.adminUrl;
export const COUNTRIES = allSettings.countries;
export const CURRENCY = allSettings.currency;
export const CURRENT_USER_IS_ADMIN = allSettings.currentUserIsAdmin;
export const HOME_URL = allSettings.homeUrl;
export const LOCALE = allSettings.locale;
export const ORDER_STATUSES = allSettings.orderStatuses;
export const PLACEHOLDER_IMG_SRC = allSettings.placeholderImgSrc as string;
export const SITE_TITLE = allSettings.siteTitle;
export const STORE_PAGES = allSettings.storePages as Record<
	string,
	{
		id: 0;
		title: '';
		permalink: '';
	}
>;
export const WC_ASSET_URL = allSettings.wcAssetUrl;
export const WC_VERSION = allSettings.wcVersion;
export const WP_LOGIN_URL = allSettings.wpLoginUrl;
export const WP_VERSION = allSettings.wpVersion;
woocommerce-blocks/assets/js/settings/shared/index.ts000064400000000306151335517650017053 0ustar00/**
 * Internal dependencies
 */
import '../../filters/exclude-draft-status-from-analytics';

export * from './default-constants';
export * from './default-address-fields';
export * from './utils';
woocommerce-blocks/assets/js/settings/shared/test/compare-with-wp-version.js000064400000001521151335517650023417 0ustar00/**
 * Internal dependencies
 */
import { isWpVersion } from '..';
import { allSettings } from '../settings-init';

describe( 'isWpVersion', () => {
	it.each`
		version               | operator | result
		${ '5.3-beta1' }      | ${ '<' } | ${ true }
		${ '5.3' }            | ${ '=' } | ${ true }
		${ '5.3-beta12-235' } | ${ '<' } | ${ true }
		${ '5.3-rc1' }        | ${ '>' } | ${ false }
		${ '5.3-rc12-235' }   | ${ '<' } | ${ true }
		${ '5.3.1' }          | ${ '>' } | ${ true }
		${ '5.4-beta1' }      | ${ '>' } | ${ true }
	`(
		'should return $result when $version is the current wpVersion ' +
			'and `5.3` is the version compared using `$operator`',
		( { version, operator, result } ) => {
			// eslint-disable-next-line
			allSettings[ 'wpVersion' ] = version;
			expect( isWpVersion( '5.3', operator ) ).toBe( result );
		}
	);
} );
woocommerce-blocks/assets/js/settings/shared/test/get-setting.js000064400000001343151335517650021145 0ustar00/**
 * Internal dependencies
 */
import { getSetting } from '../utils';
import { ADMIN_URL } from '../default-constants';

describe( 'getSetting', () => {
	it( 'returns provided default for non available setting', () => {
		expect( getSetting( 'nada', 'really nada' ) ).toBe( 'really nada' );
	} );
	it( 'returns expected value for existing setting', () => {
		expect( getSetting( 'adminUrl', 'not this' ) ).toEqual( ADMIN_URL );
	} );
	it( "returns expected value for existing setting even if it's a falsy value", () => {
		expect( getSetting( 'currentUserIsAdmin', true ) ).toBe( false );
	} );
	it( 'filters value via provided filter callback', () => {
		expect( getSetting( 'some value', 'default', () => 42 ) ).toBe( 42 );
	} );
} );
woocommerce-blocks/assets/js/settings/shared/default-address-fields.ts000064400000010025151335517650022256 0ustar00/**
 * External dependencies
 */
import { __ } from '@wordpress/i18n';

export interface AddressField {
	// The label for the field.
	label: string;
	// The label for the field if made optional.
	optionalLabel: string;
	// The HTML autocomplete attribute value. See https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete
	autocomplete: string;
	// How this field value is capitalized.
	autocapitalize?: string;
	// Set to true if the field is required.
	required: boolean;
	// Set to true if the field should not be rendered.
	hidden: boolean;
	// Fields will be sorted and render in this order, lowest to highest.
	index: number;
}

export interface LocaleSpecificAddressField extends AddressField {
	priority: number;
}

export interface AddressFields {
	first_name: AddressField;
	last_name: AddressField;
	company: AddressField;
	address_1: AddressField;
	address_2: AddressField;
	country: AddressField;
	city: AddressField;
	state: AddressField;
	postcode: AddressField;
}

export type AddressType = 'billing' | 'shipping';
export interface EnteredAddress {
	first_name: string;
	last_name: string;
	company: string;
	address_1: string;
	address_2: string;
	country: string;
	city: string;
	state: string;
	postcode: string;
}

export type KeyedAddressField = AddressField & {
	key: keyof AddressFields;
	errorMessage?: string;
};
export type ShippingAddress = EnteredAddress;
export type BillingAddress = EnteredAddress;
export type CountryAddressFields = Record< string, AddressFields >;

/**
 * Default address field properties.
 */
export const defaultAddressFields: AddressFields = {
	first_name: {
		label: __( 'First name', 'woo-gutenberg-products-block' ),
		optionalLabel: __(
			'First name (optional)',
			'woo-gutenberg-products-block'
		),
		autocomplete: 'given-name',
		autocapitalize: 'sentences',
		required: true,
		hidden: false,
		index: 10,
	},
	last_name: {
		label: __( 'Last name', 'woo-gutenberg-products-block' ),
		optionalLabel: __(
			'Last name (optional)',
			'woo-gutenberg-products-block'
		),
		autocomplete: 'family-name',
		autocapitalize: 'sentences',
		required: true,
		hidden: false,
		index: 20,
	},
	company: {
		label: __( 'Company', 'woo-gutenberg-products-block' ),
		optionalLabel: __(
			'Company (optional)',
			'woo-gutenberg-products-block'
		),
		autocomplete: 'organization',
		autocapitalize: 'sentences',
		required: false,
		hidden: false,
		index: 30,
	},
	address_1: {
		label: __( 'Address', 'woo-gutenberg-products-block' ),
		optionalLabel: __(
			'Address (optional)',
			'woo-gutenberg-products-block'
		),
		autocomplete: 'address-line1',
		autocapitalize: 'sentences',
		required: true,
		hidden: false,
		index: 40,
	},
	address_2: {
		label: __( 'Apartment, suite, etc.', 'woo-gutenberg-products-block' ),
		optionalLabel: __(
			'Apartment, suite, etc. (optional)',
			'woo-gutenberg-products-block'
		),
		autocomplete: 'address-line2',
		autocapitalize: 'sentences',
		required: false,
		hidden: false,
		index: 50,
	},
	country: {
		label: __( 'Country/Region', 'woo-gutenberg-products-block' ),
		optionalLabel: __(
			'Country/Region (optional)',
			'woo-gutenberg-products-block'
		),
		autocomplete: 'country',
		required: true,
		hidden: false,
		index: 60,
	},
	city: {
		label: __( 'City', 'woo-gutenberg-products-block' ),
		optionalLabel: __( 'City (optional)', 'woo-gutenberg-products-block' ),
		autocomplete: 'address-level2',
		autocapitalize: 'sentences',
		required: true,
		hidden: false,
		index: 70,
	},
	state: {
		label: __( 'State/County', 'woo-gutenberg-products-block' ),
		optionalLabel: __(
			'State/County (optional)',
			'woo-gutenberg-products-block'
		),
		autocomplete: 'address-level1',
		autocapitalize: 'sentences',
		required: true,
		hidden: false,
		index: 80,
	},
	postcode: {
		label: __( 'Postal code', 'woo-gutenberg-products-block' ),
		optionalLabel: __(
			'Postal code (optional)',
			'woo-gutenberg-products-block'
		),
		autocomplete: 'postal-code',
		autocapitalize: 'characters',
		required: true,
		hidden: false,
		index: 90,
	},
};

export default defaultAddressFields;
woocommerce-blocks/assets/js/settings/shared/settings-init.ts000064400000004712151335517650020552 0ustar00/**
 * External dependencies
 */
import { SymbolPosition } from '@woocommerce/type-defs/currency';

declare global {
	interface Window {
		wcSettings: Record< string, unknown >;
	}
}

export interface WooCommerceSiteCurrency {
	// The ISO code for the currency.
	code: string;
	// The precision (decimal places).
	precision: number;
	// The symbol for the currency (eg '$')
	symbol: string;
	// The position for the symbol ('left', or 'right')
	symbolPosition: SymbolPosition;
	// The string used for the decimal separator.
	decimalSeparator: string;
	// The string used for the thousands separator.
	thousandSeparator: string;
	// The format string use for displaying an amount in this currency.
	priceFormat: string;
}

export interface WooCommerceSiteLocale {
	// The locale string for the current site.
	siteLocale: string;
	// The locale string for the current user.
	userLocale: string;
	// An array of short weekday strings in the current user's locale.
	weekdaysShort: string[];
}

export interface WooCommerceSharedSettings {
	adminUrl: string;
	countries: Record< string, string > | never[];
	currency: WooCommerceSiteCurrency;
	currentUserIsAdmin: boolean;
	homeUrl: string;
	locale: WooCommerceSiteLocale;
	orderStatuses: Record< string, string > | never[];
	placeholderImgSrc: string;
	siteTitle: string;
	storePages: Record< string, string > | never[];
	wcAssetUrl: string;
	wcVersion: string;
	wpLoginUrl: string;
	wpVersion: string;
}

const defaults: WooCommerceSharedSettings = {
	adminUrl: '',
	countries: [],
	currency: {
		code: 'USD',
		precision: 2,
		symbol: '$',
		symbolPosition: 'left',
		decimalSeparator: '.',
		priceFormat: '%1$s%2$s',
		thousandSeparator: ',',
	},
	currentUserIsAdmin: false,
	homeUrl: '',
	locale: {
		siteLocale: 'en_US',
		userLocale: 'en_US',
		weekdaysShort: [ 'Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat' ],
	},
	orderStatuses: [],
	placeholderImgSrc: '',
	siteTitle: '',
	storePages: [],
	wcAssetUrl: '',
	wcVersion: '',
	wpLoginUrl: '',
	wpVersion: '',
};

const globalSharedSettings =
	typeof window.wcSettings === 'object' ? window.wcSettings : {};

// Use defaults or global settings, depending on what is set.
const allSettings: Record< string, unknown > = {
	...defaults,
	...globalSharedSettings,
};

allSettings.currency = {
	...defaults.currency,
	...( allSettings.currency as Record< string, unknown > ),
};

allSettings.locale = {
	...defaults.locale,
	...( allSettings.locale as Record< string, unknown > ),
};

export { allSettings };
woocommerce-blocks/assets/js/blocks-registry/index.js000064400000000107151335517650017055 0ustar00export * from './payment-methods';
export * from './block-components';
woocommerce-blocks/assets/js/blocks-registry/block-components/get-registered-block-components.js000064400000003201151335517650027406 0ustar00/**
 * External dependencies
 */
import deprecated from '@wordpress/deprecated';

/**
 * Internal dependencies
 */
import { registeredBlockComponents } from './registered-block-components-init';

/**
 * Get all Registered Block Components.
 *
 * WooCommerce Blocks allows React Components to be used on the frontend of the store in place of
 * Blocks instead of just serving static content.
 *
 * This gets all registered Block Components so we know which Blocks map to which React Components.
 *
 * @param {string} context Current context (a named parent Block). If Block Components were only
 *                         registered under a certain context, those Components will be returned,
 *                         as well as any Components registered under all contexts.
 * @return {Object} List of React Components registered under the provided context.
 */
export function getRegisteredBlockComponents( context ) {
	const parentInnerBlocks =
		typeof registeredBlockComponents[ context ] === 'object' &&
		Object.keys( registeredBlockComponents[ context ] ).length > 0
			? registeredBlockComponents[ context ]
			: {};

	return {
		...parentInnerBlocks,
		...registeredBlockComponents.any,
	};
}

/**
 * Alias of getRegisteredBlockComponents kept for backwards compatibility.
 *
 * @param {string} main Name of the parent block to retrieve children of.
 * @return {Object} List of registered inner blocks.
 */
export function getRegisteredInnerBlocks( main ) {
	deprecated( 'getRegisteredInnerBlocks', {
		version: '2.8.0',
		alternative: 'getRegisteredBlockComponents',
		plugin: 'WooCommerce Blocks',
	} );
	return getRegisteredBlockComponents( main );
}
woocommerce-blocks/assets/js/blocks-registry/block-components/index.js000064400000000137151335517650022335 0ustar00export * from './get-registered-block-components';
export * from './register-block-component';
woocommerce-blocks/assets/js/blocks-registry/block-components/registered-block-components-init.js000064400000000115151335517650027573 0ustar00const registeredBlockComponents = {};

export { registeredBlockComponents };
woocommerce-blocks/assets/js/blocks-registry/block-components/register-block-component.js000064400000007600151335517650026144 0ustar00/**
 * External dependencies
 */
import deprecated from '@wordpress/deprecated';

/**
 * Internal dependencies
 */
import { registeredBlockComponents } from './registered-block-components-init';

/**
 * Register a Block Component.
 *
 * WooCommerce Blocks allows React Components to be used on the frontend of the store in place of
 * Blocks instead of just serving static content.
 *
 * Registering a Block Component allows you to define which React Component should be used in place
 * of a registered Block. The Component, when rendered, will be passed all Block Attributes.
 *
 * @param {Object}   options           Options to use when registering the block.
 * @param {Function} options.component React component that will be rendered, or the return value from  React.lazy if
 *                                     dynamically imported.
 * @param {string}   options.blockName Name of the block that this component belongs to.
 * @param {string}   [options.context] To make this component available only under a certain context
 *                                     (named parent Block) define it here. If left blank, the
 *                                     Component will be available for all contexts.
 */
export function registerBlockComponent( options ) {
	if ( ! options.context ) {
		options.context = 'any';
	}
	assertOption( options, 'context', 'string' );
	assertOption( options, 'blockName', 'string' );
	assertBlockComponent( options, 'component' );

	const { context, blockName, component } = options;

	if ( ! registeredBlockComponents[ context ] ) {
		registeredBlockComponents[ context ] = {};
	}

	registeredBlockComponents[ context ][ blockName ] = component;
}

/**
 * Asserts that an option is a valid react element or lazy callback. Otherwise, throws an error.
 *
 * @throws Will throw an error if the type of the option doesn't match the expected type.
 * @param {Object} options      Object containing the option to validate.
 * @param {string} optionName   Name of the option to validate.
 */
const assertBlockComponent = ( options, optionName ) => {
	if ( options[ optionName ] ) {
		if ( typeof options[ optionName ] === 'function' ) {
			return;
		}
		if (
			options[ optionName ].$$typeof &&
			options[ optionName ].$$typeof === Symbol.for( 'react.lazy' )
		) {
			return;
		}
	}
	throw new Error(
		`Incorrect value for the ${ optionName } argument when registering a block component. Component must be a valid React Element or Lazy callback.`
	);
};

/**
 * Asserts that an option is of the given type. Otherwise, throws an error.
 *
 * @throws Will throw an error if the type of the option doesn't match the expected type.
 * @param {Object} options      Object containing the option to validate.
 * @param {string} optionName   Name of the option to validate.
 * @param {string} expectedType Type expected for the option.
 */
const assertOption = ( options, optionName, expectedType ) => {
	const actualType = typeof options[ optionName ];
	if ( actualType !== expectedType ) {
		throw new Error(
			`Incorrect value for the ${ optionName } argument when registering a block component. It was a ${ actualType }, but must be a ${ expectedType }.`
		);
	}
};

/**
 * Alias of registerBlockComponent kept for backwards compatibility.
 *
 * @param {Object}   options           Options to use when registering the block.
 * @param {string}   options.main      Name of the parent block.
 * @param {string}   options.blockName Name of the child block being registered.
 * @param {Function} options.component React component used to render the child block.
 */
export function registerInnerBlock( options ) {
	deprecated( 'registerInnerBlock', {
		version: '2.8.0',
		alternative: 'registerBlockComponent',
		plugin: 'WooCommerce Blocks',
		hint: '"main" has been replaced with "context" and is now optional.',
	} );
	assertOption( options, 'main', 'string' );
	registerBlockComponent( {
		...options,
		context: options.main,
	} );
}
woocommerce-blocks/assets/js/blocks-registry/block-components/test/index.js000064400000005127151335517650023320 0ustar00/**
 * Internal dependencies
 */
import {
	getRegisteredBlockComponents,
	registerBlockComponent,
	registerInnerBlock,
	getRegisteredInnerBlocks,
} from '../index';

describe( 'blocks registry', () => {
	const context = '@woocommerce/all-products';
	const blockName = '@woocommerce-extension/price-level';
	const component = () => {
		return null;
	};

	describe( 'registerBlockComponent', () => {
		const invokeTest = ( args ) => () => {
			return registerBlockComponent( args );
		};
		it( 'throws an error when registered block is missing `blockName`', () => {
			expect( invokeTest( { context, blockName: null } ) ).toThrowError(
				/blockName/
			);
		} );
		it( 'throws an error when registered block is missing `component`', () => {
			expect(
				invokeTest( { context, blockName, component: null } )
			).toThrowError( /component/ );
		} );
	} );

	describe( 'getRegisteredBlockComponents', () => {
		it( 'gets an empty object when context has no inner blocks', () => {
			expect(
				getRegisteredBlockComponents( '@woocommerce/all-products' )
			).toEqual( {} );
		} );
		it( 'gets a block that was successfully registered', () => {
			registerBlockComponent( { context, blockName, component } );
			expect(
				getRegisteredBlockComponents( '@woocommerce/all-products' )
			).toEqual( { [ blockName ]: component } );
		} );
	} );

	describe( 'registerInnerBlock (deprecated)', () => {
		const invokeTest = ( args ) => () => {
			registerInnerBlock( args );
		};

		it( 'throws an error when registered block is missing `main`', () => {
			const options = { main: null };
			expect( invokeTest( options ) ).toThrowError( /main/ );
			expect( console ).toHaveWarned();
		} );
		it( 'throws an error when registered block is missing `blockName`', () => {
			const options = { main: context, blockName: null };
			expect( invokeTest( options ) ).toThrowError( /blockName/ );
		} );
		it( 'throws an error when registered block is missing `component`', () => {
			const options = { main: context, blockName, component: null };
			expect( invokeTest( options ) ).toThrowError( /component/ );
		} );
	} );

	describe( 'getRegisteredInnerBlocks (deprecated)', () => {
		it( 'gets an empty object when parent has no inner blocks', () => {
			expect(
				getRegisteredInnerBlocks( '@woocommerce/test-parent' )
			).toEqual( {} );
			expect( console ).toHaveWarned();
		} );
		it( 'gets a block that was successfully registered', () => {
			registerBlockComponent( { context, blockName, component } );
			expect(
				getRegisteredInnerBlocks( '@woocommerce/all-products' )
			).toEqual( {
				[ blockName ]: component,
			} );
		} );
	} );
} );
woocommerce-blocks/assets/js/blocks-registry/payment-methods/registry.ts000064400000010521151335517650022747 0ustar00/**
 * External dependencies
 */
import deprecated from '@wordpress/deprecated';
import type {
	PaymentMethodConfiguration,
	ExpressPaymentMethodConfiguration,
	CanMakePaymentExtensionCallback,
	PaymentMethodConfigInstance,
	PaymentMethods,
	ExpressPaymentMethods,
} from '@woocommerce/type-defs/payments';

/**
 * Internal dependencies
 */
import { default as PaymentMethodConfig } from './payment-method-config';
import { default as ExpressPaymentMethodConfig } from './express-payment-method-config';
import { canMakePaymentExtensionsCallbacks } from './extensions-config';

type LegacyRegisterPaymentMethodFunction = ( config: unknown ) => unknown;
type LegacyRegisterExpessPaymentMethodFunction = ( config: unknown ) => unknown;

const paymentMethods: PaymentMethods = {};
const expressPaymentMethods: ExpressPaymentMethods = {};

/**
 * Register a regular payment method.
 */
export const registerPaymentMethod = (
	options: PaymentMethodConfiguration | LegacyRegisterPaymentMethodFunction
): void => {
	let paymentMethodConfig: PaymentMethodConfigInstance | unknown;
	if ( typeof options === 'function' ) {
		// Legacy fallback for previous API, where client passes a function:
		// registerPaymentMethod( ( Config ) => new Config( options ) );
		paymentMethodConfig = options( PaymentMethodConfig );
		deprecated( 'Passing a callback to registerPaymentMethod()', {
			alternative: 'a config options object',
			plugin: 'woocommerce-gutenberg-products-block',
			link:
				'https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/3404',
		} );
	} else {
		paymentMethodConfig = new PaymentMethodConfig( options );
	}
	if ( paymentMethodConfig instanceof PaymentMethodConfig ) {
		paymentMethods[ paymentMethodConfig.name ] = paymentMethodConfig;
	}
};

/**
 * Register an express payment method.
 */
export const registerExpressPaymentMethod = (
	options:
		| ExpressPaymentMethodConfiguration
		| LegacyRegisterExpessPaymentMethodFunction
): void => {
	let paymentMethodConfig;
	if ( typeof options === 'function' ) {
		// Legacy fallback for previous API, where client passes a function:
		// registerExpressPaymentMethod( ( Config ) => new Config( options ) );
		paymentMethodConfig = options( ExpressPaymentMethodConfig );
		deprecated( 'Passing a callback to registerExpressPaymentMethod()', {
			alternative: 'a config options object',
			plugin: 'woocommerce-gutenberg-products-block',
			link:
				'https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/3404',
		} );
	} else {
		paymentMethodConfig = new ExpressPaymentMethodConfig( options );
	}
	if ( paymentMethodConfig instanceof ExpressPaymentMethodConfig ) {
		expressPaymentMethods[ paymentMethodConfig.name ] = paymentMethodConfig;
	}
};

/**
 * Allows extension to register callbacks for specific payment methods to determine if they can make payments
 */
export const registerPaymentMethodExtensionCallbacks = (
	namespace: string,
	callbacks: Record< string, CanMakePaymentExtensionCallback >
): void => {
	if ( canMakePaymentExtensionsCallbacks[ namespace ] ) {
		// eslint-disable-next-line no-console
		console.error(
			`The namespace provided to registerPaymentMethodExtensionCallbacks must be unique. Callbacks have already been registered for the ${ namespace } namespace.`
		);
	} else {
		// Set namespace up as an empty object.
		canMakePaymentExtensionsCallbacks[ namespace ] = {};

		Object.entries( callbacks ).forEach(
			( [ paymentMethodName, callback ] ) => {
				if ( typeof callback === 'function' ) {
					canMakePaymentExtensionsCallbacks[ namespace ][
						paymentMethodName
					] = callback;
				} else {
					// eslint-disable-next-line no-console
					console.error(
						`All callbacks provided to registerPaymentMethodExtensionCallbacks must be functions. The callback for the ${ paymentMethodName } payment method in the ${ namespace } namespace was not a function.`
					);
				}
			}
		);
	}
};

export const __experimentalDeRegisterPaymentMethod = (
	paymentMethodName: string
): void => {
	delete paymentMethods[ paymentMethodName ];
};

export const __experimentalDeRegisterExpressPaymentMethod = (
	paymentMethodName: string
): void => {
	delete expressPaymentMethods[ paymentMethodName ];
};

export const getPaymentMethods = (): PaymentMethods => {
	return paymentMethods;
};

export const getExpressPaymentMethods = (): ExpressPaymentMethods => {
	return expressPaymentMethods;
};
woocommerce-blocks/assets/js/blocks-registry/payment-methods/test/payment-method-config.tsx000064400000004140151335517650026444 0ustar00/**
 * External dependencies
 */
import { registerPaymentMethodExtensionCallbacks } from '@woocommerce/blocks-registry';
import type { PaymentMethodConfigInstance } from '@woocommerce/type-defs/payments';
/**
 * Internal dependencies
 */
import PaymentMethodConfig from '../payment-method-config';
import * as paymentMethodConfigHelpers from '../payment-method-config-helper';

describe( 'PaymentMethodConfig', () => {
	let paymentMethod: PaymentMethodConfigInstance;
	const extensionsCallbackSpy = jest.spyOn(
		paymentMethodConfigHelpers,
		'canMakePaymentWithExtensions'
	);
	beforeEach( () => {
		paymentMethod = new PaymentMethodConfig( {
			name: 'test-payment-method',
			label: 'Test payment method',
			ariaLabel: 'Test payment method',
			content: <div>Test payment content</div>,
			edit: <div>Test payment edit</div>,
			canMakePayment: () => true,
			supports: { features: [ 'products' ] },
		} );
	} );

	it( 'Uses canMakePaymentWithExtensions as the canMakePayment function if an extension registers a callback', () => {
		registerPaymentMethodExtensionCallbacks(
			'woocommerce-marketplace-extension',
			{
				'unrelated-payment-method': () => true,
			}
		);

		// At this point, since no extensions have registered a callback for
		// test-payment-method we can expect the canMakePayment getter NOT
		// to execute canMakePaymentWithExtensions.
		// Disable no-unused-expressions because we just want to test the getter
		// eslint-disable-next-line no-unused-expressions
		paymentMethod.canMakePayment;
		expect( extensionsCallbackSpy ).toHaveBeenCalledTimes( 0 );

		registerPaymentMethodExtensionCallbacks(
			'other-woocommerce-marketplace-extension',
			{
				'test-payment-method': () => true,
			}
		);

		// Now, because an extension _has_ registered a callback for test-payment-method
		// The getter will use canMakePaymentWithExtensions to create the
		// canMakePayment function.
		// Disable no-unused-expressions because we just want to test the getter
		// eslint-disable-next-line no-unused-expressions
		paymentMethod.canMakePayment;
		expect( extensionsCallbackSpy ).toHaveBeenCalledTimes( 1 );
	} );
} );
woocommerce-blocks/assets/js/blocks-registry/payment-methods/test/payment-method-config-helper.ts000064400000013676151335517650027547 0ustar00/**
 * External dependencies
 */
import { registerPaymentMethodExtensionCallbacks } from '@woocommerce/blocks-registry';
/**
 * Internal dependencies
 */
import * as helpers from '../payment-method-config-helper';
import { canMakePaymentExtensionsCallbacks } from '../extensions-config';

const canMakePaymentArgument = {
	cartTotals: {
		total_items: '1488',
		total_items_tax: '312',
		total_fees: '0',
		total_fees_tax: '0',
		total_discount: '0',
		total_discount_tax: '0',
		total_shipping: '0',
		total_shipping_tax: '0',
		total_price: '1800',
		total_tax: '312',
		tax_lines: [
			{
				name: 'BTW',
				price: '312',
				rate: '21%',
			},
		],
		currency_code: 'EUR',
		currency_symbol: '€',
		currency_minor_unit: 2,
		currency_decimal_separator: ',',
		currency_thousand_separator: '.',
		currency_prefix: '€',
		currency_suffix: '',
	},
	cartNeedsShipping: true,
	billingData: {
		first_name: 'name',
		last_name: 'Name',
		company: '',
		address_1: 'fdsfdsfdsf',
		address_2: '',
		city: 'Berlin',
		state: '',
		postcode: 'xxxxx',
		country: 'DE',
		email: 'name.Name@test.com',
		phone: '1234',
	},
	shippingAddress: {
		first_name: 'name',
		last_name: 'Name',
		company: '',
		address_1: 'fdsfdsfdsf',
		address_2: '',
		city: 'Berlin',
		state: '',
		postcode: 'xxxxx',
		country: 'DE',
		phone: '1234',
	},
	selectedShippingMethods: {
		'0': 'free_shipping:1',
	},
	paymentRequirements: [ 'products' ],
};
describe( 'payment-method-config-helper', () => {
	const trueCallback = jest.fn().mockReturnValue( true );
	const falseCallback = jest.fn().mockReturnValue( false );
	const bacsCallback = jest.fn().mockReturnValue( false );
	const throwsCallback = jest.fn().mockImplementation( () => {
		throw new Error();
	} );
	beforeAll( () => {
		// Register extension callbacks for two payment methods.
		registerPaymentMethodExtensionCallbacks(
			'woocommerce-marketplace-extension',
			{
				// cod: one extension returns true, the other returns false.
				cod: trueCallback,
				// cheque: returns true only if arg.billingData.postcode is 12345.
				cheque: ( arg ) => arg.billingData.postcode === '12345',
				// bacs: both extensions return false.
				bacs: bacsCallback,
				// woopay: both extensions return true.
				woopay: trueCallback,
				// testpay: one callback errors, one returns true
				testpay: throwsCallback,
			}
		);
		registerPaymentMethodExtensionCallbacks(
			'other-woocommerce-marketplace-extension',
			{
				cod: falseCallback,
				woopay: trueCallback,
				testpay: trueCallback,
				bacs: bacsCallback,
			}
		);
	} );

	beforeEach( () => {
		trueCallback.mockClear();
		throwsCallback.mockClear();
		falseCallback.mockClear();
		bacsCallback.mockClear();
	} );
	describe( 'getCanMakePayment', () => {
		it( 'returns callback canMakePaymentWithFeaturesCheck if no extension callback is detected', () => {
			// Define arguments from a payment method ('missing-payment-method') with no registered extension callbacks.
			const args = {
				canMakePayment: jest.fn().mockImplementation( () => true ),
				features: [ 'products' ],
				paymentMethodName: 'missing-payment-method',
			};

			const canMakePayment = helpers.getCanMakePayment(
				args.canMakePayment,
				args.features,
				args.paymentMethodName
			)( canMakePaymentArgument );

			// Expect that the result of getCanMakePayment is the result of
			// the payment method's own canMakePayment, as no extension callbacks are called.
			expect( canMakePayment ).toEqual( args.canMakePayment() );
		} );

		it( 'returns callbacks from the extensions when they are defined', () => {
			// Define arguments from a payment method (bacs) with registered extension callbacks.
			const args = {
				canMakePaymentConfiguration: jest
					.fn()
					.mockImplementation( () => true ),
				features: [ 'products' ],
				paymentMethodName: 'bacs',
			};

			const canMakePayment = helpers.getCanMakePayment(
				args.canMakePaymentConfiguration,
				args.features,
				args.paymentMethodName
			)( canMakePaymentArgument );

			// Expect that the result of getCanMakePayment is not the result of
			// the payment method's own canMakePayment (args.canMakePaymentConfiguration),
			// but of the registered bacsCallback.
			expect( canMakePayment ).toBe( bacsCallback() );
		} );
	} );

	describe( 'canMakePaymentWithExtensions', () => {
		it( "Returns false without executing the registered callbacks, if the payment method's canMakePayment callback returns false.", () => {
			const canMakePayment = () => false;
			const canMakePaymentWithExtensionsResult = helpers.canMakePaymentWithExtensions(
				canMakePayment,
				canMakePaymentExtensionsCallbacks,
				'cod'
			)( canMakePaymentArgument );
			expect( canMakePaymentWithExtensionsResult ).toBe( false );
			expect( trueCallback ).not.toHaveBeenCalled();
		} );

		it( 'Returns early when a registered callback returns false, without executing all the registered callbacks', () => {
			helpers.canMakePaymentWithExtensions(
				() => true,
				canMakePaymentExtensionsCallbacks,
				'bacs'
			)( canMakePaymentArgument );
			expect( bacsCallback ).toHaveBeenCalledTimes( 1 );
		} );

		it( 'Returns true if all extension callbacks return true', () => {
			const result = helpers.canMakePaymentWithExtensions(
				() => true,
				canMakePaymentExtensionsCallbacks,
				'woopay'
			)( canMakePaymentArgument );
			expect( result ).toBe( true );
		} );

		it( 'Passes canPayArg to the callback', () => {
			helpers.canMakePaymentWithExtensions(
				() => true,
				canMakePaymentExtensionsCallbacks,
				'woopay'
			)( canMakePaymentArgument );
			expect( trueCallback ).toHaveBeenCalledWith(
				canMakePaymentArgument
			);
		} );

		it( 'Allows all valid callbacks to run, even if one causes an error', () => {
			helpers.canMakePaymentWithExtensions(
				() => true,
				canMakePaymentExtensionsCallbacks,
				'testpay'
			)( canMakePaymentArgument );
			expect( console ).toHaveErrored();
			expect( throwsCallback ).toHaveBeenCalledTimes( 1 );
			expect( trueCallback ).toHaveBeenCalledTimes( 1 );
		} );
	} );
} );
woocommerce-blocks/assets/js/blocks-registry/payment-methods/test/registry.ts000064400000005124151335517650023731 0ustar00/**
 * External dependencies
 */
import { registerPaymentMethodExtensionCallbacks } from '@woocommerce/blocks-registry';

/**
 * Internal dependencies
 */
import { canMakePaymentExtensionsCallbacks } from '../extensions-config';

describe( 'registerPaymentMethodExtensionCallbacks', () => {
	it( 'Logs an error to console if namespace is already registered', () => {
		registerPaymentMethodExtensionCallbacks(
			'woocommerce-marketplace-extension',
			{
				cod: () => false,
			}
		);

		// eslint-disable-next-line no-console
		expect( console ).not.toHaveErrored();
		registerPaymentMethodExtensionCallbacks(
			'woocommerce-marketplace-extension',
			{
				cod: () => false,
			}
		);
		expect( console ).toHaveErrored();

		// eslint-disable-next-line no-console
		expect( console.error ).toHaveBeenCalledTimes( 1 );
	} );

	it( 'Does not overwrite a namespace if a second extensions tries to register with the same name', () => {
		const firstCodCallback = jest.fn().mockReturnValue( false );
		registerPaymentMethodExtensionCallbacks(
			'overwrite-marketplace-extension',
			{
				cod: firstCodCallback,
			}
		);

		// eslint-disable-next-line no-console
		expect( console ).not.toHaveErrored();
		registerPaymentMethodExtensionCallbacks(
			'overwrite-marketplace-extension',
			{
				cod: () => false,
			}
		);

		expect(
			canMakePaymentExtensionsCallbacks[
				'overwrite-marketplace-extension'
			].cod
		).toEqual( firstCodCallback );
	} );

	it( 'Logs an error if a supplied callback is not a function and does not register the callback for that method', () => {
		registerPaymentMethodExtensionCallbacks(
			'other-woocommerce-marketplace-extension',
			{
				cod: false,
				cheque: () => true,
			}
		);

		// eslint-disable-next-line no-console
		expect( console ).toHaveErrored();
		expect( canMakePaymentExtensionsCallbacks ).toHaveProperty(
			'other-woocommerce-marketplace-extension'
		);
		expect(
			canMakePaymentExtensionsCallbacks[
				'other-woocommerce-marketplace-extension'
			]
		).not.toHaveProperty( 'cod' );
		expect(
			canMakePaymentExtensionsCallbacks[
				'other-woocommerce-marketplace-extension'
			]
		).toHaveProperty( 'cheque' );
	} );

	it( 'Adds the namespace and callbacks to the canMakePaymentExtensionCallbacks object', () => {
		// We are using a new namespace here because canMakePaymentExtensionsCallbacks cannot be reset between tests.
		registerPaymentMethodExtensionCallbacks(
			'third-woocommerce-marketplace-extension',
			{
				cod: () => false,
			}
		);
		expect( canMakePaymentExtensionsCallbacks ).toHaveProperty(
			'third-woocommerce-marketplace-extension'
		);
	} );
} );
woocommerce-blocks/assets/js/blocks-registry/payment-methods/payment-method-config-helper.ts000064400000005336151335517650026562 0ustar00/**
 * External dependencies
 */
import type {
	CanMakePaymentCallback,
	CanMakePaymentExtensionCallback,
} from '@woocommerce/type-defs/payments';

/**
 * Internal dependencies
 */
import {
	NamespacedCanMakePaymentExtensionsCallbacks,
	PaymentMethodName,
	ExtensionNamespace,
	extensionsConfig,
} from './extensions-config';

// Filter out payment methods by supported features and cart requirement.
export const canMakePaymentWithFeaturesCheck = (
	canMakePayment: CanMakePaymentCallback,
	features: string[]
): CanMakePaymentCallback => ( canPayArgument ) => {
	const requirements = canPayArgument?.paymentRequirements || [];
	const featuresSupportRequirements = requirements.every( ( requirement ) =>
		features.includes( requirement )
	);
	return featuresSupportRequirements && canMakePayment( canPayArgument );
};

// Filter out payment methods by callbacks registered by extensions.
export const canMakePaymentWithExtensions = (
	canMakePayment: CanMakePaymentCallback,
	extensionsCallbacks: NamespacedCanMakePaymentExtensionsCallbacks,
	paymentMethodName: PaymentMethodName
): CanMakePaymentCallback => ( canPayArgument ) => {
	// Validate whether the payment method is available based on its own criteria first.
	let canPay = canMakePayment( canPayArgument );

	if ( canPay ) {
		// Gather all callbacks for paymentMethodName.
		const namespacedCallbacks: Record<
			ExtensionNamespace,
			CanMakePaymentExtensionCallback
		> = {};

		Object.entries( extensionsCallbacks ).forEach(
			( [ namespace, callbacks ] ) => {
				namespacedCallbacks[ namespace ] =
					callbacks[ paymentMethodName ];
			}
		);

		canPay = Object.keys( namespacedCallbacks ).every( ( namespace ) => {
			try {
				return namespacedCallbacks[ namespace ]( canPayArgument );
			} catch ( err ) {
				// eslint-disable-next-line no-console
				console.error(
					`Error when executing callback for ${ paymentMethodName } in ${ namespace }`,
					err
				);
				// .every() expects a return value at the end of every arrow function and
				// this ensures that the error is ignored when computing the whole result.
				return true;
			}
		} );
	}

	return canPay;
};

export const getCanMakePayment = (
	canMakePayment: CanMakePaymentCallback,
	features: string[],
	paymentMethodName: string
): CanMakePaymentCallback => {
	const canPay = canMakePaymentWithFeaturesCheck( canMakePayment, features );
	// Loop through all callbacks to check if there are any registered for this payment method.
	return ( Object.values( extensionsConfig.canMakePayment ) as Record<
		PaymentMethodName,
		CanMakePaymentCallback
	>[] ).some( ( callbacks ) => paymentMethodName in callbacks )
		? canMakePaymentWithExtensions(
				canPay,
				extensionsConfig.canMakePayment,
				paymentMethodName
		  )
		: canPay;
};
woocommerce-blocks/assets/js/blocks-registry/payment-methods/extensions-config.ts000064400000001417151335517650024545 0ustar00/**
 * External dependencies
 */
import { CanMakePaymentExtensionCallback } from '@woocommerce/type-defs/payments';

type CanMakePaymentExtensionCallbacks = Record<
	string,
	CanMakePaymentExtensionCallback
>;
export type NamespacedCanMakePaymentExtensionsCallbacks = Record<
	string,
	CanMakePaymentExtensionCallbacks
>;
export type ExtensionNamespace = keyof NamespacedCanMakePaymentExtensionsCallbacks;
export type PaymentMethodName = keyof CanMakePaymentExtensionCallbacks;

// Keeps callbacks registered by extensions for different payment methods
//  eslint-disable-next-line prefer-const
export const canMakePaymentExtensionsCallbacks: NamespacedCanMakePaymentExtensionsCallbacks = {};

export const extensionsConfig = {
	canMakePayment: canMakePaymentExtensionsCallbacks,
};
woocommerce-blocks/assets/js/blocks-registry/payment-methods/assertions.ts000064400000003267151335517650023302 0ustar00/**
 * External dependencies
 */
import { isValidElement } from '@wordpress/element';
import type { ReactNode } from 'react';
import type {
	PaymentMethodConfiguration,
	ExpressPaymentMethodConfiguration,
} from '@woocommerce/type-defs/payments';

export const assertValidPaymentMethodComponent = (
	component: () => unknown,
	componentName: string
): void => {
	if ( typeof component !== 'function' ) {
		throw new TypeError(
			`The ${ componentName } property for the payment method must be a functional component`
		);
	}
};

export const assertValidElement = (
	element: ReactNode,
	elementName: string
): void => {
	if ( element !== null && ! isValidElement( element ) ) {
		throw new TypeError(
			`The ${ elementName } property for the payment method must be a React element or null.`
		);
	}
};

export const assertValidElementOrString = (
	element: ReactNode,
	elementName: string
): void => {
	if (
		element !== null &&
		! isValidElement( element ) &&
		typeof element !== 'string'
	) {
		throw new TypeError(
			`The ${ elementName } property for the payment method must be a React element, a string, or null.`
		);
	}
};

export const assertConfigHasProperties = (
	config: ExpressPaymentMethodConfiguration | PaymentMethodConfiguration,
	expectedProperties: string[] = []
): void => {
	const missingProperties = expectedProperties.reduce(
		( acc: string[], property: string ) => {
			if ( ! config.hasOwnProperty( property ) ) {
				acc.push( property );
			}
			return acc;
		},
		[]
	);
	if ( missingProperties.length > 0 ) {
		const message =
			'The payment method configuration object is missing the following properties:';
		throw new TypeError( message + missingProperties.join( ', ' ) );
	}
};
woocommerce-blocks/assets/js/blocks-registry/payment-methods/index.ts000064400000000034151335517650022204 0ustar00export * from './registry';
woocommerce-blocks/assets/js/blocks-registry/payment-methods/payment-method-config.tsx000064400000011720151335517650025467 0ustar00/**
 * External dependencies
 */
import deprecated from '@wordpress/deprecated';
import type { ReactNode } from 'react';
import type {
	PaymentMethodConfiguration,
	Supports,
	CanMakePaymentCallback,
	PaymentMethodConfigInstance,
	PaymentMethodIcons,
} from '@woocommerce/type-defs/payments';

/**
 * Internal dependencies
 */
import { getCanMakePayment } from './payment-method-config-helper';
import {
	assertConfigHasProperties,
	assertValidElement,
	assertValidElementOrString,
} from './assertions';

const NullComponent = () => {
	return null;
};

export default class PaymentMethodConfig
	implements PaymentMethodConfigInstance {
	public name: string;
	public content: ReactNode;
	public edit: ReactNode;
	public paymentMethodId?: string;
	public supports: Supports;
	public icons: null | PaymentMethodIcons;
	public label: ReactNode;
	public ariaLabel: string;
	public placeOrderButtonLabel?: string;
	public savedTokenComponent?: ReactNode | null;
	public canMakePaymentFromConfig: CanMakePaymentCallback;

	constructor( config: PaymentMethodConfiguration ) {
		// validate config
		PaymentMethodConfig.assertValidConfig( config );
		this.name = config.name;
		this.label = config.label;
		this.placeOrderButtonLabel = config.placeOrderButtonLabel;
		this.ariaLabel = config.ariaLabel;
		this.content = config.content;
		this.savedTokenComponent = config.savedTokenComponent;
		this.icons = config.icons || null;
		this.edit = config.edit;
		this.paymentMethodId = config.paymentMethodId || this.name;
		this.supports = {
			showSavedCards:
				config?.supports?.showSavedCards ||
				config?.supports?.savePaymentInfo || // Kept for backward compatibility if methods still pass this when registering.
				false,
			showSaveOption: config?.supports?.showSaveOption || false,
			features: config?.supports?.features || [ 'products' ],
		};
		this.canMakePaymentFromConfig = config.canMakePayment;
	}

	// canMakePayment is calculated each time based on data that modifies outside of the class (eg: cart data).
	get canMakePayment(): CanMakePaymentCallback {
		return getCanMakePayment(
			this.canMakePaymentFromConfig,
			this.supports.features,
			this.name
		);
	}

	static assertValidConfig = ( config: PaymentMethodConfiguration ): void => {
		// set default for optional
		config.savedTokenComponent = config.savedTokenComponent || (
			<NullComponent />
		);
		assertConfigHasProperties( config, [
			'name',
			'label',
			'ariaLabel',
			'content',
			'edit',
			'canMakePayment',
		] );
		if ( typeof config.name !== 'string' ) {
			throw new Error(
				'The name property for the payment method must be a string'
			);
		}
		if (
			typeof config.icons !== 'undefined' &&
			! Array.isArray( config.icons ) &&
			config.icons !== null
		) {
			throw new Error(
				'The icons property for the payment method must be an array or null.'
			);
		}
		if (
			typeof config.paymentMethodId !== 'string' &&
			typeof config.paymentMethodId !== 'undefined'
		) {
			throw new Error(
				'The paymentMethodId property for the payment method must be a string or undefined (in which case it will be the value of the name property).'
			);
		}
		if (
			typeof config.placeOrderButtonLabel !== 'string' &&
			typeof config.placeOrderButtonLabel !== 'undefined'
		) {
			throw new TypeError(
				'The placeOrderButtonLabel property for the payment method must be a string'
			);
		}
		assertValidElementOrString( config.label, 'label' );
		assertValidElement( config.content, 'content' );
		assertValidElement( config.edit, 'edit' );
		assertValidElement( config.savedTokenComponent, 'savedTokenComponent' );
		if ( typeof config.ariaLabel !== 'string' ) {
			throw new TypeError(
				'The ariaLabel property for the payment method must be a string'
			);
		}
		if ( typeof config.canMakePayment !== 'function' ) {
			throw new TypeError(
				'The canMakePayment property for the payment method must be a function.'
			);
		}
		if (
			typeof config.supports?.showSavedCards !== 'undefined' &&
			typeof config.supports?.showSavedCards !== 'boolean'
		) {
			throw new TypeError(
				'If the payment method includes the `supports.showSavedCards` property, it must be a boolean'
			);
		}
		if ( typeof config.supports?.savePaymentInfo !== 'undefined' ) {
			deprecated(
				'Passing savePaymentInfo when registering a payment method.',
				{
					alternative: 'Pass showSavedCards and showSaveOption',
					plugin: 'woocommerce-gutenberg-products-block',
					link:
						'https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/3686',
				}
			);
		}
		if (
			typeof config.supports?.features !== 'undefined' &&
			! Array.isArray( config.supports?.features )
		) {
			throw new Error(
				'The features property for the payment method must be an array or undefined.'
			);
		}
		if (
			typeof config.supports?.showSaveOption !== 'undefined' &&
			typeof config.supports?.showSaveOption !== 'boolean'
		) {
			throw new TypeError(
				'If the payment method includes the `supports.showSaveOption` property, it must be a boolean'
			);
		}
	};
}
woocommerce-blocks/assets/js/blocks-registry/payment-methods/express-payment-method-config.ts000064400000004720151335517650026770 0ustar00/**
 * External dependencies
 */
import type { ReactNode } from 'react';
import type {
	ExpressPaymentMethodConfiguration,
	Supports,
	CanMakePaymentCallback,
	ExpressPaymentMethodConfigInstance,
} from '@woocommerce/type-defs/payments';

/**
 * Internal dependencies
 */
import { getCanMakePayment } from './payment-method-config-helper';
import { assertConfigHasProperties, assertValidElement } from './assertions';

export default class ExpressPaymentMethodConfig
	implements ExpressPaymentMethodConfigInstance {
	public name: string;
	public content: ReactNode;
	public edit: ReactNode;
	public paymentMethodId?: string;
	public supports: Supports;
	public canMakePaymentFromConfig: CanMakePaymentCallback;

	constructor( config: ExpressPaymentMethodConfiguration ) {
		// validate config
		ExpressPaymentMethodConfig.assertValidConfig( config );
		this.name = config.name;
		this.content = config.content;
		this.edit = config.edit;
		this.paymentMethodId = config.paymentMethodId || this.name;
		this.supports = {
			features: config?.supports?.features || [ 'products' ],
		};
		this.canMakePaymentFromConfig = config.canMakePayment;
	}

	// canMakePayment is calculated each time based on data that modifies outside of the class (eg: cart data).
	get canMakePayment(): CanMakePaymentCallback {
		return getCanMakePayment(
			this.canMakePaymentFromConfig,
			this.supports.features,
			this.name
		);
	}

	static assertValidConfig = (
		config: ExpressPaymentMethodConfiguration
	): void => {
		assertConfigHasProperties( config, [ 'name', 'content', 'edit' ] );
		if ( typeof config.name !== 'string' ) {
			throw new TypeError(
				'The name property for the express payment method must be a string'
			);
		}
		if (
			typeof config.paymentMethodId !== 'string' &&
			typeof config.paymentMethodId !== 'undefined'
		) {
			throw new Error(
				'The paymentMethodId property for the payment method must be a string or undefined (in which case it will be the value of the name property).'
			);
		}
		if (
			typeof config.supports?.features !== 'undefined' &&
			! Array.isArray( config.supports?.features )
		) {
			throw new Error(
				'The features property for the payment method must be an array or undefined.'
			);
		}
		assertValidElement( config.content, 'content' );
		assertValidElement( config.edit, 'edit' );
		if ( typeof config.canMakePayment !== 'function' ) {
			throw new TypeError(
				'The canMakePayment property for the express payment method must be a function.'
			);
		}
	};
}
woocommerce-blocks/assets/js/previews/saved-payment-methods.js000064400000000317151335517650020710 0ustar00export const previewSavedPaymentMethods = {
	cc: [
		{
			method: {
				gateway: 'stripe',
				last4: '5678',
				brand: 'Visa',
			},
			expires: '12/20',
			is_default: false,
			tokenId: '1',
		},
	],
};
woocommerce-blocks/assets/js/previews/reviews.js000064400000002621151335517650016156 0ustar00/**
 * External dependencies
 */
import { __ } from '@wordpress/i18n';
import { blocksConfig } from '@woocommerce/block-settings';

export const previewReviews = [
	{
		id: 1,
		date_created: '2019-07-15T17:05:04',
		formatted_date_created: __(
			'July 15, 2019',
			'woocommerce'
		),
		date_created_gmt: '2019-07-15T15:05:04',
		product_id: 0,
		product_name: __( 'WordPress Pennant', 'woocommerce' ),
		product_permalink: '#',
		/* translators: An example person name used for the block previews. */
		reviewer: __( 'Alice', 'woocommerce' ),
		review: `<p>${ __(
			"I bought this product last week and I'm very happy with it.",
			'woocommerce'
		) }</p>\n`,
		reviewer_avatar_urls: {
			'48': blocksConfig.defaultAvatar,
			'96': blocksConfig.defaultAvatar,
		},
		rating: 5,
		verified: true,
	},
	{
		id: 2,
		date_created: '2019-07-12T12:39:39',
		formatted_date_created: __(
			'July 12, 2019',
			'woocommerce'
		),
		date_created_gmt: '2019-07-12T10:39:39',
		product_id: 0,
		product_name: __( 'WordPress Pennant', 'woocommerce' ),
		product_permalink: '#',
		/* translators: An example person name used for the block previews. */
		reviewer: __( 'Bob', 'woocommerce' ),
		review: `<p>${ __(
			'This product is awesome, I love it!',
			'woocommerce'
		) }</p>\n`,
		reviewer_avatar_urls: {
			'48': blocksConfig.defaultAvatar,
			'96': blocksConfig.defaultAvatar,
		},
		rating: null,
		verified: false,
	},
];
woocommerce-blocks/assets/js/previews/products.js000064400000003266151335517650016343 0ustar00/**
 * External dependencies
 */
import { __ } from '@wordpress/i18n';
import { WC_BLOCKS_IMAGE_URL } from '@woocommerce/block-settings';

const shortDescription = __(
	'Fly your WordPress banner with this beauty! Deck out your office space or add it to your kids walls. This banner will spruce up any space it’s hung!',
	'woocommerce'
);

export const previewProducts = [
	{
		id: 1,
		name: 'WordPress Pennant',
		variation: '',
		permalink: 'https://example.org',
		sku: 'wp-pennant',
		short_description: shortDescription,
		description:
			'Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.',
		price: '7.99',
		price_html:
			'<span class="woocommerce-Price-amount amount"><span class="woocommerce-Price-currencySymbol">$</span>7.99</span>',
		images: [
			{
				id: 1,
				src: WC_BLOCKS_IMAGE_URL + 'previews/pennant.jpg',
				thumbnail: WC_BLOCKS_IMAGE_URL + 'previews/pennant.jpg',
				name: 'pennant-1.jpg',
				alt: 'WordPress Pennant',
				srcset: '',
				sizes: '',
			},
		],
		average_rating: 5,
		review_count: 1,
		prices: {
			currency_code: 'GBP',
			decimal_separator: '.',
			thousand_separator: ',',
			decimals: 2,
			price_prefix: '£',
			price_suffix: '',
			price: '7.99',
			regular_price: '9.99',
			sale_price: '7.99',
			price_range: null,
		},
		add_to_cart: {
			text: __( 'Add to cart', 'woocommerce' ),
			description: __( 'Add to cart', 'woocommerce' ),
		},
		has_options: false,
		is_purchasable: true,
		is_in_stock: true,
		on_sale: true,
	},
];
woocommerce-blocks/assets/js/previews/grid-block.js000064400000012241151335517650016506 0ustar00/**
 * External dependencies
 */
export const gridBlockPreview = (
	<svg
		xmlns="http://www.w3.org/2000/svg"
		fill="none"
		viewBox="0 0 230 250"
		style={ {
			width: '100%',
		} }
	>
		<title>Grid Block Preview</title>
		<rect
			width="65.374"
			height="65.374"
			x=".162"
			y=".779"
			fill="#E1E3E6"
			rx="3"
		/>
		<rect
			width="47.266"
			height="5.148"
			x="9.216"
			y="76.153"
			fill="#E1E3E6"
			rx="2.574"
		/>
		<rect
			width="62.8"
			height="15"
			x="1.565"
			y="101.448"
			fill="#E1E3E6"
			rx="5"
		/>
		<rect
			width="65.374"
			height="65.374"
			x=".162"
			y="136.277"
			fill="#E1E3E6"
			rx="3"
		/>
		<rect
			width="47.266"
			height="5.148"
			x="9.216"
			y="211.651"
			fill="#E1E3E6"
			rx="2.574"
		/>
		<rect
			width="62.8"
			height="15"
			x="1.565"
			y="236.946"
			fill="#E1E3E6"
			rx="5"
		/>
		<rect
			width="65.374"
			height="65.374"
			x="82.478"
			y=".779"
			fill="#E1E3E6"
			rx="3"
		/>
		<rect
			width="47.266"
			height="5.148"
			x="91.532"
			y="76.153"
			fill="#E1E3E6"
			rx="2.574"
		/>
		<rect
			width="62.8"
			height="15"
			x="83.882"
			y="101.448"
			fill="#E1E3E6"
			rx="5"
		/>
		<rect
			width="65.374"
			height="65.374"
			x="82.478"
			y="136.277"
			fill="#E1E3E6"
			rx="3"
		/>
		<rect
			width="47.266"
			height="5.148"
			x="91.532"
			y="211.651"
			fill="#E1E3E6"
			rx="2.574"
		/>
		<rect
			width="62.8"
			height="15"
			x="83.882"
			y="236.946"
			fill="#E1E3E6"
			rx="5"
		/>
		<rect
			width="65.374"
			height="65.374"
			x="164.788"
			y=".779"
			fill="#E1E3E6"
			rx="3"
		/>
		<rect
			width="47.266"
			height="5.148"
			x="173.843"
			y="76.153"
			fill="#E1E3E6"
			rx="2.574"
		/>
		<rect
			width="62.8"
			height="15"
			x="166.192"
			y="101.448"
			fill="#E1E3E6"
			rx="5"
		/>
		<rect
			width="65.374"
			height="65.374"
			x="164.788"
			y="136.277"
			fill="#E1E3E6"
			rx="3"
		/>
		<rect
			width="47.266"
			height="5.148"
			x="173.843"
			y="211.651"
			fill="#E1E3E6"
			rx="2.574"
		/>
		<rect
			width="62.8"
			height="15"
			x="166.192"
			y="236.946"
			fill="#E1E3E6"
			rx="5"
		/>
		<rect
			width="6.177"
			height="6.177"
			x="13.283"
			y="86.301"
			fill="#E1E3E6"
			rx="3"
		/>
		<rect
			width="6.177"
			height="6.177"
			x="21.498"
			y="86.301"
			fill="#E1E3E6"
			rx="3"
		/>
		<rect
			width="6.177"
			height="6.177"
			x="29.713"
			y="86.301"
			fill="#E1E3E6"
			rx="3"
		/>
		<rect
			width="6.177"
			height="6.177"
			x="37.927"
			y="86.301"
			fill="#E1E3E6"
			rx="3"
		/>
		<rect
			width="6.177"
			height="6.177"
			x="46.238"
			y="86.301"
			fill="#E1E3E6"
			rx="3"
		/>
		<rect
			width="6.177"
			height="6.177"
			x="95.599"
			y="86.301"
			fill="#E1E3E6"
			rx="3"
		/>
		<rect
			width="6.177"
			height="6.177"
			x="103.814"
			y="86.301"
			fill="#E1E3E6"
			rx="3"
		/>
		<rect
			width="6.177"
			height="6.177"
			x="112.029"
			y="86.301"
			fill="#E1E3E6"
			rx="3"
		/>
		<rect
			width="6.177"
			height="6.177"
			x="120.243"
			y="86.301"
			fill="#E1E3E6"
			rx="3"
		/>
		<rect
			width="6.177"
			height="6.177"
			x="128.554"
			y="86.301"
			fill="#E1E3E6"
			rx="3"
		/>
		<rect
			width="6.177"
			height="6.177"
			x="177.909"
			y="86.301"
			fill="#E1E3E6"
			rx="3"
		/>
		<rect
			width="6.177"
			height="6.177"
			x="186.124"
			y="86.301"
			fill="#E1E3E6"
			rx="3"
		/>
		<rect
			width="6.177"
			height="6.177"
			x="194.339"
			y="86.301"
			fill="#E1E3E6"
			rx="3"
		/>
		<rect
			width="6.177"
			height="6.177"
			x="202.553"
			y="86.301"
			fill="#E1E3E6"
			rx="3"
		/>
		<rect
			width="6.177"
			height="6.177"
			x="210.864"
			y="86.301"
			fill="#E1E3E6"
			rx="3"
		/>
		<rect
			width="6.177"
			height="6.177"
			x="13.283"
			y="221.798"
			fill="#E1E3E6"
			rx="3"
		/>
		<rect
			width="6.177"
			height="6.177"
			x="21.498"
			y="221.798"
			fill="#E1E3E6"
			rx="3"
		/>
		<rect
			width="6.177"
			height="6.177"
			x="29.713"
			y="221.798"
			fill="#E1E3E6"
			rx="3"
		/>
		<rect
			width="6.177"
			height="6.177"
			x="37.927"
			y="221.798"
			fill="#E1E3E6"
			rx="3"
		/>
		<rect
			width="6.177"
			height="6.177"
			x="46.238"
			y="221.798"
			fill="#E1E3E6"
			rx="3"
		/>
		<rect
			width="6.177"
			height="6.177"
			x="95.599"
			y="221.798"
			fill="#E1E3E6"
			rx="3"
		/>
		<rect
			width="6.177"
			height="6.177"
			x="103.814"
			y="221.798"
			fill="#E1E3E6"
			rx="3"
		/>
		<rect
			width="6.177"
			height="6.177"
			x="112.029"
			y="221.798"
			fill="#E1E3E6"
			rx="3"
		/>
		<rect
			width="6.177"
			height="6.177"
			x="120.243"
			y="221.798"
			fill="#E1E3E6"
			rx="3"
		/>
		<rect
			width="6.177"
			height="6.177"
			x="128.554"
			y="221.798"
			fill="#E1E3E6"
			rx="3"
		/>
		<rect
			width="6.177"
			height="6.177"
			x="177.909"
			y="221.798"
			fill="#E1E3E6"
			rx="3"
		/>
		<rect
			width="6.177"
			height="6.177"
			x="186.124"
			y="221.798"
			fill="#E1E3E6"
			rx="3"
		/>
		<rect
			width="6.177"
			height="6.177"
			x="194.339"
			y="221.798"
			fill="#E1E3E6"
			rx="3"
		/>
		<rect
			width="6.177"
			height="6.177"
			x="202.553"
			y="221.798"
			fill="#E1E3E6"
			rx="3"
		/>
		<rect
			width="6.177"
			height="6.177"
			x="210.864"
			y="221.798"
			fill="#E1E3E6"
			rx="3"
		/>
	</svg>
);
woocommerce-blocks/assets/js/previews/shipping-rates.ts000064400000003376151335517650017451 0ustar00/**
 * External dependencies
 */
import { __, _x } from '@wordpress/i18n';
import type { CartResponseShippingRate } from '@woocommerce/types';

export const previewShippingRates: CartResponseShippingRate[] = [
	{
		destination: {
			address_1: '',
			address_2: '',
			city: '',
			state: '',
			postcode: '',
			country: '',
		},
		package_id: 0,
		name: __( 'Shipping', 'woo-gutenberg-products-block' ),
		items: [
			{
				key: '33e75ff09dd601bbe69f351039152189',
				name: _x(
					'Beanie with Logo',
					'example product in Cart Block',
					'woo-gutenberg-products-block'
				),
				quantity: 2,
			},
			{
				key: '6512bd43d9caa6e02c990b0a82652dca',
				name: _x(
					'Beanie',
					'example product in Cart Block',
					'woo-gutenberg-products-block'
				),
				quantity: 1,
			},
		],
		shipping_rates: [
			{
				currency_code: 'USD',
				currency_symbol: '$',
				currency_minor_unit: 2,
				currency_decimal_separator: '.',
				currency_thousand_separator: ',',
				currency_prefix: '$',
				currency_suffix: '',
				name: __( 'Free shipping', 'woo-gutenberg-products-block' ),
				description: '',
				delivery_time: '',
				price: '000',
				taxes: '0',
				rate_id: 'free_shipping:1',
				instance_id: 0,
				meta_data: [],
				method_id: 'flat_rate',
				selected: true,
			},
			{
				currency_code: 'USD',
				currency_symbol: '$',
				currency_minor_unit: 2,
				currency_decimal_separator: '.',
				currency_thousand_separator: ',',
				currency_prefix: '$',
				currency_suffix: '',
				name: __( 'Local pickup', 'woo-gutenberg-products-block' ),
				description: '',
				delivery_time: '',
				price: '200',
				taxes: '0',
				rate_id: 'local_pickup:1',
				instance_id: 1,
				meta_data: [],
				method_id: 'local_pickup',
				selected: false,
			},
		],
	},
];
woocommerce-blocks/assets/js/previews/single-product-block.js000064400000000453151335517650020522 0ustar00export const singleProductBlockPreview = (
	<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 230 100">
		<path
			fill="#E1E3E6"
			d="M76 0h11v6H76zm0 11h88v11H76zm0 16h28v6H76zm0 17h154v28H76zm0 39h22v17H76zm28 0h44v17h-44zM0 0h66v66H0z"
			style={ {
				width: '100%',
			} }
		/>
	</svg>
);
woocommerce-blocks/assets/js/previews/index.js000064400000000647151335517650015607 0ustar00export { previewProducts } from './products';
export { previewCart } from './cart';
export { previewReviews } from './reviews';
export { previewCategories } from './categories';
export { previewShippingRates } from './shipping-rates';
export { previewSavedPaymentMethods } from './saved-payment-methods';

export { gridBlockPreview } from './grid-block';
export { singleProductBlockPreview } from './single-product-block';
woocommerce-blocks/assets/js/previews/categories.js000064400000001252151335517650016616 0ustar00/**
 * External dependencies
 */
import { __ } from '@wordpress/i18n';
import { WC_BLOCKS_IMAGE_URL } from '@woocommerce/block-settings';

export const previewCategories = [
	{
		id: 1,
		name: __( 'Clothing', 'woocommerce' ),
		slug: 'clothing',
		parent: 0,
		count: 10,
		description: `<p>${ __(
			'Branded t-shirts, jumpers, pants and more!',
			'woocommerce'
		) }</p>\n`,
		image: {
			id: 1,
			date_created: '2019-07-15T17:05:04',
			date_created_gmt: '2019-07-15T17:05:04',
			date_modified: '2019-07-15T17:05:04',
			date_modified_gmt: '2019-07-15T17:05:04',
			src: WC_BLOCKS_IMAGE_URL + 'previews/collection.jpg',
			name: '',
			alt: '',
		},
		permalink: '#',
	},
];
woocommerce-blocks/assets/js/previews/cart.ts000064400000014140151335517650015434 0ustar00/**
 * External dependencies
 */
import { __ } from '@wordpress/i18n';
import { WC_BLOCKS_IMAGE_URL } from '@woocommerce/block-settings';
import { CartResponse } from '@woocommerce/types';
import { getSetting } from '@woocommerce/settings';

/**
 * Internal dependencies
 */
import { previewShippingRates } from './shipping-rates';

const displayWithTax = getSetting( 'displayCartPricesIncludingTax', false );
// Sample data for cart block.
// This closely resembles the data returned from the Store API /cart endpoint.
// https://github.com/woocommerce/woocommerce-gutenberg-products-block/blob/trunk/src/StoreApi/docs/cart.md#cart-response
export const previewCart: CartResponse = {
	coupons: [],
	shipping_rates: getSetting( 'shippingMethodsExist', false )
		? previewShippingRates
		: [],
	items: [
		{
			key: '1',
			id: 1,
			quantity: 2,
			name: __( 'Beanie', 'woo-gutenberg-products-block' ),
			short_description: __(
				'Warm hat for winter',
				'woo-gutenberg-products-block'
			),
			description:
				'Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.',
			sku: 'woo-beanie',
			permalink: 'https://example.org',
			low_stock_remaining: 2,
			backorders_allowed: false,
			show_backorder_badge: false,
			sold_individually: false,
			images: [
				{
					id: 10,
					src: WC_BLOCKS_IMAGE_URL + 'previews/beanie.jpg',
					thumbnail: WC_BLOCKS_IMAGE_URL + 'previews/beanie.jpg',
					srcset: '',
					sizes: '',
					name: '',
					alt: '',
				},
			],
			variation: [
				{
					attribute: __( 'Color', 'woo-gutenberg-products-block' ),
					value: __( 'Yellow', 'woo-gutenberg-products-block' ),
				},
				{
					attribute: __( 'Size', 'woo-gutenberg-products-block' ),
					value: __( 'Small', 'woo-gutenberg-products-block' ),
				},
			],
			prices: {
				currency_code: 'USD',
				currency_symbol: '$',
				currency_minor_unit: 2,
				currency_decimal_separator: '.',
				currency_thousand_separator: ',',
				currency_prefix: '$',
				currency_suffix: '',
				price: displayWithTax ? '800' : '640',
				regular_price: displayWithTax ? '800' : '640',
				sale_price: displayWithTax ? '800' : '640',
				raw_prices: {
					precision: 6,
					price: displayWithTax ? '8000000' : '6400000',
					regular_price: displayWithTax ? '8000000' : '6400000',
					sale_price: displayWithTax ? '8000000' : '6400000',
				},
			},
			totals: {
				currency_code: 'USD',
				currency_symbol: '$',
				currency_minor_unit: 2,
				currency_decimal_separator: '.',
				currency_thousand_separator: ',',
				currency_prefix: '$',
				currency_suffix: '',
				line_subtotal: displayWithTax ? '1600' : '1280',
				line_subtotal_tax: '0',
				line_total: '1600',
				line_total_tax: displayWithTax ? '0' : '320',
			},
			extensions: {},
		},
		{
			key: '2',
			id: 2,
			quantity: 1,
			name: __( 'Cap', 'woo-gutenberg-products-block' ),
			short_description: __(
				'Lightweight baseball cap',
				'woo-gutenberg-products-block'
			),
			description:
				'Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.',
			sku: 'woo-cap',
			permalink: 'https://example.org',
			backorders_allowed: false,
			show_backorder_badge: false,
			sold_individually: false,
			images: [
				{
					id: 11,
					src: WC_BLOCKS_IMAGE_URL + 'previews/cap.jpg',
					thumbnail: WC_BLOCKS_IMAGE_URL + 'previews/cap.jpg',
					srcset: '',
					sizes: '',
					name: '',
					alt: '',
				},
			],
			variation: [
				{
					attribute: __( 'Color', 'woo-gutenberg-products-block' ),
					value: __( 'Orange', 'woo-gutenberg-products-block' ),
				},
			],
			prices: {
				currency_code: 'USD',
				currency_symbol: '$',
				currency_minor_unit: 2,
				currency_decimal_separator: '.',
				currency_thousand_separator: ',',
				currency_prefix: '$',
				currency_suffix: '',
				price: displayWithTax ? '1400' : '1120',
				regular_price: displayWithTax ? '1600' : '1280',
				sale_price: displayWithTax ? '1400' : '1120',
				raw_prices: {
					precision: 6,
					price: displayWithTax ? '14000000' : '11200000',
					regular_price: displayWithTax ? '16000000' : '12800000',
					sale_price: displayWithTax ? '14000000' : '11200000',
				},
			},
			totals: {
				currency_code: 'USD',
				currency_symbol: '$',
				currency_minor_unit: 2,
				currency_decimal_separator: '.',
				currency_thousand_separator: ',',
				currency_prefix: '$',
				currency_suffix: '',
				line_subtotal: displayWithTax ? '1400' : '1120',
				line_subtotal_tax: displayWithTax ? '0' : '280',
				line_total: '1400',
				line_total_tax: displayWithTax ? '0' : '280',
			},
			extensions: {},
		},
	],
	fees: [],
	items_count: 3,
	items_weight: 0,
	needs_payment: true,
	needs_shipping: getSetting( 'shippingEnabled', true ),
	has_calculated_shipping: true,
	shipping_address: {
		first_name: '',
		last_name: '',
		company: '',
		address_1: '',
		address_2: '',
		city: '',
		state: '',
		postcode: '',
		country: '',
		phone: '',
	},
	billing_address: {
		first_name: '',
		last_name: '',
		company: '',
		address_1: '',
		address_2: '',
		city: '',
		state: '',
		postcode: '',
		country: '',
		email: '',
		phone: '',
	},
	totals: {
		currency_code: 'USD',
		currency_symbol: '$',
		currency_minor_unit: 2,
		currency_decimal_separator: '.',
		currency_thousand_separator: ',',
		currency_prefix: '$',
		currency_suffix: '',
		total_items: displayWithTax ? '3000' : '2400',
		total_items_tax: '0',
		total_fees: '0',
		total_fees_tax: '0',
		total_discount: '0',
		total_discount_tax: '0',
		total_shipping: '0',
		total_shipping_tax: '0',
		total_tax: '600',
		total_price: '3000',
		tax_lines: [
			{
				name: __( 'Sales tax', 'woo-gutenberg-products-block' ),
				rate: '20%',
				price: 600,
			},
		],
	},
	errors: [],
	payment_requirements: [ 'products' ],
	generated_timestamp: Date.now(),
	extensions: {},
};
woocommerce-blocks/assets/js/icons/index.js000064400000005776151335517650015066 0ustar00export { default as Icon } from './icon';

export { default as address } from './library/address';
export { default as arrowBack } from './library/arrow-back';
export { default as arrowDownAlt2 } from './library/arrow-down-alt2';
export { default as asterisk } from './library/asterisk';
export { default as atom } from './library/atom';
export { default as bank } from './library/bank';
export { default as barcode } from './library/barcode';
export { default as bill } from './library/bill';
export { default as bookmark } from './library/bookmark';
export { default as box } from './library/box';
export { default as card } from './library/card';
export { default as cart } from './library/cart';
export { default as checkPayment } from './library/check-payment';
export { default as chevronDown } from './library/chevron-down';
export { default as chevronUp } from './library/chevron-up';
export { default as chevronRight } from './library/chevron-right';
export { default as comment } from './library/comment';
export { default as contact } from './library/contact';
export { default as done } from './library/done';
export { default as discussion } from './library/discussion';
export { default as eye } from './library/eye';
export { default as exclamation } from './library/exclamation';
export { default as external } from './library/external';
export { default as fields } from './library/fields';
export { default as filledCart } from './library/filled-cart';
export { default as folderStarred } from './library/folder-starred';
export { default as folder } from './library/folder';
export { default as formStep } from './library/form-step';
export { default as grid } from './library/grid';
export { default as heading } from './library/heading';
export { default as image } from './library/image';
export { default as list } from './library/list';
export { default as more } from './library/more';
export { default as noAlt } from './library/no-alt';
export { default as notes } from './library/notes';
export { default as notice } from './library/notice';
export { default as radioSelected } from './library/radio-selected';
export { default as radioUnselected } from './library/radio-unselected';
export { default as reader } from './library/reader';
export { default as removeCart } from './library/remove-cart';
export { default as restore } from './library/restore';
export { default as review } from './library/review';
export { default as search } from './library/search';
export { default as server } from './library/server';
export { default as star } from './library/star';
export { default as stonks } from './library/stonks';
export { default as tag } from './library/tag';
export { default as tags } from './library/tags';
export { default as thumbUp } from './library/thumb-up';
export { default as toggle } from './library/toggle';
export { default as totals } from './library/totals';
export { default as truck } from './library/truck';
export { default as widgets } from './library/widgets';
export { default as woo } from './library/woo';
woocommerce-blocks/assets/js/icons/stories/index.js000064400000003543151335517650016544 0ustar00/**
 * External dependencies
 */
import { omitBy, omit } from 'lodash';
import { useState } from '@wordpress/element';

/**
 * Internal dependencies
 */
import Icon from '../icon';
import * as icons from '../index';

const availableIcons = omit( icons, 'Icon' );

export default {
	title: 'WooCommerce Blocks/@woocommerce/icons',
	component: Icon,
};

const LibraryExample = () => {
	const [ filter, setFilter ] = useState( '' );
	const filteredIcons = omitBy( availableIcons, ( _icon, name ) => {
		return ! name.includes( filter );
	} );

	return (
		<div style={ { padding: '20px' } }>
			<label htmlFor="filter-icons" style={ { paddingRight: '30px' } }>
				Filter Icons
			</label>
			<input
				// eslint-disable-next-line no-restricted-syntax
				id="filter-icons"
				type="search"
				value={ filter }
				placeholder="Icon name"
				onChange={ ( event ) => setFilter( event.target.value ) }
			/>
			<div
				style={ {
					display: 'flex',
					alignItems: 'bottom',
					flexWrap: 'wrap',
				} }
			>
				{ Object.entries( filteredIcons ).map( ( [ name, icon ] ) => {
					return (
						<div
							key={ name }
							style={ {
								display: 'flex',
								flexDirection: 'column',
								width: '25%',
								padding: '25px 0 25px 0',
							} }
						>
							<strong
								style={ {
									width: '200px',
								} }
							>
								{ name }
							</strong>
							<div
								style={ {
									display: 'flex',
									alignItems: 'center',
								} }
							>
								<Icon srcElement={ icon } />
								<Icon
									style={ { paddingLeft: '10px' } }
									srcElement={ icon }
									size={ 36 }
								/>
								<Icon
									style={ { paddingLeft: '10px' } }
									srcElement={ icon }
									size={ 48 }
								/>
							</div>
						</div>
					);
				} ) }
			</div>
		</div>
	);
};

export const Library = () => <LibraryExample />;
woocommerce-blocks/assets/js/icons/library/eye.js000064400000001037151335517650016167 0ustar00/**
 * External dependencies
 */
import { SVG } from 'wordpress-components';

const eye = (
	<SVG xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
		<path fill="none" d="M0 0h24v24H0V0z" />
		<path d="M12 6a9.77 9.77 0 0 1 8.82 5.5C19.17 14.87 15.79 17 12 17s-7.17-2.13-8.82-5.5A9.77 9.77 0 0 1 12 6m0-2C7 4 2.73 7.11 1 11.5 2.73 15.89 7 19 12 19s9.27-3.11 11-7.5C21.27 7.11 17 4 12 4zm0 5a2.5 2.5 0 0 1 0 5 2.5 2.5 0 0 1 0-5m0-2c-2.48 0-4.5 2.02-4.5 4.5S9.52 16 12 16s4.5-2.02 4.5-4.5S14.48 7 12 7z" />
	</SVG>
);

export default eye;
woocommerce-blocks/assets/js/icons/library/atom.js000064400000001464151335517650016351 0ustar00/**
 * External dependencies
 */
import { SVG } from 'wordpress-components';

const atom = (
	<SVG xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
		<path d="M12 11a1 1 0 011 1 1 1 0 01-1 1 1 1 0 01-1-1 1 1 0 011-1M4.2 4.2c1.5-1.4 4.5-.8 7.8 1.4 3.3-2.2 6.4-2.8 7.8-1.4 1.4 1.5.8 4.5-1.4 7.8 2.2 3.3 2.8 6.4 1.4 7.8-1.4 1.4-4.6.8-7.8-1.4-3.3 2.2-6.3 2.8-7.8 1.4-1.4-1.4-.8-4.6 1.4-7.8-2.2-3.3-2.8-6.3-1.4-7.8m11.3 4.3a29 29 0 011.7 1.8c1.4-2 2-4 1.2-4.7-.8-.7-2.6-.2-4.7 1.2l1.8 1.7m-7 7a29 29 0 01-1.7-1.8c-1.4 2-2 4-1.2 4.7.8.7 2.6.2 4.7-1.2a29 29 0 01-1.8-1.7M5.6 5.6c-.7.8-.2 2.6 1.2 4.7a29 29 0 013.5-3.5c-2-1.4-4-2-4.7-1.2m4.3 8.5l2.1 2a28.1 28.1 0 004-4.1 28.1 28.1 0 00-4-4 28.1 28.1 0 00-4 4l1.9 2.1m8.5 4.3c.7-.8.2-2.6-1.2-4.7a29 29 0 01-3.5 3.5c2 1.4 4 2 4.7 1.2z" />
	</SVG>
);

export default atom;
woocommerce-blocks/assets/js/icons/library/bookmark.js000064400000000454151335517650017214 0ustar00/**
 * External dependencies
 */
import { SVG } from 'wordpress-components';

const bookmark = (
	<SVG xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
		<path fill="none" d="M0 0h24v24H0z" />
		<path d="M17 3H7a2 2 0 00-2 2v16l7-3 7 3V5a2 2 0 00-2-2z" />
	</SVG>
);

export default bookmark;
woocommerce-blocks/assets/js/icons/library/widgets.js000064400000000672151335517650017057 0ustar00/**
 * External dependencies
 */
import { SVG } from 'wordpress-components';

const widgets = (
	<SVG xmlns="http://www.w3.org/2000/SVG" viewBox="0 0 24 24">
		<path fill="none" d="M0 0h24v24H0V0z" />
		<path d="M16.66 4.52l2.83 2.83-2.83 2.83-2.83-2.83 2.83-2.83M9 5v4H5V5h4m10 10v4h-4v-4h4M9 15v4H5v-4h4m7.66-13.31L11 7.34 16.66 13l5.66-5.66-5.66-5.65zM11 3H3v8h8V3zm10 10h-8v8h8v-8zm-10 0H3v8h8v-8z" />
	</SVG>
);

export default widgets;
woocommerce-blocks/assets/js/icons/library/chevron-up.js000064400000000373151335517650017475 0ustar00/**
 * External dependencies
 */
import { SVG } from 'wordpress-components';

const chevronUp = (
	<SVG viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
		<path d="M12 8l-6 5.4 1 1.2 5-4.6 5 4.6 1-1.2z" />
	</SVG>
);

export default chevronUp;
woocommerce-blocks/assets/js/icons/library/image.js000064400000000602151335517650016464 0ustar00/**
 * External dependencies
 */
import { SVG } from 'wordpress-components';

const image = (
	<SVG xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
		<path fill="none" d="M0 0h24v24H0V0z" />
		<path d="M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-4.86 8.86l-3 3.87L9 13.14 6 17h12l-3.86-5.14z" />
	</SVG>
);

export default image;
woocommerce-blocks/assets/js/icons/library/star.js000064400000000667151335517650016366 0ustar00/**
 * External dependencies
 */
import { SVG } from 'wordpress-components';

const star = (
	<SVG xmlns="http://www.w3.org/2000/SVG" viewBox="0 0 24 24">
		<path fill="none" d="M0 0h24v24H0V0z" />
		<path d="M22 9.24l-7.19-.62L12 2 9.19 8.63 2 9.24l5.46 4.73L5.82 21 12 17.27 18.18 21l-1.63-7.03L22 9.24zM12 15.4l-3.76 2.27 1-4.28-3.32-2.88 4.38-.38L12 6.1l1.71 4.04 4.38.38-3.32 2.88 1 4.28L12 15.4z" />
	</SVG>
);

export default star;
woocommerce-blocks/assets/js/icons/library/no-alt.js000064400000000776151335517650016610 0ustar00/**
 * External dependencies
 */
import { SVG } from 'wordpress-components';

const Component = ( { className, size, ...extraProps } ) => {
	return (
		<SVG
			xmlns="http://www.w3.org/2000/svg"
			viewBox="0 0 20 20"
			className={ className }
			width={ size }
			height={ size }
			{ ...extraProps }
		>
			<path d="M14.95 6.46L11.41 10l3.54 3.54-1.41 1.41L10 11.42l-3.53 3.53-1.42-1.42L8.58 10 5.05 6.47l1.42-1.42L10 8.58l3.54-3.53z" />
		</SVG>
	);
};

const noAlt = <Component />;

export default noAlt;
woocommerce-blocks/assets/js/icons/library/discussion.js000064400000000635151335517650017573 0ustar00/**
 * External dependencies
 */
import { SVG } from 'wordpress-components';

const discussion = (
	<SVG xmlns="http://www.w3.org/2000/SVG" viewBox="0 0 24 24">
		<path fill="none" d="M0 0h24v24H0V0z" />
		<path d="M15 4v7H5.17l-.59.59-.58.58V4h11m1-2H3c-.55 0-1 .45-1 1v14l4-4h10c.55 0 1-.45 1-1V3c0-.55-.45-1-1-1zm5 4h-2v9H6v2c0 .55.45 1 1 1h11l4 4V7c0-.55-.45-1-1-1z" />
	</SVG>
);

export default discussion;
woocommerce-blocks/assets/js/icons/library/thumb-up.js000064400000000764151335517650017154 0ustar00/**
 * External dependencies
 */
import { SVG } from 'wordpress-components';

const thumbUp = (
	<SVG xmlns="http://www.w3.org/2000/SVG" viewBox="0 0 24 24">
		<path opacity=".87" fill="none" d="M0 0h24v24H0V0z" />
		<path d="M21 8h-6.31l.95-4.57.03-.32c0-.41-.17-.79-.44-1.06L14.17 1 7.59 7.59C7.22 7.95 7 8.45 7 9v10c0 1.1.9 2 2 2h9c.83 0 1.54-.5 1.84-1.22l3.02-7.05c.09-.23.14-.47.14-.73v-2c0-1.1-.9-2-2-2zm0 4l-3 7H9V9l4.34-4.34L12.23 10H21v2zM1 9h4v12H1z" />
	</SVG>
);

export default thumbUp;
woocommerce-blocks/assets/js/icons/library/review.js000064400000000717151335517650016712 0ustar00/**
 * External dependencies
 */
import { SVG } from 'wordpress-components';

const review = (
	<SVG xmlns="http://www.w3.org/2000/SVG" viewBox="0 0 24 24">
		<path fill="none" d="M0 0h24v24H0V0z" />
		<path d="M20 2H4c-1.1 0-1.99.9-1.99 2L2 22l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm0 14H5.17l-.59.59-.58.58V4h16v12zm-9.5-2H18v-2h-5.5zm3.86-5.87c.2-.2.2-.51 0-.71l-1.77-1.77c-.2-.2-.51-.2-.71 0L6 11.53V14h2.47l5.89-5.87z" />
	</SVG>
);

export default review;
woocommerce-blocks/assets/js/icons/library/arrow-down-alt2.js000064400000000667151335517650020354 0ustar00/**
 * External dependencies
 */
import { SVG } from 'wordpress-components';

const Component = ( { className, size = 20, ...extraProps } ) => {
	return (
		<SVG
			xmlns="http://www.w3.org/2000/svg"
			viewBox="0 0 20 20"
			className={ className }
			width={ size }
			height={ size }
			{ ...extraProps }
		>
			<path d="M5 6l5 5 5-5 2 1-7 7-7-7z" />
		</SVG>
	);
};

const arrowDownAlt2 = <Component />;

export default arrowDownAlt2;
woocommerce-blocks/assets/js/icons/library/fields.js000064400000001562151335517650016656 0ustar00/**
 * External dependencies
 */
import { SVG } from 'wordpress-components';

const fields = (
	<SVG xmlns="http://www.w3.org/2000/SVG" viewBox="0 0 24 24" fill="none">
		<path
			stroke="currentColor"
			strokeWidth="1.5"
			fill="none"
			d="M5 3.75h14c.69 0 1.25.56 1.25 1.25v14c0 .69-.56 1.25-1.25 1.25H5c-.69 0-1.25-.56-1.25-1.25V5c0-.69.56-1.25 1.25-1.25z"
		/>
		<path
			fill="currentColor"
			fillRule="evenodd"
			d="M6.4 10.75c0-.47.38-.85.85-.85h9.5c.47 0 .85.38.85.85v1.5c0 .47-.38.85-.85.85h-9.5a.85.85 0 01-.85-.85v-1.5zm1.2.35v.8h8.8v-.8H7.6zM12.4 15.25c0-.47.38-.85.85-.85h3.5c.47 0 .85.38.85.85v1.5c0 .47-.38.85-.85.85h-3.5a.85.85 0 01-.85-.85v-1.5zm1.2.35v.8h2.8v-.8h-2.8zM6.5 15.9a.6.6 0 01.6-.6h2.8a.6.6 0 010 1.2H7.1a.6.6 0 01-.6-.6zM6.5 7.9a.6.6 0 01.6-.6h9.8a.6.6 0 110 1.2H7.1a.6.6 0 01-.6-.6z"
			clipRule="evenodd"
		/>
	</SVG>
);

export default fields;
woocommerce-blocks/assets/js/icons/library/notes.js000064400000001004151335517650016527 0ustar00/**
 * External dependencies
 */
import { SVG } from 'wordpress-components';

const notes = (
	<SVG xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16">
		<g fill="none" fillRule="evenodd">
			<path
				stroke="currentColor"
				strokeWidth="1.5"
				d="M2 .75h12c.69 0 1.25.56 1.25 1.25v12c0 .69-.56 1.25-1.25 1.25H2c-.69 0-1.25-.56-1.25-1.25V2C.75 1.31 1.31.75 2 .75z"
			/>
			<path
				fill="currentColor"
				d="M12 6H4V4.75h8zM12 9H4V7.75h8zM10 12H4v-1.25h6z"
			/>
		</g>
	</SVG>
);

export default notes;
woocommerce-blocks/assets/js/icons/library/totals.js000064400000001470151335517650016714 0ustar00/**
 * External dependencies
 */
import { SVG } from 'wordpress-components';

const totals = (
	<SVG xmlns="http://www.w3.org/2000/SVG" viewBox="0 0 24 24" fill="none">
		<path
			stroke="currentColor"
			strokeWidth="1.5"
			fill="none"
			d="M6 3.75h12c.69 0 1.25.56 1.25 1.25v14c0 .69-.56 1.25-1.25 1.25H6c-.69 0-1.25-.56-1.25-1.25V5c0-.69.56-1.25 1.25-1.25z"
		/>
		<path
			fill="currentColor"
			fillRule="evenodd"
			d="M6.9 7.5A1.1 1.1 0 018 6.4h8a1.1 1.1 0 011.1 1.1v2a1.1 1.1 0 01-1.1 1.1H8a1.1 1.1 0 01-1.1-1.1v-2zm1.2.1v1.8h7.8V7.6H8.1z"
			clipRule="evenodd"
		/>
		<path
			fill="currentColor"
			d="M8.5 12h1v1h-1v-1zM8.5 14h1v1h-1v-1zM8.5 16h1v1h-1v-1zM11.5 12h1v1h-1v-1zM11.5 14h1v1h-1v-1zM11.5 16h1v1h-1v-1zM14.5 12h1v1h-1v-1zM14.5 14h1v1h-1v-1zM14.5 16h1v1h-1v-1z"
		/>
	</SVG>
);

export default totals;
woocommerce-blocks/assets/js/icons/library/search.js000064400000000745151335517650016657 0ustar00/**
 * External dependencies
 */
import { SVG } from 'wordpress-components';

const search = (
	<SVG xmlns="http://www.w3.org/2000/SVG" viewBox="0 0 24 24">
		<path fill="none" d="M0 0h24v24H0V0z" />
		<path d="M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z" />
	</SVG>
);

export default search;
woocommerce-blocks/assets/js/icons/library/bank.js000064400000000475151335517650016325 0ustar00/**
 * External dependencies
 */
import { SVG } from 'wordpress-components';

const bank = (
	<SVG xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
		<path fill="none" d="M0 0h24v24H0z" />
		<path d="M4 10h3v7H4zM10.5 10h3v7h-3zM2 19h20v3H2zM17 10h3v7h-3zM12 1L2 6v2h20V6z" />
	</SVG>
);

export default bank;
woocommerce-blocks/assets/js/icons/library/asterisk.js000064400000001300151335517650017223 0ustar00/**
 * External dependencies
 */
import { SVG } from 'wordpress-components';

const asterisk = (
	<SVG xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16">
		<g fill="currentColor" fillRule="evenodd">
			<path d="M13.147 2.527c.288.279.295.739.015 1.027L9 7.84l4.449 4.581a.726.726 0 11-1.042 1.012l-4.42-4.55-4.419 4.55a.726.726 0 01-1.042-1.012l4.45-4.581L2.81 3.554a.726.726 0 011.042-1.012l4.133 4.256 4.134-4.256a.726.726 0 011.027-.015z" />
			<path d="M.467 7.915c0-.4.326-.726.727-.726H7.29l-.03-5.99a.726.726 0 011.452-.008l.031 5.998h6.229a.726.726 0 110 1.453H8.752l.033 6.328a.726.726 0 11-1.453.007L7.3 8.642H1.194a.726.726 0 01-.727-.727z" />
		</g>
	</SVG>
);

export default asterisk;
woocommerce-blocks/assets/js/icons/library/folder-starred.js000064400000000721151335517650020321 0ustar00/**
 * External dependencies
 */
import { SVG } from 'wordpress-components';

const folderStarred = (
	<SVG xmlns="http://www.w3.org/2000/SVG" viewBox="0 0 24 24">
		<path fill="none" d="M0 0h24v24H0V0z" />
		<path d="M20 6h-8l-2-2H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2zm0 12H4V6h5.17l2 2H20v10zm-6.92-3.96L12.39 17 15 15.47 17.61 17l-.69-2.96 2.3-1.99-3.03-.26L15 9l-1.19 2.79-3.03.26z" />
	</SVG>
);

export default folderStarred;
woocommerce-blocks/assets/js/icons/library/external.js000064400000001026151335517650017225 0ustar00/**
 * External dependencies
 */
import { SVG } from 'wordpress-components';

const external = (
	<SVG xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
		<mask
			id="external-mask"
			width="24"
			height="24"
			x="0"
			y="0"
			maskUnits="userSpaceOnUse"
		>
			<path
				fill="#fff"
				d="M6.3431 6.3431v1.994l7.8984.0072-8.6055 8.6054 1.4142 1.4143 8.6055-8.6055.0071 7.8984h1.994V6.3431H6.3431z"
			/>
		</mask>
		<g mask="url(#external-mask)">
			<path d="M0 0h24v24H0z" />
		</g>
	</SVG>
);

export default external;
woocommerce-blocks/assets/js/icons/library/address.js000064400000000735151335517650017036 0ustar00/**
 * External dependencies
 */
import { SVG } from 'wordpress-components';

const address = (
	<SVG xmlns="http://www.w3.org/2000/svg" viewBox="0 0 12 16">
		<path
			fill="currentColor"
			fillRule="evenodd"
			d="M5.6 0A5.596 5.596 0 000 5.6C0 9.8 5.6 16 5.6 16s5.6-6.2 5.6-10.4C11.2 2.504 8.696 0 5.6 0zm-4 5.6c0-2.208 1.792-4 4-4s4 1.792 4 4c0 2.304-2.304 5.752-4 7.904-1.664-2.136-4-5.624-4-7.904zm2 0a2 2 0 114 0 2 2 0 01-4 0z"
		/>
	</SVG>
);

export default address;
woocommerce-blocks/assets/js/icons/library/truck.js000064400000001020151335517650016525 0ustar00/**
 * External dependencies
 */
import { SVG } from 'wordpress-components';

const truck = (
	<SVG xmlns="http://www.w3.org/2000/svg" viewBox="0 0 17 13">
		<path
			fill="currentColor"
			fillRule="evenodd"
			d="M11.667 2.5h1.666l3.334 3.333V10H15a2.5 2.5 0 11-5 0H6.667a2.5 2.5 0 11-5 0H0V1.667C0 .746.746 0 1.667 0H10c.92 0 1.667.746 1.667 1.667V2.5zM2.917 10a1.25 1.25 0 102.5 0 1.25 1.25 0 00-2.5 0zm-1.25-2.5V1.667H10V7.5H1.667zM11.25 10a1.25 1.25 0 102.5 0 1.25 1.25 0 00-2.5 0z"
		/>
	</SVG>
);

export default truck;
woocommerce-blocks/assets/js/icons/library/reader.js000064400000000615151335517650016650 0ustar00/**
 * External dependencies
 */
import { SVG } from 'wordpress-components';

const reader = (
	<SVG xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
		<path fill="none" d="M0 0h24v24H0V0z" />
		<path d="M21 4H3a2 2 0 00-2 2v13c0 1.1.9 2 2 2h18a2 2 0 002-2V6a2 2 0 00-2-2zM3 19V6h8v13H3zm18 0h-8V6h8v13zm-7-9.5h6V11h-6zm0 2.5h6v1.5h-6zm0 2.5h6V16h-6z" />
	</SVG>
);

export default reader;
woocommerce-blocks/assets/js/icons/library/arrow-back.js000064400000000503151335517650017432 0ustar00/**
 * External dependencies
 */
import { SVG } from 'wordpress-components';

const arrowBack = (
	<SVG
		xmlns="http://www.w3.org/2000/svg"
		viewBox="0 0 24 24"
		width="24"
		height="24"
		fill="currentColor"
	>
		<path d="M20 11H7.8l5.6-5.6L12 4l-8 8 8 8 1.4-1.4L7.8 13H20v-2z" />
	</SVG>
);

export default arrowBack;
woocommerce-blocks/assets/js/icons/library/more.js000064400000000752151335517650016352 0ustar00/**
 * External dependencies
 */
import { SVG } from 'wordpress-components';

const more = (
	<SVG xmlns="http://www.w3.org/2000/SVG" viewBox="0 0 24 24">
		<path fill="none" d="M0 0h24v24H0V0z" />
		<path d="M22 3H7c-.69 0-1.23.35-1.59.88L0 12l5.41 8.11c.36.53.97.89 1.66.89H22c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 16H7.07L2.4 12l4.66-7H22v14z" />
		<circle cx="9" cy="12" r="1.5" />
		<circle cx="14" cy="12" r="1.5" />
		<circle cx="19" cy="12" r="1.5" />
	</SVG>
);

export default more;
woocommerce-blocks/assets/js/icons/library/toggle.js000064400000000700151335517650016662 0ustar00/**
 * External dependencies
 */
import { SVG } from 'wordpress-components';

const toggle = (
	<SVG xmlns="http://www.w3.org/2000/SVG" viewBox="0 0 24 24">
		<path fill="none" d="M0 0h24v24H0z" />
		<path d="M17 6H7c-3.31 0-6 2.69-6 6s2.69 6 6 6h10c3.31 0 6-2.69 6-6s-2.69-6-6-6zm0 10H7c-2.21 0-4-1.79-4-4s1.79-4 4-4h10c2.21 0 4 1.79 4 4s-1.79 4-4 4zm0-7c-1.66 0-3 1.34-3 3s1.34 3 3 3 3-1.34 3-3-1.34-3-3-3z" />
	</SVG>
);

export default toggle;
woocommerce-blocks/assets/js/icons/library/server.js000064400000001117151335517650016712 0ustar00/**
 * External dependencies
 */
import { SVG } from 'wordpress-components';

const server = (
	<SVG xmlns="http://www.w3.org/2000/SVG" viewBox="0 0 24 24">
		<path fill="none" d="M0 0h24v24H0V0z" />
		<path d="M19 15v4H5v-4h14m1-2H4c-.55 0-1 .45-1 1v6c0 .55.45 1 1 1h16c.55 0 1-.45 1-1v-6c0-.55-.45-1-1-1zM7 18.5c-.82 0-1.5-.67-1.5-1.5s.68-1.5 1.5-1.5 1.5.67 1.5 1.5-.67 1.5-1.5 1.5zM19 5v4H5V5h14m1-2H4c-.55 0-1 .45-1 1v6c0 .55.45 1 1 1h16c.55 0 1-.45 1-1V4c0-.55-.45-1-1-1zM7 8.5c-.82 0-1.5-.67-1.5-1.5S6.18 5.5 7 5.5s1.5.68 1.5 1.5S7.83 8.5 7 8.5z" />
	</SVG>
);

export default server;
woocommerce-blocks/assets/js/icons/library/list.js000064400000000646151335517650016365 0ustar00/**
 * External dependencies
 */
import { SVG } from 'wordpress-components';

const list = (
	<SVG xmlns="http://www.w3.org/2000/SVG" viewBox="0 0 24 24">
		<path fill="none" d="M0 0h24v24H0V0z" />
		<path d="M11 7h6v2h-6zm0 4h6v2h-6zm0 4h6v2h-6zM7 7h2v2H7zm0 4h2v2H7zm0 4h2v2H7zM20.1 3H3.9c-.5 0-.9.4-.9.9v16.2c0 .4.4.9.9.9h16.2c.4 0 .9-.5.9-.9V3.9c0-.5-.5-.9-.9-.9zM19 19H5V5h14v14z" />
	</SVG>
);

export default list;
woocommerce-blocks/assets/js/icons/library/form-step.js000064400000000643151335517650017323 0ustar00/**
 * External dependencies
 */
import { SVG } from 'wordpress-components';

const FormStep = (
	<SVG xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
		<g fillRule="evenodd">
			<path d="M20 6a1 1 0 011 1v13a1 1 0 01-1 1H4a1 1 0 01-1-1V7a1 1 0 011-1h16zm-1 2H5v11h14V8z" />
			<path d="M3 4h8v3H3zM18 10v3H6v-3h12zm-3 1H7v1h8v-1zM18 14v3H6v-3h12zm-3 1H7v1h8v-1z" />
		</g>
	</SVG>
);

export default FormStep;
woocommerce-blocks/assets/js/icons/library/box.js000064400000000741151335517650016176 0ustar00/**
 * External dependencies
 */
import { SVG } from 'wordpress-components';

const box = (
	<SVG xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
		<g fillRule="evenodd">
			<path d="M0 0h24v24H0z" fill="none" />
			<path
				fillRule="nonzero"
				d="M20.5 5.2l-1.4-1.7C19 3.3 18.5 3 18 3H6c-.5 0-.9.2-1.2.5L3.5 5.3A2 2 0 003 6.5V19c0 1.1.9 2 2 2h14a2 2 0 002-2V6.5c0-.5-.2-1-.5-1.3zM6.2 5h11.6l.8 1H5.4l.8-1zM5 19V8h14v11H5z"
			/>
		</g>
	</SVG>
);

export default box;
woocommerce-blocks/assets/js/icons/library/bill.js000064400000000730151335517650016326 0ustar00/**
 * External dependencies
 */
import { SVG } from 'wordpress-components';

const grid = (
	<SVG xmlns="http://www.w3.org/2000/SVG" viewBox="0 0 24 24">
		<path fill="none" d="M0 0h24v24H0V0z" />
		<path d="M11 17h2v-1h1c.55 0 1-.45 1-1v-3c0-.55-.45-1-1-1h-3v-1h4V8h-2V7h-2v1h-1c-.55 0-1 .45-1 1v3c0 .55.45 1 1 1h3v1H9v2h2v1zm9-13H4c-1.11 0-1.99.89-1.99 2L2 18c0 1.11.89 2 2 2h16c1.11 0 2-.89 2-2V6c0-1.11-.89-2-2-2zm0 14H4V6h16v12z" />
	</SVG>
);

export default grid;
woocommerce-blocks/assets/js/icons/library/filled-cart.js000064400000001147151335517650017575 0ustar00/**
 * External dependencies
 */
import { SVG } from 'wordpress-components';

const filledCart = (
	<SVG xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
		<g fill="none" fillRule="evenodd">
			<path d="M0 0h24v24H0z" />
			<path
				fill="currentColor"
				fillRule="nonzero"
				d="M15.55 13c.75 0 1.41-.41 1.75-1.03l3.58-6.49A.996.996 0 0 0 20.01 4H5.21l-.94-2H1v2h2l3.6 7.59-1.35 2.44C4.52 15.37 5.48 17 7 17h12v-2H7l1.1-2h7.45ZM7 18c-1.1 0-1.99.9-1.99 2S5.9 22 7 22s2-.9 2-2-.9-2-2-2Zm10 0c-1.1 0-1.99.9-1.99 2s.89 2 1.99 2 2-.9 2-2-.9-2-2-2Z"
			/>
		</g>{ ' ' }
	</SVG>
);

export default filledCart;
woocommerce-blocks/assets/js/icons/library/cart.js000064400000001043151335517650016333 0ustar00/**
 * External dependencies
 */
import { SVG } from 'wordpress-components';

const cart = (
	<SVG xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
		<path fill="none" d="M0 0h24v24H0V0z" />
		<path d="M15.55 13c.75 0 1.41-.41 1.75-1.03l3.58-6.49c.37-.66-.11-1.48-.87-1.48H5.21l-.94-2H1v2h2l3.6 7.59-1.35 2.44C4.52 15.37 5.48 17 7 17h12v-2H7l1.1-2h7.45zM6.16 6h12.15l-2.76 5H8.53L6.16 6zM7 18c-1.1 0-1.99.9-1.99 2S5.9 22 7 22s2-.9 2-2-.9-2-2-2zm10 0c-1.1 0-1.99.9-1.99 2s.89 2 1.99 2 2-.9 2-2-.9-2-2-2z" />
	</SVG>
);

export default cart;
woocommerce-blocks/assets/js/icons/library/tags.js000064400000001254151335517650016344 0ustar00/**
 * External dependencies
 */
import { SVG } from 'wordpress-components';

const tags = (
	<SVG xmlns="http://www.w3.org/2000/SVG" viewBox="0 0 24 24">
		<path fill="none" d="M0 0h24v24H0V0z" />
		<path d="M2.53 19.65l1.34.56v-9.03l-2.43 5.86c-.41 1.02.08 2.19 1.09 2.61zm19.5-3.7L17.07 3.98c-.31-.75-1.04-1.21-1.81-1.23-.26 0-.53.04-.79.15L7.1 5.95c-.75.31-1.21 1.03-1.23 1.8-.01.27.04.54.15.8l4.96 11.97c.31.76 1.05 1.22 1.83 1.23.26 0 .52-.05.77-.15l7.36-3.05c1.02-.42 1.51-1.59 1.09-2.6zm-9.2 3.8L7.87 7.79l7.35-3.04h.01l4.95 11.95-7.35 3.05z" />
		<circle cx="11" cy="9" r="1" />
		<path d="M5.88 19.75c0 1.1.9 2 2 2h1.45l-3.45-8.34v6.34z" />
	</SVG>
);

export default tags;
woocommerce-blocks/assets/js/icons/library/chevron-right.js000064400000000402151335517650020157 0ustar00/**
 * External dependencies
 */
import { SVG } from 'wordpress-components';

const chevronRight = (
	<SVG xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
		<path d="M10.6 6L9.4 7l4.6 5-4.6 5 1.2 1 5.4-6z" />
	</SVG>
);

export default chevronRight;
woocommerce-blocks/assets/js/icons/library/woo.js000064400000005162151335517650016214 0ustar00/**
 * External dependencies
 */
import { SVG } from 'wordpress-components';
import classnames from 'classnames';
const Component = ( { className, height, width, ...props } ) => {
	return (
		<SVG
			xmlns="http://www.w3.org/2000/svg"
			viewBox="0 0 245 145"
			className={ classnames( 'woo-icon', className ) }
			width={ width }
			height={ height }
			{ ...props }
		>
			<path
				fill="#96588A"
				d="M22.76 0h199.1a22.77 22.77 0 0 1 22.8 22.76v75.92a22.77 22.77 0 0 1-22.78 22.78h-71.41l9.77 24-43.13-24H22.76C10.1946 121.449.011 111.2654 0 98.7V22.76C.011 10.1946 10.1946.011 22.76 0z"
			/>
			<path
				fill="#FFF"
				fillRule="nonzero"
				d="M12.32 20.63a8.16 8.16 0 0 1 6.25-3.09c5.0733-.36 7.9867 2.0333 8.74 7.18 3.14 20.86 6.4933 38.5633 10.06 53.11l21.92-41.69c2-3.76 4.49-5.76 7.52-6 4.3867-.3067 7.13 2.49 8.23 8.39a186 186 0 0 0 9.47 34.23c2.62-25.38 7.0133-43.7133 13.18-55a7.73 7.73 0 0 1 6.6-4.43 8.8 8.8 0 0 1 6.32 2 7.75 7.75 0 0 1 3.05 5.74 8.52 8.52 0 0 1-1 4.77c-3.9 7.24-7.12 19.28-9.66 36.12-2.48 16.2533-3.3967 28.9633-2.75 38.13a12.25 12.25 0 0 1-1.16 6.56 6.32 6.32 0 0 1-5.33 3.53c-2.6667.18-5.3033-1.0567-7.91-3.71-9.2933-9.54-16.6567-23.7267-22.09-42.56C57.3 76.7167 52.48 86.3333 49.3 92.76c-5.86 11.3333-10.89 17.13-15.09 17.39-2.7333.1933-5.0667-2.0933-7-6.86-5.1-13.0933-10.5833-38.4033-16.45-75.93a8.56 8.56 0 0 1 1.56-6.73zM227.23 36.34a23.17 23.17 0 0 0-16-11.59 26.25 26.25 0 0 0-5.42-.58c-9.5867 0-17.41 5-23.47 15a53 53 0 0 0-7.78 28.16c0 7.7333 1.6167 14.3333 4.85 19.8a23.15 23.15 0 0 0 16 11.59 26.28 26.28 0 0 0 5.42.59c9.68 0 17.5033-5 23.47-15A53.89 53.89 0 0 0 232.08 56c0-7.7333-1.6167-14.2867-4.85-19.66zm-12.61 27.72c-1.3733 6.56-3.9167 11.5-7.63 14.82-2.9267 2.6667-5.6133 3.7433-8.06 3.23-2.4467-.5133-4.4033-2.6667-5.87-6.46a25.68 25.68 0 0 1-1.76-9.09 35.9 35.9 0 0 1 .73-7.34 33 33 0 0 1 5.28-11.88c3.3333-4.8933 6.8067-6.9467 10.42-6.16 2.44.4867 4.3933 2.64 5.86 6.46a25.68 25.68 0 0 1 1.76 9.12 35.73 35.73 0 0 1-.73 7.33v-.03zM164.57 36.34a23.2 23.2 0 0 0-16-11.59 26.42 26.42 0 0 0-5.43-.58c-9.5933 0-17.4167 5-23.47 15a53 53 0 0 0-7.78 28.16c0 7.7333 1.6133 14.3333 4.84 19.8a23.19 23.19 0 0 0 16 11.59 26.44 26.44 0 0 0 5.43.59c9.68 0 17.5033-5 23.47-15A53.88 53.88 0 0 0 169.4 56c0-7.7333-1.6133-14.2867-4.84-19.66h.01zm-12.61 27.72c-1.3667 6.56-3.91 11.5-7.63 14.82-2.93 2.64-5.63 3.72-8.07 3.23-2.44-.49-4.4-2.64-5.86-6.46a25.7 25.7 0 0 1-1.77-9.09 35.9 35.9 0 0 1 .74-7.34 33 33 0 0 1 5.28-11.88c3.3333-4.8933 6.8067-6.9467 10.42-6.16 2.44.4867 4.3933 2.64 5.86 6.46a25.91 25.91 0 0 1 1.76 9.12 35.73 35.73 0 0 1-.73 7.33v-.03z"
			/>
		</SVG>
	);
};

const woo = <Component />;

export default woo;
woocommerce-blocks/assets/js/icons/library/remove-cart.js000064400000000762151335517650017635 0ustar00/**
 * External dependencies
 */
import { SVG } from 'wordpress-components';

const removeCart = (
	<SVG xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
		<path d="M22.7 22.7l-20-20L2 2l-.7-.7L0 2.5 4.4 7l2.2 4.7L5.2 14A2 2 0 007 17h7.5l1.3 1.4a2 2 0 102.8 2.8l2.9 2.8 1.2-1.3zM7.4 15a.2.2 0 01-.2-.3l.9-1.7h2.4l2 2h-5zm8.2-2a2 2 0 001.7-1l3.6-6.5.1-.5c0-.6-.4-1-1-1H6.5l9 9zM7 18a2 2 0 100 4 2 2 0 000-4z" />
		<path fill="none" d="M0 0h24v24H0z" />
	</SVG>
);

export default removeCart;
woocommerce-blocks/assets/js/icons/library/grid.js000064400000000574151335517650016337 0ustar00/**
 * External dependencies
 */
import { SVG } from 'wordpress-components';

const grid = (
	<SVG xmlns="http://www.w3.org/2000/SVG" viewBox="0 0 24 24">
		<path fill="none" d="M0 0h24v24H0V0z" />
		<path d="M4 8h4V4H4v4zm6 12h4v-4h-4v4zm-6 0h4v-4H4v4zm0-6h4v-4H4v4zm6 0h4v-4h-4v4zm6-10v4h4V4h-4zm-6 4h4V4h-4v4zm6 6h4v-4h-4v4zm0 6h4v-4h-4v4z" />
	</SVG>
);

export default grid;
woocommerce-blocks/assets/js/icons/library/check-payment.js000064400000001377151335517650020144 0ustar00/**
 * External dependencies
 */
import { SVG } from 'wordpress-components';

const checkPayment = (
	<SVG xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
		<g fill="none" fillRule="evenodd">
			<path d="M0 0h24v24H0z" />
			<path
				fill="#000"
				fillRule="nonzero"
				d="M17.3 8v1c1 .2 1.4.9 1.4 1.7h-1c0-.6-.3-1-1-1-.8 0-1.3.4-1.3.9 0 .4.3.6 1.4 1 1 .2 2 .6 2 1.9 0 .9-.6 1.4-1.5 1.5v1H16v-1c-.9-.1-1.6-.7-1.7-1.7h1c0 .6.4 1 1.3 1 1 0 1.2-.5 1.2-.8 0-.4-.2-.8-1.3-1.1-1.3-.3-2.1-.8-2.1-1.8 0-.9.7-1.5 1.6-1.6V8h1.3zM12 10v1H6v-1h6zm2-2v1H6V8h8zM2 4v16h20V4H2zm2 14V6h16v12H4z"
			/>
			<path
				stroke="#000"
				strokeLinecap="round"
				d="M6 16c2.6 0 3.9-3 1.7-3-2 0-1 3 1.5 3 1 0 1-.8 2.8-.8"
			/>
		</g>
	</SVG>
);

export default checkPayment;
woocommerce-blocks/assets/js/icons/library/barcode.js000064400000000462151335517650017005 0ustar00/**
 * External dependencies
 */
import { SVG } from 'wordpress-components';

const barcode = (
	<SVG xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
		<path d="M2 6h2v12H2V6m3 0h1v12H5V6m2 0h3v12H7V6m4 0h1v12h-1V6m3 0h2v12h-2V6m3 0h3v12h-3V6m4 0h1v12h-1V6z" />
	</SVG>
);

export default barcode;
woocommerce-blocks/assets/js/icons/library/comment.js000064400000000613151335517650017046 0ustar00/**
 * External dependencies
 */
import { SVG } from 'wordpress-components';

const comment = (
	<SVG xmlns="http://www.w3.org/2000/SVG" viewBox="0 0 24 24">
		<path fill="none" d="M0 0h24v24H0V0z" />
		<path d="M21.99 4c0-1.1-.89-2-1.99-2H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h14l4 4-.01-18zM20 4v13.17L18.83 16H4V4h16zM6 12h12v2H6zm0-3h12v2H6zm0-3h12v2H6z" />
	</SVG>
);

export default comment;
woocommerce-blocks/assets/js/icons/library/done.js000064400000000447151335517650016336 0ustar00/**
 * External dependencies
 */
import { SVG } from 'wordpress-components';

const done = (
	<SVG xmlns="http://www.w3.org/2000/SVG" viewBox="0 0 24 24">
		<path fill="none" d="M0 0h24v24H0z" />
		<path d="M9 16.2L4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4L9 16.2z" />
	</SVG>
);

export default done;
woocommerce-blocks/assets/js/icons/library/restore.js000064400000000560151335517650017070 0ustar00/**
 * External dependencies
 */
import { SVG } from 'wordpress-components';

const restore = (
	<SVG xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
		<path fill="none" d="M0 0h24v24H0z" />
		<path d="M14 12c0-1.1-.9-2-2-2s-2 .9-2 2 .9 2 2 2 2-.9 2-2zm-2-9c-5 0-9 4-9 9H0l4 4 4-4H5a7 7 0 113 5.7l-1.5 1.4A9 9 0 1012 3z" />
	</SVG>
);

export default restore;
woocommerce-blocks/assets/js/icons/library/card.js000064400000000615151335517650016317 0ustar00/**
 * External dependencies
 */
import { SVG } from 'wordpress-components';

const card = (
	<SVG xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
		<path fill="none" d="M0 0h24v24H0V0z" />
		<path
			fill="currentColor"
			d="M20 4H4c-1.11 0-1.99.89-1.99 2L2 18c0 1.11.89 2 2 2h16c1.11 0 2-.89 2-2V6c0-1.11-.89-2-2-2zm0 14H4v-6h16v6zm0-10H4V6h16v2z"
		/>
	</SVG>
);

export default card;
woocommerce-blocks/assets/js/icons/library/chevron-down.js000064400000000401151335517650020010 0ustar00/**
 * External dependencies
 */
import { SVG } from 'wordpress-components';

const chevronDown = (
	<SVG viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
		<path d="M17 9.4L12 14 7 9.4l-1 1.2 6 5.4 6-5.4z" />
	</SVG>
);

export default chevronDown;
woocommerce-blocks/assets/js/icons/library/stonks.js000064400000000511151335517650016722 0ustar00/**
 * External dependencies
 */
import { SVG } from 'wordpress-components';
// 🤫
const stonks = (
	<SVG xmlns="http://www.w3.org/2000/SVG" viewBox="0 0 24 24">
		<path fill="none" d="M0 0h24v24H0V0z" />
		<path d="M3.5 18.49l6-6.01 4 4L22 6.92l-1.41-1.41-7.09 7.97-4-4L2 16.99l1.5 1.5z" />
	</SVG>
);

export default stonks;
woocommerce-blocks/assets/js/icons/library/exclamation.js000064400000001224151335517650017707 0ustar00/**
 * External dependencies
 */
import { SVG } from 'wordpress-components';

const exclamation = (
	<SVG xmlns="http://www.w3.org/2000/SVG" viewBox="0 0 24 24">
		<path fill="none" d="M0 0h24v24H0V0z" />
		<path d="M23 12l-2.44-2.78.34-3.68-3.61-.82-1.89-3.18L12 3 8.6 1.54 6.71 4.72l-3.61.81.34 3.68L1 12l2.44 2.78-.34 3.69 3.61.82 1.89 3.18L12 21l3.4 1.46 1.89-3.18 3.61-.82-.34-3.68L23 12zm-4.51 2.11l.26 2.79-2.74.62-1.43 2.41L12 18.82l-2.58 1.11-1.43-2.41-2.74-.62.26-2.8L3.66 12l1.85-2.12-.26-2.78 2.74-.61 1.43-2.41L12 5.18l2.58-1.11 1.43 2.41 2.74.62-.26 2.79L20.34 12l-1.85 2.11zM11 15h2v2h-2zm0-8h2v6h-2z" />
	</SVG>
);

export default exclamation;
woocommerce-blocks/assets/js/icons/library/radio-selected.js000064400000000652151335517650020273 0ustar00/**
 * External dependencies
 */
import { SVG } from 'wordpress-components';

const radioSelected = (
	<SVG xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
		<path
			fill="#1E8CBE"
			d="M12 7c-2.76 0-5 2.24-5 5s2.24 5 5 5 5-2.24 5-5-2.24-5-5-5zm0-5C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"
		/>
	</SVG>
);

export default radioSelected;
woocommerce-blocks/assets/js/icons/library/notice.js000064400000000460151335517650016665 0ustar00/**
 * External dependencies
 */
import { SVG } from 'wordpress-components';

const notice = (
	<SVG xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
		<path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z" />
	</SVG>
);

export default notice;
woocommerce-blocks/assets/js/icons/library/folder.js000064400000000546151335517650016664 0ustar00/**
 * External dependencies
 */
import { SVG } from 'wordpress-components';

const folder = (
	<SVG xmlns="http://www.w3.org/2000/SVG" viewBox="0 0 24 24">
		<path fill="none" d="M0 0h24v24H0V0z" />
		<path d="M20 6h-8l-2-2H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2zm0 12H4V8h16v10z" />
	</SVG>
);

export default folder;
woocommerce-blocks/assets/js/icons/library/heading.js000064400000000372151335517650017005 0ustar00/**
 * External dependencies
 */
import { SVG } from 'wordpress-components';

const heading = (
	<SVG xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
		<path d="M7 6L7 17L12 12.875L17 17L17 6L12 6L7 6Z" />
	</SVG>
);

export default heading;
woocommerce-blocks/assets/js/icons/library/tag.js000064400000001260151335517650016156 0ustar00/**
 * External dependencies
 */
import { SVG } from 'wordpress-components';

const tag = (
	<SVG xmlns="http://www.w3.org/2000/SVG" viewBox="0 0 24 24">
		<path fill="none" d="M0 0h24v24H0V0z" />
		<path d="M21.41 11.58l-9-9C12.05 2.22 11.55 2 11 2H4c-1.1 0-2 .9-2 2v7c0 .55.22 1.05.59 1.42l9 9c.36.36.86.58 1.41.58s1.05-.22 1.41-.59l7-7c.37-.36.59-.86.59-1.41s-.23-1.06-.59-1.42zM13 20.01L4 11V4h7v-.01l9 9-7 7.02z" />
		<circle cx="6.5" cy="6.5" r="1.5" />
		<path d="M8.9 12.55c0 .57.23 1.07.6 1.45l3.5 3.5 3.5-3.5c.37-.37.6-.89.6-1.45 0-1.13-.92-2.05-2.05-2.05-.57 0-1.08.23-1.45.6l-.6.6-.6-.59c-.37-.38-.89-.61-1.45-.61-1.13 0-2.05.92-2.05 2.05z" />
	</SVG>
);

export default tag;
woocommerce-blocks/assets/js/icons/library/radio-unselected.js000064400000000565151335517650020641 0ustar00/**
 * External dependencies
 */
import { SVG } from 'wordpress-components';

const radioUnselected = (
	<SVG xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
		<path
			fill="#757575"
			d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"
		/>
	</SVG>
);

export default radioUnselected;
woocommerce-blocks/assets/js/icons/library/contact.js000064400000001664151335517650017046 0ustar00/**
 * External dependencies
 */
import { SVG } from 'wordpress-components';

const contact = (
	<SVG xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 16">
		<g fill="none" fillRule="evenodd">
			<path
				stroke="currentColor"
				strokeWidth="1.5"
				d="M2 .75h16c.69 0 1.25.56 1.25 1.25v12c0 .69-.56 1.25-1.25 1.25H2c-.69 0-1.25-.56-1.25-1.25V2C.75 1.31 1.31.75 2 .75z"
			/>
			<path
				fill="currentColor"
				d="M7.667 7.667A2.34 2.34 0 0010 5.333 2.34 2.34 0 007.667 3a2.34 2.34 0 00-2.334 2.333 2.34 2.34 0 002.334 2.334zM11.556 3H17v3.889h-5.444V3zm2.722 2.916l1.944-1.36v-.779L14.278 5.14l-1.945-1.362v.778l1.945 1.361zm-5.834-.583a.78.78 0 00-.777-.777.78.78 0 00-.778.777c0 .428.35.778.778.778a.78.78 0 00.777-.778zm3.89 5.904c0-1.945-3.088-2.785-4.667-2.785-1.58 0-4.667.84-4.667 2.785v1.097h9.333v-1.097zM7.666 10c-1.012 0-2.163.389-2.738.778h5.475C9.821 10.38 8.678 10 7.667 10z"
			/>
		</g>
	</SVG>
);

export default contact;
woocommerce-blocks/assets/js/icons/icon/index.tsx000064400000001045151335517650016201 0ustar00/**
 * External dependencies
 */
import { cloneElement, isValidElement } from '@wordpress/element';
import type { HTMLProps, ReactElement } from 'react';

interface IconProps {
	srcElement?: ReactElement;
	size?: number;
	className?: string;
}

function Icon( {
	srcElement,
	size = 24,
	...props
}: IconProps &
	HTMLProps< HTMLImageElement | SVGElement > ): ReactElement | null {
	if ( ! isValidElement( srcElement ) ) {
		return null;
	}
	return cloneElement( srcElement, {
		width: size,
		height: size,
		...props,
	} );
}

export default Icon;
woocommerce-blocks/assets/js/types/type-guards/index.ts000064400000001663151335517650017364 0ustar00export const isNull = < T >( term: T | null ): term is null => {
	return term === null;
};

export const isNumber = < U >( term: number | U ): term is number => {
	return typeof term === 'number';
};

export const isString = < U >( term: string | U ): term is string => {
	return typeof term === 'string';
};

export const isObject = < T extends Record< string, unknown >, U >(
	term: T | U
): term is NonNullable< T > => {
	return (
		! isNull( term ) &&
		term instanceof Object &&
		term.constructor === Object
	);
};

export function objectHasProp< P extends PropertyKey >(
	target: unknown,
	property: P
): target is { [ K in P ]: unknown } {
	// The `in` operator throws a `TypeError` for non-object values.
	return isObject( target ) && property in target;
}

// eslint-disable-next-line @typescript-eslint/ban-types
export const isFunction = < T extends Function, U >(
	term: T | U
): term is T => {
	return typeof term === 'function';
};
woocommerce-blocks/assets/js/types/type-guards/test/index.ts000064400000000726151335517650020342 0ustar00/**
 * External dependencies
 */
import { isObject } from '@woocommerce/types';

describe( 'type-guards', () => {
	describe( 'Testing isObject()', () => {
		it( 'Correctly identifies an object', () => {
			expect( isObject( {} ) ).toBe( true );
			expect( isObject( { test: 'object' } ) ).toBe( true );
		} );
		it( 'Correctly rejects object-like things', () => {
			expect( isObject( [] ) ).toBe( false );
			expect( isObject( null ) ).toBe( false );
		} );
	} );
} );
woocommerce-blocks/assets/js/types/index.ts000064400000000074151335517650015113 0ustar00export * from './type-defs';
export * from './type-guards';
woocommerce-blocks/assets/js/types/type-defs/shipping.ts000064400000000421151335517650017521 0ustar00/**
 * External dependencies
 */
import type { ReactElement } from 'react';

export interface PackageRateOption {
	label: string;
	value: string;
	description?: string | ReactElement;
	secondaryLabel?: string | ReactElement;
	secondaryDescription?: string;
	id?: string;
}
woocommerce-blocks/assets/js/types/type-defs/contexts.ts000064400000000660151335517650017554 0ustar00export type ValidationContextError = {
	message: string;
	hidden: boolean;
};

export type ValidationData = {
	hasValidationErrors: boolean;
	getValidationError: ( validationErrorId: string ) => ValidationContextError;
	clearValidationError: ( validationErrorId: string ) => void;
	hideValidationError: ( validationErrorId: string ) => void;
	setValidationErrors: (
		errors: Record< string, ValidationContextError >
	) => void;
};
woocommerce-blocks/assets/js/types/type-defs/index.ts000064400000000311151335517650017005 0ustar00export * from './cart-response';
export * from './product-response';
export * from './cart';
export * from './hooks';
export * from './currency';
export * from './payments';
export * from './objects';
woocommerce-blocks/assets/js/types/type-defs/address-fields.js000064400000001722151335517650020564 0ustar00/**
 * @typedef {Object} AddressField
 *
 * @property {string} label         The label for the field.
 * @property {string} optionalLabel The label for the field if made optional.
 * @property {string} autocomplete  The HTML autocomplete attribute value. See
 *                                  https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete
 * @property {boolean} required     Set to true if the field is required.
 * @property {boolean} hidden       Set to true if the field should not be
 *                                  rendered.
 * @property {number}  index        Fields will be sorted and render in this
 *                                  order, lowest to highest.
 */

/**
 * @typedef {string} CountryCode ISO 3166 Country code.
 */

/**
 * @typedef {string} AddressFieldKey Key for an address field, e.g. first_name.
 */

/**
 * @typedef {Object <CountryCode, Object <AddressFieldKey, AddressField>>} CountryAddressFields
 */

export {};
woocommerce-blocks/assets/js/types/type-defs/add-to-cart-form.js000064400000005673151335517650020744 0ustar00/**
 * @typedef {Object} AddToCartFormDispatchActions
 *
 * @property {function():void}         resetForm          Dispatches an action that resets the form to a
 *                                                        pristine state.
 * @property {function():void}         submitForm         Dispatches an action that tells the form to submit.
 * @property {function(number):void}   setQuantity        Dispatches an action that sets the quantity to
 *                                                        the given value.
 * @property {function(Object):void}   setRequestParams   Dispatches an action that sets params for the
 *                                                        add to cart request (key value pairs).
 * @property {function(boolean=):void} setHasError        Dispatches an action that sets the status to
 *                                                        having an error.
 * @property {function(Object):void}   setAfterProcessing Dispatches an action that sets the status to
 *                                                        after processing and also sets the response
 *                                                        data accordingly.
 */

/**
 * @typedef {Object} AddToCartFormEventRegistration
 *
 * @property {function(function():boolean|Object,number=):function():void} onAddToCartAfterProcessingWithSuccess Used to register a callback that will fire after form has been processed and there are no errors.
 * @property {function(function():boolean|Object,number=):function():void} onAddToCartAfterProcessingWithError   Used to register a callback that will fire when the form has been processed and has an error.
 * @property {function(function():boolean|Object,number=):function():void} onAddToCartBeforeProcessing           Used to register a callback that will fire when the form has been submitted before being sent off to the server.
 */

/**
 * @typedef {Object} AddToCartFormStatusConstants
 *
 * @property {string} PRISTINE                   Form is in it's initialized state.
 * @property {string} IDLE                       When form state has changed but there is no
 *                                               activity happening.
 * @property {string} DISABLED                   If the form cannot be submitted due to missing
 *                                               constraints, this status is assigned.
 * @property {string} BEFORE_PROCESSING          This is the state before form processing
 *                                               begins after the add to cart button has been
 *                                               pressed. Validation occurs at point point.
 * @property {string} PROCESSING                 After BEFORE_PROCESSING status emitters have
 *                                               finished successfully.
 * @property {string} AFTER_PROCESSING           After server side processing is completed
 *                                               this status is set.
 */

export {};
woocommerce-blocks/assets/js/types/type-defs/cart.ts000064400000010242151335517650016633 0ustar00/**
 * Internal dependencies
 */
import {
	MetaKeyValue,
	ShippingRateItem,
	ExtensionsData,
} from './cart-response';

export interface CurrencyInfo {
	currency_code: string;
	currency_symbol: string;
	currency_minor_unit: number;
	currency_decimal_separator: string;
	currency_thousand_separator: string;
	currency_prefix: string;
	currency_suffix: string;
}

export interface CartTotalsItem extends CurrencyInfo {
	total_discount: string;
	total_discount_tax: string;
}

export interface CartCouponItem {
	code: string;
	label: string;
	discount_type: string;
	totals: CartTotalsItem;
}

export interface FirstNameLastName {
	first_name: string;
	last_name: string;
}

export interface BaseAddress {
	address_1: string;
	address_2: string;
	city: string;
	state: string;
	postcode: string;
	country: string;
}

export interface CartShippingPackageShippingRate extends CurrencyInfo {
	rate_id: string;
	name: string;
	description: string;
	delivery_time: string;
	price: string;
	taxes: string;
	instance_id: number;
	method_id: string;
	meta_data: Array< MetaKeyValue >;
	selected: boolean;
}

export interface CartShippingRate {
	package_id: number;
	name: string;
	destination: BaseAddress;
	items: Array< ShippingRateItem >;
	shipping_rates: Array< CartShippingPackageShippingRate >;
}

export interface CartShippingAddress extends BaseAddress, FirstNameLastName {
	company: string;
	phone: string;
}

export interface CartBillingAddress extends CartShippingAddress {
	email: string;
}

export interface CartImageItem {
	id: number;
	src: string;
	thumbnail: string;
	srcset: string;
	sizes: string;
	name: string;
	alt: string;
}

export interface CartVariationItem {
	attribute: string;
	value: string;
}

export interface CartItemPrices extends CurrencyInfo {
	price: string;
	regular_price: string;
	sale_price: string;
	price_range: null | { min_amount: string; max_amount: string };
	raw_prices: {
		precision: number;
		price: string;
		regular_price: string;
		sale_price: string;
	};
}

export interface CartItemTotals extends CurrencyInfo {
	line_subtotal: string;
	line_subtotal_tax: string;
	line_total: string;
	line_total_tax: string;
}

export type CatalogVisibility = 'catalog' | 'hidden' | 'search' | 'visible';

export interface CartItem {
	key: string;
	id: number;
	quantity: number;
	catalog_visibility: CatalogVisibility;
	quantity_limit: number;
	name: string;
	summary: string;
	short_description: string;
	description: string;
	sku: string;
	low_stock_remaining: null | number;
	backorders_allowed: boolean;
	show_backorder_badge: boolean;
	sold_individually: boolean;
	permalink: string;
	images: Array< CartImageItem >;
	variation: Array< CartVariationItem >;
	prices: CartItemPrices;
	totals: CartItemTotals;
	extensions: ExtensionsData;
	item_data: Record< string, unknown >[];
}

export interface CartTotalsTaxLineItem {
	name: string;
	price: string;
	rate: string;
}

export interface CartFeeItemTotals extends CurrencyInfo {
	total: string;
	total_tax: string;
}

export interface CartFeeItem {
	id: string;
	name: string;
	totals: CartFeeItemTotals;
}

export interface CartTotals extends CurrencyInfo {
	total_items: string;
	total_items_tax: string;
	total_fees: string;
	total_fees_tax: string;
	total_discount: string;
	total_discount_tax: string;
	total_shipping: string;
	total_shipping_tax: string;
	total_price: string;
	total_tax: string;
	tax_lines: Array< CartTotalsTaxLineItem >;
}

export interface CartErrorItem {
	code: string;
	message: string;
}

export interface Cart {
	coupons: Array< CartCouponItem >;
	shippingRates: Array< CartShippingRate >;
	shippingAddress: CartShippingAddress;
	billingAddress: CartBillingAddress;
	items: Array< CartItem >;
	itemsCount: number;
	itemsWeight: number;
	needsPayment: boolean;
	needsShipping: boolean;
	hasCalculatedShipping: boolean;
	fees: Array< CartFeeItem >;
	totals: CartTotals;
	errors: Array< CartErrorItem >;
	paymentRequirements: Array< unknown >;
	extensions: ExtensionsData;
}
export interface CartMeta {
	updatingCustomerData: boolean;
	updatingSelectedRate: boolean;
	isCartDataStale: boolean;
	applyingCoupon: string;
	removingCoupon: string;
}
export interface ExtensionCartUpdateArgs {
	data: Record< string, unknown >;
	namespace: string;
}
woocommerce-blocks/assets/js/types/type-defs/payments.ts000064400000007241151335517650017547 0ustar00/**
 * External dependencies
 */
import type { ReactNode } from 'react';

/**
 * Internal dependencies
 */
import type { CartTotals, Cart } from './cart';
import {
	CartResponseBillingAddress,
	CartResponseShippingAddress,
} from './cart-response';
import type { EmptyObjectType } from './objects';

export interface SupportsConfiguration {
	showSavedCards?: boolean;
	showSaveOption?: boolean;
	features?: string[];
	// Deprecated, in favour of showSavedCards and showSaveOption
	savePaymentInfo?: boolean;
}

// we assign a value in the class for supports.features
export interface Supports extends SupportsConfiguration {
	features: string[];
}

export interface CanMakePaymentArgument {
	cart: Cart;
	cartTotals: CartTotals;
	cartNeedsShipping: boolean;
	billingData: CartResponseBillingAddress;
	shippingAddress: CartResponseShippingAddress;
	selectedShippingMethods: Record< string, unknown >;
	paymentRequirements: Array< string >;
}

export type CanMakePaymentReturnType =
	| boolean
	| Promise< boolean | { error: { message: string } } >;

export type CanMakePaymentCallback = (
	cartData: CanMakePaymentArgument
) => CanMakePaymentReturnType;

export type CanMakePaymentExtensionCallback = (
	cartData: CanMakePaymentArgument
) => boolean;

export interface PaymentMethodIcon {
	id: string;
	src: string | null;
	alt: string;
}

export type PaymentMethodIcons = ( PaymentMethodIcon | string )[];

export interface PaymentMethodConfiguration {
	// A unique string to identify the payment method client side.
	name: string;
	// A react node for your payment method UI.
	content: ReactNode;
	// A react node to display a preview of your payment method in the editor.
	edit: ReactNode;
	// A callback to determine whether the payment method should be shown in the checkout.
	canMakePayment: CanMakePaymentCallback;
	// A unique string to represent the payment method server side. If not provided, defaults to name.
	paymentMethodId?: string;
	// Object that describes various features provided by the payment method.
	supports: SupportsConfiguration;
	// Array of card types (brands) supported by the payment method. (See stripe/credit-card for example.)
	icons?: null | PaymentMethodIcons;
	// A react node that will be used as a label for the payment method in the checkout.
	label: ReactNode;
	// An accessibility label. Screen readers will output this label when the payment method is selected.
	ariaLabel: string;
	// Optionally customize the label text for the checkout submit (`Place Order`) button.
	placeOrderButtonLabel?: string;
	// A React node that contains logic handling any processing your payment method has to do with saved payment methods if your payment method supports them
	savedTokenComponent?: ReactNode | null;
}

export type ExpressPaymentMethodConfiguration = Omit<
	PaymentMethodConfiguration,
	'icons' | 'label' | 'ariaLabel' | 'placeOrderButtonLabel'
>;

export type PaymentMethods =
	| Record< string, PaymentMethodConfigInstance >
	| EmptyObjectType;

export type ExpressPaymentMethods =
	| Record< string, ExpressPaymentMethodConfigInstance >
	| EmptyObjectType;

export interface PaymentMethodConfigInstance {
	name: string;
	content: ReactNode;
	edit: ReactNode;
	paymentMethodId?: string;
	supports: Supports;
	icons: null | PaymentMethodIcons;
	label: ReactNode;
	ariaLabel: string;
	placeOrderButtonLabel?: string;
	savedTokenComponent?: ReactNode | null;
	canMakePaymentFromConfig: CanMakePaymentCallback;
	canMakePayment: CanMakePaymentCallback;
}

export interface ExpressPaymentMethodConfigInstance {
	name: string;
	content: ReactNode;
	edit: ReactNode;
	paymentMethodId?: string;
	supports: Supports;
	canMakePaymentFromConfig: CanMakePaymentCallback;
	canMakePayment: CanMakePaymentCallback;
}
woocommerce-blocks/assets/js/types/type-defs/shipping.js000064400000001255151335517650017515 0ustar00/**
 * @typedef {Object} ShippingAddress
 *
 * @property {string} first_name First name of recipient
 * @property {string} last_name  Last name of recipient
 * @property {string} company    Company name for the shipping address
 * @property {string} address_1  First line of the shipping address
 * @property {string} address_2  Second line of the shipping address
 * @property {string} city       The city of the shipping address
 * @property {string} state      The state of the shipping address (ISO or name)
 * @property {string} postcode   The postal or zip code for the shipping address
 * @property {string} country    The country for the shipping address (ISO)
 */

export {};
woocommerce-blocks/assets/js/types/type-defs/cart.js000064400000030714151335517650016627 0ustar00/**
 * @typedef {import('./shipping').ShippingAddress} CartShippingAddress
 */

/**
 * @typedef {Object} CartTotalItem
 *
 * @property {string} label        Label for total item
 * @property {number} value        The value of the total item (in subunits).
 * @property {number} valueWithTax The value of the total item with tax
 *                                 included (in subunits).
 */

/**
 * @typedef {Object} CartShippingOption
 *
 * @property {string} name          Name of the shipping rate
 * @property {string} description   Description of the shipping rate.
 * @property {string} price         Price of the shipping rate (in subunits)
 * @property {string} rate_id       The ID of the shipping rate.
 * @property {string} delivery_time The delivery time of the shipping rate
 */

/**
 * @typedef {Object} CartItemImage
 *
 * @property {number} id        Image id.
 * @property {string} src       Full size image URL.
 * @property {string} thumbnail Thumbnail URL.
 * @property {string} srcset    Thumbnail srcset for responsive image.
 * @property {string} sizes     Thumbnail sizes for responsive images.
 * @property {string} name      Image name.
 * @property {string} alt       Image alternative text.
 */

/**
 * @typedef {Object} CartItemVariation
 *
 * @property {string} attribute Variation attribute name.
 * @property {string} value     Variation attribute value.
 */

/**
 * @typedef {Object} CartItemTotals
 *
 * @property {string} currency_code               The ISO code for the currency.
 * @property {number} currency_minor_unit         The precision (decimal
 *                                                places).
 * @property {string} currency_symbol             The symbol for the currency
 *                                                (eg '$')
 * @property {string} currency_prefix             Price prefix for the currency
 *                                                which can be used to format
 *                                                returned prices.
 * @property {string} currency_suffix             Price suffix for the currency
 *                                                which can be used to format
 *                                                returned prices.
 * @property {string} currency_decimal_separator  The string used for the
 *                                                decimal separator.
 * @property {string} currency_thousand_separator The string used for the
 *                                                thousands separator.
 * @property {string} line_subtotal               Line subtotal (the price of
 *                                                the product before coupon
 *                                                discounts have been applied
 *                                                in subunits).
 * @property {string} line_subtotal_tax           Line subtotal tax (in
 *                                                subunits).
 * @property {string} line_total                  Line total (the price of the
 *                                                product after coupon
 *                                                discounts have been applied
 *                                                in subunits).
 * @property {string} line_total_tax              Line total tax (in subunits).
 */

/**
 * @typedef {Object} CartItemPriceRange
 *
 * @property {string} min_amount Price min amount in range.
 * @property {string} max_amount Price max amount in range.
 */

/**
 * @typedef {Object} CartItemPrices
 *
 * @property {string}      currency_code               The ISO code for the
 *                                                     currency.
 * @property {number}      currency_minor_unit         The precision (decimal
 *                                                     places).
 * @property {string}      currency_symbol             The symbol for the
 *                                                     currency (eg '$')
 * @property {string}      currency_prefix             Price prefix for the
 *                                                     currency which can be
 *                                                     used to format returned
 *                                                     prices.
 * @property {string}      currency_suffix             Price suffix for the
 *                                                     currency which can be
 *                                                     used to format returned
 *                                                     prices.
 * @property {string}      currency_decimal_separator  The string used for the
 *                                                     decimal separator.
 * @property {string}      currency_thousand_separator The string used for the
 *                                                     thousands separator.
 * @property {string}      price                       Current product price
 *                                                     in subunits.
 * @property {string}      regular_price               Regular product price
 *                                                     in subunits.
 * @property {string}      sale_price                  Sale product price, if
 *                                                     applicable (in subunits).
 * @property {CartItemPriceRange|null} price_range     Price range, if
 *                                                     applicable.
 *
 */

/**
 * @typedef {Object} CartItem
 *
 * @property {string}              key                 Unique identifier for the
 *                                                     item within the cart.
 * @property {number}              id                  The cart item product or
 *                                                     variation id.
 * @property {number}              quantity            The quantity of this item
 *                                                     in the cart.
 * @property {string}              name                Product name.
 * @property {string}              summary             A short summary (or
 *                                                     excerpt from the full
 *                                                     description).
 * @property {string}              short_description   Product short description
 *                                                     in HTML format.
 * @property {string}              sku                 Stock keeping unit, if
 *                                                     applicable.
 * @property {number|null}         low_stock_remaining Quantity left in stock if
 *                                                     stock is low, or null if
 *                                                     not applicable.
 * @property {boolean}             backorders_allowed  True if backorders are
 *                                                     allowed past stock
 *                                                     availability.
 * @property {boolean}             show_backorder_badge  Whether a notification
 *                                                     should be shown about the
 *                                                     product being available on
 *                                                     backorder.
 * @property {boolean}             sold_individually   If true, only one item of
 *                                                     this product is allowed
 *                                                     for purchase in a single
 *                                                     order.
 * @property {string}              permalink           Product URL.
 * @property {CartItemImage[]}     images              List of images attached
 *                                                     to the cart item
 *                                                     product/variation.
 * @property {CartItemVariation[]} variation           Chosen attributes (for
 *                                                     variations).
 * @property {CartItemPrices}      prices              Item prices.
 * @property {CartItemTotals}      totals              Item total amounts
 *                                                     provided using the
 *                                                     smallest unit of the
 *                                                     currency.
 * @property {Object}              extensions          Extra data registered
 *                                                     by plugins.
 */

/**
 * @typedef {Object} CartData
 *
 * @property {Array}               coupons         Coupons applied to cart.
 * @property {Array}               shippingRates   Array of selected shipping
 *                                                 rates.
 * @property {CartShippingAddress} shippingAddress Shipping address for the
 *                                                 cart.
 * @property {Array}               items           Items in the cart.
 * @property {number}              itemsCount      Number of items in the cart.
 * @property {number}              itemsWeight     Weight of items in the cart.
 * @property {boolean}             needsShipping   True if the cart needs
 *                                                 shipping.
 * @property {CartTotals}          totals          Cart total amounts.
 */

/**
 * @typedef {Object} CartTotals
 *
 * @property {string} currency_code               Currency code (in ISO format)
 *                                                for returned prices.
 * @property {string} currency_symbol             Currency symbol for the
 *                                                currency which can be used to
 *                                                format returned prices.
 * @property {number} currency_minor_unit         Currency minor unit (number of
 *                                                digits after the decimal
 *                                                separator) for returned
 *                                                prices.
 * @property {string} currency_decimal_separator  Decimal separator for the
 *                                                currency which can be used to
 *                                                format returned prices.
 * @property {string} currency_thousand_separator Thousand separator for the
 *                                                currency which can be used to
 *                                                format returned prices.
 * @property {string} currency_prefix             Price prefix for the currency
 *                                                which can be used to format
 *                                                returned prices.
 * @property {string} currency_suffix             Price prefix for the currency
 *                                                which can be used to format
 *                                                returned prices.
 * @property {number} total_items                 Total price of items in the
 *                                                cart (in subunits).
 * @property {number} total_items_tax             Total tax on items in the
 *                                                cart (in subunits).
 * @property {number} total_fees                  Total price of any applied
 *                                                fees (in subunits).
 * @property {number} total_fees_tax              Total tax on fees (
 *                                                in subunits).
 * @property {number} total_discount              Total discount from applied
 *                                                coupons (in subunits).
 * @property {number} total_discount_tax          Total tax removed due to
 *                                                discount from applied coupons
 *                                                (in subunits).
 * @property {number} total_shipping              Total price of shipping
 *                                                (in subunits).
 * @property {number} total_shipping_tax          Total tax on shipping
 *                                                (in subunits).
 * @property {number} total_price                 Total price the customer will
 *                                                pay (in subunits).
 * @property {number} total_tax                   Total tax applied to items and
 *                                                shipping (in subunits).
 * @property {Array}  tax_lines                   Lines of taxes applied to
 *                                                items and shipping
 *                                                (in subunits).
 */

export {};
woocommerce-blocks/assets/js/types/type-defs/billing.js000064400000001475151335517650017320 0ustar00/**
 * @typedef {Object} BillingData
 *
 * @property {string} email      The email for the billing address
 * @property {string} first_name First name of billing customer
 * @property {string} last_name  Last name of billing customer
 * @property {string} company    Company name for the billing address
 * @property {string} address_1  First line of the billing address
 * @property {string} address_2  Second line of the billing address
 * @property {string} city       The city of the billing address
 * @property {string} state      The state of the billing address (ISO or name)
 * @property {string} postcode   The postal or zip code for the billing address
 * @property {string} country    The country for the billing address (ISO)
 * @property {string} phone      The phone number for the billing address
 */

export {};
woocommerce-blocks/assets/js/types/type-defs/currency.ts000064400000000760151335517650017540 0ustar00export interface Currency {
	code: string;
	decimalSeparator: string;
	minorUnit: number;
	prefix: string;
	suffix: string;
	symbol: string;
	thousandSeparator: string;
}

export interface CurrencyResponse {
	currency_code: string;
	currency_symbol: string;
	currency_minor_unit: number;
	currency_decimal_separator: string;
	currency_thousand_separator: string;
	currency_prefix: string;
	currency_suffix: string;
}

export type SymbolPosition = 'left' | 'left_space' | 'right' | 'right_space';
woocommerce-blocks/assets/js/types/type-defs/objects.ts000064400000000153151335517650017333 0ustar00export type ObjectType = Record< string, unknown >;
export type EmptyObjectType = Record< string, never >;
woocommerce-blocks/assets/js/types/type-defs/settings.js000064400000006002151335517650017527 0ustar00/**
 * @typedef {Object} WooCommerceSiteCurrency
 *
 * @property {string} code               The ISO code for the currency.
 * @property {number} precision          The precision (decimal places).
 * @property {string} symbol             The symbol for the currency (eg '$')
 * @property {string} symbolPosition     The position for the symbol ('left',
 *                                       or 'right')
 * @property {string} decimalSeparator   The string used for the decimal
 *                                       separator.
 * @property {string} thousandSeparator The string used for the thousands
 *                                       separator.
 * @property {string} priceFormat        The format string use for displaying
 *                                       an amount in this currency.
 */

/**
 * @typedef {Object} WooCommerceSiteLocale
 *
 * @property {string}        siteLocale    The locale string for the current
 *                                         site.
 * @property {string}        userLocale    The locale string for the current
 *                                         user.
 * @property {Array<string>} weekdaysShort An array of short weekday strings
 *                                         in the current user's locale.
 */

/**
 * @typedef {Object} WooCommerceSharedSettings
 *
 * @property {string}                  adminUrl         The url for the current
 *                                                      site's dashboard.
 * @property {Object}                  countries        An object of countries
 *                                                      where the keys are
 *                                                      Country codes and values
 *                                                      are country names
 *                                                      localized for the site's
 *                                                      current language.
 * @property {WooCommerceSiteCurrency} currency         The current site
 *                                                      currency object.
 * @property {string}                  defaultDateRange The default date range
 *                                                      query string to use.
 * @property {WooCommerceSiteLocale}   locale           Locale information for
 *                                                      the site.
 * @property {Object}                  orderStatuses    An object of order
 *                                                      statuses indexed by
 *                                                      status key and localized
 *                                                      status value.
 * @property {string}                  siteTitle        The current title of the
 *                                                      site.
 * @property {string}                  wcAssetUrl       The url to the assets
 *                                                      directory for the
 *                                                      WooCommerce plugin.
 */

export {};
woocommerce-blocks/assets/js/types/type-defs/events.ts000064400000000204151335517650017203 0ustar00export interface AddToCartEventDetail {
	// Whether cart data in the data store should be preserved.
	preserveCartData?: boolean;
}
woocommerce-blocks/assets/js/types/type-defs/contexts.js000064400000041607151335517650017550 0ustar00/**
 * @typedef {import('./billing').BillingData} BillingData
 * @typedef {import('./cart').CartShippingOption} CartShippingOption
 * @typedef {import('./shipping').ShippingAddress} CartShippingAddress
 * @typedef {import('./cart').CartData} CartData
 * @typedef {import('./checkout').CheckoutDispatchActions} CheckoutDispatchActions
 * @typedef {import('./add-to-cart-form').AddToCartFormDispatchActions} AddToCartFormDispatchActions
 * @typedef {import('./add-to-cart-form').AddToCartFormEventRegistration} AddToCartFormEventRegistration
 */

/**
 * @typedef {Object} CustomerDataContext
 *
 * @property {BillingData}          billingData          The current billing data, including address and email.
 * @property {CartShippingAddress}  shippingAddress      The current set address for shipping.
 * @property {Function}             setBillingData       A function for setting billing data.
 * @property {Function}             setShippingAddress   A function for setting shipping address.
 * @property {boolean}              shippingAsBilling    A boolean which tracks if the customer is using the same billing and shipping address.
 * @property {Function}             setShippingAsBilling A function for toggling shipping as billing.
 */

/**
 * @typedef {Object} ShippingDataContext
 *
 * @property {ShippingErrorStatus}  shippingErrorStatus         The current shipping error status.
 * @property {Function}             dispatchErrorStatus         A function for dispatching a shipping rate error status.
 * @property {ShippingErrorTypes}   shippingErrorTypes          The error type constants for the shipping rate error
 *                                                              status.
 * @property {CartShippingOption[]} shippingRates               An array of available shipping rates.
 * @property {boolean}              shippingRatesLoading        Whether or not the shipping rates are being loaded.
 * @property {string[]}             selectedRates               The ids of the rates that are selected.
 * @property {function()}           setSelectedRates            Function for setting the selected rates.
 * @property {boolean}              isSelectingRate             True when rate is being selected.
 * @property {CartShippingAddress}  shippingAddress             The current set address for shipping.
 * @property {function(Object)}     setShippingAddress          Function for setting the shipping address.
 * @property {function()}           onShippingRateSuccess       Used to register a callback to be invoked when shipping
 *                                                              rates are retrieved.
 * @property {function()}           onShippingRateSelectSuccess Used to register a callback to be invoked when shipping
 *                                                              rate is selected.
 * @property {function()}           onShippingRateSelectFail    Used to register a callback to be invoked when shipping
 *                                                              rate is selected unsuccessfully
 * @property {function()}           onShippingRateFail          Used to register a callback to be invoked when there is
 *                                                              an error with retrieving shipping rates.
 * @property {boolean}              needsShipping               True if the cart has items requiring shipping.
 * @property {boolean}              hasCalculatedShipping       True if the cart has calculated shipping costs.
 */

/**
 * @typedef {Object} ShippingErrorStatus
 *
 * @property {boolean} isPristine        Whether the status is pristine.
 * @property {boolean} isValid           Whether the status is valid.
 * @property {boolean} hasInvalidAddress Whether the address is invalid.
 * @property {boolean} hasError          Whether an error has happened.
 */

/**
 * @typedef {Object} ShippingErrorTypes
 *
 * @property {string} NONE            No shipping error.
 * @property {string} INVALID_ADDRESS Error due to an invalid address for calculating shipping.
 * @property {string} UNKNOWN         When an unknown error has occurred in calculating/retrieving shipping rates.
 */

/**
 * A saved customer payment method object (if exists)
 *
 * @typedef {Object} CustomerPaymentMethod
 *
 * @property {Object}  method     The payment method object (varies on what it might contain)
 * @property {string}  expires    Short form of expiry for payment method.
 * @property {boolean} is_default Whether it is the default payment method of the customer or not.
 * @property {number}  tokenId    The id of the saved payment method.
 * @property {Object}  actions    Varies, actions that can be done to interact with the payment method.
 */

/**
 * @typedef {Object} ShippingDataResponse
 *
 * @property {CartShippingAddress} address The address selected for shipping.
 */

/**
 * @typedef {Object} PaymentStatusDispatchers
 *
 * @property {function(Object=)}                 started    Sets started status.
 * @property {function()}                        processing Sets processing status.
 * @property {function()}                        completed  Sets complete status.
 * @property {function(string)}                  error      Sets error status.
 * @property {function(string, Object, Object=)} failed     Sets failed status.
 * @property {function(Object=,Object=,Object=)} success    Sets success status.
 */

/**
 * @typedef {function():PaymentStatusDispatchers} PaymentStatusDispatch
 */

/**
 * @typedef {Object} CheckoutDataContext
 *
 * @property {function()}                   onSubmit                             The callback to register with the
 *                                                                               checkout submit button.
 * @property {boolean}                      isComplete                           True when checkout is complete and
 *                                                                               ready for redirect.
 * @property {boolean}                      isBeforeProcessing                   True during any observers executing
 *                                                                               logic before checkout processing
 *                                                                               (eg. validation).
 * @property {boolean}                      isAfterProcessing                    True when checkout status is
 *                                                                               AFTER_PROCESSING.
 * @property {boolean}                      isIdle                               True when the checkout state has
 *                                                                               changed and checkout has no activity.
 * @property {boolean}                      isProcessing                         True when checkout has been submitted
 *                                                                               and is being processed. Note, payment
 *                                                                               related processing happens during this
 *                                                                               state. When payment status is success,
 *                                                                               processing happens on the server.
 * @property {boolean}                      isCalculating                        True when something in the checkout is
 *                                                                               resulting in totals being calculated.
 * @property {boolean}                      hasError                             True when the checkout is in an error
 *                                                                               state. Whatever caused the error
 *                                                                               (validation/payment method) will likely
 *                                                                               have triggered a notice.
 * @property {string}                       redirectUrl                          This is the url that checkout will
 *                                                                               redirect to when it's ready.
 * @property {function(function(),number=)} onCheckoutValidationBeforeProcessing Used to register a callback that will
 *                                                                               fire when the validation of the submitted checkout
 *                                                                               data happens, before it's sent off to the
 *                                                                               server.
 * @property {function(function(),number=)} onCheckoutAfterProcessingWithSuccess Used to register a callback that will
 *                                                                               fire after checkout has been processed
 *                                                                               and there are no errors.
 * @property {function(function(),number=)} onCheckoutAfterProcessingWithError   Used to register a callback that will
 *                                                                               fire when the checkout has been
 *                                                                               processed and has an error.
 * @property {CheckoutDispatchActions}      dispatchActions                      Various actions that can be dispatched
 *                                                                               for the checkout context data.
 * @property {number}                       orderId                              This is the ID for the draft order if
 *                                                                               one exists.
 * @property {number}                       orderNotes                           Order notes introduced by the user in
 *                                                                               the checkout form.
 * @property {boolean}                      hasOrder                             True when the checkout has a draft
 *                                                                               order from the API.
 * @property {boolean}                      isCart                               When true, means the provider is
 *                                                                               providing data for the cart.
 * @property {number}                       customerId                           This is the ID of the customer the
 *                                                                               draft order belongs to.
 * @property {boolean}                      shouldCreateAccount                  Should a user account be created?
 * @property {function(boolean)}            setShouldCreateAccount               Function to update the
 *                                                                               shouldCreateAccount property.
 */

/**
 * @typedef {Object} EditorDataContext
 *
 * @property {boolean} isEditor      Indicates whether in the editor context.
 * @property {number}  currentPostId The post ID being edited.
 * @property {Object}  previewData   Object containing preview data for the editor.
 * @property {function(string):Object} getPreviewData Get data by name.
 */

/**
 * @typedef {Object} AddToCartFormContext
 *
 * @property {Object}                         product              The product object to add to the cart.
 * @property {string}                         productType          The name of the product type.
 * @property {boolean}                        productIsPurchasable True if the product can be purchased.
 * @property {boolean}                        productHasOptions    True if the product has additional options and thus
 *                                                                 needs a cart form.
 * @property {boolean}                        supportsFormElements True if the product type supports form elements.
 * @property {boolean}                        showFormElements     True if showing a full add to cart form (enabled and
 *                                                                 supported).
 * @property {number}                         quantity             Stores the quantity being added to the cart.
 * @property {number}                         minQuantity          Min quantity that can be added to the cart.
 * @property {number}                         maxQuantity          Max quantity than can be added to the cart.
 * @property {Object}                         requestParams        List of params to send to the API.
 * @property {boolean}                        isIdle               True when the form state has changed and has no
 *                                                                 activity.
 * @property {boolean}                        isDisabled           True when the form cannot be submitted.
 * @property {boolean}                        isProcessing         True when the form has been submitted and is being
 *                                                                 processed.
 * @property {boolean}                        isBeforeProcessing   True during any observers executing logic before form
 *                                                                 processing (eg. validation).
 * @property {boolean}                        isAfterProcessing    True when form status is AFTER_PROCESSING.
 * @property {boolean}                        hasError             True when the form is in an error state. Whatever
 *                                                                 caused the error (validation/payment method) will
 *                                                                 likely have triggered a notice.
 * @property {AddToCartFormEventRegistration} eventRegistration    Event emitters that can be subscribed to.
 * @property {AddToCartFormDispatchActions}   dispatchActions      Various actions that can be dispatched for the add to
 *                                                                 cart form context data.
 */

/**
 * @typedef {Object} ValidationContextError
 *
 * @property {number} id Error ID.
 * @property {string} message Error message.
 * @property {boolean} hidden Error visibility.
 *
 */

/**
 * @typedef {Object} ValidationContext
 *
 * @property {(id:string)=>ValidationContextError} getValidationError     Return validation error for the given property.
 * @property {function(Object)}         setValidationErrors      Receive an object of properties and  error messages as
 *                                                               strings and adds to the validation error state.
 * @property {function(string)}         clearValidationError     Clears a validation error for the given property name.
 * @property {function()}               clearAllValidationErrors Clears all validation errors currently in state.
 * @property {function(string)}         getValidationErrorId     Returns the css id for the
 *                                                               validation error using the given inputId string.
 * @property {function(string)}         hideValidationError      Sets the hidden prop of a specific error to true.
 * @property {function(string)}         showValidationError      Sets the hidden prop of a specific error to false.
 * @property {function()}               showAllValidationErrors  Sets the hidden prop of all errors to false.
 * @property {boolean}                  hasValidationErrors      True if there is at least one error.
 */

/**
 * @typedef StoreNoticeObject
 *
 * @property {string} type   The type of notice.
 * @property {string} status The status of the notice.
 * @property {string} id     The id of the notice.
 */

/**
 * @typedef NoticeContext
 *
 * @property {Array<StoreNoticeObject>}              notices              An array of notice objects.
 * @property {function(string,string,any):undefined} createNotice         Creates a notice for the given arguments.
 * @property {function(string, any):undefined}       createSnackbarNotice Creates a snackbar notice type.
 * @property {function(string,string=):undefined}    removeNotice         Removes a notice with the given id and context
 * @property {string}                                context              The current context identifier for the notice
 *                                                                        provider
 * @property {function(boolean):void}                setIsSuppressed      Consumers can use this setter to suppress
 */

/**
 * @typedef {Object} ContainerWidthContext
 *
 * @property {boolean} hasContainerWidth  True once the class name has been derived.
 * @property {string}  containerClassName The class name derived from the width of the container.
 * @property {boolean} isMobile           True if the derived container width is mobile.
 * @property {boolean} isSmall            True if the derived container width is small.
 * @property {boolean} isMedium           True if the derived container width is medium.
 * @property {boolean} isLarge            True if the derived container width is large.
 */

export {};
woocommerce-blocks/assets/js/types/type-defs/product-response.ts000064400000003665151335517650021231 0ustar00/**
 * Internal dependencies
 */
import { CurrencyResponse } from './currency';

export interface ProductResponseItemPrices extends CurrencyResponse {
	price: string;
	regular_price: string;
	sale_price: string;
	price_range: null | { min_amount: string; max_amount: string };
	raw_prices: {
		precision: number;
		price: string;
		regular_price: string;
		sale_price: string;
	};
}

export interface ProductResponseItemData {
	name: string;
	value: string;
	display?: string;
	hidden?: boolean;
}

export interface ProductResponseImageItem {
	id: number;
	src: string;
	thumbnail: string;
	srcset: string;
	sizes: string;
	name: string;
	alt: string;
}

export interface ProductResponseTermItem {
	id: number;
	name: string;
	slug: string;
	link?: string;
}

export interface ProductResponseAttributeItem {
	id: number;
	name: string;
	taxonomy: string;
	has_variations: boolean;
	terms: Array< ProductResponseTermItem >;
}

export interface ProductResponseVariationsItem {
	id: number;
	attributes: Array< ProductResponseVariationAttributeItem >;
}

export interface ProductResponseVariationAttributeItem {
	name: string;
	value: string;
}

export interface ProductResponseItem {
	id: number;
	name: string;
	parent: number;
	type: string;
	variation: string;
	permalink: string;
	sku: string;
	short_description: string;
	description: string;
	on_sale: boolean;
	prices: ProductResponseItemPrices;
	price_html: string;
	average_rating: number;
	review_count: number;
	images: Array< ProductResponseImageItem >;
	categories: Array< ProductResponseTermItem >;
	tags: Array< ProductResponseTermItem >;
	attributes: Array< ProductResponseAttributeItem >;
	variations: Array< ProductResponseVariationsItem >;
	has_options: boolean;
	is_purchasable: boolean;
	is_in_stock: boolean;
	is_on_backorder: boolean;
	low_stock_remaining: null | number;
	sold_individually: boolean;
	quantity_limit: number;
	add_to_cart: {
		text: string;
		description: string;
		url: string;
	};
}
woocommerce-blocks/assets/js/types/type-defs/hooks.ts000064400000003101151335517650017021 0ustar00/**
 * Internal dependencies
 */
import type {
	CartResponseErrorItem,
	CartResponseCouponItem,
	CartResponseItem,
	CartResponseFeeItem,
	CartResponseTotals,
	CartResponseShippingAddress,
	CartResponseBillingAddress,
	CartResponseShippingRate,
	CartResponse,
	CartResponseCoupons,
} from './cart-response';
import type { ResponseError } from '../../data/types';
export interface StoreCartItemQuantity {
	isPendingDelete: boolean;
	quantity: number;
	setItemQuantity: React.Dispatch< React.SetStateAction< number > >;
	removeItem: () => Promise< boolean >;
	cartItemQuantityErrors: Array< CartResponseErrorItem >;
}

export interface StoreCartCoupon {
	appliedCoupons: Array< CartResponseCouponItem >;
	isLoading: boolean;
	applyCoupon: ( coupon: string ) => void;
	removeCoupon: ( coupon: string ) => void;
	isApplyingCoupon: boolean;
	isRemovingCoupon: boolean;
}

export interface StoreCart {
	cartCoupons: CartResponseCoupons;
	cartItems: Array< CartResponseItem >;
	cartFees: Array< CartResponseFeeItem >;
	cartItemsCount: number;
	cartItemsWeight: number;
	cartNeedsPayment: boolean;
	cartNeedsShipping: boolean;
	cartItemErrors: Array< CartResponseErrorItem >;
	cartTotals: CartResponseTotals;
	cartIsLoading: boolean;
	cartErrors: Array< ResponseError >;
	billingAddress: CartResponseBillingAddress;
	shippingAddress: CartResponseShippingAddress;
	shippingRates: Array< CartResponseShippingRate >;
	extensions: Record< string, unknown >;
	shippingRatesLoading: boolean;
	cartHasCalculatedShipping: boolean;
	paymentRequirements: Array< string >;
	receiveCart: ( cart: CartResponse ) => void;
}
woocommerce-blocks/assets/js/types/type-defs/hooks.js000064400000022136151335517650017020 0ustar00/**
 * @typedef {import('./cart').CartData} CartData
 * @typedef {import('./shipping').ShippingAddress} CartShippingAddress
 * @typedef {import('./contexts').StoreNoticeObject} StoreNoticeObject
 * @typedef {import('@woocommerce/type-defs/billing').BillingData} CartBillingAddress
 */

/**
 * @typedef {Object} StoreCart
 *
 * @property {Array}               cartCoupons          An array of coupons applied
 *                                                      to the cart.
 * @property {Array}               cartItems            An array of items in the
 *                                                      cart.
 * @property {Array}               cartFees             An array of fees in the
 *                                                      cart.
 * @property {number}              cartItemsCount       The number of items in the
 *                                                      cart.
 * @property {number}              cartItemsWeight      The weight of all items in
 *                                                      the cart.
 * @property {boolean}             cartNeedsPayment     True when the cart will
 *                                                      require payment.
 * @property {boolean}             cartNeedsShipping    True when the cart will
 *                                                      require shipping.
 * @property {Array}               cartItemErrors       Item validation errors.
 * @property {Object}              cartTotals           Cart and line total
 *                                                      amounts.
 * @property {boolean}             cartIsLoading        True when cart data is
 *                                                      being loaded.
 * @property {Array}               cartErrors           An array of errors thrown
 *                                                      by the cart.
 * @property {CartBillingAddress}  billingAddress       Billing address for the
 *                                                      cart.
 * @property {CartShippingAddress} shippingAddress      Shipping address for the
 *                                                      cart.
 * @property {Array}               shippingRates        array of selected shipping
 *                                                      rates.
 * @property {Object}              extensions           Values provided by  *                                                      extensions.
 * @property {boolean}             shippingRatesLoading Whether or not the
 *                                                      shipping rates are
 *                                                      being loaded.
 * @property {boolean}             cartHasCalculatedShipping Whether or not the cart has calculated shipping yet.
 * @property {Array}               paymentRequirements  List of features required from payment gateways.
 * @property {function(Object):any} receiveCart         Dispatcher to receive
 *                                                      updated cart.
 */

/**
 * @typedef {Object} StoreCartCoupon
 *
 * @property {Array}    appliedCoupons    Collection of applied coupons from the
 *                                        API.
 * @property {boolean}  isLoading         True when coupon data is being loaded.
 * @property {Function} applyCoupon       Callback for applying a coupon by code.
 * @property {Function} removeCoupon      Callback for removing a coupon by code.
 * @property {boolean}  isApplyingCoupon  True when a coupon is being applied.
 * @property {boolean}  isRemovingCoupon  True when a coupon is being removed.
 */

/**
 * @typedef {Object} StoreCartItemAddToCart
 *
 * @property {number}   cartQuantity           The quantity of the item in the
 *                                             cart.
 * @property {boolean}  addingToCart           Whether the cart item is still
 *                                             being added or not.
 * @property {boolean}  cartIsLoading          Whether the cart is being loaded.
 * @property {Function} addToCart              Callback for adding a cart item.
 */

/**
 * @typedef {Object} CheckoutNotices
 *
 * @property {StoreNoticeObject[]} checkoutNotices       Array of notices in the
 *                                                       checkout context.
 * @property {StoreNoticeObject[]} expressPaymentNotices Array of notices in the
 *                                                       express payment context.
 * @property {StoreNoticeObject[]} paymentNotices        Array of notices in the
 *                                                       payment context.
 */

/**
 * @typedef {Object} EmitResponseTypes
 *
 * @property {string} SUCCESS To indicate a success response.
 * @property {string} FAIL    To indicate a failed response.
 * @property {string} ERROR   To indicate an error response.
 */

/**
 * @typedef {Object} NoticeContexts
 *
 * @property {string} PAYMENTS         Notices for the payments step.
 * @property {string} EXPRESS_PAYMENTS Notices for the express payments step.
 */

/* eslint-disable jsdoc/valid-types */
// Enum format below triggers the above rule even though VSCode interprets it fine.
/**
 * @typedef {NoticeContexts['PAYMENTS']|NoticeContexts['EXPRESS_PAYMENTS']} NoticeContextsEnum
 */

/**
 * @typedef {Object} EmitSuccessResponse
 *
 * @property {EmitResponseTypes['SUCCESS']} type          Should have the value of
 *                                                        EmitResponseTypes.SUCCESS.
 * @property {string}                       [redirectUrl] If the redirect url should be changed set
 *                                                        this. Note, this is ignored for some
 *                                                        emitters.
 * @property {Object}                       [meta]        Additional data returned for the success
 *                                                        response. This varies between context
 *                                                        emitters.
 */

/**
 * @typedef {Object} EmitFailResponse
 *
 * @property {EmitResponseTypes['FAIL']} type             Should have the value of
 *                                                        EmitResponseTypes.FAIL
 * @property {string}                    message          A message to trigger a notice for.
 * @property {NoticeContextsEnum}        [messageContext] What context to display any message in.
 * @property {Object}                    [meta]           Additional data returned for the fail
 *                                                        response. This varies between context
 *                                                        emitters.
 */

/**
 * @typedef {Object} EmitErrorResponse
 *
 * @property {EmitResponseTypes['ERROR']} type               Should have the value of
 *                                                           EmitResponseTypes.ERROR
 * @property {string}                     message            A message to trigger a notice for.
 * @property {boolean}                    retry              If false, then it means an
 *                                                           irrecoverable error so don't allow for
 *                                                           shopper to retry checkout (which may
 *                                                           mean either a different payment or
 *                                                           fixing validation errors).
 * @property {Object}                     [validationErrors] If provided, will be set as validation
 *                                                           errors in the validation context.
 * @property {NoticeContextsEnum}         [messageContext]   What context to display any message in.
 * @property {Object}                     [meta]             Additional data returned for the fail
 *                                                           response. This varies between context
 *                                                           emitters.
 */
/* eslint-enable jsdoc/valid-types */

/**
 * @typedef {Object} EmitResponseApi
 *
 * @property {EmitResponseTypes}        responseTypes     An object of various response types that can
 *                                                        be used in returned response objects.
 * @property {NoticeContexts}           noticeContexts    An object of various notice contexts that can
 *                                                        be used for targeting where a notice appears.
 * @property {function(Object):boolean} shouldRetry       Returns whether the user is allowed to retry
 *                                                        the payment after a failed one.
 * @property {function(Object):boolean} isSuccessResponse Returns whether the given response is of a
 *                                                        success response type.
 * @property {function(Object):boolean} isErrorResponse   Returns whether the given response is of an
 *                                                        error response type.
 * @property {function(Object):boolean} isFailResponse    Returns whether the given response is of a
 *                                                        fail response type.
 */

export {};
woocommerce-blocks/assets/js/types/type-defs/registered-payment-method-props.js000064400000033145151335517650024126 0ustar00/**
 * @typedef {import('@woocommerce/type-defs/cart').CartTotalItem} CartTotalItem
 * @typedef {import('@woocommerce/type-defs/cart').CartShippingOption} CartShippingOption
 * @typedef {import('@woocommerce/type-defs/shipping').ShippingAddress} ShippingAddress
 * @typedef {import('@woocommerce/type-defs/billing').BillingData} BillingData
 * @typedef {import('@woocommerce/type-defs/contexts').PaymentMethodCurrentStatus} PaymentMethodCurrentStatus
 * @typedef {import('@woocommerce/type-defs/contexts').PaymentStatusDispatch} PaymentStatusDispatch
 * @typedef {import('@woocommerce/type-defs/contexts').ShippingErrorStatus} ShippingErrorStatus
 * @typedef {import('@woocommerce/type-defs/contexts').ShippingErrorTypes} ShippingErrorTypes
 * @typedef {import('@woocommerce/type-defs/settings').WooCommerceSiteCurrency} SiteCurrency
 * @typedef {import('@woocommerce/type-defs/hooks').EmitResponseTypes} EmitResponseTypes
 * @typedef {import('@woocommerce/type-defs/hooks').NoticeContexts} NoticeContexts
 */

/**
 * Payment Event Status Action Creators
 *
 * @typedef {Object} PaymentStatusActions
 *
 * @property {Function} started    Set started status.
 * @property {Function} processing Set processing status.
 * @property {Function} completed  Set completed status.
 * @property {Function} error      Set error status.
 * @property {Function} failed     Set failed status.
 * @property {Function} success    Set success status.
 */

/**
 * @typedef {Object} PaymentMethodShipping
 *
 * @property {boolean}              required      If shipping is required this
 *                                                will be true.
 * @property {CartShippingOption[]} options       Available shipping options.
 * @property {Function}             selectOptions Used to set the selected
 *                                                shipping options.
 * @property {Function}             updateAddress Used to update the shipping
 *                                                address.
 * @property {Function}             setStatus     Used to set the current
 *                                                shipping options status.
 * @property {Function}             selectStatus  Returns helpers for
 *                                                determining the current
 *                                                shipping options status.
 * @property {string}               status        What the current shipping
 *                                                options status is.
 */

/**
 * @typedef {Object} PaymentMethodEvents
 *
 * @property {boolean}  isCalculating      If true, means the cart/checkout is
 *                                         currently calculating totals.
 * @property {boolean}  isCheckoutComplete If true, means the checkout process
 *                                         is complete (useful if the payment
 *                                         method has something to do after
 *                                         checkout is complete before setting
 *                                         payment status to complete. Redirect
 *                                         doesn't happen until both checkout
 *                                         and payment status is complete)
 * @property {PaymentStatusActions} dispatchStatus     Used to dispatch a payment event.
 * @property {Function} selectStatus       Returns helpers for determining
 *                                         current payment event status.
 * @property {string}   status             What the current payment event status
 *                                         is.
 */

/**
 * @typedef CheckoutStatusProps
 *
 * @property {boolean} isCalculating If true then totals are being calculated in
 *                                   the checkout.
 * @property {boolean} isComplete    If true then the checkout has completed
 *                                   it's processing.
 * @property {boolean} isIdle        If true then the checkout is idle (no
 *                                   activity happening).
 * @property {boolean} isProcessing  If true then checkout is processing
 *                                   (finalizing) the order with the server.
 */

/**
 * @typedef ShippingStatusProps
 *
 * @property {ShippingErrorStatus} shippingErrorStatus Current error status for
 *                                                     shipping.
 * @property {ShippingErrorTypes}  shippingErrorTypes  An object containing all
 *                                                     the possible types for
 *                                                     shipping error status.
 */

/**
 * @typedef ShippingDataProps
 *
 * @property {CartShippingOption[]} shippingRates        All the available
 *                                                       shipping rates.
 * @property {boolean}              shippingRatesLoading Whether the rates are
 *                                                       loading or not.
 * @property {string[]}             selectedRates        An array of selected
 *                                                       rates (rate ids).
 * @property {Function}             setSelectedRates     A function for setting
 *                                                       selected rates
 *                                                       (receives id)
 * @property {boolean}              isSelectingRate      True when rates are
 *                                                       being selected.
 * @property {ShippingAddress}      shippingAddress      The current set
 *                                                       shipping address.
 * @property {Function}             setShippingAddress   A function for setting
 *                                                       the shipping address.
 * @property {boolean}              needsShipping        True if cart requires
 *                                                       shipping.
 */

/**
 * @typedef PreparedCartTotalItem
 *
 * @property {string} label  The label for the total item.
 * @property {number} value  The value for the total item.
 */

/**
 * @typedef BillingDataProps
 *
 * @property {BillingData}             billingData               The address used for billing.
 * @property {PreparedCartTotalItem}   cartTotal                 The total item for the cart.
 * @property {SiteCurrency}            currency                  Currency object.
 * @property {PreparedCartTotalItem[]} cartTotalItems            The various subtotal amounts.
 * @property {boolean}                 displayPricesIncludingTax True means that the site is
 *                                                               configured to display prices
 *                                                               including tax.
 * @property {string[]}                appliedCoupons            All the coupons that were applied.
 * @property {number}                  customerId                The customer Id the order belongs to.
 */

/**
 * @typedef EventRegistrationProps
 *
 * @property {function(function())} onCheckoutValidationBeforeProcessing Used to subscribe callbacks firing when
 *                                                              validation of the submitted checkout data happens,
 *                                                              before it's sent off to the server.
 * @property {function(function())} onCheckoutAfterProcessingWithSuccess Used to subscribe callbacks
 *                                                              firing when checkout has completed
 *                                                              processing successfully.
 * @property {function(function())} onCheckoutAfterProcessingWithError Used to subscribe callbacks
 *                                                              firing when checkout has completed
 *                                                              processing with an error.
 * @property {function(function())} onShippingRateSuccess       Used to subscribe callbacks that
 *                                                              will fire when shipping rates for a
 *                                                              given address have been received
 *                                                              successfully.
 * @property {function(function())} onShippingRateFail          Used to subscribe callbacks that
 *                                                              will fire when retrieving shipping
 *                                                              rates failed.
 * @property {function(function())} onShippingRateSelectSuccess Used to subscribe callbacks that
 *                                                              will fire after selecting a
 *                                                              shipping rate successfully.
 * @property {function(function())} onShippingRateSelectFail    Used to subscribe callbacks that
 *                                                              will fire after selecting a shipping
 *                                                              rate unsuccessfully.
 * @property {function(function())} onPaymentProcessing         Event registration callback for
 *                                                              registering observers for the
 *                                                              payment processing event.
 */

/**
 * @typedef ComponentProps
 *
 * @property {function(Object):Object} ValidationInputError  A container for holding validation
 *                                                           errors
 * @property {function(Object):Object} PaymentMethodIcons    A component used for displaying payment
 *                                                           method icons.
 * @property {function(Object):Object} PaymentMethodLabel    A component used for displaying payment
 *                                                           method labels, including an icon.
 */

/**
 * @typedef EmitResponseProps
 *
 * @property {EmitResponseTypes} responseTypes  Response types that can be returned from emitter
 *                                              observers.
 * @property {NoticeContexts}    noticeContexts Available contexts that can be returned as the value
 *                                              for the messageContext property on the object
 *                                              returned from an emitter observer.
 */

/**
 * Registered payment method props
 *
 * @typedef {Object} RegisteredPaymentMethodProps
 *
 * @property {CheckoutStatusProps}        checkoutStatus           The current checkout status exposed
 *                                                                 as various boolean state.
 * @property {PaymentMethodCurrentStatus} paymentStatus            Various payment status helpers.
 * @property {ShippingStatusProps}        shippingStatus           Various shipping status helpers.
 * @property {ShippingDataProps}          shippingData             Various data related to shipping.
 * @property {BillingDataProps}           billing                  Various billing data items.
 * @property {EventRegistrationProps}     eventRegistration        Various event registration helpers
 *                                                                 for subscribing callbacks for
 *                                                                 events.
 * @property {EmitResponseProps}          emitResponse             Utilities for usage in event
 *                                                                 observer response objects.
 * @property {Function}                   [onSubmit]               Used to trigger checkout
 *                                                                 processing.
 * @property {string}                     activePaymentMethod      Indicates what the active payment
 *                                                                 method is.
 * @property {ComponentProps}             components               Components exposed to payment
 *                                                                 methods for use.
 * @property {function(string)}           [setExpressPaymentError] For setting an error (error
 *                                                                 message string) for express
 *                                                                 payment methods. Does not change
 *                                                                 payment status.
 * @property {function()}                 [onClick]                Provided to express payment
 *                                                                 methods that should be triggered
 *                                                                 when the payment method button
 *                                                                 is clicked (which will signal to
 *                                                                 checkout the payment method has
 *                                                                 taken over payment processing)
 * @property {function()}                 [onClose]                Provided to express payment
 *                                                                 methods that should be triggered
 *                                                                 when the express payment method
 *                                                                 modal closes and control is
 *                                                                 returned to checkout.
 * @property {boolean}                    shouldSavePayment        A boolean which indicates whether
 *                                                                 the shopper has checked the save
 *                                                                 payment method checkbox.
 */

export {};
woocommerce-blocks/assets/js/types/type-defs/cart-response.ts000064400000011065151335517650020473 0ustar00/**
 * Internal dependencies
 */
import { CurrencyResponse } from './currency';
import {
	CartImageItem,
	CartItemPrices,
	CartItemTotals,
	CartVariationItem,
	CatalogVisibility,
} from './cart';

export interface CartResponseTotalsItem extends CurrencyResponse {
	total_discount: string;
	total_discount_tax: string;
}

export interface CartResponseCouponItem {
	code: string;
	discount_type: string;
	totals: CartResponseTotalsItem;
}

export interface CartResponseCouponItemWithLabel
	extends CartResponseCouponItem {
	label: string;
}

export type CartResponseCoupons = CartResponseCouponItemWithLabel[];

export interface ResponseFirstNameLastName {
	first_name: string;
	last_name: string;
}

export interface ResponseBaseAddress {
	address_1: string;
	address_2: string;
	city: string;
	state: string;
	postcode: string;
	country: string;
}

export interface ShippingRateItem {
	key: string;
	name: string;
	quantity: number;
}

export interface MetaKeyValue {
	key: string;
	value: string;
}

export type ExtensionsData =
	| Record< string, unknown >
	| Record< string, never >;

export interface CartResponseShippingPackageShippingRate
	extends CurrencyResponse {
	rate_id: string;
	name: string;
	description: string;
	delivery_time: string;
	price: string;
	taxes: string;
	instance_id: number;
	method_id: string;
	meta_data: Array< MetaKeyValue >;
	selected: boolean;
}

export interface CartResponseShippingRate {
	/* PackageId can be a string, WooCommerce Subscriptions uses strings for example, but WooCommerce core uses numbers */
	package_id: number | string;
	name: string;
	destination: ResponseBaseAddress;
	items: Array< ShippingRateItem >;
	shipping_rates: Array< CartResponseShippingPackageShippingRate >;
}

export interface CartResponseShippingAddress
	extends ResponseBaseAddress,
		ResponseFirstNameLastName {
	company: string;
	phone: string;
}

export interface CartResponseBillingAddress
	extends CartResponseShippingAddress {
	email: string;
}

export interface CartResponseImageItem {
	id: number;
	src: string;
	thumbnail: string;
	srcset: string;
	sizes: string;
	name: string;
	alt: string;
}

export interface CartResponseVariationItem {
	attribute: string;
	value: string;
}

export interface CartResponseItemPrices extends CurrencyResponse {
	price: string;
	regular_price: string;
	sale_price: string;
	price_range: null | { min_amount: string; max_amount: string };
	raw_prices: {
		precision: number;
		price: string;
		regular_price: string;
		sale_price: string;
	};
}

export interface CartResponseItemTotals extends CurrencyResponse {
	line_subtotal: string;
	line_subtotal_tax: string;
	line_total: string;
	line_total_tax: string;
}

export interface CartResponseItem {
	key: string;
	id: number;
	quantity: number;
	catalog_visibility: CatalogVisibility;
	quantity_limit: number;
	name: string;
	summary: string;
	short_description: string;
	description: string;
	sku: string;
	low_stock_remaining: null | number;
	backorders_allowed: boolean;
	show_backorder_badge: boolean;
	sold_individually: boolean;
	permalink: string;
	images: Array< CartImageItem >;
	variation: Array< CartVariationItem >;
	prices: CartItemPrices;
	totals: CartItemTotals;
	extensions: ExtensionsData;
	item_data: Record< string, unknown >[];
}

export interface CartResponseTotalsTaxLineItem {
	name: string;
	price: string;
	rate: string;
}

export interface CartResponseFeeItemTotals extends CurrencyResponse {
	total: string;
	total_tax: string;
}

export type CartResponseFeeItem = {
	id: string;
	name: string;
	totals: CartResponseFeeItemTotals;
};

export interface CartResponseTotals extends CurrencyResponse {
	total_items: string;
	total_items_tax: string;
	total_fees: string;
	total_fees_tax: string;
	total_discount: string;
	total_discount_tax: string;
	total_shipping: string;
	total_shipping_tax: string;
	total_price: string;
	total_tax: string;
	tax_lines: Array< CartResponseTotalsTaxLineItem >;
}

export interface CartResponseErrorItem {
	code: string;
	message: string;
}

export interface CartResponseExtensionItem {
	[ key: string ]: unknown;
}

export interface CartResponse {
	coupons: Array< CartResponseCouponItem >;
	shipping_rates: Array< CartResponseShippingRate >;
	shipping_address: CartResponseShippingAddress;
	billing_address: CartResponseBillingAddress;
	items: Array< CartResponseItem >;
	items_count: number;
	items_weight: number;
	needs_payment: boolean;
	needs_shipping: boolean;
	has_calculated_shipping: boolean;
	fees: Array< CartResponseFeeItem >;
	totals: CartResponseTotals;
	errors: Array< CartResponseErrorItem >;
	payment_requirements: Array< unknown >;
	extensions: ExtensionsData;
}
woocommerce-blocks/assets/js/utils/test/products.js000064400000004103151335517650016605 0ustar00/**
 * Internal dependencies
 */
import { getImageSrcFromProduct, getImageIdFromProduct } from '../products';

describe( 'getImageSrcFromProduct', () => {
	test( 'returns first image src', () => {
		const imageSrc = getImageSrcFromProduct( {
			images: [ { src: 'foo.jpg' } ],
		} );

		expect( imageSrc ).toBe( 'foo.jpg' );
	} );

	test( 'returns empty string if no product was provided', () => {
		const imageSrc = getImageSrcFromProduct();

		expect( imageSrc ).toBe( '' );
	} );

	test( 'returns empty string if product is empty', () => {
		const imageSrc = getImageSrcFromProduct( {} );

		expect( imageSrc ).toBe( '' );
	} );

	test( 'returns empty string if product has no images', () => {
		const imageSrc = getImageSrcFromProduct( { images: null } );

		expect( imageSrc ).toBe( '' );
	} );

	test( 'returns empty string if product has 0 images', () => {
		const imageSrc = getImageSrcFromProduct( { images: [] } );

		expect( imageSrc ).toBe( '' );
	} );

	test( 'returns empty string if product image has no src attribute', () => {
		const imageSrc = getImageSrcFromProduct( { images: [ {} ] } );

		expect( imageSrc ).toBe( '' );
	} );
} );

describe( 'getImageIdFromProduct', () => {
	test( 'returns first image id', () => {
		const imageUrl = getImageIdFromProduct( {
			images: [ { id: 123 } ],
		} );

		expect( imageUrl ).toBe( 123 );
	} );

	test( 'returns 0 if no product was provided', () => {
		const imageUrl = getImageIdFromProduct();

		expect( imageUrl ).toBe( 0 );
	} );

	test( 'returns 0 if product is empty', () => {
		const imageUrl = getImageIdFromProduct( {} );

		expect( imageUrl ).toBe( 0 );
	} );

	test( 'returns 0 if product has no images', () => {
		const imageUrl = getImageIdFromProduct( { images: null } );

		expect( imageUrl ).toBe( 0 );
	} );

	test( 'returns 0 if product has 0 images', () => {
		const imageUrl = getImageIdFromProduct( { images: [] } );

		expect( imageUrl ).toBe( 0 );
	} );

	test( 'returns 0 if product image has no src attribute', () => {
		const imageUrl = getImageIdFromProduct( { images: [ {} ] } );

		expect( imageUrl ).toBe( 0 );
	} );
} );
woocommerce-blocks/assets/js/utils/attributes-query.js000064400000004160151335517650017317 0ustar00/**
 * External dependencies
 */
import { sortBy } from 'lodash';

/**
 * Given a query object, removes an attribute filter by a single slug.
 *
 * @param {Array} query Current query object.
 * @param {Function} setQuery Callback to update the current query object.
 * @param {Object} attribute An attribute object.
 * @param {string} slug Term slug to remove.
 */
export const removeAttributeFilterBySlug = (
	query = [],
	setQuery = () => {},
	attribute,
	slug = ''
) => {
	// Get current filter for provided attribute.
	const foundQuery = query.filter(
		( item ) => item.attribute === attribute.taxonomy
	);

	const currentQuery = foundQuery.length ? foundQuery[ 0 ] : null;

	if (
		! currentQuery ||
		! currentQuery.slug ||
		! Array.isArray( currentQuery.slug ) ||
		! currentQuery.slug.includes( slug )
	) {
		return;
	}

	const newSlugs = currentQuery.slug.filter( ( item ) => item !== slug );

	// Remove current attribute filter from query.
	const returnQuery = query.filter(
		( item ) => item.attribute !== attribute.taxonomy
	);

	// Add a new query for selected terms, if provided.
	if ( newSlugs.length > 0 ) {
		currentQuery.slug = newSlugs.sort();
		returnQuery.push( currentQuery );
	}

	setQuery( sortBy( returnQuery, 'attribute' ) );
};

/**
 * Given a query object, sets the query up to filter by a given attribute and attribute terms.
 *
 * @param {Array} query Current query object.
 * @param {Function} setQuery Callback to update the current query object.
 * @param {Object} attribute An attribute object.
 * @param {Array} attributeTerms Array of term objects.
 * @param {string} operator Operator for the filter. Valid values: in, and.
 */
export const updateAttributeFilter = (
	query = [],
	setQuery = () => {},
	attribute,
	attributeTerms = [],
	operator = 'in'
) => {
	const returnQuery = query.filter(
		( item ) => item.attribute !== attribute.taxonomy
	);

	if ( attributeTerms.length === 0 ) {
		setQuery( returnQuery );
	} else {
		returnQuery.push( {
			attribute: attribute.taxonomy,
			operator,
			slug: attributeTerms.map( ( { slug } ) => slug ).sort(),
		} );
		setQuery( sortBy( returnQuery, 'attribute' ) );
	}
};
woocommerce-blocks/assets/js/utils/attributes.js000064400000003625151335517650016161 0ustar00/**
 * External dependencies
 */
import { getSetting } from '@woocommerce/settings';

const ATTRIBUTES = getSetting( 'attributes', [] );

/**
 * Format an attribute from the settings into an object with standardized keys.
 *
 * @param {Object} attribute The attribute object.
 */
const attributeSettingToObject = ( attribute ) => {
	if ( ! attribute || ! attribute.attribute_name ) {
		return null;
	}
	return {
		id: parseInt( attribute.attribute_id, 10 ),
		name: attribute.attribute_name,
		taxonomy: 'pa_' + attribute.attribute_name,
		label: attribute.attribute_label,
	};
};

/**
 * Format all attribute settings into objects.
 */
const attributeObjects = ATTRIBUTES.reduce( ( acc, current ) => {
	const attributeObject = attributeSettingToObject( current );

	if ( attributeObject.id ) {
		acc.push( attributeObject );
	}

	return acc;
}, [] );

/**
 * Get attribute data by taxonomy.
 *
 * @param {number} attributeId The attribute ID.
 * @return {Object|undefined} The attribute object if it exists.
 */
export const getAttributeFromID = ( attributeId ) => {
	if ( ! attributeId ) {
		return;
	}
	return attributeObjects.find( ( attribute ) => {
		return attribute.id === attributeId;
	} );
};

/**
 * Get attribute data by taxonomy.
 *
 * @param {string} taxonomy The attribute taxonomy name e.g. pa_color.
 * @return {Object|undefined} The attribute object if it exists.
 */
export const getAttributeFromTaxonomy = ( taxonomy ) => {
	if ( ! taxonomy ) {
		return;
	}
	return attributeObjects.find( ( attribute ) => {
		return attribute.taxonomy === taxonomy;
	} );
};

/**
 * Get the taxonomy of an attribute by Attribute ID.
 *
 * @param {number} attributeId The attribute ID.
 * @return {string} The taxonomy name.
 */
export const getTaxonomyFromAttributeId = ( attributeId ) => {
	if ( ! attributeId ) {
		return null;
	}
	const attribute = getAttributeFromID( attributeId );
	return attribute ? attribute.taxonomy : null;
};
woocommerce-blocks/assets/js/utils/products.js000064400000001654151335517650015636 0ustar00/**
 * Get the src of the first image attached to a product (the featured image).
 *
 * @param {Object} product The product object to get the images from.
 * @param {Array} product.images The array of images, destructured from the product object.
 * @return {string} The full URL to the image.
 */
export function getImageSrcFromProduct( product ) {
	if ( ! product || ! product.images || ! product.images.length ) {
		return '';
	}

	return product.images[ 0 ].src || '';
}

/**
 * Get the ID of the first image attached to a product (the featured image).
 *
 * @param {Object} product The product object to get the images from.
 * @param {Array} product.images The array of images, destructured from the product object.
 * @return {number} The ID of the image.
 */
export function getImageIdFromProduct( product ) {
	if ( ! product || ! product.images || ! product.images.length ) {
		return 0;
	}

	return product.images[ 0 ].id || 0;
}
woocommerce-blocks/assets/js/utils/shared-attributes.js000064400000002255151335517650017423 0ustar00/**
 * External dependencies
 */
import { getSetting } from '@woocommerce/settings';

export const sharedAttributeBlockTypes = [
	'woocommerce/product-best-sellers',
	'woocommerce/product-category',
	'woocommerce/product-new',
	'woocommerce/product-on-sale',
	'woocommerce/product-top-rated',
];

export default {
	/**
	 * Number of columns.
	 */
	columns: {
		type: 'number',
		default: getSetting( 'default_columns', 3 ),
	},

	/**
	 * Number of rows.
	 */
	rows: {
		type: 'number',
		default: getSetting( 'default_rows', 3 ),
	},

	/**
	 * How to align cart buttons.
	 */
	alignButtons: {
		type: 'boolean',
		default: false,
	},

	/**
	 * Product category, used to display only products in the given categories.
	 */
	categories: {
		type: 'array',
		default: [],
	},

	/**
	 * Product category operator, used to restrict to products in all or any selected categories.
	 */
	catOperator: {
		type: 'string',
		default: 'any',
	},

	/**
	 * Content visibility setting
	 */
	contentVisibility: {
		type: 'object',
		default: {
			title: true,
			price: true,
			rating: true,
			button: true,
		},
	},

	/**
	 * Are we previewing?
	 */
	isPreview: {
		type: 'boolean',
		default: false,
	},
};
woocommerce-blocks/assets/js/filters/get-block-attributes.js000064400000002744151335517650020337 0ustar00/**
 * External dependencies
 */
import { addFilter } from '@wordpress/hooks';

/**
 * Adjust attributes on load to set defaults so default attributes get saved.
 *
 * @param {Object} blockAttributes Original block attributes.
 * @param {Object} blockType       Block type settings.
 *
 * @return {Object} Filtered block attributes.
 */
const setBlockAttributeDefaults = ( blockAttributes, blockType ) => {
	if ( blockType.name.startsWith( 'woocommerce/' ) ) {
		Object.keys( blockType.attributes ).map( ( key ) => {
			if (
				typeof blockAttributes[ key ] === 'undefined' &&
				typeof blockType.defaults !== 'undefined' &&
				typeof blockType.defaults[ key ] !== 'undefined'
			) {
				blockAttributes[ key ] = blockType.defaults[ key ];
			}
			return key;
		} );
	}
	return blockAttributes;
};

/**
 * Hook into `blocks.getBlockAttributes` to set default attributes (if blocks
 * define them separately) when a block is loaded.
 *
 * This is a workaround for Gutenberg which does not save "default" attributes
 * to the post, which means if defaults change, all existing blocks change too.
 *
 * See https://github.com/WordPress/gutenberg/issues/7342
 *
 * To use this, the block name needs a `woocommerce/` prefix, and as well
 * as defining `attributes` during block registration, you must also declare an
 * array called `defaults`. Defaults should be omitted from `attributes`.
 */
addFilter(
	'blocks.getBlockAttributes',
	'woocommerce-blocks/get-block-attributes',
	setBlockAttributeDefaults
);
woocommerce-blocks/assets/js/filters/block-list-block.js000064400000004717151335517650017441 0ustar00/**
 * External dependencies
 */
import { Component } from '@wordpress/element';
import { createHigherOrderComponent } from '@wordpress/compose';
import { getBlockType } from '@wordpress/blocks';
import { addFilter } from '@wordpress/hooks';

/**
 * withDefaultAttributes HOC for editor.BlockListBlock.
 *
 * @param	object BlockListBlock The BlockListBlock element.
 */
const withDefaultAttributes = createHigherOrderComponent(
	( BlockListBlock ) => {
		class WrappedComponent extends Component {
			mounted = false;

			componentDidMount() {
				const { block, setAttributes } = this.props;

				if ( block.name.startsWith( 'woocommerce/' ) ) {
					setAttributes( this.getAttributesWithDefaults() );
				}
			}

			componentDidUpdate() {
				if (
					this.props.block.name.startsWith( 'woocommerce/' ) &&
					! this.mounted
				) {
					this.mounted = true;
				}
			}

			getAttributesWithDefaults() {
				const blockType = getBlockType( this.props.block.name );
				let attributes = this.props.attributes;

				if (
					! this.mounted &&
					this.props.block.name.startsWith( 'woocommerce/' ) &&
					typeof blockType.attributes !== 'undefined' &&
					typeof blockType.defaults !== 'undefined'
				) {
					attributes = Object.assign(
						{},
						this.props.attributes || {}
					);
					Object.keys( blockType.attributes ).map( ( key ) => {
						if (
							typeof attributes[ key ] === 'undefined' &&
							typeof blockType.defaults[ key ] !== 'undefined'
						) {
							attributes[ key ] = blockType.defaults[ key ];
						}
						return key;
					} );
				}
				return attributes;
			}

			render() {
				return (
					<BlockListBlock
						{ ...this.props }
						attributes={ this.getAttributesWithDefaults() }
					/>
				);
			}
		}
		return WrappedComponent;
	},
	'withDefaultAttributes'
);

/**
 * Hook into `editor.BlockListBlock` to set default attributes (if blocks
 * define them separately) when a block is inserted.
 *
 * This is a workaround for Gutenberg which does not save "default" attributes
 * to the post, which means if defaults change, all existing blocks change too.
 *
 * See https://github.com/WordPress/gutenberg/issues/7342
 *
 * To use this, the block name needs a `woocommerce/` prefix, and as well
 * as defining `attributes` during block registration, you must also declare an
 * array called `defaults`. Defaults should be omitted from `attributes`.
 */
addFilter(
	'editor.BlockListBlock',
	'woocommerce-blocks/block-list-block',
	withDefaultAttributes
);
woocommerce-blocks/assets/js/filters/exclude-draft-status-from-analytics.js000064400000002072151335517650023274 0ustar00/**
 * External dependencies
 */
import { addFilter } from '@wordpress/hooks';

addFilter(
	'woocommerce_admin_analytics_settings',
	'woocommerce-blocks/exclude-draft-status-from-analytics',
	( settings ) => {
		const removeCheckoutDraft = ( optionsGroup ) => {
			if ( optionsGroup.key === 'customStatuses' ) {
				return {
					...optionsGroup,
					options: optionsGroup.options.filter(
						( option ) => option.value !== 'checkout-draft'
					),
				};
			}
			return optionsGroup;
		};

		const actionableStatusesOptions = settings.woocommerce_actionable_order_statuses.options.map(
			removeCheckoutDraft
		);
		const excludedStatusesOptions = settings.woocommerce_excluded_report_order_statuses.options.map(
			removeCheckoutDraft
		);

		return {
			...settings,
			woocommerce_actionable_order_statuses: {
				...settings.woocommerce_actionable_order_statuses,
				options: actionableStatusesOptions,
			},
			woocommerce_excluded_report_order_statuses: {
				...settings.woocommerce_excluded_report_order_statuses,
				options: excludedStatusesOptions,
			},
		};
	}
);
woocommerce-blocks/assets/css/style.scss000064400000016351151335517650014506 0ustar00.wc-block-link-button {
	@include link-button();
}

.wc-block-suspense-placeholder {
	@include placeholder();
	@include force-content();
}

// These styles are for the server side rendered product grid blocks.
.wc-block-grid__products .wc-block-grid__product-image {
	text-decoration: none;
	display: block;
	position: relative;

	a {
		text-decoration: none;
		border: 0;
		outline: 0;
		box-shadow: none;
	}

	img {
		height: auto;
		width: 100%;

		&[hidden] {
			display: none;
		}
	}
}
.edit-post-visual-editor .editor-block-list__block .wc-block-grid__product-title,
.editor-styles-wrapper .wc-block-grid__product-title,
.wc-block-grid__product-title {
	font-family: inherit;
	line-height: 1.2em;
	font-weight: 700;
	padding: 0;
	color: inherit;
	font-size: inherit;
	display: block;
}
.wc-block-grid__product-price {
	display: block;

	.wc-block-grid__product-price__regular {
		margin-right: 0.5em;
	}
}
.wc-block-grid__product-add-to-cart.wp-block-button {
	word-break: break-word;
	white-space: normal;
	.wp-block-button__link {
		word-break: break-word;
		white-space: normal;
		margin: 0 auto !important;
		display: inline-flex;
		justify-content: center;
		text-align: center;
		// Set button font size and padding so it inherits from parent.
		padding: 0.5em 1em;
		font-size: 1em;

		&.loading {
			opacity: 0.25;
		}

		&.added::after {
			font-family: WooCommerce; /* stylelint-disable-line */
			content: "\e017";
			margin-left: 0.5em;
			display: inline-block;
			width: auto;
			height: auto;
		}

		&.loading::after {
			font-family: WooCommerce; /* stylelint-disable-line */
			content: "\e031";
			animation: spin 2s linear infinite;
			margin-left: 0.5em;
			display: inline-block;
			width: auto;
			height: auto;
		}
	}
}
// Remove button sugar if unlikely to fit.
.has-5-columns:not(.alignfull),
.has-6-columns,
.has-7-columns,
.has-8-columns,
.has-9-columns {
	.wc-block-grid__product-add-to-cart.wp-block-button .wp-block-button__link::after {
		content: "";
		margin: 0;
	}
}

.wc-block-grid__product-rating {
	display: block;

	.wc-block-grid__product-rating__stars,
	.star-rating {
		overflow: hidden;
		position: relative;
		width: 5.3em;
		height: 1.618em;
		line-height: 1.618;
		font-size: 1em;
		/* stylelint-disable-next-line font-family-no-missing-generic-family-keyword */
		font-family: star;
		font-weight: 400;
		margin: 0 auto;
		text-align: left;

		&::before {
			content: "\53\53\53\53\53";
			top: 0;
			left: 0;
			right: 0;
			position: absolute;
			opacity: 0.5;
			color: #aaa;
			white-space: nowrap;
		}
		span {
			overflow: hidden;
			top: 0;
			left: 0;
			right: 0;
			position: absolute;
			padding-top: 1.5em;
		}
		span::before {
			content: "\53\53\53\53\53";
			top: 0;
			left: 0;
			right: 0;
			position: absolute;
			color: #000;
			white-space: nowrap;
		}
	}
}
.wc-block-grid__product-onsale {
	@include font-size(small);
	padding: em($gap-smallest) em($gap-small);
	display: inline-block;
	width: auto;
	border: 1px solid #43454b;
	border-radius: 3px;
	color: #43454b;
	background: #fff;
	text-align: center;
	text-transform: uppercase;
	font-weight: 600;
	z-index: 9;
	position: relative;
}

// Element spacing.
.wc-block-grid__product {
	.wc-block-grid__product-image,
	.wc-block-grid__product-title {
		margin: 0 0 $gap-small;
	}
	// If centered when toggling alignment on, use auto margins to prevent flexbox stretching it.
	.wc-block-grid__product-price,
	.wc-block-grid__product-rating,
	.wc-block-grid__product-add-to-cart,
	.wc-block-grid__product-onsale {
		margin: 0 auto $gap-small;
	}
}

.theme-twentysixteen {
	.wc-block-grid {
		// Prevent white theme styles.
		.price ins {
			color: #77a464;
		}
	}
}

.theme-twentynineteen {
	.wc-block-grid__product {
		font-size: 0.88889em;
	}
	// Change the title font to match headings.
	.wc-block-grid__product-title,
	.wc-block-grid__product-onsale,
	.wc-block-components-product-title,
	.wc-block-components-product-sale-badge {
		font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif;
	}
	.wc-block-grid__product-title::before {
		display: none;
	}
	.wc-block-grid__product-onsale,
	.wc-block-components-product-sale-badge {
		line-height: 1;
	}
	.editor-styles-wrapper .wp-block-button .wp-block-button__link:not(.has-text-color) {
		color: #fff;
	}
}

.theme-twentytwenty {
	$twentytwenty-headings: -apple-system, blinkmacsystemfont, "Helvetica Neue", helvetica, sans-serif;
	$twentytwenty-highlights-color: #cd2653;

	.wc-block-grid__product-link {
		color: #000;
	}

	.wc-block-grid__product-title,
	.wc-block-components-product-title {
		font-family: $twentytwenty-headings;
		color: $twentytwenty-highlights-color;
		@include font-size(regular);
	}

	.wp-block-columns .wc-block-components-product-title {
		margin-top: 0;
	}

	.wc-block-grid__product-price,
	.wc-block-components-product-price {
		&__value,
		.woocommerce-Price-amount {
			font-family: $twentytwenty-headings;
			font-size: 0.9em;
		}

		del {
			opacity: 0.5;
		}

		ins {
			text-decoration: none;
		}
	}

	.wc-block-grid__product-rating,
	.star-rating {
		font-size: 0.7em;

		.wc-block-grid__product-rating__stars,
		.wc-block-components-product-rating__stars {
			line-height: 1;
		}
	}

	.wc-block-grid__product-add-to-cart > .wp-block-button__link,
	.wc-block-components-product-button > .wp-block-button__link {
		font-family: $twentytwenty-headings;
	}

	.wc-block-grid__products .wc-block-grid__product-onsale,
	.wc-block-components-product-sale-badge {
		background: $twentytwenty-highlights-color;
		color: #fff;
		font-family: $twentytwenty-headings;
		font-weight: 700;
		letter-spacing: -0.02em;
		line-height: 1.2;
		text-transform: uppercase;
	}

	// Override style from WC Core that set its position to absolute.
	// These rulesets can be removed once https://github.com/woocommerce/woocommerce/pull/26516 is released.
	.wc-block-grid__products .wc-block-components-product-sale-badge {
		position: static;
	}
	.wc-block-grid__products .wc-block-grid__product-image .wc-block-components-product-sale-badge {
		position: absolute;
	}

	// These styles are not applied to the All Products atomic block, so it can be positioned normally.
	.wc-block-grid__products .wc-block-grid__product-onsale:not(.wc-block-components-product-sale-badge) {
		position: absolute;
		right: 4px;
		top: 4px;
		z-index: 1;
	}

	.wc-block-active-filters__title,
	.wc-block-attribute-filter__title,
	.wc-block-price-filter__title,
	.wc-block-stock-filter__title {
		@include font-size(regular);
	}

	.wc-block-active-filters .wc-block-active-filters__clear-all {
		@include font-size(smaller);
	}

	.wc-block-grid__product-add-to-cart.wp-block-button .wp-block-button__link {
		@include font-size(smaller);
		padding: em($gap-smaller);
	}

	@media only screen and (min-width: 768px) {
		.wc-block-grid__products .wc-block-grid__product-onsale {
			@include font-size(small);
			padding: em($gap-smaller);
		}
	}

	@media only screen and (min-width: 1168px) {
		.wc-block-grid__products .wc-block-grid__product-onsale {
			@include font-size(small);
			padding: em($gap-smaller);
		}
	}
}

// Default screen-reader styles. Included as a fallback for themes that don't have support.
.screen-reader-text {
	@include visually-hidden();
}
.screen-reader-text:focus {
	@include visually-hidden-focus-reveal();
}
woocommerce-blocks/assets/css/editor.scss000064400000002776151335517650014642 0ustar00// Import the woocommerce components stylesheet
@import "~@woocommerce/components/build-style/style.css";

// Hack to hide preview overflow.
.editor-block-preview__content {
	overflow: hidden;
}

// Align the block icons in edit mode
.components-placeholder__label .gridicon,
.components-placeholder__label .material-icon {
	margin-right: 1ch;
	fill: currentColor;
}

// Remove the list styling, which is added back by core GB styles.
.editor-styles-wrapper {
	.wc-block-grid {
		.wc-block-grid__products {
			list-style: none;
			margin: 0 (-$gap*0.5) $gap;
			padding: 0;

			.wc-block-grid__product {
				margin: 0 0 $gap-large 0;
			}
		}

		&.components-placeholder {
			padding: 2em 1em;
		}

		&.is-loading,
		&.is-not-found {
			display: block;
		}
	}
}

// Style inline notices in the inspector.
.components-base-control {
	+ .wc-block-base-control-notice {
		margin: -$gap 0 $gap;
	}

	& + .wc-block-base-control-notice:last-child {
		margin: -$gap 0 $gap-small;
	}
}

// Selectors with extra specificity to override some editor styles.
.woocommerce-search-list__list.woocommerce-search-list__list {
	box-sizing: border-box;
	margin: 0;
	padding: 0;
}

.woocommerce-search-list__selected.woocommerce-search-list__selected > ul {
	list-style: none;
	margin: 0;
	padding: 0;
}

.theme-twentytwenty {
	.wp-block {
		.wc-block-grid__product-title,
		.wc-block-active-filters__title,
		.wc-block-attribute-filter__title,
		.wc-block-price-filter__title,
		.wc-block-stock-filter__title {
			@include font-size(regular);
		}
	}
}
woocommerce-blocks/assets/css/abstracts/_colors.scss000064400000001355151335517650016772 0ustar00@import "node_modules/@wordpress/base-styles/colors";
@import "node_modules/@automattic/color-studio/dist/color-variables";

// Bright colors
$no-stock-color: $alert-red;
$low-stock-color: $alert-yellow;
$in-stock-color: $alert-green;
$discount-color: $alert-green;

$placeholder-color: var(--global--color-primary, $gray-200);
$input-border-gray: #50575e;
$input-border-dark: rgba(255, 255, 255, 0.4);
$input-disabled-dark: rgba(255, 255, 255, 0.3);
$controls-border-dark: rgba(255, 255, 255, 0.6);
$input-text-active: #2b2d2f;
$input-placeholder-dark: rgba(255, 255, 255, 0.6);
$input-text-dark: #fff;
$input-background-dark: rgba(0, 0, 0, 0.1);
$select-dropdown-dark: #1e1e1e;
$select-dropdown-light: #fff;
$select-item-dark: rgba(0, 0, 0, 0.4);
woocommerce-blocks/assets/css/abstracts/_mixins.scss000064400000010573151335517650017002 0ustar00$fontSizes: (
	"smaller": 0.75,
	"small": 0.875,
	"regular": 1,
	"large": 1.25,
	"larger": 2,
);

// Maps a named font-size to its predefined size. Units default to em, but can
// be changed using the multiplier parameter.
@mixin font-size($sizeName, $multiplier: 1em) {
	font-size: map-get($fontSizes, $sizeName) * $multiplier;
}

@keyframes loading-fade {
	0% {
		opacity: 0.7;
	}
	50% {
		opacity: 1;
	}
	100% {
		opacity: 0.7;
	}
}

// Adds animation to placeholder section
@mixin placeholder() {
	animation: loading-fade 1.2s ease-in-out infinite;
	background-color: $placeholder-color !important;
	color: $placeholder-color !important;
	outline: 0 !important;
	border: 0 !important;
	box-shadow: none;
	pointer-events: none;
	max-width: 100%;

	// Forces direct descendants to keep layout but lose visibility.
	> * {
		visibility: hidden;
	}

	@media screen and (prefers-reduced-motion: reduce) {
		animation: none;
	}
}

@mixin force-content() {
	&::after {
		content: "\00a0";
	}
}

// Hide an element from sighted users, but available to screen reader users.
@mixin visually-hidden() {
	border: 0;
	clip: rect(1px, 1px, 1px, 1px);
	clip-path: inset(50%);
	height: 1px;
	width: 1px;
	margin: -1px;
	overflow: hidden;
	/* Many screen reader and browser combinations announce broken words as they would appear visually. */
	overflow-wrap: normal !important;
	word-wrap: normal !important;
	padding: 0;
	position: absolute !important;
	width: 1px;
}

@mixin visually-hidden-focus-reveal() {
	background-color: #fff;
	border-radius: 3px;
	box-shadow: 0 0 2px 2px rgba(0, 0, 0, 0.6);
	clip: auto !important;
	clip-path: none;
	color: $input-text-active;
	display: block;
	font-size: 0.875rem;
	font-weight: 700;
	height: auto;
	left: 5px;
	line-height: normal;
	padding: 15px 23px 14px;
	text-decoration: none;
	top: 5px;
	width: auto;
	z-index: 100000;
}

@mixin reset-box() {
	border: 0;
	border-radius: 0;
	margin: 0;
	padding: 0;
	vertical-align: baseline;
}

@mixin reset-typography() {
	color: inherit;
	font-family: inherit;
	font-size: inherit;
	font-style: inherit;
	font-weight: inherit;
	letter-spacing: inherit;
	line-height: inherit;
	text-decoration: inherit;
	text-transform: inherit;
}

// Reset <h1>, <h2>, etc. styles as if they were text. Useful for elements that must be headings for a11y but don't need those styles.
@mixin text-heading() {
	@include reset-box();
	@include reset-typography();
	box-shadow: none;
	display: inline;

	background: transparent;
}

// Reset <button> style as if it was text. Useful for elements that must be `<button>` for a11y but don't need those styles.
@mixin text-button() {
	@include reset-box();
	@include reset-typography();
	background: transparent;
	box-shadow: none;
	display: inline;
	text-shadow: none;

	&:hover,
	&:focus,
	&:active {
		background: transparent;
	}
}

// Reset <button> style so we can use link style for action buttons.
@mixin link-button() {
	@include text-button();
	text-decoration: underline;
}

// Makes sure long words are broken if they overflow the container.
@mixin wrap-break-word() {
	// This is the current standard, works in most browsers.
	overflow-wrap: anywhere;
	// Safari supports word-break.
	word-break: break-word;
	// IE11 doesn't support overflow-wrap neither word-break: break-word, so we fallback to -ms-work-break: break-all.
	-ms-word-break: break-all;
}

// Shows a border with the current color and a custom opacity. That can't be achieved
// with normal border because `currentColor` doesn't allow tweaking the opacity, and
// setting the opacity of the entire element would change the children's opacity too.
@mixin with-translucent-border($border-width: 1px, $opacity: 0.3) {
	position: relative;

	&::after {
		border-style: solid;
		border-width: $border-width;
		bottom: 0;
		content: "";
		display: block;
		left: 0;
		opacity: $opacity;
		pointer-events: none;
		position: absolute;
		right: 0;
		top: 0;
	}
}

// Wraps the content with a media query specially targeting IE11.
@mixin ie11() {
	@media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) {
		@content;
	}
}

// Converts a px unit to em.
@function em($size, $base: 16px) {
	@return math.div($size, $base) * 1em;
}

// Encodes hex colors so they can be used in URL content.
@function encode-color($color) {
	@if type-of($color) != "color" or str-index(#{$color}, "#") != 1 {
		@return $color;
	}

	$hex: str-slice(ie-hex-str($color), 4);
	@return "%23" + unquote("#{$hex}");
}
woocommerce-blocks/assets/css/abstracts/_breakpoints.scss000064400000004262151335517650020012 0ustar00/* stylelint-disable block-closing-brace-newline-after */

// Breakpoints
// Forked from https://github.com/Automattic/wp-calypso/blob/46ae24d8800fb85da6acf057a640e60dac988a38/assets/stylesheets/shared/mixins/_breakpoints.scss

// Think very carefully before adding a new breakpoint.
// The list below is based on wp-admin's main breakpoints
// See https://github.com/WordPress/gutenberg/tree/master/packages/viewport#usage
$breakpoints: 480px, 600px, 782px, 960px, 1280px, 1440px;

// @todo refactor breakpoints so they use the mixins from Gutenberg
// https://github.com/WordPress/gutenberg/blob/master/packages/base-styles/_mixins.scss
@mixin breakpoint($sizes...) {
	@each $size in $sizes {
		@if type-of($size) == string {
			$approved-value: 0;
			@each $breakpoint in $breakpoints {
				$and-larger: ">" + $breakpoint;
				$and-smaller: "<" + $breakpoint;

				@if $size == $and-smaller {
					$approved-value: 1;
					@media (max-width: $breakpoint) {
						@content;
					}
				}
				@else {
					@if $size == $and-larger {
						$approved-value: 2;
						@media (min-width: $breakpoint + 1) {
							@content;
						}
					}
					@else {
						@each $breakpoint-end in $breakpoints {
							$range: $breakpoint + "-" + $breakpoint-end;
							@if $size == $range {
								$approved-value: 3;
								@media (min-width: $breakpoint + 1) and (max-width: $breakpoint-end) {
									@content;
								}
							}
						}
					}
				}
			}
			@if $approved-value == 0 {
				$sizes: "";
				@each $breakpoint in $breakpoints {
					$sizes: $sizes + " " + $breakpoint;
				}
				@warn "ERROR in breakpoint(#{ $size }) : You can only use these sizes[ #{$sizes} ] using the following syntax [ <#{ nth($breakpoints, 1) } >#{ nth($breakpoints, 1) } #{ nth($breakpoints, 1) }-#{ nth($breakpoints, 2) } ]";
			}
		}
		@else {
			$sizes: "";
			@each $breakpoint in $breakpoints {
				$sizes: $sizes + " " + $breakpoint;
			}
			@error "ERROR in breakpoint(#{ $size }) : Please wrap the breakpoint $size in parenthesis. You can use these sizes[ #{$sizes} ] using the following syntax [ <#{ nth($breakpoints, 1) } >#{ nth($breakpoints, 1) } #{ nth($breakpoints, 1) }-#{ nth($breakpoints, 2) } ]";
		}
	}
}

/* stylelint-enable */
woocommerce-blocks/assets/css/abstracts/_variables.scss000064400000000444151335517650017437 0ustar00@import "node_modules/@wordpress/base-styles/variables";

$gap-largest: $grid-unit-50;
$gap-larger: 4.5 * $grid-unit;
$gap-large: $grid-unit-30;
$gap: $grid-unit-20;
$gap-small: $grid-unit-15;
$gap-smaller: $grid-unit-10;
$gap-smallest: $grid-unit-05;

// Cart block
$cart-image-width: 5rem;
woocommerce-blocks/readme.txt000064400000230577151335517650012365 0ustar00=== WooCommerce Blocks ===
Contributors: automattic, woocommerce, claudiulodro, tiagonoronha, jameskoster, ryelle, levinmedia, aljullu, mikejolley, nerrad, joshuawold, assassinateur, haszari, mppfeiffer, nielslange, opr18, ralucastn, tjcafferkey
Tags: gutenberg, woocommerce, woo commerce, products, blocks, woocommerce blocks
Requires at least: 5.8
Tested up to: 5.8
Requires PHP: 7.0
Stable tag: 6.1.0
License: GPLv3
License URI: https://www.gnu.org/licenses/gpl-3.0.html

== Description ==

WooCommerce Blocks are the easiest, most flexible way to display your products on posts and pages!

For more information on what blocks are available, and how to use them, check out the official documentation: https://docs.woocommerce.com/document/woocommerce-blocks/

**Note: Feature plugin for WooCommerce + Gutenberg. This plugin serves as a space to iterate and explore new Blocks and updates to existing blocks for WooCommerce, and how WooCommerce might work with the block editor.**

Use this plugin if you want access to the bleeding edge of available blocks for WooCommerce. However, stable blocks are bundled into WooCommerce, and can be added from the "WooCommerce" section in the block inserter.

- **Featured Product Block**
- **Featured Category Block**
- **Hand-picked Products Block**
- **Best Selling Products Block**
- **Top Rated Products Block**
- **Newest Products Block**
- **On Sale Products Block**
- **Products by Category Block**
- **Products by Tag Block**
- **Products by Attribute Block**
- **Product Categories List Block**
- **Reviews by Product**
- **Reviews by Category**
- **All Reviews**
- **Product Search**
- **All Products**
- **Filter Products by Price**
- **Filter Products by Attribute**
- **Filter Products by Stock**
- **Active Product Filters**
- **Cart**
- **Checkout**

== Getting Started ==

= Minimum Requirements =

* Latest release versions of WordPress and WooCommerce ([read more here](https://developer.woocommerce.com/?p=9998))
* PHP version 7.0 or greater (PHP 7.4 or greater is recommended)
* MySQL version 5.6 or greater

Visit the [WooCommerce server requirements documentation](https://docs.woocommerce.com/document/server-requirements/) for a detailed list of server requirements.

= Automatic installation =

Automatic installation is the easiest option as WordPress handles the file transfers itself and you don’t need to leave your web browser. To do an automatic install of this plugin, log in to your WordPress dashboard, navigate to the Plugins menu and click Add New.

In the search field type “WooCommerce Blocks” and click Search Plugins. Once you’ve found this plugin you can view details about it such as the point release, rating and description. Most importantly of course, you can install it by simply clicking “Install Now”.

= Manual installation =

The manual installation method involves downloading the plugin and uploading it to your webserver via your favourite FTP application. The WordPress codex contains [instructions on how to do this here](https://codex.wordpress.org/Managing_Plugins#Manual_Plugin_Installation).

= Sample data =

WooCommerce comes with some sample data you can use to populate the products and get started building Products blocks quickly and easily. You can use the core [CSV importer](https://docs.woocommerce.com/document/product-csv-importer-exporter/) or our [CSV Import Suite plugin](https://woocommerce.com/products/product-csv-import-suite/) to import sample_products.csv.

= Where can I report bugs or contribute to the project? =

Bugs should be reported in the [WooCommerce Blocks GitHub repository](https://github.com/woocommerce/woocommerce-gutenberg-products-block/).

= This is awesome! Can I contribute? =

Yes you can! Join in on our [GitHub repository](https://github.com/woocommerce/woocommerce-gutenberg-products-block/) :)

Release and roadmap notes available on the [WooCommerce Developers Blog](https://woocommerce.wordpress.com/2019/01/15/woocommerce-blocks-1-3-0-release-notes/)

== Screenshots ==

1. The Featured Product Block
2. Selecting a product for the Featured Product Block
3. Selecting Products for the Hand-picked Products Block
4. Selecting categories in the Products By Category block
5. WooCommerce Product Blocks in the block inserter menu

== Changelog ==

= 6.1.0 - 2021-10-12 =

#### Bug Fixes

- Fix the dropdown list in Product Category List Block for nested categories ([4920](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/4920))
- Fixed string translations within the All Products Block. ([4897](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/4897))
- Filter By Price: Update aria values to be more representative of the actual values presented. ([4839](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/4839))
- Fixed: Filter button from Filter Products by Attribute block is not aligned with the input field. ([4814](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/4814))
- Remove IntersectionObserver shim in favor of dropping IE11 support. ([4808](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/4808))

= 6.0.0 - 2021-09-28 =

#### Enhancements

- Checkout v2: The checkout now supports inner blocks that allow for greater customizability. This update also includes an optional Terms and Conditions field. ([4745](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/4745))
- Added global styles to All Reviews, Reviews by Category and Reviews by Product blocks. Now it's possible to change the text color and font size of those blocks. ([4323](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/4323))
- Improve the Checkout Order Summary block accessibility by making more info available to screen readers. ([4810](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/4810))
- Update canMakePayment to receive cart as argument and make it react to changes in billingData.  Improve the performance of calculating canMakePayment after changes in the Checkout block. ([4776](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/4776))
- Add support for extensions to filter express payment methods. ([4774](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/4774))

#### Bug Fixes

- Checkout: Throw an exception if there is a shipping method required and one isn't selected at the time of placing an order. ([4784](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/4784))
- Fix infinite recursion when removing an attribute filter from the Active filters block. ([4816](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/4816))
- Show placeholder message in the shipping section when there are no rates. ([4765](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/4765))
- Update All Reviews block so it honors 'ratings enabled' and 'show avatars' preferences. ([4764](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/4764))
- Fix state validation if base location has a state, and the address has an optional state. ([4761](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/4761))
- Products by Category: Moved renderEmptyResponsePlaceholder to separate method to prevent unnecessary rerender. ([4751](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/4751))
- Fix validation message styling so they never overlap other elements. ([4734](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/4734))
- Removed `receiveCart` method that was exposed in a couple of SlotFills by mistake. ([4730](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/4730))
- Fix calculation of number of reviews in the Reviews by Category block. ([4729](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/4729))

#### Documentation

- Add documentation for registerPaymentMethodExtensionCallbacks. ([4834](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/4834))

#### Performance

- Removed `wp-blocks` dependency from several frontend scripts. ([4767](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/4767))


= 5.9.1 - 2021-09-23 =

#### Bug fixes

- Fix infinite recursion when removing an attribute filter from the Active filters block. ([4816](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/4816))

= 5.9.0 - 2021-09-14 =

#### Enhancements

- Add extensibility point for extensions to filter payment methods. ([4668](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/4668))

#### Bug Fixes

- Fix Product Search block displaying incorrectly ([4740](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/4740))


= 5.8.0 - 2021-08-31 =

#### Enhancements

- Introduced the `__experimental_woocommerce_blocks_checkout_update_order_from_request` hook to the Checkout Store API. ([4610](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/4610))
- Add "Filter Products by Stock" block. ([4145](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/4145))

#### Bug Fixes

- Prevent Product Category List from displaying incorrectly when used on the shop page. ([4587](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/4587))
- Add label element to `<BlockTitle>` component. ([4585](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/4585))

#### Documentation

- Add Extensibility info to Store API readme. ([4605](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/4605))
- Update documentation for the snackbarNoticeVisibility filter. ([4508](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/4508))
- Add documentation for `extensionCartUpdate` method - this allows extensions to update the client-side cart after it has been modified on the server. ([4377](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/4377))

= 5.7.2 - 2021-09-23 =

#### Bug Fixes

- Fix infinite recursion when removing an attribute filter from the Active filters block. #4816
- Fix Product Search block displaying incorrectly. #4740

= 5.7.1 - 2021-08-30 =

#### Bug Fixes

- Disable Cart, Checkout, All Products & filters blocks from the widgets screen

= 5.7.0 - 2021-08-16 =

#### Enhancements

- Featured Category Block:  Allow user to re-select categories using the edit icon. ([4559](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/4559))
- Checkout: Switch from select element to combobox for country and state inputs so contents are searchable. ([4369](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/4369))

#### Bug Fixes

- Adjusted store notice class names so that error notices show the correct icons. ([4568](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/4568))
- Fix autofill triggering validation errors for valid values in Checkout block. ([4561](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/4561))
- Reviews by Category: Show review count instead of product count. ([4552](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/4552))
- Add server side rendering to search block so the block can be used by non-admins. ([4551](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/4551))
- Twenty Twenty: Fix broken sale badge left alignment. ([4549](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/4549))
- Twenty Twenty-One: Adjust removable chip background color. ([4547](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/4547))
- Fix handpicked product selections when a store has over 100 products. ([4534](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/4534))
- Replace .screen-reader-text with .hidden for elements that are not relevant to screen readers. ([4530](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/4530))

#### Various

- Performance improvements in the Cart and Checkout block extensibility points. ([4570](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/4570))

= 5.6.0 - 2021-08-01 =

#### Enhancements

- Ensure payment method icons are constrained to a reasonable size in the Cart and Checkout blocks. ([4427](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/4427))
- Update pagination arrows to match core. ([4364](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/4364))

#### Bug Fixes

- Remove unnecessary margin from Cart block loading skeleton to avoid content jump. ([4498](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/4498))
- Fixed the SKU search on the /wc/store/products endpoint. ([4469](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/4469))
- Ensure cart totals displayed within a Panel component are aligned well and do not have extra padding. ([4435](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/4435))
- Fix memory leak when previewing transform options for the All reviews block. ([4428](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/4428))

#### Various

- Deprecate snackbarNotices filter in favour of snackbarNoticeVisibility to allow extensions to hide snackbar notices in the Cart and Checkout blocks. ([4417](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/4417))

= 5.5.1, 5.4.1, 5.3.2, 5.2.1, 5.1.1, 5.0.1, 4.9.2, 4.8.1, 4.7.1, 4.6.1, 4.5.3, 4.4.3, 4.3.1, 4.2.1, 4.1.1, 4.0.1, 3.9.1, 3.8.1, 3.7.2, 3.6.1, 3.5.1, 3.4.1, 3.3.1, 3.2.1, 3.1.1, 3.0.1, 2.9.1, 2.8.1, 2.7.2, 2.6.2, 2.5.16 - 2021-07-14 =

#### Security fix

- This release fixes a critical vulnerability. More information about this can be found here: https://woocommerce.com/posts/critical-vulnerability-detected-july-2021/

= 5.5.0 - 2021-07-21 =

#### Enhancements

- Add screen reader text to price ranges. ([4367](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/4367))
- Allow HTML in All Products Block Product Titles. ([4363](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/4363))

#### Bug Fixes

- Ensure product grids display as intended in the editor. ([4424](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/4424))
- Wrap components in the Cart and Checkout sidebar in a TotalsWrapper. This will ensure consistent spacing and borders are applied to items in the sidebar. ([4415](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/4415))
- Remove `couponName` filter and replace it with `coupons` filter. ([4312](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/4312))
- Fix filtering by product type on Store API. ([4422](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/4422))

#### Documentation

- Add documentation for the IntegrationInterface which extension developers can use to register scripts, styles, and data with WooCommerce Blocks. ([4394](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/4394))

= 5.4.0 - 2021-06-22 =

#### Enhancements

- Made script and style handles consistent. ([4324](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/4324))
- Show loading state in the express payments area whilst payment is processing or the page is redirecting. ([4228](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/4228))

#### Bug Fixes

- Fix a warning shown when fees are included in the order. ([4360](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/4360))
- Prevent PHP notice for variable products without enabled variations. ([4317](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/4317))

#### Various

- Allow products to be added by SKU in the Hand-picked Products block. ([4366](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/4366))
- Add Slot in the Discounts section of the Checkout sidebar to allow third party extensions to render their own components there. ([4310](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/4310))

= 5.3.2 - 2021-06-28 =
- Remove the ability to filter snackbar notices ([#4398](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/4398)).

= 5.3.1 - 2021-06-15 =

- Fix Product Categories List block display in Site Editor ([#4335](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/4335)).
- Make links in the Product Categories List block unclickable in the editor ([#4339](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/4339)).
- Fix rating stars not being shown in the Site Editor ([#4345](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/4345)).

= 5.3.0 - 2021-06-08 =

#### Enhancements

- Hide the Cart and Checkout blocks from the new block-based widget editor. ([4303](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/4303))
- Provide block transforms for legacy widgets with a feature-complete block equivalent. ([4292](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/4292))

#### Bug Fixes

- Fix some missing translations from the Cart and Checkout blocks. ([4295](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/4295))
- Fix the flickering of the Proceed to Checkout button on quantity update in the Cart Block. ([4293](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/4293))
- Fix a bug in which Cart Widget didn't update when adding items from the All Products block. ([4291](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/4291))
- Fix a display issue when itemized taxes are enabled, but no products in the cart are taxable. ([4284](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/4284))
- Fix an issue where an attempt to add an out-of-stock product to the cart was made when clicking the "Read more" button. ([4265](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/4265))

#### Compatibility

- Add the ability for extensions to register callbacks to be executed by Blocks when the cart/extensions endpoint is hit. Extensions can now tell Blocks they need to do some server-side processing which will update the cart. ([4298](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/4298))

#### Various

- Add Slot in the Discounts section of the cart sidebar to allow third party extensions to render their own components there. ([4248](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/4248))
- Move `ValidatedTextInput` to the `@woocommerce/blocks-checkout` package. ([4238](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/4238))

= 5.2.0 - 2021-05-25 =

#### Enhancements

- Added a key prop to each `CartTotalItem` within `usePaymentMethodInterface `. ([4240](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/4240))
- Hide legacy widgets with a feature-complete block equivalent from the widget area block inserter. ([4237](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/4237))
- Hide the All Products Block from the Customizer Widget Areas until full support is achieved. ([4225](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/4225))
- Sync customer data during checkout with draft orders. ([4197](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/4197))
- Update the display of the sidebar/order summary in the Cart and Checkout blocks. ([4180](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/4180))
- Improved accessibility and styling of the controls of several of ours blocks. ([4100](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/4100))

#### Bug Fixes

- Hide tax breakdown if the total amount of tax to be paid is 0. ([4262](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/4262))
- Prevent Coupon code panel from appearing in stores were coupons are disabled. ([4202](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/4202))
- For payment methods, only use `canMakePayment` in the frontend (not the editor) context. ([4188](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/4188))
- Fix duplicate react keys in ProductDetails component. ([4187](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/4187))
- Fix sending of confirmation emails for orders when no payment is needed. ([4186](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/4186))
- Stopped a warning being shown when using WooCommerce Force Sells and adding a product with a Synced Force Sell to the cart. ([4182](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/4182))

#### Various

- Move Button and Label components to `@woocommerce/blocks-checkout` package. ([4222](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/4222))
- Add couponName filter to allow extensions to modify how coupons are displayed in the Cart and Checkout summary. ([4166](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/4166))

= 5.1.0 - 2021-05-10 =

#### Enhancements

- Improve error message displayed when a payment method didn't have all its dependencies registered. ([4176](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/4176))
- Improvements to `emitEventWithAbort`. ([4158](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/4158))

#### Bug Fixes

- Fix issue in which email and phone fields are cleared when using a separate billing address. ([4162](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/4162))

= 5.0.0 - 2021-04-28 =

#### Enhancements

- Added support to the Store API for batching requests. This allows multiple POST requests to be made at once to reduce the number of separate requests being made to the API. ([4075](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/4075))

#### Bug Fixes

- Prevent parts of old addresses being displayed in the shipping calculator when changing countries. ([4038](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/4038))

#### Refactor

- Rename onCheckoutBeforeProcessing to onCheckoutValidationBeforeProcessing.
- Switched to `rest_preload_api_request` for API hydration in cart and checkout blocks. ([4090](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/4090))
- Introduced AssetsController and BlockTypesController classes (which replace Assets.php and Library.php). ([4094](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/4094))
- Replaced usage of the `woocommerce_shared_settings` hook. This will be deprecated. ([4092](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/4092))

 = 4.9.1 - 2021-04-13 =

 #### Bug Fixes

 - Check if Cart and Checkout are registered before removing payment methods. ([4056](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/4056))

= 4.9.0 - 2021-04-12 =
#### Enhancements

- Added compatibility with the Google Analytics Integration. Block events, including cart and checkout, can now be tracked.

##### Dev note

Blocks are now compatible with the Google Analytics Integration: https://woocommerce.com/products/woocommerce-google-analytics/ If using Google Analytics with GTAG support (and a `G-` prefixed site ID), block events will also be tracked. This includes:

- Product searches in the Product Search Block
- Product views in the product grid blocks and All Products Block
- Add to cart events
- Cart item changes
- Checkout progress events. ([4020](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/4020))

#### Bug Fixes

- Use font color in payment methods border. ([4051](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/4051))
- Load translation file for JS files that has translatable strings. ([4050](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/4050))
- Stop shipping package titles line-breaks occurring in the middle of a word. ([4049](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/4049))
- Fixed styling issues on the cart and checkout page in Twenty(X) themes. ([4046](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/4046))
- Fix headline alignment in the empty state of the cart block. ([4044](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/4044))
- Fix button alignment in Featured Product and Featured Category blocks. ([4028](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/4028))

#### Technical debt

- Removed legacy handling for SSR blocks that rendered shortcodes. ([4010](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/4010))


= 4.8.0 - 2021-04-01 =

#### Enhancements

- Registered payment methods now have access to the `shouldSavePayment` prop in their components (which indicates whether the shopper has checked the save payment method checkbox). ([3990](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/3990))
- Payment methods implementing the `savedTokenComponent` configuration property will now have the `onPaymentProcessing` event available to the registered component. ([3982](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/3982))

#### Bug Fixes

- Fix customer address country saving to orders in certain circumstances. ([4013](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/4013))
- Prevent error messages returned by the API from displaying raw HTML. ([4005](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/4005))
- Fix the Proceed to checkout button click bug happening when the Coupon error is visible in the Cart block. ([3996](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/3996))

= 4.7.0 - 2021-03-16 =

#### Enhancements

- A new configuration property is available to registered payment methods for additional logic handling of saved payment method tokens. ([3961](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/3961))
- Provided billing data to payment method extensions so they can decide if payment is possible. ([3922](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/3922))
- Prevent errant payment methods from keeping Cart and Checkout blocks from loading. ([3920](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/3920))
- Fix block elements that don't play well with dark backgrounds. ([3887](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/3887))

#### Bug Fixes

- Remove extra padding from payment methods with no description. ([3952](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/3952))
- Fix "save payment" checkbox not showing for payment methods. ([3950](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/3950))
- Fix cart preview when shipping rates are set to be hidden until an address is entered. ([3946](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/3946))
- Sync cart item quantity if its Implicitly changed. ([3907](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/3907))
- Fix FSE not being visible when WC Blocks was enabled. ([3898](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/3898))
- Ensure sale badges have a uniform height in the Cart block. ([3897](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/3897))


= 4.6.0 - 2021-03-01 =

#### Bug Fixes

- Handle out-of-stock product visibility setting in All Products block. ([3859](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/3859))
- Show cart item subtotal instead of total in Cart and Checkout blocks ([#3905](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/3905))
- Fix button styles in Twenty Nineteen theme. ([3862](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/3862))
- Return correct sale/regular prices for variable products in the Store API. ([3854](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/3854))
- Remove shadows from text buttons and gradient background from selects in some themes. ([3846](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/3846))
- Hide Browse Shop link in cart block empty state when there is no shop page. ([3845](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/3845))

#### Various

- StoreAPI: Inject Order and Cart Controllers into Routes. ([3871](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/3871))
- Update Panel component class names to follow guidelines. More info can be found in our theming docs: https://github.com/woocommerce/woocommerce-gutenberg-products-block/blob/18dd54f07262b4d1dcf15561624617f824fcdc22/docs/theming/class-names-update-460.md. ([3860](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/3860))
- Refactor block type registration to support 3rd party integrations.

##### Dev note:

An important note that internally, this release has modified how `AbstractBlock` (the base class for all of our blocks) functions, and how it loads assets. `AbstractBlock` is internal to this project and does not seem like something that would ever need to be extended by 3rd parties, but note if you are doing so for whatever reason, your implementation would need to be updated to match. ([3829](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/3829))


= 4.5.2 - 2021-02-23 =

#### Bug Fixes

- Fix cart items showing a price of 0 when currency format didn't have decimals. ([3876](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/3876))
- Ensure the sale badge is displayed correctly below short prices in the Cart block. ([3879](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/3879))

= 4.5.1 - 2021-02-16 =

This release fixes an error that some users experienced when their site automatically updated to a temporarily broken version of the 4.5.0 release.

= 4.5.0 - 2021-02-16 =

#### Enhancements

- Login links on the checkout should use the account page. ([3844](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/3844))
- Prevent checkout linking to trashed terms and policy pages. ([3843](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/3843))
- Improved nonce logic by moving nonces to cart routes only. ([3812](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/3812))
- If coupons become invalid between applying to a cart and checking out, show the user a notice when the order is placed. ([3810](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/3810))
- Improve design of cart and checkout sidebars. ([3797](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/3797))
- Improve error displayed to customers when an item's stock status changes during checkout. ([3703](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/3703))
- Dev - Block Checkout will now respect custom address locales and custom country states via core filter hooks. ([3662](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/3662))
- Update checkout block payment methods UI. ([3439](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/3439))

#### Bug Fixes

- Fix JS warning if two cart products share the same name. ([3814](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/3814))
- Align place order button to the right of the block. ([3803](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/3803))
- Ensure special characters are displayed properly in the Cart sidebar. ([3721](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/3721))
- Fix a bug where the total price of items did not include tax in the cart and checkout blocks. ([3851](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/3851))

= 4.4.2 - 2021-02-05 =

### Bug Fixes

- Fix - Conflicts with 3rd Party payment method integrations. ([3796](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/3796))

= 4.4.0 - 2021-02-02 =

#### Enhancements

- Design tweaks to the cart page which move the quantity picker below each cart item and improve usability on mobile. ([3734](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/3734))

#### Bug Fixes

- Fix - Ensure empty categories are correctly hidden in the product categories block. ([3765](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/3765))
- Fix - Added missing wrapper div within FeaturedCategory and FeatureProduct blocks. ([3746](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/3746))
- Fix - Set correct text color in BlockErrorBoundry notices. ([3738](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/3738))
- Hidden cart item meta data will not be rendered in the Cart and Checkout blocks. ([3732](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/3732))
- Fix - Improved accessibility of product image links in the products block by using correct aria tags and hiding empty image placeholders. ([3722](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/3722))
- Add missing aria-label for stars image in the review-list-item component. ([3706](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/3706))
- Prevent "X-WC-Store-API-Nonce is invalid" error when going back to a page with the products block using the browser back button. ([3770](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/3770))

#### compatibility

- Hide the All Products Block from the new Gutenberg Widget Areas until full support is achieved. ([3737](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/3737))
- Legacy `star-rating` class name has been removed from Product rating block (inside All Products block). That element is still selectable with the `.wc-block-components-product-rating` class name. ([3717](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/3717))

= 4.3.0 - 2021-01-20 =

#### Bug Fixes

- Update input colors and alignment. ([3597](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/3597))

#### Enhancements

- Store API - Fix selected rate in cart shipping rates response. ([3680](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/3680))
- Create get_item_responses_from_schema abstraction. ([3679](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/3679))
- Show itemized fee rows in the cart/checkout blocks. ([3678](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/3678))
- Extensibility: Show item data in Cart and Checkout blocks and update the variation data styles. ([3665](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/3665))
- Introduce SlotFill for Sidebar. ([3361](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/3361))

= 4.2.0 - 2021-01-06 =

#### Bug Fixes

- Fix an error that was blocking checkout with some user saved payment methods. ([3627](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/3627))

= 4.1.0 - 2020-12-24 =

#### Enhancements

- Add the ability to directly upload an image in Featured Category and Featured Product blocks. ([3579](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/3579))
- Fix coupon code button height not adapting to the font size. ([3575](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/3575))
- Fixed Coupon Code panel not expanding/contracting in some themes. ([3569](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/3569))
- Fix: Added fallback styling for screen reader text. ([3557](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/3557))

#### Bug Fixes

- Fix nonce issues when adding product to cart from All Products. ([3598](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/3598))
- Fix bug inside Product Search in the editor. ([3578](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/3578))
- Fix console warnings in WordPress 5.6. ([3577](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/3577))
- Fixed text visibility in select inputs when using Twenty Twenty-One theme's dark mode. ([3554](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/3554))
- Fix product list images skewed in Widgets editor. ([3553](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/3553))
- Add address validation to values posted to the Checkout via StoreApi. ([3552](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/3552))
- Fix Fees not visible in Cart & Checkout blocks when order doesn't need shipping. ([3521](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/3521))

#### compatibility

- Fix All Products block edit screen. ([3547](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/3547))

#### wp dependency

- Removed compatibility with packages in WordPress 5.3. ([3541](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/3541))
- Bumped the minimum WP required version to 5.4. ([3537](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/3537))

= 4.0.0 - 2020-12-07 =

#### Enhancements

- Dev: Change register_endpoint_data to use an array of params instead of individual params. ([3478](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/3478))
- Dev: Expose store/cart via ExtendRestApi to extensions. ([3445](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/3445))
- Dev: Added formatting classes to the Store API for extensions to consume.

#### Bug Fixes

- Checkout block: Prevent `Create an account` from creating up a user account if the order fails coupon validation. ([3423](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/3423))
- Make sure cart is initialized before the CartItems route is used in the Store API. ([3488](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/3488))
- Fix notice close button color in Twenty Twenty One dark mode. ([3472](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/3472))
- Remove held stock for a draft order if an item is removed from the cart. ([3468](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/3468))
- Ensure correct alignment of checkout notice's dismiss button. ([3455](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/3455))
- Fixed a bug in Checkout block (Store API) causing checkout to fail when using an invalid coupon and creating an account.
- Checkout block: Correctly handle cases where the order fails with an error (e.g. invalid coupon) and a new user account is created. ([3429](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/3429))
- Dev: Refactored and reordered Store API checkout processing to handle various edge cases and better support future extensibility. ([3454](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/3454))

= 3.9.0 - 2020-11-25 =

See release post [here](https://developer.woocommerce.com/?p=8234)

#### Enhancements

- Expose `discount_type` in Store API coupon endpoints. ([3399](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/3399))
- Exclude checkout-draft orders from WC Admin reports and My Account > Orders. ([3379](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/3379))

#### Bug Fixes

- Hide spinner on cart block's "Proceed to Checkout" link when page unloads. ([3436](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/3436))
- Fixed express payment methods processing not completing when Stripe payment method active. ([3432](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/3432))
- Refresh PaymentRequest after cancelling payment to prevent addresses remaining populated on repeat attempts. ([3430](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/3430))
- Ensure "Add a note to your order" section is styled correctly when disabled. ([3427](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/3427))
- Prevent checkout step heading text overlapping actual heading on small viewports. ([3425](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/3425))
- Improve Stripe payment request API payment method availability. ([3424](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/3424))
- Stop hidden products from being linked in cart and checkout blocks. ([3415](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/3415))
- Show Express Payment Method Error Notices after Payment Failure. ([3410](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/3410))
- Fix cart block `isLarge` console error in the editor when running WordPress 5.6 beta. ([3408](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/3408))
- Fix: Orders not being placed when paying with an Express payment method from the Cart block. ([3403](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/3403))
- Fix incorrect usage of static method in Stripe payment method integration. ([3400](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/3400))
- Cart and checkout should respect the global "Hide shipping costs until an address is entered" setting. ([3383](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/3383))
- Sync shipping address with billing address when shipping address fields are disabled. This fixes a bug where taxes would not reflect changes in billing address when they are set to be calculated from billing address ([3358](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/3358))

#### refactor

- Support a plain js configuration argument to payment method registration APIs. ([3404](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/3404))

= 3.8.0 - 2020-11-10 =
- Show the phone number field in the billing section when shipping is disabled in settings. ([3376](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/3376))
- Add new doc referencing feature flags and experimental interfaces. ([3348](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/3348))
- Add __experimental_woocommerce_blocks_checkout_order_processed action. ([3238](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/3238))

= 3.7.1 - 2020-11-05 =

#### Bug Fixes
- Ensure that accounts are not created via checkout block request if account registration is disabled for WooCommerce ([#3371](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/3371))

= 3.7.0 - 2020-10-29 =

#### Enhancements

- Allow shoppers to sign-up for an account from the Checkout block. ([3331](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/3331))
- Standardise & refactor colors scss to align with Gutenberg colors and WooCommerce brand. ([3300](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/3300))

#### Bug Fixes

- Fix PHP 8 error when argument is not invocable in AssetsDataRegistry::Add_data. ([3315](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/3315))
- Improve layout of Cart block line item quantity selector & price on smaller screens. ([3299](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/3299))
- Correctly process orders with $0 total (e.g. via coupon) in Checkout block. ([3298](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/3298))
- Respect Enable Taxes setting for checkout block taxes display. ([3291](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/3291))
- Fix 3D secure payment errors. ([3272](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/3272))
- Show current selected attributes when re-edit Products by Attribute block. ([3185](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/3185))


= 3.6.0 - 2020-10-12 =

#### Bug Fixes

- Make 'retry' property on errors from checkoutAfterProcessingWithSuccess/Error observers default to true if it's undefined. ([3261](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/3261))
- Ensure new payment methods are only displayed when no saved payment method is selected. ([3247](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/3247))
- Load WC Blocks CSS after editor CSS. ([3219](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/3219))
- Restore saved payment method data after closing an express payment method. ([3210](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/3210))

#### refactor

- Don't load contents of payment method hidden tabs. ([3227](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/3227))

= 3.5.0 - 2020-09-29 =

#### Bug Fixes

- Use light default background colour for country/state dropdowns. ([3189](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/3189))
- Fix broken Express Payment Method use in the Checkout block for logged out or incognito users. ([3165](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/3165))
- Fix State label for Spain. ([3147](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/3147))
- Don't throw an error when registering a payment method fails. ([3134](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/3134))

#### refactor

- Use noticeContexts from useEmitResponse instead of hardcoded values. ([3161](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/3161))

= 3.4.0 - 2020-09-14 =

#### Bug Fixes

- Ensure shopper saved card is used as default payment method (default was being overwritten in some circumstances). ([3131](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/3131))
- Fix Cart & Checkout sidebar layout broken in some themes. ([3111](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/3111))
- Fix product reviews schema date fields to use new (WP 5.5) `date-time` format. ([3109](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/3109))
- Use wp_login_url instead of hardcoding login path. ([3090](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/3090))
- Fix an issue with COD not showing when first enabled. ([3088](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/3088))
- Fix JS console error when COD is enabled and no shipping method is available. ([3086](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/3086))

#### performance

- Create DebouncedValidatedTextInput component. ([3108](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/3108))

#### refactor

- Merge ProductPrice atomic block and component. ([3065](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/3065))

= 3.3.0 - 2020-09-02 =
- enhancement: Show express payment methods in the Cart block (for example: Apple Pay, Chrome Pay). [3004](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/3004)
- bug: Fix alignment of discounted prices in Cart block. [3047](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/3047)
- bug: Fix an issue with products sold individually (max of 1 per cart); the Checkout block now shows a notice if shopper attempts to add another instance of product via an `add-to-cart` link. [2854](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/2854)
- bug: Fixed styling options of the Product Title block (in All Products). [3095](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/3095)


= 3.2.0 - 2020-08-17 =
- Fix 'Add new product' link in All Products block 'No products' placeholder. [#2961](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/2961)
- Fix an undefined variable PHP notice related to Product REST API. [#2962](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/2962)
- Fixed an issue that was making some blocks not to render correctly in the Empty cart template. [#2904](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/2904)
- Fixed an issue that was not rendering the Checkout block in editor when guest checkout was not allowed. [#2958](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/2958)
- Hide the discount badge from Cart items if the value is negative. [#2955](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/2955)
- Hide saved payment methods if their payment gateway has been disabled. [#2975](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/2975)
- Add dark colors and background for Cart & Checkout blocks inputs to support dark backgrounds. [#2981](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/2981)
- The Checkout block allows customers to introduce an order note. This feature can be disabled in the editor. [#2877](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/2877)
- Cart and Checkout form fields show autocapitalized keyboard on mobile depending on the expected value. [#2884](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/2884)
- Cart and Checkout will show a live preview inside the block inserter and style selector. [#2992](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/2992)
- Payment gateways are shown in the correct order as configured in store settings. [#2934](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/2934)
- Fix a cosmetic issue where payment form errors sometimes overlap with card icons. [#2977](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/2977)
- Fixes a styling issue in the Product Search block in the editor. [#3014](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/3014)
- Improved focus styles of error states on form elements. [#2974](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/2974)
- Removed generic icons for Check and Stripe Credit Card to reduce visual clutter in Checkout block. [#2968](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/2968)
- Deprecate wc.wcSettings.setSetting function. [#3010](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/3010)
- Improve behaviour of draft order cleanup to account for clobbered custom shop order status. [#2912](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/2912)

= 3.1.0 - 2020-07-29 =
- Fix missing permissions_callback arg in StoreApi route definitions [#2926](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/2926)
- Fix 'Product Summary' in All Products block is not pulling in the short description of the product [#2913](https://github.com/woocommerce/woocommerce-gutenberg-products-block/issues/2913)
- dev: Add query filter when searching for a table [#2886](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/2886) 👏 @pkelbert
- All Products block: Can now customize text size, color and alignment in Product Title child block. Heading level option is now in block toolbar (was in settings sidebar). [#2860](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/2860)
- All Products block: Can now customize text size, color and alignment in Product Price child block. [#2881](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/2881)

= 3.0.0 - 2020-07-20 =

This release adds support for Cash on Delivery and Bank Transfer payment methods to the checkout block. The payment method extension api for the blocks [has an update to the `canMakePayment` property](https://woocommerce.wordpress.com/?p=6830).

- build: Updated the `automattic/jetpack-autoloader` package to the 2.0 branch. [#2847](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/2847)
- enhancement: Add support for the Bank Transfer (BACS) payment method in the Checkout block. [#2821](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/2821)
- enhancement: Several improvements to make Credit Card input fields display more consistent across different themes and viewport sizes. [#2869](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/2869)
- enhancement: Cart and Checkout blocks show a notification for products on backorder. [#2833](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/2833)
- enhancement: Chip styles of the Filter Products by Attribute and Active Filters have been updated to give a more consistent experience. [#2765](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/2765)
- enhancement: Add protection for rogue filters on order queries when executing cleanup draft orders logic. [#2874](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/2874)
- enhancement: Extend payment gateway extension API so gateways (payment methods) can dynamically disable (hide), based on checkout or order data (such as cart items or shipping method). For example, `Cash on Delivery` can limit availability to specific shipping methods only. [#2840](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/2840) [DN]
- enhancement: Support `Cash on Delivery` core payment gateway in the Checkout block. #2831 [#2831](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/2831)
- performance: Don't load shortcode Cart and Checkout scripts when using the blocks. [#2842](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/2842)
- performance: Scripts only relevant to the frontend side of blocks are no longer loaded in the editor. [#2788](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/2788)
- performance: Lazy Loading Atomic Components [#2777](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/2777)
- performance: Fix unnecessary checks happening for wc_reserved_stock table in site dashboard [#2895](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/2895)
- refactor: Remove dashicon classes [#2848](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/2848)

= 2.9.0 - 2020-07-07 =
- bug: Correctly sort translated state and country drop-down menus in Checkout block. [#2779](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/2779)
- dev: Add storybook story for icon library. [#2787](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/2787)
- dev: Add custom jest matcher `toRenderBlock`, used for confirming blocks are available in the editor in e2e tests. [#2780](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/2780)
- dev: Use consistent Button component in Cart & Checkout blocks. [#2781](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/2781)


= 2.8.0 - 2020-06-23 =
- bug: Cart and Checkout blocks display shipping methods with tax rates if that's how it's set in the settings. [#2748](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/2748)
- bug: Fix an error appearing in the Product Categories List block with _Full Width_ align. [#2700](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/2700)
- enhancement: Added aria-expanded attribute to Change address button in the Cart block [#2603](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/2603)
- enhancement: Fix updating the `wc_reserve_stock` stock_quantity value after making changes to the cart inbetween checkouts. [#2747](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/2747)
- enhancement: Remove background color from Express checkout title. [#2704](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/2704)
- enhancement: Several style enhancements to the Cart and Checkout blocks sidebar. [#2694](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/2694)
- enhancement: The Cart and Checkout blocks now use the font colors provided by the theme. [#2745](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/2745)
- enhancement: Update some class names to match the new guidelines. [Check the docs](https://github.com/woocommerce/woocommerce-gutenberg-products-block/blob/trunk/docs/theming/README.md) in order to see which class names have been updated. [#2691](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/2691) [DN]
- enhancement: Blocks now respect the product image cropping settings. For the All Products block, the user can switch between the cropped thumbnail and the full size image. [#2755](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/2755)

= 2.7.1 - 2020-06-16 =
- bug: Use IE11 friendly code for Dashicon component replacement. [#2708](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/2708)
- bug: Fix PHP warnings produced by StoreAPI endpoints when variations have no prices. [#2722](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/2722)
- bug: Fix missing scoped variable in closure and missing schema definitions. [#2724](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/2724)
- bug: Fix undefined index notice for query_type on the product collection data endpoint. [#2723](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/2723)

= 2.7.0 - 2020-06-09 =
- bug: Fix bug in Checkout block preventing a retry of credit card payment when first credit card used fails and a new one is tried. [#2655](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/2655)
- bug: Avoid some theme style properties leaking into the Cart and Checkout select controls. [#2647](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/2647)
- bug: Fixes to the product grid blocks in Twenty Twenty: discounted prices are no longer underlined and the On Sale badge is correctly positioned in the All Products block. [#2573](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/2573)
- bug: Improved alignment of credit card validation error messages. [#2662](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/2662)
- bug: Show the 'No shipping methods' placeholder in the editor with the _Checkout_ block if there are shipping methods but all of them are disabled. [#2543](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/2543)
- enhancement: Filter block font sizes have been adjusted to be in line with other blocks. [#2594](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/2594)
- enhancement: The All Products block and the other product grid blocks now share more styles and the markup is more similar (see release post or docs to learn how to undo this change). [#2428](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/2428) [DN]
- enhancement: The Cart and Checkout blocks now use the heading styles provided by the theme. [#2597](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/2597)
- enhancement: The Cart block titles have been merged into one. [#2615](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/2615)
- enhancement: The item count badges of the Checkout block have been updated so it looks better in light & dark backgrounds. [#2619](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/2619)
- enhancement: Checkout step progress indicator design has been updated to match the theme headings style. [#2649](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/2649)
- performance: Reduce bundlesize of blocks using @wordpress/components directly. [#2664](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/2664)

= 2.6.1 - 2020-06-01 =

- fix: Updated the wc_reserved_stock table for compatibility with versions of MySql < 5.6.5. [#2590](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/2590)

= 2.6.0 - 2020-05-25 =
**New Blocks**

The Cart and Checkout blocks are released in this version for wider review and testing as a part of our consideration for including them in WooCommerce Core. You can read more [about these blocks here](https://woocommerce.wordpress.com/?p=6384).

Also, note that we are aware of the increased file size for the All Products and Filter blocks frontend JavaScript. It is from some dependency changes. We will be addressing this in the next release.

You can read [more about the release here](https://woocommerce.wordpress.com/?p=6577)

- bug: Add placeholder to the on-sale products block when no results are found. [#1519](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/1519)
- bug: Added correct ellipsis character in Product Search block [#1672](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/1672)
- bug: If product is changed for featured product block, update the link in the button. [#1894](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/1894)
- bug: Import from `@woocommerce/settings` in `@woocommerce/block-settings` [#2330](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/2330)
- dev: Accessibility of the All Products block and filter blocks has been improved. [#1656](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/1656)
- dev: All Products Block: Update sorting labels to match frontend options [#2462](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/2462)
- dev: Change PropType validation for Icon component [#1737](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/1737)
- dev: Changed default rows and columns for product grid blocks to 3x3. [#1613](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/1613)
- dev: Check for instance of WP_Block in render_callback [#2258](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/2258)
- dev: Devs: `ENABLE_REVIEW_RATING` setting was renamed to `REVIEW_RATINGS_ENABLED` and now it also verifies reviews are enabled, to better match WooCommerce API. [#1374](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/1374)
- dev: Fix price filtering when stored prices do not match displayed prices (determined by tax settings). [#1612](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/1612)
- dev: HTML editing is no longer supported in several blocks. [#1395](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/1395)
- dev: Implement __experimentalCreateInterpolateElement for translations. [#1736](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/1736)
- dev: Load WooCommerce Core translations for 'Sale!' and some other strings if translations are unavailable for WooCommerce Blocks. [#1694](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/1694)
- dev: Prevent data hydration on REST requests [#2176](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/2176)
- dev: Show relationship between terms in the active filters block. [#1630](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/1630)
- dev: Table creation validation for install routine [#2287](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/2287)
- dev: Update the icons used in the blocks. [#1644](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/1644)
- enhancement: Add dropdown display style to Filter Products by Attribute block. [#1255](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/1255)
- enhancement: Add option to display a Filter button to Filter Products by Attribute block. [#1332](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/1332)
- enhancement: Add support for image for product categories block [#1739](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/1739)
- enhancement: An error notice will be shown in All Product if the customer is trying to add a product above stock or sold individually. [#2278](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/2278)
- performance: Improvements to REST API performance [#2248](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/2248)
- performance: Avoid loading Assets API during REST requests [#2286](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/2286)

= 2.5.16 - 2020-04-07 =
- Performance: Use the latest version of Jetpack Autoloader. #2132

= 2.5.15 - 2020-03-31 =
- Fix broken product grid blocks styles in old versions of WordPress. #2000

= 2.5.14 - 2020-03-03 =
- Added screen reader text to product counts in the product category list block #1828
- Added screenreader alternative text to the sale badge. #1826
- Product Search block is now compatible with WordPress 5.4 and the last versions of Gutenberg. #1841
- Security: Improved escaping of attributes on blocks. #1854

= 2.5.13 - 2020-02-18 =
- Respect hidden products in All Products block. #1753

= 2.5.12 - 2020-02-05 =
- Fix ratings appearing as text in the editor instead. #1650
- Fix error with the All Products block and Internet Explorer 11 when adding products to the cart. #1642
- bug: Check for instance of WooCommerce and WP_Error before initializing session and cart in `rest_authentication_errors` callback. #1698
- Fix display of price slider when using RTL languages. #1651
- Renamed the "all products" align option so it's clear the final element gets alignment, not just buttons. #1659

= 2.5.11 - 2020-01-20 =
- bug: Fix a javascript error when editing All Products inner blocks "Link to Product Page" option #1593
- bug: Fix an issue in All Products when ordering by newness was reversed #1598
- bug: Fix a javascript error in editor when user re-selects same attribute in Filter Products by Attribute block #1596
- bug: Fix a render issue for product attribute values with ampersand (&) or other special characters #1608
- bug: Fix bug in Safari and other Webkit browsers that was causing the All Products block to show 0 results when resetting the sort value. #1611

= 2.5.10 - 2020-01-09 =
- All Products block: fix wrong price format for variable products with certain currency settings. #1518

= 2.5.9 - 2020-01-07 =
- Fix issue in All Products block that was causing Variable products price to exclude taxes in some cases. #1503

= 2.5.8 - 2020-01-02 =
- Fixed a bug where Filter by Price didn't show up. #1450
- Price filter now allows entering any number in the input fields, even if it's out of constrains. #1457
- Make price slider accurately represent the selected price. #1453

= 2.5.7 - 2019-12-20 =
- Add translation comments and use correct functions #1412, #1415
- bug: Fix Price Filter constraints when price is decimal #1419

= 2.5.6 - 2019-12-17 =
- Fix broken build resulting in blocks not working.

= 2.5.5 - 2019-12-17 =
- bug: Fix broken atomic blocks in the All Products Block #1402
- bug: Only allow one instance of the All Products block per page/post. #1383
- bug: All Products Block: Fix default sort order changes not updating block in editor. #1385
- bug: Normalize set minPrice and maxPrice values by step #1379
- bug: Fix messaging when there are no attributes #1382
- Price Filter: fix NaN values shown in some occasions while loading . #1386
- bug: Fix incorrect property name for price format #1397
- Remove double colon on active filter block price label. #1399
- Fix: Attribute filters were not updating based on changes in the Price filter when query type was set to OR. #1390

= 2.5.4 - 2019-12-11 =
- bug: Fix increase in some bundle sizes #1363

= 2.5.3 - 2019-12-09 =
- Prevent Filter Products by Attribute block hiding non-matching options when Query Type is set to OR. #1339
- Fix price slider layout in narrow columns #1231

= 2.5.2 - 2019-12-02 =
- Fixed a PHP Notice in Featured Category Block when the category is invalid. #1291 👏 @strategio
- Filter Products by Attribute block now uses the attribute label instead of the slug to set the default title. #1271
- Fix Filter Products by Price slider being reset to 0-0 when filters were cleared from the Active Filters block. #1278
- Don't enqueue wcSettings unless the route requires it. #1292
- Add `getAdminLink()` utility method. #1244

= 2.5.1 - 2019-11-26 =
- Fix Products by Tag, Products by Attribute and Hand-picked Products blocks showing an invalid attributes error. #1254
- Fix the price slider updating instantly even when filter button was enabled. #1228
- Honor CSS classes in the editor for blocks added in 2.5. #1227
- Fix variable products price format in All Products block. #1210
- Allow the feature plugin to use WooCommerce Core translated strings. #1242
- Reduce number of queries ran by multiple filter blocks with All Products block. #1233
- Fix heading level setting for the All Products Title Block. #1230
- Fix editor styles (background color) for titles of "Filter by…" blocks. #1256
- Fix bug with cart not updating. #1258
- Fix issue in the Filter by Attribute selector that was preventing to reselect the currently selected attribute. #1264

= 2.5.0 - 2019-11-19 =

- Feature: Introduce an All Products block, a new block listing products using client side rendering. Requires WordPress 5.3.
- Feature: Introduce a Filter Products by Price block. Allow customers to filter the All Products block by price. Requires WordPress 5.3.
- Feature: Introduce a Filter Products by Attribute block which works alongside the new "All products" block. Requires WordPress 5.3.
- Feature: Introduce an Active Filters block that lists all currently used filters. Requires WordPress 5.3.
- Show a friendly error message in the frontend if blocks throw a JS error.
- Show a message in the editor if no products are found rather than show nothing.
- Show previews for all included blocks in the block inserter. Requires WordPress 5.3.
- Products on Sale, Products Tag and Product Search blocks have new icons.
- Officialy deprecate NPM package `@woocommerce/block-library`.
- Use Server Side Rendering for Product Category List block to remove the need to pass large amounts of data around when not needed.
- RTL fixes to several blocks.
- All block icons are displayed gray in the editor shortcuts inserter.
- Make it easier for themes to style the Product Categories List block: new class names allow writing simpler selectors and it's now possible to remove the parentheses around the count number.

= 2.4.1 - 2019-08-30 =

- Fix conflict with WooCommerce Admin.

= 2.4.0 - 2019-08-29 =
- Feature: A new block named 'All Reviews' was added in order to display a list of reviews from all products and categories of your store. #902
- Feature: Added Reviews by Product block.
- Feature: Added Reviews by Category block.
- Feature: Added a new product search block to insert a product search field on a page.
- Enhancement: Add error handling for API requests to the featured product block.
- Enhancement: Allow hidden products in Hand-picked Products block.
- Fix: Prevented block settings being output on every route.  Now they are only needed when the route has blocks requiring them.
- Dev: Introduced higher order components, global data handlers, and refactored some blocks.
- Dev: Created new HOCs for retrieving data: `withProduct`, `withComponentId`, `withCategory`.
- Dev: Export block settings to an external global `wc.blockSettings` that can be reliably used by extensions by enqueuing their script with the `wc-block-settings` as the handle. #903
- Dev: Added new generic base components: `<OrderSelect />` and `<Label />` so they can be shared between different blocks. #905

= 2.3.1 - 2019-08-27 =

- Fix: Fix deprecation notices with PHP 7.4.
- Fix: Removed unused screen-reader-text css styles for buttons which caused some theme conflicts.
- Fix: Left align stars to fix alignment in Storefront.
- Fix: Best-sellers block query results #917
- Fix: Fix duplicated translatable string #843

= 2.3.0 - 2019-08-12 =

- Feature: Added a new Featured Category Block; feature a category and show a link to it's archive.
- Feature: Added a new Products by Tag(s) block.
- Feature: Allow individual variations to be selected in the Featured Product block.
- Feature: Added a button alignment option to product grid blocks to align buttons horizontally across the row.
- Feature: Added a cancel button to the product category block editor to discard unsaved changes.
- Enhancement: Change the toggle for list type in Product Category List block to a button toggle component for clarity.
- Build: Updated build process and plugin structure to follow modern best practices. Minimum PHP version bumped to 5.6.
- Fix: Correctly hide products from grids when visibility is hidden.
- Fix: Fix Featured Category block using radio buttons instead of checkboxes.
- Fix: Use externals for frontend dependencies so they are shared between extensions and blocks. That saves 2.57MB on page weight.
- Fix: Load frontend scripts dynamically only when the page contains a block that requires them.
- Fix: Reduce dependencies of JavaScript powered frontend blocks.
- Fix: Disable HTML editing on dynamic blocks which have no content.
- Fix: Hide background opacity control in Featured Product settings if there is no background image.
- Fix: Reduce CSS specificity to make styling easier.
- Fix: Fix author access to API for Hand-picked Products block.

= 2.2.1 - 2019-07-04 =

- Fix: Allow custom CSS classes on grid blocks.
- Fix: Allow custom CSS classes on featured product block.
- Fix: Allow custom CSS classes on product categories list.

= 2.2.0 - 2019-06-26 =

- Feature: Add Product Categories List navigation block for showing a list of categories on your site.
- Enhancement: All grid blocks are now rendered directly by the blocks code, not using the shortcode.
- Enhancement: Brand the WooCommerce Blocks for better discoverability in the block inserter.
- Build: Update build process to dynamically generate required WordPress dependencies.
- Build: Update packages.

= 2.1.0 - 2019-05-14 =

- Feature: Add focal point picker to the Featured Product block, so you can adjust the background image position (only available on WP 5.2+ or with Gutenberg plugin).
- Fix: Improved fetching products from API, so searching for products in Featured Product & Hand-picked Products is faster for stores with over 200 products.
- Fix: It might be possible to request over 100 products for the editor preview, but this would cause an API error - we now limit the preview request to 100 products.
- Build: Update build script to show visual progress indicator.
- Build: Update packages.

= 2.0.1 - 2019-04-22 =

- Fix: Fix warnings about blocks already being registered.
- Fix: Fix a conflict with WooCommerce 3.6 and WooCommerce Blocks 1.4 (this change only applies to the version of blocks bundled with WooCommerce core).

= 2.0.0 - 2019-04-18 =

- **BREAKING:** Requires WordPress 5.0+, WooCommerce 3.6+
- **BREAKING:** Remove the legacy block entirely
- **BREAKING:** Remove the `wc-pb/v3/*` endpoints in favor of new core `wc-blocks/v1/*` endpoints
- Feature: Add content visibility settings to show/hide title, price, rating, button
- Feature: Add transforms between basic product grid blocks
- Fix: Add product rating display to preview, to better match front end
- Fix: Product titles render HTML correctly in preview
- Fix: Icons are now aligned correctly in placeholders
- Fix: Grid block preview column width now matches the front-end
- Fix: Webpack now builds using a custom jsonp callback, fixing possible collisions with other projects
- API: Change namespace, endpoints now accessed at `/wc/blocks/*`
- API: Add `catalog_visibility` parameter for fetching products
- API: Update structure of attribute term endpoint to return `attribute.slug`, `attribute.name` etc
- API: Update parameters to use full names, `category_operator`, `attribute_operator`
- Components: Move SearchListControl to `@woocommerce/components` library
- Components: Added new control component GridContentControl to manage content visibility
- Build: Reorganize CSS into one file for editor preview, and one file for front-end styles
- Build: Move registration code to a new class
- Build: Update packages
woocommerce-blocks/templates/emails/customer-new-account-blocks.php000064400000002647151335517650021700 0ustar00<?php
/**
 * Customer new account email - html.
 *
 * This is intended as a replacement to WC_Email_Customer_New_Account(),
 * with a set password link instead of including the new password in email
 * content.
 *
 * @package  WooCommerce/Blocks
 */

defined( 'ABSPATH' ) || exit;

do_action( 'woocommerce_email_header', $email_heading, $email ); ?>

<?php /* translators: %s: Customer username */ ?>
<p><?php printf( esc_html__( 'Hello %s,', 'woocommerce' ), esc_html( $user_login ) ); ?></p>
<?php /* translators: %1$s: Site title, %2$s: Username, %3$s: My account link */ ?>
<p><?php printf( esc_html__( 'Thanks for creating an account on %1$s. Your username is %2$s. You can access your account area to view orders, change your password, and more at: %3$s', 'woocommerce' ), esc_html( $blogname ), '<strong>' . esc_html( $user_login ) . '</strong>', make_clickable( esc_url( wc_get_page_permalink( 'myaccount' ) ) ) ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?></p>
<?php if ( $set_password_url ) : ?>
	<p><a href="<?php echo esc_attr( $set_password_url ); ?>"><?php printf( esc_html__( 'Click here to set your new password.', 'woocommerce' ) ); ?></a></p>
<?php endif; ?>

<?php
/**
 * Show user-defined additional content - this is set in each email's settings.
 */
if ( $additional_content ) {
	echo wp_kses_post( wpautop( wptexturize( $additional_content ) ) );
}

do_action( 'woocommerce_email_footer', $email );
woocommerce-blocks/templates/emails/plain/customer-new-account-blocks.php000064400000003032151335517650022770 0ustar00<?php
/**
 * Customer new account email - text.
 *
 * This is intended as a replacement to WC_Email_Customer_New_Account(),
 * with a set password link instead of including the new password in email
 * content.
 *
 * @package  WooCommerce/Blocks
 */

defined( 'ABSPATH' ) || exit;

echo "=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n";
echo esc_html( wp_strip_all_tags( $email_heading ) );
echo "\n=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n\n";

/* translators: %s: Customer username */
echo sprintf( esc_html__( 'Hi %s,', 'woocommerce' ), esc_html( $user_login ) ) . "\n\n";
/* translators: %1$s: Site title, %2$s: Username, %3$s: My account link */
echo sprintf( esc_html__( 'Thanks for creating an account on %1$s. Your username is %2$s. You can access your account area to view orders, change your password, and more at: %3$s', 'woocommerce' ), esc_html( $blogname ), esc_html( $user_login ), esc_html( wc_get_page_permalink( 'myaccount' ) ) ) . "\n\n";

if ( $set_password_url ) {
	echo esc_html__( 'To set your password, visit the following address: ', 'woocommerce' ) . "\n\n";
	echo esc_html( $set_password_url ) . "\n\n";
}

echo "\n\n----------------------------------------\n\n";

/**
 * Show user-defined additional content - this is set in each email's settings.
 */
if ( $additional_content ) {
	echo esc_html( wp_strip_all_tags( wptexturize( $additional_content ) ) );
	echo "\n\n----------------------------------------\n\n";
}

echo wp_kses_post( apply_filters( 'woocommerce_email_footer_text', get_option( 'woocommerce_email_footer_text' ) ) );
woocommerce-blocks/patches/wordpress-components+11.1.6.patch000064400000024716151335517650017766 0ustar00diff --git a/node_modules/wordpress-components/build-module/combobox-control/index.js b/node_modules/wordpress-components/build-module/combobox-control/index.js
index 51c59c1..93cbddc 100644
--- a/node_modules/wordpress-components/build-module/combobox-control/index.js
+++ b/node_modules/wordpress-components/build-module/combobox-control/index.js
@@ -1,19 +1,10 @@
-import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
-import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
-import _createClass from "@babel/runtime/helpers/esm/createClass";
-import _inherits from "@babel/runtime/helpers/esm/inherits";
-import _possibleConstructorReturn from "@babel/runtime/helpers/esm/possibleConstructorReturn";
-import _getPrototypeOf from "@babel/runtime/helpers/esm/getPrototypeOf";
 import { createElement } from "@wordpress/element";
 
-function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
-
-function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
-
 /**
  * External dependencies
  */
 import classnames from 'classnames';
+import { noop, deburr } from 'lodash';
 /**
  * WordPress dependencies
  */
@@ -34,77 +25,47 @@ import BaseControl from '../base-control';
 import Button from '../button';
 import { Flex, FlexBlock, FlexItem } from '../flex';
 import withFocusOutside from '../higher-order/with-focus-outside';
-var DetectOutside = withFocusOutside( /*#__PURE__*/function (_Component) {
-  _inherits(_class, _Component);
-
-  var _super = _createSuper(_class);
-
-  function _class() {
-    _classCallCheck(this, _class);
-
-    return _super.apply(this, arguments);
+const DetectOutside = withFocusOutside(class extends Component {
+  handleFocusOutside(event) {
+    this.props.onFocusOutside(event);
   }
 
-  _createClass(_class, [{
-    key: "handleFocusOutside",
-    value: function handleFocusOutside(event) {
-      this.props.onFocusOutside(event);
-    }
-  }, {
-    key: "render",
-    value: function render() {
-      return this.props.children;
-    }
-  }]);
-
-  return _class;
-}(Component));
+  render() {
+    return this.props.children;
+  }
 
-function ComboboxControl(_ref) {
+});
+
+function ComboboxControl({
+  value,
+  label,
+  options,
+  onChange,
+  onFilterValueChange = noop,
+  hideLabelFromVision,
+  help,
+  allowReset = true,
+  className,
+  messages = {
+    selected: __('Item selected.')
+  }
+}) {
   var _currentOption$label;
 
-  var value = _ref.value,
-      label = _ref.label,
-      options = _ref.options,
-      onChange = _ref.onChange,
-      onFilterValueChange = _ref.onFilterValueChange,
-      hideLabelFromVision = _ref.hideLabelFromVision,
-      help = _ref.help,
-      _ref$allowReset = _ref.allowReset,
-      allowReset = _ref$allowReset === void 0 ? true : _ref$allowReset,
-      className = _ref.className,
-      _ref$messages = _ref.messages,
-      messages = _ref$messages === void 0 ? {
-    selected: __('Item selected.')
-  } : _ref$messages;
-  var instanceId = useInstanceId(ComboboxControl);
-
-  var _useState = useState(null),
-      _useState2 = _slicedToArray(_useState, 2),
-      selectedSuggestion = _useState2[0],
-      setSelectedSuggestion = _useState2[1];
-
-  var _useState3 = useState(false),
-      _useState4 = _slicedToArray(_useState3, 2),
-      isExpanded = _useState4[0],
-      setIsExpanded = _useState4[1];
-
-  var _useState5 = useState(''),
-      _useState6 = _slicedToArray(_useState5, 2),
-      inputValue = _useState6[0],
-      setInputValue = _useState6[1];
-
-  var inputContainer = useRef();
-  var currentOption = options.find(function (option) {
-    return option.value === value;
-  });
-  var currentLabel = (_currentOption$label = currentOption === null || currentOption === void 0 ? void 0 : currentOption.label) !== null && _currentOption$label !== void 0 ? _currentOption$label : '';
-  var matchingSuggestions = useMemo(function () {
-    var startsWithMatch = [];
-    var containsMatch = [];
-    var match = inputValue.toLocaleLowerCase();
-    options.forEach(function (option) {
-      var index = option.label.toLocaleLowerCase().indexOf(match);
+  const currentOption = options.find(option => option.value === value);
+  const currentLabel = (_currentOption$label = currentOption === null || currentOption === void 0 ? void 0 : currentOption.label) !== null && _currentOption$label !== void 0 ? _currentOption$label : '';
+  const instanceId = useInstanceId(ComboboxControl);
+  const [selectedSuggestion, setSelectedSuggestion] = useState(currentOption || null);
+  const [isExpanded, setIsExpanded] = useState(false);
+  const [inputHasFocus, setInputHasFocus] = useState(false);
+  const [inputValue, setInputValue] = useState('');
+  const inputContainer = useRef();
+  const matchingSuggestions = useMemo(() => {
+    const startsWithMatch = [];
+    const containsMatch = [];
+    const match = deburr(inputValue.toLocaleLowerCase());
+    options.forEach(option => {
+      const index = deburr(option.label).toLocaleLowerCase().indexOf(match);
 
       if (index === 0) {
         startsWithMatch.push(option);
@@ -115,7 +76,7 @@ function ComboboxControl(_ref) {
     return startsWithMatch.concat(containsMatch);
   }, [inputValue, options, value]);
 
-  var onSuggestionSelected = function onSuggestionSelected(newSelectedSuggestion) {
+  const onSuggestionSelected = newSelectedSuggestion => {
     onChange(newSelectedSuggestion.value);
     speak(messages.selected, 'assertive');
     setSelectedSuggestion(newSelectedSuggestion);
@@ -123,10 +84,9 @@ function ComboboxControl(_ref) {
     setIsExpanded(false);
   };
 
-  var handleArrowNavigation = function handleArrowNavigation() {
-    var offset = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 1;
-    var index = matchingSuggestions.indexOf(selectedSuggestion);
-    var nextIndex = index + offset;
+  const handleArrowNavigation = (offset = 1) => {
+    const index = matchingSuggestions.indexOf(selectedSuggestion);
+    let nextIndex = index + offset;
 
     if (nextIndex < 0) {
       nextIndex = matchingSuggestions.length - 1;
@@ -138,8 +98,12 @@ function ComboboxControl(_ref) {
     setIsExpanded(true);
   };
 
-  var onKeyDown = function onKeyDown(event) {
-    var preventDefault = false;
+  const onKeyDown = event => {
+    let preventDefault = false;
+
+    if (event.defaultPrevented) {
+      return;
+    }
 
     switch (event.keyCode) {
       case ENTER:
@@ -164,7 +128,6 @@ function ComboboxControl(_ref) {
         setIsExpanded(false);
         setSelectedSuggestion(null);
         preventDefault = true;
-        event.stopPropagation();
         break;
 
       default:
@@ -176,34 +139,52 @@ function ComboboxControl(_ref) {
     }
   };
 
-  var onFocus = function onFocus() {
+  const onBlur = () => {
+    setInputHasFocus(false);
+  };
+
+  const onFocus = () => {
+    setInputHasFocus(true);
     setIsExpanded(true);
     onFilterValueChange('');
     setInputValue('');
   };
 
-  var onFocusOutside = function onFocusOutside() {
+  const onFocusOutside = () => {
     setIsExpanded(false);
   };
 
-  var onInputChange = function onInputChange(event) {
-    var text = event.value;
+  const onInputChange = event => {
+    const text = event.value;
     setInputValue(text);
     onFilterValueChange(text);
-    setIsExpanded(true);
+
+    if (inputHasFocus) {
+      setIsExpanded(true);
+    }
   };
 
-  var handleOnReset = function handleOnReset() {
+  const handleOnReset = () => {
     onChange(null);
     inputContainer.current.input.focus();
-  }; // Announcements
+  }; // Update current selections when the filter input changes.
+
 
+  useEffect(() => {
+    const hasMatchingSuggestions = matchingSuggestions.length > 0;
+    const hasSelectedMatchingSuggestions = matchingSuggestions.indexOf(selectedSuggestion) > 0;
 
-  useEffect(function () {
-    var hasMatchingSuggestions = matchingSuggestions.length > 0;
+    if (hasMatchingSuggestions && !hasSelectedMatchingSuggestions) {
+      // If the current selection isn't present in the list of suggestions, then automatically select the first item from the list of suggestions.
+      setSelectedSuggestion(matchingSuggestions[0]);
+    }
+  }, [matchingSuggestions, selectedSuggestion]); // Announcements
+
+  useEffect(() => {
+    const hasMatchingSuggestions = matchingSuggestions.length > 0;
 
     if (isExpanded) {
-      var message = hasMatchingSuggestions ? sprintf(
+      const message = hasMatchingSuggestions ? sprintf(
       /* translators: %d: number of results. */
       _n('%d result found, use up and down arrow keys to navigate.', '%d results found, use up and down arrow keys to navigate.', matchingSuggestions.length), matchingSuggestions.length) : __('No results.');
       speak(message, 'polite');
@@ -220,7 +201,7 @@ function ComboboxControl(_ref) {
     className: classnames(className, 'components-combobox-control'),
     tabIndex: "-1",
     label: label,
-    id: "components-form-token-input-".concat(instanceId),
+    id: `components-form-token-input-${instanceId}`,
     hideLabelFromVision: hideLabelFromVision,
     help: help
   }, createElement("div", {
@@ -232,8 +213,9 @@ function ComboboxControl(_ref) {
     instanceId: instanceId,
     ref: inputContainer,
     value: isExpanded ? inputValue : currentLabel,
-    "aria-label": currentLabel ? "".concat(currentLabel, ", ").concat(label) : null,
+    "aria-label": currentLabel ? `${currentLabel}, ${label}` : null,
     onFocus: onFocus,
+    onBlur: onBlur,
     isExpanded: isExpanded,
     selectedSuggestionIndex: matchingSuggestions.indexOf(selectedSuggestion),
     onChange: onInputChange
@@ -248,9 +230,7 @@ function ComboboxControl(_ref) {
     match: {
       label: inputValue
     },
-    displayTransform: function displayTransform(suggestion) {
-      return suggestion.label;
-    },
+    displayTransform: suggestion => suggestion.label,
     suggestions: matchingSuggestions,
     selectedIndex: matchingSuggestions.indexOf(selectedSuggestion),
     onHover: setSelectedSuggestion,
woocommerce-admin/src/CategoryLookup.php000064400000017155151335517650014444 0ustar00<?php
/**
 * Keeps the product category lookup table in sync with live data.
 */

namespace Automattic\WooCommerce\Admin;

defined( 'ABSPATH' ) || exit;

/**
 * \Automattic\WooCommerce\Admin\CategoryLookup class.
 */
class CategoryLookup {

	/**
	 * Stores changes to categories we need to sync.
	 *
	 * @var array
	 */
	protected $edited_product_cats = array();

	/**
	 * The single instance of the class.
	 *
	 * @var object
	 */
	protected static $instance = null;

	/**
	 * Constructor
	 *
	 * @return void
	 */
	protected function __construct() {}

	/**
	 * Get class instance.
	 *
	 * @return object Instance.
	 */
	final public static function instance() {
		if ( null === static::$instance ) {
			static::$instance = new static();
		}
		return static::$instance;
	}

	/**
	 * Init hooks.
	 */
	public function init() {
		add_action( 'generate_category_lookup_table', array( $this, 'regenerate' ) );
		add_action( 'edit_product_cat', array( $this, 'before_edit' ), 99 );
		add_action( 'edited_product_cat', array( $this, 'on_edit' ), 99 );
		add_action( 'created_product_cat', array( $this, 'on_create' ), 99 );

	}

	/**
	 * Regenerate all lookup table data.
	 */
	public function regenerate() {
		global $wpdb;

		// Delete existing data and ensure schema is current.
		Install::create_tables();
		$wpdb->query( "TRUNCATE TABLE $wpdb->wc_category_lookup" );

		$terms = get_terms(
			'product_cat',
			array(
				'hide_empty' => false,
				'fields'     => 'id=>parent',
			)
		);

		$hierarchy = array();
		$inserts   = array();

		$this->unflatten_terms( $hierarchy, $terms, 0 );
		$this->get_term_insert_values( $inserts, $hierarchy );

		if ( ! $inserts ) {
			return;
		}

		$insert_string = implode(
			'),(',
			array_map(
				function( $item ) {
					return implode( ',', $item );
				},
				$inserts
			)
		);

		$wpdb->query( "INSERT IGNORE INTO $wpdb->wc_category_lookup (category_tree_id,category_id) VALUES ({$insert_string})" ); // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.PreparedSQL.InterpolatedNotPrepared
	}

	/**
	 * Store edits so we know when the parent ID changes.
	 *
	 * @param int $category_id Term ID being edited.
	 */
	public function before_edit( $category_id ) {
		$category                                  = get_term( $category_id, 'product_cat' );
		$this->edited_product_cats[ $category_id ] = $category->parent;
	}

	/**
	 * When a product category gets edited, see if we need to sync the table.
	 *
	 * @param int $category_id Term ID being edited.
	 */
	public function on_edit( $category_id ) {
		global $wpdb;

		if ( ! isset( $this->edited_product_cats[ $category_id ] ) ) {
			return;
		}

		$category_object = get_term( $category_id, 'product_cat' );
		$prev_parent     = $this->edited_product_cats[ $category_id ];
		$new_parent      = $category_object->parent;

		// No edits - no need to modify relationships.
		if ( $prev_parent === $new_parent ) {
			return;
		}

		$this->delete( $category_id, $prev_parent );
		$this->update( $category_id );
	}

	/**
	 * When a product category gets created, add a new lookup row.
	 *
	 * @param int $category_id Term ID being created.
	 */
	public function on_create( $category_id ) {
		// If WooCommerce is being installed on a multisite, lookup tables haven't been created yet.
		if ( 'yes' === get_transient( 'wc_installing' ) ) {
			return;
		}

		$this->update( $category_id );
	}

	/**
	 * Delete lookup table data from a tree.
	 *
	 * @param int $category_id Category ID to delete.
	 * @param int $category_tree_id Tree to delete from.
	 * @return void
	 */
	protected function delete( $category_id, $category_tree_id ) {
		global $wpdb;

		if ( ! $category_tree_id ) {
			return;
		}

		$ancestors   = get_ancestors( $category_tree_id, 'product_cat', 'taxonomy' );
		$ancestors[] = $category_tree_id;
		$children    = get_term_children( $category_id, 'product_cat' );
		$children[]  = $category_id;
		$id_list     = implode( ',', array_map( 'intval', array_unique( array_filter( $children ) ) ) );

		foreach ( $ancestors as $ancestor ) {
			$wpdb->query( $wpdb->prepare( "DELETE FROM $wpdb->wc_category_lookup WHERE category_tree_id = %d AND category_id IN ({$id_list})", $ancestor ) ); // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.PreparedSQL.InterpolatedNotPrepared
		}
	}

	/**
	 * Updates lookup table data for a category by ID.
	 *
	 * @param int $category_id Category ID to update.
	 */
	protected function update( $category_id ) {
		global $wpdb;

		$ancestors    = get_ancestors( $category_id, 'product_cat', 'taxonomy' );
		$children     = get_term_children( $category_id, 'product_cat' );
		$inserts      = array();
		$inserts[]    = $this->get_insert_sql( $category_id, $category_id );
		$children_ids = array_map( 'intval', array_unique( array_filter( $children ) ) );

		foreach ( $ancestors as $ancestor ) {
			$inserts[] = $this->get_insert_sql( $category_id, $ancestor );

			foreach ( $children_ids as $child_category_id ) {
				$inserts[] = $this->get_insert_sql( $child_category_id, $ancestor );
			}
		}

		$insert_string = implode( ',', $inserts );

		$wpdb->query( "INSERT IGNORE INTO $wpdb->wc_category_lookup (category_id, category_tree_id) VALUES {$insert_string}" ); // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.PreparedSQL.InterpolatedNotPrepared
	}

	/**
	 * Get category lookup table values to insert.
	 *
	 * @param int $category_id Category ID to insert.
	 * @param int $category_tree_id Tree to insert into.
	 * @return string
	 */
	protected function get_insert_sql( $category_id, $category_tree_id ) {
		global $wpdb;
		return $wpdb->prepare( '(%d,%d)', $category_id, $category_tree_id );
	}

	/**
	 * Used to construct insert query recursively.
	 *
	 * @param  array $inserts Array of data to insert.
	 * @param  array $terms   Terms to insert.
	 * @param  array $parents Parent IDs the terms belong to.
	 */
	protected function get_term_insert_values( &$inserts, $terms, $parents = array() ) {
		foreach ( $terms as $term ) {
			$insert_parents = array_merge( array( $term['term_id'] ), $parents );

			foreach ( $insert_parents as $parent ) {
				$inserts[] = array(
					$parent,
					$term['term_id'],
				);
			}

			$this->get_term_insert_values( $inserts, $term['descendants'], $insert_parents );
		}
	}

	/**
	 * Convert flat terms array into nested array.
	 *
	 * @param array   $hierarchy Array to put terms into.
	 * @param array   $terms Array of terms (id=>parent).
	 * @param integer $parent Parent ID.
	 */
	protected function unflatten_terms( &$hierarchy, &$terms, $parent = 0 ) {
		foreach ( $terms as $term_id => $parent_id ) {
			if ( (int) $parent_id === $parent ) {
				$hierarchy[ $term_id ] = array(
					'term_id'     => $term_id,
					'descendants' => array(),
				);
				unset( $terms[ $term_id ] );
			}
		}
		foreach ( $hierarchy as $term_id => $terms_array ) {
			$this->unflatten_terms( $hierarchy[ $term_id ]['descendants'], $terms, $term_id );
		}
	}

	/**
	 * Get category descendants.
	 *
	 * @param int $category_id The category ID to lookup.
	 * @return array
	 */
	protected function get_descendants( $category_id ) {
		global $wpdb;

		return wp_parse_id_list(
			$wpdb->get_col(
				$wpdb->prepare(
					"SELECT category_id FROM $wpdb->wc_category_lookup WHERE category_tree_id = %d",
					$category_id
				)
			)
		);
	}

	/**
	 * Return all ancestor category ids for a category.
	 *
	 * @param int $category_id The category ID to lookup.
	 * @return array
	 */
	protected function get_ancestors( $category_id ) {
		global $wpdb;

		return wp_parse_id_list(
			$wpdb->get_col(
				$wpdb->prepare(
					"SELECT category_tree_id FROM $wpdb->wc_category_lookup WHERE category_id = %d",
					$category_id
				)
			)
		);
	}
}
woocommerce-admin/src/Notes/NavigationNudge.php000064400000004202151335517650015634 0ustar00<?php
/**
 * WooCommerce Admin: Navigation Nudge.
 *
 * Adds a note to nudge users to opt in to navigation.
 */

namespace Automattic\WooCommerce\Admin\Notes;

defined( 'ABSPATH' ) || exit;

use Automattic\WooCommerce\Admin\Features\Features;
use Automattic\WooCommerce\Admin\Features\Navigation\Init as Navigation;

/**
 * Navigation Nudge.
 */
class NavigationNudge {
	/**
	 * Note traits.
	 */
	use NoteTraits;

	/**
	 * Name of the note for use in the database.
	 */
	const NOTE_NAME = 'wc-admin-navigation-nudge';

	/**
	 * Attach hooks.
	 */
	public function __construct() {
		add_action( 'update_option_' . Navigation::TOGGLE_OPTION_NAME, array( $this, 'action_note' ), 10, 2 );
	}

	/**
	 * Get the note.
	 *
	 * @return Note
	 */
	public static function get_note() {
		if ( Features::is_enabled( 'navigation' ) || ! Features::exists( 'navigation' ) ) {
			return;
		}

		$note = new Note();
		$note->set_title( __( 'You now have access to the WooCommerce navigation', 'woocommerce' ) );
		$note->set_content( __( 'We’re introducing a new navigation for a more intuitive and improved user experience. You can enable the beta version of the new experience in the Advanced Settings. Enable it now for your store.', 'woocommerce' ) );
		$note->set_type( Note::E_WC_ADMIN_NOTE_INFORMATIONAL );
		$note->set_name( self::NOTE_NAME );
		$note->set_source( 'woocommerce-admin' );
		$note->add_action(
			'enable-navigation',
			__( 'Enable in Settings', 'woocommerce' ),
			admin_url( 'admin.php?page=wc-settings&tab=advanced&section=features' )
		);
		return $note;
	}

	/**
	 * Actions the note when the option is toggled.
	 *
	 * @param string $old_value Old value.
	 * @param string $value     New value.
	 */
	public static function action_note( $old_value, $value ) {
		if ( 'yes' !== $value ) {
			return;
		}

		$data_store = Notes::load_data_store();
		$note_ids   = $data_store->get_notes_with_name( self::NOTE_NAME );

		if ( ! empty( $note_ids ) ) {
			$note = Notes::get_note( $note_ids[0] );

			if ( Note::E_WC_ADMIN_NOTE_ACTIONED === $note->get_status() ) {
				return;
			}

			$note->set_status( Note::E_WC_ADMIN_NOTE_ACTIONED );
			$note->save();
		}

	}
}
woocommerce-admin/src/Notes/SetUpAdditionalPaymentTypes.php000064400000005176151335517650020201 0ustar00<?php
/**
 * Add a note to the merchant's inbox prompting them to set up additional
 * payment types if they have WooCommerce Payments activated.
 *
 * @package WooCommerce\Admin
 */

namespace Automattic\WooCommerce\Admin\Notes;

defined( 'ABSPATH' ) || exit;

/**
 * Set_Up_Additional_Payment_Types
 */
class SetUpAdditionalPaymentTypes {
	/**
	 * Note traits.
	 */
	use NoteTraits;

	/**
	 * Name of the note for use in the database.
	 */
	const NOTE_NAME = 'wc-admin-set-up-additional-payment-types';

	/**
	 * Constructor.
	 */
	public function __construct() {
		add_action(
			'activate_woocommerce-payments/woocommerce-payments.php',
			array(
				$this,
				'on_activate_wcpay',
			)
		);
		add_action(
			'deactivate_woocommerce-payments/woocommerce-payments.php',
			array(
				$this,
				'on_deactivate_wcpay',
			)
		);
	}

	/**
	 * Executes when the WooCommerce Payments plugin is activated. It does nothing
	 * if WooCommerce Payments plugin is not included in onboarding business extensions,
	 * otherwise it possibly adds the note if it isn't already in the database and if
	 * it matches any criteria (see get_note()).
	 */
	public static function on_activate_wcpay() {
		$onboarding_profile = get_option( 'woocommerce_onboarding_profile', array() );
		if ( is_array( $onboarding_profile ) && array_key_exists( 'business_extensions', $onboarding_profile ) ) {
			if ( ! is_array( $onboarding_profile['business_extensions'] ) ||
				! in_array( 'woocommerce-payments', $onboarding_profile['business_extensions'], true )
			) {
				return;
			}
		}

		self::possibly_add_note();
	}

	/**
	 * Executes when the WooCommerce Payments plugin is deactivated. Possibly
	 * hard-deletes the note if it is in the database. Hard-delete is used
	 * instead of soft-delete or actioning the note because we need to
	 * show the note if the plugin is activated again.
	 */
	public static function on_deactivate_wcpay() {
		self::possibly_delete_note();
	}

	/**
	 * Get the note.
	 *
	 * @return Note
	 */
	public static function get_note() {
		$content = __( 'Set up additional payment providers, using third-party services or other methods.', 'woocommerce' );

		$note = new Note();

		$note->set_title( __( 'Set up additional payment providers', 'woocommerce' ) );
		$note->set_content( $content );
		$note->set_content_data( (object) array() );
		$note->set_type( Note::E_WC_ADMIN_NOTE_INFORMATIONAL );
		$note->set_name( self::NOTE_NAME );
		$note->set_source( 'woocommerce-admin' );
		$note->add_action(
			'set-up-payments',
			__( 'Set up payments', 'woocommerce' ),
			wc_admin_url( '&task=payments' ),
			Note::E_WC_ADMIN_NOTE_UNACTIONED,
			true
		);

		return $note;
	}
}
woocommerce-admin/src/Notes/TrackingOptIn.php000064400000005233151335517650015273 0ustar00<?php
/**
 * WooCommerce Admin Usage Tracking Opt In Note Provider.
 *
 * Adds a Usage Tracking Opt In extension note.
 */

namespace Automattic\WooCommerce\Admin\Notes;

defined( 'ABSPATH' ) || exit;

/**
 * Tracking_Opt_In
 */
class TrackingOptIn {
	/**
	 * Note traits.
	 */
	use NoteTraits;

	/**
	 * Name of the note for use in the database.
	 */
	const NOTE_NAME = 'wc-admin-usage-tracking-opt-in';

	/**
	 * Attach hooks.
	 */
	public function __construct() {
		add_action( 'woocommerce_note_action_tracking-opt-in', array( $this, 'opt_in_to_tracking' ) );
	}

	/**
	 * Get the note.
	 *
	 * @return Note|null
	 */
	public static function get_note() {
		// Only show this note to stores that are opted out.
		if ( 'yes' === get_option( 'woocommerce_allow_tracking', 'no' ) ) {
			return;
		}

		// We want to show the note after one week.
		if ( ! self::is_wc_admin_active_in_date_range( 'week-1-4' ) ) {
			return;
		}

		/* translators: 1: open link to WooCommerce.com settings, 2: open link to WooCommerce.com tracking documentation, 3: close link tag. */
		$content_format = __(
			'Gathering usage data allows us to improve WooCommerce. Your store will be considered as we evaluate new features, judge the quality of an update, or determine if an improvement makes sense. You can always visit the %1$sSettings%3$s and choose to stop sharing data. %2$sRead more%3$s about what data we collect.',
			'woocommerce'
		);

		$note_content = sprintf(
			$content_format,
			'<a href="' . esc_url( admin_url( 'admin.php?page=wc-settings&tab=advanced&section=woocommerce_com' ) ) . '" target="_blank">',
			'<a href="https://woocommerce.com/usage-tracking?utm_medium=product" target="_blank">',
			'</a>'
		);

		$note = new Note();
		$note->set_title( __( 'Help WooCommerce improve with usage tracking', 'woocommerce' ) );
		$note->set_content( $note_content );
		$note->set_content_data( (object) array() );
		$note->set_type( Note::E_WC_ADMIN_NOTE_INFORMATIONAL );
		$note->set_name( self::NOTE_NAME );
		$note->set_source( 'woocommerce-admin' );
		$note->add_action( 'tracking-opt-in', __( 'Activate usage tracking', 'woocommerce' ), false, Note::E_WC_ADMIN_NOTE_ACTIONED, true );
		return $note;
	}

	/**
	 * Opt in to usage tracking when note is actioned.
	 *
	 * @param Note $note Note being acted upon.
	 */
	public function opt_in_to_tracking( $note ) {
		if ( self::NOTE_NAME === $note->get_name() ) {
			// Opt in to tracking and schedule the first data update.
			// Same mechanism as in WC_Admin_Setup_Wizard::wc_setup_store_setup_save().
			update_option( 'woocommerce_allow_tracking', 'yes' );
			wp_schedule_single_event( time() + 10, 'woocommerce_tracker_send_event', array( true ) );
		}
	}
}
woocommerce-admin/src/Notes/OnboardingTraits.php000064400000003746151335517650016037 0ustar00<?php
/**
 * WC Admin Onboarding Traits
 *
 * WC Admin Onboarding Traits class that houses shared functionality useful for checking status of onboarding.
 */

namespace Automattic\WooCommerce\Admin\Notes;

defined( 'ABSPATH' ) || exit;

/**
 * OnboardingTraits class, encapsulates onboarding checks and functionality
 * that are useful to determining whether to display notes or not.
 */
trait OnboardingTraits {
	/**
	 * Get access to the onboarding profile option.
	 */
	private static function get_onboarding_profile() {
		return get_option( 'woocommerce_onboarding_profile', array() );
	}

	/**
	 * Check if user has started the onboarding profile wizard.
	 *
	 * @return bool Whether or not the onboarding profile has been started.
	 */
	public static function onboarding_profile_started() {
		$onboarding_profile = self::get_onboarding_profile();
		return ! empty( $onboarding_profile );
	}

	/**
	 * Check if onboarding profile revenue is between 2 amounts
	 *
	 * @param int $min_dollars Minimum amount the range must fall within (inclusive).
	 * @param int $max_dollars Maximum amount the range must fall within (inclusive).
	 * @return bool Whether the revenue falls within the min and max (inclusive).
	 */
	public static function revenue_is_within( $min_dollars, $max_dollars ) {
		$onboarding_profile = self::get_onboarding_profile();

		if ( empty( $onboarding_profile ) || ! isset( $onboarding_profile['revenue'] ) ) {
			return false;
		}

		return $onboarding_profile['revenue'] >= $min_dollars && $onboarding_profile['revenue'] <= $max_dollars;
	}

	/**
	 * Check if the store was marked as being setup for a client in onboarding. (Returns false if onboarding
	 * was not completed).
	 *
	 * @return bool Whether or not the store is being setup for a client.
	 */
	public static function store_setup_for_client() {
		$onboarding_profile = self::get_onboarding_profile();
		return ! empty( $onboarding_profile ) && isset( $onboarding_profile['setup_client'] ) && $onboarding_profile['setup_client'];
	}
}
woocommerce-admin/src/Notes/Note.php000064400000044121151335517650013463 0ustar00<?php
/**
 * WooCommerce Admin (Dashboard) Notes.
 *
 * The WooCommerce admin notes class gets admin notes data from storage and checks validity.
 */

namespace Automattic\WooCommerce\Admin\Notes;

defined( 'ABSPATH' ) || exit;

/**
 * Note class.
 */
class Note extends \WC_Data {

	// Note types.
	const E_WC_ADMIN_NOTE_ERROR         = 'error';     // used for presenting error conditions.
	const E_WC_ADMIN_NOTE_WARNING       = 'warning';   // used for presenting warning conditions.
	const E_WC_ADMIN_NOTE_UPDATE        = 'update';    // i.e. used when a new version is available.
	const E_WC_ADMIN_NOTE_INFORMATIONAL = 'info';      // used for presenting informational messages.
	const E_WC_ADMIN_NOTE_MARKETING     = 'marketing'; // used for adding marketing messages.
	const E_WC_ADMIN_NOTE_SURVEY        = 'survey';    // used for adding survey messages.
	const E_WC_ADMIN_NOTE_EMAIL         = 'email';     // used for adding notes that will be sent by email.

	// Note status codes.
	const E_WC_ADMIN_NOTE_PENDING    = 'pending';    // the note is pending - hidden but not actioned.
	const E_WC_ADMIN_NOTE_UNACTIONED = 'unactioned'; // the note has not yet been actioned by a user.
	const E_WC_ADMIN_NOTE_ACTIONED   = 'actioned';   // the note has had its action completed by a user.
	const E_WC_ADMIN_NOTE_SNOOZED    = 'snoozed';    // the note has been snoozed by a user.
	const E_WC_ADMIN_NOTE_SENT       = 'sent';    // the note has been sent by email to the user.

	/**
	 * This is the name of this object type.
	 *
	 * @var string
	 */
	protected $object_type = 'admin-note';

	/**
	 * Cache group.
	 *
	 * @var string
	 */
	protected $cache_group = 'admin-note';

	/**
	 * Note constructor. Loads note data.
	 *
	 * @param mixed $data Note data, object, or ID.
	 */
	public function __construct( $data = '' ) {
		// Set default data here to allow `content_data` to be an object.
		$this->data = array(
			'name'          => '-',
			'type'          => self::E_WC_ADMIN_NOTE_INFORMATIONAL,
			'locale'        => 'en_US',
			'title'         => '-',
			'content'       => '-',
			'content_data'  => new \stdClass(),
			'status'        => self::E_WC_ADMIN_NOTE_UNACTIONED,
			'source'        => 'woocommerce',
			'date_created'  => '0000-00-00 00:00:00',
			'date_reminder' => '',
			'is_snoozable'  => false,
			'actions'       => array(),
			'layout'        => 'plain',
			'image'         => '',
			'is_deleted'    => false,
		);

		parent::__construct( $data );

		if ( $data instanceof Note ) {
			$this->set_id( absint( $data->get_id() ) );
		} elseif ( is_numeric( $data ) ) {
			$this->set_id( $data );
		} elseif ( is_object( $data ) && ! empty( $data->note_id ) ) {
			$this->set_id( $data->note_id );
			unset( $data->icon ); // Icons are deprecated.
			$this->set_props( (array) $data );
			$this->set_object_read( true );
		} else {
			$this->set_object_read( true );
		}

		$this->data_store = Notes::load_data_store();
		if ( $this->get_id() > 0 ) {
			$this->data_store->read( $this );
		}
	}

	/**
	 * Merge changes with data and clear.
	 *
	 * @since 3.0.0
	 */
	public function apply_changes() {
		$this->data = array_replace_recursive( $this->data, $this->changes ); // @codingStandardsIgnoreLine

		// Note actions need to be replaced wholesale.
		// Merging arrays doesn't allow for deleting note actions.
		if ( isset( $this->changes['actions'] ) ) {
			$this->data['actions'] = $this->changes['actions'];
		}

		$this->changes = array();
	}

	/*
	|--------------------------------------------------------------------------
	| Helpers
	|--------------------------------------------------------------------------
	|
	| Methods for getting allowed types, statuses.
	|
	*/

	/**
	 * Get allowed types.
	 *
	 * @return array
	 */
	public static function get_allowed_types() {
		$allowed_types = array(
			self::E_WC_ADMIN_NOTE_ERROR,
			self::E_WC_ADMIN_NOTE_WARNING,
			self::E_WC_ADMIN_NOTE_UPDATE,
			self::E_WC_ADMIN_NOTE_INFORMATIONAL,
			self::E_WC_ADMIN_NOTE_MARKETING,
			self::E_WC_ADMIN_NOTE_SURVEY,
			self::E_WC_ADMIN_NOTE_EMAIL,
		);

		return apply_filters( 'woocommerce_note_types', $allowed_types );
	}

	/**
	 * Get allowed statuses.
	 *
	 * @return array
	 */
	public static function get_allowed_statuses() {
		$allowed_statuses = array(
			self::E_WC_ADMIN_NOTE_PENDING,
			self::E_WC_ADMIN_NOTE_ACTIONED,
			self::E_WC_ADMIN_NOTE_UNACTIONED,
			self::E_WC_ADMIN_NOTE_SNOOZED,
			self::E_WC_ADMIN_NOTE_SENT,
		);

		return apply_filters( 'woocommerce_note_statuses', $allowed_statuses );
	}


	/*
	|--------------------------------------------------------------------------
	| Getters
	|--------------------------------------------------------------------------
	|
	| Methods for getting data from the note object.
	|
	*/

	/**
	 * Returns all data for this object.
	 *
	 * Override \WC_Data::get_data() to avoid errantly including meta data
	 * from ID collisions with the posts table.
	 *
	 * @return array
	 */
	public function get_data() {
		return array_merge( array( 'id' => $this->get_id() ), $this->data );
	}

	/**
	 * Get note name.
	 *
	 * @param  string $context What the value is for. Valid values are 'view' and 'edit'.
	 * @return string
	 */
	public function get_name( $context = 'view' ) {
		return $this->get_prop( 'name', $context );
	}

	/**
	 * Get note type.
	 *
	 * @param  string $context What the value is for. Valid values are 'view' and 'edit'.
	 * @return string
	 */
	public function get_type( $context = 'view' ) {
		return $this->get_prop( 'type', $context );
	}

	/**
	 * Get note locale.
	 *
	 * @param  string $context What the value is for. Valid values are 'view' and 'edit'.
	 * @return string
	 */
	public function get_locale( $context = 'view' ) {
		return $this->get_prop( 'locale', $context );
	}

	/**
	 * Get note title.
	 *
	 * @param  string $context What the value is for. Valid values are 'view' and 'edit'.
	 * @return string
	 */
	public function get_title( $context = 'view' ) {
		return $this->get_prop( 'title', $context );
	}

	/**
	 * Get note content.
	 *
	 * @param  string $context What the value is for. Valid values are 'view' and 'edit'.
	 * @return string
	 */
	public function get_content( $context = 'view' ) {
		return $this->get_prop( 'content', $context );
	}

	/**
	 * Get note content data (i.e. values that would be needed for re-localization)
	 *
	 * @param  string $context What the value is for. Valid values are 'view' and 'edit'.
	 * @return array
	 */
	public function get_content_data( $context = 'view' ) {
		return $this->get_prop( 'content_data', $context );
	}

	/**
	 * Get note status.
	 *
	 * @param  string $context What the value is for. Valid values are 'view' and 'edit'.
	 * @return string
	 */
	public function get_status( $context = 'view' ) {
		return $this->get_prop( 'status', $context );
	}

	/**
	 * Get note source.
	 *
	 * @param  string $context What the value is for. Valid values are 'view' and 'edit'.
	 * @return string
	 */
	public function get_source( $context = 'view' ) {
		return $this->get_prop( 'source', $context );
	}

	/**
	 * Get date note was created.
	 *
	 * @param  string $context What the value is for. Valid values are 'view' and 'edit'.
	 * @return WC_DateTime|NULL object if the date is set or null if there is no date.
	 */
	public function get_date_created( $context = 'view' ) {
		return $this->get_prop( 'date_created', $context );
	}

	/**
	 * Get date on which user should be reminded of the note (if any).
	 *
	 * @param  string $context What the value is for. Valid values are 'view' and 'edit'.
	 * @return WC_DateTime|NULL object if the date is set or null if there is no date.
	 */
	public function get_date_reminder( $context = 'view' ) {
		return $this->get_prop( 'date_reminder', $context );
	}

	/**
	 * Get note snoozability.
	 *
	 * @param  string $context What the value is for. Valid values are 'view' and 'edit'.
	 * @return bool   Whether or not the note can be snoozed.
	 */
	public function get_is_snoozable( $context = 'view' ) {
		return $this->get_prop( 'is_snoozable', $context );
	}

	/**
	 * Get actions on the note (if any).
	 *
	 * @param  string $context What the value is for. Valid values are 'view' and 'edit'.
	 * @return array
	 */
	public function get_actions( $context = 'view' ) {
		return $this->get_prop( 'actions', $context );
	}

	/**
	 * Get note layout (the old notes won't have one).
	 *
	 * @param  string $context What the value is for. Valid values are 'view' and 'edit'.
	 * @return array
	 */
	public function get_layout( $context = 'view' ) {
		return $this->get_prop( 'layout', $context );
	}

	/**
	 * Get note image (if any).
	 *
	 * @param  string $context What the value is for. Valid values are 'view' and 'edit'.
	 * @return array
	 */
	public function get_image( $context = 'view' ) {
		return $this->get_prop( 'image', $context );
	}

	/**
	 * Get deleted status.
	 *
	 * @param  string $context What the value is for. Valid values are 'view' and 'edit'.
	 * @return array
	 */
	public function get_is_deleted( $context = 'view' ) {
		return $this->get_prop( 'is_deleted', $context );
	}

	/*
	|--------------------------------------------------------------------------
	| Setters
	|--------------------------------------------------------------------------
	|
	| Methods for setting note data. These should not update anything in the
	| database itself and should only change what is stored in the class
	| object.
	|
	*/

	/**
	 * Set note name.
	 *
	 * @param string $name Note name.
	 */
	public function set_name( $name ) {
		// Don't allow empty names.
		if ( empty( $name ) ) {
			$this->error( 'admin_note_invalid_data', __( 'The admin note name prop cannot be empty.', 'woocommerce' ) );
		}

		$this->set_prop( 'name', $name );
	}

	/**
	 * Set note type.
	 *
	 * @param string $type Note type.
	 */
	public function set_type( $type ) {
		if ( empty( $type ) ) {
			$this->error( 'admin_note_invalid_data', __( 'The admin note type prop cannot be empty.', 'woocommerce' ) );
		}

		if ( ! in_array( $type, self::get_allowed_types(), true ) ) {
			$this->error(
				'admin_note_invalid_data',
				sprintf(
					/* translators: %s: admin note type. */
					__( 'The admin note type prop (%s) is not one of the supported types.', 'woocommerce' ),
					$type
				)
			);
		}

		$this->set_prop( 'type', $type );
	}

	/**
	 * Set note locale.
	 *
	 * @param string $locale Note locale.
	 */
	public function set_locale( $locale ) {
		if ( empty( $locale ) ) {
			$this->error( 'admin_note_invalid_data', __( 'The admin note locale prop cannot be empty.', 'woocommerce' ) );
		}

		$this->set_prop( 'locale', $locale );
	}

	/**
	 * Set note title.
	 *
	 * @param string $title Note title.
	 */
	public function set_title( $title ) {
		if ( empty( $title ) ) {
			$this->error( 'admin_note_invalid_data', __( 'The admin note title prop cannot be empty.', 'woocommerce' ) );
		}

		$this->set_prop( 'title', $title );
	}

	/**
	 * Set note icon (Deprecated).
	 *
	 * @param string $icon Note icon.
	 */
	public function set_icon( $icon ) {
		wc_deprecated_function( 'set_icon', '4.3' );
	}

	/**
	 * Set note content.
	 *
	 * @param string $content Note content.
	 */
	public function set_content( $content ) {
		$allowed_html = array(
			'br'     => array(),
			'em'     => array(),
			'strong' => array(),
			'a'      => array(
				'href'     => true,
				'rel'      => true,
				'name'     => true,
				'target'   => true,
				'download' => array(
					'valueless' => 'y',
				),
			),
			'p'      => array(),
		);

		$content = wp_kses( $content, $allowed_html );

		if ( empty( $content ) ) {
			$this->error( 'admin_note_invalid_data', __( 'The admin note content prop cannot be empty.', 'woocommerce' ) );
		}

		$this->set_prop( 'content', $content );
	}

	/**
	 * Set note data for potential re-localization.
	 *
	 * @todo Set a default empty array? https://github.com/woocommerce/woocommerce-admin/pull/1763#pullrequestreview-212442921.
	 * @param object $content_data Note data.
	 */
	public function set_content_data( $content_data ) {
		$allowed_type = false;

		// Make sure $content_data is stdClass Object or an array.
		if ( ! ( $content_data instanceof \stdClass ) ) {
			$this->error( 'admin_note_invalid_data', __( 'The admin note content_data prop must be an instance of stdClass.', 'woocommerce' ) );
		}

		$this->set_prop( 'content_data', $content_data );
	}

	/**
	 * Set note status.
	 *
	 * @param string $status Note status.
	 */
	public function set_status( $status ) {
		if ( empty( $status ) ) {
			$this->error( 'admin_note_invalid_data', __( 'The admin note status prop cannot be empty.', 'woocommerce' ) );
		}

		if ( ! in_array( $status, self::get_allowed_statuses(), true ) ) {
			$this->error(
				'admin_note_invalid_data',
				sprintf(
					/* translators: %s: admin note status property. */
					__( 'The admin note status prop (%s) is not one of the supported statuses.', 'woocommerce' ),
					$status
				)
			);
		}

		$this->set_prop( 'status', $status );
	}

	/**
	 * Set note source.
	 *
	 * @param string $source Note source.
	 */
	public function set_source( $source ) {
		if ( empty( $source ) ) {
			$this->error( 'admin_note_invalid_data', __( 'The admin note source prop cannot be empty.', 'woocommerce' ) );
		}

		$this->set_prop( 'source', $source );
	}

	/**
	 * Set date note was created. NULL is not allowed
	 *
	 * @param string|integer $date UTC timestamp, or ISO 8601 DateTime. If the DateTime string has no timezone or offset, WordPress site timezone will be assumed.
	 */
	public function set_date_created( $date ) {
		if ( empty( $date ) ) {
			$this->error( 'admin_note_invalid_data', __( 'The admin note date prop cannot be empty.', 'woocommerce' ) );
		}

		if ( is_string( $date ) ) {
			$date = wc_string_to_timestamp( $date );
		}
		$this->set_date_prop( 'date_created', $date );
	}

	/**
	 * Set date admin should be reminded of note. NULL IS allowed
	 *
	 * @param string|integer|null $date UTC timestamp, or ISO 8601 DateTime. If the DateTime string has no timezone or offset, WordPress site timezone will be assumed. Null if there is no date.
	 */
	public function set_date_reminder( $date ) {
		if ( is_string( $date ) ) {
			$date = wc_string_to_timestamp( $date );
		}
		$this->set_date_prop( 'date_reminder', $date );
	}

	/**
	 * Set note snoozability.
	 *
	 * @param bool $is_snoozable Whether or not the note can be snoozed.
	 */
	public function set_is_snoozable( $is_snoozable ) {
		return $this->set_prop( 'is_snoozable', $is_snoozable );
	}

	/**
	 * Clear actions from a note.
	 */
	public function clear_actions() {
		$this->set_prop( 'actions', array() );
	}

	/**
	 * Set note layout.
	 *
	 * @param string $layout Note layout.
	 */
	public function set_layout( $layout ) {
		// If we don't receive a layout we will set it by default as "plain".
		if ( empty( $layout ) ) {
			$layout = 'plain';
		}
		$valid_layouts = array( 'banner', 'plain', 'thumbnail' );
		if ( in_array( $layout, $valid_layouts, true ) ) {
			$this->set_prop( 'layout', $layout );
		} else {
			$this->error( 'admin_note_invalid_data', __( 'The admin note layout has a wrong prop value.', 'woocommerce' ) );
		}
	}

	/**
	 * Set note image.
	 *
	 * @param string $image Note image.
	 */
	public function set_image( $image ) {
		$this->set_prop( 'image', $image );
	}

	/**
	 * Set note deleted status. NULL is not allowed
	 *
	 * @param bool $is_deleted Note deleted status.
	 */
	public function set_is_deleted( $is_deleted ) {
		$this->set_prop( 'is_deleted', $is_deleted );
	}

	/**
	 * Add an action to the note
	 *
	 * @param string  $name           Action name (not presented to user).
	 * @param string  $label          Action label (presented as button label).
	 * @param string  $url            Action URL, if navigation needed. Optional.
	 * @param string  $status         Status to transition parent Note to upon click. Defaults to 'actioned'.
	 * @param boolean $primary        Whether or not this is the primary action. Defaults to false.
	 * @param string  $actioned_text The label to display after the note has been actioned but before it is dismissed in the UI.
	 */
	public function add_action(
		$name,
		$label,
		$url = '',
		$status = self::E_WC_ADMIN_NOTE_ACTIONED,
		$primary = false,
		$actioned_text = ''
	) {
		$name          = wc_clean( $name );
		$label         = wc_clean( $label );
		$query         = esc_url_raw( $url );
		$status        = wc_clean( $status );
		$primary       = (bool) $primary;
		$actioned_text = wc_clean( $actioned_text );

		if ( empty( $name ) ) {
			$this->error( 'admin_note_invalid_data', __( 'The admin note action name prop cannot be empty.', 'woocommerce' ) );
		}

		if ( empty( $label ) ) {
			$this->error( 'admin_note_invalid_data', __( 'The admin note action label prop cannot be empty.', 'woocommerce' ) );
		}

		$action = array(
			'name'          => $name,
			'label'         => $label,
			'query'         => $query,
			'status'        => $status,
			'primary'       => $primary,
			'actioned_text' => $actioned_text,
			'nonce_name'    => null,
			'nonce_action'  => null,
		);

		$note_actions   = $this->get_prop( 'actions', 'edit' );
		$note_actions[] = (object) $action;
		$this->set_prop( 'actions', $note_actions );
	}

	/**
	 * Set actions on a note.
	 *
	 * @param array $actions Note actions.
	 */
	public function set_actions( $actions ) {
		$this->set_prop( 'actions', $actions );
	}

	/**
	 * Add a nonce to an existing note action.
	 *
	 * @link https://codex.wordpress.org/WordPress_Nonces
	 *
	 * @param string $note_action_name Name of action to add a nonce to.
	 * @param string $nonce_action The nonce action.
	 * @param string $nonce_name The nonce Name. This is used as the paramater name in the resulting URL for the action.
	 * @return void
	 * @throws \Exception If note name cannot be found.
	 */
	public function add_nonce_to_action( string $note_action_name, string $nonce_action, string $nonce_name ) {
		$actions   = $this->get_prop( 'actions', 'edit' );

		$matching_action = null;
		foreach ( $actions as $i => $action ) {
			if ( $action->name === $note_action_name ) {
				$matching_action =& $actions[ $i ];
			}
		}

		if ( empty( $matching_action ) ) {
			throw new \Exception( sprintf( 'Could not find action %s in note %s', $note_action_name, $this->get_name() ) );
		}

		$matching_action->nonce_action = $nonce_action;
		$matching_action->nonce_name   = $nonce_name;

		$this->set_actions( $actions );
	}
}
woocommerce-admin/src/Notes/Notes.php000064400000031754151335517650013656 0ustar00<?php
/**
 * Handles storage and retrieval of admin notes
 */

namespace Automattic\WooCommerce\Admin\Notes;

if ( ! defined( 'ABSPATH' ) ) {
	exit;
}
/**
 * Admin Notes class.
 */
class Notes {
	/**
	 * Hook used for recurring "unsnooze" action.
	 */
	const UNSNOOZE_HOOK = 'wc_admin_unsnooze_admin_notes';

	/**
	 * Hook appropriate actions.
	 */
	public static function init() {
		add_action( 'admin_init', array( __CLASS__, 'schedule_unsnooze_notes' ) );
		add_action( 'admin_init', array( __CLASS__, 'possibly_delete_survey_notes' ) );
		add_action( 'update_option_woocommerce_show_marketplace_suggestions', array( __CLASS__, 'possibly_delete_marketing_notes' ), 10, 2 );
	}

	/**
	 * Get notes from the database.
	 *
	 * @param string $context Getting notes for what context. Valid values: view, edit.
	 * @param array  $args Arguments to pass to the query( e.g. per_page and page).
	 * @return array Array of arrays.
	 */
	public static function get_notes( $context = 'edit', $args = array() ) {
		$data_store = self::load_data_store();
		$raw_notes  = $data_store->get_notes( $args );
		$notes      = array();
		foreach ( (array) $raw_notes as $raw_note ) {
			try {
				$note                               = new Note( $raw_note );
				$note_id                            = $note->get_id();
				$notes[ $note_id ]                  = $note->get_data();
				$notes[ $note_id ]['name']          = $note->get_name( $context );
				$notes[ $note_id ]['type']          = $note->get_type( $context );
				$notes[ $note_id ]['locale']        = $note->get_locale( $context );
				$notes[ $note_id ]['title']         = $note->get_title( $context );
				$notes[ $note_id ]['content']       = $note->get_content( $context );
				$notes[ $note_id ]['content_data']  = $note->get_content_data( $context );
				$notes[ $note_id ]['status']        = $note->get_status( $context );
				$notes[ $note_id ]['source']        = $note->get_source( $context );
				$notes[ $note_id ]['date_created']  = $note->get_date_created( $context );
				$notes[ $note_id ]['date_reminder'] = $note->get_date_reminder( $context );
				$notes[ $note_id ]['actions']       = $note->get_actions( $context );
				$notes[ $note_id ]['layout']        = $note->get_layout( $context );
				$notes[ $note_id ]['image']         = $note->get_image( $context );
				$notes[ $note_id ]['is_deleted']    = $note->get_is_deleted( $context );
			} catch ( \Exception $e ) {
				wc_caught_exception( $e, __CLASS__ . '::' . __FUNCTION__, array( $note_id ) );
			}
		}
		return $notes;
	}

	/**
	 * Get admin note using it's ID
	 *
	 * @param int $note_id Note ID.
	 * @return Note|bool
	 */
	public static function get_note( $note_id ) {
		if ( false !== $note_id ) {
			try {
				return new Note( $note_id );
			} catch ( \Exception $e ) {
				wc_caught_exception( $e, __CLASS__ . '::' . __FUNCTION__, array( $note_id ) );
				return false;
			}
		}

		return false;
	}

	/**
	 * Get the total number of notes
	 *
	 * @param string $type Comma separated list of note types.
	 * @param string $status Comma separated list of statuses.
	 * @return int
	 */
	public static function get_notes_count( $type = array(), $status = array() ) {
		$data_store = self::load_data_store();
		return $data_store->get_notes_count( $type, $status );
	}

	/**
	 * Deletes admin notes with a given name.
	 *
	 * @param string|array $names Name(s) to search for.
	 */
	public static function delete_notes_with_name( $names ) {
		if ( is_string( $names ) ) {
			$names = array( $names );
		} elseif ( ! is_array( $names ) ) {
			return;
		}

		$data_store = self::load_data_store();

		foreach ( $names as $name ) {
			$note_ids = $data_store->get_notes_with_name( $name );
			foreach ( (array) $note_ids as $note_id ) {
				$note = self::get_note( $note_id );
				if ( $note ) {
					$note->delete();
				}
			}
		}
	}

	/**
	 * Update a note.
	 *
	 * @param Note  $note              The note that will be updated.
	 * @param array $requested_updates a list of requested updates.
	 */
	public static function update_note( $note, $requested_updates ) {
		$note_changed = false;
		if ( isset( $requested_updates['status'] ) ) {
			$note->set_status( $requested_updates['status'] );
			$note_changed = true;
		}

		if ( isset( $requested_updates['date_reminder'] ) ) {
			$note->set_date_reminder( $requested_updates['date_reminder'] );
			$note_changed = true;
		}

		if ( isset( $requested_updates['is_deleted'] ) ) {
			$note->set_is_deleted( $requested_updates['is_deleted'] );
			$note_changed = true;
		}

		if ( $note_changed ) {
			$note->save();
		}
	}

	/**
	 * Soft delete of a note.
	 *
	 * @param Note $note The note that will be deleted.
	 */
	public static function delete_note( $note ) {
		$note->set_is_deleted( 1 );
		$note->save();
	}

	/**
	 * Soft delete of all the admin notes. Returns the deleted items.
	 *
	 * @param array $args Arguments to pass to the query (ex: status).
	 * @return array Array of notes.
	 */
	public static function delete_all_notes( $args = array() ) {
		$data_store = self::load_data_store();
		$defaults   = array(
			'order'      => 'desc',
			'orderby'    => 'date_created',
			'per_page'   => 25,
			'page'       => 1,
			'type'       => array(
				Note::E_WC_ADMIN_NOTE_INFORMATIONAL,
				Note::E_WC_ADMIN_NOTE_MARKETING,
				Note::E_WC_ADMIN_NOTE_WARNING,
				Note::E_WC_ADMIN_NOTE_SURVEY,
			),
			'is_deleted' => 0,
		);
		$args       = wp_parse_args( $args, $defaults );
		// Here we filter for the same params we are using to show the note list in client side.
		$raw_notes = $data_store->get_notes( $args );

		$notes = array();
		foreach ( (array) $raw_notes as $raw_note ) {
			$note = self::get_note( $raw_note->note_id );
			if ( $note ) {
				self::delete_note( $note );
				array_push( $notes, $note );
			}
		}
		return $notes;
	}

	/**
	 * Clear note snooze status if the reminder date has been reached.
	 */
	public static function unsnooze_notes() {
		$data_store = self::load_data_store();
		$raw_notes  = $data_store->get_notes(
			array(
				'status' => array( Note::E_WC_ADMIN_NOTE_SNOOZED ),
			)
		);
		$now        = new \DateTime();

		foreach ( $raw_notes as $raw_note ) {
			$note = self::get_note( $raw_note->note_id );
			if ( false === $note ) {
				continue;
			}

			$date_reminder = $note->get_date_reminder( 'edit' );

			if ( $date_reminder < $now ) {
				$note->set_status( Note::E_WC_ADMIN_NOTE_UNACTIONED );
				$note->set_date_reminder( null );
				$note->save();
			}
		}
	}

	/**
	 * Schedule unsnooze notes event.
	 */
	public static function schedule_unsnooze_notes() {
		if ( ! wp_next_scheduled( self::UNSNOOZE_HOOK ) ) {
			wp_schedule_event( time() + 5, 'hourly', self::UNSNOOZE_HOOK );
		}
	}

	/**
	 * Unschedule unsnooze notes event.
	 */
	public static function clear_queued_actions() {
		wp_clear_scheduled_hook( self::UNSNOOZE_HOOK );
	}

	/**
	 * Delete marketing notes if marketing has been opted out.
	 *
	 * @param string $old_value Old value.
	 * @param string $value New value.
	 */
	public static function possibly_delete_marketing_notes( $old_value, $value ) {
		if ( 'no' !== $value ) {
			return;
		}

		$data_store = self::load_data_store();
		$notes      = $data_store->get_notes(
			array(
				'type' => array( Note::E_WC_ADMIN_NOTE_MARKETING ),
			)
		);

		foreach ( $notes as $note ) {
			$note = self::get_note( $note->note_id );
			if ( $note ) {
				$note->delete();
			}
		}
	}

	/**
	 * Delete actioned survey notes.
	 */
	public static function possibly_delete_survey_notes() {
		$data_store = self::load_data_store();
		$notes      = $data_store->get_notes(
			array(
				'type'   => array( Note::E_WC_ADMIN_NOTE_SURVEY ),
				'status' => array( 'actioned' ),
			)
		);

		foreach ( $notes as $note ) {
			$note = self::get_note( $note->note_id );
			if ( $note ) {
				$note->set_is_deleted( 1 );
				$note->save();
			}
		}
	}

	/**
	 * Get the status of a given note by name.
	 *
	 * @param string $note_name Name of the note.
	 * @return string|bool The note status.
	 */
	public static function get_note_status( $note_name ) {
		$data_store = self::load_data_store();
		$note_ids   = $data_store->get_notes_with_name( $note_name );

		if ( empty( $note_ids ) ) {
			return false;
		}

		$note = self::get_note( $note_ids[0] );

		return $note->get_status();
	}

	/**
	 * Get action by id.
	 *
	 * @param Note $note The note that has of the action.
	 * @param int  $action_id Action ID.
	 * @return object|bool The found action.
	 */
	public static function get_action_by_id( $note, $action_id ) {
		$actions      = $note->get_actions( 'edit' );
		$found_action = false;

		foreach ( $actions as $action ) {
			if ( $action->id === $action_id ) {
				$found_action = $action;
			}
		}
		return $found_action;
	}

	/**
	 * Trigger note action.
	 *
	 * @param Note   $note The note that has the triggered action.
	 * @param object $triggered_action The triggered action.
	 * @return Note|bool
	 */
	public static function trigger_note_action( $note, $triggered_action ) {
		/**
		 * Fires when an admin note action is taken.
		 *
		 * @param string $name The triggered action name.
		 * @param Note   $note The corresponding Note.
		 */
		do_action( 'woocommerce_note_action', $triggered_action->name, $note );

		/**
		 * Fires when an admin note action is taken.
		 * For more specific targeting of note actions.
		 *
		 * @param Note $note The corresponding Note.
		 */
		do_action( 'woocommerce_note_action_' . $triggered_action->name, $note );

		// Update the note with the status for this action.
		if ( ! empty( $triggered_action->status ) ) {
			$note->set_status( $triggered_action->status );
		}

		$note->save();

		$event_params = array(
			'note_name'    => $note->get_name(),
			'note_type'    => $note->get_type(),
			'note_title'   => $note->get_title(),
			'note_content' => $note->get_content(),
			'action_name'  => $triggered_action->name,
			'action_label' => $triggered_action->label,
			'screen'       => self::get_screen_name(),
		);

		if ( in_array( $note->get_type(), array( 'error', 'update' ), true ) ) {
			wc_admin_record_tracks_event( 'store_alert_action', $event_params );
		} else {
			self::record_tracks_event_without_cookies( 'inbox_action_click', $event_params );
		}

		return $note;
	}

	/**
	 * Record tracks event for a specific user.
	 *
	 * @param int    $user_id The user id we want to record for the event.
	 * @param string $event_name Name of the event to record.
	 * @param array  $params The params to send to the event recording.
	 */
	public static function record_tracks_event_with_user( $user_id, $event_name, $params ) {
		// We save the current user id to set it back after the event recording.
		$current_user_id = get_current_user_id();

		wp_set_current_user( $user_id );
		self::record_tracks_event_without_cookies( $event_name, $params );
		wp_set_current_user( $current_user_id );

	}

	/**
	 * Record tracks event without using cookies.
	 *
	 * @param string $event_name Name of the event to record.
	 * @param array  $params The params to send to the event recording.
	 */
	private static function record_tracks_event_without_cookies( $event_name, $params ) {
		// We save the cookie to set it back after the event recording.
		// phpcs:ignore WordPress.Security.ValidatedSanitizedInput.MissingUnslash, WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
		$anon_id = isset( $_COOKIE['tk_ai'] ) ? $_COOKIE['tk_ai'] : null;

		unset( $_COOKIE['tk_ai'] );
		wc_admin_record_tracks_event( $event_name, $params );
		if ( isset( $anon_id ) ) {
			setcookie( 'tk_ai', $anon_id );
		}
	}

	/**
	 * Get screen name.
	 *
	 * @return string The screen name.
	 */
	public static function get_screen_name() {
		$screen_name = '';

		if ( isset( $_SERVER['HTTP_REFERER'] ) ) {
			parse_str( wp_parse_url( $_SERVER['HTTP_REFERER'], PHP_URL_QUERY ), $queries ); // phpcs:ignore sanitization ok.
		}
		if ( isset( $queries ) ) {
			$page      = isset( $queries['page'] ) ? $queries['page'] : null;
			$path      = isset( $queries['path'] ) ? $queries['path'] : null;
			$post_type = isset( $queries['post_type'] ) ? $queries['post_type'] : null;
			$post      = isset( $queries['post'] ) ? get_post_type( $queries['post'] ) : null;
		}

		if ( isset( $page ) ) {
			$current_page = 'wc-admin' === $page ? 'home_screen' : $page;
			$screen_name  = isset( $path ) ? substr( str_replace( '/', '_', $path ), 1 ) : $current_page;
		} elseif ( isset( $post_type ) ) {
			$screen_name = $post_type;
		} elseif ( isset( $post ) ) {
			$screen_name = $post;
		}
		return $screen_name;
	}

	/**
	 * Loads the data store.
	 *
	 * If the "admin-note" data store is unavailable, attempts to load it
	 * will result in an exception.
	 * This method catches that exception and throws a custom one instead.
	 *
	 * @return \WC_Data_Store The "admin-note" data store.
	 * @throws NotesUnavailableException Throws exception if data store loading fails.
	 */
	public static function load_data_store() {
		try {
			return \WC_Data_Store::load( 'admin-note' );
		} catch ( \Exception $e ) {
			throw new NotesUnavailableException(
				'woocommerce_admin_notes_unavailable',
				__( 'Notes are unavailable because the "admin-note" data store cannot be loaded.', 'woocommerce' )
			);
		}
	}
}
woocommerce-admin/src/Notes/LaunchChecklist.php000064400000003116151335517650015621 0ustar00<?php
/**
 * WooCommerce Admin Launch Checklist Note.
 *
 * Adds a note to cover pre-launch checklist items for store owners.
 */

namespace Automattic\WooCommerce\Admin\Notes;

defined( 'ABSPATH' ) || exit;

/**
 * Launch_Checklist
 */
class LaunchChecklist {
	/**
	 * Note traits.
	 */
	use NoteTraits;

	/**
	 * Name of the note for use in the database.
	 */
	const NOTE_NAME = 'wc-admin-launch-checklist';

	/**
	 * Get the note.
	 *
	 * @return Note
	 */
	public static function get_note() {
		// Only add this note if completing the task list or completed 3 tasks in 10 days.
		$completed_tasks     = get_option( 'woocommerce_task_list_tracked_completed_tasks', array() );
		$ten_days_in_seconds = 10 * DAY_IN_SECONDS;
		if (
			! get_option( 'woocommerce_task_list_complete' ) &&
			(
				count( $completed_tasks ) < 3 ||
				self::is_wc_admin_active_in_date_range( 'week-1-4', $ten_days_in_seconds )
			)
		) {
			return;
		}

		$content = __( 'To make sure you never get that sinking "what did I forget" feeling, we\'ve put together the essential pre-launch checklist.', 'woocommerce' );

		$note = new Note();
		$note->set_title( __( 'Ready to launch your store?', 'woocommerce' ) );
		$note->set_content( $content );
		$note->set_content_data( (object) array() );
		$note->set_type( Note::E_WC_ADMIN_NOTE_INFORMATIONAL );
		$note->set_name( self::NOTE_NAME );
		$note->set_source( 'woocommerce-admin' );
		$note->add_action( 'learn-more', __( 'Learn more', 'woocommerce' ), 'https://woocommerce.com/posts/pre-launch-checklist-the-essentials/?utm_source=inbox&utm_medium=product' );
		return $note;
	}
}
woocommerce-admin/src/Notes/CouponPageMoved.php000064400000006767151335517650015627 0ustar00<?php
/**
 * WooCommerce Admin Coupon Page Moved provider.
 *
 * Adds a notice when the store manager access the coupons page via the old WooCommerce > Coupons menu.
 */

namespace Automattic\WooCommerce\Admin\Notes;

use Automattic\WooCommerce\Admin\Features\Features;
use Automattic\WooCommerce\Admin\Features\CouponsMovedTrait;
use stdClass;
use WC_Data_Store;

defined( 'ABSPATH' ) || exit;

/**
 * Coupon_Page_Moved class.
 */
class CouponPageMoved {

	use NoteTraits, CouponsMovedTrait;

	const NOTE_NAME = 'wc-admin-coupon-page-moved';

	/**
	 * Initialize our hooks.
	 */
	public function init() {
		if ( ! wc_coupons_enabled() ) {
			return;
		}

		add_action( 'admin_init', [ $this, 'possibly_add_note' ] );
		add_action( 'admin_init', [ $this, 'redirect_to_coupons' ] );
	}

	/**
	 * Checks if a note can and should be added.
	 *
	 * @return bool
	 */
	public static function can_be_added() {
		if ( ! wc_coupons_enabled() ) {
			return false;
		}

		// Don't add the notice if it's been hidden by the user before.
		if ( self::has_dismissed_note() ) {
			return false;
		}

		// If we already have a notice, don't add a new one.
		if ( self::has_unactioned_note() ) {
			return false;
		}

		// If new navigation feature is enabled.
		if ( Features::is_enabled( 'navigation' ) ) {
			return false;
		}

		return isset( $_GET[ self::$query_key ] ) && (bool) $_GET[ self::$query_key ]; // phpcs:ignore WordPress.Security.NonceVerification
	}

	/**
	 * Get the note object for this class.
	 *
	 * @return Note
	 */
	public static function get_note() {
		$note = new Note();
		$note->set_title( __( 'Coupon management has moved!', 'woocommerce' ) );
		$note->set_content( __( 'Coupons can now be managed from Marketing > Coupons. Click the button below to remove the legacy WooCommerce > Coupons menu item.', 'woocommerce' ) );
		$note->set_type( Note::E_WC_ADMIN_NOTE_UPDATE );
		$note->set_name( self::NOTE_NAME );
		$note->set_content_data( new stdClass() );
		$note->set_source( 'woocommerce-admin' );
		$note->add_action(
			'remove-legacy-coupon-menu',
			__( 'Remove legacy coupon menu', 'woocommerce' ),
			wc_admin_url( '&action=remove-coupon-menu' ),
			Note::E_WC_ADMIN_NOTE_ACTIONED,
			true
		);

		return $note;
	}

	/**
	 * Find notes that have not been actioned.
	 *
	 * @return bool
	 */
	protected static function has_unactioned_note() {
		$notes = self::get_data_store()->get_notes(
			[
				'name'       => [ self::NOTE_NAME ],
				'status'     => [ 'unactioned' ],
				'is_deleted' => false,
			]
		);

		return ! empty( $notes );
	}

	/**
	 * Whether any notes have been dismissed by the user previously.
	 *
	 * @return bool
	 */
	protected static function has_dismissed_note() {
		$notes = self::get_data_store()->get_notes(
			[
				'name'       => [ self::NOTE_NAME ],
				'is_deleted' => true,
			]
		);

		return ! empty( $notes );
	}

	/**
	 * Get the data store object.
	 *
	 * @return DataStore The data store object.
	 */
	protected static function get_data_store() {
		return WC_Data_Store::load( 'admin-note' );
	}

	/**
	 * Safe redirect to the coupon page to force page refresh.
	 */
	public function redirect_to_coupons() {
		/* phpcs:disable WordPress.Security.NonceVerification */
		if (
			! isset( $_GET['page'] ) ||
			'wc-admin' !== $_GET['page'] ||
			! isset( $_GET['action'] ) ||
			'remove-coupon-menu' !== $_GET['action'] ||
			! defined( 'WC_ADMIN_PLUGIN_FILE' )
		) {
			return;
		}
		/* phpcs:enable */
		$this->display_legacy_menu( false );
		wp_safe_redirect( self::get_management_url( 'coupons' ) );
		exit;
	}
}
woocommerce-admin/src/Notes/OrderMilestones.php000064400000020031151335517650015666 0ustar00<?php
/**
 * WooCommerce Admin (Dashboard) Order Milestones Note Provider.
 *
 * Adds a note to the merchant's inbox when certain order milestones are reached.
 */

namespace Automattic\WooCommerce\Admin\Notes;

defined( 'ABSPATH' ) || exit;

/**
 * Order_Milestones
 */
class OrderMilestones {
	/**
	 * Name of the "other milestones" note.
	 */
	const NOTE_NAME = 'wc-admin-orders-milestone';

	/**
	 * Option key name to store last order milestone.
	 */
	const LAST_ORDER_MILESTONE_OPTION_KEY = 'woocommerce_admin_last_orders_milestone';

	/**
	 * Hook to process order milestones.
	 */
	const PROCESS_ORDERS_MILESTONE_HOOK = 'wc_admin_process_orders_milestone';

	/**
	 * Allowed order statuses for calculating milestones.
	 *
	 * @var array
	 */
	protected $allowed_statuses = array(
		'pending',
		'processing',
		'completed',
	);

	/**
	 * Orders count cache.
	 *
	 * @var int
	 */
	protected $orders_count = null;

	/**
	 * Further order milestone thresholds.
	 *
	 * @var array
	 */
	protected $milestones = array(
		1,
		10,
		100,
		250,
		500,
		1000,
		5000,
		10000,
		500000,
		1000000,
	);

	/**
	 * Delay hook attachment until after the WC post types have been registered.
	 *
	 * This is required for retrieving the order count.
	 */
	public function __construct() {
		/**
		 * Filter Order statuses that will count towards milestones.
		 *
		 * @since 3.5.0
		 *
		 * @param array $allowed_statuses Order statuses that will count towards milestones.
		 */
		$this->allowed_statuses = apply_filters( 'woocommerce_admin_order_milestone_statuses', $this->allowed_statuses );

		add_action( 'woocommerce_after_register_post_type', array( $this, 'init' ) );
		register_deactivation_hook( WC_ADMIN_PLUGIN_FILE, array( $this, 'clear_scheduled_event' ) );
	}

	/**
	 * Hook everything up.
	 */
	public function init() {
		if ( ! wp_next_scheduled( self::PROCESS_ORDERS_MILESTONE_HOOK ) ) {
			wp_schedule_event( time(), 'hourly', self::PROCESS_ORDERS_MILESTONE_HOOK );
		}

		add_action( 'wc_admin_installed', array( $this, 'backfill_last_milestone' ) );

		add_action( self::PROCESS_ORDERS_MILESTONE_HOOK, array( $this, 'other_milestones' ) );
	}

	/**
	 * Clear out our hourly milestone hook upon plugin deactivation.
	 */
	public function clear_scheduled_event() {
		wp_clear_scheduled_hook( self::PROCESS_ORDERS_MILESTONE_HOOK );
	}

	/**
	 * Get the total count of orders (in the allowed statuses).
	 *
	 * @param bool $no_cache Optional. Skip cache.
	 * @return int Total orders count.
	 */
	public function get_orders_count( $no_cache = false ) {
		if ( $no_cache || is_null( $this->orders_count ) ) {
			$status_counts      = array_map( 'wc_orders_count', $this->allowed_statuses );
			$this->orders_count = array_sum( $status_counts );
		}

		return $this->orders_count;
	}

	/**
	 * Backfill the store's current milestone.
	 *
	 * Used to avoid celebrating milestones that were reached before plugin activation.
	 */
	public function backfill_last_milestone() {
		// If the milestone notes have been disabled via filter, bail.
		if ( ! $this->are_milestones_enabled() ) {
			return;
		}

		$this->set_last_milestone( $this->get_current_milestone() );
	}

	/**
	 * Get the store's last milestone.
	 *
	 * @return int Last milestone reached.
	 */
	public function get_last_milestone() {
		return get_option( self::LAST_ORDER_MILESTONE_OPTION_KEY, 0 );
	}

	/**
	 * Update the last reached milestone.
	 *
	 * @param int $milestone Last milestone reached.
	 */
	public function set_last_milestone( $milestone ) {
		update_option( self::LAST_ORDER_MILESTONE_OPTION_KEY, $milestone );
	}

	/**
	 * Calculate the current orders milestone.
	 *
	 * Based on the threshold values in $this->milestones.
	 *
	 * @return int Current orders milestone.
	 */
	public function get_current_milestone() {
		$milestone_reached = 0;
		$orders_count      = $this->get_orders_count();

		foreach ( $this->milestones as $milestone ) {
			if ( $milestone <= $orders_count ) {
				$milestone_reached = $milestone;
			}
		}

		return $milestone_reached;
	}

	/**
	 * Get the appropriate note title for a given milestone.
	 *
	 * @param int $milestone Order milestone.
	 * @return string Note title for the milestone.
	 */
	public function get_note_title_for_milestone( $milestone ) {
		switch ( $milestone ) {
			case 1:
				return __( 'First order received', 'woocommerce' );
			case 10:
			case 100:
			case 250:
			case 500:
			case 1000:
			case 5000:
			case 10000:
			case 500000:
			case 1000000:
				return sprintf(
					/* translators: Number of orders processed. */
					__( 'Congratulations on processing %s orders!', 'woocommerce' ),
					wc_format_decimal( $milestone )
				);
			default:
				return '';
		}
	}

	/**
	 * Get the appropriate note content for a given milestone.
	 *
	 * @param int $milestone Order milestone.
	 * @return string Note content for the milestone.
	 */
	public function get_note_content_for_milestone( $milestone ) {
		switch ( $milestone ) {
			case 1:
				return __( 'Congratulations on getting your first order! Now is a great time to learn how to manage your orders.', 'woocommerce' );
			case 10:
				return __( "You've hit the 10 orders milestone! Look at you go. Browse some WooCommerce success stories for inspiration.", 'woocommerce' );
			case 100:
			case 250:
			case 500:
			case 1000:
			case 5000:
			case 10000:
			case 500000:
			case 1000000:
				return __( 'Another order milestone! Take a look at your Orders Report to review your orders to date.', 'woocommerce' );
			default:
				return '';
		}
	}

	/**
	 * Get the appropriate note action for a given milestone.
	 *
	 * @param int $milestone Order milestone.
	 * @return array Note actoion (name, label, query) for the milestone.
	 */
	public function get_note_action_for_milestone( $milestone ) {
		switch ( $milestone ) {
			case 1:
				return array(
					'name'  => 'learn-more',
					'label' => __( 'Learn more', 'woocommerce' ),
					'query' => 'https://docs.woocommerce.com/document/managing-orders/?utm_source=inbox&utm_medium=product',
				);
			case 10:
				return array(
					'name'  => 'browse',
					'label' => __( 'Browse', 'woocommerce' ),
					'query' => 'https://woocommerce.com/success-stories/?utm_source=inbox&utm_medium=product',
				);
			case 100:
			case 250:
			case 500:
			case 1000:
			case 5000:
			case 10000:
			case 500000:
			case 1000000:
				return array(
					'name'  => 'review-orders',
					'label' => __( 'Review your orders', 'woocommerce' ),
					'query' => '?page=wc-admin&path=/analytics/orders',
				);
			default:
				return array(
					'name'  => '',
					'label' => '',
					'query' => '',
				);
		}
	}

	/**
	 * Convenience method to see if the milestone notes are enabled.
	 *
	 * @return boolean True if milestone notifications are enabled.
	 */
	public function are_milestones_enabled() {
		/**
		 * Filter to allow for disabling order milestones.
		 *
		 * @since 3.7.0
		 *
		 * @param boolean default true
		 */
		$milestone_notes_enabled = apply_filters( 'woocommerce_admin_order_milestones_enabled', true );

		return $milestone_notes_enabled;
	}

	/**
	 * Add milestone notes for other significant thresholds.
	 */
	public function other_milestones() {
		// If the milestone notes have been disabled via filter, bail.
		if ( ! $this->are_milestones_enabled() ) {
			return;
		}

		$last_milestone    = $this->get_last_milestone();
		$current_milestone = $this->get_current_milestone();

		if ( $current_milestone <= $last_milestone ) {
			return;
		}

		$this->set_last_milestone( $current_milestone );

		// We only want one milestone note at any time.
		Notes::delete_notes_with_name( self::NOTE_NAME );

		// Add the milestone note.
		$note = new Note();
		$note->set_title( $this->get_note_title_for_milestone( $current_milestone ) );
		$note->set_content( $this->get_note_content_for_milestone( $current_milestone ) );
		$note_action = $this->get_note_action_for_milestone( $current_milestone );
		$note->add_action( $note_action['name'], $note_action['label'], $note_action['query'] );
		$note->set_type( Note::E_WC_ADMIN_NOTE_INFORMATIONAL );
		$note->set_name( self::NOTE_NAME );
		$note->set_source( 'woocommerce-admin' );
		$note->save();
	}
}
woocommerce-admin/src/Notes/WooCommerceSubscriptions.php000064400000003411151335517650017562 0ustar00<?php
/**
 * WooCommerce Admin: WooCommerce Subscriptions.
 *
 * Adds a note to learn more about WooCommerce Subscriptions.
 */

namespace Automattic\WooCommerce\Admin\Notes;

defined( 'ABSPATH' ) || exit;

use \Automattic\WooCommerce\Admin\Features\Onboarding;

/**
 * WooCommerce_Subscriptions.
 */
class WooCommerceSubscriptions {
	/**
	 * Note traits.
	 */
	use NoteTraits;

	/**
	 * Name of the note for use in the database.
	 */
	const NOTE_NAME = 'wc-admin-woocommerce-subscriptions';

	/**
	 * Get the note.
	 *
	 * @return Note|null
	 */
	public static function get_note() {
		$onboarding_data = get_option( Onboarding::PROFILE_DATA_OPTION, array() );

		if ( ! isset( $onboarding_data['product_types'] ) || ! in_array( 'subscriptions', $onboarding_data['product_types'], true ) ) {
			return;
		}

		if ( ! self::is_wc_admin_active_in_date_range( 'week-1', DAY_IN_SECONDS ) ) {
			return;
		}

		$note = new Note();
		$note->set_title( __( 'Do you need more info about WooCommerce Subscriptions?', 'woocommerce' ) );
		$note->set_content( __( 'WooCommerce Subscriptions allows you to introduce a variety of subscriptions for physical or virtual products and services. Create product-of-the-month clubs, weekly service subscriptions or even yearly software billing packages. Add sign-up fees, offer free trials, or set expiration periods.', 'woocommerce' ) );
		$note->set_type( Note::E_WC_ADMIN_NOTE_MARKETING );
		$note->set_name( self::NOTE_NAME );
		$note->set_content_data( (object) array() );
		$note->set_source( 'woocommerce-admin' );
		$note->add_action(
			'learn-more',
			__( 'Learn More', 'woocommerce' ),
			'https://woocommerce.com/products/woocommerce-subscriptions/?utm_source=inbox&utm_medium=product',
			Note::E_WC_ADMIN_NOTE_UNACTIONED,
			true
		);
		return $note;
	}
}
woocommerce-admin/src/Notes/CustomizingProductCatalog.php000064400000004050151335517650017722 0ustar00<?php
/**
 * WooCommerce Admin: How to customize your product catalog note provider
 *
 * Adds a note with a link to the customizer a day after adding the first product
 */

namespace Automattic\WooCommerce\Admin\Notes;

defined( 'ABSPATH' ) || exit;

/**
 * Class CustomizingProductCatalog
 *
 * @package Automattic\WooCommerce\Admin\Notes
 */
class CustomizingProductCatalog {
	/**
	 * Note traits.
	 */
	use NoteTraits;

	/**
	 * Name of the note for use in the database.
	 */
	const NOTE_NAME = 'wc-admin-customizing-product-catalog';

	/**
	 * Get the note.
	 *
	 * @return Note
	 */
	public static function get_note() {
		$query = new \WC_Product_Query(
			array(
				'limit'    => 1,
				'paginate' => true,
				'status'   => array( 'publish' ),
				'orderby'  => 'post_date',
				'order'    => 'DESC',
			)
		);

		$products = $query->get_products();

		// we need at least 1 product.
		if ( 0 === $products->total ) {
			return;
		}

		$product           = $products->products[0];
		$created_timestamp = $product->get_date_created()->getTimestamp();
		$is_a_day_old      = ( time() - $created_timestamp ) >= DAY_IN_SECONDS;

		// the product must be at least 1 day old.
		if ( ! $is_a_day_old ) {
			return;
		}

		// store must not been active more than 14 days.
		if ( self::wc_admin_active_for( DAY_IN_SECONDS * 14 ) ) {
			return;
		}

		$note = new Note();
		$note->set_title( __( 'How to customize your product catalog', 'woocommerce' ) );
		$note->set_content( __( 'You want your product catalog and images to look great and align with your brand. This guide will give you all the tips you need to get your products looking great in your store.', 'woocommerce' ) );
		$note->set_type( Note::E_WC_ADMIN_NOTE_INFORMATIONAL );
		$note->set_name( self::NOTE_NAME );
		$note->set_content_data( (object) array() );
		$note->set_source( 'woocommerce-admin' );
		$note->add_action(
			'day-after-first-product',
			__( 'Learn more', 'woocommerce' ),
			'https://docs.woocommerce.com/document/woocommerce-customizer/?utm_source=inbox&utm_medium=product'
		);

		return $note;
	}
}
woocommerce-admin/src/Notes/RealTimeOrderAlerts.php000064400000002640151335517650016427 0ustar00<?php
/**
 * WooCommerce Admin Real Time Order Alerts Note.
 *
 * Adds a note to download the mobile app to monitor store activity.
 */

namespace Automattic\WooCommerce\Admin\Notes;

defined( 'ABSPATH' ) || exit;

/**
 * Real_Time_Order_Alerts
 */
class RealTimeOrderAlerts {
	/**
	 * Note traits.
	 */
	use NoteTraits;

	/**
	 * Name of the note for use in the database.
	 */
	const NOTE_NAME = 'wc-admin-real-time-order-alerts';

	/**
	 * Get the note.
	 *
	 * @return Note
	 */
	public static function get_note() {
		// Only add this note if the store is 3 months old.
		if ( ! self::is_wc_admin_active_in_date_range( 'month-3-6' ) ) {
			return;
		}

		// Check that the previous mobile app note was not actioned.
		if ( MobileApp::has_note_been_actioned() ) {
			return;
		}

		$content = __( 'Get notifications about store activity, including new orders and product reviews directly on your mobile devices with the Woo app.', 'woocommerce' );

		$note = new Note();
		$note->set_title( __( 'Get real-time order alerts anywhere', 'woocommerce' ) );
		$note->set_content( $content );
		$note->set_content_data( (object) array() );
		$note->set_type( Note::E_WC_ADMIN_NOTE_INFORMATIONAL );
		$note->set_name( self::NOTE_NAME );
		$note->set_source( 'woocommerce-admin' );
		$note->add_action( 'learn-more', __( 'Learn more', 'woocommerce' ), 'https://woocommerce.com/mobile/?utm_source=inbox&utm_medium=product' );
		return $note;
	}
}
woocommerce-admin/src/Notes/LearnMoreAboutVariableProducts.php000064400000004300151335517650020622 0ustar00<?php
/**
 * WooCommerce Admin learn more about variable products note provider
 *
 * Adds a note when the store owner adds the first product.
 *
 * @package WooCommerce\Admin
 */

namespace Automattic\WooCommerce\Admin\Notes;

defined( 'ABSPATH' ) || exit;

/**
 * Class AddingAndManangingProducts
 *
 * @package Automattic\WooCommerce\Admin\Notes
 */
class LearnMoreAboutVariableProducts {
	/**
	 * Note traits.
	 */
	use NoteTraits;

	/**
	 * Name of the note for use in the database.
	 */
	const NOTE_NAME = 'wc-admin-learn-more-about-variable-products';

	/**
	 * Add transition_post_status action.
	 *
	 * LearnMoreAboutVariableProducts constructor.
	 */
	public function __construct() {
		add_action( 'transition_post_status', array( $this, 'maybe_add_new_note' ), 10, 3 );
	}

	/**
	 * Maybe attempt to add a new note if product is published.
	 *
	 * @param string $new_status new status.
	 * @param string $old_status old status.
	 * @param object $post post object.
	 */
	public function maybe_add_new_note( $new_status, $old_status, $post ) {
		if ( 'publish' === $new_status && 'publish' !== $old_status && 'product' === $post->post_type ) {
			$product = wc_get_product( $post->ID );
			if ( ! $product ) {
				return;
			}

			$product->is_type( 'simple' ) && static::possibly_add_note();
		}
	}

	/**
	 * Get the note.
	 *
	 * @return Note|null
	 */
	public static function get_note() {
		$note = new Note();
		$note->set_title( __( 'Learn more about variable products', 'woocommerce' ) );
		$note->set_content(
			__(
				'Variable products are a powerful product type that lets you offer a set of variations on a product, with control over prices, stock, image and more for each variation. They can be used for a product like a shirt, where you can offer a large, medium and small and in different colors.',
				'woocommerce'
			)
		);
		$note->set_content_data( (object) array() );
		$note->set_type( Note::E_WC_ADMIN_NOTE_INFORMATIONAL );
		$note->set_name( self::NOTE_NAME );
		$note->set_source( 'woocommerce-admin' );
		$note->add_action(
			'learn-more',
			__( 'Learn more', 'woocommerce' ),
			'https://docs.woocommerce.com/document/variable-product/?utm_source=inbox&utm_medium=product'
		);

		return $note;
	}
}
woocommerce-admin/src/Notes/SellingOnlineCourses.php000064400000004420151335517650016662 0ustar00<?php
/**
 * WooCommerce Admin: Selling Online Courses note
 *
 * Adds a note to encourage selling online courses.
 */

namespace Automattic\WooCommerce\Admin\Notes;

defined( 'ABSPATH' ) || exit;

use \Automattic\WooCommerce\Admin\Features\Onboarding;

/**
 * Selling_Online_Courses
 */
class SellingOnlineCourses {
	/**
	 * Note traits.
	 */
	use NoteTraits;

	/**
	 * Name of the note for use in the database.
	 */
	const NOTE_NAME = 'wc-admin-selling-online-courses';

	/**
	 * Attach hooks.
	 */
	public function __construct() {
		add_action(
			'update_option_' . Onboarding::PROFILE_DATA_OPTION,
			array( $this, 'check_onboarding_profile' ),
			10,
			3
		);
	}

	/**
	 * Check to see if the profiler options match before possibly adding note.
	 *
	 * @param object $old_value The old option value.
	 * @param object $value     The new option value.
	 * @param string $option    The name of the option.
	 */
	public static function check_onboarding_profile( $old_value, $value, $option ) {
		// Skip adding if this store is in the education/learning industry.
		if ( ! isset( $value['industry'] ) ) {
			return;
		}
		$industry_slugs = array_column( $value['industry'], 'slug' );
		if ( ! in_array( 'education-and-learning', $industry_slugs, true ) ) {
			return;
		}

		self::possibly_add_note();
	}

	/**
	 * Get the note.
	 *
	 * @return Note
	 */
	public static function get_note() {
		$note = new Note();

		$note->set_title( __( 'Do you want to sell online courses?', 'woocommerce' ) );
		$note->set_content( __( 'Online courses are a great solution for any business that can teach a new skill. Since courses don’t require physical product development or shipping, they’re affordable, fast to create, and can generate passive income for years to come. In this article, we provide you more information about selling courses using WooCommerce.', 'woocommerce' ) );
		$note->set_content_data( (object) array() );
		$note->set_type( Note::E_WC_ADMIN_NOTE_MARKETING );
		$note->set_name( self::NOTE_NAME );
		$note->set_source( 'woocommerce-admin' );
		$note->add_action(
			'learn-more',
			__( 'Learn more', 'woocommerce' ),
			'https://woocommerce.com/posts/how-to-sell-online-courses-wordpress/?utm_source=inbox&utm_medium=product',
			Note::E_WC_ADMIN_NOTE_ACTIONED,
			true
		);

		return $note;
	}
}
woocommerce-admin/src/Notes/PerformanceOnMobile.php000064400000003043151335517650016442 0ustar00<?php
/**
 * WooCommerce Admin Performance on mobile note.
 *
 * Adds a note to download the mobile app, performance on mobile.
 */

namespace Automattic\WooCommerce\Admin\Notes;

defined( 'ABSPATH' ) || exit;

/**
 * Performance_On_Mobile
 */
class PerformanceOnMobile {
	/**
	 * Note traits.
	 */
	use NoteTraits;

	/**
	 * Name of the note for use in the database.
	 */
	const NOTE_NAME = 'wc-admin-performance-on-mobile';

	/**
	 * Get the note.
	 *
	 * @return Note
	 */
	public static function get_note() {
		// Only add this note if this store is at least 9 months old.
		$nine_months_in_seconds = MONTH_IN_SECONDS * 9;
		if ( ! self::wc_admin_active_for( $nine_months_in_seconds ) ) {
			return;
		}

		// Check that the previous mobile app notes have not been actioned.
		if ( MobileApp::has_note_been_actioned() ) {
			return;
		}
		if ( RealTimeOrderAlerts::has_note_been_actioned() ) {
			return;
		}
		if ( ManageOrdersOnTheGo::has_note_been_actioned() ) {
			return;
		}

		$note = new Note();

		$note->set_title( __( 'Track your store performance on mobile', 'woocommerce' ) );
		$note->set_content( __( 'Monitor your sales and high performing products with the Woo app.', 'woocommerce' ) );
		$note->set_content_data( (object) array() );
		$note->set_type( Note::E_WC_ADMIN_NOTE_INFORMATIONAL );
		$note->set_name( self::NOTE_NAME );
		$note->set_source( 'woocommerce-admin' );
		$note->add_action(
			'learn-more',
			__( 'Learn more', 'woocommerce' ),
			'https://woocommerce.com/mobile/?utm_source=inbox&utm_medium=product'
		);

		return $note;
	}
}
woocommerce-admin/src/Notes/MarketingJetpack.php000064400000006605151335517650016006 0ustar00<?php
/**
 * WooCommerce Admin Jetpack Marketing Note Provider.
 *
 * Adds notes to the merchant's inbox concerning Jetpack Backup.
 */

namespace Automattic\WooCommerce\Admin\Notes;

use Automattic\Jetpack\Constants;
use Automattic\WooCommerce\Admin\PluginsHelper;

defined( 'ABSPATH' ) || exit;

/**
 * Suggest Jetpack Backup to Woo users.
 *
 * Note: This should probably live in the Jetpack plugin in the future.
 *
 * @see  https://developer.woocommerce.com/2020/10/16/using-the-admin-notes-inbox-in-woocommerce/
 */
class MarketingJetpack {
	// Shared Note Traits.
	use NoteTraits;

	/**
	 * Name of the note for use in the database.
	 */
	const NOTE_NAME = 'wc-admin-marketing-jetpack-backup';

	/**
	 * Product IDs that include Backup.
	 */
	const BACKUP_IDS = [
		2010,
		2011,
		2012,
		2013,
		2014,
		2015,
		2100,
		2101,
		2102,
		2103,
		2005,
		2006,
		2000,
		2003,
		2001,
		2004,
	];

	/**
	 * Maybe add a note on Jetpack Backups for Jetpack sites older than a week without Backups.
	 */
	public static function possibly_add_note() {
		/**
		 * Check if Jetpack is installed.
		 */
		$installed_plugins = PluginsHelper::get_installed_plugin_slugs();
		if ( ! in_array( 'jetpack', $installed_plugins, true ) ) {
			return;
		}

		$data_store = \WC_Data_Store::load( 'admin-note' );

		// Do we already have this note?
		$note_ids = $data_store->get_notes_with_name( self::NOTE_NAME );
		if ( ! empty( $note_ids ) ) {

			$note_id = array_pop( $note_ids );
			$note    = Notes::get_note( $note_id );
			if ( false === $note ) {
				return;
			}

			// If Jetpack Backups was purchased after the note was created, mark this note as actioned.
			if ( self::has_backups() && Note::E_WC_ADMIN_NOTE_ACTIONED !== $note->get_status() ) {
				$note->set_status( Note::E_WC_ADMIN_NOTE_ACTIONED );
				$note->save();
			}

			return;
		}

		// Check requirements.
		if ( ! self::is_wc_admin_active_in_date_range( 'week-1-4' ) || ! self::can_be_added() || self::has_backups() ) {
			return;
		}

		// Add note.
		$note = self::get_note();
		$note->save();
	}

	/**
	 * Get the note.
	 */
	public static function get_note() {
		$note = new Note();
		$note->set_title( __( 'Protect your WooCommerce Store with Jetpack Backup.', 'woocommerce' ) );
		$note->set_content( __( 'Store downtime means lost sales. One-click restores get you back online quickly if something goes wrong.', 'woocommerce' ) );
		$note->set_type( Note::E_WC_ADMIN_NOTE_MARKETING );
		$note->set_name( self::NOTE_NAME );
		$note->set_content_data( (object) array() );
		$note->set_source( 'woocommerce-admin-notes' );
		$note->add_action(
			'jetpack-backup-woocommerce',
			__( 'Get backups', 'woocommerce' ),
			esc_url( 'https://jetpack.com/upgrade/backup-woocommerce/?utm_source=inbox&utm_medium=automattic_referred&utm_campaign=jp_backup_to_woo' ),
			Note::E_WC_ADMIN_NOTE_ACTIONED
		);
		return $note;
	}

	/**
	 * Check if this blog already has a Jetpack Backups product.
	 *
	 * @return boolean  Whether or not this blog has backups.
	 */
	protected static function has_backups() {
		$product_ids = [];

		$plan = get_option( 'jetpack_active_plan' );
		if ( ! empty( $plan ) ) {
			$product_ids[] = $plan['product_id'];
		}

		$products = get_option( 'jetpack_site_products' );
		if ( ! empty( $products ) ) {
			foreach ( $products as $product ) {
				$product_ids[] = $product['product_id'];
			}
		}

		return (bool) array_intersect( self::BACKUP_IDS, $product_ids );
	}

}
woocommerce-admin/src/Notes/AddFirstProduct.php000064400000005300151335517650015613 0ustar00<?php
/**
 * WooCommerce Admin: Add First Product.
 *
 * Adds a note (type `email`) to bring the client back to the store setup flow.
 */

namespace Automattic\WooCommerce\Admin\Notes;

defined( 'ABSPATH' ) || exit;

/**
 * Add_First_Product.
 */
class AddFirstProduct {
	/**
	 * Note traits.
	 */
	use NoteTraits;

	/**
	 * Name of the note for use in the database.
	 */
	const NOTE_NAME = 'wc-admin-add-first-product-note';

	/**
	 * Get the note.
	 *
	 * @return Note
	 */
	public static function get_note() {
		if ( ! self::wc_admin_active_for( 2 * DAY_IN_SECONDS ) || self::wc_admin_active_for( 5 * DAY_IN_SECONDS ) ) {
			return;
		}

		// Don't show if there is a product.
		$query    = new \WC_Product_Query(
			array(
				'limit'  => 1,
				'return' => 'ids',
				'status' => array( 'publish' ),
			)
		);
		$products = $query->get_products();
		if ( 0 !== count( $products ) ) {
			return;
		}

		// Don't show if there is an orders.
		$args   = array(
			'limit'  => 1,
			'return' => 'ids',
		);
		$orders = wc_get_orders( $args );
		if ( 0 !== count( $orders ) ) {
			return;
		}

		// If you're updating the following please use sprintf to separate HTML tags.
		// https://github.com/woocommerce/woocommerce-admin/pull/6617#discussion_r596889685.
		$content_lines = array(
			'{greetings}<br/><br/>',
			/* translators: %s: line break */
			sprintf( __( 'Nice one; you\'ve created a WooCommerce store! Now it\'s time to add your first product and get ready to start selling.%s', 'woocommerce' ), '<br/><br/>' ),
			__( 'There are three ways to add your products: you can <strong>create products manually, import them at once via CSV file</strong>, or <strong>migrate them from another service</strong>.<br/><br/>', 'woocommerce' ),
			/* translators: %1$s is an open anchor tag (<a>) and %2$s is a close link tag (</a>). */
			sprintf( __( '%1$1sExplore our docs%2$2s for more information, or just get started!', 'woocommerce' ), '<a href="https://docs.woocommerce.com/document/managing-products/?utm_source=help_panel&utm_medium=product">', '</a>' ),
		);

		$additional_data = array(
			'role' => 'administrator',
		);

		$note = new Note();
		$note->set_title( __( 'Add your first product', 'woocommerce' ) );
		$note->set_content( implode( '', $content_lines ) );
		$note->set_content_data( (object) $additional_data );
		$note->set_image(
			plugins_url(
				'/images/admin_notes/dashboard-widget-setup.png',
				WC_ADMIN_PLUGIN_FILE
			)
		);
		$note->set_type( Note::E_WC_ADMIN_NOTE_EMAIL );
		$note->set_name( self::NOTE_NAME );
		$note->set_source( 'woocommerce-admin' );
		$note->add_action( 'add-first-product', __( 'Add a product', 'woocommerce' ), admin_url( 'admin.php?page=wc-admin&task=products' ) );
		return $note;
	}
}
woocommerce-admin/src/Notes/InsightFirstProductAndPayment.php000064400000003151151335517650020513 0ustar00<?php
/**
 * WooCommerce Admin: Insight - First product and payment setup
 *
 * Adds a note to give insight about the first product and payment setup
 *
 * @package WooCommerce\Admin
 */

namespace Automattic\WooCommerce\Admin\Notes;

defined( 'ABSPATH' ) || exit;

/**
 * Insight_First_Sale.
 */
class InsightFirstProductAndPayment {
	/**
	 * Note traits.
	 */
	use NoteTraits;

	/**
	 * Name of the note for use in the database.
	 */
	const NOTE_NAME = 'wc-admin-insight-first-product-and-payment';

	/**
	 * Get the note.
	 *
	 * @return Note
	 */
	public static function get_note() {
		// We want to show the note after 1 day.
		if ( ! self::is_wc_admin_active_in_date_range( 'week-1', DAY_IN_SECONDS ) ) {
			return;
		}

		$note = new Note();
		$note->set_title( __( 'Insight', 'woocommerce' ) );
		$note->set_content( __( 'More than 80% of new merchants add the first product and have at least one payment method set up during the first week.<br><br>Do you find this type of insight useful?', 'woocommerce' ) );
		$note->set_type( Note::E_WC_ADMIN_NOTE_SURVEY );
		$note->set_name( self::NOTE_NAME );
		$note->set_content_data( (object) array() );
		$note->set_source( 'woocommerce-admin' );
		$note->add_action(
			'affirm-insight-first-product-and-payment',
			__( 'Yes', 'woocommerce' ),
			false,
			Note::E_WC_ADMIN_NOTE_ACTIONED,
			false,
			__( 'Thanks for your feedback', 'woocommerce' )
		);

		$note->add_action(
			'affirm-insight-first-product-and-payment',
			__( 'No', 'woocommerce' ),
			false,
			Note::E_WC_ADMIN_NOTE_ACTIONED,
			false,
			__( 'Thanks for your feedback', 'woocommerce' )
		);

		return $note;
	}
}
woocommerce-admin/src/Notes/NotesUnavailableException.php000064400000000541151335517650017667 0ustar00<?php
/**
 * WooCommerce Admin Notes Unavailable Exception Class
 *
 * Exception class thrown when an attempt to use notes is made but notes are unavailable.
 */

namespace Automattic\WooCommerce\Admin\Notes;

defined( 'ABSPATH' ) || exit;

/**
 * Notes\NotesUnavailableException class.
 */
class NotesUnavailableException extends \WC_Data_Exception {}
woocommerce-admin/src/Notes/MerchantEmailNotifications/MerchantEmailNotifications.php000064400000006536151335517650025274 0ustar00<?php
/**
 * Handles merchant email notifications
 */

namespace Automattic\WooCommerce\Admin\Notes\MerchantEmailNotifications;

use Automattic\WooCommerce\Admin\Notes\Note;
use Automattic\WooCommerce\Admin\Notes\Notes;

defined( 'ABSPATH' ) || exit;

/**
 * Merchant email notifications.
 * This gets all non-sent notes type `email` and sends them.
 */
class MerchantEmailNotifications {
	/**
	 * Initialize the merchant email notifications.
	 */
	public static function init() {
		add_action( 'admin_init', array( __CLASS__, 'trigger_notification_action' ) );
	}

	/**
	 * Trigger the note action.
	 */
	public static function trigger_notification_action() {
		/* phpcs:disable WordPress.Security.NonceVerification */
		if (
			! isset( $_GET['external_redirect'] ) ||
			1 !== intval( $_GET['external_redirect'] ) ||
			! isset( $_GET['user'] ) ||
			! isset( $_GET['note'] ) ||
			! isset( $_GET['action'] )
		) {
			return;
		}
		$note_id   = intval( $_GET['note'] );
		$action_id = intval( $_GET['action'] );
		$user_id   = intval( $_GET['user'] );
		/* phpcs:enable */

		$note = Notes::get_note( $note_id );

		if ( ! $note ) {
			return;
		}

		$triggered_action = Notes::get_action_by_id( $note, $action_id );

		if ( ! $triggered_action ) {
			return;
		}

		Notes::trigger_note_action( $note, $triggered_action );
		$url = $triggered_action->query;

		// We will use "wp_safe_redirect" when it's an internal redirect.
		if ( strpos( $url, 'http' ) === false ) {
			wp_safe_redirect( $url );
		} else {
			header( 'Location: ' . $url );
		}
		exit();
	}

	/**
	 * Send all the notifications type `email`.
	 */
	public static function run() {
		$data_store = Notes::load_data_store();
		$notes      = $data_store->get_notes(
			array(
				'type'   => array( Note::E_WC_ADMIN_NOTE_EMAIL ),
				'status' => array( 'unactioned' ),
			)
		);

		foreach ( $notes as $note ) {
			$note = Notes::get_note( $note->note_id );
			if ( $note ) {
				self::send_merchant_notification( $note );
				$note->set_status( 'sent' );
				$note->save();
			}
		}
	}

	/**
	 * Send the notification to the merchant.
	 *
	 * @param object $note The note to send.
	 */
	public static function send_merchant_notification( $note ) {
		\WC_Emails::instance();
		$users = self::get_notification_recipients( $note );
		$email = new NotificationEmail( $note );
		foreach ( $users as $user ) {
			if ( is_email( $user->user_email ) ) {
				$name = self::get_merchant_preferred_name( $user );
				$email->trigger( $user->user_email, $user->ID, $name );
			}
		}
	}

	/**
	 * Get the preferred name for user. First choice is
	 * the user's first name, and then display_name.
	 *
	 * @param WP_User $user Recipient to send the note to.
	 * @return string User's name.
	 */
	public static function get_merchant_preferred_name( $user ) {
		$first_name = get_user_meta( $user->ID, 'first_name', true );
		if ( $first_name ) {
			return $first_name;
		}
		if ( $user->display_name ) {
			return $user->display_name;
		}
		return '';
	}

	/**
	 * Get users by role to notify.
	 *
	 * @param object $note The note to send.
	 * @return array Users to notify
	 */
	public static function get_notification_recipients( $note ) {
		$content_data = $note->get_content_data();
		$role         = 'administrator';
		if ( isset( $content_data->role ) ) {
			$role = $content_data->role;
		}
		$args = array( 'role' => $role );
		return get_users( $args );
	}
}
woocommerce-admin/src/Notes/MerchantEmailNotifications/NotificationEmail.php000064400000012256151335517650023423 0ustar00<?php
/**
 * Handles emailing user notes.
 */

namespace Automattic\WooCommerce\Admin\Notes\MerchantEmailNotifications;

use Automattic\WooCommerce\Admin\Notes\Notes;

if ( ! defined( 'ABSPATH' ) ) {
	exit;
}

/**
 * Include dependencies.
 */
if ( ! class_exists( 'WC_Email', false ) ) {
	include_once WC_ABSPATH . 'includes/emails/class-wc-email.php';
}

/**
 * NotificationEmail Class.
 */
class NotificationEmail extends \WC_Email {
	/**
	 * Constructor.
	 *
	 * @param Note $note The notification to send.
	 */
	public function __construct( $note ) {
		$this->note          = $note;
		$this->id            = 'merchant_notification';
		$this->template_base = WC_ADMIN_ABSPATH . 'includes/emails/';
		$this->placeholders  = array(
			'{greetings}' => __( 'Hi there,', 'woocommerce' ),
		);

		// Call parent constructor.
		parent::__construct();
	}

	/**
	 * This email has no user-facing settings.
	 */
	public function init_form_fields() {}

	/**
	 * This email has no user-facing settings.
	 */
	public function init_settings() {}

	/**
	 * Return template filename.
	 *
	 * @param string $type Type of email to send.
	 * @return string
	 */
	public function get_template_filename( $type = 'html' ) {
		if ( ! in_array( $type, array( 'html', 'plain' ), true ) ) {
			return;
		}
		$content_data      = $this->note->get_content_data();
		$template_filename = "{$type}-merchant-notification.php";
		if ( isset( $content_data->{"template_{$type}"} ) && file_exists( $this->template_base . $content_data->{ "template_{$type}" } ) ) {
			$template_filename = $content_data[ "template_{$type}" ];
		}
		return $template_filename;
	}

	/**
	 * Return email type.
	 *
	 * @return string
	 */
	public function get_email_type() {
		return class_exists( 'DOMDocument' ) ? 'html' : 'plain';
	}

	/**
	 * Get email heading.
	 *
	 * @return string
	 */
	public function get_default_heading() {
		$content_data = $this->note->get_content_data();
		if ( isset( $content_data->heading ) ) {
			return $content_data->heading;
		}

		return $this->note->get_title();
	}

	/**
	 * Get email headers.
	 *
	 * @return string
	 */
	public function get_headers() {
		$header = 'Content-Type: ' . $this->get_content_type() . "\r\n";
		return apply_filters( 'woocommerce_email_headers', $header, $this->id, $this->object, $this );
	}

	/**
	 * Get email subject.
	 *
	 * @return string
	 */
	public function get_default_subject() {
		return $this->note->get_title();
	}

	/**
	 * Get note content.
	 *
	 * @return string
	 */
	public function get_note_content() {
		return $this->note->get_content();
	}

	/**
	 * Get note image.
	 *
	 * @return string
	 */
	public function get_image() {
		return $this->note->get_image();
	}

	/**
	 * Get email action.
	 *
	 * @return stdClass
	 */
	public function get_actions() {
		return $this->note->get_actions();
	}

	/**
	 * Get content html.
	 *
	 * @return string
	 */
	public function get_content_html() {
		return wc_get_template_html(
			$this->get_template_filename( 'html' ),
			array(
				'email_actions'           => $this->get_actions(),
				'email_content'           => $this->format_string( $this->get_note_content() ),
				'email_heading'           => $this->format_string( $this->get_heading() ),
				'email_image'             => $this->get_image(),
				'sent_to_admin'           => true,
				'plain_text'              => false,
				'email'                   => $this,
				'opened_tracking_url'     => $this->opened_tracking_url,
				'trigger_note_action_url' => $this->trigger_note_action_url,
			),
			'',
			$this->template_base
		);
	}

	/**
	 * Get content plain.
	 *
	 * @return string
	 */
	public function get_content_plain() {
		return wc_get_template_html(
			$this->get_template_filename( 'plain' ),
			array(
				'email_heading'           => $this->format_string( $this->get_heading() ),
				'email_content'           => $this->format_string( $this->get_note_content() ),
				'email_actions'           => $this->get_actions(),
				'sent_to_admin'           => true,
				'plain_text'              => true,
				'email'                   => $this,
				'trigger_note_action_url' => $this->trigger_note_action_url,
			),
			'',
			$this->template_base
		);
	}

	/**
	 * Trigger the sending of this email.
	 *
	 * @param string $user_email Email to send the note.
	 * @param int    $user_id User id to to track the note.
	 * @param string $user_name User's name.
	 */
	public function trigger( $user_email, $user_id, $user_name ) {
		$this->recipient               = $user_email;
		$this->opened_tracking_url     = sprintf(
			'%1$s/wp-json/wc-analytics/admin/notes/tracker/%2$d/user/%3$d',
			site_url(),
			$this->note->get_id(),
			$user_id
		);
		$this->trigger_note_action_url = sprintf(
			'%1$s&external_redirect=1&note=%2$d&user=%3$d&action=',
			wc_admin_url(),
			$this->note->get_id(),
			$user_id
		);

		if ( $user_name ) {
			/* translators: %s = merchant name */
			$this->placeholders['{greetings}'] = sprintf( __( 'Hi %s,', 'woocommerce' ), $user_name );
		}

		$this->send(
			$this->get_recipient(),
			$this->get_subject(),
			$this->get_content(),
			$this->get_headers(),
			$this->get_attachments()
		);
		Notes::record_tracks_event_with_user( $user_id, 'email_note_sent', array( 'note_name' => $this->note->get_name() ) );
	}
}
woocommerce-admin/src/Notes/StartDropshippingBusiness.php000064400000004556151335517650017766 0ustar00<?php
/**
 * WooCommerce Admin: Starting a dropshipping business.
 *
 * Adds a note to ask the client if they are considering starting a dropshipping business.
 */

namespace Automattic\WooCommerce\Admin\Notes;

defined( 'ABSPATH' ) || exit;

/**
 * Start_Dropshipping_Business.
 */
class StartDropshippingBusiness {
	/**
	 * Note traits.
	 */
	use NoteTraits;

	/**
	 * Name of the note for use in the database.
	 */
	const NOTE_NAME = 'wc-admin-start-dropshipping-business';

	/**
	 * Get the note.
	 *
	 * @return Note|null
	 */
	public static function get_note() {

		// We want to show the note after one day.
		if ( ! self::is_wc_admin_active_in_date_range( 'week-1', DAY_IN_SECONDS ) ) {
			return;
		}

		$onboarding_profile = get_option( 'woocommerce_onboarding_profile', array() );

		// Confirm that $onboarding_profile is set.
		if ( empty( $onboarding_profile ) ) {
			return;
		}

		// Make sure that the person who filled out the OBW was not setting up the store for their customer/client.
		if (
			! isset( $onboarding_profile['setup_client'] ) ||
			$onboarding_profile['setup_client']
		) {
			return;
		}

		// We need to show the notification when product number is 0 or the revenue is 'none' or 'up to 2500'.
		if (
			! isset( $onboarding_profile['product_count'] ) ||
			! isset( $onboarding_profile['revenue'] ) ||
			(
				0 !== (int) $onboarding_profile['product_count'] &&
				'none' !== $onboarding_profile['revenue'] &&
				'up-to-2500' !== $onboarding_profile['revenue']
			)
		) {
			return;
		}

		$note = new Note();
		$note->set_title( __( 'Are you considering starting a dropshipping business?', 'woocommerce' ) );
		$note->set_content( __( 'The ability to add inventory without having to deal with production, stocking, or fulfilling orders may seem like a dream. But is dropshipping worth it? Let’s explore some of the advantages and disadvantages to help you make the best decision for your business.', 'woocommerce' ) );
		$note->set_type( Note::E_WC_ADMIN_NOTE_INFORMATIONAL );
		$note->set_name( self::NOTE_NAME );
		$note->set_content_data( (object) array() );
		$note->set_source( 'woocommerce-admin' );
		$note->add_action(
			'dropshipping-business',
			__( 'Learn more', 'woocommerce' ),
			'https://woocommerce.com/posts/is-dropshipping-worth-it-pros-cons/?utm_source=inbox&utm_medium=product',
			Note::E_WC_ADMIN_NOTE_ACTIONED,
			true
		);
		return $note;
	}
}
woocommerce-admin/src/Notes/NavigationFeedback.php000064400000002355151335517650016265 0ustar00<?php
/**
 * WooCommerce Admin Navigation Feature Feedback
 */

namespace Automattic\WooCommerce\Admin\Notes;

use Automattic\WooCommerce\Admin\Features\Features;
use Automattic\WooCommerce\Admin\Survey;

defined( 'ABSPATH' ) || exit;

/**
 * NavigationFeedback
 */
class NavigationFeedback {
	/**
	 * Note traits.
	 */
	use NoteTraits;

	/**
	 * Name of the note for use in the database.
	 */
	const NOTE_NAME = 'wc-admin-navigation-feedback';

	/**
	 * Get the note.
	 *
	 * @return Note
	 */
	public static function get_note() {
		if ( ! Features::is_enabled( 'navigation' ) ) {
			return;
		}

		$content = __( "We're introducing the new navigation for a more intuitive and improved user experience. We'd like to hear your thoughts and first impressions.", 'woocommerce' );

		$note = new Note();
		$note->set_title( __( 'You now have access to the new WooCommerce navigation', 'woocommerce' ) );
		$note->set_content( $content );
		$note->set_content_data( (object) array() );
		$note->set_type( Note::E_WC_ADMIN_NOTE_INFORMATIONAL );
		$note->set_name( self::NOTE_NAME );
		$note->set_source( 'woocommerce-admin' );
		$note->add_action( 'share-feedback', __( 'Share feedback', 'woocommerce' ), Survey::get_url( '/new-navigation' ) );
		return $note;
	}
}
woocommerce-admin/src/Notes/ChooseNiche.php000064400000004404151335517650014745 0ustar00<?php
/**
 * WooCommerce Admin: Choose a niche note.
 *
 * Adds a note to show the client how to choose a niche for their store.
 */

namespace Automattic\WooCommerce\Admin\Notes;

defined( 'ABSPATH' ) || exit;

/**
 * Choose_Niche.
 */
class ChooseNiche {
	/**
	 * Note traits.
	 */
	use NoteTraits;

	/**
	 * Name of the note for use in the database.
	 */
	const NOTE_NAME = 'wc-admin-choose-niche';

	/**
	 * Get the note.
	 *
	 * @return Note
	 */
	public static function get_note() {
		$onboarding_profile = get_option( 'woocommerce_onboarding_profile', array() );

		// Confirm that $onboarding_profile is set.
		if ( empty( $onboarding_profile ) ) {
			return;
		}

		// Make sure that the person who filled out the OBW was not setting up the store for their customer/client.
		if (
			! isset( $onboarding_profile['setup_client'] ) ||
			$onboarding_profile['setup_client']
		) {
			return;
		}

		// Make sure that the product count is set in the onboarding profile.
		if ( ! isset( $onboarding_profile['product_count'] ) ) {
			return;
		}

		// Make sure that the revenue is set in the onboarding profile.
		if ( ! isset( $onboarding_profile['revenue'] ) ) {
			return;
		}

		// We need to show the notification when product number is 0 or the revenue is 'none' or 'up to 2500'.
		if (
			0 !== (int) $onboarding_profile['product_count'] &&
			'none' !== $onboarding_profile['revenue'] &&
			'up-to-2500' !== $onboarding_profile['revenue']
		) {
			return;
		}

		$note = new Note();
		$note->set_title( __( 'Finding an audience for your business', 'woocommerce' ) );
		$note->set_content( __( 'There’s nothing quite like entrepreneurship! We put together a blog post series — titled From Idea to First Customer — with all the tips, resources, and tools to inspire a great idea, empower you to execute it, and lead to your very first sale.', 'woocommerce' ) );
		$note->set_type( Note::E_WC_ADMIN_NOTE_INFORMATIONAL );
		$note->set_name( self::NOTE_NAME );
		$note->set_content_data( (object) array() );
		$note->set_source( 'woocommerce-admin' );
		$note->add_action(
			'choose-niche',
			__( 'Learn more', 'woocommerce' ),
			'https://woocommerce.com/from-idea-to-first-customer/?utm_source=inbox&utm_medium=product',
			Note::E_WC_ADMIN_NOTE_ACTIONED,
			true
		);
		return $note;
	}
}
woocommerce-admin/src/Notes/NavigationFeedbackFollowUp.php000064400000003367151335517650017761 0ustar00<?php
/**
 * WooCommerce Admin Navigation Feature Feedback Follow Up.
 */

namespace Automattic\WooCommerce\Admin\Notes;

use Automattic\WooCommerce\Admin\Features\Features;
use Automattic\WooCommerce\Admin\Survey;

defined( 'ABSPATH' ) || exit;

/**
 * NavigationFeedbackFollowUp
 */
class NavigationFeedbackFollowUp {
	/**
	 * Note traits.
	 */
	use NoteTraits;

	/**
	 * Name of the note for use in the database.
	 */
	const NOTE_NAME = 'wc-admin-navigation-feedback-follow-up';

	/**
	 * Get the note.
	 *
	 * @return Note
	 */
	public static function get_note() {
		if ( ! Features::is_enabled( 'navigation' ) ) {
			return;
		}

		// Check that the first note was created.
		$data_store = Notes::load_data_store();
		$note_ids   = $data_store->get_notes_with_name( 'wc-admin-navigation-feedback' );
		if ( empty( $note_ids ) ) {
			return;
		}

		// Check that first note is at least 5 days old.
		$note      = Notes::get_note( $note_ids[0] );
		$timestamp = strtotime( $note->get_date_created() );
		if ( ( time() - $timestamp ) < DAY_IN_SECONDS * 5 ) {
			return;
		}

		$content = __( "We recently introduced the new navigation for a more intuitive and improved user experience. Now that you've had some time to give it a try, let us know how this will impact your store.", 'woocommerce' );

		$note = new Note();
		$note->set_title( __( 'Share your thoughts on the new WooCommerce navigation', 'woocommerce' ) );
		$note->set_content( $content );
		$note->set_content_data( (object) array() );
		$note->set_type( Note::E_WC_ADMIN_NOTE_INFORMATIONAL );
		$note->set_name( self::NOTE_NAME );
		$note->set_source( 'woocommerce-admin' );
		$note->add_action( 'share-feedback', __( 'Share feedback', 'woocommerce' ), Survey::get_url( '/new-navigation' ) );
		return $note;
	}
}
woocommerce-admin/src/Notes/UnsecuredReportFiles.php000064400000004030151335517650016665 0ustar00<?php
/**
 * WooCommerce Admin Unsecured Files Note.
 *
 * Adds a warning about potentially unsecured files.
 */

namespace Automattic\WooCommerce\Admin\Notes;

defined( 'ABSPATH' ) || exit;

if ( ! class_exists( Note::class ) ) {
	class_alias( WC_Admin_Note::class, Note::class );
}

/**
 * Unsecured_Report_Files
 */
class UnsecuredReportFiles {

	/**
	 * Name of the note for use in the database.
	 */
	const NOTE_NAME = 'wc-admin-remove-unsecured-report-files';

	/**
	 * Get the note.
	 *
	 * @return Note|null
	 */
	public static function get_note() {
		$note = new Note();
		$note->set_title( __( 'Potentially unsecured files were found in your uploads directory', 'woocommerce' ) );
		$note->set_content(
			sprintf(
				/* translators: 1: opening analytics docs link tag. 2: closing link tag */
				__( 'Files that may contain %1$sstore analytics%2$s reports were found in your uploads directory - we recommend assessing and deleting any such files.', 'woocommerce' ),
				'<a href="https://docs.woocommerce.com/document/woocommerce-analytics/" target="_blank">',
				'</a>'
			)
		);
		$note->set_content_data( (object) array() );
		$note->set_type( Note::E_WC_ADMIN_NOTE_ERROR );
		$note->set_name( self::NOTE_NAME );
		$note->set_source( 'woocommerce-admin' );
		$note->add_action(
			'learn-more',
			__( 'Learn more', 'woocommerce' ),
			'https://developer.woocommerce.com/?p=10410',
			Note::E_WC_ADMIN_NOTE_UNACTIONED,
			true
		);
		$note->add_action(
			'dismiss',
			__( 'Dismiss', 'woocommerce' ),
			wc_admin_url(),
			Note::E_WC_ADMIN_NOTE_ACTIONED,
			false
		);

		return $note;
	}

	/**
	 * Add the note if it passes predefined conditions.
	 */
	public static function possibly_add_note() {
		$note = self::get_note();

		if ( self::note_exists() ) {
			return;
		}

		$note->save();
	}

	/**
	 * Check if the note has been previously added.
	 */
	public static function note_exists() {
		$data_store = \WC_Data_Store::load( 'admin-note' );
		$note_ids   = $data_store->get_notes_with_name( self::NOTE_NAME );
		return ! empty( $note_ids );
	}

}
woocommerce-admin/src/Notes/MigrateFromShopify.php000064400000004167151335517650016342 0ustar00<?php
/**
 * WooCommerce Admin: Migrate from Shopify to WooCommerce.
 *
 * Adds a note to ask the client if they want to migrate from Shopify to WooCommerce.
 */

namespace Automattic\WooCommerce\Admin\Notes;

defined( 'ABSPATH' ) || exit;

/**
 * Migrate_From_Shopify.
 */
class MigrateFromShopify {
	/**
	 * Note traits.
	 */
	use NoteTraits;

	/**
	 * Name of the note for use in the database.
	 */
	const NOTE_NAME = 'wc-admin-migrate-from-shopify';

	/**
	 * Get the note.
	 *
	 * @return Note
	 */
	public static function get_note() {

		// We want to show the note after two days.
		$two_days = 2 * DAY_IN_SECONDS;
		if ( ! self::is_wc_admin_active_in_date_range( 'week-1', $two_days ) ) {
			return;
		}

		$onboarding_profile = get_option( 'woocommerce_onboarding_profile', array() );
		if (
			! isset( $onboarding_profile['setup_client'] ) ||
			! isset( $onboarding_profile['selling_venues'] ) ||
			! isset( $onboarding_profile['other_platform'] )
		) {
			return;
		}

		// Make sure the client is not setup.
		if ( $onboarding_profile['setup_client'] ) {
			return;
		}

		// We will show the notification when the client already is selling and is using Shopify.
		if (
			'other' !== $onboarding_profile['selling_venues'] ||
			'shopify' !== $onboarding_profile['other_platform']
		) {
			return;
		}

		$note = new Note();
		$note->set_title( __( 'Do you want to migrate from Shopify to WooCommerce?', 'woocommerce' ) );
		$note->set_content( __( 'Changing eCommerce platforms might seem like a big hurdle to overcome, but it is easier than you might think to move your products, customers, and orders to WooCommerce. This article will help you with going through this process.', 'woocommerce' ) );
		$note->set_type( Note::E_WC_ADMIN_NOTE_INFORMATIONAL );
		$note->set_name( self::NOTE_NAME );
		$note->set_content_data( (object) array() );
		$note->set_source( 'woocommerce-admin' );
		$note->add_action(
			'migrate-from-shopify',
			__( 'Learn more', 'woocommerce' ),
			'https://woocommerce.com/posts/migrate-from-shopify-to-woocommerce/?utm_source=inbox&utm_medium=product',
			Note::E_WC_ADMIN_NOTE_ACTIONED,
			true
		);
		return $note;
	}
}
woocommerce-admin/src/Notes/DrawAttention.php000064400000004022151335517650015335 0ustar00<?php
/**
 * WooCommerce Admin Draw Attention note provider
 *
 * Adds a note to the merchant's inbox
 */

namespace Automattic\WooCommerce\Admin\Notes;

use \Automattic\WooCommerce\Admin\Features\Onboarding;

defined( 'ABSPATH' ) || exit;

/**
 * Draw_Attention
 */
class DrawAttention {
	/**
	 * Note traits.
	 */
	use NoteTraits;

	/**
	 * Name of the note for use in the database.
	 */
	const NOTE_NAME = 'wc-admin-draw-attention';

	/**
	 * Constructor.
	 */
	public function __construct() {
		// Trigger this when the onboarding options are updated.
		add_filter( 'update_option_' . Onboarding::PROFILE_DATA_OPTION, array( $this, 'possibly_add_note' ) );
	}

	/**
	 * Get the note.
	 *
	 * @return Note
	 */
	public static function get_note() {
		// We want to show the note after 3 days.
		if ( ! self::is_wc_admin_active_in_date_range( 'week-1', 3 * DAY_IN_SECONDS ) ) {
			return;
		}

		$profile_data = get_option( Onboarding::PROFILE_DATA_OPTION, array() );

		// Skip adding if this store is being set up for a client.
		if ( ! isset( $profile_data['setup_client'] ) || $profile_data['setup_client'] ) {
			return;
		}

		// Skip adding if the merchant has no products.
		if ( ! isset( $profile_data['product_count'] ) || '0' === $profile_data['product_count'] ) {
			return;
		}

		$note = new Note();
		$note->set_title( __( 'Get noticed: how to draw attention to your online store', 'woocommerce' ) );
		$note->set_content( __( 'To get you started, here are seven ways to boost your sales and avoid getting drowned out by similar, mass-produced products competing for the same buyers.', 'woocommerce' ) );
		$note->set_content_data( (object) array() );
		$note->set_type( Note::E_WC_ADMIN_NOTE_INFORMATIONAL );
		$note->set_name( self::NOTE_NAME );
		$note->set_source( 'woocommerce-admin' );
		$note->add_action(
			'learn-more',
			__( 'Learn more', 'woocommerce' ),
			'https://woocommerce.com/posts/how-to-make-your-online-store-stand-out/?utm_source=inbox&utm_medium=product',
			Note::E_WC_ADMIN_NOTE_ACTIONED,
			true
		);
		return $note;
	}
}
woocommerce-admin/src/Notes/NewSalesRecord.php000064400000007711151335517650015442 0ustar00<?php
/**
 * WooCommerce Admin (Dashboard) New Sales Record Note Provider.
 *
 * Adds a note to the merchant's inbox when the previous day's sales are a new record.
 */

namespace Automattic\WooCommerce\Admin\Notes;

defined( 'ABSPATH' ) || exit;

/**
 * New_Sales_Record
 */
class NewSalesRecord {
	/**
	 * Note traits.
	 */
	use NoteTraits;

	/**
	 * Name of the note for use in the database.
	 */
	const NOTE_NAME = 'wc-admin-new-sales-record';

	/**
	 * Option name for the sales record date in ISO 8601 (YYYY-MM-DD) date.
	 */
	const RECORD_DATE_OPTION_KEY = 'woocommerce_sales_record_date';

	/**
	 * Option name for the sales record amount.
	 */
	const RECORD_AMOUNT_OPTION_KEY = 'woocommerce_sales_record_amount';

	/**
	 * Returns the total of yesterday's sales.
	 *
	 * @param string $date Date for sales to sum (i.e. YYYY-MM-DD).
	 * @return floatval
	 */
	public static function sum_sales_for_date( $date ) {
		$order_query = new \WC_Order_Query( array( 'date_created' => $date ) );
		$orders      = $order_query->get_orders();
		$total       = 0;

		foreach ( (array) $orders as $order ) {
			$total += $order->get_total();
		}

		return $total;
	}

	/**
	 * Possibly add a sales record note.
	 */
	public static function possibly_add_note() {
		/**
		 * Filter to allow for disabling sales record milestones.
		 *
		 * @since 3.7.0
		 *
		 * @param boolean default true
		 */
		$sales_record_notes_enabled = apply_filters( 'woocommerce_admin_sales_record_milestone_enabled', true );

		if ( ! $sales_record_notes_enabled ) {
			return;
		}

		$yesterday = gmdate( 'Y-m-d', current_time( 'timestamp', 0 ) - DAY_IN_SECONDS );
		$total     = self::sum_sales_for_date( $yesterday );

		// No sales yesterday? Bail.
		if ( 0 >= $total ) {
			return;
		}

		$record_date = get_option( self::RECORD_DATE_OPTION_KEY, '' );
		$record_amt  = floatval( get_option( self::RECORD_AMOUNT_OPTION_KEY, 0 ) );

		// No previous entry? Just enter what we have and return without generating a note.
		if ( empty( $record_date ) ) {
			update_option( self::RECORD_DATE_OPTION_KEY, $yesterday );
			update_option( self::RECORD_AMOUNT_OPTION_KEY, $total );
				return;
		}

		// Otherwise, if yesterdays total bested the record, update AND generate a note.
		if ( $total > $record_amt ) {
			update_option( self::RECORD_DATE_OPTION_KEY, $yesterday );
			update_option( self::RECORD_AMOUNT_OPTION_KEY, $total );

			$formatted_yesterday   = gmdate( 'F jS', strtotime( $yesterday ) );
			$formatted_total       = html_entity_decode( wp_strip_all_tags( wc_price( $total ) ) );
			$formatted_record_date = gmdate( 'F jS', strtotime( $record_date ) );
			$formatted_record_amt  = html_entity_decode( wp_strip_all_tags( wc_price( $record_amt ) ) );

			$content = sprintf(
				/* translators: 1 and 4: Date (e.g. October 16th), 2 and 3: Amount (e.g. $160.00) */
				__( 'Woohoo, %1$s was your record day for sales! Net sales was %2$s beating the previous record of %3$s set on %4$s.', 'woocommerce' ),
				$formatted_yesterday,
				$formatted_total,
				$formatted_record_amt,
				$formatted_record_date
			);

			$content_data = (object) array(
				'old_record_date' => $record_date,
				'old_record_amt'  => $record_amt,
				'new_record_date' => $yesterday,
				'new_record_amt'  => $total,
			);

			// We only want one sales record note at any time in the inbox, so we delete any other first.
			Notes::delete_notes_with_name( self::NOTE_NAME );

			$report_url = '?page=wc-admin&path=/analytics/revenue&period=custom&compare=previous_year&after=' . $yesterday . '&before=' . $yesterday;

			// And now, create our new note.
			$note = new Note();
			$note->set_title( __( 'New sales record!', 'woocommerce' ) );
			$note->set_content( $content );
			$note->set_content_data( $content_data );
			$note->set_type( Note::E_WC_ADMIN_NOTE_INFORMATIONAL );
			$note->set_name( self::NOTE_NAME );
			$note->set_source( 'woocommerce-admin' );
			$note->add_action( 'view-report', __( 'View report', 'woocommerce' ), $report_url );
			$note->save();
		}
	}
}
woocommerce-admin/src/Notes/TestCheckout.php000064400000005155151335517650015167 0ustar00<?php
/**
 * WooCommerce Admin Test Checkout.
 *
 * Adds a note to remind the user to test their store checkout.
 *
 * @package WooCommerce\Admin
 */

namespace Automattic\WooCommerce\Admin\Notes;

defined( 'ABSPATH' ) || exit;

/**
 * Test_Checkout
 */
class TestCheckout {
	/**
	 * Note traits.
	 */
	use NoteTraits;

	/**
	 * Name of the note for use in the database.
	 */
	const NOTE_NAME = 'wc-admin-test-checkout';

	/**
	 * Completed tasks option name.
	 */
	const TASK_LIST_TRACKED_TASKS = 'woocommerce_task_list_tracked_completed_tasks';

	/**
	 * Constructor.
	 */
	public function __construct() {
		add_action( 'update_option_' . self::TASK_LIST_TRACKED_TASKS, array( $this, 'possibly_add_note' ) );
	}

	/**
	 * Get the note.
	 *
	 * @return Note|null
	 */
	public static function get_note() {
		$onboarding_profile = get_option( 'woocommerce_onboarding_profile', array() );

		// Confirm that $onboarding_profile is set.
		if ( empty( $onboarding_profile ) ) {
			return;
		}

		// Make sure that the person who filled out the OBW was not setting up
		// the store for their customer/client.
		if (
			! isset( $onboarding_profile['setup_client'] ) ||
			$onboarding_profile['setup_client']
		) {
			return;
		}

		// Make sure payments task was completed.
		$completed_tasks = get_option( self::TASK_LIST_TRACKED_TASKS, array() );
		if ( ! in_array( 'payments', $completed_tasks, true ) ) {
			return;
		}

		// Make sure that products were added within the previous 1/2 hour.
		$query = new \WC_Product_Query(
			array(
				'limit'   => 1,
				'status'  => 'publish',
				'orderby' => 'date',
				'order'   => 'ASC',
			)
		);

		$products = $query->get_products();
		if ( 0 === count( $products ) ) {
			return;
		}

		$oldest_product_timestamp = $products[0]->get_date_created()->getTimestamp();
		$half_hour_in_seconds     = 30 * MINUTE_IN_SECONDS;
		if ( ( time() - $oldest_product_timestamp ) > $half_hour_in_seconds ) {
			return;
		}

		$content = __( 'Make sure that your checkout is working properly before you launch your store. Go through your checkout process in its entirety: from adding a product to your cart, choosing a shipping location, and making a payment.', 'woocommerce' );

		$note = new Note();
		$note->set_title( __( 'Don\'t forget to test your checkout', 'woocommerce' ) );
		$note->set_content( $content );
		$note->set_content_data( (object) array() );
		$note->set_type( Note::E_WC_ADMIN_NOTE_INFORMATIONAL );
		$note->set_name( self::NOTE_NAME );
		$note->set_source( 'woocommerce-admin' );
		$note->add_action( 'test-checkout', __( 'Test checkout', 'woocommerce' ), wc_get_page_permalink( 'shop' ) );
		return $note;
	}
}
woocommerce-admin/src/Notes/OnboardingPayments.php000064400000003212151335517650016355 0ustar00<?php
/**
 * WooCommerce Admin: Payments reminder note.
 *
 * Adds a notes to complete the payment methods.
 */

namespace Automattic\WooCommerce\Admin\Notes;

defined( 'ABSPATH' ) || exit;

/**
 * Onboarding_Payments.
 */
class OnboardingPayments {
	/**
	 * Note traits.
	 */
	use NoteTraits;

	/**
	 * Name of the note for use in the database.
	 */
	const NOTE_NAME = 'wc-admin-onboarding-payments-reminder';

	/**
	 * Get the note.
	 *
	 * @return Note
	 */
	public static function get_note() {
		// We want to show the note after five days.
		if ( ! self::is_wc_admin_active_in_date_range( 'week-1-4', 5 * DAY_IN_SECONDS ) ) {
			return;
		}

		// Check to see if any gateways have been added.
		$gateways         = WC()->payment_gateways->get_available_payment_gateways();
		$enabled_gateways = array_filter(
			$gateways,
			function( $gateway ) {
				return 'yes' === $gateway->enabled;
			}
		);
		if ( ! empty( $enabled_gateways ) ) {
			return;
		}

		$note = new Note();
		$note->set_title( __( 'Start accepting payments on your store!', 'woocommerce' ) );
		$note->set_content( __( 'Take payments with the provider that’s right for you - choose from 100+ payment gateways for WooCommerce.', 'woocommerce' ) );
		$note->set_type( Note::E_WC_ADMIN_NOTE_INFORMATIONAL );
		$note->set_name( self::NOTE_NAME );
		$note->set_content_data( (object) array() );
		$note->set_source( 'woocommerce-admin' );
		$note->add_action(
			'view-payment-gateways',
			__( 'Learn more', 'woocommerce' ),
			'https://woocommerce.com/product-category/woocommerce-extensions/payment-gateways/?utm_medium=product',
			Note::E_WC_ADMIN_NOTE_ACTIONED,
			true
		);
		return $note;
	}
}
woocommerce-admin/src/Notes/FirstDownlaodableProduct.php000064400000003162151335517650017522 0ustar00<?php
/**
 * WooCommerce Admin Digital/Downloadable Producdt Handling note provider
 *
 * Adds a note with a link to the downlaodable product handling
 */

namespace Automattic\WooCommerce\Admin\Notes;

defined( 'ABSPATH' ) || exit;

/**
 * FirstDownlaodableProduct.
 */
class FirstDownlaodableProduct {
	/**
	 * Note traits.
	 */
	use NoteTraits;

	/**
	 * Name of the note for use in the database.
	 */
	const NOTE_NAME = 'wc-admin-first-downloadable-product';

	/**
	 * Get the note.
	 *
	 * @return Note
	 */
	public static function get_note() {
		$query    = new \WC_Product_Query(
			array(
				'limit'        => 1,
				'paginate'     => true,
				'return'       => 'ids',
				'downloadable' => 1,
				'status'       => array( 'publish' ),
			)
		);
		$products = $query->get_products();

		// There must be at least 1 downloadable product.
		if ( 0 === $products->total ) {
			return;
		}

		$note = new Note();
		$note->set_title( __( 'Learn more about digital/downloadable products', 'woocommerce' ) );
		$note->set_content(
			__(
				'Congrats on adding your first digital product! You can learn more about how to handle digital or downloadable products in our documentation.',
				'woocommerce'
			)
		);
		$note->set_type( Note::E_WC_ADMIN_NOTE_INFORMATIONAL );
		$note->set_name( self::NOTE_NAME );
		$note->set_content_data( (object) array() );
		$note->set_source( 'woocommerce-admin' );
		$note->add_action(
			'first-downloadable-product-handling',
			__( 'Learn more', 'woocommerce' ),
			'https://docs.woocommerce.com/document/digital-downloadable-product-handling/?utm_source=inbox&utm_medium=product'
		);

		return $note;
	}
}
woocommerce-admin/src/Notes/GettingStartedInEcommerceWebinar.php000064400000003462151335517650021130 0ustar00<?php
/**
 * WooCommerce Admin: Getting started in ecommerce, watch a webinar.
 *
 * Adds a note to remind the client they can watch a webinar to get started
 * with WooCommerce.
 */

namespace Automattic\WooCommerce\Admin\Notes;

defined( 'ABSPATH' ) || exit;

/**
 * Getting started in ecommmerce note class.
 */
class GettingStartedInEcommerceWebinar {
	/**
	 * Note traits.
	 */
	use NoteTraits;

	/**
	 * Onboarding traits.
	 */
	use OnboardingTraits;

	/**
	 * Name of the note for use in the database.
	 */
	const NOTE_NAME = 'wc-admin-getting-started-ecommerce-webinar';

	/**
	 * Get the note.
	 *
	 * @return Note
	 */
	public static function get_note() {

		if ( ! self::onboarding_profile_started() ) {
			return;
		}

		if ( self::store_setup_for_client() ) {
			return;
		}

		if ( ! self::revenue_is_within( 0, 2500 ) ) {
			return;
		}

		// Don't show if there are products.
		$query    = new \WC_Product_Query(
			array(
				'limit'    => 1,
				'paginate' => true,
				'return'   => 'ids',
				'status'   => array( 'publish' ),
			)
		);
		$products = $query->get_products();
		$count    = $products->total;

		if ( 0 !== $count ) {
			return;
		}

		$note = new Note();
		$note->set_title( __( 'Getting Started in eCommerce - webinar', 'woocommerce' ) );
		$note->set_content( __( 'We want to make eCommerce and this process of getting started as easy as possible for you. Watch this webinar to get tips on how to have our store up and running in a breeze.', 'woocommerce' ) );
		$note->set_type( Note::E_WC_ADMIN_NOTE_INFORMATIONAL );
		$note->set_name( self::NOTE_NAME );
		$note->set_content_data( (object) array() );
		$note->set_source( 'woocommerce-admin' );
		$note->add_action(
			'getting-started-webinar',
			__( 'Watch the webinar', 'woocommerce' ),
			'https://youtu.be/V_2XtCOyZ7o'
		);

		return $note;
	}
}
woocommerce-admin/src/Notes/InstallJPAndWCSPlugins.php000064400000007431151335517650016763 0ustar00<?php
/**
 * WooCommerce Admin Add Install Jetpack and WooCommerce Shipping & Tax Plugin Note Provider.
 *
 * Adds a note to the merchant's inbox prompting them to install the Jetpack
 * and WooCommerce Shipping & Tax plugins after it fails to install during
 * WooCommerce setup.
 */

namespace Automattic\WooCommerce\Admin\Notes;

defined( 'ABSPATH' ) || exit;

use \Automattic\WooCommerce\Admin\PluginsHelper;

/**
 * Install_JP_And_WCS_Plugins
 */
class InstallJPAndWCSPlugins {
	/**
	 * Note traits.
	 */
	use NoteTraits;

	/**
	 * Name of the note for use in the database.
	 */
	const NOTE_NAME = 'wc-admin-install-jp-and-wcs-plugins';

	/**
	 * Constructor.
	 */
	public function __construct() {
		add_action( 'woocommerce_note_action_install-jp-and-wcs-plugins', array( $this, 'install_jp_and_wcs_plugins' ) );
		add_action( 'activated_plugin', array( $this, 'action_note' ) );
	}

	/**
	 * Get the note.
	 *
	 * @return Note
	 */
	public static function get_note() {
		$content = __( 'We noticed that there was a problem during the Jetpack and WooCommerce Shipping & Tax install. Please try again and enjoy all the advantages of having the plugins connected to your store! Sorry for the inconvenience. The "Jetpack" and "WooCommerce Shipping & Tax" plugins will be installed & activated for free.', 'woocommerce' );

		$note = new Note();
		$note->set_title( __( 'Uh oh... There was a problem during the Jetpack and WooCommerce Shipping & Tax install. Please try again.', 'woocommerce' ) );
		$note->set_content( $content );
		$note->set_content_data( (object) array() );
		$note->set_type( Note::E_WC_ADMIN_NOTE_INFORMATIONAL );
		$note->set_name( self::NOTE_NAME );
		$note->set_source( 'woocommerce-admin' );
		$note->add_action(
			'install-jp-and-wcs-plugins',
			__( 'Install plugins', 'woocommerce' ),
			false,
			Note::E_WC_ADMIN_NOTE_ACTIONED,
			true
		);
		return $note;
	}

	/**
	 * Action the Install Jetpack and WooCommerce Shipping & Tax note, if any exists,
	 * and as long as both the Jetpack and WooCommerce Shipping & Tax plugins have been
	 * activated.
	 */
	public static function action_note() {
		// Make sure that both plugins are active before actioning the note.
		$active_plugin_slugs = PluginsHelper::get_active_plugin_slugs();
		$jp_active           = in_array( 'jetpack', $active_plugin_slugs, true );
		$wcs_active          = in_array( 'woocommerce-services', $active_plugin_slugs, true );

		if ( ! $jp_active || ! $wcs_active ) {
			return;
		}

		// Action any notes with a matching name.
		$data_store = Notes::load_data_store();
		$note_ids   = $data_store->get_notes_with_name( self::NOTE_NAME );

		foreach ( $note_ids as $note_id ) {
			$note = Notes::get_note( $note_id );

			if ( $note ) {
				$note->set_status( Note::E_WC_ADMIN_NOTE_ACTIONED );
				$note->save();
			}
		}
	}

	/**
	 * Install the Jetpack and WooCommerce Shipping & Tax plugins in response to the action
	 * being clicked in the admin note.
	 *
	 * @param Note $note The note being actioned.
	 */
	public function install_jp_and_wcs_plugins( $note ) {
		if ( self::NOTE_NAME !== $note->get_name() ) {
			return;
		}

		$this->install_and_activate_plugin( 'jetpack' );
		$this->install_and_activate_plugin( 'woocommerce-services' );
	}

	/**
	 * Installs and activates the specified plugin.
	 *
	 * @param string $plugin The plugin slug.
	 */
	private function install_and_activate_plugin( $plugin ) {
		$install_request = array( 'plugin' => $plugin );
		$installer       = new \Automattic\WooCommerce\Admin\API\OnboardingPlugins();
		$result          = $installer->install_plugin( $install_request );

		// @todo Use the error statuses to decide whether or not to action the note.
		if ( is_wp_error( $result ) ) {
			return;
		}

		$activate_request = array( 'plugins' => $plugin );

		$installer->activate_plugins( $activate_request );
	}
}
woocommerce-admin/src/Notes/DataStore.php000064400000033334151335517650014450 0ustar00<?php
/**
 * WC Admin Note Data_Store class file.
 */

namespace Automattic\WooCommerce\Admin\Notes;

defined( 'ABSPATH' ) || exit;

/**
 * WC Admin Note Data Store (Custom Tables)
 */
class DataStore extends \WC_Data_Store_WP implements \WC_Object_Data_Store_Interface {
	/**
	 * Method to create a new note in the database.
	 *
	 * @param Note $note Admin note.
	 */
	public function create( &$note ) {
		$date_created = time();
		$note->set_date_created( $date_created );

		global $wpdb;

		$note_to_be_inserted = array(
			'name'         => $note->get_name(),
			'type'         => $note->get_type(),
			'locale'       => $note->get_locale(),
			'title'        => $note->get_title(),
			'content'      => $note->get_content(),
			'status'       => $note->get_status(),
			'source'       => $note->get_source(),
			'is_snoozable' => (int) $note->get_is_snoozable(),
			'layout'       => $note->get_layout(),
			'image'        => $note->get_image(),
			'is_deleted'   => (int) $note->get_is_deleted(),
		);

		$note_to_be_inserted['content_data']  = wp_json_encode( $note->get_content_data() );
		$note_to_be_inserted['date_created']  = gmdate( 'Y-m-d H:i:s', $date_created );
		$note_to_be_inserted['date_reminder'] = null;

		$wpdb->insert( $wpdb->prefix . 'wc_admin_notes', $note_to_be_inserted );
		$note_id = $wpdb->insert_id;
		$note->set_id( $note_id );
		$note->save_meta_data();
		$this->save_actions( $note );
		$note->apply_changes();

		/**
		 * Fires when an admin note is created.
		 *
		 * @param int $note_id Note ID.
		 */
		do_action( 'woocommerce_note_created', $note_id );
	}

	/**
	 * Method to read a note.
	 *
	 * @param Note $note Admin note.
	 * @throws \Exception Throws exception when invalid data is found.
	 */
	public function read( &$note ) {
		global $wpdb;

		$note->set_defaults();
		$note_row = false;

		$note_id = $note->get_id();
		if ( 0 !== $note_id || '0' !== $note_id ) {
			$note_row = $wpdb->get_row(
				$wpdb->prepare(
					"SELECT * FROM {$wpdb->prefix}wc_admin_notes WHERE note_id = %d LIMIT 1",
					$note->get_id()
				)
			);
		}

		if ( 0 === $note->get_id() || '0' === $note->get_id() ) {
			$this->read_actions( $note );
			$note->read_meta_data();
			$note->set_object_read( true );

			/**
			 * Fires when an admin note is loaded.
			 *
			 * @param int $note_id Note ID.
			 */
			do_action( 'woocommerce_note_loaded', $note );
		} elseif ( $note_row ) {
			$note->set_name( $note_row->name );
			$note->set_type( $note_row->type );
			$note->set_locale( $note_row->locale );
			$note->set_title( $note_row->title );
			$note->set_content( $note_row->content );

			// The default for 'content_value' used to be an array, so there might be rows with invalid data!
			$content_data = json_decode( $note_row->content_data );
			if ( ! $content_data ) {
				$content_data = new \stdClass();
			} elseif ( is_array( $content_data ) ) {
				$content_data = (object) $content_data;
			}
			$note->set_content_data( $content_data );

			$note->set_status( $note_row->status );
			$note->set_source( $note_row->source );
			$note->set_date_created( $note_row->date_created );
			$note->set_date_reminder( $note_row->date_reminder );
			$note->set_is_snoozable( $note_row->is_snoozable );
			$note->set_is_deleted( (bool) $note_row->is_deleted );
			$note->set_layout( $note_row->layout );
			$note->set_image( $note_row->image );
			$this->read_actions( $note );
			$note->read_meta_data();
			$note->set_object_read( true );

			/**
			 * Fires when an admin note is loaded.
			 *
			 * @param int $note_id Note ID.
			 */
			do_action( 'woocommerce_note_loaded', $note );
		} else {
			throw new \Exception( __( 'Invalid admin note', 'woocommerce' ) );
		}
	}

	/**
	 * Updates a note in the database.
	 *
	 * @param Note $note Admin note.
	 */
	public function update( &$note ) {
		global $wpdb;

		if ( $note->get_id() ) {
			$date_created           = $note->get_date_created();
			$date_created_timestamp = $date_created->getTimestamp();
			$date_created_to_db     = gmdate( 'Y-m-d H:i:s', $date_created_timestamp );

			$date_reminder = $note->get_date_reminder();
			if ( is_null( $date_reminder ) ) {
				$date_reminder_to_db = null;
			} else {
				$date_reminder_timestamp = $date_reminder->getTimestamp();
				$date_reminder_to_db     = gmdate( 'Y-m-d H:i:s', $date_reminder_timestamp );
			}

			$wpdb->update(
				$wpdb->prefix . 'wc_admin_notes',
				array(
					'name'          => $note->get_name(),
					'type'          => $note->get_type(),
					'locale'        => $note->get_locale(),
					'title'         => $note->get_title(),
					'content'       => $note->get_content(),
					'content_data'  => wp_json_encode( $note->get_content_data() ),
					'status'        => $note->get_status(),
					'source'        => $note->get_source(),
					'date_created'  => $date_created_to_db,
					'date_reminder' => $date_reminder_to_db,
					'is_snoozable'  => $note->get_is_snoozable(),
					'layout'        => $note->get_layout(),
					'image'         => $note->get_image(),
					'is_deleted'    => $note->get_is_deleted(),
				),
				array( 'note_id' => $note->get_id() )
			);
		}

		$note->save_meta_data();
		$this->save_actions( $note );
		$note->apply_changes();

		/**
		 * Fires when an admin note is updated.
		 *
		 * @param int $note_id Note ID.
		 */
		do_action( 'woocommerce_note_updated', $note->get_id() );
	}

	/**
	 * Deletes a note from the database.
	 *
	 * @param Note  $note Admin note.
	 * @param array $args Array of args to pass to the delete method (not used).
	 */
	public function delete( &$note, $args = array() ) {
		$note_id = $note->get_id();
		if ( $note_id ) {
			global $wpdb;
			$wpdb->delete( $wpdb->prefix . 'wc_admin_notes', array( 'note_id' => $note_id ) );
			$wpdb->delete( $wpdb->prefix . 'wc_admin_note_actions', array( 'note_id' => $note_id ) );
			$note->set_id( null );
		}

		/**
		 * Fires when an admin note is deleted.
		 *
		 * @param int $note_id Note ID.
		 */
		do_action( 'woocommerce_note_deleted', $note_id );
	}

	/**
	 * Read actions from the database.
	 *
	 * @param Note $note Admin note.
	 */
	private function read_actions( &$note ) {
		global $wpdb;

		$db_actions = $wpdb->get_results(
			$wpdb->prepare(
				"SELECT action_id, name, label, query, status, is_primary, actioned_text, nonce_action, nonce_name
				FROM {$wpdb->prefix}wc_admin_note_actions
				WHERE note_id = %d",
				$note->get_id()
			)
		);

		$note_actions = array();

		if ( $db_actions ) {
			foreach ( $db_actions as $action ) {
				$note_actions[] = (object) array(
					'id'            => (int) $action->action_id,
					'name'          => $action->name,
					'label'         => $action->label,
					'query'         => $action->query,
					'status'        => $action->status,
					'primary'       => (bool) $action->is_primary,
					'actioned_text' => $action->actioned_text,
					'nonce_action'  => $action->nonce_action,
					'nonce_name'    => $action->nonce_name,
				);
			}
		}

		$note->set_actions( $note_actions );
	}

	/**
	 * Save actions to the database.
	 * This function clears old actions, then re-inserts new if any changes are found.
	 *
	 * @param Note $note Note object.
	 *
	 * @return bool|void
	 */
	private function save_actions( &$note ) {
		global $wpdb;

		$changed_props = array_keys( $note->get_changes() );

		if ( ! in_array( 'actions', $changed_props, true ) ) {
			return false;
		}

		// Process action removal. Actions are removed from
		// the note if they aren't part of the changeset.
		// See Note::add_action().
		$changed_actions = $note->get_actions( 'edit' );
		$actions_to_keep = array();

		foreach ( $changed_actions as $action ) {
			if ( ! empty( $action->id ) ) {
				$actions_to_keep[] = (int) $action->id;
			}
		}

		$clear_actions_query = $wpdb->prepare(
			"DELETE FROM {$wpdb->prefix}wc_admin_note_actions WHERE note_id = %d",
			$note->get_id()
		);

		if ( $actions_to_keep ) {
			$clear_actions_query .= sprintf( ' AND action_id NOT IN (%s)', implode( ',', $actions_to_keep ) );
		}

		$wpdb->query( $clear_actions_query ); // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared

		// Update/insert the actions in this changeset.
		foreach ( $changed_actions as $action ) {
			$action_data = array(
				'note_id'       => $note->get_id(),
				'name'          => $action->name,
				'label'         => $action->label,
				'query'         => $action->query,
				'status'        => $action->status,
				'is_primary'    => $action->primary,
				'actioned_text' => $action->actioned_text,
				'nonce_action'  => $action->nonce_action,
				'nonce_name'    => $action->nonce_name,
			);

			$data_format = array(
				'%d',
				'%s',
				'%s',
				'%s',
				'%s',
				'%d',
				'%s',
				'%s',
				'%s',
			);

			if ( ! empty( $action->id ) ) {
				$action_data['action_id'] = $action->id;
				$data_format[]            = '%d';
			}

			$wpdb->replace(
				$wpdb->prefix . 'wc_admin_note_actions',
				$action_data,
				$data_format
			);
		}

		// Update actions from DB (to grab new IDs).
		$this->read_actions( $note );
	}

	/**
	 * Return an ordered list of notes.
	 *
	 * @param array $args Query arguments.
	 * @return array An array of objects containing a note id.
	 */
	public function get_notes( $args = array() ) {
		global $wpdb;

		$defaults = array(
			'per_page' => get_option( 'posts_per_page' ),
			'page'     => 1,
			'order'    => 'DESC',
			'orderby'  => 'date_created',
		);
		$args     = wp_parse_args( $args, $defaults );

		$offset        = $args['per_page'] * ( $args['page'] - 1 );
		$where_clauses = $this->get_notes_where_clauses( $args );

		$query = $wpdb->prepare(
			// phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared, WordPress.DB.PreparedSQL.InterpolatedNotPrepared
			"SELECT * FROM {$wpdb->prefix}wc_admin_notes WHERE 1=1{$where_clauses} ORDER BY {$args['orderby']} {$args['order']} LIMIT %d, %d",
			$offset,
			$args['per_page']
		);

		return $wpdb->get_results( $query ); // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared
	}

	/**
	 * Return a count of notes.
	 *
	 * @param string $type Comma separated list of note types.
	 * @param string $status Comma separated list of statuses.
	 * @return array An array of objects containing a note id.
	 */
	public function get_notes_count( $type = array(), $status = array() ) {
		global $wpdb;

		$where_clauses = $this->get_notes_where_clauses(
			array(
				'type'   => $type,
				'status' => $status,
			)
		);

		if ( ! empty( $where_clauses ) ) {
			// phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared, WordPress.DB.PreparedSQL.InterpolatedNotPrepared
			return $wpdb->get_var( "SELECT COUNT(*) FROM {$wpdb->prefix}wc_admin_notes WHERE 1=1{$where_clauses}" );
		}

		return $wpdb->get_var( "SELECT COUNT(*) FROM {$wpdb->prefix}wc_admin_notes" );
	}

	/**
	 * Parses the query arguments passed in as arrays and escapes the values.
	 *
	 * @param array      $args the query arguments.
	 * @param string     $key the key of the specific argument.
	 * @param array|null $allowed_types optional allowed_types if only a specific set is allowed.
	 * @return array the escaped array of argument values.
	 */
	private function get_escaped_arguments_array_by_key( $args = array(), $key = '', $allowed_types = null ) {
		$arg_array = array();
		if ( isset( $args[ $key ] ) ) {
			foreach ( $args[ $key ] as $args_type ) {
				$args_type = trim( $args_type );
				$allowed   = is_null( $allowed_types ) || in_array( $args_type, $allowed_types, true );
				if ( $allowed ) {
					$arg_array[] = sprintf( "'%s'", esc_sql( $args_type ) );
				}
			}
		}
		return $arg_array;
	}

	/**
	 * Return where clauses for getting notes by status and type. For use in both the count and listing queries.
	 *
	 *  @param array $args Array of args to pass.
	 * @return string Where clauses for the query.
	 */
	public function get_notes_where_clauses( $args = array() ) {
		$allowed_types    = Note::get_allowed_types();
		$where_type_array = $this->get_escaped_arguments_array_by_key( $args, 'type', $allowed_types );

		$allowed_statuses   = Note::get_allowed_statuses();
		$where_status_array = $this->get_escaped_arguments_array_by_key( $args, 'status', $allowed_statuses );

		$escaped_is_deleted = '';
		if ( isset( $args['is_deleted'] ) ) {
			$escaped_is_deleted = esc_sql( $args['is_deleted'] );
		}

		$where_name_array   = $this->get_escaped_arguments_array_by_key( $args, 'name' );
		$where_source_array = $this->get_escaped_arguments_array_by_key( $args, 'source' );

		$escaped_where_types  = implode( ',', $where_type_array );
		$escaped_where_status = implode( ',', $where_status_array );
		$escaped_where_names  = implode( ',', $where_name_array );
		$escaped_where_source = implode( ',', $where_source_array );
		$where_clauses        = '';

		if ( ! empty( $escaped_where_types ) ) {
			$where_clauses .= " AND type IN ($escaped_where_types)";
		}

		if ( ! empty( $escaped_where_status ) ) {
			$where_clauses .= " AND status IN ($escaped_where_status)";
		}

		if ( ! empty( $escaped_where_names ) ) {
			$where_clauses .= " AND name IN ($escaped_where_names)";
		}

		if ( ! empty( $escaped_where_source ) ) {
			$where_clauses .= " AND source IN ($escaped_where_source)";
		}

		$where_clauses .= $escaped_is_deleted ? ' AND is_deleted = 1' : ' AND is_deleted = 0';

		/**
		 * Filter the notes WHERE clause before retrieving the data.
		 *
		 * Allows modification of the notes select criterial.
		 *
		 * @param string $where_clauses The generated WHERE clause.
		 * @param array  $args          The original arguments for the request.
		 */
		return apply_filters( 'woocommerce_note_where_clauses', $where_clauses, $args );
	}

	/**
	 * Find all the notes with a given name.
	 *
	 * @param string $name Name to search for.
	 * @return array An array of matching note ids.
	 */
	public function get_notes_with_name( $name ) {
		global $wpdb;
		return $wpdb->get_col(
			$wpdb->prepare(
				"SELECT note_id FROM {$wpdb->prefix}wc_admin_notes WHERE name = %s ORDER BY note_id ASC",
				$name
			)
		);
	}
}
woocommerce-admin/src/Notes/ManageStoreActivityFromHomeScreen.php000064400000003351151335517650021275 0ustar00<?php
/**
 * New! Manage your store activity from the Home screen.
 */

namespace Automattic\WooCommerce\Admin\Notes;

defined( 'ABSPATH' ) || exit;

/**
 * New! Manage your store activity from the Home screen.
 */
class ManageStoreActivityFromHomeScreen {
	/**
	 * Note traits.
	 */
	use NoteTraits;

	/**
	 * Name of the note for use in the database.
	 */
	const NOTE_NAME = 'wc-admin-manage-store-activity-from-home-screen';

	/**
	 * Attach hooks.
	 */
	public function __construct() {
		add_action(
			'woocommerce_admin_updated_existing',
			array( $this, 'possibly_add_note' )
		);
	}

	/**
	 * Get the note.
	 *
	 * @return Note|null
	 */
	public static function get_note() {
		$installed_version = get_option( 'woocommerce_admin_version' );
		// the value can be in 1.9.0-rc.3 format for RC or BETA releases
		// get the version without -rc.3.
		$version_segments  = explode( '-', $installed_version );
		$installed_version = $version_segments[0];
		if ( ! version_compare( $installed_version, '1.9.0', '=' ) ) {
			return;
		}

		$note = new Note();

		$note->set_title( __( 'New! Manage your store activity from the Home screen', 'woocommerce' ) );
		$note->set_content( __( 'Start your day knowing the next steps you need to take with your orders, products, and customer feedback.<br/><br/>Read more about how to use the activity panels on the Home screen.', 'woocommerce' ) );
		$note->set_type( Note::E_WC_ADMIN_NOTE_INFORMATIONAL );
		$note->set_name( self::NOTE_NAME );
		$note->set_source( 'woocommerce-admin' );
		$note->add_action(
			'learn-more',
			__( 'Learn more', 'woocommerce' ),
			'https://docs.woocommerce.com/document/home-screen/?utm_source=inbox&utm_medium=product',
			Note::E_WC_ADMIN_NOTE_ACTIONED,
			true
		);

		return $note;
	}
}
woocommerce-admin/src/Notes/PersonalizeStore.php000064400000003502151335517650016064 0ustar00<?php
/**
 * WooCommerce Admin Personalize Your Store Note Provider.
 *
 * Adds a note to the merchant's inbox prompting them to personalize their store.
 */

namespace Automattic\WooCommerce\Admin\Notes;

defined( 'ABSPATH' ) || exit;

/**
 * Personalize_Store
 */
class PersonalizeStore {
	/**
	 * Note traits.
	 */
	use NoteTraits;

	/**
	 * Name of the note for use in the database.
	 */
	const NOTE_NAME = 'wc-admin-personalize-store';

	/**
	 * Get the note.
	 *
	 * @return Note
	 */
	public static function get_note() {
		// Only show the note to stores with homepage.
		$homepage_id = get_option( 'woocommerce_onboarding_homepage_post_id', false );
		if ( ! $homepage_id ) {
			return;
		}

		// Show the note after task list is done.
		$is_task_list_complete = get_option( 'woocommerce_task_list_complete', false );

		// We want to show the note after day 5.
		$five_days_in_seconds = 5 * DAY_IN_SECONDS;

		if ( ! self::is_wc_admin_active_in_date_range( 'week-1-4', $five_days_in_seconds ) && ! $is_task_list_complete ) {
			return;
		}

		$content = __( 'The homepage is one of the most important entry points in your store. When done right it can lead to higher conversions and engagement. Don\'t forget to personalize the homepage that we created for your store during the onboarding.', 'woocommerce' );

		$note = new Note();
		$note->set_title( __( 'Personalize your store\'s homepage', 'woocommerce' ) );
		$note->set_content( $content );
		$note->set_content_data( (object) array() );
		$note->set_type( Note::E_WC_ADMIN_NOTE_INFORMATIONAL );
		$note->set_name( self::NOTE_NAME );
		$note->set_source( 'woocommerce-admin' );
		$note->add_action( 'personalize-homepage', __( 'Personalize homepage', 'woocommerce' ), admin_url( 'post.php?post=' . $homepage_id . '&action=edit' ), Note::E_WC_ADMIN_NOTE_ACTIONED, true );
		return $note;
	}
}
woocommerce-admin/src/Notes/Marketing.php000064400000002425151335517650014500 0ustar00<?php
/**
 * WooCommerce Admin Marketing Note Provider.
 *
 * Adds notes to the merchant's inbox concerning the marketing dashboard.
 */

namespace Automattic\WooCommerce\Admin\Notes;

defined( 'ABSPATH' ) || exit;

/**
 * Marketing
 */
class Marketing {

	/**
	 * Note traits.
	 */
	use NoteTraits;

	/**
	 * Name of the note for use in the database.
	 */
	const NOTE_NAME = 'wc-admin-marketing-intro';

	/**
	 * Get the note.
	 *
	 * @return Note
	 */
	public static function get_note() {
		// Don't show the note unless the store has been active at least 5 days.
		if ( ! self::is_wc_admin_active_in_date_range( 'week-1-4', 5 * DAY_IN_SECONDS ) ) {
			return;
		}

		$note = new Note();
		$note->set_title( __( 'Connect with your audience', 'woocommerce' ) );
		$note->set_content( __( 'Grow your customer base and increase your sales with marketing tools built for WooCommerce.', 'woocommerce' ) );
		$note->set_type( Note::E_WC_ADMIN_NOTE_INFORMATIONAL );
		$note->set_name( self::NOTE_NAME );
		$note->set_content_data( (object) array() );
		$note->set_source( 'woocommerce-admin' );
		$note->add_action(
			'open-marketing-hub',
			__( 'Open marketing hub', 'woocommerce' ),
			admin_url( 'admin.php?page=wc-admin&path=/marketing' ),
			Note::E_WC_ADMIN_NOTE_ACTIONED
		);
		return $note;
	}
}
woocommerce-admin/src/Notes/NoteTraits.php000064400000006767151335517650014670 0ustar00<?php
/**
 * WC Admin Note Traits
 *
 * WC Admin Note Traits class that houses shared functionality across notes.
 */

namespace Automattic\WooCommerce\Admin\Notes;

use Automattic\WooCommerce\Admin\WCAdminHelper;

defined( 'ABSPATH' ) || exit;

/**
 * NoteTraits class.
 */
trait NoteTraits {
	/**
	 * Test how long WooCommerce Admin has been active.
	 *
	 * @param int $seconds Time in seconds to check.
	 * @return bool Whether or not WooCommerce admin has been active for $seconds.
	 */
	private static function wc_admin_active_for( $seconds ) {
		return WCAdminHelper::is_wc_admin_active_for( $seconds );
	}

	/**
	 * Test if WooCommerce Admin has been active within a pre-defined range.
	 *
	 * @param string $range range available in WC_ADMIN_STORE_AGE_RANGES.
	 * @param int    $custom_start custom start in range.
	 * @return bool Whether or not WooCommerce admin has been active within the range.
	 */
	private static function is_wc_admin_active_in_date_range( $range, $custom_start = null ) {
		return WCAdminHelper::is_wc_admin_active_in_date_range( $range, $custom_start );
	}

	/**
	 * Check if the note has been previously added.
	 *
	 * @throws NotesUnavailableException Throws exception when notes are unavailable.
	 */
	public static function note_exists() {
		$data_store = Notes::load_data_store();
		$note_ids   = $data_store->get_notes_with_name( self::NOTE_NAME );
		return ! empty( $note_ids );
	}

	/**
	 * Checks if a note can and should be added.
	 *
	 * @return bool
	 * @throws NotesUnavailableException Throws exception when notes are unavailable.
	 */
	public static function can_be_added() {
		$note = self::get_note();

		if ( ! $note instanceof Note && ! $note instanceof WC_Admin_Note ) {
			return;
		}

		if ( self::note_exists() ) {
			return false;
		}

		if (
			'no' === get_option( 'woocommerce_show_marketplace_suggestions', 'yes' ) &&
			Note::E_WC_ADMIN_NOTE_MARKETING === $note->get_type()
		) {
			return false;
		}

		return true;
	}

	/**
	 * Add the note if it passes predefined conditions.
	 *
	 * @throws NotesUnavailableException Throws exception when notes are unavailable.
	 */
	public static function possibly_add_note() {
		$note = self::get_note();

		if ( ! self::can_be_added() ) {
			return;
		}

		$note->save();
	}

	/**
	 * Alias this method for backwards compatibility.
	 *
	 * @throws NotesUnavailableException Throws exception when notes are unavailable.
	 */
	public static function add_note() {
		self::possibly_add_note();
	}

	/**
	 * Possibly delete the note, if it exists in the database. Note that this
	 * is a hard delete, for where it doesn't make sense to soft delete or
	 * action the note.
	 *
	 * @throws NotesUnavailableException Throws exception when notes are unavailable.
	 */
	public static function possibly_delete_note() {
		$data_store = Notes::load_data_store();
		$note_ids   = $data_store->get_notes_with_name( self::NOTE_NAME );

		foreach ( $note_ids as $note_id ) {
			$note = Notes::get_note( $note_id );

			if ( $note ) {
				$data_store->delete( $note );
			}
		}
	}

	/**
	 * Get if the note has been actioned.
	 *
	 * @return bool
	 * @throws NotesUnavailableException Throws exception when notes are unavailable.
	 */
	public static function has_note_been_actioned() {
		$data_store = Notes::load_data_store();
		$note_ids   = $data_store->get_notes_with_name( self::NOTE_NAME );

		if ( ! empty( $note_ids ) ) {
			$note = Notes::get_note( $note_ids[0] );

			if ( Note::E_WC_ADMIN_NOTE_ACTIONED === $note->get_status() ) {
				return true;
			}
		}

		return false;
	}
}
woocommerce-admin/src/Notes/GivingFeedbackNotes.php000064400000002623151335517650016420 0ustar00<?php
/**
 * WooCommerce Admin (Dashboard) Giving feedback notes provider
 *
 * Adds notes to the merchant's inbox about giving feedback.
 */

namespace Automattic\WooCommerce\Admin\Notes;

defined( 'ABSPATH' ) || exit;

use Automattic\WooCommerce\Admin\Survey;

/**
 * Giving_Feedback_Notes
 */
class GivingFeedbackNotes {
	/**
	 * Note traits.
	 */
	use NoteTraits;

	/**
	 * Name of the note for use in the database.
	 */
	const NOTE_NAME = 'wc-admin-store-notice-giving-feedback-2';

	/**
	 * Get the note.
	 *
	 * @return Note
	 */
	protected static function get_note() {
		if ( ! self::is_wc_admin_active_in_date_range( 'week-1-4' ) ) {
			return;
		}

		// Otherwise, create our new note.
		$note = new Note();
		$note->set_title( __( 'You\'re invited to share your experience', 'woocommerce' ) );
		$note->set_content( __( 'Now that you’ve chosen us as a partner, our goal is to make sure we\'re providing the right tools to meet your needs. We\'re looking forward to having your feedback on the store setup experience so we can improve it in the future.', 'woocommerce' ) );
		$note->set_content_data( (object) array() );
		$note->set_type( Note::E_WC_ADMIN_NOTE_INFORMATIONAL );
		$note->set_name( self::NOTE_NAME );
		$note->set_source( 'woocommerce-admin' );
		$note->add_action(
			'share-feedback',
			__( 'Share feedback', 'woocommerce' ),
			Survey::get_url( '/store-setup-survey' )
		);
		return $note;
	}
}
woocommerce-admin/src/Notes/FirstProduct.php000064400000004023151335517650015203 0ustar00<?php
/**
 * WooCommerce Admin: Do you need help with adding your first product?
 *
 * Adds a note to ask the client if they need help adding their first product.
 */

namespace Automattic\WooCommerce\Admin\Notes;

defined( 'ABSPATH' ) || exit;

/**
 * First_Product.
 */
class FirstProduct {
	/**
	 * Note traits.
	 */
	use NoteTraits;

	/**
	 * Name of the note for use in the database.
	 */
	const NOTE_NAME = 'wc-admin-first-product';

	/**
	 * Get the note.
	 *
	 * @return Note
	 */
	public static function get_note() {
		// We want to show the note after seven days.
		if ( ! self::is_wc_admin_active_in_date_range( 'week-1-4' ) ) {
			return;
		}

		$onboarding_profile = get_option( 'woocommerce_onboarding_profile', array() );

		// Confirm that $onboarding_profile is set.
		if ( empty( $onboarding_profile ) ) {
			return;
		}

		// Make sure that the person who filled out the OBW was not setting up
		// the store for their customer/client.
		if (
			! isset( $onboarding_profile['setup_client'] ) ||
			$onboarding_profile['setup_client']
		) {
			return;
		}

		// Don't show if there are products.
		$query    = new \WC_Product_Query(
			array(
				'limit'    => 1,
				'paginate' => true,
				'return'   => 'ids',
				'status'   => array( 'publish' ),
			)
		);
		$products = $query->get_products();
		$count    = $products->total;
		if ( 0 !== $count ) {
			return;
		}

		$note = new Note();
		$note->set_title( __( 'Do you need help with adding your first product?', 'woocommerce' ) );
		$note->set_content( __( 'This video tutorial will help you go through the process of adding your first product in WooCommerce.', 'woocommerce' ) );
		$note->set_type( Note::E_WC_ADMIN_NOTE_INFORMATIONAL );
		$note->set_name( self::NOTE_NAME );
		$note->set_content_data( (object) array() );
		$note->set_source( 'woocommerce-admin' );
		$note->add_action(
			'first-product-watch-tutorial',
			__( 'Watch tutorial', 'woocommerce' ),
			'https://www.youtube.com/watch?v=sFtXa00Jf_o&list=PLHdG8zvZd0E575Ia8Mu3w1h750YLXNfsC&index=24'
		);

		return $note;
	}
}
woocommerce-admin/src/Notes/ManageOrdersOnTheGo.php000064400000002677151335517650016363 0ustar00<?php
/**
 * WooCommerce Admin Manage orders on the go note.
 *
 * Adds a note to download the mobile app to manage orders on the go.
 */

namespace Automattic\WooCommerce\Admin\Notes;

defined( 'ABSPATH' ) || exit;

/**
 * Manage_Orders_On_The_Go
 */
class ManageOrdersOnTheGo {
	/**
	 * Note traits.
	 */
	use NoteTraits;

	/**
	 * Name of the note for use in the database.
	 */
	const NOTE_NAME = 'wc-admin-manage-orders-on-the-go';

	/**
	 * Get the note.
	 *
	 * @return Note|null
	 */
	public static function get_note() {
		// Only add this note if this store is at least 6 months old.
		if ( ! self::is_wc_admin_active_in_date_range( 'month-6+' ) ) {
			return;
		}

		// Check that the previous mobile app notes have not been actioned.
		if ( MobileApp::has_note_been_actioned() ) {
			return;
		}
		if ( RealTimeOrderAlerts::has_note_been_actioned() ) {
			return;
		}

		$note = new Note();

		$note->set_title( __( 'Manage your orders on the go', 'woocommerce' ) );
		$note->set_content( __( 'Look for orders, customer info, and process refunds in one click with the Woo app.', 'woocommerce' ) );
		$note->set_content_data( (object) array() );
		$note->set_type( Note::E_WC_ADMIN_NOTE_INFORMATIONAL );
		$note->set_name( self::NOTE_NAME );
		$note->set_source( 'woocommerce-admin' );
		$note->add_action(
			'learn-more',
			__( 'Learn more', 'woocommerce' ),
			'https://woocommerce.com/mobile/?utm_source=inbox&utm_medium=product'
		);

		return $note;
	}
}
woocommerce-admin/src/Notes/DeactivatePlugin.php000064400000004304151335517650016005 0ustar00<?php
/**
 * WooCommerce Admin: Update version reminder note.
 *
 * Creates a note to nudge users to use the newer version when two are installed.
 */

namespace Automattic\WooCommerce\Admin\Notes;

defined( 'ABSPATH' ) || exit;

/**
 * Deactivate_Plugin.
 */
class DeactivatePlugin {
	/**
	 * Note traits.
	 */
	use NoteTraits;

	/**
	 * Name of the note for use in the database.
	 */
	const NOTE_NAME = 'wc-admin-deactivate-plugin';

	/**
	 * Attach hooks.
	 */
	public function __construct() {
		add_action( 'init', array( $this, 'deactivate_feature_plugin' ) );
	}

	/**
	 * Get the note.
	 *
	 * @return Note
	 */
	public static function get_note() {
		$note = new Note();
		$note->set_title( __( 'Deactivate old WooCommerce Admin version', 'woocommerce' ) );
		$note->set_content( __( 'Your current version of WooCommerce Admin is outdated and a newer version is included with WooCommerce. We recommend deactivating the plugin and using the stable version included with WooCommerce.', 'woocommerce' ) );
		$note->set_type( Note::E_WC_ADMIN_NOTE_INFORMATIONAL );
		$note->set_name( self::NOTE_NAME );
		$note->set_content_data( (object) array() );
		$note->set_source( 'woocommerce-admin' );
		$note->add_action(
			'deactivate-feature-plugin',
			__( 'Deactivate', 'woocommerce' ),
			wc_admin_url( '&action=deactivate-feature-plugin' ),
			Note::E_WC_ADMIN_NOTE_UNACTIONED,
			true
		);
		return $note;
	}

	/**
	 * Delete the note if the version is higher than the included.
	 */
	public static function delete_note() {
		Notes::delete_notes_with_name( self::NOTE_NAME );
	}

	/**
	 * Deactivate feature plugin.
	 */
	public function deactivate_feature_plugin() {
		/* phpcs:disable WordPress.Security.NonceVerification */
		if (
			! isset( $_GET['page'] ) ||
			'wc-admin' !== $_GET['page'] ||
			! isset( $_GET['action'] ) ||
			'deactivate-feature-plugin' !== $_GET['action'] ||
			! defined( 'WC_ADMIN_PLUGIN_FILE' )
		) {
			return;
		}
		/* phpcs:enable */

		$deactivate_url = admin_url( 'plugins.php?action=deactivate&plugin=' . rawurlencode( WC_ADMIN_PLUGIN_FILE ) . '&plugin_status=all&paged=1&_wpnonce=' . wp_create_nonce( 'deactivate-plugin_' . WC_ADMIN_PLUGIN_FILE ) );
		wp_safe_redirect( $deactivate_url );
		exit;
	}
}
woocommerce-admin/src/Notes/DeprecatedNotes.php000064400000045045151335517650015635 0ustar00<?php
/**
 * Define deprecated classes to support changing the naming convention of
 * admin notes.
 */

namespace Automattic\WooCommerce\Admin\Notes;

defined( 'ABSPATH' ) || exit;

use Automattic\WooCommerce\Admin\DeprecatedClassFacade;

// phpcs:disable Generic.Files.OneObjectStructurePerFile.MultipleFound

/**
 * WC_Admin_Note.
 *
 * @deprecated since 1.7.0, use Note
 */
class WC_Admin_Note extends DeprecatedClassFacade {
	// These constants must be redeclared as to not break plugins that use them.
	const E_WC_ADMIN_NOTE_ERROR         = Note::E_WC_ADMIN_NOTE_ERROR;
	const E_WC_ADMIN_NOTE_WARNING       = Note::E_WC_ADMIN_NOTE_WARNING;
	const E_WC_ADMIN_NOTE_UPDATE        = Note::E_WC_ADMIN_NOTE_UPDATE;
	const E_WC_ADMIN_NOTE_INFORMATIONAL = Note::E_WC_ADMIN_NOTE_INFORMATIONAL;
	const E_WC_ADMIN_NOTE_MARKETING     = Note::E_WC_ADMIN_NOTE_MARKETING;
	const E_WC_ADMIN_NOTE_SURVEY        = Note::E_WC_ADMIN_NOTE_SURVEY;
	const E_WC_ADMIN_NOTE_PENDING       = Note::E_WC_ADMIN_NOTE_PENDING;
	const E_WC_ADMIN_NOTE_UNACTIONED    = Note::E_WC_ADMIN_NOTE_UNACTIONED;
	const E_WC_ADMIN_NOTE_ACTIONED      = Note::E_WC_ADMIN_NOTE_ACTIONED;
	const E_WC_ADMIN_NOTE_SNOOZED       = Note::E_WC_ADMIN_NOTE_SNOOZED;
	const E_WC_ADMIN_NOTE_EMAIL         = Note::E_WC_ADMIN_NOTE_EMAIL;

	/**
	 * The name of the non-deprecated class that this facade covers.
	 *
	 * @var string
	 */
	protected static $facade_over_classname = 'Automattic\WooCommerce\Admin\Notes\Note';

	/**
	 * The version that this class was deprecated in.
	 *
	 * @var string
	 */
	protected static $deprecated_in_version = '1.7.0';

	/**
	 * Note constructor. Loads note data.
	 *
	 * @param mixed $data Note data, object, or ID.
	 */
	public function __construct( $data = '' ) {
		$this->instance = new static::$facade_over_classname( $data );
	}
}

/**
 * WC_Admin_Notes.
 *
 * @deprecated since 1.7.0, use Notes
 */
class WC_Admin_Notes extends DeprecatedClassFacade {
	/**
	 * The name of the non-deprecated class that this facade covers.
	 *
	 * @var string
	 */
	protected static $facade_over_classname = 'Automattic\WooCommerce\Admin\Notes\Notes';

	/**
	 * The version that this class was deprecated in.
	 *
	 * @var string
	 */
	protected static $deprecated_in_version = '1.7.0';
}

/**
 * WC_Admin_Notes_Choose_Niche.
 *
 * @deprecated since 1.7.0, use ChooseNiche
 */
class WC_Admin_Notes_Choose_Niche extends DeprecatedClassFacade {
	/**
	 * The name of the non-deprecated class that this facade covers.
	 *
	 * @var string
	 */
	protected static $facade_over_classname = 'Automattic\WooCommerce\Admin\Notes\ChooseNiche';

	/**
	 * The version that this class was deprecated in.
	 *
	 * @var string
	 */
	protected static $deprecated_in_version = '1.7.0';
}

/**
 * WC_Admin_Notes_Coupon_Page_Moved.
 *
 * @deprecated since 1.7.0, use CouponPageMoved
 */
class WC_Admin_Notes_Coupon_Page_Moved extends DeprecatedClassFacade {
	/**
	 * The name of the non-deprecated class that this facade covers.
	 *
	 * @var string
	 */
	protected static $facade_over_classname = 'Automattic\WooCommerce\Admin\Notes\CouponPageMoved';

	/**
	 * The version that this class was deprecated in.
	 *
	 * @var string
	 */
	protected static $deprecated_in_version = '1.7.0';
}

/**
 * WC_Admin_Notes_Customize_Store_With_Blocks.
 *
 * @deprecated since 1.7.0, use CustomizeStoreWithBlocks
 */
class WC_Admin_Notes_Customize_Store_With_Blocks extends DeprecatedClassFacade {
	/**
	 * The name of the non-deprecated class that this facade covers.
	 *
	 * @var string
	 */
	protected static $facade_over_classname = 'Automattic\WooCommerce\Admin\Notes\CustomizeStoreWithBlocks';

	/**
	 * The version that this class was deprecated in.
	 *
	 * @var string
	 */
	protected static $deprecated_in_version = '1.7.0';
}

/**
 * WC_Admin_Notes_Deactivate_Plugin.
 *
 * @deprecated since 1.7.0, use DeactivatePlugin
 */
class WC_Admin_Notes_Deactivate_Plugin extends DeprecatedClassFacade {
	/**
	 * The name of the non-deprecated class that this facade covers.
	 *
	 * @var string
	 */
	protected static $facade_over_classname = 'Automattic\WooCommerce\Admin\Notes\DeactivatePlugin';

	/**
	 * The version that this class was deprecated in.
	 *
	 * @var string
	 */
	protected static $deprecated_in_version = '1.7.0';
}

/**
 * WC_Admin_Notes_Draw_Attention.
 *
 * @deprecated since 1.7.0, use DrawAttention
 */
class WC_Admin_Notes_Draw_Attention extends DeprecatedClassFacade {
	/**
	 * The name of the non-deprecated class that this facade covers.
	 *
	 * @var string
	 */
	protected static $facade_over_classname = 'Automattic\WooCommerce\Admin\Notes\DrawAttention';

	/**
	 * The version that this class was deprecated in.
	 *
	 * @var string
	 */
	protected static $deprecated_in_version = '1.7.0';
}

/**
 * WC_Admin_Notes_Edit_Products_On_The_Move.
 *
 * @deprecated since 1.7.0, use EditProductsOnTheMove
 */
class WC_Admin_Notes_Edit_Products_On_The_Move extends DeprecatedClassFacade {
	/**
	 * The name of the non-deprecated class that this facade covers.
	 *
	 * @var string
	 */
	protected static $facade_over_classname = 'Automattic\WooCommerce\Admin\Notes\EditProductsOnTheMove';

	/**
	 * The version that this class was deprecated in.
	 *
	 * @var string
	 */
	protected static $deprecated_in_version = '1.7.0';
}

/**
 * WC_Admin_Notes_EU_VAT_Number.
 *
 * @deprecated since 1.7.0, use EUVATNumber
 */
class WC_Admin_Notes_EU_VAT_Number extends DeprecatedClassFacade {
	/**
	 * The name of the non-deprecated class that this facade covers.
	 *
	 * @var string
	 */
	protected static $facade_over_classname = 'Automattic\WooCommerce\Admin\Notes\EUVATNumber';

	/**
	 * The version that this class was deprecated in.
	 *
	 * @var string
	 */
	protected static $deprecated_in_version = '1.7.0';
}

/**
 * WC_Admin_Notes_Facebook_Marketing_Expert.
 *
 * @deprecated since 1.7.0, use FacebookMarketingExpert
 */
class WC_Admin_Notes_Facebook_Marketing_Expert extends DeprecatedClassFacade {
	/**
	 * The name of the non-deprecated class that this facade covers.
	 *
	 * @var string
	 */
	protected static $facade_over_classname = 'Automattic\WooCommerce\Admin\Notes\FacebookMarketingExpert';

	/**
	 * The version that this class was deprecated in.
	 *
	 * @var string
	 */
	protected static $deprecated_in_version = '1.7.0';
}

/**
 * WC_Admin_Notes_First_Product.
 *
 * @deprecated since 1.7.0, use FirstProduct
 */
class WC_Admin_Notes_First_Product extends DeprecatedClassFacade {
	/**
	 * The name of the non-deprecated class that this facade covers.
	 *
	 * @var string
	 */
	protected static $facade_over_classname = 'Automattic\WooCommerce\Admin\Notes\FirstProduct';

	/**
	 * The version that this class was deprecated in.
	 *
	 * @var string
	 */
	protected static $deprecated_in_version = '1.7.0';
}

/**
 * WC_Admin_Notes_Giving_Feedback_Notes.
 *
 * @deprecated since 1.7.0, use GivingFeedbackNotes
 */
class WC_Admin_Notes_Giving_Feedback_Notes extends DeprecatedClassFacade {
	/**
	 * The name of the non-deprecated class that this facade covers.
	 *
	 * @var string
	 */
	protected static $facade_over_classname = 'Automattic\WooCommerce\Admin\Notes\GivingFeedbackNotes';

	/**
	 * The version that this class was deprecated in.
	 *
	 * @var string
	 */
	protected static $deprecated_in_version = '1.7.0';
}

/**
 * WC_Admin_Notes_Insight_First_Sale.
 *
 * @deprecated since 1.7.0, use InsightFirstSale
 */
class WC_Admin_Notes_Insight_First_Sale extends DeprecatedClassFacade {
	/**
	 * The name of the non-deprecated class that this facade covers.
	 *
	 * @var string
	 */
	protected static $facade_over_classname = 'Automattic\WooCommerce\Admin\Notes\InsightFirstSale';

	/**
	 * The version that this class was deprecated in.
	 *
	 * @var string
	 */
	protected static $deprecated_in_version = '1.7.0';
}

/**
 * WC_Admin_Notes_Install_JP_And_WCS_Plugins.
 *
 * @deprecated since 1.7.0, use InstallJPAndWCSPlugins
 */
class WC_Admin_Notes_Install_JP_And_WCS_Plugins extends DeprecatedClassFacade {
	/**
	 * The name of the non-deprecated class that this facade covers.
	 *
	 * @var string
	 */
	protected static $facade_over_classname = 'Automattic\WooCommerce\Admin\Notes\InstallJPAndWCSPlugins';

	/**
	 * The version that this class was deprecated in.
	 *
	 * @var string
	 */
	protected static $deprecated_in_version = '1.7.0';
}

/**
 * WC_Admin_Notes_Launch_Checklist.
 *
 * @deprecated since 1.7.0, use LaunchChecklist
 */
class WC_Admin_Notes_Launch_Checklist extends DeprecatedClassFacade {
	/**
	 * The name of the non-deprecated class that this facade covers.
	 *
	 * @var string
	 */
	protected static $facade_over_classname = 'Automattic\WooCommerce\Admin\Notes\LaunchChecklist';

	/**
	 * The version that this class was deprecated in.
	 *
	 * @var string
	 */
	protected static $deprecated_in_version = '1.7.0';
}

/**
 * WC_Admin_Notes_Marketing.
 *
 * @deprecated since 1.7.0, use Marketing
 */
class WC_Admin_Notes_Marketing extends DeprecatedClassFacade {
	/**
	 * The name of the non-deprecated class that this facade covers.
	 *
	 * @var string
	 */
	protected static $facade_over_classname = 'Automattic\WooCommerce\Admin\Notes\Marketing';

	/**
	 * The version that this class was deprecated in.
	 *
	 * @var string
	 */
	protected static $deprecated_in_version = '1.7.0';
}

/**
 * WC_Admin_Notes_Migrate_From_Shopify.
 *
 * @deprecated since 1.7.0, use MigrateFromShopify
 */
class WC_Admin_Notes_Migrate_From_Shopify extends DeprecatedClassFacade {
	/**
	 * The name of the non-deprecated class that this facade covers.
	 *
	 * @var string
	 */
	protected static $facade_over_classname = 'Automattic\WooCommerce\Admin\Notes\MigrateFromShopify';

	/**
	 * The version that this class was deprecated in.
	 *
	 * @var string
	 */
	protected static $deprecated_in_version = '1.7.0';
}

/**
 * WC_Admin_Notes_Mobile_App.
 *
 * @deprecated since 1.7.0, use MobileApp
 */
class WC_Admin_Notes_Mobile_App extends DeprecatedClassFacade {
	/**
	 * The name of the non-deprecated class that this facade covers.
	 *
	 * @var string
	 */
	protected static $facade_over_classname = 'Automattic\WooCommerce\Admin\Notes\MobileApp';

	/**
	 * The version that this class was deprecated in.
	 *
	 * @var string
	 */
	protected static $deprecated_in_version = '1.7.0';
}

/**
 * WC_Admin_Notes_Need_Some_Inspiration.
 *
 * @deprecated since 1.7.0, use NeedSomeInspiration
 */
class WC_Admin_Notes_Need_Some_Inspiration extends DeprecatedClassFacade {
	/**
	 * The name of the non-deprecated class that this facade covers.
	 *
	 * @var string
	 */
	protected static $facade_over_classname = 'Automattic\WooCommerce\Admin\Notes\NeedSomeInspiration';

	/**
	 * The version that this class was deprecated in.
	 *
	 * @var string
	 */
	protected static $deprecated_in_version = '1.7.0';
}

/**
 * WC_Admin_Notes_New_Sales_Record.
 *
 * @deprecated since 1.7.0, use NewSalesRecord
 */
class WC_Admin_Notes_New_Sales_Record extends DeprecatedClassFacade {
	/**
	 * The name of the non-deprecated class that this facade covers.
	 *
	 * @var string
	 */
	protected static $facade_over_classname = 'Automattic\WooCommerce\Admin\Notes\NewSalesRecord';

	/**
	 * The version that this class was deprecated in.
	 *
	 * @var string
	 */
	protected static $deprecated_in_version = '1.7.0';
}

/**
 * WC_Admin_Notes_Onboarding_Email_Marketing.
 *
 * @deprecated since 1.7.0, use OnboardingEmailMarketing
 */
class WC_Admin_Notes_Onboarding_Email_Marketing extends DeprecatedClassFacade {
	/**
	 * The name of the non-deprecated class that this facade covers.
	 *
	 * @var string
	 */
	protected static $facade_over_classname = 'Automattic\WooCommerce\Admin\Notes\OnboardingEmailMarketing';

	/**
	 * The version that this class was deprecated in.
	 *
	 * @var string
	 */
	protected static $deprecated_in_version = '1.7.0';
}

/**
 * WC_Admin_Notes_Onboarding_Payments.
 *
 * @deprecated since 1.7.0, use OnboardingPayments
 */
class WC_Admin_Notes_Onboarding_Payments extends DeprecatedClassFacade {
	/**
	 * The name of the non-deprecated class that this facade covers.
	 *
	 * @var string
	 */
	protected static $facade_over_classname = 'Automattic\WooCommerce\Admin\Notes\OnboardingPayments';

	/**
	 * The version that this class was deprecated in.
	 *
	 * @var string
	 */
	protected static $deprecated_in_version = '1.7.0';
}

/**
 * WC_Admin_Notes_Online_Clothing_Store.
 *
 * @deprecated since 1.7.0, use OnlineClothingStore
 */
class WC_Admin_Notes_Online_Clothing_Store extends DeprecatedClassFacade {
	/**
	 * The name of the non-deprecated class that this facade covers.
	 *
	 * @var string
	 */
	protected static $facade_over_classname = 'Automattic\WooCommerce\Admin\Notes\OnlineClothingStore';

	/**
	 * The version that this class was deprecated in.
	 *
	 * @var string
	 */
	protected static $deprecated_in_version = '1.7.0';
}

/**
 * WC_Admin_Notes_Order_Milestones.
 *
 * @deprecated since 1.7.0, use OrderMilestones
 */
class WC_Admin_Notes_Order_Milestones extends DeprecatedClassFacade {
	/**
	 * The name of the non-deprecated class that this facade covers.
	 *
	 * @var string
	 */
	protected static $facade_over_classname = 'Automattic\WooCommerce\Admin\Notes\OrderMilestones';

	/**
	 * The version that this class was deprecated in.
	 *
	 * @var string
	 */
	protected static $deprecated_in_version = '1.7.0';
}

/**
 * WC_Admin_Notes_Performance_On_Mobile.
 *
 * @deprecated since 1.7.0, use PerformanceOnMobile
 */
class WC_Admin_Notes_Performance_On_Mobile extends DeprecatedClassFacade {
	/**
	 * The name of the non-deprecated class that this facade covers.
	 *
	 * @var string
	 */
	protected static $facade_over_classname = 'Automattic\WooCommerce\Admin\Notes\PerformanceOnMobile';

	/**
	 * The version that this class was deprecated in.
	 *
	 * @var string
	 */
	protected static $deprecated_in_version = '1.7.0';
}

/**
 * WC_Admin_Notes_Personalize_Store.
 *
 * @deprecated since 1.7.0, use PersonalizeStore
 */
class WC_Admin_Notes_Personalize_Store extends DeprecatedClassFacade {
	/**
	 * The name of the non-deprecated class that this facade covers.
	 *
	 * @var string
	 */
	protected static $facade_over_classname = 'Automattic\WooCommerce\Admin\Notes\PersonalizeStore';

	/**
	 * The version that this class was deprecated in.
	 *
	 * @var string
	 */
	protected static $deprecated_in_version = '1.7.0';
}

/**
 * WC_Admin_Notes_Real_Time_Order_Alerts.
 *
 * @deprecated since 1.7.0, use RealTimeOrderAlerts
 */
class WC_Admin_Notes_Real_Time_Order_Alerts extends DeprecatedClassFacade {
	/**
	 * The name of the non-deprecated class that this facade covers.
	 *
	 * @var string
	 */
	protected static $facade_over_classname = 'Automattic\WooCommerce\Admin\Notes\RealTimeOrderAlerts';

	/**
	 * The version that this class was deprecated in.
	 *
	 * @var string
	 */
	protected static $deprecated_in_version = '1.7.0';
}

/**
 * WC_Admin_Notes_Selling_Online_Courses.
 *
 * @deprecated since 1.7.0, use SellingOnlineCourses
 */
class WC_Admin_Notes_Selling_Online_Courses extends DeprecatedClassFacade {
	/**
	 * The name of the non-deprecated class that this facade covers.
	 *
	 * @var string
	 */
	protected static $facade_over_classname = 'Automattic\WooCommerce\Admin\Notes\SellingOnlineCourses';

	/**
	 * The version that this class was deprecated in.
	 *
	 * @var string
	 */
	protected static $deprecated_in_version = '1.7.0';
}

/**
 * WC_Admin_Notes_Set_Up_Additional_Payment_Types.
 *
 * @deprecated since 1.7.0, use SetUpAdditionalPaymentTypes
 */
class WC_Admin_Notes_Set_Up_Additional_Payment_Types extends DeprecatedClassFacade {
	/**
	 * The name of the non-deprecated class that this facade covers.
	 *
	 * @var string
	 */
	protected static $facade_over_classname = 'Automattic\WooCommerce\Admin\Notes\SetUpAdditionalPaymentTypes';

	/**
	 * The version that this class was deprecated in.
	 *
	 * @var string
	 */
	protected static $deprecated_in_version = '1.7.0';
}

/**
 * WC_Admin_Notes_Start_Dropshipping_Business.
 *
 * @deprecated since 1.7.0, use StartDropshippingBusiness
 */
class WC_Admin_Notes_Start_Dropshipping_Business extends DeprecatedClassFacade {
	/**
	 * The name of the non-deprecated class that this facade covers.
	 *
	 * @var string
	 */
	protected static $facade_over_classname = 'Automattic\WooCommerce\Admin\Notes\StartDropshippingBusiness';

	/**
	 * The version that this class was deprecated in.
	 *
	 * @var string
	 */
	protected static $deprecated_in_version = '1.7.0';
}

/**
 * WC_Admin_Notes_Test_Checkout.
 *
 * @deprecated since 1.7.0, use TestCheckout
 */
class WC_Admin_Notes_Test_Checkout extends DeprecatedClassFacade {
	/**
	 * The name of the non-deprecated class that this facade covers.
	 *
	 * @var string
	 */
	protected static $facade_over_classname = 'Automattic\WooCommerce\Admin\Notes\TestCheckout';

	/**
	 * The version that this class was deprecated in.
	 *
	 * @var string
	 */
	protected static $deprecated_in_version = '1.7.0';
}

/**
 * WC_Admin_Notes_Tracking_Opt_In.
 *
 * @deprecated since 1.7.0, use TrackingOptIn
 */
class WC_Admin_Notes_Tracking_Opt_In extends DeprecatedClassFacade {
	/**
	 * The name of the non-deprecated class that this facade covers.
	 *
	 * @var string
	 */
	protected static $facade_over_classname = 'Automattic\WooCommerce\Admin\Notes\TrackingOptIn';

	/**
	 * The version that this class was deprecated in.
	 *
	 * @var string
	 */
	protected static $deprecated_in_version = '1.7.0';
}

/**
 * WC_Admin_Notes_Woo_Subscriptions_Notes.
 *
 * @deprecated since 1.7.0, use WooSubscriptionsNotes
 */
class WC_Admin_Notes_Woo_Subscriptions_Notes extends DeprecatedClassFacade {
	/**
	 * The name of the non-deprecated class that this facade covers.
	 *
	 * @var string
	 */
	protected static $facade_over_classname = 'Automattic\WooCommerce\Admin\Notes\WooSubscriptionsNotes';

	/**
	 * The version that this class was deprecated in.
	 *
	 * @var string
	 */
	protected static $deprecated_in_version = '1.7.0';
}

/**
 * WC_Admin_Notes_WooCommerce_Payments.
 *
 * @deprecated since 1.7.0, use WooCommercePayments
 */
class WC_Admin_Notes_WooCommerce_Payments extends DeprecatedClassFacade {
	/**
	 * The name of the non-deprecated class that this facade covers.
	 *
	 * @var string
	 */
	protected static $facade_over_classname = 'Automattic\WooCommerce\Admin\Notes\WooCommercePayments';

	/**
	 * The version that this class was deprecated in.
	 *
	 * @var string
	 */
	protected static $deprecated_in_version = '1.7.0';
}

/**
 * WC_Admin_Notes_WooCommerce_Subscriptions.
 *
 * @deprecated since 1.7.0, use WooCommerceSubscriptions
 */
class WC_Admin_Notes_WooCommerce_Subscriptions extends DeprecatedClassFacade {
	/**
	 * The name of the non-deprecated class that this facade covers.
	 *
	 * @var string
	 */
	protected static $facade_over_classname = 'Automattic\WooCommerce\Admin\Notes\WooCommerceSubscriptions';

	/**
	 * The version that this class was deprecated in.
	 *
	 * @var string
	 */
	protected static $deprecated_in_version = '1.7.0';
}
woocommerce-admin/src/Notes/EUVATNumber.php000064400000003051151335517650014610 0ustar00<?php
/**
 * WooCommerce Admin: EU VAT Number Note.
 *
 * Adds a note for EU store to install the EU VAT Number extension.
 */

namespace Automattic\WooCommerce\Admin\Notes;

defined( 'ABSPATH' ) || exit;

/**
 * EU_VAT_Number
 */
class EUVATNumber {
	/**
	 * Note traits.
	 */
	use NoteTraits;

	/**
	 * Name of the note for use in the database.
	 */
	const NOTE_NAME = 'wc-admin-eu-vat-number';

	/**
	 * Get the note.
	 *
	 * @return Note
	 */
	public static function get_note() {
		if ( 'yes' !== get_option( 'wc_connect_taxes_enabled', 'no' ) ) {
			return;
		}

		$country_code = WC()->countries->get_base_country();
		$eu_countries = WC()->countries->get_european_union_countries();
		if ( ! in_array( $country_code, $eu_countries, true ) ) {
			return;
		}

		$content = __( "If your store is based in the EU, we recommend using the EU VAT Number extension in addition to automated taxes. It provides your checkout with a field to collect and validate a customer's EU VAT number, if they have one.", 'woocommerce' );

		$note = new Note();
		$note->set_title( __( 'Collect and validate EU VAT numbers at checkout', 'woocommerce' ) );
		$note->set_content( $content );
		$note->set_content_data( (object) array() );
		$note->set_type( Note::E_WC_ADMIN_NOTE_MARKETING );
		$note->set_name( self::NOTE_NAME );
		$note->set_source( 'woocommerce-admin' );
		$note->add_action(
			'learn-more',
			__( 'Learn more', 'woocommerce' ),
			'https://woocommerce.com/products/eu-vat-number/?utm_medium=product',
			Note::E_WC_ADMIN_NOTE_ACTIONED,
			true
		);
		return $note;
	}
}
woocommerce-admin/src/Notes/WooSubscriptionsNotes.php000064400000033115151335517650017124 0ustar00<?php
/**
 * WooCommerce Admin (Dashboard) WooCommerce.com Extension Subscriptions Note Provider.
 *
 * Adds notes to the merchant's inbox concerning WooCommerce.com extension subscriptions.
 */

namespace Automattic\WooCommerce\Admin\Notes;

defined( 'ABSPATH' ) || exit;

/**
 * Woo_Subscriptions_Notes
 */
class WooSubscriptionsNotes {
	const LAST_REFRESH_OPTION_KEY = 'woocommerce_admin-wc-helper-last-refresh';
	const CONNECTION_NOTE_NAME    = 'wc-admin-wc-helper-connection';
	const SUBSCRIPTION_NOTE_NAME  = 'wc-admin-wc-helper-subscription';
	const NOTIFY_WHEN_DAYS_LEFT   = 60;

	/**
	 * We want to bubble up expiration notices when they cross certain age
	 * thresholds. PHP 5.2 doesn't support constant arrays, so we do this.
	 *
	 * @return array
	 */
	private function get_bump_thresholds() {
		return array( 60, 45, 20, 7, 1 ); // days.
	}

	/**
	 * Hook all the things.
	 */
	public function __construct() {
		add_action( 'admin_init', array( $this, 'admin_init' ) );
		add_action( 'update_option_woocommerce_helper_data', array( $this, 'update_option_woocommerce_helper_data' ), 10, 2 );
	}

	/**
	 * Reacts to changes in the helper option.
	 *
	 * @param array $old_value The previous value of the option.
	 * @param array $value The new value of the option.
	 */
	public function update_option_woocommerce_helper_data( $old_value, $value ) {
		if ( ! is_array( $old_value ) ) {
			$old_value = array();
		}
		if ( ! is_array( $value ) ) {
			$value = array();
		}

		$old_auth  = array_key_exists( 'auth', $old_value ) ? $old_value['auth'] : array();
		$new_auth  = array_key_exists( 'auth', $value ) ? $value['auth'] : array();
		$old_token = array_key_exists( 'access_token', $old_auth ) ? $old_auth['access_token'] : '';
		$new_token = array_key_exists( 'access_token', $new_auth ) ? $new_auth['access_token'] : '';

		// The site just disconnected.
		if ( ! empty( $old_token ) && empty( $new_token ) ) {
			$this->remove_notes();
			$this->add_no_connection_note();
			return;
		}

		// The site is connected.
		if ( $this->is_connected() ) {
			$this->remove_notes();
			$this->refresh_subscription_notes();
			return;
		}
	}

	/**
	 * Things to do on admin_init.
	 */
	public function admin_init() {
		$this->check_connection();

		if ( $this->is_connected() ) {
			$refresh_notes = false;

			// Did the user just do something on the helper page?.
			if ( isset( $_GET['wc-helper-status'] ) ) { // @codingStandardsIgnoreLine.
				$refresh_notes = true;
			}

			// Has it been more than a day since we last checked?
			// Note: We do it this way and not wp_scheduled_task since WC_Helper_Options is not loaded for cron.
			$time_now_gmt = current_time( 'timestamp', 0 );
			$last_refresh = intval( get_option( self::LAST_REFRESH_OPTION_KEY, 0 ) );
			if ( $last_refresh + DAY_IN_SECONDS <= $time_now_gmt ) {
				update_option( self::LAST_REFRESH_OPTION_KEY, $time_now_gmt );
				$refresh_notes = true;
			}

			if ( $refresh_notes ) {
				$this->refresh_subscription_notes();
			}
		}
	}

	/**
	 * Checks the connection. Adds a note (as necessary) if there is no connection.
	 */
	public function check_connection() {
		if ( ! $this->is_connected() ) {
			$data_store = Notes::load_data_store();
			$note_ids   = $data_store->get_notes_with_name( self::CONNECTION_NOTE_NAME );
			if ( ! empty( $note_ids ) ) {
				// We already have a connection note. Exit early.
				return;
			}

			$this->remove_notes();
			$this->add_no_connection_note();
		}
	}

	/**
	 * Whether or not we think the site is currently connected to WooCommerce.com.
	 *
	 * @return bool
	 */
	public function is_connected() {
		$auth = \WC_Helper_Options::get( 'auth' );
		return ( ! empty( $auth['access_token'] ) );
	}

	/**
	 * Returns the WooCommerce.com provided site ID for this site.
	 *
	 * @return int|false
	 */
	public function get_connected_site_id() {
		if ( ! $this->is_connected() ) {
			return false;
		}

		$auth = \WC_Helper_Options::get( 'auth' );
		return absint( $auth['site_id'] );
	}

	/**
	 * Returns an array of product_ids whose subscriptions are active on this site.
	 *
	 * @return array
	 */
	public function get_subscription_active_product_ids() {
		$site_id = $this->get_connected_site_id();
		if ( ! $site_id ) {
			return array();
		}

		$product_ids = array();

		if ( $this->is_connected() ) {
			$subscriptions = \WC_Helper::get_subscriptions();

			foreach ( (array) $subscriptions as $subscription ) {
				if ( in_array( $site_id, $subscription['connections'], true ) ) {
					$product_ids[] = $subscription['product_id'];
				}
			}
		}

		return $product_ids;
	}

	/**
	 * Clears all connection or subscription notes.
	 */
	public function remove_notes() {
		Notes::delete_notes_with_name( self::CONNECTION_NOTE_NAME );
		Notes::delete_notes_with_name( self::SUBSCRIPTION_NOTE_NAME );
	}

	/**
	 * Adds a note prompting to connect to WooCommerce.com.
	 */
	public function add_no_connection_note() {
		$note = new Note();
		$note->set_title( __( 'Connect to WooCommerce.com', 'woocommerce' ) );
		$note->set_content( __( 'Connect to get important product notifications and updates.', 'woocommerce' ) );
		$note->set_content_data( (object) array() );
		$note->set_type( Note::E_WC_ADMIN_NOTE_INFORMATIONAL );
		$note->set_name( self::CONNECTION_NOTE_NAME );
		$note->set_source( 'woocommerce-admin' );
		$note->add_action(
			'connect',
			__( 'Connect', 'woocommerce' ),
			'?page=wc-addons&section=helper',
			Note::E_WC_ADMIN_NOTE_UNACTIONED
		);
		$note->save();
	}

	/**
	 * Gets the product_id (if any) associated with a note.
	 *
	 * @param Note $note The note object to interrogate.
	 * @return int|false
	 */
	public function get_product_id_from_subscription_note( &$note ) {
		$content_data = $note->get_content_data();

		if ( property_exists( $content_data, 'product_id' ) ) {
			return intval( $content_data->product_id );
		}

		return false;
	}

	/**
	 * Removes notes for product_ids no longer active on this site.
	 */
	public function prune_inactive_subscription_notes() {
		$active_product_ids = $this->get_subscription_active_product_ids();

		$data_store = Notes::load_data_store();
		$note_ids   = $data_store->get_notes_with_name( self::SUBSCRIPTION_NOTE_NAME );

		foreach ( (array) $note_ids as $note_id ) {
			$note       = Notes::get_note( $note_id );
			$product_id = $this->get_product_id_from_subscription_note( $note );
			if ( ! empty( $product_id ) ) {
				if ( ! in_array( $product_id, $active_product_ids, true ) ) {
					$note->delete();
				}
			}
		}
	}

	/**
	 * Finds a note for a given product ID, if the note exists at all.
	 *
	 * @param int $product_id The product ID to search for.
	 * @return Note|false
	 */
	public function find_note_for_product_id( $product_id ) {
		$product_id = intval( $product_id );

		$data_store = Notes::load_data_store();
		$note_ids   = $data_store->get_notes_with_name( self::SUBSCRIPTION_NOTE_NAME );
		foreach ( (array) $note_ids as $note_id ) {
			$note             = Notes::get_note( $note_id );
			$found_product_id = $this->get_product_id_from_subscription_note( $note );

			if ( $product_id === $found_product_id ) {
				return $note;
			}
		}

		return false;
	}

	/**
	 * Deletes a note for a given product ID, if the note exists at all.
	 *
	 * @param int $product_id The product ID to search for.
	 */
	public function delete_any_note_for_product_id( $product_id ) {
		$product_id = intval( $product_id );

		$note = $this->find_note_for_product_id( $product_id );
		if ( $note ) {
			$note->delete();
		}
	}

	/**
	 * Adds or updates a note for an expiring subscription.
	 *
	 * @param array $subscription The subscription to work with.
	 */
	public function add_or_update_subscription_expiring( $subscription ) {
		$product_id            = $subscription['product_id'];
		$product_name          = $subscription['product_name'];
		$expires               = intval( $subscription['expires'] );
		$time_now_gmt          = current_time( 'timestamp', 0 );
		$days_until_expiration = intval( ceil( ( $expires - $time_now_gmt ) / DAY_IN_SECONDS ) );

		$note = $this->find_note_for_product_id( $product_id );

		if ( $note ) {
			$content_data = $note->get_content_data();
			if ( property_exists( $content_data, 'days_until_expiration' ) ) {
				// Note: There is no reason this property should not exist. This is just defensive programming.
				$note_days_until_expiration = intval( $content_data->days_until_expiration );
				if ( $days_until_expiration === $note_days_until_expiration ) {
					// Note is already up to date. Bail.
					return;
				}

				// If we have a note and we are at or have crossed a threshold, we should delete
				// the old note and create a new one, thereby "bumping" the note to the top of the inbox.
				$bump_thresholds    = $this->get_bump_thresholds();
				$crossing_threshold = false;

				foreach ( (array) $bump_thresholds as $bump_threshold ) {
					if ( ( $note_days_until_expiration > $bump_threshold ) && ( $days_until_expiration <= $bump_threshold ) ) {
						$note->delete();
						$note = false;
						continue;
					}
				}
			}
		}

		$note_title = sprintf(
			/* translators: name of the extension subscription expiring soon */
			__( '%s subscription expiring soon', 'woocommerce' ),
			$product_name
		);

		$note_content = sprintf(
			/* translators: number of days until the subscription expires */
			__( 'Your subscription expires in %d days. Enable autorenew to avoid losing updates and access to support.', 'woocommerce' ),
			$days_until_expiration
		);

		$note_content_data = (object) array(
			'product_id'            => $product_id,
			'product_name'          => $product_name,
			'expired'               => false,
			'days_until_expiration' => $days_until_expiration,
		);

		if ( ! $note ) {
			$note = new Note();
		}

		// Reset everything in case we are repurposing an expired note as an expiring note.
		$note->set_title( $note_title );
		$note->set_type( Note::E_WC_ADMIN_NOTE_WARNING );
		$note->set_name( self::SUBSCRIPTION_NOTE_NAME );
		$note->set_source( 'woocommerce-admin' );
		$note->clear_actions();
		$note->add_action(
			'enable-autorenew',
			__( 'Enable Autorenew', 'woocommerce' ),
			'https://woocommerce.com/my-account/my-subscriptions/?utm_medium=product'
		);
		$note->set_content( $note_content );
		$note->set_content_data( $note_content_data );
		$note->save();
	}

	/**
	 * Adds a note for an expired subscription, or updates an expiring note to expired.
	 *
	 * @param array $subscription The subscription to work with.
	 */
	public function add_or_update_subscription_expired( $subscription ) {
		$product_id   = $subscription['product_id'];
		$product_name = $subscription['product_name'];
		$product_page = $subscription['product_url'];
		$expires      = intval( $subscription['expires'] );
		$expires_date = gmdate( 'F jS', $expires );

		$note = $this->find_note_for_product_id( $product_id );
		if ( $note ) {
			$note_content_data = $note->get_content_data();
			if ( $note_content_data->expired ) {
				// We've already got a full fledged expired note for this. Bail.
				// Expired notes' content don't change with time.
				return;
			}
		}

		$note_title = sprintf(
			/* translators: name of the extension subscription that expired */
			__( '%s subscription expired', 'woocommerce' ),
			$product_name
		);

		$note_content = sprintf(
			/* translators: date the subscription expired, e.g. Jun 7th 2018 */
			__( 'Your subscription expired on %s. Get a new subscription to continue receiving updates and access to support.', 'woocommerce' ),
			$expires_date
		);

		$note_content_data = (object) array(
			'product_id'   => $product_id,
			'product_name' => $product_name,
			'expired'      => true,
			'expires'      => $expires,
			'expires_date' => $expires_date,
		);

		if ( ! $note ) {
			$note = new Note();
		}

		$note->set_title( $note_title );
		$note->set_content( $note_content );
		$note->set_content_data( $note_content_data );
		$note->set_type( Note::E_WC_ADMIN_NOTE_WARNING );
		$note->set_name( self::SUBSCRIPTION_NOTE_NAME );
		$note->set_source( 'woocommerce-admin' );
		$note->clear_actions();
		$note->add_action(
			'renew-subscription',
			__( 'Renew Subscription', 'woocommerce' ),
			$product_page
		);
		$note->save();
	}

	/**
	 * For each active subscription on this site, checks the expiration date and creates/updates/deletes notes.
	 */
	public function refresh_subscription_notes() {
		if ( ! $this->is_connected() ) {
			return;
		}

		$this->prune_inactive_subscription_notes();

		$subscriptions      = \WC_Helper::get_subscriptions();
		$active_product_ids = $this->get_subscription_active_product_ids();

		foreach ( (array) $subscriptions as $subscription ) {
			// Only concern ourselves with active products.
			$product_id = $subscription['product_id'];
			if ( ! in_array( $product_id, $active_product_ids, true ) ) {
				continue;
			}

			// If the subscription will auto-renew, clean up and exit.
			if ( $subscription['autorenew'] ) {
				$this->delete_any_note_for_product_id( $product_id );
				continue;
			}

			// If the subscription is not expiring by the first threshold, clean up and exit.
			$bump_thresholds = $this->get_bump_thresholds();
			$first_threshold = DAY_IN_SECONDS * $bump_thresholds[0];
			$expires         = intval( $subscription['expires'] );
			$time_now_gmt    = current_time( 'timestamp', 0 );
			if ( $expires > $time_now_gmt + $first_threshold ) {
				$this->delete_any_note_for_product_id( $product_id );
				continue;
			}

			// Otherwise, if the subscription can still have auto-renew enabled, let them know that now.
			if ( $expires > $time_now_gmt ) {
				$this->add_or_update_subscription_expiring( $subscription );
				continue;
			}

			// If we got this far, the subscription has completely expired, let them know.
			$this->add_or_update_subscription_expired( $subscription );
		}
	}
}
woocommerce-admin/src/Notes/ChoosingTheme.php000064400000002537151335517650015317 0ustar00<?php
/**
 * WooCommerce Admin (Dashboard) choosing a theme note
 *
 * Adds notes to the merchant's inbox about choosing a theme.
 */

namespace Automattic\WooCommerce\Admin\Notes;

defined( 'ABSPATH' ) || exit;

/**
 * Giving_Feedback_Notes
 */
class ChoosingTheme {
	/**
	 * Note traits.
	 */
	use NoteTraits;

	/**
	 * Name of the note for use in the database.
	 */
	const NOTE_NAME = 'wc-admin-choosing-a-theme';

	/**
	 * Get the note.
	 *
	 * @return Note
	 */
	protected static function get_note() {
		// We need to show choosing a theme notification after 1 day of install.
		if ( ! self::is_wc_admin_active_in_date_range( 'week-1', DAY_IN_SECONDS ) ) {
			return;
		}

		// Otherwise, create our new note.
		$note = new Note();
		$note->set_title( __( 'Choosing a theme?', 'woocommerce' ) );
		$note->set_content( __( 'Check out the themes that are compatible with WooCommerce and choose one aligned with your brand and business needs.', 'woocommerce' ) );
		$note->set_content_data( (object) array() );
		$note->set_type( Note::E_WC_ADMIN_NOTE_MARKETING );
		$note->set_name( self::NOTE_NAME );
		$note->set_source( 'woocommerce-admin' );
		$note->add_action(
			'visit-the-theme-marketplace',
			__( 'Visit the theme marketplace', 'woocommerce' ),
			'https://woocommerce.com/product-category/themes/?utm_source=inbox&utm_medium=product'
		);
		return $note;
	}
}
woocommerce-admin/src/Notes/OnlineClothingStore.php000064400000005130151335517650016504 0ustar00<?php
/**
 * WooCommerce Admin: Start your online clothing store.
 *
 * Adds a note to ask the client if they are considering starting an online
 * clothing store.
 */

namespace Automattic\WooCommerce\Admin\Notes;

defined( 'ABSPATH' ) || exit;

/**
 * Online_Clothing_Store.
 */
class OnlineClothingStore {
	/**
	 * Note traits.
	 */
	use NoteTraits;

	/**
	 * Name of the note for use in the database.
	 */
	const NOTE_NAME = 'wc-admin-online-clothing-store';

	/**
	 * Returns whether the industries includes fashion-apparel-accessories.
	 *
	 * @param array $industries The industries to search.
	 *
	 * @return bool Whether the industries includes fashion-apparel-accessories.
	 */
	private static function is_in_fashion_industry( $industries ) {
		foreach ( $industries as $industry ) {
			if ( 'fashion-apparel-accessories' === $industry['slug'] ) {
				return true;
			}
		}

		return false;
	}

	/**
	 * Get the note.
	 *
	 * @return Note
	 */
	public static function get_note() {
		// We want to show the note after two days.
		if ( ! self::is_wc_admin_active_in_date_range( 'week-1', 2 * DAY_IN_SECONDS ) ) {
			return;
		}

		$onboarding_profile = get_option( 'woocommerce_onboarding_profile', array() );

		// Confirm that $onboarding_profile is set.
		if ( empty( $onboarding_profile ) ) {
			return;
		}

		// Make sure that the person who filled out the OBW was not setting up
		// the store for their customer/client.
		if (
			! isset( $onboarding_profile['setup_client'] ) ||
			$onboarding_profile['setup_client']
		) {
			return;
		}

		// We need to show the notification when the industry is
		// fashion/apparel/accessories.
		if ( ! isset( $onboarding_profile['industry'] ) ) {
			return;
		}
		if ( ! self::is_in_fashion_industry( $onboarding_profile['industry'] ) ) {
			return;
		}

		$note = new Note();
		$note->set_title( __( 'Start your online clothing store', 'woocommerce' ) );
		$note->set_content( __( 'Starting a fashion website is exciting but it may seem overwhelming as well. In this article, we\'ll walk you through the setup process, teach you to create successful product listings, and show you how to market to your ideal audience.', 'woocommerce' ) );
		$note->set_type( Note::E_WC_ADMIN_NOTE_INFORMATIONAL );
		$note->set_name( self::NOTE_NAME );
		$note->set_content_data( (object) array() );
		$note->set_source( 'woocommerce-admin' );
		$note->add_action(
			'online-clothing-store',
			__( 'Learn more', 'woocommerce' ),
			'https://woocommerce.com/posts/starting-an-online-clothing-store/?utm_source=inbox&utm_medium=product',
			Note::E_WC_ADMIN_NOTE_ACTIONED,
			true
		);
		return $note;
	}
}
woocommerce-admin/src/Notes/MobileApp.php000064400000002443151335517650014427 0ustar00<?php
/**
 * WooCommerce Admin Mobile App Note Provider.
 *
 * Adds a note to the merchant's inbox showing the benefits of the mobile app.
 */

namespace Automattic\WooCommerce\Admin\Notes;

defined( 'ABSPATH' ) || exit;

/**
 * Mobile_App
 */
class MobileApp {
	/**
	 * Note traits.
	 */
	use NoteTraits;

	/**
	 * Name of the note for use in the database.
	 */
	const NOTE_NAME = 'wc-admin-mobile-app';

	/**
	 * Get the note.
	 *
	 * @return Note
	 */
	public static function get_note() {
		// We want to show the mobile app note after day 2.
		$two_days_in_seconds = 2 * DAY_IN_SECONDS;
		if ( ! self::is_wc_admin_active_in_date_range( 'week-1', $two_days_in_seconds ) ) {
			return;
		}

		$content = __( 'Install the WooCommerce mobile app to manage orders, receive sales notifications, and view key metrics — wherever you are.', 'woocommerce' );

		$note = new Note();
		$note->set_title( __( 'Install Woo mobile app', 'woocommerce' ) );
		$note->set_content( $content );
		$note->set_content_data( (object) array() );
		$note->set_type( Note::E_WC_ADMIN_NOTE_INFORMATIONAL );
		$note->set_name( self::NOTE_NAME );
		$note->set_source( 'woocommerce-admin' );
		$note->add_action( 'learn-more', __( 'Learn more', 'woocommerce' ), 'https://woocommerce.com/mobile/?utm_medium=product' );
		return $note;
	}
}
woocommerce-admin/src/Notes/WelcomeToWooCommerceForStoreUsers.php000064400000002653151335517650021326 0ustar00<?php
/**
 * WooCommerce Admin: Welcome to WooCommerce for store users.
 */

namespace Automattic\WooCommerce\Admin\Notes;

defined( 'ABSPATH' ) || exit;

/**
 * Welcome to WooCommerce for store users.
 */
class WelcomeToWooCommerceForStoreUsers {
	/**
	 * Note traits.
	 */
	use NoteTraits;

	/**
	 * Name of the note for use in the database.
	 */
	const NOTE_NAME = 'wc-admin-welcome-to-woocommerce-for-store-users';

	/**
	 * Attach hooks.
	 */
	public function __construct() {
		add_action( 'init', array( $this, 'possibly_add_note' ) );
	}

	/**
	 * Get the note.
	 *
	 * @return Note|null
	 */
	public static function get_note() {
		// Only add if coming from Calypso.
		if ( ! isset( $_GET['from-calypso'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification
			return;
		}

		$note = new Note();
		$note->set_title( __( 'Welcome to your new store management experience', 'woocommerce' ) );
		$note->set_content( __( "We've designed your navigation and home screen to help you focus on the things that matter most in managing your online store.", 'woocommerce' ) );
		$note->set_type( Note::E_WC_ADMIN_NOTE_INFORMATIONAL );
		$note->set_name( self::NOTE_NAME );
		$note->set_source( 'woocommerce-admin' );
		$note->add_action(
			'learn-more',
			__( 'Learn more', 'woocommerce' ),
			'https://wordpress.com/support/new-woocommerce-experience-on-wordpress-dot-com/"',
			Note::E_WC_ADMIN_NOTE_ACTIONED,
			true
		);

		return $note;
	}
}
woocommerce-admin/src/Notes/AddingAndManangingProducts.php000064400000003401151335517650017727 0ustar00<?php
/**
 * WooCommerce Admin adding and managing products note provider
 *
 * Adds a note with a link to the manging products doc if store has been active > 3 days and
 * product count is 0
 *
 * @package WooCommerce\Admin
 */

namespace Automattic\WooCommerce\Admin\Notes;

defined( 'ABSPATH' ) || exit;

/**
 * Class AddingAndManangingProducts
 *
 * @package Automattic\WooCommerce\Admin\Notes
 */
class AddingAndManangingProducts {
	/**
	 * Note traits.
	 */
	use NoteTraits;

	/**
	 * Name of the note for use in the database.
	 */
	const NOTE_NAME = 'wc-admin-adding-and-managing-products';

	/**
	 * Get the note.
	 *
	 * @return Note|null
	 */
	public static function get_note() {
		// Store must have been at least 3 days.
		if ( ! self::is_wc_admin_active_in_date_range( 'week-1', DAY_IN_SECONDS * 3 ) ) {
			return;
		}

		// Total # of products must be 0.
		$query = new \WC_Product_Query(
			array(
				'limit'    => 1,
				'paginate' => true,
				'return'   => 'ids',
				'status'   => array( 'publish' ),
			)
		);

		$products = $query->get_products();
		if ( 0 !== $products->total ) {
			return;
		}

		$note = new Note();
		$note->set_title( __( 'Adding and Managing Products', 'woocommerce' ) );
		$note->set_content(
			__(
				'Learn more about how to set up products in WooCommerce through our useful documentation about adding and managing products.',
				'woocommerce'
			)
		);
		$note->set_content_data( (object) array() );
		$note->set_type( Note::E_WC_ADMIN_NOTE_INFORMATIONAL );
		$note->set_name( self::NOTE_NAME );
		$note->set_source( 'woocommerce-admin' );
		$note->add_action(
			'learn-more',
			__( 'Learn more', 'woocommerce' ),
			'https://docs.woocommerce.com/document/managing-products/?utm_source=inbox&utm_medium=product'
		);

		return $note;
	}
}
woocommerce-admin/src/Notes/WooCommercePayments.php000064400000012732151335517650016521 0ustar00<?php
/**
 * WooCommerce Admin WooCommerce Payments Note Provider.
 *
 * Adds a note to the merchant's inbox showing the benefits of the WooCommerce Payments.
 */

namespace Automattic\WooCommerce\Admin\Notes;

defined( 'ABSPATH' ) || exit;

/**
 * WooCommerce_Payments
 */
class WooCommercePayments {
	/**
	 * Note traits.
	 */
	use NoteTraits;

	/**
	 * Name of the note for use in the database.
	 */
	const NOTE_NAME = 'wc-admin-woocommerce-payments';

	/**
	 * Name of the note for use in the database.
	 */
	const PLUGIN_SLUG = 'woocommerce-payments';

	/**
	 * Name of the note for use in the database.
	 */
	const PLUGIN_FILE = 'woocommerce-payments/woocommerce-payments.php';

	/**
	 * Attach hooks.
	 */
	public function __construct() {
		add_action( 'init', array( $this, 'install_on_action' ) );
		add_action( 'wc-admin-woocommerce-payments_add_note', array( $this, 'add_note' ) );
	}

	/**
	 * Maybe add a note on WooCommerce Payments for US based sites older than a week without the plugin installed.
	 */
	public static function possibly_add_note() {
		if ( ! self::is_wc_admin_active_in_date_range( 'week-1-4' ) || 'US' !== WC()->countries->get_base_country() ) {
			return;
		}

		$data_store = Notes::load_data_store();

		// We already have this note? Then mark the note as actioned.
		$note_ids = $data_store->get_notes_with_name( self::NOTE_NAME );
		if ( ! empty( $note_ids ) ) {

			$note_id = array_pop( $note_ids );
			$note    = Notes::get_note( $note_id );
			if ( false === $note ) {
				return;
			}

			// If the WooCommerce Payments plugin was installed after the note was created, make sure it's marked as actioned.
			if ( self::is_installed() && Note::E_WC_ADMIN_NOTE_ACTIONED !== $note->get_status() ) {
				$note->set_status( Note::E_WC_ADMIN_NOTE_ACTIONED );
				$note->save();
			}

			return;
		}

		$current_date = new \DateTime();
		$publish_date = new \DateTime( '2020-04-14' );

		if ( $current_date >= $publish_date ) {

			$note = self::get_note();
			if ( self::can_be_added() ) {
				$note->save();
			}

			return;

		} else {

			$hook_name = sprintf( '%s_add_note', self::NOTE_NAME );

			if ( ! WC()->queue()->get_next( $hook_name ) ) {
				WC()->queue()->schedule_single( $publish_date->getTimestamp(), $hook_name );
			}
		}
	}

	/**
	 * Add a note about WooCommerce Payments.
	 *
	 * @return Note
	 */
	public static function get_note() {
		$note = new Note();
		$note->set_title( __( 'Try the new way to get paid', 'woocommerce' ) );
		$note->set_content(
			__( 'Securely accept credit and debit cards on your site. Manage transactions without leaving your WordPress dashboard. Only with <strong>WooCommerce Payments</strong>.', 'woocommerce' ) .
			'<br><br>' .
			sprintf(
				/* translators: 1: opening link tag, 2: closing tag */
				__( 'By clicking "Get started", you agree to our %1$sTerms of Service%2$s', 'woocommerce' ),
				'<a href="https://wordpress.com/tos/" target="_blank">',
				'</a>'
			)
		);
		$note->set_content_data( (object) array() );
		$note->set_type( Note::E_WC_ADMIN_NOTE_MARKETING );
		$note->set_name( self::NOTE_NAME );
		$note->set_source( 'woocommerce-admin' );
		$note->add_action( 'learn-more', __( 'Learn more', 'woocommerce' ), 'https://woocommerce.com/payments/?utm_medium=product', Note::E_WC_ADMIN_NOTE_UNACTIONED );
		$note->add_action( 'get-started', __( 'Get started', 'woocommerce' ), wc_admin_url( '&action=setup-woocommerce-payments' ), Note::E_WC_ADMIN_NOTE_ACTIONED, true );

		// Create the note as "actioned" if the plugin is already installed.
		if ( self::is_installed() ) {
			$note->set_status( Note::E_WC_ADMIN_NOTE_ACTIONED );
		}
		return $note;
	}


	/**
	 * Check if the WooCommerce Payments plugin is active or installed.
	 */
	protected static function is_installed() {
		if ( defined( 'WC_Payments' ) ) {
			return true;
		}
		include_once ABSPATH . '/wp-admin/includes/plugin.php';
		return 0 === validate_plugin( self::PLUGIN_FILE );
	}

	/**
	 * Install and activate WooCommerce Payments.
	 *
	 * @return boolean Whether the plugin was successfully activated.
	 */
	private function install_and_activate_wcpay() {
		$install_request = array( 'plugins' => self::PLUGIN_SLUG );
		$installer       = new \Automattic\WooCommerce\Admin\API\Plugins();
		$result          = $installer->install_plugins( $install_request );
		if ( is_wp_error( $result ) ) {
			return false;
		}

		wc_admin_record_tracks_event( 'woocommerce_payments_install', array( 'context' => 'inbox' ) );

		$activate_request = array( 'plugins' => self::PLUGIN_SLUG );
		$result           = $installer->activate_plugins( $activate_request );
		if ( is_wp_error( $result ) ) {
			return false;
		}

		return true;
	}

	/**
	 * Install & activate WooCommerce Payments plugin, and redirect to setup.
	 */
	public function install_on_action() {
		// TODO: Need to validate this request more strictly since we're taking install actions directly?
		/* phpcs:disable WordPress.Security.NonceVerification */
		if (
			! isset( $_GET['page'] ) ||
			'wc-admin' !== $_GET['page'] ||
			! isset( $_GET['action'] ) ||
			'setup-woocommerce-payments' !== $_GET['action']
		) {
			return;
		}
		/* phpcs:enable */

		if ( ! current_user_can( 'install_plugins' ) ) {
			return;
		}

		$this->install_and_activate_wcpay();

		// WooCommerce Payments is installed at this point, so link straight into the onboarding flow.
		$connect_url = add_query_arg(
			array(
				'wcpay-connect' => '1',
				'_wpnonce'      => wp_create_nonce( 'wcpay-connect' ),
			),
			admin_url()
		);
		wp_safe_redirect( $connect_url );
		exit;
	}
}
woocommerce-admin/src/Notes/FilterByProductVariationsInReports.php000064400000003634151335517650021551 0ustar00<?php
/**
 * New - filter by product variations in order and product reports.
 */

namespace Automattic\WooCommerce\Admin\Notes;

defined( 'ABSPATH' ) || exit;

/**
 * FilterByProductVariationsInReports.
 */
class FilterByProductVariationsInReports {
	/**
	 * Note traits.
	 */
	use NoteTraits;

	/**
	 * Name of the note for use in the database.
	 */
	const NOTE_NAME = 'wc-admin-filter-by-product-variations-in-reports';

	/**
	 * Get the note
	 *
	 * @return Note|null
	 */
	public static function get_note() {
		if ( ! self::are_products_with_variations() ) {
			return null;
		}

		$note = new Note();
		$note->set_title( __( 'New - filter by product variations in orders and products reports', 'woocommerce' ) );
		$note->set_content( __( 'One of the most awaited features has just arrived! You can now have insights into each product variation in the orders and products reports.', 'woocommerce' ) );
		$note->set_type( Note::E_WC_ADMIN_NOTE_INFORMATIONAL );
		$note->set_layout( 'banner' );
		$note->set_image(
			plugins_url(
				'/images/admin_notes/filter-by-product-variations-note.svg',
				WC_ADMIN_PLUGIN_FILE
			)
		);
		$note->set_name( self::NOTE_NAME );
		$note->set_content_data( (object) array() );
		$note->set_source( 'woocommerce-admin' );
		$note->add_action(
			'learn-more',
			__( 'Learn more', 'woocommerce' ),
			'https://docs.woocommerce.com/document/woocommerce-analytics/?utm_medium=product#variations-report'
		);

		return $note;
	}

	/**
	 * Returns whether or not there are variable products.
	 *
	 * @return bool If there are variable products
	 */
	private static function are_products_with_variations() {
		$query    = new \WC_Product_Query(
			array(
				'limit'    => 1,
				'paginate' => true,
				'return'   => 'ids',
				'status'   => array( 'publish' ),
				'type'     => array( 'variable' ),
			)
		);
		$products = $query->get_products();
		$count    = $products->total;

		return 0 !== $count;
	}
}
woocommerce-admin/src/Notes/EditProductsOnTheMove.php000064400000003112151335517650016747 0ustar00<?php
/**
 * WooCommerce Admin Edit products on the move note.
 *
 * Adds a note to download the mobile app.
 */

namespace Automattic\WooCommerce\Admin\Notes;

defined( 'ABSPATH' ) || exit;

/**
 * Edit_Products_On_The_Move
 */
class EditProductsOnTheMove {
	/**
	 * Note traits.
	 */
	use NoteTraits;

	/**
	 * Name of the note for use in the database.
	 */
	const NOTE_NAME = 'wc-admin-edit-products-on-the-move';

	/**
	 * Get the note.
	 *
	 * @return Note
	 */
	public static function get_note() {
		// Only add this note if this store is at least a year old.
		$year_in_seconds = 365 * DAY_IN_SECONDS;
		if ( ! self::wc_admin_active_for( $year_in_seconds ) ) {
			return;
		}

		// Check that the previous mobile app notes have not been actioned.
		if ( MobileApp::has_note_been_actioned() ) {
			return;
		}
		if ( RealTimeOrderAlerts::has_note_been_actioned() ) {
			return;
		}
		if ( ManageOrdersOnTheGo::has_note_been_actioned() ) {
			return;
		}
		if ( PerformanceOnMobile::has_note_been_actioned() ) {
			return;
		}

		$note = new Note();

		$note->set_title( __( 'Edit products on the move', 'woocommerce' ) );
		$note->set_content( __( 'Edit and create new products from your mobile devices with the Woo app', 'woocommerce' ) );
		$note->set_content_data( (object) array() );
		$note->set_type( Note::E_WC_ADMIN_NOTE_INFORMATIONAL );
		$note->set_name( self::NOTE_NAME );
		$note->set_source( 'woocommerce-admin' );
		$note->add_action(
			'learn-more',
			__( 'Learn more', 'woocommerce' ),
			'https://woocommerce.com/mobile/?utm_source=inbox&utm_medium=product'
		);

		return $note;
	}
}
woocommerce-admin/src/Notes/CustomizeStoreWithBlocks.php000064400000004402151335517650017545 0ustar00<?php
/**
 * WooCommerce Admin: Customize your online store with WooCommerce blocks.
 *
 * Adds a note to customize the client online store with WooCommerce blocks.
 *
 * @package WooCommerce\Admin
 */

namespace Automattic\WooCommerce\Admin\Notes;

defined( 'ABSPATH' ) || exit;

/**
 * Customize_Store_With_Blocks.
 */
class CustomizeStoreWithBlocks {
	/**
	 * Note traits.
	 */
	use NoteTraits;

	/**
	 * Name of the note for use in the database.
	 */
	const NOTE_NAME = 'wc-admin-customize-store-with-blocks';

	/**
	 * Get the note.
	 *
	 * @return Note
	 */
	public static function get_note() {
		$onboarding_profile = get_option( 'woocommerce_onboarding_profile', array() );

		// Confirm that $onboarding_profile is set.
		if ( empty( $onboarding_profile ) ) {
			return;
		}

		// Make sure that the person who filled out the OBW was not setting up
		// the store for their customer/client.
		if (
			! isset( $onboarding_profile['setup_client'] ) ||
			$onboarding_profile['setup_client']
		) {
			return;
		}

		// We want to show the note after fourteen days.
		if ( ! self::is_wc_admin_active_in_date_range( 'week-1-4', 14 * DAY_IN_SECONDS ) ) {
			return;
		}

		// Don't show if there aren't products.
		$query    = new \WC_Product_Query(
			array(
				'limit'  => 1,
				'return' => 'ids',
				'status' => array( 'publish' ),
			)
		);
		$products = $query->get_products();
		if ( 0 === count( $products ) ) {
			return;
		}

		$note = new Note();
		$note->set_title( __( 'Customize your online store with WooCommerce blocks', 'woocommerce' ) );
		$note->set_content( __( 'With our blocks, you can select and display products, categories, filters, and more virtually anywhere on your site — no need to use shortcodes or edit lines of code. Learn more about how to use each one of them.', 'woocommerce' ) );
		$note->set_type( Note::E_WC_ADMIN_NOTE_INFORMATIONAL );
		$note->set_name( self::NOTE_NAME );
		$note->set_content_data( (object) array() );
		$note->set_source( 'woocommerce-admin' );
		$note->add_action(
			'customize-store-with-blocks',
			__( 'Learn more', 'woocommerce' ),
			'https://woocommerce.com/posts/how-to-customize-your-online-store-with-woocommerce-blocks/?utm_source=inbox&utm_medium=product',
			Note::E_WC_ADMIN_NOTE_ACTIONED,
			true
		);
		return $note;
	}
}
woocommerce-admin/src/Notes/NeedSomeInspiration.php000064400000003262151335517650016476 0ustar00<?php
/**
 * WooCommerce Admin: Do you need some inspiration?
 *
 * Adds a note to ask the client if they need some inspiration.
 */

namespace Automattic\WooCommerce\Admin\Notes;

defined( 'ABSPATH' ) || exit;

/**
 * Need_Some_Inspiration.
 */
class NeedSomeInspiration {
	/**
	 * Note traits.
	 */
	use NoteTraits;

	/**
	 * Name of the note for use in the database.
	 */
	const NOTE_NAME = 'wc-admin-need-some-inspiration';

	/**
	 * Get the note.
	 *
	 * @return Note
	 */
	public static function get_note() {
		// We want to show the note after 4 days.
		if ( ! self::is_wc_admin_active_in_date_range( 'week-1-4', 4 * DAY_IN_SECONDS ) ) {
			return;
		}

		$onboarding_profile = get_option( 'woocommerce_onboarding_profile', array() );

		// Confirm that $onboarding_profile is set.
		if ( empty( $onboarding_profile ) ) {
			return;
		}

		// Make sure that the person who filled out the OBW was not setting up
		// the store for their customer/client.
		if (
			! isset( $onboarding_profile['setup_client'] ) ||
			$onboarding_profile['setup_client']
		) {
			return;
		}

		$note = new Note();
		$note->set_title( __( 'Browse our success stories', 'woocommerce' ) );
		$note->set_content( __( 'Learn more about how other entrepreneurs used WooCommerce to build successful businesses.', 'woocommerce' ) );
		$note->set_type( Note::E_WC_ADMIN_NOTE_INFORMATIONAL );
		$note->set_name( self::NOTE_NAME );
		$note->set_content_data( (object) array() );
		$note->set_source( 'woocommerce-admin' );
		$note->add_action(
			'need-some-inspiration',
			__( 'See success stories', 'woocommerce' ),
			'https://woocommerce.com/success-stories/?utm_source=inbox&utm_medium=product',
			true
		);
		return $note;
	}
}
woocommerce-admin/src/Notes/InsightFirstSale.php000064400000003141151335517650015775 0ustar00<?php
/**
 * WooCommerce Admin: Insight - First sale
 *
 * Adds a note to give insight about the first sale.
 *
 * @package WooCommerce\Admin
 */

namespace Automattic\WooCommerce\Admin\Notes;

defined( 'ABSPATH' ) || exit;

/**
 * Insight_First_Sale.
 */
class InsightFirstSale {
	/**
	 * Note traits.
	 */
	use NoteTraits;

	/**
	 * Name of the note for use in the database.
	 */
	const NOTE_NAME = 'wc-admin-insight-first-sale';

	/**
	 * Get the note.
	 *
	 * @return Note
	 */
	public static function get_note() {
		if ( ! self::is_wc_admin_active_in_date_range( 'week-1-4' ) ) {
			return;
		}

		$note = new Note();
		$note->set_title( __( 'Did you know?', 'woocommerce' ) );
		$note->set_content( __( 'A WooCommerce powered store needs on average 31 days to get the first sale. You\'re on the right track! Do you find this type of insight useful?', 'woocommerce' ) );
		$note->set_type( Note::E_WC_ADMIN_NOTE_SURVEY );
		$note->set_name( self::NOTE_NAME );
		$note->set_content_data( (object) array() );
		$note->set_source( 'woocommerce-admin' );

		// Note that there is no corresponding function called in response to
		// this. Apart from setting the note to actioned a tracks event is
		// sent in NoteActions.
		$note->add_action(
			'affirm-insight-first-sale',
			__( 'Yes', 'woocommerce' ),
			false,
			Note::E_WC_ADMIN_NOTE_ACTIONED,
			false,
			__( 'Thanks for your feedback', 'woocommerce' )
		);
		$note->add_action(
			'deny-insight-first-sale',
			__( 'No', 'woocommerce' ),
			false,
			Note::E_WC_ADMIN_NOTE_ACTIONED,
			false,
			__( 'Thanks for your feedback', 'woocommerce' )
		);

		return $note;
	}
}
woocommerce-admin/src/Features/MobileAppBanner.php000064400000001674151335517650016250 0ustar00<?php

namespace Automattic\WooCommerce\Admin\Features;

defined( 'ABSPATH' ) || exit;

/**
 * Determine if the mobile app banner shows on Android devices
 */
class MobileAppBanner {
	/**
	 * Class instance.
	 *
	 * @var Analytics instance
	 */
	protected static $instance = null;

	/**
	 * Get class instance.
	 */
	public static function get_instance() {
		if ( ! self::$instance ) {
			self::$instance = new self();
		}
		return self::$instance;
	}

	/**
	 * Hook into WooCommerce.
	 */
	public function __construct() {
		add_filter( 'woocommerce_admin_get_user_data_fields', array( $this, 'add_user_data_fields' ) );
	}

	/**
	 * Adds fields so that we can store user preferences for the mobile app banner
	 *
	 * @param array $user_data_fields User data fields.
	 * @return array
	 */
	public function add_user_data_fields( $user_data_fields ) {
		return array_merge(
			$user_data_fields,
			array(
				'android_app_banner_dismissed',
			)
		);
	}
}
woocommerce-admin/src/Features/OnboardingTasks/TaskLists.php000064400000011152151335517650020253 0ustar00<?php
/**
 * Handles storage and retrieval of task lists
 */

namespace Automattic\WooCommerce\Admin\Features\OnboardingTasks;

use Automattic\WooCommerce\Admin\Features\OnboardingTasks\Tasks\Appearance;
use Automattic\WooCommerce\Admin\Features\OnboardingTasks\Tasks\Marketing;
use Automattic\WooCommerce\Admin\Features\OnboardingTasks\Tasks\Payments;
use Automattic\WooCommerce\Admin\Features\OnboardingTasks\Tasks\Products;
use Automattic\WooCommerce\Admin\Features\OnboardingTasks\Tasks\Purchase;
use Automattic\WooCommerce\Admin\Features\OnboardingTasks\Tasks\Shipping;
use Automattic\WooCommerce\Admin\Features\OnboardingTasks\Tasks\StoreDetails;
use Automattic\WooCommerce\Admin\Features\OnboardingTasks\Tasks\Tax;
use Automattic\WooCommerce\Admin\Features\OnboardingTasks\Tasks\WooCommercePayments;
use Automattic\WooCommerce\Admin\Loader;

/**
 * Task Lists class.
 */
class TaskLists {
	/**
	 * Class instance.
	 *
	 * @var TaskLists instance
	 */
	protected static $instance = null;

	/**
	 * An array of all registered lists.
	 *
	 * @var array
	 */
	protected static $lists = array();

	/**
	 * Get class instance.
	 */
	final public static function instance() {
		if ( ! static::$instance ) {
			static::$instance = new static();
		}
		return static::$instance;
	}

	/**
	 * Initialize the task lists.
	 */
	public static function init() {
		self::init_default_lists();
		add_action( 'rest_api_init', array( __CLASS__, 'maybe_add_default_tasks' ) );
	}

	/**
	 * Initialize default lists.
	 */
	public static function init_default_lists() {
		self::add_list(
			array(
				'id'    => 'setup',
				'title' => __( 'Get ready to start selling', 'woocommerce' ),
			)
		);

		self::add_list(
			array(
				'id'    => 'extended',
				'title' => __( 'Things to do next', 'woocommerce' ),
			)
		);
	}

	/**
	 * Add a task list.
	 *
	 * @param array $args Task list properties.
	 * @return WP_Error|Task
	 */
	public static function add_list( $args ) {
		if ( isset( self::$lists[ $args['id'] ] ) ) {
			return new \WP_Error(
				'woocommerce_task_list_exists',
				__( 'Task list ID already exists', 'woocommerce' )
			);
		}

		self::$lists[ $args['id'] ] = new TaskList( $args );
	}

	/**
	 * Add task to a given task list.
	 *
	 * @param string $list_id List ID to add the task to.
	 * @param array  $args Task properties.
	 * @return WP_Error|Task
	 */
	public static function add_task( $list_id, $args ) {
		if ( ! isset( self::$lists[ $list_id ] ) ) {
			return new \WP_Error(
				'woocommerce_task_list_invalid_list',
				__( 'Task list ID does not exist', 'woocommerce' )
			);
		}

		self::$lists[ $list_id ]->add_task( $args );
	}

	/**
	 * Add default task lists.
	 */
	public static function maybe_add_default_tasks() {
		global $wp;

		if ( substr( $wp->request, 0, 34 ) !== 'wp-json/wc-admin/onboarding/tasks' ) {
			return;
		}

		if ( ! apply_filters( 'woocommerce_admin_onboarding_tasks_add_default_tasks', true ) ) {
			return;
		}

		self::add_task( 'setup', StoreDetails::get_task() );
		self::add_task( 'setup', Purchase::get_task() );
		self::add_task( 'setup', Products::get_task() );
		self::add_task( 'setup', WooCommercePayments::get_task() );
		self::add_task( 'setup', Payments::get_task() );
		self::add_task( 'setup', Tax::get_task() );
		self::add_task( 'setup', Shipping::get_task() );
		self::add_task( 'setup', Marketing::get_task() );
		self::add_task( 'setup', Appearance::get_task() );
	}

	/**
	 * Get all task lists.
	 *
	 * @return array
	 */
	public static function get_lists() {
		return self::$lists;
	}

	/**
	 * Get visible task lists.
	 */
	public static function get_visible() {
		return array_filter(
			self::get_lists(),
			function ( $task_list ) {
				return ! $task_list->is_hidden();
			}
		);
	}


	/**
	 * Retrieve a task list by ID.
	 *
	 * @param String $id Task list ID.
	 *
	 * @return TaskList|null
	 */
	public static function get_list( $id ) {
		foreach ( self::get_lists() as $task_list ) {
			if ( $task_list->id === $id ) {
				return $task_list;
			}
		}

		return null;
	}

	/**
	 * Retrieve single task.
	 *
	 * @param String $id Task ID.
	 * @param String $task_list_id Task list ID.
	 *
	 * @return Object
	 */
	public static function get_task( $id, $task_list_id = null ) {
		$task_list = $task_list_id ? self::get_task_list_by_id( $task_list_id ) : null;

		if ( $task_list_id && ! $task_list ) {
			return null;
		}

		$tasks_to_search = $task_list ? $task_list['tasks'] : array_reduce(
			self::get_lists(),
			function ( $all, $curr ) {
				return array_merge( $all, $curr['tasks'] );
			},
			array()
		);

		foreach ( $tasks_to_search as $task ) {
			if ( $id === $task['id'] ) {
				return $task;
			}
		}

		return null;
	}
}
woocommerce-admin/src/Features/OnboardingTasks/Init.php000064400000035675151335517650017255 0ustar00<?php
/**
 * WooCommerce Onboarding Tasks
 * NOTE: DO NOT edit this file in WooCommerce core, this is generated from woocommerce-admin.
 */

namespace Automattic\WooCommerce\Admin\Features\OnboardingTasks;

use \Automattic\WooCommerce\Admin\Loader;
use Automattic\WooCommerce\Admin\API\Reports\Taxes\Stats\DataStore as TaxDataStore;
use Automattic\WooCommerce\Admin\Features\OnboardingTasks\Tasks\Tax;

/**
 * Contains the logic for completing onboarding tasks.
 */
class Init {
	/**
	 * Class instance.
	 *
	 * @var OnboardingTasks instance
	 */
	protected static $instance = null;

	/**
	 * Name of the active task transient.
	 *
	 * @var string
	 */
	const ACTIVE_TASK_TRANSIENT = 'wc_onboarding_active_task';

	/**
	 * Get class instance.
	 */
	public static function get_instance() {
		if ( ! self::$instance ) {
			self::$instance = new self();
		}
		return self::$instance;
	}

	/**
	 * Constructor
	 */
	public function __construct() {
		// This hook needs to run when options are updated via REST.
		add_action( 'add_option_woocommerce_task_list_complete', array( $this, 'track_completion' ), 10, 2 );
		add_action( 'add_option_woocommerce_extended_task_list_complete', array( $this, 'track_extended_completion' ), 10, 2 );
		add_action( 'add_option_woocommerce_task_list_tracked_completed_tasks', array( $this, 'track_task_completion' ), 10, 2 );
		add_action( 'update_option_woocommerce_task_list_tracked_completed_tasks', array( $this, 'track_task_completion' ), 10, 2 );
		add_action( 'admin_enqueue_scripts', array( $this, 'update_option_extended_task_list' ), 15 );
		add_filter( 'pre_option_woocommerce_task_list_hidden', array( $this, 'get_deprecated_options' ), 10, 2 );
		add_filter( 'pre_option_woocommerce_extended_task_list_hidden', array( $this, 'get_deprecated_options' ), 10, 2 );
		add_action( 'pre_update_option_woocommerce_task_list_hidden', array( $this, 'update_deprecated_options' ), 10, 3 );
		add_action( 'pre_update_option_woocommerce_extended_task_list_hidden', array( $this, 'update_deprecated_options' ), 10, 3 );
		TaskLists::init();

		if ( ! is_admin() ) {
			return;
		}

		add_action( 'admin_enqueue_scripts', array( $this, 'add_media_scripts' ) );
		// Old settings injection.
		// Run after Onboarding.
		add_filter( 'woocommerce_components_settings', array( __CLASS__, 'component_settings' ), 30 );
		// New settings injection.
		add_filter( 'woocommerce_admin_shared_settings', array( $this, 'component_settings' ), 30 );

		add_action( 'admin_init', array( $this, 'set_active_task' ), 5 );
		add_action( 'admin_enqueue_scripts', array( $this, 'add_onboarding_product_notice_admin_script' ) );
		add_action( 'admin_enqueue_scripts', array( $this, 'add_onboarding_homepage_notice_admin_script' ) );
		add_action( 'admin_enqueue_scripts', array( $this, 'add_onboarding_tax_notice_admin_script' ) );
		add_action( 'admin_enqueue_scripts', array( $this, 'add_onboarding_product_import_notice_admin_script' ) );
	}

	/**
	 * Enqueue scripts and styles.
	 */
	public function add_media_scripts() {
		wp_enqueue_media();
	}

	/**
	 * Get task item data for settings filter.
	 *
	 * @return array
	 */
	public static function get_settings() {
		$settings            = array();
		$wc_pay_is_connected = false;
		if ( class_exists( '\WC_Payments' ) ) {
			$wc_payments_gateway = \WC_Payments::get_gateway();
			$wc_pay_is_connected = method_exists( $wc_payments_gateway, 'is_connected' )
				? $wc_payments_gateway->is_connected()
				: false;
		}

		$gateways         = WC()->payment_gateways->get_available_payment_gateways();
		$enabled_gateways = array_filter(
			$gateways,
			function( $gateway ) {
				return 'yes' === $gateway->enabled;
			}
		);

		// @todo We may want to consider caching some of these and use to check against
		// task completion along with cache busting for active tasks.
		$settings['automatedTaxSupportedCountries'] = Tax::get_automated_tax_supported_countries();
		$settings['hasHomepage']                    = self::check_task_completion( 'homepage' ) || 'classic' === get_option( 'classic-editor-replace' );
		$settings['hasPaymentGateway']              = ! empty( $enabled_gateways );
		$settings['enabledPaymentGateways']         = array_keys( $enabled_gateways );
		$settings['hasPhysicalProducts']            = count(
			wc_get_products(
				array(
					'virtual' => false,
					'limit'   => 1,
				)
			)
		) > 0;
		$settings['hasProducts']                    = self::check_task_completion( 'products' );
		$settings['isAppearanceComplete']           = get_option( 'woocommerce_task_list_appearance_complete' );
		$settings['isTaxComplete']                  = self::check_task_completion( 'tax' );
		$settings['shippingZonesCount']             = count( \WC_Shipping_Zones::get_zones() );
		$settings['stylesheet']                     = get_option( 'stylesheet' );
		$settings['taxJarActivated']                = class_exists( 'WC_Taxjar' );
		$settings['themeMods']                      = get_theme_mods();
		$settings['wcPayIsConnected']               = $wc_pay_is_connected;

		return $settings;
	}

	/**
	 * Add task items to component settings.
	 *
	 * @param array $settings Component settings.
	 * @return array
	 */
	public function component_settings( $settings ) {
		// Bail early if not on a wc-admin powered page, or task list shouldn't be shown.
		if (
			! \Automattic\WooCommerce\Admin\Loader::is_admin_page() ||
			! count( TaskLists::get_visible() )
		) {
			return $settings;
		}

		// If onboarding isn't enabled this will throw warnings.
		if ( ! isset( $settings['onboarding'] ) ) {
			$settings['onboarding'] = array();
		}

		$settings['onboarding'] = array_merge(
			$settings['onboarding'],
			array(
				'tasksStatus' => self::get_settings(),
			)
		);

		return $settings;
	}

	/**
	 * Temporarily store the active task to persist across page loads when neccessary (such as publishing a product). Most tasks do not need to do this.
	 */
	public static function set_active_task() {
		if ( isset( $_GET[ self::ACTIVE_TASK_TRANSIENT ] ) ) { // phpcs:ignore csrf ok.
			$task = sanitize_title_with_dashes( wp_unslash( $_GET[ self::ACTIVE_TASK_TRANSIENT ] ) ); // phpcs:ignore csrf ok.

			if ( self::check_task_completion( $task ) ) {
				return;
			}

			set_transient(
				self::ACTIVE_TASK_TRANSIENT,
				$task,
				DAY_IN_SECONDS
			);
		}
	}

	/**
	 * Get the name of the active task.
	 *
	 * @return string
	 */
	public static function get_active_task() {
		return get_transient( self::ACTIVE_TASK_TRANSIENT );
	}

	/**
	 * Check for active task completion, and clears the transient.
	 *
	 * @return bool
	 */
	public static function is_active_task_complete() {
		$active_task = self::get_active_task();

		if ( ! $active_task ) {
			return false;
		}

		if ( self::check_task_completion( $active_task ) ) {
			delete_transient( self::ACTIVE_TASK_TRANSIENT );
			return true;
		}

		return false;
	}

	/**
	 * Check for task completion of a given task.
	 *
	 * @param string $task Name of task.
	 * @return bool
	 */
	public static function check_task_completion( $task ) {
		switch ( $task ) {
			case 'products':
				$products = wp_count_posts( 'product' );
				return (int) $products->publish > 0;
			case 'homepage':
				$homepage_id = get_option( 'woocommerce_onboarding_homepage_post_id', false );
				if ( ! $homepage_id ) {
					return false;
				}
				$post      = get_post( $homepage_id );
				$completed = $post && 'publish' === $post->post_status;
				return $completed;
			case 'tax':
				return 'yes' === get_option( 'wc_connect_taxes_enabled' ) ||
					count( TaxDataStore::get_taxes( array() ) ) > 0 ||
					false !== get_option( 'woocommerce_no_sales_tax' );
		}
		return false;
	}

	/**
	 * Hooks into the product page to add a notice to return to the task list if a product was added.
	 *
	 * @param string $hook Page hook.
	 */
	public static function add_onboarding_product_notice_admin_script( $hook ) {
		global $post;
		if (
			'post.php' !== $hook ||
			'product' !== $post->post_type ||
			'products' !== self::get_active_task() ||
			! self::is_active_task_complete()
		) {
			return;
		}

		$script_assets_filename = Loader::get_script_asset_filename( 'wp-admin-scripts', 'onboarding-product-notice' );
		$script_assets          = require WC_ADMIN_ABSPATH . WC_ADMIN_DIST_JS_FOLDER . 'wp-admin-scripts/' . $script_assets_filename;

		wp_enqueue_script(
			'onboarding-product-notice',
			Loader::get_url( 'wp-admin-scripts/onboarding-product-notice', 'js' ),
			array_merge( array( WC_ADMIN_APP ), $script_assets ['dependencies'] ),
			WC_ADMIN_VERSION_NUMBER,
			true
		);
	}

	/**
	 * Hooks into the post page to display a different success notice and sets the active page as the site's home page if visted from onboarding.
	 *
	 * @param string $hook Page hook.
	 */
	public static function add_onboarding_homepage_notice_admin_script( $hook ) {
		global $post;
		if ( 'post.php' === $hook && 'page' === $post->post_type && isset( $_GET[ self::ACTIVE_TASK_TRANSIENT ] ) && 'homepage' === $_GET[ self::ACTIVE_TASK_TRANSIENT ] ) { // phpcs:ignore csrf ok.
			$script_assets_filename = Loader::get_script_asset_filename( 'wp-admin-scripts', 'onboarding-homepage-notice' );
			$script_assets          = require WC_ADMIN_ABSPATH . WC_ADMIN_DIST_JS_FOLDER . 'wp-admin-scripts/' . $script_assets_filename;

			wp_enqueue_script(
				'onboarding-homepage-notice',
				Loader::get_url( 'wp-admin-scripts/onboarding-homepage-notice', 'js' ),
				array_merge( array( WC_ADMIN_APP ), $script_assets ['dependencies'] ),
				WC_ADMIN_VERSION_NUMBER,
				true
			);
		}
	}

	/**
	 * Adds a notice to return to the task list when the save button is clicked on tax settings pages.
	 */
	public static function add_onboarding_tax_notice_admin_script() {
		$page = isset( $_GET['page'] ) ? $_GET['page'] : ''; // phpcs:ignore csrf ok, sanitization ok.
		$tab  = isset( $_GET['tab'] ) ? $_GET['tab'] : ''; // phpcs:ignore csrf ok, sanitization ok.

		if (
			'wc-settings' === $page &&
			'tax' === $tab &&
			'tax' === self::get_active_task() &&
			! self::is_active_task_complete()
		) {
			$script_assets_filename = Loader::get_script_asset_filename( 'wp-admin-scripts', 'onboarding-tax-notice' );
			$script_assets          = require WC_ADMIN_ABSPATH . WC_ADMIN_DIST_JS_FOLDER . 'wp-admin-scripts/' . $script_assets_filename;

			wp_enqueue_script(
				'onboarding-tax-notice',
				Loader::get_url( 'wp-admin-scripts/onboarding-tax-notice', 'js' ),
				array_merge( array( WC_ADMIN_APP ), $script_assets ['dependencies'] ),
				WC_ADMIN_VERSION_NUMBER,
				true
			);
		}
	}

	/**
	 * Adds a notice to return to the task list when the product importeris done running.
	 *
	 * @param string $hook Page hook.
	 */
	public function add_onboarding_product_import_notice_admin_script( $hook ) {
		$step = isset( $_GET['step'] ) ? $_GET['step'] : ''; // phpcs:ignore csrf ok, sanitization ok.
		if ( 'product_page_product_importer' === $hook && 'done' === $step && 'product-import' === self::get_active_task() ) {
			delete_transient( self::ACTIVE_TASK_TRANSIENT );

			$script_assets_filename = Loader::get_script_asset_filename( 'wp-admin-scripts', 'onboarding-product-import-notice' );
			$script_assets          = require WC_ADMIN_ABSPATH . WC_ADMIN_DIST_JS_FOLDER . 'wp-admin-scripts/' . $script_assets_filename;

			wp_enqueue_script(
				'onboarding-product-import-notice',
				Loader::get_url( 'wp-admin-scripts/onboarding-product-import-notice', 'js' ),
				array_merge( array( WC_ADMIN_APP ), $script_assets ['dependencies'] ),
				WC_ADMIN_VERSION_NUMBER,
				true
			);
		}
	}

	/**
	 * Records an event when all tasks are completed in the task list.
	 *
	 * @param mixed $old_value Old value.
	 * @param mixed $new_value New value.
	 */
	public static function track_completion( $old_value, $new_value ) {
		if ( $new_value ) {
			wc_admin_record_tracks_event( 'tasklist_tasks_completed' );
		}
	}

	/**
	 * Records an event when all tasks are completed in the extended task list.
	 *
	 * @param mixed $old_value Old value.
	 * @param mixed $new_value New value.
	 */
	public static function track_extended_completion( $old_value, $new_value ) {
		if ( $new_value ) {
			wc_admin_record_tracks_event( 'extended_tasklist_tasks_completed' );
		}
	}

	/**
	 * Records an event for individual task completion.
	 *
	 * @param mixed $old_value Old value.
	 * @param mixed $new_value New value.
	 */
	public static function track_task_completion( $old_value, $new_value ) {
		$old_value       = is_array( $old_value ) ? $old_value : array();
		$new_value       = is_array( $new_value ) ? $new_value : array();
		$untracked_tasks = array_diff( $new_value, $old_value );

		foreach ( $untracked_tasks as $task ) {
			wc_admin_record_tracks_event( 'tasklist_task_completed', array( 'task_name' => $task ) );
		}
	}

	/**
	 * Update registered extended task list items.
	 */
	public static function update_option_extended_task_list() {
		if (
			! \Automattic\WooCommerce\Admin\Loader::is_admin_page() ||
			! count( TaskLists::get_visible() )
		) {
			return;
		}
		$extended_tasks_list_items            = get_option( 'woocommerce_extended_task_list_items', array() );
		$registered_extended_tasks_list_items = apply_filters( 'woocommerce_get_registered_extended_tasks', array() );
		if ( $registered_extended_tasks_list_items !== $extended_tasks_list_items ) {
			update_option( 'woocommerce_extended_task_list_items', $registered_extended_tasks_list_items );
			$extended_list = TaskLists::get_list( 'extended' );
			if ( ! $extended_list ) {
				return;
			}
			$extended_list->show();
		}
	}

	/**
	 * Get the values from the correct source when attempting to retrieve deprecated options.
	 *
	 * @param string $pre_option Pre option value.
	 * @param string $option Option name.
	 * @return string
	 */
	public function get_deprecated_options( $pre_option, $option ) {
		if ( 'yes' === get_transient( 'wc_admin_installing' ) ) {
			return $pre_option;
		};

		$hidden = get_option( 'woocommerce_task_list_hidden_lists', array() );
		switch ( $option ) {
			case 'woocommerce_task_list_hidden':
				return in_array( 'setup', $hidden, true ) ? 'yes' : 'no';
			case 'woocommerce_extended_task_list_hidden':
				return in_array( 'extended', $hidden, true ) ? 'yes' : 'no';
		}
	}

	/**
	 * Updates the new option names when deprecated options are updated.
	 * This is a temporary fallback until we can fully remove the old task list components.
	 *
	 * @param string $value New value.
	 * @param string $old_value Old value.
	 * @param string $option Option name.
	 * @return string
	 */
	public function update_deprecated_options( $value, $old_value, $option ) {
		switch ( $option ) {
			case 'woocommerce_task_list_hidden':
				$task_list = TaskLists::get_list( 'setup' );
				if ( ! $task_list ) {
					return;
				}
				$update = 'yes' === $value ? $task_list->hide() : $task_list->show();
				delete_option( 'woocommerce_task_list_hidden' );
				return false;
			case 'woocommerce_extended_task_list_hidden':
				$task_list = TaskLists::get_list( 'extended' );
				if ( ! $task_list ) {
					return;
				}
				$update = 'yes' === $value ? $task_list->hide() : $task_list->show();
				delete_option( 'woocommerce_extended_task_list_hidden' );
				return false;
		}
	}
}
woocommerce-admin/src/Features/OnboardingTasks/TaskList.php000064400000004655151335517650020102 0ustar00<?php
/**
 * Handles storage and retrieval of a task list
 */

namespace Automattic\WooCommerce\Admin\Features\OnboardingTasks;

use Automattic\WooCommerce\Admin\Features\OnboardingTasks\Task;

/**
 * Task List class.
 */
class TaskList {
	/**
	 * Option name hidden task lists.
	 */
	const HIDDEN_OPTION = 'woocommerce_task_list_hidden_lists';

	/**
	 * Option name completed task lists.
	 */
	const COMPLETED_OPTION = 'woocommerce_task_list_completed_lists';

	/**
	 * ID.
	 *
	 * @var string
	 */
	public $id = '';

	/**
	 * Title.
	 *
	 * @var string
	 */
	public $title = '';

	/**
	 * Title.
	 *
	 * @var array
	 */
	protected $tasks = array();

	/**
	 * Constructor
	 *
	 * @param array $data Task list data.
	 */
	public function __construct( $data = array() ) {
		$defaults = array(
			'id'    => null,
			'title' => '',
			'tasks' => array(),
		);

		$data = wp_parse_args( $data, $defaults );

		$this->id    = $data['id'];
		$this->title = $data['title'];
		$this->tasks = $data['tasks'];
	}

	/**
	 * Check if the task list is hidden.
	 *
	 * @return bool
	 */
	public function is_hidden() {
		$hidden = get_option( self::HIDDEN_OPTION, array() );
		return in_array( $this->id, $hidden, true );
	}

	/**
	 * Hide the task list.
	 *
	 * @return bool
	 */
	public function hide() {
		$hidden   = get_option( self::HIDDEN_OPTION, array() );
		$hidden[] = $this->id;
		return update_option( self::HIDDEN_OPTION, array_unique( $hidden ) );
	}

	/**
	 * Undo hiding of the task list.
	 *
	 * @return bool
	 */
	public function show() {
		$hidden = get_option( self::HIDDEN_OPTION, array() );
		$hidden = array_diff( $hidden, array( $this->id ) );
		return update_option( self::HIDDEN_OPTION, $hidden );
	}

	/**
	 * Check if the task list is complete.
	 *
	 * @return bool
	 */
	public function is_complete() {
		$complete = get_option( self::COMPLETED_OPTION, array() );
		return in_array( $this->id, $complete, true );
	}

	/**
	 * Add task to the task list.
	 *
	 * @param array $args Task properties.
	 */
	public function add_task( $args ) {
		$this->tasks[] = new Task( $args );
	}

	/**
	 * Get the list for use in JSON.
	 *
	 * @return array
	 */
	public function get_json() {
		return array(
			'id'         => $this->id,
			'title'      => $this->title,
			'isHidden'   => $this->is_hidden(),
			'isComplete' => $this->is_complete(),
			'tasks'      => array_map(
				function( $task ) {
					return $task->get_json();
				},
				$this->tasks
			),
		);
	}

}
woocommerce-admin/src/Features/OnboardingTasks/Tasks/Products.php000064400000001761151335517650021227 0ustar00<?php

namespace Automattic\WooCommerce\Admin\Features\OnboardingTasks\Tasks;

/**
 * Products Task
 */
class Products {
	/**
	 * Get the task arguments.
	 *
	 * @return array
	 */
	public static function get_task() {
		return array(
			'id'          => 'products',
			'title'       => __( 'Add my products', 'woocommerce' ),
			'content'     => __(
				'Start by adding the first product to your store. You can add your products manually, via CSV, or import them from another service.',
				'woocommerce'
			),
			'is_complete' => self::has_products(),
			'can_view'    => true,
			'time'        => __( '1 minute per product', 'woocommerce' ),
		);
	}

	/**
	 * Check if the store has any published products.
	 *
	 * @return bool
	 */
	public static function has_products() {
		$product_query = new \WC_Product_Query(
			array(
				'limit'  => 1,
				'return' => 'ids',
				'status' => array( 'publish' ),
			)
		);
		$products      = $product_query->get_products();

		return 0 !== count( $products );
	}
}
woocommerce-admin/src/Features/OnboardingTasks/Tasks/WooCommercePayments.php000064400000004411151335517650023357 0ustar00<?php

namespace Automattic\WooCommerce\Admin\Features\OnboardingTasks\Tasks;

use Automattic\WooCommerce\Admin\Features\Onboarding;
use Automattic\WooCommerce\Admin\PluginsHelper;

/**
 * WooCommercePayments Task
 */
class WooCommercePayments {
	/**
	 * Get the task arguments.
	 *
	 * @return array
	 */
	public static function get_task() {
		return array(
			'id'           => 'woocommerce-payments',
			'title'        => __( 'Get paid with WooCommerce Payments', 'woocommerce' ),
			'content'      => __(
				"You're only one step away from getting paid. Verify your business details to start managing transactions with WooCommerce Payments.",
				'woocommerce'
			),
			'action_label' => __( 'Finish setup', 'woocommerce' ),
			'expanded'     => true,
			'is_complete'  => self::is_connected(),
			'can_view'     => self::is_requested() &&
				self::is_installed() &&
				self::is_supported(),
			'time'         => __( '2 minutes', 'woocommerce' ),
		);
	}

	/**
	 * Check if the plugin was requested during onboarding.
	 *
	 * @return bool
	 */
	public static function is_requested() {
		$profiler_data       = get_option( Onboarding::PROFILE_DATA_OPTION, array() );
		$business_extensions = isset( $profiler_data['business_extensions'] ) ? $profiler_data['business_extensions'] : array();
		return in_array( 'woocommerce-payments', $business_extensions, true );
	}

	/**
	 * Check if the plugin is installed.
	 *
	 * @return bool
	 */
	public static function is_installed() {
		$installed_plugins = PluginsHelper::get_installed_plugin_slugs();
		return in_array( 'woocommerce-payments', $installed_plugins, true );
	}

	/**
	 * Check if WooCommerce Payments is connected.
	 *
	 * @return bool
	 */
	public static function is_connected() {
		if ( class_exists( '\WC_Payments' ) ) {
			$wc_payments_gateway = \WC_Payments::get_gateway();
			return method_exists( $wc_payments_gateway, 'is_connected' )
				? $wc_payments_gateway->is_connected()
				: false;
		}

		return false;
	}

	/**
	 * Check if the store is in a supported country.
	 *
	 * @return bool
	 */
	public static function is_supported() {
		return in_array(
			WC()->countries->get_base_country(),
			array(
				'US',
				'PR',
				'AU',
				'CA',
				'DE',
				'ES',
				'FR',
				'GB',
				'IE',
				'IT',
				'NZ',
			),
			true
		);
	}
}
woocommerce-admin/src/Features/OnboardingTasks/Tasks/Marketing.php000064400000002736151335517650021350 0ustar00<?php

namespace Automattic\WooCommerce\Admin\Features\OnboardingTasks\Tasks;

use Automattic\WooCommerce\Admin\Features\Features;
use Automattic\WooCommerce\Admin\Features\RemoteFreeExtensions\Init as RemoteFreeExtensions;

/**
 * Marketing Task
 */
class Marketing {
	/**
	 * Get the task arguments.
	 *
	 * @return array
	 */
	public static function get_task() {
		return array(
			'id'          => 'marketing',
			'title'       => __( 'Set up marketing tools', 'woocommerce' ),
			'content'     => __(
				'Add recommended marketing tools to reach new customers and grow your business',
				'woocommerce'
			),
			'is_complete' => self::has_installed_extensions(),
			'can_view'    => Features::is_enabled( 'remote-free-extensions' ) && count( self::get_bundles() ) > 0,
			'time'        => __( '1 minute', 'woocommerce' ),
		);
	}

	/**
	 * Get the marketing bundles.
	 *
	 * @return array
	 */
	public static function get_bundles() {
		return RemoteFreeExtensions::get_extensions(
			array(
				'reach',
				'grow',
			)
		);
	}

	/**
	 * Check if the store has installed marketing extensions.
	 *
	 * @return bool
	 */
	public static function has_installed_extensions() {
		$bundles = self::get_bundles();

		return array_reduce(
			$bundles,
			function( $has_installed, $bundle ) {
				if ( $has_installed ) {
					return true;
				}
				foreach ( $bundle['plugins'] as $plugin ) {
					if ( $plugin->is_installed ) {
						return true;
					}
				}
				return false;
			},
			false
		);
	}
}
woocommerce-admin/src/Features/OnboardingTasks/Tasks/Payments.php000064400000002406151335517650021221 0ustar00<?php

namespace Automattic\WooCommerce\Admin\Features\OnboardingTasks\Tasks;

use Automattic\WooCommerce\Admin\Features\Features;
use Automattic\WooCommerce\Admin\Features\OnboardingTasks\Tasks\WooCommercePayments;

/**
 * Payments Task
 */
class Payments {
	/**
	 * Get the task arguments.
	 *
	 * @return array
	 */
	public static function get_task() {
		return array(
			'id'          => 'payments',
			'title'       => __( 'Set up payments', 'woocommerce' ),
			'content'     => __(
				'Choose payment providers and enable payment methods at checkout.',
				'woocommerce'
			),
			'is_complete' => self::has_gateways(),
			'can_view'    => Features::is_enabled( 'payment-gateway-suggestions' ) &&
				(
					! WooCommercePayments::is_requested() ||
					! WooCommercePayments::is_installed() ||
					! WooCommercePayments::is_supported()
				),
			'time'        => __( '2 minutes', 'woocommerce' ),
		);
	}

	/**
	 * Check if the store has any enabled gateways.
	 *
	 * @return bool
	 */
	public static function has_gateways() {
		$gateways         = WC()->payment_gateways->get_available_payment_gateways();
		$enabled_gateways = array_filter(
			$gateways,
			function( $gateway ) {
				return 'yes' === $gateway->enabled;
			}
		);

		return ! empty( $enabled_gateways );
	}
}
woocommerce-admin/src/Features/OnboardingTasks/Tasks/StoreDetails.php000064400000001622151335517650022022 0ustar00<?php

namespace Automattic\WooCommerce\Admin\Features\OnboardingTasks\Tasks;

use Automattic\WooCommerce\Admin\Features\Onboarding;

/**
 * Store Details Task
 */
class StoreDetails {
	/**
	 * Get the task arguments.
	 *
	 * @return array
	 */
	public static function get_task() {
		$profiler_data = get_option( Onboarding::PROFILE_DATA_OPTION, array() );

		return array(
			'id'           => 'store_details',
			'title'        => __( 'Store details', 'woocommerce' ),
			'content'      => __(
				'Your store address is required to set the origin country for shipping, currencies, and payment options.',
				'woocommerce'
			),
			'action_label' => __( "Let's go", 'woocommerce' ),
			'action_url'   => '/setup-wizard',
			'is_complete'  => isset( $profiler_data['completed'] ) && true === $profiler_data['completed'],
			'can_view'     => true,
			'time'         => __( '4 minutes', 'woocommerce' ),
		);
	}
}
woocommerce-admin/src/Features/OnboardingTasks/Tasks/Shipping.php000064400000002730151335517650021202 0ustar00<?php

namespace Automattic\WooCommerce\Admin\Features\OnboardingTasks\Tasks;

use Automattic\WooCommerce\Admin\Features\Onboarding;

/**
 * Shipping Task
 */
class Shipping {
	/**
	 * Get the task arguments.
	 *
	 * @return array
	 */
	public static function get_task() {
		return array(
			'id'           => 'shipping',
			'title'        => __( 'Set up shipping', 'woocommerce' ),
			'content'      => __(
				"Set your store location and where you'll ship to.",
				'woocommerce'
			),
			'action_url'   => self::has_shipping_zones()
				? admin_url( 'admin.php?page=wc-settings&tab=shipping' )
				: null,
			'action_label' => __( "Let's go", 'woocommerce' ),
			'is_complete'  => self::has_shipping_zones(),
			'can_view'     => self::has_physical_products(),
			'time'         => __( '1 minute', 'woocommerce' ),
		);
	}

	/**
	 * Check if the store has any shipping zones.
	 *
	 * @return bool
	 */
	public static function has_shipping_zones() {
		return count( \WC_Shipping_Zones::get_zones() ) > 0;
	}

	/**
	 * Check if the store has physical products.
	 *
	 * @return bool
	 */
	public static function has_physical_products() {
		$profiler_data = get_option( Onboarding::PROFILE_DATA_OPTION, array() );
		$product_types = isset( $profiler_data['product_types'] ) ? $profiler_data['product_types'] : array();

		return in_array( 'physical', $product_types, true ) ||
			count(
				wc_get_products(
					array(
						'virtual' => false,
						'limit'   => 1,
					)
				)
			) > 0;
	}
}
woocommerce-admin/src/Features/OnboardingTasks/Tasks/Appearance.php000064400000001257151335517650021463 0ustar00<?php

namespace Automattic\WooCommerce\Admin\Features\OnboardingTasks\Tasks;

/**
 * Appearance Task
 */
class Appearance {
	/**
	 * Get the task arguments.
	 *
	 * @return array
	 */
	public static function get_task() {
		return array(
			'id'           => 'appearance',
			'title'        => __( 'Personalize my store', 'woocommerce' ),
			'content'      => __(
				'Add your logo, create a homepage, and start designing your store.',
				'woocommerce'
			),
			'action_label' => __( "Let's go", 'woocommerce' ),
			'is_complete'  => get_option( 'woocommerce_task_list_appearance_complete' ),
			'can_view'     => true,
			'time'         => __( '2 minutes', 'woocommerce' ),
		);
	}
}
woocommerce-admin/src/Features/OnboardingTasks/Tasks/Tax.php000064400000003447151335517650020163 0ustar00<?php

namespace Automattic\WooCommerce\Admin\Features\OnboardingTasks\Tasks;

use Automattic\WooCommerce\Admin\Features\Features;
use Automattic\WooCommerce\Admin\API\Reports\Taxes\Stats\DataStore as TaxDataStore;

/**
 * Tax Task
 */
class Tax {
	/**
	 * Get the task arguments.
	 *
	 * @return array
	 */
	public static function get_task() {
		return array(
			'id'           => 'tax',
			'title'        => __( 'Set up tax', 'woocommerce' ),
			'content'      => self::can_use_automated_taxes()
				? __(
					'Good news! WooCommerce Services and Jetpack can automate your sales tax calculations for you.',
					'woocommerce'
				)
				: __(
					'Set your store location and configure tax rate settings.',
					'woocommerce'
				),
			'action_label' => self::can_use_automated_taxes()
				? __( 'Yes please', 'woocommerce' )
				: __( "Let's go", 'woocommerce' ),
			'is_complete'  => get_option( 'wc_connect_taxes_enabled' ) ||
				count( TaxDataStore::get_taxes( array() ) ) > 0 ||
				false !== get_option( 'woocommerce_no_sales_tax' ),
			'is_visible'   => true,
			'time'         => __( '1 minute', 'woocommerce' ),
		);
	}

	/**
	 * Check if the store has any enabled gateways.
	 *
	 * @return bool
	 */
	public static function can_use_automated_taxes() {
		if ( ! class_exists( 'WC_Taxjar' ) ) {
			return false;
		}

		return in_array( WC()->countries->get_base_country(), self::get_automated_tax_supported_countries(), true );
	}

	/**
	 * Get an array of countries that support automated tax.
	 *
	 * @return array
	 */
	public static function get_automated_tax_supported_countries() {
		// https://developers.taxjar.com/api/reference/#countries .
		$tax_supported_countries = array_merge(
			array( 'US', 'CA', 'AU' ),
			WC()->countries->get_european_union_countries()
		);

		return $tax_supported_countries;
	}
}
woocommerce-admin/src/Features/OnboardingTasks/Tasks/Purchase.php000064400000004525151335517650021177 0ustar00<?php

namespace Automattic\WooCommerce\Admin\Features\OnboardingTasks\Tasks;

use Automattic\WooCommerce\Admin\Features\Onboarding;
use Automattic\WooCommerce\Admin\PluginsHelper;

/**
 * Purchase Task
 */
class Purchase {
	/**
	 * Get the task arguments.
	 *
	 * @return array
	 */
	public static function get_task() {
		$products = self::get_products();

		return array(
			'id'             => 'purchase',
			'title'          => count( $products['remaining'] ) === 1
				? sprintf(
					/* translators: %1$s: list of product names comma separated, %2%s the last product name */
					__(
						'Add %s to my store',
						'woocommerce'
					),
					$products['remaining'][0]
				)
				: __(
					'Add paid extensions to my store',
					'woocommerce'
				),
			'content'        => count( $products['remaining'] ) === 1
				? $products['purchaseable'][0]['description']
				: sprintf(
					/* translators: %1$s: list of product names comma separated, %2%s the last product name */
					__(
						'Good choice! You chose to add %1$s and %2$s to your store.',
						'woocommerce'
					),
					implode( ', ', array_slice( $products['remaining'], 0, -1 ) ) . ( count( $products['remaining'] ) > 2 ? ',' : '' ),
					end( $products['remaining'] )
				),
			'action_label'   => __( 'Purchase & install now', 'woocommerce' ),
			'is_complete'    => count( $products['remaining'] ) === 0,
			'can_view'       => count( $products['purchaseable'] ) > 0,
			'time'           => __( '2 minutes', 'woocommerce' ),
			'is_dismissable' => true,
		);
	}

	/**
	 * Get purchaseable and remaining products.
	 *
	 * @return array
	 */
	public static function get_products() {
		$profiler_data = get_option( Onboarding::PROFILE_DATA_OPTION, array() );
		$installed     = PluginsHelper::get_installed_plugin_slugs();
		$product_types = isset( $profiler_data['product_types'] ) ? $profiler_data['product_types'] : array();
		$allowed       = Onboarding::get_allowed_product_types();
		$purchaseable  = array();
		$remaining     = array();
		foreach ( $product_types as $type ) {
			if ( ! isset( $allowed[ $type ]['slug'] ) ) {
				continue;
			}

			$purchaseable[] = $allowed[ $type ];

			if ( ! in_array( $allowed[ $type ]['slug'], $installed, true ) ) {
				$remaining[] = $allowed[ $type ]['label'];
			}
		}

		return array(
			'purchaseable' => $purchaseable,
			'remaining'    => $remaining,
		);
	}
}
woocommerce-admin/src/Features/OnboardingTasks/Task.php000064400000013703151335517650017240 0ustar00<?php
/**
 * Handles task related methods.
 */

namespace Automattic\WooCommerce\Admin\Features\OnboardingTasks;

/**
 * Task class.
 */
class Task {
	/**
	 * ID.
	 *
	 * @var string
	 */
	public $id = '';

	/**
	 * Title.
	 *
	 * @var string
	 */
	public $title = '';

	/**
	 * Title.
	 *
	 * @var string
	 */
	public $content = '';

	/**
	 * Action label.
	 *
	 * @var string
	 */
	public $action_label = '';

	/**
	 * Action URL.
	 *
	 * @var string|null
	 */
	public $action_url = null;

	/**
	 * Task completion.
	 *
	 * @var bool
	 */
	protected $is_complete = false;

	/**
	 * Viewing capability.
	 *
	 * @var bool
	 */
	protected $can_view = true;

	/**
	 * Time string.
	 *
	 * @var string|null
	 */
	public $time = null;

	/**
	 * Dismissability.
	 *
	 * @var bool
	 */
	protected $is_dismissable = false;

	/**
	 * Snoozeability.
	 *
	 * @var bool
	 */
	protected $is_snoozeable = false;

	/**
	 * Snoozeability.
	 *
	 * @var string|null
	 */
	public $snoozed_until = null;

	/**
	 * Name of the dismiss option.
	 *
	 * @var string
	 */
	const DISMISSED_OPTION = 'woocommerce_task_list_dismissed_tasks';

	/**
	 * Name of the snooze option.
	 *
	 * @var string
	 */
	const SNOOZED_OPTION = 'woocommerce_task_list_remind_me_later_tasks';

	/**
	 * Duration to milisecond mapping.
	 *
	 * @var string
	 */
	protected $duration_to_ms = array(
		'day'  => DAY_IN_SECONDS * 1000,
		'hour' => HOUR_IN_SECONDS * 1000,
		'week' => WEEK_IN_SECONDS * 1000,
	);

	/**
	 * Constructor
	 *
	 * @param array $data Task list data.
	 */
	public function __construct( $data = array() ) {
		$defaults = array(
			'id'             => null,
			'title'          => '',
			'content'        => '',
			'action_label'   => __( "Let's go", 'woocommerce' ),
			'action_url'     => null,
			'is_complete'    => false,
			'can_view'       => true,
			'time'           => null,
			'is_dismissable' => false,
			'is_snoozeable'  => false,
			'snoozed_until'  => null,
		);

		$data = wp_parse_args( $data, $defaults );

		$this->id             = (string) $data['id'];
		$this->title          = (string) $data['title'];
		$this->content        = (string) $data['content'];
		$this->action_label   = (string) $data['action_label'];
		$this->action_url     = (string) $data['action_url'];
		$this->is_complete    = (bool) $data['is_complete'];
		$this->can_view       = (bool) $data['can_view'];
		$this->time           = (string) $data['time'];
		$this->is_dismissable = (bool) $data['is_dismissable'];
		$this->is_snoozeable  = (bool) $data['is_snoozeable'];

		$snoozed_tasks = get_option( self::SNOOZED_OPTION, array() );
		if ( isset( $snoozed_tasks[ $this->id ] ) ) {
			$this->snoozed_until = $snoozed_tasks[ $this->id ];
		}
	}

	/**
	 * Bool for task dismissal.
	 *
	 * @return bool
	 */
	public function is_dismissed() {
		if ( ! $this->is_dismissable ) {
			return false;
		}

		$dismissed = get_option( self::DISMISSED_OPTION, array() );

		return in_array( $this->id, $dismissed, true );
	}

	/**
	 * Dismiss the task.
	 *
	 * @return bool
	 */
	public function dismiss() {
		if ( ! $this->is_dismissable ) {
			return false;
		}

		$dismissed   = get_option( self::DISMISSED_OPTION, array() );
		$dismissed[] = $this->id;
		$update      = update_option( self::DISMISSED_OPTION, array_unique( $dismissed ) );

		if ( $update ) {
			wc_admin_record_tracks_event( 'tasklist_dismiss_task', array( 'task_name' => $this->id ) );
		}

		return $update;
	}

	/**
	 * Undo task dismissal.
	 *
	 * @return bool
	 */
	public function undo_dismiss() {
		$dismissed = get_option( self::DISMISSED_OPTION, array() );
		$dismissed = array_diff( $dismissed, array( $this->id ) );
		$update    = update_option( self::DISMISSED_OPTION, $dismissed );

		if ( $update ) {
			wc_admin_record_tracks_event( 'tasklist_undo_dismiss_task', array( 'task_name' => $this->id ) );
		}

		return $update;
	}

	/**
	 * Bool for task snoozed.
	 *
	 * @return bool
	 */
	public function is_snoozed() {
		if ( ! $this->is_snoozeable ) {
			return false;
		}

		$snoozed = get_option( self::SNOOZED_OPTION, array() );

		return isset( $snoozed[ $this->id ] ) && $snoozed[ $this->id ] > ( time() * 1000 );
	}

	/**
	 * Snooze the task.
	 *
	 * @param string $duration Duration to snooze. day|hour|week.
	 * @return bool
	 */
	public function snooze( $duration = 'day' ) {
		if ( ! $this->is_snoozeable ) {
			return false;
		}

		$snoozed              = get_option( self::SNOOZED_OPTION, array() );
		$snoozed_until        = $this->duration_to_ms[ $duration ] + ( time() * 1000 );
		$snoozed[ $this->id ] = $snoozed_until;
		$update               = update_option( self::SNOOZED_OPTION, $snoozed );

		if ( $update ) {
			if ( $update ) {
				wc_admin_record_tracks_event( 'tasklist_remindmelater_task', array( 'task_name' => $this->id ) );
				$this->snoozed_until = $snoozed_until;
			}
		}

		return $update;
	}

	/**
	 * Undo task snooze.
	 *
	 * @return bool
	 */
	public function undo_snooze() {
		$snoozed = get_option( self::SNOOZED_OPTION, array() );
		unset( $snoozed[ $this->id ] );
		$update = update_option( self::SNOOZED_OPTION, $snoozed );

		if ( $update ) {
			wc_admin_record_tracks_event( 'tasklist_undo_remindmelater_task', array( 'task_name' => $this->id ) );
		}

		return $update;
	}

	/**
	 * Bool for task visibility.
	 *
	 * @return bool
	 */
	public function is_visible() {
		return $this->can_view && ! $this->is_snoozed() && ! $this->is_dismissed();
	}

	/**
	 * Get the task as JSON.
	 *
	 * @return array
	 */
	public function get_json() {
		return array(
			'id'            => $this->id,
			'title'         => $this->title,
			'content'       => $this->content,
			'actionLabel'   => $this->action_label,
			'actionUrl'     => $this->action_url,
			'isComplete'    => $this->is_complete,
			'isVisible'     => $this->is_visible(),
			'time'          => $this->time,
			'isDismissed'   => $this->is_dismissed(),
			'isDismissable' => $this->is_dismissable,
			'isSnoozed'     => $this->is_snoozed(),
			'isSnoozeable'  => $this->is_snoozeable,
			'snoozedUntil'  => $this->snoozed_until,
		);
	}

}
woocommerce-admin/src/Features/Coupons.php000064400000007152151335517650014675 0ustar00<?php
/**
 * WooCommerce Marketing > Coupons.
 *
 * NOTE: DO NOT edit this file in WooCommerce core, this is generated from woocommerce-admin.
 */

namespace Automattic\WooCommerce\Admin\Features;

use Automattic\WooCommerce\Admin\Features\Features;
use Automattic\WooCommerce\Admin\Loader;
use Automattic\WooCommerce\Admin\Notes\CouponPageMoved;
use Automattic\WooCommerce\Admin\PageController;

/**
 * Contains backend logic for the Coupons feature.
 */
class Coupons {

	use CouponsMovedTrait;

	/**
	 * Class instance.
	 *
	 * @var Coupons instance
	 */
	protected static $instance = null;

	/**
	 * Get class instance.
	 */
	public static function get_instance() {
		if ( ! self::$instance ) {
			self::$instance = new self();
		}
		return self::$instance;
	}

	/**
	 * Hook into WooCommerce.
	 */
	public function __construct() {
		if ( ! is_admin() ) {
			return;
		}

		// If the main marketing feature is disabled, don't modify coupon behavior.
		if ( ! Features::is_enabled( 'marketing' ) ) {
			return;
		}

		// Only support coupon modifications if coupons are enabled.
		if ( ! wc_coupons_enabled() ) {
			return;
		}

		( new CouponPageMoved() )->init();

		add_action( 'admin_enqueue_scripts', array( $this, 'maybe_add_marketing_coupon_script' ) );
		add_action( 'woocommerce_register_post_type_shop_coupon', array( $this, 'move_coupons' ) );
		add_action( 'admin_head', array( $this, 'fix_coupon_menu_highlight' ), 99 );
		add_action( 'admin_menu', array( $this, 'maybe_add_coupon_menu_redirect' ) );
	}

	/**
	 * Maybe add menu item back in original spot to help people transition
	 */
	public function maybe_add_coupon_menu_redirect() {
		if ( ! $this->should_display_legacy_menu() ) {
			return;
		}

		add_submenu_page(
			'woocommerce',
			__( 'Coupons', 'woocommerce' ),
			__( 'Coupons', 'woocommerce' ),
			'manage_options',
			'coupons-moved',
			[ $this, 'coupon_menu_moved' ]
		);
	}

	/**
	 * Call back for transition menu item
	 */
	public function coupon_menu_moved() {
		wp_safe_redirect( $this->get_legacy_coupon_url(), 301 );
		exit();
	}

	/**
	 * Modify registered post type shop_coupon
	 *
	 * @param array $args Array of post type parameters.
	 *
	 * @return array the filtered parameters.
	 */
	public function move_coupons( $args ) {
		$args['show_in_menu'] = current_user_can( 'manage_woocommerce' ) ? 'woocommerce-marketing' : true;
		return $args;
	}

	/**
	 * Undo WC modifications to $parent_file for 'shop_coupon'
	 */
	public function fix_coupon_menu_highlight() {
		global $parent_file, $post_type;

		if ( 'shop_coupon' === $post_type ) {
			$parent_file = 'woocommerce-marketing'; // phpcs:ignore WordPress.WP.GlobalVariablesOverride
		}
	}

	/**
	 * Maybe add our wc-admin coupon scripts if viewing coupon pages
	 */
	public function maybe_add_marketing_coupon_script() {
		$curent_screen = PageController::get_instance()->get_current_page();
		if ( ! isset( $curent_screen['id'] ) || 'woocommerce-coupons' !== $curent_screen['id'] ) {
			return;
		}

		$rtl = is_rtl() ? '-rtl' : '';

		wp_enqueue_style(
			'wc-admin-marketing-coupons',
			Loader::get_url( "marketing-coupons/style{$rtl}", 'css' ),
			array(),
			Loader::get_file_version( 'css' )
		);

		$script_assets_filename = Loader::get_script_asset_filename( 'wp-admin-scripts', 'marketing-coupons' );
		$script_assets          = require WC_ADMIN_ABSPATH . WC_ADMIN_DIST_JS_FOLDER . 'wp-admin-scripts/' . $script_assets_filename;

		wp_enqueue_script(
			'wc-admin-marketing-coupons',
			Loader::get_url( 'wp-admin-scripts/marketing-coupons', 'js' ),
			array_merge( array( WC_ADMIN_APP ), $script_assets ['dependencies'] ),
			Loader::get_file_version( 'js' ),
			true
		);
	}
}
woocommerce-admin/src/Features/Analytics.php000064400000021657151335517650015204 0ustar00<?php
/**
 * WooCommerce Analytics.
 * NOTE: DO NOT edit this file in WooCommerce core, this is generated from woocommerce-admin.
 */

namespace Automattic\WooCommerce\Admin\Features;

use Automattic\WooCommerce\Admin\Loader;
use Automattic\WooCommerce\Admin\API\Reports\Cache;
use Automattic\WooCommerce\Admin\Features\Features;

/**
 * Contains backend logic for the Analytics feature.
 */
class Analytics {
	/**
	 * Option name used to toggle this feature.
	 */
	const TOGGLE_OPTION_NAME = 'woocommerce_analytics_enabled';
	/**
	 * Clear cache tool identifier.
	 */
	const CACHE_TOOL_ID = 'clear_woocommerce_analytics_cache';

	/**
	 * Class instance.
	 *
	 * @var Analytics instance
	 */
	protected static $instance = null;

	/**
	 * Get class instance.
	 */
	public static function get_instance() {
		if ( ! self::$instance ) {
			self::$instance = new self();
		}
		return self::$instance;
	}

	/**
	 * Hook into WooCommerce.
	 */
	public function __construct() {
		add_filter( 'woocommerce_settings_features', array( $this, 'add_feature_toggle' ) );
		add_action( 'update_option_' . self::TOGGLE_OPTION_NAME, array( $this, 'reload_page_on_toggle' ), 10, 2 );

		if ( ! Features::is_enabled( 'analytics' ) ) {
			return;
		}

		add_filter( 'woocommerce_component_settings_preload_endpoints', array( $this, 'add_preload_endpoints' ) );
		add_filter( 'woocommerce_admin_get_user_data_fields', array( $this, 'add_user_data_fields' ) );
		add_action( 'admin_menu', array( $this, 'register_pages' ) );
		add_filter( 'woocommerce_debug_tools', array( $this, 'register_cache_clear_tool' ) );
	}

	/**
	 * Add the feature toggle to the features settings.
	 *
	 * @param array $features Feature sections.
	 * @return array
	 */
	public static function add_feature_toggle( $features ) {
		$description = __(
			'Enables WooCommerce Analytics',
			'woocommerce'
		);

		$features[] = array(
			'title'   => __( 'Analytics', 'woocommerce' ),
			'desc'    => $description,
			'id'      => self::TOGGLE_OPTION_NAME,
			'type'    => 'checkbox',
			'default' => 'yes',
			'class'   => '',
		);

		return $features;
	}

	/**
	 * Reloads the page when the option is toggled to make sure all Analytics features are loaded.
	 *
	 * @param string $old_value Old value.
	 * @param string $value     New value.
	 */
	public static function reload_page_on_toggle( $old_value, $value ) {
		if ( $old_value === $value ) {
			return;
		}

		if ( isset( $_SERVER['REQUEST_URI'] ) ) {
			wp_safe_redirect( wp_unslash( $_SERVER['REQUEST_URI'] ) );
			exit();
		}
	}

	/**
	 * Preload data from the countries endpoint.
	 *
	 * @param array $endpoints Array of preloaded endpoints.
	 * @return array
	 */
	public function add_preload_endpoints( $endpoints ) {
		$endpoints['countries']             = '/wc-analytics/data/countries';
		$endpoints['performanceIndicators'] = '/wc-analytics/reports/performance-indicators/allowed';
		$endpoints['leaderboards']          = '/wc-analytics/leaderboards/allowed';
		return $endpoints;
	}

	/**
	 * Adds fields so that we can store user preferences for the columns to display on a report.
	 *
	 * @param array $user_data_fields User data fields.
	 * @return array
	 */
	public function add_user_data_fields( $user_data_fields ) {
		return array_merge(
			$user_data_fields,
			array(
				'categories_report_columns',
				'coupons_report_columns',
				'customers_report_columns',
				'orders_report_columns',
				'products_report_columns',
				'revenue_report_columns',
				'taxes_report_columns',
				'variations_report_columns',
				'dashboard_sections',
				'dashboard_chart_type',
				'dashboard_chart_interval',
				'dashboard_leaderboard_rows',
			)
		);
	}

	/**
	 * Register the cache clearing tool on the WooCommerce > Status > Tools page.
	 *
	 * @param array $debug_tools Available debug tool registrations.
	 * @return array Filtered debug tool registrations.
	 */
	public function register_cache_clear_tool( $debug_tools ) {
		$settings_url = add_query_arg(
			array(
				'page' => 'wc-admin',
				'path' => '/analytics/settings',
			),
			get_admin_url( null, 'admin.php' )
		);

		$debug_tools[ self::CACHE_TOOL_ID ] = array(
			'name'     => __( 'Clear analytics cache', 'woocommerce' ),
			'button'   => __( 'Clear', 'woocommerce' ),
			'desc'     => sprintf(
				/* translators: 1: opening link tag, 2: closing tag */
				__( 'This tool will reset the cached values used in WooCommerce Analytics. If numbers still look off, try %1$sReimporting Historical Data%2$s.', 'woocommerce' ),
				'<a href="' . esc_url( $settings_url ) . '">',
				'</a>'
			),
			'callback' => array( $this, 'run_clear_cache_tool' ),
		);

		return $debug_tools;
	}

	/**
	 * Registers report pages.
	 */
	public function register_pages() {
		$report_pages = self::get_report_pages();
		foreach ( $report_pages as $report_page ) {
			if ( ! is_null( $report_page ) ) {
				wc_admin_register_page( $report_page );
			}
		}
	}

	/**
	 * Get report pages.
	 */
	public static function get_report_pages() {
		$overview_page = array(
			'id'       => 'woocommerce-analytics',
			'title'    => __( 'Analytics', 'woocommerce' ),
			'path'     => '/analytics/overview',
			'icon'     => 'dashicons-chart-bar',
			'position' => 56, // After WooCommerce & Product menu items.
		);

		$report_pages = array(
			$overview_page,
			array(
				'id'       => 'woocommerce-analytics-overview',
				'title'    => __( 'Overview', 'woocommerce' ),
				'parent'   => 'woocommerce-analytics',
				'path'     => '/analytics/overview',
				'nav_args' => array(
					'order'  => 10,
					'parent' => 'woocommerce-analytics',
				),
			),
			array(
				'id'       => 'woocommerce-analytics-products',
				'title'    => __( 'Products', 'woocommerce' ),
				'parent'   => 'woocommerce-analytics',
				'path'     => '/analytics/products',
				'nav_args' => array(
					'order'  => 20,
					'parent' => 'woocommerce-analytics',
				),
			),
			array(
				'id'       => 'woocommerce-analytics-revenue',
				'title'    => __( 'Revenue', 'woocommerce' ),
				'parent'   => 'woocommerce-analytics',
				'path'     => '/analytics/revenue',
				'nav_args' => array(
					'order'  => 30,
					'parent' => 'woocommerce-analytics',
				),
			),
			array(
				'id'       => 'woocommerce-analytics-orders',
				'title'    => __( 'Orders', 'woocommerce' ),
				'parent'   => 'woocommerce-analytics',
				'path'     => '/analytics/orders',
				'nav_args' => array(
					'order'  => 40,
					'parent' => 'woocommerce-analytics',
				),
			),
			array(
				'id'       => 'woocommerce-analytics-variations',
				'title'    => __( 'Variations', 'woocommerce' ),
				'parent'   => 'woocommerce-analytics',
				'path'     => '/analytics/variations',
				'nav_args' => array(
					'order'  => 50,
					'parent' => 'woocommerce-analytics',
				),
			),
			array(
				'id'       => 'woocommerce-analytics-categories',
				'title'    => __( 'Categories', 'woocommerce' ),
				'parent'   => 'woocommerce-analytics',
				'path'     => '/analytics/categories',
				'nav_args' => array(
					'order'  => 60,
					'parent' => 'woocommerce-analytics',
				),
			),
			array(
				'id'       => 'woocommerce-analytics-coupons',
				'title'    => __( 'Coupons', 'woocommerce' ),
				'parent'   => 'woocommerce-analytics',
				'path'     => '/analytics/coupons',
				'nav_args' => array(
					'order'  => 70,
					'parent' => 'woocommerce-analytics',
				),
			),
			array(
				'id'       => 'woocommerce-analytics-taxes',
				'title'    => __( 'Taxes', 'woocommerce' ),
				'parent'   => 'woocommerce-analytics',
				'path'     => '/analytics/taxes',
				'nav_args' => array(
					'order'  => 80,
					'parent' => 'woocommerce-analytics',
				),
			),
			array(
				'id'       => 'woocommerce-analytics-downloads',
				'title'    => __( 'Downloads', 'woocommerce' ),
				'parent'   => 'woocommerce-analytics',
				'path'     => '/analytics/downloads',
				'nav_args' => array(
					'order'  => 90,
					'parent' => 'woocommerce-analytics',
				),
			),
			'yes' === get_option( 'woocommerce_manage_stock' ) ? array(
				'id'       => 'woocommerce-analytics-stock',
				'title'    => __( 'Stock', 'woocommerce' ),
				'parent'   => 'woocommerce-analytics',
				'path'     => '/analytics/stock',
				'nav_args' => array(
					'order'  => 100,
					'parent' => 'woocommerce-analytics',
				),
			) : null,
			array(
				'id'     => 'woocommerce-analytics-customers',
				'title'  => __( 'Customers', 'woocommerce' ),
				'parent' => 'woocommerce',
				'path'   => '/customers',
			),
			array(
				'id'       => 'woocommerce-analytics-settings',
				'title'    => __( 'Settings', 'woocommerce' ),
				'parent'   => 'woocommerce-analytics',
				'path'     => '/analytics/settings',
				'nav_args' => array(
					'title'  => __( 'Analytics', 'woocommerce' ),
					'parent' => 'woocommerce-settings',
				),
			),
		);

		return apply_filters( 'woocommerce_analytics_report_menu_items', $report_pages );
	}

	/**
	 * "Clear" analytics cache by invalidating it.
	 */
	public function run_clear_cache_tool() {
		Cache::invalidate();

		return __( 'Analytics cache cleared.', 'woocommerce' );
	}
}
woocommerce-admin/src/Features/CouponsMovedTrait.php000064400000004233151335517650016671 0ustar00<?php
/**
 * A Trait to help with managing the legacy coupon menu.
 */

namespace Automattic\WooCommerce\Admin\Features;

use Automattic\WooCommerce\Admin\Features\Features;

/**
 * CouponsMovedTrait trait.
 */
trait CouponsMovedTrait {

	/**
	 * The GET query key for the legacy menu.
	 *
	 * @var string
	 */
	protected static $query_key = 'legacy_coupon_menu';

	/**
	 * The key for storing an option in the DB.
	 *
	 * @var string
	 */
	protected static $option_key = 'wc_admin_show_legacy_coupon_menu';

	/**
	 * Get the URL for the legacy coupon management.
	 *
	 * @return string The unescaped URL for the legacy coupon management page.
	 */
	protected static function get_legacy_coupon_url() {
		return self::get_coupon_url( [ self::$query_key => true ] );
	}

	/**
	 * Get the URL for the coupon management page.
	 *
	 * @param array $args Additional URL query arguments.
	 *
	 * @return string
	 */
	protected static function get_coupon_url( $args = [] ) {
		$args = array_merge(
			[
				'post_type' => 'shop_coupon',
			],
			$args
		);

		return add_query_arg( $args, admin_url( 'edit.php' ) );
	}

	/**
	 * Get the new URL for managing coupons.
	 *
	 * @param string $page The management page.
	 *
	 * @return string
	 */
	protected static function get_management_url( $page ) {
		$path = '';
		switch ( $page ) {
			case 'coupon':
			case 'coupons':
				return self::get_coupon_url();

			case 'marketing':
				$path = self::get_marketing_path();
				break;
		}

		return "wc-admin&path={$path}";
	}

	/**
	 * Get the WC Admin path for the marking page.
	 *
	 * @return string
	 */
	protected static function get_marketing_path() {
		return '/marketing/overview';
	}

	/**
	 * Whether we should display the legacy coupon menu item.
	 *
	 * @return bool
	 */
	protected static function should_display_legacy_menu() {
		return ( get_option( self::$option_key, 1 ) && ! Features::is_enabled( 'navigation' ) );
	}

	/**
	 * Set whether we should display the legacy coupon menu item.
	 *
	 * @param bool $display Whether the menu should be displayed or not.
	 */
	protected static function display_legacy_menu( $display = false ) {
		update_option( self::$option_key, $display ? 1 : 0 );
	}
}
woocommerce-admin/src/Features/CustomerEffortScoreTracks.php000064400000027157151335517650020371 0ustar00<?php
/**
 * WooCommerce Customer effort score tracks
 *
 * @package WooCommerce\Admin\Features
 */

namespace Automattic\WooCommerce\Admin\Features;

defined( 'ABSPATH' ) || exit;

/**
 * Triggers customer effort score on several different actions.
 */
class CustomerEffortScoreTracks {
	/**
	 * Option name for the CES Tracks queue.
	 */
	const CES_TRACKS_QUEUE_OPTION_NAME = 'woocommerce_ces_tracks_queue';

	/**
	 * Option name for the clear CES Tracks queue for page.
	 */
	const CLEAR_CES_TRACKS_QUEUE_FOR_PAGE_OPTION_NAME =
		'woocommerce_clear_ces_tracks_queue_for_page';

	/**
	 * Option name for the set of actions that have been shown.
	 */
	const SHOWN_FOR_ACTIONS_OPTION_NAME = 'woocommerce_ces_shown_for_actions';

	/**
	 * Action name for settings change.
	 */
	const SETTINGS_CHANGE_ACTION_NAME = 'settings_change';

	/**
	 * Action name for add product categories.
	 */
	const ADD_PRODUCT_CATEGORIES_ACTION_NAME = 'add_product_categories';

	/**
	 * Action name for add product tags.
	 */
	const ADD_PRODUCT_TAGS_ACTION_NAME = 'add_product_tags';

	/*
	 * Action name for add product attributes.
	 */
	const ADD_PRODUCT_ATTRIBUTES_ACTION_NAME = 'add_product_attributes';

	/**
	 * Action name for import products.
	 */
	const IMPORT_PRODUCTS_ACTION_NAME = 'import_products';

	/**
	 * Action name for search.
	 */
	const SEARCH_ACTION_NAME = 'ces_search';

	/**
	 * Label for the snackbar that appears when a user submits the survey.
	 *
	 * @var string
	 */
	private $onsubmit_label;

	/**
	 * Constructor. Sets up filters to hook into WooCommerce.
	 */
	public function __construct() {
		$this->enable_survey_enqueing_if_tracking_is_enabled();
	}

	/**
	 * Add actions that require woocommerce_allow_tracking.
	 */
	private function enable_survey_enqueing_if_tracking_is_enabled() {
		// Only hook up the action handlers if in wp-admin.
		if ( ! is_admin() ) {
			return;
		}

		// Do not hook up the action handlers if a mobile device is used.
		if ( wp_is_mobile() ) {
			return;
		}

		// Only enqueue a survey if tracking is allowed.
		$allow_tracking = 'yes' === get_option( 'woocommerce_allow_tracking', 'no' );
		if ( ! $allow_tracking ) {
			return;
		}

		add_action( 'admin_init', array( $this, 'maybe_clear_ces_tracks_queue' ) );
		add_action( 'woocommerce_update_options', array( $this, 'run_on_update_options' ), 10, 3 );
		add_action( 'product_cat_add_form', array( $this, 'add_script_track_product_categories' ), 10, 3 );
		add_action( 'product_tag_add_form', array( $this, 'add_script_track_product_tags' ), 10, 3 );
		add_action( 'woocommerce_attribute_added', array( $this, 'run_on_add_product_attributes' ), 10, 3 );
		add_action( 'load-edit.php', array( $this, 'run_on_load_edit_php' ), 10, 3 );
		add_action( 'product_page_product_importer', array( $this, 'run_on_product_import' ), 10, 3 );

		$this->onsubmit_label = __( 'Thank you for your feedback!', 'woocommerce' );
	}

	/**
	 * Returns a generated script for tracking tags added on edit-tags.php page.
	 * CES survey is triggered via direct access to wc/customer-effort-score store
	 * via wp.data.dispatch method.
	 *
	 * Due to lack of options to directly hook ourselves into the ajax post request
	 * initiated by edit-tags.php page, we infer a successful request by observing
	 * an increase of the number of rows in tags table
	 *
	 * @param string $action Action name for the survey.
	 * @param string $label Label for the snackbar.
	 *
	 * @return string Generated JavaScript to append to page.
	 */
	private function get_script_track_edit_php( $action, $label ) {
		return sprintf(
			"(function( $ ) {
				'use strict';
				// Hook on submit button and sets a 500ms interval function
				// to determine successful add tag or otherwise.
				$('#addtag #submit').on( 'click', function() {
					const initialCount = $('.tags tbody > tr').length;
					const interval = setInterval( function() {
						if ( $('.tags tbody > tr').length > initialCount ) {
							// New tag detected.
							clearInterval( interval );
							wp.data.dispatch('wc/customer-effort-score').addCesSurvey( '%s', '%s', window.pagenow, window.adminpage, '%s' );
						} else {
							// Form is no longer loading, most likely failed.
							if ( $( '#addtag .submit .spinner.is-active' ).length < 1 ) {
								clearInterval( interval );
							}
						}
					}, 500 );
				});
			})( jQuery );",
			esc_js( $action ),
			esc_js( $label ),
			esc_js( $this->onsubmit_label )
		);
	}

	/**
	 * Get the current published product count.
	 *
	 * @return integer The current published product count.
	 */
	private function get_product_count() {
		$query         = new \WC_Product_Query(
			array(
				'limit'    => 1,
				'paginate' => true,
				'return'   => 'ids',
				'status'   => array( 'publish' ),
			)
		);
		$products      = $query->get_products();
		$product_count = intval( $products->total );

		return $product_count;
	}

	/**
	 * Get the current shop order count.
	 *
	 * @return integer The current shop order count.
	 */
	private function get_shop_order_count() {
		$query            = new \WC_Order_Query(
			array(
				'limit'    => 1,
				'paginate' => true,
				'return'   => 'ids',
			)
		);
		$shop_orders      = $query->get_orders();
		$shop_order_count = intval( $shop_orders->total );

		return $shop_order_count;
	}

	/**
	 * Return whether the action has already been shown.
	 *
	 * @param string $action The action to check.
	 *
	 * @return bool Whether the action has already been shown.
	 */
	private function has_been_shown( $action ) {
		$shown_for_features = get_option( self::SHOWN_FOR_ACTIONS_OPTION_NAME, array() );
		$has_been_shown     = in_array( $action, $shown_for_features, true );

		return $has_been_shown;
	}

	/**
	 * Enqueue the item to the CES tracks queue.
	 *
	 * @param array $item The item to enqueue.
	 */
	private function enqueue_to_ces_tracks( $item ) {
		$queue = get_option(
			self::CES_TRACKS_QUEUE_OPTION_NAME,
			array()
		);

		$has_duplicate = array_filter(
			$queue,
			function ( $queue_item ) use ( $item ) {
				return $queue_item['action'] === $item['action'];
			}
		);
		if ( $has_duplicate ) {
			return;
		}

		$queue[] = $item;

		update_option(
			self::CES_TRACKS_QUEUE_OPTION_NAME,
			$queue
		);
	}

	/**
	 * Enqueue the CES survey on using search dynamically.
	 *
	 * @param string $search_area Search area such as "product" or "shop_order".
	 * @param string $page_now Value of window.pagenow.
	 * @param string $admin_page Value of window.adminpage.
	 */
	public function enqueue_ces_survey_for_search( $search_area, $page_now, $admin_page ) {
		if ( $this->has_been_shown( self::SEARCH_ACTION_NAME ) ) {
			return;
		}

		$this->enqueue_to_ces_tracks(
			array(
				'action'         => self::SEARCH_ACTION_NAME,
				'label'          => __(
					'How easy was it to use search?',
					'woocommerce'
				),
				'onsubmit_label' => $this->onsubmit_label,
				'pagenow'        => $page_now,
				'adminpage'      => $admin_page,
				'props'          => (object) array(
					'search_area' => $search_area,
				),
			)
		);
	}

	/**
	 * Maybe clear the CES tracks queue, executed on every page load. If the
	 * clear option is set it clears the queue. In practice, this executes a
	 * page load after the queued CES tracks are displayed on the client, which
	 * sets the clear option.
	 */
	public function maybe_clear_ces_tracks_queue() {
		$clear_ces_tracks_queue_for_page = get_option(
			self::CLEAR_CES_TRACKS_QUEUE_FOR_PAGE_OPTION_NAME,
			false
		);

		if ( ! $clear_ces_tracks_queue_for_page ) {
			return;
		}

		$queue           = get_option(
			self::CES_TRACKS_QUEUE_OPTION_NAME,
			array()
		);
		$remaining_items = array_filter(
			$queue,
			function ( $item ) use ( $clear_ces_tracks_queue_for_page ) {
				return $clear_ces_tracks_queue_for_page['pagenow'] !== $item['pagenow']
				|| $clear_ces_tracks_queue_for_page['adminpage'] !== $item['adminpage'];
			}
		);

		update_option(
			self::CES_TRACKS_QUEUE_OPTION_NAME,
			array_values( $remaining_items )
		);
		update_option( self::CLEAR_CES_TRACKS_QUEUE_FOR_PAGE_OPTION_NAME, false );
	}

	/**
	 * Appends a script to footer to trigger CES on adding product categories.
	 */
	public function add_script_track_product_categories() {
		if ( $this->has_been_shown( self::ADD_PRODUCT_CATEGORIES_ACTION_NAME ) ) {
			return;
		}

		wc_enqueue_js(
			$this->get_script_track_edit_php(
				self::ADD_PRODUCT_CATEGORIES_ACTION_NAME,
				__( 'How easy was it to add product category?', 'woocommerce' )
			)
		);
	}

	/**
	 * Appends a script to footer to trigger CES on adding product tags.
	 */
	public function add_script_track_product_tags() {
		if ( $this->has_been_shown( self::ADD_PRODUCT_TAGS_ACTION_NAME ) ) {
			return;
		}

		wc_enqueue_js(
			$this->get_script_track_edit_php(
				self::ADD_PRODUCT_TAGS_ACTION_NAME,
				__( 'How easy was it to add a product tag?', 'woocommerce' )
			)
		);
	}

	/**
	 * Maybe enqueue the CES survey on product import, if step is done.
	 */
	public function run_on_product_import() {
		// We're only interested in when the importer completes.
		if ( empty( $_GET['step'] ) || 'done' !== $_GET['step'] ) { // phpcs:ignore CSRF ok.
			return;
		}

		if ( $this->has_been_shown( self::IMPORT_PRODUCTS_ACTION_NAME ) ) {
			return;
		}

		$this->enqueue_to_ces_tracks(
			array(
				'action'         => self::IMPORT_PRODUCTS_ACTION_NAME,
				'label'          => __(
					'How easy was it to import products?',
					'woocommerce'
				),
				'onsubmit_label' => $this->onsubmit_label,
				'pagenow'        => 'product_page_product_importer',
				'adminpage'      => 'product_page_product_importer',
				'props'          => (object) array(),
			)
		);
	}

	/**
	 * Enqueue the CES survey trigger for setting changes.
	 */
	public function run_on_update_options() {
		// $current_tab is set when WC_Admin_Settings::save_settings is called.
		global $current_tab;
		global $current_section;

		if ( $this->has_been_shown( self::SETTINGS_CHANGE_ACTION_NAME ) ) {
			return;
		}

		$props = array(
			'settings_area' => $current_tab,
		);

		if ( $current_section ) {
			$props['settings_section'] = $current_section;
		}

		$this->enqueue_to_ces_tracks(
			array(
				'action'         => self::SETTINGS_CHANGE_ACTION_NAME,
				'label'          => __(
					'How easy was it to update your settings?',
					'woocommerce'
				),
				'onsubmit_label' => $this->onsubmit_label,
				'pagenow'        => 'woocommerce_page_wc-settings',
				'adminpage'      => 'woocommerce_page_wc-settings',
				'props'          => (object) $props,
			)
		);
	}

	/**
	 * Enqueue the CES survey on adding new product attributes.
	 */
	public function run_on_add_product_attributes() {
		if ( $this->has_been_shown( self::ADD_PRODUCT_ATTRIBUTES_ACTION_NAME ) ) {
			return;
		}

		$this->enqueue_to_ces_tracks(
			array(
				'action'         => self::ADD_PRODUCT_ATTRIBUTES_ACTION_NAME,
				'label'          => __(
					'How easy was it to add a product attribute?',
					'woocommerce'
				),
				'onsubmit_label' => $this->onsubmit_label,
				'pagenow'        => 'product_page_product_attributes',
				'adminpage'      => 'product_page_product_attributes',
				'props'          => (object) array(),
			)
		);
	}

	/**
	 * Determine on initiating CES survey on searching for product or orders.
	 */
	public function run_on_load_edit_php() {
		$allowed_types = array( 'product', 'shop_order' );
		$post_type     = get_current_screen()->post_type;

		// We're only interested for certain post types.
		if ( ! in_array( $post_type, $allowed_types, true ) ) {
			return;
		}

		// Determine whether request is search by "s" GET parameter.
		if ( empty( $_GET['s'] ) ) { // phpcs:disable WordPress.Security.NonceVerification.Recommended
			return;
		}

		$page_now = 'edit-' . $post_type;
		$this->enqueue_ces_survey_for_search( $post_type, $page_now, 'edit-php' );
	}
}
woocommerce-admin/src/Features/ShippingLabelBanner.php000064400000011150151335517650017107 0ustar00<?php
/**
 * WooCommerce Shipping Label banner.
 * NOTE: DO NOT edit this file in WooCommerce core, this is generated from woocommerce-admin.
 */

namespace Automattic\WooCommerce\Admin\Features;

use \Automattic\WooCommerce\Admin\Loader;
use \Automattic\Jetpack\Connection\Manager as Jetpack_Connection_Manager;

/**
 * Shows print shipping label banner on edit order page.
 */
class ShippingLabelBanner {

	/**
	 * Singleton for the display rules class
	 *
	 * @var ShippingLabelBannerDisplayRules
	 */
	private $shipping_label_banner_display_rules;

	/**
	 * Constructor
	 */
	public function __construct() {
		if ( ! is_admin() ) {
			return;
		}
		add_action( 'add_meta_boxes', array( $this, 'add_meta_boxes' ), 6, 2 );
	}

	/**
	 * Check if WooCommerce Shipping makes sense for this merchant.
	 *
	 * @return bool
	 */
	private function should_show_meta_box() {
		if ( ! $this->shipping_label_banner_display_rules ) {
			$jetpack_version   = null;
			$jetpack_connected = null;
			$wcs_version       = null;
			$wcs_tos_accepted  = null;

			if ( defined( 'JETPACK__VERSION' ) ) {
				$jetpack_version = JETPACK__VERSION;
			}

			if ( class_exists( Jetpack_Connection_Manager::class ) ) {
				$jetpack_connected = ( new Jetpack_Connection_Manager() )->is_active();
			}

			if ( class_exists( '\WC_Connect_Loader' ) ) {
				$wcs_version = \WC_Connect_Loader::get_wcs_version();
			}

			if ( class_exists( '\WC_Connect_Options' ) ) {
				$wcs_tos_accepted = \WC_Connect_Options::get_option( 'tos_accepted' );
			}

			$incompatible_plugins = class_exists( '\WC_Shipping_Fedex_Init' ) ||
				class_exists( '\WC_Shipping_UPS_Init' ) ||
				class_exists( '\WC_Integration_ShippingEasy' ) ||
				class_exists( '\WC_ShipStation_Integration' );

			$this->shipping_label_banner_display_rules =
				new ShippingLabelBannerDisplayRules(
					$jetpack_version,
					$jetpack_connected,
					$wcs_version,
					$wcs_tos_accepted,
					$incompatible_plugins
				);
		}

		return $this->shipping_label_banner_display_rules->should_display_banner();
	}

	/**
	 * Add metabox to order page.
	 *
	 * @param string   $post_type current post type.
	 * @param \WP_Post $post Current post object.
	 */
	public function add_meta_boxes( $post_type, $post ) {
		$order = wc_get_order( $post );
		if ( $this->should_show_meta_box() ) {
			add_meta_box(
				'woocommerce-admin-print-label',
				__( 'Shipping Label', 'woocommerce' ),
				array( $this, 'meta_box' ),
				null,
				'normal',
				'high',
				array(
					'context' => 'shipping_label',
					'order'   => $post->ID,
					'items'   => $this->count_shippable_items( $order ),
				)
			);
			add_action( 'admin_enqueue_scripts', array( $this, 'add_print_shipping_label_script' ) );
		}
	}

	/**
	 * Count shippable items
	 *
	 * @param \WC_Order $order Current order.
	 * @return int
	 */
	private function count_shippable_items( \WC_Order $order ) {
		$count = 0;
		foreach ( $order->get_items() as $item ) {
			if ( $item instanceof \WC_Order_Item_Product ) {
				$product = $item->get_product();
				if ( $product && $product->needs_shipping() ) {
					$count += $item->get_quantity();
				}
			}
		}
		return $count;
	}
	/**
	 * Adds JS to order page to render shipping banner.
	 *
	 * @param string $hook current page hook.
	 */
	public function add_print_shipping_label_script( $hook ) {
		$rtl = is_rtl() ? '.rtl' : '';
		wp_enqueue_style(
			'print-shipping-label-banner-style',
			Loader::get_url( "print-shipping-label-banner/style{$rtl}", 'css' ),
			array( 'wp-components' ),
			Loader::get_file_version( 'css' )
		);

		$script_assets_filename = Loader::get_script_asset_filename( 'wp-admin-scripts', 'print-shipping-label-banner' );
		$script_assets          = require WC_ADMIN_ABSPATH . WC_ADMIN_DIST_JS_FOLDER . 'wp-admin-scripts/' . $script_assets_filename;

		wp_enqueue_script(
			'print-shipping-label-banner',
			Loader::get_url( 'wp-admin-scripts/print-shipping-label-banner', 'js' ),
			array_merge( array( WC_ADMIN_APP ), $script_assets ['dependencies'] ),
			Loader::get_file_version( 'js' ),
			true
		);

		$payload = array(
			'nonce'                 => wp_create_nonce( 'wp_rest' ),
			'baseURL'               => get_rest_url(),
			'wcs_server_connection' => true,
		);

		wp_localize_script( 'print-shipping-label-banner', 'wcConnectData', $payload );
	}

	/**
	 * Render placeholder metabox.
	 *
	 * @param \WP_Post $post current post.
	 * @param array    $args empty args.
	 */
	public function meta_box( $post, $args ) {

		?>
		<div id="wc-admin-shipping-banner-root" class="woocommerce <?php echo esc_attr( 'wc-admin-shipping-banner' ); ?>" data-args="<?php echo esc_attr( wp_json_encode( $args['args'] ) ); ?>">
		</div>
		<?php
	}
}
woocommerce-admin/src/Features/RemoteInboxNotifications.php000064400000002003151335517650020222 0ustar00<?php
/**
 * Remote Inbox Notifications feature.
 * NOTE: DO NOT edit this file in WooCommerce core, this is generated from woocommerce-admin.
 */

namespace Automattic\WooCommerce\Admin\Features;

use Automattic\WooCommerce\Admin\Features\Features;
use \Automattic\WooCommerce\Admin\RemoteInboxNotifications\RemoteInboxNotificationsEngine;

/**
 * Remote Inbox Notifications feature logic.
 */
class RemoteInboxNotifications {
	/**
	 * Option name used to toggle this feature.
	 */
	const TOGGLE_OPTION_NAME = 'woocommerce_show_marketplace_suggestions';

	/**
	 * Class instance.
	 *
	 * @var RemoteInboxNotifications instance
	 */
	protected static $instance = null;

	/**
	 * Get class instance.
	 */
	public static function get_instance() {
		if ( ! self::$instance ) {
			self::$instance = new self();
		}
		return self::$instance;
	}

	/**
	 * Hook into WooCommerce.
	 */
	public function __construct() {
		if ( Features::is_enabled( 'remote-inbox-notifications' ) ) {
			RemoteInboxNotificationsEngine::init();
		}
	}
}
woocommerce-admin/src/Features/Onboarding.php000064400000100734151335517650015331 0ustar00<?php
/**
 * WooCommerce Onboarding
 * NOTE: DO NOT edit this file in WooCommerce core, this is generated from woocommerce-admin.
 */

namespace Automattic\WooCommerce\Admin\Features;

use \Automattic\WooCommerce\Admin\Loader;
use Automattic\WooCommerce\Admin\PageController;
use Automattic\WooCommerce\Admin\WCAdminHelper;
use Automattic\WooCommerce\Admin\Features\OnboardingTasks\Init as OnboardingTasks;
use Automattic\WooCommerce\Admin\Features\OnboardingTasks\TaskLists;
use Automattic\WooCommerce\Admin\Schedulers\MailchimpScheduler;

/**
 * Contains backend logic for the onboarding profile and checklist feature.
 */
class Onboarding {
	/**
	 * Class instance.
	 *
	 * @var Onboarding instance
	 */
	protected static $instance = null;

	/**
	 * Name of themes transient.
	 *
	 * @var string
	 */
	const THEMES_TRANSIENT = 'wc_onboarding_themes';

	/**
	 * Name of product data transient.
	 *
	 * @var string
	 */
	const PRODUCT_DATA_TRANSIENT = 'wc_onboarding_product_data';

	/**
	 * Profile data option name.
	 */
	const PROFILE_DATA_OPTION = 'woocommerce_onboarding_profile';

	/**
	 * Get class instance.
	 */
	public static function get_instance() {
		if ( ! self::$instance ) {
			self::$instance = new self();
		}
		return self::$instance;
	}

	/**
	 * Hook into WooCommerce.
	 */
	public function __construct() {
		$this->add_toggle_actions();

		OnboardingTasks::get_instance();

		// Add actions and filters.
		$this->add_actions();
		$this->add_filters();
	}

	/**
	 * Adds the ability to toggle the new onboarding experience on or off.
	 */
	private function add_toggle_actions() {
		add_action( 'woocommerce_updated', array( $this, 'maybe_mark_complete' ) );
		add_action( 'update_option_' . self::PROFILE_DATA_OPTION, array( $this, 'send_profile_data_on_update' ), 10, 2 );
		add_action( 'woocommerce_helper_connected', array( $this, 'send_profile_data_on_connect' ) );
	}

	/**
	 * Add onboarding actions.
	 */
	private function add_actions() {
		// Rest API hooks need to run before is_admin() checks.
		add_action( 'woocommerce_theme_installed', array( $this, 'delete_themes_transient' ) );
		add_action( 'after_switch_theme', array( $this, 'delete_themes_transient' ) );
		add_action(
			'update_option_' . self::PROFILE_DATA_OPTION,
			array(
				$this,
				'trigger_profile_completed_action',
			),
			10,
			2
		);
		add_action( 'woocommerce_admin_plugins_pre_activate', array( $this, 'activate_and_install_jetpack_ahead_of_wcpay' ) );
		add_action( 'woocommerce_admin_plugins_pre_install', array( $this, 'activate_and_install_jetpack_ahead_of_wcpay' ) );

		// Always hook into Jetpack connection even if outside of admin.
		add_action( 'jetpack_site_registered', array( $this, 'set_woocommerce_setup_jetpack_opted_in' ) );

		add_action( 'woocommerce_onboarding_profile_data_updated', array( $this, 'on_profile_data_updated' ), 10, 2 );

		if ( ! is_admin() ) {
			return;
		}

		add_action( 'admin_init', array( $this, 'admin_redirects' ) );
		add_action( 'current_screen', array( $this, 'add_help_tab' ), 60 );
		add_action( 'current_screen', array( $this, 'reset_profiler' ) );
		add_action( 'current_screen', array( $this, 'reset_task_list' ) );
		add_action( 'current_screen', array( $this, 'reset_extended_task_list' ) );
		add_action( 'current_screen', array( $this, 'redirect_wccom_install' ) );
		add_action( 'current_screen', array( $this, 'redirect_old_onboarding' ) );
	}

	/**
	 * Test whether the context of execution comes from async action scheduler.
	 * Note: this is a polyfill for wc_is_running_from_async_action_scheduler()
	 *       which was introduced in WC 4.0.
	 *
	 * @return bool
	 */
	public static function is_running_from_async_action_scheduler() {
		if ( function_exists( '\wc_is_running_from_async_action_scheduler' ) ) {
			return \wc_is_running_from_async_action_scheduler();
		}

		// phpcs:ignore WordPress.Security.NonceVerification.Recommended
		return isset( $_REQUEST['action'] ) && 'as_async_request_queue_runner' === $_REQUEST['action'];
	}

	/**
	 * Handle redirects to setup/welcome page after install and updates.
	 *
	 * For setup wizard, transient must be present, the user must have access rights, and we must ignore the network/bulk plugin updaters.
	 */
	public function admin_redirects() {
		// Don't run this fn from Action Scheduler requests, as it would clear _wc_activation_redirect transient.
		// That means OBW would never be shown.
		if ( self::is_running_from_async_action_scheduler() ) {
			return;
		}

		// Setup wizard redirect.
		if ( get_transient( '_wc_activation_redirect' ) && apply_filters( 'woocommerce_enable_setup_wizard', true ) ) {
			$do_redirect        = true;
			$current_page       = isset( $_GET['page'] ) ? wc_clean( wp_unslash( $_GET['page'] ) ) : false; // phpcs:ignore WordPress.Security.NonceVerification
			$is_onboarding_path = ! isset( $_GET['path'] ) || '/setup-wizard' === wc_clean( wp_unslash( $_GET['page'] ) ); // phpcs:ignore WordPress.Security.NonceVerification

			// On these pages, or during these events, postpone the redirect.
			if ( wp_doing_ajax() || is_network_admin() || ! current_user_can( 'manage_woocommerce' ) ) {
				$do_redirect = false;
			}

			// On these pages, or during these events, disable the redirect.
			if (
				( 'wc-admin' === $current_page && $is_onboarding_path ) ||
				apply_filters( 'woocommerce_prevent_automatic_wizard_redirect', false ) ||
				isset( $_GET['activate-multi'] ) // phpcs:ignore WordPress.Security.NonceVerification
			) {
				delete_transient( '_wc_activation_redirect' );
				$do_redirect = false;
			}

			if ( $do_redirect ) {
				delete_transient( '_wc_activation_redirect' );
				wp_safe_redirect( wc_admin_url() );
				exit;
			}
		}
	}

	/**
	 * Sets the woocommerce_setup_jetpack_opted_in to true when Jetpack connects to WPCOM.
	 */
	public function set_woocommerce_setup_jetpack_opted_in() {
		update_option( 'woocommerce_setup_jetpack_opted_in', true );
	}

	/**
	 * Trigger the woocommerce_onboarding_profile_completed action
	 *
	 * @param array $old_value Previous value.
	 * @param array $value Current value.
	 */
	public function trigger_profile_completed_action( $old_value, $value ) {
		if ( isset( $old_value['completed'] ) && $old_value['completed'] ) {
			return;
		}

		if ( ! isset( $value['completed'] ) || ! $value['completed'] ) {
			return;
		}

		/**
		 * Action hook fired when the onboarding profile (or onboarding wizard,
		 * or profiler) is completed.
		 *
		 * @since 1.5.0
		 */
		do_action( 'woocommerce_onboarding_profile_completed' );
	}

	/**
	 * Add onboarding filters.
	 */
	private function add_filters() {
		// Rest API hooks need to run before is_admin() checks.
		add_filter( 'woocommerce_rest_prepare_themes', array( $this, 'add_uploaded_theme_data' ) );

		if ( ! is_admin() ) {
			return;
		}

		// Old settings injection.
		// Run after Automattic\WooCommerce\Admin\Loader.
		add_filter( 'woocommerce_components_settings', array( $this, 'component_settings' ), 20 );
		// New settings injection.
		add_filter( 'woocommerce_admin_shared_settings', array( $this, 'component_settings' ), 20 );
		add_filter( 'woocommerce_admin_preload_settings', array( $this, 'preload_settings' ) );
		add_filter( 'woocommerce_admin_is_loading', array( $this, 'is_loading' ) );
		add_filter( 'woocommerce_show_admin_notice', array( $this, 'remove_install_notice' ), 10, 2 );
		add_filter( 'woocommerce_component_settings_preload_endpoints', array( $this, 'add_preload_endpoints' ) );
	}

	/**
	 * Preload data from the countries endpoint.
	 *
	 * @param array $endpoints Array of preloaded endpoints.
	 * @return array
	 */
	public function add_preload_endpoints( $endpoints ) {
		$endpoints['countries'] = '/wc-analytics/data/countries';
		return $endpoints;
	}

	/**
	 * Send profile data to WooCommerce.com.
	 */
	public static function send_profile_data() {
		if ( 'yes' !== get_option( 'woocommerce_allow_tracking', 'no' ) ) {
			return;
		}

		if ( ! class_exists( '\WC_Helper_API' ) || ! method_exists( '\WC_Helper_API', 'put' ) ) {
			return;
		}

		if ( ! class_exists( '\WC_Helper_Options' ) ) {
			return;
		}

		$auth = \WC_Helper_Options::get( 'auth' );
		if ( empty( $auth['access_token'] ) || empty( $auth['access_token_secret'] ) ) {
			return false;
		}

		$profile       = get_option( self::PROFILE_DATA_OPTION, array() );
		$base_location = wc_get_base_location();
		$defaults      = array(
			'plugins'             => 'skipped',
			'industry'            => array(),
			'product_types'       => array(),
			'product_count'       => '0',
			'selling_venues'      => 'no',
			'revenue'             => 'none',
			'other_platform'      => 'none',
			'business_extensions' => array(),
			'theme'               => get_stylesheet(),
			'setup_client'        => false,
			'store_location'      => $base_location['country'],
			'default_currency'    => get_woocommerce_currency(),
		);

		// Prepare industries as an array of slugs if they are in array format.
		if ( isset( $profile['industry'] ) && is_array( $profile['industry'] ) ) {
			$industry_slugs = array();
			foreach ( $profile['industry'] as $industry ) {
				$industry_slugs[] = is_array( $industry ) ? $industry['slug'] : $industry;
			}
			$profile['industry'] = $industry_slugs;
		}
		$body = wp_parse_args( $profile, $defaults );

		\WC_Helper_API::put(
			'profile',
			array(
				'authenticated' => true,
				'body'          => wp_json_encode( $body ),
				'headers'       => array(
					'Content-Type' => 'application/json',
				),
			)
		);
	}

	/**
	 * Send profiler data on profiler change to completion.
	 *
	 * @param array $old_value Previous value.
	 * @param array $value Current value.
	 */
	public static function send_profile_data_on_update( $old_value, $value ) {
		if ( ! isset( $value['completed'] ) || ! $value['completed'] ) {
			return;
		}

		self::send_profile_data();
	}

	/**
	 * Send profiler data after a site is connected.
	 */
	public static function send_profile_data_on_connect() {
		$profile = get_option( self::PROFILE_DATA_OPTION, array() );
		if ( ! isset( $profile['completed'] ) || ! $profile['completed'] ) {
			return;
		}

		self::send_profile_data();
	}

	/**
	 * Redirect the old onboarding wizard to the profiler.
	 */
	public static function redirect_old_onboarding() {
		$current_page = isset( $_GET['page'] ) ? wc_clean( wp_unslash( $_GET['page'] ) ) : false; // phpcs:ignore csrf okay.

		if ( 'wc-setup' === $current_page ) {
			delete_transient( '_wc_activation_redirect' );
			wp_safe_redirect( wc_admin_url( '&reset_profiler=1' ) );
		}
	}

	/**
	 * Returns true if the profiler should be displayed (not completed and not skipped).
	 *
	 * @return bool
	 */
	public static function should_show_profiler() {
		/* phpcs:disable WordPress.Security.NonceVerification */
		$is_current_page = isset( $_GET['page'] ) &&
			'wc-admin' === $_GET['page'] &&
			isset( $_GET['path'] ) &&
			'/setup-wizard' === $_GET['path'];
		/* phpcs: enable */

		if ( $is_current_page ) {
			return true;
		}

		$onboarding_data = get_option( self::PROFILE_DATA_OPTION, array() );

		$is_completed = isset( $onboarding_data['completed'] ) && true === $onboarding_data['completed'];
		$is_skipped   = isset( $onboarding_data['skipped'] ) && true === $onboarding_data['skipped'];

		// @todo When merging to WooCommerce Core, we should set the `completed` flag to true during the upgrade progress.
		// https://github.com/woocommerce/woocommerce-admin/pull/2300#discussion_r287237498.
		return ! $is_completed && ! $is_skipped;
	}

	/**
	 * Returns true if the task list should be displayed (not completed or hidden off the dashboard).
	 *
	 * @deprecated 2.7.0
	 * @return bool
	 */
	public static function should_show_tasks() {
		wc_deprecated_function( 'should_show_tasks', '4.4', '\Automattic\WooCommerce\Admin\Features\OnboardingTasks\TaskLists::get_list( $list_id )->is_hidden()' );

		$setup_list    = TaskLists::get_list( 'setup' );
		$extended_list = TaskLists::get_list( 'extended' );

		return ( $setup_list && ! $setup_list->is_hidden() ) || ( $extended_list && ! $extended_list->is_hidden() );
	}

	/**
	 * Get a list of allowed industries for the onboarding wizard.
	 *
	 * @return array
	 */
	public static function get_allowed_industries() {
		/* With "use_description" we turn the description input on. With "description_label" we set the input label */
		return apply_filters(
			'woocommerce_admin_onboarding_industries',
			array(
				'fashion-apparel-accessories'     => array(
					'label'             => __( 'Fashion, apparel, and accessories', 'woocommerce' ),
					'use_description'   => false,
					'description_label' => '',
				),
				'health-beauty'                   => array(
					'label'             => __( 'Health and beauty', 'woocommerce' ),
					'use_description'   => false,
					'description_label' => '',
				),
				'electronics-computers'           => array(
					'label'             => __( 'Electronics and computers', 'woocommerce' ),
					'use_description'   => false,
					'description_label' => '',
				),
				'food-drink'                      => array(
					'label'             => __( 'Food and drink', 'woocommerce' ),
					'use_description'   => false,
					'description_label' => '',
				),
				'home-furniture-garden'           => array(
					'label'             => __( 'Home, furniture, and garden', 'woocommerce' ),
					'use_description'   => false,
					'description_label' => '',
				),
				'cbd-other-hemp-derived-products' => array(
					'label'             => __( 'CBD and other hemp-derived products', 'woocommerce' ),
					'use_description'   => false,
					'description_label' => '',
				),
				'education-and-learning'          => array(
					'label'             => __( 'Education and learning', 'woocommerce' ),
					'use_description'   => false,
					'description_label' => '',
				),
				'other'                           => array(
					'label'             => __( 'Other', 'woocommerce' ),
					'use_description'   => true,
					'description_label' => __( 'Description', 'woocommerce' ),
				),
			)
		);
	}

	/**
	 * Get a list of allowed product types for the onboarding wizard.
	 *
	 * @return array
	 */
	public static function get_allowed_product_types() {
		$products      = array(
			'physical'        => array(
				'label'   => __( 'Physical products', 'woocommerce' ),
				'default' => true,
			),
			'downloads'       => array(
				'label' => __( 'Downloads', 'woocommerce' ),
			),
			'subscriptions'   => array(
				'label' => __( 'Subscriptions', 'woocommerce' ),
			),
			'memberships'     => array(
				'label'   => __( 'Memberships', 'woocommerce' ),
				'product' => 958589,
			),
			'bookings'        => array(
				'label'   => __( 'Bookings', 'woocommerce' ),
				'product' => 390890,
			),
			'product-bundles' => array(
				'label'   => __( 'Bundles', 'woocommerce' ),
				'product' => 18716,
			),
			'product-add-ons' => array(
				'label'   => __( 'Customizable products', 'woocommerce' ),
				'product' => 18618,
			),
		);
		$base_location = wc_get_base_location();
		if ( ! Features::is_enabled( 'subscriptions' ) || 'US' !== $base_location['country'] ) {
			$products['subscriptions']['product'] = 27147;
		}
		$product_types = self::append_product_data( $products );

		return apply_filters( 'woocommerce_admin_onboarding_product_types', $product_types );
	}

	/**
	 * Sort themes returned from WooCommerce.com
	 *
	 * @param  array $themes Array of themes from WooCommerce.com.
	 * @return array
	 */
	public static function sort_woocommerce_themes( $themes ) {
		usort(
			$themes,
			function ( $product_1, $product_2 ) {
				if ( ! property_exists( $product_1, 'id' ) || ! property_exists( $product_1, 'slug' ) ) {
					return 1;
				}
				if ( ! property_exists( $product_2, 'id' ) || ! property_exists( $product_2, 'slug' ) ) {
					return 1;
				}
				if ( in_array( 'Storefront', array( $product_1->slug, $product_2->slug ), true ) ) {
					return 'Storefront' === $product_1->slug ? -1 : 1;
				}
				return $product_1->id < $product_2->id ? 1 : -1;
			}
		);
		return $themes;
	}

	/**
	 * Get a list of themes for the onboarding wizard.
	 *
	 * @return array
	 */
	public static function get_themes() {
		$themes = get_transient( self::THEMES_TRANSIENT );
		if ( false === $themes ) {
			$theme_data = wp_remote_get( 'https://woocommerce.com/wp-json/wccom-extensions/1.0/search?category=themes' );
			$themes     = array();

			if ( ! is_wp_error( $theme_data ) ) {
				$theme_data    = json_decode( $theme_data['body'] );
				$woo_themes    = property_exists( $theme_data, 'products' ) ? $theme_data->products : array();
				$sorted_themes = self::sort_woocommerce_themes( $woo_themes );

				foreach ( $sorted_themes as $theme ) {
					$slug                                       = sanitize_title_with_dashes( $theme->slug );
					$themes[ $slug ]                            = (array) $theme;
					$themes[ $slug ]['is_installed']            = false;
					$themes[ $slug ]['has_woocommerce_support'] = true;
					$themes[ $slug ]['slug']                    = $slug;
				}
			}

			$installed_themes = wp_get_themes();
			$active_theme     = get_option( 'stylesheet' );

			foreach ( $installed_themes as $slug => $theme ) {
				$theme_data      = self::get_theme_data( $theme );
				$themes[ $slug ] = $theme_data;
			}

			// Add the WooCommerce support tag for default themes that don't explicitly declare support.
			if ( function_exists( 'wc_is_wp_default_theme_active' ) && wc_is_wp_default_theme_active() ) {
				$themes[ $active_theme ]['has_woocommerce_support'] = true;
			}

			$themes = array( $active_theme => $themes[ $active_theme ] ) + $themes;

			set_transient( self::THEMES_TRANSIENT, $themes, DAY_IN_SECONDS );
		}

		$themes = apply_filters( 'woocommerce_admin_onboarding_themes', $themes );
		return array_values( $themes );
	}

	/**
	 * Get theme data used in onboarding theme browser.
	 *
	 * @param WP_Theme $theme Theme to gather data from.
	 * @return array
	 */
	public static function get_theme_data( $theme ) {
		return array(
			'slug'                    => sanitize_text_field( $theme->stylesheet ),
			'title'                   => $theme->get( 'Name' ),
			'price'                   => '0.00',
			'is_installed'            => true,
			'image'                   => $theme->get_screenshot(),
			'has_woocommerce_support' => true,
		);
	}

	/**
	 * Add theme data to response from themes controller.
	 *
	 * @param WP_REST_Response $response Rest response.
	 * @return WP_REST_Response
	 */
	public static function add_uploaded_theme_data( $response ) {
		if ( ! isset( $response->data['theme'] ) ) {
			return $response;
		}

		$theme                        = wp_get_theme( $response->data['theme'] );
		$response->data['theme_data'] = self::get_theme_data( $theme );

		return $response;
	}

	/**
	 * Check if theme has declared support for WooCommerce.
	 *
	 * @param WP_Theme $theme Theme to check.
	 * @link https://developer.woocommerce.com/2017/12/09/wc-3-3-will-look-great-on-all-the-themes/
	 * @deprecated 2.2.0
	 * @return bool
	 */
	public static function has_woocommerce_support( $theme ) {
		wc_deprecated_function( 'Onboarding::has_woocommerce_support', '5.3' ); // Deprecated since WooCommerce 5.3.
		return true; // All themes are supported since WooCommerce 3.3.
	}

	/**
	 * Append dynamic product data from API.
	 *
	 * @param array $product_types Array of product types.
	 * @return array
	 */
	public static function append_product_data( $product_types ) {
		$woocommerce_products = get_transient( self::PRODUCT_DATA_TRANSIENT );
		if ( false === $woocommerce_products ) {
			$woocommerce_products = wp_remote_get( 'https://woocommerce.com/wp-json/wccom-extensions/1.0/search' );
			if ( is_wp_error( $woocommerce_products ) ) {
				return $product_types;
			}

			set_transient( self::PRODUCT_DATA_TRANSIENT, $woocommerce_products, DAY_IN_SECONDS );
		}

		$product_data = json_decode( $woocommerce_products['body'] );
		$products     = array();

		// Map product data by ID.
		if ( isset( $product_data ) && isset( $product_data->products ) ) {
			foreach ( $product_data->products as $product_datum ) {
				if ( isset( $product_datum->id ) ) {
					$products[ $product_datum->id ] = $product_datum;
				}
			}
		}

		// Loop over product types and append data.
		foreach ( $product_types as $key => $product_type ) {
			if ( isset( $product_type['product'] ) && isset( $products[ $product_type['product'] ] ) ) {
				$price        = html_entity_decode( $products[ $product_type['product'] ]->price );
				$yearly_price = (float) str_replace( '$', '', $price );

				$product_types[ $key ]['yearly_price'] = $yearly_price;
				$product_types[ $key ]['description']  = $products[ $product_type['product'] ]->excerpt;
				$product_types[ $key ]['more_url']     = $products[ $product_type['product'] ]->link;
				$product_types[ $key ]['slug']         = strtolower( preg_replace( '~[^\pL\d]+~u', '-', $products[ $product_type['product'] ]->slug ) );
			} elseif ( isset( $product_type['product'] ) ) {
				/* translators: site currency symbol (used to show that the product costs money) */
				$product_types[ $key ]['label'] .= sprintf( __( ' — %s', 'woocommerce' ), html_entity_decode( get_woocommerce_currency_symbol() ) );
			}
		}

		return $product_types;
	}

	/**
	 * Delete the stored themes transient.
	 */
	public static function delete_themes_transient() {
		delete_transient( self::THEMES_TRANSIENT );
	}

	/**
	 * Determine if the current page is one of the WC Admin pages.
	 *
	 * @return bool
	 */
	protected function is_wc_pages() {
		$current_page = PageController::get_instance()->get_current_page();
		if ( ! $current_page || ! isset( $current_page['path'] ) ) {
			return false;
		}

		return 0 === strpos( $current_page['path'], 'wc-admin' );
	}

	/**
	 * Add profiler items to component settings.
	 *
	 * @param array $settings Component settings.
	 *
	 * @return array
	 */
	public function component_settings( $settings ) {
		$profile                = (array) get_option( self::PROFILE_DATA_OPTION, array() );
		$settings['onboarding'] = array(
			'profile' => $profile,
		);

		// Only fetch if the onboarding wizard OR the task list is incomplete or currently shown
		// or the current page is one of the WooCommerce Admin pages.
		if (
			( ! self::should_show_profiler() && ! count( TaskLists::get_visible() )
			||
			! $this->is_wc_pages()
		)
		) {
			return $settings;
		}

		include_once WC_ABSPATH . 'includes/admin/helper/class-wc-helper-options.php';
		$wccom_auth                 = \WC_Helper_Options::get( 'auth' );
		$profile['wccom_connected'] = empty( $wccom_auth['access_token'] ) ? false : true;

		$settings['onboarding']['activeTheme']     = get_option( 'stylesheet' );
		$settings['onboarding']['currencySymbols'] = get_woocommerce_currency_symbols();
		$settings['onboarding']['euCountries']     = WC()->countries->get_european_union_countries();
		$settings['onboarding']['industries']      = self::get_allowed_industries();
		$settings['onboarding']['localeInfo']      = include WC()->plugin_path() . '/i18n/locale-info.php';
		$settings['onboarding']['profile']         = $profile;
		$settings['onboarding']['themes']          = self::get_themes();

		return $settings;
	}

	/**
	 * Preload WC setting options to prime state of the application.
	 *
	 * @param array $options Array of options to preload.
	 * @return array
	 */
	public function preload_settings( $options ) {
		$options[] = 'general';

		return $options;
	}

	/**
	 * Gets an array of themes that can be installed & activated via the onboarding wizard.
	 *
	 * @return array
	 */
	public static function get_allowed_themes() {
		$allowed_themes = array();
		$themes         = self::get_themes();

		foreach ( $themes as $theme ) {
			$price = preg_replace( '/&#?[a-z0-9]+;/i', '', $theme['price'] );

			if ( $theme['is_installed'] || '0.00' === $price ) {
				$allowed_themes[] = $theme['slug'];
			}
		}

		return apply_filters( 'woocommerce_admin_onboarding_themes_whitelist', $allowed_themes );
	}

	/**
	 * Let the app know that we will be showing the onboarding route, so wp-admin elements should be hidden while loading.
	 *
	 * @param bool $is_loading Indicates if the `woocommerce-admin-is-loading` should be appended or not.
	 * @return bool
	 */
	public function is_loading( $is_loading ) {
		$show_profiler = self::should_show_profiler();

		if ( $show_profiler ) {
			return true;
		}

		return $is_loading;
	}

	/**
	 * Track changes to the onboarding option.
	 *
	 * @param mixed  $mixed Option name or previous value if option previously existed.
	 * @param string $value Value of the updated option.
	 */
	public static function track_onboarding_toggle( $mixed, $value ) {
		if ( defined( 'WC_ADMIN_MIGRATING_OPTIONS' ) && WC_ADMIN_MIGRATING_OPTIONS ) {
			return;
		};

		wc_admin_record_tracks_event(
			'onboarding_toggled',
			array(
				'previous_value' => ! $value,
				'new_value'      => $value,
			)
		);
	}

	/**
	 * Update the help tab setup link to reset the onboarding profiler.
	 */
	public static function add_help_tab() {
		if ( ! function_exists( 'wc_get_screen_ids' ) ) {
			return;
		}

		$screen = get_current_screen();

		if ( ! $screen || ! in_array( $screen->id, wc_get_screen_ids(), true ) ) {
			return;
		}

		// Remove the old help tab if it exists.
		$help_tabs = $screen->get_help_tabs();
		foreach ( $help_tabs as $help_tab ) {
			if ( 'woocommerce_onboard_tab' !== $help_tab['id'] ) {
				continue;
			}

			$screen->remove_help_tab( 'woocommerce_onboard_tab' );
		}

		// Add the new help tab.
		$help_tab = array(
			'title' => __( 'Setup wizard', 'woocommerce' ),
			'id'    => 'woocommerce_onboard_tab',
		);

		$setup_list    = TaskLists::get_list( 'setup' );
		$extended_list = TaskLists::get_list( 'extended' );

		if ( $setup_list ) {
			$help_tab['content'] = '<h2>' . __( 'WooCommerce Onboarding', 'woocommerce' ) . '</h2>';

			$help_tab['content'] .= '<h3>' . __( 'Profile Setup Wizard', 'woocommerce' ) . '</h3>';
			$help_tab['content'] .= '<p>' . __( 'If you need to access the setup wizard again, please click on the button below.', 'woocommerce' ) . '</p>' .
				'<p><a href="' . wc_admin_url( '&path=/setup-wizard' ) . '" class="button button-primary">' . __( 'Setup wizard', 'woocommerce' ) . '</a></p>';

			$help_tab['content'] .= '<h3>' . __( 'Task List', 'woocommerce' ) . '</h3>';
			$help_tab['content'] .= '<p>' . __( 'If you need to enable or disable the task lists, please click on the button below.', 'woocommerce' ) . '</p>' .
			( $setup_list->is_hidden()
				? '<p><a href="' . wc_admin_url( '&reset_task_list=1' ) . '" class="button button-primary">' . __( 'Enable', 'woocommerce' ) . '</a></p>'
				: '<p><a href="' . wc_admin_url( '&reset_task_list=0' ) . '" class="button button-primary">' . __( 'Disable', 'woocommerce' ) . '</a></p>'
			);
		}

		if ( $extended_list ) {
			$help_tab['content'] .= '<h3>' . __( 'Extended task List', 'woocommerce' ) . '</h3>';
			$help_tab['content'] .= '<p>' . __( 'If you need to enable or disable the extended task lists, please click on the button below.', 'woocommerce' ) . '</p>' .
			( $extended_list->is_hidden()
				? '<p><a href="' . wc_admin_url( '&reset_extended_task_list=1' ) . '" class="button button-primary">' . __( 'Enable', 'woocommerce' ) . '</a></p>'
				: '<p><a href="' . wc_admin_url( '&reset_extended_task_list=0' ) . '" class="button button-primary">' . __( 'Disable', 'woocommerce' ) . '</a></p>'
			);
		}

		$screen->add_help_tab( $help_tab );
	}

	/**
	 * Reset the onboarding profiler and redirect to the profiler.
	 */
	public static function reset_profiler() {
		if (
			! Loader::is_admin_page() ||
			! isset( $_GET['reset_profiler'] ) // phpcs:ignore CSRF ok.
		) {
			return;
		}

		$previous  = 1 === absint( $_GET['reset_profiler'] ); // phpcs:ignore CSRF ok.
		$new_value = ! $previous;

		wc_admin_record_tracks_event(
			'storeprofiler_toggled',
			array(
				'previous'  => $previous,
				'new_value' => $new_value,
			)
		);

		$request = new \WP_REST_Request( 'POST', '/wc-admin/onboarding/profile' );
		$request->set_headers( array( 'content-type' => 'application/json' ) );
		$request->set_body(
			wp_json_encode(
				array(
					'completed' => $new_value,
					'skipped'   => $new_value,
				)
			)
		);
		$response = rest_do_request( $request );
		wp_safe_redirect( wc_admin_url() );
		exit;
	}

	/**
	 * Reset the onboarding task list and redirect to the dashboard.
	 */
	public static function reset_task_list() {
		if (
			! Loader::is_admin_page() ||
			! isset( $_GET['reset_task_list'] ) // phpcs:ignore CSRF ok.
		) {
			return;
		}

		$task_list = TaskLists::get_list( 'setup' );

		if ( ! $task_list ) {
			return;
		}
		$show   = 1 === absint( $_GET['reset_task_list'] );
		$update = $show ? $task_list->show() : $task_list->hide(); // phpcs:ignore CSRF ok.

		if ( $update ) {
			wc_admin_record_tracks_event(
				'tasklist_toggled',
				array(
					'status' => $show ? 'disabled' : 'enabled',
				)
			);
		}

		wp_safe_redirect( wc_admin_url() );
		exit;
	}

	/**
	 * Reset the extended task list and redirect to the dashboard.
	 */
	public static function reset_extended_task_list() {
		if (
			! Loader::is_admin_page() ||
			! isset( $_GET['reset_extended_task_list'] ) // phpcs:ignore CSRF ok.
		) {
			return;
		}

		$task_list = TaskLists::get_list( 'extended' );

		if ( ! $task_list ) {
			return;
		}
		$show   = 1 === absint( $_GET['reset_extended_task_list'] );
		$update = $show ? $task_list->show() : $task_list->hide(); // phpcs:ignore CSRF ok.

		if ( $update ) {
			wc_admin_record_tracks_event(
				'extended_tasklist_toggled',
				array(
					'status' => $show ? 'disabled' : 'enabled',
				)
			);
		}

		wp_safe_redirect( wc_admin_url() );
		exit;
	}

	/**
	 * Remove the install notice that prompts the user to visit the old onboarding setup wizard.
	 *
	 * @param bool   $show Show or hide the notice.
	 * @param string $notice The slug of the notice.
	 * @return bool
	 */
	public static function remove_install_notice( $show, $notice ) {
		if ( 'install' === $notice ) {
			return false;
		}

		return $show;
	}

	/**
	 * Redirects the user to the task list if the task list is enabled and finishing a wccom checkout.
	 *
	 * @todo Once URL params are added to the redirect, we can check those instead of the referer.
	 */
	public static function redirect_wccom_install() {
		$task_list = TaskLists::get_list( 'setup' );

		if (
			! $task_list ||
			$task_list->is_hidden() ||
			! isset( $_SERVER['HTTP_REFERER'] ) ||
			0 !== strpos( $_SERVER['HTTP_REFERER'], 'https://woocommerce.com/checkout?utm_medium=product' ) // phpcs:ignore sanitization ok.
		) {
			return;
		}

		wp_safe_redirect( wc_admin_url() );
	}

	/**
	 * When updating WooCommerce, mark the profiler and task list complete.
	 *
	 * @todo The `maybe_enable_setup_wizard()` method should be revamped on onboarding enable in core.
	 * See https://github.com/woocommerce/woocommerce/blob/1ca791f8f2325fe2ee0947b9c47e6a4627366374/includes/class-wc-install.php#L341
	 */
	public static function maybe_mark_complete() {
		// The install notice still exists so don't complete the profiler.
		if ( ! class_exists( 'WC_Admin_Notices' ) || \WC_Admin_Notices::has_notice( 'install' ) ) {
			return;
		}

		$onboarding_data = get_option( self::PROFILE_DATA_OPTION, array() );
		// Don't make updates if the profiler is completed or skipped, but task list is potentially incomplete.
		if (
			( isset( $onboarding_data['completed'] ) && $onboarding_data['completed'] ) ||
			( isset( $onboarding_data['skipped'] ) && $onboarding_data['skipped'] )
		) {
			return;
		}

		$onboarding_data['completed'] = true;
		update_option( self::PROFILE_DATA_OPTION, $onboarding_data );

		if ( ! WCAdminHelper::is_wc_admin_active_for( DAY_IN_SECONDS ) ) {
			$task_list = TaskLists::get_list( 'setup' );
			if ( ! $task_list ) {
				return;
			}
			$task_list->hide();
		}
	}

	/**
	 * Ensure that Jetpack gets installed and activated ahead of WooCommerce Payments
	 * if both are being installed/activated at the same time.
	 *
	 * See: https://github.com/Automattic/woocommerce-payments/issues/1663
	 * See: https://github.com/Automattic/jetpack/issues/19624
	 *
	 * @param array $plugins A list of plugins to install or activate.
	 *
	 * @return array
	 */
	public static function activate_and_install_jetpack_ahead_of_wcpay( $plugins ) {
		if ( in_array( 'jetpack', $plugins, true ) && in_array( 'woocommerce-payments', $plugins, true ) ) {
			array_unshift( $plugins, 'jetpack' );
			$plugins = array_unique( $plugins );
		}
		return $plugins;
	}

	/**
	 * Delete MailchimpScheduler::SUBSCRIBED_OPTION_NAME option if profile data is being updated with a new email.
	 *
	 * @param array $existing_data Existing option data.
	 * @param array $updating_data Updating option data.
	 */
	public function on_profile_data_updated( $existing_data, $updating_data ) {
		if (
			isset( $existing_data['store_email'] ) &&
			isset( $updating_data['store_email'] ) &&
			$existing_data['store_email'] !== $updating_data['store_email']
		) {
			delete_option( MailchimpScheduler::SUBSCRIBED_OPTION_NAME );
		}
	}
}
woocommerce-admin/src/Features/Homescreen.php000064400000012207151335517650015334 0ustar00<?php
/**
 * WooCommerce Homescreen.
 * NOTE: DO NOT edit this file in WooCommerce core, this is generated from woocommerce-admin.
 */

namespace Automattic\WooCommerce\Admin\Features;

use Automattic\WooCommerce\Admin\Loader;

/**
 * Contains backend logic for the homescreen feature.
 */
class Homescreen {
	/**
	 * Menu slug.
	 */
	const MENU_SLUG = 'wc-admin';

	/**
	 * Class instance.
	 *
	 * @var Homescreen instance
	 */
	protected static $instance = null;

	/**
	 * Get class instance.
	 */
	public static function get_instance() {
		if ( ! self::$instance ) {
			self::$instance = new self();
		}
		return self::$instance;
	}

	/**
	 * Hook into WooCommerce.
	 */
	public function __construct() {
		add_filter( 'woocommerce_admin_get_user_data_fields', array( $this, 'add_user_data_fields' ) );
		add_action( 'admin_menu', array( $this, 'register_page' ) );
		// In WC Core 5.1 $submenu manipulation occurs in admin_menu, not admin_head. See https://github.com/woocommerce/woocommerce/pull/29088.
		if ( version_compare( WC_VERSION, '5.1', '>=' ) ) {
			// priority is 20 to run after admin_menu hook for woocommerce runs, so that submenu is populated.
			add_action( 'admin_menu', array( $this, 'possibly_remove_woocommerce_menu' ) );
			add_action( 'admin_menu', array( $this, 'update_link_structure' ), 20 );
		} else {
			// priority is 20 to run after https://github.com/woocommerce/woocommerce/blob/a55ae325306fc2179149ba9b97e66f32f84fdd9c/includes/admin/class-wc-admin-menus.php#L165.
			add_action( 'admin_head', array( $this, 'update_link_structure' ), 20 );
		}
		add_filter( 'woocommerce_admin_preload_options', array( $this, 'preload_options' ) );

		add_filter( 'woocommerce_admin_shared_settings', array( $this, 'component_settings' ), 20 );
	}

	/**
	 * Adds fields so that we can store performance indicators, row settings, and chart type settings for users.
	 *
	 * @param array $user_data_fields User data fields.
	 * @return array
	 */
	public function add_user_data_fields( $user_data_fields ) {
		return array_merge(
			$user_data_fields,
			array(
				'homepage_layout',
				'homepage_stats',
				'task_list_tracked_started_tasks',
				'help_panel_highlight_shown',
			)
		);
	}

	/**
	 * Registers home page.
	 */
	public function register_page() {
		// Register a top-level item for users who cannot view the core WooCommerce menu.
		if ( ! $this->is_admin_user() ) {
			wc_admin_register_page(
				array(
					'id'         => 'woocommerce-home',
					'title'      => __( 'WooCommerce', 'woocommerce' ),
					'path'       => self::MENU_SLUG,
					'capability' => 'read',
				)
			);
			return;
		}

		wc_admin_register_page(
			array(
				'id'         => 'woocommerce-home',
				'title'      => __( 'Home', 'woocommerce' ),
				'parent'     => 'woocommerce',
				'path'       => self::MENU_SLUG,
				'order'      => 0,
				'capability' => 'read',
			)
		);
	}

	/**
	 * Check if the user can access the top-level WooCommerce item.
	 */
	public function is_admin_user() {
		return current_user_can( 'edit_others_shop_orders' ) || current_user_can( 'manage_woocommerce' );
	}

	/**
	 * Possibly remove the WooCommerce menu item if it was purely used to access wc-admin pages.
	 */
	public function possibly_remove_woocommerce_menu() {
		global $menu;

		if ( $this->is_admin_user() ) {
			return;
		}

		foreach ( $menu as $key => $menu_item ) {
			if ( self::MENU_SLUG !== $menu_item[2] || 'read' !== $menu_item[1] ) {
				continue;
			}

			unset( $menu[ $key ] );
		}
	}

	/**
	 * Update the WooCommerce menu structure to make our main dashboard/handler
	 * the top level link for 'WooCommerce'.
	 */
	public function update_link_structure() {
		global $submenu;
		// User does not have capabilites to see the submenu.
		if ( ! current_user_can( 'manage_woocommerce' ) || empty( $submenu['woocommerce'] ) ) {
			return;
		}

		$wc_admin_key = null;
		foreach ( $submenu['woocommerce'] as $submenu_key => $submenu_item ) {
			if ( self::MENU_SLUG === $submenu_item[2] ) {
				$wc_admin_key = $submenu_key;
				break;
			}
		}

		if ( ! $wc_admin_key ) {
			return;
		}

		$menu = $submenu['woocommerce'][ $wc_admin_key ];

		// Move menu item to top of array.
		unset( $submenu['woocommerce'][ $wc_admin_key ] );
		array_unshift( $submenu['woocommerce'], $menu );
	}

	/**
	 * Preload options to prime state of the application.
	 *
	 * @param array $options Array of options to preload.
	 * @return array
	 */
	public function preload_options( $options ) {
		$options[] = 'woocommerce_default_homepage_layout';

		return $options;
	}

	/**
	 * Add data to the shared component settings.
	 *
	 * @param array $settings Shared component settings.
	 */
	public function component_settings( $settings ) {
		$allowed_statuses = Loader::get_order_statuses( wc_get_order_statuses() );

		// Remove the Draft Order status (from the Checkout Block).
		unset( $allowed_statuses['checkout-draft'] );

		$status_counts                     = array_map( 'wc_orders_count', array_keys( $allowed_statuses ) );
		$product_counts                    = wp_count_posts( 'product' );
		$settings['orderCount']            = array_sum( $status_counts );
		$settings['publishedProductCount'] = $product_counts->publish;

		return $settings;
	}
}
woocommerce-admin/src/Features/Navigation/Menu.php000064400000054406151335517650016256 0ustar00<?php
/**
 * WooCommerce Navigation Menu
 *
 * @package Woocommerce Navigation
 */

namespace Automattic\WooCommerce\Admin\Features\Navigation;

use Automattic\WooCommerce\Admin\Features\Navigation\Favorites;
use Automattic\WooCommerce\Admin\Features\Navigation\Screen;
use Automattic\WooCommerce\Admin\Features\Navigation\CoreMenu;

/**
 * Contains logic for the WooCommerce Navigation menu.
 */
class Menu {
	/**
	 * Class instance.
	 *
	 * @var Menu instance
	 */
	protected static $instance = null;

	/**
	 * Array index of menu capability.
	 *
	 * @var int
	 */
	const CAPABILITY = 1;

	/**
	 * Array index of menu callback.
	 *
	 * @var int
	 */
	const CALLBACK = 2;

	/**
	 * Array index of menu callback.
	 *
	 * @var int
	 */
	const SLUG = 3;

	/**
	 * Array index of menu CSS class string.
	 *
	 * @var int
	 */
	const CSS_CLASSES = 4;

	/**
	 * Array of usable menu IDs.
	 */
	const MENU_IDS = array(
		'primary',
		'favorites',
		'plugins',
		'secondary',
	);

	/**
	 * Store menu items.
	 *
	 * @var array
	 */
	protected static $menu_items = array();

	/**
	 * Store categories with menu item IDs.
	 *
	 * @var array
	 */
	protected static $categories = array(
		'woocommerce' => array(),
	);

	/**
	 * Registered callbacks or URLs with migration boolean as key value pairs.
	 *
	 * @var array
	 */
	protected static $callbacks = array();

	/**
	 * Get class instance.
	 */
	final public static function instance() {
		if ( ! static::$instance ) {
			static::$instance = new static();
		}
		return static::$instance;
	}

	/**
	 * Init.
	 */
	public function init() {
		add_action( 'admin_menu', array( $this, 'add_core_items' ), 100 );
		add_filter( 'admin_enqueue_scripts', array( $this, 'enqueue_data' ), 20 );

		add_filter( 'admin_menu', array( $this, 'migrate_core_child_items' ), PHP_INT_MAX - 1 );
		add_filter( 'admin_menu', array( $this, 'migrate_menu_items' ), PHP_INT_MAX - 2 );
	}

	/**
	 * Convert a WordPress menu callback to a URL.
	 *
	 * @param string $callback Menu callback.
	 * @return string
	 */
	public static function get_callback_url( $callback ) {
		// Return the full URL.
		if ( strpos( $callback, 'http' ) === 0 ) {
			return $callback;
		}

		$pos  = strpos( $callback, '?' );
		$file = $pos > 0 ? substr( $callback, 0, $pos ) : $callback;
		if ( file_exists( ABSPATH . "/wp-admin/$file" ) ) {
			return $callback;
		}
		return 'admin.php?page=' . $callback;
	}

	/**
	 * Get the parent key if one exists.
	 *
	 * @param string $callback Callback or URL.
	 * @return string|null
	 */
	public static function get_parent_key( $callback ) {
		global $submenu;

		if ( ! $submenu ) {
			return null;
		}

		// This is already a parent item.
		if ( isset( $submenu[ $callback ] ) ) {
			return null;
		}

		foreach ( $submenu as $key => $menu ) {
			foreach ( $menu as $item ) {
				if ( $item[ self::CALLBACK ] === $callback ) {
					return $key;
				}
			}
		}

		return null;
	}

	/**
	 * Adds a top level menu item to the navigation.
	 *
	 * @param array $args Array containing the necessary arguments.
	 *    $args = array(
	 *      'id'      => (string) The unique ID of the menu item. Required.
	 *      'title'   => (string) Title of the menu item. Required.
	 *      'url'     => (string) URL or callback to be used. Required.
	 *      'order'   => (int) Menu item order.
	 *      'migrate' => (bool) Whether or not to hide the item in the wp admin menu.
	 *      'menuId'  => (string) The ID of the menu to add the category to.
	 *    ).
	 */
	private static function add_category( $args ) {
		if ( ! isset( $args['id'] ) || isset( self::$menu_items[ $args['id'] ] ) ) {
			return;
		}

		$defaults           = array(
			'id'         => '',
			'title'      => '',
			'order'      => 100,
			'migrate'    => true,
			'menuId'     => 'primary',
			'isCategory' => true,
		);
		$menu_item          = wp_parse_args( $args, $defaults );
		$menu_item['title'] = wp_strip_all_tags( wp_specialchars_decode( $menu_item['title'] ) );
		unset( $menu_item['url'] );
		unset( $menu_item['capability'] );

		if ( ! isset( $menu_item['parent'] ) ) {
			$menu_item['parent']          = 'woocommerce';
			$menu_item['backButtonLabel'] = __(
				'WooCommerce Home',
				'woocommerce'
			);
		}

		self::$menu_items[ $menu_item['id'] ]       = $menu_item;
		self::$categories[ $menu_item['id'] ]       = array();
		self::$categories[ $menu_item['parent'] ][] = $menu_item['id'];

		if ( isset( $args['url'] ) ) {
			self::$callbacks[ $args['url'] ] = $menu_item['migrate'];
		}
	}

	/**
	 * Adds a child menu item to the navigation.
	 *
	 * @param array $args Array containing the necessary arguments.
	 *    $args = array(
	 *      'id'              => (string) The unique ID of the menu item. Required.
	 *      'title'           => (string) Title of the menu item. Required.
	 *      'parent'          => (string) Parent menu item ID.
	 *      'capability'      => (string) Capability to view this menu item.
	 *      'url'             => (string) URL or callback to be used. Required.
	 *      'order'           => (int) Menu item order.
	 *      'migrate'         => (bool) Whether or not to hide the item in the wp admin menu.
	 *      'menuId'          => (string) The ID of the menu to add the item to.
	 *      'matchExpression' => (string) A regular expression used to identify if the menu item is active.
	 *    ).
	 */
	private static function add_item( $args ) {
		if ( ! isset( $args['id'] ) ) {
			return;
		}

		if ( isset( self::$menu_items[ $args['id'] ] ) ) {
			error_log(  // phpcs:ignore
				sprintf(
					/* translators: 1: Duplicate menu item path. */
					esc_html__( 'You have attempted to register a duplicate item with WooCommerce Navigation: %1$s', 'woocommerce' ),
					'`' . $args['id'] . '`'
				)
			);
			return;
		}

		$defaults           = array(
			'id'         => '',
			'title'      => '',
			'capability' => 'manage_woocommerce',
			'url'        => '',
			'order'      => 100,
			'migrate'    => true,
			'menuId'     => 'primary',
		);
		$menu_item          = wp_parse_args( $args, $defaults );
		$menu_item['title'] = wp_strip_all_tags( wp_specialchars_decode( $menu_item['title'] ) );
		$menu_item['url']   = self::get_callback_url( $menu_item['url'] );

		if ( ! isset( $menu_item['parent'] ) ) {
			$menu_item['parent'] = 'woocommerce';
		}

		$menu_item['menuId'] = self::get_item_menu_id( $menu_item );

		self::$menu_items[ $menu_item['id'] ]       = $menu_item;
		self::$categories[ $menu_item['parent'] ][] = $menu_item['id'];

		if ( isset( $args['url'] ) ) {
			self::$callbacks[ $args['url'] ] = $menu_item['migrate'];
		}
	}

	/**
	 * Get an item's menu ID from its parent.
	 *
	 * @param array $item Item args.
	 * @return string
	 */
	public static function get_item_menu_id( $item ) {
		$favorites = Favorites::get_all();
		if ( is_array( $favorites ) && ! empty( $favorites ) && in_array( $item['id'], $favorites, true ) ) {
			return 'favorites';
		}

		if ( isset( $item['parent'] ) && isset( self::$menu_items[ $item['parent'] ] ) ) {
			$menu_id = self::$menu_items[ $item['parent'] ]['menuId'];
			return 'favorites' === $menu_id
				? 'plugins'
				: $menu_id;
		}

		return $item['menuId'];
	}

	/**
	 * Adds a plugin category.
	 *
	 * @param array $args Array containing the necessary arguments.
	 *    $args = array(
	 *      'id'      => (string) The unique ID of the menu item. Required.
	 *      'title'   => (string) Title of the menu item. Required.
	 *      'url'     => (string) URL or callback to be used. Required.
	 *      'migrate' => (bool) Whether or not to hide the item in the wp admin menu.
	 *      'order'   => (int) Menu item order.
	 *    ).
	 */
	public static function add_plugin_category( $args ) {
		$category_args = array_merge(
			$args,
			array(
				'menuId' => 'plugins',
			)
		);

		if ( ! isset( $category_args['parent'] ) ) {
			unset( $category_args['order'] );
		}

		$menu_id = self::get_item_menu_id( $category_args );
		if ( ! in_array( $menu_id, array( 'plugins', 'favorites' ), true ) ) {
			return;
		}

		$category_args['menuId'] = $menu_id;

		self::add_category( $category_args );
	}

	/**
	 * Adds a plugin item.
	 *
	 * @param array $args Array containing the necessary arguments.
	 *    $args = array(
	 *      'id'              => (string) The unique ID of the menu item. Required.
	 *      'title'           => (string) Title of the menu item. Required.
	 *      'parent'          => (string) Parent menu item ID.
	 *      'capability'      => (string) Capability to view this menu item.
	 *      'url'             => (string) URL or callback to be used. Required.
	 *      'migrate'         => (bool) Whether or not to hide the item in the wp admin menu.
	 *      'order'           => (int) Menu item order.
	 *      'matchExpression' => (string) A regular expression used to identify if the menu item is active.
	 *    ).
	 */
	public static function add_plugin_item( $args ) {
		if ( ! isset( $args['parent'] ) ) {
			unset( $args['order'] );
		}

		$item_args = array_merge(
			$args,
			array(
				'menuId' => 'plugins',
			)
		);

		$menu_id = self::get_item_menu_id( $item_args );

		if ( 'plugins' !== $menu_id ) {
			return;
		}

		self::add_item( $item_args );
	}

	/**
	 * Adds a plugin setting item.
	 *
	 * @param array $args Array containing the necessary arguments.
	 *    $args = array(
	 *      'id'         => (string) The unique ID of the menu item. Required.
	 *      'title'      => (string) Title of the menu item. Required.
	 *      'capability' => (string) Capability to view this menu item.
	 *      'url'        => (string) URL or callback to be used. Required.
	 *      'migrate'    => (bool) Whether or not to hide the item in the wp admin menu.
	 *    ).
	 */
	public static function add_setting_item( $args ) {
		unset( $args['order'] );

		if ( isset( $args['parent'] ) || isset( $args['menuId'] ) ) {
			error_log(  // phpcs:ignore
				sprintf(
					/* translators: 1: Duplicate menu item path. */
					esc_html__( 'The item ID %1$s attempted to register using an invalid option. The arguments `menuId` and `parent` are not allowed for add_setting_item()', 'woocommerce' ),
					'`' . $args['id'] . '`'
				)
			);
		}

		$item_args = array_merge(
			$args,
			array(
				'menuId' => 'secondary',
				'parent' => 'woocommerce-settings',
			)
		);

		self::add_item( $item_args );
	}



	/**
	 * Get menu item templates for a given post type.
	 *
	 * @param string $post_type Post type to add.
	 * @param array  $menu_args Arguments merged with the returned menu items.
	 * @return array
	 */
	public static function get_post_type_items( $post_type, $menu_args = array() ) {
		$post_type_object = get_post_type_object( $post_type );

		if ( ! $post_type_object || ! $post_type_object->show_in_menu ) {
			return;
		}

		$parent           = isset( $menu_args['parent'] ) ? $menu_args['parent'] . '-' : '';
		$match_expression = isset( $_GET['post'] ) && get_post_type( intval( $_GET['post'] ) ) === $post_type // phpcs:ignore WordPress.Security.NonceVerification
			? '(edit.php|post.php)'
			: null;

		return array(
			'default' => array_merge(
				array(
					'title'           => esc_attr( $post_type_object->labels->menu_name ),
					'capability'      => $post_type_object->cap->edit_posts,
					'id'              => $parent . $post_type,
					'url'             => "edit.php?post_type={$post_type}",
					'matchExpression' => $match_expression,
				),
				$menu_args
			),
			'all'     => array_merge(
				array(
					'title'           => esc_attr( $post_type_object->labels->all_items ),
					'capability'      => $post_type_object->cap->edit_posts,
					'id'              => "{$parent}{$post_type}-all-items",
					'url'             => "edit.php?post_type={$post_type}",
					'order'           => 10,
					'matchExpression' => $match_expression,
				),
				$menu_args
			),
			'new'     => array_merge(
				array(
					'title'      => esc_attr( $post_type_object->labels->add_new ),
					'capability' => $post_type_object->cap->create_posts,
					'id'         => "{$parent}{$post_type}-add-new",
					'url'        => "post-new.php?post_type={$post_type}",
					'order'      => 20,
				),
				$menu_args
			),
		);
	}

	/**
	 * Get menu item templates for a given taxonomy.
	 *
	 * @param string $taxonomy Taxonomy to add.
	 * @param array  $menu_args Arguments merged with the returned menu items.
	 * @return array
	 */
	public static function get_taxonomy_items( $taxonomy, $menu_args = array() ) {
		$taxonomy_object = get_taxonomy( $taxonomy );

		if ( ! $taxonomy_object || ! $taxonomy_object->show_in_menu ) {
			return;
		}

		$parent             = isset( $menu_args['parent'] ) ? $menu_args['parent'] . '-' : '';
		$product_type_query = ! empty( $taxonomy_object->object_type )
			? "&post_type={$taxonomy_object->object_type[0]}"
			: '';
		$match_expression   = 'term.php';                               // Match term.php pages.
		$match_expression  .= "(?=.*[?|&]taxonomy=${taxonomy}(&|$|#))"; // Lookahead to match a taxonomy URL param.
		$match_expression  .= '|';                                      // Or.
		$match_expression  .= 'edit-tags.php';                          // Match edit-tags.php pages.
		$match_expression  .= "(?=.*[?|&]taxonomy=${taxonomy}(&|$|#))"; // Lookahead to match a taxonomy URL param.

		return array(
			'default' => array_merge(
				array(
					'title'           => esc_attr( $taxonomy_object->labels->menu_name ),
					'capability'      => $taxonomy_object->cap->edit_terms,
					'id'              => $parent . $taxonomy,
					'url'             => "edit-tags.php?taxonomy={$taxonomy}{$product_type_query}",
					'matchExpression' => $match_expression,
				),
				$menu_args
			),
			'all'     => array_merge(
				array(
					'title'           => esc_attr( $taxonomy_object->labels->all_items ),
					'capability'      => $taxonomy_object->cap->edit_terms,
					'id'              => "{$parent}{$taxonomy}-all-items",
					'url'             => "edit-tags.php?taxonomy={$taxonomy}{$product_type_query}",
					'matchExpression' => $match_expression,
					'order'           => 10,
				),
				$menu_args
			),

		);
	}

	/**
	 * Add core menu items.
	 */
	public function add_core_items() {
		$categories = CoreMenu::get_categories();
		foreach ( $categories as $category ) {
			self::add_category( $category );
		}

		$items = CoreMenu::get_items();
		foreach ( $items as $item ) {
			if ( isset( $item['is_category'] ) && $item['is_category'] ) {
				self::add_category( $item );
			} else {
				self::add_item( $item );
			}
		}
	}

	/**
	 * Add an item or taxonomy.
	 *
	 * @param array $menu_item Menu item.
	 */
	public function add_item_and_taxonomy( $menu_item ) {
		if ( in_array( $menu_item[2], CoreMenu::get_excluded_items(), true ) ) {
			return;
		}

		$menu_item[2] = htmlspecialchars_decode( $menu_item[2] );

		// Don't add already added items.
		$callbacks = self::get_callbacks();
		if ( array_key_exists( $menu_item[2], $callbacks ) ) {
			return;
		}

		// Don't add these Product submenus because they are added elsewhere.
		if ( in_array( $menu_item[2], array( 'product_importer', 'product_exporter', 'product_attributes' ), true ) ) {
			return;
		}

		self::add_plugin_item(
			array(
				'title'      => $menu_item[0],
				'capability' => $menu_item[1],
				'id'         => sanitize_title( $menu_item[0] ),
				'url'        => $menu_item[2],
			)
		);

		// Determine if migrated items are a taxonomy or post_type. If they are, register them.
		$parsed_url   = wp_parse_url( $menu_item[2] );
		$query_string = isset( $parsed_url['query'] ) ? $parsed_url['query'] : false;

		if ( $query_string ) {
			$query = array();
			parse_str( $query_string, $query );

			if ( isset( $query['taxonomy'] ) ) {
				Screen::register_taxonomy( $query['taxonomy'] );
			} elseif ( isset( $query['post_type'] ) ) {
				Screen::register_post_type( $query['post_type'] );
			}
		}
	}

	/**
	 * Migrate any remaining WooCommerce child items.
	 *
	 * @param array $menu Menu items.
	 * @return array
	 */
	public function migrate_core_child_items( $menu ) {
		global $submenu;

		if ( ! isset( $submenu['woocommerce'] ) && ! isset( $submenu['edit.php?post_type=product'] ) ) {
			return $menu;
		}

		$main_items    = isset( $submenu['woocommerce'] ) ? $submenu['woocommerce'] : array();
		$product_items = isset( $submenu['edit.php?post_type=product'] ) ? $submenu['edit.php?post_type=product'] : array();

		foreach ( $main_items as $key => $menu_item ) {
			self::add_item_and_taxonomy( $menu_item );
			// phpcs:disable
			if ( ! isset( $menu_item[ self::CSS_CLASSES ] ) ) {
				$submenu['woocommerce'][ $key ][] .= ' hide-if-js';
			} else if ( strpos( $submenu['woocommerce'][ $key ][ self::CSS_CLASSES ], 'hide-if-js' ) !== false ) {
				continue;
			} else {
				$submenu['woocommerce'][ $key ][ self::CSS_CLASSES ] .= ' hide-if-js';
			}
			// phpcs:enable
		}

		foreach ( $product_items as $key => $menu_item ) {
			self::add_item_and_taxonomy( $menu_item );
		}

		return $menu;
	}

	/**
	 * Check if a menu item's callback is registered in the menu.
	 *
	 * @param array $menu_item Menu item args.
	 * @return bool
	 */
	public static function has_callback( $menu_item ) {
		if ( ! $menu_item || ! isset( $menu_item[ self::CALLBACK ] ) ) {
			return false;
		}

		$callback = $menu_item[ self::CALLBACK ];

		if (
			isset( self::$callbacks[ $callback ] ) &&
			self::$callbacks[ $callback ]
		) {
			return true;
		}

		if (
			isset( self::$callbacks[ self::get_callback_url( $callback ) ] ) &&
			self::$callbacks[ self::get_callback_url( $callback ) ]
		) {
			return true;
		}

		return false;
	}

	/**
	 * Hides all WP admin menus items and adds screen IDs to check for new items.
	 */
	public static function migrate_menu_items() {
		global $menu, $submenu;

		foreach ( $menu as $key => $menu_item ) {
			if ( self::has_callback( $menu_item ) ) {
				// Disable phpcs since we need to override submenu classes.
				// Note that `phpcs:ignore WordPress.Variables.GlobalVariables.OverrideProhibited` does not work to disable this check.
				// phpcs:disable
				$menu[ $key ][ self::CSS_CLASSES ] .= ' hide-if-js';
				// phps:enable
				continue;
			}

			// WordPress core menus make the parent item the same URL as the first child.
			$has_children = isset( $submenu[ $menu_item[ self::CALLBACK ] ] ) && isset( $submenu[ $menu_item[ self::CALLBACK ] ][0] );
			$first_child  = $has_children ? $submenu[ $menu_item[ self::CALLBACK ] ][0] : null;
			if ( 'woocommerce' !== $menu_item[2] && self::has_callback( $first_child ) ) {
				// Disable phpcs since we need to override submenu classes.
				// Note that `phpcs:ignore WordPress.Variables.GlobalVariables.OverrideProhibited` does not work to disable this check.
				// phpcs:disable
				$menu[ $key ][ self::CSS_CLASSES ] .= ' hide-if-js';
				// phps:enable
			}
		}

		// Remove excluded submenu items
		if ( isset( $submenu['woocommerce'] ) ) {
			foreach ( $submenu['woocommerce'] as $key => $submenu_item ) {
				if ( in_array( $submenu_item[ self::CALLBACK ], CoreMenu::get_excluded_items(), true ) ) {
					if ( isset( $submenu['woocommerce'][ $key ][ self::CSS_CLASSES ] ) ) {
						$submenu['woocommerce'][ $key ][ self::CSS_CLASSES ] .= ' hide-if-js';
					} else {
						$submenu['woocommerce'][ $key ][] = 'hide-if-js';
					}
				}
			}
		}

		foreach ( $submenu as $parent_key => $parent ) {
			foreach ( $parent as $key => $menu_item ) {
				if ( self::has_callback( $menu_item ) ) {
					// Disable phpcs since we need to override submenu classes.
					// Note that `phpcs:ignore WordPress.Variables.GlobalVariables.OverrideProhibited` does not work to disable this check.
					// phpcs:disable
					if ( ! isset( $menu_item[ self::SLUG ] ) ) {
						$submenu[ $parent_key ][ $key ][] = '';
					}
					if ( ! isset( $menu_item[ self::CSS_CLASSES ] ) ) {
						$submenu[ $parent_key ][ $key ][] .= ' hide-if-js';
					} else {
						$submenu[ $parent_key ][ $key ][ self::CSS_CLASSES ] .= ' hide-if-js';
					}
					// phps:enable
				}
			}
		}

		foreach ( array_keys( self::$callbacks ) as $callback ) {
			Screen::add_screen( $callback );
		}
	}

	/**
	 * Add a callback to identify and hide pages in the WP menu.
	 */
	public static function hide_wp_menu_item( $callback ) {
		self::$callbacks[ $callback ] = true;
	}

	/**
	 * Get registered menu items.
	 *
	 * @return array
	 */
	public static function get_items() {
		return apply_filters( 'woocommerce_navigation_menu_items', self::$menu_items );
	}

	/**
	 * Get registered menu items.
	 *
	 * @return array
	 */
	public static function get_category_items( $category ) {
		if ( ! isset( self::$categories[ $category ] ) ) {
			return array();
		}

		$menu_item_ids = self::$categories[ $category ];

		$category_menu_items = array();
		foreach ( $menu_item_ids as $id ) {
			if ( isset( self::$menu_items[ $id ] ) ) {
				$category_menu_items[] = self::$menu_items[ $id ];
			}
		}

		return apply_filters( 'woocommerce_navigation_menu_category_items', $category_menu_items );
	}

	/**
	 * Get registered callbacks.
	 *
	 * @return array
	 */
	public static function get_callbacks() {
		return apply_filters( 'woocommerce_navigation_callbacks', self::$callbacks );
	}

	/**
	 * Gets the menu item data mapped by category and menu ID.
	 *
	 * @return array
	 */
	public static function get_mapped_menu_items() {
		$menu_items   = self::get_items();
		$mapped_items = array();

		// Sort the items by order and title.
		$order     = array_column( $menu_items, 'order' );
		$title     = array_column( $menu_items, 'title' );
		array_multisort( $order, SORT_ASC, $title, SORT_ASC, $menu_items );

		foreach ( $menu_items as $id => $menu_item ) {
			$category_id = $menu_item[ 'parent' ];
			$menu_id     = $menu_item[ 'menuId' ];
			if ( ! isset( $mapped_items[ $category_id ] ) ) {
				$mapped_items[ $category_id ] = array();
				foreach ( self::MENU_IDS as $available_menu_id ) {
					$mapped_items[ $category_id ][ $available_menu_id ] = array();
				}
			}

			// Incorrect menu ID.
			if ( ! isset( $mapped_items[ $category_id ][ $menu_id ] ) ) {
				continue;
			}

			// Remove the item if the user cannot access it.
			if ( isset( $menu_item[ 'capability' ] ) && ! current_user_can( $menu_item[ 'capability' ] ) ) {
				continue;
			}

			$mapped_items[ $category_id ][ $menu_id ][] = $menu_item;
		}

		return $mapped_items;
	}

	/**
	 * Add the menu to the page output.
	 *
	 * @param array $menu Menu items.
	 * @return array
	 */
	public function enqueue_data( $menu ) {
		$data = array(
			'menuItems'     => array_values( self::get_items() ),
			'rootBackUrl'   => get_dashboard_url(),
		);

		wp_add_inline_script( WC_ADMIN_APP, 'window.wcNavigation = ' . wp_json_encode( $data ), 'before' );
	}
}
woocommerce-admin/src/Features/Navigation/Init.php000064400000011341151335517650016244 0ustar00<?php
/**
 * Navigation Experience
 *
 * @package Woocommerce Admin
 */

namespace Automattic\WooCommerce\Admin\Features\Navigation;

use Automattic\WooCommerce\Admin\Loader;
use Automattic\WooCommerce\Admin\Survey;
use Automattic\WooCommerce\Admin\Features\Features;
use Automattic\WooCommerce\Admin\Features\Navigation\Screen;
use Automattic\WooCommerce\Admin\Features\Navigation\Menu;
use Automattic\WooCommerce\Admin\Features\Navigation\CoreMenu;

/**
 * Contains logic for the Navigation
 */
class Init {
	/**
	 * Option name used to toggle this feature.
	 */
	const TOGGLE_OPTION_NAME = 'woocommerce_navigation_enabled';

	/**
	 * Hook into WooCommerce.
	 */
	public function __construct() {
		add_filter( 'woocommerce_settings_features', array( $this, 'add_feature_toggle' ) );
		add_action( 'update_option_' . self::TOGGLE_OPTION_NAME, array( $this, 'reload_page_on_toggle' ), 10, 2 );
		add_action( 'admin_enqueue_scripts', array( $this, 'maybe_enqueue_opt_out_scripts' ) );

		if ( Features::is_enabled( 'navigation' ) ) {
			Menu::instance()->init();
			CoreMenu::instance()->init();
			Screen::instance()->init();
		}
	}

	/**
	 * Add the feature toggle to the features settings.
	 *
	 * @param array $features Feature sections.
	 * @return array
	 */
	public static function add_feature_toggle( $features ) {
		$description  = __(
			'Adds the new WooCommerce navigation experience to the dashboard',
			'woocommerce'
		);
		$update_text  = '';
		$needs_update = version_compare( get_bloginfo( 'version' ), '5.6', '<' );
		if ( $needs_update && current_user_can( 'update_core' ) && current_user_can( 'update_php' ) ) {
			$update_text = sprintf(
				/* translators: 1: line break tag, 2: open link to WordPress update link, 3: close link tag. */
				__( '%1$s %2$sUpdate WordPress to enable the new navigation%3$s', 'woocommerce' ),
				'<br/>',
				'<a href="' . self_admin_url( 'update-core.php' ) . '" target="_blank">',
				'</a>'
			);
		}

		$features[] = array(
			'title' => __( 'Navigation', 'woocommerce' ),
			'desc'  => $description . $update_text,
			'id'    => self::TOGGLE_OPTION_NAME,
			'type'  => 'checkbox',
			'class' => $needs_update ? 'disabled' : '',
		);

		return $features;
	}

	/**
	 * Determine if sufficient versions are present to support Navigation feature
	 */
	public function is_nav_compatible() {
		include_once ABSPATH . 'wp-admin/includes/plugin.php';

		$gutenberg_minimum_version = '9.0.0'; // https://github.com/WordPress/gutenberg/releases/tag/v9.0.0.
		$wp_minimum_version        = '5.6';
		$has_gutenberg             = is_plugin_active( 'gutenberg/gutenberg.php' );
		$gutenberg_version         = $has_gutenberg ? get_plugin_data( WP_PLUGIN_DIR . '/gutenberg/gutenberg.php' )['Version'] : false;

		if ( $gutenberg_version && version_compare( $gutenberg_version, $gutenberg_minimum_version, '>=' ) ) {
			return true;
		}

		// Get unmodified $wp_version.
		include ABSPATH . WPINC . '/version.php';

		// Strip '-src' from the version string. Messes up version_compare().
		$wp_version = str_replace( '-src', '', $wp_version );

		if ( version_compare( $wp_version, $wp_minimum_version, '>=' ) ) {
			return true;
		}

		return false;
	}

	/**
	 * Reloads the page when the option is toggled to make sure all nav features are loaded.
	 *
	 * @param string $old_value Old value.
	 * @param string $value     New value.
	 */
	public static function reload_page_on_toggle( $old_value, $value ) {
		if ( $old_value === $value ) {
			return;
		}

		if ( 'yes' !== $value ) {
			update_option( 'woocommerce_navigation_show_opt_out', 'yes' );
		}

		if ( isset( $_SERVER['REQUEST_URI'] ) ) {
			wp_safe_redirect( wp_unslash( $_SERVER['REQUEST_URI'] ) );
			exit();
		}
	}

	/**
	 * Enqueue the opt out scripts.
	 */
	public function maybe_enqueue_opt_out_scripts() {
		if ( 'yes' !== get_option( 'woocommerce_navigation_show_opt_out', 'no' ) ) {
			return;
		}

		$rtl = is_rtl() ? '.rtl' : '';
		wp_enqueue_style(
			'wc-admin-navigation-opt-out',
			Loader::get_url( "navigation-opt-out/style{$rtl}", 'css' ),
			array( 'wp-components' ),
			Loader::get_file_version( 'css' )
		);

		$script_assets_filename = Loader::get_script_asset_filename( 'wp-admin-scripts', 'navigation-opt-out' );
		$script_assets          = require WC_ADMIN_ABSPATH . WC_ADMIN_DIST_JS_FOLDER . 'wp-admin-scripts/' . $script_assets_filename;

		wp_enqueue_script(
			'wc-admin-navigation-opt-out',
			Loader::get_url( 'wp-admin-scripts/navigation-opt-out', 'js' ),
			array_merge( array( WC_ADMIN_APP ), $script_assets ['dependencies'] ),
			Loader::get_file_version( 'js' ),
			true
		);

		wp_localize_script(
			'wc-admin-navigation-opt-out',
			'surveyData',
			array(
				'url' => Survey::get_url( '/new-navigation-opt-out' ),
			)
		);

		delete_option( 'woocommerce_navigation_show_opt_out' );
	}
}
woocommerce-admin/src/Features/Navigation/CoreMenu.php000064400000025257151335517650017071 0ustar00<?php
/**
 * WooCommerce Navigation Core Menu
 *
 * @package Woocommerce Admin
 */

namespace Automattic\WooCommerce\Admin\Features\Navigation;

use Automattic\WooCommerce\Admin\Features\Features;
use Automattic\WooCommerce\Admin\Features\Navigation\Menu;
use Automattic\WooCommerce\Admin\Features\Navigation\Screen;

/**
 * CoreMenu class. Handles registering Core menu items.
 */
class CoreMenu {
	/**
	 * Class instance.
	 *
	 * @var Menu instance
	 */
	protected static $instance = null;

	/**
	 * Get class instance.
	 */
	final public static function instance() {
		if ( ! static::$instance ) {
			static::$instance = new static();
		}
		return static::$instance;
	}

	/**
	 * Init.
	 */
	public function init() {
		add_action( 'admin_menu', array( $this, 'register_post_types' ) );
		// Add this after we've finished migrating menu items to avoid hiding these items.
		add_action( 'admin_menu', array( $this, 'add_dashboard_menu_items' ), PHP_INT_MAX );
	}

	/**
	 * Add registered admin settings as menu items.
	 */
	public static function get_setting_items() {
		// Let the Settings feature add pages to the navigation if enabled.
		if ( Features::is_enabled( 'settings' ) ) {
			return array();
		}

		// Calling this method adds pages to the below tabs filter on non-settings pages.
		\WC_Admin_Settings::get_settings_pages();
		$tabs = apply_filters( 'woocommerce_settings_tabs_array', array() );

		$menu_items = array();
		$order      = 0;
		foreach ( $tabs as $key => $setting ) {
			$order       += 10;
			$menu_items[] = (
				array(
					'parent'     => 'woocommerce-settings',
					'title'      => $setting,
					'capability' => 'manage_woocommerce',
					'id'         => 'settings-' . $key,
					'url'        => 'admin.php?page=wc-settings&tab=' . $key,
					'order'      => $order,
				)
			);
		}

		return $menu_items;
	}

	/**
	 * Get all menu categories.
	 *
	 * @return array
	 */
	public static function get_categories() {
		$analytics_enabled = Features::is_enabled( 'analytics' );
		return array(
			array(
				'title' => __( 'Orders', 'woocommerce' ),
				'id'    => 'woocommerce-orders',
				'order' => 10,
			),
			array(
				'title' => __( 'Products', 'woocommerce' ),
				'id'    => 'woocommerce-products',
				'order' => 20,
			),
			$analytics_enabled ?
			array(
				'title' => __( 'Analytics', 'woocommerce' ),
				'id'    => 'woocommerce-analytics',
				'order' => 30,
			) : null,
			$analytics_enabled ?
			array(
				'title'  => __( 'Reports', 'woocommerce' ),
				'id'     => 'woocommerce-reports',
				'parent' => 'woocommerce-analytics',
				'order'  => 200,
			) : null,
			array(
				'title' => __( 'Marketing', 'woocommerce' ),
				'id'    => 'woocommerce-marketing',
				'order' => 40,
			),
			array(
				'title'  => __( 'Marketplace', 'woocommerce' ),
				'id'     => 'woocommerce-marketplace',
				'menuId' => 'secondary',
				'order'  => 10,
			),
			array(
				'title'  => __( 'Settings', 'woocommerce' ),
				'id'     => 'woocommerce-settings',
				'menuId' => 'secondary',
				'order'  => 20,
				'url'    => 'admin.php?page=wc-settings',
			),
			array(
				'title'  => __( 'Tools', 'woocommerce' ),
				'id'     => 'woocommerce-tools',
				'menuId' => 'secondary',
				'order'  => 30,
			),
		);
	}

	/**
	 * Get all menu items.
	 *
	 * @return array
	 */
	public static function get_items() {
		$order_items       = Menu::get_post_type_items( 'shop_order', array( 'parent' => 'woocommerce-orders' ) );
		$product_items     = Menu::get_post_type_items( 'product', array( 'parent' => 'woocommerce-products' ) );
		$product_tag_items = Menu::get_taxonomy_items(
			'product_tag',
			array(
				'parent' => 'woocommerce-products',
				'order'  => 30,
			)
		);
		$product_cat_items = Menu::get_taxonomy_items(
			'product_cat',
			array(
				'parent' => 'woocommerce-products',
				'order'  => 20,
			)
		);

		$coupon_items  = Menu::get_post_type_items( 'shop_coupon', array( 'parent' => 'woocommerce-marketing' ) );
		$setting_items = self::get_setting_items();
		$wca_items     = array();
		$wca_pages     = \Automattic\WooCommerce\Admin\PageController::get_instance()->get_pages();

		foreach ( $wca_pages as $page ) {
			if ( ! isset( $page['nav_args'] ) ) {
				continue;
			}

			$path = isset( $page['path'] ) ? $page['path'] : null;
			$item = array_merge(
				array(
					'id'         => $page['id'],
					'url'        => $path,
					'title'      => $page['title'][0],
					'capability' => isset( $page['capability'] ) ? $page['capability'] : 'manage_woocommerce',
				),
				$page['nav_args']
			);

			// Don't allow top-level items to be added to the primary menu.
			if ( ! isset( $item['parent'] ) || 'woocommerce' === $item['parent'] ) {
				$item['menuId'] = 'plugins';
			}

			$wca_items[] = $item;
		}

		$home_item = array();
		if ( defined( '\Automattic\WooCommerce\Admin\Features\Homescreen::MENU_SLUG' ) ) {
			$home_item = array(
				'id'              => 'woocommerce-home',
				'title'           => __( 'Home', 'woocommerce' ),
				'url'             => \Automattic\WooCommerce\Admin\Features\Homescreen::MENU_SLUG,
				'order'           => 0,
				'matchExpression' => 'page=wc-admin((?!path=).)*$',
			);
		}

		$customers_item = array();
		if ( Features::is_enabled( 'analytics' ) ) {
			$customers_item = array(
				'id'    => 'woocommerce-analytics-customers',
				'title' => __( 'Customers', 'woocommerce' ),
				'url'   => 'wc-admin&path=/customers',
				'order' => 50,
			);
		}

		return array_merge(
			array(
				$home_item,
				$customers_item,
				$order_items['all'],
				$order_items['new'],
				$product_items['all'],
				$product_cat_items['default'],
				$product_tag_items['default'],
				array(
					'id'              => 'woocommerce-product-attributes',
					'title'           => __( 'Attributes', 'woocommerce' ),
					'url'             => 'edit.php?post_type=product&page=product_attributes',
					'capability'      => 'manage_product_terms',
					'order'           => 40,
					'parent'          => 'woocommerce-products',
					'matchExpression' => 'edit.php(?=.*[?|&]page=product_attributes(&|$|#))|edit-tags.php(?=.*[?|&]taxonomy=pa_)(?=.*[?|&]post_type=product(&|$|#))',
				),
				array_merge( $product_items['new'], array( 'order' => 50 ) ),
				$coupon_items['default'],
			),
			// Marketplace category.
			self::get_marketplace_items(),
			// Tools category.
			self::get_tool_items(),
			// WooCommerce Admin items.
			$wca_items,
			// Settings category.
			$setting_items,
			// Legacy report items.
			self::get_legacy_report_items()
		);
	}

	/**
	 * Get marketplace menu items.
	 *
	 * @return array
	 */
	public static function get_marketplace_items() {
		return array(
			array(
				'parent'     => 'woocommerce-marketplace',
				'title'      => __( 'Browse', 'woocommerce' ),
				'capability' => 'manage_woocommerce',
				'id'         => 'marketplace-browse',
				'url'        => 'admin.php?page=wc-addons',
				'migrate'    => false,
				'order'      => 0,
			),
			array(
				'parent'     => 'woocommerce-marketplace',
				'title'      => __( 'My Subscriptions', 'woocommerce' ),
				'capability' => 'manage_woocommerce',
				'id'         => 'marketplace-my-subscriptions',
				'url'        => 'admin.php?page=wc-addons&section=helper',
				'migrate'    => false,
				'order'      => 1,
			),
		);
	}

	/**
	 * Get items for tools category.
	 *
	 * @return array
	 */
	public static function get_tool_items() {
		$tabs = array(
			'status' => __( 'System status', 'woocommerce' ),
			'tools'  => __( 'Utilities', 'woocommerce' ),
			'logs'   => __( 'Logs', 'woocommerce' ),
		);
		$tabs = apply_filters( 'woocommerce_admin_status_tabs', $tabs );

		$order = 1;
		$items = array(
			array(
				'parent'     => 'woocommerce-tools',
				'title'      => __( 'Import / Export', 'woocommerce' ),
				'capability' => 'import',
				'id'         => 'tools-import-export',
				'url'        => 'import.php',
				'migrate'    => false,
				'order'      => 0,
			),
		);

		foreach ( $tabs as $key => $tab ) {
			$items[] = array(
				'parent'     => 'woocommerce-tools',
				'title'      => $tab,
				'capability' => 'manage_woocommerce',
				'id'         => 'tools-' . $key,
				'url'        => 'wc-status&tab=' . $key,
				'order'      => $order,
			);
			$order++;
		}

		return $items;
	}

	/**
	 * Get legacy report items.
	 *
	 * @return array
	 */
	public static function get_legacy_report_items() {
		$reports    = \WC_Admin_Reports::get_reports();
		$menu_items = array();

		$order = 0;
		foreach ( $reports as $key => $report ) {
			$menu_items[] = array(
				'parent'     => 'woocommerce-reports',
				'title'      => $report['title'],
				'capability' => 'view_woocommerce_reports',
				'id'         => $key,
				'url'        => 'wc-reports&tab=' . $key,
				'order'      => $order,
			);
			$order++;
		}

		return $menu_items;
	}

	/**
	 * Register all core post types.
	 */
	public function register_post_types() {
		Screen::register_post_type( 'shop_order' );
		Screen::register_post_type( 'product' );
		Screen::register_post_type( 'shop_coupon' );
	}

	/**
	 * Add the dashboard items to the WP menu to create a quick-access flyout menu.
	 */
	public function add_dashboard_menu_items() {
		global $submenu, $menu;
		$mapped_items = Menu::get_mapped_menu_items();
		$top_level    = $mapped_items['woocommerce'];

		// phpcs:disable
		if ( ! isset( $submenu['woocommerce'] ) || empty( $top_level ) ) {
			return;
		}

		$menuIds = array(
			'primary',
			'secondary',
			'favorites',
		);

		foreach ( $menuIds as $menuId ) {
			foreach( $top_level[ $menuId ] as $item ) {
				// Skip specific categories.
				if (
					in_array(
						$item['id'],
						array(
							'woocommerce-tools',
						),
						true
					)
				) {
					continue;
				}
	
				// Use the link from the first item if it's a category.
				if ( ! isset( $item['url'] ) ) {
					$categoryMenuId = $menuId === 'favorites' ? 'plugins' : $menuId;
					$category_items = $mapped_items[ $item['id'] ][ $categoryMenuId ];

					if ( ! empty( $category_items ) ) {
						$first_item = $category_items[0];

	
						$submenu['woocommerce'][] = array(
							$item['title'],
							$first_item['capability'],
							isset( $first_item['url'] ) ? $first_item['url'] : null,
							$item['title'],
						);
					}
	
					continue;
				}
	
				// Show top-level items.
				$submenu['woocommerce'][] = array(
					$item['title'],
					$item['capability'],
					isset( $item['url'] ) ? $item['url'] : null,
					$item['title'],
				);
			}
		}
		// phpcs:enable
	}

	/**
	 * Get items excluded from WooCommerce menu migration.
	 *
	 * @return array
	 */
	public static function get_excluded_items() {
		$excluded_items = array(
			'woocommerce',
			'wc-reports',
			'wc-settings',
			'wc-status',
			'wc-addons',
			'wc-addons&section=helper',
		);

		return apply_filters( 'woocommerce_navigation_core_excluded_items', $excluded_items );
	}
}
woocommerce-admin/src/Features/Navigation/Favorites.php000064400000006153151335517650017310 0ustar00<?php
/**
 * WooCommerce Navigation Favorite
 *
 * @package Woocommerce Navigation
 */

namespace Automattic\WooCommerce\Admin\Features\Navigation;

use Automattic\WooCommerce\Admin\Loader;

/**
 * Contains logic for the WooCommerce Navigation menu.
 */
class Favorites {

	/**
	 * Array index of menu capability.
	 *
	 * @var int
	 */
	const META_NAME = 'navigation_favorites';

	/**
	 * Get class instance.
	 */
	final public static function instance() {
		if ( ! static::$instance ) {
			static::$instance = new static();
		}
		return static::$instance;
	}

	/**
	 * Set given favorites string to the user meta data.
	 *
	 * @param string|number $user_id User id.
	 * @param array         $favorites Array of favorite values to set.
	 */
	private static function set_meta_value( $user_id, $favorites ) {
		Loader::update_user_data_field( $user_id, self::META_NAME, wp_json_encode( (array) $favorites ) );
	}

	/**
	 * Add item to favorites
	 *
	 * @param string        $item_id Identifier of item to add.
	 * @param string|number $user_id Identifier of user to add to.
	 * @return WP_Error|Boolean   Throws exception if item already exists.
	 */
	public static function add_item( $item_id, $user_id = null ) {
		$user = $user_id ?? get_current_user_id();

		if ( ! $user || ! $item_id ) {
			return new \WP_Error(
				'woocommerce_favorites_invalid_request',
				__( 'Sorry, invalid request', 'woocommerce' )
			);
		}

		$all_favorites = self::get_all( $user );

		if ( in_array( $item_id, $all_favorites, true ) ) {
			return new \WP_Error(
				'woocommerce_favorites_already_exists',
				__( 'Favorite already exists', 'woocommerce' )
			);
		}

		$all_favorites[] = $item_id;

		self::set_meta_value( $user, $all_favorites );

		return true;
	}

	/**
	 * Remove item from favorites
	 *
	 * @param string        $item_id Identifier of item to remove.
	 * @param string|number $user_id Identifier of user to remove from.
	 * @return \WP_Error|Boolean   Throws exception if item does not exist.
	 */
	public static function remove_item( $item_id, $user_id = null ) {
		$user = $user_id ?? get_current_user_id();

		if ( ! $user || ! $item_id ) {
			return new \WP_Error(
				'woocommerce_favorites_invalid_request',
				__( 'Sorry, invalid request', 'woocommerce' )
			);
		}

		$all_favorites = self::get_all( $user );

		if ( ! in_array( $item_id, $all_favorites, true ) ) {
			return new \WP_Error(
				'woocommerce_favorites_does_not_exist',
				__( 'Favorite item not found', 'woocommerce' )
			);
		}

		$remaining = array_values( array_diff( $all_favorites, [ $item_id ] ) );

		self::set_meta_value( $user, $remaining );

		return true;
	}

	/**
	 * Get all registered favorites.
	 *
	 * @param string|number $user_id Identifier of user to query.
	 * @return WP_Error|Array
	 */
	public static function get_all( $user_id = null ) {
		$user = $user_id ?? get_current_user_id();

		if ( ! $user ) {
			return new \WP_Error(
				'woocommerce_favorites_invalid_request',
				__( 'Sorry, invalid request', 'woocommerce' )
			);
		}

		$response = Loader::get_user_data_field( $user, self::META_NAME );

		return $response ? json_decode( $response, true ) : array();
	}

}
woocommerce-admin/src/Features/Navigation/Screen.php000064400000013106151335517650016561 0ustar00<?php
/**
 * WooCommerce Navigation Screen
 *
 * @package Woocommerce Navigation
 */

namespace Automattic\WooCommerce\Admin\Features\Navigation;

use Automattic\WooCommerce\Admin\Features\Navigation\Menu;

/**
 * Contains logic for the WooCommerce Navigation menu.
 */
class Screen {
	/**
	 * Class instance.
	 *
	 * @var Screen instance
	 */
	protected static $instance = null;

	/**
	 * Screen IDs of registered pages.
	 *
	 * @var array
	 */
	protected static $screen_ids = array();

	/**
	 * Registered post types.
	 *
	 * @var array
	 */
	protected static $post_types = array();

	/**
	 * Registered taxonomies.
	 *
	 * @var array
	 */
	protected static $taxonomies = array();

	/**
	 * Get class instance.
	 */
	final public static function instance() {
		if ( ! static::$instance ) {
			static::$instance = new static();
		}
		return static::$instance;
	}

	/**
	 * Init.
	 */
	public function init() {
		add_filter( 'admin_body_class', array( $this, 'add_body_class' ) );
	}

	/**
	 * Returns an array of filtered screen ids.
	 */
	public static function get_screen_ids() {
		return apply_filters( 'woocommerce_navigation_screen_ids', self::$screen_ids );
	}

	/**
	 * Returns an array of registered post types.
	 */
	public static function get_post_types() {
		return apply_filters( 'woocommerce_navigation_post_types', self::$post_types );
	}

	/**
	 * Returns an array of registered post types.
	 */
	public static function get_taxonomies() {
		return apply_filters( 'woocommerce_navigation_taxonomies', self::$taxonomies );
	}

	/**
	 * Check if we're on a WooCommerce page
	 *
	 * @return bool
	 */
	public static function is_woocommerce_page() {
		global $pagenow;

		// Get taxonomy if on a taxonomy screen.
		$taxonomy = '';
		if ( in_array( $pagenow, array( 'edit-tags.php', 'term.php' ), true ) ) {
			if ( isset( $_GET['taxonomy'] ) ) { // phpcs:ignore CSRF ok.
				$taxonomy = sanitize_text_field( wp_unslash( $_GET['taxonomy'] ) ); // phpcs:ignore CSRF ok.
			}
		}
		$taxonomies = self::get_taxonomies();

		// Get post type if on a post screen.
		$post_type = '';
		if ( in_array( $pagenow, array( 'edit.php', 'post.php', 'post-new.php' ), true ) ) {
			if ( isset( $_GET['post'] ) ) { // phpcs:ignore CSRF ok.
				$post_type = get_post_type( (int) $_GET['post'] ); // phpcs:ignore CSRF ok.
			} elseif ( isset( $_GET['post_type'] ) ) { // phpcs:ignore CSRF ok.
				$post_type = sanitize_text_field( wp_unslash( $_GET['post_type'] ) ); // phpcs:ignore CSRF ok.
			}
		}
		$post_types = self::get_post_types();

		// Get current screen ID.
		$current_screen    = get_current_screen();
		$screen_ids        = self::get_screen_ids();
		$current_screen_id = $current_screen ? $current_screen->id : null;

		if (
			in_array( $post_type, $post_types, true ) ||
			in_array( $taxonomy, $taxonomies, true ) ||
			self::is_woocommerce_core_taxonomy( $taxonomy ) ||
			in_array( $current_screen_id, $screen_ids, true )
		) {
			return true;
		}

		return false;
	}

	/**
	 * Check if a given taxonomy is a WooCommerce core related taxonomy.
	 *
	 * @param string $taxonomy Taxonomy.
	 * @return bool
	 */
	public static function is_woocommerce_core_taxonomy( $taxonomy ) {
		if ( in_array( $taxonomy, array( 'product_cat', 'product_tag' ), true ) ) {
			return true;
		}

		if ( 'pa_' === substr( $taxonomy, 0, 3 ) ) {
			return true;
		}

		return false;
	}

	/**
	 * Add navigation classes to body.
	 *
	 * @param string $classes Classes.
	 * @return string
	 */
	public function add_body_class( $classes ) {
		if ( self::is_woocommerce_page() ) {
			$classes .= ' has-woocommerce-navigation';

			/**
			 * Adds the ability to skip disabling of the WP toolbar.
			 *
			 * @param boolean $bool WP Toolbar disabled.
			 */
			if ( apply_filters( 'woocommerce_navigation_wp_toolbar_disabled', true ) ) {
				$classes .= ' is-wp-toolbar-disabled';
			}
		}

		return $classes;
	}

	/**
	 * Adds a screen ID to the list of screens that use the navigtion.
	 * Finds the parent if none is given to grab the correct screen ID.
	 *
	 * @param string      $callback Callback or URL for page.
	 * @param string|null $parent   Parent screen ID.
	 */
	public static function add_screen( $callback, $parent = null ) {
		global $submenu;

		$plugin_page = self::get_plugin_page( $callback );

		if ( ! $parent ) {
			$parent = Menu::get_parent_key( $callback );
		}

		$screen_id = get_plugin_page_hookname( $plugin_page, $parent );

		// This screen has already been added.
		if ( in_array( $screen_id, self::$screen_ids, true ) ) {
			return;
		}

		self::$screen_ids[] = $screen_id;
	}

	/**
	 * Get the plugin page slug.
	 *
	 * @param string $callback Callback.
	 * @return string
	 */
	public static function get_plugin_page( $callback ) {
		$url   = Menu::get_callback_url( $callback );
		$parts = wp_parse_url( $url );

		if ( ! isset( $parts['query'] ) ) {
			return $callback;
		}

		parse_str( $parts['query'], $query );

		if ( ! isset( $query['page'] ) ) {
			return $callback;
		}

		$plugin_page = wp_unslash( $query['page'] );
		$plugin_page = plugin_basename( $plugin_page );
		return $plugin_page;
	}

	/**
	 * Register post type for use in WooCommerce Navigation screens.
	 *
	 * @param string $post_type Post type to add.
	 */
	public static function register_post_type( $post_type ) {
		if ( ! in_array( $post_type, self::$post_types, true ) ) {
			self::$post_types[] = $post_type;
		}
	}

	/**
	 * Register taxonomy for use in WooCommerce Navigation screens.
	 *
	 * @param string $taxonomy Taxonomy to add.
	 */
	public static function register_taxonomy( $taxonomy ) {
		if ( ! in_array( $taxonomy, self::$taxonomies, true ) ) {
			self::$taxonomies[] = $taxonomy;
		}
	}
}
woocommerce-admin/src/Features/PaymentGatewaySuggestions/PaymentGatewaysController.php000064400000010562151335517650025626 0ustar00<?php
/**
 * Logic for extending WC_REST_Payment_Gateways_Controller.
 */

namespace Automattic\WooCommerce\Admin\Features\PaymentGatewaySuggestions;

use Automattic\WooCommerce\Admin\Features\TransientNotices;

defined( 'ABSPATH' ) || exit;

/**
 * PaymentGateway class
 */
class PaymentGatewaysController {

	/**
	 * Initialize payment gateway changes.
	 */
	public static function init() {
		add_filter( 'woocommerce_rest_prepare_payment_gateway', array( __CLASS__, 'extend_response' ), 10, 3 );
		add_filter( 'admin_init', array( __CLASS__, 'possibly_do_connection_return_action' ) );
		add_action( 'woocommerce_admin_payment_gateway_connection_return', array( __CLASS__, 'handle_successfull_connection' ) );
	}

	/**
	 * Add necessary fields to REST API response.
	 *
	 * @param  WP_REST_Response   $response   Response data.
	 * @param  WC_Payment_Gateway $gateway    Payment gateway object.
	 * @param  WP_REST_Request    $request    Request object.
	 * @return WP_REST_Response
	 */
	public static function extend_response( $response, $gateway, $request ) {
		$data = $response->get_data();

		$data['needs_setup']          = $gateway->needs_setup();
		$data['post_install_scripts'] = self::get_post_install_scripts( $gateway );
		$data['settings_url']         = method_exists( $gateway, 'get_settings_url' )
			? $gateway->get_settings_url()
			: admin_url( 'admin.php?page=wc-settings&tab=checkout&section=' . strtolower( $gateway->id ) );

		$return_url             = wc_admin_url( '&task=payments&connection-return=' . strtolower( $gateway->id ) );
		$data['connection_url'] = method_exists( $gateway, 'get_connection_url' )
			? $gateway->get_connection_url( $return_url )
			: null;

		$data['setup_help_text'] = method_exists( $gateway, 'get_setup_help_text' )
			? $gateway->get_setup_help_text()
			: null;

		$data['required_settings_keys'] = method_exists( $gateway, 'get_required_settings_keys' )
			? $gateway->get_required_settings_keys()
			: array();

		$response->set_data( $data );

		return $response;
	}

	/**
	 * Get payment gateway scripts for post-install.
	 *
	 * @param  WC_Payment_Gateway $gateway Payment gateway object.
	 * @return array Install scripts.
	 */
	public static function get_post_install_scripts( $gateway ) {
		$scripts    = array();
		$wp_scripts = wp_scripts();

		$handles = method_exists( $gateway, 'get_post_install_script_handles' )
			? $gateway->get_post_install_script_handles()
			: array();

		foreach ( $handles as $handle ) {
			if ( isset( $wp_scripts->registered[ $handle ] ) ) {
				$scripts[] = $wp_scripts->registered[ $handle ];
			}
		}

		return $scripts;
	}

	/**
	 * Call an action after a gating has been successfully returned.
	 */
	public static function possibly_do_connection_return_action() {
		// phpcs:disable WordPress.Security.NonceVerification
		if (
			! isset( $_GET['page'] ) ||
			'wc-admin' !== $_GET['page'] ||
			! isset( $_GET['task'] ) ||
			'payments' !== $_GET['task'] ||
			! isset( $_GET['connection-return'] )
		) {
			return;
		}

		$gateway_id = sanitize_text_field( wp_unslash( $_GET['connection-return'] ) );

		// phpcs:enable WordPress.Security.NonceVerification

		do_action( 'woocommerce_admin_payment_gateway_connection_return', $gateway_id );
	}

	/**
	 * Handle a successful gateway connection.
	 *
	 * @param string $gateway_id Gateway ID.
	 */
	public static function handle_successfull_connection( $gateway_id ) {
		// phpcs:disable WordPress.Security.NonceVerification
		if ( ! isset( $_GET['success'] ) || 1 !== intval( $_GET['success'] ) ) {
			return;
		}
		// phpcs:enable WordPress.Security.NonceVerification

		$payment_gateways = WC()->payment_gateways()->payment_gateways();
		$payment_gateway  = isset( $payment_gateways[ $gateway_id ] ) ? $payment_gateways[ $gateway_id ] : null;

		if ( ! $payment_gateway ) {
			return;
		}

		$payment_gateway->update_option( 'enabled', 'yes' );

		TransientNotices::add(
			array(
				'user_id' => get_current_user_id(),
				'id'      => 'payment-gateway-connection-return-' . str_replace( ',', '-', $gateway_id ),
				'status'  => 'success',
				'content' => sprintf(
					/* translators: the title of the payment gateway */
					__( '%s connected successfully', 'woocommerce' ),
					$payment_gateway->method_title
				),
			)
		);

		wc_admin_record_tracks_event(
			'tasklist_payment_connect_method',
			array(
				'payment_method' => $gateway_id,
			)
		);

		wp_safe_redirect( wc_admin_url() );
	}
}
woocommerce-admin/src/Features/PaymentGatewaySuggestions/Init.php000064400000004151151335517650021340 0ustar00<?php
/**
 * Handles running payment gateway suggestion specs
 */

namespace Automattic\WooCommerce\Admin\Features\PaymentGatewaySuggestions;

defined( 'ABSPATH' ) || exit;

use Automattic\WooCommerce\Admin\RemoteInboxNotifications\SpecRunner;
use Automattic\WooCommerce\Admin\Features\PaymentGatewaySuggestions\DefaultPaymentGateways;
use Automattic\WooCommerce\Admin\Features\PaymentGatewaySuggestions\PaymentGatewaysController;

/**
 * Remote Payment Methods engine.
 * This goes through the specs and gets eligible payment gateways.
 */
class Init {
	const SPECS_TRANSIENT_NAME = 'woocommerce_admin_payment_gateway_suggestions_specs';

	/**
	 * Constructor.
	 */
	public function __construct() {
		add_action( 'change_locale', array( __CLASS__, 'delete_specs_transient' ) );
		PaymentGatewaysController::init();
	}

	/**
	 * Go through the specs and run them.
	 */
	public static function get_suggestions() {
		$suggestions = array();
		$specs       = self::get_specs();

		foreach ( $specs as $spec ) {
			$suggestion    = EvaluateSuggestion::evaluate( $spec );
			$suggestions[] = $suggestion;
		}

		return array_values(
			array_filter(
				$suggestions,
				function( $suggestion ) {
					return ! property_exists( $suggestion, 'is_visible' ) || $suggestion->is_visible;
				}
			)
		);

	}

	/**
	 * Delete the specs transient.
	 */
	public static function delete_specs_transient() {
		delete_transient( self::SPECS_TRANSIENT_NAME );
	}

	/**
	 * Get specs or fetch remotely if they don't exist.
	 */
	public static function get_specs() {
		$specs = get_transient( self::SPECS_TRANSIENT_NAME );

		// Fetch specs if they don't yet exist.
		if ( false === $specs || ! is_array( $specs ) || 0 === count( $specs ) ) {
			if ( 'no' === get_option( 'woocommerce_show_marketplace_suggestions', 'yes' ) ) {
				return DefaultPaymentGateways::get_all();
			}

			$specs = DataSourcePoller::read_specs_from_data_sources();

			// Fall back to default specs if polling failed.
			if ( ! $specs ) {
				return DefaultPaymentGateways::get_all();
			}

			set_transient( self::SPECS_TRANSIENT_NAME, $specs, 7 * DAY_IN_SECONDS );
		}

		return $specs;
	}
}
woocommerce-admin/src/Features/PaymentGatewaySuggestions/EvaluateSuggestion.php000064400000001534151335517650024255 0ustar00<?php
/**
 * Evaluates the spec and returns a status.
 */

namespace Automattic\WooCommerce\Admin\Features\PaymentGatewaySuggestions;

defined( 'ABSPATH' ) || exit;

use Automattic\WooCommerce\Admin\RemoteInboxNotifications\RuleEvaluator;

/**
 * Evaluates the spec and returns the evaluated suggestion.
 */
class EvaluateSuggestion {
	/**
	 * Evaluates the spec and returns the suggestion.
	 *
	 * @param object|array $spec The suggestion to evaluate.
	 * @return object The evaluated suggestion.
	 */
	public static function evaluate( $spec ) {
		$rule_evaluator = new RuleEvaluator();
		$suggestion     = is_array( $spec ) ? (object) $spec : clone $spec;

		if ( isset( $suggestion->is_visible ) ) {
			$is_visible             = $rule_evaluator->evaluate( $suggestion->is_visible );
			$suggestion->is_visible = $is_visible;
		}

		return $suggestion;
	}
}
woocommerce-admin/src/Features/PaymentGatewaySuggestions/DefaultPaymentGateways.php000064400000031432151335517650025066 0ustar00<?php
/**
 * Gets a list of fallback methods if remote fetching is disabled.
 */

namespace Automattic\WooCommerce\Admin\Features\PaymentGatewaySuggestions;

defined( 'ABSPATH' ) || exit;

use Automattic\WooCommerce\Admin\Features\OnboardingTasks\Init as OnboardingTasks;

/**
 * Default Payment Gateways
 */
class DefaultPaymentGateways {

	/**
	 * Get default specs.
	 *
	 * @return array Default specs.
	 */
	public static function get_all() {
		return array(
			array(
				'id'         => 'payfast',
				'title'      => __( 'PayFast', 'woocommerce' ),
				'content'    => __( 'The PayFast extension for WooCommerce enables you to accept payments by Credit Card and EFT via one of South Africa’s most popular payment gateways. No setup fees or monthly subscription costs. Selecting this extension will configure your store to use South African rands as the selected currency.', 'woocommerce' ),
				'image'      => WC()->plugin_url() . '/assets/images/payfast.png',
				'plugins'    => array( 'woocommerce-payfast-gateway' ),
				'is_visible' => array(
					(object) array(
						'type'      => 'base_location_country',
						'value'     => 'ZA',
						'operation' => '=',
					),
					self::get_rules_for_cbd( false ),
				),
			),
			array(
				'id'                      => 'stripe',
				'title'                   => __( ' Stripe', 'woocommerce' ),
				'content'                 => __( 'Accept debit and credit cards in 135+ currencies, methods such as Alipay, and one-touch checkout with Apple Pay.', 'woocommerce' ),
				'image'                   => WC()->plugin_url() . '/assets/images/stripe.png',
				'plugins'                 => array( 'woocommerce-gateway-stripe' ),
				'is_visible'              => array(
					// https://stripe.com/global.
					self::get_rules_for_countries(
						array(
							'AU',
							'AT',
							'BE',
							'BG',
							'BR',
							'CA',
							'CY',
							'CZ',
							'DK',
							'EE',
							'FI',
							'FR',
							'DE',
							'GR',
							'HK',
							'IN',
							'IE',
							'IT',
							'JP',
							'LV',
							'LT',
							'LU',
							'MY',
							'MT',
							'MX',
							'NL',
							'NZ',
							'NO',
							'PL',
							'PT',
							'RO',
							'SG',
							'SK',
							'SI',
							'ES',
							'SE',
							'CH',
							'GB',
							'US',
							'PR',
						)
					),
					self::get_rules_for_cbd( false ),
				),
				'recommendation_priority' => 3,
			),
			array(
				'id'         => 'paystack',
				'title'      => __( 'Paystack', 'woocommerce' ),
				'content'    => __( 'Paystack helps African merchants accept one-time and recurring payments online with a modern, safe, and secure payment gateway.', 'woocommerce' ),
				'image'      => plugins_url( 'images/onboarding/paystack.png', WC_ADMIN_PLUGIN_FILE ),
				'plugins'    => array( 'woo-paystack' ),
				'is_visible' => array(
					self::get_rules_for_countries( array( 'ZA', 'GH', 'NG' ) ),
					self::get_rules_for_cbd( false ),
				),
			),
			array(
				'id'         => 'kco',
				'title'      => __( 'Klarna Checkout', 'woocommerce' ),
				'content'    => __( 'Choose the payment that you want, pay now, pay later or slice it. No credit card numbers, no passwords, no worries.', 'woocommerce' ),
				'image'      => WC()->plugin_url() . '/assets/images/klarna-black.png',
				'plugins'    => array( 'klarna-checkout-for-woocommerce' ),
				'is_visible' => array(
					self::get_rules_for_countries( array( 'SE', 'FI', 'NO' ) ),
					self::get_rules_for_cbd( false ),
				),
			),
			array(
				'id'         => 'klarna_payments',
				'title'      => __( 'Klarna Payments', 'woocommerce' ),
				'content'    => __( 'Choose the payment that you want, pay now, pay later or slice it. No credit card numbers, no passwords, no worries.', 'woocommerce' ),
				'image'      => WC()->plugin_url() . '/assets/images/klarna-black.png',
				'plugins'    => array( 'klarna-payments-for-woocommerce' ),
				'is_visible' => array(
					self::get_rules_for_countries(
						array(
							'DK',
							'DE',
							'AT',
							'NL',
							'CH',
							'BE',
							'SP',
							'PL',
							'FR',
							'IT',
							'GB',
						)
					),
					self::get_rules_for_cbd( false ),
				),
			),
			array(
				'id'         => 'mollie_wc_gateway_banktransfer',
				'title'      => __( 'Mollie', 'woocommerce' ),
				'content'    => __( 'Effortless payments by Mollie: Offer global and local payment methods, get onboarded in minutes, and supported in your language.', 'woocommerce' ),
				'image'      => plugins_url( 'images/onboarding/mollie.svg', WC_ADMIN_PLUGIN_FILE ),
				'plugins'    => array( 'mollie-payments-for-woocommerce' ),
				'is_visible' => array(
					self::get_rules_for_countries(
						array(
							'FR',
							'DE',
							'GB',
							'AT',
							'CH',
							'ES',
							'IT',
							'PL',
							'FI',
							'NL',
							'BE',
						)
					),
				),
			),
			array(
				'id'                      => 'woo-mercado-pago-custom',
				'title'                   => __( 'Mercado Pago Checkout Pro & Custom', 'woocommerce' ),
				'content'                 => __( 'Accept credit and debit cards, offline (cash or bank transfer) and logged-in payments with money in Mercado Pago. Safe and secure payments with the leading payment processor in LATAM.', 'woocommerce' ),
				'image'                   => plugins_url( 'images/onboarding/mercadopago.png', WC_ADMIN_PLUGIN_FILE ),
				'plugins'                 => array( 'woocommerce-mercadopago' ),
				'is_visible'              => array(
					self::get_rules_for_countries( array( 'AR', 'BR', 'CL', 'CO', 'MX', 'PE', 'UY' ) ),
				),
				'recommendation_priority' => 2,
				'is_local_partner'        => true,
			),
			array(
				'id'         => 'ppcp-gateway',
				'title'      => __( 'PayPal Payments', 'woocommerce' ),
				'content'    => __( "Safe and secure payments using credit cards or your customer's PayPal account.", 'woocommerce' ),
				'image'      => WC()->plugin_url() . '/assets/images/paypal.png',
				'plugins'    => array( 'woocommerce-paypal-payments' ),
				'is_visible' => array(
					(object) array(
						'type'      => 'base_location_country',
						'value'     => 'IN',
						'operation' => '!=',
					),
					self::get_rules_for_cbd( false ),
				),
			),
			array(
				'id'         => 'cod',
				'title'      => __( 'Cash on delivery', 'woocommerce' ),
				'content'    => __( 'Take payments in cash upon delivery.', 'woocommerce' ),
				'image'      => plugins_url( 'images/onboarding/cod.svg', WC_ADMIN_PLUGIN_FILE ),
				'is_visible' => array(
					self::get_rules_for_cbd( false ),
				),
			),
			array(
				'id'         => 'bacs',
				'title'      => __( 'Direct bank transfer', 'woocommerce' ),
				'content'    => __( 'Take payments via bank transfer.', 'woocommerce' ),
				'image'      => plugins_url( 'images/onboarding/bacs.svg', WC_ADMIN_PLUGIN_FILE ),
				'is_visible' => array(
					self::get_rules_for_cbd( false ),
				),
			),
			array(
				'id'                      => 'woocommerce_payments',
				'title'                   => __( 'WooCommerce Payments', 'woocommerce' ),
				'content'                 => __(
					'Manage transactions without leaving your WordPress Dashboard. Only with WooCommerce Payments.',
					'woocommerce'
				),
				'image'                   => plugins_url( 'images/onboarding/wcpay.svg', WC_ADMIN_PLUGIN_FILE ),
				'plugins'                 => array( 'woocommerce-payments' ),
				'description'             => 'Try the new way to get paid. Securely accept credit and debit cards on your site. Manage transactions without leaving your WordPress dashboard. Only with WooCommerce Payments.',
				'is_visible'              => array(
					self::get_rules_for_cbd( false ),
					self::get_rules_for_countries( self::get_wcpay_countries() ),
				),
				'recommendation_priority' => 1,
			),
			array(
				'id'         => 'razorpay',
				'title'      => __( 'Razorpay', 'woocommerce' ),
				'content'    => __( 'The official Razorpay extension for WooCommerce allows you to accept credit cards, debit cards, netbanking, wallet, and UPI payments.', 'woocommerce' ),
				'image'      => plugins_url( 'images/onboarding/razorpay.svg', WC_ADMIN_PLUGIN_FILE ),
				'plugins'    => array( 'woo-razorpay' ),
				'is_visible' => array(
					(object) array(
						'type'      => 'base_location_country',
						'value'     => 'IN',
						'operation' => '=',
					),
					self::get_rules_for_cbd( false ),
				),
			),
			array(
				'id'         => 'payubiz',
				'title'      => __( 'PayU for WooCommerce', 'woocommerce' ),
				'content'    => __( 'Enable PayU’s exclusive plugin for WooCommerce to start accepting payments in 100+ payment methods available in India including credit cards, debit cards, UPI, & more!', 'woocommerce' ),
				'image'      => plugins_url( 'images/onboarding/payu.svg', WC_ADMIN_PLUGIN_FILE ),
				'plugins'    => array( 'payu-india' ),
				'is_visible' => array(
					(object) array(
						'type'      => 'base_location_country',
						'value'     => 'IN',
						'operation' => '=',
					),
					self::get_rules_for_cbd( false ),
				),
			),
			array(
				'id'         => 'eway',
				'title'      => __( 'Eway', 'woocommerce' ),
				'content'    => __( 'The Eway extension for WooCommerce allows you to take credit card payments directly on your store without redirecting your customers to a third party site to make payment.', 'woocommerce' ),
				'image'      => plugins_url( 'images/onboarding/eway.png', WC_ADMIN_PLUGIN_FILE ),
				'plugins'    => array( 'woocommerce-gateway-eway' ),
				'is_visible' => array(
					self::get_rules_for_countries( array( 'AU', 'NZ' ) ),
					self::get_rules_for_cbd( false ),
				),
			),
			array(
				'id'         => 'square_credit_card',
				'title'      => __( 'Square', 'woocommerce' ),
				'content'    => __( 'Securely accept credit and debit cards with one low rate, no surprise fees (custom rates available). Sell online and in store and track sales and inventory in one place.', 'woocommerce' ),
				'image'      => WC()->plugin_url() . '/assets/images/square-black.png',
				'plugins'    => array( 'woocommerce-square' ),
				'is_visible' => array(
					(object) array(
						'type'     => 'or',
						'operands' => (object) array(
							array(
								self::get_rules_for_countries( array( 'US' ) ),
								self::get_rules_for_cbd( true ),
							),
							array(
								self::get_rules_for_countries( array( 'US', 'CA', 'JP', 'GB', 'AU', 'IE', 'FR' ) ),
								self::get_rules_for_selling_venues( array( 'brick-mortar', 'brick-mortar-other' ) ),
							),
						),
					),
				),
			),
		);
	}

	/**
	 * Get array of countries supported by WCPay depending on feature flag.
	 *
	 * @return array Array of countries.
	 */
	public static function get_wcpay_countries() {
		return array( 'US', 'PR', 'AU', 'CA', 'DE', 'ES', 'FR', 'GB', 'IE', 'IT', 'NZ', 'AT', 'BE', 'NL', 'PL', 'PT', 'CH', 'HK', 'SG' );
	}

	/**
	 * Get rules that match the store base location to one of the provided countries.
	 *
	 * @param array $countries Array of countries to match.
	 * @return object Rules to match.
	 */
	public static function get_rules_for_countries( $countries ) {
		$rules = array();

		foreach ( $countries as $country ) {
			$rules[] = (object) array(
				'type'      => 'base_location_country',
				'value'     => $country,
				'operation' => '=',
			);
		}

		return (object) array(
			'type'     => 'or',
			'operands' => $rules,
		);
	}

	/**
	 * Get rules that match the store's selling venues.
	 *
	 * @param array $selling_venues Array of venues to match.
	 * @return object Rules to match.
	 */
	public static function get_rules_for_selling_venues( $selling_venues ) {
		$rules = array();

		foreach ( $selling_venues as $venue ) {
			$rules[] = (object) array(
				'type'         => 'option',
				'transformers' => array(
					(object) array(
						'use'       => 'dot_notation',
						'arguments' => (object) array(
							'path' => 'selling_venues',
						),
					),
				),
				'option_name'  => 'woocommerce_onboarding_profile',
				'operation'    => '=',
				'value'        => $venue,
				'default'      => array(),
			);
		}

		return (object) array(
			'type'     => 'or',
			'operands' => $rules,
		);
	}

	/**
	 * Get default rules for CBD based on given argument.
	 *
	 * @param bool $should_have Whether or not the store should have CBD as an industry (true) or not (false).
	 * @return array Rules to match.
	 */
	public static function get_rules_for_cbd( $should_have ) {
		return (object) array(
			'type'         => 'option',
			'transformers' => array(
				(object) array(
					'use'       => 'dot_notation',
					'arguments' => (object) array(
						'path' => 'industry',
					),
				),
				(object) array(
					'use'       => 'array_column',
					'arguments' => (object) array(
						'key' => 'slug',
					),
				),
			),
			'option_name'  => 'woocommerce_onboarding_profile',
			'operation'    => $should_have ? 'contains' : '!contains',
			'value'        => 'cbd-other-hemp-derived-products',
			'default'      => array(),
		);
	}

}
woocommerce-admin/src/Features/PaymentGatewaySuggestions/DataSourcePoller.php000064400000007151151335517650023650 0ustar00<?php
/**
 * Handles polling and storage of specs
 */

namespace Automattic\WooCommerce\Admin\Features\PaymentGatewaySuggestions;

defined( 'ABSPATH' ) || exit;

/**
 * Specs data source poller class.
 * This handles polling specs from JSON endpoints.
 */
class DataSourcePoller {
	/**
	 * Name of data sources filter.
	 */
	const FILTER_NAME = 'woocommerce_admin_payment_gateway_suggestions_data_sources';

	/**
	 * Default data sources array.
	 */
	const DATA_SOURCES = array(
		'https://woocommerce.com/wp-json/wccom/payment-gateway-suggestions/1.0/suggestions.json',
	);

	/**
	 * The logger instance.
	 *
	 * @var WC_Logger|null
	 */
	protected static $logger = null;

	/**
	 * Get the logger instance.
	 *
	 * @return WC_Logger
	 */
	private static function get_logger() {
		if ( is_null( self::$logger ) ) {
			self::$logger = wc_get_logger();
		}

		return self::$logger;
	}

	/**
	 * Reads the data sources for specs and persists those specs.
	 *
	 * @return bool Whether any specs were read.
	 */
	public static function read_specs_from_data_sources() {
		$specs        = array();
		$data_sources = apply_filters( self::FILTER_NAME, self::DATA_SOURCES );

		// Note that this merges the specs from the data sources based on the
		// id - last one wins.
		foreach ( $data_sources as $url ) {
			$specs_from_data_source = self::read_data_source( $url );
			self::merge_specs( $specs_from_data_source, $specs, $url );
		}

		return $specs;
	}

	/**
	 * Read a single data source and return the read specs
	 *
	 * @param string $url The URL to read the specs from.
	 *
	 * @return array The specs that have been read from the data source.
	 */
	private static function read_data_source( $url ) {
		$logger_context = array( 'source' => $url );
		$logger         = self::get_logger();
		$response       = wp_remote_get(
			add_query_arg(
				'_locale',
				get_user_locale(),
				$url
			)
		);

		if ( is_wp_error( $response ) || ! isset( $response['body'] ) ) {
			$logger->error(
				'Error getting remote payment method data feed',
				$logger_context
			);
			// phpcs:ignore
			$logger->error( print_r( $response, true ), $logger_context );

			return [];
		}

		$body  = $response['body'];
		$specs = json_decode( $body );

		if ( null === $specs ) {
			$logger->error(
				'Empty response in remote payment method data feed',
				$logger_context
			);

			return [];
		}

		if ( ! is_array( $specs ) ) {
			$logger->error(
				'Remote payment method data feed is not an array',
				$logger_context
			);

			return [];
		}

		return $specs;
	}

	/**
	 * Merge the specs.
	 *
	 * @param Array  $specs_to_merge_in The specs to merge in to $specs.
	 * @param Array  $specs             The list of specs being merged into.
	 * @param string $url               The url of the feed being merged in (for error reporting).
	 */
	private static function merge_specs( $specs_to_merge_in, &$specs, $url ) {
		foreach ( $specs_to_merge_in as $spec ) {
			if ( ! self::validate_spec( $spec, $url ) ) {
				continue;
			}

			$id           = $spec->id;
			$specs[ $id ] = $spec;
		}
	}

	/**
	 * Validate the spec.
	 *
	 * @param object $spec The spec to validate.
	 * @param string $url  The url of the feed that provided the spec.
	 *
	 * @return bool The result of the validation.
	 */
	private static function validate_spec( $spec, $url ) {
		$logger         = self::get_logger();
		$logger_context = array( 'source' => $url );

		if ( ! isset( $spec->id ) ) {
			$logger->error(
				'Spec is invalid because the id is missing in feed',
				$logger_context
			);
			// phpcs:ignore
			$logger->error( print_r( $spec, true ), $logger_context );

			return false;
		}

		return true;
	}
}
woocommerce-admin/src/Features/ShippingLabelBannerDisplayRules.php000064400000012424151335517650021455 0ustar00<?php
/**
 * WooCommerce Shipping Label Banner Display Rules.
 * NOTE: DO NOT edit this file in WooCommerce core, this is generated from woocommerce-admin.
 */

namespace Automattic\WooCommerce\Admin\Features;

/**
 * Determines whether or not the Shipping Label Banner should be displayed
 */
class ShippingLabelBannerDisplayRules {

	/**
	 * Holds the installed Jetpack version.
	 *
	 * @var string
	 */
	private $jetpack_version;


	/**
	 * Whether or not the installed Jetpack is connected.
	 *
	 * @var bool
	 */
	private $jetpack_connected;

	/**
	 * Holds the installed WooCommerce Shipping & Tax version.
	 *
	 * @var string
	 */
	private $wcs_version;

	/**
	 * Whether or not there're plugins installed incompatible with the banner.
	 *
	 * @var bool
	 */
	private $no_incompatible_plugins_installed;

	/**
	 * Whether or not the WooCommerce Shipping & Tax ToS has been accepted.
	 *
	 * @var bool
	 */
	private $wcs_tos_accepted;

	/**
	 * Minimum supported Jetpack version.
	 *
	 * @var string
	 */
	private $min_jetpack_version = '4.4';

	/**
	 * Minimum supported WooCommerce Shipping & Tax version.
	 *
	 * @var string
	 */
	private $min_wcs_version = '1.22.5';

	/**
	 * Supported countries by USPS, see: https://webpmt.usps.gov/pmt010.cfm
	 *
	 * @var array
	 */
	private $supported_countries = array( 'US', 'AS', 'PR', 'VI', 'GU', 'MP', 'UM', 'FM', 'MH' );

	/**
	 * Array of supported currency codes.
	 *
	 * @var array
	 */
	private $supported_currencies = array( 'USD' );


	/**
	 * Constructor.
	 *
	 * @param string $jetpack_version Installed Jetpack version to check.
	 * @param bool   $jetpack_connected Is Jetpack connected?.
	 * @param string $wcs_version Installed WooCommerce Shipping & Tax version to check.
	 * @param bool   $wcs_tos_accepted WooCommerce Shipping & Tax Terms of Service accepted?.
	 * @param bool   $incompatible_plugins_installed Are there any incompatible plugins installed?.
	 */
	public function __construct( $jetpack_version, $jetpack_connected, $wcs_version, $wcs_tos_accepted, $incompatible_plugins_installed ) {
		$this->jetpack_version                   = $jetpack_version;
		$this->jetpack_connected                 = $jetpack_connected;
		$this->wcs_version                       = $wcs_version;
		$this->wcs_tos_accepted                  = $wcs_tos_accepted;
		$this->no_incompatible_plugins_installed = ! $incompatible_plugins_installed;
	}

	/**
	 * Determines whether banner is eligible for display (does not include a/b logic).
	 */
	public function should_display_banner() {
		return $this->banner_not_dismissed() &&
			$this->jetpack_installed_and_active() &&
			$this->jetpack_up_to_date() &&
			$this->jetpack_connected &&
			$this->no_incompatible_plugins_installed &&
			$this->order_has_shippable_products() &&
			$this->store_in_us_and_usd() &&
			( $this->wcs_not_installed() || (
				$this->wcs_up_to_date() && ! $this->wcs_tos_accepted
			) );
	}

	/**
	 * Checks if the banner was not dismissed by the user.
	 *
	 * @return bool
	 */
	private function banner_not_dismissed() {
		$dismissed_timestamp_ms = get_option( 'woocommerce_shipping_dismissed_timestamp' );

		if ( ! is_numeric( $dismissed_timestamp_ms ) ) {
			return true;
		}
		$dismissed_timestamp_ms = intval( $dismissed_timestamp_ms );
		$dismissed_timestamp    = intval( round( $dismissed_timestamp_ms / 1000 ) );
		$expired_timestamp      = $dismissed_timestamp + 24 * 60 * 60; // 24 hours from click time

		$dismissed_for_good = -1 === $dismissed_timestamp_ms;
		$dismissed_24h      = time() < $expired_timestamp;

		return ! $dismissed_for_good && ! $dismissed_24h;
	}

	/**
	 * Checks if jetpack is installed and active.
	 *
	 * @return bool
	 */
	private function jetpack_installed_and_active() {
		return ! ! $this->jetpack_version;
	}

	/**
	 * Checks if Jetpack version is supported.
	 *
	 * @return bool
	 */
	private function jetpack_up_to_date() {
		return version_compare( $this->jetpack_version, $this->min_jetpack_version, '>=' );
	}

	/**
	 * Checks if there's a shippable product in the current order.
	 *
	 * @return bool
	 */
	private function order_has_shippable_products() {
		$post = get_post();
		if ( ! $post ) {
			return false;
		}

		$order = wc_get_order( get_post()->ID );

		if ( ! $order ) {
			return false;
		}
		// At this point (no packaging data), only show if there's at least one existing and shippable product.
		foreach ( $order->get_items() as $item ) {
			if ( $item instanceof \WC_Order_Item_Product ) {
				$product = $item->get_product();

				if ( $product && $product->needs_shipping() ) {
					return true;
				}
			}
		}

		return false;
	}

	/**
	 * Checks if the store is in the US and has its default currency set to USD.
	 *
	 * @return bool
	 */
	private function store_in_us_and_usd() {
		$base_currency = get_woocommerce_currency();
		$base_location = wc_get_base_location();

		return in_array( $base_currency, $this->supported_currencies, true ) && in_array( $base_location['country'], $this->supported_countries, true );
	}

	/**
	 * Checks if WooCommerce Shipping & Tax is not installed.
	 *
	 * @return bool
	 */
	private function wcs_not_installed() {
		return ! $this->wcs_version;
	}

	/**
	 * Checks if WooCommerce Shipping & Tax is up to date.
	 */
	private function wcs_up_to_date() {
		return $this->wcs_version && version_compare( $this->wcs_version, $this->min_wcs_version, '>=' );
	}
}
woocommerce-admin/src/Features/TransientNotices.php000064400000005576151335517650016553 0ustar00<?php
/**
 * WooCommerce Transient Notices
 * NOTE: DO NOT edit this file in WooCommerce core, this is generated from woocommerce-admin.
 */

namespace Automattic\WooCommerce\Admin\Features;

use \Automattic\WooCommerce\Admin\Loader;

/**
 * Shows print shipping label banner on edit order page.
 */
class TransientNotices {

	/**
	 * Option name for the queue.
	 */
	const QUEUE_OPTION = 'woocommerce_admin_transient_notices_queue';

	/**
	 * Constructor
	 */
	public function __construct() {
		add_filter( 'woocommerce_admin_preload_options', array( $this, 'preload_options' ) );
	}


	/**
	 * Get all notices in the queue.
	 *
	 * @return array
	 */
	public static function get_queue() {
		return get_option( self::QUEUE_OPTION, array() );
	}

	/**
	 * Get all notices in the queue by a given user ID.
	 *
	 * @param int $user_id User ID.
	 * @return array
	 */
	public static function get_queue_by_user( $user_id ) {
		$notices = self::get_queue();

		return array_filter(
			$notices,
			function( $notice ) use ( $user_id ) {
				return ! isset( $notice['user_id'] ) ||
					null === $notice['user_id'] ||
					$user_id === $notice['user_id'];
			}
		);
	}

	/**
	 * Get a notice by ID.
	 *
	 * @param array $notice_id Notice of ID to get.
	 * @return array|null
	 */
	public static function get( $notice_id ) {
		$queue = self::get_queue();

		if ( isset( $queue[ $notice_id ] ) ) {
			return $queue[ $notice_id ];
		}

		return null;
	}

	/**
	 * Add a notice to be shown.
	 *
	 * @param array $notice Notice.
	 *    $notice = array(
	 *      'id'      => (string) Unique ID for the notice. Required.
	 *      'user_id' => (int|null) User ID to show the notice to.
	 *      'status'  => (string) info|error|success
	 *      'content' => (string) Content to be shown for the notice. Required.
	 *      'options' => (array) Array of options to be passed to the notice component.
	 *       See https://developer.wordpress.org/block-editor/reference-guides/data/data-core-notices/#createNotice for available options.
	 *    ).
	 */
	public static function add( $notice ) {
		$queue = self::get_queue();

		$defaults               = array(
			'user_id' => null,
			'status'  => 'info',
			'options' => array(),
		);
		$notice_data            = array_merge( $defaults, $notice );
		$notice_data['options'] = (object) $notice_data['options'];

		$queue[ $notice['id'] ] = $notice_data;
		update_option( self::QUEUE_OPTION, $queue );
	}

	/**
	 * Remove a notice by ID.
	 *
	 * @param array $notice_id Notice of ID to remove.
	 */
	public static function remove( $notice_id ) {
		$queue = self::get_queue();
		unset( $queue[ $notice_id ] );
		update_option( self::QUEUE_OPTION, $queue );
	}

	/**
	 * Preload options to prime state of the application.
	 *
	 * @param array $options Array of options to preload.
	 * @return array
	 */
	public function preload_options( $options ) {
		$options[] = self::QUEUE_OPTION;

		return $options;
	}

}
woocommerce-admin/src/Features/Features.php000064400000024337151335517650015031 0ustar00<?php
/**
 * Features loader for features developed in WooCommerce Admin.
 */

namespace Automattic\WooCommerce\Admin\Features;

use Automattic\WooCommerce\Admin\Loader;

/**
 * Features Class.
 */
class Features {
	/**
	 * Class instance.
	 *
	 * @var Loader instance
	 */
	protected static $instance = null;

	/**
	 * Optional features
	 *
	 * @var array
	 */
	protected static $optional_features = array(
		'navigation'                 => array( 'default' => 'no' ),
		'settings'                   => array( 'default' => 'no' ),
		'analytics'                  => array( 'default' => 'yes' ),
		'remote-inbox-notifications' => array( 'default' => 'yes' ),
	);

	/**
	 * Beta features
	 *
	 * @var array
	 */
	protected static $beta_features = array(
		'navigation',
		'settings',
	);

	/**
	 * Get class instance.
	 */
	public static function get_instance() {
		if ( ! self::$instance ) {
			self::$instance = new self();
		}
		return self::$instance;
	}

	/**
	 * Constructor.
	 */
	public function __construct() {
		// Load feature before WooCommerce update hooks.
		add_action( 'init', array( __CLASS__, 'load_features' ), 4 );
		add_filter( 'woocommerce_get_sections_advanced', array( __CLASS__, 'add_features_section' ) );
		add_filter( 'woocommerce_get_settings_advanced', array( __CLASS__, 'add_features_settings' ), 10, 2 );
		add_action( 'admin_enqueue_scripts', array( __CLASS__, 'maybe_load_beta_features_modal' ) );
		add_action( 'admin_enqueue_scripts', array( __CLASS__, 'load_scripts' ), 15 );
		add_filter( 'admin_body_class', array( __CLASS__, 'add_admin_body_classes' ) );
		add_filter( 'update_option_woocommerce_allow_tracking', array( __CLASS__, 'maybe_disable_features' ), 10, 2 );
	}

	/**
	 * Gets a build configured array of enabled WooCommerce Admin features/sections, but does not respect optionally disabled features.
	 *
	 * @return array Enabled Woocommerce Admin features/sections.
	 */
	public static function get_features() {
		return apply_filters( 'woocommerce_admin_features', array() );
	}

	/**
	 * Gets the optional feature options as an associative array that can be toggled on or off.
	 *
	 * @return array
	 */
	public static function get_optional_feature_options() {
		$features = [];

		foreach ( array_keys( self::$optional_features ) as $optional_feature_key ) {
			$feature_class = self::get_feature_class( $optional_feature_key );

			if ( $feature_class ) {
				$features[ $optional_feature_key ] = $feature_class::TOGGLE_OPTION_NAME;
			}
		}
		return $features;
	}

	/**
	 * Returns if a specific wc-admin feature exists in the current environment.
	 *
	 * @param  string $feature Feature slug.
	 * @return bool Returns true if the feature exists.
	 */
	public static function exists( $feature ) {
		$features = self::get_features();
		return in_array( $feature, $features, true );
	}

	/**
	 * Get the feature class as a string.
	 *
	 * @param string $feature Feature name.
	 * @return string|null
	 */
	public static function get_feature_class( $feature ) {
		$feature       = str_replace( '-', '', ucwords( strtolower( $feature ), '-' ) );
		$feature_class = 'Automattic\\WooCommerce\\Admin\\Features\\' . $feature;

		if ( class_exists( $feature_class ) ) {
			return $feature_class;
		}

		// Handle features contained in subdirectory.
		if ( class_exists( $feature_class . '\\Init' ) ) {
			return $feature_class . '\\Init';
		}

		return null;
	}

	/**
	 * Class loader for enabled WooCommerce Admin features/sections.
	 */
	public static function load_features() {
		$features = self::get_features();
		foreach ( $features as $feature ) {
			$feature_class = self::get_feature_class( $feature );

			if ( $feature_class ) {
				new $feature_class();
			}
		}
	}

	/**
	 * Gets a build configured array of enabled WooCommerce Admin respecting optionally disabled features.
	 *
	 * @return array Enabled Woocommerce Admin features/sections.
	 */
	public static function get_available_features() {
		$features                      = self::get_features();
		$optional_feature_keys         = array_keys( self::$optional_features );
		$optional_features_unavailable = [];

		/**
		 * Filter allowing WooCommerce Admin optional features to be disabled.
		 *
		 * @param bool $disabled False.
		 */
		if ( apply_filters( 'woocommerce_admin_disabled', false ) ) {
			return array_values( array_diff( $features, $optional_feature_keys ) );
		}

		foreach ( $optional_feature_keys as $optional_feature_key ) {
			$feature_class = self::get_feature_class( $optional_feature_key );

			if ( $feature_class ) {
				$default = isset( self::$optional_features[ $optional_feature_key ]['default'] ) ?
					self::$optional_features[ $optional_feature_key ]['default'] :
					'no';

				// Check if the feature is currently being enabled, if it is continue.
				/* phpcs:disable WordPress.Security.NonceVerification */
				$feature_option = $feature_class::TOGGLE_OPTION_NAME;
				if ( isset( $_POST[ $feature_option ] ) && '1' === $_POST[ $feature_option ] ) {
					continue;
				}

				if ( 'yes' !== get_option( $feature_class::TOGGLE_OPTION_NAME, $default ) ) {
					$optional_features_unavailable[] = $optional_feature_key;
				}
			}
		}

		return array_values( array_diff( $features, $optional_features_unavailable ) );
	}

	/**
	 * Check if a feature is enabled.
	 *
	 * @param string $feature Feature slug.
	 * @return bool
	 */
	public static function is_enabled( $feature ) {
		$available_features = self::get_available_features();
		return in_array( $feature, $available_features, true );
	}

	/**
	 * Enable a toggleable optional feature.
	 *
	 * @param string $feature Feature name.
	 * @return bool
	 */
	public static function enable( $feature ) {
		$features = self::get_optional_feature_options();

		if ( isset( $features[ $feature ] ) ) {
			update_option( $features[ $feature ], 'yes' );
			return true;
		}

		return false;
	}

	/**
	 * Disable a toggleable optional feature.
	 *
	 * @param string $feature Feature name.
	 * @return bool
	 */
	public static function disable( $feature ) {
		$features = self::get_optional_feature_options();

		if ( isset( $features[ $feature ] ) ) {
			update_option( $features[ $feature ], 'no' );
			return true;
		}

		return false;
	}

	/**
	 * Disable features when opting out of tracking.
	 *
	 * @param string $old_value Old value.
	 * @param string $value New value.
	 */
	public static function maybe_disable_features( $old_value, $value ) {
		if ( 'yes' === $value ) {
			return;
		}

		foreach ( self::$beta_features as $feature ) {
			self::disable( $feature );
		}
	}

	/**
	 * Adds the Features section to the advanced tab of WooCommerce Settings
	 *
	 * @param array $sections Sections.
	 * @return array
	 */
	public static function add_features_section( $sections ) {
		$features = apply_filters(
			'woocommerce_settings_features',
			array()
		);

		if ( empty( $features ) ) {
			return $sections;
		}

		$sections['features'] = __( 'Features', 'woocommerce' );
		return $sections;
	}

	/**
	 * Adds the Features settings.
	 *
	 * @param array  $settings Settings.
	 * @param string $current_section Current section slug.
	 * @return array
	 */
	public static function add_features_settings( $settings, $current_section ) {
		if ( 'features' !== $current_section ) {
			return $settings;
		}

		$features = apply_filters(
			'woocommerce_settings_features',
			array()
		);

		$features_disabled = apply_filters( 'woocommerce_admin_disabled', false );

		if ( ! $features_disabled && empty( $features ) ) {
			return $settings;
		}

		$desc          = __( 'Start using new features that are being progressively rolled out to improve the store management experience.', 'woocommerce' );
		$disabled_desc = __( 'WooCommerce features have been disabled.', 'woocommerce' );

		if ( $features_disabled ) {
			$GLOBALS['hide_save_button'] = true;
		}

		return array_merge(
			array(
				array(
					'title' => __( 'Features', 'woocommerce' ),
					'type'  => 'title',
					'desc'  => $features_disabled ? $disabled_desc : $desc,
					'id'    => 'features_options',
				),
			),
			$features_disabled ? array() : $features,
			array(
				array(
					'type' => 'sectionend',
					'id'   => 'features_options',
				),
			)
		);
	}

	/**
	 * Conditionally loads the beta features tracking modal.
	 *
	 * @param string $hook Page hook.
	 */
	public static function maybe_load_beta_features_modal( $hook ) {
		if (
			'woocommerce_page_wc-settings' !== $hook ||
			! isset( $_GET['tab'] ) || 'advanced' !== $_GET['tab'] || // phpcs:ignore CSRF ok.
			! isset( $_GET['section'] ) || 'features' !== $_GET['section'] // phpcs:ignore CSRF ok.
		) {
			return;
		}
		$tracking_enabled = get_option( 'woocommerce_allow_tracking', 'no' );

		if ( empty( self::$beta_features ) ) {
			return;
		}

		if ( 'yes' === $tracking_enabled ) {
			return;
		}

		$rtl = is_rtl() ? '.rtl' : '';

		wp_enqueue_style(
			'wc-admin-beta-features-tracking-modal',
			Loader::get_url( "beta-features-tracking-modal/style{$rtl}", 'css' ),
			array( 'wp-components' ),
			Loader::get_file_version( 'css' )
		);

		wp_enqueue_script(
			'wc-admin-beta-features-tracking-modal',
			Loader::get_url( 'wp-admin-scripts/beta-features-tracking-modal', 'js' ),
			array( 'wp-i18n', 'wp-element', WC_ADMIN_APP ),
			Loader::get_file_version( 'js' ),
			true
		);
	}

	/**
	 * Loads the required scripts on the correct pages.
	 */
	public static function load_scripts() {
		if ( ! Loader::is_admin_or_embed_page() ) {
			return;
		}

		$features         = self::get_features();
		$enabled_features = array();
		foreach ( $features as $key ) {
			$enabled_features[ $key ] = self::is_enabled( $key );
		}
		wp_add_inline_script( WC_ADMIN_APP, 'window.wcAdminFeatures = ' . wp_json_encode( $enabled_features ), 'before' );
	}


	/**
	 * Adds body classes to the main wp-admin wrapper, allowing us to better target elements in specific scenarios.
	 *
	 * @param string $admin_body_class Body class to add.
	 */
	public static function add_admin_body_classes( $admin_body_class = '' ) {
		if ( ! Loader::is_admin_or_embed_page() ) {
			return $admin_body_class;
		}

		$classes = explode( ' ', trim( $admin_body_class ) );

		$features = self::get_features();
		foreach ( $features as $feature_key ) {
			$classes[] = sanitize_html_class( 'woocommerce-feature-enabled-' . $feature_key );
		}

		$admin_body_class = implode( ' ', array_unique( $classes ) );
		return " $admin_body_class ";
	}
}
woocommerce-admin/src/Features/RemoteFreeExtensions/EvaluateExtension.php000064400000002262151335517650023024 0ustar00<?php
/**
 * Evaluates the spec and returns a status.
 */

namespace Automattic\WooCommerce\Admin\Features\RemoteFreeExtensions;

defined( 'ABSPATH' ) || exit;

use Automattic\WooCommerce\Admin\PluginsHelper;
use Automattic\WooCommerce\Admin\RemoteInboxNotifications\RuleEvaluator;

/**
 * Evaluates the extension and returns it.
 */
class EvaluateExtension {
	/**
	 * Evaluates the extension and returns it.
	 *
	 * @param object $extension The extension to evaluate.
	 * @return object The evaluated extension.
	 */
	public static function evaluate( $extension ) {
		$rule_evaluator = new RuleEvaluator();

		if ( isset( $extension->is_visible ) ) {
			$is_visible            = $rule_evaluator->evaluate( $extension->is_visible );
			$extension->is_visible = $is_visible;
		} else {
			$extension->is_visible = true;
		}

		$installed_plugins       = PluginsHelper::get_installed_plugin_slugs();
		$activated_plugins       = PluginsHelper::get_active_plugin_slugs();
		$extension->is_installed = in_array( explode( ':', $extension->key )[0], $installed_plugins, true );
		$extension->is_activated = in_array( explode( ':', $extension->key )[0], $activated_plugins, true );

		return $extension;
	}
}
woocommerce-admin/src/Features/RemoteFreeExtensions/DataSourcePoller.php000064400000006736151335517650022603 0ustar00<?php
/**
 * Handles polling and storage of specs
 */

namespace Automattic\WooCommerce\Admin\Features\RemoteFreeExtensions;

defined( 'ABSPATH' ) || exit;

/**
 * Specs data source poller class.
 * This handles polling specs from JSON endpoints.
 */
class DataSourcePoller {
	const DATA_SOURCES = array(
		'https://woocommerce.com/wp-json/wccom/obw-free-extensions/2.0/extensions.json',
	);

	/**
	 * The logger instance.
	 *
	 * @var WC_Logger|null
	 */
	protected static $logger = null;

	/**
	 * Get the logger instance.
	 *
	 * @return WC_Logger
	 */
	private static function get_logger() {
		if ( is_null( self::$logger ) ) {
			self::$logger = wc_get_logger();
		}

		return self::$logger;
	}

	/**
	 * Reads the data sources for specs and persists those specs.
	 *
	 * @return bool Whether any specs were read.
	 */
	public static function read_specs_from_data_sources() {
		$specs        = array();
		$data_sources = apply_filters( 'woocommerce_admin_remote_free_extensions_data_sources', self::DATA_SOURCES );

		// Note that this merges the specs from the data sources based on the
		// key - last one wins.
		foreach ( $data_sources as $url ) {
			$specs_from_data_source = self::read_data_source( $url );
			self::merge_specs( $specs_from_data_source, $specs, $url );
		}

		return $specs;
	}

	/**
	 * Read a single data source and return the read specs
	 *
	 * @param string $url The URL to read the specs from.
	 *
	 * @return array The specs that have been read from the data source.
	 */
	private static function read_data_source( $url ) {
		$logger_context = array( 'source' => $url );
		$logger         = self::get_logger();
		$response       = wp_remote_get(
			add_query_arg(
				'_locale',
				get_user_locale(),
				$url
			)
		);

		if ( is_wp_error( $response ) || ! isset( $response['body'] ) ) {
			$logger->error(
				'Error getting remote payment method data feed',
				$logger_context
			);
			// phpcs:ignore
			$logger->error( print_r( $response, true ), $logger_context );

			return [];
		}

		$body  = $response['body'];
		$specs = json_decode( $body );

		if ( null === $specs ) {
			$logger->error(
				'Empty response in remote payment method data feed',
				$logger_context
			);

			return [];
		}

		if ( ! is_array( $specs ) ) {
			$logger->error(
				'Remote payment method data feed is not an array',
				$logger_context
			);

			return [];
		}

		return $specs;
	}

	/**
	 * Merge the specs.
	 *
	 * @param Array  $specs_to_merge_in The specs to merge in to $specs.
	 * @param Array  $specs             The list of specs being merged into.
	 * @param string $url               The url of the feed being merged in (for error reporting).
	 */
	private static function merge_specs( $specs_to_merge_in, &$specs, $url ) {
		foreach ( $specs_to_merge_in as $spec ) {
			if ( ! self::validate_spec( $spec, $url ) ) {
				continue;
			}

			$key           = $spec->key;
			$specs[ $key ] = $spec;
		}
	}

	/**
	 * Validate the spec.
	 *
	 * @param object $spec The spec to validate.
	 * @param string $url  The url of the feed that provided the spec.
	 *
	 * @return bool The result of the validation.
	 */
	private static function validate_spec( $spec, $url ) {
		$logger         = self::get_logger();
		$logger_context = array( 'source' => $url );

		if ( ! isset( $spec->key ) ) {
			$logger->error(
				'Spec is invalid because the key is missing in feed',
				$logger_context
			);
			// phpcs:ignore
			$logger->error( print_r( $spec, true ), $logger_context );

			return false;
		}

		return true;
	}
}
woocommerce-admin/src/Features/RemoteFreeExtensions/Init.php000064400000004631151335517650020266 0ustar00<?php
/**
 * Handles running payment method specs
 */

namespace Automattic\WooCommerce\Admin\Features\RemoteFreeExtensions;

defined( 'ABSPATH' ) || exit;

use Automattic\WooCommerce\Admin\RemoteInboxNotifications\SpecRunner;
use Automattic\WooCommerce\Admin\Features\RemoteFreeExtensions\DefaultFreeExtensions;

/**
 * Remote Payment Methods engine.
 * This goes through the specs and gets eligible payment methods.
 */
class Init {
	const SPECS_TRANSIENT_NAME = 'woocommerce_admin_remote_free_extensions_specs';

	/**
	 * Constructor.
	 */
	public function __construct() {
		add_action( 'change_locale', array( __CLASS__, 'delete_specs_transient' ) );
		add_action( 'woocommerce_admin_updated', array( __CLASS__, 'delete_specs_transient' ) );
	}

	/**
	 * Go through the specs and run them.
	 *
	 * @param array $allowed_bundles Optional array of allowed bundles to be returned.
	 * @return array
	 */
	public static function get_extensions( $allowed_bundles = array() ) {
		$bundles = array();
		$specs   = self::get_specs();

		foreach ( $specs as $spec ) {
			$spec              = (object) $spec;
			$bundle            = (array) $spec;
			$bundle['plugins'] = array();

			if ( ! empty( $allowed_bundles ) && ! in_array( $spec->key, $allowed_bundles, true ) ) {
				continue;
			}

			foreach ( $spec->plugins as $plugin ) {
				$extension = EvaluateExtension::evaluate( (object) $plugin );

				if ( ! property_exists( $extension, 'is_visible' ) || $extension->is_visible ) {
					$bundle['plugins'][] = $extension;
				}
			}

			$bundles[] = $bundle;
		}

		return $bundles;
	}

	/**
	 * Delete the specs transient.
	 */
	public static function delete_specs_transient() {
		delete_transient( self::SPECS_TRANSIENT_NAME );
	}

	/**
	 * Get specs or fetch remotely if they don't exist.
	 */
	public static function get_specs() {
		$specs = get_transient( self::SPECS_TRANSIENT_NAME );

		// Fetch specs if they don't yet exist.
		if ( false === $specs || ! is_array( $specs ) || 0 === count( $specs ) ) {
			if ( 'no' === get_option( 'woocommerce_show_marketplace_suggestions', 'yes' ) ) {
				return DefaultFreeExtensions::get_all();
			}

			$specs = DataSourcePoller::read_specs_from_data_sources();

			// Fall back to default specs if polling failed.
			if ( ! $specs || empty( $specs ) ) {
				return DefaultFreeExtensions::get_all();
			}

			set_transient( self::SPECS_TRANSIENT_NAME, $specs, 7 * DAY_IN_SECONDS );
		}

		return $specs;
	}
}
woocommerce-admin/src/Features/RemoteFreeExtensions/DefaultFreeExtensions.php000064400000026537151335517650023642 0ustar00<?php
/**
 * Gets a list of fallback methods if remote fetching is disabled.
 */

namespace Automattic\WooCommerce\Admin\Features\RemoteFreeExtensions;

defined( 'ABSPATH' ) || exit;

use Automattic\WooCommerce\Admin\Features\OnboardingTasks\Init as OnboardingTasks;

/**
 * Default Free Extensions
 */
class DefaultFreeExtensions {

	/**
	 * Get default specs.
	 *
	 * @return array Default specs.
	 */
	public static function get_all() {
		$bundles = [
			[
				'key'     => 'basics',
				'title'   => __( 'Get the basics', 'woocommerce' ),
				'plugins' => [
					[
						'key'         => 'woocommerce-payments',
						'description' => sprintf(
							/* translators: 1: opening product link tag. 2: closing link tag */
							__( 'Accept credit cards with %1$sWooCommerce Payments%2$s', 'woocommerce' ),
							'<a href="https://woocommerce.com/products/woocommerce-payments" target="_blank">',
							'</a>'
						),
						'is_visible'  => [
							[
								'type'     => 'or',
								'operands' => [
									[
										'type'      => 'base_location_country',
										'value'     => 'US',
										'operation' => '=',
									],
									[
										'type'      => 'base_location_country',
										'value'     => 'PR',
										'operation' => '=',
									],
									[
										'type'      => 'base_location_country',
										'value'     => 'AU',
										'operation' => '=',
									],
									[
										'type'      => 'base_location_country',
										'value'     => 'CA',
										'operation' => '=',
									],
									[
										'type'      => 'base_location_country',
										'value'     => 'DE',
										'operation' => '=',
									],
									[
										'type'      => 'base_location_country',
										'value'     => 'ES',
										'operation' => '=',
									],
									[
										'type'      => 'base_location_country',
										'value'     => 'FR',
										'operation' => '=',
									],
									[
										'type'      => 'base_location_country',
										'value'     => 'GB',
										'operation' => '=',
									],
									[
										'type'      => 'base_location_country',
										'value'     => 'IE',
										'operation' => '=',
									],
									[
										'type'      => 'base_location_country',
										'value'     => 'IT',
										'operation' => '=',
									],
									[
										'type'      => 'base_location_country',
										'value'     => 'NZ',
										'operation' => '=',
									],
									[
										'type'      => 'base_location_country',
										'value'     => 'AT',
										'operation' => '=',
									],
									[
										'type'      => 'base_location_country',
										'value'     => 'BE',
										'operation' => '=',
									],
									[
										'type'      => 'base_location_country',
										'value'     => 'NL',
										'operation' => '=',
									],
									[
										'type'      => 'base_location_country',
										'value'     => 'PL',
										'operation' => '=',
									],
									[
										'type'      => 'base_location_country',
										'value'     => 'PT',
										'operation' => '=',
									],
									[
										'type'      => 'base_location_country',
										'value'     => 'CH',
										'operation' => '=',
									],
									[
										'type'      => 'base_location_country',
										'value'     => 'HK',
										'operation' => '=',
									],
									[
										'type'      => 'base_location_country',
										'value'     => 'SG',
										'operation' => '=',
									],
								],
							],
							[
								'type'         => 'option',
								'transformers' => [
									[
										'use'       => 'dot_notation',
										'arguments' => [
											'path' => 'industry',
										],
									],
									[
										'use'       => 'array_column',
										'arguments' => [
											'key' => 'slug',
										],
									],
									[
										'use'       => 'array_search',
										'arguments' => [
											'value' => 'cbd-other-hemp-derived-products',
										],
									],
								],
								'option_name'  => 'woocommerce_onboarding_profile',
								'value'        => 'cbd-other-hemp-derived-products',
								'default'      => '',
								'operation'    => '!=',
							],
						],
					],
					[
						'key'         => 'woocommerce-services:shipping',
						'description' => sprintf(
							/* translators: 1: opening product link tag. 2: closing link tag */
							__( 'Print shipping labels with %1$sWooCommerce Shipping%2$s', 'woocommerce' ),
							'<a href="https://woocommerce.com/products/shipping" target="_blank">',
							'</a>'
						),
						'is_visible'  => [
							[
								'type'      => 'base_location_country',
								'value'     => 'US',
								'operation' => '=',
							],
							[
								'type'    => 'not',
								'operand' => [
									[
										'type'    => 'plugins_activated',
										'plugins' => [ 'woocommerce-services' ],
									],
								],
							],
							[
								'type'     => 'or',
								'operands' => [
									[
										[
											'type'         => 'option',
											'transformers' => [
												[
													'use' => 'dot_notation',
													'arguments' => [
														'path' => 'product_types',
													],
												],
												[
													'use' => 'count',
												],
											],
											'option_name'  => 'woocommerce_onboarding_profile',
											'value'        => 1,
											'default'      => '',
											'operation'    => '!=',
										],
									],
									[
										[
											'type'         => 'option',
											'transformers' => [
												[
													'use' => 'dot_notation',
													'arguments' => [
														'path' => 'product_types.0',
													],
												],
											],
											'option_name'  => 'woocommerce_onboarding_profile',
											'value'        => 'downloads',
											'default'      => '',
											'operation'    => '!=',
										],
									],
								],
							],
						],
					],
					[
						'key'         => 'woocommerce-services:tax',
						'description' => sprintf(
							/* translators: 1: opening product link tag. 2: closing link tag */
							__( 'Get automated sales tax with %1$sWooCommerce Tax%2$s', 'woocommerce' ),
							'<a href="https://woocommerce.com/products/tax" target="_blank">',
							'</a>'
						),
						'is_visible'  => [
							[
								'type'     => 'or',
								'operands' => [
									[
										'type'      => 'base_location_country',
										'value'     => 'US',
										'operation' => '=',
									],
									[
										'type'      => 'base_location_country',
										'value'     => 'FR',
										'operation' => '=',
									],
									[
										'type'      => 'base_location_country',
										'value'     => 'GB',
										'operation' => '=',
									],
									[
										'type'      => 'base_location_country',
										'value'     => 'DE',
										'operation' => '=',
									],
									[
										'type'      => 'base_location_country',
										'value'     => 'CA',
										'operation' => '=',
									],
									[
										'type'      => 'base_location_country',
										'value'     => 'AU',
										'operation' => '=',
									],
									[
										'type'      => 'base_location_country',
										'value'     => 'GR',
										'operation' => '=',
									],
									[
										'type'      => 'base_location_country',
										'value'     => 'BE',
										'operation' => '=',
									],
									[
										'type'      => 'base_location_country',
										'value'     => 'PT',
										'operation' => '=',
									],
									[
										'type'      => 'base_location_country',
										'value'     => 'DK',
										'operation' => '=',
									],
									[
										'type'      => 'base_location_country',
										'value'     => 'SE',
										'operation' => '=',
									],
								],
							],
							[
								'type'    => 'not',
								'operand' => [
									[
										'type'    => 'plugins_activated',
										'plugins' => [ 'woocommerce-services' ],
									],
								],
							],
						],
					],
					[
						'key'         => 'jetpack',
						'description' => sprintf(
							/* translators: 1: opening product link tag. 2: closing link tag */
							__( 'Enhance speed and security with %1$sJetpack%2$s', 'woocommerce' ),
							'<a href="https://woocommerce.com/products/jetpack" target="_blank">',
							'</a>'
						),
						'is_visible'  => [
							[
								'type'    => 'not',
								'operand' => [
									[
										'type'    => 'plugins_activated',
										'plugins' => [ 'jetpack' ],
									],
								],
							],
						],
					],
					[
						'key'         => 'mailpoet',
						'name'        => __( 'MailPoet', 'woocommerce' ),
						'description' => sprintf(
							/* translators: 1: opening product link tag. 2: closing link tag */
							__( 'Level up your email marketing with %1$sMailPoet%2$s', 'woocommerce' ),
							'<a href="https://woocommerce.com/products/mailpoet" target="_blank">',
							'</a>'
						),
						'manage_url'  => 'admin.php?page=mailpoet-newsletters',
						'is_visible'  => [
							[
								'type'    => 'not',
								'operand' => [
									[
										'type'    => 'plugins_activated',
										'plugins' => [ 'mailpoet' ],
									],
								],
							],
						],
					],
				],
			],
			[
				'key'     => 'reach',
				'title'   => __( 'Reach out to customers', 'woocommerce' ),
				'plugins' => [
					[
						'key'         => 'mailpoet',
						'name'        => __( 'MailPoet', 'woocommerce' ),
						'description' => __( 'Create and send purchase follow-up emails, newsletters, and promotional campaigns straight from your dashboard.', 'woocommerce' ),
						'image_url'   => plugins_url( 'images/onboarding/mailpoet.png', WC_ADMIN_PLUGIN_FILE ),
						'manage_url'  => 'admin.php?page=mailpoet-newsletters',
					],
					[
						'key'         => 'mailchimp-for-woocommerce',
						'name'        => __( 'Mailchimp', 'woocommerce' ),
						'description' => __( 'Send targeted campaigns, recover abandoned carts and much more with Mailchimp.', 'woocommerce' ),
						'image_url'   => plugins_url( 'images/onboarding/mailchimp-for-woocommerce.png', WC_ADMIN_PLUGIN_FILE ),
						'manage_url'  => 'admin.php?page=mailchimp-woocommerce',
					],
					[
						'key'         => 'creative-mail-by-constant-contact',
						'name'        => __( 'Creative Mail for WooCommerce', 'woocommerce' ),
						'description' => __( 'Create on-brand store campaigns, fast email promotions and customer retargeting with Creative Mail.', 'woocommerce' ),
						'image_url'   => plugins_url( 'images/onboarding/creative-mail-by-constant-contact.png', WC_ADMIN_PLUGIN_FILE ),
						'manage_url'  => 'admin.php?page=creativemail',
					],
				],
			],
			[
				'key'     => 'grow',
				'title'   => __( 'Grow your store', 'woocommerce' ),
				'plugins' => [
					[
						'key'         => 'google-listings-and-ads',
						'name'        => __( 'Google Listings & Ads', 'woocommerce' ),
						'description' => __( 'Reach more shoppers and drive sales for your store. Integrate with Google to list your products for free and launch paid ad campaigns.', 'woocommerce' ),
						'image_url'   => plugins_url( 'images/onboarding/google-listings-and-ads.png', WC_ADMIN_PLUGIN_FILE ),
						'manage_url'  => 'admin.php?page=wc-admin&path=%2Fgoogle%2Fstart',
					],
				],
			],
		];

		$bundles = wp_json_encode( $bundles );
		return json_decode( $bundles );
	}
}
woocommerce-admin/src/Features/WcPayPromotion/WCPaymentGatewayPreInstallWCPayPromotion.php000064400000001652151335517650026202 0ustar00<?php
/**
 * Class WCPaymentGatewayPreInstallWCPayPromotion
 *
 * @package WooCommerce\Admin
 */

namespace Automattic\WooCommerce\Admin\Features\WcPayPromotion;

if ( ! defined( 'ABSPATH' ) ) {
	exit;
}

/**
 * A Psuedo WCPay gateway class.
 *
 * @extends WC_Payment_Gateway
 */
class WCPaymentGatewayPreInstallWCPayPromotion extends \WC_Payment_Gateway {

	const GATEWAY_ID = 'pre_install_woocommerce_payments_promotion';

	/**
	 * Constructor
	 */
	public function __construct() {
		$wc_pay_spec        = Init::get_wc_pay_promotion_spec();
		$this->id           = static::GATEWAY_ID;
		$this->method_title = $wc_pay_spec->title;
		if ( property_exists( $wc_pay_spec, 'sub_title' ) ) {
			$this->title = sprintf( '<span class="gateway-subtitle" >%s</span>', $wc_pay_spec->sub_title );
		}
		$this->method_description = $wc_pay_spec->content;
		$this->has_fields         = false;

		// Get setting values.
		$this->enabled = false;
	}
}
woocommerce-admin/src/Features/WcPayPromotion/Init.php000064400000015246151335517650017107 0ustar00<?php
/**
 * Handles wcpay promotion
 */

namespace Automattic\WooCommerce\Admin\Features\WcPayPromotion;

defined( 'ABSPATH' ) || exit;

use Automattic\WooCommerce\Admin\Loader;
use Automattic\WooCommerce\Admin\PaymentPlugins;
use Automattic\WooCommerce\Admin\Features\PaymentGatewaySuggestions\EvaluateSuggestion;

/**
 * WC Pay Promotion engine.
 */
class Init {
	const SPECS_TRANSIENT_NAME    = 'woocommerce_admin_payment_method_promotion_specs';
	const EXPLAT_VARIATION_PREFIX = 'woocommerce_wc_pay_promotion_payment_methods_table_';

	/**
	 * Constructor.
	 */
	public function __construct() {
		include_once __DIR__ . '/WCPaymentGatewayPreInstallWCPayPromotion.php';

		add_action( 'change_locale', array( __CLASS__, 'delete_specs_transient' ) );
		add_filter( PaymentPlugins::FILTER_NAME, array( __CLASS__, 'possibly_filter_recommended_payment_gateways' ) );

		if ( ! isset( $_GET['page'] ) || 'wc-settings' !== $_GET['page'] || ! isset( $_GET['tab'] ) || 'checkout' !== $_GET['tab'] ) { // phpcs:ignore WordPress.Security.NonceVerification
			return;
		}

		add_filter( 'woocommerce_payment_gateways', array( __CLASS__, 'possibly_register_pre_install_wc_pay_promotion_gateway' ) );
		add_filter( 'option_woocommerce_gateway_order', [ __CLASS__, 'set_gateway_top_of_list' ] );
		add_filter( 'default_option_woocommerce_gateway_order', [ __CLASS__, 'set_gateway_top_of_list' ] );

		$rtl = is_rtl() ? '.rtl' : '';

		wp_enqueue_style(
			'wc-admin-payment-method-promotions',
			Loader::get_url( "payment-method-promotions/style{$rtl}", 'css' ),
			array( 'wp-components' ),
			Loader::get_file_version( 'css' )
		);

		$script_assets_filename = Loader::get_script_asset_filename( 'wp-admin-scripts', 'payment-method-promotions' );
		$script_assets          = require WC_ADMIN_ABSPATH . WC_ADMIN_DIST_JS_FOLDER . 'wp-admin-scripts/' . $script_assets_filename;

		wp_enqueue_script(
			'wc-admin-payment-method-promotions',
			Loader::get_url( 'wp-admin-scripts/payment-method-promotions', 'js' ),
			array_merge( array( WC_ADMIN_APP ), $script_assets ['dependencies'] ),
			Loader::get_file_version( 'js' ),
			true
		);
	}

	/**
	 * Possibly registers the pre install wc pay promoted gateway.
	 *
	 * @param array $gateways list of gateway classes.
	 * @return array list of gateway classes.
	 */
	public static function possibly_register_pre_install_wc_pay_promotion_gateway( $gateways ) {
		if ( self::should_register_pre_install_wc_pay_promoted_gateway() ) {
			$gateways[] = 'Automattic\WooCommerce\Admin\Features\WCPayPromotion\WCPaymentGatewayPreInstallWCPayPromotion';
		}
		return $gateways;
	}

	/**
	 * Possibly filters out woocommerce-payments from recommended payment methods.
	 *
	 * @param array $payment_methods list of payment methods.
	 * @return array list of payment method.
	 */
	public static function possibly_filter_recommended_payment_gateways( $payment_methods ) {
		if ( self::should_register_pre_install_wc_pay_promoted_gateway() ) {
			return array_filter(
				$payment_methods,
				function( $payment_method ) {
					return 'woocommerce-payments' !== $payment_method['product'];
				}
			);
		}
		return $payment_methods;
	}

	/**
	 * Checks if promoted gateway should be registered.
	 *
	 * @return boolean if promoted gateway should be registered.
	 */
	public static function should_register_pre_install_wc_pay_promoted_gateway() {
		// Check if WC Pay is enabled.
		if ( class_exists( '\WC_Payments' ) ) {
			return false;
		}
		if ( 'no' === get_option( 'woocommerce_show_marketplace_suggestions', 'yes' ) ) {
			return false;
		}
		$wc_pay_spec = self::get_wc_pay_promotion_spec();

		if ( ! $wc_pay_spec || ! isset( $wc_pay_spec->additional_info ) || ! isset( $wc_pay_spec->additional_info->experiment_version ) ) {
			return false;
		}

		$anon_id        = isset( $_COOKIE['tk_ai'] ) ? sanitize_text_field( wp_unslash( $_COOKIE['tk_ai'] ) ) : '';
		$allow_tracking = 'yes' === get_option( 'woocommerce_allow_tracking' );
		$abtest         = new \WooCommerce\Admin\Experimental_Abtest(
			$anon_id,
			'woocommerce',
			$allow_tracking
		);

		$variation_name = $abtest->get_variation( self::EXPLAT_VARIATION_PREFIX . $wc_pay_spec->additional_info->experiment_version );

		if ( 'treatment' === $variation_name ) {
			return true;
		}

		return false;
	}

	/**
	 * By default, new payment gateways are put at the bottom of the list on the admin "Payments" settings screen.
	 * For visibility, we want WooCommerce Payments to be at the top of the list.
	 *
	 * @param array $ordering Existing ordering of the payment gateways.
	 *
	 * @return array Modified ordering.
	 */
	public static function set_gateway_top_of_list( $ordering ) {
		$ordering = (array) $ordering;
		$id       = WCPaymentGatewayPreInstallWCPayPromotion::GATEWAY_ID;
		// Only tweak the ordering if the list hasn't been reordered with WooCommerce Payments in it already.
		if ( ! isset( $ordering[ $id ] ) || ! is_numeric( $ordering[ $id ] ) ) {
			$is_empty        = empty( $ordering ) || empty( $ordering[0] );
			$ordering[ $id ] = $is_empty ? 0 : ( min( $ordering ) - 1 );
		}
		return $ordering;
	}

	/**
	 * Get WC Pay promotion spec.
	 */
	public static function get_wc_pay_promotion_spec() {
		$promotions            = self::get_promotions();
		$wc_pay_promotion_spec = array_values(
			array_filter(
				$promotions,
				function( $promotion ) {
					return isset( $promotion->plugins ) && in_array( 'woocommerce-payments', $promotion->plugins, true );
				}
			)
		);

		return current( $wc_pay_promotion_spec );
	}

	/**
	 * Go through the specs and run them.
	 */
	public static function get_promotions() {
		$suggestions = array();
		$specs       = self::get_specs();

		foreach ( $specs as $spec ) {
			$suggestion    = EvaluateSuggestion::evaluate( $spec );
			$suggestions[] = $suggestion;
		}

		return array_values(
			array_filter(
				$suggestions,
				function( $suggestion ) {
					return ! property_exists( $suggestion, 'is_visible' ) || $suggestion->is_visible;
				}
			)
		);

	}

	/**
	 * Delete the specs transient.
	 */
	public static function delete_specs_transient() {
		delete_transient( self::SPECS_TRANSIENT_NAME );
	}

	/**
	 * Get specs or fetch remotely if they don't exist.
	 */
	public static function get_specs() {
		$specs = get_transient( self::SPECS_TRANSIENT_NAME );

		// Fetch specs if they don't yet exist.
		if ( false === $specs || ! is_array( $specs ) || 0 === count( $specs ) ) {
			if ( 'no' === get_option( 'woocommerce_show_marketplace_suggestions', 'yes' ) ) {
				return array();
			}

			$specs = DataSourcePoller::read_specs_from_data_sources();

			// Fall back to default specs if polling failed.
			if ( ! $specs ) {
				return array();
			}

			set_transient( self::SPECS_TRANSIENT_NAME, $specs, 7 * DAY_IN_SECONDS );
		}

		return $specs;
	}
}

woocommerce-admin/src/Features/WcPayPromotion/DataSourcePoller.php000064400000005547151335517650021417 0ustar00<?php
/**
 * Handles polling and storage of specs
 */

namespace Automattic\WooCommerce\Admin\Features\WcPayPromotion;

defined( 'ABSPATH' ) || exit;

/**
 * Specs data source poller class.
 * This handles polling specs from JSON endpoints.
 */
class DataSourcePoller {
	/**
	 * Name of data sources filter.
	 */
	const FILTER_NAME = 'woocommerce_admin_payment_method_promotions_data_sources';

	/**
	 * Default data sources array.
	 */
	const DATA_SOURCES = array(
		'https://woocommerce.com/wp-json/wccom/payment-gateway-suggestions/1.0/payment-method/promotions.json',
	);

	/**
	 * The logger instance.
	 *
	 * @var WC_Logger|null
	 */
	protected static $logger = null;

	/**
	 * Get the logger instance.
	 *
	 * @return WC_Logger
	 */
	private static function get_logger() {
		if ( is_null( self::$logger ) ) {
			self::$logger = wc_get_logger();
		}

		return self::$logger;
	}

	/**
	 * Reads the data sources for specs and persists those specs.
	 *
	 * @return bool Whether any specs were read.
	 */
	public static function read_specs_from_data_sources() {
		$specs        = array();
		$data_sources = apply_filters( self::FILTER_NAME, self::DATA_SOURCES );

		// Note that this merges the specs from the data sources based on the
		// product - last one wins.
		foreach ( $data_sources as $url ) {
			$specs_from_data_source = self::read_data_source( $url );
			self::merge_specs( $specs_from_data_source, $specs, $url );
		}

		return $specs;
	}

	/**
	 * Read a single data source and return the read specs
	 *
	 * @param string $url The URL to read the specs from.
	 *
	 * @return array The specs that have been read from the data source.
	 */
	private static function read_data_source( $url ) {
		$logger_context = array( 'source' => $url );
		$logger         = self::get_logger();
		$response       = wp_remote_get(
			add_query_arg(
				'_locale',
				get_user_locale(),
				$url
			)
		);

		if ( is_wp_error( $response ) || ! isset( $response['body'] ) ) {
			$logger->error(
				'Error getting remote payment method data feed',
				$logger_context
			);
			// phpcs:ignore
			$logger->error( print_r( $response, true ), $logger_context );

			return [];
		}

		$body  = $response['body'];
		$specs = json_decode( $body );

		if ( null === $specs ) {
			$logger->error(
				'Empty response in remote payment method data feed',
				$logger_context
			);

			return [];
		}

		if ( ! is_array( $specs ) ) {
			$logger->error(
				'Remote payment method data feed is not an array',
				$logger_context
			);

			return [];
		}

		return $specs;
	}

	/**
	 * Merge the specs.
	 *
	 * @param Array $specs_to_merge_in The specs to merge in to $specs.
	 * @param Array $specs             The list of specs being merged into.
	 */
	private static function merge_specs( $specs_to_merge_in, &$specs ) {
		foreach ( $specs_to_merge_in as $spec ) {
			$id           = $spec->id;
			$specs[ $id ] = $spec;
		}
	}
}
woocommerce-admin/src/Features/Settings.php000064400000011007151335517650015041 0ustar00<?php
/**
 * WooCommerce Settings.
 * NOTE: DO NOT edit this file in WooCommerce core, this is generated from woocommerce-admin.
 */

namespace Automattic\WooCommerce\Admin\Features;

use Automattic\WooCommerce\Admin\Marketing\InstalledExtensions;
use Automattic\WooCommerce\Admin\Loader;
use Automattic\WooCommerce\Admin\PageController;

/**
 * Contains backend logic for the Settings feature.
 */
class Settings {
	/**
	 * Option name used to toggle this feature.
	 */
	const TOGGLE_OPTION_NAME = 'woocommerce_settings_enabled';

	/**
	 * Class instance.
	 *
	 * @var Settings instance
	 */
	protected static $instance = null;

	/**
	 * Get class instance.
	 */
	public static function get_instance() {
		if ( ! self::$instance ) {
			self::$instance = new self();
		}
		return self::$instance;
	}

	/**
	 * Hook into WooCommerce.
	 */
	public function __construct() {
		if ( ! is_admin() ) {
			return;
		}

		add_filter( 'woocommerce_settings_features', array( $this, 'add_feature_toggle' ) );

		if ( 'yes' !== get_option( 'woocommerce_settings_enabled', 'no' ) ) {
			return;
		}

		add_filter( 'woocommerce_admin_shared_settings', array( __CLASS__, 'add_component_settings' ) );
		// Run this after the original WooCommerce settings have been added.
		add_action( 'admin_menu', array( $this, 'register_pages' ), 60 );
		add_action( 'init', array( $this, 'redirect_core_settings_pages' ) );
	}

	/**
	 * Add the necessary data to initially load the WooCommerce Settings pages.
	 *
	 * @param array $settings Array of component settings.
	 * @return array Array of component settings.
	 */
	public static function add_component_settings( $settings ) {
		if ( ! is_admin() ) {
			return $settings;
		}

		$setting_pages = \WC_Admin_Settings::get_settings_pages();
		$pages         = array();
		foreach ( $setting_pages as $setting_page ) {
			$pages = $setting_page->add_settings_page( $pages );
		}

		$settings['settingsPages'] = $pages;

		return $settings;
	}

	/**
	 * Add the feature toggle to the features settings.
	 *
	 * @param array $features Feature sections.
	 * @return array
	 */
	public static function add_feature_toggle( $features ) {
		$features[] = array(
			'title' => __( 'Settings', 'woocommerce' ),
			'desc'  => __(
				'Adds the new WooCommerce settings UI.',
				'woocommerce'
			),
			'id'    => 'woocommerce_settings_enabled',
			'type'  => 'checkbox',
		);

		return $features;
	}

	/**
	 * Registers settings pages.
	 */
	public function register_pages() {
		$controller = PageController::get_instance();

		$setting_pages = \WC_Admin_Settings::get_settings_pages();
		$settings      = array();
		foreach ( $setting_pages as $setting_page ) {
			$settings = $setting_page->add_settings_page( $settings );
		}

		$order = 0;
		foreach ( $settings as $key => $setting ) {
			$order        += 10;
			$settings_page = array(
				'parent'   => 'woocommerce-settings',
				'title'    => $setting,
				'id'       => 'settings-' . $key,
				'path'     => "/settings/$key",
				'nav_args' => array(
					'capability' => 'manage_woocommerce',
					'order'      => $order,
					'parent'     => 'woocommerce-settings',
				),
			);

			// Replace the old menu with the first settings item.
			if ( 10 === $order ) {
				$this->replace_settings_page( $settings_page );
			}

			$controller->register_page( $settings_page );
		}
	}

	/**
	 * Replace the Settings page in the original WooCommerce menu.
	 *
	 * @param array $page Page used to replace the original.
	 */
	protected function replace_settings_page( $page ) {
		global $submenu;

		// Check if WooCommerce parent menu has been registered.
		if ( ! isset( $submenu['woocommerce'] ) ) {
			return;
		}

		foreach ( $submenu['woocommerce'] as &$item ) {
			// The "slug" (aka the path) is the third item in the array.
			if ( 0 === strpos( $item[2], 'wc-settings' ) ) {
				$item[2] = wc_admin_url( "&path={$page['path']}" );
			}
		}
	}

	/**
	 * Redirect the old settings page URLs to the new ones.
	 */
	public function redirect_core_settings_pages() {
		/* phpcs:disable WordPress.Security.NonceVerification */
		if ( ! isset( $_GET['page'] ) || 'wc-settings' !== $_GET['page'] ) {
			return;
		}

		if ( ! current_user_can( 'manage_woocommerce' ) ) {
			return;
		}

		$setting_pages   = \WC_Admin_Settings::get_settings_pages();
		$default_setting = isset( $setting_pages[0] ) ? $setting_pages[0]->get_id() : '';
		$setting         = isset( $_GET['tab'] ) ? sanitize_text_field( wp_unslash( $_GET['tab'] ) ) : $default_setting;
		/* phpcs:enable */

		wp_safe_redirect( wc_admin_url( "&path=/settings/$setting" ) );
		exit;
	}
}
woocommerce-admin/src/Features/ActivityPanels.php000064400000003245151335517650016205 0ustar00<?php
/**
 * WooCommerce Activity Panel.
 * NOTE: DO NOT edit this file in WooCommerce core, this is generated from woocommerce-admin.
 */

namespace Automattic\WooCommerce\Admin\Features;

use Automattic\WooCommerce\Admin\Notes\Notes;

/**
 * Contains backend logic for the activity panel feature.
 */
class ActivityPanels {
	/**
	 * Class instance.
	 *
	 * @var ActivityPanels instance
	 */
	protected static $instance = null;

	/**
	 * Get class instance.
	 */
	public static function get_instance() {
		if ( ! self::$instance ) {
			self::$instance = new self();
		}
		return self::$instance;
	}

	/**
	 * Hook into WooCommerce.
	 */
	public function __construct() {
		add_filter( 'woocommerce_admin_get_user_data_fields', array( $this, 'add_user_data_fields' ) );
		// Run after Automattic\WooCommerce\Admin\Loader.
		add_filter( 'woocommerce_components_settings', array( $this, 'component_settings' ), 20 );
		// New settings injection.
		add_filter( 'woocommerce_admin_shared_settings', array( $this, 'component_settings' ), 20 );
	}

	/**
	 * Adds fields so that we can store activity panel last read and open times.
	 *
	 * @param array $user_data_fields User data fields.
	 * @return array
	 */
	public function add_user_data_fields( $user_data_fields ) {
		return array_merge(
			$user_data_fields,
			array(
				'activity_panel_inbox_last_read',
				'activity_panel_reviews_last_read',
			)
		);
	}

	/**
	 * Add alert count to the component settings.
	 *
	 * @param array $settings Component settings.
	 */
	public function component_settings( $settings ) {
		$settings['alertCount'] = Notes::get_notes_count( array( 'error', 'update' ), array( 'unactioned' ) );
		return $settings;
	}
}
woocommerce-admin/src/Features/Marketing.php000064400000016622151335517650015172 0ustar00<?php
/**
 * WooCommerce Marketing.
 * NOTE: DO NOT edit this file in WooCommerce core, this is generated from woocommerce-admin.
 */

namespace Automattic\WooCommerce\Admin\Features;

use Automattic\WooCommerce\Admin\Features\Features;
use Automattic\WooCommerce\Admin\Marketing\InstalledExtensions;
use Automattic\WooCommerce\Admin\Loader;
use Automattic\WooCommerce\Admin\PageController;

/**
 * Contains backend logic for the Marketing feature.
 */
class Marketing {

	use CouponsMovedTrait;

	/**
	 * Name of recommended plugins transient.
	 *
	 * @var string
	 */
	const RECOMMENDED_PLUGINS_TRANSIENT = 'wc_marketing_recommended_plugins';

	/**
	 * Name of knowledge base post transient.
	 *
	 * @var string
	 */
	const KNOWLEDGE_BASE_TRANSIENT = 'wc_marketing_knowledge_base';

	/**
	 * Class instance.
	 *
	 * @var Marketing instance
	 */
	protected static $instance = null;

	/**
	 * Get class instance.
	 */
	public static function get_instance() {
		if ( ! self::$instance ) {
			self::$instance = new self();
		}
		return self::$instance;
	}

	/**
	 * Hook into WooCommerce.
	 */
	public function __construct() {
		if ( ! is_admin() ) {
			return;
		}

		add_action( 'admin_menu', array( $this, 'register_pages' ), 5 );
		add_action( 'admin_menu', array( $this, 'add_parent_menu_item' ), 6 );

		add_filter( 'woocommerce_admin_preload_options', array( $this, 'preload_options' ) );
		add_filter( 'woocommerce_admin_shared_settings', array( $this, 'component_settings' ), 30 );
	}

	/**
	 * Add main marketing menu item.
	 *
	 * Uses priority of 9 so other items can easily be added at the default priority (10).
	 */
	public function add_parent_menu_item() {
		if ( ! Features::is_enabled( 'navigation' ) ) {
			add_menu_page(
				__( 'Marketing', 'woocommerce' ),
				__( 'Marketing', 'woocommerce' ),
				'manage_woocommerce',
				'woocommerce-marketing',
				null,
				'dashicons-megaphone',
				58
			);
		}

		PageController::get_instance()->connect_page(
			[
				'id'         => 'woocommerce-marketing',
				'title'      => 'Marketing',
				'capability' => 'manage_woocommerce',
				'path'       => 'wc-admin&path=/marketing',
			]
		);
	}

	/**
	 * Registers report pages.
	 */
	public function register_pages() {
		$this->register_overview_page();

		$controller = PageController::get_instance();
		$defaults   = [
			'parent'        => 'woocommerce-marketing',
			'existing_page' => false,
		];

		$marketing_pages = apply_filters( 'woocommerce_marketing_menu_items', [] );
		foreach ( $marketing_pages as $marketing_page ) {
			if ( ! is_array( $marketing_page ) ) {
				continue;
			}

			$marketing_page = array_merge( $defaults, $marketing_page );

			if ( $marketing_page['existing_page'] ) {
				$controller->connect_page( $marketing_page );
			} else {
				$controller->register_page( $marketing_page );
			}
		}
	}

	/**
	 * Register the main Marketing page, which is Marketing > Overview.
	 *
	 * This is done separately because we need to ensure the page is registered properly and
	 * that the link is done properly. For some reason the normal page registration process
	 * gives us the wrong menu link.
	 */
	protected function register_overview_page() {
		global $submenu;

		// First register the page.
		PageController::get_instance()->register_page(
			[
				'id'       => 'woocommerce-marketing-overview',
				'title'    => __( 'Overview', 'woocommerce' ),
				'path'     => 'wc-admin&path=/marketing',
				'parent'   => 'woocommerce-marketing',
				'nav_args' => array(
					'parent' => 'woocommerce-marketing',
					'order'  => 10,
				),
			]
		);

		// Now fix the path, since register_page() gets it wrong.
		if ( ! isset( $submenu['woocommerce-marketing'] ) ) {
			return;
		}

		foreach ( $submenu['woocommerce-marketing'] as &$item ) {
			// The "slug" (aka the path) is the third item in the array.
			if ( 0 === strpos( $item[2], 'wc-admin' ) ) {
				$item[2] = 'admin.php?page=' . $item[2];
			}
		}
	}

	/**
	 * Preload options to prime state of the application.
	 *
	 * @param array $options Array of options to preload.
	 * @return array
	 */
	public function preload_options( $options ) {
		$options[] = 'woocommerce_marketing_overview_welcome_hidden';

		return $options;
	}

	/**
	 * Add settings for marketing feature.
	 *
	 * @param array $settings Component settings.
	 * @return array
	 */
	public function component_settings( $settings ) {
		// Bail early if not on a wc-admin powered page.
		if ( ! Loader::is_admin_page() ) {
			return $settings;
		}

		$settings['marketing']['installedExtensions'] = InstalledExtensions::get_data();

		return $settings;
	}

	/**
	 * Load recommended plugins from WooCommerce.com
	 *
	 * @return array
	 */
	public function get_recommended_plugins() {
		$plugins = get_transient( self::RECOMMENDED_PLUGINS_TRANSIENT );

		if ( false === $plugins ) {
			$request = wp_remote_get( 'https://woocommerce.com/wp-json/wccom/marketing-tab/1.1/recommendations.json' );
			$plugins = [];

			if ( ! is_wp_error( $request ) && 200 === $request['response']['code'] ) {
				$plugins = json_decode( $request['body'], true );
			}

			set_transient(
				self::RECOMMENDED_PLUGINS_TRANSIENT,
				$plugins,
				// Expire transient in 15 minutes if remote get failed.
				// Cache an empty result to avoid repeated failed requests.
				empty( $plugins ) ? 900 : 3 * DAY_IN_SECONDS
			);
		}

		return array_values( $plugins );
	}

	/**
	 * Load knowledge base posts from WooCommerce.com
	 *
	 * @param string $category Category of posts to retrieve.
	 * @return array
	 */
	public function get_knowledge_base_posts( $category ) {

		$kb_transient = self::KNOWLEDGE_BASE_TRANSIENT;

		$categories = array(
			'marketing' => 1744,
			'coupons'   => 25202,
		);

		// Default to marketing category (if no category set on the kb component).
		if ( ! empty( $category ) && array_key_exists( $category, $categories ) ) {
			$category_id  = $categories[ $category ];
			$kb_transient = $kb_transient . '_' . strtolower( $category );
		} else {
			$category_id = $categories['marketing'];
		}

		$posts = get_transient( $kb_transient );

		if ( false === $posts ) {
			$request_url = add_query_arg(
				array(
					'categories' => $category_id,
					'page'       => 1,
					'per_page'   => 8,
					'_embed'     => 1,
				),
				'https://woocommerce.com/wp-json/wp/v2/posts?utm_medium=product'
			);

			$request = wp_remote_get( $request_url );
			$posts   = [];

			if ( ! is_wp_error( $request ) && 200 === $request['response']['code'] ) {
				$raw_posts = json_decode( $request['body'], true );

				foreach ( $raw_posts as $raw_post ) {
					$post = [
						'title'         => html_entity_decode( $raw_post['title']['rendered'] ),
						'date'          => $raw_post['date_gmt'],
						'link'          => $raw_post['link'],
						'author_name'   => isset( $raw_post['author_name'] ) ? html_entity_decode( $raw_post['author_name'] ) : '',
						'author_avatar' => isset( $raw_post['author_avatar_url'] ) ? $raw_post['author_avatar_url'] : '',
					];

					$featured_media = $raw_post['_embedded']['wp:featuredmedia'];

					if ( count( $featured_media ) > 0 ) {
						$image         = current( $featured_media );
						$post['image'] = add_query_arg(
							array(
								'resize' => '650,340',
								'crop'   => 1,
							),
							$image['source_url']
						);
					}

					$posts[] = $post;
				}
			}

			set_transient(
				$kb_transient,
				$posts,
				// Expire transient in 15 minutes if remote get failed.
				empty( $posts ) ? 900 : DAY_IN_SECONDS
			);
		}

		return $posts;
	}
}
woocommerce-admin/src/DeprecatedClassFacade.php000064400000004467151335517650015611 0ustar00<?php
/**
 * A facade to allow deprecating an entire class. Calling instance or static
 * functions on the facade triggers a deprecation notice before calling the
 * underlying function.
 *
 * Use it by extending DeprecatedClassFacade in your facade class, setting the
 * static $facade_over_classname string to the name of the class to build
 * a facade over, and setting the static $deprecated_in_version to the version
 * that the class was deprecated in. Eg.:
 *
 * class DeprecatedGoose extends DeprecatedClassFacade {
 *     static $facade_over_classname = 'Goose';
 *     static $deprecated_in_version = '1.7.0';
 * }
 */

namespace Automattic\WooCommerce\Admin;

defined( 'ABSPATH' ) || exit;

// phpcs:disable WordPress.Security.EscapeOutput.OutputNotEscaped

/**
 * A facade to allow deprecating an entire class.
 */
class DeprecatedClassFacade {
	/**
	 * The instance that this facade covers over.
	 *
	 * @var object
	 */
	protected $instance;

	/**
	 * Constructor.
	 */
	public function __construct() {
		$this->instance = new static::$facade_over_classname();
	}

	/**
	 * Log a deprecation to the error log.
	 *
	 * @param string $function The name of the deprecated function being called.
	 */
	private static function log_deprecation( $function ) {
		error_log( // phpcs:ignore
			sprintf(
				'%1$s is deprecated since version %2$s! Use %3$s instead.',
				static::class . '::' . $function,
				static::$deprecated_in_version,
				static::$facade_over_classname . '::' . $function
			)
		);
	}

	/**
	 * Executes when calling any function on an instance of this class.
	 *
	 * @param string $name      The name of the function being called.
	 * @param array  $arguments An array of the arguments to the function call.
	 */
	public function __call( $name, $arguments ) {
		self::log_deprecation( $name );

		return call_user_func_array(
			array(
				$this->instance,
				$name,
			),
			$arguments
		);
	}

	/**
	 * Executes when calling any static function on this class.
	 *
	 * @param string $name      The name of the function being called.
	 * @param array  $arguments An array of the arguments to the function call.
	 */
	public static function __callStatic( $name, $arguments ) {
		self::log_deprecation( $name );

		return call_user_func_array(
			array(
				static::$facade_over_classname,
				$name,
			),
			$arguments
		);
	}
}
woocommerce-admin/src/Install.php000064400000040626151335517650013102 0ustar00<?php
/**
 * Installation related functions and actions.
 */

namespace Automattic\WooCommerce\Admin;

defined( 'ABSPATH' ) || exit;

use Automattic\WooCommerce\Admin\API\Reports\Cache;
use \Automattic\WooCommerce\Admin\Notes\Notes;

/**
 * Install Class.
 */
class Install {
	/**
	 * Plugin version option name.
	 */
	const VERSION_OPTION = 'woocommerce_admin_version';

	/**
	 * DB updates and callbacks that need to be run per version.
	 *
	 * @var array
	 */
	protected static $db_updates = array(
		'0.20.1' => array(
			'wc_admin_update_0201_order_status_index',
			'wc_admin_update_0201_db_version',
		),
		'0.23.0' => array(
			'wc_admin_update_0230_rename_gross_total',
			'wc_admin_update_0230_db_version',
		),
		'0.25.1' => array(
			'wc_admin_update_0251_remove_unsnooze_action',
			'wc_admin_update_0251_db_version',
		),
		'1.1.0'  => array(
			'wc_admin_update_110_remove_facebook_note',
			'wc_admin_update_110_db_version',
		),
		'1.3.0'  => array(
			'wc_admin_update_130_remove_dismiss_action_from_tracking_opt_in_note',
			'wc_admin_update_130_db_version',
		),
		'1.4.0'  => array(
			'wc_admin_update_140_change_deactivate_plugin_note_type',
			'wc_admin_update_140_db_version',
		),
		'1.6.0'  => array(
			'wc_admin_update_160_remove_facebook_note',
			'wc_admin_update_160_db_version',
		),
		'1.7.0'  => array(
			'wc_admin_update_170_homescreen_layout',
			'wc_admin_update_170_db_version',
		),
		'2.7.0'  => array(
			'wc_admin_update_270_delete_report_downloads',
			'wc_admin_update_270_db_version',
		),
		'2.7.1'  => array(
			'wc_admin_update_271_update_task_list_options',
			'wc_admin_update_271_db_version',
		),
		'2.8.0'  => array(
			'wc_admin_update_280_order_status',
			'wc_admin_update_280_db_version',
		),
	);

	/**
	 * Migrated option names mapping. New => old.
	 *
	 * @var array
	 */
	protected static $migrated_options = array(
		'woocommerce_onboarding_profile'           => 'wc_onboarding_profile',
		'woocommerce_admin_install_timestamp'      => 'wc_admin_install_timestamp',
		'woocommerce_onboarding_opt_in'            => 'wc_onboarding_opt_in',
		'woocommerce_admin_import_stats'           => 'wc_admin_import_stats',
		'woocommerce_admin_version'                => 'wc_admin_version',
		'woocommerce_admin_last_orders_milestone'  => 'wc_admin_last_orders_milestone',
		'woocommerce_admin-wc-helper-last-refresh' => 'wc-admin-wc-helper-last-refresh',
		'woocommerce_admin_report_export_status'   => 'wc_admin_report_export_status',
		'woocommerce_task_list_complete'           => 'woocommerce_task_list_complete',
		'woocommerce_task_list_hidden'             => 'woocommerce_task_list_hidden',
		'woocommerce_extended_task_list_complete'  => 'woocommerce_extended_task_list_complete',
		'woocommerce_extended_task_list_hidden'    => 'woocommerce_extended_task_list_hidden',
	);

	/**
	 * Hook in tabs.
	 */
	public static function init() {
		add_action( 'init', array( __CLASS__, 'check_version' ), 5 );
		add_filter( 'wpmu_drop_tables', array( __CLASS__, 'wpmu_drop_tables' ) );

		// Add wc-admin report tables to list of WooCommerce tables.
		add_filter( 'woocommerce_install_get_tables', array( __CLASS__, 'add_tables' ) );
	}

	/**
	 * Migrate option values to their new keys/names.
	 */
	public static function migrate_options() {
		wc_maybe_define_constant( 'WC_ADMIN_MIGRATING_OPTIONS', true );

		foreach ( self::$migrated_options as $new_option => $old_option ) {
			$old_option_value = get_option( $old_option, false );

			// Continue if no option value was previously set.
			if ( false === $old_option_value ) {
				continue;
			}

			if ( '1' === $old_option_value ) {
				$old_option_value = 'yes';
			} elseif ( '0' === $old_option_value ) {
				$old_option_value = 'no';
			}

			update_option( $new_option, $old_option_value );
			if ( $new_option !== $old_option ) {
				delete_option( $old_option );
			}
		}
	}

	/**
	 * Check WC Admin version and run the updater is required.
	 *
	 * This check is done on all requests and runs if the versions do not match.
	 */
	public static function check_version() {
		if ( defined( 'IFRAME_REQUEST' ) ) {
			return;
		}

		$version_option  = get_option( self::VERSION_OPTION );
		$requires_update = version_compare( get_option( self::VERSION_OPTION ), WC_ADMIN_VERSION_NUMBER, '<' );

		/*
		 * When included as part of Core, no `on_activation` hook as been called
		 * so there is no version in options. Make sure install gets called in this
		 * case as well as a regular version update
		 */
		if ( ! $version_option || $requires_update ) {
			self::install();
			/**
			 * WooCommerce Admin has been installed or updated.
			 */
			do_action( 'woocommerce_admin_updated' );

			if ( ! $version_option ) {
				/**
				 * WooCommerce Admin has been installed.
				 */
				do_action( 'woocommerce_admin_newly_installed' );
			}

			if ( $requires_update ) {
				/**
				 * An existing installation of WooCommerce Admin has been
				 * updated.
				 */
				do_action( 'woocommerce_admin_updated_existing' );
			}
		}

		/*
		 * Add the version option if none is found, as would be the case when
		 * initialized via Core for the first time.
		 */
		if ( ! $version_option ) {
			add_option( self::VERSION_OPTION, WC_ADMIN_VERSION_NUMBER );
		}
	}

	/**
	 * Install WC Admin.
	 */
	public static function install() {
		if ( ! is_blog_installed() ) {
			return;
		}

		// Check if we are not already running this routine.
		if ( 'yes' === get_transient( 'wc_admin_installing' ) ) {
			return;
		}

		// If we made it till here nothing is running yet, lets set the transient now.
		set_transient( 'wc_admin_installing', 'yes', MINUTE_IN_SECONDS * 10 );
		wc_maybe_define_constant( 'WC_ADMIN_INSTALLING', true );

		self::migrate_options();
		self::create_tables();
		self::create_events();
		self::delete_obsolete_notes();
		self::maybe_update_db_version();

		delete_transient( 'wc_admin_installing' );

		// Use add_option() here to avoid overwriting this value with each
		// plugin version update. We base plugin age off of this value.
		add_option( 'woocommerce_admin_install_timestamp', time() );
		do_action( 'woocommerce_admin_installed' );
	}

	/**
	 * Get database schema.
	 *
	 * @return string
	 */
	protected static function get_schema() {
		global $wpdb;

		$collate = $wpdb->has_cap( 'collation' ) ? $wpdb->get_charset_collate() : '';

		// Max DB index length. See wp_get_db_schema().
		$max_index_length = 191;

		$tables = "
		CREATE TABLE {$wpdb->prefix}wc_order_stats (
			order_id bigint(20) unsigned NOT NULL,
			parent_id bigint(20) unsigned DEFAULT 0 NOT NULL,
			date_created datetime DEFAULT '0000-00-00 00:00:00' NOT NULL,
			date_created_gmt datetime DEFAULT '0000-00-00 00:00:00' NOT NULL,
			num_items_sold int(11) DEFAULT 0 NOT NULL,
			total_sales double DEFAULT 0 NOT NULL,
			tax_total double DEFAULT 0 NOT NULL,
			shipping_total double DEFAULT 0 NOT NULL,
			net_total double DEFAULT 0 NOT NULL,
			returning_customer boolean DEFAULT NULL,
			status varchar(200) NOT NULL,
			customer_id BIGINT UNSIGNED NOT NULL,
			PRIMARY KEY (order_id),
			KEY date_created (date_created),
			KEY customer_id (customer_id),
			KEY status (status({$max_index_length}))
		) $collate;
		CREATE TABLE {$wpdb->prefix}wc_order_product_lookup (
			order_item_id BIGINT UNSIGNED NOT NULL,
			order_id BIGINT UNSIGNED NOT NULL,
			product_id BIGINT UNSIGNED NOT NULL,
			variation_id BIGINT UNSIGNED NOT NULL,
			customer_id BIGINT UNSIGNED NULL,
			date_created datetime DEFAULT '0000-00-00 00:00:00' NOT NULL,
			product_qty INT NOT NULL,
			product_net_revenue double DEFAULT 0 NOT NULL,
			product_gross_revenue double DEFAULT 0 NOT NULL,
			coupon_amount double DEFAULT 0 NOT NULL,
			tax_amount double DEFAULT 0 NOT NULL,
			shipping_amount double DEFAULT 0 NOT NULL,
			shipping_tax_amount double DEFAULT 0 NOT NULL,
			PRIMARY KEY  (order_item_id),
			KEY order_id (order_id),
			KEY product_id (product_id),
			KEY customer_id (customer_id),
			KEY date_created (date_created)
		) $collate;
		CREATE TABLE {$wpdb->prefix}wc_order_tax_lookup (
			order_id BIGINT UNSIGNED NOT NULL,
			tax_rate_id BIGINT UNSIGNED NOT NULL,
			date_created datetime DEFAULT '0000-00-00 00:00:00' NOT NULL,
			shipping_tax double DEFAULT 0 NOT NULL,
			order_tax double DEFAULT 0 NOT NULL,
			total_tax double DEFAULT 0 NOT NULL,
			PRIMARY KEY (order_id, tax_rate_id),
			KEY tax_rate_id (tax_rate_id),
			KEY date_created (date_created)
		) $collate;
		CREATE TABLE {$wpdb->prefix}wc_order_coupon_lookup (
			order_id BIGINT UNSIGNED NOT NULL,
			coupon_id BIGINT NOT NULL,
			date_created datetime DEFAULT '0000-00-00 00:00:00' NOT NULL,
			discount_amount double DEFAULT 0 NOT NULL,
			PRIMARY KEY (order_id, coupon_id),
			KEY coupon_id (coupon_id),
			KEY date_created (date_created)
		) $collate;
		CREATE TABLE {$wpdb->prefix}wc_admin_notes (
			note_id BIGINT UNSIGNED NOT NULL AUTO_INCREMENT,
			name varchar(255) NOT NULL,
			type varchar(20) NOT NULL,
			locale varchar(20) NOT NULL,
			title longtext NOT NULL,
			content longtext NOT NULL,
			content_data longtext NULL default null,
			status varchar(200) NOT NULL,
			source varchar(200) NOT NULL,
			date_created datetime NOT NULL default '0000-00-00 00:00:00',
			date_reminder datetime NULL default null,
			is_snoozable boolean DEFAULT 0 NOT NULL,
			layout varchar(20) DEFAULT '' NOT NULL,
			image varchar(200) NULL DEFAULT NULL,
			is_deleted boolean DEFAULT 0 NOT NULL,
			icon varchar(200) NOT NULL default 'info',
			PRIMARY KEY (note_id)
		) $collate;
		CREATE TABLE {$wpdb->prefix}wc_admin_note_actions (
			action_id BIGINT UNSIGNED NOT NULL AUTO_INCREMENT,
			note_id BIGINT UNSIGNED NOT NULL,
			name varchar(255) NOT NULL,
			label varchar(255) NOT NULL,
			query longtext NOT NULL,
			status varchar(255) NOT NULL,
			is_primary boolean DEFAULT 0 NOT NULL,
			actioned_text varchar(255) NOT NULL,
			nonce_action varchar(255) NULL DEFAULT NULL,
			nonce_name varchar(255) NULL DEFAULT NULL,
			PRIMARY KEY (action_id),
			KEY note_id (note_id)
		) $collate;
		CREATE TABLE {$wpdb->prefix}wc_customer_lookup (
			customer_id BIGINT UNSIGNED NOT NULL AUTO_INCREMENT,
			user_id BIGINT UNSIGNED DEFAULT NULL,
			username varchar(60) DEFAULT '' NOT NULL,
			first_name varchar(255) NOT NULL,
			last_name varchar(255) NOT NULL,
			email varchar(100) NULL default NULL,
			date_last_active timestamp NULL default null,
			date_registered timestamp NULL default null,
			country char(2) DEFAULT '' NOT NULL,
			postcode varchar(20) DEFAULT '' NOT NULL,
			city varchar(100) DEFAULT '' NOT NULL,
			state varchar(100) DEFAULT '' NOT NULL,
			PRIMARY KEY (customer_id),
			UNIQUE KEY user_id (user_id),
			KEY email (email)
		) $collate;
		CREATE TABLE {$wpdb->prefix}wc_category_lookup (
			category_tree_id BIGINT UNSIGNED NOT NULL,
			category_id BIGINT UNSIGNED NOT NULL,
			PRIMARY KEY (category_tree_id,category_id)
		) $collate;
		";

		return $tables;
	}

	/**
	 * Create database tables.
	 */
	public static function create_tables() {
		require_once ABSPATH . 'wp-admin/includes/upgrade.php';

		dbDelta( self::get_schema() );
	}

	/**
	 * Return a list of tables. Used to make sure all WC Admin tables are dropped
	 * when uninstalling the plugin in a single site or multi site environment.
	 *
	 * @return array WC tables.
	 */
	public static function get_tables() {
		global $wpdb;

		return array(
			"{$wpdb->prefix}wc_order_stats",
			"{$wpdb->prefix}wc_order_product_lookup",
			"{$wpdb->prefix}wc_order_tax_lookup",
			"{$wpdb->prefix}wc_order_coupon_lookup",
			"{$wpdb->prefix}wc_admin_notes",
			"{$wpdb->prefix}wc_admin_note_actions",
			"{$wpdb->prefix}wc_customer_lookup",
			"{$wpdb->prefix}wc_category_lookup",
		);
	}

	/**
	 * Adds new tables.
	 *
	 * @param array $wc_tables List of WooCommerce tables.
	 * @return array
	 */
	public static function add_tables( $wc_tables ) {
		return array_merge(
			$wc_tables,
			self::get_tables()
		);
	}

	/**
	 * Uninstall tables when MU blog is deleted.
	 *
	 * @param array $tables List of tables that will be deleted by WP.
	 *
	 * @return string[]
	 */
	public static function wpmu_drop_tables( $tables ) {
		return array_merge( $tables, self::get_tables() );
	}

	/**
	 * Get list of DB update callbacks.
	 *
	 * @return array
	 */
	public static function get_db_update_callbacks() {
		return self::$db_updates;
	}

	/**
	 * Is a DB update needed?
	 *
	 * @return boolean
	 */
	public static function needs_db_update() {
		$current_db_version = get_option( self::VERSION_OPTION, null );
		$updates            = self::get_db_update_callbacks();
		$update_versions    = array_keys( $updates );
		usort( $update_versions, 'version_compare' );

		return ! is_null( $current_db_version ) && version_compare( $current_db_version, end( $update_versions ), '<' );
	}

	/**
	 * See if we need to show or run database updates during install.
	 */
	private static function maybe_update_db_version() {
		if ( self::needs_db_update() ) {
			self::update();
		} else {
			self::update_db_version();
		}
	}

	/**
	 * Push all needed DB updates to the queue for processing.
	 */
	private static function update() {
		$current_db_version = get_option( self::VERSION_OPTION );
		$loop               = 0;

		foreach ( self::get_db_update_callbacks() as $version => $update_callbacks ) {
			if ( version_compare( $current_db_version, $version, '<' ) ) {
				$completed_version_updates = 0;

				foreach ( $update_callbacks as $update_callback ) {
					$pending_jobs = WC()->queue()->search(
						array(
							'per_page' => 1,
							'hook'     => 'woocommerce_run_update_callback',
							'search'   => wp_json_encode( array( $update_callback ) ),
							'group'    => 'woocommerce-db-updates',
							'status'   => 'pending',
						)
					);

					$complete_jobs = WC()->queue()->search(
						array(
							'per_page' => 1,
							'hook'     => 'woocommerce_run_update_callback',
							'search'   => wp_json_encode( array( $update_callback ) ),
							'group'    => 'woocommerce-db-updates',
							'status'   => 'complete',
						)
					);

					$completed_version_updates += count( $complete_jobs );

					if ( empty( $pending_jobs ) && empty( $complete_jobs ) ) {
						WC()->queue()->schedule_single(
							time() + $loop,
							'woocommerce_run_update_callback',
							array( $update_callback ),
							'woocommerce-db-updates'
						);
						Cache::invalidate();
					}

					$loop++;

				}

				// Users have experienced concurrency issues where all update callbacks
				// have run but the version option hasn't been updated. If all the updates
				// for a version are complete, update the version option to reflect that.
				// See: https:// github.com/woocommerce/woocommerce-admin/issues/5058.
				if ( count( $update_callbacks ) === $completed_version_updates ) {
					self::update_db_version( $version );
				}
			}
		}
	}

	/**
	 * Update WC Admin version to current.
	 *
	 * @param string|null $version New WooCommerce Admin DB version or null.
	 */
	public static function update_db_version( $version = null ) {
		delete_option( self::VERSION_OPTION );
		add_option( self::VERSION_OPTION, is_null( $version ) ? WC_ADMIN_VERSION_NUMBER : $version );
	}

	/**
	 * Schedule cron events.
	 */
	public static function create_events() {
		if ( ! wp_next_scheduled( 'wc_admin_daily' ) ) {
			wp_schedule_event( time(), 'daily', 'wc_admin_daily' );
		}
		// Note: this is potentially redundant when the core package exists.
		wp_schedule_single_event( time() + 10, 'generate_category_lookup_table' );
	}

	/**
	 * Delete obsolete notes.
	 */
	protected static function delete_obsolete_notes() {
		$obsolete_notes_names = array(
			'wc-admin-welcome-note',
			'wc-admin-store-notice-setting-moved',
			'wc-admin-store-notice-giving-feedback',
			'wc-admin-learn-more-about-product-settings',
			'wc-admin-onboarding-profiler-reminder',
			'wc-admin-historical-data',
			'wc-admin-review-shipping-settings',
			'wc-admin-home-screen-feedback',
			'wc-admin-effortless-payments-by-mollie',
			'wc-admin-google-ads-and-marketing',
		);

		$additional_obsolete_notes_names = apply_filters(
			'woocommerce_admin_obsolete_notes_names',
			array()
		);

		if ( is_array( $additional_obsolete_notes_names ) ) {
			$obsolete_notes_names = array_merge(
				$obsolete_notes_names,
				$additional_obsolete_notes_names
			);
		}

		Notes::delete_notes_with_name( $obsolete_notes_names );
	}

	/**
	 * Drop WooCommerce Admin tables.
	 *
	 * @return void
	 */
	public static function drop_tables() {
		global $wpdb;

		$tables = self::get_tables();

		foreach ( $tables as $table ) {
			/* phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared */
			$wpdb->query( "DROP TABLE IF EXISTS {$table}" );
			/* phpcs:enable */
		}
	}
}
woocommerce-admin/src/Survey.php000064400000001367151335517650012770 0ustar00<?php
/**
 * Survey helper methods.
 */

namespace Automattic\WooCommerce\Admin;

defined( 'ABSPATH' ) || exit;

/**
 * Survey Class.
 */
class Survey {
	/**
	 * Survey URL.
	 */
	const SURVEY_URL = 'https://automattic.survey.fm';

	/**
	 * Get a survey's URL from a path.
	 *
	 * @param  string $path Path of the survey.
	 * @param  array  $query Query arguments as key value pairs.
	 * @return string Full URL to survey.
	 */
	public static function get_url( $path, $query = array() ) {
		$url = self::SURVEY_URL . $path;

		$query_args = apply_filters( 'woocommerce_admin_survey_query', $query );

		if ( ! empty( $query_args ) ) {
			$query_string = http_build_query( $query_args );
			$url          = $url . '?' . $query_string;
		}

		return $url;
	}
}
woocommerce-admin/src/FeaturePlugin.php000064400000022621151335517650014241 0ustar00<?php
/**
 * WooCommerce Admin: Feature plugin main class.
 */

namespace Automattic\WooCommerce\Admin;

defined( 'ABSPATH' ) || exit;

use \Automattic\WooCommerce\Admin\Notes\LearnMoreAboutVariableProducts;
use \Automattic\WooCommerce\Admin\Notes\Notes;
use \Automattic\WooCommerce\Admin\Notes\OrderMilestones;
use \Automattic\WooCommerce\Admin\Notes\WooSubscriptionsNotes;
use \Automattic\WooCommerce\Admin\Notes\TrackingOptIn;
use \Automattic\WooCommerce\Admin\Notes\WooCommercePayments;
use \Automattic\WooCommerce\Admin\Notes\InstallJPAndWCSPlugins;
use \Automattic\WooCommerce\Admin\Notes\DrawAttention;
use \Automattic\WooCommerce\Admin\Notes\SetUpAdditionalPaymentTypes;
use \Automattic\WooCommerce\Admin\Notes\TestCheckout;
use \Automattic\WooCommerce\Admin\Notes\SellingOnlineCourses;
use \Automattic\WooCommerce\Admin\Notes\MerchantEmailNotifications\MerchantEmailNotifications;
use \Automattic\WooCommerce\Admin\Notes\WelcomeToWooCommerceForStoreUsers;
use \Automattic\WooCommerce\Admin\Notes\ManageStoreActivityFromHomeScreen;
use \Automattic\WooCommerce\Admin\Notes\NavigationNudge;
use Automattic\WooCommerce\Admin\Features\Features;

/**
 * Feature plugin main class.
 *
 * @internal This file will not be bundled with woo core, only the feature plugin.
 * @internal Note this is not called WC_Admin due to a class already existing in core with that name.
 */
class FeaturePlugin {
	/**
	 * The single instance of the class.
	 *
	 * @var object
	 */
	protected static $instance = null;

	/**
	 * Constructor
	 *
	 * @return void
	 */
	protected function __construct() {}

	/**
	 * Get class instance.
	 *
	 * @return object Instance.
	 */
	final public static function instance() {
		if ( null === static::$instance ) {
			static::$instance = new static();
		}
		return static::$instance;
	}

	/**
	 * Init the feature plugin, only if we can detect both Gutenberg and WooCommerce.
	 */
	public function init() {
		// Load the page controller functions file first to prevent fatal errors when disabling WooCommerce Admin.
		$this->define_constants();
		require_once WC_ADMIN_ABSPATH . '/includes/page-controller-functions.php';
		require_once WC_ADMIN_ABSPATH . '/src/Notes/DeprecatedNotes.php';
		require_once WC_ADMIN_ABSPATH . '/includes/core-functions.php';
		require_once WC_ADMIN_ABSPATH . '/includes/feature-config.php';
		require_once WC_ADMIN_ABSPATH . '/includes/wc-admin-update-functions.php';
		require_once WC_ADMIN_ABSPATH . '/includes/class-experimental-abtest.php';

		register_activation_hook( WC_ADMIN_PLUGIN_FILE, array( $this, 'on_activation' ) );
		register_deactivation_hook( WC_ADMIN_PLUGIN_FILE, array( $this, 'on_deactivation' ) );
		if ( did_action( 'plugins_loaded' ) ) {
			self::on_plugins_loaded();
		} else {
			// Make sure we hook into `plugins_loaded` before core's Automattic\WooCommerce\Package::init().
			// If core is network activated but we aren't, the packaged version of WooCommerce Admin will
			// attempt to use a data store that hasn't been loaded yet - because we've defined our constants here.
			// See: https://github.com/woocommerce/woocommerce-admin/issues/3869.
			add_action( 'plugins_loaded', array( $this, 'on_plugins_loaded' ), 9 );
		}
	}

	/**
	 * Install DB and create cron events when activated.
	 *
	 * @return void
	 */
	public function on_activation() {
		Install::create_tables();
		Install::create_events();
	}

	/**
	 * Remove WooCommerce Admin scheduled actions on deactivate.
	 *
	 * @return void
	 */
	public function on_deactivation() {
		// Don't clean up if the WooCommerce Admin package is in core.
		// NOTE: Any future divergence from the core package will need to be accounted for here.
		if ( defined( 'WC_ADMIN_PACKAGE_EXISTS' ) && WC_ADMIN_PACKAGE_EXISTS ) {
			return;
		}

		// Check if we are deactivating due to dependencies not being satisfied.
		// If WooCommerce is disabled we can't include files that depend upon it.
		if ( ! $this->has_satisfied_dependencies() ) {
			return;
		}

		$this->includes();
		ReportsSync::clear_queued_actions();
		Notes::clear_queued_actions();
		wp_clear_scheduled_hook( 'wc_admin_daily' );
		wp_clear_scheduled_hook( 'generate_category_lookup_table' );
	}

	/**
	 * Setup plugin once all other plugins are loaded.
	 *
	 * @return void
	 */
	public function on_plugins_loaded() {
		$this->load_plugin_textdomain();

		if ( ! $this->has_satisfied_dependencies() ) {
			add_action( 'admin_init', array( $this, 'deactivate_self' ) );
			add_action( 'admin_notices', array( $this, 'render_dependencies_notice' ) );
			return;
		}

		$this->hooks();
		$this->includes();
	}

	/**
	 * Define Constants.
	 */
	protected function define_constants() {
		$this->define( 'WC_ADMIN_APP', 'wc-admin-app' );
		$this->define( 'WC_ADMIN_ABSPATH', dirname( __DIR__ ) . '/' );
		$this->define( 'WC_ADMIN_DIST_JS_FOLDER', 'dist/' );
		$this->define( 'WC_ADMIN_DIST_CSS_FOLDER', 'dist/' );
		$this->define( 'WC_ADMIN_PLUGIN_FILE', WC_ADMIN_ABSPATH . 'woocommerce-admin.php' );
		// WARNING: Do not directly edit this version number constant.
		// It is updated as part of the prebuild process from the package.json value.
		$this->define( 'WC_ADMIN_VERSION_NUMBER', '2.8.0' );
	}

	/**
	 * Load Localisation files.
	 */
	protected function load_plugin_textdomain() {
		load_plugin_textdomain( 'woocommerce-admin', false, basename( dirname( __DIR__ ) ) . '/languages' );
	}

	/**
	 * Include WC Admin classes.
	 */
	public function includes() {
		// Initialize Database updates, option migrations, and Notes.
		Install::init();
		Events::instance()->init();
		Notes::init();

		// Initialize Plugins Installer.
		PluginsInstaller::init();

		// Initialize API.
		API\Init::instance();

		if ( Features::is_enabled( 'analytics' ) ) {
			// Initialize Reports syncing.
			ReportsSync::init();
			CategoryLookup::instance()->init();

			// Initialize Reports exporter.
			ReportExporter::init();
		}

		// Admin note providers.
		// @todo These should be bundled in the features/ folder, but loading them from there currently has a load order issue.
		new WooSubscriptionsNotes();
		new OrderMilestones();
		new TrackingOptIn();
		new WooCommercePayments();
		new InstallJPAndWCSPlugins();
		new DrawAttention();
		new SetUpAdditionalPaymentTypes();
		new TestCheckout();
		new SellingOnlineCourses();
		new LearnMoreAboutVariableProducts();
		new WelcomeToWooCommerceForStoreUsers();
		new ManageStoreActivityFromHomeScreen();
		new NavigationNudge();

		// Initialize MerchantEmailNotifications.
		MerchantEmailNotifications::init();
	}

	/**
	 * Set up our admin hooks and plugin loader.
	 */
	protected function hooks() {
		add_filter( 'woocommerce_admin_features', array( $this, 'replace_supported_features' ), 0 );

		Loader::get_instance();
	}

	/**
	 * Get an array of dependency error messages.
	 *
	 * @return array
	 */
	protected function get_dependency_errors() {
		$errors                      = array();
		$wordpress_version           = get_bloginfo( 'version' );
		$minimum_wordpress_version   = '5.4';
		$minimum_woocommerce_version = '4.8';
		$wordpress_minimum_met       = version_compare( $wordpress_version, $minimum_wordpress_version, '>=' );
		$woocommerce_minimum_met     = class_exists( 'WooCommerce' ) && version_compare( WC_VERSION, $minimum_woocommerce_version, '>=' );

		if ( ! $woocommerce_minimum_met ) {
			$errors[] = sprintf(
				/* translators: 1: URL of WooCommerce plugin, 2: The minimum WooCommerce version number */
				__( 'The WooCommerce Admin feature plugin requires <a href="%1$s">WooCommerce</a> %2$s or greater to be installed and active.', 'woocommerce' ),
				'https://wordpress.org/plugins/woocommerce/',
				$minimum_woocommerce_version
			);
		}

		if ( ! $wordpress_minimum_met ) {
			$errors[] = sprintf(
				/* translators: 1: URL of WordPress.org, 2: The minimum WordPress version number */
				__( 'The WooCommerce Admin feature plugin requires <a href="%1$s">WordPress</a> %2$s or greater to be installed and active.', 'woocommerce' ),
				'https://wordpress.org/',
				$minimum_wordpress_version
			);
		}

		return $errors;
	}

	/**
	 * Returns true if all dependencies for the wc-admin plugin are loaded.
	 *
	 * @return bool
	 */
	public function has_satisfied_dependencies() {
		$dependency_errors = $this->get_dependency_errors();
		return 0 === count( $dependency_errors );
	}

	/**
	 * Deactivates this plugin.
	 */
	public function deactivate_self() {
		deactivate_plugins( plugin_basename( WC_ADMIN_PLUGIN_FILE ) );
		unset( $_GET['activate'] ); // phpcs:ignore CSRF ok.
	}

	/**
	 * Notify users of the plugin requirements.
	 */
	public function render_dependencies_notice() {
		$message = $this->get_dependency_errors();
		printf( '<div class="error"><p>%s</p></div>', implode( ' ', $message ) ); /* phpcs:ignore xss ok. */
	}

	/**
	 * Overwrites the allowed features array using a local `feature-config.php` file.
	 *
	 * @param array $features Array of feature slugs.
	 */
	public function replace_supported_features( $features ) {
		$feature_config = apply_filters( 'woocommerce_admin_get_feature_config', wc_admin_get_feature_config() );
		$features       = array_keys( array_filter( $feature_config ) );
		return $features;
	}

	/**
	 * Define constant if not already set.
	 *
	 * @param string      $name  Constant name.
	 * @param string|bool $value Constant value.
	 */
	protected function define( $name, $value ) {
		if ( ! defined( $name ) ) {
			define( $name, $value );
		}
	}

	/**
	 * Prevent cloning.
	 */
	private function __clone() {}

	/**
	 * Prevent unserializing.
	 */
	public function __wakeup() {
		die();
	}
}
woocommerce-admin/src/PaymentPlugins.php000064400000005627151335517650014455 0ustar00<?php
/**
 * WooCommerce Payment methods.
 * NOTE: DO NOT edit this file in WooCommerce core, this is generated from woocommerce-admin.
 */

namespace Automattic\WooCommerce\Admin;

/**
 * Contains backend logic for retrieving payment plugin recommendations.
 */
class PaymentPlugins {
	/**
	 * Name of recommended plugins filter.
	 */
	const FILTER_NAME = 'woocommerce_admin_recommended_payment_plugins';

	/**
	 * Name of recommended plugins transient.
	 *
	 * @var string
	 */
	const RECOMMENDED_PLUGINS_TRANSIENT = 'wc_recommended_payment_plugins';


	/**
	 * Class instance.
	 *
	 * @var PaymentPlugins instance
	 */
	protected static $instance = null;

	/**
	 * Get class instance.
	 */
	public static function get_instance() {
		if ( ! self::$instance ) {
			self::$instance = new self();
		}
		return self::$instance;
	}

	/**
	 * Load recommended payment plugins from WooCommerce.com
	 *
	 * @return array
	 */
	public function get_recommended_plugins() {
		if ( ! self::allow_recommendations() ) {
			return array();
		}
		$plugins_data = get_transient( self::RECOMMENDED_PLUGINS_TRANSIENT );

		if ( false === $plugins_data ) {
			include_once ABSPATH . '/wp-admin/includes/plugin-install.php';

			$url     = 'https://woocommerce.com/wp-json/wccom/marketplace-suggestions/1.0/payment-suggestions.json';
			$request = wp_safe_remote_get( $url );
			$plugins = [];

			if ( ! is_wp_error( $request ) && 200 === $request['response']['code'] ) {
				$plugins = json_decode( $request['body'], true );
			}
			foreach ( $plugins as $key => $plugin ) {
				if ( ! array_key_exists( 'copy', $plugins[ $key ] ) ) {
					$api = plugins_api(
						'plugin_information',
						array(
							'slug'   => $plugin['product'],
							'fields' => array(
								'short_description' => true,
							),
						)
					);
					if ( is_wp_error( $api ) ) {
						continue;
					}
					$plugins[ $key ]['copy'] = $api->short_description;
				}
			}

			$plugins_data = array(
				'recommendations' => $plugins,
				'updated'         => time(),
			);

			set_transient(
				self::RECOMMENDED_PLUGINS_TRANSIENT,
				$plugins_data,
				// Expire transient in 15 minutes if remote get failed.
				// Cache an empty result to avoid repeated failed requests.
				empty( $plugins ) ? 900 : 3 * DAY_IN_SECONDS
			);
		}

		return apply_filters( self::FILTER_NAME, array_values( $plugins_data['recommendations'] ) );
	}

	/**
	 * Should recommendations be displayed?
	 *
	 * @return bool
	 */
	private function allow_recommendations() {
		// Suggestions are only displayed if user can install plugins.
		if ( ! current_user_can( 'install_plugins' ) ) {
			return false;
		}

		// Suggestions may be disabled via a setting under Accounts & Privacy.
		if ( 'no' === get_option( 'woocommerce_show_marketplace_suggestions', 'yes' ) ) {
			return false;
		}

		// User can disabled all suggestions via filter.
		return apply_filters( 'woocommerce_allow_payment_recommendations', true );
	}
}

woocommerce-admin/src/Marketing/InstalledExtensions.php000064400000020441151335517650017405 0ustar00<?php
/**
 * InstalledExtensions class file.
 */

namespace Automattic\WooCommerce\Admin\Marketing;

use Automattic\WooCommerce\Admin\Loader;
use Automattic\WooCommerce\Admin\PluginsHelper;

/**
 * Installed Marketing Extensions class.
 */
class InstalledExtensions {

	/**
	 * Gets an array of plugin data for the "Installed marketing extensions" card.
	 *
	 * Valid extensions statuses are: installed, activated, configured
	 */
	public static function get_data() {
		$data = [];

		$automatewoo = self::get_automatewoo_extension_data();
		$mailchimp   = self::get_mailchimp_extension_data();
		$facebook    = self::get_facebook_extension_data();
		$pinterest   = self::get_pinterest_extension_data();
		$google      = self::get_google_extension_data();
		$hubspot     = self::get_hubspot_extension_data();
		$amazon_ebay = self::get_amazon_ebay_extension_data();

		if ( $automatewoo ) {
			$data[] = $automatewoo;
		}

		if ( $mailchimp ) {
			$data[] = $mailchimp;
		}

		if ( $facebook ) {
			$data[] = $facebook;
		}

		if ( $pinterest ) {
			$data[] = $pinterest;
		}

		if ( $google ) {
			$data[] = $google;
		}

		if ( $hubspot ) {
			$data[] = $hubspot;
		}

		if ( $amazon_ebay ) {
			$data[] = $amazon_ebay;
		}

		return $data;
	}

	/**
	 * Get allowed plugins.
	 *
	 * @return array
	 */
	public static function get_allowed_plugins() {
		return [
			'automatewoo',
			'mailchimp-for-woocommerce',
			'creative-mail-by-constant-contact',
			'facebook-for-woocommerce',
			'pinterest-for-woocommerce',
			'google-listings-and-ads',
			'hubspot-for-woocommerce',
			'woocommerce-amazon-ebay-integration',
		];
	}

	/**
	 * Get AutomateWoo extension data.
	 *
	 * @return array|bool
	 */
	protected static function get_automatewoo_extension_data() {
		$slug = 'automatewoo';

		if ( ! PluginsHelper::is_plugin_installed( $slug ) ) {
			return false;
		}

		$data         = self::get_extension_base_data( $slug );
		$data['icon'] = plugins_url( 'images/marketing/automatewoo.svg', WC_ADMIN_PLUGIN_FILE );

		if ( 'activated' === $data['status'] && function_exists( 'AW' ) ) {
			$data['settingsUrl'] = admin_url( 'admin.php?page=automatewoo-settings' );
			$data['docsUrl']     = 'https://automatewoo.com/docs/';
			$data['status']      = 'configured'; // Currently no configuration step.
		}

		return $data;
	}

	/**
	 * Get MailChimp extension data.
	 *
	 * @return array|bool
	 */
	protected static function get_mailchimp_extension_data() {
		$slug = 'mailchimp-for-woocommerce';

		if ( ! PluginsHelper::is_plugin_installed( $slug ) ) {
			return false;
		}

		$data         = self::get_extension_base_data( $slug );
		$data['icon'] = plugins_url( 'images/marketing/mailchimp.svg', WC_ADMIN_PLUGIN_FILE );

		if ( 'activated' === $data['status'] && function_exists( 'mailchimp_is_configured' ) ) {
			$data['docsUrl']     = 'https://mailchimp.com/help/connect-or-disconnect-mailchimp-for-woocommerce/';
			$data['settingsUrl'] = admin_url( 'admin.php?page=mailchimp-woocommerce' );

			if ( mailchimp_is_configured() ) {
				$data['status'] = 'configured';
			}
		}

		return $data;
	}

	/**
	 * Get Facebook extension data.
	 *
	 * @return array|bool
	 */
	protected static function get_facebook_extension_data() {
		$slug = 'facebook-for-woocommerce';

		if ( ! PluginsHelper::is_plugin_installed( $slug ) ) {
			return false;
		}

		$data         = self::get_extension_base_data( $slug );
		$data['icon'] = plugins_url( 'images/marketing/facebook.svg', WC_ADMIN_PLUGIN_FILE );

		if ( 'activated' === $data['status'] && function_exists( 'facebook_for_woocommerce' ) ) {
			$integration = facebook_for_woocommerce()->get_integration();

			if ( $integration->is_configured() ) {
				$data['status'] = 'configured';
			}

			$data['settingsUrl'] = facebook_for_woocommerce()->get_settings_url();
			$data['docsUrl']     = facebook_for_woocommerce()->get_documentation_url();
		}

		return $data;
	}

	/**
	 * Get Pinterest extension data.
	 *
	 * @return array|bool
	 */
	protected static function get_pinterest_extension_data() {
		$slug = 'pinterest-for-woocommerce';

		if ( ! PluginsHelper::is_plugin_installed( $slug ) ) {
			return false;
		}

		$data         = self::get_extension_base_data( $slug );
		$data['icon'] = plugins_url( 'images/marketing/pinterest.svg', WC_ADMIN_PLUGIN_FILE );

		// TODO: Finalise docs url.
		$data['docsUrl'] = 'https://docs.woocommerce.com/document/pinterest-for-woocommerce/?utm_medium=product';

		if ( 'activated' === $data['status'] && class_exists( 'Pinterest_For_Woocommerce' ) ) {
			$pinterest_onboarding_completed = Pinterest_For_Woocommerce()::is_setup_complete();
			if ( $pinterest_onboarding_completed ) {
				$data['status']      = 'configured';
				$data['settingsUrl'] = admin_url( 'admin.php?page=wc-admin&path=/pinterest/settings' );
			} else {
				$data['settingsUrl'] = admin_url( 'admin.php?page=wc-admin&path=/pinterest/landing' );
			}
		}

		return $data;
	}

	/**
	 * Get Google extension data.
	 *
	 * @return array|bool
	 */
	protected static function get_google_extension_data() {
		$slug = 'google-listings-and-ads';

		if ( ! PluginsHelper::is_plugin_installed( $slug ) ) {
			return false;
		}

		$data         = self::get_extension_base_data( $slug );
		$data['icon'] = plugins_url( 'images/marketing/google.svg', WC_ADMIN_PLUGIN_FILE );

		if ( 'activated' === $data['status'] && function_exists( 'woogle_get_container' ) && class_exists( '\Automattic\WooCommerce\GoogleListingsAndAds\MerchantCenter\MerchantCenterService' ) ) {

			$merchant_center = woogle_get_container()->get( \Automattic\WooCommerce\GoogleListingsAndAds\MerchantCenter\MerchantCenterService::class );

			if ( $merchant_center->is_setup_complete() ) {
				$data['status']      = 'configured';
				$data['settingsUrl'] = admin_url( 'admin.php?page=wc-admin&path=/google/settings' );
			} else {
				$data['settingsUrl'] = admin_url( 'admin.php?page=wc-admin&path=/google/start' );
			}

			$data['docsUrl'] = 'https://docs.woocommerce.com/document/google-listings-and-ads/?utm_medium=product';
		}

		return $data;
	}

	/**
	 * Get Hubspot extension data.
	 *
	 * @return array|bool
	 */
	protected static function get_hubspot_extension_data() {
		$slug = 'hubspot-for-woocommerce';

		if ( ! PluginsHelper::is_plugin_installed( $slug ) ) {
			return false;
		}

		$data         = self::get_extension_base_data( $slug );
		$data['icon'] = plugins_url( 'images/marketing/hubspot.svg', WC_ADMIN_PLUGIN_FILE );

		if ( 'activated' === $data['status'] && class_exists( '\Hubwoo' ) ) {

			// Use same check as HubWoo admin.
			if ( \Hubwoo::is_setup_completed() ) {
				$data['status'] = 'configured';
			}

			$data['settingsUrl'] = admin_url( 'admin.php?page=hubwoo' );
			$data['docsUrl']     = 'https://docs.makewebbetter.com/hubspot-integration-for-woocommerce/';
		}

		return $data;
	}

	/**
	 * Get Amazon / Ebay extension data.
	 *
	 * @return array|bool
	 */
	protected static function get_amazon_ebay_extension_data() {
		$slug = 'woocommerce-amazon-ebay-integration';

		if ( ! PluginsHelper::is_plugin_installed( $slug ) ) {
			return false;
		}

		$data         = self::get_extension_base_data( $slug );
		$data['icon'] = plugins_url( 'images/marketing/amazon-ebay.svg', WC_ADMIN_PLUGIN_FILE );

		if ( 'activated' === $data['status'] && class_exists( '\CodistoConnect' ) ) {

			$codisto_merchantid = get_option( 'codisto_merchantid' );

			// Use same check as codisto admin tabs.
			if ( is_numeric( $codisto_merchantid ) ) {
				$data['status'] = 'configured';
			}

			$data['settingsUrl'] = admin_url( 'admin.php?page=codisto-settings' );
			$data['docsUrl']     = 'https://docs.woocommerce.com/document/getting-started-with-woocommerce-amazon-ebay-integration/?utm_medium=product';
		}

		return $data;
	}


	/**
	 * Get an array of basic data for a given extension.
	 *
	 * @param string $slug Plugin slug.
	 *
	 * @return array|false
	 */
	protected static function get_extension_base_data( $slug ) {
		$status      = PluginsHelper::is_plugin_active( $slug ) ? 'activated' : 'installed';
		$plugin_data = PluginsHelper::get_plugin_data( $slug );

		if ( ! $plugin_data ) {
			return false;
		}

		return [
			'slug'        => $slug,
			'status'      => $status,
			'name'        => $plugin_data['Name'],
			'description' => html_entity_decode( wp_trim_words( $plugin_data['Description'], 20 ) ),
			'supportUrl'  => 'https://woocommerce.com/my-account/create-a-ticket/?utm_medium=product',
		];
	}

}
woocommerce-admin/src/RemoteInboxNotifications/SpecRunner.php000064400000010432151335517650020535 0ustar00<?php
/**
 * Runs a single spec.
 */

namespace Automattic\WooCommerce\Admin\RemoteInboxNotifications;

defined( 'ABSPATH' ) || exit;

use \Automattic\WooCommerce\Admin\Notes\Note;
use \Automattic\WooCommerce\Admin\Notes\Notes;

/**
 * Runs a single spec.
 */
class SpecRunner {
	/**
	 * Run the spec.
	 *
	 * @param object $spec         The spec to run.
	 * @param object $stored_state Stored state.
	 */
	public static function run_spec( $spec, $stored_state ) {
		$data_store = Notes::load_data_store();

		// Create or update the note.
		$existing_note_ids = $data_store->get_notes_with_name( $spec->slug );
		if ( 0 === count( $existing_note_ids ) ) {
			$note = new Note();
			$note->set_status( Note::E_WC_ADMIN_NOTE_PENDING );
		} else {
			$note = Notes::get_note( $existing_note_ids[0] );
			if ( false === $note ) {
				return;
			}
		}

		// Evaluate the spec and get the new note status.
		$previous_status = $note->get_status();
		$status          = EvaluateAndGetStatus::evaluate(
			$spec,
			$previous_status,
			$stored_state,
			new RuleEvaluator()
		);

		// If the status is changing, update the created date to now.
		if ( $previous_status !== $status ) {
			$note->set_date_created( time() );
		}

		// Get the matching locale or fall back to en-US.
		$locale = self::get_locale( $spec->locales );

		if ( null === $locale ) {
			return;
		}

		// Set up the note.
		$note->set_title( $locale->title );
		$note->set_content( $locale->content );
		$note->set_content_data( (object) array() );
		$note->set_status( $status );
		$note->set_type( $spec->type );
		$note->set_name( $spec->slug );
		if ( isset( $spec->source ) ) {
			$note->set_source( $spec->source );
		}

		// Clear then create actions.
		$note->clear_actions();
		$actions = isset( $spec->actions ) ? $spec->actions : array();
		foreach ( $actions as $action ) {
			$action_locale = self::get_action_locale( $action->locales );

			$url = self::get_url( $action );

			$note->add_action(
				$action->name,
				( null === $action_locale || ! isset( $action_locale->label ) )
					? ''
					: $action_locale->label,
				$url,
				$action->status,
				isset( $action->is_primary ) ? $action->is_primary : false
			);
		}

		$note->save();
	}

	/**
	 * Get the URL for an action.
	 *
	 * @param object $action The action.
	 *
	 * @return string The URL for the action.
	 */
	private static function get_url( $action ) {
		if ( ! isset( $action->url ) ) {
			return '';
		}

		if ( isset( $action->url_is_admin_query ) && $action->url_is_admin_query ) {
			return wc_admin_url( $action->url );
		}

		return $action->url;
	}

	/**
	 * Get the locale for the WordPress locale, or fall back to the en_US
	 * locale.
	 *
	 * @param Array $locales The locales to search through.
	 *
	 * @returns object The locale that was found, or null if no matching locale was found.
	 */
	public static function get_locale( $locales ) {
		$wp_locale           = get_locale();
		$matching_wp_locales = array_values(
			array_filter(
				$locales,
				function( $l ) use ( $wp_locale ) {
					return $wp_locale === $l->locale;
				}
			)
		);

		if ( 0 !== count( $matching_wp_locales ) ) {
			return $matching_wp_locales[0];
		}

		// Fall back to en_US locale.
		$en_us_locales = array_values(
			array_filter(
				$locales,
				function( $l ) {
					return 'en_US' === $l->locale;
				}
			)
		);

		if ( 0 !== count( $en_us_locales ) ) {
			return $en_us_locales[0];
		}

		return null;
	}

	/**
	 * Get the action locale that matches the note locale, or fall back to the
	 * en_US locale.
	 *
	 * @param Array $action_locales The locales from the spec's action.
	 *
	 * @return object The matching locale, or the en_US fallback locale, or null if neither was found.
	 */
	public static function get_action_locale( $action_locales ) {
		$wp_locale           = get_locale();
		$matching_wp_locales = array_values(
			array_filter(
				$action_locales,
				function ( $l ) use ( $wp_locale ) {
					return $wp_locale === $l->locale;
				}
			)
		);

		if ( 0 !== count( $matching_wp_locales ) ) {
			return $matching_wp_locales[0];
		}

		// Fall back to en_US locale.
		$en_us_locales = array_values(
			array_filter(
				$action_locales,
				function( $l ) {
					return 'en_US' === $l->locale;
				}
			)
		);

		if ( 0 !== count( $en_us_locales ) ) {
			return $en_us_locales[0];
		}

		return null;
	}
}
woocommerce-admin/src/RemoteInboxNotifications/TransformerInterface.php000064400000001424151335517650022575 0ustar00<?php

namespace Automattic\WooCommerce\Admin\RemoteInboxNotifications;

use stdClass;

/**
 * An interface to define a transformer.
 *
 * Interface TransformerInterface
 *
 * @package Automattic\WooCommerce\Admin\RemoteInboxNotifications
 */
interface TransformerInterface {
	/**
	 * Transform given value to a different value.
	 *
	 * @param mixed         $value a value to transform.
	 * @param stdClass|null $arguments arguments.
	 * @param string|null   $default default value.
	 *
	 * @return mixed|null
	 */
	public function transform( $value, stdClass $arguments = null, $default = null);

	/**
	 * Validate Transformer arguments.
	 *
	 * @param stdClass|null $arguments arguments to validate.
	 *
	 * @return mixed
	 */
	public function validate( stdClass $arguments = null );
}
woocommerce-admin/src/RemoteInboxNotifications/NoteStatusRuleProcessor.php000064400000002452151335517650023315 0ustar00<?php
/**
 * Rule processor that compares against the status of another note. For
 * example, this could be used to conditionally create a note only if another
 * note has not been actioned.
 */

namespace Automattic\WooCommerce\Admin\RemoteInboxNotifications;

defined( 'ABSPATH' ) || exit;

use Automattic\WooCommerce\Admin\Notes\Notes;

/**
 * Rule processor that compares against the status of another note.
 */
class NoteStatusRuleProcessor implements RuleProcessorInterface {
	/**
	 * Compare against the status of another note.
	 *
	 * @param object $rule         The rule being processed by this rule processor.
	 * @param object $stored_state Stored state.
	 *
	 * @return bool The result of the operation.
	 */
	public function process( $rule, $stored_state ) {
		$status = Notes::get_note_status( $rule->note_name );
		if ( ! $status ) {
			return false;
		}

		return ComparisonOperation::compare(
			$status,
			$rule->status,
			$rule->operation
		);
	}

	/**
	 * Validates the rule.
	 *
	 * @param object $rule The rule to validate.
	 *
	 * @return bool Pass/fail.
	 */
	public function validate( $rule ) {
		if ( ! isset( $rule->note_name ) ) {
			return false;
		}

		if ( ! isset( $rule->status ) ) {
			return false;
		}

		if ( ! isset( $rule->operation ) ) {
			return false;
		}

		return true;
	}
}
woocommerce-admin/src/RemoteInboxNotifications/WCAdminActiveForRuleProcessor.php000064400000003144151335517650024270 0ustar00<?php
/**
 * Rule processor for publishing if wc-admin has been active for at least the
 * given number of seconds.
 */

namespace Automattic\WooCommerce\Admin\RemoteInboxNotifications;

defined( 'ABSPATH' ) || exit;

/**
 * Rule processor for publishing if wc-admin has been active for at least the
 * given number of seconds.
 */
class WCAdminActiveForRuleProcessor implements RuleProcessorInterface {
	/**
	 * Constructor
	 *
	 * @param object $wcadmin_active_for_provider Provides the amount of time wcadmin has been active for.
	 */
	public function __construct( $wcadmin_active_for_provider = null ) {
		$this->wcadmin_active_for_provider = null === $wcadmin_active_for_provider
			? new WCAdminActiveForProvider()
			: $wcadmin_active_for_provider;
	}

	/**
	 * Performs a comparison operation against the amount of time wc-admin has
	 * been active for in days.
	 *
	 * @param object $rule         The rule being processed.
	 * @param object $stored_state Stored state.
	 *
	 * @return bool The result of the operation.
	 */
	public function process( $rule, $stored_state ) {
		$active_for_seconds = $this->wcadmin_active_for_provider->get_wcadmin_active_for_in_seconds();
		$rule_seconds       = $rule->days * DAY_IN_SECONDS;

		return ComparisonOperation::compare(
			$active_for_seconds,
			$rule_seconds,
			$rule->operation
		);
	}

	/**
	 * Validates the rule.
	 *
	 * @param object $rule The rule to validate.
	 *
	 * @return bool Pass/fail.
	 */
	public function validate( $rule ) {
		if ( ! isset( $rule->days ) ) {
			return false;
		}

		if ( ! isset( $rule->operation ) ) {
			return false;
		}

		return true;
	}
}
woocommerce-admin/src/RemoteInboxNotifications/PublishAfterTimeRuleProcessor.php000064400000002411151335517650024406 0ustar00<?php
/**
 * Rule processor for sending after a specified date/time.
 */

namespace Automattic\WooCommerce\Admin\RemoteInboxNotifications;

defined( 'ABSPATH' ) || exit;

use \Automattic\WooCommerce\Admin\DateTimeProvider\CurrentDateTimeProvider;

/**
 * Rule processor for sending after a specified date/time.
 */
class PublishAfterTimeRuleProcessor implements RuleProcessorInterface {
	/**
	 * Constructor.
	 *
	 * @param DateTimeProviderInterface $date_time_provider The DateTime provider.
	 */
	public function __construct( $date_time_provider = null ) {
		$this->date_time_provider = null === $date_time_provider
			? new CurrentDateTimeProvider()
			: $date_time_provider;
	}

	/**
	 * Process the rule.
	 *
	 * @param object $rule         The specific rule being processed by this rule processor.
	 * @param object $stored_state Stored state.
	 *
	 * @return bool Whether the rule passes or not.
	 */
	public function process( $rule, $stored_state ) {
		return $this->date_time_provider->get_now() >= new \DateTime( $rule->publish_after );
	}

	/**
	 * Validates the rule.
	 *
	 * @param object $rule The rule to validate.
	 *
	 * @return bool Pass/fail.
	 */
	public function validate( $rule ) {
		if ( ! isset( $rule->publish_after ) ) {
			return false;
		}

		return true;
	}
}
woocommerce-admin/src/RemoteInboxNotifications/OnboardingProfileRuleProcessor.php000064400000002600151335517650024602 0ustar00<?php
/**
 * Rule processor that performs a comparison operation against a value in the
 * onboarding profile.
 */

namespace Automattic\WooCommerce\Admin\RemoteInboxNotifications;

defined( 'ABSPATH' ) || exit;

/**
 * Rule processor that performs a comparison operation against a value in the
 * onboarding profile.
 */
class OnboardingProfileRuleProcessor implements RuleProcessorInterface {
	/**
	 * Performs a comparison operation against a value in the onboarding
	 * profile.
	 *
	 * @param object $rule         The rule being processed by this rule processor.
	 * @param object $stored_state Stored state.
	 *
	 * @return bool The result of the operation.
	 */
	public function process( $rule, $stored_state ) {
		$onboarding_profile = get_option( 'woocommerce_onboarding_profile' );

		if ( empty( $onboarding_profile ) ) {
			return false;
		}

		if ( ! isset( $onboarding_profile[ $rule->index ] ) ) {
			return false;
		}

		return ComparisonOperation::compare(
			$onboarding_profile[ $rule->index ],
			$rule->value,
			$rule->operation
		);
	}

	/**
	 * Validates the rule.
	 *
	 * @param object $rule The rule to validate.
	 *
	 * @return bool Pass/fail.
	 */
	public function validate( $rule ) {
		if ( ! isset( $rule->index ) ) {
			return false;
		}

		if ( ! isset( $rule->value ) ) {
			return false;
		}

		if ( ! isset( $rule->operation ) ) {
			return false;
		}

		return true;
	}
}
woocommerce-admin/src/RemoteInboxNotifications/RuleProcessorInterface.php000064400000001221151335517650023075 0ustar00<?php
/**
 * Interface for a rule processor.
 */

namespace Automattic\WooCommerce\Admin\RemoteInboxNotifications;

defined( 'ABSPATH' ) || exit;

/**
 * Rule processor interface
 */
interface RuleProcessorInterface {
	/**
	 * Processes a rule, returning the boolean result of the processing.
	 *
	 * @param object $rule         The rule to process.
	 * @param object $stored_state Stored state.
	 *
	 * @return bool The result of the processing.
	 */
	public function process( $rule, $stored_state );

	/**
	 * Validates the rule.
	 *
	 * @param object $rule The rule to validate.
	 *
	 * @return bool Pass/fail.
	 */
	public function validate( $rule );
}
woocommerce-admin/src/RemoteInboxNotifications/OrderCountRuleProcessor.php000064400000002336151335517650023271 0ustar00<?php
/**
 * Rule processor for publishing based on the number of orders.
 */

namespace Automattic\WooCommerce\Admin\RemoteInboxNotifications;

defined( 'ABSPATH' ) || exit;

/**
 * Rule processor for publishing based on the number of orders.
 */
class OrderCountRuleProcessor implements RuleProcessorInterface {
	/**
	 * Constructor.
	 *
	 * @param object $orders_provider The orders provider.
	 */
	public function __construct( $orders_provider = null ) {
		$this->orders_provider = null === $orders_provider
			? new OrdersProvider()
			: $orders_provider;
	}

	/**
	 * Process the rule.
	 *
	 * @param object $rule         The rule to process.
	 * @param object $stored_state Stored state.
	 *
	 * @return bool Whether the rule passes or not.
	 */
	public function process( $rule, $stored_state ) {
		$count = $this->orders_provider->get_order_count();

		return ComparisonOperation::compare(
			$count,
			$rule->value,
			$rule->operation
		);
	}

	/**
	 * Validates the rule.
	 *
	 * @param object $rule The rule to validate.
	 *
	 * @return bool Pass/fail.
	 */
	public function validate( $rule ) {
		if ( ! isset( $rule->value ) ) {
			return false;
		}

		if ( ! isset( $rule->operation ) ) {
			return false;
		}

		return true;
	}
}
woocommerce-admin/src/RemoteInboxNotifications/GetRuleProcessor.php000064400000003626151335517650021727 0ustar00<?php
/**
 * Gets the processor for the specified rule type.
 */

namespace Automattic\WooCommerce\Admin\RemoteInboxNotifications;

defined( 'ABSPATH' ) || exit;

/**
 * Class encapsulating getting the processor for a given rule type.
 */
class GetRuleProcessor {
	/**
	 * Get the processor for the specified rule type.
	 *
	 * @param string $rule_type The rule type.
	 *
	 * @return RuleProcessorInterface The matching processor for the specified rule type, or a FailRuleProcessor if no matching processor is found.
	 */
	public static function get_processor( $rule_type ) {
		switch ( $rule_type ) {
			case 'plugins_activated':
				return new PluginsActivatedRuleProcessor();
			case 'publish_after_time':
				return new PublishAfterTimeRuleProcessor();
			case 'publish_before_time':
				return new PublishBeforeTimeRuleProcessor();
			case 'not':
				return new NotRuleProcessor();
			case 'or':
				return new OrRuleProcessor();
			case 'fail':
				return new FailRuleProcessor();
			case 'pass':
				return new PassRuleProcessor();
			case 'plugin_version':
				return new PluginVersionRuleProcessor();
			case 'stored_state':
				return new StoredStateRuleProcessor();
			case 'order_count':
				return new OrderCountRuleProcessor();
			case 'wcadmin_active_for':
				return new WCAdminActiveForRuleProcessor();
			case 'product_count':
				return new ProductCountRuleProcessor();
			case 'onboarding_profile':
				return new OnboardingProfileRuleProcessor();
			case 'is_ecommerce':
				return new IsEcommerceRuleProcessor();
			case 'base_location_country':
				return new BaseLocationCountryRuleProcessor();
			case 'base_location_state':
				return new BaseLocationStateRuleProcessor();
			case 'note_status':
				return new NoteStatusRuleProcessor();
			case 'option':
				return new OptionRuleProcessor();
			case 'wca_updated':
				return new WooCommerceAdminUpdatedRuleProcessor();
		}

		return new FailRuleProcessor();
	}
}
woocommerce-admin/src/RemoteInboxNotifications/NotRuleProcessor.php000064400000002334151335517650021743 0ustar00<?php
/**
 * Rule processor that negates the rules in the rule's operand.
 */

namespace Automattic\WooCommerce\Admin\RemoteInboxNotifications;

defined( 'ABSPATH' ) || exit;

/**
 * Rule processor that negates the rules in the rule's operand.
 */
class NotRuleProcessor implements RuleProcessorInterface {
	/**
	 * Constructor.
	 *
	 * @param RuleEvaluator $rule_evaluator The rule evaluator to use.
	 */
	public function __construct( $rule_evaluator = null ) {
		$this->rule_evaluator = null === $rule_evaluator
			? new RuleEvaluator()
			: $rule_evaluator;
	}

	/**
	 * Evaluates the rules in the operand and negates the result.
	 *
	 * @param object $rule         The specific rule being processed by this rule processor.
	 * @param object $stored_state Stored state.
	 *
	 * @return bool The result of the operation.
	 */
	public function process( $rule, $stored_state ) {
		$evaluated_operand = $this->rule_evaluator->evaluate(
			$rule->operand,
			$stored_state
		);

		return ! $evaluated_operand;
	}

	/**
	 * Validates the rule.
	 *
	 * @param object $rule The rule to validate.
	 *
	 * @return bool Pass/fail.
	 */
	public function validate( $rule ) {
		if ( ! isset( $rule->operand ) ) {
			return false;
		}

		return true;
	}
}
woocommerce-admin/src/RemoteInboxNotifications/FailRuleProcessor.php000064400000001261151335517650022054 0ustar00<?php
/**
 * Rule processor that fails.
 */

namespace Automattic\WooCommerce\Admin\RemoteInboxNotifications;

defined( 'ABSPATH' ) || exit;

/**
 * Rule processor that fails.
 */
class FailRuleProcessor implements RuleProcessorInterface {
	/**
	 * Fails the rule.
	 *
	 * @param object $rule         The specific rule being processed by this rule processor.
	 * @param object $stored_state Stored state.
	 *
	 * @return bool Always false.
	 */
	public function process( $rule, $stored_state ) {
		return false;
	}

	/**
	 * Validates the rule.
	 *
	 * @param object $rule The rule to validate.
	 *
	 * @return bool Pass/fail.
	 */
	public function validate( $rule ) {
		return true;
	}
}
woocommerce-admin/src/RemoteInboxNotifications/PassRuleProcessor.php000064400000001407151335517650022111 0ustar00<?php
/**
 * Rule processor that passes. This is required because an empty set of rules
 * (or predicate) evaluates to false.
 */

namespace Automattic\WooCommerce\Admin\RemoteInboxNotifications;

defined( 'ABSPATH' ) || exit;

/**
 * Rule processor that passes.
 */
class PassRuleProcessor implements RuleProcessorInterface {
	/**
	 * Passes the rule.
	 *
	 * @param object $rule         The specific rule being processed by this rule processor.
	 * @param object $stored_state Stored state.
	 *
	 * @return bool Always true.
	 */
	public function process( $rule, $stored_state ) {
		return true;
	}

	/**
	 * Validates the rule.
	 *
	 * @param object $rule The rule to validate.
	 *
	 * @return bool Pass/fail.
	 */
	public function validate( $rule ) {
		return true;
	}
}
woocommerce-admin/src/RemoteInboxNotifications/BaseLocationCountryRuleProcessor.php000064400000002270151335517650025131 0ustar00<?php
/**
 * Rule processor that performs a comparison operation against the base
 * location - country.
 */

namespace Automattic\WooCommerce\Admin\RemoteInboxNotifications;

defined( 'ABSPATH' ) || exit;

/**
 * Rule processor that performs a comparison operation against the base
 * location - country.
 */
class BaseLocationCountryRuleProcessor implements RuleProcessorInterface {
	/**
	 * Performs a comparison operation against the base location - country.
	 *
	 * @param object $rule         The specific rule being processed by this rule processor.
	 * @param object $stored_state Stored state.
	 *
	 * @return bool The result of the operation.
	 */
	public function process( $rule, $stored_state ) {
		$base_location = wc_get_base_location();
		if ( ! $base_location ) {
			return false;
		}

		return ComparisonOperation::compare(
			$base_location['country'],
			$rule->value,
			$rule->operation
		);
	}

	/**
	 * Validates the rule.
	 *
	 * @param object $rule The rule to validate.
	 *
	 * @return bool Pass/fail.
	 */
	public function validate( $rule ) {
		if ( ! isset( $rule->value ) ) {
			return false;
		}

		if ( ! isset( $rule->operation ) ) {
			return false;
		}

		return true;
	}
}
woocommerce-admin/src/RemoteInboxNotifications/DataSourcePoller.php000064400000016542151335517650021671 0ustar00<?php
/**
 * Handles polling and storage of specs
 */

namespace Automattic\WooCommerce\Admin\RemoteInboxNotifications;

defined( 'ABSPATH' ) || exit;

/**
 * Specs data source poller class.
 * This handles polling specs from JSON endpoints, and
 * stores the specs in to the database as an option.
 */
class DataSourcePoller {
	const DATA_SOURCES = array(
		'https://woocommerce.com/wp-json/wccom/inbox-notifications/1.0/notifications.json',
	);

	/**
	 * The logger instance.
	 *
	 * @var WC_Logger|null
	 */
	protected static $logger = null;

	/**
	 * Get the logger instance.
	 *
	 * @return WC_Logger
	 */
	private static function get_logger() {
		if ( is_null( self::$logger ) ) {
			self::$logger = wc_get_logger();
		}

		return self::$logger;
	}

	/**
	 * Reads the data sources for specs and persists those specs.
	 *
	 * @return bool Whether any specs were read.
	 */
	public static function read_specs_from_data_sources() {
		$specs        = array();
		$data_sources = apply_filters( 'woocommerce_admin_remote_inbox_data_sources', self::DATA_SOURCES );

		// Note that this merges the specs from the data sources based on the
		// slug - last one wins.
		foreach ( $data_sources as $url ) {
			$specs_from_data_source = self::read_data_source( $url, $specs );
			self::merge_specs( $specs_from_data_source, $specs, $url );
		}

		// Persist the specs as an option.
		update_option(
			RemoteInboxNotificationsEngine::SPECS_OPTION_NAME,
			$specs,
			false
		);

		return 0 !== count( $specs );
	}

	/**
	 * Read a single data source and return the read specs
	 *
	 * @param string $url The URL to read the specs from.
	 *
	 * @return array The specs that have been read from the data source.
	 */
	private static function read_data_source( $url ) {
		$logger_context = array( 'source' => $url );
		$logger         = self::get_logger();
		$response       = wp_remote_get( $url );

		if ( is_wp_error( $response ) || ! isset( $response['body'] ) ) {
			$logger->error(
				'Error getting remote inbox notification data feed',
				$logger_context
			);
			// phpcs:ignore
			$logger->error( print_r( $response, true ), $logger_context );

			return [];
		}

		$body  = $response['body'];
		$specs = json_decode( $body );

		if ( null === $specs ) {
			$logger->error(
				'Empty response in remote inbox notification data feed',
				$logger_context
			);

			return [];
		}

		if ( ! is_array( $specs ) ) {
			$logger->error(
				'Remote inbox notification data feed is not an array',
				$logger_context
			);

			return [];
		}

		return $specs;
	}

	/**
	 * Merge the specs.
	 *
	 * @param Array  $specs_to_merge_in The specs to merge in to $specs.
	 * @param Array  $specs             The list of specs being merged into.
	 * @param string $url               The url of the feed being merged in (for error reporting).
	 */
	private static function merge_specs( $specs_to_merge_in, &$specs, $url ) {
		foreach ( $specs_to_merge_in as $spec ) {
			if ( ! self::validate_spec( $spec, $url ) ) {
				continue;
			}

			$slug           = $spec->slug;
			$specs[ $slug ] = $spec;
		}
	}

	/**
	 * Validate the spec.
	 *
	 * @param object $spec The spec to validate.
	 * @param string $url  The url of the feed that provided the spec.
	 *
	 * @return bool The result of the validation.
	 */
	private static function validate_spec( $spec, $url ) {
		$logger         = self::get_logger();
		$logger_context = array( 'source' => $url );

		if ( ! isset( $spec->slug ) ) {
			$logger->error(
				'Spec is invalid because the slug is missing in feed',
				$logger_context
			);
			// phpcs:ignore
			$logger->error( print_r( $spec, true ), $logger_context );

			return false;
		}

		if ( ! isset( $spec->status ) ) {
			$logger->error(
				'Spec is invalid because the status is missing in feed',
				$logger_context
			);
			// phpcs:ignore
			$logger->error( print_r( $spec, true ), $logger_context );

			return false;
		}

		if ( ! isset( $spec->locales ) || ! is_array( $spec->locales ) ) {
			$logger->error(
				'Spec is invalid because the status is missing or empty in feed',
				$logger_context
			);
			// phpcs:ignore
			$logger->error( print_r( $spec, true ), $logger_context );

			return false;
		}

		if ( null === SpecRunner::get_locale( $spec->locales ) ) {
			$logger->error(
				'Spec is invalid because the locale could not be retrieved in feed',
				$logger_context
			);
			// phpcs:ignore
			$logger->error( print_r( $spec, true ), $logger_context );

			return false;
		}

		if ( ! isset( $spec->type ) ) {
			$logger->error(
				'Spec is invalid because the type is missing in feed',
				$logger_context
			);
			// phpcs:ignore
			$logger->error( print_r( $spec, true ), $logger_context );

			return false;
		}

		if ( isset( $spec->actions ) && is_array( $spec->actions ) ) {
			foreach ( $spec->actions as $action ) {
				if ( ! self::validate_action( $action, $url ) ) {
					$logger->error(
						'Spec is invalid because an action is invalid in feed',
						$logger_context
					);
					// phpcs:ignore
					$logger->error( print_r( $spec, true ), $logger_context );

					return false;
				}
			}
		}

		if ( isset( $spec->rules ) && is_array( $spec->rules ) ) {
			foreach ( $spec->rules as $rule ) {
				if ( ! isset( $rule->type ) ) {
					$logger->error(
						'Spec is invalid because a rule type is empty in feed',
						$logger_context
					);
					// phpcs:ignore
					$logger->error( print_r( $rule, true ), $logger_context );
					// phpcs:ignore
					$logger->error( print_r( $spec, true ), $logger_context );

					return false;
				}

				$processor = GetRuleProcessor::get_processor( $rule->type );

				if ( ! $processor->validate( $rule ) ) {
					$logger->error(
						'Spec is invalid because a rule is invalid in feed',
						$logger_context
					);
					// phpcs:ignore
					$logger->error( print_r( $rule, true ), $logger_context );
					// phpcs:ignore
					$logger->error( print_r( $spec, true ), $logger_context );

					return false;
				}
			}
		}

		return true;
	}

	/**
	 * Validate the action.
	 *
	 * @param object $action The action to validate.
	 * @param string $url    The url of the feed containing the action (for error reporting).
	 *
	 * @return bool The result of the validation.
	 */
	private static function validate_action( $action, $url ) {
		$logger         = self::get_logger();
		$logger_context = array( 'source' => $url );

		if ( ! isset( $action->locales ) || ! is_array( $action->locales ) ) {
			$logger->error(
				'Action is invalid because it has empty or missing locales in feed',
				$logger_context
			);
			// phpcs:ignore
			$logger->error( print_r( $action, true ), $logger_context );

			return false;
		}

		if ( null === SpecRunner::get_action_locale( $action->locales ) ) {
			$logger->error(
				'Action is invalid because the locale could not be retrieved in feed',
				$logger_context
			);
			// phpcs:ignore
			$logger->error( print_r( $action, true ), $logger_context );

			return false;
		}

		if ( ! isset( $action->name ) ) {
			$logger->error(
				'Action is invalid because the name is missing in feed',
				$logger_context
			);
			// phpcs:ignore
			$logger->error( print_r( $action, true ), $logger_context );

			return false;
		}

		if ( ! isset( $action->status ) ) {
			$logger->error(
				'Action is invalid because the status is missing in feed',
				$logger_context
			);
			// phpcs:ignore
			$logger->error( print_r( $action, true ), $logger_context );

			return false;
		}

		return true;
	}
}
woocommerce-admin/src/RemoteInboxNotifications/PluginVersionRuleProcessor.php000064400000003377151335517650024017 0ustar00<?php
/**
 * Rule processor for sending when the provided plugin is activated and
 * matches the specified version.
 */

namespace Automattic\WooCommerce\Admin\RemoteInboxNotifications;

defined( 'ABSPATH' ) || exit;

use \Automattic\WooCommerce\Admin\PluginsProvider\PluginsProvider;

/**
 * Rule processor for sending when the provided plugin is activated and
 * matches the specified version.
 */
class PluginVersionRuleProcessor implements RuleProcessorInterface {
	/**
	 * Constructor.
	 *
	 * @param PluginsProviderInterface $plugins_provider The plugins provider.
	 */
	public function __construct( $plugins_provider = null ) {
		$this->plugins_provider = null === $plugins_provider
			? new PluginsProvider()
			: $plugins_provider;
	}

	/**
	 * Process the rule.
	 *
	 * @param object $rule         The specific rule being processed by this rule processor.
	 * @param object $stored_state Stored state.
	 *
	 * @return bool Whether the rule passes or not.
	 */
	public function process( $rule, $stored_state ) {
		$active_plugin_slugs = $this->plugins_provider->get_active_plugin_slugs();

		if ( ! in_array( $rule->plugin, $active_plugin_slugs, true ) ) {
			return false;
		}

		$plugin_data = $this->plugins_provider->get_plugin_data( $rule->plugin );

		if ( ! $plugin_data ) {
			return false;
		}

		$plugin_version = $plugin_data['Version'];

		return version_compare( $plugin_version, $rule->version, $rule->operator );
	}

	/**
	 * Validates the rule.
	 *
	 * @param object $rule The rule to validate.
	 *
	 * @return bool Pass/fail.
	 */
	public function validate( $rule ) {
		if ( ! isset( $rule->plugin ) ) {
			return false;
		}

		if ( ! isset( $rule->version ) ) {
			return false;
		}

		if ( ! isset( $rule->operator ) ) {
			return false;
		}

		return true;
	}
}
woocommerce-admin/src/RemoteInboxNotifications/EvaluationLogger.php000064400000003360151335517650021722 0ustar00<?php

namespace Automattic\WooCommerce\Admin\RemoteInboxNotifications;

/**
 * Class EvaluationLogger
 *
 * @package Automattic\WooCommerce\Admin\RemoteInboxNotifications
 */
class EvaluationLogger {
	/**
	 * Slug of the spec.
	 *
	 * @var string
	 */
	private $slug;

	/**
	 * Results of rules in the given spec.
	 *
	 * @var array
	 */
	private $results = array();

	/**
	 * Logger class to use.
	 *
	 * @var WC_Logger_Interface|null
	 */
	private $logger;

	/**
	 * Logger source.
	 *
	 * @var string logger source.
	 */
	private $source = '';

	/**
	 * EvaluationLogger constructor.
	 *
	 * @param string               $slug Slug of a spec that is being evaluated.
	 * @param null                 $source Logger source.
	 * @param \WC_Logger_Interface $logger Logger class to use.
	 */
	public function __construct( $slug, $source = null, \WC_Logger_Interface $logger = null ) {
		$this->slug = $slug;
		if ( null === $logger ) {
			$logger = wc_get_logger();
		}

		if ( $source ) {
			$this->source = $source;
		}

		$this->logger = $logger;
	}

	/**
	 * Add evaluation result of a rule.
	 *
	 * @param string  $rule_type name of the rule being tested.
	 * @param boolean $result result of a given rule.
	 */
	public function add_result( $rule_type, $result ) {
		array_push(
			$this->results,
			array(
				'rule'   => $rule_type,
				'result' => $result ? 'passed' : 'failed',
			)
		);
	}

	/**
	 * Log the results.
	 */
	public function log() {
		if ( false === defined( 'WC_ADMIN_DEBUG_RULE_EVALUATOR' ) || true !== constant( 'WC_ADMIN_DEBUG_RULE_EVALUATOR' ) ) {
			return;
		}

		foreach ( $this->results as $result ) {
			$this->logger->debug(
				"[{$this->slug}] {$result['rule']}: {$result['result']}",
				array( 'source' => $this->source )
			);
		}
	}
}
woocommerce-admin/src/RemoteInboxNotifications/StoredStateSetupForProducts.php000064400000007077151335517650024141 0ustar00<?php
/**
 * Handles stored state setup for products.
 */

namespace Automattic\WooCommerce\Admin\RemoteInboxNotifications;

defined( 'ABSPATH' ) || exit;

use \Automattic\WooCommerce\Admin\PluginsProvider\PluginsProvider;
use \Automattic\WooCommerce\Admin\RemoteInboxNotifications\SpecRunner;

/**
 * Handles stored state setup for products.
 */
class StoredStateSetupForProducts {
	const ASYNC_RUN_REMOTE_NOTIFICATIONS_ACTION_NAME =
		'woocommerce_admin/stored_state_setup_for_products/async/run_remote_notifications';

	/**
	 * Initialize the class via the admin_init hook.
	 */
	public static function admin_init() {
		add_action( 'product_page_product_importer', array( __CLASS__, 'run_on_product_importer' ) );
		add_action( 'transition_post_status', array( __CLASS__, 'run_on_transition_post_status' ), 10, 3 );
	}

	/**
	 * Initialize the class via the init hook.
	 */
	public static function init() {
		add_action( self::ASYNC_RUN_REMOTE_NOTIFICATIONS_ACTION_NAME, array( __CLASS__, 'run_remote_notifications' ) );
	}

	/**
	 * Run the remote notifications engine. This is triggered by
	 * action-scheduler after a product is added. It also cleans up from
	 * setting the product count increment.
	 */
	public static function run_remote_notifications() {
		RemoteInboxNotificationsEngine::run();
	}

	/**
	 * Set initial stored state values.
	 *
	 * @param object $stored_state The stored state.
	 *
	 * @return object The stored state.
	 */
	public static function init_stored_state( $stored_state ) {
		$stored_state->there_were_no_products = ! self::are_there_products();
		$stored_state->there_are_now_products = ! $stored_state->there_were_no_products;

		return $stored_state;
	}

	/**
	 * Are there products query.
	 *
	 * @return bool
	 */
	private static function are_there_products() {
		$query    = new \WC_Product_Query(
			array(
				'limit'    => 1,
				'paginate' => true,
				'return'   => 'ids',
				'status'   => array( 'publish' ),
			)
		);
		$products = $query->get_products();
		$count    = $products->total;

		return $count > 0;
	}

	/**
	 * Runs on product importer steps.
	 */
	public static function run_on_product_importer() {
		// We're only interested in when the importer completes.
		// phpcs:disable WordPress.Security.NonceVerification.Recommended
		if ( ! isset( $_REQUEST['step'] ) ) {
			return;
		}
		if ( 'done' !== $_REQUEST['step'] ) {
			return;
		}
		// phpcs:enable

		$stored_state                         = RemoteInboxNotificationsEngine::get_stored_state();
		$stored_state->there_are_now_products = true;
		RemoteInboxNotificationsEngine::update_stored_state( $stored_state );

		self::enqueue_async_run_remote_notifications();
	}

	/**
	 * Runs when a post status transitions, but we're only interested if it is
	 * a product being published.
	 *
	 * @param string $new_status The new status.
	 * @param string $old_status The old status.
	 * @param Post   $post       The post.
	 */
	public static function run_on_transition_post_status( $new_status, $old_status, $post ) {
		if (
			'product' !== $post->post_type ||
			'publish' !== $new_status
		) {
			return;
		}

		$stored_state                         = RemoteInboxNotificationsEngine::get_stored_state();
		$stored_state->there_are_now_products = true;

		RemoteInboxNotificationsEngine::update_stored_state( $stored_state );

		self::enqueue_async_run_remote_notifications();
	}

	/**
	 * Enqueues an async action (using action-scheduler) to run remote
	 * notifications.
	 */
	private static function enqueue_async_run_remote_notifications() {
		as_enqueue_async_action( self::ASYNC_RUN_REMOTE_NOTIFICATIONS_ACTION_NAME );
	}
}
woocommerce-admin/src/RemoteInboxNotifications/WooCommerceAdminUpdatedRuleProcessor.php000064400000001561151335517650025703 0ustar00<?php
/**
 * Rule processor for sending when WooCommerce Admin has been updated.
 */

namespace Automattic\WooCommerce\Admin\RemoteInboxNotifications;

defined( 'ABSPATH' ) || exit;

/**
 * Rule processor for sending when WooCommerce Admin has been updated.
 */
class WooCommerceAdminUpdatedRuleProcessor implements RuleProcessorInterface {
	/**
	 * Process the rule.
	 *
	 * @param object $rule         The specific rule being processed by this rule processor.
	 * @param object $stored_state Stored state.
	 *
	 * @return bool Whether the rule passes or not.
	 */
	public function process( $rule, $stored_state ) {
		return get_option( RemoteInboxNotificationsEngine::WCA_UPDATED_OPTION_NAME, false );
	}

	/**
	 * Validates the rule.
	 *
	 * @param object $rule The rule to validate.
	 *
	 * @return bool Pass/fail.
	 */
	public function validate( $rule ) {
		return true;
	}
}
woocommerce-admin/src/RemoteInboxNotifications/WCAdminActiveForProvider.php000064400000000767151335517650023263 0ustar00<?php
/**
 * WCAdmin active for provider.
 */

namespace Automattic\WooCommerce\Admin\RemoteInboxNotifications;

use Automattic\WooCommerce\Admin\WCAdminHelper;

defined( 'ABSPATH' ) || exit;

/**
 * WCAdminActiveForProvider class
 */
class WCAdminActiveForProvider {
	/**
	 * Get the number of seconds that the store has been active.
	 *
	 * @return number Number of seconds.
	 */
	public function get_wcadmin_active_for_in_seconds() {
		return WCAdminHelper::get_wcadmin_active_for_in_seconds();
	}
}
woocommerce-admin/src/RemoteInboxNotifications/Transformers/ArraySearch.php000064400000002306151335517650023343 0ustar00<?php

namespace Automattic\WooCommerce\Admin\RemoteInboxNotifications\Transformers;

use Automattic\WooCommerce\Admin\RemoteInboxNotifications\TransformerInterface;
use InvalidArgumentException;
use stdClass;

/**
 * Searches a given a given value in the array.
 *
 * @package Automattic\WooCommerce\Admin\RemoteInboxNotifications\Transformers
 */
class ArraySearch implements TransformerInterface {
	/**
	 * Search a given value in the array.
	 *
	 * @param mixed         $value a value to transform.
	 * @param stdClass|null $arguments required argument 'value'.
	 * @param string|null   $default default value.
	 *
	 * @throws InvalidArgumentException Throws when the required 'value' is missing.
	 *
	 * @return mixed|null
	 */
	public function transform( $value, stdClass $arguments = null, $default = null ) {
		$key = array_search( $arguments->value, $value, true );
		if ( false !== $key ) {
			return $value[ $key ];
		}

		return null;
	}

	/**
	 * Validate Transformer arguments.
	 *
	 * @param stdClass|null $arguments arguments to validate.
	 *
	 * @return mixed
	 */
	public function validate( stdClass $arguments = null ) {
		if ( ! isset( $arguments->value ) ) {
			return false;
		}

		return true;
	}
}
woocommerce-admin/src/RemoteInboxNotifications/Transformers/ArrayFlatten.php000064400000002000151335517650023522 0ustar00<?php

namespace Automattic\WooCommerce\Admin\RemoteInboxNotifications\Transformers;

use Automattic\WooCommerce\Admin\RemoteInboxNotifications\TransformerInterface;
use stdClass;

/**
 * Flatten nested array.
 *
 * @package Automattic\WooCommerce\Admin\RemoteInboxNotifications\Transformers
 */
class ArrayFlatten implements TransformerInterface {
	/**
	 * Search a given value in the array.
	 *
	 * @param mixed         $value a value to transform.
	 * @param stdClass|null $arguments arguments.
	 * @param string|null   $default default value.
	 *
	 * @return mixed|null
	 */
	public function transform( $value, stdClass $arguments = null, $default = null ) {
		$return = array();
		array_walk_recursive(
			$value,
			function( $item ) use ( &$return ) {
				$return[] = $item;
			}
		);

		return $return;
	}

	/**
	 * Validate Transformer arguments.
	 *
	 * @param stdClass|null $arguments arguments to validate.
	 *
	 * @return mixed
	 */
	public function validate( stdClass $arguments = null ) {
		return true;
	}
}
woocommerce-admin/src/RemoteInboxNotifications/Transformers/DotNotation.php000064400000003545151335517650023407 0ustar00<?php

namespace Automattic\WooCommerce\Admin\RemoteInboxNotifications\Transformers;

use Automattic\WooCommerce\Admin\RemoteInboxNotifications\TransformerInterface;
use InvalidArgumentException;
use stdClass;

/**
 * Find an array value by dot notation.
 *
 * @package Automattic\WooCommerce\Admin\RemoteInboxNotifications\Transformers
 */
class DotNotation implements TransformerInterface {

	/**
	 * Find given path from the given value.
	 *
	 * @param mixed         $value a value to transform.
	 * @param stdClass|null $arguments required argument 'path'.
	 * @param string|null   $default default value.
	 *
	 * @throws InvalidArgumentException Throws when the required 'path' is missing.
	 *
	 * @return mixed
	 */
	public function transform( $value, stdclass $arguments = null, $default = null ) {
		if ( is_object( $value ) ) {
			// if the value is an object, convert it to an array.
			$value = json_decode( wp_json_encode( $value ), true );
		}

		return $this->get( $value, $arguments->path, $default );
	}

	/**
	 * Find the given $path in $array by dot notation.
	 *
	 * @param array  $array an array to search in.
	 * @param string $path a path in the given array.
	 * @param null   $default default value to return if $path was not found.
	 *
	 * @return mixed|null
	 */
	public function get( $array, $path, $default = null ) {
		if ( isset( $array[ $path ] ) ) {
			return $array[ $path ];
		}

		foreach ( explode( '.', $path ) as $segment ) {
			if ( ! is_array( $array ) || ! array_key_exists( $segment, $array ) ) {
				return $default;
			}

			$array = $array[ $segment ];
		}

		return $array;
	}

	/**
	 * Validate Transformer arguments.
	 *
	 * @param stdClass|null $arguments arguments to validate.
	 *
	 * @return mixed
	 */
	public function validate( stdClass $arguments = null ) {
		if ( ! isset( $arguments->path ) ) {
			return false;
		}

		return true;
	}
}
woocommerce-admin/src/RemoteInboxNotifications/Transformers/ArrayColumn.php000064400000002161151335517650023372 0ustar00<?php

namespace Automattic\WooCommerce\Admin\RemoteInboxNotifications\Transformers;

use Automattic\WooCommerce\Admin\RemoteInboxNotifications\TransformerInterface;
use InvalidArgumentException;
use stdClass;

/**
 * Search array value by one of its key.
 *
 * @package Automattic\WooCommerce\Admin\RemoteInboxNotifications\Transformers
 */
class ArrayColumn implements TransformerInterface {
	/**
	 * Search array value by one of its key.
	 *
	 * @param mixed         $value a value to transform.
	 * @param stdClass|null $arguments required arguments 'key'.
	 * @param string|null   $default default value.
	 *
	 * @throws InvalidArgumentException Throws when the required argument 'key' is missing.
	 *
	 * @return mixed
	 */
	public function transform( $value, stdClass $arguments = null, $default = null ) {
		return array_column( $value, $arguments->key );
	}

	/**
	 * Validate Transformer arguments.
	 *
	 * @param stdClass|null $arguments arguments to validate.
	 *
	 * @return mixed
	 */
	public function validate( stdClass $arguments = null ) {
		if ( ! isset( $arguments->key ) ) {
			return false;
		}

		return true;
	}
}
woocommerce-admin/src/RemoteInboxNotifications/Transformers/ArrayKeys.php000064400000001626151335517650023055 0ustar00<?php

namespace Automattic\WooCommerce\Admin\RemoteInboxNotifications\Transformers;

use Automattic\WooCommerce\Admin\RemoteInboxNotifications\TransformerInterface;
use stdClass;

/**
 * Search array value by one of its key.
 *
 * @package Automattic\WooCommerce\Admin\RemoteInboxNotifications\Transformers
 */
class ArrayKeys implements TransformerInterface {
	/**
	 * Search array value by one of its key.
	 *
	 * @param mixed         $value a value to transform.
	 * @param stdClass|null $arguments arguments.
	 * @param string|null   $default default value.
	 *
	 * @return mixed
	 */
	public function transform( $value, stdClass $arguments = null, $default = null ) {
		return array_keys( $value );
	}

	/**
	 * Validate Transformer arguments.
	 *
	 * @param stdClass|null $arguments arguments to validate.
	 *
	 * @return mixed
	 */
	public function validate( stdClass $arguments = null ) {
		return true;
	}
}
woocommerce-admin/src/RemoteInboxNotifications/Transformers/Count.php000064400000001562151335517650022232 0ustar00<?php

namespace Automattic\WooCommerce\Admin\RemoteInboxNotifications\Transformers;

use Automattic\WooCommerce\Admin\RemoteInboxNotifications\TransformerInterface;
use stdClass;

/**
 * Count elements in Array.
 *
 * @package Automattic\WooCommerce\Admin\RemoteInboxNotifications\Transformers
 */
class Count implements TransformerInterface {
	/**
	 *  Count elements in Array.
	 *
	 * @param array         $value an array to count.
	 * @param stdClass|null $arguments arguments.
	 * @param string|null   $default default value.
	 *
	 * @return number
	 */
	public function transform( $value, stdClass $arguments = null, $default = null ) {
		return count( $value );
	}

	/**
	 * Validate Transformer arguments.
	 *
	 * @param stdClass|null $arguments arguments to validate.
	 *
	 * @return mixed
	 */
	public function validate( stdClass $arguments = null ) {
		return true;
	}
}
woocommerce-admin/src/RemoteInboxNotifications/Transformers/ArrayValues.php000064400000001632151335517650023376 0ustar00<?php

namespace Automattic\WooCommerce\Admin\RemoteInboxNotifications\Transformers;

use Automattic\WooCommerce\Admin\RemoteInboxNotifications\TransformerInterface;
use stdClass;

/**
 * Search array value by one of its key.
 *
 * @package Automattic\WooCommerce\Admin\RemoteInboxNotifications\Transformers
 */
class ArrayValues implements TransformerInterface {
	/**
	 * Search array value by one of its key.
	 *
	 * @param mixed         $value a value to transform.
	 * @param stdClass|null $arguments arguments.
	 * @param string|null   $default default value.
	 *
	 * @return mixed
	 */
	public function transform( $value, stdClass $arguments = null, $default = null ) {
		return array_values( $value );
	}

	/**
	 * Validate Transformer arguments.
	 *
	 * @param stdClass|null $arguments arguments to validate.
	 *
	 * @return mixed
	 */
	public function validate( stdClass $arguments = null ) {
		return true;
	}
}
woocommerce-admin/src/RemoteInboxNotifications/ProductCountRuleProcessor.php000064400000002750151335517650023636 0ustar00<?php
/**
 * Rule processor that performs a comparison operation against the number of
 * products.
 */

namespace Automattic\WooCommerce\Admin\RemoteInboxNotifications;

defined( 'ABSPATH' ) || exit;

/**
 * Rule processor that performs a comparison operation against the number of
 * products.
 */
class ProductCountRuleProcessor implements RuleProcessorInterface {
	/**
	 * Constructor.
	 *
	 * @param object $product_query The product query.
	 */
	public function __construct( $product_query = null ) {
		$this->product_query = null === $product_query
			? new \WC_Product_Query(
				array(
					'limit'    => 1,
					'paginate' => true,
					'return'   => 'ids',
					'status'   => array( 'publish' ),
				)
			)
			: $product_query;
	}

	/**
	 * Performs a comparison operation against the number of products.
	 *
	 * @param object $rule         The specific rule being processed by this rule processor.
	 * @param object $stored_state Stored state.
	 *
	 * @return bool The result of the operation.
	 */
	public function process( $rule, $stored_state ) {
		$products = $this->product_query->get_products();

		return ComparisonOperation::compare(
			$products->total,
			$rule->value,
			$rule->operation
		);
	}

	/**
	 * Validates the rule.
	 *
	 * @param object $rule The rule to validate.
	 *
	 * @return bool Pass/fail.
	 */
	public function validate( $rule ) {
		if ( ! isset( $rule->value ) ) {
			return false;
		}

		if ( ! isset( $rule->operation ) ) {
			return false;
		}

		return true;
	}
}
woocommerce-admin/src/RemoteInboxNotifications/ComparisonOperation.php000064400000002205151335517650022443 0ustar00<?php
/**
 * Compare two operands using the specified operation.
 */

namespace Automattic\WooCommerce\Admin\RemoteInboxNotifications;

defined( 'ABSPATH' ) || exit;

/**
 * Compare two operands using the specified operation.
 */
class ComparisonOperation {
	/**
	 * Compare two operands using the specified operation.
	 *
	 * @param object $left_operand  The left hand operand.
	 * @param object $right_operand The right hand operand.
	 * @param string $operation     The operation used to compare the operands.
	 */
	public static function compare( $left_operand, $right_operand, $operation ) {
		switch ( $operation ) {
			case '=':
				return $left_operand === $right_operand;
			case '<':
				return $left_operand < $right_operand;
			case '<=':
				return $left_operand <= $right_operand;
			case '>':
				return $left_operand > $right_operand;
			case '>=':
				return $left_operand >= $right_operand;
			case '!=':
				return $left_operand !== $right_operand;
			case 'contains':
				return in_array( $right_operand, $left_operand, true );
			case '!contains':
				return ! in_array( $right_operand, $left_operand, true );
		}

		return false;
	}
}
woocommerce-admin/src/RemoteInboxNotifications/RemoteInboxNotificationsEngine.php000064400000011616151335517650024571 0ustar00<?php
/**
 * Handles running specs
 */

namespace Automattic\WooCommerce\Admin\RemoteInboxNotifications;

defined( 'ABSPATH' ) || exit;

use \Automattic\WooCommerce\Admin\PluginsProvider\PluginsProvider;
use \Automattic\WooCommerce\Admin\Features\Onboarding;

/**
 * Remote Inbox Notifications engine.
 * This goes through the specs and runs (creates admin notes) for those
 * specs that are able to be triggered.
 */
class RemoteInboxNotificationsEngine {
	const SPECS_OPTION_NAME        = 'wc_remote_inbox_notifications_specs';
	const STORED_STATE_OPTION_NAME = 'wc_remote_inbox_notifications_stored_state';
	const WCA_UPDATED_OPTION_NAME  = 'wc_remote_inbox_notifications_wca_updated';

	/**
	 * Initialize the engine.
	 */
	public static function init() {
		// Init things that need to happen before admin_init.
		add_action( 'init', array( __CLASS__, 'on_init' ), 0, 0 );

		// Continue init via admin_init.
		add_action( 'admin_init', array( __CLASS__, 'on_admin_init' ) );

		// Trigger when the profile data option is updated (during onboarding).
		add_action(
			'update_option_' . Onboarding::PROFILE_DATA_OPTION,
			array( __CLASS__, 'update_profile_option' ),
			10,
			2
		);

		// Hook into WCA updated. This is hooked up here rather than in
		// on_admin_init because that runs too late to hook into the action.
		add_action( 'woocommerce_admin_updated', array( __CLASS__, 'run_on_woocommerce_admin_updated' ) );
	}

	/**
	 * This is triggered when the profile option is updated and if the
	 * profiler is being completed, triggers a run of the engine.
	 *
	 * @param mixed $old_value Old value.
	 * @param mixed $new_value New value.
	 */
	public static function update_profile_option( $old_value, $new_value ) {
		// Return early if we're not completing the profiler.
		if (
			( isset( $old_value['completed'] ) && $old_value['completed'] ) ||
			! isset( $new_value['completed'] ) ||
			! $new_value['completed']
		) {
			return;
		}

		self::run();
	}

	/**
	 * Init is continued via admin_init so that WC is loaded when the product
	 * query is used, otherwise the query generates a "0 = 1" in the WHERE
	 * condition and thus doesn't return any results.
	 */
	public static function on_admin_init() {
		add_action( 'activated_plugin', array( __CLASS__, 'run' ) );
		add_action( 'deactivated_plugin', array( __CLASS__, 'run_on_deactivated_plugin' ), 10, 1 );
		StoredStateSetupForProducts::admin_init();

		// Pre-fetch stored state so it has the correct initial values.
		self::get_stored_state();
	}

	/**
	 * An init hook is used here so that StoredStateSetupForProducts can set
	 * up a hook that gets triggered by action-scheduler - this is needed
	 * because the admin_init hook doesn't get triggered by WP Cron.
	 */
	public static function on_init() {
		StoredStateSetupForProducts::init();
	}

	/**
	 * Go through the specs and run them.
	 */
	public static function run() {
		$specs = get_option( self::SPECS_OPTION_NAME );

		if ( false === $specs || 0 === count( $specs ) ) {
			// We are running too early, need to poll data sources first.
			if ( DataSourcePoller::read_specs_from_data_sources() ) {
				self::run();
			}

			return;
		}

		$stored_state = self::get_stored_state();

		foreach ( $specs as $spec ) {
			SpecRunner::run_spec( $spec, $stored_state );
		}
	}

	/**
	 * Set an option indicating that WooCommerce Admin has just been updated,
	 * run the specs, then clear that option. This lets the
	 * WooCommerceAdminUpdatedRuleProcessor trigger on WCA update.
	 */
	public static function run_on_woocommerce_admin_updated() {
		update_option( self::WCA_UPDATED_OPTION_NAME, true, false );

		self::run();

		update_option( self::WCA_UPDATED_OPTION_NAME, false, false );
	}

	/**
	 * Gets the stored state option, and does the initial set up if it doesn't
	 * already exist.
	 *
	 * @return object The stored state option.
	 */
	public static function get_stored_state() {
		$stored_state = get_option( self::STORED_STATE_OPTION_NAME );

		if ( false === $stored_state ) {
			$stored_state = new \stdClass();

			$stored_state = StoredStateSetupForProducts::init_stored_state(
				$stored_state
			);

			add_option(
				self::STORED_STATE_OPTION_NAME,
				$stored_state,
				'',
				false
			);
		}

		return $stored_state;
	}

	/**
	 * The deactivated_plugin hook happens before the option is updated
	 * (https://github.com/WordPress/WordPress/blob/master/wp-admin/includes/plugin.php#L826)
	 * so this captures the deactivated plugin path and pushes it into the
	 * PluginsProvider.
	 *
	 * @param string $plugin Path to the plugin file relative to the plugins directory.
	 */
	public static function run_on_deactivated_plugin( $plugin ) {
		PluginsProvider::set_deactivated_plugin( $plugin );
		self::run();
	}

	/**
	 * Update the stored state option.
	 *
	 * @param object $stored_state The stored state.
	 */
	public static function update_stored_state( $stored_state ) {
		update_option( self::STORED_STATE_OPTION_NAME, $stored_state, false );
	}
}
woocommerce-admin/src/RemoteInboxNotifications/TransformerService.php000064400000003756151335517650022307 0ustar00<?php

namespace Automattic\WooCommerce\Admin\RemoteInboxNotifications;

use InvalidArgumentException;
use stdClass;

/**
 * A simple service class for the Transformer classes.
 *
 * Class TransformerService
 *
 * @package Automattic\WooCommerce\Admin\RemoteInboxNotifications
 */
class TransformerService {
	/**
	 * Create a transformer object by name.
	 *
	 * @param string $name name of the transformer.
	 *
	 * @return TransformerInterface|null
	 */
	public static function create_transformer( $name ) {
		$camel_cased = str_replace( ' ', '', ucwords( str_replace( '_', ' ', $name ) ) );

		$classname = __NAMESPACE__ . '\\Transformers\\' . $camel_cased;
		if ( ! class_exists( $classname ) ) {
			return null;
		}

		return new $classname();
	}

	/**
	 * Apply transformers to the given value.
	 *
	 * @param mixed  $target_value a value to transform.
	 * @param array  $transformer_configs transform configuration.
	 * @param string $default default value.
	 *
	 * @throws InvalidArgumentException Throws when one of the requried arguments is missing.
	 * @return mixed|null
	 */
	public static function apply( $target_value, array $transformer_configs, $default ) {
		foreach ( $transformer_configs as $transformer_config ) {
			if ( ! isset( $transformer_config->use ) ) {
				throw new InvalidArgumentException( 'Missing required config value: use' );
			}

			if ( ! isset( $transformer_config->arguments ) ) {
				$transformer_config->arguments = null;
			}

			$transformer = self::create_transformer( $transformer_config->use );
			if ( null === $transformer ) {
				throw new InvalidArgumentException( "Unable to find a transformer by name: {$transformer_config->use}" );
			}

			$transformed_value = $transformer->transform( $target_value, $transformer_config->arguments, $default );
			// if the transformer returns null, then return the previously transformed value.
			if ( null === $transformed_value ) {
				return $target_value;
			}

			$target_value = $transformed_value;
		}

		return $target_value;
	}
}
woocommerce-admin/src/RemoteInboxNotifications/IsEcommerceRuleProcessor.php000064400000002161151335517650023374 0ustar00<?php
/**
 * Rule processor that passes (or fails) when the site is on the eCommerce
 * plan.
 *
 * @package WooCommerce\Admin\Classes
 */

namespace Automattic\WooCommerce\Admin\RemoteInboxNotifications;

defined( 'ABSPATH' ) || exit;

/**
 * Rule processor that passes (or fails) when the site is on the eCommerce
 * plan.
 */
class IsEcommerceRuleProcessor implements RuleProcessorInterface {
	/**
	 * Passes (or fails) based on whether the site is on the eCommerce plan or
	 * not.
	 *
	 * @param object $rule         The rule being processed by this rule processor.
	 * @param object $stored_state Stored state.
	 *
	 * @return bool The result of the operation.
	 */
	public function process( $rule, $stored_state ) {
		if ( ! function_exists( 'wc_calypso_bridge_is_ecommerce_plan' ) ) {
			return false === $rule->value;
		}

		return (bool) wc_calypso_bridge_is_ecommerce_plan() === $rule->value;
	}

	/**
	 * Validate the rule.
	 *
	 * @param object $rule The rule to validate.
	 *
	 * @return bool Pass/fail.
	 */
	public function validate( $rule ) {
		if ( ! isset( $rule->value ) ) {
			return false;
		}

		return true;
	}
}
woocommerce-admin/src/RemoteInboxNotifications/StoredStateRuleProcessor.php000064400000002346151335517650023447 0ustar00<?php
/**
 * Rule processor that performs a comparison operation against a value in the
 * stored state object.
 */

namespace Automattic\WooCommerce\Admin\RemoteInboxNotifications;

defined( 'ABSPATH' ) || exit;

/**
 * Rule processor that performs a comparison operation against a value in the
 * stored state object.
 */
class StoredStateRuleProcessor implements RuleProcessorInterface {
	/**
	 * Performs a comparison operation against a value in the stored state object.
	 *
	 * @param object $rule         The rule being processed by this rule processor.
	 * @param object $stored_state Stored state.
	 *
	 * @return bool The result of the operation.
	 */
	public function process( $rule, $stored_state ) {
		if ( ! isset( $stored_state->{$rule->index} ) ) {
			return false;
		}

		return ComparisonOperation::compare(
			$stored_state->{$rule->index},
			$rule->value,
			$rule->operation
		);
	}

	/**
	 * Validates the rule.
	 *
	 * @param object $rule The rule to validate.
	 *
	 * @return bool Pass/fail.
	 */
	public function validate( $rule ) {
		if ( ! isset( $rule->index ) ) {
			return false;
		}

		if ( ! isset( $rule->value ) ) {
			return false;
		}

		if ( ! isset( $rule->operation ) ) {
			return false;
		}

		return true;
	}
}
woocommerce-admin/src/RemoteInboxNotifications/RuleEvaluator.php000064400000004151151335517650021244 0ustar00<?php
/**
 * Evaluate the given rules as an AND operation - return false early if a
 * rule evaluates to false.
 */

namespace Automattic\WooCommerce\Admin\RemoteInboxNotifications;

defined( 'ABSPATH' ) || exit;

/**
 * Evaluate the given rules as an AND operation - return false early if a
 * rule evaluates to false.
 */
class RuleEvaluator {
	/**
	 * Constructor.
	 *
	 * @param GetRuleProcessor $get_rule_processor The GetRuleProcessor to use.
	 */
	public function __construct( $get_rule_processor = null ) {
		$this->get_rule_processor = null === $get_rule_processor
			? new GetRuleProcessor()
			: $get_rule_processor;
	}

	/**
	 * Evaluate the given rules as an AND operation - return false early if a
	 * rule evaluates to false.
	 *
	 * @param array|object $rules The rule or rules being processed.
	 * @param object|null  $stored_state Stored state.
	 * @param array        $logger_args Arguments for the event logger. `slug` is required.
	 *
	 * @throws \InvalidArgumentException Thrown when $logger_args is missing slug.
	 *
	 * @return bool The result of the operation.
	 */
	public function evaluate( $rules, $stored_state = null, $logger_args = array() ) {
		if ( ! is_array( $rules ) ) {
			$rules = array( $rules );
		}

		if ( 0 === count( $rules ) ) {
			return false;
		}

		$evaluation_logger = null;

		if ( count( $logger_args ) ) {
			if ( ! array_key_exists( 'slug', $logger_args ) ) {
				throw new \InvalidArgumentException( 'Missing required field: slug in $logger_args.' );
			}

			array_key_exists( 'source', $logger_args ) ? $source = $logger_args['source'] : $source = null;

			$evaluation_logger = new EvaluationLogger( $logger_args['slug'], $source );
		}

		foreach ( $rules as $rule ) {
			$processor        = $this->get_rule_processor->get_processor( $rule->type );
			$processor_result = $processor->process( $rule, $stored_state );
			$evaluation_logger && $evaluation_logger->add_result( $rule->type, $processor_result );

			if ( ! $processor_result ) {
				$evaluation_logger && $evaluation_logger->log();
				return false;
			}
		}

		$evaluation_logger && $evaluation_logger->log();

		return true;
	}
}
woocommerce-admin/src/RemoteInboxNotifications/OrdersProvider.php000064400000001277151335517650021431 0ustar00<?php
/**
 * Provider for order-related queries and operations.
 */

namespace Automattic\WooCommerce\Admin\RemoteInboxNotifications;

defined( 'ABSPATH' ) || exit;

/**
 * Provider for order-related queries and operations.
 */
class OrdersProvider {
	/**
	 * Allowed order statuses for calculating milestones.
	 *
	 * @var array
	 */
	protected $allowed_statuses = array(
		'pending',
		'processing',
		'completed',
	);

	/**
	 * Returns the number of orders.
	 *
	 * @return integer The number of orders.
	 */
	public function get_order_count() {
		$status_counts = array_map( 'wc_orders_count', $this->allowed_statuses );
		$orders_count  = array_sum( $status_counts );

		return $orders_count;
	}
}
woocommerce-admin/src/RemoteInboxNotifications/PluginsActivatedRuleProcessor.php000064400000002760151335517650024454 0ustar00<?php
/**
 * Rule processor for sending when the provided plugins are activated.
 */

namespace Automattic\WooCommerce\Admin\RemoteInboxNotifications;

defined( 'ABSPATH' ) || exit;

use \Automattic\WooCommerce\Admin\PluginsProvider\PluginsProvider;

/**
 * Rule processor for sending when the provided plugins are activated.
 */
class PluginsActivatedRuleProcessor implements RuleProcessorInterface {
	/**
	 * Constructor.
	 *
	 * @param PluginsProviderInterface $plugins_provider The plugins provider.
	 */
	public function __construct( $plugins_provider = null ) {
		$this->plugins_provider = null === $plugins_provider
			? new PluginsProvider()
			: $plugins_provider;
	}

	/**
	 * Process the rule.
	 *
	 * @param object $rule         The specific rule being processed by this rule processor.
	 * @param object $stored_state Stored state.
	 *
	 * @return bool Whether the rule passes or not.
	 */
	public function process( $rule, $stored_state ) {
		if ( 0 === count( $rule->plugins ) ) {
			return false;
		}

		$active_plugin_slugs = $this->plugins_provider->get_active_plugin_slugs();

		foreach ( $rule->plugins as $plugin_slug ) {
			if ( ! in_array( $plugin_slug, $active_plugin_slugs, true ) ) {
				return false;
			}
		}

		return true;
	}

	/**
	 * Validates the rule.
	 *
	 * @param object $rule The rule to validate.
	 *
	 * @return bool Pass/fail.
	 */
	public function validate( $rule ) {
		if ( ! isset( $rule->plugins ) || ! is_array( $rule->plugins ) ) {
			return false;
		}

		return true;
	}
}
woocommerce-admin/src/RemoteInboxNotifications/BaseLocationStateRuleProcessor.php000064400000002256151335517650024552 0ustar00<?php
/**
 * Rule processor that performs a comparison operation against the base
 * location - state.
 */

namespace Automattic\WooCommerce\Admin\RemoteInboxNotifications;

defined( 'ABSPATH' ) || exit;

/**
 * Rule processor that performs a comparison operation against the base
 * location - state.
 */
class BaseLocationStateRuleProcessor implements RuleProcessorInterface {
	/**
	 * Performs a comparison operation against the base location - state.
	 *
	 * @param object $rule         The specific rule being processed by this rule processor.
	 * @param object $stored_state Stored state.
	 *
	 * @return bool The result of the operation.
	 */
	public function process( $rule, $stored_state ) {
		$base_location = wc_get_base_location();
		if ( ! $base_location ) {
			return false;
		}

		return ComparisonOperation::compare(
			$base_location['state'],
			$rule->value,
			$rule->operation
		);
	}

	/**
	 * Validates the rule.
	 *
	 * @param object $rule The rule to validate.
	 *
	 * @return bool Pass/fail.
	 */
	public function validate( $rule ) {
		if ( ! isset( $rule->value ) ) {
			return false;
		}

		if ( ! isset( $rule->operation ) ) {
			return false;
		}

		return true;
	}
}
woocommerce-admin/src/RemoteInboxNotifications/OptionRuleProcessor.php000064400000004353151335517650022456 0ustar00<?php
/**
 * Rule processor that performs a comparison operation against an option value.
 */

namespace Automattic\WooCommerce\Admin\RemoteInboxNotifications;

defined( 'ABSPATH' ) || exit;

/**
 * Rule processor that performs a comparison operation against an option value.
 */
class OptionRuleProcessor implements RuleProcessorInterface {
	/**
	 * Performs a comparison operation against the option value.
	 *
	 * @param object $rule         The specific rule being processed by this rule processor.
	 * @param object $stored_state Stored state.
	 *
	 * @return bool The result of the operation.
	 */
	public function process( $rule, $stored_state ) {
		$is_contains   = $rule->operation && strpos( $rule->operation, 'contains' ) !== false;
		$default_value = $is_contains ? array() : false;
		$default       = isset( $rule->default ) ? $rule->default : $default_value;
		$option_value  = get_option( $rule->option_name, $default );

		if ( $is_contains && ! is_array( $option_value ) ) {
			$logger = wc_get_logger();
			$logger->warning(
				sprintf(
					'ComparisonOperation "%s" option value "%s" is not an array, defaulting to empty array.',
					$rule->operation,
					$rule->option_name
				),
				array(
					'option_value' => $option_value,
					'rule'         => $rule,
				)
			);
			$option_value = array();
		}

		if ( isset( $rule->transformers ) && is_array( $rule->transformers ) ) {
			$option_value = TransformerService::apply( $option_value, $rule->transformers, $rule->default );
		}

		return ComparisonOperation::compare(
			$option_value,
			$rule->value,
			$rule->operation
		);
	}

	/**
	 * Validates the rule.
	 *
	 * @param object $rule The rule to validate.
	 *
	 * @return bool Pass/fail.
	 */
	public function validate( $rule ) {
		if ( ! isset( $rule->option_name ) ) {
			return false;
		}

		if ( ! isset( $rule->value ) ) {
			return false;
		}

		if ( ! isset( $rule->operation ) ) {
			return false;
		}

		if ( isset( $rule->transformers ) && is_array( $rule->transformers ) ) {
			foreach ( $rule->transformers as $transform_args ) {
				$transformer = TransformerService::create_transformer( $transform_args->use );
				if ( ! $transformer->validate( $transform_args->arguments ) ) {
					return false;
				}
			}
		}

		return true;
	}
}
woocommerce-admin/src/RemoteInboxNotifications/OrRuleProcessor.php000064400000002613151335517650021563 0ustar00<?php
/**
 * Rule processor that performs an OR operation on the rule's left and right
 * operands.
 */

namespace Automattic\WooCommerce\Admin\RemoteInboxNotifications;

defined( 'ABSPATH' ) || exit;

/**
 * Rule processor that performs an OR operation on the rule's left and right
 * operands.
 */
class OrRuleProcessor implements RuleProcessorInterface {
	/**
	 * Constructor.
	 *
	 * @param RuleEvaluator $rule_evaluator The rule evaluator to use.
	 */
	public function __construct( $rule_evaluator = null ) {
		$this->rule_evaluator = null === $rule_evaluator
			? new RuleEvaluator()
			: $rule_evaluator;
	}

	/**
	 * Performs an OR operation on the rule's left and right operands.
	 *
	 * @param object $rule         The specific rule being processed by this rule processor.
	 * @param object $stored_state Stored state.
	 *
	 * @return bool The result of the operation.
	 */
	public function process( $rule, $stored_state ) {
		foreach ( $rule->operands as $operand ) {
			$evaluated_operand = $this->rule_evaluator->evaluate(
				$operand,
				$stored_state
			);

			if ( $evaluated_operand ) {
				return true;
			}
		}

		return false;
	}

	/**
	 * Validates the rule.
	 *
	 * @param object $rule The rule to validate.
	 *
	 * @return bool Pass/fail.
	 */
	public function validate( $rule ) {
		if ( ! isset( $rule->operands ) || ! is_array( $rule->operands ) ) {
			return false;
		}

		return true;
	}
}
woocommerce-admin/src/RemoteInboxNotifications/PublishBeforeTimeRuleProcessor.php000064400000002416151335517650024554 0ustar00<?php
/**
 * Rule processor for sending before a specified date/time.
 */

namespace Automattic\WooCommerce\Admin\RemoteInboxNotifications;

defined( 'ABSPATH' ) || exit;

use \Automattic\WooCommerce\Admin\DateTimeProvider\CurrentDateTimeProvider;

/**
 * Rule processor for sending before a specified date/time.
 */
class PublishBeforeTimeRuleProcessor implements RuleProcessorInterface {
	/**
	 * Constructor.
	 *
	 * @param DateTimeProviderInterface $date_time_provider The DateTime provider.
	 */
	public function __construct( $date_time_provider = null ) {
		$this->date_time_provider = null === $date_time_provider
			? new CurrentDateTimeProvider()
			: $date_time_provider;
	}

	/**
	 * Process the rule.
	 *
	 * @param object $rule         The specific rule being processed by this rule processor.
	 * @param object $stored_state Stored state.
	 *
	 * @return bool Whether the rule passes or not.
	 */
	public function process( $rule, $stored_state ) {
		return $this->date_time_provider->get_now() <= new \DateTime( $rule->publish_before );
	}

	/**
	 * Validates the rule.
	 *
	 * @param object $rule The rule to validate.
	 *
	 * @return bool Pass/fail.
	 */
	public function validate( $rule ) {
		if ( ! isset( $rule->publish_before ) ) {
			return false;
		}

		return true;
	}
}
woocommerce-admin/src/RemoteInboxNotifications/EvaluateAndGetStatus.php000064400000003027151335517650022510 0ustar00<?php
/**
 * Evaluates the spec and returns a status.
 */

namespace Automattic\WooCommerce\Admin\RemoteInboxNotifications;

defined( 'ABSPATH' ) || exit;

use \Automattic\WooCommerce\Admin\Notes\Note;

/**
 * Evaluates the spec and returns a status.
 */
class EvaluateAndGetStatus {
	/**
	 * Evaluates the spec and returns a status.
	 *
	 * @param array  $spec The spec to evaluate.
	 * @param string $current_status The note's current status.
	 * @param object $stored_state Stored state.
	 * @param object $rule_evaluator Evaluates rules into true/false.
	 *
	 * @return string The evaluated status.
	 */
	public static function evaluate( $spec, $current_status, $stored_state, $rule_evaluator ) {
		// No rules should leave the note alone.
		if ( ! isset( $spec->rules ) ) {
			return $current_status;
		}

		$evaluated_result = $rule_evaluator->evaluate(
			$spec->rules,
			$stored_state,
			array(
				'slug'   => $spec->slug,
				'source' => 'remote-inbox-notifications',
			)
		);

		// Pending notes should be the spec status if the spec passes,
		// left alone otherwise.
		if ( Note::E_WC_ADMIN_NOTE_PENDING === $current_status ) {
			return $evaluated_result
				? $spec->status
				: Note::E_WC_ADMIN_NOTE_PENDING;
		}

		// When allow_redisplay isn't set, just leave the note alone.
		if ( ! isset( $spec->allow_redisplay ) || ! $spec->allow_redisplay ) {
			return $current_status;
		}

		// allow_redisplay is set, unaction the note if eval to true.
		return $evaluated_result
			? Note::E_WC_ADMIN_NOTE_UNACTIONED
			: $current_status;
	}
}
woocommerce-admin/src/DateTimeProvider/DateTimeProviderInterface.php000064400000000602151335517650021721 0ustar00<?php
/**
 * Interface for a provider for getting the current DateTime,
 * designed to be mockable for unit tests.
 */

namespace Automattic\WooCommerce\Admin\DateTimeProvider;

defined( 'ABSPATH' ) || exit;

/**
 * DateTime Provider Interface.
 */
interface DateTimeProviderInterface {
	/**
	 * Returns the current DateTime.
	 *
	 * @return DateTime
	 */
	public function get_now();
}
woocommerce-admin/src/DateTimeProvider/CurrentDateTimeProvider.php000064400000000763151335517650021453 0ustar00<?php
/**
 * A provider for getting the current DateTime.
 */

namespace Automattic\WooCommerce\Admin\DateTimeProvider;

defined( 'ABSPATH' ) || exit;

use Automattic\WooCommerce\Admin\DateTimeProvider\DateTimeProviderInterface;

/**
 * Current DateTime Provider.
 *
 * Uses the current DateTime.
 */
class CurrentDateTimeProvider implements DateTimeProviderInterface {
	/**
	 * Returns the current DateTime.
	 *
	 * @return DateTime
	 */
	public function get_now() {
		return new \DateTime();
	}
}
woocommerce-admin/src/PluginsProvider/PluginsProvider.php000064400000003510151335517650017753 0ustar00<?php
/**
 * A provider for getting access to plugin queries.
 */

namespace Automattic\WooCommerce\Admin\PluginsProvider;

defined( 'ABSPATH' ) || exit;

use Automattic\WooCommerce\Admin\PluginsProvider\PluginsProviderInterface;
use Automattic\WooCommerce\Admin\PluginsHelper;

/**
 * Plugins Provider.
 *
 * Uses the live PluginsHelper.
 */
class PluginsProvider implements PluginsProviderInterface {
	/**
	 * The deactivated plugin slug.
	 *
	 * @var string
	 */
	private static $deactivated_plugin_slug = '';

	/**
	 * Get an array of active plugin slugs.
	 *
	 * @return array
	 */
	public function get_active_plugin_slugs() {
		return array_filter(
			PluginsHelper::get_active_plugin_slugs(),
			function( $p ) {
				return $p !== self::$deactivated_plugin_slug;
			}
		);
	}

	/**
	 * Set the deactivated plugin. This is needed because the deactivated_plugin
	 * hook happens before the option is updated which means that getting the
	 * active plugins includes the deactivated plugin.
	 *
	 * @param string $plugin_path The path to the plugin being deactivated.
	 */
	public static function set_deactivated_plugin( $plugin_path ) {
		self::$deactivated_plugin_slug = explode( '/', $plugin_path )[0];
	}

	/**
	 * Get plugin data.
	 *
	 * @param string $plugin Path to the plugin file relative to the plugins directory or the plugin directory name.
	 *
	 * @return array|false
	 */
	public function get_plugin_data( $plugin ) {
		return PluginsHelper::get_plugin_data( $plugin );
	}

	/**
	 * Get the path to the plugin file relative to the plugins directory from the plugin slug.
	 *
	 * E.g. 'woocommerce' returns 'woocommerce/woocommerce.php'
	 *
	 * @param string $slug Plugin slug to get path for.
	 *
	 * @return string|false
	 */
	public function get_plugin_path_from_slug( $slug ) {
		return PluginsHelper::get_plugin_path_from_slug( $slug );
	}
}
woocommerce-admin/src/PluginsProvider/PluginsProviderInterface.php000064400000001650151335517650021577 0ustar00<?php
/**
 * Interface for a provider for getting access to plugin queries,
 * designed to be mockable for unit tests.
 */

namespace Automattic\WooCommerce\Admin\PluginsProvider;

defined( 'ABSPATH' ) || exit;

/**
 * Plugins Provider Interface
 */
interface PluginsProviderInterface {
	/**
	 * Get an array of active plugin slugs.
	 *
	 * @return array
	 */
	public function get_active_plugin_slugs();

	/**
	 * Get plugin data.
	 *
	 * @param string $plugin Path to the plugin file relative to the plugins directory or the plugin directory name.
	 *
	 * @return array|false
	 */
	public function get_plugin_data( $plugin );

	/**
	 * Get the path to the plugin file relative to the plugins directory from the plugin slug.
	 *
	 * E.g. 'woocommerce' returns 'woocommerce/woocommerce.php'
	 *
	 * @param string $slug Plugin slug to get path for.
	 *
	 * @return string|false
	 */
	public function get_plugin_path_from_slug( $slug );
}
woocommerce-admin/src/Events.php000064400000014645151335517650012742 0ustar00<?php
/**
 * Handle cron events.
 * NOTE: DO NOT edit this file in WooCommerce core, this is generated from woocommerce-admin.
 */

namespace Automattic\WooCommerce\Admin;

defined( 'ABSPATH' ) || exit;

use \Automattic\WooCommerce\Admin\Features\Features;
use \Automattic\WooCommerce\Admin\Notes\AddingAndManangingProducts;
use \Automattic\WooCommerce\Admin\Notes\ChooseNiche;
use \Automattic\WooCommerce\Admin\Notes\ChoosingTheme;
use \Automattic\WooCommerce\Admin\Notes\CustomizingProductCatalog;
use Automattic\WooCommerce\Admin\Notes\FirstDownlaodableProduct;
use \Automattic\WooCommerce\Admin\Notes\InsightFirstProductAndPayment;
use \Automattic\WooCommerce\Admin\Notes\MobileApp;
use \Automattic\WooCommerce\Admin\Notes\NewSalesRecord;
use \Automattic\WooCommerce\Admin\Notes\TrackingOptIn;
use \Automattic\WooCommerce\Admin\Notes\OnboardingEmailMarketing;
use \Automattic\WooCommerce\Admin\Notes\OnboardingPayments;
use \Automattic\WooCommerce\Admin\Notes\PersonalizeStore;
use \Automattic\WooCommerce\Admin\Notes\EUVATNumber;
use \Automattic\WooCommerce\Admin\Notes\WooCommercePayments;
use \Automattic\WooCommerce\Admin\Notes\Marketing;
use \Automattic\WooCommerce\Admin\Notes\MarketingJetpack;
use \Automattic\WooCommerce\Admin\Notes\StartDropshippingBusiness;
use \Automattic\WooCommerce\Admin\Notes\WooCommerceSubscriptions;
use \Automattic\WooCommerce\Admin\Notes\MigrateFromShopify;
use \Automattic\WooCommerce\Admin\Notes\LaunchChecklist;
use \Automattic\WooCommerce\Admin\Notes\RealTimeOrderAlerts;
use \Automattic\WooCommerce\Admin\RemoteInboxNotifications\DataSourcePoller;
use \Automattic\WooCommerce\Admin\RemoteInboxNotifications\RemoteInboxNotificationsEngine;
use \Automattic\WooCommerce\Admin\Notes\MerchantEmailNotifications\MerchantEmailNotifications;
use \Automattic\WooCommerce\Admin\Notes\InsightFirstSale;
use \Automattic\WooCommerce\Admin\Notes\NeedSomeInspiration;
use \Automattic\WooCommerce\Admin\Notes\OnlineClothingStore;
use \Automattic\WooCommerce\Admin\Notes\FirstProduct;
use \Automattic\WooCommerce\Admin\Notes\CustomizeStoreWithBlocks;
use \Automattic\WooCommerce\Admin\Notes\TestCheckout;
use \Automattic\WooCommerce\Admin\Notes\EditProductsOnTheMove;
use \Automattic\WooCommerce\Admin\Notes\PerformanceOnMobile;
use \Automattic\WooCommerce\Admin\Notes\ManageOrdersOnTheGo;
use \Automattic\WooCommerce\Admin\Notes\NavigationFeedback;
use \Automattic\WooCommerce\Admin\Notes\NavigationFeedbackFollowUp;
use \Automattic\WooCommerce\Admin\Notes\FilterByProductVariationsInReports;
use \Automattic\WooCommerce\Admin\Notes\AddFirstProduct;
use \Automattic\WooCommerce\Admin\Notes\DrawAttention;
use \Automattic\WooCommerce\Admin\Notes\GettingStartedInEcommerceWebinar;
use \Automattic\WooCommerce\Admin\Notes\NavigationNudge;
use Automattic\WooCommerce\Admin\Schedulers\MailchimpScheduler;

/**
 * Events Class.
 */
class Events {
	/**
	 * The single instance of the class.
	 *
	 * @var object
	 */
	protected static $instance = null;

	/**
	 * Constructor
	 *
	 * @return void
	 */
	protected function __construct() {}

	/**
	 * Get class instance.
	 *
	 * @return object Instance.
	 */
	final public static function instance() {
		if ( null === static::$instance ) {
			static::$instance = new static();
		}
		return static::$instance;
	}

	/**
	 * Cron event handlers.
	 */
	public function init() {
		add_action( 'wc_admin_daily', array( $this, 'do_wc_admin_daily' ) );
	}

	/**
	 * Daily events to run.
	 *
	 * Note: Order_Milestones::other_milestones is hooked to this as well.
	 */
	public function do_wc_admin_daily() {
		$this->possibly_add_notes();

		if ( $this->is_remote_inbox_notifications_enabled() ) {
			DataSourcePoller::read_specs_from_data_sources();
			RemoteInboxNotificationsEngine::run();
		}

		if ( $this->is_merchant_email_notifications_enabled() ) {
			MerchantEmailNotifications::run();
		}

		if ( Features::is_enabled( 'onboarding' ) ) {
			( new MailchimpScheduler() )->run();
		}
	}

	/**
	 * Adds notes that should be added.
	 */
	protected function possibly_add_notes() {
		NewSalesRecord::possibly_add_note();
		MobileApp::possibly_add_note();
		TrackingOptIn::possibly_add_note();
		OnboardingPayments::possibly_add_note();
		PersonalizeStore::possibly_add_note();
		WooCommercePayments::possibly_add_note();
		EUVATNumber::possibly_add_note();
		Marketing::possibly_add_note();
		MarketingJetpack::possibly_add_note();
		StartDropshippingBusiness::possibly_add_note();
		WooCommerceSubscriptions::possibly_add_note();
		MigrateFromShopify::possibly_add_note();
		InsightFirstSale::possibly_add_note();
		LaunchChecklist::possibly_add_note();
		NeedSomeInspiration::possibly_add_note();
		OnlineClothingStore::possibly_add_note();
		FirstProduct::possibly_add_note();
		ChooseNiche::possibly_add_note();
		RealTimeOrderAlerts::possibly_add_note();
		CustomizeStoreWithBlocks::possibly_add_note();
		TestCheckout::possibly_add_note();
		EditProductsOnTheMove::possibly_add_note();
		PerformanceOnMobile::possibly_add_note();
		ManageOrdersOnTheGo::possibly_add_note();
		NavigationFeedback::possibly_add_note();
		NavigationFeedbackFollowUp::possibly_add_note();
		FilterByProductVariationsInReports::possibly_add_note();
		DrawAttention::possibly_add_note();
		ChoosingTheme::possibly_add_note();
		InsightFirstProductAndPayment::possibly_add_note();
		AddFirstProduct::possibly_add_note();
		AddingAndManangingProducts::possibly_add_note();
		CustomizingProductCatalog::possibly_add_note();
		GettingStartedInEcommerceWebinar::possibly_add_note();
		FirstDownlaodableProduct::possibly_add_note();
		NavigationNudge::possibly_add_note();
	}

	/**
	 * Checks if remote inbox notifications are enabled.
	 *
	 * @return bool Whether remote inbox notifications are enabled.
	 */
	protected function is_remote_inbox_notifications_enabled() {
		// Check if the feature flag is disabled.
		if ( ! Features::is_enabled( 'remote-inbox-notifications' ) ) {
			return false;
		}

		// Check if the site has opted out of marketplace suggestions.
		if ( 'yes' !== get_option( 'woocommerce_show_marketplace_suggestions', 'yes' ) ) {
			return false;
		}

		// All checks have passed.
		return true;
	}

	/**
	 * Checks if merchant email notifications are enabled.
	 *
	 * @return bool Whether merchant email notifications are enabled.
	 */
	protected function is_merchant_email_notifications_enabled() {
		// Check if the feature flag is disabled.
		if ( 'yes' !== get_option( 'woocommerce_merchant_email_notifications', 'no' ) ) {
			return false;
		}

		// All checks have passed.
		return true;
	}
}
woocommerce-admin/src/ReportCSVExporter.php000064400000022773151335517650015057 0ustar00<?php
/**
 * Handles reports CSV export batches.
 */

namespace Automattic\WooCommerce\Admin;

if ( ! defined( 'ABSPATH' ) ) {
	exit;
}

use \Automattic\WooCommerce\Admin\API\Reports\ExportableInterface;

/**
 * Include dependencies.
 */
if ( ! class_exists( 'WC_CSV_Batch_Exporter', false ) ) {
	include_once WC_ABSPATH . 'includes/export/abstract-wc-csv-batch-exporter.php';
}

/**
 * ReportCSVExporter Class.
 */
class ReportCSVExporter extends \WC_CSV_Batch_Exporter {
	/**
	 * Type of report being exported.
	 *
	 * @var string
	 */
	protected $report_type;

	/**
	 * Parameters for the report query.
	 *
	 * @var array
	 */
	protected $report_args;

	/**
	 * REST controller for the report.
	 *
	 * @var WC_REST_Reports_Controller
	 */
	protected $controller;

	/**
	 * Constructor.
	 *
	 * @param string $type Report type. E.g. 'customers'.
	 * @param array  $args Report parameters.
	 */
	public function __construct( $type = false, $args = array() ) {
		parent::__construct();

		self::maybe_create_directory();

		if ( ! empty( $type ) ) {
			$this->set_report_type( $type );
			$this->set_column_names( $this->get_report_columns() );
		}

		if ( ! empty( $args ) ) {
			$this->set_report_args( $args );
		}
	}

	/**
	 * Create the directory for reports if it does not yet exist.
	 */
	public static function maybe_create_directory() {
		$reports_dir = self::get_reports_directory();

		$files = array(
			array(
				'base'    => $reports_dir,
				'file'    => '.htaccess',
				'content' => 'DirectoryIndex index.php index.html' . PHP_EOL . 'deny from all',
			),
			array(
				'base'    => $reports_dir,
				'file'    => 'index.html',
				'content' => '',
			),
		);

		foreach ( $files as $file ) {
			if ( ! file_exists( trailingslashit( $file['base'] ) ) ) {
				wp_mkdir_p( $file['base'] );
			}
			if ( ! file_exists( trailingslashit( $file['base'] ) . $file['file'] ) ) {
				$file_handle = @fopen( trailingslashit( $file['base'] ) . $file['file'], 'wb' ); // phpcs:ignore WordPress.PHP.NoSilencedErrors.Discouraged, WordPress.WP.AlternativeFunctions.file_system_read_fopen
				if ( $file_handle ) {
					fwrite( $file_handle, $file['content'] ); // phpcs:ignore WordPress.WP.AlternativeFunctions.file_system_read_fwrite
					fclose( $file_handle ); // phpcs:ignore WordPress.WP.AlternativeFunctions.file_system_read_fclose
				}
			}
		}
	}

	/**
	 * Get report uploads directory.
	 *
	 * @return string
	 */
	public static function get_reports_directory() {
		$upload_dir = wp_upload_dir();
		return trailingslashit( $upload_dir['basedir'] ) . 'woocommerce_uploads/reports/';
	}

	/**
	 * Get file path to export to.
	 *
	 * @return string
	 */
	protected function get_file_path() {
		return self::get_reports_directory() . $this->get_filename();
	}


	/**
	 * Setter for report type.
	 *
	 * @param string $type The report type. E.g. customers.
	 */
	public function set_report_type( $type ) {
		$this->report_type = $type;
		$this->export_type = "admin_{$type}_report";
		$this->filename    = "wc-{$type}-report-export";
		$this->controller  = $this->map_report_controller();
	}

	/**
	 * Setter for report args.
	 *
	 * @param array $args The report args.
	 */
	public function set_report_args( $args ) {
		// Use our own internal limit and include all extended info.
		$report_args = array_merge(
			$args,
			array(
				'per_page'      => $this->get_limit(),
				'extended_info' => true,
			)
		);

		// Should this happen externally?
		if ( isset( $report_args['page'] ) ) {
			$this->set_page( $report_args['page'] );
		}

		$this->report_args = $report_args;
	}

	/**
	 * Get a REST controller instance for the report type.
	 *
	 * @return bool|WC_REST_Reports_Controller Report controller instance or boolean false on error.
	 */
	protected function map_report_controller() {
		// @todo - Add filter to this list.
		$controller_map = array(
			'products'   => 'Automattic\WooCommerce\Admin\API\Reports\Products\Controller',
			'variations' => 'Automattic\WooCommerce\Admin\API\Reports\Variations\Controller',
			'orders'     => 'Automattic\WooCommerce\Admin\API\Reports\Orders\Controller',
			'categories' => 'Automattic\WooCommerce\Admin\API\Reports\Categories\Controller',
			'taxes'      => 'Automattic\WooCommerce\Admin\API\Reports\Taxes\Controller',
			'coupons'    => 'Automattic\WooCommerce\Admin\API\Reports\Coupons\Controller',
			'stock'      => 'Automattic\WooCommerce\Admin\API\Reports\Stock\Controller',
			'downloads'  => 'Automattic\WooCommerce\Admin\API\Reports\Downloads\Controller',
			'customers'  => 'Automattic\WooCommerce\Admin\API\Reports\Customers\Controller',
			'revenue'    => 'Automattic\WooCommerce\Admin\API\Reports\Revenue\Stats\Controller',
		);

		if ( isset( $controller_map[ $this->report_type ] ) ) {
			// Load the controllers if accessing outside the REST API.
			return new $controller_map[ $this->report_type ]();
		}

		// Should this do something else?
		return false;
	}

	/**
	 * Get the report columns from the controller.
	 *
	 * @return array Array of report column names.
	 */
	protected function get_report_columns() {
		// Default to the report's defined export columns.
		if ( $this->controller instanceof ExportableInterface ) {
			return $this->controller->get_export_columns();
		}

		// Fallback to generating columns from the report schema.
		$report_columns = array();
		$report_schema  = $this->controller->get_item_schema();

		if ( isset( $report_schema['properties'] ) ) {
			foreach ( $report_schema['properties'] as $column_name => $column_info ) {
				// Expand extended info columns into export.
				if ( 'extended_info' === $column_name ) {
					// Remove columns with questionable CSV values, like markup.
					$extended_info  = array_diff( array_keys( $column_info ), array( 'image' ) );
					$report_columns = array_merge( $report_columns, $extended_info );
				} else {
					$report_columns[] = $column_name;
				}
			}
		}

		return $report_columns;
	}

	/**
	 * Get total % complete.
	 *
	 * Forces an int from parent::get_percent_complete(), which can return a float.
	 *
	 * @return int Percent complete.
	 */
	public function get_percent_complete() {
		return intval( parent::get_percent_complete() );
	}

	/**
	 * Get total number of rows in export.
	 *
	 * @return int Number of rows to export.
	 */
	public function get_total_rows() {
		return $this->total_rows;
	}

	/**
	 * Prepare data for export.
	 */
	public function prepare_data_to_export() {
		$request  = new \WP_REST_Request( 'GET', "/wc-analytics/reports/{$this->report_type}" );
		$params   = $this->controller->get_collection_params();
		$defaults = array();

		foreach ( $params as $arg => $options ) {
			if ( isset( $options['default'] ) ) {
				$defaults[ $arg ] = $options['default'];
			}
		}

		$request->set_attributes( array( 'args' => $params ) );
		$request->set_default_params( $defaults );
		$request->set_query_params( $this->report_args );
		$request->sanitize_params();

		// Does the controller have an export-specific item retrieval method?
		// @todo - Potentially revisit. This is only for /revenue/stats/.
		if ( is_callable( array( $this->controller, 'get_export_items' ) ) ) {
			$response = $this->controller->get_export_items( $request );
		} else {
			$response = $this->controller->get_items( $request );
		}

		// Use WP_REST_Server::response_to_data() to embed links in data.
		add_filter( 'woocommerce_rest_check_permissions', '__return_true' );
		$rest_server = rest_get_server();
		$report_data = $rest_server->response_to_data( $response, true );
		remove_filter( 'woocommerce_rest_check_permissions', '__return_true' );

		$report_meta      = $response->get_headers();
		$this->total_rows = $report_meta['X-WP-Total'];
		$this->row_data   = array_map( array( $this, 'generate_row_data' ), $report_data );
	}

	/**
	 * Generate row data from a raw report item.
	 *
	 * @param object $item Report item data.
	 * @return array CSV row data.
	 */
	protected function get_raw_row_data( $item ) {
		$columns = $this->get_column_names();
		$row     = array();

		// Expand extended info.
		if ( isset( $item['extended_info'] ) ) {
			// Pull extended info property from report item object.
			$extended_info = (array) $item['extended_info'];
			unset( $item['extended_info'] );

			// Merge extended info columns into report item object.
			$item = array_merge( $item, $extended_info );
		}

		foreach ( $columns as $column_id => $column_name ) {
			$value = isset( $item[ $column_name ] ) ? $item[ $column_name ] : null;

			if ( has_filter( "woocommerce_export_{$this->export_type}_column_{$column_name}" ) ) {
				// Filter for 3rd parties.
				$value = apply_filters( "woocommerce_export_{$this->export_type}_column_{$column_name}", '', $item );

			} elseif ( is_callable( array( $this, "get_column_value_{$column_name}" ) ) ) {
				// Handle special columns which don't map 1:1 to item data.
				$value = $this->{"get_column_value_{$column_name}"}( $item, $this->export_type );

			} elseif ( ! is_scalar( $value ) ) {
				// Ensure that the value is somewhat readable in CSV.
				$value = wp_json_encode( $value );
			}

			$row[ $column_id ] = $value;
		}

		return $row;
	}

	/**
	 * Get the export row for a given report item.
	 *
	 * @param object $item Report item data.
	 * @return array CSV row data.
	 */
	protected function generate_row_data( $item ) {
		// Default to the report's export method.
		if ( $this->controller instanceof ExportableInterface ) {
			$row = $this->controller->prepare_item_for_export( $item );
		} else {
			// Fallback to raw report data.
			$row = $this->get_raw_row_data( $item );
		}

		return apply_filters( "woocommerce_export_{$this->export_type}_row_data", $row, $item );
	}
}
woocommerce-admin/src/PageController.php000064400000034270151335517650014412 0ustar00<?php
/**
 * PageController
 */

namespace Automattic\WooCommerce\Admin;

use Automattic\WooCommerce\Admin\Loader;

defined( 'ABSPATH' ) || exit;

/**
 * PageController
 */
class PageController {
	// JS-powered page root.
	const PAGE_ROOT = 'wc-admin';

	/**
	 * Singleton instance of self.
	 *
	 * @var PageController
	 */
	private static $instance = false;

	/**
	 * Current page ID (or false if not registered with this controller).
	 *
	 * @var string
	 */
	private $current_page = null;

	/**
	 * Registered pages
	 * Contains information (breadcrumbs, menu info) about JS powered pages and classic WooCommerce pages.
	 *
	 * @var array
	 */
	private $pages = array();

	/**
	 * We want a single instance of this class so we can accurately track registered menus and pages.
	 */
	public static function get_instance() {
		if ( ! self::$instance ) {
			self::$instance = new self();
		}

		return self::$instance;
	}

	/**
	 * Connect an existing page to wc-admin.
	 *
	 * @param array $options {
	 *   Array describing the page.
	 *
	 *   @type string       id           Id to reference the page.
	 *   @type string|array title        Page title. Used in menus and breadcrumbs.
	 *   @type string|null  parent       Parent ID. Null for new top level page.
	 *   @type string       path         Path for this page. E.g. admin.php?page=wc-settings&tab=checkout
	 *   @type string       capability   Capability needed to access the page.
	 *   @type string       icon         Icon. Dashicons helper class, base64-encoded SVG, or 'none'.
	 *   @type int          position     Menu item position.
	 *   @type boolean      js_page      If this is a JS-powered page.
	 * }
	 */
	public function connect_page( $options ) {
		if ( ! is_array( $options['title'] ) ) {
			$options['title'] = array( $options['title'] );
		}

		/**
		 * Filter the options when connecting or registering a page.
		 *
		 * Use the `js_page` option to determine if registering.
		 *
		 * @param array $options {
		 *   Array describing the page.
		 *
		 *   @type string       id           Id to reference the page.
		 *   @type string|array title        Page title. Used in menus and breadcrumbs.
		 *   @type string|null  parent       Parent ID. Null for new top level page.
		 *   @type string       screen_id    The screen ID that represents the connected page. (Not required for registering).
		 *   @type string       path         Path for this page. E.g. admin.php?page=wc-settings&tab=checkout
		 *   @type string       capability   Capability needed to access the page.
		 *   @type string       icon         Icon. Dashicons helper class, base64-encoded SVG, or 'none'.
		 *   @type int          position     Menu item position.
		 *   @type boolean      js_page      If this is a JS-powered page.
		 * }
		 */
		$options = apply_filters( 'woocommerce_navigation_connect_page_options', $options );

		// @todo check for null ID, or collision.
		$this->pages[ $options['id'] ] = $options;
	}

	/**
	 * Determine the current page ID, if it was registered with this controller.
	 */
	public function determine_current_page() {
		$current_url       = '';
		$current_screen_id = $this->get_current_screen_id();

		if ( isset( $_SERVER['REQUEST_URI'] ) ) {
			$current_url = esc_url_raw( wp_unslash( $_SERVER['REQUEST_URI'] ) );
		}

		$current_query = wp_parse_url( $current_url, PHP_URL_QUERY );
		parse_str( $current_query, $current_pieces );
		$current_path  = empty( $current_pieces['page'] ) ? '' : $current_pieces['page'];
		$current_path .= empty( $current_pieces['path'] ) ? '' : '&path=' . $current_pieces['path'];

		foreach ( $this->pages as $page ) {
			if ( isset( $page['js_page'] ) && $page['js_page'] ) {
				// Check registered admin pages.
				if (
					$page['path'] === $current_path
				) {
					$this->current_page = $page;
					return;
				}
			} else {
				// Check connected admin pages.
				if (
					isset( $page['screen_id'] ) &&
					$page['screen_id'] === $current_screen_id
				) {
					$this->current_page = $page;
					return;
				}
			}
		}
		$this->current_page = false;
	}


	/**
	 * Get breadcrumbs for WooCommerce Admin Page navigation.
	 *
	 * @return array Navigation pieces (breadcrumbs).
	 */
	public function get_breadcrumbs() {
		$current_page = $this->get_current_page();

		// Bail if this isn't a page registered with this controller.
		if ( false === $current_page ) {
			// Filter documentation below.
			return apply_filters( 'woocommerce_navigation_get_breadcrumbs', array( '' ), $current_page );
		}

		if ( 1 === count( $current_page['title'] ) ) {
			$breadcrumbs = $current_page['title'];
		} else {
			// If this page has multiple title pieces, only link the first one.
			$breadcrumbs = array_merge(
				array(
					array( $current_page['path'], reset( $current_page['title'] ) ),
				),
				array_slice( $current_page['title'], 1 )
			);
		}

		if ( isset( $current_page['parent'] ) ) {
			$parent_id = $current_page['parent'];

			while ( $parent_id ) {
				if ( isset( $this->pages[ $parent_id ] ) ) {
					$parent = $this->pages[ $parent_id ];

					if ( 0 === strpos( $parent['path'], self::PAGE_ROOT ) ) {
						$parent['path'] = 'admin.php?page=' . $parent['path'];
					}

					array_unshift( $breadcrumbs, array( $parent['path'], reset( $parent['title'] ) ) );
					$parent_id = isset( $parent['parent'] ) ? $parent['parent'] : false;
				} else {
					$parent_id = false;
				}
			}
		}

		$woocommerce_breadcrumb = array( 'admin.php?page=' . self::PAGE_ROOT, __( 'WooCommerce', 'woocommerce' ) );

		array_unshift( $breadcrumbs, $woocommerce_breadcrumb );

		/**
		 * The navigation breadcrumbs for the current page.
		 *
		 * @param array         $breadcrumbs Navigation pieces (breadcrumbs).
		 * @param array|boolean $current_page The connected page data or false if not identified.
		 */
		return apply_filters( 'woocommerce_navigation_get_breadcrumbs', $breadcrumbs, $current_page );
	}

	/**
	 * Get the current page.
	 *
	 * @return array|boolean Current page or false if not registered with this controller.
	 */
	public function get_current_page() {
		// If 'current_screen' hasn't fired yet, the current page calculation
		// will fail which causes `false` to be returned for all subsquent calls.
		if ( ! did_action( 'current_screen' ) ) {
			_doing_it_wrong( __FUNCTION__, esc_html__( 'Current page retrieval should be called on or after the `current_screen` hook.', 'woocommerce' ), '0.16.0' );
		}

		if ( is_null( $this->current_page ) ) {
			$this->determine_current_page();
		}

		return $this->current_page;
	}


	/**
	 * Returns the current screen ID.
	 *
	 * This is slightly different from WP's get_current_screen, in that it attaches an action,
	 * so certain pages like 'add new' pages can have different breadcrumbs or handling.
	 * It also catches some more unique dynamic pages like taxonomy/attribute management.
	 *
	 * Format:
	 * - {$current_screen->action}-{$current_screen->action}-tab-section
	 * - {$current_screen->action}-{$current_screen->action}-tab
	 * - {$current_screen->action}-{$current_screen->action} if no tab is present
	 * - {$current_screen->action} if no action or tab is present
	 *
	 * @return string Current screen ID.
	 */
	public function get_current_screen_id() {
		$current_screen = get_current_screen();
		if ( ! $current_screen ) {
			// Filter documentation below.
			return apply_filters( 'woocommerce_navigation_current_screen_id', false, $current_screen );
		}

		$screen_pieces = array( $current_screen->id );

		if ( $current_screen->action ) {
			$screen_pieces[] = $current_screen->action;
		}

		if (
			! empty( $current_screen->taxonomy ) &&
			isset( $current_screen->post_type ) &&
			'product' === $current_screen->post_type
		) {
			// Editing a product attribute.
			if ( 0 === strpos( $current_screen->taxonomy, 'pa_' ) ) {
				$screen_pieces = array( 'product_page_product_attribute-edit' );
			}

			// Editing a product taxonomy term.
			if ( ! empty( $_GET['tag_ID'] ) ) {
				$screen_pieces = array( $current_screen->taxonomy );
			}
		}

		// Pages with default tab values.
		$pages_with_tabs = apply_filters(
			'woocommerce_navigation_pages_with_tabs',
			array(
				'wc-reports'  => 'orders',
				'wc-settings' => 'general',
				'wc-status'   => 'status',
				'wc-addons'   => 'browse-extensions',
			)
		);

		// Tabs that have sections as well.
		$wc_emails    = \WC_Emails::instance();
		$wc_email_ids = array_map( 'sanitize_title', array_keys( $wc_emails->get_emails() ) );

		$tabs_with_sections = apply_filters(
			'woocommerce_navigation_page_tab_sections',
			array(
				'products'          => array( '', 'inventory', 'downloadable' ),
				'shipping'          => array( '', 'options', 'classes' ),
				'checkout'          => array( 'bacs', 'cheque', 'cod', 'paypal' ),
				'email'             => $wc_email_ids,
				'advanced'          => array(
					'',
					'keys',
					'webhooks',
					'legacy_api',
					'woocommerce_com',
				),
				'browse-extensions' => array( 'helper' ),
			)
		);

		if ( ! empty( $_GET['page'] ) ) {
			if ( in_array( $_GET['page'], array_keys( $pages_with_tabs ) ) ) { // WPCS: sanitization ok.
				if ( ! empty( $_GET['tab'] ) ) {
					$tab = wc_clean( wp_unslash( $_GET['tab'] ) );
				} else {
					$tab = $pages_with_tabs[ $_GET['page'] ]; // WPCS: sanitization ok.
				}

				$screen_pieces[] = $tab;

				if ( ! empty( $_GET['section'] ) ) {
					if (
						isset( $tabs_with_sections[ $tab ] ) &&
						in_array( $_GET['section'], array_keys( $tabs_with_sections[ $tab ] ) ) // WPCS: sanitization ok.
					) {
						$screen_pieces[] = wc_clean( wp_unslash( $_GET['section'] ) );
					}
				}

				// Editing a shipping zone.
				if ( ( 'shipping' === $tab ) && isset( $_GET['zone_id'] ) ) {
					$screen_pieces[] = 'edit_zone';
				}
			}
		}

		/**
		 * The current screen id.
		 *
		 * Used for identifying pages to render the WooCommerce Admin header.
		 *
		 * @param string|boolean $screen_id The screen id or false if not identified.
		 * @param WP_Screen      $current_screen The current WP_Screen.
		 */
		return apply_filters( 'woocommerce_navigation_current_screen_id', implode( '-', $screen_pieces ), $current_screen );
	}

	/**
	 * Returns the path from an ID.
	 *
	 * @param  string $id  ID to get path for.
	 * @return string Path for the given ID, or the ID on lookup miss.
	 */
	public function get_path_from_id( $id ) {
		if ( isset( $this->pages[ $id ] ) && isset( $this->pages[ $id ]['path'] ) ) {
			return $this->pages[ $id ]['path'];
		}
		return $id;
	}

	/**
	 * Returns true if we are on a page connected to this controller.
	 *
	 * @return boolean
	 */
	public function is_connected_page() {
		$current_page = $this->get_current_page();

		if ( false === $current_page ) {
			$is_connected_page = false;
		} else {
			$is_connected_page = isset( $current_page['js_page'] ) ? ! $current_page['js_page'] : true;
		}

		// Disable embed on the block editor.
		$current_screen = did_action( 'current_screen' ) ? get_current_screen() : false;
		if ( method_exists( $current_screen, 'is_block_editor' ) && $current_screen->is_block_editor() ) {
			$is_connected_page = false;
		}

		/**
		 * Whether or not the current page is an existing page connected to this controller.
		 *
		 * Used to determine if the WooCommerce Admin header should be rendered.
		 *
		 * @param boolean       $is_connected_page True if the current page is connected.
		 * @param array|boolean $current_page The connected page data or false if not identified.
		 */
		return apply_filters( 'woocommerce_navigation_is_connected_page', $is_connected_page, $current_page );
	}

	/**
	 * Returns true if we are on a page registed with this controller.
	 *
	 * @return boolean
	 */
	public function is_registered_page() {
		$current_page = $this->get_current_page();

		if ( false === $current_page ) {
			$is_registered_page = false;
		} else {
			$is_registered_page = isset( $current_page['js_page'] ) && $current_page['js_page'];
		}

		/**
		 * Whether or not the current page was registered with this controller.
		 *
		 * Used to determine if this is a JS-powered WooCommerce Admin page.
		 *
		 * @param boolean       $is_registered_page True if the current page was registered with this controller.
		 * @param array|boolean $current_page The registered page data or false if not identified.
		 */
		return apply_filters( 'woocommerce_navigation_is_registered_page', $is_registered_page, $current_page );
	}

	/**
	 * Adds a JS powered page to wc-admin.
	 *
	 * @param array $options {
	 *   Array describing the page.
	 *
	 *   @type string      id           Id to reference the page.
	 *   @type string      title        Page title. Used in menus and breadcrumbs.
	 *   @type string|null parent       Parent ID. Null for new top level page.
	 *   @type string      path         Path for this page, full path in app context; ex /analytics/report
	 *   @type string      capability   Capability needed to access the page.
	 *   @type string      icon         Icon. Dashicons helper class, base64-encoded SVG, or 'none'.
	 *   @type int         position     Menu item position.
	 *   @type int         order        Navigation item order.
	 * }
	 */
	public function register_page( $options ) {
		$defaults = array(
			'id'         => null,
			'parent'     => null,
			'title'      => '',
			'capability' => 'view_woocommerce_reports',
			'path'       => '',
			'icon'       => '',
			'position'   => null,
			'js_page'    => true,
		);

		$options = wp_parse_args( $options, $defaults );

		if ( 0 !== strpos( $options['path'], self::PAGE_ROOT ) ) {
			$options['path'] = self::PAGE_ROOT . '&path=' . $options['path'];
		}

		if ( is_null( $options['parent'] ) ) {
			add_menu_page(
				$options['title'],
				$options['title'],
				$options['capability'],
				$options['path'],
				array( __CLASS__, 'page_wrapper' ),
				$options['icon'],
				$options['position']
			);
		} else {
			$parent_path = $this->get_path_from_id( $options['parent'] );
			// @todo check for null path.
			add_submenu_page(
				$parent_path,
				$options['title'],
				$options['title'],
				$options['capability'],
				$options['path'],
				array( __CLASS__, 'page_wrapper' )
			);
		}

		$this->connect_page( $options );
	}

	/**
	 * Get registered pages.
	 *
	 * @return array
	 */
	public function get_pages() {
		return $this->pages;
	}

	/**
	 * Set up a div for the app to render into.
	 */
	public static function page_wrapper() {
		Loader::page_wrapper();
	}
}
woocommerce-admin/src/Composer/Package.php000064400000007343151335517650014615 0ustar00<?php
/**
 * Returns information about the package and handles init.
 */

/**
 * This namespace isn't compatible with the PSR-4
 * which ensures that the copy in the standalone plugin will not be autoloaded.
 */
namespace Automattic\WooCommerce\Admin\Composer;

defined( 'ABSPATH' ) || exit;

use Automattic\WooCommerce\Admin\Notes\DeactivatePlugin;
use Automattic\WooCommerce\Admin\Notes\Notes;
use Automattic\WooCommerce\Admin\Notes\NotesUnavailableException;
use Automattic\WooCommerce\Admin\FeaturePlugin;

/**
 * Main package class.
 */
class Package {

	/**
	 * Version.
	 *
	 * @var string
	 */
	const VERSION = '2.8.0';

	/**
	 * Package active.
	 *
	 * @var bool
	 */
	private static $package_active = false;

	/**
	 * Active version
	 *
	 * @var bool
	 */
	private static $active_version = null;

	/**
	 * Init the package.
	 *
	 * Only initialize for WP 5.3 or greater.
	 */
	public static function init() {
		// Avoid double initialization when the feature plugin is in use.
		if ( defined( 'WC_ADMIN_VERSION_NUMBER' ) ) {
			self::$active_version = WC_ADMIN_VERSION_NUMBER;

			// Check version after WooCommerce is initialized.
			add_action( 'woocommerce_init', array( __CLASS__, 'check_outdated_wca_plugin' ) );

			// Register a deactivation hook for the feature plugin.
			register_deactivation_hook( WC_ADMIN_PLUGIN_FILE, array( __CLASS__, 'on_deactivation' ) );

			return;
		}

		$feature_plugin_instance = FeaturePlugin::instance();
		$satisfied_dependencies  = is_callable( array( $feature_plugin_instance, 'has_satisfied_dependencies' ) ) && $feature_plugin_instance->has_satisfied_dependencies();
		if ( ! $satisfied_dependencies ) {
			return;
		}

		// Indicate to the feature plugin that the core package exists.
		if ( ! defined( 'WC_ADMIN_PACKAGE_EXISTS' ) ) {
			define( 'WC_ADMIN_PACKAGE_EXISTS', true );
		}

		self::$package_active = true;
		self::$active_version = self::VERSION;
		$feature_plugin_instance->init();

		// Unhook the custom Action Scheduler data store class in active older versions of WC Admin.
		remove_filter( 'action_scheduler_store_class', array( $feature_plugin_instance, 'replace_actionscheduler_store_class' ) );
	}

	/**
	 * Return the version of the package.
	 *
	 * @return string
	 */
	public static function get_version() {
		return self::VERSION;
	}

	/**
	 * Return the active version of WC Admin.
	 *
	 * @return string
	 */
	public static function get_active_version() {
		return self::$active_version;
	}

	/**
	 * Return whether the package is active.
	 *
	 * @return bool
	 */
	public static function is_package_active() {
		return self::$package_active;
	}

	/**
	 * Return the path to the package.
	 *
	 * @return string
	 */
	public static function get_path() {
		return dirname( __DIR__ );
	}

	/**
	 * Add deactivation hook for versions of the plugin that don't have the deactivation note.
	 */
	public static function on_deactivation() {
		if ( ! self::is_notes_initialized() ) {
			return;
		}

		$update_version = new DeactivatePlugin();
		$update_version::delete_note();
	}

	/**
	 * Checks if embedded WCA version is newer than standalone WCA
	 * and adds/removes DeactivatePlugin note as necessary.
	 */
	public static function check_outdated_wca_plugin() {

		if ( ! self::is_notes_initialized() ) {
			return;
		}

		$update_version = new DeactivatePlugin();

		if ( version_compare( WC_ADMIN_VERSION_NUMBER, self::VERSION, '<' ) ) {
			if ( method_exists( $update_version, 'possibly_add_note' ) ) {
				$update_version::possibly_add_note();
			}
		} else {
			$update_version::delete_note();
		}
	}

	/**
	 * Checks if notes have been initialized.
	 */
	private static function is_notes_initialized() {
		try {
			Notes::load_data_store();
		} catch ( NotesUnavailableException $e ) {
			return false;
		}
		return true;
	}
}
woocommerce-admin/src/WCAdminSharedSettings.php000064400000002764151335517650015627 0ustar00<?php
/**
 * Manages the WC Admin settings that need to be pre-loaded.
 */

namespace Automattic\WooCommerce\Admin;

defined( 'ABSPATH' ) || exit;

/**
 * \Automattic\WooCommerce\Admin\WCAdminSharedSettings class.
 */
class WCAdminSharedSettings {
	/**
	 * Settings prefix used for the window.wcSettings object.
	 *
	 * @var string
	 */
	private $settings_prefix = 'admin';

	/**
	 * Class instance.
	 *
	 * @var WCAdminSharedSettings instance
	 */
	protected static $instance = null;

	/**
	 * Hook into WooCommerce Blocks.
	 */
	protected function __construct() {
		if ( did_action( 'woocommerce_blocks_loaded' ) ) {
			$this->on_woocommerce_blocks_loaded();
		} else {
			add_action( 'woocommerce_blocks_loaded', array( $this, 'on_woocommerce_blocks_loaded' ), 10 );
		}
	}

	/**
	 * Get class instance.
	 *
	 * @return object Instance.
	 */
	public static function get_instance() {
		if ( null === self::$instance ) {
			self::$instance = new self();
		}
		return self::$instance;
	}

	/**
	 * Adds settings to the Blocks AssetDataRegistry when woocommerce_blocks is loaded.
	 *
	 * @return void
	 */
	public function on_woocommerce_blocks_loaded() {
		if ( class_exists( '\Automattic\WooCommerce\Blocks\Assets\AssetDataRegistry' ) ) {
			\Automattic\WooCommerce\Blocks\Package::container()->get( \Automattic\WooCommerce\Blocks\Assets\AssetDataRegistry::class )->add(
				$this->settings_prefix,
				function() {
					return apply_filters( 'woocommerce_admin_shared_settings', array() );
				},
				true
			);
		}
	}
}

woocommerce-admin/src/PluginsHelper.php000064400000006216151335517650014252 0ustar00<?php
/**
 * PluginsHelper
 *
 * Helper class for the site's plugins.
 */

namespace Automattic\WooCommerce\Admin;

defined( 'ABSPATH' ) || exit;

if ( ! function_exists( 'get_plugins' ) ) {
	require_once ABSPATH . 'wp-admin/includes/plugin.php';
}

/**
 * Class PluginsHelper
 */
class PluginsHelper {

	/**
	 * Get the path to the plugin file relative to the plugins directory from the plugin slug.
	 *
	 * E.g. 'woocommerce' returns 'woocommerce/woocommerce.php'
	 *
	 * @param string $slug Plugin slug to get path for.
	 *
	 * @return string|false
	 */
	public static function get_plugin_path_from_slug( $slug ) {
		$plugins = get_plugins();

		if ( strstr( $slug, '/' ) ) {
			// The slug is already a plugin path.
			return $slug;
		}

		foreach ( $plugins as $plugin_path => $data ) {
			$path_parts = explode( '/', $plugin_path );
			if ( $path_parts[0] === $slug ) {
				return $plugin_path;
			}
		}

		return false;
	}

	/**
	 * Get an array of installed plugin slugs.
	 *
	 * @return array
	 */
	public static function get_installed_plugin_slugs() {
		return array_map(
			function( $plugin_path ) {
				$path_parts = explode( '/', $plugin_path );
				return $path_parts[0];
			},
			array_keys( get_plugins() )
		);
	}

	/**
	 * Get an array of installed plugins with their file paths as a key value pair.
	 *
	 * @return array
	 */
	public static function get_installed_plugins_paths() {
		$plugins           = get_plugins();
		$installed_plugins = array();

		foreach ( $plugins as $path => $plugin ) {
			$path_parts                 = explode( '/', $path );
			$slug                       = $path_parts[0];
			$installed_plugins[ $slug ] = $path;
		}

		return $installed_plugins;
	}

	/**
	 * Get an array of active plugin slugs.
	 *
	 * @return array
	 */
	public static function get_active_plugin_slugs() {
		return array_map(
			function( $plugin_path ) {
				$path_parts = explode( '/', $plugin_path );
				return $path_parts[0];
			},
			get_option( 'active_plugins', array() )
		);
	}

	/**
	 * Checks if a plugin is installed.
	 *
	 * @param string $plugin Path to the plugin file relative to the plugins directory or the plugin directory name.
	 *
	 * @return bool
	 */
	public static function is_plugin_installed( $plugin ) {
		$plugin_path = self::get_plugin_path_from_slug( $plugin );
		return $plugin_path ? array_key_exists( $plugin_path, get_plugins() ) : false;
	}

	/**
	 * Checks if a plugin is active.
	 *
	 * @param string $plugin Path to the plugin file relative to the plugins directory or the plugin directory name.
	 *
	 * @return bool
	 */
	public static function is_plugin_active( $plugin ) {
		$plugin_path = self::get_plugin_path_from_slug( $plugin );
		return $plugin_path ? in_array( $plugin_path, get_option( 'active_plugins', array() ), true ) : false;
	}

	/**
	 * Get plugin data.
	 *
	 * @param string $plugin Path to the plugin file relative to the plugins directory or the plugin directory name.
	 *
	 * @return array|false
	 */
	public static function get_plugin_data( $plugin ) {
		$plugin_path = self::get_plugin_path_from_slug( $plugin );
		$plugins     = get_plugins();

		return isset( $plugins[ $plugin_path ] ) ? $plugins[ $plugin_path ] : false;
	}

}
woocommerce-admin/src/Schedulers/MailchimpScheduler.php000064400000005055151335517650017334 0ustar00<?php

namespace Automattic\WooCommerce\Admin\Schedulers;

/**
 * Class MailchimpScheduler
 *
 * @package Automattic\WooCommerce\Admin\Schedulers
 */
class MailchimpScheduler {

	const SUBSCRIBE_ENDPOINT     = 'https://woocommerce.com/wp-json/wccom/v1/subscribe';
	const SUBSCRIBE_ENDPOINT_DEV = 'http://woocommerce.test/wp-json/wccom/v1/subscribe';

	const SUBSCRIBED_OPTION_NAME = 'woocommerce_onboarding_subscribed_to_mailchimp';

	const LOGGER_CONTEXT = 'mailchimp_scheduler';

	/**
	 * The logger instance.
	 *
	 * @var \WC_Logger_Interface|null
	 */
	private $logger;

	/**
	 * MailchimpScheduler constructor.
	 *
	 * @param \WC_Logger_Interface|null $logger Logger instance.
	 */
	public function __construct( \WC_Logger_Interface $logger = null ) {
		if ( null === $logger ) {
			$logger = wc_get_logger();
		}
		$this->logger = $logger;
	}

	/**
	 * Attempt to subscribe store_email to MailChimp.
	 */
	public function run() {
		// Abort if we've already subscribed to MailChimp.
		if ( 'yes' === get_option( self::SUBSCRIBED_OPTION_NAME ) ) {
			return false;
		}

		$profile_data = get_option( 'woocommerce_onboarding_profile' );

		if ( ! isset( $profile_data['is_agree_marketing'] ) || false === $profile_data['is_agree_marketing'] ) {
			return false;
		}

		// Abort if store_email doesn't exist.
		if ( ! isset( $profile_data['store_email'] ) ) {
			return false;
		}

		$response = $this->make_request( $profile_data['store_email'] );

		if ( is_wp_error( $response ) || ! isset( $response['body'] ) ) {
			$this->logger->error(
				'Error getting a response from Mailchimp API.',
				array( 'source' => self::LOGGER_CONTEXT )
			);
			return false;
		} else {
			$body = json_decode( $response['body'] );
			if ( isset( $body->success ) && true === $body->success ) {
				update_option( self::SUBSCRIBED_OPTION_NAME, 'yes' );
				return true;
			} else {
				$this->logger->error(
				// phpcs:ignore
					'Incorrect response from Mailchimp API with: ' . print_r( $body, true ),
					array( 'source' => self::LOGGER_CONTEXT )
				);
				return false;
			}
		}
	}

	/**
	 * Make an HTTP request to the API.
	 *
	 * @param string $store_email Email address to subscribe.
	 *
	 * @return mixed
	 */
	public function make_request( $store_email ) {
		if ( 'development' === constant( 'WP_ENVIRONMENT_TYPE' ) ) {
			$subscribe_endpoint = self::SUBSCRIBE_ENDPOINT_DEV;
		} else {
			$subscribe_endpoint = self::SUBSCRIBE_ENDPOINT;
		}

		return wp_remote_post(
			$subscribe_endpoint,
			array(
				'method' => 'POST',
				'body'   => array(
					'email' => $store_email,
				),
			)
		);
	}
}
woocommerce-admin/src/Schedulers/ImportInterface.php000064400000001241151335517650016656 0ustar00<?php
/**
 * Import related abstract functions.
 */

namespace Automattic\WooCommerce\Admin\Schedulers;

interface ImportInterface {
	/**
	 * Get items based on query and return IDs along with total available.
	 *
	 * @param int      $limit Number of records to retrieve.
	 * @param int      $page  Page number.
	 * @param int|bool $days Number of days prior to current date to limit search results.
	 * @param bool     $skip_existing Skip already imported items.
	 */
	public static function get_items( $limit, $page, $days, $skip_existing );

	/**
	 * Get total number of items already imported.
	 *
	 * @return null
	 */
	public static function get_total_imported();

}
woocommerce-admin/src/Schedulers/CustomersScheduler.php000064400000016350151335517650017415 0ustar00<?php
/**
 * Customer syncing related functions and actions.
 */

namespace Automattic\WooCommerce\Admin\Schedulers;

defined( 'ABSPATH' ) || exit;

use \Automattic\WooCommerce\Admin\API\Reports\Cache as ReportsCache;
use \Automattic\WooCommerce\Admin\API\Reports\Customers\DataStore as CustomersDataStore;
use \Automattic\WooCommerce\Admin\Schedulers\OrdersScheduler;

/**
 * CustomersScheduler Class.
 */
class CustomersScheduler extends ImportScheduler {
	/**
	 * Slug to identify the scheduler.
	 *
	 * @var string
	 */
	public static $name = 'customers';

	/**
	 * Attach customer lookup update hooks.
	 */
	public static function init() {
		add_action( 'woocommerce_new_customer', array( __CLASS__, 'schedule_import' ) );
		add_action( 'woocommerce_update_customer', array( __CLASS__, 'schedule_import' ) );
		add_action( 'updated_user_meta', array( __CLASS__, 'schedule_import_via_last_active' ), 10, 3 );
		add_action( 'woocommerce_privacy_remove_order_personal_data', array( __CLASS__, 'schedule_anonymize' ) );
		add_action( 'delete_user', array( __CLASS__, 'schedule_user_delete' ) );
		add_action( 'remove_user_from_blog', array( __CLASS__, 'schedule_user_delete' ) );

		CustomersDataStore::init();
		parent::init();
	}

	/**
	 * Add customer dependencies.
	 *
	 * @return array
	 */
	public static function get_dependencies() {
		return array(
			'delete_batch_init' => OrdersScheduler::get_action( 'delete_batch_init' ),
			'anonymize'         => self::get_action( 'import' ),
			'delete_user'       => self::get_action( 'import' ),
		);
	}

	/**
	 * Get the customer IDs and total count that need to be synced.
	 *
	 * @param int      $limit Number of records to retrieve.
	 * @param int      $page  Page number.
	 * @param int|bool $days Number of days prior to current date to limit search results.
	 * @param bool     $skip_existing Skip already imported customers.
	 */
	public static function get_items( $limit = 10, $page = 1, $days = false, $skip_existing = false ) {
		$customer_roles = apply_filters( 'woocommerce_analytics_import_customer_roles', array( 'customer' ) );
		$query_args     = array(
			'fields'   => 'ID',
			'orderby'  => 'ID',
			'order'    => 'ASC',
			'number'   => $limit,
			'paged'    => $page,
			'role__in' => $customer_roles,
		);

		if ( is_int( $days ) ) {
			$query_args['date_query'] = array(
				'after' => gmdate( 'Y-m-d 00:00:00', time() - ( DAY_IN_SECONDS * $days ) ),
			);
		}

		if ( $skip_existing ) {
			add_action( 'pre_user_query', array( __CLASS__, 'exclude_existing_customers_from_query' ) );
		}

		$customer_query = new \WP_User_Query( $query_args );

		remove_action( 'pre_user_query', array( __CLASS__, 'exclude_existing_customers_from_query' ) );

		return (object) array(
			'total' => $customer_query->get_total(),
			'ids'   => $customer_query->get_results(),
		);
	}

	/**
	 * Exclude users that already exist in our customer lookup table.
	 *
	 * Meant to be hooked into 'pre_user_query' action.
	 *
	 * @param WP_User_Query $wp_user_query WP_User_Query to modify.
	 */
	public static function exclude_existing_customers_from_query( $wp_user_query ) {
		global $wpdb;

		$wp_user_query->query_where .= " AND NOT EXISTS (
			SELECT ID FROM {$wpdb->prefix}wc_customer_lookup
			WHERE {$wpdb->prefix}wc_customer_lookup.user_id = {$wpdb->users}.ID
		)";
	}

	/**
	 * Get total number of rows imported.
	 *
	 * @return int
	 */
	public static function get_total_imported() {
		global $wpdb;
		return $wpdb->get_var( "SELECT COUNT(*) FROM {$wpdb->prefix}wc_customer_lookup" );
	}

	/**
	 * Get all available scheduling actions.
	 * Used to determine action hook names and clear events.
	 *
	 * @return array
	 */
	public static function get_scheduler_actions() {
		$actions                = parent::get_scheduler_actions();
		$actions['anonymize']   = 'wc-admin_anonymize_' . static::$name;
		$actions['delete_user'] = 'wc-admin_delete_user_' . static::$name;
		return $actions;
	}

	/**
	 * Schedule import.
	 *
	 * @param int $user_id User ID.
	 * @return void
	 */
	public static function schedule_import( $user_id ) {
		self::schedule_action( 'import', array( $user_id ) );
	}

	/**
	 * Schedule an import if the "last active" meta value was changed.
	 * Function expects to be hooked into the `updated_user_meta` action.
	 *
	 * @param int    $meta_id ID of updated metadata entry.
	 * @param int    $user_id ID of the user being updated.
	 * @param string $meta_key Meta key being updated.
	 */
	public static function schedule_import_via_last_active( $meta_id, $user_id, $meta_key ) {
		if ( 'wc_last_active' === $meta_key ) {
			self::schedule_import( $user_id );
		}
	}

	/**
	 * Schedule an action to anonymize a single Order.
	 *
	 * @param WC_Order $order Order object.
	 * @return void
	 */
	public static function schedule_anonymize( $order ) {
		if ( is_a( $order, 'WC_Order' ) ) {
			// Postpone until any pending updates are completed.
			self::schedule_action( 'anonymize', array( $order->get_id() ) );
		}
	}

	/**
	 * Schedule an action to delete a single User.
	 *
	 * @param int $user_id User ID.
	 * @return void
	 */
	public static function schedule_user_delete( $user_id ) {
		if ( (int) $user_id > 0 && ! doing_action( 'wp_uninitialize_site' ) ) {
			// Postpone until any pending updates are completed.
			self::schedule_action( 'delete_user', array( $user_id ) );
		}
	}

	/**
	 * Imports a single customer.
	 *
	 * @param int $user_id User ID.
	 * @return void
	 */
	public static function import( $user_id ) {
		CustomersDataStore::update_registered_customer( $user_id );
	}

	/**
	 * Delete a batch of customers.
	 *
	 * @param int $batch_size Number of items to delete.
	 * @return void
	 */
	public static function delete( $batch_size ) {
		global $wpdb;

		$customer_ids = $wpdb->get_col(
			$wpdb->prepare(
				"SELECT customer_id FROM {$wpdb->prefix}wc_customer_lookup ORDER BY customer_id ASC LIMIT %d",
				$batch_size
			)
		);

		foreach ( $customer_ids as $customer_id ) {
			CustomersDataStore::delete_customer( $customer_id );
		}
	}

	/**
	 * Anonymize the customer data for a single order.
	 *
	 * @param int $order_id Order id.
	 * @return void
	 */
	public static function anonymize( $order_id ) {
		global $wpdb;

		$customer_id = $wpdb->get_var(
			$wpdb->prepare( "SELECT customer_id FROM {$wpdb->prefix}wc_order_stats WHERE order_id = %d", $order_id )
		);

		if ( ! $customer_id ) {
			return;
		}

		// Long form query because $wpdb->update rejects [deleted].
		$deleted_text = __( '[deleted]', 'woocommerce' );
		$updated      = $wpdb->query(
			$wpdb->prepare(
				"UPDATE {$wpdb->prefix}wc_customer_lookup
					SET
						user_id = NULL,
						username = %s,
						first_name = %s,
						last_name = %s,
						email = %s,
						country = '',
						postcode = %s,
						city = %s,
						state = %s
					WHERE
						customer_id = %d",
				array(
					$deleted_text,
					$deleted_text,
					$deleted_text,
					'deleted@site.invalid',
					$deleted_text,
					$deleted_text,
					$deleted_text,
					$customer_id,
				)
			)
		);
		// If the customer row was anonymized, flush the cache.
		if ( $updated ) {
			ReportsCache::invalidate();
		}
	}

	/**
	 * Delete the customer data for a single user.
	 *
	 * @param int $user_id User ID.
	 * @return void
	 */
	public static function delete_user( $user_id ) {
		CustomersDataStore::delete_customer_by_user_id( $user_id );
	}
}
woocommerce-admin/src/Schedulers/OrdersScheduler.php000064400000012772151335517650016673 0ustar00<?php
/**
 * Order syncing related functions and actions.
 */

namespace Automattic\WooCommerce\Admin\Schedulers;

defined( 'ABSPATH' ) || exit;

use \Automattic\WooCommerce\Admin\API\Reports\Coupons\DataStore as CouponsDataStore;
use \Automattic\WooCommerce\Admin\API\Reports\Orders\Stats\DataStore as OrdersStatsDataStore;
use \Automattic\WooCommerce\Admin\API\Reports\Products\DataStore as ProductsDataStore;
use \Automattic\WooCommerce\Admin\API\Reports\Taxes\DataStore as TaxesDataStore;
use \Automattic\WooCommerce\Admin\API\Reports\Customers\DataStore as CustomersDataStore;
use \Automattic\WooCommerce\Admin\API\Reports\Cache as ReportsCache;
use \Automattic\WooCommerce\Admin\Schedulers\CustomersScheduler;

/**
 * OrdersScheduler Class.
 */
class OrdersScheduler extends ImportScheduler {
	/**
	 * Slug to identify the scheduler.
	 *
	 * @var string
	 */
	public static $name = 'orders';

	/**
	 * Attach order lookup update hooks.
	 */
	public static function init() {
		// Activate WC_Order extension.
		\Automattic\WooCommerce\Admin\Overrides\Order::add_filters();
		\Automattic\WooCommerce\Admin\Overrides\OrderRefund::add_filters();

		// Order and refund data must be run on these hooks to ensure meta data is set.
		add_action( 'save_post', array( __CLASS__, 'possibly_schedule_import' ) );
		add_action( 'woocommerce_refund_created', array( __CLASS__, 'possibly_schedule_import' ) );

		OrdersStatsDataStore::init();
		CouponsDataStore::init();
		ProductsDataStore::init();
		TaxesDataStore::init();

		parent::init();
	}

	/**
	 * Add customer dependencies.
	 *
	 * @return array
	 */
	public static function get_dependencies() {
		return array(
			'import_batch_init' => CustomersScheduler::get_action( 'import_batch_init' ),
		);
	}

	/**
	 * Get the order/refund IDs and total count that need to be synced.
	 *
	 * @param int      $limit Number of records to retrieve.
	 * @param int      $page  Page number.
	 * @param int|bool $days Number of days prior to current date to limit search results.
	 * @param bool     $skip_existing Skip already imported orders.
	 */
	public static function get_items( $limit = 10, $page = 1, $days = false, $skip_existing = false ) {
		global $wpdb;
		$where_clause = '';
		$offset       = $page > 1 ? ( $page - 1 ) * $limit : 0;

		if ( is_int( $days ) ) {
			$days_ago      = gmdate( 'Y-m-d 00:00:00', time() - ( DAY_IN_SECONDS * $days ) );
			$where_clause .= " AND post_date_gmt >= '{$days_ago}'";
		}

		if ( $skip_existing ) {
			$where_clause .= " AND NOT EXISTS (
				SELECT 1 FROM {$wpdb->prefix}wc_order_stats
				WHERE {$wpdb->prefix}wc_order_stats.order_id = {$wpdb->posts}.ID
			)";
		}

		$count = $wpdb->get_var(
			"SELECT COUNT(*) FROM {$wpdb->posts}
			WHERE post_type IN ( 'shop_order', 'shop_order_refund' )
			AND post_status NOT IN ( 'wc-auto-draft', 'auto-draft', 'trash' )
			{$where_clause}"
		); // phpcs:ignore unprepared SQL ok.

		$order_ids = absint( $count ) > 0 ? $wpdb->get_col(
			$wpdb->prepare(
				"SELECT ID FROM {$wpdb->posts}
				WHERE post_type IN ( 'shop_order', 'shop_order_refund' )
				AND post_status NOT IN ( 'wc-auto-draft', 'auto-draft', 'trash' )
				{$where_clause}
				ORDER BY post_date_gmt ASC
				LIMIT %d
				OFFSET %d",
				$limit,
				$offset
			)
		) : array(); // phpcs:ignore unprepared SQL ok.

		return (object) array(
			'total' => absint( $count ),
			'ids'   => $order_ids,
		);
	}

	/**
	 * Get total number of rows imported.
	 */
	public static function get_total_imported() {
		global $wpdb;
		return $wpdb->get_var( "SELECT COUNT(*) FROM {$wpdb->prefix}wc_order_stats" );
	}

	/**
	 * Schedule this import if the post is an order or refund.
	 *
	 * @param int $post_id Post ID.
	 */
	public static function possibly_schedule_import( $post_id ) {
		if ( 'shop_order' !== get_post_type( $post_id ) && 'woocommerce_refund_created' !== current_filter() ) {
			return;
		}

		self::schedule_action( 'import', array( $post_id ) );
	}

	/**
	 * Imports a single order or refund to update lookup tables for.
	 * If an error is encountered in one of the updates, a retry action is scheduled.
	 *
	 * @param int $order_id Order or refund ID.
	 * @return void
	 */
	public static function import( $order_id ) {
		$order = wc_get_order( $order_id );

		// If the order isn't found for some reason, skip the sync.
		if ( ! $order ) {
			return;
		}

		$type = $order->get_type();

		// If the order isn't the right type, skip sync.
		if ( 'shop_order' !== $type && 'shop_order_refund' !== $type ) {
			return;
		}

		// If the order has no id or date created, skip sync.
		if ( ! $order->get_id() || ! $order->get_date_created() ) {
			return;
		}

		$results = array(
			OrdersStatsDataStore::sync_order( $order_id ),
			ProductsDataStore::sync_order_products( $order_id ),
			CouponsDataStore::sync_order_coupons( $order_id ),
			TaxesDataStore::sync_order_taxes( $order_id ),
			CustomersDataStore::sync_order_customer( $order_id ),
		);

		if ( 'shop_order' === $type ) {
			$order_refunds = $order->get_refunds();

			foreach ( $order_refunds as $refund ) {
				OrdersStatsDataStore::sync_order( $refund->get_id() );
			}
		}

		ReportsCache::invalidate();
	}

	/**
	 * Delete a batch of orders.
	 *
	 * @param int $batch_size Number of items to delete.
	 * @return void
	 */
	public static function delete( $batch_size ) {
		global $wpdb;

		$order_ids = $wpdb->get_col(
			$wpdb->prepare(
				"SELECT order_id FROM {$wpdb->prefix}wc_order_stats ORDER BY order_id ASC LIMIT %d",
				$batch_size
			)
		);

		foreach ( $order_ids as $order_id ) {
			OrdersStatsDataStore::delete_order( $order_id );
		}
	}
}
woocommerce-admin/src/Schedulers/ImportScheduler.php000064400000011302151335517650016673 0ustar00<?php
/**
 * Import related functions and actions.
 */

namespace Automattic\WooCommerce\Admin\Schedulers;

defined( 'ABSPATH' ) || exit;

use \Automattic\WooCommerce\Admin\API\Reports\Cache as ReportsCache;
use \Automattic\WooCommerce\Admin\Schedulers\SchedulerTraits;

/**
 * ImportScheduler class.
 */
abstract class ImportScheduler implements ImportInterface {
	/**
	 * Import stats option name.
	 */
	const IMPORT_STATS_OPTION = 'woocommerce_admin_import_stats';

	/**
	 * Scheduler traits.
	 */
	use SchedulerTraits {
		get_batch_sizes as get_scheduler_batch_sizes;
	}

	/**
	 * Returns true if an import is in progress.
	 *
	 * @return bool
	 */
	public static function is_importing() {
		$pending_jobs = self::queue()->search(
			array(
				'status'   => 'pending',
				'per_page' => 1,
				'claimed'  => false,
				'search'   => 'import',
				'group'    => self::$group,
			)
		);
		if ( empty( $pending_jobs ) ) {
			$in_progress = self::queue()->search(
				array(
					'status'   => 'in-progress',
					'per_page' => 1,
					'search'   => 'import',
					'group'    => self::$group,
				)
			);
		}

		return ! empty( $pending_jobs ) || ! empty( $in_progress );
	}

	/**
	 * Get batch sizes.
	 *
	 * @retun array
	 */
	public static function get_batch_sizes() {
		return array_merge(
			self::get_scheduler_batch_sizes(),
			array(
				'delete' => 10,
				'import' => 25,
				'queue'  => 100,
			)
		);

	}

	/**
	 * Get all available scheduling actions.
	 * Used to determine action hook names and clear events.
	 *
	 * @return array
	 */
	public static function get_scheduler_actions() {
		return array(
			'import_batch_init' => 'wc-admin_import_batch_init_' . static::$name,
			'import_batch'      => 'wc-admin_import_batch_' . static::$name,
			'delete_batch_init' => 'wc-admin_delete_batch_init_' . static::$name,
			'delete_batch'      => 'wc-admin_delete_batch_' . static::$name,
			'import'            => 'wc-admin_import_' . static::$name,
		);
	}

	/**
	 * Queue the imports into multiple batches.
	 *
	 * @param integer|boolean $days Number of days to import.
	 * @param boolean         $skip_existing Skip exisiting records.
	 */
	public static function import_batch_init( $days, $skip_existing ) {
		$batch_size = static::get_batch_size( 'import' );
		$items      = static::get_items( 1, 1, $days, $skip_existing );

		if ( 0 === $items->total ) {
			return;
		}

		$num_batches = ceil( $items->total / $batch_size );

		self::queue_batches( 1, $num_batches, 'import_batch', array( $days, $skip_existing ) );
	}

	/**
	 * Imports a batch of items to update.
	 *
	 * @param int      $batch_number Batch number to import (essentially a query page number).
	 * @param int|bool $days Number of days to import.
	 * @param bool     $skip_existing Skip exisiting records.
	 * @return void
	 */
	public static function import_batch( $batch_number, $days, $skip_existing ) {
		$batch_size = static::get_batch_size( 'import' );

		$properties = array(
			'batch_number' => $batch_number,
			'batch_size'   => $batch_size,
			'type'         => static::$name,
		);
		wc_admin_record_tracks_event( 'import_job_start', $properties );

		// When we are skipping already imported items, the table of items to import gets smaller in
		// every batch, so we want to always import the first page.
		$page  = $skip_existing ? 1 : $batch_number;
		$items = static::get_items( $batch_size, $page, $days, $skip_existing );

		foreach ( $items->ids as $id ) {
			static::import( $id );
		}

		$import_stats                              = get_option( self::IMPORT_STATS_OPTION, array() );
		$imported_count                            = absint( $import_stats[ static::$name ]['imported'] ) + count( $items->ids );
		$import_stats[ static::$name ]['imported'] = $imported_count;
		update_option( self::IMPORT_STATS_OPTION, $import_stats );

		$properties['imported_count'] = $imported_count;

		wc_admin_record_tracks_event( 'import_job_complete', $properties );
	}

	/**
	 * Queue item deletion in batches.
	 */
	public static function delete_batch_init() {
		global $wpdb;
		$batch_size = static::get_batch_size( 'delete' );
		$count      = static::get_total_imported();

		if ( 0 === $count ) {
			return;
		}

		$num_batches = ceil( $count / $batch_size );

		self::queue_batches( 1, $num_batches, 'delete_batch' );
	}

	/**
	 * Delete a batch by passing the count to be deleted to the child delete method.
	 *
	 * @return void
	 */
	public static function delete_batch() {
		wc_admin_record_tracks_event( 'delete_import_data_job_start', array( 'type' => static::$name ) );

		$batch_size = static::get_batch_size( 'delete' );
		static::delete( $batch_size );

		ReportsCache::invalidate();

		wc_admin_record_tracks_event( 'delete_import_data_job_complete', array( 'type' => static::$name ) );
	}
}
woocommerce-admin/src/Schedulers/SchedulerTraits.php000064400000023360151335517650016676 0ustar00<?php
/**
 * Traits for scheduling actions and dependencies.
 */

namespace Automattic\WooCommerce\Admin\Schedulers;

defined( 'ABSPATH' ) || exit;

/**
 * SchedulerTraits class.
 */
trait SchedulerTraits {
	/**
	 * Action scheduler group.
	 *
	 * @var string|null
	 */
	public static $group = 'wc-admin-data';

	/**
	 * Queue instance.
	 *
	 * @var WC_Queue_Interface
	 */
	protected static $queue = null;

	/**
	 * Add all actions as hooks.
	 */
	public static function init() {
		foreach ( self::get_actions() as $action_name => $action_hook ) {
			$method = new \ReflectionMethod( static::class, $action_name );
			add_action( $action_hook, array( static::class, 'do_action_or_reschedule' ), 10, $method->getNumberOfParameters() );
		}
	}

	/**
	 * Get queue instance.
	 *
	 * @return WC_Queue_Interface
	 */
	public static function queue() {
		if ( is_null( self::$queue ) ) {
			self::$queue = WC()->queue();
		}

		return self::$queue;
	}

	/**
	 * Set queue instance.
	 *
	 * @param WC_Queue_Interface $queue Queue instance.
	 */
	public static function set_queue( $queue ) {
		self::$queue = $queue;
	}

	/**
	 * Gets the default scheduler actions for batching and scheduling actions.
	 */
	public static function get_default_scheduler_actions() {
		return array(
			'schedule_action' => 'wc-admin_schedule_action_' . static::$name,
			'queue_batches'   => 'wc-admin_queue_batches_' . static::$name,
		);
	}

	/**
	 * Gets the actions for this specific scheduler.
	 *
	 * @return array
	 */
	public static function get_scheduler_actions() {
		return array();
	}

	/**
	 * Get all available scheduling actions.
	 * Used to determine action hook names and clear events.
	 */
	public static function get_actions() {
		return array_merge(
			static::get_default_scheduler_actions(),
			static::get_scheduler_actions()
		);
	}

	/**
	 * Get an action tag name from the action name.
	 *
	 * @param string $action_name The action name.
	 * @return string|null
	 */
	public static function get_action( $action_name ) {
		$actions = static::get_actions();
		return isset( $actions[ $action_name ] ) ? $actions[ $action_name ] : null;
	}

	/**
	 * Returns an array of actions and dependencies as key => value pairs.
	 *
	 * @return array
	 */
	public static function get_dependencies() {
		return array();
	}

	/**
	 * Get dependencies associated with an action.
	 *
	 * @param string $action_name The action slug.
	 * @return string|null
	 */
	public static function get_dependency( $action_name ) {
		$dependencies = static::get_dependencies();
		return isset( $dependencies[ $action_name ] ) ? $dependencies[ $action_name ] : null;
	}

	/**
	 * Batch action size.
	 */
	public static function get_batch_sizes() {
		return array(
			'queue_batches' => 100,
		);
	}

	/**
	 * Returns the batch size for an action.
	 *
	 * @param string $action Single batch action name.
	 * @return int Batch size.
	 */
	public static function get_batch_size( $action ) {
		$batch_sizes = static::get_batch_sizes();
		$batch_size  = isset( $batch_sizes[ $action ] ) ? $batch_sizes[ $action ] : 25;

		/**
		 * Filter the batch size for regenerating a report table.
		 *
		 * @param int    $batch_size Batch size.
		 * @param string $action Batch action name.
		 */
		return apply_filters( 'woocommerce_analytics_regenerate_batch_size', $batch_size, static::$name, $action );
	}

	/**
	 * Flatten multidimensional arrays to store for scheduling.
	 *
	 * @param array $args Argument array.
	 * @return string
	 */
	public static function flatten_args( $args ) {
		$flattened = array();

		foreach ( $args as $arg ) {
			if ( is_array( $arg ) ) {
				$flattened[] = self::flatten_args( $arg );
			} else {
				$flattened[] = $arg;
			}
		}

		$string = '[' . implode( ',', $flattened ) . ']';
		return $string;
	}

	/**
	 * Check if existing jobs exist for an action and arguments.
	 *
	 * @param string $action_name Action name.
	 * @param array  $args Array of arguments to pass to action.
	 * @return bool
	 */
	public static function has_existing_jobs( $action_name, $args ) {
		$existing_jobs = self::queue()->search(
			array(
				'status'   => 'pending',
				'per_page' => 1,
				'claimed'  => false,
				'hook'     => static::get_action( $action_name ),
				'search'   => self::flatten_args( $args ),
				'group'    => self::$group,
			)
		);

		if ( $existing_jobs ) {
			$existing_job = current( $existing_jobs );

			// Bail out if there's a pending single action, or a pending scheduled actions.
			if (
				( static::get_action( $action_name ) === $existing_job->get_hook() ) ||
				(
					static::get_action( 'schedule_action' ) === $existing_job->get_hook() &&
					in_array( self::get_action( $action_name ), $existing_job->get_args(), true )
				)
			) {
				return true;
			}
		}

		return false;
	}

	/**
	 * Get the next blocking job for an action.
	 *
	 * @param string $action_name Action name.
	 * @return false|ActionScheduler_Action
	 */
	public static function get_next_blocking_job( $action_name ) {
		$dependency = self::get_dependency( $action_name );

		if ( ! $dependency ) {
			return false;
		}

		$blocking_jobs = self::queue()->search(
			array(
				'status'   => 'pending',
				'orderby'  => 'date',
				'order'    => 'DESC',
				'per_page' => 1,
				'search'   => $dependency, // search is used instead of hook to find queued batch creation.
				'group'    => static::$group,
			)
		);

		$next_job_schedule = null;

		if ( is_array( $blocking_jobs ) ) {
			foreach ( $blocking_jobs as $blocking_job ) {
				$next_job_schedule = self::get_next_action_time( $blocking_job );

				// Ensure that the next schedule is a DateTime (it can be null).
				if ( is_a( $next_job_schedule, 'DateTime' ) ) {
					return $blocking_job;
				}
			}
		}

		return false;
	}

	/**
	 * Check for blocking jobs and reschedule if any exist.
	 */
	public static function do_action_or_reschedule() {
		$action_hook = current_action();
		$action_name = array_search( $action_hook, static::get_actions(), true );
		$args        = func_get_args();

		// Check if any blocking jobs exist and schedule after they've completed
		// or schedule to run now if no blocking jobs exist.
		$blocking_job = static::get_next_blocking_job( $action_name );
		if ( $blocking_job ) {
			$after = new \DateTime();
			self::queue()->schedule_single(
				self::get_next_action_time( $blocking_job )->getTimestamp() + 5,
				$action_hook,
				$args,
				static::$group
			);
		} else {
			call_user_func_array( array( static::class, $action_name ), $args );
		}
	}

	/**
	 * Get the DateTime for the next scheduled time an action should run.
	 * This function allows backwards compatibility with Action Scheduler < v3.0.
	 *
	 * @param \ActionScheduler_Action $action Action.
	 * @return DateTime|null
	 */
	public static function get_next_action_time( $action ) {
		if ( method_exists( $action->get_schedule(), 'get_next' ) ) {
			$after             = new \DateTime();
			$next_job_schedule = $action->get_schedule()->get_next( $after );
		} else {
			$next_job_schedule = $action->get_schedule()->next();
		}

		return $next_job_schedule;
	}

	/**
	 * Schedule an action to run and check for dependencies.
	 *
	 * @param string $action_name Action name.
	 * @param array  $args Array of arguments to pass to action.
	 */
	public static function schedule_action( $action_name, $args = array() ) {
		// Check for existing jobs and bail if they already exist.
		if ( static::has_existing_jobs( $action_name, $args ) ) {
			return;
		}

		$action_hook = static::get_action( $action_name );
		if ( ! $action_hook ) {
			return;
		}

		if (
			// Skip scheduling if Action Scheduler tables have not been initialized.
			! get_option( 'schema-ActionScheduler_StoreSchema' ) ||
			apply_filters( 'woocommerce_analytics_disable_action_scheduling', false )
		) {
			call_user_func_array( array( static::class, $action_name ), $args );
			return;
		}

		self::queue()->schedule_single( time() + 5, $action_hook, $args, static::$group );
	}

	/**
	 * Queue a large number of batch jobs, respecting the batch size limit.
	 * Reduces a range of batches down to "single batch" jobs.
	 *
	 * @param int    $range_start Starting batch number.
	 * @param int    $range_end Ending batch number.
	 * @param string $single_batch_action Action to schedule for a single batch.
	 * @param array  $action_args Action arguments.
	 * @return void
	 */
	public static function queue_batches( $range_start, $range_end, $single_batch_action, $action_args = array() ) {
		$batch_size       = static::get_batch_size( 'queue_batches' );
		$range_size       = 1 + ( $range_end - $range_start );
		$action_timestamp = time() + 5;

		if ( $range_size > $batch_size ) {
			// If the current batch range is larger than a single batch,
			// split the range into $queue_batch_size chunks.
			$chunk_size = (int) ceil( $range_size / $batch_size );

			for ( $i = 0; $i < $batch_size; $i++ ) {
				$batch_start = (int) ( $range_start + ( $i * $chunk_size ) );
				$batch_end   = (int) min( $range_end, $range_start + ( $chunk_size * ( $i + 1 ) ) - 1 );

				if ( $batch_start > $range_end ) {
					return;
				}

				self::schedule_action(
					'queue_batches',
					array( $batch_start, $batch_end, $single_batch_action, $action_args )
				);
			}
		} else {
			// Otherwise, queue the single batches.
			for ( $i = $range_start; $i <= $range_end; $i++ ) {
				$batch_action_args = array_merge( array( $i ), $action_args );
				self::schedule_action( $single_batch_action, $batch_action_args );
			}
		}
	}

	/**
	 * Clears all queued actions.
	 */
	public static function clear_queued_actions() {
		if ( version_compare( \ActionScheduler_Versions::instance()->latest_version(), '3.0', '>=' ) ) {
			\ActionScheduler::store()->cancel_actions_by_group( static::$group );
		} else {
			$actions = static::get_actions();
			foreach ( $actions as $action ) {
				self::queue()->cancel_all( $action, null, static::$group );
			}
		}
	}
}
woocommerce-admin/src/Loader.php000064400000132335151335517650012701 0ustar00<?php
/**
 * Register the scripts, styles, and includes needed for pieces of the WooCommerce Admin experience.
 * NOTE: DO NOT edit this file in WooCommerce core, this is generated from woocommerce-admin.
 */

namespace Automattic\WooCommerce\Admin;

use \_WP_Dependency;
use Automattic\WooCommerce\Admin\API\Reports\Orders\DataStore as OrdersDataStore;
use Automattic\WooCommerce\Admin\API\Plugins;
use Automattic\WooCommerce\Admin\Features\Features;
use Automattic\WooCommerce\Admin\Features\Navigation\Screen;
use WC_Marketplace_Suggestions;

/**
 * Loader Class.
 */
class Loader {
	/**
	 * App entry point.
	 */
	const APP_ENTRY_POINT = 'wc-admin';

	/**
	 * Class instance.
	 *
	 * @var Loader instance
	 */
	protected static $instance = null;

	/**
	 * An array of classes to load from the includes folder.
	 *
	 * @var array
	 */
	protected static $classes = array();

	/**
	 * WordPress capability required to use analytics features.
	 *
	 * @var string
	 */
	protected static $required_capability = null;

	/**
	 * An array of dependencies that have been preloaded (to avoid duplicates).
	 *
	 * @var array
	 */
	protected $preloaded_dependencies = array(
		'script' => array(),
		'style'  => array(),
	);

	/**
	 * Get class instance.
	 */
	public static function get_instance() {
		if ( ! self::$instance ) {
			self::$instance = new self();
		}
		return self::$instance;
	}

	/**
	 * Constructor.
	 * Hooks added here should be removed in `wc_admin_initialize` via the feature plugin.
	 */
	public function __construct() {
		Features::get_instance();
		WCAdminSharedSettings::get_instance();
		add_action( 'init', array( __CLASS__, 'define_tables' ) );
		add_action( 'admin_enqueue_scripts', array( __CLASS__, 'register_scripts' ) );
		add_action( 'admin_enqueue_scripts', array( __CLASS__, 'inject_wc_settings_dependencies' ), 14 );
		add_action( 'admin_enqueue_scripts', array( $this, 'load_scripts' ), 15 );
		// Old settings injection.
		add_filter( 'woocommerce_components_settings', array( __CLASS__, 'add_component_settings' ) );
		// New settings injection.
		add_filter( 'woocommerce_admin_shared_settings', array( __CLASS__, 'add_component_settings' ) );
		add_filter( 'admin_body_class', array( __CLASS__, 'add_admin_body_classes' ) );
		add_action( 'admin_menu', array( __CLASS__, 'register_page_handler' ) );
		add_action( 'admin_menu', array( __CLASS__, 'register_store_details_page' ) );
		add_filter( 'admin_title', array( __CLASS__, 'update_admin_title' ) );
		add_action( 'rest_api_init', array( __CLASS__, 'register_user_data' ) );
		add_action( 'in_admin_header', array( __CLASS__, 'embed_page_header' ) );
		add_filter( 'woocommerce_settings_groups', array( __CLASS__, 'add_settings_group' ) );
		add_filter( 'woocommerce_settings-wc_admin', array( __CLASS__, 'add_settings' ) );
		add_action( 'admin_head', array( __CLASS__, 'remove_notices' ) );
		add_action( 'admin_head', array( __CLASS__, 'smart_app_banner' ) );
		add_action( 'admin_notices', array( __CLASS__, 'inject_before_notices' ), -9999 );
		add_action( 'admin_notices', array( __CLASS__, 'inject_after_notices' ), PHP_INT_MAX );

		// Added this hook to delete the field woocommerce_onboarding_homepage_post_id when deleting the homepage.
		add_action( 'trashed_post', array( __CLASS__, 'delete_homepage' ) );

		// priority is 20 to run after https://github.com/woocommerce/woocommerce/blob/a55ae325306fc2179149ba9b97e66f32f84fdd9c/includes/admin/class-wc-admin-menus.php#L165.
		add_action( 'admin_head', array( __CLASS__, 'remove_app_entry_page_menu_item' ), 20 );

		/*
		* Remove the emoji script as it always defaults to replacing emojis with Twemoji images.
		* Gutenberg has also disabled emojis. More on that here -> https://github.com/WordPress/gutenberg/pull/6151
		*/
		remove_action( 'admin_print_scripts', 'print_emoji_detection_script' );

		// Combine JSON translation files (from chunks) when language packs are updated.
		add_action( 'upgrader_process_complete', array( __CLASS__, 'combine_translation_chunk_files' ), 10, 2 );

		// Handler for WooCommerce and WooCommerce Admin plugin activation.
		add_action( 'woocommerce_activated_plugin', array( __CLASS__, 'activated_plugin' ) );
		add_action( 'activated_plugin', array( __CLASS__, 'activated_plugin' ) );
		add_action( 'admin_init', array( __CLASS__, 'is_using_installed_wc_admin_plugin' ) );
	}

	/**
	 * Verifies which plugin version is being used. If WooCommerce Admin is installed and activated but not in use
	 * it will show a warning.
	 */
	public static function is_using_installed_wc_admin_plugin() {
		if ( PluginsHelper::is_plugin_active( 'woocommerce-admin' ) ) {
			$path = PluginsHelper::get_plugin_data( 'woocommerce-admin' );
			if ( WC_ADMIN_VERSION_NUMBER !== $path['Version'] ) {
				add_action(
					'admin_notices',
					function() {
						echo '<div class="error"><p>';
						printf(
							/* translators: %s: is referring to the plugin's name. */
							esc_html__( 'You have the %s plugin activated but it is not being used.', 'woocommerce' ),
							'<code>WooCommerce Admin</code>'
						);
						echo '</p></div>';
					}
				);
			}
		}
	}

	/**
	 * Run when plugin is activated (can be WooCommerce or WooCommerce Admin).
	 *
	 * @param string $filename Activated plugin filename.
	 */
	public static function activated_plugin( $filename ) {
		$plugin_domain           = explode( '/', plugin_basename( __FILE__ ) )[0];
		$activated_plugin_domain = explode( '/', $filename )[0];

		// Ensure we're only running only on activation hook that originates from our plugin.
		if ( $plugin_domain === $activated_plugin_domain ) {
			self::generate_translation_strings();
		}
	}

	/**
	 * Add custom tables to $wpdb object.
	 */
	public static function define_tables() {
		global $wpdb;

		// List of tables without prefixes.
		$tables = array(
			'wc_category_lookup' => 'wc_category_lookup',
		);

		foreach ( $tables as $name => $table ) {
			$wpdb->$name    = $wpdb->prefix . $table;
			$wpdb->tables[] = $table;
		}
	}

	/**
	 * Gets a build configured array of enabled WooCommerce Admin features/sections.
	 *
	 * @return array Enabled Woocommerce Admin features/sections.
	 *
	 * @deprecated since 1.9.0, use Features::get_features()
	 */
	public static function get_features() {
		return Features::get_features();
	}

	/**
	 * Gets WordPress capability required to use analytics features.
	 *
	 * @return string
	 * @deprecated since 2.1.0, use value 'view_woocommerce_reports'
	 */
	public static function get_analytics_capability() {
		if ( null === static::$required_capability ) {
			/**
			 * Filters the required capability to use the analytics features.
			 *
			 * @param string $capability WordPress capability.
			 */
			static::$required_capability = apply_filters( 'woocommerce_analytics_menu_capability', 'view_woocommerce_reports' );
		}
		return static::$required_capability;
	}

	/**
	 * Helper function indicating whether the current user has the required analytics capability.
	 *
	 * @return bool
	 * @deprecated since 2.1.0, use current_user_can( 'view_woocommerce_reports' )
	 */
	public static function user_can_analytics() {
		return current_user_can( static::get_analytics_capability() );
	}

	/**
	 * Returns if a specific wc-admin feature is enabled.
	 *
	 * @param  string $feature Feature slug.
	 * @return bool Returns true if the feature is enabled.
	 *
	 * @deprecated since 1.9.0, use Features::is_enabled( $feature )
	 */
	public static function is_feature_enabled( $feature ) {
		return Features::is_enabled( $feature );
	}

	/**
	 * Determines if a minified JS file should be served.
	 *
	 * @param  boolean $script_debug Only serve unminified files if script debug is on.
	 * @return boolean If js asset should use minified version.
	 */
	public static function should_use_minified_js_file( $script_debug ) {
		// minified files are only shipped in non-core versions of wc-admin, return false if minified files are not available.
		if ( ! Features::exists( 'minified-js' ) ) {
			return false;
		}

		// Otherwise we will serve un-minified files if SCRIPT_DEBUG is on, or if anything truthy is passed in-lieu of SCRIPT_DEBUG.
		return ! $script_debug;
	}

	/**
	 * Gets the URL to an asset file.
	 *
	 * @param  string $file File name (without extension).
	 * @param  string $ext File extension.
	 * @return string URL to asset.
	 */
	public static function get_url( $file, $ext ) {
		$suffix = '';

		// Potentially enqueue minified JavaScript.
		if ( 'js' === $ext ) {
			$script_debug = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG;
			$suffix       = self::should_use_minified_js_file( $script_debug ) ? '.min' : '';
		}

		return plugins_url( self::get_path( $ext ) . $file . $suffix . '.' . $ext, WC_ADMIN_PLUGIN_FILE );
	}

	/**
	 * Gets a script asset registry filename. The asset registry lists dependencies for the given script.
	 *
	 * @param  string $script_path_name Path to where the script asset registry is contained.
	 * @param  string $file File name (without extension).
	 * @return string complete asset filename.
	 *
	 * @throws \Exception Throws an exception when a readable asset registry file cannot be found.
	 */
	public static function get_script_asset_filename( $script_path_name, $file ) {
		$minification_supported = Features::exists( 'minified-js' );
		$script_min_filename    = $file . '.min.asset.php';
		$script_nonmin_filename = $file . '.asset.php';
		$script_asset_path      = WC_ADMIN_ABSPATH . WC_ADMIN_DIST_JS_FOLDER . $script_path_name . '/';

		// Check minification is supported first, to avoid multiple is_readable checks when minification is
		// not supported.
		if ( $minification_supported && is_readable( $script_asset_path . $script_min_filename ) ) {
			return $script_min_filename;
		} elseif ( is_readable( $script_asset_path . $script_nonmin_filename ) ) {
			return $script_nonmin_filename;
		} else {
			// could not find an asset file, throw an error.
			throw new \Exception( 'Could not find asset registry for ' . $script_path_name );
		}
	}

	/**
	 * Gets the file modified time as a cache buster if we're in dev mode, or the plugin version otherwise.
	 *
	 * @param string $ext File extension.
	 * @return string The cache buster value to use for the given file.
	 */
	public static function get_file_version( $ext ) {
		if ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) {
			return filemtime( WC_ADMIN_ABSPATH . self::get_path( $ext ) );
		}
		return WC_ADMIN_VERSION_NUMBER;
	}

	/**
	 * Gets the path for the asset depending on file type.
	 *
	 * @param  string $ext File extension.
	 * @return string Folder path of asset.
	 */
	private static function get_path( $ext ) {
		return ( 'css' === $ext ) ? WC_ADMIN_DIST_CSS_FOLDER : WC_ADMIN_DIST_JS_FOLDER;
	}

	/**
	 * Connects existing WooCommerce pages.
	 *
	 * @todo The entry point for the embed needs moved to this class as well.
	 */
	public static function register_page_handler() {
		require_once WC_ADMIN_ABSPATH . 'includes/connect-existing-pages.php';
	}

	/**
	 * Registers the store details (profiler) page.
	 */
	public static function register_store_details_page() {
		wc_admin_register_page(
			array(
				'title'  => __( 'Setup Wizard', 'woocommerce' ),
				'parent' => '',
				'path'   => '/setup-wizard',
			)
		);
	}


	/**
	 * Remove the menu item for the app entry point page.
	 */
	public static function remove_app_entry_page_menu_item() {
		global $submenu;
		// User does not have capabilites to see the submenu.
		if ( ! current_user_can( 'manage_woocommerce' ) || empty( $submenu['woocommerce'] ) ) {
			return;
		}

		$wc_admin_key = null;
		foreach ( $submenu['woocommerce'] as $submenu_key => $submenu_item ) {
			// Our app entry page menu item has no title.
			if ( is_null( $submenu_item[0] ) && self::APP_ENTRY_POINT === $submenu_item[2] ) {
				$wc_admin_key = $submenu_key;
				break;
			}
		}

		if ( ! $wc_admin_key ) {
			return;
		}

		unset( $submenu['woocommerce'][ $wc_admin_key ] );
	}

	/**
	 * Registers all the neccessary scripts and styles to show the admin experience.
	 */
	public static function register_scripts() {
		if ( ! function_exists( 'wp_set_script_translations' ) ) {
			return;
		}

		$js_file_version  = self::get_file_version( 'js' );
		$css_file_version = self::get_file_version( 'css' );

		$scripts = array(
			'wc-explat',
			'wc-experimental',
			'wc-customer-effort-score',
			// NOTE: This should be removed when Gutenberg is updated and the notices package is removed from WooCommerce Admin.
			'wc-notices',
			'wc-number',
			'wc-tracks',
			'wc-date',
			'wc-components',
			WC_ADMIN_APP,
			'wc-csv',
			'wc-store-data',
			'wc-currency',
			'wc-navigation',
		);

		$scripts_map = array(
			WC_ADMIN_APP    => 'app',
			'wc-csv'        => 'csv-export',
			'wc-store-data' => 'data',
		);

		$translated_scripts = array(
			'wc-currency',
			'wc-date',
			'wc-components',
			'wc-customer-effort-score',
			WC_ADMIN_APP,
		);

		foreach ( $scripts as $script ) {
			$script_path_name = isset( $scripts_map[ $script ] ) ? $scripts_map[ $script ] : str_replace( 'wc-', '', $script );

			try {
				$script_assets_filename = self::get_script_asset_filename( $script_path_name, 'index' );
				$script_assets          = require WC_ADMIN_ABSPATH . WC_ADMIN_DIST_JS_FOLDER . $script_path_name . '/' . $script_assets_filename;

				wp_register_script(
					$script,
					self::get_url( $script_path_name . '/index', 'js' ),
					$script_assets ['dependencies'],
					$js_file_version,
					true
				);

				if ( in_array( $script, $translated_scripts, true ) ) {
					wp_set_script_translations( $script, 'woocommerce' );
				}
			} catch ( \Exception $e ) {
				// Avoid crashing WordPress if an asset file could not be loaded.
				wc_caught_exception( $e, __CLASS__ . '::' . __FUNCTION__, $script_path_name );
			}
		}

		wp_register_style(
			'wc-components',
			self::get_url( 'components/style', 'css' ),
			array(),
			$css_file_version
		);
		wp_style_add_data( 'wc-components', 'rtl', 'replace' );

		wp_register_style(
			'wc-customer-effort-score',
			self::get_url( 'customer-effort-score/style', 'css' ),
			array(),
			$css_file_version
		);
		wp_style_add_data( 'wc-customer-effort-score', 'rtl', 'replace' );

		wp_register_style(
			'wc-experimental',
			self::get_url( 'experimental/style', 'css' ),
			array(),
			$css_file_version
		);
		wp_style_add_data( 'wc-experimental', 'rtl', 'replace' );

		wp_localize_script(
			WC_ADMIN_APP,
			'wcAdminAssets',
			array(
				'path'    => plugins_url( self::get_path( 'js' ), WC_ADMIN_PLUGIN_FILE ),
				'version' => $js_file_version,
			)
		);

		wp_register_style(
			WC_ADMIN_APP,
			self::get_url( 'app/style', 'css' ),
			array( 'wc-components', 'wc-customer-effort-score', 'wp-components', 'wc-experimental' ),
			$css_file_version
		);
		wp_style_add_data( WC_ADMIN_APP, 'rtl', 'replace' );

		wp_register_style(
			'wc-onboarding',
			self::get_url( 'onboarding/style', 'css' ),
			array(),
			$css_file_version
		);
		wp_style_add_data( 'wc-onboarding', 'rtl', 'replace' );
	}

	/**
	 * Generate a filename to cache translations from JS chunks.
	 *
	 * @param string $domain Text domain.
	 * @param string $locale Locale being retrieved.
	 * @return string Filename.
	 */
	public static function get_combined_translation_filename( $domain, $locale ) {
		$filename = implode( '-', array( $domain, $locale, WC_ADMIN_APP ) ) . '.json';

		return $filename;
	}

	/**
	 * Find and combine translation chunk files.
	 *
	 * Only targets files that aren't represented by a registered script (e.g. not passed to wp_register_script()).
	 *
	 * @param string $lang_dir Path to language files.
	 * @param string $domain Text domain.
	 * @param string $locale Locale being retrieved.
	 * @return array Combined translation chunk data.
	 */
	public static function get_translation_chunk_data( $lang_dir, $domain, $locale ) {
		// So long as this function is called during the 'upgrader_process_complete' action,
		// the filesystem object should be hooked up.
		global $wp_filesystem;

		// Grab all JSON files in the current language pack.
		$json_i18n_filenames       = glob( $lang_dir . $domain . '-' . $locale . '-*.json' );
		$combined_translation_data = array();

		if ( false === $json_i18n_filenames ) {
			return $combined_translation_data;
		}

		foreach ( $json_i18n_filenames as $json_filename ) {
			if ( ! $wp_filesystem->is_readable( $json_filename ) ) {
				continue;
			}

			$file_contents = $wp_filesystem->get_contents( $json_filename );
			$chunk_data    = \json_decode( $file_contents, true );

			if ( empty( $chunk_data ) ) {
				continue;
			}

			if ( ! isset( $chunk_data['comment']['reference'] ) ) {
				continue;
			}

			$reference_file = $chunk_data['comment']['reference'];

			// Only combine "app" files (not scripts registered with WP).
			if (
				false === strpos( $reference_file, 'dist/chunks/' ) &&
				false === strpos( $reference_file, 'dist/app/index.js' )
			) {
				continue;
			}

			if ( empty( $combined_translation_data ) ) {
				// Use the first translation file as the base structure.
				$combined_translation_data = $chunk_data;
			} else {
				// Combine all messages from all chunk files.
				$combined_translation_data['locale_data']['messages'] = array_merge(
					$combined_translation_data['locale_data']['messages'],
					$chunk_data['locale_data']['messages']
				);
			}
		}

		// Remove inaccurate reference comment.
		unset( $combined_translation_data['comment'] );

		return $combined_translation_data;
	}

	/**
	 * Combine translation chunks when plugin is activated.
	 *
	 * This function combines JSON translation data auto-extracted by GlotPress
	 * from Webpack-generated JS chunks into a single file. This is necessary
	 * since the JS chunks are not known to WordPress via wp_register_script()
	 * and wp_set_script_translations().
	 */
	public static function generate_translation_strings() {
		$plugin_domain = explode( '/', plugin_basename( __FILE__ ) )[0];
		$locale        = determine_locale();
		$lang_dir      = WP_LANG_DIR . '/plugins/';

		// Bail early if not localized.
		if ( 'en_US' === $locale ) {
			return;
		}

		if ( ! function_exists( 'get_filesystem_method' ) ) {
			require_once ABSPATH . 'wp-admin/includes/file.php';
		}

		$access_type = get_filesystem_method();
		if ( 'direct' === $access_type ) {
			\WP_Filesystem();
			self::build_and_save_translations( $lang_dir, $plugin_domain, $locale );
		} else {
			// I'm reluctant to add support for other filesystems here as it would require
			// user's input on activating plugin - which I don't think is common.
			return;
		}
	}

	/**
	 * Combine and save translations for a specific locale.
	 *
	 * Note that this assumes \WP_Filesystem is already initialized with write access.
	 *
	 * @param string $language_dir Path to language files.
	 * @param string $plugin_domain Text domain.
	 * @param string $locale Locale being retrieved.
	 */
	public static function build_and_save_translations( $language_dir, $plugin_domain, $locale ) {
		global $wp_filesystem;
		$translations_from_chunks = self::get_translation_chunk_data( $language_dir, $plugin_domain, $locale );

		if ( empty( $translations_from_chunks ) ) {
			return;
		}

		$cache_filename          = self::get_combined_translation_filename( $plugin_domain, $locale );
		$chunk_translations_json = wp_json_encode( $translations_from_chunks );

		// Cache combined translations strings to a file.
		$wp_filesystem->put_contents( $language_dir . $cache_filename, $chunk_translations_json );
	}

	/**
	 * Combine translation chunks when files are updated.
	 *
	 * This function combines JSON translation data auto-extracted by GlotPress
	 * from Webpack-generated JS chunks into a single file that can be used in
	 * subsequent requests. This is necessary since the JS chunks are not known
	 * to WordPress via wp_register_script() and wp_set_script_translations().
	 *
	 * @param Language_Pack_Upgrader $instance Upgrader instance.
	 * @param array                  $hook_extra Info about the upgraded language packs.
	 */
	public static function combine_translation_chunk_files( $instance, $hook_extra ) {
		if (
			! is_a( $instance, 'Language_Pack_Upgrader' ) ||
			! isset( $hook_extra['translations'] ) ||
			! is_array( $hook_extra['translations'] )
		) {
			return;
		}

		// Make sure we're handing the correct domain (could be woocommerce or woocommerce-admin).
		$plugin_domain = explode( '/', plugin_basename( __FILE__ ) )[0];
		$locales       = array();
		$language_dir  = WP_LANG_DIR . '/plugins/';

		// Gather the locales that were updated in this operation.
		foreach ( $hook_extra['translations'] as $translation ) {
			if (
				'plugin' === $translation['type'] &&
				$plugin_domain === $translation['slug']
			) {
				$locales[] = $translation['language'];
			}
		}

		// Build combined translation files for all updated locales.
		foreach ( $locales as $locale ) {
			// So long as this function is hooked to the 'upgrader_process_complete' action,
			// WP_Filesystem should be hooked up to be able to call build_and_save_translations.
			self::build_and_save_translations( $language_dir, $plugin_domain, $locale );
		}
	}

	/**
	 * Load translation strings from language packs for dynamic imports.
	 *
	 * @param string $file File location for the script being translated.
	 * @param string $handle Script handle.
	 * @param string $domain Text domain.
	 *
	 * @return string New file location for the script being translated.
	 */
	public static function load_script_translation_file( $file, $handle, $domain ) {
		// Make sure the main app script is being loaded.
		if ( WC_ADMIN_APP !== $handle ) {
			return $file;
		}

		// Make sure we're handing the correct domain (could be woocommerce or woocommerce-admin).
		$plugin_domain = explode( '/', plugin_basename( __FILE__ ) )[0];
		if ( $plugin_domain !== $domain ) {
			return $file;
		}

		$locale         = determine_locale();
		$cache_filename = self::get_combined_translation_filename( $domain, $locale );

		return WP_LANG_DIR . '/plugins/' . $cache_filename;
	}

	/**
	 * Loads the required scripts on the correct pages.
	 */
	public function load_scripts() {
		if ( ! self::is_admin_or_embed_page() ) {
			return;
		}

		// Grab translation strings from Webpack-generated chunks.
		add_filter( 'load_script_translation_file', array( __CLASS__, 'load_script_translation_file' ), 10, 3 );

		wp_enqueue_script( WC_ADMIN_APP );
		wp_enqueue_style( WC_ADMIN_APP );
		wp_enqueue_style( 'wc-material-icons' );
		wp_enqueue_style( 'wc-onboarding' );

		// Preload our assets.
		$this->output_header_preload_tags();
	}

	/**
	 * Render a preload link tag for a dependency, optionally
	 * checked against a provided allowlist.
	 *
	 * See: https://macarthur.me/posts/preloading-javascript-in-wordpress
	 *
	 * @param WP_Dependency $dependency The WP_Dependency being preloaded.
	 * @param string        $type Dependency type - 'script' or 'style'.
	 * @param array         $allowlist Optional. List of allowed dependency handles.
	 */
	public function maybe_output_preload_link_tag( $dependency, $type, $allowlist = array() ) {
		if (
			(
				! empty( $allowlist ) &&
				! in_array( $dependency->handle, $allowlist, true )
			) ||
			in_array( $dependency->handle, $this->preloaded_dependencies[ $type ], true )
		) {
			return;
		}

		$this->preloaded_dependencies[ $type ][] = $dependency->handle;

		$source = $dependency->ver ? add_query_arg( 'ver', $dependency->ver, $dependency->src ) : $dependency->src;

		echo '<link rel="preload" href="', esc_url( $source ), '" as="', esc_attr( $type ), '" />', "\n";
	}

	/**
	 * Output a preload link tag for dependencies (and their sub dependencies)
	 * with an optional allowlist.
	 *
	 * See: https://macarthur.me/posts/preloading-javascript-in-wordpress
	 *
	 * @param string $type Dependency type - 'script' or 'style'.
	 * @param array  $allowlist Optional. List of allowed dependency handles.
	 */
	public function output_header_preload_tags_for_type( $type, $allowlist = array() ) {
		if ( 'script' === $type ) {
			$dependencies_of_type = wp_scripts();
		} elseif ( 'style' === $type ) {
			$dependencies_of_type = wp_styles();
		} else {
			return;
		}

		foreach ( $dependencies_of_type->queue as $dependency_handle ) {
			$dependency = $dependencies_of_type->query( $dependency_handle, 'registered' );

			if ( false === $dependency ) {
				continue;
			}

			// Preload the subdependencies first.
			foreach ( $dependency->deps as $sub_dependency_handle ) {
				$sub_dependency = $dependencies_of_type->query( $sub_dependency_handle, 'registered' );

				if ( $sub_dependency ) {
					$this->maybe_output_preload_link_tag( $sub_dependency, $type, $allowlist );
				}
			}

			$this->maybe_output_preload_link_tag( $dependency, $type, $allowlist );
		}
	}

	/**
	 * Output preload link tags for all enqueued stylesheets and scripts.
	 *
	 * See: https://macarthur.me/posts/preloading-javascript-in-wordpress
	 */
	public function output_header_preload_tags() {
		$wc_admin_scripts = array(
			WC_ADMIN_APP,
			'wc-components',
		);

		$wc_admin_styles = array(
			WC_ADMIN_APP,
			'wc-components',
			'wc-material-icons',
		);

		// Preload styles.
		$this->output_header_preload_tags_for_type( 'style', $wc_admin_styles );

		// Preload scripts.
		$this->output_header_preload_tags_for_type( 'script', $wc_admin_scripts );
	}

	/**
	 * Returns true if we are on a JS powered admin page or
	 * a "classic" (non JS app) powered admin page (an embedded page).
	 */
	public static function is_admin_or_embed_page() {
		return self::is_admin_page() || self::is_embed_page();
	}

	/**
	 * Returns true if we are on a JS powered admin page.
	 */
	public static function is_admin_page() {
		// Check the function exists before calling in case WC Admin is disabled. See PR #6563.
		return function_exists( 'wc_admin_is_registered_page' ) && wc_admin_is_registered_page();
	}

	/**
	 *  Returns true if we are on a "classic" (non JS app) powered admin page.
	 *
	 * TODO: See usage in `admin.php`. This needs refactored and implemented properly in core.
	 */
	public static function is_embed_page() {
		return wc_admin_is_connected_page() || ( ! self::is_admin_page() && class_exists( 'Automattic\WooCommerce\Admin\Features\Navigation\Screen' ) && Screen::is_woocommerce_page() );
	}

	/**
	 * Returns breadcrumbs for the current page.
	 */
	private static function get_embed_breadcrumbs() {
		return wc_admin_get_breadcrumbs();
	}

	/**
	 * Outputs breadcrumbs via PHP for the initial load of an embedded page.
	 *
	 * @param array $section Section to create breadcrumb from.
	 */
	private static function output_heading( $section ) {
		echo esc_html( $section );
	}

	/**
	 * Set up a div for the header embed to render into.
	 * The initial contents here are meant as a place loader for when the PHP page initialy loads.
	 */
	public static function embed_page_header() {
		if ( ! self::is_admin_page() && ! self::is_embed_page() ) {
			return;
		}

		if ( ! self::is_embed_page() ) {
			return;
		}

		$sections = self::get_embed_breadcrumbs();
		$sections = is_array( $sections ) ? $sections : array( $sections );
		?>
		<div id="woocommerce-embedded-root" class="is-embed-loading">
			<div class="woocommerce-layout">
				<div class="woocommerce-layout__header is-embed-loading">
					<h1 class="woocommerce-layout__header-heading">
						<?php self::output_heading( end( $sections ) ); ?>
					</h1>
				</div>
			</div>
		</div>
		<?php
	}

	/**
	 * Adds body classes to the main wp-admin wrapper, allowing us to better target elements in specific scenarios.
	 *
	 * @param string $admin_body_class Body class to add.
	 */
	public static function add_admin_body_classes( $admin_body_class = '' ) {
		if ( ! self::is_admin_or_embed_page() ) {
			return $admin_body_class;
		}

		$classes   = explode( ' ', trim( $admin_body_class ) );
		$classes[] = 'woocommerce-page';
		if ( self::is_embed_page() ) {
			$classes[] = 'woocommerce-embed-page';
		}

		/**
		 * Some routes or features like onboarding hide the wp-admin navigation and masterbar.
		 * Setting `woocommerce_admin_is_loading` to true allows us to premeptively hide these
		 * elements while the JS app loads.
		 * This class needs to be removed by those feature components (like <ProfileWizard />).
		 *
		 * @param bool $is_loading If WooCommerce Admin is loading a fullscreen view.
		 */
		$is_loading = apply_filters( 'woocommerce_admin_is_loading', false );

		if ( self::is_admin_page() && $is_loading ) {
			$classes[] = 'woocommerce-admin-is-loading';
		}

		$admin_body_class = implode( ' ', array_unique( $classes ) );
		return " $admin_body_class ";
	}

	/**
	 * Adds an iOS "Smart App Banner" for display on iOS Safari.
	 * See https://developer.apple.com/library/archive/documentation/AppleApplications/Reference/SafariWebContent/PromotingAppswithAppBanners/PromotingAppswithAppBanners.html
	 */
	public static function smart_app_banner() {
		if ( self::is_admin_or_embed_page() ) {
			echo "
				<meta name='apple-itunes-app' content='app-id=1389130815'>
			";
		}
	}


	/**
	 * Removes notices that should not be displayed on WC Admin pages.
	 */
	public static function remove_notices() {
		if ( ! self::is_admin_or_embed_page() ) {
			return;
		}

		// Hello Dolly.
		if ( function_exists( 'hello_dolly' ) ) {
			remove_action( 'admin_notices', 'hello_dolly' );
		}
	}

	/**
	 * Runs before admin notices action and hides them.
	 */
	public static function inject_before_notices() {
		if ( ! self::is_admin_or_embed_page() ) {
			return;
		}

		// Wrap the notices in a hidden div to prevent flickering before
		// they are moved elsewhere in the page by WordPress Core.
		echo '<div class="woocommerce-layout__notice-list-hide" id="wp__notice-list">';

		if ( self::is_admin_page() ) {
			// Capture all notices and hide them. WordPress Core looks for
			// `.wp-header-end` and appends notices after it if found.
			// https://github.com/WordPress/WordPress/blob/f6a37e7d39e2534d05b9e542045174498edfe536/wp-admin/js/common.js#L737 .
			echo '<div class="wp-header-end" id="woocommerce-layout__notice-catcher"></div>';
		}
	}

	/**
	 * Runs after admin notices and closes div.
	 */
	public static function inject_after_notices() {
		if ( ! self::is_admin_or_embed_page() ) {
			return;
		}

		// Close the hidden div used to prevent notices from flickering before
		// they are inserted elsewhere in the page.
		echo '</div>';
	}

	/**
	 * Edits Admin title based on section of wc-admin.
	 *
	 * @param string $admin_title Modifies admin title.
	 * @todo Can we do some URL rewriting so we can figure out which page they are on server side?
	 */
	public static function update_admin_title( $admin_title ) {
		if (
			! did_action( 'current_screen' ) ||
			! self::is_admin_page()
		) {
			return $admin_title;
		}

		$sections = self::get_embed_breadcrumbs();
		$pieces   = array();

		foreach ( $sections as $section ) {
			$pieces[] = is_array( $section ) ? $section[1] : $section;
		}

		$pieces = array_reverse( $pieces );
		$title  = implode( ' &lsaquo; ', $pieces );

		/* translators: %1$s: updated title, %2$s: blog info name */
		return sprintf( __( '%1$s &lsaquo; %2$s', 'woocommerce' ), $title, get_bloginfo( 'name' ) );
	}

	/**
	 * Set up a div for the app to render into.
	 */
	public static function page_wrapper() {
		?>
		<div class="wrap">
			<div id="root"></div>
		</div>
		<?php
	}

	/**
	 * Hooks extra neccessary data into the component settings array already set in WooCommerce core.
	 *
	 * @param array $settings Array of component settings.
	 * @return array Array of component settings.
	 */
	public static function add_component_settings( $settings ) {
		if ( ! is_admin() ) {
			return $settings;
		}

		if ( ! function_exists( 'wc_blocks_container' ) ) {
			global $wp_locale;
			// inject data not available via older versions of wc_blocks/woo.
			$settings['orderStatuses'] = self::get_order_statuses( wc_get_order_statuses() );
			$settings['stockStatuses'] = self::get_order_statuses( wc_get_product_stock_status_options() );
			$settings['currency']      = self::get_currency_settings();
			$settings['locale']        = [
				'siteLocale'    => isset( $settings['siteLocale'] )
					? $settings['siteLocale']
					: get_locale(),
				'userLocale'    => isset( $settings['l10n']['userLocale'] )
					? $settings['l10n']['userLocale']
					: get_user_locale(),
				'weekdaysShort' => isset( $settings['l10n']['weekdaysShort'] )
					? $settings['l10n']['weekdaysShort']
					: array_values( $wp_locale->weekday_abbrev ),
			];
		}

		$preload_data_endpoints = apply_filters( 'woocommerce_component_settings_preload_endpoints', array( '/wc/v3' ) );
		if ( class_exists( 'Jetpack' ) ) {
			$preload_data_endpoints['jetpackStatus'] = '/jetpack/v4/connection';
		}
		if ( ! empty( $preload_data_endpoints ) ) {
			$preload_data = array_reduce(
				array_values( $preload_data_endpoints ),
				'rest_preload_api_request'
			);
		}

		$preload_options = apply_filters( 'woocommerce_admin_preload_options', array() );
		if ( ! empty( $preload_options ) ) {
			foreach ( $preload_options as $option ) {
				$settings['preloadOptions'][ $option ] = get_option( $option );
			}
		}

		$preload_settings = apply_filters( 'woocommerce_admin_preload_settings', array() );
		if ( ! empty( $preload_settings ) ) {
			$setting_options = new \WC_REST_Setting_Options_V2_Controller();
			foreach ( $preload_settings as $group ) {
				$group_settings   = $setting_options->get_group_settings( $group );
				$preload_settings = [];
				foreach ( $group_settings as $option ) {
					$preload_settings[ $option['id'] ] = $option['value'];
				}
				$settings['preloadSettings'][ $group ] = $preload_settings;
			}
		}

		$user_controller = new \WP_REST_Users_Controller();
		$request         = new \WP_REST_Request();
		$request->set_query_params( array( 'context' => 'edit' ) );
		$user_response     = $user_controller->get_current_item( $request );
		$current_user_data = is_wp_error( $user_response ) ? (object) array() : $user_response->get_data();

		$settings['currentUserData']      = $current_user_data;
		$settings['reviewsEnabled']       = get_option( 'woocommerce_enable_reviews' );
		$settings['manageStock']          = get_option( 'woocommerce_manage_stock' );
		$settings['commentModeration']    = get_option( 'comment_moderation' );
		$settings['notifyLowStockAmount'] = get_option( 'woocommerce_notify_low_stock_amount' );
		// @todo On merge, once plugin images are added to core WooCommerce, `wcAdminAssetUrl` can be retired,
		// and `wcAssetUrl` can be used in its place throughout the codebase.
		$settings['wcAdminAssetUrl'] = plugins_url( 'images/', dirname( __DIR__ ) . '/woocommerce-admin.php' );
		$settings['wcVersion']       = WC_VERSION;
		$settings['siteUrl']         = site_url();
		$settings['shopUrl']         = get_permalink( wc_get_page_id( 'shop' ) );
		$settings['homeUrl']         = home_url();
		$settings['dateFormat']      = get_option( 'date_format' );
		$settings['timeZone']        = wc_timezone_string();
		$settings['plugins']         = array(
			'installedPlugins' => PluginsHelper::get_installed_plugin_slugs(),
			'activePlugins'    => Plugins::get_active_plugins(),
		);
		// Plugins that depend on changing the translation work on the server but not the client -
		// WooCommerce Branding is an example of this - so pass through the translation of
		// 'WooCommerce' to wcSettings.
		$settings['woocommerceTranslation'] = __( 'WooCommerce', 'woocommerce' );
		// We may have synced orders with a now-unregistered status.
		// E.g An extension that added statuses is now inactive or removed.
		$settings['unregisteredOrderStatuses'] = self::get_unregistered_order_statuses();
		// The separator used for attributes found in Variation titles.
		$settings['variationTitleAttributesSeparator'] = apply_filters( 'woocommerce_product_variation_title_attributes_separator', ' - ', new \WC_Product() );

		if ( ! empty( $preload_data_endpoints ) ) {
			$settings['dataEndpoints'] = isset( $settings['dataEndpoints'] )
				? $settings['dataEndpoints']
				: [];
			foreach ( $preload_data_endpoints as $key => $endpoint ) {
				// Handle error case: rest_do_request() doesn't guarantee success.
				if ( empty( $preload_data[ $endpoint ] ) ) {
					$settings['dataEndpoints'][ $key ] = array();
				} else {
					$settings['dataEndpoints'][ $key ] = $preload_data[ $endpoint ]['body'];
				}
			}
		}
		$settings = self::get_custom_settings( $settings );
		if ( self::is_embed_page() ) {
			$settings['embedBreadcrumbs'] = self::get_embed_breadcrumbs();
		}

		$settings['allowMarketplaceSuggestions'] = WC_Marketplace_Suggestions::allow_suggestions();
		$settings['connectNonce']                = wp_create_nonce( 'connect' );

		return $settings;
	}

	/**
	 * Format order statuses by removing a leading 'wc-' if present.
	 *
	 * @param array $statuses Order statuses.
	 * @return array formatted statuses.
	 */
	public static function get_order_statuses( $statuses ) {
		$formatted_statuses = array();
		foreach ( $statuses as $key => $value ) {
			$formatted_key                        = preg_replace( '/^wc-/', '', $key );
			$formatted_statuses[ $formatted_key ] = $value;
		}
		return $formatted_statuses;
	}

	/**
	 * Get all order statuses present in analytics tables that aren't registered.
	 *
	 * @return array Unregistered order statuses.
	 */
	public static function get_unregistered_order_statuses() {
		$registered_statuses   = wc_get_order_statuses();
		$all_synced_statuses   = OrdersDataStore::get_all_statuses();
		$unregistered_statuses = array_diff( $all_synced_statuses, array_keys( $registered_statuses ) );
		$formatted_status_keys = self::get_order_statuses( array_fill_keys( $unregistered_statuses, '' ) );
		$formatted_statuses    = array_keys( $formatted_status_keys );

		return array_combine( $formatted_statuses, $formatted_statuses );
	}

	/**
	 * Register the admin settings for use in the WC REST API
	 *
	 * @param array $groups Array of setting groups.
	 * @return array
	 */
	public static function add_settings_group( $groups ) {
		$groups[] = array(
			'id'          => 'wc_admin',
			'label'       => __( 'WooCommerce Admin', 'woocommerce' ),
			'description' => __( 'Settings for WooCommerce admin reporting.', 'woocommerce' ),
		);
		return $groups;
	}

	/**
	 * Add WC Admin specific settings
	 *
	 * @param array $settings Array of settings in wc admin group.
	 * @return array
	 */
	public static function add_settings( $settings ) {
		$unregistered_statuses = self::get_unregistered_order_statuses();
		$registered_statuses   = self::get_order_statuses( wc_get_order_statuses() );
		$all_statuses          = array_merge( $unregistered_statuses, $registered_statuses );

		$settings[] = array(
			'id'          => 'woocommerce_excluded_report_order_statuses',
			'option_key'  => 'woocommerce_excluded_report_order_statuses',
			'label'       => __( 'Excluded report order statuses', 'woocommerce' ),
			'description' => __( 'Statuses that should not be included when calculating report totals.', 'woocommerce' ),
			'default'     => array( 'pending', 'cancelled', 'failed' ),
			'type'        => 'multiselect',
			'options'     => $all_statuses,
		);
		$settings[] = array(
			'id'          => 'woocommerce_actionable_order_statuses',
			'option_key'  => 'woocommerce_actionable_order_statuses',
			'label'       => __( 'Actionable order statuses', 'woocommerce' ),
			'description' => __( 'Statuses that require extra action on behalf of the store admin.', 'woocommerce' ),
			'default'     => array( 'processing', 'on-hold' ),
			'type'        => 'multiselect',
			'options'     => $all_statuses,
		);
		$settings[] = array(
			'id'          => 'woocommerce_default_date_range',
			'option_key'  => 'woocommerce_default_date_range',
			'label'       => __( 'Default Date Range', 'woocommerce' ),
			'description' => __( 'Default Date Range', 'woocommerce' ),
			'default'     => 'period=month&compare=previous_year',
			'type'        => 'text',
		);
		return $settings;
	}

	/**
	 * Gets custom settings used for WC Admin.
	 *
	 * @param array $settings Array of settings to merge into.
	 * @return array
	 */
	public static function get_custom_settings( $settings ) {
		$wc_rest_settings_options_controller = new \WC_REST_Setting_Options_Controller();
		$wc_admin_group_settings             = $wc_rest_settings_options_controller->get_group_settings( 'wc_admin' );
		$settings['wcAdminSettings']         = array();

		foreach ( $wc_admin_group_settings as $setting ) {
			if ( ! empty( $setting['id'] ) ) {
				$settings['wcAdminSettings'][ $setting['id'] ] = $setting['value'];
			}
		}
		return $settings;
	}

	/**
	 * Return an object defining the currecy options for the site's current currency
	 *
	 * @return  array  Settings for the current currency {
	 *     Array of settings.
	 *
	 *     @type string $code       Currency code.
	 *     @type string $precision  Number of decimals.
	 *     @type string $symbol     Symbol for currency.
	 * }
	 */
	public static function get_currency_settings() {
		$code = get_woocommerce_currency();

		return apply_filters(
			'wc_currency_settings',
			array(
				'code'              => $code,
				'precision'         => wc_get_price_decimals(),
				'symbol'            => html_entity_decode( get_woocommerce_currency_symbol( $code ) ),
				'symbolPosition'    => get_option( 'woocommerce_currency_pos' ),
				'decimalSeparator'  => wc_get_price_decimal_separator(),
				'thousandSeparator' => wc_get_price_thousand_separator(),
				'priceFormat'       => html_entity_decode( get_woocommerce_price_format() ),
			)
		);
	}

	/**
	 * Registers WooCommerce specific user data to the WordPress user API.
	 */
	public static function register_user_data() {
		register_rest_field(
			'user',
			'is_super_admin',
			array(
				'get_callback' => function() {
					return is_super_admin();
				},
				'schema'       => null,
			)
		);
		register_rest_field(
			'user',
			'woocommerce_meta',
			array(
				'get_callback'    => array( __CLASS__, 'get_user_data_values' ),
				'update_callback' => array( __CLASS__, 'update_user_data_values' ),
				'schema'          => null,
			)
		);
	}

	/**
	 * For all the registered user data fields (  Loader::get_user_data_fields ), fetch the data
	 * for returning via the REST API.
	 *
	 * @param WP_User $user Current user.
	 */
	public static function get_user_data_values( $user ) {
		$values = array();
		foreach ( self::get_user_data_fields() as $field ) {
			$values[ $field ] = self::get_user_data_field( $user['id'], $field );
		}
		return $values;
	}

	/**
	 * For all the registered user data fields ( Loader::get_user_data_fields ), update the data
	 * for the REST API.
	 *
	 * @param array   $values   The new values for the meta.
	 * @param WP_User $user     The current user.
	 * @param string  $field_id The field id for the user meta.
	 */
	public static function update_user_data_values( $values, $user, $field_id ) {
		if ( empty( $values ) || ! is_array( $values ) || 'woocommerce_meta' !== $field_id ) {
			return;
		}
		$fields  = self::get_user_data_fields();
		$updates = array();
		foreach ( $values as $field => $value ) {
			if ( in_array( $field, $fields, true ) ) {
				$updates[ $field ] = $value;
				self::update_user_data_field( $user->ID, $field, $value );
			}
		}
		return $updates;
	}

	/**
	 * We store some WooCommerce specific user meta attached to users endpoint,
	 * so that we can track certain preferences or values such as the inbox activity panel last open time.
	 * Additional fields can be added in the function below, and then used via wc-admin's currentUser data.
	 *
	 * @return array Fields to expose over the WP user endpoint.
	 */
	public static function get_user_data_fields() {
		return apply_filters( 'woocommerce_admin_get_user_data_fields', array() );
	}

	/**
	 * Helper to update user data fields.
	 *
	 * @param int    $user_id  User ID.
	 * @param string $field Field name.
	 * @param mixed  $value  Field value.
	 */
	public static function update_user_data_field( $user_id, $field, $value ) {
		update_user_meta( $user_id, 'woocommerce_admin_' . $field, $value );
	}

	/**
	 * Helper to retrive user data fields.
	 *
	 * Migrates old key prefixes as well.
	 *
	 * @param int    $user_id  User ID.
	 * @param string $field Field name.
	 * @return mixed The user field value.
	 */
	public static function get_user_data_field( $user_id, $field ) {
		$meta_value = get_user_meta( $user_id, 'woocommerce_admin_' . $field, true );

		// Migrate old meta values (prefix changed from `wc_admin_` to `woocommerce_admin_`).
		if ( '' === $meta_value ) {
			$old_meta_value = get_user_meta( $user_id, 'wc_admin_' . $field, true );

			if ( '' !== $old_meta_value ) {
				self::update_user_data_field( $user_id, $field, $old_meta_value );
				delete_user_meta( $user_id, 'wc_admin_' . $field );

				$meta_value = $old_meta_value;
			}
		}

		return $meta_value;
	}

	/**
	 * Injects wp-shared-settings as a dependency if it's present.
	 */
	public static function inject_wc_settings_dependencies() {
		if ( wp_script_is( 'wc-settings', 'registered' ) ) {
			$handles_for_injection = [
				'wc-csv',
				'wc-currency',
				'wc-customer-effort-score',
				'wc-navigation',
				// NOTE: This should be removed when Gutenberg is updated and
				// the notices package is removed from WooCommerce Admin.
				'wc-notices',
				'wc-number',
				'wc-date',
				'wc-components',
				'wc-tracks',
			];
			foreach ( $handles_for_injection as $handle ) {
				$script = wp_scripts()->query( $handle, 'registered' );
				if ( $script instanceof _WP_Dependency ) {
					$script->deps[] = 'wc-settings';
				}
			}
		}
	}

	/**
	 * Delete woocommerce_onboarding_homepage_post_id field when the homepage is deleted
	 *
	 * @param int $post_id The deleted post id.
	 */
	public static function delete_homepage( $post_id ) {
		if ( 'page' !== get_post_type( $post_id ) ) {
			return;
		}
		$homepage_id = intval( get_option( 'woocommerce_onboarding_homepage_post_id', false ) );
		if ( $homepage_id === $post_id ) {
			delete_option( 'woocommerce_onboarding_homepage_post_id' );
		}
	}
}
woocommerce-admin/src/ReportsSync.php000064400000013633151335517650013765 0ustar00<?php
/**
 * Report table sync related functions and actions.
 */

namespace Automattic\WooCommerce\Admin;

defined( 'ABSPATH' ) || exit;

use Automattic\WooCommerce\Admin\Schedulers\CustomersScheduler;
use Automattic\WooCommerce\Admin\Schedulers\OrdersScheduler;
use Automattic\WooCommerce\Admin\Schedulers\ImportScheduler;

/**
 * ReportsSync Class.
 */
class ReportsSync {
	/**
	 * Hook in sync methods.
	 */
	public static function init() {
		// Initialize scheduler hooks.
		foreach ( self::get_schedulers() as $scheduler ) {
			$scheduler::init();
		}
		add_action( 'woocommerce_update_product', array( __CLASS__, 'clear_stock_count_cache' ) );
		add_action( 'woocommerce_new_product', array( __CLASS__, 'clear_stock_count_cache' ) );
		add_action( 'update_option_woocommerce_notify_low_stock_amount', array( __CLASS__, 'clear_stock_count_cache' ) );
		add_action( 'update_option_woocommerce_notify_no_stock_amount', array( __CLASS__, 'clear_stock_count_cache' ) );
	}

	/**
	 * Get classes for syncing data.
	 *
	 * @return array
	 * @throws \Exception Throws exception when invalid data is found.
	 */
	public static function get_schedulers() {
		$schedulers = apply_filters(
			'woocommerce_analytics_report_schedulers',
			array(
				new CustomersScheduler(),
				new OrdersScheduler(),
			)
		);

		foreach ( $schedulers as $scheduler ) {
			if ( ! is_subclass_of( $scheduler, 'Automattic\WooCommerce\Admin\Schedulers\ImportScheduler' ) ) {
				throw new \Exception( __( 'Report sync schedulers should be derived from the Automattic\WooCommerce\Admin\Schedulers\ImportScheduler class.', 'woocommerce' ) );
			}
		}

		return $schedulers;
	}

	/**
	 * Returns true if an import is in progress.
	 *
	 * @return bool
	 */
	public static function is_importing() {
		foreach ( self::get_schedulers() as $scheduler ) {
			if ( $scheduler::is_importing() ) {
				return true;
			}
		}
		return false;
	}

	/**
	 * Regenerate data for reports.
	 *
	 * @param int|bool $days Number of days to import.
	 * @param bool     $skip_existing Skip exisiting records.
	 * @return string
	 */
	public static function regenerate_report_data( $days, $skip_existing ) {
		if ( self::is_importing() ) {
			return new \WP_Error( 'wc_admin_import_in_progress', __( 'An import is already in progress. Please allow the previous import to complete before beginning a new one.', 'woocommerce' ) );
		}

		self::reset_import_stats( $days, $skip_existing );
		foreach ( self::get_schedulers() as $scheduler ) {
			$scheduler::schedule_action( 'import_batch_init', array( $days, $skip_existing ) );
		}

		/**
		 * Fires when report data regeneration begins.
		 *
		 * @param int|bool $days Number of days to import.
		 * @param bool     $skip_existing Skip exisiting records.
		 */
		do_action( 'woocommerce_analytics_regenerate_init', $days, $skip_existing );

		return __( 'Report table data is being rebuilt. Please allow some time for data to fully populate.', 'woocommerce' );
	}

	/**
	 * Update the import stat totals and counts.
	 *
	 * @param int|bool $days Number of days to import.
	 * @param bool     $skip_existing Skip exisiting records.
	 */
	public static function reset_import_stats( $days, $skip_existing ) {
		$import_stats = get_option( ImportScheduler::IMPORT_STATS_OPTION, array() );
		$totals       = self::get_import_totals( $days, $skip_existing );

		foreach ( self::get_schedulers() as $scheduler ) {
			$import_stats[ $scheduler::$name ]['imported'] = 0;
			$import_stats[ $scheduler::$name ]['total']    = $totals[ $scheduler::$name ];
		}

		// Update imported from date if older than previous.
		$previous_import_date = isset( $import_stats['imported_from'] ) ? $import_stats['imported_from'] : null;
		$current_import_date  = $days ? gmdate( 'Y-m-d 00:00:00', time() - ( DAY_IN_SECONDS * $days ) ) : -1;

		if ( ! $previous_import_date || -1 === $current_import_date || new \DateTime( $previous_import_date ) > new \DateTime( $current_import_date ) ) {
			$import_stats['imported_from'] = $current_import_date;
		}

		update_option( ImportScheduler::IMPORT_STATS_OPTION, $import_stats );
	}

	/**
	 * Get stats for current import.
	 *
	 * @return array
	 */
	public static function get_import_stats() {
		$import_stats                 = get_option( ImportScheduler::IMPORT_STATS_OPTION, array() );
		$import_stats['is_importing'] = self::is_importing();

		return $import_stats;
	}

	/**
	 * Get the import totals for all syncs.
	 *
	 * @param int|bool $days Number of days to import.
	 * @param bool     $skip_existing Skip exisiting records.
	 * @return array
	 */
	public static function get_import_totals( $days, $skip_existing ) {
		$totals = array();

		foreach ( self::get_schedulers() as $scheduler ) {
			$items                       = $scheduler::get_items( 1, 1, $days, $skip_existing );
			$totals[ $scheduler::$name ] = $items->total;
		}

		return $totals;
	}

	/**
	 * Clears all queued actions.
	 */
	public static function clear_queued_actions() {
		foreach ( self::get_schedulers() as $scheduler ) {
			$scheduler::clear_queued_actions();
		}
	}

	/**
	 * Delete all data for reports.
	 *
	 * @return string
	 */
	public static function delete_report_data() {
		// Cancel all pending import jobs.
		self::clear_queued_actions();

		foreach ( self::get_schedulers() as $scheduler ) {
			$scheduler::schedule_action( 'delete_batch_init', array() );
		}

		// Delete import options.
		delete_option( ImportScheduler::IMPORT_STATS_OPTION );

		return __( 'Report table data is being deleted.', 'woocommerce' );
	}

	/**
	 * Clear the count cache when products are added or updated, or when
	 * the no/low stock options are changed.
	 *
	 * @param int $id Post/product ID.
	 */
	public static function clear_stock_count_cache( $id ) {
		delete_transient( 'wc_admin_stock_count_lowstock' );
		delete_transient( 'wc_admin_product_count' );
		$status_options = wc_get_product_stock_status_options();
		foreach ( $status_options as $status => $label ) {
			delete_transient( 'wc_admin_stock_count_' . $status );
		}
	}
}
woocommerce-admin/src/PluginsInstaller.php000064400000006245151335517650014772 0ustar00<?php
/**
 * PluginsInstaller
 *
 * Installer to allow plugin installation via URL query.
 */

namespace Automattic\WooCommerce\Admin;

defined( 'ABSPATH' ) || exit;

use Automattic\WooCommerce\Admin\API\Plugins;
use Automattic\WooCommerce\Admin\Features\TransientNotices;

/**
 * Class PluginsInstaller
 */
class PluginsInstaller {

	/**
	 * Constructor
	 */
	public static function init() {
		add_action( 'admin_init', array( __CLASS__, 'possibly_install_activate_plugins' ) );
	}

	/**
	 * Check if an install or activation is being requested via URL query.
	 */
	public static function possibly_install_activate_plugins() {
		/* phpcs:disable WordPress.Security.NonceVerification.Recommended */
		if ( ! isset( $_GET['plugin_action'] ) || ! isset( $_GET['plugins'] ) || ! current_user_can( 'install_plugins' ) ) {
			return;
		}

		$plugins       = sanitize_text_field( wp_unslash( $_GET['plugins'] ) );
		$plugin_action = sanitize_text_field( wp_unslash( $_GET['plugin_action'] ) );
		/* phpcs:enable WordPress.Security.NonceVerification.Recommended */

		$plugins_api     = new Plugins();
		$install_result  = null;
		$activate_result = null;

		switch ( $plugin_action ) {
			case 'install':
				$install_result = $plugins_api->install_plugins( array( 'plugins' => $plugins ) );
				break;
			case 'activate':
				$activate_result = $plugins_api->activate_plugins( array( 'plugins' => $plugins ) );
				break;
			case 'install-activate':
				$install_result  = $plugins_api->install_plugins( array( 'plugins' => $plugins ) );
				$activate_result = $plugins_api->activate_plugins( array( 'plugins' => implode( ',', $install_result['data']['installed'] ) ) );
				break;
		}

		self::cache_results( $plugins, $install_result, $activate_result );
		self::redirect_to_referer();
	}

	/**
	 * Display the results of installation and activation on the page.
	 *
	 * @param string $plugins Comma separated list of plugins.
	 * @param array  $install_result Result of installation.
	 * @param array  $activate_result Result of activation.
	 */
	public static function cache_results( $plugins, $install_result, $activate_result ) {
		if ( ! $install_result && ! $activate_result ) {
			return;
		}

		if ( is_wp_error( $install_result ) || is_wp_error( $activate_result ) ) {
			$message = $activate_result ? $activate_result->get_error_message() : $install_result->get_error_message();
		} else {
			$message = $activate_result ? $activate_result['message'] : $install_result['message'];
		}

		TransientNotices::add(
			array(
				'user_id' => get_current_user_id(),
				'id'      => 'plugin-installer-' . str_replace( ',', '-', $plugins ),
				'status'  => 'success',
				'content' => $message,
			)
		);
	}

	/**
	 * Redirect back to the referring page if one exists.
	 */
	public static function redirect_to_referer() {
		$referer = wp_get_referer();
		if ( $referer && 0 !== strpos( $referer, wp_login_url() ) ) {
			wp_safe_redirect( $referer );
			exit();
		}

		if ( ! isset( $_SERVER['REQUEST_URI'] ) ) {
			return;
		}

		$url = remove_query_arg( 'plugin_action', wp_unslash( $_SERVER['REQUEST_URI'] ) ); // phpcs:ignore sanitization ok.
		$url = remove_query_arg( 'plugins', $url );
		wp_safe_redirect( $url );
		exit();
	}
}
woocommerce-admin/src/ReportExporter.php000064400000014440151335517650014473 0ustar00<?php
/**
 * Handles reports CSV export.
 */

namespace Automattic\WooCommerce\Admin;

if ( ! defined( 'ABSPATH' ) ) {
	exit;
}

use \Automattic\WooCommerce\Admin\Schedulers\SchedulerTraits;

/**
 * ReportExporter Class.
 */
class ReportExporter {
	/**
	 * Slug to identify the scheduler.
	 *
	 * @var string
	 */
	public static $name = 'report_exporter';

	/**
	 * Scheduler traits.
	 */
	use SchedulerTraits {
		init as scheduler_init;
	}

	/**
	 * Export status option name.
	 */
	const EXPORT_STATUS_OPTION = 'woocommerce_admin_report_export_status';

	/**
	 * Export file download action.
	 */
	const DOWNLOAD_EXPORT_ACTION = 'woocommerce_admin_download_report_csv';

	/**
	 * Get all available scheduling actions.
	 * Used to determine action hook names and clear events.
	 *
	 * @return array
	 */
	public static function get_scheduler_actions() {
		return array(
			'export_report'              => 'woocommerce_admin_report_export',
			'email_report_download_link' => 'woocommerce_admin_email_report_download_link',
		);
	}

	/**
	 * Add action dependencies.
	 *
	 * @return array
	 */
	public static function get_dependencies() {
		return array(
			'email_report_download_link' => self::get_action( 'export_report' ),
		);
	}

	/**
	 * Hook in action methods.
	 */
	public static function init() {
		// Initialize scheduled action handlers.
		self::scheduler_init();

		// Report download handler.
		add_action( 'admin_init', array( __CLASS__, 'download_export_file' ) );
	}

	/**
	 * Queue up actions for a full report export.
	 *
	 * @param string $export_id Unique ID for report (timestamp expected).
	 * @param string $report_type Report type. E.g. 'customers'.
	 * @param array  $report_args Report parameters, passed to data query.
	 * @param bool   $send_email Optional. Send an email when the export is complete.
	 * @return int Number of items to export.
	 */
	public static function queue_report_export( $export_id, $report_type, $report_args = array(), $send_email = false ) {
		$exporter = new ReportCSVExporter( $report_type, $report_args );
		$exporter->prepare_data_to_export();

		$total_rows  = $exporter->get_total_rows();
		$batch_size  = $exporter->get_limit();
		$num_batches = (int) ceil( $total_rows / $batch_size );

		// Create batches, like initial import.
		$report_batch_args = array( $export_id, $report_type, $report_args );

		if ( 0 < $num_batches ) {
			self::queue_batches( 1, $num_batches, 'export_report', $report_batch_args );

			if ( $send_email ) {
				$email_action_args = array( get_current_user_id(), $export_id, $report_type );
				self::schedule_action( 'email_report_download_link', $email_action_args );
			}
		}

		return $total_rows;
	}

	/**
	 * Process a report export action.
	 *
	 * @param int    $page_number Page number for this action.
	 * @param string $export_id Unique ID for report (timestamp expected).
	 * @param string $report_type Report type. E.g. 'customers'.
	 * @param array  $report_args Report parameters, passed to data query.
	 * @return void
	 */
	public static function export_report( $page_number, $export_id, $report_type, $report_args ) {
		$report_args['page'] = $page_number;

		$exporter = new ReportCSVExporter( $report_type, $report_args );
		$exporter->set_filename( "wc-{$report_type}-report-export-{$export_id}" );
		$exporter->generate_file();

		self::update_export_percentage_complete( $report_type, $export_id, $exporter->get_percent_complete() );
	}

	/**
	 * Generate a key to reference an export status.
	 *
	 * @param string $report_type Report type. E.g. 'customers'.
	 * @param string $export_id Unique ID for report (timestamp expected).
	 * @return string Status key.
	 */
	protected static function get_status_key( $report_type, $export_id ) {
		return $report_type . ':' . $export_id;
	}

	/**
	 * Update the completion percentage of a report export.
	 *
	 * @param string $report_type Report type. E.g. 'customers'.
	 * @param string $export_id Unique ID for report (timestamp expected).
	 * @param int    $percentage Completion percentage.
	 * @return void
	 */
	public static function update_export_percentage_complete( $report_type, $export_id, $percentage ) {
		$exports_status = get_option( self::EXPORT_STATUS_OPTION, array() );
		$status_key     = self::get_status_key( $report_type, $export_id );

		$exports_status[ $status_key ] = $percentage;

		update_option( self::EXPORT_STATUS_OPTION, $exports_status );
	}

	/**
	 * Get the completion percentage of a report export.
	 *
	 * @param string $report_type Report type. E.g. 'customers'.
	 * @param string $export_id Unique ID for report (timestamp expected).
	 * @return bool|int Completion percentage, or false if export not found.
	 */
	public static function get_export_percentage_complete( $report_type, $export_id ) {
		$exports_status = get_option( self::EXPORT_STATUS_OPTION, array() );
		$status_key     = self::get_status_key( $report_type, $export_id );

		if ( isset( $exports_status[ $status_key ] ) ) {
			return $exports_status[ $status_key ];
		}

		return false;
	}

	/**
	 * Serve the export file.
	 */
	public static function download_export_file() {
		// @todo - add nonce? (nonces are good for 24 hours)
		if (
			isset( $_GET['action'] ) &&
			! empty( $_GET['filename'] ) &&
			self::DOWNLOAD_EXPORT_ACTION === wp_unslash( $_GET['action'] ) && // WPCS: input var ok, sanitization ok.
			current_user_can( 'view_woocommerce_reports' )
		) {
			$exporter = new ReportCSVExporter();
			$exporter->set_filename( wp_unslash( $_GET['filename'] ) ); // WPCS: input var ok, sanitization ok.
			$exporter->export();
		}
	}

	/**
	 * Process a report export email action.
	 *
	 * @param int    $user_id User ID that requested the email.
	 * @param string $export_id Unique ID for report (timestamp expected).
	 * @param string $report_type Report type. E.g. 'customers'.
	 * @return void
	 */
	public static function email_report_download_link( $user_id, $export_id, $report_type ) {
		$percent_complete = self::get_export_percentage_complete( $report_type, $export_id );

		if ( 100 === $percent_complete ) {
			$query_args   = array(
				'action'   => self::DOWNLOAD_EXPORT_ACTION,
				'filename' => "wc-{$report_type}-report-export-{$export_id}",
			);
			$download_url = add_query_arg( $query_args, admin_url() );

			\WC_Emails::instance();
			$email = new ReportCSVEmail();
			$email->trigger( $user_id, $report_type, $download_url );
		}
	}
}
woocommerce-admin/src/ReportCSVEmail.php000064400000007077151335517650014276 0ustar00<?php
/**
 * Handles emailing users CSV Export download links.
 */

namespace Automattic\WooCommerce\Admin;

if ( ! defined( 'ABSPATH' ) ) {
	exit;
}

/**
 * Include dependencies.
 */
if ( ! class_exists( 'WC_Email', false ) ) {
	include_once WC_ABSPATH . 'includes/emails/class-wc-email.php';
}

/**
 * ReportCSVEmail Class.
 */
class ReportCSVEmail extends \WC_Email {
	/**
	 * Constructor.
	 */
	public function __construct() {
		$this->id             = 'admin_report_export_download';
		$this->template_base  = dirname( __DIR__ ) . '/includes/emails/';
		$this->template_html  = 'html-admin-report-export-download.php';
		$this->template_plain = 'plain-admin-report-export-download.php';
		$this->report_labels  = array(
			'categories' => __( 'Categories', 'woocommerce' ),
			'coupons'    => __( 'Coupons', 'woocommerce' ),
			'customers'  => __( 'Customers', 'woocommerce' ),
			'downloads'  => __( 'Downloads', 'woocommerce' ),
			'orders'     => __( 'Orders', 'woocommerce' ),
			'products'   => __( 'Products', 'woocommerce' ),
			'revenue'    => __( 'Revenue', 'woocommerce' ),
			'stock'      => __( 'Stock', 'woocommerce' ),
			'taxes'      => __( 'Taxes', 'woocommerce' ),
			'variations' => __( 'Variations', 'woocommerce' ),
		);

		// Call parent constructor.
		parent::__construct();
	}

	/**
	 * This email has no user-facing settings.
	 */
	public function init_form_fields() {}

	/**
	 * This email has no user-facing settings.
	 */
	public function init_settings() {}

	/**
	 * Return email type.
	 *
	 * @return string
	 */
	public function get_email_type() {
		return class_exists( 'DOMDocument' ) ? 'html' : 'plain';
	}

	/**
	 * Get email heading.
	 *
	 * @return string
	 */
	public function get_default_heading() {
		return __( 'Your Report Download', 'woocommerce' );
	}

	/**
	 * Get email subject.
	 *
	 * @return string
	 */
	public function get_default_subject() {
		return __( '[{site_title}]: Your {report_name} Report download is ready', 'woocommerce' );
	}

	/**
	 * Get content html.
	 *
	 * @return string
	 */
	public function get_content_html() {
		return wc_get_template_html(
			$this->template_html,
			array(
				'report_name'   => $this->report_type,
				'download_url'  => $this->download_url,
				'email_heading' => $this->get_heading(),
				'sent_to_admin' => true,
				'plain_text'    => false,
				'email'         => $this,
			),
			'',
			$this->template_base
		);
	}

	/**
	 * Get content plain.
	 *
	 * @return string
	 */
	public function get_content_plain() {
		return wc_get_template_html(
			$this->template_plain,
			array(
				'report_name'   => $this->report_type,
				'download_url'  => $this->download_url,
				'email_heading' => $this->get_heading(),
				'sent_to_admin' => true,
				'plain_text'    => true,
				'email'         => $this,
			),
			'',
			$this->template_base
		);
	}

	/**
	 * Trigger the sending of this email.
	 *
	 * @param int    $user_id User ID to email.
	 * @param string $report_type The type of report export being emailed.
	 * @param string $download_url The URL for downloading the report.
	 */
	public function trigger( $user_id, $report_type, $download_url ) {
		$user               = new \WP_User( $user_id );
		$this->recipient    = $user->user_email;
		$this->download_url = $download_url;

		if ( isset( $this->report_labels[ $report_type ] ) ) {
			$this->report_type                   = $this->report_labels[ $report_type ];
			$this->placeholders['{report_name}'] = $this->report_type;
		}

		$this->send(
			$this->get_recipient(),
			$this->get_subject(),
			$this->get_content(),
			$this->get_headers(),
			$this->get_attachments()
		);
	}
}
woocommerce-admin/src/Overrides/Order.php000064400000006617151335517650014513 0ustar00<?php
/**
 * WC Admin Order
 *
 * WC Admin Order class that adds some functionality on top of general WooCommerce WC_Order.
 */

namespace Automattic\WooCommerce\Admin\Overrides;

defined( 'ABSPATH' ) || exit;

use \Automattic\WooCommerce\Admin\API\Reports\Customers\DataStore as CustomersDataStore;
use \Automattic\WooCommerce\Admin\API\Reports\Orders\Stats\DataStore as OrdersStatsDataStore;

/**
 * WC_Order subclass.
 */
class Order extends \WC_Order {
	/**
	 * Order traits.
	 */
	use OrderTraits;

	/**
	 * Holds refund amounts and quantities for the order.
	 *
	 * @var void|array
	 */
	protected $refunded_line_items;

	/**
	 * Get only core class data in array format.
	 *
	 * @return array
	 */
	public function get_data_without_line_items() {
		return array_merge(
			array(
				'id' => $this->get_id(),
			),
			$this->data,
			array(
				'number'         => $this->get_order_number(),
				'meta_data'      => $this->get_meta_data(),
			)
		);
	}

	/**
	 * Get order line item data by type.
	 *
	 * @param string $type Order line item type.
	 * @return array|bool Array of line items on success, boolean false on failure.
	 */
	public function get_line_item_data( $type ) {
		$type_to_items = array(
			'line_items'     => 'line_item',
			'tax_lines'      => 'tax',
			'shipping_lines' => 'shipping',
			'fee_lines'      => 'fee',
			'coupon_lines'   => 'coupon',
		);

		if ( isset( $type_to_items[ $type ] ) ) {
			return $this->get_items( $type_to_items[ $type ] );
		}

		return false;
	}

	/**
	 * Add filter(s) required to hook this class to substitute WC_Order.
	 */
	public static function add_filters() {
		add_filter( 'woocommerce_order_class', array( __CLASS__, 'order_class_name' ), 10, 3 );
	}

	/**
	 * Filter function to swap class WC_Order for this one in cases when it's suitable.
	 *
	 * @param string $classname Name of the class to be created.
	 * @param string $order_type Type of order object to be created.
	 * @param number $order_id Order id to create.
	 *
	 * @return string
	 */
	public static function order_class_name( $classname, $order_type, $order_id ) {
		// @todo - Only substitute class when necessary (during sync).
		if ( 'WC_Order' === $classname ) {
			return '\Automattic\WooCommerce\Admin\Overrides\Order';
		} else {
			return $classname;
		}
	}

	/**
	 * Get the customer ID used for reports in the customer lookup table.
	 *
	 * @return int
	 */
	public function get_report_customer_id() {
		return CustomersDataStore::get_or_create_customer_from_order( $this );
	}

	/**
	 * Returns true if the customer has made an earlier order.
	 *
	 * @return bool
	 */
	public function is_returning_customer() {
		return OrdersStatsDataStore::is_returning_customer( $this );
	}

	/**
	 * Get the customer's first name.
	 */
	public function get_customer_first_name() {
		if ( $this->get_user_id() ) {
			return get_user_meta( $this->get_user_id(), 'first_name', true );
		}

		if ( '' !== $this->get_billing_first_name( 'edit' ) ) {
			return $this->get_billing_first_name( 'edit' );
		} else {
			return $this->get_shipping_first_name( 'edit' );
		}
	}

	/**
	 * Get the customer's last name.
	 */
	public function get_customer_last_name() {
		if ( $this->get_user_id() ) {
			return get_user_meta( $this->get_user_id(), 'last_name', true );
		}

		if ( '' !== $this->get_billing_last_name( 'edit' ) ) {
			return $this->get_billing_last_name( 'edit' );
		} else {
			return $this->get_shipping_last_name( 'edit' );
		}
	}
}
woocommerce-admin/src/Overrides/ThemeUpgrader.php000064400000004004151335517650016160 0ustar00<?php
/**
 * Theme upgrader used in REST API response.
 */

namespace Automattic\WooCommerce\Admin\Overrides;

defined( 'ABSPATH' ) || exit;

/**
 * Admin\Overrides\ThemeUpgrader Class.
 */
class ThemeUpgrader extends \Theme_Upgrader {
	/**
	 * Install a theme package.
	 *
	 * @param string $package The full local path or URI of the package.
	 * @param array  $args {
	 *     Optional. Other arguments for installing a theme package. Default empty array.
	 *
	 *     @type bool $clear_update_cache Whether to clear the updates cache if successful.
	 *                                    Default true.
	 * }
	 *
	 * @return bool|WP_Error True if the installation was successful, false or a WP_Error object otherwise.
	 */
	public function install( $package, $args = array() ) {
		$defaults    = array(
			'clear_update_cache' => true,
		);
		$parsed_args = wp_parse_args( $args, $defaults );

		$this->init();
		$this->install_strings();

		add_filter( 'upgrader_source_selection', array( $this, 'check_package' ) );
		add_filter( 'upgrader_post_install', array( $this, 'check_parent_theme_filter' ), 10, 3 );
		if ( $parsed_args['clear_update_cache'] ) {
			// Clear cache so wp_update_themes() knows about the new theme.
			add_action( 'upgrader_process_complete', 'wp_clean_themes_cache', 9, 0 );
		}

		$result = $this->run(
			array(
				'package'           => $package,
				'destination'       => get_theme_root(),
				'clear_destination' => false, // Do not overwrite files.
				'clear_working'     => true,
				'hook_extra'        => array(
					'type'   => 'theme',
					'action' => 'install',
				),
			)
		);

		remove_action( 'upgrader_process_complete', 'wp_clean_themes_cache', 9 );
		remove_filter( 'upgrader_source_selection', array( $this, 'check_package' ) );
		remove_filter( 'upgrader_post_install', array( $this, 'check_parent_theme_filter' ) );

		if ( $result && ! is_wp_error( $result ) ) {
			// Refresh the Theme Update information.
			wp_clean_themes_cache( $parsed_args['clear_update_cache'] );
		}

		return $result;
	}
}
woocommerce-admin/src/Overrides/OrderRefund.php000064400000003533151335517650015651 0ustar00<?php
/**
 * WC Admin Order Refund
 *
 * WC Admin Order Refund class that adds some functionality on top of general WooCommerce WC_Order_Refund.
 */

namespace Automattic\WooCommerce\Admin\Overrides;

defined( 'ABSPATH' ) || exit;

use \Automattic\WooCommerce\Admin\API\Reports\Customers\DataStore as CustomersDataStore;

/**
 * WC_Order_Refund subclass.
 */
class OrderRefund extends \WC_Order_Refund {
	/**
	 * Order traits.
	 */
	use OrderTraits;

	/**
	 * Add filter(s) required to hook this class to substitute WC_Order_Refund.
	 */
	public static function add_filters() {
		add_filter( 'woocommerce_order_class', array( __CLASS__, 'order_class_name' ), 10, 3 );
	}

	/**
	 * Filter function to swap class WC_Order_Refund for this one in cases when it's suitable.
	 *
	 * @param string $classname Name of the class to be created.
	 * @param string $order_type Type of order object to be created.
	 * @param number $order_id Order id to create.
	 *
	 * @return string
	 */
	public static function order_class_name( $classname, $order_type, $order_id ) {
		// @todo - Only substitute class when necessary (during sync).
		if ( 'WC_Order_Refund' === $classname ) {
			return '\Automattic\WooCommerce\Admin\Overrides\OrderRefund';
		} else {
			return $classname;
		}
	}

	/**
	 * Get the customer ID of the parent order used for reports in the customer lookup table.
	 *
	 * @return int|bool Customer ID of parent order, or false if parent order not found.
	 */
	public function get_report_customer_id() {
		$parent_order = wc_get_order( $this->get_parent_id() );

		if ( ! $parent_order ) {
			return false;
		}

		return CustomersDataStore::get_or_create_customer_from_order( $parent_order );
	}

	/**
	 * Returns null since refunds should not be counted towards returning customer counts.
	 *
	 * @return null
	 */
	public function is_returning_customer() {
		return null;
	}
}
woocommerce-admin/src/Overrides/OrderTraits.php000064400000005077151335517650015701 0ustar00<?php
/**
 * WC Admin Order Trait
 *
 * WC Admin Order Trait class that houses shared functionality across order and refund classes.
 */

namespace Automattic\WooCommerce\Admin\Overrides;

defined( 'ABSPATH' ) || exit;

/**
 * OrderTraits class.
 */
trait OrderTraits {
	/**
	 * Calculate shipping amount for line item/product as a total shipping amount ratio based on quantity.
	 *
	 * @param WC_Order_Item $item Line item from order.
	 *
	 * @return float|int
	 */
	public function get_item_shipping_amount( $item ) {
		// Shipping amount loosely based on woocommerce code in includes/admin/meta-boxes/views/html-order-item(s).php
		// distributed simply based on number of line items.
		$product_qty = $item->get_quantity( 'edit' );
		$order_items = $this->get_item_count();
		if ( 0 === $order_items ) {
			return 0;
		}

		$total_shipping_amount = (float) $this->get_shipping_total();

		return $total_shipping_amount / $order_items * $product_qty;
	}

	/**
	 * Calculate shipping tax amount for line item/product as a total shipping tax amount ratio based on quantity.
	 *
	 * Loosely based on code in includes/admin/meta-boxes/views/html-order-item(s).php.
	 *
	 * @todo If WC is currently not tax enabled, but it was before (or vice versa), would this work correctly?
	 *
	 * @param WC_Order_Item $item Line item from order.
	 *
	 * @return float|int
	 */
	public function get_item_shipping_tax_amount( $item ) {
		$order_items = $this->get_item_count();
		if ( 0 === $order_items ) {
			return 0;
		}

		$product_qty               = $item->get_quantity( 'edit' );
		$order_taxes               = $this->get_taxes();
		$line_items_shipping       = $this->get_items( 'shipping' );
		$total_shipping_tax_amount = 0;
		foreach ( $line_items_shipping as $item_id => $shipping_item ) {
			$tax_data = $shipping_item->get_taxes();
			if ( $tax_data ) {
				foreach ( $order_taxes as $tax_item ) {
					$tax_item_id                = $tax_item->get_rate_id();
					$tax_item_total             = isset( $tax_data['total'][ $tax_item_id ] ) ? (float) $tax_data['total'][ $tax_item_id ] : 0;
					$total_shipping_tax_amount += $tax_item_total;
				}
			}
		}
		return $total_shipping_tax_amount / $order_items * $product_qty;
	}

	/**
	 * Calculates coupon amount for specified line item/product.
	 *
	 * Coupon calculation based on woocommerce code in includes/admin/meta-boxes/views/html-order-item.php.
	 *
	 * @param WC_Order_Item $item Line item from order.
	 *
	 * @return float
	 */
	public function get_item_coupon_amount( $item ) {
		return floatval( $item->get_subtotal( 'edit' ) - $item->get_total( 'edit' ) );
	}
}
woocommerce-admin/src/Overrides/ThemeUpgraderSkin.php000064400000001446151335517650017014 0ustar00<?php
/**
 * Theme upgrader skin used in REST API response.
 */

namespace Automattic\WooCommerce\Admin\Overrides;

defined( 'ABSPATH' ) || exit;

/**
 * Admin\Overrides\ThemeUpgraderSkin Class.
 */
class ThemeUpgraderSkin extends \Theme_Upgrader_Skin {
	/**
	 * Avoid undefined property error from \Theme_Upgrader::check_parent_theme_filter().
	 *
	 * @var array
	 */
	public $api;

	/**
	 * Hide the skin header display.
	 */
	public function header() {}

	/**
	 * Hide the skin footer display.
	 */
	public function footer() {}

	/**
	 * Hide the skin feedback display.
	 *
	 * @param string $string String to display.
	 * @param mixed  ...$args Optional text replacements.
	 */
	public function feedback( $string, ...$args ) {}

	/**
	 * Hide the skin after display.
	 */
	public function after() {}
}
woocommerce-admin/src/API/OnboardingTasks.php000064400000077700151335517650015200 0ustar00<?php
/**
 * REST API Onboarding Tasks Controller
 *
 * Handles requests to complete various onboarding tasks.
 */

namespace Automattic\WooCommerce\Admin\API;

use Automattic\WooCommerce\Admin\Features\Onboarding;
use Automattic\WooCommerce\Admin\Features\OnboardingTasks\Init as OnboardingTasksFeature;
use Automattic\WooCommerce\Admin\Features\OnboardingTasks\TaskLists;

defined( 'ABSPATH' ) || exit;

/**
 * Onboarding Tasks Controller.
 *
 * @extends WC_REST_Data_Controller
 */
class OnboardingTasks extends \WC_REST_Data_Controller {
	/**
	 * Endpoint namespace.
	 *
	 * @var string
	 */
	protected $namespace = 'wc-admin';

	/**
	 * Route base.
	 *
	 * @var string
	 */
	protected $rest_base = 'onboarding/tasks';

	/**
	 * Duration to milisecond mapping.
	 *
	 * @var string
	 */
	protected $duration_to_ms = array(
		'day'  => DAY_IN_SECONDS * 1000,
		'hour' => HOUR_IN_SECONDS * 1000,
		'week' => WEEK_IN_SECONDS * 1000,
	);

	/**
	 * Register routes.
	 */
	public function register_routes() {
		register_rest_route(
			$this->namespace,
			'/' . $this->rest_base . '/import_sample_products',
			array(
				array(
					'methods'             => \WP_REST_Server::CREATABLE,
					'callback'            => array( $this, 'import_sample_products' ),
					'permission_callback' => array( $this, 'create_products_permission_check' ),
				),
				'schema' => array( $this, 'get_public_item_schema' ),
			)
		);

		register_rest_route(
			$this->namespace,
			'/' . $this->rest_base . '/create_homepage',
			array(
				array(
					'methods'             => \WP_REST_Server::CREATABLE,
					'callback'            => array( $this, 'create_homepage' ),
					'permission_callback' => array( $this, 'create_pages_permission_check' ),
				),
				'schema' => array( $this, 'get_public_item_schema' ),
			)
		);

		register_rest_route(
			$this->namespace,
			'/' . $this->rest_base . '/status',
			array(
				array(
					'methods'             => \WP_REST_Server::READABLE,
					'callback'            => array( $this, 'get_status' ),
					'permission_callback' => array( $this, 'get_status_permission_check' ),
				),
				'schema' => array( $this, 'get_status_item_schema' ),
			)
		);

		register_rest_route(
			$this->namespace,
			'/' . $this->rest_base . '/create_product_from_template',
			array(
				array(
					'methods'             => \WP_REST_Server::CREATABLE,
					'callback'            => array( $this, 'create_product_from_template' ),
					'permission_callback' => array( $this, 'create_products_permission_check' ),
					'args'                => array_merge(
						$this->get_endpoint_args_for_item_schema( \WP_REST_Server::CREATABLE ),
						array(
							'template_name' => array(
								'required'    => true,
								'type'        => 'string',
								'description' => __( 'Product template name.', 'woocommerce' ),
							),
						)
					),
				),
				'schema' => array( $this, 'get_public_item_schema' ),
			)
		);

		register_rest_route(
			$this->namespace,
			'/' . $this->rest_base,
			array(
				array(
					'methods'             => \WP_REST_Server::READABLE,
					'callback'            => array( $this, 'get_tasks' ),
					'permission_callback' => array( $this, 'get_tasks_permission_check' ),
				),
				'schema' => array( $this, 'get_public_item_schema' ),
			)
		);

		register_rest_route(
			$this->namespace,
			'/' . $this->rest_base . '/(?P<id>[a-z0-9_\-]+)/hide',
			array(
				array(
					'methods'             => \WP_REST_Server::EDITABLE,
					'callback'            => array( $this, 'hide_task_list' ),
					'permission_callback' => array( $this, 'hide_task_list_permission_check' ),
				),
				'schema' => array( $this, 'get_public_item_schema' ),
			)
		);

		register_rest_route(
			$this->namespace,
			'/' . $this->rest_base . '/(?P<id>[a-z0-9_\-]+)/dismiss',
			array(
				array(
					'methods'             => \WP_REST_Server::EDITABLE,
					'callback'            => array( $this, 'dismiss_task' ),
					'permission_callback' => array( $this, 'get_tasks_permission_check' ),
				),
				'schema' => array( $this, 'get_public_item_schema' ),
			)
		);

		register_rest_route(
			$this->namespace,
			'/' . $this->rest_base . '/(?P<id>[a-z0-9_\-]+)/undo_dismiss',
			array(
				array(
					'methods'             => \WP_REST_Server::EDITABLE,
					'callback'            => array( $this, 'undo_dismiss_task' ),
					'permission_callback' => array( $this, 'get_tasks_permission_check' ),
				),
				'schema' => array( $this, 'get_public_item_schema' ),
			)
		);

		register_rest_route(
			$this->namespace,
			'/' . $this->rest_base . '/(?P<id>[a-z0-9_-]+)/snooze',
			array(
				'args'   => array(
					'duration'     => array(
						'description'       => __( 'Time period to snooze the task.', 'woocommerce' ),
						'type'              => 'string',
						'validate_callback' => function( $param, $request, $key ) {
							return in_array( $param, array_keys( $this->duration_to_ms ), true );
						},
					),
					'task_list_id' => array(
						'description' => __( 'Optional parameter to query specific task list.', 'woocommerce' ),
						'type'        => 'string',
					),
				),
				array(
					'methods'             => \WP_REST_Server::CREATABLE,
					'callback'            => array( $this, 'snooze_task' ),
					'permission_callback' => array( $this, 'snooze_task_permissions_check' ),
				),
				'schema' => array( $this, 'get_public_item_schema' ),
			)
		);

		register_rest_route(
			$this->namespace,
			'/' . $this->rest_base . '/(?P<id>[a-z0-9_\-]+)/undo_snooze',
			array(
				array(
					'methods'             => \WP_REST_Server::EDITABLE,
					'callback'            => array( $this, 'undo_snooze_task' ),
					'permission_callback' => array( $this, 'snooze_task_permissions_check' ),
				),
				'schema' => array( $this, 'get_public_item_schema' ),
			)
		);
	}

	/**
	 * Check if a given request has access to create a product.
	 *
	 * @param  WP_REST_Request $request Full details about the request.
	 * @return WP_Error|boolean
	 */
	public function create_products_permission_check( $request ) {
		if ( ! wc_rest_check_post_permissions( 'product', 'create' ) ) {
			return new \WP_Error( 'woocommerce_rest_cannot_create', __( 'Sorry, you are not allowed to create resources.', 'woocommerce' ), array( 'status' => rest_authorization_required_code() ) );
		}

		return true;
	}

	/**
	 * Check if a given request has access to create a product.
	 *
	 * @param  WP_REST_Request $request Full details about the request.
	 * @return WP_Error|boolean
	 */
	public function create_pages_permission_check( $request ) {
		if ( ! wc_rest_check_post_permissions( 'page', 'create' ) || ! current_user_can( 'manage_options' ) ) {
			return new \WP_Error( 'woocommerce_rest_cannot_create', __( 'Sorry, you are not allowed to create new pages.', 'woocommerce' ), array( 'status' => rest_authorization_required_code() ) );
		}

		return true;
	}

	/**
	 * Check if a given request has access to get onboarding tasks status.
	 *
	 * @param  WP_REST_Request $request Full details about the request.
	 * @return WP_Error|boolean
	 */
	public function get_status_permission_check( $request ) {
		if ( ! current_user_can( 'manage_options' ) ) {
			return new \WP_Error( 'woocommerce_rest_cannot_create', __( 'Sorry, you are not allowed to retrieve onboarding status.', 'woocommerce' ), array( 'status' => rest_authorization_required_code() ) );
		}

		return true;
	}

	/**
	 * Check if a given request has access to manage woocommerce.
	 *
	 * @param  WP_REST_Request $request Full details about the request.
	 * @return WP_Error|boolean
	 */
	public function get_tasks_permission_check( $request ) {
		if ( ! current_user_can( 'manage_woocommerce' ) ) {
			return new \WP_Error( 'woocommerce_rest_cannot_create', __( 'Sorry, you are not allowed to retrieve onboarding tasks.', 'woocommerce' ), array( 'status' => rest_authorization_required_code() ) );
		}

		return true;
	}

	/**
	 * Check if a given request has permission to hide task lists.
	 *
	 * @param  WP_REST_Request $request Full details about the request.
	 * @return WP_Error|boolean
	 */
	public function hide_task_list_permission_check( $request ) {
		if ( ! current_user_can( 'manage_woocommerce' ) ) {
			return new \WP_Error( 'woocommerce_rest_cannot_update', __( 'Sorry, you are not allowed to hide task lists.', 'woocommerce' ), array( 'status' => rest_authorization_required_code() ) );
		}

		return true;
	}

	/**
	 * Check if a given request has access to manage woocommerce.
	 *
	 * @param  WP_REST_Request $request Full details about the request.
	 * @return WP_Error|boolean
	 */
	public function snooze_task_permissions_check( $request ) {
		if ( ! current_user_can( 'manage_woocommerce' ) ) {
			return new \WP_Error( 'woocommerce_rest_cannot_create', __( 'Sorry, you are not allowed to snooze onboarding tasks.', 'woocommerce' ), array( 'status' => rest_authorization_required_code() ) );
		}

		return true;
	}

	/**
	 * Import sample products from given CSV path.
	 *
	 * @param  string $csv_file CSV file path.
	 * @return WP_Error|WP_REST_Response
	 */
	public static function import_sample_products_from_csv( $csv_file ) {
		include_once WC_ABSPATH . 'includes/import/class-wc-product-csv-importer.php';

		if ( file_exists( $csv_file ) && class_exists( 'WC_Product_CSV_Importer' ) ) {
			// Override locale so we can return mappings from WooCommerce in English language stores.
			add_filter( 'locale', '__return_false', 9999 );
			$importer_class = apply_filters( 'woocommerce_product_csv_importer_class', 'WC_Product_CSV_Importer' );
			$args           = array(
				'parse'   => true,
				'mapping' => self::get_header_mappings( $csv_file ),
			);
			$args           = apply_filters( 'woocommerce_product_csv_importer_args', $args, $importer_class );

			$importer = new $importer_class( $csv_file, $args );
			$import   = $importer->import();
			return $import;
		} else {
			return new \WP_Error( 'woocommerce_rest_import_error', __( 'Sorry, the sample products data file was not found.', 'woocommerce' ) );
		}
	}

	/**
	 * Import sample products from WooCommerce sample CSV.
	 *
	 * @return WP_Error|WP_REST_Response
	 */
	public static function import_sample_products() {
		$sample_csv_file = WC_ABSPATH . 'sample-data/sample_products.csv';

		$import = self::import_sample_products_from_csv( $sample_csv_file );
		return rest_ensure_response( $import );
	}


	/**
	 * Creates a product from a template name passed in through the template_name param.
	 *
	 * @param WP_REST_Request $request Request data.
	 * @return WP_REST_Response|WP_Error
	 */
	public static function create_product_from_template( $request ) {
		$template_name = $request->get_param( 'template_name' );
		$template_path = __DIR__ . '/Templates/' . $template_name . '_product.csv';
		$template_path = apply_filters( 'woocommerce_product_template_csv_file_path', $template_path, $template_name );

		$import = self::import_sample_products_from_csv( $template_path );

		if ( is_wp_error( $import ) || 0 === count( $import['imported'] ) ) {
			return new \WP_Error(
				'woocommerce_rest_product_creation_error',
				/* translators: %s is template name */
				__( 'Sorry, creating the product with template failed.', 'woocommerce' ),
				array( 'status' => 500 )
			);
		}
		$product = wc_get_product( $import['imported'][0] );
		$product->set_status( 'auto-draft' );
		$product->save();

		return rest_ensure_response(
			array(
				'id' => $product->get_id(),
			)
		);
	}


	/**
	 * Get header mappings from CSV columns.
	 *
	 * @param string $file File path.
	 * @return array Mapped headers.
	 */
	public static function get_header_mappings( $file ) {
		include_once WC_ABSPATH . 'includes/admin/importers/mappings/mappings.php';

		$importer_class  = apply_filters( 'woocommerce_product_csv_importer_class', 'WC_Product_CSV_Importer' );
		$importer        = new $importer_class( $file, array() );
		$raw_headers     = $importer->get_raw_keys();
		$default_columns = wc_importer_default_english_mappings( array() );
		$special_columns = wc_importer_default_special_english_mappings( array() );

		$headers = array();
		foreach ( $raw_headers as $key => $field ) {
			$index             = $field;
			$headers[ $index ] = $field;

			if ( isset( $default_columns[ $field ] ) ) {
				$headers[ $index ] = $default_columns[ $field ];
			} else {
				foreach ( $special_columns as $regex => $special_key ) {
					if ( preg_match( self::sanitize_special_column_name_regex( $regex ), $field, $matches ) ) {
						$headers[ $index ] = $special_key . $matches[1];
						break;
					}
				}
			}
		}

		return $headers;
	}

	/**
	 * Sanitize special column name regex.
	 *
	 * @param  string $value Raw special column name.
	 * @return string
	 */
	public static function sanitize_special_column_name_regex( $value ) {
		return '/' . str_replace( array( '%d', '%s' ), '(.*)', trim( quotemeta( $value ) ) ) . '/';
	}

	/**
	 * Returns a valid cover block with an image, if one exists, or background as a fallback.
	 *
	 * @param  array $image Image to use for the cover block. Should contain a media ID and image URL.
	 * @return string Block content.
	 */
	private static function get_homepage_cover_block( $image ) {
		$shop_url = get_permalink( wc_get_page_id( 'shop' ) );
		if ( ! empty( $image['url'] ) && ! empty( $image['id'] ) ) {
			return '<!-- wp:cover {"url":"' . esc_url( $image['url'] ) . '","id":' . intval( $image['id'] ) . ',"dimRatio":0} -->
			<div class="wp-block-cover" style="background-image:url(' . esc_url( $image['url'] ) . ')"><div class="wp-block-cover__inner-container"><!-- wp:paragraph {"align":"center","placeholder":"' . __( 'Write title…', 'woocommerce' ) . '","textColor":"white","fontSize":"large"} -->
			<p class="has-text-align-center has-large-font-size">' . __( 'Welcome to the store', 'woocommerce' ) . '</p>
			<!-- /wp:paragraph -->

			<!-- wp:paragraph {"align":"center","textColor":"white"} -->
			<p class="has-text-color has-text-align-center">' . __( 'Write a short welcome message here', 'woocommerce' ) . '</p>
			<!-- /wp:paragraph -->

			<!-- wp:button {"align":"center"} -->
			<div class="wp-block-button aligncenter"><a href="' . esc_url( $shop_url ) . '" class="wp-block-button__link">' . __( 'Go shopping', 'woocommerce' ) . '</a></div>
			<!-- /wp:button --></div></div>
			<!-- /wp:cover -->';
		}

		return '<!-- wp:cover {"dimRatio":0} -->
		<div class="wp-block-cover"><div class="wp-block-cover__inner-container"><!-- wp:paragraph {"align":"center","placeholder":"' . __( 'Write title…', 'woocommerce' ) . '","textColor":"white","fontSize":"large"} -->
		<p class="has-text-color has-text-align-center has-large-font-size">' . __( 'Welcome to the store', 'woocommerce' ) . '</p>
		<!-- /wp:paragraph -->

		<!-- wp:paragraph {"align":"center","textColor":"white"} -->
		<p class="has-text-color has-text-align-center">' . __( 'Write a short welcome message here', 'woocommerce' ) . '</p>
		<!-- /wp:paragraph -->

		<!-- wp:button {"align":"center"} -->
		<div class="wp-block-button aligncenter"><a href="' . esc_url( $shop_url ) . '" class="wp-block-button__link">' . __( 'Go shopping', 'woocommerce' ) . '</a></div>
		<!-- /wp:button --></div></div>
		<!-- /wp:cover -->';
	}

	/**
	 * Returns a valid media block with an image, if one exists, or a uninitialized media block the user can set.
	 *
	 * @param  array  $image Image to use for the cover block. Should contain a media ID and image URL.
	 * @param  string $align If the image should be aligned to the left or right.
	 * @return string Block content.
	 */
	private static function get_homepage_media_block( $image, $align = 'left' ) {
		$media_position = 'right' === $align ? '"mediaPosition":"right",' : '';
		$css_class      = 'right' === $align ? ' has-media-on-the-right' : '';

		if ( ! empty( $image['url'] ) && ! empty( $image['id'] ) ) {
			return '<!-- wp:media-text {' . $media_position . '"mediaId":' . intval( $image['id'] ) . ',"mediaType":"image"} -->
			<div class="wp-block-media-text alignwide' . $css_class . '""><figure class="wp-block-media-text__media"><img src="' . esc_url( $image['url'] ) . '" alt="" class="wp-image-' . intval( $image['id'] ) . '"/></figure><div class="wp-block-media-text__content"><!-- wp:paragraph {"placeholder":"' . __( 'Content…', 'woocommerce' ) . '","fontSize":"large"} -->
			<p class="has-large-font-size"></p>
			<!-- /wp:paragraph --></div></div>
			<!-- /wp:media-text -->';
		}

		return '<!-- wp:media-text {' . $media_position . '} -->
		<div class="wp-block-media-text alignwide' . $css_class . '"><figure class="wp-block-media-text__media"></figure><div class="wp-block-media-text__content"><!-- wp:paragraph {"placeholder":"' . __( 'Content…', 'woocommerce' ) . '","fontSize":"large"} -->
		<p class="has-large-font-size"></p>
		<!-- /wp:paragraph --></div></div>
		<!-- /wp:media-text -->';
	}

	/**
	 * Returns a homepage template to be inserted into a post. A different template will be used depending on the number of products.
	 *
	 * @param int $post_id ID of the homepage template.
	 * @return string Template contents.
	 */
	private static function get_homepage_template( $post_id ) {
		$products = wp_count_posts( 'product' );
		if ( $products->publish >= 4 ) {
			$images   = self::sideload_homepage_images( $post_id, 1 );
			$image_1  = ! empty( $images[0] ) ? $images[0] : '';
			$template = self::get_homepage_cover_block( $image_1 ) . '
				<!-- wp:heading {"align":"center"} -->
				<h2 style="text-align:center">' . __( 'Shop by Category', 'woocommerce' ) . '</h2>
				<!-- /wp:heading -->
				<!-- wp:shortcode -->
				[product_categories number="0" parent="0"]
				<!-- /wp:shortcode -->
				<!-- wp:heading {"align":"center"} -->
				<h2 style="text-align:center">' . __( 'New In', 'woocommerce' ) . '</h2>
				<!-- /wp:heading -->
				<!-- wp:woocommerce/product-new {"columns":4} /-->
				<!-- wp:heading {"align":"center"} -->
				<h2 style="text-align:center">' . __( 'Fan Favorites', 'woocommerce' ) . '</h2>
				<!-- /wp:heading -->
				<!-- wp:woocommerce/product-top-rated {"columns":4} /-->
				<!-- wp:heading {"align":"center"} -->
				<h2 style="text-align:center">' . __( 'On Sale', 'woocommerce' ) . '</h2>
				<!-- /wp:heading -->
				<!-- wp:woocommerce/product-on-sale {"columns":4} /-->
				<!-- wp:heading {"align":"center"} -->
				<h2 style="text-align:center">' . __( 'Best Sellers', 'woocommerce' ) . '</h2>
				<!-- /wp:heading -->
				<!-- wp:woocommerce/product-best-sellers {"columns":4} /-->
			';

			/**
			 * Modify the template/content of the default homepage.
			 *
			 * @param string $template The default homepage template.
			 */
			return apply_filters( 'woocommerce_admin_onboarding_homepage_template', $template );
		}

		$images   = self::sideload_homepage_images( $post_id, 3 );
		$image_1  = ! empty( $images[0] ) ? $images[0] : '';
		$image_2  = ! empty( $images[1] ) ? $images[1] : '';
		$image_3  = ! empty( $images[2] ) ? $images[2] : '';
		$template = self::get_homepage_cover_block( $image_1 ) . '
		<!-- wp:heading {"align":"center"} -->
		<h2 style="text-align:center">' . __( 'New Products', 'woocommerce' ) . '</h2>
		<!-- /wp:heading -->

		<!-- wp:woocommerce/product-new /--> ' .

		self::get_homepage_media_block( $image_1, 'right' ) .
		self::get_homepage_media_block( $image_2, 'left' ) .
		self::get_homepage_media_block( $image_3, 'right' ) . '

		<!-- wp:woocommerce/featured-product /-->';

		/** This filter is documented in src/API/OnboardingTasks.php. */
		return apply_filters( 'woocommerce_admin_onboarding_homepage_template', $template );
	}

	/**
	 * Gets the possible industry images from the plugin folder for sideloading. If an image doesn't exist, other.jpg is used a fallback.
	 *
	 * @return array An array of images by industry.
	 */
	private static function get_available_homepage_images() {
		$industry_images = array();
		$industries      = Onboarding::get_allowed_industries();
		foreach ( $industries as $industry_slug => $label ) {
			$industry_images[ $industry_slug ] = apply_filters( 'woocommerce_admin_onboarding_industry_image', plugins_url( 'images/onboarding/other-small.jpg', WC_ADMIN_PLUGIN_FILE ), $industry_slug );
		}
		return $industry_images;
	}

	/**
	 * Uploads a number of images to a homepage template, depending on the selected industry from the profile wizard.
	 *
	 * @param  int $post_id ID of the homepage template.
	 * @param  int $number_of_images The number of images that should be sideloaded (depending on how many media slots are in the template).
	 * @return array An array of images that have been attached to the post.
	 */
	private static function sideload_homepage_images( $post_id, $number_of_images ) {
		$profile            = get_option( Onboarding::PROFILE_DATA_OPTION, array() );
		$images_to_sideload = array();
		$available_images   = self::get_available_homepage_images();

		require_once ABSPATH . 'wp-admin/includes/image.php';
		require_once ABSPATH . 'wp-admin/includes/file.php';
		require_once ABSPATH . 'wp-admin/includes/media.php';

		if ( ! empty( $profile['industry'] ) ) {
			foreach ( $profile['industry'] as $selected_industry ) {
				if ( is_string( $selected_industry ) ) {
					$industry_slug = $selected_industry;
				} elseif ( is_array( $selected_industry ) && ! empty( $selected_industry['slug'] ) ) {
					$industry_slug = $selected_industry['slug'];
				} else {
					continue;
				}
				// Capture the first industry for use in our minimum images logic.
				$first_industry       = isset( $first_industry ) ? $first_industry : $industry_slug;
				$images_to_sideload[] = ! empty( $available_images[ $industry_slug ] ) ? $available_images[ $industry_slug ] : $available_images['other'];
			}
		}

		// Make sure we have at least {$number_of_images} images.
		if ( count( $images_to_sideload ) < $number_of_images ) {
			for ( $i = count( $images_to_sideload ); $i < $number_of_images; $i++ ) {
				// Fill up missing image slots with the first selected industry, or other.
				$industry             = isset( $first_industry ) ? $first_industry : 'other';
				$images_to_sideload[] = empty( $available_images[ $industry ] ) ? $available_images['other'] : $available_images[ $industry ];
			}
		}

		$already_sideloaded = array();
		$images_for_post    = array();
		foreach ( $images_to_sideload as $image ) {
			// Avoid uploading two of the same image, if an image is repeated.
			if ( ! empty( $already_sideloaded[ $image ] ) ) {
				$images_for_post[] = $already_sideloaded[ $image ];
				continue;
			}

			$sideload_id = \media_sideload_image( $image, $post_id, null, 'id' );
			if ( ! is_wp_error( $sideload_id ) ) {
				$sideload_url                 = wp_get_attachment_url( $sideload_id );
				$already_sideloaded[ $image ] = array(
					'id'  => $sideload_id,
					'url' => $sideload_url,
				);
				$images_for_post[]            = $already_sideloaded[ $image ];
			}
		}

		return $images_for_post;
	}

	/**
	 * Create a homepage from a template.
	 *
	 * @return WP_Error|array
	 */
	public static function create_homepage() {
		$post_id = wp_insert_post(
			array(
				'post_title'   => __( 'Homepage', 'woocommerce' ),
				'post_type'    => 'page',
				'post_status'  => 'publish',
				'post_content' => '', // Template content is updated below, so images can be attached to the post.
			)
		);

		if ( ! is_wp_error( $post_id ) && 0 < $post_id ) {

			$template = self::get_homepage_template( $post_id );
			wp_update_post(
				array(
					'ID'           => $post_id,
					'post_content' => $template,
				)
			);

			update_option( 'show_on_front', 'page' );
			update_option( 'page_on_front', $post_id );
			update_option( 'woocommerce_onboarding_homepage_post_id', $post_id );

			// Use the full width template on stores using Storefront.
			if ( 'storefront' === get_stylesheet() ) {
				update_post_meta( $post_id, '_wp_page_template', 'template-fullwidth.php' );
			}

			return array(
				'status'         => 'success',
				'message'        => __( 'Homepage created', 'woocommerce' ),
				'post_id'        => $post_id,
				'edit_post_link' => htmlspecialchars_decode( get_edit_post_link( $post_id ) ),
			);
		} else {
			return $post_id;
		}
	}

	/**
	 * Get the status endpoint schema, conforming to JSON Schema.
	 *
	 * @return array
	 */
	public function get_status_item_schema() {
		$schema = array(
			'$schema'    => 'http://json-schema.org/draft-04/schema#',
			'title'      => 'Onboarding Task Status',
			'type'       => 'object',
			'properties' => array(
				'automatedTaxSupportedCountries' => array(
					'type'        => 'array',
					'description' => __( 'Country codes that support Automated Taxes.', 'woocommerce' ),
					'context'     => array( 'view' ),
					'readonly'    => true,
					'items'       => array(
						'type' => 'string',
					),
				),
				'hasHomepage'                    => array(
					'type'        => 'boolean',
					'description' => __( 'If the store has a homepage created.', 'woocommerce' ),
					'context'     => array( 'view' ),
					'readonly'    => true,
				),
				'hasPaymentGateway'              => array(
					'type'        => 'boolean',
					'description' => __( 'If the store has an enabled payment gateway.', 'woocommerce' ),
					'context'     => array( 'view' ),
					'readonly'    => true,
				),
				'hasPhysicalProducts'            => array(
					'type'        => 'boolean',
					'description' => __( 'If the store has any physical (non-virtual) products.', 'woocommerce' ),
					'context'     => array( 'view' ),
					'readonly'    => true,
				),
				'hasProducts'                    => array(
					'type'        => 'boolean',
					'description' => __( 'If the store has any products.', 'woocommerce' ),
					'context'     => array( 'view' ),
					'readonly'    => true,
				),
				'isTaxComplete'                  => array(
					'type'        => 'boolean',
					'description' => __( 'If the tax step has been completed.', 'woocommerce' ),
					'context'     => array( 'view' ),
					'readonly'    => true,
				),
				'shippingZonesCount'             => array(
					'type'        => 'number',
					'description' => __( 'The number of shipping zones configured for the store.', 'woocommerce' ),
					'context'     => array( 'view' ),
					'readonly'    => true,
				),
				'taxJarActivated'                => array(
					'type'        => 'boolean',
					'description' => __( 'If the store has the TaxJar extension active.', 'woocommerce' ),
					'context'     => array( 'view' ),
					'readonly'    => true,
				),
				'themeMods'                      => array(
					'type'        => 'object',
					'description' => __( 'Active theme modifications.', 'woocommerce' ),
					'context'     => array( 'view' ),
					'readonly'    => true,
				),
				'wcPayIsConnected'               => array(
					'type'        => 'boolean',
					'description' => __( 'If the store is using WooCommerce Payments.', 'woocommerce' ),
					'context'     => array( 'view' ),
					'readonly'    => true,
				),
			),
		);

		return $this->add_additional_fields_schema( $schema );
	}

	/**
	 * Get various onboarding task statuses.
	 *
	 * @return WP_Error|array
	 */
	public function get_status() {
		$status = OnboardingTasksFeature::get_settings();

		return rest_ensure_response( $status );
	}

	/**
	 * Get the onboarding tasks.
	 *
	 * @return WP_REST_Response|WP_Error
	 */
	public function get_tasks() {
		$lists = TaskLists::get_lists();
		$json  = array_map(
			function( $list ) {
				return $list->get_json();
			},
			$lists
		);
		return rest_ensure_response( array_values( apply_filters( 'woocommerce_admin_onboarding_tasks', $json ) ) );
	}

	/**
	 * Dismiss a single task.
	 *
	 * @param WP_REST_Request $request Full details about the request.
	 * @return WP_REST_Request|WP_Error
	 */
	public function dismiss_task( $request ) {
		$id = $request->get_param( 'id' );

		$is_dismissable = false;

		$task = TaskLists::get_task( $id );

		if ( $task && isset( $task['isDismissable'] ) && $task['isDismissable'] ) {
			$is_dismissable = true;
		}

		if ( ! $is_dismissable ) {
			return new \WP_Error(
				'woocommerce_rest_invalid_task',
				__( 'Sorry, no dismissable task with that ID was found.', 'woocommerce' ),
				array(
					'status' => 404,
				)
			);
		}

		$dismissed   = get_option( 'woocommerce_task_list_dismissed_tasks', array() );
		$dismissed[] = $id;
		$update      = update_option( 'woocommerce_task_list_dismissed_tasks', array_unique( $dismissed ) );

		if ( $update ) {
			wc_admin_record_tracks_event( 'tasklist_dismiss_task', array( 'task_name' => $id ) );
		}

		$task = TaskLists::get_task( $id );

		return rest_ensure_response( $task );
	}

	/**
	 * Undo dismissal of a single task.
	 *
	 * @param WP_REST_Request $request Full details about the request.
	 * @return WP_REST_Request|WP_Error
	 */
	public function undo_dismiss_task( $request ) {
		$id = $request->get_param( 'id' );

		$dismissed = get_option( 'woocommerce_task_list_dismissed_tasks', array() );
		$dismissed = array_diff( $dismissed, array( $id ) );
		$update    = update_option( 'woocommerce_task_list_dismissed_tasks', $dismissed );

		if ( $update ) {
			wc_admin_record_tracks_event( 'tasklist_undo_dismiss_task', array( 'task_name' => $id ) );
		}

		$task = TaskLists::get_task( $id );

		return rest_ensure_response( $task );
	}

	/**
	 * Snooze an onboarding task.
	 *
	 * @param WP_REST_Request $request Request data.
	 *
	 * @return WP_REST_Response|WP_Error
	 */
	public function snooze_task( $request ) {
		$task_id         = $request->get_param( 'id' );
		$task_list_id    = $request->get_param( 'task_list_id' );
		$snooze_duration = $request->get_param( 'duration' );

		$is_snoozeable = false;

		$snooze_task = TaskLists::get_task( $task_id, $task_list_id );

		if ( $snooze_task && isset( $snooze_task['isSnoozeable'] ) && $snooze_task['isSnoozeable'] ) {
			$is_snoozeable = true;
		}

		if ( ! $is_snoozeable ) {
			return new \WP_Error(
				'woocommerce_tasks_invalid_task',
				__( 'Sorry, no snoozeable task with that ID was found.', 'woocommerce' ),
				array(
					'status' => 404,
				)
			);
		}

		$snooze_option = get_option( 'woocommerce_task_list_remind_me_later_tasks', array() );
		$duration      = is_null( $snooze_duration ) ? 'day' : $snooze_duration;
		$snoozed_until = $this->duration_to_ms[ $duration ] + ( time() * 1000 );

		$snooze_option[ $task_id ] = $snoozed_until;
		$update                    = update_option( 'woocommerce_task_list_remind_me_later_tasks', $snooze_option );

		if ( $update ) {
			wc_admin_record_tracks_event( 'tasklist_remindmelater_task', array( 'task_name' => $task_id ) );
			$snooze_task['isSnoozed']    = true;
			$snooze_task['snoozedUntil'] = $snoozed_until;
		}

		return rest_ensure_response( $snooze_task );
	}

	/**
	 * Undo snooze of a single task.
	 *
	 * @param WP_REST_Request $request Full details about the request.
	 * @return WP_REST_Request|WP_Error
	 */
	public function undo_snooze_task( $request ) {
		$id = $request->get_param( 'id' );

		$snoozed = get_option( 'woocommerce_task_list_remind_me_later_tasks', array() );

		if ( ! isset( $snoozed[ $id ] ) ) {
			return new \WP_Error(
				'woocommerce_tasks_invalid_task',
				__( 'Sorry, no snoozed task with that ID was found.', 'woocommerce' ),
				array(
					'status' => 404,
				)
			);
		}

		unset( $snoozed[ $id ] );

		$update = update_option( 'woocommerce_task_list_remind_me_later_tasks', $snoozed );

		if ( $update ) {
			wc_admin_record_tracks_event( 'tasklist_undo_remindmelater_task', array( 'task_name' => $id ) );
		}

		return rest_ensure_response( TaskLists::get_task( $id ) );
	}

	/**
	 * Hide a task list.
	 *
	 * @param WP_REST_Request $request Request data.
	 *
	 * @return WP_REST_Response|WP_Error
	 */
	public function hide_task_list( $request ) {
		$id        = $request->get_param( 'id' );
		$task_list = TaskLists::get_list( $id );

		if ( ! $task_list ) {
			return new \WP_Error(
				'woocommerce_tasks_invalid_task_list',
				__( 'Sorry, that task list was not found', 'woocommerce' ),
				array(
					'status' => 404,
				)
			);
		}

		$update = $task_list->hide();
		$json   = $task_list->get_json();

		if ( $update ) {
			$completed_task_count = array_reduce(
				$json['tasks'],
				function( $total, $task ) {
					return $task['isComplete'] ? $total + 1 : $total;
				},
				0
			);

			wc_admin_record_tracks_event(
				$id . '_completed',
				array(
					'action'                => 'remove_card',
					'completed_task_count'  => $completed_task_count,
					'incomplete_task_count' => count( $json['tasks'] ) - $completed_task_count,
				)
			);
		}

		return rest_ensure_response( $json );
	}

}
woocommerce-admin/src/API/DataCountries.php000064400000000702151335517650014641 0ustar00<?php
/**
 * REST API Data countries controller.
 *
 * Handles requests to the /data/countries endpoint.
 */

namespace Automattic\WooCommerce\Admin\API;

defined( 'ABSPATH' ) || exit;

/**
 * REST API Data countries controller class.
 *
 * @extends WC_REST_Data_Countries_Controller
 */
class DataCountries extends \WC_REST_Data_Countries_Controller {

	/**
	 * Endpoint namespace.
	 *
	 * @var string
	 */
	protected $namespace = 'wc-analytics';
}
woocommerce-admin/src/API/Templates/digital_product.csv000064400000003422151335517650017215 0ustar00Type,Name,Published,"Is featured?","Visibility in catalog","Short description",Description,"Date sale price starts","Date sale price ends","Tax status","Tax class","In stock?",Stock,"Backorders allowed?","Sold individually?","Weight (lbs)","Length (in)","Width (in)","Height (in)","Allow customer reviews?","Purchase note","Sale price","Regular price",Categories,Tags,"Shipping class",Images,"Download limit","Download expiry days",Parent,"Grouped products",Upsells,Cross-sells,"External URL","Button text",Position,"Attribute 1 name","Attribute 1 value(s)","Attribute 1 visible","Attribute 1 global","Attribute 2 name","Attribute 2 value(s)","Attribute 2 visible","Attribute 2 global","Meta: _wpcom_is_markdown","Download 1 name","Download 1 URL","Download 2 name","Download 2 URL"
"simple, downloadable, virtual",Album,0,0,visible,"This is a simple, virtual product.","Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum sagittis orci ac odio dictum tincidunt. Donec ut metus leo. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Sed luctus, dui eu sagittis sodales, nulla nibh sagittis augue, vel porttitor diam enim non metus. Vestibulum aliquam augue neque. Phasellus tincidunt odio eget ullamcorper efficitur. Cras placerat ut turpis pellentesque vulputate. Nam sed consequat tortor. Curabitur finibus sapien dolor. Ut eleifend tellus nec erat pulvinar dignissim. Nam non arcu purus. Vivamus et massa massa.",,,taxable,,1,,0,0,,,,,1,,,15,Music,,,https://woocommercecore.mystagingwebsite.com/wp-content/uploads/2017/12/album-1.jpg,1,1,,,,,,,0,,,,,,,,,1,"Single 1",https://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2017/08/single.jpg,"Single 2",https://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2017/08/album.jpg
woocommerce-admin/src/API/Templates/variable_product.csv000064400000003010151335517650017356 0ustar00Type,Name,Published,"Is featured?","Visibility in catalog","Short description",Description,"Date sale price starts","Date sale price ends","Tax status","Tax class","In stock?",Stock,"Backorders allowed?","Sold individually?","Weight (lbs)","Length (in)","Width (in)","Height (in)","Allow customer reviews?","Purchase note","Sale price","Regular price",Categories,Tags,"Shipping class",Images,"Download limit","Download expiry days",Parent,"Grouped products",Upsells,Cross-sells,"External URL","Button text",Position,"Attribute 1 name","Attribute 1 value(s)","Attribute 1 visible","Attribute 1 global","Attribute 2 name","Attribute 2 value(s)","Attribute 2 visible","Attribute 2 global","Meta: _wpcom_is_markdown","Download 1 name","Download 1 URL","Download 2 name","Download 2 URL"
variable,"V-Neck T-Shirt",0,1,visible,"This is a variable product.","Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.",,,taxable,,1,,0,0,.5,24,1,2,1,,,,"Clothing > Tshirts",,,"https://woocommercecore.mystagingwebsite.com/wp-content/uploads/2017/12/vneck-tee-2.jpg, https://woocommercecore.mystagingwebsite.com/wp-content/uploads/2017/12/vnech-tee-green-1.jpg, https://woocommercecore.mystagingwebsite.com/wp-content/uploads/2017/12/vnech-tee-blue-1.jpg",,,,,,,,,0,Color,"Blue, Green, Red",1,1,Size,"Large, Medium, Small",1,1,1,,,,
woocommerce-admin/src/API/Templates/physical_product.csv000064400000002445151335517650017420 0ustar00Type,Name,Published,"Is featured?","Visibility in catalog","Short description",Description,"Date sale price starts","Date sale price ends","Tax status","Tax class","In stock?",Stock,"Backorders allowed?","Sold individually?","Weight (lbs)","Length (in)","Width (in)","Height (in)","Allow customer reviews?","Purchase note","Sale price","Regular price",Categories,Tags,"Shipping class",Images,"Download limit","Download expiry days",Parent,"Grouped products",Upsells,Cross-sells,"External URL","Button text",Position,"Attribute 1 name","Attribute 1 value(s)","Attribute 1 visible","Attribute 1 global","Attribute 2 name","Attribute 2 value(s)","Attribute 2 visible","Attribute 2 global","Meta: _wpcom_is_markdown","Download 1 name","Download 1 URL","Download 2 name","Download 2 URL"
simple,"Hoodie with Logo",0,0,visible,"This is a simple product.","Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.",,,taxable,,1,,0,0,2,10,6,3,1,,,45,"Clothing > Hoodies",,,https://woocommercecore.mystagingwebsite.com/wp-content/uploads/2017/12/hoodie-with-logo-2.jpg,,,,,,,,,0,Color,Blue,1,1,,,,,1,,,,
woocommerce-admin/src/API/Coupons.php000064400000004177151335517650013534 0ustar00<?php
/**
 * REST API Coupons Controller
 *
 * Handles requests to /coupons/*
 */

namespace Automattic\WooCommerce\Admin\API;

defined( 'ABSPATH' ) || exit;

/**
 * Coupons controller.
 *
 * @extends WC_REST_Coupons_Controller
 */
class Coupons extends \WC_REST_Coupons_Controller {

	/**
	 * Endpoint namespace.
	 *
	 * @var string
	 */
	protected $namespace = 'wc-analytics';

	/**
	 * Get the query params for collections.
	 *
	 * @return array
	 */
	public function get_collection_params() {
		$params           = parent::get_collection_params();
		$params['search'] = array(
			'description'       => __( 'Limit results to coupons with codes matching a given string.', 'woocommerce' ),
			'type'              => 'string',
			'validate_callback' => 'rest_validate_request_arg',
		);
		return $params;
	}


	/**
	 * Add coupon code searching to the WC API.
	 *
	 * @param WP_REST_Request $request Request data.
	 * @return array
	 */
	protected function prepare_objects_query( $request ) {
		$args = parent::prepare_objects_query( $request );

		if ( ! empty( $request['search'] ) ) {
			$args['search'] = $request['search'];
			$args['s']      = false;
		}

		return $args;
	}

	/**
	 * Get a collection of posts and add the code search option to WP_Query.
	 *
	 * @param WP_REST_Request $request Full details about the request.
	 * @return WP_Error|WP_REST_Response
	 */
	public function get_items( $request ) {
		add_filter( 'posts_where', array( __CLASS__, 'add_wp_query_search_code_filter' ), 10, 2 );
		$response = parent::get_items( $request );
		remove_filter( 'posts_where', array( __CLASS__, 'add_wp_query_search_code_filter' ), 10 );
		return $response;
	}

	/**
	 * Add code searching to the WP Query
	 *
	 * @param string $where Where clause used to search posts.
	 * @param object $wp_query WP_Query object.
	 * @return string
	 */
	public static function add_wp_query_search_code_filter( $where, $wp_query ) {
		global $wpdb;

		$search = $wp_query->get( 'search' );
		if ( $search ) {
			$code_like = '%' . $wpdb->esc_like( $search ) . '%';
			$where    .= $wpdb->prepare( "AND {$wpdb->posts}.post_title LIKE %s", $code_like );
		}

		return $where;
	}
}
woocommerce-admin/src/API/OnboardingProfile.php000064400000036567151335517650015521 0ustar00<?php
/**
 * REST API Onboarding Profile Controller
 *
 * Handles requests to /onboarding/profile
 */

namespace Automattic\WooCommerce\Admin\API;

defined( 'ABSPATH' ) || exit;

use Automattic\WooCommerce\Admin\Features\Onboarding;
use \Automattic\Jetpack\Connection\Manager as Jetpack_Connection_Manager;

/**
 * Onboarding Profile controller.
 *
 * @extends WC_REST_Data_Controller
 */
class OnboardingProfile extends \WC_REST_Data_Controller {
	/**
	 * Endpoint namespace.
	 *
	 * @var string
	 */
	protected $namespace = 'wc-admin';

	/**
	 * Route base.
	 *
	 * @var string
	 */
	protected $rest_base = 'onboarding/profile';

	/**
	 * Register routes.
	 */
	public function register_routes() {
		register_rest_route(
			$this->namespace,
			'/' . $this->rest_base,
			array(
				array(
					'methods'             => \WP_REST_Server::READABLE,
					'callback'            => array( $this, 'get_items' ),
					'permission_callback' => array( $this, 'get_items_permissions_check' ),
				),
				'schema' => array( $this, 'get_public_item_schema' ),
			)
		);
		register_rest_route(
			$this->namespace,
			'/' . $this->rest_base,
			array(
				array(
					'methods'             => \WP_REST_Server::EDITABLE,
					'callback'            => array( $this, 'update_items' ),
					'permission_callback' => array( $this, 'update_items_permissions_check' ),
					'args'                => $this->get_collection_params(),
				),
				'schema' => array( $this, 'get_public_item_schema' ),
			)
		);

		// This endpoint is experimental. For internal use only.
		register_rest_route(
			$this->namespace,
			'/' . $this->rest_base . '/experimental_get_email_prefill',
			array(
				array(
					'methods'             => \WP_REST_Server::READABLE,
					'callback'            => array( $this, 'get_email_prefill' ),
					'permission_callback' => array( $this, 'get_items_permissions_check' ),
				),
				'schema' => array( $this, 'get_public_item_schema' ),
			)
		);
	}

	/**
	 * Check whether a given request has permission to read onboarding profile data.
	 *
	 * @param  WP_REST_Request $request Full details about the request.
	 * @return WP_Error|boolean
	 */
	public function get_items_permissions_check( $request ) {
		if ( ! wc_rest_check_manager_permissions( 'settings', 'read' ) ) {
			return new \WP_Error( 'woocommerce_rest_cannot_view', __( 'Sorry, you cannot list resources.', 'woocommerce' ), array( 'status' => rest_authorization_required_code() ) );
		}

		return true;
	}

	/**
	 * Check whether a given request has permission to edit onboarding profile data.
	 *
	 * @param  WP_REST_Request $request Full details about the request.
	 * @return WP_Error|boolean
	 */
	public function update_items_permissions_check( $request ) {
		if ( ! wc_rest_check_manager_permissions( 'settings', 'edit' ) ) {
			return new \WP_Error( 'woocommerce_rest_cannot_view', __( 'Sorry, you cannot edit this resource.', 'woocommerce' ), array( 'status' => rest_authorization_required_code() ) );
		}

		return true;
	}

	/**
	 * Return all onboarding profile data.
	 *
	 * @param  WP_REST_Request $request Request data.
	 * @return WP_Error|WP_REST_Response
	 */
	public function get_items( $request ) {
		include_once WC_ABSPATH . 'includes/admin/helper/class-wc-helper-options.php';

		$onboarding_data             = get_option( Onboarding::PROFILE_DATA_OPTION, array() );
		$onboarding_data['industry'] = isset( $onboarding_data['industry'] ) ? $this->filter_industries( $onboarding_data['industry'] ) : null;
		$item_schema                 = $this->get_item_schema();
		$items                       = array();
		foreach ( $item_schema['properties'] as $key => $property_schema ) {
			$items[ $key ] = isset( $onboarding_data[ $key ] ) ? $onboarding_data[ $key ] : null;
		}

		$wccom_auth               = \WC_Helper_Options::get( 'auth' );
		$items['wccom_connected'] = empty( $wccom_auth['access_token'] ) ? false : true;

		$item = $this->prepare_item_for_response( $items, $request );
		$data = $this->prepare_response_for_collection( $item );

		return rest_ensure_response( $data );
	}

	/**
	 * Filter the industries.
	 *
	 * @param  array $industries list of industries.
	 * @return array
	 */
	public function filter_industries( $industries ) {
		return apply_filters(
			'woocommerce_admin_onboarding_industries',
			$industries
		);
	}

	/**
	 * Update onboarding profile data.
	 *
	 * @param  WP_REST_Request $request Request data.
	 * @return WP_Error|WP_REST_Response
	 */
	public function update_items( $request ) {
		$params          = $request->get_json_params();
		$query_args      = $this->prepare_objects_query( $params );
		$onboarding_data = (array) get_option( Onboarding::PROFILE_DATA_OPTION, array() );
		$profile_data    = array_merge( $onboarding_data, $query_args );
		update_option( Onboarding::PROFILE_DATA_OPTION, $profile_data );
		do_action( 'woocommerce_onboarding_profile_data_updated', $onboarding_data, $query_args );

		$result = array(
			'status'  => 'success',
			'message' => __( 'Onboarding profile data has been updated.', 'woocommerce' ),
		);

		$response = $this->prepare_item_for_response( $result, $request );
		$data     = $this->prepare_response_for_collection( $response );

		return rest_ensure_response( $data );
	}

	/**
	 * Returns a default email to be pre-filled in OBW. Prioritizes Jetpack if connected,
	 * otherwise will default to WordPress general settings.
	 *
	 * @param  WP_REST_Request $request Request data.
	 * @return WP_Error|WP_REST_Response
	 */
	public function get_email_prefill( $request ) {
		$result = array(
			'email' => '',
		);

		// Attempt to get email from Jetpack.
		if ( class_exists( Jetpack_Connection_Manager::class ) ) {
			$jetpack_connection_manager = new Jetpack_Connection_Manager();
			if ( $jetpack_connection_manager->is_active() ) {
				$jetpack_user = $jetpack_connection_manager->get_connected_user_data();

				$result['email'] = $jetpack_user['email'];
			}
		}

		// Attempt to get email from WordPress general settings.
		if ( empty( $result['email'] ) ) {
			$result['email'] = get_option( 'admin_email' );
		}

		return rest_ensure_response( $result );
	}

	/**
	 * Prepare objects query.
	 *
	 * @param  array $params The params sent in the request.
	 * @return array
	 */
	protected function prepare_objects_query( $params ) {
		$args       = array();
		$properties = self::get_profile_properties();

		foreach ( $properties as $key => $property ) {
			if ( isset( $params[ $key ] ) ) {
				$args[ $key ] = $params[ $key ];
			}
		}

		/**
		 * Filter the query arguments for a request.
		 *
		 * Enables adding extra arguments or setting defaults for a post
		 * collection request.
		 *
		 * @param array $args    Key value array of query var to query value.
		 * @param array $params The params sent in the request.
		 */
		$args = apply_filters( 'woocommerce_rest_onboarding_profile_object_query', $args, $params );

		return $args;
	}


	/**
	 * Prepare the data object for response.
	 *
	 * @param object          $item Data object.
	 * @param WP_REST_Request $request Request object.
	 * @return WP_REST_Response $response Response data.
	 */
	public function prepare_item_for_response( $item, $request ) {
		$data     = $this->add_additional_fields_to_object( $item, $request );
		$data     = $this->filter_response_by_context( $data, 'view' );
		$response = rest_ensure_response( $data );

		/**
		 * Filter the list returned from the API.
		 *
		 * @param WP_REST_Response $response The response object.
		 * @param array            $item     The original item.
		 * @param WP_REST_Request  $request  Request used to generate the response.
		 */
		return apply_filters( 'woocommerce_rest_onboarding_prepare_profile', $response, $item, $request );
	}

	/**
	 * Get onboarding profile properties.
	 *
	 * @return array
	 */
	public static function get_profile_properties() {
		$properties = array(
			'completed'           => array(
				'type'              => 'boolean',
				'description'       => __( 'Whether or not the profile was completed.', 'woocommerce' ),
				'context'           => array( 'view' ),
				'readonly'          => true,
				'validate_callback' => 'rest_validate_request_arg',
			),
			'skipped'             => array(
				'type'              => 'boolean',
				'description'       => __( 'Whether or not the profile was skipped.', 'woocommerce' ),
				'context'           => array( 'view' ),
				'readonly'          => true,
				'validate_callback' => 'rest_validate_request_arg',
			),
			'industry'            => array(
				'type'              => 'array',
				'description'       => __( 'Industry.', 'woocommerce' ),
				'context'           => array( 'view' ),
				'readonly'          => true,
				'validate_callback' => 'rest_validate_request_arg',
				'items'             => array(
					'type' => 'object',
				),
			),
			'product_types'       => array(
				'type'              => 'array',
				'description'       => __( 'Types of products sold.', 'woocommerce' ),
				'context'           => array( 'view' ),
				'readonly'          => true,
				'sanitize_callback' => 'wp_parse_slug_list',
				'validate_callback' => 'rest_validate_request_arg',
				'items'             => array(
					'enum' => array_keys( Onboarding::get_allowed_product_types() ),
					'type' => 'string',
				),
			),
			'product_count'       => array(
				'type'              => 'string',
				'description'       => __( 'Number of products to be added.', 'woocommerce' ),
				'context'           => array( 'view' ),
				'readonly'          => true,
				'validate_callback' => 'rest_validate_request_arg',
				'enum'              => array(
					'0',
					'1-10',
					'11-100',
					'101-1000',
					'1000+',
				),
			),
			'selling_venues'      => array(
				'type'              => 'string',
				'description'       => __( 'Other places the store is selling products.', 'woocommerce' ),
				'context'           => array( 'view' ),
				'readonly'          => true,
				'validate_callback' => 'rest_validate_request_arg',
				'enum'              => array(
					'no',
					'other',
					'brick-mortar',
					'brick-mortar-other',
					'other-woocommerce',
				),
			),
			'revenue'             => array(
				'type'              => 'string',
				'description'       => __( 'Current annual revenue of the store.', 'woocommerce' ),
				'context'           => array( 'view' ),
				'readonly'          => true,
				'validate_callback' => 'rest_validate_request_arg',
				'enum'              => array(
					'none',
					'up-to-2500',
					'2500-10000',
					'10000-50000',
					'50000-250000',
					'more-than-250000',
					'rather-not-say',
				),
			),
			'other_platform'      => array(
				'type'              => 'string',
				'description'       => __( 'Name of other platform used to sell.', 'woocommerce' ),
				'context'           => array( 'view' ),
				'readonly'          => true,
				'validate_callback' => 'rest_validate_request_arg',
				'enum'              => array(
					'shopify',
					'bigcommerce',
					'magento',
					'wix',
					'amazon',
					'ebay',
					'etsy',
					'squarespace',
					'other',
				),
			),
			'other_platform_name' => array(
				'type'              => 'string',
				'description'       => __( 'Name of other platform used to sell (not listed).', 'woocommerce' ),
				'context'           => array( 'view' ),
				'readonly'          => true,
				'validate_callback' => 'rest_validate_request_arg',
			),
			'business_extensions' => array(
				'type'              => 'array',
				'description'       => __( 'Extra business extensions to install.', 'woocommerce' ),
				'context'           => array( 'view' ),
				'readonly'          => true,
				'sanitize_callback' => 'wp_parse_slug_list',
				'validate_callback' => 'rest_validate_request_arg',
				'items'             => array(
					'enum' => array(
						'jetpack',
						'woocommerce-services',
						'woocommerce-payments',
						'mailchimp-for-woocommerce',
						'creative-mail-by-constant-contact',
						'facebook-for-woocommerce',
						'google-listings-and-ads',
						'mailpoet',
					),
					'type' => 'string',
				),
			),
			'theme'               => array(
				'type'              => 'string',
				'description'       => __( 'Selected store theme.', 'woocommerce' ),
				'context'           => array( 'view' ),
				'readonly'          => true,
				'sanitize_callback' => 'sanitize_title_with_dashes',
				'validate_callback' => 'rest_validate_request_arg',
			),
			'setup_client'        => array(
				'type'              => 'boolean',
				'description'       => __( 'Whether or not this store was setup for a client.', 'woocommerce' ),
				'context'           => array( 'view' ),
				'readonly'          => true,
				'validate_callback' => 'rest_validate_request_arg',
			),
			'wccom_connected'     => array(
				'type'              => 'boolean',
				'description'       => __( 'Whether or not the store was connected to WooCommerce.com during the extension flow.', 'woocommerce' ),
				'context'           => array( 'view' ),
				'readonly'          => true,
				'validate_callback' => 'rest_validate_request_arg',
			),
			'is_agree_marketing'  => array(
				'type'              => 'boolean',
				'description'       => __( 'Whether or not this store agreed to receiving marketing contents from WooCommerce.com.', 'woocommerce' ),
				'context'           => array( 'view' ),
				'readonly'          => true,
				'validate_callback' => 'rest_validate_request_arg',
			),
			'store_email'         => array(
				'type'              => 'string',
				'description'       => __( 'Store email address.', 'woocommerce' ),
				'context'           => array( 'view' ),
				'readonly'          => true,
				'validate_callback' => array( __CLASS__, 'rest_validate_marketing_email' ),
			),
		);

		return apply_filters( 'woocommerce_rest_onboarding_profile_properties', $properties );
	}

	/**
	 * Optionally validates email if user agreed to marketing or if email is not empty.
	 *
	 * @param mixed           $value Email value.
	 * @param WP_REST_Request $request Request object.
	 * @param string          $param Parameter name.
	 * @return true|WP_Error
	 */
	public static function rest_validate_marketing_email( $value, $request, $param ) {
		$is_agree_marketing = $request->get_param( 'is_agree_marketing' );
		if (
			( $is_agree_marketing || ! empty( $value ) ) &&
			! is_email( $value ) ) {
			return new \WP_Error( 'rest_invalid_email', __( 'Invalid email address', 'woocommerce' ) );
		};
		return true;
	}

	/**
	 * Get the schema, conforming to JSON Schema.
	 *
	 * @return array
	 */
	public function get_item_schema() {
		// Unset properties used for collection params.
		$properties = self::get_profile_properties();
		foreach ( $properties as $key => $property ) {
			unset( $properties[ $key ]['default'] );
			unset( $properties[ $key ]['items'] );
			unset( $properties[ $key ]['validate_callback'] );
			unset( $properties[ $key ]['sanitize_callback'] );
		}

		$schema = array(
			'$schema'    => 'http://json-schema.org/draft-04/schema#',
			'title'      => 'onboarding_profile',
			'type'       => 'object',
			'properties' => $properties,
		);

		return $this->add_additional_fields_schema( $schema );
	}

	/**
	 * Get the query params for collections.
	 *
	 * @return array
	 */
	public function get_collection_params() {
		// Unset properties used for item schema.
		$params = self::get_profile_properties();
		foreach ( $params as $key => $param ) {
			unset( $params[ $key ]['context'] );
			unset( $params[ $key ]['readonly'] );
		}

		$params['context'] = $this->get_context_param( array( 'default' => 'view' ) );

		return apply_filters( 'woocommerce_rest_onboarding_profile_collection_params', $params );
	}
}
woocommerce-admin/src/API/OnboardingPayments.php000064400000003456151335517650015710 0ustar00<?php
/**
 * REST API Onboarding Payments Controller
 *
 * Handles requests to /onboarding/payments
 */

namespace Automattic\WooCommerce\Admin\API;

defined( 'ABSPATH' ) || exit;

use Automattic\WooCommerce\Admin\Features\PaymentGatewaySuggestions\Init as PaymentGatewaySuggestions;

/**
 * Onboarding Payments Controller.
 *
 * @extends WC_REST_Data_Controller
 */
class OnboardingPayments extends \WC_REST_Data_Controller {

	/**
	 * Endpoint namespace.
	 *
	 * @var string
	 */
	protected $namespace = 'wc-admin';

	/**
	 * Route base.
	 *
	 * @var string
	 */
	protected $rest_base = 'onboarding/payments';

	/**
	 * Register routes.
	 */
	public function register_routes() {
		register_rest_route(
			$this->namespace,
			'/' . $this->rest_base,
			array(
				array(
					'methods'             => \WP_REST_Server::READABLE,
					'callback'            => array( $this, 'get_suggestions' ),
					'permission_callback' => array( $this, 'get_items_permissions_check' ),
				),
				'schema' => array( $this, 'get_public_item_schema' ),
			)
		);
	}

	/**
	 * Check whether a given request has permission to read onboarding profile data.
	 *
	 * @param  WP_REST_Request $request Full details about the request.
	 * @return WP_Error|boolean
	 */
	public function get_items_permissions_check( $request ) {
		if ( ! wc_rest_check_manager_permissions( 'settings', 'read' ) ) {
			return new \WP_Error( 'woocommerce_rest_cannot_view', __( 'Sorry, you cannot list resources.', 'woocommerce' ), array( 'status' => rest_authorization_required_code() ) );
		}

		return true;
	}

	/**
	 * Return available payment gateway suggestions.
	 *
	 * @param \WP_REST_Request $request Request data.
	 *
	 * @return \WP_Error|\WP_REST_Response
	 */
	public function get_suggestions( $request ) {
		return PaymentGatewaySuggestions::get_suggestions();
	}

}
woocommerce-admin/src/API/Leaderboards.php000064400000040540151335517650014467 0ustar00<?php
/**
 * REST API Leaderboards Controller
 *
 * Handles requests to /leaderboards
 */

namespace Automattic\WooCommerce\Admin\API;

defined( 'ABSPATH' ) || exit;

use \Automattic\WooCommerce\Admin\API\Reports\Categories\DataStore as CategoriesDataStore;
use \Automattic\WooCommerce\Admin\API\Reports\Coupons\DataStore as CouponsDataStore;
use \Automattic\WooCommerce\Admin\API\Reports\Customers\DataStore as CustomersDataStore;
use \Automattic\WooCommerce\Admin\API\Reports\Products\DataStore as ProductsDataStore;

/**
 * Leaderboards controller.
 *
 * @extends WC_REST_Data_Controller
 */
class Leaderboards extends \WC_REST_Data_Controller {
	/**
	 * Endpoint namespace.
	 *
	 * @var string
	 */
	protected $namespace = 'wc-analytics';

	/**
	 * Route base.
	 *
	 * @var string
	 */
	protected $rest_base = 'leaderboards';

	/**
	 * Register routes.
	 */
	public function register_routes() {
		register_rest_route(
			$this->namespace,
			'/' . $this->rest_base,
			array(
				array(
					'methods'             => \WP_REST_Server::READABLE,
					'callback'            => array( $this, 'get_items' ),
					'permission_callback' => array( $this, 'get_items_permissions_check' ),
					'args'                => $this->get_collection_params(),
				),
				'schema' => array( $this, 'get_public_item_schema' ),
			)
		);

		register_rest_route(
			$this->namespace,
			'/' . $this->rest_base . '/allowed',
			array(
				array(
					'methods'             => \WP_REST_Server::READABLE,
					'callback'            => array( $this, 'get_allowed_items' ),
					'permission_callback' => array( $this, 'get_items_permissions_check' ),
				),
				'schema' => array( $this, 'get_public_allowed_item_schema' ),
			)
		);
	}

	/**
	 * Get the data for the coupons leaderboard.
	 *
	 * @param int    $per_page Number of rows.
	 * @param string $after Items after date.
	 * @param string $before Items before date.
	 * @param string $persisted_query URL query string.
	 */
	public function get_coupons_leaderboard( $per_page, $after, $before, $persisted_query ) {
		$coupons_data_store = new CouponsDataStore();
		$coupons_data       = $per_page > 0 ? $coupons_data_store->get_data(
			apply_filters(
				'woocommerce_analytics_coupons_query_args',
				array(
					'orderby'       => 'orders_count',
					'order'         => 'desc',
					'after'         => $after,
					'before'        => $before,
					'per_page'      => $per_page,
					'extended_info' => true,
				)
			)
		)->data : array();

		$rows = array();
		foreach ( $coupons_data as $coupon ) {
			$url_query   = wp_parse_args(
				array(
					'filter'  => 'single_coupon',
					'coupons' => $coupon['coupon_id'],
				),
				$persisted_query
			);
			$coupon_url  = wc_admin_url( '/analytics/coupons', $url_query );
			$coupon_code = isset( $coupon['extended_info'] ) && isset( $coupon['extended_info']['code'] ) ? $coupon['extended_info']['code'] : '';
			$rows[]      = array(
				array(
					'display' => "<a href='{$coupon_url}'>{$coupon_code}</a>",
					'value'   => $coupon_code,
				),
				array(
					'display' => wc_admin_number_format( $coupon['orders_count'] ),
					'value'   => $coupon['orders_count'],
				),
				array(
					'display' => wc_price( $coupon['amount'] ),
					'value'   => $coupon['amount'],
				),
			);
		}

		return array(
			'id'      => 'coupons',
			'label'   => __( 'Top Coupons - Number of Orders', 'woocommerce' ),
			'headers' => array(
				array(
					'label' => __( 'Coupon code', 'woocommerce' ),
				),
				array(
					'label' => __( 'Orders', 'woocommerce' ),
				),
				array(
					'label' => __( 'Amount discounted', 'woocommerce' ),
				),
			),
			'rows'    => $rows,
		);
	}

	/**
	 * Get the data for the categories leaderboard.
	 *
	 * @param int    $per_page Number of rows.
	 * @param string $after Items after date.
	 * @param string $before Items before date.
	 * @param string $persisted_query URL query string.
	 */
	public function get_categories_leaderboard( $per_page, $after, $before, $persisted_query ) {
		$categories_data_store = new CategoriesDataStore();
		$categories_data       = $per_page > 0 ? $categories_data_store->get_data(
			apply_filters(
				'woocommerce_analytics_categories_query_args',
				array(
					'orderby'       => 'items_sold',
					'order'         => 'desc',
					'after'         => $after,
					'before'        => $before,
					'per_page'      => $per_page,
					'extended_info' => true,
				)
			)
		)->data : array();

		$rows = array();
		foreach ( $categories_data as $category ) {
			$url_query     = wp_parse_args(
				array(
					'filter'     => 'single_category',
					'categories' => $category['category_id'],
				),
				$persisted_query
			);
			$category_url  = wc_admin_url( '/analytics/categories', $url_query );
			$category_name = isset( $category['extended_info'] ) && isset( $category['extended_info']['name'] ) ? $category['extended_info']['name'] : '';
			$rows[]        = array(
				array(
					'display' => "<a href='{$category_url}'>{$category_name}</a>",
					'value'   => $category_name,
				),
				array(
					'display' => wc_admin_number_format( $category['items_sold'] ),
					'value'   => $category['items_sold'],
				),
				array(
					'display' => wc_price( $category['net_revenue'] ),
					'value'   => $category['net_revenue'],
				),
			);
		}

		return array(
			'id'      => 'categories',
			'label'   => __( 'Top categories - Items sold', 'woocommerce' ),
			'headers' => array(
				array(
					'label' => __( 'Category', 'woocommerce' ),
				),
				array(
					'label' => __( 'Items sold', 'woocommerce' ),
				),
				array(
					'label' => __( 'Net sales', 'woocommerce' ),
				),
			),
			'rows'    => $rows,
		);
	}

	/**
	 * Get the data for the customers leaderboard.
	 *
	 * @param int    $per_page Number of rows.
	 * @param string $after Items after date.
	 * @param string $before Items before date.
	 * @param string $persisted_query URL query string.
	 */
	public function get_customers_leaderboard( $per_page, $after, $before, $persisted_query ) {
		$customers_data_store = new CustomersDataStore();
		$customers_data       = $per_page > 0 ? $customers_data_store->get_data(
			apply_filters(
				'woocommerce_analytics_customers_query_args',
				array(
					'orderby'      => 'total_spend',
					'order'        => 'desc',
					'order_after'  => $after,
					'order_before' => $before,
					'per_page'     => $per_page,
				)
			)
		)->data : array();

		$rows = array();
		foreach ( $customers_data as $customer ) {
			$url_query    = wp_parse_args(
				array(
					'filter'    => 'single_customer',
					'customers' => $customer['id'],
				),
				$persisted_query
			);
			$customer_url = wc_admin_url( '/analytics/customers', $url_query );
			$rows[]       = array(
				array(
					'display' => "<a href='{$customer_url}'>{$customer['name']}</a>",
					'value'   => $customer['name'],
				),
				array(
					'display' => wc_admin_number_format( $customer['orders_count'] ),
					'value'   => $customer['orders_count'],
				),
				array(
					'display' => wc_price( $customer['total_spend'] ),
					'value'   => $customer['total_spend'],
				),
			);
		}

		return array(
			'id'      => 'customers',
			'label'   => __( 'Top Customers - Total Spend', 'woocommerce' ),
			'headers' => array(
				array(
					'label' => __( 'Customer Name', 'woocommerce' ),
				),
				array(
					'label' => __( 'Orders', 'woocommerce' ),
				),
				array(
					'label' => __( 'Total Spend', 'woocommerce' ),
				),
			),
			'rows'    => $rows,
		);
	}

	/**
	 * Get the data for the products leaderboard.
	 *
	 * @param int    $per_page Number of rows.
	 * @param string $after Items after date.
	 * @param string $before Items before date.
	 * @param string $persisted_query URL query string.
	 */
	public function get_products_leaderboard( $per_page, $after, $before, $persisted_query ) {
		$products_data_store = new ProductsDataStore();
		$products_data       = $per_page > 0 ? $products_data_store->get_data(
			apply_filters(
				'woocommerce_analytics_products_query_args',
				array(
					'orderby'       => 'items_sold',
					'order'         => 'desc',
					'after'         => $after,
					'before'        => $before,
					'per_page'      => $per_page,
					'extended_info' => true,
				)
			)
		)->data : array();

		$rows = array();
		foreach ( $products_data as $product ) {
			$url_query    = wp_parse_args(
				array(
					'filter'   => 'single_product',
					'products' => $product['product_id'],
				),
				$persisted_query
			);
			$product_url  = wc_admin_url( '/analytics/products', $url_query );
			$product_name = isset( $product['extended_info'] ) && isset( $product['extended_info']['name'] ) ? $product['extended_info']['name'] : '';
			$rows[]       = array(
				array(
					'display' => "<a href='{$product_url}'>{$product_name}</a>",
					'value'   => $product_name,
				),
				array(
					'display' => wc_admin_number_format( $product['items_sold'] ),
					'value'   => $product['items_sold'],
				),
				array(
					'display' => wc_price( $product['net_revenue'] ),
					'value'   => $product['net_revenue'],
				),
			);
		}

		return array(
			'id'      => 'products',
			'label'   => __( 'Top products - Items sold', 'woocommerce' ),
			'headers' => array(
				array(
					'label' => __( 'Product', 'woocommerce' ),
				),
				array(
					'label' => __( 'Items sold', 'woocommerce' ),
				),
				array(
					'label' => __( 'Net sales', 'woocommerce' ),
				),
			),
			'rows'    => $rows,
		);
	}

	/**
	 * Get an array of all leaderboards.
	 *
	 * @param int    $per_page Number of rows.
	 * @param string $after Items after date.
	 * @param string $before Items before date.
	 * @param string $persisted_query URL query string.
	 * @return array
	 */
	public function get_leaderboards( $per_page, $after, $before, $persisted_query ) {
		$leaderboards = array(
			$this->get_customers_leaderboard( $per_page, $after, $before, $persisted_query ),
			$this->get_coupons_leaderboard( $per_page, $after, $before, $persisted_query ),
			$this->get_categories_leaderboard( $per_page, $after, $before, $persisted_query ),
			$this->get_products_leaderboard( $per_page, $after, $before, $persisted_query ),
		);

		return apply_filters( 'woocommerce_leaderboards', $leaderboards, $per_page, $after, $before, $persisted_query );
	}

	/**
	 * Return all leaderboards.
	 *
	 * @param  WP_REST_Request $request Request data.
	 * @return WP_Error|WP_REST_Response
	 */
	public function get_items( $request ) {
		$persisted_query = json_decode( $request['persisted_query'], true );
		$leaderboards    = $this->get_leaderboards( $request['per_page'], $request['after'], $request['before'], $persisted_query );
		$data            = array();

		if ( ! empty( $leaderboards ) ) {
			foreach ( $leaderboards as $leaderboard ) {
				$response = $this->prepare_item_for_response( $leaderboard, $request );
				$data[]   = $this->prepare_response_for_collection( $response );
			}
		}

		return rest_ensure_response( $data );
	}

	/**
	 * Returns a list of allowed leaderboards.
	 *
	 * @param  WP_REST_Request $request Request data.
	 * @return array|WP_Error
	 */
	public function get_allowed_items( $request ) {
		$leaderboards = $this->get_leaderboards( 0, null, null, null );

		$data = array();
		foreach ( $leaderboards as $leaderboard ) {
			$data[] = (object) array(
				'id'      => $leaderboard['id'],
				'label'   => $leaderboard['label'],
				'headers' => $leaderboard['headers'],
			);
		}

		$objects = array();
		foreach ( $data as $item ) {
			$prepared  = $this->prepare_item_for_response( $item, $request );
			$objects[] = $this->prepare_response_for_collection( $prepared );
		}

		$response = rest_ensure_response( $objects );
		$response->header( 'X-WP-Total', count( $data ) );
		$response->header( 'X-WP-TotalPages', 1 );

		$base = add_query_arg( $request->get_query_params(), rest_url( sprintf( '/%s/%s', $this->namespace, $this->rest_base ) ) );

		return $response;
	}

	/**
	 * Prepare the data object for response.
	 *
	 * @param object          $item Data object.
	 * @param WP_REST_Request $request Request object.
	 * @return WP_REST_Response $response Response data.
	 */
	public function prepare_item_for_response( $item, $request ) {
		$data     = $this->add_additional_fields_to_object( $item, $request );
		$data     = $this->filter_response_by_context( $data, 'view' );
		$response = rest_ensure_response( $data );

		/**
		 * Filter the list returned from the API.
		 *
		 * @param WP_REST_Response $response The response object.
		 * @param array            $item     The original item.
		 * @param WP_REST_Request  $request  Request used to generate the response.
		 */
		return apply_filters( 'woocommerce_rest_prepare_leaderboard', $response, $item, $request );
	}

	/**
	 * Get the query params for collections.
	 *
	 * @return array
	 */
	public function get_collection_params() {
		$params                    = array();
		$params['page']            = array(
			'description'       => __( 'Current page of the collection.', 'woocommerce' ),
			'type'              => 'integer',
			'default'           => 1,
			'sanitize_callback' => 'absint',
			'validate_callback' => 'rest_validate_request_arg',
			'minimum'           => 1,
		);
		$params['per_page']        = array(
			'description'       => __( 'Maximum number of items to be returned in result set.', 'woocommerce' ),
			'type'              => 'integer',
			'default'           => 5,
			'minimum'           => 1,
			'maximum'           => 20,
			'sanitize_callback' => 'absint',
			'validate_callback' => 'rest_validate_request_arg',
		);
		$params['after']           = array(
			'description'       => __( 'Limit response to resources published after a given ISO8601 compliant date.', 'woocommerce' ),
			'type'              => 'string',
			'format'            => 'date-time',
			'validate_callback' => 'rest_validate_request_arg',
		);
		$params['before']          = array(
			'description'       => __( 'Limit response to resources published before a given ISO8601 compliant date.', 'woocommerce' ),
			'type'              => 'string',
			'format'            => 'date-time',
			'validate_callback' => 'rest_validate_request_arg',
		);
		$params['persisted_query'] = array(
			'description'       => __( 'URL query to persist across links.', 'woocommerce' ),
			'type'              => 'string',
			'validate_callback' => 'rest_validate_request_arg',
		);
		return $params;
	}

	/**
	 * Get the schema, conforming to JSON Schema.
	 *
	 * @return array
	 */
	public function get_item_schema() {
		$schema = array(
			'$schema'    => 'http://json-schema.org/draft-04/schema#',
			'title'      => 'leaderboard',
			'type'       => 'object',
			'properties' => array(
				'id'      => array(
					'type'        => 'string',
					'description' => __( 'Leaderboard ID.', 'woocommerce' ),
					'context'     => array( 'view' ),
					'readonly'    => true,
				),
				'label'   => array(
					'type'        => 'string',
					'description' => __( 'Displayed title for the leaderboard.', 'woocommerce' ),
					'context'     => array( 'view' ),
					'readonly'    => true,
				),
				'headers' => array(
					'type'        => 'array',
					'description' => __( 'Table headers.', 'woocommerce' ),
					'context'     => array( 'view' ),
					'readonly'    => true,
					'items'       => array(
						'type'       => 'array',
						'properties' => array(
							'label' => array(
								'description' => __( 'Table column header.', 'woocommerce' ),
								'type'        => 'string',
								'context'     => array( 'view', 'edit' ),
								'readonly'    => true,
							),
						),
					),
				),
				'rows'    => array(
					'type'        => 'array',
					'description' => __( 'Table rows.', 'woocommerce' ),
					'context'     => array( 'view' ),
					'readonly'    => true,
					'items'       => array(
						'type'       => 'array',
						'properties' => array(
							'display' => array(
								'description' => __( 'Table cell display.', 'woocommerce' ),
								'type'        => 'string',
								'context'     => array( 'view', 'edit' ),
								'readonly'    => true,
							),
							'value'   => array(
								'description' => __( 'Table cell value.', 'woocommerce' ),
								'type'        => 'string',
								'context'     => array( 'view', 'edit' ),
								'readonly'    => true,
							),
						),
					),
				),
			),
		);

		return $this->add_additional_fields_schema( $schema );
	}

	/**
	 * Get schema for the list of allowed leaderboards.
	 *
	 * @return array $schema
	 */
	public function get_public_allowed_item_schema() {
		$schema = $this->get_public_item_schema();
		unset( $schema['properties']['rows'] );
		return $schema;
	}
}
woocommerce-admin/src/API/DataDownloadIPs.php000064400000010213151335517650015047 0ustar00<?php
/**
 * REST API Data Download IP Controller
 *
 * Handles requests to /data/download-ips
 */

namespace Automattic\WooCommerce\Admin\API;

defined( 'ABSPATH' ) || exit;

/**
 * Data Download IP controller.
 *
 * @extends WC_REST_Data_Controller
 */
class DataDownloadIPs extends \WC_REST_Data_Controller {
	/**
	 * Endpoint namespace.
	 *
	 * @var string
	 */
	protected $namespace = 'wc-analytics';

	/**
	 * Route base.
	 *
	 * @var string
	 */
	protected $rest_base = 'data/download-ips';

	/**
	 * Register routes.
	 *
	 * @since 3.5.0
	 */
	public function register_routes() {
		register_rest_route(
			$this->namespace,
			'/' . $this->rest_base,
			array(
				array(
					'methods'             => \WP_REST_Server::READABLE,
					'callback'            => array( $this, 'get_items' ),
					'permission_callback' => array( $this, 'get_items_permissions_check' ),
				),
				'schema' => array( $this, 'get_public_item_schema' ),
			)
		);
	}

	/**
	 * Return the download IPs matching the passed parameters.
	 *
	 * @since  3.5.0
	 * @param  WP_REST_Request $request Request data.
	 * @return WP_Error|WP_REST_Response
	 */
	public function get_items( $request ) {
		global $wpdb;

		if ( isset( $request['match'] ) ) {
			$downloads = $wpdb->get_results(
				$wpdb->prepare(
					"SELECT DISTINCT( user_ip_address ) FROM {$wpdb->prefix}wc_download_log
					WHERE user_ip_address LIKE %s
					LIMIT 10",
					$request['match'] . '%'
				)
			);
		} else {
			return new \WP_Error( 'woocommerce_rest_data_download_ips_invalid_request', __( 'Invalid request. Please pass the match parameter.', 'woocommerce' ), array( 'status' => 400 ) );
		}

		$data = array();

		if ( ! empty( $downloads ) ) {
			foreach ( $downloads as $download ) {
				$response = $this->prepare_item_for_response( $download, $request );
				$data[]   = $this->prepare_response_for_collection( $response );
			}
		}

		return rest_ensure_response( $data );
	}

	/**
	 * Prepare the data object for response.
	 *
	 * @since  3.5.0
	 * @param object          $item Data object.
	 * @param WP_REST_Request $request Request object.
	 * @return WP_REST_Response $response Response data.
	 */
	public function prepare_item_for_response( $item, $request ) {
		$data     = $this->add_additional_fields_to_object( $item, $request );
		$data     = $this->filter_response_by_context( $data, 'view' );
		$response = rest_ensure_response( $data );

		$response->add_links( $this->prepare_links( $item ) );

		/**
		 * Filter the list returned from the API.
		 *
		 * @param WP_REST_Response $response The response object.
		 * @param array            $item     The original item.
		 * @param WP_REST_Request  $request  Request used to generate the response.
		 */
		return apply_filters( 'woocommerce_rest_prepare_data_download_ip', $response, $item, $request );
	}

	/**
	 * Prepare links for the request.
	 *
	 * @param object $item Data object.
	 * @return array Links for the given object.
	 */
	protected function prepare_links( $item ) {
		$links = array(
			'collection' => array(
				'href' => rest_url( sprintf( '/%s/%s', $this->namespace, $this->rest_base ) ),
			),
		);
		return $links;
	}

	/**
	 * Get the query params for collections.
	 *
	 * @return array
	 */
	public function get_collection_params() {
		$params            = array();
		$params['context'] = $this->get_context_param( array( 'default' => 'view' ) );
		$params['match']   = array(
			'description'       => __( 'A partial IP address can be passed and matching results will be returned.', 'woocommerce' ),
			'type'              => 'string',
			'validate_callback' => 'rest_validate_request_arg',
		);
		return $params;
	}


	/**
	 * Get the schema, conforming to JSON Schema.
	 *
	 * @return array
	 */
	public function get_item_schema() {
		$schema = array(
			'$schema'    => 'http://json-schema.org/draft-04/schema#',
			'title'      => 'data_download_ips',
			'type'       => 'object',
			'properties' => array(
				'user_ip_address' => array(
					'type'        => 'string',
					'description' => __( 'IP address.', 'woocommerce' ),
					'context'     => array( 'view' ),
					'readonly'    => true,
				),
			),
		);

		return $this->add_additional_fields_schema( $schema );
	}
}
woocommerce-admin/src/API/SettingOptions.php000064400000001542151335517650015070 0ustar00<?php
/**
 * REST API Setting Options Controller
 *
 * Handles requests to /settings/{option}
 */

namespace Automattic\WooCommerce\Admin\API;

defined( 'ABSPATH' ) || exit;

use \Automattic\WooCommerce\Admin\API\Reports\Cache as ReportsCache;

/**
 * Setting Options controller.
 *
 * @extends WC_REST_Setting_Options_Controller
 */
class SettingOptions extends \WC_REST_Setting_Options_Controller {

	/**
	 * Endpoint namespace.
	 *
	 * @var string
	 */
	protected $namespace = 'wc-analytics';

	/**
	 * Invalidates API cache when updating settings options.
	 *
	 * @param WP_REST_Request $request Full details about the request.
	 * @return array Of WP_Error or WP_REST_Response.
	 */
	public function batch_items( $request ) {
		// Invalidate the API cache.
		ReportsCache::invalidate();

		// Process the request.
		return parent::batch_items( $request );
	}
}
woocommerce-admin/src/API/ProductCategories.php000064400000000675151335517650015533 0ustar00<?php
/**
 * REST API Product Categories Controller
 *
 * Handles requests to /products/categories.
 */

namespace Automattic\WooCommerce\Admin\API;

defined( 'ABSPATH' ) || exit;

/**
 * Product categories controller.
 *
 * @extends WC_REST_Product_Categories_Controller
 */
class ProductCategories extends \WC_REST_Product_Categories_Controller {
	/**
	 * Endpoint namespace.
	 *
	 * @var string
	 */
	protected $namespace = 'wc-analytics';
}
woocommerce-admin/src/API/ProductVariations.php000064400000013664151335517650015567 0ustar00<?php
/**
 * REST API Product Variations Controller
 *
 * Handles requests to /products/variations.
 */

namespace Automattic\WooCommerce\Admin\API;

defined( 'ABSPATH' ) || exit;

/**
 * Product variations controller.
 *
 * @extends WC_REST_Product_Variations_Controller
 */
class ProductVariations extends \WC_REST_Product_Variations_Controller {
	/**
	 * Endpoint namespace.
	 *
	 * @var string
	 */
	protected $namespace = 'wc-analytics';

	/**
	 * Register the routes for products.
	 */
	public function register_routes() {
		parent::register_routes();

		// Add a route for listing variations without specifying the parent product ID.
		register_rest_route(
			$this->namespace,
			'/variations',
			array(
				array(
					'methods'             => \WP_REST_Server::READABLE,
					'callback'            => array( $this, 'get_items' ),
					'permission_callback' => array( $this, 'get_items_permissions_check' ),
					'args'                => $this->get_collection_params(),
				),
				'schema' => array( $this, 'get_public_item_schema' ),
			)
		);
	}

	/**
	 * Get the query params for collections.
	 *
	 * @return array
	 */
	public function get_collection_params() {
		$params           = parent::get_collection_params();
		$params['search'] = array(
			'description'       => __( 'Search by similar product name, sku, or attribute value.', 'woocommerce' ),
			'type'              => 'string',
			'validate_callback' => 'rest_validate_request_arg',
		);
		return $params;
	}

	/**
	 * Add in conditional search filters for variations.
	 *
	 * @param string $where Where clause used to search posts.
	 * @param object $wp_query WP_Query object.
	 * @return string
	 */
	public static function add_wp_query_filter( $where, $wp_query ) {
		global $wpdb;

		$search = $wp_query->get( 'search' );
		if ( $search ) {
			$like       = '%' . $wpdb->esc_like( $search ) . '%';
			$conditions = array(
				$wpdb->prepare( "{$wpdb->posts}.post_title LIKE %s", $like ), // phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared
				$wpdb->prepare( 'attr_search_meta.meta_value LIKE %s', $like ), // phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared
			);

			if ( wc_product_sku_enabled() ) {
				$conditions[] = $wpdb->prepare( 'wc_product_meta_lookup.sku LIKE %s', $like );
			}

			$where .= ' AND (' . implode( ' OR ', $conditions ) . ')';
		}

		return $where;
	}

	/**
	 * Join posts meta tables when variation search query is present.
	 *
	 * @param string $join Join clause used to search posts.
	 * @param object $wp_query WP_Query object.
	 * @return string
	 */
	public static function add_wp_query_join( $join, $wp_query ) {
		global $wpdb;

		$search = $wp_query->get( 'search' );
		if ( $search ) {
			$join .= " LEFT JOIN {$wpdb->postmeta} AS attr_search_meta
						ON {$wpdb->posts}.ID = attr_search_meta.post_id
						AND attr_search_meta.meta_key LIKE 'attribute_%' ";
		}

		if ( wc_product_sku_enabled() && ! strstr( $join, 'wc_product_meta_lookup' ) ) {
			$join .= " LEFT JOIN {$wpdb->wc_product_meta_lookup} wc_product_meta_lookup
						ON $wpdb->posts.ID = wc_product_meta_lookup.product_id ";
		}

		return $join;
	}

	/**
	 * Add product name and sku filtering to the WC API.
	 *
	 * @param WP_REST_Request $request Request data.
	 * @return array
	 */
	protected function prepare_objects_query( $request ) {
		$args = parent::prepare_objects_query( $request );

		if ( ! empty( $request['search'] ) ) {
			$args['search'] = $request['search'];
			unset( $args['s'] );
		}

		// Retreive variations without specifying a parent product.
		if ( "/{$this->namespace}/variations" === $request->get_route() ) {
			unset( $args['post_parent'] );
		}

		return $args;
	}

	/**
	 * Get a collection of posts and add the post title filter option to WP_Query.
	 *
	 * @param WP_REST_Request $request Full details about the request.
	 * @return WP_Error|WP_REST_Response
	 */
	public function get_items( $request ) {
		add_filter( 'posts_where', array( __CLASS__, 'add_wp_query_filter' ), 10, 2 );
		add_filter( 'posts_join', array( __CLASS__, 'add_wp_query_join' ), 10, 2 );
		add_filter( 'posts_groupby', array( 'Automattic\WooCommerce\Admin\API\Products', 'add_wp_query_group_by' ), 10, 2 );
		$response = parent::get_items( $request );
		remove_filter( 'posts_where', array( __CLASS__, 'add_wp_query_filter' ), 10 );
		remove_filter( 'posts_join', array( __CLASS__, 'add_wp_query_join' ), 10 );
		remove_filter( 'posts_groupby', array( 'Automattic\WooCommerce\Admin\API\Products', 'add_wp_query_group_by' ), 10 );
		return $response;
	}

	/**
	 * Get the Product's schema, conforming to JSON Schema.
	 *
	 * @return array
	 */
	public function get_item_schema() {
		$schema = parent::get_item_schema();

		$schema['properties']['name']      = array(
			'description' => __( 'Product parent name.', 'woocommerce' ),
			'type'        => 'string',
			'context'     => array( 'view', 'edit' ),
		);
		$schema['properties']['type']      = array(
			'description' => __( 'Product type.', 'woocommerce' ),
			'type'        => 'string',
			'default'     => 'variation',
			'enum'        => array( 'variation' ),
			'context'     => array( 'view', 'edit' ),
		);
		$schema['properties']['parent_id'] = array(
			'description' => __( 'Product parent ID.', 'woocommerce' ),
			'type'        => 'integer',
			'context'     => array( 'view', 'edit' ),
		);

		return $schema;
	}

	/**
	 * Prepare a single variation output for response.
	 *
	 * @param  WC_Data         $object  Object data.
	 * @param  WP_REST_Request $request Request object.
	 * @return WP_REST_Response
	 */
	public function prepare_object_for_response( $object, $request ) {
		$context  = empty( $request['context'] ) ? 'view' : $request['context'];
		$response = parent::prepare_object_for_response( $object, $request );
		$data     = $response->get_data();

		$data['name']      = $object->get_name( $context );
		$data['type']      = $object->get_type();
		$data['parent_id'] = $object->get_parent_id( $context );

		$response->set_data( $data );

		return $response;
	}
}
woocommerce-admin/src/API/Orders.php000064400000022264151335517650013341 0ustar00<?php
/**
 * REST API Orders Controller
 *
 * Handles requests to /orders/*
 */

namespace Automattic\WooCommerce\Admin\API;

defined( 'ABSPATH' ) || exit;

use Automattic\WooCommerce\Admin\API\Reports\Controller as ReportsController;

/**
 * Orders controller.
 *
 * @extends WC_REST_Orders_Controller
 */
class Orders extends \WC_REST_Orders_Controller {
	/**
	 * Endpoint namespace.
	 *
	 * @var string
	 */
	protected $namespace = 'wc-analytics';

	/**
	 * Get the query params for collections.
	 *
	 * @return array
	 */
	public function get_collection_params() {
		$params = parent::get_collection_params();
		// This needs to remain a string to support extensions that filter Order Number.
		$params['number'] = array(
			'description'       => __( 'Limit result set to orders matching part of an order number.', 'woocommerce' ),
			'type'              => 'string',
			'validate_callback' => 'rest_validate_request_arg',
		);
		// Fix the default 'status' value until it can be patched in core.
		$params['status']['default'] = array( 'any' );

		// Analytics settings may affect the allowed status list.
		$params['status']['items']['enum'] = ReportsController::get_order_statuses();

		return $params;
	}

	/**
	 * Prepare objects query.
	 *
	 * @param  WP_REST_Request $request Full details about the request.
	 * @return array
	 */
	protected function prepare_objects_query( $request ) {
		global $wpdb;
		$args = parent::prepare_objects_query( $request );

		// Search by partial order number.
		if ( ! empty( $request['number'] ) ) {
			$partial_number = trim( $request['number'] );
			$limit          = intval( $args['posts_per_page'] );
			$order_ids      = $wpdb->get_col(
				$wpdb->prepare(
					"SELECT ID
					FROM {$wpdb->prefix}posts
					WHERE post_type = 'shop_order'
					AND ID LIKE %s
					LIMIT %d",
					$wpdb->esc_like( absint( $partial_number ) ) . '%',
					$limit
				)
			);

			// Force WP_Query return empty if don't found any order.
			$order_ids        = empty( $order_ids ) ? array( 0 ) : $order_ids;
			$args['post__in'] = $order_ids;
		}

		return $args;
	}

	/**
	 * Get product IDs, names, and quantity from order ID.
	 *
	 * @param array $order_id ID of order.
	 * @return array
	 */
	protected function get_products_by_order_id( $order_id ) {
		global $wpdb;
		$order_items_table    = $wpdb->prefix . 'woocommerce_order_items';
		$order_itemmeta_table = $wpdb->prefix . 'woocommerce_order_itemmeta';
		$products             = $wpdb->get_results(
			$wpdb->prepare(
				// phpcs:disable WordPress.DB.PreparedSQL.InterpolatedNotPrepared
				"SELECT
				order_id,
				order_itemmeta.meta_value as product_id,
				order_itemmeta_2.meta_value as product_quantity,
				order_itemmeta_3.meta_value as variation_id,
				{$wpdb->posts}.post_title as product_name
			FROM {$order_items_table} order_items
			    LEFT JOIN {$order_itemmeta_table} order_itemmeta on order_items.order_item_id = order_itemmeta.order_item_id
			    LEFT JOIN {$order_itemmeta_table} order_itemmeta_2 on order_items.order_item_id = order_itemmeta_2.order_item_id
			    LEFT JOIN {$order_itemmeta_table} order_itemmeta_3 on order_items.order_item_id = order_itemmeta_3.order_item_id
			    LEFT JOIN {$wpdb->posts} on {$wpdb->posts}.ID = order_itemmeta.meta_value
			WHERE
				order_id = ( %d )
			    AND order_itemmeta.meta_key = '_product_id'
				AND order_itemmeta_2.meta_key = '_qty'
			  	AND order_itemmeta_3.meta_key = '_variation_id'
			GROUP BY product_id
			", // phpcs:enable WordPress.DB.PreparedSQL.InterpolatedNotPrepared
				$order_id
			),
			ARRAY_A
		);

		return $products;
	}

	/**
	 * Get customer data from customer_id.
	 *
	 * @param array $customer_id ID of customer.
	 * @return array
	 */
	protected function get_customer_by_id( $customer_id ) {
		global $wpdb;

		$customer_lookup_table = $wpdb->prefix . 'wc_customer_lookup';

		$customer = $wpdb->get_row(
			$wpdb->prepare(
				// phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared
				"SELECT * FROM {$customer_lookup_table} WHERE customer_id = ( %d )",
				$customer_id
			),
			ARRAY_A
		);

		return $customer;
	}

	/**
	 * Get formatted item data.
	 *
	 * @param  WC_Data $object WC_Data instance.
	 * @return array
	 */
	protected function get_formatted_item_data( $object ) {
		$extra_fields = array( 'customer', 'products' );
		$fields       = false;
		// Determine if the response fields were specified.
		if ( ! empty( $this->request['_fields'] ) ) {
			$fields = wp_parse_list( $this->request['_fields'] );

			if ( 0 === count( $fields ) ) {
				$fields = false;
			} else {
				$fields = array_map( 'trim', $fields );
			}
		}

		// Initially skip line items if we can.
		$using_order_class_override = is_a( $object, '\Automattic\WooCommerce\Admin\Overrides\Order' );
		if ( $using_order_class_override ) {
			$data = $object->get_data_without_line_items();
		} else {
			$data = $object->get_data();
		}

		$extra_fields      = false === $fields ? array() : array_intersect( $extra_fields, $fields );
		$format_decimal    = array( 'discount_total', 'discount_tax', 'shipping_total', 'shipping_tax', 'shipping_total', 'shipping_tax', 'cart_tax', 'total', 'total_tax' );
		$format_date       = array( 'date_created', 'date_modified', 'date_completed', 'date_paid' );
		$format_line_items = array( 'line_items', 'tax_lines', 'shipping_lines', 'fee_lines', 'coupon_lines' );

		// Add extra data as necessary.
		$extra_data = array();
		foreach ( $extra_fields as $field ) {
			switch ( $field ) {
				case 'customer':
					$extra_data['customer'] = $this->get_customer_by_id( $data['customer_id'] );
					break;
				case 'products':
					$extra_data['products'] = $this->get_products_by_order_id( $object->get_id() );
					break;
			}
		}
		// Format decimal values.
		foreach ( $format_decimal as $key ) {
			$data[ $key ] = wc_format_decimal( $data[ $key ], $this->request['dp'] );
		}

		// format total with order currency.
		if ( $object instanceof \WC_Order ) {
			$data['total_formatted'] = wp_strip_all_tags( html_entity_decode( $object->get_formatted_order_total() ), true );
		}

		// Format date values.
		foreach ( $format_date as $key ) {
			$datetime              = $data[ $key ];
			$data[ $key ]          = wc_rest_prepare_date_response( $datetime, false );
			$data[ $key . '_gmt' ] = wc_rest_prepare_date_response( $datetime );
		}

		// Format the order status.
		$data['status'] = 'wc-' === substr( $data['status'], 0, 3 ) ? substr( $data['status'], 3 ) : $data['status'];

		// Format requested line items.
		$formatted_line_items = array();

		foreach ( $format_line_items as $key ) {
			if ( false === $fields || in_array( $key, $fields, true ) ) {
				if ( $using_order_class_override ) {
					$line_item_data = $object->get_line_item_data( $key );
				} else {
					$line_item_data = $data[ $key ];
				}
				$formatted_line_items[ $key ] = array_values( array_map( array( $this, 'get_order_item_data' ), $line_item_data ) );
			}
		}

		// Refunds.
		$data['refunds'] = array();
		foreach ( $object->get_refunds() as $refund ) {
			$data['refunds'][] = array(
				'id'     => $refund->get_id(),
				'reason' => $refund->get_reason() ? $refund->get_reason() : '',
				'total'  => '-' . wc_format_decimal( $refund->get_amount(), $this->request['dp'] ),
			);
		}

		return array_merge(
			array(
				'id'                   => $object->get_id(),
				'parent_id'            => $data['parent_id'],
				'number'               => $data['number'],
				'order_key'            => $data['order_key'],
				'created_via'          => $data['created_via'],
				'version'              => $data['version'],
				'status'               => $data['status'],
				'currency'             => $data['currency'],
				'date_created'         => $data['date_created'],
				'date_created_gmt'     => $data['date_created_gmt'],
				'date_modified'        => $data['date_modified'],
				'date_modified_gmt'    => $data['date_modified_gmt'],
				'discount_total'       => $data['discount_total'],
				'discount_tax'         => $data['discount_tax'],
				'shipping_total'       => $data['shipping_total'],
				'shipping_tax'         => $data['shipping_tax'],
				'cart_tax'             => $data['cart_tax'],
				'total'                => $data['total'],
				'total_formatted'      => isset( $data['total_formatted'] ) ? $data['total_formatted'] : $data['total'],
				'total_tax'            => $data['total_tax'],
				'prices_include_tax'   => $data['prices_include_tax'],
				'customer_id'          => $data['customer_id'],
				'customer_ip_address'  => $data['customer_ip_address'],
				'customer_user_agent'  => $data['customer_user_agent'],
				'customer_note'        => $data['customer_note'],
				'billing'              => $data['billing'],
				'shipping'             => $data['shipping'],
				'payment_method'       => $data['payment_method'],
				'payment_method_title' => $data['payment_method_title'],
				'transaction_id'       => $data['transaction_id'],
				'date_paid'            => $data['date_paid'],
				'date_paid_gmt'        => $data['date_paid_gmt'],
				'date_completed'       => $data['date_completed'],
				'date_completed_gmt'   => $data['date_completed_gmt'],
				'cart_hash'            => $data['cart_hash'],
				'meta_data'            => $data['meta_data'],
				'refunds'              => $data['refunds'],
			),
			$formatted_line_items,
			$extra_data
		);
	}
}
woocommerce-admin/src/API/Marketing.php000064400000006521151335517650014022 0ustar00<?php
/**
 * REST API Marketing Controller
 *
 * Handles requests to /marketing.
 */

namespace Automattic\WooCommerce\Admin\API;

use Automattic\WooCommerce\Admin\Features\Marketing as MarketingFeature;
use Automattic\WooCommerce\Admin\PluginsHelper;

defined( 'ABSPATH' ) || exit;

/**
 * Marketing Controller.
 *
 * @extends WC_REST_Data_Controller
 */
class Marketing extends \WC_REST_Data_Controller {

	/**
	 * Endpoint namespace.
	 *
	 * @var string
	 */
	protected $namespace = 'wc-admin';

	/**
	 * Route base.
	 *
	 * @var string
	 */
	protected $rest_base = 'marketing';

	/**
	 * Register routes.
	 */
	public function register_routes() {
		register_rest_route(
			$this->namespace,
			'/' . $this->rest_base . '/recommended',
			array(
				array(
					'methods'             => \WP_REST_Server::READABLE,
					'callback'            => array( $this, 'get_recommended_plugins' ),
					'permission_callback' => array( $this, 'get_items_permissions_check' ),
					'args'                => array(
						'per_page' => $this->get_collection_params()['per_page'],
						'category' => array(
							'type'              => 'string',
							'validate_callback' => 'rest_validate_request_arg',
							'sanitize_callback' => 'sanitize_title_with_dashes',
						),
					),
				),
				'schema' => array( $this, 'get_public_item_schema' ),
			)
		);

		register_rest_route(
			$this->namespace,
			'/' . $this->rest_base . '/knowledge-base',
			array(
				array(
					'methods'             => \WP_REST_Server::READABLE,
					'callback'            => array( $this, 'get_knowledge_base_posts' ),
					'permission_callback' => array( $this, 'get_items_permissions_check' ),
					'args'                => array(
						'category' => array(
							'type'              => 'string',
							'validate_callback' => 'rest_validate_request_arg',
							'sanitize_callback' => 'sanitize_title_with_dashes',
						),
					),
				),
				'schema' => array( $this, 'get_public_item_schema' ),
			)
		);
	}

	/**
	 * Return installed marketing extensions data.
	 *
	 * @param \WP_REST_Request $request Request data.
	 *
	 * @return \WP_Error|\WP_REST_Response
	 */
	public function get_recommended_plugins( $request ) {
		// Default to marketing category (if no category set).
		$category      = ( ! empty( $request->get_param( 'category' ) ) ) ? $request->get_param( 'category' ) : 'marketing';
		$all_plugins   = MarketingFeature::get_instance()->get_recommended_plugins();
		$valid_plugins = [];
		$per_page      = $request->get_param( 'per_page' );

		foreach ( $all_plugins as $plugin ) {

			// default to marketing if 'categories' is empty on the plugin object (support for legacy api while testing).
			$plugin_categories = ( ! empty( $plugin['categories'] ) ) ? $plugin['categories'] : [ 'marketing' ];

			if ( ! PluginsHelper::is_plugin_installed( $plugin['plugin'] ) && in_array( $category, $plugin_categories, true ) ) {
				$valid_plugins[] = $plugin;
			}
		}

		return rest_ensure_response( array_slice( $valid_plugins, 0, $per_page ) );
	}

	/**
	 * Return installed marketing extensions data.
	 *
	 * @param \WP_REST_Request $request Request data.
	 *
	 * @return \WP_Error|\WP_REST_Response
	 */
	public function get_knowledge_base_posts( $request ) {
		$category = $request->get_param( 'category' );
		return rest_ensure_response( MarketingFeature::get_instance()->get_knowledge_base_posts( $category ) );
	}
}
woocommerce-admin/src/API/CustomAttributeTraits.php000064400000006576151335517650016440 0ustar00<?php
/**
 * Traits for handling custom product attributes and their terms.
 */

namespace Automattic\WooCommerce\Admin\API;

defined( 'ABSPATH' ) || exit;

/**
 * CustomAttributeTraits class.
 */
trait CustomAttributeTraits {
	/**
	 * Get a single attribute by its slug.
	 *
	 * @param string $slug The attribute slug.
	 * @return WP_Error|object The matching attribute object or WP_Error if not found.
	 */
	public function get_custom_attribute_by_slug( $slug ) {
		$matching_attributes = $this->get_custom_attributes( array( 'slug' => $slug ) );

		if ( empty( $matching_attributes ) ) {
			return new \WP_Error(
				'woocommerce_rest_product_attribute_not_found',
				__( 'No product attribute with that slug was found.', 'woocommerce' ),
				array( 'status' => 404 )
			);
		}

		foreach ( $matching_attributes as $attribute_key => $attribute_value ) {
			return array( $attribute_key => $attribute_value );
		}
	}

	/**
	 * Query custom attributes by name or slug.
	 *
	 * @param string $args Search arguments, either name or slug.
	 * @return array Matching attributes, formatted for response.
	 */
	protected function get_custom_attributes( $args ) {
		global $wpdb;

		$args = wp_parse_args(
			$args,
			array(
				'name' => '',
				'slug' => '',
			)
		);

		if ( empty( $args['name'] ) && empty( $args['slug'] ) ) {
			return array();
		}

		$mode = $args['name'] ? 'name' : 'slug';

		if ( 'name' === $mode ) {
			$name = $args['name'];
			// Get as close as we can to matching the name property of custom attributes using SQL.
			$like = '%"name";s:%:"%' . $wpdb->esc_like( $name ) . '%"%';
		} else {
			$slug = sanitize_title_for_query( $args['slug'] );
			// Get as close as we can to matching the slug property of custom attributes using SQL.
			$like = '%s:' . strlen( $slug ) . ':"' . $slug . '";a:6:{%';
		}

		// Find all serialized product attributes with names like the search string.
		$query_results = $wpdb->get_results(
			$wpdb->prepare(
				"SELECT meta_value
				FROM {$wpdb->postmeta}
				WHERE meta_key = '_product_attributes'
				AND meta_value LIKE %s
				LIMIT 100",
				$like
			),
			ARRAY_A
		);

		$custom_attributes = array();

		foreach ( $query_results as $raw_product_attributes ) {

			$meta_attributes = maybe_unserialize( $raw_product_attributes['meta_value'] );

			if ( empty( $meta_attributes ) || ! is_array( $meta_attributes ) ) {
				continue;
			}

			foreach ( $meta_attributes as $meta_attribute_key => $meta_attribute_value ) {
				$meta_value = array_merge(
					array(
						'name'        => '',
						'is_taxonomy' => 0,
					),
					(array) $meta_attribute_value
				);

				// Skip non-custom attributes.
				if ( ! empty( $meta_value['is_taxonomy'] ) ) {
					continue;
				}

				// Skip custom attributes that didn't match the query.
				// (There can be any number of attributes in the meta value).
				if ( ( 'name' === $mode ) && ( false === stripos( $meta_value['name'], $name ) ) ) {
					continue;
				}

				if ( ( 'slug' === $mode ) && ( $meta_attribute_key !== $slug ) ) {
					continue;
				}

				// Combine all values when there are multiple matching custom attributes.
				if ( isset( $custom_attributes[ $meta_attribute_key ] ) ) {
					$custom_attributes[ $meta_attribute_key ]['value'] .= ' ' . WC_DELIMITER . ' ' . $meta_value['value'];
				} else {
					$custom_attributes[ $meta_attribute_key ] = $meta_attribute_value;
				}
			}
		}

		return $custom_attributes;
	}
}
woocommerce-admin/src/API/Products.php000064400000023172151335517650013705 0ustar00<?php
/**
 * REST API Products Controller
 *
 * Handles requests to /products/*
 */

namespace Automattic\WooCommerce\Admin\API;

defined( 'ABSPATH' ) || exit;

/**
 * Products controller.
 *
 * @extends WC_REST_Products_Controller
 */
class Products extends \WC_REST_Products_Controller {

	/**
	 * Endpoint namespace.
	 *
	 * @var string
	 */
	protected $namespace = 'wc-analytics';

	/**
	 * Local cache of last order dates by ID.
	 *
	 * @var array
	 */
	protected $last_order_dates = array();

	/**
	 * Adds properties that can be embed via ?_embed=1.
	 *
	 * @return array
	 */
	public function get_item_schema() {
		$schema = parent::get_item_schema();

		$properties_to_embed = array(
			'id',
			'name',
			'slug',
			'permalink',
			'images',
			'description',
			'short_description',
		);

		foreach ( $properties_to_embed as $property ) {
			$schema['properties'][ $property ]['context'][] = 'embed';
		}

		$schema['properties']['last_order_date'] = array(
			'description' => __( "The date the last order for this product was placed, in the site's timezone.", 'woocommerce' ),
			'type'        => 'date-time',
			'context'     => array( 'view', 'edit' ),
			'readonly'    => true,
		);

		return $schema;
	}

	/**
	 * Get the query params for collections.
	 *
	 * @return array
	 */
	public function get_collection_params() {
		$params                 = parent::get_collection_params();
		$params['low_in_stock'] = array(
			'description'       => __( 'Limit result set to products that are low or out of stock. (Deprecated)', 'woocommerce' ),
			'type'              => 'boolean',
			'default'           => false,
			'sanitize_callback' => 'wc_string_to_bool',
		);
		$params['search']       = array(
			'description'       => __( 'Search by similar product name or sku.', 'woocommerce' ),
			'type'              => 'string',
			'validate_callback' => 'rest_validate_request_arg',
		);
		return $params;
	}


	/**
	 * Add product name and sku filtering to the WC API.
	 *
	 * @param WP_REST_Request $request Request data.
	 * @return array
	 */
	protected function prepare_objects_query( $request ) {
		$args = parent::prepare_objects_query( $request );

		if ( ! empty( $request['search'] ) ) {
			$args['search'] = trim( $request['search'] );
			unset( $args['s'] );
		}
		if ( ! empty( $request['low_in_stock'] ) ) {
			$args['low_in_stock'] = $request['low_in_stock'];
			$args['post_type']    = array( 'product', 'product_variation' );
		}

		return $args;
	}

	/**
	 * Get a collection of posts and add the post title filter option to WP_Query.
	 *
	 * @param WP_REST_Request $request Full details about the request.
	 * @return WP_Error|WP_REST_Response
	 */
	public function get_items( $request ) {
		add_filter( 'posts_fields', array( __CLASS__, 'add_wp_query_fields' ), 10, 2 );
		add_filter( 'posts_where', array( __CLASS__, 'add_wp_query_filter' ), 10, 2 );
		add_filter( 'posts_join', array( __CLASS__, 'add_wp_query_join' ), 10, 2 );
		add_filter( 'posts_groupby', array( __CLASS__, 'add_wp_query_group_by' ), 10, 2 );
		$response = parent::get_items( $request );
		remove_filter( 'posts_fields', array( __CLASS__, 'add_wp_query_fields' ), 10 );
		remove_filter( 'posts_where', array( __CLASS__, 'add_wp_query_filter' ), 10 );
		remove_filter( 'posts_join', array( __CLASS__, 'add_wp_query_join' ), 10 );
		remove_filter( 'posts_groupby', array( __CLASS__, 'add_wp_query_group_by' ), 10 );

		/**
		 * The low stock query caused performance issues in WooCommerce 5.5.1
		 * due to a) being slow, and b) multiple requests being made to this endpoint
		 * from WC Admin.
		 *
		 * This is a temporary measure to trigger the user’s browser to cache the
		 * endpoint response for 1 minute, limiting the amount of requests overall.
		 *
		 * https://github.com/woocommerce/woocommerce-admin/issues/7358
		 */
		if ( $this->is_low_in_stock_request( $request ) ) {
			$response->header( 'Cache-Control', 'max-age=300' );
		}
		return $response;
	}

	/**
	 * Check whether the request is for products low in stock.
	 *
	 * It matches requests with paramaters:
	 *
	 * low_in_stock = true
	 * page = 1
	 * fields[0] = id
	 *
	 * @param string $request WP REST API request.
	 * @return boolean Whether the request matches.
	 */
	private function is_low_in_stock_request( $request ) {
		if (
			$request->get_param( 'low_in_stock' ) === true &&
			$request->get_param( 'page' ) === 1 &&
			is_array( $request->get_param( '_fields' ) ) &&
			count( $request->get_param( '_fields' ) ) === 1 &&
			in_array( 'id', $request->get_param( '_fields' ), true )
		) {
			return true;
		}

		return false;
	}

	/**
	 * Hang onto last order date since it will get removed by wc_get_product().
	 *
	 * @param stdClass $object_data Single row from query results.
	 * @return WC_Data
	 */
	public function get_object( $object_data ) {
		if ( isset( $object_data->last_order_date ) ) {
			$this->last_order_dates[ $object_data->ID ] = $object_data->last_order_date;
		}
		return parent::get_object( $object_data );
	}

	/**
	 * Add `low_stock_amount` property to product data
	 *
	 * @param WC_Data         $object  Object data.
	 * @param WP_REST_Request $request Request object.
	 * @return WP_REST_Response
	 */
	public function prepare_object_for_response( $object, $request ) {
		$data        = parent::prepare_object_for_response( $object, $request );
		$object_data = $object->get_data();
		$product_id  = $object_data['id'];

		if ( $request->get_param( 'low_in_stock' ) ) {
			if ( is_numeric( $object_data['low_stock_amount'] ) ) {
				$data->data['low_stock_amount'] = $object_data['low_stock_amount'];
			}
			if ( isset( $this->last_order_dates[ $product_id ] ) ) {
				$data->data['last_order_date'] = wc_rest_prepare_date_response( $this->last_order_dates[ $product_id ] );
			}
		}
		if ( isset( $data->data['name'] ) ) {
			$data->data['name'] = wp_strip_all_tags( $data->data['name'] );
		}

		return $data;
	}

	/**
	 * Add in conditional select fields to the query.
	 *
	 * @param string $select Select clause used to select fields from the query.
	 * @param object $wp_query WP_Query object.
	 * @return string
	 */
	public static function add_wp_query_fields( $select, $wp_query ) {
		if ( $wp_query->get( 'low_in_stock' ) ) {
			$fields  = array(
				'low_stock_amount_meta.meta_value AS low_stock_amount',
				'MAX( product_lookup.date_created ) AS last_order_date',
			);
			$select .= ', ' . implode( ', ', $fields );
		}

		return $select;
	}

	/**
	 * Add in conditional search filters for products.
	 *
	 * @param string $where Where clause used to search posts.
	 * @param object $wp_query WP_Query object.
	 * @return string
	 */
	public static function add_wp_query_filter( $where, $wp_query ) {
		global $wpdb;

		$search = $wp_query->get( 'search' );
		if ( $search ) {
			$title_like = '%' . $wpdb->esc_like( $search ) . '%';
			$where     .= $wpdb->prepare( " AND ({$wpdb->posts}.post_title LIKE %s", $title_like );  // phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared
			$where     .= wc_product_sku_enabled() ? $wpdb->prepare( ' OR wc_product_meta_lookup.sku LIKE %s)', $search ) : ')';
		}

		if ( $wp_query->get( 'low_in_stock' ) ) {
			$low_stock_amount = absint( max( get_option( 'woocommerce_notify_low_stock_amount' ), 1 ) );
			$where           .= "
			AND wc_product_meta_lookup.stock_quantity IS NOT NULL
			AND wc_product_meta_lookup.stock_status IN('instock','outofstock')
			AND (
				(
					low_stock_amount_meta.meta_value > ''
					AND wc_product_meta_lookup.stock_quantity <= CAST(low_stock_amount_meta.meta_value AS SIGNED)
				)
				OR (
					(
						low_stock_amount_meta.meta_value IS NULL OR low_stock_amount_meta.meta_value <= ''
					)
					AND wc_product_meta_lookup.stock_quantity <= {$low_stock_amount}
				)
			)";
		}

		return $where;
	}

	/**
	 * Join posts meta tables when product search or low stock query is present.
	 *
	 * @param string $join Join clause used to search posts.
	 * @param object $wp_query WP_Query object.
	 * @return string
	 */
	public static function add_wp_query_join( $join, $wp_query ) {
		global $wpdb;

		$search = $wp_query->get( 'search' );
		if ( $search && wc_product_sku_enabled() ) {
			$join = self::append_product_sorting_table_join( $join );
		}

		if ( $wp_query->get( 'low_in_stock' ) ) {
			$product_lookup_table = $wpdb->prefix . 'wc_order_product_lookup';

			$join  = self::append_product_sorting_table_join( $join );
			$join .= " LEFT JOIN {$wpdb->postmeta} AS low_stock_amount_meta ON {$wpdb->posts}.ID = low_stock_amount_meta.post_id AND low_stock_amount_meta.meta_key = '_low_stock_amount' ";
			$join .= " LEFT JOIN {$product_lookup_table} product_lookup ON {$wpdb->posts}.ID = CASE
				WHEN {$wpdb->posts}.post_type = 'product' THEN product_lookup.product_id
				WHEN {$wpdb->posts}.post_type = 'product_variation' THEN product_lookup.variation_id
			END";
		}

		return $join;
	}

	/**
	 * Join wc_product_meta_lookup to posts if not already joined.
	 *
	 * @param string $sql SQL join.
	 * @return string
	 */
	protected static function append_product_sorting_table_join( $sql ) {
		global $wpdb;

		if ( ! strstr( $sql, 'wc_product_meta_lookup' ) ) {
			$sql .= " LEFT JOIN {$wpdb->wc_product_meta_lookup} wc_product_meta_lookup ON $wpdb->posts.ID = wc_product_meta_lookup.product_id ";
		}
		return $sql;
	}

	/**
	 * Group by post ID to prevent duplicates.
	 *
	 * @param string $groupby Group by clause used to organize posts.
	 * @param object $wp_query WP_Query object.
	 * @return string
	 */
	public static function add_wp_query_group_by( $groupby, $wp_query ) {
		global $wpdb;

		$search       = $wp_query->get( 'search' );
		$low_in_stock = $wp_query->get( 'low_in_stock' );
		if ( empty( $groupby ) && ( $search || $low_in_stock ) ) {
			$groupby = $wpdb->posts . '.ID';
		}
		return $groupby;
	}
}
woocommerce-admin/src/API/OnboardingFreeExtensions.php000064400000003477151335517650017054 0ustar00<?php
/**
 * REST API Onboarding Free Extensions Controller
 *
 * Handles requests to /onboarding/free-extensions
 */

namespace Automattic\WooCommerce\Admin\API;

defined( 'ABSPATH' ) || exit;

use Automattic\WooCommerce\Admin\Features\RemoteFreeExtensions\Init as RemoteFreeExtensions;

/**
 * Onboarding Payments Controller.
 *
 * @extends WC_REST_Data_Controller
 */
class OnboardingFreeExtensions extends \WC_REST_Data_Controller {

	/**
	 * Endpoint namespace.
	 *
	 * @var string
	 */
	protected $namespace = 'wc-admin';

	/**
	 * Route base.
	 *
	 * @var string
	 */
	protected $rest_base = 'onboarding/free-extensions';

	/**
	 * Register routes.
	 */
	public function register_routes() {
		register_rest_route(
			$this->namespace,
			'/' . $this->rest_base,
			array(
				array(
					'methods'             => \WP_REST_Server::READABLE,
					'callback'            => array( $this, 'get_available_extensions' ),
					'permission_callback' => array( $this, 'get_items_permissions_check' ),
				),
				'schema' => array( $this, 'get_public_item_schema' ),
			)
		);
	}

	/**
	 * Check whether a given request has permission to read onboarding profile data.
	 *
	 * @param  WP_REST_Request $request Full details about the request.
	 * @return WP_Error|boolean
	 */
	public function get_items_permissions_check( $request ) {
		if ( ! wc_rest_check_manager_permissions( 'settings', 'read' ) ) {
			return new \WP_Error( 'woocommerce_rest_cannot_view', __( 'Sorry, you cannot list resources.', 'woocommerce' ), array( 'status' => rest_authorization_required_code() ) );
		}

		return true;
	}

	/**
	 * Return available payment methods.
	 *
	 * @param \WP_REST_Request $request Request data.
	 *
	 * @return \WP_Error|\WP_REST_Response
	 */
	public function get_available_extensions( $request ) {
		return RemoteFreeExtensions::get_extensions();
	}

}
woocommerce-admin/src/API/Reports/ParameterException.php000064400000000506151335517650017333 0ustar00<?php
/**
 * WooCommerce Admin Input Parameter Exception Class
 *
 * Exception class thrown when user provides incorrect parameters.
 */

namespace Automattic\WooCommerce\Admin\API\Reports;

defined( 'ABSPATH' ) || exit;

/**
 * API\Reports\ParameterException class.
 */
class ParameterException extends \WC_Data_Exception {}
woocommerce-admin/src/API/Reports/ExportableInterface.php000064400000001160151335517650017457 0ustar00<?php
/**
 * Reports Exportable Controller Interface
 */

namespace Automattic\WooCommerce\Admin\API\Reports;

if ( ! defined( 'ABSPATH' ) ) {
	exit;
}

/**
 * WooCommerce Reports exportable controller interface.
 *
 * @since 3.5.0
 */
interface ExportableInterface {

	/**
	 * Get the column names for export.
	 *
	 * @return array Key value pair of Column ID => Label.
	 */
	public function get_export_columns();

	/**
	 * Get the column values for export.
	 *
	 * @param array $item Single report item/row.
	 * @return array Key value pair of Column ID => Value.
	 */
	public function prepare_item_for_export( $item );
}
woocommerce-admin/src/API/Reports/Cache.php000064400000002753151335517650014545 0ustar00<?php
/**
 * REST API Reports Cache.
 *
 * Handles report data object caching.
 */

namespace Automattic\WooCommerce\Admin\API\Reports;

defined( 'ABSPATH' ) || exit;

/**
 * REST API Reports Cache class.
 */
class Cache {
	/**
	 * Cache version. Used to invalidate all cached values.
	 */
	const VERSION_OPTION = 'woocommerce_reports';

	/**
	 * Invalidate cache.
	 */
	public static function invalidate() {
		\WC_Cache_Helper::get_transient_version( self::VERSION_OPTION, true );
	}

	/**
	 * Get cache version number.
	 *
	 * @return string
	 */
	public static function get_version() {
		$version = \WC_Cache_Helper::get_transient_version( self::VERSION_OPTION );

		return $version;
	}

	/**
	 * Get cached value.
	 *
	 * @param string $key Cache key.
	 * @return mixed
	 */
	public static function get( $key ) {
		$transient_version = self::get_version();
		$transient_value   = get_transient( $key );

		if (
			isset( $transient_value['value'], $transient_value['version'] ) &&
			$transient_value['version'] === $transient_version
		) {
			return $transient_value['value'];
		}

		return false;
	}

	/**
	 * Update cached value.
	 *
	 * @param string $key   Cache key.
	 * @param mixed  $value New value.
	 * @return bool
	 */
	public static function set( $key, $value ) {
		$transient_version = self::get_version();
		$transient_value   = array(
			'version' => $transient_version,
			'value'   => $value,
		);

		$result = set_transient( $key, $transient_value, WEEK_IN_SECONDS );

		return $result;
	}
}
woocommerce-admin/src/API/Reports/Coupons/DataStore.php000064400000036342151335517650017057 0ustar00<?php
/**
 * API\Reports\Coupons\DataStore class file.
 */

namespace Automattic\WooCommerce\Admin\API\Reports\Coupons;

defined( 'ABSPATH' ) || exit;

use \Automattic\WooCommerce\Admin\API\Reports\DataStore as ReportsDataStore;
use \Automattic\WooCommerce\Admin\API\Reports\DataStoreInterface;
use \Automattic\WooCommerce\Admin\API\Reports\TimeInterval;
use \Automattic\WooCommerce\Admin\API\Reports\SqlQuery;
use \Automattic\WooCommerce\Admin\API\Reports\Cache as ReportsCache;

/**
 * API\Reports\Coupons\DataStore.
 */
class DataStore extends ReportsDataStore implements DataStoreInterface {

	/**
	 * Table used to get the data.
	 *
	 * @var string
	 */
	protected static $table_name = 'wc_order_coupon_lookup';

	/**
	 * Cache identifier.
	 *
	 * @var string
	 */
	protected $cache_key = 'coupons';

	/**
	 * Mapping columns to data type to return correct response types.
	 *
	 * @var array
	 */
	protected $column_types = array(
		'coupon_id'    => 'intval',
		'amount'       => 'floatval',
		'orders_count' => 'intval',
	);

	/**
	 * Data store context used to pass to filters.
	 *
	 * @var string
	 */
	protected $context = 'coupons';

	/**
	 * Assign report columns once full table name has been assigned.
	 */
	protected function assign_report_columns() {
		$table_name           = self::get_db_table_name();
		$this->report_columns = array(
			'coupon_id'    => 'coupon_id',
			'amount'       => 'SUM(discount_amount) as amount',
			'orders_count' => "COUNT(DISTINCT {$table_name}.order_id) as orders_count",
		);
	}

	/**
	 * Set up all the hooks for maintaining and populating table data.
	 */
	public static function init() {
		add_action( 'woocommerce_analytics_delete_order_stats', array( __CLASS__, 'sync_on_order_delete' ), 5 );
	}

	/**
	 * Returns an array of ids of included coupons, based on query arguments from the user.
	 *
	 * @param array $query_args Parameters supplied by the user.
	 * @return array
	 */
	protected function get_included_coupons_array( $query_args ) {
		if ( isset( $query_args['coupons'] ) && is_array( $query_args['coupons'] ) && count( $query_args['coupons'] ) > 0 ) {
			return $query_args['coupons'];
		}
		return array();
	}

	/**
	 * Updates the database query with parameters used for Products report: categories and order status.
	 *
	 * @param array $query_args Query arguments supplied by the user.
	 */
	protected function add_sql_query_params( $query_args ) {
		global $wpdb;
		$order_coupon_lookup_table = self::get_db_table_name();

		$this->add_time_period_sql_params( $query_args, $order_coupon_lookup_table );
		$this->get_limit_sql_params( $query_args );

		$included_coupons = $this->get_included_coupons( $query_args, 'coupons' );
		if ( $included_coupons ) {
			$this->subquery->add_sql_clause( 'where', "AND {$order_coupon_lookup_table}.coupon_id IN ({$included_coupons})" );

			$this->add_order_by_params( $query_args, 'outer', 'default_results.coupon_id' );
		} else {
			$this->add_order_by_params( $query_args, 'inner', "{$order_coupon_lookup_table}.coupon_id" );
		}

		$this->add_order_status_clause( $query_args, $order_coupon_lookup_table, $this->subquery );
	}

	/**
	 * Fills ORDER BY clause of SQL request based on user supplied parameters.
	 *
	 * @param array  $query_args Parameters supplied by the user.
	 * @param string $from_arg   Target of the JOIN sql param.
	 * @param string $id_cell    ID cell identifier, like `table_name.id_column_name`.
	 */
	protected function add_order_by_params( $query_args, $from_arg, $id_cell ) {
		global $wpdb;
		$lookup_table    = self::get_db_table_name();
		$order_by_clause = $this->add_order_by_clause( $query_args, $this );
		$join            = "JOIN {$wpdb->posts} AS _coupons ON {$id_cell} = _coupons.ID";
		$this->add_orderby_order_clause( $query_args, $this );

		if ( 'inner' === $from_arg ) {
			$this->subquery->clear_sql_clause( 'join' );
			if ( false !== strpos( $order_by_clause, '_coupons' ) ) {
				$this->subquery->add_sql_clause( 'join', $join );
			}
		} else {
			$this->clear_sql_clause( 'join' );
			if ( false !== strpos( $order_by_clause, '_coupons' ) ) {
				$this->add_sql_clause( 'join', $join );
			}
		}
	}

	/**
	 * Maps ordering specified by the user to columns in the database/fields in the data.
	 *
	 * @param string $order_by Sorting criterion.
	 * @return string
	 */
	protected function normalize_order_by( $order_by ) {
		if ( 'date' === $order_by ) {
			return 'time_interval';
		}
		if ( 'code' === $order_by ) {
			return '_coupons.post_title';
		}
		return $order_by;
	}

	/**
	 * Enriches the coupon data with extra attributes.
	 *
	 * @param array $coupon_data Coupon data.
	 * @param array $query_args Query parameters.
	 */
	protected function include_extended_info( &$coupon_data, $query_args ) {
		foreach ( $coupon_data as $idx => $coupon_datum ) {
			$extended_info = new \ArrayObject();
			if ( $query_args['extended_info'] ) {
				$coupon_id = $coupon_datum['coupon_id'];
				$coupon    = new \WC_Coupon( $coupon_id );

				if ( 0 === $coupon->get_id() ) {
					// Deleted or otherwise invalid coupon.
					$extended_info = array(
						'code'             => __( '(Deleted)', 'woocommerce' ),
						'date_created'     => '',
						'date_created_gmt' => '',
						'date_expires'     => '',
						'date_expires_gmt' => '',
						'discount_type'    => __( 'N/A', 'woocommerce' ),
					);
				} else {
					$gmt_timzone = new \DateTimeZone( 'UTC' );

					$date_expires = $coupon->get_date_expires();
					if ( is_a( $date_expires, 'DateTime' ) ) {
						$date_expires     = $date_expires->format( TimeInterval::$iso_datetime_format );
						$date_expires_gmt = new \DateTime( $date_expires );
						$date_expires_gmt->setTimezone( $gmt_timzone );
						$date_expires_gmt = $date_expires_gmt->format( TimeInterval::$iso_datetime_format );
					} else {
						$date_expires     = '';
						$date_expires_gmt = '';
					}

					$date_created = $coupon->get_date_created();
					if ( is_a( $date_created, 'DateTime' ) ) {
						$date_created     = $date_created->format( TimeInterval::$iso_datetime_format );
						$date_created_gmt = new \DateTime( $date_created );
						$date_created_gmt->setTimezone( $gmt_timzone );
						$date_created_gmt = $date_created_gmt->format( TimeInterval::$iso_datetime_format );
					} else {
						$date_created     = '';
						$date_created_gmt = '';
					}

					$extended_info = array(
						'code'             => $coupon->get_code(),
						'date_created'     => $date_created,
						'date_created_gmt' => $date_created_gmt,
						'date_expires'     => $date_expires,
						'date_expires_gmt' => $date_expires_gmt,
						'discount_type'    => $coupon->get_discount_type(),
					);
				}
			}
			$coupon_data[ $idx ]['extended_info'] = $extended_info;
		}
	}

	/**
	 * Returns the report data based on parameters supplied by the user.
	 *
	 * @param array $query_args  Query parameters.
	 * @return stdClass|WP_Error Data.
	 */
	public function get_data( $query_args ) {
		global $wpdb;

		$table_name = self::get_db_table_name();

		// These defaults are only partially applied when used via REST API, as that has its own defaults.
		$defaults   = array(
			'per_page'      => get_option( 'posts_per_page' ),
			'page'          => 1,
			'order'         => 'DESC',
			'orderby'       => 'coupon_id',
			'before'        => TimeInterval::default_before(),
			'after'         => TimeInterval::default_after(),
			'fields'        => '*',
			'coupons'       => array(),
			'extended_info' => false,
		);
		$query_args = wp_parse_args( $query_args, $defaults );
		$this->normalize_timezones( $query_args, $defaults );

		/*
		 * We need to get the cache key here because
		 * parent::update_intervals_sql_params() modifies $query_args.
		 */
		$cache_key = $this->get_cache_key( $query_args );
		$data      = $this->get_cached_data( $cache_key );

		if ( false === $data ) {
			$this->initialize_queries();

			$data = (object) array(
				'data'    => array(),
				'total'   => 0,
				'pages'   => 0,
				'page_no' => 0,
			);

			$selections       = $this->selected_columns( $query_args );
			$included_coupons = $this->get_included_coupons_array( $query_args );
			$limit_params     = $this->get_limit_params( $query_args );
			$this->subquery->add_sql_clause( 'select', $selections );
			$this->add_sql_query_params( $query_args );

			if ( count( $included_coupons ) > 0 ) {
				$total_results = count( $included_coupons );
				$total_pages   = (int) ceil( $total_results / $limit_params['per_page'] );

				$fields    = $this->get_fields( $query_args );
				$ids_table = $this->get_ids_table( $included_coupons, 'coupon_id' );

				$this->add_sql_clause( 'select', $this->format_join_selections( $fields, array( 'coupon_id' ) ) );
				$this->add_sql_clause( 'from', '(' );
				$this->add_sql_clause( 'from', $this->subquery->get_query_statement() );
				$this->add_sql_clause( 'from', ") AS {$table_name}" );
				$this->add_sql_clause(
					'right_join',
					"RIGHT JOIN ( {$ids_table} ) AS default_results
					ON default_results.coupon_id = {$table_name}.coupon_id"
				);

				$coupons_query = $this->get_query_statement();
			} else {
				$this->subquery->add_sql_clause( 'order_by', $this->get_sql_clause( 'order_by' ) );
				$this->subquery->add_sql_clause( 'limit', $this->get_sql_clause( 'limit' ) );
				$coupons_query = $this->subquery->get_query_statement();

				$this->subquery->clear_sql_clause( array( 'select', 'order_by' ) );
				$this->subquery->add_sql_clause( 'select', 'coupon_id' );
				$coupon_subquery = "SELECT COUNT(*) FROM (
					{$this->subquery->get_query_statement()}
				) AS tt";

				$db_records_count = (int) $wpdb->get_var(
					$coupon_subquery // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared
				);

				$total_results = $db_records_count;
				$total_pages   = (int) ceil( $db_records_count / $limit_params['per_page'] );
				if ( $query_args['page'] < 1 || $query_args['page'] > $total_pages ) {
					return $data;
				}
			}

			$coupon_data = $wpdb->get_results(
				$coupons_query, // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared
				ARRAY_A
			);
			if ( null === $coupon_data ) {
				return $data;
			}

			$this->include_extended_info( $coupon_data, $query_args );

			$coupon_data = array_map( array( $this, 'cast_numbers' ), $coupon_data );
			$data        = (object) array(
				'data'    => $coupon_data,
				'total'   => $total_results,
				'pages'   => $total_pages,
				'page_no' => (int) $query_args['page'],
			);

			$this->set_cached_data( $cache_key, $data );
		}

		return $data;
	}

	/**
	 * Get coupon ID for an order.
	 *
	 * Tries to get the ID from order item meta, then falls back to a query of published coupons.
	 *
	 * @param \WC_Order_Item_Coupon $coupon_item The coupon order item object.
	 * @return int Coupon ID on success, 0 on failure.
	 */
	public static function get_coupon_id( \WC_Order_Item_Coupon $coupon_item ) {
		// First attempt to get coupon ID from order item data.
		$coupon_data = $coupon_item->get_meta( 'coupon_data', true );

		// Normal checkout orders should have this data.
		// See: https://github.com/woocommerce/woocommerce/blob/3dc7df7af9f7ca0c0aa34ede74493e856f276abe/includes/abstracts/abstract-wc-order.php#L1206.
		if ( isset( $coupon_data['id'] ) ) {
			return $coupon_data['id'];
		}

		// Try to get the coupon ID using the code.
		return wc_get_coupon_id_by_code( $coupon_item->get_code() );
	}

	/**
	 * Create or update an an entry in the wc_order_coupon_lookup table for an order.
	 *
	 * @since 3.5.0
	 * @param int $order_id Order ID.
	 * @return int|bool Returns -1 if order won't be processed, or a boolean indicating processing success.
	 */
	public static function sync_order_coupons( $order_id ) {
		global $wpdb;

		$order = wc_get_order( $order_id );

		if ( ! $order ) {
			return -1;
		}

		// Refunds don't affect coupon stats so return successfully if one is called here.
		if ( 'shop_order_refund' === $order->get_type() ) {
			return true;
		}

		$table_name     = self::get_db_table_name();
		$existing_items = $wpdb->get_col(
			$wpdb->prepare(
				// phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared
				"SELECT coupon_id FROM {$table_name} WHERE order_id = %d",
				$order_id
			)
		);
		$existing_items     = array_flip( $existing_items );
		$coupon_items       = $order->get_items( 'coupon' );
		$coupon_items_count = count( $coupon_items );
		$num_updated        = 0;
		$num_deleted        = 0;

		foreach ( $coupon_items as $coupon_item ) {
			$coupon_id = self::get_coupon_id( $coupon_item );
			unset( $existing_items[ $coupon_id ] );

			if ( ! $coupon_id ) {
				// Insert a unique, but obviously invalid ID for this deleted coupon.
				$num_deleted++;
				$coupon_id = -1 * $num_deleted;
			}

			$result = $wpdb->replace(
				self::get_db_table_name(),
				array(
					'order_id'        => $order_id,
					'coupon_id'       => $coupon_id,
					'discount_amount' => $coupon_item->get_discount(),
					'date_created'    => $order->get_date_created( 'edit' )->date( TimeInterval::$sql_datetime_format ),
				),
				array(
					'%d',
					'%d',
					'%f',
					'%s',
				)
			);

			/**
			 * Fires when coupon's reports are updated.
			 *
			 * @param int $coupon_id Coupon ID.
			 * @param int $order_id  Order ID.
			 */
			do_action( 'woocommerce_analytics_update_coupon', $coupon_id, $order_id );

			// Sum the rows affected. Using REPLACE can affect 2 rows if the row already exists.
			$num_updated += 2 === intval( $result ) ? 1 : intval( $result );
		}

		if ( ! empty( $existing_items ) ) {
			$existing_items = array_flip( $existing_items );
			$format         = array_fill( 0, count( $existing_items ), '%d' );
			$format         = implode( ',', $format );
			array_unshift( $existing_items, $order_id );
			$wpdb->query(
				$wpdb->prepare(
					// phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared
					"DELETE FROM {$table_name} WHERE order_id = %d AND coupon_id in ({$format})",
					$existing_items
				)
			);
		}

		return ( $coupon_items_count === $num_updated );
	}

	/**
	 * Clean coupons data when an order is deleted.
	 *
	 * @param int $order_id Order ID.
	 */
	public static function sync_on_order_delete( $order_id ) {
		global $wpdb;

		$wpdb->delete( self::get_db_table_name(), array( 'order_id' => $order_id ) );
		/**
		 * Fires when coupon's reports are removed from database.
		 *
		 * @param int $coupon_id Coupon ID.
		 * @param int $order_id  Order ID.
		 */
		do_action( 'woocommerce_analytics_delete_coupon', 0, $order_id );

		ReportsCache::invalidate();
	}

	/**
	 * Gets coupons based on the provided arguments.
	 *
	 * @todo Upon core merge, including this in core's `class-wc-coupon-data-store-cpt.php` might make more sense.
	 * @param array $args Array of args to filter the query by. Supports `include`.
	 * @return array Array of results.
	 */
	public function get_coupons( $args ) {
		global $wpdb;
		$query = "SELECT ID, post_title FROM {$wpdb->posts} WHERE post_type='shop_coupon'";

		$included_coupons = $this->get_included_coupons( $args, 'include' );
		if ( ! empty( $included_coupons ) ) {
			$query .= " AND ID IN ({$included_coupons})";
		}

		return $wpdb->get_results( $query ); // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared
	}

	/**
	 * Initialize query objects.
	 */
	protected function initialize_queries() {
		$this->clear_all_clauses();
		$this->subquery = new SqlQuery( $this->context . '_subquery' );
		$this->subquery->add_sql_clause( 'from', self::get_db_table_name() );
		$this->subquery->add_sql_clause( 'group_by', 'coupon_id' );
	}
}
woocommerce-admin/src/API/Reports/Coupons/Controller.php000064400000025323151335517650017311 0ustar00<?php
/**
 * REST API Reports coupons controller
 *
 * Handles requests to the /reports/coupons endpoint.
 */

namespace Automattic\WooCommerce\Admin\API\Reports\Coupons;

defined( 'ABSPATH' ) || exit;

use \Automattic\WooCommerce\Admin\API\Reports\ExportableInterface;

/**
 * REST API Reports coupons controller class.
 *
 * @extends WC_REST_Reports_Controller
 */
class Controller extends \WC_REST_Reports_Controller implements ExportableInterface {

	/**
	 * Endpoint namespace.
	 *
	 * @var string
	 */
	protected $namespace = 'wc-analytics';

	/**
	 * Route base.
	 *
	 * @var string
	 */
	protected $rest_base = 'reports/coupons';

	/**
	 * Maps query arguments from the REST request.
	 *
	 * @param array $request Request array.
	 * @return array
	 */
	protected function prepare_reports_query( $request ) {
		$args                  = array();
		$args['before']        = $request['before'];
		$args['after']         = $request['after'];
		$args['page']          = $request['page'];
		$args['per_page']      = $request['per_page'];
		$args['orderby']       = $request['orderby'];
		$args['order']         = $request['order'];
		$args['coupons']       = (array) $request['coupons'];
		$args['extended_info'] = $request['extended_info'];
		return $args;
	}

	/**
	 * Get all reports.
	 *
	 * @param WP_REST_Request $request Request data.
	 * @return array|WP_Error
	 */
	public function get_items( $request ) {
		$query_args    = $this->prepare_reports_query( $request );
		$coupons_query = new Query( $query_args );
		$report_data   = $coupons_query->get_data();

		$data = array();

		foreach ( $report_data->data as $coupons_data ) {
			$item   = $this->prepare_item_for_response( $coupons_data, $request );
			$data[] = $this->prepare_response_for_collection( $item );
		}

		$response = rest_ensure_response( $data );
		$response->header( 'X-WP-Total', (int) $report_data->total );
		$response->header( 'X-WP-TotalPages', (int) $report_data->pages );

		$page      = $report_data->page_no;
		$max_pages = $report_data->pages;
		$base      = add_query_arg( $request->get_query_params(), rest_url( sprintf( '/%s/%s', $this->namespace, $this->rest_base ) ) );
		if ( $page > 1 ) {
			$prev_page = $page - 1;
			if ( $prev_page > $max_pages ) {
				$prev_page = $max_pages;
			}
			$prev_link = add_query_arg( 'page', $prev_page, $base );
			$response->link_header( 'prev', $prev_link );
		}
		if ( $max_pages > $page ) {
			$next_page = $page + 1;
			$next_link = add_query_arg( 'page', $next_page, $base );
			$response->link_header( 'next', $next_link );
		}

		return $response;
	}

	/**
	 * Prepare a report object for serialization.
	 *
	 * @param stdClass        $report  Report data.
	 * @param WP_REST_Request $request Request object.
	 * @return WP_REST_Response
	 */
	public function prepare_item_for_response( $report, $request ) {
		$data = $report;

		$context = ! empty( $request['context'] ) ? $request['context'] : 'view';
		$data    = $this->add_additional_fields_to_object( $data, $request );
		$data    = $this->filter_response_by_context( $data, $context );

		// Wrap the data in a response object.
		$response = rest_ensure_response( $data );
		$response->add_links( $this->prepare_links( $report ) );

		/**
		 * Filter a report returned from the API.
		 *
		 * Allows modification of the report data right before it is returned.
		 *
		 * @param WP_REST_Response $response The response object.
		 * @param object           $report   The original report object.
		 * @param WP_REST_Request  $request  Request used to generate the response.
		 */
		return apply_filters( 'woocommerce_rest_prepare_report_coupons', $response, $report, $request );
	}

	/**
	 * Prepare links for the request.
	 *
	 * @param WC_Reports_Query $object Object data.
	 * @return array
	 */
	protected function prepare_links( $object ) {
		$links = array(
			'coupon' => array(
				'href' => rest_url( sprintf( '/%s/coupons/%d', $this->namespace, $object['coupon_id'] ) ),
			),
		);

		return $links;
	}

	/**
	 * Get the Report's schema, conforming to JSON Schema.
	 *
	 * @return array
	 */
	public function get_item_schema() {
		$schema = array(
			'$schema'    => 'http://json-schema.org/draft-04/schema#',
			'title'      => 'report_coupons',
			'type'       => 'object',
			'properties' => array(
				'coupon_id'     => array(
					'description' => __( 'Coupon ID.', 'woocommerce' ),
					'type'        => 'integer',
					'context'     => array( 'view', 'edit' ),
					'readonly'    => true,
				),
				'amount'        => array(
					'description' => __( 'Net discount amount.', 'woocommerce' ),
					'type'        => 'number',
					'context'     => array( 'view', 'edit' ),
					'readonly'    => true,
				),
				'orders_count'  => array(
					'description' => __( 'Number of orders.', 'woocommerce' ),
					'type'        => 'integer',
					'context'     => array( 'view', 'edit' ),
					'readonly'    => true,
				),
				'extended_info' => array(
					'code'             => array(
						'type'        => 'string',
						'readonly'    => true,
						'context'     => array( 'view', 'edit' ),
						'description' => __( 'Coupon code.', 'woocommerce' ),
					),
					'date_created'     => array(
						'type'        => 'date-time',
						'readonly'    => true,
						'context'     => array( 'view', 'edit' ),
						'description' => __( 'Coupon creation date.', 'woocommerce' ),
					),
					'date_created_gmt' => array(
						'type'        => 'date-time',
						'readonly'    => true,
						'context'     => array( 'view', 'edit' ),
						'description' => __( 'Coupon creation date in GMT.', 'woocommerce' ),
					),
					'date_expires'     => array(
						'type'        => 'date-time',
						'readonly'    => true,
						'context'     => array( 'view', 'edit' ),
						'description' => __( 'Coupon expiration date.', 'woocommerce' ),
					),
					'date_expires_gmt' => array(
						'type'        => 'date-time',
						'readonly'    => true,
						'context'     => array( 'view', 'edit' ),
						'description' => __( 'Coupon expiration date in GMT.', 'woocommerce' ),
					),
					'discount_type'    => array(
						'type'        => 'string',
						'readonly'    => true,
						'context'     => array( 'view', 'edit' ),
						'enum'        => array_keys( wc_get_coupon_types() ),
						'description' => __( 'Coupon discount type.', 'woocommerce' ),
					),
				),
			),
		);

		return $this->add_additional_fields_schema( $schema );
	}

	/**
	 * Get the query params for collections.
	 *
	 * @return array
	 */
	public function get_collection_params() {
		$params                  = array();
		$params['context']       = $this->get_context_param( array( 'default' => 'view' ) );
		$params['page']          = array(
			'description'       => __( 'Current page of the collection.', 'woocommerce' ),
			'type'              => 'integer',
			'default'           => 1,
			'sanitize_callback' => 'absint',
			'validate_callback' => 'rest_validate_request_arg',
			'minimum'           => 1,
		);
		$params['per_page']      = array(
			'description'       => __( 'Maximum number of items to be returned in result set.', 'woocommerce' ),
			'type'              => 'integer',
			'default'           => 10,
			'minimum'           => 1,
			'maximum'           => 100,
			'sanitize_callback' => 'absint',
			'validate_callback' => 'rest_validate_request_arg',
		);
		$params['after']         = array(
			'description'       => __( 'Limit response to resources published after a given ISO8601 compliant date.', 'woocommerce' ),
			'type'              => 'string',
			'format'            => 'date-time',
			'validate_callback' => 'rest_validate_request_arg',
		);
		$params['before']        = array(
			'description'       => __( 'Limit response to resources published before a given ISO8601 compliant date.', 'woocommerce' ),
			'type'              => 'string',
			'format'            => 'date-time',
			'validate_callback' => 'rest_validate_request_arg',
		);
		$params['order']         = array(
			'description'       => __( 'Order sort attribute ascending or descending.', 'woocommerce' ),
			'type'              => 'string',
			'default'           => 'desc',
			'enum'              => array( 'asc', 'desc' ),
			'validate_callback' => 'rest_validate_request_arg',
		);
		$params['orderby']       = array(
			'description'       => __( 'Sort collection by object attribute.', 'woocommerce' ),
			'type'              => 'string',
			'default'           => 'coupon_id',
			'enum'              => array(
				'coupon_id',
				'code',
				'amount',
				'orders_count',
			),
			'validate_callback' => 'rest_validate_request_arg',
		);
		$params['coupons']       = array(
			'description'       => __( 'Limit result set to coupons assigned specific coupon IDs.', 'woocommerce' ),
			'type'              => 'array',
			'sanitize_callback' => 'wp_parse_id_list',
			'validate_callback' => 'rest_validate_request_arg',
			'items'             => array(
				'type' => 'integer',
			),
		);
		$params['extended_info'] = array(
			'description'       => __( 'Add additional piece of info about each coupon to the report.', 'woocommerce' ),
			'type'              => 'boolean',
			'default'           => false,
			'sanitize_callback' => 'wc_string_to_bool',
			'validate_callback' => 'rest_validate_request_arg',
		);

		return $params;
	}

	/**
	 * Get the column names for export.
	 *
	 * @return array Key value pair of Column ID => Label.
	 */
	public function get_export_columns() {
		$export_columns = array(
			'code'         => __( 'Coupon code', 'woocommerce' ),
			'orders_count' => __( 'Orders', 'woocommerce' ),
			'amount'       => __( 'Amount discounted', 'woocommerce' ),
			'created'      => __( 'Created', 'woocommerce' ),
			'expires'      => __( 'Expires', 'woocommerce' ),
			'type'         => __( 'Type', 'woocommerce' ),
		);

		/**
		 * Filter to add or remove column names from the coupons report for
		 * export.
		 *
		 * @since 1.6.0
		 */
		return apply_filters(
			'woocommerce_report_coupons_export_columns',
			$export_columns
		);
	}

	/**
	 * Get the column values for export.
	 *
	 * @param array $item Single report item/row.
	 * @return array Key value pair of Column ID => Row Value.
	 */
	public function prepare_item_for_export( $item ) {
		$date_expires = empty( $item['extended_info']['date_expires'] )
			? __( 'N/A', 'woocommerce' )
			: $item['extended_info']['date_expires'];

		$export_item = array(
			'code'         => $item['extended_info']['code'],
			'orders_count' => $item['orders_count'],
			'amount'       => $item['amount'],
			'created'      => $item['extended_info']['date_created'],
			'expires'      => $date_expires,
			'type'         => $item['extended_info']['discount_type'],
		);

		/**
		 * Filter to prepare extra columns in the export item for the coupons
		 * report.
		 *
		 * @since 1.6.0
		 */
		return apply_filters(
			'woocommerce_report_coupons_prepare_export_item',
			$export_item,
			$item
		);
	}
}
woocommerce-admin/src/API/Reports/Coupons/Query.php000064400000002246151335517650016272 0ustar00<?php
/**
 * Class for parameter-based Coupons Report querying
 *
 * Example usage:
 * $args = array(
 *          'before'  => '2018-07-19 00:00:00',
 *          'after'   => '2018-07-05 00:00:00',
 *          'page'    => 2,
 *          'coupons' => array(5, 120),
 *         );
 * $report = new \Automattic\WooCommerce\Admin\API\Reports\Coupons\Query( $args );
 * $mydata = $report->get_data();
 */

namespace Automattic\WooCommerce\Admin\API\Reports\Coupons;

defined( 'ABSPATH' ) || exit;

use \Automattic\WooCommerce\Admin\API\Reports\Query as ReportsQuery;

/**
 * API\Reports\Coupons\Query
 */
class Query extends ReportsQuery {

	/**
	 * Valid fields for Products report.
	 *
	 * @return array
	 */
	protected function get_default_query_vars() {
		return array();
	}

	/**
	 * Get product data based on the current query vars.
	 *
	 * @return array
	 */
	public function get_data() {
		$args = apply_filters( 'woocommerce_analytics_coupons_query_args', $this->get_query_vars() );

		$data_store = \WC_Data_Store::load( 'report-coupons' );
		$results    = $data_store->get_data( $args );
		return apply_filters( 'woocommerce_analytics_coupons_select_query', $results, $args );
	}

}
woocommerce-admin/src/API/Reports/Coupons/Stats/Controller.php000064400000026731151335517650020413 0ustar00<?php
/**
 * REST API Reports coupons stats controller
 *
 * Handles requests to the /reports/coupons/stats endpoint.
 */

namespace Automattic\WooCommerce\Admin\API\Reports\Coupons\Stats;

defined( 'ABSPATH' ) || exit;

use \Automattic\WooCommerce\Admin\API\Reports\ParameterException;

/**
 * REST API Reports coupons stats controller class.
 *
 * @extends WC_REST_Reports_Controller
 */
class Controller extends \WC_REST_Reports_Controller {

	/**
	 * Endpoint namespace.
	 *
	 * @var string
	 */
	protected $namespace = 'wc-analytics';

	/**
	 * Route base.
	 *
	 * @var string
	 */
	protected $rest_base = 'reports/coupons/stats';


	/**
	 * Maps query arguments from the REST request.
	 *
	 * @param array $request Request array.
	 * @return array
	 */
	protected function prepare_reports_query( $request ) {
		$args              = array();
		$args['before']    = $request['before'];
		$args['after']     = $request['after'];
		$args['interval']  = $request['interval'];
		$args['page']      = $request['page'];
		$args['per_page']  = $request['per_page'];
		$args['orderby']   = $request['orderby'];
		$args['order']     = $request['order'];
		$args['coupons']   = (array) $request['coupons'];
		$args['segmentby'] = $request['segmentby'];
		$args['fields']    = $request['fields'];

		return $args;
	}

	/**
	 * Get all reports.
	 *
	 * @param WP_REST_Request $request Request data.
	 * @return array|WP_Error
	 */
	public function get_items( $request ) {
		$query_args    = $this->prepare_reports_query( $request );
		$coupons_query = new Query( $query_args );
		try {
			$report_data = $coupons_query->get_data();
		} catch ( ParameterException $e ) {
			return new \WP_Error( $e->getErrorCode(), $e->getMessage(), array( 'status' => $e->getCode() ) );
		}

		$out_data = array(
			'totals'    => get_object_vars( $report_data->totals ),
			'intervals' => array(),
		);

		foreach ( $report_data->intervals as $interval_data ) {
			$item                    = $this->prepare_item_for_response( (object) $interval_data, $request );
			$out_data['intervals'][] = $this->prepare_response_for_collection( $item );
		}

		$response = rest_ensure_response( $out_data );
		$response->header( 'X-WP-Total', (int) $report_data->total );
		$response->header( 'X-WP-TotalPages', (int) $report_data->pages );

		$page      = $report_data->page_no;
		$max_pages = $report_data->pages;
		$base      = add_query_arg( $request->get_query_params(), rest_url( sprintf( '/%s/%s', $this->namespace, $this->rest_base ) ) );
		if ( $page > 1 ) {
			$prev_page = $page - 1;
			if ( $prev_page > $max_pages ) {
				$prev_page = $max_pages;
			}
			$prev_link = add_query_arg( 'page', $prev_page, $base );
			$response->link_header( 'prev', $prev_link );
		}
		if ( $max_pages > $page ) {
			$next_page = $page + 1;
			$next_link = add_query_arg( 'page', $next_page, $base );
			$response->link_header( 'next', $next_link );
		}

		return $response;
	}

	/**
	 * Prepare a report object for serialization.
	 *
	 * @param stdClass        $report  Report data.
	 * @param WP_REST_Request $request Request object.
	 * @return WP_REST_Response
	 */
	public function prepare_item_for_response( $report, $request ) {
		$data = get_object_vars( $report );

		$context = ! empty( $request['context'] ) ? $request['context'] : 'view';
		$data    = $this->add_additional_fields_to_object( $data, $request );
		$data    = $this->filter_response_by_context( $data, $context );

		// Wrap the data in a response object.
		$response = rest_ensure_response( $data );

		/**
		 * Filter a report returned from the API.
		 *
		 * Allows modification of the report data right before it is returned.
		 *
		 * @param WP_REST_Response $response The response object.
		 * @param object           $report   The original report object.
		 * @param WP_REST_Request  $request  Request used to generate the response.
		 */
		return apply_filters( 'woocommerce_rest_prepare_report_coupons_stats', $response, $report, $request );
	}

	/**
	 * Get the Report's schema, conforming to JSON Schema.
	 *
	 * @return array
	 */
	public function get_item_schema() {
		$data_values = array(
			'amount'        => array(
				'description' => __( 'Net discount amount.', 'woocommerce' ),
				'type'        => 'number',
				'context'     => array( 'view', 'edit' ),
				'readonly'    => true,
				'indicator'   => true,
				'format'      => 'currency',
			),
			'coupons_count' => array(
				'description' => __( 'Number of coupons.', 'woocommerce' ),
				'type'        => 'integer',
				'context'     => array( 'view', 'edit' ),
				'readonly'    => true,
			),
			'orders_count'  => array(
				'title'       => __( 'Discounted orders', 'woocommerce' ),
				'description' => __( 'Number of discounted orders.', 'woocommerce' ),
				'type'        => 'integer',
				'context'     => array( 'view', 'edit' ),
				'readonly'    => true,
				'indicator'   => true,
			),
		);

		$segments = array(
			'segments' => array(
				'description' => __( 'Reports data grouped by segment condition.', 'woocommerce' ),
				'type'        => 'array',
				'context'     => array( 'view', 'edit' ),
				'readonly'    => true,
				'items'       => array(
					'type'       => 'object',
					'properties' => array(
						'segment_id' => array(
							'description' => __( 'Segment identificator.', 'woocommerce' ),
							'type'        => 'integer',
							'context'     => array( 'view', 'edit' ),
							'readonly'    => true,
						),
						'subtotals'  => array(
							'description' => __( 'Interval subtotals.', 'woocommerce' ),
							'type'        => 'object',
							'context'     => array( 'view', 'edit' ),
							'readonly'    => true,
							'properties'  => $data_values,
						),
					),
				),
			),
		);

		$totals = array_merge( $data_values, $segments );

		$schema = array(
			'$schema'    => 'http://json-schema.org/draft-04/schema#',
			'title'      => 'report_coupons_stats',
			'type'       => 'object',
			'properties' => array(
				'totals'    => array(
					'description' => __( 'Totals data.', 'woocommerce' ),
					'type'        => 'object',
					'context'     => array( 'view', 'edit' ),
					'readonly'    => true,
					'properties'  => $totals,
				),
				'intervals' => array(
					'description' => __( 'Reports data grouped by intervals.', 'woocommerce' ),
					'type'        => 'array',
					'context'     => array( 'view', 'edit' ),
					'readonly'    => true,
					'items'       => array(
						'type'       => 'object',
						'properties' => array(
							'interval'       => array(
								'description' => __( 'Type of interval.', 'woocommerce' ),
								'type'        => 'string',
								'context'     => array( 'view', 'edit' ),
								'readonly'    => true,
								'enum'        => array( 'day', 'week', 'month', 'year' ),
							),
							'date_start'     => array(
								'description' => __( "The date the report start, in the site's timezone.", 'woocommerce' ),
								'type'        => 'date-time',
								'context'     => array( 'view', 'edit' ),
								'readonly'    => true,
							),
							'date_start_gmt' => array(
								'description' => __( 'The date the report start, as GMT.', 'woocommerce' ),
								'type'        => 'date-time',
								'context'     => array( 'view', 'edit' ),
								'readonly'    => true,
							),
							'date_end'       => array(
								'description' => __( "The date the report end, in the site's timezone.", 'woocommerce' ),
								'type'        => 'date-time',
								'context'     => array( 'view', 'edit' ),
								'readonly'    => true,
							),
							'date_end_gmt'   => array(
								'description' => __( 'The date the report end, as GMT.', 'woocommerce' ),
								'type'        => 'date-time',
								'context'     => array( 'view', 'edit' ),
								'readonly'    => true,
							),
							'subtotals'      => array(
								'description' => __( 'Interval subtotals.', 'woocommerce' ),
								'type'        => 'object',
								'context'     => array( 'view', 'edit' ),
								'readonly'    => true,
								'properties'  => $totals,
							),
						),
					),
				),
			),
		);

		return $this->add_additional_fields_schema( $schema );
	}

	/**
	 * Get the query params for collections.
	 *
	 * @return array
	 */
	public function get_collection_params() {
		$params              = array();
		$params['context']   = $this->get_context_param( array( 'default' => 'view' ) );
		$params['page']      = array(
			'description'       => __( 'Current page of the collection.', 'woocommerce' ),
			'type'              => 'integer',
			'default'           => 1,
			'sanitize_callback' => 'absint',
			'validate_callback' => 'rest_validate_request_arg',
			'minimum'           => 1,
		);
		$params['per_page']  = array(
			'description'       => __( 'Maximum number of items to be returned in result set.', 'woocommerce' ),
			'type'              => 'integer',
			'default'           => 10,
			'minimum'           => 1,
			'maximum'           => 100,
			'sanitize_callback' => 'absint',
			'validate_callback' => 'rest_validate_request_arg',
		);
		$params['after']     = array(
			'description'       => __( 'Limit response to resources published after a given ISO8601 compliant date.', 'woocommerce' ),
			'type'              => 'string',
			'format'            => 'date-time',
			'validate_callback' => 'rest_validate_request_arg',
		);
		$params['before']    = array(
			'description'       => __( 'Limit response to resources published before a given ISO8601 compliant date.', 'woocommerce' ),
			'type'              => 'string',
			'format'            => 'date-time',
			'validate_callback' => 'rest_validate_request_arg',
		);
		$params['order']     = array(
			'description'       => __( 'Order sort attribute ascending or descending.', 'woocommerce' ),
			'type'              => 'string',
			'default'           => 'desc',
			'enum'              => array( 'asc', 'desc' ),
			'validate_callback' => 'rest_validate_request_arg',
		);
		$params['orderby']   = array(
			'description'       => __( 'Sort collection by object attribute.', 'woocommerce' ),
			'type'              => 'string',
			'default'           => 'date',
			'enum'              => array(
				'date',
				'amount',
				'coupons_count',
				'orders_count',
			),
			'validate_callback' => 'rest_validate_request_arg',
		);
		$params['interval']  = array(
			'description'       => __( 'Time interval to use for buckets in the returned data.', 'woocommerce' ),
			'type'              => 'string',
			'default'           => 'week',
			'enum'              => array(
				'hour',
				'day',
				'week',
				'month',
				'quarter',
				'year',
			),
			'validate_callback' => 'rest_validate_request_arg',
		);
		$params['coupons']   = array(
			'description'       => __( 'Limit result set to coupons assigned specific coupon IDs.', 'woocommerce' ),
			'type'              => 'array',
			'sanitize_callback' => 'wp_parse_id_list',
			'validate_callback' => 'rest_validate_request_arg',
			'items'             => array(
				'type' => 'integer',
			),
		);
		$params['segmentby'] = array(
			'description'       => __( 'Segment the response by additional constraint.', 'woocommerce' ),
			'type'              => 'string',
			'enum'              => array(
				'product',
				'variation',
				'category',
				'coupon',
			),
			'validate_callback' => 'rest_validate_request_arg',
		);
		$params['fields']    = array(
			'description'       => __( 'Limit stats fields to the specified items.', 'woocommerce' ),
			'type'              => 'array',
			'sanitize_callback' => 'wp_parse_slug_list',
			'validate_callback' => 'rest_validate_request_arg',
			'items'             => array(
				'type' => 'string',
			),
		);

		return $params;
	}
}
woocommerce-admin/src/API/Reports/Coupons/Stats/Query.php000064400000002305151335517650017364 0ustar00<?php
/**
 * Class for parameter-based Products Report querying
 *
 * Example usage:
 * $args = array(
 *          'before'  => '2018-07-19 00:00:00',
 *          'after'   => '2018-07-05 00:00:00',
 *          'page'    => 2,
 *          'coupons' => array(5, 120),
 *         );
 * $report = new \Automattic\WooCommerce\Admin\API\Reports\Coupons\Stats\Query( $args );
 * $mydata = $report->get_data();
 */

namespace Automattic\WooCommerce\Admin\API\Reports\Coupons\Stats;

defined( 'ABSPATH' ) || exit;

use \Automattic\WooCommerce\Admin\API\Reports\Query as ReportsQuery;

/**
 * API\Reports\Coupons\Stats\Query
 */
class Query extends ReportsQuery {

	/**
	 * Valid fields for Products report.
	 *
	 * @return array
	 */
	protected function get_default_query_vars() {
		return array();
	}

	/**
	 * Get product data based on the current query vars.
	 *
	 * @return array
	 */
	public function get_data() {
		$args = apply_filters( 'woocommerce_analytics_coupons_stats_query_args', $this->get_query_vars() );

		$data_store = \WC_Data_Store::load( 'report-coupons-stats' );
		$results    = $data_store->get_data( $args );
		return apply_filters( 'woocommerce_analytics_coupons_select_query', $results, $args );
	}

}
woocommerce-admin/src/API/Reports/Coupons/Stats/DataStore.php000064400000021311151335517650020143 0ustar00<?php
/**
 * API\Reports\Coupons\Stats\DataStore class file.
 */

namespace Automattic\WooCommerce\Admin\API\Reports\Coupons\Stats;

defined( 'ABSPATH' ) || exit;
use \Automattic\WooCommerce\Admin\API\Reports\Coupons\DataStore as CouponsDataStore;
use \Automattic\WooCommerce\Admin\API\Reports\DataStoreInterface;
use \Automattic\WooCommerce\Admin\API\Reports\TimeInterval;
use \Automattic\WooCommerce\Admin\API\Reports\SqlQuery;

/**
 * API\Reports\Coupons\Stats\DataStore.
 */
class DataStore extends CouponsDataStore implements DataStoreInterface {
	/**
	 * Mapping columns to data type to return correct response types.
	 *
	 * @var array
	 */
	protected $column_types = array(
		'date_start'     => 'strval',
		'date_end'       => 'strval',
		'date_start_gmt' => 'strval',
		'date_end_gmt'   => 'strval',
		'amount'         => 'floatval',
		'coupons_count'  => 'intval',
		'orders_count'   => 'intval',
	);

	/**
	 * SQL columns to select in the db query.
	 *
	 * @var array
	 */
	protected $report_columns;

	/**
	 * Data store context used to pass to filters.
	 *
	 * @var string
	 */
	protected $context = 'coupons_stats';

	/**
	 * Cache identifier.
	 *
	 * @var string
	 */
	protected $cache_key = 'coupons_stats';

	/**
	 * Assign report columns once full table name has been assigned.
	 */
	protected function assign_report_columns() {
		$table_name           = self::get_db_table_name();
		$this->report_columns = array(
			'amount'        => 'SUM(discount_amount) as amount',
			'coupons_count' => 'COUNT(DISTINCT coupon_id) as coupons_count',
			'orders_count'  => "COUNT(DISTINCT {$table_name}.order_id) as orders_count",
		);
	}

	/**
	 * Updates the database query with parameters used for Products Stats report: categories and order status.
	 *
	 * @param array $query_args       Query arguments supplied by the user.
	 */
	protected function update_sql_query_params( $query_args ) {
		global $wpdb;

		$clauses = array(
			'where' => '',
			'join'  => '',
		);

		$order_coupon_lookup_table = self::get_db_table_name();

		$included_coupons = $this->get_included_coupons( $query_args, 'coupons' );
		if ( $included_coupons ) {
			$clauses['where'] .= " AND {$order_coupon_lookup_table}.coupon_id IN ({$included_coupons})";
		}

		$order_status_filter = $this->get_status_subquery( $query_args );
		if ( $order_status_filter ) {
			$clauses['join']  .= " JOIN {$wpdb->prefix}wc_order_stats ON {$order_coupon_lookup_table}.order_id = {$wpdb->prefix}wc_order_stats.order_id";
			$clauses['where'] .= " AND ( {$order_status_filter} )";
		}

		$this->add_time_period_sql_params( $query_args, $order_coupon_lookup_table );
		$this->add_intervals_sql_params( $query_args, $order_coupon_lookup_table );
		$clauses['where_time'] = $this->get_sql_clause( 'where_time' );

		$this->interval_query->add_sql_clause( 'limit', $this->get_sql_clause( 'limit' ) );
		$this->interval_query->add_sql_clause( 'order_by', $this->get_sql_clause( 'order_by' ) );
		$this->interval_query->add_sql_clause( 'select', $this->get_sql_clause( 'select' ) );
		$this->interval_query->add_sql_clause( 'select', 'AS time_interval' );

		foreach ( array( 'join', 'where_time', 'where' ) as $clause ) {
			$this->interval_query->add_sql_clause( $clause, $clauses[ $clause ] );
			$this->total_query->add_sql_clause( $clause, $clauses[ $clause ] );
		}
	}

	/**
	 * Returns the report data based on parameters supplied by the user.
	 *
	 * @since 3.5.0
	 * @param array $query_args  Query parameters.
	 * @return stdClass|WP_Error Data.
	 */
	public function get_data( $query_args ) {
		global $wpdb;

		$table_name = self::get_db_table_name();

		// These defaults are only partially applied when used via REST API, as that has its own defaults.
		$defaults   = array(
			'per_page' => get_option( 'posts_per_page' ),
			'page'     => 1,
			'order'    => 'DESC',
			'orderby'  => 'date',
			'before'   => TimeInterval::default_before(),
			'after'    => TimeInterval::default_after(),
			'fields'   => '*',
			'interval' => 'week',
			'coupons'  => array(),
		);
		$query_args = wp_parse_args( $query_args, $defaults );
		$this->normalize_timezones( $query_args, $defaults );

		/*
		 * We need to get the cache key here because
		 * parent::update_intervals_sql_params() modifies $query_args.
		 */
		$cache_key = $this->get_cache_key( $query_args );
		$data      = $this->get_cached_data( $cache_key );

		if ( false === $data ) {
			$this->initialize_queries();

			$data = (object) array(
				'data'    => array(),
				'total'   => 0,
				'pages'   => 0,
				'page_no' => 0,
			);

			$selections      = $this->selected_columns( $query_args );
			$totals_query    = array();
			$intervals_query = array();
			$limit_params    = $this->get_limit_sql_params( $query_args );
			$this->update_sql_query_params( $query_args, $totals_query, $intervals_query );

			$db_intervals = $wpdb->get_col(
				$this->interval_query->get_query_statement()
			); // WPCS: cache ok, DB call ok, unprepared SQL ok.

			$db_interval_count       = count( $db_intervals );
			$expected_interval_count = TimeInterval::intervals_between( $query_args['after'], $query_args['before'], $query_args['interval'] );
			$total_pages             = (int) ceil( $expected_interval_count / $limit_params['per_page'] );
			if ( $query_args['page'] < 1 || $query_args['page'] > $total_pages ) {
				return $data;
			}

			$this->total_query->add_sql_clause( 'select', $selections );
			$totals = $wpdb->get_results(
				$this->total_query->get_query_statement(),
				ARRAY_A
			); // WPCS: cache ok, DB call ok, unprepared SQL ok.

			if ( null === $totals ) {
				return $data;
			}

			// @todo remove these assignements when refactoring segmenter classes to use query objects.
			$totals_query          = array(
				'from_clause'       => $this->total_query->get_sql_clause( 'join' ),
				'where_time_clause' => $this->total_query->get_sql_clause( 'where_time' ),
				'where_clause'      => $this->total_query->get_sql_clause( 'where' ),
			);
			$intervals_query       = array(
				'select_clause'     => $this->get_sql_clause( 'select' ),
				'from_clause'       => $this->interval_query->get_sql_clause( 'join' ),
				'where_time_clause' => $this->interval_query->get_sql_clause( 'where_time' ),
				'where_clause'      => $this->interval_query->get_sql_clause( 'where' ),
				'limit'             => $this->get_sql_clause( 'limit' ),
			);
			$segmenter             = new Segmenter( $query_args, $this->report_columns );
			$totals[0]['segments'] = $segmenter->get_totals_segments( $totals_query, $table_name );
			$totals                = (object) $this->cast_numbers( $totals[0] );

			// Intervals.
			$this->update_intervals_sql_params( $query_args, $db_interval_count, $expected_interval_count, $table_name );
			$this->interval_query->add_sql_clause( 'select', ", MAX({$table_name}.date_created) AS datetime_anchor" );

			if ( '' !== $selections ) {
				$this->interval_query->add_sql_clause( 'select', ', ' . $selections );
			}

			$intervals = $wpdb->get_results(
				$this->interval_query->get_query_statement(),
				ARRAY_A
			); // WPCS: cache ok, DB call ok, unprepared SQL ok.

			if ( null === $intervals ) {
				return $data;
			}

			$data = (object) array(
				'totals'    => $totals,
				'intervals' => $intervals,
				'total'     => $expected_interval_count,
				'pages'     => $total_pages,
				'page_no'   => (int) $query_args['page'],
			);

			if ( TimeInterval::intervals_missing( $expected_interval_count, $db_interval_count, $limit_params['per_page'], $query_args['page'], $query_args['order'], $query_args['orderby'], count( $intervals ) ) ) {
				$this->fill_in_missing_intervals( $db_intervals, $query_args['adj_after'], $query_args['adj_before'], $query_args['interval'], $data );
				$this->sort_intervals( $data, $query_args['orderby'], $query_args['order'] );
				$this->remove_extra_records( $data, $query_args['page'], $limit_params['per_page'], $db_interval_count, $expected_interval_count, $query_args['orderby'], $query_args['order'] );
			} else {
				$this->update_interval_boundary_dates( $query_args['after'], $query_args['before'], $query_args['interval'], $data->intervals );
			}
			$segmenter->add_intervals_segments( $data, $intervals_query, $table_name );
			$this->create_interval_subtotals( $data->intervals );

			$this->set_cached_data( $cache_key, $data );
		}

		return $data;
	}

	/**
	 * Initialize query objects.
	 */
	protected function initialize_queries() {
		$this->clear_all_clauses();
		unset( $this->subquery );
		$this->total_query = new SqlQuery( $this->context . '_total' );
		$this->total_query->add_sql_clause( 'from', self::get_db_table_name() );

		$this->interval_query = new SqlQuery( $this->context . '_interval' );
		$this->interval_query->add_sql_clause( 'from', self::get_db_table_name() );
		$this->interval_query->add_sql_clause( 'group_by', 'time_interval' );
	}
}
woocommerce-admin/src/API/Reports/Coupons/Stats/Segmenter.php000064400000036143151335517650020217 0ustar00<?php
/**
 * Class for adding segmenting support to coupons/stats without cluttering the data store.
 */

namespace Automattic\WooCommerce\Admin\API\Reports\Coupons\Stats;

defined( 'ABSPATH' ) || exit;

use \Automattic\WooCommerce\Admin\API\Reports\Segmenter as ReportsSegmenter;
use \Automattic\WooCommerce\Admin\API\Reports\ParameterException;

/**
 * Date & time interval and numeric range handling class for Reporting API.
 */
class Segmenter extends ReportsSegmenter {

	/**
	 * Returns column => query mapping to be used for product-related product-level segmenting query
	 * (e.g. coupon discount amount for product X when segmenting by product id or category).
	 *
	 * @param string $products_table Name of SQL table containing the product-level segmenting info.
	 *
	 * @return array Column => SELECT query mapping.
	 */
	protected function get_segment_selections_product_level( $products_table ) {
		$columns_mapping = array(
			'amount' => "SUM($products_table.coupon_amount) as amount",
		);

		return $columns_mapping;
	}

	/**
	 * Returns column => query mapping to be used for order-related product-level segmenting query
	 * (e.g. orders_count when segmented by category).
	 *
	 * @param string $coupons_lookup_table Name of SQL table containing the order-level segmenting info.
	 *
	 * @return array Column => SELECT query mapping.
	 */
	protected function get_segment_selections_order_level( $coupons_lookup_table ) {
		$columns_mapping = array(
			'coupons_count' => "COUNT(DISTINCT $coupons_lookup_table.coupon_id) as coupons_count",
			'orders_count'  => "COUNT(DISTINCT $coupons_lookup_table.order_id) as orders_count",
		);

		return $columns_mapping;
	}

	/**
	 * Returns column => query mapping to be used for order-level segmenting query
	 * (e.g. discount amount when segmented by coupons).
	 *
	 * @param string $coupons_lookup_table Name of SQL table containing the order-level info.
	 * @param array  $overrides Array of overrides for default column calculations.
	 *
	 * @return array Column => SELECT query mapping.
	 */
	protected function segment_selections_orders( $coupons_lookup_table, $overrides = array() ) {
		$columns_mapping = array(
			'amount'        => "SUM($coupons_lookup_table.discount_amount) as amount",
			'coupons_count' => "COUNT(DISTINCT $coupons_lookup_table.coupon_id) as coupons_count",
			'orders_count'  => "COUNT(DISTINCT $coupons_lookup_table.order_id) as orders_count",
		);

		if ( $overrides ) {
			$columns_mapping = array_merge( $columns_mapping, $overrides );
		}

		return $columns_mapping;
	}

	/**
	 * Calculate segments for totals where the segmenting property is bound to product (e.g. category, product_id, variation_id).
	 *
	 * @param array  $segmenting_selections SELECT part of segmenting SQL query--one for 'product_level' and one for 'order_level'.
	 * @param string $segmenting_from FROM part of segmenting SQL query.
	 * @param string $segmenting_where WHERE part of segmenting SQL query.
	 * @param string $segmenting_groupby GROUP BY part of segmenting SQL query.
	 * @param string $segmenting_dimension_name Name of the segmenting dimension.
	 * @param string $table_name Name of SQL table which is the stats table for orders.
	 * @param array  $totals_query Array of SQL clauses for totals query.
	 * @param string $unique_orders_table Name of temporary SQL table that holds unique orders.
	 *
	 * @return array
	 */
	protected function get_product_related_totals_segments( $segmenting_selections, $segmenting_from, $segmenting_where, $segmenting_groupby, $segmenting_dimension_name, $table_name, $totals_query, $unique_orders_table ) {
		global $wpdb;

		// Product-level numbers and order-level numbers can be fetched by the same query.
		$segments_products = $wpdb->get_results(
			"SELECT
						$segmenting_groupby AS $segmenting_dimension_name
						{$segmenting_selections['product_level']}
						{$segmenting_selections['order_level']}
					FROM
						$table_name
						$segmenting_from
						{$totals_query['from_clause']}
					WHERE
						1=1
						{$totals_query['where_time_clause']}
						{$totals_query['where_clause']}
						$segmenting_where
					GROUP BY
						$segmenting_groupby",
			ARRAY_A
		); // WPCS: cache ok, DB call ok, unprepared SQL ok.

		$totals_segments = $this->merge_segment_totals_results( $segmenting_dimension_name, $segments_products, array() );
		return $totals_segments;
	}

	/**
	 * Calculate segments for intervals where the segmenting property is bound to product (e.g. category, product_id, variation_id).
	 *
	 * @param array  $segmenting_selections SELECT part of segmenting SQL query--one for 'product_level' and one for 'order_level'.
	 * @param string $segmenting_from FROM part of segmenting SQL query.
	 * @param string $segmenting_where WHERE part of segmenting SQL query.
	 * @param string $segmenting_groupby GROUP BY part of segmenting SQL query.
	 * @param string $segmenting_dimension_name Name of the segmenting dimension.
	 * @param string $table_name Name of SQL table which is the stats table for orders.
	 * @param array  $intervals_query Array of SQL clauses for intervals query.
	 * @param string $unique_orders_table Name of temporary SQL table that holds unique orders.
	 *
	 * @return array
	 */
	protected function get_product_related_intervals_segments( $segmenting_selections, $segmenting_from, $segmenting_where, $segmenting_groupby, $segmenting_dimension_name, $table_name, $intervals_query, $unique_orders_table ) {
		global $wpdb;

		// LIMIT offset, rowcount needs to be updated to LIMIT offset, rowcount * max number of segments.
		$limit_parts      = explode( ',', $intervals_query['limit'] );
		$orig_rowcount    = intval( $limit_parts[1] );
		$segmenting_limit = $limit_parts[0] . ',' . $orig_rowcount * count( $this->get_all_segments() );

		// Product-level numbers and order-level numbers can be fetched by the same query.
		$segments_products = $wpdb->get_results(
			"SELECT
						{$intervals_query['select_clause']} AS time_interval,
						$segmenting_groupby AS $segmenting_dimension_name
						{$segmenting_selections['product_level']}
						{$segmenting_selections['order_level']}
					FROM
						$table_name
						$segmenting_from
						{$intervals_query['from_clause']}
					WHERE
						1=1
						{$intervals_query['where_time_clause']}
						{$intervals_query['where_clause']}
						$segmenting_where
					GROUP BY
						time_interval, $segmenting_groupby
					$segmenting_limit",
			ARRAY_A
		); // WPCS: cache ok, DB call ok, unprepared SQL ok.

		$intervals_segments = $this->merge_segment_intervals_results( $segmenting_dimension_name, $segments_products, array() );
		return $intervals_segments;
	}

	/**
	 * Calculate segments for totals query where the segmenting property is bound to order (e.g. coupon or customer type).
	 *
	 * @param string $segmenting_select SELECT part of segmenting SQL query.
	 * @param string $segmenting_from FROM part of segmenting SQL query.
	 * @param string $segmenting_where WHERE part of segmenting SQL query.
	 * @param string $segmenting_groupby GROUP BY part of segmenting SQL query.
	 * @param string $table_name Name of SQL table which is the stats table for orders.
	 * @param array  $totals_query Array of SQL clauses for intervals query.
	 *
	 * @return array
	 */
	protected function get_order_related_totals_segments( $segmenting_select, $segmenting_from, $segmenting_where, $segmenting_groupby, $table_name, $totals_query ) {
		global $wpdb;

		$totals_segments = $wpdb->get_results(
			"SELECT
						$segmenting_groupby
						$segmenting_select
					FROM
						$table_name
						$segmenting_from
						{$totals_query['from_clause']}
					WHERE
						1=1
						{$totals_query['where_time_clause']}
						{$totals_query['where_clause']}
						$segmenting_where
					GROUP BY
						$segmenting_groupby",
			ARRAY_A
		); // WPCS: cache ok, DB call ok, unprepared SQL ok.

		// Reformat result.
		$totals_segments = $this->reformat_totals_segments( $totals_segments, $segmenting_groupby );
		return $totals_segments;
	}

	/**
	 * Calculate segments for intervals query where the segmenting property is bound to order (e.g. coupon or customer type).
	 *
	 * @param string $segmenting_select SELECT part of segmenting SQL query.
	 * @param string $segmenting_from FROM part of segmenting SQL query.
	 * @param string $segmenting_where WHERE part of segmenting SQL query.
	 * @param string $segmenting_groupby GROUP BY part of segmenting SQL query.
	 * @param string $table_name Name of SQL table which is the stats table for orders.
	 * @param array  $intervals_query Array of SQL clauses for intervals query.
	 *
	 * @return array
	 */
	protected function get_order_related_intervals_segments( $segmenting_select, $segmenting_from, $segmenting_where, $segmenting_groupby, $table_name, $intervals_query ) {
		global $wpdb;
		$limit_parts      = explode( ',', $intervals_query['limit'] );
		$orig_rowcount    = intval( $limit_parts[1] );
		$segmenting_limit = $limit_parts[0] . ',' . $orig_rowcount * count( $this->get_all_segments() );

		$intervals_segments = $wpdb->get_results(
			"SELECT
						MAX($table_name.date_created) AS datetime_anchor,
						{$intervals_query['select_clause']} AS time_interval,
						$segmenting_groupby
						$segmenting_select
					FROM
						$table_name
						$segmenting_from
						{$intervals_query['from_clause']}
					WHERE
						1=1
						{$intervals_query['where_time_clause']}
						{$intervals_query['where_clause']}
						$segmenting_where
					GROUP BY
						time_interval, $segmenting_groupby
					$segmenting_limit",
			ARRAY_A
		); // WPCS: cache ok, DB call ok, unprepared SQL ok.

		// Reformat result.
		$intervals_segments = $this->reformat_intervals_segments( $intervals_segments, $segmenting_groupby );
		return $intervals_segments;
	}

	/**
	 * Return array of segments formatted for REST response.
	 *
	 * @param string $type Type of segments to return--'totals' or 'intervals'.
	 * @param array  $query_params SQL query parameter array.
	 * @param string $table_name Name of main SQL table for the data store (used as basis for JOINS).
	 *
	 * @return array
	 * @throws \Automattic\WooCommerce\Admin\API\Reports\ParameterException In case of segmenting by variations, when no parent product is specified.
	 */
	protected function get_segments( $type, $query_params, $table_name ) {
		global $wpdb;
		if ( ! isset( $this->query_args['segmentby'] ) || '' === $this->query_args['segmentby'] ) {
			return array();
		}

		$product_segmenting_table = $wpdb->prefix . 'wc_order_product_lookup';
		$unique_orders_table      = '';
		$segmenting_where         = '';

		// Product, variation, and category are bound to product, so here product segmenting table is required,
		// while coupon and customer are bound to order, so we don't need the extra JOIN for those.
		// This also means that segment selections need to be calculated differently.
		if ( 'product' === $this->query_args['segmentby'] ) {
			$product_level_columns     = $this->get_segment_selections_product_level( $product_segmenting_table );
			$order_level_columns       = $this->get_segment_selections_order_level( $table_name );
			$segmenting_selections     = array(
				'product_level' => $this->prepare_selections( $product_level_columns ),
				'order_level'   => $this->prepare_selections( $order_level_columns ),
			);
			$this->report_columns      = array_merge( $product_level_columns, $order_level_columns );
			$segmenting_from           = "INNER JOIN $product_segmenting_table ON ($table_name.order_id = $product_segmenting_table.order_id)";
			$segmenting_groupby        = $product_segmenting_table . '.product_id';
			$segmenting_dimension_name = 'product_id';

			$segments = $this->get_product_related_segments( $type, $segmenting_selections, $segmenting_from, $segmenting_where, $segmenting_groupby, $segmenting_dimension_name, $table_name, $query_params, $unique_orders_table );
		} elseif ( 'variation' === $this->query_args['segmentby'] ) {
			if ( ! isset( $this->query_args['product_includes'] ) || count( $this->query_args['product_includes'] ) !== 1 ) {
				throw new ParameterException( 'wc_admin_reports_invalid_segmenting_variation', __( 'product_includes parameter need to specify exactly one product when segmenting by variation.', 'woocommerce' ) );
			}

			$product_level_columns     = $this->get_segment_selections_product_level( $product_segmenting_table );
			$order_level_columns       = $this->get_segment_selections_order_level( $table_name );
			$segmenting_selections     = array(
				'product_level' => $this->prepare_selections( $product_level_columns ),
				'order_level'   => $this->prepare_selections( $order_level_columns ),
			);
			$this->report_columns      = array_merge( $product_level_columns, $order_level_columns );
			$segmenting_from           = "INNER JOIN $product_segmenting_table ON ($table_name.order_id = $product_segmenting_table.order_id)";
			$segmenting_where          = "AND $product_segmenting_table.product_id = {$this->query_args['product_includes'][0]}";
			$segmenting_groupby        = $product_segmenting_table . '.variation_id';
			$segmenting_dimension_name = 'variation_id';

			$segments = $this->get_product_related_segments( $type, $segmenting_selections, $segmenting_from, $segmenting_where, $segmenting_groupby, $segmenting_dimension_name, $table_name, $query_params, $unique_orders_table );
		} elseif ( 'category' === $this->query_args['segmentby'] ) {
			$product_level_columns     = $this->get_segment_selections_product_level( $product_segmenting_table );
			$order_level_columns       = $this->get_segment_selections_order_level( $table_name );
			$segmenting_selections     = array(
				'product_level' => $this->prepare_selections( $product_level_columns ),
				'order_level'   => $this->prepare_selections( $order_level_columns ),
			);
			$this->report_columns      = array_merge( $product_level_columns, $order_level_columns );
			$segmenting_from           = "
			INNER JOIN $product_segmenting_table ON ($table_name.order_id = $product_segmenting_table.order_id)
			LEFT JOIN {$wpdb->term_relationships} ON {$product_segmenting_table}.product_id = {$wpdb->term_relationships}.object_id
			JOIN {$wpdb->term_taxonomy} ON {$wpdb->term_taxonomy}.term_taxonomy_id = {$wpdb->term_relationships}.term_taxonomy_id
			LEFT JOIN {$wpdb->wc_category_lookup} ON {$wpdb->term_taxonomy}.term_id = {$wpdb->wc_category_lookup}.category_id
			";
			$segmenting_where          = " AND {$wpdb->wc_category_lookup}.category_tree_id IS NOT NULL";
			$segmenting_groupby        = "{$wpdb->wc_category_lookup}.category_tree_id";
			$segmenting_dimension_name = 'category_id';

			$segments = $this->get_product_related_segments( $type, $segmenting_selections, $segmenting_from, $segmenting_where, $segmenting_groupby, $segmenting_dimension_name, $table_name, $query_params, $unique_orders_table );
		} elseif ( 'coupon' === $this->query_args['segmentby'] ) {
			$coupon_level_columns  = $this->segment_selections_orders( $table_name );
			$segmenting_selections = $this->prepare_selections( $coupon_level_columns );
			$this->report_columns  = $coupon_level_columns;
			$segmenting_from       = '';
			$segmenting_groupby    = "$table_name.coupon_id";

			$segments = $this->get_order_related_segments( $type, $segmenting_selections, $segmenting_from, $segmenting_where, $segmenting_groupby, $table_name, $query_params );
		}

		return $segments;
	}
}
woocommerce-admin/src/API/Reports/PerformanceIndicators/Controller.php000064400000046370151335517650022151 0ustar00<?php
/**
 * REST API Performance indicators controller
 *
 * Handles requests to the /reports/store-performance endpoint.
 */

namespace Automattic\WooCommerce\Admin\API\Reports\PerformanceIndicators;

use \Automattic\WooCommerce\Admin\API\Reports\TimeInterval;

defined( 'ABSPATH' ) || exit;

/**
 * REST API Reports Performance indicators controller class.
 *
 * @extends WC_REST_Reports_Controller
 */
class Controller extends \WC_REST_Reports_Controller {

	/**
	 * Endpoint namespace.
	 *
	 * @var string
	 */
	protected $namespace = 'wc-analytics';

	/**
	 * Route base.
	 *
	 * @var string
	 */
	protected $rest_base = 'reports/performance-indicators';

	/**
	 * Contains a list of endpoints by report slug.
	 *
	 * @var array
	 */
	protected $endpoints = array();

	/**
	 * Contains a list of active Jetpack module slugs.
	 *
	 * @var array
	 */
	protected $active_jetpack_modules = null;

	/**
	 * Contains a list of allowed stats.
	 *
	 * @var array
	 */
	protected $allowed_stats = array();

	/**
	 * Contains a list of stat labels.
	 *
	 * @var array
	 */
	protected $labels = array();

	/**
	 * Contains a list of endpoints by url.
	 *
	 * @var array
	 */
	protected $urls = array();

	/**
	 * Contains a cache of retrieved stats data, grouped by report slug.
	 *
	 * @var array
	 */
	protected $stats_data = array();

	/**
	 * Constructor.
	 */
	public function __construct() {
		add_filter( 'woocommerce_rest_performance_indicators_data_value', array( $this, 'format_data_value' ), 10, 5 );
	}

	/**
	 * Register the routes for reports.
	 */
	public function register_routes() {
		register_rest_route(
			$this->namespace,
			'/' . $this->rest_base,
			array(
				array(
					'methods'             => \WP_REST_Server::READABLE,
					'callback'            => array( $this, 'get_items' ),
					'permission_callback' => array( $this, 'get_items_permissions_check' ),
					'args'                => $this->get_collection_params(),
				),
				'schema' => array( $this, 'get_public_item_schema' ),
			)
		);

		register_rest_route(
			$this->namespace,
			'/' . $this->rest_base . '/allowed',
			array(
				array(
					'methods'             => \WP_REST_Server::READABLE,
					'callback'            => array( $this, 'get_allowed_items' ),
					'permission_callback' => array( $this, 'get_items_permissions_check' ),
					'args'                => $this->get_collection_params(),
				),
				'schema' => array( $this, 'get_public_allowed_item_schema' ),
			)
		);
	}

	/**
	 * Maps query arguments from the REST request.
	 *
	 * @param array $request Request array.
	 * @return array
	 */
	protected function prepare_reports_query( $request ) {
		$args           = array();
		$args['before'] = $request['before'];
		$args['after']  = $request['after'];
		$args['stats']  = $request['stats'];
		return $args;
	}

	/**
	 * Get analytics report data and endpoints.
	 */
	public function get_analytics_report_data() {
		$request  = new \WP_REST_Request( 'GET', '/wc-analytics/reports' );
		$response = rest_do_request( $request );

		if ( is_wp_error( $response ) ) {
			return $response;
		}

		if ( 200 !== $response->get_status() ) {
			return new \WP_Error( 'woocommerce_analytics_performance_indicators_result_failed', __( 'Sorry, fetching performance indicators failed.', 'woocommerce' ) );
		}

		$endpoints = $response->get_data();

		foreach ( $endpoints as $endpoint ) {
			if ( '/stats' === substr( $endpoint['slug'], -6 ) ) {
				$request  = new \WP_REST_Request( 'OPTIONS', $endpoint['path'] );
				$response = rest_do_request( $request );

				if ( is_wp_error( $response ) ) {
					return $response;
				}

				$data = $response->get_data();

				$prefix = substr( $endpoint['slug'], 0, -6 );

				if ( empty( $data['schema']['properties']['totals']['properties'] ) ) {
					continue;
				}

				foreach ( $data['schema']['properties']['totals']['properties'] as $property_key => $schema_info ) {
					if ( empty( $schema_info['indicator'] ) || ! $schema_info['indicator'] ) {
						continue;
					}

					$stat                   = $prefix . '/' . $property_key;
					$this->allowed_stats[]  = $stat;
					$stat_label             = empty( $schema_info['title'] ) ? $schema_info['description'] : $schema_info['title'];
					$this->labels[ $stat ]  = trim( $stat_label, '.' );
					$this->formats[ $stat ] = isset( $schema_info['format'] ) ? $schema_info['format'] : 'number';
				}

				$this->endpoints[ $prefix ] = $endpoint['path'];
				$this->urls[ $prefix ]      = $endpoint['_links']['report'][0]['href'];
			}
		}
	}

	/**
	 * Get active Jetpack modules.
	 *
	 * @return array List of active Jetpack module slugs.
	 */
	public function get_active_jetpack_modules() {
		if ( is_null( $this->active_jetpack_modules ) ) {
			if ( class_exists( '\Jetpack' ) && method_exists( '\Jetpack', 'get_active_modules' ) ) {
				$active_modules               = \Jetpack::get_active_modules();
				$this->active_jetpack_modules = is_array( $active_modules ) ? $active_modules : array();
			} else {
				$this->active_jetpack_modules = array();
			}
		}

		return $this->active_jetpack_modules;
	}

	/**
	 * Set active Jetpack modules.
	 *
	 * @param array $modules List of active Jetpack module slugs.
	 */
	public function set_active_jetpack_modules( $modules ) {
		$this->active_jetpack_modules = $modules;
	}

	/**
	 * Get active Jetpack modules and endpoints.
	 */
	public function get_jetpack_modules_data() {
		$active_modules = $this->get_active_jetpack_modules();

		if ( empty( $active_modules ) ) {
			return;
		}

		$items = apply_filters(
			'woocommerce_rest_performance_indicators_jetpack_items',
			array(
				'stats/visitors' => array(
					'label'      => __( 'Visitors', 'woocommerce' ),
					'permission' => 'view_stats',
					'format'     => 'number',
					'module'     => 'stats',
				),
				'stats/views'    => array(
					'label'      => __( 'Views', 'woocommerce' ),
					'permission' => 'view_stats',
					'format'     => 'number',
					'module'     => 'stats',
				),
			)
		);

		foreach ( $items as $item_key => $item ) {
			if ( ! in_array( $item['module'], $active_modules, true ) ) {
				return;
			}

			if ( $item['permission'] && ! current_user_can( $item['permission'] ) ) {
				return;
			}

			$stat                         = 'jetpack/' . $item_key;
			$endpoint                     = 'jetpack/' . $item['module'];
			$this->allowed_stats[]        = $stat;
			$this->labels[ $stat ]        = $item['label'];
			$this->endpoints[ $endpoint ] = '/jetpack/v4/module/' . $item['module'] . '/data';
			$this->formats[ $stat ]       = $item['format'];
		}

		$this->urls['jetpack/stats'] = '/jetpack';
	}

	/**
	 * Get information such as allowed stats, stat labels, and endpoint data from stats reports.
	 *
	 * @return WP_Error|True
	 */
	private function get_indicator_data() {
		// Data already retrieved.
		if ( ! empty( $this->endpoints ) && ! empty( $this->labels ) && ! empty( $this->allowed_stats ) ) {
			return true;
		}

		$this->get_analytics_report_data();
		$this->get_jetpack_modules_data();

		return true;
	}

	/**
	 * Returns a list of allowed performance indicators.
	 *
	 * @param  WP_REST_Request $request Request data.
	 * @return array|WP_Error
	 */
	public function get_allowed_items( $request ) {
		$indicator_data = $this->get_indicator_data();
		if ( is_wp_error( $indicator_data ) ) {
			return $indicator_data;
		}

		$data = array();
		foreach ( $this->allowed_stats as $stat ) {
			$pieces = $this->get_stats_parts( $stat );
			$report = $pieces[0];
			$chart  = $pieces[1];
			$data[] = (object) array(
				'stat'  => $stat,
				'chart' => $chart,
				'label' => $this->labels[ $stat ],
			);
		}

		usort( $data, array( $this, 'sort' ) );

		$objects = array();
		foreach ( $data as $item ) {
			$prepared  = $this->prepare_item_for_response( $item, $request );
			$objects[] = $this->prepare_response_for_collection( $prepared );
		}

		$response = rest_ensure_response( $objects );
		$response->header( 'X-WP-Total', count( $data ) );
		$response->header( 'X-WP-TotalPages', 1 );

		$base = add_query_arg( $request->get_query_params(), rest_url( sprintf( '/%s/%s', $this->namespace, $this->rest_base ) ) );

		return $response;
	}

	/**
	 * Sorts the list of stats. Sorted by custom arrangement.
	 *
	 * @see https://github.com/woocommerce/woocommerce-admin/issues/1282
	 * @param object $a First item.
	 * @param object $b Second item.
	 * @return order
	 */
	public function sort( $a, $b ) {
		/**
		 * Custom ordering for store performance indicators.
		 *
		 * @see https://github.com/woocommerce/woocommerce-admin/issues/1282
		 * @param array $indicators A list of ordered indicators.
		 */
		$stat_order = apply_filters(
			'woocommerce_rest_report_sort_performance_indicators',
			array(
				'revenue/total_sales',
				'revenue/net_revenue',
				'orders/orders_count',
				'orders/avg_order_value',
				'products/items_sold',
				'revenue/refunds',
				'coupons/orders_count',
				'coupons/amount',
				'taxes/total_tax',
				'taxes/order_tax',
				'taxes/shipping_tax',
				'revenue/shipping',
				'downloads/download_count',
			)
		);

		$a = array_search( $a->stat, $stat_order, true );
		$b = array_search( $b->stat, $stat_order, true );

		if ( false === $a && false === $b ) {
			return 0;
		} elseif ( false === $a ) {
			return 1;
		} elseif ( false === $b ) {
			return -1;
		} else {
			return $a - $b;
		}
	}

	/**
	 * Get report stats data, avoiding duplicate requests for stats that use the same endpoint.
	 *
	 * @param string $report Report slug to request data for.
	 * @param array  $query_args Report query args.
	 * @return WP_REST_Response|WP_Error Report stats data.
	 */
	public function get_stats_data( $report, $query_args ) {
		// Return from cache if we've already requested these report stats.
		if ( isset( $this->stats_data[ $report ] ) ) {
			return $this->stats_data[ $report ];
		}

		// Request the report stats.
		$request_url = $this->endpoints[ $report ];
		$request     = new \WP_REST_Request( 'GET', $request_url );
		$request->set_param( 'before', $query_args['before'] );
		$request->set_param( 'after', $query_args['after'] );

		$response = rest_do_request( $request );

		// Cache the response.
		$this->stats_data[ $report ] = $response;

		return $response;
	}

	/**
	 * Get all reports.
	 *
	 * @param  WP_REST_Request $request Request data.
	 * @return array|WP_Error
	 */
	public function get_items( $request ) {
		$indicator_data = $this->get_indicator_data();
		if ( is_wp_error( $indicator_data ) ) {
			return $indicator_data;
		}

		$query_args = $this->prepare_reports_query( $request );
		if ( empty( $query_args['stats'] ) ) {
			return new \WP_Error( 'woocommerce_analytics_performance_indicators_empty_query', __( 'A list of stats to query must be provided.', 'woocommerce' ), 400 );
		}

		$stats = array();
		foreach ( $query_args['stats'] as $stat ) {
			$is_error = false;

			$pieces = $this->get_stats_parts( $stat );
			$report = $pieces[0];
			$chart  = $pieces[1];

			if ( ! in_array( $stat, $this->allowed_stats, true ) ) {
				continue;
			}

			$response = $this->get_stats_data( $report, $query_args );

			if ( is_wp_error( $response ) ) {
				return $response;
			}

			$data   = $response->get_data();
			$format = $this->formats[ $stat ];
			$label  = $this->labels[ $stat ];

			if ( 200 !== $response->get_status() ) {
				$stats[] = (object) array(
					'stat'   => $stat,
					'chart'  => $chart,
					'label'  => $label,
					'format' => $format,
					'value'  => null,
				);
				continue;
			}

			$stats[] = (object) array(
				'stat'   => $stat,
				'chart'  => $chart,
				'label'  => $label,
				'format' => $format,
				'value'  => apply_filters( 'woocommerce_rest_performance_indicators_data_value', $data, $stat, $report, $chart, $query_args ),
			);
		}

		usort( $stats, array( $this, 'sort' ) );

		$objects = array();
		foreach ( $stats as $stat ) {
			$data      = $this->prepare_item_for_response( $stat, $request );
			$objects[] = $this->prepare_response_for_collection( $data );
		}

		$response = rest_ensure_response( $objects );
		$response->header( 'X-WP-Total', count( $stats ) );
		$response->header( 'X-WP-TotalPages', 1 );

		$base = add_query_arg( $request->get_query_params(), rest_url( sprintf( '/%s/%s', $this->namespace, $this->rest_base ) ) );

		return $response;
	}

	/**
	 * Prepare a report object for serialization.
	 *
	 * @param stdClass        $stat_data    Report data.
	 * @param WP_REST_Request $request Request object.
	 * @return WP_REST_Response
	 */
	public function prepare_item_for_response( $stat_data, $request ) {
		$context = ! empty( $request['context'] ) ? $request['context'] : 'view';
		$data    = $this->add_additional_fields_to_object( $stat_data, $request );
		$data    = $this->filter_response_by_context( $data, $context );

		// Wrap the data in a response object.
		$response = rest_ensure_response( $data );

		$response->add_links( $this->prepare_links( $data ) );

		/**
		 * Filter a report returned from the API.
		 *
		 * Allows modification of the report data right before it is returned.
		 *
		 * @param WP_REST_Response $response The response object.
		 * @param object           $report   The original report object.
		 * @param WP_REST_Request  $request  Request used to generate the response.
		 */
		return apply_filters( 'woocommerce_rest_prepare_report_performance_indicators', $response, $stat_data, $request );
	}

	/**
	 * Prepare links for the request.
	 *
	 * @param \Automattic\WooCommerce\Admin\API\Reports\Query $object Object data.
	 * @return array
	 */
	protected function prepare_links( $object ) {
		$pieces   = $this->get_stats_parts( $object->stat );
		$endpoint = $pieces[0];
		$stat     = $pieces[1];
		$url      = isset( $this->urls[ $endpoint ] ) ? $this->urls[ $endpoint ] : '';

		$links = array(
			'api'    => array(
				'href' => rest_url( $this->endpoints[ $endpoint ] ),
			),
			'report' => array(
				'href' => $url,
			),
		);

		return $links;
	}

	/**
	 * Returns the endpoint part of a stat request (prefix) and the actual stat total we want.
	 * To allow extensions to namespace (example: fue/emails/sent), we break on the last forward slash.
	 *
	 * @param string $full_stat A stat request string like orders/avg_order_value or fue/emails/sent.
	 * @return array Containing the prefix (endpoint) and suffix (stat).
	 */
	private function get_stats_parts( $full_stat ) {
		$endpoint = substr( $full_stat, 0, strrpos( $full_stat, '/' ) );
		$stat     = substr( $full_stat, ( strrpos( $full_stat, '/' ) + 1 ) );
		return array(
			$endpoint,
			$stat,
		);
	}

	/**
	 * Format the data returned from the API for given stats.
	 *
	 * @param array  $data Data from external endpoint.
	 * @param string $stat Name of the stat.
	 * @param string $report Name of the report.
	 * @param string $chart Name of the chart.
	 * @param array  $query_args Query args.
	 * @return mixed
	 */
	public function format_data_value( $data, $stat, $report, $chart, $query_args ) {
		if ( 'jetpack/stats' === $report ) {
			// Get the index of the field to tally.
			$index = array_search( $chart, $data['general']->visits->fields, true );
			if ( ! $index ) {
				return null;
			}

			// Loop over provided data and filter by the queried date.
			// Note that this is currently limited to 30 days via the Jetpack API
			// but the WordPress.com endpoint allows up to 90 days.
			$total  = 0;
			$before = gmdate( 'Y-m-d', strtotime( isset( $query_args['before'] ) ? $query_args['before'] : TimeInterval::default_before() ) );
			$after  = gmdate( 'Y-m-d', strtotime( isset( $query_args['after'] ) ? $query_args['after'] : TimeInterval::default_after() ) );
			foreach ( $data['general']->visits->data as $datum ) {
				if ( $datum[0] >= $after && $datum[0] <= $before ) {
					$total += $datum[ $index ];
				}
			}
			return $total;
		}

		if ( isset( $data['totals'] ) && isset( $data['totals'][ $chart ] ) ) {
			return $data['totals'][ $chart ];
		}

		return null;
	}

	/**
	 * Get the Report's schema, conforming to JSON Schema.
	 *
	 * @return array
	 */
	public function get_item_schema() {
		$indicator_data = $this->get_indicator_data();
		if ( is_wp_error( $indicator_data ) ) {
			$allowed_stats = array();
		} else {
			$allowed_stats = $this->allowed_stats;
		}

		$schema = array(
			'$schema'    => 'http://json-schema.org/draft-04/schema#',
			'title'      => 'report_performance_indicator',
			'type'       => 'object',
			'properties' => array(
				'stat'   => array(
					'description' => __( 'Unique identifier for the resource.', 'woocommerce' ),
					'type'        => 'string',
					'context'     => array( 'view', 'edit' ),
					'readonly'    => true,
					'enum'        => $allowed_stats,
				),
				'chart'  => array(
					'description' => __( 'The specific chart this stat referrers to.', 'woocommerce' ),
					'type'        => 'string',
					'context'     => array( 'view', 'edit' ),
					'readonly'    => true,
				),
				'label'  => array(
					'description' => __( 'Human readable label for the stat.', 'woocommerce' ),
					'type'        => 'string',
					'context'     => array( 'view', 'edit' ),
					'readonly'    => true,
				),
				'format' => array(
					'description' => __( 'Format of the stat.', 'woocommerce' ),
					'type'        => 'number',
					'context'     => array( 'view', 'edit' ),
					'readonly'    => true,
					'enum'        => array( 'number', 'currency' ),
				),
				'value'  => array(
					'description' => __( 'Value of the stat. Returns null if the stat does not exist or cannot be loaded.', 'woocommerce' ),
					'type'        => 'number',
					'context'     => array( 'view', 'edit' ),
					'readonly'    => true,
				),
			),
		);

		return $this->add_additional_fields_schema( $schema );
	}

	/**
	 * Get schema for the list of allowed performance indicators.
	 *
	 * @return array $schema
	 */
	public function get_public_allowed_item_schema() {
		$schema = $this->get_public_item_schema();
		unset( $schema['properties']['value'] );
		unset( $schema['properties']['format'] );
		return $schema;
	}

	/**
	 * Get the query params for collections.
	 *
	 * @return array
	 */
	public function get_collection_params() {
		$indicator_data = $this->get_indicator_data();
		if ( is_wp_error( $indicator_data ) ) {
			$allowed_stats = __( 'There was an issue loading the report endpoints', 'woocommerce' );
		} else {
			$allowed_stats = implode( ', ', $this->allowed_stats );
		}

		$params            = array();
		$params['context'] = $this->get_context_param( array( 'default' => 'view' ) );
		$params['stats']   = array(
			'description'       => sprintf(
				/* translators: Allowed values is a list of stat endpoints. */
				__( 'Limit response to specific report stats. Allowed values: %s.', 'woocommerce' ),
				$allowed_stats
			),
			'type'              => 'array',
			'validate_callback' => 'rest_validate_request_arg',
			'items'             => array(
				'type' => 'string',
				'enum' => $this->allowed_stats,
			),
			'default'           => $this->allowed_stats,
		);
		$params['after']   = array(
			'description'       => __( 'Limit response to resources published after a given ISO8601 compliant date.', 'woocommerce' ),
			'type'              => 'string',
			'format'            => 'date-time',
			'validate_callback' => 'rest_validate_request_arg',
		);
		$params['before']  = array(
			'description'       => __( 'Limit response to resources published before a given ISO8601 compliant date.', 'woocommerce' ),
			'type'              => 'string',
			'format'            => 'date-time',
			'validate_callback' => 'rest_validate_request_arg',
		);
		return $params;
	}
}
woocommerce-admin/src/API/Reports/Stock/Controller.php000064400000044170151335517650016747 0ustar00<?php
/**
 * REST API Reports stock controller
 *
 * Handles requests to the /reports/stock endpoint.
 */

namespace Automattic\WooCommerce\Admin\API\Reports\Stock;

defined( 'ABSPATH' ) || exit;

use \Automattic\WooCommerce\Admin\API\Reports\ExportableInterface;

/**
 * REST API Reports stock controller class.
 *
 * @extends WC_REST_Reports_Controller
 */
class Controller extends \WC_REST_Reports_Controller implements ExportableInterface {

	/**
	 * Endpoint namespace.
	 *
	 * @var string
	 */
	protected $namespace = 'wc-analytics';

	/**
	 * Route base.
	 *
	 * @var string
	 */
	protected $rest_base = 'reports/stock';

	/**
	 * Registered stock status options.
	 *
	 * @var array
	 */
	protected $status_options;

	/**
	 * Constructor.
	 */
	public function __construct() {
		$this->status_options = wc_get_product_stock_status_options();
	}

	/**
	 * Maps query arguments from the REST request.
	 *
	 * @param  WP_REST_Request $request Request array.
	 * @return array
	 */
	protected function prepare_reports_query( $request ) {
		$args                        = array();
		$args['offset']              = $request['offset'];
		$args['order']               = $request['order'];
		$args['orderby']             = $request['orderby'];
		$args['paged']               = $request['page'];
		$args['post__in']            = $request['include'];
		$args['post__not_in']        = $request['exclude'];
		$args['posts_per_page']      = $request['per_page'];
		$args['post_parent__in']     = $request['parent'];
		$args['post_parent__not_in'] = $request['parent_exclude'];

		if ( 'date' === $args['orderby'] ) {
			$args['orderby'] = 'date ID';
		} elseif ( 'include' === $args['orderby'] ) {
			$args['orderby'] = 'post__in';
		} elseif ( 'id' === $args['orderby'] ) {
			$args['orderby'] = 'ID'; // ID must be capitalized.
		}

		$args['post_type'] = array( 'product', 'product_variation' );

		if ( 'lowstock' === $request['type'] ) {
			$args['low_in_stock'] = true;
		} elseif ( in_array( $request['type'], array_keys( $this->status_options ), true ) ) {
			$args['stock_status'] = $request['type'];
		}

		$args['ignore_sticky_posts'] = true;

		return $args;
	}

	/**
	 * Query products.
	 *
	 * @param  array $query_args Query args.
	 * @return array
	 */
	protected function get_products( $query_args ) {
		$query  = new \WP_Query();
		$result = $query->query( $query_args );

		$total_posts = $query->found_posts;
		if ( $total_posts < 1 ) {
			// Out-of-bounds, run the query again without LIMIT for total count.
			unset( $query_args['paged'] );
			$count_query = new \WP_Query();
			$count_query->query( $query_args );
			$total_posts = $count_query->found_posts;
		}

		return array(
			'objects' => array_map( 'wc_get_product', $result ),
			'total'   => (int) $total_posts,
			'pages'   => (int) ceil( $total_posts / (int) $query->query_vars['posts_per_page'] ),
		);
	}

	/**
	 * Get all reports.
	 *
	 * @param  WP_REST_Request $request Request data.
	 * @return array|WP_Error
	 */
	public function get_items( $request ) {
		add_filter( 'posts_where', array( __CLASS__, 'add_wp_query_filter' ), 10, 2 );
		add_filter( 'posts_join', array( __CLASS__, 'add_wp_query_join' ), 10, 2 );
		add_filter( 'posts_groupby', array( __CLASS__, 'add_wp_query_group_by' ), 10, 2 );
		add_filter( 'posts_clauses', array( __CLASS__, 'add_wp_query_orderby' ), 10, 2 );
		$query_args    = $this->prepare_reports_query( $request );
		$query_results = $this->get_products( $query_args );
		remove_filter( 'posts_where', array( __CLASS__, 'add_wp_query_filter' ), 10 );
		remove_filter( 'posts_join', array( __CLASS__, 'add_wp_query_join' ), 10 );
		remove_filter( 'posts_groupby', array( __CLASS__, 'add_wp_query_group_by' ), 10 );
		remove_filter( 'posts_clauses', array( __CLASS__, 'add_wp_query_orderby' ), 10 );

		$objects = array();
		foreach ( $query_results['objects'] as $object ) {
			$data      = $this->prepare_item_for_response( $object, $request );
			$objects[] = $this->prepare_response_for_collection( $data );
		}

		$page      = (int) $query_args['paged'];
		$max_pages = $query_results['pages'];

		$response = rest_ensure_response( $objects );
		$response->header( 'X-WP-Total', $query_results['total'] );
		$response->header( 'X-WP-TotalPages', (int) $max_pages );

		$base = add_query_arg( $request->get_query_params(), rest_url( sprintf( '/%s/%s', $this->namespace, $this->rest_base ) ) );

		if ( $page > 1 ) {
			$prev_page = $page - 1;
			if ( $prev_page > $max_pages ) {
				$prev_page = $max_pages;
			}
			$prev_link = add_query_arg( 'page', $prev_page, $base );
			$response->link_header( 'prev', $prev_link );
		}
		if ( $max_pages > $page ) {
			$next_page = $page + 1;
			$next_link = add_query_arg( 'page', $next_page, $base );
			$response->link_header( 'next', $next_link );
		}

		return $response;
	}

	/**
	 * Add in conditional search filters for products.
	 *
	 * @param string $where Where clause used to search posts.
	 * @param object $wp_query WP_Query object.
	 * @return string
	 */
	public static function add_wp_query_filter( $where, $wp_query ) {
		global $wpdb;

		$stock_status = $wp_query->get( 'stock_status' );
		if ( $stock_status ) {
			$where .= $wpdb->prepare(
				' AND wc_product_meta_lookup.stock_status = %s ',
				$stock_status
			);
		}

		if ( $wp_query->get( 'low_in_stock' ) ) {
			// We want products with stock < low stock amount, but greater than no stock amount.
			$no_stock_amount  = absint( max( get_option( 'woocommerce_notify_no_stock_amount' ), 0 ) );
			$low_stock_amount = absint( max( get_option( 'woocommerce_notify_low_stock_amount' ), 1 ) );
			$where           .= "
			AND wc_product_meta_lookup.stock_quantity IS NOT NULL
			AND wc_product_meta_lookup.stock_status = 'instock'
			AND (
				(
					low_stock_amount_meta.meta_value > ''
					AND wc_product_meta_lookup.stock_quantity <= CAST(low_stock_amount_meta.meta_value AS SIGNED)
					AND wc_product_meta_lookup.stock_quantity > {$no_stock_amount}
				)
				OR (
					(
						low_stock_amount_meta.meta_value IS NULL OR low_stock_amount_meta.meta_value <= ''
					)
					AND wc_product_meta_lookup.stock_quantity <= {$low_stock_amount}
					AND wc_product_meta_lookup.stock_quantity > {$no_stock_amount}
				)
			)";
		}

		return $where;
	}

	/**
	 * Join posts meta tables when product search or low stock query is present.
	 *
	 * @param string $join Join clause used to search posts.
	 * @param object $wp_query WP_Query object.
	 * @return string
	 */
	public static function add_wp_query_join( $join, $wp_query ) {
		global $wpdb;

		$stock_status = $wp_query->get( 'stock_status' );
		if ( $stock_status ) {
			$join = self::append_product_sorting_table_join( $join );
		}

		if ( $wp_query->get( 'low_in_stock' ) ) {
			$join  = self::append_product_sorting_table_join( $join );
			$join .= " LEFT JOIN {$wpdb->postmeta} AS low_stock_amount_meta ON {$wpdb->posts}.ID = low_stock_amount_meta.post_id AND low_stock_amount_meta.meta_key = '_low_stock_amount' ";
		}

		return $join;
	}

	/**
	 * Join wc_product_meta_lookup to posts if not already joined.
	 *
	 * @param string $sql SQL join.
	 * @return string
	 */
	protected static function append_product_sorting_table_join( $sql ) {
		global $wpdb;

		if ( ! strstr( $sql, 'wc_product_meta_lookup' ) ) {
			$sql .= " LEFT JOIN {$wpdb->wc_product_meta_lookup} wc_product_meta_lookup ON $wpdb->posts.ID = wc_product_meta_lookup.product_id ";
		}
		return $sql;
	}

	/**
	 * Group by post ID to prevent duplicates.
	 *
	 * @param string $groupby Group by clause used to organize posts.
	 * @param object $wp_query WP_Query object.
	 * @return string
	 */
	public static function add_wp_query_group_by( $groupby, $wp_query ) {
		global $wpdb;

		if ( empty( $groupby ) ) {
			$groupby = $wpdb->posts . '.ID';
		}
		return $groupby;
	}

	/**
	 * Custom orderby clauses using the lookup tables.
	 *
	 * @param array  $args Query args.
	 * @param object $wp_query WP_Query object.
	 * @return array
	 */
	public static function add_wp_query_orderby( $args, $wp_query ) {
		global $wpdb;

		$orderby = $wp_query->get( 'orderby' );
		$order   = esc_sql( $wp_query->get( 'order' ) ? $wp_query->get( 'order' ) : 'desc' );

		switch ( $orderby ) {
			case 'stock_quantity':
				$args['join']    = self::append_product_sorting_table_join( $args['join'] );
				$args['orderby'] = " wc_product_meta_lookup.stock_quantity {$order}, wc_product_meta_lookup.product_id {$order} ";
				break;
			case 'stock_status':
				$args['join']    = self::append_product_sorting_table_join( $args['join'] );
				$args['orderby'] = " wc_product_meta_lookup.stock_status {$order}, wc_product_meta_lookup.stock_quantity {$order} ";
				break;
			case 'sku':
				$args['join']    = self::append_product_sorting_table_join( $args['join'] );
				$args['orderby'] = " wc_product_meta_lookup.sku {$order}, wc_product_meta_lookup.product_id {$order} ";
				break;
		}

		return $args;
	}

	/**
	 * Prepare a report object for serialization.
	 *
	 * @param  WC_Product      $product  Report data.
	 * @param  WP_REST_Request $request Request object.
	 * @return WP_REST_Response
	 */
	public function prepare_item_for_response( $product, $request ) {
		$data = array(
			'id'               => $product->get_id(),
			'parent_id'        => $product->get_parent_id(),
			'name'             => wp_strip_all_tags( $product->get_name() ),
			'sku'              => $product->get_sku(),
			'stock_status'     => $product->get_stock_status(),
			'stock_quantity'   => (float) $product->get_stock_quantity(),
			'manage_stock'     => $product->get_manage_stock(),
			'low_stock_amount' => $product->get_low_stock_amount(),
		);

		if ( '' === $data['low_stock_amount'] ) {
			$data['low_stock_amount'] = absint( max( get_option( 'woocommerce_notify_low_stock_amount' ), 1 ) );
		}

		$context = ! empty( $request['context'] ) ? $request['context'] : 'view';
		$data    = $this->add_additional_fields_to_object( $data, $request );
		$data    = $this->filter_response_by_context( $data, $context );

		// Wrap the data in a response object.
		$response = rest_ensure_response( $data );
		$response->add_links( $this->prepare_links( $product ) );

		/**
		 * Filter a report returned from the API.
		 *
		 * Allows modification of the report data right before it is returned.
		 *
		 * @param WP_REST_Response $response The response object.
		 * @param WC_Product       $product   The original product object.
		 * @param WP_REST_Request  $request  Request used to generate the response.
		 */
		return apply_filters( 'woocommerce_rest_prepare_report_stock', $response, $product, $request );
	}

	/**
	 * Prepare links for the request.
	 *
	 * @param  WC_Product $product Object data.
	 * @return array
	 */
	protected function prepare_links( $product ) {
		if ( $product->is_type( 'variation' ) ) {
			$links = array(
				'product' => array(
					'href' => rest_url( sprintf( '/%s/products/%d/variations/%d', $this->namespace, $product->get_parent_id(), $product->get_id() ) ),
				),
				'parent'  => array(
					'href' => rest_url( sprintf( '/%s/products/%d', $this->namespace, $product->get_parent_id() ) ),
				),
			);
		} elseif ( $product->get_parent_id() ) {
			$links = array(
				'product' => array(
					'href' => rest_url( sprintf( '/%s/products/%d', $this->namespace, $product->get_id() ) ),
				),
				'parent'  => array(
					'href' => rest_url( sprintf( '/%s/products/%d', $this->namespace, $product->get_parent_id() ) ),
				),
			);
		} else {
			$links = array(
				'product' => array(
					'href' => rest_url( sprintf( '/%s/products/%d', $this->namespace, $product->get_id() ) ),
				),
			);
		}

		return $links;
	}

	/**
	 * Get the Report's schema, conforming to JSON Schema.
	 *
	 * @return array
	 */
	public function get_item_schema() {
		$schema = array(
			'$schema'    => 'http://json-schema.org/draft-04/schema#',
			'title'      => 'report_stock',
			'type'       => 'object',
			'properties' => array(
				'id'             => array(
					'description' => __( 'Unique identifier for the resource.', 'woocommerce' ),
					'type'        => 'integer',
					'context'     => array( 'view', 'edit' ),
					'readonly'    => true,
				),
				'parent_id'      => array(
					'description' => __( 'Product parent ID.', 'woocommerce' ),
					'type'        => 'integer',
					'context'     => array( 'view', 'edit' ),
					'readonly'    => true,
				),
				'name'           => array(
					'description' => __( 'Product name.', 'woocommerce' ),
					'type'        => 'string',
					'context'     => array( 'view', 'edit' ),
					'readonly'    => true,
				),
				'sku'            => array(
					'description' => __( 'Unique identifier.', 'woocommerce' ),
					'type'        => 'string',
					'context'     => array( 'view', 'edit' ),
					'readonly'    => true,
				),
				'stock_status'   => array(
					'description' => __( 'Stock status.', 'woocommerce' ),
					'type'        => 'string',
					'enum'        => array_keys( wc_get_product_stock_status_options() ),
					'context'     => array( 'view', 'edit' ),
					'readonly'    => true,
				),
				'stock_quantity' => array(
					'description' => __( 'Stock quantity.', 'woocommerce' ),
					'type'        => 'integer',
					'context'     => array( 'view', 'edit' ),
					'readonly'    => true,
				),
				'manage_stock'   => array(
					'description' => __( 'Manage stock.', 'woocommerce' ),
					'type'        => 'boolean',
					'context'     => array( 'view', 'edit' ),
					'readonly'    => true,
				),
			),
		);

		return $this->add_additional_fields_schema( $schema );
	}

	/**
	 * Get the query params for collections.
	 *
	 * @return array
	 */
	public function get_collection_params() {
		$params                   = array();
		$params['context']        = $this->get_context_param( array( 'default' => 'view' ) );
		$params['page']           = array(
			'description'       => __( 'Current page of the collection.', 'woocommerce' ),
			'type'              => 'integer',
			'default'           => 1,
			'sanitize_callback' => 'absint',
			'validate_callback' => 'rest_validate_request_arg',
			'minimum'           => 1,
		);
		$params['per_page']       = array(
			'description'       => __( 'Maximum number of items to be returned in result set.', 'woocommerce' ),
			'type'              => 'integer',
			'default'           => 10,
			'minimum'           => 1,
			'maximum'           => 100,
			'sanitize_callback' => 'absint',
			'validate_callback' => 'rest_validate_request_arg',
		);
		$params['exclude']        = array(
			'description'       => __( 'Ensure result set excludes specific IDs.', 'woocommerce' ),
			'type'              => 'array',
			'items'             => array(
				'type' => 'integer',
			),
			'default'           => array(),
			'sanitize_callback' => 'wp_parse_id_list',
		);
		$params['include']        = array(
			'description'       => __( 'Limit result set to specific ids.', 'woocommerce' ),
			'type'              => 'array',
			'items'             => array(
				'type' => 'integer',
			),
			'default'           => array(),
			'sanitize_callback' => 'wp_parse_id_list',
		);
		$params['offset']         = array(
			'description'       => __( 'Offset the result set by a specific number of items.', 'woocommerce' ),
			'type'              => 'integer',
			'sanitize_callback' => 'absint',
			'validate_callback' => 'rest_validate_request_arg',
		);
		$params['order']          = array(
			'description'       => __( 'Order sort attribute ascending or descending.', 'woocommerce' ),
			'type'              => 'string',
			'default'           => 'asc',
			'enum'              => array( 'asc', 'desc' ),
			'validate_callback' => 'rest_validate_request_arg',
		);
		$params['orderby']        = array(
			'description'       => __( 'Sort collection by object attribute.', 'woocommerce' ),
			'type'              => 'string',
			'default'           => 'stock_status',
			'enum'              => array(
				'stock_status',
				'stock_quantity',
				'date',
				'id',
				'include',
				'title',
				'sku',
			),
			'validate_callback' => 'rest_validate_request_arg',
		);
		$params['parent']         = array(
			'description'       => __( 'Limit result set to those of particular parent IDs.', 'woocommerce' ),
			'type'              => 'array',
			'items'             => array(
				'type' => 'integer',
			),
			'sanitize_callback' => 'wp_parse_id_list',
			'default'           => array(),
		);
		$params['parent_exclude'] = array(
			'description'       => __( 'Limit result set to all items except those of a particular parent ID.', 'woocommerce' ),
			'type'              => 'array',
			'items'             => array(
				'type' => 'integer',
			),
			'sanitize_callback' => 'wp_parse_id_list',
			'default'           => array(),
		);
		$params['type']           = array(
			'description' => __( 'Limit result set to items assigned a stock report type.', 'woocommerce' ),
			'type'        => 'string',
			'default'     => 'all',
			'enum'        => array_merge( array( 'all', 'lowstock' ), array_keys( wc_get_product_stock_status_options() ) ),
		);

		return $params;
	}

	/**
	 * Get the column names for export.
	 *
	 * @return array Key value pair of Column ID => Label.
	 */
	public function get_export_columns() {
		$export_columns = array(
			'title'          => __( 'Product / Variation', 'woocommerce' ),
			'sku'            => __( 'SKU', 'woocommerce' ),
			'stock_status'   => __( 'Status', 'woocommerce' ),
			'stock_quantity' => __( 'Stock', 'woocommerce' ),
		);

		/**
		 * Filter to add or remove column names from the stock report for
		 * export.
		 *
		 * @since 1.6.0
		 */
		return apply_filters(
			'woocommerce_report_stock_export_columns',
			$export_columns
		);
	}

	/**
	 * Get the column values for export.
	 *
	 * @param array $item Single report item/row.
	 * @return array Key value pair of Column ID => Row Value.
	 */
	public function prepare_item_for_export( $item ) {
		$status = $item['stock_status'];
		if ( array_key_exists( $item['stock_status'], $this->status_options ) ) {
			$status = $this->status_options[ $item['stock_status'] ];
		}

		$export_item = array(
			'title'          => $item['name'],
			'sku'            => $item['sku'],
			'stock_status'   => $status,
			'stock_quantity' => $item['stock_quantity'],
		);

		/**
		 * Filter to prepare extra columns in the export item for the stock
		 * report.
		 *
		 * @since 1.6.0
		 */
		return apply_filters(
			'woocommerce_report_stock_prepare_export_item',
			$export_item,
			$item
		);
	}
}
woocommerce-admin/src/API/Reports/Stock/Stats/DataStore.php000064400000010567151335517650017613 0ustar00<?php
/**
 * API\Reports\Stock\Stats\DataStore class file.
 */

namespace Automattic\WooCommerce\Admin\API\Reports\Stock\Stats;

defined( 'ABSPATH' ) || exit;

use \Automattic\WooCommerce\Admin\API\Reports\DataStore as ReportsDataStore;
use \Automattic\WooCommerce\Admin\API\Reports\DataStoreInterface;

/**
 * API\Reports\Stock\Stats\DataStore.
 */
class DataStore extends ReportsDataStore implements DataStoreInterface {

	/**
	 * Get stock counts for the whole store.
	 *
	 * @param array $query Not used for the stock stats data store, but needed for the interface.
	 * @return array Array of counts.
	 */
	public function get_data( $query ) {
		$report_data              = array();
		$cache_expire             = DAY_IN_SECONDS * 30;
		$low_stock_transient_name = 'wc_admin_stock_count_lowstock';
		$low_stock_count          = get_transient( $low_stock_transient_name );
		if ( false === $low_stock_count ) {
			$low_stock_count = $this->get_low_stock_count();
			set_transient( $low_stock_transient_name, $low_stock_count, $cache_expire );
		} else {
			$low_stock_count = intval( $low_stock_count );
		}
		$report_data['lowstock'] = $low_stock_count;

		$status_options = wc_get_product_stock_status_options();
		foreach ( $status_options as $status => $label ) {
			$transient_name = 'wc_admin_stock_count_' . $status;
			$count          = get_transient( $transient_name );
			if ( false === $count ) {
				$count = $this->get_count( $status );
				set_transient( $transient_name, $count, $cache_expire );
			} else {
				$count = intval( $count );
			}
			$report_data[ $status ] = $count;
		}

		$product_count_transient_name = 'wc_admin_product_count';
		$product_count                = get_transient( $product_count_transient_name );
		if ( false === $product_count ) {
			$product_count = $this->get_product_count();
			set_transient( $product_count_transient_name, $product_count, $cache_expire );
		} else {
			$product_count = intval( $product_count );
		}
		$report_data['products'] = $product_count;
		return $report_data;
	}

	/**
	 * Get low stock count (products with stock < low stock amount, but greater than no stock amount).
	 *
	 * @return int Low stock count.
	 */
	private function get_low_stock_count() {
		global $wpdb;

		$no_stock_amount  = absint( max( get_option( 'woocommerce_notify_no_stock_amount' ), 0 ) );
		$low_stock_amount = absint( max( get_option( 'woocommerce_notify_low_stock_amount' ), 1 ) );

		return (int) $wpdb->get_var(
			$wpdb->prepare(
				"
				SELECT count( DISTINCT posts.ID ) FROM {$wpdb->posts} posts
				LEFT JOIN {$wpdb->wc_product_meta_lookup} wc_product_meta_lookup ON posts.ID = wc_product_meta_lookup.product_id
				LEFT JOIN {$wpdb->postmeta} low_stock_amount_meta ON posts.ID = low_stock_amount_meta.post_id AND low_stock_amount_meta.meta_key = '_low_stock_amount'
				WHERE posts.post_type IN ( 'product', 'product_variation' )
				AND wc_product_meta_lookup.stock_quantity IS NOT NULL
				AND wc_product_meta_lookup.stock_status = 'instock'
				AND (
					(
						low_stock_amount_meta.meta_value > ''
						AND wc_product_meta_lookup.stock_quantity <= CAST(low_stock_amount_meta.meta_value AS SIGNED)
						AND wc_product_meta_lookup.stock_quantity > %d
					)
					OR (
						(
							low_stock_amount_meta.meta_value IS NULL OR low_stock_amount_meta.meta_value <= ''
						)
						AND wc_product_meta_lookup.stock_quantity <= %d
						AND wc_product_meta_lookup.stock_quantity > %d
					)
				)
				",
				$no_stock_amount,
				$low_stock_amount,
				$no_stock_amount
			)
		);
	}

	/**
	 * Get count for the passed in stock status.
	 *
	 * @param  string $status Status slug.
	 * @return int Count.
	 */
	private function get_count( $status ) {
		global $wpdb;

		return (int) $wpdb->get_var(
			$wpdb->prepare(
				"
				SELECT count( DISTINCT posts.ID ) FROM {$wpdb->posts} posts
				LEFT JOIN {$wpdb->wc_product_meta_lookup} wc_product_meta_lookup ON posts.ID = wc_product_meta_lookup.product_id
				WHERE posts.post_type IN ( 'product', 'product_variation' )
				AND wc_product_meta_lookup.stock_status = %s
				",
				$status
			)
		);
	}

	/**
	 * Get product count for the store.
	 *
	 * @return int Product count.
	 */
	private function get_product_count() {
		$query_args              = array();
		$query_args['post_type'] = array( 'product', 'product_variation' );
		$query                   = new \WP_Query();
		$query->query( $query_args );
		return intval( $query->found_posts );
	}
}
woocommerce-admin/src/API/Reports/Stock/Stats/Controller.php000064400000007074151335517650020047 0ustar00<?php
/**
 * REST API Reports stock stats controller
 *
 * Handles requests to the /reports/stock/stats endpoint.
 */

namespace Automattic\WooCommerce\Admin\API\Reports\Stock\Stats;

defined( 'ABSPATH' ) || exit;

/**
 * REST API Reports stock stats controller class.
 *
 * @extends WC_REST_Reports_Controller
 */
class Controller extends \WC_REST_Reports_Controller {

	/**
	 * Endpoint namespace.
	 *
	 * @var string
	 */
	protected $namespace = 'wc-analytics';

	/**
	 * Route base.
	 *
	 * @var string
	 */
	protected $rest_base = 'reports/stock/stats';

	/**
	 * Get Stock Status Totals.
	 *
	 * @param  WP_REST_Request $request Request data.
	 * @return array|WP_Error
	 */
	public function get_items( $request ) {
		$stock_query = new Query();
		$report_data = $stock_query->get_data();
		$out_data    = array(
			'totals' => $report_data,
		);
		return rest_ensure_response( $out_data );
	}

	/**
	 * Prepare a report object for serialization.
	 *
	 * @param  WC_Product      $report  Report data.
	 * @param  WP_REST_Request $request Request object.
	 * @return WP_REST_Response
	 */
	public function prepare_item_for_response( $report, $request ) {
		$data = $report;

		$context = ! empty( $request['context'] ) ? $request['context'] : 'view';
		$data    = $this->add_additional_fields_to_object( $data, $request );
		$data    = $this->filter_response_by_context( $data, $context );

		// Wrap the data in a response object.
		$response = rest_ensure_response( $data );

		/**
		 * Filter a report returned from the API.
		 *
		 * Allows modification of the report data right before it is returned.
		 *
		 * @param WP_REST_Response $response The response object.
		 * @param WC_Product       $product   The original bject.
		 * @param WP_REST_Request  $request  Request used to generate the response.
		 */
		return apply_filters( 'woocommerce_rest_prepare_report_stock_stats', $response, $product, $request );
	}

	/**
	 * Get the Report's schema, conforming to JSON Schema.
	 *
	 * @return array
	 */
	public function get_item_schema() {
		$totals = array(
			'products' => array(
				'description' => __( 'Number of products.', 'woocommerce' ),
				'type'        => 'integer',
				'context'     => array( 'view', 'edit' ),
				'readonly'    => true,
			),
			'lowstock' => array(
				'description' => __( 'Number of low stock products.', 'woocommerce' ),
				'type'        => 'integer',
				'context'     => array( 'view', 'edit' ),
				'readonly'    => true,
			),
		);

		$status_options = wc_get_product_stock_status_options();
		foreach ( $status_options as $status => $label ) {
			$totals[ $status ] = array(
				/* translators: Stock status. Example: "Number of low stock products */
				'description' => sprintf( __( 'Number of %s products.', 'woocommerce' ), $label ),
				'type'        => 'integer',
				'context'     => array( 'view', 'edit' ),
				'readonly'    => true,
			);
		}

		$schema = array(
			'$schema'    => 'http://json-schema.org/draft-04/schema#',
			'title'      => 'report_customers_stats',
			'type'       => 'object',
			'properties' => array(
				'totals' => array(
					'description' => __( 'Totals data.', 'woocommerce' ),
					'type'        => 'object',
					'context'     => array( 'view', 'edit' ),
					'readonly'    => true,
					'properties'  => $totals,
				),
			),
		);

		return $this->add_additional_fields_schema( $schema );
	}

	/**
	 * Get the query params for collections.
	 *
	 * @return array
	 */
	public function get_collection_params() {
		$params            = array();
		$params['context'] = $this->get_context_param( array( 'default' => 'view' ) );
		return $params;
	}
}
woocommerce-admin/src/API/Reports/Stock/Stats/Query.php000064400000001317151335517650017023 0ustar00<?php
/**
 * Class for stock stats report querying
 *
 * $report = new \Automattic\WooCommerce\Admin\API\Reports\Stock\Stats\Query();
 * $mydata = $report->get_data();
 */

namespace Automattic\WooCommerce\Admin\API\Reports\Stock\Stats;

defined( 'ABSPATH' ) || exit;

use \Automattic\WooCommerce\Admin\API\Reports\Query as ReportsQuery;

/**
 * API\Reports\Stock\Stats\Query
 */
class Query extends ReportsQuery {

	/**
	 * Get product data based on the current query vars.
	 *
	 * @return array
	 */
	public function get_data() {
		$data_store = \WC_Data_Store::load( 'report-stock-stats' );
		$results    = $data_store->get_data();
		return apply_filters( 'woocommerce_analytics_stock_stats_query', $results );
	}
}
woocommerce-admin/src/API/Reports/Variations/Query.php000064400000002367151335517650016767 0ustar00<?php
/**
 * Class for parameter-based Products Report querying
 *
 * Example usage:
 * $args = array(
 *          'before'       => '2018-07-19 00:00:00',
 *          'after'        => '2018-07-05 00:00:00',
 *          'page'         => 2,
 *          'categories'   => array(15, 18),
 *          'products'     => array(1,2,3)
 *         );
 * $report = new \Automattic\WooCommerce\Admin\API\Reports\Variations\Query( $args );
 * $mydata = $report->get_data();
 */

namespace Automattic\WooCommerce\Admin\API\Reports\Variations;

defined( 'ABSPATH' ) || exit;

use \Automattic\WooCommerce\Admin\API\Reports\Query as ReportsQuery;

/**
 * API\Reports\Variations\Query
 */
class Query extends ReportsQuery {

	/**
	 * Valid fields for Products report.
	 *
	 * @return array
	 */
	protected function get_default_query_vars() {
		return array();
	}

	/**
	 * Get product data based on the current query vars.
	 *
	 * @return array
	 */
	public function get_data() {
		$args = apply_filters( 'woocommerce_analytics_variations_query_args', $this->get_query_vars() );

		$data_store = \WC_Data_Store::load( 'report-variations' );
		$results    = $data_store->get_data( $args );
		return apply_filters( 'woocommerce_analytics_variations_select_query', $results, $args );
	}
}
woocommerce-admin/src/API/Reports/Variations/DataStore.php000064400000035031151335517650017542 0ustar00<?php
/**
 * API\Reports\Variations\DataStore class file.
 */

namespace Automattic\WooCommerce\Admin\API\Reports\Variations;

defined( 'ABSPATH' ) || exit;

use \Automattic\WooCommerce\Admin\API\Reports\DataStore as ReportsDataStore;
use \Automattic\WooCommerce\Admin\API\Reports\DataStoreInterface;
use \Automattic\WooCommerce\Admin\API\Reports\TimeInterval;
use \Automattic\WooCommerce\Admin\API\Reports\SqlQuery;

/**
 * API\Reports\Variations\DataStore.
 */
class DataStore extends ReportsDataStore implements DataStoreInterface {

	/**
	 * Table used to get the data.
	 *
	 * @var string
	 */
	protected static $table_name = 'wc_order_product_lookup';

	/**
	 * Cache identifier.
	 *
	 * @var string
	 */
	protected $cache_key = 'variations';

	/**
	 * Mapping columns to data type to return correct response types.
	 *
	 * @var array
	 */
	protected $column_types = array(
		'date_start'   => 'strval',
		'date_end'     => 'strval',
		'product_id'   => 'intval',
		'variation_id' => 'intval',
		'items_sold'   => 'intval',
		'net_revenue'  => 'floatval',
		'orders_count' => 'intval',
		'name'         => 'strval',
		'price'        => 'floatval',
		'image'        => 'strval',
		'permalink'    => 'strval',
		'sku'          => 'strval',
	);

	/**
	 * Extended product attributes to include in the data.
	 *
	 * @var array
	 */
	protected $extended_attributes = array(
		'name',
		'price',
		'image',
		'permalink',
		'stock_status',
		'stock_quantity',
		'low_stock_amount',
		'sku',
	);

	/**
	 * Data store context used to pass to filters.
	 *
	 * @var string
	 */
	protected $context = 'variations';

	/**
	 * Assign report columns once full table name has been assigned.
	 */
	protected function assign_report_columns() {
		$table_name           = self::get_db_table_name();
		$this->report_columns = array(
			'product_id'   => 'product_id',
			'variation_id' => 'variation_id',
			'items_sold'   => 'SUM(product_qty) as items_sold',
			'net_revenue'  => 'SUM(product_net_revenue) AS net_revenue',
			'orders_count' => "COUNT(DISTINCT {$table_name}.order_id) as orders_count",
		);
	}

	/**
	 * Fills FROM clause of SQL request based on user supplied parameters.
	 *
	 * @param array  $query_args Parameters supplied by the user.
	 * @param string $arg_name   Target of the JOIN sql param.
	 */
	protected function add_from_sql_params( $query_args, $arg_name ) {
		global $wpdb;

		if ( 'sku' !== $query_args['orderby'] ) {
			return;
		}

		$table_name = self::get_db_table_name();
		$join       = "LEFT JOIN {$wpdb->postmeta} AS postmeta ON {$table_name}.variation_id = postmeta.post_id AND postmeta.meta_key = '_sku'";

		if ( 'inner' === $arg_name ) {
			$this->subquery->add_sql_clause( 'join', $join );
		} else {
			$this->add_sql_clause( 'join', $join );
		}
	}

	/**
	 * Generate a subquery for order_item_id based on the attribute filters.
	 *
	 * @param array $query_args Query arguments supplied by the user.
	 * @return string
	 */
	protected function get_order_item_by_attribute_subquery( $query_args ) {
		$order_product_lookup_table = self::get_db_table_name();
		$attribute_subqueries       = $this->get_attribute_subqueries( $query_args, $order_product_lookup_table );

		if ( $attribute_subqueries['join'] && $attribute_subqueries['where'] ) {
			// Perform a subquery for DISTINCT order items that match our attribute filters.
			$attr_subquery = new SqlQuery( $this->context . '_attribute_subquery' );
			$attr_subquery->add_sql_clause( 'select', "DISTINCT {$order_product_lookup_table}.order_item_id" );
			$attr_subquery->add_sql_clause( 'from', $order_product_lookup_table );
			$attr_subquery->add_sql_clause( 'where', "AND {$order_product_lookup_table}.variation_id != 0" );

			foreach ( $attribute_subqueries['join'] as $attribute_join ) {
				$attr_subquery->add_sql_clause( 'join', $attribute_join );
			}

			$operator = $this->get_match_operator( $query_args );
			$attr_subquery->add_sql_clause( 'where', 'AND (' . implode( " {$operator} ", $attribute_subqueries['where'] ) . ')' );

			return "AND {$order_product_lookup_table}.order_item_id IN ({$attr_subquery->get_query_statement()})";
		}

		return false;
	}

	/**
	 * Updates the database query with parameters used for Products report: categories and order status.
	 *
	 * @param array $query_args Query arguments supplied by the user.
	 */
	protected function add_sql_query_params( $query_args ) {
		global $wpdb;
		$order_product_lookup_table = self::get_db_table_name();
		$order_stats_lookup_table   = $wpdb->prefix . 'wc_order_stats';
		$order_item_meta_table      = $wpdb->prefix . 'woocommerce_order_itemmeta';
		$where_subquery             = array();

		$this->add_time_period_sql_params( $query_args, $order_product_lookup_table );
		$this->get_limit_sql_params( $query_args );
		$this->add_order_by_sql_params( $query_args );

		$included_variations = $this->get_included_variations( $query_args );
		if ( $included_variations > 0 ) {
			$this->add_from_sql_params( $query_args, 'outer' );
		} else {
			$this->add_from_sql_params( $query_args, 'inner' );
		}

		$included_products = $this->get_included_products( $query_args );
		if ( $included_products ) {
			$this->subquery->add_sql_clause( 'where', "AND {$order_product_lookup_table}.product_id IN ({$included_products})" );
		}

		$excluded_products = $this->get_excluded_products( $query_args );
		if ( $excluded_products ) {
			$this->subquery->add_sql_clause( 'where', "AND {$order_product_lookup_table}.product_id NOT IN ({$excluded_products})" );
		}

		if ( $included_variations ) {
			$this->subquery->add_sql_clause( 'where', "AND {$order_product_lookup_table}.variation_id IN ({$included_variations})" );
		} elseif ( ! $included_products ) {
			$this->subquery->add_sql_clause( 'where', "AND {$order_product_lookup_table}.variation_id != 0" );
		}

		$order_status_filter = $this->get_status_subquery( $query_args );
		if ( $order_status_filter ) {
			$this->subquery->add_sql_clause( 'join', "JOIN {$order_stats_lookup_table} ON {$order_product_lookup_table}.order_id = {$order_stats_lookup_table}.order_id" );
			$this->subquery->add_sql_clause( 'where', "AND ( {$order_status_filter} )" );
		}

		$attribute_order_items_subquery = $this->get_order_item_by_attribute_subquery( $query_args );
		if ( $attribute_order_items_subquery ) {
			// JOIN on product lookup if we haven't already.
			if ( ! $order_status_filter ) {
				$this->subquery->add_sql_clause( 'join', "JOIN {$order_product_lookup_table} ON {$order_stats_lookup_table}.order_id = {$order_product_lookup_table}.order_id" );
			}

			// Add subquery for matching attributes to WHERE.
			$this->subquery->add_sql_clause( 'where', $attribute_order_items_subquery );
		}

		if ( 0 < count( $where_subquery ) ) {
			$operator = $this->get_match_operator( $query_args );
			$this->subquery->add_sql_clause( 'where', 'AND (' . implode( " {$operator} ", $where_subquery ) . ')' );
		}
	}

	/**
	 * Maps ordering specified by the user to columns in the database/fields in the data.
	 *
	 * @param string $order_by Sorting criterion.
	 *
	 * @return string
	 */
	protected function normalize_order_by( $order_by ) {
		if ( 'date' === $order_by ) {
			return self::get_db_table_name() . '.date_created';
		}
		if ( 'sku' === $order_by ) {
			return 'meta_value';
		}

		return $order_by;
	}

	/**
	 * Enriches the product data with attributes specified by the extended_attributes.
	 *
	 * @param array $products_data Product data.
	 * @param array $query_args Query parameters.
	 */
	protected function include_extended_info( &$products_data, $query_args ) {
		foreach ( $products_data as $key => $product_data ) {
			$extended_info = new \ArrayObject();
			if ( $query_args['extended_info'] ) {
				$extended_attributes = apply_filters( 'woocommerce_rest_reports_variations_extended_attributes', $this->extended_attributes, $product_data );
				$parent_product      = wc_get_product( $product_data['product_id'] );
				$attributes          = array();

				// Base extended info off the parent variable product if the variation ID is 0.
				// This is caused by simple products with prior sales being converted into variable products.
				// See: https://github.com/woocommerce/woocommerce-admin/issues/2719.
				$variation_id      = (int) $product_data['variation_id'];
				$variation_product = ( 0 === $variation_id ) ? $parent_product : wc_get_product( $variation_id );

				// Fall back to the parent product if the variation can't be found.
				$extended_attributes_product = is_a( $variation_product, 'WC_Product' ) ? $variation_product : $parent_product;

				foreach ( $extended_attributes as $extended_attribute ) {
					$function = 'get_' . $extended_attribute;
					if ( is_callable( array( $extended_attributes_product, $function ) ) ) {
						$value                                = $extended_attributes_product->{$function}();
						$extended_info[ $extended_attribute ] = $value;
					}
				}

				// If this is a variation, add its attributes.
				// NOTE: We don't fall back to the parent product here because it will include all possible attribute options.
				if (
					0 < $variation_id &&
					is_callable( array( $variation_product, 'get_variation_attributes' ) )
				) {
					$variation_attributes = $variation_product->get_variation_attributes();

					foreach ( $variation_attributes as $attribute_name => $attribute ) {
						$name         = str_replace( 'attribute_', '', $attribute_name );
						$option_term  = get_term_by( 'slug', $attribute, $name );
						$attributes[] = array(
							'id'     => wc_attribute_taxonomy_id_by_name( $name ),
							'name'   => str_replace( 'pa_', '', $name ),
							'option' => $option_term && ! is_wp_error( $option_term ) ? $option_term->name : $attribute,
						);
					}
				}

				$extended_info['attributes'] = $attributes;

				// If there is no set low_stock_amount, use the one in user settings.
				if ( '' === $extended_info['low_stock_amount'] ) {
					$extended_info['low_stock_amount'] = absint( max( get_option( 'woocommerce_notify_low_stock_amount' ), 1 ) );
				}
				$extended_info = $this->cast_numbers( $extended_info );
			}
			$products_data[ $key ]['extended_info'] = $extended_info;
		}
	}

	/**
	 * Returns the report data based on parameters supplied by the user.
	 *
	 * @param array $query_args Query parameters.
	 *
	 * @return stdClass|WP_Error Data.
	 */
	public function get_data( $query_args ) {
		global $wpdb;

		$table_name = self::get_db_table_name();

		// These defaults are only partially applied when used via REST API, as that has its own defaults.
		$defaults   = array(
			'per_page'           => get_option( 'posts_per_page' ),
			'page'               => 1,
			'order'              => 'DESC',
			'orderby'            => 'date',
			'before'             => TimeInterval::default_before(),
			'after'              => TimeInterval::default_after(),
			'fields'             => '*',
			'product_includes'   => array(),
			'variation_includes' => array(),
			'extended_info'      => false,
		);
		$query_args = wp_parse_args( $query_args, $defaults );
		$this->normalize_timezones( $query_args, $defaults );

		/*
		 * We need to get the cache key here because
		 * parent::update_intervals_sql_params() modifies $query_args.
		 */
		$cache_key = $this->get_cache_key( $query_args );
		$data      = $this->get_cached_data( $cache_key );

		if ( false === $data ) {
			$this->initialize_queries();

			$data = (object) array(
				'data'    => array(),
				'total'   => 0,
				'pages'   => 0,
				'page_no' => 0,
			);

			$selections          = $this->selected_columns( $query_args );
			$included_variations =
				( isset( $query_args['variation_includes'] ) && is_array( $query_args['variation_includes'] ) )
					? $query_args['variation_includes']
					: array();
			$params              = $this->get_limit_params( $query_args );
			$this->add_sql_query_params( $query_args );

			if ( count( $included_variations ) > 0 ) {
				$total_results = count( $included_variations );
				$total_pages   = (int) ceil( $total_results / $params['per_page'] );

				$this->subquery->clear_sql_clause( 'select' );
				$this->subquery->add_sql_clause( 'select', $selections );

				if ( 'date' === $query_args['orderby'] ) {
					$this->subquery->add_sql_clause( 'select', ", {$table_name}.date_created" );
				}

				$fields          = $this->get_fields( $query_args );
				$join_selections = $this->format_join_selections( $fields, array( 'variation_id' ) );
				$ids_table       = $this->get_ids_table( $included_variations, 'variation_id' );

				$this->add_sql_clause( 'select', $join_selections );
				$this->add_sql_clause( 'from', '(' );
				$this->add_sql_clause( 'from', $this->subquery->get_query_statement() );
				$this->add_sql_clause( 'from', ") AS {$table_name}" );
				$this->add_sql_clause(
					'right_join',
					"RIGHT JOIN ( {$ids_table} ) AS default_results
					ON default_results.variation_id = {$table_name}.variation_id"
				);

				$variations_query = $this->get_query_statement();
			} else {
				/* phpcs:disable WordPress.DB.PreparedSQL.InterpolatedNotPrepared */
				$db_records_count = (int) $wpdb->get_var(
					"SELECT COUNT(*) FROM (
						{$this->subquery->get_query_statement()}
					) AS tt"
				);
				/* phpcs:enable */

				$total_results = $db_records_count;
				$total_pages   = (int) ceil( $db_records_count / $params['per_page'] );

				if ( $query_args['page'] < 1 || $query_args['page'] > $total_pages ) {
					return $data;
				}

				$this->subquery->clear_sql_clause( 'select' );
				$this->subquery->add_sql_clause( 'select', $selections );
				$this->subquery->add_sql_clause( 'order_by', $this->get_sql_clause( 'order_by' ) );
				$this->subquery->add_sql_clause( 'limit', $this->get_sql_clause( 'limit' ) );
				$variations_query = $this->subquery->get_query_statement();
			}

			/* phpcs:disable WordPress.DB.PreparedSQL.NotPrepared */
			$product_data = $wpdb->get_results(
				$variations_query,
				ARRAY_A
			);
			/* phpcs:enable */

			if ( null === $product_data ) {
				return $data;
			}

			$this->include_extended_info( $product_data, $query_args );

			$product_data = array_map( array( $this, 'cast_numbers' ), $product_data );
			$data         = (object) array(
				'data'    => $product_data,
				'total'   => $total_results,
				'pages'   => $total_pages,
				'page_no' => (int) $query_args['page'],
			);

			$this->set_cached_data( $cache_key, $data );
		}

		return $data;
	}

	/**
	 * Initialize query objects.
	 */
	protected function initialize_queries() {
		$this->clear_all_clauses();
		$this->subquery = new SqlQuery( $this->context . '_subquery' );
		$this->subquery->add_sql_clause( 'select', 'product_id' );
		$this->subquery->add_sql_clause( 'from', self::get_db_table_name() );
		$this->subquery->add_sql_clause( 'group_by', 'product_id, variation_id' );
	}
}
woocommerce-admin/src/API/Reports/Variations/Controller.php000064400000035305151335517650020003 0ustar00<?php
/**
 * REST API Reports products controller
 *
 * Handles requests to the /reports/products endpoint.
 */

namespace Automattic\WooCommerce\Admin\API\Reports\Variations;

defined( 'ABSPATH' ) || exit;

use \Automattic\WooCommerce\Admin\API\Reports\Controller as ReportsController;
use \Automattic\WooCommerce\Admin\API\Reports\ExportableInterface;
use \Automattic\WooCommerce\Admin\API\Reports\ExportableTraits;

/**
 * REST API Reports products controller class.
 *
 * @extends WC_REST_Reports_Controller
 */
class Controller extends ReportsController implements ExportableInterface {
	/**
	 * Exportable traits.
	 */
	use ExportableTraits;

	/**
	 * Endpoint namespace.
	 *
	 * @var string
	 */
	protected $namespace = 'wc-analytics';

	/**
	 * Route base.
	 *
	 * @var string
	 */
	protected $rest_base = 'reports/variations';

	/**
	 * Mapping between external parameter name and name used in query class.
	 *
	 * @var array
	 */
	protected $param_mapping = array(
		'variations' => 'variation_includes',
	);

	/**
	 * Get items.
	 *
	 * @param WP_REST_Request $request Request data.
	 *
	 * @return array|WP_Error
	 */
	public function get_items( $request ) {
		$args       = array();
		$registered = array_keys( $this->get_collection_params() );
		foreach ( $registered as $param_name ) {
			if ( isset( $request[ $param_name ] ) ) {
				if ( isset( $this->param_mapping[ $param_name ] ) ) {
					$args[ $this->param_mapping[ $param_name ] ] = $request[ $param_name ];
				} else {
					$args[ $param_name ] = $request[ $param_name ];
				}
			}
		}

		$reports       = new Query( $args );
		$products_data = $reports->get_data();

		$data = array();

		foreach ( $products_data->data as $product_data ) {
			$item   = $this->prepare_item_for_response( $product_data, $request );
			$data[] = $this->prepare_response_for_collection( $item );
		}

		$response = rest_ensure_response( $data );
		$response->header( 'X-WP-Total', (int) $products_data->total );
		$response->header( 'X-WP-TotalPages', (int) $products_data->pages );

		$page      = $products_data->page_no;
		$max_pages = $products_data->pages;
		$base      = add_query_arg( $request->get_query_params(), rest_url( sprintf( '/%s/%s', $this->namespace, $this->rest_base ) ) );
		if ( $page > 1 ) {
			$prev_page = $page - 1;
			if ( $prev_page > $max_pages ) {
				$prev_page = $max_pages;
			}
			$prev_link = add_query_arg( 'page', $prev_page, $base );
			$response->link_header( 'prev', $prev_link );
		}
		if ( $max_pages > $page ) {
			$next_page = $page + 1;
			$next_link = add_query_arg( 'page', $next_page, $base );
			$response->link_header( 'next', $next_link );
		}

		return $response;
	}

	/**
	 * Prepare a report object for serialization.
	 *
	 * @param array           $report  Report data.
	 * @param WP_REST_Request $request Request object.
	 * @return WP_REST_Response
	 */
	public function prepare_item_for_response( $report, $request ) {
		$data = $report;

		$context = ! empty( $request['context'] ) ? $request['context'] : 'view';
		$data    = $this->add_additional_fields_to_object( $data, $request );
		$data    = $this->filter_response_by_context( $data, $context );

		// Wrap the data in a response object.
		$response = rest_ensure_response( $data );
		$response->add_links( $this->prepare_links( $report ) );

		/**
		 * Filter a report returned from the API.
		 *
		 * Allows modification of the report data right before it is returned.
		 *
		 * @param WP_REST_Response $response The response object.
		 * @param object           $report   The original report object.
		 * @param WP_REST_Request  $request  Request used to generate the response.
		 */
		return apply_filters( 'woocommerce_rest_prepare_report_variations', $response, $report, $request );
	}

	/**
	 * Prepare links for the request.
	 *
	 * @param array $object Object data.
	 * @return array        Links for the given post.
	 */
	protected function prepare_links( $object ) {
		$links = array(
			'product'   => array(
				'href' => rest_url( sprintf( '/%s/%s/%d', $this->namespace, 'products', $object['product_id'] ) ),
			),
			'variation' => array(
				'href' => rest_url( sprintf( '/%s/%s/%d/%s/%d', $this->namespace, 'products', $object['product_id'], 'variation', $object['variation_id'] ) ),
			),
		);

		return $links;
	}

	/**
	 * Get the Report's schema, conforming to JSON Schema.
	 *
	 * @return array
	 */
	public function get_item_schema() {
		$schema = array(
			'$schema'    => 'http://json-schema.org/draft-04/schema#',
			'title'      => 'report_varitations',
			'type'       => 'object',
			'properties' => array(
				'product_id'    => array(
					'type'        => 'integer',
					'readonly'    => true,
					'context'     => array( 'view', 'edit' ),
					'description' => __( 'Product ID.', 'woocommerce' ),
				),
				'variation_id'  => array(
					'type'        => 'integer',
					'readonly'    => true,
					'context'     => array( 'view', 'edit' ),
					'description' => __( 'Product ID.', 'woocommerce' ),
				),
				'items_sold'    => array(
					'type'        => 'integer',
					'readonly'    => true,
					'context'     => array( 'view', 'edit' ),
					'description' => __( 'Number of items sold.', 'woocommerce' ),
				),
				'net_revenue'   => array(
					'type'        => 'number',
					'readonly'    => true,
					'context'     => array( 'view', 'edit' ),
					'description' => __( 'Total Net sales of all items sold.', 'woocommerce' ),
				),
				'orders_count'  => array(
					'type'        => 'integer',
					'readonly'    => true,
					'context'     => array( 'view', 'edit' ),
					'description' => __( 'Number of orders product appeared in.', 'woocommerce' ),
				),
				'extended_info' => array(
					'name'             => array(
						'type'        => 'string',
						'readonly'    => true,
						'context'     => array( 'view', 'edit' ),
						'description' => __( 'Product name.', 'woocommerce' ),
					),
					'price'            => array(
						'type'        => 'number',
						'readonly'    => true,
						'context'     => array( 'view', 'edit' ),
						'description' => __( 'Product price.', 'woocommerce' ),
					),
					'image'            => array(
						'type'        => 'string',
						'readonly'    => true,
						'context'     => array( 'view', 'edit' ),
						'description' => __( 'Product image.', 'woocommerce' ),
					),
					'permalink'        => array(
						'type'        => 'string',
						'readonly'    => true,
						'context'     => array( 'view', 'edit' ),
						'description' => __( 'Product link.', 'woocommerce' ),
					),
					'attributes'       => array(
						'type'        => 'array',
						'readonly'    => true,
						'context'     => array( 'view', 'edit' ),
						'description' => __( 'Product attributes.', 'woocommerce' ),
					),
					'stock_status'     => array(
						'type'        => 'string',
						'readonly'    => true,
						'context'     => array( 'view', 'edit' ),
						'description' => __( 'Product inventory status.', 'woocommerce' ),
					),
					'stock_quantity'   => array(
						'type'        => 'integer',
						'readonly'    => true,
						'context'     => array( 'view', 'edit' ),
						'description' => __( 'Product inventory quantity.', 'woocommerce' ),
					),
					'low_stock_amount' => array(
						'type'        => 'integer',
						'readonly'    => true,
						'context'     => array( 'view', 'edit' ),
						'description' => __( 'Product inventory threshold for low stock.', 'woocommerce' ),
					),
				),
			),
		);

		return $this->add_additional_fields_schema( $schema );
	}

	/**
	 * Get the query params for collections.
	 *
	 * @return array
	 */
	public function get_collection_params() {
		$params                      = array();
		$params['context']           = $this->get_context_param( array( 'default' => 'view' ) );
		$params['page']              = array(
			'description'       => __( 'Current page of the collection.', 'woocommerce' ),
			'type'              => 'integer',
			'default'           => 1,
			'sanitize_callback' => 'absint',
			'validate_callback' => 'rest_validate_request_arg',
			'minimum'           => 1,
		);
		$params['per_page']          = array(
			'description'       => __( 'Maximum number of items to be returned in result set.', 'woocommerce' ),
			'type'              => 'integer',
			'default'           => 10,
			'minimum'           => 1,
			'maximum'           => 100,
			'sanitize_callback' => 'absint',
			'validate_callback' => 'rest_validate_request_arg',
		);
		$params['after']             = array(
			'description'       => __( 'Limit response to resources published after a given ISO8601 compliant date.', 'woocommerce' ),
			'type'              => 'string',
			'format'            => 'date-time',
			'validate_callback' => 'rest_validate_request_arg',
		);
		$params['before']            = array(
			'description'       => __( 'Limit response to resources published before a given ISO8601 compliant date.', 'woocommerce' ),
			'type'              => 'string',
			'format'            => 'date-time',
			'validate_callback' => 'rest_validate_request_arg',
		);
		$params['match']             = array(
			'description'       => __( 'Indicates whether all the conditions should be true for the resulting set, or if any one of them is sufficient. Match affects the following parameters: status_is, status_is_not, product_includes, product_excludes, coupon_includes, coupon_excludes, customer, categories', 'woocommerce' ),
			'type'              => 'string',
			'default'           => 'all',
			'enum'              => array(
				'all',
				'any',
			),
			'validate_callback' => 'rest_validate_request_arg',
		);
		$params['order']             = array(
			'description'       => __( 'Order sort attribute ascending or descending.', 'woocommerce' ),
			'type'              => 'string',
			'default'           => 'desc',
			'enum'              => array( 'asc', 'desc' ),
			'validate_callback' => 'rest_validate_request_arg',
		);
		$params['orderby']           = array(
			'description'       => __( 'Sort collection by object attribute.', 'woocommerce' ),
			'type'              => 'string',
			'default'           => 'date',
			'enum'              => array(
				'date',
				'net_revenue',
				'orders_count',
				'items_sold',
				'sku',
			),
			'validate_callback' => 'rest_validate_request_arg',
		);
		$params['product_includes']  = array(
			'description'       => __( 'Limit result set to items that have the specified parent product(s).', 'woocommerce' ),
			'type'              => 'array',
			'items'             => array(
				'type' => 'integer',
			),
			'default'           => array(),
			'sanitize_callback' => 'wp_parse_id_list',
			'validate_callback' => 'rest_validate_request_arg',
		);
		$params['product_excludes']  = array(
			'description'       => __( 'Limit result set to items that don\'t have the specified parent product(s).', 'woocommerce' ),
			'type'              => 'array',
			'items'             => array(
				'type' => 'integer',
			),
			'default'           => array(),
			'validate_callback' => 'rest_validate_request_arg',
			'sanitize_callback' => 'wp_parse_id_list',
		);
		$params['variations']        = array(
			'description'       => __( 'Limit result to items with specified variation ids.', 'woocommerce' ),
			'type'              => 'array',
			'sanitize_callback' => 'wp_parse_id_list',
			'validate_callback' => 'rest_validate_request_arg',
			'items'             => array(
				'type' => 'integer',
			),
		);
		$params['extended_info']     = array(
			'description'       => __( 'Add additional piece of info about each variation to the report.', 'woocommerce' ),
			'type'              => 'boolean',
			'default'           => false,
			'sanitize_callback' => 'wc_string_to_bool',
			'validate_callback' => 'rest_validate_request_arg',
		);
		$params['attribute_is']      = array(
			'description'       => __( 'Limit result set to variations that include the specified attributes.', 'woocommerce' ),
			'type'              => 'array',
			'items'             => array(
				'type' => 'array',
			),
			'default'           => array(),
			'validate_callback' => 'rest_validate_request_arg',
		);
		$params['attribute_is_not']  = array(
			'description'       => __( 'Limit result set to variations that don\'t include the specified attributes.', 'woocommerce' ),
			'type'              => 'array',
			'items'             => array(
				'type' => 'array',
			),
			'default'           => array(),
			'validate_callback' => 'rest_validate_request_arg',
		);
		$params['category_includes'] = array(
			'description'       => __( 'Limit result set to variations in the specified categories.', 'woocommerce' ),
			'type'              => 'array',
			'sanitize_callback' => 'wp_parse_id_list',
			'validate_callback' => 'rest_validate_request_arg',
			'items'             => array(
				'type' => 'integer',
			),
		);
		$params['category_excludes'] = array(
			'description'       => __( 'Limit result set to variations not in the specified categories.', 'woocommerce' ),
			'type'              => 'array',
			'sanitize_callback' => 'wp_parse_id_list',
			'validate_callback' => 'rest_validate_request_arg',
			'items'             => array(
				'type' => 'integer',
			),
		);

		return $params;
	}

	/**
	 * Get stock status column export value.
	 *
	 * @param array $status Stock status from report row.
	 * @return string
	 */
	protected function _get_stock_status( $status ) {
		$statuses = wc_get_product_stock_status_options();

		return isset( $statuses[ $status ] ) ? $statuses[ $status ] : '';
	}

	/**
	 * Get the column names for export.
	 *
	 * @return array Key value pair of Column ID => Label.
	 */
	public function get_export_columns() {
		$export_columns = array(
			'product_name' => __( 'Product / Variation title', 'woocommerce' ),
			'sku'          => __( 'SKU', 'woocommerce' ),
			'items_sold'   => __( 'Items sold', 'woocommerce' ),
			'net_revenue'  => __( 'N. Revenue', 'woocommerce' ),
			'orders_count' => __( 'Orders', 'woocommerce' ),
		);

		if ( 'yes' === get_option( 'woocommerce_manage_stock' ) ) {
			$export_columns['stock_status'] = __( 'Status', 'woocommerce' );
			$export_columns['stock']        = __( 'Stock', 'woocommerce' );
		}

		return $export_columns;
	}

	/**
	 * Get the column values for export.
	 *
	 * @param array $item Single report item/row.
	 * @return array Key value pair of Column ID => Row Value.
	 */
	public function prepare_item_for_export( $item ) {
		$export_item = array(
			'product_name' => $item['extended_info']['name'],
			'sku'          => $item['extended_info']['sku'],
			'items_sold'   => $item['items_sold'],
			'net_revenue'  => self::csv_number_format( $item['net_revenue'] ),
			'orders_count' => $item['orders_count'],
		);

		if ( 'yes' === get_option( 'woocommerce_manage_stock' ) ) {
			$export_item['stock_status'] = $this->_get_stock_status( $item['extended_info']['stock_status'] );
			$export_item['stock']        = $item['extended_info']['stock_quantity'];
		}

		return $export_item;
	}
}
woocommerce-admin/src/API/Reports/Variations/Stats/DataStore.php000064400000025474151335517650020652 0ustar00<?php
/**
 * API\Reports\Products\Stats\DataStore class file.
 */

namespace Automattic\WooCommerce\Admin\API\Reports\Variations\Stats;

defined( 'ABSPATH' ) || exit;

use \Automattic\WooCommerce\Admin\API\Reports\Variations\DataStore as VariationsDataStore;
use \Automattic\WooCommerce\Admin\API\Reports\DataStoreInterface;
use \Automattic\WooCommerce\Admin\API\Reports\TimeInterval;
use \Automattic\WooCommerce\Admin\API\Reports\SqlQuery;

/**
 * API\Reports\Variations\Stats\DataStore.
 */
class DataStore extends VariationsDataStore implements DataStoreInterface {

	/**
	 * Mapping columns to data type to return correct response types.
	 *
	 * @var array
	 */
	protected $column_types = array(
		'items_sold'       => 'intval',
		'net_revenue'      => 'floatval',
		'orders_count'     => 'intval',
		'variations_count' => 'intval',
	);

	/**
	 * Cache identifier.
	 *
	 * @var string
	 */
	protected $cache_key = 'variations_stats';

	/**
	 * Data store context used to pass to filters.
	 *
	 * @var string
	 */
	protected $context = 'variations_stats';

	/**
	 * Assign report columns once full table name has been assigned.
	 */
	protected function assign_report_columns() {
		$table_name           = self::get_db_table_name();
		$this->report_columns = array(
			'items_sold'       => 'SUM(product_qty) as items_sold',
			'net_revenue'      => 'SUM(product_net_revenue) AS net_revenue',
			'orders_count'     => "COUNT( DISTINCT ( CASE WHEN product_gross_revenue >= 0 THEN {$table_name}.order_id END ) ) as orders_count",
			'variations_count' => 'COUNT(DISTINCT variation_id) as variations_count',
		);
	}

	/**
	 * Updates the database query with parameters used for Products Stats report: categories and order status.
	 *
	 * @param array $query_args       Query arguments supplied by the user.
	 */
	protected function update_sql_query_params( $query_args ) {
		global $wpdb;

		$products_where_clause      = '';
		$products_from_clause       = '';
		$where_subquery             = array();
		$order_product_lookup_table = self::get_db_table_name();
		$order_item_meta_table      = $wpdb->prefix . 'woocommerce_order_itemmeta';

		$included_products = $this->get_included_products( $query_args );
		if ( $included_products ) {
			$products_where_clause .= " AND {$order_product_lookup_table}.product_id IN ({$included_products})";
		}

		$excluded_products = $this->get_excluded_products( $query_args );
		if ( $excluded_products ) {
			$products_where_clause .= "AND {$order_product_lookup_table}.product_id NOT IN ({$excluded_products})";
		}

		$included_variations = $this->get_included_variations( $query_args );
		if ( $included_variations ) {
			$products_where_clause .= " AND {$order_product_lookup_table}.variation_id IN ({$included_variations})";
		} else {
			$products_where_clause .= " AND {$order_product_lookup_table}.variation_id != 0";
		}

		$order_status_filter = $this->get_status_subquery( $query_args );
		if ( $order_status_filter ) {
			$products_from_clause  .= " JOIN {$wpdb->prefix}wc_order_stats ON {$order_product_lookup_table}.order_id = {$wpdb->prefix}wc_order_stats.order_id";
			$products_where_clause .= " AND ( {$order_status_filter} )";
		}

		$attribute_order_items_subquery = $this->get_order_item_by_attribute_subquery( $query_args );
		if ( $attribute_order_items_subquery ) {
			// JOIN on product lookup if we haven't already.
			if ( ! $order_status_filter ) {
				$products_from_clause .= " JOIN {$wpdb->prefix}wc_order_stats ON {$order_product_lookup_table}.order_id = {$wpdb->prefix}wc_order_stats.order_id";
			}

			// Add subquery for matching attributes to WHERE.
			$products_where_clause .= $attribute_order_items_subquery;
		}

		if ( 0 < count( $where_subquery ) ) {
			$operator               = $this->get_match_operator( $query_args );
			$products_where_clause .= 'AND (' . implode( " {$operator} ", $where_subquery ) . ')';
		}

		$this->add_time_period_sql_params( $query_args, $order_product_lookup_table );
		$this->total_query->add_sql_clause( 'where', $products_where_clause );
		$this->total_query->add_sql_clause( 'join', $products_from_clause );

		$this->add_intervals_sql_params( $query_args, $order_product_lookup_table );
		$this->interval_query->add_sql_clause( 'where', $products_where_clause );
		$this->interval_query->add_sql_clause( 'join', $products_from_clause );
		$this->interval_query->add_sql_clause( 'select', $this->get_sql_clause( 'select' ) . ' AS time_interval' );
	}

	/**
	 * Returns the report data based on parameters supplied by the user.
	 *
	 * @since 3.5.0
	 * @param array $query_args  Query parameters.
	 * @return stdClass|WP_Error Data.
	 */
	public function get_data( $query_args ) {
		global $wpdb;

		$table_name = self::get_db_table_name();

		// These defaults are only partially applied when used via REST API, as that has its own defaults.
		$defaults   = array(
			'per_page'           => get_option( 'posts_per_page' ),
			'page'               => 1,
			'order'              => 'DESC',
			'orderby'            => 'date',
			'before'             => TimeInterval::default_before(),
			'after'              => TimeInterval::default_after(),
			'fields'             => '*',
			'category_includes'  => array(),
			'interval'           => 'week',
			'product_includes'   => array(),
			'variation_includes' => array(),
		);
		$query_args = wp_parse_args( $query_args, $defaults );
		$this->normalize_timezones( $query_args, $defaults );

		/*
		 * We need to get the cache key here because
		 * parent::update_intervals_sql_params() modifies $query_args.
		 */
		$cache_key = $this->get_cache_key( $query_args );
		$data      = $this->get_cached_data( $cache_key );

		if ( false === $data ) {
			$this->initialize_queries();

			$selections = $this->selected_columns( $query_args );
			$params     = $this->get_limit_params( $query_args );

			$this->update_sql_query_params( $query_args );
			$this->get_limit_sql_params( $query_args );
			$this->interval_query->add_sql_clause( 'where_time', $this->get_sql_clause( 'where_time' ) );

			/* phpcs:disable WordPress.DB.PreparedSQL.NotPrepared */
			$db_intervals = $wpdb->get_col(
				$this->interval_query->get_query_statement()
			);
			/* phpcs:enable */

			$db_interval_count       = count( $db_intervals );
			$expected_interval_count = TimeInterval::intervals_between( $query_args['after'], $query_args['before'], $query_args['interval'] );
			$total_pages             = (int) ceil( $expected_interval_count / $params['per_page'] );
			if ( $query_args['page'] < 1 || $query_args['page'] > $total_pages ) {
				return array();
			}

			$intervals = array();
			$this->update_intervals_sql_params( $query_args, $db_interval_count, $expected_interval_count, $table_name );
			$this->total_query->add_sql_clause( 'select', $selections );
			$this->total_query->add_sql_clause( 'where_time', $this->get_sql_clause( 'where_time' ) );

			/* phpcs:disable WordPress.DB.PreparedSQL.NotPrepared */
			$totals = $wpdb->get_results(
				$this->total_query->get_query_statement(),
				ARRAY_A
			);
			/* phpcs:enable */

			// @todo remove these assignements when refactoring segmenter classes to use query objects.
			$totals_query          = array(
				'from_clause'       => $this->total_query->get_sql_clause( 'join' ),
				'where_time_clause' => $this->total_query->get_sql_clause( 'where_time' ),
				'where_clause'      => $this->total_query->get_sql_clause( 'where' ),
			);
			$intervals_query       = array(
				'select_clause'     => $this->get_sql_clause( 'select' ),
				'from_clause'       => $this->interval_query->get_sql_clause( 'join' ),
				'where_time_clause' => $this->interval_query->get_sql_clause( 'where_time' ),
				'where_clause'      => $this->interval_query->get_sql_clause( 'where' ),
				'order_by'          => $this->get_sql_clause( 'order_by' ),
				'limit'             => $this->get_sql_clause( 'limit' ),
			);
			$segmenter             = new Segmenter( $query_args, $this->report_columns );
			$totals[0]['segments'] = $segmenter->get_totals_segments( $totals_query, $table_name );

			if ( null === $totals ) {
				return new \WP_Error( 'woocommerce_analytics_variations_stats_result_failed', __( 'Sorry, fetching revenue data failed.', 'woocommerce' ) );
			}

			$this->interval_query->add_sql_clause( 'order_by', $this->get_sql_clause( 'order_by' ) );
			$this->interval_query->add_sql_clause( 'limit', $this->get_sql_clause( 'limit' ) );
			$this->interval_query->add_sql_clause( 'select', ", MAX(${table_name}.date_created) AS datetime_anchor" );
			if ( '' !== $selections ) {
				$this->interval_query->add_sql_clause( 'select', ', ' . $selections );
			}

			/* phpcs:disable WordPress.DB.PreparedSQL.NotPrepared */
			$intervals = $wpdb->get_results(
				$this->interval_query->get_query_statement(),
				ARRAY_A
			);
			/* phpcs:enable */

			if ( null === $intervals ) {
				return new \WP_Error( 'woocommerce_analytics_variations_stats_result_failed', __( 'Sorry, fetching revenue data failed.', 'woocommerce' ) );
			}

			$totals = (object) $this->cast_numbers( $totals[0] );

			$data = (object) array(
				'totals'    => $totals,
				'intervals' => $intervals,
				'total'     => $expected_interval_count,
				'pages'     => $total_pages,
				'page_no'   => (int) $query_args['page'],
			);

			if ( TimeInterval::intervals_missing( $expected_interval_count, $db_interval_count, $params['per_page'], $query_args['page'], $query_args['order'], $query_args['orderby'], count( $intervals ) ) ) {
				$this->fill_in_missing_intervals( $db_intervals, $query_args['adj_after'], $query_args['adj_before'], $query_args['interval'], $data );
				$this->sort_intervals( $data, $query_args['orderby'], $query_args['order'] );
				$this->remove_extra_records( $data, $query_args['page'], $params['per_page'], $db_interval_count, $expected_interval_count, $query_args['orderby'], $query_args['order'] );
			} else {
				$this->update_interval_boundary_dates( $query_args['after'], $query_args['before'], $query_args['interval'], $data->intervals );
			}
			$segmenter->add_intervals_segments( $data, $intervals_query, $table_name );
			$this->create_interval_subtotals( $data->intervals );

			$this->set_cached_data( $cache_key, $data );
		}

		return $data;
	}

	/**
	 * Normalizes order_by clause to match to SQL query.
	 *
	 * @param string $order_by Order by option requeste by user.
	 * @return string
	 */
	protected function normalize_order_by( $order_by ) {
		if ( 'date' === $order_by ) {
			return 'time_interval';
		}

		return $order_by;
	}

	/**
	 * Initialize query objects.
	 */
	protected function initialize_queries() {
		$this->clear_all_clauses();
		unset( $this->subquery );
		$this->total_query = new SqlQuery( $this->context . '_total' );
		$this->total_query->add_sql_clause( 'from', self::get_db_table_name() );

		$this->interval_query = new SqlQuery( $this->context . '_interval' );
		$this->interval_query->add_sql_clause( 'from', self::get_db_table_name() );
		$this->interval_query->add_sql_clause( 'group_by', 'time_interval' );
	}
}
woocommerce-admin/src/API/Reports/Variations/Stats/Controller.php000064400000036565151335517650021112 0ustar00<?php
/**
 * REST API Reports variations stats controller
 *
 * Handles requests to the /reports/variations/stats endpoint.
 */

namespace Automattic\WooCommerce\Admin\API\Reports\Variations\Stats;

defined( 'ABSPATH' ) || exit;

use \Automattic\WooCommerce\Admin\API\Reports\ParameterException;

/**
 * REST API Reports variations stats controller class.
 *
 * @extends WC_REST_Reports_Controller
 */
class Controller extends \WC_REST_Reports_Controller {

	/**
	 * Endpoint namespace.
	 *
	 * @var string
	 */
	protected $namespace = 'wc-analytics';

	/**
	 * Route base.
	 *
	 * @var string
	 */
	protected $rest_base = 'reports/variations/stats';

	/**
	 * Mapping between external parameter name and name used in query class.
	 *
	 * @var array
	 */
	protected $param_mapping = array(
		'variations' => 'variation_includes',
	);

	/**
	 * Constructor.
	 */
	public function __construct() {
		add_filter( 'woocommerce_analytics_variations_stats_select_query', array( $this, 'set_default_report_data' ) );
	}

	/**
	 * Get all reports.
	 *
	 * @param WP_REST_Request $request Request data.
	 * @return array|WP_Error
	 */
	public function get_items( $request ) {
		$query_args = array(
			'fields' => array(
				'items_sold',
				'net_revenue',
				'orders_count',
				'variations_count',
			),
		);

		$registered = array_keys( $this->get_collection_params() );
		foreach ( $registered as $param_name ) {
			if ( isset( $request[ $param_name ] ) ) {
				if ( isset( $this->param_mapping[ $param_name ] ) ) {
					$query_args[ $this->param_mapping[ $param_name ] ] = $request[ $param_name ];
				} else {
					$query_args[ $param_name ] = $request[ $param_name ];
				}
			}
		}

		$query = new Query( $query_args );
		try {
			$report_data = $query->get_data();
		} catch ( ParameterException $e ) {
			return new \WP_Error( $e->getErrorCode(), $e->getMessage(), array( 'status' => $e->getCode() ) );
		}

		$out_data = array(
			'totals'    => get_object_vars( $report_data->totals ),
			'intervals' => array(),
		);

		foreach ( $report_data->intervals as $interval_data ) {
			$item                    = $this->prepare_item_for_response( $interval_data, $request );
			$out_data['intervals'][] = $this->prepare_response_for_collection( $item );
		}

		$response = rest_ensure_response( $out_data );
		$response->header( 'X-WP-Total', (int) $report_data->total );
		$response->header( 'X-WP-TotalPages', (int) $report_data->pages );

		$page      = $report_data->page_no;
		$max_pages = $report_data->pages;
		$base      = add_query_arg( $request->get_query_params(), rest_url( sprintf( '/%s/%s', $this->namespace, $this->rest_base ) ) );
		if ( $page > 1 ) {
			$prev_page = $page - 1;
			if ( $prev_page > $max_pages ) {
				$prev_page = $max_pages;
			}
			$prev_link = add_query_arg( 'page', $prev_page, $base );
			$response->link_header( 'prev', $prev_link );
		}
		if ( $max_pages > $page ) {
			$next_page = $page + 1;
			$next_link = add_query_arg( 'page', $next_page, $base );
			$response->link_header( 'next', $next_link );
		}

		return $response;
	}

	/**
	 * Prepare a report object for serialization.
	 *
	 * @param Array           $report  Report data.
	 * @param WP_REST_Request $request Request object.
	 * @return WP_REST_Response
	 */
	public function prepare_item_for_response( $report, $request ) {
		$data = $report;

		$context = ! empty( $request['context'] ) ? $request['context'] : 'view';
		$data    = $this->add_additional_fields_to_object( $data, $request );
		$data    = $this->filter_response_by_context( $data, $context );

		// Wrap the data in a response object.
		$response = rest_ensure_response( $data );

		/**
		 * Filter a report returned from the API.
		 *
		 * Allows modification of the report data right before it is returned.
		 *
		 * @param WP_REST_Response $response The response object.
		 * @param object           $report   The original report object.
		 * @param WP_REST_Request  $request  Request used to generate the response.
		 */
		return apply_filters( 'woocommerce_rest_prepare_report_variations_stats', $response, $report, $request );
	}

	/**
	 * Get the Report's schema, conforming to JSON Schema.
	 *
	 * @return array
	 */
	public function get_item_schema() {
		$data_values = array(
			'items_sold'   => array(
				'title'       => __( 'Variations Sold', 'woocommerce' ),
				'description' => __( 'Number of variation items sold.', 'woocommerce' ),
				'type'        => 'integer',
				'context'     => array( 'view', 'edit' ),
				'readonly'    => true,
				'indicator'   => true,
			),
			'net_revenue'  => array(
				'description' => __( 'Net sales.', 'woocommerce' ),
				'type'        => 'number',
				'context'     => array( 'view', 'edit' ),
				'readonly'    => true,
				'format'      => 'currency',
			),
			'orders_count' => array(
				'description' => __( 'Number of orders.', 'woocommerce' ),
				'type'        => 'integer',
				'context'     => array( 'view', 'edit' ),
				'readonly'    => true,
			),
		);

		$segments = array(
			'segments' => array(
				'description' => __( 'Reports data grouped by segment condition.', 'woocommerce' ),
				'type'        => 'array',
				'context'     => array( 'view', 'edit' ),
				'readonly'    => true,
				'items'       => array(
					'type'       => 'object',
					'properties' => array(
						'segment_id'    => array(
							'description' => __( 'Segment identificator.', 'woocommerce' ),
							'type'        => 'integer',
							'context'     => array( 'view', 'edit' ),
							'readonly'    => true,
						),
						'segment_label' => array(
							'description' => __( 'Human readable segment label, either product or variation name.', 'woocommerce' ),
							'type'        => 'string',
							'context'     => array( 'view', 'edit' ),
							'readonly'    => true,
							'enum'        => array( 'day', 'week', 'month', 'year' ),
						),
						'subtotals'     => array(
							'description' => __( 'Interval subtotals.', 'woocommerce' ),
							'type'        => 'object',
							'context'     => array( 'view', 'edit' ),
							'readonly'    => true,
							'properties'  => $data_values,
						),
					),
				),
			),
		);

		$totals = array_merge( $data_values, $segments );

		$schema = array(
			'$schema'    => 'http://json-schema.org/draft-04/schema#',
			'title'      => 'report_variations_stats',
			'type'       => 'object',
			'properties' => array(
				'totals'    => array(
					'description' => __( 'Totals data.', 'woocommerce' ),
					'type'        => 'object',
					'context'     => array( 'view', 'edit' ),
					'readonly'    => true,
					'properties'  => $totals,
				),
				'intervals' => array(
					'description' => __( 'Reports data grouped by intervals.', 'woocommerce' ),
					'type'        => 'array',
					'context'     => array( 'view', 'edit' ),
					'readonly'    => true,
					'items'       => array(
						'type'       => 'object',
						'properties' => array(
							'interval'       => array(
								'description' => __( 'Type of interval.', 'woocommerce' ),
								'type'        => 'string',
								'context'     => array( 'view', 'edit' ),
								'readonly'    => true,
								'enum'        => array( 'day', 'week', 'month', 'year' ),
							),
							'date_start'     => array(
								'description' => __( "The date the report start, in the site's timezone.", 'woocommerce' ),
								'type'        => 'date-time',
								'context'     => array( 'view', 'edit' ),
								'readonly'    => true,
							),
							'date_start_gmt' => array(
								'description' => __( 'The date the report start, as GMT.', 'woocommerce' ),
								'type'        => 'date-time',
								'context'     => array( 'view', 'edit' ),
								'readonly'    => true,
							),
							'date_end'       => array(
								'description' => __( "The date the report end, in the site's timezone.", 'woocommerce' ),
								'type'        => 'date-time',
								'context'     => array( 'view', 'edit' ),
								'readonly'    => true,
							),
							'date_end_gmt'   => array(
								'description' => __( 'The date the report end, as GMT.', 'woocommerce' ),
								'type'        => 'date-time',
								'context'     => array( 'view', 'edit' ),
								'readonly'    => true,
							),
							'subtotals'      => array(
								'description' => __( 'Interval subtotals.', 'woocommerce' ),
								'type'        => 'object',
								'context'     => array( 'view', 'edit' ),
								'readonly'    => true,
								'properties'  => $totals,
							),
						),
					),
				),
			),
		);

		return $this->add_additional_fields_schema( $schema );
	}

	/**
	 * Set the default results to 0 if API returns an empty array
	 *
	 * @param Mixed $results Report data.
	 * @return object
	 */
	public function set_default_report_data( $results ) {
		if ( empty( $results ) ) {
			$results                       = new \stdClass();
			$results->total                = 0;
			$results->totals               = new \stdClass();
			$results->totals->items_sold   = 0;
			$results->totals->net_revenue  = 0;
			$results->totals->orders_count = 0;
			$results->intervals            = array();
			$results->pages                = 1;
			$results->page_no              = 1;
		}
		return $results;
	}

	/**
	 * Get the query params for collections.
	 *
	 * @return array
	 */
	public function get_collection_params() {
		$params                      = array();
		$params['context']           = $this->get_context_param( array( 'default' => 'view' ) );
		$params['page']              = array(
			'description'       => __( 'Current page of the collection.', 'woocommerce' ),
			'type'              => 'integer',
			'default'           => 1,
			'sanitize_callback' => 'absint',
			'validate_callback' => 'rest_validate_request_arg',
			'minimum'           => 1,
		);
		$params['per_page']          = array(
			'description'       => __( 'Maximum number of items to be returned in result set.', 'woocommerce' ),
			'type'              => 'integer',
			'default'           => 10,
			'minimum'           => 1,
			'maximum'           => 100,
			'sanitize_callback' => 'absint',
			'validate_callback' => 'rest_validate_request_arg',
		);
		$params['after']             = array(
			'description'       => __( 'Limit response to resources published after a given ISO8601 compliant date.', 'woocommerce' ),
			'type'              => 'string',
			'format'            => 'date-time',
			'validate_callback' => 'rest_validate_request_arg',
		);
		$params['before']            = array(
			'description'       => __( 'Limit response to resources published before a given ISO8601 compliant date.', 'woocommerce' ),
			'type'              => 'string',
			'format'            => 'date-time',
			'validate_callback' => 'rest_validate_request_arg',
		);
		$params['match']             = array(
			'description'       => __( 'Indicates whether all the conditions should be true for the resulting set, or if any one of them is sufficient. Match affects the following parameters: status_is, status_is_not, product_includes, product_excludes, coupon_includes, coupon_excludes, customer, categories', 'woocommerce' ),
			'type'              => 'string',
			'default'           => 'all',
			'enum'              => array(
				'all',
				'any',
			),
			'validate_callback' => 'rest_validate_request_arg',
		);
		$params['order']             = array(
			'description'       => __( 'Order sort attribute ascending or descending.', 'woocommerce' ),
			'type'              => 'string',
			'default'           => 'desc',
			'enum'              => array( 'asc', 'desc' ),
			'validate_callback' => 'rest_validate_request_arg',
		);
		$params['orderby']           = array(
			'description'       => __( 'Sort collection by object attribute.', 'woocommerce' ),
			'type'              => 'string',
			'default'           => 'date',
			'enum'              => array(
				'date',
				'net_revenue',
				'coupons',
				'refunds',
				'shipping',
				'taxes',
				'net_revenue',
				'orders_count',
				'items_sold',
			),
			'validate_callback' => 'rest_validate_request_arg',
		);
		$params['interval']          = array(
			'description'       => __( 'Time interval to use for buckets in the returned data.', 'woocommerce' ),
			'type'              => 'string',
			'default'           => 'week',
			'enum'              => array(
				'hour',
				'day',
				'week',
				'month',
				'quarter',
				'year',
			),
			'validate_callback' => 'rest_validate_request_arg',
		);
		$params['category_includes'] = array(
			'description'       => __( 'Limit result to items from the specified categories.', 'woocommerce' ),
			'type'              => 'array',
			'sanitize_callback' => 'wp_parse_id_list',
			'validate_callback' => 'rest_validate_request_arg',
			'items'             => array(
				'type' => 'integer',
			),
		);
		$params['category_excludes'] = array(
			'description'       => __( 'Limit result set to variations not in the specified categories.', 'woocommerce' ),
			'type'              => 'array',
			'sanitize_callback' => 'wp_parse_id_list',
			'validate_callback' => 'rest_validate_request_arg',
			'items'             => array(
				'type' => 'integer',
			),
		);
		$params['product_includes']  = array(
			'description'       => __( 'Limit result set to items that have the specified parent product(s).', 'woocommerce' ),
			'type'              => 'array',
			'items'             => array(
				'type' => 'integer',
			),
			'default'           => array(),
			'sanitize_callback' => 'wp_parse_id_list',
			'validate_callback' => 'rest_validate_request_arg',
		);
		$params['product_excludes']  = array(
			'description'       => __( 'Limit result set to items that don\'t have the specified parent product(s).', 'woocommerce' ),
			'type'              => 'array',
			'items'             => array(
				'type' => 'integer',
			),
			'default'           => array(),
			'validate_callback' => 'rest_validate_request_arg',
			'sanitize_callback' => 'wp_parse_id_list',
		);
		$params['variations']        = array(
			'description'       => __( 'Limit result to items with specified variation ids.', 'woocommerce' ),
			'type'              => 'array',
			'sanitize_callback' => 'wp_parse_id_list',
			'validate_callback' => 'rest_validate_request_arg',
			'items'             => array(
				'type' => 'integer',
			),
		);
		$params['segmentby']         = array(
			'description'       => __( 'Segment the response by additional constraint.', 'woocommerce' ),
			'type'              => 'string',
			'enum'              => array(
				'product',
				'category',
				'variation',
			),
			'validate_callback' => 'rest_validate_request_arg',
		);
		$params['fields']            = array(
			'description'       => __( 'Limit stats fields to the specified items.', 'woocommerce' ),
			'type'              => 'array',
			'sanitize_callback' => 'wp_parse_slug_list',
			'validate_callback' => 'rest_validate_request_arg',
			'items'             => array(
				'type' => 'string',
			),
		);
		$params['attribute_is']      = array(
			'description'       => __( 'Limit result set to orders that include products with the specified attributes.', 'woocommerce' ),
			'type'              => 'array',
			'items'             => array(
				'type' => 'array',
			),
			'default'           => array(),
			'validate_callback' => 'rest_validate_request_arg',
		);
		$params['attribute_is_not']  = array(
			'description'       => __( 'Limit result set to orders that don\'t include products with the specified attributes.', 'woocommerce' ),
			'type'              => 'array',
			'items'             => array(
				'type' => 'array',
			),
			'default'           => array(),
			'validate_callback' => 'rest_validate_request_arg',
		);

		return $params;
	}
}
woocommerce-admin/src/API/Reports/Variations/Stats/Segmenter.php000064400000017470151335517650020712 0ustar00<?php
/**
 * Class for adding segmenting support without cluttering the data stores.
 */

namespace Automattic\WooCommerce\Admin\API\Reports\Variations\Stats;

defined( 'ABSPATH' ) || exit;

use \Automattic\WooCommerce\Admin\API\Reports\Segmenter as ReportsSegmenter;
use \Automattic\WooCommerce\Admin\API\Reports\ParameterException;

/**
 * Date & time interval and numeric range handling class for Reporting API.
 */
class Segmenter extends ReportsSegmenter {

	/**
	 * Returns column => query mapping to be used for product-related product-level segmenting query
	 * (e.g. products sold, revenue from product X when segmenting by category).
	 *
	 * @param string $products_table Name of SQL table containing the product-level segmenting info.
	 *
	 * @return array Column => SELECT query mapping.
	 */
	protected function get_segment_selections_product_level( $products_table ) {
		$columns_mapping = array(
			'items_sold'       => "SUM($products_table.product_qty) as items_sold",
			'net_revenue'      => "SUM($products_table.product_net_revenue ) AS net_revenue",
			'orders_count'     => "COUNT( DISTINCT $products_table.order_id ) AS orders_count",
			'variations_count' => "COUNT( DISTINCT $products_table.variation_id ) AS variations_count",
		);

		return $columns_mapping;
	}

	/**
	 * Calculate segments for totals where the segmenting property is bound to product (e.g. category, product_id, variation_id).
	 *
	 * @param array  $segmenting_selections SELECT part of segmenting SQL query--one for 'product_level' and one for 'order_level'.
	 * @param string $segmenting_from FROM part of segmenting SQL query.
	 * @param string $segmenting_where WHERE part of segmenting SQL query.
	 * @param string $segmenting_groupby GROUP BY part of segmenting SQL query.
	 * @param string $segmenting_dimension_name Name of the segmenting dimension.
	 * @param string $table_name Name of SQL table which is the stats table for orders.
	 * @param array  $totals_query Array of SQL clauses for totals query.
	 * @param string $unique_orders_table Name of temporary SQL table that holds unique orders.
	 *
	 * @return array
	 */
	protected function get_product_related_totals_segments( $segmenting_selections, $segmenting_from, $segmenting_where, $segmenting_groupby, $segmenting_dimension_name, $table_name, $totals_query, $unique_orders_table ) {
		global $wpdb;

		$product_segmenting_table = $wpdb->prefix . 'wc_order_product_lookup';

		// Can't get all the numbers from one query, so split it into one query for product-level numbers and one for order-level numbers (which first need to have orders uniqued).
		// Product-level numbers.
		$segments_products = $wpdb->get_results(
			"SELECT
						$segmenting_groupby AS $segmenting_dimension_name
						{$segmenting_selections['product_level']}
					FROM
						$table_name
						$segmenting_from
						{$totals_query['from_clause']}
					WHERE
						1=1
						{$totals_query['where_time_clause']}
						{$totals_query['where_clause']}
						$segmenting_where
					GROUP BY
						$segmenting_groupby",
			ARRAY_A
		); // WPCS: cache ok, DB call ok, unprepared SQL ok.

		$totals_segments = $this->merge_segment_totals_results( $segmenting_dimension_name, $segments_products, array() );
		return $totals_segments;
	}

	/**
	 * Calculate segments for intervals where the segmenting property is bound to product (e.g. category, product_id, variation_id).
	 *
	 * @param array  $segmenting_selections SELECT part of segmenting SQL query--one for 'product_level' and one for 'order_level'.
	 * @param string $segmenting_from FROM part of segmenting SQL query.
	 * @param string $segmenting_where WHERE part of segmenting SQL query.
	 * @param string $segmenting_groupby GROUP BY part of segmenting SQL query.
	 * @param string $segmenting_dimension_name Name of the segmenting dimension.
	 * @param string $table_name Name of SQL table which is the stats table for orders.
	 * @param array  $intervals_query Array of SQL clauses for intervals query.
	 * @param string $unique_orders_table Name of temporary SQL table that holds unique orders.
	 *
	 * @return array
	 */
	protected function get_product_related_intervals_segments( $segmenting_selections, $segmenting_from, $segmenting_where, $segmenting_groupby, $segmenting_dimension_name, $table_name, $intervals_query, $unique_orders_table ) {
		global $wpdb;

		$product_segmenting_table = $wpdb->prefix . 'wc_order_product_lookup';

		// LIMIT offset, rowcount needs to be updated to a multiple of the number of segments.
		preg_match( '/LIMIT (\d+)\s?,\s?(\d+)/', $intervals_query['limit'], $limit_parts );
		$segment_count    = count( $this->get_all_segments() );
		$orig_offset      = intval( $limit_parts[1] );
		$orig_rowcount    = intval( $limit_parts[2] );
		$segmenting_limit = $wpdb->prepare( 'LIMIT %d, %d', $orig_offset * $segment_count, $orig_rowcount * $segment_count );

		// Can't get all the numbers from one query, so split it into one query for product-level numbers and one for order-level numbers (which first need to have orders uniqued).
		// Product-level numbers.
		$segments_products = $wpdb->get_results(
			"SELECT
						{$intervals_query['select_clause']} AS time_interval,
						$segmenting_groupby AS $segmenting_dimension_name
						{$segmenting_selections['product_level']}
					FROM
						$table_name
						$segmenting_from
						{$intervals_query['from_clause']}
					WHERE
						1=1
						{$intervals_query['where_time_clause']}
						{$intervals_query['where_clause']}
						$segmenting_where
					GROUP BY
						time_interval, $segmenting_groupby
					$segmenting_limit",
			ARRAY_A
		); // WPCS: cache ok, DB call ok, unprepared SQL ok.

		$intervals_segments = $this->merge_segment_intervals_results( $segmenting_dimension_name, $segments_products, array() );
		return $intervals_segments;
	}

	/**
	 * Return array of segments formatted for REST response.
	 *
	 * @param string $type Type of segments to return--'totals' or 'intervals'.
	 * @param array  $query_params SQL query parameter array.
	 * @param string $table_name Name of main SQL table for the data store (used as basis for JOINS).
	 *
	 * @return array
	 * @throws \Automattic\WooCommerce\Admin\API\Reports\ParameterException In case of segmenting by variations, when no parent product is specified.
	 */
	protected function get_segments( $type, $query_params, $table_name ) {
		global $wpdb;
		if ( ! isset( $this->query_args['segmentby'] ) || '' === $this->query_args['segmentby'] ) {
			return array();
		}

		$product_segmenting_table = $wpdb->prefix . 'wc_order_product_lookup';
		$unique_orders_table      = 'uniq_orders';
		$segmenting_where         = '';

		// Product, variation, and category are bound to product, so here product segmenting table is required,
		// while coupon and customer are bound to order, so we don't need the extra JOIN for those.
		// This also means that segment selections need to be calculated differently.
		if ( 'variation' === $this->query_args['segmentby'] ) {
			$product_level_columns     = $this->get_segment_selections_product_level( $product_segmenting_table );
			$segmenting_selections     = array(
				'product_level' => $this->prepare_selections( $product_level_columns ),
			);
			$this->report_columns      = $product_level_columns;
			$segmenting_from           = '';
			$segmenting_groupby        = $product_segmenting_table . '.variation_id';
			$segmenting_dimension_name = 'variation_id';

			// Restrict our search space for variation comparisons.
			if ( isset( $this->query_args['variation_includes'] ) ) {
				$variation_ids    = implode( ',', $this->get_all_segments() );
				$segmenting_where = " AND $product_segmenting_table.variation_id IN ( $variation_ids )";
			}

			$segments = $this->get_product_related_segments( $type, $segmenting_selections, $segmenting_from, $segmenting_where, $segmenting_groupby, $segmenting_dimension_name, $table_name, $query_params, $unique_orders_table );
		}

		return $segments;
	}
}
woocommerce-admin/src/API/Reports/Variations/Stats/Query.php000064400000002447151335517650020064 0ustar00<?php
/**
 * Class for parameter-based Variations Stats Report querying
 *
 * Example usage:
 * $args = array(
 *          'before'       => '2018-07-19 00:00:00',
 *          'after'        => '2018-07-05 00:00:00',
 *          'page'         => 2,
 *          'categories'   => array(15, 18),
 *          'product_ids'  => array(1,2,3)
 *         );
 * $report = new \Automattic\WooCommerce\Admin\API\Reports\Variations\Stats\Query( $args );
 * $mydata = $report->get_data();
 */

namespace Automattic\WooCommerce\Admin\API\Reports\Variations\Stats;

defined( 'ABSPATH' ) || exit;

use \Automattic\WooCommerce\Admin\API\Reports\Query as ReportsQuery;

/**
 * API\Reports\Variations\Stats\Query
 */
class Query extends ReportsQuery {

	/**
	 * Valid fields for Products report.
	 *
	 * @return array
	 */
	protected function get_default_query_vars() {
		return array();
	}

	/**
	 * Get variations data based on the current query vars.
	 *
	 * @return array
	 */
	public function get_data() {
		$args = apply_filters( 'woocommerce_analytics_variations_stats_query_args', $this->get_query_vars() );

		$data_store = \WC_Data_Store::load( 'report-variations-stats' );
		$results    = $data_store->get_data( $args );
		return apply_filters( 'woocommerce_analytics_variations_stats_select_query', $results, $args );
	}

}
woocommerce-admin/src/API/Reports/TimeInterval.php000064400000051475151335517650016152 0ustar00<?php
/**
 * Class for time interval and numeric range handling for reports.
 */

namespace Automattic\WooCommerce\Admin\API\Reports;

defined( 'ABSPATH' ) || exit;

/**
 * Date & time interval and numeric range handling class for Reporting API.
 */
class TimeInterval {

	/**
	 * Format string for ISO DateTime formatter.
	 *
	 * @var string
	 */
	public static $iso_datetime_format = 'Y-m-d\TH:i:s';

	/**
	 * Format string for use in SQL queries.
	 *
	 * @var string
	 */
	public static $sql_datetime_format = 'Y-m-d H:i:s';

	/**
	 * Converts local datetime to GMT/UTC time.
	 *
	 * @param string $datetime_string String representation of local datetime.
	 * @return DateTime
	 */
	public static function convert_local_datetime_to_gmt( $datetime_string ) {
		$datetime = new \DateTime( $datetime_string, new \DateTimeZone( wc_timezone_string() ) );
		$datetime->setTimezone( new \DateTimeZone( 'GMT' ) );
		return $datetime;
	}

	/**
	 * Returns default 'before' parameter for the reports.
	 *
	 * @return DateTime
	 */
	public static function default_before() {
		$datetime = new \WC_DateTime();
		// Set local timezone or offset.
		if ( get_option( 'timezone_string' ) ) {
			$datetime->setTimezone( new \DateTimeZone( wc_timezone_string() ) );
		} else {
			$datetime->set_utc_offset( wc_timezone_offset() );
		}
		return $datetime;
	}

	/**
	 * Returns default 'after' parameter for the reports.
	 *
	 * @return DateTime
	 */
	public static function default_after() {
		$now       = time();
		$week_back = $now - WEEK_IN_SECONDS;

		$datetime = new \WC_DateTime();
		$datetime->setTimestamp( $week_back );
		// Set local timezone or offset.
		if ( get_option( 'timezone_string' ) ) {
			$datetime->setTimezone( new \DateTimeZone( wc_timezone_string() ) );
		} else {
			$datetime->set_utc_offset( wc_timezone_offset() );
		}
		return $datetime;
	}

	/**
	 * Returns date format to be used as grouping clause in SQL.
	 *
	 * @param string $time_interval Time interval.
	 * @param string $table_name Name of the db table relevant for the date constraint.
	 * @return mixed
	 */
	public static function db_datetime_format( $time_interval, $table_name ) {
		$first_day_of_week = absint( get_option( 'start_of_week' ) );

		if ( 1 === $first_day_of_week ) {
			// Week begins on Monday, ISO 8601.
			$week_format = "DATE_FORMAT({$table_name}.date_created, '%x-%v')";
		} else {
			// Week begins on day other than specified by ISO 8601, needs to be in sync with function simple_week_number.
			$week_format = "CONCAT(YEAR({$table_name}.date_created), '-', LPAD( FLOOR( ( DAYOFYEAR({$table_name}.date_created) + ( ( DATE_FORMAT(MAKEDATE(YEAR({$table_name}.date_created),1), '%w') - $first_day_of_week + 7 ) % 7 ) - 1 ) / 7  ) + 1 , 2, '0'))";

		}

		// Whenever this is changed, double check method time_interval_id to make sure they are in sync.
		$mysql_date_format_mapping = array(
			'hour'    => "DATE_FORMAT({$table_name}.date_created, '%Y-%m-%d %H')",
			'day'     => "DATE_FORMAT({$table_name}.date_created, '%Y-%m-%d')",
			'week'    => $week_format,
			'month'   => "DATE_FORMAT({$table_name}.date_created, '%Y-%m')",
			'quarter' => "CONCAT(YEAR({$table_name}.date_created), '-', QUARTER({$table_name}.date_created))",
			'year'    => "YEAR({$table_name}.date_created)",

		);

		return $mysql_date_format_mapping[ $time_interval ];
	}

	/**
	 * Returns quarter for the DateTime.
	 *
	 * @param DateTime $datetime Local date & time.
	 * @return int|null
	 */
	public static function quarter( $datetime ) {
		switch ( (int) $datetime->format( 'm' ) ) {
			case 1:
			case 2:
			case 3:
				return 1;
			case 4:
			case 5:
			case 6:
				return 2;
			case 7:
			case 8:
			case 9:
				return 3;
			case 10:
			case 11:
			case 12:
				return 4;

		}
		return null;
	}

	/**
	 * Returns simple week number for the DateTime, for week starting on $first_day_of_week.
	 *
	 * The first week of the year is considered to be the week containing January 1.
	 * The second week starts on the next $first_day_of_week.
	 *
	 * @param DateTime $datetime          Local date for which the week number is to be calculated.
	 * @param int      $first_day_of_week 0 for Sunday to 6 for Saturday.
	 * @return int
	 */
	public static function simple_week_number( $datetime, $first_day_of_week ) {
		$beg_of_year_day          = new \DateTime( "{$datetime->format('Y')}-01-01" );
		$adj_day_beg_of_year      = ( (int) $beg_of_year_day->format( 'w' ) - $first_day_of_week + 7 ) % 7;
		$days_since_start_of_year = (int) $datetime->format( 'z' ) + 1;

		return (int) floor( ( ( $days_since_start_of_year + $adj_day_beg_of_year - 1 ) / 7 ) ) + 1;
	}

	/**
	 * Returns ISO 8601 week number for the DateTime, if week starts on Monday,
	 * otherwise returns simple week number.
	 *
	 * @see TimeInterval::simple_week_number()
	 *
	 * @param DateTime $datetime          Local date for which the week number is to be calculated.
	 * @param int      $first_day_of_week 0 for Sunday to 6 for Saturday.
	 * @return int
	 */
	public static function week_number( $datetime, $first_day_of_week ) {
		if ( 1 === $first_day_of_week ) {
			$week_number = (int) $datetime->format( 'W' );
		} else {
			$week_number = self::simple_week_number( $datetime, $first_day_of_week );
		}
		return $week_number;
	}

	/**
	 * Returns time interval id for the DateTime.
	 *
	 * @param string   $time_interval Time interval type (week, day, etc).
	 * @param DateTime $datetime      Date & time.
	 * @return string
	 */
	public static function time_interval_id( $time_interval, $datetime ) {
		// Whenever this is changed, double check method db_datetime_format to make sure they are in sync.
		$php_time_format_for = array(
			'hour'    => 'Y-m-d H',
			'day'     => 'Y-m-d',
			'week'    => 'o-W',
			'month'   => 'Y-m',
			'quarter' => 'Y-' . self::quarter( $datetime ),
			'year'    => 'Y',
		);

		// If the week does not begin on Monday.
		$first_day_of_week = absint( get_option( 'start_of_week' ) );

		if ( 'week' === $time_interval && 1 !== $first_day_of_week ) {
			$week_no = self::simple_week_number( $datetime, $first_day_of_week );
			$week_no = str_pad( $week_no, 2, '0', STR_PAD_LEFT );
			$year_no = $datetime->format( 'Y' );
			return "$year_no-$week_no";
		}

		return $datetime->format( $php_time_format_for[ $time_interval ] );
	}

	/**
	 * Calculates number of time intervals between two dates, closed interval on both sides.
	 *
	 * @param DateTime $start_datetime Start date & time.
	 * @param DateTime $end_datetime End date & time.
	 * @param string   $interval Time interval increment, e.g. hour, day, week.
	 *
	 * @return int
	 */
	public static function intervals_between( $start_datetime, $end_datetime, $interval ) {
		switch ( $interval ) {
			case 'hour':
				$end_timestamp   = (int) $end_datetime->format( 'U' );
				$start_timestamp = (int) $start_datetime->format( 'U' );
				$addendum        = 0;
				// modulo HOUR_IN_SECONDS would normally work, but there are non-full hour timezones, e.g. Nepal.
				$start_min_sec = (int) $start_datetime->format( 'i' ) * MINUTE_IN_SECONDS + (int) $start_datetime->format( 's' );
				$end_min_sec   = (int) $end_datetime->format( 'i' ) * MINUTE_IN_SECONDS + (int) $end_datetime->format( 's' );
				if ( $end_min_sec < $start_min_sec ) {
					$addendum = 1;
				}
				$diff_timestamp = $end_timestamp - $start_timestamp;

				return (int) floor( ( (int) $diff_timestamp ) / HOUR_IN_SECONDS ) + 1 + $addendum;
			case 'day':
				$end_timestamp      = (int) $end_datetime->format( 'U' );
				$start_timestamp    = (int) $start_datetime->format( 'U' );
				$addendum           = 0;
				$end_hour_min_sec   = (int) $end_datetime->format( 'H' ) * HOUR_IN_SECONDS + (int) $end_datetime->format( 'i' ) * MINUTE_IN_SECONDS + (int) $end_datetime->format( 's' );
				$start_hour_min_sec = (int) $start_datetime->format( 'H' ) * HOUR_IN_SECONDS + (int) $start_datetime->format( 'i' ) * MINUTE_IN_SECONDS + (int) $start_datetime->format( 's' );
				if ( $end_hour_min_sec < $start_hour_min_sec ) {
					$addendum = 1;
				}
				$diff_timestamp = $end_timestamp - $start_timestamp;

				return (int) floor( ( (int) $diff_timestamp ) / DAY_IN_SECONDS ) + 1 + $addendum;
			case 'week':
				// @todo Optimize? approximately day count / 7, but year end is tricky, a week can have fewer days.
				$week_count = 0;
				do {
					$start_datetime = self::next_week_start( $start_datetime );
					$week_count++;
				} while ( $start_datetime <= $end_datetime );
				return $week_count;
			case 'month':
				// Year diff in months: (end_year - start_year - 1) * 12.
				$year_diff_in_months = ( (int) $end_datetime->format( 'Y' ) - (int) $start_datetime->format( 'Y' ) - 1 ) * 12;
				// All the months in end_date year plus months from X to 12 in the start_date year.
				$month_diff = (int) $end_datetime->format( 'n' ) + ( 12 - (int) $start_datetime->format( 'n' ) );
				// Add months for number of years between end_date and start_date.
				$month_diff += $year_diff_in_months + 1;
				return $month_diff;
			case 'quarter':
				// Year diff in quarters: (end_year - start_year - 1) * 4.
				$year_diff_in_quarters = ( (int) $end_datetime->format( 'Y' ) - (int) $start_datetime->format( 'Y' ) - 1 ) * 4;
				// All the quarters in end_date year plus quarters from X to 4 in the start_date year.
				$quarter_diff = self::quarter( $end_datetime ) + ( 4 - self::quarter( $start_datetime ) );
				// Add quarters for number of years between end_date and start_date.
				$quarter_diff += $year_diff_in_quarters + 1;
				return $quarter_diff;
			case 'year':
				$year_diff = (int) $end_datetime->format( 'Y' ) - (int) $start_datetime->format( 'Y' );
				return $year_diff + 1;
		}
		return 0;
	}

	/**
	 * Returns a new DateTime object representing the next hour start/previous hour end if reversed.
	 *
	 * @param DateTime $datetime Date and time.
	 * @param bool     $reversed Going backwards in time instead of forward.
	 * @return DateTime
	 */
	public static function next_hour_start( $datetime, $reversed = false ) {
		$hour_increment         = $reversed ? 0 : 1;
		$timestamp              = (int) $datetime->format( 'U' );
		$seconds_into_hour      = (int) $datetime->format( 'i' ) * MINUTE_IN_SECONDS + (int) $datetime->format( 's' );
		$hours_offset_timestamp = $timestamp + ( $hour_increment * HOUR_IN_SECONDS - $seconds_into_hour );

		if ( $reversed ) {
			$hours_offset_timestamp --;
		}

		$hours_offset_time = new \DateTime();
		$hours_offset_time->setTimestamp( $hours_offset_timestamp );
		$hours_offset_time->setTimezone( new \DateTimeZone( wc_timezone_string() ) );
		return $hours_offset_time;
	}

	/**
	 * Returns a new DateTime object representing the next day start, or previous day end if reversed.
	 *
	 * @param DateTime $datetime Date and time.
	 * @param bool     $reversed Going backwards in time instead of forward.
	 * @return DateTime
	 */
	public static function next_day_start( $datetime, $reversed = false ) {
		$oneday       = new \DateInterval( 'P1D' );
		$new_datetime = clone $datetime;

		if ( $reversed ) {
			$new_datetime->sub( $oneday );
			$new_datetime->setTime( 23, 59, 59 );
		} else {
			$new_datetime->add( $oneday );
			$new_datetime->setTime( 0, 0, 0 );
		}

		return $new_datetime;
	}

	/**
	 * Returns DateTime object representing the next week start, or previous week end if reversed.
	 *
	 * @param DateTime $datetime Date and time.
	 * @param bool     $reversed Going backwards in time instead of forward.
	 * @return DateTime
	 */
	public static function next_week_start( $datetime, $reversed = false ) {
		$first_day_of_week = absint( get_option( 'start_of_week' ) );
		$initial_week_no   = self::week_number( $datetime, $first_day_of_week );
		$failsafe_count    = 0;

		do {
			if ( $failsafe_count++ >= 7 ) {
				break;
			}
			$datetime        = self::next_day_start( $datetime, $reversed );
			$current_week_no = self::week_number( $datetime, $first_day_of_week );
		} while ( $current_week_no === $initial_week_no );

		// The week boundary is actually next midnight when going in reverse, so set it to day -1 at 23:59:59.
		if ( $reversed ) {
			$timestamp            = (int) $datetime->format( 'U' );
			$end_of_day_timestamp = floor( $timestamp / DAY_IN_SECONDS ) * DAY_IN_SECONDS + DAY_IN_SECONDS - 1;
			$datetime->setTimestamp( $end_of_day_timestamp );
		}

		return $datetime;
	}

	/**
	 * Returns a new DateTime object representing the next month start, or previous month end if reversed.
	 *
	 * @param DateTime $datetime Date and time.
	 * @param bool     $reversed Going backwards in time instead of forward.
	 * @return DateTime
	 */
	public static function next_month_start( $datetime, $reversed = false ) {
		$month_increment = 1;
		$year            = $datetime->format( 'Y' );
		$month           = (int) $datetime->format( 'm' );

		if ( $reversed ) {
			$beg_of_month_datetime       = new \DateTime( "$year-$month-01 00:00:00", new \DateTimeZone( wc_timezone_string() ) );
			$timestamp                   = (int) $beg_of_month_datetime->format( 'U' );
			$end_of_prev_month_timestamp = $timestamp - 1;
			$datetime->setTimestamp( $end_of_prev_month_timestamp );
		} else {
			$month += $month_increment;
			if ( $month > 12 ) {
				$month = 1;
				$year ++;
			}
			$day      = '01';
			$datetime = new \DateTime( "$year-$month-$day 00:00:00", new \DateTimeZone( wc_timezone_string() ) );
		}

		return $datetime;
	}

	/**
	 * Returns a new DateTime object representing the next quarter start, or previous quarter end if reversed.
	 *
	 * @param DateTime $datetime Date and time.
	 * @param bool     $reversed Going backwards in time instead of forward.
	 * @return DateTime
	 */
	public static function next_quarter_start( $datetime, $reversed = false ) {
		$year  = $datetime->format( 'Y' );
		$month = (int) $datetime->format( 'n' );

		switch ( $month ) {
			case 1:
			case 2:
			case 3:
				if ( $reversed ) {
					$month = 1;
				} else {
					$month = 4;
				}
				break;
			case 4:
			case 5:
			case 6:
				if ( $reversed ) {
					$month = 4;
				} else {
					$month = 7;
				}
				break;
			case 7:
			case 8:
			case 9:
				if ( $reversed ) {
					$month = 7;
				} else {
					$month = 10;
				}
				break;
			case 10:
			case 11:
			case 12:
				if ( $reversed ) {
					$month = 10;
				} else {
					$month = 1;
					$year ++;
				}
				break;
		}
		$datetime = new \DateTime( "$year-$month-01 00:00:00", new \DateTimeZone( wc_timezone_string() ) );
		if ( $reversed ) {
			$timestamp                   = (int) $datetime->format( 'U' );
			$end_of_prev_month_timestamp = $timestamp - 1;
			$datetime->setTimestamp( $end_of_prev_month_timestamp );
		}

		return $datetime;
	}

	/**
	 * Return a new DateTime object representing the next year start, or previous year end if reversed.
	 *
	 * @param DateTime $datetime Date and time.
	 * @param bool     $reversed Going backwards in time instead of forward.
	 * @return DateTime
	 */
	public static function next_year_start( $datetime, $reversed = false ) {
		$year_increment = 1;
		$year           = (int) $datetime->format( 'Y' );
		$month          = '01';
		$day            = '01';

		if ( $reversed ) {
			$datetime                   = new \DateTime( "$year-$month-$day 00:00:00", new \DateTimeZone( wc_timezone_string() ) );
			$timestamp                  = (int) $datetime->format( 'U' );
			$end_of_prev_year_timestamp = $timestamp - 1;
			$datetime->setTimestamp( $end_of_prev_year_timestamp );
		} else {
			$year    += $year_increment;
			$datetime = new \DateTime( "$year-$month-$day 00:00:00", new \DateTimeZone( wc_timezone_string() ) );
		}

		return $datetime;
	}

	/**
	 * Returns beginning of next time interval for provided DateTime.
	 *
	 * E.g. for current DateTime, beginning of next day, week, quarter, etc.
	 *
	 * @param DateTime $datetime      Date and time.
	 * @param string   $time_interval Time interval, e.g. week, day, hour.
	 * @param bool     $reversed Going backwards in time instead of forward.
	 * @return DateTime
	 */
	public static function iterate( $datetime, $time_interval, $reversed = false ) {
		return call_user_func( array( __CLASS__, "next_{$time_interval}_start" ), $datetime, $reversed );
	}

	/**
	 * Returns expected number of items on the page in case of date ordering.
	 *
	 * @param int $expected_interval_count Expected number of intervals in total.
	 * @param int $items_per_page          Number of items per page.
	 * @param int $page_no                 Page number.
	 *
	 * @return float|int
	 */
	public static function expected_intervals_on_page( $expected_interval_count, $items_per_page, $page_no ) {
		$total_pages = (int) ceil( $expected_interval_count / $items_per_page );
		if ( $page_no < $total_pages ) {
			return $items_per_page;
		} elseif ( $page_no === $total_pages ) {
			return $expected_interval_count - ( $page_no - 1 ) * $items_per_page;
		} else {
			return 0;
		}
	}

	/**
	 * Returns true if there are any intervals that need to be filled in the response.
	 *
	 * @param int    $expected_interval_count Expected number of intervals in total.
	 * @param int    $db_records              Total number of records for given period in the database.
	 * @param int    $items_per_page          Number of items per page.
	 * @param int    $page_no                 Page number.
	 * @param string $order                   asc or desc.
	 * @param string $order_by                Column by which the result will be sorted.
	 * @param int    $intervals_count         Number of records for given (possibly shortened) time interval.
	 *
	 * @return bool
	 */
	public static function intervals_missing( $expected_interval_count, $db_records, $items_per_page, $page_no, $order, $order_by, $intervals_count ) {
		if ( $expected_interval_count <= $db_records ) {
			return false;
		}
		if ( 'date' === $order_by ) {
			$expected_intervals_on_page = self::expected_intervals_on_page( $expected_interval_count, $items_per_page, $page_no );
			return $intervals_count < $expected_intervals_on_page;
		}
		if ( 'desc' === $order ) {
			return $page_no > floor( $db_records / $items_per_page );
		}
		if ( 'asc' === $order ) {
			return $page_no <= ceil( ( $expected_interval_count - $db_records ) / $items_per_page );
		}
		// Invalid ordering.
		return false;
	}

	/**
	 * Normalize "*_between" parameters to "*_min" and "*_max" for numeric values
	 * and "*_after" and "*_before" for date values.
	 *
	 * @param array        $request Query params from REST API request.
	 * @param string|array $param_names One or more param names to handle. Should not include "_between" suffix.
	 * @param bool         $is_date Boolean if the param is date is related.
	 * @return array Normalized query values.
	 */
	public static function normalize_between_params( $request, $param_names, $is_date ) {
		if ( ! is_array( $param_names ) ) {
			$param_names = array( $param_names );
		}

		$normalized = array();

		foreach ( $param_names as $param_name ) {
			if ( ! is_array( $request[ $param_name . '_between' ] ) ) {
				continue;
			}

			$range = $request[ $param_name . '_between' ];

			if ( 2 !== count( $range ) ) {
				continue;
			}

			$min = $is_date ? '_after' : '_min';
			$max = $is_date ? '_before' : '_max';

			if ( $range[0] < $range[1] ) {
				$normalized[ $param_name . $min ] = $range[0];
				$normalized[ $param_name . $max ] = $range[1];
			} else {
				$normalized[ $param_name . $min ] = $range[1];
				$normalized[ $param_name . $max ] = $range[0];
			}
		}

		return $normalized;
	}

	/**
	 * Validate a "*_between" range argument (an array with 2 numeric items).
	 *
	 * @param  mixed           $value Parameter value.
	 * @param  WP_REST_Request $request REST Request.
	 * @param  string          $param Parameter name.
	 * @return WP_Error|boolean
	 */
	public static function rest_validate_between_numeric_arg( $value, $request, $param ) {
		if ( ! wp_is_numeric_array( $value ) ) {
			return new \WP_Error(
				'rest_invalid_param',
				/* translators: 1: parameter name */
				sprintf( __( '%1$s is not a numerically indexed array.', 'woocommerce' ), $param )
			);
		}

		if (
			2 !== count( $value ) ||
			! is_numeric( $value[0] ) ||
			! is_numeric( $value[1] )
		) {
			return new \WP_Error(
				'rest_invalid_param',
				/* translators: %s: parameter name */
				sprintf( __( '%s must contain 2 numbers.', 'woocommerce' ), $param )
			);
		}

		return true;
	}

	/**
	 * Validate a "*_between" range argument (an array with 2 date items).
	 *
	 * @param  mixed           $value Parameter value.
	 * @param  WP_REST_Request $request REST Request.
	 * @param  string          $param Parameter name.
	 * @return WP_Error|boolean
	 */
	public static function rest_validate_between_date_arg( $value, $request, $param ) {
		if ( ! wp_is_numeric_array( $value ) ) {
			return new \WP_Error(
				'rest_invalid_param',
				/* translators: 1: parameter name */
				sprintf( __( '%1$s is not a numerically indexed array.', 'woocommerce' ), $param )
			);
		}

		if (
			2 !== count( $value ) ||
			! rest_parse_date( $value[0] ) ||
			! rest_parse_date( $value[1] )
		) {
			return new \WP_Error(
				'rest_invalid_param',
				/* translators: %s: parameter name */
				sprintf( __( '%s must contain 2 valid dates.', 'woocommerce' ), $param )
			);
		}

		return true;
	}
}
woocommerce-admin/src/API/Reports/Downloads/Files/Controller.php000064400000001105151335517650020647 0ustar00<?php
/**
 * REST API Reports downloads files controller
 *
 * Handles requests to the /reports/downloads/files endpoint.
 */

namespace Automattic\WooCommerce\Admin\API\Reports\Downloads\Files;

defined( 'ABSPATH' ) || exit;

/**
 * REST API Reports downloads files controller class.
 *
 * @extends WC_REST_Reports_Controller
 */
class Controller extends \WC_REST_Reports_Controller {

	/**
	 * Endpoint namespace.
	 *
	 * @var string
	 */
	protected $namespace = 'wc-analytics';

	/**
	 * Route base.
	 *
	 * @var string
	 */
	protected $rest_base = 'reports/downloads/files';
}
woocommerce-admin/src/API/Reports/Downloads/Stats/Controller.php000064400000032213151335517650020707 0ustar00<?php
/**
 * REST API Reports downloads stats controller
 *
 * Handles requests to the /reports/downloads/stats endpoint.
 */

namespace Automattic\WooCommerce\Admin\API\Reports\Downloads\Stats;

defined( 'ABSPATH' ) || exit;

/**
 * REST API Reports downloads stats controller class.
 *
 * @extends WC_REST_Reports_Controller
 */
class Controller extends \WC_REST_Reports_Controller {

	/**
	 * Endpoint namespace.
	 *
	 * @var string
	 */
	protected $namespace = 'wc-analytics';

	/**
	 * Route base.
	 *
	 * @var string
	 */
	protected $rest_base = 'reports/downloads/stats';

	/**
	 * Maps query arguments from the REST request.
	 *
	 * @param array $request Request array.
	 * @return array
	 */
	protected function prepare_reports_query( $request ) {
		$args                        = array();
		$args['before']              = $request['before'];
		$args['after']               = $request['after'];
		$args['interval']            = $request['interval'];
		$args['page']                = $request['page'];
		$args['per_page']            = $request['per_page'];
		$args['orderby']             = $request['orderby'];
		$args['order']               = $request['order'];
		$args['match']               = $request['match'];
		$args['product_includes']    = (array) $request['product_includes'];
		$args['product_excludes']    = (array) $request['product_excludes'];
		$args['customer_includes']   = (array) $request['customer_includes'];
		$args['customer_excludes']   = (array) $request['customer_excludes'];
		$args['order_includes']      = (array) $request['order_includes'];
		$args['order_excludes']      = (array) $request['order_excludes'];
		$args['ip_address_includes'] = (array) $request['ip_address_includes'];
		$args['ip_address_excludes'] = (array) $request['ip_address_excludes'];
		$args['fields']              = $request['fields'];

		return $args;
	}

	/**
	 * Get all reports.
	 *
	 * @param WP_REST_Request $request Request data.
	 * @return array|WP_Error
	 */
	public function get_items( $request ) {
		$query_args      = $this->prepare_reports_query( $request );
		$downloads_query = new Query( $query_args );
		$report_data     = $downloads_query->get_data();

		$out_data = array(
			'totals'    => get_object_vars( $report_data->totals ),
			'intervals' => array(),
		);

		foreach ( $report_data->intervals as $interval_data ) {
			$item                    = $this->prepare_item_for_response( $interval_data, $request );
			$out_data['intervals'][] = $this->prepare_response_for_collection( $item );
		}

		$response = rest_ensure_response( $out_data );
		$response->header( 'X-WP-Total', (int) $report_data->total );
		$response->header( 'X-WP-TotalPages', (int) $report_data->pages );

		$page      = $report_data->page_no;
		$max_pages = $report_data->pages;
		$base      = add_query_arg( $request->get_query_params(), rest_url( sprintf( '/%s/%s', $this->namespace, $this->rest_base ) ) );
		if ( $page > 1 ) {
			$prev_page = $page - 1;
			if ( $prev_page > $max_pages ) {
				$prev_page = $max_pages;
			}
			$prev_link = add_query_arg( 'page', $prev_page, $base );
			$response->link_header( 'prev', $prev_link );
		}
		if ( $max_pages > $page ) {
			$next_page = $page + 1;
			$next_link = add_query_arg( 'page', $next_page, $base );
			$response->link_header( 'next', $next_link );
		}

		return $response;
	}

	/**
	 * Prepare a report object for serialization.
	 *
	 * @param Array           $report  Report data.
	 * @param WP_REST_Request $request Request object.
	 * @return WP_REST_Response
	 */
	public function prepare_item_for_response( $report, $request ) {
		$data = $report;

		$context = ! empty( $request['context'] ) ? $request['context'] : 'view';
		$data    = $this->add_additional_fields_to_object( $data, $request );
		$data    = $this->filter_response_by_context( $data, $context );

		// Wrap the data in a response object.
		$response = rest_ensure_response( $data );

		/**
		 * Filter a report returned from the API.
		 *
		 * Allows modification of the report data right before it is returned.
		 *
		 * @param WP_REST_Response $response The response object.
		 * @param object           $report   The original report object.
		 * @param WP_REST_Request  $request  Request used to generate the response.
		 */
		return apply_filters( 'woocommerce_rest_prepare_report_downloads_stats', $response, $report, $request );
	}

	/**
	 * Get the Report's schema, conforming to JSON Schema.
	 *
	 * @return array
	 */
	public function get_item_schema() {
		$totals = array(
			'download_count' => array(
				'title'       => __( 'Downloads', 'woocommerce' ),
				'description' => __( 'Number of downloads.', 'woocommerce' ),
				'type'        => 'number',
				'context'     => array( 'view', 'edit' ),
				'readonly'    => true,
				'indicator'   => true,
			),
		);

		$schema = array(
			'$schema'    => 'http://json-schema.org/draft-04/schema#',
			'title'      => 'report_orders_stats',
			'type'       => 'object',
			'properties' => array(
				'totals'    => array(
					'description' => __( 'Totals data.', 'woocommerce' ),
					'type'        => 'object',
					'context'     => array( 'view', 'edit' ),
					'readonly'    => true,
					'properties'  => $totals,
				),
				'intervals' => array(
					'description' => __( 'Reports data grouped by intervals.', 'woocommerce' ),
					'type'        => 'array',
					'context'     => array( 'view', 'edit' ),
					'readonly'    => true,
					'items'       => array(
						'type'       => 'object',
						'properties' => array(
							'interval'       => array(
								'description' => __( 'Type of interval.', 'woocommerce' ),
								'type'        => 'string',
								'context'     => array( 'view', 'edit' ),
								'readonly'    => true,
								'enum'        => array( 'day', 'week', 'month', 'year' ),
							),
							'date_start'     => array(
								'description' => __( "The date the report start, in the site's timezone.", 'woocommerce' ),
								'type'        => 'date-time',
								'context'     => array( 'view', 'edit' ),
								'readonly'    => true,
							),
							'date_start_gmt' => array(
								'description' => __( 'The date the report start, as GMT.', 'woocommerce' ),
								'type'        => 'date-time',
								'context'     => array( 'view', 'edit' ),
								'readonly'    => true,
							),
							'date_end'       => array(
								'description' => __( "The date the report end, in the site's timezone.", 'woocommerce' ),
								'type'        => 'date-time',
								'context'     => array( 'view', 'edit' ),
								'readonly'    => true,
							),
							'date_end_gmt'   => array(
								'description' => __( 'The date the report end, as GMT.', 'woocommerce' ),
								'type'        => 'date-time',
								'context'     => array( 'view', 'edit' ),
								'readonly'    => true,
							),
							'subtotals'      => array(
								'description' => __( 'Interval subtotals.', 'woocommerce' ),
								'type'        => 'object',
								'context'     => array( 'view', 'edit' ),
								'readonly'    => true,
								'properties'  => $totals,
							),
						),
					),
				),
			),
		);

		return $this->add_additional_fields_schema( $schema );
	}

	/**
	 * Get the query params for collections.
	 *
	 * @return array
	 */
	public function get_collection_params() {
		$params                     = array();
		$params['context']          = $this->get_context_param( array( 'default' => 'view' ) );
		$params['page']             = array(
			'description'       => __( 'Current page of the collection.', 'woocommerce' ),
			'type'              => 'integer',
			'default'           => 1,
			'sanitize_callback' => 'absint',
			'validate_callback' => 'rest_validate_request_arg',
			'minimum'           => 1,
		);
		$params['per_page']         = array(
			'description'       => __( 'Maximum number of items to be returned in result set.', 'woocommerce' ),
			'type'              => 'integer',
			'default'           => 10,
			'minimum'           => 1,
			'maximum'           => 100,
			'sanitize_callback' => 'absint',
			'validate_callback' => 'rest_validate_request_arg',
		);
		$params['after']            = array(
			'description'       => __( 'Limit response to resources published after a given ISO8601 compliant date.', 'woocommerce' ),
			'type'              => 'string',
			'format'            => 'date-time',
			'validate_callback' => 'rest_validate_request_arg',
		);
		$params['before']           = array(
			'description'       => __( 'Limit response to resources published before a given ISO8601 compliant date.', 'woocommerce' ),
			'type'              => 'string',
			'format'            => 'date-time',
			'validate_callback' => 'rest_validate_request_arg',
		);
		$params['order']            = array(
			'description'       => __( 'Order sort attribute ascending or descending.', 'woocommerce' ),
			'type'              => 'string',
			'default'           => 'desc',
			'enum'              => array( 'asc', 'desc' ),
			'validate_callback' => 'rest_validate_request_arg',
		);
		$params['orderby']          = array(
			'description'       => __( 'Sort collection by object attribute.', 'woocommerce' ),
			'type'              => 'string',
			'default'           => 'date',
			'enum'              => array(
				'date',
				'download_count',
			),
			'validate_callback' => 'rest_validate_request_arg',
		);
		$params['interval']         = array(
			'description'       => __( 'Time interval to use for buckets in the returned data.', 'woocommerce' ),
			'type'              => 'string',
			'default'           => 'week',
			'enum'              => array(
				'hour',
				'day',
				'week',
				'month',
				'quarter',
				'year',
			),
			'validate_callback' => 'rest_validate_request_arg',
		);
		$params['match']            = array(
			'description'       => __( 'Indicates whether all the conditions should be true for the resulting set, or if any one of them is sufficient. Match affects the following parameters: status_is, status_is_not, product_includes, product_excludes, coupon_includes, coupon_excludes, customer, categories', 'woocommerce' ),
			'type'              => 'string',
			'default'           => 'all',
			'enum'              => array(
				'all',
				'any',
			),
			'validate_callback' => 'rest_validate_request_arg',
		);
		$params['product_includes'] = array(
			'description'       => __( 'Limit result set to items that have the specified product(s) assigned.', 'woocommerce' ),
			'type'              => 'array',
			'items'             => array(
				'type' => 'integer',
			),
			'default'           => array(),
			'sanitize_callback' => 'wp_parse_id_list',

		);
		$params['product_excludes']    = array(
			'description'       => __( 'Limit result set to items that don\'t have the specified product(s) assigned.', 'woocommerce' ),
			'type'              => 'array',
			'items'             => array(
				'type' => 'integer',
			),
			'default'           => array(),
			'sanitize_callback' => 'wp_parse_id_list',
		);
		$params['order_includes']      = array(
			'description'       => __( 'Limit result set to items that have the specified order ids.', 'woocommerce' ),
			'type'              => 'array',
			'sanitize_callback' => 'wp_parse_id_list',
			'validate_callback' => 'rest_validate_request_arg',
			'items'             => array(
				'type' => 'integer',
			),
		);
		$params['order_excludes']      = array(
			'description'       => __( 'Limit result set to items that don\'t have the specified order ids.', 'woocommerce' ),
			'type'              => 'array',
			'sanitize_callback' => 'wp_parse_id_list',
			'validate_callback' => 'rest_validate_request_arg',
			'items'             => array(
				'type' => 'integer',
			),
		);
		$params['customer_includes']   = array(
			'description'       => __( 'Limit response to objects that have the specified customer ids.', 'woocommerce' ),
			'type'              => 'array',
			'sanitize_callback' => 'wp_parse_id_list',
			'validate_callback' => 'rest_validate_request_arg',
			'items'             => array(
				'type' => 'integer',
			),
		);
		$params['customer_excludes']   = array(
			'description'       => __( 'Limit response to objects that don\'t have the specified customer ids.', 'woocommerce' ),
			'type'              => 'array',
			'sanitize_callback' => 'wp_parse_id_list',
			'validate_callback' => 'rest_validate_request_arg',
			'items'             => array(
				'type' => 'integer',
			),
		);
		$params['ip_address_includes'] = array(
			'description'       => __( 'Limit response to objects that have a specified ip address.', 'woocommerce' ),
			'type'              => 'array',
			'validate_callback' => 'rest_validate_request_arg',
			'items'             => array(
				'type' => 'string',
			),
		);

		$params['ip_address_excludes'] = array(
			'description'       => __( 'Limit response to objects that don\'t have a specified ip address.', 'woocommerce' ),
			'type'              => 'array',
			'validate_callback' => 'rest_validate_request_arg',
			'items'             => array(
				'type' => 'string',
			),
		);
		$params['fields']              = array(
			'description'       => __( 'Limit stats fields to the specified items.', 'woocommerce' ),
			'type'              => 'array',
			'sanitize_callback' => 'wp_parse_slug_list',
			'validate_callback' => 'rest_validate_request_arg',
			'items'             => array(
				'type' => 'string',
			),
		);

		return $params;
	}
}
woocommerce-admin/src/API/Reports/Downloads/Stats/DataStore.php000064400000015121151335517650020451 0ustar00<?php
/**
 * API\Reports\Downloads\Stats\DataStore class file.
 */

namespace Automattic\WooCommerce\Admin\API\Reports\Downloads\Stats;

defined( 'ABSPATH' ) || exit;

use \Automattic\WooCommerce\Admin\API\Reports\Downloads\DataStore as DownloadsDataStore;
use \Automattic\WooCommerce\Admin\API\Reports\DataStoreInterface;
use \Automattic\WooCommerce\Admin\API\Reports\TimeInterval;
use \Automattic\WooCommerce\Admin\API\Reports\SqlQuery;

/**
 * API\Reports\Downloads\Stats\DataStore.
 */
class DataStore extends DownloadsDataStore implements DataStoreInterface {

	/**
	 * Mapping columns to data type to return correct response types.
	 *
	 * @var array
	 */
	protected $column_types = array(
		'download_count' => 'intval',
	);

	/**
	 * Cache identifier.
	 *
	 * @var string
	 */
	protected $cache_key = 'downloads_stats';

	/**
	 * Data store context used to pass to filters.
	 *
	 * @var string
	 */
	protected $context = 'downloads_stats';

	/**
	 * Assign report columns once full table name has been assigned.
	 */
	protected function assign_report_columns() {
		$this->report_columns = array(
			'download_count' => 'COUNT(DISTINCT download_log_id) as download_count',
		);
	}

	/**
	 * Returns the report data based on parameters supplied by the user.
	 *
	 * @param array $query_args  Query parameters.
	 * @return stdClass|WP_Error Data.
	 */
	public function get_data( $query_args ) {
		global $wpdb;

		$table_name = self::get_db_table_name();

		// These defaults are only partially applied when used via REST API, as that has its own defaults.
		$defaults   = array(
			'per_page' => get_option( 'posts_per_page' ),
			'page'     => 1,
			'order'    => 'DESC',
			'orderby'  => 'date',
			'fields'   => '*',
			'interval' => 'week',
			'before'   => TimeInterval::default_before(),
			'after'    => TimeInterval::default_after(),
		);
		$query_args = wp_parse_args( $query_args, $defaults );
		$this->normalize_timezones( $query_args, $defaults );

		/*
		 * We need to get the cache key here because
		 * parent::update_intervals_sql_params() modifies $query_args.
		 */
		$cache_key = $this->get_cache_key( $query_args );
		$data      = $this->get_cached_data( $cache_key );

		if ( false === $data ) {
			$this->initialize_queries();
			$selections = $this->selected_columns( $query_args );
			$this->add_sql_query_params( $query_args );
			$this->add_time_period_sql_params( $query_args, $table_name );
			$this->add_intervals_sql_params( $query_args, $table_name );

			$this->interval_query->add_sql_clause( 'select', $this->get_sql_clause( 'select' ) . ' AS time_interval' );
			$this->interval_query->str_replace_clause( 'select', 'date_created', 'timestamp' );
			$this->interval_query->str_replace_clause( 'where_time', 'date_created', 'timestamp' );

			$db_intervals = $wpdb->get_col(
				$this->interval_query->get_query_statement()
			); // WPCS: cache ok, DB call ok, , unprepared SQL ok.

			$db_records_count = count( $db_intervals );

			$params                  = $this->get_limit_params( $query_args );
			$expected_interval_count = TimeInterval::intervals_between( $query_args['after'], $query_args['before'], $query_args['interval'] );
			$total_pages             = (int) ceil( $expected_interval_count / $params['per_page'] );
			if ( $query_args['page'] < 1 || $query_args['page'] > $total_pages ) {
				return array();
			}

			$this->update_intervals_sql_params( $query_args, $db_records_count, $expected_interval_count, $table_name );
			$this->interval_query->str_replace_clause( 'where_time', 'date_created', 'timestamp' );
			$this->total_query->add_sql_clause( 'select', $selections );
			$this->total_query->add_sql_clause( 'where', $this->interval_query->get_sql_clause( 'where' ) );
			$totals = $wpdb->get_results(
				$this->total_query->get_query_statement(),
				ARRAY_A
			); // WPCS: cache ok, DB call ok, unprepared SQL ok.

			if ( null === $totals ) {
				return new \WP_Error( 'woocommerce_analytics_downloads_stats_result_failed', __( 'Sorry, fetching downloads data failed.', 'woocommerce' ) );
			}

			$this->interval_query->add_sql_clause( 'order_by', $this->get_sql_clause( 'order_by' ) );
			$this->interval_query->add_sql_clause( 'limit', $this->get_sql_clause( 'limit' ) );
			$this->interval_query->add_sql_clause( 'select', ', MAX(timestamp) AS datetime_anchor' );
			if ( '' !== $selections ) {
				$this->interval_query->add_sql_clause( 'select', ', ' . $selections );
			}

			$intervals = $wpdb->get_results(
				$this->interval_query->get_query_statement(),
				ARRAY_A
			); // WPCS: cache ok, DB call ok, unprepared SQL ok.

			if ( null === $intervals ) {
				return new \WP_Error( 'woocommerce_analytics_downloads_stats_result_failed', __( 'Sorry, fetching downloads data failed.', 'woocommerce' ) );
			}

			$totals = (object) $this->cast_numbers( $totals[0] );
			$data   = (object) array(
				'totals'    => $totals,
				'intervals' => $intervals,
				'total'     => $expected_interval_count,
				'pages'     => $total_pages,
				'page_no'   => (int) $query_args['page'],
			);

			if ( $this->intervals_missing( $expected_interval_count, $db_records_count, $params['per_page'], $query_args['page'], $query_args['order'], $query_args['orderby'], count( $intervals ) ) ) {
				$this->fill_in_missing_intervals( $db_intervals, $query_args['adj_after'], $query_args['adj_before'], $query_args['interval'], $data );
				$this->sort_intervals( $data, $query_args['orderby'], $query_args['order'] );
				$this->remove_extra_records( $data, $query_args['page'], $params['per_page'], $db_records_count, $expected_interval_count, $query_args['orderby'], $query_args['order'] );
			} else {
				$this->update_interval_boundary_dates( $query_args['after'], $query_args['before'], $query_args['interval'], $data->intervals );
			}
			$this->create_interval_subtotals( $data->intervals );

			$this->set_cached_data( $cache_key, $data );
		}

		return $data;
	}

	/**
	 * Normalizes order_by clause to match to SQL query.
	 *
	 * @param string $order_by Order by option requeste by user.
	 * @return string
	 */
	protected function normalize_order_by( $order_by ) {
		if ( 'date' === $order_by ) {
			return 'time_interval';
		}

		return $order_by;
	}

	/**
	 * Initialize query objects.
	 */
	protected function initialize_queries() {
		$this->clear_all_clauses();
		unset( $this->subquery );
		$this->total_query = new SqlQuery( $this->context . '_total' );
		$this->total_query->add_sql_clause( 'from', self::get_db_table_name() );

		$this->interval_query = new SqlQuery( $this->context . '_interval' );
		$this->interval_query->add_sql_clause( 'from', self::get_db_table_name() );
		$this->interval_query->add_sql_clause( 'group_by', 'time_interval' );
	}
}
woocommerce-admin/src/API/Reports/Downloads/Stats/Query.php000064400000001600151335517650017665 0ustar00<?php
/**
 * Class for parameter-based downloads Reports querying
 */

namespace Automattic\WooCommerce\Admin\API\Reports\Downloads\Stats;

defined( 'ABSPATH' ) || exit;

use \Automattic\WooCommerce\Admin\API\Reports\Query as ReportsQuery;

/**
 * API\Reports\Downloads\Stats\Query
 */
class Query extends ReportsQuery {

	/**
	 * Valid fields for Orders report.
	 *
	 * @return array
	 */
	protected function get_default_query_vars() {
		return array();
	}

	/**
	 * Get revenue data based on the current query vars.
	 *
	 * @return array
	 */
	public function get_data() {
		$args = apply_filters( 'woocommerce_analytics_downloads_stats_query_args', $this->get_query_vars() );

		$data_store = \WC_Data_Store::load( 'report-downloads-stats' );
		$results    = $data_store->get_data( $args );
		return apply_filters( 'woocommerce_analytics_downloads_stats_select_query', $results, $args );
	}
}
woocommerce-admin/src/API/Reports/Downloads/DataStore.php000064400000027424151335517650017364 0ustar00<?php
/**
 * API\Reports\Downloads\DataStore class file.
 */

namespace Automattic\WooCommerce\Admin\API\Reports\Downloads;

defined( 'ABSPATH' ) || exit;

use \Automattic\WooCommerce\Admin\API\Reports\DataStore as ReportsDataStore;
use \Automattic\WooCommerce\Admin\API\Reports\DataStoreInterface;
use \Automattic\WooCommerce\Admin\API\Reports\TimeInterval;
use \Automattic\WooCommerce\Admin\API\Reports\SqlQuery;

/**
 * API\Reports\Downloads\DataStore.
 */
class DataStore extends ReportsDataStore implements DataStoreInterface {

	/**
	 * Table used to get the data.
	 *
	 * @var string
	 */
	protected static $table_name = 'wc_download_log';

	/**
	 * Cache identifier.
	 *
	 * @var string
	 */
	protected $cache_key = 'downloads';

	/**
	 * Mapping columns to data type to return correct response types.
	 *
	 * @var array
	 */
	protected $column_types = array(
		'id'          => 'intval',
		'date'        => 'strval',
		'date_gmt'    => 'strval',
		'download_id' => 'strval', // String because this can sometimes be a hash.
		'file_name'   => 'strval',
		'product_id'  => 'intval',
		'order_id'    => 'intval',
		'user_id'     => 'intval',
		'ip_address'  => 'strval',
	);

	/**
	 * Data store context used to pass to filters.
	 *
	 * @var string
	 */
	protected $context = 'downloads';

	/**
	 * Assign report columns once full table name has been assigned.
	 */
	protected function assign_report_columns() {
		$this->report_columns = array(
			'id'          => 'download_log_id as id',
			'date'        => 'timestamp as date_gmt',
			'download_id' => 'product_permissions.download_id',
			'product_id'  => 'product_permissions.product_id',
			'order_id'    => 'product_permissions.order_id',
			'user_id'     => 'product_permissions.user_id',
			'ip_address'  => 'user_ip_address as ip_address',
		);
	}

	/**
	 * Updates the database query with parameters used for downloads report.
	 *
	 * @param array $query_args Query arguments supplied by the user.
	 */
	protected function add_sql_query_params( $query_args ) {
		global $wpdb;

		$lookup_table     = self::get_db_table_name();
		$permission_table = $wpdb->prefix . 'woocommerce_downloadable_product_permissions';
		$operator         = $this->get_match_operator( $query_args );
		$where_filters    = array();
		$join             = "JOIN {$permission_table} as product_permissions ON {$lookup_table}.permission_id = product_permissions.permission_id";

		$where_time = $this->add_time_period_sql_params( $query_args, $lookup_table );
		if ( $where_time ) {
			if ( isset( $this->subquery ) ) {
				$this->subquery->add_sql_clause( 'where_time', $where_time );
			} else {
				$this->interval_query->add_sql_clause( 'where_time', $where_time );
			}
		}
		$this->get_limit_sql_params( $query_args );

		$where_filters[] = $this->get_object_where_filter(
			$lookup_table,
			'permission_id',
			$permission_table,
			'product_id',
			'IN',
			$this->get_included_products( $query_args )
		);
		$where_filters[] = $this->get_object_where_filter(
			$lookup_table,
			'permission_id',
			$permission_table,
			'product_id',
			'NOT IN',
			$this->get_excluded_products( $query_args )
		);
		$where_filters[] = $this->get_object_where_filter(
			$lookup_table,
			'permission_id',
			$permission_table,
			'order_id',
			'IN',
			$this->get_included_orders( $query_args )
		);
		$where_filters[] = $this->get_object_where_filter(
			$lookup_table,
			'permission_id',
			$permission_table,
			'order_id',
			'NOT IN',
			$this->get_excluded_orders( $query_args )
		);

		$customer_lookup_table = $wpdb->prefix . 'wc_customer_lookup';
		$customer_lookup       = "SELECT {$customer_lookup_table}.user_id FROM {$customer_lookup_table} WHERE {$customer_lookup_table}.customer_id IN (%s)";
		$included_customers    = $this->get_included_customers( $query_args );
		$excluded_customers    = $this->get_excluded_customers( $query_args );
		if ( $included_customers ) {
			$where_filters[] = $this->get_object_where_filter(
				$lookup_table,
				'permission_id',
				$permission_table,
				'user_id',
				'IN',
				sprintf( $customer_lookup, $included_customers )
			);
		}

		if ( $excluded_customers ) {
			$where_filters[] = $this->get_object_where_filter(
				$lookup_table,
				'permission_id',
				$permission_table,
				'user_id',
				'NOT IN',
				sprintf( $customer_lookup, $excluded_customers )
			);
		}

		$included_ip_addresses = $this->get_included_ip_addresses( $query_args );
		$excluded_ip_addresses = $this->get_excluded_ip_addresses( $query_args );
		if ( $included_ip_addresses ) {
			$where_filters[] = "{$lookup_table}.user_ip_address IN ('{$included_ip_addresses}')";
		}

		if ( $excluded_ip_addresses ) {
			$where_filters[] = "{$lookup_table}.user_ip_address NOT IN ('{$excluded_ip_addresses}')";
		}

		$where_filters   = array_filter( $where_filters );
		$where_subclause = implode( " $operator ", $where_filters );
		if ( $where_subclause ) {
			if ( isset( $this->subquery ) ) {
				$this->subquery->add_sql_clause( 'where', "AND ( $where_subclause )" );
			} else {
				$this->interval_query->add_sql_clause( 'where', "AND ( $where_subclause )" );
			}
		}

		if ( isset( $this->subquery ) ) {
			$this->subquery->add_sql_clause( 'join', $join );
		} else {
			$this->interval_query->add_sql_clause( 'join', $join );
		}
		$this->add_order_by( $query_args );
	}

	/**
	 * Returns comma separated ids of included ip address, based on query arguments from the user.
	 *
	 * @param array $query_args Parameters supplied by the user.
	 * @return string
	 */
	protected function get_included_ip_addresses( $query_args ) {
		if ( isset( $query_args['ip_address_includes'] ) && is_array( $query_args['ip_address_includes'] ) && count( $query_args['ip_address_includes'] ) > 0 ) {
			$query_args['ip_address_includes'] = array_map( 'esc_sql', $query_args['ip_address_includes'] );
		}
		return self::get_filtered_ids( $query_args, 'ip_address_includes', "','" );
	}

	/**
	 * Returns comma separated ids of excluded ip address, based on query arguments from the user.
	 *
	 * @param array $query_args Parameters supplied by the user.
	 * @return string
	 */
	protected function get_excluded_ip_addresses( $query_args ) {
		if ( isset( $query_args['ip_address_excludes'] ) && is_array( $query_args['ip_address_excludes'] ) && count( $query_args['ip_address_excludes'] ) > 0 ) {
			$query_args['ip_address_excludes'] = array_map( 'esc_sql', $query_args['ip_address_excludes'] );
		}
		return self::get_filtered_ids( $query_args, 'ip_address_excludes', "','" );
	}

	/**
	 * Returns comma separated ids of included customers, based on query arguments from the user.
	 *
	 * @param array $query_args Parameters supplied by the user.
	 * @return string
	 */
	protected function get_included_customers( $query_args ) {
		return self::get_filtered_ids( $query_args, 'customer_includes' );
	}

	/**
	 * Returns comma separated ids of excluded customers, based on query arguments from the user.
	 *
	 * @param array $query_args Parameters supplied by the user.
	 * @return string
	 */
	protected function get_excluded_customers( $query_args ) {
		return self::get_filtered_ids( $query_args, 'customer_excludes' );
	}

	/**
	 * Gets WHERE time clause of SQL request with date-related constraints.
	 *
	 * @param array  $query_args Parameters supplied by the user.
	 * @param string $table_name Name of the db table relevant for the date constraint.
	 * @return string
	 */
	protected function add_time_period_sql_params( $query_args, $table_name ) {
		$where_time = '';
		if ( $query_args['before'] ) {
			$datetime_str = $query_args['before']->format( TimeInterval::$sql_datetime_format );
			$where_time  .= " AND {$table_name}.timestamp <= '$datetime_str'";

		}

		if ( $query_args['after'] ) {
			$datetime_str = $query_args['after']->format( TimeInterval::$sql_datetime_format );
			$where_time  .= " AND {$table_name}.timestamp >= '$datetime_str'";
		}

		return $where_time;
	}

	/**
	 * Fills ORDER BY clause of SQL request based on user supplied parameters.
	 *
	 * @param array $query_args Parameters supplied by the user.
	 */
	protected function add_order_by( $query_args ) {
		global $wpdb;
		$this->clear_sql_clause( 'order_by' );
		$order_by = '';
		if ( isset( $query_args['orderby'] ) ) {
			$order_by = $this->normalize_order_by( $query_args['orderby'] );
			$this->add_sql_clause( 'order_by', $order_by );
		}

		if ( false !== strpos( $order_by, '_products' ) ) {
			$this->subquery->add_sql_clause( 'join', "JOIN {$wpdb->posts} AS _products ON product_permissions.product_id = _products.ID" );
		}

		$this->add_orderby_order_clause( $query_args, $this );
	}

	/**
	 * Returns the report data based on parameters supplied by the user.
	 *
	 * @param array $query_args  Query parameters.
	 * @return stdClass|WP_Error Data.
	 */
	public function get_data( $query_args ) {
		global $wpdb;

		$table_name = self::get_db_table_name();

		// These defaults are only partially applied when used via REST API, as that has its own defaults.
		$defaults   = array(
			'per_page' => get_option( 'posts_per_page' ),
			'page'     => 1,
			'order'    => 'DESC',
			'orderby'  => 'timestamp',
			'before'   => TimeInterval::default_before(),
			'after'    => TimeInterval::default_after(),
			'fields'   => '*',
		);
		$query_args = wp_parse_args( $query_args, $defaults );
		$this->normalize_timezones( $query_args, $defaults );

		/*
		 * We need to get the cache key here because
		 * parent::update_intervals_sql_params() modifies $query_args.
		 */
		$cache_key = $this->get_cache_key( $query_args );
		$data      = $this->get_cached_data( $cache_key );

		if ( false === $data ) {
			$this->initialize_queries();

			$data = (object) array(
				'data'    => array(),
				'total'   => 0,
				'pages'   => 0,
				'page_no' => 0,
			);

			$selections = $this->selected_columns( $query_args );
			$this->add_sql_query_params( $query_args );

			$db_records_count = (int) $wpdb->get_var(
				"SELECT COUNT(*) FROM (
					{$this->subquery->get_query_statement()}
				) AS tt"
			); // WPCS: cache ok, DB call ok, unprepared SQL ok.

			$params      = $this->get_limit_params( $query_args );
			$total_pages = (int) ceil( $db_records_count / $params['per_page'] );
			if ( $query_args['page'] < 1 || $query_args['page'] > $total_pages ) {
				return $data;
			}

			$this->subquery->clear_sql_clause( 'select' );
			$this->subquery->add_sql_clause( 'select', $selections );
			$this->subquery->add_sql_clause( 'order_by', $this->get_sql_clause( 'order_by' ) );
			$this->subquery->add_sql_clause( 'limit', $this->get_sql_clause( 'limit' ) );

			$download_data = $wpdb->get_results(
				$this->subquery->get_query_statement(),
				ARRAY_A
			); // WPCS: cache ok, DB call ok, unprepared SQL ok.

			if ( null === $download_data ) {
				return $data;
			}

			$download_data = array_map( array( $this, 'cast_numbers' ), $download_data );
			$data          = (object) array(
				'data'    => $download_data,
				'total'   => $db_records_count,
				'pages'   => $total_pages,
				'page_no' => (int) $query_args['page'],
			);

			$this->set_cached_data( $cache_key, $data );
		}

		return $data;
	}

	/**
	 * Maps ordering specified by the user to columns in the database/fields in the data.
	 *
	 * @param string $order_by Sorting criterion.
	 * @return string
	 */
	protected function normalize_order_by( $order_by ) {
		global $wpdb;

		if ( 'date' === $order_by ) {
			return $wpdb->prefix . 'wc_download_log.timestamp';
		}

		if ( 'product' === $order_by ) {
			return '_products.post_title';
		}

		return $order_by;
	}

	/**
	 * Initialize query objects.
	 */
	protected function initialize_queries() {
		$this->clear_all_clauses();
		$table_name     = self::get_db_table_name();
		$this->subquery = new SqlQuery( $this->context . '_subquery' );
		$this->subquery->add_sql_clause( 'from', $table_name );
		$this->subquery->add_sql_clause( 'select', "{$table_name}.download_log_id" );
		$this->subquery->add_sql_clause( 'group_by', "{$table_name}.download_log_id" );
	}
}
woocommerce-admin/src/API/Reports/Downloads/Query.php000064400000002261151335517650016573 0ustar00<?php
/**
 * Class for parameter-based downloads report querying.
 *
 * Example usage:
 * $args = array(
 *      'before'       => '2018-07-19 00:00:00',
 *      'after'        => '2018-07-05 00:00:00',
 *      'page'         => 2,
 *      'products'     => array(1,2,3)
 * );
 * $report = new \Automattic\WooCommerce\Admin\API\Reports\Downloads\Query( $args );
 * $mydata = $report->get_data();
 */

namespace Automattic\WooCommerce\Admin\API\Reports\Downloads;

defined( 'ABSPATH' ) || exit;

use \Automattic\WooCommerce\Admin\API\Reports\Query as ReportsQuery;

/**
 * API\Reports\Downloads\Query
 */
class Query extends ReportsQuery {

	/**
	 * Valid fields for downloads report.
	 *
	 * @return array
	 */
	protected function get_default_query_vars() {
		return array();
	}

	/**
	 * Get downloads data based on the current query vars.
	 *
	 * @return array
	 */
	public function get_data() {
		$args = apply_filters( 'woocommerce_analytics_downloads_query_args', $this->get_query_vars() );

		$data_store = \WC_Data_Store::load( 'report-downloads' );
		$results    = $data_store->get_data( $args );
		return apply_filters( 'woocommerce_analytics_downloads_select_query', $results, $args );
	}
}
woocommerce-admin/src/API/Reports/Downloads/Controller.php000064400000034565151335517650017625 0ustar00<?php
/**
 * REST API Reports downloads controller
 *
 * Handles requests to the /reports/downloads endpoint.
 */

namespace Automattic\WooCommerce\Admin\API\Reports\Downloads;

defined( 'ABSPATH' ) || exit;

use \Automattic\WooCommerce\Admin\API\Reports\Controller as ReportsController;
use \Automattic\WooCommerce\Admin\API\Reports\ExportableInterface;

/**
 * REST API Reports downloads controller class.
 *
 * @extends Automattic\WooCommerce\Admin\API\Reports\Controller
 */
class Controller extends ReportsController implements ExportableInterface {
	/**
	 * Endpoint namespace.
	 *
	 * @var string
	 */
	protected $namespace = 'wc-analytics';

	/**
	 * Route base.
	 *
	 * @var string
	 */
	protected $rest_base = 'reports/downloads';

	/**
	 * Get items.
	 *
	 * @param WP_REST_Request $request Request data.
	 * @return array|WP_Error
	 */
	public function get_items( $request ) {
		$args       = array();
		$registered = array_keys( $this->get_collection_params() );
		foreach ( $registered as $param_name ) {
			if ( isset( $request[ $param_name ] ) ) {
				$args[ $param_name ] = $request[ $param_name ];
			}
		}

		$reports        = new Query( $args );
		$downloads_data = $reports->get_data();

		$data = array();

		foreach ( $downloads_data->data as $download_data ) {
			$item   = $this->prepare_item_for_response( $download_data, $request );
			$data[] = $this->prepare_response_for_collection( $item );
		}

		$response = rest_ensure_response( $data );

		$response->header( 'X-WP-Total', (int) $downloads_data->total );
		$response->header( 'X-WP-TotalPages', (int) $downloads_data->pages );

		$page      = $downloads_data->page_no;
		$max_pages = $downloads_data->pages;
		$base      = add_query_arg( $request->get_query_params(), rest_url( sprintf( '/%s/%s', $this->namespace, $this->rest_base ) ) );
		if ( $page > 1 ) {
			$prev_page = $page - 1;
			if ( $prev_page > $max_pages ) {
				$prev_page = $max_pages;
			}
			$prev_link = add_query_arg( 'page', $prev_page, $base );
			$response->link_header( 'prev', $prev_link );
		}
		if ( $max_pages > $page ) {
			$next_page = $page + 1;
			$next_link = add_query_arg( 'page', $next_page, $base );
			$response->link_header( 'next', $next_link );
		}

		return $response;
	}

	/**
	 * Prepare a report object for serialization.
	 *
	 * @param Array           $report  Report data.
	 * @param WP_REST_Request $request Request object.
	 * @return WP_REST_Response
	 */
	public function prepare_item_for_response( $report, $request ) {
		$data = $report;

		$context = ! empty( $request['context'] ) ? $request['context'] : 'view';
		$data    = $this->add_additional_fields_to_object( $data, $request );
		$data    = $this->filter_response_by_context( $data, $context );

		// Wrap the data in a response object.
		$response = rest_ensure_response( $data );
		$response->add_links( $this->prepare_links( $report ) );

		$response->data['date'] = get_date_from_gmt( $data['date_gmt'], 'Y-m-d H:i:s' );

		// Figure out file name.
		// Matches https://github.com/woocommerce/woocommerce/blob/4be0018c092e617c5d2b8c46b800eb71ece9ddef/includes/class-wc-download-handler.php#L197.
		$product_id = intval( $data['product_id'] );
		$_product   = wc_get_product( $product_id );

		// Make sure the product hasn't been deleted.
		if ( $_product ) {
			$file_path                   = $_product->get_file_download_path( $data['download_id'] );
			$filename                    = basename( $file_path );
			$response->data['file_name'] = apply_filters( 'woocommerce_file_download_filename', $filename, $product_id );
			$response->data['file_path'] = $file_path;
		} else {
			$response->data['file_name'] = '';
			$response->data['file_path'] = '';
		}

		$customer                       = new \WC_Customer( $data['user_id'] );
		$response->data['username']     = $customer->get_username();
		$response->data['order_number'] = $this->get_order_number( $data['order_id'] );

		/**
		 * Filter a report returned from the API.
		 *
		 * Allows modification of the report data right before it is returned.
		 *
		 * @param WP_REST_Response $response The response object.
		 * @param object           $report   The original report object.
		 * @param WP_REST_Request  $request  Request used to generate the response.
		 */
		return apply_filters( 'woocommerce_rest_prepare_report_downloads', $response, $report, $request );
	}

	/**
	 * Prepare links for the request.
	 *
	 * @param Array $object Object data.
	 * @return array        Links for the given post.
	 */
	protected function prepare_links( $object ) {
		$links = array(
			'product' => array(
				'href'       => rest_url( sprintf( '/%s/%s/%d', $this->namespace, 'products', $object['product_id'] ) ),
				'embeddable' => true,
			),
		);

		return $links;
	}

	/**
	 * Get the Report's schema, conforming to JSON Schema.
	 *
	 * @return array
	 */
	public function get_item_schema() {
		$schema = array(
			'$schema'    => 'http://json-schema.org/draft-04/schema#',
			'title'      => 'report_downloads',
			'type'       => 'object',
			'properties' => array(
				'id'           => array(
					'type'        => 'integer',
					'readonly'    => true,
					'context'     => array( 'view', 'edit' ),
					'description' => __( 'ID.', 'woocommerce' ),
				),
				'product_id'   => array(
					'type'        => 'integer',
					'readonly'    => true,
					'context'     => array( 'view', 'edit' ),
					'description' => __( 'Product ID.', 'woocommerce' ),
				),
				'date'         => array(
					'description' => __( "The date of the download, in the site's timezone.", 'woocommerce' ),
					'type'        => 'date-time',
					'context'     => array( 'view', 'edit' ),
					'readonly'    => true,
				),
				'date_gmt'     => array(
					'description' => __( 'The date of the download, as GMT.', 'woocommerce' ),
					'type'        => 'date-time',
					'context'     => array( 'view', 'edit' ),
					'readonly'    => true,
				),
				'download_id'  => array(
					'type'        => 'string',
					'readonly'    => true,
					'context'     => array( 'view', 'edit' ),
					'description' => __( 'Download ID.', 'woocommerce' ),
				),
				'file_name'    => array(
					'type'        => 'string',
					'readonly'    => true,
					'context'     => array( 'view', 'edit' ),
					'description' => __( 'File name.', 'woocommerce' ),
				),
				'file_path'    => array(
					'type'        => 'string',
					'readonly'    => true,
					'context'     => array( 'view', 'edit' ),
					'description' => __( 'File URL.', 'woocommerce' ),
				),
				'order_id'     => array(
					'type'        => 'integer',
					'readonly'    => true,
					'context'     => array( 'view', 'edit' ),
					'description' => __( 'Order ID.', 'woocommerce' ),
				),
				'order_number' => array(
					'type'        => 'string',
					'readonly'    => true,
					'context'     => array( 'view', 'edit' ),
					'description' => __( 'Order Number.', 'woocommerce' ),
				),
				'user_id'      => array(
					'type'        => 'integer',
					'readonly'    => true,
					'context'     => array( 'view', 'edit' ),
					'description' => __( 'User ID for the downloader.', 'woocommerce' ),
				),
				'username'     => array(
					'type'        => 'string',
					'readonly'    => true,
					'context'     => array( 'view', 'edit' ),
					'description' => __( 'User name of the downloader.', 'woocommerce' ),
				),
				'ip_address'   => array(
					'type'        => 'string',
					'readonly'    => true,
					'context'     => array( 'view', 'edit' ),
					'description' => __( 'IP address for the downloader.', 'woocommerce' ),
				),
			),
		);

		return $this->add_additional_fields_schema( $schema );
	}

	/**
	 * Get the query params for collections.
	 *
	 * @return array
	 */
	public function get_collection_params() {
		$params                        = array();
		$params['context']             = $this->get_context_param( array( 'default' => 'view' ) );
		$params['page']                = array(
			'description'       => __( 'Current page of the collection.', 'woocommerce' ),
			'type'              => 'integer',
			'default'           => 1,
			'sanitize_callback' => 'absint',
			'validate_callback' => 'rest_validate_request_arg',
			'minimum'           => 1,
		);
		$params['per_page']            = array(
			'description'       => __( 'Maximum number of items to be returned in result set.', 'woocommerce' ),
			'type'              => 'integer',
			'default'           => 10,
			'minimum'           => 1,
			'maximum'           => 100,
			'sanitize_callback' => 'absint',
			'validate_callback' => 'rest_validate_request_arg',
		);
		$params['after']               = array(
			'description'       => __( 'Limit response to resources published after a given ISO8601 compliant date.', 'woocommerce' ),
			'type'              => 'string',
			'format'            => 'date-time',
			'validate_callback' => 'rest_validate_request_arg',
		);
		$params['before']              = array(
			'description'       => __( 'Limit response to resources published before a given ISO8601 compliant date.', 'woocommerce' ),
			'type'              => 'string',
			'format'            => 'date-time',
			'validate_callback' => 'rest_validate_request_arg',
		);
		$params['order']               = array(
			'description'       => __( 'Order sort attribute ascending or descending.', 'woocommerce' ),
			'type'              => 'string',
			'default'           => 'desc',
			'enum'              => array( 'asc', 'desc' ),
			'validate_callback' => 'rest_validate_request_arg',
		);
		$params['orderby']             = array(
			'description'       => __( 'Sort collection by object attribute.', 'woocommerce' ),
			'type'              => 'string',
			'default'           => 'date',
			'enum'              => array(
				'date',
				'product',
			),
			'validate_callback' => 'rest_validate_request_arg',
		);
		$params['match']               = array(
			'description'       => __( 'Indicates whether all the conditions should be true for the resulting set, or if any one of them is sufficient. Match affects the following parameters: products, orders, username, ip_address.', 'woocommerce' ),
			'type'              => 'string',
			'default'           => 'all',
			'enum'              => array(
				'all',
				'any',
			),
			'validate_callback' => 'rest_validate_request_arg',
		);
		$params['product_includes']    = array(
			'description'       => __( 'Limit result set to items that have the specified product(s) assigned.', 'woocommerce' ),
			'type'              => 'array',
			'items'             => array(
				'type' => 'integer',
			),
			'default'           => array(),
			'sanitize_callback' => 'wp_parse_id_list',
			'validate_callback' => 'rest_validate_request_arg',
		);
		$params['product_excludes']    = array(
			'description'       => __( 'Limit result set to items that don\'t have the specified product(s) assigned.', 'woocommerce' ),
			'type'              => 'array',
			'items'             => array(
				'type' => 'integer',
			),
			'default'           => array(),
			'validate_callback' => 'rest_validate_request_arg',
			'sanitize_callback' => 'wp_parse_id_list',
		);
		$params['order_includes']      = array(
			'description'       => __( 'Limit result set to items that have the specified order ids.', 'woocommerce' ),
			'type'              => 'array',
			'sanitize_callback' => 'wp_parse_id_list',
			'validate_callback' => 'rest_validate_request_arg',
			'items'             => array(
				'type' => 'integer',
			),
		);
		$params['order_excludes']      = array(
			'description'       => __( 'Limit result set to items that don\'t have the specified order ids.', 'woocommerce' ),
			'type'              => 'array',
			'sanitize_callback' => 'wp_parse_id_list',
			'validate_callback' => 'rest_validate_request_arg',
			'items'             => array(
				'type' => 'integer',
			),
		);
		$params['customer_includes']   = array(
			'description'       => __( 'Limit response to objects that have the specified user ids.', 'woocommerce' ),
			'type'              => 'array',
			'sanitize_callback' => 'wp_parse_id_list',
			'validate_callback' => 'rest_validate_request_arg',
			'items'             => array(
				'type' => 'integer',
			),
		);
		$params['customer_excludes']   = array(
			'description'       => __( 'Limit response to objects that don\'t have the specified user ids.', 'woocommerce' ),
			'type'              => 'array',
			'sanitize_callback' => 'wp_parse_id_list',
			'validate_callback' => 'rest_validate_request_arg',
			'items'             => array(
				'type' => 'integer',
			),
		);
		$params['ip_address_includes'] = array(
			'description'       => __( 'Limit response to objects that have a specified ip address.', 'woocommerce' ),
			'type'              => 'array',
			'validate_callback' => 'rest_validate_request_arg',
			'items'             => array(
				'type' => 'string',
			),
		);

		$params['ip_address_excludes'] = array(
			'description'       => __( 'Limit response to objects that don\'t have a specified ip address.', 'woocommerce' ),
			'type'              => 'array',
			'validate_callback' => 'rest_validate_request_arg',
			'items'             => array(
				'type' => 'string',
			),
		);

		return $params;
	}

	/**
	 * Get the column names for export.
	 *
	 * @return array Key value pair of Column ID => Label.
	 */
	public function get_export_columns() {
		$export_columns = array(
			'date'         => __( 'Date', 'woocommerce' ),
			'product'      => __( 'Product title', 'woocommerce' ),
			'file_name'    => __( 'File name', 'woocommerce' ),
			'order_number' => __( 'Order #', 'woocommerce' ),
			'user_id'      => __( 'User Name', 'woocommerce' ),
			'ip_address'   => __( 'IP', 'woocommerce' ),
		);

		/**
		 * Filter to add or remove column names from the downloads report for
		 * export.
		 *
		 * @since 1.6.0
		 */
		return apply_filters(
			'woocommerce_filter_downloads_export_columns',
			$export_columns
		);
	}

	/**
	 * Get the column values for export.
	 *
	 * @param array $item Single report item/row.
	 * @return array Key value pair of Column ID => Row Value.
	 */
	public function prepare_item_for_export( $item ) {
		$export_item = array(
			'date'         => $item['date'],
			'product'      => $item['_embedded']['product'][0]['name'],
			'file_name'    => $item['file_name'],
			'order_number' => $item['order_number'],
			'user_id'      => $item['username'],
			'ip_address'   => $item['ip_address'],
		);

		/**
		 * Filter to prepare extra columns in the export item for the downloads
		 * report.
		 *
		 * @since 1.6.0
		 */
		return apply_filters(
			'woocommerce_report_downloads_prepare_export_item',
			$export_item,
			$item
		);
	}
}
woocommerce-admin/src/API/Reports/DataStoreInterface.php000064400000000621151335517650017241 0ustar00<?php
/**
 * Reports Data Store Interface
 */

namespace Automattic\WooCommerce\Admin\API\Reports;

if ( ! defined( 'ABSPATH' ) ) {
	exit;
}

/**
 * WooCommerce Reports data store interface.
 *
 * @since 3.5.0
 */
interface DataStoreInterface {

	/**
	 * Get the data based on args.
	 *
	 * @param array $args Query parameters.
	 * @return stdClass|WP_Error
	 */
	public function get_data( $args );
}
woocommerce-admin/src/API/Reports/Query.php000064400000001121151335517650014633 0ustar00<?php
/**
 * Class for parameter-based Reports querying
 */

namespace Automattic\WooCommerce\Admin\API\Reports;

defined( 'ABSPATH' ) || exit;

/**
 * Admin\API\Reports\Query
 */
abstract class Query extends \WC_Object_Query {

	/**
	 * Get report data matching the current query vars.
	 *
	 * @return array|object of WC_Product objects
	 */
	public function get_data() {
		/* translators: %s: Method name */
		return new \WP_Error( 'invalid-method', sprintf( __( "Method '%s' not implemented. Must be overridden in subclass.", 'woocommerce' ), __METHOD__ ), array( 'status' => 405 ) );
	}
}
woocommerce-admin/src/API/Reports/ExportableTraits.php000064400000001160151335517650017025 0ustar00<?php
/**
 * REST API Reports exportable traits
 *
 * Collection of utility methods for exportable reports.
 */

namespace Automattic\WooCommerce\Admin\API\Reports;

defined( 'ABSPATH' ) || exit;

/**
 * ExportableTraits class.
 */
trait ExportableTraits {
	/**
	 * Format numbers for CSV using store precision setting.
	 *
	 * @param string|float $value Numeric value.
	 * @return string Formatted value.
	 */
	public static function csv_number_format( $value ) {
		$decimals = wc_get_price_decimals();
		// See: @woocommerce/currency: getCurrencyFormatDecimal().
		return number_format( $value, $decimals, '.', '' );
	}
}
woocommerce-admin/src/API/Reports/Revenue/Stats/Controller.php000064400000036111151335517650020367 0ustar00<?php
/**
 * REST API Reports revenue stats controller
 *
 * Handles requests to the /reports/revenue/stats endpoint.
 */

namespace Automattic\WooCommerce\Admin\API\Reports\Revenue\Stats;

defined( 'ABSPATH' ) || exit;

use \Automattic\WooCommerce\Admin\API\Reports\Revenue\Query as RevenueQuery;
use \Automattic\WooCommerce\Admin\API\Reports\ExportableInterface;
use \Automattic\WooCommerce\Admin\API\Reports\ExportableTraits;
use \Automattic\WooCommerce\Admin\API\Reports\ParameterException;

/**
 * REST API Reports revenue stats controller class.
 *
 * @extends WC_REST_Reports_Controller
 */
class Controller extends \WC_REST_Reports_Controller implements ExportableInterface {
	/**
	 * Exportable traits.
	 */
	use ExportableTraits;

	/**
	 * Endpoint namespace.
	 *
	 * @var string
	 */
	protected $namespace = 'wc-analytics';

	/**
	 * Route base.
	 *
	 * @var string
	 */
	protected $rest_base = 'reports/revenue/stats';

	/**
	 * Maps query arguments from the REST request.
	 *
	 * @param array $request Request array.
	 * @return array
	 */
	protected function prepare_reports_query( $request ) {
		$args              = array();
		$args['before']    = $request['before'];
		$args['after']     = $request['after'];
		$args['interval']  = $request['interval'];
		$args['page']      = $request['page'];
		$args['per_page']  = $request['per_page'];
		$args['orderby']   = $request['orderby'];
		$args['order']     = $request['order'];
		$args['segmentby'] = $request['segmentby'];
		$args['fields']    = $request['fields'];

		return $args;
	}

	/**
	 * Get all reports.
	 *
	 * @param WP_REST_Request $request Request data.
	 * @return WP_REST_Response|WP_Error
	 */
	public function get_items( $request ) {
		$query_args      = $this->prepare_reports_query( $request );
		$reports_revenue = new RevenueQuery( $query_args );
		try {
			$report_data = $reports_revenue->get_data();
		} catch ( ParameterException $e ) {
			return new \WP_Error( $e->getErrorCode(), $e->getMessage(), array( 'status' => $e->getCode() ) );
		}

		$out_data = array(
			'totals'    => get_object_vars( $report_data->totals ),
			'intervals' => array(),
		);

		foreach ( $report_data->intervals as $interval_data ) {
			$item                    = $this->prepare_item_for_response( $interval_data, $request );
			$out_data['intervals'][] = $this->prepare_response_for_collection( $item );
		}

		$response = rest_ensure_response( $out_data );
		$response->header( 'X-WP-Total', (int) $report_data->total );
		$response->header( 'X-WP-TotalPages', (int) $report_data->pages );

		$page      = $report_data->page_no;
		$max_pages = $report_data->pages;
		$base      = add_query_arg( $request->get_query_params(), rest_url( sprintf( '/%s/%s', $this->namespace, $this->rest_base ) ) );
		if ( $page > 1 ) {
			$prev_page = $page - 1;
			if ( $prev_page > $max_pages ) {
				$prev_page = $max_pages;
			}
			$prev_link = add_query_arg( 'page', $prev_page, $base );
			$response->link_header( 'prev', $prev_link );
		}
		if ( $max_pages > $page ) {
			$next_page = $page + 1;
			$next_link = add_query_arg( 'page', $next_page, $base );
			$response->link_header( 'next', $next_link );
		}

		return $response;
	}

	/**
	 * Get report items for export.
	 *
	 * Returns only the interval data.
	 *
	 * @param WP_REST_Request $request Request data.
	 * @return WP_REST_Response
	 */
	public function get_export_items( $request ) {
		$response  = $this->get_items( $request );
		$data      = $response->get_data();
		$intervals = $data['intervals'];

		$response->set_data( $intervals );

		return $response;
	}

	/**
	 * Prepare a report object for serialization.
	 *
	 * @param Array           $report  Report data.
	 * @param WP_REST_Request $request Request object.
	 * @return WP_REST_Response
	 */
	public function prepare_item_for_response( $report, $request ) {
		$data = $report;

		$context = ! empty( $request['context'] ) ? $request['context'] : 'view';
		$data    = $this->add_additional_fields_to_object( $data, $request );
		$data    = $this->filter_response_by_context( $data, $context );

		// Wrap the data in a response object.
		$response = rest_ensure_response( $data );

		/**
		 * Filter a report returned from the API.
		 *
		 * Allows modification of the report data right before it is returned.
		 *
		 * @param WP_REST_Response $response The response object.
		 * @param object           $report   The original report object.
		 * @param WP_REST_Request  $request  Request used to generate the response.
		 */
		return apply_filters( 'woocommerce_rest_prepare_report_revenue_stats', $response, $report, $request );
	}

	/**
	 * Get the Report's schema, conforming to JSON Schema.
	 *
	 * @return array
	 */
	public function get_item_schema() {
		$data_values = array(
			'total_sales'    => array(
				'description' => __( 'Total sales.', 'woocommerce' ),
				'type'        => 'number',
				'context'     => array( 'view', 'edit' ),
				'readonly'    => true,
				'indicator'   => true,
				'format'      => 'currency',
			),
			'net_revenue'    => array(
				'description' => __( 'Net sales.', 'woocommerce' ),
				'type'        => 'number',
				'context'     => array( 'view', 'edit' ),
				'readonly'    => true,
				'indicator'   => true,
				'format'      => 'currency',
			),
			'coupons'        => array(
				'description' => __( 'Amount discounted by coupons.', 'woocommerce' ),
				'type'        => 'number',
				'context'     => array( 'view', 'edit' ),
				'readonly'    => true,
			),
			'coupons_count'  => array(
				'description' => __( 'Unique coupons count.', 'woocommerce' ),
				'type'        => 'number',
				'context'     => array( 'view', 'edit' ),
				'readonly'    => true,
				'format'      => 'currency',
			),
			'shipping'       => array(
				'title'       => __( 'Shipping', 'woocommerce' ),
				'description' => __( 'Total of shipping.', 'woocommerce' ),
				'type'        => 'number',
				'context'     => array( 'view', 'edit' ),
				'readonly'    => true,
				'indicator'   => true,
				'format'      => 'currency',
			),
			'taxes'          => array(
				'description' => __( 'Total of taxes.', 'woocommerce' ),
				'type'        => 'number',
				'context'     => array( 'view', 'edit' ),
				'readonly'    => true,
				'format'      => 'currency',
			),
			'refunds'        => array(
				'title'       => __( 'Returns', 'woocommerce' ),
				'description' => __( 'Total of returns.', 'woocommerce' ),
				'type'        => 'number',
				'context'     => array( 'view', 'edit' ),
				'readonly'    => true,
				'indicator'   => true,
				'format'      => 'currency',
			),
			'orders_count'   => array(
				'description' => __( 'Number of orders.', 'woocommerce' ),
				'type'        => 'integer',
				'context'     => array( 'view', 'edit' ),
				'readonly'    => true,
			),
			'num_items_sold' => array(
				'description' => __( 'Items sold.', 'woocommerce' ),
				'type'        => 'integer',
				'context'     => array( 'view', 'edit' ),
				'readonly'    => true,
			),
			'products'       => array(
				'description' => __( 'Products sold.', 'woocommerce' ),
				'type'        => 'integer',
				'context'     => array( 'view', 'edit' ),
				'readonly'    => true,
			),
			'gross_sales'    => array(
				'description' => __( 'Gross sales.', 'woocommerce' ),
				'type'        => 'number',
				'context'     => array( 'view', 'edit' ),
				'readonly'    => true,
				'indicator'   => true,
				'format'      => 'currency',
			),
		);

		$segments = array(
			'segments' => array(
				'description' => __( 'Reports data grouped by segment condition.', 'woocommerce' ),
				'type'        => 'array',
				'context'     => array( 'view', 'edit' ),
				'readonly'    => true,
				'items'       => array(
					'type'       => 'object',
					'properties' => array(
						'segment_id' => array(
							'description' => __( 'Segment identificator.', 'woocommerce' ),
							'type'        => 'integer',
							'context'     => array( 'view', 'edit' ),
							'readonly'    => true,
						),
						'subtotals'  => array(
							'description' => __( 'Interval subtotals.', 'woocommerce' ),
							'type'        => 'object',
							'context'     => array( 'view', 'edit' ),
							'readonly'    => true,
							'properties'  => $data_values,
						),
					),
				),
			),
		);

		$totals = array_merge( $data_values, $segments );

		// Products is not shown in intervals.
		unset( $data_values['products'] );

		$intervals = array_merge( $data_values, $segments );

		$schema = array(
			'$schema'    => 'http://json-schema.org/draft-04/schema#',
			'title'      => 'report_revenue_stats',
			'type'       => 'object',
			'properties' => array(
				'totals'    => array(
					'description' => __( 'Totals data.', 'woocommerce' ),
					'type'        => 'object',
					'context'     => array( 'view', 'edit' ),
					'readonly'    => true,
					'properties'  => $totals,
				),
				'intervals' => array(
					'description' => __( 'Reports data grouped by intervals.', 'woocommerce' ),
					'type'        => 'array',
					'context'     => array( 'view', 'edit' ),
					'readonly'    => true,
					'items'       => array(
						'type'       => 'object',
						'properties' => array(
							'interval'       => array(
								'description' => __( 'Type of interval.', 'woocommerce' ),
								'type'        => 'string',
								'context'     => array( 'view', 'edit' ),
								'readonly'    => true,
								'enum'        => array( 'day', 'week', 'month', 'year' ),
							),
							'date_start'     => array(
								'description' => __( "The date the report start, in the site's timezone.", 'woocommerce' ),
								'type'        => 'date-time',
								'context'     => array( 'view', 'edit' ),
								'readonly'    => true,
							),
							'date_start_gmt' => array(
								'description' => __( 'The date the report start, as GMT.', 'woocommerce' ),
								'type'        => 'date-time',
								'context'     => array( 'view', 'edit' ),
								'readonly'    => true,
							),
							'date_end'       => array(
								'description' => __( "The date the report end, in the site's timezone.", 'woocommerce' ),
								'type'        => 'date-time',
								'context'     => array( 'view', 'edit' ),
								'readonly'    => true,
							),
							'date_end_gmt'   => array(
								'description' => __( 'The date the report end, as GMT.', 'woocommerce' ),
								'type'        => 'date-time',
								'context'     => array( 'view', 'edit' ),
								'readonly'    => true,
							),
							'subtotals'      => array(
								'description' => __( 'Interval subtotals.', 'woocommerce' ),
								'type'        => 'object',
								'context'     => array( 'view', 'edit' ),
								'readonly'    => true,
								'properties'  => $intervals,
							),
						),
					),
				),
			),
		);

		return $this->add_additional_fields_schema( $schema );
	}

	/**
	 * Get the query params for collections.
	 *
	 * @return array
	 */
	public function get_collection_params() {
		$params              = array();
		$params['context']   = $this->get_context_param( array( 'default' => 'view' ) );
		$params['page']      = array(
			'description'       => __( 'Current page of the collection.', 'woocommerce' ),
			'type'              => 'integer',
			'default'           => 1,
			'sanitize_callback' => 'absint',
			'validate_callback' => 'rest_validate_request_arg',
			'minimum'           => 1,
		);
		$params['per_page']  = array(
			'description'       => __( 'Maximum number of items to be returned in result set.', 'woocommerce' ),
			'type'              => 'integer',
			'default'           => 10,
			'minimum'           => 1,
			'maximum'           => 100,
			'sanitize_callback' => 'absint',
			'validate_callback' => 'rest_validate_request_arg',
		);
		$params['after']     = array(
			'description'       => __( 'Limit response to resources published after a given ISO8601 compliant date.', 'woocommerce' ),
			'type'              => 'string',
			'format'            => 'date-time',
			'validate_callback' => 'rest_validate_request_arg',
		);
		$params['before']    = array(
			'description'       => __( 'Limit response to resources published before a given ISO8601 compliant date.', 'woocommerce' ),
			'type'              => 'string',
			'format'            => 'date-time',
			'validate_callback' => 'rest_validate_request_arg',
		);
		$params['order']     = array(
			'description'       => __( 'Order sort attribute ascending or descending.', 'woocommerce' ),
			'type'              => 'string',
			'default'           => 'desc',
			'enum'              => array( 'asc', 'desc' ),
			'validate_callback' => 'rest_validate_request_arg',
		);
		$params['orderby']   = array(
			'description'       => __( 'Sort collection by object attribute.', 'woocommerce' ),
			'type'              => 'string',
			'default'           => 'date',
			'enum'              => array(
				'date',
				'total_sales',
				'coupons',
				'refunds',
				'shipping',
				'taxes',
				'net_revenue',
				'orders_count',
				'items_sold',
				'gross_sales',
			),
			'validate_callback' => 'rest_validate_request_arg',
		);
		$params['interval']  = array(
			'description'       => __( 'Time interval to use for buckets in the returned data.', 'woocommerce' ),
			'type'              => 'string',
			'default'           => 'week',
			'enum'              => array(
				'hour',
				'day',
				'week',
				'month',
				'quarter',
				'year',
			),
			'validate_callback' => 'rest_validate_request_arg',
		);
		$params['segmentby'] = array(
			'description'       => __( 'Segment the response by additional constraint.', 'woocommerce' ),
			'type'              => 'string',
			'enum'              => array(
				'product',
				'category',
				'variation',
				'coupon',
				'customer_type', // new vs returning.
			),
			'validate_callback' => 'rest_validate_request_arg',
		);

		return $params;
	}

	/**
	 * Get the column names for export.
	 *
	 * @return array Key value pair of Column ID => Label.
	 */
	public function get_export_columns() {
		return array(
			'date'         => __( 'Date', 'woocommerce' ),
			'orders_count' => __( 'Orders', 'woocommerce' ),
			'gross_sales'  => __( 'Gross sales', 'woocommerce' ),
			'total_sales'  => __( 'Total sales', 'woocommerce' ),
			'refunds'      => __( 'Returns', 'woocommerce' ),
			'coupons'      => __( 'Coupons', 'woocommerce' ),
			'taxes'        => __( 'Taxes', 'woocommerce' ),
			'shipping'     => __( 'Shipping', 'woocommerce' ),
			'net_revenue'  => __( 'Net Revenue', 'woocommerce' ),
		);
	}

	/**
	 * Get the column values for export.
	 *
	 * @param array $item Single report item/row.
	 * @return array Key value pair of Column ID => Row Value.
	 */
	public function prepare_item_for_export( $item ) {
		$subtotals = (array) $item['subtotals'];

		return array(
			'date'         => $item['date_start'],
			'orders_count' => $subtotals['orders_count'],
			'gross_sales'  => self::csv_number_format( $subtotals['gross_sales'] ),
			'total_sales'  => self::csv_number_format( $subtotals['total_sales'] ),
			'refunds'      => self::csv_number_format( $subtotals['refunds'] ),
			'coupons'      => self::csv_number_format( $subtotals['coupons'] ),
			'taxes'        => self::csv_number_format( $subtotals['taxes'] ),
			'shipping'     => self::csv_number_format( $subtotals['shipping'] ),
			'net_revenue'  => self::csv_number_format( $subtotals['net_revenue'] ),
		);
	}
}
woocommerce-admin/src/API/Reports/Revenue/Query.php000064400000003100151335517650016243 0ustar00<?php
/**
 * Class for parameter-based Revenue Reports querying
 *
 * Example usage:
 * $args = array(
 *          'before' => '2018-07-19 00:00:00',
 *          'after'  => '2018-07-05 00:00:00',
 *          'interval' => 'week',
 *         );
 * $report = new \Automattic\WooCommerce\Admin\API\Reports\Revenue\Query( $args );
 * $mydata = $report->get_data();
 */

namespace Automattic\WooCommerce\Admin\API\Reports\Revenue;

defined( 'ABSPATH' ) || exit;

use \Automattic\WooCommerce\Admin\API\Reports\Query as ReportsQuery;

/**
 * API\Reports\Revenue\Query
 */
class Query extends ReportsQuery {

	/**
	 * Valid fields for Revenue report.
	 *
	 * @return array
	 */
	protected function get_default_query_vars() {
		return array(
			'per_page' => get_option( 'posts_per_page' ), // not sure if this should be the default.
			'page'     => 1,
			'order'    => 'DESC',
			'orderby'  => 'date',
			'before'   => '',
			'after'    => '',
			'interval' => 'week',
			'fields'   => array(
				'orders_count',
				'num_items_sold',
				'total_sales',
				'coupons',
				'coupons_count',
				'refunds',
				'taxes',
				'shipping',
				'net_revenue',
				'gross_sales',
			),
		);
	}

	/**
	 * Get revenue data based on the current query vars.
	 *
	 * @return array
	 */
	public function get_data() {
		$args = apply_filters( 'woocommerce_analytics_revenue_query_args', $this->get_query_vars() );

		$data_store = \WC_Data_Store::load( 'report-revenue-stats' );
		$results    = $data_store->get_data( $args );
		return apply_filters( 'woocommerce_analytics_revenue_select_query', $results, $args );
	}
}
woocommerce-admin/src/API/Reports/Taxes/Stats/Segmenter.php000064400000013032151335517650017645 0ustar00<?php
/**
 * Class for adding segmenting support without cluttering the data stores.
 */

namespace Automattic\WooCommerce\Admin\API\Reports\Taxes\Stats;

defined( 'ABSPATH' ) || exit;

use \Automattic\WooCommerce\Admin\API\Reports\Segmenter as ReportsSegmenter;

/**
 * Date & time interval and numeric range handling class for Reporting API.
 */
class Segmenter extends ReportsSegmenter {

	/**
	 * Returns column => query mapping to be used for order-related order-level segmenting query (e.g. tax_rate_id).
	 *
	 * @param string $lookup_table Name of SQL table containing the order-level segmenting info.
	 *
	 * @return array Column => SELECT query mapping.
	 */
	protected function get_segment_selections_order_level( $lookup_table ) {
		$columns_mapping = array(
			'tax_codes'    => "COUNT(DISTINCT $lookup_table.tax_rate_id) as tax_codes",
			'total_tax'    => "SUM($lookup_table.total_tax) AS total_tax",
			'order_tax'    => "SUM($lookup_table.order_tax) as order_tax",
			'shipping_tax' => "SUM($lookup_table.shipping_tax) as shipping_tax",
			'orders_count' => "COUNT(DISTINCT $lookup_table.order_id) as orders_count",
		);

		return $columns_mapping;
	}

	/**
	 * Calculate segments for totals query where the segmenting property is bound to order (e.g. coupon or customer type).
	 *
	 * @param string $segmenting_select SELECT part of segmenting SQL query.
	 * @param string $segmenting_from FROM part of segmenting SQL query.
	 * @param string $segmenting_where WHERE part of segmenting SQL query.
	 * @param string $segmenting_groupby GROUP BY part of segmenting SQL query.
	 * @param string $table_name Name of SQL table which is the stats table for orders.
	 * @param array  $totals_query Array of SQL clauses for intervals query.
	 *
	 * @return array
	 */
	protected function get_order_related_totals_segments( $segmenting_select, $segmenting_from, $segmenting_where, $segmenting_groupby, $table_name, $totals_query ) {
		global $wpdb;

		$totals_segments = $wpdb->get_results(
			"SELECT
						$segmenting_groupby
						$segmenting_select
					FROM
						$table_name
						$segmenting_from
						{$totals_query['from_clause']}
					WHERE
						1=1
						{$totals_query['where_time_clause']}
						{$totals_query['where_clause']}
						$segmenting_where
					GROUP BY
						$segmenting_groupby",
			ARRAY_A
		); // WPCS: cache ok, DB call ok, unprepared SQL ok.

		// Reformat result.
		$totals_segments = $this->reformat_totals_segments( $totals_segments, $segmenting_groupby );
		return $totals_segments;
	}

	/**
	 * Calculate segments for intervals query where the segmenting property is bound to order (e.g. coupon or customer type).
	 *
	 * @param string $segmenting_select SELECT part of segmenting SQL query.
	 * @param string $segmenting_from FROM part of segmenting SQL query.
	 * @param string $segmenting_where WHERE part of segmenting SQL query.
	 * @param string $segmenting_groupby GROUP BY part of segmenting SQL query.
	 * @param string $table_name Name of SQL table which is the stats table for orders.
	 * @param array  $intervals_query Array of SQL clauses for intervals query.
	 *
	 * @return array
	 */
	protected function get_order_related_intervals_segments( $segmenting_select, $segmenting_from, $segmenting_where, $segmenting_groupby, $table_name, $intervals_query ) {
		global $wpdb;
		$segmenting_limit = '';
		$limit_parts      = explode( ',', $intervals_query['limit'] );
		if ( 2 === count( $limit_parts ) ) {
			$orig_rowcount    = intval( $limit_parts[1] );
			$segmenting_limit = $limit_parts[0] . ',' . $orig_rowcount * count( $this->get_all_segments() );
		}

		$intervals_segments = $wpdb->get_results(
			"SELECT
						MAX($table_name.date_created) AS datetime_anchor,
						{$intervals_query['select_clause']} AS time_interval,
						$segmenting_groupby
						$segmenting_select
					FROM
						$table_name
						$segmenting_from
						{$intervals_query['from_clause']}
					WHERE
						1=1
						{$intervals_query['where_time_clause']}
						{$intervals_query['where_clause']}
						$segmenting_where
					GROUP BY
						time_interval, $segmenting_groupby
					$segmenting_limit",
			ARRAY_A
		); // WPCS: cache ok, DB call ok, unprepared SQL ok.

		// Reformat result.
		$intervals_segments = $this->reformat_intervals_segments( $intervals_segments, $segmenting_groupby );
		return $intervals_segments;
	}

	/**
	 * Return array of segments formatted for REST response.
	 *
	 * @param string $type Type of segments to return--'totals' or 'intervals'.
	 * @param array  $query_params SQL query parameter array.
	 * @param string $table_name Name of main SQL table for the data store (used as basis for JOINS).
	 *
	 * @return array
	 * @throws \Automattic\WooCommerce\Admin\API\Reports\ParameterException In case of segmenting by variations, when no parent product is specified.
	 */
	protected function get_segments( $type, $query_params, $table_name ) {
		if ( ! isset( $this->query_args['segmentby'] ) || '' === $this->query_args['segmentby'] ) {
			return array();
		}

		$segmenting_where = '';
		$segmenting_from  = '';
		$segments         = array();

		if ( 'tax_rate_id' === $this->query_args['segmentby'] ) {
			$tax_rate_level_columns = $this->get_segment_selections_order_level( $table_name );
			$segmenting_select      = $this->prepare_selections( $tax_rate_level_columns );
			$this->report_columns   = $tax_rate_level_columns;
			$segmenting_groupby     = $table_name . '.tax_rate_id';

			$segments = $this->get_order_related_segments( $type, $segmenting_select, $segmenting_from, $segmenting_where, $segmenting_groupby, $table_name, $query_params );
		}

		return $segments;
	}
}
woocommerce-admin/src/API/Reports/Taxes/Stats/Query.php000064400000002377151335517650017033 0ustar00<?php
/**
 * Class for parameter-based Taxes Stats Report querying
 *
 * Example usage:
 * $args = array(
 *          'before'       => '2018-07-19 00:00:00',
 *          'after'        => '2018-07-05 00:00:00',
 *          'page'         => 2,
 *          'categories'   => array(15, 18),
 *          'product_ids'  => array(1,2,3)
 *         );
 * $report = new \Automattic\WooCommerce\Admin\API\Reports\Taxes\Stats\Query( $args );
 * $mydata = $report->get_data();
 */

namespace Automattic\WooCommerce\Admin\API\Reports\Taxes\Stats;

defined( 'ABSPATH' ) || exit;

use \Automattic\WooCommerce\Admin\API\Reports\Query as ReportsQuery;

/**
 * API\Reports\Taxes\Stats\Query
 */
class Query extends ReportsQuery {

	/**
	 * Valid fields for Taxes report.
	 *
	 * @return array
	 */
	protected function get_default_query_vars() {
		return array();
	}

	/**
	 * Get tax stats data based on the current query vars.
	 *
	 * @return array
	 */
	public function get_data() {
		$args = apply_filters( 'woocommerce_analytics_taxes_stats_query_args', $this->get_query_vars() );

		$data_store = \WC_Data_Store::load( 'report-taxes-stats' );
		$results    = $data_store->get_data( $args );
		return apply_filters( 'woocommerce_analytics_taxes_stats_select_query', $results, $args );
	}
}
woocommerce-admin/src/API/Reports/Taxes/Stats/DataStore.php000064400000023075151335517650017612 0ustar00<?php
/**
 * API\Reports\Taxes\Stats\DataStore class file.
 */

namespace Automattic\WooCommerce\Admin\API\Reports\Taxes\Stats;

defined( 'ABSPATH' ) || exit;

use \Automattic\WooCommerce\Admin\API\Reports\DataStore as ReportsDataStore;
use \Automattic\WooCommerce\Admin\API\Reports\DataStoreInterface;
use \Automattic\WooCommerce\Admin\API\Reports\TimeInterval;
use \Automattic\WooCommerce\Admin\API\Reports\SqlQuery;

/**
 * API\Reports\Taxes\Stats\DataStore.
 */
class DataStore extends ReportsDataStore implements DataStoreInterface {

	/**
	 * Table used to get the data.
	 *
	 * @var string
	 */
	protected static $table_name = 'wc_order_tax_lookup';

	/**
	 * Cache identifier.
	 *
	 * @var string
	 */
	protected $cache_key = 'taxes_stats';

	/**
	 * Mapping columns to data type to return correct response types.
	 *
	 * @var array
	 */
	protected $column_types = array(
		'tax_codes'    => 'intval',
		'total_tax'    => 'floatval',
		'order_tax'    => 'floatval',
		'shipping_tax' => 'floatval',
		'orders_count' => 'intval',
	);

	/**
	 * Data store context used to pass to filters.
	 *
	 * @var string
	 */
	protected $context = 'taxes_stats';

	/**
	 * Assign report columns once full table name has been assigned.
	 */
	protected function assign_report_columns() {
		$table_name           = self::get_db_table_name();
		$this->report_columns = array(
			'tax_codes'    => 'COUNT(DISTINCT tax_rate_id) as tax_codes',
			'total_tax'    => 'SUM(total_tax) AS total_tax',
			'order_tax'    => 'SUM(order_tax) as order_tax',
			'shipping_tax' => 'SUM(shipping_tax) as shipping_tax',
			'orders_count' => "COUNT( DISTINCT ( CASE WHEN parent_id = 0 THEN {$table_name}.order_id END ) ) as orders_count",
		);
	}

	/**
	 * Updates the database query with parameters used for Taxes Stats report
	 *
	 * @param array $query_args       Query arguments supplied by the user.
	 */
	protected function update_sql_query_params( $query_args ) {
		$taxes_where_clause     = '';
		$order_tax_lookup_table = self::get_db_table_name();

		if ( isset( $query_args['taxes'] ) && ! empty( $query_args['taxes'] ) ) {
			$allowed_taxes       = implode( ',', $query_args['taxes'] );
			$taxes_where_clause .= " AND {$order_tax_lookup_table}.tax_rate_id IN ({$allowed_taxes})";
		}

		$order_status_filter = $this->get_status_subquery( $query_args );
		if ( $order_status_filter ) {
			$taxes_where_clause .= " AND ( {$order_status_filter} )";
		}

		$this->add_time_period_sql_params( $query_args, $order_tax_lookup_table );
		$this->total_query->add_sql_clause( 'where', $taxes_where_clause );

		$this->add_intervals_sql_params( $query_args, $order_tax_lookup_table );
		$this->interval_query->add_sql_clause( 'where', $taxes_where_clause );
		$this->interval_query->add_sql_clause( 'select', $this->get_sql_clause( 'select' ) . ' AS time_interval' );
		$this->interval_query->add_sql_clause( 'where_time', $this->get_sql_clause( 'where_time' ) );
	}

	/**
	 * Get taxes associated with a store.
	 *
	 * @param array $args Array of args to filter the query by. Supports `include`.
	 * @return array An array of all taxes.
	 */
	public static function get_taxes( $args ) {
		global $wpdb;
		$query = "
			SELECT 
				tax_rate_id, 
				tax_rate_country, 
				tax_rate_state, 
				tax_rate_name, 
				tax_rate_priority 
			FROM {$wpdb->prefix}woocommerce_tax_rates
		";
		if ( ! empty( $args['include'] ) ) {
			$included_taxes = implode( ',', $args['include'] );
			$query         .= " WHERE tax_rate_id IN ({$included_taxes})";
		}
		return $wpdb->get_results( $query, ARRAY_A ); // WPCS: cache ok, DB call ok, unprepared SQL ok.
	}

	/**
	 * Returns the report data based on parameters supplied by the user.
	 *
	 * @param array $query_args  Query parameters.
	 * @return stdClass|WP_Error Data.
	 */
	public function get_data( $query_args ) {
		global $wpdb;

		$table_name = self::get_db_table_name();

		// These defaults are only partially applied when used via REST API, as that has its own defaults.
		$defaults   = array(
			'per_page' => get_option( 'posts_per_page' ),
			'page'     => 1,
			'order'    => 'DESC',
			'orderby'  => 'tax_rate_id',
			'before'   => TimeInterval::default_before(),
			'after'    => TimeInterval::default_after(),
			'fields'   => '*',
			'taxes'    => array(),
		);
		$query_args = wp_parse_args( $query_args, $defaults );
		$this->normalize_timezones( $query_args, $defaults );

		/*
		 * We need to get the cache key here because
		 * parent::update_intervals_sql_params() modifies $query_args.
		 */
		$cache_key = $this->get_cache_key( $query_args );
		$data      = $this->get_cached_data( $cache_key );

		if ( false === $data ) {
			$this->initialize_queries();

			$data = (object) array(
				'totals'    => (object) array(),
				'intervals' => (object) array(),
				'total'     => 0,
				'pages'     => 0,
				'page_no'   => 0,
			);

			$selections       = $this->selected_columns( $query_args );
			$params           = $this->get_limit_params( $query_args );
			$order_stats_join = "JOIN {$wpdb->prefix}wc_order_stats ON {$table_name}.order_id = {$wpdb->prefix}wc_order_stats.order_id";
			$this->update_sql_query_params( $query_args );
			$this->interval_query->add_sql_clause( 'join', $order_stats_join );

			$db_intervals            = $wpdb->get_col(
				$this->interval_query->get_query_statement()
			); // WPCS: cache ok, DB call ok, unprepared SQL ok.
			$db_interval_count       = count( $db_intervals );
			$expected_interval_count = TimeInterval::intervals_between( $query_args['after'], $query_args['before'], $query_args['interval'] );
			$total_pages             = (int) ceil( $expected_interval_count / $params['per_page'] );

			if ( $query_args['page'] < 1 || $query_args['page'] > $total_pages ) {
				return $data;
			}
			$this->total_query->add_sql_clause( 'select', $selections );
			$this->total_query->add_sql_clause( 'join', $order_stats_join );
			$this->total_query->add_sql_clause( 'where_time', $this->get_sql_clause( 'where_time' ) );

			$totals = $wpdb->get_results(
				$this->total_query->get_query_statement(),
				ARRAY_A
			); // WPCS: cache ok, DB call ok, unprepared SQL ok.

			if ( null === $totals ) {
				return new \WP_Error( 'woocommerce_analytics_taxes_stats_result_failed', __( 'Sorry, fetching revenue data failed.', 'woocommerce' ) );
			}

			// @todo remove these assignements when refactoring segmenter classes to use query objects.
			$totals_query          = array(
				'from_clause'       => $this->total_query->get_sql_clause( 'join' ),
				'where_time_clause' => $this->total_query->get_sql_clause( 'where_time' ),
				'where_clause'      => $this->total_query->get_sql_clause( 'where' ),
			);
			$intervals_query       = array(
				'select_clause'     => $this->get_sql_clause( 'select' ),
				'from_clause'       => $this->interval_query->get_sql_clause( 'join' ),
				'where_time_clause' => $this->interval_query->get_sql_clause( 'where_time' ),
				'where_clause'      => $this->interval_query->get_sql_clause( 'where' ),
			);
			$segmenter             = new Segmenter( $query_args, $this->report_columns );
			$totals[0]['segments'] = $segmenter->get_totals_segments( $totals_query, $table_name );

			$this->update_intervals_sql_params( $query_args, $db_interval_count, $expected_interval_count, $table_name );

			if ( '' !== $selections ) {
				$this->interval_query->add_sql_clause( 'select', ', ' . $selections );
			}

			$this->interval_query->add_sql_clause( 'select', ", MAX({$table_name}.date_created) AS datetime_anchor" );
			$this->interval_query->add_sql_clause( 'order_by', $this->get_sql_clause( 'order_by' ) );
			$this->interval_query->add_sql_clause( 'limit', $this->get_sql_clause( 'limit' ) );

			$intervals = $wpdb->get_results(
				$this->interval_query->get_query_statement(),
				ARRAY_A
			); // WPCS: cache ok, DB call ok, unprepared SQL ok.

			if ( null === $intervals ) {
				return new \WP_Error( 'woocommerce_analytics_taxes_stats_result_failed', __( 'Sorry, fetching tax data failed.', 'woocommerce' ) );
			}

			$totals = (object) $this->cast_numbers( $totals[0] );

			$data = (object) array(
				'totals'    => $totals,
				'intervals' => $intervals,
				'total'     => $expected_interval_count,
				'pages'     => $total_pages,
				'page_no'   => (int) $query_args['page'],
			);

			if ( TimeInterval::intervals_missing( $expected_interval_count, $db_interval_count, $params['per_page'], $query_args['page'], $query_args['order'], $query_args['orderby'], count( $intervals ) ) ) {
				$this->fill_in_missing_intervals( $db_intervals, $query_args['adj_after'], $query_args['adj_before'], $query_args['interval'], $data );
				$this->sort_intervals( $data, $query_args['orderby'], $query_args['order'] );
				$this->remove_extra_records( $data, $query_args['page'], $params['per_page'], $db_interval_count, $expected_interval_count, $query_args['orderby'], $query_args['order'] );
			} else {
				$this->update_interval_boundary_dates( $query_args['after'], $query_args['before'], $query_args['interval'], $data->intervals );
			}
			$segmenter->add_intervals_segments( $data, $intervals_query, $table_name );
			$this->create_interval_subtotals( $data->intervals );
			$this->set_cached_data( $cache_key, $data );
		}
		return $data;
	}

	/**
	 * Initialize query objects.
	 */
	protected function initialize_queries() {
		$this->clear_all_clauses();
		unset( $this->subquery );
		$this->total_query = new SqlQuery( $this->context . '_total' );
		$this->total_query->add_sql_clause( 'from', self::get_db_table_name() );

		$this->interval_query = new SqlQuery( $this->context . '_interval' );
		$this->interval_query->add_sql_clause( 'from', self::get_db_table_name() );
		$this->interval_query->add_sql_clause( 'group_by', 'time_interval' );
	}
}
woocommerce-admin/src/API/Reports/Taxes/Stats/Controller.php000064400000030766151335517650020054 0ustar00<?php
/**
 * REST API Reports taxes stats controller
 *
 * Handles requests to the /reports/taxes/stats endpoint.
 */

namespace Automattic\WooCommerce\Admin\API\Reports\Taxes\Stats;

defined( 'ABSPATH' ) || exit;

/**
 * REST API Reports taxes stats controller class.
 *
 * @extends WC_REST_Reports_Controller
 */
class Controller extends \WC_REST_Reports_Controller {

	/**
	 * Endpoint namespace.
	 *
	 * @var string
	 */
	protected $namespace = 'wc-analytics';

	/**
	 * Route base.
	 *
	 * @var string
	 */
	protected $rest_base = 'reports/taxes/stats';

	/**
	 * Constructor.
	 */
	public function __construct() {
		add_filter( 'woocommerce_analytics_taxes_stats_select_query', array( $this, 'set_default_report_data' ) );
	}

	/**
	 * Set the default results to 0 if API returns an empty array
	 *
	 * @param Mixed $results Report data.
	 * @return object
	 */
	public function set_default_report_data( $results ) {
		if ( empty( $results ) ) {
			$results                       = new \stdClass();
			$results->total                = 0;
			$results->totals               = new \stdClass();
			$results->totals->tax_codes    = 0;
			$results->totals->total_tax    = 0;
			$results->totals->order_tax    = 0;
			$results->totals->shipping_tax = 0;
			$results->totals->orders       = 0;
			$results->intervals            = array();
			$results->pages                = 1;
			$results->page_no              = 1;
		}
		return $results;
	}

	/**
	 * Maps query arguments from the REST request.
	 *
	 * @param array $request Request array.
	 * @return array
	 */
	protected function prepare_reports_query( $request ) {
		$args              = array();
		$args['before']    = $request['before'];
		$args['after']     = $request['after'];
		$args['interval']  = $request['interval'];
		$args['page']      = $request['page'];
		$args['per_page']  = $request['per_page'];
		$args['orderby']   = $request['orderby'];
		$args['order']     = $request['order'];
		$args['taxes']     = (array) $request['taxes'];
		$args['segmentby'] = $request['segmentby'];
		$args['fields']    = $request['fields'];

		return $args;
	}

	/**
	 * Get all reports.
	 *
	 * @param WP_REST_Request $request Request data.
	 * @return array|WP_Error
	 */
	public function get_items( $request ) {
		$query_args  = $this->prepare_reports_query( $request );
		$taxes_query = new Query( $query_args );
		$report_data = $taxes_query->get_data();

		$out_data = array(
			'totals'    => get_object_vars( $report_data->totals ),
			'intervals' => array(),
		);

		foreach ( $report_data->intervals as $interval_data ) {
			$item                    = $this->prepare_item_for_response( (object) $interval_data, $request );
			$out_data['intervals'][] = $this->prepare_response_for_collection( $item );
		}

		$response = rest_ensure_response( $out_data );
		$response->header( 'X-WP-Total', (int) $report_data->total );
		$response->header( 'X-WP-TotalPages', (int) $report_data->pages );

		$page      = $report_data->page_no;
		$max_pages = $report_data->pages;
		$base      = add_query_arg( $request->get_query_params(), rest_url( sprintf( '/%s/%s', $this->namespace, $this->rest_base ) ) );
		if ( $page > 1 ) {
			$prev_page = $page - 1;
			if ( $prev_page > $max_pages ) {
				$prev_page = $max_pages;
			}
			$prev_link = add_query_arg( 'page', $prev_page, $base );
			$response->link_header( 'prev', $prev_link );
		}
		if ( $max_pages > $page ) {
			$next_page = $page + 1;
			$next_link = add_query_arg( 'page', $next_page, $base );
			$response->link_header( 'next', $next_link );
		}

		return $response;
	}

	/**
	 * Prepare a report object for serialization.
	 *
	 * @param stdClass        $report  Report data.
	 * @param WP_REST_Request $request Request object.
	 * @return WP_REST_Response
	 */
	public function prepare_item_for_response( $report, $request ) {
		$data = get_object_vars( $report );

		$context = ! empty( $request['context'] ) ? $request['context'] : 'view';
		$data    = $this->add_additional_fields_to_object( $data, $request );
		$data    = $this->filter_response_by_context( $data, $context );

		// Wrap the data in a response object.
		$response = rest_ensure_response( $data );

		/**
		 * Filter a report returned from the API.
		 *
		 * Allows modification of the report data right before it is returned.
		 *
		 * @param WP_REST_Response $response The response object.
		 * @param object           $report   The original report object.
		 * @param WP_REST_Request  $request  Request used to generate the response.
		 */
		return apply_filters( 'woocommerce_rest_prepare_report_taxes_stats', $response, $report, $request );
	}

	/**
	 * Get the Report's schema, conforming to JSON Schema.
	 *
	 * @return array
	 */
	public function get_item_schema() {
		$data_values = array(
			'total_tax'    => array(
				'description' => __( 'Total tax.', 'woocommerce' ),
				'type'        => 'number',
				'context'     => array( 'view', 'edit' ),
				'readonly'    => true,
				'indicator'   => true,
				'format'      => 'currency',
			),
			'order_tax'    => array(
				'description' => __( 'Order tax.', 'woocommerce' ),
				'type'        => 'number',
				'context'     => array( 'view', 'edit' ),
				'readonly'    => true,
				'indicator'   => true,
				'format'      => 'currency',
			),
			'shipping_tax' => array(
				'description' => __( 'Shipping tax.', 'woocommerce' ),
				'type'        => 'number',
				'context'     => array( 'view', 'edit' ),
				'readonly'    => true,
				'indicator'   => true,
				'format'      => 'currency',
			),
			'orders_count' => array(
				'description' => __( 'Number of orders.', 'woocommerce' ),
				'type'        => 'integer',
				'context'     => array( 'view', 'edit' ),
				'readonly'    => true,
			),
			'tax_codes'    => array(
				'description' => __( 'Amount of tax codes.', 'woocommerce' ),
				'type'        => 'integer',
				'context'     => array( 'view', 'edit' ),
				'readonly'    => true,
			),
		);

		$segments = array(
			'segments' => array(
				'description' => __( 'Reports data grouped by segment condition.', 'woocommerce' ),
				'type'        => 'array',
				'context'     => array( 'view', 'edit' ),
				'readonly'    => true,
				'items'       => array(
					'type'       => 'object',
					'properties' => array(
						'segment_id' => array(
							'description' => __( 'Segment identificator.', 'woocommerce' ),
							'type'        => 'integer',
							'context'     => array( 'view', 'edit' ),
							'readonly'    => true,
						),
						'subtotals'  => array(
							'description' => __( 'Interval subtotals.', 'woocommerce' ),
							'type'        => 'object',
							'context'     => array( 'view', 'edit' ),
							'readonly'    => true,
							'properties'  => $data_values,
						),
					),
				),
			),
		);

		$totals = array_merge( $data_values, $segments );

		$schema = array(
			'$schema'    => 'http://json-schema.org/draft-04/schema#',
			'title'      => 'report_taxes_stats',
			'type'       => 'object',
			'properties' => array(
				'totals'    => array(
					'description' => __( 'Totals data.', 'woocommerce' ),
					'type'        => 'object',
					'context'     => array( 'view', 'edit' ),
					'readonly'    => true,
					'properties'  => $totals,
				),
				'intervals' => array(
					'description' => __( 'Reports data grouped by intervals.', 'woocommerce' ),
					'type'        => 'array',
					'context'     => array( 'view', 'edit' ),
					'readonly'    => true,
					'items'       => array(
						'type'       => 'object',
						'properties' => array(
							'interval'       => array(
								'description' => __( 'Type of interval.', 'woocommerce' ),
								'type'        => 'string',
								'context'     => array( 'view', 'edit' ),
								'readonly'    => true,
								'enum'        => array( 'day', 'week', 'month', 'year' ),
							),
							'date_start'     => array(
								'description' => __( "The date the report start, in the site's timezone.", 'woocommerce' ),
								'type'        => 'date-time',
								'context'     => array( 'view', 'edit' ),
								'readonly'    => true,
							),
							'date_start_gmt' => array(
								'description' => __( 'The date the report start, as GMT.', 'woocommerce' ),
								'type'        => 'date-time',
								'context'     => array( 'view', 'edit' ),
								'readonly'    => true,
							),
							'date_end'       => array(
								'description' => __( "The date the report end, in the site's timezone.", 'woocommerce' ),
								'type'        => 'date-time',
								'context'     => array( 'view', 'edit' ),
								'readonly'    => true,
							),
							'date_end_gmt'   => array(
								'description' => __( 'The date the report end, as GMT.', 'woocommerce' ),
								'type'        => 'date-time',
								'context'     => array( 'view', 'edit' ),
								'readonly'    => true,
							),
							'subtotals'      => array(
								'description' => __( 'Interval subtotals.', 'woocommerce' ),
								'type'        => 'object',
								'context'     => array( 'view', 'edit' ),
								'readonly'    => true,
								'properties'  => $totals,
							),
						),
					),
				),
			),
		);

		return $this->add_additional_fields_schema( $schema );
	}

	/**
	 * Get the query params for collections.
	 *
	 * @return array
	 */
	public function get_collection_params() {
		$params              = array();
		$params['context']   = $this->get_context_param( array( 'default' => 'view' ) );
		$params['page']      = array(
			'description'       => __( 'Current page of the collection.', 'woocommerce' ),
			'type'              => 'integer',
			'default'           => 1,
			'sanitize_callback' => 'absint',
			'validate_callback' => 'rest_validate_request_arg',
			'minimum'           => 1,
		);
		$params['per_page']  = array(
			'description'       => __( 'Maximum number of items to be returned in result set.', 'woocommerce' ),
			'type'              => 'integer',
			'default'           => 10,
			'minimum'           => 1,
			'maximum'           => 100,
			'sanitize_callback' => 'absint',
			'validate_callback' => 'rest_validate_request_arg',
		);
		$params['after']     = array(
			'description'       => __( 'Limit response to resources published after a given ISO8601 compliant date.', 'woocommerce' ),
			'type'              => 'string',
			'format'            => 'date-time',
			'validate_callback' => 'rest_validate_request_arg',
		);
		$params['before']    = array(
			'description'       => __( 'Limit response to resources published before a given ISO8601 compliant date.', 'woocommerce' ),
			'type'              => 'string',
			'format'            => 'date-time',
			'validate_callback' => 'rest_validate_request_arg',
		);
		$params['order']     = array(
			'description'       => __( 'Order sort attribute ascending or descending.', 'woocommerce' ),
			'type'              => 'string',
			'default'           => 'desc',
			'enum'              => array( 'asc', 'desc' ),
			'validate_callback' => 'rest_validate_request_arg',
		);
		$params['orderby']   = array(
			'description'       => __( 'Sort collection by object attribute.', 'woocommerce' ),
			'type'              => 'string',
			'default'           => 'date',
			'enum'              => array(
				'date',
				'items_sold',
				'total_sales',
				'orders_count',
				'products_count',
			),
			'validate_callback' => 'rest_validate_request_arg',
		);
		$params['interval']  = array(
			'description'       => __( 'Time interval to use for buckets in the returned data.', 'woocommerce' ),
			'type'              => 'string',
			'default'           => 'week',
			'enum'              => array(
				'hour',
				'day',
				'week',
				'month',
				'quarter',
				'year',
			),
			'validate_callback' => 'rest_validate_request_arg',
		);
		$params['taxes']     = array(
			'description'       => __( 'Limit result set to all items that have the specified term assigned in the taxes taxonomy.', 'woocommerce' ),
			'type'              => 'array',
			'sanitize_callback' => 'wp_parse_id_list',
			'validate_callback' => 'rest_validate_request_arg',
			'items'             => array(
				'type' => 'integer',
			),
		);
		$params['segmentby'] = array(
			'description'       => __( 'Segment the response by additional constraint.', 'woocommerce' ),
			'type'              => 'string',
			'enum'              => array(
				'tax_rate_id',
			),
			'validate_callback' => 'rest_validate_request_arg',
		);
		$params['fields']    = array(
			'description'       => __( 'Limit stats fields to the specified items.', 'woocommerce' ),
			'type'              => 'array',
			'sanitize_callback' => 'wp_parse_slug_list',
			'validate_callback' => 'rest_validate_request_arg',
			'items'             => array(
				'type' => 'string',
			),
		);

		return $params;
	}
}
woocommerce-admin/src/API/Reports/Taxes/DataStore.php000064400000025753151335517650016521 0ustar00<?php
/**
 * API\Reports\Taxes\DataStore class file.
 */

namespace Automattic\WooCommerce\Admin\API\Reports\Taxes;

defined( 'ABSPATH' ) || exit;

use \Automattic\WooCommerce\Admin\API\Reports\DataStore as ReportsDataStore;
use \Automattic\WooCommerce\Admin\API\Reports\DataStoreInterface;
use \Automattic\WooCommerce\Admin\API\Reports\TimeInterval;
use \Automattic\WooCommerce\Admin\API\Reports\SqlQuery;
use \Automattic\WooCommerce\Admin\API\Reports\Cache as ReportsCache;

/**
 * API\Reports\Taxes\DataStore.
 */
class DataStore extends ReportsDataStore implements DataStoreInterface {

	/**
	 * Table used to get the data.
	 *
	 * @var string
	 */
	protected static $table_name = 'wc_order_tax_lookup';

	/**
	 * Cache identifier.
	 *
	 * @var string
	 */
	protected $cache_key = 'taxes';

	/**
	 * Mapping columns to data type to return correct response types.
	 *
	 * @var array
	 */
	protected $column_types = array(
		'tax_rate_id'  => 'intval',
		'name'         => 'strval',
		'tax_rate'     => 'floatval',
		'country'      => 'strval',
		'state'        => 'strval',
		'priority'     => 'intval',
		'total_tax'    => 'floatval',
		'order_tax'    => 'floatval',
		'shipping_tax' => 'floatval',
		'orders_count' => 'intval',
	);

	/**
	 * Data store context used to pass to filters.
	 *
	 * @var string
	 */
	protected $context = 'taxes';

	/**
	 * Assign report columns once full table name has been assigned.
	 */
	protected function assign_report_columns() {
		$table_name           = self::get_db_table_name();
		$this->report_columns = array(
			'tax_rate_id'  => "{$table_name}.tax_rate_id",
			'name'         => 'tax_rate_name as name',
			'tax_rate'     => 'tax_rate',
			'country'      => 'tax_rate_country as country',
			'state'        => 'tax_rate_state as state',
			'priority'     => 'tax_rate_priority as priority',
			'total_tax'    => 'SUM(total_tax) as total_tax',
			'order_tax'    => 'SUM(order_tax) as order_tax',
			'shipping_tax' => 'SUM(shipping_tax) as shipping_tax',
			'orders_count' => "COUNT( DISTINCT ( CASE WHEN total_tax >= 0 THEN {$table_name}.order_id END ) ) as orders_count",
		);
	}

	/**
	 * Set up all the hooks for maintaining and populating table data.
	 */
	public static function init() {
		add_action( 'woocommerce_analytics_delete_order_stats', array( __CLASS__, 'sync_on_order_delete' ), 15 );
	}

	/**
	 * Fills FROM clause of SQL request based on user supplied parameters.
	 *
	 * @param array  $query_args          Query arguments supplied by the user.
	 * @param string $order_status_filter Order status subquery.
	 */
	protected function add_from_sql_params( $query_args, $order_status_filter ) {
		global $wpdb;
		$table_name = self::get_db_table_name();

		if ( $order_status_filter ) {
			$this->subquery->add_sql_clause( 'join', "JOIN {$wpdb->prefix}wc_order_stats ON {$table_name}.order_id = {$wpdb->prefix}wc_order_stats.order_id" );
		}

		if ( isset( $query_args['taxes'] ) && ! empty( $query_args['taxes'] ) ) {
			$this->add_sql_clause( 'join', "JOIN {$wpdb->prefix}woocommerce_tax_rates ON default_results.tax_rate_id = {$wpdb->prefix}woocommerce_tax_rates.tax_rate_id" );
		} else {
			$this->subquery->add_sql_clause( 'join', "JOIN {$wpdb->prefix}woocommerce_tax_rates ON {$table_name}.tax_rate_id = {$wpdb->prefix}woocommerce_tax_rates.tax_rate_id" );
		}
	}

	/**
	 * Updates the database query with parameters used for Taxes report: categories and order status.
	 *
	 * @param array $query_args Query arguments supplied by the user.
	 */
	protected function add_sql_query_params( $query_args ) {
		global $wpdb;

		$order_tax_lookup_table = self::get_db_table_name();

		$this->add_time_period_sql_params( $query_args, $order_tax_lookup_table );
		$this->get_limit_sql_params( $query_args );
		$this->add_order_by_sql_params( $query_args );
		$order_status_filter = $this->get_status_subquery( $query_args );
		$this->add_from_sql_params( $query_args, $order_status_filter );

		if ( isset( $query_args['taxes'] ) && ! empty( $query_args['taxes'] ) ) {
			$allowed_taxes = self::get_filtered_ids( $query_args, 'taxes' );
			$this->subquery->add_sql_clause( 'where', "AND {$order_tax_lookup_table}.tax_rate_id IN ({$allowed_taxes})" );
		}

		if ( $order_status_filter ) {
			$this->subquery->add_sql_clause( 'where', "AND ( {$order_status_filter} )" );
		}
	}

	/**
	 * Returns the report data based on parameters supplied by the user.
	 *
	 * @param array $query_args  Query parameters.
	 * @return stdClass|WP_Error Data.
	 */
	public function get_data( $query_args ) {
		global $wpdb;

		$table_name = self::get_db_table_name();

		// These defaults are only partially applied when used via REST API, as that has its own defaults.
		$defaults   = array(
			'per_page' => get_option( 'posts_per_page' ),
			'page'     => 1,
			'order'    => 'DESC',
			'orderby'  => 'tax_rate_id',
			'before'   => TimeInterval::default_before(),
			'after'    => TimeInterval::default_after(),
			'fields'   => '*',
			'taxes'    => array(),
		);
		$query_args = wp_parse_args( $query_args, $defaults );
		$this->normalize_timezones( $query_args, $defaults );

		/*
		 * We need to get the cache key here because
		 * parent::update_intervals_sql_params() modifies $query_args.
		 */
		$cache_key = $this->get_cache_key( $query_args );
		$data      = $this->get_cached_data( $cache_key );

		if ( false === $data ) {
			$this->initialize_queries();

			$data = (object) array(
				'data'    => array(),
				'total'   => 0,
				'pages'   => 0,
				'page_no' => 0,
			);

			$this->add_sql_query_params( $query_args );
			$params = $this->get_limit_params( $query_args );

			if ( isset( $query_args['taxes'] ) && ! empty( $query_args['taxes'] ) ) {
				$total_results = count( $query_args['taxes'] );
				$total_pages   = (int) ceil( $total_results / $params['per_page'] );

				$inner_selections = array( 'tax_rate_id', 'total_tax', 'order_tax', 'shipping_tax', 'orders_count' );
				$outer_selections = array( 'name', 'tax_rate', 'country', 'state', 'priority' );

				$selections      = $this->selected_columns( array( 'fields' => $inner_selections ) );
				$fields          = $this->get_fields( $query_args );
				$join_selections = $this->format_join_selections( $fields, array( 'tax_rate_id' ), $outer_selections );
				$ids_table       = $this->get_ids_table( $query_args['taxes'], 'tax_rate_id' );

				$this->subquery->clear_sql_clause( 'select' );
				$this->subquery->add_sql_clause( 'select', $this->selected_columns( array( 'fields' => $inner_selections ) ) );
				$this->add_sql_clause( 'select', $join_selections );
				$this->add_sql_clause( 'from', '(' );
				$this->add_sql_clause( 'from', $this->subquery->get_query_statement() );
				$this->add_sql_clause( 'from', ") AS {$table_name}" );
				$this->add_sql_clause(
					'right_join',
					"RIGHT JOIN ( {$ids_table} ) AS default_results
					ON default_results.tax_rate_id = {$table_name}.tax_rate_id"
				);

				$taxes_query = $this->get_query_statement();
			} else {
				$db_records_count = (int) $wpdb->get_var(
					"SELECT COUNT(*) FROM (
						{$this->subquery->get_query_statement()}
					) AS tt"
				); // WPCS: cache ok, DB call ok, unprepared SQL ok.

				$total_results = $db_records_count;
				$total_pages   = (int) ceil( $db_records_count / $params['per_page'] );

				if ( $query_args['page'] < 1 || $query_args['page'] > $total_pages ) {
					return $data;
				}

				$this->subquery->clear_sql_clause( 'select' );
				$this->subquery->add_sql_clause( 'select', $this->selected_columns( $query_args ) );
				$this->subquery->add_sql_clause( 'order_by', $this->get_sql_clause( 'order_by' ) );
				$taxes_query = $this->subquery->get_query_statement();
			}

			$tax_data = $wpdb->get_results(
				$taxes_query,
				ARRAY_A
			); // WPCS: cache ok, DB call ok, unprepared SQL ok.

			if ( null === $tax_data ) {
				return $data;
			}

			$tax_data = array_map( array( $this, 'cast_numbers' ), $tax_data );
			$data     = (object) array(
				'data'    => $tax_data,
				'total'   => $total_results,
				'pages'   => $total_pages,
				'page_no' => (int) $query_args['page'],
			);

			$this->set_cached_data( $cache_key, $data );
		}

		return $data;
	}

	/**
	 * Maps ordering specified by the user to columns in the database/fields in the data.
	 *
	 * @param string $order_by Sorting criterion.
	 * @return string
	 */
	protected function normalize_order_by( $order_by ) {
		global $wpdb;

		if ( 'tax_code' === $order_by ) {
			return 'CONCAT_WS( "-", NULLIF(tax_rate_country, ""), NULLIF(tax_rate_state, ""), NULLIF(tax_rate_name, ""), NULLIF(tax_rate_priority, "") )';
		} elseif ( 'rate' === $order_by ) {
			return "CAST({$wpdb->prefix}woocommerce_tax_rates.tax_rate as DECIMAL(7,4))";
		}

		return $order_by;
	}

	/**
	 * Create or update an entry in the wc_order_tax_lookup table for an order.
	 *
	 * @param int $order_id Order ID.
	 * @return int|bool Returns -1 if order won't be processed, or a boolean indicating processing success.
	 */
	public static function sync_order_taxes( $order_id ) {
		global $wpdb;

		$order = wc_get_order( $order_id );
		if ( ! $order ) {
			return -1;
		}

		$tax_items   = $order->get_items( 'tax' );
		$num_updated = 0;

		foreach ( $tax_items as $tax_item ) {
			$result = $wpdb->replace(
				self::get_db_table_name(),
				array(
					'order_id'     => $order->get_id(),
					'date_created' => $order->get_date_created( 'edit' )->date( TimeInterval::$sql_datetime_format ),
					'tax_rate_id'  => $tax_item->get_rate_id(),
					'shipping_tax' => $tax_item->get_shipping_tax_total(),
					'order_tax'    => $tax_item->get_tax_total(),
					'total_tax'    => (float) $tax_item->get_tax_total() + (float) $tax_item->get_shipping_tax_total(),
				),
				array(
					'%d',
					'%s',
					'%d',
					'%f',
					'%f',
					'%f',
				)
			);

			/**
			 * Fires when tax's reports are updated.
			 *
			 * @param int $tax_rate_id Tax Rate ID.
			 * @param int $order_id    Order ID.
			 */
			do_action( 'woocommerce_analytics_update_tax', $tax_item->get_rate_id(), $order->get_id() );

			// Sum the rows affected. Using REPLACE can affect 2 rows if the row already exists.
			$num_updated += 2 === intval( $result ) ? 1 : intval( $result );
		}

		return ( count( $tax_items ) === $num_updated );
	}

	/**
	 * Clean taxes data when an order is deleted.
	 *
	 * @param int $order_id Order ID.
	 */
	public static function sync_on_order_delete( $order_id ) {
		global $wpdb;

		$wpdb->delete( self::get_db_table_name(), array( 'order_id' => $order_id ) );

		/**
		 * Fires when tax's reports are removed from database.
		 *
		 * @param int $tax_rate_id Tax Rate ID.
		 * @param int $order_id    Order ID.
		 */
		do_action( 'woocommerce_analytics_delete_tax', 0, $order_id );

		ReportsCache::invalidate();
	}

	/**
	 * Initialize query objects.
	 */
	protected function initialize_queries() {
		$this->clear_all_clauses();
		$this->subquery = new SqlQuery( $this->context . '_subquery' );
		$this->subquery->add_sql_clause( 'select', self::get_db_table_name() . '.tax_rate_id' );
		$this->subquery->add_sql_clause( 'from', self::get_db_table_name() );
		$this->subquery->add_sql_clause( 'group_by', self::get_db_table_name() . '.tax_rate_id' );
	}
}
woocommerce-admin/src/API/Reports/Taxes/Query.php000064400000002246151335517650015730 0ustar00<?php
/**
 * Class for parameter-based Taxes Report querying
 *
 * Example usage:
 * $args = array(
 *          'before'       => '2018-07-19 00:00:00',
 *          'after'        => '2018-07-05 00:00:00',
 *          'page'         => 2,
 *          'taxes'        => array(1,2,3)
 *         );
 * $report = new \Automattic\WooCommerce\Admin\API\Reports\Taxes\Query( $args );
 * $mydata = $report->get_data();
 */

namespace Automattic\WooCommerce\Admin\API\Reports\Taxes;

defined( 'ABSPATH' ) || exit;

use \Automattic\WooCommerce\Admin\API\Reports\Query as ReportsQuery;

/**
 * API\Reports\Taxes\Query
 */
class Query extends ReportsQuery {

	/**
	 * Valid fields for Taxes report.
	 *
	 * @return array
	 */
	protected function get_default_query_vars() {
		return array();
	}

	/**
	 * Get product data based on the current query vars.
	 *
	 * @return array
	 */
	public function get_data() {
		$args = apply_filters( 'woocommerce_analytics_taxes_query_args', $this->get_query_vars() );

		$data_store = \WC_Data_Store::load( 'report-taxes' );
		$results    = $data_store->get_data( $args );
		return apply_filters( 'woocommerce_analytics_taxes_select_query', $results, $args );
	}
}
woocommerce-admin/src/API/Reports/Taxes/Controller.php000064400000023502151335517650016744 0ustar00<?php
/**
 * REST API Reports taxes controller
 *
 * Handles requests to the /reports/taxes endpoint.
 */

namespace Automattic\WooCommerce\Admin\API\Reports\Taxes;

defined( 'ABSPATH' ) || exit;

use \Automattic\WooCommerce\Admin\API\Reports\ExportableInterface;
use \Automattic\WooCommerce\Admin\API\Reports\ExportableTraits;

/**
 * REST API Reports taxes controller class.
 *
 * @extends WC_REST_Reports_Controller
 */
class Controller extends \WC_REST_Reports_Controller implements ExportableInterface {
	/**
	 * Exportable traits.
	 */
	use ExportableTraits;

	/**
	 * Endpoint namespace.
	 *
	 * @var string
	 */
	protected $namespace = 'wc-analytics';

	/**
	 * Route base.
	 *
	 * @var string
	 */
	protected $rest_base = 'reports/taxes';

	/**
	 * Maps query arguments from the REST request.
	 *
	 * @param array $request Request array.
	 * @return array
	 */
	protected function prepare_reports_query( $request ) {
		$args             = array();
		$args['before']   = $request['before'];
		$args['after']    = $request['after'];
		$args['page']     = $request['page'];
		$args['per_page'] = $request['per_page'];
		$args['orderby']  = $request['orderby'];
		$args['order']    = $request['order'];
		$args['taxes']    = $request['taxes'];

		return $args;
	}

	/**
	 * Get all reports.
	 *
	 * @param WP_REST_Request $request Request data.
	 * @return array|WP_Error
	 */
	public function get_items( $request ) {
		$query_args  = $this->prepare_reports_query( $request );
		$taxes_query = new Query( $query_args );
		$report_data = $taxes_query->get_data();

		$data = array();

		foreach ( $report_data->data as $tax_data ) {
			$item   = $this->prepare_item_for_response( (object) $tax_data, $request );
			$data[] = $this->prepare_response_for_collection( $item );
		}

		$response = rest_ensure_response( $data );
		$response->header( 'X-WP-Total', (int) $report_data->total );
		$response->header( 'X-WP-TotalPages', (int) $report_data->pages );

		$page      = $report_data->page_no;
		$max_pages = $report_data->pages;
		$base      = add_query_arg( $request->get_query_params(), rest_url( sprintf( '/%s/%s', $this->namespace, $this->rest_base ) ) );
		if ( $page > 1 ) {
			$prev_page = $page - 1;
			if ( $prev_page > $max_pages ) {
				$prev_page = $max_pages;
			}
			$prev_link = add_query_arg( 'page', $prev_page, $base );
			$response->link_header( 'prev', $prev_link );
		}
		if ( $max_pages > $page ) {
			$next_page = $page + 1;
			$next_link = add_query_arg( 'page', $next_page, $base );
			$response->link_header( 'next', $next_link );
		}

		return $response;
	}

	/**
	 * Prepare a report object for serialization.
	 *
	 * @param stdClass        $report  Report data.
	 * @param WP_REST_Request $request Request object.
	 * @return WP_REST_Response
	 */
	public function prepare_item_for_response( $report, $request ) {
		$context = ! empty( $request['context'] ) ? $request['context'] : 'view';
		$report  = $this->add_additional_fields_to_object( $report, $request );
		$report  = $this->filter_response_by_context( $report, $context );

		// Wrap the data in a response object.
		$response = rest_ensure_response( $report );
		$response->add_links( $this->prepare_links( $report ) );

		/**
		 * Filter a report returned from the API.
		 *
		 * Allows modification of the report data right before it is returned.
		 *
		 * @param WP_REST_Response $response The response object.
		 * @param object           $report   The original report object.
		 * @param WP_REST_Request  $request  Request used to generate the response.
		 */
		return apply_filters( 'woocommerce_rest_prepare_report_taxes', $response, $report, $request );
	}

	/**
	 * Prepare links for the request.
	 *
	 * @param WC_Reports_Query $object Object data.
	 * @return array
	 */
	protected function prepare_links( $object ) {
		$links = array(
			'tax' => array(
				'href' => rest_url( sprintf( '/%s/taxes/%d', $this->namespace, $object->tax_rate_id ) ),
			),
		);

		return $links;
	}

	/**
	 * Get the Report's schema, conforming to JSON Schema.
	 *
	 * @return array
	 */
	public function get_item_schema() {
		$schema = array(
			'$schema'    => 'http://json-schema.org/draft-04/schema#',
			'title'      => 'report_taxes',
			'type'       => 'object',
			'properties' => array(
				'tax_rate_id'  => array(
					'description' => __( 'Tax rate ID.', 'woocommerce' ),
					'type'        => 'integer',
					'context'     => array( 'view', 'edit' ),
					'readonly'    => true,
				),
				'name'         => array(
					'description' => __( 'Tax rate name.', 'woocommerce' ),
					'type'        => 'string',
					'context'     => array( 'view', 'edit' ),
					'readonly'    => true,
				),
				'tax_rate'     => array(
					'description' => __( 'Tax rate.', 'woocommerce' ),
					'type'        => 'number',
					'context'     => array( 'view', 'edit' ),
					'readonly'    => true,
				),
				'country'      => array(
					'description' => __( 'Country / Region.', 'woocommerce' ),
					'type'        => 'string',
					'context'     => array( 'view', 'edit' ),
					'readonly'    => true,
				),
				'state'        => array(
					'description' => __( 'State.', 'woocommerce' ),
					'type'        => 'string',
					'context'     => array( 'view', 'edit' ),
					'readonly'    => true,
				),
				'priority'     => array(
					'description' => __( 'Priority.', 'woocommerce' ),
					'type'        => 'integer',
					'context'     => array( 'view', 'edit' ),
					'readonly'    => true,
				),
				'total_tax'    => array(
					'description' => __( 'Total tax.', 'woocommerce' ),
					'type'        => 'number',
					'context'     => array( 'view', 'edit' ),
					'readonly'    => true,
				),
				'order_tax'    => array(
					'description' => __( 'Order tax.', 'woocommerce' ),
					'type'        => 'number',
					'context'     => array( 'view', 'edit' ),
					'readonly'    => true,
				),
				'shipping_tax' => array(
					'description' => __( 'Shipping tax.', 'woocommerce' ),
					'type'        => 'number',
					'context'     => array( 'view', 'edit' ),
					'readonly'    => true,
				),
				'orders_count' => array(
					'description' => __( 'Number of orders.', 'woocommerce' ),
					'type'        => 'integer',
					'context'     => array( 'view', 'edit' ),
					'readonly'    => true,
				),
			),
		);

		return $this->add_additional_fields_schema( $schema );
	}

	/**
	 * Get the query params for collections.
	 *
	 * @return array
	 */
	public function get_collection_params() {
		$params             = array();
		$params['context']  = $this->get_context_param( array( 'default' => 'view' ) );
		$params['page']     = array(
			'description'       => __( 'Current page of the collection.', 'woocommerce' ),
			'type'              => 'integer',
			'default'           => 1,
			'sanitize_callback' => 'absint',
			'validate_callback' => 'rest_validate_request_arg',
			'minimum'           => 1,
		);
		$params['per_page'] = array(
			'description'       => __( 'Maximum number of items to be returned in result set.', 'woocommerce' ),
			'type'              => 'integer',
			'default'           => 10,
			'minimum'           => 1,
			'maximum'           => 100,
			'sanitize_callback' => 'absint',
			'validate_callback' => 'rest_validate_request_arg',
		);
		$params['after']    = array(
			'description'       => __( 'Limit response to resources published after a given ISO8601 compliant date.', 'woocommerce' ),
			'type'              => 'string',
			'format'            => 'date-time',
			'validate_callback' => 'rest_validate_request_arg',
		);
		$params['before']   = array(
			'description'       => __( 'Limit response to resources published before a given ISO8601 compliant date.', 'woocommerce' ),
			'type'              => 'string',
			'format'            => 'date-time',
			'validate_callback' => 'rest_validate_request_arg',
		);
		$params['order']    = array(
			'description'       => __( 'Order sort attribute ascending or descending.', 'woocommerce' ),
			'type'              => 'string',
			'default'           => 'desc',
			'enum'              => array( 'asc', 'desc' ),
			'validate_callback' => 'rest_validate_request_arg',
		);
		$params['orderby']  = array(
			'description'       => __( 'Sort collection by object attribute.', 'woocommerce' ),
			'type'              => 'string',
			'default'           => 'tax_rate_id',
			'enum'              => array(
				'name',
				'tax_rate_id',
				'tax_code',
				'rate',
				'order_tax',
				'total_tax',
				'shipping_tax',
				'orders_count',
			),
			'validate_callback' => 'rest_validate_request_arg',
		);
		$params['taxes']    = array(
			'description'       => __( 'Limit result set to items assigned one or more tax rates.', 'woocommerce' ),
			'type'              => 'array',
			'sanitize_callback' => 'wp_parse_id_list',
			'validate_callback' => 'rest_validate_request_arg',
			'items'             => array(
				'type' => 'string',
			),
		);

		return $params;
	}

	/**
	 * Get the column names for export.
	 *
	 * @return array Key value pair of Column ID => Label.
	 */
	public function get_export_columns() {
		return array(
			'tax_code'     => __( 'Tax code', 'woocommerce' ),
			'rate'         => __( 'Rate', 'woocommerce' ),
			'total_tax'    => __( 'Total tax', 'woocommerce' ),
			'order_tax'    => __( 'Order tax', 'woocommerce' ),
			'shipping_tax' => __( 'Shipping tax', 'woocommerce' ),
			'orders_count' => __( 'Orders', 'woocommerce' ),
		);
	}

	/**
	 * Get the column values for export.
	 *
	 * @param array $item Single report item/row.
	 * @return array Key value pair of Column ID => Row Value.
	 */
	public function prepare_item_for_export( $item ) {
		return array(
			'tax_code'     => \WC_Tax::get_rate_code( $item['tax_rate_id'] ),
			'rate'         => $item['tax_rate'],
			'total_tax'    => self::csv_number_format( $item['total_tax'] ),
			'order_tax'    => self::csv_number_format( $item['order_tax'] ),
			'shipping_tax' => self::csv_number_format( $item['shipping_tax'] ),
			'orders_count' => $item['orders_count'],
		);
	}
}
woocommerce-admin/src/API/Reports/Customers/Stats/DataStore.php000064400000007232151335517650020507 0ustar00<?php
/**
 * API\Reports\Customers\Stats\DataStore class file.
 */

namespace Automattic\WooCommerce\Admin\API\Reports\Customers\Stats;

defined( 'ABSPATH' ) || exit;

use \Automattic\WooCommerce\Admin\API\Reports\Customers\DataStore as CustomersDataStore;
use \Automattic\WooCommerce\Admin\API\Reports\DataStoreInterface;

/**
 * API\Reports\Customers\Stats\DataStore.
 */
class DataStore extends CustomersDataStore implements DataStoreInterface {
	/**
	 * Mapping columns to data type to return correct response types.
	 *
	 * @var array
	 */
	protected $column_types = array(
		'customers_count'     => 'intval',
		'avg_orders_count'    => 'floatval',
		'avg_total_spend'     => 'floatval',
		'avg_avg_order_value' => 'floatval',
	);

	/**
	 * Cache identifier.
	 *
	 * @var string
	 */
	protected $cache_key = 'customers_stats';

	/**
	 * Data store context used to pass to filters.
	 *
	 * @var string
	 */
	protected $context = 'customers_stats';

	/**
	 * Assign report columns once full table name has been assigned.
	 */
	protected function assign_report_columns() {
		$this->report_columns = array(
			'customers_count'     => 'COUNT( * ) as customers_count',
			'avg_orders_count'    => 'AVG( orders_count ) as avg_orders_count',
			'avg_total_spend'     => 'AVG( total_spend ) as avg_total_spend',
			'avg_avg_order_value' => 'AVG( avg_order_value ) as avg_avg_order_value',
		);
	}

	/**
	 * Returns the report data based on parameters supplied by the user.
	 *
	 * @param array $query_args  Query parameters.
	 * @return stdClass|WP_Error Data.
	 */
	public function get_data( $query_args ) {
		global $wpdb;

		$customers_table_name = self::get_db_table_name();

		// These defaults are only partially applied when used via REST API, as that has its own defaults.
		$defaults   = array(
			'per_page' => get_option( 'posts_per_page' ),
			'page'     => 1,
			'order'    => 'DESC',
			'orderby'  => 'date_registered',
			'fields'   => '*',
		);
		$query_args = wp_parse_args( $query_args, $defaults );
		$this->normalize_timezones( $query_args, $defaults );

		/*
		 * We need to get the cache key here because
		 * parent::update_intervals_sql_params() modifies $query_args.
		 */
		$cache_key = $this->get_cache_key( $query_args );
		$data      = $this->get_cached_data( $cache_key );

		if ( false === $data ) {
			$this->initialize_queries();

			$data = (object) array(
				'customers_count'     => 0,
				'avg_orders_count'    => 0,
				'avg_total_spend'     => 0.0,
				'avg_avg_order_value' => 0.0,
			);

			$selections = $this->selected_columns( $query_args );
			$this->add_sql_query_params( $query_args );
			// Clear SQL clauses set for parent class queries that are different here.
			$this->subquery->clear_sql_clause( 'select' );
			$this->subquery->add_sql_clause( 'select', 'SUM( total_sales ) AS total_spend,' );
			$this->subquery->add_sql_clause(
				'select',
				'SUM( CASE WHEN parent_id = 0 THEN 1 END ) as orders_count,'
			);
			$this->subquery->add_sql_clause(
				'select',
				'CASE WHEN SUM( CASE WHEN parent_id = 0 THEN 1 ELSE 0 END ) = 0 THEN NULL ELSE SUM( total_sales ) / SUM( CASE WHEN parent_id = 0 THEN 1 ELSE 0 END ) END AS avg_order_value'
			);

			$this->clear_sql_clause( array( 'order_by', 'limit' ) );
			$this->add_sql_clause( 'select', $selections );
			$this->add_sql_clause( 'from', "({$this->subquery->get_query_statement()}) AS tt" );

			$report_data = $wpdb->get_results(
				$this->get_query_statement(), // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared
				ARRAY_A
			);

			if ( null === $report_data ) {
				return $data;
			}

			$data = (object) $this->cast_numbers( $report_data[0] );

			$this->set_cached_data( $cache_key, $data );
		}

		return $data;
	}
}
woocommerce-admin/src/API/Reports/Customers/Stats/Controller.php000064400000037743151335517650020756 0ustar00<?php
/**
 * REST API Reports customers stats controller
 *
 * Handles requests to the /reports/customers/stats endpoint.
 */

namespace Automattic\WooCommerce\Admin\API\Reports\Customers\Stats;

defined( 'ABSPATH' ) || exit;

use \Automattic\WooCommerce\Admin\API\Reports\TimeInterval;

/**
 * REST API Reports customers stats controller class.
 *
 * @extends WC_REST_Reports_Controller
 */
class Controller extends \WC_REST_Reports_Controller {
	/**
	 * Endpoint namespace.
	 *
	 * @var string
	 */
	protected $namespace = 'wc-analytics';

	/**
	 * Route base.
	 *
	 * @var string
	 */
	protected $rest_base = 'reports/customers/stats';

	/**
	 * Maps query arguments from the REST request.
	 *
	 * @param array $request Request array.
	 * @return array
	 */
	protected function prepare_reports_query( $request ) {
		$args                        = array();
		$args['registered_before']   = $request['registered_before'];
		$args['registered_after']    = $request['registered_after'];
		$args['match']               = $request['match'];
		$args['search']              = $request['search'];
		$args['name_includes']       = $request['name_includes'];
		$args['name_excludes']       = $request['name_excludes'];
		$args['username_includes']   = $request['username_includes'];
		$args['username_excludes']   = $request['username_excludes'];
		$args['email_includes']      = $request['email_includes'];
		$args['email_excludes']      = $request['email_excludes'];
		$args['country_includes']    = $request['country_includes'];
		$args['country_excludes']    = $request['country_excludes'];
		$args['last_active_before']  = $request['last_active_before'];
		$args['last_active_after']   = $request['last_active_after'];
		$args['orders_count_min']    = $request['orders_count_min'];
		$args['orders_count_max']    = $request['orders_count_max'];
		$args['total_spend_min']     = $request['total_spend_min'];
		$args['total_spend_max']     = $request['total_spend_max'];
		$args['avg_order_value_min'] = $request['avg_order_value_min'];
		$args['avg_order_value_max'] = $request['avg_order_value_max'];
		$args['last_order_before']   = $request['last_order_before'];
		$args['last_order_after']    = $request['last_order_after'];
		$args['customers']           = $request['customers'];
		$args['fields']              = $request['fields'];

		$between_params_numeric    = array( 'orders_count', 'total_spend', 'avg_order_value' );
		$normalized_params_numeric = TimeInterval::normalize_between_params( $request, $between_params_numeric, false );
		$between_params_date       = array( 'last_active', 'registered' );
		$normalized_params_date    = TimeInterval::normalize_between_params( $request, $between_params_date, true );
		$args                      = array_merge( $args, $normalized_params_numeric, $normalized_params_date );

		return $args;
	}

	/**
	 * Get all reports.
	 *
	 * @param WP_REST_Request $request Request data.
	 * @return array|WP_Error
	 */
	public function get_items( $request ) {
		$query_args      = $this->prepare_reports_query( $request );
		$customers_query = new Query( $query_args );
		$report_data     = $customers_query->get_data();
		$out_data        = array(
			'totals' => $report_data,
		);

		return rest_ensure_response( $out_data );
	}

	/**
	 * Prepare a report object for serialization.
	 *
	 * @param Array           $report  Report data.
	 * @param WP_REST_Request $request Request object.
	 * @return WP_REST_Response
	 */
	public function prepare_item_for_response( $report, $request ) {
		$data = $report;

		$context = ! empty( $request['context'] ) ? $request['context'] : 'view';
		$data    = $this->add_additional_fields_to_object( $data, $request );
		$data    = $this->filter_response_by_context( $data, $context );

		// Wrap the data in a response object.
		$response = rest_ensure_response( $data );

		/**
		 * Filter a report returned from the API.
		 *
		 * Allows modification of the report data right before it is returned.
		 *
		 * @param WP_REST_Response $response The response object.
		 * @param object           $report   The original report object.
		 * @param WP_REST_Request  $request  Request used to generate the response.
		 */
		return apply_filters( 'woocommerce_rest_prepare_report_customers_stats', $response, $report, $request );
	}

	/**
	 * Get the Report's schema, conforming to JSON Schema.
	 *
	 * @return array
	 */
	public function get_item_schema() {
		// @todo Should any of these be 'indicator's?
		$totals = array(
			'customers_count'     => array(
				'description' => __( 'Number of customers.', 'woocommerce' ),
				'type'        => 'integer',
				'context'     => array( 'view', 'edit' ),
				'readonly'    => true,
			),
			'avg_orders_count'    => array(
				'description' => __( 'Average number of orders.', 'woocommerce' ),
				'type'        => 'integer',
				'context'     => array( 'view', 'edit' ),
				'readonly'    => true,
			),
			'avg_total_spend'     => array(
				'description' => __( 'Average total spend per customer.', 'woocommerce' ),
				'type'        => 'number',
				'context'     => array( 'view', 'edit' ),
				'readonly'    => true,
				'format'      => 'currency',
			),
			'avg_avg_order_value' => array(
				'description' => __( 'Average AOV per customer.', 'woocommerce' ),
				'type'        => 'number',
				'context'     => array( 'view', 'edit' ),
				'readonly'    => true,
				'format'      => 'currency',
			),
		);

		$schema = array(
			'$schema'    => 'http://json-schema.org/draft-04/schema#',
			'title'      => 'report_customers_stats',
			'type'       => 'object',
			'properties' => array(
				'totals' => array(
					'description' => __( 'Totals data.', 'woocommerce' ),
					'type'        => 'object',
					'context'     => array( 'view', 'edit' ),
					'readonly'    => true,
					'properties'  => $totals,
				),
			),
		);

		return $this->add_additional_fields_schema( $schema );
	}

	/**
	 * Get the query params for collections.
	 *
	 * @return array
	 */
	public function get_collection_params() {
		$params                            = array();
		$params['context']                 = $this->get_context_param( array( 'default' => 'view' ) );
		$params['registered_before']       = array(
			'description'       => __( 'Limit response to objects registered before (or at) a given ISO8601 compliant datetime.', 'woocommerce' ),
			'type'              => 'string',
			'format'            => 'date-time',
			'validate_callback' => 'rest_validate_request_arg',
		);
		$params['registered_after']        = array(
			'description'       => __( 'Limit response to objects registered after (or at) a given ISO8601 compliant datetime.', 'woocommerce' ),
			'type'              => 'string',
			'format'            => 'date-time',
			'validate_callback' => 'rest_validate_request_arg',
		);
		$params['match']                   = array(
			'description'       => __( 'Indicates whether all the conditions should be true for the resulting set, or if any one of them is sufficient. Match affects the following parameters: status_is, status_is_not, product_includes, product_excludes, coupon_includes, coupon_excludes, customer, categories', 'woocommerce' ),
			'type'              => 'string',
			'default'           => 'all',
			'enum'              => array(
				'all',
				'any',
			),
			'validate_callback' => 'rest_validate_request_arg',
		);
		$params['search']                  = array(
			'description'       => __( 'Limit response to objects with a customer field containing the search term. Searches the field provided by `searchby`.', 'woocommerce' ),
			'type'              => 'string',
			'validate_callback' => 'rest_validate_request_arg',
		);
		$params['searchby']                = array(
			'description' => 'Limit results with `search` and `searchby` to specific fields containing the search term.',
			'type'        => 'string',
			'default'     => 'name',
			'enum'        => array(
				'name',
				'username',
				'email',
			),
		);
		$params['name_includes']           = array(
			'description'       => __( 'Limit response to objects with specfic names.', 'woocommerce' ),
			'type'              => 'string',
			'validate_callback' => 'rest_validate_request_arg',
		);
		$params['name_excludes']           = array(
			'description'       => __( 'Limit response to objects excluding specfic names.', 'woocommerce' ),
			'type'              => 'string',
			'validate_callback' => 'rest_validate_request_arg',
		);
		$params['username_includes']       = array(
			'description'       => __( 'Limit response to objects with specfic usernames.', 'woocommerce' ),
			'type'              => 'string',
			'validate_callback' => 'rest_validate_request_arg',
		);
		$params['username_excludes']       = array(
			'description'       => __( 'Limit response to objects excluding specfic usernames.', 'woocommerce' ),
			'type'              => 'string',
			'validate_callback' => 'rest_validate_request_arg',
		);
		$params['email_includes']          = array(
			'description'       => __( 'Limit response to objects including emails.', 'woocommerce' ),
			'type'              => 'string',
			'validate_callback' => 'rest_validate_request_arg',
		);
		$params['email_excludes']          = array(
			'description'       => __( 'Limit response to objects excluding emails.', 'woocommerce' ),
			'type'              => 'string',
			'validate_callback' => 'rest_validate_request_arg',
		);
		$params['country_includes']        = array(
			'description'       => __( 'Limit response to objects with specfic countries.', 'woocommerce' ),
			'type'              => 'string',
			'validate_callback' => 'rest_validate_request_arg',
		);
		$params['country_excludes']        = array(
			'description'       => __( 'Limit response to objects excluding specfic countries.', 'woocommerce' ),
			'type'              => 'string',
			'validate_callback' => 'rest_validate_request_arg',
		);
		$params['last_active_before']      = array(
			'description'       => __( 'Limit response to objects last active before (or at) a given ISO8601 compliant datetime.', 'woocommerce' ),
			'type'              => 'string',
			'format'            => 'date-time',
			'validate_callback' => 'rest_validate_request_arg',
		);
		$params['last_active_after']       = array(
			'description'       => __( 'Limit response to objects last active after (or at) a given ISO8601 compliant datetime.', 'woocommerce' ),
			'type'              => 'string',
			'format'            => 'date-time',
			'validate_callback' => 'rest_validate_request_arg',
		);
		$params['last_active_between']     = array(
			'description'       => __( 'Limit response to objects last active between two given ISO8601 compliant datetime.', 'woocommerce' ),
			'type'              => 'array',
			'validate_callback' => array( '\Automattic\WooCommerce\Admin\API\Reports\TimeInterval', 'rest_validate_between_date_arg' ),
			'items'             => array(
				'type' => 'string',
			),
		);
		$params['registered_before']       = array(
			'description'       => __( 'Limit response to objects registered before (or at) a given ISO8601 compliant datetime.', 'woocommerce' ),
			'type'              => 'string',
			'format'            => 'date-time',
			'validate_callback' => 'rest_validate_request_arg',
		);
		$params['registered_after']        = array(
			'description'       => __( 'Limit response to objects registered after (or at) a given ISO8601 compliant datetime.', 'woocommerce' ),
			'type'              => 'string',
			'format'            => 'date-time',
			'validate_callback' => 'rest_validate_request_arg',
		);
		$params['registered_between']      = array(
			'description'       => __( 'Limit response to objects last active between two given ISO8601 compliant datetime.', 'woocommerce' ),
			'type'              => 'array',
			'validate_callback' => array( '\Automattic\WooCommerce\Admin\API\Reports\TimeInterval', 'rest_validate_between_date_arg' ),
			'items'             => array(
				'type' => 'string',
			),
		);
		$params['orders_count_min']        = array(
			'description'       => __( 'Limit response to objects with an order count greater than or equal to given integer.', 'woocommerce' ),
			'type'              => 'integer',
			'sanitize_callback' => 'absint',
			'validate_callback' => 'rest_validate_request_arg',
		);
		$params['orders_count_max']        = array(
			'description'       => __( 'Limit response to objects with an order count less than or equal to given integer.', 'woocommerce' ),
			'type'              => 'integer',
			'sanitize_callback' => 'absint',
			'validate_callback' => 'rest_validate_request_arg',
		);
		$params['orders_count_between']    = array(
			'description'       => __( 'Limit response to objects with an order count between two given integers.', 'woocommerce' ),
			'type'              => 'array',
			'validate_callback' => array( '\Automattic\WooCommerce\Admin\API\Reports\TimeInterval', 'rest_validate_between_numeric_arg' ),
			'items'             => array(
				'type' => 'integer',
			),
		);
		$params['total_spend_min']         = array(
			'description'       => __( 'Limit response to objects with a total order spend greater than or equal to given number.', 'woocommerce' ),
			'type'              => 'number',
			'validate_callback' => 'rest_validate_request_arg',
		);
		$params['total_spend_max']         = array(
			'description'       => __( 'Limit response to objects with a total order spend less than or equal to given number.', 'woocommerce' ),
			'type'              => 'number',
			'validate_callback' => 'rest_validate_request_arg',
		);
		$params['total_spend_between']     = array(
			'description'       => __( 'Limit response to objects with a total order spend between two given numbers.', 'woocommerce' ),
			'type'              => 'array',
			'validate_callback' => array( '\Automattic\WooCommerce\Admin\API\Reports\TimeInterval', 'rest_validate_between_numeric_arg' ),
			'items'             => array(
				'type' => 'integer',
			),
		);
		$params['avg_order_value_min']     = array(
			'description'       => __( 'Limit response to objects with an average order spend greater than or equal to given number.', 'woocommerce' ),
			'type'              => 'number',
			'validate_callback' => 'rest_validate_request_arg',
		);
		$params['avg_order_value_max']     = array(
			'description'       => __( 'Limit response to objects with an average order spend less than or equal to given number.', 'woocommerce' ),
			'type'              => 'number',
			'validate_callback' => 'rest_validate_request_arg',
		);
		$params['avg_order_value_between'] = array(
			'description'       => __( 'Limit response to objects with an average order spend between two given numbers.', 'woocommerce' ),
			'type'              => 'array',
			'validate_callback' => array( '\Automattic\WooCommerce\Admin\API\Reports\TimeInterval', 'rest_validate_between_numeric_arg' ),
			'items'             => array(
				'type' => 'integer',
			),
		);
		$params['last_order_before']       = array(
			'description'       => __( 'Limit response to objects with last order before (or at) a given ISO8601 compliant datetime.', 'woocommerce' ),
			'type'              => 'string',
			'format'            => 'date-time',
			'validate_callback' => 'rest_validate_request_arg',
		);
		$params['last_order_after']        = array(
			'description'       => __( 'Limit response to objects with last order after (or at) a given ISO8601 compliant datetime.', 'woocommerce' ),
			'type'              => 'string',
			'format'            => 'date-time',
			'validate_callback' => 'rest_validate_request_arg',
		);
		$params['customers']               = array(
			'description'       => __( 'Limit result to items with specified customer ids.', 'woocommerce' ),
			'type'              => 'array',
			'sanitize_callback' => 'wp_parse_id_list',
			'validate_callback' => 'rest_validate_request_arg',
			'items'             => array(
				'type' => 'integer',
			),
		);
		$params['fields']                  = array(
			'description'       => __( 'Limit stats fields to the specified items.', 'woocommerce' ),
			'type'              => 'array',
			'sanitize_callback' => 'wp_parse_slug_list',
			'validate_callback' => 'rest_validate_request_arg',
			'items'             => array(
				'type' => 'string',
			),
		);

		return $params;
	}
}
woocommerce-admin/src/API/Reports/Customers/Stats/Query.php000064400000003006151335517650017721 0ustar00<?php
/**
 * Class for parameter-based Customers Report Stats querying
 *
 * Example usage:
 * $args = array(
 *          'registered_before'   => '2018-07-19 00:00:00',
 *          'registered_after'    => '2018-07-05 00:00:00',
 *          'page'                => 2,
 *          'avg_order_value_min' => 100,
 *          'country'             => 'GB',
 *         );
 * $report = new \Automattic\WooCommerce\Admin\API\Reports\Customers\Stats\Query( $args );
 * $mydata = $report->get_data();
 */

namespace Automattic\WooCommerce\Admin\API\Reports\Customers\Stats;

defined( 'ABSPATH' ) || exit;

use \Automattic\WooCommerce\Admin\API\Reports\Query as ReportsQuery;

/**
 * API\Reports\Customers\Stats\Query
 */
class Query extends ReportsQuery {

	/**
	 * Valid fields for Customers report.
	 *
	 * @return array
	 */
	protected function get_default_query_vars() {
		return array(
			'per_page' => get_option( 'posts_per_page' ), // not sure if this should be the default.
			'page'     => 1,
			'order'    => 'DESC',
			'orderby'  => 'date_registered',
			'fields'   => '*', // @todo Needed?
		);
	}

	/**
	 * Get product data based on the current query vars.
	 *
	 * @return array
	 */
	public function get_data() {
		$args = apply_filters( 'woocommerce_analytics_customers_stats_query_args', $this->get_query_vars() );

		$data_store = \WC_Data_Store::load( 'report-customers-stats' );
		$results    = $data_store->get_data( $args );
		return apply_filters( 'woocommerce_analytics_customers_stats_select_query', $results, $args );
	}
}
woocommerce-admin/src/API/Reports/Customers/Query.php000064400000002713151335517650016627 0ustar00<?php
/**
 * Class for parameter-based Customers Report querying
 *
 * Example usage:
 * $args = array(
 *          'registered_before'   => '2018-07-19 00:00:00',
 *          'registered_after'    => '2018-07-05 00:00:00',
 *          'page'                => 2,
 *          'avg_order_value_min' => 100,
 *          'country'             => 'GB',
 *         );
 * $report = new \Automattic\WooCommerce\Admin\API\Reports\Customers\Query( $args );
 * $mydata = $report->get_data();
 */

namespace Automattic\WooCommerce\Admin\API\Reports\Customers;

defined( 'ABSPATH' ) || exit;

use \Automattic\WooCommerce\Admin\API\Reports\Query as ReportsQuery;

/**
 * API\Reports\Customers\Query
 */
class Query extends ReportsQuery {

	/**
	 * Valid fields for Customers report.
	 *
	 * @return array
	 */
	protected function get_default_query_vars() {
		return array(
			'per_page' => get_option( 'posts_per_page' ), // not sure if this should be the default.
			'page'     => 1,
			'order'    => 'DESC',
			'orderby'  => 'date_registered',
			'fields'   => '*',
		);
	}

	/**
	 * Get product data based on the current query vars.
	 *
	 * @return array
	 */
	public function get_data() {
		$args = apply_filters( 'woocommerce_analytics_customers_query_args', $this->get_query_vars() );

		$data_store = \WC_Data_Store::load( 'report-customers' );
		$results    = $data_store->get_data( $args );
		return apply_filters( 'woocommerce_analytics_customers_select_query', $results, $args );
	}
}
woocommerce-admin/src/API/Reports/Customers/DataStore.php000064400000062622151335517650017415 0ustar00<?php
/**
 * Admin\API\Reports\Customers\DataStore class file.
 */

namespace Automattic\WooCommerce\Admin\API\Reports\Customers;

defined( 'ABSPATH' ) || exit;

use \Automattic\WooCommerce\Admin\API\Reports\DataStore as ReportsDataStore;
use \Automattic\WooCommerce\Admin\API\Reports\DataStoreInterface;
use \Automattic\WooCommerce\Admin\API\Reports\TimeInterval;
use \Automattic\WooCommerce\Admin\API\Reports\SqlQuery;
use \Automattic\WooCommerce\Admin\API\Reports\Cache as ReportsCache;

/**
 * Admin\API\Reports\Customers\DataStore.
 */
class DataStore extends ReportsDataStore implements DataStoreInterface {

	/**
	 * Table used to get the data.
	 *
	 * @var string
	 */
	protected static $table_name = 'wc_customer_lookup';

	/**
	 * Cache identifier.
	 *
	 * @var string
	 */
	protected $cache_key = 'customers';

	/**
	 * Mapping columns to data type to return correct response types.
	 *
	 * @var array
	 */
	protected $column_types = array(
		'id'              => 'intval',
		'user_id'         => 'intval',
		'orders_count'    => 'intval',
		'total_spend'     => 'floatval',
		'avg_order_value' => 'floatval',
	);

	/**
	 * Data store context used to pass to filters.
	 *
	 * @var string
	 */
	protected $context = 'customers';

	/**
	 * Assign report columns once full table name has been assigned.
	 */
	protected function assign_report_columns() {
		global $wpdb;
		$table_name           = self::get_db_table_name();
		$orders_count         = 'SUM( CASE WHEN parent_id = 0 THEN 1 ELSE 0 END )';
		$total_spend          = 'SUM( total_sales )';
		$this->report_columns = array(
			'id'               => "{$table_name}.customer_id as id",
			'user_id'          => 'user_id',
			'username'         => 'username',
			'name'             => "CONCAT_WS( ' ', first_name, last_name ) as name", // @todo What does this mean for RTL?
			'email'            => 'email',
			'country'          => 'country',
			'city'             => 'city',
			'state'            => 'state',
			'postcode'         => 'postcode',
			'date_registered'  => 'date_registered',
			'date_last_active' => 'IF( date_last_active <= "0000-00-00 00:00:00", NULL, date_last_active ) AS date_last_active',
			'date_last_order'  => "MAX( {$wpdb->prefix}wc_order_stats.date_created ) as date_last_order",
			'orders_count'     => "{$orders_count} as orders_count",
			'total_spend'      => "{$total_spend} as total_spend",
			'avg_order_value'  => "CASE WHEN {$orders_count} = 0 THEN NULL ELSE {$total_spend} / {$orders_count} END AS avg_order_value",
		);
	}

	/**
	 * Set up all the hooks for maintaining and populating table data.
	 */
	public static function init() {
		add_action( 'edit_user_profile_update', array( __CLASS__, 'update_registered_customer' ) );
		add_action( 'woocommerce_analytics_delete_order_stats', array( __CLASS__, 'sync_on_order_delete' ), 15, 2 );
	}

	/**
	 * Sync customers data after an order was deleted.
	 *
	 * When an order is deleted, the customer record is deleted from the
	 * table if the customer has no other orders.
	 *
	 * @param int $order_id Order ID.
	 * @param int $customer_id Customer ID.
	 */
	public static function sync_on_order_delete( $order_id, $customer_id ) {
		$customer_id = absint( $customer_id );

		if ( 0 === $customer_id ) {
			return;
		}

		// Calculate the amount of orders remaining for this customer.
		$order_count = self::get_order_count( $customer_id );

		if ( 0 === $order_count ) {
			self::delete_customer( $customer_id );
		}
	}

	/**
	 * Sync customers data after an order was updated.
	 *
	 * Only updates customer if it is the customers last order.
	 *
	 * @param int $post_id of order.
	 * @return true|-1
	 */
	public static function sync_order_customer( $post_id ) {
		global $wpdb;

		if ( 'shop_order' !== get_post_type( $post_id ) && 'shop_order_refund' !== get_post_type( $post_id ) ) {
			return -1;
		}

		$order       = wc_get_order( $post_id );
		$customer_id = self::get_existing_customer_id_from_order( $order );
		if ( false === $customer_id ) {
			return -1;
		}
		$last_order = self::get_last_order( $customer_id );

		if ( ! $last_order || $order->get_id() !== $last_order->get_id() ) {
			return -1;
		}

		list($data, $format) = self::get_customer_order_data_and_format( $order );

		$result = $wpdb->update( self::get_db_table_name(), $data, array( 'customer_id' => $customer_id ), $format );

		/**
		 * Fires when a customer is updated.
		 *
		 * @param int $customer_id Customer ID.
		 */
		do_action( 'woocommerce_analytics_update_customer', $customer_id );

		return 1 === $result;
	}

	/**
	 * Maps ordering specified by the user to columns in the database/fields in the data.
	 *
	 * @param string $order_by Sorting criterion.
	 * @return string
	 */
	protected function normalize_order_by( $order_by ) {
		if ( 'name' === $order_by ) {
			return "CONCAT_WS( ' ', first_name, last_name )";
		}

		return $order_by;
	}

	/**
	 * Fills WHERE clause of SQL request with date-related constraints.
	 *
	 * @param array  $query_args Parameters supplied by the user.
	 * @param string $table_name Name of the db table relevant for the date constraint.
	 */
	protected function add_time_period_sql_params( $query_args, $table_name ) {
		global $wpdb;

		$this->clear_sql_clause( array( 'where', 'where_time', 'having' ) );
		$date_param_mapping  = array(
			'registered'  => array(
				'clause' => 'where',
				'column' => $table_name . '.date_registered',
			),
			'order'       => array(
				'clause' => 'where',
				'column' => $wpdb->prefix . 'wc_order_stats.date_created',
			),
			'last_active' => array(
				'clause' => 'where',
				'column' => $table_name . '.date_last_active',
			),
			'last_order'  => array(
				'clause' => 'having',
				'column' => "MAX( {$wpdb->prefix}wc_order_stats.date_created )",
			),
		);
		$match_operator      = $this->get_match_operator( $query_args );
		$where_time_clauses  = array();
		$having_time_clauses = array();

		foreach ( $date_param_mapping as $query_param => $param_info ) {
			$subclauses  = array();
			$before_arg  = $query_param . '_before';
			$after_arg   = $query_param . '_after';
			$column_name = $param_info['column'];

			if ( ! empty( $query_args[ $before_arg ] ) ) {
				$datetime     = new \DateTime( $query_args[ $before_arg ] );
				$datetime_str = $datetime->format( TimeInterval::$sql_datetime_format );
				$subclauses[] = "{$column_name} <= '$datetime_str'";
			}

			if ( ! empty( $query_args[ $after_arg ] ) ) {
				$datetime     = new \DateTime( $query_args[ $after_arg ] );
				$datetime_str = $datetime->format( TimeInterval::$sql_datetime_format );
				$subclauses[] = "{$column_name} >= '$datetime_str'";
			}

			if ( $subclauses && ( 'where' === $param_info['clause'] ) ) {
				$where_time_clauses[] = '(' . implode( ' AND ', $subclauses ) . ')';
			}

			if ( $subclauses && ( 'having' === $param_info['clause'] ) ) {
				$having_time_clauses[] = '(' . implode( ' AND ', $subclauses ) . ')';
			}
		}

		if ( $where_time_clauses ) {
			$this->subquery->add_sql_clause( 'where_time', 'AND ' . implode( " {$match_operator} ", $where_time_clauses ) );
		}

		if ( $having_time_clauses ) {
			$this->subquery->add_sql_clause( 'having', 'AND ' . implode( " {$match_operator} ", $having_time_clauses ) );
		}
	}

	/**
	 * Updates the database query with parameters used for Customers report: categories and order status.
	 *
	 * @param array $query_args Query arguments supplied by the user.
	 */
	protected function add_sql_query_params( $query_args ) {
		global $wpdb;
		$customer_lookup_table  = self::get_db_table_name();
		$order_stats_table_name = $wpdb->prefix . 'wc_order_stats';

		$this->add_time_period_sql_params( $query_args, $customer_lookup_table );
		$this->get_limit_sql_params( $query_args );
		$this->add_order_by_sql_params( $query_args );
		$this->subquery->add_sql_clause( 'left_join', "LEFT JOIN {$order_stats_table_name} ON {$customer_lookup_table}.customer_id = {$order_stats_table_name}.customer_id" );

		$match_operator = $this->get_match_operator( $query_args );
		$where_clauses  = array();
		$having_clauses = array();

		$exact_match_params = array(
			'name',
			'username',
			'email',
			'country',
		);

		foreach ( $exact_match_params as $exact_match_param ) {
			if ( ! empty( $query_args[ $exact_match_param . '_includes' ] ) ) {
				$exact_match_arguments         = $query_args[ $exact_match_param . '_includes' ];
				$exact_match_arguments_escaped = array_map( 'esc_sql', explode( ',', $exact_match_arguments ) );
				$included                      = implode( "','", $exact_match_arguments_escaped );
				// 'country_includes' is a list of country codes, the others will be a list of customer ids.
				$table_column    = 'country' === $exact_match_param ? $exact_match_param : 'customer_id';
				$where_clauses[] = "{$customer_lookup_table}.{$table_column} IN ('{$included}')";
			}

			if ( ! empty( $query_args[ $exact_match_param . '_excludes' ] ) ) {
				$exact_match_arguments         = $query_args[ $exact_match_param . '_excludes' ];
				$exact_match_arguments_escaped = array_map( 'esc_sql', explode( ',', $exact_match_arguments ) );
				$excluded                      = implode( "','", $exact_match_arguments_escaped );
				// 'country_includes' is a list of country codes, the others will be a list of customer ids.
				$table_column    = 'country' === $exact_match_param ? $exact_match_param : 'customer_id';
				$where_clauses[] = "{$customer_lookup_table}.{$table_column} NOT IN ('{$excluded}')";
			}
		}

		$search_params = array(
			'name',
			'username',
			'email',
		);

		if ( ! empty( $query_args['search'] ) ) {
			$name_like = '%' . $wpdb->esc_like( $query_args['search'] ) . '%';

			if ( empty( $query_args['searchby'] ) || 'name' === $query_args['searchby'] || ! in_array( $query_args['searchby'], $search_params, true ) ) {
				$searchby = "CONCAT_WS( ' ', first_name, last_name )";
			} else {
				$searchby = $query_args['searchby'];
			}

			$where_clauses[] = $wpdb->prepare( "{$searchby} LIKE %s", $name_like ); // phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared
		}

		// Allow a list of customer IDs to be specified.
		if ( ! empty( $query_args['customers'] ) ) {
			$included_customers = $this->get_filtered_ids( $query_args, 'customers' );
			$where_clauses[]    = "{$customer_lookup_table}.customer_id IN ({$included_customers})";
		}

		$numeric_params = array(
			'orders_count'    => array(
				'column' => 'COUNT( order_id )',
				'format' => '%d',
			),
			'total_spend'     => array(
				'column' => 'SUM( total_sales )',
				'format' => '%f',
			),
			'avg_order_value' => array(
				'column' => '( SUM( total_sales ) / COUNT( order_id ) )',
				'format' => '%f',
			),
		);

		foreach ( $numeric_params as $numeric_param => $param_info ) {
			$subclauses = array();
			$min_param  = $numeric_param . '_min';
			$max_param  = $numeric_param . '_max';
			$or_equal   = isset( $query_args[ $min_param ] ) && isset( $query_args[ $max_param ] ) ? '=' : '';

			if ( isset( $query_args[ $min_param ] ) ) {
				$subclauses[] = $wpdb->prepare(
					// phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared, WordPress.DB.PreparedSQLPlaceholders.UnfinishedPrepare
					"{$param_info['column']} >{$or_equal} {$param_info['format']}",
					$query_args[ $min_param ]
				);
			}

			if ( isset( $query_args[ $max_param ] ) ) {
				$subclauses[] = $wpdb->prepare(
					// phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared, WordPress.DB.PreparedSQLPlaceholders.UnfinishedPrepare
					"{$param_info['column']} <{$or_equal} {$param_info['format']}",
					$query_args[ $max_param ]
				);
			}

			if ( $subclauses ) {
				$having_clauses[] = '(' . implode( ' AND ', $subclauses ) . ')';
			}
		}

		if ( $where_clauses ) {
			$preceding_match = empty( $this->get_sql_clause( 'where_time' ) ) ? ' AND ' : " {$match_operator} ";
			$this->subquery->add_sql_clause( 'where', $preceding_match . implode( " {$match_operator} ", $where_clauses ) );
		}

		$order_status_filter = $this->get_status_subquery( $query_args );
		if ( $order_status_filter ) {
			$this->subquery->add_sql_clause( 'left_join', "AND ( {$order_status_filter} )" );
		}

		if ( $having_clauses ) {
			$preceding_match = empty( $this->get_sql_clause( 'having' ) ) ? ' AND ' : " {$match_operator} ";
			$this->subquery->add_sql_clause( 'having', $preceding_match . implode( " {$match_operator} ", $having_clauses ) );
		}
	}

	/**
	 * Returns the report data based on parameters supplied by the user.
	 *
	 * @param array $query_args  Query parameters.
	 * @return stdClass|WP_Error Data.
	 */
	public function get_data( $query_args ) {
		global $wpdb;

		$customers_table_name   = self::get_db_table_name();
		$order_stats_table_name = $wpdb->prefix . 'wc_order_stats';

		// These defaults are only partially applied when used via REST API, as that has its own defaults.
		$defaults   = array(
			'per_page'     => get_option( 'posts_per_page' ),
			'page'         => 1,
			'order'        => 'DESC',
			'orderby'      => 'date_registered',
			'order_before' => TimeInterval::default_before(),
			'order_after'  => TimeInterval::default_after(),
			'fields'       => '*',
		);
		$query_args = wp_parse_args( $query_args, $defaults );
		$this->normalize_timezones( $query_args, $defaults );

		/*
		 * We need to get the cache key here because
		 * parent::update_intervals_sql_params() modifies $query_args.
		 */
		$cache_key = $this->get_cache_key( $query_args );
		$data      = $this->get_cached_data( $cache_key );

		if ( false === $data ) {
			$this->initialize_queries();

			$data = (object) array(
				'data'    => array(),
				'total'   => 0,
				'pages'   => 0,
				'page_no' => 0,
			);

			$selections       = $this->selected_columns( $query_args );
			$sql_query_params = $this->add_sql_query_params( $query_args );
			$count_query      = "SELECT COUNT(*) FROM (
					{$this->subquery->get_query_statement()}
				) as tt
				";
			$db_records_count = (int) $wpdb->get_var(
				$count_query // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared
			);

			$params      = $this->get_limit_params( $query_args );
			$total_pages = (int) ceil( $db_records_count / $params['per_page'] );
			if ( $query_args['page'] < 1 || $query_args['page'] > $total_pages ) {
				return $data;
			}

			$this->subquery->clear_sql_clause( 'select' );
			$this->subquery->add_sql_clause( 'select', $selections );
			$this->subquery->add_sql_clause( 'order_by', $this->get_sql_clause( 'order_by' ) );
			$this->subquery->add_sql_clause( 'limit', $this->get_sql_clause( 'limit' ) );

			$customer_data = $wpdb->get_results(
				$this->subquery->get_query_statement(), // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared
				ARRAY_A
			);

			if ( null === $customer_data ) {
				return $data;
			}

			$customer_data = array_map( array( $this, 'cast_numbers' ), $customer_data );
			$data          = (object) array(
				'data'    => $customer_data,
				'total'   => $db_records_count,
				'pages'   => $total_pages,
				'page_no' => (int) $query_args['page'],
			);

			$this->set_cached_data( $cache_key, $data );
		}

		return $data;
	}

	/**
	 * Returns an existing customer ID for an order if one exists.
	 *
	 * @param object $order WC Order.
	 * @return int|bool
	 */
	public static function get_existing_customer_id_from_order( $order ) {
		global $wpdb;

		if ( ! is_a( $order, 'WC_Order' ) ) {
			return false;
		}

		$user_id = $order->get_customer_id();

		if ( 0 === $user_id ) {
			$customer_id = $wpdb->get_var(
				$wpdb->prepare(
					"SELECT customer_id FROM {$wpdb->prefix}wc_order_stats WHERE order_id = %d",
					$order->get_id()
				)
			);

			if ( $customer_id ) {
				return $customer_id;
			}

			$email = $order->get_billing_email( 'edit' );

			if ( $email ) {
				return self::get_guest_id_by_email( $email );
			} else {
				return false;
			}
		} else {
			return self::get_customer_id_by_user_id( $user_id );
		}
	}

	/**
	 * Get or create a customer from a given order.
	 *
	 * @param object $order WC Order.
	 * @return int|bool
	 */
	public static function get_or_create_customer_from_order( $order ) {
		if ( ! $order ) {
			return false;
		}

		global $wpdb;

		if ( ! is_a( $order, 'WC_Order' ) ) {
			return false;
		}

		$returning_customer_id = self::get_existing_customer_id_from_order( $order );

		if ( $returning_customer_id ) {
			return $returning_customer_id;
		}

		list($data, $format) = self::get_customer_order_data_and_format( $order );

		$result      = $wpdb->insert( self::get_db_table_name(), $data, $format );
		$customer_id = $wpdb->insert_id;

		/**
		 * Fires when a new report customer is created.
		 *
		 * @param int $customer_id Customer ID.
		 */
		do_action( 'woocommerce_analytics_new_customer', $customer_id );

		return $result ? $customer_id : false;
	}

	/**
	 * Returns a data object and format object of the customers data coming from the order.
	 *
	 * @param object      $order         WC_Order where we get customer info from.
	 * @param object|null $customer_user WC_Customer registered customer WP user.
	 * @return array ($data, $format)
	 */
	public static function get_customer_order_data_and_format( $order, $customer_user = null ) {
		$data   = array(
			'first_name'       => $order->get_customer_first_name(),
			'last_name'        => $order->get_customer_last_name(),
			'email'            => $order->get_billing_email( 'edit' ),
			'city'             => $order->get_billing_city( 'edit' ),
			'state'            => $order->get_billing_state( 'edit' ),
			'postcode'         => $order->get_billing_postcode( 'edit' ),
			'country'          => $order->get_billing_country( 'edit' ),
			'date_last_active' => gmdate( 'Y-m-d H:i:s', $order->get_date_created( 'edit' )->getTimestamp() ),
		);
		$format = array(
			'%s',
			'%s',
			'%s',
			'%s',
			'%s',
			'%s',
			'%s',
			'%s',
		);

		// Add registered customer data.
		if ( 0 !== $order->get_user_id() ) {
			$user_id = $order->get_user_id();
			if ( is_null( $customer_user ) ) {
				$customer_user = new \WC_Customer( $user_id );
			}
			$data['user_id']         = $user_id;
			$data['username']        = $customer_user->get_username( 'edit' );
			$data['date_registered'] = $customer_user->get_date_created( 'edit' ) ? $customer_user->get_date_created( 'edit' )->date( TimeInterval::$sql_datetime_format ) : null;
			$format[]                = '%d';
			$format[]                = '%s';
			$format[]                = '%s';
		}
		return array( $data, $format );
	}

	/**
	 * Retrieve a guest ID (when user_id is null) by email.
	 *
	 * @param string $email Email address.
	 * @return false|array Customer array if found, boolean false if not.
	 */
	public static function get_guest_id_by_email( $email ) {
		global $wpdb;

		$table_name  = self::get_db_table_name();
		$customer_id = $wpdb->get_var(
			$wpdb->prepare(
				// phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared
				"SELECT customer_id FROM {$table_name} WHERE email = %s AND user_id IS NULL LIMIT 1",
				$email
			)
		);

		return $customer_id ? (int) $customer_id : false;
	}

	/**
	 * Retrieve a registered customer row id by user_id.
	 *
	 * @param string|int $user_id User ID.
	 * @return false|int Customer ID if found, boolean false if not.
	 */
	public static function get_customer_id_by_user_id( $user_id ) {
		global $wpdb;

		$table_name  = self::get_db_table_name();
		$customer_id = $wpdb->get_var(
			$wpdb->prepare(
				// phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared
				"SELECT customer_id FROM {$table_name} WHERE user_id = %d LIMIT 1",
				$user_id
			)
		);

		return $customer_id ? (int) $customer_id : false;
	}

	/**
	 * Retrieve the last order made by a customer.
	 *
	 * @param int $customer_id Customer ID.
	 * @return object WC_Order|false.
	 */
	public static function get_last_order( $customer_id ) {
		global $wpdb;
		$orders_table = $wpdb->prefix . 'wc_order_stats';

		$last_order = $wpdb->get_var(
			$wpdb->prepare(
				// phpcs:disable WordPress.DB.PreparedSQL.InterpolatedNotPrepared
				"SELECT order_id, date_created_gmt FROM {$orders_table}
				WHERE customer_id = %d
				ORDER BY date_created_gmt DESC, order_id DESC LIMIT 1",
				// phpcs:enable
				$customer_id
			)
		);
		if ( ! $last_order ) {
			return false;
		}
		return wc_get_order( absint( $last_order ) );
	}

	/**
	 * Retrieve the oldest orders made by a customer.
	 *
	 * @param int $customer_id Customer ID.
	 * @return array Orders.
	 */
	public static function get_oldest_orders( $customer_id ) {
		global $wpdb;
		$orders_table                = $wpdb->prefix . 'wc_order_stats';
		$excluded_statuses           = array_map( array( __CLASS__, 'normalize_order_status' ), self::get_excluded_report_order_statuses() );
		$excluded_statuses_condition = '';
		if ( ! empty( $excluded_statuses ) ) {
			$excluded_statuses_str       = implode( "','", $excluded_statuses );
			$excluded_statuses_condition = "AND status NOT IN ('{$excluded_statuses_str}')";
		}

		return $wpdb->get_results(
			$wpdb->prepare(
				// phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared
				"SELECT order_id, date_created FROM {$orders_table} WHERE customer_id = %d {$excluded_statuses_condition} ORDER BY date_created, order_id ASC LIMIT 2",
				$customer_id
			)
		);
	}

	/**
	 * Retrieve the amount of orders made by a customer.
	 *
	 * @param int $customer_id Customer ID.
	 * @return int|null Amount of orders for customer or null on failure.
	 */
	public static function get_order_count( $customer_id ) {
		global $wpdb;
		$customer_id = absint( $customer_id );

		if ( 0 === $customer_id ) {
			return null;
		}

		$result = $wpdb->get_var(
			$wpdb->prepare(
				"SELECT COUNT( order_id ) FROM {$wpdb->prefix}wc_order_stats WHERE customer_id = %d",
				$customer_id
			)
		);

		if ( is_null( $result ) ) {
			return null;
		}

		return (int) $result;
	}

	/**
	 * Update the database with customer data.
	 *
	 * @param int $user_id WP User ID to update customer data for.
	 * @return int|bool|null Number or rows modified or false on failure.
	 */
	public static function update_registered_customer( $user_id ) {
		global $wpdb;

		$customer = new \WC_Customer( $user_id );

		if ( ! self::is_valid_customer( $user_id ) ) {
			return false;
		}

		$last_order = $customer->get_last_order();

		if ( ! $last_order ) {
			$first_name = get_user_meta( $user_id, 'first_name', true );
			$last_name  = get_user_meta( $user_id, 'last_name', true );
		} else {
			$first_name = $last_order->get_customer_first_name();
			$last_name  = $last_order->get_customer_last_name();
		}

		$last_active = $customer->get_meta( 'wc_last_active', true, 'edit' );
		$data        = array(
			'user_id'          => $user_id,
			'username'         => $customer->get_username( 'edit' ),
			'first_name'       => $first_name,
			'last_name'        => $last_name,
			'email'            => $customer->get_email( 'edit' ),
			'city'             => $customer->get_billing_city( 'edit' ),
			'state'            => $customer->get_billing_state( 'edit' ),
			'postcode'         => $customer->get_billing_postcode( 'edit' ),
			'country'          => $customer->get_billing_country( 'edit' ),
			'date_registered'  => $customer->get_date_created( 'edit' )->date( TimeInterval::$sql_datetime_format ),
			'date_last_active' => $last_active ? gmdate( 'Y-m-d H:i:s', $last_active ) : null,
		);
		$format      = array(
			'%d',
			'%s',
			'%s',
			'%s',
			'%s',
			'%s',
			'%s',
			'%s',
			'%s',
			'%s',
			'%s',
		);

		$customer_id = self::get_customer_id_by_user_id( $user_id );

		if ( $customer_id ) {
			// Preserve customer_id for existing user_id.
			$data['customer_id'] = $customer_id;
			$format[]            = '%d';
		}

		$results = $wpdb->replace( self::get_db_table_name(), $data, $format );

		/**
		 * Fires when customser's reports are updated.
		 *
		 * @param int $customer_id Customer ID.
		 */
		do_action( 'woocommerce_analytics_update_customer', $customer_id );

		ReportsCache::invalidate();

		return $results;
	}

	/**
	 * Check if a user ID is a valid customer or other user role with past orders.
	 *
	 * @param int $user_id User ID.
	 * @return bool
	 */
	protected static function is_valid_customer( $user_id ) {
		$customer = new \WC_Customer( $user_id );

		if ( absint( $customer->get_id() ) !== absint( $user_id ) ) {
			return false;
		}

		$customer_roles = (array) apply_filters( 'woocommerce_analytics_customer_roles', array( 'customer' ) );
		if ( $customer->get_order_count() < 1 && ! in_array( $customer->get_role(), $customer_roles, true ) ) {
			return false;
		}

		return true;
	}

	/**
	 * Delete a customer lookup row.
	 *
	 * @param int $customer_id Customer ID.
	 */
	public static function delete_customer( $customer_id ) {
		global $wpdb;

		$customer_id = (int) $customer_id;
		$num_deleted = $wpdb->delete( self::get_db_table_name(), array( 'customer_id' => $customer_id ) );

		if ( $num_deleted ) {
			/**
			 * Fires when a customer is deleted.
			 *
			 * @param int $order_id Order ID.
			 */
			do_action( 'woocommerce_analytics_delete_customer', $customer_id );

			ReportsCache::invalidate();
		}
	}

	/**
	 * Delete a customer lookup row by WordPress User ID.
	 *
	 * @param int $user_id WordPress User ID.
	 */
	public static function delete_customer_by_user_id( $user_id ) {
		global $wpdb;

		$user_id     = (int) $user_id;
		$num_deleted = $wpdb->delete( self::get_db_table_name(), array( 'user_id' => $user_id ) );

		if ( $num_deleted ) {
			ReportsCache::invalidate();
		}
	}

	/**
	 * Initialize query objects.
	 */
	protected function initialize_queries() {
		$this->clear_all_clauses();
		$table_name     = self::get_db_table_name();
		$this->subquery = new SqlQuery( $this->context . '_subquery' );
		$this->subquery->add_sql_clause( 'from', $table_name );
		$this->subquery->add_sql_clause( 'select', "{$table_name}.customer_id" );
		$this->subquery->add_sql_clause( 'group_by', "{$table_name}.customer_id" );
	}
}
woocommerce-admin/src/API/Reports/Customers/Controller.php000064400000061375151335517650017656 0ustar00<?php
/**
 * REST API Reports customers controller
 *
 * Handles requests to the /reports/customers endpoint.
 */

namespace Automattic\WooCommerce\Admin\API\Reports\Customers;

defined( 'ABSPATH' ) || exit;

use \Automattic\WooCommerce\Admin\API\Reports\ExportableTraits;
use \Automattic\WooCommerce\Admin\API\Reports\ExportableInterface;
use \Automattic\WooCommerce\Admin\API\Reports\TimeInterval;

/**
 * REST API Reports customers controller class.
 *
 * @extends WC_REST_Reports_Controller
 */
class Controller extends \WC_REST_Reports_Controller implements ExportableInterface {
	/**
	 * Exportable traits.
	 */
	use ExportableTraits;

	/**
	 * Endpoint namespace.
	 *
	 * @var string
	 */
	protected $namespace = 'wc-analytics';

	/**
	 * Route base.
	 *
	 * @var string
	 */
	protected $rest_base = 'reports/customers';

	/**
	 * Maps query arguments from the REST request.
	 *
	 * @param array $request Request array.
	 * @return array
	 */
	protected function prepare_reports_query( $request ) {
		$args                        = array();
		$args['registered_before']   = $request['registered_before'];
		$args['registered_after']    = $request['registered_after'];
		$args['order_before']        = $request['before'];
		$args['order_after']         = $request['after'];
		$args['page']                = $request['page'];
		$args['per_page']            = $request['per_page'];
		$args['order']               = $request['order'];
		$args['orderby']             = $request['orderby'];
		$args['match']               = $request['match'];
		$args['search']              = $request['search'];
		$args['searchby']            = $request['searchby'];
		$args['name_includes']       = $request['name_includes'];
		$args['name_excludes']       = $request['name_excludes'];
		$args['username_includes']   = $request['username_includes'];
		$args['username_excludes']   = $request['username_excludes'];
		$args['email_includes']      = $request['email_includes'];
		$args['email_excludes']      = $request['email_excludes'];
		$args['country_includes']    = $request['country_includes'];
		$args['country_excludes']    = $request['country_excludes'];
		$args['last_active_before']  = $request['last_active_before'];
		$args['last_active_after']   = $request['last_active_after'];
		$args['orders_count_min']    = $request['orders_count_min'];
		$args['orders_count_max']    = $request['orders_count_max'];
		$args['total_spend_min']     = $request['total_spend_min'];
		$args['total_spend_max']     = $request['total_spend_max'];
		$args['avg_order_value_min'] = $request['avg_order_value_min'];
		$args['avg_order_value_max'] = $request['avg_order_value_max'];
		$args['last_order_before']   = $request['last_order_before'];
		$args['last_order_after']    = $request['last_order_after'];
		$args['customers']           = $request['customers'];

		$between_params_numeric    = array( 'orders_count', 'total_spend', 'avg_order_value' );
		$normalized_params_numeric = TimeInterval::normalize_between_params( $request, $between_params_numeric, false );
		$between_params_date       = array( 'last_active', 'registered' );
		$normalized_params_date    = TimeInterval::normalize_between_params( $request, $between_params_date, true );
		$args                      = array_merge( $args, $normalized_params_numeric, $normalized_params_date );

		return $args;
	}

	/**
	 * Get all reports.
	 *
	 * @param WP_REST_Request $request Request data.
	 * @return array|WP_Error
	 */
	public function get_items( $request ) {
		$query_args      = $this->prepare_reports_query( $request );
		$customers_query = new Query( $query_args );
		$report_data     = $customers_query->get_data();

		$data = array();

		foreach ( $report_data->data as $customer_data ) {
			$item   = $this->prepare_item_for_response( $customer_data, $request );
			$data[] = $this->prepare_response_for_collection( $item );
		}

		$response = rest_ensure_response( $data );
		$response->header( 'X-WP-Total', (int) $report_data->total );
		$response->header( 'X-WP-TotalPages', (int) $report_data->pages );

		$page      = $report_data->page_no;
		$max_pages = $report_data->pages;
		$base      = add_query_arg( $request->get_query_params(), rest_url( sprintf( '/%s/%s', $this->namespace, $this->rest_base ) ) );
		if ( $page > 1 ) {
			$prev_page = $page - 1;
			if ( $prev_page > $max_pages ) {
				$prev_page = $max_pages;
			}
			$prev_link = add_query_arg( 'page', $prev_page, $base );
			$response->link_header( 'prev', $prev_link );
		}
		if ( $max_pages > $page ) {
			$next_page = $page + 1;
			$next_link = add_query_arg( 'page', $next_page, $base );
			$response->link_header( 'next', $next_link );
		}

		return $response;
	}


	/**
	 * Get one report.
	 *
	 * @param WP_REST_Request $request Request data.
	 * @return array|WP_Error
	 */
	public function get_item( $request ) {
		$query_args              = $this->prepare_reports_query( $request );
		$query_args['customers'] = array( $request->get_param( 'id' ) );
		$customers_query         = new Query( $query_args );
		$report_data             = $customers_query->get_data();

		$data = array();

		foreach ( $report_data->data as $customer_data ) {
			$item   = $this->prepare_item_for_response( $customer_data, $request );
			$data[] = $this->prepare_response_for_collection( $item );
		}

		$response = rest_ensure_response( $data );
		$response->header( 'X-WP-Total', (int) $report_data->total );
		$response->header( 'X-WP-TotalPages', (int) $report_data->pages );

		return $response;
	}

	/**
	 * Prepare a report object for serialization.
	 *
	 * @param array           $report  Report data.
	 * @param WP_REST_Request $request Request object.
	 * @return WP_REST_Response
	 */
	public function prepare_item_for_response( $report, $request ) {
		$context = ! empty( $request['context'] ) ? $request['context'] : 'view';
		$data    = $this->add_additional_fields_to_object( $report, $request );
		// Registered date is UTC.
		$data['date_registered_gmt'] = wc_rest_prepare_date_response( $data['date_registered'] );
		$data['date_registered']     = wc_rest_prepare_date_response( $data['date_registered'], false );
		// Last active date is local time.
		$data['date_last_active_gmt'] = wc_rest_prepare_date_response( $data['date_last_active'], false );
		$data['date_last_active']     = wc_rest_prepare_date_response( $data['date_last_active'] );
		$data                         = $this->filter_response_by_context( $data, $context );

		// Wrap the data in a response object.
		$response = rest_ensure_response( $data );
		$response->add_links( $this->prepare_links( $report ) );
		/**
		 * Filter a report returned from the API.
		 *
		 * Allows modification of the report data right before it is returned.
		 *
		 * @param WP_REST_Response $response The response object.
		 * @param object           $report   The original report object.
		 * @param WP_REST_Request  $request  Request used to generate the response.
		 */
		return apply_filters( 'woocommerce_rest_prepare_report_customers', $response, $report, $request );
	}

	/**
	 * Prepare links for the request.
	 *
	 * @param array $object Object data.
	 * @return array
	 */
	protected function prepare_links( $object ) {
		if ( empty( $object['user_id'] ) ) {
			return array();
		}

		return array(
			'customer'   => array(
				'href' => rest_url( sprintf( '/%s/customers/%d', $this->namespace, $object['id'] ) ),
			),
			'collection' => array(
				'href' => rest_url( sprintf( '/%s/customers', $this->namespace ) ),
			),
		);
	}

	/**
	 * Get the Report's schema, conforming to JSON Schema.
	 *
	 * @return array
	 */
	public function get_item_schema() {
		$schema = array(
			'$schema'    => 'http://json-schema.org/draft-04/schema#',
			'title'      => 'report_customers',
			'type'       => 'object',
			'properties' => array(
				'id'                   => array(
					'description' => __( 'Customer ID.', 'woocommerce' ),
					'type'        => 'integer',
					'context'     => array( 'view', 'edit' ),
					'readonly'    => true,
				),
				'user_id'              => array(
					'description' => __( 'User ID.', 'woocommerce' ),
					'type'        => 'integer',
					'context'     => array( 'view', 'edit' ),
					'readonly'    => true,
				),
				'name'                 => array(
					'description' => __( 'Name.', 'woocommerce' ),
					'type'        => 'string',
					'context'     => array( 'view', 'edit' ),
					'readonly'    => true,
				),
				'username'             => array(
					'description' => __( 'Username.', 'woocommerce' ),
					'type'        => 'string',
					'context'     => array( 'view', 'edit' ),
					'readonly'    => true,
				),
				'country'              => array(
					'description' => __( 'Country / Region.', 'woocommerce' ),
					'type'        => 'string',
					'context'     => array( 'view', 'edit' ),
					'readonly'    => true,
				),
				'city'                 => array(
					'description' => __( 'City.', 'woocommerce' ),
					'type'        => 'string',
					'context'     => array( 'view', 'edit' ),
					'readonly'    => true,
				),
				'state'                => array(
					'description' => __( 'Region.', 'woocommerce' ),
					'type'        => 'string',
					'context'     => array( 'view', 'edit' ),
					'readonly'    => true,
				),
				'postcode'             => array(
					'description' => __( 'Postal code.', 'woocommerce' ),
					'type'        => 'string',
					'context'     => array( 'view', 'edit' ),
					'readonly'    => true,
				),
				'date_registered'      => array(
					'description' => __( 'Date registered.', 'woocommerce' ),
					'type'        => 'date-time',
					'context'     => array( 'view', 'edit' ),
					'readonly'    => true,
				),
				'date_registered_gmt'  => array(
					'description' => __( 'Date registered GMT.', 'woocommerce' ),
					'type'        => 'date-time',
					'context'     => array( 'view', 'edit' ),
					'readonly'    => true,
				),
				'date_last_active'     => array(
					'description' => __( 'Date last active.', 'woocommerce' ),
					'type'        => 'date-time',
					'context'     => array( 'view', 'edit' ),
					'readonly'    => true,
				),
				'date_last_active_gmt' => array(
					'description' => __( 'Date last active GMT.', 'woocommerce' ),
					'type'        => 'date-time',
					'context'     => array( 'view', 'edit' ),
					'readonly'    => true,
				),
				'orders_count'         => array(
					'description' => __( 'Order count.', 'woocommerce' ),
					'type'        => 'integer',
					'context'     => array( 'view', 'edit' ),
					'readonly'    => true,
				),
				'total_spend'          => array(
					'description' => __( 'Total spend.', 'woocommerce' ),
					'type'        => 'number',
					'context'     => array( 'view', 'edit' ),
					'readonly'    => true,
				),
				'avg_order_value'      => array(
					'description' => __( 'Avg order value.', 'woocommerce' ),
					'type'        => 'number',
					'context'     => array( 'view', 'edit' ),
					'readonly'    => true,
				),
			),
		);
		return $this->add_additional_fields_schema( $schema );
	}

	/**
	 * Get the query params for collections.
	 *
	 * @return array
	 */
	public function get_collection_params() {
		$params                            = array();
		$params['context']                 = $this->get_context_param( array( 'default' => 'view' ) );
		$params['registered_before']       = array(
			'description'       => __( 'Limit response to objects registered before (or at) a given ISO8601 compliant datetime.', 'woocommerce' ),
			'type'              => 'string',
			'format'            => 'date-time',
			'validate_callback' => 'rest_validate_request_arg',
		);
		$params['registered_after']        = array(
			'description'       => __( 'Limit response to objects registered after (or at) a given ISO8601 compliant datetime.', 'woocommerce' ),
			'type'              => 'string',
			'format'            => 'date-time',
			'validate_callback' => 'rest_validate_request_arg',
		);
		$params['after']                   = array(
			'description'       => __( 'Limit response to resources with orders published after a given ISO8601 compliant date.', 'woocommerce' ),
			'type'              => 'string',
			'format'            => 'date-time',
			'validate_callback' => 'rest_validate_request_arg',
		);
		$params['before']                  = array(
			'description'       => __( 'Limit response to resources with orders published before a given ISO8601 compliant date.', 'woocommerce' ),
			'type'              => 'string',
			'format'            => 'date-time',
			'validate_callback' => 'rest_validate_request_arg',
		);
		$params['page']                    = array(
			'description'       => __( 'Current page of the collection.', 'woocommerce' ),
			'type'              => 'integer',
			'default'           => 1,
			'sanitize_callback' => 'absint',
			'validate_callback' => 'rest_validate_request_arg',
			'minimum'           => 1,
		);
		$params['per_page']                = array(
			'description'       => __( 'Maximum number of items to be returned in result set.', 'woocommerce' ),
			'type'              => 'integer',
			'default'           => 10,
			'minimum'           => 1,
			'maximum'           => 100,
			'sanitize_callback' => 'absint',
			'validate_callback' => 'rest_validate_request_arg',
		);
		$params['order']                   = array(
			'description'       => __( 'Order sort attribute ascending or descending.', 'woocommerce' ),
			'type'              => 'string',
			'default'           => 'desc',
			'enum'              => array( 'asc', 'desc' ),
			'validate_callback' => 'rest_validate_request_arg',
		);
		$params['orderby']                 = array(
			'description'       => __( 'Sort collection by object attribute.', 'woocommerce' ),
			'type'              => 'string',
			'default'           => 'date_registered',
			'enum'              => array(
				'username',
				'name',
				'country',
				'city',
				'state',
				'postcode',
				'date_registered',
				'date_last_active',
				'orders_count',
				'total_spend',
				'avg_order_value',
			),
			'validate_callback' => 'rest_validate_request_arg',
		);
		$params['match']                   = array(
			'description'       => __( 'Indicates whether all the conditions should be true for the resulting set, or if any one of them is sufficient. Match affects the following parameters: status_is, status_is_not, product_includes, product_excludes, coupon_includes, coupon_excludes, customer, categories', 'woocommerce' ),
			'type'              => 'string',
			'default'           => 'all',
			'enum'              => array(
				'all',
				'any',
			),
			'validate_callback' => 'rest_validate_request_arg',
		);
		$params['search']                  = array(
			'description'       => __( 'Limit response to objects with a customer field containing the search term. Searches the field provided by `searchby`.', 'woocommerce' ),
			'type'              => 'string',
			'validate_callback' => 'rest_validate_request_arg',
		);
		$params['searchby']                = array(
			'description' => 'Limit results with `search` and `searchby` to specific fields containing the search term.',
			'type'        => 'string',
			'default'     => 'name',
			'enum'        => array(
				'name',
				'username',
				'email',
			),
		);
		$params['name_includes']           = array(
			'description'       => __( 'Limit response to objects with specfic names.', 'woocommerce' ),
			'type'              => 'string',
			'validate_callback' => 'rest_validate_request_arg',
		);
		$params['name_excludes']           = array(
			'description'       => __( 'Limit response to objects excluding specfic names.', 'woocommerce' ),
			'type'              => 'string',
			'validate_callback' => 'rest_validate_request_arg',
		);
		$params['username_includes']       = array(
			'description'       => __( 'Limit response to objects with specfic usernames.', 'woocommerce' ),
			'type'              => 'string',
			'validate_callback' => 'rest_validate_request_arg',
		);
		$params['username_excludes']       = array(
			'description'       => __( 'Limit response to objects excluding specfic usernames.', 'woocommerce' ),
			'type'              => 'string',
			'validate_callback' => 'rest_validate_request_arg',
		);
		$params['email_includes']          = array(
			'description'       => __( 'Limit response to objects including emails.', 'woocommerce' ),
			'type'              => 'string',
			'validate_callback' => 'rest_validate_request_arg',
		);
		$params['email_excludes']          = array(
			'description'       => __( 'Limit response to objects excluding emails.', 'woocommerce' ),
			'type'              => 'string',
			'validate_callback' => 'rest_validate_request_arg',
		);
		$params['country_includes']        = array(
			'description'       => __( 'Limit response to objects with specfic countries.', 'woocommerce' ),
			'type'              => 'string',
			'validate_callback' => 'rest_validate_request_arg',
		);
		$params['country_excludes']        = array(
			'description'       => __( 'Limit response to objects excluding specfic countries.', 'woocommerce' ),
			'type'              => 'string',
			'validate_callback' => 'rest_validate_request_arg',
		);
		$params['last_active_before']      = array(
			'description'       => __( 'Limit response to objects last active before (or at) a given ISO8601 compliant datetime.', 'woocommerce' ),
			'type'              => 'string',
			'format'            => 'date-time',
			'validate_callback' => 'rest_validate_request_arg',
		);
		$params['last_active_after']       = array(
			'description'       => __( 'Limit response to objects last active after (or at) a given ISO8601 compliant datetime.', 'woocommerce' ),
			'type'              => 'string',
			'format'            => 'date-time',
			'validate_callback' => 'rest_validate_request_arg',
		);
		$params['last_active_between']     = array(
			'description'       => __( 'Limit response to objects last active between two given ISO8601 compliant datetime.', 'woocommerce' ),
			'type'              => 'array',
			'validate_callback' => array( '\Automattic\WooCommerce\Admin\API\Reports\TimeInterval', 'rest_validate_between_date_arg' ),
			'items'             => array(
				'type' => 'string',
			),
		);
		$params['registered_before']       = array(
			'description'       => __( 'Limit response to objects registered before (or at) a given ISO8601 compliant datetime.', 'woocommerce' ),
			'type'              => 'string',
			'format'            => 'date-time',
			'validate_callback' => 'rest_validate_request_arg',
		);
		$params['registered_after']        = array(
			'description'       => __( 'Limit response to objects registered after (or at) a given ISO8601 compliant datetime.', 'woocommerce' ),
			'type'              => 'string',
			'format'            => 'date-time',
			'validate_callback' => 'rest_validate_request_arg',
		);
		$params['registered_between']      = array(
			'description'       => __( 'Limit response to objects last active between two given ISO8601 compliant datetime.', 'woocommerce' ),
			'type'              => 'array',
			'validate_callback' => array( '\Automattic\WooCommerce\Admin\API\Reports\TimeInterval', 'rest_validate_between_date_arg' ),
			'items'             => array(
				'type' => 'string',
			),
		);
		$params['orders_count_min']        = array(
			'description'       => __( 'Limit response to objects with an order count greater than or equal to given integer.', 'woocommerce' ),
			'type'              => 'integer',
			'sanitize_callback' => 'absint',
			'validate_callback' => 'rest_validate_request_arg',
		);
		$params['orders_count_max']        = array(
			'description'       => __( 'Limit response to objects with an order count less than or equal to given integer.', 'woocommerce' ),
			'type'              => 'integer',
			'sanitize_callback' => 'absint',
			'validate_callback' => 'rest_validate_request_arg',
		);
		$params['orders_count_between']    = array(
			'description'       => __( 'Limit response to objects with an order count between two given integers.', 'woocommerce' ),
			'type'              => 'array',
			'validate_callback' => array( '\Automattic\WooCommerce\Admin\API\Reports\TimeInterval', 'rest_validate_between_numeric_arg' ),
			'items'             => array(
				'type' => 'integer',
			),
		);
		$params['total_spend_min']         = array(
			'description'       => __( 'Limit response to objects with a total order spend greater than or equal to given number.', 'woocommerce' ),
			'type'              => 'number',
			'validate_callback' => 'rest_validate_request_arg',
		);
		$params['total_spend_max']         = array(
			'description'       => __( 'Limit response to objects with a total order spend less than or equal to given number.', 'woocommerce' ),
			'type'              => 'number',
			'validate_callback' => 'rest_validate_request_arg',
		);
		$params['total_spend_between']     = array(
			'description'       => __( 'Limit response to objects with a total order spend between two given numbers.', 'woocommerce' ),
			'type'              => 'array',
			'validate_callback' => array( '\Automattic\WooCommerce\Admin\API\Reports\TimeInterval', 'rest_validate_between_numeric_arg' ),
			'items'             => array(
				'type' => 'integer',
			),
		);
		$params['avg_order_value_min']     = array(
			'description'       => __( 'Limit response to objects with an average order spend greater than or equal to given number.', 'woocommerce' ),
			'type'              => 'number',
			'validate_callback' => 'rest_validate_request_arg',
		);
		$params['avg_order_value_max']     = array(
			'description'       => __( 'Limit response to objects with an average order spend less than or equal to given number.', 'woocommerce' ),
			'type'              => 'number',
			'validate_callback' => 'rest_validate_request_arg',
		);
		$params['avg_order_value_between'] = array(
			'description'       => __( 'Limit response to objects with an average order spend between two given numbers.', 'woocommerce' ),
			'type'              => 'array',
			'validate_callback' => array( '\Automattic\WooCommerce\Admin\API\Reports\TimeInterval', 'rest_validate_between_numeric_arg' ),
			'items'             => array(
				'type' => 'integer',
			),
		);
		$params['last_order_before']       = array(
			'description'       => __( 'Limit response to objects with last order before (or at) a given ISO8601 compliant datetime.', 'woocommerce' ),
			'type'              => 'string',
			'format'            => 'date-time',
			'validate_callback' => 'rest_validate_request_arg',
		);
		$params['last_order_after']        = array(
			'description'       => __( 'Limit response to objects with last order after (or at) a given ISO8601 compliant datetime.', 'woocommerce' ),
			'type'              => 'string',
			'format'            => 'date-time',
			'validate_callback' => 'rest_validate_request_arg',
		);
		$params['customers']               = array(
			'description'       => __( 'Limit result to items with specified customer ids.', 'woocommerce' ),
			'type'              => 'array',
			'sanitize_callback' => 'wp_parse_id_list',
			'validate_callback' => 'rest_validate_request_arg',
			'items'             => array(
				'type' => 'integer',
			),
		);

		return $params;
	}

	/**
	 * Get the column names for export.
	 *
	 * @return array Key value pair of Column ID => Label.
	 */
	public function get_export_columns() {
		$export_columns = array(
			'name'            => __( 'Name', 'woocommerce' ),
			'username'        => __( 'Username', 'woocommerce' ),
			'last_active'     => __( 'Last Active', 'woocommerce' ),
			'registered'      => __( 'Sign Up', 'woocommerce' ),
			'email'           => __( 'Email', 'woocommerce' ),
			'orders_count'    => __( 'Orders', 'woocommerce' ),
			'total_spend'     => __( 'Total Spend', 'woocommerce' ),
			'avg_order_value' => __( 'AOV', 'woocommerce' ),
			'country'         => __( 'Country / Region', 'woocommerce' ),
			'city'            => __( 'City', 'woocommerce' ),
			'region'          => __( 'Region', 'woocommerce' ),
			'postcode'        => __( 'Postal Code', 'woocommerce' ),
		);

		/**
		 * Filter to add or remove column names from the customers report for
		 * export.
		 *
		 * @since 1.6.0
		 */
		return apply_filters(
			'woocommerce_report_customers_export_columns',
			$export_columns
		);
	}

	/**
	 * Get the column values for export.
	 *
	 * @param array $item Single report item/row.
	 * @return array Key value pair of Column ID => Row Value.
	 */
	public function prepare_item_for_export( $item ) {
		$export_item = array(
			'name'            => $item['name'],
			'username'        => $item['username'],
			'last_active'     => $item['date_last_active'],
			'registered'      => $item['date_registered'],
			'email'           => $item['email'],
			'orders_count'    => $item['orders_count'],
			'total_spend'     => self::csv_number_format( $item['total_spend'] ),
			'avg_order_value' => self::csv_number_format( $item['avg_order_value'] ),
			'country'         => $item['country'],
			'city'            => $item['city'],
			'region'          => $item['state'],
			'postcode'        => $item['postcode'],
		);

		return apply_filters(
			'woocommerce_report_customers_prepare_export_item',
			$export_item,
			$item
		);
	}
}
woocommerce-admin/src/API/Reports/Categories/Query.php000064400000002370151335517650016727 0ustar00<?php
/**
 * Class for parameter-based Categories Report querying
 *
 * Example usage:
 * $args = array(
 *          'before'       => '2018-07-19 00:00:00',
 *          'after'        => '2018-07-05 00:00:00',
 *          'page'         => 2,
 *          'order'        => 'desc',
 *          'orderby'      => 'items_sold',
 *         );
 * $report = new \Automattic\WooCommerce\Admin\API\Reports\Categories\Query( $args );
 * $mydata = $report->get_data();
 */

namespace Automattic\WooCommerce\Admin\API\Reports\Categories;

defined( 'ABSPATH' ) || exit;

use \Automattic\WooCommerce\Admin\API\Reports\Query as ReportsQuery;

/**
 * API\Reports\Query
 */
class Query extends ReportsQuery {

	const REPORT_NAME = 'report-categories';

	/**
	 * Valid fields for Categories report.
	 *
	 * @return array
	 */
	protected function get_default_query_vars() {
		return array();
	}

	/**
	 * Get categories data based on the current query vars.
	 *
	 * @return array
	 */
	public function get_data() {
		$args    = apply_filters( 'woocommerce_analytics_categories_query_args', $this->get_query_vars() );
		$results = \WC_Data_Store::load( self::REPORT_NAME )->get_data( $args );
		return apply_filters( 'woocommerce_analytics_categories_select_query', $results, $args );
	}
}
woocommerce-admin/src/API/Reports/Categories/DataStore.php000064400000025144151335517650017514 0ustar00<?php
/**
 * API\Reports\Categories\DataStore class file.
 */

namespace Automattic\WooCommerce\Admin\API\Reports\Categories;

defined( 'ABSPATH' ) || exit;

use \Automattic\WooCommerce\Admin\API\Reports\DataStore as ReportsDataStore;
use \Automattic\WooCommerce\Admin\API\Reports\DataStoreInterface;
use \Automattic\WooCommerce\Admin\API\Reports\TimeInterval;
use \Automattic\WooCommerce\Admin\API\Reports\SqlQuery;

/**
 * API\Reports\Categories\DataStore.
 */
class DataStore extends ReportsDataStore implements DataStoreInterface {

	/**
	 * Table used to get the data.
	 *
	 * @var string
	 */
	protected static $table_name = 'wc_order_product_lookup';

	/**
	 * Cache identifier.
	 *
	 * @var string
	 */
	protected $cache_key = 'categories';

	/**
	 * Order by setting used for sorting categories data.
	 *
	 * @var string
	 */
	private $order_by = '';

	/**
	 * Order setting used for sorting categories data.
	 *
	 * @var string
	 */
	private $order = '';

	/**
	 * Mapping columns to data type to return correct response types.
	 *
	 * @var array
	 */
	protected $column_types = array(
		'category_id'    => 'intval',
		'items_sold'     => 'intval',
		'net_revenue'    => 'floatval',
		'orders_count'   => 'intval',
		'products_count' => 'intval',
	);

	/**
	 * Data store context used to pass to filters.
	 *
	 * @var string
	 */
	protected $context = 'categories';

	/**
	 * Assign report columns once full table name has been assigned.
	 */
	protected function assign_report_columns() {
		$table_name           = self::get_db_table_name();
		$this->report_columns = array(
			'items_sold'     => 'SUM(product_qty) as items_sold',
			'net_revenue'    => 'SUM(product_net_revenue) AS net_revenue',
			'orders_count'   => "COUNT(DISTINCT {$table_name}.order_id) as orders_count",
			'products_count' => "COUNT(DISTINCT {$table_name}.product_id) as products_count",
		);
	}

	/**
	 * Return the database query with parameters used for Categories report: time span and order status.
	 *
	 * @param array $query_args Query arguments supplied by the user.
	 */
	protected function add_sql_query_params( $query_args ) {
		global $wpdb;
		$order_product_lookup_table = self::get_db_table_name();

		$this->add_time_period_sql_params( $query_args, $order_product_lookup_table );

		// join wp_order_product_lookup_table with relationships and taxonomies
		// @todo How to handle custom product tables?
		$this->subquery->add_sql_clause( 'left_join', "LEFT JOIN {$wpdb->term_relationships} ON {$order_product_lookup_table}.product_id = {$wpdb->term_relationships}.object_id" );
		// Adding this (inner) JOIN as a LEFT JOIN for ordering purposes. See comment in add_order_by_params().
		$this->subquery->add_sql_clause( 'left_join', "JOIN {$wpdb->term_taxonomy} ON {$wpdb->term_taxonomy}.term_taxonomy_id = {$wpdb->term_relationships}.term_taxonomy_id" );
		$this->subquery->add_sql_clause( 'left_join', "LEFT JOIN {$wpdb->wc_category_lookup} ON {$wpdb->term_taxonomy}.term_id = {$wpdb->wc_category_lookup}.category_id" );

		$included_categories = $this->get_included_categories( $query_args );
		if ( $included_categories ) {
			$this->subquery->add_sql_clause( 'where', "AND {$wpdb->wc_category_lookup}.category_tree_id IN ({$included_categories})" );

			// Limit is left out here so that the grouping in code by PHP can be applied correctly.
			// This also needs to be put after the term_taxonomy JOIN so that we can match the correct term name.
			$this->add_order_by_params( $query_args, 'outer', 'default_results.category_id' );
		} else {
			$this->add_order_by_params( $query_args, 'inner', "{$wpdb->wc_category_lookup}.category_tree_id" );
		}

		$this->add_order_status_clause( $query_args, $order_product_lookup_table, $this->subquery );
		$this->subquery->add_sql_clause( 'where', "AND {$wpdb->wc_category_lookup}.category_tree_id IS NOT NULL" );
	}

	/**
	 * Fills ORDER BY clause of SQL request based on user supplied parameters.
	 *
	 * @param array  $query_args Parameters supplied by the user.
	 * @param string $from_arg   Target of the JOIN sql param.
	 * @param string $id_cell    ID cell identifier, like `table_name.id_column_name`.
	 */
	protected function add_order_by_params( $query_args, $from_arg, $id_cell ) {
		global $wpdb;
		$lookup_table    = self::get_db_table_name();
		$order_by_clause = $this->add_order_by_clause( $query_args, $this );
		$this->add_orderby_order_clause( $query_args, $this );

		if ( false !== strpos( $order_by_clause, '_terms' ) ) {
			$join = "JOIN {$wpdb->terms} AS _terms ON {$id_cell} = _terms.term_id";
			if ( 'inner' === $from_arg ) {
				// Even though this is an (inner) JOIN, we're adding it as a `left_join` to
				// affect its order in the query statement. The SqlQuery::$sql_filters variable
				// determines the order in which joins are concatenated.
				// See: https://github.com/woocommerce/woocommerce-admin/blob/1f261998e7287b77bc13c3d4ee2e84b717da7957/src/API/Reports/SqlQuery.php#L46-L50.
				$this->subquery->add_sql_clause( 'left_join', $join );
			} else {
				$this->add_sql_clause( 'join', $join );
			}
		}
	}

	/**
	 * Maps ordering specified by the user to columns in the database/fields in the data.
	 *
	 * @param string $order_by Sorting criterion.
	 * @return string
	 */
	protected function normalize_order_by( $order_by ) {
		if ( 'date' === $order_by ) {
			return 'time_interval';
		}
		if ( 'category' === $order_by ) {
			return '_terms.name';
		}
		return $order_by;
	}

	/**
	 * Returns an array of ids of included categories, based on query arguments from the user.
	 *
	 * @param array $query_args Parameters supplied by the user.
	 * @return string
	 */
	protected function get_included_categories_array( $query_args ) {
		if ( isset( $query_args['category_includes'] ) && is_array( $query_args['category_includes'] ) && count( $query_args['category_includes'] ) > 0 ) {
			return $query_args['category_includes'];
		}
		return array();
	}

	/**
	 * Returns the page of data according to page number and items per page.
	 *
	 * @param array   $data           Data to paginate.
	 * @param integer $page_no        Page number.
	 * @param integer $items_per_page Number of items per page.
	 * @return array
	 */
	protected function page_records( $data, $page_no, $items_per_page ) {
		$offset = ( $page_no - 1 ) * $items_per_page;
		return array_slice( $data, $offset, $items_per_page );
	}

	/**
	 * Enriches the category data.
	 *
	 * @param array $categories_data Categories data.
	 * @param array $query_args  Query parameters.
	 */
	protected function include_extended_info( &$categories_data, $query_args ) {
		foreach ( $categories_data as $key => $category_data ) {
			$extended_info = new \ArrayObject();
			if ( $query_args['extended_info'] ) {
				$extended_info['name'] = get_the_category_by_ID( $category_data['category_id'] );
			}
			$categories_data[ $key ]['extended_info'] = $extended_info;
		}
	}

	/**
	 * Returns the report data based on parameters supplied by the user.
	 *
	 * @param array $query_args  Query parameters.
	 * @return stdClass|WP_Error Data.
	 */
	public function get_data( $query_args ) {
		global $wpdb;

		$table_name = self::get_db_table_name();

		// These defaults are only partially applied when used via REST API, as that has its own defaults.
		$defaults   = array(
			'per_page'          => get_option( 'posts_per_page' ),
			'page'              => 1,
			'order'             => 'DESC',
			'orderby'           => 'date',
			'before'            => TimeInterval::default_before(),
			'after'             => TimeInterval::default_after(),
			'fields'            => '*',
			'category_includes' => array(),
			'extended_info'     => false,
		);
		$query_args = wp_parse_args( $query_args, $defaults );
		$this->normalize_timezones( $query_args, $defaults );

		/*
		 * We need to get the cache key here because
		 * parent::update_intervals_sql_params() modifies $query_args.
		 */
		$cache_key = $this->get_cache_key( $query_args );
		$data      = $this->get_cached_data( $cache_key );

		if ( false === $data ) {
			$this->initialize_queries();

			$data = (object) array(
				'data'    => array(),
				'total'   => 0,
				'pages'   => 0,
				'page_no' => 0,
			);

			$this->subquery->add_sql_clause( 'select', $this->selected_columns( $query_args ) );
			$included_categories = $this->get_included_categories_array( $query_args );
			$this->add_sql_query_params( $query_args );

			if ( count( $included_categories ) > 0 ) {
				$fields    = $this->get_fields( $query_args );
				$ids_table = $this->get_ids_table( $included_categories, 'category_id' );

				$this->add_sql_clause( 'select', $this->format_join_selections( array_merge( array( 'category_id' ), $fields ), array( 'category_id' ) ) );
				$this->add_sql_clause( 'from', '(' );
				$this->add_sql_clause( 'from', $this->subquery->get_query_statement() );
				$this->add_sql_clause( 'from', ") AS {$table_name}" );
				$this->add_sql_clause(
					'right_join',
					"RIGHT JOIN ( {$ids_table} ) AS default_results
					ON default_results.category_id = {$table_name}.category_id"
				);

				$categories_query = $this->get_query_statement();
			} else {
				$this->subquery->add_sql_clause( 'order_by', $this->get_sql_clause( 'order_by' ) );
				$categories_query = $this->subquery->get_query_statement();
			}
			$categories_data = $wpdb->get_results(
				$categories_query,
				ARRAY_A
			); // WPCS: cache ok, DB call ok, unprepared SQL ok.

			if ( null === $categories_data ) {
				return new \WP_Error( 'woocommerce_analytics_categories_result_failed', __( 'Sorry, fetching revenue data failed.', 'woocommerce' ), array( 'status' => 500 ) );
			}

			$record_count = count( $categories_data );
			$total_pages  = (int) ceil( $record_count / $query_args['per_page'] );
			if ( $query_args['page'] < 1 || $query_args['page'] > $total_pages ) {
				return $data;
			}

			$categories_data = $this->page_records( $categories_data, $query_args['page'], $query_args['per_page'] );
			$this->include_extended_info( $categories_data, $query_args );
			$categories_data = array_map( array( $this, 'cast_numbers' ), $categories_data );
			$data            = (object) array(
				'data'    => $categories_data,
				'total'   => $record_count,
				'pages'   => $total_pages,
				'page_no' => (int) $query_args['page'],
			);

			$this->set_cached_data( $cache_key, $data );
		}

		return $data;
	}

	/**
	 * Initialize query objects.
	 */
	protected function initialize_queries() {
		global $wpdb;
		$this->subquery = new SqlQuery( $this->context . '_subquery' );
		$this->subquery->add_sql_clause( 'select', "{$wpdb->wc_category_lookup}.category_tree_id as category_id," );
		$this->subquery->add_sql_clause( 'from', self::get_db_table_name() );
		$this->subquery->add_sql_clause( 'group_by', "{$wpdb->wc_category_lookup}.category_tree_id" );
	}
}
woocommerce-admin/src/API/Reports/Categories/Controller.php000064400000027313151335517650017751 0ustar00<?php
/**
 * REST API Reports categories controller
 *
 * Handles requests to the /reports/categories endpoint.
 */

namespace Automattic\WooCommerce\Admin\API\Reports\Categories;

defined( 'ABSPATH' ) || exit;

use \Automattic\WooCommerce\Admin\API\Reports\Controller as ReportsController;
use \Automattic\WooCommerce\Admin\API\Reports\ExportableInterface;

/**
 * REST API Reports categories controller class.
 *
 * @extends \Automattic\WooCommerce\Admin\API\Reports\Controller
 */
class Controller extends ReportsController implements ExportableInterface {

	/**
	 * Endpoint namespace.
	 *
	 * @var string
	 */
	protected $namespace = 'wc-analytics';

	/**
	 * Route base.
	 *
	 * @var string
	 */
	protected $rest_base = 'reports/categories';

	/**
	 * Maps query arguments from the REST request.
	 *
	 * @param array $request Request array.
	 * @return array
	 */
	protected function prepare_reports_query( $request ) {
		$args                      = array();
		$args['before']            = $request['before'];
		$args['after']             = $request['after'];
		$args['interval']          = $request['interval'];
		$args['page']              = $request['page'];
		$args['per_page']          = $request['per_page'];
		$args['orderby']           = $request['orderby'];
		$args['order']             = $request['order'];
		$args['extended_info']     = $request['extended_info'];
		$args['category_includes'] = (array) $request['categories'];
		$args['status_is']         = (array) $request['status_is'];
		$args['status_is_not']     = (array) $request['status_is_not'];

		return $args;
	}

	/**
	 * Get all reports.
	 *
	 * @param WP_REST_Request $request Request data.
	 * @return array|WP_Error
	 */
	public function get_items( $request ) {
		$query_args       = $this->prepare_reports_query( $request );
		$categories_query = new Query( $query_args );
		$report_data      = $categories_query->get_data();

		if ( is_wp_error( $report_data ) ) {
			return $report_data;
		}

		if ( ! isset( $report_data->data ) || ! isset( $report_data->page_no ) || ! isset( $report_data->pages ) ) {
			return new \WP_Error( 'woocommerce_rest_reports_categories_invalid_response', __( 'Invalid response from data store.', 'woocommerce' ), array( 'status' => 500 ) );
		}

		$out_data = array();

		foreach ( $report_data->data as $datum ) {
			$item       = $this->prepare_item_for_response( $datum, $request );
			$out_data[] = $this->prepare_response_for_collection( $item );
		}

		$response = rest_ensure_response( $out_data );
		$response->header( 'X-WP-Total', (int) $report_data->total );
		$response->header( 'X-WP-TotalPages', (int) $report_data->pages );

		$page      = $report_data->page_no;
		$max_pages = $report_data->pages;
		$base      = add_query_arg( $request->get_query_params(), rest_url( sprintf( '/%s/%s', $this->namespace, $this->rest_base ) ) );
		if ( $page > 1 ) {
			$prev_page = $page - 1;
			if ( $prev_page > $max_pages ) {
				$prev_page = $max_pages;
			}
			$prev_link = add_query_arg( 'page', $prev_page, $base );
			$response->link_header( 'prev', $prev_link );
		}
		if ( $max_pages > $page ) {
			$next_page = $page + 1;
			$next_link = add_query_arg( 'page', $next_page, $base );
			$response->link_header( 'next', $next_link );
		}

		return $response;
	}

	/**
	 * Prepare a report object for serialization.
	 *
	 * @param stdClass        $report  Report data.
	 * @param WP_REST_Request $request Request object.
	 * @return WP_REST_Response
	 */
	public function prepare_item_for_response( $report, $request ) {
		$data = $report;

		$context = ! empty( $request['context'] ) ? $request['context'] : 'view';
		$data    = $this->add_additional_fields_to_object( $data, $request );
		$data    = $this->filter_response_by_context( $data, $context );

		// Wrap the data in a response object.
		$response = rest_ensure_response( $data );
		$response->add_links( $this->prepare_links( $report ) );

		/**
		 * Filter a report returned from the API.
		 *
		 * Allows modification of the report data right before it is returned.
		 *
		 * @param WP_REST_Response $response The response object.
		 * @param object           $report   The original report object.
		 * @param WP_REST_Request  $request  Request used to generate the response.
		 */
		return apply_filters( 'woocommerce_rest_prepare_report_categories', $response, $report, $request );
	}

	/**
	 * Prepare links for the request.
	 *
	 * @param \Automattic\WooCommerce\Admin\API\Reports\Query $object Object data.
	 * @return array
	 */
	protected function prepare_links( $object ) {
		$links = array(
			'category' => array(
				'href' => rest_url( sprintf( '/%s/products/categories/%d', $this->namespace, $object['category_id'] ) ),
			),
		);

		return $links;
	}

	/**
	 * Get the Report's schema, conforming to JSON Schema.
	 *
	 * @return array
	 */
	public function get_item_schema() {
		$schema = array(
			'$schema'    => 'http://json-schema.org/draft-04/schema#',
			'title'      => 'report_categories',
			'type'       => 'object',
			'properties' => array(
				'category_id'    => array(
					'description' => __( 'Category ID.', 'woocommerce' ),
					'type'        => 'integer',
					'context'     => array( 'view', 'edit' ),
					'readonly'    => true,
				),
				'items_sold'     => array(
					'description' => __( 'Amount of items sold.', 'woocommerce' ),
					'type'        => 'integer',
					'context'     => array( 'view', 'edit' ),
					'readonly'    => true,
				),
				'net_revenue'    => array(
					'description' => __( 'Total sales.', 'woocommerce' ),
					'type'        => 'number',
					'context'     => array( 'view', 'edit' ),
					'readonly'    => true,
				),
				'orders_count'   => array(
					'description' => __( 'Number of orders.', 'woocommerce' ),
					'type'        => 'integer',
					'context'     => array( 'view', 'edit' ),
					'readonly'    => true,
				),
				'products_count' => array(
					'description' => __( 'Amount of products.', 'woocommerce' ),
					'type'        => 'integer',
					'context'     => array( 'view', 'edit' ),
					'readonly'    => true,
				),
				'extended_info'  => array(
					'name' => array(
						'type'        => 'string',
						'readonly'    => true,
						'context'     => array( 'view', 'edit' ),
						'description' => __( 'Category name.', 'woocommerce' ),
					),
				),
			),
		);

		return $this->add_additional_fields_schema( $schema );
	}

	/**
	 * Get the query params for collections.
	 *
	 * @return array
	 */
	public function get_collection_params() {
		$params                  = array();
		$params['context']       = $this->get_context_param( array( 'default' => 'view' ) );
		$params['page']          = array(
			'description'       => __( 'Current page of the collection.', 'woocommerce' ),
			'type'              => 'integer',
			'default'           => 1,
			'sanitize_callback' => 'absint',
			'validate_callback' => 'rest_validate_request_arg',
			'minimum'           => 1,
		);
		$params['per_page']      = array(
			'description'       => __( 'Maximum number of items to be returned in result set.', 'woocommerce' ),
			'type'              => 'integer',
			'default'           => 10,
			'minimum'           => 1,
			'maximum'           => 100,
			'sanitize_callback' => 'absint',
			'validate_callback' => 'rest_validate_request_arg',
		);
		$params['after']         = array(
			'description'       => __( 'Limit response to resources published after a given ISO8601 compliant date.', 'woocommerce' ),
			'type'              => 'string',
			'format'            => 'date-time',
			'validate_callback' => 'rest_validate_request_arg',
		);
		$params['before']        = array(
			'description'       => __( 'Limit response to resources published before a given ISO8601 compliant date.', 'woocommerce' ),
			'type'              => 'string',
			'format'            => 'date-time',
			'validate_callback' => 'rest_validate_request_arg',
		);
		$params['order']         = array(
			'description'       => __( 'Order sort attribute ascending or descending.', 'woocommerce' ),
			'type'              => 'string',
			'default'           => 'desc',
			'enum'              => array( 'asc', 'desc' ),
			'validate_callback' => 'rest_validate_request_arg',
		);
		$params['orderby']       = array(
			'description'       => __( 'Sort collection by object attribute.', 'woocommerce' ),
			'type'              => 'string',
			'default'           => 'category_id',
			'enum'              => array(
				'category_id',
				'items_sold',
				'net_revenue',
				'orders_count',
				'products_count',
				'category',
			),
			'validate_callback' => 'rest_validate_request_arg',
		);
		$params['interval']      = array(
			'description'       => __( 'Time interval to use for buckets in the returned data.', 'woocommerce' ),
			'type'              => 'string',
			'default'           => 'week',
			'enum'              => array(
				'hour',
				'day',
				'week',
				'month',
				'quarter',
				'year',
			),
			'validate_callback' => 'rest_validate_request_arg',
		);
		$params['status_is']     = array(
			'description'       => __( 'Limit result set to items that have the specified order status.', 'woocommerce' ),
			'type'              => 'array',
			'sanitize_callback' => 'wp_parse_slug_list',
			'validate_callback' => 'rest_validate_request_arg',
			'items'             => array(
				'enum' => self::get_order_statuses(),
				'type' => 'string',
			),
		);
		$params['status_is_not'] = array(
			'description'       => __( 'Limit result set to items that don\'t have the specified order status.', 'woocommerce' ),
			'type'              => 'array',
			'sanitize_callback' => 'wp_parse_slug_list',
			'validate_callback' => 'rest_validate_request_arg',
			'items'             => array(
				'enum' => self::get_order_statuses(),
				'type' => 'string',
			),
		);
		$params['categories']    = array(
			'description'       => __( 'Limit result set to all items that have the specified term assigned in the categories taxonomy.', 'woocommerce' ),
			'type'              => 'array',
			'sanitize_callback' => 'wp_parse_id_list',
			'validate_callback' => 'rest_validate_request_arg',
			'items'             => array(
				'type' => 'integer',
			),
		);
		$params['extended_info'] = array(
			'description'       => __( 'Add additional piece of info about each category to the report.', 'woocommerce' ),
			'type'              => 'boolean',
			'default'           => false,
			'sanitize_callback' => 'wc_string_to_bool',
			'validate_callback' => 'rest_validate_request_arg',
		);

		return $params;
	}

	/**
	 * Get the column names for export.
	 *
	 * @return array Key value pair of Column ID => Label.
	 */
	public function get_export_columns() {
		$export_columns = array(
			'category'       => __( 'Category', 'woocommerce' ),
			'items_sold'     => __( 'Items sold', 'woocommerce' ),
			'net_revenue'    => __( 'Net Revenue', 'woocommerce' ),
			'products_count' => __( 'Products', 'woocommerce' ),
			'orders_count'   => __( 'Orders', 'woocommerce' ),
		);

		/**
		 * Filter to add or remove column names from the categories report for
		 * export.
		 *
		 * @since 1.6.0
		 */
		return apply_filters(
			'woocommerce_report_categories_export_columns',
			$export_columns
		);
	}

	/**
	 * Get the column values for export.
	 *
	 * @param array $item Single report item/row.
	 * @return array Key value pair of Column ID => Row Value.
	 */
	public function prepare_item_for_export( $item ) {
		$export_item = array(
			'category'       => $item['extended_info']['name'],
			'items_sold'     => $item['items_sold'],
			'net_revenue'    => $item['net_revenue'],
			'products_count' => $item['products_count'],
			'orders_count'   => $item['orders_count'],
		);

		/**
		 * Filter to prepare extra columns in the export item for the
		 * categories export.
		 *
		 * @since 1.6.0
		 */
		return apply_filters(
			'woocommerce_report_categories_prepare_export_item',
			$export_item,
			$item
		);
	}
}
woocommerce-admin/src/API/Reports/DataStore.php000064400000134454151335517650015434 0ustar00<?php
/**
 * Admin\API\Reports\DataStore class file.
 */

namespace Automattic\WooCommerce\Admin\API\Reports;

if ( ! defined( 'ABSPATH' ) ) {
	exit;
}

use \Automattic\WooCommerce\Admin\API\Reports\TimeInterval;

/**
 * Admin\API\Reports\DataStore: Common parent for custom report data stores.
 */
class DataStore extends SqlQuery {

	/**
	 * Cache group for the reports.
	 *
	 * @var string
	 */
	protected $cache_group = 'reports';

	/**
	 * Time out for the cache.
	 *
	 * @var int
	 */
	protected $cache_timeout = 3600;

	/**
	 * Table used as a data store for this report.
	 *
	 * @var string
	 */
	protected static $table_name = '';

	/**
	 * Mapping columns to data type to return correct response types.
	 *
	 * @var array
	 */
	protected $column_types = array();

	// @todo This does not really belong here, maybe factor out the comparison as separate class?
	/**
	 * Order by property, used in the cmp function.
	 *
	 * @var string
	 */
	private $order_by = '';
	/**
	 * Order property, used in the cmp function.
	 *
	 * @var string
	 */
	private $order = '';
	/**
	 * Query limit parameters.
	 *
	 * @var array
	 */
	private $limit_parameters = array();
	/**
	 * Data store context used to pass to filters.
	 *
	 * @var string
	 */
	protected $context = 'reports';

	/**
	 * Subquery object for query nesting.
	 *
	 * @var SqlQuery
	 */
	protected $subquery;

	/**
	 * Totals query object.
	 *
	 * @var SqlQuery
	 */
	protected $total_query;

	/**
	 * Intervals query object.
	 *
	 * @var SqlQuery
	 */
	protected $interval_query;

	/**
	 * Class constructor.
	 */
	public function __construct() {
		self::set_db_table_name();
		$this->assign_report_columns();

		if ( property_exists( $this, 'report_columns' ) ) {
			$this->report_columns = apply_filters(
				'woocommerce_admin_report_columns',
				$this->report_columns,
				$this->context,
				self::get_db_table_name()
			);
		}
	}

	/**
	 * Get table name from database class.
	 */
	public static function get_db_table_name() {
		global $wpdb;
		return isset( $wpdb->{static::$table_name} ) ? $wpdb->{static::$table_name} : $wpdb->prefix . static::$table_name;
	}

	/**
	 * Set table name from database class.
	 */
	protected static function set_db_table_name() {
		global $wpdb;
		if ( static::$table_name && ! isset( $wpdb->{static::$table_name} ) ) {
			$wpdb->{static::$table_name} = $wpdb->prefix . static::$table_name;
		}
	}

	/**
	 * Whether or not the report should use the caching layer.
	 *
	 * Provides an opportunity for plugins to prevent reports from using cache.
	 *
	 * @return boolean Whether or not to utilize caching.
	 */
	protected function should_use_cache() {
		/**
		 * Determines if a report will utilize caching.
		 *
		 * @param bool $use_cache Whether or not to use cache.
		 * @param string $cache_key The report's cache key. Used to identify the report.
		 */
		return (bool) apply_filters( 'woocommerce_analytics_report_should_use_cache', true, $this->cache_key );
	}

	/**
	 * Returns string to be used as cache key for the data.
	 *
	 * @param array $params Query parameters.
	 * @return string
	 */
	protected function get_cache_key( $params ) {
		return implode(
			'_',
			array(
				'wc_report',
				$this->cache_key,
				md5( wp_json_encode( $params ) ),
			)
		);
	}

	/**
	 * Wrapper around Cache::get().
	 *
	 * @param string $cache_key Cache key.
	 * @return mixed
	 */
	protected function get_cached_data( $cache_key ) {
		if ( $this->should_use_cache() ) {
			return Cache::get( $cache_key );
		}

		return false;
	}

	/**
	 * Wrapper around Cache::set().
	 *
	 * @param string $cache_key Cache key.
	 * @param mixed  $value     New value.
	 * @return bool
	 */
	protected function set_cached_data( $cache_key, $value ) {
		if ( $this->should_use_cache() ) {
			return Cache::set( $cache_key, $value );
		}

		return true;
	}

	/**
	 * Compares two report data objects by pre-defined object property and ASC/DESC ordering.
	 *
	 * @param stdClass $a Object a.
	 * @param stdClass $b Object b.
	 * @return string
	 */
	private function interval_cmp( $a, $b ) {
		if ( '' === $this->order_by || '' === $this->order ) {
			return 0;
			// @todo Should return WP_Error here perhaps?
		}
		if ( $a[ $this->order_by ] === $b[ $this->order_by ] ) {
			// As relative order is undefined in case of equality in usort, second-level sorting by date needs to be enforced
			// so that paging is stable.
			if ( $a['time_interval'] === $b['time_interval'] ) {
				return 0; // This should never happen.
			} elseif ( $a['time_interval'] > $b['time_interval'] ) {
				return 1;
			} elseif ( $a['time_interval'] < $b['time_interval'] ) {
				return -1;
			}
		} elseif ( $a[ $this->order_by ] > $b[ $this->order_by ] ) {
			return strtolower( $this->order ) === 'desc' ? -1 : 1;
		} elseif ( $a[ $this->order_by ] < $b[ $this->order_by ] ) {
			return strtolower( $this->order ) === 'desc' ? 1 : -1;
		}
	}

	/**
	 * Sorts intervals according to user's request.
	 *
	 * They are pre-sorted in SQL, but after adding gaps, they need to be sorted including the added ones.
	 *
	 * @param stdClass $data      Data object, must contain an array under $data->intervals.
	 * @param string   $sort_by   Ordering property.
	 * @param string   $direction DESC/ASC.
	 */
	protected function sort_intervals( &$data, $sort_by, $direction ) {
		$this->sort_array( $data->intervals, $sort_by, $direction );
	}

	/**
	 * Sorts array of arrays based on subarray key $sort_by.
	 *
	 * @param array  $arr       Array to sort.
	 * @param string $sort_by   Ordering property.
	 * @param string $direction DESC/ASC.
	 */
	protected function sort_array( &$arr, $sort_by, $direction ) {
		$this->order_by = $this->normalize_order_by( $sort_by );
		$this->order    = $direction;
		usort( $arr, array( $this, 'interval_cmp' ) );
	}

	/**
	 * Fills in interval gaps from DB with 0-filled objects.
	 *
	 * @param array    $db_intervals   Array of all intervals present in the db.
	 * @param DateTime $start_datetime Start date.
	 * @param DateTime $end_datetime   End date.
	 * @param string   $time_interval  Time interval, e.g. day, week, month.
	 * @param stdClass $data           Data with SQL extracted intervals.
	 * @return stdClass
	 */
	protected function fill_in_missing_intervals( $db_intervals, $start_datetime, $end_datetime, $time_interval, &$data ) {
		// @todo This is ugly and messy.
		$local_tz = new \DateTimeZone( wc_timezone_string() );
		// At this point, we don't know when we can stop iterating, as the ordering can be based on any value.
		$time_ids     = array_flip( wp_list_pluck( $data->intervals, 'time_interval' ) );
		$db_intervals = array_flip( $db_intervals );
		// Totals object used to get all needed properties.
		$totals_arr = get_object_vars( $data->totals );
		foreach ( $totals_arr as $key => $val ) {
			$totals_arr[ $key ] = 0;
		}
		// @todo Should 'products' be in intervals?
		unset( $totals_arr['products'] );
		while ( $start_datetime <= $end_datetime ) {
			$next_start = TimeInterval::iterate( $start_datetime, $time_interval );
			$time_id    = TimeInterval::time_interval_id( $time_interval, $start_datetime );
			// Either create fill-zero interval or use data from db.
			if ( $next_start > $end_datetime ) {
				$interval_end = $end_datetime->format( 'Y-m-d H:i:s' );
			} else {
				$prev_end_timestamp = (int) $next_start->format( 'U' ) - 1;
				$prev_end           = new \DateTime();
				$prev_end->setTimestamp( $prev_end_timestamp );
				$prev_end->setTimezone( $local_tz );
				$interval_end = $prev_end->format( 'Y-m-d H:i:s' );
			}
			if ( array_key_exists( $time_id, $time_ids ) ) {
				// For interval present in the db for this time frame, just fill in dates.
				$record               = &$data->intervals[ $time_ids[ $time_id ] ];
				$record['date_start'] = $start_datetime->format( 'Y-m-d H:i:s' );
				$record['date_end']   = $interval_end;
			} elseif ( ! array_key_exists( $time_id, $db_intervals ) ) {
				// For intervals present in the db outside of this time frame, do nothing.
				// For intervals not present in the db, fabricate it.
				$record_arr                  = array();
				$record_arr['time_interval'] = $time_id;
				$record_arr['date_start']    = $start_datetime->format( 'Y-m-d H:i:s' );
				$record_arr['date_end']      = $interval_end;
				$data->intervals[]           = array_merge( $record_arr, $totals_arr );
			}
			$start_datetime = $next_start;
		}
		return $data;
	}

	/**
	 * Converts input datetime parameters to local timezone. If there are no inputs from the user in query_args,
	 * uses default from $defaults.
	 *
	 * @param array $query_args Array of query arguments.
	 * @param array $defaults Array of default values.
	 */
	protected function normalize_timezones( &$query_args, $defaults ) {
		$local_tz = new \DateTimeZone( wc_timezone_string() );
		foreach ( array( 'before', 'after' ) as $query_arg_key ) {
			if ( isset( $query_args[ $query_arg_key ] ) && is_string( $query_args[ $query_arg_key ] ) ) {
				// Assume that unspecified timezone is a local timezone.
				$datetime = new \DateTime( $query_args[ $query_arg_key ], $local_tz );
				// In case timezone was forced by using +HH:MM, convert to local timezone.
				$datetime->setTimezone( $local_tz );
				$query_args[ $query_arg_key ] = $datetime;
			} elseif ( isset( $query_args[ $query_arg_key ] ) && is_a( $query_args[ $query_arg_key ], 'DateTime' ) ) {
				// In case timezone is in other timezone, convert to local timezone.
				$query_args[ $query_arg_key ]->setTimezone( $local_tz );
			} else {
				$query_args[ $query_arg_key ] = isset( $defaults[ $query_arg_key ] ) ? $defaults[ $query_arg_key ] : null;
			}
		}
	}

	/**
	 * Removes extra records from intervals so that only requested number of records get returned.
	 *
	 * @param stdClass $data           Data from whose intervals the records get removed.
	 * @param int      $page_no        Offset requested by the user.
	 * @param int      $items_per_page Number of records requested by the user.
	 * @param int      $db_interval_count Database interval count.
	 * @param int      $expected_interval_count Expected interval count on the output.
	 * @param string   $order_by Order by field.
	 * @param string   $order ASC or DESC.
	 */
	protected function remove_extra_records( &$data, $page_no, $items_per_page, $db_interval_count, $expected_interval_count, $order_by, $order ) {
		if ( 'date' === strtolower( $order_by ) ) {
			$offset = 0;
		} else {
			if ( 'asc' === strtolower( $order ) ) {
				$offset = ( $page_no - 1 ) * $items_per_page;
			} else {
				$offset = ( $page_no - 1 ) * $items_per_page - $db_interval_count;
			}
			$offset = $offset < 0 ? 0 : $offset;
		}
		$count = $expected_interval_count - ( $page_no - 1 ) * $items_per_page;
		if ( $count < 0 ) {
			$count = 0;
		} elseif ( $count > $items_per_page ) {
			$count = $items_per_page;
		}
		$data->intervals = array_slice( $data->intervals, $offset, $count );
	}

	/**
	 * Returns expected number of items on the page in case of date ordering.
	 *
	 * @param int $expected_interval_count Expected number of intervals in total.
	 * @param int $items_per_page          Number of items per page.
	 * @param int $page_no                 Page number.
	 *
	 * @return float|int
	 */
	protected function expected_intervals_on_page( $expected_interval_count, $items_per_page, $page_no ) {
		$total_pages = (int) ceil( $expected_interval_count / $items_per_page );
		if ( $page_no < $total_pages ) {
			return $items_per_page;
		} elseif ( $page_no === $total_pages ) {
			return $expected_interval_count - ( $page_no - 1 ) * $items_per_page;
		} else {
			return 0;
		}
	}

	/**
	 * Returns true if there are any intervals that need to be filled in the response.
	 *
	 * @param int    $expected_interval_count Expected number of intervals in total.
	 * @param int    $db_records              Total number of records for given period in the database.
	 * @param int    $items_per_page          Number of items per page.
	 * @param int    $page_no                 Page number.
	 * @param string $order                   asc or desc.
	 * @param string $order_by                Column by which the result will be sorted.
	 * @param int    $intervals_count         Number of records for given (possibly shortened) time interval.
	 *
	 * @return bool
	 */
	protected function intervals_missing( $expected_interval_count, $db_records, $items_per_page, $page_no, $order, $order_by, $intervals_count ) {
		if ( $expected_interval_count <= $db_records ) {
			return false;
		}
		if ( 'date' === $order_by ) {
			$expected_intervals_on_page = $this->expected_intervals_on_page( $expected_interval_count, $items_per_page, $page_no );
			return $intervals_count < $expected_intervals_on_page;
		}
		if ( 'desc' === $order ) {
			return $page_no > floor( $db_records / $items_per_page );
		}
		if ( 'asc' === $order ) {
			return $page_no <= ceil( ( $expected_interval_count - $db_records ) / $items_per_page );
		}
		// Invalid ordering.
		return false;
	}

	/**
	 * Updates the LIMIT query part for Intervals query of the report.
	 *
	 * If there are less records in the database than time intervals, then we need to remap offset in SQL query
	 * to fetch correct records.
	 *
	 * @param array  $query_args Query arguments.
	 * @param int    $db_interval_count Database interval count.
	 * @param int    $expected_interval_count Expected interval count on the output.
	 * @param string $table_name Name of the db table relevant for the date constraint.
	 */
	protected function update_intervals_sql_params( &$query_args, $db_interval_count, $expected_interval_count, $table_name ) {
		if ( $db_interval_count === $expected_interval_count ) {
			return;
		}

		$params   = $this->get_limit_params( $query_args );
		$local_tz = new \DateTimeZone( wc_timezone_string() );
		if ( 'date' === strtolower( $query_args['orderby'] ) ) {
			// page X in request translates to slightly different dates in the db, in case some
			// records are missing from the db.
			$start_iteration = 0;
			$end_iteration   = 0;
			if ( 'asc' === strtolower( $query_args['order'] ) ) {
				// ORDER BY date ASC.
				$new_start_date    = $query_args['after'];
				$intervals_to_skip = ( $query_args['page'] - 1 ) * $params['per_page'];
				$latest_end_date   = $query_args['before'];
				for ( $i = 0; $i < $intervals_to_skip; $i++ ) {
					if ( $new_start_date > $latest_end_date ) {
						$new_start_date  = $latest_end_date;
						$start_iteration = 0;
						break;
					}
					$new_start_date = TimeInterval::iterate( $new_start_date, $query_args['interval'] );
					$start_iteration ++;
				}

				$new_end_date = clone $new_start_date;
				for ( $i = 0; $i < $params['per_page']; $i++ ) {
					if ( $new_end_date > $latest_end_date ) {
						break;
					}
					$new_end_date = TimeInterval::iterate( $new_end_date, $query_args['interval'] );
					$end_iteration ++;
				}
				if ( $new_end_date > $latest_end_date ) {
					$new_end_date  = $latest_end_date;
					$end_iteration = 0;
				}
				if ( $end_iteration ) {
					$new_end_date_timestamp = (int) $new_end_date->format( 'U' ) - 1;
					$new_end_date->setTimestamp( $new_end_date_timestamp );
				}
			} else {
				// ORDER BY date DESC.
				$new_end_date        = $query_args['before'];
				$intervals_to_skip   = ( $query_args['page'] - 1 ) * $params['per_page'];
				$earliest_start_date = $query_args['after'];
				for ( $i = 0; $i < $intervals_to_skip; $i++ ) {
					if ( $new_end_date < $earliest_start_date ) {
						$new_end_date  = $earliest_start_date;
						$end_iteration = 0;
						break;
					}
					$new_end_date = TimeInterval::iterate( $new_end_date, $query_args['interval'], true );
					$end_iteration ++;
				}

				$new_start_date = clone $new_end_date;
				for ( $i = 0; $i < $params['per_page']; $i++ ) {
					if ( $new_start_date < $earliest_start_date ) {
						break;
					}
					$new_start_date = TimeInterval::iterate( $new_start_date, $query_args['interval'], true );
					$start_iteration ++;
				}
				if ( $new_start_date < $earliest_start_date ) {
					$new_start_date  = $earliest_start_date;
					$start_iteration = 0;
				}
				if ( $start_iteration ) {
					// @todo Is this correct? should it only be added if iterate runs? other two iterate instances, too?
					$new_start_date_timestamp = (int) $new_start_date->format( 'U' ) + 1;
					$new_start_date->setTimestamp( $new_start_date_timestamp );
				}
			}
			// @todo - Do this without modifying $query_args?
			$query_args['adj_after']  = $new_start_date;
			$query_args['adj_before'] = $new_end_date;
			$adj_after                = $new_start_date->format( TimeInterval::$sql_datetime_format );
			$adj_before               = $new_end_date->format( TimeInterval::$sql_datetime_format );
			$this->interval_query->clear_sql_clause( array( 'where_time', 'limit' ) );
			$this->interval_query->add_sql_clause( 'where_time', "AND {$table_name}.date_created <= '$adj_before'" );
			$this->interval_query->add_sql_clause( 'where_time', "AND {$table_name}.date_created >= '$adj_after'" );
			$this->clear_sql_clause( 'limit' );
			$this->add_sql_clause( 'limit', 'LIMIT 0,' . $params['per_page'] );
		} else {
			if ( 'asc' === $query_args['order'] ) {
				$offset = ( ( $query_args['page'] - 1 ) * $params['per_page'] ) - ( $expected_interval_count - $db_interval_count );
				$offset = $offset < 0 ? 0 : $offset;
				$count  = $query_args['page'] * $params['per_page'] - ( $expected_interval_count - $db_interval_count );
				if ( $count < 0 ) {
					$count = 0;
				} elseif ( $count > $params['per_page'] ) {
					$count = $params['per_page'];
				}

				$this->clear_sql_clause( 'limit' );
				$this->add_sql_clause( 'limit', 'LIMIT ' . $offset . ',' . $count );
			}
			// Otherwise no change in limit clause.
			// @todo - Do this without modifying $query_args?
			$query_args['adj_after']  = $query_args['after'];
			$query_args['adj_before'] = $query_args['before'];
		}
	}

	/**
	 * Casts strings returned from the database to appropriate data types for output.
	 *
	 * @param array $array Associative array of values extracted from the database.
	 * @return array|WP_Error
	 */
	protected function cast_numbers( $array ) {
		$retyped_array = array();
		$column_types  = apply_filters( 'woocommerce_rest_reports_column_types', $this->column_types, $array );
		foreach ( $array as $column_name => $value ) {
			if ( is_array( $value ) ) {
				$value = $this->cast_numbers( $value );
			}

			if ( isset( $column_types[ $column_name ] ) ) {
				$retyped_array[ $column_name ] = $column_types[ $column_name ]( $value );
			} else {
				$retyped_array[ $column_name ] = $value;
			}
		}
		return $retyped_array;
	}

	/**
	 * Returns a list of columns selected by the query_args formatted as a comma separated string.
	 *
	 * @param array $query_args User-supplied options.
	 * @return string
	 */
	protected function selected_columns( $query_args ) {
		$selections = $this->report_columns;

		if ( isset( $query_args['fields'] ) && is_array( $query_args['fields'] ) ) {
			$keep = array();
			foreach ( $query_args['fields'] as $field ) {
				if ( isset( $selections[ $field ] ) ) {
					$keep[ $field ] = $selections[ $field ];
				}
			}
			$selections = implode( ', ', $keep );
		} else {
			$selections = implode( ', ', $selections );
		}
		return $selections;
	}

	/**
	 * Get the excluded order statuses used when calculating reports.
	 *
	 * @return array
	 */
	protected static function get_excluded_report_order_statuses() {
		$excluded_statuses = \WC_Admin_Settings::get_option( 'woocommerce_excluded_report_order_statuses', array( 'pending', 'failed', 'cancelled' ) );
		$excluded_statuses = array_merge( array( 'trash' ), $excluded_statuses );
		return apply_filters( 'woocommerce_analytics_excluded_order_statuses', $excluded_statuses );
	}

	/**
	 * Maps order status provided by the user to the one used in the database.
	 *
	 * @param string $status Order status.
	 * @return string
	 */
	protected static function normalize_order_status( $status ) {
		$status = trim( $status );
		return 'wc-' . $status;
	}

	/**
	 * Normalizes order_by clause to match to SQL query.
	 *
	 * @param string $order_by Order by option requested by user.
	 * @return string
	 */
	protected function normalize_order_by( $order_by ) {
		if ( 'date' === $order_by ) {
			return 'time_interval';
		}

		return $order_by;
	}

	/**
	 * Updates start and end dates for intervals so that they represent intervals' borders, not times when data in db were recorded.
	 *
	 * E.g. if there are db records for only Tuesday and Thursday this week, the actual week interval is [Mon, Sun], not [Tue, Thu].
	 *
	 * @param DateTime $start_datetime Start date.
	 * @param DateTime $end_datetime End date.
	 * @param string   $time_interval Time interval, e.g. day, week, month.
	 * @param array    $intervals Array of intervals extracted from SQL db.
	 */
	protected function update_interval_boundary_dates( $start_datetime, $end_datetime, $time_interval, &$intervals ) {
		$local_tz = new \DateTimeZone( wc_timezone_string() );
		foreach ( $intervals as $key => $interval ) {
			$datetime = new \DateTime( $interval['datetime_anchor'], $local_tz );

			$prev_start = TimeInterval::iterate( $datetime, $time_interval, true );
			// @todo Not sure if the +1/-1 here are correct, especially as they are applied before the ?: below.
			$prev_start_timestamp = (int) $prev_start->format( 'U' ) + 1;
			$prev_start->setTimestamp( $prev_start_timestamp );
			if ( $start_datetime ) {
				$date_start                      = $prev_start < $start_datetime ? $start_datetime : $prev_start;
				$intervals[ $key ]['date_start'] = $date_start->format( 'Y-m-d H:i:s' );
			} else {
				$intervals[ $key ]['date_start'] = $prev_start->format( 'Y-m-d H:i:s' );
			}

			$next_end           = TimeInterval::iterate( $datetime, $time_interval );
			$next_end_timestamp = (int) $next_end->format( 'U' ) - 1;
			$next_end->setTimestamp( $next_end_timestamp );
			if ( $end_datetime ) {
				$date_end                      = $next_end > $end_datetime ? $end_datetime : $next_end;
				$intervals[ $key ]['date_end'] = $date_end->format( 'Y-m-d H:i:s' );
			} else {
				$intervals[ $key ]['date_end'] = $next_end->format( 'Y-m-d H:i:s' );
			}

			$intervals[ $key ]['interval'] = $time_interval;
		}
	}

	/**
	 * Change structure of intervals to form a correct response.
	 *
	 * Also converts local datetimes to GMT and adds them to the intervals.
	 *
	 * @param array $intervals Time interval, e.g. day, week, month.
	 */
	protected function create_interval_subtotals( &$intervals ) {
		foreach ( $intervals as $key => $interval ) {
			$start_gmt = TimeInterval::convert_local_datetime_to_gmt( $interval['date_start'] );
			$end_gmt   = TimeInterval::convert_local_datetime_to_gmt( $interval['date_end'] );
			// Move intervals result to subtotals object.
			$intervals[ $key ] = array(
				'interval'       => $interval['time_interval'],
				'date_start'     => $interval['date_start'],
				'date_start_gmt' => $start_gmt->format( TimeInterval::$sql_datetime_format ),
				'date_end'       => $interval['date_end'],
				'date_end_gmt'   => $end_gmt->format( TimeInterval::$sql_datetime_format ),
			);

			unset( $interval['interval'] );
			unset( $interval['date_start'] );
			unset( $interval['date_end'] );
			unset( $interval['datetime_anchor'] );
			unset( $interval['time_interval'] );
			$intervals[ $key ]['subtotals'] = (object) $this->cast_numbers( $interval );
		}
	}

	/**
	 * Fills WHERE clause of SQL request with date-related constraints.
	 *
	 * @param array  $query_args Parameters supplied by the user.
	 * @param string $table_name Name of the db table relevant for the date constraint.
	 */
	protected function add_time_period_sql_params( $query_args, $table_name ) {
		$this->clear_sql_clause( array( 'from', 'where_time', 'where' ) );
		if ( isset( $this->subquery ) ) {
			$this->subquery->clear_sql_clause( 'where_time' );
		}

		if ( isset( $query_args['before'] ) && '' !== $query_args['before'] ) {
			if ( is_a( $query_args['before'], 'WC_DateTime' ) ) {
				$datetime_str = $query_args['before']->date( TimeInterval::$sql_datetime_format );
			} else {
				$datetime_str = $query_args['before']->format( TimeInterval::$sql_datetime_format );
			}
			if ( isset( $this->subquery ) ) {
				$this->subquery->add_sql_clause( 'where_time', "AND {$table_name}.date_created <= '$datetime_str'" );
			} else {
				$this->add_sql_clause( 'where_time', "AND {$table_name}.date_created <= '$datetime_str'" );
			}
		}

		if ( isset( $query_args['after'] ) && '' !== $query_args['after'] ) {
			if ( is_a( $query_args['after'], 'WC_DateTime' ) ) {
				$datetime_str = $query_args['after']->date( TimeInterval::$sql_datetime_format );
			} else {
				$datetime_str = $query_args['after']->format( TimeInterval::$sql_datetime_format );
			}
			if ( isset( $this->subquery ) ) {
				$this->subquery->add_sql_clause( 'where_time', "AND {$table_name}.date_created >= '$datetime_str'" );
			} else {
				$this->add_sql_clause( 'where_time', "AND {$table_name}.date_created >= '$datetime_str'" );
			}
		}
	}

	/**
	 * Fills LIMIT clause of SQL request based on user supplied parameters.
	 *
	 * @param array $query_args Parameters supplied by the user.
	 * @return array
	 */
	protected function get_limit_sql_params( $query_args ) {
		$params = $this->get_limit_params( $query_args );

		$this->clear_sql_clause( 'limit' );
		$this->add_sql_clause( 'limit', "LIMIT {$params['offset']}, {$params['per_page']}" );
		return $params;
	}

	/**
	 * Fills LIMIT parameters of SQL request based on user supplied parameters.
	 *
	 * @param array $query_args Parameters supplied by the user.
	 * @return array
	 */
	protected function get_limit_params( $query_args = array() ) {
		if ( isset( $query_args['per_page'] ) && is_numeric( $query_args['per_page'] ) ) {
			$this->limit_parameters['per_page'] = (int) $query_args['per_page'];
		} else {
			$this->limit_parameters['per_page'] = get_option( 'posts_per_page' );
		}

		$this->limit_parameters['offset'] = 0;
		if ( isset( $query_args['page'] ) ) {
			$this->limit_parameters['offset'] = ( (int) $query_args['page'] - 1 ) * $this->limit_parameters['per_page'];
		}

		return $this->limit_parameters;
	}

	/**
	 * Generates a virtual table given a list of IDs.
	 *
	 * @param array $ids          Array of IDs.
	 * @param array $id_field     Name of the ID field.
	 * @param array $other_values Other values that must be contained in the virtual table.
	 * @return array
	 */
	protected function get_ids_table( $ids, $id_field, $other_values = array() ) {
		$selects = array();
		foreach ( $ids as $id ) {
			$new_select = "SELECT {$id} AS {$id_field}";
			foreach ( $other_values as $key => $value ) {
				$new_select .= ", {$value} AS {$key}";
			}
			array_push( $selects, $new_select );
		}
		return join( ' UNION ', $selects );
	}

	/**
	 * Returns a comma separated list of the fields in the `query_args`, if there aren't, returns `report_columns` keys.
	 *
	 * @param array $query_args Parameters supplied by the user.
	 * @return array
	 */
	protected function get_fields( $query_args ) {
		if ( isset( $query_args['fields'] ) && is_array( $query_args['fields'] ) ) {
			return $query_args['fields'];
		}
		return array_keys( $this->report_columns );
	}

	/**
	 * Returns a comma separated list of the field names prepared to be used for a selection after a join with `default_results`.
	 *
	 * @param array $fields                 Array of fields name.
	 * @param array $default_results_fields Fields to load from `default_results` table.
	 * @param array $outer_selections       Array of fields that are not selected in the inner query.
	 * @return string
	 */
	protected function format_join_selections( $fields, $default_results_fields, $outer_selections = array() ) {
		foreach ( $fields as $i => $field ) {
			foreach ( $default_results_fields as $default_results_field ) {
				if ( $field === $default_results_field ) {
					$fields[ $i ] = "default_results.{$field} AS {$field}";
				}
			}
			if ( in_array( $field, $outer_selections, true ) && array_key_exists( $field, $this->report_columns ) ) {
				$fields[ $i ] = $this->report_columns[ $field ];
			}
		}
		return implode( ', ', $fields );
	}

	/**
	 * Fills ORDER BY clause of SQL request based on user supplied parameters.
	 *
	 * @param array $query_args Parameters supplied by the user.
	 */
	protected function add_order_by_sql_params( $query_args ) {
		if ( isset( $query_args['orderby'] ) ) {
			$order_by_clause = $this->normalize_order_by( $query_args['orderby'] );
		} else {
			$order_by_clause = '';
		}

		$this->clear_sql_clause( 'order_by' );
		$this->add_sql_clause( 'order_by', $order_by_clause );
		$this->add_orderby_order_clause( $query_args, $this );
	}

	/**
	 * Fills FROM and WHERE clauses of SQL request for 'Intervals' section of data response based on user supplied parameters.
	 *
	 * @param array  $query_args Parameters supplied by the user.
	 * @param string $table_name Name of the db table relevant for the date constraint.
	 */
	protected function add_intervals_sql_params( $query_args, $table_name ) {
		$this->clear_sql_clause( array( 'from', 'where_time', 'where' ) );

		$this->add_time_period_sql_params( $query_args, $table_name );

		if ( isset( $query_args['interval'] ) && '' !== $query_args['interval'] ) {
			$interval = $query_args['interval'];
			$this->clear_sql_clause( 'select' );
			$this->add_sql_clause( 'select', TimeInterval::db_datetime_format( $interval, $table_name ) );
		}
	}

	/**
	 * Get join and where clauses for refunds based on user supplied parameters.
	 *
	 * @param array $query_args Parameters supplied by the user.
	 * @return array
	 */
	protected function get_refund_subquery( $query_args ) {
		global $wpdb;
		$table_name = $wpdb->prefix . 'wc_order_stats';
		$sql_query  = array(
			'where_clause' => '',
			'from_clause'  => '',
		);

		if ( ! isset( $query_args['refunds'] ) ) {
			return $sql_query;
		}

		if ( 'all' === $query_args['refunds'] ) {
			$sql_query['where_clause'] .= 'parent_id != 0';
		}

		if ( 'none' === $query_args['refunds'] ) {
			$sql_query['where_clause'] .= 'parent_id = 0';
		}

		if ( 'full' === $query_args['refunds'] || 'partial' === $query_args['refunds'] ) {
			$operator                   = 'full' === $query_args['refunds'] ? '=' : '!=';
			$sql_query['from_clause']  .= " JOIN {$table_name} parent_order_stats ON {$table_name}.parent_id = parent_order_stats.order_id";
			$sql_query['where_clause'] .= "parent_order_stats.status {$operator} '{$this->normalize_order_status( 'refunded' )}'";
		}

		return $sql_query;
	}

	/**
	 * Returns an array of products belonging to given categories.
	 *
	 * @param array $categories List of categories IDs.
	 * @return array|stdClass
	 */
	protected function get_products_by_cat_ids( $categories ) {
		$terms = get_terms(
			array(
				'taxonomy' => 'product_cat',
				'include'  => $categories,
			)
		);

		if ( is_wp_error( $terms ) || empty( $terms ) ) {
			return array();
		}

		$args = array(
			'category' => wc_list_pluck( $terms, 'slug' ),
			'limit'    => -1,
			'return'   => 'ids',
		);
		return wc_get_products( $args );
	}

	/**
	 * Get WHERE filter by object ids subquery.
	 *
	 * @param string $select_table Select table name.
	 * @param string $select_field Select table object ID field name.
	 * @param string $filter_table Lookup table name.
	 * @param string $filter_field Lookup table object ID field name.
	 * @param string $compare      Comparison string (IN|NOT IN).
	 * @param string $id_list      Comma separated ID list.
	 *
	 * @return string
	 */
	protected function get_object_where_filter( $select_table, $select_field, $filter_table, $filter_field, $compare, $id_list ) {
		global $wpdb;
		if ( empty( $id_list ) ) {
			return '';
		}

		$lookup_name = isset( $wpdb->$filter_table ) ? $wpdb->$filter_table : $wpdb->prefix . $filter_table;
		return " {$select_table}.{$select_field} {$compare} (
			SELECT
				DISTINCT {$filter_table}.{$select_field}
			FROM
				{$filter_table}
			WHERE
				{$filter_table}.{$filter_field} IN ({$id_list})
		)";
	}

	/**
	 * Returns an array of ids of allowed products, based on query arguments from the user.
	 *
	 * @param array $query_args Parameters supplied by the user.
	 * @return array
	 */
	protected function get_included_products_array( $query_args ) {
		$included_products = array();
		$operator          = $this->get_match_operator( $query_args );

		if ( isset( $query_args['category_includes'] ) && is_array( $query_args['category_includes'] ) && count( $query_args['category_includes'] ) > 0 ) {
			$included_products = $this->get_products_by_cat_ids( $query_args['category_includes'] );

			// If no products were found in the specified categories, we will force an empty set
			// by matching a product ID of -1, unless the filters are OR/any and products are specified.
			if ( empty( $included_products ) ) {
				$included_products = array( '-1' );
			}
		}

		if ( isset( $query_args['product_includes'] ) && is_array( $query_args['product_includes'] ) && count( $query_args['product_includes'] ) > 0 ) {
			if ( count( $included_products ) > 0 ) {
				if ( 'AND' === $operator ) {
					// AND results in an intersection between products from selected categories and manually included products.
					$included_products = array_intersect( $included_products, $query_args['product_includes'] );
				} elseif ( 'OR' === $operator ) {
					// OR results in a union of products from selected categories and manually included products.
					$included_products = array_merge( $included_products, $query_args['product_includes'] );
				}
			} else {
				$included_products = $query_args['product_includes'];
			}
		}

		return $included_products;
	}

	/**
	 * Returns comma separated ids of allowed products, based on query arguments from the user.
	 *
	 * @param array $query_args Parameters supplied by the user.
	 * @return string
	 */
	protected function get_included_products( $query_args ) {
		$included_products = $this->get_included_products_array( $query_args );
		return implode( ',', $included_products );
	}

	/**
	 * Returns comma separated ids of allowed variations, based on query arguments from the user.
	 *
	 * @param array $query_args Parameters supplied by the user.
	 * @return string
	 */
	protected function get_included_variations( $query_args ) {
		return $this->get_filtered_ids( $query_args, 'variation_includes' );
	}

	/**
	 * Returns comma separated ids of excluded variations, based on query arguments from the user.
	 *
	 * @param array $query_args Parameters supplied by the user.
	 * @return string
	 */
	protected function get_excluded_variations( $query_args ) {
		return $this->get_filtered_ids( $query_args, 'variation_excludes' );
	}

	/**
	 * Returns an array of ids of disallowed products, based on query arguments from the user.
	 *
	 * @param array $query_args Parameters supplied by the user.
	 * @return array
	 */
	protected function get_excluded_products_array( $query_args ) {
		$excluded_products = array();
		$operator          = $this->get_match_operator( $query_args );

		if ( isset( $query_args['category_excludes'] ) && is_array( $query_args['category_excludes'] ) && count( $query_args['category_excludes'] ) > 0 ) {
			$excluded_products = $this->get_products_by_cat_ids( $query_args['category_excludes'] );
		}

		if ( isset( $query_args['product_excludes'] ) && is_array( $query_args['product_excludes'] ) && count( $query_args['product_excludes'] ) > 0 ) {
			$excluded_products = array_merge( $excluded_products, $query_args['product_excludes'] );
		}

		return $excluded_products;
	}

	/**
	 * Returns comma separated ids of excluded products, based on query arguments from the user.
	 *
	 * @param array $query_args Parameters supplied by the user.
	 * @return string
	 */
	protected function get_excluded_products( $query_args ) {
		$excluded_products = $this->get_excluded_products_array( $query_args );
		return implode( ',', $excluded_products );
	}

	/**
	 * Returns comma separated ids of included categories, based on query arguments from the user.
	 *
	 * @param array $query_args Parameters supplied by the user.
	 * @return string
	 */
	protected function get_included_categories( $query_args ) {
		return $this->get_filtered_ids( $query_args, 'category_includes' );
	}

	/**
	 * Returns comma separated ids of included coupons, based on query arguments from the user.
	 *
	 * @param array  $query_args Parameters supplied by the user.
	 * @param string $field      Field name in the parameter list.
	 * @return string
	 */
	protected function get_included_coupons( $query_args, $field = 'coupon_includes' ) {
		return $this->get_filtered_ids( $query_args, $field );
	}

	/**
	 * Returns comma separated ids of excluded coupons, based on query arguments from the user.
	 *
	 * @param array $query_args Parameters supplied by the user.
	 * @return string
	 */
	protected function get_excluded_coupons( $query_args ) {
		return $this->get_filtered_ids( $query_args, 'coupon_excludes' );
	}

	/**
	 * Returns comma separated ids of included orders, based on query arguments from the user.
	 *
	 * @param array $query_args Parameters supplied by the user.
	 * @return string
	 */
	protected function get_included_orders( $query_args ) {
		return $this->get_filtered_ids( $query_args, 'order_includes' );
	}

	/**
	 * Returns comma separated ids of excluded orders, based on query arguments from the user.
	 *
	 * @param array $query_args Parameters supplied by the user.
	 * @return string
	 */
	protected function get_excluded_orders( $query_args ) {
		return $this->get_filtered_ids( $query_args, 'order_excludes' );
	}

	/**
	 * Returns comma separated ids of included users, based on query arguments from the user.
	 *
	 * @param array $query_args Parameters supplied by the user.
	 * @return string
	 */
	protected function get_included_users( $query_args ) {
		return $this->get_filtered_ids( $query_args, 'user_includes' );
	}

	/**
	 * Returns comma separated ids of excluded users, based on query arguments from the user.
	 *
	 * @param array $query_args Parameters supplied by the user.
	 * @return string
	 */
	protected function get_excluded_users( $query_args ) {
		return $this->get_filtered_ids( $query_args, 'user_excludes' );
	}

	/**
	 * Returns order status subquery to be used in WHERE SQL query, based on query arguments from the user.
	 *
	 * @param array  $query_args Parameters supplied by the user.
	 * @param string $operator   AND or OR, based on match query argument.
	 * @return string
	 */
	protected function get_status_subquery( $query_args, $operator = 'AND' ) {
		global $wpdb;

		$subqueries        = array();
		$excluded_statuses = array();
		if ( isset( $query_args['status_is'] ) && is_array( $query_args['status_is'] ) && count( $query_args['status_is'] ) > 0 ) {
			$allowed_statuses = array_map( array( $this, 'normalize_order_status' ), $query_args['status_is'] );
			if ( $allowed_statuses ) {
				$subqueries[] = "{$wpdb->prefix}wc_order_stats.status IN ( '" . implode( "','", $allowed_statuses ) . "' )";
			}
		}

		if ( isset( $query_args['status_is_not'] ) && is_array( $query_args['status_is_not'] ) && count( $query_args['status_is_not'] ) > 0 ) {
			$excluded_statuses = array_map( array( $this, 'normalize_order_status' ), $query_args['status_is_not'] );
		}

		if ( ( ! isset( $query_args['status_is'] ) || empty( $query_args['status_is'] ) )
			&& ( ! isset( $query_args['status_is_not'] ) || empty( $query_args['status_is_not'] ) )
		) {
			$excluded_statuses = array_map( array( $this, 'normalize_order_status' ), $this->get_excluded_report_order_statuses() );
		}

		if ( $excluded_statuses ) {
			$subqueries[] = "{$wpdb->prefix}wc_order_stats.status NOT IN ( '" . implode( "','", $excluded_statuses ) . "' )";
		}

		return implode( " $operator ", $subqueries );
	}

	/**
	 * Add order status SQL clauses if included in query.
	 *
	 * @param array    $query_args Parameters supplied by the user.
	 * @param string   $table_name Database table name.
	 * @param SqlQuery $sql_query  Query object.
	 */
	protected function add_order_status_clause( $query_args, $table_name, &$sql_query ) {
		global $wpdb;
		$order_status_filter = $this->get_status_subquery( $query_args );
		if ( $order_status_filter ) {
			$sql_query->add_sql_clause( 'join', "JOIN {$wpdb->prefix}wc_order_stats ON {$table_name}.order_id = {$wpdb->prefix}wc_order_stats.order_id" );
			$sql_query->add_sql_clause( 'where', "AND ( {$order_status_filter} )" );
		}
	}

	/**
	 * Add order by SQL clause if included in query.
	 *
	 * @param array    $query_args Parameters supplied by the user.
	 * @param SqlQuery $sql_query  Query object.
	 * @return string Order by clause.
	 */
	protected function add_order_by_clause( $query_args, &$sql_query ) {
		$order_by_clause = '';

		$sql_query->clear_sql_clause( array( 'order_by' ) );
		if ( isset( $query_args['orderby'] ) ) {
			$order_by_clause = $this->normalize_order_by( $query_args['orderby'] );
			$sql_query->add_sql_clause( 'order_by', $order_by_clause );
		}

		// Return ORDER BY clause to allow adding the sort field(s) to query via a JOIN.
		return $order_by_clause;
	}

	/**
	 * Add order by order SQL clause.
	 *
	 * @param array    $query_args Parameters supplied by the user.
	 * @param SqlQuery $sql_query  Query object.
	 */
	protected function add_orderby_order_clause( $query_args, &$sql_query ) {
		if ( isset( $query_args['order'] ) ) {
			$sql_query->add_sql_clause( 'order_by', $query_args['order'] );
		} else {
			$sql_query->add_sql_clause( 'order_by', 'DESC' );
		}
	}

	/**
	 * Returns customer subquery to be used in WHERE SQL query, based on query arguments from the user.
	 *
	 * @param array $query_args Parameters supplied by the user.
	 * @return string
	 */
	protected function get_customer_subquery( $query_args ) {
		global $wpdb;

		$customer_filter = '';
		if ( isset( $query_args['customer_type'] ) ) {
			if ( 'new' === strtolower( $query_args['customer_type'] ) ) {
				$customer_filter = " {$wpdb->prefix}wc_order_stats.returning_customer = 0";
			} elseif ( 'returning' === strtolower( $query_args['customer_type'] ) ) {
				$customer_filter = " {$wpdb->prefix}wc_order_stats.returning_customer = 1";
			}
		}

		return $customer_filter;
	}

	/**
	 * Returns product attribute subquery elements used in JOIN and WHERE clauses,
	 * based on query arguments from the user.
	 *
	 * @param array  $query_args Parameters supplied by the user.
	 * @param string $table_name Database table name.
	 * @return array
	 */
	protected function get_attribute_subqueries( $query_args, $table_name ) {
		global $wpdb;

		$sql_clauses           = array(
			'join'  => array(),
			'where' => array(),
		);
		$match_operator        = $this->get_match_operator( $query_args );
		$post_meta_comparators = array(
			'='  => 'attribute_is',
			'!=' => 'attribute_is_not',
		);

		foreach ( $post_meta_comparators as $comparator => $arg ) {
			if ( ! isset( $query_args[ $arg ] ) || ! is_array( $query_args[ $arg ] ) ) {
				continue;
			}
			foreach ( $query_args[ $arg ] as $attribute_term ) {
				// We expect tuples.
				if ( ! is_array( $attribute_term ) || 2 !== count( $attribute_term ) ) {
					continue;
				}

				// If the tuple is numeric, assume these are IDs.
				if ( is_numeric( $attribute_term[0] ) && is_numeric( $attribute_term[1] ) ) {
					$attribute_id = intval( $attribute_term[0] );
					$term_id      = intval( $attribute_term[1] );

					// Invalid IDs.
					if ( 0 === $attribute_id || 0 === $term_id ) {
						continue;
					}

					// @todo: Use wc_get_attribute () instead ?
					$attr_taxonomy = wc_attribute_taxonomy_name_by_id( $attribute_id );
					// Invalid attribute ID.
					if ( empty( $attr_taxonomy ) ) {
						continue;
					}

					$attr_term = get_term_by( 'id', $term_id, $attr_taxonomy );
					// Invalid term ID.
					if ( false === $attr_term ) {
						continue;
					}

					$meta_key   = sanitize_title( $attr_taxonomy );
					$meta_value = $attr_term->slug;
				} else {
					// Assume these are a custom attribute slug/value pair.
					$meta_key   = esc_sql( $attribute_term[0] );
					$meta_value = esc_sql( $attribute_term[1] );
				}

				$join_alias = 'orderitemmeta1';

				if ( empty( $sql_clauses['join'] ) ) {
					$sql_clauses['join'][] = "JOIN {$wpdb->prefix}woocommerce_order_items orderitems ON orderitems.order_id = {$table_name}.order_id";
				}

				// If we're matching all filters (AND), we'll need multiple JOINs on postmeta.
				// If not, just one.
				if ( 'AND' === $match_operator || 1 === count( $sql_clauses['join'] ) ) {
					$join_idx              = count( $sql_clauses['join'] );
					$join_alias            = 'orderitemmeta' . $join_idx;
					$sql_clauses['join'][] = "JOIN {$wpdb->prefix}woocommerce_order_itemmeta as {$join_alias} ON {$join_alias}.order_item_id = orderitems.order_item_id";
				}

				// phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared
				$sql_clauses['where'][] = $wpdb->prepare( "( {$join_alias}.meta_key = %s AND {$join_alias}.meta_value {$comparator} %s )", $meta_key, $meta_value );
			}
		}

		// If we're matching multiple attributes and all filters (AND), make sure
		// we're matching attributes on the same product.
		$num_attribute_filters = count( $sql_clauses['join'] );

		for ( $i = 2; $i < $num_attribute_filters; $i++ ) {
			$join_alias            = 'orderitemmeta' . $i;
			$sql_clauses['join'][] = "AND orderitemmeta1.order_item_id = {$join_alias}.order_item_id";
		}

		return $sql_clauses;
	}

	/**
	 * Returns logic operator for WHERE subclause based on 'match' query argument.
	 *
	 * @param array $query_args Parameters supplied by the user.
	 * @return string
	 */
	protected function get_match_operator( $query_args ) {
		$operator = 'AND';

		if ( ! isset( $query_args['match'] ) ) {
			return $operator;
		}

		if ( 'all' === strtolower( $query_args['match'] ) ) {
			$operator = 'AND';
		} elseif ( 'any' === strtolower( $query_args['match'] ) ) {
			$operator = 'OR';
		}
		return $operator;
	}

	/**
	 * Returns filtered comma separated ids, based on query arguments from the user.
	 *
	 * @param array  $query_args Parameters supplied by the user.
	 * @param string $field      Query field to filter.
	 * @param string $separator  Field separator.
	 * @return string
	 */
	protected function get_filtered_ids( $query_args, $field, $separator = ',' ) {
		$ids_str = '';
		$ids     = isset( $query_args[ $field ] ) && is_array( $query_args[ $field ] ) ? $query_args[ $field ] : array();

		/**
		 * Filter the IDs before retrieving report data.
		 *
		 * Allows filtering of the objects included or excluded from reports.
		 *
		 * @param array  $ids        List of object Ids.
		 * @param array  $query_args The original arguments for the request.
		 * @param string $field      The object type.
		 * @param string $context    The data store context.
		 */
		$ids = apply_filters( 'woocommerce_analytics_' . $field, $ids, $query_args, $field, $this->context );

		if ( ! empty( $ids ) ) {
			$ids_str = implode( $separator, $ids );
		}
		return $ids_str;
	}

	/**
	 * Assign report columns once full table name has been assigned.
	 */
	protected function assign_report_columns() {}
}
woocommerce-admin/src/API/Reports/Export/Controller.php000064400000015545151335517650017151 0ustar00<?php
/**
 * REST API Reports Export Controller
 *
 * Handles requests to:
 * - /reports/[report]/export
 * - /reports/[report]/export/[id]/status
 */

namespace Automattic\WooCommerce\Admin\API\Reports\Export;

defined( 'ABSPATH' ) || exit;

use \Automattic\WooCommerce\Admin\ReportExporter;

/**
 * Reports Export controller.
 *
 * @extends \Automattic\WooCommerce\Admin\API\Reports\Controller
 */
class Controller extends \Automattic\WooCommerce\Admin\API\Reports\Controller {
	/**
	 * Endpoint namespace.
	 *
	 * @var string
	 */
	protected $namespace = 'wc-analytics';

	/**
	 * Route base.
	 *
	 * @var string
	 */
	protected $rest_base = 'reports/(?P<type>[a-z]+)/export';

	/**
	 * Register routes.
	 */
	public function register_routes() {
		register_rest_route(
			$this->namespace,
			'/' . $this->rest_base,
			array(
				array(
					'methods'             => \WP_REST_Server::EDITABLE,
					'callback'            => array( $this, 'export_items' ),
					'permission_callback' => array( $this, 'get_items_permissions_check' ),
					'args'                => $this->get_export_collection_params(),
				),
				'schema' => array( $this, 'get_export_public_schema' ),
			)
		);

		register_rest_route(
			$this->namespace,
			'/' . $this->rest_base . '/(?P<export_id>[a-z0-9]+)/status',
			array(
				array(
					'methods'             => \WP_REST_Server::READABLE,
					'callback'            => array( $this, 'export_status' ),
					'permission_callback' => array( $this, 'get_items_permissions_check' ),
				),
				'schema' => array( $this, 'get_export_status_public_schema' ),
			)
		);
	}

	/**
	 * Get the query params for collections.
	 *
	 * @return array
	 */
	public function get_export_collection_params() {
		$params                = array();
		$params['report_args'] = array(
			'description'       => __( 'Parameters to pass on to the exported report.', 'woocommerce' ),
			'type'              => 'object',
			'validate_callback' => 'rest_validate_request_arg', // @todo: use each controller's schema?
		);
		$params['email']       = array(
			'description'       => __( 'When true, email a link to download the export to the requesting user.', 'woocommerce' ),
			'type'              => 'boolean',
			'validate_callback' => 'rest_validate_request_arg',
		);
		return $params;
	}

	/**
	 * Get the Report Export's schema, conforming to JSON Schema.
	 *
	 * @return array
	 */
	public function get_export_public_schema() {
		$schema = array(
			'$schema'    => 'http://json-schema.org/draft-04/schema#',
			'title'      => 'report_export',
			'type'       => 'object',
			'properties' => array(
				'status'    => array(
					'description' => __( 'Export status.', 'woocommerce' ),
					'type'        => 'string',
					'context'     => array( 'view', 'edit' ),
					'readonly'    => true,
				),
				'message'   => array(
					'description' => __( 'Export status message.', 'woocommerce' ),
					'type'        => 'string',
					'context'     => array( 'view', 'edit' ),
					'readonly'    => true,
				),
				'export_id' => array(
					'description' => __( 'Export ID.', 'woocommerce' ),
					'type'        => 'string',
					'context'     => array( 'view', 'edit' ),
					'readonly'    => true,
				),
			),
		);

		return $this->add_additional_fields_schema( $schema );
	}

	/**
	 * Get the Export status schema, conforming to JSON Schema.
	 *
	 * @return array
	 */
	public function get_export_status_public_schema() {
		$schema = array(
			'$schema'    => 'http://json-schema.org/draft-04/schema#',
			'title'      => 'report_export_status',
			'type'       => 'object',
			'properties' => array(
				'percent_complete' => array(
					'description' => __( 'Percentage complete.', 'woocommerce' ),
					'type'        => 'int',
					'context'     => array( 'view', 'edit' ),
					'readonly'    => true,
				),
				'download_url'     => array(
					'description' => __( 'Export download URL.', 'woocommerce' ),
					'type'        => 'string',
					'context'     => array( 'view', 'edit' ),
					'readonly'    => true,
				),
			),
		);

		return $this->add_additional_fields_schema( $schema );
	}

	/**
	 * Export data based on user request params.
	 *
	 * @param  WP_REST_Request $request Request data.
	 * @return WP_Error|WP_REST_Response
	 */
	public function export_items( $request ) {
		$report_type = $request['type'];
		$report_args = empty( $request['report_args'] ) ? array() : $request['report_args'];
		$send_email  = isset( $request['email'] ) ? $request['email'] : false;

		$default_export_id = str_replace( '.', '', microtime( true ) );
		$export_id         = apply_filters( 'woocommerce_admin_export_id', $default_export_id );
		$export_id 		   = (string) sanitize_file_name( $export_id );

		$total_rows = ReportExporter::queue_report_export( $export_id, $report_type, $report_args, $send_email );

		if ( 0 === $total_rows ) {
			return rest_ensure_response(
				array(
					'message' => __( 'There is no data to export for the given request.', 'woocommerce' ),
				)
			);
		}

		ReportExporter::update_export_percentage_complete( $report_type, $export_id, 0 );

		$response = rest_ensure_response(
			array(
				'message'   => __( 'Your report file is being generated.', 'woocommerce' ),
				'export_id' => $export_id,
			)
		);

		// Include a link to the export status endpoint.
		$response->add_links(
			array(
				'status' => array(
					'href' => rest_url( sprintf( '%s/reports/%s/export/%s/status', $this->namespace, $report_type, $export_id ) ),
				),
			)
		);

		$data = $this->prepare_response_for_collection( $response );

		return rest_ensure_response( $data );
	}

	/**
	 * Export status based on user request params.
	 *
	 * @param  WP_REST_Request $request Request data.
	 * @return WP_Error|WP_REST_Response
	 */
	public function export_status( $request ) {
		$report_type = $request['type'];
		$export_id   = $request['export_id'];
		$percentage  = ReportExporter::get_export_percentage_complete( $report_type, $export_id );

		if ( false === $percentage ) {
			return new \WP_Error(
				'woocommerce_admin_reports_export_invalid_id',
				__( 'Sorry, there is no export with that ID.', 'woocommerce' ),
				array( 'status' => 404 )
			);
		}

		$result = array(
			'percent_complete' => $percentage,
		);

		// @todo - add thing in the links below instead?
		if ( 100 === $percentage ) {
			$query_args = array(
				'action'   => ReportExporter::DOWNLOAD_EXPORT_ACTION,
				'filename' => "wc-{$report_type}-report-export-{$export_id}",
			);

			$result['download_url'] = add_query_arg( $query_args, admin_url() );
		}

		// Wrap the data in a response object.
		$response = rest_ensure_response( $result );
		// Include a link to the export status endpoint.
		$response->add_links(
			array(
				'self' => array(
					'href' => rest_url( sprintf( '%s/reports/%s/export/%s/status', $this->namespace, $report_type, $export_id ) ),
				),
			)
		);

		$data = $this->prepare_response_for_collection( $response );

		return rest_ensure_response( $data );
	}
}
woocommerce-admin/src/API/Reports/Controller.php000064400000024140151335517650015657 0ustar00<?php
/**
 * REST API Reports controller extended by WC Admin plugin.
 *
 * Handles requests to the reports endpoint.
 */

namespace Automattic\WooCommerce\Admin\API\Reports;

defined( 'ABSPATH' ) || exit;

/**
 * REST API Reports controller class.
 *
 * @extends WC_REST_Reports_Controller
 */
class Controller extends \WC_REST_Reports_Controller {

	/**
	 * Endpoint namespace.
	 *
	 * @var string
	 */
	protected $namespace = 'wc-analytics';

	/**
	 * Route base.
	 *
	 * @var string
	 */
	protected $rest_base = 'reports';

	/**
	 * Register the routes for reports.
	 */
	public function register_routes() {
		register_rest_route(
			$this->namespace,
			'/' . $this->rest_base,
			array(
				array(
					'methods'             => \WP_REST_Server::READABLE,
					'callback'            => array( $this, 'get_items' ),
					'permission_callback' => array( $this, 'get_items_permissions_check' ),
					'args'                => $this->get_collection_params(),
				),
				'schema' => array( $this, 'get_public_item_schema' ),
			)
		);
	}

	/**
	 * Check whether a given request has permission to read reports.
	 *
	 * @param  WP_REST_Request $request Full details about the request.
	 * @return WP_Error|boolean
	 */
	public function get_items_permissions_check( $request ) {
		if ( ! wc_rest_check_manager_permissions( 'reports', 'read' ) ) {
			return new \WP_Error( 'woocommerce_rest_cannot_view', __( 'Sorry, you cannot list resources.', 'woocommerce' ), array( 'status' => rest_authorization_required_code() ) );
		}

		return true;
	}


	/**
	 * Get all reports.
	 *
	 * @param WP_REST_Request $request Request data.
	 * @return array|WP_Error
	 */
	public function get_items( $request ) {
		$data    = array();
		$reports = array(
			array(
				'slug'        => 'performance-indicators',
				'description' => __( 'Batch endpoint for getting specific performance indicators from `stats` endpoints.', 'woocommerce' ),
			),
			array(
				'slug'        => 'revenue/stats',
				'description' => __( 'Stats about revenue.', 'woocommerce' ),
			),
			array(
				'slug'        => 'orders/stats',
				'description' => __( 'Stats about orders.', 'woocommerce' ),
			),
			array(
				'slug'        => 'products',
				'description' => __( 'Products detailed reports.', 'woocommerce' ),
			),
			array(
				'slug'        => 'products/stats',
				'description' => __( 'Stats about products.', 'woocommerce' ),
			),
			array(
				'slug'        => 'variations',
				'description' => __( 'Variations detailed reports.', 'woocommerce' ),
			),
			array(
				'slug'        => 'variations/stats',
				'description' => __( 'Stats about variations.', 'woocommerce' ),
			),
			array(
				'slug'        => 'categories',
				'description' => __( 'Product categories detailed reports.', 'woocommerce' ),
			),
			array(
				'slug'        => 'categories/stats',
				'description' => __( 'Stats about product categories.', 'woocommerce' ),
			),
			array(
				'slug'        => 'coupons',
				'description' => __( 'Coupons detailed reports.', 'woocommerce' ),
			),
			array(
				'slug'        => 'coupons/stats',
				'description' => __( 'Stats about coupons.', 'woocommerce' ),
			),
			array(
				'slug'        => 'taxes',
				'description' => __( 'Taxes detailed reports.', 'woocommerce' ),
			),
			array(
				'slug'        => 'taxes/stats',
				'description' => __( 'Stats about taxes.', 'woocommerce' ),
			),
			array(
				'slug'        => 'downloads',
				'description' => __( 'Product downloads detailed reports.', 'woocommerce' ),
			),
			array(
				'slug'        => 'downloads/files',
				'description' => __( 'Product download files detailed reports.', 'woocommerce' ),
			),
			array(
				'slug'        => 'downloads/stats',
				'description' => __( 'Stats about product downloads.', 'woocommerce' ),
			),
			array(
				'slug'        => 'customers',
				'description' => __( 'Customers detailed reports.', 'woocommerce' ),
			),
		);

		/**
		 * Filter the list of allowed reports, so that data can be loaded from third party extensions in addition to WooCommerce core.
		 * Array items should be in format of array( 'slug' => 'downloads/stats', 'description' =>  '',
		 * 'url' => '', and 'path' => '/wc-ext/v1/...'.
		 *
		 * @param array $endpoints The list of allowed reports..
		 */
		$reports = apply_filters( 'woocommerce_admin_reports', $reports );

		foreach ( $reports as $report ) {
			if ( empty( $report['slug'] ) ) {
				continue;
			}

			if ( empty( $report['path'] ) ) {
				$report['path'] = '/' . $this->namespace . '/reports/' . $report['slug'];
			}

			// Allows a different admin page to be loaded here,
			// or allows an empty url if no report exists for a set of performance indicators.
			if ( ! isset( $report['url'] ) ) {
				if ( '/stats' === substr( $report['slug'], -6 ) ) {
					$url_slug = substr( $report['slug'], 0, -6 );
				} else {
					$url_slug = $report['slug'];
				}

				$report['url'] = '/analytics/' . $url_slug;
			}

			$item   = $this->prepare_item_for_response( (object) $report, $request );
			$data[] = $this->prepare_response_for_collection( $item );
		}

		return rest_ensure_response( $data );
	}

	/**
	 * Get the order number for an order. If no filter is present for `woocommerce_order_number`, we can just return the ID.
	 * Returns the parent order number if the order is actually a refund.
	 *
	 * @param  int $order_id Order ID.
	 * @return string
	 */
	public function get_order_number( $order_id ) {
		$order = wc_get_order( $order_id );

		if ( ! $order instanceof \WC_Order && ! $order instanceof \WC_Order_Refund ) {
			return null;
		}

		if ( 'shop_order_refund' === $order->get_type() ) {
			$order = wc_get_order( $order->get_parent_id() );
		}

		if ( ! has_filter( 'woocommerce_order_number' ) ) {
			return $order->get_id();
		}

		return $order->get_order_number();
	}

	/**
	 * Get the order total with the related currency formatting.
	 * Returns the parent order total if the order is actually a refund.
	 *
	 * @param  int $order_id Order ID.
	 * @return string
	 */
	public function get_total_formatted( $order_id ) {
		$order = wc_get_order( $order_id );

		if ( ! $order instanceof \WC_Order && ! $order instanceof \WC_Order_Refund ) {
			return null;
		}

		if ( 'shop_order_refund' === $order->get_type() ) {
			$order = wc_get_order( $order->get_parent_id() );
		}

		return wp_strip_all_tags( html_entity_decode( $order->get_formatted_order_total() ), true );
	}

	/**
	 * Prepare a report object for serialization.
	 *
	 * @param stdClass        $report  Report data.
	 * @param WP_REST_Request $request Request object.
	 * @return WP_REST_Response
	 */
	public function prepare_item_for_response( $report, $request ) {
		$data = array(
			'slug'        => $report->slug,
			'description' => $report->description,
			'path'        => $report->path,
		);

		$context = ! empty( $request['context'] ) ? $request['context'] : 'view';
		$data    = $this->add_additional_fields_to_object( $data, $request );
		$data    = $this->filter_response_by_context( $data, $context );

		// Wrap the data in a response object.
		$response = rest_ensure_response( $data );
		$response->add_links(
			array(
				'self'       => array(
					'href' => rest_url( $report->path ),
				),
				'report'     => array(
					'href' => $report->url,
				),
				'collection' => array(
					'href' => rest_url( sprintf( '%s/%s', $this->namespace, $this->rest_base ) ),
				),
			)
		);

		/**
		 * Filter a report returned from the API.
		 *
		 * Allows modification of the report data right before it is returned.
		 *
		 * @param WP_REST_Response $response The response object.
		 * @param object           $report   The original report object.
		 * @param WP_REST_Request  $request  Request used to generate the response.
		 */
		return apply_filters( 'woocommerce_rest_prepare_report', $response, $report, $request );
	}

	/**
	 * Get the Report's schema, conforming to JSON Schema.
	 *
	 * @return array
	 */
	public function get_item_schema() {
		$schema = array(
			'$schema'    => 'http://json-schema.org/draft-04/schema#',
			'title'      => 'report',
			'type'       => 'object',
			'properties' => array(
				'slug'        => array(
					'description' => __( 'An alphanumeric identifier for the resource.', 'woocommerce' ),
					'type'        => 'string',
					'context'     => array( 'view' ),
					'readonly'    => true,
				),
				'description' => array(
					'description' => __( 'A human-readable description of the resource.', 'woocommerce' ),
					'type'        => 'string',
					'context'     => array( 'view' ),
					'readonly'    => true,
				),
				'path'        => array(
					'description' => __( 'API path.', 'woocommerce' ),
					'type'        => 'string',
					'context'     => array( 'view' ),
					'readonly'    => true,
				),
			),
		);

		return $this->add_additional_fields_schema( $schema );
	}

	/**
	 * Get the query params for collections.
	 *
	 * @return array
	 */
	public function get_collection_params() {
		return array(
			'context' => $this->get_context_param( array( 'default' => 'view' ) ),
		);
	}

	/**
	 * Get order statuses without prefixes.
	 * Includes unregistered statuses that have been marked "actionable".
	 *
	 * @return array
	 */
	public static function get_order_statuses() {
		// Allow all statuses selected as "actionable" - this may include unregistered statuses.
		// See: https://github.com/woocommerce/woocommerce-admin/issues/5592.
		$actionable_statuses = get_option( 'woocommerce_actionable_order_statuses', array() );

		// See WC_REST_Orders_V2_Controller::get_collection_params() re: any/trash statuses.
		$registered_statuses = array_merge( array( 'any', 'trash' ), array_keys( self::get_order_status_labels() ) );

		// Merge the status arrays (using flip to avoid array_unique()).
		$allowed_statuses = array_keys( array_merge( array_flip( $registered_statuses ), array_flip( $actionable_statuses ) ) );

		return $allowed_statuses;
	}

	/**
	 * Get order statuses (and labels) without prefixes.
	 *
	 * @return array
	 */
	public static function get_order_status_labels() {
		$order_statuses = array();

		foreach ( wc_get_order_statuses() as $key => $label ) {
			$new_key                    = str_replace( 'wc-', '', $key );
			$order_statuses[ $new_key ] = $label;
		}

		return $order_statuses;
	}
}
woocommerce-admin/src/API/Reports/Segmenter.php000064400000052326151335517650015474 0ustar00<?php
/**
 * Class for adding segmenting support without cluttering the data stores.
 */

namespace Automattic\WooCommerce\Admin\API\Reports;

defined( 'ABSPATH' ) || exit;

use \Automattic\WooCommerce\Admin\API\Reports\Coupons\DataStore as CouponsDataStore;
use \Automattic\WooCommerce\Admin\API\Reports\Taxes\Stats\DataStore as TaxesStatsDataStore;

/**
 * Date & time interval and numeric range handling class for Reporting API.
 */
class Segmenter {

	/**
	 * Array of all segment ids.
	 *
	 * @var array|bool
	 */
	protected $all_segment_ids = false;

	/**
	 * Array of all segment labels.
	 *
	 * @var array
	 */
	protected $segment_labels = array();

	/**
	 * Query arguments supplied by the user for data store.
	 *
	 * @var array
	 */
	protected $query_args = '';

	/**
	 * SQL definition for each column.
	 *
	 * @var array
	 */
	protected $report_columns = array();

	/**
	 * Constructor.
	 *
	 * @param array $query_args Query arguments supplied by the user for data store.
	 * @param array $report_columns Report columns lookup from data store.
	 */
	public function __construct( $query_args, $report_columns ) {
		$this->query_args     = $query_args;
		$this->report_columns = $report_columns;
	}

	/**
	 * Filters definitions for SELECT clauses based on query_args and joins them into one string usable in SELECT clause.
	 *
	 * @param array $columns_mapping Column name -> SQL statememt mapping.
	 *
	 * @return string to be used in SELECT clause statements.
	 */
	protected function prepare_selections( $columns_mapping ) {
		if ( isset( $this->query_args['fields'] ) && is_array( $this->query_args['fields'] ) ) {
			$keep = array();
			foreach ( $this->query_args['fields'] as $field ) {
				if ( isset( $columns_mapping[ $field ] ) ) {
					$keep[ $field ] = $columns_mapping[ $field ];
				}
			}
			$selections = implode( ', ', $keep );
		} else {
			$selections = implode( ', ', $columns_mapping );
		}

		if ( $selections ) {
			$selections = ',' . $selections;
		}

		return $selections;
	}

	/**
	 * Update row-level db result for segments in 'totals' section to the format used for output.
	 *
	 * @param array  $segments_db_result Results from the SQL db query for segmenting.
	 * @param string $segment_dimension Name of column used for grouping the result.
	 *
	 * @return array Reformatted array.
	 */
	protected function reformat_totals_segments( $segments_db_result, $segment_dimension ) {
		$segment_result = array();

		if ( strpos( $segment_dimension, '.' ) ) {
			$segment_dimension = substr( strstr( $segment_dimension, '.' ), 1 );
		}

		$segment_labels = $this->get_segment_labels();
		foreach ( $segments_db_result as $segment_data ) {
			$segment_id = $segment_data[ $segment_dimension ];
			if ( ! isset( $segment_labels[ $segment_id ] ) ) {
				continue;
			}

			unset( $segment_data[ $segment_dimension ] );
			$segment_datum                 = array(
				'segment_id'    => $segment_id,
				'segment_label' => $segment_labels[ $segment_id ],
				'subtotals'     => $segment_data,
			);
			$segment_result[ $segment_id ] = $segment_datum;
		}

		return $segment_result;
	}

	/**
	 * Merges segmented results for totals response part.
	 *
	 * E.g. $r1 = array(
	 *     0 => array(
	 *          'product_id' => 3,
	 *          'net_amount' => 15,
	 *     ),
	 * );
	 * $r2 = array(
	 *     0 => array(
	 *          'product_id'      => 3,
	 *          'avg_order_value' => 25,
	 *     ),
	 * );
	 *
	 * $merged = array(
	 *     3 => array(
	 *          'segment_id' => 3,
	 *          'subtotals'  => array(
	 *              'net_amount'      => 15,
	 *              'avg_order_value' => 25,
	 *          )
	 *     ),
	 * );
	 *
	 * @param string $segment_dimension Name of the segment dimension=key in the result arrays used to match records from result sets.
	 * @param array  $result1 Array 1 of segmented figures.
	 * @param array  $result2 Array 2 of segmented figures.
	 *
	 * @return array
	 */
	protected function merge_segment_totals_results( $segment_dimension, $result1, $result2 ) {
		$result_segments = array();
		$segment_labels  = $this->get_segment_labels();

		foreach ( $result1 as $segment_data ) {
			$segment_id = $segment_data[ $segment_dimension ];
			if ( ! isset( $segment_labels[ $segment_id ] ) ) {
				continue;
			}

			unset( $segment_data[ $segment_dimension ] );
			$result_segments[ $segment_id ] = array(
				'segment_label' => $segment_labels[ $segment_id ],
				'segment_id'    => $segment_id,
				'subtotals'     => $segment_data,
			);
		}

		foreach ( $result2 as $segment_data ) {
			$segment_id = $segment_data[ $segment_dimension ];
			if ( ! isset( $segment_labels[ $segment_id ] ) ) {
				continue;
			}

			unset( $segment_data[ $segment_dimension ] );
			if ( ! isset( $result_segments[ $segment_id ] ) ) {
				$result_segments[ $segment_id ] = array(
					'segment_label' => $segment_labels[ $segment_id ],
					'segment_id'    => $segment_id,
					'subtotals'     => array(),
				);
			}
			$result_segments[ $segment_id ]['subtotals'] = array_merge( $result_segments[ $segment_id ]['subtotals'], $segment_data );
		}
		return $result_segments;
	}
	/**
	 * Merges segmented results for intervals response part.
	 *
	 * E.g. $r1 = array(
	 *     0 => array(
	 *          'product_id'    => 3,
	 *          'time_interval' => '2018-12'
	 *          'net_amount'    => 15,
	 *     ),
	 * );
	 * $r2 = array(
	 *     0 => array(
	 *          'product_id'      => 3,
	 *          'time_interval' => '2018-12'
	 *          'avg_order_value' => 25,
	 *     ),
	 * );
	 *
	 * $merged = array(
	 *     '2018-12' => array(
	 *          'segments' => array(
	 *              3 => array(
	 *                  'segment_id' => 3,
	 *                  'subtotals'  => array(
	 *                      'net_amount'      => 15,
	 *                      'avg_order_value' => 25,
	 *                  ),
	 *              ),
	 *          ),
	 *     ),
	 * );
	 *
	 * @param string $segment_dimension Name of the segment dimension=key in the result arrays used to match records from result sets.
	 * @param array  $result1 Array 1 of segmented figures.
	 * @param array  $result2 Array 2 of segmented figures.
	 *
	 * @return array
	 */
	protected function merge_segment_intervals_results( $segment_dimension, $result1, $result2 ) {
		$result_segments = array();
		$segment_labels  = $this->get_segment_labels();

		foreach ( $result1 as $segment_data ) {
			$segment_id = $segment_data[ $segment_dimension ];
			if ( ! isset( $segment_labels[ $segment_id ] ) ) {
				continue;
			}

			$time_interval = $segment_data['time_interval'];
			if ( ! isset( $result_segments[ $time_interval ] ) ) {
				$result_segments[ $time_interval ]             = array();
				$result_segments[ $time_interval ]['segments'] = array();
			}

			unset( $segment_data['time_interval'] );
			unset( $segment_data['datetime_anchor'] );
			unset( $segment_data[ $segment_dimension ] );
			$segment_datum = array(
				'segment_label' => $segment_labels[ $segment_id ],
				'segment_id'    => $segment_id,
				'subtotals'     => $segment_data,
			);
			$result_segments[ $time_interval ]['segments'][ $segment_id ] = $segment_datum;
		}

		foreach ( $result2 as $segment_data ) {
			$segment_id = $segment_data[ $segment_dimension ];
			if ( ! isset( $segment_labels[ $segment_id ] ) ) {
				continue;
			}

			$time_interval = $segment_data['time_interval'];
			if ( ! isset( $result_segments[ $time_interval ] ) ) {
				$result_segments[ $time_interval ]             = array();
				$result_segments[ $time_interval ]['segments'] = array();
			}

			unset( $segment_data['time_interval'] );
			unset( $segment_data['datetime_anchor'] );
			unset( $segment_data[ $segment_dimension ] );

			if ( ! isset( $result_segments[ $time_interval ]['segments'][ $segment_id ] ) ) {
				$result_segments[ $time_interval ]['segments'][ $segment_id ] = array(
					'segment_label' => $segment_labels[ $segment_id ],
					'segment_id'    => $segment_id,
					'subtotals'     => array(),
				);
			}
			$result_segments[ $time_interval ]['segments'][ $segment_id ]['subtotals'] = array_merge( $result_segments[ $time_interval ]['segments'][ $segment_id ]['subtotals'], $segment_data );
		}
		return $result_segments;
	}

	/**
	 * Update row-level db result for segments in 'intervals' section to the format used for output.
	 *
	 * @param array  $segments_db_result Results from the SQL db query for segmenting.
	 * @param string $segment_dimension Name of column used for grouping the result.
	 *
	 * @return array Reformatted array.
	 */
	protected function reformat_intervals_segments( $segments_db_result, $segment_dimension ) {
		$aggregated_segment_result = array();

		if ( strpos( $segment_dimension, '.' ) ) {
			$segment_dimension = substr( strstr( $segment_dimension, '.' ), 1 );
		}

		$segment_labels = $this->get_segment_labels();

		foreach ( $segments_db_result as $segment_data ) {
			$segment_id = $segment_data[ $segment_dimension ];
			if ( ! isset( $segment_labels[ $segment_id ] ) ) {
				continue;
			}

			$time_interval = $segment_data['time_interval'];
			if ( ! isset( $aggregated_segment_result[ $time_interval ] ) ) {
				$aggregated_segment_result[ $time_interval ]             = array();
				$aggregated_segment_result[ $time_interval ]['segments'] = array();
			}
			unset( $segment_data['time_interval'] );
			unset( $segment_data['datetime_anchor'] );
			unset( $segment_data[ $segment_dimension ] );
			$segment_datum = array(
				'segment_label' => $segment_labels[ $segment_id ],
				'segment_id'    => $segment_id,
				'subtotals'     => $segment_data,
			);
			$aggregated_segment_result[ $time_interval ]['segments'][ $segment_id ] = $segment_datum;
		}

		return $aggregated_segment_result;
	}

	/**
	 * Fetches all segment ids from db and stores it for later use.
	 *
	 * @return void
	 */
	protected function set_all_segments() {
		global $wpdb;

		if ( ! isset( $this->query_args['segmentby'] ) || '' === $this->query_args['segmentby'] ) {
			$this->all_segment_ids = array();
			return;
		}

		$segments       = array();
		$segment_labels = array();

		if ( 'product' === $this->query_args['segmentby'] ) {
			$args = array(
				'return' => 'objects',
				'limit'  => -1,
			);

			if ( isset( $this->query_args['product_includes'] ) ) {
				$args['include'] = $this->query_args['product_includes'];
			}

			if ( isset( $this->query_args['category_includes'] ) ) {
				$categories       = $this->query_args['category_includes'];
				$args['category'] = array();
				foreach ( $categories as $category_id ) {
					$terms              = get_term_by( 'id', $category_id, 'product_cat' );
					$args['category'][] = $terms->slug;
				}
			}

			$segment_objects = wc_get_products( $args );
			foreach ( $segment_objects as $segment ) {
				$id                    = $segment->get_id();
				$segments[]            = $id;
				$segment_labels[ $id ] = $segment->get_name();
			}
		} elseif ( 'variation' === $this->query_args['segmentby'] ) {
			$args = array(
				'return' => 'objects',
				'limit'  => -1,
				'type'   => 'variation',
			);

			if (
				isset( $this->query_args['product_includes'] ) &&
				count( $this->query_args['product_includes'] ) === 1
			) {
				$args['parent'] = $this->query_args['product_includes'][0];
			}

			if ( isset( $this->query_args['variation_includes'] ) ) {
				$args['include'] = $this->query_args['variation_includes'];
			}

			$segment_objects = wc_get_products( $args );

			foreach ( $segment_objects as $segment ) {
				$id           = $segment->get_id();
				$segments[]   = $id;
				$product_name = $segment->get_name();
				$separator    = apply_filters( 'woocommerce_product_variation_title_attributes_separator', ' - ', $segment );
				$attributes   = wc_get_formatted_variation( $segment, true, false );

				$segment_labels[ $id ] = $product_name . $separator . $attributes;
			}

			// If no variations were specified, add a segment for the parent product (variation = 0).
			// This is to catch simple products with prior sales converted into variable products.
			// See: https://github.com/woocommerce/woocommerce-admin/issues/2719.
			if ( isset( $args['parent'] ) && empty( $args['include'] ) ) {
				$parent_object     = wc_get_product( $args['parent'] );
				$segments[]        = 0;
				$segment_labels[0] = $parent_object->get_name();
			}
		} elseif ( 'category' === $this->query_args['segmentby'] ) {
			$args = array(
				'taxonomy' => 'product_cat',
			);

			if ( isset( $this->query_args['category_includes'] ) ) {
				$args['include'] = $this->query_args['category_includes'];
			}

			// @todo: Look into `wc_get_products` or data store methods and not directly touching the database or post types.
			$categories = get_categories( $args );

			$segments       = wp_list_pluck( $categories, 'cat_ID' );
			$segment_labels = wp_list_pluck( $categories, 'name', 'cat_ID' );

		} elseif ( 'coupon' === $this->query_args['segmentby'] ) {
			$args = array();
			if ( isset( $this->query_args['coupons'] ) ) {
				$args['include'] = $this->query_args['coupons'];
			}
			$coupons_store  = new CouponsDataStore();
			$coupons        = $coupons_store->get_coupons( $args );
			$segments       = wp_list_pluck( $coupons, 'ID' );
			$segment_labels = wp_list_pluck( $coupons, 'post_title', 'ID' );
			$segment_labels = array_map( 'wc_format_coupon_code', $segment_labels );
		} elseif ( 'customer_type' === $this->query_args['segmentby'] ) {
			// 0 -- new customer
			// 1 -- returning customer
			$segments = array( 0, 1 );
		} elseif ( 'tax_rate_id' === $this->query_args['segmentby'] ) {
			$args = array();
			if ( isset( $this->query_args['taxes'] ) ) {
				$args['include'] = $this->query_args['taxes'];
			}
			$taxes = TaxesStatsDataStore::get_taxes( $args );

			foreach ( $taxes as $tax ) {
				$id                    = $tax['tax_rate_id'];
				$segments[]            = $id;
				$segment_labels[ $id ] = \WC_Tax::get_rate_code( (object) $tax );
			}
		} else {
			// Catch all default.
			$segments = array();
		}

		$this->all_segment_ids = $segments;
		$this->segment_labels  = $segment_labels;
	}

	/**
	 * Return all segment ids for given segmentby query parameter.
	 *
	 * @return array
	 */
	protected function get_all_segments() {
		if ( ! is_array( $this->all_segment_ids ) ) {
			$this->set_all_segments();
		}

		return $this->all_segment_ids;
	}

	/**
	 * Return all segment labels for given segmentby query parameter.
	 *
	 * @return array
	 */
	protected function get_segment_labels() {
		if ( ! is_array( $this->all_segment_ids ) ) {
			$this->set_all_segments();
		}

		return $this->segment_labels;
	}

	/**
	 * Compares two report data objects by pre-defined object property and ASC/DESC ordering.
	 *
	 * @param stdClass $a Object a.
	 * @param stdClass $b Object b.
	 * @return string
	 */
	private function segment_cmp( $a, $b ) {
		if ( $a['segment_id'] === $b['segment_id'] ) {
			return 0;
		} elseif ( $a['segment_id'] > $b['segment_id'] ) {
			return 1;
		} elseif ( $a['segment_id'] < $b['segment_id'] ) {
			return - 1;
		}
	}

	/**
	 * Adds zeroes for segments not present in the data selection.
	 *
	 * @param array $segments Array of segments from the database for given data points.
	 *
	 * @return array
	 */
	protected function fill_in_missing_segments( $segments ) {
		$segment_subtotals = array();
		if ( isset( $this->query_args['fields'] ) && is_array( $this->query_args['fields'] ) ) {
			foreach ( $this->query_args['fields'] as $field ) {
				if ( isset( $this->report_columns[ $field ] ) ) {
					$segment_subtotals[ $field ] = 0;
				}
			}
		} else {
			foreach ( $this->report_columns as $field => $sql_clause ) {
				$segment_subtotals[ $field ] = 0;
			}
		}
		if ( ! is_array( $segments ) ) {
			$segments = array();
		}
		$all_segment_ids = $this->get_all_segments();
		$segment_labels  = $this->get_segment_labels();
		foreach ( $all_segment_ids as $segment_id ) {
			if ( ! isset( $segments[ $segment_id ] ) ) {
				$segments[ $segment_id ] = array(
					'segment_id'    => $segment_id,
					'segment_label' => $segment_labels[ $segment_id ],
					'subtotals'     => $segment_subtotals,
				);
			}
		}

		// Using array_values to remove custom keys, so that it gets later converted to JSON as an array.
		$segments_no_keys = array_values( $segments );
		usort( $segments_no_keys, array( $this, 'segment_cmp' ) );
		return $segments_no_keys;
	}

	/**
	 * Adds missing segments to intervals, modifies $data.
	 *
	 * @param stdClass $data Response data.
	 */
	protected function fill_in_missing_interval_segments( &$data ) {
		foreach ( $data->intervals as $order_id => $interval_data ) {
			$data->intervals[ $order_id ]['segments'] = $this->fill_in_missing_segments( $data->intervals[ $order_id ]['segments'] );
		}
	}

	/**
	 * Calculate segments for segmenting property bound to product (e.g. category, product_id, variation_id).
	 *
	 * @param string $type Type of segments to return--'totals' or 'intervals'.
	 * @param array  $segmenting_selections SELECT part of segmenting SQL query--one for 'product_level' and one for 'order_level'.
	 * @param string $segmenting_from FROM part of segmenting SQL query.
	 * @param string $segmenting_where WHERE part of segmenting SQL query.
	 * @param string $segmenting_groupby GROUP BY part of segmenting SQL query.
	 * @param string $segmenting_dimension_name Name of the segmenting dimension.
	 * @param string $table_name Name of SQL table which is the stats table for orders.
	 * @param array  $query_params Array of SQL clauses for intervals/totals query.
	 * @param string $unique_orders_table Name of temporary SQL table that holds unique orders.
	 *
	 * @return array
	 */
	protected function get_product_related_segments( $type, $segmenting_selections, $segmenting_from, $segmenting_where, $segmenting_groupby, $segmenting_dimension_name, $table_name, $query_params, $unique_orders_table ) {
		if ( 'totals' === $type ) {
			return $this->get_product_related_totals_segments( $segmenting_selections, $segmenting_from, $segmenting_where, $segmenting_groupby, $segmenting_dimension_name, $table_name, $query_params, $unique_orders_table );
		} elseif ( 'intervals' === $type ) {
			return $this->get_product_related_intervals_segments( $segmenting_selections, $segmenting_from, $segmenting_where, $segmenting_groupby, $segmenting_dimension_name, $table_name, $query_params, $unique_orders_table );
		}
	}

	/**
	 * Calculate segments for segmenting property bound to order (e.g. coupon or customer type).
	 *
	 * @param string $type Type of segments to return--'totals' or 'intervals'.
	 * @param string $segmenting_select SELECT part of segmenting SQL query.
	 * @param string $segmenting_from FROM part of segmenting SQL query.
	 * @param string $segmenting_where WHERE part of segmenting SQL query.
	 * @param string $segmenting_groupby GROUP BY part of segmenting SQL query.
	 * @param string $table_name Name of SQL table which is the stats table for orders.
	 * @param array  $query_params Array of SQL clauses for intervals/totals query.
	 *
	 * @return array
	 */
	protected function get_order_related_segments( $type, $segmenting_select, $segmenting_from, $segmenting_where, $segmenting_groupby, $table_name, $query_params ) {
		if ( 'totals' === $type ) {
			return $this->get_order_related_totals_segments( $segmenting_select, $segmenting_from, $segmenting_where, $segmenting_groupby, $table_name, $query_params );
		} elseif ( 'intervals' === $type ) {
			return $this->get_order_related_intervals_segments( $segmenting_select, $segmenting_from, $segmenting_where, $segmenting_groupby, $table_name, $query_params );
		}
	}

	/**
	 * Assign segments to time intervals by updating original $intervals array.
	 *
	 * @param array $intervals Result array from intervals SQL query.
	 * @param array $intervals_segments Result array from interval segments SQL query.
	 */
	protected function assign_segments_to_intervals( &$intervals, $intervals_segments ) {
		$old_keys = array_keys( $intervals );
		foreach ( $intervals as $interval ) {
			$intervals[ $interval['time_interval'] ]             = $interval;
			$intervals[ $interval['time_interval'] ]['segments'] = array();
		}
		foreach ( $old_keys as $key ) {
			unset( $intervals[ $key ] );
		}

		foreach ( $intervals_segments as $time_interval => $segment ) {
			if ( isset( $intervals[ $time_interval ] ) ) {
				$intervals[ $time_interval ]['segments'] = $segment['segments'];
			}
		}
		// To remove time interval keys (so that REST response is formatted correctly).
		$intervals = array_values( $intervals );
	}

	/**
	 * Returns an array of segments for totals part of REST response.
	 *
	 * @param array  $query_params Totals SQL query parameters.
	 * @param string $table_name Name of the SQL table that is the main order stats table.
	 *
	 * @return array
	 */
	public function get_totals_segments( $query_params, $table_name ) {
		$segments = $this->get_segments( 'totals', $query_params, $table_name );
		$segments = $this->fill_in_missing_segments( $segments );

		return $segments;
	}

	/**
	 * Adds an array of segments to data->intervals object.
	 *
	 * @param stdClass $data Data object representing the REST response.
	 * @param array    $intervals_query Intervals SQL query parameters.
	 * @param string   $table_name Name of the SQL table that is the main order stats table.
	 */
	public function add_intervals_segments( &$data, $intervals_query, $table_name ) {
		$intervals_segments = $this->get_segments( 'intervals', $intervals_query, $table_name );

		$this->assign_segments_to_intervals( $data->intervals, $intervals_segments );
		$this->fill_in_missing_interval_segments( $data );
	}
}
woocommerce-admin/src/API/Reports/Orders/Controller.php000064400000050203151335517650017114 0ustar00<?php
/**
 * REST API Reports orders controller
 *
 * Handles requests to the /reports/orders endpoint.
 */

namespace Automattic\WooCommerce\Admin\API\Reports\Orders;

defined( 'ABSPATH' ) || exit;

use \Automattic\WooCommerce\Admin\API\Reports\Controller as ReportsController;
use \Automattic\WooCommerce\Admin\API\Reports\ExportableInterface;

/**
 * REST API Reports orders controller class.
 *
 * @extends \Automattic\WooCommerce\Admin\API\Reports\Controller
 */
class Controller extends ReportsController implements ExportableInterface {

	/**
	 * Endpoint namespace.
	 *
	 * @var string
	 */
	protected $namespace = 'wc-analytics';

	/**
	 * Route base.
	 *
	 * @var string
	 */
	protected $rest_base = 'reports/orders';

	/**
	 * Maps query arguments from the REST request.
	 *
	 * @param array $request Request array.
	 * @return array
	 */
	protected function prepare_reports_query( $request ) {
		$args                       = array();
		$args['before']             = $request['before'];
		$args['after']              = $request['after'];
		$args['page']               = $request['page'];
		$args['per_page']           = $request['per_page'];
		$args['orderby']            = $request['orderby'];
		$args['order']              = $request['order'];
		$args['product_includes']   = (array) $request['product_includes'];
		$args['product_excludes']   = (array) $request['product_excludes'];
		$args['variation_includes'] = (array) $request['variation_includes'];
		$args['variation_excludes'] = (array) $request['variation_excludes'];
		$args['coupon_includes']    = (array) $request['coupon_includes'];
		$args['coupon_excludes']    = (array) $request['coupon_excludes'];
		$args['tax_rate_includes']  = (array) $request['tax_rate_includes'];
		$args['tax_rate_excludes']  = (array) $request['tax_rate_excludes'];
		$args['status_is']          = (array) $request['status_is'];
		$args['status_is_not']      = (array) $request['status_is_not'];
		$args['customer_type']      = $request['customer_type'];
		$args['extended_info']      = $request['extended_info'];
		$args['refunds']            = $request['refunds'];
		$args['match']              = $request['match'];
		$args['order_includes']     = $request['order_includes'];
		$args['order_excludes']     = $request['order_excludes'];
		$args['attribute_is']       = (array) $request['attribute_is'];
		$args['attribute_is_not']   = (array) $request['attribute_is_not'];

		return $args;
	}

	/**
	 * Get all reports.
	 *
	 * @param WP_REST_Request $request Request data.
	 * @return array|WP_Error
	 */
	public function get_items( $request ) {
		$query_args   = $this->prepare_reports_query( $request );
		$orders_query = new Query( $query_args );
		$report_data  = $orders_query->get_data();

		$data = array();

		foreach ( $report_data->data as $orders_data ) {
			$orders_data['order_number']    = $this->get_order_number( $orders_data['order_id'] );
			$orders_data['total_formatted'] = $this->get_total_formatted( $orders_data['order_id'] );
			$item                           = $this->prepare_item_for_response( $orders_data, $request );
			$data[]                         = $this->prepare_response_for_collection( $item );
		}

		$response = rest_ensure_response( $data );
		$response->header( 'X-WP-Total', (int) $report_data->total );
		$response->header( 'X-WP-TotalPages', (int) $report_data->pages );

		$page      = $report_data->page_no;
		$max_pages = $report_data->pages;
		$base      = add_query_arg( $request->get_query_params(), rest_url( sprintf( '/%s/%s', $this->namespace, $this->rest_base ) ) );
		if ( $page > 1 ) {
			$prev_page = $page - 1;
			if ( $prev_page > $max_pages ) {
				$prev_page = $max_pages;
			}
			$prev_link = add_query_arg( 'page', $prev_page, $base );
			$response->link_header( 'prev', $prev_link );
		}
		if ( $max_pages > $page ) {
			$next_page = $page + 1;
			$next_link = add_query_arg( 'page', $next_page, $base );
			$response->link_header( 'next', $next_link );
		}

		return $response;
	}

	/**
	 * Prepare a report object for serialization.
	 *
	 * @param stdClass        $report  Report data.
	 * @param WP_REST_Request $request Request object.
	 * @return WP_REST_Response
	 */
	public function prepare_item_for_response( $report, $request ) {
		$data = $report;

		$context = ! empty( $request['context'] ) ? $request['context'] : 'view';
		$data    = $this->add_additional_fields_to_object( $data, $request );
		$data    = $this->filter_response_by_context( $data, $context );

		// Wrap the data in a response object.
		$response = rest_ensure_response( $data );
		$response->add_links( $this->prepare_links( $report ) );

		/**
		 * Filter a report returned from the API.
		 *
		 * Allows modification of the report data right before it is returned.
		 *
		 * @param WP_REST_Response $response The response object.
		 * @param object           $report   The original report object.
		 * @param WP_REST_Request  $request  Request used to generate the response.
		 */
		return apply_filters( 'woocommerce_rest_prepare_report_orders', $response, $report, $request );
	}

	/**
	 * Prepare links for the request.
	 *
	 * @param WC_Reports_Query $object Object data.
	 * @return array
	 */
	protected function prepare_links( $object ) {
		$links = array(
			'order' => array(
				'href' => rest_url( sprintf( '/%s/orders/%d', $this->namespace, $object['order_id'] ) ),
			),
		);

		return $links;
	}

	/**
	 * Get the Report's schema, conforming to JSON Schema.
	 *
	 * @return array
	 */
	public function get_item_schema() {
		$schema = array(
			'$schema'    => 'http://json-schema.org/draft-04/schema#',
			'title'      => 'report_orders',
			'type'       => 'object',
			'properties' => array(
				'order_id'         => array(
					'description' => __( 'Order ID.', 'woocommerce' ),
					'type'        => 'integer',
					'context'     => array( 'view', 'edit' ),
					'readonly'    => true,
				),
				'order_number'     => array(
					'description' => __( 'Order Number.', 'woocommerce' ),
					'type'        => 'string',
					'context'     => array( 'view', 'edit' ),
					'readonly'    => true,
				),
				'date_created'     => array(
					'description' => __( "Date the order was created, in the site's timezone.", 'woocommerce' ),
					'type'        => 'date-time',
					'context'     => array( 'view', 'edit' ),
					'readonly'    => true,
				),
				'date_created_gmt' => array(
					'description' => __( 'Date the order was created, as GMT.', 'woocommerce' ),
					'type'        => 'date-time',
					'context'     => array( 'view', 'edit' ),
					'readonly'    => true,
				),
				'status'           => array(
					'description' => __( 'Order status.', 'woocommerce' ),
					'type'        => 'string',
					'context'     => array( 'view', 'edit' ),
					'readonly'    => true,
				),
				'customer_id'      => array(
					'description' => __( 'Customer ID.', 'woocommerce' ),
					'type'        => 'integer',
					'context'     => array( 'view', 'edit' ),
					'readonly'    => true,
				),
				'num_items_sold'   => array(
					'description' => __( 'Number of items sold.', 'woocommerce' ),
					'type'        => 'integer',
					'context'     => array( 'view', 'edit' ),
					'readonly'    => true,
				),
				'net_total'        => array(
					'description' => __( 'Net total revenue.', 'woocommerce' ),
					'type'        => 'float',
					'context'     => array( 'view', 'edit' ),
					'readonly'    => true,
				),
				'total_formatted'  => array(
					'description' => __( 'Net total revenue (formatted).', 'woocommerce' ),
					'type'        => 'string',
					'context'     => array( 'view', 'edit' ),
					'readonly'    => true,
				),
				'customer_type'    => array(
					'description' => __( 'Returning or new customer.', 'woocommerce' ),
					'type'        => 'string',
					'context'     => array( 'view', 'edit' ),
					'readonly'    => true,
				),
				'extended_info'    => array(
					'products' => array(
						'type'        => 'array',
						'readonly'    => true,
						'context'     => array( 'view', 'edit' ),
						'description' => __( 'List of order product IDs, names, quantities.', 'woocommerce' ),
					),
					'coupons'  => array(
						'type'        => 'array',
						'readonly'    => true,
						'context'     => array( 'view', 'edit' ),
						'description' => __( 'List of order coupons.', 'woocommerce' ),
					),
					'customer' => array(
						'type'        => 'object',
						'readonly'    => true,
						'context'     => array( 'view', 'edit' ),
						'description' => __( 'Order customer information.', 'woocommerce' ),
					),
				),
			),
		);

		return $this->add_additional_fields_schema( $schema );
	}

	/**
	 * Get the query params for collections.
	 *
	 * @return array
	 */
	public function get_collection_params() {
		$params                       = array();
		$params['context']            = $this->get_context_param( array( 'default' => 'view' ) );
		$params['page']               = array(
			'description'       => __( 'Current page of the collection.', 'woocommerce' ),
			'type'              => 'integer',
			'default'           => 1,
			'sanitize_callback' => 'absint',
			'validate_callback' => 'rest_validate_request_arg',
			'minimum'           => 1,
		);
		$params['per_page']           = array(
			'description'       => __( 'Maximum number of items to be returned in result set.', 'woocommerce' ),
			'type'              => 'integer',
			'default'           => 10,
			'minimum'           => 0,
			'maximum'           => 100,
			'sanitize_callback' => 'absint',
			'validate_callback' => 'rest_validate_request_arg',
		);
		$params['after']              = array(
			'description'       => __( 'Limit response to resources published after a given ISO8601 compliant date.', 'woocommerce' ),
			'type'              => 'string',
			'format'            => 'date-time',
			'validate_callback' => 'rest_validate_request_arg',
		);
		$params['before']             = array(
			'description'       => __( 'Limit response to resources published before a given ISO8601 compliant date.', 'woocommerce' ),
			'type'              => 'string',
			'format'            => 'date-time',
			'validate_callback' => 'rest_validate_request_arg',
		);
		$params['order']              = array(
			'description'       => __( 'Order sort attribute ascending or descending.', 'woocommerce' ),
			'type'              => 'string',
			'default'           => 'desc',
			'enum'              => array( 'asc', 'desc' ),
			'validate_callback' => 'rest_validate_request_arg',
		);
		$params['orderby']            = array(
			'description'       => __( 'Sort collection by object attribute.', 'woocommerce' ),
			'type'              => 'string',
			'default'           => 'date',
			'enum'              => array(
				'date',
				'num_items_sold',
				'net_total',
			),
			'validate_callback' => 'rest_validate_request_arg',
		);
		$params['product_includes']   = array(
			'description'       => __( 'Limit result set to items that have the specified product(s) assigned.', 'woocommerce' ),
			'type'              => 'array',
			'items'             => array(
				'type' => 'integer',
			),
			'default'           => array(),
			'sanitize_callback' => 'wp_parse_id_list',
			'validate_callback' => 'rest_validate_request_arg',
		);
		$params['product_excludes']   = array(
			'description'       => __( 'Limit result set to items that don\'t have the specified product(s) assigned.', 'woocommerce' ),
			'type'              => 'array',
			'items'             => array(
				'type' => 'integer',
			),
			'default'           => array(),
			'validate_callback' => 'rest_validate_request_arg',
			'sanitize_callback' => 'wp_parse_id_list',
		);
		$params['variation_includes'] = array(
			'description'       => __( 'Limit result set to items that have the specified variation(s) assigned.', 'woocommerce' ),
			'type'              => 'array',
			'items'             => array(
				'type' => 'integer',
			),
			'default'           => array(),
			'sanitize_callback' => 'wp_parse_id_list',
			'validate_callback' => 'rest_validate_request_arg',
		);
		$params['variation_excludes'] = array(
			'description'       => __( 'Limit result set to items that don\'t have the specified variation(s) assigned.', 'woocommerce' ),
			'type'              => 'array',
			'items'             => array(
				'type' => 'integer',
			),
			'default'           => array(),
			'validate_callback' => 'rest_validate_request_arg',
			'sanitize_callback' => 'wp_parse_id_list',
		);
		$params['coupon_includes']    = array(
			'description'       => __( 'Limit result set to items that have the specified coupon(s) assigned.', 'woocommerce' ),
			'type'              => 'array',
			'items'             => array(
				'type' => 'integer',
			),
			'default'           => array(),
			'sanitize_callback' => 'wp_parse_id_list',
			'validate_callback' => 'rest_validate_request_arg',
		);
		$params['coupon_excludes']    = array(
			'description'       => __( 'Limit result set to items that don\'t have the specified coupon(s) assigned.', 'woocommerce' ),
			'type'              => 'array',
			'items'             => array(
				'type' => 'integer',
			),
			'default'           => array(),
			'validate_callback' => 'rest_validate_request_arg',
			'sanitize_callback' => 'wp_parse_id_list',
		);
		$params['tax_rate_includes']  = array(
			'description'       => __( 'Limit result set to items that have the specified tax rate(s) assigned.', 'woocommerce' ),
			'type'              => 'array',
			'items'             => array(
				'type' => 'integer',
			),
			'default'           => array(),
			'sanitize_callback' => 'wp_parse_id_list',
			'validate_callback' => 'rest_validate_request_arg',
		);
		$params['tax_rate_excludes']  = array(
			'description'       => __( 'Limit result set to items that don\'t have the specified tax rate(s) assigned.', 'woocommerce' ),
			'type'              => 'array',
			'items'             => array(
				'type' => 'integer',
			),
			'default'           => array(),
			'validate_callback' => 'rest_validate_request_arg',
			'sanitize_callback' => 'wp_parse_id_list',
		);
		$params['status_is']          = array(
			'description'       => __( 'Limit result set to items that have the specified order status.', 'woocommerce' ),
			'type'              => 'array',
			'sanitize_callback' => 'wp_parse_slug_list',
			'validate_callback' => 'rest_validate_request_arg',
			'items'             => array(
				'enum' => self::get_order_statuses(),
				'type' => 'string',
			),
		);
		$params['status_is_not']      = array(
			'description'       => __( 'Limit result set to items that don\'t have the specified order status.', 'woocommerce' ),
			'type'              => 'array',
			'sanitize_callback' => 'wp_parse_slug_list',
			'validate_callback' => 'rest_validate_request_arg',
			'items'             => array(
				'enum' => self::get_order_statuses(),
				'type' => 'string',
			),
		);
		$params['customer_type']      = array(
			'description'       => __( 'Limit result set to returning or new customers.', 'woocommerce' ),
			'type'              => 'string',
			'default'           => '',
			'enum'              => array(
				'',
				'returning',
				'new',
			),
			'validate_callback' => 'rest_validate_request_arg',
		);
		$params['refunds']            = array(
			'description'       => __( 'Limit result set to specific types of refunds.', 'woocommerce' ),
			'type'              => 'string',
			'default'           => '',
			'enum'              => array(
				'',
				'all',
				'partial',
				'full',
				'none',
			),
			'validate_callback' => 'rest_validate_request_arg',
		);
		$params['extended_info']      = array(
			'description'       => __( 'Add additional piece of info about each coupon to the report.', 'woocommerce' ),
			'type'              => 'boolean',
			'default'           => false,
			'sanitize_callback' => 'wc_string_to_bool',
			'validate_callback' => 'rest_validate_request_arg',
		);
		$params['order_includes']     = array(
			'description'       => __( 'Limit result set to items that have the specified order ids.', 'woocommerce' ),
			'type'              => 'array',
			'sanitize_callback' => 'wp_parse_id_list',
			'validate_callback' => 'rest_validate_request_arg',
			'items'             => array(
				'type' => 'integer',
			),
		);
		$params['order_excludes']     = array(
			'description'       => __( 'Limit result set to items that don\'t have the specified order ids.', 'woocommerce' ),
			'type'              => 'array',
			'sanitize_callback' => 'wp_parse_id_list',
			'validate_callback' => 'rest_validate_request_arg',
			'items'             => array(
				'type' => 'integer',
			),
		);
		$params['attribute_is']       = array(
			'description'       => __( 'Limit result set to orders that include products with the specified attributes.', 'woocommerce' ),
			'type'              => 'array',
			'items'             => array(
				'type' => 'array',
			),
			'default'           => array(),
			'validate_callback' => 'rest_validate_request_arg',
		);
		$params['attribute_is_not']   = array(
			'description'       => __( 'Limit result set to orders that don\'t include products with the specified attributes.', 'woocommerce' ),
			'type'              => 'array',
			'items'             => array(
				'type' => 'array',
			),
			'default'           => array(),
			'validate_callback' => 'rest_validate_request_arg',
		);

		return $params;
	}

	/**
	 * Get customer name column export value.
	 *
	 * @param array $customer Customer from report row.
	 * @return string
	 */
	protected function get_customer_name( $customer ) {
		return $customer['first_name'] . ' ' . $customer['last_name'];
	}

	/**
	 * Get products column export value.
	 *
	 * @param array $products Products from report row.
	 * @return string
	 */
	protected function _get_products( $products ) {
		$products_list = array();

		foreach ( $products as $product ) {
			$products_list[] = sprintf(
				/* translators: 1: numeric product quantity, 2: name of product */
				__( '%1$s× %2$s', 'woocommerce' ),
				$product['quantity'],
				$product['name']
			);
		}

		return implode( ', ', $products_list );
	}

	/**
	 * Get coupons column export value.
	 *
	 * @param array $coupons Coupons from report row.
	 * @return string
	 */
	protected function _get_coupons( $coupons ) {
		return implode( ', ', wp_list_pluck( $coupons, 'code' ) );
	}

	/**
	 * Get the column names for export.
	 *
	 * @return array Key value pair of Column ID => Label.
	 */
	public function get_export_columns() {
		$export_columns = array(
			'date_created'    => __( 'Date', 'woocommerce' ),
			'order_number'    => __( 'Order #', 'woocommerce' ),
			'total_formatted' => __( 'N. Revenue (formatted)', 'woocommerce' ),
			'status'          => __( 'Status', 'woocommerce' ),
			'customer_name'   => __( 'Customer', 'woocommerce' ),
			'customer_type'   => __( 'Customer type', 'woocommerce' ),
			'products'        => __( 'Product(s)', 'woocommerce' ),
			'num_items_sold'  => __( 'Items sold', 'woocommerce' ),
			'coupons'         => __( 'Coupon(s)', 'woocommerce' ),
			'net_total'       => __( 'N. Revenue', 'woocommerce' ),
		);

		/**
		 * Filter to add or remove column names from the orders report for
		 * export.
		 *
		 * @since 1.6.0
		 */
		return apply_filters(
			'woocommerce_report_orders_export_columns',
			$export_columns
		);
	}

	/**
	 * Get the column values for export.
	 *
	 * @param array $item Single report item/row.
	 * @return array Key value pair of Column ID => Row Value.
	 */
	public function prepare_item_for_export( $item ) {
		$export_item = array(
			'date_created'    => $item['date_created'],
			'order_number'    => $item['order_number'],
			'total_formatted' => $item['total_formatted'],
			'status'          => $item['status'],
			'customer_name'   => isset( $item['extended_info']['customer'] ) ? $this->get_customer_name( $item['extended_info']['customer'] ) : null,
			'customer_type'   => $item['customer_type'],
			'products'        => isset( $item['extended_info']['products'] ) ? $this->_get_products( $item['extended_info']['products'] ) : null,
			'num_items_sold'  => $item['num_items_sold'],
			'coupons'         => isset( $item['extended_info']['coupons'] ) ? $this->_get_coupons( $item['extended_info']['coupons'] ) : null,
			'net_total'       => $item['net_total'],
		);

		/**
		 * Filter to prepare extra columns in the export item for the orders
		 * report.
		 *
		 * @since 1.6.0
		 */
		return apply_filters(
			'woocommerce_report_orders_prepare_export_item',
			$export_item,
			$item
		);
	}
}
woocommerce-admin/src/API/Reports/Orders/Stats/Query.php000064400000003004151335517650017171 0ustar00<?php
/**
 * Class for parameter-based Order Stats Reports querying
 *
 * Example usage:
 * $args = array(
 *          'before'       => '2018-07-19 00:00:00',
 *          'after'        => '2018-07-05 00:00:00',
 *          'interval'     => 'week',
 *          'categories'   => array(15, 18),
 *          'coupons'      => array(138),
 *          'status_in'    => array('completed'),
 *         );
 * $report = new \Automattic\WooCommerce\Admin\API\Reports\Orders\Stats\Query( $args );
 * $mydata = $report->get_data();
 */

namespace Automattic\WooCommerce\Admin\API\Reports\Orders\Stats;

defined( 'ABSPATH' ) || exit;

use \Automattic\WooCommerce\Admin\API\Reports\Query as ReportsQuery;

/**
 * API\Reports\Orders\Stats\Query
 */
class Query extends ReportsQuery {

	/**
	 * Valid fields for Orders report.
	 *
	 * @return array
	 */
	protected function get_default_query_vars() {
		return array(
			'fields' => array(
				'net_revenue',
				'avg_order_value',
				'orders_count',
				'avg_items_per_order',
				'num_items_sold',
				'coupons',
				'coupons_count',
				'total_customers',
			),
		);
	}

	/**
	 * Get revenue data based on the current query vars.
	 *
	 * @return array
	 */
	public function get_data() {
		$args = apply_filters( 'woocommerce_analytics_orders_stats_query_args', $this->get_query_vars() );

		$data_store = \WC_Data_Store::load( 'report-orders-stats' );
		$results    = $data_store->get_data( $args );
		return apply_filters( 'woocommerce_analytics_orders_stats_select_query', $results, $args );
	}
}
woocommerce-admin/src/API/Reports/Orders/Stats/Controller.php000064400000047702151335517650020224 0ustar00<?php
/**
 * REST API Reports orders stats controller
 *
 * Handles requests to the /reports/orders/stats endpoint.
 */

namespace Automattic\WooCommerce\Admin\API\Reports\Orders\Stats;

defined( 'ABSPATH' ) || exit;

use \Automattic\WooCommerce\Admin\API\Reports\ParameterException;

/**
 * REST API Reports orders stats controller class.
 *
 * @extends \Automattic\WooCommerce\Admin\API\Reports\Controller
 */
class Controller extends \Automattic\WooCommerce\Admin\API\Reports\Controller {

	/**
	 * Endpoint namespace.
	 *
	 * @var string
	 */
	protected $namespace = 'wc-analytics';

	/**
	 * Route base.
	 *
	 * @var string
	 */
	protected $rest_base = 'reports/orders/stats';

	/**
	 * Maps query arguments from the REST request.
	 *
	 * @param array $request Request array.
	 * @return array
	 */
	protected function prepare_reports_query( $request ) {
		$args                       = array();
		$args['before']             = $request['before'];
		$args['after']              = $request['after'];
		$args['interval']           = $request['interval'];
		$args['page']               = $request['page'];
		$args['per_page']           = $request['per_page'];
		$args['orderby']            = $request['orderby'];
		$args['order']              = $request['order'];
		$args['fields']             = $request['fields'];
		$args['match']              = $request['match'];
		$args['status_is']          = (array) $request['status_is'];
		$args['status_is_not']      = (array) $request['status_is_not'];
		$args['product_includes']   = (array) $request['product_includes'];
		$args['product_excludes']   = (array) $request['product_excludes'];
		$args['variation_includes'] = (array) $request['variation_includes'];
		$args['variation_excludes'] = (array) $request['variation_excludes'];
		$args['coupon_includes']    = (array) $request['coupon_includes'];
		$args['coupon_excludes']    = (array) $request['coupon_excludes'];
		$args['tax_rate_includes']  = (array) $request['tax_rate_includes'];
		$args['tax_rate_excludes']  = (array) $request['tax_rate_excludes'];
		$args['customer_type']      = $request['customer_type'];
		$args['refunds']            = $request['refunds'];
		$args['attribute_is']       = (array) $request['attribute_is'];
		$args['attribute_is_not']   = (array) $request['attribute_is_not'];
		$args['category_includes']  = (array) $request['categories'];
		$args['segmentby']          = $request['segmentby'];

		// For backwards compatibility, `customer` is aliased to `customer_type`.
		if ( empty( $request['customer_type'] ) && ! empty( $request['customer'] ) ) {
			$args['customer_type'] = $request['customer'];
		}

		return $args;
	}

	/**
	 * Get all reports.
	 *
	 * @param WP_REST_Request $request Request data.
	 * @return array|WP_Error
	 */
	public function get_items( $request ) {
		$query_args   = $this->prepare_reports_query( $request );
		$orders_query = new Query( $query_args );
		try {
			$report_data = $orders_query->get_data();
		} catch ( ParameterException $e ) {
			return new \WP_Error( $e->getErrorCode(), $e->getMessage(), array( 'status' => $e->getCode() ) );
		}

		$out_data = array(
			'totals'    => get_object_vars( $report_data->totals ),
			'intervals' => array(),
		);

		foreach ( $report_data->intervals as $interval_data ) {
			$item                    = $this->prepare_item_for_response( $interval_data, $request );
			$out_data['intervals'][] = $this->prepare_response_for_collection( $item );
		}

		$response = rest_ensure_response( $out_data );
		$response->header( 'X-WP-Total', (int) $report_data->total );
		$response->header( 'X-WP-TotalPages', (int) $report_data->pages );

		$page      = $report_data->page_no;
		$max_pages = $report_data->pages;
		$base      = add_query_arg( $request->get_query_params(), rest_url( sprintf( '/%s/%s', $this->namespace, $this->rest_base ) ) );
		if ( $page > 1 ) {
			$prev_page = $page - 1;
			if ( $prev_page > $max_pages ) {
				$prev_page = $max_pages;
			}
			$prev_link = add_query_arg( 'page', $prev_page, $base );
			$response->link_header( 'prev', $prev_link );
		}
		if ( $max_pages > $page ) {
			$next_page = $page + 1;
			$next_link = add_query_arg( 'page', $next_page, $base );
			$response->link_header( 'next', $next_link );
		}

		return $response;
	}

	/**
	 * Prepare a report object for serialization.
	 *
	 * @param Array           $report  Report data.
	 * @param WP_REST_Request $request Request object.
	 * @return WP_REST_Response
	 */
	public function prepare_item_for_response( $report, $request ) {
		$data = $report;

		$context = ! empty( $request['context'] ) ? $request['context'] : 'view';
		$data    = $this->add_additional_fields_to_object( $data, $request );
		$data    = $this->filter_response_by_context( $data, $context );

		// Wrap the data in a response object.
		$response = rest_ensure_response( $data );

		/**
		 * Filter a report returned from the API.
		 *
		 * Allows modification of the report data right before it is returned.
		 *
		 * @param WP_REST_Response $response The response object.
		 * @param object           $report   The original report object.
		 * @param WP_REST_Request  $request  Request used to generate the response.
		 */
		return apply_filters( 'woocommerce_rest_prepare_report_orders_stats', $response, $report, $request );
	}

	/**
	 * Get the Report's schema, conforming to JSON Schema.
	 *
	 * @return array
	 */
	public function get_item_schema() {
		$data_values = array(
			'net_revenue'         => array(
				'description' => __( 'Net sales.', 'woocommerce' ),
				'type'        => 'number',
				'context'     => array( 'view', 'edit' ),
				'readonly'    => true,
				'format'      => 'currency',
			),
			'orders_count'        => array(
				'title'       => __( 'Orders', 'woocommerce' ),
				'description' => __( 'Number of orders', 'woocommerce' ),
				'type'        => 'integer',
				'context'     => array( 'view', 'edit' ),
				'readonly'    => true,
				'indicator'   => true,
			),
			'avg_order_value'     => array(
				'description' => __( 'Average order value.', 'woocommerce' ),
				'type'        => 'number',
				'context'     => array( 'view', 'edit' ),
				'readonly'    => true,
				'indicator'   => true,
				'format'      => 'currency',
			),
			'avg_items_per_order' => array(
				'description' => __( 'Average items per order', 'woocommerce' ),
				'type'        => 'number',
				'context'     => array( 'view', 'edit' ),
				'readonly'    => true,
			),
			'num_items_sold'      => array(
				'description' => __( 'Number of items sold', 'woocommerce' ),
				'type'        => 'integer',
				'context'     => array( 'view', 'edit' ),
				'readonly'    => true,
			),
			'coupons'             => array(
				'description' => __( 'Amount discounted by coupons.', 'woocommerce' ),
				'type'        => 'number',
				'context'     => array( 'view', 'edit' ),
				'readonly'    => true,
			),
			'coupons_count'       => array(
				'description' => __( 'Unique coupons count.', 'woocommerce' ),
				'type'        => 'number',
				'context'     => array( 'view', 'edit' ),
				'readonly'    => true,
			),
			'total_customers'     => array(
				'description' => __( 'Total distinct customers.', 'woocommerce' ),
				'type'        => 'integer',
				'context'     => array( 'view', 'edit' ),
				'readonly'    => true,
			),
			'products'            => array(
				'description' => __( 'Number of distinct products sold.', 'woocommerce' ),
				'type'        => 'number',
				'context'     => array( 'view', 'edit' ),
				'readonly'    => true,
			),
		);

		$segments = array(
			'segments' => array(
				'description' => __( 'Reports data grouped by segment condition.', 'woocommerce' ),
				'type'        => 'array',
				'context'     => array( 'view', 'edit' ),
				'readonly'    => true,
				'items'       => array(
					'type'       => 'object',
					'properties' => array(
						'segment_id' => array(
							'description' => __( 'Segment identificator.', 'woocommerce' ),
							'type'        => 'integer',
							'context'     => array( 'view', 'edit' ),
							'readonly'    => true,
						),
						'subtotals'  => array(
							'description' => __( 'Interval subtotals.', 'woocommerce' ),
							'type'        => 'object',
							'context'     => array( 'view', 'edit' ),
							'readonly'    => true,
							'properties'  => $data_values,
						),
					),
				),
			),
		);

		$totals = array_merge( $data_values, $segments );

		// Products is not shown in intervals.
		unset( $data_values['products'] );

		$intervals = array_merge( $data_values, $segments );

		$schema = array(
			'$schema'    => 'http://json-schema.org/draft-04/schema#',
			'title'      => 'report_orders_stats',
			'type'       => 'object',
			'properties' => array(
				'totals'    => array(
					'description' => __( 'Totals data.', 'woocommerce' ),
					'type'        => 'object',
					'context'     => array( 'view', 'edit' ),
					'readonly'    => true,
					'properties'  => $totals,
				),
				'intervals' => array(
					'description' => __( 'Reports data grouped by intervals.', 'woocommerce' ),
					'type'        => 'array',
					'context'     => array( 'view', 'edit' ),
					'readonly'    => true,
					'items'       => array(
						'type'       => 'object',
						'properties' => array(
							'interval'       => array(
								'description' => __( 'Type of interval.', 'woocommerce' ),
								'type'        => 'string',
								'context'     => array( 'view', 'edit' ),
								'readonly'    => true,
								'enum'        => array( 'day', 'week', 'month', 'year' ),
							),
							'date_start'     => array(
								'description' => __( "The date the report start, in the site's timezone.", 'woocommerce' ),
								'type'        => 'date-time',
								'context'     => array( 'view', 'edit' ),
								'readonly'    => true,
							),
							'date_start_gmt' => array(
								'description' => __( 'The date the report start, as GMT.', 'woocommerce' ),
								'type'        => 'date-time',
								'context'     => array( 'view', 'edit' ),
								'readonly'    => true,
							),
							'date_end'       => array(
								'description' => __( "The date the report end, in the site's timezone.", 'woocommerce' ),
								'type'        => 'date-time',
								'context'     => array( 'view', 'edit' ),
								'readonly'    => true,
							),
							'date_end_gmt'   => array(
								'description' => __( 'The date the report end, as GMT.', 'woocommerce' ),
								'type'        => 'date-time',
								'context'     => array( 'view', 'edit' ),
								'readonly'    => true,
							),
							'subtotals'      => array(
								'description' => __( 'Interval subtotals.', 'woocommerce' ),
								'type'        => 'object',
								'context'     => array( 'view', 'edit' ),
								'readonly'    => true,
								'properties'  => $intervals,
							),
						),
					),
				),
			),
		);

		return $this->add_additional_fields_schema( $schema );
	}

	/**
	 * Get the query params for collections.
	 *
	 * @return array
	 */
	public function get_collection_params() {
		$params                     = array();
		$params['context']          = $this->get_context_param( array( 'default' => 'view' ) );
		$params['page']             = array(
			'description'       => __( 'Current page of the collection.', 'woocommerce' ),
			'type'              => 'integer',
			'default'           => 1,
			'sanitize_callback' => 'absint',
			'validate_callback' => 'rest_validate_request_arg',
			'minimum'           => 1,
		);
		$params['per_page']         = array(
			'description'       => __( 'Maximum number of items to be returned in result set.', 'woocommerce' ),
			'type'              => 'integer',
			'default'           => 10,
			'minimum'           => 1,
			'maximum'           => 100,
			'sanitize_callback' => 'absint',
			'validate_callback' => 'rest_validate_request_arg',
		);
		$params['after']            = array(
			'description'       => __( 'Limit response to resources published after a given ISO8601 compliant date.', 'woocommerce' ),
			'type'              => 'string',
			'format'            => 'date-time',
			'validate_callback' => 'rest_validate_request_arg',
		);
		$params['before']           = array(
			'description'       => __( 'Limit response to resources published before a given ISO8601 compliant date.', 'woocommerce' ),
			'type'              => 'string',
			'format'            => 'date-time',
			'validate_callback' => 'rest_validate_request_arg',
		);
		$params['order']            = array(
			'description'       => __( 'Order sort attribute ascending or descending.', 'woocommerce' ),
			'type'              => 'string',
			'default'           => 'desc',
			'enum'              => array( 'asc', 'desc' ),
			'validate_callback' => 'rest_validate_request_arg',
		);
		$params['orderby']          = array(
			'description'       => __( 'Sort collection by object attribute.', 'woocommerce' ),
			'type'              => 'string',
			'default'           => 'date',
			'enum'              => array(
				'date',
				'net_revenue',
				'orders_count',
				'avg_order_value',
			),
			'validate_callback' => 'rest_validate_request_arg',
		);
		$params['interval']         = array(
			'description'       => __( 'Time interval to use for buckets in the returned data.', 'woocommerce' ),
			'type'              => 'string',
			'default'           => 'week',
			'enum'              => array(
				'hour',
				'day',
				'week',
				'month',
				'quarter',
				'year',
			),
			'validate_callback' => 'rest_validate_request_arg',
		);
		$params['match']            = array(
			'description'       => __( 'Indicates whether all the conditions should be true for the resulting set, or if any one of them is sufficient. Match affects the following parameters: status_is, status_is_not, product_includes, product_excludes, coupon_includes, coupon_excludes, customer, categories', 'woocommerce' ),
			'type'              => 'string',
			'default'           => 'all',
			'enum'              => array(
				'all',
				'any',
			),
			'validate_callback' => 'rest_validate_request_arg',
		);
		$params['status_is']        = array(
			'description'       => __( 'Limit result set to items that have the specified order status.', 'woocommerce' ),
			'type'              => 'array',
			'sanitize_callback' => 'wp_parse_slug_list',
			'validate_callback' => 'rest_validate_request_arg',
			'default'           => null,
			'items'             => array(
				'enum' => self::get_order_statuses(),
				'type' => 'string',
			),
		);
		$params['status_is_not']    = array(
			'description'       => __( 'Limit result set to items that don\'t have the specified order status.', 'woocommerce' ),
			'type'              => 'array',
			'sanitize_callback' => 'wp_parse_slug_list',
			'validate_callback' => 'rest_validate_request_arg',
			'items'             => array(
				'enum' => self::get_order_statuses(),
				'type' => 'string',
			),
		);
		$params['product_includes'] = array(
			'description'       => __( 'Limit result set to items that have the specified product(s) assigned.', 'woocommerce' ),
			'type'              => 'array',
			'items'             => array(
				'type' => 'integer',
			),
			'default'           => array(),
			'sanitize_callback' => 'wp_parse_id_list',

		);
		$params['product_excludes']   = array(
			'description'       => __( 'Limit result set to items that don\'t have the specified product(s) assigned.', 'woocommerce' ),
			'type'              => 'array',
			'items'             => array(
				'type' => 'integer',
			),
			'default'           => array(),
			'sanitize_callback' => 'wp_parse_id_list',
		);
		$params['variation_includes'] = array(
			'description'       => __( 'Limit result set to items that have the specified variation(s) assigned.', 'woocommerce' ),
			'type'              => 'array',
			'items'             => array(
				'type' => 'integer',
			),
			'default'           => array(),
			'sanitize_callback' => 'wp_parse_id_list',
			'validate_callback' => 'rest_validate_request_arg',
		);
		$params['variation_excludes'] = array(
			'description'       => __( 'Limit result set to items that don\'t have the specified variation(s) assigned.', 'woocommerce' ),
			'type'              => 'array',
			'items'             => array(
				'type' => 'integer',
			),
			'default'           => array(),
			'validate_callback' => 'rest_validate_request_arg',
			'sanitize_callback' => 'wp_parse_id_list',
		);
		$params['coupon_includes']    = array(
			'description'       => __( 'Limit result set to items that have the specified coupon(s) assigned.', 'woocommerce' ),
			'type'              => 'array',
			'items'             => array(
				'type' => 'integer',
			),
			'default'           => array(),
			'sanitize_callback' => 'wp_parse_id_list',
		);
		$params['coupon_excludes']    = array(
			'description'       => __( 'Limit result set to items that don\'t have the specified coupon(s) assigned.', 'woocommerce' ),
			'type'              => 'array',
			'items'             => array(
				'type' => 'integer',
			),
			'default'           => array(),
			'sanitize_callback' => 'wp_parse_id_list',
		);
		$params['tax_rate_includes']  = array(
			'description'       => __( 'Limit result set to items that have the specified tax rate(s) assigned.', 'woocommerce' ),
			'type'              => 'array',
			'items'             => array(
				'type' => 'integer',
			),
			'default'           => array(),
			'sanitize_callback' => 'wp_parse_id_list',
			'validate_callback' => 'rest_validate_request_arg',
		);
		$params['tax_rate_excludes']  = array(
			'description'       => __( 'Limit result set to items that don\'t have the specified tax rate(s) assigned.', 'woocommerce' ),
			'type'              => 'array',
			'items'             => array(
				'type' => 'integer',
			),
			'default'           => array(),
			'validate_callback' => 'rest_validate_request_arg',
			'sanitize_callback' => 'wp_parse_id_list',
		);
		$params['customer']           = array(
			'description'       => __( 'Alias for customer_type (deprecated).', 'woocommerce' ),
			'type'              => 'string',
			'enum'              => array(
				'new',
				'returning',
			),
			'validate_callback' => 'rest_validate_request_arg',
		);
		$params['customer_type']      = array(
			'description'       => __( 'Limit result set to orders that have the specified customer_type', 'woocommerce' ),
			'type'              => 'string',
			'enum'              => array(
				'new',
				'returning',
			),
			'validate_callback' => 'rest_validate_request_arg',
		);
		$params['refunds']            = array(
			'description'       => __( 'Limit result set to specific types of refunds.', 'woocommerce' ),
			'type'              => 'string',
			'default'           => '',
			'enum'              => array(
				'',
				'all',
				'partial',
				'full',
				'none',
			),
			'validate_callback' => 'rest_validate_request_arg',
		);
		$params['attribute_is']       = array(
			'description'       => __( 'Limit result set to orders that include products with the specified attributes.', 'woocommerce' ),
			'type'              => 'array',
			'items'             => array(
				'type' => 'array',
			),
			'default'           => array(),
			'validate_callback' => 'rest_validate_request_arg',
		);
		$params['attribute_is_not']   = array(
			'description'       => __( 'Limit result set to orders that don\'t include products with the specified attributes.', 'woocommerce' ),
			'type'              => 'array',
			'items'             => array(
				'type' => 'array',
			),
			'default'           => array(),
			'validate_callback' => 'rest_validate_request_arg',
		);
		$params['segmentby']          = array(
			'description'       => __( 'Segment the response by additional constraint.', 'woocommerce' ),
			'type'              => 'string',
			'enum'              => array(
				'product',
				'category',
				'variation',
				'coupon',
				'customer_type', // new vs returning.
			),
			'validate_callback' => 'rest_validate_request_arg',
		);
		$params['fields']             = array(
			'description'       => __( 'Limit stats fields to the specified items.', 'woocommerce' ),
			'type'              => 'array',
			'sanitize_callback' => 'wp_parse_slug_list',
			'validate_callback' => 'rest_validate_request_arg',
			'items'             => array(
				'type' => 'string',
			),
		);

		return $params;
	}
}
woocommerce-admin/src/API/Reports/Orders/Stats/Segmenter.php000064400000051635151335517650020032 0ustar00<?php
/**
 * Class for adding segmenting support without cluttering the data stores.
 */

namespace Automattic\WooCommerce\Admin\API\Reports\Orders\Stats;

defined( 'ABSPATH' ) || exit;

use \Automattic\WooCommerce\Admin\API\Reports\Segmenter as ReportsSegmenter;
use \Automattic\WooCommerce\Admin\API\Reports\ParameterException;

/**
 * Date & time interval and numeric range handling class for Reporting API.
 */
class Segmenter extends ReportsSegmenter {

	/**
	 * Returns column => query mapping to be used for product-related product-level segmenting query
	 * (e.g. products sold, revenue from product X when segmenting by category).
	 *
	 * @param string $products_table Name of SQL table containing the product-level segmenting info.
	 *
	 * @return array Column => SELECT query mapping.
	 */
	protected function get_segment_selections_product_level( $products_table ) {
		$columns_mapping = array(
			'num_items_sold' => "SUM($products_table.product_qty) as num_items_sold",
			'total_sales'    => "SUM($products_table.product_gross_revenue) AS total_sales",
			'coupons'        => 'SUM( coupon_lookup_left_join.discount_amount ) AS coupons',
			'coupons_count'  => 'COUNT( DISTINCT( coupon_lookup_left_join.coupon_id ) ) AS coupons_count',
			'refunds'        => "SUM( CASE WHEN $products_table.product_gross_revenue < 0 THEN $products_table.product_gross_revenue ELSE 0 END ) AS refunds",
			'taxes'          => "SUM($products_table.tax_amount) AS taxes",
			'shipping'       => "SUM($products_table.shipping_amount) AS shipping",
			'net_revenue'    => "SUM($products_table.product_net_revenue) AS net_revenue",
		);

		return $columns_mapping;
	}

	/**
	 * Returns column => query mapping to be used for order-related product-level segmenting query
	 * (e.g. avg items per order when segmented by category).
	 *
	 * @param string $unique_orders_table Name of SQL table containing the order-level segmenting info.
	 *
	 * @return array Column => SELECT query mapping.
	 */
	protected function get_segment_selections_order_level( $unique_orders_table ) {
		$columns_mapping = array(
			'orders_count'        => "COUNT($unique_orders_table.order_id) AS orders_count",
			'avg_items_per_order' => "AVG($unique_orders_table.num_items_sold) AS avg_items_per_order",
			'avg_order_value'     => "SUM($unique_orders_table.net_total) / COUNT($unique_orders_table.order_id) AS avg_order_value",
			'total_customers'     => "COUNT( DISTINCT( $unique_orders_table.customer_id ) ) AS total_customers",
		);

		return $columns_mapping;
	}

	/**
	 * Returns column => query mapping to be used for order-level segmenting query
	 * (e.g. avg items per order or Net sales when segmented by coupons).
	 *
	 * @param string $order_stats_table Name of SQL table containing the order-level info.
	 * @param array  $overrides Array of overrides for default column calculations.
	 *
	 * @return array Column => SELECT query mapping.
	 */
	protected function segment_selections_orders( $order_stats_table, $overrides = array() ) {
		$columns_mapping = array(
			'num_items_sold'      => "SUM($order_stats_table.num_items_sold) as num_items_sold",
			'total_sales'         => "SUM($order_stats_table.total_sales) AS total_sales",
			'coupons'             => "SUM($order_stats_table.discount_amount) AS coupons",
			'coupons_count'       => 'COUNT( DISTINCT(coupon_lookup_left_join.coupon_id) ) AS coupons_count',
			'refunds'             => "SUM( CASE WHEN $order_stats_table.parent_id != 0 THEN $order_stats_table.total_sales END ) AS refunds",
			'taxes'               => "SUM($order_stats_table.tax_total) AS taxes",
			'shipping'            => "SUM($order_stats_table.shipping_total) AS shipping",
			'net_revenue'         => "SUM($order_stats_table.net_total) AS net_revenue",
			'orders_count'        => "COUNT($order_stats_table.order_id) AS orders_count",
			'avg_items_per_order' => "AVG($order_stats_table.num_items_sold) AS avg_items_per_order",
			'avg_order_value'     => "SUM($order_stats_table.net_total) / COUNT($order_stats_table.order_id) AS avg_order_value",
			'total_customers'     => "COUNT( DISTINCT( $order_stats_table.customer_id ) ) AS total_customers",
		);

		if ( $overrides ) {
			$columns_mapping = array_merge( $columns_mapping, $overrides );
		}

		return $columns_mapping;
	}

	/**
	 * Calculate segments for totals where the segmenting property is bound to product (e.g. category, product_id, variation_id).
	 *
	 * @param array  $segmenting_selections SELECT part of segmenting SQL query--one for 'product_level' and one for 'order_level'.
	 * @param string $segmenting_from FROM part of segmenting SQL query.
	 * @param string $segmenting_where WHERE part of segmenting SQL query.
	 * @param string $segmenting_groupby GROUP BY part of segmenting SQL query.
	 * @param string $segmenting_dimension_name Name of the segmenting dimension.
	 * @param string $table_name Name of SQL table which is the stats table for orders.
	 * @param array  $totals_query Array of SQL clauses for totals query.
	 * @param string $unique_orders_table Name of temporary SQL table that holds unique orders.
	 *
	 * @return array
	 */
	protected function get_product_related_totals_segments( $segmenting_selections, $segmenting_from, $segmenting_where, $segmenting_groupby, $segmenting_dimension_name, $table_name, $totals_query, $unique_orders_table ) {
		global $wpdb;

		$product_segmenting_table = $wpdb->prefix . 'wc_order_product_lookup';

		// Can't get all the numbers from one query, so split it into one query for product-level numbers and one for order-level numbers (which first need to have orders uniqued).
		// Product-level numbers.
		$segments_products = $wpdb->get_results(
			"SELECT
						$segmenting_groupby AS $segmenting_dimension_name
						{$segmenting_selections['product_level']}
					FROM
						$table_name
						$segmenting_from
						{$totals_query['from_clause']}
					WHERE
						1=1
						{$totals_query['where_time_clause']}
						{$totals_query['where_clause']}
						$segmenting_where
					GROUP BY
						$segmenting_groupby",
			ARRAY_A
		); // phpcs:ignore cache ok, DB call ok, unprepared SQL ok.

		// Order level numbers.
		// As there can be 2 same product ids (or variation ids) per one order, the orders first need to be uniqued before calculating averages, customer counts, etc.
		$segments_orders = $wpdb->get_results(
			"SELECT
				    $unique_orders_table.$segmenting_dimension_name AS $segmenting_dimension_name
				    {$segmenting_selections['order_level']}
				FROM
				(
					SELECT
				        $table_name.order_id,
				        $segmenting_groupby AS $segmenting_dimension_name,
				        MAX( num_items_sold ) AS num_items_sold,
				        MAX( net_total ) as net_total,
				        MAX( returning_customer ) AS returning_customer,
						MAX( $table_name.customer_id ) as customer_id
				    FROM
				        $table_name
				        $segmenting_from
				        {$totals_query['from_clause']}
				    WHERE
				        1=1
						{$totals_query['where_time_clause']}
						{$totals_query['where_clause']}
						$segmenting_where
				    GROUP BY
				        $product_segmenting_table.order_id, $segmenting_groupby
				) AS $unique_orders_table
				GROUP BY
				    $unique_orders_table.$segmenting_dimension_name",
			ARRAY_A
		); // phpcs:ignore cache ok, DB call ok, unprepared SQL ok.

		$totals_segments = $this->merge_segment_totals_results( $segmenting_dimension_name, $segments_products, $segments_orders );
		return $totals_segments;
	}

	/**
	 * Calculate segments for intervals where the segmenting property is bound to product (e.g. category, product_id, variation_id).
	 *
	 * @param array  $segmenting_selections SELECT part of segmenting SQL query--one for 'product_level' and one for 'order_level'.
	 * @param string $segmenting_from FROM part of segmenting SQL query.
	 * @param string $segmenting_where WHERE part of segmenting SQL query.
	 * @param string $segmenting_groupby GROUP BY part of segmenting SQL query.
	 * @param string $segmenting_dimension_name Name of the segmenting dimension.
	 * @param string $table_name Name of SQL table which is the stats table for orders.
	 * @param array  $intervals_query Array of SQL clauses for intervals query.
	 * @param string $unique_orders_table Name of temporary SQL table that holds unique orders.
	 *
	 * @return array
	 */
	protected function get_product_related_intervals_segments( $segmenting_selections, $segmenting_from, $segmenting_where, $segmenting_groupby, $segmenting_dimension_name, $table_name, $intervals_query, $unique_orders_table ) {
		global $wpdb;

		$product_segmenting_table = $wpdb->prefix . 'wc_order_product_lookup';

		// LIMIT offset, rowcount needs to be updated to LIMIT offset, rowcount * max number of segments.
		$limit_parts      = explode( ',', $intervals_query['limit'] );
		$orig_rowcount    = intval( $limit_parts[1] );
		$segmenting_limit = $limit_parts[0] . ',' . $orig_rowcount * count( $this->get_all_segments() );

		// Can't get all the numbers from one query, so split it into one query for product-level numbers and one for order-level numbers (which first need to have orders uniqued).
		// Product-level numbers.
		$segments_products = $wpdb->get_results(
			"SELECT
						{$intervals_query['select_clause']} AS time_interval,
						$segmenting_groupby AS $segmenting_dimension_name
						{$segmenting_selections['product_level']}
					FROM
						$table_name
						$segmenting_from
						{$intervals_query['from_clause']}
					WHERE
						1=1
						{$intervals_query['where_time_clause']}
						{$intervals_query['where_clause']}
						$segmenting_where
					GROUP BY
						time_interval, $segmenting_groupby
					$segmenting_limit",
			ARRAY_A
		); // phpcs:ignore cache ok, DB call ok, unprepared SQL ok.

		// Order level numbers.
		// As there can be 2 same product ids (or variation ids) per one order, the orders first need to be uniqued before calculating averages, customer counts, etc.
		$segments_orders = $wpdb->get_results(
			"SELECT
					$unique_orders_table.time_interval AS time_interval,
				    $unique_orders_table.$segmenting_dimension_name AS $segmenting_dimension_name
				    {$segmenting_selections['order_level']}
				FROM
				(
					SELECT
						MAX( $table_name.date_created ) AS datetime_anchor,
						{$intervals_query['select_clause']} AS time_interval,
				        $table_name.order_id,
				        $segmenting_groupby AS $segmenting_dimension_name,
				        MAX( num_items_sold ) AS num_items_sold,
				        MAX( net_total ) as net_total,
				        MAX( returning_customer ) AS returning_customer,
						MAX( $table_name.customer_id ) as customer_id
				    FROM
				        $table_name
				        $segmenting_from
				        {$intervals_query['from_clause']}
				    WHERE
				        1=1
						{$intervals_query['where_time_clause']}
						{$intervals_query['where_clause']}
						$segmenting_where
				    GROUP BY
				        time_interval, $product_segmenting_table.order_id, $segmenting_groupby
				) AS $unique_orders_table
				GROUP BY
				    time_interval, $unique_orders_table.$segmenting_dimension_name
				$segmenting_limit",
			ARRAY_A
		); // phpcs:ignore cache ok, DB call ok, unprepared SQL ok.

		$intervals_segments = $this->merge_segment_intervals_results( $segmenting_dimension_name, $segments_products, $segments_orders );
		return $intervals_segments;
	}

	/**
	 * Calculate segments for totals query where the segmenting property is bound to order (e.g. coupon or customer type).
	 *
	 * @param string $segmenting_select SELECT part of segmenting SQL query.
	 * @param string $segmenting_from FROM part of segmenting SQL query.
	 * @param string $segmenting_where WHERE part of segmenting SQL query.
	 * @param string $segmenting_groupby GROUP BY part of segmenting SQL query.
	 * @param string $table_name Name of SQL table which is the stats table for orders.
	 * @param array  $totals_query Array of SQL clauses for intervals query.
	 *
	 * @return array
	 */
	protected function get_order_related_totals_segments( $segmenting_select, $segmenting_from, $segmenting_where, $segmenting_groupby, $table_name, $totals_query ) {
		global $wpdb;

		$totals_segments = $wpdb->get_results(
			"SELECT
						$segmenting_groupby
						$segmenting_select
					FROM
						$table_name
						$segmenting_from
						{$totals_query['from_clause']}
					WHERE
						1=1
						{$totals_query['where_time_clause']}
						{$totals_query['where_clause']}
						$segmenting_where
					GROUP BY
						$segmenting_groupby",
			ARRAY_A
		); // phpcs:ignore cache ok, DB call ok, unprepared SQL ok.

		// Reformat result.
		$totals_segments = $this->reformat_totals_segments( $totals_segments, $segmenting_groupby );
		return $totals_segments;
	}

	/**
	 * Calculate segments for intervals query where the segmenting property is bound to order (e.g. coupon or customer type).
	 *
	 * @param string $segmenting_select SELECT part of segmenting SQL query.
	 * @param string $segmenting_from FROM part of segmenting SQL query.
	 * @param string $segmenting_where WHERE part of segmenting SQL query.
	 * @param string $segmenting_groupby GROUP BY part of segmenting SQL query.
	 * @param string $table_name Name of SQL table which is the stats table for orders.
	 * @param array  $intervals_query Array of SQL clauses for intervals query.
	 *
	 * @return array
	 */
	protected function get_order_related_intervals_segments( $segmenting_select, $segmenting_from, $segmenting_where, $segmenting_groupby, $table_name, $intervals_query ) {
		global $wpdb;
		$segmenting_limit = '';
		$limit_parts      = explode( ',', $intervals_query['limit'] );
		if ( 2 === count( $limit_parts ) ) {
			$orig_rowcount    = intval( $limit_parts[1] );
			$segmenting_limit = $limit_parts[0] . ',' . $orig_rowcount * count( $this->get_all_segments() );
		}

		$intervals_segments = $wpdb->get_results(
			"SELECT
						MAX($table_name.date_created) AS datetime_anchor,
						{$intervals_query['select_clause']} AS time_interval,
						$segmenting_groupby
						$segmenting_select
					FROM
						$table_name
						$segmenting_from
						{$intervals_query['from_clause']}
					WHERE
						1=1
						{$intervals_query['where_time_clause']}
						{$intervals_query['where_clause']}
						$segmenting_where
					GROUP BY
						time_interval, $segmenting_groupby
					$segmenting_limit",
			ARRAY_A
		); // phpcs:ignore cache ok, DB call ok, unprepared SQL ok.

		// Reformat result.
		$intervals_segments = $this->reformat_intervals_segments( $intervals_segments, $segmenting_groupby );
		return $intervals_segments;
	}

	/**
	 * Return array of segments formatted for REST response.
	 *
	 * @param string $type Type of segments to return--'totals' or 'intervals'.
	 * @param array  $query_params SQL query parameter array.
	 * @param string $table_name Name of main SQL table for the data store (used as basis for JOINS).
	 *
	 * @return array
	 * @throws \Automattic\WooCommerce\Admin\API\Reports\ParameterException In case of segmenting by variations, when no parent product is specified.
	 */
	protected function get_segments( $type, $query_params, $table_name ) {
		global $wpdb;
		if ( ! isset( $this->query_args['segmentby'] ) || '' === $this->query_args['segmentby'] ) {
			return array();
		}

		$product_segmenting_table = $wpdb->prefix . 'wc_order_product_lookup';
		$unique_orders_table      = 'uniq_orders';
		$segmenting_from          = "LEFT JOIN {$wpdb->prefix}wc_order_coupon_lookup AS coupon_lookup_left_join ON ($table_name.order_id = coupon_lookup_left_join.order_id) ";
		$segmenting_where         = '';

		// Product, variation, and category are bound to product, so here product segmenting table is required,
		// while coupon and customer are bound to order, so we don't need the extra JOIN for those.
		// This also means that segment selections need to be calculated differently.
		if ( 'product' === $this->query_args['segmentby'] ) {
			// @todo How to handle shipping taxes when grouped by product?
			$product_level_columns     = $this->get_segment_selections_product_level( $product_segmenting_table );
			$order_level_columns       = $this->get_segment_selections_order_level( $unique_orders_table );
			$segmenting_selections     = array(
				'product_level' => $this->prepare_selections( $product_level_columns ),
				'order_level'   => $this->prepare_selections( $order_level_columns ),
			);
			$this->report_columns      = array_merge( $product_level_columns, $order_level_columns );
			$segmenting_from          .= "INNER JOIN $product_segmenting_table ON ($table_name.order_id = $product_segmenting_table.order_id)";
			$segmenting_groupby        = $product_segmenting_table . '.product_id';
			$segmenting_dimension_name = 'product_id';

			$segments = $this->get_product_related_segments( $type, $segmenting_selections, $segmenting_from, $segmenting_where, $segmenting_groupby, $segmenting_dimension_name, $table_name, $query_params, $unique_orders_table );
		} elseif ( 'variation' === $this->query_args['segmentby'] ) {
			if ( ! isset( $this->query_args['product_includes'] ) || count( $this->query_args['product_includes'] ) !== 1 ) {
				throw new ParameterException( 'wc_admin_reports_invalid_segmenting_variation', __( 'product_includes parameter need to specify exactly one product when segmenting by variation.', 'woocommerce' ) );
			}

			$product_level_columns     = $this->get_segment_selections_product_level( $product_segmenting_table );
			$order_level_columns       = $this->get_segment_selections_order_level( $unique_orders_table );
			$segmenting_selections     = array(
				'product_level' => $this->prepare_selections( $product_level_columns ),
				'order_level'   => $this->prepare_selections( $order_level_columns ),
			);
			$this->report_columns      = array_merge( $product_level_columns, $order_level_columns );
			$segmenting_from          .= "INNER JOIN $product_segmenting_table ON ($table_name.order_id = $product_segmenting_table.order_id)";
			$segmenting_where          = "AND $product_segmenting_table.product_id = {$this->query_args['product_includes'][0]}";
			$segmenting_groupby        = $product_segmenting_table . '.variation_id';
			$segmenting_dimension_name = 'variation_id';

			$segments = $this->get_product_related_segments( $type, $segmenting_selections, $segmenting_from, $segmenting_where, $segmenting_groupby, $segmenting_dimension_name, $table_name, $query_params, $unique_orders_table );
		} elseif ( 'category' === $this->query_args['segmentby'] ) {
			$product_level_columns     = $this->get_segment_selections_product_level( $product_segmenting_table );
			$order_level_columns       = $this->get_segment_selections_order_level( $unique_orders_table );
			$segmenting_selections     = array(
				'product_level' => $this->prepare_selections( $product_level_columns ),
				'order_level'   => $this->prepare_selections( $order_level_columns ),
			);
			$this->report_columns      = array_merge( $product_level_columns, $order_level_columns );
			$segmenting_from          .= "
			INNER JOIN $product_segmenting_table ON ($table_name.order_id = $product_segmenting_table.order_id)
			LEFT JOIN {$wpdb->term_relationships} ON {$product_segmenting_table}.product_id = {$wpdb->term_relationships}.object_id
			JOIN {$wpdb->term_taxonomy} ON {$wpdb->term_taxonomy}.term_taxonomy_id = {$wpdb->term_relationships}.term_taxonomy_id
			LEFT JOIN {$wpdb->wc_category_lookup} ON {$wpdb->term_taxonomy}.term_id = {$wpdb->wc_category_lookup}.category_id
			";
			$segmenting_where          = " AND {$wpdb->wc_category_lookup}.category_tree_id IS NOT NULL";
			$segmenting_groupby        = "{$wpdb->wc_category_lookup}.category_tree_id";
			$segmenting_dimension_name = 'category_id';

			$segments = $this->get_product_related_segments( $type, $segmenting_selections, $segmenting_from, $segmenting_where, $segmenting_groupby, $segmenting_dimension_name, $table_name, $query_params, $unique_orders_table );
		} elseif ( 'coupon' === $this->query_args['segmentby'] ) {
			// As there can be 2 or more coupons applied per one order, coupon amount needs to be split.
			$coupon_override       = array(
				'coupons' => 'SUM(coupon_lookup.discount_amount) AS coupons',
			);
			$coupon_level_columns  = $this->segment_selections_orders( $table_name, $coupon_override );
			$segmenting_selections = $this->prepare_selections( $coupon_level_columns );
			$this->report_columns  = $coupon_level_columns;
			$segmenting_from      .= "
			INNER JOIN {$wpdb->prefix}wc_order_coupon_lookup AS coupon_lookup ON ($table_name.order_id = coupon_lookup.order_id)
            ";
			$segmenting_groupby    = 'coupon_lookup.coupon_id';

			$segments = $this->get_order_related_segments( $type, $segmenting_selections, $segmenting_from, $segmenting_where, $segmenting_groupby, $table_name, $query_params );
		} elseif ( 'customer_type' === $this->query_args['segmentby'] ) {
			$customer_level_columns = $this->segment_selections_orders( $table_name );
			$segmenting_selections  = $this->prepare_selections( $customer_level_columns );
			$this->report_columns   = $customer_level_columns;
			$segmenting_groupby     = "$table_name.returning_customer";

			$segments = $this->get_order_related_segments( $type, $segmenting_selections, $segmenting_from, $segmenting_where, $segmenting_groupby, $table_name, $query_params );
		}

		return $segments;
	}
}
woocommerce-admin/src/API/Reports/Orders/Stats/DataStore.php000064400000061426151335517650017766 0ustar00<?php
/**
 * API\Reports\Orders\Stats\DataStore class file.
 */

namespace Automattic\WooCommerce\Admin\API\Reports\Orders\Stats;

defined( 'ABSPATH' ) || exit;

use \Automattic\WooCommerce\Admin\API\Reports\DataStore as ReportsDataStore;
use \Automattic\WooCommerce\Admin\API\Reports\DataStoreInterface;
use \Automattic\WooCommerce\Admin\API\Reports\TimeInterval;
use \Automattic\WooCommerce\Admin\API\Reports\SqlQuery;
use \Automattic\WooCommerce\Admin\API\Reports\Cache as ReportsCache;
use \Automattic\WooCommerce\Admin\API\Reports\Customers\DataStore as CustomersDataStore;

/**
 * API\Reports\Orders\Stats\DataStore.
 */
class DataStore extends ReportsDataStore implements DataStoreInterface {

	/**
	 * Table used to get the data.
	 *
	 * @var string
	 */
	protected static $table_name = 'wc_order_stats';

	/**
	 * Cron event name.
	 */
	const CRON_EVENT = 'wc_order_stats_update';

	/**
	 * Cache identifier.
	 *
	 * @var string
	 */
	protected $cache_key = 'orders_stats';

	/**
	 * Type for each column to cast values correctly later.
	 *
	 * @var array
	 */
	protected $column_types = array(
		'orders_count'        => 'intval',
		'num_items_sold'      => 'intval',
		'gross_sales'         => 'floatval',
		'total_sales'         => 'floatval',
		'coupons'             => 'floatval',
		'coupons_count'       => 'intval',
		'refunds'             => 'floatval',
		'taxes'               => 'floatval',
		'shipping'            => 'floatval',
		'net_revenue'         => 'floatval',
		'avg_items_per_order' => 'floatval',
		'avg_order_value'     => 'floatval',
		'total_customers'     => 'intval',
		'products'            => 'intval',
		'segment_id'          => 'intval',
	);

	/**
	 * Data store context used to pass to filters.
	 *
	 * @var string
	 */
	protected $context = 'orders_stats';

	/**
	 * Assign report columns once full table name has been assigned.
	 */
	protected function assign_report_columns() {
		$table_name = self::get_db_table_name();
		// Avoid ambigious columns in SQL query.
		$refunds     = "ABS( SUM( CASE WHEN {$table_name}.net_total < 0 THEN {$table_name}.net_total ELSE 0 END ) )";
		$gross_sales =
			"( SUM({$table_name}.total_sales)" .
			' + COALESCE( SUM(discount_amount), 0 )' . // SUM() all nulls gives null.
			" - SUM({$table_name}.tax_total)" .
			" - SUM({$table_name}.shipping_total)" .
			" + {$refunds}" .
			' ) as gross_sales';

		$this->report_columns = array(
			'orders_count'        => "SUM( CASE WHEN {$table_name}.parent_id = 0 THEN 1 ELSE 0 END ) as orders_count",
			'num_items_sold'      => "SUM({$table_name}.num_items_sold) as num_items_sold",
			'gross_sales'         => $gross_sales,
			'total_sales'         => "SUM({$table_name}.total_sales) AS total_sales",
			'coupons'             => 'COALESCE( SUM(discount_amount), 0 ) AS coupons', // SUM() all nulls gives null.
			'coupons_count'       => 'COALESCE( coupons_count, 0 ) as coupons_count',
			'refunds'             => "{$refunds} AS refunds",
			'taxes'               => "SUM({$table_name}.tax_total) AS taxes",
			'shipping'            => "SUM({$table_name}.shipping_total) AS shipping",
			'net_revenue'         => "SUM({$table_name}.net_total) AS net_revenue",
			'avg_items_per_order' => "SUM( {$table_name}.num_items_sold ) / SUM( CASE WHEN {$table_name}.parent_id = 0 THEN 1 ELSE 0 END ) AS avg_items_per_order",
			'avg_order_value'     => "SUM( {$table_name}.net_total ) / SUM( CASE WHEN {$table_name}.parent_id = 0 THEN 1 ELSE 0 END ) AS avg_order_value",
			'total_customers'     => "COUNT( DISTINCT( {$table_name}.customer_id ) ) as total_customers",
		);
	}

	/**
	 * Set up all the hooks for maintaining and populating table data.
	 */
	public static function init() {
		add_action( 'delete_post', array( __CLASS__, 'delete_order' ) );
	}

	/**
	 * Updates the totals and intervals database queries with parameters used for Orders report: categories, coupons and order status.
	 *
	 * @param array $query_args      Query arguments supplied by the user.
	 */
	protected function orders_stats_sql_filter( $query_args ) {
		// @todo Performance of all of this?
		global $wpdb;

		$from_clause        = '';
		$orders_stats_table = self::get_db_table_name();
		$product_lookup     = $wpdb->prefix . 'wc_order_product_lookup';
		$coupon_lookup      = $wpdb->prefix . 'wc_order_coupon_lookup';
		$tax_rate_lookup    = $wpdb->prefix . 'wc_order_tax_lookup';
		$operator           = $this->get_match_operator( $query_args );

		$where_filters = array();

		// Products filters.
		$where_filters[] = $this->get_object_where_filter(
			$orders_stats_table,
			'order_id',
			$product_lookup,
			'product_id',
			'IN',
			$this->get_included_products( $query_args )
		);
		$where_filters[] = $this->get_object_where_filter(
			$orders_stats_table,
			'order_id',
			$product_lookup,
			'product_id',
			'NOT IN',
			$this->get_excluded_products( $query_args )
		);

		// Variations filters.
		$where_filters[] = $this->get_object_where_filter(
			$orders_stats_table,
			'order_id',
			$product_lookup,
			'variation_id',
			'IN',
			$this->get_included_variations( $query_args )
		);
		$where_filters[] = $this->get_object_where_filter(
			$orders_stats_table,
			'order_id',
			$product_lookup,
			'variation_id',
			'NOT IN',
			$this->get_excluded_variations( $query_args )
		);

		// Coupons filters.
		$where_filters[] = $this->get_object_where_filter(
			$orders_stats_table,
			'order_id',
			$coupon_lookup,
			'coupon_id',
			'IN',
			$this->get_included_coupons( $query_args )
		);
		$where_filters[] = $this->get_object_where_filter(
			$orders_stats_table,
			'order_id',
			$coupon_lookup,
			'coupon_id',
			'NOT IN',
			$this->get_excluded_coupons( $query_args )
		);

		// Tax rate filters.
		$where_filters[] = $this->get_object_where_filter(
			$orders_stats_table,
			'order_id',
			$tax_rate_lookup,
			'tax_rate_id',
			'IN',
			implode( ',', $query_args['tax_rate_includes'] )
		);
		$where_filters[] = $this->get_object_where_filter(
			$orders_stats_table,
			'order_id',
			$tax_rate_lookup,
			'tax_rate_id',
			'NOT IN',
			implode( ',', $query_args['tax_rate_excludes'] )
		);

		// Product attribute filters.
		$attribute_subqueries = $this->get_attribute_subqueries( $query_args, $orders_stats_table );
		if ( $attribute_subqueries['join'] && $attribute_subqueries['where'] ) {
			// Build a subquery for getting order IDs by product attribute(s).
			// Done here since our use case is a little more complicated than get_object_where_filter() can handle.
			$attribute_subquery = new SqlQuery();
			$attribute_subquery->add_sql_clause( 'select', "{$orders_stats_table}.order_id" );
			$attribute_subquery->add_sql_clause( 'from', $orders_stats_table );

			// JOIN on product lookup.
			$attribute_subquery->add_sql_clause( 'join', "JOIN {$product_lookup} ON {$orders_stats_table}.order_id = {$product_lookup}.order_id" );

			// Add JOINs for matching attributes.
			foreach ( $attribute_subqueries['join'] as $attribute_join ) {
				$attribute_subquery->add_sql_clause( 'join', $attribute_join );
			}
			// Add WHEREs for matching attributes.
			$attribute_subquery->add_sql_clause( 'where', 'AND (' . implode( " {$operator} ", $attribute_subqueries['where'] ) . ')' );

			// Generate subquery statement and add to our where filters.
			$where_filters[] = "{$orders_stats_table}.order_id IN (" . $attribute_subquery->get_query_statement() . ')';
		}

		$where_filters[] = $this->get_customer_subquery( $query_args );
		$refund_subquery = $this->get_refund_subquery( $query_args );
		$from_clause    .= $refund_subquery['from_clause'];
		if ( $refund_subquery['where_clause'] ) {
			$where_filters[] = $refund_subquery['where_clause'];
		}

		$where_filters   = array_filter( $where_filters );
		$where_subclause = implode( " $operator ", $where_filters );

		// Append status filter after to avoid matching ANY on default statuses.
		$order_status_filter = $this->get_status_subquery( $query_args, $operator );
		if ( $order_status_filter ) {
			if ( empty( $query_args['status_is'] ) && empty( $query_args['status_is_not'] ) ) {
				$operator = 'AND';
			}
			$where_subclause = implode( " $operator ", array_filter( array( $where_subclause, $order_status_filter ) ) );
		}

		// To avoid requesting the subqueries twice, the result is applied to all queries passed to the method.
		if ( $where_subclause ) {
			$this->total_query->add_sql_clause( 'where', "AND ( $where_subclause )" );
			$this->total_query->add_sql_clause( 'join', $from_clause );
			$this->interval_query->add_sql_clause( 'where', "AND ( $where_subclause )" );
			$this->interval_query->add_sql_clause( 'join', $from_clause );
		}
	}

	/**
	 * Returns the report data based on parameters supplied by the user.
	 *
	 * @param array $query_args  Query parameters.
	 * @return stdClass|WP_Error Data.
	 */
	public function get_data( $query_args ) {
		global $wpdb;

		$table_name = self::get_db_table_name();

		// These defaults are only applied when not using REST API, as the API has its own defaults that overwrite these for most values (except before, after, etc).
		$defaults   = array(
			'per_page'          => get_option( 'posts_per_page' ),
			'page'              => 1,
			'order'             => 'DESC',
			'orderby'           => 'date',
			'before'            => TimeInterval::default_before(),
			'after'             => TimeInterval::default_after(),
			'interval'          => 'week',
			'fields'            => '*',
			'segmentby'         => '',

			'match'             => 'all',
			'status_is'         => array(),
			'status_is_not'     => array(),
			'product_includes'  => array(),
			'product_excludes'  => array(),
			'coupon_includes'   => array(),
			'coupon_excludes'   => array(),
			'tax_rate_includes' => array(),
			'tax_rate_excludes' => array(),
			'customer_type'     => '',
			'category_includes' => array(),
		);
		$query_args = wp_parse_args( $query_args, $defaults );
		$this->normalize_timezones( $query_args, $defaults );

		/*
		 * We need to get the cache key here because
		 * parent::update_intervals_sql_params() modifies $query_args.
		 */
		$cache_key = $this->get_cache_key( $query_args );
		$data      = $this->get_cached_data( $cache_key );

		if ( false === $data ) {
			$this->initialize_queries();

			$data = (object) array(
				'totals'    => (object) array(),
				'intervals' => (object) array(),
				'total'     => 0,
				'pages'     => 0,
				'page_no'   => 0,
			);

			$selections = $this->selected_columns( $query_args );
			$this->add_time_period_sql_params( $query_args, $table_name );
			$this->add_intervals_sql_params( $query_args, $table_name );
			$this->add_order_by_sql_params( $query_args );
			$where_time  = $this->get_sql_clause( 'where_time' );
			$params      = $this->get_limit_sql_params( $query_args );
			$coupon_join = "LEFT JOIN (
						SELECT
							order_id,
							SUM(discount_amount) AS discount_amount,
							COUNT(DISTINCT coupon_id) AS coupons_count
						FROM
							{$wpdb->prefix}wc_order_coupon_lookup
						GROUP BY
							order_id
						) order_coupon_lookup
						ON order_coupon_lookup.order_id = {$wpdb->prefix}wc_order_stats.order_id";

			// Additional filtering for Orders report.
			$this->orders_stats_sql_filter( $query_args );
			$this->total_query->add_sql_clause( 'select', $selections );
			$this->total_query->add_sql_clause( 'left_join', $coupon_join );
			$this->total_query->add_sql_clause( 'where_time', $where_time );
			$totals = $wpdb->get_results(
				$this->total_query->get_query_statement(),
				ARRAY_A
			); // phpcs:ignore cache ok, DB call ok, unprepared SQL ok.
			if ( null === $totals ) {
				return new \WP_Error( 'woocommerce_analytics_revenue_result_failed', __( 'Sorry, fetching revenue data failed.', 'woocommerce' ) );
			}

			// @todo Remove these assignements when refactoring segmenter classes to use query objects.
			$totals_query    = array(
				'from_clause'       => $this->total_query->get_sql_clause( 'join' ),
				'where_time_clause' => $where_time,
				'where_clause'      => $this->total_query->get_sql_clause( 'where' ),
			);
			$intervals_query = array(
				'select_clause'     => $this->get_sql_clause( 'select' ),
				'from_clause'       => $this->interval_query->get_sql_clause( 'join' ),
				'where_time_clause' => $where_time,
				'where_clause'      => $this->interval_query->get_sql_clause( 'where' ),
				'limit'             => $this->get_sql_clause( 'limit' ),
			);

			$unique_products            = $this->get_unique_product_count( $totals_query['from_clause'], $totals_query['where_time_clause'], $totals_query['where_clause'] );
			$totals[0]['products']      = $unique_products;
			$segmenter                  = new Segmenter( $query_args, $this->report_columns );
			$unique_coupons             = $this->get_unique_coupon_count( $totals_query['from_clause'], $totals_query['where_time_clause'], $totals_query['where_clause'] );
			$totals[0]['coupons_count'] = $unique_coupons;
			$totals[0]['segments']      = $segmenter->get_totals_segments( $totals_query, $table_name );
			$totals                     = (object) $this->cast_numbers( $totals[0] );

			$this->interval_query->add_sql_clause( 'select', $this->get_sql_clause( 'select' ) . ' AS time_interval' );
			$this->interval_query->add_sql_clause( 'left_join', $coupon_join );
			$this->interval_query->add_sql_clause( 'where_time', $where_time );
			$db_intervals = $wpdb->get_col(
				$this->interval_query->get_query_statement()
			); // phpcs:ignore cache ok, DB call ok, , unprepared SQL ok.

			$db_interval_count       = count( $db_intervals );
			$expected_interval_count = TimeInterval::intervals_between( $query_args['after'], $query_args['before'], $query_args['interval'] );
			$total_pages             = (int) ceil( $expected_interval_count / $params['per_page'] );

			if ( $query_args['page'] < 1 || $query_args['page'] > $total_pages ) {
				return $data;
			}

			$this->update_intervals_sql_params( $query_args, $db_interval_count, $expected_interval_count, $table_name );
			$this->interval_query->add_sql_clause( 'order_by', $this->get_sql_clause( 'order_by' ) );
			$this->interval_query->add_sql_clause( 'limit', $this->get_sql_clause( 'limit' ) );
			$this->interval_query->add_sql_clause( 'select', ", MAX(${table_name}.date_created) AS datetime_anchor" );
			if ( '' !== $selections ) {
				$this->interval_query->add_sql_clause( 'select', ', ' . $selections );
			}
			$intervals = $wpdb->get_results(
				$this->interval_query->get_query_statement(),
				ARRAY_A
			); // phpcs:ignore cache ok, DB call ok, unprepared SQL ok.

			if ( null === $intervals ) {
				return new \WP_Error( 'woocommerce_analytics_revenue_result_failed', __( 'Sorry, fetching revenue data failed.', 'woocommerce' ) );
			}

			if ( isset( $intervals[0] ) ) {
				$unique_coupons                = $this->get_unique_coupon_count( $intervals_query['from_clause'], $intervals_query['where_time_clause'], $intervals_query['where_clause'], true );
				$intervals[0]['coupons_count'] = $unique_coupons;
			}

			$data = (object) array(
				'totals'    => $totals,
				'intervals' => $intervals,
				'total'     => $expected_interval_count,
				'pages'     => $total_pages,
				'page_no'   => (int) $query_args['page'],
			);

			if ( TimeInterval::intervals_missing( $expected_interval_count, $db_interval_count, $params['per_page'], $query_args['page'], $query_args['order'], $query_args['orderby'], count( $intervals ) ) ) {
				$this->fill_in_missing_intervals( $db_intervals, $query_args['adj_after'], $query_args['adj_before'], $query_args['interval'], $data );
				$this->sort_intervals( $data, $query_args['orderby'], $query_args['order'] );
				$this->remove_extra_records( $data, $query_args['page'], $params['per_page'], $db_interval_count, $expected_interval_count, $query_args['orderby'], $query_args['order'] );
			} else {
				$this->update_interval_boundary_dates( $query_args['after'], $query_args['before'], $query_args['interval'], $data->intervals );
			}
			$segmenter->add_intervals_segments( $data, $intervals_query, $table_name );
			$this->create_interval_subtotals( $data->intervals );

			$this->set_cached_data( $cache_key, $data );
		}

		return $data;
	}

	/**
	 * Get unique products based on user time query
	 *
	 * @param string $from_clause       From clause with date query.
	 * @param string $where_time_clause Where clause with date query.
	 * @param string $where_clause      Where clause with date query.
	 * @return integer Unique product count.
	 */
	public function get_unique_product_count( $from_clause, $where_time_clause, $where_clause ) {
		global $wpdb;

		$table_name = self::get_db_table_name();
		return $wpdb->get_var(
			"SELECT
					COUNT( DISTINCT {$wpdb->prefix}wc_order_product_lookup.product_id )
				FROM
					{$wpdb->prefix}wc_order_product_lookup JOIN {$table_name} ON {$wpdb->prefix}wc_order_product_lookup.order_id = {$table_name}.order_id
					{$from_clause}
				WHERE
					1=1
					{$where_time_clause}
					{$where_clause}"
		); // phpcs:ignore cache ok, DB call ok, unprepared SQL ok.
	}

	/**
	 * Get unique coupons based on user time query
	 *
	 * @param string $from_clause       From clause with date query.
	 * @param string $where_time_clause Where clause with date query.
	 * @param string $where_clause      Where clause with date query.
	 * @return integer Unique product count.
	 */
	public function get_unique_coupon_count( $from_clause, $where_time_clause, $where_clause ) {
		global $wpdb;

		$table_name = self::get_db_table_name();
		return $wpdb->get_var(
			"SELECT
					COUNT(DISTINCT coupon_id)
				FROM
					{$wpdb->prefix}wc_order_coupon_lookup JOIN {$table_name} ON {$wpdb->prefix}wc_order_coupon_lookup.order_id = {$table_name}.order_id
					{$from_clause}
				WHERE
					1=1
					{$where_time_clause}
					{$where_clause}"
		); // phpcs:ignore cache ok, DB call ok, unprepared SQL ok.
	}

	/**
	 * Add order information to the lookup table when orders are created or modified.
	 *
	 * @param int $post_id Post ID.
	 * @return int|bool Returns -1 if order won't be processed, or a boolean indicating processing success.
	 */
	public static function sync_order( $post_id ) {
		if ( 'shop_order' !== get_post_type( $post_id ) && 'shop_order_refund' !== get_post_type( $post_id ) ) {
			return -1;
		}

		$order = wc_get_order( $post_id );
		if ( ! $order ) {
			return -1;
		}

		return self::update( $order );
	}

	/**
	 * Update the database with stats data.
	 *
	 * @param WC_Order|WC_Order_Refund $order Order or refund to update row for.
	 * @return int|bool Returns -1 if order won't be processed, or a boolean indicating processing success.
	 */
	public static function update( $order ) {
		global $wpdb;
		$table_name = self::get_db_table_name();

		if ( ! $order->get_id() || ! $order->get_date_created() ) {
			return -1;
		}

		/**
		 * Filters order stats data.
		 *
		 * @param array $data Data written to order stats lookup table.
		 * @param WC_Order $order  Order object.
		 */
		$data = apply_filters(
			'woocommerce_analytics_update_order_stats_data',
			array(
				'order_id'           => $order->get_id(),
				'parent_id'          => $order->get_parent_id(),
				'date_created'       => $order->get_date_created()->date( 'Y-m-d H:i:s' ),
				'date_created_gmt'   => gmdate( 'Y-m-d H:i:s', $order->get_date_created()->getTimestamp() ),
				'num_items_sold'     => self::get_num_items_sold( $order ),
				'total_sales'        => $order->get_total(),
				'tax_total'          => $order->get_total_tax(),
				'shipping_total'     => $order->get_shipping_total(),
				'net_total'          => self::get_net_total( $order ),
				'status'             => self::normalize_order_status( $order->get_status() ),
				'customer_id'        => $order->get_report_customer_id(),
				'returning_customer' => $order->is_returning_customer(),
			),
			$order
		);

		$format = array(
			'%d',
			'%d',
			'%s',
			'%s',
			'%d',
			'%f',
			'%f',
			'%f',
			'%f',
			'%s',
			'%d',
			'%d',
		);

		if ( 'shop_order_refund' === $order->get_type() ) {
			$parent_order = wc_get_order( $order->get_parent_id() );
			if ( $parent_order ) {
				$data['parent_id'] = $parent_order->get_id();
				$data['status']    = self::normalize_order_status( $parent_order->get_status() );
			}
		} else {
			$data['returning_customer'] = self::is_returning_customer( $order );
		}

		// Update or add the information to the DB.
		$result = $wpdb->replace( $table_name, $data, $format );

		/**
		 * Fires when order's stats reports are updated.
		 *
		 * @param int $order_id Order ID.
		 */
		do_action( 'woocommerce_analytics_update_order_stats', $order->get_id() );

		// Check the rows affected for success. Using REPLACE can affect 2 rows if the row already exists.
		return ( 1 === $result || 2 === $result );
	}

	/**
	 * Deletes the order stats when an order is deleted.
	 *
	 * @param int $post_id Post ID.
	 */
	public static function delete_order( $post_id ) {
		global $wpdb;
		$order_id = (int) $post_id;

		if ( 'shop_order' !== get_post_type( $order_id ) && 'shop_order_refund' !== get_post_type( $order_id ) ) {
			return;
		}

		// Retrieve customer details before the order is deleted.
		$order       = wc_get_order( $order_id );
		$customer_id = absint( CustomersDataStore::get_existing_customer_id_from_order( $order ) );

		// Delete the order.
		$wpdb->delete( self::get_db_table_name(), array( 'order_id' => $order_id ) );
		/**
		 * Fires when orders stats are deleted.
		 *
		 * @param int $order_id Order ID.
		 * @param int $customer_id Customer ID.
		 */
		do_action( 'woocommerce_analytics_delete_order_stats', $order_id, $customer_id );

		ReportsCache::invalidate();
	}


	/**
	 * Calculation methods.
	 */

	/**
	 * Get number of items sold among all orders.
	 *
	 * @param array $order WC_Order object.
	 * @return int
	 */
	protected static function get_num_items_sold( $order ) {
		$num_items = 0;

		$line_items = $order->get_items( 'line_item' );
		foreach ( $line_items as $line_item ) {
			$num_items += $line_item->get_quantity();
		}

		return $num_items;
	}

	/**
	 * Get the net amount from an order without shipping, tax, or refunds.
	 *
	 * @param array $order WC_Order object.
	 * @return float
	 */
	protected static function get_net_total( $order ) {
		$net_total = floatval( $order->get_total() ) - floatval( $order->get_total_tax() ) - floatval( $order->get_shipping_total() );
		return (float) $net_total;
	}

	/**
	 * Check to see if an order's customer has made previous orders or not
	 *
	 * @param array $order WC_Order object.
	 * @return bool
	 */
	public static function is_returning_customer( $order ) {
		$customer_id = \Automattic\WooCommerce\Admin\API\Reports\Customers\DataStore::get_existing_customer_id_from_order( $order );

		if ( ! $customer_id ) {
			return false;
		}

		$oldest_orders = \Automattic\WooCommerce\Admin\API\Reports\Customers\DataStore::get_oldest_orders( $customer_id );

		if ( empty( $oldest_orders ) ) {
			return false;
		}

		$first_order       = $oldest_orders[0];
		$second_order      = isset( $oldest_orders[1] ) ? $oldest_orders[1] : false;
		$excluded_statuses = self::get_excluded_report_order_statuses();

		// Order is older than previous first order.
		if ( $order->get_date_created() < wc_string_to_datetime( $first_order->date_created ) &&
			! in_array( $order->get_status(), $excluded_statuses, true )
		) {
			self::set_customer_first_order( $customer_id, $order->get_id() );
			return false;
		}

		// The current order is the oldest known order.
		$is_first_order = (int) $order->get_id() === (int) $first_order->order_id;
		// Order date has changed and next oldest is now the first order.
		$date_change = $second_order &&
			$order->get_date_created() > wc_string_to_datetime( $first_order->date_created ) &&
			wc_string_to_datetime( $second_order->date_created ) < $order->get_date_created();
		// Status has changed to an excluded status and next oldest order is now the first order.
		$status_change = $second_order &&
			in_array( $order->get_status(), $excluded_statuses, true );
		if ( $is_first_order && ( $date_change || $status_change ) ) {
			self::set_customer_first_order( $customer_id, $second_order->order_id );
			return true;
		}

		return (int) $order->get_id() !== (int) $first_order->order_id;
	}

	/**
	 * Set a customer's first order and all others to returning.
	 *
	 * @param int $customer_id Customer ID.
	 * @param int $order_id Order ID.
	 */
	protected static function set_customer_first_order( $customer_id, $order_id ) {
		global $wpdb;
		$orders_stats_table = self::get_db_table_name();

		$wpdb->query(
			$wpdb->prepare(
				"UPDATE ${orders_stats_table} SET returning_customer = CASE WHEN order_id = %d THEN false ELSE true END WHERE customer_id = %d",
				$order_id,
				$customer_id
			)
		);
	}

	/**
	 * Initialize query objects.
	 */
	protected function initialize_queries() {
		$this->clear_all_clauses();
		unset( $this->subquery );
		$this->total_query = new SqlQuery( $this->context . '_total' );
		$this->total_query->add_sql_clause( 'from', self::get_db_table_name() );

		$this->interval_query = new SqlQuery( $this->context . '_interval' );
		$this->interval_query->add_sql_clause( 'from', self::get_db_table_name() );
		$this->interval_query->add_sql_clause( 'group_by', 'time_interval' );
	}
}
woocommerce-admin/src/API/Reports/Orders/Query.php000064400000002350151335517650016076 0ustar00<?php
/**
 * Class for parameter-based Orders Reports querying
 *
 * Example usage:
 * $args = array(
 *          'before'        => '2018-07-19 00:00:00',
 *          'after'         => '2018-07-05 00:00:00',
 *          'interval'      => 'week',
 *          'products'      => array(15, 18),
 *          'coupons'       => array(138),
 *          'status_is'     => array('completed'),
 *          'status_is_not' => array('failed'),
 *          'new_customers' => false,
 *         );
 * $report = new \Automattic\WooCommerce\Admin\API\Reports\Orders\Query( $args );
 * $mydata = $report->get_data();
 */

namespace Automattic\WooCommerce\Admin\API\Reports\Orders;

defined( 'ABSPATH' ) || exit;

use \Automattic\WooCommerce\Admin\API\Reports\Query as ReportsQuery;

/**
 * API\Reports\Orders\Query
 */
class Query extends ReportsQuery {

	/**
	 * Get order data based on the current query vars.
	 *
	 * @return array
	 */
	public function get_data() {
		$args       = apply_filters( 'woocommerce_analytics_orders_query_args', $this->get_query_vars() );
		$data_store = \WC_Data_Store::load( 'report-orders' );
		$results    = $data_store->get_data( $args );
		return apply_filters( 'woocommerce_analytics_orders_select_query', $results, $args );
	}
}
woocommerce-admin/src/API/Reports/Orders/DataStore.php000064400000044576151335517650016677 0ustar00<?php
/**
 * API\Reports\Orders\DataStore class file.
 */

namespace Automattic\WooCommerce\Admin\API\Reports\Orders;

defined( 'ABSPATH' ) || exit;

use \Automattic\WooCommerce\Admin\API\Reports\DataStore as ReportsDataStore;
use \Automattic\WooCommerce\Admin\API\Reports\DataStoreInterface;
use \Automattic\WooCommerce\Admin\API\Reports\SqlQuery;
use \Automattic\WooCommerce\Admin\API\Reports\Cache;
use \Automattic\WooCommerce\Admin\API\Reports\TimeInterval;


/**
 * API\Reports\Orders\DataStore.
 */
class DataStore extends ReportsDataStore implements DataStoreInterface {

	/**
	 * Table used to get the data.
	 *
	 * @var string
	 */
	protected static $table_name = 'wc_order_stats';

	/**
	 * Cache identifier.
	 *
	 * @var string
	 */
	protected $cache_key = 'orders';

	/**
	 * Mapping columns to data type to return correct response types.
	 *
	 * @var array
	 */
	protected $column_types = array(
		'order_id'         => 'intval',
		'parent_id'        => 'intval',
		'date_created'     => 'strval',
		'date_created_gmt' => 'strval',
		'status'           => 'strval',
		'customer_id'      => 'intval',
		'net_total'        => 'floatval',
		'total_sales'      => 'floatval',
		'num_items_sold'   => 'intval',
		'customer_type'    => 'strval',
	);

	/**
	 * Data store context used to pass to filters.
	 *
	 * @var string
	 */
	protected $context = 'orders';

	/**
	 * Assign report columns once full table name has been assigned.
	 */
	protected function assign_report_columns() {
		$table_name = self::get_db_table_name();
		// Avoid ambigious columns in SQL query.
		$this->report_columns = array(
			'order_id'         => "DISTINCT {$table_name}.order_id",
			'parent_id'        => "{$table_name}.parent_id",
			'date_created'     => "{$table_name}.date_created",
			'date_created_gmt' => "{$table_name}.date_created_gmt",
			'status'           => "REPLACE({$table_name}.status, 'wc-', '') as status",
			'customer_id'      => "{$table_name}.customer_id",
			'net_total'        => "{$table_name}.net_total",
			'total_sales'      => "{$table_name}.total_sales",
			'num_items_sold'   => "{$table_name}.num_items_sold",
			'customer_type'    => "(CASE WHEN {$table_name}.returning_customer = 0 THEN 'new' ELSE 'returning' END) as customer_type",
		);
	}

	/**
	 * Updates the database query with parameters used for orders report: coupons and products filters.
	 *
	 * @param array $query_args Query arguments supplied by the user.
	 */
	protected function add_sql_query_params( $query_args ) {
		global $wpdb;
		$order_stats_lookup_table   = self::get_db_table_name();
		$order_coupon_lookup_table  = $wpdb->prefix . 'wc_order_coupon_lookup';
		$order_product_lookup_table = $wpdb->prefix . 'wc_order_product_lookup';
		$order_tax_lookup_table     = $wpdb->prefix . 'wc_order_tax_lookup';
		$operator                   = $this->get_match_operator( $query_args );
		$where_subquery             = array();
		$have_joined_products_table = false;

		$this->add_time_period_sql_params( $query_args, $order_stats_lookup_table );
		$this->get_limit_sql_params( $query_args );
		$this->add_order_by_sql_params( $query_args );

		$status_subquery = $this->get_status_subquery( $query_args );
		if ( $status_subquery ) {
			if ( empty( $query_args['status_is'] ) && empty( $query_args['status_is_not'] ) ) {
				$this->subquery->add_sql_clause( 'where', "AND {$status_subquery}" );
			} else {
				$where_subquery[] = $status_subquery;
			}
		}

		$included_orders = $this->get_included_orders( $query_args );
		if ( $included_orders ) {
			$where_subquery[] = "{$order_stats_lookup_table}.order_id IN ({$included_orders})";
		}

		$excluded_orders = $this->get_excluded_orders( $query_args );
		if ( $excluded_orders ) {
			$where_subquery[] = "{$order_stats_lookup_table}.order_id NOT IN ({$excluded_orders})";
		}

		if ( $query_args['customer_type'] ) {
			$returning_customer = 'returning' === $query_args['customer_type'] ? 1 : 0;
			$where_subquery[]   = "{$order_stats_lookup_table}.returning_customer = ${returning_customer}";
		}

		$refund_subquery = $this->get_refund_subquery( $query_args );
		$this->subquery->add_sql_clause( 'from', $refund_subquery['from_clause'] );
		if ( $refund_subquery['where_clause'] ) {
			$where_subquery[] = $refund_subquery['where_clause'];
		}

		$included_coupons = $this->get_included_coupons( $query_args );
		$excluded_coupons = $this->get_excluded_coupons( $query_args );
		if ( $included_coupons || $excluded_coupons ) {
			$this->subquery->add_sql_clause( 'join', "LEFT JOIN {$order_coupon_lookup_table} ON {$order_stats_lookup_table}.order_id = {$order_coupon_lookup_table}.order_id" );
		}
		if ( $included_coupons ) {
			$where_subquery[] = "{$order_coupon_lookup_table}.coupon_id IN ({$included_coupons})";
		}
		if ( $excluded_coupons ) {
			$where_subquery[] = "({$order_coupon_lookup_table}.coupon_id IS NULL OR {$order_coupon_lookup_table}.coupon_id NOT IN ({$excluded_coupons}))";
		}

		$included_products = $this->get_included_products( $query_args );
		$excluded_products = $this->get_excluded_products( $query_args );
		if ( $included_products || $excluded_products ) {
			$this->subquery->add_sql_clause( 'join', "LEFT JOIN {$order_product_lookup_table} product_lookup" );
			$this->subquery->add_sql_clause( 'join', "ON {$order_stats_lookup_table}.order_id = product_lookup.order_id" );
		}
		if ( $included_products ) {
			$this->subquery->add_sql_clause( 'join', "AND product_lookup.product_id IN ({$included_products})" );
			$where_subquery[] = 'product_lookup.order_id IS NOT NULL';
		}
		if ( $excluded_products ) {
			$this->subquery->add_sql_clause( 'join', "AND product_lookup.product_id IN ({$excluded_products})" );
			$where_subquery[] = 'product_lookup.order_id IS NULL';
		}

		$included_variations = $this->get_included_variations( $query_args );
		$excluded_variations = $this->get_excluded_variations( $query_args );
		if ( $included_variations || $excluded_variations ) {
			$this->subquery->add_sql_clause( 'join', "LEFT JOIN {$order_product_lookup_table} variation_lookup" );
			$this->subquery->add_sql_clause( 'join', "ON {$order_stats_lookup_table}.order_id = variation_lookup.order_id" );
		}
		if ( $included_variations ) {
			$this->subquery->add_sql_clause( 'join', "AND variation_lookup.variation_id IN ({$included_variations})" );
			$where_subquery[] = 'variation_lookup.order_id IS NOT NULL';
		}
		if ( $excluded_variations ) {
			$this->subquery->add_sql_clause( 'join', "AND variation_lookup.variation_id IN ({$excluded_variations})" );
			$where_subquery[] = 'variation_lookup.order_id IS NULL';
		}

		$included_tax_rates = ! empty( $query_args['tax_rate_includes'] ) ? implode( ',', $query_args['tax_rate_includes'] ) : false;
		$excluded_tax_rates = ! empty( $query_args['tax_rate_excludes'] ) ? implode( ',', $query_args['tax_rate_excludes'] ) : false;
		if ( $included_tax_rates || $excluded_tax_rates ) {
			$this->subquery->add_sql_clause( 'join', "LEFT JOIN {$order_tax_lookup_table} ON {$order_stats_lookup_table}.order_id = {$order_tax_lookup_table}.order_id" );
		}
		if ( $included_tax_rates ) {
			$where_subquery[] = "{$order_tax_lookup_table}.tax_rate_id IN ({$included_tax_rates})";
		}
		if ( $excluded_tax_rates ) {
			$where_subquery[] = "{$order_tax_lookup_table}.tax_rate_id NOT IN ({$excluded_tax_rates}) OR {$order_tax_lookup_table}.tax_rate_id IS NULL";
		}

		$attribute_subqueries = $this->get_attribute_subqueries( $query_args, $order_stats_lookup_table );
		if ( $attribute_subqueries['join'] && $attribute_subqueries['where'] ) {
			$this->subquery->add_sql_clause( 'join', "JOIN {$order_product_lookup_table} ON {$order_stats_lookup_table}.order_id = {$order_product_lookup_table}.order_id" );

			// Add JOINs for matching attributes.
			foreach ( $attribute_subqueries['join'] as $attribute_join ) {
				$this->subquery->add_sql_clause( 'join', $attribute_join );
			}
			// Add WHEREs for matching attributes.
			$where_subquery = array_merge( $where_subquery, $attribute_subqueries['where'] );
		}

		if ( 0 < count( $where_subquery ) ) {
			$this->subquery->add_sql_clause( 'where', 'AND (' . implode( " {$operator} ", $where_subquery ) . ')' );
		}
	}

	/**
	 * Returns the report data based on parameters supplied by the user.
	 *
	 * @param array $query_args  Query parameters.
	 * @return stdClass|WP_Error Data.
	 */
	public function get_data( $query_args ) {
		global $wpdb;

		$table_name = self::get_db_table_name();

		// These defaults are only partially applied when used via REST API, as that has its own defaults.
		$defaults   = array(
			'per_page'          => get_option( 'posts_per_page' ),
			'page'              => 1,
			'order'             => 'DESC',
			'orderby'           => 'date_created',
			'before'            => TimeInterval::default_before(),
			'after'             => TimeInterval::default_after(),
			'fields'            => '*',
			'product_includes'  => array(),
			'product_excludes'  => array(),
			'coupon_includes'   => array(),
			'coupon_excludes'   => array(),
			'tax_rate_includes' => array(),
			'tax_rate_excludes' => array(),
			'customer_type'     => null,
			'status_is'         => array(),
			'extended_info'     => false,
			'refunds'           => null,
			'order_includes'    => array(),
			'order_excludes'    => array(),
		);
		$query_args = wp_parse_args( $query_args, $defaults );
		$this->normalize_timezones( $query_args, $defaults );

		/*
		 * We need to get the cache key here because
		 * parent::update_intervals_sql_params() modifies $query_args.
		 */
		$cache_key = $this->get_cache_key( $query_args );
		$data      = $this->get_cached_data( $cache_key );

		if ( false === $data ) {
			$this->initialize_queries();

			$data = (object) array(
				'data'    => array(),
				'total'   => 0,
				'pages'   => 0,
				'page_no' => 0,
			);

			$selections = $this->selected_columns( $query_args );
			$params     = $this->get_limit_params( $query_args );
			$this->add_sql_query_params( $query_args );
			/* phpcs:disable WordPress.DB.PreparedSQL.InterpolatedNotPrepared */
			$db_records_count = (int) $wpdb->get_var(
				"SELECT COUNT(*) FROM (
					{$this->subquery->get_query_statement()}
				) AS tt"
			);
			/* phpcs:enable */

			if ( 0 === $params['per_page'] ) {
				$total_pages = 0;
			} else {
				$total_pages = (int) ceil( $db_records_count / $params['per_page'] );
			}
			if ( $query_args['page'] < 1 || $query_args['page'] > $total_pages ) {
				$data = (object) array(
					'data'    => array(),
					'total'   => $db_records_count,
					'pages'   => 0,
					'page_no' => 0,
				);
				return $data;
			}

			$this->subquery->clear_sql_clause( 'select' );
			$this->subquery->add_sql_clause( 'select', $selections );
			$this->subquery->add_sql_clause( 'order_by', $this->get_sql_clause( 'order_by' ) );
			$this->subquery->add_sql_clause( 'limit', $this->get_sql_clause( 'limit' ) );
			/* phpcs:disable WordPress.DB.PreparedSQL.NotPrepared */
			$orders_data = $wpdb->get_results(
				$this->subquery->get_query_statement(),
				ARRAY_A
			);
			/* phpcs:enable */

			if ( null === $orders_data ) {
				return $data;
			}

			if ( $query_args['extended_info'] ) {
				$this->include_extended_info( $orders_data, $query_args );
			}

			$orders_data = array_map( array( $this, 'cast_numbers' ), $orders_data );
			$data        = (object) array(
				'data'    => $orders_data,
				'total'   => $db_records_count,
				'pages'   => $total_pages,
				'page_no' => (int) $query_args['page'],
			);

			$this->set_cached_data( $cache_key, $data );
		}
		return $data;
	}

	/**
	 * Normalizes order_by clause to match to SQL query.
	 *
	 * @param string $order_by Order by option requeste by user.
	 * @return string
	 */
	protected function normalize_order_by( $order_by ) {
		if ( 'date' === $order_by ) {
			return 'date_created';
		}

		return $order_by;
	}

	/**
	 * Enriches the order data.
	 *
	 * @param array $orders_data Orders data.
	 * @param array $query_args  Query parameters.
	 */
	protected function include_extended_info( &$orders_data, $query_args ) {
		$mapped_orders    = $this->map_array_by_key( $orders_data, 'order_id' );
		$related_orders   = $this->get_orders_with_parent_id( $mapped_orders );
		$order_ids        = array_merge( array_keys( $mapped_orders ), array_keys( $related_orders ) );
		$products         = $this->get_products_by_order_ids( $order_ids );
		$coupons          = $this->get_coupons_by_order_ids( array_keys( $mapped_orders ) );
		$customers        = $this->get_customers_by_orders( $orders_data );
		$mapped_customers = $this->map_array_by_key( $customers, 'customer_id' );

		$mapped_data = array();
		foreach ( $products as $product ) {
			if ( ! isset( $mapped_data[ $product['order_id'] ] ) ) {
				$mapped_data[ $product['order_id'] ]['products'] = array();
			}

			$is_variation = '0' !== $product['variation_id'];
			$product_data = array(
				'id'       => $is_variation ? $product['variation_id'] : $product['product_id'],
				'name'     => $product['product_name'],
				'quantity' => $product['product_quantity'],
			);

			if ( $is_variation ) {
				$variation = wc_get_product( $product_data['id'] );
				$separator = apply_filters( 'woocommerce_product_variation_title_attributes_separator', ' - ', $variation );

				if ( false === strpos( $product_data['name'], $separator ) ) {
					$attributes            = wc_get_formatted_variation( $variation, true, false );
					$product_data['name'] .= $separator . $attributes;
				}
			}

			$mapped_data[ $product['order_id'] ]['products'][] = $product_data;

			// If this product's order has another related order, it will be added to our mapped_data.
			if ( isset( $related_orders [ $product['order_id'] ] ) ) {
				$mapped_data[ $related_orders[ $product['order_id'] ]['order_id'] ] ['products'] [] = $product_data;
			}
		}

		foreach ( $coupons as $coupon ) {
			if ( ! isset( $mapped_data[ $coupon['order_id'] ] ) ) {
				$mapped_data[ $product['order_id'] ]['coupons'] = array();
			}

			$mapped_data[ $coupon['order_id'] ]['coupons'][] = array(
				'id'   => $coupon['coupon_id'],
				'code' => wc_format_coupon_code( $coupon['coupon_code'] ),
			);
		}

		foreach ( $orders_data as $key => $order_data ) {
			$defaults                             = array(
				'products' => array(),
				'coupons'  => array(),
				'customer' => array(),
			);
			$orders_data[ $key ]['extended_info'] = isset( $mapped_data[ $order_data['order_id'] ] ) ? array_merge( $defaults, $mapped_data[ $order_data['order_id'] ] ) : $defaults;
			if ( $order_data['customer_id'] && isset( $mapped_customers[ $order_data['customer_id'] ] ) ) {
				$orders_data[ $key ]['extended_info']['customer'] = $mapped_customers[ $order_data['customer_id'] ];
			}
		}
	}

	/**
	 * Returns oreders that have a parent id
	 *
	 * @param array $orders Orders array.
	 * @return array
	 */
	protected function get_orders_with_parent_id( $orders ) {
		$related_orders = array();
		foreach ( $orders as $order ) {
			if ( '0' !== $order['parent_id'] ) {
				$related_orders[ $order['parent_id'] ] = $order;
			}
		}
		return $related_orders;
	}

	/**
	 * Returns the same array index by a given key
	 *
	 * @param array  $array Array to be looped over.
	 * @param string $key Key of values used for new array.
	 * @return array
	 */
	protected function map_array_by_key( $array, $key ) {
		$mapped = array();
		foreach ( $array as $item ) {
			$mapped[ $item[ $key ] ] = $item;
		}
		return $mapped;
	}

	/**
	 * Get product IDs, names, and quantity from order IDs.
	 *
	 * @param array $order_ids Array of order IDs.
	 * @return array
	 */
	protected function get_products_by_order_ids( $order_ids ) {
		global $wpdb;
		$order_product_lookup_table = $wpdb->prefix . 'wc_order_product_lookup';
		$included_order_ids         = implode( ',', $order_ids );

		/* phpcs:disable WordPress.DB.PreparedSQL.InterpolatedNotPrepared */
		$products = $wpdb->get_results(
			"SELECT
				order_id,
				product_id,
				variation_id,
				post_title as product_name,
				product_qty as product_quantity
			FROM {$wpdb->posts}
			JOIN
				{$order_product_lookup_table}
				ON {$wpdb->posts}.ID = (
					CASE WHEN variation_id > 0
						THEN variation_id
						ELSE product_id
					END
				)
			WHERE
				order_id IN ({$included_order_ids})
			",
			ARRAY_A
		);
		/* phpcs:enable */

		return $products;
	}

	/**
	 * Get customer data from Order data.
	 *
	 * @param array $orders Array of orders data.
	 * @return array
	 */
	protected function get_customers_by_orders( $orders ) {
		global $wpdb;

		$customer_lookup_table = $wpdb->prefix . 'wc_customer_lookup';
		$customer_ids          = array();

		foreach ( $orders as $order ) {
			if ( $order['customer_id'] ) {
				$customer_ids[] = intval( $order['customer_id'] );
			}
		}

		if ( empty( $customer_ids ) ) {
			return array();
		}

		/* phpcs:disable WordPress.DB.PreparedSQL.InterpolatedNotPrepared */
		$customer_ids = implode( ',', $customer_ids );
		$customers    = $wpdb->get_results(
			"SELECT * FROM {$customer_lookup_table} WHERE customer_id IN ({$customer_ids})",
			ARRAY_A
		);
		/* phpcs:enable */

		return $customers;
	}

	/**
	 * Get coupon information from order IDs.
	 *
	 * @param array $order_ids Array of order IDs.
	 * @return array
	 */
	protected function get_coupons_by_order_ids( $order_ids ) {
		global $wpdb;
		$order_coupon_lookup_table = $wpdb->prefix . 'wc_order_coupon_lookup';
		$included_order_ids        = implode( ',', $order_ids );

		/* phpcs:disable WordPress.DB.PreparedSQL.InterpolatedNotPrepared */
		$coupons = $wpdb->get_results(
			"SELECT order_id, coupon_id, post_title as coupon_code
				FROM {$wpdb->posts}
				JOIN {$order_coupon_lookup_table} ON {$order_coupon_lookup_table}.coupon_id = {$wpdb->posts}.ID
				WHERE
					order_id IN ({$included_order_ids})
				",
			ARRAY_A
		);
		/* phpcs:enable */

		return $coupons;
	}

	/**
	 * Get all statuses that have been synced.
	 *
	 * @return array Unique order statuses.
	 */
	public static function get_all_statuses() {
		global $wpdb;

		$cache_key = 'orders-all-statuses';
		$statuses  = Cache::get( $cache_key );

		if ( false === $statuses ) {
			/* phpcs:disable WordPress.DB.PreparedSQL.InterpolatedNotPrepared */
			$table_name = self::get_db_table_name();
			$statuses   = $wpdb->get_col(
				"SELECT DISTINCT status FROM {$table_name}"
			);
			/* phpcs:enable */

			Cache::set( $cache_key, $statuses );
		}

		return $statuses;
	}

	/**
	 * Initialize query objects.
	 */
	protected function initialize_queries() {
		$this->clear_all_clauses();
		$this->subquery = new SqlQuery( $this->context . '_subquery' );
		$this->subquery->add_sql_clause( 'select', self::get_db_table_name() . '.order_id' );
		$this->subquery->add_sql_clause( 'from', self::get_db_table_name() );
	}
}
woocommerce-admin/src/API/Reports/Import/Controller.php000064400000021231151335517650017127 0ustar00<?php
/**
 * REST API Reports Import Controller
 *
 * Handles requests to /reports/import
 */

namespace Automattic\WooCommerce\Admin\API\Reports\Import;

defined( 'ABSPATH' ) || exit;

use Automattic\WooCommerce\Admin\ReportsSync;

/**
 * Reports Imports controller.
 *
 * @extends \Automattic\WooCommerce\Admin\API\Reports\Controller
 */
class Controller extends \Automattic\WooCommerce\Admin\API\Reports\Controller {
	/**
	 * Endpoint namespace.
	 *
	 * @var string
	 */
	protected $namespace = 'wc-analytics';

	/**
	 * Route base.
	 *
	 * @var string
	 */
	protected $rest_base = 'reports/import';

	/**
	 * Register routes.
	 */
	public function register_routes() {
		register_rest_route(
			$this->namespace,
			'/' . $this->rest_base,
			array(
				array(
					'methods'             => \WP_REST_Server::EDITABLE,
					'callback'            => array( $this, 'import_items' ),
					'permission_callback' => array( $this, 'import_permissions_check' ),
					'args'                => $this->get_import_collection_params(),
				),
				'schema' => array( $this, 'get_import_public_schema' ),
			)
		);
		register_rest_route(
			$this->namespace,
			'/' . $this->rest_base . '/cancel',
			array(
				array(
					'methods'             => \WP_REST_Server::EDITABLE,
					'callback'            => array( $this, 'cancel_import' ),
					'permission_callback' => array( $this, 'import_permissions_check' ),
				),
				'schema' => array( $this, 'get_import_public_schema' ),
			)
		);
		register_rest_route(
			$this->namespace,
			'/' . $this->rest_base . '/delete',
			array(
				array(
					'methods'             => \WP_REST_Server::EDITABLE,
					'callback'            => array( $this, 'delete_imported_items' ),
					'permission_callback' => array( $this, 'import_permissions_check' ),
				),
				'schema' => array( $this, 'get_import_public_schema' ),
			)
		);
		register_rest_route(
			$this->namespace,
			'/' . $this->rest_base . '/status',
			array(
				array(
					'methods'             => \WP_REST_Server::READABLE,
					'callback'            => array( $this, 'get_import_status' ),
					'permission_callback' => array( $this, 'import_permissions_check' ),
				),
				'schema' => array( $this, 'get_import_public_schema' ),
			)
		);
		register_rest_route(
			$this->namespace,
			'/' . $this->rest_base . '/totals',
			array(
				array(
					'methods'             => \WP_REST_Server::READABLE,
					'callback'            => array( $this, 'get_import_totals' ),
					'permission_callback' => array( $this, 'import_permissions_check' ),
					'args'                => $this->get_import_collection_params(),
				),
				'schema' => array( $this, 'get_import_public_schema' ),
			)
		);
	}

	/**
	 * Makes sure the current user has access to WRITE the settings APIs.
	 *
	 * @param WP_REST_Request $request Full data about the request.
	 * @return WP_Error|bool
	 */
	public function import_permissions_check( $request ) {
		if ( ! wc_rest_check_manager_permissions( 'settings', 'edit' ) ) {
			return new \WP_Error( 'woocommerce_rest_cannot_edit', __( 'Sorry, you cannot edit this resource.', 'woocommerce' ), array( 'status' => rest_authorization_required_code() ) );
		}
		return true;
	}

	/**
	 * Import data based on user request params.
	 *
	 * @param  WP_REST_Request $request Request data.
	 * @return WP_Error|WP_REST_Response
	 */
	public function import_items( $request ) {
		$query_args = $this->prepare_objects_query( $request );
		$import     = ReportsSync::regenerate_report_data( $query_args['days'], $query_args['skip_existing'] );

		if ( is_wp_error( $import ) ) {
			$result = array(
				'status'  => 'error',
				'message' => $import->get_error_message(),
			);
		} else {
			$result = array(
				'status'  => 'success',
				'message' => $import,
			);
		}

		$response = $this->prepare_item_for_response( $result, $request );
		$data     = $this->prepare_response_for_collection( $response );

		return rest_ensure_response( $data );
	}

	/**
	 * Prepare request object as query args.
	 *
	 * @param WP_REST_Request $request Request data.
	 * @return array
	 */
	protected function prepare_objects_query( $request ) {
		$args                  = array();
		$args['skip_existing'] = $request['skip_existing'];
		$args['days']          = $request['days'];

		return $args;
	}

	/**
	 * Prepare the data object for response.
	 *
	 * @param object          $item Data object.
	 * @param WP_REST_Request $request Request object.
	 * @return WP_REST_Response $response Response data.
	 */
	public function prepare_item_for_response( $item, $request ) {
		$data     = $this->add_additional_fields_to_object( $item, $request );
		$data     = $this->filter_response_by_context( $data, 'view' );
		$response = rest_ensure_response( $data );

		/**
		 * Filter the list returned from the API.
		 *
		 * @param WP_REST_Response $response The response object.
		 * @param array            $item     The original item.
		 * @param WP_REST_Request  $request  Request used to generate the response.
		 */
		return apply_filters( 'woocommerce_rest_prepare_reports_import', $response, $item, $request );
	}

	/**
	 * Get the query params for collections.
	 *
	 * @return array
	 */
	public function get_import_collection_params() {
		$params                  = array();
		$params['days']          = array(
			'description'       => __( 'Number of days to import.', 'woocommerce' ),
			'type'              => 'integer',
			'sanitize_callback' => 'absint',
			'validate_callback' => 'rest_validate_request_arg',
			'minimum'           => 0,
		);
		$params['skip_existing'] = array(
			'description'       => __( 'Skip importing existing order data.', 'woocommerce' ),
			'type'              => 'boolean',
			'default'           => false,
			'sanitize_callback' => 'wc_string_to_bool',
			'validate_callback' => 'rest_validate_request_arg',
		);
		return $params;
	}

	/**
	 * Get the Report's schema, conforming to JSON Schema.
	 *
	 * @return array
	 */
	public function get_import_public_schema() {
		$schema = array(
			'$schema'    => 'http://json-schema.org/draft-04/schema#',
			'title'      => 'report_import',
			'type'       => 'object',
			'properties' => array(
				'status'  => array(
					'description' => __( 'Regeneration status.', 'woocommerce' ),
					'type'        => 'string',
					'context'     => array( 'view', 'edit' ),
					'readonly'    => true,
				),
				'message' => array(
					'description' => __( 'Regenerate data message.', 'woocommerce' ),
					'type'        => 'string',
					'context'     => array( 'view', 'edit' ),
					'readonly'    => true,
				),
			),
		);

		return $this->add_additional_fields_schema( $schema );
	}

	/**
	 * Cancel all queued import actions.
	 *
	 * @param  WP_REST_Request $request Request data.
	 * @return WP_Error|WP_REST_Response
	 */
	public function cancel_import( $request ) {
		ReportsSync::clear_queued_actions();

		$result = array(
			'status'  => 'success',
			'message' => __( 'All pending and in-progress import actions have been cancelled.', 'woocommerce' ),
		);

		$response = $this->prepare_item_for_response( $result, $request );
		$data     = $this->prepare_response_for_collection( $response );

		return rest_ensure_response( $data );
	}

	/**
	 * Delete all imported items.
	 *
	 * @param  WP_REST_Request $request Request data.
	 * @return WP_Error|WP_REST_Response
	 */
	public function delete_imported_items( $request ) {
		$delete = ReportsSync::delete_report_data();

		if ( is_wp_error( $delete ) ) {
			$result = array(
				'status'  => 'error',
				'message' => $delete->get_error_message(),
			);
		} else {
			$result = array(
				'status'  => 'success',
				'message' => $delete,
			);
		}

		$response = $this->prepare_item_for_response( $result, $request );
		$data     = $this->prepare_response_for_collection( $response );

		return rest_ensure_response( $data );
	}

	/**
	 * Get the status of the current import.
	 *
	 * @param  WP_REST_Request $request Request data.
	 * @return WP_Error|WP_REST_Response
	 */
	public function get_import_status( $request ) {
		$result   = ReportsSync::get_import_stats();
		$response = $this->prepare_item_for_response( $result, $request );
		$data     = $this->prepare_response_for_collection( $response );

		return rest_ensure_response( $data );
	}

	/**
	 * Get the total orders and customers based on user supplied params.
	 *
	 * @param  WP_REST_Request $request Request data.
	 * @return WP_Error|WP_REST_Response
	 */
	public function get_import_totals( $request ) {
		$query_args = $this->prepare_objects_query( $request );
		$totals     = ReportsSync::get_import_totals( $query_args['days'], $query_args['skip_existing'] );

		$response = $this->prepare_item_for_response( $totals, $request );
		$data     = $this->prepare_response_for_collection( $response );

		return rest_ensure_response( $data );
	}
}
woocommerce-admin/src/API/Reports/SqlQuery.php000064400000011706151335517650015325 0ustar00<?php
/**
 * Admin\API\Reports\SqlQuery class file.
 */

namespace Automattic\WooCommerce\Admin\API\Reports;

if ( ! defined( 'ABSPATH' ) ) {
	exit;
}

/**
 * Admin\API\Reports\SqlQuery: Common parent for manipulating SQL query clauses.
 */
class SqlQuery {
	/**
	 * List of SQL clauses.
	 *
	 * @var array
	 */
	private $sql_clauses = array(
		'select'     => array(),
		'from'       => array(),
		'left_join'  => array(),
		'join'       => array(),
		'right_join' => array(),
		'where'      => array(),
		'where_time' => array(),
		'group_by'   => array(),
		'having'     => array(),
		'limit'      => array(),
		'order_by'   => array(),
	);
	/**
	 * SQL clause merge filters.
	 *
	 * @var array
	 */
	private $sql_filters = array(
		'where' => array(
			'where',
			'where_time',
		),
		'join'  => array(
			'right_join',
			'join',
			'left_join',
		),
	);
	/**
	 * Data store context used to pass to filters.
	 *
	 * @var string
	 */
	protected $context;

	/**
	 * Constructor.
	 *
	 * @param string $context Optional context passed to filters. Default empty string.
	 */
	public function __construct( $context = '' ) {
		$this->context = $context;
	}

	/**
	 * Add a SQL clause to be included when get_data is called.
	 *
	 * @param string $type   Clause type.
	 * @param string $clause SQL clause.
	 */
	protected function add_sql_clause( $type, $clause ) {
		if ( isset( $this->sql_clauses[ $type ] ) && ! empty( $clause ) ) {
			$this->sql_clauses[ $type ][] = $clause;
		}
	}

	/**
	 * Get SQL clause by type.
	 *
	 * @param string $type     Clause type.
	 * @param string $handling Whether to filter the return value (filtered|unfiltered). Default unfiltered.
	 *
	 * @return string SQL clause.
	 */
	protected function get_sql_clause( $type, $handling = 'unfiltered' ) {
		if ( ! isset( $this->sql_clauses[ $type ] ) ) {
			return '';
		}

		/**
		 * Default to bypassing filters for clause retrieval internal to data stores.
		 * The filters are applied when the full SQL statement is retrieved.
		 */
		if ( 'unfiltered' === $handling ) {
			return implode( ' ', $this->sql_clauses[ $type ] );
		}

		if ( isset( $this->sql_filters[ $type ] ) ) {
			$clauses = array();
			foreach ( $this->sql_filters[ $type ] as $subset ) {
				$clauses = array_merge( $clauses, $this->sql_clauses[ $subset ] );
			}
		} else {
			$clauses = $this->sql_clauses[ $type ];
		}

		/**
		 * Filter SQL clauses by type and context.
		 *
		 * @param array  $clauses The original arguments for the request.
		 * @param string $context The data store context.
		 */
		$clauses = apply_filters( "woocommerce_analytics_clauses_{$type}", $clauses, $this->context );
		/**
		 * Filter SQL clauses by type and context.
		 *
		 * @param array  $clauses The original arguments for the request.
		 */
		$clauses = apply_filters( "woocommerce_analytics_clauses_{$type}_{$this->context}", $clauses );
		return implode( ' ', $clauses );
	}

	/**
	 * Clear SQL clauses by type.
	 *
	 * @param string|array $types Clause type.
	 */
	protected function clear_sql_clause( $types ) {
		foreach ( (array) $types as $type ) {
			if ( isset( $this->sql_clauses[ $type ] ) ) {
				$this->sql_clauses[ $type ] = array();
			}
		}
	}

	/**
	 * Replace strings within SQL clauses by type.
	 *
	 * @param string $type    Clause type.
	 * @param string $search  String to search for.
	 * @param string $replace Replacement string.
	 */
	protected function str_replace_clause( $type, $search, $replace ) {
		if ( isset( $this->sql_clauses[ $type ] ) ) {
			foreach ( $this->sql_clauses[ $type ] as $key => $sql ) {
				$this->sql_clauses[ $type ][ $key ] = str_replace( $search, $replace, $sql );
			}
		}
	}

	/**
	 * Get the full SQL statement.
	 *
	 * @return string
	 */
	public function get_query_statement() {
		$join     = $this->get_sql_clause( 'join', 'filtered' );
		$where    = $this->get_sql_clause( 'where', 'filtered' );
		$group_by = $this->get_sql_clause( 'group_by', 'filtered' );
		$having   = $this->get_sql_clause( 'having', 'filtered' );
		$order_by = $this->get_sql_clause( 'order_by', 'filtered' );

		$statement = "
			SELECT
				{$this->get_sql_clause( 'select', 'filtered' )}
			FROM
				{$this->get_sql_clause( 'from', 'filtered' )}
				{$join}
			WHERE
				1=1
				{$where}
		";

		if ( ! empty( $group_by ) ) {
			$statement .= "
				GROUP BY
					{$group_by}
			";
			if ( ! empty( $having ) ) {
				$statement .= "
					HAVING
						1=1
						{$having}
				";
			}
		}

		if ( ! empty( $order_by ) ) {
			$statement .= "
				ORDER BY
					{$order_by}
			";
		}

		return $statement . $this->get_sql_clause( 'limit', 'filtered' );
	}

	/**
	 * Reinitialize the clause array.
	 */
	public function clear_all_clauses() {
		$this->sql_clauses = array(
			'select'     => array(),
			'from'       => array(),
			'left_join'  => array(),
			'join'       => array(),
			'right_join' => array(),
			'where'      => array(),
			'where_time' => array(),
			'group_by'   => array(),
			'having'     => array(),
			'limit'      => array(),
			'order_by'   => array(),
		);
	}
}
woocommerce-admin/src/API/Reports/Products/Controller.php000064400000034200151335517650017460 0ustar00<?php
/**
 * REST API Reports products controller
 *
 * Handles requests to the /reports/products endpoint.
 */

namespace Automattic\WooCommerce\Admin\API\Reports\Products;

defined( 'ABSPATH' ) || exit;

use \Automattic\WooCommerce\Admin\API\Reports\ExportableInterface;

/**
 * REST API Reports products controller class.
 *
 * @extends WC_REST_Reports_Controller
 */
class Controller extends \WC_REST_Reports_Controller implements ExportableInterface {

	/**
	 * Endpoint namespace.
	 *
	 * @var string
	 */
	protected $namespace = 'wc-analytics';

	/**
	 * Route base.
	 *
	 * @var string
	 */
	protected $rest_base = 'reports/products';

	/**
	 * Mapping between external parameter name and name used in query class.
	 *
	 * @var array
	 */
	protected $param_mapping = array(
		'categories' => 'category_includes',
		'products'   => 'product_includes',
		'variations' => 'variation_includes',
	);

	/**
	 * Get items.
	 *
	 * @param WP_REST_Request $request Request data.
	 *
	 * @return array|WP_Error
	 */
	public function get_items( $request ) {
		$args       = array();
		$registered = array_keys( $this->get_collection_params() );
		foreach ( $registered as $param_name ) {
			if ( isset( $request[ $param_name ] ) ) {
				if ( isset( $this->param_mapping[ $param_name ] ) ) {
					$args[ $this->param_mapping[ $param_name ] ] = $request[ $param_name ];
				} else {
					$args[ $param_name ] = $request[ $param_name ];
				}
			}
		}

		$reports       = new Query( $args );
		$products_data = $reports->get_data();

		$data = array();

		foreach ( $products_data->data as $product_data ) {
			$item = $this->prepare_item_for_response( $product_data, $request );
			if ( isset( $item->data['extended_info']['name'] ) ) {
				$item->data['extended_info']['name'] = wp_strip_all_tags( $item->data['extended_info']['name'] );
			}
			$data[] = $this->prepare_response_for_collection( $item );
		}

		$response = rest_ensure_response( $data );
		$response->header( 'X-WP-Total', (int) $products_data->total );
		$response->header( 'X-WP-TotalPages', (int) $products_data->pages );

		$page      = $products_data->page_no;
		$max_pages = $products_data->pages;
		$base      = add_query_arg( $request->get_query_params(), rest_url( sprintf( '/%s/%s', $this->namespace, $this->rest_base ) ) );
		if ( $page > 1 ) {
			$prev_page = $page - 1;
			if ( $prev_page > $max_pages ) {
				$prev_page = $max_pages;
			}
			$prev_link = add_query_arg( 'page', $prev_page, $base );
			$response->link_header( 'prev', $prev_link );
		}
		if ( $max_pages > $page ) {
			$next_page = $page + 1;
			$next_link = add_query_arg( 'page', $next_page, $base );
			$response->link_header( 'next', $next_link );
		}

		return $response;
	}

	/**
	 * Prepare a report object for serialization.
	 *
	 * @param Array           $report  Report data.
	 * @param WP_REST_Request $request Request object.
	 * @return WP_REST_Response
	 */
	public function prepare_item_for_response( $report, $request ) {
		$data = $report;

		$context = ! empty( $request['context'] ) ? $request['context'] : 'view';
		$data    = $this->add_additional_fields_to_object( $data, $request );
		$data    = $this->filter_response_by_context( $data, $context );

		// Wrap the data in a response object.
		$response = rest_ensure_response( $data );
		$response->add_links( $this->prepare_links( $report ) );

		/**
		 * Filter a report returned from the API.
		 *
		 * Allows modification of the report data right before it is returned.
		 *
		 * @param WP_REST_Response $response The response object.
		 * @param object           $report   The original report object.
		 * @param WP_REST_Request  $request  Request used to generate the response.
		 */
		return apply_filters( 'woocommerce_rest_prepare_report_products', $response, $report, $request );
	}

	/**
	 * Prepare links for the request.
	 *
	 * @param Array $object Object data.
	 * @return array        Links for the given post.
	 */
	protected function prepare_links( $object ) {
		$links = array(
			'product' => array(
				'href' => rest_url( sprintf( '/%s/%s/%d', $this->namespace, 'products', $object['product_id'] ) ),
			),
		);

		return $links;
	}

	/**
	 * Get the Report's schema, conforming to JSON Schema.
	 *
	 * @return array
	 */
	public function get_item_schema() {
		$schema = array(
			'$schema'    => 'http://json-schema.org/draft-04/schema#',
			'title'      => 'report_products',
			'type'       => 'object',
			'properties' => array(
				'product_id'    => array(
					'type'        => 'integer',
					'readonly'    => true,
					'context'     => array( 'view', 'edit' ),
					'description' => __( 'Product ID.', 'woocommerce' ),
				),
				'items_sold'    => array(
					'type'        => 'integer',
					'readonly'    => true,
					'context'     => array( 'view', 'edit' ),
					'description' => __( 'Number of items sold.', 'woocommerce' ),
				),
				'net_revenue'   => array(
					'type'        => 'number',
					'readonly'    => true,
					'context'     => array( 'view', 'edit' ),
					'description' => __( 'Total Net sales of all items sold.', 'woocommerce' ),
				),
				'orders_count'  => array(
					'type'        => 'integer',
					'readonly'    => true,
					'context'     => array( 'view', 'edit' ),
					'description' => __( 'Number of orders product appeared in.', 'woocommerce' ),
				),
				'extended_info' => array(
					'name'             => array(
						'type'        => 'string',
						'readonly'    => true,
						'context'     => array( 'view', 'edit' ),
						'description' => __( 'Product name.', 'woocommerce' ),
					),
					'price'            => array(
						'type'        => 'number',
						'readonly'    => true,
						'context'     => array( 'view', 'edit' ),
						'description' => __( 'Product price.', 'woocommerce' ),
					),
					'image'            => array(
						'type'        => 'string',
						'readonly'    => true,
						'context'     => array( 'view', 'edit' ),
						'description' => __( 'Product image.', 'woocommerce' ),
					),
					'permalink'        => array(
						'type'        => 'string',
						'readonly'    => true,
						'context'     => array( 'view', 'edit' ),
						'description' => __( 'Product link.', 'woocommerce' ),
					),
					'category_ids'     => array(
						'type'        => 'array',
						'readonly'    => true,
						'context'     => array( 'view', 'edit' ),
						'description' => __( 'Product category IDs.', 'woocommerce' ),
					),
					'stock_status'     => array(
						'type'        => 'string',
						'readonly'    => true,
						'context'     => array( 'view', 'edit' ),
						'description' => __( 'Product inventory status.', 'woocommerce' ),
					),
					'stock_quantity'   => array(
						'type'        => 'integer',
						'readonly'    => true,
						'context'     => array( 'view', 'edit' ),
						'description' => __( 'Product inventory quantity.', 'woocommerce' ),
					),
					'low_stock_amount' => array(
						'type'        => 'integer',
						'readonly'    => true,
						'context'     => array( 'view', 'edit' ),
						'description' => __( 'Product inventory threshold for low stock.', 'woocommerce' ),
					),
					'variations'       => array(
						'type'        => 'array',
						'readonly'    => true,
						'context'     => array( 'view', 'edit' ),
						'description' => __( 'Product variations IDs.', 'woocommerce' ),
					),
					'sku'              => array(
						'type'        => 'string',
						'readonly'    => true,
						'context'     => array( 'view', 'edit' ),
						'description' => __( 'Product SKU.', 'woocommerce' ),
					),
				),
			),
		);

		return $this->add_additional_fields_schema( $schema );
	}

	/**
	 * Get the query params for collections.
	 *
	 * @return array
	 */
	public function get_collection_params() {
		$params               = array();
		$params['context']    = $this->get_context_param( array( 'default' => 'view' ) );
		$params['page']       = array(
			'description'       => __( 'Current page of the collection.', 'woocommerce' ),
			'type'              => 'integer',
			'default'           => 1,
			'sanitize_callback' => 'absint',
			'validate_callback' => 'rest_validate_request_arg',
			'minimum'           => 1,
		);
		$params['per_page']   = array(
			'description'       => __( 'Maximum number of items to be returned in result set.', 'woocommerce' ),
			'type'              => 'integer',
			'default'           => 10,
			'minimum'           => 1,
			'maximum'           => 100,
			'sanitize_callback' => 'absint',
			'validate_callback' => 'rest_validate_request_arg',
		);
		$params['after']      = array(
			'description'       => __( 'Limit response to resources published after a given ISO8601 compliant date.', 'woocommerce' ),
			'type'              => 'string',
			'format'            => 'date-time',
			'validate_callback' => 'rest_validate_request_arg',
		);
		$params['before']     = array(
			'description'       => __( 'Limit response to resources published before a given ISO8601 compliant date.', 'woocommerce' ),
			'type'              => 'string',
			'format'            => 'date-time',
			'validate_callback' => 'rest_validate_request_arg',
		);
		$params['order']      = array(
			'description'       => __( 'Order sort attribute ascending or descending.', 'woocommerce' ),
			'type'              => 'string',
			'default'           => 'desc',
			'enum'              => array( 'asc', 'desc' ),
			'validate_callback' => 'rest_validate_request_arg',
		);
		$params['orderby']    = array(
			'description'       => __( 'Sort collection by object attribute.', 'woocommerce' ),
			'type'              => 'string',
			'default'           => 'date',
			'enum'              => array(
				'date',
				'net_revenue',
				'orders_count',
				'items_sold',
				'product_name',
				'variations',
				'sku',
			),
			'validate_callback' => 'rest_validate_request_arg',
		);
		$params['categories'] = array(
			'description'       => __( 'Limit result to items from the specified categories.', 'woocommerce' ),
			'type'              => 'array',
			'sanitize_callback' => 'wp_parse_id_list',
			'validate_callback' => 'rest_validate_request_arg',
			'items'             => array(
				'type' => 'integer',
			),
		);
		$params['match']      = array(
			'description'       => __( 'Indicates whether all the conditions should be true for the resulting set, or if any one of them is sufficient. Match affects the following parameters: status_is, status_is_not, product_includes, product_excludes, coupon_includes, coupon_excludes, customer, categories', 'woocommerce' ),
			'type'              => 'string',
			'default'           => 'all',
			'enum'              => array(
				'all',
				'any',
			),
			'validate_callback' => 'rest_validate_request_arg',
		);
		$params['products']   = array(
			'description'       => __( 'Limit result to items with specified product ids.', 'woocommerce' ),
			'type'              => 'array',
			'sanitize_callback' => 'wp_parse_id_list',
			'validate_callback' => 'rest_validate_request_arg',
			'items'             => array(
				'type' => 'integer',
			),

		);
		$params['extended_info'] = array(
			'description'       => __( 'Add additional piece of info about each product to the report.', 'woocommerce' ),
			'type'              => 'boolean',
			'default'           => false,
			'sanitize_callback' => 'wc_string_to_bool',
			'validate_callback' => 'rest_validate_request_arg',
		);

		return $params;
	}

	/**
	 * Get stock status column export value.
	 *
	 * @param array $status Stock status from report row.
	 * @return string
	 */
	protected function _get_stock_status( $status ) {
		$statuses = wc_get_product_stock_status_options();

		return isset( $statuses[ $status ] ) ? $statuses[ $status ] : '';
	}

	/**
	 * Get categories column export value.
	 *
	 * @param array $category_ids Category IDs from report row.
	 * @return string
	 */
	protected function _get_categories( $category_ids ) {
		$category_names = get_terms(
			array(
				'taxonomy' => 'product_cat',
				'include'  => $category_ids,
				'fields'   => 'names',
			)
		);

		return implode( ', ', $category_names );
	}

	/**
	 * Get the column names for export.
	 *
	 * @return array Key value pair of Column ID => Label.
	 */
	public function get_export_columns() {
		$export_columns = array(
			'product_name' => __( 'Product title', 'woocommerce' ),
			'sku'          => __( 'SKU', 'woocommerce' ),
			'items_sold'   => __( 'Items sold', 'woocommerce' ),
			'net_revenue'  => __( 'N. Revenue', 'woocommerce' ),
			'orders_count' => __( 'Orders', 'woocommerce' ),
			'product_cat'  => __( 'Category', 'woocommerce' ),
			'variations'   => __( 'Variations', 'woocommerce' ),
		);

		if ( 'yes' === get_option( 'woocommerce_manage_stock' ) ) {
			$export_columns['stock_status'] = __( 'Status', 'woocommerce' );
			$export_columns['stock']        = __( 'Stock', 'woocommerce' );
		}

		/**
		 * Filter to add or remove column names from the products report for
		 * export.
		 *
		 * @since 1.6.0
		 */
		return apply_filters(
			'woocommerce_report_products_export_columns',
			$export_columns
		);
	}

	/**
	 * Get the column values for export.
	 *
	 * @param array $item Single report item/row.
	 * @return array Key value pair of Column ID => Row Value.
	 */
	public function prepare_item_for_export( $item ) {
		$export_item = array(
			'product_name' => $item['extended_info']['name'],
			'sku'          => $item['extended_info']['sku'],
			'items_sold'   => $item['items_sold'],
			'net_revenue'  => $item['net_revenue'],
			'orders_count' => $item['orders_count'],
			'product_cat'  => $this->_get_categories( $item['extended_info']['category_ids'] ),
			'variations'   => isset( $item['extended_info']['variations'] ) ? count( $item['extended_info']['variations'] ) : 0,
		);

		if ( 'yes' === get_option( 'woocommerce_manage_stock' ) ) {
			if ( $item['extended_info']['manage_stock'] ) {
				$export_item['stock_status'] = $this->_get_stock_status( $item['extended_info']['stock_status'] );
				$export_item['stock']        = $item['extended_info']['stock_quantity'];
			} else {
				$export_item['stock_status'] = __( 'N/A', 'woocommerce' );
				$export_item['stock']        = __( 'N/A', 'woocommerce' );
			}
		}

		/**
		 * Filter to prepare extra columns in the export item for the products
		 * report.
		 *
		 * @since 1.6.0
		 */
		return apply_filters(
			'woocommerce_report_products_prepare_export_item',
			$export_item,
			$item
		);
	}
}
woocommerce-admin/src/API/Reports/Products/Query.php000064400000002353151335517650016446 0ustar00<?php
/**
 * Class for parameter-based Products Report querying
 *
 * Example usage:
 * $args = array(
 *          'before'       => '2018-07-19 00:00:00',
 *          'after'        => '2018-07-05 00:00:00',
 *          'page'         => 2,
 *          'categories'   => array(15, 18),
 *          'products'     => array(1,2,3)
 *         );
 * $report = new \Automattic\WooCommerce\Admin\API\Reports\Products\Query( $args );
 * $mydata = $report->get_data();
 */

namespace Automattic\WooCommerce\Admin\API\Reports\Products;

defined( 'ABSPATH' ) || exit;

use \Automattic\WooCommerce\Admin\API\Reports\Query as ReportsQuery;

/**
 * API\Reports\Products\Query
 */
class Query extends ReportsQuery {

	/**
	 * Valid fields for Products report.
	 *
	 * @return array
	 */
	protected function get_default_query_vars() {
		return array();
	}

	/**
	 * Get product data based on the current query vars.
	 *
	 * @return array
	 */
	public function get_data() {
		$args = apply_filters( 'woocommerce_analytics_products_query_args', $this->get_query_vars() );

		$data_store = \WC_Data_Store::load( 'report-products' );
		$results    = $data_store->get_data( $args );
		return apply_filters( 'woocommerce_analytics_products_select_query', $results, $args );
	}
}
woocommerce-admin/src/API/Reports/Products/DataStore.php000064400000042536151335517650017236 0ustar00<?php
/**
 * API\Reports\Products\DataStore class file.
 */

namespace Automattic\WooCommerce\Admin\API\Reports\Products;

defined( 'ABSPATH' ) || exit;

use \Automattic\WooCommerce\Admin\API\Reports\DataStore as ReportsDataStore;
use \Automattic\WooCommerce\Admin\API\Reports\DataStoreInterface;
use \Automattic\WooCommerce\Admin\API\Reports\TimeInterval;
use \Automattic\WooCommerce\Admin\API\Reports\SqlQuery;
use \Automattic\WooCommerce\Admin\API\Reports\Cache as ReportsCache;

/**
 * API\Reports\Products\DataStore.
 */
class DataStore extends ReportsDataStore implements DataStoreInterface {

	/**
	 * Table used to get the data.
	 *
	 * @var string
	 */
	protected static $table_name = 'wc_order_product_lookup';

	/**
	 * Cache identifier.
	 *
	 * @var string
	 */
	protected $cache_key = 'products';

	/**
	 * Mapping columns to data type to return correct response types.
	 *
	 * @var array
	 */
	protected $column_types = array(
		'date_start'       => 'strval',
		'date_end'         => 'strval',
		'product_id'       => 'intval',
		'items_sold'       => 'intval',
		'net_revenue'      => 'floatval',
		'orders_count'     => 'intval',
		// Extended attributes.
		'name'             => 'strval',
		'price'            => 'floatval',
		'image'            => 'strval',
		'permalink'        => 'strval',
		'stock_status'     => 'strval',
		'stock_quantity'   => 'intval',
		'low_stock_amount' => 'intval',
		'category_ids'     => 'array_values',
		'variations'       => 'array_values',
		'sku'              => 'strval',
	);

	/**
	 * Extended product attributes to include in the data.
	 *
	 * @var array
	 */
	protected $extended_attributes = array(
		'name',
		'price',
		'image',
		'permalink',
		'stock_status',
		'stock_quantity',
		'manage_stock',
		'low_stock_amount',
		'category_ids',
		'variations',
		'sku',
	);

	/**
	 * Data store context used to pass to filters.
	 *
	 * @var string
	 */
	protected $context = 'products';

	/**
	 * Assign report columns once full table name has been assigned.
	 */
	protected function assign_report_columns() {
		$table_name           = self::get_db_table_name();
		$this->report_columns = array(
			'product_id'   => 'product_id',
			'items_sold'   => 'SUM(product_qty) as items_sold',
			'net_revenue'  => 'SUM(product_net_revenue) AS net_revenue',
			'orders_count' => "COUNT( DISTINCT ( CASE WHEN product_gross_revenue >= 0 THEN {$table_name}.order_id END ) ) as orders_count",
		);
	}

	/**
	 * Set up all the hooks for maintaining and populating table data.
	 */
	public static function init() {
		add_action( 'woocommerce_analytics_delete_order_stats', array( __CLASS__, 'sync_on_order_delete' ), 10 );
	}

	/**
	 * Fills FROM clause of SQL request based on user supplied parameters.
	 *
	 * @param array  $query_args Parameters supplied by the user.
	 * @param string $arg_name   Target of the JOIN sql param.
	 * @param string $id_cell    ID cell identifier, like `table_name.id_column_name`.
	 */
	protected function add_from_sql_params( $query_args, $arg_name, $id_cell ) {
		global $wpdb;

		$type = 'join';
		// Order by product name requires extra JOIN.
		switch ( $query_args['orderby'] ) {
			case 'product_name':
				$join = " JOIN {$wpdb->posts} AS _products ON {$id_cell} = _products.ID";
				break;
			case 'sku':
				$join = " LEFT JOIN {$wpdb->postmeta} AS postmeta ON {$id_cell} = postmeta.post_id AND postmeta.meta_key = '_sku'";
				break;
			case 'variations':
				$type = 'left_join';
				$join = "LEFT JOIN ( SELECT post_parent, COUNT(*) AS variations FROM {$wpdb->posts} WHERE post_type = 'product_variation' GROUP BY post_parent ) AS _variations ON {$id_cell} = _variations.post_parent";
				break;
			default:
				$join = '';
				break;
		}
		if ( $join ) {
			if ( 'inner' === $arg_name ) {
				$this->subquery->add_sql_clause( $type, $join );
			} else {
				$this->add_sql_clause( $type, $join );
			}
		}
	}

	/**
	 * Updates the database query with parameters used for Products report: categories and order status.
	 *
	 * @param array $query_args Query arguments supplied by the user.
	 */
	protected function add_sql_query_params( $query_args ) {
		global $wpdb;
		$order_product_lookup_table = self::get_db_table_name();

		$this->add_time_period_sql_params( $query_args, $order_product_lookup_table );
		$this->get_limit_sql_params( $query_args );
		$this->add_order_by_sql_params( $query_args );

		$included_products = $this->get_included_products( $query_args );
		if ( $included_products ) {
			$this->add_from_sql_params( $query_args, 'outer', 'default_results.product_id' );
			$this->subquery->add_sql_clause( 'where', "AND {$order_product_lookup_table}.product_id IN ({$included_products})" );
		} else {
			$this->add_from_sql_params( $query_args, 'inner', "{$order_product_lookup_table}.product_id" );
		}

		$included_variations = $this->get_included_variations( $query_args );
		if ( $included_variations ) {
			$this->subquery->add_sql_clause( 'where', "AND {$order_product_lookup_table}.variation_id IN ({$included_variations})" );
		}

		$order_status_filter = $this->get_status_subquery( $query_args );
		if ( $order_status_filter ) {
			$this->subquery->add_sql_clause( 'join', "JOIN {$wpdb->prefix}wc_order_stats ON {$order_product_lookup_table}.order_id = {$wpdb->prefix}wc_order_stats.order_id" );
			$this->subquery->add_sql_clause( 'where', "AND ( {$order_status_filter} )" );
		}
	}

	/**
	 * Maps ordering specified by the user to columns in the database/fields in the data.
	 *
	 * @param string $order_by Sorting criterion.
	 * @return string
	 */
	protected function normalize_order_by( $order_by ) {
		if ( 'date' === $order_by ) {
			return self::get_db_table_name() . '.date_created';
		}
		if ( 'product_name' === $order_by ) {
			return 'post_title';
		}
		if ( 'sku' === $order_by ) {
			return 'meta_value';
		}
		return $order_by;
	}

	/**
	 * Enriches the product data with attributes specified by the extended_attributes.
	 *
	 * @param array $products_data Product data.
	 * @param array $query_args  Query parameters.
	 */
	protected function include_extended_info( &$products_data, $query_args ) {
		global $wpdb;
		$product_names = array();

		foreach ( $products_data as $key => $product_data ) {
			$extended_info = new \ArrayObject();
			if ( $query_args['extended_info'] ) {
				$product_id = $product_data['product_id'];
				$product    = wc_get_product( $product_id );
				// Product was deleted.
				if ( ! $product ) {
					if ( ! isset( $product_names[ $product_id ] ) ) {
						$product_names[ $product_id ] = $wpdb->get_var(
							$wpdb->prepare(
								"SELECT i.order_item_name
								FROM {$wpdb->prefix}woocommerce_order_items i, {$wpdb->prefix}woocommerce_order_itemmeta m
								WHERE i.order_item_id = m.order_item_id
								AND m.meta_key = '_product_id'
								AND m.meta_value = %s
								ORDER BY i.order_item_id DESC
								LIMIT 1",
								$product_id
							)
						);
					}

					/* translators: %s is product name */
					$products_data[ $key ]['extended_info']['name'] = $product_names[ $product_id ] ? sprintf( __( '%s (Deleted)', 'woocommerce' ), $product_names[ $product_id ] ) : __( '(Deleted)', 'woocommerce' );
					continue;
				}

				$extended_attributes = apply_filters( 'woocommerce_rest_reports_products_extended_attributes', $this->extended_attributes, $product_data );
				foreach ( $extended_attributes as $extended_attribute ) {
					if ( 'variations' === $extended_attribute ) {
						if ( ! $product->is_type( 'variable' ) ) {
							continue;
						}
						$function = 'get_children';
					} else {
						$function = 'get_' . $extended_attribute;
					}
					if ( is_callable( array( $product, $function ) ) ) {
						$value                                = $product->{$function}();
						$extended_info[ $extended_attribute ] = $value;
					}
				}
				// If there is no set low_stock_amount, use the one in user settings.
				if ( '' === $extended_info['low_stock_amount'] ) {
					$extended_info['low_stock_amount'] = absint( max( get_option( 'woocommerce_notify_low_stock_amount' ), 1 ) );
				}
				$extended_info = $this->cast_numbers( $extended_info );
			}
			$products_data[ $key ]['extended_info'] = $extended_info;
		}
	}

	/**
	 * Returns the report data based on parameters supplied by the user.
	 *
	 * @param array $query_args  Query parameters.
	 * @return stdClass|WP_Error Data.
	 */
	public function get_data( $query_args ) {
		global $wpdb;

		$table_name = self::get_db_table_name();

		// These defaults are only partially applied when used via REST API, as that has its own defaults.
		$defaults   = array(
			'per_page'          => get_option( 'posts_per_page' ),
			'page'              => 1,
			'order'             => 'DESC',
			'orderby'           => 'date',
			'before'            => TimeInterval::default_before(),
			'after'             => TimeInterval::default_after(),
			'fields'            => '*',
			'category_includes' => array(),
			'product_includes'  => array(),
			'extended_info'     => false,
		);
		$query_args = wp_parse_args( $query_args, $defaults );
		$this->normalize_timezones( $query_args, $defaults );

		/*
		 * We need to get the cache key here because
		 * parent::update_intervals_sql_params() modifies $query_args.
		 */
		$cache_key = $this->get_cache_key( $query_args );
		$data      = $this->get_cached_data( $cache_key );

		if ( false === $data ) {
			$this->initialize_queries();

			$data = (object) array(
				'data'    => array(),
				'total'   => 0,
				'pages'   => 0,
				'page_no' => 0,
			);

			$selections        = $this->selected_columns( $query_args );
			$included_products = $this->get_included_products_array( $query_args );
			$params            = $this->get_limit_params( $query_args );
			$this->add_sql_query_params( $query_args );

			if ( count( $included_products ) > 0 ) {
				$filtered_products = array_diff( $included_products, array( '-1' ) );
				$total_results     = count( $filtered_products );
				$total_pages       = (int) ceil( $total_results / $params['per_page'] );

				if ( 'date' === $query_args['orderby'] ) {
					$selections .= ", {$table_name}.date_created";
				}

				$fields          = $this->get_fields( $query_args );
				$join_selections = $this->format_join_selections( $fields, array( 'product_id' ) );
				$ids_table       = $this->get_ids_table( $included_products, 'product_id' );

				$this->subquery->clear_sql_clause( 'select' );
				$this->subquery->add_sql_clause( 'select', $selections );
				$this->add_sql_clause( 'select', $join_selections );
				$this->add_sql_clause( 'from', '(' );
				$this->add_sql_clause( 'from', $this->subquery->get_query_statement() );
				$this->add_sql_clause( 'from', ") AS {$table_name}" );
				$this->add_sql_clause(
					'right_join',
					"RIGHT JOIN ( {$ids_table} ) AS default_results
					ON default_results.product_id = {$table_name}.product_id"
				);
				$this->add_sql_clause( 'where', 'AND default_results.product_id != -1' );

				$products_query = $this->get_query_statement();
			} else {
				$count_query      = "SELECT COUNT(*) FROM (
						{$this->subquery->get_query_statement()}
					) AS tt";
				$db_records_count = (int) $wpdb->get_var(
					$count_query // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared
				);

				$total_results = $db_records_count;
				$total_pages   = (int) ceil( $db_records_count / $params['per_page'] );

				if ( ( $query_args['page'] < 1 || $query_args['page'] > $total_pages ) ) {
					return $data;
				}

				$this->subquery->clear_sql_clause( 'select' );
				$this->subquery->add_sql_clause( 'select', $selections );
				$this->subquery->add_sql_clause( 'order_by', $this->get_sql_clause( 'order_by' ) );
				$this->subquery->add_sql_clause( 'limit', $this->get_sql_clause( 'limit' ) );
				$products_query = $this->subquery->get_query_statement();
			}

			$product_data = $wpdb->get_results(
				$products_query, // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared
				ARRAY_A
			);

			if ( null === $product_data ) {
				return $data;
			}

			$this->include_extended_info( $product_data, $query_args );

			$product_data = array_map( array( $this, 'cast_numbers' ), $product_data );
			$data         = (object) array(
				'data'    => $product_data,
				'total'   => $total_results,
				'pages'   => $total_pages,
				'page_no' => (int) $query_args['page'],
			);

			$this->set_cached_data( $cache_key, $data );
		}

		return $data;
	}

	/**
	 * Create or update an entry in the wc_admin_order_product_lookup table for an order.
	 *
	 * @since 3.5.0
	 * @param int $order_id Order ID.
	 * @return int|bool Returns -1 if order won't be processed, or a boolean indicating processing success.
	 */
	public static function sync_order_products( $order_id ) {
		global $wpdb;

		$order = wc_get_order( $order_id );
		if ( ! $order ) {
			return -1;
		}

		$table_name     = self::get_db_table_name();
		$existing_items = $wpdb->get_col(
			$wpdb->prepare(
				// phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared, WordPress.DB.PreparedSQL.InterpolatedNotPrepared
				"SELECT order_item_id FROM {$table_name} WHERE order_id = %d",
				$order_id
			)
		);
		$existing_items = array_flip( $existing_items );
		$order_items    = $order->get_items();
		$num_updated    = 0;
		$decimals       = wc_get_price_decimals();
		$round_tax      = 'no' === get_option( 'woocommerce_tax_round_at_subtotal' );

		foreach ( $order_items as $order_item ) {
			$order_item_id = $order_item->get_id();
			unset( $existing_items[ $order_item_id ] );
			$product_qty         = $order_item->get_quantity( 'edit' );
			$shipping_amount     = $order->get_item_shipping_amount( $order_item );
			$shipping_tax_amount = $order->get_item_shipping_tax_amount( $order_item );
			$coupon_amount       = $order->get_item_coupon_amount( $order_item );

			// Skip line items without changes to product quantity.
			if ( ! $product_qty ) {
				$num_updated++;
				continue;
			}

			// Tax amount.
			$tax_amount  = 0;
			$order_taxes = $order->get_taxes();
			$tax_data    = $order_item->get_taxes();
			foreach ( $order_taxes as $tax_item ) {
				$tax_item_id = $tax_item->get_rate_id();
				$tax_amount += isset( $tax_data['total'][ $tax_item_id ] ) ? (float) $tax_data['total'][ $tax_item_id ] : 0;
			}

			$net_revenue = round( $order_item->get_total( 'edit' ), $decimals );
			if ( $round_tax ) {
				$tax_amount = round( $tax_amount, $decimals );
			}

			$result = $wpdb->replace(
				self::get_db_table_name(),
				array(
					'order_item_id'         => $order_item_id,
					'order_id'              => $order->get_id(),
					'product_id'            => wc_get_order_item_meta( $order_item_id, '_product_id' ),
					'variation_id'          => wc_get_order_item_meta( $order_item_id, '_variation_id' ),
					'customer_id'           => $order->get_report_customer_id(),
					'product_qty'           => $product_qty,
					'product_net_revenue'   => $net_revenue,
					'date_created'          => $order->get_date_created( 'edit' )->date( TimeInterval::$sql_datetime_format ),
					'coupon_amount'         => $coupon_amount,
					'tax_amount'            => $tax_amount,
					'shipping_amount'       => $shipping_amount,
					'shipping_tax_amount'   => $shipping_tax_amount,
					// @todo Can this be incorrect if modified by filters?
					'product_gross_revenue' => $net_revenue + $tax_amount + $shipping_amount + $shipping_tax_amount,
				),
				array(
					'%d', // order_item_id.
					'%d', // order_id.
					'%d', // product_id.
					'%d', // variation_id.
					'%d', // customer_id.
					'%d', // product_qty.
					'%f', // product_net_revenue.
					'%s', // date_created.
					'%f', // coupon_amount.
					'%f', // tax_amount.
					'%f', // shipping_amount.
					'%f', // shipping_tax_amount.
					'%f', // product_gross_revenue.
				)
			); // WPCS: cache ok, DB call ok, unprepared SQL ok.

			/**
			 * Fires when product's reports are updated.
			 *
			 * @param int $order_item_id Order Item ID.
			 * @param int $order_id      Order ID.
			 */
			do_action( 'woocommerce_analytics_update_product', $order_item_id, $order->get_id() );

			// Sum the rows affected. Using REPLACE can affect 2 rows if the row already exists.
			$num_updated += 2 === intval( $result ) ? 1 : intval( $result );
		}

		if ( ! empty( $existing_items ) ) {
			$existing_items = array_flip( $existing_items );
			$format         = array_fill( 0, count( $existing_items ), '%d' );
			$format         = implode( ',', $format );
			array_unshift( $existing_items, $order_id );
			$wpdb->query(
				$wpdb->prepare(
					// phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared, WordPress.DB.PreparedSQL.InterpolatedNotPrepared
					"DELETE FROM {$table_name} WHERE order_id = %d AND order_item_id in ({$format})",
					$existing_items
				)
			);
		}

		return ( count( $order_items ) === $num_updated );
	}

	/**
	 * Clean products data when an order is deleted.
	 *
	 * @param int $order_id Order ID.
	 */
	public static function sync_on_order_delete( $order_id ) {
		global $wpdb;

		$wpdb->delete( self::get_db_table_name(), array( 'order_id' => $order_id ) );

		/**
		 * Fires when product's reports are removed from database.
		 *
		 * @param int $product_id Product ID.
		 * @param int $order_id   Order ID.
		 */
		do_action( 'woocommerce_analytics_delete_product', 0, $order_id );

		ReportsCache::invalidate();
	}

	/**
	 * Initialize query objects.
	 */
	protected function initialize_queries() {
		$this->clear_all_clauses();
		$this->subquery = new SqlQuery( $this->context . '_subquery' );
		$this->subquery->add_sql_clause( 'select', 'product_id' );
		$this->subquery->add_sql_clause( 'from', self::get_db_table_name() );
		$this->subquery->add_sql_clause( 'group_by', 'product_id' );
	}
}
woocommerce-admin/src/API/Reports/Products/Stats/Query.php000064400000002426151335517650017545 0ustar00<?php
/**
 * Class for parameter-based Products Stats Report querying
 *
 * Example usage:
 * $args = array(
 *          'before'       => '2018-07-19 00:00:00',
 *          'after'        => '2018-07-05 00:00:00',
 *          'page'         => 2,
 *          'categories'   => array(15, 18),
 *          'product_ids'  => array(1,2,3)
 *         );
 * $report = new \Automattic\WooCommerce\Admin\API\Reports\Products\Stats\Query( $args );
 * $mydata = $report->get_data();
 */

namespace Automattic\WooCommerce\Admin\API\Reports\Products\Stats;

defined( 'ABSPATH' ) || exit;

use \Automattic\WooCommerce\Admin\API\Reports\Query as ReportsQuery;

/**
 * API\Reports\Products\Stats\Query
 */
class Query extends ReportsQuery {

	/**
	 * Valid fields for Products report.
	 *
	 * @return array
	 */
	protected function get_default_query_vars() {
		return array();
	}

	/**
	 * Get product data based on the current query vars.
	 *
	 * @return array
	 */
	public function get_data() {
		$args = apply_filters( 'woocommerce_analytics_products_stats_query_args', $this->get_query_vars() );

		$data_store = \WC_Data_Store::load( 'report-products-stats' );
		$results    = $data_store->get_data( $args );
		return apply_filters( 'woocommerce_analytics_products_stats_select_query', $results, $args );
	}

}
woocommerce-admin/src/API/Reports/Products/Stats/Segmenter.php000064400000024314151335517650020371 0ustar00<?php
/**
 * Class for adding segmenting support without cluttering the data stores.
 */

namespace Automattic\WooCommerce\Admin\API\Reports\Products\Stats;

defined( 'ABSPATH' ) || exit;

use \Automattic\WooCommerce\Admin\API\Reports\Segmenter as ReportsSegmenter;
use \Automattic\WooCommerce\Admin\API\Reports\ParameterException;

/**
 * Date & time interval and numeric range handling class for Reporting API.
 */
class Segmenter extends ReportsSegmenter {

	/**
	 * Returns column => query mapping to be used for product-related product-level segmenting query
	 * (e.g. products sold, revenue from product X when segmenting by category).
	 *
	 * @param string $products_table Name of SQL table containing the product-level segmenting info.
	 *
	 * @return array Column => SELECT query mapping.
	 */
	protected function get_segment_selections_product_level( $products_table ) {
		$columns_mapping = array(
			'items_sold'       => "SUM($products_table.product_qty) as items_sold",
			'net_revenue'      => "SUM($products_table.product_net_revenue ) AS net_revenue",
			'orders_count'     => "COUNT( DISTINCT $products_table.order_id ) AS orders_count",
			'products_count'   => "COUNT( DISTINCT $products_table.product_id ) AS products_count",
			'variations_count' => "COUNT( DISTINCT $products_table.variation_id ) AS variations_count",
		);

		return $columns_mapping;
	}

	/**
	 * Calculate segments for totals where the segmenting property is bound to product (e.g. category, product_id, variation_id).
	 *
	 * @param array  $segmenting_selections SELECT part of segmenting SQL query--one for 'product_level' and one for 'order_level'.
	 * @param string $segmenting_from FROM part of segmenting SQL query.
	 * @param string $segmenting_where WHERE part of segmenting SQL query.
	 * @param string $segmenting_groupby GROUP BY part of segmenting SQL query.
	 * @param string $segmenting_dimension_name Name of the segmenting dimension.
	 * @param string $table_name Name of SQL table which is the stats table for orders.
	 * @param array  $totals_query Array of SQL clauses for totals query.
	 * @param string $unique_orders_table Name of temporary SQL table that holds unique orders.
	 *
	 * @return array
	 */
	protected function get_product_related_totals_segments( $segmenting_selections, $segmenting_from, $segmenting_where, $segmenting_groupby, $segmenting_dimension_name, $table_name, $totals_query, $unique_orders_table ) {
		global $wpdb;

		$product_segmenting_table = $wpdb->prefix . 'wc_order_product_lookup';

		// Can't get all the numbers from one query, so split it into one query for product-level numbers and one for order-level numbers (which first need to have orders uniqued).
		// Product-level numbers.
		$segments_products = $wpdb->get_results(
			"SELECT
						$segmenting_groupby AS $segmenting_dimension_name
						{$segmenting_selections['product_level']}
					FROM
						$table_name
						$segmenting_from
						{$totals_query['from_clause']}
					WHERE
						1=1
						{$totals_query['where_time_clause']}
						{$totals_query['where_clause']}
						$segmenting_where
					GROUP BY
						$segmenting_groupby",
			ARRAY_A
		); // WPCS: cache ok, DB call ok, unprepared SQL ok.

		$totals_segments = $this->merge_segment_totals_results( $segmenting_dimension_name, $segments_products, array() );
		return $totals_segments;
	}

	/**
	 * Calculate segments for intervals where the segmenting property is bound to product (e.g. category, product_id, variation_id).
	 *
	 * @param array  $segmenting_selections SELECT part of segmenting SQL query--one for 'product_level' and one for 'order_level'.
	 * @param string $segmenting_from FROM part of segmenting SQL query.
	 * @param string $segmenting_where WHERE part of segmenting SQL query.
	 * @param string $segmenting_groupby GROUP BY part of segmenting SQL query.
	 * @param string $segmenting_dimension_name Name of the segmenting dimension.
	 * @param string $table_name Name of SQL table which is the stats table for orders.
	 * @param array  $intervals_query Array of SQL clauses for intervals query.
	 * @param string $unique_orders_table Name of temporary SQL table that holds unique orders.
	 *
	 * @return array
	 */
	protected function get_product_related_intervals_segments( $segmenting_selections, $segmenting_from, $segmenting_where, $segmenting_groupby, $segmenting_dimension_name, $table_name, $intervals_query, $unique_orders_table ) {
		global $wpdb;

		$product_segmenting_table = $wpdb->prefix . 'wc_order_product_lookup';

		// LIMIT offset, rowcount needs to be updated to a multiple of the number of segments.
		preg_match( '/LIMIT (\d+)\s?,\s?(\d+)/', $intervals_query['limit'], $limit_parts );
		$segment_count    = count( $this->get_all_segments() );
		$orig_offset      = intval( $limit_parts[1] );
		$orig_rowcount    = intval( $limit_parts[2] );
		$segmenting_limit = $wpdb->prepare( 'LIMIT %d, %d', $orig_offset * $segment_count, $orig_rowcount * $segment_count );

		// Can't get all the numbers from one query, so split it into one query for product-level numbers and one for order-level numbers (which first need to have orders uniqued).
		// Product-level numbers.
		$segments_products = $wpdb->get_results(
			"SELECT
						{$intervals_query['select_clause']} AS time_interval,
						$segmenting_groupby AS $segmenting_dimension_name
						{$segmenting_selections['product_level']}
					FROM
						$table_name
						$segmenting_from
						{$intervals_query['from_clause']}
					WHERE
						1=1
						{$intervals_query['where_time_clause']}
						{$intervals_query['where_clause']}
						$segmenting_where
					GROUP BY
						time_interval, $segmenting_groupby
					$segmenting_limit",
			ARRAY_A
		); // WPCS: cache ok, DB call ok, unprepared SQL ok.

		$intervals_segments = $this->merge_segment_intervals_results( $segmenting_dimension_name, $segments_products, array() );
		return $intervals_segments;
	}

	/**
	 * Return array of segments formatted for REST response.
	 *
	 * @param string $type Type of segments to return--'totals' or 'intervals'.
	 * @param array  $query_params SQL query parameter array.
	 * @param string $table_name Name of main SQL table for the data store (used as basis for JOINS).
	 *
	 * @return array
	 * @throws \Automattic\WooCommerce\Admin\API\Reports\ParameterException In case of segmenting by variations, when no parent product is specified.
	 */
	protected function get_segments( $type, $query_params, $table_name ) {
		global $wpdb;
		if ( ! isset( $this->query_args['segmentby'] ) || '' === $this->query_args['segmentby'] ) {
			return array();
		}

		$product_segmenting_table = $wpdb->prefix . 'wc_order_product_lookup';
		$unique_orders_table      = 'uniq_orders';
		$segmenting_where         = '';

		// Product, variation, and category are bound to product, so here product segmenting table is required,
		// while coupon and customer are bound to order, so we don't need the extra JOIN for those.
		// This also means that segment selections need to be calculated differently.
		if ( 'product' === $this->query_args['segmentby'] ) {
			$product_level_columns     = $this->get_segment_selections_product_level( $product_segmenting_table );
			$segmenting_selections     = array(
				'product_level' => $this->prepare_selections( $product_level_columns ),
			);
			$this->report_columns      = $product_level_columns;
			$segmenting_from           = '';
			$segmenting_groupby        = $product_segmenting_table . '.product_id';
			$segmenting_dimension_name = 'product_id';

			$segments = $this->get_product_related_segments( $type, $segmenting_selections, $segmenting_from, $segmenting_where, $segmenting_groupby, $segmenting_dimension_name, $table_name, $query_params, $unique_orders_table );
		} elseif ( 'variation' === $this->query_args['segmentby'] ) {
			if ( ! isset( $this->query_args['product_includes'] ) || count( $this->query_args['product_includes'] ) !== 1 ) {
				throw new ParameterException( 'wc_admin_reports_invalid_segmenting_variation', __( 'product_includes parameter need to specify exactly one product when segmenting by variation.', 'woocommerce' ) );
			}

			$product_level_columns     = $this->get_segment_selections_product_level( $product_segmenting_table );
			$segmenting_selections     = array(
				'product_level' => $this->prepare_selections( $product_level_columns ),
			);
			$this->report_columns      = $product_level_columns;
			$segmenting_from           = '';
			$segmenting_where          = "AND $product_segmenting_table.product_id = {$this->query_args['product_includes'][0]}";
			$segmenting_groupby        = $product_segmenting_table . '.variation_id';
			$segmenting_dimension_name = 'variation_id';

			$segments = $this->get_product_related_segments( $type, $segmenting_selections, $segmenting_from, $segmenting_where, $segmenting_groupby, $segmenting_dimension_name, $table_name, $query_params, $unique_orders_table );
		} elseif ( 'category' === $this->query_args['segmentby'] ) {
			$product_level_columns     = $this->get_segment_selections_product_level( $product_segmenting_table );
			$segmenting_selections     = array(
				'product_level' => $this->prepare_selections( $product_level_columns ),
			);
			$this->report_columns      = $product_level_columns;
			$segmenting_from           = "
			LEFT JOIN {$wpdb->term_relationships} ON {$product_segmenting_table}.product_id = {$wpdb->term_relationships}.object_id
			JOIN {$wpdb->term_taxonomy} ON {$wpdb->term_taxonomy}.term_taxonomy_id = {$wpdb->term_relationships}.term_taxonomy_id
			LEFT JOIN {$wpdb->wc_category_lookup} ON {$wpdb->term_taxonomy}.term_id = {$wpdb->wc_category_lookup}.category_id
			";
			$segmenting_where          = " AND {$wpdb->wc_category_lookup}.category_tree_id IS NOT NULL";
			$segmenting_groupby        = "{$wpdb->wc_category_lookup}.category_tree_id";
			$segmenting_dimension_name = 'category_id';

			// Restrict our search space for category comparisons.
			if ( isset( $this->query_args['category_includes'] ) ) {
				$category_ids      = implode( ',', $this->get_all_segments() );
				$segmenting_where .= " AND {$wpdb->wc_category_lookup}.category_id IN ( $category_ids )";
			}

			$segments = $this->get_product_related_segments( $type, $segmenting_selections, $segmenting_from, $segmenting_where, $segmenting_groupby, $segmenting_dimension_name, $table_name, $query_params, $unique_orders_table );
		}

		return $segments;
	}
}
woocommerce-admin/src/API/Reports/Products/Stats/DataStore.php000064400000023377151335517650020336 0ustar00<?php
/**
 * API\Reports\Products\Stats\DataStore class file.
 */

namespace Automattic\WooCommerce\Admin\API\Reports\Products\Stats;

defined( 'ABSPATH' ) || exit;

use \Automattic\WooCommerce\Admin\API\Reports\Products\DataStore as ProductsDataStore;
use \Automattic\WooCommerce\Admin\API\Reports\DataStoreInterface;
use \Automattic\WooCommerce\Admin\API\Reports\TimeInterval;
use \Automattic\WooCommerce\Admin\API\Reports\SqlQuery;

/**
 * API\Reports\Products\Stats\DataStore.
 */
class DataStore extends ProductsDataStore implements DataStoreInterface {

	/**
	 * Mapping columns to data type to return correct response types.
	 *
	 * @var array
	 */
	protected $column_types = array(
		'date_start'       => 'strval',
		'date_end'         => 'strval',
		'product_id'       => 'intval',
		'items_sold'       => 'intval',
		'net_revenue'      => 'floatval',
		'orders_count'     => 'intval',
		'products_count'   => 'intval',
		'variations_count' => 'intval',
	);

	/**
	 * Cache identifier.
	 *
	 * @var string
	 */
	protected $cache_key = 'products_stats';

	/**
	 * Data store context used to pass to filters.
	 *
	 * @var string
	 */
	protected $context = 'products_stats';

	/**
	 * Assign report columns once full table name has been assigned.
	 */
	protected function assign_report_columns() {
		$table_name           = self::get_db_table_name();
		$this->report_columns = array(
			'items_sold'       => 'SUM(product_qty) as items_sold',
			'net_revenue'      => 'SUM(product_net_revenue) AS net_revenue',
			'orders_count'     => "COUNT( DISTINCT ( CASE WHEN product_gross_revenue >= 0 THEN {$table_name}.order_id END ) ) as orders_count",
			'products_count'   => 'COUNT(DISTINCT product_id) as products_count',
			'variations_count' => 'COUNT(DISTINCT variation_id) as variations_count',
		);
	}

	/**
	 * Updates the database query with parameters used for Products Stats report: categories and order status.
	 *
	 * @param array $query_args       Query arguments supplied by the user.
	 */
	protected function update_sql_query_params( $query_args ) {
		global $wpdb;

		$products_where_clause      = '';
		$products_from_clause       = '';
		$order_product_lookup_table = self::get_db_table_name();

		$included_products = $this->get_included_products( $query_args );
		if ( $included_products ) {
			$products_where_clause .= " AND {$order_product_lookup_table}.product_id IN ({$included_products})";
		}

		$included_variations = $this->get_included_variations( $query_args );
		if ( $included_variations ) {
			$products_where_clause .= " AND {$order_product_lookup_table}.variation_id IN ({$included_variations})";
		}

		$order_status_filter = $this->get_status_subquery( $query_args );
		if ( $order_status_filter ) {
			$products_from_clause  .= " JOIN {$wpdb->prefix}wc_order_stats ON {$order_product_lookup_table}.order_id = {$wpdb->prefix}wc_order_stats.order_id";
			$products_where_clause .= " AND ( {$order_status_filter} )";
		}

		$this->add_time_period_sql_params( $query_args, $order_product_lookup_table );
		$this->total_query->add_sql_clause( 'where', $products_where_clause );
		$this->total_query->add_sql_clause( 'join', $products_from_clause );

		$this->add_intervals_sql_params( $query_args, $order_product_lookup_table );
		$this->interval_query->add_sql_clause( 'where', $products_where_clause );
		$this->interval_query->add_sql_clause( 'join', $products_from_clause );
		$this->interval_query->add_sql_clause( 'select', $this->get_sql_clause( 'select' ) . ' AS time_interval' );
	}

	/**
	 * Returns the report data based on parameters supplied by the user.
	 *
	 * @since 3.5.0
	 * @param array $query_args  Query parameters.
	 * @return stdClass|WP_Error Data.
	 */
	public function get_data( $query_args ) {
		global $wpdb;

		$table_name = self::get_db_table_name();

		// These defaults are only partially applied when used via REST API, as that has its own defaults.
		$defaults   = array(
			'per_page'          => get_option( 'posts_per_page' ),
			'page'              => 1,
			'order'             => 'DESC',
			'orderby'           => 'date',
			'before'            => TimeInterval::default_before(),
			'after'             => TimeInterval::default_after(),
			'fields'            => '*',
			'category_includes' => array(),
			'interval'          => 'week',
			'product_includes'  => array(),
		);
		$query_args = wp_parse_args( $query_args, $defaults );
		$this->normalize_timezones( $query_args, $defaults );

		/*
		 * We need to get the cache key here because
		 * parent::update_intervals_sql_params() modifies $query_args.
		 */
		$cache_key = $this->get_cache_key( $query_args );
		$data      = $this->get_cached_data( $cache_key );

		if ( false === $data ) {
			$this->initialize_queries();

			$selections = $this->selected_columns( $query_args );
			$params     = $this->get_limit_params( $query_args );

			$this->update_sql_query_params( $query_args );
			$this->get_limit_sql_params( $query_args );
			$this->interval_query->add_sql_clause( 'where_time', $this->get_sql_clause( 'where_time' ) );

			$db_intervals = $wpdb->get_col(
				$this->interval_query->get_query_statement()
			); // WPCS: cache ok, DB call ok, unprepared SQL ok.

			$db_interval_count       = count( $db_intervals );
			$expected_interval_count = TimeInterval::intervals_between( $query_args['after'], $query_args['before'], $query_args['interval'] );
			$total_pages             = (int) ceil( $expected_interval_count / $params['per_page'] );
			if ( $query_args['page'] < 1 || $query_args['page'] > $total_pages ) {
				return array();
			}

			$intervals = array();
			$this->update_intervals_sql_params( $query_args, $db_interval_count, $expected_interval_count, $table_name );
			$this->total_query->add_sql_clause( 'select', $selections );
			$this->total_query->add_sql_clause( 'where_time', $this->get_sql_clause( 'where_time' ) );

			$totals = $wpdb->get_results(
				$this->total_query->get_query_statement(),
				ARRAY_A
			); // WPCS: cache ok, DB call ok, unprepared SQL ok.

			// @todo remove these assignements when refactoring segmenter classes to use query objects.
			$totals_query          = array(
				'from_clause'       => $this->total_query->get_sql_clause( 'join' ),
				'where_time_clause' => $this->total_query->get_sql_clause( 'where_time' ),
				'where_clause'      => $this->total_query->get_sql_clause( 'where' ),
			);
			$intervals_query       = array(
				'select_clause'     => $this->get_sql_clause( 'select' ),
				'from_clause'       => $this->interval_query->get_sql_clause( 'join' ),
				'where_time_clause' => $this->interval_query->get_sql_clause( 'where_time' ),
				'where_clause'      => $this->interval_query->get_sql_clause( 'where' ),
				'order_by'          => $this->get_sql_clause( 'order_by' ),
				'limit'             => $this->get_sql_clause( 'limit' ),
			);
			$segmenter             = new Segmenter( $query_args, $this->report_columns );
			$totals[0]['segments'] = $segmenter->get_totals_segments( $totals_query, $table_name );

			if ( null === $totals ) {
				return new \WP_Error( 'woocommerce_analytics_products_stats_result_failed', __( 'Sorry, fetching revenue data failed.', 'woocommerce' ) );
			}

			$this->interval_query->add_sql_clause( 'order_by', $this->get_sql_clause( 'order_by' ) );
			$this->interval_query->add_sql_clause( 'limit', $this->get_sql_clause( 'limit' ) );
			$this->interval_query->add_sql_clause( 'select', ", MAX(${table_name}.date_created) AS datetime_anchor" );
			if ( '' !== $selections ) {
				$this->interval_query->add_sql_clause( 'select', ', ' . $selections );
			}

			$intervals = $wpdb->get_results(
				$this->interval_query->get_query_statement(),
				ARRAY_A
			); // WPCS: cache ok, DB call ok, unprepared SQL ok.

			if ( null === $intervals ) {
				return new \WP_Error( 'woocommerce_analytics_products_stats_result_failed', __( 'Sorry, fetching revenue data failed.', 'woocommerce' ) );
			}

			$totals = (object) $this->cast_numbers( $totals[0] );

			$data = (object) array(
				'totals'    => $totals,
				'intervals' => $intervals,
				'total'     => $expected_interval_count,
				'pages'     => $total_pages,
				'page_no'   => (int) $query_args['page'],
			);

			if ( TimeInterval::intervals_missing( $expected_interval_count, $db_interval_count, $params['per_page'], $query_args['page'], $query_args['order'], $query_args['orderby'], count( $intervals ) ) ) {
				$this->fill_in_missing_intervals( $db_intervals, $query_args['adj_after'], $query_args['adj_before'], $query_args['interval'], $data );
				$this->sort_intervals( $data, $query_args['orderby'], $query_args['order'] );
				$this->remove_extra_records( $data, $query_args['page'], $params['per_page'], $db_interval_count, $expected_interval_count, $query_args['orderby'], $query_args['order'] );
			} else {
				$this->update_interval_boundary_dates( $query_args['after'], $query_args['before'], $query_args['interval'], $data->intervals );
			}
			$segmenter->add_intervals_segments( $data, $intervals_query, $table_name );
			$this->create_interval_subtotals( $data->intervals );

			$this->set_cached_data( $cache_key, $data );
		}

		return $data;
	}

	/**
	 * Normalizes order_by clause to match to SQL query.
	 *
	 * @param string $order_by Order by option requeste by user.
	 * @return string
	 */
	protected function normalize_order_by( $order_by ) {
		if ( 'date' === $order_by ) {
			return 'time_interval';
		}

		return $order_by;
	}

	/**
	 * Initialize query objects.
	 */
	protected function initialize_queries() {
		$this->clear_all_clauses();
		unset( $this->subquery );
		$this->total_query = new SqlQuery( $this->context . '_total' );
		$this->total_query->add_sql_clause( 'from', self::get_db_table_name() );

		$this->interval_query = new SqlQuery( $this->context . '_interval' );
		$this->interval_query->add_sql_clause( 'from', self::get_db_table_name() );
		$this->interval_query->add_sql_clause( 'group_by', 'time_interval' );
	}
}
woocommerce-admin/src/API/Reports/Products/Stats/Controller.php000064400000032457151335517650020572 0ustar00<?php
/**
 * REST API Reports products stats controller
 *
 * Handles requests to the /reports/products/stats endpoint.
 */

namespace Automattic\WooCommerce\Admin\API\Reports\Products\Stats;

defined( 'ABSPATH' ) || exit;

use \Automattic\WooCommerce\Admin\API\Reports\ParameterException;

/**
 * REST API Reports products stats controller class.
 *
 * @extends WC_REST_Reports_Controller
 */
class Controller extends \WC_REST_Reports_Controller {

	/**
	 * Endpoint namespace.
	 *
	 * @var string
	 */
	protected $namespace = 'wc-analytics';

	/**
	 * Route base.
	 *
	 * @var string
	 */
	protected $rest_base = 'reports/products/stats';

	/**
	 * Mapping between external parameter name and name used in query class.
	 *
	 * @var array
	 */
	protected $param_mapping = array(
		'categories' => 'category_includes',
		'products'   => 'product_includes',
		'variations' => 'variation_includes',
	);

	/**
	 * Constructor.
	 */
	public function __construct() {
		add_filter( 'woocommerce_analytics_products_stats_select_query', array( $this, 'set_default_report_data' ) );
	}

	/**
	 * Get all reports.
	 *
	 * @param WP_REST_Request $request Request data.
	 * @return array|WP_Error
	 */
	public function get_items( $request ) {
		$query_args = array(
			'fields' => array(
				'items_sold',
				'net_revenue',
				'orders_count',
				'products_count',
				'variations_count',
			),
		);

		$registered = array_keys( $this->get_collection_params() );
		foreach ( $registered as $param_name ) {
			if ( isset( $request[ $param_name ] ) ) {
				if ( isset( $this->param_mapping[ $param_name ] ) ) {
					$query_args[ $this->param_mapping[ $param_name ] ] = $request[ $param_name ];
				} else {
					$query_args[ $param_name ] = $request[ $param_name ];
				}
			}
		}

		$query = new Query( $query_args );
		try {
			$report_data = $query->get_data();
		} catch ( ParameterException $e ) {
			return new \WP_Error( $e->getErrorCode(), $e->getMessage(), array( 'status' => $e->getCode() ) );
		}

		$out_data = array(
			'totals'    => get_object_vars( $report_data->totals ),
			'intervals' => array(),
		);

		foreach ( $report_data->intervals as $interval_data ) {
			$item                    = $this->prepare_item_for_response( $interval_data, $request );
			$out_data['intervals'][] = $this->prepare_response_for_collection( $item );
		}

		$response = rest_ensure_response( $out_data );
		$response->header( 'X-WP-Total', (int) $report_data->total );
		$response->header( 'X-WP-TotalPages', (int) $report_data->pages );

		$page      = $report_data->page_no;
		$max_pages = $report_data->pages;
		$base      = add_query_arg( $request->get_query_params(), rest_url( sprintf( '/%s/%s', $this->namespace, $this->rest_base ) ) );
		if ( $page > 1 ) {
			$prev_page = $page - 1;
			if ( $prev_page > $max_pages ) {
				$prev_page = $max_pages;
			}
			$prev_link = add_query_arg( 'page', $prev_page, $base );
			$response->link_header( 'prev', $prev_link );
		}
		if ( $max_pages > $page ) {
			$next_page = $page + 1;
			$next_link = add_query_arg( 'page', $next_page, $base );
			$response->link_header( 'next', $next_link );
		}

		return $response;
	}

	/**
	 * Prepare a report object for serialization.
	 *
	 * @param Array           $report  Report data.
	 * @param WP_REST_Request $request Request object.
	 * @return WP_REST_Response
	 */
	public function prepare_item_for_response( $report, $request ) {
		$data = $report;

		$context = ! empty( $request['context'] ) ? $request['context'] : 'view';
		$data    = $this->add_additional_fields_to_object( $data, $request );
		$data    = $this->filter_response_by_context( $data, $context );

		// Wrap the data in a response object.
		$response = rest_ensure_response( $data );

		/**
		 * Filter a report returned from the API.
		 *
		 * Allows modification of the report data right before it is returned.
		 *
		 * @param WP_REST_Response $response The response object.
		 * @param object           $report   The original report object.
		 * @param WP_REST_Request  $request  Request used to generate the response.
		 */
		return apply_filters( 'woocommerce_rest_prepare_report_products_stats', $response, $report, $request );
	}

	/**
	 * Get the Report's schema, conforming to JSON Schema.
	 *
	 * @return array
	 */
	public function get_item_schema() {
		$data_values = array(
			'items_sold'   => array(
				'title'       => __( 'Products sold', 'woocommerce' ),
				'description' => __( 'Number of product items sold.', 'woocommerce' ),
				'type'        => 'integer',
				'context'     => array( 'view', 'edit' ),
				'readonly'    => true,
				'indicator'   => true,
			),
			'net_revenue'  => array(
				'description' => __( 'Net sales.', 'woocommerce' ),
				'type'        => 'number',
				'context'     => array( 'view', 'edit' ),
				'readonly'    => true,
				'format'      => 'currency',
			),
			'orders_count' => array(
				'description' => __( 'Number of orders.', 'woocommerce' ),
				'type'        => 'integer',
				'context'     => array( 'view', 'edit' ),
				'readonly'    => true,
			),
		);

		$segments = array(
			'segments' => array(
				'description' => __( 'Reports data grouped by segment condition.', 'woocommerce' ),
				'type'        => 'array',
				'context'     => array( 'view', 'edit' ),
				'readonly'    => true,
				'items'       => array(
					'type'       => 'object',
					'properties' => array(
						'segment_id'    => array(
							'description' => __( 'Segment identificator.', 'woocommerce' ),
							'type'        => 'integer',
							'context'     => array( 'view', 'edit' ),
							'readonly'    => true,
						),
						'segment_label' => array(
							'description' => __( 'Human readable segment label, either product or variation name.', 'woocommerce' ),
							'type'        => 'string',
							'context'     => array( 'view', 'edit' ),
							'readonly'    => true,
							'enum'        => array( 'day', 'week', 'month', 'year' ),
						),
						'subtotals'     => array(
							'description' => __( 'Interval subtotals.', 'woocommerce' ),
							'type'        => 'object',
							'context'     => array( 'view', 'edit' ),
							'readonly'    => true,
							'properties'  => $data_values,
						),
					),
				),
			),
		);

		$totals = array_merge( $data_values, $segments );

		$schema = array(
			'$schema'    => 'http://json-schema.org/draft-04/schema#',
			'title'      => 'report_products_stats',
			'type'       => 'object',
			'properties' => array(
				'totals'    => array(
					'description' => __( 'Totals data.', 'woocommerce' ),
					'type'        => 'object',
					'context'     => array( 'view', 'edit' ),
					'readonly'    => true,
					'properties'  => $totals,
				),
				'intervals' => array(
					'description' => __( 'Reports data grouped by intervals.', 'woocommerce' ),
					'type'        => 'array',
					'context'     => array( 'view', 'edit' ),
					'readonly'    => true,
					'items'       => array(
						'type'       => 'object',
						'properties' => array(
							'interval'       => array(
								'description' => __( 'Type of interval.', 'woocommerce' ),
								'type'        => 'string',
								'context'     => array( 'view', 'edit' ),
								'readonly'    => true,
								'enum'        => array( 'day', 'week', 'month', 'year' ),
							),
							'date_start'     => array(
								'description' => __( "The date the report start, in the site's timezone.", 'woocommerce' ),
								'type'        => 'date-time',
								'context'     => array( 'view', 'edit' ),
								'readonly'    => true,
							),
							'date_start_gmt' => array(
								'description' => __( 'The date the report start, as GMT.', 'woocommerce' ),
								'type'        => 'date-time',
								'context'     => array( 'view', 'edit' ),
								'readonly'    => true,
							),
							'date_end'       => array(
								'description' => __( "The date the report end, in the site's timezone.", 'woocommerce' ),
								'type'        => 'date-time',
								'context'     => array( 'view', 'edit' ),
								'readonly'    => true,
							),
							'date_end_gmt'   => array(
								'description' => __( 'The date the report end, as GMT.', 'woocommerce' ),
								'type'        => 'date-time',
								'context'     => array( 'view', 'edit' ),
								'readonly'    => true,
							),
							'subtotals'      => array(
								'description' => __( 'Interval subtotals.', 'woocommerce' ),
								'type'        => 'object',
								'context'     => array( 'view', 'edit' ),
								'readonly'    => true,
								'properties'  => $totals,
							),
						),
					),
				),
			),
		);

		return $this->add_additional_fields_schema( $schema );
	}

	/**
	 * Set the default results to 0 if API returns an empty array
	 *
	 * @param Mixed $results Report data.
	 * @return object
	 */
	public function set_default_report_data( $results ) {
		if ( empty( $results ) ) {
			$results                       = new \stdClass();
			$results->total                = 0;
			$results->totals               = new \stdClass();
			$results->totals->items_sold   = 0;
			$results->totals->net_revenue  = 0;
			$results->totals->orders_count = 0;
			$results->intervals            = array();
			$results->pages                = 1;
			$results->page_no              = 1;
		}
		return $results;
	}

	/**
	 * Get the query params for collections.
	 *
	 * @return array
	 */
	public function get_collection_params() {
		$params               = array();
		$params['context']    = $this->get_context_param( array( 'default' => 'view' ) );
		$params['page']       = array(
			'description'       => __( 'Current page of the collection.', 'woocommerce' ),
			'type'              => 'integer',
			'default'           => 1,
			'sanitize_callback' => 'absint',
			'validate_callback' => 'rest_validate_request_arg',
			'minimum'           => 1,
		);
		$params['per_page']   = array(
			'description'       => __( 'Maximum number of items to be returned in result set.', 'woocommerce' ),
			'type'              => 'integer',
			'default'           => 10,
			'minimum'           => 1,
			'maximum'           => 100,
			'sanitize_callback' => 'absint',
			'validate_callback' => 'rest_validate_request_arg',
		);
		$params['after']      = array(
			'description'       => __( 'Limit response to resources published after a given ISO8601 compliant date.', 'woocommerce' ),
			'type'              => 'string',
			'format'            => 'date-time',
			'validate_callback' => 'rest_validate_request_arg',
		);
		$params['before']     = array(
			'description'       => __( 'Limit response to resources published before a given ISO8601 compliant date.', 'woocommerce' ),
			'type'              => 'string',
			'format'            => 'date-time',
			'validate_callback' => 'rest_validate_request_arg',
		);
		$params['order']      = array(
			'description'       => __( 'Order sort attribute ascending or descending.', 'woocommerce' ),
			'type'              => 'string',
			'default'           => 'desc',
			'enum'              => array( 'asc', 'desc' ),
			'validate_callback' => 'rest_validate_request_arg',
		);
		$params['orderby']    = array(
			'description'       => __( 'Sort collection by object attribute.', 'woocommerce' ),
			'type'              => 'string',
			'default'           => 'date',
			'enum'              => array(
				'date',
				'net_revenue',
				'coupons',
				'refunds',
				'shipping',
				'taxes',
				'net_revenue',
				'orders_count',
				'items_sold',
			),
			'validate_callback' => 'rest_validate_request_arg',
		);
		$params['interval']   = array(
			'description'       => __( 'Time interval to use for buckets in the returned data.', 'woocommerce' ),
			'type'              => 'string',
			'default'           => 'week',
			'enum'              => array(
				'hour',
				'day',
				'week',
				'month',
				'quarter',
				'year',
			),
			'validate_callback' => 'rest_validate_request_arg',
		);
		$params['categories'] = array(
			'description'       => __( 'Limit result to items from the specified categories.', 'woocommerce' ),
			'type'              => 'array',
			'sanitize_callback' => 'wp_parse_id_list',
			'validate_callback' => 'rest_validate_request_arg',
			'items'             => array(
				'type' => 'integer',
			),
		);
		$params['products']   = array(
			'description'       => __( 'Limit result to items with specified product ids.', 'woocommerce' ),
			'type'              => 'array',
			'sanitize_callback' => 'wp_parse_id_list',
			'validate_callback' => 'rest_validate_request_arg',
			'items'             => array(
				'type' => 'integer',
			),
		);
		$params['variations'] = array(
			'description'       => __( 'Limit result to items with specified variation ids.', 'woocommerce' ),
			'type'              => 'array',
			'sanitize_callback' => 'wp_parse_id_list',
			'validate_callback' => 'rest_validate_request_arg',
			'items'             => array(
				'type' => 'integer',
			),
		);
		$params['segmentby']  = array(
			'description'       => __( 'Segment the response by additional constraint.', 'woocommerce' ),
			'type'              => 'string',
			'enum'              => array(
				'product',
				'category',
				'variation',
			),
			'validate_callback' => 'rest_validate_request_arg',
		);
		$params['fields']     = array(
			'description'       => __( 'Limit stats fields to the specified items.', 'woocommerce' ),
			'type'              => 'array',
			'sanitize_callback' => 'wp_parse_slug_list',
			'validate_callback' => 'rest_validate_request_arg',
			'items'             => array(
				'type' => 'string',
			),
		);

		return $params;
	}
}
woocommerce-admin/src/API/Taxes.php000064400000011570151335517650013165 0ustar00<?php
/**
 * REST API Taxes Controller
 *
 * Handles requests to /taxes/*
 */

namespace Automattic\WooCommerce\Admin\API;

defined( 'ABSPATH' ) || exit;

/**
 * Taxes controller.
 *
 * @extends WC_REST_Taxes_Controller
 */
class Taxes extends \WC_REST_Taxes_Controller {

	/**
	 * Endpoint namespace.
	 *
	 * @var string
	 */
	protected $namespace = 'wc-analytics';

	/**
	 * Get the query params for collections.
	 *
	 * @return array
	 */
	public function get_collection_params() {
		$params            = parent::get_collection_params();
		$params['search']  = array(
			'description'       => __( 'Search by similar tax code.', 'woocommerce' ),
			'type'              => 'string',
			'validate_callback' => 'rest_validate_request_arg',
		);
		$params['include'] = array(
			'description'       => __( 'Limit result set to items that have the specified rate ID(s) assigned.', 'woocommerce' ),
			'type'              => 'array',
			'items'             => array(
				'type' => 'integer',
			),
			'default'           => array(),
			'validate_callback' => 'rest_validate_request_arg',
		);
		return $params;
	}

	/**
	 * Get all taxes and allow filtering by tax code.
	 *
	 * @param WP_REST_Request $request Full details about the request.
	 * @return WP_Error|WP_REST_Response
	 */
	public function get_items( $request ) {
		global $wpdb;

		$prepared_args           = array();
		$prepared_args['order']  = $request['order'];
		$prepared_args['number'] = $request['per_page'];
		if ( ! empty( $request['offset'] ) ) {
			$prepared_args['offset'] = $request['offset'];
		} else {
			$prepared_args['offset'] = ( $request['page'] - 1 ) * $prepared_args['number'];
		}
		$orderby_possibles        = array(
			'id'    => 'tax_rate_id',
			'order' => 'tax_rate_order',
		);
		$prepared_args['orderby'] = $orderby_possibles[ $request['orderby'] ];
		$prepared_args['class']   = $request['class'];
		$prepared_args['search']  = $request['search'];
		$prepared_args['include'] = $request['include'];

		/**
		 * Filter arguments, before passing to $wpdb->get_results(), when querying taxes via the REST API.
		 *
		 * @param array           $prepared_args Array of arguments for $wpdb->get_results().
		 * @param WP_REST_Request $request       The current request.
		 */
		$prepared_args = apply_filters( 'woocommerce_rest_tax_query', $prepared_args, $request );

		$query = "
			SELECT *
			FROM {$wpdb->prefix}woocommerce_tax_rates
			WHERE 1 = 1
		";

		// Filter by tax class.
		if ( ! empty( $prepared_args['class'] ) ) {
			$class  = 'standard' !== $prepared_args['class'] ? sanitize_title( $prepared_args['class'] ) : '';
			$query .= " AND tax_rate_class = '$class'";
		}

		// Filter by tax code.
		$tax_code_search = $prepared_args['search'];
		if ( $tax_code_search ) {
			$code_like = '%' . $wpdb->esc_like( $tax_code_search ) . '%';
			$query    .= $wpdb->prepare( ' AND CONCAT_WS( "-", NULLIF(tax_rate_country, ""), NULLIF(tax_rate_state, ""), NULLIF(tax_rate_name, ""), NULLIF(tax_rate_priority, "") ) LIKE %s', $code_like );
		}

		// Filter by included tax rate IDs.
		$included_taxes = $prepared_args['include'];
		if ( ! empty( $included_taxes ) ) {
			$included_taxes = implode( ',', $prepared_args['include'] );
			$query         .= " AND tax_rate_id IN ({$included_taxes})";
		}

		// Order tax rates.
		$order_by = sprintf( ' ORDER BY %s', sanitize_key( $prepared_args['orderby'] ) );

		// Pagination.
		$pagination = sprintf( ' LIMIT %d, %d', $prepared_args['offset'], $prepared_args['number'] );

		// Query taxes.
		$results = $wpdb->get_results( $query . $order_by . $pagination ); // @codingStandardsIgnoreLine.

		$taxes = array();
		foreach ( $results as $tax ) {
			$data    = $this->prepare_item_for_response( $tax, $request );
			$taxes[] = $this->prepare_response_for_collection( $data );
		}

		$response = rest_ensure_response( $taxes );

		// Store pagination values for headers then unset for count query.
		$per_page = (int) $prepared_args['number'];
		$page     = ceil( ( ( (int) $prepared_args['offset'] ) / $per_page ) + 1 );

		// Query only for ids.
		$wpdb->get_results( str_replace( 'SELECT *', 'SELECT tax_rate_id', $query ) ); // @codingStandardsIgnoreLine.

		// Calculate totals.
		$total_taxes = (int) $wpdb->num_rows;
		$response->header( 'X-WP-Total', (int) $total_taxes );
		$max_pages = ceil( $total_taxes / $per_page );
		$response->header( 'X-WP-TotalPages', (int) $max_pages );

		$base = add_query_arg( $request->get_query_params(), rest_url( sprintf( '/%s/%s', $this->namespace, $this->rest_base ) ) );
		if ( $page > 1 ) {
			$prev_page = $page - 1;
			if ( $prev_page > $max_pages ) {
				$prev_page = $max_pages;
			}
			$prev_link = add_query_arg( 'page', $prev_page, $base );
			$response->link_header( 'prev', $prev_link );
		}
		if ( $max_pages > $page ) {
			$next_page = $page + 1;
			$next_link = add_query_arg( 'page', $next_page, $base );
			$response->link_header( 'next', $next_link );
		}

		return $response;
	}
}
woocommerce-admin/src/API/NavigationFavorites.php000064400000020115151335517650016056 0ustar00<?php
/**
 * REST API Navigation Favorites controller
 *
 * Handles requests to the navigation favorites endpoint
 */

namespace Automattic\WooCommerce\Admin\API;

defined( 'ABSPATH' ) || exit;

use Automattic\WooCommerce\Admin\Features\Navigation\Favorites;

/**
 * REST API Favorites controller class.
 *
 * @extends WC_REST_CRUD_Controller
 */
class NavigationFavorites extends \WC_REST_Data_Controller {

	/**
	 * Endpoint namespace.
	 *
	 * @var string
	 */
	protected $namespace = 'wc-admin';

	/**
	 * Route base.
	 *
	 * @var string
	 */
	protected $rest_base = 'navigation/favorites';

	/**
	 * Error code to status code mapping.
	 *
	 * @var array
	 */
	protected $error_to_status_map = array(
		'woocommerce_favorites_invalid_request' => 400,
		'woocommerce_favorites_already_exists'  => 409,
		'woocommerce_favorites_does_not_exist'  => 404,
		'woocommerce_favorites_invalid_user'    => 400,
		'woocommerce_favorites_unauthenticated' => 401,
	);

	/**
	 * Register the routes
	 */
	public function register_routes() {
		register_rest_route(
			$this->namespace,
			'/' . $this->rest_base,
			array(
				array(
					'methods'             => \WP_REST_Server::READABLE,
					'callback'            => array( $this, 'get_items' ),
					'permission_callback' => array( $this, 'get_items_permissions_check' ),
					'args'                => array(
						'user_id' => array(
							'required'          => true,
							'validate_callback' => function( $param, $request, $key ) {
								return is_numeric( $param );
							},
						),
					),
				),
				array(
					'methods'             => \WP_REST_Server::CREATABLE,
					'callback'            => array( $this, 'add_item' ),
					'permission_callback' => array( $this, 'add_item_permissions_check' ),
					'args'                => array(
						'item_id' => array(
							'required' => true,
						),
						'user_id' => array(
							'required'          => true,
							'validate_callback' => function( $param, $request, $key ) {
								return is_numeric( $param );
							},
						),
					),
				),
				array(
					'methods'             => \WP_REST_Server::DELETABLE,
					'callback'            => array( $this, 'delete_item' ),
					'permission_callback' => array( $this, 'delete_item_permissions_check' ),
					'args'                => array(
						'item_id' => array(
							'required' => true,
						),
						'user_id' => array(
							'required'          => true,
							'validate_callback' => function( $param, $request, $key ) {
								return is_numeric( $param );
							},
						),
					),
				),
				'schema' => array( $this, 'get_public_item_schema' ),
			)
		);

		register_rest_route(
			$this->namespace,
			'/' . $this->rest_base . '/me',
			array(
				array(
					'methods'             => \WP_REST_Server::READABLE,
					'callback'            => array( $this, 'get_items_by_current_user' ),
					'permission_callback' => array( $this, 'current_user_permissions_check' ),
				),
				array(
					'methods'             => \WP_REST_Server::CREATABLE,
					'callback'            => array( $this, 'add_item_by_current_user' ),
					'permission_callback' => array( $this, 'current_user_permissions_check' ),
					'args'                => array(
						'item_id' => array(
							'required' => true,
						),
					),
				),
				array(
					'methods'             => \WP_REST_Server::DELETABLE,
					'callback'            => array( $this, 'delete_item_by_current_user' ),
					'permission_callback' => array( $this, 'current_user_permissions_check' ),
					'args'                => array(
						'item_id' => array(
							'required' => true,
						),
					),
				),
				'schema' => array( $this, 'get_public_item_schema' ),
			)
		);

	}

	/**
	 * Get all favorites.
	 *
	 * @param WP_REST_Request $request Request data.
	 * @return WP_REST_Response
	 */
	public function get_items( $request ) {
		$user_id = $request->get_param( 'user_id' );

		$response = Favorites::get_all( $user_id );

		if ( is_wp_error( $response ) || ! $response ) {
			return rest_ensure_response( $this->prepare_error( $response ) );
		}

		return rest_ensure_response(
			array_map( 'stripslashes', $response )
		);
	}

	/**
	 * Get all favorites of current user.
	 *
	 * @param WP_REST_Request $request Request data.
	 * @return WP_REST_Response
	 */
	public function get_items_by_current_user( $request ) {
		$current_user = get_current_user_id();

		if ( ! $current_user ) {
			return $this->prepare_error(
				new \WP_Error(
					'woocommerce_favorites_unauthenticated',
					__( 'You must be authenticated to use this endpoint', 'woocommerce' )
				)
			);
		}

		$request->set_param( 'user_id', $current_user );

		return $this->get_items( $request );
	}

	/**
	 * Add a favorite.
	 *
	 * @param WP_REST_Request $request Request data.
	 * @return WP_REST_Response
	 */
	public function add_item( $request ) {
		$user_id = $request->get_param( 'user_id' );
		$fav_id  = $request->get_param( 'item_id' );
		$user    = get_userdata( $user_id );

		if ( false === $user ) {
			return $this->prepare_error(
				new \WP_Error(
					'woocommerce_favorites_invalid_user',
					__( 'Invalid user_id provided', 'woocommerce' )
				)
			);
		}

		$response = Favorites::add_item( $fav_id, $user_id );

		if ( is_wp_error( $response ) || ! $response ) {
			return rest_ensure_response( $this->prepare_error( $response ) );
		}

		return rest_ensure_response( Favorites::get_all( $user_id ) );
	}

	/**
	 * Add a favorite for current user.
	 *
	 * @param WP_REST_Request $request Request data.
	 * @return WP_REST_Response
	 */
	public function add_item_by_current_user( $request ) {
		$current_user = get_current_user_id();

		if ( ! $current_user ) {
			return $this->prepare_error(
				new \WP_Error(
					'woocommerce_favorites_unauthenticated',
					__( 'You must be authenticated to use this endpoint', 'woocommerce' )
				)
			);
		}

		$request->set_param( 'user_id', get_current_user_id() );
		return $this->add_item( $request );
	}

	/**
	 * Delete a favorite.
	 *
	 * @param WP_REST_Request $request Request data.
	 * @return WP_REST_Response
	 */
	public function delete_item( $request ) {
		$user_id = $request->get_param( 'user_id' );
		$fav_id  = $request->get_param( 'item_id' );

		$response = Favorites::remove_item( $fav_id, $user_id );

		if ( is_wp_error( $response ) || ! $response ) {
			return rest_ensure_response( $this->prepare_error( $response ) );
		}

		return rest_ensure_response( Favorites::get_all( $user_id ) );
	}

	/**
	 * Delete a favorite for current user.
	 *
	 * @param WP_REST_Request $request Request data.
	 * @return WP_REST_Response
	 */
	public function delete_item_by_current_user( $request ) {
		$current_user = get_current_user_id();

		if ( ! $current_user ) {
			return $this->prepare_error(
				new \WP_Error(
					'woocommerce_favorites_unauthenticated',
					__( 'You must be authenticated to use this endpoint', 'woocommerce' )
				)
			);
		}

		$request->set_param( 'user_id', $current_user );

		return $this->delete_item( $request );
	}


	/**
	 * Check whether a given request has permission to create favorites.
	 *
	 * @param  WP_REST_Request $request Full details about the request.
	 * @return WP_Error|boolean
	 */
	public function add_item_permissions_check( $request ) {
		return current_user_can( 'edit_users' );
	}

	/**
	 * Check whether a given request has permission to delete notes.
	 *
	 * @param  WP_REST_Request $request Full details about the request.
	 * @return WP_Error|boolean
	 */
	public function delete_item_permissions_check( $request ) {
		return current_user_can( 'edit_users' );
	}

	/**
	 * Always allow for operations that only impact current user
	 *
	 * @param  WP_REST_Request $request Full details about the request.
	 * @return WP_Error|boolean
	 */
	public function current_user_permissions_check( $request ) {
		return true;
	}

	/**
	 * Accept an instance of WP_Error and add the appropriate data for REST transit.
	 *
	 * @param  WP_Error $error Error to prepare.
	 * @return WP_Error
	 */
	protected function prepare_error( $error ) {
		if ( ! is_wp_error( $error ) ) {
			return $error;
		}

		$error->add_data(
			array(
				'status' => $this->error_to_status_map[ $error->get_error_code() ] ?? 500,
			)
		);

		return $error;
	}

}
woocommerce-admin/src/API/ProductAttributes.php000064400000010710151335517650015563 0ustar00<?php
/**
 * REST API Product Attributes Controller
 *
 * Handles requests to /products/attributes.
 */

namespace Automattic\WooCommerce\Admin\API;

defined( 'ABSPATH' ) || exit;

/**
 * Product categories controller.
 *
 * @extends WC_REST_Product_Attributes_Controller
 */
class ProductAttributes extends \WC_REST_Product_Attributes_Controller {
	use CustomAttributeTraits;

	/**
	 * Endpoint namespace.
	 *
	 * @var string
	 */
	protected $namespace = 'wc-analytics';

	/**
	 * Register the routes for custom product attributes.
	 */
	public function register_routes() {
		parent::register_routes();

		register_rest_route(
			$this->namespace,
			'products/attributes/(?P<slug>[a-z0-9_\-]+)',
			array(
				'args'   => array(
					'slug' => array(
						'description' => __( 'Slug identifier for the resource.', 'woocommerce' ),
						'type'        => 'string',
					),
				),
				array(
					'methods'             => \WP_REST_Server::READABLE,
					'callback'            => array( $this, 'get_item_by_slug' ),
					'permission_callback' => array( $this, 'get_items_permissions_check' ),
				),
				'schema' => array( $this, 'get_public_item_schema' ),
			)
		);
	}

	/**
	 * Get the query params for collections
	 *
	 * @return array
	 */
	public function get_collection_params() {
		$params           = parent::get_collection_params();
		$params['search'] = array(
			'description'       => __( 'Search by similar attribute name.', 'woocommerce' ),
			'type'              => 'string',
			'validate_callback' => 'rest_validate_request_arg',
		);

		return $params;
	}

	/**
	 * Get the Attribute's schema, conforming to JSON Schema.
	 *
	 * @return array
	 */
	public function get_item_schema() {
		$schema = parent::get_item_schema();
		// Custom attributes substitute slugs for numeric IDs.
		$schema['properties']['id']['type'] = array( 'integer', 'string' );

		return $schema;
	}

	/**
	 * Get a single attribute by it's slug.
	 *
	 * @param WP_REST_Request $request The API request.
	 * @return WP_REST_Response
	 */
	public function get_item_by_slug( $request ) {
		if ( empty( $request['slug'] ) ) {
			return array();
		}

		$attributes = $this->get_custom_attribute_by_slug( $request['slug'] );

		if ( is_wp_error( $attributes ) ) {
			return $attributes;
		}

		$response_items = $this->format_custom_attribute_items_for_response( $attributes );

		return reset( $response_items );
	}

	/**
	 * Format custom attribute items for response (mimic the structure of a taxonomy - backed attribute).
	 *
	 * @param array $custom_attributes - CustomAttributeTraits::get_custom_attributes().
	 * @return array
	 */
	public function format_custom_attribute_items_for_response( $custom_attributes ) {
		$response = array();

		foreach ( $custom_attributes as $attribute_key => $attribute_value ) {
			$data = array(
				'id'           => $attribute_key,
				'name'         => $attribute_value['name'],
				'slug'         => $attribute_key,
				'type'         => 'select',
				'order_by'     => 'menu_order',
				'has_archives' => false,
			);

			$item_response = rest_ensure_response( $data );
			$item_response->add_links( $this->prepare_links( (object) array( 'attribute_id' => $attribute_key ) ) );
			$item_response = $this->prepare_response_for_collection(
				$item_response
			);

			$response[] = $item_response;
		}

		return $response;
	}

	/**
	 * Get all attributes, with support for searching (which includes custom attributes).
	 *
	 * @param WP_REST_Request $request The API request.
	 * @return WP_REST_Response
	 */
	public function get_items( $request ) {
		if ( empty( $request['search'] ) ) {
			return parent::get_items( $request );
		}

		$search_string       = $request['search'];
		$custom_attributes   = $this->get_custom_attributes( array( 'name' => $search_string ) );
		$matching_attributes = $this->format_custom_attribute_items_for_response( $custom_attributes );
		$taxonomy_attributes = wc_get_attribute_taxonomies();

		foreach ( $taxonomy_attributes as $attribute_obj ) {
			// Skip taxonomy attributes that didn't match the query.
			if ( false === stripos( $attribute_obj->attribute_label, $search_string ) ) {
				continue;
			}

			$attribute             = $this->prepare_item_for_response( $attribute_obj, $request );
			$matching_attributes[] = $this->prepare_response_for_collection( $attribute );
		}

		$response = rest_ensure_response( $matching_attributes );
		$response->header( 'X-WP-Total', count( $matching_attributes ) );
		$response->header( 'X-WP-TotalPages', 1 );

		return $response;
	}
}
woocommerce-admin/src/API/Customers.php000064400000004146151335517650014066 0ustar00<?php
/**
 * REST API Customers Controller
 *
 * Handles requests to /customers/*
 */

namespace Automattic\WooCommerce\Admin\API;

defined( 'ABSPATH' ) || exit;

/**
 * Customers controller.
 *
 * @extends \Automattic\WooCommerce\Admin\API\Reports\Customers\Controller
 */
class Customers extends \Automattic\WooCommerce\Admin\API\Reports\Customers\Controller {

	/**
	 * Route base.
	 *
	 * @var string
	 */
	protected $rest_base = 'customers';

	/**
	 * Register the routes for customers.
	 */
	public function register_routes() {
		register_rest_route(
			$this->namespace,
			'/' . $this->rest_base,
			array(
				array(
					'methods'             => \WP_REST_Server::READABLE,
					'callback'            => array( $this, 'get_items' ),
					'permission_callback' => array( $this, 'get_items_permissions_check' ),
					'args'                => $this->get_collection_params(),
				),
				'schema' => array( $this, 'get_public_item_schema' ),
			)
		);

		register_rest_route(
			$this->namespace,
			'/' . $this->rest_base . '/(?P<id>[\d-]+)',
			array(
				'args'   => array(
					'id' => array(
						'description' => __( 'Unique ID for the resource.', 'woocommerce' ),
						'type'        => 'integer',
					),
				),
				array(
					'methods'             => \WP_REST_Server::READABLE,
					'callback'            => array( $this, 'get_item' ),
					'permission_callback' => array( $this, 'get_items_permissions_check' ),
					'args'                => $this->get_collection_params(),
				),
				'schema' => array( $this, 'get_public_item_schema' ),
			)
		);
	}

	/**
	 * Maps query arguments from the REST request.
	 *
	 * @param array $request Request array.
	 * @return array
	 */
	protected function prepare_reports_query( $request ) {
		$args              = parent::prepare_reports_query( $request );
		$args['customers'] = $request['include'];
		return $args;
	}

	/**
	 * Get the query params for collections.
	 *
	 * @return array
	 */
	public function get_collection_params() {
		$params            = parent::get_collection_params();
		$params['include'] = $params['customers'];
		unset( $params['customers'] );
		return $params;
	}
}
woocommerce-admin/src/API/Plugins.php000064400000055336151335517650013532 0ustar00<?php
/**
 * REST API Plugins Controller
 *
 * Handles requests to install and activate depedent plugins.
 */

namespace Automattic\WooCommerce\Admin\API;

use Automattic\WooCommerce\Admin\Features\Onboarding;
use Automattic\WooCommerce\Admin\PaymentPlugins;
use Automattic\WooCommerce\Admin\PluginsHelper;
use \Automattic\WooCommerce\Admin\Notes\InstallJPAndWCSPlugins;

defined( 'ABSPATH' ) || exit;

/**
 * Plugins Controller.
 *
 * @extends WC_REST_Data_Controller
 */
class Plugins extends \WC_REST_Data_Controller {
	/**
	 * Endpoint namespace.
	 *
	 * @var string
	 */
	protected $namespace = 'wc-admin';

	/**
	 * Route base.
	 *
	 * @var string
	 */
	protected $rest_base = 'plugins';

	/**
	 * Register routes.
	 */
	public function register_routes() {
		register_rest_route(
			$this->namespace,
			'/' . $this->rest_base . '/install',
			array(
				array(
					'methods'             => \WP_REST_Server::EDITABLE,
					'callback'            => array( $this, 'install_plugins' ),
					'permission_callback' => array( $this, 'update_item_permissions_check' ),
				),
				'schema' => array( $this, 'get_item_schema' ),
			)
		);

		register_rest_route(
			$this->namespace,
			'/' . $this->rest_base . '/active',
			array(
				array(
					'methods'             => \WP_REST_Server::READABLE,
					'callback'            => array( $this, 'active_plugins' ),
					'permission_callback' => array( $this, 'get_item_permissions_check' ),
				),
				'schema' => array( $this, 'get_item_schema' ),
			)
		);

		register_rest_route(
			$this->namespace,
			'/' . $this->rest_base . '/installed',
			array(
				array(
					'methods'             => \WP_REST_Server::READABLE,
					'callback'            => array( $this, 'installed_plugins' ),
					'permission_callback' => array( $this, 'get_item_permissions_check' ),
				),
				'schema' => array( $this, 'get_item_schema' ),
			)
		);

		register_rest_route(
			$this->namespace,
			'/' . $this->rest_base . '/activate',
			array(
				array(
					'methods'             => \WP_REST_Server::EDITABLE,
					'callback'            => array( $this, 'activate_plugins' ),
					'permission_callback' => array( $this, 'update_item_permissions_check' ),
				),
				'schema' => array( $this, 'get_item_schema' ),
			)
		);

		register_rest_route(
			$this->namespace,
			'/' . $this->rest_base . '/recommended-payment-plugins',
			array(
				array(
					'methods'             => \WP_REST_Server::READABLE,
					'callback'            => array( $this, 'recommended_payment_plugins' ),
					'permission_callback' => array( $this, 'get_item_permissions_check' ),
				),
				'schema' => array( $this, 'get_item_schema' ),
			)
		);

		register_rest_route(
			$this->namespace,
			'/' . $this->rest_base . '/connect-jetpack',
			array(
				array(
					'methods'             => \WP_REST_Server::READABLE,
					'callback'            => array( $this, 'connect_jetpack' ),
					'permission_callback' => array( $this, 'update_item_permissions_check' ),
				),
				'schema' => array( $this, 'get_connect_schema' ),
			)
		);

		register_rest_route(
			$this->namespace,
			'/' . $this->rest_base . '/request-wccom-connect',
			array(
				array(
					'methods'             => 'POST',
					'callback'            => array( $this, 'request_wccom_connect' ),
					'permission_callback' => array( $this, 'update_item_permissions_check' ),
				),
				'schema' => array( $this, 'get_connect_schema' ),
			)
		);

		register_rest_route(
			$this->namespace,
			'/' . $this->rest_base . '/finish-wccom-connect',
			array(
				array(
					'methods'             => 'POST',
					'callback'            => array( $this, 'finish_wccom_connect' ),
					'permission_callback' => array( $this, 'update_item_permissions_check' ),
				),
				'schema' => array( $this, 'get_connect_schema' ),
			)
		);

		register_rest_route(
			$this->namespace,
			'/' . $this->rest_base . '/connect-wcpay',
			array(
				array(
					'methods'             => \WP_REST_Server::EDITABLE,
					'callback'            => array( $this, 'connect_wcpay' ),
					'permission_callback' => array( $this, 'update_item_permissions_check' ),
				),
				'schema' => array( $this, 'get_connect_schema' ),
			)
		);

		register_rest_route(
			$this->namespace,
			'/' . $this->rest_base . '/connect-square',
			array(
				array(
					'methods'             => \WP_REST_Server::EDITABLE,
					'callback'            => array( $this, 'connect_square' ),
					'permission_callback' => array( $this, 'update_item_permissions_check' ),
				),
				'schema' => array( $this, 'get_connect_schema' ),
			)
		);
	}

	/**
	 * Check if a given request has access to manage plugins.
	 *
	 * @param  WP_REST_Request $request Full details about the request.
	 * @return WP_Error|boolean
	 */
	public function update_item_permissions_check( $request ) {
		if ( ! current_user_can( 'install_plugins' ) ) {
			return new \WP_Error( 'woocommerce_rest_cannot_update', __( 'Sorry, you cannot manage plugins.', 'woocommerce' ), array( 'status' => rest_authorization_required_code() ) );
		}
		return true;
	}

	/**
	 * Create an alert notification in response to an error installing a plugin.
	 *
	 * @todo This should be moved to a filter to make this API more generic and less plugin-specific.
	 *
	 * @param string $slug The slug of the plugin being installed.
	 */
	private function create_install_plugin_error_inbox_notification_for_jetpack_installs( $slug ) {
		// Exit early if we're not installing the Jetpack or the WooCommerce Shipping & Tax plugins.
		if ( 'jetpack' !== $slug && 'woocommerce-services' !== $slug ) {
			return;
		}

		InstallJPAndWCSPlugins::possibly_add_note();
	}

	/**
	 * Install the requested plugin.
	 *
	 * @param  WP_REST_Request $request Full details about the request.
	 * @return WP_Error|array Plugin Status
	 */
	public function install_plugin( $request ) {
		wc_deprecated_function( 'install_plugin', '4.3', '\Automattic\WooCommerce\Admin\API\Plugins()->install_plugins' );
		// This method expects a `plugin` argument to be sent, install plugins requires plugins.
		$request['plugins'] = $request['plugin'];
		return self::install_plugins( $request );
	}

	/**
	 * Installs the requested plugins.
	 *
	 * @param  WP_REST_Request $request Full details about the request.
	 * @return WP_Error|array Plugin Status
	 */
	public function install_plugins( $request ) {
		$plugins = explode( ',', $request['plugins'] );

		/**
		 * Filter the list of plugins to install.
		 *
		 * @param array $plugins A list of the plugins to install.
		 */
		$plugins = apply_filters( 'woocommerce_admin_plugins_pre_install', $plugins );

		if ( empty( $request['plugins'] ) || ! is_array( $plugins ) ) {
			return new \WP_Error( 'woocommerce_rest_invalid_plugins', __( 'Plugins must be a non-empty array.', 'woocommerce' ), 404 );
		}

		require_once ABSPATH . 'wp-admin/includes/plugin.php';
		include_once ABSPATH . '/wp-admin/includes/admin.php';
		include_once ABSPATH . '/wp-admin/includes/plugin-install.php';
		include_once ABSPATH . '/wp-admin/includes/plugin.php';
		include_once ABSPATH . '/wp-admin/includes/class-wp-upgrader.php';
		include_once ABSPATH . '/wp-admin/includes/class-plugin-upgrader.php';

		$existing_plugins  = PluginsHelper::get_installed_plugins_paths();
		$installed_plugins = array();
		$results           = array();
		$errors            = new \WP_Error();

		foreach ( $plugins as $plugin ) {
			$slug = sanitize_key( $plugin );

			if ( isset( $existing_plugins[ $slug ] ) ) {
				$installed_plugins[] = $plugin;
				continue;
			}

			$api = plugins_api(
				'plugin_information',
				array(
					'slug'   => $slug,
					'fields' => array(
						'sections' => false,
					),
				)
			);

			if ( is_wp_error( $api ) ) {
				$properties = array(
					/* translators: %s: plugin slug (example: woocommerce-services) */
					'error_message' => __( 'The requested plugin `%s` could not be installed. Plugin API call failed.', 'woocommerce' ),
					'api'           => $api,
					'slug'          => $slug,
				);
				wc_admin_record_tracks_event( 'install_plugin_error', $properties );

				$this->create_install_plugin_error_inbox_notification_for_jetpack_installs( $slug );

				$errors->add(
					$plugin,
					sprintf(
						/* translators: %s: plugin slug (example: woocommerce-services) */
						__( 'The requested plugin `%s` could not be installed. Plugin API call failed.', 'woocommerce' ),
						$slug
					)
				);

				continue;
			}

			$upgrader           = new \Plugin_Upgrader( new \Automatic_Upgrader_Skin() );
			$result             = $upgrader->install( $api->download_link );
			$results[ $plugin ] = $result;

			if ( is_wp_error( $result ) || is_null( $result ) ) {
				$properties = array(
					/* translators: %s: plugin slug (example: woocommerce-services) */
					'error_message' => __( 'The requested plugin `%s` could not be installed.', 'woocommerce' ),
					'slug'          => $slug,
					'api'           => $api,
					'upgrader'      => $upgrader,
					'result'        => $result,
				);
				wc_admin_record_tracks_event( 'install_plugin_error', $properties );

				$this->create_install_plugin_error_inbox_notification_for_jetpack_installs( $slug );

				$errors->add(
					$plugin,
					sprintf(
						/* translators: %s: plugin slug (example: woocommerce-services) */
						__( 'The requested plugin `%s` could not be installed. Upgrader install failed.', 'woocommerce' ),
						$slug
					)
				);
				continue;
			}

			$installed_plugins[] = $plugin;
		}

		return array(
			'data'    => array(
				'installed' => $installed_plugins,
				'results'   => $results,
			),
			'errors'  => $errors,
			'success' => count( $errors->errors ) === 0,
			'message' => count( $errors->errors ) === 0
				? __( 'Plugins were successfully installed.', 'woocommerce' )
				: __( 'There was a problem installing some of the requested plugins.', 'woocommerce' ),
		);
	}

	/**
	 * Returns a list of active plugins in API format.
	 *
	 * @return array Active plugins
	 */
	public static function active_plugins() {
		return( array(
			'plugins' => array_values( PluginsHelper::get_active_plugin_slugs() ),
		) );
	}
	/**
	 * Returns a list of active plugins.
	 *
	 * @return array Active plugins
	 */
	public static function get_active_plugins() {
		$data = self::active_plugins();
		return $data['plugins'];
	}

	/**
	 * Returns a list of installed plugins.
	 *
	 * @return array Installed plugins
	 */
	public function installed_plugins() {
		return( array(
			'plugins' => PluginsHelper::get_installed_plugin_slugs(),
		) );
	}

	/**
	 * Activate the requested plugin.
	 *
	 * @param  WP_REST_Request $request Full details about the request.
	 * @return WP_Error|array Plugin Status
	 */
	public function activate_plugins( $request ) {
		$plugin_paths      = PluginsHelper::get_installed_plugins_paths();
		$plugins           = explode( ',', $request['plugins'] );
		$errors            = new \WP_Error();
		$activated_plugins = array();

		if ( empty( $request['plugins'] ) || ! is_array( $plugins ) ) {
			return new \WP_Error( 'woocommerce_rest_invalid_plugins', __( 'Plugins must be a non-empty array.', 'woocommerce' ), 404 );
		}

		require_once ABSPATH . 'wp-admin/includes/plugin.php';

		// the mollie-payments-for-woocommerce plugin calls `WP_Filesystem()` during it's activation hook, which crashes without this include.
		require_once ABSPATH . 'wp-admin/includes/file.php';

		/**
		 * Filter the list of plugins to activate.
		 *
		 * @param array $plugins A list of the plugins to activate.
		 */
		$plugins = apply_filters( 'woocommerce_admin_plugins_pre_activate', $plugins );

		foreach ( $plugins as $plugin ) {
			$slug = $plugin;
			$path = isset( $plugin_paths[ $slug ] ) ? $plugin_paths[ $slug ] : false;

			if ( ! $path ) {
				$errors->add(
					$plugin,
					/* translators: %s: plugin slug (example: woocommerce-services) */
					sprintf( __( 'The requested plugin `%s`. is not yet installed.', 'woocommerce' ), $slug )
				);
				continue;
			}

			$result = activate_plugin( $path );
			if ( ! is_null( $result ) ) {
				$this->create_install_plugin_error_inbox_notification_for_jetpack_installs( $slug );

				$errors->add(
					$plugin,
					/* translators: %s: plugin slug (example: woocommerce-services) */
					sprintf( __( 'The requested plugin `%s` could not be activated.', 'woocommerce' ), $slug )
				);
				continue;
			}

			$activated_plugins[] = $plugin;
		}

		return( array(
			'data'    => array(
				'activated' => $activated_plugins,
				'active'    => self::get_active_plugins(),
			),
			'errors'  => $errors,
			'success' => count( $errors->errors ) === 0,
			'message' => count( $errors->errors ) === 0
				? __( 'Plugins were successfully activated.', 'woocommerce' )
				: __( 'There was a problem activating some of the requested plugins.', 'woocommerce' ),
		) );
	}

	/**
	 * Return recommended payment plugins.
	 *
	 * @param WP_REST_Request $request Full details about the request.
	 * @return \WP_Error|\WP_HTTP_Response|\WP_REST_Response
	 */
	public function recommended_payment_plugins( $request ) {
		// Default to marketing category (if no category set).
		$all_plugins   = PaymentPlugins::get_instance()->get_recommended_plugins();
		$valid_plugins = [];
		$per_page      = $request->get_param( 'per_page' );
		// We currently only support English suggestions, unless otherwise provided in locale-data.
		$locale             = get_locale();
		$suggestion_locales = array(
			'en_AU',
			'en_CA',
			'en_GB',
			'en_NZ',
			'en_US',
			'en_ZA',
		);

		foreach ( $all_plugins as $plugin ) {
			if ( ! PluginsHelper::is_plugin_active( $plugin['product'] ) ) {
				if ( isset( $plugin['locale-data'] ) && isset( $plugin['locale-data'][ $locale ] ) ) {
					$locale_plugin = array_merge( $plugin, $plugin['locale-data'][ $locale ] );
					unset( $locale_plugin['locale-data'] );
					$valid_plugins[]      = $locale_plugin;
					$suggestion_locales[] = $locale;
				} else {
					$valid_plugins[] = $plugin;
				}
			}
		}

		if ( ! in_array( $locale, $suggestion_locales, true ) ) {
			// If not a supported locale we return an empty array.
			return rest_ensure_response( array() );
		}

		return rest_ensure_response( array_slice( $valid_plugins, 0, $per_page ) );
	}

	/**
	 * Generates a Jetpack Connect URL.
	 *
	 * @param  WP_REST_Request $request Full details about the request.
	 * @return WP_Error|array Connection URL for Jetpack
	 */
	public function connect_jetpack( $request ) {
		if ( ! class_exists( '\Jetpack' ) ) {
			return new \WP_Error( 'woocommerce_rest_jetpack_not_active', __( 'Jetpack is not installed or active.', 'woocommerce' ), 404 );
		}

		$redirect_url = apply_filters( 'woocommerce_admin_onboarding_jetpack_connect_redirect_url', esc_url_raw( $request['redirect_url'] ) );
		$connect_url  = \Jetpack::init()->build_connect_url( true, $redirect_url, 'woocommerce-onboarding' );

		$calypso_env = defined( 'WOOCOMMERCE_CALYPSO_ENVIRONMENT' ) && in_array( WOOCOMMERCE_CALYPSO_ENVIRONMENT, array( 'development', 'wpcalypso', 'horizon', 'stage' ), true ) ? WOOCOMMERCE_CALYPSO_ENVIRONMENT : 'production';
		$connect_url = add_query_arg( array( 'calypso_env' => $calypso_env ), $connect_url );

		return( array(
			'slug'          => 'jetpack',
			'name'          => __( 'Jetpack', 'woocommerce' ),
			'connectAction' => $connect_url,
		) );
	}

	/**
	 *  Kicks off the WCCOM Connect process.
	 *
	 * @return WP_Error|array Connection URL for WooCommerce.com
	 */
	public function request_wccom_connect() {
		include_once WC_ABSPATH . 'includes/admin/helper/class-wc-helper-api.php';
		if ( ! class_exists( 'WC_Helper_API' ) ) {
			return new \WP_Error( 'woocommerce_rest_helper_not_active', __( 'There was an error loading the WooCommerce.com Helper API.', 'woocommerce' ), 404 );
		}

		$redirect_uri = wc_admin_url( '&task=connect&wccom-connected=1' );

		$request = \WC_Helper_API::post(
			'oauth/request_token',
			array(
				'body' => array(
					'home_url'     => home_url(),
					'redirect_uri' => $redirect_uri,
				),
			)
		);

		$code = wp_remote_retrieve_response_code( $request );
		if ( 200 !== $code ) {
			return new \WP_Error( 'woocommerce_rest_helper_connect', __( 'There was an error connecting to WooCommerce.com. Please try again.', 'woocommerce' ), 500 );
		}

		$secret = json_decode( wp_remote_retrieve_body( $request ) );
		if ( empty( $secret ) ) {
			return new \WP_Error( 'woocommerce_rest_helper_connect', __( 'There was an error connecting to WooCommerce.com. Please try again.', 'woocommerce' ), 500 );
		}

		do_action( 'woocommerce_helper_connect_start' );

		$connect_url = add_query_arg(
			array(
				'home_url'     => rawurlencode( home_url() ),
				'redirect_uri' => rawurlencode( $redirect_uri ),
				'secret'       => rawurlencode( $secret ),
				'wccom-from'   => 'onboarding',
			),
			\WC_Helper_API::url( 'oauth/authorize' )
		);

		if ( defined( 'WOOCOMMERCE_CALYPSO_ENVIRONMENT' ) && in_array( WOOCOMMERCE_CALYPSO_ENVIRONMENT, array( 'development', 'wpcalypso', 'horizon', 'stage' ), true ) ) {
			$connect_url = add_query_arg(
				array(
					'calypso_env' => WOOCOMMERCE_CALYPSO_ENVIRONMENT,
				),
				$connect_url
			);
		}

		return( array(
			'connectAction' => $connect_url,
		) );
	}

	/**
	 * Finishes connecting to WooCommerce.com.
	 *
	 * @param  object $rest_request Request details.
	 * @return WP_Error|array Contains success status.
	 */
	public function finish_wccom_connect( $rest_request ) {
		include_once WC_ABSPATH . 'includes/admin/helper/class-wc-helper.php';
		include_once WC_ABSPATH . 'includes/admin/helper/class-wc-helper-api.php';
		include_once WC_ABSPATH . 'includes/admin/helper/class-wc-helper-updater.php';
		include_once WC_ABSPATH . 'includes/admin/helper/class-wc-helper-options.php';
		if ( ! class_exists( 'WC_Helper_API' ) ) {
			return new \WP_Error( 'woocommerce_rest_helper_not_active', __( 'There was an error loading the WooCommerce.com Helper API.', 'woocommerce' ), 404 );
		}

		// Obtain an access token.
		$request = \WC_Helper_API::post(
			'oauth/access_token',
			array(
				'body' => array(
					'request_token' => wp_unslash( $rest_request['request_token'] ), // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
					'home_url'      => home_url(),
				),
			)
		);

		$code = wp_remote_retrieve_response_code( $request );
		if ( 200 !== $code ) {
			return new \WP_Error( 'woocommerce_rest_helper_connect', __( 'There was an error connecting to WooCommerce.com. Please try again.', 'woocommerce' ), 500 );
		}

		$access_token = json_decode( wp_remote_retrieve_body( $request ), true );
		if ( ! $access_token ) {
			return new \WP_Error( 'woocommerce_rest_helper_connect', __( 'There was an error connecting to WooCommerce.com. Please try again.', 'woocommerce' ), 500 );
		}

		\WC_Helper_Options::update(
			'auth',
			array(
				'access_token'        => $access_token['access_token'],
				'access_token_secret' => $access_token['access_token_secret'],
				'site_id'             => $access_token['site_id'],
				'user_id'             => get_current_user_id(),
				'updated'             => time(),
			)
		);

		if ( ! \WC_Helper::_flush_authentication_cache() ) {
			\WC_Helper_Options::update( 'auth', array() );
			return new \WP_Error( 'woocommerce_rest_helper_connect', __( 'There was an error connecting to WooCommerce.com. Please try again.', 'woocommerce' ), 500 );
		}

		delete_transient( '_woocommerce_helper_subscriptions' );
		\WC_Helper_Updater::flush_updates_cache();

		do_action( 'woocommerce_helper_connected' );

		return array(
			'success' => true,
		);
	}


	/**
	 * Returns a URL that can be used to connect to Square.
	 *
	 * @return WP_Error|array Connect URL.
	 */
	public function connect_square() {
		if ( ! class_exists( '\WooCommerce\Square\Handlers\Connection' ) ) {
			return new \WP_Error( 'woocommerce_rest_helper_connect', __( 'There was an error connecting to Square.', 'woocommerce' ), 500 );
		}

		if ( 'US' === WC()->countries->get_base_country() ) {
			$profile = get_option( Onboarding::PROFILE_DATA_OPTION, array() );
			if ( ! empty( $profile['industry'] ) ) {
				$has_cbd_industry = in_array( 'cbd-other-hemp-derived-products', array_column( $profile['industry'], 'slug' ), true );
			}
		}

		if ( $has_cbd_industry ) {
			$url = 'https://squareup.com/t/f_partnerships/d_referrals/p_woocommerce/c_general/o_none/l_us/dt_alldevice/pr_payments/?route=/solutions/cbd';
		} else {
			$url = \WooCommerce\Square\Handlers\Connection::CONNECT_URL_PRODUCTION;
		}

		$redirect_url = wp_nonce_url( wc_admin_url( '&task=payments&method=square&square-connect-finish=1' ), 'wc_square_connected' );
		$args         = array(
			'redirect' => rawurlencode( rawurlencode( $redirect_url ) ),
			'scopes'   => implode(
				',',
				array(
					'MERCHANT_PROFILE_READ',
					'PAYMENTS_READ',
					'PAYMENTS_WRITE',
					'ORDERS_READ',
					'ORDERS_WRITE',
					'CUSTOMERS_READ',
					'CUSTOMERS_WRITE',
					'SETTLEMENTS_READ',
					'ITEMS_READ',
					'ITEMS_WRITE',
					'INVENTORY_READ',
					'INVENTORY_WRITE',
				)
			),
		);

		$connect_url = add_query_arg( $args, $url );

		return( array(
			'connectUrl' => $connect_url,
		) );
	}

	/**
	 * Returns a URL that can be used to by WCPay to verify business details with Stripe.
	 *
	 * @return WP_Error|array Connect URL.
	 */
	public function connect_wcpay() {
		if ( ! class_exists( 'WC_Payments_Account' ) ) {
			return new \WP_Error( 'woocommerce_rest_helper_connect', __( 'There was an error communicating with the WooCommerce Payments plugin.', 'woocommerce' ), 500 );
		}

		$connect_url = add_query_arg(
			array(
				'wcpay-connect' => 'WCADMIN_PAYMENT_TASK',
				'_wpnonce'      => wp_create_nonce( 'wcpay-connect' ),
			),
			admin_url()
		);

		return( array(
			'connectUrl' => $connect_url,
		) );
	}

	/**
	 * Get the schema, conforming to JSON Schema.
	 *
	 * @return array
	 */
	public function get_item_schema() {
		$schema = array(
			'$schema'    => 'http://json-schema.org/draft-04/schema#',
			'title'      => 'plugins',
			'type'       => 'object',
			'properties' => array(
				'slug'   => array(
					'description' => __( 'Plugin slug.', 'woocommerce' ),
					'type'        => 'string',
					'context'     => array( 'view', 'edit' ),
					'readonly'    => true,
				),
				'name'   => array(
					'description' => __( 'Plugin name.', 'woocommerce' ),
					'type'        => 'string',
					'context'     => array( 'view', 'edit' ),
					'readonly'    => true,
				),
				'status' => array(
					'description' => __( 'Plugin status.', 'woocommerce' ),
					'type'        => 'string',
					'context'     => array( 'view', 'edit' ),
					'readonly'    => true,
				),
			),
		);

		return $this->add_additional_fields_schema( $schema );
	}

	/**
	 * Get the schema, conforming to JSON Schema.
	 *
	 * @return array
	 */
	public function get_connect_schema() {
		$schema = $this->get_item_schema();
		unset( $schema['properties']['status'] );
		$schema['properties']['connectAction'] = array(
			'description' => __( 'Action that should be completed to connect Jetpack.', 'woocommerce' ),
			'type'        => 'string',
			'context'     => array( 'view', 'edit' ),
			'readonly'    => true,
		);
		return $schema;
	}
}
woocommerce-admin/src/API/Themes.php000064400000013745151335517650013334 0ustar00<?php
/**
 * REST API Themes Controller
 *
 * Handles requests to /themes
 */

namespace Automattic\WooCommerce\Admin\API;

defined( 'ABSPATH' ) || exit;

use Automattic\WooCommerce\Admin\Overrides\ThemeUpgrader;
use Automattic\WooCommerce\Admin\Overrides\ThemeUpgraderSkin;

/**
 * Themes controller.
 *
 * @extends WC_REST_Data_Controller
 */
class Themes extends \WC_REST_Data_Controller {
	/**
	 * Endpoint namespace.
	 *
	 * @var string
	 */
	protected $namespace = 'wc-admin';

	/**
	 * Route base.
	 *
	 * @var string
	 */
	protected $rest_base = 'themes';

	/**
	 * Register routes.
	 */
	public function register_routes() {
		register_rest_route(
			$this->namespace,
			'/' . $this->rest_base,
			array(
				array(
					'methods'             => \WP_REST_Server::EDITABLE,
					'callback'            => array( $this, 'upload_theme' ),
					'permission_callback' => array( $this, 'upload_theme_permissions_check' ),
					'args'                => $this->get_collection_params(),
				),
				'schema' => array( $this, 'get_public_item_schema' ),
			)
		);
	}

	/**
	 * Check whether a given request has permission to edit upload plugins/themes.
	 *
	 * @param  WP_REST_Request $request Full details about the request.
	 * @return WP_Error|boolean
	 */
	public function upload_theme_permissions_check( $request ) {
		if ( ! current_user_can( 'upload_themes' ) ) {
			return new \WP_Error( 'woocommerce_rest_cannot_view', __( 'Sorry, you are not allowed to install themes on this site.', 'woocommerce' ), array( 'status' => rest_authorization_required_code() ) );
		}

		return true;
	}

	/**
	 * Upload and install a theme.
	 *
	 * @param  WP_REST_Request $request Request data.
	 * @return WP_Error|WP_REST_Response
	 */
	public function upload_theme( $request ) {
		if (
			! isset( $_FILES['pluginzip'] ) || ! isset( $_FILES['pluginzip']['tmp_name'] ) || ! is_uploaded_file( $_FILES['pluginzip']['tmp_name'] ) || ! is_file( $_FILES['pluginzip']['tmp_name'] ) ) { // WPCS: sanitization ok.
			return new \WP_Error( 'woocommerce_rest_invalid_file', __( 'Specified file failed upload test.', 'woocommerce' ) );
		}

		include_once ABSPATH . 'wp-admin/includes/file.php';
		include_once ABSPATH . '/wp-admin/includes/admin.php';
		include_once ABSPATH . '/wp-admin/includes/theme-install.php';
		include_once ABSPATH . '/wp-admin/includes/theme.php';
		include_once ABSPATH . '/wp-admin/includes/class-wp-upgrader.php';
		include_once ABSPATH . '/wp-admin/includes/class-theme-upgrader.php';

		$_GET['package'] = true;
		$file_upload     = new \File_Upload_Upgrader( 'pluginzip', 'package' );
		$upgrader        = new ThemeUpgrader( new ThemeUpgraderSkin() );
		$install         = $upgrader->install( $file_upload->package );

		if ( $install || is_wp_error( $install ) ) {
			$file_upload->cleanup();
		}

		if ( ! is_wp_error( $install ) && isset( $install['destination_name'] ) ) {
			$theme  = $install['destination_name'];
			$result = array(
				'status'  => 'success',
				'message' => $upgrader->strings['process_success'],
				'theme'   => $theme,
			);

			/**
			 * Fires when a theme is successfully installed.
			 *
			 * @param string $theme The theme name.
			 */
			do_action( 'woocommerce_theme_installed', $theme );
		} else {
			if ( is_wp_error( $install ) && $install->get_error_code() ) {
				$error_message = isset( $upgrader->strings[ $install->get_error_code() ] ) ? $upgrader->strings[ $install->get_error_code() ] : $install->get_error_data();
			} else {
				$error_message = $upgrader->strings['process_failed'];
			}

			$result = array(
				'status'  => 'error',
				'message' => $error_message,
			);
		}

		$response = $this->prepare_item_for_response( $result, $request );
		$data     = $this->prepare_response_for_collection( $response );

		return rest_ensure_response( $data );
	}


	/**
	 * Prepare the data object for response.
	 *
	 * @param object          $item Data object.
	 * @param WP_REST_Request $request Request object.
	 * @return WP_REST_Response $response Response data.
	 */
	public function prepare_item_for_response( $item, $request ) {
		$data     = $this->add_additional_fields_to_object( $item, $request );
		$data     = $this->filter_response_by_context( $data, 'view' );
		$response = rest_ensure_response( $data );

		/**
		 * Filter the list returned from the API.
		 *
		 * @param WP_REST_Response $response The response object.
		 * @param array            $item     The original item.
		 * @param WP_REST_Request  $request  Request used to generate the response.
		 */
		return apply_filters( 'woocommerce_rest_prepare_themes', $response, $item, $request );
	}


	/**
	 * Get the schema, conforming to JSON Schema.
	 *
	 * @return array
	 */
	public function get_item_schema() {
		$schema = array(
			'$schema'    => 'http://json-schema.org/draft-04/schema#',
			'title'      => 'upload_theme',
			'type'       => 'object',
			'properties' => array(
				'status'  => array(
					'description' => __( 'Theme installation status.', 'woocommerce' ),
					'type'        => 'string',
					'context'     => array( 'view', 'edit' ),
					'readonly'    => true,
				),
				'message' => array(
					'description' => __( 'Theme installation message.', 'woocommerce' ),
					'type'        => 'string',
					'context'     => array( 'view', 'edit' ),
					'readonly'    => true,
				),
				'theme'   => array(
					'description' => __( 'Uploaded theme.', 'woocommerce' ),
					'type'        => 'object',
					'context'     => array( 'view', 'edit' ),
					'readonly'    => true,
				),
			),
		);

		return $this->add_additional_fields_schema( $schema );
	}

	/**
	 * Get the query params for collections.
	 *
	 * @return array
	 */
	public function get_collection_params() {
		$params['context']   = $this->get_context_param( array( 'default' => 'view' ) );
		$params['pluginzip'] = array(
			'description'       => __( 'A zip file of the theme to be uploaded.', 'woocommerce' ),
			'type'              => 'file',
			'validate_callback' => 'rest_validate_request_arg',
		);

		return apply_filters( 'woocommerce_rest_themes_collection_params', $params );
	}
}
woocommerce-admin/src/API/Data.php000064400000001636151335517650012754 0ustar00<?php
/**
 * REST API Data Controller
 *
 * Handles requests to /data
 */

namespace Automattic\WooCommerce\Admin\API;

defined( 'ABSPATH' ) || exit;

/**
 * Data controller.
 *
 * @extends WC_REST_Data_Controller
 */
class Data extends \WC_REST_Data_Controller {

	/**
	 * Endpoint namespace.
	 *
	 * @var string
	 */
	protected $namespace = 'wc-analytics';

	/**
	 * Return the list of data resources.
	 *
	 * @param  WP_REST_Request $request Request data.
	 * @return WP_Error|WP_REST_Response
	 */
	public function get_items( $request ) {
		$response         = parent::get_items( $request );
		$response->data[] = $this->prepare_response_for_collection(
			$this->prepare_item_for_response(
				(object) array(
					'slug'        => 'download-ips',
					'description' => __( 'An endpoint used for searching download logs for a specific IP address.', 'woocommerce' ),
				),
				$request
			)
		);
		return $response;
	}
}
woocommerce-admin/src/API/Options.php000064400000013636151335517650013541 0ustar00<?php
/**
 * REST API Options Controller
 *
 * Handles requests to get and update options in the wp_options table.
 */

namespace Automattic\WooCommerce\Admin\API;

defined( 'ABSPATH' ) || exit;

/**
 * Options Controller.
 *
 * @extends WC_REST_Data_Controller
 */
class Options extends \WC_REST_Data_Controller {
	/**
	 * Endpoint namespace.
	 *
	 * @var string
	 */
	protected $namespace = 'wc-admin';

	/**
	 * Route base.
	 *
	 * @var string
	 */
	protected $rest_base = 'options';

	/**
	 * Register routes.
	 */
	public function register_routes() {
		register_rest_route(
			$this->namespace,
			'/' . $this->rest_base,
			array(
				array(
					'methods'             => \WP_REST_Server::READABLE,
					'callback'            => array( $this, 'get_options' ),
					'permission_callback' => array( $this, 'get_item_permissions_check' ),
				),
				'schema' => array( $this, 'get_item_schema' ),
			)
		);

		register_rest_route(
			$this->namespace,
			'/' . $this->rest_base,
			array(
				array(
					'methods'             => \WP_REST_Server::EDITABLE,
					'callback'            => array( $this, 'update_options' ),
					'permission_callback' => array( $this, 'update_item_permissions_check' ),
				),
				'schema' => array( $this, 'get_item_schema' ),
			)
		);
	}

	/**
	 * Check if a given request has access to get options.
	 *
	 * @param  WP_REST_Request $request Full details about the request.
	 * @return WP_Error|boolean
	 */
	public function get_item_permissions_check( $request ) {
		$params = explode( ',', $request['options'] );

		if ( ! isset( $request['options'] ) || ! is_array( $params ) ) {
			return new \WP_Error( 'woocommerce_rest_cannot_view', __( 'You must supply an array of options.', 'woocommerce' ), 500 );
		}

		foreach ( $params as $option ) {
			if ( ! $this->user_has_permission( $option, $request ) ) {
				return new \WP_Error( 'woocommerce_rest_cannot_view', __( 'Sorry, you cannot view these options.', 'woocommerce' ), array( 'status' => rest_authorization_required_code() ) );
			}
		}

		return true;
	}

	/**
	 * Check if the user has permission given an option name.
	 *
	 * @param  string          $option Option name.
	 * @param  WP_REST_Request $request Full details about the request.
	 * @return boolean
	 */
	public function user_has_permission( $option, $request ) {
		$permissions = $this->get_option_permissions( $request );

		if ( isset( $permissions[ $option ] ) ) {
			return $permissions[ $option ];
		}

		return current_user_can( 'manage_options' );
	}

	/**
	 * Check if a given request has access to update options.
	 *
	 * @param  WP_REST_Request $request Full details about the request.
	 * @return WP_Error|boolean
	 */
	public function update_item_permissions_check( $request ) {
		$params = $request->get_json_params();

		if ( ! is_array( $params ) ) {
			return new \WP_Error( 'woocommerce_rest_cannot_update', __( 'You must supply an array of options and values.', 'woocommerce' ), 500 );
		}

		foreach ( $params as $option_name => $option_value ) {
			if ( ! $this->user_has_permission( $option_name, $request ) ) {
				return new \WP_Error( 'woocommerce_rest_cannot_update', __( 'Sorry, you cannot manage these options.', 'woocommerce' ), array( 'status' => rest_authorization_required_code() ) );
			}
		}

		return true;
	}

	/**
	 * Get an array of options and respective permissions for the current user.
	 *
	 * @param  WP_REST_Request $request Full details about the request.
	 * @return array
	 */
	public function get_option_permissions( $request ) {
		$permissions = array(
			'theme_mods_' . get_stylesheet()               => current_user_can( 'edit_theme_options' ),
			'woocommerce_setup_jetpack_opted_in'           => current_user_can( 'manage_woocommerce' ),
			'woocommerce_stripe_settings'                  => current_user_can( 'manage_woocommerce' ),
			'woocommerce-ppcp-settings'                    => current_user_can( 'manage_woocommerce' ),
			'woocommerce_ppcp-gateway_setting'             => current_user_can( 'manage_woocommerce' ),
			'woocommerce_demo_store'                       => current_user_can( 'manage_woocommerce' ),
			'woocommerce_demo_store_notice'                => current_user_can( 'manage_woocommerce' ),
			'woocommerce_ces_tracks_queue'                 => current_user_can( 'manage_woocommerce' ),
			'woocommerce_navigation_intro_modal_dismissed' => current_user_can( 'manage_woocommerce' ),
		);

		return apply_filters( 'woocommerce_rest_api_option_permissions', $permissions, $request );
	}

	/**
	 * Gets an array of options and respective values.
	 *
	 * @param  WP_REST_Request $request Full details about the request.
	 * @return array Options object with option values.
	 */
	public function get_options( $request ) {
		$params  = explode( ',', $request['options'] );
		$options = array();

		if ( ! is_array( $params ) ) {
			return array();
		}

		foreach ( $params as $option ) {
			$options[ $option ] = get_option( $option );
		}

		return $options;
	}

	/**
	 * Updates an array of objects.
	 *
	 * @param  WP_REST_Request $request Full details about the request.
	 * @return array Options object with a boolean if the option was updated.
	 */
	public function update_options( $request ) {
		$params  = $request->get_json_params();
		$updated = array();

		if ( ! is_array( $params ) ) {
			return array();
		}

		foreach ( $params as $key => $value ) {
			$updated[ $key ] = update_option( $key, $value );
		}

		return $updated;
	}

	/**
	 * Get the schema, conforming to JSON Schema.
	 *
	 * @return array
	 */
	public function get_item_schema() {
		$schema = array(
			'$schema'    => 'http://json-schema.org/draft-04/schema#',
			'title'      => 'options',
			'type'       => 'object',
			'properties' => array(
				'options' => array(
					'type'        => 'array',
					'description' => __( 'Array of options with associated values.', 'woocommerce' ),
					'context'     => array( 'view' ),
					'readonly'    => true,
				),
			),
		);

		return $this->add_additional_fields_schema( $schema );
	}
}
woocommerce-admin/src/API/Notes.php000064400000055311151335517650013172 0ustar00<?php
/**
 * REST API Admin Notes controller
 *
 * Handles requests to the admin notes endpoint.
 */

namespace Automattic\WooCommerce\Admin\API;

defined( 'ABSPATH' ) || exit;

use Automattic\WooCommerce\Admin\Notes\Note;
use Automattic\WooCommerce\Admin\Notes\Notes as NotesRepository;

/**
 * REST API Admin Notes controller class.
 *
 * @extends WC_REST_CRUD_Controller
 */
class Notes extends \WC_REST_CRUD_Controller {

	/**
	 * Endpoint namespace.
	 *
	 * @var string
	 */
	protected $namespace = 'wc-analytics';

	/**
	 * Route base.
	 *
	 * @var string
	 */
	protected $rest_base = 'admin/notes';

	/**
	 * Register the routes for admin notes.
	 */
	public function register_routes() {
		register_rest_route(
			$this->namespace,
			'/' . $this->rest_base,
			array(
				array(
					'methods'             => \WP_REST_Server::READABLE,
					'callback'            => array( $this, 'get_items' ),
					'permission_callback' => array( $this, 'get_items_permissions_check' ),
					'args'                => $this->get_collection_params(),
				),
				'schema' => array( $this, 'get_public_item_schema' ),
			)
		);

		register_rest_route(
			$this->namespace,
			'/' . $this->rest_base . '/(?P<id>[\d-]+)',
			array(
				'args'   => array(
					'id' => array(
						'description' => __( 'Unique ID for the resource.', 'woocommerce' ),
						'type'        => 'integer',
					),
				),
				array(
					'methods'             => \WP_REST_Server::READABLE,
					'callback'            => array( $this, 'get_item' ),
					'permission_callback' => array( $this, 'get_item_permissions_check' ),
				),
				array(
					'methods'             => \WP_REST_Server::EDITABLE,
					'callback'            => array( $this, 'update_item' ),
					'permission_callback' => array( $this, 'update_items_permissions_check' ),
				),
				'schema' => array( $this, 'get_public_item_schema' ),
			)
		);

		register_rest_route(
			$this->namespace,
			'/' . $this->rest_base . '/delete/(?P<id>[\d-]+)',
			array(
				array(
					'methods'             => \WP_REST_Server::DELETABLE,
					'callback'            => array( $this, 'delete_item' ),
					'permission_callback' => array( $this, 'update_items_permissions_check' ),
				),
				'schema' => array( $this, 'get_public_item_schema' ),
			)
		);

		register_rest_route(
			$this->namespace,
			'/' . $this->rest_base . '/delete/all',
			array(
				array(
					'methods'             => \WP_REST_Server::DELETABLE,
					'callback'            => array( $this, 'delete_all_items' ),
					'permission_callback' => array( $this, 'update_items_permissions_check' ),
					'args'                => array(
						'status' => array(
							'description'       => __( 'Status of note.', 'woocommerce' ),
							'type'              => 'array',
							'sanitize_callback' => 'wp_parse_slug_list',
							'validate_callback' => 'rest_validate_request_arg',
							'items'             => array(
								'enum' => Note::get_allowed_statuses(),
								'type' => 'string',
							),
						),
					),
				),
				'schema' => array( $this, 'get_public_item_schema' ),
			)
		);

		register_rest_route(
			$this->namespace,
			'/' . $this->rest_base . '/tracker/(?P<note_id>[\d-]+)/user/(?P<user_id>[\d-]+)',
			array(
				array(
					'methods'             => \WP_REST_Server::READABLE,
					'callback'            => array( $this, 'track_opened_email' ),
					'permission_callback' => '__return_true',
				),
				'schema' => array( $this, 'get_public_item_schema' ),
			)
		);

		register_rest_route(
			$this->namespace,
			'/' . $this->rest_base . '/update',
			array(
				array(
					'methods'             => \WP_REST_Server::EDITABLE,
					'callback'            => array( $this, 'batch_update_items' ),
					'permission_callback' => array( $this, 'update_items_permissions_check' ),
				),
				'schema' => array( $this, 'get_public_item_schema' ),
			)
		);
	}

	/**
	 * Get a single note.
	 *
	 * @param WP_REST_Request $request Request data.
	 * @return WP_REST_Response|WP_Error
	 */
	public function get_item( $request ) {
		$note = NotesRepository::get_note( $request->get_param( 'id' ) );

		if ( ! $note ) {
			return new \WP_Error(
				'woocommerce_note_invalid_id',
				__( 'Sorry, there is no resource with that ID.', 'woocommerce' ),
				array( 'status' => 404 )
			);
		}

		if ( is_wp_error( $note ) ) {
			return $note;
		}

		$data = $this->prepare_note_data_for_response( $note, $request );

		return rest_ensure_response( $data );
	}

	/**
	 * Get all notes.
	 *
	 * @param WP_REST_Request $request Request data.
	 * @return WP_REST_Response
	 */
	public function get_items( $request ) {
		$query_args = $this->prepare_objects_query( $request );

		$notes = NotesRepository::get_notes( 'edit', $query_args );

		$data = array();
		foreach ( (array) $notes as $note_obj ) {
			$note   = $this->prepare_item_for_response( $note_obj, $request );
			$note   = $this->prepare_response_for_collection( $note );
			$data[] = $note;
		}

		$response = rest_ensure_response( $data );
		$response->header( 'X-WP-Total', NotesRepository::get_notes_count( $query_args['type'], $query_args['status'] ) );

		return $response;
	}

	/**
	 * Prepare objects query.
	 *
	 * @param  WP_REST_Request $request Full details about the request.
	 * @return array
	 */
	protected function prepare_objects_query( $request ) {
		$args               = array();
		$args['order']      = $request['order'];
		$args['orderby']    = $request['orderby'];
		$args['per_page']   = $request['per_page'];
		$args['page']       = $request['page'];
		$args['type']       = isset( $request['type'] ) ? $request['type'] : array();
		$args['status']     = isset( $request['status'] ) ? $request['status'] : array();
		$args['source']     = isset( $request['source'] ) ? $request['source'] : array();
		$args['is_deleted'] = 0;

		if ( 'date' === $args['orderby'] ) {
			$args['orderby'] = 'date_created';
		}

		/**
		 * Filter the query arguments for a request.
		 *
		 * Enables adding extra arguments or setting defaults for a post
		 * collection request.
		 *
		 * @param array           $args    Key value array of query var to query value.
		 * @param WP_REST_Request $request The request used.
		 */
		$args = apply_filters( 'woocommerce_rest_notes_object_query', $args, $request );

		return $args;
	}

	/**
	 * Check whether a given request has permission to read a single note.
	 *
	 * @param  WP_REST_Request $request Full details about the request.
	 * @return WP_Error|boolean
	 */
	public function get_item_permissions_check( $request ) {
		if ( ! wc_rest_check_manager_permissions( 'system_status', 'read' ) ) {
			return new \WP_Error( 'woocommerce_rest_cannot_view', __( 'Sorry, you cannot list resources.', 'woocommerce' ), array( 'status' => rest_authorization_required_code() ) );
		}

		return true;
	}

	/**
	 * Check whether a given request has permission to read notes.
	 *
	 * @param  WP_REST_Request $request Full details about the request.
	 * @return WP_Error|boolean
	 */
	public function get_items_permissions_check( $request ) {
		if ( ! wc_rest_check_manager_permissions( 'system_status', 'read' ) ) {
			return new \WP_Error( 'woocommerce_rest_cannot_view', __( 'Sorry, you cannot list resources.', 'woocommerce' ), array( 'status' => rest_authorization_required_code() ) );
		}

		return true;
	}

	/**
	 * Update a single note.
	 *
	 * @param WP_REST_Request $request Full details about the request.
	 * @return WP_REST_Request|WP_Error
	 */
	public function update_item( $request ) {
		$note = NotesRepository::get_note( $request->get_param( 'id' ) );

		if ( ! $note ) {
			return new \WP_Error(
				'woocommerce_note_invalid_id',
				__( 'Sorry, there is no resource with that ID.', 'woocommerce' ),
				array( 'status' => 404 )
			);
		}

		NotesRepository::update_note( $note, $this->get_requested_updates( $request ) );
		return $this->get_item( $request );
	}

	/**
	 * Delete a single note.
	 *
	 * @param WP_REST_Request $request Full details about the request.
	 * @return WP_REST_Request|WP_Error
	 */
	public function delete_item( $request ) {
		$note = NotesRepository::get_note( $request->get_param( 'id' ) );

		if ( ! $note ) {
			return new \WP_Error(
				'woocommerce_note_invalid_id',
				__( 'Sorry, there is no note with that ID.', 'woocommerce' ),
				array( 'status' => 404 )
			);
		}

		NotesRepository::delete_note( $note );
		$data = $this->prepare_note_data_for_response( $note, $request );
		return rest_ensure_response( $data );
	}

	/**
	 * Delete all notes.
	 *
	 * @param WP_REST_Request $request Request object.
	 * @return WP_REST_Request|WP_Error
	 */
	public function delete_all_items( $request ) {
		$args = array();
		if ( isset( $request['status'] ) ) {
			$args['status'] = $request['status'];
		}
		$notes = NotesRepository::delete_all_notes( $args );
		$data  = array();
		foreach ( (array) $notes as $note_obj ) {
			$data[] = $this->prepare_note_data_for_response( $note_obj, $request );
		}

		$response = rest_ensure_response( $data );
		$response->header( 'X-WP-Total', NotesRepository::get_notes_count( array( 'info', 'warning' ), array() ) );
		return $response;
	}

	/**
	 * Prepare note data.
	 *
	 * @param Note            $note     Note data.
	 * @param WP_REST_Request $request  Request object.
	 *
	 * @return WP_REST_Response $response Response data.
	 */
	public function prepare_note_data_for_response( $note, $request ) {
		$note = $note->get_data();
		$note = $this->prepare_item_for_response( $note, $request );
		return $this->prepare_response_for_collection( $note );
	}

	/**
	 * Prepare an array with the the requested updates.
	 *
	 * @param WP_REST_Request $request  Request object.
	 * @return array A list of the requested updates values.
	 */
	public function get_requested_updates( $request ) {
		$requested_updates = array();
		if ( ! is_null( $request->get_param( 'status' ) ) ) {
			$requested_updates['status'] = $request->get_param( 'status' );
		}

		if ( ! is_null( $request->get_param( 'date_reminder' ) ) ) {
			$requested_updates['date_reminder'] = $request->get_param( 'date_reminder' );
		}

		if ( ! is_null( $request->get_param( 'is_deleted' ) ) ) {
			$requested_updates['is_deleted'] = $request->get_param( 'is_deleted' );
		}
		return $requested_updates;
	}

	/**
	 * Batch update a set of notes.
	 *
	 * @param WP_REST_Request $request Request object.
	 * @return WP_REST_Request|WP_Error
	 */
	public function undoremove_items( $request ) {
		wc_deprecated_function( 'undoremove_items', '4.4', '\Automattic\WooCommerce\Admin\API\Notes()->undoremove_items' );
		return self::batch_update_items( $request );
	}

	/**
	 * Batch update a set of notes.
	 *
	 * @param WP_REST_Request $request Request object.
	 * @return WP_REST_Request|WP_Error
	 */
	public function batch_update_items( $request ) {
		$data     = array();
		$note_ids = $request->get_param( 'noteIds' );

		if ( ! isset( $note_ids ) || ! is_array( $note_ids ) ) {
			return new \WP_Error(
				'woocommerce_note_invalid_ids',
				__( 'Please provide an array of IDs through the noteIds param.', 'woocommerce' ),
				array( 'status' => 422 )
			);
		}

		foreach ( (array) $note_ids as $note_id ) {
			$note = NotesRepository::get_note( (int) $note_id );
			if ( $note ) {
				NotesRepository::update_note( $note, $this->get_requested_updates( $request ) );
				$data[] = $this->prepare_note_data_for_response( $note, $request );
			}
		}

		$response = rest_ensure_response( $data );
		$response->header( 'X-WP-Total', NotesRepository::get_notes_count( array( 'info', 'warning' ), array() ) );
		return $response;
	}

	/**
	 * Makes sure the current user has access to WRITE the settings APIs.
	 *
	 * @param WP_REST_Request $request Full data about the request.
	 * @return WP_Error|bool
	 */
	public function update_items_permissions_check( $request ) {
		if ( ! wc_rest_check_manager_permissions( 'settings', 'edit' ) ) {
			return new \WP_Error( 'woocommerce_rest_cannot_edit', __( 'Sorry, you cannot edit this resource.', 'woocommerce' ), array( 'status' => rest_authorization_required_code() ) );
		}
		return true;
	}

	/**
	 * Prepare a path or query for serialization to the client.
	 *
	 * @param string $query The query, path, or URL to transform.
	 * @return string A fully formed URL.
	 */
	public function prepare_query_for_response( $query ) {
		if ( empty( $query ) ) {
			return $query;
		}
		if ( 'https://' === substr( $query, 0, 8 ) ) {
			return $query;
		}
		if ( 'http://' === substr( $query, 0, 7 ) ) {
			return $query;
		}
		if ( '?' === substr( $query, 0, 1 ) ) {
			return admin_url( 'admin.php' . $query );
		}

		return admin_url( $query );
	}

	/**
	 * Maybe add a nonce to a URL.
	 *
	 * @link https://codex.wordpress.org/WordPress_Nonces
	 *
	 * @param string $url The URL needing a nonce.
	 * @param string $action The nonce action.
	 * @param string $name The nonce anme.
	 * @return string A fully formed URL.
	 */
	private function maybe_add_nonce_to_url( string $url, string $action = '', string $name = '' ) : string {
		if ( empty( $action ) ) {
			return $url;
		}

		if ( empty( $name ) ) {
			// Default paramater name.
			$name = '_wpnonce';
		}

		return add_query_arg( $name, wp_create_nonce( $action ), $url );
	}

	/**
	 * Prepare a note object for serialization.
	 *
	 * @param array           $data Note data.
	 * @param WP_REST_Request $request Request object.
	 * @return WP_REST_Response $response Response data.
	 */
	public function prepare_item_for_response( $data, $request ) {
		$context                   = ! empty( $request['context'] ) ? $request['context'] : 'view';
		$data                      = $this->add_additional_fields_to_object( $data, $request );
		$data['date_created_gmt']  = wc_rest_prepare_date_response( $data['date_created'] );
		$data['date_created']      = wc_rest_prepare_date_response( $data['date_created'], false );
		$data['date_reminder_gmt'] = wc_rest_prepare_date_response( $data['date_reminder'] );
		$data['date_reminder']     = wc_rest_prepare_date_response( $data['date_reminder'], false );
		$data['title']             = stripslashes( $data['title'] );
		$data['content']           = stripslashes( $data['content'] );
		$data['is_snoozable']      = (bool) $data['is_snoozable'];
		$data['is_deleted']        = (bool) $data['is_deleted'];
		foreach ( (array) $data['actions'] as $key => $value ) {
			$data['actions'][ $key ]->label  = stripslashes( $data['actions'][ $key ]->label );
			$data['actions'][ $key ]->url    = $this->maybe_add_nonce_to_url(
				$this->prepare_query_for_response( $data['actions'][ $key ]->query ),
				(string) $data['actions'][ $key ]->nonce_action,
				(string) $data['actions'][ $key ]->nonce_name
			);
			$data['actions'][ $key ]->status = stripslashes( $data['actions'][ $key ]->status );
		}
		$data = $this->filter_response_by_context( $data, $context );

		// Wrap the data in a response object.
		$response = rest_ensure_response( $data );
		$response->add_links(
			array(
				'self'       => array(
					'href' => rest_url( sprintf( '/%s/%s/%d', $this->namespace, $this->rest_base, $data['id'] ) ),
				),
				'collection' => array(
					'href' => rest_url( sprintf( '%s/%s', $this->namespace, $this->rest_base ) ),
				),
			)
		);
		/**
		 * Filter a note returned from the API.
		 *
		 * Allows modification of the note data right before it is returned.
		 *
		 * @param WP_REST_Response $response The response object.
		 * @param array            $data The original note.
		 * @param WP_REST_Request  $request  Request used to generate the response.
		 */
		return apply_filters( 'woocommerce_rest_prepare_note', $response, $data, $request );
	}


	/**
	 * Track opened emails.
	 *
	 * @param WP_REST_Request $request Request object.
	 */
	public function track_opened_email( $request ) {
		$note = NotesRepository::get_note( $request->get_param( 'note_id' ) );
		if ( ! $note ) {
			return;
		}

		NotesRepository::record_tracks_event_with_user( $request->get_param( 'user_id' ), 'email_note_opened', array( 'note_name' => $note->get_name() ) );
	}

	/**
	 * Get the query params for collections.
	 *
	 * @return array
	 */
	public function get_collection_params() {
		$params             = array();
		$params['context']  = $this->get_context_param( array( 'default' => 'view' ) );
		$params['order']    = array(
			'description'       => __( 'Order sort attribute ascending or descending.', 'woocommerce' ),
			'type'              => 'string',
			'default'           => 'desc',
			'enum'              => array( 'asc', 'desc' ),
			'validate_callback' => 'rest_validate_request_arg',
		);
		$params['orderby']  = array(
			'description'       => __( 'Sort collection by object attribute.', 'woocommerce' ),
			'type'              => 'string',
			'default'           => 'date',
			'enum'              => array(
				'note_id',
				'date',
				'type',
				'title',
				'status',
			),
			'validate_callback' => 'rest_validate_request_arg',
		);
		$params['page']     = array(
			'description'       => __( 'Current page of the collection.', 'woocommerce' ),
			'type'              => 'integer',
			'default'           => 1,
			'sanitize_callback' => 'absint',
			'validate_callback' => 'rest_validate_request_arg',
			'minimum'           => 1,
		);
		$params['per_page'] = array(
			'description'       => __( 'Maximum number of items to be returned in result set.', 'woocommerce' ),
			'type'              => 'integer',
			'default'           => 10,
			'minimum'           => 1,
			'maximum'           => 100,
			'sanitize_callback' => 'absint',
			'validate_callback' => 'rest_validate_request_arg',
		);
		$params['type']     = array(
			'description'       => __( 'Type of note.', 'woocommerce' ),
			'type'              => 'array',
			'sanitize_callback' => 'wp_parse_slug_list',
			'validate_callback' => 'rest_validate_request_arg',
			'items'             => array(
				'enum' => Note::get_allowed_types(),
				'type' => 'string',
			),
		);
		$params['status']   = array(
			'description'       => __( 'Status of note.', 'woocommerce' ),
			'type'              => 'array',
			'sanitize_callback' => 'wp_parse_slug_list',
			'validate_callback' => 'rest_validate_request_arg',
			'items'             => array(
				'enum' => Note::get_allowed_statuses(),
				'type' => 'string',
			),
		);
		$params['source']   = array(
			'description'       => __( 'Source of note.', 'woocommerce' ),
			'type'              => 'array',
			'sanitize_callback' => 'wp_parse_list',
			'validate_callback' => 'rest_validate_request_arg',
			'items'             => array(
				'type' => 'string',
			),
		);
		return $params;
	}

	/**
	 * Get the note's schema, conforming to JSON Schema.
	 *
	 * @return array
	 */
	public function get_item_schema() {
		$schema = array(
			'$schema'    => 'http://json-schema.org/draft-04/schema#',
			'title'      => 'note',
			'type'       => 'object',
			'properties' => array(
				'id'                => array(
					'description' => __( 'ID of the note record.', 'woocommerce' ),
					'type'        => 'integer',
					'context'     => array( 'view' ),
					'readonly'    => true,
				),
				'name'              => array(
					'description' => __( 'Name of the note.', 'woocommerce' ),
					'type'        => 'string',
					'context'     => array( 'view', 'edit' ),
					'readonly'    => true,
				),
				'type'              => array(
					'description' => __( 'The type of the note (e.g. error, warning, etc.).', 'woocommerce' ),
					'type'        => 'string',
					'context'     => array( 'view', 'edit' ),
					'readonly'    => true,
				),
				'locale'            => array(
					'description' => __( 'Locale used for the note title and content.', 'woocommerce' ),
					'type'        => 'string',
					'context'     => array( 'view', 'edit' ),
					'readonly'    => true,
				),
				'title'             => array(
					'description' => __( 'Title of the note.', 'woocommerce' ),
					'type'        => 'string',
					'context'     => array( 'view', 'edit' ),
					'readonly'    => true,
				),
				'content'           => array(
					'description' => __( 'Content of the note.', 'woocommerce' ),
					'type'        => 'string',
					'context'     => array( 'view', 'edit' ),
					'readonly'    => true,
				),
				'content_data'      => array(
					'description' => __( 'Content data for the note. JSON string. Available for re-localization.', 'woocommerce' ),
					'type'        => 'string',
					'context'     => array( 'view', 'edit' ),
					'readonly'    => true,
				),
				'status'            => array(
					'description' => __( 'The status of the note (e.g. unactioned, actioned).', 'woocommerce' ),
					'type'        => 'string',
					'context'     => array( 'view', 'edit' ),
				),
				'source'            => array(
					'description' => __( 'Source of the note.', 'woocommerce' ),
					'type'        => 'string',
					'context'     => array( 'view', 'edit' ),
					'readonly'    => true,
				),
				'date_created'      => array(
					'description' => __( 'Date the note was created.', 'woocommerce' ),
					'type'        => 'string',
					'context'     => array( 'view', 'edit' ),
					'readonly'    => true,
				),
				'date_created_gmt'  => array(
					'description' => __( 'Date the note was created (GMT).', 'woocommerce' ),
					'type'        => 'string',
					'context'     => array( 'view', 'edit' ),
					'readonly'    => true,
				),
				'date_reminder'     => array(
					'description' => __( 'Date after which the user should be reminded of the note, if any.', 'woocommerce' ),
					'type'        => 'string',
					'context'     => array( 'view', 'edit' ),
					'readonly'    => true, // @todo Allow date_reminder to be updated.
				),
				'date_reminder_gmt' => array(
					'description' => __( 'Date after which the user should be reminded of the note, if any (GMT).', 'woocommerce' ),
					'type'        => 'string',
					'context'     => array( 'view', 'edit' ),
					'readonly'    => true,
				),
				'is_snoozable'      => array(
					'description' => __( 'Whether or not a user can request to be reminded about the note.', 'woocommerce' ),
					'type'        => 'boolean',
					'context'     => array( 'view', 'edit' ),
					'readonly'    => true,
				),
				'actions'           => array(
					'description' => __( 'An array of actions, if any, for the note.', 'woocommerce' ),
					'type'        => 'array',
					'context'     => array( 'view', 'edit' ),
					'readonly'    => true,
				),
				'layout'            => array(
					'description' => __( 'The layout of the note (e.g. banner, thumbnail, plain).', 'woocommerce' ),
					'type'        => 'string',
					'context'     => array( 'view', 'edit' ),
					'readonly'    => true,
				),
				'image'             => array(
					'description' => __( 'The image of the note, if any.', 'woocommerce' ),
					'type'        => 'string',
					'context'     => array( 'view', 'edit' ),
					'readonly'    => true,
				),
				'is_deleted'        => array(
					'description' => __( 'Registers whether the note is deleted or not', 'woocommerce' ),
					'type'        => 'boolean',
					'context'     => array( 'view', 'edit' ),
					'readonly'    => true,
				),
			),
		);
		return $this->add_additional_fields_schema( $schema );
	}
}
woocommerce-admin/src/API/ProductsLowInStock.php000064400000022775151335517650015672 0ustar00<?php
/**
 * REST API ProductsLowInStock Controller
 *
 * Handles request to /products/low-in-stock
 */

namespace Automattic\WooCommerce\Admin\API;

defined( 'ABSPATH' ) || exit;

/**
 * ProductsLowInStock controller.
 *
 * @extends WC_REST_Products_Controller
 */
final class ProductsLowInStock extends \WC_REST_Products_Controller {

	/**
	 * Endpoint namespace.
	 *
	 * @var string
	 */
	protected $namespace = 'wc-analytics';

	/**
	 * Register routes.
	 */
	public function register_routes() {
		register_rest_route(
			$this->namespace,
			'products/low-in-stock',
			array(
				'args'   => array(),
				array(
					'methods'             => \WP_REST_Server::READABLE,
					'callback'            => array( $this, 'get_items' ),
					'permission_callback' => array( $this, 'get_items_permissions_check' ),
					'args'                => $this->get_collection_params(),
				),
				'schema' => array( $this, 'get_public_item_schema' ),
			)
		);
	}

	/**
	 * Get low in stock products.
	 *
	 * @param WP_REST_Request $request request object.
	 *
	 * @return WP_REST_Response|WP_ERROR
	 */
	public function get_items( $request ) {
		$query_results = $this->get_low_in_stock_products(
			$request->get_param( 'page' ),
			$request->get_param( 'per_page' ),
			$request->get_param( 'status' )
		);

		// set images and attributes.
		$query_results['results'] = array_map(
			function( $query_result ) {
				$product                  = wc_get_product( $query_result );
				$query_result->images     = $this->get_images( $product );
				$query_result->attributes = $this->get_attributes( $product );
				return $query_result;
			},
			$query_results['results']
		);

		// set last_order_date.
		$query_results['results'] = $this->set_last_order_date( $query_results['results'] );

		// convert the post data to the expected API response for the backward compatibility.
		$query_results['results'] = array_map( array( $this, 'transform_post_to_api_response' ), $query_results['results'] );

		$response = rest_ensure_response( array_values( $query_results['results'] ) );
		$response->header( 'X-WP-Total', $query_results['total'] );
		$response->header( 'X-WP-TotalPages', $query_results['pages'] );

		return $response;
	}

	/**
	 * Set the last order date for each data.
	 *
	 * @param array $results query result from get_low_in_stock_products.
	 *
	 * @return mixed
	 */
	protected function set_last_order_date( $results = array() ) {
		global $wpdb;
		if ( 0 === count( $results ) ) {
			return $results;
		}

		$wheres = array();
		foreach ( $results as $result ) {
			'product_variation' === $result->post_type ?
				array_push( $wheres, "(product_id={$result->post_parent} and variation_id={$result->ID})" )
				: array_push( $wheres, "product_id={$result->ID}" );
		}

		count( $wheres ) ? $where_clause = implode( ' or ', $wheres ) : $where_clause = $wheres[0];

		$product_lookup_table = $wpdb->prefix . 'wc_order_product_lookup';
		$query_string         = "
			select
				product_id,
				variation_id,
				MAX( wc_order_product_lookup.date_created ) AS last_order_date
			from {$product_lookup_table} wc_order_product_lookup
			where {$where_clause}
			group by product_id
			order by date_created desc
		";

		// phpcs:ignore -- ignore prepare() warning as we're not using any user input here.
		$last_order_dates = $wpdb->get_results( $query_string );
		$last_order_dates_index = array();
		// Make an index with product_id_variation_id as a key
		// so that it can be referenced back without looping the whole array.
		foreach ( $last_order_dates as $last_order_date ) {
			$last_order_dates_index[ $last_order_date->product_id . '_' . $last_order_date->variation_id ] = $last_order_date;
		}

		foreach ( $results as &$result ) {
			'product_variation' === $result->post_type ?
				$index_key   = $result->post_parent . '_' . $result->ID
				: $index_key = $result->ID . '_' . $result->post_parent;

			if ( isset( $last_order_dates_index[ $index_key ] ) ) {
				$result->last_order_date = $last_order_dates_index[ $index_key ]->last_order_date;
			}
		}

		return $results;
	}

	/**
	 * Get low in stock products data.
	 *
	 * @param int    $page current page.
	 * @param int    $per_page items per page.
	 * @param string $status post status.
	 *
	 * @return array
	 */
	protected function get_low_in_stock_products( $page = 1, $per_page = 1, $status = 'publish' ) {
		global $wpdb;

		$offset              = ( $page - 1 ) * $per_page;
		$low_stock_threshold = absint( max( get_option( 'woocommerce_notify_low_stock_amount' ), 1 ) );

		$query_string = $this->get_query( $this->is_using_sitewide_stock_threshold_only() );

		$query_results = $wpdb->get_results(
			// phpcs:ignore -- not sure why phpcs complains about this line when prepare() is used here.
			$wpdb->prepare( $query_string, $status, $low_stock_threshold, $offset, $per_page ),
			OBJECT_K
		);

		$total_results = $wpdb->get_var( 'SELECT FOUND_ROWS()' );

		return array(
			'results' => $query_results,
			'total'   => (int) $total_results,
			'pages'   => (int) ceil( $total_results / (int) $per_page ),
		);
	}

	/**
	 * Check to see if store is using sitewide threshold only. Meaning that it does not have any custom
	 * stock threshold for a product.
	 *
	 * @return bool
	 */
	protected function is_using_sitewide_stock_threshold_only() {
		global $wpdb;
		$count = $wpdb->get_var( "select count(*) as total from {$wpdb->postmeta} where meta_key='_low_stock_amount'" );
		return 0 === (int) $count;
	}

	/**
	 * Transform post object to expected API response.
	 *
	 * @param object $query_result a row of query result from get_low_in_stock_products().
	 *
	 * @return array
	 */
	protected function transform_post_to_api_response( $query_result ) {
		$low_stock_amount = null;
		if ( isset( $query_result->low_stock_amount ) ) {
			$low_stock_amount = (int) $query_result->low_stock_amount;
		}

		if ( ! isset( $query_result->last_order_date ) ) {
			$query_result->last_order_date = null;
		}

		return array(
			'id'               => (int) $query_result->ID,
			'images'           => $query_result->images,
			'attributes'       => $query_result->attributes,
			'low_stock_amount' => $low_stock_amount,
			'last_order_date'  => wc_rest_prepare_date_response( $query_result->last_order_date ),
			'name'             => $query_result->post_title,
			'parent_id'        => (int) $query_result->post_parent,
			'stock_quantity'   => (int) $query_result->stock_quantity,
			'type'             => 'product_variation' === $query_result->post_type ? 'variation' : 'simple',
		);
	}

	/**
	 * Generate a query.
	 *
	 * @param bool $siteside_only generates a query for sitewide low stock threshold only query.
	 *
	 * @return string
	 */
	protected function get_query( $siteside_only = false ) {
		global $wpdb;
		$query = "
			SELECT
				SQL_CALC_FOUND_ROWS wp_posts.*,
				:postmeta_select
				wc_product_meta_lookup.stock_quantity
			FROM
			  {$wpdb->wc_product_meta_lookup} wc_product_meta_lookup
			  LEFT JOIN {$wpdb->posts} wp_posts ON wp_posts.ID = wc_product_meta_lookup.product_id
			  :postmeta_join
			WHERE
			  wp_posts.post_type IN ('product', 'product_variation')
			  AND wp_posts.post_status = %s
			  AND wc_product_meta_lookup.stock_quantity IS NOT NULL
			  AND wc_product_meta_lookup.stock_status IN('instock', 'outofstock')
			  :postmeta_wheres
			order by wc_product_meta_lookup.product_id DESC
			limit %d, %d
		";

		$postmeta = array(
			'select' => '',
			'join'   => '',
			'wheres' => 'AND wc_product_meta_lookup.stock_quantity <= %d',
		);

		if ( ! $siteside_only ) {
			$postmeta['select'] = 'meta.meta_value AS low_stock_amount,';
			$postmeta['join']   = "LEFT JOIN {$wpdb->postmeta} AS meta ON wp_posts.ID = meta.post_id
			  AND meta.meta_key = '_low_stock_amount'";
			$postmeta['wheres'] = "AND (
			    (
			      meta.meta_value > ''
			      AND wc_product_meta_lookup.stock_quantity <= CAST(
			        meta.meta_value AS SIGNED
			      )
			    )
			    OR (
			      (
			        meta.meta_value IS NULL
			        OR meta.meta_value <= ''
			      )
			      AND wc_product_meta_lookup.stock_quantity <= %d
			    )
		    )";
		}

		return strtr(
			$query,
			array(
				':postmeta_select' => $postmeta['select'],
				':postmeta_join'   => $postmeta['join'],
				':postmeta_wheres' => $postmeta['wheres'],
			)
		);
	}

	/**
	 * Get the query params for collections of attachments.
	 *
	 * @return array
	 */
	public function get_collection_params() {
		$params                       = array();
		$params['context']            = $this->get_context_param();
		$params['context']['default'] = 'view';

		$params['page']     = array(
			'description'       => __( 'Current page of the collection.', 'woocommerce' ),
			'type'              => 'integer',
			'default'           => 1,
			'sanitize_callback' => 'absint',
			'validate_callback' => 'rest_validate_request_arg',
			'minimum'           => 1,
		);
		$params['per_page'] = array(
			'description'       => __( 'Maximum number of items to be returned in result set.', 'woocommerce' ),
			'type'              => 'integer',
			'default'           => 10,
			'minimum'           => 1,
			'maximum'           => 100,
			'sanitize_callback' => 'absint',
			'validate_callback' => 'rest_validate_request_arg',
		);

		$params['status'] = array(
			'default'           => 'publish',
			'description'       => __( 'Limit result set to products assigned a specific status.', 'woocommerce' ),
			'type'              => 'string',
			'enum'              => array_merge( array_keys( get_post_statuses() ), array( 'future' ) ),
			'sanitize_callback' => 'sanitize_key',
			'validate_callback' => 'rest_validate_request_arg',
		);

		return $params;
	}
}
woocommerce-admin/src/API/ProductAttributeTerms.php000064400000010546151335517650016422 0ustar00<?php
/**
 * REST API Product Attribute Terms Controller
 *
 * Handles requests to /products/attributes/<slug>/terms
 */

namespace Automattic\WooCommerce\Admin\API;

defined( 'ABSPATH' ) || exit;

/**
 * Product attribute terms controller.
 *
 * @extends WC_REST_Product_Attribute_Terms_Controller
 */
class ProductAttributeTerms extends \WC_REST_Product_Attribute_Terms_Controller {
	use CustomAttributeTraits;

	/**
	 * Endpoint namespace.
	 *
	 * @var string
	 */
	protected $namespace = 'wc-analytics';


	/**
	 * Register the routes for custom product attributes.
	 */
	public function register_routes() {
		parent::register_routes();

		register_rest_route(
			$this->namespace,
			'products/attributes/(?P<slug>[a-z0-9_\-]+)/terms',
			array(
				'args'   => array(
					'slug' => array(
						'description' => __( 'Slug identifier for the resource.', 'woocommerce' ),
						'type'        => 'string',
					),
				),
				array(
					'methods'             => \WP_REST_Server::READABLE,
					'callback'            => array( $this, 'get_item_by_slug' ),
					'permission_callback' => array( $this, 'get_custom_attribute_permissions_check' ),
					'args'                => $this->get_collection_params(),
				),
				'schema' => array( $this, 'get_public_item_schema' ),
			)
		);
	}

	/**
	 * Check if a given request has access to read a custom attribute.
	 *
	 * @param  WP_REST_Request $request Full details about the request.
	 * @return WP_Error|boolean
	 */
	public function get_custom_attribute_permissions_check( $request ) {
		if ( ! wc_rest_check_manager_permissions( 'attributes', 'read' ) ) {
			return new WP_Error(
				'woocommerce_rest_cannot_view',
				__( 'Sorry, you cannot view this resource.', 'woocommerce' ),
				array(
					'status' => rest_authorization_required_code(),
				)
			);
		}

		return true;
	}

	/**
	 * Get the Attribute's schema, conforming to JSON Schema.
	 *
	 * @return array
	 */
	public function get_item_schema() {
		$schema = parent::get_item_schema();
		// Custom attributes substitute slugs for numeric IDs.
		$schema['properties']['id']['type'] = array( 'integer', 'string' );

		return $schema;
	}

	/**
	 * Query custom attribute values by slug.
	 *
	 * @param string $slug Attribute slug.
	 * @return array Attribute values, formatted for response.
	 */
	protected function get_custom_attribute_values( $slug ) {
		global $wpdb;

		if ( empty( $slug ) ) {
			return array();
		}

		$attribute_values = array();

		// Get the attribute properties.
		$attribute = $this->get_custom_attribute_by_slug( $slug );

		if ( is_wp_error( $attribute ) ) {
			return $attribute;
		}

		// Find all attribute values assigned to products.
		$query_results = $wpdb->get_results(
			$wpdb->prepare(
				"SELECT meta_value, COUNT(meta_id) AS product_count
				FROM {$wpdb->postmeta}
				WHERE meta_key = %s
				AND meta_value != ''
				GROUP BY meta_value",
				'attribute_' . esc_sql( $slug )
			),
			OBJECT_K
		);

		// Ensure all defined properties are in the response.
		$defined_values = wc_get_text_attributes( $attribute[ $slug ]['value'] );

		foreach ( $defined_values as $defined_value ) {
			if ( array_key_exists( $defined_value, $query_results ) ) {
				continue;
			}

			$query_results[ $defined_value ] = (object) array(
				'meta_value'    => $defined_value, // phpcs:ignore WordPress.DB.SlowDBQuery.slow_db_query_meta_value
				'product_count' => 0,
			);
		}

		foreach ( $query_results as $term_value => $term ) {
			// Mimic the structure of a taxonomy-backed attribute values for response.
			$data = array(
				'id'          => $term_value,
				'name'        => $term_value,
				'slug'        => $term_value,
				'description' => '',
				'menu_order'  => 0,
				'count'       => (int) $term->product_count,
			);

			$response = rest_ensure_response( $data );
			$response->add_links(
				array(
					'collection' => array(
						'href' => rest_url(
							$this->namespace . '/products/attributes/' . $slug . '/terms'
						),
					),
				)
			);
			$response = $this->prepare_response_for_collection( $response );

			$attribute_values[ $term_value ] = $response;
		}

		return array_values( $attribute_values );
	}

	/**
	 * Get a single custom attribute.
	 *
	 * @param WP_REST_Request $request Full details about the request.
	 * @return WP_REST_Request|WP_Error
	 */
	public function get_item_by_slug( $request ) {
		return $this->get_custom_attribute_values( $request['slug'] );
	}
}
woocommerce-admin/src/API/Features.php000064400000003277151335517650013664 0ustar00<?php
/**
 * REST API Features Controller
 *
 * Handles requests to /features
 */

namespace Automattic\WooCommerce\Admin\API;

defined( 'ABSPATH' ) || exit;

use Automattic\WooCommerce\Admin\Features\Features as FeaturesClass;

/**
 * Features Controller.
 *
 * @extends WC_REST_Data_Controller
 */
class Features extends \WC_REST_Data_Controller {

	/**
	 * Endpoint namespace.
	 *
	 * @var string
	 */
	protected $namespace = 'wc-admin';

	/**
	 * Route base.
	 *
	 * @var string
	 */
	protected $rest_base = 'features';

	/**
	 * Register routes.
	 */
	public function register_routes() {
		register_rest_route(
			$this->namespace,
			'/' . $this->rest_base,
			array(
				array(
					'methods'             => \WP_REST_Server::READABLE,
					'callback'            => array( $this, 'get_features' ),
					'permission_callback' => array( $this, 'get_items_permissions_check' ),
				),
				'schema' => array( $this, 'get_public_item_schema' ),
			)
		);
	}

	/**
	 * Check whether a given request has permission to read onboarding profile data.
	 *
	 * @param  WP_REST_Request $request Full details about the request.
	 * @return WP_Error|boolean
	 */
	public function get_items_permissions_check( $request ) {
		if ( ! wc_rest_check_manager_permissions( 'settings', 'read' ) ) {
			return new \WP_Error( 'woocommerce_rest_cannot_view', __( 'Sorry, you cannot list resources.', 'woocommerce' ), array( 'status' => rest_authorization_required_code() ) );
		}

		return true;
	}

	/**
	 * Return available payment methods.
	 *
	 * @param \WP_REST_Request $request Request data.
	 *
	 * @return \WP_Error|\WP_REST_Response
	 */
	public function get_features( $request ) {
		return FeaturesClass::get_available_features();
	}

}
woocommerce-admin/src/API/Init.php000064400000016607151335517650013012 0ustar00<?php
/**
 * REST API bootstrap.
 */

namespace Automattic\WooCommerce\Admin\API;

use Automattic\WooCommerce\Admin\Features\Features;

defined( 'ABSPATH' ) || exit;

use \Automattic\WooCommerce\Admin\Loader;

/**
 * Init class.
 */
class Init {
	/**
	 * The single instance of the class.
	 *
	 * @var object
	 */
	protected static $instance = null;

	/**
	 * Get class instance.
	 *
	 * @return object Instance.
	 */
	final public static function instance() {
		if ( null === static::$instance ) {
			static::$instance = new static();
		}
		return static::$instance;
	}

	/**
	 * Boostrap REST API.
	 */
	public function __construct() {
		// Hook in data stores.
		add_filter( 'woocommerce_data_stores', array( __CLASS__, 'add_data_stores' ) );
		// REST API extensions init.
		add_action( 'rest_api_init', array( $this, 'rest_api_init' ) );

		// Add currency symbol to orders endpoint response.
		add_filter( 'woocommerce_rest_prepare_shop_order_object', array( __CLASS__, 'add_currency_symbol_to_order_response' ) );
	}

	/**
	 * Init REST API.
	 */
	public function rest_api_init() {
		$controllers = array(
			'Automattic\WooCommerce\Admin\API\Features',
			'Automattic\WooCommerce\Admin\API\Notes',
			'Automattic\WooCommerce\Admin\API\NoteActions',
			'Automattic\WooCommerce\Admin\API\Coupons',
			'Automattic\WooCommerce\Admin\API\Data',
			'Automattic\WooCommerce\Admin\API\DataCountries',
			'Automattic\WooCommerce\Admin\API\DataDownloadIPs',
			'Automattic\WooCommerce\Admin\API\Marketing',
			'Automattic\WooCommerce\Admin\API\MarketingOverview',
			'Automattic\WooCommerce\Admin\API\Options',
			'Automattic\WooCommerce\Admin\API\Orders',
			'Automattic\WooCommerce\Admin\API\Products',
			'Automattic\WooCommerce\Admin\API\ProductAttributes',
			'Automattic\WooCommerce\Admin\API\ProductAttributeTerms',
			'Automattic\WooCommerce\Admin\API\ProductCategories',
			'Automattic\WooCommerce\Admin\API\ProductVariations',
			'Automattic\WooCommerce\Admin\API\ProductReviews',
			'Automattic\WooCommerce\Admin\API\ProductVariations',
			'Automattic\WooCommerce\Admin\API\ProductsLowInStock',
			'Automattic\WooCommerce\Admin\API\SettingOptions',
			'Automattic\WooCommerce\Admin\API\Themes',
			'Automattic\WooCommerce\Admin\API\Plugins',
			'Automattic\WooCommerce\Admin\API\OnboardingFreeExtensions',
			'Automattic\WooCommerce\Admin\API\OnboardingPayments',
			'Automattic\WooCommerce\Admin\API\OnboardingProductTypes',
			'Automattic\WooCommerce\Admin\API\OnboardingProfile',
			'Automattic\WooCommerce\Admin\API\OnboardingTasks',
			'Automattic\WooCommerce\Admin\API\OnboardingThemes',
			'Automattic\WooCommerce\Admin\API\NavigationFavorites',
			'Automattic\WooCommerce\Admin\API\Taxes',
		);

		if ( Features::is_enabled( 'analytics' ) ) {
			$analytics_controllers = array(
				'Automattic\WooCommerce\Admin\API\Customers',
				'Automattic\WooCommerce\Admin\API\Leaderboards',
				'Automattic\WooCommerce\Admin\API\Reports\Controller',
				'Automattic\WooCommerce\Admin\API\Reports\Import\Controller',
				'Automattic\WooCommerce\Admin\API\Reports\Export\Controller',
				'Automattic\WooCommerce\Admin\API\Reports\Products\Controller',
				'Automattic\WooCommerce\Admin\API\Reports\Variations\Controller',
				'Automattic\WooCommerce\Admin\API\Reports\Products\Stats\Controller',
				'Automattic\WooCommerce\Admin\API\Reports\Variations\Stats\Controller',
				'Automattic\WooCommerce\Admin\API\Reports\Revenue\Stats\Controller',
				'Automattic\WooCommerce\Admin\API\Reports\Orders\Controller',
				'Automattic\WooCommerce\Admin\API\Reports\Orders\Stats\Controller',
				'Automattic\WooCommerce\Admin\API\Reports\Categories\Controller',
				'Automattic\WooCommerce\Admin\API\Reports\Taxes\Controller',
				'Automattic\WooCommerce\Admin\API\Reports\Taxes\Stats\Controller',
				'Automattic\WooCommerce\Admin\API\Reports\Coupons\Controller',
				'Automattic\WooCommerce\Admin\API\Reports\Coupons\Stats\Controller',
				'Automattic\WooCommerce\Admin\API\Reports\Stock\Controller',
				'Automattic\WooCommerce\Admin\API\Reports\Stock\Stats\Controller',
				'Automattic\WooCommerce\Admin\API\Reports\Downloads\Controller',
				'Automattic\WooCommerce\Admin\API\Reports\Downloads\Stats\Controller',
				'Automattic\WooCommerce\Admin\API\Reports\Customers\Controller',
				'Automattic\WooCommerce\Admin\API\Reports\Customers\Stats\Controller',
			);

			// The performance indicators controller must be registered last, after other /stats endpoints have been registered.
			$analytics_controllers[] = 'Automattic\WooCommerce\Admin\API\Reports\PerformanceIndicators\Controller';

			$controllers = array_merge( $controllers, $analytics_controllers );
		}

		$controllers = apply_filters( 'woocommerce_admin_rest_controllers', $controllers );

		foreach ( $controllers as $controller ) {
			$this->$controller = new $controller();
			$this->$controller->register_routes();
		}
	}

	/**
	 * Adds data stores.
	 *
	 * @param array $data_stores List of data stores.
	 * @return array
	 */
	public static function add_data_stores( $data_stores ) {
		return array_merge(
			$data_stores,
			array(
				'report-revenue-stats'    => 'Automattic\WooCommerce\Admin\API\Reports\Orders\Stats\DataStore',
				'report-orders'           => 'Automattic\WooCommerce\Admin\API\Reports\Orders\DataStore',
				'report-orders-stats'     => 'Automattic\WooCommerce\Admin\API\Reports\Orders\Stats\DataStore',
				'report-products'         => 'Automattic\WooCommerce\Admin\API\Reports\Products\DataStore',
				'report-variations'       => 'Automattic\WooCommerce\Admin\API\Reports\Variations\DataStore',
				'report-products-stats'   => 'Automattic\WooCommerce\Admin\API\Reports\Products\Stats\DataStore',
				'report-variations-stats' => 'Automattic\WooCommerce\Admin\API\Reports\Variations\Stats\DataStore',
				'report-categories'       => 'Automattic\WooCommerce\Admin\API\Reports\Categories\DataStore',
				'report-taxes'            => 'Automattic\WooCommerce\Admin\API\Reports\Taxes\DataStore',
				'report-taxes-stats'      => 'Automattic\WooCommerce\Admin\API\Reports\Taxes\Stats\DataStore',
				'report-coupons'          => 'Automattic\WooCommerce\Admin\API\Reports\Coupons\DataStore',
				'report-coupons-stats'    => 'Automattic\WooCommerce\Admin\API\Reports\Coupons\Stats\DataStore',
				'report-downloads'        => 'Automattic\WooCommerce\Admin\API\Reports\Downloads\DataStore',
				'report-downloads-stats'  => 'Automattic\WooCommerce\Admin\API\Reports\Downloads\Stats\DataStore',
				'admin-note'              => 'Automattic\WooCommerce\Admin\Notes\DataStore',
				'report-customers'        => 'Automattic\WooCommerce\Admin\API\Reports\Customers\DataStore',
				'report-customers-stats'  => 'Automattic\WooCommerce\Admin\API\Reports\Customers\Stats\DataStore',
				'report-stock-stats'      => 'Automattic\WooCommerce\Admin\API\Reports\Stock\Stats\DataStore',
			)
		);
	}

	/**
	 * Add the currency symbol (in addition to currency code) to each Order
	 * object in REST API responses. For use in formatAmount().
	 *
	 * @param {WP_REST_Response} $response REST response object.
	 * @returns {WP_REST_Response}
	 */
	public static function add_currency_symbol_to_order_response( $response ) {
		$response_data                    = $response->get_data();
		$currency_code                    = $response_data['currency'];
		$currency_symbol                  = get_woocommerce_currency_symbol( $currency_code );
		$response_data['currency_symbol'] = html_entity_decode( $currency_symbol );
		$response->set_data( $response_data );

		return $response;
	}
}
woocommerce-admin/src/API/OnboardingProductTypes.php000064400000003406151335517650016550 0ustar00<?php
/**
 * REST API Onboarding Product Types Controller
 *
 * Handles requests to /onboarding/product-types
 */

namespace Automattic\WooCommerce\Admin\API;

use Automattic\WooCommerce\Admin\Features\Onboarding;

defined( 'ABSPATH' ) || exit;

/**
 * Onboarding Product Types Controller.
 *
 * @extends WC_REST_Data_Controller
 */
class OnboardingProductTypes extends \WC_REST_Data_Controller {

	/**
	 * Endpoint namespace.
	 *
	 * @var string
	 */
	protected $namespace = 'wc-admin';

	/**
	 * Route base.
	 *
	 * @var string
	 */
	protected $rest_base = 'onboarding/product-types';

	/**
	 * Register routes.
	 */
	public function register_routes() {
		register_rest_route(
			$this->namespace,
			'/' . $this->rest_base,
			array(
				array(
					'methods'             => \WP_REST_Server::READABLE,
					'callback'            => array( $this, 'get_product_types' ),
					'permission_callback' => array( $this, 'get_items_permissions_check' ),
				),
				'schema' => array( $this, 'get_public_item_schema' ),
			)
		);
	}

	/**
	 * Check whether a given request has permission to read onboarding profile data.
	 *
	 * @param  WP_REST_Request $request Full details about the request.
	 * @return WP_Error|boolean
	 */
	public function get_items_permissions_check( $request ) {
		if ( ! wc_rest_check_manager_permissions( 'settings', 'read' ) ) {
			return new \WP_Error( 'woocommerce_rest_cannot_view', __( 'Sorry, you cannot list resources.', 'woocommerce' ), array( 'status' => rest_authorization_required_code() ) );
		}

		return true;
	}

	/**
	 * Return available product types.
	 *
	 * @param \WP_REST_Request $request Request data.
	 *
	 * @return \WP_Error|\WP_REST_Response
	 */
	public function get_product_types( $request ) {
		return Onboarding::get_allowed_product_types();
	}

}
woocommerce-admin/src/API/MarketingOverview.php000064400000006546151335517650015560 0ustar00<?php
/**
 * REST API Marketing Overview Controller
 *
 * Handles requests to /marketing/overview.
 */

namespace Automattic\WooCommerce\Admin\API;

use Automattic\WooCommerce\Admin\Marketing\InstalledExtensions;
use Automattic\WooCommerce\Admin\PluginsHelper;

defined( 'ABSPATH' ) || exit;

/**
 * Marketing Overview Controller.
 *
 * @extends WC_REST_Data_Controller
 */
class MarketingOverview extends \WC_REST_Data_Controller {

	/**
	 * Endpoint namespace.
	 *
	 * @var string
	 */
	protected $namespace = 'wc-admin';

	/**
	 * Route base.
	 *
	 * @var string
	 */
	protected $rest_base = 'marketing/overview';

	/**
	 * Register routes.
	 */
	public function register_routes() {
		register_rest_route(
			$this->namespace,
			'/' . $this->rest_base . '/activate-plugin',
			array(
				array(
					'methods'             => \WP_REST_Server::EDITABLE,
					'callback'            => array( $this, 'activate_plugin' ),
					'permission_callback' => array( $this, 'install_plugins_permissions_check' ),
					'args'                => array(
						'plugin' => array(
							'required'          => true,
							'type'              => 'string',
							'validate_callback' => 'rest_validate_request_arg',
							'sanitize_callback' => 'sanitize_title_with_dashes',
						),
					),
				),
				'schema' => array( $this, 'get_item_schema' ),
			)
		);

		register_rest_route(
			$this->namespace,
			'/' . $this->rest_base . '/installed-plugins',
			array(
				array(
					'methods'             => \WP_REST_Server::READABLE,
					'callback'            => array( $this, 'get_installed_plugins' ),
					'permission_callback' => array( $this, 'get_items_permissions_check' ),
				),
				'schema' => array( $this, 'get_public_item_schema' ),
			)
		);
	}

	/**
	 * Return installed marketing extensions data.
	 *
	 * @param \WP_REST_Request $request Request data.
	 *
	 * @return \WP_Error|\WP_REST_Response
	 */
	public function activate_plugin( $request ) {
		$plugin_slug = $request->get_param( 'plugin' );

		if ( ! PluginsHelper::is_plugin_installed( $plugin_slug ) ) {
			return new \WP_Error( 'woocommerce_rest_invalid_plugin', __( 'Invalid plugin.', 'woocommerce' ), 404 );
		}

		$result = activate_plugin( PluginsHelper::get_plugin_path_from_slug( $plugin_slug ) );

		if ( ! is_null( $result ) ) {
			return new \WP_Error( 'woocommerce_rest_invalid_plugin', __( 'The plugin could not be activated.', 'woocommerce' ), 500 );
		}

		// IMPORTANT - Don't return the active plugins data here.
		// Instead we will get that data in a separate request to ensure they are loaded.
		return rest_ensure_response(
			array(
				'status' => 'success',
			)
		);
	}

	/**
	 * Check if a given request has access to manage plugins.
	 *
	 * @param \WP_REST_Request $request Full details about the request.
	 *
	 * @return \WP_Error|boolean
	 */
	public function install_plugins_permissions_check( $request ) {
		if ( ! current_user_can( 'install_plugins' ) ) {
			return new \WP_Error( 'woocommerce_rest_cannot_update', __( 'Sorry, you cannot manage plugins.', 'woocommerce' ), array( 'status' => rest_authorization_required_code() ) );
		}

		return true;
	}

	/**
	 * Return installed marketing extensions data.
	 *
	 * @param \WP_REST_Request $request Request data.
	 *
	 * @return \WP_Error|\WP_REST_Response
	 */
	public function get_installed_plugins( $request ) {
		return rest_ensure_response( InstalledExtensions::get_data() );
	}

}
woocommerce-admin/src/API/OnboardingThemes.php000064400000013750151335517650015333 0ustar00<?php
/**
 * REST API Onboarding Themes Controller
 *
 * Handles requests to install and activate themes.
 */

namespace Automattic\WooCommerce\Admin\API;

use Automattic\WooCommerce\Admin\Features\Onboarding;

defined( 'ABSPATH' ) || exit;

/**
 * Onboarding Themes Controller.
 *
 * @extends WC_REST_Data_Controller
 */
class OnboardingThemes extends \WC_REST_Data_Controller {
	/**
	 * Endpoint namespace.
	 *
	 * @var string
	 */
	protected $namespace = 'wc-admin';

	/**
	 * Route base.
	 *
	 * @var string
	 */
	protected $rest_base = 'onboarding/themes';

	/**
	 * Register routes.
	 */
	public function register_routes() {
		register_rest_route(
			$this->namespace,
			'/' . $this->rest_base . '/install',
			array(
				array(
					'methods'             => \WP_REST_Server::EDITABLE,
					'callback'            => array( $this, 'install_theme' ),
					'permission_callback' => array( $this, 'update_item_permissions_check' ),
				),
				'schema' => array( $this, 'get_item_schema' ),
			)
		);

		register_rest_route(
			$this->namespace,
			'/' . $this->rest_base . '/activate',
			array(
				array(
					'methods'             => \WP_REST_Server::EDITABLE,
					'callback'            => array( $this, 'activate_theme' ),
					'permission_callback' => array( $this, 'update_item_permissions_check' ),
				),
				'schema' => array( $this, 'get_item_schema' ),
			)
		);
	}

	/**
	 * Check if a given request has access to manage themes.
	 *
	 * @param  WP_REST_Request $request Full details about the request.
	 * @return WP_Error|boolean
	 */
	public function update_item_permissions_check( $request ) {
		if ( ! current_user_can( 'install_themes' ) ) {
			return new \WP_Error( 'woocommerce_rest_cannot_update', __( 'Sorry, you cannot manage themes.', 'woocommerce' ), array( 'status' => rest_authorization_required_code() ) );
		}
		return true;
	}

	/**
	 * Installs the requested theme.
	 *
	 * @param  WP_REST_Request $request Full details about the request.
	 * @return WP_Error|array Theme installation status.
	 */
	public function install_theme( $request ) {
		$allowed_themes = Onboarding::get_allowed_themes();
		$theme          = sanitize_text_field( $request['theme'] );

		if ( ! in_array( $theme, $allowed_themes, true ) ) {
			return new \WP_Error( 'woocommerce_rest_invalid_theme', __( 'Invalid theme.', 'woocommerce' ), 404 );
		}

		$installed_themes = wp_get_themes();

		if ( in_array( $theme, array_keys( $installed_themes ), true ) ) {
			return( array(
				'slug'   => $theme,
				'name'   => $installed_themes[ $theme ]->get( 'Name' ),
				'status' => 'success',
			) );
		}

		include_once ABSPATH . '/wp-admin/includes/admin.php';
		include_once ABSPATH . '/wp-admin/includes/theme-install.php';
		include_once ABSPATH . '/wp-admin/includes/theme.php';
		include_once ABSPATH . '/wp-admin/includes/class-wp-upgrader.php';
		include_once ABSPATH . '/wp-admin/includes/class-theme-upgrader.php';

		$api = themes_api(
			'theme_information',
			array(
				'slug'   => $theme,
				'fields' => array(
					'sections' => false,
				),
			)
		);

		if ( is_wp_error( $api ) ) {
			return new \WP_Error(
				'woocommerce_rest_theme_install',
				sprintf(
					/* translators: %s: theme slug (example: woocommerce-services) */
					__( 'The requested theme `%s` could not be installed. Theme API call failed.', 'woocommerce' ),
					$theme
				),
				500
			);
		}

		$upgrader = new \Theme_Upgrader( new \Automatic_Upgrader_Skin() );
		$result   = $upgrader->install( $api->download_link );

		if ( is_wp_error( $result ) || is_null( $result ) ) {
			return new \WP_Error(
				'woocommerce_rest_theme_install',
				sprintf(
					/* translators: %s: theme slug (example: woocommerce-services) */
					__( 'The requested theme `%s` could not be installed.', 'woocommerce' ),
					$theme
				),
				500
			);
		}

		return array(
			'slug'   => $theme,
			'name'   => $api->name,
			'status' => 'success',
		);
	}

	/**
	 * Activate the requested theme.
	 *
	 * @param  WP_REST_Request $request Full details about the request.
	 * @return WP_Error|array Theme activation status.
	 */
	public function activate_theme( $request ) {
		$allowed_themes = Onboarding::get_allowed_themes();
		$theme          = sanitize_text_field( $request['theme'] );
		if ( ! in_array( $theme, $allowed_themes, true ) ) {
			return new \WP_Error( 'woocommerce_rest_invalid_theme', __( 'Invalid theme.', 'woocommerce' ), 404 );
		}

		require_once ABSPATH . 'wp-admin/includes/theme.php';

		$installed_themes = wp_get_themes();

		if ( ! in_array( $theme, array_keys( $installed_themes ), true ) ) {
			/* translators: %s: theme slug (example: woocommerce-services) */
			return new \WP_Error( 'woocommerce_rest_invalid_theme', sprintf( __( 'Invalid theme %s.', 'woocommerce' ), $theme ), 404 );
		}

		$result = switch_theme( $theme );
		if ( ! is_null( $result ) ) {
			return new \WP_Error( 'woocommerce_rest_invalid_theme', sprintf( __( 'The requested theme could not be activated.', 'woocommerce' ), $theme ), 500 );
		}

		return( array(
			'slug'   => $theme,
			'name'   => $installed_themes[ $theme ]->get( 'Name' ),
			'status' => 'success',
		) );
	}

	/**
	 * Get the schema, conforming to JSON Schema.
	 *
	 * @return array
	 */
	public function get_item_schema() {
		$schema = array(
			'$schema'    => 'http://json-schema.org/draft-04/schema#',
			'title'      => 'onboarding_theme',
			'type'       => 'object',
			'properties' => array(
				'slug'   => array(
					'description' => __( 'Theme slug.', 'woocommerce' ),
					'type'        => 'string',
					'context'     => array( 'view', 'edit' ),
					'readonly'    => true,
				),
				'name'   => array(
					'description' => __( 'Theme name.', 'woocommerce' ),
					'type'        => 'string',
					'context'     => array( 'view', 'edit' ),
					'readonly'    => true,
				),
				'status' => array(
					'description' => __( 'Theme status.', 'woocommerce' ),
					'type'        => 'string',
					'context'     => array( 'view', 'edit' ),
					'readonly'    => true,
				),
			),
		);

		return $this->add_additional_fields_schema( $schema );
	}
}
woocommerce-admin/src/API/ProductReviews.php000064400000002445151335517650015067 0ustar00<?php
/**
 * REST API Product Reviews Controller
 *
 * Handles requests to /products/reviews.
 */

namespace Automattic\WooCommerce\Admin\API;

defined( 'ABSPATH' ) || exit;

/**
 * Product reviews controller.
 *
 * @extends WC_REST_Product_Reviews_Controller
 */
class ProductReviews extends \WC_REST_Product_Reviews_Controller {
	/**
	 * Endpoint namespace.
	 *
	 * @var string
	 */
	protected $namespace = 'wc-analytics';

	/**
	 * Prepare links for the request.
	 *
	 * @param WP_Comment $review Product review object.
	 * @return array Links for the given product review.
	 */
	protected function prepare_links( $review ) {
		$links = array(
			'self'       => array(
				'href' => rest_url( sprintf( '/%s/%s/%d', $this->namespace, $this->rest_base, $review->comment_ID ) ),
			),
			'collection' => array(
				'href' => rest_url( sprintf( '/%s/%s', $this->namespace, $this->rest_base ) ),
			),
		);
		if ( 0 !== (int) $review->comment_post_ID ) {
			$links['up'] = array(
				'href'       => rest_url( sprintf( '/%s/products/%d', $this->namespace, $review->comment_post_ID ) ),
				'embeddable' => true,
			);
		}
		if ( 0 !== (int) $review->user_id ) {
			$links['reviewer'] = array(
				'href'       => rest_url( 'wp/v2/users/' . $review->user_id ),
				'embeddable' => true,
			);
		}
		return $links;
	}
}
woocommerce-admin/src/API/NoteActions.php000064400000004525151335517650014331 0ustar00<?php
/**
 * REST API Admin Note Action controller
 *
 * Handles requests to the admin note action endpoint.
 */

namespace Automattic\WooCommerce\Admin\API;

defined( 'ABSPATH' ) || exit;

use Automattic\WooCommerce\Admin\Notes\Note;
use \Automattic\WooCommerce\Admin\Notes\Notes as NotesFactory;

/**
 * REST API Admin Note Action controller class.
 *
 * @extends WC_REST_CRUD_Controller
 */
class NoteActions extends Notes {

	/**
	 * Register the routes for admin notes.
	 */
	public function register_routes() {
		register_rest_route(
			$this->namespace,
			'/' . $this->rest_base . '/(?P<note_id>[\d-]+)/action/(?P<action_id>[\d-]+)',
			array(
				'args'   => array(
					'note_id'   => array(
						'description' => __( 'Unique ID for the Note.', 'woocommerce' ),
						'type'        => 'integer',
					),
					'action_id' => array(
						'description' => __( 'Unique ID for the Note Action.', 'woocommerce' ),
						'type'        => 'integer',
					),
				),
				array(
					'methods'             => \WP_REST_Server::EDITABLE,
					'callback'            => array( $this, 'trigger_note_action' ),
					// @todo - double check these permissions for taking note actions.
					'permission_callback' => array( $this, 'get_item_permissions_check' ),
				),
				'schema' => array( $this, 'get_public_item_schema' ),
			)
		);
	}

	/**
	 * Trigger a note action.
	 *
	 * @param WP_REST_Request $request Full details about the request.
	 * @return WP_REST_Request|WP_Error
	 */
	public function trigger_note_action( $request ) {
		$note = NotesFactory::get_note( $request->get_param( 'note_id' ) );

		if ( ! $note ) {
			return new \WP_Error(
				'woocommerce_note_invalid_id',
				__( 'Sorry, there is no resource with that ID.', 'woocommerce' ),
				array( 'status' => 404 )
			);
		}

		$triggered_action = NotesFactory::get_action_by_id( $note, $request->get_param( 'action_id' ) );

		if ( ! $triggered_action ) {
			return new \WP_Error(
				'woocommerce_note_action_invalid_id',
				__( 'Sorry, there is no resource with that ID.', 'woocommerce' ),
				array( 'status' => 404 )
			);
		}

		$triggered_note = NotesFactory::trigger_note_action( $note, $triggered_action );

		$data = $triggered_note->get_data();
		$data = $this->prepare_item_for_response( $data, $request );
		$data = $this->prepare_response_for_collection( $data );

		return rest_ensure_response( $data );
	}
}
woocommerce-admin/src/WCAdminHelper.php000064400000005310151335517650014105 0ustar00<?php
/**
 * WCAdminHelper
 *
 * Helper class for generic WCAdmin functions.
 */

namespace Automattic\WooCommerce\Admin;

defined( 'ABSPATH' ) || exit;

/**
 * Class WCAdminHelper
 */
class WCAdminHelper {
	/**
	 * WC Admin timestamp option name.
	 */
	const WC_ADMIN_TIMESTAMP_OPTION = 'woocommerce_admin_install_timestamp';

	const WC_ADMIN_STORE_AGE_RANGES = array(
		'week-1'    => array(
			'start' => 0,
			'end'   => WEEK_IN_SECONDS,
		),
		'week-1-4'  => array(
			'start' => WEEK_IN_SECONDS,
			'end'   => WEEK_IN_SECONDS * 4,
		),
		'month-1-3' => array(
			'start' => MONTH_IN_SECONDS,
			'end'   => MONTH_IN_SECONDS * 3,
		),
		'month-3-6' => array(
			'start' => MONTH_IN_SECONDS * 3,
			'end'   => MONTH_IN_SECONDS * 6,
		),
		'month-6+'  => array(
			'start' => MONTH_IN_SECONDS * 6,
		),
	);

	/**
	 * Get the number of seconds that the store has been active.
	 *
	 * @return number Number of seconds.
	 */
	public static function get_wcadmin_active_for_in_seconds() {
		$install_timestamp = get_option( self::WC_ADMIN_TIMESTAMP_OPTION );

		if ( false === $install_timestamp ) {
			$install_timestamp = time();
			update_option( self::WC_ADMIN_TIMESTAMP_OPTION, $install_timestamp );
		}

		return time() - $install_timestamp;
	}


	/**
	 * Test how long WooCommerce Admin has been active.
	 *
	 * @param int $seconds Time in seconds to check.
	 * @return bool Whether or not WooCommerce admin has been active for $seconds.
	 */
	public static function is_wc_admin_active_for( $seconds ) {
		$wc_admin_active_for = self::get_wcadmin_active_for_in_seconds();

		return ( $wc_admin_active_for >= $seconds );
	}

	/**
	 * Test if WooCommerce Admin has been active within a pre-defined range.
	 *
	 * @param string $range range available in WC_ADMIN_STORE_AGE_RANGES.
	 * @param int    $custom_start custom start in range.
	 * @throws \InvalidArgumentException Throws exception when invalid $range is passed in.
	 * @return bool Whether or not WooCommerce admin has been active within the range.
	 */
	public static function is_wc_admin_active_in_date_range( $range, $custom_start = null ) {
		if ( ! array_key_exists( $range, self::WC_ADMIN_STORE_AGE_RANGES ) ) {
			throw new \InvalidArgumentException(
				sprintf(
					'"%s" range is not supported, use one of: %s',
					$range,
					implode( ', ', array_keys( self::WC_ADMIN_STORE_AGE_RANGES ) )
				)
			);
		}
		$wc_admin_active_for = self::get_wcadmin_active_for_in_seconds();

		$range_data = self::WC_ADMIN_STORE_AGE_RANGES[ $range ];
		$start      = null !== $custom_start ? $custom_start : $range_data['start'];
		if ( $range_data && $wc_admin_active_for >= $start ) {
			return isset( $range_data['end'] ) ? $wc_admin_active_for < $range_data['end'] : true;
		}
		return false;
	}
}
woocommerce-admin/license.txt000064400000106736151335517650012364 0ustar00WooCommerce - eCommerce for WordPress

Copyright 2015 by the contributors

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA

This program incorporates work covered by the following copyright and
permission notices:

  Jigoshop is Copyright (c) 2011 Jigowatt Ltd.
  http://jigowatt.com - http://jigoshop.com

  Jigoshop is released under the GPL

and

  WooCommerce - eCommerce for WordPress

  WooCommerce is Copyright (c) 2015 WooThemes

  WooCommerce is released under the GPL

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

  GNU GENERAL PUBLIC LICENSE
                       Version 3, 29 June 2007

 Copyright © 2007 Free Software Foundation, Inc. <https://fsf.org/>
 Everyone is permitted to copy and distribute verbatim copies
 of this license document, but changing it is not allowed.

                            Preamble

  The GNU General Public License is a free, copyleft license for
software and other kinds of works.

  The licenses for most software and other practical works are designed
to take away your freedom to share and change the works.  By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users.  We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors.  You can apply it to
your programs, too.

  When we speak of free software, we are referring to freedom, not
price.  Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.

  To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights.  Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.

  For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received.  You must make sure that they, too, receive
or can get the source code.  And you must show them these terms so they
know their rights.

  Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.

  For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software.  For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.

  Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so.  This is fundamentally incompatible with the aim of
protecting users' freedom to change the software.  The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable.  Therefore, we
have designed this version of the GPL to prohibit the practice for those
products.  If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.

  Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary.  To prevent this, the GPL assures that
patents cannot be used to render the program non-free.

  The precise terms and conditions for copying, distribution and
modification follow.

                       TERMS AND CONDITIONS

  0. Definitions.

  "This License" refers to version 3 of the GNU General Public License.

  "Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.

  "The Program" refers to any copyrightable work licensed under this
License.  Each licensee is addressed as "you".  "Licensees" and
"recipients" may be individuals or organizations.

  To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy.  The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.

  A "covered work" means either the unmodified Program or a work based
on the Program.

  To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy.  Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.

  To "convey" a work means any kind of propagation that enables other
parties to make or receive copies.  Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.

  An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License.  If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.

  1. Source Code.

  The "source code" for a work means the preferred form of the work
for making modifications to it.  "Object code" means any non-source
form of a work.

  A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.

  The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form.  A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.

  The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities.  However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work.  For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.

  The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.

  The Corresponding Source for a work in source code form is that
same work.

  2. Basic Permissions.

  All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met.  This License explicitly affirms your unlimited
permission to run the unmodified Program.  The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work.  This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.

  You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force.  You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright.  Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.

  Conveying under any other circumstances is permitted solely under
the conditions stated below.  Sublicensing is not allowed; section 10
makes it unnecessary.

  3. Protecting Users' Legal Rights From Anti-Circumvention Law.

  No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.

  When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.

  4. Conveying Verbatim Copies.

  You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.

  You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.

  5. Conveying Modified Source Versions.

  You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:

    a) The work must carry prominent notices stating that you modified
    it, and giving a relevant date.

    b) The work must carry prominent notices stating that it is
    released under this License and any conditions added under section
    7.  This requirement modifies the requirement in section 4 to
    "keep intact all notices".

    c) You must license the entire work, as a whole, under this
    License to anyone who comes into possession of a copy.  This
    License will therefore apply, along with any applicable section 7
    additional terms, to the whole of the work, and all its parts,
    regardless of how they are packaged.  This License gives no
    permission to license the work in any other way, but it does not
    invalidate such permission if you have separately received it.

    d) If the work has interactive user interfaces, each must display
    Appropriate Legal Notices; however, if the Program has interactive
    interfaces that do not display Appropriate Legal Notices, your
    work need not make them do so.

  A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit.  Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.

  6. Conveying Non-Source Forms.

  You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:

    a) Convey the object code in, or embodied in, a physical product
    (including a physical distribution medium), accompanied by the
    Corresponding Source fixed on a durable physical medium
    customarily used for software interchange.

    b) Convey the object code in, or embodied in, a physical product
    (including a physical distribution medium), accompanied by a
    written offer, valid for at least three years and valid for as
    long as you offer spare parts or customer support for that product
    model, to give anyone who possesses the object code either (1) a
    copy of the Corresponding Source for all the software in the
    product that is covered by this License, on a durable physical
    medium customarily used for software interchange, for a price no
    more than your reasonable cost of physically performing this
    conveying of source, or (2) access to copy the
    Corresponding Source from a network server at no charge.

    c) Convey individual copies of the object code with a copy of the
    written offer to provide the Corresponding Source.  This
    alternative is allowed only occasionally and noncommercially, and
    only if you received the object code with such an offer, in accord
    with subsection 6b.

    d) Convey the object code by offering access from a designated
    place (gratis or for a charge), and offer equivalent access to the
    Corresponding Source in the same way through the same place at no
    further charge.  You need not require recipients to copy the
    Corresponding Source along with the object code.  If the place to
    copy the object code is a network server, the Corresponding Source
    may be on a different server (operated by you or a third party)
    that supports equivalent copying facilities, provided you maintain
    clear directions next to the object code saying where to find the
    Corresponding Source.  Regardless of what server hosts the
    Corresponding Source, you remain obligated to ensure that it is
    available for as long as needed to satisfy these requirements.

    e) Convey the object code using peer-to-peer transmission, provided
    you inform other peers where the object code and Corresponding
    Source of the work are being offered to the general public at no
    charge under subsection 6d.

  A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.

  A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling.  In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage.  For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product.  A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.

  "Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source.  The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.

  If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information.  But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).

  The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed.  Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.

  Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.

  7. Additional Terms.

  "Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law.  If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.

  When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it.  (Additional permissions may be written to require their own
removal in certain cases when you modify the work.)  You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.

  Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:

    a) Disclaiming warranty or limiting liability differently from the
    terms of sections 15 and 16 of this License; or

    b) Requiring preservation of specified reasonable legal notices or
    author attributions in that material or in the Appropriate Legal
    Notices displayed by works containing it; or

    c) Prohibiting misrepresentation of the origin of that material, or
    requiring that modified versions of such material be marked in
    reasonable ways as different from the original version; or

    d) Limiting the use for publicity purposes of names of licensors or
    authors of the material; or

    e) Declining to grant rights under trademark law for use of some
    trade names, trademarks, or service marks; or

    f) Requiring indemnification of licensors and authors of that
    material by anyone who conveys the material (or modified versions of
    it) with contractual assumptions of liability to the recipient, for
    any liability that these contractual assumptions directly impose on
    those licensors and authors.

  All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10.  If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term.  If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.

  If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.

  Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.

  8. Termination.

  You may not propagate or modify a covered work except as expressly
provided under this License.  Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).

  However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.

  Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.

  Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License.  If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.

  9. Acceptance Not Required for Having Copies.

  You are not required to accept this License in order to receive or
run a copy of the Program.  Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance.  However,
nothing other than this License grants you permission to propagate or
modify any covered work.  These actions infringe copyright if you do
not accept this License.  Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.

  10. Automatic Licensing of Downstream Recipients.

  Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License.  You are not responsible
for enforcing compliance by third parties with this License.

  An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations.  If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.

  You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License.  For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.

  11. Patents.

  A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based.  The
work thus licensed is called the contributor's "contributor version".

  A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version.  For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.

  Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.

  In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement).  To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.

  If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients.  "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.

  If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.

  A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License.  You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.

  Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.

  12. No Surrender of Others' Freedom.

  If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License.  If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all.  For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.

  13. Use with the GNU Affero General Public License.

  Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work.  The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.

  14. Revised Versions of this License.

  The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time.  Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.

  Each version is given a distinguishing version number.  If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation.  If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.

  If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.

  Later license versions may give you additional or different
permissions.  However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.

  15. Disclaimer of Warranty.

  THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW.  EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU.  SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.

  16. Limitation of Liability.

  IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.

  17. Interpretation of Sections 15 and 16.

  If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.

                     END OF TERMS AND CONDITIONS

            How to Apply These Terms to Your New Programs

  If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.

  To do so, attach the following notices to the program.  It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.

    <one line to give the program's name and a brief idea of what it does.>
    Copyright © <year>  <name of author>

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <https://www.gnu.org/licenses/>.

Also add information on how to contact you by electronic and paper mail.

  If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:

    <program>  Copyright © <year>  <name of author>
    This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
    This is free software, and you are welcome to redistribute it
    under certain conditions; type `show c' for details.

The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License.  Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".

  You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<https://www.gnu.org/licenses/>.

  The GNU General Public License does not permit incorporating your program
into proprietary programs.  If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library.  If this is what you want to do, use the GNU Lesser General
Public License instead of this License.  But first, please read
<https://www.gnu.org/philosophy/why-not-lgpl.html>.woocommerce-admin/lint-staged.config.js000064400000002256151335517650014206 0ustar00module.exports = {
	'*.scss': [ 'npm run lint:css-fix' ],
	'client/**/*.(t|j)s?(x)': [
		'wp-scripts format-js',
		'wp-scripts lint-js',
		'npm run test-staged',
	],
	'packages/**/*.(t|j)s?(x)': ( packageFiles ) => {
		const globalScripts = [
			`wp-scripts format-js ${ packageFiles.join( ' ' ) }`,
			`wp-scripts lint-js ${ packageFiles.join( ' ' ) }`,
		];

		const filesByPackage = packageFiles.reduce(
			( packages, packageFile ) => {
				const packageNameMatch = packageFile.match(
					/\/packages\/([a-z0-9\-]+)\//
				);

				if ( ! packageNameMatch ) {
					return packages;
				}

				const packageName = packageNameMatch[ 1 ];

				if ( Array.isArray( packages[ packageName ] ) ) {
					packages[ packageName ].push( packageFile );
				} else {
					packages[ packageName ] = [ packageFile ];
				}

				return packages;
			},
			{}
		);

		const workspaceScripts = Object.keys( filesByPackage ).map(
			( packageName ) =>
				`lerna --scope @woocommerce/${ packageName } run test-staged -- ${ filesByPackage[
					packageName
				].join( ' ' ) }`
		);

		return globalScripts.concat( workspaceScripts );
	},
	'*.php': [ 'php -d display_errors=1 -l', 'composer run-script phpcs' ],
};
woocommerce-admin/unminify.js000064400000005141151335517650012361 0ustar00/**
 * Repurposed UnminifiedWebpackPlugin.
 *
 * See: https://github.com/leftstick/unminified-webpack-plugin/blob/master/index.js
 *
 * Changes:
 * 1. Remove check for UglifyJsPlugin - Terser is the successor.
 * 2. Remove check for development mode - we always want unminified files.
 * 3. Remove BannerPlugin support - we don't use it.
 * 4. Remove the 'min' suffix from the chunk loaded in the new `mainEntry` option.
 * 5. Hook into compilation later so we're running after Source Map generation.
 */
const path = require( 'path' );
const ModuleFilenameHelpers = require( 'webpack/lib/ModuleFilenameHelpers' );

const getFileName = ( name, ext, opts ) => {
	if ( name.match(/([-_.]min)[-_.]/ ) ) {
		return name.replace( /[-_.]min/, '' );
	}

	const suffix = ( opts.postfix || 'nomin' ) + '.' + ext;
	if ( name.match( new RegExp( '\.' + ext + '$' ) ) ) {
		return name.replace( new RegExp( ext + '$' ), suffix )
	}

	return name + suffix;
};

class UnminifyWebpackPlugin {
	constructor( opts ) {
		const options = opts || {};

		this.options = {
			test: options.test || /\.(js|css)($|\?)/i,
			mainEntry: options.mainEntry || false,
		};
	}

	apply( compiler ) {
		// Hook after asset optimization if we're using a devtool (source map).
		// @todo: Update to afterFinishAssets for Webpack 5.x?
		const compilationHook = compiler.options.devtool ? 'afterOptimizeAssets' : 'additionalAssets';

		compiler.hooks.compilation.tap( 'UnminifyWebpackPlugin', ( compilation ) => {
			compilation.hooks[ compilationHook ].tap( 'UnminifyWebpackPlugin', () => {
				const files = [
					...compilation.additionalChunkAssets
				];
	
				compilation.chunks.forEach( chunk => files.push( ...chunk.files ) );

				const finalFiles = files.filter( ModuleFilenameHelpers.matchObject.bind( null, this.options ) );

				finalFiles.forEach( ( minified ) => {
					const asset = compilation.assets[ minified ];
					let source = asset.source();
					const ext = path.extname( minified ).substr( 1 );
					const unminified = getFileName( minified, ext, this.options );
	
					// Remove the ".min" suffix from the lazy loaded chunk filenames.
					if ( this.options.mainEntry && minified === this.options.mainEntry ) {
						// See: https://github.com/webpack/webpack/blob/v4.43.0/lib/web/JsonpMainTemplatePlugin.js#L129
						// NOTE: This will break with Webpack 5.x!
						source = source.replace( / \+ "\.min\.js"$/m, ' + ".js"' );
					}
	
					compilation.assets[ unminified ] = {
						source: () => {
							return source;
						},
						size: () => {
							return source.length;
						}
					};
				} );
			} );
		} );
	}
}

module.exports = UnminifyWebpackPlugin;
woocommerce-admin/vendor/automattic/jetpack-autoloader/src/class-shutdown-handler.php000064400000005203151335517650025302 0ustar00<?php
/* HEADER */ // phpcs:ignore

/**
 * This class handles the shutdown of the autoloader.
 */
class Shutdown_Handler {

	/**
	 * The Plugins_Handler instance.
	 *
	 * @var Plugins_Handler
	 */
	private $plugins_handler;

	/**
	 * The plugins cached by this autoloader.
	 *
	 * @var string[]
	 */
	private $cached_plugins;

	/**
	 * Indicates whether or not this autoloader was included by another.
	 *
	 * @var bool
	 */
	private $was_included_by_autoloader;

	/**
	 * Constructor.
	 *
	 * @param Plugins_Handler $plugins_handler The Plugins_Handler instance to use.
	 * @param string[]        $cached_plugins The plugins cached by the autoloaer.
	 * @param bool            $was_included_by_autoloader Indicates whether or not the autoloader was included by another.
	 */
	public function __construct( $plugins_handler, $cached_plugins, $was_included_by_autoloader ) {
		$this->plugins_handler            = $plugins_handler;
		$this->cached_plugins             = $cached_plugins;
		$this->was_included_by_autoloader = $was_included_by_autoloader;
	}

	/**
	 * Handles the shutdown of the autoloader.
	 */
	public function __invoke() {
		// Don't save a broken cache if an error happens during some plugin's initialization.
		if ( ! did_action( 'plugins_loaded' ) ) {
			// Ensure that the cache is emptied to prevent consecutive failures if the cache is to blame.
			if ( ! empty( $this->cached_plugins ) ) {
				$this->plugins_handler->cache_plugins( array() );
			}

			return;
		}

		// Load the active plugins fresh since the list we pulled earlier might not contain
		// plugins that were activated but did not reset the autoloader. This happens
		// when a plugin is in the cache but not "active" when the autoloader loads.
		// We also want to make sure that plugins which are deactivating are not
		// considered "active" so that they will be removed from the cache now.
		try {
			$active_plugins = $this->plugins_handler->get_active_plugins( false, ! $this->was_included_by_autoloader );
		} catch ( \Exception $ex ) {
			// When the package is deleted before shutdown it will throw an exception.
			// In the event this happens we should erase the cache.
			if ( ! empty( $this->cached_plugins ) ) {
				$this->plugins_handler->cache_plugins( array() );
			}
			return;
		}

		// The paths should be sorted for easy comparisons with those loaded from the cache.
		// Note we don't need to sort the cached entries because they're already sorted.
		sort( $active_plugins );

		// We don't want to waste time saving a cache that hasn't changed.
		if ( $this->cached_plugins === $active_plugins ) {
			return;
		}

		$this->plugins_handler->cache_plugins( $active_plugins );
	}
}
woocommerce-admin/vendor/automattic/jetpack-autoloader/src/class-path-processor.php000064400000012557151335517650024777 0ustar00<?php
/* HEADER */ // phpcs:ignore

/**
 * This class handles dealing with paths for the autoloader.
 */
class Path_Processor {
	/**
	 * Given a path this will replace any of the path constants with a token to represent it.
	 *
	 * @param string $path The path we want to process.
	 *
	 * @return string The tokenized path.
	 */
	public function tokenize_path_constants( $path ) {
		$path = wp_normalize_path( $path );

		$constants = $this->get_normalized_constants();
		foreach ( $constants as $constant => $constant_path ) {
			$len = strlen( $constant_path );
			if ( substr( $path, 0, $len ) !== $constant_path ) {
				continue;
			}

			return substr_replace( $path, '{{' . $constant . '}}', 0, $len );
		}

		return $path;
	}

	/**
	 * Given a path this will replace any of the path constant tokens with the expanded path.
	 *
	 * @param string $tokenized_path The path we want to process.
	 *
	 * @return string The expanded path.
	 */
	public function untokenize_path_constants( $tokenized_path ) {
		$tokenized_path = wp_normalize_path( $tokenized_path );

		$constants = $this->get_normalized_constants();
		foreach ( $constants as $constant => $constant_path ) {
			$constant = '{{' . $constant . '}}';

			$len = strlen( $constant );
			if ( substr( $tokenized_path, 0, $len ) !== $constant ) {
				continue;
			}

			return $this->get_real_path( substr_replace( $tokenized_path, $constant_path, 0, $len ) );
		}

		return $tokenized_path;
	}

	/**
	 * Given a file and an array of places it might be, this will find the absolute path and return it.
	 *
	 * @param string $file The plugin or theme file to resolve.
	 * @param array  $directories_to_check The directories we should check for the file if it isn't an absolute path.
	 *
	 * @return string|false Returns the absolute path to the directory, otherwise false.
	 */
	public function find_directory_with_autoloader( $file, $directories_to_check ) {
		$file = wp_normalize_path( $file );

		if ( ! $this->is_absolute_path( $file ) ) {
			$file = $this->find_absolute_plugin_path( $file, $directories_to_check );
			if ( ! isset( $file ) ) {
				return false;
			}
		}

		// We need the real path for consistency with __DIR__ paths.
		$file = $this->get_real_path( $file );

		// phpcs:disable WordPress.PHP.NoSilencedErrors.Discouraged
		$directory = @is_file( $file ) ? dirname( $file ) : $file;
		if ( ! @is_file( $directory . '/vendor/composer/jetpack_autoload_classmap.php' ) ) {
			return false;
		}
		// phpcs:enable WordPress.PHP.NoSilencedErrors.Discouraged

		return $directory;
	}

	/**
	 * Fetches an array of normalized paths keyed by the constant they came from.
	 *
	 * @return string[] The normalized paths keyed by the constant.
	 */
	private function get_normalized_constants() {
		$raw_constants = array(
			// Order the constants from most-specific to least-specific.
			'WP_PLUGIN_DIR',
			'WPMU_PLUGIN_DIR',
			'WP_CONTENT_DIR',
			'ABSPATH',
		);

		$constants = array();
		foreach ( $raw_constants as $raw ) {
			if ( ! defined( $raw ) ) {
				continue;
			}

			$path = wp_normalize_path( constant( $raw ) );
			if ( isset( $path ) ) {
				$constants[ $raw ] = $path;
			}
		}

		return $constants;
	}

	/**
	 * Indicates whether or not a path is absolute.
	 *
	 * @param string $path The path to check.
	 *
	 * @return bool True if the path is absolute, otherwise false.
	 */
	private function is_absolute_path( $path ) {
		if ( 0 === strlen( $path ) || '.' === $path[0] ) {
			return false;
		}

		// Absolute paths on Windows may begin with a drive letter.
		if ( preg_match( '/^[a-zA-Z]:[\/\\\\]/', $path ) ) {
			return true;
		}

		// A path starting with / or \ is absolute; anything else is relative.
		return ( '/' === $path[0] || '\\' === $path[0] );
	}

	/**
	 * Given a file and a list of directories to check, this method will try to figure out
	 * the absolute path to the file in question.
	 *
	 * @param string $normalized_path The normalized path to the plugin or theme file to resolve.
	 * @param array  $directories_to_check The directories we should check for the file if it isn't an absolute path.
	 *
	 * @return string|null The absolute path to the plugin file, otherwise null.
	 */
	private function find_absolute_plugin_path( $normalized_path, $directories_to_check ) {
		// We're only able to find the absolute path for plugin/theme PHP files.
		if ( ! is_string( $normalized_path ) || '.php' !== substr( $normalized_path, -4 ) ) {
			return null;
		}

		foreach ( $directories_to_check as $directory ) {
			$normalized_check = wp_normalize_path( trailingslashit( $directory ) ) . $normalized_path;
			// phpcs:ignore WordPress.PHP.NoSilencedErrors.Discouraged
			if ( @is_file( $normalized_check ) ) {
				return $normalized_check;
			}
		}

		return null;
	}

	/**
	 * Given a path this will figure out the real path that we should be using.
	 *
	 * @param string $path The path to resolve.
	 *
	 * @return string The resolved path.
	 */
	private function get_real_path( $path ) {
		// We want to resolve symbolic links for consistency with __DIR__ paths.
		// phpcs:ignore WordPress.PHP.NoSilencedErrors.Discouraged
		$real_path = @realpath( $path );
		if ( false === $real_path ) {
			// Let the autoloader deal with paths that don't exist.
			$real_path = $path;
		}

		// Using realpath will make it platform-specific so we must normalize it after.
		if ( $path !== $real_path ) {
			$real_path = wp_normalize_path( $real_path );
		}

		return $real_path;
	}
}
woocommerce-admin/vendor/automattic/jetpack-autoloader/src/class-version-loader.php000064400000007664151335517650024762 0ustar00<?php
/* HEADER */ // phpcs:ignore

/**
 * This class loads other classes based on given parameters.
 */
class Version_Loader {

	/**
	 * The Version_Selector object.
	 *
	 * @var Version_Selector
	 */
	private $version_selector;

	/**
	 * A map of available classes and their version and file path.
	 *
	 * @var array
	 */
	private $classmap;

	/**
	 * A map of PSR-4 namespaces and their version and directory path.
	 *
	 * @var array
	 */
	private $psr4_map;

	/**
	 * A map of all the files that we should load.
	 *
	 * @var array
	 */
	private $filemap;

	/**
	 * The constructor.
	 *
	 * @param Version_Selector $version_selector The Version_Selector object.
	 * @param array            $classmap The verioned classmap to load using.
	 * @param array            $psr4_map The versioned PSR-4 map to load using.
	 * @param array            $filemap The versioned filemap to load.
	 */
	public function __construct( $version_selector, $classmap, $psr4_map, $filemap ) {
		$this->version_selector = $version_selector;
		$this->classmap         = $classmap;
		$this->psr4_map         = $psr4_map;
		$this->filemap          = $filemap;
	}

	/**
	 * Finds the file path for the given class.
	 *
	 * @param string $class_name The class to find.
	 *
	 * @return string|null $file_path The path to the file if found, null if no class was found.
	 */
	public function find_class_file( $class_name ) {
		$data = $this->select_newest_file(
			isset( $this->classmap[ $class_name ] ) ? $this->classmap[ $class_name ] : null,
			$this->find_psr4_file( $class_name )
		);
		if ( ! isset( $data ) ) {
			return null;
		}

		return $data['path'];
	}

	/**
	 * Load all of the files in the filemap.
	 */
	public function load_filemap() {
		if ( empty( $this->filemap ) ) {
			return;
		}

		foreach ( $this->filemap as $file_identifier => $file_data ) {
			if ( empty( $GLOBALS['__composer_autoload_files'][ $file_identifier ] ) ) {
				require_once $file_data['path'];

				$GLOBALS['__composer_autoload_files'][ $file_identifier ] = true;
			}
		}
	}

	/**
	 * Compares different class sources and returns the newest.
	 *
	 * @param array|null $classmap_data The classmap class data.
	 * @param array|null $psr4_data The PSR-4 class data.
	 *
	 * @return array|null $data
	 */
	private function select_newest_file( $classmap_data, $psr4_data ) {
		if ( ! isset( $classmap_data ) ) {
			return $psr4_data;
		} elseif ( ! isset( $psr4_data ) ) {
			return $classmap_data;
		}

		if ( $this->version_selector->is_version_update_required( $classmap_data['version'], $psr4_data['version'] ) ) {
			return $psr4_data;
		}

		return $classmap_data;
	}

	/**
	 * Finds the file for a given class in a PSR-4 namespace.
	 *
	 * @param string $class_name The class to find.
	 *
	 * @return array|null $data The version and path path to the file if found, null otherwise.
	 */
	private function find_psr4_file( $class_name ) {
		if ( ! isset( $this->psr4_map ) ) {
			return null;
		}

		// Don't bother with classes that have no namespace.
		$class_index = strrpos( $class_name, '\\' );
		if ( ! $class_index ) {
			return null;
		}
		$class_for_path = str_replace( '\\', '/', $class_name );

		// Search for the namespace by iteratively cutting off the last segment until
		// we find a match. This allows us to check the most-specific namespaces
		// first as well as minimize the amount of time spent looking.
		for (
			$class_namespace = substr( $class_name, 0, $class_index );
			! empty( $class_namespace );
			$class_namespace = substr( $class_namespace, 0, strrpos( $class_namespace, '\\' ) )
		) {
			$namespace = $class_namespace . '\\';
			if ( ! isset( $this->psr4_map[ $namespace ] ) ) {
				continue;
			}
			$data = $this->psr4_map[ $namespace ];

			foreach ( $data['path'] as $path ) {
				$path .= '/' . substr( $class_for_path, strlen( $namespace ) ) . '.php';
				if ( file_exists( $path ) ) {
					return array(
						'version' => $data['version'],
						'path'    => $path,
					);
				}
			}
		}

		return null;
	}
}
woocommerce-admin/vendor/automattic/jetpack-autoloader/src/class-autoloader.php000064400000007573151335517650024167 0ustar00<?php
/* HEADER */ // phpcs:ignore

/**
 * This class handles management of the actual PHP autoloader.
 */
class Autoloader {

	/**
	 * Checks to see whether or not the autoloader should be initialized and then initializes it if so.
	 *
	 * @param Container|null $container The container we want to use for autoloader initialization. If none is given
	 *                                  then a container will be created automatically.
	 */
	public static function init( $container = null ) {
		// The container holds and manages the lifecycle of our dependencies
		// to make them easier to work with and increase flexibility.
		if ( ! isset( $container ) ) {
			require_once __DIR__ . '/class-container.php';
			$container = new Container();
		}

		// phpcs:disable Generic.Commenting.DocComment.MissingShort

		/** @var Autoloader_Handler $autoloader_handler */
		$autoloader_handler = $container->get( Autoloader_Handler::class );

		// If the autoloader is already initializing it means that it has included us as the latest.
		$was_included_by_autoloader = $autoloader_handler->is_initializing();

		/** @var Plugin_Locator $plugin_locator */
		$plugin_locator = $container->get( Plugin_Locator::class );

		/** @var Plugins_Handler $plugins_handler */
		$plugins_handler = $container->get( Plugins_Handler::class );

		// The current plugin is the one that we are attempting to initialize here.
		$current_plugin = $plugin_locator->find_current_plugin();

		// The active plugins are those that we were able to discover on the site. This list will not
		// include mu-plugins, those activated by code, or those who are hidden by filtering. We also
		// want to take care to not consider the current plugin unknown if it was included by an
		// autoloader. This avoids the case where a plugin will be marked "active" while deactivated
		// due to it having the latest autoloader.
		$active_plugins = $plugins_handler->get_active_plugins( true, ! $was_included_by_autoloader );

		// The cached plugins are all of those that were active or discovered by the autoloader during a previous request.
		// Note that it's possible this list will include plugins that have since been deactivated, but after a request
		// the cache should be updated and the deactivated plugins will be removed.
		$cached_plugins = $plugins_handler->get_cached_plugins();

		// We combine the active list and cached list to preemptively load classes for plugins that are
		// presently unknown but will be loaded during the request. While this may result in us considering packages in
		// deactivated plugins there shouldn't be any problems as a result and the eventual consistency is sufficient.
		$all_plugins = array_merge( $active_plugins, $cached_plugins );

		// In particular we also include the current plugin to address the case where it is the latest autoloader
		// but also unknown (and not cached). We don't want it in the active list because we don't know that it
		// is active but we need it in the all plugins list so that it is considered by the autoloader.
		$all_plugins[] = $current_plugin;

		// We require uniqueness in the array to avoid processing the same plugin more than once.
		$all_plugins = array_values( array_unique( $all_plugins ) );

		/** @var Latest_Autoloader_Guard $guard */
		$guard = $container->get( Latest_Autoloader_Guard::class );
		if ( $guard->should_stop_init( $current_plugin, $all_plugins, $was_included_by_autoloader ) ) {
			return;
		}

		// Initialize the autoloader using the handler now that we're ready.
		$autoloader_handler->activate_autoloader( $all_plugins );

		/** @var Hook_Manager $hook_manager */
		$hook_manager = $container->get( Hook_Manager::class );

		// Register a shutdown handler to clean up the autoloader.
		$hook_manager->add_action( 'shutdown', new Shutdown_Handler( $plugins_handler, $cached_plugins, $was_included_by_autoloader ) );

		// phpcs:enable Generic.Commenting.DocComment.MissingShort
	}
}
woocommerce-admin/vendor/automattic/jetpack-autoloader/src/CustomAutoloaderPlugin.php000064400000014057151335517650025371 0ustar00<?php //phpcs:ignore WordPress.Files.FileName.NotHyphenatedLowercase
/**
 * Custom Autoloader Composer Plugin, hooks into composer events to generate the custom autoloader.
 *
 * @package automattic/jetpack-autoloader
 */

// phpcs:disable PHPCompatibility.Keywords.NewKeywords.t_useFound
// phpcs:disable PHPCompatibility.LanguageConstructs.NewLanguageConstructs.t_ns_separatorFound
// phpcs:disable PHPCompatibility.Keywords.NewKeywords.t_namespaceFound
// phpcs:disable WordPress.Files.FileName.NotHyphenatedLowercase
// phpcs:disable WordPress.Files.FileName.InvalidClassFileName
// phpcs:disable WordPress.NamingConventions.ValidVariableName.VariableNotSnakeCase

namespace Automattic\Jetpack\Autoloader;

use Composer\Composer;
use Composer\EventDispatcher\EventSubscriberInterface;
use Composer\IO\IOInterface;
use Composer\Plugin\PluginInterface;
use Composer\Script\Event;
use Composer\Script\ScriptEvents;

/**
 * Class CustomAutoloaderPlugin.
 *
 * @package automattic/jetpack-autoloader
 */
class CustomAutoloaderPlugin implements PluginInterface, EventSubscriberInterface {

	/**
	 * IO object.
	 *
	 * @var IOInterface IO object.
	 */
	private $io;

	/**
	 * Composer object.
	 *
	 * @var Composer Composer object.
	 */
	private $composer;

	/**
	 * Do nothing.
	 *
	 * @param Composer    $composer Composer object.
	 * @param IOInterface $io IO object.
	 */
	public function activate( Composer $composer, IOInterface $io ) { // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable
		$this->composer = $composer;
		$this->io       = $io;
	}

	/**
	 * Do nothing.
	 * phpcs:disable VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable
	 *
	 * @param Composer    $composer Composer object.
	 * @param IOInterface $io IO object.
	 */
	public function deactivate( Composer $composer, IOInterface $io ) {
		/*
		 * Intentionally left empty. This is a PluginInterface method.
		 * phpcs:enable VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable
		 */
	}

	/**
	 * Do nothing.
	 * phpcs:disable VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable
	 *
	 * @param Composer    $composer Composer object.
	 * @param IOInterface $io IO object.
	 */
	public function uninstall( Composer $composer, IOInterface $io ) {
		/*
		 * Intentionally left empty. This is a PluginInterface method.
		 * phpcs:enable VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable
		 */
	}

	/**
	 * Tell composer to listen for events and do something with them.
	 *
	 * @return array List of subscribed events.
	 */
	public static function getSubscribedEvents() {
		return array(
			ScriptEvents::POST_AUTOLOAD_DUMP => 'postAutoloadDump',
		);
	}

	/**
	 * Generate the custom autolaoder.
	 *
	 * @param Event $event Script event object.
	 */
	public function postAutoloadDump( Event $event ) {
		// When the autoloader is not required by the root package we don't want to execute it.
		// This prevents unwanted transitive execution that generates unused autoloaders or
		// at worst throws fatal executions.
		if ( ! $this->isRequiredByRoot() ) {
			return;
		}

		$config = $this->composer->getConfig();

		if ( 'vendor' !== $config->raw()['config']['vendor-dir'] ) {
			$this->io->writeError( "\n<error>An error occurred while generating the autoloader files:", true );
			$this->io->writeError( 'The project\'s composer.json or composer environment set a non-default vendor directory.', true );
			$this->io->writeError( 'The default composer vendor directory must be used.</error>', true );
			exit();
		}

		$installationManager = $this->composer->getInstallationManager();
		$repoManager         = $this->composer->getRepositoryManager();
		$localRepo           = $repoManager->getLocalRepository();
		$package             = $this->composer->getPackage();
		$optimize            = $event->getFlags()['optimize'];
		$suffix              = $this->determineSuffix();

		$generator = new AutoloadGenerator( $this->io );
		$generator->dump( $this->composer, $config, $localRepo, $package, $installationManager, 'composer', $optimize, $suffix );
		$this->generated = true;
	}

	/**
	 * Determine the suffix for the autoloader class.
	 *
	 * Reuses an existing suffix from vendor/autoload_packages.php or vendor/autoload.php if possible.
	 *
	 * @return string Suffix.
	 */
	private function determineSuffix() {
		$config     = $this->composer->getConfig();
		$vendorPath = $config->get( 'vendor-dir' );

		// Command line.
		$suffix = $config->get( 'autoloader-suffix' );
		if ( $suffix ) {
			return $suffix;
		}

		// Reuse our own suffix, if any.
		if ( is_readable( $vendorPath . '/autoload_packages.php' ) ) {
			// phpcs:ignore WordPress.WP.AlternativeFunctions.file_get_contents_file_get_contents
			$content = file_get_contents( $vendorPath . '/autoload_packages.php' );
			if ( preg_match( '/^namespace Automattic\\\\Jetpack\\\\Autoloader\\\\jp([^;\s]+);/m', $content, $match ) ) {
				return $match[1];
			}
		}

		// Reuse Composer's suffix, if any.
		if ( is_readable( $vendorPath . '/autoload.php' ) ) {
			// phpcs:ignore WordPress.WP.AlternativeFunctions.file_get_contents_file_get_contents
			$content = file_get_contents( $vendorPath . '/autoload.php' );
			if ( preg_match( '{ComposerAutoloaderInit([^:\s]+)::}', $content, $match ) ) {
				return $match[1];
			}
		}

		// Generate a random suffix.
		return md5( uniqid( '', true ) );
	}

	/**
	 * Checks to see whether or not the root package is the one that required the autoloader.
	 *
	 * @return bool
	 */
	private function isRequiredByRoot() {
		$package  = $this->composer->getPackage();
		$requires = $package->getRequires();
		if ( ! is_array( $requires ) ) {
			$requires = array();
		}
		$devRequires = $package->getDevRequires();
		if ( ! is_array( $devRequires ) ) {
			$devRequires = array();
		}
		$requires = array_merge( $requires, $devRequires );

		if ( empty( $requires ) ) {
			$this->io->writeError( "\n<error>The package is not required and this should never happen?</error>", true );
			exit();
		}

		foreach ( $requires as $require ) {
			if ( 'automattic/jetpack-autoloader' === $require->getTarget() ) {
				return true;
			}
		}

		return false;
	}
}
woocommerce-admin/vendor/automattic/jetpack-autoloader/src/AutoloadFileWriter.php000064400000006211151335517650024456 0ustar00<?php // phpcs:ignore WordPress.Files.FileName
/**
 * Autoloader file writer.
 *
 * @package automattic/jetpack-autoloader
 */

// phpcs:disable WordPress.Files.FileName.InvalidClassFileName
// phpcs:disable WordPress.NamingConventions.ValidFunctionName.MethodNameInvalid
// phpcs:disable WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase
// phpcs:disable WordPress.NamingConventions.ValidVariableName.InterpolatedVariableNotSnakeCase
// phpcs:disable WordPress.NamingConventions.ValidVariableName.VariableNotSnakeCase
// phpcs:disable WordPress.NamingConventions.ValidVariableName.PropertyNotSnakeCase
// phpcs:disable WordPress.PHP.DevelopmentFunctions.error_log_var_export
// phpcs:disable WordPress.WP.AlternativeFunctions.file_system_read_file_put_contents
// phpcs:disable WordPress.WP.AlternativeFunctions.file_system_read_fopen
// phpcs:disable WordPress.WP.AlternativeFunctions.file_system_read_fwrite

namespace Automattic\Jetpack\Autoloader;

/**
 * Class AutoloadFileWriter.
 */
class AutoloadFileWriter {

	/**
	 * The file comment to use.
	 */
	const COMMENT = <<<AUTOLOADER_COMMENT
/**
 * This file was automatically generated by automattic/jetpack-autoloader.
 *
 * @package automattic/jetpack-autoloader
 */

AUTOLOADER_COMMENT;

	/**
	 * Copies autoloader files and replaces any placeholders in them.
	 *
	 * @param IOInterface|null $io An IO for writing to.
	 * @param string           $outDir The directory to place the autoloader files in.
	 * @param string           $suffix The suffix to use in the autoloader's namespace.
	 */
	public static function copyAutoloaderFiles( $io, $outDir, $suffix ) {
		$renameList = array(
			'autoload.php' => '../autoload_packages.php',
		);
		$ignoreList = array(
			'AutoloadGenerator.php',
			'AutoloadProcessor.php',
			'CustomAutoloaderPlugin.php',
			'ManifestGenerator.php',
			'AutoloadFileWriter.php',
		);

		// Copy all of the autoloader files.
		$files = scandir( __DIR__ );
		foreach ( $files as $file ) {
			// Only PHP files will be copied.
			if ( substr( $file, -4 ) !== '.php' ) {
				continue;
			}

			if ( in_array( $file, $ignoreList, true ) ) {
				continue;
			}

			$newFile = isset( $renameList[ $file ] ) ? $renameList[ $file ] : $file;
			$content = self::prepareAutoloaderFile( $file, $suffix );

			$written = file_put_contents( $outDir . '/' . $newFile, $content );
			if ( $io ) {
				if ( $written ) {
					$io->writeError( "  <info>Generated: $newFile</info>" );
				} else {
					$io->writeError( "  <error>Error: $newFile</error>" );
				}
			}
		}
	}

	/**
	 * Prepares an autoloader file to be written to the destination.
	 *
	 * @param String $filename a file to prepare.
	 * @param String $suffix   Unique suffix used in the namespace.
	 *
	 * @return string
	 */
	private static function prepareAutoloaderFile( $filename, $suffix ) {
		$header  = self::COMMENT;
		$header .= PHP_EOL;
		$header .= 'namespace Automattic\Jetpack\Autoloader\jp' . $suffix . ';';
		$header .= PHP_EOL . PHP_EOL;

		$sourceLoader  = fopen( __DIR__ . '/' . $filename, 'r' );
		$file_contents = stream_get_contents( $sourceLoader );
		return str_replace(
			'/* HEADER */',
			$header,
			$file_contents
		);
	}
}
woocommerce-admin/vendor/automattic/jetpack-autoloader/src/class-plugin-locator.php000064400000010174151335517650024756 0ustar00<?php
/* HEADER */ // phpcs:ignore

/**
 * This class scans the WordPress installation to find active plugins.
 */
class Plugin_Locator {

	/**
	 * The path processor for finding plugin paths.
	 *
	 * @var Path_Processor
	 */
	private $path_processor;

	/**
	 * The constructor.
	 *
	 * @param Path_Processor $path_processor The Path_Processor instance.
	 */
	public function __construct( $path_processor ) {
		$this->path_processor = $path_processor;
	}

	/**
	 * Finds the path to the current plugin.
	 *
	 * @return string $path The path to the current plugin.
	 *
	 * @throws \RuntimeException If the current plugin does not have an autoloader.
	 */
	public function find_current_plugin() {
		// Escape from `vendor/__DIR__` to root plugin directory.
		$plugin_directory = dirname( dirname( __DIR__ ) );

		// Use the path processor to ensure that this is an autoloader we're referencing.
		$path = $this->path_processor->find_directory_with_autoloader( $plugin_directory, array() );
		if ( false === $path ) {
			throw new \RuntimeException( 'Failed to locate plugin ' . $plugin_directory );
		}

		return $path;
	}

	/**
	 * Checks a given option for plugin paths.
	 *
	 * @param string $option_name  The option that we want to check for plugin information.
	 * @param bool   $site_option  Indicates whether or not we want to check the site option.
	 *
	 * @return array $plugin_paths The list of absolute paths we've found.
	 */
	public function find_using_option( $option_name, $site_option = false ) {
		$raw = $site_option ? get_site_option( $option_name ) : get_option( $option_name );
		if ( false === $raw ) {
			return array();
		}

		return $this->convert_plugins_to_paths( $raw );
	}

	/**
	 * Checks for plugins in the `action` request parameter.
	 *
	 * @param string[] $allowed_actions The actions that we're allowed to return plugins for.
	 *
	 * @return array $plugin_paths The list of absolute paths we've found.
	 */
	public function find_using_request_action( $allowed_actions ) {
		// phpcs:disable WordPress.Security.NonceVerification.Recommended

		/**
		 * Note: we're not actually checking the nonce here because it's too early
		 * in the execution. The pluggable functions are not yet loaded to give
		 * plugins a chance to plug their versions. Therefore we're doing the bare
		 * minimum: checking whether the nonce exists and it's in the right place.
		 * The request will fail later if the nonce doesn't pass the check.
		 */
		if ( empty( $_REQUEST['_wpnonce'] ) ) {
			return array();
		}

		$action = isset( $_REQUEST['action'] ) ? wp_unslash( $_REQUEST['action'] ) : false;
		if ( ! in_array( $action, $allowed_actions, true ) ) {
			return array();
		}

		$plugin_slugs = array();
		switch ( $action ) {
			case 'activate':
			case 'deactivate':
				if ( empty( $_REQUEST['plugin'] ) ) {
					break;
				}

				$plugin_slugs[] = wp_unslash( $_REQUEST['plugin'] );
				break;

			case 'activate-selected':
			case 'deactivate-selected':
				if ( empty( $_REQUEST['checked'] ) ) {
					break;
				}

				$plugin_slugs = wp_unslash( $_REQUEST['checked'] );
				break;
		}

		// phpcs:enable WordPress.Security.NonceVerification.Recommended
		return $this->convert_plugins_to_paths( $plugin_slugs );
	}

	/**
	 * Given an array of plugin slugs or paths, this will convert them to absolute paths and filter
	 * out the plugins that are not directory plugins. Note that array keys will also be included
	 * if they are plugin paths!
	 *
	 * @param string[] $plugins Plugin paths or slugs to filter.
	 *
	 * @return string[]
	 */
	private function convert_plugins_to_paths( $plugins ) {
		if ( ! is_array( $plugins ) || empty( $plugins ) ) {
			return array();
		}

		// We're going to look for plugins in the standard directories.
		$path_constants = array( WP_PLUGIN_DIR, WPMU_PLUGIN_DIR );

		$plugin_paths = array();
		foreach ( $plugins as $key => $value ) {
			$path = $this->path_processor->find_directory_with_autoloader( $key, $path_constants );
			if ( $path ) {
				$plugin_paths[] = $path;
			}

			$path = $this->path_processor->find_directory_with_autoloader( $value, $path_constants );
			if ( $path ) {
				$plugin_paths[] = $path;
			}
		}

		return $plugin_paths;
	}
}
woocommerce-admin/vendor/automattic/jetpack-autoloader/src/class-container.php000064400000011157151335517650024003 0ustar00<?php
/* HEADER */ // phpcs:ignore

/**
 * This class manages the files and dependencies of the autoloader.
 */
class Container {

	/**
	 * Since each autoloader's class files exist within their own namespace we need a map to
	 * convert between the local class and a shared key. Note that no version checking is
	 * performed on these dependencies and the first autoloader to register will be the
	 * one that is utilized.
	 */
	const SHARED_DEPENDENCY_KEYS = array(
		Hook_Manager::class => 'Hook_Manager',
	);

	/**
	 * A map of all the dependencies we've registered with the container and created.
	 *
	 * @var array
	 */
	protected $dependencies;

	/**
	 * The constructor.
	 */
	public function __construct() {
		$this->dependencies = array();

		$this->register_shared_dependencies();
		$this->register_dependencies();
		$this->initialize_globals();
	}

	/**
	 * Gets a dependency out of the container.
	 *
	 * @param string $class The class to fetch.
	 *
	 * @return mixed
	 * @throws \InvalidArgumentException When a class that isn't registered with the container is fetched.
	 */
	public function get( $class ) {
		if ( ! isset( $this->dependencies[ $class ] ) ) {
			throw new \InvalidArgumentException( "Class '$class' is not registered with the container." );
		}

		return $this->dependencies[ $class ];
	}

	/**
	 * Registers all of the dependencies that are shared between all instances of the autoloader.
	 */
	private function register_shared_dependencies() {
		global $jetpack_autoloader_container_shared;
		if ( ! isset( $jetpack_autoloader_container_shared ) ) {
			$jetpack_autoloader_container_shared = array();
		}

		$key = self::SHARED_DEPENDENCY_KEYS[ Hook_Manager::class ];
		if ( ! isset( $jetpack_autoloader_container_shared[ $key ] ) ) {
			require_once __DIR__ . '/class-hook-manager.php';
			$jetpack_autoloader_container_shared[ $key ] = new Hook_Manager();
		}
		$this->dependencies[ Hook_Manager::class ] = &$jetpack_autoloader_container_shared[ $key ];
	}

	/**
	 * Registers all of the dependencies with the container.
	 */
	private function register_dependencies() {
		require_once __DIR__ . '/class-path-processor.php';
		$this->dependencies[ Path_Processor::class ] = new Path_Processor();

		require_once __DIR__ . '/class-plugin-locator.php';
		$this->dependencies[ Plugin_Locator::class ] = new Plugin_Locator(
			$this->get( Path_Processor::class )
		);

		require_once __DIR__ . '/class-version-selector.php';
		$this->dependencies[ Version_Selector::class ] = new Version_Selector();

		require_once __DIR__ . '/class-autoloader-locator.php';
		$this->dependencies[ Autoloader_Locator::class ] = new Autoloader_Locator(
			$this->get( Version_Selector::class )
		);

		require_once __DIR__ . '/class-php-autoloader.php';
		$this->dependencies[ PHP_Autoloader::class ] = new PHP_Autoloader();

		require_once __DIR__ . '/class-manifest-reader.php';
		$this->dependencies[ Manifest_Reader::class ] = new Manifest_Reader(
			$this->get( Version_Selector::class )
		);

		require_once __DIR__ . '/class-plugins-handler.php';
		$this->dependencies[ Plugins_Handler::class ] = new Plugins_Handler(
			$this->get( Plugin_Locator::class ),
			$this->get( Path_Processor::class )
		);

		require_once __DIR__ . '/class-autoloader-handler.php';
		$this->dependencies[ Autoloader_Handler::class ] = new Autoloader_Handler(
			$this->get( PHP_Autoloader::class ),
			$this->get( Hook_Manager::class ),
			$this->get( Manifest_Reader::class ),
			$this->get( Version_Selector::class )
		);

		require_once __DIR__ . '/class-latest-autoloader-guard.php';
		$this->dependencies[ Latest_Autoloader_Guard::class ] = new Latest_Autoloader_Guard(
			$this->get( Plugins_Handler::class ),
			$this->get( Autoloader_Handler::class ),
			$this->get( Autoloader_Locator::class )
		);

		// Register any classes that we will use elsewhere.
		require_once __DIR__ . '/class-version-loader.php';
		require_once __DIR__ . '/class-shutdown-handler.php';
	}

	/**
	 * Initializes any of the globals needed by the autoloader.
	 */
	private function initialize_globals() {
		/*
		 * This global was retired in version 2.9. The value is set to 'false' to maintain
		 * compatibility with older versions of the autoloader.
		 */
		global $jetpack_autoloader_including_latest;
		$jetpack_autoloader_including_latest = false;

		// Not all plugins can be found using the locator. In cases where a plugin loads the autoloader
		// but was not discoverable, we will record them in this array to track them as "active".
		global $jetpack_autoloader_activating_plugins_paths;
		if ( ! isset( $jetpack_autoloader_activating_plugins_paths ) ) {
			$jetpack_autoloader_activating_plugins_paths = array();
		}
	}
}
woocommerce-admin/vendor/automattic/jetpack-autoloader/src/AutoloadGenerator.php000064400000033623151335517650024337 0ustar00<?php // phpcs:ignore WordPress.Files.FileName
/**
 * Autoloader Generator.
 *
 * @package automattic/jetpack-autoloader
 */

// phpcs:disable PHPCompatibility.Keywords.NewKeywords.t_useFound
// phpcs:disable PHPCompatibility.LanguageConstructs.NewLanguageConstructs.t_ns_separatorFound
// phpcs:disable PHPCompatibility.FunctionDeclarations.NewClosure.Found
// phpcs:disable PHPCompatibility.Keywords.NewKeywords.t_namespaceFound
// phpcs:disable PHPCompatibility.Keywords.NewKeywords.t_dirFound
// phpcs:disable WordPress.Files.FileName.InvalidClassFileName
// phpcs:disable WordPress.PHP.DevelopmentFunctions.error_log_var_export
// phpcs:disable WordPress.WP.AlternativeFunctions.file_system_read_file_put_contents
// phpcs:disable WordPress.WP.AlternativeFunctions.file_system_read_fopen
// phpcs:disable WordPress.WP.AlternativeFunctions.file_system_read_fwrite
// phpcs:disable WordPress.NamingConventions.ValidFunctionName.MethodNameInvalid
// phpcs:disable WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase
// phpcs:disable WordPress.NamingConventions.ValidVariableName.InterpolatedVariableNotSnakeCase
// phpcs:disable WordPress.NamingConventions.ValidVariableName.VariableNotSnakeCase
// phpcs:disable WordPress.NamingConventions.ValidVariableName.PropertyNotSnakeCase

namespace Automattic\Jetpack\Autoloader;

use Composer\Autoload\ClassMapGenerator;
use Composer\Composer;
use Composer\Config;
use Composer\Installer\InstallationManager;
use Composer\IO\IOInterface;
use Composer\Package\PackageInterface;
use Composer\Repository\InstalledRepositoryInterface;
use Composer\Util\Filesystem;
use Composer\Util\PackageSorter;

/**
 * Class AutoloadGenerator.
 */
class AutoloadGenerator {

	/**
	 * The filesystem utility.
	 *
	 * @var Filesystem
	 */
	private $filesystem;

	/**
	 * Instantiate an AutoloadGenerator object.
	 *
	 * @param IOInterface $io IO object.
	 */
	public function __construct( IOInterface $io = null ) {
		$this->io         = $io;
		$this->filesystem = new Filesystem();
	}

	/**
	 * Dump the Jetpack autoloader files.
	 *
	 * @param Composer                     $composer The Composer object.
	 * @param Config                       $config Config object.
	 * @param InstalledRepositoryInterface $localRepo Installed Repository object.
	 * @param PackageInterface             $mainPackage Main Package object.
	 * @param InstallationManager          $installationManager Manager for installing packages.
	 * @param string                       $targetDir Path to the current target directory.
	 * @param bool                         $scanPsrPackages Whether or not PSR packages should be converted to a classmap.
	 * @param string                       $suffix The autoloader suffix.
	 */
	public function dump(
		Composer $composer,
		Config $config,
		InstalledRepositoryInterface $localRepo,
		PackageInterface $mainPackage,
		InstallationManager $installationManager,
		$targetDir,
		$scanPsrPackages = false,
		$suffix = null
	) {
		$this->filesystem->ensureDirectoryExists( $config->get( 'vendor-dir' ) );

		$packageMap = $composer->getAutoloadGenerator()->buildPackageMap( $installationManager, $mainPackage, $localRepo->getCanonicalPackages() );
		$autoloads  = $this->parseAutoloads( $packageMap, $mainPackage );

		// Convert the autoloads into a format that the manifest generator can consume more easily.
		$basePath           = $this->filesystem->normalizePath( realpath( getcwd() ) );
		$vendorPath         = $this->filesystem->normalizePath( realpath( $config->get( 'vendor-dir' ) ) );
		$processedAutoloads = $this->processAutoloads( $autoloads, $scanPsrPackages, $vendorPath, $basePath );
		unset( $packageMap, $autoloads );

		// Make sure none of the legacy files remain that can lead to problems with the autoloader.
		$this->removeLegacyFiles( $vendorPath );

		// Write all of the files now that we're done.
		$this->writeAutoloaderFiles( $vendorPath . '/jetpack-autoloader/', $suffix );
		$this->writeManifests( $vendorPath . '/' . $targetDir, $processedAutoloads );

		if ( ! $scanPsrPackages ) {
			$this->io->writeError( '<warning>You are generating an unoptimized autoloader. If this is a production build, consider using the -o option.</warning>' );
		}
	}

	/**
	 * Compiles an ordered list of namespace => path mappings
	 *
	 * @param  array            $packageMap  Array of array(package, installDir-relative-to-composer.json).
	 * @param  PackageInterface $mainPackage Main package instance.
	 *
	 * @return array The list of path mappings.
	 */
	public function parseAutoloads( array $packageMap, PackageInterface $mainPackage ) {
		$rootPackageMap = array_shift( $packageMap );

		$sortedPackageMap   = $this->sortPackageMap( $packageMap );
		$sortedPackageMap[] = $rootPackageMap;
		array_unshift( $packageMap, $rootPackageMap );

		$psr0     = $this->parseAutoloadsType( $packageMap, 'psr-0', $mainPackage );
		$psr4     = $this->parseAutoloadsType( $packageMap, 'psr-4', $mainPackage );
		$classmap = $this->parseAutoloadsType( array_reverse( $sortedPackageMap ), 'classmap', $mainPackage );
		$files    = $this->parseAutoloadsType( $sortedPackageMap, 'files', $mainPackage );

		krsort( $psr0 );
		krsort( $psr4 );

		return array(
			'psr-0'    => $psr0,
			'psr-4'    => $psr4,
			'classmap' => $classmap,
			'files'    => $files,
		);
	}

	/**
	 * Sorts packages by dependency weight
	 *
	 * Packages of equal weight retain the original order
	 *
	 * @param  array $packageMap The package map.
	 *
	 * @return array
	 */
	protected function sortPackageMap( array $packageMap ) {
		$packages = array();
		$paths    = array();

		foreach ( $packageMap as $item ) {
			list( $package, $path ) = $item;
			$name                   = $package->getName();
			$packages[ $name ]      = $package;
			$paths[ $name ]         = $path;
		}

		$sortedPackages = PackageSorter::sortPackages( $packages );

		$sortedPackageMap = array();

		foreach ( $sortedPackages as $package ) {
			$name               = $package->getName();
			$sortedPackageMap[] = array( $packages[ $name ], $paths[ $name ] );
		}

		return $sortedPackageMap;
	}

	/**
	 * Returns the file identifier.
	 *
	 * @param PackageInterface $package The package instance.
	 * @param string           $path The path.
	 */
	protected function getFileIdentifier( PackageInterface $package, $path ) {
		return md5( $package->getName() . ':' . $path );
	}

	/**
	 * Returns the path code for the given path.
	 *
	 * @param Filesystem $filesystem The filesystem instance.
	 * @param string     $basePath The base path.
	 * @param string     $vendorPath The vendor path.
	 * @param string     $path The path.
	 *
	 * @return string The path code.
	 */
	protected function getPathCode( Filesystem $filesystem, $basePath, $vendorPath, $path ) {
		if ( ! $filesystem->isAbsolutePath( $path ) ) {
			$path = $basePath . '/' . $path;
		}
		$path = $filesystem->normalizePath( $path );

		$baseDir = '';
		if ( 0 === strpos( $path . '/', $vendorPath . '/' ) ) {
			$path    = substr( $path, strlen( $vendorPath ) );
			$baseDir = '$vendorDir';

			if ( false !== $path ) {
				$baseDir .= ' . ';
			}
		} else {
			$path = $filesystem->normalizePath( $filesystem->findShortestPath( $basePath, $path, true ) );
			if ( ! $filesystem->isAbsolutePath( $path ) ) {
				$baseDir = '$baseDir . ';
				$path    = '/' . $path;
			}
		}

		if ( strpos( $path, '.phar' ) !== false ) {
			$baseDir = "'phar://' . " . $baseDir;
		}

		return $baseDir . ( ( false !== $path ) ? var_export( $path, true ) : '' );
	}

	/**
	 * This function differs from the composer parseAutoloadsType in that beside returning the path.
	 * It also return the path and the version of a package.
	 *
	 * Supports PSR-4, PSR-0, and classmap parsing.
	 *
	 * @param array            $packageMap Map of all the packages.
	 * @param string           $type Type of autoloader to use.
	 * @param PackageInterface $mainPackage Instance of the Package Object.
	 *
	 * @return array
	 */
	protected function parseAutoloadsType( array $packageMap, $type, PackageInterface $mainPackage ) {
		$autoloads = array();

		foreach ( $packageMap as $item ) {
			list($package, $installPath) = $item;
			$autoload                    = $package->getAutoload();

			if ( $package === $mainPackage ) {
				$autoload = array_merge_recursive( $autoload, $package->getDevAutoload() );
			}

			if ( null !== $package->getTargetDir() && $package !== $mainPackage ) {
				$installPath = substr( $installPath, 0, -strlen( '/' . $package->getTargetDir() ) );
			}

			if ( in_array( $type, array( 'psr-4', 'psr-0' ), true ) && isset( $autoload[ $type ] ) && is_array( $autoload[ $type ] ) ) {
				foreach ( $autoload[ $type ] as $namespace => $paths ) {
					$paths = is_array( $paths ) ? $paths : array( $paths );
					foreach ( $paths as $path ) {
						$relativePath              = empty( $installPath ) ? ( empty( $path ) ? '.' : $path ) : $installPath . '/' . $path;
						$autoloads[ $namespace ][] = array(
							'path'    => $relativePath,
							'version' => $package->getVersion(), // Version of the class comes from the package - should we try to parse it?
						);
					}
				}
			}

			if ( 'classmap' === $type && isset( $autoload['classmap'] ) && is_array( $autoload['classmap'] ) ) {
				foreach ( $autoload['classmap'] as $paths ) {
					$paths = is_array( $paths ) ? $paths : array( $paths );
					foreach ( $paths as $path ) {
						$relativePath = empty( $installPath ) ? ( empty( $path ) ? '.' : $path ) : $installPath . '/' . $path;
						$autoloads[]  = array(
							'path'    => $relativePath,
							'version' => $package->getVersion(), // Version of the class comes from the package - should we try to parse it?
						);
					}
				}
			}
			if ( 'files' === $type && isset( $autoload['files'] ) && is_array( $autoload['files'] ) ) {
				foreach ( $autoload['files'] as $paths ) {
					$paths = is_array( $paths ) ? $paths : array( $paths );
					foreach ( $paths as $path ) {
						$relativePath = empty( $installPath ) ? ( empty( $path ) ? '.' : $path ) : $installPath . '/' . $path;
						$autoloads[ $this->getFileIdentifier( $package, $path ) ] = array(
							'path'    => $relativePath,
							'version' => $package->getVersion(), // Version of the file comes from the package - should we try to parse it?
						);
					}
				}
			}
		}

		return $autoloads;
	}

	/**
	 * Given Composer's autoloads this will convert them to a version that we can use to generate the manifests.
	 *
	 * When the $scanPsrPackages argument is true, PSR-4 namespaces are converted to classmaps. When $scanPsrPackages
	 * is false, PSR-4 namespaces are not converted to classmaps.
	 *
	 * PSR-0 namespaces are always converted to classmaps.
	 *
	 * @param array  $autoloads The autoloads we want to process.
	 * @param bool   $scanPsrPackages Whether or not PSR-4 packages should be converted to a classmap.
	 * @param string $vendorPath The path to the vendor directory.
	 * @param string $basePath The path to the current directory.
	 *
	 * @return array $processedAutoloads
	 */
	private function processAutoloads( $autoloads, $scanPsrPackages, $vendorPath, $basePath ) {
		$processor = new AutoloadProcessor(
			function ( $path, $excludedClasses, $namespace ) use ( $basePath ) {
				$dir = $this->filesystem->normalizePath(
					$this->filesystem->isAbsolutePath( $path ) ? $path : $basePath . '/' . $path
				);
				return ClassMapGenerator::createMap(
					$dir,
					$excludedClasses,
					null, // Don't pass the IOInterface since the normal autoload generation will have reported already.
					empty( $namespace ) ? null : $namespace
				);
			},
			function ( $path ) use ( $basePath, $vendorPath ) {
				return $this->getPathCode( $this->filesystem, $basePath, $vendorPath, $path );
			}
		);

		return array(
			'psr-4'    => $processor->processPsr4Packages( $autoloads, $scanPsrPackages ),
			'classmap' => $processor->processClassmap( $autoloads, $scanPsrPackages ),
			'files'    => $processor->processFiles( $autoloads ),
		);
	}

	/**
	 * Removes all of the legacy autoloader files so they don't cause any problems.
	 *
	 * @param string $outDir The directory legacy files are written to.
	 */
	private function removeLegacyFiles( $outDir ) {
		$files = array(
			'autoload_functions.php',
			'class-autoloader-handler.php',
			'class-classes-handler.php',
			'class-files-handler.php',
			'class-plugins-handler.php',
			'class-version-selector.php',
		);
		foreach ( $files as $file ) {
			$this->filesystem->remove( $outDir . '/' . $file );
		}
	}

	/**
	 * Writes all of the autoloader files to disk.
	 *
	 * @param string $outDir The directory to write to.
	 * @param string $suffix The unique autoloader suffix.
	 */
	private function writeAutoloaderFiles( $outDir, $suffix ) {
		$this->io->writeError( "<info>Generating jetpack autoloader ($outDir)</info>" );

		// We will remove all autoloader files to generate this again.
		$this->filesystem->emptyDirectory( $outDir );

		// Write the autoloader files.
		AutoloadFileWriter::copyAutoloaderFiles( $this->io, $outDir, $suffix );
	}

	/**
	 * Writes all of the manifest files to disk.
	 *
	 * @param string $outDir The directory to write to.
	 * @param array  $processedAutoloads The processed autoloads.
	 */
	private function writeManifests( $outDir, $processedAutoloads ) {
		$this->io->writeError( "<info>Generating jetpack autoloader manifests ($outDir)</info>" );

		$manifestFiles = array(
			'classmap' => 'jetpack_autoload_classmap.php',
			'psr-4'    => 'jetpack_autoload_psr4.php',
			'files'    => 'jetpack_autoload_filemap.php',
		);

		foreach ( $manifestFiles as $key => $file ) {
			// Make sure the file doesn't exist so it isn't there if we don't write it.
			$this->filesystem->remove( $outDir . '/' . $file );
			if ( empty( $processedAutoloads[ $key ] ) ) {
				continue;
			}

			$content = ManifestGenerator::buildManifest( $key, $file, $processedAutoloads[ $key ] );
			if ( empty( $content ) ) {
				continue;
			}

			if ( file_put_contents( $outDir . '/' . $file, $content ) ) {
				$this->io->writeError( "  <info>Generated: $file</info>" );
			} else {
				$this->io->writeError( "  <error>Error: $file</error>" );
			}
		}
	}
}
woocommerce-admin/vendor/automattic/jetpack-autoloader/src/class-plugins-handler.php000064400000013071151335517650025112 0ustar00<?php
/* HEADER */ // phpcs:ignore

/**
 * This class handles locating and caching all of the active plugins.
 */
class Plugins_Handler {
	/**
	 * The transient key for plugin paths.
	 */
	const TRANSIENT_KEY = 'jetpack_autoloader_plugin_paths';

	/**
	 * The locator for finding plugins in different locations.
	 *
	 * @var Plugin_Locator
	 */
	private $plugin_locator;

	/**
	 * The processor for transforming cached paths.
	 *
	 * @var Path_Processor
	 */
	private $path_processor;

	/**
	 * The constructor.
	 *
	 * @param Plugin_Locator $plugin_locator The locator for finding active plugins.
	 * @param Path_Processor $path_processor The processor for transforming cached paths.
	 */
	public function __construct( $plugin_locator, $path_processor ) {
		$this->plugin_locator = $plugin_locator;
		$this->path_processor = $path_processor;
	}

	/**
	 * Gets all of the active plugins we can find.
	 *
	 * @param bool $include_deactivating When true, plugins deactivating this request will be considered active.
	 * @param bool $record_unknown When true, the current plugin will be marked as active and recorded when unknown.
	 *
	 * @return string[]
	 */
	public function get_active_plugins( $include_deactivating, $record_unknown ) {
		global $jetpack_autoloader_activating_plugins_paths;

		// We're going to build a unique list of plugins from a few different sources
		// to find all of our "active" plugins. While we need to return an integer
		// array, we're going to use an associative array internally to reduce
		// the amount of time that we're going to spend checking uniqueness
		// and merging different arrays together to form the output.
		$active_plugins = array();

		// Make sure that plugins which have activated this request are considered as "active" even though
		// they probably won't be present in any option.
		if ( is_array( $jetpack_autoloader_activating_plugins_paths ) ) {
			foreach ( $jetpack_autoloader_activating_plugins_paths as $path ) {
				$active_plugins[ $path ] = $path;
			}
		}

		// This option contains all of the plugins that have been activated.
		$plugins = $this->plugin_locator->find_using_option( 'active_plugins' );
		foreach ( $plugins as $path ) {
			$active_plugins[ $path ] = $path;
		}

		// This option contains all of the multisite plugins that have been activated.
		if ( is_multisite() ) {
			$plugins = $this->plugin_locator->find_using_option( 'active_sitewide_plugins', true );
			foreach ( $plugins as $path ) {
				$active_plugins[ $path ] = $path;
			}
		}

		// These actions contain plugins that are being activated/deactivated during this request.
		$plugins = $this->plugin_locator->find_using_request_action( array( 'activate', 'activate-selected', 'deactivate', 'deactivate-selected' ) );
		foreach ( $plugins as $path ) {
			$active_plugins[ $path ] = $path;
		}

		// When the current plugin isn't considered "active" there's a problem.
		// Since we're here, the plugin is active and currently being loaded.
		// We can support this case (mu-plugins and non-standard activation)
		// by adding the current plugin to the active list and marking it
		// as an unknown (activating) plugin. This also has the benefit
		// of causing a reset because the active plugins list has
		// been changed since it was saved in the global.
		$current_plugin = $this->plugin_locator->find_current_plugin();
		if ( $record_unknown && ! in_array( $current_plugin, $active_plugins, true ) ) {
			$active_plugins[ $current_plugin ]             = $current_plugin;
			$jetpack_autoloader_activating_plugins_paths[] = $current_plugin;
		}

		// When deactivating plugins aren't desired we should entirely remove them from the active list.
		if ( ! $include_deactivating ) {
			// These actions contain plugins that are being deactivated during this request.
			$plugins = $this->plugin_locator->find_using_request_action( array( 'deactivate', 'deactivate-selected' ) );
			foreach ( $plugins as $path ) {
				unset( $active_plugins[ $path ] );
			}
		}

		// Transform the array so that we don't have to worry about the keys interacting with other array types later.
		return array_values( $active_plugins );
	}

	/**
	 * Gets all of the cached plugins if there are any.
	 *
	 * @return string[]
	 */
	public function get_cached_plugins() {
		$cached = get_transient( self::TRANSIENT_KEY );
		if ( ! is_array( $cached ) || empty( $cached ) ) {
			return array();
		}

		// We need to expand the tokens to an absolute path for this webserver.
		return array_map( array( $this->path_processor, 'untokenize_path_constants' ), $cached );
	}

	/**
	 * Saves the plugin list to the cache.
	 *
	 * @param array $plugins The plugin list to save to the cache.
	 */
	public function cache_plugins( $plugins ) {
		// We store the paths in a tokenized form so that that webservers with different absolute paths don't break.
		$plugins = array_map( array( $this->path_processor, 'tokenize_path_constants' ), $plugins );

		set_transient( self::TRANSIENT_KEY, $plugins );
	}

	/**
	 * Checks to see whether or not the plugin list given has changed when compared to the
	 * shared `$jetpack_autoloader_cached_plugin_paths` global. This allows us to deal
	 * with cases where the active list may change due to filtering..
	 *
	 * @param string[] $plugins The plugins list to check against the global cache.
	 *
	 * @return bool True if the plugins have changed, otherwise false.
	 */
	public function have_plugins_changed( $plugins ) {
		global $jetpack_autoloader_cached_plugin_paths;

		if ( $jetpack_autoloader_cached_plugin_paths !== $plugins ) {
			$jetpack_autoloader_cached_plugin_paths = $plugins;
			return true;
		}

		return false;
	}
}
woocommerce-admin/vendor/automattic/jetpack-autoloader/src/class-version-selector.php000064400000003165151335517650025324 0ustar00<?php
/* HEADER */ // phpcs:ignore

/**
 * Used to select package versions.
 */
class Version_Selector {

	/**
	 * Checks whether the selected package version should be updated. Composer development
	 * package versions ('9999999-dev' or versions that start with 'dev-') are favored
	 * when the JETPACK_AUTOLOAD_DEV constant is set to true.
	 *
	 * @param String $selected_version The currently selected package version.
	 * @param String $compare_version The package version that is being evaluated to
	 *                                determine if the version needs to be updated.
	 *
	 * @return bool Returns true if the selected package version should be updated,
	 *                 else false.
	 */
	public function is_version_update_required( $selected_version, $compare_version ) {
		$use_dev_versions = defined( 'JETPACK_AUTOLOAD_DEV' ) && JETPACK_AUTOLOAD_DEV;

		if ( is_null( $selected_version ) ) {
			return true;
		}

		if ( $use_dev_versions && $this->is_dev_version( $selected_version ) ) {
			return false;
		}

		if ( $this->is_dev_version( $compare_version ) ) {
			if ( $use_dev_versions ) {
				return true;
			} else {
				return false;
			}
		}

		if ( version_compare( $selected_version, $compare_version, '<' ) ) {
			return true;
		}

		return false;
	}

	/**
	 * Checks whether the given package version is a development version.
	 *
	 * @param String $version The package version.
	 *
	 * @return bool True if the version is a dev version, else false.
	 */
	public function is_dev_version( $version ) {
		if ( 'dev-' === substr( $version, 0, 4 ) || '9999999-dev' === $version ) {
			return true;
		}

		return false;
	}
}
woocommerce-admin/vendor/automattic/jetpack-autoloader/src/AutoloadProcessor.php000064400000012357151335517650024371 0ustar00<?php // phpcs:ignore WordPress.Files.FileName
/**
 * Autoload Processor.
 *
 * @package automattic/jetpack-autoloader
 */

// phpcs:disable WordPress.Files.FileName.InvalidClassFileName
// phpcs:disable WordPress.NamingConventions.ValidFunctionName.MethodNameInvalid
// phpcs:disable WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase
// phpcs:disable WordPress.NamingConventions.ValidVariableName.InterpolatedVariableNotSnakeCase
// phpcs:disable WordPress.NamingConventions.ValidVariableName.VariableNotSnakeCase
// phpcs:disable WordPress.NamingConventions.ValidVariableName.PropertyNotSnakeCase

namespace Automattic\Jetpack\Autoloader;

/**
 * Class AutoloadProcessor.
 */
class AutoloadProcessor {

	/**
	 * A callable for scanning a directory for all of its classes.
	 *
	 * @var callable
	 */
	private $classmapScanner;

	/**
	 * A callable for transforming a path into one to be used in code.
	 *
	 * @var callable
	 */
	private $pathCodeTransformer;

	/**
	 * The constructor.
	 *
	 * @param callable $classmapScanner A callable for scanning a directory for all of its classes.
	 * @param callable $pathCodeTransformer A callable for transforming a path into one to be used in code.
	 */
	public function __construct( $classmapScanner, $pathCodeTransformer ) {
		$this->classmapScanner     = $classmapScanner;
		$this->pathCodeTransformer = $pathCodeTransformer;
	}

	/**
	 * Processes the classmap autoloads into a relative path format including the version for each file.
	 *
	 * @param array $autoloads The autoloads we are processing.
	 * @param bool  $scanPsrPackages Whether or not PSR packages should be converted to a classmap.
	 *
	 * @return array $processed
	 */
	public function processClassmap( $autoloads, $scanPsrPackages ) {
		// We can't scan PSR packages if we don't actually have any.
		if ( empty( $autoloads['psr-4'] ) ) {
			$scanPsrPackages = false;
		}

		if ( empty( $autoloads['classmap'] ) && ! $scanPsrPackages ) {
			return null;
		}

		$excludedClasses = null;
		if ( ! empty( $autoloads['exclude-from-classmap'] ) ) {
			$excludedClasses = '{(' . implode( '|', $autoloads['exclude-from-classmap'] ) . ')}';
		}

		$processed = array();

		if ( $scanPsrPackages ) {
			foreach ( $autoloads['psr-4'] as $namespace => $sources ) {
				$namespace = empty( $namespace ) ? null : $namespace;

				foreach ( $sources as $source ) {
					$classmap = call_user_func( $this->classmapScanner, $source['path'], $excludedClasses, $namespace );

					foreach ( $classmap as $class => $path ) {
						$processed[ $class ] = array(
							'version' => $source['version'],
							'path'    => call_user_func( $this->pathCodeTransformer, $path ),
						);
					}
				}
			}
		}

		/*
		 * PSR-0 namespaces are converted to classmaps for both optimized and unoptimized autoloaders because any new
		 * development should use classmap or PSR-4 autoloading.
		 */
		if ( ! empty( $autoloads['psr-0'] ) ) {
			foreach ( $autoloads['psr-0'] as $namespace => $sources ) {
				$namespace = empty( $namespace ) ? null : $namespace;

				foreach ( $sources as $source ) {
					$classmap = call_user_func( $this->classmapScanner, $source['path'], $excludedClasses, $namespace );
					foreach ( $classmap as $class => $path ) {
						$processed[ $class ] = array(
							'version' => $source['version'],
							'path'    => call_user_func( $this->pathCodeTransformer, $path ),
						);
					}
				}
			}
		}

		if ( ! empty( $autoloads['classmap'] ) ) {
			foreach ( $autoloads['classmap'] as $package ) {
				$classmap = call_user_func( $this->classmapScanner, $package['path'], $excludedClasses, null );

				foreach ( $classmap as $class => $path ) {
					$processed[ $class ] = array(
						'version' => $package['version'],
						'path'    => call_user_func( $this->pathCodeTransformer, $path ),
					);
				}
			}
		}

		return $processed;
	}

	/**
	 * Processes the PSR-4 autoloads into a relative path format including the version for each file.
	 *
	 * @param array $autoloads The autoloads we are processing.
	 * @param bool  $scanPsrPackages Whether or not PSR packages should be converted to a classmap.
	 *
	 * @return array $processed
	 */
	public function processPsr4Packages( $autoloads, $scanPsrPackages ) {
		if ( $scanPsrPackages || empty( $autoloads['psr-4'] ) ) {
			return null;
		}

		$processed = array();

		foreach ( $autoloads['psr-4'] as $namespace => $packages ) {
			$namespace = empty( $namespace ) ? null : $namespace;
			$paths     = array();

			foreach ( $packages as $package ) {
				$paths[] = call_user_func( $this->pathCodeTransformer, $package['path'] );
			}

			$processed[ $namespace ] = array(
				'version' => $package['version'],
				'path'    => $paths,
			);
		}

		return $processed;
	}

	/**
	 * Processes the file autoloads into a relative format including the version for each file.
	 *
	 * @param array $autoloads The autoloads we are processing.
	 *
	 * @return array|null $processed
	 */
	public function processFiles( $autoloads ) {
		if ( empty( $autoloads['files'] ) ) {
			return null;
		}

		$processed = array();

		foreach ( $autoloads['files'] as $file_id => $package ) {
			$processed[ $file_id ] = array(
				'version' => $package['version'],
				'path'    => call_user_func( $this->pathCodeTransformer, $package['path'] ),
			);
		}

		return $processed;
	}
}
woocommerce-admin/vendor/automattic/jetpack-autoloader/src/class-autoloader-handler.php000064400000010465151335517650025574 0ustar00<?php
/* HEADER */ // phpcs:ignore

use Automattic\Jetpack\Autoloader\AutoloadGenerator;

/**
 * This class selects the package version for the autoloader.
 */
class Autoloader_Handler {

	/**
	 * The PHP_Autoloader instance.
	 *
	 * @var PHP_Autoloader
	 */
	private $php_autoloader;

	/**
	 * The Hook_Manager instance.
	 *
	 * @var Hook_Manager
	 */
	private $hook_manager;

	/**
	 * The Manifest_Reader instance.
	 *
	 * @var Manifest_Reader
	 */
	private $manifest_reader;

	/**
	 * The Version_Selector instance.
	 *
	 * @var Version_Selector
	 */
	private $version_selector;

	/**
	 * The constructor.
	 *
	 * @param PHP_Autoloader   $php_autoloader The PHP_Autoloader instance.
	 * @param Hook_Manager     $hook_manager The Hook_Manager instance.
	 * @param Manifest_Reader  $manifest_reader The Manifest_Reader instance.
	 * @param Version_Selector $version_selector The Version_Selector instance.
	 */
	public function __construct( $php_autoloader, $hook_manager, $manifest_reader, $version_selector ) {
		$this->php_autoloader   = $php_autoloader;
		$this->hook_manager     = $hook_manager;
		$this->manifest_reader  = $manifest_reader;
		$this->version_selector = $version_selector;
	}

	/**
	 * Checks to see whether or not an autoloader is currently in the process of initializing.
	 *
	 * @return bool
	 */
	public function is_initializing() {
		// If no version has been set it means that no autoloader has started initializing yet.
		global $jetpack_autoloader_latest_version;
		if ( ! isset( $jetpack_autoloader_latest_version ) ) {
			return false;
		}

		// When the version is set but the classmap is not it ALWAYS means that this is the
		// latest autoloader and is being included by an older one.
		global $jetpack_packages_classmap;
		if ( empty( $jetpack_packages_classmap ) ) {
			return true;
		}

		// Version 2.4.0 added a new global and altered the reset semantics. We need to check
		// the other global as well since it may also point at initialization.
		// Note: We don't need to check for the class first because every autoloader that
		// will set the latest version global requires this class in the classmap.
		$replacing_version = $jetpack_packages_classmap[ AutoloadGenerator::class ]['version'];
		if ( $this->version_selector->is_dev_version( $replacing_version ) || version_compare( $replacing_version, '2.4.0.0', '>=' ) ) {
			global $jetpack_autoloader_loader;
			if ( ! isset( $jetpack_autoloader_loader ) ) {
				return true;
			}
		}

		return false;
	}

	/**
	 * Activates an autoloader using the given plugins and activates it.
	 *
	 * @param string[] $plugins The plugins to initialize the autoloader for.
	 */
	public function activate_autoloader( $plugins ) {
		global $jetpack_packages_psr4;
		$jetpack_packages_psr4 = array();
		$this->manifest_reader->read_manifests( $plugins, 'vendor/composer/jetpack_autoload_psr4.php', $jetpack_packages_psr4 );

		global $jetpack_packages_classmap;
		$jetpack_packages_classmap = array();
		$this->manifest_reader->read_manifests( $plugins, 'vendor/composer/jetpack_autoload_classmap.php', $jetpack_packages_classmap );

		global $jetpack_packages_filemap;
		$jetpack_packages_filemap = array();
		$this->manifest_reader->read_manifests( $plugins, 'vendor/composer/jetpack_autoload_filemap.php', $jetpack_packages_filemap );

		$loader = new Version_Loader(
			$this->version_selector,
			$jetpack_packages_classmap,
			$jetpack_packages_psr4,
			$jetpack_packages_filemap
		);

		$this->php_autoloader->register_autoloader( $loader );

		// Now that the autoloader is active we can load the filemap.
		$loader->load_filemap();
	}

	/**
	 * Resets the active autoloader and all related global state.
	 */
	public function reset_autoloader() {
		$this->php_autoloader->unregister_autoloader();
		$this->hook_manager->reset();

		// Clear all of the autoloader globals so that older autoloaders don't do anything strange.
		global $jetpack_autoloader_latest_version;
		$jetpack_autoloader_latest_version = null;

		global $jetpack_packages_classmap;
		$jetpack_packages_classmap = array(); // Must be array to avoid exceptions in old autoloaders!

		global $jetpack_packages_psr4;
		$jetpack_packages_psr4 = array(); // Must be array to avoid exceptions in old autoloaders!

		global $jetpack_packages_filemap;
		$jetpack_packages_filemap = array(); // Must be array to avoid exceptions in old autoloaders!
	}
}
woocommerce-admin/vendor/automattic/jetpack-autoloader/src/ManifestGenerator.php000064400000007132151335517650024331 0ustar00<?php // phpcs:ignore WordPress.Files.FileName
/**
 * Manifest Generator.
 *
 * @package automattic/jetpack-autoloader
 */

// phpcs:disable WordPress.Files.FileName.InvalidClassFileName
// phpcs:disable WordPress.NamingConventions.ValidFunctionName.MethodNameInvalid
// phpcs:disable WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase
// phpcs:disable WordPress.NamingConventions.ValidVariableName.InterpolatedVariableNotSnakeCase
// phpcs:disable WordPress.NamingConventions.ValidVariableName.VariableNotSnakeCase
// phpcs:disable WordPress.NamingConventions.ValidVariableName.PropertyNotSnakeCase
// phpcs:disable WordPress.PHP.DevelopmentFunctions.error_log_var_export

namespace Automattic\Jetpack\Autoloader;

/**
 * Class ManifestGenerator.
 */
class ManifestGenerator {

	/**
	 * Builds a manifest file for the given autoloader type.
	 *
	 * @param string $autoloaderType The type of autoloader to build a manifest for.
	 * @param string $fileName The filename of the manifest.
	 * @param array  $content The manifest content to generate using.
	 *
	 * @return string|null $manifestFile
	 * @throws \InvalidArgumentException When an invalid autoloader type is given.
	 */
	public static function buildManifest( $autoloaderType, $fileName, $content ) {
		if ( empty( $content ) ) {
			return null;
		}

		switch ( $autoloaderType ) {
			case 'classmap':
			case 'files':
				return self::buildStandardManifest( $fileName, $content );
			case 'psr-4':
				return self::buildPsr4Manifest( $fileName, $content );
		}

		throw new \InvalidArgumentException( 'An invalid manifest type of ' . $autoloaderType . ' was passed!' );
	}

	/**
	 * Builds the contents for the standard manifest file.
	 *
	 * @param string $fileName The filename we are building.
	 * @param array  $manifestData The formatted data for the manifest.
	 *
	 * @return string|null $manifestFile
	 */
	private static function buildStandardManifest( $fileName, $manifestData ) {
		$fileContent = PHP_EOL;
		foreach ( $manifestData as $key => $data ) {
			$key          = var_export( $key, true );
			$versionCode  = var_export( $data['version'], true );
			$fileContent .= <<<MANIFEST_CODE
	$key => array(
		'version' => $versionCode,
		'path'    => {$data['path']}
	),
MANIFEST_CODE;
			$fileContent .= PHP_EOL;
		}

		return self::buildFile( $fileName, $fileContent );
	}

	/**
	 * Builds the contents for the PSR-4 manifest file.
	 *
	 * @param string $fileName The filename we are building.
	 * @param array  $namespaces The formatted PSR-4 data for the manifest.
	 *
	 * @return string|null $manifestFile
	 */
	private static function buildPsr4Manifest( $fileName, $namespaces ) {
		$fileContent = PHP_EOL;
		foreach ( $namespaces as $namespace => $data ) {
			$namespaceCode = var_export( $namespace, true );
			$versionCode   = var_export( $data['version'], true );
			$pathCode      = 'array( ' . implode( ', ', $data['path'] ) . ' )';
			$fileContent  .= <<<MANIFEST_CODE
	$namespaceCode => array(
		'version' => $versionCode,
		'path'    => $pathCode
	),
MANIFEST_CODE;
			$fileContent  .= PHP_EOL;
		}

		return self::buildFile( $fileName, $fileContent );
	}

	/**
	 * Generate the PHP that will be used in the file.
	 *
	 * @param string $fileName The filename we are building.
	 * @param string $content The content to be written into the file.
	 *
	 * @return string $fileContent
	 */
	private static function buildFile( $fileName, $content ) {
		return <<<INCLUDE_FILE
<?php

// This file `$fileName` was auto generated by automattic/jetpack-autoloader.

\$vendorDir = dirname(__DIR__);
\$baseDir   = dirname(\$vendorDir);

return array($content);

INCLUDE_FILE;
	}
}
woocommerce-admin/vendor/automattic/jetpack-autoloader/src/class-php-autoloader.php000064400000005071151335517650024743 0ustar00<?php
/* HEADER */ // phpcs:ignore

/**
 * This class handles management of the actual PHP autoloader.
 */
class PHP_Autoloader {

	/**
	 * Registers the autoloader with PHP so that it can begin autoloading classes.
	 *
	 * @param Version_Loader $version_loader The class loader to use in the autoloader.
	 */
	public function register_autoloader( $version_loader ) {
		// Make sure no other autoloaders are registered.
		$this->unregister_autoloader();

		// Set the global so that it can be used to load classes.
		global $jetpack_autoloader_loader;
		$jetpack_autoloader_loader = $version_loader;

		// Ensure that the autoloader is first to avoid contention with others.
		spl_autoload_register( array( self::class, 'load_class' ), true, true );
	}

	/**
	 * Unregisters the active autoloader so that it will no longer autoload classes.
	 */
	public function unregister_autoloader() {
		// Remove any v2 autoloader that we've already registered.
		$autoload_chain = spl_autoload_functions();
		foreach ( $autoload_chain as $autoloader ) {
			// We can identify a v2 autoloader using the namespace.
			$namespace_check = null;

			// Functions are recorded as strings.
			if ( is_string( $autoloader ) ) {
				$namespace_check = $autoloader;
			} elseif ( is_array( $autoloader ) && is_string( $autoloader[0] ) ) {
				// Static method calls have the class as the first array element.
				$namespace_check = $autoloader[0];
			} else {
				// Since the autoloader has only ever been a function or a static method we don't currently need to check anything else.
				continue;
			}

			// Check for the namespace without the generated suffix.
			if ( 'Automattic\\Jetpack\\Autoloader\\jp' === substr( $namespace_check, 0, 32 ) ) {
				spl_autoload_unregister( $autoloader );
			}
		}

		// Clear the global now that the autoloader has been unregistered.
		global $jetpack_autoloader_loader;
		$jetpack_autoloader_loader = null;
	}

	/**
	 * Loads a class file if one could be found.
	 *
	 * Note: This function is static so that the autoloader can be easily unregistered. If
	 * it was a class method we would have to unwrap the object to check the namespace.
	 *
	 * @param string $class_name The name of the class to autoload.
	 *
	 * @return bool Indicates whether or not a class file was loaded.
	 */
	public static function load_class( $class_name ) {
		global $jetpack_autoloader_loader;
		if ( ! isset( $jetpack_autoloader_loader ) ) {
			return;
		}

		$file = $jetpack_autoloader_loader->find_class_file( $class_name );
		if ( ! isset( $file ) ) {
			return false;
		}

		require $file;
		return true;
	}
}
woocommerce-admin/vendor/automattic/jetpack-autoloader/src/class-latest-autoloader-guard.php000064400000005062151335517650026550 0ustar00<?php
/* HEADER */ // phpcs:ignore

/**
 * This class ensures that we're only executing the latest autoloader.
 */
class Latest_Autoloader_Guard {

	/**
	 * The Plugins_Handler instance.
	 *
	 * @var Plugins_Handler
	 */
	private $plugins_handler;

	/**
	 * The Autoloader_Handler instance.
	 *
	 * @var Autoloader_Handler
	 */
	private $autoloader_handler;

	/**
	 * The Autoloader_locator instance.
	 *
	 * @var Autoloader_Locator
	 */
	private $autoloader_locator;

	/**
	 * The constructor.
	 *
	 * @param Plugins_Handler    $plugins_handler    The Plugins_Handler instance.
	 * @param Autoloader_Handler $autoloader_handler The Autoloader_Handler instance.
	 * @param Autoloader_Locator $autoloader_locator The Autoloader_Locator instance.
	 */
	public function __construct( $plugins_handler, $autoloader_handler, $autoloader_locator ) {
		$this->plugins_handler    = $plugins_handler;
		$this->autoloader_handler = $autoloader_handler;
		$this->autoloader_locator = $autoloader_locator;
	}

	/**
	 * Indicates whether or not the autoloader should be initialized. Note that this function
	 * has the side-effect of actually loading the latest autoloader in the event that this
	 * is not it.
	 *
	 * @param string   $current_plugin             The current plugin we're checking.
	 * @param string[] $plugins                    The active plugins to check for autoloaders in.
	 * @param bool     $was_included_by_autoloader Indicates whether or not this autoloader was included by another.
	 *
	 * @return bool True if we should stop initialization, otherwise false.
	 */
	public function should_stop_init( $current_plugin, $plugins, $was_included_by_autoloader ) {
		global $jetpack_autoloader_latest_version;

		// We need to reset the autoloader when the plugins change because
		// that means the autoloader was generated with a different list.
		if ( $this->plugins_handler->have_plugins_changed( $plugins ) ) {
			$this->autoloader_handler->reset_autoloader();
		}

		// When the latest autoloader has already been found we don't need to search for it again.
		// We should take care however because this will also trigger if the autoloader has been
		// included by an older one.
		if ( isset( $jetpack_autoloader_latest_version ) && ! $was_included_by_autoloader ) {
			return true;
		}

		$latest_plugin = $this->autoloader_locator->find_latest_autoloader( $plugins, $jetpack_autoloader_latest_version );
		if ( isset( $latest_plugin ) && $latest_plugin !== $current_plugin ) {
			require $this->autoloader_locator->get_autoloader_path( $latest_plugin );
			return true;
		}

		return false;
	}
}
woocommerce-admin/vendor/automattic/jetpack-autoloader/src/class-hook-manager.php000064400000003643151335517650024372 0ustar00<?php
/* HEADER */ // phpcs:ignore

/**
 * Allows the latest autoloader to register hooks that can be removed when the autoloader is reset.
 */
class Hook_Manager {

	/**
	 * An array containing all of the hooks that we've registered.
	 *
	 * @var array
	 */
	private $registered_hooks;

	/**
	 * The constructor.
	 */
	public function __construct() {
		$this->registered_hooks = array();
	}

	/**
	 * Adds an action to WordPress and registers it internally.
	 *
	 * @param string   $tag           The name of the action which is hooked.
	 * @param callable $callable      The function to call.
	 * @param int      $priority      Used to specify the priority of the action.
	 * @param int      $accepted_args Used to specify the number of arguments the callable accepts.
	 */
	public function add_action( $tag, $callable, $priority = 10, $accepted_args = 1 ) {
		$this->registered_hooks[ $tag ][] = array(
			'priority' => $priority,
			'callable' => $callable,
		);

		add_action( $tag, $callable, $priority, $accepted_args );
	}

	/**
	 * Adds a filter to WordPress and registers it internally.
	 *
	 * @param string   $tag           The name of the filter which is hooked.
	 * @param callable $callable      The function to call.
	 * @param int      $priority      Used to specify the priority of the filter.
	 * @param int      $accepted_args Used to specify the number of arguments the callable accepts.
	 */
	public function add_filter( $tag, $callable, $priority = 10, $accepted_args = 1 ) {
		$this->registered_hooks[ $tag ][] = array(
			'priority' => $priority,
			'callable' => $callable,
		);

		add_filter( $tag, $callable, $priority, $accepted_args );
	}

	/**
	 * Removes all of the registered hooks.
	 */
	public function reset() {
		foreach ( $this->registered_hooks as $tag => $hooks ) {
			foreach ( $hooks as $hook ) {
				remove_filter( $tag, $hook['callable'], $hook['priority'] );
			}
		}
		$this->registered_hooks = array();
	}
}
woocommerce-admin/vendor/automattic/jetpack-autoloader/src/class-manifest-reader.php000064400000004673151335517650025074 0ustar00<?php
/* HEADER */ // phpcs:ignore

/**
 * This class reads autoloader manifest files.
 */
class Manifest_Reader {

	/**
	 * The Version_Selector object.
	 *
	 * @var Version_Selector
	 */
	private $version_selector;

	/**
	 * The constructor.
	 *
	 * @param Version_Selector $version_selector The Version_Selector object.
	 */
	public function __construct( $version_selector ) {
		$this->version_selector = $version_selector;
	}

	/**
	 * Reads all of the manifests in the given plugin paths.
	 *
	 * @param array  $plugin_paths  The paths to the plugins we're loading the manifest in.
	 * @param string $manifest_path The path that we're loading the manifest from in each plugin.
	 * @param array  $path_map The path map to add the contents of the manifests to.
	 *
	 * @return array $path_map The path map we've built using the manifests in each plugin.
	 */
	public function read_manifests( $plugin_paths, $manifest_path, &$path_map ) {
		$file_paths = array_map(
			function ( $path ) use ( $manifest_path ) {
				return trailingslashit( $path ) . $manifest_path;
			},
			$plugin_paths
		);

		foreach ( $file_paths as $path ) {
			$this->register_manifest( $path, $path_map );
		}

		return $path_map;
	}

	/**
	 * Registers a plugin's manifest file with the path map.
	 *
	 * @param string $manifest_path The absolute path to the manifest that we're loading.
	 * @param array  $path_map The path map to add the contents of the manifest to.
	 */
	protected function register_manifest( $manifest_path, &$path_map ) {
		if ( ! is_readable( $manifest_path ) ) {
			return;
		}

		$manifest = require $manifest_path;
		if ( ! is_array( $manifest ) ) {
			return;
		}

		foreach ( $manifest as $key => $data ) {
			$this->register_record( $key, $data, $path_map );
		}
	}

	/**
	 * Registers an entry from the manifest in the path map.
	 *
	 * @param string $key The identifier for the entry we're registering.
	 * @param array  $data The data for the entry we're registering.
	 * @param array  $path_map The path map to add the contents of the manifest to.
	 */
	protected function register_record( $key, $data, &$path_map ) {
		if ( isset( $path_map[ $key ]['version'] ) ) {
			$selected_version = $path_map[ $key ]['version'];
		} else {
			$selected_version = null;
		}

		if ( $this->version_selector->is_version_update_required( $selected_version, $data['version'] ) ) {
			$path_map[ $key ] = array(
				'version' => $data['version'],
				'path'    => $data['path'],
			);
		}
	}
}
woocommerce-admin/vendor/automattic/jetpack-autoloader/src/class-autoloader-locator.php000064400000003616151335517650025622 0ustar00<?php
/* HEADER */ // phpcs:ignore

use Automattic\Jetpack\Autoloader\AutoloadGenerator;

/**
 * This class locates autoloaders.
 */
class Autoloader_Locator {

	/**
	 * The object for comparing autoloader versions.
	 *
	 * @var Version_Selector
	 */
	private $version_selector;

	/**
	 * The constructor.
	 *
	 * @param Version_Selector $version_selector The version selector object.
	 */
	public function __construct( $version_selector ) {
		$this->version_selector = $version_selector;
	}

	/**
	 * Finds the path to the plugin with the latest autoloader.
	 *
	 * @param array  $plugin_paths An array of plugin paths.
	 * @param string $latest_version The latest version reference.
	 *
	 * @return string|null
	 */
	public function find_latest_autoloader( $plugin_paths, &$latest_version ) {
		$latest_plugin = null;

		foreach ( $plugin_paths as $plugin_path ) {
			$version = $this->get_autoloader_version( $plugin_path );
			if ( ! $this->version_selector->is_version_update_required( $latest_version, $version ) ) {
				continue;
			}

			$latest_version = $version;
			$latest_plugin  = $plugin_path;
		}

		return $latest_plugin;
	}

	/**
	 * Gets the path to the autoloader.
	 *
	 * @param string $plugin_path The path to the plugin.
	 *
	 * @return string
	 */
	public function get_autoloader_path( $plugin_path ) {
		return trailingslashit( $plugin_path ) . 'vendor/autoload_packages.php';
	}

	/**
	 * Gets the version for the autoloader.
	 *
	 * @param string $plugin_path The path to the plugin.
	 *
	 * @return string|null
	 */
	public function get_autoloader_version( $plugin_path ) {
		$classmap = trailingslashit( $plugin_path ) . 'vendor/composer/jetpack_autoload_classmap.php';
		if ( ! file_exists( $classmap ) ) {
			return null;
		}

		$classmap = require $classmap;
		if ( isset( $classmap[ AutoloadGenerator::class ] ) ) {
			return $classmap[ AutoloadGenerator::class ]['version'];
		}

		return null;
	}
}
woocommerce-admin/vendor/automattic/jetpack-autoloader/src/autoload.php000064400000000173151335517650022522 0ustar00<?php
/* HEADER */ // phpcs:ignore

require_once __DIR__ . '/jetpack-autoloader/class-autoloader.php';
Autoloader::init();
woocommerce-admin/vendor/automattic/jetpack-autoloader/LICENSE.txt000064400000043760151335517650021246 0ustar00This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA


===================================


GNU GENERAL PUBLIC LICENSE
   Version 2, June 1991

Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.

		Preamble

The licenses for most software are designed to take away your
freedom to share and change it.  By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users.  This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it.  (Some other Free Software Foundation software is covered by
the GNU Lesser General Public License instead.)  You can apply it to
your programs, too.

When we speak of free software, we are referring to freedom, not
price.  Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.

To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.

For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have.  You must make sure that they, too, receive or can get the
source code.  And you must show them these terms so they know their
rights.

We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.

Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software.  If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.

Finally, any free program is threatened constantly by software
patents.  We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary.  To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.

The precise terms and conditions for copying, distribution and
modification follow.

GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION

0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License.  The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language.  (Hereinafter, translation is included without limitation in
the term "modification".)  Each licensee is addressed as "you".

Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope.  The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.

1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.

You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.

2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:

a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.

b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.

c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License.  (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)

These requirements apply to the modified work as a whole.  If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works.  But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.

Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.

In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.

3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:

a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,

b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,

c) Accompany it with the information you received as to the offer
to distribute corresponding source code.  (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)

The source code for a work means the preferred form of the work for
making modifications to it.  For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable.  However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.

If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.

4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License.  Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.

5. You are not required to accept this License, since you have not
signed it.  However, nothing else grants you permission to modify or
distribute the Program or its derivative works.  These actions are
prohibited by law if you do not accept this License.  Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.

6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions.  You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.

7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License.  If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all.  For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.

If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.

It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices.  Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.

This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.

8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded.  In such case, this License incorporates
the limitation as if written in the body of this License.

9. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time.  Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.

Each version is given a distinguishing version number.  If the Program
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation.  If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.

10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission.  For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this.  Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.

		NO WARRANTY

11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.

12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.

 END OF TERMS AND CONDITIONS

How to Apply These Terms to Your New Programs

If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.

To do so, attach the following notices to the program.  It is safest
to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.

<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year>  <name of author>

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.

Also add information on how to contact you by electronic and paper mail.

If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:

Gnomovision version 69, Copyright (C) year name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.

The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License.  Of course, the commands you use may
be called something other than `show w' and `show c'; they could even be
mouse-clicks or menu items--whatever suits your program.

You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary.  Here is a sample; alter the names:

Yoyodyne, Inc., hereby disclaims all copyright interest in the program
`Gnomovision' (which makes passes at compilers) written by James Hacker.

<signature of Ty Coon>, 1 April 1989
Ty Coon, President of Vice

This General Public License does not permit incorporating your program into
proprietary programs.  If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library.  If this is what you want to do, use the GNU Lesser General
Public License instead of this License.
woocommerce-admin/vendor/composer/platform_check.php000064400000001635151335517650017007 0ustar00<?php

// platform_check.php @generated by Composer

$issues = array();

if (!(PHP_VERSION_ID >= 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
    );
}
woocommerce-admin/vendor/composer/InstalledVersions.php000064400000033350151335517650017475 0ustar00<?php

/*
 * This file is part of Composer.
 *
 * (c) Nils Adermann <naderman@naderman.de>
 *     Jordi Boggiano <j.boggiano@seld.be>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Composer;

use Composer\Autoload\ClassLoader;
use Composer\Semver\VersionParser;

/**
 * This class is copied in every Composer installed project and available to all
 *
 * See also https://getcomposer.org/doc/07-runtime.md#installed-versions
 *
 * To require its presence, you can require `composer-runtime-api ^2.0`
 */
class InstalledVersions
{
    private static $installed;
    private static $canGetVendors;
    private static $installedByVendor = array();

    /**
     * Returns a list of all package names which are present, either by being installed, replaced or provided
     *
     * @return string[]
     * @psalm-return list<string>
     */
    public static function getInstalledPackages()
    {
        $packages = array();
        foreach (self::getInstalled() as $installed) {
            $packages[] = array_keys($installed['versions']);
        }

        if (1 === \count($packages)) {
            return $packages[0];
        }

        return array_keys(array_flip(\call_user_func_array('array_merge', $packages)));
    }

    /**
     * Returns a list of all package names with a specific type e.g. 'library'
     *
     * @param  string   $type
     * @return string[]
     * @psalm-return list<string>
     */
    public static function getInstalledPackagesByType($type)
    {
        $packagesByType = array();

        foreach (self::getInstalled() as $installed) {
            foreach ($installed['versions'] as $name => $package) {
                if (isset($package['type']) && $package['type'] === $type) {
                    $packagesByType[] = $name;
                }
            }
        }

        return $packagesByType;
    }

    /**
     * Checks whether the given package is installed
     *
     * This also returns true if the package name is provided or replaced by another package
     *
     * @param  string $packageName
     * @param  bool   $includeDevRequirements
     * @return bool
     */
    public static function isInstalled($packageName, $includeDevRequirements = true)
    {
        foreach (self::getInstalled() as $installed) {
            if (isset($installed['versions'][$packageName])) {
                return $includeDevRequirements || empty($installed['versions'][$packageName]['dev_requirement']);
            }
        }

        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($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, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}
     */
    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, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>}
     */
    public static function getRawData()
    {
        @trigger_error('getRawData only returns the first dataset loaded, which may not be what you expect. Use getAllRawData() instead which returns all datasets for all autoloaders present in the process.', E_USER_DEPRECATED);

        if (null === self::$installed) {
            // only require the installed.php file if this file is loaded from its dumped location,
            // and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937
            if (substr(__DIR__, -8, 1) !== 'C') {
                self::$installed = include __DIR__ . '/installed.php';
            } else {
                self::$installed = array();
            }
        }

        return self::$installed;
    }

    /**
     * Returns the raw data of all installed.php which are currently loaded for custom implementations
     *
     * @return array[]
     * @psalm-return list<array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>}>
     */
    public static function getAllRawData()
    {
        return self::getInstalled();
    }

    /**
     * Lets you reload the static array from another file
     *
     * This is only useful for complex integrations in which a project needs to use
     * this class but then also needs to execute another project's autoloader in process,
     * and wants to ensure both projects have access to their version of installed.php.
     *
     * A typical case would be PHPUnit, where it would need to make sure it reads all
     * the data it needs from this class, then call reload() with
     * `require $CWD/vendor/composer/installed.php` (or similar) as input to make sure
     * the project in which it runs can then also use this class safely, without
     * interference between PHPUnit's dependencies and the project's dependencies.
     *
     * @param  array[] $data A vendor/composer/installed.php data set
     * @return void
     *
     * @psalm-param array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>} $data
     */
    public static function reload($data)
    {
        self::$installed = $data;
        self::$installedByVendor = array();
    }

    /**
     * @return array[]
     * @psalm-return list<array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>}>
     */
    private static function getInstalled()
    {
        if (null === self::$canGetVendors) {
            self::$canGetVendors = method_exists('Composer\Autoload\ClassLoader', 'getRegisteredLoaders');
        }

        $installed = array();

        if (self::$canGetVendors) {
            foreach (ClassLoader::getRegisteredLoaders() as $vendorDir => $loader) {
                if (isset(self::$installedByVendor[$vendorDir])) {
                    $installed[] = self::$installedByVendor[$vendorDir];
                } elseif (is_file($vendorDir.'/composer/installed.php')) {
                    $installed[] = self::$installedByVendor[$vendorDir] = require $vendorDir.'/composer/installed.php';
                    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') {
                self::$installed = require __DIR__ . '/installed.php';
            } else {
                self::$installed = array();
            }
        }
        $installed[] = self::$installed;

        return $installed;
    }
}
woocommerce-admin/vendor/composer/autoload_classmap.php000064400000000555151335517650017521 0ustar00<?php

// autoload_classmap.php @generated by Composer

$vendorDir = dirname(dirname(__FILE__));
$baseDir = dirname($vendorDir);

return array(
    'Automattic\\Jetpack\\Autoloader\\AutoloadGenerator' => $vendorDir . '/automattic/jetpack-autoloader/src/AutoloadGenerator.php',
    'Composer\\InstalledVersions' => $vendorDir . '/composer/InstalledVersions.php',
);
woocommerce-admin/vendor/composer/jetpack_autoload_psr4.php000064400000001136151335517650020303 0ustar00<?php

// This file `jetpack_autoload_psr4.php` was auto generated by automattic/jetpack-autoloader.

$vendorDir = dirname(__DIR__);
$baseDir   = dirname($vendorDir);

return array(
	'Composer\\Installers\\' => array(
		'version' => '1.12.0.0',
		'path'    => array( $vendorDir . '/composer/installers/src/Composer/Installers' )
	),
	'Automattic\\WooCommerce\\Admin\\' => array(
		'version' => '2.8.0.0',
		'path'    => array( $baseDir . '/src' )
	),
	'Automattic\\Jetpack\\Autoloader\\' => array(
		'version' => '2.10.5.0',
		'path'    => array( $vendorDir . '/automattic/jetpack-autoloader/src' )
	),
);
woocommerce-admin/vendor/composer/installed.json000064400000016127151335517650016171 0ustar00{
    "packages": [
        {
            "name": "automattic/jetpack-autoloader",
            "version": "v2.10.5",
            "version_normalized": "2.10.5.0",
            "source": {
                "type": "git",
                "url": "https://github.com/Automattic/jetpack-autoloader.git",
                "reference": "ec66177eefa1126d5319f3135ff3a7185e21a0ba"
            },
            "dist": {
                "type": "zip",
                "url": "https://api.github.com/repos/Automattic/jetpack-autoloader/zipball/ec66177eefa1126d5319f3135ff3a7185e21a0ba",
                "reference": "ec66177eefa1126d5319f3135ff3a7185e21a0ba",
                "shasum": ""
            },
            "require": {
                "composer-plugin-api": "^1.1 || ^2.0"
            },
            "require-dev": {
                "automattic/jetpack-changelogger": "^1.2",
                "yoast/phpunit-polyfills": "1.0.1"
            },
            "time": "2021-08-31T17:20:29+00:00",
            "type": "composer-plugin",
            "extra": {
                "autotagger": true,
                "class": "Automattic\\Jetpack\\Autoloader\\CustomAutoloaderPlugin",
                "mirror-repo": "Automattic/jetpack-autoloader",
                "changelogger": {
                    "link-template": "https://github.com/Automattic/jetpack-autoloader/compare/v${old}...v${new}"
                },
                "branch-alias": {
                    "dev-master": "2.10.x-dev"
                }
            },
            "installation-source": "dist",
            "autoload": {
                "classmap": [
                    "src/AutoloadGenerator.php"
                ],
                "psr-4": {
                    "Automattic\\Jetpack\\Autoloader\\": "src"
                }
            },
            "notification-url": "https://packagist.org/downloads/",
            "license": [
                "GPL-2.0-or-later"
            ],
            "description": "Creates a custom autoloader for a plugin or theme.",
            "support": {
                "source": "https://github.com/Automattic/jetpack-autoloader/tree/v2.10.5"
            },
            "install-path": "../automattic/jetpack-autoloader"
        },
        {
            "name": "composer/installers",
            "version": "v1.12.0",
            "version_normalized": "1.12.0.0",
            "source": {
                "type": "git",
                "url": "https://github.com/composer/installers.git",
                "reference": "d20a64ed3c94748397ff5973488761b22f6d3f19"
            },
            "dist": {
                "type": "zip",
                "url": "https://api.github.com/repos/composer/installers/zipball/d20a64ed3c94748397ff5973488761b22f6d3f19",
                "reference": "d20a64ed3c94748397ff5973488761b22f6d3f19",
                "shasum": ""
            },
            "require": {
                "composer-plugin-api": "^1.0 || ^2.0"
            },
            "replace": {
                "roundcube/plugin-installer": "*",
                "shama/baton": "*"
            },
            "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": "^4.2 || ^5",
                "symfony/process": "^2.3"
            },
            "time": "2021-09-13T08:19:44+00:00",
            "type": "composer-plugin",
            "extra": {
                "class": "Composer\\Installers\\Plugin",
                "branch-alias": {
                    "dev-main": "1.x-dev"
                }
            },
            "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": [
                "Craft",
                "Dolibarr",
                "Eliasis",
                "Hurad",
                "ImageCMS",
                "Kanboard",
                "Lan Management System",
                "MODX Evo",
                "MantisBT",
                "Mautic",
                "Maya",
                "OXID",
                "Plentymarkets",
                "Porto",
                "RadPHP",
                "SMF",
                "Starbug",
                "Thelia",
                "Whmcs",
                "WolfCMS",
                "agl",
                "aimeos",
                "annotatecms",
                "attogram",
                "bitrix",
                "cakephp",
                "chef",
                "cockpit",
                "codeigniter",
                "concrete5",
                "croogo",
                "dokuwiki",
                "drupal",
                "eZ Platform",
                "elgg",
                "expressionengine",
                "fuelphp",
                "grav",
                "installer",
                "itop",
                "joomla",
                "known",
                "kohana",
                "laravel",
                "lavalite",
                "lithium",
                "magento",
                "majima",
                "mako",
                "mediawiki",
                "miaoxing",
                "modulework",
                "modx",
                "moodle",
                "osclass",
                "pantheon",
                "phpbb",
                "piwik",
                "ppi",
                "processwire",
                "puppet",
                "pxcms",
                "reindex",
                "roundcube",
                "shopware",
                "silverstripe",
                "sydes",
                "sylius",
                "symfony",
                "tastyigniter",
                "typo3",
                "wordpress",
                "yawik",
                "zend",
                "zikula"
            ],
            "support": {
                "issues": "https://github.com/composer/installers/issues",
                "source": "https://github.com/composer/installers/tree/v1.12.0"
            },
            "funding": [
                {
                    "url": "https://packagist.com",
                    "type": "custom"
                },
                {
                    "url": "https://github.com/composer",
                    "type": "github"
                },
                {
                    "url": "https://tidelift.com/funding/github/packagist/composer/composer",
                    "type": "tidelift"
                }
            ],
            "install-path": "./installers"
        }
    ],
    "dev": false,
    "dev-package-names": []
}
woocommerce-admin/vendor/composer/ClassLoader.php000064400000037301151335517650016221 0ustar00<?php

/*
 * This file is part of Composer.
 *
 * (c) Nils Adermann <naderman@naderman.de>
 *     Jordi Boggiano <j.boggiano@seld.be>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Composer\Autoload;

/**
 * ClassLoader implements a PSR-0, PSR-4 and classmap class loader.
 *
 *     $loader = new \Composer\Autoload\ClassLoader();
 *
 *     // register classes with namespaces
 *     $loader->add('Symfony\Component', __DIR__.'/component');
 *     $loader->add('Symfony',           __DIR__.'/framework');
 *
 *     // activate the autoloader
 *     $loader->register();
 *
 *     // to enable searching the include path (eg. for PEAR packages)
 *     $loader->setUseIncludePath(true);
 *
 * In this example, if you try to use a class in the Symfony\Component
 * namespace or one of its children (Symfony\Component\Console for instance),
 * the autoloader will first look for the class under the component/
 * directory, and it will then fallback to the framework/ directory if not
 * found before giving up.
 *
 * This class is loosely based on the Symfony UniversalClassLoader.
 *
 * @author Fabien Potencier <fabien@symfony.com>
 * @author Jordi Boggiano <j.boggiano@seld.be>
 * @see    https://www.php-fig.org/psr/psr-0/
 * @see    https://www.php-fig.org/psr/psr-4/
 */
class ClassLoader
{
    /** @var ?string */
    private $vendorDir;

    // PSR-4
    /**
     * @var array[]
     * @psalm-var array<string, array<string, int>>
     */
    private $prefixLengthsPsr4 = array();
    /**
     * @var array[]
     * @psalm-var array<string, array<int, string>>
     */
    private $prefixDirsPsr4 = array();
    /**
     * @var array[]
     * @psalm-var array<string, string>
     */
    private $fallbackDirsPsr4 = array();

    // PSR-0
    /**
     * @var array[]
     * @psalm-var array<string, array<string, string[]>>
     */
    private $prefixesPsr0 = array();
    /**
     * @var array[]
     * @psalm-var array<string, string>
     */
    private $fallbackDirsPsr0 = array();

    /** @var bool */
    private $useIncludePath = false;

    /**
     * @var string[]
     * @psalm-var array<string, string>
     */
    private $classMap = array();

    /** @var bool */
    private $classMapAuthoritative = false;

    /**
     * @var bool[]
     * @psalm-var array<string, bool>
     */
    private $missingClasses = array();

    /** @var ?string */
    private $apcuPrefix;

    /**
     * @var self[]
     */
    private static $registeredLoaders = array();

    /**
     * @param ?string $vendorDir
     */
    public function __construct($vendorDir = null)
    {
        $this->vendorDir = $vendorDir;
    }

    /**
     * @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<string, array<int, string>>
     */
    public function getPrefixesPsr4()
    {
        return $this->prefixDirsPsr4;
    }

    /**
     * @return array[]
     * @psalm-return array<string, string>
     */
    public function getFallbackDirs()
    {
        return $this->fallbackDirsPsr0;
    }

    /**
     * @return array[]
     * @psalm-return array<string, string>
     */
    public function getFallbackDirsPsr4()
    {
        return $this->fallbackDirsPsr4;
    }

    /**
     * @return string[] Array of classname => path
     * @psalm-var array<string, string>
     */
    public function getClassMap()
    {
        return $this->classMap;
    }

    /**
     * @param string[] $classMap Class to filename map
     * @psalm-param array<string, string> $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($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;
    }
}

/**
 * Scope isolated include.
 *
 * Prevents access to $this/self from included files.
 *
 * @param  string $file
 * @return void
 * @private
 */
function includeFile($file)
{
    include $file;
}
woocommerce-admin/vendor/composer/autoload_namespaces.php000064400000000225151335517650020027 0ustar00<?php

// autoload_namespaces.php @generated by Composer

$vendorDir = dirname(dirname(__FILE__));
$baseDir = dirname($vendorDir);

return array(
);
woocommerce-admin/vendor/composer/installers/src/Composer/Installers/AsgardInstaller.php000064400000002456151335517650025765 0ustar00<?php
namespace Composer\Installers;

class AsgardInstaller extends BaseInstaller
{
    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($vars)
    {
        if ($vars['type'] === 'asgard-module') {
            return $this->inflectPluginVars($vars);
        }

        if ($vars['type'] === 'asgard-theme') {
            return $this->inflectThemeVars($vars);
        }

        return $vars;
    }

    protected function inflectPluginVars($vars)
    {
        $vars['name'] = preg_replace('/-module$/', '', $vars['name']);
        $vars['name'] = str_replace(array('-', '_'), ' ', $vars['name']);
        $vars['name'] = str_replace(' ', '', ucwords($vars['name']));

        return $vars;
    }

    protected function inflectThemeVars($vars)
    {
        $vars['name'] = preg_replace('/-theme$/', '', $vars['name']);
        $vars['name'] = str_replace(array('-', '_'), ' ', $vars['name']);
        $vars['name'] = str_replace(' ', '', ucwords($vars['name']));

        return $vars;
    }
}
woocommerce-admin/vendor/composer/installers/src/Composer/Installers/CiviCrmInstaller.php000064400000000243151335517650026110 0ustar00<?php
namespace Composer\Installers;

class CiviCrmInstaller extends BaseInstaller
{
    protected $locations = array(
        'ext'    => 'ext/{$name}/'
    );
}
woocommerce-admin/vendor/composer/installers/src/Composer/Installers/KnownInstaller.php000064400000000411151335517650025645 0ustar00<?php
namespace Composer\Installers;

class KnownInstaller extends BaseInstaller
{
    protected $locations = array(
        'plugin'    => 'IdnoPlugins/{$name}/',
        'theme'     => 'Themes/{$name}/',
        'console'   => 'ConsolePlugins/{$name}/',
    );
}
woocommerce-admin/vendor/composer/installers/src/Composer/Installers/TheliaInstaller.php000064400000000604151335517650025763 0ustar00<?php
namespace Composer\Installers;

class TheliaInstaller extends BaseInstaller
{
    protected $locations = array(
        'module'                => 'local/modules/{$name}/',
        'frontoffice-template'  => 'templates/frontOffice/{$name}/',
        'backoffice-template'   => 'templates/backOffice/{$name}/',
        'email-template'        => 'templates/email/{$name}/',
    );
}
woocommerce-admin/vendor/composer/installers/src/Composer/Installers/OsclassInstaller.php000064400000000447151335517650026171 0ustar00<?php
namespace Composer\Installers;


class OsclassInstaller extends BaseInstaller 
{
    
    protected $locations = array(
        'plugin' => 'oc-content/plugins/{$name}/',
        'theme' => 'oc-content/themes/{$name}/',
        'language' => 'oc-content/languages/{$name}/',
    );
    
}
woocommerce-admin/vendor/composer/installers/src/Composer/Installers/DframeInstaller.php000064400000000263151335517650025754 0ustar00<?php

namespace Composer\Installers;

class DframeInstaller extends BaseInstaller
{
    protected $locations = array(
        'module'  => 'modules/{$vendor}/{$name}/',
    );
}
woocommerce-admin/vendor/composer/installers/src/Composer/Installers/LithiumInstaller.php000064400000000336151335517650026172 0ustar00<?php
namespace Composer\Installers;

class LithiumInstaller extends BaseInstaller
{
    protected $locations = array(
        'library' => 'libraries/{$name}/',
        'source'  => 'libraries/_source/{$name}/',
    );
}
woocommerce-admin/vendor/composer/installers/src/Composer/Installers/EzPlatformInstaller.php000064400000000354151335517650026642 0ustar00<?php
namespace Composer\Installers;

class EzPlatformInstaller extends BaseInstaller
{
    protected $locations = array(
        'meta-assets' => 'web/assets/ezplatform/',
        'assets' => 'web/assets/ezplatform/{$name}/',
    );
}
woocommerce-admin/vendor/composer/installers/src/Composer/Installers/ChefInstaller.php000064400000000336151335517650025424 0ustar00<?php
namespace Composer\Installers;

class ChefInstaller extends BaseInstaller
{
    protected $locations = array(
        'cookbook'  => 'Chef/{$vendor}/{$name}/',
        'role'      => 'Chef/roles/{$name}/',
    );
}

woocommerce-admin/vendor/composer/installers/src/Composer/Installers/MayaInstaller.php000064400000001427151335517650025450 0ustar00<?php
namespace Composer\Installers;

class MayaInstaller extends BaseInstaller
{
    protected $locations = array(
        'module' => 'modules/{$name}/',
    );

    /**
     * Format package name.
     *
     * For package type maya-module, cut off a trailing '-module' if present.
     *
     */
    public function inflectPackageVars($vars)
    {
        if ($vars['type'] === 'maya-module') {
            return $this->inflectModuleVars($vars);
        }

        return $vars;
    }

    protected function inflectModuleVars($vars)
    {
        $vars['name'] = preg_replace('/-module$/', '', $vars['name']);
        $vars['name'] = str_replace(array('-', '_'), ' ', $vars['name']);
        $vars['name'] = str_replace(' ', '', ucwords($vars['name']));

        return $vars;
    }
}
woocommerce-admin/vendor/composer/installers/src/Composer/Installers/WHMCSInstaller.php000064400000001506151335517650025440 0ustar00<?php

namespace Composer\Installers;

class WHMCSInstaller extends BaseInstaller
{
    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}/'
    );
}
woocommerce-admin/vendor/composer/installers/src/Composer/Installers/PantheonInstaller.php000064400000000446151335517650026335 0ustar00<?php

namespace Composer\Installers;

class PantheonInstaller extends BaseInstaller
{
    /** @var array<string, string> */
    protected $locations = array(
        'script' => 'web/private/scripts/quicksilver/{$name}',
        'module' => 'web/private/scripts/quicksilver/{$name}',
    );
}
woocommerce-admin/vendor/composer/installers/src/Composer/Installers/PiwikInstaller.php000064400000001271151335517650025641 0ustar00<?php
namespace Composer\Installers;

/**
 * Class PiwikInstaller
 *
 * @package Composer\Installers
 */
class PiwikInstaller extends BaseInstaller
{
    /**
     * @var array
     */
    protected $locations = array(
        'plugin' => 'plugins/{$name}/',
    );

    /**
     * Format package name to CamelCase
     * @param array $vars
     *
     * @return array
     */
    public function inflectPackageVars($vars)
    {
        $vars['name'] = strtolower(preg_replace('/(?<=\\w)([A-Z])/', '_\\1', $vars['name']));
        $vars['name'] = str_replace(array('-', '_'), ' ', $vars['name']);
        $vars['name'] = str_replace(' ', '', ucwords($vars['name']));

        return $vars;
    }
}
woocommerce-admin/vendor/composer/installers/src/Composer/Installers/KirbyInstaller.php000064400000000405151335517650025634 0ustar00<?php
namespace Composer\Installers;

class KirbyInstaller extends BaseInstaller
{
    protected $locations = array(
        'plugin'    => 'site/plugins/{$name}/',
        'field'    => 'site/fields/{$name}/',
        'tag'    => 'site/tags/{$name}/'
    );
}
woocommerce-admin/vendor/composer/installers/src/Composer/Installers/PhiftyInstaller.php000064400000000400151335517650026012 0ustar00<?php
namespace Composer\Installers;

class PhiftyInstaller extends BaseInstaller
{
    protected $locations = array(
        'bundle' => 'bundles/{$name}/',
        'library' => 'libraries/{$name}/',
        'framework' => 'frameworks/{$name}/',
    );
}
woocommerce-admin/vendor/composer/installers/src/Composer/Installers/ElggInstaller.php000064400000000241151335517650025430 0ustar00<?php
namespace Composer\Installers;

class ElggInstaller extends BaseInstaller
{
    protected $locations = array(
        'plugin' => 'mod/{$name}/',
    );
}
woocommerce-admin/vendor/composer/installers/src/Composer/Installers/Symfony1Installer.php000064400000001066151335517650026305 0ustar00<?php
namespace Composer\Installers;

/**
 * Plugin installer for symfony 1.x
 *
 * @author Jérôme Tamarelle <jerome@tamarelle.net>
 */
class Symfony1Installer extends BaseInstaller
{
    protected $locations = array(
        'plugin'    => 'plugins/{$name}/',
    );

    /**
     * Format package name to CamelCase
     */
    public function inflectPackageVars($vars)
    {
        $vars['name'] = preg_replace_callback('/(-[a-z])/', function ($matches) {
            return strtoupper($matches[0][1]);
        }, $vars['name']);

        return $vars;
    }
}
woocommerce-admin/vendor/composer/installers/src/Composer/Installers/DokuWikiInstaller.php000064400000002354151335517650026307 0ustar00<?php
namespace Composer\Installers;

class DokuWikiInstaller extends BaseInstaller
{
    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($vars)
    {

        if ($vars['type'] === 'dokuwiki-plugin') {
            return $this->inflectPluginVars($vars);
        }

        if ($vars['type'] === 'dokuwiki-template') {
            return $this->inflectTemplateVars($vars);
        }

        return $vars;
    }

    protected function inflectPluginVars($vars)
    {
        $vars['name'] = preg_replace('/-plugin$/', '', $vars['name']);
        $vars['name'] = preg_replace('/^dokuwiki_?-?/', '', $vars['name']);

        return $vars;
    }

    protected function inflectTemplateVars($vars)
    {
        $vars['name'] = preg_replace('/-template$/', '', $vars['name']);
        $vars['name'] = preg_replace('/^dokuwiki_?-?/', '', $vars['name']);

        return $vars;
    }

}
woocommerce-admin/vendor/composer/installers/src/Composer/Installers/Plugin.php000064400000001214151335517650024133 0ustar00<?php

namespace Composer\Installers;

use Composer\Composer;
use Composer\IO\IOInterface;
use Composer\Plugin\PluginInterface;

class Plugin implements PluginInterface
{
    private $installer;

    public function activate(Composer $composer, IOInterface $io)
    {
        $this->installer = new Installer($io, $composer);
        $composer->getInstallationManager()->addInstaller($this->installer);
    }

    public function deactivate(Composer $composer, IOInterface $io)
    {
        $composer->getInstallationManager()->removeInstaller($this->installer);
    }

    public function uninstall(Composer $composer, IOInterface $io)
    {
    }
}
woocommerce-admin/vendor/composer/installers/src/Composer/Installers/LaravelInstaller.php000064400000000253151335517650026143 0ustar00<?php
namespace Composer\Installers;

class LaravelInstaller extends BaseInstaller
{
    protected $locations = array(
        'library' => 'libraries/{$name}/',
    );
}
woocommerce-admin/vendor/composer/installers/src/Composer/Installers/HuradInstaller.php000064400000001276151335517650025626 0ustar00<?php
namespace Composer\Installers;

class HuradInstaller extends BaseInstaller
{
    protected $locations = array(
        'plugin' => 'plugins/{$name}/',
        'theme' => 'plugins/{$name}/',
    );

    /**
     * Format package name to CamelCase
     */
    public function inflectPackageVars($vars)
    {
        $nameParts = explode('/', $vars['name']);
        foreach ($nameParts as &$value) {
            $value = strtolower(preg_replace('/(?<=\\w)([A-Z])/', '_\\1', $value));
            $value = str_replace(array('-', '_'), ' ', $value);
            $value = str_replace(' ', '', ucwords($value));
        }
        $vars['name'] = implode('/', $nameParts);
        return $vars;
    }
}
woocommerce-admin/vendor/composer/installers/src/Composer/Installers/DolibarrInstaller.php000064400000000542151335517650026314 0ustar00<?php
namespace Composer\Installers;

/**
 * Class DolibarrInstaller
 *
 * @package Composer\Installers
 * @author  Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
 */
class DolibarrInstaller extends BaseInstaller
{
    //TODO: Add support for scripts and themes
    protected $locations = array(
        'module' => 'htdocs/custom/{$name}/',
    );
}
woocommerce-admin/vendor/composer/installers/src/Composer/Installers/GravInstaller.php000064400000001274151335517650025460 0ustar00<?php
namespace Composer\Installers;

class GravInstaller extends BaseInstaller
{
    protected $locations = array(
        'plugin' => 'user/plugins/{$name}/',
        'theme'  => 'user/themes/{$name}/',
    );

    /**
     * Format package name
     *
     * @param array $vars
     *
     * @return array
     */
    public function inflectPackageVars($vars)
    {
        $restrictedWords = implode('|', array_keys($this->locations));

        $vars['name'] = strtolower($vars['name']);
        $vars['name'] = preg_replace('/^(?:grav-)?(?:(?:'.$restrictedWords.')-)?(.*?)(?:-(?:'.$restrictedWords.'))?$/ui',
            '$1',
            $vars['name']
        );

        return $vars;
    }
}
woocommerce-admin/vendor/composer/installers/src/Composer/Installers/BaseInstaller.php000064400000007753151335517650025443 0ustar00<?php
namespace Composer\Installers;

use Composer\IO\IOInterface;
use Composer\Composer;
use Composer\Package\PackageInterface;

abstract class BaseInstaller
{
    protected $locations = array();
    protected $composer;
    protected $package;
    protected $io;

    /**
     * Initializes base installer.
     *
     * @param PackageInterface $package
     * @param Composer         $composer
     * @param IOInterface      $io
     */
    public function __construct(PackageInterface $package = null, Composer $composer = null, IOInterface $io = null)
    {
        $this->composer = $composer;
        $this->package = $package;
        $this->io = $io;
    }

    /**
     * Return the install path based on package type.
     *
     * @param  PackageInterface $package
     * @param  string           $frameworkType
     * @return string
     */
    public function getInstallPath(PackageInterface $package, $frameworkType = '')
    {
        $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'];
        }

        if ($this->composer->getPackage()) {
            $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();
        if (!isset($locations[$packageType])) {
            throw new \InvalidArgumentException(sprintf('Package type "%s" is not supported', $type));
        }

        return $this->templatePath($locations[$packageType], $availableVars);
    }

    /**
     * For an installer to override to modify the vars per installer.
     *
     * @param  array<string, string> $vars This will normally receive array{name: string, vendor: string, type: string}
     * @return array<string, string>
     */
    public function inflectPackageVars($vars)
    {
        return $vars;
    }

    /**
     * Gets the installer's locations
     *
     * @return array<string, string> map of package types => install path
     */
    public function getLocations()
    {
        return $this->locations;
    }

    /**
     * Replace vars in a path
     *
     * @param  string                $path
     * @param  array<string, string> $vars
     * @return string
     */
    protected function templatePath($path, array $vars = array())
    {
        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
     * @param  string $name
     * @param  string $type
     * @param  string $vendor = NULL
     * @return string|false
     */
    protected function mapCustomInstallPaths(array $paths, $name, $type, $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;
    }
}
woocommerce-admin/vendor/composer/installers/src/Composer/Installers/ProcessWireInstaller.php000064400000001053151335517650027021 0ustar00<?php

namespace Composer\Installers;

class ProcessWireInstaller extends BaseInstaller
{
    protected $locations = array(
        'module'  => 'site/modules/{$name}/',
    );

    /**
     * Format package name to CamelCase
     */
    public function inflectPackageVars($vars)
    {
        $vars['name'] = strtolower(preg_replace('/(?<=\\w)([A-Z])/', '_\\1', $vars['name']));
        $vars['name'] = str_replace(array('-', '_'), ' ', $vars['name']);
        $vars['name'] = str_replace(' ', '', ucwords($vars['name']));

        return $vars;
    }
}
woocommerce-admin/vendor/composer/installers/src/Composer/Installers/ItopInstaller.php000064400000000256151335517650025473 0ustar00<?php
namespace Composer\Installers;

class ItopInstaller extends BaseInstaller
{
    protected $locations = array(
        'extension'    => 'extensions/{$name}/',
    );
}
woocommerce-admin/vendor/composer/installers/src/Composer/Installers/Redaxo5Installer.php000064400000000404151335517650026062 0ustar00<?php
namespace Composer\Installers;

class Redaxo5Installer extends BaseInstaller
{
    protected $locations = array(
        'addon'          => 'redaxo/src/addons/{$name}/',
        'bestyle-plugin' => 'redaxo/src/addons/be_style/plugins/{$name}/'
    );
}
woocommerce-admin/vendor/composer/installers/src/Composer/Installers/RadPHPInstaller.php000064400000001223151335517650025631 0ustar00<?php
namespace Composer\Installers;

class RadPHPInstaller extends BaseInstaller
{
    protected $locations = array(
        'bundle' => 'src/{$name}/'
    );

    /**
     * Format package name to CamelCase
     */
    public function inflectPackageVars($vars)
    {
        $nameParts = explode('/', $vars['name']);
        foreach ($nameParts as &$value) {
            $value = strtolower(preg_replace('/(?<=\\w)([A-Z])/', '_\\1', $value));
            $value = str_replace(array('-', '_'), ' ', $value);
            $value = str_replace(' ', '', ucwords($value));
        }
        $vars['name'] = implode('/', $nameParts);
        return $vars;
    }
}
woocommerce-admin/vendor/composer/installers/src/Composer/Installers/PortoInstaller.php000064400000000260151335517650025656 0ustar00<?php
namespace Composer\Installers;

class PortoInstaller extends BaseInstaller
{
    protected $locations = array(
        'container' => 'app/Containers/{$name}/',
    );
}
woocommerce-admin/vendor/composer/installers/src/Composer/Installers/EliasisInstaller.php000064400000000461151335517650026147 0ustar00<?php
namespace Composer\Installers;

class EliasisInstaller extends BaseInstaller
{
    protected $locations = array(
        'component' => 'components/{$name}/',
        'module'    => 'modules/{$name}/',
        'plugin'    => 'plugins/{$name}/',
        'template'  => 'templates/{$name}/',
    );
}
woocommerce-admin/vendor/composer/installers/src/Composer/Installers/StarbugInstaller.php000064400000000461151335517650026165 0ustar00<?php
namespace Composer\Installers;

class StarbugInstaller extends BaseInstaller
{
    protected $locations = array(
        'module' => 'modules/{$name}/',
        'theme' => 'themes/{$name}/',
        'custom-module' => 'app/modules/{$name}/',
        'custom-theme' => 'app/themes/{$name}/'
    );
}
woocommerce-admin/vendor/composer/installers/src/Composer/Installers/CraftInstaller.php000064400000001446151335517650025621 0ustar00<?php
namespace Composer\Installers;

/**
 * Installer for Craft Plugins
 */
class CraftInstaller extends BaseInstaller
{
    const NAME_PREFIX = 'craft';
    const NAME_SUFFIX = 'plugin';

    protected $locations = array(
        'plugin' => 'craft/plugins/{$name}/',
    );

    /**
     * Strip `craft-` prefix and/or `-plugin` suffix from package names
     *
     * @param  array $vars
     *
     * @return array
     */
    final public function inflectPackageVars($vars)
    {
        return $this->inflectPluginVars($vars);
    }

    private function inflectPluginVars($vars)
    {
        $vars['name'] = preg_replace('/-' . self::NAME_SUFFIX . '$/i', '', $vars['name']);
        $vars['name'] = preg_replace('/^' . self::NAME_PREFIX . '-/i', '', $vars['name']);

        return $vars;
    }
}
woocommerce-admin/vendor/composer/installers/src/Composer/Installers/AimeosInstaller.php000064400000000250151335517650025767 0ustar00<?php
namespace Composer\Installers;

class AimeosInstaller extends BaseInstaller
{
    protected $locations = array(
        'extension'   => 'ext/{$name}/',
    );
}
woocommerce-admin/vendor/composer/installers/src/Composer/Installers/MODXEvoInstaller.php000064400000000741151335517650026000 0ustar00<?php
namespace Composer\Installers;

/**
 * An installer to handle MODX Evolution specifics when installing packages.
 */
class MODXEvoInstaller extends BaseInstaller
{
    protected $locations = array(
        'snippet'       => 'assets/snippets/{$name}/',
        'plugin'        => 'assets/plugins/{$name}/',
        'module'        => 'assets/modules/{$name}/',
        'template'      => 'assets/templates/{$name}/',
        'lib'           => 'assets/lib/{$name}/'
    );
}
woocommerce-admin/vendor/composer/installers/src/Composer/Installers/FuelInstaller.php000064400000000417151335517650025452 0ustar00<?php
namespace Composer\Installers;

class FuelInstaller extends BaseInstaller
{
    protected $locations = array(
        'module'  => 'fuel/app/modules/{$name}/',
        'package' => 'fuel/packages/{$name}/',
        'theme'   => 'fuel/app/themes/{$name}/',
    );
}
woocommerce-admin/vendor/composer/installers/src/Composer/Installers/MagentoInstaller.php000064400000000421151335517650026144 0ustar00<?php
namespace Composer\Installers;

class MagentoInstaller extends BaseInstaller
{
    protected $locations = array(
        'theme'   => 'app/design/frontend/{$name}/',
        'skin'    => 'skin/frontend/default/{$name}/',
        'library' => 'lib/{$name}/',
    );
}
woocommerce-admin/vendor/composer/installers/src/Composer/Installers/DrupalInstaller.php000064400000001543151335517650026007 0ustar00<?php
namespace Composer\Installers;

class DrupalInstaller extends BaseInstaller
{
    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/',
    );
}
vendor/composer/installers/src/Composer/Installers/LanManagementSystemInstaller.php000064400000001326151335517650030414 0ustar00woocommerce-admin<?php

namespace Composer\Installers;

class LanManagementSystemInstaller extends BaseInstaller
{

    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($vars)
    {
        $vars['name'] = strtolower(preg_replace('/(?<=\\w)([A-Z])/', '_\\1', $vars['name']));
        $vars['name'] = str_replace(array('-', '_'), ' ', $vars['name']);
        $vars['name'] = str_replace(' ', '', ucwords($vars['name']));

        return $vars;
    }

}
woocommerce-admin/vendor/composer/installers/src/Composer/Installers/ImageCMSInstaller.php000064400000000444151335517650026144 0ustar00<?php
namespace Composer\Installers;

class ImageCMSInstaller extends BaseInstaller
{
    protected $locations = array(
        'template'    => 'templates/{$name}/',
        'module'      => 'application/modules/{$name}/',
        'library'     => 'application/libraries/{$name}/',
    );
}
woocommerce-admin/vendor/composer/installers/src/Composer/Installers/AnnotateCmsInstaller.php000064400000000436151335517650026774 0ustar00<?php
namespace Composer\Installers;

class AnnotateCmsInstaller extends BaseInstaller
{
    protected $locations = array(
        'module'    => 'addons/modules/{$name}/',
        'component' => 'addons/components/{$name}/',
        'service'   => 'addons/services/{$name}/',
    );
}
woocommerce-admin/vendor/composer/installers/src/Composer/Installers/UserFrostingInstaller.php000064400000000265151335517650027212 0ustar00<?php
namespace Composer\Installers;

class UserFrostingInstaller extends BaseInstaller
{
    protected $locations = array(
        'sprinkle' => 'app/sprinkles/{$name}/',
    );
}
woocommerce-admin/vendor/composer/installers/src/Composer/Installers/MiaoxingInstaller.php000064400000000252151335517650026327 0ustar00<?php

namespace Composer\Installers;

class MiaoxingInstaller extends BaseInstaller
{
    protected $locations = array(
        'plugin' => 'plugins/{$name}/',
    );
}
woocommerce-admin/vendor/composer/installers/src/Composer/Installers/KanboardInstaller.php000064400000000450151335517650026275 0ustar00<?php
namespace Composer\Installers;

/**
 *
 * Installer for kanboard plugins
 *
 * kanboard.net
 *
 * Class KanboardInstaller
 * @package Composer\Installers
 */
class KanboardInstaller extends BaseInstaller
{
    protected $locations = array(
        'plugin'  => 'plugins/{$name}/',
    );
}
woocommerce-admin/vendor/composer/installers/src/Composer/Installers/MicroweberInstaller.php000064400000010340151335517650026651 0ustar00<?php
namespace Composer\Installers;

class MicroweberInstaller extends BaseInstaller
{
    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($vars)
    {


        if ($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;
    }

    protected function inflectTemplateVars($vars)
    {
        $vars['install_item_dir'] = preg_replace('/-template$/', '', $vars['install_item_dir']);
        $vars['install_item_dir'] = preg_replace('/template-$/', '', $vars['install_item_dir']);

        return $vars;
    }

    protected function inflectTemplatesVars($vars)
    {
        $vars['install_item_dir'] = preg_replace('/-templates$/', '', $vars['install_item_dir']);
        $vars['install_item_dir'] = preg_replace('/templates-$/', '', $vars['install_item_dir']);

        return $vars;
    }

    protected function inflectCoreVars($vars)
    {
        $vars['install_item_dir'] = preg_replace('/-providers$/', '', $vars['install_item_dir']);
        $vars['install_item_dir'] = preg_replace('/-provider$/', '', $vars['install_item_dir']);
        $vars['install_item_dir'] = preg_replace('/-adapter$/', '', $vars['install_item_dir']);

        return $vars;
    }

    protected function inflectModuleVars($vars)
    {
        $vars['install_item_dir'] = preg_replace('/-module$/', '', $vars['install_item_dir']);
        $vars['install_item_dir'] = preg_replace('/module-$/', '', $vars['install_item_dir']);

        return $vars;
    }

    protected function inflectModulesVars($vars)
    {
        $vars['install_item_dir'] = preg_replace('/-modules$/', '', $vars['install_item_dir']);
        $vars['install_item_dir'] = preg_replace('/modules-$/', '', $vars['install_item_dir']);

        return $vars;
    }

    protected function inflectSkinVars($vars)
    {
        $vars['install_item_dir'] = preg_replace('/-skin$/', '', $vars['install_item_dir']);
        $vars['install_item_dir'] = preg_replace('/skin-$/', '', $vars['install_item_dir']);

        return $vars;
    }

    protected function inflectElementVars($vars)
    {
        $vars['install_item_dir'] = preg_replace('/-elements$/', '', $vars['install_item_dir']);
        $vars['install_item_dir'] = preg_replace('/elements-$/', '', $vars['install_item_dir']);
        $vars['install_item_dir'] = preg_replace('/-element$/', '', $vars['install_item_dir']);
        $vars['install_item_dir'] = preg_replace('/element-$/', '', $vars['install_item_dir']);

        return $vars;
    }
}
woocommerce-admin/vendor/composer/installers/src/Composer/Installers/MediaWikiInstaller.php000064400000002422151335517650026420 0ustar00<?php
namespace Composer\Installers;

class MediaWikiInstaller extends BaseInstaller
{
    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($vars)
    {

        if ($vars['type'] === 'mediawiki-extension') {
            return $this->inflectExtensionVars($vars);
        }

        if ($vars['type'] === 'mediawiki-skin') {
            return $this->inflectSkinVars($vars);
        }

        return $vars;
    }

    protected function inflectExtensionVars($vars)
    {
        $vars['name'] = preg_replace('/-extension$/', '', $vars['name']);
        $vars['name'] = str_replace('-', ' ', $vars['name']);
        $vars['name'] = str_replace(' ', '', ucwords($vars['name']));

        return $vars;
    }

    protected function inflectSkinVars($vars)
    {
        $vars['name'] = preg_replace('/-skin$/', '', $vars['name']);

        return $vars;
    }

}
woocommerce-admin/vendor/composer/installers/src/Composer/Installers/AttogramInstaller.php000064400000000251151335517650026331 0ustar00<?php
namespace Composer\Installers;

class AttogramInstaller extends BaseInstaller
{
    protected $locations = array(
        'module' => 'modules/{$name}/',
    );
}
woocommerce-admin/vendor/composer/installers/src/Composer/Installers/YawikInstaller.php000064400000001246151335517650025644 0ustar00<?php
/**
 * Created by PhpStorm.
 * User: cbleek
 * Date: 25.03.16
 * Time: 20:55
 */

namespace Composer\Installers;


class YawikInstaller extends BaseInstaller
{
    protected $locations = array(
        'module'  => 'module/{$name}/',
    );

    /**
     * Format package name to CamelCase
     * @param array $vars
     *
     * @return array
     */
    public function inflectPackageVars($vars)
    {
        $vars['name'] = strtolower(preg_replace('/(?<=\\w)([A-Z])/', '_\\1', $vars['name']));
        $vars['name'] = str_replace(array('-', '_'), ' ', $vars['name']);
        $vars['name'] = str_replace(' ', '', ucwords($vars['name']));

        return $vars;
    }
}woocommerce-admin/vendor/composer/installers/src/Composer/Installers/ShopwareInstaller.php000064400000003156151335517650026352 0ustar00<?php
namespace Composer\Installers;

/**
 * Plugin/theme installer for shopware
 * @author Benjamin Boit
 */
class ShopwareInstaller extends BaseInstaller
{
    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
     * @param  array $vars
     * @return array
     */
    public function inflectPackageVars($vars)
    {
        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($vars)
    {
        $camelCasedName = preg_replace_callback('/(-[a-z])/', function ($matches) {
            return strtoupper($matches[0][1]);
        }, $vars['name']);

        $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($vars)
    {
        $vars['name'] = str_replace('-', '_', $vars['name']);

        return $vars;
    }
}
woocommerce-admin/vendor/composer/installers/src/Composer/Installers/SMFInstaller.php000064400000000312151335517650025176 0ustar00<?php
namespace Composer\Installers;

class SMFInstaller extends BaseInstaller
{
    protected $locations = array(
        'module' => 'Sources/{$name}/',
        'theme' => 'Themes/{$name}/',
    );
}
woocommerce-admin/vendor/composer/installers/src/Composer/Installers/VgmcpInstaller.php000064400000002457151335517650025641 0ustar00<?php
namespace Composer\Installers;

class VgmcpInstaller extends BaseInstaller
{
    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($vars)
    {
        if ($vars['type'] === 'vgmcp-bundle') {
            return $this->inflectPluginVars($vars);
        }

        if ($vars['type'] === 'vgmcp-theme') {
            return $this->inflectThemeVars($vars);
        }

        return $vars;
    }

    protected function inflectPluginVars($vars)
    {
        $vars['name'] = preg_replace('/-bundle$/', '', $vars['name']);
        $vars['name'] = str_replace(array('-', '_'), ' ', $vars['name']);
        $vars['name'] = str_replace(' ', '', ucwords($vars['name']));

        return $vars;
    }

    protected function inflectThemeVars($vars)
    {
        $vars['name'] = preg_replace('/-theme$/', '', $vars['name']);
        $vars['name'] = str_replace(array('-', '_'), ' ', $vars['name']);
        $vars['name'] = str_replace(' ', '', ucwords($vars['name']));

        return $vars;
    }
}
woocommerce-admin/vendor/composer/installers/src/Composer/Installers/PPIInstaller.php000064400000000244151335517650025205 0ustar00<?php
namespace Composer\Installers;

class PPIInstaller extends BaseInstaller
{
    protected $locations = array(
        'module' => 'modules/{$name}/',
    );
}
woocommerce-admin/vendor/composer/installers/src/Composer/Installers/RedaxoInstaller.php000064400000000413151335517650025775 0ustar00<?php
namespace Composer\Installers;

class RedaxoInstaller extends BaseInstaller
{
    protected $locations = array(
        'addon'          => 'redaxo/include/addons/{$name}/',
        'bestyle-plugin' => 'redaxo/include/addons/be_style/plugins/{$name}/'
    );
}
woocommerce-admin/vendor/composer/installers/src/Composer/Installers/ModxInstaller.php000064400000000364151335517650025467 0ustar00<?php
namespace Composer\Installers;

/**
 * An installer to handle MODX specifics when installing packages.
 */
class ModxInstaller extends BaseInstaller
{
    protected $locations = array(
        'extra' => 'core/packages/{$name}/'
    );
}
woocommerce-admin/vendor/composer/installers/src/Composer/Installers/TaoInstaller.php000064400000001423151335517650025300 0ustar00<?php
namespace Composer\Installers;

/**
 * An installer to handle TAO extensions.
 */
class TaoInstaller extends BaseInstaller
{
    const EXTRA_TAO_EXTENSION_NAME = 'tao-extension-name';

    protected $locations = array(
        'extension' => '{$name}'
    );
    
    public function inflectPackageVars($vars)
    {
        $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;
    }
}
woocommerce-admin/vendor/composer/installers/src/Composer/Installers/PhpBBInstaller.php000064400000000405151335517650025507 0ustar00<?php
namespace Composer\Installers;

class PhpBBInstaller extends BaseInstaller
{
    protected $locations = array(
        'extension' => 'ext/{$vendor}/{$name}/',
        'language'  => 'language/{$name}/',
        'style'     => 'styles/{$name}/',
    );
}
woocommerce-admin/vendor/composer/installers/src/Composer/Installers/SyDESInstaller.php000064400000002264151335517650025510 0ustar00<?php
namespace Composer\Installers;

class SyDESInstaller extends BaseInstaller
{
    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.
     *
     * {@inerhitDoc}
     */
    public function inflectPackageVars($vars)
    {
        if ($vars['type'] == 'sydes-module') {
            return $this->inflectModuleVars($vars);
        }

        if ($vars['type'] === 'sydes-theme') {
            return $this->inflectThemeVars($vars);
        }

        return $vars;
    }

    public function inflectModuleVars($vars)
    {
        $vars['name'] = preg_replace('/(^sydes-|-module$)/i', '', $vars['name']);
        $vars['name'] = str_replace(array('-', '_'), ' ', $vars['name']);
        $vars['name'] = str_replace(' ', '', ucwords($vars['name']));

        return $vars;
    }

    protected function inflectThemeVars($vars)
    {
        $vars['name'] = preg_replace('/(^sydes-|-theme$)/', '', $vars['name']);
        $vars['name'] = strtolower($vars['name']);

        return $vars;
    }
}
woocommerce-admin/vendor/composer/installers/src/Composer/Installers/PrestashopInstaller.php000064400000000322151335517650026702 0ustar00<?php
namespace Composer\Installers;

class PrestashopInstaller extends BaseInstaller
{
    protected $locations = array(
        'module' => 'modules/{$name}/',
        'theme'  => 'themes/{$name}/',
    );
}
woocommerce-admin/vendor/composer/installers/src/Composer/Installers/OctoberInstaller.php000064400000002377151335517650026163 0ustar00<?php
namespace Composer\Installers;

class OctoberInstaller extends BaseInstaller
{
    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($vars)
    {
        if ($vars['type'] === 'october-plugin') {
            return $this->inflectPluginVars($vars);
        }

        if ($vars['type'] === 'october-theme') {
            return $this->inflectThemeVars($vars);
        }

        return $vars;
    }

    protected function inflectPluginVars($vars)
    {
        $vars['name'] = preg_replace('/^oc-|-plugin$/', '', $vars['name']);
        $vars['vendor'] = preg_replace('/[^a-z0-9_]/i', '', $vars['vendor']);

        return $vars;
    }

    protected function inflectThemeVars($vars)
    {
        $vars['name'] = preg_replace('/^oc-|-theme$/', '', $vars['name']);
        $vars['vendor'] = preg_replace('/[^a-z0-9_]/i', '', $vars['vendor']);

        return $vars;
    }
}
woocommerce-admin/vendor/composer/installers/src/Composer/Installers/SiteDirectInstaller.php000064400000001216151335517650026614 0ustar00<?php

namespace Composer\Installers;

class SiteDirectInstaller extends BaseInstaller
{
    protected $locations = array(
        'module' => 'modules/{$vendor}/{$name}/',
        'plugin' => 'plugins/{$vendor}/{$name}/'
    );

    public function inflectPackageVars($vars)
    {
        return $this->parseVars($vars);
    }

    protected function parseVars($vars)
    {
        $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;
    }
}
woocommerce-admin/vendor/composer/installers/src/Composer/Installers/MantisBTInstaller.php000064400000001110151335517650026227 0ustar00<?php
namespace Composer\Installers;

use Composer\DependencyResolver\Pool;

class MantisBTInstaller extends BaseInstaller
{
    protected $locations = array(
        'plugin' => 'plugins/{$name}/',
    );

    /**
     * Format package name to CamelCase
     */
    public function inflectPackageVars($vars)
    {
        $vars['name'] = strtolower(preg_replace('/(?<=\\w)([A-Z])/', '_\\1', $vars['name']));
        $vars['name'] = str_replace(array('-', '_'), ' ', $vars['name']);
        $vars['name'] = str_replace(' ', '', ucwords($vars['name']));

        return $vars;
    }
}
woocommerce-admin/vendor/composer/installers/src/Composer/Installers/PuppetInstaller.php000064400000000251151335517650026030 0ustar00<?php

namespace Composer\Installers;

class PuppetInstaller extends BaseInstaller
{

    protected $locations = array(
        'module' => 'modules/{$name}/',
    );
}
woocommerce-admin/vendor/composer/installers/src/Composer/Installers/KohanaInstaller.php000064400000000247151335517650025761 0ustar00<?php
namespace Composer\Installers;

class KohanaInstaller extends BaseInstaller
{
    protected $locations = array(
        'module' => 'modules/{$name}/',
    );
}
woocommerce-admin/vendor/composer/installers/src/Composer/Installers/LavaLiteInstaller.php000064400000000344151335517650026257 0ustar00<?php
namespace Composer\Installers;

class LavaLiteInstaller extends BaseInstaller
{
    protected $locations = array(
        'package' => 'packages/{$vendor}/{$name}/',
        'theme'   => 'public/themes/{$name}/',
    );
}
woocommerce-admin/vendor/composer/installers/src/Composer/Installers/RoundcubeInstaller.php000064400000000711151335517650026502 0ustar00<?php
namespace Composer\Installers;

class RoundcubeInstaller extends BaseInstaller
{
    protected $locations = array(
        'plugin' => 'plugins/{$name}/',
    );

    /**
     * Lowercase name and changes the name to a underscores
     *
     * @param  array $vars
     * @return array
     */
    public function inflectPackageVars($vars)
    {
        $vars['name'] = strtolower(str_replace('-', '_', $vars['name']));

        return $vars;
    }
}
woocommerce-admin/vendor/composer/installers/src/Composer/Installers/TuskInstaller.php000064400000000640151335517650025503 0ustar00<?php
    namespace Composer\Installers;
    /**
     * Composer installer for 3rd party Tusk utilities
     * @author Drew Ewing <drew@phenocode.com>
     */
    class TuskInstaller extends BaseInstaller
    {
        protected $locations = array(
            'task'    => '.tusk/tasks/{$name}/',
            'command' => '.tusk/commands/{$name}/',
            'asset'   => 'assets/tusk/{$name}/',
        );
    }
woocommerce-admin/vendor/composer/installers/src/Composer/Installers/KodiCMSInstaller.php000064400000000333151335517650026005 0ustar00<?php
namespace Composer\Installers;

class KodiCMSInstaller extends BaseInstaller
{
    protected $locations = array(
        'plugin' => 'cms/plugins/{$name}/',
        'media'  => 'cms/media/vendor/{$name}/'
    );
}woocommerce-admin/vendor/composer/installers/src/Composer/Installers/CroogoInstaller.php000064400000000767151335517650026017 0ustar00<?php
namespace Composer\Installers;

class CroogoInstaller extends BaseInstaller
{
    protected $locations = array(
        'plugin' => 'Plugin/{$name}/',
        'theme' => 'View/Themed/{$name}/',
    );

    /**
     * Format package name to CamelCase
     */
    public function inflectPackageVars($vars)
    {
        $vars['name'] = strtolower(str_replace(array('-', '_'), ' ', $vars['name']));
        $vars['name'] = str_replace(' ', '', ucwords($vars['name']));

        return $vars;
    }
}
woocommerce-admin/vendor/composer/installers/src/Composer/Installers/MoodleInstaller.php000064400000006054151335517650026001 0ustar00<?php
namespace Composer\Installers;

class MoodleInstaller extends BaseInstaller
{
    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}/',
        '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}/',
        'fileconverter'      => 'files/converter/{$name}/',
        'format'             => 'course/format/{$name}/',
        'coursereport'       => 'course/report/{$name}/',
        'customcertelement'  => 'mod/customcert/element/{$name}/',
        'datafield'          => 'mod/data/field/{$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}/',
        'message'            => 'message/output/{$name}/',
        'mnetservice'        => 'mnet/service/{$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}/'
    );
}
woocommerce-admin/vendor/composer/installers/src/Composer/Installers/MauticInstaller.php000064400000002225151335517650026000 0ustar00<?php
namespace Composer\Installers;

use Composer\Package\PackageInterface;

class MauticInstaller extends BaseInstaller
{
    protected $locations = array(
        'plugin'           => 'plugins/{$name}/',
        'theme'            => 'themes/{$name}/',
        'core'             => 'app/',
    );

    private function getDirectoryName()
    {
        $extra = $this->package->getExtra();
        if (!empty($extra['install-directory-name'])) {
            return $extra['install-directory-name'];
        }

        return $this->toCamelCase($this->package->getPrettyName());
    }

    /**
     * @param string $packageName
     *
     * @return string
     */
    private function toCamelCase($packageName)
    {
        return str_replace(' ', '', ucwords(str_replace('-', ' ', basename($packageName))));
    }

    /**
     * Format package name of mautic-plugins to CamelCase
     */
    public function inflectPackageVars($vars)
    {

        if ($vars['type'] == 'mautic-plugin' || $vars['type'] == 'mautic-theme') {
            $directoryName = $this->getDirectoryName();
            $vars['name'] = $directoryName;
        }

        return $vars;
    }

}
woocommerce-admin/vendor/composer/installers/src/Composer/Installers/AglInstaller.php000064400000000711151335517650025257 0ustar00<?php
namespace Composer\Installers;

class AglInstaller extends BaseInstaller
{
    protected $locations = array(
        'module' => 'More/{$name}/',
    );

    /**
     * Format package name to CamelCase
     */
    public function inflectPackageVars($vars)
    {
        $vars['name'] = preg_replace_callback('/(?:^|_|-)(.?)/', function ($matches) {
            return strtoupper($matches[1]);
        }, $vars['name']);

        return $vars;
    }
}
woocommerce-admin/vendor/composer/installers/src/Composer/Installers/MajimaInstaller.php000064400000001502151335517650025751 0ustar00<?php
namespace Composer\Installers;

/**
 * Plugin/theme installer for majima
 * @author David Neustadt
 */
class MajimaInstaller extends BaseInstaller
{
    protected $locations = array(
        'plugin' => 'plugins/{$name}/',
    );

    /**
     * Transforms the names
     * @param  array $vars
     * @return array
     */
    public function inflectPackageVars($vars)
    {
        return $this->correctPluginName($vars);
    }

    /**
     * Change hyphenated names to camelcase
     * @param  array $vars
     * @return array
     */
    private function correctPluginName($vars)
    {
        $camelCasedName = preg_replace_callback('/(-[a-z])/', function ($matches) {
            return strtoupper($matches[0][1]);
        }, $vars['name']);
        $vars['name'] = ucfirst($camelCasedName);
        return $vars;
    }
}
woocommerce-admin/vendor/composer/installers/src/Composer/Installers/MODULEWorkInstaller.php000064400000000256151335517650026410 0ustar00<?php
namespace Composer\Installers;

class MODULEWorkInstaller extends BaseInstaller
{
    protected $locations = array(
        'module'    => 'modules/{$name}/',
    );
}
woocommerce-admin/vendor/composer/installers/src/Composer/Installers/MakoInstaller.php000064400000000253151335517650025444 0ustar00<?php
namespace Composer\Installers;

class MakoInstaller extends BaseInstaller
{
    protected $locations = array(
        'package' => 'app/packages/{$name}/',
    );
}
woocommerce-admin/vendor/composer/installers/src/Composer/Installers/FuelphpInstaller.php000064400000000257151335517650026164 0ustar00<?php
namespace Composer\Installers;

class FuelphpInstaller extends BaseInstaller
{
    protected $locations = array(
        'component'  => 'components/{$name}/',
    );
}
woocommerce-admin/vendor/composer/installers/src/Composer/Installers/ReIndexInstaller.php000064400000000324151335517650026112 0ustar00<?php
namespace Composer\Installers;

class ReIndexInstaller extends BaseInstaller
{
    protected $locations = array(
        'theme'     => 'themes/{$name}/',
        'plugin'    => 'plugins/{$name}/'
    );
}
woocommerce-admin/vendor/composer/installers/src/Composer/Installers/PimcoreInstaller.php000064400000001040151335517650026146 0ustar00<?php
namespace Composer\Installers;

class PimcoreInstaller extends BaseInstaller
{
    protected $locations = array(
        'plugin' => 'plugins/{$name}/',
    );

    /**
     * Format package name to CamelCase
     */
    public function inflectPackageVars($vars)
    {
        $vars['name'] = strtolower(preg_replace('/(?<=\\w)([A-Z])/', '_\\1', $vars['name']));
        $vars['name'] = str_replace(array('-', '_'), ' ', $vars['name']);
        $vars['name'] = str_replace(' ', '', ucwords($vars['name']));

        return $vars;
    }
}
woocommerce-admin/vendor/composer/installers/src/Composer/Installers/WolfCMSInstaller.php000064400000000255151335517650026031 0ustar00<?php
namespace Composer\Installers;

class WolfCMSInstaller extends BaseInstaller
{
    protected $locations = array(
        'plugin' => 'wolf/plugins/{$name}/',
    );
}
woocommerce-admin/vendor/composer/installers/src/Composer/Installers/DecibelInstaller.php000064400000000272151335517650026105 0ustar00<?php
namespace Composer\Installers;

class DecibelInstaller extends BaseInstaller
{
    /** @var array */
    protected $locations = array(
        'app'    => 'app/{$name}/',
    );
}
woocommerce-admin/vendor/composer/installers/src/Composer/Installers/PxcmsInstaller.php000064400000003734151335517650025656 0ustar00<?php
namespace Composer\Installers;

class PxcmsInstaller extends BaseInstaller
{
    protected $locations = array(
        'module' => 'app/Modules/{$name}/',
        'theme' => 'themes/{$name}/',
    );

    /**
     * Format package name.
     *
     * @param array $vars
     *
     * @return array
     */
    public function inflectPackageVars($vars)
    {
        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.
     *
     * return string
     */
    protected function inflectModuleVars($vars)
    {
        $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'] = preg_replace('/-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.
     *
     * return string
     */
    protected function inflectThemeVars($vars)
    {
        $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'] = preg_replace('/-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;
    }
}
woocommerce-admin/vendor/composer/installers/src/Composer/Installers/WordPressInstaller.php000064400000000524151335517650026506 0ustar00<?php
namespace Composer\Installers;

class WordPressInstaller extends BaseInstaller
{
    protected $locations = array(
        'plugin'    => 'wp-content/plugins/{$name}/',
        'theme'     => 'wp-content/themes/{$name}/',
        'muplugin'  => 'wp-content/mu-plugins/{$name}/',
        'dropin'    => 'wp-content/{$name}/',
    );
}
woocommerce-admin/vendor/composer/installers/src/Composer/Installers/TYPO3FlowInstaller.php000064400000002300151335517650026256 0ustar00<?php
namespace Composer\Installers;

/**
 * An installer to handle TYPO3 Flow specifics when installing packages.
 */
class TYPO3FlowInstaller extends BaseInstaller
{
    protected $locations = array(
        'package'       => 'Packages/Application/{$name}/',
        'framework'     => 'Packages/Framework/{$name}/',
        'plugin'        => 'Packages/Plugins/{$name}/',
        'site'          => 'Packages/Sites/{$name}/',
        'boilerplate'   => 'Packages/Boilerplates/{$name}/',
        'build'         => 'Build/{$name}/',
    );

    /**
     * Modify the package name to be a TYPO3 Flow style key.
     *
     * @param  array $vars
     * @return array
     */
    public function inflectPackageVars($vars)
    {
        $autoload = $this->package->getAutoload();
        if (isset($autoload['psr-0']) && is_array($autoload['psr-0'])) {
            $namespace = key($autoload['psr-0']);
            $vars['name'] = str_replace('\\', '.', $namespace);
        }
        if (isset($autoload['psr-4']) && is_array($autoload['psr-4'])) {
            $namespace = key($autoload['psr-4']);
            $vars['name'] = rtrim(str_replace('\\', '.', $namespace), '.');
        }

        return $vars;
    }
}
woocommerce-admin/vendor/composer/installers/src/Composer/Installers/SilverStripeInstaller.php000064400000002127151335517650027212 0ustar00<?php
namespace Composer\Installers;

use Composer\Package\PackageInterface;

class SilverStripeInstaller extends BaseInstaller
{
    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
     *
     * @param  PackageInterface $package
     * @param  string           $frameworkType
     * @return string
     */
    public function getInstallPath(PackageInterface $package, $frameworkType = '')
    {
        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);
    }
}
woocommerce-admin/vendor/composer/installers/src/Composer/Installers/ExpressionEngineInstaller.php000064400000001334151335517650030043 0ustar00<?php
namespace Composer\Installers;

use Composer\Package\PackageInterface;

class ExpressionEngineInstaller extends BaseInstaller
{

    protected $locations = array();

    private $ee2Locations = array(
        'addon'   => 'system/expressionengine/third_party/{$name}/',
        'theme'   => 'themes/third_party/{$name}/',
    );

    private $ee3Locations = array(
        'addon'   => 'system/user/addons/{$name}/',
        'theme'   => 'themes/user/{$name}/',
    );

    public function getInstallPath(PackageInterface $package, $frameworkType = '')
    {

        $version = "{$frameworkType}Locations";
        $this->locations = $this->$version;

        return parent::getInstallPath($package, $frameworkType);
    }
}
woocommerce-admin/vendor/composer/installers/src/Composer/Installers/WinterInstaller.php000064400000002676151335517650026040 0ustar00<?php
namespace Composer\Installers;

class WinterInstaller extends BaseInstaller
{
    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($vars)
    {
        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;
    }
    
    protected function inflectModuleVars($vars)
    {
        $vars['name'] = preg_replace('/^wn-|-module$/', '', $vars['name']);

        return $vars;
    }

    protected function inflectPluginVars($vars)
    {
        $vars['name'] = preg_replace('/^wn-|-plugin$/', '', $vars['name']);
        $vars['vendor'] = preg_replace('/[^a-z0-9_]/i', '', $vars['vendor']);

        return $vars;
    }

    protected function inflectThemeVars($vars)
    {
        $vars['name'] = preg_replace('/^wn-|-theme$/', '', $vars['name']);

        return $vars;
    }
}
woocommerce-admin/vendor/composer/installers/src/Composer/Installers/BonefishInstaller.php000064400000000267151335517650026317 0ustar00<?php
namespace Composer\Installers;

class BonefishInstaller extends BaseInstaller
{
    protected $locations = array(
        'package'    => 'Packages/{$vendor}/{$name}/'
    );
}
woocommerce-admin/vendor/composer/installers/src/Composer/Installers/ClanCatsFrameworkInstaller.php000064400000000326151335517650030124 0ustar00<?php
namespace Composer\Installers;

class ClanCatsFrameworkInstaller extends BaseInstaller
{
	protected $locations = array(
		'ship'      => 'CCF/orbit/{$name}/',
		'theme'     => 'CCF/app/themes/{$name}/',
	);
}woocommerce-admin/vendor/composer/installers/src/Composer/Installers/OxidInstaller.php000064400000002652151335517650025465 0ustar00<?php
namespace Composer\Installers;

use Composer\Package\PackageInterface;

class OxidInstaller extends BaseInstaller
{
	const VENDOR_PATTERN = '/^modules\/(?P<vendor>.+)\/.+/';

    protected $locations = array(
        'module'    => 'modules/{$name}/',
        'theme'  => 'application/views/{$name}/',
        'out'    => 'out/{$name}/',
    );

	/**
	 * getInstallPath
	 *
	 * @param PackageInterface $package
	 * @param string $frameworkType
	 * @return string
	 */
	public function getInstallPath(PackageInterface $package, $frameworkType = '')
	{
		$installPath = parent::getInstallPath($package, $frameworkType);
		$type = $this->package->getType();
		if ($type === 'oxid-module') {
			$this->prepareVendorDirectory($installPath);
		}
		return $installPath;
	}

	/**
	 * prepareVendorDirectory
	 *
	 * Makes sure there is a vendormetadata.php file inside
	 * the vendor folder if there is a vendor folder.
	 *
	 * @param string $installPath
	 * @return void
	 */
	protected function prepareVendorDirectory($installPath)
	{
		$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);
	}
}
woocommerce-admin/vendor/composer/installers/src/Composer/Installers/TYPO3CmsInstaller.php000064400000000575151335517650026105 0ustar00<?php
namespace Composer\Installers;

/**
 * Extension installer for TYPO3 CMS
 *
 * @deprecated since 1.0.25, use https://packagist.org/packages/typo3/cms-composer-installers instead
 *
 * @author Sascha Egerer <sascha.egerer@dkd.de>
 */
class TYPO3CmsInstaller extends BaseInstaller
{
    protected $locations = array(
        'extension'   => 'typo3conf/ext/{$name}/',
    );
}
woocommerce-admin/vendor/composer/installers/src/Composer/Installers/VanillaInstaller.php000064400000000325151335517650026143 0ustar00<?php
namespace Composer\Installers;

class VanillaInstaller extends BaseInstaller
{
    protected $locations = array(
        'plugin'    => 'plugins/{$name}/',
        'theme'     => 'themes/{$name}/',
    );
}
woocommerce-admin/vendor/composer/installers/src/Composer/Installers/ZikulaInstaller.php000064400000000341151335517650026012 0ustar00<?php
namespace Composer\Installers;

class ZikulaInstaller extends BaseInstaller
{
    protected $locations = array(
        'module' => 'modules/{$vendor}-{$name}/',
        'theme'  => 'themes/{$vendor}-{$name}/'
    );
}
woocommerce-admin/vendor/composer/installers/src/Composer/Installers/CakePHPInstaller.php000064400000003446151335517650025777 0ustar00<?php
namespace Composer\Installers;

use Composer\DependencyResolver\Pool;
use Composer\Semver\Constraint\Constraint;

class CakePHPInstaller extends BaseInstaller
{
    protected $locations = array(
        'plugin' => 'Plugin/{$name}/',
    );

    /**
     * Format package name to CamelCase
     */
    public function inflectPackageVars($vars)
    {
        if ($this->matchesCakeVersion('>=', '3.0.0')) {
            return $vars;
        }

        $nameParts = explode('/', $vars['name']);
        foreach ($nameParts as &$value) {
            $value = strtolower(preg_replace('/(?<=\\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()
    {
        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
     *
     * @param string $matcher
     * @param string $version
     * @return bool
     * @phpstan-param Constraint::STR_OP_* $matcher
     */
    protected function matchesCakeVersion($matcher, $version)
    {
        $repositoryManager = $this->composer->getRepositoryManager();
        if (! $repositoryManager) {
            return false;
        }

        $repos = $repositoryManager->getLocalRepository();
        if (!$repos) {
            return false;
        }

        return $repos->findPackage('cakephp/cakephp', new Constraint($matcher, $version)) !== null;
    }
}
woocommerce-admin/vendor/composer/installers/src/Composer/Installers/CockpitInstaller.php000064400000001231151335517650026146 0ustar00<?php
namespace Composer\Installers;

class CockpitInstaller extends BaseInstaller
{
    protected $locations = array(
        'module' => 'cockpit/modules/addons/{$name}/',
    );

    /**
     * Format module name.
     *
     * Strip `module-` prefix from package name.
     *
     * {@inheritDoc}
     */
    public function inflectPackageVars($vars)
    {
        if ($vars['type'] == 'cockpit-module') {
            return $this->inflectModuleVars($vars);
        }

        return $vars;
    }

    public function inflectModuleVars($vars)
    {
        $vars['name'] = ucfirst(preg_replace('/cockpit-/i', '', $vars['name']));

        return $vars;
    }
}
woocommerce-admin/vendor/composer/installers/src/Composer/Installers/Installer.php000064400000024372151335517650024644 0ustar00<?php

namespace Composer\Installers;

use Composer\Composer;
use Composer\Installer\BinaryInstaller;
use Composer\Installer\LibraryInstaller;
use Composer\IO\IOInterface;
use Composer\Package\PackageInterface;
use Composer\Repository\InstalledRepositoryInterface;
use Composer\Util\Filesystem;
use React\Promise\PromiseInterface;

class Installer extends LibraryInstaller
{

    /**
     * Package types to installer class map
     *
     * @var array
     */
    private $supportedTypes = array(
        'aimeos'       => 'AimeosInstaller',
        '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',
        'craft'        => 'CraftInstaller',
        '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',
        'joomla'       => 'JoomlaInstaller',
        'kanboard'     => 'KanboardInstaller',
        'kirby'        => 'KirbyInstaller',
        'known'	       => 'KnownInstaller',
        'kodicms'      => 'KodiCMSInstaller',
        'kohana'       => 'KohanaInstaller',
        'lms'      => 'LanManagementSystemInstaller',
        'laravel'      => 'LaravelInstaller',
        'lavalite'     => 'LavaLiteInstaller',
        'lithium'      => 'LithiumInstaller',
        'magento'      => 'MagentoInstaller',
        'majima'       => 'MajimaInstaller',
        'mantisbt'     => 'MantisBTInstaller',
        'mako'         => 'MakoInstaller',
        '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',
        'pimcore'      => 'PimcoreInstaller',
        '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',
        'symfony1'     => 'Symfony1Installer',
        'tao'          => 'TaoInstaller',
        'thelia'       => 'TheliaInstaller',
        'tusk'         => 'TuskInstaller',
        'typo3-cms'    => 'TYPO3CmsInstaller',
        'typo3-flow'   => 'TYPO3FlowInstaller',
        'userfrosting' => 'UserFrostingInstaller',
        'vanilla'      => 'VanillaInstaller',
        'whmcs'        => 'WHMCSInstaller',
        'winter'       => 'WinterInstaller',
        'wolfcms'      => 'WolfCMSInstaller',
        'wordpress'    => 'WordPressInstaller',
        'yawik'        => 'YawikInstaller',
        'zend'         => 'ZendInstaller',
        'zikula'       => 'ZikulaInstaller',
        'prestashop'   => 'PrestashopInstaller'
    );

    /**
     * Installer constructor.
     *
     * Disables installers specified in main composer extra installer-disable
     * list
     *
     * @param IOInterface          $io
     * @param Composer             $composer
     * @param string               $type
     * @param Filesystem|null      $filesystem
     * @param BinaryInstaller|null $binaryInstaller
     */
    public function __construct(
        IOInterface $io,
        Composer $composer,
        $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());

        return $installer->getInstallPath($package, $frameworkType);
    }

    public function uninstall(InstalledRepositoryInterface $repo, PackageInterface $package)
    {
        $installPath = $this->getPackageBasePath($package);
        $io = $this->io;
        $outputStatus = function () use ($io, $installPath) {
            $io->write(sprintf('Deleting %s - %s', $installPath, !file_exists($installPath) ? '<comment>deleted</comment>' : '<error>not deleted</error>'));
        };

        $promise = parent::uninstall($repo, $package);

        // Composer v2 might return a promise here
        if ($promise instanceof PromiseInterface) {
            return $promise->then($outputStatus);
        }

        // If not, execute the code right away as parent::uninstall executed synchronously (composer v1, or v2 without async)
        $outputStatus();

        return null;
    }

    /**
     * {@inheritDoc}
     */
    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
     *
     * @param  string       $type
     * @return string|false
     */
    protected function findFrameworkType($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
     *
     * @param  string $frameworkType
     * @return string
     */
    protected function getLocationPattern($frameworkType)
    {
        $pattern = false;
        if (!empty($this->supportedTypes[$frameworkType])) {
            $frameworkClass = 'Composer\\Installers\\' . $this->supportedTypes[$frameworkType];
            /** @var BaseInstaller $framework */
            $framework = new $frameworkClass(null, $this->composer, $this->getIO());
            $locations = array_keys($framework->getLocations());
            $pattern = $locations ? '(' . implode('|', $locations) . ')' : false;
        }

        return $pattern ? : '(\w+)';
    }

    /**
     * Get I/O object
     *
     * @return IOInterface
     */
    private function getIO()
    {
        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)
     *
     * @return void
     */
    protected function removeDisabledInstallers()
    {
        $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();
        } else {
            // Disable specified installers
            foreach ($disable as $key => $installer) {
                if (is_string($installer) && key_exists($installer, $this->supportedTypes)) {
                    unset($this->supportedTypes[$installer]);
                }
            }
        }
    }
}
woocommerce-admin/vendor/composer/installers/src/Composer/Installers/Concrete5Installer.php000064400000000556151335517650026412 0ustar00<?php
namespace Composer\Installers;

class Concrete5Installer extends BaseInstaller
{
    protected $locations = array(
        'core'       => 'concrete/',
        'block'      => 'application/blocks/{$name}/',
        'package'    => 'packages/{$name}/',
        'theme'      => 'application/themes/{$name}/',
        'update'     => 'updates/{$name}/',
    );
}
woocommerce-admin/vendor/composer/installers/src/Composer/Installers/OntoWikiInstaller.php000064400000001324151335517650026320 0ustar00<?php
namespace Composer\Installers;

class OntoWikiInstaller extends BaseInstaller
{
    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($vars)
    {
        $vars['name'] = strtolower($vars['name']);
        $vars['name'] = preg_replace('/.ontowiki$/', '', $vars['name']);
        $vars['name'] = preg_replace('/-theme$/', '', $vars['name']);
        $vars['name'] = preg_replace('/-translation$/', '', $vars['name']);

        return $vars;
    }
}
woocommerce-admin/vendor/composer/installers/src/Composer/Installers/CodeIgniterInstaller.php000064400000000465151335517650026756 0ustar00<?php
namespace Composer\Installers;

class CodeIgniterInstaller extends BaseInstaller
{
    protected $locations = array(
        'library'     => 'application/libraries/{$name}/',
        'third-party' => 'application/third_party/{$name}/',
        'module'      => 'application/modules/{$name}/',
    );
}
woocommerce-admin/vendor/composer/installers/src/Composer/Installers/JoomlaInstaller.php000064400000000640151335517650025776 0ustar00<?php
namespace Composer\Installers;

class JoomlaInstaller extends BaseInstaller
{
    protected $locations = array(
        'component'    => 'components/{$name}/',
        'module'       => 'modules/{$name}/',
        'template'     => 'templates/{$name}/',
        'plugin'       => 'plugins/{$name}/',
        'library'      => 'libraries/{$name}/',
    );

    // TODO: Add inflector for mod_ and com_ names
}
woocommerce-admin/vendor/composer/installers/src/Composer/Installers/BitrixInstaller.php000064400000010251151335517650026015 0ustar00<?php

namespace Composer\Installers;

use Composer\Util\Filesystem;

/**
 * Installer for Bitrix Framework. Supported types of extensions:
 * - `bitrix-d7-module` — copy the module to directory `bitrix/modules/<vendor>.<name>`.
 * - `bitrix-d7-component` — copy the component to directory `bitrix/components/<vendor>/<name>`.
 * - `bitrix-d7-template` — copy the template to directory `bitrix/templates/<vendor>_<name>`.
 * 
 * You can set custom path to directory with Bitrix kernel in `composer.json`:
 * 
 * ```json
 * {
 *      "extra": {
 *          "bitrix-dir": "s1/bitrix"
 *      }
 * }
 * ```
 *
 * @author Nik Samokhvalov <nik@samokhvalov.info>
 * @author Denis Kulichkin <onexhovia@gmail.com>
 */
class BitrixInstaller extends BaseInstaller
{
    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 array Storage for informations about duplicates at all the time of installation packages.
     */
    private static $checkedDuplicates = array();

    /**
     * {@inheritdoc}
     */
    public function inflectPackageVars($vars)
    {
        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($path, array $vars = array())
    {
        $templatePath = parent::templatePath($path, $vars);
        $this->checkDuplicates($templatePath, $vars);

        return $templatePath;
    }

    /**
     * Duplicates search packages.
     *
     * @param string $path
     * @param array $vars
     */
    protected function checkDuplicates($path, array $vars = array())
    {
        $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 && $this->io->isInteractive()) {

            $this->io->writeError('    <error>Duplication of packages:</error>');
            $this->io->writeError('    <info>Package ' . $oldPath . ' will be called instead package ' . $path . '</info>');

            while (true) {
                switch ($this->io->ask('    <info>Delete ' . $oldPath . ' [y,n,?]?</info> ', '?')) {
                    case 'y':
                        $fs = new Filesystem();
                        $fs->removeDirectory($oldPath);
                        break 2;

                    case 'n':
                        break 2;

                    case '?':
                    default:
                        $this->io->writeError(array(
                            '    y - delete package ' . $oldPath . ' and to continue with the installation',
                            '    n - don\'t delete and to continue with the installation',
                        ));
                        $this->io->writeError('    ? - print help');
                        break;
                }
            }
        }

        static::$checkedDuplicates[] = $oldPath;
    }
}
woocommerce-admin/vendor/composer/installers/src/Composer/Installers/PlentymarketsInstaller.php000064400000001311151335517650027413 0ustar00<?php
namespace Composer\Installers;

class PlentymarketsInstaller extends BaseInstaller
{
    protected $locations = array(
        'plugin'   => '{$name}/'
    );

    /**
     * Remove hyphen, "plugin" and format to camelcase
     * @param array $vars
     *
     * @return array
     */
    public function inflectPackageVars($vars)
    {
        $vars['name'] = explode("-", $vars['name']);
        foreach ($vars['name'] as $key => $name) {
            $vars['name'][$key] = ucfirst($vars['name'][$key]);
            if (strcasecmp($name, "Plugin") == 0) {
                unset($vars['name'][$key]);
            }
        }
        $vars['name'] = implode("",$vars['name']);

        return $vars;
    }
}
woocommerce-admin/vendor/composer/installers/src/Composer/Installers/TastyIgniterInstaller.php000064400000001553151335517650027207 0ustar00<?php

namespace Composer\Installers;

class TastyIgniterInstaller extends BaseInstaller
{
    protected $locations = array(
        '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($vars)
    {
        if ($vars['type'] === 'tastyigniter-extension') {
            $vars['vendor'] = preg_replace('/[^a-z0-9_]/i', '', $vars['vendor']);
            $vars['name'] = preg_replace('/^ti-ext-/', '', $vars['name']);
        }

        if ($vars['type'] === 'tastyigniter-theme') {
            $vars['name'] = preg_replace('/^ti-theme-/', '', $vars['name']);
        }

        return $vars;
    }
}woocommerce-admin/vendor/composer/installers/src/Composer/Installers/SyliusInstaller.php000064400000000245151335517650026046 0ustar00<?php
namespace Composer\Installers;

class SyliusInstaller extends BaseInstaller
{
    protected $locations = array(
        'theme' => 'themes/{$name}/',
    );
}
woocommerce-admin/vendor/composer/installers/src/Composer/Installers/ZendInstaller.php000064400000000376151335517650025463 0ustar00<?php
namespace Composer\Installers;

class ZendInstaller extends BaseInstaller
{
    protected $locations = array(
        'library' => 'library/{$name}/',
        'extra'   => 'extras/library/{$name}/',
        'module'  => 'module/{$name}/',
    );
}
woocommerce-admin/vendor/composer/installers/src/bootstrap.php000064400000000724151335517650021010 0ustar00<?php
function includeIfExists($file)
{
    if (file_exists($file)) {
        return include $file;
    }
}
if ((!$loader = includeIfExists(__DIR__ . '/../vendor/autoload.php')) && (!$loader = includeIfExists(__DIR__ . '/../../../autoload.php'))) {
    die('You must set up the project dependencies, run the following commands:'.PHP_EOL.
        'curl -s http://getcomposer.org/installer | php'.PHP_EOL.
        'php composer.phar install'.PHP_EOL);
}
return $loader;
woocommerce-admin/vendor/composer/installers/phpstan.neon.dist000064400000000325151335517650020770 0ustar00parameters:
    level: 5
    paths:
        - src
        - tests
    excludes_analyse:
        - tests/Composer/Installers/Test/PolyfillTestCase.php

includes:
    - vendor/phpstan/phpstan-phpunit/extension.neon
woocommerce-admin/vendor/composer/installers/LICENSE000064400000002046151335517650016477 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.woocommerce-admin/vendor/composer/LICENSE000064400000002056151335517650014320 0ustar00
Copyright (c) Nils Adermann, Jordi Boggiano

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is furnished
to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

woocommerce-admin/vendor/composer/autoload_psr4.php000064400000000634151335517650016604 0ustar00<?php

// autoload_psr4.php @generated by Composer

$vendorDir = dirname(dirname(__FILE__));
$baseDir = dirname($vendorDir);

return array(
    'Composer\\Installers\\' => array($vendorDir . '/composer/installers/src/Composer/Installers'),
    'Automattic\\WooCommerce\\Admin\\' => array($baseDir . '/src'),
    'Automattic\\Jetpack\\Autoloader\\' => array($vendorDir . '/automattic/jetpack-autoloader/src'),
);
woocommerce-admin/vendor/composer/autoload_real.php000064400000003551151335517650016640 0ustar00<?php

// autoload_real.php @generated by Composer

class ComposerAutoloaderInitd8a0da99a02edbc19880f5a1a3c7fa56
{
    private static $loader;

    public static function loadClassLoader($class)
    {
        if ('Composer\Autoload\ClassLoader' === $class) {
            require __DIR__ . '/ClassLoader.php';
        }
    }

    /**
     * @return \Composer\Autoload\ClassLoader
     */
    public static function getLoader()
    {
        if (null !== self::$loader) {
            return self::$loader;
        }

        require __DIR__ . '/platform_check.php';

        spl_autoload_register(array('ComposerAutoloaderInitd8a0da99a02edbc19880f5a1a3c7fa56', 'loadClassLoader'), true, true);
        self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(\dirname(__FILE__)));
        spl_autoload_unregister(array('ComposerAutoloaderInitd8a0da99a02edbc19880f5a1a3c7fa56', 'loadClassLoader'));

        $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
        if ($useStaticLoader) {
            require __DIR__ . '/autoload_static.php';

            call_user_func(\Composer\Autoload\ComposerStaticInitd8a0da99a02edbc19880f5a1a3c7fa56::getInitializer($loader));
        } else {
            $map = require __DIR__ . '/autoload_namespaces.php';
            foreach ($map as $namespace => $path) {
                $loader->set($namespace, $path);
            }

            $map = require __DIR__ . '/autoload_psr4.php';
            foreach ($map as $namespace => $path) {
                $loader->setPsr4($namespace, $path);
            }

            $classMap = require __DIR__ . '/autoload_classmap.php';
            if ($classMap) {
                $loader->addClassMap($classMap);
            }
        }

        $loader->register(true);

        return $loader;
    }
}
woocommerce-admin/vendor/composer/jetpack_autoload_classmap.php000064400000000563151335517650021221 0ustar00<?php

// This file `jetpack_autoload_classmap.php` was auto generated by automattic/jetpack-autoloader.

$vendorDir = dirname(__DIR__);
$baseDir   = dirname($vendorDir);

return array(
	'Automattic\\Jetpack\\Autoloader\\AutoloadGenerator' => array(
		'version' => '2.10.5.0',
		'path'    => $vendorDir . '/automattic/jetpack-autoloader/src/AutoloadGenerator.php'
	),
);
woocommerce-admin/vendor/composer/autoload_static.php000064400000003213151335517650017177 0ustar00<?php

// autoload_static.php @generated by Composer

namespace Composer\Autoload;

class ComposerStaticInitd8a0da99a02edbc19880f5a1a3c7fa56
{
    public static $prefixLengthsPsr4 = array (
        'C' => 
        array (
            'Composer\\Installers\\' => 20,
        ),
        'A' => 
        array (
            'Automattic\\WooCommerce\\Admin\\' => 29,
            'Automattic\\Jetpack\\Autoloader\\' => 30,
        ),
    );

    public static $prefixDirsPsr4 = array (
        'Composer\\Installers\\' => 
        array (
            0 => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers',
        ),
        'Automattic\\WooCommerce\\Admin\\' => 
        array (
            0 => __DIR__ . '/../..' . '/src',
        ),
        'Automattic\\Jetpack\\Autoloader\\' => 
        array (
            0 => __DIR__ . '/..' . '/automattic/jetpack-autoloader/src',
        ),
    );

    public static $classMap = array (
        'Automattic\\Jetpack\\Autoloader\\AutoloadGenerator' => __DIR__ . '/..' . '/automattic/jetpack-autoloader/src/AutoloadGenerator.php',
        'Composer\\InstalledVersions' => __DIR__ . '/..' . '/composer/InstalledVersions.php',
    );

    public static function getInitializer(ClassLoader $loader)
    {
        return \Closure::bind(function () use ($loader) {
            $loader->prefixLengthsPsr4 = ComposerStaticInitd8a0da99a02edbc19880f5a1a3c7fa56::$prefixLengthsPsr4;
            $loader->prefixDirsPsr4 = ComposerStaticInitd8a0da99a02edbc19880f5a1a3c7fa56::$prefixDirsPsr4;
            $loader->classMap = ComposerStaticInitd8a0da99a02edbc19880f5a1a3c7fa56::$classMap;

        }, null, ClassLoader::class);
    }
}
woocommerce-admin/vendor/composer/installed.php000064400000003430151335517650016000 0ustar00<?php return array(
    'root' => array(
        'pretty_version' => '2.8.0',
        'version' => '2.8.0.0',
        'type' => 'wordpress-plugin',
        'install_path' => __DIR__ . '/../../',
        'aliases' => array(),
        'reference' => NULL,
        'name' => 'woocommerce/woocommerce-admin',
        'dev' => false,
    ),
    'versions' => array(
        'automattic/jetpack-autoloader' => array(
            'pretty_version' => 'v2.10.5',
            'version' => '2.10.5.0',
            'type' => 'composer-plugin',
            'install_path' => __DIR__ . '/../automattic/jetpack-autoloader',
            'aliases' => array(),
            'reference' => 'ec66177eefa1126d5319f3135ff3a7185e21a0ba',
            'dev_requirement' => false,
        ),
        'composer/installers' => array(
            'pretty_version' => 'v1.12.0',
            'version' => '1.12.0.0',
            'type' => 'composer-plugin',
            'install_path' => __DIR__ . '/./installers',
            'aliases' => array(),
            'reference' => 'd20a64ed3c94748397ff5973488761b22f6d3f19',
            'dev_requirement' => false,
        ),
        'roundcube/plugin-installer' => array(
            'dev_requirement' => false,
            'replaced' => array(
                0 => '*',
            ),
        ),
        'shama/baton' => array(
            'dev_requirement' => false,
            'replaced' => array(
                0 => '*',
            ),
        ),
        'woocommerce/woocommerce-admin' => array(
            'pretty_version' => '2.8.0',
            'version' => '2.8.0.0',
            'type' => 'wordpress-plugin',
            'install_path' => __DIR__ . '/../../',
            'aliases' => array(),
            'reference' => NULL,
            'dev_requirement' => false,
        ),
    ),
);
woocommerce-admin/vendor/autoload_packages.php000064400000000475151335517650015646 0ustar00<?php
/**
 * This file was automatically generated by automattic/jetpack-autoloader.
 *
 * @package automattic/jetpack-autoloader
 */

namespace Automattic\Jetpack\Autoloader\jpd8a0da99a02edbc19880f5a1a3c7fa56;

 // phpcs:ignore

require_once __DIR__ . '/jetpack-autoloader/class-autoloader.php';
Autoloader::init();
woocommerce-admin/vendor/jetpack-autoloader/class-manifest-reader.php000064400000005175151335517650022131 0ustar00<?php
/**
 * This file was automatically generated by automattic/jetpack-autoloader.
 *
 * @package automattic/jetpack-autoloader
 */

namespace Automattic\Jetpack\Autoloader\jpd8a0da99a02edbc19880f5a1a3c7fa56;

 // phpcs:ignore

/**
 * This class reads autoloader manifest files.
 */
class Manifest_Reader {

	/**
	 * The Version_Selector object.
	 *
	 * @var Version_Selector
	 */
	private $version_selector;

	/**
	 * The constructor.
	 *
	 * @param Version_Selector $version_selector The Version_Selector object.
	 */
	public function __construct( $version_selector ) {
		$this->version_selector = $version_selector;
	}

	/**
	 * Reads all of the manifests in the given plugin paths.
	 *
	 * @param array  $plugin_paths  The paths to the plugins we're loading the manifest in.
	 * @param string $manifest_path The path that we're loading the manifest from in each plugin.
	 * @param array  $path_map The path map to add the contents of the manifests to.
	 *
	 * @return array $path_map The path map we've built using the manifests in each plugin.
	 */
	public function read_manifests( $plugin_paths, $manifest_path, &$path_map ) {
		$file_paths = array_map(
			function ( $path ) use ( $manifest_path ) {
				return trailingslashit( $path ) . $manifest_path;
			},
			$plugin_paths
		);

		foreach ( $file_paths as $path ) {
			$this->register_manifest( $path, $path_map );
		}

		return $path_map;
	}

	/**
	 * Registers a plugin's manifest file with the path map.
	 *
	 * @param string $manifest_path The absolute path to the manifest that we're loading.
	 * @param array  $path_map The path map to add the contents of the manifest to.
	 */
	protected function register_manifest( $manifest_path, &$path_map ) {
		if ( ! is_readable( $manifest_path ) ) {
			return;
		}

		$manifest = require $manifest_path;
		if ( ! is_array( $manifest ) ) {
			return;
		}

		foreach ( $manifest as $key => $data ) {
			$this->register_record( $key, $data, $path_map );
		}
	}

	/**
	 * Registers an entry from the manifest in the path map.
	 *
	 * @param string $key The identifier for the entry we're registering.
	 * @param array  $data The data for the entry we're registering.
	 * @param array  $path_map The path map to add the contents of the manifest to.
	 */
	protected function register_record( $key, $data, &$path_map ) {
		if ( isset( $path_map[ $key ]['version'] ) ) {
			$selected_version = $path_map[ $key ]['version'];
		} else {
			$selected_version = null;
		}

		if ( $this->version_selector->is_version_update_required( $selected_version, $data['version'] ) ) {
			$path_map[ $key ] = array(
				'version' => $data['version'],
				'path'    => $data['path'],
			);
		}
	}
}
woocommerce-admin/vendor/jetpack-autoloader/class-autoloader.php000064400000010075151335517650021215 0ustar00<?php
/**
 * This file was automatically generated by automattic/jetpack-autoloader.
 *
 * @package automattic/jetpack-autoloader
 */

namespace Automattic\Jetpack\Autoloader\jpd8a0da99a02edbc19880f5a1a3c7fa56;

 // phpcs:ignore

/**
 * This class handles management of the actual PHP autoloader.
 */
class Autoloader {

	/**
	 * Checks to see whether or not the autoloader should be initialized and then initializes it if so.
	 *
	 * @param Container|null $container The container we want to use for autoloader initialization. If none is given
	 *                                  then a container will be created automatically.
	 */
	public static function init( $container = null ) {
		// The container holds and manages the lifecycle of our dependencies
		// to make them easier to work with and increase flexibility.
		if ( ! isset( $container ) ) {
			require_once __DIR__ . '/class-container.php';
			$container = new Container();
		}

		// phpcs:disable Generic.Commenting.DocComment.MissingShort

		/** @var Autoloader_Handler $autoloader_handler */
		$autoloader_handler = $container->get( Autoloader_Handler::class );

		// If the autoloader is already initializing it means that it has included us as the latest.
		$was_included_by_autoloader = $autoloader_handler->is_initializing();

		/** @var Plugin_Locator $plugin_locator */
		$plugin_locator = $container->get( Plugin_Locator::class );

		/** @var Plugins_Handler $plugins_handler */
		$plugins_handler = $container->get( Plugins_Handler::class );

		// The current plugin is the one that we are attempting to initialize here.
		$current_plugin = $plugin_locator->find_current_plugin();

		// The active plugins are those that we were able to discover on the site. This list will not
		// include mu-plugins, those activated by code, or those who are hidden by filtering. We also
		// want to take care to not consider the current plugin unknown if it was included by an
		// autoloader. This avoids the case where a plugin will be marked "active" while deactivated
		// due to it having the latest autoloader.
		$active_plugins = $plugins_handler->get_active_plugins( true, ! $was_included_by_autoloader );

		// The cached plugins are all of those that were active or discovered by the autoloader during a previous request.
		// Note that it's possible this list will include plugins that have since been deactivated, but after a request
		// the cache should be updated and the deactivated plugins will be removed.
		$cached_plugins = $plugins_handler->get_cached_plugins();

		// We combine the active list and cached list to preemptively load classes for plugins that are
		// presently unknown but will be loaded during the request. While this may result in us considering packages in
		// deactivated plugins there shouldn't be any problems as a result and the eventual consistency is sufficient.
		$all_plugins = array_merge( $active_plugins, $cached_plugins );

		// In particular we also include the current plugin to address the case where it is the latest autoloader
		// but also unknown (and not cached). We don't want it in the active list because we don't know that it
		// is active but we need it in the all plugins list so that it is considered by the autoloader.
		$all_plugins[] = $current_plugin;

		// We require uniqueness in the array to avoid processing the same plugin more than once.
		$all_plugins = array_values( array_unique( $all_plugins ) );

		/** @var Latest_Autoloader_Guard $guard */
		$guard = $container->get( Latest_Autoloader_Guard::class );
		if ( $guard->should_stop_init( $current_plugin, $all_plugins, $was_included_by_autoloader ) ) {
			return;
		}

		// Initialize the autoloader using the handler now that we're ready.
		$autoloader_handler->activate_autoloader( $all_plugins );

		/** @var Hook_Manager $hook_manager */
		$hook_manager = $container->get( Hook_Manager::class );

		// Register a shutdown handler to clean up the autoloader.
		$hook_manager->add_action( 'shutdown', new Shutdown_Handler( $plugins_handler, $cached_plugins, $was_included_by_autoloader ) );

		// phpcs:enable Generic.Commenting.DocComment.MissingShort
	}
}
woocommerce-admin/vendor/jetpack-autoloader/class-php-autoloader.php000064400000005373151335517650022007 0ustar00<?php
/**
 * This file was automatically generated by automattic/jetpack-autoloader.
 *
 * @package automattic/jetpack-autoloader
 */

namespace Automattic\Jetpack\Autoloader\jpd8a0da99a02edbc19880f5a1a3c7fa56;

 // phpcs:ignore

/**
 * This class handles management of the actual PHP autoloader.
 */
class PHP_Autoloader {

	/**
	 * Registers the autoloader with PHP so that it can begin autoloading classes.
	 *
	 * @param Version_Loader $version_loader The class loader to use in the autoloader.
	 */
	public function register_autoloader( $version_loader ) {
		// Make sure no other autoloaders are registered.
		$this->unregister_autoloader();

		// Set the global so that it can be used to load classes.
		global $jetpack_autoloader_loader;
		$jetpack_autoloader_loader = $version_loader;

		// Ensure that the autoloader is first to avoid contention with others.
		spl_autoload_register( array( self::class, 'load_class' ), true, true );
	}

	/**
	 * Unregisters the active autoloader so that it will no longer autoload classes.
	 */
	public function unregister_autoloader() {
		// Remove any v2 autoloader that we've already registered.
		$autoload_chain = spl_autoload_functions();
		foreach ( $autoload_chain as $autoloader ) {
			// We can identify a v2 autoloader using the namespace.
			$namespace_check = null;

			// Functions are recorded as strings.
			if ( is_string( $autoloader ) ) {
				$namespace_check = $autoloader;
			} elseif ( is_array( $autoloader ) && is_string( $autoloader[0] ) ) {
				// Static method calls have the class as the first array element.
				$namespace_check = $autoloader[0];
			} else {
				// Since the autoloader has only ever been a function or a static method we don't currently need to check anything else.
				continue;
			}

			// Check for the namespace without the generated suffix.
			if ( 'Automattic\\Jetpack\\Autoloader\\jp' === substr( $namespace_check, 0, 32 ) ) {
				spl_autoload_unregister( $autoloader );
			}
		}

		// Clear the global now that the autoloader has been unregistered.
		global $jetpack_autoloader_loader;
		$jetpack_autoloader_loader = null;
	}

	/**
	 * Loads a class file if one could be found.
	 *
	 * Note: This function is static so that the autoloader can be easily unregistered. If
	 * it was a class method we would have to unwrap the object to check the namespace.
	 *
	 * @param string $class_name The name of the class to autoload.
	 *
	 * @return bool Indicates whether or not a class file was loaded.
	 */
	public static function load_class( $class_name ) {
		global $jetpack_autoloader_loader;
		if ( ! isset( $jetpack_autoloader_loader ) ) {
			return;
		}

		$file = $jetpack_autoloader_loader->find_class_file( $class_name );
		if ( ! isset( $file ) ) {
			return false;
		}

		require $file;
		return true;
	}
}
woocommerce-admin/vendor/jetpack-autoloader/class-hook-manager.php000064400000004145151335517650021427 0ustar00<?php
/**
 * This file was automatically generated by automattic/jetpack-autoloader.
 *
 * @package automattic/jetpack-autoloader
 */

namespace Automattic\Jetpack\Autoloader\jpd8a0da99a02edbc19880f5a1a3c7fa56;

 // phpcs:ignore

/**
 * Allows the latest autoloader to register hooks that can be removed when the autoloader is reset.
 */
class Hook_Manager {

	/**
	 * An array containing all of the hooks that we've registered.
	 *
	 * @var array
	 */
	private $registered_hooks;

	/**
	 * The constructor.
	 */
	public function __construct() {
		$this->registered_hooks = array();
	}

	/**
	 * Adds an action to WordPress and registers it internally.
	 *
	 * @param string   $tag           The name of the action which is hooked.
	 * @param callable $callable      The function to call.
	 * @param int      $priority      Used to specify the priority of the action.
	 * @param int      $accepted_args Used to specify the number of arguments the callable accepts.
	 */
	public function add_action( $tag, $callable, $priority = 10, $accepted_args = 1 ) {
		$this->registered_hooks[ $tag ][] = array(
			'priority' => $priority,
			'callable' => $callable,
		);

		add_action( $tag, $callable, $priority, $accepted_args );
	}

	/**
	 * Adds a filter to WordPress and registers it internally.
	 *
	 * @param string   $tag           The name of the filter which is hooked.
	 * @param callable $callable      The function to call.
	 * @param int      $priority      Used to specify the priority of the filter.
	 * @param int      $accepted_args Used to specify the number of arguments the callable accepts.
	 */
	public function add_filter( $tag, $callable, $priority = 10, $accepted_args = 1 ) {
		$this->registered_hooks[ $tag ][] = array(
			'priority' => $priority,
			'callable' => $callable,
		);

		add_filter( $tag, $callable, $priority, $accepted_args );
	}

	/**
	 * Removes all of the registered hooks.
	 */
	public function reset() {
		foreach ( $this->registered_hooks as $tag => $hooks ) {
			foreach ( $hooks as $hook ) {
				remove_filter( $tag, $hook['callable'], $hook['priority'] );
			}
		}
		$this->registered_hooks = array();
	}
}
woocommerce-admin/vendor/jetpack-autoloader/class-container.php000064400000011461151335517650021040 0ustar00<?php
/**
 * This file was automatically generated by automattic/jetpack-autoloader.
 *
 * @package automattic/jetpack-autoloader
 */

namespace Automattic\Jetpack\Autoloader\jpd8a0da99a02edbc19880f5a1a3c7fa56;

 // phpcs:ignore

/**
 * This class manages the files and dependencies of the autoloader.
 */
class Container {

	/**
	 * Since each autoloader's class files exist within their own namespace we need a map to
	 * convert between the local class and a shared key. Note that no version checking is
	 * performed on these dependencies and the first autoloader to register will be the
	 * one that is utilized.
	 */
	const SHARED_DEPENDENCY_KEYS = array(
		Hook_Manager::class => 'Hook_Manager',
	);

	/**
	 * A map of all the dependencies we've registered with the container and created.
	 *
	 * @var array
	 */
	protected $dependencies;

	/**
	 * The constructor.
	 */
	public function __construct() {
		$this->dependencies = array();

		$this->register_shared_dependencies();
		$this->register_dependencies();
		$this->initialize_globals();
	}

	/**
	 * Gets a dependency out of the container.
	 *
	 * @param string $class The class to fetch.
	 *
	 * @return mixed
	 * @throws \InvalidArgumentException When a class that isn't registered with the container is fetched.
	 */
	public function get( $class ) {
		if ( ! isset( $this->dependencies[ $class ] ) ) {
			throw new \InvalidArgumentException( "Class '$class' is not registered with the container." );
		}

		return $this->dependencies[ $class ];
	}

	/**
	 * Registers all of the dependencies that are shared between all instances of the autoloader.
	 */
	private function register_shared_dependencies() {
		global $jetpack_autoloader_container_shared;
		if ( ! isset( $jetpack_autoloader_container_shared ) ) {
			$jetpack_autoloader_container_shared = array();
		}

		$key = self::SHARED_DEPENDENCY_KEYS[ Hook_Manager::class ];
		if ( ! isset( $jetpack_autoloader_container_shared[ $key ] ) ) {
			require_once __DIR__ . '/class-hook-manager.php';
			$jetpack_autoloader_container_shared[ $key ] = new Hook_Manager();
		}
		$this->dependencies[ Hook_Manager::class ] = &$jetpack_autoloader_container_shared[ $key ];
	}

	/**
	 * Registers all of the dependencies with the container.
	 */
	private function register_dependencies() {
		require_once __DIR__ . '/class-path-processor.php';
		$this->dependencies[ Path_Processor::class ] = new Path_Processor();

		require_once __DIR__ . '/class-plugin-locator.php';
		$this->dependencies[ Plugin_Locator::class ] = new Plugin_Locator(
			$this->get( Path_Processor::class )
		);

		require_once __DIR__ . '/class-version-selector.php';
		$this->dependencies[ Version_Selector::class ] = new Version_Selector();

		require_once __DIR__ . '/class-autoloader-locator.php';
		$this->dependencies[ Autoloader_Locator::class ] = new Autoloader_Locator(
			$this->get( Version_Selector::class )
		);

		require_once __DIR__ . '/class-php-autoloader.php';
		$this->dependencies[ PHP_Autoloader::class ] = new PHP_Autoloader();

		require_once __DIR__ . '/class-manifest-reader.php';
		$this->dependencies[ Manifest_Reader::class ] = new Manifest_Reader(
			$this->get( Version_Selector::class )
		);

		require_once __DIR__ . '/class-plugins-handler.php';
		$this->dependencies[ Plugins_Handler::class ] = new Plugins_Handler(
			$this->get( Plugin_Locator::class ),
			$this->get( Path_Processor::class )
		);

		require_once __DIR__ . '/class-autoloader-handler.php';
		$this->dependencies[ Autoloader_Handler::class ] = new Autoloader_Handler(
			$this->get( PHP_Autoloader::class ),
			$this->get( Hook_Manager::class ),
			$this->get( Manifest_Reader::class ),
			$this->get( Version_Selector::class )
		);

		require_once __DIR__ . '/class-latest-autoloader-guard.php';
		$this->dependencies[ Latest_Autoloader_Guard::class ] = new Latest_Autoloader_Guard(
			$this->get( Plugins_Handler::class ),
			$this->get( Autoloader_Handler::class ),
			$this->get( Autoloader_Locator::class )
		);

		// Register any classes that we will use elsewhere.
		require_once __DIR__ . '/class-version-loader.php';
		require_once __DIR__ . '/class-shutdown-handler.php';
	}

	/**
	 * Initializes any of the globals needed by the autoloader.
	 */
	private function initialize_globals() {
		/*
		 * This global was retired in version 2.9. The value is set to 'false' to maintain
		 * compatibility with older versions of the autoloader.
		 */
		global $jetpack_autoloader_including_latest;
		$jetpack_autoloader_including_latest = false;

		// Not all plugins can be found using the locator. In cases where a plugin loads the autoloader
		// but was not discoverable, we will record them in this array to track them as "active".
		global $jetpack_autoloader_activating_plugins_paths;
		if ( ! isset( $jetpack_autoloader_activating_plugins_paths ) ) {
			$jetpack_autoloader_activating_plugins_paths = array();
		}
	}
}
woocommerce-admin/vendor/jetpack-autoloader/class-latest-autoloader-guard.php000064400000005364151335517650023614 0ustar00<?php
/**
 * This file was automatically generated by automattic/jetpack-autoloader.
 *
 * @package automattic/jetpack-autoloader
 */

namespace Automattic\Jetpack\Autoloader\jpd8a0da99a02edbc19880f5a1a3c7fa56;

 // phpcs:ignore

/**
 * This class ensures that we're only executing the latest autoloader.
 */
class Latest_Autoloader_Guard {

	/**
	 * The Plugins_Handler instance.
	 *
	 * @var Plugins_Handler
	 */
	private $plugins_handler;

	/**
	 * The Autoloader_Handler instance.
	 *
	 * @var Autoloader_Handler
	 */
	private $autoloader_handler;

	/**
	 * The Autoloader_locator instance.
	 *
	 * @var Autoloader_Locator
	 */
	private $autoloader_locator;

	/**
	 * The constructor.
	 *
	 * @param Plugins_Handler    $plugins_handler    The Plugins_Handler instance.
	 * @param Autoloader_Handler $autoloader_handler The Autoloader_Handler instance.
	 * @param Autoloader_Locator $autoloader_locator The Autoloader_Locator instance.
	 */
	public function __construct( $plugins_handler, $autoloader_handler, $autoloader_locator ) {
		$this->plugins_handler    = $plugins_handler;
		$this->autoloader_handler = $autoloader_handler;
		$this->autoloader_locator = $autoloader_locator;
	}

	/**
	 * Indicates whether or not the autoloader should be initialized. Note that this function
	 * has the side-effect of actually loading the latest autoloader in the event that this
	 * is not it.
	 *
	 * @param string   $current_plugin             The current plugin we're checking.
	 * @param string[] $plugins                    The active plugins to check for autoloaders in.
	 * @param bool     $was_included_by_autoloader Indicates whether or not this autoloader was included by another.
	 *
	 * @return bool True if we should stop initialization, otherwise false.
	 */
	public function should_stop_init( $current_plugin, $plugins, $was_included_by_autoloader ) {
		global $jetpack_autoloader_latest_version;

		// We need to reset the autoloader when the plugins change because
		// that means the autoloader was generated with a different list.
		if ( $this->plugins_handler->have_plugins_changed( $plugins ) ) {
			$this->autoloader_handler->reset_autoloader();
		}

		// When the latest autoloader has already been found we don't need to search for it again.
		// We should take care however because this will also trigger if the autoloader has been
		// included by an older one.
		if ( isset( $jetpack_autoloader_latest_version ) && ! $was_included_by_autoloader ) {
			return true;
		}

		$latest_plugin = $this->autoloader_locator->find_latest_autoloader( $plugins, $jetpack_autoloader_latest_version );
		if ( isset( $latest_plugin ) && $latest_plugin !== $current_plugin ) {
			require $this->autoloader_locator->get_autoloader_path( $latest_plugin );
			return true;
		}

		return false;
	}
}
woocommerce-admin/vendor/jetpack-autoloader/class-plugins-handler.php000064400000013373151335517650022156 0ustar00<?php
/**
 * This file was automatically generated by automattic/jetpack-autoloader.
 *
 * @package automattic/jetpack-autoloader
 */

namespace Automattic\Jetpack\Autoloader\jpd8a0da99a02edbc19880f5a1a3c7fa56;

 // phpcs:ignore

/**
 * This class handles locating and caching all of the active plugins.
 */
class Plugins_Handler {
	/**
	 * The transient key for plugin paths.
	 */
	const TRANSIENT_KEY = 'jetpack_autoloader_plugin_paths';

	/**
	 * The locator for finding plugins in different locations.
	 *
	 * @var Plugin_Locator
	 */
	private $plugin_locator;

	/**
	 * The processor for transforming cached paths.
	 *
	 * @var Path_Processor
	 */
	private $path_processor;

	/**
	 * The constructor.
	 *
	 * @param Plugin_Locator $plugin_locator The locator for finding active plugins.
	 * @param Path_Processor $path_processor The processor for transforming cached paths.
	 */
	public function __construct( $plugin_locator, $path_processor ) {
		$this->plugin_locator = $plugin_locator;
		$this->path_processor = $path_processor;
	}

	/**
	 * Gets all of the active plugins we can find.
	 *
	 * @param bool $include_deactivating When true, plugins deactivating this request will be considered active.
	 * @param bool $record_unknown When true, the current plugin will be marked as active and recorded when unknown.
	 *
	 * @return string[]
	 */
	public function get_active_plugins( $include_deactivating, $record_unknown ) {
		global $jetpack_autoloader_activating_plugins_paths;

		// We're going to build a unique list of plugins from a few different sources
		// to find all of our "active" plugins. While we need to return an integer
		// array, we're going to use an associative array internally to reduce
		// the amount of time that we're going to spend checking uniqueness
		// and merging different arrays together to form the output.
		$active_plugins = array();

		// Make sure that plugins which have activated this request are considered as "active" even though
		// they probably won't be present in any option.
		if ( is_array( $jetpack_autoloader_activating_plugins_paths ) ) {
			foreach ( $jetpack_autoloader_activating_plugins_paths as $path ) {
				$active_plugins[ $path ] = $path;
			}
		}

		// This option contains all of the plugins that have been activated.
		$plugins = $this->plugin_locator->find_using_option( 'active_plugins' );
		foreach ( $plugins as $path ) {
			$active_plugins[ $path ] = $path;
		}

		// This option contains all of the multisite plugins that have been activated.
		if ( is_multisite() ) {
			$plugins = $this->plugin_locator->find_using_option( 'active_sitewide_plugins', true );
			foreach ( $plugins as $path ) {
				$active_plugins[ $path ] = $path;
			}
		}

		// These actions contain plugins that are being activated/deactivated during this request.
		$plugins = $this->plugin_locator->find_using_request_action( array( 'activate', 'activate-selected', 'deactivate', 'deactivate-selected' ) );
		foreach ( $plugins as $path ) {
			$active_plugins[ $path ] = $path;
		}

		// When the current plugin isn't considered "active" there's a problem.
		// Since we're here, the plugin is active and currently being loaded.
		// We can support this case (mu-plugins and non-standard activation)
		// by adding the current plugin to the active list and marking it
		// as an unknown (activating) plugin. This also has the benefit
		// of causing a reset because the active plugins list has
		// been changed since it was saved in the global.
		$current_plugin = $this->plugin_locator->find_current_plugin();
		if ( $record_unknown && ! in_array( $current_plugin, $active_plugins, true ) ) {
			$active_plugins[ $current_plugin ]             = $current_plugin;
			$jetpack_autoloader_activating_plugins_paths[] = $current_plugin;
		}

		// When deactivating plugins aren't desired we should entirely remove them from the active list.
		if ( ! $include_deactivating ) {
			// These actions contain plugins that are being deactivated during this request.
			$plugins = $this->plugin_locator->find_using_request_action( array( 'deactivate', 'deactivate-selected' ) );
			foreach ( $plugins as $path ) {
				unset( $active_plugins[ $path ] );
			}
		}

		// Transform the array so that we don't have to worry about the keys interacting with other array types later.
		return array_values( $active_plugins );
	}

	/**
	 * Gets all of the cached plugins if there are any.
	 *
	 * @return string[]
	 */
	public function get_cached_plugins() {
		$cached = get_transient( self::TRANSIENT_KEY );
		if ( ! is_array( $cached ) || empty( $cached ) ) {
			return array();
		}

		// We need to expand the tokens to an absolute path for this webserver.
		return array_map( array( $this->path_processor, 'untokenize_path_constants' ), $cached );
	}

	/**
	 * Saves the plugin list to the cache.
	 *
	 * @param array $plugins The plugin list to save to the cache.
	 */
	public function cache_plugins( $plugins ) {
		// We store the paths in a tokenized form so that that webservers with different absolute paths don't break.
		$plugins = array_map( array( $this->path_processor, 'tokenize_path_constants' ), $plugins );

		set_transient( self::TRANSIENT_KEY, $plugins );
	}

	/**
	 * Checks to see whether or not the plugin list given has changed when compared to the
	 * shared `$jetpack_autoloader_cached_plugin_paths` global. This allows us to deal
	 * with cases where the active list may change due to filtering..
	 *
	 * @param string[] $plugins The plugins list to check against the global cache.
	 *
	 * @return bool True if the plugins have changed, otherwise false.
	 */
	public function have_plugins_changed( $plugins ) {
		global $jetpack_autoloader_cached_plugin_paths;

		if ( $jetpack_autoloader_cached_plugin_paths !== $plugins ) {
			$jetpack_autoloader_cached_plugin_paths = $plugins;
			return true;
		}

		return false;
	}
}
woocommerce-admin/vendor/jetpack-autoloader/class-plugin-locator.php000064400000010476151335517650022022 0ustar00<?php
/**
 * This file was automatically generated by automattic/jetpack-autoloader.
 *
 * @package automattic/jetpack-autoloader
 */

namespace Automattic\Jetpack\Autoloader\jpd8a0da99a02edbc19880f5a1a3c7fa56;

 // phpcs:ignore

/**
 * This class scans the WordPress installation to find active plugins.
 */
class Plugin_Locator {

	/**
	 * The path processor for finding plugin paths.
	 *
	 * @var Path_Processor
	 */
	private $path_processor;

	/**
	 * The constructor.
	 *
	 * @param Path_Processor $path_processor The Path_Processor instance.
	 */
	public function __construct( $path_processor ) {
		$this->path_processor = $path_processor;
	}

	/**
	 * Finds the path to the current plugin.
	 *
	 * @return string $path The path to the current plugin.
	 *
	 * @throws \RuntimeException If the current plugin does not have an autoloader.
	 */
	public function find_current_plugin() {
		// Escape from `vendor/__DIR__` to root plugin directory.
		$plugin_directory = dirname( dirname( __DIR__ ) );

		// Use the path processor to ensure that this is an autoloader we're referencing.
		$path = $this->path_processor->find_directory_with_autoloader( $plugin_directory, array() );
		if ( false === $path ) {
			throw new \RuntimeException( 'Failed to locate plugin ' . $plugin_directory );
		}

		return $path;
	}

	/**
	 * Checks a given option for plugin paths.
	 *
	 * @param string $option_name  The option that we want to check for plugin information.
	 * @param bool   $site_option  Indicates whether or not we want to check the site option.
	 *
	 * @return array $plugin_paths The list of absolute paths we've found.
	 */
	public function find_using_option( $option_name, $site_option = false ) {
		$raw = $site_option ? get_site_option( $option_name ) : get_option( $option_name );
		if ( false === $raw ) {
			return array();
		}

		return $this->convert_plugins_to_paths( $raw );
	}

	/**
	 * Checks for plugins in the `action` request parameter.
	 *
	 * @param string[] $allowed_actions The actions that we're allowed to return plugins for.
	 *
	 * @return array $plugin_paths The list of absolute paths we've found.
	 */
	public function find_using_request_action( $allowed_actions ) {
		// phpcs:disable WordPress.Security.NonceVerification.Recommended

		/**
		 * Note: we're not actually checking the nonce here because it's too early
		 * in the execution. The pluggable functions are not yet loaded to give
		 * plugins a chance to plug their versions. Therefore we're doing the bare
		 * minimum: checking whether the nonce exists and it's in the right place.
		 * The request will fail later if the nonce doesn't pass the check.
		 */
		if ( empty( $_REQUEST['_wpnonce'] ) ) {
			return array();
		}

		$action = isset( $_REQUEST['action'] ) ? wp_unslash( $_REQUEST['action'] ) : false;
		if ( ! in_array( $action, $allowed_actions, true ) ) {
			return array();
		}

		$plugin_slugs = array();
		switch ( $action ) {
			case 'activate':
			case 'deactivate':
				if ( empty( $_REQUEST['plugin'] ) ) {
					break;
				}

				$plugin_slugs[] = wp_unslash( $_REQUEST['plugin'] );
				break;

			case 'activate-selected':
			case 'deactivate-selected':
				if ( empty( $_REQUEST['checked'] ) ) {
					break;
				}

				$plugin_slugs = wp_unslash( $_REQUEST['checked'] );
				break;
		}

		// phpcs:enable WordPress.Security.NonceVerification.Recommended
		return $this->convert_plugins_to_paths( $plugin_slugs );
	}

	/**
	 * Given an array of plugin slugs or paths, this will convert them to absolute paths and filter
	 * out the plugins that are not directory plugins. Note that array keys will also be included
	 * if they are plugin paths!
	 *
	 * @param string[] $plugins Plugin paths or slugs to filter.
	 *
	 * @return string[]
	 */
	private function convert_plugins_to_paths( $plugins ) {
		if ( ! is_array( $plugins ) || empty( $plugins ) ) {
			return array();
		}

		// We're going to look for plugins in the standard directories.
		$path_constants = array( WP_PLUGIN_DIR, WPMU_PLUGIN_DIR );

		$plugin_paths = array();
		foreach ( $plugins as $key => $value ) {
			$path = $this->path_processor->find_directory_with_autoloader( $key, $path_constants );
			if ( $path ) {
				$plugin_paths[] = $path;
			}

			$path = $this->path_processor->find_directory_with_autoloader( $value, $path_constants );
			if ( $path ) {
				$plugin_paths[] = $path;
			}
		}

		return $plugin_paths;
	}
}
woocommerce-admin/vendor/jetpack-autoloader/class-autoloader-locator.php000064400000004120151335517650022650 0ustar00<?php
/**
 * This file was automatically generated by automattic/jetpack-autoloader.
 *
 * @package automattic/jetpack-autoloader
 */

namespace Automattic\Jetpack\Autoloader\jpd8a0da99a02edbc19880f5a1a3c7fa56;

 // phpcs:ignore

use Automattic\Jetpack\Autoloader\AutoloadGenerator;

/**
 * This class locates autoloaders.
 */
class Autoloader_Locator {

	/**
	 * The object for comparing autoloader versions.
	 *
	 * @var Version_Selector
	 */
	private $version_selector;

	/**
	 * The constructor.
	 *
	 * @param Version_Selector $version_selector The version selector object.
	 */
	public function __construct( $version_selector ) {
		$this->version_selector = $version_selector;
	}

	/**
	 * Finds the path to the plugin with the latest autoloader.
	 *
	 * @param array  $plugin_paths An array of plugin paths.
	 * @param string $latest_version The latest version reference.
	 *
	 * @return string|null
	 */
	public function find_latest_autoloader( $plugin_paths, &$latest_version ) {
		$latest_plugin = null;

		foreach ( $plugin_paths as $plugin_path ) {
			$version = $this->get_autoloader_version( $plugin_path );
			if ( ! $this->version_selector->is_version_update_required( $latest_version, $version ) ) {
				continue;
			}

			$latest_version = $version;
			$latest_plugin  = $plugin_path;
		}

		return $latest_plugin;
	}

	/**
	 * Gets the path to the autoloader.
	 *
	 * @param string $plugin_path The path to the plugin.
	 *
	 * @return string
	 */
	public function get_autoloader_path( $plugin_path ) {
		return trailingslashit( $plugin_path ) . 'vendor/autoload_packages.php';
	}

	/**
	 * Gets the version for the autoloader.
	 *
	 * @param string $plugin_path The path to the plugin.
	 *
	 * @return string|null
	 */
	public function get_autoloader_version( $plugin_path ) {
		$classmap = trailingslashit( $plugin_path ) . 'vendor/composer/jetpack_autoload_classmap.php';
		if ( ! file_exists( $classmap ) ) {
			return null;
		}

		$classmap = require $classmap;
		if ( isset( $classmap[ AutoloadGenerator::class ] ) ) {
			return $classmap[ AutoloadGenerator::class ]['version'];
		}

		return null;
	}
}
woocommerce-admin/vendor/jetpack-autoloader/class-version-selector.php000064400000003467151335517650022370 0ustar00<?php
/**
 * This file was automatically generated by automattic/jetpack-autoloader.
 *
 * @package automattic/jetpack-autoloader
 */

namespace Automattic\Jetpack\Autoloader\jpd8a0da99a02edbc19880f5a1a3c7fa56;

 // phpcs:ignore

/**
 * Used to select package versions.
 */
class Version_Selector {

	/**
	 * Checks whether the selected package version should be updated. Composer development
	 * package versions ('9999999-dev' or versions that start with 'dev-') are favored
	 * when the JETPACK_AUTOLOAD_DEV constant is set to true.
	 *
	 * @param String $selected_version The currently selected package version.
	 * @param String $compare_version The package version that is being evaluated to
	 *                                determine if the version needs to be updated.
	 *
	 * @return bool Returns true if the selected package version should be updated,
	 *                 else false.
	 */
	public function is_version_update_required( $selected_version, $compare_version ) {
		$use_dev_versions = defined( 'JETPACK_AUTOLOAD_DEV' ) && JETPACK_AUTOLOAD_DEV;

		if ( is_null( $selected_version ) ) {
			return true;
		}

		if ( $use_dev_versions && $this->is_dev_version( $selected_version ) ) {
			return false;
		}

		if ( $this->is_dev_version( $compare_version ) ) {
			if ( $use_dev_versions ) {
				return true;
			} else {
				return false;
			}
		}

		if ( version_compare( $selected_version, $compare_version, '<' ) ) {
			return true;
		}

		return false;
	}

	/**
	 * Checks whether the given package version is a development version.
	 *
	 * @param String $version The package version.
	 *
	 * @return bool True if the version is a dev version, else false.
	 */
	public function is_dev_version( $version ) {
		if ( 'dev-' === substr( $version, 0, 4 ) || '9999999-dev' === $version ) {
			return true;
		}

		return false;
	}
}
woocommerce-admin/vendor/jetpack-autoloader/class-path-processor.php000064400000013061151335517650022025 0ustar00<?php
/**
 * This file was automatically generated by automattic/jetpack-autoloader.
 *
 * @package automattic/jetpack-autoloader
 */

namespace Automattic\Jetpack\Autoloader\jpd8a0da99a02edbc19880f5a1a3c7fa56;

 // phpcs:ignore

/**
 * This class handles dealing with paths for the autoloader.
 */
class Path_Processor {
	/**
	 * Given a path this will replace any of the path constants with a token to represent it.
	 *
	 * @param string $path The path we want to process.
	 *
	 * @return string The tokenized path.
	 */
	public function tokenize_path_constants( $path ) {
		$path = wp_normalize_path( $path );

		$constants = $this->get_normalized_constants();
		foreach ( $constants as $constant => $constant_path ) {
			$len = strlen( $constant_path );
			if ( substr( $path, 0, $len ) !== $constant_path ) {
				continue;
			}

			return substr_replace( $path, '{{' . $constant . '}}', 0, $len );
		}

		return $path;
	}

	/**
	 * Given a path this will replace any of the path constant tokens with the expanded path.
	 *
	 * @param string $tokenized_path The path we want to process.
	 *
	 * @return string The expanded path.
	 */
	public function untokenize_path_constants( $tokenized_path ) {
		$tokenized_path = wp_normalize_path( $tokenized_path );

		$constants = $this->get_normalized_constants();
		foreach ( $constants as $constant => $constant_path ) {
			$constant = '{{' . $constant . '}}';

			$len = strlen( $constant );
			if ( substr( $tokenized_path, 0, $len ) !== $constant ) {
				continue;
			}

			return $this->get_real_path( substr_replace( $tokenized_path, $constant_path, 0, $len ) );
		}

		return $tokenized_path;
	}

	/**
	 * Given a file and an array of places it might be, this will find the absolute path and return it.
	 *
	 * @param string $file The plugin or theme file to resolve.
	 * @param array  $directories_to_check The directories we should check for the file if it isn't an absolute path.
	 *
	 * @return string|false Returns the absolute path to the directory, otherwise false.
	 */
	public function find_directory_with_autoloader( $file, $directories_to_check ) {
		$file = wp_normalize_path( $file );

		if ( ! $this->is_absolute_path( $file ) ) {
			$file = $this->find_absolute_plugin_path( $file, $directories_to_check );
			if ( ! isset( $file ) ) {
				return false;
			}
		}

		// We need the real path for consistency with __DIR__ paths.
		$file = $this->get_real_path( $file );

		// phpcs:disable WordPress.PHP.NoSilencedErrors.Discouraged
		$directory = @is_file( $file ) ? dirname( $file ) : $file;
		if ( ! @is_file( $directory . '/vendor/composer/jetpack_autoload_classmap.php' ) ) {
			return false;
		}
		// phpcs:enable WordPress.PHP.NoSilencedErrors.Discouraged

		return $directory;
	}

	/**
	 * Fetches an array of normalized paths keyed by the constant they came from.
	 *
	 * @return string[] The normalized paths keyed by the constant.
	 */
	private function get_normalized_constants() {
		$raw_constants = array(
			// Order the constants from most-specific to least-specific.
			'WP_PLUGIN_DIR',
			'WPMU_PLUGIN_DIR',
			'WP_CONTENT_DIR',
			'ABSPATH',
		);

		$constants = array();
		foreach ( $raw_constants as $raw ) {
			if ( ! defined( $raw ) ) {
				continue;
			}

			$path = wp_normalize_path( constant( $raw ) );
			if ( isset( $path ) ) {
				$constants[ $raw ] = $path;
			}
		}

		return $constants;
	}

	/**
	 * Indicates whether or not a path is absolute.
	 *
	 * @param string $path The path to check.
	 *
	 * @return bool True if the path is absolute, otherwise false.
	 */
	private function is_absolute_path( $path ) {
		if ( 0 === strlen( $path ) || '.' === $path[0] ) {
			return false;
		}

		// Absolute paths on Windows may begin with a drive letter.
		if ( preg_match( '/^[a-zA-Z]:[\/\\\\]/', $path ) ) {
			return true;
		}

		// A path starting with / or \ is absolute; anything else is relative.
		return ( '/' === $path[0] || '\\' === $path[0] );
	}

	/**
	 * Given a file and a list of directories to check, this method will try to figure out
	 * the absolute path to the file in question.
	 *
	 * @param string $normalized_path The normalized path to the plugin or theme file to resolve.
	 * @param array  $directories_to_check The directories we should check for the file if it isn't an absolute path.
	 *
	 * @return string|null The absolute path to the plugin file, otherwise null.
	 */
	private function find_absolute_plugin_path( $normalized_path, $directories_to_check ) {
		// We're only able to find the absolute path for plugin/theme PHP files.
		if ( ! is_string( $normalized_path ) || '.php' !== substr( $normalized_path, -4 ) ) {
			return null;
		}

		foreach ( $directories_to_check as $directory ) {
			$normalized_check = wp_normalize_path( trailingslashit( $directory ) ) . $normalized_path;
			// phpcs:ignore WordPress.PHP.NoSilencedErrors.Discouraged
			if ( @is_file( $normalized_check ) ) {
				return $normalized_check;
			}
		}

		return null;
	}

	/**
	 * Given a path this will figure out the real path that we should be using.
	 *
	 * @param string $path The path to resolve.
	 *
	 * @return string The resolved path.
	 */
	private function get_real_path( $path ) {
		// We want to resolve symbolic links for consistency with __DIR__ paths.
		// phpcs:ignore WordPress.PHP.NoSilencedErrors.Discouraged
		$real_path = @realpath( $path );
		if ( false === $real_path ) {
			// Let the autoloader deal with paths that don't exist.
			$real_path = $path;
		}

		// Using realpath will make it platform-specific so we must normalize it after.
		if ( $path !== $real_path ) {
			$real_path = wp_normalize_path( $real_path );
		}

		return $real_path;
	}
}
woocommerce-admin/vendor/jetpack-autoloader/class-shutdown-handler.php000064400000005505151335517650022346 0ustar00<?php
/**
 * This file was automatically generated by automattic/jetpack-autoloader.
 *
 * @package automattic/jetpack-autoloader
 */

namespace Automattic\Jetpack\Autoloader\jpd8a0da99a02edbc19880f5a1a3c7fa56;

 // phpcs:ignore

/**
 * This class handles the shutdown of the autoloader.
 */
class Shutdown_Handler {

	/**
	 * The Plugins_Handler instance.
	 *
	 * @var Plugins_Handler
	 */
	private $plugins_handler;

	/**
	 * The plugins cached by this autoloader.
	 *
	 * @var string[]
	 */
	private $cached_plugins;

	/**
	 * Indicates whether or not this autoloader was included by another.
	 *
	 * @var bool
	 */
	private $was_included_by_autoloader;

	/**
	 * Constructor.
	 *
	 * @param Plugins_Handler $plugins_handler The Plugins_Handler instance to use.
	 * @param string[]        $cached_plugins The plugins cached by the autoloaer.
	 * @param bool            $was_included_by_autoloader Indicates whether or not the autoloader was included by another.
	 */
	public function __construct( $plugins_handler, $cached_plugins, $was_included_by_autoloader ) {
		$this->plugins_handler            = $plugins_handler;
		$this->cached_plugins             = $cached_plugins;
		$this->was_included_by_autoloader = $was_included_by_autoloader;
	}

	/**
	 * Handles the shutdown of the autoloader.
	 */
	public function __invoke() {
		// Don't save a broken cache if an error happens during some plugin's initialization.
		if ( ! did_action( 'plugins_loaded' ) ) {
			// Ensure that the cache is emptied to prevent consecutive failures if the cache is to blame.
			if ( ! empty( $this->cached_plugins ) ) {
				$this->plugins_handler->cache_plugins( array() );
			}

			return;
		}

		// Load the active plugins fresh since the list we pulled earlier might not contain
		// plugins that were activated but did not reset the autoloader. This happens
		// when a plugin is in the cache but not "active" when the autoloader loads.
		// We also want to make sure that plugins which are deactivating are not
		// considered "active" so that they will be removed from the cache now.
		try {
			$active_plugins = $this->plugins_handler->get_active_plugins( false, ! $this->was_included_by_autoloader );
		} catch ( \Exception $ex ) {
			// When the package is deleted before shutdown it will throw an exception.
			// In the event this happens we should erase the cache.
			if ( ! empty( $this->cached_plugins ) ) {
				$this->plugins_handler->cache_plugins( array() );
			}
			return;
		}

		// The paths should be sorted for easy comparisons with those loaded from the cache.
		// Note we don't need to sort the cached entries because they're already sorted.
		sort( $active_plugins );

		// We don't want to waste time saving a cache that hasn't changed.
		if ( $this->cached_plugins === $active_plugins ) {
			return;
		}

		$this->plugins_handler->cache_plugins( $active_plugins );
	}
}
woocommerce-admin/vendor/jetpack-autoloader/class-autoloader-handler.php000064400000010767151335517650022640 0ustar00<?php
/**
 * This file was automatically generated by automattic/jetpack-autoloader.
 *
 * @package automattic/jetpack-autoloader
 */

namespace Automattic\Jetpack\Autoloader\jpd8a0da99a02edbc19880f5a1a3c7fa56;

 // phpcs:ignore

use Automattic\Jetpack\Autoloader\AutoloadGenerator;

/**
 * This class selects the package version for the autoloader.
 */
class Autoloader_Handler {

	/**
	 * The PHP_Autoloader instance.
	 *
	 * @var PHP_Autoloader
	 */
	private $php_autoloader;

	/**
	 * The Hook_Manager instance.
	 *
	 * @var Hook_Manager
	 */
	private $hook_manager;

	/**
	 * The Manifest_Reader instance.
	 *
	 * @var Manifest_Reader
	 */
	private $manifest_reader;

	/**
	 * The Version_Selector instance.
	 *
	 * @var Version_Selector
	 */
	private $version_selector;

	/**
	 * The constructor.
	 *
	 * @param PHP_Autoloader   $php_autoloader The PHP_Autoloader instance.
	 * @param Hook_Manager     $hook_manager The Hook_Manager instance.
	 * @param Manifest_Reader  $manifest_reader The Manifest_Reader instance.
	 * @param Version_Selector $version_selector The Version_Selector instance.
	 */
	public function __construct( $php_autoloader, $hook_manager, $manifest_reader, $version_selector ) {
		$this->php_autoloader   = $php_autoloader;
		$this->hook_manager     = $hook_manager;
		$this->manifest_reader  = $manifest_reader;
		$this->version_selector = $version_selector;
	}

	/**
	 * Checks to see whether or not an autoloader is currently in the process of initializing.
	 *
	 * @return bool
	 */
	public function is_initializing() {
		// If no version has been set it means that no autoloader has started initializing yet.
		global $jetpack_autoloader_latest_version;
		if ( ! isset( $jetpack_autoloader_latest_version ) ) {
			return false;
		}

		// When the version is set but the classmap is not it ALWAYS means that this is the
		// latest autoloader and is being included by an older one.
		global $jetpack_packages_classmap;
		if ( empty( $jetpack_packages_classmap ) ) {
			return true;
		}

		// Version 2.4.0 added a new global and altered the reset semantics. We need to check
		// the other global as well since it may also point at initialization.
		// Note: We don't need to check for the class first because every autoloader that
		// will set the latest version global requires this class in the classmap.
		$replacing_version = $jetpack_packages_classmap[ AutoloadGenerator::class ]['version'];
		if ( $this->version_selector->is_dev_version( $replacing_version ) || version_compare( $replacing_version, '2.4.0.0', '>=' ) ) {
			global $jetpack_autoloader_loader;
			if ( ! isset( $jetpack_autoloader_loader ) ) {
				return true;
			}
		}

		return false;
	}

	/**
	 * Activates an autoloader using the given plugins and activates it.
	 *
	 * @param string[] $plugins The plugins to initialize the autoloader for.
	 */
	public function activate_autoloader( $plugins ) {
		global $jetpack_packages_psr4;
		$jetpack_packages_psr4 = array();
		$this->manifest_reader->read_manifests( $plugins, 'vendor/composer/jetpack_autoload_psr4.php', $jetpack_packages_psr4 );

		global $jetpack_packages_classmap;
		$jetpack_packages_classmap = array();
		$this->manifest_reader->read_manifests( $plugins, 'vendor/composer/jetpack_autoload_classmap.php', $jetpack_packages_classmap );

		global $jetpack_packages_filemap;
		$jetpack_packages_filemap = array();
		$this->manifest_reader->read_manifests( $plugins, 'vendor/composer/jetpack_autoload_filemap.php', $jetpack_packages_filemap );

		$loader = new Version_Loader(
			$this->version_selector,
			$jetpack_packages_classmap,
			$jetpack_packages_psr4,
			$jetpack_packages_filemap
		);

		$this->php_autoloader->register_autoloader( $loader );

		// Now that the autoloader is active we can load the filemap.
		$loader->load_filemap();
	}

	/**
	 * Resets the active autoloader and all related global state.
	 */
	public function reset_autoloader() {
		$this->php_autoloader->unregister_autoloader();
		$this->hook_manager->reset();

		// Clear all of the autoloader globals so that older autoloaders don't do anything strange.
		global $jetpack_autoloader_latest_version;
		$jetpack_autoloader_latest_version = null;

		global $jetpack_packages_classmap;
		$jetpack_packages_classmap = array(); // Must be array to avoid exceptions in old autoloaders!

		global $jetpack_packages_psr4;
		$jetpack_packages_psr4 = array(); // Must be array to avoid exceptions in old autoloaders!

		global $jetpack_packages_filemap;
		$jetpack_packages_filemap = array(); // Must be array to avoid exceptions in old autoloaders!
	}
}
woocommerce-admin/vendor/jetpack-autoloader/class-version-loader.php000064400000010166151335517650022010 0ustar00<?php
/**
 * This file was automatically generated by automattic/jetpack-autoloader.
 *
 * @package automattic/jetpack-autoloader
 */

namespace Automattic\Jetpack\Autoloader\jpd8a0da99a02edbc19880f5a1a3c7fa56;

 // phpcs:ignore

/**
 * This class loads other classes based on given parameters.
 */
class Version_Loader {

	/**
	 * The Version_Selector object.
	 *
	 * @var Version_Selector
	 */
	private $version_selector;

	/**
	 * A map of available classes and their version and file path.
	 *
	 * @var array
	 */
	private $classmap;

	/**
	 * A map of PSR-4 namespaces and their version and directory path.
	 *
	 * @var array
	 */
	private $psr4_map;

	/**
	 * A map of all the files that we should load.
	 *
	 * @var array
	 */
	private $filemap;

	/**
	 * The constructor.
	 *
	 * @param Version_Selector $version_selector The Version_Selector object.
	 * @param array            $classmap The verioned classmap to load using.
	 * @param array            $psr4_map The versioned PSR-4 map to load using.
	 * @param array            $filemap The versioned filemap to load.
	 */
	public function __construct( $version_selector, $classmap, $psr4_map, $filemap ) {
		$this->version_selector = $version_selector;
		$this->classmap         = $classmap;
		$this->psr4_map         = $psr4_map;
		$this->filemap          = $filemap;
	}

	/**
	 * Finds the file path for the given class.
	 *
	 * @param string $class_name The class to find.
	 *
	 * @return string|null $file_path The path to the file if found, null if no class was found.
	 */
	public function find_class_file( $class_name ) {
		$data = $this->select_newest_file(
			isset( $this->classmap[ $class_name ] ) ? $this->classmap[ $class_name ] : null,
			$this->find_psr4_file( $class_name )
		);
		if ( ! isset( $data ) ) {
			return null;
		}

		return $data['path'];
	}

	/**
	 * Load all of the files in the filemap.
	 */
	public function load_filemap() {
		if ( empty( $this->filemap ) ) {
			return;
		}

		foreach ( $this->filemap as $file_identifier => $file_data ) {
			if ( empty( $GLOBALS['__composer_autoload_files'][ $file_identifier ] ) ) {
				require_once $file_data['path'];

				$GLOBALS['__composer_autoload_files'][ $file_identifier ] = true;
			}
		}
	}

	/**
	 * Compares different class sources and returns the newest.
	 *
	 * @param array|null $classmap_data The classmap class data.
	 * @param array|null $psr4_data The PSR-4 class data.
	 *
	 * @return array|null $data
	 */
	private function select_newest_file( $classmap_data, $psr4_data ) {
		if ( ! isset( $classmap_data ) ) {
			return $psr4_data;
		} elseif ( ! isset( $psr4_data ) ) {
			return $classmap_data;
		}

		if ( $this->version_selector->is_version_update_required( $classmap_data['version'], $psr4_data['version'] ) ) {
			return $psr4_data;
		}

		return $classmap_data;
	}

	/**
	 * Finds the file for a given class in a PSR-4 namespace.
	 *
	 * @param string $class_name The class to find.
	 *
	 * @return array|null $data The version and path path to the file if found, null otherwise.
	 */
	private function find_psr4_file( $class_name ) {
		if ( ! isset( $this->psr4_map ) ) {
			return null;
		}

		// Don't bother with classes that have no namespace.
		$class_index = strrpos( $class_name, '\\' );
		if ( ! $class_index ) {
			return null;
		}
		$class_for_path = str_replace( '\\', '/', $class_name );

		// Search for the namespace by iteratively cutting off the last segment until
		// we find a match. This allows us to check the most-specific namespaces
		// first as well as minimize the amount of time spent looking.
		for (
			$class_namespace = substr( $class_name, 0, $class_index );
			! empty( $class_namespace );
			$class_namespace = substr( $class_namespace, 0, strrpos( $class_namespace, '\\' ) )
		) {
			$namespace = $class_namespace . '\\';
			if ( ! isset( $this->psr4_map[ $namespace ] ) ) {
				continue;
			}
			$data = $this->psr4_map[ $namespace ];

			foreach ( $data['path'] as $path ) {
				$path .= '/' . substr( $class_for_path, strlen( $namespace ) ) . '.php';
				if ( file_exists( $path ) ) {
					return array(
						'version' => $data['version'],
						'path'    => $path,
					);
				}
			}
		}

		return null;
	}
}
woocommerce-admin/vendor/autoload.php000064400000000262151335517650014002 0ustar00<?php

// autoload.php @generated by Composer

require_once __DIR__ . '/composer/autoload_real.php';

return ComposerAutoloaderInitd8a0da99a02edbc19880f5a1a3c7fa56::getLoader();
woocommerce-admin/images/admin_notes/dashboard-widget-setup.png000064400000007040151335517650021006 0ustar00�PNG


IHDR���N�PLTEGpL�������������������������������������������������������������������������]��K��5�ļ������"w�m�������+}�:��3������u������������Ú��bgm������������������&.<DL���3��1Qm/]�2k����?�������tRNS	2[������s���H���پ��o���IDATx����0EQ'i��4���~f�©�]��qQI��uk�h%����"|/����k���<1��t�w5�hU�al-��
���5�OdD+E�E��~X����U�rv���D����%�n�eem�D��y�܌6����,����w;�cNrZ�5�(�����b��-�ߙ"W��-` <���O��6O�|O=��0��o5h<��t���kS��R�� i����a6B<�I�SF�R{Z���L�Ur(�M�]��;4%��bs���<�����&eS�{_�c�R	��ئ.�m�^����X(im3!��\�����1k��28������,nf<j�s{7��H��X����Z��0��(fh����k���` ��E���wt��N��5q�F'����$3B��C��Gǥij�t�hN��.z`�
�m�����x9��`��Ha�v͸��D����Ӡ�9����g�`�D3>�	6�\�S�H�>L�������
�s����"�6t��� JS @b��̎����z'e�ů֧�
t㈧0W��)q���� �{/��U9lA��+MRS�v�������K���͹G}�J�#`��NS�U{Eh|C!Tn�z��H`�@�����c��Kݚ�%枪q����R��8�ɐ�?�D�k�(��IF�aK�n�x�9Е�f8F	�[r�S�6BJ��
��&؞�wa�s1��N���]8���`��8�6��H;��֫uV��8Ѵ�.�{�8?;8�GA�l�.�π,��4�v`w�l�:�\,�ܠw�a0�����,�4�d�f��w�aܴ���z�5���IU��Y���؆2p�
-����A�ӇIM�����*y���4�R!��+��z�.���}�p0���D�l:�,�p��p0�;&{��F����eM���*e�Ll�1Oy�Mv}�v�ET�|��gA��Z��p�v�^��@�]�Smx�΂�PVcC�Iy;\o�"��P:��N�O6�ZV�58&6�Ӻ�,q�M��H���-g�G]A\�f4�a�qe�G�\N�)W��[�~�te�s�$GA6)o�#�A�Tϸ*�V�}�7���#C?�
�������^.|��B��3�	Ç����̅���П���m,^��z)�Ã��!z���a�H]���b�ؓz������Z�&���,,�T����Β��|Z�L�	Mq֟�9Z��#�F�]²���M6&�I��%f(\�a���؝����[pU����2���k�'�lØ4�POd� �V
A:id�Vsf�(Q��˂��na�?�I�S.2ٺk^8[_|n*Y��#�u�	 3+7/��m�%��E�ϑ���g�=�ﲒ�^�
�/�Y��V,=��4���k�c�,\\����a�Z�(f��Kf.�-a�:��点��-;v�獰ՂIx���B1�K�:C%~6�n�Bq*i9����2}�`�p�xq�3� pY2W�k��p���U$�=�,�59_7�*
��Bx��_Y�LhOf8G�S��W�&>��VFXW�
��We�P`hŮ` T9�i�w�L���e�muU&���~�PPxQ��%ݑ�y���9�a;�m�N�#�+����E��9��P~��\�~a�`�:@�L��E��E�Рi�e�
)� h7pv@�֏�b�
������4DI�[׆��%�,*+�j����Նq�^=���5�%������U��T�E��(6�z�ǎ��2^�b��޲\�X^2�o�"T@`ucz6A�ZZC�o�6�� �`6��<.���E��S?.IcдW�x�T�v�TW`��b�����d�C�uN���UX�ZX/J����9�x��8ĕ��M��E�^΃�mÓ��H_c%5@�ӻ�+��/} ;c�&V��=��e���ׯȪr��!U|�ו�r�ߒބ�������	ߟ/bE�@1�������'X�]���-�y��DKmt�ycK��4Y��Zُ��������Y�kW��FR+�5�9��J�?�v���LLϤ��-s(��X��]�X	z�	ڗ+H�j�w�p�GIIO$�n��-�
�^���hZ�[��8�b|��95�%[K�>���G���A�w�X��41۽.��9]�å,N����I��r�ͱ��DZ���Pƍ�w���#i��Br��ҹ�4��I�x-��D�|(���|�%�3�v;��B<�܇���|뫜�=K0��FROI��X����-<�*ɢ�����H6��!�;�b�0��`��oE8�*a�[��5W�`Yo��A2�e�m�L��^��Ӌ�#�݀]�q������8��vY.j���7����o�O�w%�׽��!���a��x�q�����=�?���V�%f�Z���O��\E���`^���۫o��D�����V�۳)���K.\��L
�	��+�ۻ-���0���`;��I�1��RzII��&�	x�G, dC�|{��^C�q2�K��k�zUs4��û=>`k�$-r��	��=�b�p��"��w���pi�K-X(����=l�����M�u׽��Lm��ђ~qB@fL3�s6#N�!���/b�O����g=#\�UˋT�Ȩ0�s{�(-��N��MQ0[.��QQYg�Y�g=�y�"cCK/��l�1�q{O��w�z��Y��vh�L���C�S�M~��z2�����(]2ۃI�g���w�Y�t�#��ɏ3:KK^(Uq�7��C�����Kv��Zk�����Ky��F�����ީP �Gu��߫^n�~���
e�	GDz`�3���t�/�Zۧ�'�j�5�6�ϼ$W׮.��O�*�Y��+����A]����F�o�,�(���귨��`yC�=�o}�70�P��������?:�V�"��@}>���֣��Ę�س
YfXG3�ԠĀ�)��<��!��c��� SZ����w؊n�����5�m���c_V��q,x|����ӧcW���8��G.�c�;LQ���ąv�T�}<y�"��)]Re$���3R��7�Ӊ���&��:����턘I�TڸrYAV��37ت��̽�Ei�<����J&�IPG�YΜ�֔$�*��k��n��i����"���Y�v�!��&2RuIEND�B`�woocommerce-admin/images/admin_notes/filter-by-product-variations-note.svg000064400000017521151335517650023153 0ustar00<svg width="598" height="235" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M0 2a2 2 0 0 1 2-2h594a2 2 0 0 1 2 2v233H0V2z" fill="#F0F0F0"/><path fill="#F0F0F0" d="M32 19h533v198H32z"/><path d="M183.37 197.791H54.188V36.731h155.314v138.685l-26.132 22.375z" fill="#fff"/><path d="M183 175v23l26.5-22.5-26.5-.5z" fill="#DDD"/><path d="M350.025 197.791H220.843V36.731h155.314v138.685l-26.132 22.375z" fill="#fff"/><path d="M350 175v23l26.5-22.5-26.5-.5z" fill="#DDD"/><path d="M516.187 197.791H387.005V36.731h155.314v138.685l-26.132 22.375z" fill="#fff"/><path d="M516 175v23l26.5-22.5-26.5-.5z" fill="#DDD"/><path d="M131.589 181.507c10.343 0 18.727-8.373 18.727-18.701 0-10.329-8.384-18.702-18.727-18.702s-18.727 8.373-18.727 18.702c0 10.328 8.384 18.701 18.727 18.701z" fill="#F0F0F0"/><path d="M138.897 174.918h-14.006c1.815-8.401 1.81-15.168.364-20.64a1.462 1.462 0 0 1 .891-1.738l3.768-1.447c1.131 1.459 2.727 2.096 5.216 1.157l1.974.405a2.029 2.029 0 0 1 1.62 2.118c-.146 2.14-.088 4.297-.214 6.158-.387 5.765-.554 10.259.387 13.987z" fill="#F0B849"/><path d="m138.317 161.413 3.767-1.736-.193-1.367a5.601 5.601 0 0 0-.983-3.17 5.62 5.62 0 0 0-2.604-2.061l-1.146-.443 1.159 8.777zM125.857 161.028l-3.767-1.736.193-1.367a5.609 5.609 0 0 1 3.587-5.231l1.146-.444-1.159 8.778z" fill="#F0B849"/><path d="M298.244 181.507c10.343 0 18.727-8.373 18.727-18.701 0-10.329-8.384-18.702-18.727-18.702s-18.727 8.373-18.727 18.702c0 10.328 8.384 18.701 18.727 18.701z" fill="#F0F0F0"/><path d="M305.552 174.918h-14.006c1.815-8.401 1.81-15.168.364-20.64a1.462 1.462 0 0 1 .891-1.738l3.768-1.447c1.131 1.459 2.727 2.096 5.216 1.157l1.974.405a2.029 2.029 0 0 1 1.619 2.118c-.145 2.14-.088 4.297-.213 6.158-.387 5.765-.554 10.259.387 13.987z" fill="#1E1E1E"/><path d="m304.972 161.413 3.767-1.736-.193-1.367a5.609 5.609 0 0 0-3.587-5.231l-1.146-.443 1.159 8.777zM292.512 161.028l-3.767-1.736.193-1.367a5.609 5.609 0 0 1 3.587-5.231l1.146-.444-1.159 8.778z" fill="#1E1E1E"/><path d="M464.406 181.507c10.343 0 18.727-8.373 18.727-18.701 0-10.329-8.384-18.702-18.727-18.702s-18.727 8.373-18.727 18.702c0 10.328 8.384 18.701 18.727 18.701z" fill="#F0F0F0"/><path d="M471.714 174.918h-14.006c1.815-8.401 1.81-15.168.364-20.64a1.462 1.462 0 0 1 .89-1.738l3.769-1.447c1.131 1.459 2.727 2.096 5.215 1.157l1.975.405a2.029 2.029 0 0 1 1.619 2.118c-.145 2.14-.088 4.297-.213 6.158-.387 5.765-.554 10.259.387 13.987z" fill="#4AB866"/><path d="m471.134 161.413 3.767-1.736-.193-1.367a5.609 5.609 0 0 0-3.587-5.231l-1.146-.443 1.159 8.777zM458.674 161.028l-3.767-1.736.193-1.367c0-1.131.342-2.236.983-3.17a5.62 5.62 0 0 1 2.604-2.061l1.146-.444-1.159 8.778z" fill="#4AB866"/><path fill="#FAFAFA" d="M54.188 36.731h155.315v93.582H54.188z"/><path d="M81.8 102.379h100.316" stroke="#7983A6" stroke-miterlimit="10"/><g opacity=".5" stroke="#7983A6" stroke-miterlimit="10"><path opacity=".5" d="M81.8 91.179h1.598"/><path opacity=".5" d="M86.537 91.178h92.568" stroke-dasharray="4 4"/><path opacity=".5" d="M180.674 91.178h1.599"/></g><g opacity=".5" stroke="#7983A6" stroke-miterlimit="10"><path opacity=".5" d="M81.8 80.26h1.598"/><path opacity=".5" d="M86.537 80.26h92.568" stroke-dasharray="4 4"/><path opacity=".5" d="M180.674 80.26h1.599"/></g><g opacity=".5" stroke="#7983A6" stroke-miterlimit="10"><path opacity=".5" d="M81.8 69.34h1.598"/><path opacity=".5" d="M86.537 69.34h92.568" stroke-dasharray="4 4"/><path opacity=".5" d="M180.674 69.34h1.599"/></g><g opacity=".5" stroke="#7983A6" stroke-miterlimit="10"><path opacity=".5" d="M81.8 58.422h1.598"/><path opacity=".5" d="M86.537 58.422h92.568" stroke-dasharray="4 4"/><path opacity=".5" d="M180.674 58.422h1.599"/></g><g opacity=".3"><path opacity=".65" d="M94.01 80.26H86.8V102.1h7.21V80.26z" fill="#007CBA"/></g><path d="M114.402 69.184h-7.524v33.195h7.524V69.184z" fill="#007CBA"/><g opacity=".3"><path opacity=".65" d="M134.246 91.061h-7.21v11.267h7.21V91.061z" fill="#007CBA"/></g><path d="M154.529 57.91h-7.524v44.469h7.524V57.911z" fill="#007CBA"/><g opacity=".3"><path opacity=".65" d="M174.479 68.76h-7.21v33.339h7.21v-33.34z" fill="#007CBA"/></g><path d="M90.422 108.958a1.725 1.725 0 1 0 .001-3.45 1.725 1.725 0 0 0-.001 3.45zM110.485 108.958a1.725 1.725 0 1 0 .002-3.45 1.725 1.725 0 0 0-.002 3.45zM130.549 108.958a1.724 1.724 0 1 0-1.726-1.724c0 .952.772 1.724 1.726 1.724zM151.239 108.958a1.725 1.725 0 1 0 .002-3.45 1.725 1.725 0 0 0-.002 3.45zM171.302 108.958a1.725 1.725 0 1 0 .002-3.45 1.725 1.725 0 0 0-.002 3.45z" fill="#007CBA"/><path fill="#FAFAFA" d="M220.843 36.731h155.315v93.582H220.843z"/><path d="M248.454 102.379h100.317" stroke="#7983A6" stroke-miterlimit="10"/><g opacity=".5" stroke="#7983A6" stroke-miterlimit="10"><path opacity=".5" d="M248.454 91.179h1.599"/><path opacity=".5" d="M253.192 91.178h92.568" stroke-dasharray="4 4"/><path opacity=".5" d="M347.329 91.178h1.599"/></g><g opacity=".5" stroke="#7983A6" stroke-miterlimit="10"><path opacity=".5" d="M248.454 80.26h1.599"/><path opacity=".5" d="M253.192 80.26h92.568" stroke-dasharray="4 4"/><path opacity=".5" d="M347.329 80.26h1.599"/></g><g opacity=".5" stroke="#7983A6" stroke-miterlimit="10"><path opacity=".5" d="M248.454 69.34h1.599"/><path opacity=".5" d="M253.192 69.34h92.568" stroke-dasharray="4 4"/><path opacity=".5" d="M347.329 69.34h1.599"/></g><g opacity=".5" stroke="#7983A6" stroke-miterlimit="10"><path opacity=".5" d="M248.454 58.422h1.599"/><path opacity=".5" d="M253.192 58.422h92.568" stroke-dasharray="4 4"/><path opacity=".5" d="M347.329 58.422h1.599"/></g><g opacity=".3"><path opacity=".65" d="M261 86h-8v16h8V86z" fill="#007CBA"/></g><path d="M281 61h-7v41h7V61z" fill="#007CBA"/><g opacity=".3"><path opacity=".65" d="M301 73h-7v29.001h7v-29z" fill="#007CBA"/></g><path d="M321 69h-7v33h7V69z" fill="#007CBA"/><g opacity=".3"><path opacity=".65" d="M341 61h-7v41.001h7v-41z" fill="#007CBA"/></g><path d="M257.077 108.958a1.724 1.724 0 1 0 .001-3.449 1.724 1.724 0 0 0-.001 3.449zM277.14 108.958a1.725 1.725 0 1 0 .002-3.45 1.725 1.725 0 0 0-.002 3.45zM297.203 108.958a1.725 1.725 0 1 0 .003-3.45 1.725 1.725 0 0 0-.003 3.45zM317.894 108.958a1.725 1.725 0 1 0 .002-3.45 1.725 1.725 0 0 0-.002 3.45zM337.957 108.958a1.725 1.725 0 1 0 .002-3.45 1.725 1.725 0 0 0-.002 3.45z" fill="#007CBA"/><path fill="#FAFAFA" d="M387.005 36.731H542.32v93.582H387.005z"/><path d="M414.616 102.379h100.317" stroke="#7983A6" stroke-miterlimit="10"/><g opacity=".5" stroke="#7983A6" stroke-miterlimit="10"><path opacity=".5" d="M414.616 91.179h1.599"/><path opacity=".5" d="M419.354 91.178h92.568" stroke-dasharray="4 4"/><path opacity=".5" d="M513.491 91.178h1.599"/></g><g opacity=".5" stroke="#7983A6" stroke-miterlimit="10"><path opacity=".5" d="M414.616 80.26h1.599"/><path opacity=".5" d="M419.354 80.26h92.568" stroke-dasharray="4 4"/><path opacity=".5" d="M513.491 80.26h1.599"/></g><g opacity=".5" stroke="#7983A6" stroke-miterlimit="10"><path opacity=".5" d="M414.616 69.34h1.599"/><path opacity=".5" d="M419.354 69.34h92.568" stroke-dasharray="4 4"/><path opacity=".5" d="M513.491 69.34h1.599"/></g><g opacity=".5" stroke="#7983A6" stroke-miterlimit="10"><path opacity=".5" d="M414.616 58.422h1.599"/><path opacity=".5" d="M419.354 58.422h92.568" stroke-dasharray="4 4"/><path opacity=".5" d="M513.491 58.422h1.599"/></g><g opacity=".3"><path opacity=".65" d="M427 63h-7v39h7V63z" fill="#007CBA"/></g><path d="M447 65h-7v37h7V65z" fill="#007CBA"/><g opacity=".3"><path opacity=".65" d="M467 80h-7v22.001h7v-22z" fill="#007CBA"/></g><path d="M487 91h-7v11h7V91z" fill="#007CBA"/><g opacity=".3"><path opacity=".65" d="M507 80h-7v22.001h7v-22z" fill="#007CBA"/></g><path d="M423.239 108.958a1.724 1.724 0 1 0 .001-3.449 1.724 1.724 0 0 0-.001 3.449zM443.302 108.958a1.725 1.725 0 1 0 .002-3.45 1.725 1.725 0 0 0-.002 3.45zM463.365 108.958a1.725 1.725 0 1 0 .002-3.45 1.725 1.725 0 0 0-.002 3.45zM484.056 108.958a1.724 1.724 0 1 0 .001-3.449 1.724 1.724 0 0 0-.001 3.449zM504.119 108.958a1.725 1.725 0 1 0 .002-3.45 1.725 1.725 0 0 0-.002 3.45z" fill="#007CBA"/></svg>woocommerce-admin/images/empty-content.svg000064400000001012151335517650014752 0ustar00<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 400 400"><path d="M226.153 88.31 355.38 301.446c8.59 14.168 4.069 32.617-10.1 41.207A30 30 0 0 1 329.728 347H71.273c-16.569 0-30-13.431-30-30a30 30 0 0 1 4.347-15.554L174.847 88.31c8.59-14.168 27.039-18.69 41.207-10.1a30 30 0 0 1 10.1 10.1zM184.37 153l2.53 102.024h26.56L215.99 153h-31.62zm15.81 154.723c9.59 0 17.18-7.273 17.18-16.548 0-9.275-7.59-16.547-17.18-16.547-9.591 0-17.18 7.272-17.18 16.547s7.589 16.548 17.18 16.548z" stroke="#979797" fill="#95588A"/></svg>woocommerce-admin/images/marketing/mailchimp.svg000064400000010000151335517650016065 0ustar00<svg width="36" height="36" fill="none" xmlns="http://www.w3.org/2000/svg"><rect width="36" height="36" rx="3" fill="#FFE071"/><path d="M24.053 17.286c.186-.022.365-.024.528 0 .095-.221.111-.604.026-1.02-.126-.619-.298-.993-.652-.935-.355.058-.368.506-.24 1.125.07.348.197.646.338.83zM21.012 17.776c.253.113.409.189.47.123.04-.041.028-.12-.033-.22-.125-.209-.383-.42-.655-.539a1.757 1.757 0 0 0-1.738.213c-.17.127-.33.302-.307.41.007.034.032.06.092.068.14.017.629-.236 1.191-.27.397-.026.727.101.98.215zM20.502 18.073c-.33.053-.512.164-.629.268-.1.089-.161.187-.16.256a.079.079 0 0 0 .08.083c.074 0 .24-.068.24-.068.46-.168.763-.148 1.064-.113.166.019.244.03.28-.028.011-.017.024-.053-.009-.108-.078-.13-.411-.345-.866-.29zM23.026 19.163c.224.112.471.068.552-.099.08-.167-.037-.393-.261-.505-.224-.113-.471-.069-.551.098-.08.167.037.394.26.506zM24.467 17.878c-.182-.003-.333.2-.337.455-.004.255.14.464.322.467.182.003.333-.2.337-.455.005-.255-.14-.464-.322-.467zM12.237 22.474c-.045-.059-.12-.04-.192-.024-.05.012-.107.026-.17.025a.367.367 0 0 1-.31-.161c-.083-.13-.078-.324.013-.546l.043-.1c.146-.334.39-.894.116-1.427-.207-.401-.543-.651-.949-.704-.388-.05-.789.097-1.044.384-.403.454-.466 1.071-.388 1.289.029.08.073.102.105.106.07.01.17-.041.234-.216l.018-.057c.029-.092.081-.263.168-.4a.717.717 0 0 1 1.014-.215c.282.187.39.54.27.877-.063.174-.164.507-.141.78.045.554.379.777.679.8.29.012.495-.155.547-.277.029-.072.004-.116-.013-.134z" fill="#000"/><path d="M29.062 21.46c-.01-.04-.083-.309-.182-.634-.1-.325-.203-.554-.203-.554.399-.609.406-1.153.353-1.461-.056-.383-.212-.708-.527-1.045-.314-.336-.956-.681-1.86-.94l-.474-.134c-.002-.02-.025-1.14-.045-1.621-.015-.348-.044-.891-.21-1.425-.196-.724-.538-1.357-.966-1.762 1.18-1.249 1.917-2.625 1.915-3.805-.004-2.269-2.734-2.956-6.099-1.534-.003.002-.707.306-.713.31l-1.308-1.309C14.907 2.131 2.913 15.74 6.747 19.044l.839.725a4.28 4.28 0 0 0-.233 1.942c.09.91.549 1.782 1.294 2.455.707.64 1.637 1.045 2.54 1.044 1.492 3.51 4.902 5.664 8.9 5.785 4.289.13 7.889-1.924 9.397-5.614.099-.259.518-1.425.518-2.456-.002-1.035-.575-1.464-.94-1.464zm-17.546 2.764c-.13.022-.263.032-.397.028-1.295-.036-2.695-1.226-2.834-2.638-.154-1.56.628-2.76 2.01-3.045.166-.034.365-.054.581-.042.775.043 1.917.65 2.177 2.373.231 1.526-.136 3.08-1.537 3.324zm-1.446-6.588c-.861.171-1.62.67-2.084 1.357-.277-.236-.794-.693-.885-.871-.741-1.436.808-4.227 1.89-5.804 2.675-3.896 6.863-6.844 8.803-6.309.315.091 1.36 1.327 1.36 1.327s-1.939 1.098-3.737 2.628c-2.422 1.903-4.252 4.67-5.347 7.672zm13.596 6.004a.077.077 0 0 0 .044-.077.072.072 0 0 0-.079-.065s-2.029.306-3.945-.41c.208-.693.764-.443 1.602-.374a11.493 11.493 0 0 0 3.87-.427c.868-.254 2.008-.755 2.894-1.469.3.67.404 1.407.404 1.407s.232-.042.425.079c.183.115.316.353.225.97-.187 1.151-.666 2.086-1.472 2.946a6.09 6.09 0 0 1-1.768 1.348 7.391 7.391 0 0 1-1.154.498c-3.038 1.013-6.15-.1-7.152-2.492a3.848 3.848 0 0 1-.2-.565c-.428-1.576-.065-3.467 1.069-4.657.07-.076.14-.165.14-.277a.496.496 0 0 0-.109-.264c-.396-.587-1.77-1.588-1.495-3.525.198-1.391 1.39-2.371 2.502-2.313l.282.016c.482.029.902.092 1.298.109.663.03 1.26-.07 1.967-.67.239-.203.43-.379.753-.435.034-.005.118-.037.288-.029a.94.94 0 0 1 .484.158c.566.385.647 1.317.676 2 .017.389.063 1.33.079 1.6.036.619.195.706.517.814.181.06.35.106.598.177.75.215 1.194.433 1.475.713a.958.958 0 0 1 .269.538c.088.659-.5 1.472-2.06 2.212-1.706.808-3.776 1.012-5.205.85l-.5-.058c-1.145-.157-1.797 1.351-1.11 2.384.442.666 1.647 1.1 2.852 1.1 2.764 0 4.889-1.204 5.678-2.244.024-.031.026-.035.064-.092.038-.06.006-.093-.042-.059-.646.45-3.513 2.24-6.58 1.702 0 0-.374-.062-.714-.197-.27-.107-.836-.373-.905-.966 2.476.783 4.035.044 4.035.044zm-3.922-.472.001.002v-.002zM15.01 12.302c.95-1.121 2.121-2.096 3.17-2.643.036-.02.074.02.055.057-.084.154-.244.483-.295.734-.008.039.034.068.066.045.652-.453 1.787-.94 2.783-1.002.042-.003.063.053.029.08a2.38 2.38 0 0 0-.438.448c-.02.028-.001.069.033.069.7.005 1.685.255 2.327.622.043.025.012.11-.037.1-.972-.228-2.561-.4-4.214.01-1.475.368-2.6.935-3.421 1.545-.042.031-.091-.025-.058-.065z" fill="#000"/></svg>woocommerce-admin/images/marketing/automatewoo.svg000064400000001021151335517650016471 0ustar00<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100"><defs><clipPath id="a"><path d="M0 0h100v100H0z"/></clipPath></defs><g clip-path="url(#a)"><path fill="#fff" d="M0 0h100v100H0z"/><path fill="#7532e4" d="M0 0h100v100H0z"/><g fill="#1ff2e6"><path d="M34.714 59.618H20.902l-2.823 7.764h-6.982l13.048-33.994h7.669l12.934 33.995h-7.192zm-11.6-6.047h9.4l-4.687-12.838zM81.184 33.388h6.753l-9.4 33.995h-6.81l-7.764-24.208-7.764 24.208h-6.906l-9.448-33.995h7l6.238 23.388 7.535-23.388h6.849l7.592 23.483z"/></g></g></svg>woocommerce-admin/images/marketing/amazon-ebay.svg000064400000011373151335517650016343 0ustar00<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100"><defs><clipPath id="a"><path d="M0 0h100v100H0z"/></clipPath></defs><g clip-path="url(#a)"><path fill="#fff" d="M0 0h100v100H0z"/><path fill="#eee" d="M0 0h100v100H0z"/><g fill-rule="evenodd"><path d="M59.518 44.844c-4.732 3.488-11.591 5.349-17.5 5.349a31.66 31.66 0 0 1-21.374-8.156c-.443-.4-.046-.946.486-.634a43.018 43.018 0 0 0 21.384 5.671 42.523 42.523 0 0 0 16.312-3.335c.8-.34 1.471.525.688 1.106" fill="#f90"/><path d="M61.484 42.594c-.6-.773-4-.365-5.522-.184-.464.057-.535-.347-.117-.638 2.7-1.9 7.142-1.354 7.66-.716s-.135 5.09-2.676 7.213c-.39.326-.762.152-.588-.28.571-1.425 1.85-4.619 1.244-5.395" fill="#f90"/><path d="M56.068 28.335v-1.85a.457.457 0 0 1 .468-.468h8.284a.461.461 0 0 1 .479.468v1.585a2.605 2.605 0 0 1-.624 1.163l-4.292 6.129a9.146 9.146 0 0 1 4.725 1.014.843.843 0 0 1 .44.72v1.974c0 .269-.3.585-.61.422a9.542 9.542 0 0 0-8.752.014c-.287.156-.588-.156-.588-.425v-1.877a2.238 2.238 0 0 1 .3-1.272l4.973-7.132h-4.328a.458.458 0 0 1-.479-.464M25.851 39.88h-2.52a.476.476 0 0 1-.45-.429V26.517a.473.473 0 0 1 .486-.464h2.35a.475.475 0 0 1 .457.432v1.691h.046a3.463 3.463 0 0 1 6.589 0 3.722 3.722 0 0 1 6.4-.982c.8 1.088.634 2.669.634 4.055v8.163a.476.476 0 0 1-.486.468H36.84a.479.479 0 0 1-.454-.468v-6.856a16.192 16.192 0 0 0-.071-2.424 1.312 1.312 0 0 0-1.482-1.113 1.674 1.674 0 0 0-1.506 1.06 7.831 7.831 0 0 0-.234 2.478v6.855a.476.476 0 0 1-.486.468H30.09a.476.476 0 0 1-.454-.468v-6.855c0-1.443.238-3.566-1.553-3.566-1.811 0-1.74 2.07-1.74 3.566v6.855a.476.476 0 0 1-.486.468M72.43 25.78c3.739 0 5.763 3.211 5.763 7.295 0 3.945-2.237 7.075-5.763 7.075-3.672 0-5.671-3.211-5.671-7.213 0-4.027 2.024-7.156 5.671-7.156m.018 2.639c-1.857 0-1.974 2.531-1.974 4.108s-.025 4.955 1.953 4.955c1.953 0 2.045-2.722 2.045-4.381a11.959 11.959 0 0 0-.376-3.431 1.577 1.577 0 0 0-1.648-1.251M83.042 39.88h-2.51a.479.479 0 0 1-.454-.468V26.474a.477.477 0 0 1 .486-.422H82.9a.482.482 0 0 1 .45.362v1.978h.046c.705-1.769 1.694-2.612 3.435-2.612a3.307 3.307 0 0 1 2.942 1.524c.659 1.035.659 2.775.659 4.027v8.142a.484.484 0 0 1-.486.408h-2.527a.477.477 0 0 1-.447-.408v-7.026c0-1.414.163-3.484-1.577-3.484a1.647 1.647 0 0 0-1.457 1.035 5.724 5.724 0 0 0-.4 2.449v6.965a.485.485 0 0 1-.493.468M49.465 33.701a4.93 4.93 0 0 1-.471 2.673 2.048 2.048 0 0 1-1.744 1.145c-.968 0-1.535-.737-1.535-1.825 0-2.148 1.925-2.538 3.75-2.538v.546m2.541 6.143a.526.526 0 0 1-.6.06 6.143 6.143 0 0 1-1.446-1.68 4.991 4.991 0 0 1-4.154 1.833 3.575 3.575 0 0 1-3.771-3.927 4.277 4.277 0 0 1 2.687-4.119 17.463 17.463 0 0 1 4.739-.876v-.327a3.214 3.214 0 0 0-.308-1.825 1.677 1.677 0 0 0-1.414-.656 1.917 1.917 0 0 0-2.024 1.514.527.527 0 0 1-.439.461l-2.442-.262a.444.444 0 0 1-.376-.528c.563-2.965 3.244-3.858 5.639-3.858a5.714 5.714 0 0 1 3.8 1.255c1.223 1.145 1.105 2.673 1.105 4.335v3.927a3.447 3.447 0 0 0 .95 2.336.477.477 0 0 1-.011.67c-.514.429-1.428 1.226-1.932 1.673v-.007M16.426 33.701a4.93 4.93 0 0 1-.471 2.673 2.043 2.043 0 0 1-1.744 1.145c-.968 0-1.531-.737-1.531-1.825-.001-2.149 1.92-2.539 3.746-2.539v.546m2.541 6.143a.526.526 0 0 1-.6.06 6.2 6.2 0 0 1-1.446-1.68 4.986 4.986 0 0 1-4.15 1.831A3.576 3.576 0 0 1 9 36.129a4.282 4.282 0 0 1 2.687-4.118 17.462 17.462 0 0 1 4.739-.876v-.326a3.243 3.243 0 0 0-.3-1.825 1.686 1.686 0 0 0-1.414-.656 1.921 1.921 0 0 0-2.033 1.513.527.527 0 0 1-.436.461L9.8 30.04a.446.446 0 0 1-.376-.528c.561-2.964 3.238-3.857 5.634-3.857a5.714 5.714 0 0 1 3.8 1.255c1.222 1.145 1.105 2.673 1.105 4.335v3.927a3.447 3.447 0 0 0 .95 2.336.473.473 0 0 1-.007.67c-.514.429-1.428 1.226-1.932 1.673l-.007-.007"/></g><path d="M26.955 60.115c-4.339 0-7.955 1.841-7.955 7.392 0 4.4 2.431 7.171 8.067 7.171 6.633 0 7.059-4.37 7.059-4.37h-3.215s-.689 2.353-4.04 2.353a4.4 4.4 0 0 1-4.693-4.428h12.284v-1.619c0-2.557-1.623-6.5-7.507-6.5zm-.112 2.073c2.6 0 4.37 1.592 4.37 3.977l-8.964-.001c0-2.531 2.312-3.976 4.594-3.976z" fill="#e53238"/><path d="M34.46 54.737v17.154c0 .974-.069 2.341-.069 2.341h3.066s.11-.982.11-1.879c0 0 1.515 2.37 5.633 2.37a6.961 6.961 0 0 0 7.283-7.325 6.922 6.922 0 0 0-7.277-7.241c-4.279 0-5.609 2.311-5.609 2.311v-7.731zm7.955 7.542c2.945 0 4.818 2.186 4.818 5.119a4.857 4.857 0 0 1-4.8 5.2c-3.143 0-4.839-2.454-4.839-5.175.003-2.532 1.524-5.144 4.82-5.144z" fill="#0064d2"/><path d="M58.1 60.115c-6.528 0-6.947 3.574-6.947 4.146h3.249s.17-2.087 3.473-2.087c2.146 0 3.809.982 3.809 2.871v.672h-3.809c-5.057 0-7.731 1.479-7.731 4.482 0 2.955 2.47 4.562 5.809 4.562 4.55 0 6.015-2.514 6.015-2.514 0 1 .077 1.985.077 1.985h2.888s-.112-1.221-.112-2v-6.756c0-4.428-3.572-5.36-6.722-5.36zm3.585 7.619v.9c0 1.169-.721 4.075-4.968 4.075-2.326 0-3.323-1.161-3.323-2.507 0-2.452 3.358-2.468 8.291-2.468z" fill="#f5af02"/><path d="M63.073 60.676h3.655l5.246 10.51 5.234-10.51h3.311l-9.533 18.711h-3.473l2.751-5.216z" fill="#86b817"/></g></svg>woocommerce-admin/images/marketing/facebook.svg000064400000000513151335517650015703 0ustar00<svg width="36" height="36" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M34 0H2C.8 0 0 .8 0 2v32c0 1 .8 2 2 2h17.2V22h-4.6v-5.4h4.6v-4c0-4.6 2.8-7.2 7-7.2 2 0 3.6.2 4.2.2v4.8h-2.8c-2.2 0-2.6 1-2.6 2.6v3.4h5.4l-.8 5.6H25v14h9c1 0 2-.8 2-2V2c0-1.2-.8-2-2-2z" fill="#3B5997"/></svg>woocommerce-admin/images/marketing/pinterest.svg000064400000002137151335517650016153 0ustar00<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 25.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0)  -->
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
	 viewBox="0 0 243 243" style="enable-background:new 0 0 243 243;" xml:space="preserve">
<style type="text/css">
	.st0{fill:#E60023;}
</style>
<g>
	<path class="st0" d="M121.5,0C54.4,0,0,54.4,0,121.5C0,173,32,217,77.2,234.7c-1.1-9.6-2-24.4,0.4-34.9
		c2.2-9.5,14.2-60.4,14.2-60.4s-3.6-7.3-3.6-18c0-16.9,9.8-29.5,22-29.5c10.4,0,15.4,7.8,15.4,17.1c0,10.4-6.6,26-10.1,40.5
		c-2.9,12.1,6.1,22,18,22c21.6,0,38.2-22.8,38.2-55.6c0-29.1-20.9-49.4-50.8-49.4C86.3,66.5,66,92.4,66,119.2c0,10.4,4,21.6,9,27.7
		c1,1.2,1.1,2.3,0.8,3.5c-0.9,3.8-3,12.1-3.4,13.8c-0.5,2.2-1.8,2.7-4.1,1.6c-15.2-7.1-24.7-29.2-24.7-47.1
		c0-38.3,27.8-73.5,80.3-73.5c42.1,0,74.9,30,74.9,70.2c0,41.9-26.4,75.6-63,75.6c-12.3,0-23.9-6.4-27.8-14c0,0-6.1,23.2-7.6,28.9
		c-2.7,10.6-10.1,23.8-15.1,31.9c11.4,3.5,23.4,5.4,36,5.4c67.1,0,121.5-54.4,121.5-121.5C243,54.4,188.6,0,121.5,0z"/>
</g>
</svg>
woocommerce-admin/images/marketing/hubspot.svg000064400000001467151335517650015627 0ustar00<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100"><defs><clipPath id="a"><path d="M0 0h100v100H0z"/></clipPath></defs><g clip-path="url(#a)"><path fill="#fff" d="M0 0h100v100H0z"/><path d="M100 100H0V0h100v100zM40.665 75.539a6.446 6.446 0 1 0 6.447 6.447 6.376 6.376 0 0 0-.3-1.843l7.346-7.343a19.808 19.808 0 1 0 15.048-35.32h.015v-9.025a6.959 6.959 0 0 0 4.013-6.273v-.211a6.971 6.971 0 0 0-6.952-6.953h-.212a6.97 6.97 0 0 0-6.952 6.953v.211a6.957 6.957 0 0 0 4.013 6.273V37.5a19.745 19.745 0 0 0-9.376 4.126l-24.82-19.331a7.919 7.919 0 0 0-4.148-9.145 7.845 7.845 0 0 0-3.5-.817 7.919 7.919 0 1 0 3.938 14.786l24.4 19a19.775 19.775 0 0 0 .3 22.3l-7.426 7.427a6.362 6.362 0 0 0-1.834-.307zm25.522-8.321h-.023a10.164 10.164 0 0 1 .023-20.328h.013a10.166 10.166 0 0 1-.012 20.333z" fill="#ff7a59"/></g></svg>woocommerce-admin/images/marketing/google.svg000064400000003235151335517650015412 0ustar00<svg width="128" height="128" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill="#fff" d="M0 0h128v128H0z"/><path fill-rule="evenodd" clip-rule="evenodd" d="M92.454 42.342a6.796 6.796 0 1 0 0-13.593 6.796 6.796 0 0 0 0 13.593zM44.31 40.268l20.848-20.849a8.78 8.78 0 0 1 6.229-2.562h30.921a8.808 8.808 0 0 1 8.17 5.45 8.798 8.798 0 0 1 .665 3.385v30.921c0 2.43-.972 4.639-2.607 6.229L87.72 83.678l-43.41-43.41z" fill="#4285F4"/><path fill-rule="evenodd" clip-rule="evenodd" d="M87.72 83.678 62.03 109.394c-1.635 1.59-3.843 2.606-6.273 2.606-2.43 0-4.638-1.016-6.228-2.606L18.606 78.472C16.972 76.882 16 74.674 16 72.245a8.843 8.843 0 0 1 2.606-6.273L44.31 40.267l43.41 43.411z" fill="#34A853"/><path fill-rule="evenodd" clip-rule="evenodd" d="M33.611 93.478 18.606 78.472C16.972 76.882 16 74.674 16 72.244a8.843 8.843 0 0 1 2.606-6.272L44.31 40.268l21.256 21.256-31.954 31.954z" fill="#FBBC05"/><path fill-rule="evenodd" clip-rule="evenodd" d="M108.092 18.997a8.804 8.804 0 0 0-5.784-2.14H71.387a8.78 8.78 0 0 0-6.229 2.562L44.31 40.267l21.256 21.256 21.649-21.649a6.796 6.796 0 0 1 9.568-9.568l11.309-11.309z" fill="#EA4335"/><path d="M65.553 77.737c7.624 0 13.805-6.18 13.805-13.804S73.178 50.13 65.553 50.13 51.75 56.309 51.75 63.933s6.18 13.804 13.804 13.804z" fill="#4285F4"/><path fill-rule="evenodd" clip-rule="evenodd" d="M84.36 59.872H66.002v7.877H76.57c-.985 5.005-5.105 7.877-10.568 7.877-6.448 0-11.642-5.374-11.642-12.047S59.553 51.532 66 51.532c2.777 0 5.284 1.02 7.255 2.687l5.731-5.93c-3.492-3.152-7.97-5.098-12.986-5.098-10.926 0-19.703 9.082-19.703 20.388s8.777 20.388 19.703 20.388c9.852 0 18.808-7.414 18.808-20.388 0-1.205-.18-2.502-.448-3.707z" fill="#fff"/></svg>woocommerce-admin/images/shippingillustration.svg000064400000011176151335517650016453 0ustar00<svg width="96" height="68" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill="#fff" d="M0 0h96v68H0z"/><g clip-path="url(#a)"><path d="M0 0h96v68H0V0z" fill="#fff"/><g clip-path="url(#b)"><path d="M96 63.366H3v.224h93v-.224z" fill="#7F54B3"/><path d="M90.549 29.889h-31.26v33.523h31.26V29.89z" fill="#F7EDF7"/><path d="M60.736 46.595V31.122h1.78l8.732.28-.39 2.299v12.894H60.737zm16.909 6.839h-5.451V63.3h5.45v-9.866z" fill="#DCDCDE"/><path d="M35.595 45.361h-22.36v18.163h22.36V45.361z" fill="#F7EDF7"/><path d="M25.137 58.255h-3.782v5.157h3.782v-5.157z" fill="#DCDCDE"/><path d="M67.4 35.041c-.843 1.486-6.78-.99-6.78-.99l-11.344-4.605-2.742-2.046-1.747-1.303 3.88-1.095.109.053 2.704 1.3 10.37 6.243s7.75-1.432 5.55 2.443z" fill="#A0616A"/><path d="M38.807 17.784s-1.46.591-1.629 2.25c-.169 1.658-.183 11.012-.183 11.012s3.814-2.213 5.865-2.258c2.05-.046 6.815-3.532 6.815-3.532s-8.976-8.17-10.868-7.472z" fill="#D0CDE1"/><path opacity=".1" d="M38.807 17.784s-1.46.591-1.629 2.25c-.169 1.658-.183 11.012-.183 11.012s3.814-2.213 5.865-2.258c2.05-.046 6.815-3.532 6.815-3.532s-8.976-8.17-10.868-7.472z" fill="#000"/><path d="m53.115 48.388-3.114.225s-.096 5.89-.501 7.4l5.34 4.26-1.113-3.588-.612-8.297z" fill="#A0616A"/><path d="M55.142 60.395c-.221-.079-.191-.122-.191-.122v-.224l-5.442-4.402c-.053.197-.112.326-.176.365-.2.121-.485.516-.769.973a4.393 4.393 0 0 0-.455 3.624l-.222 3.812h.89l.222-3.476h1.113s1.891 2.467 2.447 3.364c.556.897 3.004 1.121 5.451-.56 2.068-1.422-1.662-2.923-2.868-3.354z" fill="#2F2E41"/><path d="M25.75 35.102s-5.452 6.615-.223 10.651c2.3 1.776 4.321 5.137 5.863 8.344a19.152 19.152 0 0 0 5.114 6.534 18.967 18.967 0 0 0 7.378 3.734S62.46 42.502 56.12 36.335c-6.341-6.166-23.472-.785-23.472-.785l-6.898-.448z" fill="#2F2E41"/><path d="M41.182 29.524c.025 1.477-.256 3.098-1.527 3.448-2.447.673-2.67.336-2.67.336s-.445.785-.334 1.682c.112.897-1.056.168-1.056.168s-11.848 1.514-11.403-.168c.445-1.682 4.672-7.512 4.672-7.512s6.897-9.754 8.344-9.418c.049.011.099.025.15.04 1.474.432 3.973 2.342 4.188 3.1.223.784-.667 5.718-.667 5.718.18.857.282 1.73.303 2.606z" fill="#D0CDE1"/><path d="M58.678 43.287c-1.447.897-2.336-5.494-2.336-5.494l-10.457-6.39-2.379-2.466-1.515-1.571 4.005-.448.099.069 2.46 1.724 9.233 7.849s2.336 5.83.89 6.727z" fill="#A0616A"/><path opacity=".1" d="M40.879 26.917c.18.858.282 1.73.303 2.607-.777.143-1.48.194-1.972.084-2.002-.448-6.23.785-6.23.785s2.225-9.082 2.781-10.651a2.747 2.747 0 0 1 1.598-1.643c1.473.433 3.972 2.342 4.187 3.1.223.785-.667 5.718-.667 5.718z" fill="#000"/><path d="M40.828 16.68c-2.403-1.15-3.428-4.052-2.29-6.481 1.137-2.43 4.007-3.466 6.41-2.316 2.403 1.15 3.428 4.052 2.29 6.482-1.137 2.43-4.007 3.466-6.41 2.315z" fill="#2F2E41"/><path opacity=".1" d="M46.663 27.814s-1.466.604-3.157 1.123l-1.515-1.571 4.005-.448.099.069c.358.515.568.827.568.827z" fill="#000"/><path d="m44.065 15.589-1.77 7.578-4.269-3.989s2.186-3.058 2.186-3.855c0-.798 3.853.266 3.853.266z" fill="#A0616A"/><path d="M38.209 17.387s-1.558.225-2.114 1.794c-.556 1.57-2.781 10.652-2.781 10.652s4.227-1.234 6.23-.785c2.002.448 7.453-1.794 7.453-1.794s-6.786-10.09-8.788-9.867z" fill="#D0CDE1"/><path d="M42.025 17.743c-1.857-.889-2.65-3.131-1.77-5.008.88-1.878 3.097-2.679 4.954-1.79 1.856.889 2.649 3.131 1.77 5.009-.88 1.877-3.097 2.678-4.954 1.79z" fill="#9F616A"/><path d="M39.829 15.713c-1.748-.837-2.494-2.947-1.666-4.714a3.484 3.484 0 0 1 4.662-1.684c1.747.836 2.493 2.947 1.666 4.713a3.484 3.484 0 0 1-4.662 1.685z" fill="#2F2E41"/><path d="M37.569 9.31c-1.614-.773-2.303-2.723-1.539-4.355A3.219 3.219 0 0 1 40.337 3.4c1.614.773 2.303 2.723 1.539 4.355a3.219 3.219 0 0 1-4.307 1.556z" fill="#2F2E41"/><path d="M35.392 7.67a3.294 3.294 0 0 0 2.476 1.675 3.22 3.22 0 0 0 1.517-.182 3.19 3.19 0 0 0 1.257-.86 3.19 3.19 0 0 1-2.153 1.44 3.25 3.25 0 0 1-1.328-.047 3.274 3.274 0 0 1-2.08-1.587 3.28 3.28 0 0 1-.401-1.274 3.24 3.24 0 0 1 .14-1.323c.139-.425.363-.816.66-1.149A3.222 3.222 0 0 0 34.985 6a3.275 3.275 0 0 0 .408 1.67zm8.142 7.369c-1.53-.732-2.308-2.31-1.739-3.525.569-1.215 2.27-1.606 3.799-.874 1.529.732 2.307 2.31 1.738 3.525-.569 1.215-2.27 1.606-3.798.874z" fill="#2F2E41"/><path d="M43.752 16.123c-.327-.157-.383-.732-.125-1.284.259-.552.734-.873 1.062-.716.328.157.383.732.125 1.284-.259.552-.734.872-1.062.716z" fill="#A0616A"/><path opacity=".5" d="M70.904 32H61v.576h9.904V32zm0 2.591H61v.576h9.904v-.576zm0 2.591h-5.598v.576h5.598v-.576zm-7.177-.864H61v2.303h2.727v-2.303zm7.177 9.356H65.02v2.303h5.885v-2.303zm0-5.901H61v.575h9.904v-.575zm0 2.591H61v.575h9.904v-.575z" fill="#9A69C7"/></g></g><defs><clipPath id="a"><path d="M0 0h96v68H0V0z" fill="#fff"/></clipPath><clipPath id="b"><path fill="#fff" d="M3-4h88v86H3z"/></clipPath></defs></svg>woocommerce-admin/images/onboarding/fb-woocommerce.png000064400000003305151335517650017166 0ustar00�PNG


IHDR�7��a*PLTE����������������ׇ��Mi�6\�"T�K�h�Ed����o���VIDATx���o��g�~Ҭ
����v�,�!TJ�P%j�C*�DP��d��u�ֶ���{C�6$K��D���DS�������:�v��T%s�7~��w?��͒]X��]X���^�����%}ǻ2 !;�dOv���+�[�1	oIB2%�ʠ�>!����i#����Զ	�$��xq2�d���6!�����Z�ŵq�9�g�%~��M #!#Xv'�H��{F\��#X2bH�iŽ'�5D<�P�Z�!�t��jm��6$ن�%a=��.��'imK"�H�0�($�v�$S��Y�LCܒ�'Cۑ������%�N��Ճ��d+��TX.%n60���LtF��y$EuT����S�8ȣF@��q,��QsJcy4�=�e5.E�I�T��kz��:�Cňq���I�����L�d>����<����D�K��ʰ'�JW��E�wH2�&x�9��	���r�ig�:@�[㐃�Ꝡ�3+�?,��c�_��P�U�A��6S�uY�k���lnqaUJ
�e��%,�w�Maa�2�=�����)$�Ȩ��CBT"��ŀ$S����$
��R<������p�{�ˍ�_w�:�M|�[yD&\�Rޘ�h#_2���xlD��}=n֊�n�?U&x�4���}a����z�E��:8m3H��T��Kki���v�E�I�<��h�Gq���:��a�J"5���l*q1�Ĺ����l$9w~�I��f� M�m^)FΉ��G8�i�E�$�p�;҂E<0	mS
5*9��6���b�wf��.k*�$����FO|p�m�1Y�Z|~A�GZ�\�=�B�L<v'�ipf��.v�l�ȉW&T��U�~7+�L�q���Qwf���|���o���/�G?)�%x$	
M$o��@Re�y^�P&��K� z����&� �@�K�e�+��%WhB�P"M|ib���h,I6�dy�rhB�p�-�e�5h�UOY<I�Ӫ'(e
6��Z��D=��<���#��$�$8?�L�'���g��H�2�Ӊ�e��Q���l�T�IV
|��^
���	J��;c�3Lj��W=���1�á�����n^ǚJQ���S�%Ir�o�g]9�؋���.�O����s�*��h�r�<��S
����b����҉��Hp��:4}�	N3�Ÿ\<܂��K���d��� F�3*���QEU��<ࢢ�E�5��|�����=���U�)^���,�9~,��]�Q�@��7M�L���U��B�Y���>�(x��k�O*(_���7+���y�*ѿ?����=c�$��C��xu���l�Vf��g8+W��G�Uo��6�kW_�{��b"=�����Ǿ��s��o�U4�n"jI�4M�k���k��xV�^�/�&�'���s&�l�
nbX�n7�����C�:R%�D�Lrv��њ�8��̟����_F�[���E��'ToK�m{��t���y��3�uR%���gЗ���[�xQ�C��>7�K
�pݫ��ԞN��U�YE�`��3�\�p'@60/��$��ZE'S�l�e�4ɐ�2��v�22�ƾ:�=@�6��	EP�ɤsb.��t�d\�Įgb�L'�\
5r��IEND�B`�woocommerce-admin/images/onboarding/other-small.jpg000064400000223470151335517650016514 0ustar00���JFIFHH���	!"$"$���"�����Q�[�Ī�<�Z�M+�V��N�<6�N�`�Bp���㠀8�I#:	�|E0$#�+��p+��-������ϛ��ʀ� N�gW{P��|�Y)���U	]١l���R�ZA�8!09�:�A088 8	�j����!Tjp���8+,�R��eF��2F[?��R��~��hL�HLB��9e�N��C����W[Gf�oy٤�v_hD ���Q��:@G���d�k.U�)[�ʠ�y
�R+�p;2���gdҵm���U��%�I�������!d��Im�Y�:2�$8�)�M������g��H�zn&&�@H�@tpt�4���&E)�z�(�f��[�9UU�9X������k��m�Jr�B5��l6��G��߈~m]�H�n����Oj_�a!ŋV钨�ˣo�֪��5!"`�y�&���s�n�m�)_|��DZuJ������F+vr�8���"JS��m��$9S�vi}����W�B�+�2��:LzvÍ��O��C�%5�m��]���g����j�u#$@L�C�@ � q
�]qC��$#+5[FZ�n��JrF�f+���ü��J`@8+�/�έ8�y��f��9�Q)y��qd��L���mF��Ql"���F@D�J!$C�@�@"�J��
���8E��՚�����	�Dpu9h���vd8
��:Z;b�N��|#�	�;y6[�fbY)���«��y�[T'�ӹ ��D�`N8��F��I�_��*��P����vr�k{gf��S�|�d�!�i�
��{b��vΜVG�؄֥<����C��S_��Ü�vέ�y�i��H��DH���#Q�Wʳƾߢ`��'Nj�AX DF	�r��Y�+��	X�&�!�R��gʝ��X�88�a;.9��<*�qd��G-[T*h!V8�6zz	��"�2�!�v�D���%��P�9�v_lθ�e�c�R�	�D�Ҙ%5����&;j��"��>�r�r��_;`��DC����w��b��OU��HԶ�*�r�p�z};�!PD%0�����]Y�]��3�qn��f��$A�S �����VW�x��;0N$�-B$8��_s��v�_-JZ����*�ӛS�M��������L9]Y� �92 )�5Q��o���V�x�&*JhE$��M����`Y�Շf��,�L���B}Y*Z4FJ�|�`�|�Ik��j-�j�Q�j�{�|�\�[+&�?HM�H!$D�$@5UUU�E��tYl��n
��L���B%�t��8����îs�w��Q��U'&�m��a-�"C��I��jJ|�U�f�QOo��k;;-��Tf��ri����� �4UUQ���Y����lN���¾E���[�����v���&�0N<�A3�T�8B6�W�Zĭ�e��p�HFQ�DeOo��vv٫v�3`�.Z�p�$�$ ���B�F��m���VX��Tx\�Y�����l������ Fu�`MX�E|�%}_<!Œ_�jQ��T�U�7vl���Yn���nly|�3��T`�W�:�iL�B����O�o��睩l�2���g:W��ا�@v�h%�D��w�:�ӇN;�4r�FZ3�Y%��4���T�B�)P�wL[}���/��4U�>g��`��W�&X;t��UP��e�E�Q�a��؎�;`tr�A�㼩@üt�2	�>�$�����qbW�S�Kj��W����䌯ӳE�>��=5��E^��y�3e��p�Bh)������C����U���ub������P�QJ]��I�L ��ˡT.���Œ_��y�NH��Q�����Ж��/l�~��ג2G��¨��O����x����;�L��*�w�>�����8�\�uC���1NL�p�@	��B+.g[~
�����N�Z����J2�~��ѧv�n���ӷ.kl���m^w��{��$"%@L(���v]����ߛ���b�_ ����:pG:�H�� >�_b��;�
�I�M�����N8���?O�����sw�}�d����j���3UWa2\�|�'�'���WT/�v��ߏ���xl�	$@@p�qӝt�d B$��$�E���V[�x�_g&ˬ��Q��[UV��#(O�o�v��7��?C�/��Qep��B�m��y�W��P���#��d�Q�S����V�b����6e�	��&�����FI�&@��T�����vrl�v�R�9Q��V�*J2�~�������w=o��e��~w1��j�g�{����|��j��;�t	��
�і��;5z��;q�f�a�L�`C����M�	�O��V�}�gw��s����;V�MU����]���]��?;���ﳞ��{|�[����nQ�Y�C�i���|�ESXptp�#.�c�uC�i������z�_vP"	#!p,H	�L��	�݄m�FV�XD*�rj��N�FTQ��cˏ�\����Y��~cf���ه��><&�6K/�o����<��~g=�՗4+Y]���&c���UZ�b�W\6���Y$���Ț �X��0�ݪދ����!��պ�%��b������J���oݩ/k�=j���+���<�U�M�z�g;����]v�&�Z°9��&C-�E}��Jl���&��ʙ)�D��*�:��r0�TX��sA��8_��vӗs�oӏ�Aߣ~�?�-���vQ�3�U�w��?;g����#�x�}oU���@����v��i�z����?j�`��]�!���S$@HG�{����A[5���������r�O�_ў?���J�;��|���n�S�6Cc��}[��</���Ov^w��
�9�h͖��	��v[9�D�}�h1D�*�Y)�$�L�G�
Q�C�C��Mڵf��հ�]���Bu=?ҿAx_
�z~����R��ޏ�ˎ?I�>��w����뾉�%�+�w�se��=޷�|�0E	�}�{�'	�"�e�;;R�J`���}����G�V��#�>Z0��SY}���	c���g;S�3�L�1�w���;����2oy�u�g�ޏ�(��c�~R�[�}����
��3e�B�R��#e6���H�r���#Ue��Q%HL�P��?Y�/ɼ��[+�����M�5���>vʕ�y�t�K�G�>[�0�ޞ�~��_�{W׃6�Zf}���Ï����^�7�@ Weta˙
���@��#�H��Ŗ�U���gj@LI�����O�� =^��W����SY}��$�\��h�T���>�l�ƪ�_������|w����a��&�Y'��x^=��������VL8+l˳%�ƚ-��dҝӅ5@�Zũ4�B'�����]�"��v�V�G������M~���ʉU�Q���j������o�Ͼ�/���wU�`��X<��>��}OV�x^O�����>�o�ӝ�`ɇmٹa;d
v��&Jn*��PMj@�@LZTY��E�b�Cc�V�G��M_%l����ϕ�զ�y�ڥ�}�_��Z�����7l��t���P�~��=oV�a��?���>�o��9�]�ɇ{#fa����u�	������'���R�k bWrVrћ糦�Ħ�L�Fu-�a�x�#W/��S�?�s�a�ӻ7ۖ�5y�+��Ϣ�}J�G���{���x�w��9�
ņL8+���#5INA0i���@&UW��r��Z���zq��I��)��Є�Zs���Ǖ���&?���.Z#wf�r����>��}���<���X��c�a�?�r ˏ5�<��!NBd��7��"@�,���UT')�0�;Wgh��!8rĦ�|�7;U��=�'ǫ��߫�o��?���G��=�W����>���J����~S/��6�;�,}��Tc)��K�֔�M"bA)[�2Јg�o�<X�U	ڔ�H�@n�
�mwa��9�e6�E����/a~���ϗ�>f�{=ON�&��������z�`�ǫ���)د�e�[jQF�,̕��iL=�b	��	�_o�O��_��H�UBv�0����Zʯ�1,�Ө�6�[��=r�6�����1��Ϋ��zޞo6Z�����lߖ�>u^���:�|���
�&<u�n�sӟD/�	�h&�a K�˘L!�П�j���Ρ��Ju{Wv}������Zj�dbX��������c�����u\5���?̩Z�l��U�r����>�W��)X�@
�a�\�]m�mBr�	��Jb
���,���sO���*����`�B~�验����qe��7B)h��j�)B_y����|���΍nn�����_S��Z��[7{��_�|��p+�;VLx딭�*�^�:	�!4�LA�[����=ߌ�GÄA$B���%��坪�W��Ŗ�uH���<٣��,�Q��~��x_�ߏ��}��w��V�"�;;lٿ���z��g��`Ҭxr֒p���NY)��S	L�_*:!K���e� UIh$�z��S]���� qd�ע�i[	������R���=O���V?co����<��%8v�lٳ�>�W��7X�V���r�	o�T	�d&���pٜB �
�KD��@׻�r��w�T��~����*�E�;9WT�A�G�|����=c_��y��v�C�m�M����y?-�|�;��5y���e�6#�')�N�Jb����$@���(���o\�;�"U)�n�f�e>N-�g�e�7鞏�|�|pf�C���|��_m��B��z���w辚�+�<(8���|��#��=o&U� N�Ja}Z��$@���$dD�m����`�3!5}���;:I;�R�;�J���7�:�c��4y٠�=?Z����N��X���g��Mo������������k�`�j��	�d')�S�;|�H�URZ� ��T���f!:�4��h�2�c�U�ʔcT�H�J_;�x-Ãz>�'����m��8Y~횷z>�м����4��~���㟛����y2�L��Mh%0�+����:$��H�UT'l�H���r��<�h �f_�Ԫ��{�v_*p�2�/����e����~����y��'Nh8Y��v�O�'���*88�?]�ߛ���<,�%-Q��&%4��)�7Uz�[$�*N���	M�
��r��z��ʧ<*�9`Ӫ�DC�J?M�)W�W�|��Qn\ʬ�}����o��D,�f�[�����?)��0Yو[�u��~��3X���j��"�"��I��o���nZ�W|��*�������ݜ��I8Uj�+@��J%V���Q�Wg��U�?
E�`�Ug��K��;~�z s���4z~��{��SǪ�-��P�g�o��y9%����U�0Jp�S�r�Vh��4'�.���L�<�Qj/ZB VYm�{�+�Ŋ,%n�&[����F��o�O��8�_������O#��g��I�m�z���}_�xTQ�ߣ��	�a�1�^͓Ϗ��Z�Jp��o��VF]�t��|��"���Ղ�U_m���$yV��O�X5j�[�.G�|�j���D��~*2��e�>����~�z+;9N�l�?�����l���UQIF<��w{^j��sBi_}��{eS��M˖�(F2A>l����B ��;.�@�tS�U�]>�
:�U�H�/���1��</�G����GՏ���Y~��')�;v����ߏ�����+��UY�N��e|��E��V���	Ȝ'˹8t�d���?;��-!UIj��	�M־�:C�rėߡ_*��[S��<�s΍�e�W�?f���G��U�x�i�͖��N�m�O���vZҝ��ERW��u�o�UV�>K�J��fBp�Glݱ41�1����x�h-AUKo��!8&�"Kֶ�uB0�D�%�ڍ-����<���K����%�c��G����<|K�أ(�M>�Ӫy��e��+mղ����[ս��'
KP��%/O|��S>8��#)��3�@�Ј����Q H�A�h�j^�^8B6����j�h�^�^~a
�&�8f�r�[ث��3-�Z��u������.��1�:Li���4�_WB�_;S��gi��iMU�7l�˛,q��r�rܽ���P�p�UR��
�L�!8"cT#RүAN��}�qU��/c/��DJݿV�a���~���(���*�_�}\��|�4Ye�����tN^���ns���n�V;c���K���=?[T#�8pt��t�f�_M�����%s��ᄦ� ���UU@`@n������-Y�/��3����a��W��w�:3Aގ�������nϫ�=1�~3��3Y-
��W�~�3n�\m��z:�ꪯU��Ѳ��ў��rvHw��Y����:h���g��sݟ���%4T�R��q�=�J����@�-��f��U�jK���ԮVwg�v\�7k�BK'�;>��=����}S�*�]`�f�tr�Vl����k-�ztyy���dd��t'�W�����E��_Ϩ��z~.�'����8��
�[|��WXY�nҥ��_1��R��Q(���珛7*��h�uQ��f����.�=ϳ�!�u�l�UTm;윮��GE�j�J��ue�*�-�]f�-�5z~W���yw�ǝ��<?��_c�?<��������2�
�[z���
��=]KL�b�9m�ٯ��k�Q�΢0��.ݪ�jl��4[:�l��o�bx<,����*�(&=5V�ے�l�h��ه¡�2�+�J�9+,�l�+�_��/��f_[�c�#�^V��=��e]���S�SB UK4O=�,�tAT�C/���_2��w*�K�}_�a��nP�f�UQv˳��*��l��OOef\��r�UB =������ͧ�]�X�_|ez�'������_������0��|��
ҿ>����^f�?�f���3X��@��kU��+b�V��Q��s��]�]q���jK�m��(X�f��������SV�W��W��r��Lh��}O��UX5B-��Σ-��]a�џ�a�6n�c�{����̾���m�����/�{�eÊ��~s�sHD*�f�Y��,�m��L˅��ά�\m���C�a��k�(,���^8���ݓ
wYLt2cl�=�N~&2,g�0�O�~��n�{�Cϫ*vl����B�����|�[?C���?>��y7�?�R�<|��>��|,"SB UKu*�ՀVY��2�@�ggW�Su=B�gg��y�勔Xh�7���C��_�ή�#��3O��{��Ō�fG����;�ߦ�;��k���U/��7�>����~�����ΟC�:��SN�]�����@��kU�5���
��k,�%2�@�m�~�WG����(���X���͒�%�Կ��D��ə�����O3̢}�i���
���Œ�{�-�u��u��=��oa�)o�}ܜu�p�1�К�~��o4ZB UKo�Y�+`
�+Y���O4vv�kWg+�w����|�(�ڪX��_F*��W_��b���b���}<�&2�N�UTb 6zO�T��|��w�*�|};�#���k�4[/��,^���|��2S�\�P����(>��|� ZAUKm�Q���XXXzĪ�cn���/�Z��\��x�$h��R��Źq�	���LJ΢�_|r�^��zq�<\xD��$	��~��!U��}�m�?2�S�~�3��-�>S����~cf���l�t�H�{�U�!�U�|Qi@UB�F��X
�Wb��Ċ���f���m�}���;;f�O�8�p�f�cۖ:+A�e�f��ۭ��^�fo���t	"&i�>����_�<��5�O��mZ����OZ�;���F���8N�e%A)ϑ�i���xb�PU���F����+�X=�I�pf��gi}�We|�Z_���aܰ�*Y���#E��,�r|�9oէ��w{����)�e��4�����U_I�o�T>���!��>�ԗ�W��i�\���W�>Fy4C� �2�J��|�����j�UU�`
�����<� 9>�(ߡ�����y|y�=S�n�oU[O���Zui��'���k�O�|ǙD@��?����/v^�y4H���zoܣ���7]V:��M>u:�-�B:w��8-�Q���T�T8X�{5����z7��)�֍Q��T�ƍ�y\#-����=��|��o�=�ZQ���\5$P�JG�z~���2��}oڿ��~u}�ƭzv՚�C�L�D�Q��|�ͣ�c�g���������8�����+;�Ԅ�O��~���%g}�w=S����W[f�p5z���?7�Q�{�c���c�#Ҋ;2^��y4��:��~����?4����5zwS��L�K�=��������W�"�O�����)�DUSM�s�YX��o�Y�y�v�d���c���{��#AZ�ގ�Q
9u�>ǻ��o���{����0a�Ԫ �8�����>�xpl�#mUW+5[%]����c�K�_�~���C�}g��ȵ���b�a?��>��!N��i�MUV:p���*r<�:��)����r��Ww�`�;
!8r�ތ��d���~��>[�q�߫nl�/��Q�����D}�Gw���c����ڳ�e��ȡ;}����!���'��ϯ����I����J�E�C��rJR�\zt9�2V�J���t�+,��V��,��D���]��n[o��/ό(��툄'd�?O��c����{��S���hU�|�a�\�}m�m���+�D��E��5z>���G�||���+��M�?��>����l����~1�[�9�O���D����뮊�uü+,ӾQ+Ug�Bu����+�����ga�(��6��j�~͞���f_������-��m��~���������O�<x,�|Y`�U���~�N�hݺ��{�C<��Z3`��_I>W���_��W��yy�����-��D�AUU���l�UX�θV,Y��Z�<�,���hWeUZ����=�x���퓾NwV�gj�����%��y��U��N�~��������_;›a7��;�y/󶭿�L�j��ݢW�W�$�O*sS����[F|��_a����c���~W��پ�E��Q�
:�e�:���
��dJhjЭʭ�eg��~J9⌓����o͟F��_�=ۭ��uYv�Y��M���M.J�����?<QW�}�p[n_��')~�/3tv{�O��}/����D!Voc�m�
<:��|}Q��E�M�x�
�u�(�PǓ*�T4�U��p�p+Xv�P+�y����-����
���l��w��3�ut��5[�r�ޜ��禌xm٪Y�[��V�Q-��<��ޫa��|RE_A�4K��|t�o�K�?+��{���l��|���x�:�VS��O�a�l�??_�{��p�/�1�3g�}�ǨS�5L�hi��EP������Bu�����-���*B2����ˇ4BuuZ��9�m>Ź|ʷUFwh�Z%�q���zn�<��*�[_��e�-���Tc�+�M�߻��>���=�����o��}�����_y�q�==�/��*���~�_=�:}=jz�&̸34뮊��i؛���<��Ö�,�[����s?�DaD'Z�;el�;=�r��z5��n��=7h*��B5B{��U���y�[�^����I��l��������ϵ��o�-���O��<'�U�xob�*>/����߰��j�J>c��^:{6x_7�վʻ�e���ci�UY�N.٪믝��[h��5�-m����k��,�f�4o�g��t[�UT��UYoaTe~�k�W���r�i�`�;Wu��_�џ<R�?�c�_���齯cݏ��Ϸ�z3JV���x�}��w�}����|Ǜ
<칬�|����mHFQ9���|�'N���p:pVh�.t�N��[h��9RӶ{�x�{Meu���j�P�v��F���iOl��\�e��T�_�Q�>�w��������|6-u�~��g��?aG�U�'�Z���Z*����˳�y?o�ox�����ћ?���ڕ�k�Ǚ�ci���8�vv���#�9���岜�e�*JhY�|�s����a���`�3e�u��0��B3��u$�e�^k>����f!����qʽ/c�1�����kO��6Ư��ϩ�j�|�tJ\�U�e�����!S��y^&�s�ת޹OD#�����f[o���C���}�;ڸ�pr�R���ojZ;�|̱�eu���.�d�(�{�g��l�FIL��UQ/��|,�m��`|��U�[��}?��
�;����UC�-��M���ޟ����g�c��/:���L���TX�F�:�o�Vz�Z��_���0�嶋/�T�c�S��ƪ0�uجXX���Tm�mYjV,���0 �p�'%��n�FiZ�wG�V��W����?��=��;~{��\>�գ���eZ~���+V�c�b��*�|�י��v��!��̓��Vz�]�v�ѧUaS�a����o���$����lЪV+�VƣN�|u�w�_z���aY��=9��J��ux��眭ճ�Y�_/�xV�7Շ<Q���|���]��U�C���{�����,�{f2��W*�(��8pQn˪�B+,n���!����]	�Jn��,t��u���]�Jr�\չ�6p[�J���8O[O���W��?RV���Nj�o�}���_V^U�O���y	O��'��z?1�\�>&�\��W���oyUB�Q�y4[�EY�V]�غ��sV�(�)Mo>��Ö���
�����ܑٺx�V�����FX�s���9	>��]Of����g�����{�Ɯ��7}N�����}��9�z_O¶s�_D���j�G���u��O@<�.�v]VZ�&48� pvb�v��ա���m�J1��g}�3X�V���k:_�8ڷJ�4-ղ�2����Cr�ʧ�}>_��UY���w�_g��}�j�<���_����|)���Y~f��wv_3��oy]q�$�a�<�-�uYꌂbdL�B�B [);�\�j!���l���r�'5�}��S
�	����	��H��n|t#�[�˗5R��:7�2�j�����j�����V�F�O��K/)��gjBo������u(�Q+���
�{��0��MV캪��!�ʁ)�@������[��+�XNs��ɧm�I�hUN���vhs�.��j�`hײyiʄa�:6z{<�ʆ������}�s�]T���#齋k�]R}�AVo���USK�v��d�������'̍�n���I�:z�Ħ!�ZuJ����j�s����+��>���Ԫ����e��.Ъ�򢊣R�N���R5C��pl��ߛ���w}_��x�d~������c�^������媬ջ�:�Fy�)��Ui�19����*��y�_���&*A2������ک,�Be�Ns��g$���;���[��,��e�Y�U��MUB��v��<��
�t����Q$~�譲�sӿ�J#��O罏V|���;)�Ui��[�t�S]���-�vs)�)�Fw��U�Mʐ"��@��느E~���M�����/D�V�n�G��U|��`'����Hٲy�UP�'f͝�NN� Br��^�
#�_��o���~OǮ�4yo��殙¹B��µ��̪�Orw٠J�<��f��U)��y�h�r���r}�`/�T��8BTe�O��+EK;)۷�]5(�!X
'X�Uf�p�5 ѧd�Ǖ"%�^��9��T���{����ւvj�}]��jQB�jZ[+�Q���z����E7>n�E����j���Uʐ�&���+�:��[)<tz�eF^�e�"�����o��£��k�������Z������]�hE$ʒ���Z�UR���*��J�‹�g��w�Up�=q�}���vl�?����j*"�T�n�Tt-SY����M��D��@� _�M�+�ێf���l���4��Oo����Q�gx��j�B��vl�mX3F	�K.B/s���UUU�Sө~:�߻�;h�D��ܵf���fZ�}�~Lo�o��B5*��B>2�_�e�;���Bݒ��`B<����	jٲ�Ff��l���ԧ�Z�+-|�?Uv��`��V�T�UP��7]N<�D�HN�N����*/�(�9vŻ�W
[�������q��:���Ulղ8�����"�jջ̯?��[7�pa�K�v�Nb�+f#��	ݳf�u���x9�?����m �)�g���MV��j����5�]U*��f�˚��D����o��y8�e���Z�j�T��/�l��U�ǖ�����<m�%]vX�^vc��|�:^��z&_;�O�U��T�S"���Mh�0��l+< 9������$e4Y9�����v���b�S$���mKL�֌*����٪�@[j�ޞ�G�j�+�饫��+���NW�>���UU|�0�;�B`����9j���<.����OԾp(��e��E��R�� �vh��#���-�9�->����2�ñ�6�)'�Z��<L�U���`�[�-��UU�[��=UB(&%4*z{���V��4UU��=Ty4E&�C�ժ���*Il�:��Uf���e����W=����������-���fkt�]����`�{,#\��[}�M�G��nЅU����᫇c|ms�eBSY��;4;M�8�an�|�j�e~��˖������=FV�gƶ�K��S�e�J>���Ֆ�;,Ik���-QFx�j�_u���n���Î�C�����W���M�iٰF�f{}HFˇ-b���93y�[�f�#EUUY8L��v7�ʢSO�Ə
���Ox;ã��WV[j�ܩUP����T%����-U*�Vڿ����a�-
>����8����df�=uAc:}���ѺuFͲ��Öݞ��D<�2٧��sKV�4���g�s����;ʳy�r�W�Ӫ�NW�N��TQTa�;�����%�FS��r�j�UN����&�
�j�m�~���ִ�NS@����w=Z%�tz��8jԕ��=3�<_'ϓ���;eU�]��Զ}пF���0�N�^v<�h�Z!�a��^w��Z���W�L�����p#N8�f�Ϙ|2�U�R2��5pr���"�9��G*��W`�:�|��;t��\UT���hǚ�����M�o����D�ջ�ϛ��5F����/2�-t�V�Dl�Y�M;�n��5��[��Σ-�n�h���[�y~fij��N�4��ˢ�ST�"9q�Z����q�0�Ei�>�4%Hvծ���*�5W��YZ��H��gn�㞸�5-Ӳ���SA4"�{:ug����c-[�e�(�+�kև���QBkl�5#UQ���n�Fypa�Gk/�]}�g�4�;
���<���A9_���<�]���
��	[(�EUWD�"#T	�O>�d	�T������QTs�΋���w�����B6�ݯ&�Њ�U%~x�%~�Nܾv`ѷ����y�m�|��o�1���-�˶�;N�L^ud�o��C��n�^_�D�*��������ӣ���
*�T����FQo�>w�|9|�&�2�S��q�Tߞ����tmWQT#n�����R$�U+f��2�P�������f�Il���Vj��}��El�UT�A4l������t1����2�3���D�*���:}=�y4�/M
2�D"����!ǧ�6������	��vFٷY^
S���Y]�wB�ڡ8U�vj�:��v�[lj%�T"%;�zv��",ջv����)�	�VR�Զ��F��`�O�l0�J->����0���h�j��?
���_�M޵⌸���	�DA�N�ms8;�A4�Jk^�(�{��pQ�V�e��lЊ�[5j�j���4#+f��IF�[��K�L��}Gd3/����#VX�)�]�������a�R�y�m�<uzv̧��	����g��g��~�̪�R�+ˇ-@"��zu%\�����~w�V��7�n5Ul��X���u��̄j��l�|tD��F˥�j�z�����P��WEX�9N�W
����T4i�ynբ�7w/�����G΢���W�t����U���Wl�4C��W��F�F�f�F:"�8zp�ok��2��߃��;y��G�T#T�pVae���UU������e;.�����!
�'-^����S\�Z}�Ǟ6��E�#��zJ�_;l�ÏW��^uWߎ�>�����̲�.��m����g��۩���6\y���p�B�1Â�M���w�ejR�ٰw:�j°Y�'m��������q�壱�;HC�'T*�	ۧw���V���~�x�p�#��2�v�zp��,�4B��O
��W�|�|��՟���N�N�g���:�6Q�6z��Z�zU�J�����cf�_3m�^��vj�TMXVó�9M��6j�.:Ų�+-
�2Us��O��:���Y��~���D��m�E}��uI9M���l�5���~�z:�S�f��uW薯Cѻ>8[|��芬��8`,Yeo^�E)ӏ�9����������+��UQD�C�`,;4��D�f�y3f���D��
����}OM���<�[�u���m��Qi�4Ne9�F*e��V�6���f��3�����<�4_f�GўqӾ�~~Z!Z+���PYFW�7���CDŽ����a�*��+`�`��ON�4S� JeIL;�g�X�g�����(��3���f��뢫o�en�FZ/A��Y+�ܕY���Z4���=�&�^f[w<�:�o�W��~v龌8�և
���$�+�s����y}>&.�V��w.l�f@�hT�`,�2I[m��=SB)&
��	��=:��2���;v�ݲu/�5F�z���!V^9\4�c��6�ލ�vl�I��2۱�`���ٿwpa��-p�����������+�d�+}��f�TҩK+�vi#œE)�S�"@�UA4���z�y�fkt쇝�ݻ}��!9�nڍb	ӈ��oi�1�w�o��[7\�^f[v<��}�7�y�r�U�V��%<�p,��?�����K�fQ�'j�9X���iߦ�<�ud�� LU�7�~�^g�M�o�i��}Q�Vs�|;gy_'N:�����v;}��{g�q�̢[����v�s`Ö�pV=z�����}�o��D��n�s���/�s�]b�+h�}����o�7<J�;2S	DI�T9�vj�8��(���e��Ob�;��v�\��&�(�l�5`�ݾ^v�N�*�7��y��}�-�ltC�`e`�D��p\}׿� E	�j�YTTjUU���X�G���V_��h�U�	"Z�Ѝc��z>�.��ua�S��{������V�U�6v�;'Ӈf�Z};��ez4y�ev_l�Q+��E�T��>�ݫ�!m�Ӧ9h�5F����Ᵽg�~��o���^f:��tVSA4߿��*0f��z ��ގ�,�s��oy�|�Hc͖Zvk��5[)W_uzz�]w�9��2��)��,,C��z��V�
\��٧����
Zc��Ђ���]a`�+'�}׵�Y�3�����䪰��L����v�G�ԫ.<Ӧ4-��6l�m��-���f�>W��9#~�OD��˯O�G��WjqX���0�R�Q��j�Y'�ަO�T�f���Tc�j�VX�VY�_S�z�E^g�2�;l�%>#�nݢUUFHF��+uiէE���\�^vk=M��-Ty>f9�j�7z���U����`����e�S\9X�Q��M���������4�.hF(s�Ƶb��
��-�C:j+m���j�����1,�}����TZ_�f�6��J}�^ez��ɣV�Q�����toӏZ�+Xvv]Mu���`��/?Hݏ�TIEe�=aʢ�eP�d8Y`ٻѽF�aDD*���v]�2��5E��ӫT�9MMi�&��]�<*��?;�n�<����`�̔�]u�s�ԣUV�o��F�?��FIԶ՞���*�B� X��k
�ae��	��;�;%UT�3c�TS�E�v�@��/�S��m$ ��_.�>��9�?�/[�x�}[=]�uUW+ee�����z�_O7��d�>�;�	睓_��̯�ԅ����Q���,Ӫڨ���۴*B�ek��3c�]UJp�=k'(�1@������m�U-��>��;�j�|7��_;
�ރ7��,kV,��V��(�lp��w��$#nu�����F�*�v�k�YΝ8�Y���]TUF{w�{�V�vM7*��`U]P���j�1B)٪��/�|��}�v��~e}9墌�z;(��5]�,t��!8�ן[)��?'�:��r���g�Ʀr��C��VX�QV
����ز�3/wz���E;x�jET#Tj�-���<�-��a�N��Wf��5Zte�j��<���`X`�{?2�S�1�|ARUNS��/�+�U9X�Ê��X+��x���|�+d'd�&B=�j�EP�7{2SB0N��T��:�Ƥ��Sv������`,
�􅽟�[)���4���;n�o�W��`V��`�R�Up����)ڒ�ZI4���@�٥�)D�y�v��!Uyj_:����,�
�� ���p岷��? B(NS����
��u��W`
��k+X;0I"r��)��9JpEV�;5UDI��5UTeoyUu�,�`WaXR+y���-�����~P�P����,��i����X:���qْHNIȵh�)Nò���(��0�c��'d�\*�V,V�Z�σ�-�����!'+g��x��=��,]��
�+��ڄ�#�0����r�j�����檎��
�X���ݎprԽic���T-����x]�5N�Ŏ��``,���Y}�Y��#]�a�C�:��)�9�N!Y|�EaX�V�&䣆��eE�y�L�g)��<X���gmF��Yb1pk�e�h�����_*!�IF$�t��˩�D��v��EK;8T�+z�9'�ZYw*�[�DŽ���y�N�Ŗ�vwU�0���w�ٖ	�d%.�S�
�H�0�$�9\�Ea�ň'e����,�0��e`Q8J�p�Ö�*��}�[l��a��U:�t⵻=���`F#"1�l�vp��xWVj��S)�1S!c�,��������+V=I�6[Vp;4�*;g����Si�4F�N�ŀ�n�F�)'ʳv��Mʕ�1@MdӔ�U�����g�JeP� ��#Y]���k�W]`X+V�Ξ����S��=��m�)��;M�*󫦺쮲�Ŋ����s���5NIFjm#Da��U#��JV���5F"�����,��>U]PX�X
�V��Rp��Ն�%��y�;l����W�Q]��Xgf�I��՞�,��e4���㈐��cH�ҝ�� '5�k���ީ��v:8���,+Ύ:ԝ=�����8Z��[3׿�g���;~�m�J��!;NF2�iN��H�j����4��E�a�t!U\���VîV
�f�jYn\��v��l�![8G��G�e���;�e�*���ҢS%[26�+H�4e���SBpD �Hpt�j��N�b+��+�`�u�.�&en���I���>���1�d�TY�F�I��0���H��hf��DVt9��ggX���O;J��������ڶ,T��H�Ѣ����6�*J`91ć�OH"`Ygg+X�;��aX�`zR�v�5�v١lH#)�y�0KJ���:��@q�q��&B2# M	�����9����
�vhr��Yc����]�``��n<�ó�҉�9�y�U�[mg�xG�B"�2Q� �UV!>F��pX,+�k,C����θ�`��R&��[�vkalHEl��o�T�NV�v�E�ڑO�B���@E9ވ�Wa8B(�.V��V,��,��`��=H����n��kj!�Pݏdʠ�`����m�IN�S�A)��g���B4�(�
ŀ����+�V�`�X,�*OWpЭ�ul�j!2Sr�'%���`�"��+��%4���)���bJWY
�MP�#
�Y`��X�X+s�tp�,V��e`zJ���4+w�N�Q!2S3Ĕ�ԣ`NKUJ)N�#	���$���SO�º���8`����k+V�WaX+t9���B�y�+w�N�Q!4�(��;�)K�����@��[U��QB�\u��vh9ڠF�¸G�+���`�k����X=$/��~w�V̔P�$�١T�!j �B�9dN��Z�jFV�U8V�d�R#"r�H��G��.�Y`V,�X��ek��X="˻��q�u;eE	�Lr�5[(�8q�"�#b &JBrN�6���m����j�#$�)�ER*�A�9�e�k�
��YX,V������;�gh�2�M(v�/�rE(�L�;8r�9��xV@&FS�j�Em��(�m�p�R�5T@U�Ih#ȣā@��b�=.NWwϪw���,�Ҋ�l��L%w�q#����H!�D@�2&�Z�6�F�"U�l%�e-�Ă.��
��{)��:���SL���;z�-!L 㼰�pVq�:�L��B	��;��8NW��P�s�2��F�4U�+UZA8"�**Eā����������,�%i��q)���..$G�}~��U���\J,���x��X�@e�	Uk�;��M��O��TT���H�Ӻ�,@r'�����eA5 �x�I�P$RQg���:�nDg�!D�"�,g��s�e�HR��b�z\r�:�VC43-!`�=;�b��K ��s����b_}D��5�X9Ӻ8���+\�|��	�Qh���o��O0�&/�U�:1�
J��Q*J��W�>������$���;��O&p�5�?Pi%���W4wի�@i����p�I�rf�(Bi*�7V#�.��K&���c��6M\&�(	RB�L�3��q���折kq ��~�v���<�Q5p�J��ö 8�kh�n��@yf}G`:�<	P�
��;bԎh��Bu�l���A@%����A�l@��s�BA��:���L$('>���~���\���p�n�BHN|z���ç�y�	(S�=>��lGv�*В�8����	#͐�<��!����T�B�F�NL��x�U`\�aZ�po3J�DLs��h^H�����&�`X<�4�d��q��	y�^�}�ɐP���Eł,B�ǘF�#��;qƚ�1�y��0��d(h���͞��ێwM	�YG}~��e�X���(��<��G�v�5 &�XN��Gr��sYH��P�,l�4��3���tЀ�痿�9]T�|����	B��#H�\���Gឝ���Bh�nz��;W<��	2�9�giZ����3�@�;�=;qƚ�D�s���2�t:���='P��<Ú�q�pv�t $��q!Rs�x��L�����V�=3�D8��;}�9��3.�����F=s��ãF�����S�M,c;�G�p�H��J�S��Q9G�x��5��87�]��R�hp�bgz��ێ�^z %I���;�e9�z!�^?z5�,t�&���\�j!�n8���M%I��2sI�Nu9iZ�g��}�x}9�3-5	��j�3:��S� %I��Fywl��}��˞�a�]i�,M�sQ�����"
"p�h�����x�� �N]�h�磚��o6zv�*T�4�T��o�ό�$,�y�;ڰ4�����gW@I�;`���2���Cό��M,=o'^��&�yZ;c>�ێ�IB� %��5޳��J)�'׏��Z���(�4���#��;t��"@
�ˑڗ;F�����|o����{��h����4��N( !a�gδ��<�_d��}7'9���~O���9���X��SMs�t�;����Hsy�L��i�3���><-��}~vC�s[j�@<���9���;��@IR��
��jɿ�=��)�j���wG6Bh�L����q����JM<=�z�0���>��^����z�?C
�o;u`M�v��x�4P�@RAsۯμ��x��N�|޺���O���Ϧ�@�ǔӶG\�*�d&�BT&/_�����ߪ���z��m��9}n���.�%@<��8t�;��Z.	P���r���r��w�1�yk[����^6�5�)��9δ�XeR�!A9g�}�<�z<�C��r��w��ק=
@BT��"��n��G��i� �)!BO9��f�Ϗ�ˈ�~���u�F�� J�D��Ѡ�#�}�l�I1�mϦ�̹�5���н@BT�.��9����P\	
H��Y����S����_@J�eP�G:�s=(.$H�pڧW��3h4ԋ�æ�9ճg�E �3�c���ʼ��3w���&��YF�9գ���VBj�@+�Q:�ؾ���U��Bjв�h#��o6z4� 	B�*�0E��W�����
s�f�N�X�J"�y��4�w@h�hh3���o��`�E����
}�*� ) �s@�CA�p�ގg�mK�Z$�I���-�h��h"��X�zv�Ѐ�IR��T�XE��,-�Ї�|����b	��H����p[*Z. F�N�?���ip,HT�`H
������\19��>����,��H���J��"ip\\19�����c�(jJ@Q0��%W��4��.u�H���p�(X�i%9�`
����R�@��s���y~����pL����]ZR��'t�Ĩ����ֈ��c���O�)�+=����!�E��L�1up���idx�9Z�\ds��N���[7m*���ŝ�>t}��n�I�@Ηֈ��1gz��{��r�@����� Yޣ]Z9��(�H	�����y͞�(�\.@��@�E�yt�[O;��K (��ł�@.<�g���5{#���B�@BJT��$Z,"��鞶#��q���,�	��)j� ���]#Kέ�-VHH
[T$X!` �]#KZ8��' (	(M	U�H@YB�-1F� �q�)%��@ ���s��v��K-YZ�.�ZYz:#�vAK�`���ppb��ћ�����z, �Z(\��\w�t��.q`
p�������BȚ�J2��^������k�l<����#�Z��>���H��5j�a���A�$I@V���2�?:�aA`��5�G7�@ 苩�<��^�=�@���w�
�^Q��^z�e�t|,��X��q���MH��,ִ�B�D��H(�%�SR��X��ʦ�	��/ގ�Y	��X��(H)h	��ԡ`p�ը��JH���{,
=�HS@%@��Z�s�SZO�&@$���b<y�A (��	UK\�`T����5"sD�z/$��ӫ{k�zu�j��RP��>{��olg,���ĝ=B$����
�XVp]%I��������^g˘�J�A==A�OE ��.��0��ޝ}輣�e12g�X�����
֊��4L'���z�:=��,0�<�vu
�ΤJ-A:3���uy�te�E����"H��{�@{�$7Y�
_��iX���r��J��sE���H
"�5��1�����/��E��1:>g0I]�H
�!`:e�<5�FW)q~fh����}m{��Evtte�3��w~ˇ�{�Ūh_��3�)>��j��pM]un*A{`�}~N1�ԣ+�P_�&��Ԝ�ߢ�s��W�]Z�T�G��A��Z�&�P�&�ӓ�e iթV�;?9��K�"c�p�$�,���m���ݲ���_8q���+y���&��P�����g'��
߿Q���F�P��`�$�眡u(�?{5���BO{u��F@yXA���KΎy�X��N����A-�i��籐��G����mP/!��9E�Y��_^��$Og��������n���!mP.%�G<�Z������/�u0}�Ϙ�$�ޚ��uԫ��|��2B��KΌE�Y积k|����=Ҽѐ{�:�otʧT��#�l�ȋkW��@G�^y��,��=і���N����/(��8�"�X!�^�Z�!R�R�=�5��������Kd�Xe���?0g�ր������FELZ�i���;=�V�sWFUq*+_b�7����߾(�#K,��p]\J���S��� �u������&��m뛫�-������i`u3�ГVHH��M4D���k]6�y�{?�����)Xo�Ӈ�ƖP�E��jȉgi�Iwָo9F�Q�V9a���5��g���wN:^�_� �4�:�J.��V�	T��izl��4�޹��'n���Ѿ���[�)h��H�i`u�].%V�T��y��Q]��i�S&�w�Ö�7l"c\Fy�#���0�\J��%�
L5�\���2ηo�sq��kqv�K\N\�����0�[%/$HN~t��0
�:cYt�q��we���ё��ß�F�d�!u:�U�D� s��h�~����]�T߯e�4}?�>��no�D����#K�dE���Ւ%I��@H>����Tm��5��Z���ߡ�??���Fm�u(]N�&�(���W#��{Yq��<||���wk���o�O�|�G+.f�Q%��k�9��PH}=z���|ƿk���^�~���H��LJ���~�9G̰3{�pDLS�J�%sV�K�~ܲ��g�ϗ��Ɵ?��|�Ow����sܡ�,�ͥ��D��*u�U��$���t��_;�}��
\?k��?��'G���k�vs�}��~u�-��:�Q>�SI5�D�#:�H)=��_+��OW��_��}�վ���?I�}��Ya_<\e�P�&����Q �ݬ:w试�����wk��?\�~{�{�y��aǐ!q�pC(.�*�Q ŵ���j��p�__�}>�O��1�Z����?S�Ë0��vI�D�q(�!�9V� ��_3�n���>G��ã.(�Ο������?�xq�e��;$��J�Ȑ
�:�t�A����uG7Wg��&\��uתy�_'70a]��(��%W��$��H$*������֮��FE�J��Fp9��#�d�At��$$�Q%MF��YoeUϞ���(�j�����6�����
Q1 
�7O�"B�}K�,��|���i�*�y��d�XC(Z�U�D���Q>�
y�/~~n�Dy����H�L�y1�˛=.2�Ka�:�P�MJ��� c�TO�!"����q�؝i/.���r��3�Ʒ���C(Z��V�e��>��g�����3���`�pZe�����B�J�e����$N�����fz=mB���ol�xwr�B��$�8�V^�
MMy���X�"���=h��є.�*�1 4�'���!I�`��|��q`�X:�P��5㶨�H.��FEJ�I�)����а1�ȸ���C(Y
]�a �K�'� Me��Հ�-:�,�FSV⾨^�Q �՞�%ZS�Z.�-���"c�+)�uq1 �U�y(<���)��X��:��}�~��h�&	"�‰�%Z��AbRb�T�e-@u���?<P�$vs�R�U��X���D�%SE�QM^�?<)(H��,VD�`��y�MR@X:}c%����[$H�D�Q�Z$*��B1�h��`u�}z���	[�WSL9}3�
Z�#��r�FQ`C�V��K�E���J�S�$�XY�%Hu�}�˜�Y"@g����:��E�	�dj� ��;yy��r*�"@�@v/�Kg�g��H�haX|9�y�^�H�R�a�,�`�k���.[�$H(H�fh�a`��ɬ �\M_��Ā(Fl�4�hXg�;�e��T��9z{`E�y��ۋXq`�YAjIW&�u	RxE�E�X!`��RTHXB@x��"��9��%W��@ ���%J�RUq:	H
H"����a�I*�i�B^&@����y��T�T�l��� =(H	��E3 "#02BC@$4PRS`bcrs%5D1a�&Tp!AQ�q����?�f�L��a1O1^�2�âz�Tm�l���O�,����ߕ�����Y���g����|��Y�|a��y�D��XE��0#Y,�)��-���y��,�L`�Ĕk9�lPS�}7���k�ɛy�o6m�y��ař�d��K;���ý���nt�o���o�Y�����X~G����?��V�9�̴�K?���0?*�,%�aa0%��F�%�3�����Ʌ��5�4�0/Ә���r������^�L��^̙����`2b�bÕ{�k�^�`Ul8��͸͸�����vr,%�U�}��efL�Xr09�����a,�K"�Ya,�F`FvK2�,'���:��g�<��z�OM��p��Ɏ84��Ӻ��#�Y�~W��Y�ÑaȾJ���b��=�|_DY��&ne�fL��^�Qg_#72\�>��gd�+%��K%��d�Y��]����'�O��'��?�y����d�Y,���B�Y,���a)�,2`s0#0?!�,"�Ya,�K"�,>�;1JvNĀ�X/Qz��^��D�+��� ��`}*�"��+ݓ}�,&(}����,	��aȰ��*:йQ�Q�<�	d�Y,�K%�`r�d�h�%��d�Y,�2ɣɣ4f��Y|�Y,�K%��d�Y�d��Xeg�d�Y,������E�Py,��,�&a�JÖ�dXK%�aa,��/����x��a��Ԍ�p��c�H�1#��6_q��;>�{��ۗؼْ�W�����2�36f�^䬼�g*3o�TneF�F�d��rY�e���̰�,�yFM��y��Ѳ35�E�Ì?�XE�ń�0%�Y�dXs^L�3Qg)�^���p���j_��F��d�;%��1{z�36nK;r�b�?1gγ����ܗ�^�K>�l�ۋɛ��s*9G�6O�ٹ��~R�g;3�,���/���_��F�-d�+<�lܟ��	Y�9V�����
<�+/�	y��f�^l�<��ߗe�XÌ?�`ed��0<�Xd�v�,9,�/���0���0>��fvv���{g+9��3s?Z�\����ی��{����ʏnQ�"�ϣa�`X�%qyTF-��a�|c���?�XE��L��]��8���/�g+<�����%��`zq��a{spA�{k�;��l��^�f�T{r�o����a�dXy@���a2������J���?)a�e`~OO�Ȱ�e���TyK��}/s���9���pɑge��'��|X�ʎ�׹�>ܣ>�y���,>��wY��IŁ��dg�,?�Fȼן�2.,RT~�G2���/r3ߒ�2��,#2/����`������{��턧�8s^u��09�>�v}b�͒�
��K�����*/��a����ϏS6E���dXeY�8��e�/�{�02aʉG����F�VE����}��>�K��Z_/�XK&�bc/�a�-�*�E��k���a� �5���,>�aʰ������Ɇ��×��0��|֌9|�kMi*�W� vQ�ns/�{���ɇy2Q��J����r�/o�{qg|�8��8��<�8�8��,���,"���XE����>LR������V��/����9|�_r�|�kK�_/��×���͇=l�{s�f甾u�f�̙�/���ζj.VE��~kۋ�e�Xd�=H�����/
3�£0s�Q�f}q��0��|�_/�������Y��C<�p���a{"÷�+*@"�j^�5����L>������.3s&S��0����*�~w��|a���g/�<���l>V�;V"��(w��)s�ȯg*�3f�U^��ae9�ÿ�a���ed�,"�-1i�	F�Q�^���w�SN.�}�ی¯_qq�PjJ�(4�f�
�;#a���YŜY�0�y P��}.Q��0�E����9}6F�kՇ��e��ӧ[=�e���!Nev��=3������R^{l��	�a����а�_/����K�'����>�FnyT��뿕�gc5%�l��	Q�y�g�öa��,,"����<4��a�tݰ�HO|e5���
H�k�E��@�fr��>5ʊ3�I�`�^r�_��w�S�.bf�Z��� M";�g��Ɍ;[v��?�e8�56������sB�X�p407�xF��2,�rV;�g1C������<��Ì9|�&�
�"ù��+=�.�%�k�^�eQ���OM�����%8E�XK;�	���J?b�8�m�X�bl\e���	YA��ʊ
IQ��fq�Q�P872��̬��d��Xd�ɇ��Q��O��V$Ž���!(�
z�}��<D�p�0�?��ԃإձ��t�%@x[�
l��5��q����-vexe|c�_/�8×�_��Z�d^�Vwc�`�.��g��j���������3�XvÑ{�qqa���Q�����Ɇs�a�$5;r�ܬH��������>ʌ¥F��Y��J�;#e�ٕ���y�9a��XE�K	��p(�l��9����/Mz��a��l��a�f�}�k�dX^�;��?�g{
������Mf�.3D����XE��T���|����|�0����Ȱ���Ɏ{<�<���ζE��E�jK��f�f���2Xr�S��F�a����~��A��
O�kF:1����"�&�HJ�k�e4�����>fv�9�β�)������aeD`p�G�`'+����a�*(����\]`�xu�_Fތ3;օ�^�LB��������fl�ɇ{5��_���Vf�K܋ܘ��G��6Js娋>���^l8���f���Ƚ��L�)�/<<&��i0���X`q�d]L�7�2��2�#*Bx�ԋ>�L�d`_L|����T�¬��0��9�,?9��fV��˯O/_+9����Sћ�b�1���ji�����1�{5>8Ì?�l���i�9(^��C��r��Ԭ�Y�,�٨�]9�������q{��:�<�|������
<�yTJ0��*)�aʋ��73g��/n/r,/`E�����*)���ö�"�<<&�)���ʃ=3��+*@"�"�#+�<OnkE�r.���)�/d]��<��@�F*0�Q�J�#)�9,��Xd��e`ego�XB�,��AaH��Yy����/S��pOz������q���3���8Ϻ��F8�f�0�\\�w#6�\^�N �?.�&mό2XF`E�и��̪&v_�:�ԕ��R3s6~%��	F������`��J��,�J0���	��E��t�VoNb�2����deI���w�av/S�0d��z�;�Ԕ}k�B�)�(�E���Ә��1
h���d�&`F+ʰ�=l�ʳ�9��E;�x�8����GoM�F�X`vi�a*2g"��䣮F�RU����� PT/Ԥ3��Y���C9�0��{��A�k�`�`J��r�2�XFJ4��:���J�=@c%FLی���M��eFQ��R�s��0;��"�/o%��ø�ʢ�0�\�/�5�R��=C�F-=��a�����	����/���u�"öza,^�`Yf�m~��k��4�Vs+Y�����d`d�U�\�ү���=��<e����a�쌳��ʳ0_�n���l�z��a}�����Fu�Ƚ����X~Z��^�e��9r.�X�Q���3r`a�7jJ��`^���S/�3l2���>�N��7l4��1D�`/�ܔ�aaܘXL<*�Xs��g�	G�l�/Ԕ{��0�d�>ޜ_Z���
�}���靧,��SS��b�1�5TjrXgLq���fL���*ٷJ��S�j3���*|U@3��YE.^�޵�Vji���-V���]P@M�,43M���?C%@X�_�J�"��FٲY�	�fT�aܘ����н>K�|��,=M5��8,��pk^�ʀ��+:/\f�_f�E{���p�Qߧ>���r0;�)��XL?�0�dYؽ9P}�6JØ��܌�
=Ⱥ��9�%^u���Na~�Gг�g}�g:4�Qkb�05�z���)���nE�d�8�h�iQM�J����L<��5�g_%FL��z7}���#��k_n����J�B�b��ᇡ�l�l��?�fnFmń�.TFm��{�/n3�b��s5��;�,2��w�p�3�ܲb�i�%FX��'	���L<#c���r���g�Ϲ0��a�(�<`�J��W�R�#+��L��(��u�a����,���"ϸ����
3Z�+b�ۘ���,�a���@�b�cS��y�ɜ��iμî�8M�q%�Ͷ�g*:��홖L9Q�Û%9������j���q����B�5�+6�V2�9W��,�����X_~��>�2b{a�S��������������ɊY�lg�;/�;�)�,�Y�z�"��1 ��Vb�Ĭ�3�,�9Ŝ��a�b牌�	YRZaf�a)�d�w��ی8�_}��	Xg+��c	�c%�g�0�3������1O�賒��g5@VI�4��)TZ����O�S�Y�a�	��Qb,0d��I����j!~�����v�����xcӌ)����a�������6eO+6�Vs/�|��͛�2Q�%{��ι�t/��.�N�S����Ɍ�&8��ř�J3�>�fÞ&��TTc�o�$�,/�a)��Sdey�bG*1)O^fɃ�S��3�gv0r������&b��KQ�^Ƀ�E�T$4� _1�����d�U�)i�����`u&x3��EE�Y�a��Nf6-�zr�g/M�Z�A��5��t�T�Z��ׯ����=;'p���XJ���~K72^�e�����S��Ü��W��|���ȳ��9�\��Ԙၳ&�r�ˆ��8>�l�)�%@Lcnc�)���ʠ�6|���2��n-&r��.�2�h�=fz���9Q|�8�=IF}���J{�%��i���
r����� �7�4��Ȼ��NV�	�}U���Ì��)�^#OK���b0<A�^��0�h�m�fW��^M�t��[�IQL�Vض-��g�VK#�>�֬�]FP��(�s�(�-G���͸�͛q�دvK�V~�G2�ϕ{��s�~�L��}×���,(�
�[&8}�<���72���0���X�9���=r�%Jp9e���r��V:0��)��}��d�0	y�%^ȴعP���*d��N۔��O����;;w���,�s9Q(�Q٩0���mr�l�)`,��1�D��Ȅ��5lg����Y�Q4�GH��j>�0�3?���Ӆ%x1�A��T$Μ�[���!XE�L��X���fØ9�X�s���
?'�>_]�����V~�G2�ܫ�Ö��Ƚ���"�����L�ɛ�p��������s�=6L`%eX���=�YS+*c�E��	F�����þ,&�+,�8�	P`l��ö�����q�g*VɩS�9�T��#*o����}�����S�s;�X�Q��:�{Qh6J��la���=L.���=�6X�tw"��Ş�%@���+<���g�d�T
a<xi�b�q�`>��o�2��%{'�q{yS�Ίs��r�o5�vX�Fnd��F`tf�E�j�7"�'�&ne�{�?��V.VL`�f�LP�RS�[�#+%eaʊ�ÿ%�3�fĀ{�*o���gSde}����e|�7�3��϶���)���E��3��ʃ��L�2��XJ=��Y�Y���L�)1C�'��*#3������y������槲0��,=�8[�������`Y����OL�)�Q���	F�<���@?"�0��*s0f����"��4�RcC}�g+og����a{
����}����3s�{|��/��ђ��E�q�w�\`/,S���=�3s.���载9Y1�LAײ-�X�*y��;����.��.T�,��ʛ%EI�Mh��_�`{`��d�����S��|�>本9�p��L/�(�aaۋ��g1C��P���0>����QҀQ�}_��_`�9�5&u���.q���K���G��HV�f�'���5�#Ql;�[,�	����[=�,��^q�g�/�.�gs&����� w���X}ߕy����a�NT�M��e�Ë�܌��˂ös������s��(}��@v,�g[&�g\`r,�S��̖�TfK	���ö�=�"�w�ɈrVLcp�8w&ܘXO�V�b��Z�>��TFe������?E=��l�V��G��:��M�2°#��l	O{�������qq{���&m�3p���Ö�p9��Q�����P��D��+�i��#73s.���p��ؼ�M��J��8���Ɂ��S�Xd����Y�_*��+:y��p&��NQ�_B�3p���& fk9X	�p�8w%X��a0�y����>��P�a�9Xy�r�|a�K�a�^�5���d�8�C�¡��t�`l�P��/Ma�3zl����pc?��XJ:cG��b٨�?�����0?�׷.z����p2�6�79�0�\^�K��͇��%����Q� &(��ܲ,�Y��3f�/o&�c72���������s�L�9*����ʰ�a�#3s6J�Ξ`[�0����(��0�R,�V�0ԕ�����a���&)15z>��r�|�,�a�a����
z�1	��k�
5���V/�ffL�
@�ە}A�}��~)f�n/��͚k�_8�`Fp�4�)�o��u�S�e�>�K�b�s�>e�*�8d�̗����&t,%����c��ܲ0����E���Fne�a�O��|��5��1C��4�0��r��\���	FȰ�8��
8�F:T����`L>�4�S��:��<4��nE��ex|g*+����b�u�	Ns>䣞���Ø����ϣa��_qg�0�0�S�@��Rˡ��z�3L��`R�ר�g�S��^���	Q���f����	���R�l��f��*���<x��	��N�5�*8J�NqG	X�\�(�5��{a���6�b�"�����׷)�:9׹/3������@��"��9Xfl<׹������/Ṟ������y�"�0�Dg-��%A�:0�3%�\�;)���l���O�N/���ӕ�f%|���u��aa(�Vl�1+7>���y,��/&dɅR��ů~���6�ֺu�T߁� {*����6-�����^�,��R�9X	5�Rj- 3�J���^���- ӌ;�nq%N��@	bj?7Y���ɑ}��g�,'�s0��W=y���{s��͛s;1D�Ɏ�A̗�Nr��fM���g�v}���,5#}�>��$�8�̘+#9i�Y�Õ�r�|a�,��g���0d]y��H��2��Mk�Q�p%��a���3�9�l�F����23�����G���}��e�`�{���q
g#E�^�����)��i��5�"ϸ������3��}�{#
���>Iĕ!�kԟ�H��^�e�یی�qa܌ۘ�������L���\^�����
��@1������0;g���aa8Nϱ�2��Y8�;���*#9�(�U�+%A�9y�y��5�XE�Q��L<%B�0�d�}�p���y�J���qg/�8Ô��Y�S�E��/�2����4�(�Հ�p[A��@"�36j0��4x��~�k����OM�)�)�!�7�����;�2��0��^�p��C�
�jtù��5�,���=FN0�~��5�����gB�}��@���o%�,ד6��������ԗ��7/r2/s>0zy��f���LRc�a�ʢV5�ʲVJ�U�:�%�p��`��L��Of�fޜ����|a�Ddg��� t���]0����&�}[ņ���5�z��\`XϤY�?����q�[���V�Y�VUn=��?�e�r����/��C��S��E����Y�g���p��&(a�3�Vt0�o�����.�s��0���jLp�8v0�Ϲ/�*#79h�U�ܕr��S�[��R,�\��L#V�#7<ՄXX|l�ӌ	PJ��u��;`�J�v'Y��}�!<0��������;�������������AʊgR���5�1D�0q�?����^^��^�fX�8z9i�Y�z����*`f`�d�;���OR3��3o%�e��g�Ӳp���1�1�9�p�9�2d�槔q�s9Y�.,��-ҍҌ�)ö���Ø��ny�Z:c{4ֹ���p��ە�Q���P�%`J��l��Q4lf���Vכ/���L>��j���%����s�����b~�8�����c��λ���������d�ɇ+����{|���/L;g1��Ԍpi��nY�^�灅�}?����=1�b�91�=Cd^u���r��3nV���*0�}�q�r��1�����(�n`-k�'��`L/��a����f�-s�(
9��9Q��f���<;,�`}l��>��aF��w��ԕz¯O�v3�uy,�������U��/o��̙f�i�úb����7"�2/l�O0����A��bc�z��%���	QʹG(�6�b�+#79O�EńXE��	N�J}��+&1�:���`~ ��t`
M=9GMz��~8�k�z}ι���lf��ks�ʈ�\>������g�#�:)5�͑~�0�e��ʇ٨Ϯ����t�b/���k:��,=a�	Q��t�Z�m#?.Ö��a�o�q{sٝ�73XX���?�:��Yڞ��Kی>�E�x_��0����T{�1�1�%8fܨ9Pq�ȹG)�6�!z�8E�XL<%8L.S��Y�s�x,�+8n�
a)�ac5�f�w=���['8<A�b��3���g
����/��
30Y�l��Jz��3Ql����u魞��ɢ��<N��MqxS�~���@qxU0EѤ%���k9Q�J�����gB�"�/
3���r./o����fqfzq�q����%f����޽H�̙�>3�{��W����Ps9�rS�aʈ�U�9G�����E��"�S�ŘJ8���xͳ���p��'	�`k
C�x�i�~�Q��=�_A�Ls
3f���j�d���A�Xqi3f�ר��?�‘�^���Xk�5�TXl�Z�����ņ����qt�2/

M8��ƹ�����SM�``��"�ޜa�͸��K�qg*)������KPkg֬�5�>��{�>3���r.+�ʳ��3����Ԝ6�Y�V�f�`}�������y/raw�Q�%f��`�g1C�JsɗʎU�9G1C9Yȼ��.,��-�q�9����+��c�͇�,�
ט0%6za����s�g�ɈT�Õ���hŦ�i�$�*	��` g�3�J��c&�`F��gL�瀩��^ 21 �Ћ���
���ض~��T��=zl�k�S��4ȸ��XfȻ͎[%8/N0,�`^�`i�%���ā���?�&l�9�gr3n_�9Q�/s�]��fw�ٖ�0s�e*�+�ֹ�	�a�{2X}�&f�E��`v�;�s��^L�ZyG(�T��@�g"�g���Ŝ��Q��L./�r��d�2a��_qg�F�(��N2�b��r�Ҡ�X_Ȱ����s��TT/m����7^ů����0#�V{`Ⱥg�@�Ž/
L]0.h�m�- ��z�b@�l�%9����]��IYM��qtf�V�XePa������v�N0,g�,?5f��ϐ#,ɛg*<�_"�Y�>FY�yQ��)Q��\��Y�0'�3�g�����0��E���e�g�1�|�=g��QʹO)�%A�Õ�ȼ��a��w�g�*䕇1�Ì8×ŜYŘE�W�a�Kt���2�TTʃ��8E���um@"�q����޺@��{&R�-�[� =IP�6w�#<����"�qxk�/
��HnE�$6��	`exd����56o�>C��{qab�S&Y�r��P�j��y5�ea�b�,?4f��x���s���%����	��`z��r����Xw��͸�ÆT�O����ԋu��_��1λ���E�n0#%G*�8E�ʉXr��~r��9���n��V:��p�0�_qgqg/�9|�_5���ta�a�yOa8l�<v��+%A�Y��_/�8��X�"�@�}�#@��`���)�ו�J��f�*�o�a���lȼr�t5|1�͞r�.C
l-���2��A�T�����6�S��FU�8�-{��<��,���\Y���*:ؙQ~���#6�,/����S�k�e�(�/��F85
s����{q�*%G-<��צ�X	Qȸ����)�,�d��b�c*eEM����0�qg���K派kMhÌ<�qff�Zר�E���~��`�P�`�M[�6\i��2����צ��������T��{������)�.����06n��,,a��2`Y��aȳ�fqvK��B��l�G�b�ۡd_	bG�a������r�sG��~z��E�%/�0e�qmHv�IGN�YĘØz�LZ��*�x�jN(��ñnޣ:,r���8�̙�)�+?Q�Z󿷒�0���~k茩��q�`�O�	X�;��df�eG�X�L����e�["�{z�wl�c��gq����Q�p�r�;s	Qȼ��,��Q��d]ded�����8��,��~R�-�M����2��@�Ƕ�2hԝ8.x�/
���)�.�mq���aظ��E�/�.�NV^l�v��.�`jFnj,2]3��5��g��)�a�iбz�|%_���Ӯ}��!{����p�*�O��϶�tv�05�qU~�")���8ûl�f�eMK��F~�0ɝ|����������eY�yQ̽�U�2Ȱ�0/\��%�E�l�,�R0,�J�;˕��nK;�]}��G�����i��J�ʃ��g/��g-<������Vf��͑�4f����<1�
dѳ�gd[�*eC�A�a���-&{`Ⱥ
����/
	OAL�
@�\b{q��q`g��Fl��Tu���a��}��;����T�4�H�ƹG����X���x3�ut��&	K��s���7`��1l�]�x2�h��`t�q/�t���*��+��>�����c�9~L��/�������3�J��ی��^�l��|��a������]��gNԶ3���0�^�f�L��f��8��2���,�da��ʞQ�s턬���QȾ��a|Zb�d^f��e�(�E�e5��`r,��q�~Z��qt��Ë�SALȰ��t�t���e����u���9�O�q���X�|�t�kԲ2�12�L��ł��E�f�N,�r/&_�rϑy/r.,6坼��=c���g�k��lש�X���H~.���}���^3���Z�$��Z��Fq
Vk����a�w��>0��k�s��c}���q�f���ͽ8�S���H��F^k��K�mlg�k�u(X1�b�=�����>,��K,p;a�k̖|���ی�^�l��~Gɩ��嗯&�ҹsR�Ø�['�q�q�*}��8���0�i��9Pr��G*Ña0�`6��
0�����ۘ��M�5����,�0�`�FtS�.,�`j%8Ysߛ/��a(�c4��SR.�2�b	�ظ�S�/���3X1��2�2��Y�٧�Pg��f���������2S�6�Ms��`���k��xz�g�1VT2��B����ӡ�e�n2�8�!�B��0:E�;y�qV0k�k��$��F���~�9|^�lHMlc/l57,�ٱf��_Z���E�8��f�`vض-��'�6!FugrS���c"��m�ӯNYg�s��.�L��,�;lς�ԫZ�SR�Þ��9�O���!��ی��^�l��_ۋ;�����\���nLی�>Ƚ�jyO�,�9Ŝa�Ì<�ʳ	O�	F���1!1���wT�<�y,�g��ۋ���иε��Y�w�>=NE��Q٧���4����F����Ӕ}�l�FٳNTnV�FJ���|���\��kݷCP�Y��Ag�G���j2��ѨJ��ZE��G�}���0���eC?E:��8b�o
��e��Fc	9��U=6��?�X�����]��#1*�0�E]C%�l��d��Kۋ�?\f�Wٸ��BL�lY��Js3X1�0�*����[�*p����jN���1
��]�}�G���ʅ�3L�=Ft����ґk�i�3�zzr�����N�z�9�Q�a�~��;�s_�bU�e:YI��2��*��*�SR��
���E��侹�`g�i��l0)X�[>3)��g���<�So�{�/r3o%���fK���3Ӌ܋�?��ʀ��>�Ͱ���&s.S�L9P|�<�q�<I�������a���;�u!SۘýlԘ�����5�Y�3��?�mY�@��/�i��0�+:����<�fk�]��g(�la�-ѕ���*l�����ORzf�/O�2��k�pF:��6����5��W�%u]>�ޣ%?X�:�V��˯=K��Z^�1*��/צ�x���eC=�c"���g�0�
yQĘ�R��W��е�+*k*����1��d������:�2�������i�w3XY�OLꪀ��1�J�B͌Zְ��^��O��x�=3��(�d^	��N�ld��f�J�-�`i�:c����AP�M0���N�J|r��P�le��:��8<��
y�:�:�j-l��3ď���i������v���5�Ԙ��w�q�8���!�w�կ��1�Q��� ר���N�eR�?
�|��d��*��zz�_�,��ߨs��� �d���[7/)��g���'�u�d�ͼ���Y������ܾ�������:��S�^�P7���ɾ�Zs��/
>u�^L9Qʳɇ��au&L.��u?��ʙ�T޳��{0�>�����F���,�����d`_f^��&k;�/>�-�u'��{OS�G^��j�Y�b�w�Bֶ٨�	��S;�}�����4�Ɋ'�g��&V��io�xR�Y��d����(i)�*8�}�~b�EMMS��c?�dW����U�l���;�:�5
����UN��dgbAFچ-zk��<*�eG��`,�gYE�P/O�/�a��e1��:���8/��ЩŁMK��2�k[*�&g8��P��19ŕ���QN����1r��1S��ӕ��I�ձ���^���+�q�bt��������Fb�Fk���>�����[a��G���e]ta�QQ�j-hXLr��A�=?���U���eJh�ή�mq�[@h�dg��\�1��R��i�5䰘ٌR3��8�,�
�Q�s�p��=������q�y/%�`W�q���n=L���*)�L�r��<��P#}��&m�S����ɒ�%��Fs������bz�0�fL�a�XZCL��F�`f��`f�c6�2Xz��6i��J|u�5����>�^�:�!�&��LV����s�(~<����.�
��k^����:3�jA`�JJyY���[+���TԚ��c?�d�'�9�~5�e�f��x,5"�54�3�ªqFе��fɊS:��Ԍ�,��Ϳ\e����XX�𺓥�)�>5����������̂p8Y��3��,�٧���m�)��<B������ޙ��8;(�ש�e8��k�A9Ĕ��=:שx��a�US�Tp�0_��4�i����-����`TR�,�r�6j3ragf!N��1��J�o

�65�54�=J_G�z��Y�W�gV��1k����0k�j)Āg��L3]3�md��3
ij��<����`��t3�W��79W�Ɉ:�i�6�8w
�2/�&Fu��E�d�����E820��r�޹O>C���nL��\Y���\^L���`Ff�Fffqw����7#6�>�룕z����i�Q�tn
��Z�0~��a�zk��?���> �_�.VSp�V{��d��\8xi��62�jC�4���|n��l�deMI�P�2^Ⱦ��� ��c�����`��gnTT߶��q��Me��ϼ��w���ᩧr̖���l/:FR�����1J���u[�C8����y�z2W�.̬=0cŭ��K,˅�N��c�����b�Q�'	���R�u�𮤿Ql��iM~�4���a�G6~��<;�)ֿ`�;1G/�1
���60�ְ����=,�eC:�NɊc	<R��õgxj3�8���(�lZְ�x����t���^�����^���xVi��Hf&�c�05��E��qf��t��d�3?�����щ
�s�f�/����5"�(��
�/����@�T-l_��^��@�R1%<�5����+�͛�{~F!μْ�]�����m��{�a���s�/p& ����{g��p�<gDo�3s&m�S�Xs/r..3n23�fk�a)�-2�'����a,Ɂ����5�nFp�ҺE����&�g]��VcحU�eS"Τ�[�>���,�i�Ql;N�����qa�\`;L���=C�b���۲Vx�6-zvE�_Ed��ԋ�a�5������t#3�ߗ�s���
vm��$����*Nk��&�Pa�xU�zz��g��`�<����t�h`X���~Ʌ�m`!s�X�JE颐zٗԞ�M#=��X1�_]��
aa���.�@��0��l�x�9P	��5��-��_�)�t��r�hw��!8<���&8�k��ˠ<3�f����0�P4÷g\���c?@���*4���\'�~�Vzk���pC�:z���lNQԧ���be��a*8��f�Я��c%G⧶ŮTcx��W21�5�1�g'u�K�p,�+�W�����Cp9ג���\���qada氋�����0�+7Q��f�FnXv�#6�i�8E�`s./*�̖y0��<�	F)�ە�k���P����+�>�〿3�N'�8E����ʀgo%���[>3�)��E� н>�C%bjN�Fj.��VSX�5�%@�i�����\XX�8���/
��٧H�z��1�5�UIW�e���p�f��sן	�ǁ�ձkcf��3�/��*j��,�S�}�ƕf�6�Q_��0k^�Sߋ��kc����Ł�k1�)�8c6T~9�{
��fx;���go�7�Q��Αa��Jò��~��Yp�a���A�>@g��8���ʶ|w�0r�T�lf�J~ƒp��c"��`�k�i�/��>5ʀ�5��2Ο�+F�u�}���LR�յ�"��c�sָ��N�Ù�fYca������Xw&!�μ��>}�kɆ�|\g[2��]����b�%A�������̙��N�2��`d����C3��~�F�,;a*/ӕ������a�yX9�T�N,�Þ�ܧ�qf�05���F�X;�j04�X��5�::5>8��;��.�CԌ�d�����6־�ɊV
���^�:��O�ck�3=8����GF��1zzk�Y�˂�>5���`L>��<:��0�	��6YO��r�7�����^�Q�jz�,�O!�]@1�e���a���v=�����+�kXlc�r�u!U�ӿ���8���ؿ�f\Sf(t�f���Hw����	Xw�9���an����18�-?��q�O�ޚ�*1�H�*��6w�F��}�������|�%�s���]FX��>���<�Cs�|���=r�Ԗv��a,���T:�Jýg+:�������9h�Q�U����(�ĀJ����&gO��ɇ����+T:�Xq���,�a����#N2��
z~����u�� �8���Ox,Ôi���!lc�r���
�[���9�S:�����Mk��d�>�j/�qgb��kԌ3�\c��]��:����fa�iř���˂�Ĕ�Ӹ�E�|Xln��Rq&$�(l^�S�Ꙡ���a�1�#�o<�˺��E'��Lc�a���b�w����0�jn�݉�1l�e���`163Q��s�O�Y���^k�>�K�gDgZ�qab��Fhbλ�b�B�B����wߒ�?�d��)g}�vY�޵���4�2�7"�ֽ9���^"��byc��g� |����a���/�.�^����g�%@�V��Y)��7'�Fl�	N0�V�Q�U���əӁ�J09Ffzs����ta�|YŜa�a�X_�/���)�x[56̃%�_0�UX�u����]Hp�l��ӫa���3|�J��{���~�qᦫ���!<0���]�8o
��k_��?`�8n�X=l���qg�ԘS��%zмo=;��UNXz�^����8n���گ=6N4¨��+��ߜ��x�E��v/�ua�0�.�=ieY�^���	Ƙ��fS�N��9N�Mkc�d����g�׆�Y��3�c��j1�yŝ���:�MZ��_��q|[Ft`��x.c�ֳR�צ�+Q���Ӄ�zQ�*l�f��&)�'���jU�Ds��C��~,��C�r�.������;���\,ǭl`_b��c��6)X��\����\^}a̰<�0��54����2�3�ũ7���>;��������_*����y�}u�	PÕ{
��/[3g"�Q����be�ɣ)�S�U�*4�02YŞL�0�]1�:3Ԕt��01C�*0���`F_�z��|���������YW���Zì��>���{�:ëg��{���٦�Xns
w��{"�°���s��,>��O�o109�OS[Xh��0�bCA��TR3
f�z4�[Ru��C*q����c��0�E��˂��Jzu�„2��?����xN(MN�N
ʥ�O~��.��u>p�#0�+�<N�٧yX_@�Ǫj��|M����¸�`��::
l��
,�N�Mkc��^g1LJ���y�`{#0�z�!�;�kC�GASU�&�)��3b�b�<~o��_�k�[�����bl�@�s��^��/[������[��z����@3�1�B�ؼ;�}'��,�tf�?Mw�Xv�&%&�c�ѧ���ӗ�}�{qf|�yz3a�3�yb�O����`��acp}e2YV�1k[A:�c��p���Y��\��>u����Գ%�/<,>����*%@E��~l�	�����͝ad��9nTu�����]1�]4���L>�.�Ȱ	X.cFF}�+����_�����<���V"��	�'�s�/�e�����0�`j/�������!�k�ӫ6�8��ո�j-� �������L;`w�qõ����`!0��)�mQM�\�N��e%9�29�T�Uc����V��������;�Rc��b��c7��3l[VVT�Y�*��=�FE�Eߩ��eW�)�G�U���oZ�8o����[SN��;[��-�e�gO�|�4�nc�;/3�t�=�t�ʵ�(o=K2����[�G�^�\����Z�`jLS�r�R��vz�a����4��wό%�w�0�سc#
��a�=����q�`20��*����^~���dñ���|@b�`R�,�r�A���g�'o*���^�*���%�*��3K�SQ��V�1��VrS���;#0�0��M닰;r��a�,�ѕ	�*̗)�S�_d]���J:`�͹�:Ŝ��z�0�����%g�Np݇�x���yp@��^���8� I\�
=C�j_a��|9��V�@U�t��O@u�̨5����y�7��i��›�03��b�V`&fl61��a�q}	�q
5VkA�]� a����|�^_[XhB�`����_	^�:�Ez�^`����%-BWH��L��:�& vQ�ש�}��#��[��,���.�N�vU���鮑�e��X�J�՚��ֶ�-qn3X.�1a��~��%B@��\f�/=8����F�4�ooO�e�����]��3ԋ05��E�:��`��q$�f9V����g�+��=��^�*�^�lܗ�9i�4�����;�y���3\�	NsZkF;5�0��f6.Q����.,�R.,/�OnTS����r�%L-!LDS�c�VT��*{g1�?�^�`_N���G만��ـb�_��N0�8��r�=���@�����]Ӊ1P6Ta�Z��Z浌5��&��K���.�Q`�LB�إ�c;��,�,�a�&+U�J�?�΀�|����\�mᠴ�Z�&����,�N���V_8n�����Mh`Xlc�3��^�EC���@J�*q��)V���u���+�]ES4���L0�5�eN��jE��Ć����a�i��� k�螎K5ߦ��k��Y)�ł�,�`�Mr�&�şp�}���d�K��l[�]��`_0p�)�?tg�IP�9XӚ���/ʬ�^�*�Õ�3s%�ta{
w���%F�ʏ%a)�a�×�Nr��a��1�,��"����$%be@X�O)�Q���S�a�eLeHJ�v�c�A��맜��C=���0:���D��S��V��w�,��c7�a�[�QV�>��b��‘obа��xu���)�7L�özl�8�.΅��(�LV��
Fi�����������x>D�e=*��gY�Ίs�b�앜C�%���E��0��J_�ld�1*�B�V~��}�F�,%?E�0S�wνCfW��l5|Xv���Ԍ�̀y�����7�~M�
��i�0�
�֕�-�����.�!Xl^�p,����B����X�geBY��8�,����8͸Ϩ_�K�7�{|��Vf������t���,��a�.Tl�7��/s/��W�a�02���w�1�ȳ8�F�0��hع�&b���X2/rQ�0�r��0�V���g�p��@�� ���,�R�����F��a�F�2_~ܨ��MSUP������&AL�PbfŮɅ��]AճMk]��Y1L{�^��1g�_Y��3���,g�LC��W޵���r���ױ�c�F_���{q`���dW�.�O)�`F��l��X_��b�I��L��UF��U��|7�;��E�Xh_�B��P��?X8e�τ����7����w��E�eǁ�Fr2��g8㭔,��N2��Ұc��*��/�gg��a��E�k�Vr/���{�ᾊ�df�>C)Pft�� O��r�"�a�`r,�*p��a0�3��9X	�n^䣔r�"�/�8�^��q�*�@F�0#02������ �f���1���_�K���Y��t��0�N�3�oӘ_ްf'T��VPp��#Q$z�e�dqx�KXF�@2�����J�f�lA�`g*+�j��V�3�FE��2����ש��'�zqw�K�ti�ŀ��XE����2`K;y�|]I��1��/�O��|1_�kԔ�*`�]E[4���~�A��c%	����ҭ���λ"�������~N��y0/Y�p�^���=s�8���p�K5r�gf)N�O�c��x�c;��q�����aؽFK�חXx>��LQ=�E���O�1����E�d�Vm�.Ty�����9��~��`T�3
s���͹�*�>K8Ì8ξE�t�(�%:@Ӌ	X�1���SsN/rQ�3��/��K���Ԍ�@J��O
4c��4g��1��L`y8_��`�B���[Fq@Y����>IGAS[z���E��ԫԯ�i��_Y�.�
��=L)��l[�����[���]��ʚ��P�3��`�O�+P"�6_]�/nS�p2�3Mk������gc%渰�q�r�#͑�d`N���h���vX�E�PmЭ�qt��J���k�a�۾0�͋���d`^��&����,������ǧ�a�6,4�ˌ"�,#Q����c1J����jj3Ѧ��jx��,���q���nV�d]�7	��/m
�*ǁ��5}�1@����`�g+3_�K�?&��^�+9,�.�ˆ��9X`l5�w%`v�G�&#2\��9|��ga(�S�pd���K�IX}����b�r�QŜ�TY��#T����h�c���L]4]�g<e4�L`y8=�aߌO��8�[�ʏkc/�5�&9ƽ61�^k�S��w�צ̘3OO�Ȼ53e����g{N,"�S��^g=�}l�Z�%F_���1w�50�Ī�-k�ld_	;S�k�o��m;uf��d_Pi��J�O^��l��SD�6/��8�=C�	d�P��
O�0#�P�['A�����X���ص�aŅ���z~��9e�����K#ɎPx�3C7=a�/[M���L�F�A�v�$����8�8��q�q����>M8���X�E��OR��Α��I��2XE�XK%�,�	d�Y,�K%�����3^l��q{���E�ʏ�|�)`z�an0Y��
��e+=����2f�f�l�gr���>e�p�S���g)�5�^���
9�;�zspJ�ʎQ�Y�K�%��TFJtŤ4������On-!�M++T`f���ac5'�H�~�	����P�d^���Ѷs�O���e��,��{yQ�o�qg|X�jm�1�tԵ��–�����G�PR�޵�sQN�ji���<)����ԇ�5�:o8����S�k0��?Dg[%e0U,���.ci�V��]����� ��sn2���M���%EIҬ<Z��~��/�%���>�9l�[gA���х8-�kԳ�N3�A���df<}�FFcu'~�)�+1*����}�z�k�	d�ʅ� Ł�
v/O�y02��0M`T/lì%?]F��"�%E��0%eMJ8^���k԰oԜS_�S�2���f!1�5�-��Z4���bB0�zqa�7���\XX�8���04���#�8���1���E�Ze�FY4f�іK%��d`Y�,Ɂ�v�t���̧�W|��ya`f���1K5;�Vm�g�&m�m�,�%�K>Zp�E�Ku����.�x���Ed��}�Ë��_�#賚Ұ�Ϲ)�"��Ì8Ë0ԋtY��ORTX9Y|���>F�>i�N8�S�_�H1��g�%���z�f{a:�>_�,��h��J~�C��Z���Բ��(�Axu>��{��;�]@R���L�����	�`�QضP��F��9�U(��t�����XY�d_D�ٲS�/%����2���)ֶ1��
9�Lu	�~�ש|]�qw�Qk��r�S�s/E����y���%�e��j�p
Xz�q�{�Pꔱ+Y魁u'��,��H͸�́p�ي��a�D���b�:���蕉MU9ӳ䌦0�5�}�8��0�x8-��]�E�zkZֿйXk=6v�+�h���"�0%bL�������������������%�XK%��d`K%�Y,�F`FfÌ��/����3����"��s��ʎ�����Ä��#3n3o6nr��_*�<��%D֋��wn1�/NV��\��9|c��E�0�-�2-�Z1ч躙OS<LeL�;�5�h�'��A��	Ł�^燋�X3+"�%��e��oRVYж|����>`�z��=v�)Y���E�v�5�'^��Ͱ�a�똅H'�C�Mfa��b��Y�/Ql0����
0Z��E������WHʶ/\;z~���!��*)��_E�_��X�a���`�q}�,�fx]&��ec�
@��++Ζ�׭}�
9OR�0bص��x����Q��Iz��´�k{0��j�4���0Pְc:�ALt����;��ᾌq?�,�nh�0�ܜX�O�,���%��:�#�kc#0�E�����AfL�z���&�f�1l\�3�6/r��[=�1�:�Ѧ����:฼�k�וeI�h�eM��?@Fpק`$`J��FS�5#z�����aܩ[OQE��9ā�pft��%��e��;&f�̗�,����^�2����,,(�?�+�A�㼦!��ʢ3o6ny+<�r�/n0�0�d�t֕q���qy0��,��_q�/�;���F�kE��iy��nd��,%��,�����b�1SUp��z� 8��zy��i�n��ji�@-����UAձk�A�SR�IOS�ʊK4ذ�S�tY���BϹ��t�)�C�(j�R�?C=<1��B��5���]��O�"�0�>��_A�Nqa���ר��ў��3Q���`~��c�h/��P��y��(��`�}�����@�:v1�kXY1N'���RR-�g�d�ď��[N�z���v��Q��ꗦ����}�Ü`�v/s�2���R���r�۽r�����,��8�_�_qsX�
zl�\a��c
zs0�R�M�a**SKNoc4ֹ�c`kMBר�2L�Ό< i��`����2�v���_��YLt���m���f
�`�(VT/�̲Y��5�d��a8N��l
� ��T9�s�?��Q�'��a��T#Tf�̗䳡q������~X8т��|g���V����rTOfl��Y�Q�Y��Y)Ϲ|d`FnE�|�q���wŞl<�g̽Ȱɑ�Qń`Ff�x9�X�
9���y���E��=����0,��z�,/�M:ר�1	��&�M"�>��r�ؿ���&l1l텇�ʊ�:&[צ�Xj�L���6��^�N�v���b�0:
S�}]W�{x�(�Xlgm�z&a�־��`�t�!u�b̬?�)�S. kZص��5%F�3.
n
Fm�Ls
����H�5�z�k�3��n���5������>�0Ӕ��u��-��l�8�l�3���'1�Tgee;��.�C�Pa��}�H��l�筚�şoR.��u���2}�X6hi��6�4gP�-}}a**CP�c%`,��NK����b��U8x-l�c�u��XFST�*)*똿��03���:4�c�����
f�٨����e8}�:��}�E��x���z�1�3}>��qyp����ɉ�:�b�ֵ�s�����*��Ye��2��8���B�����n�)��}g1�)q
��mg1����\��^}f�&��9*3^l��a�;Fm�f�2�9���,�Oa����)Ѣ�ٶq�a���,�ϒ��`E��0�D^�^�L8��O)�fKFnd��XrTTa�8��3<?��#:ק00�z��;� N.��*�Q٦zs��7�ʇ�l@{��aسb��_M�,�
l`Z���q$]��a�����uEC5ü�Yи�0d������cǘY^]1��g]��OY��Q�-k_������aխlbœ^f��ue��ԋ�Re�?ȶ�ؿY�*�3[
���M��p��hU�R��za*,
�-����(����X3Naw��}5��2��`1�bְ#��|�3z�P���Lb��h�k�b��>�%�|qa��&^k��+(�Ξ��R�3Z�g^��%0<+
�6,�P��lg���(�n�r��:��u�f}zl�%�S���F{��|��.�3r0�w������S��qw���Ůq%B��_���Ʌ��X��a�4ϷL��
���=�"���𵇧��ΰ�&a����о���)��-��;y0��r�0�t��u�
Fi��K�S���$�I�Y�.b}����eA��'�+Tk��r�9YоF��3s�{����l��)����p��b�qg�<���s�Y䰋�L8Ì��#3r/�Ë��E����N02f�Ta=�w�ng��bVȺd��pه�x����]�g�5���%9��\�c
0z�I�2�b��QFVj1��18�`J���;s�*|V k��a��e`d�d[��z{k��.F!�{gR��,�-�`_+,���u���E�US�l�`X~�����9�� �0鱓��0�r�9Pu1���Z��)��sQ�	Oй����j|k�}��]����1�OB��:t��e�q��i�q��8�����k��n�a�f�e��P��,�CSQk^�T��:Y��NtN$����c/�/Y�Nt�gq}a�
�f���~�b�&1M��@�	�}�/��d�K�kb��o	�L���k�2f��ʀ_rT�׷*4�{w�:klc"��`3S���`b���3Y�Xz�a)���Ύ2VJ�כ���%��>u�sS��^��#ş����/o&Fm����8��`K/dXd�#*%����U�E�E�d�#h�ȴ�)�/��Hu�F$#̨�ʄ���,�04ؼQf�9]��c
��J����8�#-ׯSms��L]��N�l9�`N,�u.lB٨
�����`@3C��0
sc4�Y����@�/Zצ�N��h‘�c|�����>�'٫�Q�|�N0�-��Zа�<<�D��sV��@�
q`{�s��3���_�e��ϒ^��3��	�nU��<���w�>����k	GL���=qw����c�*@�L�v~��^����Ʌ��tځ��3_n0L�+/�秩�g
��|����_�)�}���V|9�1k��gz�%1�
�8��Y߇ӳ�r�5���l���=H�=I�Ԛj�}�3��X1{l��н8�Y����P��te����Rq�}�|�
�0ŭlɖK,\���0z�#���1�m=
B�ͫ#�q��8����d�Ξ0�a���1\�ɑg�Qоu�s/�a�E����faF��0�����2/o&Fm����8��8����g/Ìta�O�+��×���,�_y,��/�5��ȷ_/	P�|a��]M�
6{'	��R�zle���������MH�=0�8Ë����9���a�_�F�0��ghK�L�Ń�x8-s���\bA��t�a��/���q���3_qk�B/����ش1��h��s�5�zt���@J�������>�r�r�^ͽH�`1kԘ�MUXuul_��Q���eC&��&�*%=������e�`�g�Ì���Ua�{~̙07�i[�pE���*�f�ʌV����X�ʌn�z`�Fq	�t�����Z��ן�S'��;5̪��@�]�g07_����-��������F+�Qr�ܜ'Se��� ��`e��[*Y��~��T���شj.a�7Ӄl0�AAeA�޿]�����y�P��e�����+��� �a+eAŇ3��,�,�q�+Tk͟�.S�Ƚ�j��󯚟&_�{�B�x���g�f������o���9|�_/��a�O�&�_�qgqgq�r�|[�5��_5���֌t�1чr�����8M�|H���z�S�+
�R�׬����0�P%[}�\Yذ�w,3dc�,�=�
9Ǖ�t~hbֶ�Ra�de�~�)����2,�P��8�,��1�u�wvN$֭Y�U��P�����0zS�/CQ��N<�����Mz�+:8,�끧��s���l�/��|Y����Z���Js�MqvE�=8�3Y������KNk[;�N��B��@qtf=63��
��^��)V�/�VK��k�d����SMav/Q�;�(öz���˄���)`i�r���}�1�X�F�NF�%8�jJ30`1~����
�0z�\`ߩL�[�v���Jp3Z͝�3dXvד㌾X;���bק��t��;"�V�v���2Ta��r�;u�S��d���Bù+Ξ��(��Ul�eS�]��>�g5��,2a�kɇr�|��gqfy0�a�}����9|�1�Z-�Ì<�sw��a�R����}�q�
G2�z�H��K�R,��	�����ORNb���A���ȳ=Cԟ��`��^����>�F�����O�qg|�1Jv-}��qe2j�3[��'��}����X�0��l?�c��ggR1��a�1J�R���b�p?N0�vֵ����c%a�/Q�Zְ�6..�/��5�a��J���5�,:O�,��q�==N�g�0ֺM5�ѩ*f�c
���+�9e���n]�VV&���P�5�P��*c��d���aT�ӕ��[�MvYdZL���.�P������N`.��l`�HQTi��k;"ϸ�g8~�B�M���0��0��^��l��Fl	O��n��F/rc���O5�q�������~Mf�:��/s����ΰ��E=?�Y�*?��a���6{%F�}��*��ɑ�J�0<��_/���ɇ��0�]N�9B�|u8�41��}iegsS+/���]���t-k�}��Q�i�8�3g������,�S��wŝ�g(���c1���-˫^��X,ր�X��P[8���t�b�KR,��]�S��>��0X"�F.tj�Y^��ųQ�`L?�ha��3�Ϸ`_� {t?�ldf7Xk�鯢2��C���sR2�f���?���=}�g�]�f�}w���@��a��Y��vE�L	X	j2,郶��05����c�:zs[*�/
�Ƙuzk[b�����]��
�=M�/���鎖�)�~�8�b�}���gGo&O�N0#��,��:�ֽKl����]�c09�%Fk͟�./5��Vm�:��ν��/��s3ӧ^��e~!���f�JϨY���g����������/�����bs��*��[�6^w��s�N�:
5�"��P'SR��=�B������Mq�b�,Բ,�\�苼��BV��2���pz����T�>��_8�����;qgcşqf'�P&��㗨���O��Z�jy�s���c��蜣9O��&^��гԜ6���0#*l^�55=ྐྵa�_�8�,���ʳʱ vjE���N�s����u:٧ڔxRij**٩P����054���	ā�X6w;��=y�KX�Ϡ��`���g�8l�N�lb�b�c���9�,�����5��˗)�f�^�5f�s�o�{y0"�!{�*�a�(�yr�#6�ti�U�J�əS��P�B�<`F`}g�k��umg��^��E��m��3]&&���S�`�Xu!P��0�6L@
��kbp���kf�̂.�#"�"����0��+���Flc#*Rt�Bʅ�Yb��8����m+Y��?x[Xu {a0�c�c��Zذ��0)��!Ě��Х�3���@��L=�(�Q��͸θ��<�s��NJצ�0r0遀�=k���N,ܧg�K�^�"�+n��x=y����&����c?�\��,�d�0<@ֶ-kg��w�R�)qi���\6�@�p)ɪ^��:q �
=���z�φ�N��M����P��s��|e��iʋ���=<��I�i
��F�٨��0�1κp�w�-��.�VJ����*|���Yν�!a{|�P%`�%?E���f�U�H�ə�.2��PB�>L��/*�0^�?E��$���q���O�n[7���'N~-�c/+���1$�޵�P�Shb�ņ��^�0"��Ng�d�<(�k
��k@^s�HV;��a��EM2�w���gSc����8��n2.�^�ק1C��Ŗf�(�O���?�͋�\�_�qzN���k�d��d��u��b�=�9}�Ԍ<�`jE�8}�c��S@U�c��f�醜b@�l^�'@._~W���/]��
vjw�'���/
I���>���8�n\P�vK��k�9랹�ԝ-`1qgz��b��YL�cֿgq���}>�*����1lY����Ӌ;��ˆ�1��=6uJ�±���-��u�TJ�Q���׬%�a�>k��^��7�{~C�E�rх�	��z��{n�������	Q��L�y3%����u�XJ|��8f��þ�����E��2a��?�c'	�3�����x
�4��))��w:�8�
U�1��o�N0��nu�x��"��p8�9��paf�F/P�8�c:�S�}�Xqi�J�4�w=�8���-zkZ�B,P��a��X_)��t46-l�=IFtԵ���X�/��b��X	::�-z�0 �a��F�/^�#)�O��,�E�a�X��l�Ø=��~��2��w�gs�̬��FKm���;zy}��%;5���ĉbY��C�Y��;1
��4���Z�T�9i��1f[s���]c��٨�F_��+>Fm�Z�(Υ��}=E����~ lf��9�uќ^�#�fܨ�����ՄXK#,"�/o6nd����1
��^�2�e�_~K>\?�\�%�-����dd`v�7Tn��ɇda�ə./&FF:��g�a{��sD��<E�r�jj2Y{"�	`5�ΰ�u.��MZ���`��6!�9z�q0�\�+ݦl�
F!�@��9F'c)5����-�s�8x����R35����x�}Z��=��y��/��3����,�س��VT�+*ͰU���ʝz�c��;�/ߗ	�O�c�dJu���a��i��E0/R��l�/_�%��ޣ&w�oNS�FY�|��ԗ��9�Pg�cs�ӌ�_�F_��`���+�r�q��L.�����c�F��1#�������j-�Yƾ᱑�q�vX��Yv3R/�y��+�wź�j;±,�q�P�P�~ӕ�}�6�D���o�J�����|�ܘ��:�������B�b�g{"�9�>C���s���ɛ~b�2��>Zs�\^L��>��F]�?�nk���L4�ax�NN~Muw���&)�T�F1l�e�o��}���4�[��P1r�*
��f��~���
�U0ؽJ-H�==E�-���]��
6��3R��b�X^�#�"�������ʶ-��;u'T�2��ų�y�`���"���s��>�=F1v4�)@T�z�Z���4����h�?Y�4+��3 �g����^���2��}��oP�lc,���4���+Ć{t�����=5�b���٧SR;��|�8×޳\�0�f�H';��fk;�����_qCdg��s�Ϡd����/��*��^���^�2���G>�D��������?^�#�r�ٗ���3o�XF�Z����Ϣ��d���Z�1��,�l�
���zy��@E�Ł�.3X���\�<V���lZ���<My�:��b�r�_S�L���W�=1�z�l9y�@j1l_U��Е�et��Z��k0��u��+Z�/
un(z����O�Y��r΀c=g1Ua�3q�y�	�vQN�f��'d`^�/Q��c:/���}~��ІYe�N0��*�����)偧�����f_�g;4�,��sָ��a�}��Y��7^�GS}�g+�l��5qa���Xg��������?y�$p`-g�@Yw޸Ά+�d��������ş"��^���^����D�A�2Q�-̞��F_ FndͿ)sм�̼��..,�AG�Paz�l�8_��=���8��XE�`YP��#`x�N����?xL.���
�Cg������R.�C]�g���b���F��;���X���cp�qQ�m���x�F����c1�b�v���1��/3fW�0|V�[�O��n��LT���b�55_�{(��%���w�de�T&���,�sZkMk%��ʐ�.kK�r��[��TJ�Nv,&f5�o�/8���J��H�3�E�T��+"�z����5��Z�0z`ܮ\��"w*�ȳ�BϺ���Z�>��!��ǤZ�F7^k��Z�?mq�,��ec�������35�X�����1
�u����@1Ί�N}�ʢ|����̙��,,�<�k�^k�ی>V*�坼��4�/�.p�׊-��}����w�i�&Xl��#,fk�Fu���*iX�b���/�A���Q�����_�z}"�1���M�]���‚���Z��g�&!��!���Ӭ0���Ԟ�����,�"�,�9�q`�>��<"�����E�T$Π���͸�ی8Ì;&�ֿl��/9y���2ɬq��&,�q�z�k�ff�[5"��j���Fiʎ�M���0%?
�j�U:�>@�⫋O�s(�p@a�Ռ��Ԍ�h�zk�W?�.��N��z��E�bU'�V�ʓ=�2^_ay��_�1�r��L<�%DfK���qy,3^�W��<׷��!��񇘽�\���`E��͑gz�}��FndͿ%a|�<���~Z���&`y�U�K;`��a�*)}�Ӕ`^�\���ԕ�9`i�O�������q�Q��醤Y�z{��=�P%�ŜY�\��	F���6�п�&~ܾ�ٛ/�05�.20�S���Mh�q٦���=�F`��GcN���Xx��u�a�h0�az�a�a��QS�p�/Mt,g�x�0~
\f1R��Zu�f+_����5�e���ey��T�Pn:��c"�9�Y�a�i�sZkMi�dc���tYŘq����6e}��/�!�5��aʉQ��,\XE�Xr��/o�r�p����X�&(}ȳ���q�ܾC͞ϣXr/�\\��|����9�k�pY�Ĕ�a�M�A+:+��2��2.�jY�~�������,aό�������X,a�#/�X��k�XE���`.Q����f�F��|`N�C�iq٦�2}�^�����H��/����E���@������uu����vׅ1���00O�S�N/��z~hg�k���S_�++��M�Lde��c���\`FJ�
H�554�^����>K/�a��,�S��u���fL8Ìt�,��q�5��/�9Q��a��?6�=aaa/�0��E�-<��?����S�g[5?��=�f��)��d^��Ͱ�XE�l�\\�ɑ���03Y��0��s��S�ܼL%e�Tjn0�FoR.0T�ŝ�=9�p=v1q�z["��E�`^�\`^���a/	g�,S%ߩ0�4��u�?
��(�J�l���d^`�FWS�2�
i�[#��{��?v��23�>N�8�!�:�E�v|k��1Sܫb�*jM}DZ��22�C���2���%�XJ�=MFK;�a{Y)�,,ɇ*%e��RS��`e�4e�D�r�"�S�w,ٶ��'UPl���T��ю�9Nq|�9Pq�qg*#9q����a�l<�B����ʰ�^��?��
��٩��R�l�r�}�������`d��Y��-qr�6}Q�J0�)���1�qB��*׹�yS��FY��ԕ�qw��_z��a�^��6j2-=����SrTQԝ�hc���9�=}U81t�ӼB�GYE�*w�/Q~�0&!��KN�TbT�cg�<��^8���,8=%]C"�^E�c:�ld_$;t�U"�W�t����>1��S"��MF1����ə,;����l��F`E�-1i�1�ML�E��͑�J��\��8Y�FY��7%�4c4�`FSw55&�R�21��~��a�Õ�qfz��S�T������ΰ�	g3�w�>e����"���\��E�rp�^�\`X�[=�E�,�ћ�|��,��y,��./o&g������,��c8�8���
;�8��͸�0Y��ԲbsMK�kZ��?�\^��1xk4��9G��Öb��)�z�Q˯�i)س���8y5�a�X�k\bx`;��P��:�4^�Fq�
�^���|��|WL�ص�Tcx����1}~��9ښ�c�l=H��2]�r�QŸ54��da��Wٓ6�e�!,^�VE�XK,�X`�d���Ñ�}}l�ɇ�#躔��\��߾���f*�����n�Q��d��+�;)�嗳Q��d��%fK�r�����r�#,%8F�	Q��0%�i�LZf�њ2ɣ���a�d�Y�6*�./;&Y~B�G2�>����9��|f������|�?�\\^L?���ӌ��VSa�tl�B�����^�����C�\�����[1Z�1v٦���x/M���d��pZWO���z�+1^ޚ�i��^=��ѝ=#ֵ��5�^7��0Z���#*jOq�f��2_c"�Q�;�7r�䘀E��ϐ����_ra���O��O��}�ӕq��ӗ��,���E�os5��	|a���<�r�x|��чR�>�_F�\f+F�`_l��{��*1��Z�*1Z�#+*Oq�q��E�ŜY�f����+%FT�S�3nTgO�%Fk�i�L]4��Fh��4cT�,"�h��4f��0#�aY,�K2a�K���qa��5�*c�!{r��{������x9�2bz�)�Y���^�Y�|a�>�qqy0�0��Y�`�g�;�-�[?��#+l�=����gRz��a/ە�k9`i�5..�<�a޹O(��	P}����3sSN_c;�܌6E���l܌36|�s��(�����\���T8�����k��R�9O�sߚ���ɇR��5�b�a����z�>F2�S�#8��4Fc�'����V���'��Og�d֚��́���YŜa��a漙�+%FT�r���r�%�8�Y*3��a�,%�4f�њ2�%@d���3Fh���P�#�aai�LіJ����a��1ю�teL������W�ˁ�였Y~��)��es/����*�6ns��\\\da�}�^k܋8�3a�,�%A��k	x^�Y�G�)�}���*`�Xv3Qqf�a���jF�	N��d��z}�Gа�}l6Fu���Pv3N0�c�dc�x���q��0n=q��4^6��['���й��N���1��ߌ��=ʦF��0�0�,��×��XK"�5�a�K͒�23r..S�3Vd�O�+%Ft�..SŘs�J̗(�,2�2�#T&T`Fk	Ni�	dZf��	Y**x��ʐ��8�Mi|�^~S79���/s�;/Ԙ�޽O�,��v/?����Y��Z��da��Q��̬�y,'�zy2�H��L�Xv��*9N��P�P�٦�Xn6`�)��Ix��%��E�!gZ�}00��O�Si�͌�u��ԌĿ��I�bU&͵�����zr������8���Y䳋<�k��,62�%䰌�q�/�aT_�*2`w"�*>fm�����%�Yź-�u1g/���TeO(��*11�,����a0�T8%a�d��dc�q�~r��9���"�90���Vp��=8�����H������}���0��ò,���NY��092.Q��[��=r�����KZ��*+�)Xzlc�=9Y�'�[#1�ޚ�#+�l��Z珩?|eK��d��p�����6�)+0�XE�`;Ya0#Y,�\]�r�7���Ë8���a�Df��Ώ��r�:xÕ��5�wźx����E�,�u�U��*yG�0#0%�aa����eLeL������^�36�X|��r�=�E��a/�����l���w�a�2���ńdg�z;�|CRk՞�쳶����v����s�
H�H{ָut���c+��ש>����Ƶ�bU'��������?��f��N�*%G2���8Õ�*#,"�������,����2̘�,�2̖a��>U�S�|�#3XeO��%Ft�r�Ts�y,��-�n�<�%FT򏝇�3XN���c�SS�8��/0da��g�����ο:�)���P}�����y3r3o6nr��lӕi��B�-qyTF}:��^��ӌ3=�g��O)�*�Q�G(�,��+%@FXE�E�xi�)�xi�4e�ah�bc+#Y��a�>L	P�܋���e���G�����������	a泔���D��r�,9Xq�q�/�9|c���F:^L����οw�S��.3�g�=H�fvv��Y��Ь��0���Y����r�S�Q*9�qg)�)�/��`M�ņl�X.̘r�>e�5?B�*���a�VsS�3nVgNq�*3/�בaF11�fT�(�*��S�~fa�a��֌ta�c6�ג�6y>Z03���P���g���?�����=�E��,������ϯ\���*%G:�S��tYߓ%��g�&�kF֚�ZkF:2�-�Z_�,��ʽ��#*s�<�*9���^�lە���0��a)��P�2Y�s�9Q*2��|�;q�r�|��ٷξVy�ae�o�,���͑����e�de��T��ɗ����3nTFs���S��<�q�qn����T�k�_�ʙ�e�n��T�:1�gy��Y�./*�Pq��9�sɒ���Sş-D��a�a�%8Jp�	P�+02�;%9ʈ̩�8fñq��Pq��3o�|�Vb�
0�\��l(���jLS��Lن>VST�T=Z�ؿ"�ç���bܸ��Ƚ����~�U��09V��\���3�\�9Nq�q�/�t�1��tc��a�:_/�8Ì8Ì8�8�始׹yT��ʜ�9Ŝ��/��S��J��̖�#9��%8L	P�2�	O*#2���0�0�0�����ξVnN�<C�;(�B�����u&
9Ę:q�?R�:���K
l��^��RT�Vu���a��`}
��\^l��Xd��a�0<��9Of�f椨��`gO)�:��,��q��%�WٛXqa~L	d�E���<�a�9Ŝ���<���<�娕��*T2�S�����%�a*#2�����tc�0�$���f��<J��6Tz�3�i�5�������6w(�)��?�J`P*׶��W�S���i_,�f�Pfӌ�ɞ�Ͱ�H��a�2��&dg����<��9Nq�*%G302YŞL�����Zf�Zc���K&�XFk���0%���S��0Μ#3%�s娕�ی	P����{y0�8��Y,�	Q��-ݸʘʘ�F׳o�{r��{|��q����dXK�'��^*aX��/�YRT`ųQki�g�Fw��,��,�f�.0,^u^��	N�?!���	O�|�8��a�5Ŝ^L��`|���&h�%�i�����xi�,�LьLXw0#5�ʃ�<��,�:x͸̗(�j%fK��*V`d�����O�A�k���×�k#y^�Ts�o���C�*5��G�Q�`�8���P�Ë��G}�l��i�H��|�gb�1���ʀ�a�����{|��\\�ɗ�~AN�S����a���<^L��E�XF�,"�Y4c��Ŧ��%��������<��#%��:0�*/��r���Td�O*%Dg-<��ʠ�0�<�vJ��8×��+ە��u��N���s��Т�ҽ8���1:1Ø}ֲ3H..�n0,�J�GȽ̗��k9S����3^�XE��8���Գ�r�SŁ�ʉY��.2Vk��y0#hŦ-1��3F,"�0%�����Y�y,�a氋�P���.S�mʌ�ϖ�Td�O*%dg"��<^�U���9���c�q����g:��-�ߴ8�+�]�qt�3N��T��!F�1�k�1J�aνȰ��K,�v�a�b�"��f����Z��8��,�&�.S�8�����+%FkʢVFgOa�����XE���F��"��@FfT�)�8FJ��ϕ�r�p��3�qr�,�*��q�1�1���s�o?�\,�����
=6O���;[�똿F�E��\�1�q�2Yʽ���OR��l�7�����h�9�r������TJ�Q�<Y��䧔�y�"�X0%��=�C,��N�ʠ%@J�����3nTtgO|��%�EʉYȸ�O�r��#1ч��s�a��Nॣ�c#1(�����C?p�˧��^8��Q�}��>�a)��k����ؕ:{�
0^��%E�bO�u�yFqgr�Tf���9P|��/5�Xd��6f��r�O��*%����ە���S���Tm���qr�TFr.S�s�
8ʙP��Fa���{<���5c_b�,)Pw�����0�N0����&f��V�/���&L��tj.p�x�*M���+���Ә��5��²�L�k�y�G��j,�)#M4L?$\��gdY�����aʃ䧔�X|�#>��q������-d`E�|�3�8�J�Q���TJ�Qȸ��teLeM�8������W����3r0>�P��(����ٓ:�ӌ܌��ə�l2a�[2g�S��>��00:�%vju�z;�鯠m��3�Ql����q�z��Y�)��R0ש�	Y��0�gMdbc)�##�Y��>u�yO~L8��a���yO�Lə��nTgNsZkJ��0���%ń������:1ч����s��0���y�/a��}G�E��*>�O�R0;a�Q��72f�^�k�D�Ns��^�0zĂ�k�zj�ӧ�޸�
}Ͱ	X`�/Q����Ա{�VS^Õ�ǹ�*�%�yN�#09|��S�Y�2����/+Ö��fk�	N��\��9|[��֌<��9��+3*x�9Y+3%�l8Ì?���Q�~W��2���V�M��G�,휾��p���73^�a��5Ŝ�:�
���6L�E@1ob�����XjLs�a�нI�cu8�;�1�2TT��a�%C�r��"\�9Oq���qgqgaqg�,�6J����,9j%da�r,�Y�a䳔򟒲3*yO*%`F#0����̽�Q�~W��>�e�t`��y��zg,3�M����J�o&ngnz��&�,�I��Ʌ�k��l�x��5��>ۦ�x��b޽D�Hb��k���2���ӌ?:����,9a�X~b�S�[���0�3&:�,��-�n�8��a��PyS�x�ʱ�нF23��׹�8���ʋ��aʃ�Ë�ʜ�<�䬌�ʞ,�Aʃ�͇�+�ɇ����������NX����J����9O~�ʋ�Dd�����8�9XN�0��8��^$q��8ʓ��|a��^���xiᧆ�����xi�4c4f�њ2�fk8�E�,�&yk8�E�-�n�8���D�ʞS�]����A�Nt�F02\�9F|���,�&��t�ta��,"�&a�{9ٹ̽�N���N����8~����/o:=�þ�S��)���ͼ��|�?˩�.,"駆	�)�����x?��)�(熞xi�)��Lbc�g�0���Yź-�u1u1u3Z��AY*2\�欕��%8J�ʌ���VFnF�2�1чJÌ?�Y���2�98~ϰ��qA��G�G`t�f�1�Ì�ۋ܌��a�N��1��K9r��;��/���t�ٕ�4c)�2�xi�MLz�q����s0��a����E��SRn�]�^Z_/�>Z��S�=�NO^U�+*p�aJ�XQ��<�r��0�0����.e�r``c��{^s�:8n��^�Lܔr�N.�0���ə3s6t/�ńXM��&0%�Ӝ�8��9|���qn�q��_�,5ʀ��Lbf�ы�F`F�Y��	d����y�i�5���E�-�x�1ѕ1n�E�,�_/�ʃ�ʜ�9����d���S��ñr��T�ʞQ�Y�����8Ì?�����e�raw�O����O�<�x΅��gB�T���ɑ{�������ޟ�.S�p	dbc)�)��)�S�E�񉌦�3�F&,Xqa����0/�Or11��h���Lbf�ыLZg��������xi�4f�њ3Fh�2Xf�e�|]�^r���_��,��sZkMh�J���8Js�q�1��U.S�[��2��1ч/�񛜿�n2�3�
Д}}>�������c�/�)��3nVtTk܌��qg)�.�,�`����S�YŘV�&�br����Ŧ��de0�'�	ᯌ���2�2�1'Ls�F&hńXK#+2�Y��4f���Fxi������K#1'4e�a,>V`K"�,9�0"��΅�8#ȳ��gdeLeLa�|g�̽�ոw��b���?�̧�ش�l&!��������YŜ[��b�g��ta�r��E���E�O|]|�O��Bx��g��&.�5"�<HM`	��FMh�F:�Ì�2���Ӗ��|�	d�Y4e�i9grY,�%��`K2XX`VM�)���1a��X���a��a���O�0�0�0���q�����[��ueƇ�KO���r�`^���u2/r3s�՜�,�֚чy,��<L�3Ĝ�'Xqu�<d�u���YYY<d�u���YY<g��u7���<L֚�ZkK��xK�˾_/��l���<�fL0���<�xÌtc���,"ùvFa�a�������9�;�̼��e��KO�����2S턬�FL����+��5��֞&x��Nx��b�b�g��2x��Bx��g��&x����|�_r�|�_5��c��֚�n��[�g�1�Zx���Zx��N2�x��c*g�����T�T�8����&a��s*���:?�*,���.8?����zq`aN�s&E�ca�m�|�kMi|֚���<L�3��Ru!<L�3��T�i�5���,��yŜY�w�:1�ZkMi�5�5���+�6k�ɇ�U��^t�cS�w�z�Tް_ퟙO�O�,,\��ɑ��"�Y4f��Y,�K%�̬����|�_5���^r���8��t�,��_/�ѕ'5��a�0���6��|��g��Ԝ����;f��?P!z�l�d�8n��G�b�8}F�_=�{
�+/�n3s&y��V�gdіK%����9��5�XdÌ?��Y�ξJs��Y8��Fv����^�0�RVVј>T$��[9���%9�0%e�|��<��K	d�0%���ϦYŜa����d�Y,�K%�Fh�d�Y,�KY�a�VK%�ׇ���gΰ��q���ʳl9�ȳ��TE��bϬ"�5�<}��k����sӅ�	Pfiř��0���g�+��M�,�K%��d�Y����|�kK��Z_/�Xed�Y�`M��K%��dњ1��h��4c�	dXr����XE��̘q��3�yVs��g�0�^K;6�T���=@_�1@�5��5O���O�/mң?���*�8E�VK%��d�h��4f��h�#,�K%��d�Y,�K%��g�,�ϑgd]�0Õg�`ed�h�F"Ù�r��XE�L8×��/rbo�q�Qa��a�����}�%Rk����x>�2Xr��p%�Q�TnL�*yN~M��/�����%�ɣ4f�ьOnh��4f�њ3Fh��4e�FY,�Xf��-�Z1�Z1���Z_�K��,��#0� Xr_q��"��
��pwYQ�ȴ�UQ�ԋ¨�A@���S����z�5�XsQ�鄳��
w.3p2`O���a)��Y�,�|�E�l�
9`K%����ьLњ3Fh�����&h��,�K%�E��|YŜ[��5��c��|�F�0��I{qr��{|˾ax��FVFT���1]sZϸq��/g>���*Vi��ng񟞰���a�=<�r���g/U�;,�9,�XY�Y4f�њ3Fh��4e�FY,�K%����Y�K�XE�����M��%g���ɩYRk�Ԗ_�g�Gа��d���72f�fߜ����Y��3Y�~K<�|�<�ggγ͛��,�K%�ɣ4f��щ�LьLbc09,�K>��ΰ�q�����Y�d×�����ʀ��܋8�Ϳ9qa��<�=�qg�xy,	`FdfL�Vy������}MB����X�q{����~j�/�a�#��/s���yl0��%�?˘������J0�^�����6�X<���͸�u�Ӱ�/���q�|�?˖���XJ���;��E��1�g#6�P@��,"�+Y,?)g��<��r���L8��"��*7��Gy��0w�,8���|f�ZL�9N��8�8�>u��v#"�<��r��=�|�����G�����`62V��ظ�8�����^a<M�u�E���	�i�p/�=����PFQ�~�5'���>EŤ�2��9y�X�y��9Ȱ��w��K+0�0�o������*>�}	x!z����`�=8��`��bC��`�-1���F$�,��`ey�����<a��EԜ]{��?�.��.�>@�>��9�i�D֣���O����޹g�,==ME�0ٶ��m��	xFE��a�`ed��,͗���0���������Z�<Ņ�gۋ;<I�sĜ�<LeH�!5��@����YM��,I�������Hm�z�l��I����q�aG|�щ�h�&�a�%���/3�3���9�<I�����#'�w�E��.x����S����i�C���������.ó���3��h��Z�?���óql�0���"���d�YL��������忹��^r�	�/0deK���f��OON.���@���^�x������	zt�a:
{k���0Y��1?�d�Y��,	e�����w�d]I��E׻��x�jnE�>��B珦��R�x�?��kS~�K�62^S%���F�7��Y߭r���-�ʟ�d�߰��?����q����f�Ϫ`�d�	`F&xiᯞ�)�Xq�rË3������W�,�09ѧ�;�-�$��;��þ^g}�n���,�4�a���%�=�9`�Xe��z�`��oM��E��,���E��@��ӌ�[%��4��D��,?�d��m��������'<I��Eל^%R$^+S<y�����I�P��j��q�f��#�4�6.2���c'��=���P�R��G���T����������22��7ɢ��a���O���f�����p���+,,�&iŀFYk�Kh����<4��4L%�4]��:�����r��5��	�5���/�a�/���ӗ�Y�/	xE��ܗ�<Y��2��띝�E�E�{l\`������F?4COa�����d�ɋ��4����a��t߶�����.2���\�nӞ
��:X��Ԗ:X��y��k;��ĺx�ORu�3ǟȵ����jcܤ\���%�������᩵7��瀿�\�-���`O�]�9�*c(*m��87ɣ,9a��s%��7>�{���r�t�ea�l[X�܌9`K%�,�M���3Fh�I�Xr��󗜼�[�x��'�ֹ��x��$x��a<I�z[�.�x��5"�?���Rx�c܋���8�'S��i��ԗ��qzs����Ӗ'O��bmk���ۋOoQ���F��,v���ϼ��n0�Q��
۝�O
����}�#��F^]1���)�7<�i�s��ƶFS;��<1��2YfvK8��������2x��s�:�Ů,��!r�3�#���4h�[L������qs�e�De1���G&���.��E��n}K5{��:��vFey�fvK%��d�+%���!�9�xo���sFXr����|Y���ۋ0�9|�����z�w���ԘE��5<a�m�ę�]I�N.��٦��l���ʐ�ЌrO�d��d[�`l��d[�eM�-zqn?���3�z�/3_p�a�q�,
�-sE&��D���Ⱥjc���Ԟ:���������\e5����K��Eڛ��a�%�5��l�$��<a������=I�@��������,��J~62x`?�s�:�9��x3��FS|l�h��4NXrÖ�������f�f���{�z�s5�#/���9�X0#+3��-��d�<���	`KY,�K%�FX�Fx`�h�Ĝ�9a�+�^r�q�k�ԋpM`�t֞&kF:1�Z�Ob�s[��5��o������汃4�9�=k�f�%�5�p"�0��/�p4���,N2Ì�4R}�'�Hv�k�OsQl�I�$�E�/`/N2�#t��Q��m�`|�`�ۚ5!�^�d��X�w���g����~����,L�?�h�<њ'4O��?ۚ!4f��M<7���4NXrÖ��X}�ϪY�<��'A��/�kE�%�̰����fu���[0+%�,	`s��D'�	ᧆ9�sD��Xr����+�,��/8�9�5�S�d֋tY�֞&x�����}z���)�@<H]O�R���΃�/צ��d�9rY��[%���["Θ"�=��2���Θ���t׮2���t�����ć�dZ@��b��a��gE��m���:�y�����;?"��ӌ�h���
<7��
�l��?�\��kd�g�t���0�C<O�Os��<3��?�<1�����Xq����22P "0@`1A!#BQR3a$Cp���?�@�mJ�Z�O�����Sl��j�}
���o��IЎ#�0�"D�8@��=Ua[B��u��굪7���_UJ�F_����@� @�C @����V�\����H���[��D��o�bŅ��UЬh��)cD��?��LH�3'�7�,�b��R&+
��'�nY0��/��Z��E�����3�Y\ݍ�[��LW�g�V��7j�ޣ�[\݊6/��V���ێc4����V�+
��n�����7��Q�v�ĘGb��N�x��_���I��]w�&��K�\ݴT��Z뾯�_�ګ~�u�����5�V�Iz���f$LV��}_�6�r�*�F��V��[Lר�%���2�Z-x3)�V�4��cKi��`͂	��%ś���Z/E�g&L�.�o���whO�_�ԭ��]h��,�\-�����l��<��M�,�>���5%�7u��.^�w�gҙ��i�*S�[E��?�al�u�u�pRМouW5E����7��n�йx��V�36�����ZKR��S�)�f�KBq]Y-T���h�˳�Se�T��l���YFQX3�l&m6�ccUiv2\$I�lnoAa�aX��I)<$�r��e-k��PA��̦�b}UVcwR+��BI��z�4�Eͥ��v*�䔒��z+3p��IT��$���
�
�V��.m-si��p&-9�%&�37hȱa��o�R��mQ��_U�B�I�y�ͥ�n����7���R��ŎRTZ�њ����-�e��&����a�տ���e���UV6Y5�����_nZ)j-j,~��YY�Dnz
�Z���k�B���*��4��eRJ�X�\�J0����Z����k�L3Z�l-�Qv��X�k�)c��E�?�K��Z����Z���(�ʵ%V\[��ToIzb�ʴ-s0�V�1w���4V�XY%T�y}\�F'���
sя���1�_[~�4��-��E��5�ln{��.n���U䨹pee�X�1j�j)q��R2��ȱ2���!n2��l,]��ј����ė4����3�|�n��J\�[{� �U$�DeFY(����e����i-ʲf�YeEQ���
ijT�[U�k��M����\�R��U�D��0ܨXj*ԓ+aavgavdU��kJ6ҫ^Q��16e�^�e.��
�N�aZ,]��pVa�0��3bռ����C�k�ݍ���ݛv��L�iK�/+������M�F���st��-�f���m�+��	1~²���-M�'{TOnV�VU'�7��Uñ��5�\,*��EEQYY��*�_�\,7%0�mE��K�Hp!���3��)a�]���}����lȬ*+4H�V�9ubņ��h�~,}�r�_v�\,d�od�6<��k��\ڻ�y�ت�,+s1U�i���#.�,sJCm,}��Ⱥ�Q3S��M��f�M��F˜q�`���������k��nV.��\¬��ZX��v-Sz��0�����66��\Z�3j��clʫ!X�_�X�%d��[�(ܭ��������
�ٰ��k����fEZ1iu���*Tb�QZyW
2Ƅ���0x�
���U�-<XXĸ��l.�[7��R���JK�Ʋj��a�������n��Ү���A�+!���Y����lه^QԱvT����T��R��6�t����V�'�w%D�Ak��_Y
Y���)c��vYUEh�i-p�sp7Ɣ�z��:�ܘ�bRZ�#E��]��X����#')7L.��]��֌Xf�f.�5p�n��6��A2�+�������9�H��5�ʄ�ee.�4c��J���r�jR�e�4O�a�pFJ'��ٴ�p\�ob��n-��Z����b�J�Q��ʥ�L�-�Q��l>冾�N5�&�ٴ�-�[�eV�K�EQ�L-�-1�}UFib�%!�XUcwSu�ȧ�3(��~4��"��H�e�5=�*��m1����� ��,e��7��ޱ&nZ*��ڄ��K��
�F�H��$���7�$��U��.mE�"�0��&,p���I3v1b,*��YWAlĕ�P����Q}Ff�7B�"���tn����^�1�9�VX[DH� �<��C#a"�n�Ѻ EH/�ݻo���q|��˙����ݰ�iiK�oT_4f��M����//��n��e3P�sN�(���.o\��ӔL��d��q^�)k=4F�T߱�G݋�(��ߨ��W�Zp�YhX�M�kR��ُ�ct�+
�Z�����>�H)**��3i	öfR��Z���xv��X��I���7�j�X���n*yR��kU�S2�z��\�^�x�d�YE��e]F5����n����j��bM�K�I�7��Y��2dɩ%$�7���g�ɒ�d�7JD��K�"�H�E���$Kȧњ�"����qO)%$���22 "0@P1`3A!BQRa#$Cp��?�o~���D�8��ql#��$H�a*Q[���E��L;UX�_�Ҁ�۾{s�"dɓ�dɓ&L�2D�$H�2D�&L���e 2�'}kU�*Q�V�G���u���dɒ&L�2dɓ&L�$I�1&�D��,�U��Dd^�
�qX��V��R�ֺ�f�W|"7�.��M��I���#�re!ٳq��L����w�����Di/Ÿ�W=�0 C��@�Q"G�T���e�.V�Wؐ�&k� �2��T���N%&+��2�ݍ��L׊(��'(�%��e�KV�o6�݋��d��L�9Xd�ֈn���q�y��`5��J'f�D��h�
`dz�ů��Qu���/뚋���)u^���E�ƒi�QXg�N	������0��e�I���u�L+_�!k��wX;[몢��[Z.���UY�:M�on�?EW5�e#��YN���ϧ2��f#.e=M�p�^�u[ہt�ҖI��+�t��Q;�7t�Ǫݶ�18ǽ�n���]#���U���,A���'r�"%���G�&S���{��!P� G���V�6�ŭ���Uo�V�N�7Vd�q\V��w�hN��km�R=N;�V�n���.�m	�a�B+Dz
�v�yT�u�5Y�C{�[4ɛ��0���q�µ�4몂�D��d�fE��XT�\����Z*�V[��c,-����S�A;�qaZ7(�-�)n�9��]�׵���1�a,H\*�aT��p�e����2~��0���<¡��T���Ŀ�fRR�3i��.F�7R^RĔ���VX��y�쩝�W�'MQ�[nE�nEE^&UaV$k,�:��Eu1~q[�A3~�Y���}3�Ql$EEQS&x�NsU�
�~�$��1���7����ԉ���OU[��%�*0��‹�Q�"�b�UXU�miͤ7��o�AU��?���ET^����&^��K�L]�A+���T���d�.�����E�Tcu��Ұ��HpZ��T��;LN%-�]�T�����ۭv��	u�1ib�.h.�Z�m�߫
�7IVU-r�Pӳ$�Fr�0��ERL�]��2��b��N
�J��j\ť��u�jC_f�WR�߼��&�����+��:+uX��U0��e/�.#j��X���EMV�[{x�&^E�V���ͦ��d��3��u�mVayZ9�]�U��el�a���Wwu��Vk�=�a�_�����b�-o�Vay����5�Q�4�є��vr1�hޣ����bZ��`�j[�C����L��Uf��Ua�\�����"��h��V�Օ�KJ\��Go�&IqY���T�ז��0ܔ��#5ǫ~2�6���ɋ�m�P�p�FK4���Co*��hb��x��U���Tf���H[�i��#j��on��쓧c]	I�7�.RHXeV����X��QXwUZ���o��fUh�V�V�yj�X]�9�����$W�r�X�ġ���R�/�V�ȇ,E��_������[�Q-�T��j����
�3tmj���]-J�b(��\�]������U�_�E���;}BEK7kDU�-�hɽ�u��R�ӳJ�⪼�Cv��e�X���\´��F�UxE�u/��M�*��D�A��.�Z2�ŽRb�oE�Uf�F���$��J7�]��Z��Z�mu��"��զL����*��"��+��}F�j�f�ҡp��B��,[�Uڳ���I��.����Q�x��䠘k�����-[�NUl�U��S��E�U,�v1���
7L_�n�:ҕ�4�&eV/���B��jM-�j�����(�2�E^6����bm-%�oSE-z���E�M�z���ex�s�t0?v��F�F1>)���Z�Z�A�e��Ee"��l���MT��E��]j"b��c�Ԕk��Q��2�^[��1�l�w�������j���rD�J'Z��0�2o�wq��oSE�-Xĸ+�KmS�#QݣF�M��R������YZaV�`��'��"�m+Ii�;�兿�q?U��Q9nP�Wv+���u*'z�3
���T���!6f.)�Vg,]?M�c�QYb�r��6"2E�`�/��nL�C2��rd9���c�MBi�h��w�:����6���s%T�r�9>Ȏ�&.�3U�7���F;���J4�Zi!���&�)�,���I]U,bUP_QM�z�����f����b�+C
�{Ccv�,;[j1}��	��̔*3��+}J����N��.�Ұ�O�c4DDV"���]���ʅ���h�Y���e���~��¬�'V�FV4�)�*l���a�+ʥ�tb�����X�w���aZJ2�V"��W�o~��`�����R�1��L㊬�$EYb�1Ut�fi���f>��v��l�v���]^z�-+V,.ȸ[K������j�4Z������L�zF�)֥�1U|K{��e�0z���U1�%�n�qt�z��.���e��Z�v�	�u�0�8��r�}�%rƊ�:-k,:�hê��Xuej�X�W+Z�]��O��N��,\Ԣ�1�&�j3T�6Ûh�K�%-[����F#�Q0<�s7'Qa��3��~��6:Җ/��1V�uQUKMȢ����,�7-j�_M����݂u�k.ꠅ�d��,]��ɪ�[Z\�[�]�U�`�2�i^U�J�c=�gfVX����J�i{i*RY:+)�4�j���f����O��+���'^ƺW+�S%�'�[oX��FR��ҧ2ҕ0��J��_Y]0~��ÉFc�݅���������2[i.PUɹ�7fɵ��t�Q<B��J'Y5P�&Zeqd� ]���^��ak"ж�M�Ir��{�"���	�4rV�p9&�	�Q���oM촩'o����b���>J'Y
4��3lZ4P��V��P\2[i(�J"�aH��3REŖK˔ɍ}?��P��iRWZ�Z
��1���7-�_���n��Y��^��N�bF�5-
.J��QV9 �$TUɮ��qk�փ]o��b/����SsB
�J�R�}��6�i�Z�X� �K��*��a����l�Y���j�EW8�d�^9��o�F�(�ٺ��اac��]5c�L=�e��fase"���ޟS��Ŗ����c:�[F���"��Q��c��a��b|�vW�NiR�����GeNj�S�k�*
}Tlb�X�c��7��;w-�_+]��eb�%t�άME���c��S��A���
}؛l�n���I�M�[�Š�
թ
aXi[o���f���J�}˭-�q7��Ou��XVct7�e����|+D�5m�t��4��Ƣ\����כ�*���cP�k�(���J��vᱨm5����N-�eط�oÆ�.评AVF���pn�Ѻ;�Q��?
y�_�_�-�zoE���I(��(�/z��p���1&&�7z����R��2d�7�n&���x�W��j�K�j�3G�ƷW`̬/�ߠ��b¯˟W���6��*���̟�׉[���{p2��W�~o�K�#���""�X�n�X�l��b5�?�H���ҁ�l�Ę�2Y�I/F*EH�qb5!�H��2w1�l�^�+���E����woocommerce-admin/images/onboarding/eway.png000064400000021427151335517650015234 0ustar00�PNG


IHDR�{]�@	pHYs��tIME� �1 IDATx��y|\U���ϝI&{�4K�6iKw�R
-� ;"" �,�OA�*~��_����!�"�
������" ��-]��ni�4{Ҭ�����
R蜛���$M��W��s��s��<�y��*��KtKtKtKtKtKtKtKtKt�	��i���
��oq�+�����zwhx����'8<�VM����a�f؉�m��6�4z�!P
�5H�~�;
j����7ْ~o�`/ڵvm����u�_C+
:f5���3���`J��ͅ�	N�a��j�A�Nt�h�඀���8��w82�ȤY��?�����
��A�� SOA*�@0�ّ��і���@Ԟ���	d��.��i��q�`R{2V%F��ڽ�rt�ڕ��s�'C�1ȜO#�fB0'=���
/����H3Rv2�<�-fF��:���H�Q��]my��t��=�g枊T~���䈩Qt��m����K?���+�d�d�A�U?��k�6ɥ�:d�ٙ�f�+?��M��D݂T.��=t�#h�C�sg��W�1��#Ȕ��M�T�<�n���w̯�q��9�ׂ�UWB�/����p�V�c��6���|?=��9Y�
d��캾6��Nw˞3�����2��?��z_`���©�iǪkі��y!�8��Yfiز}��0�H��в�E�?�+K�׉���ݰ�oM�1���1t��ц���Z��p�~5)��I{���]qa�H0�0��lt��<O��۵-&���i�Q���mz2��]�������@��4,���P�����k>��h�pW|mZ
�^N�@gL�{�Lh4�&� �kU�k���ޤ�>�G�Ѝ�z�j��w�ۀ6}��oC_k|���y:��P�;��6�$�z���H7y�6��
1ی��h㗓��G��>��=�x
^ޏ�nf�K�~CSړ^t��Z���WoG��	�d��ԀS��n?�M�6��Λq_܌���ao���MECGC��X3�2���붇�I2�m^�T-Ko;��o���� ��'�wB`:*����AO��N���o޸
��K �d���8'D���~�6]����Ȕ�Aa
�]8l
�σ��-+�柂6ǥʻ/g��d��CJN@w>{�7���A�?�����;C*LߖOw=t�d�Bʏ4Ht';�A�yH�{�h:*�@�w��POs�C����Yt�u#�����/��u
!���D��ǃK�������l��Z�Z�~mxm���=��]S�s� Thx���NӢ�m~����H���ì��/�����_拁��@�GCCalC�)HũH�{��r�B�]��W@�"d�Yh��híyٯ#ѭ_���Ȕ����ѵ�	��j�B�gq�Ypab��d�{q�_�̼���C��q��׮�ҹ��q���[�z�F���i(���i�*�Ѷ'�׋���}���; ��7�R��Ȭ��z2��H�%��sp�_�i~j���@w�euZ��یn��\J�9���5/�-Y�*+�}r�}�s����7�;lD�Z��-߃�48�{Ѧ_$����pʛ��M���{f���$��Y~��dѽ8�����&�(��E ���o#�<‚�w�5��N����{���E�SdkJ�l��?�����F7}��/��!�3�>�u�i��^l��Z�g����XޙH~�Ҹ��Z���j�j��2�w >&̮_�;�e���k�
�ϯT#��M�TGy��,�rO�Y���z�>o2a~�ֿ%�[����%�����\j͈�6��>���p��?�Ud��~��]7}Ū�)'zt��s_�]f]��/L�[�L�9��R�λю7L-Df���@������.�z ���֔.8ں���
!ӎc��q"R����=4|*�"%D��O@����R�
d���0S�y�w�l�5�H*�4
�3K��SG������0:��-�'RԈ(��Ym/<����YD\�>ZX�w���2<%D���0_�:�sA�d�2��;��~��5M�ʓ�$Ӗ�B_K
�0��k���r(2�t�}�q6�w@�-fi>��=s��W�w^�}�n��T]�����O�ϔZ'ȌS��i�g�#F�N*�%��-� ��|C�1�~7_X�v׏�[|"Ზ"E��䕲Px��;�B�-F)ћ�7�o最Lo�ߨ����y�;������+�����=1:i�
m/����"��#�s �$�	B�(�{�v���x�ӡ����{>�vn�,ѣCh�
�ն���'ox�g�N�A">���n2�'���N/�-iS����g�zfN �>Ǽ^4]�]ɯ7�; ������k&��@�g
Wð�	���]wm�����TC���c�3	��o��Ӽ�%S!߇d[��<��3;�K��o�)?мX�
h�3�O�#fM,�Hɬ4�pN@�z۝o~4�[�D�@*�4�V�n�4�&ֽ�EG���f��*���,C;M�^d�9���d� ����w�r�]�qȯH�M�Z��z���_�6������[����c���D�F�b�B�����:�z驺롷���H/��x��
�|�CV!�C�4$ʈ{�R~�FMl��6������-ѓ�~�CH*?0�G˖��<���P/d�j=R�^t{(���mB[_A�O�=ݍ0`^���=N���O�/�����PP����x�,͝�P�x�X4}�h��h�o`p
�:���1$�b��Bd�9��5���B�A����8ѓc�A�>[M�{ۭ���d���m�/�C�F�O�b��3����:�KH��w(��������Kܯ���Vq<R<
o�A�?������n�yw���r�$w�t��O��1Ry��Q���w0iBKt7�;}^���C�h�Z��2���s+�hsL���
>�ZjOG;n��!�-��s^�M\D�5�Vř��ug�!�ǡ�3,w"�ş�p���q2=�$�h�k�ƛ����g�7��p�Y��jh�`3�F����	}h{�kYs�ޅ�◠��W�T��a��k-ŵh��0`���r,���~�e-DVF�MYM�vj������5ȴ#�T�iV�C�"��''�7ރ��ј�ak�+���4%�М=n����,ϓW݉6��2C6E�N��CtOlv!Rr�y�u=}mq�U3_-��r�@�'|̈�gF��
�c�Rrd�%֍���u�I;������6JE;�y�=9���9WbΘPl��h������x�uƸ��^B�U�oQ0���xlWf�knG��?��`�is��C��F��7�%� ��)Ef���rC[{�x��	���ze��@�8y�P|�R9�<�\�u���ې��#l���~p)R1r�#)��f/����n�#r�e��Z�J������D�vE��m�6�2&�����^R�@�����Zb�3�z�(�7Ӆ93���#��]L6����� ��[�cM�/���Ry,jLB�Aj�ɋ�X�Ȕ���b��D;�hV��(����7l���H�	h���O!� dp�
���7�_����J?��D����&X�h��4�8�s\��{7‡��{�6h^�ȥ�T�����>^�/9��	B�p�1�l��&�ރT~ˋ���ʖ��zRtѭq�1��E�c�����h.���Q�w���}~���6>kN�\�2L��q_��
n�@�^�s����
:�x�sK=E<���V�c�'�}���It	BVMl�th5
@va�B:O��8H�,�pZb6B�H�h×cϯ����ǐ�
-/��?�gW}'
����o�ǵ����{�D�{|�t�'1�Eo�W1Ĩ-�C���rP�}.Qp
��N�>_�99���
1��ўz$�0yD�����N�@��M���h�=IB��鵤�K���z�u{l���6�l�<����T�2��	��Ӷ�]o~��2O��6.��I�<ѓ{{	"�>	�ZVL�^ʙE>�W7޸�����̵Ȝ�Pv`��^��'�u��;{x��_4'��:)O,�Q��դ�;#:'�&��"�����;��.P8���'T�p�#��Tk�>���mdu�:��Ԝ���$lV)����;�C�m{F�莛||�'v(��nC�B�ac'9���<$������f�L{�0�Eh�d��H��z�lNٴ�B��m��n���� �@ϳ�gU��t8��8
�s����7�E�*s�����w�c�j�d��6���W�Kf�s�
ue����1�E$2���_�G�-/L�,��H�����[�xZ��o0̩F��'�v�U@����4\�Ս�MO���5)���w�h=�
�3�p�_5_/�LB0׼���Y�t��sh��M�P�9RI���Щ>ʜb�)�Qh����V��CM�6)CH�94��x9�{��Ǟ�qY�4�&�d'��R�����!�FH��!hX��Ϥ6��H�ҵٿ�QƉH�B:(��x��R�� �ɦ[�����{�vl���ce��F�֡-/{��LZE`^\y{~/�g�F�&�L]h~�L���E6w�;Ϥ.�;�����/-�݌+��|���ͷ��['Ӄ9H�Y��/�o���<�|��ۑ3	�r���w����Vr��_`�}�ú�^k�y޵
m���?�8�l�p��v'g��k;t�u�7�;Ad�'|T�
��=Όπ(�ڎn}mx>e�L}��)���籥���2#�5� ��>i�O��]�$�oF���"a���|֥Hɼ��Uv��ݼ���f�Dw<�qH�<�^������	�ޅ�z�wh!S�����}�@t�躓q�;��4�gg���1Α�ԥ���Z���=/���@�O4�oж�L��Z��pn��z{>���<Ϝb�0��F�问wim�nڞ?�MO'��8˜�	��/����6�@�KW��:�����^�&�ť�}��L/�&U��E*OK���>�xB�ݿ_f�'��W{[pig���ϡ�>��
�̾0~�Df\�q�2����c�t��mN
2.��W1C�|�l6]���@Zɮ�㮼L'����L���	~�])Oe$�'�Y�v-T,ݏ�/5�<D7ஹ�\ #5���=���_�}SuEµ�@��dž��pgj�hDp_�<���A�y�C�O��F�^���R�
t��C_z?�mD[h�d#3.O����=��"T�T~-�0�p��F��
r}L��[p�z[R���m��_����_[>�?2��w7r������/��nMQ��vܗ�]�$�Ѝ!с�<d��|b�����M���GW��I��2�{����[?3��\BǑ&|�2.�S�8)/��v����#��	N�V�Af^�O�ո+>��x"����^�-y���^�Y�Ӹ�!�iڼ&��I�W�p�����p�h�:�N#�a���6|M�G_�h��v�%Ȕ�ʃG��z8����k��a���³�ſD���E�(�ꫡ���؅,��S�Ӂ��N1��U8�y.�D#r�嫠����;
�8Jz	:�G�h���
��|6�	]�Sd�9�%�x'zv�pD7�Ч3���#S��85%m���@��H���8�^�T]��@7��E�w8Mp*��X��(��*𤕺h4�)޵�|�VBt	%��>YtU�ɦ;_D׌�I�9	�П��`�vl��z�ȷ�ŗ���I�N�?eLos��s o2i9΄�$�1(�iw��:�<�ѭ	�s�����ё�?�|]}�9��:�
NE����7�"��@ ҏ��C��tr��Ft�E�?����$=�!/�ҧ�G��?gɷ/��T�}�Zi��� �,�zY_+�s'��H!���jYj��c��bs*�B�^��;/�OEW�kOKlJ)8��k�n'�M)
k
��:�D!)���a;J�1��;!+��N��G��]s=�!?N��X3��Rf����9���'b/� -�Ǥd��=vwf"s��Ӕ�jR�Y�gs�w���S��Vz����<��S�I6%VZK�2�忁�t�)��B�=9�Qd�GR�f���!` Qɧ or&{)?�Gm?wti�޿l���q�N���s�y8�<�L?�t儓)�|7䜐�
A��p��!SF�ܤM��g	ȯ�Y�#d�� �$�}u,2�78�����D��*�����|ک)�㚐�3����,�ZE~9�򫑹�JR�KT�9	Yp'����N�X\������k�#��jd�-8]�igQC�K�$�ݨ�w���G[������F��Ȕ����Ʀ�Vt]�s��/m��H�Ǒ��g��-�믇�'�A/�͜Ϥn�!��[��6�
��H]��3
�A�NA�%��
��u��w��v���%ę}����q�==�.J�8�#)�nf��&�Ю���{��&��L��Ð�3��[2��Δ��z��n�Kd*�vD!�P�*��x����4>�6��ՠ]	�s%�,C�NG*��?��B��!�mB�>��ޑ��Y��)"5�An������>sX�2�L�C~�Ԙ�
�w�`ڱzahvB��("A�B���d@~�W�7����^^��&o��@�ܰt℆�"�C�T�l�Xe�ID�i]�;�����Uv�p��"y� w
��y��g��s+��p�nҧq�����wTvR�X�I!�>�z���n-�Z�LBrv�|��7��[�9+wx�rhq�w����F��|F}Mf�,N:�mp|���@[NO|�Il�8�-������,�^w����6_̫a\�[XX$��Xe�^�|�%���x��=��w��q�v�E܈����g�z��a�k��{��d��m�Z�[��.���[�-�,����u�-�.t�´/S�Վ�U�-₻��{fB��g�9)іюC0itG�-�-�滠+v�.m�ib�+��
D�ƾ��ɫ�D�H�,��݀6�l�h�j���|=g>�Z�[�9Ő�S=�uEj3��k��n��>i�nd��f����l��@o]����/E�9�߰D�����l�m]k;)�C�֟b�}:%{,�-�Cv>�h�J���l٭�"ͷ��2���PqxJ�X�[�9S�H������M�l?%����=\����᳽m��^u(dfM���TO�6���k/MY�Kt���Bf�T��mYc�)���
W��JG��	g�n��T�8�1K��?��~�Q���{�T�
�Kt�1B^Rq��z�#��l?��g'Z��i2�R����"q�>����a�ˡ��vT,���sUBȬo�<��%�E�"5�a�q���v������oz�7ߒ�^�갔��%�E22�9�|
r�_�Mj��h޴
��	�RC��/�� �%�Er�.@�ȷ���9��5�W������{H�´��%�E�r}�|�|��kF�}:��
��]�u?f�'��uV�ʈY�[�b�q�_d�?����!ܽo�Qdw�
�w�O?V#�n�*Ѥk��l�rK������N�W~��}�䫯��k�5��/����%�EjU���ԯ���y3��;�4�0��Fh�����{��\���"Lx������ůM|�=�w�Ж��[|1�d��/�H&ݱ/�h1q0Ѕ���N�7'��WAA����f��߄�?��\���.(������"��ى��gG&{`2�:��&J�5mZ�n���G�D�ë��)���"��c3��"��a��"�����/�<�=��at˗A�G^�*�$�D�H#�7��>�82�杉�42e����[�
7����`[���|��k1���CW�+_��G⻿�K8�χ����w��E�
�>�Y� �)�;&͵D�H/�Zq_�"��Y�%���!d�y�S2�2DiAt�t�R��IDATǯG���DΉ8K�S�%�E�1؋��+��	��R��Pu$R2Yc�`i�*���5���Yp	�M��[�[dȘ���E7���Z�T��T�9�Y�W�U!��l�m��[���N-R�yd��E�YKt�L��܆�z-�ܑ�םZ(8):J#�3�*2�Dx�����v�y?<�ߍ,�R�hܘ���G$�n~����[p#!���H(��eHv!r<)��	x�_v��n�!�C�0��[Ѷ�����v,s��ro�0�b,�-�Z�N_+��_�繎W�;�!PNH�{ݲ(����ц�v�އ�5�x����3X�[�1�mY�nگ�ڟsR{12���m3-�-�	�h�vt�m�hb����BG S�C��и�^Kt�q'��G�֠ۮ��q�:��bd�G�I����]Kt��7����
�>HҎ��R
�"EK��������%���!�#�D;�@���g���AS��*R�y�Bj�F&���9{uZ�[읈x�j=����4�����&�l�_��C�\$w&�T@N9�"U��7����b�H}\ﯪW����S��'��g�?&ʹxKt�}6g���%����%����%����%����%����%����%����%���%�������fᠩ��JIEND�B`�woocommerce-admin/images/onboarding/creativemail.png000064400000003533151335517650016732 0ustar00�PNG


IHDR�7z�%]KPLTEGpLA8\08C08C08C08C08C08C19D08C38Gf3�f3�?7[08Cf2�:6Se3�f3�e2�08C08Cf2�08Cf2���>tRNS��v����K5���K"f��c�ս���IDATx��v�*�gTTIP�|�'=��a�.]�ڻ���h	A�ρ��/�3���M�v�t��~�aL�Lc�	
}����5S�4�d�6���|�%B{,Uh��u]7J�]�	�k��t�D?���.��s�
n�R��h�ߨ�����Wyʤl_�p������OT��%z_eW�W�T0Q���I�7�5~D�,/���+*5�7�ʽtlW��@%O�֝�v#ꎙ��]
1ݬ¸�1�x5���s`"j�6���#ұ�i:�s�ρ`��x��Aec�,�T��Զ���qQ����R��tM�E�Ɔ��(�L���f��-��F�\)��JK�QH��1Z
PI<(sH{�Yuy�������'vb�&��cVqcAM(��U�Ζ)��{¤�T90b*v[��}���I���N	��ާ�h�gN��&9)�}���̤�&�[��9�����[�x+�=�T��EUTҳ�s�k�׬�Q,�T枻,{�p��a�xm�U����&��S���ǑU�$�`"�D�**ޱ���F��s���`�TT��Ϛ�
s�]VYb�e�����d%-��
���5MŽ\]�J�F�`�A����8�+�*����~������D͙�V:��U����POh͙6���I�hIY�^+��kEc��� ���T�v��:·<T��8�P�:Q)ƨ�o� +�;*(v:%BيJ�J�����H�ϳ���pQA��Z`���7&�BC�+uY,T��
�b>�h*��,E�_T�ؤe(
A����=y���@e�/=�����K����g�I!*�bJm0�m�9�j�Eu�7f�y<�9��4m@�p�,*���U*X>��i�v��
~F5��5�XcU��&v:�-T��)m|�6��(0�V�
��*���c�Z�
Y�%��*�M�{_TY\UT�?�`�[#�gҋ�^�[k�b,T�P�J��'�
	��n���v�
*<���X��b��_N�E��h>V�U����8�T���zHWC�Wp0[wJ�n�*~�b��0�}%��~�N3:��T��=3P�憁�زm�Ԯ~��i�����r���� B'i,l�ku�1�kI�ÇҞm�@�&����8ӳ�;��X#�9��F��1���6�r���]���NA�77777�3A�S�t���o�Zj�GT��j�A�%��2�v��ojN�'�
�T8�x�:�9|/�k�،
�
�h��t!n;-3u &-Ӏ�f��#��+�b�(2K�����U���z[��È���Y5&_�{]Vq	�G&&�]٭L�[1T޽��̆�s�H漂1S^��-�j�i��B�%(1���Z�+��T��L+�����ˬ�P9b�~�`ǀͫc����B�ƆG-��c(����d���ap��r��X y���~Wz~��7t ~��#�<X�"��x�o�V"���
���7�=#$�Ǿ����t��:��
�r.ӄ�xP�\��J;a�@���
�p���j:�Αy�iL�F��L�NO+su,�q�a�u�/V����Қ;.\�d
_V����70]��]e�|{���5R����V$��NLAv�Ƌ��y}�1ݓ,xZ1���<�ęI�;���T���Z5=�T%f��<�XWk@��U'HMr$�c�K�י����K1����N����Q��qsss�&���sSIEND�B`�woocommerce-admin/images/onboarding/cod.svg000064400000005020151335517650015036 0ustar00	<svg
		width="96"
		height="32"
		viewBox="0 0 96 32"
		fill="none"
		xmlns="http://www.w3.org/2000/svg"
	>
		<rect width="32" height="32" rx="16" fill="#8E9196" />
		<mask
			id="cod-mask-0"
			mask-type="alpha"
			maskUnits="userSpaceOnUse"
			x="7"
			y="10"
			width="18"
			height="12"
		>
			<path
				fill-rule="evenodd"
				clip-rule="evenodd"
				d="M22 13H19.75V10H9.25C8.425 10 7.75 10.675 7.75 11.5V19.75H9.25C9.25 20.995 10.255 22 11.5 22C12.745 22 13.75 20.995 13.75 19.75H18.25C18.25 20.995 19.255 22 20.5 22C21.745 22 22.75 20.995 22.75 19.75H24.25V16L22 13ZM21.625 14.125L23.095 16H19.75V14.125H21.625ZM10.75 19.75C10.75 20.1625 11.0875 20.5 11.5 20.5C11.9125 20.5 12.25 20.1625 12.25 19.75C12.25 19.3375 11.9125 19 11.5 19C11.0875 19 10.75 19.3375 10.75 19.75ZM13.165 18.25C12.7525 17.7925 12.1675 17.5 11.5 17.5C10.8325 17.5 10.2475 17.7925 9.835 18.25H9.25V11.5H18.25V18.25H13.165ZM19.75 19.75C19.75 20.1625 20.0875 20.5 20.5 20.5C20.9125 20.5 21.25 20.1625 21.25 19.75C21.25 19.3375 20.9125 19 20.5 19C20.0875 19 19.75 19.3375 19.75 19.75Z"
				fill="white"
			/>
		</mask>
		<g mask="url(#cod-mask-0)">
			<rect x="7" y="7" width="18" height="18" fill="white" />
		</g>
		<mask
			id="cod-mask-1"
			mask-type="alpha"
			maskUnits="userSpaceOnUse"
			x="39"
			y="10"
			width="18"
			height="12"
		>
			<path
				d="M39 17L53.17 17L49.59 20.59L51 22L57 16L51 10L49.59 11.41L53.17 15L39 15L39 17Z"
				fill="white"
			/>
		</mask>
		<g mask="url(#cod-mask-1)">
			<rect
				x="60"
				y="28"
				width="24"
				height="24"
				transform="rotate(-180 60 28)"
				fill="#8E9196"
			/>
		</g>
		<rect x="64" width="32" height="32" rx="16" fill="#8E9196" />
		<mask
			id="cod-mask-2"
			mask-type="alpha"
			maskUnits="userSpaceOnUse"
			x="76"
			y="9"
			width="8"
			height="14"
		>
			<path
				d="M80.2926 15.175C78.5901 14.7325 78.0426 14.275 78.0426 13.5625C78.0426 12.745 78.8001 12.175 80.0676 12.175C81.4026 12.175 81.8976 12.8125 81.9426 13.75H83.6001C83.5476 12.46 82.7601 11.275 81.1926 10.8925V9.25H78.9426V10.87C77.4876 11.185 76.3176 12.13 76.3176 13.5775C76.3176 15.31 77.7501 16.1725 79.8426 16.675C81.7176 17.125 82.0926 17.785 82.0926 18.4825C82.0926 19 81.7251 19.825 80.0676 19.825C78.5226 19.825 77.9151 19.135 77.8326 18.25H76.1826C76.2726 19.8925 77.5026 20.815 78.9426 21.1225V22.75H81.1926V21.1375C82.6551 20.86 83.8176 20.0125 83.8176 18.475C83.8176 16.345 81.9951 15.6175 80.2926 15.175Z"
				fill="white"
			/>
		</mask>
		<g mask="url(#cod-mask-2)">
			<rect x="71" y="7" width="18" height="18" fill="white" />
		</g>
	</svg>woocommerce-admin/images/onboarding/paystack.png000064400000004117151335517650016103 0ustar00�PNG


IHDR�G-��BPLTEGpL22224232222�������2��=(ٜtRNS!��
���6ui�_U�&jH��IDATx���B1�|�������B�;]?����D�H.'=����d�c4�����@
ˑ�&����Y&�8^�A���DNY��˼E�����u	Ya ���@��@�Y�w�ۭ�8�МN��_ufy�D�A.�V�$�_�i��G�(��Q@r�Tb,������PJ	$�져Q
%���g#����J���;L$�@�쟜s�����z_��n��e�7vΧ��"n��g��9GJݨȻ�:����Ҋ<�4眔�Q�%--u�(~�C\��@.sg��Iv{e� r�2ιM����]%����{�,�Yr�~(op��e��+5�:"��g�"u/q�khc{�:f-�3��j��U��K�)�>-2�5H �?���2*`�0�Jh��6��}%;��A_W�:��&2�N�{i/ͨN�u-�V
�%s1���<pv�����_
��q|��J/�e��T-��DO��@0q6�u@��\瀈b�;>���uȨ-�@���^���(���L�'�ia�-g��y��D�_��w���)��y'A��mü�"I
���@�œ7(@X[G��ϧ�r���������,7K=-�a���lr=|�w��Y Q�g�;��H����z�KH�rc�(���V�g������c�"���칕A�"�����ڲ+��T ng�)r��.,���w�/��Kâă;
f{���Z�&F HI���J|��Ɵ#�yo@��xƚu&��559넪�xmQ�m�5�I����J|"�U>Hp�4 �8�(���׽b�����q�=V�
����e�ĝ	f=�8Āy����
6В�d��^�C�`���Hr��6�u�w�)0��MDiS@b/�-u��Eq'�A¢Զ��a���hd����Lі�m�4ȶG�a���_�VzAi\C���q V��vtB�B��%�@Җ�(����y ����a]��O�2���Y_a�T��a
9���X�<�{�*����t�i���[�.�`�1�ޖ�pHtwW��Z�h��T�Y�1/I�B�CR?e�ٺ�cj�O
�h@�)��`F�~ӠqqK�ؗn�ўJ�eQ'촓����Fz]-i��8�r�8���g�&�_�IP�h���L��H$����X5�wx
�>\d���@��tR���_u �J�W��*"�PM��N/�a#���/J[���[?�x��i��,�n9&m݅���#�F6
��	�t�WI�gK�F�I;�XH����"×r8�'�~�!WE��q��$
�;��s�5I��V>���B <��6%8E�+�_��9&
(
�#}=B�Mq�~^g$��%�왦o�yҀ@��оȂ۰i t��5�5٘�4ĥa$�@ ��a�kMa{���@w:�2;M���
��jH�Z ���1��dG�~�o �����6���W�u
�L��5.�6�r_lSu ����~8 �ylŋJ����t�L�?�2Į#KsHZw�i
��wQ^1�I�hC����kS�#������2d���a��Ϙ�~|�F������w6X��fř�d��h���.�r�8�Ii*y1�a�.�d���2+�S��f�n�/�>�:ʒ��;'z��߸o��8���'�T��Z�n�v�F��7پɵ�来̷f��W��k���1Z��z�&0(�4�� a��z���@���m=�<,�r�t��o<�&�[��g6�D>.9�~Ì������a1s�����q��<�|�!�j�|��P��X�����yow�~WYd���C���������/��r��Z����[��l�ǡܔ��G%a�C��ӓ{,���K�澙���f5���IEND�B`�woocommerce-admin/images/onboarding/mercadopago.png000064400000004701151335517650016544 0ustar00�PNG


IHDR�;���PLTEGpL)/l'/k)/k(/l)/k)0l(/l(/l'/l(/k&;w M�d�r�X�(/k)/l��������
�� `�R~�5?wv}���������㳷̉��Vc�����HS�jp����r����������������������E�i1tRNS(@�����Yp�����Р��������������������d�� B0����g�`�IDATxܘ�z�<�M'�
n���-���p�\|���w~�8��dB�<����}Xi?P��$�@�U�$۝ѯ$A�}�wW�z�0��.;�v��m���{'��Z�+;�_;�-�c�Q�&x9V�\��:� }�$J򭢋w+��6�/ߛϥ�~���]�"��A�{)Jg���R�E�JGBh�����0�=ZM���:���(L[�ߓD>Z�T�c-2�;]>���G�L�n���{�v�S�C��b
=i��(ȝ1h13:��<ސ��/L�O�x?��k�"9,��A�v�)�u8��0��03��	oq�Aߵ�eʓkL�M�8b����(N���z)��$��-�م�y�?�u޹�O����E�ɭO�~����.=��p�b�Uys��٥�>"��K�.�J��2���\x��ѝO�bD�h2���Ѡ�n�'͜�<�Mzċ����h�l�������G5����e�َ.u�|���W	ʟ��f�/
r ����֬`y��PUnS�k�8��Z<�^�
�Й�EW:x֋��禷gJ����1^� M4�\X�<K�k����G�V8ɐ"��s��3�����5#���9��[�L/��jW%?�p�O���(��zV5��?
B��A)e]�nŜ�'R��|�j�I�Px�I&	�$Z��+S^��)�.xp��.��$%�Bgõx�(��\�3�/����=�F\m�J��ޙ�,�ĕ���?�/�i"��2�&[	��`�",�6��du������P�d��Bc��s�]���H��6De�_0Yl;�0w��%wG�b]n���w�Z��e>�%>��=����5F�4�IJ5�U��B��pyN�i9�HW���s��;	���De�,��1�84��8b�,�v�k)�s�Vww��Ϻ�Q��㶦�H�M����A8>��= ��^z�D�/���U]
.ȅ]�ǀG�Ob�,� 5m�}nN};�͋��z��^+��|�&#>�?'T-8Jٲ���]��x���k��^�&V�m��Ny�>�9����D:&x�M:wa���./���1q����Z���^��d����VJ�Ov���(�wO�4�V-��:Sh����Y�XT�Մpz���sGL�7���>��Z��5}Y���M���;͞o�ӓL6
���n_Z�'_�!1�:�;�j>sŅeIGf����b�]J�mߗ�Tܚ�s/�ΐ���L�AUu��X��\<Y4��Q[�����ߵ@Q�� m��k�M��@ϴm��9$f��zN����z���M��t��1��&KȞ�3���J/�b�UZk�)ݙ^ɸWo4����8u��G~~���1�ayI���[
��u����g�lz�ު�R�gs����gb�jfޭD�BS7oQ%jp�4�1��/�.<2��0ynws�fӋ)c�@�R��"nF���eX�^9��b�/_���.����i�
5�26@���nj���4c.�^�nB��u���v��D>��zm>=U�1�G{���K\���ȉ�6���L��)R�#�BXJ<M�Aq���.q�6����4��pjx^Ҹ�Ϟ8r�ˁ9�5.M�]4�,���S
�)�:��u��<c
O�^[Ao	��.x��	�Z�=�`"��ub�@o��nށ�c��٦���x�����vѤ:�%�C�Uq2�/)���^�u2�C�^ϘQPE�kۯ�`H!�!���2�<���l�i��&�����G�+�^I����/�Zv�N�E|
�gru�	2�_·������D�-n2S>�ϡ�?��>иh:��!l:`�l{ݻ��m�a�Gc�(���c`�Q"����u�]��t�'�/bO�f���$�0�R�a-ΖÀ�@Ŭ��/٭9�Q��AYk U��m�0@e,���8&u�>����p)�S��|(��C�`�Q�c$A	���tay�z����i�	�j飳&|���>��`!�����Y��3>��>�
�{x3��:(���"VR6��+4X,��lo��k�������\�yn���T�{��x����~/�?kx9

����Z+��9�G�2˴�����̨�����28�PN�TJ:���%C�W�m�T>���iV����=�%Z4���d�@����`�j�����JP����b��fp�ҿ�k�	|\VIEND�B`�woocommerce-admin/images/onboarding/g-shopping.png000064400000002454151335517650016341 0ustar00�PNG


IHDR�7z�%]�PLTEGpLB��@��A��A��B��o��)~�_iw{���P��\fl^bg��A��^bg^bh_chbkg^bg\fg��i��^bg^bh^bg^dfahp����8^bh^bg��۶^cg����
A��^cg�r�:5�R
�c'�X.�T3�R���/tRNSZ�?��Y��)4��Y���J���ɣ?7��td���vfN������	A1IDATx�
�@��SQ�_q���""""�s_�����C{G����J�@s����헉v�(E�wNx�Ht�i&!����Y������
��e��¸���ت��R!�$�=��
NV�V��/,��K0��RNto���Z��*�7��!�a��0aobc��B�'��n,�oN����Ke
@���o�
?��bC��َ��n*�]T�j��Ԑ�Q��T��P9**�߲�BC���G�B�>bB�>҂w�6��#ٝ��0��5���,����2�
TU��<���Tt�Ļ�D`��a�6� �_Ј�t��G/�P�k*��Gd�AE�QB�U��;�$D"�w@��s0���,��qc�!?zU�P�E�%��U��#^�=J�r���yބ\�b1�k�rؐ�|0Q�kq�gq�U�?v���S�*!��G�'��h���>nUR�06o��Q��@Rf�՚�xI#.���я� U?�L�vkz��N�ȷ��cSQ��A���S1Ǒ�<�:�Aг�yqyy���B��BC����&)6=	L�m�b{ ]V)�*9.1jXX�A�+�۲!��g�����뫫���I.d�}
���fcW�@�F=��TWɌu:�J^UE�E������p}���{.�}�ߐ5��}���7'�����mF;nд�+kZ�4�JF�N�$7��M,'�r�K|�s(]*�i�A�U��	Ӥ�J�,�2$��֓��z�-�In���/�O_~[���C��B<�y(��L�=z�y�͘��eo����EW:o�Y��E*GT���B	y���%��P�3]�&T��a���ha-L�Ɔ��E��_�x�u�m��a��B�<��ާ8k��
	�MKr�EF�SӾ9�����k��1��Lrb�)�>�R�y�$#E^kV��;O3ƨô/ˉ<�s���0E�v�\L�9�$s
�����>��VZU����O�PimG�v$
�ѿ>ZD迀BH���8p���{|Q��IEND�B`�woocommerce-admin/images/onboarding/mailchimp-for-woocommerce.png000064400000004622151335517650021331 0ustar00�PNG


IHDR22?��	pHYs��sRGB���gAMA���a	'IDATx�ZpU�]�$� B@A
"�V:B�Կ���	�iU�U� J;
bA���7*(D+�ȷ�'� 	����w������w_��f�K�}�޻�9{�9OPZw	Cj� (􃅮4�i�/�����G��hvn��s��H���.����/�t_P8	+��D��2�������	�/D7A���svzH�)�3�R��w�*B������g#c�A�."~��"�����s�ow��w8�\�B��RY���|��g��H���u���͔.��V�I�jQ�u��h�鵎�Y!�u�(0m�������ֈ�
e�}
l��B�\:��l�.رOp�4�yYP��F��o��h�n��O��8{�`_�:SFi�n�����^��p�j�����1���k|���;j�
t(ʁkׁq3������˘�����&�zֱ^|x��K�O7b��ߠ�\e��l2�?��ދ
��?01AHD!P�3��5�"r����C�O�k!�K����4b����6�թ-\�5����I�F6���{!��D��P�Fu��i�B�K;L���t�����[�D�[���~>I4-���y�+W�0�B\�C'`�̑b�����pVw���_��+5���pE�+#��{Y�C�3��R+\c�T���(�Nx,�������4��kT�����q%.��9�ū}��KA�w�m��k��u����u��d�r�DJX,x�s2�s����a4���y����w�0u^nP^LL�>(X_��1�53�tC�m+m��I>[`a�> �����w��p_{��7�5��� ���]�s���kT���O�-c�<T�~�:h���� ���v�N���\$~I���Ϋ�H�-��,.�
�p��Z+7(��U��;�e�Ek}_ސu�/i�%���Q�n�
�t
~�|�Bx��(�_�lM�:���	6|%�r��.��O"7�O��	ڷ.N��>I���^g�x��/���0��;�.�N#�����C��T��p�1bY�Rͺ^x.%X�(v���3��1_H8�=S5K�M�,���4{�V
�A=�u[���ؾ��KeJo���)D��Q��;�k��c�{�8pɇ�U���SA3}��qQ����]�8K߲��3�Z�Ξ\h����Q��1~��A����Q!v��Â�7-�/H��7]��e�1Z��ZQ;���I�T���
�1��x�U"���}?��,yϯH�D3�k�y��]���W	�QXM��5ٲ���p����)1d�܌�ԗj�I�l���2�6 e7ş�q��kd%kDk2[�E��v�!�|��ݭ�	�U�ܔ듨-��D�J��.&�������F��5zw�P�%w��e_�:Z�!���af�\0�U�����4>��@T�;͓��I����b�aVJ�6,����
q�!'�ըa�Op�qq=[35�����4�K�[hPv��w�P�
�L��r�+�N-�č
���Q��=ԛ�G-4���:A#'�Px���3Y�\	��ׯ���|N�^�fu��:���c\�\DBh�h�ڵ|�eӛ��y}���5`�^�=��\f��ޕ	���kMq�Ӻ�+, a66r��ᮚe��&�/�sy&�	3����j4r뷂5�?En�ю.�]\�{�7{V��t�jab�˷Z۴t���C���6F�IC'�ק�5i��>�tF3���*����f���^�8~�೭b�$�ά��
��&�����hvA�׈�Y]�I�>�J��(�C��2�s>�e�>���:�n�֫
�ׁ�Ybu��+��c��y�&�C����W��ʞ��izq�+#��S��*<�M#~��%�%@/�]�鱵�瘪�����@�����?+����
Tv_x�'Sg�oe���G㔭#ej�v���\K�b���f\�J�EQa�
ӹp7g��q�n��dmg"�t�v�%��`�&�Uz�*x���0"Kا�̔�r��(�=�5Uぎ�̪X"����/�ߛ͎U��kj�Ac(3\�p��M�8x��D�� �꼑{#ɇ�V�؅��O�\Cv�ݹ���t�^A�K���0����j299�D	K��)TgC)����B%�pD��\��lnw�$땨�0%�2�t:c�EU�B
�εQ"{o�i��T:����-�J�:s�=�mv���Pn8�-HF~^i��
xI�:-2�_��'m�n���L��
L�&���Pz�z7%���T��}��?��PIEND�B`�woocommerce-admin/images/onboarding/google-listings-and-ads.png000064400000003363151335517650020701 0ustar00�PNG


IHDR22?��	pHYs��sRGB���gAMA���a�IDATx�lEǿ3�wm�D����"(�Zm1 Q��?��?(��B�
��
����5*�!@@S���*H�g�8A~IK[ڻ���m��������|������7��̛�7����A��a�gL��t�PV��4n���pw�t/��C����B��½��>(D�"���R���mZ�#�:~{W~�l(B�"���a^M$�,�4?�
P�H��ǒ5�����o�=y��� �iC	7�P�cEjw ���y6!����;q�ȩ�޳�̄6�c�!��)q�ӥ�"��5���Y8��"��2M�_%hW�fBe�;�6�������;�ϣ�$I���RDnCW��o�],�>	��ڇ^�z��6��HP���P�I�Eh�-���y�Y��-��n|�k��7�U~�"2�T<��Y��/��>�s1�	&��rg͒1�[L��bclT�{�q�1�×PD߭q�Wci�/ʽh��X+U8�*��ۈ+z8��
���sz�hģ�H�J�oI	�6Z%&$)	fi��^z����"V<%����h�_���j�$�_�ʦ��$�E�!�sFTJXL�c4��������H��o�ш�qG���Z��M�wO�,�r
D Q��47Bq.�㏮�_���͔�/�h�"�[�v��Hr��S�}E$�4�ے@X��o�dp���
�L^*߀s�.P@���)�~"�Ͱѹ6͉n����s����e,
w3�E�YnOBIrB��=MA� 8GJSd�M뾣����x�2,\b3�IT��s�Ʋ��'\�Oӊ��z�&��
%�U�csi����t�֕�bs����Y�
�3h[��Z}L+RʫF�h�$�2\V��;�Cid�
|g_��sQWJh�ڔSK��OƮ@Gx�[P'��&RE%z. �}I"�іs��������[倅�(�=�iO���p�q\.aw}���]Y�ꪒ��OhKG�ѭOb\\�#}���\lz���u.#�3u{7�#M]��~3m�U��Hƺg0����Cz�+R�ҍ�����rB\yh!��͕��9�$_�L���aLc��_�H��MJĔ���Z
��%��u��m�
u�tj�XZۭȝ�*��Xe��H�@���4T��I�J)x��6�u@L�ţ�!]���K�{,��Z:l`��&���ur�%���-�ٝ��ʑ�P�����#��kpDO��'w�y���h�T��j�-E~�sh9f�,������״��a�q!�6��A<<Ք��xΈ��q�n����\s�;;�Q,�v���m���f8�1��ZQ�b8���z6���؁E�`�y�Ô�n&�xr���A��^�Rq-�#�[��^B'|[V����:L�ipXA���%�l��*������ܽ#��=y�p�����+�]�sz��V��Q�{l�O�ش̺Ǡ�̢
�]��0��0ﰺ,?u�Un���W�WV"r�Nߪ�&��)E���)�Y�$:F��.��Q��N�k�x@,��=Nv�7�à����{n���/$��X����zo1��Ib�^���\��y=�o�.�q�ߊ~.�.����xΌ+�|��^�">��~+�Y�w��L�Ù����t~�Ԟ�*��7�����;ҕ.��IEND�B`�woocommerce-admin/images/onboarding/creative-mail-by-constant-contact.png000064400000007020151335517650022672 0ustar00�PNG


IHDRdd��gAMA���asRGB��� cHRMz&�����u0�`:�p��Q<	pHYs��bKGD�������
gIDATx��YoWv���[K/�(��(R����Y� �10��đ��8A�ϑ/$���,�<	��<H�vⱑر,ˣ�f�dwum��y�jn�5�D�Ը�q��b��Y�Mҟ�ɿ�7�BP��`U�*X�
V���U��`U�*X�
A��U��`U�*X�
V��U��`U�*?��U�`=��,3C�xJ���'%/����KK+�AǙs�f6��.��]��$�Ϟ��|��Xe�^�j�:�a�?�pT�����<w֯\9�简R�{SSO�<�FQ��G�֨����8N�\�`�[p�K�t�کZͦ�c&"�\^��׽f�'Q��z�v{�n��h�:W�c�I~�{tv��ʕ���8[ˆ3�8"
C�ĉ��əBq����u:�^oEi��-�
��
Ri��:u��%I���J�4-W�y�����s:g�~��D���F��$��Uιf3�z������Y��s���]\<p�������`P��ۍ����P���WO5�A�>HV�]D���Jp�o���h���)��F�4MQQ����N�b�8�/]Z8u�`�EP��?�Jp�g���p���ӉZ�a�
�i��(��`�J�|aa�ҥ���{ۦ,S@x�9zt�رiM�|0�;�Q�U*.I�-�{pv�B��j޵k�0s��Gp�G�֍��#G���S"H�l0H��Q�5�v��0)r���1e��+�����=Z��!p�2��1?�T=�$��J�n�:�Q�3Z]}Dpv�0�xq�̙��
{�:|�q�HSi�q�-/��hu5N�\�jp��I�i>7׼|�x�����Q�\�i���f��ͥ�[��N�j;���J�$�Ć��Fk�c?�����=[oY���Pi<��U�@X�S���"�2�2H:�hyy�nG�~�
�﹵k�cj>��BӍ�۟�h�P��G�l��p�\L�Zw�(�Dh��S����#*irSf�}�c���\h�F�ݥ��ӛ6͸�X�T�����?��?���Ii���W���M&	T��
�f��aNf��j�r11�?Pk��5���I��i��I:ߗ�&���w~(^�^Ⱦ���*g�~�~����Q=���*�W@vz����0�&�
U ef'"%�2��2�H���ԳRXe=�V}_�� �W?�0� �?��� k�{���������˙@F��`��呃�-�=�d�z�w�w��7>��ҍֹ�� 3<�?,"8Ǫ�����ǂ|4�y�z�z����<
C�|�����\����>�Q6��ƨ1J��vn�l�L�xc�2�� ~&'U�T��({J̒p�����Rt���w/��_�ed�o�z�)�~DXL'ީ��~�}c`��3�ɬk��e$��d1����j�ڻ9iF������\'�2��`��H������/��|�ʧë����7Iæ@"��[o�
�����-�^��#h�0P&�"��]��L6[���ek��$?ʆ�ƀ-�$ʹ���-���:����G�k����_L�a9
�����(}]^�,f�������L˭ԘK׿���}"��n���3�I4r�/�s��>�����OV�~����K����z�y�J�����u<�.^���o���g��	��Hb�k��u�0+��8��S7���~�f��|��7m_Q���a��>|P�s�j�o_�P��fXDp���[v�/ѽcF�^.�,�b��+�����n��
�b��*ReTd�/�AX�f������%�u/Ed-�Bq$�;��$�/u��hUSM��˞�d�w�o��v��rPӹfj-����3Y��X"&b�|�$����a1k4��/���g:��(�uX"d�:ҹ'�{�oi�By�9(;p��#_�Nx��?u�����Z"�l�0�!f*��J?�H��>8z�˔���ض�a-�@r��ߒ���Y�aYJ�ATIxg~�{����ׂf����a���;3o���v�'�%��1P �eЖ�]׺#���T��$�\So&=�]��w��?ϙ"����,�R�Ж�g�С�e�G����x��2�RZf4	���h �eY��_ʰ�<'6d�)��%������/�֖٘;�A�[��n)�6�Xd<�ţ���2C;�eؐ�-T���sOZw]��:���
㳵�N�$�8�zI.�(x���g/Y[D���v{X6������N'���S�������jS�/Bu��=׹'˷���Ѫ�l��HS��t��~R�^��N�����%q�yxR��1�&���C��L03W�=Z;4�O����g3�&ufy,@�ڕ��uG:�d��Iƒ��HSdQ>��κco�s^�^��oI`�x������>R��
�S��u1�=|��H3��fd������$�aO�w�uW�-U���l@̔S��<���g������%#U1�����e^�\˔q�'}L�}Y��$�
@����[��׹�Áf)`,�N�$�ƒ��ɁK��?n>��o��xoA��P��ѽ̣D$��O��v
���˞�fp��
̼(������(���dؐPXM�8�vN��y�����u��`�8e����1�o>�ѧh�3L�kH��8H��1�N�q����vC����a*��)�$K12���z�m\|�y�Qv^5Web��I�uC���`|b��H�^����d�Dx
��E��X�9���U��pPFN.��p ���}���?l�Y��TAl���X0����mB`PqN�C2@`�8��y�O�47]��KC��O��}��8΃���y�y��ƉӁ79�P�}��U��~���`������E��9����!�$�a���~�m^��ݹ�
ò�T�!�ݫ�wUY
\����ބ��E�ϡq�g���S�r�`c�9'���&zZ���n�c�kĿ@�YԞA��g�ں�+��!
V�S!b&�x�G�,�]���招B�6D�GY<[R��LL��Ѭ����n��u@���i`��@��Q��)��B���կʆ�^D**
QU��L6ql����W���8��Dt��-��=(�M�&W�FD��˖Cɽ���$��h��ҡ6�Y�7|bwQ���I!���f�W�KEݚv����?�i+Ev2���X]^���ߧ@2OHY�pN$/\lݹ�R��<����s�\�S}��Γ��
q�ru�8'k���י�`�u@ev�&(h�T4/�"�x@��������u
ҏ+K���o`���(���aaU�~T�娂U��`U�*Xը`U�*X�
V��m�_JpF���6IEND�B`�woocommerce-admin/images/onboarding/mailchimp.png000064400000004342151335517650016227 0ustar00�PNG


IHDR�7z�%]BPLTEGpLsӴ�tRNS<q��,�^�L�����?��9IDATx՘���(�@�p
����&@��ճ�1�shE|�p�7)�,�j�Sr_%��F"58B�$)�G�-�}%2l�f�1Ƽ�G����ܥϞ�(�Tݡ4��Fqg&��DF����Z�=&.0DK�Sc�5校���z
�B�T�=���>T)=EE��\%���<�$�@�����n(�)$�D�/�W�\I{��E�b�f
���/��6!�9S���X���(xje���*�����Z��8���`/�ct�̽v��2}�'�|&3H�11��V��֋I2���rJN��7�t%Q87���E�ӊ�w`n^���DόV0�m����";�mC:-i��e?�ѡ�ը�%�e1�ϲ��%Pt��P��ӑ�zX�bwO�]V���l�l�s�W�MnTI�y��j����C�^7�}�P��Z��|�(����Ĭ��k���}��������7�E�b���
mo=3��tyޱ���I��D��ٞ�N�p�J�zE����t��G���	ףJwy�f��Z�QD��
ly�V��֭ť�P�� �;J-b�y�1�}v�{�Vf�{�Q��Y~���"��[�Q��<r�������w�E����`u�E��c�q;W��|���\}��jW!��X�%���%�.i�ѫa)$Pzn���o���F�Q"�H���F#W��HS�#�S���-*v{5�:�tE+��HU���6�~ր�r=H���s�.(��)�i:�)@�;�B���x%m�]|w���.����B�&�Ǫ�`ex1�Jz���J�*i�\�J!�%v��yӽTn�sk�W�4�fLdj<�Rɜtɟ�R3�����+3J�zC	QvK����^��(�b�J��8�]���(D��A,XHKr+_7�q�AX�D?&�/(G����v��4�v�����"seo��\��v�as*�5Q���H�
M�H�P$8F�e��8�x��۲g�'�z��zG�:�>�
[�5�>p��.FxC�r�|��E�`��L���:d��X�<iF��V`(��@�o(�6F�T����1�ԫ�0r�-=_Pv���x_�
_Q����lE�<���½�p]sU	t7YX4B#�D��ui�E���r�@H�T+��)�Qf��dGU�gy%3ğQt!$c�.�^���±P���i�����\R�$�C9�<i�mGL��(5R뎢�FGo(�o*яQ��w5�ߣ0�@��JP0������5Q�t��}���~�
���
�x���[�������C(r{��4a�OnJM����Q���SH�ű�w��+K�m��2
��Q����T��ay?�i̐�ҿ����}�rʵ�ǹ�e��iN^\+�R����jN�p���U���
p����K7eϔ�(��j_��E����J)r�/���T𙚇!�ߏ��O�ߞ�EA����C�~��ն��t�Z�(Ҽs(~�|h�)m��5�������́�Ӿ�~�m���H���h~�ˏ'J���:�`��g.�
���+��VGII�%�c�(�4�d/Υt�;di���X�w��/G�>�y UJ��m�&�)㞥�@��6b	
k�l��3�G.�`����'��Z� q@PH�Of~�	�%��C���9���a4r��%f�:�,�E8)P����84�0�K�2����
a��D[�+��m\j<�.!��W2�X���d�y�n����}.��{���oEu�po�uR�C�;J��?r>��Kk��oG0�X�6�A�
�2��s����`޸�M�C���:��%�1d%ZSv�Y˱f�O F!����yn�^$��B1��z�v�b��3���>�~R�r��MY��/�p)�@�*"�7I���)8tsc\����D�GO�������	�I�~� �`�5�̨�D'~~)�!F���>�L����~����ǜ�!������ux�9�)
�<���L��▷�7m��C�����n�f�'�����c�������Y,()~@��d!$��	��},����d�'��?�R����V�	 �,���|+|�IEND�B`�woocommerce-admin/images/onboarding/razorpay.svg000064400000007042151335517650016146 0ustar00<svg
    xmlns="http://www.w3.org/2000/svg"
    width="100"
    height="24"
    fill="#072654"
    viewBox="0 0 1896 401"
>
    <path
        fill="#3395FF"
        d="M122.63 105.7l-15.75 57.97 90.15-58.3-58.96 219.98 59.88.05L285.05.48"
    />
    <path d="M25.6 232.92L.8 325.4h122.73l50.22-188.13L25.6 232.92m426.32-81.42c-3 11.15-8.78 19.34-17.4 24.57-8.6 5.22-20.67 7.84-36.25 7.84h-49.5l17.38-64.8h49.5c15.56 0 26.25 2.6 32.05 7.9 5.8 5.3 7.2 13.4 4.22 24.6m51.25-1.4c6.3-23.4 3.7-41.4-7.82-54-11.5-12.5-31.68-18.8-60.48-18.8H324.4l-66.5 248.1h53.67l26.8-100h35.2c7.9 0 14.12 1.3 18.66 3.8 4.55 2.6 7.22 7.1 8.04 13.6l9.58 82.6h57.5l-9.32-77c-1.9-17.2-9.77-27.3-23.6-30.3 17.63-5.1 32.4-13.6 44.3-25.4a92.6 92.6 0 0 0 24.44-42.5m130.46 86.4c-4.5 16.8-11.4 29.5-20.73 38.4-9.34 8.9-20.5 13.3-33.52 13.3-13.26 0-22.25-4.3-27-13-4.76-8.7-4.92-21.3-.5-37.8 4.42-16.5 11.47-29.4 21.17-38.7 9.7-9.3 21.04-13.95 34.06-13.95 13 0 21.9 4.5 26.4 13.43 4.6 8.97 4.7 21.8.2 38.5zm23.52-87.8l-6.72 25.1c-2.9-9-8.53-16.2-16.85-21.6-8.34-5.3-18.66-8-30.97-8-15.1 0-29.6 3.9-43.5 11.7-13.9 7.8-26.1 18.8-36.5 33-10.4 14.2-18 30.3-22.9 48.4-4.8 18.2-5.8 34.1-2.9 47.9 3 13.9 9.3 24.5 19 31.9 9.8 7.5 22.3 11.2 37.6 11.2a82.4 82.4 0 0 0 35.2-7.7 82.11 82.11 0 0 0 28.4-21.2l-7 26.16h51.9L709.3 149h-52zm238.65 0H744.87l-10.55 39.4h87.82l-116.1 100.3-9.92 37h155.8l10.55-39.4h-94.1l117.88-101.8m142.4 52c-4.67 17.4-11.6 30.48-20.75 39-9.15 8.6-20.23 12.9-33.24 12.9-27.2 0-36.14-17.3-26.86-51.9 4.6-17.2 11.56-30.13 20.86-38.84 9.3-8.74 20.57-13.1 33.82-13.1 13 0 21.78 4.33 26.3 13.05 4.52 8.7 4.48 21.67-.13 38.87m30.38-80.83c-11.95-7.44-27.2-11.16-45.8-11.16-18.83 0-36.26 3.7-52.3 11.1a113.09 113.09 0 0 0-41 32.06c-11.3 13.9-19.43 30.2-24.42 48.8-4.9 18.53-5.5 34.8-1.7 48.73 3.8 13.9 11.8 24.6 23.8 32 12.1 7.46 27.5 11.17 46.4 11.17 18.6 0 35.9-3.74 51.8-11.18 15.9-7.48 29.5-18.1 40.8-32.1 11.3-13.94 19.4-30.2 24.4-48.8 5-18.6 5.6-34.84 1.8-48.8-3.8-13.9-11.7-24.6-23.6-32.05m185.1 40.8l13.3-48.1c-4.5-2.3-10.4-3.5-17.8-3.5-11.9 0-23.3 2.94-34.3 8.9-9.46 5.06-17.5 12.2-24.3 21.14l6.9-25.9-15.07.06h-37l-47.7 176.7h52.63l24.75-92.37c3.6-13.43 10.08-24 19.43-31.5 9.3-7.53 20.9-11.3 34.9-11.3 8.6 0 16.6 1.97 24.2 5.9m146.5 41.1c-4.5 16.5-11.3 29.1-20.6 37.8-9.3 8.74-20.5 13.1-33.5 13.1s-21.9-4.4-26.6-13.2c-4.8-8.85-4.9-21.6-.4-38.36 4.5-16.75 11.4-29.6 20.9-38.5 9.5-8.97 20.7-13.45 33.7-13.45 12.8 0 21.4 4.6 26 13.9 4.6 9.3 4.7 22.2.28 38.7m36.8-81.4c-9.75-7.8-22.2-11.7-37.3-11.7-13.23 0-25.84 3-37.8 9.06-11.95 6.05-21.65 14.3-29.1 24.74l.18-1.2 8.83-28.1h-51.4l-13.1 48.9-.4 1.7-54 201.44h52.7l27.2-101.4c2.7 9.02 8.2 16.1 16.6 21.22 8.4 5.1 18.77 7.63 31.1 7.63 15.3 0 29.9-3.7 43.75-11.1 13.9-7.42 25.9-18.1 36.1-31.9 10.2-13.8 17.77-29.8 22.6-47.9 4.9-18.13 5.9-34.3 3.1-48.45-2.85-14.17-9.16-25.14-18.9-32.9m174.65 80.65c-4.5 16.7-11.4 29.5-20.7 38.3-9.3 8.86-20.5 13.27-33.5 13.27-13.3 0-22.3-4.3-27-13-4.8-8.7-4.9-21.3-.5-37.8 4.4-16.5 11.42-29.4 21.12-38.7 9.7-9.3 21.05-13.94 34.07-13.94 13 0 21.8 4.5 26.4 13.4 4.6 8.93 4.63 21.76.15 38.5zm23.5-87.85l-6.73 25.1c-2.9-9.05-8.5-16.25-16.8-21.6-8.4-5.34-18.7-8-31-8-15.1 0-29.68 3.9-43.6 11.7-13.9 7.8-26.1 18.74-36.5 32.9-10.4 14.16-18 30.3-22.9 48.4-4.85 18.17-5.8 34.1-2.9 47.96 2.93 13.8 9.24 24.46 19 31.9 9.74 7.4 22.3 11.14 37.6 11.14 12.3 0 24.05-2.56 35.2-7.7a82.3 82.3 0 0 0 28.33-21.23l-7 26.18h51.9l47.38-176.7h-51.9zm269.87.06l.03-.05h-31.9c-1.02 0-1.92.05-2.85.07h-16.55l-8.5 11.8-2.1 2.8-.9 1.4-67.25 93.68-13.9-109.7h-55.08l27.9 166.7-61.6 85.3h54.9l14.9-21.13c.42-.62.8-1.14 1.3-1.8l17.4-24.7.5-.7 77.93-110.5 65.7-93 .1-.06h-.03z" />
</svg>woocommerce-admin/images/onboarding/bacs.svg000064400000004034151335517650015205 0ustar00<svg
    width="96"
    height="32"
    viewBox="0 0 96 32"
    fill="none"
    xmlns="http://www.w3.org/2000/svg"
>
    <rect width="32" height="32" rx="16" fill="#8E9196" />
    <mask
        id="bacs0"
        mask-type="alpha"
        maskUnits="userSpaceOnUse"
        x="8"
        y="8"
        width="16"
        height="16"
    >
        <path
            fill-rule="evenodd"
            clip-rule="evenodd"
            d="M8.875 12.25L16 8.5L23.125 12.25V13.75H8.875V12.25ZM16 10.195L19.9075 12.25H12.0925L16 10.195ZM10.75 15.25H12.25V20.5H10.75V15.25ZM15.25 20.5V15.25H16.75V20.5H15.25ZM23.125 23.5V22H8.875V23.5H23.125ZM19.75 15.25H21.25V20.5H19.75V15.25Z"
            fill="white"
        />
    </mask>
    <g mask="url(#bacs0)">
        <rect x="7" y="7" width="18" height="18" fill="white" />
    </g>
    <mask
        id="bacs1"
        mask-type="alpha"
        maskUnits="userSpaceOnUse"
        x="39"
        y="10"
        width="18"
        height="12"
    >
        <path
            d="M39 17L53.17 17L49.59 20.59L51 22L57 16L51 10L49.59 11.41L53.17 15L39 15L39 17Z"
            fill="white"
        />
    </mask>
    <g mask="url(#bacs1)">
        <rect
            x="60"
            y="28"
            width="24"
            height="24"
            transform="rotate(-180 60 28)"
            fill="#8E9196"
        />
    </g>
    <rect x="64" width="32" height="32" rx="16" fill="#8E9196" />
    <mask
        id="bacs2"
        mask-type="alpha"
        maskUnits="userSpaceOnUse"
        x="72"
        y="8"
        width="16"
        height="16"
    >
        <path
            fill-rule="evenodd"
            clip-rule="evenodd"
            d="M72.875 12.25L80 8.5L87.125 12.25V13.75H72.875V12.25ZM80 10.195L83.9075 12.25H76.0925L80 10.195ZM74.75 15.25H76.25V20.5H74.75V15.25ZM79.25 20.5V15.25H80.75V20.5H79.25ZM87.125 23.5V22H72.875V23.5H87.125ZM83.75 15.25H85.25V20.5H83.75V15.25Z"
            fill="white"
        />
    </mask>
    <g mask="url(#bacs2)">
        <rect x="71" y="7" width="18" height="18" fill="white" />
    </g>
</svg>woocommerce-admin/images/onboarding/wcpay.svg000064400000006770151335517650015431 0ustar00<svg
	width="100"
	height="64"
	viewBox="-10 0 120 64"
	fill="none"
	xmlns="http://www.w3.org/2000/svg"
>
	<path
		fill-rule="evenodd"
		clip-rule="evenodd"
		d="M9.78073 0.5H91.1787C96.3299 0.5 100.5 4.77335 100.5 10.0522V41.8929C100.5 47.1717 96.3299 51.4451 91.1787 51.4451H61.9883L65.9948 61.5L48.3742 51.4451H9.82161C4.67036 51.4451 0.500298 47.1717 0.500298 41.8929V10.0522C0.459415 4.81524 4.62947 0.5 9.78073 0.5Z"
		fill="#7F54B3"
	/>
	<path
		d="M5.48791 9.1725C6.06028 8.37648 6.91882 7.95752 8.06354 7.87373C10.1486 7.70615 11.3342 8.71165 11.6204 10.8902C12.8877 19.6464 14.2778 27.0619 15.7495 33.1368L24.7029 15.6663C25.5206 14.0743 26.5426 13.2364 27.7691 13.1526C29.568 13.0269 30.6718 14.2 31.1215 16.6718C32.1436 22.2439 33.4519 26.9781 35.0054 31.0001C36.0684 20.3586 37.8672 12.6917 40.402 7.95753C41.0152 6.78445 41.9146 6.19791 43.1002 6.11412C44.0405 6.03033 44.8991 6.3236 45.6759 6.95203C46.4526 7.58047 46.8615 8.37648 46.9432 9.34008C46.9841 10.0942 46.8615 10.7226 46.5344 11.3511C44.94 14.3676 43.6317 19.4369 42.5688 26.4754C41.5467 33.3044 41.1787 38.6251 41.424 42.4376C41.5058 43.485 41.3423 44.4067 40.9334 45.2027C40.4428 46.1244 39.707 46.6272 38.7666 46.711C37.7037 46.7948 36.5998 46.292 35.5369 45.1608C31.7348 41.1807 28.7094 35.2316 26.5018 27.3133C23.8444 32.6759 21.882 36.6979 20.6146 39.3792C18.2025 44.1134 16.1584 46.5434 14.4413 46.6691C13.3374 46.7529 12.3971 45.7893 11.5795 43.7783C9.49445 38.2899 7.24589 27.6904 4.83379 11.9795C4.71114 10.8902 4.91555 9.92662 5.48791 9.1725Z"
		fill="white"
	/>
	<path
		d="M93.3864 15.7499C91.9146 13.1105 89.7478 11.5185 86.8451 10.89C86.0683 10.7225 85.3324 10.6387 84.6374 10.6387C80.7127 10.6387 77.5238 12.7335 75.0299 16.923C72.904 20.4841 71.8411 24.4223 71.8411 28.7376C71.8411 31.9635 72.4952 34.7286 73.8034 37.0329C75.2752 39.6723 77.442 41.2644 80.3447 41.8928C81.1215 42.0604 81.8574 42.1442 82.5524 42.1442C86.518 42.1442 89.7069 40.0494 92.1599 35.8598C94.2858 32.2568 95.3488 28.3186 95.3488 24.0034C95.3488 20.7355 94.6946 18.0123 93.3864 15.7499ZM88.2351 27.355C87.6628 30.1201 86.6407 32.173 85.128 33.5556C83.9424 34.6449 82.8386 35.1057 81.8165 34.8962C80.8353 34.6868 80.0177 33.8069 79.4044 32.173C78.9138 30.8742 78.6685 29.5755 78.6685 28.3605C78.6685 27.3131 78.7503 26.2657 78.9547 25.3021C79.3226 23.5844 80.0177 21.9086 81.1215 20.3166C82.4706 18.2637 83.9015 17.4258 85.3733 17.719C86.3545 17.9285 87.1722 18.8083 87.7854 20.4422C88.276 21.741 88.5213 23.0398 88.5213 24.2547C88.5213 25.344 88.3987 26.3914 88.2351 27.355Z"
		fill="white"
	/>
	<path
		d="M67.7528 15.7499C66.281 13.1105 64.0734 11.5185 61.2116 10.89C60.4348 10.7225 59.6989 10.6387 59.0039 10.6387C55.0791 10.6387 51.8903 12.7335 49.3964 16.923C47.2705 20.4841 46.2075 24.4223 46.2075 28.7376C46.2075 31.9635 46.8616 34.7286 48.1699 37.0329C49.6417 39.6723 51.8085 41.2644 54.7112 41.8928C55.488 42.0604 56.2238 42.1442 56.9189 42.1442C60.8845 42.1442 64.0734 40.0494 66.5263 35.8598C68.6523 32.2568 69.7152 28.3186 69.7152 24.0034C69.7152 20.7355 69.0611 18.0123 67.7528 15.7499ZM62.6016 27.355C62.0292 30.1201 61.0071 32.173 59.4945 33.5556C58.3089 34.6449 57.205 35.1057 56.183 34.8962C55.2018 34.6868 54.3841 33.8069 53.7709 32.173C53.2803 30.8742 53.035 29.5755 53.035 28.3605C53.035 27.3131 53.1167 26.2657 53.3212 25.3021C53.6891 23.5844 54.3841 21.9086 55.4879 20.3166C56.8371 18.2637 58.268 17.4258 59.7398 17.719C60.721 17.9285 61.5386 18.8083 62.1519 20.4422C62.6425 21.741 62.8878 23.0398 62.8878 24.2547C62.8878 25.344 62.806 26.3914 62.6016 27.355Z"
		fill="white"
	/>
</svg>
woocommerce-admin/images/onboarding/mailpoet.png000064400000003025151335517650016073 0ustar00�PNG


IHDR2F���f	pHYs��sRGB���gAMA���a�IDATx�{�UEǿ�9w]���U�|�li*AQ��؊��a��nb�AP��GDT�D�BCH��()�e/*J4��ZD��*��Hs��{��\�޳�t��;��88gΙ�33�33���o���������~��@t.J)��`����5h���t���d(F�,�,�UZ�3
� At����}��ψnWȳ^�}���|�vqIf�{��O�Nt�[^ނ�t�k���аt��h�Gȃ��=1���v6`pXuҥ����'&ߌ�c"�8[�<�<)K@�<<!D��:p)
 oA���콫9���]�J+0PTf�!y�U(��9s��uu���!.��,�\�N��z�q*��
��I�����	��1n*,pod��*��z�'�1��xrgt"���y(����
M3v�ռ@�?y%Q$��h�U��áy�������E?���Jh
�,S�&M�����ܕ�1���.P� �~��ϊ�C#n��W�����z�g�#P��2�b������~r(�)�(���7���`��4�����` K��a;�DY��|��"Y�����JU�Z_D�%g�/p�3�+V���1��OCp�UuF�?�߂Cܭ#]���Ź3���V��!�z�C�q^lD�TWc2����a�"��o8ı�hW ��2���Lc3��E�V����kG v|�}N`�TY��k�-�Z������87�	l���B��bM�P�R�:�",�Zlל�(y��xAȟ�w�h0.��0�Z���":��&��N�c(���z=�]�bdk��D{Mܲ��L���n��)^���s�e�2a���y�T3�$�[�iL��
w�����������PP���`]�h�l�	St�1111��,���醮5�·V�]�U�{���A��``���<�f�Dga���o�u{?N���S�vI�&���M�m�4��y���%�l?��T~�C�K� ��
3>R�o*��y�a�a�1��(w}�~�f��fcz5oجtp1�~*w&u,s�U��!�]���2^v(č�BYg_��c�舅�w=O��(��Կy<�48�j�O�6�{3�u�8�����V���8W��/�������[˘�A�'�F0�=��z�U��c�y�?���4
(��{�5��'X�)v׊��f�	U�A�8Ҋ�P��*�ӛ�
��M�=~�^���Uc-���;����
�>�!�T�+�͙���3�"O{	����dό�Qy)�4ï
��r#8.��z�d1�L;��/i�%q�������g�"U��yL��������\��J�����ߝ	�
��c�K���؈,����z�
�8ħ��$ ��1{}Pz�U�H~�c������`S�ѯK!�OI��hfg�E�Pi��Q��Ս6ಔ�)�b�%���11111111�s�8���.�IEND�B`�woocommerce-admin/images/onboarding/mollie.svg000064400000003373151335517650015563 0ustar00<svg fill="none" viewBox="0 0 677 200" height="30" width="100" xmlns="http://www.w3.org/2000/svg"><g fill="#000"><path d="M286.342 65.313c-37.175 0-67.35 30.242-67.35 67.344 0 37.101 30.245 67.343 67.35 67.343 37.106 0 67.35-30.242 67.35-67.343 0-37.102-30.174-67.344-67.35-67.344zm0 102.835c-19.533 0-35.425-15.89-35.425-35.421s15.892-35.422 35.425-35.422 35.426 15.891 35.426 35.422-15.893 35.421-35.426 35.421z" fill-rule="evenodd"/><path d="M510.375 42.002c11.6 0 21.003-9.402 21.003-21.001C531.378 9.402 521.975 0 510.375 0c-11.599 0-21.003 9.402-21.003 21.001 0 11.599 9.404 21.001 21.003 21.001z"/><path d="M148.842 65.383c-1.75-.14-3.431-.21-5.181-.21-16.242 0-31.644 6.65-42.706 18.411-11.062-11.69-26.394-18.41-42.496-18.41C26.254 65.173 0 91.353 0 123.555v73.714h31.505v-72.804c0-13.37 10.991-25.691 23.943-27.021.91-.07 1.82-.14 2.66-.14 14.563 0 26.465 11.9 26.535 26.461v73.504h32.204v-72.944c0-13.3 10.922-25.621 23.944-26.951.91-.07 1.82-.14 2.66-.14 14.562 0 26.534 11.83 26.604 26.321v73.714h32.205v-72.804a59.782 59.782 0 00-15.332-39.972c-9.872-11.06-23.384-17.85-38.086-19.11z" fill-rule="evenodd"/><path d="M403.26 3.15h-32.205v194.26h32.205zM464.869 3.15h-32.205v194.26h32.205zM526.478 68.533h-32.205V197.34h32.205z"/><path d="M677 129.646c0-17.08-6.651-33.181-18.693-45.432-12.112-12.25-28.074-19.04-45.086-19.04h-.841c-17.642.21-34.305 7.21-46.766 19.74-12.462 12.53-19.463 29.122-19.673 46.833-.21 18.06 6.721 35.141 19.533 48.092 12.811 12.951 29.754 20.091 47.817 20.091h.07c23.663 0 45.856-12.671 57.968-33.042l1.54-2.59-26.604-13.09-1.33 2.17c-6.651 10.99-18.202 17.501-31.014 17.501-16.383 0-30.525-10.921-34.866-26.462H677zm-65.04-35.211c14.703 0 27.864 9.66 32.485 23.381h-64.899c4.55-13.721 17.712-23.381 32.414-23.381z" fill-rule="evenodd"/></g></svg>
woocommerce-admin/images/onboarding/payu.svg000064400000004707151335517650015262 0ustar00<svg
    xmlns="http://www.w3.org/2000/svg"
    width="1333.333"
    version="1"
    viewBox="0 0 1000 1000"
>
    <path
        d="M8987 7472c-15-16-17-45-17-194 0-157 2-177 18-191s44-17 189-17c152 0 172 2 186 18 15 16 17 45 17 194 0 157-2 177-18 191s-44 17-189 17c-152 0-172-2-186-18zM9413 7046l-28-24v-520l24-26 24-26h518l24 25 25 24v250c0 162-4 259-11 274-20 43-45 47-304 47-243 0-244 0-272-24zM8623 6435c-44-19-64-54-70-123l-6-59-106-6c-182-11-261-50-293-145-9-28-14-251-18-912l-5-875-29-62c-47-102-124-160-256-194-83-21-356-19-440 4-131 36-203 90-249 187l-26 55-5 875c-5 669-9 884-19 913-20 62-75 115-140 135-82 25-431 25-513-1-70-21-110-54-134-109-18-41-19-90-22-888-2-567 1-877 8-942 45-397 254-684 606-832 100-41 240-81 369-103 156-27 570-24 725 5 224 41 398 107 541 202 92 62 216 193 273 288 27 45 64 126 82 179 61 180 64 217 64 936v647h165c128 0 173 3 195 15 61 31 60 27 60 398 0 377-2 386-65 413-49 20-645 20-692-1zM322 6230c-114-24-221-100-268-192-55-108-54-73-54-1379V3453l23-34c29-44 72-58 172-58s143 14 172 58l23 34v935l473 5c379 4 489 8 557 21 374 72 570 244 656 573 36 135 45 410 20 562-64 379-252 580-626 667-65 15-141 18-590 20-283 1-534-2-558-6zm1107-388c75-27 103-44 154-91 88-82 127-217 127-438-1-343-95-479-370-529-56-10-188-13-513-14H389l3 503c3 457 5 505 21 534 35 64 26 63 512 60 429-2 442-3 504-25zM2665 5600c-114-13-234-38-274-58-62-31-76-61-76-167 0-79 3-98 21-121 32-43 65-49 163-30 175 33 251 40 441 40 272 0 384-28 473-121 62-63 78-123 84-309l6-162-369-5c-387-5-459-12-604-58-155-49-291-151-353-263-56-102-72-176-71-341 0-135 3-158 27-231 64-192 211-329 422-393 123-38 231-52 407-51 526 0 804 152 895 490 16 59 18 123 18 650v585l-23 75c-52 167-144 281-288 357-168 88-292 113-594 118-124 2-261 0-305-5zm832-1452c-7-243-17-288-83-358-49-52-106-81-211-106-89-22-373-25-453-5-198 49-277 155-268 355 3 80 8 99 34 146 50 87 142 139 289 160 27 4 196 8 374 9l324 1-6-202zM4073 5535c-46-20-67-57-59-105 9-57 420-1575 458-1690 42-130 91-221 152-283 64-64 123-94 228-115 68-13 95-14 171-4 50 6 93 10 95 8 7-7-80-211-113-266-37-61-97-122-155-157-48-29-155-60-232-68-130-14-162-36-160-115 2-84 30-166 69-200 32-28 38-30 121-30 98 0 228 26 318 63 229 93 393 294 499 613 53 161 565 2215 565 2269 0 50-21 80-64 91-14 3-70 4-125 2-116-4-142-16-179-89-14-27-95-348-212-837-104-437-198-812-209-835-37-83-92-117-188-117-113 0-163 31-204 126-9 23-106 367-214 765-245 906-247 910-285 943-17 14-47 30-68 36-52 14-171 12-209-5z"
        transform="matrix(.1 0 0 -.1 0 1000)"
    ></path>
</svg>woocommerce-admin/dist/print-shipping-label-banner/style-rtl.css000064400000011417151335517650021077 0ustar00:root{--wp-admin-theme-color:#007cba;--wp-admin-theme-color-darker-10:#006ba1;--wp-admin-theme-color-darker-20:#005a87}body.admin-color-light{--wp-admin-theme-color:#0085ba;--wp-admin-theme-color-darker-10:#0073a1;--wp-admin-theme-color-darker-20:#006187}body.admin-color-modern{--wp-admin-theme-color:#3858e9;--wp-admin-theme-color-darker-10:#2145e6;--wp-admin-theme-color-darker-20:#183ad6}body.admin-color-blue{--wp-admin-theme-color:#096484;--wp-admin-theme-color-darker-10:#07526c;--wp-admin-theme-color-darker-20:#064054}body.admin-color-coffee{--wp-admin-theme-color:#46403c;--wp-admin-theme-color-darker-10:#383330;--wp-admin-theme-color-darker-20:#2b2724}body.admin-color-ectoplasm{--wp-admin-theme-color:#523f6d;--wp-admin-theme-color-darker-10:#46365d;--wp-admin-theme-color-darker-20:#3a2c4d}body.admin-color-midnight{--wp-admin-theme-color:#e14d43;--wp-admin-theme-color-darker-10:#dd382d;--wp-admin-theme-color-darker-20:#d02c21}body.admin-color-ocean{--wp-admin-theme-color:#627c83;--wp-admin-theme-color-darker-10:#576e74;--wp-admin-theme-color-darker-20:#4c6066}body.admin-color-sunrise{--wp-admin-theme-color:#dd823b;--wp-admin-theme-color-darker-10:#d97426;--wp-admin-theme-color-darker-20:#c36922}.components-visually-hidden{border:0;clip:rect(1px,1px,1px,1px);-webkit-clip-path:inset(50%);clip-path:inset(50%);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;word-wrap:normal!important}.components-visually-hidden:focus{background-color:#ddd;clip:auto!important;-webkit-clip-path:none;clip-path:none;color:#444;display:block;font-size:1em;height:auto;right:5px;line-height:normal;padding:15px 23px 14px;text-decoration:none;top:5px;width:auto;z-index:100000}#woocommerce-admin-print-label{min-height:100px}#woocommerce-admin-print-label .handlediv,#woocommerce-admin-print-label .hndle,#woocommerce-admin-print-label .postbox-header{display:none}#woocommerce-admin-print-label .wc-admin-shipping-banner-container{display:flex;align-items:center;margin-top:18px;margin-bottom:6px}#woocommerce-admin-print-label .wc-admin-shipping-banner-blob,#woocommerce-admin-print-label .wc-admin-shipping-banner-illustration{margin-left:8px}#woocommerce-admin-print-label h3{margin:0;font-size:1.15em}#woocommerce-admin-print-label p{margin:0;font-size:15px;line-height:19px}#woocommerce-admin-print-label .components-button.is-primary{margin:10px auto 10px 61px;padding:0 30px;font-size:14px;font-weight:500;line-height:25px;text-decoration:none;text-shadow:none;overflow:visible}#woocommerce-admin-print-label .notice-dismiss{top:14px;left:18px}#woocommerce-admin-print-label .wc-admin-shipping-banner-install-error{color:#d63638}#woocommerce-admin-print-label .wc-admin-shipping-banner-install-error>.warning-icon{margin-left:3px;vertical-align:middle;margin-top:-2px}#woocommerce-admin-print-label .wc-admin-shipping-banner-install-error>.warning-icon path{fill:#d63638}#woocommerce-admin-print-label .components-external-link__icon{display:none}.components-modal__frame.wc-admin-shipping-banner__dismiss-modal{width:500px;max-width:100%}.components-modal__frame.wc-admin-shipping-banner__dismiss-modal .components-modal__header{border-bottom:0;margin:4px 0;padding:0;height:50px}.components-modal__frame.wc-admin-shipping-banner__dismiss-modal .components-modal__header .components-button.has-icon{right:15px}.components-modal__frame.wc-admin-shipping-banner__dismiss-modal .components-modal__header .components-button.has-icon svg{width:30px;height:30px}.components-modal__frame.wc-admin-shipping-banner__dismiss-modal .components-modal__header-heading{font-style:normal;font-weight:500;font-size:20px;line-height:32px}.components-modal__frame.wc-admin-shipping-banner__dismiss-modal .wc-admin-shipping-banner__dismiss-modal-help-text{font-size:16px;line-height:24px;margin:0 0 1em 60px}.components-modal__frame.wc-admin-shipping-banner__dismiss-modal .wc-admin-shipping-banner__dismiss-modal-actions{text-align:left}.components-modal__frame.wc-admin-shipping-banner__dismiss-modal .wc-admin-shipping-banner__dismiss-modal-actions .components-button.is-primary{height:30px;padding-right:15px;padding-left:15px;text-align:center;font-size:14px;line-height:15px;font-weight:500;align-items:center;margin-right:10px}.components-modal__frame.wc-admin-shipping-banner__dismiss-modal .wc-admin-shipping-banner__dismiss-modal-actions button.is-primary{align-self:flex-end}@media(max-width:1080px){#woocommerce-admin-print-label{text-align:center}#woocommerce-admin-print-label .wc-admin-shipping-banner-container{flex-wrap:wrap;justify-content:center}#woocommerce-admin-print-label .components-button.is-primary{margin:10px 0 0}#woocommerce-admin-print-label p{margin:5px 15px;max-width:none}#woocommerce-admin-print-label h3{margin-top:10px}}.notice.wcs-nux__notice,.wc-admin-shipping-banner__dismiss-modal .components-button span{display:none}woocommerce-admin/dist/print-shipping-label-banner/style.css000064400000011420151335517650020272 0ustar00:root{--wp-admin-theme-color:#007cba;--wp-admin-theme-color-darker-10:#006ba1;--wp-admin-theme-color-darker-20:#005a87}body.admin-color-light{--wp-admin-theme-color:#0085ba;--wp-admin-theme-color-darker-10:#0073a1;--wp-admin-theme-color-darker-20:#006187}body.admin-color-modern{--wp-admin-theme-color:#3858e9;--wp-admin-theme-color-darker-10:#2145e6;--wp-admin-theme-color-darker-20:#183ad6}body.admin-color-blue{--wp-admin-theme-color:#096484;--wp-admin-theme-color-darker-10:#07526c;--wp-admin-theme-color-darker-20:#064054}body.admin-color-coffee{--wp-admin-theme-color:#46403c;--wp-admin-theme-color-darker-10:#383330;--wp-admin-theme-color-darker-20:#2b2724}body.admin-color-ectoplasm{--wp-admin-theme-color:#523f6d;--wp-admin-theme-color-darker-10:#46365d;--wp-admin-theme-color-darker-20:#3a2c4d}body.admin-color-midnight{--wp-admin-theme-color:#e14d43;--wp-admin-theme-color-darker-10:#dd382d;--wp-admin-theme-color-darker-20:#d02c21}body.admin-color-ocean{--wp-admin-theme-color:#627c83;--wp-admin-theme-color-darker-10:#576e74;--wp-admin-theme-color-darker-20:#4c6066}body.admin-color-sunrise{--wp-admin-theme-color:#dd823b;--wp-admin-theme-color-darker-10:#d97426;--wp-admin-theme-color-darker-20:#c36922}.components-visually-hidden{border:0;clip:rect(1px,1px,1px,1px);-webkit-clip-path:inset(50%);clip-path:inset(50%);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;word-wrap:normal!important}.components-visually-hidden:focus{background-color:#ddd;clip:auto!important;-webkit-clip-path:none;clip-path:none;color:#444;display:block;font-size:1em;height:auto;left:5px;line-height:normal;padding:15px 23px 14px;text-decoration:none;top:5px;width:auto;z-index:100000}#woocommerce-admin-print-label{min-height:100px}#woocommerce-admin-print-label .handlediv,#woocommerce-admin-print-label .hndle,#woocommerce-admin-print-label .postbox-header{display:none}#woocommerce-admin-print-label .wc-admin-shipping-banner-container{display:flex;align-items:center;margin-top:18px;margin-bottom:6px}#woocommerce-admin-print-label .wc-admin-shipping-banner-blob,#woocommerce-admin-print-label .wc-admin-shipping-banner-illustration{margin-right:8px}#woocommerce-admin-print-label h3{margin:0;font-size:1.15em}#woocommerce-admin-print-label p{margin:0;font-size:15px;line-height:19px}#woocommerce-admin-print-label .components-button.is-primary{margin:10px 61px 10px auto;padding:0 30px;font-size:14px;font-weight:500;line-height:25px;text-decoration:none;text-shadow:none;overflow:visible}#woocommerce-admin-print-label .notice-dismiss{top:14px;right:18px}#woocommerce-admin-print-label .wc-admin-shipping-banner-install-error{color:#d63638}#woocommerce-admin-print-label .wc-admin-shipping-banner-install-error>.warning-icon{margin-right:3px;vertical-align:middle;margin-top:-2px}#woocommerce-admin-print-label .wc-admin-shipping-banner-install-error>.warning-icon path{fill:#d63638}#woocommerce-admin-print-label .components-external-link__icon{display:none}.components-modal__frame.wc-admin-shipping-banner__dismiss-modal{width:500px;max-width:100%}.components-modal__frame.wc-admin-shipping-banner__dismiss-modal .components-modal__header{border-bottom:0;margin:4px 0;padding:0;height:50px}.components-modal__frame.wc-admin-shipping-banner__dismiss-modal .components-modal__header .components-button.has-icon{left:15px}.components-modal__frame.wc-admin-shipping-banner__dismiss-modal .components-modal__header .components-button.has-icon svg{width:30px;height:30px}.components-modal__frame.wc-admin-shipping-banner__dismiss-modal .components-modal__header-heading{font-style:normal;font-weight:500;font-size:20px;line-height:32px}.components-modal__frame.wc-admin-shipping-banner__dismiss-modal .wc-admin-shipping-banner__dismiss-modal-help-text{font-size:16px;line-height:24px;margin:0 60px 1em 0}.components-modal__frame.wc-admin-shipping-banner__dismiss-modal .wc-admin-shipping-banner__dismiss-modal-actions{text-align:right}.components-modal__frame.wc-admin-shipping-banner__dismiss-modal .wc-admin-shipping-banner__dismiss-modal-actions .components-button.is-primary{height:30px;padding-left:15px;padding-right:15px;text-align:center;font-size:14px;line-height:15px;font-weight:500;align-items:center;margin-left:10px}.components-modal__frame.wc-admin-shipping-banner__dismiss-modal .wc-admin-shipping-banner__dismiss-modal-actions button.is-primary{align-self:flex-end}@media(max-width:1080px){#woocommerce-admin-print-label{text-align:center}#woocommerce-admin-print-label .wc-admin-shipping-banner-container{flex-wrap:wrap;justify-content:center}#woocommerce-admin-print-label .components-button.is-primary{margin:10px 0 0}#woocommerce-admin-print-label p{margin:5px 15px;max-width:none}#woocommerce-admin-print-label h3{margin-top:10px}}.notice.wcs-nux__notice,.wc-admin-shipping-banner__dismiss-modal .components-button span{display:none}woocommerce-admin/dist/currency/index.asset.php000064400000000250151335517650015714 0ustar00<?php return array('dependencies' => array('wc-number', 'wp-deprecated', 'wp-element', 'wp-html-entities', 'wp-i18n'), 'version' => '02c307a1f122a300ce76e5fe62b61649');woocommerce-admin/dist/currency/index.js000064400000011275151335517650014434 0ustar00this.wc=this.wc||{},this.wc.currency=function(e){var o={};function t(r){if(o[r])return o[r].exports;var n=o[r]={i:r,l:!1,exports:{}};return e[r].call(n.exports,n,n.exports,t),n.l=!0,n.exports}return t.m=e,t.c=o,t.d=function(e,o,r){t.o(e,o)||Object.defineProperty(e,o,{enumerable:!0,get:r})},t.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},t.t=function(e,o){if(1&o&&(e=t(e)),8&o)return e;if(4&o&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(t.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&o&&"string"!=typeof e)for(var n in e)t.d(r,n,function(o){return e[o]}.bind(null,n));return r},t.n=function(e){var o=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(o,"a",o),o},t.o=function(e,o){return Object.prototype.hasOwnProperty.call(e,o)},t.p="",t(t.s=443)}({0:function(e,o){e.exports=window.wp.element},120:function(e,o){e.exports=window.wc.number},2:function(e,o){e.exports=window.wp.i18n},28:function(e,o){e.exports=window.wp.htmlEntities},43:function(e,o){e.exports=window.wp.deprecated},443:function(e,o,t){"use strict";t.r(o),t.d(o,"getCurrencyData",(function(){return u}));var r=t(0),n=t(28),a=t(2),i=t(120),s=t(43),c=t.n(s);function u(){return c()("getCurrencyData",{version:"3.1.0",alternative:"CurrencyFactory.getDataForCountry",plugin:"WooCommerce Admin",hint:"Pass in the country, locale data, and symbol info to use getDataForCountry"}),{US:{code:"USD",symbol:"$",symbolPosition:"left",thousandSeparator:",",decimalSeparator:".",precision:2},EU:{code:"EUR",symbol:"€",symbolPosition:"left",thousandSeparator:".",decimalSeparator:",",precision:2},IN:{code:"INR",symbol:"₹",symbolPosition:"left",thousandSeparator:",",decimalSeparator:".",precision:2},GB:{code:"GBP",symbol:"£",symbolPosition:"left",thousandSeparator:",",decimalSeparator:".",precision:2},BR:{code:"BRL",symbol:"R$",symbolPosition:"left",thousandSeparator:".",decimalSeparator:",",precision:2},VN:{code:"VND",symbol:"₫",symbolPosition:"right",thousandSeparator:".",decimalSeparator:",",precision:1},ID:{code:"IDR",symbol:"Rp",symbolPosition:"left",thousandSeparator:".",decimalSeparator:",",precision:0},BD:{code:"BDT",symbol:"৳",symbolPosition:"left",thousandSeparator:",",decimalSeparator:".",precision:0},PK:{code:"PKR",symbol:"₨",symbolPosition:"left",thousandSeparator:",",decimalSeparator:".",precision:2},RU:{code:"RUB",symbol:"₽",symbolPosition:"right",thousandSeparator:" ",decimalSeparator:",",precision:2},TR:{code:"TRY",symbol:"₺",symbolPosition:"left",thousandSeparator:".",decimalSeparator:",",precision:2},MX:{code:"MXN",symbol:"$",symbolPosition:"left",thousandSeparator:",",decimalSeparator:".",precision:2},CA:{code:"CAD",symbol:"$",symbolPosition:"left",thousandSeparator:",",decimalSeparator:".",precision:2}}}o.default=function(e){let o;function t(e){const t={code:"USD",symbol:"$",symbolPosition:"left",thousandSeparator:",",decimalSeparator:".",precision:2,...e};o={code:t.code.toString(),symbol:t.symbol.toString(),symbolPosition:t.symbolPosition.toString(),decimalSeparator:t.decimalSeparator.toString(),priceFormat:u(t),thousandSeparator:t.thousandSeparator.toString(),precision:parseInt(t.precision,10)}}function s(e,t=!1){const r=Object(i.numberFormat)(o,e);if(""===r)return r;const{priceFormat:n,symbol:s,code:c}=o;return Object(a.sprintf)(n,t?c:s,r)}function u(e){if(e.priceFormat)return function(e){const o=document.createElement("DIV");return o.innerHTML=e,o.textContent||o.innerText||""}(e.priceFormat.toString());switch(e.symbolPosition){case"left":return"%1$s%2$s";case"right":return"%2$s%1$s";case"left_space":return"%1$s %2$s";case"right_space":return"%2$s %1$s"}return"%1$s%2$s"}return t(e),{getCurrencyConfig:()=>({...o}),getDataForCountry:function(e,o={},t={}){const r=o[e]||{},a=t[r.currency_code];return a?{code:r.currency_code,symbol:Object(n.decodeEntities)(a),symbolPosition:r.currency_pos,thousandSeparator:r.thousand_sep,decimalSeparator:r.decimal_sep,precision:r.num_decimals}:{}},setCurrency:t,formatAmount:s,formatCurrency:function(e){return c()("Currency().formatCurrency",{version:"5.0.0",alternative:"Currency().formatAmount",plugin:"WooCommerce",hint:"`formatAmount` accepts the same arguments as formatCurrency"}),s(e)},getPriceFormat:u,formatDecimal(e){if("number"!=typeof e&&(e=parseFloat(e)),Number.isNaN(e))return 0;const{precision:t}=o;return Math.round(e*Math.pow(10,t))/Math.pow(10,t)},formatDecimalString(e){if("number"!=typeof e&&(e=parseFloat(e)),Number.isNaN(e))return"";const{precision:t}=o;return e.toFixed(t)},render:e=>("number"!=typeof e&&(e=parseFloat(e)),e<0?Object(r.createElement)("span",{className:"is-negative"},s(e)):s(e))}}}});woocommerce-admin/dist/analytics-settings/style-rtl.css000064400000012566151335517650017437 0ustar00@media(min-width:783px){.woocommerce-settings__wrapper{padding:0 13px}}.woocommerce-settings__actions{margin-bottom:40px}@media(min-width:1281px){.woocommerce-settings__actions{margin-right:15%}}.woocommerce-settings__actions button{margin-left:16px}.woocommerce-setting{display:flex;margin-bottom:24px}@media(max-width:1280px){.woocommerce-setting{flex-direction:column}}.woocommerce-setting__label{font-size:16px;font-size:1rem;margin-bottom:16px;padding-left:16px;font-weight:700}@media(min-width:1281px){.woocommerce-setting__label{width:15%}}.woocommerce-setting__input{display:flex;flex-direction:column}@media(min-width:1281px){.woocommerce-setting__input{width:35%}.woocommerce-setting__input .woocommerce-filters-filter{width:100%}}.woocommerce-setting__input label{width:100%;display:block;margin-bottom:12px;color:#757575}.woocommerce-setting__input .woocommerce-filters-filter label{margin-bottom:0}.woocommerce-setting__input button:not(.components-tab-panel__tabs-item){margin-bottom:12px;align-self:flex-start}.woocommerce-setting__input .components-base-control__field{display:flex}.woocommerce-setting__input .woocommerce-filters-date__content-controls{padding-bottom:0}.woocommerce-setting__options-group-label{display:block;font-weight:700;margin-bottom:12px}.woocommerce-setting__help{font-style:italic;color:#757575}:root{--wp-admin-theme-color:#007cba;--wp-admin-theme-color-darker-10:#006ba1;--wp-admin-theme-color-darker-20:#005a87}body.admin-color-light{--wp-admin-theme-color:#0085ba;--wp-admin-theme-color-darker-10:#0073a1;--wp-admin-theme-color-darker-20:#006187}body.admin-color-modern{--wp-admin-theme-color:#3858e9;--wp-admin-theme-color-darker-10:#2145e6;--wp-admin-theme-color-darker-20:#183ad6}body.admin-color-blue{--wp-admin-theme-color:#096484;--wp-admin-theme-color-darker-10:#07526c;--wp-admin-theme-color-darker-20:#064054}body.admin-color-coffee{--wp-admin-theme-color:#46403c;--wp-admin-theme-color-darker-10:#383330;--wp-admin-theme-color-darker-20:#2b2724}body.admin-color-ectoplasm{--wp-admin-theme-color:#523f6d;--wp-admin-theme-color-darker-10:#46365d;--wp-admin-theme-color-darker-20:#3a2c4d}body.admin-color-midnight{--wp-admin-theme-color:#e14d43;--wp-admin-theme-color-darker-10:#dd382d;--wp-admin-theme-color-darker-20:#d02c21}body.admin-color-ocean{--wp-admin-theme-color:#627c83;--wp-admin-theme-color-darker-10:#576e74;--wp-admin-theme-color-darker-20:#4c6066}body.admin-color-sunrise{--wp-admin-theme-color:#dd823b;--wp-admin-theme-color-darker-10:#d97426;--wp-admin-theme-color-darker-20:#c36922}.woocommerce-settings-historical-data__columns{display:grid;grid-column-gap:24px;grid-template-columns:calc(50% - 12px) calc(50% - 12px)}.woocommerce-settings-historical-data__columns .woocommerce-settings-historical-data__column{align-self:end;margin-top:12px}.woocommerce-settings-historical-data__columns .woocommerce-settings-historical-data__column:first-child{grid-column-start:1;grid-column-end:2;grid-row-start:1;grid-row-end:2}.woocommerce-settings-historical-data__columns .woocommerce-settings-historical-data__column:nth-child(2){grid-column-start:2;grid-column-end:3;grid-row-start:1;grid-row-end:2}@media(max-width:960px){.woocommerce-settings-historical-data__columns{grid-template-columns:100%}.woocommerce-settings-historical-data__columns .woocommerce-settings-historical-data__column:first-child{grid-column-start:1;grid-column-end:2;grid-row-start:1;grid-row-end:2}.woocommerce-settings-historical-data__columns .woocommerce-settings-historical-data__column:nth-child(2){grid-column-start:1;grid-column-end:2;grid-row-start:2;grid-row-end:3}}.woocommerce-settings-historical-data__columns .components-base-control__label,.woocommerce-settings-historical-data__columns .woocommerce-settings-historical-data__column-label{margin-bottom:12px}.woocommerce-settings-historical-data__columns .components-select-control__input{height:38px;padding:8px 2px}.woocommerce-settings-historical-data__columns .components-base-control__field{margin-bottom:0}.woocommerce-settings-historical-data__skip-checkbox{margin-top:24px}.woocommerce-settings-historical-data__skip-checkbox>.components-base-control__field{margin-bottom:0}.woocommerce-settings-historical-data__skip-checkbox>.components-base-control__field>.components-checkbox-control__label{display:inline-block;margin-bottom:0;width:auto}.woocommerce-settings-historical-data__progress-label{display:inline-block;font-weight:700;margin-bottom:12px;margin-top:24px}.woocommerce-settings-historical-data__progress-label+.woocommerce-settings-historical-data__progress-label{margin-right:.25em}.woocommerce-settings-historical-data__progress-bar{-webkit-appearance:none;appearance:none;border:0;height:8px;width:100%;background-color:#c4c4c4}.woocommerce-settings-historical-data__progress-bar::-moz-progress-bar{background-color:#0085ba}.woocommerce-settings-historical-data__progress-bar::-webkit-progress-bar{background-color:#c4c4c4}.woocommerce-settings-historical-data__progress-bar::-webkit-progress-value{background-color:#0085ba}.woocommerce-settings-historical-data__status{display:block;font-weight:700;margin-top:24px}.woocommerce-settings-historical-data__status>.components-spinner{float:none;height:12px;margin-right:6px;margin-left:6px;width:12px}.woocommerce-settings-historical-data__status>.components-spinner:before{right:2px;height:3px;top:2px;transform-origin:4px 4px;width:3px}.woocommerce-settings-historical-data__actions{align-items:center;display:flex}woocommerce-admin/dist/experimental/style.css000064400000032211151335517650015475 0ustar00:root{--wp-admin-theme-color:#007cba;--wp-admin-theme-color-darker-10:#006ba1;--wp-admin-theme-color-darker-20:#005a87}body.admin-color-light{--wp-admin-theme-color:#0085ba;--wp-admin-theme-color-darker-10:#0073a1;--wp-admin-theme-color-darker-20:#006187}body.admin-color-modern{--wp-admin-theme-color:#3858e9;--wp-admin-theme-color-darker-10:#2145e6;--wp-admin-theme-color-darker-20:#183ad6}body.admin-color-blue{--wp-admin-theme-color:#096484;--wp-admin-theme-color-darker-10:#07526c;--wp-admin-theme-color-darker-20:#064054}body.admin-color-coffee{--wp-admin-theme-color:#46403c;--wp-admin-theme-color-darker-10:#383330;--wp-admin-theme-color-darker-20:#2b2724}body.admin-color-ectoplasm{--wp-admin-theme-color:#523f6d;--wp-admin-theme-color-darker-10:#46365d;--wp-admin-theme-color-darker-20:#3a2c4d}body.admin-color-midnight{--wp-admin-theme-color:#e14d43;--wp-admin-theme-color-darker-10:#dd382d;--wp-admin-theme-color-darker-20:#d02c21}body.admin-color-ocean{--wp-admin-theme-color:#627c83;--wp-admin-theme-color-darker-10:#576e74;--wp-admin-theme-color-darker-20:#4c6066}body.admin-color-sunrise{--wp-admin-theme-color:#dd823b;--wp-admin-theme-color-darker-10:#d97426;--wp-admin-theme-color-darker-20:#c36922}.woocommerce-experimental-list{margin:0;padding:0}a.woocommerce-experimental-list__item{color:inherit}.woocommerce-experimental-list__item{display:flex;align-items:center;margin-bottom:0;text-decoration:none;background-color:#fff}.woocommerce-experimental-list__item.has-gutters{padding:16px 24px}.woocommerce-experimental-list__item.has-action:not(.expanded){cursor:pointer}.woocommerce-experimental-list__item:focus:not(.expanded){box-shadow:inset 0 0 0 1px #006088,inset 0 0 0 2px #fff}.woocommerce-experimental-list__item:focus-visible{box-shadow:none}.woocommerce-experimental-list__item:not(.transitions-disabled).woocommerce-list__item-enter{opacity:0;max-height:0;transform:translateX(50%)}.woocommerce-experimental-list__item:not(.transitions-disabled).woocommerce-list__item-enter-active{opacity:1;max-height:100vh;transform:translateX(0);transition:opacity .5s,transform .5s,max-height .5s}.woocommerce-experimental-list__item:not(.transitions-disabled).woocommerce-list__item-exit{opacity:1;max-height:100vh;transform:translateX(0)}.woocommerce-experimental-list__item:not(.transitions-disabled).woocommerce-list__item-exit-active{opacity:0;max-height:0;transform:translateX(50%);transition:opacity .5s,transform .5s,max-height .5s}.woocommerce-experimental-list__item>.woocommerce-list__item-inner{text-decoration:none;width:100%;display:flex;align-items:center;padding:16px 24px}.woocommerce-experimental-list__item>.woocommerce-list__item-inner:focus{box-shadow:inset 0 0 0 1px #006088,inset 0 0 0 2px #fff}.woocommerce-experimental-list__item .woocommerce-list__item-title{color:#1d2327}.woocommerce-experimental-list__item .woocommerce-list__item-expandable-content{margin-top:4px;display:block;font-size:14px;line-height:20px;color:#50575d}.woocommerce-experimental-list__item .woocommerce-list__item-before{margin-right:20px;display:flex;align-items:center}.woocommerce-experimental-list__item .woocommerce-list__item-after{display:flex;align-items:center;margin-left:auto}.woocommerce-experimental-list__item:not(:first-child){border-top:1px solid #f0f0f0}.woocommerce-experimental-list__item:hover{background-color:#f0f0f0}.woocommerce-experimental-list__item:hover .woocommerce-list__item-title{color:#007cba;color:var(--wp-admin-theme-color)}.woocommerce-experimental-list__item:hover .woocommerce-list__item-before>svg{fill:#007cba;fill:var(--wp-admin-theme-color)}.woocommerce-experimental-list__item .woocommerce-list__item-title{color:#007cba;color:var(--wp-admin-theme-color)}.woocommerce-experimental-list__item .woocommerce-list__item-before>svg{fill:#007cba;fill:var(--wp-admin-theme-color)}.woocommerce-experimental-list__item .woocommerce-list__item-after>svg{fill:#1e1e1e}.woocommerce-experimental-list__item.is-complete .woocommerce-task__icon{background-color:#007cba;background-color:var(--wp-admin-theme-color)}.woocommerce-experimental-list__item.is-complete .woocommerce-list__item-title{color:#757575}.woocommerce-experimental-list__item.is-complete .woocommerce-list__item-expandable-content{display:none}.woocommerce-experimental-list__item-title{color:#2c3338}.woocommerce-experimental-list__item-expandable-content{color:#646970}.woocommerce-experimental-list__item.list-item-collapse{overflow:hidden;display:grid;grid-template-columns:auto 48px}.woocommerce-experimental-list__item.list-item-collapse>*{align-self:center}.woocommerce-experimental-list__item.list-item-collapse p{margin:0;padding:16px 24px}.woocommerce-experimental-list__item.list-item-collapse .list-item-collapse__icon-container{justify-content:flex-end}.woocommerce-experimental-list__item.list-item-collapse.woocommerce-list__item-enter{max-height:0;opacity:1}.woocommerce-experimental-list__item.list-item-collapse.woocommerce-list__item-enter-active{max-height:55px;transition:max-height .5s}.woocommerce-experimental-list__item.list-item-collapse.woocommerce-list__item-exit{max-height:55px}.woocommerce-experimental-list__item.list-item-collapse.woocommerce-list__item-exit-active{max-height:0;opacity:1;transition:max-height .5s}.woocommerce-experimental-list-wrapper{border-top:1px solid #f0f0f0}.woocommerce-task-list__item{position:relative;display:grid;grid-template-columns:72px auto 48px}.woocommerce-task-list__item>*{align-self:center}.woocommerce-task-list__item:before{content:"";position:absolute;top:0;left:0;width:4px;height:100%;background:transparent}.woocommerce-task-list__item.level-1:before{background-color:#d94f4f}.woocommerce-task-list__item.level-1 .gridicons-notice-outline{fill:#d94f4f}.woocommerce-task-list__item.level-2:before{background-color:#f0b849}.woocommerce-task-list__item .woocommerce-task-list__item-title{color:#007cba;color:var(--wp-admin-theme-color)}.woocommerce-task-list__item .woocommerce-task-list__item-expandable-content,.woocommerce-task-list__item .woocommerce-task__additional-info,.woocommerce-task-list__item .woocommerce-task__estimated-time{color:#757575;font-weight:400;font-size:12px}.woocommerce-task-list__item .woocommerce-task__estimated-time{margin-top:4px}.woocommerce-task-list__item .woocommerce-task-list__item-before{display:flex;align-items:center;padding:16px 0 16px 24px}.woocommerce-task-list__item .woocommerce-task-list__item-text{padding:16px 0}.woocommerce-task-list__item .woocommerce-task-list__item-text .woocommerce-pill{padding:1px 8px;margin-left:8px}.woocommerce-task-list__item .woocommerce-task-list__item-expandable-content{margin-top:4px;overflow:hidden}.woocommerce-task-list__item .woocommerce-task-list__item-expandable-content.woocommerce-task-list__item-expandable-content-enter{opacity:0}.woocommerce-task-list__item .woocommerce-task-list__item-expandable-content.woocommerce-task-list__item-expandable-content-enter-active,.woocommerce-task-list__item .woocommerce-task-list__item-expandable-content.woocommerce-task-list__item-expandable-content-enter-done,.woocommerce-task-list__item .woocommerce-task-list__item-expandable-content.woocommerce-task-list__item-expandable-content-exit{opacity:1}.woocommerce-task-list__item .woocommerce-task-list__item-expandable-content.woocommerce-task-list__item-expandable-content-exit-active{opacity:0}.woocommerce-task-list__item .woocommerce-task-list__item-expandable-content .woocommerce-task__additional-info{margin-top:8px}.woocommerce-task-list__item .woocommerce-task-list__item-action{margin-top:8px;margin-bottom:4px;display:block}.woocommerce-task-list__item .woocommerce-task-list__item-after{display:flex;align-items:center}.woocommerce-task-list__item .woocommerce-task-list__item-before .woocommerce-task__icon{border-radius:50%;width:32px;height:32px}.woocommerce-task-list__item .woocommerce-task-list__item-before .woocommerce-task__icon svg{fill:#fff;position:relative;top:4px;left:5px}.woocommerce-task-list__item.complete .woocommerce-task__icon{background-color:#007cba;background-color:var(--wp-admin-theme-color)}.woocommerce-task-list__item.complete .woocommerce-task-list__item-title{color:#757575}.woocommerce-task-list__item.complete .woocommerce-task-list__item-expandable-content,.woocommerce-task-list__item.complete .woocommerce-task__estimated-time{display:none}.woocommerce-task-list__item:not(.complete) .woocommerce-task__icon{border:1px solid #f0f0f0;background:#fff}.woocommerce-task-list__item .components-tooltip .components-popover__content{width:160px;white-space:normal}.woocommerce-task-list__item .woocommerce-task-card__section-controls{text-align:left}.woocommerce-inbox-message{position:relative;color:#757575;background:#fff;border-radius:2px;font-size:13px;font-size:.8125rem;margin:0 0 24px;-ms-box-orient:horizontal}.woocommerce-inbox-message.banner{flex-direction:column}.woocommerce-inbox-message.banner img{width:100%}.woocommerce-inbox-message.thumbnail{display:flex;flex-direction:row-reverse}.woocommerce-inbox-message.thumbnail img{width:128px;height:100%}.woocommerce-homepage-column .woocommerce-inbox-message{margin:20px 0}.woocommerce-inbox-message:not(.is-placeholder){border:1px solid #e0e0e0}.woocommerce-inbox-message .line{width:100%}.woocommerce-inbox-message .third-line{width:33%}.woocommerce-inbox-message .fifth-line{width:20%}.woocommerce-inbox-message .sixth-line{width:16%}.woocommerce-inbox-message__content .woocommerce-inbox-message__unread-indicator{height:8px;width:8px;background-color:#007cba;background-color:var(--wp-admin-theme-color);border-radius:100px;display:inline-block;margin-right:8px}.woocommerce-inbox-message__content .woocommerce-inbox-message__title{color:#1e1e1e;font-size:16px;font-size:1rem;font-style:normal;line-height:1.5;font-weight:700;margin:8px 0}.is-placeholder .woocommerce-inbox-message__content .woocommerce-inbox-message__title{margin-bottom:10px}.is-placeholder .woocommerce-inbox-message__content .woocommerce-inbox-message__title>div{animation:loading-fade 1.6s ease-in-out infinite;background-color:#f0f0f0;color:transparent;margin:5px 0}.is-placeholder .woocommerce-inbox-message__content .woocommerce-inbox-message__title>div:after{content:" "}@media screen and (prefers-reduced-motion:reduce){.is-placeholder .woocommerce-inbox-message__content .woocommerce-inbox-message__title>div{animation:none}}.woocommerce-inbox-message__content .woocommerce-inbox-message__date{color:#757575;font-size:12px;font-size:.75rem;margin-bottom:16px;font-style:normal;font-weight:400;line-height:16px}.is-placeholder .woocommerce-inbox-message__content .woocommerce-inbox-message__date{margin-bottom:10px}.is-placeholder .woocommerce-inbox-message__content .woocommerce-inbox-message__date>div{animation:loading-fade 1.6s ease-in-out infinite;background-color:#f0f0f0;color:transparent}.is-placeholder .woocommerce-inbox-message__content .woocommerce-inbox-message__date>div:after{content:" "}@media screen and (prefers-reduced-motion:reduce){.is-placeholder .woocommerce-inbox-message__content .woocommerce-inbox-message__date>div{animation:none}}.woocommerce-inbox-message__text{color:#757575;font-style:normal;font-weight:400;font-size:14px;font-size:.875rem;line-height:20px}.woocommerce-inbox-message__text>p:first-child{margin-top:0}.woocommerce-inbox-message__text>p:last-child{margin-bottom:0}.is-placeholder .woocommerce-inbox-message__text>div{animation:loading-fade 1.6s ease-in-out infinite;background-color:#f0f0f0;color:transparent;margin:5px 0}.is-placeholder .woocommerce-inbox-message__text>div:after{content:" "}@media screen and (prefers-reduced-motion:reduce){.is-placeholder .woocommerce-inbox-message__text>div{animation:none}}.woocommerce-inbox-message__actions{padding-top:16px;border-top:1px solid #e0e0e0}.woocommerce-inbox-message__actions>*+*{margin-left:.5em}.woocommerce-inbox-message__actions a,.woocommerce-inbox-message__actions button{cursor:pointer}.woocommerce-inbox-message__actions .components-dropdown{display:inline}.woocommerce-inbox-message__actions .components-dropdown .components-popover__content{min-width:195px}.woocommerce-inbox-message__actions .components-dropdown .components-popover__content ul{text-align:center}.woocommerce-inbox-message__actions .components-dropdown .components-popover__content li{margin:0;cursor:pointer}.is-placeholder .woocommerce-inbox-message__actions>div{animation:loading-fade 1.6s ease-in-out infinite;background-color:#f0f0f0;color:transparent;float:left;height:28px;margin-right:8px}.is-placeholder .woocommerce-inbox-message__actions>div:after{content:" "}@media screen and (prefers-reduced-motion:reduce){.is-placeholder .woocommerce-inbox-message__actions>div{animation:none}}.woocommerce-inbox-dismiss-confirmation_modal{text-align:left}.woocommerce-inbox-dismiss-confirmation_wrapper p{font-size:16px;color:#757575}.woocommerce-inbox-dismiss-confirmation_wrapper .woocommerce-inbox-dismiss-confirmation_buttons{text-align:right}.woocommerce-inbox-dismiss-confirmation_wrapper .woocommerce-inbox-dismiss-confirmation_buttons button{margin-left:10px}.woocommerce-inbox-message__wrapper>div{padding:16px 24px}.is-placeholder .woocommerce-inbox-message__wrapper>div{padding:10px 24px;display:flow-root}@media (-ms-high-contrast:active),(-ms-high-contrast:none){.woocommerce-admin-dismiss-dropdown{margin-top:0}.is-placeholder .woocommerce-inbox-message__wrapper{padding-bottom:10px}}woocommerce-admin/dist/experimental/index.js000064400000156430151335517650015302 0ustar00/*! For license information please see index.js.LICENSE.txt */
this.wc=this.wc||{},this.wc.experimental=function(e){var t={};function n(o){if(t[o])return t[o].exports;var r=t[o]={i:o,l:!1,exports:{}};return e[o].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=e,n.c=t,n.d=function(e,t,o){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)n.d(o,r,function(t){return e[t]}.bind(null,r));return o},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=464)}({0:function(e,t){e.exports=window.wp.element},1:function(e,t,n){e.exports=n(47)()},116:function(e,t,n){"use strict";function o(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var r=n(22);var i=n(0);function a(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}t.a=function(e){var t=e.icon,n=e.size,c=void 0===n?24:n,s=function(e,t){if(null==e)return{};var n,o,i=Object(r.a)(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(o=0;o<a.length;o++)n=a[o],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}(e,["icon","size"]);return Object(i.cloneElement)(t,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?a(Object(n),!0).forEach((function(t){o(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):a(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({width:c,height:c},s))}},169:function(e,t,n){"use strict";var o=n(23),r=n(22),i=n(25);n(1);function a(e,t){return e.replace(new RegExp("(^|\\s)"+t+"(?:\\s|$)","g"),"$1").replace(/\s+/g," ").replace(/^\s*|\s*$/g,"")}var c=n(5),s=n.n(c),l=n(65),u=function(e,t){return e&&t&&t.split(" ").forEach((function(t){return o=t,void((n=e).classList?n.classList.remove(o):"string"==typeof n.className?n.className=a(n.className,o):n.setAttribute("class",a(n.className&&n.className.baseVal||"",o)));var n,o}))},m=function(e){function t(){for(var t,n=arguments.length,o=new Array(n),r=0;r<n;r++)o[r]=arguments[r];return(t=e.call.apply(e,[this].concat(o))||this).appliedClasses={appear:{},enter:{},exit:{}},t.onEnter=function(e,n){var o=t.resolveArguments(e,n),r=o[0],i=o[1];t.removeClasses(r,"exit"),t.addClass(r,i?"appear":"enter","base"),t.props.onEnter&&t.props.onEnter(e,n)},t.onEntering=function(e,n){var o=t.resolveArguments(e,n),r=o[0],i=o[1]?"appear":"enter";t.addClass(r,i,"active"),t.props.onEntering&&t.props.onEntering(e,n)},t.onEntered=function(e,n){var o=t.resolveArguments(e,n),r=o[0],i=o[1]?"appear":"enter";t.removeClasses(r,i),t.addClass(r,i,"done"),t.props.onEntered&&t.props.onEntered(e,n)},t.onExit=function(e){var n=t.resolveArguments(e)[0];t.removeClasses(n,"appear"),t.removeClasses(n,"enter"),t.addClass(n,"exit","base"),t.props.onExit&&t.props.onExit(e)},t.onExiting=function(e){var n=t.resolveArguments(e)[0];t.addClass(n,"exit","active"),t.props.onExiting&&t.props.onExiting(e)},t.onExited=function(e){var n=t.resolveArguments(e)[0];t.removeClasses(n,"exit"),t.addClass(n,"exit","done"),t.props.onExited&&t.props.onExited(e)},t.resolveArguments=function(e,n){return t.props.nodeRef?[t.props.nodeRef.current,e]:[e,n]},t.getClassNames=function(e){var n=t.props.classNames,o="string"==typeof n,r=o?""+(o&&n?n+"-":"")+e:n[e];return{baseClassName:r,activeClassName:o?r+"-active":n[e+"Active"],doneClassName:o?r+"-done":n[e+"Done"]}},t}Object(i.a)(t,e);var n=t.prototype;return n.addClass=function(e,t,n){var o=this.getClassNames(t)[n+"ClassName"],r=this.getClassNames("enter").doneClassName;"appear"===t&&"done"===n&&r&&(o+=" "+r),"active"===n&&e&&e.scrollTop,o&&(this.appliedClasses[t][n]=o,function(e,t){e&&t&&t.split(" ").forEach((function(t){return o=t,void((n=e).classList?n.classList.add(o):function(e,t){return e.classList?!!t&&e.classList.contains(t):-1!==(" "+(e.className.baseVal||e.className)+" ").indexOf(" "+t+" ")}(n,o)||("string"==typeof n.className?n.className=n.className+" "+o:n.setAttribute("class",(n.className&&n.className.baseVal||"")+" "+o)));var n,o}))}(e,o))},n.removeClasses=function(e,t){var n=this.appliedClasses[t],o=n.base,r=n.active,i=n.done;this.appliedClasses[t]={},o&&u(e,o),r&&u(e,r),i&&u(e,i)},n.render=function(){var e=this.props,t=(e.classNames,Object(r.a)(e,["classNames"]));return s.a.createElement(l.a,Object(o.a)({},t,{onEnter:this.onEnter,onEntered:this.onEntered,onEntering:this.onEntering,onExit:this.onExit,onExiting:this.onExiting,onExited:this.onExited}))},t}(s.a.Component);m.defaultProps={classNames:""},m.propTypes={};t.a=m},172:function(e,t,n){"use strict";var o=n(22),r=n(23);var i=n(25),a=(n(1),n(5)),c=n.n(a),s=n(33);function l(e,t){var n=Object.create(null);return e&&a.Children.map(e,(function(e){return e})).forEach((function(e){n[e.key]=function(e){return t&&Object(a.isValidElement)(e)?t(e):e}(e)})),n}function u(e,t,n){return null!=n[t]?n[t]:e.props[t]}function m(e,t,n){var o=l(e.children),r=function(e,t){function n(n){return n in t?t[n]:e[n]}e=e||{},t=t||{};var o,r=Object.create(null),i=[];for(var a in e)a in t?i.length&&(r[a]=i,i=[]):i.push(a);var c={};for(var s in t){if(r[s])for(o=0;o<r[s].length;o++){var l=r[s][o];c[r[s][o]]=n(l)}c[s]=n(s)}for(o=0;o<i.length;o++)c[i[o]]=n(i[o]);return c}(t,o);return Object.keys(r).forEach((function(i){var c=r[i];if(Object(a.isValidElement)(c)){var s=i in t,l=i in o,m=t[i],p=Object(a.isValidElement)(m)&&!m.props.in;!l||s&&!p?l||!s||p?l&&s&&Object(a.isValidElement)(m)&&(r[i]=Object(a.cloneElement)(c,{onExited:n.bind(null,c),in:m.props.in,exit:u(c,"exit",e),enter:u(c,"enter",e)})):r[i]=Object(a.cloneElement)(c,{in:!1}):r[i]=Object(a.cloneElement)(c,{onExited:n.bind(null,c),in:!0,exit:u(c,"exit",e),enter:u(c,"enter",e)})}})),r}var p=Object.values||function(e){return Object.keys(e).map((function(t){return e[t]}))},d=function(e){function t(t,n){var o,r=(o=e.call(this,t,n)||this).handleExited.bind(function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(o));return o.state={contextValue:{isMounting:!0},handleExited:r,firstRender:!0},o}Object(i.a)(t,e);var n=t.prototype;return n.componentDidMount=function(){this.mounted=!0,this.setState({contextValue:{isMounting:!1}})},n.componentWillUnmount=function(){this.mounted=!1},t.getDerivedStateFromProps=function(e,t){var n,o,r=t.children,i=t.handleExited;return{children:t.firstRender?(n=e,o=i,l(n.children,(function(e){return Object(a.cloneElement)(e,{onExited:o.bind(null,e),in:!0,appear:u(e,"appear",n),enter:u(e,"enter",n),exit:u(e,"exit",n)})}))):m(e,r,i),firstRender:!1}},n.handleExited=function(e,t){var n=l(this.props.children);e.key in n||(e.props.onExited&&e.props.onExited(t),this.mounted&&this.setState((function(t){var n=Object(r.a)({},t.children);return delete n[e.key],{children:n}})))},n.render=function(){var e=this.props,t=e.component,n=e.childFactory,r=Object(o.a)(e,["component","childFactory"]),i=this.state.contextValue,a=p(this.state.children).map(n);return delete r.appear,delete r.enter,delete r.exit,null===t?c.a.createElement(s.a.Provider,{value:i},a):c.a.createElement(s.a.Provider,{value:i},c.a.createElement(t,r,a))},t}(c.a.Component);d.propTypes={},d.defaultProps={component:"div",childFactory:function(e){return e}};t.a=d},2:function(e,t){e.exports=window.wp.i18n},21:function(e,t){e.exports=window.wc.components},22:function(e,t,n){"use strict";function o(e,t){if(null==e)return{};var n,o,r={},i=Object.keys(e);for(o=0;o<i.length;o++)n=i[o],t.indexOf(n)>=0||(r[n]=e[n]);return r}n.d(t,"a",(function(){return o}))},23:function(e,t,n){"use strict";function o(){return(o=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e}).apply(this,arguments)}n.d(t,"a",(function(){return o}))},25:function(e,t,n){"use strict";function o(e,t){return(o=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function r(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,o(e,t)}n.d(t,"a",(function(){return r}))},265:function(e,t,n){var o;o=function(e,t){return function(e){var t={};function n(o){if(t[o])return t[o].exports;var r=t[o]={i:o,l:!1,exports:{}};return e[o].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=e,n.c=t,n.d=function(e,t,o){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)n.d(o,r,function(t){return e[t]}.bind(null,r));return o},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=4)}([function(e,t,n){e.exports=n(5)()},function(t,n){t.exports=e},function(e,n){e.exports=t},function(e,t){e.exports=function(e,t,n){var o=e.direction,r=e.value;switch(o){case"top":return n.top+r<t.top&&n.bottom>t.bottom&&n.left<t.left&&n.right>t.right;case"left":return n.left+r<t.left&&n.bottom>t.bottom&&n.top<t.top&&n.right>t.right;case"bottom":return n.bottom-r>t.bottom&&n.left<t.left&&n.right>t.right&&n.top<t.top;case"right":return n.right-r>t.right&&n.left<t.left&&n.top<t.top&&n.bottom>t.bottom}}},function(e,t,n){"use strict";n.r(t),n.d(t,"default",(function(){return g}));var o=n(1),r=n.n(o),i=n(2),a=n.n(i),c=n(0),s=n.n(c),l=n(3),u=n.n(l);function m(e){return(m="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function p(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function d(e){return(d=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function f(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function h(e,t){return(h=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function b(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var g=function(e){function t(e){var n,o,r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),o=this,r=d(t).call(this,e),n=!r||"object"!==m(r)&&"function"!=typeof r?f(o):r,b(f(n),"getContainer",(function(){return n.props.containment||window})),b(f(n),"addEventListener",(function(e,t,o,r){var i;n.debounceCheck||(n.debounceCheck={});var a=function(){i=null,n.check()},c={target:e,fn:r>-1?function(){i||(i=setTimeout(a,r||0))}:function(){clearTimeout(i),i=setTimeout(a,o||0)},getLastTimeout:function(){return i}};e.addEventListener(t,c.fn),n.debounceCheck[t]=c})),b(f(n),"startWatching",(function(){n.debounceCheck||n.interval||(n.props.intervalCheck&&(n.interval=setInterval(n.check,n.props.intervalDelay)),n.props.scrollCheck&&n.addEventListener(n.getContainer(),"scroll",n.props.scrollDelay,n.props.scrollThrottle),n.props.resizeCheck&&n.addEventListener(window,"resize",n.props.resizeDelay,n.props.resizeThrottle),!n.props.delayedCall&&n.check())})),b(f(n),"stopWatching",(function(){if(n.debounceCheck)for(var e in n.debounceCheck)if(n.debounceCheck.hasOwnProperty(e)){var t=n.debounceCheck[e];clearTimeout(t.getLastTimeout()),t.target.removeEventListener(e,t.fn),n.debounceCheck[e]=null}n.debounceCheck=null,n.interval&&(n.interval=clearInterval(n.interval))})),b(f(n),"check",(function(){var e,t,o=n.node;if(!o)return n.state;if(e=function(e){return void 0===e.width&&(e.width=e.right-e.left),void 0===e.height&&(e.height=e.bottom-e.top),e}(n.roundRectDown(o.getBoundingClientRect())),n.props.containment){var r=n.props.containment.getBoundingClientRect();t={top:r.top,left:r.left,bottom:r.bottom,right:r.right}}else t={top:0,left:0,bottom:window.innerHeight||document.documentElement.clientHeight,right:window.innerWidth||document.documentElement.clientWidth};var i=n.props.offset||{};"object"===m(i)&&(t.top+=i.top||0,t.left+=i.left||0,t.bottom-=i.bottom||0,t.right-=i.right||0);var a={top:e.top>=t.top,left:e.left>=t.left,bottom:e.bottom<=t.bottom,right:e.right<=t.right},c=e.height>0&&e.width>0,s=c&&a.top&&a.left&&a.bottom&&a.right;if(c&&n.props.partialVisibility){var l=e.top<=t.bottom&&e.bottom>=t.top&&e.left<=t.right&&e.right>=t.left;"string"==typeof n.props.partialVisibility&&(l=a[n.props.partialVisibility]),s=n.props.minTopValue?l&&e.top<=t.bottom-n.props.minTopValue:l}"string"==typeof i.direction&&"number"==typeof i.value&&(console.warn("[notice] offset.direction and offset.value have been deprecated. They still work for now, but will be removed in next major version. Please upgrade to the new syntax: { %s: %d }",i.direction,i.value),s=u()(i,e,t));var p=n.state;return n.state.isVisible!==s&&(p={isVisible:s,visibilityRect:a},n.setState(p),n.props.onChange&&n.props.onChange(s)),p})),n.state={isVisible:null,visibilityRect:{}},n}var n,o,i;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&h(e,t)}(t,e),n=t,(o=[{key:"componentDidMount",value:function(){this.node=a.a.findDOMNode(this),this.props.active&&this.startWatching()}},{key:"componentWillUnmount",value:function(){this.stopWatching()}},{key:"componentDidUpdate",value:function(e){this.node=a.a.findDOMNode(this),this.props.active&&!e.active?(this.setState({isVisible:null,visibilityRect:{}}),this.startWatching()):this.props.active||this.stopWatching()}},{key:"roundRectDown",value:function(e){return{top:Math.floor(e.top),left:Math.floor(e.left),bottom:Math.floor(e.bottom),right:Math.floor(e.right)}}},{key:"render",value:function(){return this.props.children instanceof Function?this.props.children({isVisible:this.state.isVisible,visibilityRect:this.state.visibilityRect}):r.a.Children.only(this.props.children)}}])&&p(n.prototype,o),i&&p(n,i),t}(r.a.Component);b(g,"defaultProps",{active:!0,partialVisibility:!1,minTopValue:0,scrollCheck:!1,scrollDelay:250,scrollThrottle:-1,resizeCheck:!1,resizeDelay:250,resizeThrottle:-1,intervalCheck:!0,intervalDelay:100,delayedCall:!1,offset:{},containment:null,children:r.a.createElement("span",null)}),b(g,"propTypes",{onChange:s.a.func,active:s.a.bool,partialVisibility:s.a.oneOfType([s.a.bool,s.a.oneOf(["top","right","bottom","left"])]),delayedCall:s.a.bool,offset:s.a.oneOfType([s.a.shape({top:s.a.number,left:s.a.number,bottom:s.a.number,right:s.a.number}),s.a.shape({direction:s.a.oneOf(["top","right","bottom","left"]),value:s.a.number})]),scrollCheck:s.a.bool,scrollDelay:s.a.number,scrollThrottle:s.a.number,resizeCheck:s.a.bool,resizeDelay:s.a.number,resizeThrottle:s.a.number,intervalCheck:s.a.bool,intervalDelay:s.a.number,containment:"undefined"!=typeof window?s.a.instanceOf(window.Element):s.a.any,children:s.a.oneOfType([s.a.element,s.a.func]),minTopValue:s.a.number})},function(e,t,n){"use strict";var o=n(6);function r(){}function i(){}i.resetWarningCache=r,e.exports=function(){function e(e,t,n,r,i,a){if(a!==o){var c=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw c.name="Invariant Violation",c}}function t(){return e}e.isRequired=e;var n={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:i,resetWarningCache:r};return n.PropTypes=n,n}},function(e,t,n){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"}])},e.exports=o(n(5),n(29))},27:function(e,t){e.exports=window.wp.keycodes},277:function(e,t,n){"use strict";var o=n(0),r=n(8),i=Object(o.createElement)(r.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},Object(o.createElement)(r.Path,{d:"M6.5 12.4L12 8l5.5 4.4-.9 1.2L12 10l-4.5 3.6-1-1.2z"}));t.a=i},278:function(e,t,n){"use strict";var o=n(0),r=n(8),i=Object(o.createElement)(r.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},Object(o.createElement)(r.Path,{d:"M17.5 11.6L12 16l-5.5-4.4.9-1.2L12 14l4.5-3.6 1 1.2z"}));t.a=i},29:function(e,t){e.exports=window.ReactDOM},3:function(e,t){e.exports=window.wp.components},33:function(e,t,n){"use strict";var o=n(5),r=n.n(o);t.a=r.a.createContext(null)},464:function(e,t,n){"use strict";n.r(t),n.d(t,"Navigation",(function(){return W})),n.d(t,"NavigationBackButton",(function(){return G})),n.d(t,"NavigationGroup",(function(){return q})),n.d(t,"NavigationMenu",(function(){return $})),n.d(t,"NavigationItem",(function(){return Y})),n.d(t,"Text",(function(){return K})),n.d(t,"useSlot",(function(){return X})),n.d(t,"ListItem",(function(){return l})),n.d(t,"List",(function(){return m})),n.d(t,"CollapsibleList",(function(){return y})),n.d(t,"TaskItem",(function(){return D})),n.d(t,"InboxNoteCard",(function(){return F})),n.d(t,"InboxDismissConfirmationModal",(function(){return U})),n.d(t,"InboxNotePlaceholder",(function(){return V})),n.d(t,"VerticalCSSTransition",(function(){return k}));var o=n(3),r=n(169),i=n(0),a=n(27),c=n(6),s=n.n(c);const l=({children:e,disableGutters:t=!1,animation:n="none",className:o="",exit:c,enter:l,onExited:u,in:m,...p})=>{const d=!!(null==p?void 0:p.onClick),f=d?{role:"button",onKeyDown:e=>{return t=e,void("function"==typeof(n=p.onClick)&&t.keyCode===a.ENTER&&n(t));var t,n},tabIndex:0}:{},h=s()({"has-action":d,"has-gutters":!t,"transitions-disabled":"slide-right"!==n});return Object(i.createElement)(r.a,{timeout:500,classNames:o||"woocommerce-list__item",in:m,exit:c,enter:l,onExited:u},Object(i.createElement)("li",Object.assign({},f,p,{className:`woocommerce-experimental-list__item ${h} ${o}`}),e))};var u=n(172);const m=({children:e,listType:t,animation:n="none",...o})=>Object(i.createElement)(u.a,Object.assign({component:t||"ul",className:"woocommerce-experimental-list"},o),i.Children.map(e,e=>{if(Object(i.isValidElement)(e)){const{onExited:t,in:o,enter:a,exit:c,...s}=e.props,l=s.animation||n;return Object(i.createElement)(r.a,{timeout:500,onExited:t,in:o,enter:a,exit:c,classNames:"woocommerce-list__item"},Object(i.cloneElement)(e,{animation:l,...s}))}return e}));var p=n(116),d=n(278),f=n(277),h=n(65);const b={transitionProperty:"max-height",transitionDuration:"500ms",maxHeight:0,overflow:"hidden"};function g(e,t,n){if(n.length<e.length){const e=n.map(e=>e.key);return t.filter(t=>t.key&&e.includes(t.key))}const o=t.map(e=>e.key),r=e.map(e=>e.key);return n.filter(e=>e.key&&(o.includes(e.key)||!r.includes(e.key)))}const v=(e,t,n)=>{let o=0;"entered"!==e&&"entering"!==e||!n||(o=function(e){let t=0;if(e)for(const n of e.children){t+=n.clientHeight;const e=window.getComputedStyle(n);t+=parseInt(e.marginTop,10)||0,t+=parseInt(e.marginBottom,10)||0}return t}(n));const r={...b,maxHeight:o};return"entering"!==e&&"exiting"!==e&&(delete r.transitionDuration,delete r.transition,delete r.transitionProperty),"entered"!==e||t||delete r.maxHeight,r},y=({children:e,collapsed:t=!0,collapseLabel:n,expandLabel:o,show:a=0,onCollapse:c,onExpand:b,...y})=>{const[O,x]=Object(i.useState)(t),[E,w]=Object(i.useState)(t),[j,_]=Object(i.useState)({collapse:n,expand:o}),[k,T]=Object(i.useState)({all:[],shown:[],hidden:[]}),N=Object(i.useRef)(null),C=()=>{let t=[];const r=i.Children.map(e,e=>Object(i.isValidElement)(e)&&"key"in e?e:null)||[];let c=r;a>0&&(t=r.slice(0,a),c=r.slice(a)),c.length>0&&_({expand:o,collapse:n}),T({all:r,shown:t,hidden:c})};Object(i.useEffect)(()=>{w(O)},[O]),Object(i.useEffect)(()=>{const t=i.Children.map(e,e=>Object(i.isValidElement)(e)&&"key"in e?e:null)||[];k.all.length>0&&O&&"none"!==y.animation?(T({...k,shown:g(k.all,k.shown,t)}),setTimeout(()=>{C()},500)):C()},[e]);const S=Object(i.useCallback)(()=>{var e;x(!O),e=!O,c&&e&&c(),b&&!e&&b()},[O]),A=s()(y.className||"","woocommerce-experimental-list"),D=s()({"woocommerce-experimental-list-wrapper":!O});return Object(i.createElement)(m,Object.assign({},y,{className:A}),[...k.shown,Object(i.createElement)(h.a,{key:"remaining-children",timeout:500,in:!E,mountOnEnter:!0,unmountOnExit:!1},e=>{const t=v(e,O,N.current);return Object(i.createElement)("div",{className:D,ref:N,style:t},Object(i.createElement)(u.a,{className:"woocommerce-experimental-list"},i.Children.map(k.hidden,e=>{const{onExited:t,in:n,enter:o,exit:a,...c}=e.props,s=c.animation||y.animation;return Object(i.createElement)(r.a,{key:e.key,timeout:500,onExited:t,in:n,enter:o,exit:a,classNames:"woocommerce-list__item"},Object(i.cloneElement)(e,{animation:s,...c}))})))}),k.hidden.length>0?Object(i.createElement)(l,{key:"collapse-item",className:"list-item-collapse",onClick:S,animation:"none",disableGutters:!0},Object(i.createElement)("p",null,O?j.expand:j.collapse),Object(i.createElement)(p.a,{className:"list-item-collapse__icon",size:30,icon:O?d.a:f.a})):null])};var O=n(2),x=n(475),E=n(61),w=n.n(E),j=n(21),_=n(53);const k=({children:e,defaultStyle:t,...n})=>{const[o,a]=Object(i.useState)(0),[c,s]=Object(i.useState)(n.in||!1),l=Object(i.useRef)(null),u=Object(i.useCallback)(e=>{e&&a(function(e){let t=0;for(const n of e.children){t+=n.clientHeight;const e=window.getComputedStyle(n);t+=parseInt(e.marginTop,10)||0,t+=parseInt(e.marginBottom,10)||0}return t}(e))},[e]);Object(i.useEffect)(()=>{s(n.in||!1)},[n.in]);const m={entered:{maxHeight:o},entering:{maxHeight:o},exiting:{maxHeight:0},exited:{maxHeight:0}},p=e=>{const o=(()=>{const{timeout:e}=n;let t,o,r;return"number"==typeof e&&(t=o=r=e),void 0!==e&&"number"!=typeof e&&(t=e.exit,o=e.enter,r=void 0!==e.appear?e.appear:o),{exit:t,enter:o,appear:r}})(),r=l.current&&l.current.context&&l.current.context.isMounting;let i;i=e.startsWith("enter")?o[r?"enter":"appear"]:o.exit;const a={transitionProperty:"max-height",transitionDuration:void 0===i?"500ms":i+"ms",overflow:"hidden",...t||{},...m[e]};return"entering"!==e&&"exiting"!==e&&(delete a.transitionDuration,delete a.transition,delete a.transitionProperty),"entered"===e&&n.in&&delete a.maxHeight,a};return Object(i.createElement)(r.a,Object.assign({},n,{in:c,ref:l}),t=>Object(i.createElement)("div",{className:"vertical-css-transition-container",style:p(t),ref:u},e))},T=["a","b","em","i","strong","p","br"],N=["target","href","rel","name","download"],C=e=>({__html:Object(_.sanitize)(e,{ALLOWED_TAGS:T,ALLOWED_ATTR:N})}),S=({level:e,completed:t,children:n})=>{let r="";return 1!==e||t?2!==e||t||(r=Object(O.__)("This task is required to set up your extension",'woocommerce')):r=Object(O.__)("This task is required to keep your store running",'woocommerce'),""===r?n:Object(i.createElement)(o.Tooltip,{text:r},n)},A=({children:e,expandable:t,expanded:n})=>t?Object(i.createElement)(k,{timeout:500,in:n,classNames:"woocommerce-task-list__item-expandable-content",defaultStyle:{transitionProperty:"max-height, opacity"}},e):n?Object(i.createElement)(i.Fragment,null,e):null,D=({completed:e,title:t,onDelete:n,onCollapse:r,onDismiss:a,onSnooze:c,onExpand:u,onClick:m,additionalInfo:d,time:f,content:h,expandable:b=!1,expanded:g=!1,showActionButton:v,level:y=3,action:E,actionLabel:_,...k})=>{const[T,N]=Object(i.useState)(g);Object(i.useEffect)(()=>{N(g)},[g]);const D=s()("woocommerce-task-list__item",{complete:e,expanded:T,"level-2":2===y&&!e,"level-1":1===y&&!e});void 0===v&&(v=b);const R=(a||c)&&!e||n&&e;return Object(i.createElement)(l,Object.assign({disableGutters:!0,className:D,onClick:b&&v?()=>{N(!T),T&&u&&u(),!T&&r&&r()}:m},k),Object(i.createElement)(S,{level:y,completed:e},Object(i.createElement)("div",{className:"woocommerce-task-list__item-before"},1!==y||e?Object(i.createElement)("div",{className:"woocommerce-task__icon"},e&&Object(i.createElement)(p.a,{icon:x.a})):Object(i.createElement)(w.a,{size:36}))),Object(i.createElement)("div",{className:"woocommerce-task-list__item-text"},Object(i.createElement)(K,{as:"div",size:"14",lineHeight:e?"18px":"20px",weight:e?"normal":"600",variant:e?"body.small":"button"},Object(i.createElement)("span",{className:"woocommerce-task-list__item-title"},t),Object(i.createElement)(A,{expandable:b,expanded:T},Object(i.createElement)("div",{className:"woocommerce-task-list__item-expandable-content"},h,b&&!e&&d&&Object(i.createElement)("div",{className:"woocommerce-task__additional-info",dangerouslySetInnerHTML:C(d)}),!e&&v&&Object(i.createElement)(o.Button,{className:"woocommerce-task-list__item-action",isPrimary:!0,onClick:e=>{e.stopPropagation(),E(e,{isExpanded:!0})}},_||t))),!b&&!e&&d&&Object(i.createElement)("div",{className:"woocommerce-task__additional-info",dangerouslySetInnerHTML:C(d)}),f&&Object(i.createElement)("div",{className:"woocommerce-task__estimated-time"},f))),R&&Object(i.createElement)(j.EllipsisMenu,{label:Object(O.__)("Task Options",'woocommerce'),className:"woocommerce-task-list__item-after",onToggle:e=>e.stopPropagation(),renderContent:()=>Object(i.createElement)("div",{className:"woocommerce-task-card__section-controls"},a&&!e&&Object(i.createElement)(o.Button,{onClick:e=>{e.stopPropagation(),a()}},Object(O.__)("Dismiss",'woocommerce')),c&&!e&&Object(i.createElement)(o.Button,{onClick:e=>{e.stopPropagation(),c()}},Object(O.__)("Remind me later",'woocommerce')),n&&e&&Object(i.createElement)(o.Button,{onClick:e=>{e.stopPropagation(),n()}},Object(O.__)("Delete",'woocommerce')))}))};var R=n(265),L=n.n(R),M=n(9),P=n.n(M);const I=({label:e,onClick:t,href:n})=>{const[r,a]=Object(i.useState)(!1);return Object(i.createElement)(o.Button,{isSecondary:!0,isBusy:r,disabled:r,href:n,onClick:e=>{const n=e.currentTarget.href||"";let o=!0,r="";window.wcSettings&&(r=window.wcSettings.adminUrl),!n.length||r&&n.startsWith(r)||(e.preventDefault(),o=!1,window.open(n,"_blank")),a(o),t()}},e)};const z=["a","b","em","i","strong","p","br"],B=["target","href","rel","name","download"],H=o.Dropdown,F=({note:e,lastRead:t,onDismiss:n,onNoteActionClick:r,onBodyLinkClick:a,onNoteVisible:c,className:l})=>{const[u,m]=Object(i.useState)(!1),p=Object(i.useRef)(!1),d=Object(i.useRef)(null),f=function(e){const t=Object(i.useCallback)(t=>{const n=t.target;if(n&&"href"in n){const t=n.href;t&&e&&e(t)}},[e]);return Object(i.useCallback)(e=>(e&&e.addEventListener("click",t),()=>{e&&e.removeEventListener("click",t)}),[t])}(t=>{a&&a(e,t)}),h=(t,o)=>{n&&n(e,t),o()},{content:b,date_created:g,date_created_gmt:v,image:y,is_deleted:x,layout:E,status:w,title:k}=e;if(x)return null;const T=!t||!v||new Date(v+"Z").getTime()>t,N=g,C="plain"!==E&&""!==E,S=s()("woocommerce-inbox-message",l,E,{"message-is-unread":T&&"unactioned"===w});return Object(i.createElement)(L.a,{onChange:t=>{t&&!p.current&&(c&&c(e),p.current=!0)}},Object(i.createElement)("section",{className:S},C&&Object(i.createElement)("div",{className:"woocommerce-inbox-message__image"},Object(i.createElement)("img",{src:y,alt:""})),Object(i.createElement)("div",{className:"woocommerce-inbox-message__wrapper"},Object(i.createElement)("div",{className:"woocommerce-inbox-message__content"},T&&Object(i.createElement)("div",{className:"woocommerce-inbox-message__unread-indicator"}),N&&Object(i.createElement)("span",{className:"woocommerce-inbox-message__date"},P.a.utc(N).fromNow()),Object(i.createElement)(j.H,{className:"woocommerce-inbox-message__title"},k),Object(i.createElement)(j.Section,{className:"woocommerce-inbox-message__text"},Object(i.createElement)("span",{dangerouslySetInnerHTML:(A=b,{__html:Object(_.sanitize)(A,{ALLOWED_TAGS:z,ALLOWED_ATTR:B})}),ref:f}))),Object(i.createElement)("div",{className:"woocommerce-inbox-message__actions"},(()=>{const{actions:t}=e;return u||(t?Object(i.createElement)(i.Fragment,null,t.map(t=>Object(i.createElement)(I,{key:t.id,label:t.label,href:t&&t.url&&t.url.length?t.url:void 0,onClick:()=>(t=>{r&&r(e,t),t.actioned_text&&m(t.actioned_text)})(t)}))):void 0)})(),u?null:Object(i.createElement)(H,{contentClassName:"woocommerce-admin-dismiss-dropdown",position:"bottom right",renderToggle:({onClose:e,onToggle:t})=>Object(i.createElement)(o.Button,{isTertiary:!0,onClick:e=>{e.target.focus(),t()},ref:d,onBlur:t=>((e,t)=>{const n=["woocommerce-admin-dismiss-notification","components-popover__content","components-dropdown__content"];let o=null;if(e.relatedTarget)o=e.relatedTarget;else if(d.current){const e=d.current.ownerDocument;o=e?e.activeElement:null}let r=!1;if(o&&"className"in o){const e=o.className;r=n.some(t=>e.includes(t))}r?e.preventDefault():t()})(t,e)},Object(O.__)("Dismiss",'woocommerce')),focusOnMount:!1,popoverProps:{noArrow:!0},renderContent:({onToggle:e})=>Object(i.createElement)("ul",null,Object(i.createElement)("li",null,Object(i.createElement)(o.Button,{className:"woocommerce-admin-dismiss-notification",onClick:()=>h("note",e)},Object(O.__)("Dismiss this message",'woocommerce'))),Object(i.createElement)("li",null,Object(i.createElement)(o.Button,{className:"woocommerce-admin-dismiss-notification",onClick:()=>h("all",e)},Object(O.__)("Dismiss all messages",'woocommerce'))))})))));var A},U=({onClose:e,onDismiss:t,buttonLabel:n=Object(O.__)("Yes, I'm sure",'woocommerce')})=>{const[r,a]=Object(i.useState)(!1);return Object(i.createElement)(o.Modal,{title:Object(O.__)("Are you sure?",'woocommerce'),onRequestClose:()=>e(),className:"woocommerce-inbox-dismiss-confirmation_modal"},Object(i.createElement)("div",{className:"woocommerce-inbox-dismiss-confirmation_wrapper"},Object(i.createElement)("p",null,Object(O.__)("Dismissed messages cannot be viewed again",'woocommerce')),Object(i.createElement)("div",{className:"woocommerce-inbox-dismiss-confirmation_buttons"},Object(i.createElement)(o.Button,{isSecondary:!0,onClick:()=>e()},Object(O.__)("Cancel",'woocommerce')),Object(i.createElement)(o.Button,{isSecondary:!0,isBusy:r,disabled:r,onClick:()=>{a(!0),t()}},n))))},V=({className:e})=>Object(i.createElement)("div",{className:"woocommerce-inbox-message is-placeholder "+e,"aria-hidden":!0},Object(i.createElement)("div",{className:"woocommerce-inbox-message__wrapper"},Object(i.createElement)("div",{className:"woocommerce-inbox-message__content"},Object(i.createElement)("div",{className:"woocommerce-inbox-message__date"},Object(i.createElement)("div",{className:"sixth-line"})),Object(i.createElement)("div",{className:"woocommerce-inbox-message__title"},Object(i.createElement)("div",{className:"line"}),Object(i.createElement)("div",{className:"line"})),Object(i.createElement)("div",{className:"woocommerce-inbox-message__text"},Object(i.createElement)("div",{className:"line"}),Object(i.createElement)("div",{className:"third-line"}))),Object(i.createElement)("div",{className:"woocommerce-inbox-message__actions"},Object(i.createElement)("div",{className:"fifth-line"}),Object(i.createElement)("div",{className:"fifth-line"})))),W=o.Navigation||o.__experimentalNavigation,G=o.NavigationBackButton||o.__experimentalNavigationBackButton,q=o.NavigationGroup||o.__experimentalNavigationGroup,$=o.NavigationMenu||o.__experimentalNavigationMenu,Y=o.NavigationItem||o.__experimentalNavigationItem,K=o.Text||o.__experimentalText,X=o.useSlot||o.__experimentalUseSlot},47:function(e,t,n){"use strict";var o=n(48);function r(){}function i(){}i.resetWarningCache=r,e.exports=function(){function e(e,t,n,r,i,a){if(a!==o){var c=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw c.name="Invariant Violation",c}}function t(){return e}e.isRequired=e;var n={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:i,resetWarningCache:r};return n.PropTypes=n,n}},475:function(e,t,n){"use strict";var o=n(0),r=n(8),i=Object(o.createElement)(r.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(o.createElement)(r.Path,{d:"M18.3 5.6L9.9 16.9l-4.6-3.4-.9 1.2 5.8 4.3 9.3-12.6z"}));t.a=i},48:function(e,t,n){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},5:function(e,t){e.exports=window.React},53:function(e,t,n){e.exports=function(){"use strict";var e=Object.hasOwnProperty,t=Object.setPrototypeOf,n=Object.isFrozen,o=Object.getPrototypeOf,r=Object.getOwnPropertyDescriptor,i=Object.freeze,a=Object.seal,c=Object.create,s="undefined"!=typeof Reflect&&Reflect,l=s.apply,u=s.construct;l||(l=function(e,t,n){return e.apply(t,n)}),i||(i=function(e){return e}),a||(a=function(e){return e}),u||(u=function(e,t){return new(Function.prototype.bind.apply(e,[null].concat(function(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}(t))))});var m,p=E(Array.prototype.forEach),d=E(Array.prototype.pop),f=E(Array.prototype.push),h=E(String.prototype.toLowerCase),b=E(String.prototype.match),g=E(String.prototype.replace),v=E(String.prototype.indexOf),y=E(String.prototype.trim),O=E(RegExp.prototype.test),x=(m=TypeError,function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return u(m,t)});function E(e){return function(t){for(var n=arguments.length,o=Array(n>1?n-1:0),r=1;r<n;r++)o[r-1]=arguments[r];return l(e,t,o)}}function w(e,o){t&&t(e,null);for(var r=o.length;r--;){var i=o[r];if("string"==typeof i){var a=h(i);a!==i&&(n(o)||(o[r]=a),i=a)}e[i]=!0}return e}function j(t){var n=c(null),o=void 0;for(o in t)l(e,t,[o])&&(n[o]=t[o]);return n}function _(e,t){for(;null!==e;){var n=r(e,t);if(n){if(n.get)return E(n.get);if("function"==typeof n.value)return E(n.value)}e=o(e)}return function(e){return console.warn("fallback value for",e),null}}var k=i(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),T=i(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),N=i(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),C=i(["animate","color-profile","cursor","discard","fedropshadow","feimage","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),S=i(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover"]),A=i(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),D=i(["#text"]),R=i(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","xmlns","slot"]),L=i(["accent-height","accumulate","additive","alignment-baseline","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","targetx","targety","transform","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),M=i(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),P=i(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),I=a(/\{\{[\s\S]*|[\s\S]*\}\}/gm),z=a(/<%[\s\S]*|[\s\S]*%>/gm),B=a(/^data-[\-\w.\u00B7-\uFFFF]/),H=a(/^aria-[\-\w]+$/),F=a(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),U=a(/^(?:\w+script|data):/i),V=a(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),W="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};function G(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}var q=function(){return"undefined"==typeof window?null:window},$=function(e,t){if("object"!==(void 0===e?"undefined":W(e))||"function"!=typeof e.createPolicy)return null;var n=null;t.currentScript&&t.currentScript.hasAttribute("data-tt-policy-suffix")&&(n=t.currentScript.getAttribute("data-tt-policy-suffix"));var o="dompurify"+(n?"#"+n:"");try{return e.createPolicy(o,{createHTML:function(e){return e}})}catch(e){return console.warn("TrustedTypes policy "+o+" could not be created."),null}};return function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:q(),n=function(t){return e(t)};if(n.version="2.2.9",n.removed=[],!t||!t.document||9!==t.document.nodeType)return n.isSupported=!1,n;var o=t.document,r=t.document,a=t.DocumentFragment,c=t.HTMLTemplateElement,s=t.Node,l=t.Element,u=t.NodeFilter,m=t.NamedNodeMap,E=void 0===m?t.NamedNodeMap||t.MozNamedAttrMap:m,Y=t.Text,K=t.Comment,X=t.DOMParser,Z=t.trustedTypes,J=l.prototype,Q=_(J,"cloneNode"),ee=_(J,"nextSibling"),te=_(J,"childNodes"),ne=_(J,"parentNode");if("function"==typeof c){var oe=r.createElement("template");oe.content&&oe.content.ownerDocument&&(r=oe.content.ownerDocument)}var re=$(Z,o),ie=re&&Pe?re.createHTML(""):"",ae=r,ce=ae.implementation,se=ae.createNodeIterator,le=ae.createDocumentFragment,ue=o.importNode,me={};try{me=j(r).documentMode?r.documentMode:{}}catch(e){}var pe={};n.isSupported="function"==typeof ne&&ce&&void 0!==ce.createHTMLDocument&&9!==me;var de=I,fe=z,he=B,be=H,ge=U,ve=V,ye=F,Oe=null,xe=w({},[].concat(G(k),G(T),G(N),G(S),G(D))),Ee=null,we=w({},[].concat(G(R),G(L),G(M),G(P))),je=null,_e=null,ke=!0,Te=!0,Ne=!1,Ce=!1,Se=!1,Ae=!1,De=!1,Re=!1,Le=!1,Me=!0,Pe=!1,Ie=!0,ze=!0,Be=!1,He={},Fe=w({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]),Ue=null,Ve=w({},["audio","video","img","source","image","track"]),We=null,Ge=w({},["alt","class","for","id","label","name","pattern","placeholder","summary","title","value","style","xmlns"]),qe="http://www.w3.org/1998/Math/MathML",$e="http://www.w3.org/2000/svg",Ye="http://www.w3.org/1999/xhtml",Ke=Ye,Xe=!1,Ze=null,Je=r.createElement("form"),Qe=function(e){Ze&&Ze===e||(e&&"object"===(void 0===e?"undefined":W(e))||(e={}),e=j(e),Oe="ALLOWED_TAGS"in e?w({},e.ALLOWED_TAGS):xe,Ee="ALLOWED_ATTR"in e?w({},e.ALLOWED_ATTR):we,We="ADD_URI_SAFE_ATTR"in e?w(j(Ge),e.ADD_URI_SAFE_ATTR):Ge,Ue="ADD_DATA_URI_TAGS"in e?w(j(Ve),e.ADD_DATA_URI_TAGS):Ve,je="FORBID_TAGS"in e?w({},e.FORBID_TAGS):{},_e="FORBID_ATTR"in e?w({},e.FORBID_ATTR):{},He="USE_PROFILES"in e&&e.USE_PROFILES,ke=!1!==e.ALLOW_ARIA_ATTR,Te=!1!==e.ALLOW_DATA_ATTR,Ne=e.ALLOW_UNKNOWN_PROTOCOLS||!1,Ce=e.SAFE_FOR_TEMPLATES||!1,Se=e.WHOLE_DOCUMENT||!1,Re=e.RETURN_DOM||!1,Le=e.RETURN_DOM_FRAGMENT||!1,Me=!1!==e.RETURN_DOM_IMPORT,Pe=e.RETURN_TRUSTED_TYPE||!1,De=e.FORCE_BODY||!1,Ie=!1!==e.SANITIZE_DOM,ze=!1!==e.KEEP_CONTENT,Be=e.IN_PLACE||!1,ye=e.ALLOWED_URI_REGEXP||ye,Ke=e.NAMESPACE||Ye,Ce&&(Te=!1),Le&&(Re=!0),He&&(Oe=w({},[].concat(G(D))),Ee=[],!0===He.html&&(w(Oe,k),w(Ee,R)),!0===He.svg&&(w(Oe,T),w(Ee,L),w(Ee,P)),!0===He.svgFilters&&(w(Oe,N),w(Ee,L),w(Ee,P)),!0===He.mathMl&&(w(Oe,S),w(Ee,M),w(Ee,P))),e.ADD_TAGS&&(Oe===xe&&(Oe=j(Oe)),w(Oe,e.ADD_TAGS)),e.ADD_ATTR&&(Ee===we&&(Ee=j(Ee)),w(Ee,e.ADD_ATTR)),e.ADD_URI_SAFE_ATTR&&w(We,e.ADD_URI_SAFE_ATTR),ze&&(Oe["#text"]=!0),Se&&w(Oe,["html","head","body"]),Oe.table&&(w(Oe,["tbody"]),delete je.tbody),i&&i(e),Ze=e)},et=w({},["mi","mo","mn","ms","mtext"]),tt=w({},["foreignobject","desc","title","annotation-xml"]),nt=w({},T);w(nt,N),w(nt,C);var ot=w({},S);w(ot,A);var rt=function(e){var t=ne(e);t&&t.tagName||(t={namespaceURI:Ye,tagName:"template"});var n=h(e.tagName),o=h(t.tagName);if(e.namespaceURI===$e)return t.namespaceURI===Ye?"svg"===n:t.namespaceURI===qe?"svg"===n&&("annotation-xml"===o||et[o]):Boolean(nt[n]);if(e.namespaceURI===qe)return t.namespaceURI===Ye?"math"===n:t.namespaceURI===$e?"math"===n&&tt[o]:Boolean(ot[n]);if(e.namespaceURI===Ye){if(t.namespaceURI===$e&&!tt[o])return!1;if(t.namespaceURI===qe&&!et[o])return!1;var r=w({},["title","style","font","a","script"]);return!ot[n]&&(r[n]||!nt[n])}return!1},it=function(e){f(n.removed,{element:e});try{e.parentNode.removeChild(e)}catch(t){try{e.outerHTML=ie}catch(t){e.remove()}}},at=function(e,t){try{f(n.removed,{attribute:t.getAttributeNode(e),from:t})}catch(e){f(n.removed,{attribute:null,from:t})}if(t.removeAttribute(e),"is"===e&&!Ee[e])if(Re||Le)try{it(t)}catch(e){}else try{t.setAttribute(e,"")}catch(e){}},ct=function(e){var t=void 0,n=void 0;if(De)e="<remove></remove>"+e;else{var o=b(e,/^[\r\n\t ]+/);n=o&&o[0]}var i=re?re.createHTML(e):e;if(Ke===Ye)try{t=(new X).parseFromString(i,"text/html")}catch(e){}if(!t||!t.documentElement){t=ce.createDocument(Ke,"template",null);try{t.documentElement.innerHTML=Xe?"":i}catch(e){}}var a=t.body||t.documentElement;return e&&n&&a.insertBefore(r.createTextNode(n),a.childNodes[0]||null),Se?t.documentElement:a},st=function(e){return se.call(e.ownerDocument||e,e,u.SHOW_ELEMENT|u.SHOW_COMMENT|u.SHOW_TEXT,null,!1)},lt=function(e){return!(e instanceof Y||e instanceof K||"string"==typeof e.nodeName&&"string"==typeof e.textContent&&"function"==typeof e.removeChild&&e.attributes instanceof E&&"function"==typeof e.removeAttribute&&"function"==typeof e.setAttribute&&"string"==typeof e.namespaceURI&&"function"==typeof e.insertBefore)},ut=function(e){return"object"===(void 0===s?"undefined":W(s))?e instanceof s:e&&"object"===(void 0===e?"undefined":W(e))&&"number"==typeof e.nodeType&&"string"==typeof e.nodeName},mt=function(e,t,o){pe[e]&&p(pe[e],(function(e){e.call(n,t,o,Ze)}))},pt=function(e){var t=void 0;if(mt("beforeSanitizeElements",e,null),lt(e))return it(e),!0;if(b(e.nodeName,/[\u0080-\uFFFF]/))return it(e),!0;var o=h(e.nodeName);if(mt("uponSanitizeElement",e,{tagName:o,allowedTags:Oe}),!ut(e.firstElementChild)&&(!ut(e.content)||!ut(e.content.firstElementChild))&&O(/<[/\w]/g,e.innerHTML)&&O(/<[/\w]/g,e.textContent))return it(e),!0;if(!Oe[o]||je[o]){if(ze&&!Fe[o]){var r=ne(e)||e.parentNode,i=te(e)||e.childNodes;if(i&&r)for(var a=i.length-1;a>=0;--a)r.insertBefore(Q(i[a],!0),ee(e))}return it(e),!0}return e instanceof l&&!rt(e)?(it(e),!0):"noscript"!==o&&"noembed"!==o||!O(/<\/no(script|embed)/i,e.innerHTML)?(Ce&&3===e.nodeType&&(t=e.textContent,t=g(t,de," "),t=g(t,fe," "),e.textContent!==t&&(f(n.removed,{element:e.cloneNode()}),e.textContent=t)),mt("afterSanitizeElements",e,null),!1):(it(e),!0)},dt=function(e,t,n){if(Ie&&("id"===t||"name"===t)&&(n in r||n in Je))return!1;if(Te&&O(he,t));else if(ke&&O(be,t));else{if(!Ee[t]||_e[t])return!1;if(We[t]);else if(O(ye,g(n,ve,"")));else if("src"!==t&&"xlink:href"!==t&&"href"!==t||"script"===e||0!==v(n,"data:")||!Ue[e])if(Ne&&!O(ge,g(n,ve,"")));else if(n)return!1}return!0},ft=function(e){var t=void 0,o=void 0,r=void 0,i=void 0;mt("beforeSanitizeAttributes",e,null);var a=e.attributes;if(a){var c={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Ee};for(i=a.length;i--;){var s=t=a[i],l=s.name,u=s.namespaceURI;if(o=y(t.value),r=h(l),c.attrName=r,c.attrValue=o,c.keepAttr=!0,c.forceKeepAttr=void 0,mt("uponSanitizeAttribute",e,c),o=c.attrValue,!c.forceKeepAttr&&(at(l,e),c.keepAttr))if(O(/\/>/i,o))at(l,e);else{Ce&&(o=g(o,de," "),o=g(o,fe," "));var m=e.nodeName.toLowerCase();if(dt(m,r,o))try{u?e.setAttributeNS(u,l,o):e.setAttribute(l,o),d(n.removed)}catch(e){}}}mt("afterSanitizeAttributes",e,null)}},ht=function e(t){var n=void 0,o=st(t);for(mt("beforeSanitizeShadowDOM",t,null);n=o.nextNode();)mt("uponSanitizeShadowNode",n,null),pt(n)||(n.content instanceof a&&e(n.content),ft(n));mt("afterSanitizeShadowDOM",t,null)};return n.sanitize=function(e,r){var i=void 0,c=void 0,l=void 0,u=void 0,m=void 0;if((Xe=!e)&&(e="\x3c!--\x3e"),"string"!=typeof e&&!ut(e)){if("function"!=typeof e.toString)throw x("toString is not a function");if("string"!=typeof(e=e.toString()))throw x("dirty is not a string, aborting")}if(!n.isSupported){if("object"===W(t.toStaticHTML)||"function"==typeof t.toStaticHTML){if("string"==typeof e)return t.toStaticHTML(e);if(ut(e))return t.toStaticHTML(e.outerHTML)}return e}if(Ae||Qe(r),n.removed=[],"string"==typeof e&&(Be=!1),Be);else if(e instanceof s)1===(c=(i=ct("\x3c!----\x3e")).ownerDocument.importNode(e,!0)).nodeType&&"BODY"===c.nodeName||"HTML"===c.nodeName?i=c:i.appendChild(c);else{if(!Re&&!Ce&&!Se&&-1===e.indexOf("<"))return re&&Pe?re.createHTML(e):e;if(!(i=ct(e)))return Re?null:ie}i&&De&&it(i.firstChild);for(var p=st(Be?e:i);l=p.nextNode();)3===l.nodeType&&l===u||pt(l)||(l.content instanceof a&&ht(l.content),ft(l),u=l);if(u=null,Be)return e;if(Re){if(Le)for(m=le.call(i.ownerDocument);i.firstChild;)m.appendChild(i.firstChild);else m=i;return Me&&(m=ue.call(o,m,!0)),m}var d=Se?i.outerHTML:i.innerHTML;return Ce&&(d=g(d,de," "),d=g(d,fe," ")),re&&Pe?re.createHTML(d):d},n.setConfig=function(e){Qe(e),Ae=!0},n.clearConfig=function(){Ze=null,Ae=!1},n.isValidAttribute=function(e,t,n){Ze||Qe({});var o=h(e),r=h(t);return dt(o,r,n)},n.addHook=function(e,t){"function"==typeof t&&(pe[e]=pe[e]||[],f(pe[e],t))},n.removeHook=function(e){pe[e]&&d(pe[e])},n.removeHooks=function(e){pe[e]&&(pe[e]=[])},n.removeAllHooks=function(){pe={}},n}()}()},6:function(e,t,n){!function(){"use strict";var t={}.hasOwnProperty;function n(){for(var e=[],o=0;o<arguments.length;o++){var r=arguments[o];if(r){var i=typeof r;if("string"===i||"number"===i)e.push(r);else if(Array.isArray(r)){if(r.length){var a=n.apply(null,r);a&&e.push(a)}}else if("object"===i)if(r.toString===Object.prototype.toString)for(var c in r)t.call(r,c)&&r[c]&&e.push(c);else e.push(r.toString())}}return e.join(" ")}e.exports?(n.default=n,e.exports=n):"function"==typeof define&&"object"==typeof define.amd&&define.amd?define("classnames",[],(function(){return n})):window.classNames=n}()},61:function(e,t,n){"use strict";var o=Object.assign||function(e){for(var t,n=1;n<arguments.length;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e};Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n=e.size,r=void 0===n?24:n,i=e.onClick,c=(e.icon,e.className),s=function(e,t){var n={};for(var o in e)0<=t.indexOf(o)||Object.prototype.hasOwnProperty.call(e,o)&&(n[o]=e[o]);return n}(e,["size","onClick","icon","className"]),l=["gridicon","gridicons-notice-outline",c,(t=r,!(0!=t%18)&&"needs-offset"),!1,!1].filter(Boolean).join(" ");return a.default.createElement("svg",o({className:l,height:r,width:r,onClick:i},s,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"}),a.default.createElement("g",null,a.default.createElement("path",{d:"M12 4c4.41 0 8 3.59 8 8s-3.59 8-8 8-8-3.59-8-8 3.59-8 8-8m0-2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2zm1 13h-2v2h2v-2zm-2-2h2l.5-6h-3l.5 6z"})))};var r,i=n(5),a=(r=i)&&r.__esModule?r:{default:r};e.exports=t.default},65:function(e,t,n){"use strict";var o=n(22),r=n(25),i=(n(1),n(5)),a=n.n(i),c=n(29),s=n.n(c),l=!1,u=n(33),m=function(e){function t(t,n){var o;o=e.call(this,t,n)||this;var r,i=n&&!n.isMounting?t.enter:t.appear;return o.appearStatus=null,t.in?i?(r="exited",o.appearStatus="entering"):r="entered":r=t.unmountOnExit||t.mountOnEnter?"unmounted":"exited",o.state={status:r},o.nextCallback=null,o}Object(r.a)(t,e),t.getDerivedStateFromProps=function(e,t){return e.in&&"unmounted"===t.status?{status:"exited"}:null};var n=t.prototype;return n.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},n.componentDidUpdate=function(e){var t=null;if(e!==this.props){var n=this.state.status;this.props.in?"entering"!==n&&"entered"!==n&&(t="entering"):"entering"!==n&&"entered"!==n||(t="exiting")}this.updateStatus(!1,t)},n.componentWillUnmount=function(){this.cancelNextCallback()},n.getTimeouts=function(){var e,t,n,o=this.props.timeout;return e=t=n=o,null!=o&&"number"!=typeof o&&(e=o.exit,t=o.enter,n=void 0!==o.appear?o.appear:t),{exit:e,enter:t,appear:n}},n.updateStatus=function(e,t){void 0===e&&(e=!1),null!==t?(this.cancelNextCallback(),"entering"===t?this.performEnter(e):this.performExit()):this.props.unmountOnExit&&"exited"===this.state.status&&this.setState({status:"unmounted"})},n.performEnter=function(e){var t=this,n=this.props.enter,o=this.context?this.context.isMounting:e,r=this.props.nodeRef?[o]:[s.a.findDOMNode(this),o],i=r[0],a=r[1],c=this.getTimeouts(),u=o?c.appear:c.enter;!e&&!n||l?this.safeSetState({status:"entered"},(function(){t.props.onEntered(i)})):(this.props.onEnter(i,a),this.safeSetState({status:"entering"},(function(){t.props.onEntering(i,a),t.onTransitionEnd(u,(function(){t.safeSetState({status:"entered"},(function(){t.props.onEntered(i,a)}))}))})))},n.performExit=function(){var e=this,t=this.props.exit,n=this.getTimeouts(),o=this.props.nodeRef?void 0:s.a.findDOMNode(this);t&&!l?(this.props.onExit(o),this.safeSetState({status:"exiting"},(function(){e.props.onExiting(o),e.onTransitionEnd(n.exit,(function(){e.safeSetState({status:"exited"},(function(){e.props.onExited(o)}))}))}))):this.safeSetState({status:"exited"},(function(){e.props.onExited(o)}))},n.cancelNextCallback=function(){null!==this.nextCallback&&(this.nextCallback.cancel(),this.nextCallback=null)},n.safeSetState=function(e,t){t=this.setNextCallback(t),this.setState(e,t)},n.setNextCallback=function(e){var t=this,n=!0;return this.nextCallback=function(o){n&&(n=!1,t.nextCallback=null,e(o))},this.nextCallback.cancel=function(){n=!1},this.nextCallback},n.onTransitionEnd=function(e,t){this.setNextCallback(t);var n=this.props.nodeRef?this.props.nodeRef.current:s.a.findDOMNode(this),o=null==e&&!this.props.addEndListener;if(n&&!o){if(this.props.addEndListener){var r=this.props.nodeRef?[this.nextCallback]:[n,this.nextCallback],i=r[0],a=r[1];this.props.addEndListener(i,a)}null!=e&&setTimeout(this.nextCallback,e)}else setTimeout(this.nextCallback,0)},n.render=function(){var e=this.state.status;if("unmounted"===e)return null;var t=this.props,n=t.children,r=(t.in,t.mountOnEnter,t.unmountOnExit,t.appear,t.enter,t.exit,t.timeout,t.addEndListener,t.onEnter,t.onEntering,t.onEntered,t.onExit,t.onExiting,t.onExited,t.nodeRef,Object(o.a)(t,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]));return a.a.createElement(u.a.Provider,{value:null},"function"==typeof n?n(e,r):a.a.cloneElement(a.a.Children.only(n),r))},t}(a.a.Component);function p(){}m.contextType=u.a,m.propTypes={},m.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:p,onEntering:p,onEntered:p,onExit:p,onExiting:p,onExited:p},m.UNMOUNTED="unmounted",m.EXITED="exited",m.ENTERING="entering",m.ENTERED="entered",m.EXITING="exiting";t.a=m},8:function(e,t){e.exports=window.wp.primitives},9:function(e,t){e.exports=window.moment}});woocommerce-admin/dist/experimental/style-rtl.css000064400000032220151335517650016274 0ustar00:root{--wp-admin-theme-color:#007cba;--wp-admin-theme-color-darker-10:#006ba1;--wp-admin-theme-color-darker-20:#005a87}body.admin-color-light{--wp-admin-theme-color:#0085ba;--wp-admin-theme-color-darker-10:#0073a1;--wp-admin-theme-color-darker-20:#006187}body.admin-color-modern{--wp-admin-theme-color:#3858e9;--wp-admin-theme-color-darker-10:#2145e6;--wp-admin-theme-color-darker-20:#183ad6}body.admin-color-blue{--wp-admin-theme-color:#096484;--wp-admin-theme-color-darker-10:#07526c;--wp-admin-theme-color-darker-20:#064054}body.admin-color-coffee{--wp-admin-theme-color:#46403c;--wp-admin-theme-color-darker-10:#383330;--wp-admin-theme-color-darker-20:#2b2724}body.admin-color-ectoplasm{--wp-admin-theme-color:#523f6d;--wp-admin-theme-color-darker-10:#46365d;--wp-admin-theme-color-darker-20:#3a2c4d}body.admin-color-midnight{--wp-admin-theme-color:#e14d43;--wp-admin-theme-color-darker-10:#dd382d;--wp-admin-theme-color-darker-20:#d02c21}body.admin-color-ocean{--wp-admin-theme-color:#627c83;--wp-admin-theme-color-darker-10:#576e74;--wp-admin-theme-color-darker-20:#4c6066}body.admin-color-sunrise{--wp-admin-theme-color:#dd823b;--wp-admin-theme-color-darker-10:#d97426;--wp-admin-theme-color-darker-20:#c36922}.woocommerce-experimental-list{margin:0;padding:0}a.woocommerce-experimental-list__item{color:inherit}.woocommerce-experimental-list__item{display:flex;align-items:center;margin-bottom:0;text-decoration:none;background-color:#fff}.woocommerce-experimental-list__item.has-gutters{padding:16px 24px}.woocommerce-experimental-list__item.has-action:not(.expanded){cursor:pointer}.woocommerce-experimental-list__item:focus:not(.expanded){box-shadow:inset 0 0 0 1px #006088,inset 0 0 0 2px #fff}.woocommerce-experimental-list__item:focus-visible{box-shadow:none}.woocommerce-experimental-list__item:not(.transitions-disabled).woocommerce-list__item-enter{opacity:0;max-height:0;transform:translateX(-50%)}.woocommerce-experimental-list__item:not(.transitions-disabled).woocommerce-list__item-enter-active{opacity:1;max-height:100vh;transform:translateX(0);transition:opacity .5s,transform .5s,max-height .5s}.woocommerce-experimental-list__item:not(.transitions-disabled).woocommerce-list__item-exit{opacity:1;max-height:100vh;transform:translateX(0)}.woocommerce-experimental-list__item:not(.transitions-disabled).woocommerce-list__item-exit-active{opacity:0;max-height:0;transform:translateX(-50%);transition:opacity .5s,transform .5s,max-height .5s}.woocommerce-experimental-list__item>.woocommerce-list__item-inner{text-decoration:none;width:100%;display:flex;align-items:center;padding:16px 24px}.woocommerce-experimental-list__item>.woocommerce-list__item-inner:focus{box-shadow:inset 0 0 0 1px #006088,inset 0 0 0 2px #fff}.woocommerce-experimental-list__item .woocommerce-list__item-title{color:#1d2327}.woocommerce-experimental-list__item .woocommerce-list__item-expandable-content{margin-top:4px;display:block;font-size:14px;line-height:20px;color:#50575d}.woocommerce-experimental-list__item .woocommerce-list__item-before{margin-left:20px;display:flex;align-items:center}.woocommerce-experimental-list__item .woocommerce-list__item-after{display:flex;align-items:center;margin-right:auto}.woocommerce-experimental-list__item:not(:first-child){border-top:1px solid #f0f0f0}.woocommerce-experimental-list__item:hover{background-color:#f0f0f0}.woocommerce-experimental-list__item:hover .woocommerce-list__item-title{color:#007cba;color:var(--wp-admin-theme-color)}.woocommerce-experimental-list__item:hover .woocommerce-list__item-before>svg{fill:#007cba;fill:var(--wp-admin-theme-color)}.woocommerce-experimental-list__item .woocommerce-list__item-title{color:#007cba;color:var(--wp-admin-theme-color)}.woocommerce-experimental-list__item .woocommerce-list__item-before>svg{fill:#007cba;fill:var(--wp-admin-theme-color)}.woocommerce-experimental-list__item .woocommerce-list__item-after>svg{fill:#1e1e1e}.woocommerce-experimental-list__item.is-complete .woocommerce-task__icon{background-color:#007cba;background-color:var(--wp-admin-theme-color)}.woocommerce-experimental-list__item.is-complete .woocommerce-list__item-title{color:#757575}.woocommerce-experimental-list__item.is-complete .woocommerce-list__item-expandable-content{display:none}.woocommerce-experimental-list__item-title{color:#2c3338}.woocommerce-experimental-list__item-expandable-content{color:#646970}.woocommerce-experimental-list__item.list-item-collapse{overflow:hidden;display:grid;grid-template-columns:auto 48px}.woocommerce-experimental-list__item.list-item-collapse>*{align-self:center}.woocommerce-experimental-list__item.list-item-collapse p{margin:0;padding:16px 24px}.woocommerce-experimental-list__item.list-item-collapse .list-item-collapse__icon-container{justify-content:flex-end}.woocommerce-experimental-list__item.list-item-collapse.woocommerce-list__item-enter{max-height:0;opacity:1}.woocommerce-experimental-list__item.list-item-collapse.woocommerce-list__item-enter-active{max-height:55px;transition:max-height .5s}.woocommerce-experimental-list__item.list-item-collapse.woocommerce-list__item-exit{max-height:55px}.woocommerce-experimental-list__item.list-item-collapse.woocommerce-list__item-exit-active{max-height:0;opacity:1;transition:max-height .5s}.woocommerce-experimental-list-wrapper{border-top:1px solid #f0f0f0}.woocommerce-task-list__item{position:relative;display:grid;grid-template-columns:72px auto 48px}.woocommerce-task-list__item>*{align-self:center}.woocommerce-task-list__item:before{content:"";position:absolute;top:0;right:0;width:4px;height:100%;background:transparent}.woocommerce-task-list__item.level-1:before{background-color:#d94f4f}.woocommerce-task-list__item.level-1 .gridicons-notice-outline{fill:#d94f4f}.woocommerce-task-list__item.level-2:before{background-color:#f0b849}.woocommerce-task-list__item .woocommerce-task-list__item-title{color:#007cba;color:var(--wp-admin-theme-color)}.woocommerce-task-list__item .woocommerce-task-list__item-expandable-content,.woocommerce-task-list__item .woocommerce-task__additional-info,.woocommerce-task-list__item .woocommerce-task__estimated-time{color:#757575;font-weight:400;font-size:12px}.woocommerce-task-list__item .woocommerce-task__estimated-time{margin-top:4px}.woocommerce-task-list__item .woocommerce-task-list__item-before{display:flex;align-items:center;padding:16px 24px 16px 0}.woocommerce-task-list__item .woocommerce-task-list__item-text{padding:16px 0}.woocommerce-task-list__item .woocommerce-task-list__item-text .woocommerce-pill{padding:1px 8px;margin-right:8px}.woocommerce-task-list__item .woocommerce-task-list__item-expandable-content{margin-top:4px;overflow:hidden}.woocommerce-task-list__item .woocommerce-task-list__item-expandable-content.woocommerce-task-list__item-expandable-content-enter{opacity:0}.woocommerce-task-list__item .woocommerce-task-list__item-expandable-content.woocommerce-task-list__item-expandable-content-enter-active,.woocommerce-task-list__item .woocommerce-task-list__item-expandable-content.woocommerce-task-list__item-expandable-content-enter-done,.woocommerce-task-list__item .woocommerce-task-list__item-expandable-content.woocommerce-task-list__item-expandable-content-exit{opacity:1}.woocommerce-task-list__item .woocommerce-task-list__item-expandable-content.woocommerce-task-list__item-expandable-content-exit-active{opacity:0}.woocommerce-task-list__item .woocommerce-task-list__item-expandable-content .woocommerce-task__additional-info{margin-top:8px}.woocommerce-task-list__item .woocommerce-task-list__item-action{margin-top:8px;margin-bottom:4px;display:block}.woocommerce-task-list__item .woocommerce-task-list__item-after{display:flex;align-items:center}.woocommerce-task-list__item .woocommerce-task-list__item-before .woocommerce-task__icon{border-radius:50%;width:32px;height:32px}.woocommerce-task-list__item .woocommerce-task-list__item-before .woocommerce-task__icon svg{fill:#fff;position:relative;top:4px;right:5px}.woocommerce-task-list__item.complete .woocommerce-task__icon{background-color:#007cba;background-color:var(--wp-admin-theme-color)}.woocommerce-task-list__item.complete .woocommerce-task-list__item-title{color:#757575}.woocommerce-task-list__item.complete .woocommerce-task-list__item-expandable-content,.woocommerce-task-list__item.complete .woocommerce-task__estimated-time{display:none}.woocommerce-task-list__item:not(.complete) .woocommerce-task__icon{border:1px solid #f0f0f0;background:#fff}.woocommerce-task-list__item .components-tooltip .components-popover__content{width:160px;white-space:normal}.woocommerce-task-list__item .woocommerce-task-card__section-controls{text-align:right}.woocommerce-inbox-message{position:relative;color:#757575;background:#fff;border-radius:2px;font-size:13px;font-size:.8125rem;margin:0 0 24px;-ms-box-orient:horizontal}.woocommerce-inbox-message.banner{flex-direction:column}.woocommerce-inbox-message.banner img{width:100%}.woocommerce-inbox-message.thumbnail{display:flex;flex-direction:row-reverse}.woocommerce-inbox-message.thumbnail img{width:128px;height:100%}.woocommerce-homepage-column .woocommerce-inbox-message{margin:20px 0}.woocommerce-inbox-message:not(.is-placeholder){border:1px solid #e0e0e0}.woocommerce-inbox-message .line{width:100%}.woocommerce-inbox-message .third-line{width:33%}.woocommerce-inbox-message .fifth-line{width:20%}.woocommerce-inbox-message .sixth-line{width:16%}.woocommerce-inbox-message__content .woocommerce-inbox-message__unread-indicator{height:8px;width:8px;background-color:#007cba;background-color:var(--wp-admin-theme-color);border-radius:100px;display:inline-block;margin-left:8px}.woocommerce-inbox-message__content .woocommerce-inbox-message__title{color:#1e1e1e;font-size:16px;font-size:1rem;font-style:normal;line-height:1.5;font-weight:700;margin:8px 0}.is-placeholder .woocommerce-inbox-message__content .woocommerce-inbox-message__title{margin-bottom:10px}.is-placeholder .woocommerce-inbox-message__content .woocommerce-inbox-message__title>div{animation:loading-fade 1.6s ease-in-out infinite;background-color:#f0f0f0;color:transparent;margin:5px 0}.is-placeholder .woocommerce-inbox-message__content .woocommerce-inbox-message__title>div:after{content:" "}@media screen and (prefers-reduced-motion:reduce){.is-placeholder .woocommerce-inbox-message__content .woocommerce-inbox-message__title>div{animation:none}}.woocommerce-inbox-message__content .woocommerce-inbox-message__date{color:#757575;font-size:12px;font-size:.75rem;margin-bottom:16px;font-style:normal;font-weight:400;line-height:16px}.is-placeholder .woocommerce-inbox-message__content .woocommerce-inbox-message__date{margin-bottom:10px}.is-placeholder .woocommerce-inbox-message__content .woocommerce-inbox-message__date>div{animation:loading-fade 1.6s ease-in-out infinite;background-color:#f0f0f0;color:transparent}.is-placeholder .woocommerce-inbox-message__content .woocommerce-inbox-message__date>div:after{content:" "}@media screen and (prefers-reduced-motion:reduce){.is-placeholder .woocommerce-inbox-message__content .woocommerce-inbox-message__date>div{animation:none}}.woocommerce-inbox-message__text{color:#757575;font-style:normal;font-weight:400;font-size:14px;font-size:.875rem;line-height:20px}.woocommerce-inbox-message__text>p:first-child{margin-top:0}.woocommerce-inbox-message__text>p:last-child{margin-bottom:0}.is-placeholder .woocommerce-inbox-message__text>div{animation:loading-fade 1.6s ease-in-out infinite;background-color:#f0f0f0;color:transparent;margin:5px 0}.is-placeholder .woocommerce-inbox-message__text>div:after{content:" "}@media screen and (prefers-reduced-motion:reduce){.is-placeholder .woocommerce-inbox-message__text>div{animation:none}}.woocommerce-inbox-message__actions{padding-top:16px;border-top:1px solid #e0e0e0}.woocommerce-inbox-message__actions>*+*{margin-right:.5em}.woocommerce-inbox-message__actions a,.woocommerce-inbox-message__actions button{cursor:pointer}.woocommerce-inbox-message__actions .components-dropdown{display:inline}.woocommerce-inbox-message__actions .components-dropdown .components-popover__content{min-width:195px}.woocommerce-inbox-message__actions .components-dropdown .components-popover__content ul{text-align:center}.woocommerce-inbox-message__actions .components-dropdown .components-popover__content li{margin:0;cursor:pointer}.is-placeholder .woocommerce-inbox-message__actions>div{animation:loading-fade 1.6s ease-in-out infinite;background-color:#f0f0f0;color:transparent;float:right;height:28px;margin-left:8px}.is-placeholder .woocommerce-inbox-message__actions>div:after{content:" "}@media screen and (prefers-reduced-motion:reduce){.is-placeholder .woocommerce-inbox-message__actions>div{animation:none}}.woocommerce-inbox-dismiss-confirmation_modal{text-align:right}.woocommerce-inbox-dismiss-confirmation_wrapper p{font-size:16px;color:#757575}.woocommerce-inbox-dismiss-confirmation_wrapper .woocommerce-inbox-dismiss-confirmation_buttons{text-align:left}.woocommerce-inbox-dismiss-confirmation_wrapper .woocommerce-inbox-dismiss-confirmation_buttons button{margin-right:10px}.woocommerce-inbox-message__wrapper>div{padding:16px 24px}.is-placeholder .woocommerce-inbox-message__wrapper>div{padding:10px 24px;display:flow-root}@media (-ms-high-contrast:active),(-ms-high-contrast:none){.woocommerce-admin-dismiss-dropdown{margin-top:0}.is-placeholder .woocommerce-inbox-message__wrapper{padding-bottom:10px}}woocommerce-admin/dist/experimental/index.asset.php000064400000000330151335517650016556 0ustar00<?php return array('dependencies' => array('moment', 'react', 'react-dom', 'wc-components', 'wp-components', 'wp-element', 'wp-i18n', 'wp-keycodes', 'wp-primitives'), 'version' => 'e5c73094e2807e2142e427bb70f9b815');woocommerce-admin/dist/experimental/index.js.LICENSE.txt000064400000000463151335517650017173 0ustar00/*!
  Copyright (c) 2018 Jed Watson.
  Licensed under the MIT License (MIT), see
  http://jedwatson.github.io/classnames
*/

/*! @license DOMPurify | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/2.2.2/LICENSE */
woocommerce-admin/dist/beta-features-tracking-modal/style-rtl.css000064400000002672151335517650021230 0ustar00:root{--wp-admin-theme-color:#007cba;--wp-admin-theme-color-darker-10:#006ba1;--wp-admin-theme-color-darker-20:#005a87}body.admin-color-light{--wp-admin-theme-color:#0085ba;--wp-admin-theme-color-darker-10:#0073a1;--wp-admin-theme-color-darker-20:#006187}body.admin-color-modern{--wp-admin-theme-color:#3858e9;--wp-admin-theme-color-darker-10:#2145e6;--wp-admin-theme-color-darker-20:#183ad6}body.admin-color-blue{--wp-admin-theme-color:#096484;--wp-admin-theme-color-darker-10:#07526c;--wp-admin-theme-color-darker-20:#064054}body.admin-color-coffee{--wp-admin-theme-color:#46403c;--wp-admin-theme-color-darker-10:#383330;--wp-admin-theme-color-darker-20:#2b2724}body.admin-color-ectoplasm{--wp-admin-theme-color:#523f6d;--wp-admin-theme-color-darker-10:#46365d;--wp-admin-theme-color-darker-20:#3a2c4d}body.admin-color-midnight{--wp-admin-theme-color:#e14d43;--wp-admin-theme-color-darker-10:#dd382d;--wp-admin-theme-color-darker-20:#d02c21}body.admin-color-ocean{--wp-admin-theme-color:#627c83;--wp-admin-theme-color-darker-10:#576e74;--wp-admin-theme-color-darker-20:#4c6066}body.admin-color-sunrise{--wp-admin-theme-color:#dd823b;--wp-admin-theme-color-darker-10:#d97426;--wp-admin-theme-color-darker-20:#c36922}.woocommerce-beta-features-tracking-modal__actions{text-align:left;margin-top:24px}.woocommerce-beta-features-tracking-modal__actions .components-button.is-primary{margin-right:16px}.woocommerce-beta-features-tracking-modal__checkbox{padding:16px 0}woocommerce-admin/dist/beta-features-tracking-modal/style.css000064400000002672151335517650020431 0ustar00:root{--wp-admin-theme-color:#007cba;--wp-admin-theme-color-darker-10:#006ba1;--wp-admin-theme-color-darker-20:#005a87}body.admin-color-light{--wp-admin-theme-color:#0085ba;--wp-admin-theme-color-darker-10:#0073a1;--wp-admin-theme-color-darker-20:#006187}body.admin-color-modern{--wp-admin-theme-color:#3858e9;--wp-admin-theme-color-darker-10:#2145e6;--wp-admin-theme-color-darker-20:#183ad6}body.admin-color-blue{--wp-admin-theme-color:#096484;--wp-admin-theme-color-darker-10:#07526c;--wp-admin-theme-color-darker-20:#064054}body.admin-color-coffee{--wp-admin-theme-color:#46403c;--wp-admin-theme-color-darker-10:#383330;--wp-admin-theme-color-darker-20:#2b2724}body.admin-color-ectoplasm{--wp-admin-theme-color:#523f6d;--wp-admin-theme-color-darker-10:#46365d;--wp-admin-theme-color-darker-20:#3a2c4d}body.admin-color-midnight{--wp-admin-theme-color:#e14d43;--wp-admin-theme-color-darker-10:#dd382d;--wp-admin-theme-color-darker-20:#d02c21}body.admin-color-ocean{--wp-admin-theme-color:#627c83;--wp-admin-theme-color-darker-10:#576e74;--wp-admin-theme-color-darker-20:#4c6066}body.admin-color-sunrise{--wp-admin-theme-color:#dd823b;--wp-admin-theme-color-darker-10:#d97426;--wp-admin-theme-color-darker-20:#c36922}.woocommerce-beta-features-tracking-modal__actions{text-align:right;margin-top:24px}.woocommerce-beta-features-tracking-modal__actions .components-button.is-primary{margin-left:16px}.woocommerce-beta-features-tracking-modal__checkbox{padding:16px 0}woocommerce-admin/dist/undefined/style-rtl.css000064400000004374151335517650015551 0ustar00:root{--wp-admin-theme-color:#007cba;--wp-admin-theme-color-darker-10:#006ba1;--wp-admin-theme-color-darker-20:#005a87}body.admin-color-light{--wp-admin-theme-color:#0085ba;--wp-admin-theme-color-darker-10:#0073a1;--wp-admin-theme-color-darker-20:#006187}body.admin-color-modern{--wp-admin-theme-color:#3858e9;--wp-admin-theme-color-darker-10:#2145e6;--wp-admin-theme-color-darker-20:#183ad6}body.admin-color-blue{--wp-admin-theme-color:#096484;--wp-admin-theme-color-darker-10:#07526c;--wp-admin-theme-color-darker-20:#064054}body.admin-color-coffee{--wp-admin-theme-color:#46403c;--wp-admin-theme-color-darker-10:#383330;--wp-admin-theme-color-darker-20:#2b2724}body.admin-color-ectoplasm{--wp-admin-theme-color:#523f6d;--wp-admin-theme-color-darker-10:#46365d;--wp-admin-theme-color-darker-20:#3a2c4d}body.admin-color-midnight{--wp-admin-theme-color:#e14d43;--wp-admin-theme-color-darker-10:#dd382d;--wp-admin-theme-color-darker-20:#d02c21}body.admin-color-ocean{--wp-admin-theme-color:#627c83;--wp-admin-theme-color-darker-10:#576e74;--wp-admin-theme-color-darker-20:#4c6066}body.admin-color-sunrise{--wp-admin-theme-color:#dd823b;--wp-admin-theme-color-darker-10:#d97426;--wp-admin-theme-color-darker-20:#c36922}.woocommerce-report-table__scroll-point{position:relative;top:-48px}@media(max-width:782px){.woocommerce-report-table__scroll-point{top:-62px}}.woocommerce-feature-enabled-activity-panels .woocommerce-report-table__scroll-point{top:-108px}@media(max-width:782px){.woocommerce-feature-enabled-activity-panels .woocommerce-report-table__scroll-point{top:-122px}}.woocommerce-report-table .woocommerce-search{flex-grow:1}.woocommerce-report-table .components-card__header{display:grid;grid-gap:12px;grid-template-columns:min-content 1fr min-content}.woocommerce-report-table .woocommerce-table__compare.components-button{padding:8px}.woocommerce-report-table .woocommerce-ellipsis-menu{justify-self:flex-end}button.woocommerce-table__download-button{padding:6px 12px;color:#000;text-decoration:none;align-items:center}button.woocommerce-table__download-button svg{margin-left:8px;height:24px;width:24px}@media(max-width:782px){button.woocommerce-table__download-button svg{margin-left:0}button.woocommerce-table__download-button .woocommerce-table__download-button__label{display:none}}woocommerce-admin/dist/csv-export/index.js000064400000012144151335517650014710 0ustar00/*! For license information please see index.js.LICENSE.txt */
this.wc=this.wc||{},this.wc.csvExport=function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=442)}({264:function(e,t,n){var r=r||function(e){"use strict";if("undefined"==typeof navigator||!/MSIE [1-9]\./.test(navigator.userAgent)){var t=e.document,n=function(){return e.URL||e.webkitURL||e},r=t.createElementNS("http://www.w3.org/1999/xhtml","a"),o="download"in r,i=/Version\/[\d\.]+.*Safari/.test(navigator.userAgent),a=e.webkitRequestFileSystem,c=e.requestFileSystem||a||e.mozRequestFileSystem,u=function(t){(e.setImmediate||e.setTimeout)((function(){throw t}),0)},f=0,l=function(e){setTimeout((function(){"string"==typeof e?n().revokeObjectURL(e):e.remove()}),4e4)},s=function(e,t,n){for(var r=(t=[].concat(t)).length;r--;){var o=e["on"+t[r]];if("function"==typeof o)try{o.call(e,n||e)}catch(e){u(e)}}},d=function(e){return/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(e.type)?new Blob(["\ufeff",e],{type:e.type}):e},p=function(t,u,p){p||(t=d(t));var y,v,w,m=this,b=t.type,g=!1,S=function(){s(m,"writestart progress write writeend".split(" "))},h=function(){if(v&&i&&"undefined"!=typeof FileReader){var r=new FileReader;return r.onloadend=function(){var e=r.result;v.location.href="data:attachment/file"+e.slice(e.search(/[,;]/)),m.readyState=m.DONE,S()},r.readAsDataURL(t),void(m.readyState=m.INIT)}(!g&&y||(y=n().createObjectURL(t)),v)?v.location.href=y:void 0===e.open(y,"_blank")&&i&&(e.location.href=y);m.readyState=m.DONE,S(),l(y)},O=function(e){return function(){if(m.readyState!==m.DONE)return e.apply(this,arguments)}},R={create:!0,exclusive:!1};if(m.readyState=m.INIT,u||(u="download"),o)return y=n().createObjectURL(t),void setTimeout((function(){var e,t;r.href=y,r.download=u,e=r,t=new MouseEvent("click"),e.dispatchEvent(t),S(),l(y),m.readyState=m.DONE}));e.chrome&&b&&"application/octet-stream"!==b&&(w=t.slice||t.webkitSlice,t=w.call(t,0,t.size,"application/octet-stream"),g=!0),a&&"download"!==u&&(u+=".download"),("application/octet-stream"===b||a)&&(v=e),c?(f+=t.size,c(e.TEMPORARY,f,O((function(e){e.root.getDirectory("saved",R,O((function(e){var n=function(){e.getFile(u,R,O((function(e){e.createWriter(O((function(n){n.onwriteend=function(t){v.location.href=e.toURL(),m.readyState=m.DONE,s(m,"writeend",t),l(e)},n.onerror=function(){var e=n.error;e.code!==e.ABORT_ERR&&h()},"writestart progress write abort".split(" ").forEach((function(e){n["on"+e]=m["on"+e]})),n.write(t),m.abort=function(){n.abort(),m.readyState=m.DONE},m.readyState=m.WRITING})),h)})),h)};e.getFile(u,{create:!1},O((function(e){e.remove(),n()})),O((function(e){e.code===e.NOT_FOUND_ERR?n():h()})))})),h)})),h)):h()},y=p.prototype;return"undefined"!=typeof navigator&&navigator.msSaveOrOpenBlob?function(e,t,n){return n||(e=d(e)),navigator.msSaveOrOpenBlob(e,t||"download")}:(y.abort=function(){this.readyState=this.DONE,s(this,"abort")},y.readyState=y.INIT=0,y.WRITING=1,y.DONE=2,y.error=y.onwritestart=y.onprogress=y.onwrite=y.onabort=y.onerror=y.onwriteend=null,function(e,t,n){return new p(e,t,n)})}}("undefined"!=typeof self&&self||"undefined"!=typeof window&&window||this.content);e.exports?e.exports.saveAs=r:"undefined"!=typeof define&&null!==define&&null!==define.amd&&define([],(function(){return r}))},442:function(e,t,n){"use strict";n.r(t),n.d(t,"generateCSVDataFromTable",(function(){return f})),n.d(t,"generateCSVFileName",(function(){return l})),n.d(t,"downloadCSVFile",(function(){return s}));var r=n(9),o=n.n(r),i=n(264);function a(e){let t=e.toString();return["=","+","-","@"].includes(t.charAt(0))?t='"\t'+t+'"':t.match(/[,"\s]/)&&(t='"'+t.replace(/"/g,'""')+'"'),t}function c(e){return Array.isArray(e)?e.map(e=>a(e.label)).join(","):[]}function u(e){return Array.isArray(e)?e.map(e=>e.map(e=>void 0===e.value||null===e.value?"":a(e.value)).join(",")).join("\n"):[]}function f(e,t){return[c(e),u(t)].filter(e=>e.length).join("\n")}function l(e="",t={}){return[e.toLowerCase().replace(/[^a-z0-9]/g,"-"),o()().format("YYYY-MM-DD"),Object.keys(t).map(e=>e.toLowerCase().replace(/[^a-z0-9]/g,"-")+"-"+decodeURIComponent(t[e]).toLowerCase().replace(/[^a-z0-9]/g,"-")).join("_")].filter(e=>e.length).join("_")+".csv"}function s(e,t){const n=new Blob([t],{type:"text/csv;charset=utf-8"});Object(i.saveAs)(n,e)}},9:function(e,t){e.exports=window.moment}});woocommerce-admin/dist/csv-export/index.js.LICENSE.txt000064400000000124151335517650016602 0ustar00/*! @source http://purl.eligrey.com/github/FileSaver.js/blob/master/FileSaver.js */
woocommerce-admin/dist/csv-export/index.asset.php000064400000000147151335517650016201 0ustar00<?php return array('dependencies' => array('moment'), 'version' => 'bd0b23a4f51d92c50497fca0fc123bce');woocommerce-admin/dist/marketing-overview/style-rtl.css000064400000027006151335517650017432 0ustar00.woocommerce-marketing-overview{max-width:1032px;margin:0 auto}.woocommerce-marketing-overview .components-card{margin-bottom:24px}.woocommerce-marketing-installed-extensions-card__item{display:flex;align-items:center;padding:18px 24px}.woocommerce-marketing-installed-extensions-card__item h4{font-weight:400;font-size:16px;margin:0 0 5px;color:#1e1e1e}.woocommerce-marketing-installed-extensions-card__item p{color:#757575;margin:0}.woocommerce-marketing-installed-extensions-card__item:not(:last-child){border-bottom:1px solid #e0e0e0}.woocommerce-marketing-installed-extensions-card__item-text-and-actions{display:flex;flex-wrap:wrap;align-items:center;flex-grow:2;min-width:0}@media(min-width:601px){.woocommerce-marketing-installed-extensions-card__item-text-and-actions{flex-wrap:nowrap}}@media(min-width:601px){.woocommerce-marketing-installed-extensions-card__item-actions{text-align:left;white-space:nowrap;padding-right:25px}}@media(min-width:961px){.woocommerce-marketing-installed-extensions-card__item-description{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:550px}}.woocommerce-marketing-installed-extensions-card__item-links{margin:0;padding:0}.woocommerce-marketing-installed-extensions-card__item-links li{display:inline-block;margin:0 0 0 25px}@media(min-width:601px){.woocommerce-marketing-installed-extensions-card__item-links li{margin:0 30px 0 0}}.woocommerce-marketing-installed-extensions-card__item-links a{font-weight:600;color:#007cba!important;color:var(--wp-admin-theme-color)!important;text-decoration:none;font-size:14px}.woocommerce-marketing-installed-extensions-card .woocommerce-admin-marketing-product-icon{align-self:flex-start;margin-left:14px;margin-top:2px}.woocommerce-marketing-installed-extensions-card__item-text{min-width:0;flex-grow:2;margin:0 0 10px;width:100%}@media(min-width:601px){.woocommerce-marketing-installed-extensions-card__item-text{margin:0;width:auto}}.components-button.woocommerce-admin-marketing-button:not([disabled]){border-color:#007cba!important;border-color:var(--wp-admin-theme-color)!important;color:#007cba!important;color:var(--wp-admin-theme-color)!important}.woocommerce-admin-marketing-card .components-card__header .woocommerce-admin-marketing-card-subtitle{font-weight:400;margin-top:4px;color:#757575}.woocommerce-admin-marketing-product-icon{position:relative;overflow:hidden;width:36px;height:36px;border-radius:8px;background:#f0f0f0;color:#f0f0f0}.woocommerce-admin-marketing-product-icon svg{width:36px;height:36px}.woocommerce-marketing-slider,.woocommerce-marketing-slider>div{display:block;width:100%;overflow:hidden}.woocommerce-marketing-slider>div{white-space:normal;position:relative;height:100%}.woocommerce-marketing-slider__slide{top:0;right:0;width:100%;transition:transform .3s ease-in;position:relative}.woocommerce-marketing-slider .slide-enter,.woocommerce-marketing-slider .slide-exit{position:absolute}.woocommerce-marketing-slider.animate-right .slide-enter{transform:translateX(100%)}.woocommerce-marketing-slider.animate-right .slide-enter-active,.woocommerce-marketing-slider.animate-right .slide-exit{transform:translateX(0)}.woocommerce-marketing-slider.animate-left .slide-enter,.woocommerce-marketing-slider.animate-right .slide-exit-active{transform:translateX(-100%)}.woocommerce-marketing-slider.animate-left .slide-enter-active,.woocommerce-marketing-slider.animate-left .slide-exit{transform:translateX(0)}.woocommerce-marketing-slider.animate-left .slide-exit-active{transform:translateX(100%)}@media screen and (prefers-reduced-motion:reduce){.woocommerce-marketing-slider .slide-enter-active,.woocommerce-marketing-slider .slide-exit-active{transition:none!important}}.woocommerce-marketing-recommended-extensions-card .components-card__body{padding:12px}.woocommerce-marketing-recommended-extensions-card__items{display:flex;flex-wrap:wrap}@media(min-width:601px){.woocommerce-marketing-recommended-extensions-card__items>.is-loading.woocommerce-marketing-recommended-extensions-item,.woocommerce-marketing-recommended-extensions-card__items>a{width:50%}}@media(min-width:961px){.woocommerce-marketing-recommended-extensions-card__items>.is-loading.woocommerce-marketing-recommended-extensions-item,.woocommerce-marketing-recommended-extensions-card__items>a{width:33.3%}.woocommerce-marketing-recommended-extensions-card__items--count-1>.is-loading.woocommerce-marketing-recommended-extensions-item,.woocommerce-marketing-recommended-extensions-card__items--count-1>a{width:100%}.woocommerce-marketing-recommended-extensions-card__items--count-2>.is-loading.woocommerce-marketing-recommended-extensions-item,.woocommerce-marketing-recommended-extensions-card__items--count-2>a{width:50%}.woocommerce-marketing-recommended-extensions-card__items--count-4>.is-loading.woocommerce-marketing-recommended-extensions-item,.woocommerce-marketing-recommended-extensions-card__items--count-4>a{width:25%}}.woocommerce-marketing-recommended-extensions-item{display:block;padding:12px;text-decoration:none;position:relative}.woocommerce-marketing-recommended-extensions-item h4{color:#1e1e1e;margin:-2px 0 3px;font-size:16px;line-height:1.3;transition:color .2s ease}.woocommerce-marketing-recommended-extensions-item p{color:#757575;margin:0}.woocommerce-marketing-recommended-extensions-item:hover h4{color:#007cba;color:var(--wp-admin-theme-color)}.woocommerce-marketing-recommended-extensions-item:hover p{color:#1e1e1e}.woocommerce-marketing-recommended-extensions-item__text{padding-right:46px}.woocommerce-marketing-recommended-extensions-item .woocommerce-admin-marketing-product-icon{position:absolute;top:12px;right:12px}.woocommerce-marketing-recommended-extensions-item.is-loading .is-placeholder{animation:loading-fade 1.6s ease-in-out infinite;background-color:#f0f0f0;color:transparent;display:inline-block;min-height:16px}.woocommerce-marketing-recommended-extensions-item.is-loading .is-placeholder:after{content:" "}@media screen and (prefers-reduced-motion:reduce){.woocommerce-marketing-recommended-extensions-item.is-loading .is-placeholder{animation:none}}.woocommerce-marketing-recommended-extensions-item.is-loading h4{width:80%}.woocommerce-marketing-recommended-extensions-item.is-loading p :last-child{width:60%}.woocommerce-marketing-knowledgebase-card .woocommerce-marketing-slider{margin:0 0 14px}.woocommerce-marketing-knowledgebase-card .woocommerce-pagination{justify-content:flex-start;flex-direction:row}.woocommerce-marketing-knowledgebase-card__page{width:100%;display:flex}@media(max-width:960px){.woocommerce-marketing-knowledgebase-card__page{display:block}}.woocommerce-marketing-knowledgebase-card__post{display:flex;flex-wrap:wrap;width:100%;text-decoration:none}.woocommerce-marketing-knowledgebase-card__post:not(:last-child){margin-bottom:16px}@media(min-width:961px){.woocommerce-marketing-knowledgebase-card__post{flex-wrap:nowrap;width:50%}.woocommerce-marketing-knowledgebase-card__post:not(:last-child){margin-bottom:0;padding-left:16px}}.woocommerce-marketing-knowledgebase-card__post-img{width:100%;padding-bottom:52%;overflow:hidden;position:relative;flex:none;border-radius:3px}@media(min-width:961px){.woocommerce-marketing-knowledgebase-card__post-img{width:144px;height:103px;margin-left:16px;padding-bottom:0}}.woocommerce-marketing-knowledgebase-card__post-img img{position:absolute;top:0;left:0;display:block;width:100%}@media(min-width:961px){.woocommerce-marketing-knowledgebase-card__post-img img{position:absolute;top:0;left:0;height:100%;width:auto}}.woocommerce-marketing-knowledgebase-card__post-text{margin:10px 0 0;flex:1}@media(min-width:961px){.woocommerce-marketing-knowledgebase-card__post-text{margin:0}}.woocommerce-marketing-knowledgebase-card__post h3{margin-top:0;margin-bottom:6px;font-size:16px;line-height:24px;font-weight:600;white-space:normal;color:#1e1e1e;transition:color .2s ease}.woocommerce-marketing-knowledgebase-card__post:hover h3{color:#007cba;color:var(--wp-admin-theme-color)}.woocommerce-marketing-knowledgebase-card__post-meta{display:flex;justify-content:flex-start;align-items:center;font-size:12px;line-height:17px;color:#757575;margin:0;padding:0;height:17px}.woocommerce-marketing-knowledgebase-card__post-meta .woocommerce-gravatar{margin:1px 5px 0 0}.woocommerce-marketing-knowledgebase-card__post.is-loading .is-placeholder{animation:loading-fade 1.6s ease-in-out infinite;background-color:#f0f0f0;color:transparent}.woocommerce-marketing-knowledgebase-card__post.is-loading .is-placeholder:after{content:" "}@media screen and (prefers-reduced-motion:reduce){.woocommerce-marketing-knowledgebase-card__post.is-loading .is-placeholder{animation:none}}.woocommerce-marketing-knowledgebase-card__post.is-loading p{width:40%}:root{--wp-admin-theme-color:#007cba;--wp-admin-theme-color-darker-10:#006ba1;--wp-admin-theme-color-darker-20:#005a87}body.admin-color-light{--wp-admin-theme-color:#0085ba;--wp-admin-theme-color-darker-10:#0073a1;--wp-admin-theme-color-darker-20:#006187}body.admin-color-modern{--wp-admin-theme-color:#3858e9;--wp-admin-theme-color-darker-10:#2145e6;--wp-admin-theme-color-darker-20:#183ad6}body.admin-color-blue{--wp-admin-theme-color:#096484;--wp-admin-theme-color-darker-10:#07526c;--wp-admin-theme-color-darker-20:#064054}body.admin-color-coffee{--wp-admin-theme-color:#46403c;--wp-admin-theme-color-darker-10:#383330;--wp-admin-theme-color-darker-20:#2b2724}body.admin-color-ectoplasm{--wp-admin-theme-color:#523f6d;--wp-admin-theme-color-darker-10:#46365d;--wp-admin-theme-color-darker-20:#3a2c4d}body.admin-color-midnight{--wp-admin-theme-color:#e14d43;--wp-admin-theme-color-darker-10:#dd382d;--wp-admin-theme-color-darker-20:#d02c21}body.admin-color-ocean{--wp-admin-theme-color:#627c83;--wp-admin-theme-color-darker-10:#576e74;--wp-admin-theme-color-darker-20:#4c6066}body.admin-color-sunrise{--wp-admin-theme-color:#dd823b;--wp-admin-theme-color-darker-10:#d97426;--wp-admin-theme-color-darker-20:#c36922}.woocommerce-marketing-overview-welcome-card{position:relative}.woocommerce-marketing-overview-welcome-card .components-card__body{display:flex;justify-content:center;align-items:center;flex-wrap:wrap;padding:22px}@media(min-width:601px){.woocommerce-marketing-overview-welcome-card .components-card__body{flex-wrap:nowrap}}@media(min-width:961px){.woocommerce-marketing-overview-welcome-card .components-card__body{padding:32px 108px}}.woocommerce-marketing-overview-welcome-card__hide-button{display:flex;align-items:center;padding:8px;margin:0;border:none;background:none;color:#757575;overflow:hidden;border-radius:4px;position:absolute;top:10px;left:10px}.woocommerce-marketing-overview-welcome-card__hide-button svg{fill:currentColor;outline:none}.woocommerce-marketing-overview-welcome-card__hide-button:not(:disabled):not([aria-disabled=true]):not(.is-default):hover{background-color:#fff;color:#1e1e1e;box-shadow:inset 0 0 0 1px #ccc,inset 0 0 0 2px #fff,0 1px 1px rgba(30,30,30,.2)}.woocommerce-marketing-overview-welcome-card__hide-button:not(:disabled):not([aria-disabled=true]):not(.is-default):active{outline:none;background-color:#fff;color:#1e1e1e;box-shadow:inset 0 0 0 1px #ccc,inset 0 0 0 2px #fff}.woocommerce-marketing-overview-welcome-card__hide-button:disabled:focus,.woocommerce-marketing-overview-welcome-card__hide-button[aria-disabled=true]:focus{box-shadow:none}.woocommerce-marketing-overview-welcome-card h3{font-size:20px;line-height:26px;font-weight:400;text-align:center;margin:1em 0 0}@media(min-width:601px){.woocommerce-marketing-overview-welcome-card h3{text-align:right;margin:0 20px 0 0}}@media(min-width:961px){.woocommerce-marketing-overview-welcome-card h3{font-size:24px;line-height:32px}}.woocommerce-marketing-overview-welcome-card img{width:231px;flex:none}woocommerce-admin/dist/dashboard/style-rtl.css000064400000014602151335517650015532 0ustar00:root{--wp-admin-theme-color:#007cba;--wp-admin-theme-color-darker-10:#006ba1;--wp-admin-theme-color-darker-20:#005a87}body.admin-color-light{--wp-admin-theme-color:#0085ba;--wp-admin-theme-color-darker-10:#0073a1;--wp-admin-theme-color-darker-20:#006187}body.admin-color-modern{--wp-admin-theme-color:#3858e9;--wp-admin-theme-color-darker-10:#2145e6;--wp-admin-theme-color-darker-20:#183ad6}body.admin-color-blue{--wp-admin-theme-color:#096484;--wp-admin-theme-color-darker-10:#07526c;--wp-admin-theme-color-darker-20:#064054}body.admin-color-coffee{--wp-admin-theme-color:#46403c;--wp-admin-theme-color-darker-10:#383330;--wp-admin-theme-color-darker-20:#2b2724}body.admin-color-ectoplasm{--wp-admin-theme-color:#523f6d;--wp-admin-theme-color-darker-10:#46365d;--wp-admin-theme-color-darker-20:#3a2c4d}body.admin-color-midnight{--wp-admin-theme-color:#e14d43;--wp-admin-theme-color-darker-10:#dd382d;--wp-admin-theme-color-darker-20:#d02c21}body.admin-color-ocean{--wp-admin-theme-color:#627c83;--wp-admin-theme-color-darker-10:#576e74;--wp-admin-theme-color-darker-20:#4c6066}body.admin-color-sunrise{--wp-admin-theme-color:#dd823b;--wp-admin-theme-color-darker-10:#d97426;--wp-admin-theme-color-darker-20:#c36922}#klarna-kp-banner,.woocommerce-page:not(.woocommerce-embed-page) #klarna-banner{display:none}.woocommerce-dashboard__columns{display:grid;grid-template-columns:calc(50% - 12px) calc(50% - 12px);grid-column-gap:24px}.woocommerce-dashboard__columns>div:first-child{grid-column-start:1;grid-column-end:2;grid-row-start:1;grid-row-end:2}.woocommerce-dashboard__columns>div:nth-child(2){grid-column-start:2;grid-column-end:3;grid-row-start:1;grid-row-end:2}.woocommerce-dashboard__columns>div:nth-child(3){grid-column-start:1;grid-column-end:2;grid-row-start:2;grid-row-end:3}.woocommerce-dashboard__columns>div:nth-child(4){grid-column-start:2;grid-column-end:3;grid-row-start:2;grid-row-end:3}.woocommerce-dashboard__columns>div:nth-child(5){grid-column-start:1;grid-column-end:2;grid-row-start:3;grid-row-end:4}.woocommerce-dashboard__columns>div:nth-child(6){grid-column-start:2;grid-column-end:3;grid-row-start:3;grid-row-end:4}.woocommerce-dashboard__columns>div:nth-child(7){grid-column-start:1;grid-column-end:2;grid-row-start:4;grid-row-end:5}.woocommerce-dashboard__columns>div:nth-child(8){grid-column-start:2;grid-column-end:3;grid-row-start:4;grid-row-end:5}.woocommerce-dashboard__columns>div:nth-child(9){grid-column-start:1;grid-column-end:2;grid-row-start:5;grid-row-end:6}.woocommerce-dashboard__columns>div:nth-child(10){grid-column-start:2;grid-column-end:3;grid-row-start:5;grid-row-end:6}.woocommerce-dashboard__columns>div:nth-child(11){grid-column-start:1;grid-column-end:2;grid-row-start:6;grid-row-end:7}.woocommerce-dashboard__columns>div:nth-child(12){grid-column-start:2;grid-column-end:3;grid-row-start:6;grid-row-end:7}.woocommerce-dashboard__columns>div:nth-child(13){grid-column-start:1;grid-column-end:2;grid-row-start:7;grid-row-end:8}.woocommerce-dashboard__columns>div:nth-child(14){grid-column-start:2;grid-column-end:3;grid-row-start:7;grid-row-end:8}@media(max-width:960px){.woocommerce-dashboard__columns{grid-template-columns:100%}.woocommerce-dashboard__columns>div:first-child{grid-column-start:1;grid-column-end:2;grid-row-start:1;grid-row-end:2}.woocommerce-dashboard__columns>div:nth-child(2){grid-column-start:1;grid-column-end:2;grid-row-start:2;grid-row-end:3}.woocommerce-dashboard__columns>div:nth-child(3){grid-column-start:1;grid-column-end:2;grid-row-start:3;grid-row-end:4}.woocommerce-dashboard__columns>div:nth-child(4){grid-column-start:1;grid-column-end:2;grid-row-start:4;grid-row-end:5}.woocommerce-dashboard__columns>div:nth-child(5){grid-column-start:1;grid-column-end:2;grid-row-start:5;grid-row-end:6}.woocommerce-dashboard__columns>div:nth-child(6){grid-column-start:1;grid-column-end:2;grid-row-start:6;grid-row-end:7}.woocommerce-dashboard__columns>div:nth-child(7){grid-column-start:1;grid-column-end:2;grid-row-start:7;grid-row-end:8}.woocommerce-dashboard__columns>div:nth-child(8){grid-column-start:1;grid-column-end:2;grid-row-start:8;grid-row-end:9}.woocommerce-dashboard__columns>div:nth-child(9){grid-column-start:1;grid-column-end:2;grid-row-start:9;grid-row-end:10}.woocommerce-dashboard__columns>div:nth-child(10){grid-column-start:1;grid-column-end:2;grid-row-start:10;grid-row-end:11}.woocommerce-dashboard__columns>div:nth-child(11){grid-column-start:1;grid-column-end:2;grid-row-start:11;grid-row-end:12}.woocommerce-dashboard__columns>div:nth-child(12){grid-column-start:1;grid-column-end:2;grid-row-start:12;grid-row-end:13}.woocommerce-dashboard__columns>div:nth-child(13){grid-column-start:1;grid-column-end:2;grid-row-start:13;grid-row-end:14}.woocommerce-dashboard__columns>div:nth-child(14){grid-column-start:1;grid-column-end:2;grid-row-start:14;grid-row-end:15}}.woocommerce-dashboard__widget{display:flex;align-items:center;text-align:center}.woocommerce-dashboard__widget-item{flex:1}.woocommerce-dashboard-section__add-more{margin:0 auto;width:84px;padding:0 24px 24px}.woocommerce-dashboard-section__add-more .components-popover__content{padding:0 16px 8px}.woocommerce-dashboard-section__add-more>button svg{fill:#757575}.woocommerce-dashboard-section__add-more-choices{display:flex;justify-content:center}.woocommerce-dashboard-section__add-more-btn{display:flex;flex-direction:column;align-items:center;padding:16px;margin:8px}.woocommerce-dashboard-section__add-more-btn.components-button{height:auto}.woocommerce-dashboard-section__add-more-btn .store-performance__icon{transform:rotate(45deg)}.woocommerce-dashboard-section__add-more-btn-title{color:#757575;padding-top:8px}.woocommerce-dashboard-section-controls{border-top:1px solid #f0f0f0;padding-top:8px}.woocommerce-dashboard-section-controls .icon-control{margin:0 0 0 8px;vertical-align:bottom;fill:#757575}.woocommerce-dashboard-section-controls .woocommerce-ellipsis-menu__item{padding-bottom:10px}.components-card .woocommerce-ellipsis-menu__toggle{padding:0}.woocommerce-task-dashboard__body .woocommerce-task-dashboard__container .woocommerce-task-card{max-width:680px;margin-right:auto;margin-left:auto;margin-bottom:24px}.woocommerce-task-dashboard__body .woocommerce-task-dashboard__container .woocommerce-task-card .components-card__header.is-size-large{padding-bottom:12px}.woocommerce-task-dashboard__body .woocommerce-task-dashboard__container .woocommerce-task-card .components-card__header.is-size-large .woocommerce-card__menu{margin-top:8px}woocommerce-admin/dist/activity-panels-help/style-rtl.css000064400000004240151335517650017642 0ustar00:root{--wp-admin-theme-color:#007cba;--wp-admin-theme-color-darker-10:#006ba1;--wp-admin-theme-color-darker-20:#005a87}body.admin-color-light{--wp-admin-theme-color:#0085ba;--wp-admin-theme-color-darker-10:#0073a1;--wp-admin-theme-color-darker-20:#006187}body.admin-color-modern{--wp-admin-theme-color:#3858e9;--wp-admin-theme-color-darker-10:#2145e6;--wp-admin-theme-color-darker-20:#183ad6}body.admin-color-blue{--wp-admin-theme-color:#096484;--wp-admin-theme-color-darker-10:#07526c;--wp-admin-theme-color-darker-20:#064054}body.admin-color-coffee{--wp-admin-theme-color:#46403c;--wp-admin-theme-color-darker-10:#383330;--wp-admin-theme-color-darker-20:#2b2724}body.admin-color-ectoplasm{--wp-admin-theme-color:#523f6d;--wp-admin-theme-color-darker-10:#46365d;--wp-admin-theme-color-darker-20:#3a2c4d}body.admin-color-midnight{--wp-admin-theme-color:#e14d43;--wp-admin-theme-color-darker-10:#dd382d;--wp-admin-theme-color-darker-20:#d02c21}body.admin-color-ocean{--wp-admin-theme-color:#627c83;--wp-admin-theme-color-darker-10:#576e74;--wp-admin-theme-color-darker-20:#4c6066}body.admin-color-sunrise{--wp-admin-theme-color:#dd823b;--wp-admin-theme-color-darker-10:#d97426;--wp-admin-theme-color-darker-20:#c36922}.woocommerce-layout__activity-panel-header{height:50px;background:#e0e0e0;padding:16px;display:flex;justify-content:space-between;align-items:center}@media(min-width:783px){.woocommerce-layout__activity-panel-header{padding:16px 24px}}.woocommerce-layout__activity-panel-header h3{font-size:13px;font-weight:600;line-height:16px;margin:0;padding:0}.woocommerce-layout__activity-panel-header .woocommerce-ellipsis-menu__toggle.components-button:not(:disabled):not([aria-disabled=true]):focus,.woocommerce-layout__activity-panel-header .woocommerce-ellipsis-menu__toggle.components-button:not(:disabled):not([aria-disabled=true]):hover{box-shadow:none;border-radius:10px;background:#ccc}.woocommerce-layout__inbox-title{color:#1e1e1e;display:flex;align-items:center}.woocommerce-layout__inbox-subtitle{color:#757575}.woocommerce-layout__inbox-badge{margin-right:6px;background-color:#757575;border-radius:13px;padding:0 6px;color:#fff;display:inline-block;text-align:center;vertical-align:top}woocommerce-admin/dist/navigation/index.js000064400000057317151335517650014750 0ustar00this.wc=this.wc||{},this.wc.navigation=function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=467)}({0:function(e,t){e.exports=window.wp.element},15:function(e,t){e.exports=window.wp.url},23:function(e,t,n){"use strict";function r(){return(r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}n.d(t,"a",(function(){return r}))},3:function(e,t){e.exports=window.wp.components},30:function(e,t){e.exports=window.wp.hooks},32:function(e,t,n){"use strict";var r=n(67),o=n(68),i=n(39);e.exports={formats:i,parse:o,stringify:r}},39:function(e,t,n){"use strict";var r=String.prototype.replace,o=/%20/g,i="RFC1738",a="RFC3986";e.exports={default:a,formatters:{RFC1738:function(e){return r.call(e,o,"+")},RFC3986:function(e){return String(e)}},RFC1738:i,RFC3986:a}},4:function(e,t){e.exports=window.lodash},41:function(e,t,n){"use strict";t.a=function(e,t){if(!e)throw new Error("Invariant failed")}},467:function(e,t,n){"use strict";n.r(t),n.d(t,"getHistory",(function(){return f})),n.d(t,"flattenFilters",(function(){return p})),n.d(t,"getActiveFiltersFromQuery",(function(){return d})),n.d(t,"getDefaultOptionValue",(function(){return h})),n.d(t,"getQueryFromActiveFilters",(function(){return y})),n.d(t,"getUrlKey",(function(){return v})),n.d(t,"getPath",(function(){return m})),n.d(t,"getPersistedQuery",(function(){return g})),n.d(t,"getQueryExcludedScreens",(function(){return w})),n.d(t,"pathIsExcluded",(function(){return b})),n.d(t,"getScreenFromPath",(function(){return O})),n.d(t,"getIdsFromQuery",(function(){return j})),n.d(t,"getSetOfIdsFromQuery",(function(){return x})),n.d(t,"getSearchWords",(function(){return P})),n.d(t,"getNewPath",(function(){return k})),n.d(t,"getQuery",(function(){return E})),n.d(t,"onQueryChange",(function(){return S})),n.d(t,"updateQueryString",(function(){return A})),n.d(t,"addHistoryListener",(function(){return L})),n.d(t,"WooNavigationItem",(function(){return N}));var r=n(0),o=n(15),i=n(32),a=n(4),c=n(30),u=n(3),s=n(52);let l;function f(){if(!l){const e=document.location.pathname,t=Object(s.a)({basename:e.substring(0,e.lastIndexOf("/"))});l={get length(){return t.length},get action(){return t.action},get location(){const{location:e}=t,n=Object(i.parse)(e.search.substring(1)).path||"/";return{...e,pathname:n}},createHref:(...e)=>t.createHref.apply(t,e),push:(...e)=>t.push.apply(t,e),replace:(...e)=>t.replace.apply(t,e),go:(...e)=>t.go.apply(t,e),goBack:(...e)=>t.goBack.apply(t,e),goForward:(...e)=>t.goForward.apply(t,e),block:(...e)=>t.block.apply(t,e),listen(e){return t.listen(()=>{e(this.location,this.action)})}}}return l}function p(e){const t=[];return e.forEach(e=>{if(e.subFilters){t.push(Object(a.omit)(e,"subFilters"));const n=p(e.subFilters);t.push(...n)}else t.push(e)}),t}function d(e,t){return Object.keys(t).reduce((n,r)=>{const o=t[r];if(o.rules){const t=o.rules.filter(t=>e.hasOwnProperty(v(r,t.value)));if(t.length)if(o.allowMultiple)t.forEach(t=>{e[v(r,t.value)].forEach(e=>{n.push({key:r,rule:t.value,value:e})})});else{const o=e[v(r,t[0].value)];n.push({key:r,rule:t[0].value,value:o})}}else if(e[r])if(o.allowMultiple){e[r].forEach(e=>{n.push({key:r,value:e})})}else n.push({key:r,value:e[r]});return n},[])}function h(e,t){const{defaultOption:n}=e.input;if(e.input.defaultOption){const r=Object(a.find)(t,{value:n});return r?r.value:void console.warn(`invalid defaultOption ${n} supplied to ${e.labels.add}`)}return Object(a.get)(t,[0,"value"])}function y(e,t,n){return{...d(t,n).reduce((e,t)=>(e[v(t.key,t.rule)]=void 0,e),{}),...e.reduce((e,t)=>{if("between"===t.rule&&(!Array.isArray(t.value)||t.value.some(e=>!e)))return e;if(t.value){const r=v(t.key,t.rule);n[t.key]&&n[t.key].allowMultiple?(e.hasOwnProperty(r)||(e[r]=[]),e[r].push(t.value)):e[r]=t.value}return e},{})}}function v(e,t){return t&&t.length?`${e}_${t}`:e}const m=()=>f().location.pathname,g=(e=E())=>{const t=Object(c.applyFilters)("woocommerce_admin_persisted_queries",["period","compare","before","after","interval","type"]);return Object(a.pick)(e,t)},w=()=>Object(c.applyFilters)("woocommerce_admin_time_excluded_screens",["stock","settings","customers","homescreen"]),b=e=>w().includes(O(e)),O=(e=m())=>"/"===e?"homescreen":e.replace("/analytics","").replace("/","");function j(e=""){return[...x(e)]}function x(e=""){return new Set(e.split(",").map(e=>parseInt(e,10)).filter(e=>!isNaN(e)))}function P(e=E()){if("object"!=typeof e)throw new Error("Invalid parameter passed to getSearchWords, it expects an object or no parameters.");const{search:t}=e;if(!t)return[];if("string"!=typeof t)throw new Error("Invalid 'search' type. getSearchWords expects query's 'search' property to be a string.");return t.split(",").map(e=>e.replace("%2C",","))}function k(e,t=m(),n=E(),r="wc-admin"){const i={page:r,...n,...e};return"/"!==t&&(i.path=t),Object(o.addQueryArgs)("admin.php",i)}function E(){const e=f().location.search;return e.length&&Object(i.parse)(e.substring(1))||{}}function S(e,t=m(),n=E()){switch(e){case"sort":return(e,r)=>A({orderby:e,order:r},t,n);case"compare":return(e,r,o)=>A({[r]:"compare-"+e,[e]:o,search:void 0},t,n);default:return r=>A({[e]:r},t,n)}}function A(e,t=m(),n=E(),r="wc-admin"){const o=k(e,t,n,r);f().push(o)}const L=e=>(window.wcNavigation&&!window.wcNavigation.historyPatched&&(e=>{const t=e.pushState,n=e.replaceState;e.pushState=function(n){const r=new CustomEvent("pushstate",{state:n});return window.dispatchEvent(r),t.apply(e,arguments)},e.replaceState=function(t){const r=new CustomEvent("replacestate",{state:t});return window.dispatchEvent(r),n.apply(e,arguments)},window.wcNavigation.historyPatched=!0})(window.history),window.addEventListener("popstate",e),window.addEventListener("pushstate",e),window.addEventListener("replacestate",e),()=>{window.removeEventListener("popstate",e),window.removeEventListener("pushstate",e),window.removeEventListener("replacestate",e)}),N=({children:e,item:t})=>Object(r.createElement)(u.Fill,{name:"woocommerce_navigation_"+t},e);N.Slot=({name:e})=>Object(r.createElement)(u.Slot,{name:"woocommerce_navigation_"+e})},49:function(e,t,n){"use strict";var r=n(39),o=Object.prototype.hasOwnProperty,i=Array.isArray,a=function(){for(var e=[],t=0;t<256;++t)e.push("%"+((t<16?"0":"")+t.toString(16)).toUpperCase());return e}(),c=function(e,t){for(var n=t&&t.plainObjects?Object.create(null):{},r=0;r<e.length;++r)void 0!==e[r]&&(n[r]=e[r]);return n};e.exports={arrayToObject:c,assign:function(e,t){return Object.keys(t).reduce((function(e,n){return e[n]=t[n],e}),e)},combine:function(e,t){return[].concat(e,t)},compact:function(e){for(var t=[{obj:{o:e},prop:"o"}],n=[],r=0;r<t.length;++r)for(var o=t[r],a=o.obj[o.prop],c=Object.keys(a),u=0;u<c.length;++u){var s=c[u],l=a[s];"object"==typeof l&&null!==l&&-1===n.indexOf(l)&&(t.push({obj:a,prop:s}),n.push(l))}return function(e){for(;e.length>1;){var t=e.pop(),n=t.obj[t.prop];if(i(n)){for(var r=[],o=0;o<n.length;++o)void 0!==n[o]&&r.push(n[o]);t.obj[t.prop]=r}}}(t),e},decode:function(e,t,n){var r=e.replace(/\+/g," ");if("iso-8859-1"===n)return r.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(r)}catch(e){return r}},encode:function(e,t,n,o,i){if(0===e.length)return e;var c=e;if("symbol"==typeof e?c=Symbol.prototype.toString.call(e):"string"!=typeof e&&(c=String(e)),"iso-8859-1"===n)return escape(c).replace(/%u[0-9a-f]{4}/gi,(function(e){return"%26%23"+parseInt(e.slice(2),16)+"%3B"}));for(var u="",s=0;s<c.length;++s){var l=c.charCodeAt(s);45===l||46===l||95===l||126===l||l>=48&&l<=57||l>=65&&l<=90||l>=97&&l<=122||i===r.RFC1738&&(40===l||41===l)?u+=c.charAt(s):l<128?u+=a[l]:l<2048?u+=a[192|l>>6]+a[128|63&l]:l<55296||l>=57344?u+=a[224|l>>12]+a[128|l>>6&63]+a[128|63&l]:(s+=1,l=65536+((1023&l)<<10|1023&c.charCodeAt(s)),u+=a[240|l>>18]+a[128|l>>12&63]+a[128|l>>6&63]+a[128|63&l])}return u},isBuffer:function(e){return!(!e||"object"!=typeof e)&&!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))},isRegExp:function(e){return"[object RegExp]"===Object.prototype.toString.call(e)},maybeMap:function(e,t){if(i(e)){for(var n=[],r=0;r<e.length;r+=1)n.push(t(e[r]));return n}return t(e)},merge:function e(t,n,r){if(!n)return t;if("object"!=typeof n){if(i(t))t.push(n);else{if(!t||"object"!=typeof t)return[t,n];(r&&(r.plainObjects||r.allowPrototypes)||!o.call(Object.prototype,n))&&(t[n]=!0)}return t}if(!t||"object"!=typeof t)return[t].concat(n);var a=t;return i(t)&&!i(n)&&(a=c(t,r)),i(t)&&i(n)?(n.forEach((function(n,i){if(o.call(t,i)){var a=t[i];a&&"object"==typeof a&&n&&"object"==typeof n?t[i]=e(a,n,r):t.push(n)}else t[i]=n})),t):Object.keys(n).reduce((function(t,i){var a=n[i];return o.call(t,i)?t[i]=e(t[i],a,r):t[i]=a,t}),a)}}},52:function(e,t,n){"use strict";n.d(t,"a",(function(){return b})),n.d(t,"c",(function(){return j})),n.d(t,"b",(function(){return h})),n.d(t,"e",(function(){return y})),n.d(t,"d",(function(){return d}));var r=n(23);function o(e){return"/"===e.charAt(0)}function i(e,t){for(var n=t,r=n+1,o=e.length;r<o;n+=1,r+=1)e[n]=e[r];e.pop()}var a=function(e,t){void 0===t&&(t="");var n,r=e&&e.split("/")||[],a=t&&t.split("/")||[],c=e&&o(e),u=t&&o(t),s=c||u;if(e&&o(e)?a=r:r.length&&(a.pop(),a=a.concat(r)),!a.length)return"/";if(a.length){var l=a[a.length-1];n="."===l||".."===l||""===l}else n=!1;for(var f=0,p=a.length;p>=0;p--){var d=a[p];"."===d?i(a,p):".."===d?(i(a,p),f++):f&&(i(a,p),f--)}if(!s)for(;f--;f)a.unshift("..");!s||""===a[0]||a[0]&&o(a[0])||a.unshift("");var h=a.join("/");return n&&"/"!==h.substr(-1)&&(h+="/"),h};function c(e){return e.valueOf?e.valueOf():Object.prototype.valueOf.call(e)}var u=function e(t,n){if(t===n)return!0;if(null==t||null==n)return!1;if(Array.isArray(t))return Array.isArray(n)&&t.length===n.length&&t.every((function(t,r){return e(t,n[r])}));if("object"==typeof t||"object"==typeof n){var r=c(t),o=c(n);return r!==t||o!==n?e(r,o):Object.keys(Object.assign({},t,n)).every((function(r){return e(t[r],n[r])}))}return!1},s=n(41);function l(e){return"/"===e.charAt(0)?e:"/"+e}function f(e,t){return function(e,t){return 0===e.toLowerCase().indexOf(t.toLowerCase())&&-1!=="/?#".indexOf(e.charAt(t.length))}(e,t)?e.substr(t.length):e}function p(e){return"/"===e.charAt(e.length-1)?e.slice(0,-1):e}function d(e){var t=e.pathname,n=e.search,r=e.hash,o=t||"/";return n&&"?"!==n&&(o+="?"===n.charAt(0)?n:"?"+n),r&&"#"!==r&&(o+="#"===r.charAt(0)?r:"#"+r),o}function h(e,t,n,o){var i;"string"==typeof e?(i=function(e){var t=e||"/",n="",r="",o=t.indexOf("#");-1!==o&&(r=t.substr(o),t=t.substr(0,o));var i=t.indexOf("?");return-1!==i&&(n=t.substr(i),t=t.substr(0,i)),{pathname:t,search:"?"===n?"":n,hash:"#"===r?"":r}}(e)).state=t:(void 0===(i=Object(r.a)({},e)).pathname&&(i.pathname=""),i.search?"?"!==i.search.charAt(0)&&(i.search="?"+i.search):i.search="",i.hash?"#"!==i.hash.charAt(0)&&(i.hash="#"+i.hash):i.hash="",void 0!==t&&void 0===i.state&&(i.state=t));try{i.pathname=decodeURI(i.pathname)}catch(e){throw e instanceof URIError?new URIError('Pathname "'+i.pathname+'" could not be decoded. This is likely caused by an invalid percent-encoding.'):e}return n&&(i.key=n),o?i.pathname?"/"!==i.pathname.charAt(0)&&(i.pathname=a(i.pathname,o.pathname)):i.pathname=o.pathname:i.pathname||(i.pathname="/"),i}function y(e,t){return e.pathname===t.pathname&&e.search===t.search&&e.hash===t.hash&&e.key===t.key&&u(e.state,t.state)}function v(){var e=null;var t=[];return{setPrompt:function(t){return e=t,function(){e===t&&(e=null)}},confirmTransitionTo:function(t,n,r,o){if(null!=e){var i="function"==typeof e?e(t,n):e;"string"==typeof i?"function"==typeof r?r(i,o):o(!0):o(!1!==i)}else o(!0)},appendListener:function(e){var n=!0;function r(){n&&e.apply(void 0,arguments)}return t.push(r),function(){n=!1,t=t.filter((function(e){return e!==r}))}},notifyListeners:function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];t.forEach((function(e){return e.apply(void 0,n)}))}}}var m=!("undefined"==typeof window||!window.document||!window.document.createElement);function g(e,t){t(window.confirm(e))}function w(){try{return window.history.state||{}}catch(e){return{}}}function b(e){void 0===e&&(e={}),m||Object(s.a)(!1);var t,n=window.history,o=(-1===(t=window.navigator.userAgent).indexOf("Android 2.")&&-1===t.indexOf("Android 4.0")||-1===t.indexOf("Mobile Safari")||-1!==t.indexOf("Chrome")||-1!==t.indexOf("Windows Phone"))&&window.history&&"pushState"in window.history,i=!(-1===window.navigator.userAgent.indexOf("Trident")),a=e,c=a.forceRefresh,u=void 0!==c&&c,y=a.getUserConfirmation,b=void 0===y?g:y,O=a.keyLength,j=void 0===O?6:O,x=e.basename?p(l(e.basename)):"";function P(e){var t=e||{},n=t.key,r=t.state,o=window.location,i=o.pathname+o.search+o.hash;return x&&(i=f(i,x)),h(i,r,n)}function k(){return Math.random().toString(36).substr(2,j)}var E=v();function S(e){Object(r.a)(_,e),_.length=n.length,E.notifyListeners(_.location,_.action)}function A(e){(function(e){return void 0===e.state&&-1===navigator.userAgent.indexOf("CriOS")})(e)||C(P(e.state))}function L(){C(P(w()))}var N=!1;function C(e){if(N)N=!1,S();else{E.confirmTransitionTo(e,"POP",b,(function(t){t?S({action:"POP",location:e}):function(e){var t=_.location,n=T.indexOf(t.key);-1===n&&(n=0);var r=T.indexOf(e.key);-1===r&&(r=0);var o=n-r;o&&(N=!0,H(o))}(e)}))}}var F=P(w()),T=[F.key];function D(e){return x+d(e)}function H(e){n.go(e)}var Q=0;function R(e){1===(Q+=e)&&1===e?(window.addEventListener("popstate",A),i&&window.addEventListener("hashchange",L)):0===Q&&(window.removeEventListener("popstate",A),i&&window.removeEventListener("hashchange",L))}var I=!1;var _={length:n.length,action:"POP",location:F,createHref:D,push:function(e,t){var r=h(e,t,k(),_.location);E.confirmTransitionTo(r,"PUSH",b,(function(e){if(e){var t=D(r),i=r.key,a=r.state;if(o)if(n.pushState({key:i,state:a},null,t),u)window.location.href=t;else{var c=T.indexOf(_.location.key),s=T.slice(0,c+1);s.push(r.key),T=s,S({action:"PUSH",location:r})}else window.location.href=t}}))},replace:function(e,t){var r=h(e,t,k(),_.location);E.confirmTransitionTo(r,"REPLACE",b,(function(e){if(e){var t=D(r),i=r.key,a=r.state;if(o)if(n.replaceState({key:i,state:a},null,t),u)window.location.replace(t);else{var c=T.indexOf(_.location.key);-1!==c&&(T[c]=r.key),S({action:"REPLACE",location:r})}else window.location.replace(t)}}))},go:H,goBack:function(){H(-1)},goForward:function(){H(1)},block:function(e){void 0===e&&(e=!1);var t=E.setPrompt(e);return I||(R(1),I=!0),function(){return I&&(I=!1,R(-1)),t()}},listen:function(e){var t=E.appendListener(e);return R(1),function(){R(-1),t()}}};return _}function O(e,t,n){return Math.min(Math.max(e,t),n)}function j(e){void 0===e&&(e={});var t=e,n=t.getUserConfirmation,o=t.initialEntries,i=void 0===o?["/"]:o,a=t.initialIndex,c=void 0===a?0:a,u=t.keyLength,s=void 0===u?6:u,l=v();function f(e){Object(r.a)(b,e),b.length=b.entries.length,l.notifyListeners(b.location,b.action)}function p(){return Math.random().toString(36).substr(2,s)}var y=O(c,0,i.length-1),m=i.map((function(e){return h(e,void 0,"string"==typeof e?p():e.key||p())})),g=d;function w(e){var t=O(b.index+e,0,b.entries.length-1),r=b.entries[t];l.confirmTransitionTo(r,"POP",n,(function(e){e?f({action:"POP",location:r,index:t}):f()}))}var b={length:m.length,action:"POP",location:m[y],index:y,entries:m,createHref:g,push:function(e,t){var r=h(e,t,p(),b.location);l.confirmTransitionTo(r,"PUSH",n,(function(e){if(e){var t=b.index+1,n=b.entries.slice(0);n.length>t?n.splice(t,n.length-t,r):n.push(r),f({action:"PUSH",location:r,index:t,entries:n})}}))},replace:function(e,t){var r=h(e,t,p(),b.location);l.confirmTransitionTo(r,"REPLACE",n,(function(e){e&&(b.entries[b.index]=r,f({action:"REPLACE",location:r}))}))},go:w,goBack:function(){w(-1)},goForward:function(){w(1)},canGo:function(e){var t=b.index+e;return t>=0&&t<b.entries.length},block:function(e){return void 0===e&&(e=!1),l.setPrompt(e)},listen:function(e){return l.appendListener(e)}};return b}},67:function(e,t,n){"use strict";var r=n(49),o=n(39),i=Object.prototype.hasOwnProperty,a={brackets:function(e){return e+"[]"},comma:"comma",indices:function(e,t){return e+"["+t+"]"},repeat:function(e){return e}},c=Array.isArray,u=Array.prototype.push,s=function(e,t){u.apply(e,c(t)?t:[t])},l=Date.prototype.toISOString,f=o.default,p={addQueryPrefix:!1,allowDots:!1,charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encoder:r.encode,encodeValuesOnly:!1,format:f,formatter:o.formatters[f],indices:!1,serializeDate:function(e){return l.call(e)},skipNulls:!1,strictNullHandling:!1},d=function e(t,n,o,i,a,u,l,f,d,h,y,v,m,g){var w,b=t;if("function"==typeof l?b=l(n,b):b instanceof Date?b=h(b):"comma"===o&&c(b)&&(b=r.maybeMap(b,(function(e){return e instanceof Date?h(e):e}))),null===b){if(i)return u&&!m?u(n,p.encoder,g,"key",y):n;b=""}if("string"==typeof(w=b)||"number"==typeof w||"boolean"==typeof w||"symbol"==typeof w||"bigint"==typeof w||r.isBuffer(b))return u?[v(m?n:u(n,p.encoder,g,"key",y))+"="+v(u(b,p.encoder,g,"value",y))]:[v(n)+"="+v(String(b))];var O,j=[];if(void 0===b)return j;if("comma"===o&&c(b))O=[{value:b.length>0?b.join(",")||null:void 0}];else if(c(l))O=l;else{var x=Object.keys(b);O=f?x.sort(f):x}for(var P=0;P<O.length;++P){var k=O[P],E="object"==typeof k&&void 0!==k.value?k.value:b[k];if(!a||null!==E){var S=c(b)?"function"==typeof o?o(n,k):n:n+(d?"."+k:"["+k+"]");s(j,e(E,S,o,i,a,u,l,f,d,h,y,v,m,g))}}return j};e.exports=function(e,t){var n,r=e,u=function(e){if(!e)return p;if(null!==e.encoder&&void 0!==e.encoder&&"function"!=typeof e.encoder)throw new TypeError("Encoder has to be a function.");var t=e.charset||p.charset;if(void 0!==e.charset&&"utf-8"!==e.charset&&"iso-8859-1"!==e.charset)throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var n=o.default;if(void 0!==e.format){if(!i.call(o.formatters,e.format))throw new TypeError("Unknown format option provided.");n=e.format}var r=o.formatters[n],a=p.filter;return("function"==typeof e.filter||c(e.filter))&&(a=e.filter),{addQueryPrefix:"boolean"==typeof e.addQueryPrefix?e.addQueryPrefix:p.addQueryPrefix,allowDots:void 0===e.allowDots?p.allowDots:!!e.allowDots,charset:t,charsetSentinel:"boolean"==typeof e.charsetSentinel?e.charsetSentinel:p.charsetSentinel,delimiter:void 0===e.delimiter?p.delimiter:e.delimiter,encode:"boolean"==typeof e.encode?e.encode:p.encode,encoder:"function"==typeof e.encoder?e.encoder:p.encoder,encodeValuesOnly:"boolean"==typeof e.encodeValuesOnly?e.encodeValuesOnly:p.encodeValuesOnly,filter:a,format:n,formatter:r,serializeDate:"function"==typeof e.serializeDate?e.serializeDate:p.serializeDate,skipNulls:"boolean"==typeof e.skipNulls?e.skipNulls:p.skipNulls,sort:"function"==typeof e.sort?e.sort:null,strictNullHandling:"boolean"==typeof e.strictNullHandling?e.strictNullHandling:p.strictNullHandling}}(t);"function"==typeof u.filter?r=(0,u.filter)("",r):c(u.filter)&&(n=u.filter);var l,f=[];if("object"!=typeof r||null===r)return"";l=t&&t.arrayFormat in a?t.arrayFormat:t&&"indices"in t?t.indices?"indices":"repeat":"indices";var h=a[l];n||(n=Object.keys(r)),u.sort&&n.sort(u.sort);for(var y=0;y<n.length;++y){var v=n[y];u.skipNulls&&null===r[v]||s(f,d(r[v],v,h,u.strictNullHandling,u.skipNulls,u.encode?u.encoder:null,u.filter,u.sort,u.allowDots,u.serializeDate,u.format,u.formatter,u.encodeValuesOnly,u.charset))}var m=f.join(u.delimiter),g=!0===u.addQueryPrefix?"?":"";return u.charsetSentinel&&("iso-8859-1"===u.charset?g+="utf8=%26%2310003%3B&":g+="utf8=%E2%9C%93&"),m.length>0?g+m:""}},68:function(e,t,n){"use strict";var r=n(49),o=Object.prototype.hasOwnProperty,i=Array.isArray,a={allowDots:!1,allowPrototypes:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decoder:r.decode,delimiter:"&",depth:5,ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictNullHandling:!1},c=function(e){return e.replace(/&#(\d+);/g,(function(e,t){return String.fromCharCode(parseInt(t,10))}))},u=function(e,t){return e&&"string"==typeof e&&t.comma&&e.indexOf(",")>-1?e.split(","):e},s=function(e,t,n,r){if(e){var i=n.allowDots?e.replace(/\.([^.[]+)/g,"[$1]"):e,a=/(\[[^[\]]*])/g,c=n.depth>0&&/(\[[^[\]]*])/.exec(i),s=c?i.slice(0,c.index):i,l=[];if(s){if(!n.plainObjects&&o.call(Object.prototype,s)&&!n.allowPrototypes)return;l.push(s)}for(var f=0;n.depth>0&&null!==(c=a.exec(i))&&f<n.depth;){if(f+=1,!n.plainObjects&&o.call(Object.prototype,c[1].slice(1,-1))&&!n.allowPrototypes)return;l.push(c[1])}return c&&l.push("["+i.slice(c.index)+"]"),function(e,t,n,r){for(var o=r?t:u(t,n),i=e.length-1;i>=0;--i){var a,c=e[i];if("[]"===c&&n.parseArrays)a=[].concat(o);else{a=n.plainObjects?Object.create(null):{};var s="["===c.charAt(0)&&"]"===c.charAt(c.length-1)?c.slice(1,-1):c,l=parseInt(s,10);n.parseArrays||""!==s?!isNaN(l)&&c!==s&&String(l)===s&&l>=0&&n.parseArrays&&l<=n.arrayLimit?(a=[])[l]=o:a[s]=o:a={0:o}}o=a}return o}(l,t,n,r)}};e.exports=function(e,t){var n=function(e){if(!e)return a;if(null!==e.decoder&&void 0!==e.decoder&&"function"!=typeof e.decoder)throw new TypeError("Decoder has to be a function.");if(void 0!==e.charset&&"utf-8"!==e.charset&&"iso-8859-1"!==e.charset)throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var t=void 0===e.charset?a.charset:e.charset;return{allowDots:void 0===e.allowDots?a.allowDots:!!e.allowDots,allowPrototypes:"boolean"==typeof e.allowPrototypes?e.allowPrototypes:a.allowPrototypes,arrayLimit:"number"==typeof e.arrayLimit?e.arrayLimit:a.arrayLimit,charset:t,charsetSentinel:"boolean"==typeof e.charsetSentinel?e.charsetSentinel:a.charsetSentinel,comma:"boolean"==typeof e.comma?e.comma:a.comma,decoder:"function"==typeof e.decoder?e.decoder:a.decoder,delimiter:"string"==typeof e.delimiter||r.isRegExp(e.delimiter)?e.delimiter:a.delimiter,depth:"number"==typeof e.depth||!1===e.depth?+e.depth:a.depth,ignoreQueryPrefix:!0===e.ignoreQueryPrefix,interpretNumericEntities:"boolean"==typeof e.interpretNumericEntities?e.interpretNumericEntities:a.interpretNumericEntities,parameterLimit:"number"==typeof e.parameterLimit?e.parameterLimit:a.parameterLimit,parseArrays:!1!==e.parseArrays,plainObjects:"boolean"==typeof e.plainObjects?e.plainObjects:a.plainObjects,strictNullHandling:"boolean"==typeof e.strictNullHandling?e.strictNullHandling:a.strictNullHandling}}(t);if(""===e||null==e)return n.plainObjects?Object.create(null):{};for(var l="string"==typeof e?function(e,t){var n,s={},l=t.ignoreQueryPrefix?e.replace(/^\?/,""):e,f=t.parameterLimit===1/0?void 0:t.parameterLimit,p=l.split(t.delimiter,f),d=-1,h=t.charset;if(t.charsetSentinel)for(n=0;n<p.length;++n)0===p[n].indexOf("utf8=")&&("utf8=%E2%9C%93"===p[n]?h="utf-8":"utf8=%26%2310003%3B"===p[n]&&(h="iso-8859-1"),d=n,n=p.length);for(n=0;n<p.length;++n)if(n!==d){var y,v,m=p[n],g=m.indexOf("]="),w=-1===g?m.indexOf("="):g+1;-1===w?(y=t.decoder(m,a.decoder,h,"key"),v=t.strictNullHandling?null:""):(y=t.decoder(m.slice(0,w),a.decoder,h,"key"),v=r.maybeMap(u(m.slice(w+1),t),(function(e){return t.decoder(e,a.decoder,h,"value")}))),v&&t.interpretNumericEntities&&"iso-8859-1"===h&&(v=c(v)),m.indexOf("[]=")>-1&&(v=i(v)?[v]:v),o.call(s,y)?s[y]=r.combine(s[y],v):s[y]=v}return s}(e,n):e,f=n.plainObjects?Object.create(null):{},p=Object.keys(l),d=0;d<p.length;++d){var h=p[d],y=s(h,l[h],n,"string"==typeof e);f=r.merge(f,y,n)}return r.compact(f)}}});woocommerce-admin/dist/navigation/index.asset.php000064400000000234151335517650016223 0ustar00<?php return array('dependencies' => array('lodash', 'wp-components', 'wp-element', 'wp-hooks', 'wp-url'), 'version' => 'ad61216d0100ce7aab8b98bba12d3d07');woocommerce-admin/dist/analytics-report-products/style-rtl.css000064400000003031151335517650020736 0ustar00:root{--wp-admin-theme-color:#007cba;--wp-admin-theme-color-darker-10:#006ba1;--wp-admin-theme-color-darker-20:#005a87}body.admin-color-light{--wp-admin-theme-color:#0085ba;--wp-admin-theme-color-darker-10:#0073a1;--wp-admin-theme-color-darker-20:#006187}body.admin-color-modern{--wp-admin-theme-color:#3858e9;--wp-admin-theme-color-darker-10:#2145e6;--wp-admin-theme-color-darker-20:#183ad6}body.admin-color-blue{--wp-admin-theme-color:#096484;--wp-admin-theme-color-darker-10:#07526c;--wp-admin-theme-color-darker-20:#064054}body.admin-color-coffee{--wp-admin-theme-color:#46403c;--wp-admin-theme-color-darker-10:#383330;--wp-admin-theme-color-darker-20:#2b2724}body.admin-color-ectoplasm{--wp-admin-theme-color:#523f6d;--wp-admin-theme-color-darker-10:#46365d;--wp-admin-theme-color-darker-20:#3a2c4d}body.admin-color-midnight{--wp-admin-theme-color:#e14d43;--wp-admin-theme-color-darker-10:#dd382d;--wp-admin-theme-color-darker-20:#d02c21}body.admin-color-ocean{--wp-admin-theme-color:#627c83;--wp-admin-theme-color-darker-10:#576e74;--wp-admin-theme-color-darker-20:#4c6066}body.admin-color-sunrise{--wp-admin-theme-color:#dd823b;--wp-admin-theme-color-darker-10:#d97426;--wp-admin-theme-color-darker-20:#c36922}.woocommerce-table__product-categories>.woocommerce-table__breadcrumbs{display:inline-block;margin-left:12px}.woocommerce-table__product-categories .components-popover__content{padding:0 16px;text-align:right}.woocommerce-table__product-categories .components-popover__content .woocommerce-table__breadcrumbs{margin-top:12px;margin-bottom:12px}woocommerce-admin/dist/store-performance/style-rtl.css000064400000003636151335517650017243 0ustar00:root{--wp-admin-theme-color:#007cba;--wp-admin-theme-color-darker-10:#006ba1;--wp-admin-theme-color-darker-20:#005a87}body.admin-color-light{--wp-admin-theme-color:#0085ba;--wp-admin-theme-color-darker-10:#0073a1;--wp-admin-theme-color-darker-20:#006187}body.admin-color-modern{--wp-admin-theme-color:#3858e9;--wp-admin-theme-color-darker-10:#2145e6;--wp-admin-theme-color-darker-20:#183ad6}body.admin-color-blue{--wp-admin-theme-color:#096484;--wp-admin-theme-color-darker-10:#07526c;--wp-admin-theme-color-darker-20:#064054}body.admin-color-coffee{--wp-admin-theme-color:#46403c;--wp-admin-theme-color-darker-10:#383330;--wp-admin-theme-color-darker-20:#2b2724}body.admin-color-ectoplasm{--wp-admin-theme-color:#523f6d;--wp-admin-theme-color-darker-10:#46365d;--wp-admin-theme-color-darker-20:#3a2c4d}body.admin-color-midnight{--wp-admin-theme-color:#e14d43;--wp-admin-theme-color-darker-10:#dd382d;--wp-admin-theme-color-darker-20:#d02c21}body.admin-color-ocean{--wp-admin-theme-color:#627c83;--wp-admin-theme-color-darker-10:#576e74;--wp-admin-theme-color-darker-20:#4c6066}body.admin-color-sunrise{--wp-admin-theme-color:#dd823b;--wp-admin-theme-color-darker-10:#d97426;--wp-admin-theme-color-darker-20:#c36922}.woocommerce-dashboard__store-performance{margin-bottom:24px}@media(max-width:782px){.woocommerce-dashboard__store-performance{border-width:0}}.woocommerce-dashboard__store-performance .woocommerce-summary__item{background-color:#fff}.woocommerce-dashboard__store-performance .woocommerce-summary__item:hover{background-color:#f0f0f0}.woocommerce-dashboard__store-performance .woocommerce-summary{background-color:#f0f0f0;margin:0}@media(max-width:782px){.woocommerce-dashboard__store-performance .woocommerce-summary.is-placeholder{border-top:0}.woocommerce-dashboard__store-performance .woocommerce-summary:not(.is-placeholder) .woocommerce-summary__item-container:first-child .woocommerce-summary__item{border-top:1px solid #ccc}}woocommerce-admin/dist/customer-effort-score/style.css000064400000006714151335517650017246 0ustar00:root{--wp-admin-theme-color:#007cba;--wp-admin-theme-color-darker-10:#006ba1;--wp-admin-theme-color-darker-20:#005a87}body.admin-color-light{--wp-admin-theme-color:#0085ba;--wp-admin-theme-color-darker-10:#0073a1;--wp-admin-theme-color-darker-20:#006187}body.admin-color-modern{--wp-admin-theme-color:#3858e9;--wp-admin-theme-color-darker-10:#2145e6;--wp-admin-theme-color-darker-20:#183ad6}body.admin-color-blue{--wp-admin-theme-color:#096484;--wp-admin-theme-color-darker-10:#07526c;--wp-admin-theme-color-darker-20:#064054}body.admin-color-coffee{--wp-admin-theme-color:#46403c;--wp-admin-theme-color-darker-10:#383330;--wp-admin-theme-color-darker-20:#2b2724}body.admin-color-ectoplasm{--wp-admin-theme-color:#523f6d;--wp-admin-theme-color-darker-10:#46365d;--wp-admin-theme-color-darker-20:#3a2c4d}body.admin-color-midnight{--wp-admin-theme-color:#e14d43;--wp-admin-theme-color-darker-10:#dd382d;--wp-admin-theme-color-darker-20:#d02c21}body.admin-color-ocean{--wp-admin-theme-color:#627c83;--wp-admin-theme-color-darker-10:#576e74;--wp-admin-theme-color-darker-20:#4c6066}body.admin-color-sunrise{--wp-admin-theme-color:#dd823b;--wp-admin-theme-color-darker-10:#d97426;--wp-admin-theme-color-darker-20:#c36922}.woocommerce-customer-effort-score__selection{margin:1em 0}.woocommerce-customer-effort-score__selection .components-base-control__field{display:flex;flex-direction:column;margin:0 auto;color:#007cba;color:var(--wp-admin-theme-color)}@media(min-width:601px){.woocommerce-customer-effort-score__selection .components-base-control__field{flex-direction:row}}.woocommerce-customer-effort-score__selection .components-radio-control__option:not(:last-child){margin-bottom:0;margin-right:4px}.woocommerce-customer-effort-score__selection .components-radio-control__option input{position:absolute;opacity:0}.woocommerce-customer-effort-score__selection .components-radio-control__option label{display:block;text-align:center;box-sizing:border-box;width:9em;height:100%;padding:1em .5em;font-size:.9em}.woocommerce-customer-effort-score__selection .components-radio-control__option label:hover{background-color:#e6f1f5}.woocommerce-customer-effort-score__selection .components-radio-control__option input:focus+label{outline:2px solid #006088;background-color:peach;color:#055d9c}.woocommerce-customer-effort-score__selection .components-radio-control__option input:checked+label{outline:2px solid #006088;background-color:#e6f1f5}.woocommerce-customer-effort-score__selection .components-radio-control__option label:before{display:block;font-size:24px;text-align:center;margin:1em 0;color:#006088}.woocommerce-customer-effort-score__selection .components-radio-control__option input[value="1"]+label:before{content:"😞"}.woocommerce-customer-effort-score__selection .components-radio-control__option input[value="2"]+label:before{content:"🙁"}.woocommerce-customer-effort-score__selection .components-radio-control__option input[value="3"]+label:before{content:"😐"}.woocommerce-customer-effort-score__selection .components-radio-control__option input[value="4"]+label:before{content:"🙂"}.woocommerce-customer-effort-score__selection .components-radio-control__option input[value="5"]+label:before{content:"😁"}.woocommerce-customer-effort-score__comments label{display:block;color:inherit;font-weight:700}.woocommerce-customer-effort-score__comments textarea{width:100%}.woocommerce-customer-effort-score__buttons{text-align:right}.woocommerce-customer-effort-score__buttons .components-button{margin-left:1em}woocommerce-admin/dist/customer-effort-score/style-rtl.css000064400000006713151335517650020044 0ustar00:root{--wp-admin-theme-color:#007cba;--wp-admin-theme-color-darker-10:#006ba1;--wp-admin-theme-color-darker-20:#005a87}body.admin-color-light{--wp-admin-theme-color:#0085ba;--wp-admin-theme-color-darker-10:#0073a1;--wp-admin-theme-color-darker-20:#006187}body.admin-color-modern{--wp-admin-theme-color:#3858e9;--wp-admin-theme-color-darker-10:#2145e6;--wp-admin-theme-color-darker-20:#183ad6}body.admin-color-blue{--wp-admin-theme-color:#096484;--wp-admin-theme-color-darker-10:#07526c;--wp-admin-theme-color-darker-20:#064054}body.admin-color-coffee{--wp-admin-theme-color:#46403c;--wp-admin-theme-color-darker-10:#383330;--wp-admin-theme-color-darker-20:#2b2724}body.admin-color-ectoplasm{--wp-admin-theme-color:#523f6d;--wp-admin-theme-color-darker-10:#46365d;--wp-admin-theme-color-darker-20:#3a2c4d}body.admin-color-midnight{--wp-admin-theme-color:#e14d43;--wp-admin-theme-color-darker-10:#dd382d;--wp-admin-theme-color-darker-20:#d02c21}body.admin-color-ocean{--wp-admin-theme-color:#627c83;--wp-admin-theme-color-darker-10:#576e74;--wp-admin-theme-color-darker-20:#4c6066}body.admin-color-sunrise{--wp-admin-theme-color:#dd823b;--wp-admin-theme-color-darker-10:#d97426;--wp-admin-theme-color-darker-20:#c36922}.woocommerce-customer-effort-score__selection{margin:1em 0}.woocommerce-customer-effort-score__selection .components-base-control__field{display:flex;flex-direction:column;margin:0 auto;color:#007cba;color:var(--wp-admin-theme-color)}@media(min-width:601px){.woocommerce-customer-effort-score__selection .components-base-control__field{flex-direction:row}}.woocommerce-customer-effort-score__selection .components-radio-control__option:not(:last-child){margin-bottom:0;margin-left:4px}.woocommerce-customer-effort-score__selection .components-radio-control__option input{position:absolute;opacity:0}.woocommerce-customer-effort-score__selection .components-radio-control__option label{display:block;text-align:center;box-sizing:border-box;width:9em;height:100%;padding:1em .5em;font-size:.9em}.woocommerce-customer-effort-score__selection .components-radio-control__option label:hover{background-color:#e6f1f5}.woocommerce-customer-effort-score__selection .components-radio-control__option input:focus+label{outline:2px solid #006088;background-color:peach;color:#055d9c}.woocommerce-customer-effort-score__selection .components-radio-control__option input:checked+label{outline:2px solid #006088;background-color:#e6f1f5}.woocommerce-customer-effort-score__selection .components-radio-control__option label:before{display:block;font-size:24px;text-align:center;margin:1em 0;color:#006088}.woocommerce-customer-effort-score__selection .components-radio-control__option input[value="1"]+label:before{content:"😞"}.woocommerce-customer-effort-score__selection .components-radio-control__option input[value="2"]+label:before{content:"🙁"}.woocommerce-customer-effort-score__selection .components-radio-control__option input[value="3"]+label:before{content:"😐"}.woocommerce-customer-effort-score__selection .components-radio-control__option input[value="4"]+label:before{content:"🙂"}.woocommerce-customer-effort-score__selection .components-radio-control__option input[value="5"]+label:before{content:"😁"}.woocommerce-customer-effort-score__comments label{display:block;color:inherit;font-weight:700}.woocommerce-customer-effort-score__comments textarea{width:100%}.woocommerce-customer-effort-score__buttons{text-align:left}.woocommerce-customer-effort-score__buttons .components-button{margin-right:1em}woocommerce-admin/dist/customer-effort-score/index.asset.php000064400000000263151335517650020323 0ustar00<?php return array('dependencies' => array('wc-experimental', 'wp-components', 'wp-compose', 'wp-data', 'wp-element', 'wp-i18n'), 'version' => 'f48b928284cc737d5308b2ed30cde115');woocommerce-admin/dist/customer-effort-score/index.js000064400000011723151335517650017035 0ustar00this.wc=this.wc||{},this.wc.customerEffortScore=function(e){var t={};function o(c){if(t[c])return t[c].exports;var r=t[c]={i:c,l:!1,exports:{}};return e[c].call(r.exports,r,r.exports,o),r.l=!0,r.exports}return o.m=e,o.c=t,o.d=function(e,t,c){o.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:c})},o.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.t=function(e,t){if(1&t&&(e=o(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var c=Object.create(null);if(o.r(c),Object.defineProperty(c,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)o.d(c,r,function(t){return e[t]}.bind(null,r));return c},o.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(t,"a",t),t},o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},o.p="",o(o.s=468)}({0:function(e,t){e.exports=window.wp.element},1:function(e,t,o){e.exports=o(47)()},14:function(e,t){e.exports=window.wp.compose},2:function(e,t){e.exports=window.wp.i18n},20:function(e,t){e.exports=window.wc.experimental},3:function(e,t){e.exports=window.wp.components},468:function(e,t,o){"use strict";o.r(t),o.d(t,"CustomerEffortScore",(function(){return d}));var c=o(0),r=o(1),n=o.n(r),a=o(2),i=o(14),l=o(7),s=o(3),u=o(20);function m({recordScoreCallback:e,label:t}){const o=[{label:Object(a.__)("Very difficult",'woocommerce'),value:"1"},{label:Object(a.__)("Somewhat difficult",'woocommerce'),value:"2"},{label:Object(a.__)("Neutral",'woocommerce'),value:"3"},{label:Object(a.__)("Somewhat easy",'woocommerce'),value:"4"},{label:Object(a.__)("Very easy",'woocommerce'),value:"5"}],[r,n]=Object(c.useState)(NaN),[i,l]=Object(c.useState)(""),[m,b]=Object(c.useState)(!1),[f,d]=Object(c.useState)(!0),p=()=>d(!1);return f?Object(c.createElement)(s.Modal,{className:"woocommerce-customer-effort-score",title:Object(a.__)("Please share your feedback",'woocommerce'),onRequestClose:p,shouldCloseOnClickOutside:!1},Object(c.createElement)(u.Text,{variant:"subtitle.small",as:"p",weight:"600",size:"14",lineHeight:"20px"},t),Object(c.createElement)("div",{className:"woocommerce-customer-effort-score__selection"},Object(c.createElement)(s.RadioControl,{selected:r.toString(10),options:o,onChange:e=>{const t=parseInt(e,10);n(t),b(!Number.isInteger(t))}})),(1===r||2===r)&&Object(c.createElement)("div",{className:"woocommerce-customer-effort-score__comments"},Object(c.createElement)(s.TextareaControl,{label:Object(a.__)("Comments (Optional)",'woocommerce'),help:Object(a.__)("Your feedback will go to the WooCommerce development team",'woocommerce'),value:i,onChange:e=>l(e),rows:5})),m&&Object(c.createElement)("div",{className:"woocommerce-customer-effort-score__errors",role:"alert"},Object(c.createElement)(u.Text,{variant:"body",as:"p"},Object(a.__)("Please provide feedback by selecting an option above.",'woocommerce'))),Object(c.createElement)("div",{className:"woocommerce-customer-effort-score__buttons"},Object(c.createElement)(s.Button,{isTertiary:!0,onClick:p,name:"cancel"},Object(a.__)("Cancel",'woocommerce')),Object(c.createElement)(s.Button,{isPrimary:!0,onClick:()=>{Number.isInteger(r)?(d(!1),e(r,i)):b(!0)},name:"send"},Object(a.__)("Send",'woocommerce')))):null}m.propTypes={recordScoreCallback:n.a.func.isRequired,label:n.a.string.isRequired};var b=m;const f=()=>{};function d({recordScoreCallback:e,label:t,createNotice:o,onNoticeShownCallback:r=f,onNoticeDismissedCallback:n=f,onModalShownCallback:i=f,icon:l}){const[s,u]=Object(c.useState)(!0),[m,d]=Object(c.useState)(!1);return Object(c.useEffect)(()=>{s&&(o("success",t,{actions:[{label:Object(a.__)("Give feedback",'woocommerce'),onClick:()=>{d(!0),i()}}],icon:l,explicitDismiss:!0,onDismiss:n}),u(!1),r())},[s]),s?null:m?Object(c.createElement)(b,{label:t,recordScoreCallback:e}):null}d.propTypes={recordScoreCallback:n.a.func.isRequired,label:n.a.string.isRequired,createNotice:n.a.func.isRequired,onNoticeShownCallback:n.a.func,onNoticeDismissedCallback:n.a.func,onModalShownCallback:n.a.func,icon:n.a.element};t.default=Object(i.compose)(Object(l.withDispatch)(e=>{const{createNotice:t}=e("core/notices2");return{createNotice:t}}))(d)},47:function(e,t,o){"use strict";var c=o(48);function r(){}function n(){}n.resetWarningCache=r,e.exports=function(){function e(e,t,o,r,n,a){if(a!==c){var i=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw i.name="Invariant Violation",i}}function t(){return e}e.isRequired=e;var o={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:n,resetWarningCache:r};return o.PropTypes=o,o}},48:function(e,t,o){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},7:function(e,t){e.exports=window.wp.data}});woocommerce-admin/dist/analytics-report-categories/style-rtl.css000064400000003031151335517650021220 0ustar00:root{--wp-admin-theme-color:#007cba;--wp-admin-theme-color-darker-10:#006ba1;--wp-admin-theme-color-darker-20:#005a87}body.admin-color-light{--wp-admin-theme-color:#0085ba;--wp-admin-theme-color-darker-10:#0073a1;--wp-admin-theme-color-darker-20:#006187}body.admin-color-modern{--wp-admin-theme-color:#3858e9;--wp-admin-theme-color-darker-10:#2145e6;--wp-admin-theme-color-darker-20:#183ad6}body.admin-color-blue{--wp-admin-theme-color:#096484;--wp-admin-theme-color-darker-10:#07526c;--wp-admin-theme-color-darker-20:#064054}body.admin-color-coffee{--wp-admin-theme-color:#46403c;--wp-admin-theme-color-darker-10:#383330;--wp-admin-theme-color-darker-20:#2b2724}body.admin-color-ectoplasm{--wp-admin-theme-color:#523f6d;--wp-admin-theme-color-darker-10:#46365d;--wp-admin-theme-color-darker-20:#3a2c4d}body.admin-color-midnight{--wp-admin-theme-color:#e14d43;--wp-admin-theme-color-darker-10:#dd382d;--wp-admin-theme-color-darker-20:#d02c21}body.admin-color-ocean{--wp-admin-theme-color:#627c83;--wp-admin-theme-color-darker-10:#576e74;--wp-admin-theme-color-darker-20:#4c6066}body.admin-color-sunrise{--wp-admin-theme-color:#dd823b;--wp-admin-theme-color-darker-10:#d97426;--wp-admin-theme-color-darker-20:#c36922}.woocommerce-table__product-categories>.woocommerce-table__breadcrumbs{display:inline-block;margin-left:12px}.woocommerce-table__product-categories .components-popover__content{padding:0 16px;text-align:right}.woocommerce-table__product-categories .components-popover__content .woocommerce-table__breadcrumbs{margin-top:12px;margin-bottom:12px}woocommerce-admin/dist/notices/index.js000064400000005003151335517650014236 0ustar00this.wc=this.wc||{},this.wc.notices=function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(r,i,function(e){return t[e]}.bind(null,i));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=465)}({127:function(t,e){t.exports=window.wp.notices},4:function(t,e){t.exports=window.lodash},465:function(t,e,n){"use strict";n.r(e);var r={};n.r(r),n.d(r,"createNotice",(function(){return f})),n.d(r,"createSuccessNotice",(function(){return a})),n.d(r,"createInfoNotice",(function(){return l})),n.d(r,"createErrorNotice",(function(){return d})),n.d(r,"createWarningNotice",(function(){return p})),n.d(r,"removeNotice",(function(){return b}));var i={};n.r(i),n.d(i,"getNotices",(function(){return O}));n(127);var o=n(7),c=n(4);var u=(t=>e=>(n={},r)=>{const i=r[t];if(void 0===i)return n;const o=e(n[i],r);return o===n[i]?n:{...n,[i]:o}})("context")((t=[],e)=>{switch(e.type){case"CREATE_NOTICE":return[...Object(c.reject)(t,{id:e.notice.id}),e.notice];case"REMOVE_NOTICE":return Object(c.reject)(t,{id:e.id})}return t});const s="global";function f(t="info",e,n={}){const{speak:r=!0,isDismissible:i=!0,context:o=s,id:u=Object(c.uniqueId)(o),actions:f=[],type:a="default",__unstableHTML:l,icon:d=null,explicitDismiss:p=!1,onDismiss:b=null}=n;return{type:"CREATE_NOTICE",context:o,notice:{id:u,status:t,content:e=String(e),spokenMessage:r?e:null,__unstableHTML:l,isDismissible:i,actions:f,type:a,icon:d,explicitDismiss:p,onDismiss:b}}}function a(t,e){return f("success",t,e)}function l(t,e){return f("info",t,e)}function d(t,e){return f("error",t,e)}function p(t,e){return f("warning",t,e)}function b(t,e=s){return{type:"REMOVE_NOTICE",id:t,context:e}}const y=[];function O(t,e=s){return t[e]||y}Object(o.registerStore)("core/notices2",{reducer:u,actions:r,selectors:i})},7:function(t,e){t.exports=window.wp.data}});woocommerce-admin/dist/notices/index.asset.php000064400000000200151335517650015521 0ustar00<?php return array('dependencies' => array('lodash', 'wp-data', 'wp-notices'), 'version' => '9e38645ebce85f6aeaa25fe769d2ea5a');woocommerce-admin/dist/onboarding/style-rtl.css000064400000005233151335517650015725 0ustar00:root{--wp-admin-theme-color:#007cba;--wp-admin-theme-color-darker-10:#006ba1;--wp-admin-theme-color-darker-20:#005a87}body.admin-color-light{--wp-admin-theme-color:#0085ba;--wp-admin-theme-color-darker-10:#0073a1;--wp-admin-theme-color-darker-20:#006187}body.admin-color-modern{--wp-admin-theme-color:#3858e9;--wp-admin-theme-color-darker-10:#2145e6;--wp-admin-theme-color-darker-20:#183ad6}body.admin-color-blue{--wp-admin-theme-color:#096484;--wp-admin-theme-color-darker-10:#07526c;--wp-admin-theme-color-darker-20:#064054}body.admin-color-coffee{--wp-admin-theme-color:#46403c;--wp-admin-theme-color-darker-10:#383330;--wp-admin-theme-color-darker-20:#2b2724}body.admin-color-ectoplasm{--wp-admin-theme-color:#523f6d;--wp-admin-theme-color-darker-10:#46365d;--wp-admin-theme-color-darker-20:#3a2c4d}body.admin-color-midnight{--wp-admin-theme-color:#e14d43;--wp-admin-theme-color-darker-10:#dd382d;--wp-admin-theme-color-darker-20:#d02c21}body.admin-color-ocean{--wp-admin-theme-color:#627c83;--wp-admin-theme-color-darker-10:#576e74;--wp-admin-theme-color-darker-20:#4c6066}body.admin-color-sunrise{--wp-admin-theme-color:#dd823b;--wp-admin-theme-color-darker-10:#d97426;--wp-admin-theme-color-darker-20:#c36922}.woocommerce-task-payments .woocommerce-task-payment-wcpay .woocommerce-task-payment-wcpay__description{font-size:16px;margin-bottom:24px}.woocommerce-task-payments .woocommerce-task-payment-wcpay .components-card__header{margin-bottom:12px;justify-content:flex-start;padding:25px}.woocommerce-task-payments .woocommerce-task-payment-wcpay .components-card__header .woocommerce-pill{margin-right:12px}.woocommerce-task-payments .woocommerce-task-payment-wcpay .components-card__footer{flex-direction:column;align-items:flex-start}.woocommerce-task-payments .woocommerce-task-payment-wcpay .components-card__footer .components-button{margin-top:16px;margin-right:0}.woocommerce-task-payments .woocommerce-task-payment-wcpay .components-card__body h2{margin:0 0 20px}.woocommerce-task-payments .woocommerce-task-payment-wcpay .woocommerce-task-payment-wcpay__accepted{display:flex;margin-top:12px;flex-wrap:wrap;gap:12px}.woocommerce-task-payments .woocommerce-task-payment-wcpay .woocommerce-task-payment-wcpay__accepted h3{color:#40464d}.woocommerce-task-payment__recommended-ribbon{transform:rotate(45deg) translate(50%,-50%);background:#2c3338;color:#fff;font-size:11px;line-height:20px;position:absolute;top:0;right:0;line-height:1;padding:7px 40px;transform-origin:top right;margin-top:32px;margin-right:32px}.woocommerce-task-payment__recommended-ribbon span{max-width:70px}@media(max-width:600px){.woocommerce-task-payment__recommended-ribbon{margin-top:24px;margin-right:24px;font-size:9px}}woocommerce-admin/dist/onboarding/index.js000064400000534606151335517650014734 0ustar00this.wc=this.wc||{},this.wc.onboarding=function(C){var H={};function e(L){if(H[L])return H[L].exports;var t=H[L]={i:L,l:!1,exports:{}};return C[L].call(t.exports,t,t.exports,e),t.l=!0,t.exports}return e.m=C,e.c=H,e.d=function(C,H,L){e.o(C,H)||Object.defineProperty(C,H,{enumerable:!0,get:L})},e.r=function(C){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(C,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(C,"__esModule",{value:!0})},e.t=function(C,H){if(1&H&&(C=e(C)),8&H)return C;if(4&H&&"object"==typeof C&&C&&C.__esModule)return C;var L=Object.create(null);if(e.r(L),Object.defineProperty(L,"default",{enumerable:!0,value:C}),2&H&&"string"!=typeof C)for(var t in C)e.d(L,t,function(H){return C[H]}.bind(null,t));return L},e.n=function(C){var H=C&&C.__esModule?function(){return C.default}:function(){return C};return e.d(H,"a",H),H},e.o=function(C,H){return Object.prototype.hasOwnProperty.call(C,H)},e.p="",e(e.s=271)}({0:function(C,H){C.exports=window.wp.element},2:function(C,H){C.exports=window.wp.i18n},20:function(C,H){C.exports=window.wc.experimental},21:function(C,H){C.exports=window.wc.components},271:function(C,H,e){"use strict";e.r(H),e.d(H,"WCPayCardHeader",(function(){return b})),e.d(H,"WCPayCardBody",(function(){return Z})),e.d(H,"WCPayCardFooter",(function(){return v})),e.d(H,"WCPayCard",(function(){return O})),e.d(H,"RecommendedRibbon",(function(){return s})),e.d(H,"SetupRequired",(function(){return w})),e.d(H,"WCPayAcceptedMethods",(function(){return h})),e.d(H,"Visa",(function(){return i})),e.d(H,"MasterCard",(function(){return d})),e.d(H,"Amex",(function(){return a})),e.d(H,"ApplePay",(function(){return o})),e.d(H,"GooglePay",(function(){return R})),e.d(H,"WCPayLogo",(function(){return M})),e.d(H,"WooPaymentGatewaySetup",(function(){return g})),e.d(H,"WooPaymentGatewayConfigure",(function(){return x})),e.d(H,"WooOnboardingTask",(function(){return F})),e.d(H,"WooOnboardingTaskListItem",(function(){return _}));var L=e(3),t=e(20),l=e(0),n=e(21),c=e(2),i=()=>Object(l.createElement)("svg",{width:"51",height:"35",viewBox:"0 0 51 35",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Object(l.createElement)("rect",{x:"0.5",y:"0.5",width:"50",height:"34",rx:"3.5",fill:"white",stroke:"#F3F3F3"}),Object(l.createElement)("path",{d:"M22.6435 24.004H19.248L21.3718 11.7534H24.7671L22.6435 24.004Z",fill:"#15195A"}),Object(l.createElement)("path",{d:"M34.952 12.0528C34.2823 11.8049 33.22 11.5312 31.9066 11.5312C28.5534 11.5312 26.1922 13.1993 26.1777 15.5842C26.1499 17.3437 27.8683 18.321 29.1536 18.9077C30.4672 19.5072 30.9138 19.8985 30.9138 20.4329C30.9004 21.2536 29.8522 21.6319 28.8747 21.6319C27.5191 21.6319 26.7927 21.4369 25.6889 20.9803L25.2417 20.7845L24.7666 23.5345C25.563 23.873 27.0302 24.1733 28.5534 24.1865C32.1162 24.1865 34.4356 22.5442 34.4631 20.0028C34.4767 18.6082 33.5693 17.5396 31.613 16.6665C30.4254 16.1059 29.6981 15.728 29.6981 15.1544C29.7121 14.6331 30.3133 14.099 31.6539 14.099C32.7577 14.0729 33.5687 14.3204 34.1831 14.5681L34.4902 14.6982L34.952 12.0528Z",fill:"#15195A"}),Object(l.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M41.0301 11.7534H43.6565L46.3957 24.0039H43.2519C43.2519 24.0039 42.9442 22.5963 42.8467 22.1662H38.4873C38.3612 22.4919 37.7747 24.0039 37.7747 24.0039H34.2119L39.2554 12.7699C39.6049 11.9748 40.2202 11.7534 41.0301 11.7534ZM40.8208 16.2365C40.8208 16.2365 39.7448 18.9603 39.4652 19.6641H42.2875C42.1478 19.0516 41.5048 16.1192 41.5048 16.1192L41.2676 15.0636C41.1676 15.3355 41.0231 15.7092 40.9256 15.9612C40.8596 16.1321 40.8151 16.2471 40.8208 16.2365Z",fill:"#15195A"}),Object(l.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M4.53636 11.7534H9.99929C10.7398 11.7792 11.3406 12.0008 11.5361 12.7832L12.7233 18.4113C12.7234 18.4118 12.7236 18.4124 12.7238 18.4129L13.0871 20.1072L16.4124 11.7534H20.0028L14.6657 23.991H11.0752L8.04881 13.3464C7.00461 12.7769 5.81289 12.3188 4.48047 12.0009L4.53636 11.7534Z",fill:"#15195A"})),d=()=>Object(l.createElement)("svg",{width:"51",height:"35",viewBox:"0 0 51 35",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Object(l.createElement)("rect",{x:"0.5",y:"0.5",width:"50",height:"34",rx:"3.5",fill:"white",stroke:"#F3F3F3"}),Object(l.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M18.6846 27.0292V28.3215V29.6137H18.1154V29.2999C17.9349 29.5327 17.661 29.6787 17.2886 29.6787C16.5546 29.6787 15.9791 29.1112 15.9791 28.3215C15.9791 27.5324 16.5546 26.9642 17.2886 26.9642C17.661 26.9642 17.9349 27.1103 18.1154 27.343V27.0292H18.6846ZM17.3594 27.494C16.8667 27.494 16.5652 27.8672 16.5652 28.3215C16.5652 28.7757 16.8667 29.1489 17.3594 29.1489C17.8302 29.1489 18.148 28.7918 18.148 28.3215C18.148 27.8511 17.8302 27.494 17.3594 27.494ZM37.9186 28.3215C37.9186 27.8672 38.2201 27.494 38.7128 27.494C39.1842 27.494 39.5014 27.8511 39.5014 28.3215C39.5014 28.7918 39.1842 29.1489 38.7128 29.1489C38.2201 29.1489 37.9186 28.7757 37.9186 28.3215ZM40.0386 25.9913V28.3215V29.6137H39.4688V29.2999C39.2882 29.5327 39.0143 29.6787 38.642 29.6787C37.9079 29.6787 37.3325 29.1112 37.3325 28.3215C37.3325 27.5324 37.9079 26.9642 38.642 26.9642C39.0143 26.9642 39.2882 27.1103 39.4688 27.343V25.9913H40.0386ZM25.7496 27.4674C26.1163 27.4674 26.352 27.6945 26.4122 28.0943H25.0538C25.1146 27.7211 25.3441 27.4674 25.7496 27.4674ZM24.4571 28.3215C24.4571 27.5157 24.9937 26.9642 25.7609 26.9642C26.4943 26.9642 26.9983 27.5157 27.0039 28.3215C27.0039 28.397 26.9983 28.4675 26.9926 28.5375L25.0488 28.5375C25.1309 29.0029 25.465 29.1706 25.8317 29.1706C26.0944 29.1706 26.374 29.0728 26.5933 28.9001L26.8723 29.3167C26.5545 29.5815 26.1934 29.6787 25.7991 29.6787C25.0156 29.6787 24.4571 29.1434 24.4571 28.3215ZM32.6337 28.3215C32.6337 27.8672 32.9353 27.494 33.4279 27.494C33.8987 27.494 34.2165 27.8511 34.2165 28.3215C34.2165 28.7918 33.8987 29.1489 33.4279 29.1489C32.9353 29.1489 32.6337 28.7757 32.6337 28.3215ZM34.7529 27.0292V28.3215V29.6137H34.1837V29.2999C34.0026 29.5327 33.7293 29.6787 33.3569 29.6787C32.6229 29.6787 32.0475 29.1112 32.0475 28.3215C32.0475 27.5324 32.6229 26.9642 33.3569 26.9642C33.7293 26.9642 34.0026 27.1103 34.1837 27.343V27.0292H34.7529ZM29.4191 28.3215C29.4191 29.1056 29.972 29.6787 30.8157 29.6787C31.21 29.6787 31.4726 29.5921 31.7572 29.3705L31.4839 28.9162C31.2701 29.0679 31.0457 29.1489 30.7988 29.1489C30.3443 29.1434 30.0102 28.8191 30.0102 28.3215C30.0102 27.8239 30.3443 27.4996 30.7988 27.494C31.0457 27.494 31.2701 27.5751 31.4839 27.7267L31.7572 27.2724C31.4726 27.0509 31.21 26.9642 30.8157 26.9642C29.972 26.9642 29.4191 27.5373 29.4191 28.3215ZM36.0674 27.3431C36.2153 27.1159 36.4291 26.9643 36.7575 26.9643C36.8729 26.9643 37.0371 26.986 37.1631 27.0349L36.9876 27.5646C36.8672 27.5157 36.7469 27.4997 36.6315 27.4997C36.2592 27.4997 36.073 27.7373 36.073 28.165V29.6138H35.5032V27.0293H36.0674V27.3431ZM21.4996 27.2347C21.2257 27.0564 20.8483 26.9642 20.4321 26.9642C19.7689 26.9642 19.342 27.278 19.342 27.7917C19.342 28.2132 19.6599 28.4731 20.2453 28.5542L20.5142 28.5919C20.8264 28.6352 20.9737 28.7163 20.9737 28.8624C20.9737 29.0623 20.7656 29.1762 20.377 29.1762C19.9827 29.1762 19.6981 29.0518 19.5063 28.9057L19.238 29.3433C19.5502 29.5704 19.9444 29.6787 20.3713 29.6787C21.1273 29.6787 21.5654 29.3272 21.5654 28.8352C21.5654 28.3809 21.2207 28.1432 20.6509 28.0621L20.3826 28.0238C20.1363 27.9916 19.9388 27.9433 19.9388 27.77C19.9388 27.5806 20.125 27.4674 20.4371 27.4674C20.7712 27.4674 21.0947 27.5918 21.2533 27.689L21.4996 27.2347ZM28.1542 27.3431C28.3015 27.1159 28.5152 26.9643 28.8437 26.9643C28.959 26.9643 29.1233 26.986 29.2493 27.0349L29.0738 27.5646C28.9534 27.5157 28.833 27.4997 28.7177 27.4997C28.3454 27.4997 28.1592 27.7373 28.1592 28.165V29.6138H27.59V27.0293L28.1542 27.0293V27.3431ZM23.9862 27.0292H23.0553V26.2451H22.4799V27.0292H21.949V27.5429H22.4799V28.7219C22.4799 29.3216 22.7156 29.6787 23.3888 29.6787C23.6358 29.6787 23.9204 29.6032 24.1009 29.4788L23.9367 28.9973C23.7668 29.0945 23.5806 29.1434 23.4327 29.1434C23.1481 29.1434 23.0553 28.9701 23.0553 28.7108V27.5429H23.9862V27.0292ZM15.4758 27.9917V29.6138H14.9003V28.1755C14.9003 27.7373 14.7142 27.4941 14.3255 27.4941C13.9475 27.4941 13.6849 27.7324 13.6849 28.1811V29.6138H13.1095V28.1755C13.1095 27.7373 12.9183 27.4941 12.5403 27.4941C12.151 27.4941 11.899 27.7324 11.899 28.1811V29.6138H11.3242V27.0293H11.894V27.348C12.1078 27.0454 12.3811 26.9643 12.6606 26.9643C13.0606 26.9643 13.3451 27.1376 13.5257 27.4242C13.767 27.0615 14.1118 26.9587 14.4459 26.9643C15.0815 26.9699 15.4758 27.3808 15.4758 27.9917Z",fill:"#231F20"}),Object(l.createElement)("path",{d:"M29.9381 22.6376H21.3115V7.33105H29.9381V22.6376Z",fill:"#FF5F00"}),Object(l.createElement)("path",{d:"M21.8586 14.9846C21.8586 11.8796 23.331 9.11372 25.624 7.33129C23.9472 6.02789 21.831 5.24994 19.5311 5.24994C14.0864 5.24994 9.67285 9.60822 9.67285 14.9846C9.67285 20.361 14.0864 24.7192 19.5311 24.7192C21.831 24.7192 23.9472 23.9413 25.624 22.6379C23.331 20.8555 21.8586 18.0896 21.8586 14.9846Z",fill:"#EB001B"}),Object(l.createElement)("path",{d:"M41.5758 14.9846C41.5758 20.361 37.1622 24.7192 31.7175 24.7192C29.4177 24.7192 27.3014 23.9413 25.624 22.6379C27.9176 20.8555 29.3901 18.0896 29.3901 14.9846C29.3901 11.8796 27.9176 9.11372 25.624 7.33129C27.3014 6.02789 29.4177 5.24994 31.7175 5.24994C37.1622 5.24994 41.5758 9.60822 41.5758 14.9846Z",fill:"#F79E1B"})),V=()=>Object(l.createElement)("svg",{width:"51",height:"35",viewBox:"0 0 51 35",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Object(l.createElement)("rect",{x:"0.5",y:"0.5",width:"49.6897",height:"34",rx:"3.5",fill:"white",stroke:"#F3F3F3"}),Object(l.createElement)("path",{d:"M29.9708 22.8244H21.3047V7.35352H29.9708V22.8244Z",fill:"#6C6BBD"}),Object(l.createElement)("path",{d:"M21.8549 15.0891C21.8549 11.9507 23.3341 9.15521 25.6375 7.35365C23.9531 6.03626 21.8272 5.24995 19.5168 5.24995C14.0471 5.24995 9.61328 9.65501 9.61328 15.0891C9.61328 20.5232 14.0471 24.9282 19.5168 24.9282C21.8272 24.9282 23.9531 24.1419 25.6375 22.8245C23.3341 21.023 21.8549 18.2274 21.8549 15.0891Z",fill:"#EB001B"}),Object(l.createElement)("path",{d:"M41.6626 15.0891C41.6626 20.5232 37.2288 24.9282 31.7591 24.9282C29.4487 24.9282 27.3228 24.1419 25.6377 22.8245C27.9418 21.023 29.421 18.2274 29.421 15.0891C29.421 11.9507 27.9418 9.15521 25.6377 7.35365C27.3228 6.03626 29.4487 5.24995 31.7591 5.24995C37.2288 5.24995 41.6626 9.65501 41.6626 15.0891Z",fill:"#0099DF"}),Object(l.createElement)("path",{d:"M32.9036 27.1956C33.0188 27.1956 33.1845 27.2175 33.311 27.2669L33.1347 27.8024C33.0138 27.753 32.8929 27.7367 32.777 27.7367C32.403 27.7367 32.216 27.9769 32.216 28.4085V29.8735H31.6436V27.2613H32.2103V27.5784C32.3589 27.3489 32.5736 27.1956 32.9036 27.1956Z",fill:"#231F20"}),Object(l.createElement)("path",{d:"M30.7887 27.7807H29.8536V28.9611C29.8536 29.2232 29.9468 29.3984 30.2333 29.3984C30.382 29.3984 30.569 29.3489 30.739 29.2507L30.904 29.7368C30.7226 29.8625 30.4367 29.9395 30.1893 29.9395C29.5123 29.9395 29.2762 29.5785 29.2762 28.9717V27.7807H28.7422V27.2615H29.2762V26.469H29.8536V27.2615H30.7887V27.7807Z",fill:"#231F20"}),Object(l.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M24.1754 27.1958C24.9128 27.1958 25.4191 27.7532 25.4247 28.5676C25.4247 28.6433 25.4192 28.7135 25.4135 28.7842L25.4134 28.7859H23.4607C23.5432 29.2557 23.8788 29.4252 24.2472 29.4252C24.511 29.4252 24.7919 29.327 25.0116 29.1519L25.2925 29.5729C24.9732 29.8406 24.6105 29.9388 24.2144 29.9388C23.4273 29.9388 22.8662 29.3977 22.8662 28.5676C22.8662 27.7532 23.4052 27.1958 24.1754 27.1958ZM24.1648 27.7036C23.7574 27.7036 23.5269 27.9607 23.4658 28.3379H24.8304C24.77 27.9332 24.5332 27.7036 24.1648 27.7036Z",fill:"#231F20"}),Object(l.createElement)("path",{d:"M27.9386 27.9283C27.7793 27.8295 27.455 27.7038 27.1193 27.7038C26.8057 27.7038 26.6187 27.8189 26.6187 28.0103C26.6187 28.1848 26.8164 28.2342 27.0639 28.2668L27.3334 28.3049C27.9058 28.3875 28.2522 28.6277 28.2522 29.0868C28.2522 29.5841 27.812 29.9395 27.0532 29.9395C26.6237 29.9395 26.2277 29.83 25.9141 29.6004L26.1836 29.1575C26.3763 29.3052 26.6628 29.4309 27.0589 29.4309C27.4493 29.4309 27.6584 29.3164 27.6584 29.1137C27.6584 28.9667 27.5098 28.8842 27.1962 28.841L26.9266 28.8028C26.3379 28.7203 26.0186 28.4582 26.0186 28.0322C26.0186 27.513 26.4481 27.1958 27.1137 27.1958C27.5318 27.1958 27.9115 27.289 28.1861 27.4692L27.9386 27.9283Z",fill:"#231F20"}),Object(l.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M35.561 27.3015C35.3872 27.2308 35.1982 27.1958 34.9942 27.1958C34.7902 27.1958 34.6013 27.2308 34.4275 27.3015C34.2537 27.3716 34.1044 27.4685 33.9785 27.5918C33.8526 27.715 33.7537 27.8608 33.6819 28.0284C33.6101 28.1967 33.5742 28.3793 33.5742 28.5764C33.5742 28.7734 33.6101 28.9561 33.6819 29.1243C33.7537 29.292 33.8526 29.4384 33.9785 29.5616C34.1044 29.6848 34.2537 29.7812 34.4275 29.8519C34.6013 29.9219 34.7902 29.9569 34.9942 29.9569C35.1982 29.9569 35.3872 29.9219 35.561 29.8519C35.7348 29.7812 35.8853 29.6848 36.0118 29.5616C36.139 29.4384 36.2379 29.292 36.3097 29.1243C36.3815 28.9561 36.4174 28.7734 36.4174 28.5764C36.4174 28.3793 36.3815 28.1967 36.3097 28.0284C36.2379 27.8608 36.139 27.715 36.0118 27.5918C35.8853 27.4685 35.7348 27.3716 35.561 27.3015ZM34.666 27.7969C34.7674 27.7563 34.8763 27.7356 34.9941 27.7356C35.1118 27.7356 35.2214 27.7563 35.3221 27.7969C35.4235 27.8382 35.5117 27.8958 35.5854 27.9696C35.6603 28.0434 35.7182 28.1322 35.761 28.2354C35.8032 28.3386 35.824 28.4525 35.824 28.5763C35.824 28.7008 35.8032 28.8141 35.761 28.9173C35.7182 29.0205 35.6603 29.1093 35.5854 29.1831C35.5117 29.2569 35.4235 29.3145 35.3221 29.3558C35.2214 29.3971 35.1118 29.4171 34.9941 29.4171C34.8763 29.4171 34.7674 29.3971 34.666 29.3558C34.5652 29.3145 34.4777 29.2569 34.404 29.1831C34.3303 29.1093 34.2724 29.0205 34.2302 28.9173C34.188 28.8141 34.1672 28.7008 34.1672 28.5763C34.1672 28.4525 34.188 28.3386 34.2302 28.2354C34.2724 28.1322 34.3303 28.0434 34.404 27.9696C34.4777 27.8958 34.5652 27.8382 34.666 27.7969Z",fill:"#231F20"}),Object(l.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M22.2524 27.2615V28.5676V29.8737H21.6806V29.5566C21.4986 29.7918 21.224 29.9394 20.85 29.9394C20.1126 29.9394 19.5352 29.3652 19.5352 28.5676C19.5352 27.7694 20.1126 27.1958 20.85 27.1958C21.224 27.1958 21.4986 27.3434 21.6806 27.5786V27.2615H22.2524ZM20.9211 27.7312C20.4262 27.7312 20.1233 28.1084 20.1233 28.5675C20.1233 29.0267 20.4262 29.4033 20.9211 29.4033C21.394 29.4033 21.7133 29.0429 21.7133 28.5675C21.7133 28.0921 21.394 27.7312 20.9211 27.7312Z",fill:"#231F20"}),Object(l.createElement)("path",{d:"M19.0293 29.8735V28.234C19.0293 27.6166 18.6332 27.2012 17.9953 27.1956C17.6597 27.19 17.3127 27.2938 17.0709 27.6604C16.8896 27.3707 16.603 27.1956 16.2013 27.1956C15.9211 27.1956 15.6459 27.2775 15.4312 27.5834V27.2613H14.8594V29.8735H15.4368V28.4254C15.4368 27.9719 15.69 27.7311 16.0804 27.7311C16.4601 27.7311 16.6528 27.9769 16.6528 28.4198V29.8735H17.2302V28.4254C17.2302 27.9719 17.4947 27.7311 17.8738 27.7311C18.2649 27.7311 18.4519 27.9769 18.4519 28.4198V29.8735H19.0293V29.8735Z",fill:"#231F20"})),a=()=>Object(l.createElement)("svg",{width:"52",height:"35",viewBox:"0 0 52 35",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Object(l.createElement)("rect",{x:"1.18945",y:"0.5",width:"50",height:"34",rx:"3.5",fill:"#006FCF",stroke:"#F3F3F3"}),Object(l.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11.1205 25.2823V18.0771H19.3189L20.1985 19.1441L21.1072 18.0771H50.8653V24.7854C50.8653 24.7854 50.0871 25.2751 49.187 25.2823H32.7093L31.7176 24.1465V25.2823H28.4679V23.3435C28.4679 23.3435 28.0239 23.6141 27.0642 23.6141H25.9581V25.2823H21.0376L20.1593 24.1924L19.2675 25.2823H11.1205ZM1.56836 12.6465L3.41294 8.63574H6.60294L7.64976 10.8824V8.63574H11.6152L12.2384 10.2596L12.8425 8.63574H30.6434V9.4521C30.6434 9.4521 31.5792 8.63574 33.1171 8.63574L38.8928 8.65457L39.9215 10.8718V8.63574H43.24L44.1534 9.90939V8.63574H47.5023V15.841H44.1534L43.2781 14.5632V15.841H38.4025L37.9121 14.7052H36.6014L36.1191 15.841H32.8126C31.4893 15.841 30.6434 15.0413 30.6434 15.0413V15.841H25.658L24.6685 14.7052V15.841H6.13036L5.64039 14.7052H4.33383L3.84732 15.841H1.56836V12.6465ZM1.5779 14.9189L4.06583 9.52391H5.95199L8.43755 14.9189H6.7821L6.32542 13.8386H3.65672L3.19767 14.9189H1.5779ZM5.79982 12.6674L4.98636 10.7795L4.17053 12.6674H5.79982ZM8.60869 14.9182V9.52317L10.9105 9.53115L12.2493 13.0095L13.556 9.52317H15.8394V14.9182H14.3933V10.9429L12.8603 14.9182H11.592L10.0548 10.9429V14.9182H8.60869ZM16.8289 14.9182V9.52317H21.5479V10.73H18.2902V11.6528H21.4717V12.7886H18.2902V13.7469H21.5479V14.9182H16.8289ZM22.3851 14.9189V9.52391H25.6033C26.6696 9.52391 27.625 10.1389 27.625 11.2742C27.625 12.2447 26.8195 12.8698 26.0385 12.9313L27.9413 14.9189H26.1741L24.4402 13.0023H23.8313V14.9189H22.3851ZM25.4843 10.7306H23.8313V11.8664H25.5057C25.7956 11.8664 26.1694 11.6569 26.1694 11.2985C26.1694 11.0199 25.8809 10.7306 25.4843 10.7306ZM29.692 14.9182H28.2154V9.52317H29.692V14.9182ZM33.1931 14.9182H32.8744C31.3323 14.9182 30.396 13.7851 30.396 12.2429C30.396 10.6626 31.3218 9.52317 33.2692 9.52317H34.8676V10.8009H33.2108C32.4202 10.8009 31.8611 11.3763 31.8611 12.2562C31.8611 13.301 32.5004 13.7398 33.4215 13.7398H33.802L33.1931 14.9182ZM33.8521 14.9189L36.34 9.52391H38.2262L40.7117 14.9189H39.0563L38.5996 13.8386H35.9309L35.4719 14.9189H33.8521ZM38.074 12.6674L37.2605 10.7795L36.4447 12.6674H38.074ZM40.8805 14.9182V9.52317H42.7191L45.0667 12.9128V9.52317H46.5128V14.9182H44.7337L42.3267 11.4398V14.9182H40.8805ZM12.1099 24.3594V18.9643H16.8289V20.1711H13.5713V21.0939H16.7528V22.2297H13.5713V23.1881H16.8289V24.3594H12.1099ZM35.2329 24.3594V18.9643H39.9519V20.1711H36.6943V21.0939H39.8606V22.2297H36.6943V23.1881H39.9519V24.3594H35.2329ZM17.0121 24.3594L19.3097 21.6951L16.9574 18.9643H18.7793L20.1803 20.6525L21.586 18.9643H23.3366L21.0151 21.6618L23.317 24.3594H21.4953L20.1351 22.6978L18.8079 24.3594H17.0121ZM23.4887 24.3603V18.9653H26.6831C27.9938 18.9653 28.7595 19.7531 28.7595 20.7799C28.7595 22.0193 27.7832 22.6566 26.4952 22.6566H24.9729V24.3603H23.4887ZM26.5761 20.1853H24.973V21.4276H26.5714C26.9937 21.4276 27.2897 21.1665 27.2897 20.8064C27.2897 20.4232 26.9922 20.1853 26.5761 20.1853ZM29.3875 24.3594V18.9643H32.6056C33.672 18.9643 34.6274 19.5793 34.6274 20.7146C34.6274 21.6851 33.8218 22.3102 33.0409 22.3717L34.9437 24.3594H33.1765L31.4426 22.4427H30.8337V24.3594H29.3875ZM32.4867 20.171H30.8337V21.3068H32.5082C32.798 21.3068 33.1718 21.0974 33.1718 20.7389C33.1718 20.4603 32.8833 20.171 32.4867 20.171ZM40.6217 24.3594V23.1881H43.5159C43.9441 23.1881 44.1295 22.9722 44.1295 22.7355C44.1295 22.5087 43.9447 22.2794 43.5159 22.2794H42.208C41.0712 22.2794 40.4381 21.6334 40.4381 20.6636C40.4381 19.7985 41.0178 18.9643 42.7072 18.9643H45.5233L44.9144 20.1782H42.4788C42.0132 20.1782 41.8699 20.4061 41.8699 20.6237C41.8699 20.8473 42.047 21.0939 42.4027 21.0939H43.7727C45.04 21.0939 45.5899 21.7644 45.5899 22.6424C45.5899 23.5863 44.9772 24.3594 43.7038 24.3594H40.6217ZM45.7176 24.3594V23.1881H48.6118C49.04 23.1881 49.2254 22.9722 49.2254 22.7355C49.2254 22.5087 49.0406 22.2794 48.6118 22.2794H47.3039C46.1671 22.2794 45.534 21.6334 45.534 20.6636C45.534 19.7985 46.1138 18.9643 47.8031 18.9643H50.6192L50.0103 20.1782H47.5747C47.1092 20.1782 46.9658 20.4061 46.9658 20.6237C46.9658 20.8473 47.1429 21.0939 47.4986 21.0939H48.8687C50.1359 21.0939 50.6858 21.7644 50.6858 22.6424C50.6858 23.5863 50.0731 24.3594 48.7997 24.3594H45.7176Z",fill:"white"})),o=()=>Object(l.createElement)("svg",{width:"52",height:"35",viewBox:"0 0 52 35",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Object(l.createElement)("rect",{x:"0.878906",y:"0.5",width:"50",height:"34",rx:"3.5",fill:"white",stroke:"#F3F3F3"}),Object(l.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M15.8352 13.0607C15.4642 13.5024 14.8707 13.8507 14.2771 13.8009C14.2029 13.2038 14.4935 12.5693 14.8336 12.1774C15.2045 11.7233 15.8537 11.3999 16.3792 11.375C16.4411 11.997 16.1999 12.6066 15.8352 13.0607ZM16.373 13.9192C15.8501 13.8889 15.373 14.0774 14.9876 14.2297C14.7396 14.3277 14.5296 14.4106 14.3698 14.4106C14.1905 14.4106 13.9718 14.3232 13.7263 14.2251C13.4046 14.0965 13.0367 13.9495 12.651 13.9565C11.7669 13.969 10.9446 14.4728 10.4933 15.2753C9.56588 16.8801 10.2522 19.2563 11.1486 20.5626C11.5876 21.2095 12.1131 21.9186 12.8056 21.8937C13.1102 21.8822 13.3294 21.7886 13.5562 21.6918C13.8173 21.5803 14.0885 21.4645 14.512 21.4645C14.9208 21.4645 15.1802 21.5773 15.4292 21.6856C15.6659 21.7885 15.8933 21.8874 16.2308 21.8813C16.948 21.8689 17.3993 21.2344 17.8383 20.5875C18.312 19.8931 18.5202 19.2155 18.5518 19.1127L18.5555 19.1008C18.5547 19.1 18.5488 19.0973 18.5385 19.0926C18.3802 19.0196 17.1698 18.4621 17.1582 16.9672C17.1465 15.7124 18.1182 15.0767 18.2712 14.9766L18.2712 14.9766C18.2805 14.9705 18.2868 14.9664 18.2896 14.9642C17.6713 14.0436 16.7068 13.9441 16.373 13.9192ZM21.3377 21.8128V12.1153H24.9546C26.8217 12.1153 28.1263 13.4091 28.1263 15.3001C28.1263 17.1911 26.797 18.4974 24.9051 18.4974H22.8339V21.8128H21.3377ZM22.8339 13.3841H24.5589C25.8572 13.3841 26.5991 14.0808 26.5991 15.3062C26.5991 16.5317 25.8572 17.2346 24.5527 17.2346H22.8339V13.3841ZM33.0661 20.6496C32.6704 21.4085 31.7986 21.8874 30.8589 21.8874C29.4678 21.8874 28.4971 21.0539 28.4971 19.7974C28.4971 18.5533 29.4368 17.838 31.1742 17.7322L33.0413 17.6203V17.0853C33.0413 16.2953 32.5282 15.8661 31.6131 15.8661C30.8589 15.8661 30.3086 16.258 30.1973 16.8552H28.8495C28.8928 15.5986 30.0675 14.6842 31.6564 14.6842C33.369 14.6842 34.4819 15.5862 34.4819 16.9858V21.8128H33.097V20.6496H33.0661ZM31.2609 20.7368C30.4633 20.7368 29.9563 20.3511 29.9563 19.7602C29.9563 19.1506 30.4448 18.796 31.3784 18.74L33.0415 18.6343V19.1817C33.0415 20.0898 32.2748 20.7368 31.2609 20.7368ZM39.0756 22.1922C38.4759 23.8903 37.7897 24.4502 36.3306 24.4502C36.2193 24.4502 35.8483 24.4377 35.7617 24.4129V23.2496C35.8545 23.2621 36.0832 23.2745 36.2007 23.2745C36.8623 23.2745 37.2332 22.9946 37.462 22.2668L37.598 21.8376L35.0631 14.7775H36.6273L38.3894 20.5065H38.4203L40.1823 14.7775H41.7033L39.0756 22.1922Z",fill:"black"})),r=()=>Object(l.createElement)("svg",{width:"52",height:"35",viewBox:"0 0 52 35",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Object(l.createElement)("rect",{x:"1.18945",y:"0.5",width:"49.6897",height:"34",rx:"2.5",fill:"url(#paint0_linear)",stroke:"#F1F1F1"}),Object(l.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M19.7636 16.9816H26.6269C26.5657 15.4963 26.2201 13.9649 25.1717 12.9813C23.9229 11.8096 21.7355 11.375 19.781 11.375C17.7466 11.375 15.4968 11.8517 14.2414 13.1088C13.1588 14.1918 12.9248 15.9341 12.9248 17.4997C12.9248 19.1395 13.3827 21.0469 14.5571 22.1456C15.8059 23.3147 17.8294 23.625 19.781 23.625C21.6767 23.625 23.7302 23.2746 24.9718 22.1647C26.2099 21.0561 26.6377 19.1888 26.6377 17.4997V17.4918H19.7636V16.9816ZM27.0876 17.4921V23.3511H36.6352V23.3432C38.0322 23.267 39.1436 22.0059 39.1436 20.4575C39.1436 18.9084 38.0322 17.5664 36.6352 17.4895V17.4921H27.0876ZM36.5263 11.6203C37.8879 11.6203 38.9687 12.8032 38.9687 14.2957C38.9687 15.7087 37.9762 16.8626 36.7135 16.9816H27.0873V11.6118H36.2251C36.2813 11.6049 36.3468 11.6097 36.4108 11.6144C36.4508 11.6174 36.4901 11.6203 36.5263 11.6203Z",fill:"#FEFEFE"}),Object(l.createElement)("defs",null,Object(l.createElement)("linearGradient",{id:"paint0_linear",x1:"14.4385",y1:"-4.43215",x2:"2.09335",y2:"33.4202",gradientUnits:"userSpaceOnUse"},Object(l.createElement)("stop",{stopColor:"#222E72"}),Object(l.createElement)("stop",{offset:"0.591647",stopColor:"#40CBFF"}),Object(l.createElement)("stop",{offset:"1",stopColor:"#3CB792"})))),m=()=>Object(l.createElement)("svg",{width:"51",height:"35",viewBox:"0 0 51 35",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Object(l.createElement)("rect",{x:"1.18945",y:"0.5",width:"49",height:"34",rx:"3.5",fill:"white",stroke:"#F3F3F3"}),Object(l.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8.30356 21.1794C8.30356 20.493 7.95026 20.5381 7.6123 20.5309V20.3325C7.90535 20.347 8.20582 20.347 8.49964 20.347C8.8153 20.347 9.24386 20.3325 9.80068 20.3325C11.7479 20.3325 12.8085 21.6523 12.8085 23.0038C12.8085 23.7601 12.3724 25.6602 9.71022 25.6602C9.32704 25.6602 8.97313 25.6451 8.61983 25.6451C8.28172 25.6451 7.95026 25.6521 7.6123 25.6602V25.4616C8.06302 25.4154 8.28172 25.4004 8.30356 24.8815V21.1794ZM9.04049 24.759C9.04049 25.3469 9.4545 25.4153 9.82282 25.4153C11.4476 25.4153 11.9807 24.1715 11.9807 23.0344C11.9807 21.6071 11.0785 20.5769 9.62735 20.5769C9.31835 20.5769 9.17617 20.5992 9.04049 20.6074V24.759Z",fill:"#1A1919"}),Object(l.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M13.0713 25.4613H13.2138C13.4243 25.4613 13.5748 25.4613 13.5748 25.2088V23.1406C13.5748 22.8053 13.4622 22.7589 13.1836 22.6067V22.4849C13.537 22.377 13.9585 22.233 13.9882 22.2101C14.0412 22.1794 14.0856 22.1712 14.1239 22.1712C14.1608 22.1712 14.1762 22.2171 14.1762 22.2788V25.2088C14.1762 25.4613 14.342 25.4613 14.5528 25.4613H14.6801V25.6599C14.4244 25.6599 14.1608 25.6448 13.8909 25.6448C13.6202 25.6448 13.3493 25.6518 13.0713 25.6599V25.4613ZM13.8758 20.9962C13.6799 20.9962 13.5074 20.813 13.5074 20.6146C13.5074 20.4235 13.6881 20.2476 13.8758 20.2476C14.071 20.2476 14.2445 20.4084 14.2445 20.6146C14.2445 20.8211 14.0786 20.9962 13.8758 20.9962Z",fill:"#1A1919"}),Object(l.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M15.3957 23.1866C15.3957 22.9048 15.3126 22.8285 14.9598 22.6833V22.5383C15.2826 22.4316 15.5907 22.3319 15.952 22.1714C15.9748 22.1714 15.9966 22.1866 15.9966 22.2476V22.7439C16.426 22.4316 16.7944 22.1714 17.299 22.1714C17.9373 22.1714 18.1628 22.6447 18.1628 23.2401V25.209C18.1628 25.4614 18.3287 25.4614 18.5391 25.4614H18.6747V25.66C18.4107 25.66 18.1478 25.6449 17.8774 25.6449C17.6065 25.6449 17.3356 25.652 17.0649 25.66V25.4614H17.2005C17.4112 25.4614 17.561 25.4614 17.561 25.209V23.233C17.561 22.7974 17.299 22.5839 16.8699 22.5839C16.629 22.5839 16.2455 22.782 15.9966 22.9507V25.209C15.9966 25.4614 16.1628 25.4614 16.3735 25.4614H16.5085V25.66C16.2455 25.66 15.9822 25.6449 15.711 25.6449C15.4409 25.6449 15.1698 25.652 14.8994 25.66V25.4614H15.0351C15.2454 25.4614 15.3957 25.4614 15.3957 25.209V23.1866Z",fill:"#1A1919"}),Object(l.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M19.2463 23.5536C19.2309 23.6223 19.2309 23.7366 19.2463 23.9963C19.2906 24.7212 19.7503 25.3162 20.3512 25.3162C20.7654 25.3162 21.0889 25.0871 21.3666 24.8053L21.4716 24.9122C21.1256 25.3777 20.6972 25.7748 20.0811 25.7748C18.8851 25.7748 18.6445 24.5987 18.6445 24.1106C18.6445 22.6144 19.6369 22.1714 20.1627 22.1714C20.7725 22.1714 21.4272 22.5606 21.4342 23.3699C21.4342 23.4163 21.4342 23.4616 21.4272 23.5075L21.3592 23.5536H19.2463ZM20.5777 23.309C20.7653 23.309 20.7873 23.2097 20.7873 23.1177C20.7873 22.7291 20.5544 22.4161 20.1331 22.4161C19.6748 22.4161 19.3588 22.759 19.2687 23.309H20.5777Z",fill:"#1A1919"}),Object(l.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M21.6074 25.4614H21.8106C22.0203 25.4614 22.1709 25.4614 22.1709 25.209V23.0646C22.1709 22.8285 21.8929 22.782 21.78 22.721V22.6069C22.3289 22.3701 22.6298 22.1714 22.6986 22.1714C22.7426 22.1714 22.7652 22.1943 22.7652 22.2711V22.9581H22.781C22.9684 22.6605 23.2848 22.1714 23.7433 22.1714C23.9312 22.1714 24.1715 22.3011 24.1715 22.576C24.1715 22.782 24.0294 22.9661 23.8189 22.9661C23.585 22.9661 23.585 22.782 23.3215 22.782C23.1939 22.782 22.7728 22.9581 22.7728 23.4163V25.209C22.7728 25.4614 22.923 25.4614 23.1337 25.4614H23.5543V25.66C23.1408 25.652 22.8261 25.6449 22.5023 25.6449C22.194 25.6449 21.878 25.652 21.6074 25.66V25.4614Z",fill:"#1A1919"}),Object(l.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M24.5026 24.5985C24.6006 25.1022 24.9008 25.5303 25.4508 25.5303C25.8937 25.5303 26.059 25.2552 26.059 24.9882C26.059 24.0871 24.4202 24.3775 24.4202 23.1488C24.4202 22.7208 24.7587 22.1714 25.586 22.1714C25.8262 22.1714 26.1495 22.2406 26.4425 22.3934L26.4953 23.1712H26.3225C26.2473 22.6906 25.9845 22.416 25.5027 22.416C25.2019 22.416 24.9164 22.5913 24.9164 22.9195C24.9164 23.8131 26.6606 23.5378 26.6606 24.7362C26.6606 25.2396 26.2625 25.7746 25.3673 25.7746C25.0668 25.7746 24.7127 25.6675 24.4504 25.5149L24.3672 24.637L24.5026 24.5985Z",fill:"#1A1919"}),Object(l.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M33.4502 21.7134H33.2626C33.1195 20.8213 32.4953 20.4621 31.6537 20.4621C30.7879 20.4621 29.5325 21.0494 29.5325 22.8812C29.5325 24.4236 30.6158 25.5305 31.7736 25.5305C32.5173 25.5305 33.1353 25.0112 33.2854 24.2093L33.4584 24.2549L33.2854 25.3696C32.9696 25.5683 32.1196 25.7748 31.6227 25.7748C29.8638 25.7748 28.751 24.622 28.751 22.9048C28.751 21.3396 30.1271 20.2173 31.601 20.2173C32.2099 20.2173 32.7963 20.4163 33.3754 20.6226L33.4502 21.7134Z",fill:"#1A1919"}),Object(l.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M33.7217 25.461H33.864C34.0753 25.461 34.2254 25.461 34.2254 25.2086V20.9583C34.2254 20.4617 34.1128 20.4466 33.8267 20.3625V20.2402C34.1273 20.1411 34.4434 20.004 34.6017 19.9117C34.6834 19.8666 34.7441 19.8276 34.7662 19.8276C34.8122 19.8276 34.8271 19.874 34.8271 19.9353V25.2086C34.8271 25.461 34.9927 25.461 35.203 25.461H35.3303V25.6596C35.0754 25.6596 34.8122 25.6445 34.5413 25.6445C34.2707 25.6445 34.0003 25.6516 33.7217 25.6596V25.461Z",fill:"#1A1919"}),Object(l.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M38.5497 25.2394C38.5497 25.3773 38.632 25.3846 38.7594 25.3846C38.8502 25.3846 38.9625 25.3773 39.061 25.3773V25.538C38.7374 25.5682 38.1205 25.7285 37.9774 25.7744L37.9399 25.7512V25.1329C37.4892 25.5067 37.1429 25.7744 36.6082 25.7744C36.2023 25.7744 35.7815 25.5067 35.7815 24.8664V22.9118C35.7815 22.7131 35.7516 22.5223 35.3311 22.4847V22.3393C35.6019 22.3317 36.2023 22.2861 36.3003 22.2861C36.3838 22.2861 36.3838 22.3393 36.3838 22.5075V24.4765C36.3838 24.7057 36.3838 25.3614 37.0379 25.3614C37.2931 25.3614 37.6316 25.1635 37.9472 24.8967V22.843C37.9472 22.6905 37.5865 22.6065 37.3162 22.5306V22.3933C37.9923 22.3468 38.4139 22.2861 38.489 22.2861C38.5497 22.2861 38.5497 22.3393 38.5497 22.4235V25.2394Z",fill:"#1A1919"}),Object(l.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M40.0461 22.7206C40.3468 22.4617 40.753 22.171 41.1666 22.171C42.0391 22.171 42.5655 22.9427 42.5655 23.7745C42.5655 24.774 41.8433 25.7744 40.7674 25.7744C40.2116 25.7744 39.9182 25.5906 39.7223 25.5066L39.4974 25.6822L39.3397 25.5986C39.4069 25.1484 39.4449 24.7057 39.4449 24.2398V20.9583C39.4449 20.4617 39.3317 20.4466 39.0459 20.3625V20.2402C39.347 20.1411 39.6625 20.004 39.8203 19.9117C39.9033 19.8666 39.9633 19.8276 39.9862 19.8276C40.031 19.8276 40.0461 19.8742 40.0461 19.9353V22.7206ZM40.0461 24.7968C40.0461 25.0867 40.317 25.5756 40.8207 25.5756C41.6252 25.5756 41.9634 24.774 41.9634 24.0944C41.9634 23.2703 41.3475 22.5835 40.7611 22.5835C40.4816 22.5835 40.249 22.767 40.0461 22.9427V24.7968Z",fill:"#1A1919"}),Object(l.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11.6628 29.4042L11.671 29.3961V27.8391C11.671 27.4982 11.4374 27.4484 11.3148 27.4484H11.2246V27.3237C11.4173 27.3237 11.6055 27.3402 11.7976 27.3402C11.9653 27.3402 12.1338 27.3237 12.3009 27.3237V27.4484H12.2401C12.0677 27.4484 11.8753 27.4816 11.8753 27.9758V29.8655C11.8753 30.0111 11.8793 30.1563 11.8995 30.2852H11.744L9.63706 27.9008V29.6124C9.63706 29.974 9.7063 30.098 10.0213 30.098H10.091V30.2228C9.91508 30.2228 9.73929 30.2066 9.56334 30.2066C9.37964 30.2066 9.19115 30.2228 9.00684 30.2228V30.098H9.0643C9.3465 30.098 9.43246 29.9027 9.43246 29.5715V27.8216C9.43246 27.5893 9.24366 27.4484 9.06027 27.4484H9.00684V27.3237C9.16203 27.3237 9.32187 27.3402 9.47707 27.3402C9.6002 27.3402 9.71884 27.3237 9.84151 27.3237L11.6628 29.4042Z",fill:"#1A1919"}),Object(l.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11.899 30.3027L11.7305 30.2969L9.65398 27.9477V29.6124C9.65893 29.9735 9.71299 30.0761 10.0211 30.0801H10.1087V30.2406H10.0906C9.91356 30.2406 9.73746 30.2239 9.56291 30.2239C9.37968 30.2239 9.19165 30.2406 9.00625 30.2406H8.98828V30.0801H9.06387C9.33429 30.0785 9.41158 29.9021 9.41453 29.5714V27.8223C9.41375 27.6011 9.23501 27.4665 9.05999 27.4665H8.98828V27.3057H9.00625C9.16268 27.3057 9.32283 27.3219 9.47632 27.3219C9.59837 27.3219 9.71655 27.3057 9.85455 27.3121L11.6528 29.3667V27.8391C11.6508 27.5092 11.4336 27.4692 11.3145 27.4665H11.2062V27.3057H11.2244C11.4177 27.3057 11.606 27.3219 11.7971 27.3219C11.9636 27.3219 12.1314 27.3057 12.3005 27.3057H12.3185V27.4665H12.2396C12.0707 27.4709 11.8973 27.486 11.8924 27.9758V29.8655C11.8924 30.0109 11.8969 30.1559 11.9165 30.2819L11.9203 30.3027H11.899ZM11.7436 30.2666H11.879C11.8607 30.1416 11.8574 30.0037 11.8574 29.8655V27.9759C11.8574 27.4774 12.0633 27.4304 12.2395 27.4301H12.2826V27.3417C12.1214 27.343 11.9598 27.3581 11.797 27.3581C11.6096 27.3581 11.4275 27.343 11.2425 27.3417L11.2421 27.4301H11.3144C11.4402 27.4304 11.6882 27.4871 11.6882 27.8391L11.6827 29.4092L11.6747 29.4172L11.6607 29.4305L9.84099 27.3417C9.71941 27.3417 9.60107 27.3581 9.47624 27.3581C9.32631 27.3581 9.17266 27.343 9.02428 27.3417L9.02351 27.4301H9.0599C9.25181 27.4304 9.44929 27.5791 9.44929 27.8223V29.5714C9.44929 29.9037 9.35806 30.116 9.06378 30.1171L9.02428 30.116V30.2051C9.20147 30.2037 9.38408 30.1884 9.56282 30.1884C9.7335 30.1884 9.90387 30.2037 10.0727 30.2051V30.1171H10.021C9.69896 30.116 9.61919 29.9735 9.61888 29.6124V27.8544L11.7436 30.2666ZM11.6623 29.4042L11.6752 29.3922L11.6623 29.4042ZM11.6528 29.3961V29.3945L11.6495 29.3918L11.6528 29.3961Z",fill:"#1A1919"}),Object(l.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12.9145 27.5313C12.6072 27.5313 12.5953 27.6064 12.534 27.9092H12.4111C12.4272 27.7928 12.4475 27.6767 12.4602 27.5562C12.4766 27.4394 12.4849 27.3236 12.4849 27.2035H12.5829C12.6159 27.3281 12.7181 27.3236 12.8292 27.3236H14.9396C15.0507 27.3236 15.1528 27.3195 15.1611 27.1948L15.2588 27.2118C15.2431 27.3236 15.2263 27.4358 15.2144 27.5482C15.2063 27.6603 15.2063 27.7721 15.2063 27.8842L15.0834 27.9304C15.075 27.777 15.0547 27.5313 14.7806 27.5313H14.1094V29.7408C14.1094 30.0612 14.2529 30.0978 14.449 30.0978H14.527V30.2227C14.3673 30.2227 14.0808 30.2066 13.8602 30.2066C13.6144 30.2066 13.3277 30.2227 13.1681 30.2227V30.0978H13.2461C13.4716 30.0978 13.5856 30.0774 13.5856 29.7495V27.5313H12.9145Z",fill:"#1A1919"}),Object(l.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M14.5273 30.2405C14.366 30.2405 14.0798 30.224 13.8602 30.224C13.6147 30.224 13.3285 30.2405 13.168 30.2405H13.1505V30.08H13.2461C13.4716 30.0746 13.5622 30.0717 13.5673 29.7495V27.5491H12.9144V27.5128H13.6028V29.7495C13.6028 30.083 13.4703 30.1166 13.2461 30.1169H13.1855V30.2047C13.3469 30.2035 13.6226 30.1883 13.8602 30.1883C14.0731 30.1883 14.3465 30.2035 14.5087 30.2047V30.1169H14.4489C14.251 30.1166 14.0917 30.0673 14.0917 29.7409V27.5128H14.7805C15.055 27.5139 15.0914 27.7506 15.0999 27.9052L15.1885 27.872C15.1885 27.7635 15.1889 27.6549 15.1962 27.5458C15.2083 27.4384 15.2232 27.3329 15.2385 27.2265L15.1764 27.216C15.1573 27.3369 15.0419 27.3433 14.9394 27.3417H12.8077C12.7114 27.3419 12.6065 27.3372 12.5697 27.2213H12.5021C12.5015 27.3361 12.4938 27.4475 12.4783 27.5582C12.4661 27.6723 12.4473 27.7819 12.4324 27.892H12.5198C12.5735 27.6022 12.6085 27.5087 12.9144 27.5128V27.5491C12.6113 27.5552 12.618 27.6066 12.5512 27.9135L12.5483 27.9276H12.3906L12.3928 27.9061C12.4095 27.7902 12.4303 27.6736 12.4422 27.553C12.4592 27.4378 12.467 27.3225 12.467 27.2035V27.1851H12.5969L12.6 27.1982C12.6276 27.3029 12.7033 27.3037 12.8077 27.3056H14.9394C15.0534 27.3037 15.1364 27.3021 15.1434 27.1935L15.1448 27.1738L15.1634 27.1776L15.2791 27.1962L15.2761 27.2145C15.2599 27.326 15.2439 27.4378 15.2315 27.5491C15.2239 27.6604 15.2239 27.772 15.2239 27.8843V27.8968L15.212 27.9017L15.0672 27.9555L15.0663 27.9314C15.055 27.7752 15.0392 27.5491 14.7805 27.5491H14.1274V29.7409C14.1314 30.054 14.2537 30.0761 14.4489 30.08H14.5446V30.2405H14.5273Z",fill:"#1A1919"}),Object(l.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M15.3896 30.098H15.4473C15.5941 30.098 15.7501 30.0775 15.7501 29.8614V27.6856C15.7501 27.4691 15.5941 27.4486 15.4473 27.4486H15.3896V27.3237C15.6384 27.3237 16.0649 27.3402 16.408 27.3402C16.7523 27.3402 17.1773 27.3237 17.4555 27.3237C17.4484 27.5023 17.4523 27.7771 17.4643 27.9595L17.341 27.9925C17.3214 27.7224 17.2723 27.507 16.8425 27.507H16.2744V28.5944H16.7604C17.0059 28.5944 17.0593 28.4537 17.0836 28.2293H17.2063C17.1981 28.3915 17.1938 28.5534 17.1938 28.7152C17.1938 28.8733 17.1981 29.031 17.2063 29.1885L17.0836 29.2134C17.0593 28.9645 17.0471 28.8026 16.7644 28.8026H16.2744V29.7697C16.2744 30.0401 16.5107 30.0401 16.7728 30.0401C17.2639 30.0401 17.4806 30.0066 17.6034 29.5338L17.7176 29.5624C17.6644 29.7829 17.6157 30.0024 17.579 30.2228C17.3167 30.2228 16.8462 30.2068 16.4786 30.2068C16.1096 30.2068 15.6231 30.2228 15.3896 30.2228V30.098Z",fill:"#1A1919"}),Object(l.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M17.5784 30.2406C17.3159 30.2406 16.845 30.2233 16.478 30.2233C16.1093 30.2233 15.623 30.2406 15.3893 30.2406H15.3721V30.0801H15.4469C15.595 30.0776 15.7297 30.0644 15.7316 29.8614V27.6856C15.7297 27.4827 15.595 27.4692 15.4469 27.4665H15.3721V27.3057H15.3893C15.6392 27.3057 16.0649 27.3219 16.4078 27.3219C16.7518 27.3219 17.1766 27.3057 17.4553 27.3057H17.4734L17.4728 27.3248C17.4701 27.3869 17.4684 27.4608 17.4684 27.539C17.4684 27.6825 17.4728 27.8399 17.4808 27.9581L17.4816 27.9729L17.4678 27.9771L17.3239 28.0153L17.3233 27.9939C17.2992 27.7245 17.2635 27.5284 16.8422 27.5243H16.2907L16.2904 28.5762H16.76C16.9959 28.5737 17.038 28.4514 17.0659 28.2274L17.0668 28.2107H17.2242L17.2239 28.2297C17.216 28.392 17.2112 28.5534 17.2112 28.7152C17.2112 28.8722 17.216 29.0299 17.2239 29.1878L17.2242 29.2029L17.2093 29.2063L17.0668 29.2351L17.0659 29.2156C17.0376 28.962 17.0357 28.823 16.7642 28.8201H16.2907V29.7698C16.2913 30.0222 16.5057 30.0208 16.7724 30.0222C17.2651 30.0192 17.4624 29.9947 17.5857 29.5289L17.5899 29.5121L17.6071 29.5149L17.7383 29.5495L17.7345 29.5666C17.6814 29.7864 17.6326 30.006 17.5956 30.2258L17.5925 30.2406H17.5784ZM17.5634 30.2048C17.5992 29.9948 17.6458 29.785 17.696 29.576L17.6155 29.5554C17.4929 30.0199 17.2555 30.0614 16.7726 30.0583C16.5147 30.0583 16.257 30.0583 16.2556 29.7698V28.7846H16.7644C17.0501 28.7816 17.0789 28.9564 17.0994 29.1927L17.1877 29.1743C17.1798 29.0212 17.1757 28.8674 17.1757 28.7152C17.1757 28.5593 17.1798 28.4037 17.1877 28.2469H17.0994C17.0763 28.4639 17.0095 28.6153 16.7602 28.6126H16.2556V27.4884H16.8424C17.2679 27.4849 17.3384 27.7085 17.357 27.9698L17.4451 27.9454C17.438 27.8283 17.4332 27.6777 17.4332 27.539C17.4332 27.4679 17.435 27.4005 17.4373 27.3417C17.1593 27.343 16.7444 27.3581 16.408 27.3581C16.0717 27.3581 15.6579 27.343 15.4074 27.3417V27.4301H15.4471C15.5927 27.4304 15.7667 27.456 15.7677 27.6857V29.8614C15.7667 30.0907 15.5927 30.116 15.4471 30.1171H15.4074V30.2048C15.6456 30.204 16.1186 30.1884 16.4781 30.1884C16.8393 30.1884 17.2996 30.204 17.5634 30.2048Z",fill:"#1A1919"}),Object(l.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M18.27 27.7636C18.27 27.4608 18.1062 27.4484 17.9792 27.4484H17.9053V27.3237C18.0363 27.3237 18.29 27.3402 18.5398 27.3402C18.7849 27.3402 18.9816 27.3237 19.1984 27.3237C19.7132 27.3237 20.1725 27.4647 20.1725 28.0549C20.1725 28.4284 19.9268 28.6565 19.6037 28.7861L20.3031 29.8487C20.418 30.0244 20.4991 30.0736 20.7002 30.098V30.2228C20.5648 30.2228 20.4339 30.2068 20.2993 30.2068C20.1725 30.2068 20.041 30.2228 19.9148 30.2228C19.5994 29.8035 19.3291 29.3552 19.0634 28.8768H18.7937V29.7661C18.7937 30.0859 18.9407 30.098 19.1282 30.098H19.2024V30.2228C18.9687 30.2228 18.7324 30.2068 18.4986 30.2068C18.3022 30.2068 18.1099 30.2228 17.9053 30.2228V30.098H17.9792C18.1311 30.098 18.27 30.0277 18.27 29.8743V27.7636ZM18.7938 28.7271H18.9938C19.4035 28.7271 19.624 28.5697 19.624 28.0794C19.624 27.7101 19.3908 27.4733 19.0262 27.4733C18.9033 27.4733 18.851 27.4861 18.7938 27.4901V28.7271Z",fill:"#1A1919"}),Object(l.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M20.6994 30.2406C20.5622 30.2406 20.4321 30.2239 20.2975 30.2239C20.1728 30.2239 20.0419 30.2406 19.8994 30.2337C19.5855 29.8155 19.3165 29.3697 19.0522 28.8955H18.8105V29.7653C18.8149 30.078 18.9384 30.0757 19.1275 30.0801H19.2193V30.2406H19.2012C18.9674 30.2406 18.7296 30.2239 18.4977 30.2239C18.3023 30.2239 18.1101 30.2406 17.9045 30.2406H17.8867V30.0801H17.9784C18.1256 30.079 18.2499 30.0139 18.2505 29.8743V27.7636C18.2474 27.4692 18.1054 27.4706 17.9784 27.4665H17.8867V27.3057H17.9045C18.037 27.3057 18.2896 27.3219 18.5391 27.3219C18.7833 27.3219 18.9796 27.3057 19.1977 27.3057C19.7136 27.3068 20.1883 27.4509 20.1895 28.0543C20.1895 28.4291 19.9455 28.6633 19.6299 28.794L20.317 29.8388C20.4315 30.0111 20.5027 30.0541 20.7018 30.0801L20.7166 30.0824V30.2406H20.6994ZM18.7927 28.8589H19.0723L19.0774 28.8682C19.3438 29.3453 19.6127 29.7938 19.9139 30.2051C20.0385 30.2051 20.17 30.1884 20.2974 30.1884C20.428 30.1884 20.5544 30.2029 20.6814 30.2048V30.1136C20.4896 30.0899 20.3995 30.0311 20.2878 29.8589L19.5755 28.7778L19.5956 28.7695C19.9161 28.6414 20.1535 28.4195 20.1537 28.0543C20.1535 27.4782 19.712 27.3445 19.1976 27.3417C18.9821 27.3417 18.7854 27.3585 18.539 27.3585C18.2986 27.3585 18.0558 27.343 17.9219 27.3417V27.4301H17.9783C18.1053 27.4304 18.2861 27.4518 18.2861 27.7637V29.8743C18.2861 30.041 18.1323 30.1168 17.9783 30.1171H17.9219V30.2048C18.1186 30.204 18.3054 30.1884 18.4977 30.1884C18.7261 30.1884 18.9572 30.204 19.1835 30.2048V30.1171H19.1274C18.9411 30.1168 18.7746 30.0933 18.7746 29.7654V28.8589H18.7927ZM18.7926 28.7449H18.7745V27.4733L18.7901 27.472C18.8462 27.4674 18.9013 27.456 19.0251 27.456C19.3978 27.456 19.6405 27.7017 19.6408 28.0804C19.6397 28.5762 19.4055 28.7448 18.9927 28.7449H18.7926ZM18.993 28.7094C19.398 28.7053 19.6021 28.5628 19.6061 28.0803C19.6037 27.7174 19.3817 27.4923 19.0253 27.4908C18.9149 27.4908 18.8627 27.5011 18.8105 27.5063V28.7094H18.993Z",fill:"#1A1919"}),Object(l.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M23.4779 29.4042L23.485 29.3961V27.8391C23.485 27.4982 23.2526 27.4484 23.1297 27.4484H23.0401V27.3237C23.2324 27.3237 23.42 27.3402 23.6128 27.3402C23.781 27.3402 23.9475 27.3237 24.1165 27.3237V27.4484H24.0549C23.8829 27.4484 23.6907 27.4816 23.6907 27.9758V29.8655C23.6907 30.0111 23.6948 30.1563 23.7149 30.2852H23.56L21.453 27.9008V29.6124C21.453 29.974 21.522 30.098 21.8371 30.098H21.9068V30.2228C21.731 30.2228 21.5547 30.2066 21.3789 30.2066C21.1941 30.2066 21.0063 30.2228 20.8223 30.2228V30.098H20.8791C21.1616 30.098 21.248 29.9027 21.248 29.5715V27.8216C21.248 27.5893 21.0595 27.4484 20.8755 27.4484H20.8223V27.3237C20.9772 27.3237 21.1379 27.3402 21.2931 27.3402C21.4147 27.3402 21.534 27.3237 21.6569 27.3237L23.4779 29.4042Z",fill:"#1A1919"}),Object(l.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M23.7146 30.3027L23.5466 30.2969L21.4697 27.948V29.6122C21.4745 29.974 21.5284 30.0761 21.8369 30.0801H21.9237V30.2406H21.9059C21.729 30.2406 21.5534 30.2233 21.378 30.2233C21.1954 30.2233 21.0063 30.2406 20.822 30.2406H20.8037V30.0801H20.879C21.1493 30.079 21.2267 29.9021 21.2293 29.5704V27.8216C21.2289 27.6003 21.0504 27.4665 20.8754 27.4665H20.8037V27.3057H20.822C20.9783 27.3057 21.1384 27.3219 21.2928 27.3219C21.413 27.3219 21.5315 27.3057 21.6687 27.311L23.4676 29.3667V27.8391C23.4665 27.5092 23.2486 27.4684 23.1296 27.4665H23.0217V27.3057H23.0395C23.2328 27.3057 23.4214 27.3219 23.6127 27.3219C23.7794 27.3219 23.9469 27.3057 24.1156 27.3057H24.1337V27.4665H24.0547C23.8859 27.4706 23.712 27.486 23.708 27.9758V29.8655C23.708 30.0109 23.7115 30.1549 23.7324 30.2822L23.7344 30.3027H23.7146ZM23.5596 30.2666H23.6937C23.6757 30.1424 23.6722 30.0037 23.6722 29.8655V27.9759C23.6725 27.4774 23.8794 27.4312 24.0546 27.4301H24.0976V27.3417C23.9365 27.343 23.7748 27.3581 23.6125 27.3581C23.4245 27.3581 23.2422 27.343 23.0571 27.3417V27.4301H23.1294C23.2555 27.4312 23.5033 27.4871 23.5033 27.8391L23.4974 29.4092L23.49 29.4172L23.4772 29.4309L21.6566 27.3417C21.5349 27.3417 21.4163 27.3581 21.2927 27.3581C21.1409 27.3581 20.988 27.343 20.8393 27.3417V27.4301H20.8752C21.0678 27.4312 21.2646 27.5785 21.2646 27.8217V29.5705C21.2646 29.9037 21.1722 30.116 20.8788 30.1171L20.8393 30.1168V30.2049C21.016 30.2037 21.1983 30.1884 21.3778 30.1884C21.5495 30.1884 21.7195 30.2037 21.8887 30.2049V30.1171H21.8368C21.5148 30.1168 21.4345 29.974 21.4336 29.6123V27.855L23.5596 30.2666ZM23.4775 29.4042L23.4908 29.3922L23.4775 29.4042ZM23.4674 29.3961V29.395L23.4645 29.3918L23.4674 29.3961Z",fill:"#1A1919"}),Object(l.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M24.7741 29.6286C24.7329 29.7693 24.6835 29.8784 24.6835 29.9521C24.6835 30.0771 24.8559 30.0977 24.9905 30.0977H25.0362V30.2224C24.8718 30.2134 24.7049 30.2064 24.5402 30.2064C24.3929 30.2064 24.2464 30.2134 24.0986 30.2224V30.0977H24.1236C24.2828 30.0977 24.4183 30.002 24.479 29.8275L25.1337 27.9218C25.1872 27.7677 25.2609 27.5602 25.2858 27.4062C25.4159 27.3607 25.5803 27.2782 25.6577 27.2277C25.6704 27.2235 25.678 27.2192 25.6904 27.2192C25.7028 27.2192 25.7104 27.2192 25.7194 27.2323C25.7314 27.2651 25.7434 27.3026 25.7561 27.3357L26.5093 29.5082C26.5584 29.6531 26.607 29.8067 26.6594 29.932C26.7092 30.0485 26.7952 30.0977 26.9307 30.0977H26.9552V30.2224C26.7709 30.2134 26.5862 30.2064 26.3908 30.2064C26.1902 30.2064 25.985 30.2134 25.7763 30.2224V30.0977H25.8214C25.915 30.0977 26.0756 30.0812 26.0756 29.9773C26.0756 29.9237 26.0386 29.8114 25.9929 29.678L25.8335 29.1964H24.9048L24.7741 29.6286ZM25.3715 27.7887H25.363L24.9827 28.9642H25.7472L25.3715 27.7887Z",fill:"#1A1919"}),Object(l.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M26.954 30.2404C26.7702 30.2324 26.5857 30.2231 26.3909 30.2231C26.1903 30.2231 25.9861 30.2324 25.7774 30.2404L25.7585 30.2414V30.0791H25.8215C25.9163 30.0791 26.0569 30.0576 26.0572 29.9776C26.0582 29.9302 26.0215 29.8164 25.9764 29.6844L25.8206 29.2145H24.9181L24.7907 29.6342C24.7495 29.7754 24.6998 29.8851 24.7006 29.9527C24.702 30.0541 24.8547 30.0791 24.9905 30.0791H25.0534V30.2414L25.0348 30.2404C24.8713 30.2324 24.7043 30.2231 24.5406 30.2231C24.3945 30.2231 24.2466 30.2324 24.1001 30.2404L24.0811 30.2414V30.0791H24.1235C24.2756 30.0788 24.4026 29.9906 24.4618 29.8219L25.1171 27.9156C25.1699 27.7619 25.2442 27.5553 25.2796 27.3893C25.408 27.3451 25.5726 27.2613 25.6511 27.2112C25.6626 27.2071 25.6739 27.2017 25.6903 27.2017C25.7004 27.2011 25.7224 27.2038 25.7357 27.2255C25.7473 27.2596 25.7603 27.2969 25.7727 27.3303L26.5261 29.5025C26.5742 29.6479 26.6232 29.8013 26.6768 29.9244C26.7242 30.0351 26.7993 30.0788 26.9308 30.0791H26.9721V30.2414L26.954 30.2404ZM25.7943 30.2036C25.9968 30.1963 26.1955 30.1883 26.391 30.1883C26.5807 30.1883 26.7591 30.1963 26.9369 30.2036V30.1166H26.9309C26.7906 30.1176 26.6941 30.0616 26.6439 29.9391C26.5906 29.8137 26.5409 29.6595 26.4926 29.5141L25.7392 27.3417C25.7268 27.3086 25.7152 27.2715 25.7045 27.2419C25.7005 27.2378 25.7014 27.2378 25.6981 27.2378H25.6904C25.6822 27.2378 25.6772 27.2403 25.6667 27.243C25.588 27.2949 25.424 27.3768 25.3023 27.4092C25.2773 27.5666 25.2036 27.7741 25.1505 27.928L24.4958 29.8338C24.4335 30.0143 24.2896 30.1169 24.1236 30.1166H24.1168V30.2036C24.2571 30.1963 24.3987 30.1883 24.5407 30.1883C24.699 30.1883 24.8604 30.1963 25.017 30.2036V30.1166H24.9906C24.857 30.1147 24.6708 30.1 24.6661 29.9528C24.6665 29.8704 24.7166 29.7642 24.7568 29.6238L24.7741 29.629L24.7568 29.6233L24.8915 29.1795H25.8456L26.0095 29.6727C26.0555 29.8063 26.0926 29.917 26.0926 29.9777C26.0866 30.1048 25.9144 30.1143 25.8216 30.1166H25.7943V30.2036ZM24.958 28.9822L25.3497 27.7704H25.3717V27.7888L25.3674 27.7901L25.3717 27.7888V27.7704H25.384L25.7729 28.9822H24.958ZM25.0067 28.946H25.723L25.3669 27.8331L25.0067 28.946ZM25.3539 27.7943L25.3634 27.7913L25.3539 27.7943Z",fill:"#1A1919"}),Object(l.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M27.1347 27.5313C26.8279 27.5313 26.8155 27.6064 26.7538 27.9092H26.6309C26.647 27.7928 26.6679 27.6767 26.6806 27.5562C26.6965 27.4394 26.7044 27.3236 26.7044 27.2035H26.8034C26.8355 27.3281 26.938 27.3236 27.0484 27.3236H29.1601C29.2701 27.3236 29.3723 27.3195 29.3804 27.1948L29.4783 27.2118C29.4631 27.3236 29.4468 27.4358 29.434 27.5482C29.425 27.6603 29.425 27.7721 29.425 27.8842L29.3028 27.9304C29.2955 27.777 29.2749 27.5313 29.0001 27.5313H28.3292V29.7408C28.3292 30.0612 28.4726 30.0978 28.6687 30.0978H28.7469V30.2227C28.5871 30.2227 28.3011 30.2066 28.0797 30.2066C27.8346 30.2066 27.5475 30.2227 27.3879 30.2227V30.0978H27.4658C27.6914 30.0978 27.8055 30.0774 27.8055 29.7495V27.5313H27.1347Z",fill:"#1A1919"}),Object(l.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M28.748 30.2405C28.5872 30.2405 28.3003 30.224 28.0804 30.224C27.836 30.224 27.5495 30.2405 27.3892 30.2405H27.371V30.08H27.4669C27.6926 30.0746 27.783 30.0717 27.7885 29.7495L27.7881 27.5491H27.1358V27.5128H27.8242V29.7495C27.8242 30.083 27.6917 30.1158 27.4669 30.1166H27.4067V30.205C27.5684 30.2035 27.8433 30.1883 28.0804 30.1883C28.2943 30.1883 28.5681 30.2035 28.7297 30.205V30.1166H28.6696C28.4724 30.1158 28.313 30.0677 28.3127 29.7409V27.5128H29.0012C29.2761 27.5139 29.3119 27.7506 29.3198 27.9052L29.4087 27.872C29.4087 27.7635 29.4093 27.6549 29.4177 27.5463C29.4287 27.4392 29.4442 27.3329 29.459 27.227L29.3972 27.216C29.3785 27.3369 29.263 27.3436 29.1612 27.3417H27.0286C26.9321 27.3428 26.8277 27.3372 26.7905 27.221H26.7236C26.7227 27.3359 26.7146 27.4475 26.6985 27.5582C26.6874 27.6728 26.6677 27.7827 26.6521 27.892H26.74C26.7938 27.6022 26.8293 27.5082 27.1358 27.5128V27.5491C26.8323 27.5544 26.839 27.6066 26.7723 27.9135L26.7693 27.9276H26.6113L26.6138 27.907C26.631 27.7902 26.6511 27.6736 26.6631 27.554C26.6798 27.4378 26.6874 27.3225 26.6874 27.2035V27.1851H26.8173L26.8207 27.1982C26.8494 27.3029 26.9239 27.3037 27.0286 27.3056H29.1612C29.2744 27.3037 29.357 27.3021 29.3643 27.1938L29.3649 27.1738L29.3839 27.1776L29.5001 27.1962L29.4973 27.2145C29.4804 27.326 29.4649 27.4378 29.4525 27.5491C29.4442 27.6604 29.4442 27.7722 29.4442 27.8843V27.8968L29.4322 27.9017L29.2874 27.9555L29.2868 27.9314C29.2761 27.7752 29.2599 27.5491 29.0012 27.5491H28.3479V29.7409C28.3521 30.054 28.4746 30.0761 28.6696 30.08H28.765V30.2405H28.748Z",fill:"#1A1919"}),Object(l.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M29.6299 30.098H29.6872C29.8346 30.098 29.9895 30.0775 29.9895 29.8614V27.6856C29.9895 27.4691 29.8346 27.4486 29.6872 27.4486H29.6299V27.3237C29.7896 27.3237 30.0346 27.3402 30.2349 27.3402C30.4399 27.3402 30.6856 27.3237 30.8783 27.3237V27.4486H30.8208C30.6729 27.4486 30.5174 27.4691 30.5174 27.6856V29.8614C30.5174 30.0775 30.6729 30.098 30.8208 30.098H30.8783V30.2228C30.6817 30.2228 30.4359 30.2068 30.2316 30.2068C30.0307 30.2068 29.7896 30.2228 29.6299 30.2228V30.098Z",fill:"#1A1919"}),Object(l.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M30.8792 30.2406C30.6814 30.2406 30.4367 30.2233 30.2325 30.2233C30.0322 30.2233 29.7906 30.2406 29.6308 30.2406H29.6133V30.0801H29.6882C29.8357 30.0776 29.9717 30.0644 29.9726 29.8614V27.6856C29.9717 27.4827 29.8357 27.4692 29.6882 27.4665H29.6133V27.3057H29.6308C29.7906 27.3057 30.0367 27.3219 30.2358 27.3219C30.4397 27.3219 30.6852 27.3057 30.8792 27.3057H30.8962V27.4665H30.8218C30.6721 27.4692 30.5375 27.4827 30.5361 27.6856V29.8614C30.5375 30.0644 30.6721 30.0776 30.8218 30.0801H30.8962V30.2406H30.8792ZM30.8605 30.2048V30.1168H30.8218C30.6749 30.1168 30.5013 30.0907 30.5013 29.8614V27.6857C30.5013 27.456 30.6749 27.4304 30.8218 27.4301H30.8605V27.3417C30.6718 27.343 30.4349 27.3581 30.2357 27.3581C30.0415 27.3581 29.8073 27.343 29.6485 27.3417V27.4301H29.6882C29.8334 27.4304 30.0078 27.456 30.0083 27.6857V29.8614C30.0078 30.0907 29.8334 30.1168 29.6882 30.1168H29.6485V30.2048C29.8062 30.2029 30.0376 30.1884 30.2324 30.1884C30.4308 30.1884 30.6675 30.2037 30.8605 30.2048Z",fill:"#1A1919"}),Object(l.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M32.5103 27.2612C33.3826 27.2612 34.0779 27.81 34.0779 28.6947C34.0779 29.65 33.4026 30.285 32.5314 30.285C31.6636 30.285 31.001 29.6868 31.001 28.7937C31.001 27.9303 31.6595 27.2612 32.5103 27.2612ZM32.5722 30.1022C33.3663 30.1022 33.5048 29.3915 33.5048 28.7859C33.5048 28.179 33.1823 27.4442 32.5027 27.4442C31.7868 27.4442 31.5738 28.0922 31.5738 28.6482C31.5738 29.3915 31.9096 30.1022 32.5722 30.1022Z",fill:"#1A1919"}),Object(l.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M30.9824 28.7937C30.9841 27.9203 31.6503 27.2446 32.5099 27.2432V27.2795C31.6687 27.2795 31.018 27.9394 31.0171 28.7937C31.0188 29.6767 31.6718 30.266 32.5313 30.2663C33.3937 30.266 34.0592 29.6401 34.0603 28.694C34.0595 27.8204 33.3752 27.2803 32.5099 27.2795V27.2432C33.3884 27.2441 34.0936 27.7983 34.0951 28.694C34.0942 29.6593 33.4109 30.3009 32.5313 30.3024C31.656 30.3009 30.9841 29.6967 30.9824 28.7937ZM31.5555 28.6481C31.5567 28.0892 31.7715 27.4255 32.5021 27.4255C33.1969 27.4271 33.5209 28.1755 33.5223 28.7858C33.5209 29.3914 33.3806 30.1191 32.572 30.1191V30.0839C33.35 30.0833 33.4852 29.3914 33.4864 28.7858C33.4864 28.1842 33.1672 27.4632 32.5021 27.4621C31.8002 27.4629 31.5928 28.0949 31.5909 28.6481C31.5912 29.3879 31.9239 30.0828 32.572 30.0839V30.1191C31.8928 30.1185 31.5567 29.3958 31.5555 28.6481Z",fill:"#1A1919"}),Object(l.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M36.8353 29.4042L36.8439 29.3961V27.8391C36.8439 27.4982 36.6098 27.4484 36.4872 27.4484H36.3981V27.3237C36.5899 27.3237 36.7785 27.3402 36.9703 27.3402C37.1385 27.3402 37.3062 27.3237 37.4741 27.3237V27.4484H37.4126C37.2411 27.4484 37.048 27.4816 37.048 27.9758V29.8655C37.048 30.0111 37.0523 30.1563 37.0731 30.2852H36.9174L34.8098 27.9008V29.6124C34.8098 29.974 34.8796 30.098 35.194 30.098H35.2642V30.2228C35.0881 30.2228 34.9124 30.2066 34.7365 30.2066C34.5522 30.2066 34.3638 30.2228 34.1797 30.2228V30.098H34.2371C34.52 30.098 34.6053 29.9027 34.6053 29.5715V27.8216C34.6053 27.5893 34.4177 27.4484 34.2327 27.4484H34.1797V27.3237C34.3352 27.3237 34.4946 27.3402 34.6504 27.3402C34.7729 27.3402 34.8909 27.3237 35.0142 27.3237L36.8353 29.4042Z",fill:"#1A1919"}),Object(l.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M37.0729 30.3027L36.9036 30.2969L34.827 27.948V29.6124C34.8318 29.974 34.8859 30.0757 35.1932 30.0793H35.2813V30.2406H35.264C35.0868 30.2406 34.9111 30.2239 34.7361 30.2239C34.5527 30.2239 34.3644 30.2406 34.1788 30.2406H34.1621V30.0793H34.2366C34.5063 30.0785 34.584 29.9021 34.5873 29.5714V27.8216C34.5871 27.6003 34.4082 27.4665 34.2324 27.4665H34.1621V27.3057H34.1788C34.3357 27.3057 34.4953 27.3219 34.6498 27.3219C34.7713 27.3219 34.8888 27.3057 35.0276 27.3121L36.8255 29.3667V27.8391C36.8241 27.5092 36.6062 27.4692 36.4868 27.4665H36.379V27.3057H36.3977C36.5899 27.3057 36.7787 27.3219 36.9694 27.3219C37.1368 27.3219 37.3038 27.3057 37.4739 27.3057H37.4911V27.4665H37.4121C37.2434 27.4709 37.0693 27.4866 37.0659 27.9758V29.8655C37.0659 30.0109 37.0691 30.1559 37.089 30.2822L37.0925 30.3027H37.0729ZM36.9171 30.2666H37.0512C37.0339 30.1416 37.0298 30.0037 37.0298 29.8655V27.9759C37.0298 27.4766 37.2365 27.4312 37.4121 27.4301H37.4564V27.3417C37.2939 27.343 37.133 27.3581 36.9694 27.3581C36.7831 27.3581 36.6002 27.343 36.4149 27.3417V27.4301H36.4868C36.6132 27.4312 36.8602 27.4879 36.8602 27.8391L36.8559 29.4092L36.848 29.4172L36.835 29.4309L35.014 27.3417C34.8929 27.3417 34.7738 27.3581 34.6499 27.3581C34.499 27.3581 34.3454 27.343 34.1965 27.3417V27.4301H34.2325C34.4248 27.4312 34.6225 27.5785 34.6225 27.8217V29.5714C34.6225 29.9037 34.5311 30.116 34.2366 30.1171L34.1965 30.1168V30.2049C34.3742 30.2037 34.5563 30.1884 34.7361 30.1884C34.9068 30.1884 35.0764 30.2037 35.246 30.2049V30.1171H35.1932C34.8721 30.1168 34.7916 29.974 34.7916 29.6124V27.8544L36.9171 30.2666ZM36.8351 29.4042L36.8481 29.3922L36.8351 29.4042ZM36.8256 29.3961V29.395L36.8224 29.3918L36.8256 29.3961Z",fill:"#1A1919"}),Object(l.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M38.1311 29.6286C38.091 29.7693 38.0416 29.8784 38.0416 29.9521C38.0416 30.0771 38.214 30.0977 38.3481 30.0977H38.3938V30.2224C38.2299 30.2134 38.062 30.2064 37.8981 30.2064C37.7508 30.2064 37.6037 30.2134 37.457 30.2224V30.0977H37.4803C37.6407 30.0977 37.7762 30.002 37.836 29.8275L38.4921 27.9218C38.5449 27.7677 38.619 27.5602 38.6425 27.4062C38.774 27.3607 38.9373 27.2782 39.0161 27.2277C39.0276 27.2235 39.0358 27.2192 39.0485 27.2192C39.0604 27.2192 39.0681 27.2192 39.0765 27.2323C39.0889 27.2651 39.1011 27.3026 39.1135 27.3357L39.8664 29.5082C39.9152 29.6531 39.9646 29.8067 40.0181 29.932C40.0672 30.0485 40.153 30.0977 40.2879 30.0977H40.3131V30.2224C40.1286 30.2134 39.9443 30.2064 39.7478 30.2064C39.5477 30.2064 39.3428 30.2134 39.1338 30.2224V30.0977H39.1792C39.2728 30.0977 39.4332 30.0812 39.4332 29.9773C39.4332 29.9237 39.3965 29.8114 39.3508 29.678L39.1913 29.1964H38.2626L38.1311 29.6286ZM38.7292 27.7887H38.721L38.3395 28.9642H39.1059L38.7292 27.7887Z",fill:"#1A1919"}),Object(l.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M40.3115 30.2407C40.127 30.2333 39.9433 30.224 39.7482 30.224C39.5485 30.224 39.3435 30.2333 39.135 30.2407L39.1169 30.2416V30.0802H39.1791C39.2742 30.0802 39.4152 30.0578 39.4153 29.9778C39.4164 29.9305 39.3794 29.8172 39.3334 29.6846L39.1782 29.2147H38.2749L38.1485 29.6345C38.1073 29.7768 38.059 29.8854 38.0595 29.9527C38.0595 30.0544 38.213 30.0802 38.3482 30.0802H38.4107V30.2416L38.3923 30.2407C38.2289 30.2333 38.0613 30.224 37.8984 30.224C37.7517 30.224 37.6049 30.2333 37.4573 30.2407L37.4395 30.2416V30.0802H37.4805C37.6331 30.0794 37.7607 29.9907 37.8206 29.8222L38.475 27.9159C38.5275 27.7621 38.6014 27.5556 38.6373 27.3902C38.7659 27.3449 38.9302 27.2616 39.0098 27.2114C39.0204 27.2073 39.0318 27.2023 39.0486 27.2023C39.0591 27.2014 39.0806 27.204 39.0932 27.2267C39.1056 27.2594 39.1176 27.2971 39.131 27.3306L39.8834 29.5027C39.9326 29.6482 39.9814 29.8016 40.0346 29.9255C40.0827 30.0354 40.1568 30.0791 40.2876 30.0802H40.3299V30.2416L40.3115 30.2407ZM39.1516 30.204C39.354 30.1964 39.5531 30.1884 39.7482 30.1884C39.9384 30.1884 40.1164 30.1964 40.295 30.2037L40.2945 30.1167H40.2877C40.1491 30.117 40.0526 30.0617 40.0015 29.9392C39.9476 29.8138 39.8989 29.6596 39.8498 29.5146L39.0969 27.3418C39.0849 27.3087 39.0718 27.2716 39.0622 27.2428C39.0588 27.2379 39.0591 27.2379 39.0567 27.2379H39.0486C39.0398 27.2379 39.0353 27.2407 39.0255 27.2436C38.9455 27.2944 38.7817 27.3777 38.6609 27.4093C38.6355 27.5666 38.5612 27.7738 38.5085 27.9281L37.8532 29.8339C37.7909 30.0144 37.648 30.117 37.4806 30.1167H37.4745V30.2037C37.6155 30.1964 37.7561 30.1884 37.8984 30.1884C38.0569 30.1884 38.2187 30.1964 38.3759 30.2037V30.1167H38.3482C38.2152 30.1148 38.0287 30.1005 38.0234 29.9526C38.0245 29.8705 38.0749 29.7646 38.115 29.6239L38.1314 29.6291L38.115 29.6234L38.2496 29.1796H39.2033L39.3677 29.6728C39.4127 29.8064 39.4501 29.9171 39.4501 29.9777C39.4442 30.1049 39.2721 30.1144 39.1792 30.1167H39.1516V30.204ZM38.3155 28.9823L38.7084 27.7707H38.7296V27.7891L38.725 27.7904L38.7296 27.7891V27.7707H38.742L39.1289 28.9823H38.3155ZM38.3649 28.9463H39.0808L38.7249 27.834L38.3649 28.9463ZM38.7127 27.7946L38.7207 27.7916L38.7127 27.7946Z",fill:"#1A1919"}),Object(l.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M41.3443 29.8155C41.3443 29.9824 41.458 30.0316 41.5893 30.0489C41.7568 30.0614 41.9411 30.0614 42.1299 30.0401C42.3015 30.0192 42.4488 29.9202 42.5222 29.8155C42.5873 29.7243 42.6241 29.608 42.6492 29.5168H42.7676C42.7225 29.7535 42.6653 29.9864 42.6162 30.2228C42.2569 30.2228 41.8957 30.2068 41.5362 30.2068C41.1758 30.2068 40.816 30.2228 40.4561 30.2228V30.098H40.5127C40.6603 30.098 40.8205 30.0775 40.8205 29.82V27.6856C40.8205 27.4691 40.6603 27.4484 40.5127 27.4484H40.4561V27.3237C40.6726 27.3237 40.8857 27.3402 41.1022 27.3402C41.3113 27.3402 41.5155 27.3237 41.7247 27.3237V27.4484H41.6219C41.4664 27.4484 41.3443 27.4528 41.3443 27.6729V29.8155Z",fill:"#1A1919"}),Object(l.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M42.6158 30.2406C42.2549 30.2406 41.8945 30.2239 41.5356 30.2239C41.1757 30.2239 40.8156 30.2406 40.4547 30.2406H40.4375V30.0801H40.5122C40.6601 30.0765 40.8006 30.0659 40.8023 29.8201V27.6849C40.8006 27.4827 40.6607 27.4692 40.5122 27.4665H40.4375V27.3057H40.4547C40.6726 27.3057 40.8856 27.3219 41.1013 27.3219C41.3097 27.3219 41.5135 27.3057 41.7241 27.3057H41.7405V27.4665H41.6213C41.4625 27.4706 41.364 27.4633 41.3605 27.6729V29.8155C41.3615 29.9708 41.4618 30.0123 41.5897 30.0309C41.6617 30.0359 41.7379 30.0386 41.8166 30.0386C41.9167 30.0386 42.0206 30.0339 42.1264 30.0225C42.293 30.0024 42.4364 29.9046 42.5072 29.8056C42.5704 29.7168 42.606 29.603 42.6308 29.5126L42.6342 29.4989H42.7885L42.7849 29.5207C42.7386 29.7581 42.6823 29.9898 42.6327 30.2266L42.6294 30.2406H42.6158ZM42.6009 30.2048C42.6483 29.9792 42.7017 29.7586 42.746 29.5346H42.6616C42.6365 29.625 42.6 29.7365 42.5358 29.8269C42.4593 29.9344 42.3078 30.0359 42.1303 30.0583C42.0233 30.0693 41.9169 30.0749 41.8167 30.0749C41.7374 30.0749 41.6609 30.0713 41.5864 30.066C41.4533 30.0512 41.3246 29.9932 41.3248 29.8155V27.6729C41.3248 27.442 41.4687 27.4301 41.6214 27.4301H41.7056V27.3417C41.5041 27.343 41.3051 27.3585 41.1014 27.3585C40.89 27.3585 40.6826 27.343 40.4732 27.3417V27.4301H40.5123C40.6582 27.4301 40.8367 27.456 40.8367 27.6849V29.8201C40.8367 30.0889 40.6589 30.1168 40.5123 30.1168H40.4732V30.2048C40.8267 30.204 41.1804 30.1884 41.5357 30.1884C41.8915 30.1884 42.2467 30.204 42.6009 30.2048Z",fill:"#1A1919"}),Object(l.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M17.1602 12.6614C17.1602 8.77664 20.2628 5.62744 24.09 5.62744C27.9174 5.62744 31.0201 8.77664 31.0201 12.6614C31.0201 16.5462 27.9174 19.6956 24.09 19.6956C20.2628 19.6956 17.1602 16.5462 17.1602 12.6614Z",fill:"#FFFFFE"}),Object(l.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M28.2807 12.5227C28.2779 10.7214 27.1686 9.18519 25.6055 8.5768V16.4683C27.1686 15.8592 28.2779 14.3243 28.2807 12.5227ZM22.6238 16.4669V8.57771C21.0621 9.18799 19.9545 10.722 19.9503 12.5229C19.9545 14.3232 21.0621 15.8571 22.6238 16.4669ZM24.1156 5.85259C20.4863 5.85401 17.546 8.83908 17.5454 12.5228C17.546 16.206 20.4863 19.1906 24.1156 19.1913C27.7449 19.1906 30.6858 16.206 30.6867 12.5228C30.6858 8.83908 27.7449 5.85401 24.1156 5.85259ZM24.0995 19.8207C20.1281 19.8399 16.8594 16.5742 16.8594 12.5989C16.8594 8.25425 20.1281 5.24921 24.0995 5.25H25.9606C29.8851 5.24921 33.4668 8.25284 33.4668 12.5989C33.4668 16.5728 29.8851 19.8207 25.9606 19.8207H24.0995Z",fill:"#0069AA"}),Object(l.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7.60352 30.098H7.66098C7.80812 30.098 7.96362 30.0775 7.96362 29.8614V27.6856C7.96362 27.4691 7.80812 27.4486 7.66098 27.4486H7.60352V27.3237C7.76305 27.3237 8.00854 27.3402 8.20958 27.3402C8.41403 27.3402 8.65921 27.3237 8.85158 27.3237V27.4486H8.79381C8.64729 27.4486 8.49147 27.4691 8.49147 27.6856V29.8614C8.49147 30.0775 8.64729 30.098 8.79381 30.098H8.85158V30.2228C8.65534 30.2228 8.40923 30.2068 8.2054 30.2068C8.00451 30.2068 7.76305 30.2228 7.60352 30.2228V30.098Z",fill:"#1A1919"}),Object(l.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8.85181 30.2406C8.65387 30.2406 8.409 30.2239 8.20532 30.2239C8.00506 30.2239 7.76437 30.2406 7.60375 30.2406H7.58594V30.0801H7.6609C7.80944 30.0765 7.9445 30.0644 7.94574 29.8614V27.6856C7.9445 27.4824 7.80944 27.4692 7.6609 27.4665H7.58594V27.3057H7.60375C7.76437 27.3057 8.0097 27.3219 8.20981 27.3219C8.41333 27.3219 8.65836 27.3057 8.85181 27.3057H8.87009V27.4665H8.79482C8.64613 27.4692 8.51029 27.4824 8.50952 27.6856V29.8614C8.51029 30.0644 8.64613 30.0765 8.79482 30.0801H8.87009V30.2406H8.85181ZM8.83398 30.2051L8.83413 30.1168H8.79464C8.64827 30.1168 8.47433 30.0907 8.4734 29.8614V27.6857C8.47433 27.456 8.64827 27.4304 8.79464 27.4304H8.83398V27.3417C8.64517 27.3419 8.40804 27.3585 8.20963 27.3585C8.01525 27.3585 7.77998 27.343 7.62154 27.3417V27.4304H7.66072C7.80662 27.4304 7.98087 27.456 7.98087 27.6857V29.8614C7.98087 30.0907 7.80662 30.1168 7.66072 30.1168H7.62154V30.2051C7.77998 30.2037 8.01107 30.1884 8.20514 30.1884C8.40448 30.1884 8.64099 30.204 8.83398 30.2051Z",fill:"#1A1919"}),Object(l.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M42.7169 27.2061C42.9638 27.2061 43.1479 27.3985 43.1479 27.6444C43.1479 27.8901 42.9638 28.0804 42.7169 28.0804C42.4706 28.0804 42.2861 27.8901 42.2861 27.6444C42.2861 27.3985 42.4706 27.2061 42.7169 27.2061ZM42.7168 27.9992C42.9101 27.9992 43.0577 27.8324 43.0577 27.6443C43.0577 27.456 42.9118 27.288 42.7168 27.288C42.5229 27.288 42.3754 27.456 42.3754 27.6443C42.3754 27.8324 42.5229 27.9992 42.7168 27.9992ZM42.5025 27.8751V27.8538C42.5551 27.8461 42.565 27.8475 42.565 27.8149V27.4907C42.565 27.4451 42.5606 27.4294 42.5042 27.4319V27.4096H42.7247C42.8005 27.4096 42.8703 27.4464 42.8703 27.5259C42.8703 27.5908 42.8282 27.6391 42.7684 27.6578L42.8393 27.7581C42.8723 27.8034 42.91 27.8461 42.9341 27.8612V27.8751H42.8503C42.8101 27.8751 42.7745 27.7892 42.6955 27.674H42.6478V27.8189C42.6478 27.8475 42.6577 27.8461 42.7106 27.8538V27.8751H42.5025ZM42.6481 27.6444H42.6989C42.7545 27.6444 42.7802 27.6018 42.7802 27.5328C42.7802 27.4633 42.7406 27.4386 42.6961 27.4386H42.6481V27.6444Z",fill:"#1A1919"})),f=()=>Object(l.createElement)("svg",{width:"52",height:"35",viewBox:"0 0 52 35",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Object(l.createElement)("rect",{x:"0.878906",y:"0.5",width:"50",height:"34",rx:"3.5",fill:"white",stroke:"#F3F3F3"}),Object(l.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M17.1461 17.7823C17.1461 19.9191 18.8322 21.576 21.0021 21.576C21.6154 21.576 22.141 21.456 22.7888 21.1524V19.4832C22.2192 20.0506 21.7145 20.2795 21.0685 20.2795C19.6332 20.2795 18.6146 19.2439 18.6146 17.7717C18.6146 16.376 19.6654 15.2751 21.0021 15.2751C21.6818 15.2751 22.1963 15.5163 22.7888 16.0929V14.4246C22.1633 14.1089 21.649 13.978 21.0357 13.978C18.8768 13.978 17.1461 15.6685 17.1461 17.7823ZM13.4892 16.0168C13.4892 16.4097 13.7401 16.6173 14.5953 16.9321C16.2163 17.5222 16.6967 18.0449 16.6967 19.2001C16.6967 20.6072 15.6577 21.5872 14.177 21.5872C13.0926 21.5872 12.304 21.1622 11.6475 20.2031L12.5682 19.3209C12.8962 19.9523 13.4437 20.2907 14.1234 20.2907C14.7593 20.2907 15.2298 19.8542 15.2298 19.2653C15.2298 18.96 15.0873 18.6979 14.8025 18.5128C14.6594 18.4252 14.3754 18.2949 13.8174 18.0988C12.479 17.6197 12.0201 17.1068 12.0201 16.1053C12.0201 14.9155 13.006 14.0224 14.2987 14.0224C15.0997 14.0224 15.8327 14.2948 16.4455 14.8282L15.6998 15.7997C15.3286 15.3857 14.9775 15.211 14.5507 15.211C13.9366 15.211 13.4892 15.559 13.4892 16.0168ZM9.68583 21.4123H11.1109V14.1424H9.68583V21.4123ZM6.77288 19.6035C6.32524 20.006 5.74353 20.1815 4.82283 20.1815H4.44039V15.374H4.82283C5.74353 15.374 6.30238 15.538 6.77288 15.9621C7.26569 16.3986 7.56205 17.0755 7.56205 17.7717C7.56205 18.4697 7.26569 19.1671 6.77288 19.6035ZM5.10834 14.1424H3.0166V21.4121H5.09733C6.20374 21.4121 7.0025 21.1525 7.70389 20.5728C8.53737 19.8867 9.03017 18.8523 9.03017 17.7824C9.03017 15.6369 7.41938 14.1424 5.10834 14.1424ZM32.1394 14.1424L34.0875 19.0255L36.061 14.1424H37.6057L34.4496 21.5988H33.6828L30.5826 14.1424H32.1394ZM38.2501 21.4122H42.2913V20.1815H39.6741V18.2191H42.1951V16.9878H39.6741V15.3742H42.2913V14.1424H38.2501V21.4122ZM44.6585 17.4893H45.0748C45.9851 17.4893 46.4674 17.0958 46.4674 16.365C46.4674 15.6575 45.9851 15.2876 45.0974 15.2876H44.6585V17.4893ZM45.3485 14.1422C46.9918 14.1422 47.9339 14.9275 47.9339 16.2886C47.9339 17.4016 47.3429 18.1325 46.2695 18.3496L48.5695 21.4121H46.817L44.8447 18.4917H44.6587V21.4121H43.2353V14.1422H45.3485Z",fill:"#1D1D1B"}),Object(l.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M30.415 19.8859C31.5716 18.0862 31.0433 15.6953 29.235 14.5445C27.4267 13.3937 25.0236 13.9191 23.867 15.7188C22.7107 17.518 23.2391 19.9096 25.0474 21.0604C26.8557 22.2112 29.2587 21.6851 30.415 19.8859Z",fill:"url(#paint0_linear)"}),Object(l.createElement)("defs",null,Object(l.createElement)("linearGradient",{id:"paint0_linear",x1:"32.5088",y1:"16.6279",x2:"25.9795",y2:"12.4317",gradientUnits:"userSpaceOnUse"},Object(l.createElement)("stop",{stopColor:"#F6A000"}),Object(l.createElement)("stop",{offset:"0.623918",stopColor:"#E47E02"}),Object(l.createElement)("stop",{offset:"1",stopColor:"#D36002"})))),p=()=>Object(l.createElement)("svg",{width:"51",height:"35",viewBox:"0 0 51 35",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Object(l.createElement)("rect",{x:"0.878906",y:"0.5",width:"49",height:"34",rx:"3.5",fill:"white",stroke:"#F3F3F3"}),Object(l.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M33.473 17.5973H33.494H33.5346H33.5752H33.6158H33.6564H33.697H33.7376H33.7782H33.8188H33.8594H33.9H33.9406H33.9812H34.0218H34.0624H34.103H34.1436H34.1842H34.2248H34.2654H34.306H34.3466H34.3872H34.4278H34.4684H34.509H34.5496H34.5902H34.6308H34.6714H34.712H34.7527H34.7932H34.8338H34.8745H34.915H34.9556H34.9963H35.0368H35.0774H35.1181H35.1586H35.1992H35.2399H35.2805H35.321H35.3617H35.4023H35.4428H35.4835H35.5241H35.5646H35.6053H35.6459H35.6864H35.7271H35.7677H35.8083H35.8489H35.8895H35.9233L35.9301 17.5975C35.9426 17.5978 35.9563 17.5984 35.9707 17.5991C35.9837 17.5999 35.9973 17.6008 36.0113 17.6018C36.0246 17.6028 36.0383 17.604 36.0519 17.6052C36.0656 17.6065 36.0792 17.6079 36.0925 17.6093C36.1064 17.6109 36.1201 17.6126 36.1331 17.6143C36.1476 17.6163 36.1613 17.6183 36.1737 17.6205C36.1826 17.622 36.1909 17.6235 36.1982 17.6251L36.2143 17.6288C36.2279 17.632 36.2414 17.6354 36.2549 17.6392C36.2685 17.643 36.282 17.647 36.2955 17.6513C36.3091 17.6557 36.3227 17.6603 36.3361 17.6653C36.3497 17.6702 36.3632 17.6755 36.3767 17.681C36.3903 17.6866 36.4039 17.6926 36.4173 17.6987C36.431 17.705 36.4445 17.7116 36.4579 17.7185C36.4716 17.7254 36.4851 17.7328 36.4985 17.7403C36.5122 17.7481 36.5257 17.7562 36.5391 17.7646C36.5528 17.7732 36.5664 17.7821 36.5797 17.7913C36.5934 17.8008 36.607 17.8105 36.6203 17.8206C36.634 17.8311 36.6476 17.8419 36.6609 17.8531C36.6747 17.8646 36.6882 17.8766 36.7015 17.8889C36.7154 17.9017 36.7289 17.9148 36.7421 17.9284C36.7561 17.9426 36.7695 17.9574 36.7827 17.9725C36.7967 17.9885 36.8102 18.005 36.8233 18.0219C36.8374 18.0401 36.8509 18.0587 36.8639 18.0779C36.8781 18.0989 36.8917 18.1205 36.9045 18.1426C36.919 18.1675 36.9325 18.1932 36.9451 18.2196C36.96 18.2508 36.9736 18.283 36.9857 18.3161C37.002 18.3606 37.0156 18.4067 37.0263 18.4544C37.0449 18.5369 37.0549 18.6238 37.0549 18.7145C37.0549 18.8057 37.0449 18.893 37.0263 18.9758C37.0156 19.0235 37.002 19.0698 36.9857 19.1143C36.9736 19.1476 36.96 19.1798 36.9451 19.2111C36.9325 19.2375 36.919 19.2632 36.9045 19.2882C36.8917 19.3103 36.8782 19.3319 36.8639 19.3529C36.8509 19.3721 36.8374 19.3908 36.8233 19.409C36.8102 19.4259 36.7967 19.4423 36.7827 19.4584C36.7695 19.4734 36.756 19.4881 36.7421 19.5024C36.7289 19.516 36.7153 19.5291 36.7015 19.5419C36.6882 19.5541 36.6747 19.566 36.6609 19.5775C36.6476 19.5886 36.6341 19.5995 36.6203 19.6099C36.607 19.62 36.5934 19.6297 36.5797 19.6391C36.5664 19.6483 36.5528 19.6572 36.5391 19.6657C36.5257 19.674 36.5122 19.6821 36.4985 19.6898C36.4851 19.6974 36.4716 19.7046 36.4579 19.7116C36.4445 19.7184 36.431 19.7249 36.4173 19.7312C36.4039 19.7373 36.3903 19.7432 36.3767 19.7488C36.3632 19.7542 36.3497 19.7595 36.3361 19.7644C36.3227 19.7692 36.3091 19.7738 36.2955 19.7781C36.282 19.7824 36.2685 19.7863 36.2549 19.7901C36.2414 19.7937 36.2279 19.7971 36.2143 19.8003L36.1982 19.8039C36.1909 19.8056 36.1826 19.8073 36.1737 19.8089C36.1613 19.8111 36.1476 19.8132 36.1331 19.8152C36.1201 19.8169 36.1064 19.8186 36.0925 19.8202C36.0792 19.8217 36.0656 19.823 36.0519 19.8243C36.0383 19.8255 36.0246 19.8266 36.0113 19.8276C35.9973 19.8286 35.9837 19.8295 35.9707 19.8301C35.9563 19.8309 35.9426 19.8314 35.9301 19.8317L35.9083 19.832H35.8895H35.8489H35.8083H35.7677H35.7271H35.6864H35.6459H35.6053H35.5646H35.5241H35.4835H35.4428H35.4023H35.3617H35.321H35.2805H35.2399H35.1992H35.1586H35.1181H35.0774H35.0368H34.9963H34.9556H34.915H34.8745H34.8338H34.7932H34.7527H34.712H34.6714H34.6308H34.5902H34.5496H34.509H34.4684H34.4278H34.3872H34.3466H34.306H34.2654H34.2248H34.1842H34.1436H34.103H34.0624H34.0218H33.9812H33.9406H33.9H33.8594H33.8188H33.7782H33.7376H33.697H33.6564H33.6158H33.5752H33.5346H33.494H33.473V17.5973ZM36.7423 15.0681C36.7586 15.1431 36.7673 15.2226 36.7673 15.3062C36.7673 15.3898 36.7586 15.4691 36.7423 15.5441C36.7318 15.5923 36.7181 15.6385 36.7016 15.6829C36.6896 15.7153 36.676 15.7467 36.661 15.7769C36.6485 15.8023 36.6349 15.8269 36.6204 15.8508C36.6076 15.8718 36.594 15.8923 36.5798 15.9122C36.5668 15.9303 36.5533 15.9478 36.5392 15.9649C36.5261 15.9807 36.5126 15.9961 36.4986 16.011C36.4855 16.0251 36.472 16.0387 36.4581 16.0518C36.4448 16.0644 36.4313 16.0765 36.4174 16.0883C36.4042 16.0996 36.3906 16.1104 36.3768 16.121C36.3636 16.1311 36.35 16.1409 36.3363 16.1504C36.3229 16.1596 36.3094 16.1684 36.2956 16.1769C36.2823 16.1852 36.2687 16.1931 36.255 16.2007C36.2417 16.2082 36.2281 16.2154 36.2145 16.2222C36.2011 16.2289 36.1875 16.2353 36.1738 16.2415C36.1604 16.2475 36.1469 16.2532 36.1332 16.2586C36.1198 16.2639 36.1063 16.269 36.0926 16.2737C36.0792 16.2784 36.0657 16.2829 36.0521 16.287C36.0386 16.2911 36.0251 16.295 36.0114 16.2985C35.998 16.3021 35.9845 16.3053 35.9708 16.3083C35.9574 16.3113 35.9439 16.3139 35.9303 16.3164L35.9204 16.3182C35.9125 16.3195 35.902 16.3211 35.8896 16.3227C35.8777 16.3242 35.8639 16.3258 35.849 16.3273C35.8362 16.3286 35.8225 16.3299 35.8085 16.3311C35.7952 16.3322 35.7815 16.3332 35.7678 16.334C35.7542 16.3349 35.7405 16.3357 35.7272 16.3362C35.7132 16.3368 35.6995 16.3372 35.6867 16.3372L35.6802 16.3373H35.6461H35.6054H35.5648H35.5243H35.4836H35.443H35.4025H35.3619H35.3212H35.2807H35.2401H35.1994H35.1589H35.1183H35.0776H35.037H34.9965H34.9559H34.9152H34.8747H34.8341H34.7934H34.7529H34.7123H34.6716H34.6311H34.5905H34.5499H34.5092H34.4687H34.4281H34.3874H34.3469H34.3063H34.2657H34.2251H34.1845H34.1439H34.1033H34.0627H34.0221H33.9814H33.9409H33.9003H33.8597H33.8191H33.7785H33.7379H33.6973H33.6567H33.6161H33.5754H33.5349H33.4943H33.473V14.2751H33.4943H33.5349H33.5754H33.6161H33.6567H33.6973H33.7379H33.7785H33.8191H33.8597H33.9003H33.9409H33.9814H34.0221H34.0627H34.1033H34.1439H34.1845H34.2251H34.2657H34.3063H34.3469H34.3874H34.4281H34.4687H34.5092H34.5499H34.5905H34.6311H34.6716H34.7123H34.7529H34.7934H34.8341H34.8747H34.9152H34.9559H34.9965H35.037H35.0776H35.1183H35.1589H35.1994H35.2401H35.2807H35.3212H35.3619H35.4025H35.443H35.4836H35.5243H35.5648H35.6054H35.6461H35.6867H35.7037L35.7272 14.2759C35.7405 14.2764 35.7542 14.2772 35.7678 14.2781C35.7815 14.279 35.7952 14.28 35.8085 14.2811C35.8225 14.2822 35.8362 14.2835 35.849 14.2848C35.8639 14.2862 35.8777 14.2877 35.8896 14.2891C35.902 14.2905 35.9125 14.2919 35.9204 14.293L35.9303 14.2948C35.9439 14.2972 35.9574 14.3 35.9708 14.303C35.9845 14.306 35.998 14.3093 36.0114 14.3129C36.0251 14.3165 36.0386 14.3203 36.0521 14.3245C36.0657 14.3287 36.0792 14.3331 36.0926 14.3378C36.1063 14.3427 36.1198 14.3477 36.1332 14.3531C36.1469 14.3585 36.1604 14.3643 36.1738 14.3703C36.1875 14.3765 36.2011 14.3829 36.2145 14.3896C36.2281 14.3965 36.2417 14.4036 36.255 14.4111C36.2687 14.4187 36.2823 14.4267 36.2956 14.435C36.3094 14.4435 36.3229 14.4523 36.3363 14.4615C36.35 14.4709 36.3636 14.4808 36.3768 14.491C36.3906 14.5015 36.4042 14.5124 36.4174 14.5237C36.4313 14.5355 36.4448 14.5476 36.4581 14.5602C36.472 14.5733 36.4855 14.5869 36.4986 14.601C36.5126 14.6159 36.5261 14.6313 36.5392 14.6471C36.5533 14.6642 36.5668 14.6818 36.5798 14.6999C36.594 14.7197 36.6076 14.7402 36.6204 14.7613C36.6349 14.7851 36.6485 14.8097 36.661 14.8351C36.676 14.8654 36.6896 14.8968 36.7016 14.9292C36.7181 14.9736 36.7318 15.0199 36.7423 15.0681ZM41.7774 4.375H41.7941L41.794 25.5542C41.794 25.6807 41.7882 25.8059 41.7774 25.9296C41.7679 26.0385 41.7543 26.1462 41.7368 26.2526C41.725 26.324 41.7115 26.3948 41.6962 26.465C41.6838 26.5221 41.6703 26.5789 41.6556 26.6351C41.6429 26.6836 41.6293 26.7318 41.615 26.7796C41.602 26.8228 41.5886 26.8658 41.5744 26.9085C41.5614 26.9472 41.5478 26.9855 41.5338 27.0237C41.5207 27.0593 41.5071 27.0946 41.4932 27.1297C41.48 27.1627 41.4665 27.1954 41.4526 27.228C41.4394 27.2588 41.4258 27.2895 41.4119 27.3199C41.3987 27.3489 41.3852 27.3778 41.3714 27.4064C41.3581 27.4339 41.3446 27.4612 41.3307 27.4883C41.3175 27.5143 41.3039 27.5402 41.2901 27.5659C41.2769 27.5906 41.2632 27.615 41.2495 27.6394C41.2362 27.663 41.2227 27.6865 41.2089 27.7098C41.1956 27.7325 41.182 27.755 41.1683 27.7775C41.1549 27.7993 41.1414 27.8211 41.1277 27.8427C41.1144 27.8635 41.1007 27.8842 41.0871 27.9049C41.0737 27.9249 41.0601 27.9448 41.0465 27.9647C41.0331 27.9841 41.0195 28.0036 41.0058 28.0228C40.9924 28.0416 40.979 28.0603 40.9653 28.0789C40.9519 28.097 40.9383 28.1148 40.9246 28.1327C40.9112 28.1503 40.8977 28.1678 40.884 28.1852C40.8706 28.2022 40.8571 28.2191 40.8434 28.2359C40.83 28.2523 40.8164 28.2686 40.8028 28.2849C40.7893 28.3009 40.7759 28.3171 40.7622 28.3329C40.7488 28.3484 40.7352 28.3637 40.7216 28.379C40.7082 28.3941 40.6946 28.4091 40.681 28.424C40.6675 28.4387 40.6541 28.4534 40.6404 28.4679C40.627 28.4821 40.6134 28.4961 40.5998 28.5102C40.5863 28.5241 40.5729 28.5382 40.5592 28.5519C40.5458 28.5654 40.5321 28.5786 40.5186 28.5919C40.5051 28.605 40.4916 28.6182 40.4779 28.6313C40.4645 28.644 40.451 28.6567 40.4374 28.6693C40.4239 28.6818 40.4103 28.6942 40.3967 28.7065C40.3833 28.7187 40.3698 28.7308 40.3561 28.7428C40.3427 28.7546 40.3291 28.7664 40.3155 28.7781C40.302 28.7896 40.2886 28.8012 40.2749 28.8126C40.2615 28.8239 40.2479 28.8349 40.2343 28.846C40.2208 28.857 40.2073 28.8681 40.1937 28.8789C40.1803 28.8896 40.1667 28.9001 40.1531 28.9106C40.1396 28.9211 40.1261 28.9316 40.1125 28.942C40.0991 28.9521 40.0854 28.9621 40.0719 28.9721C40.0583 28.9821 40.0449 28.9921 40.0313 29.002C40.0178 29.0117 40.0042 29.0211 39.9907 29.0306C39.9771 29.0401 39.9637 29.0496 39.95 29.059C39.9366 29.0682 39.923 29.0772 39.9095 29.0862C39.896 29.0953 39.8825 29.1043 39.8688 29.1132C39.8554 29.122 39.8418 29.1306 39.8282 29.1392C39.8147 29.1477 39.8012 29.1563 39.7876 29.1647C39.7742 29.1731 39.7606 29.1813 39.747 29.1895L39.7064 29.2137C39.6929 29.2216 39.6794 29.2295 39.6658 29.2373C39.6524 29.2451 39.6388 29.2526 39.6252 29.2602C39.6117 29.2678 39.5982 29.2754 39.5846 29.2828C39.5711 29.2901 39.5575 29.2972 39.544 29.3044C39.5304 29.3115 39.517 29.3189 39.5034 29.326C39.4899 29.3329 39.4763 29.3395 39.4628 29.3463C39.4492 29.3531 39.4358 29.36 39.4221 29.3666C39.4087 29.3732 39.3951 29.3796 39.3816 29.3861L39.3409 29.4052L39.3003 29.4237C39.2868 29.4298 39.2733 29.4357 39.2597 29.4416C39.2462 29.4475 39.2327 29.4536 39.2191 29.4593C39.2057 29.4651 39.1921 29.4704 39.1785 29.476C39.165 29.4816 39.1515 29.4873 39.1379 29.4927C39.1244 29.4981 39.1109 29.5032 39.0973 29.5085C39.0838 29.5137 39.0703 29.5189 39.0567 29.524L39.0161 29.5391C39.0026 29.544 38.989 29.5487 38.9755 29.5535C38.9619 29.5583 38.9485 29.5632 38.9349 29.5679C38.9214 29.5724 38.9078 29.5767 38.8942 29.5811L38.8537 29.5944C38.8402 29.5987 38.8266 29.6028 38.813 29.607L38.7724 29.6192C38.7589 29.6232 38.7454 29.6273 38.7318 29.6311C38.7184 29.635 38.7048 29.6385 38.6912 29.6422C38.6777 29.6459 38.6642 29.6497 38.6506 29.6533L38.61 29.6636L38.5694 29.6735L38.5288 29.6833C38.5153 29.6864 38.5017 29.6892 38.4882 29.6922C38.4746 29.6952 38.4611 29.6983 38.4476 29.7011L38.407 29.7093L38.3663 29.7171C38.3528 29.7196 38.3393 29.7224 38.3257 29.7248C38.3123 29.7272 38.2987 29.7293 38.2851 29.7316L38.2445 29.7383L38.2039 29.7445L38.1633 29.7502C38.1498 29.7521 38.1363 29.7542 38.1227 29.7559C38.1092 29.7577 38.0956 29.759 38.0821 29.7606C38.0686 29.7622 38.0551 29.7638 38.0415 29.7653C38.028 29.7667 38.0145 29.7682 38.0009 29.7695C37.9874 29.7709 37.9738 29.772 37.9603 29.7732C37.9467 29.7744 37.9332 29.7757 37.9197 29.7768C37.9062 29.7778 37.8926 29.7787 37.8791 29.7796L37.8384 29.7822C37.8249 29.783 37.8114 29.784 37.7978 29.7847C37.7844 29.7854 37.7708 29.7857 37.7572 29.7863L37.7166 29.7878L37.676 29.7889C37.6625 29.7892 37.649 29.7892 37.6354 29.7894L37.5948 29.7899L37.5864 29.79H37.5542H37.5136H37.473H37.4324H37.3917H37.3512H37.3105H37.2699H37.2293H37.1887H37.1481H37.1075H37.0669H37.0263H36.9857H36.9451H36.9045H36.8638H36.8233H36.7826H36.742H36.7014H36.6608H36.6202H36.5796H36.539H36.4984H36.4578H36.4172H36.3766H36.3359H36.2954H36.2547H36.2141H36.1735H36.1329H36.0923H36.0517H36.0111H35.9705H35.9299H35.8893H35.8487H35.808H35.7675H35.7268H35.6862H35.6456H35.605H35.5644H35.5238H35.4832H35.4426H35.402H35.3614H35.3208H35.2801H35.2396H35.1989H35.1583H35.1177H35.0771H35.0365H34.9959H34.9553H34.9147H34.8741H34.8335H34.7929H34.7522H34.7117H34.671H34.6304H34.5898H34.5492H34.5086H34.468H34.4274H34.3868H34.3462H34.3056H34.265H34.2243H34.1838H34.1431H34.1025H34.0619H34.0213H33.9807H33.9401H33.8995H33.8589H33.8183H33.7777H33.7371H33.6964H33.6559H33.6152H33.5746H33.534H33.4934H33.4528H33.4122H33.3716H33.331H33.2904H33.2498H33.2092H33.1685H33.128H33.0873H33.0467H33.0061H32.9655H32.9249H32.8843H32.8437H32.8031H32.7625H32.7219H32.6813H32.6406H32.6H32.5594H32.5188H32.4782H32.4376H32.397H32.3564H32.3158H32.2752H32.2346H32.194H32.1534H32.1127H32.0721H32.0315H31.9909H31.9503H31.9097H31.8691H31.8285H31.7879H31.7473H31.7067H31.666H31.6255H31.5848H31.5442H31.5036H31.416V21.1545H31.5036H31.5442H31.5848H31.6255H31.666H31.7067H31.7473H31.7879H31.8285H31.8691H31.9097H31.9503H31.9909H32.0315H32.0721H32.1127H32.1534H32.194H32.2346H32.2752H32.3158H32.3564H32.397H32.4376H32.4782H32.5188H32.5594H32.6H32.6406H32.6813H32.7219H32.7625H32.8031H32.8437H32.8843H32.9249H32.9655H33.0061H33.0467H33.0873H33.128H33.1685H33.2092H33.2498H33.2904H33.331H33.3716H33.4122H33.4528H33.4934H33.534H33.5746H33.6152H33.6559H33.6964H33.7371H33.7777H33.8183H33.8589H33.8995H33.9401H33.9807H34.0213H34.0619H34.1025H34.1431H34.1838H34.2243H34.265H34.3056H34.3462H34.3868H34.4274H34.468H34.5086H34.5492H34.5898H34.6304H34.671H34.7117H34.7522H34.7929H34.8335H34.8741H34.9147H34.9553H34.9959H35.0365H35.0771H35.1177H35.1583H35.1989H35.2396H35.2801H35.3208H35.3614H35.402H35.4426H35.4832H35.5238H35.5644H35.605H35.6456H35.6862H35.7268H35.7675H35.808H35.8487H35.8893H35.9299H35.9705H36.0111H36.0517H36.0923H36.1329H36.1735H36.2141H36.2547H36.2954H36.3359H36.3766H36.4172H36.4578H36.4984H36.539H36.5796H36.6202H36.6608H36.7014H36.742H36.7826H36.8233H36.8638H36.9045H36.9451H36.9857H37.0263H37.0669H37.1075H37.1481H37.1887H37.2293H37.2699H37.3105H37.3512H37.3917H37.4324H37.473H37.5136H37.5542H37.5948H37.6354H37.676H37.7166H37.7572H37.7978H37.8384H37.8791H37.9197H37.9412L37.9603 21.1543L38.0009 21.154L38.0415 21.1532C38.0551 21.1528 38.0686 21.1526 38.0821 21.1521C38.0957 21.1517 38.1092 21.151 38.1227 21.1504L38.1633 21.1485L38.2039 21.146L38.2445 21.1432L38.2851 21.14L38.3257 21.1363C38.3393 21.135 38.3529 21.1337 38.3663 21.1323C38.3799 21.1309 38.3934 21.1293 38.407 21.1277L38.4476 21.1227C38.4611 21.1209 38.4747 21.1192 38.4882 21.1173C38.5018 21.1154 38.5153 21.1133 38.5288 21.1113C38.5424 21.1092 38.5559 21.1072 38.5694 21.105L38.61 21.0981L38.6506 21.0908C38.6642 21.0882 38.6778 21.0858 38.6912 21.0831C38.7048 21.0804 38.7183 21.0775 38.7318 21.0746L38.7724 21.0658C38.786 21.0627 38.7996 21.0597 38.813 21.0565C38.8267 21.0533 38.8402 21.0498 38.8537 21.0465C38.8672 21.0431 38.8808 21.0396 38.8942 21.0361C38.9078 21.0325 38.9214 21.0288 38.9349 21.0251C38.9485 21.0213 38.962 21.0174 38.9755 21.0134C38.9891 21.0095 39.0026 21.0054 39.0161 21.0013L39.0567 20.9885C39.0703 20.9841 39.0838 20.9796 39.0973 20.975C39.1109 20.9704 39.1245 20.9658 39.1379 20.961C39.1515 20.9562 39.1651 20.9514 39.1785 20.9464C39.1922 20.9413 39.2056 20.9361 39.2191 20.9308C39.2327 20.9256 39.2463 20.9202 39.2597 20.9147C39.2733 20.9092 39.2869 20.9037 39.3003 20.898C39.314 20.8923 39.3275 20.8864 39.3409 20.8804C39.3546 20.8744 39.3681 20.8682 39.3816 20.862C39.3951 20.8557 39.4087 20.8493 39.4221 20.8429C39.4357 20.8363 39.4493 20.8297 39.4628 20.823C39.4764 20.8161 39.4899 20.8091 39.5034 20.802C39.517 20.7949 39.5305 20.7875 39.544 20.7801C39.5576 20.7727 39.5712 20.7651 39.5846 20.7574C39.5982 20.7496 39.6118 20.7417 39.6252 20.7337C39.6388 20.7256 39.6524 20.7174 39.6658 20.709C39.6795 20.7004 39.693 20.6917 39.7064 20.683C39.7201 20.674 39.7336 20.6649 39.747 20.6558C39.7607 20.6464 39.7742 20.6369 39.7876 20.6274C39.8013 20.6176 39.8148 20.6077 39.8282 20.5976C39.8419 20.5874 39.8555 20.577 39.8688 20.5665C39.8825 20.5558 39.8961 20.5449 39.9095 20.5339C39.9232 20.5226 39.9367 20.5112 39.95 20.4996C39.9638 20.4878 39.9773 20.4757 39.9907 20.4636C40.0044 20.451 40.0179 20.4383 40.0313 20.4255C40.045 20.4123 40.0586 20.3989 40.0719 20.3854C40.0857 20.3714 40.0992 20.3572 40.1125 20.3428C40.1263 20.328 40.1398 20.3129 40.1531 20.2977C40.1669 20.2819 40.1805 20.2658 40.1937 20.2496C40.2075 20.2327 40.2211 20.2156 40.2343 20.1983C40.2481 20.1801 40.2618 20.1618 40.2749 20.1432C40.2889 20.1235 40.3023 20.1034 40.3155 20.0831C40.3295 20.0616 40.343 20.0399 40.3561 20.0179C40.3702 19.9942 40.3837 19.9701 40.3967 19.9458C40.4109 19.9193 40.4245 19.8926 40.4374 19.8654C40.4517 19.835 40.4652 19.8041 40.4779 19.7728C40.4926 19.7368 40.5061 19.7004 40.5186 19.6634C40.5338 19.6177 40.5473 19.5711 40.5592 19.5237C40.5765 19.4544 40.5901 19.3833 40.5998 19.3104C40.6116 19.222 40.6178 19.1312 40.6178 19.0378C40.6178 18.9469 40.6116 18.8586 40.5998 18.7728C40.5901 18.7024 40.5765 18.6337 40.5592 18.5668C40.5473 18.5213 40.5338 18.4766 40.5186 18.4327C40.5061 18.3968 40.4926 18.3613 40.4779 18.3266C40.4653 18.2964 40.4517 18.2667 40.4374 18.2375C40.4245 18.2112 40.4109 18.1853 40.3967 18.1598C40.3837 18.1363 40.3702 18.113 40.3561 18.0901C40.3431 18.0689 40.3295 18.0479 40.3155 18.0273C40.3024 18.0078 40.2889 17.9884 40.2749 17.9694C40.2618 17.9514 40.2482 17.9337 40.2343 17.9163C40.2211 17.8995 40.2075 17.883 40.1937 17.8667C40.1804 17.851 40.1669 17.8355 40.1531 17.8202C40.1398 17.8055 40.1263 17.791 40.1125 17.7767C40.0992 17.7628 40.0856 17.7492 40.0719 17.7357C40.0586 17.7226 40.045 17.7097 40.0313 17.697C40.0179 17.6846 40.0044 17.6724 39.9907 17.6604C39.9773 17.6486 39.9638 17.637 39.95 17.6255C39.9367 17.6143 39.9232 17.6033 39.9095 17.5924C39.8961 17.5817 39.8825 17.5712 39.8688 17.5608C39.8554 17.5507 39.8419 17.5407 39.8282 17.5307C39.8148 17.5211 39.8013 17.5115 39.7876 17.502C39.7742 17.4928 39.7607 17.4836 39.747 17.4745C39.7336 17.4657 39.7201 17.4569 39.7064 17.4482C39.693 17.4398 39.6795 17.4314 39.6658 17.4231C39.6524 17.415 39.6389 17.407 39.6252 17.3991C39.6118 17.3913 39.5982 17.3837 39.5846 17.3761C39.5712 17.3687 39.5576 17.3614 39.544 17.3541C39.5305 17.347 39.517 17.3399 39.5034 17.333C39.4899 17.3261 39.4764 17.3193 39.4628 17.3126C39.4493 17.3061 39.4358 17.2995 39.4221 17.2931C39.4087 17.2868 39.3951 17.2807 39.3816 17.2746C39.3681 17.2685 39.3546 17.2626 39.3409 17.2567C39.3275 17.251 39.3139 17.2453 39.3003 17.2396C39.2868 17.2341 39.2734 17.2285 39.2597 17.2231C39.2463 17.2178 39.2327 17.2126 39.2191 17.2074C39.2057 17.2023 39.1921 17.1974 39.1785 17.1925C39.165 17.1876 39.1515 17.1828 39.1379 17.1781C39.1244 17.1734 39.1109 17.1688 39.0973 17.1642C39.0838 17.1598 39.0703 17.1554 39.0567 17.1511C39.0432 17.1468 39.0296 17.1427 39.0161 17.1386L38.9755 17.1266C38.962 17.1227 38.9485 17.1188 38.9349 17.1151C38.9214 17.1114 38.9078 17.1078 38.8942 17.1043C38.8808 17.1008 38.8672 17.0974 38.8537 17.094C38.8402 17.0906 38.8266 17.0873 38.813 17.0841C38.7996 17.0809 38.786 17.0779 38.7724 17.0748C38.759 17.0718 38.7454 17.069 38.7318 17.0661C38.7183 17.0633 38.7048 17.0604 38.6912 17.0577L38.6506 17.0499L38.61 17.0426C38.5965 17.0403 38.583 17.0379 38.5694 17.0357L38.5288 17.0292C38.5153 17.0272 38.5017 17.0252 38.4882 17.0233L38.4476 17.0178L38.407 17.0126L38.3663 17.008L38.3257 17.0037L38.2851 16.9999L38.2445 16.9965L38.207 16.9936L38.207 16.9446L38.2445 16.9387L38.2851 16.932C38.2987 16.9296 38.3123 16.9273 38.3257 16.9248L38.3663 16.9169C38.38 16.9142 38.3935 16.9114 38.407 16.9085L38.4476 16.8996C38.4611 16.8965 38.4747 16.8934 38.4882 16.8902C38.5018 16.8869 38.5153 16.8834 38.5288 16.8799C38.5424 16.8764 38.5559 16.8728 38.5694 16.8691C38.583 16.8654 38.5965 16.8616 38.61 16.8577C38.6236 16.8538 38.6372 16.8498 38.6506 16.8457C38.6642 16.8416 38.6778 16.8373 38.6912 16.833C38.7049 16.8286 38.7184 16.824 38.7318 16.8195C38.7455 16.8148 38.759 16.81 38.7724 16.8052C38.7861 16.8003 38.7996 16.7954 38.813 16.7903C38.8267 16.7852 38.8402 16.7799 38.8537 16.7746C38.8673 16.7692 38.8808 16.7637 38.8942 16.7581C38.9079 16.7524 38.9214 16.7467 38.9349 16.7408C38.9485 16.7348 38.962 16.7287 38.9755 16.7225C38.9891 16.7162 39.0026 16.7098 39.0161 16.7033C39.0297 16.6967 39.0433 16.6899 39.0567 16.6831C39.0703 16.6761 39.0839 16.6691 39.0973 16.662C39.111 16.6547 39.1245 16.6472 39.1379 16.6398C39.1516 16.6321 39.1651 16.6243 39.1785 16.6165C39.1922 16.6084 39.2057 16.6003 39.2191 16.592C39.2328 16.5836 39.2463 16.575 39.2597 16.5664C39.2734 16.5575 39.2869 16.5485 39.3003 16.5394C39.314 16.53 39.3276 16.5206 39.3409 16.511C39.3547 16.5012 39.3682 16.4912 39.3816 16.4812C39.3953 16.4708 39.4088 16.4604 39.4221 16.4498C39.4359 16.4389 39.4494 16.4279 39.4628 16.4167C39.4765 16.4052 39.49 16.3935 39.5034 16.3817C39.5172 16.3695 39.5307 16.3571 39.544 16.3446C39.5577 16.3317 39.5713 16.3186 39.5846 16.3054C39.5984 16.2917 39.6119 16.2779 39.6252 16.2639C39.639 16.2493 39.6526 16.2345 39.6658 16.2195C39.6796 16.2039 39.6932 16.1881 39.7064 16.1721C39.7203 16.1554 39.7338 16.1385 39.747 16.1214C39.7609 16.1033 39.7745 16.085 39.7876 16.0665C39.8016 16.0469 39.8151 16.027 39.8282 16.007C39.8422 15.9856 39.8558 15.9639 39.8688 15.942C39.8829 15.9183 39.8965 15.8942 39.9095 15.8699C39.9237 15.8432 39.9372 15.8162 39.95 15.7888C39.9645 15.7581 39.978 15.7268 39.9907 15.6953C40.0054 15.6586 40.0189 15.6214 40.0313 15.5836C40.0467 15.5362 40.0603 15.488 40.0719 15.4393C40.0906 15.3601 40.1042 15.2793 40.1125 15.1971C40.1191 15.1322 40.1225 15.0665 40.1225 15.0001C40.1225 14.93 40.1191 14.8616 40.1125 14.795C40.1041 14.7098 40.0905 14.6275 40.0719 14.5481C40.0603 14.4985 40.0467 14.45 40.0313 14.4027C40.0189 14.3648 40.0054 14.3277 39.9907 14.2913C39.978 14.26 39.9644 14.2292 39.95 14.199C39.9372 14.172 39.9236 14.1455 39.9095 14.1194C39.8965 14.0955 39.8829 14.072 39.8688 14.0488C39.8557 14.0273 39.8422 14.0061 39.8282 13.9852C39.8151 13.9656 39.8015 13.9464 39.7876 13.9274C39.7745 13.9095 39.7609 13.8917 39.747 13.8743C39.7338 13.8576 39.7203 13.8411 39.7064 13.8249C39.6932 13.8095 39.6796 13.7943 39.6658 13.7793C39.6526 13.7649 39.639 13.7506 39.6252 13.7366C39.6119 13.723 39.5984 13.7097 39.5846 13.6965C39.5713 13.6837 39.5577 13.6711 39.544 13.6587C39.5307 13.6466 39.5171 13.6347 39.5034 13.623C39.49 13.6116 39.4765 13.6004 39.4628 13.5893C39.4494 13.5785 39.4359 13.5678 39.4221 13.5574C39.4088 13.5471 39.3952 13.5371 39.3816 13.5272C39.3682 13.5174 39.3546 13.5079 39.3409 13.4984C39.3275 13.4892 39.314 13.4801 39.3003 13.4711C39.2869 13.4623 39.2734 13.4537 39.2597 13.4451C39.2463 13.4367 39.2328 13.4285 39.2191 13.4204C39.2057 13.4124 39.1922 13.4045 39.1785 13.3968C39.1651 13.3891 39.1516 13.3816 39.1379 13.3742C39.1245 13.3669 39.111 13.3598 39.0973 13.3527C39.0839 13.3458 39.0703 13.339 39.0567 13.3322C39.0432 13.3256 39.0297 13.319 39.0161 13.3126C39.0026 13.3062 38.9891 13.2999 38.9755 13.2938C38.962 13.2878 38.9485 13.282 38.9349 13.2761C38.9214 13.2704 38.9078 13.2647 38.8942 13.2591C38.8808 13.2536 38.8672 13.2482 38.8537 13.2429C38.8402 13.2376 38.8267 13.2324 38.813 13.2273C38.7996 13.2223 38.7861 13.2174 38.7724 13.2126C38.759 13.2078 38.7454 13.2031 38.7318 13.1985C38.7184 13.194 38.7048 13.1895 38.6912 13.1852C38.6778 13.1808 38.6642 13.1766 38.6506 13.1724C38.6371 13.1683 38.6236 13.1641 38.61 13.1602C38.5965 13.1563 38.583 13.1525 38.5694 13.1488C38.5559 13.1451 38.5424 13.1415 38.5288 13.1379L38.4882 13.1275C38.4747 13.1242 38.4612 13.1209 38.4476 13.1177C38.4341 13.1145 38.4206 13.1115 38.407 13.1085L38.3663 13.0998C38.3528 13.097 38.3394 13.0941 38.3257 13.0915C38.3123 13.0888 38.2987 13.0864 38.2851 13.0839L38.2445 13.0767C38.231 13.0744 38.2175 13.0721 38.2039 13.0699L38.1633 13.0637L38.1227 13.0579L38.0821 13.0525L38.0415 13.0477L38.0009 13.0433L37.9603 13.0392L37.9197 13.0356L37.8791 13.0324L37.8384 13.0295L37.7978 13.0272L37.7817 13.0263L37.7572 13.0247L37.7166 13.0223L37.676 13.0201L37.6354 13.0179L37.5948 13.016L37.5542 13.0142L37.5136 13.0127L37.473 13.0114L37.4324 13.0105L37.3917 13.01L37.3694 13.0099H37.3512H37.3105H37.2699H37.2293H37.1887H37.1481H37.1075H37.0669H37.0263H36.9857H36.9451H36.9045H36.8638H36.8233H36.7826H36.742H36.7014H36.6608H36.6202H36.5796H36.539H36.4984H36.4578H36.4172H36.3766H36.3359H36.2954H36.2547H36.2141H36.1735H36.1329H36.0923H36.0517H36.0111H35.9705H35.9299H35.8893H35.8487H35.808H35.7675H35.7268H35.6862H35.6456H35.605H35.5644H35.5238H35.4832H35.4426H35.402H35.3614H35.3208H35.2801H35.2396H35.1989H35.1583H35.1177H35.0771H35.0365H34.9959H34.9553H34.9147H34.8741H34.8335H34.7929H34.7522H34.7117H34.671H34.6304H34.5898H34.5492H34.5086H34.468H34.4274H34.3868H34.3462H34.3056H34.265H34.2243H34.1838H34.1431H34.1025H34.0619H34.0213H33.9807H33.9401H33.8995H33.8589H33.8183H33.7777H33.7371H33.6964H33.6559H33.6152H33.5746H33.534H33.4934H33.4528H33.4122H33.3716H33.331H33.2904H33.2498H33.2092H33.1685H33.128H33.0873H33.0467H33.0061H32.9655H32.9249H32.8843H32.8437H32.8031H32.7625H32.7219H32.6813H32.6406H32.6H32.5594H32.5188H32.4782H32.4376H32.397H32.3564H32.3158H32.2752H32.2346H32.194H32.1534H32.1127H32.0721H32.0315H31.9909H31.9503H31.9097H31.8691H31.8285H31.7879H31.7473H31.7067H31.666H31.6255H31.5848H31.5442H31.5036H31.416V8.61119C31.416 8.31526 31.4463 8.02649 31.5036 7.74768C31.5159 7.68797 31.5295 7.62877 31.5442 7.57005C31.5569 7.5198 31.5705 7.46992 31.5848 7.42041C31.5977 7.37619 31.6112 7.33227 31.6255 7.28866C31.6385 7.24881 31.6519 7.20917 31.666 7.16986C31.6791 7.1334 31.6926 7.09714 31.7067 7.06115C31.7198 7.02754 31.7333 6.99409 31.7473 6.96092C31.7605 6.92961 31.774 6.89843 31.7879 6.8675C31.8011 6.83812 31.8147 6.80894 31.8285 6.77994C31.8417 6.75225 31.8553 6.72477 31.8691 6.69742C31.8824 6.67113 31.896 6.64504 31.9097 6.61905C31.923 6.594 31.9365 6.56913 31.9503 6.5444C31.9636 6.5204 31.9772 6.49662 31.9909 6.47293C32.0043 6.44996 32.0178 6.42708 32.0315 6.40441C32.0449 6.38242 32.0584 6.3606 32.0721 6.33888C32.0854 6.31784 32.0991 6.297 32.1127 6.27622C32.1261 6.25589 32.1396 6.23563 32.1534 6.21554C32.1668 6.19585 32.1802 6.17616 32.194 6.15671C32.2073 6.13787 32.2209 6.11927 32.2346 6.10066C32.2479 6.08236 32.2615 6.0642 32.2752 6.04614C32.2887 6.02835 32.3021 6.01049 32.3158 5.99294C32.3291 5.97586 32.3428 5.95905 32.3564 5.94218C32.3698 5.92554 32.3833 5.90904 32.397 5.89264C32.4105 5.87644 32.4239 5.86024 32.4376 5.84425C32.451 5.82866 32.4646 5.81335 32.4782 5.79796C32.4917 5.78271 32.5051 5.76743 32.5188 5.75239C32.5322 5.73765 32.5458 5.72304 32.5594 5.70847C32.5729 5.6941 32.5864 5.67984 32.6 5.66564C32.6135 5.65164 32.627 5.63765 32.6406 5.62382C32.6541 5.61024 32.6677 5.59685 32.6813 5.58347C32.6948 5.57015 32.7082 5.5567 32.7219 5.54358C32.7352 5.53074 32.7489 5.5182 32.7625 5.50553C32.776 5.49292 32.7894 5.48028 32.8031 5.46785C32.8165 5.45561 32.8301 5.44362 32.8437 5.43159C32.8572 5.41963 32.8707 5.40767 32.8843 5.39587C32.8978 5.38425 32.9113 5.3728 32.9249 5.36134C32.9384 5.34999 32.9519 5.33868 32.9655 5.32749C32.979 5.31641 32.9925 5.30547 33.0061 5.29459L33.0467 5.26243L33.0873 5.23112C33.1008 5.22085 33.1144 5.21066 33.128 5.20056C33.1414 5.19056 33.1549 5.1806 33.1685 5.17074L33.2092 5.1417C33.2226 5.13218 33.2362 5.12272 33.2498 5.11337L33.2904 5.08568L33.331 5.05875C33.3445 5.0499 33.358 5.04109 33.3716 5.03242L33.4122 5.00687C33.4257 4.99843 33.4392 4.98999 33.4528 4.98172C33.4663 4.97352 33.4799 4.96556 33.4934 4.95753C33.507 4.9495 33.5204 4.9414 33.534 4.93354C33.5474 4.92578 33.5611 4.91829 33.5746 4.91067C33.5882 4.90304 33.6016 4.89528 33.6152 4.88783C33.6287 4.88047 33.6423 4.87336 33.6559 4.86614C33.6694 4.85892 33.6828 4.85167 33.6964 4.84459C33.7099 4.83757 33.7235 4.83076 33.7371 4.82392C33.7506 4.81711 33.7641 4.81026 33.7777 4.80359L33.8183 4.78383C33.8318 4.77736 33.8453 4.77106 33.8589 4.76472C33.8724 4.75842 33.8859 4.75201 33.8995 4.74585C33.913 4.73975 33.9266 4.73392 33.9401 4.72795C33.9536 4.72199 33.9671 4.71592 33.9807 4.7101C33.9942 4.70434 34.0078 4.69885 34.0213 4.69322C34.0348 4.68763 34.0483 4.68197 34.0619 4.67651L34.1025 4.66042L34.1431 4.64487C34.1567 4.63972 34.1702 4.6345 34.1838 4.62952C34.1972 4.62457 34.2108 4.61993 34.2243 4.61511C34.2379 4.6103 34.2514 4.60539 34.265 4.60071C34.2784 4.59607 34.292 4.5917 34.3056 4.58719L34.3462 4.57394C34.3597 4.56961 34.3732 4.56523 34.3868 4.56103C34.4003 4.55686 34.4139 4.55293 34.4274 4.5489C34.4409 4.54484 34.4544 4.54063 34.468 4.53674C34.4815 4.53287 34.4951 4.52928 34.5086 4.52555C34.5221 4.52183 34.5356 4.51807 34.5492 4.51447L34.5898 4.5039C34.6033 4.50048 34.6169 4.49723 34.6304 4.49394C34.644 4.49065 34.6574 4.48713 34.671 4.48398C34.6845 4.48086 34.6981 4.47801 34.7117 4.475L34.7522 4.46608L34.7929 4.45765C34.8063 4.45494 34.8199 4.45239 34.8335 4.44982C34.847 4.44721 34.8605 4.44443 34.8741 4.44196C34.8876 4.43948 34.9012 4.43738 34.9147 4.43508L34.9553 4.4283C34.9688 4.42613 34.9824 4.4239 34.9959 4.42186C35.0094 4.41983 35.023 4.41803 35.0365 4.41614C35.0501 4.41424 35.0635 4.41217 35.0771 4.41041C35.0906 4.40865 35.1042 4.40709 35.1177 4.40546L35.1583 4.40079C35.1719 4.3993 35.1854 4.39764 35.1989 4.39628C35.2124 4.39492 35.226 4.39387 35.2396 4.39265L35.2801 4.38903L35.3208 4.38595C35.3343 4.38496 35.3478 4.38418 35.3614 4.38334C35.3749 4.38252 35.3884 4.38147 35.402 4.38076C35.4155 4.38005 35.4291 4.37964 35.4426 4.37907L35.4832 4.37754C35.4968 4.3771 35.5103 4.37652 35.5238 4.37622C35.5373 4.37591 35.5509 4.37588 35.5644 4.37568C35.5779 4.37547 35.5915 4.37524 35.605 4.37517L35.6152 4.37503H35.6456H35.6862H35.7268H35.7675H35.808H35.8487H35.8893H35.9299H35.9705H36.0111H36.0517H36.0923H36.1329H36.1735H36.2141H36.2547H36.2954H36.3359H36.3766H36.4172H36.4578H36.4984H36.539H36.5796H36.6202H36.6608H36.7014H36.742H36.7826H36.8233H36.8638H36.9045H36.9451H36.9857H37.0263H37.0669H37.1075H37.1481H37.1887H37.2293H37.2699H37.3105H37.3512H37.3917H37.4324H37.473H37.5136H37.5542H37.5948H37.6354H37.676H37.7166H37.7572H37.7978H37.8384H37.8791H37.9197H37.9603H38.0009H38.0415H38.0821H38.1227H38.1633H38.2039H38.2445H38.2851H38.3257H38.3663H38.407H38.4476H38.4882H38.5288H38.5694H38.61H38.6506H38.6912H38.7318H38.7724H38.813H38.8537H38.8942H38.9349H38.9755H39.0161H39.0567H39.0973H39.1379H39.1785H39.2191H39.2597H39.3003H39.3409H39.3816H39.4221H39.4628H39.5034H39.544H39.5846H39.6252H39.6658H39.7064H39.747H39.7876H39.8282H39.8688H39.9095H39.95H39.9907H40.0313H40.0719H40.1125H40.1531H40.1937H40.2343H40.2749H40.3155H40.3561H40.3967H40.4374H40.4779H40.5186H40.5592H40.5998H40.6404H40.681H40.7216H40.7622H40.8028H40.8434H40.884H40.9246H40.9653H41.0058H41.0465H41.0871H41.1277H41.1683H41.2089H41.2495H41.2901H41.3307H41.3714H41.4119H41.4526H41.4932H41.5338H41.5744H41.615H41.6556H41.6962H41.7368H41.7774V4.375Z",fill:"#54B230"}),Object(l.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8.1377 19.0723V8.61115C8.1377 8.31608 8.16772 8.02805 8.22476 7.74998C8.23702 7.69027 8.25061 7.63111 8.26532 7.57235C8.27791 7.52203 8.29147 7.47212 8.30584 7.42254C8.31867 7.37836 8.3322 7.33451 8.34637 7.29093C8.35936 7.25105 8.37279 7.21133 8.38692 7.17196C8.40001 7.13553 8.41341 7.09931 8.42744 7.06336C8.44054 7.02974 8.45407 6.99623 8.468 6.96302C8.48116 6.93171 8.49466 6.9006 8.50852 6.8697C8.52172 6.84032 8.53525 6.81118 8.54904 6.78217C8.56224 6.75445 8.57583 6.72694 8.5896 6.69956C8.60283 6.67326 8.61636 6.64717 8.63012 6.62121C8.64338 6.59617 8.65691 6.5713 8.67064 6.54656C8.68394 6.52261 8.69744 6.49879 8.7112 6.47513C8.72453 6.45216 8.73796 6.42925 8.75172 6.40655C8.76505 6.38459 8.77858 6.3628 8.79228 6.34112C8.80554 6.32011 8.81917 6.29923 8.8328 6.27846C8.84616 6.25813 8.85963 6.23787 8.87332 6.21777C8.88679 6.19805 8.90011 6.17836 8.91388 6.15888C8.92717 6.14007 8.94081 6.1215 8.9544 6.1029C8.9678 6.0846 8.98129 6.06644 8.99496 6.04838C9.00839 6.03062 9.02178 6.01273 9.03548 5.99518C9.04881 5.97813 9.06244 5.96136 9.076 5.94452C9.0894 5.92788 9.10289 5.91131 9.11656 5.89487C9.12999 5.87871 9.14342 5.86258 9.15708 5.84662C9.17044 5.831 9.18404 5.81565 9.19764 5.80023C9.21107 5.78495 9.2245 5.7697 9.23816 5.75466C9.25152 5.73992 9.26512 5.72538 9.27868 5.71084C9.29211 5.69644 9.30561 5.68217 9.31924 5.66798C9.33267 5.65398 9.34613 5.63999 9.35976 5.62616C9.37316 5.61257 9.38675 5.59919 9.40032 5.5858C9.41381 5.57249 9.42717 5.55907 9.44084 5.54595C9.4542 5.53311 9.46783 5.52057 9.48136 5.5079C9.49486 5.49526 9.50825 5.48259 9.52192 5.47015C9.53531 5.45795 9.54891 5.44599 9.56244 5.43396C9.57594 5.422 9.58936 5.41 9.603 5.39821C9.61642 5.38659 9.62995 5.37517 9.64352 5.36372C9.65695 5.35237 9.67044 5.34101 9.68404 5.32983C9.69747 5.31878 9.71103 5.30784 9.7246 5.29693C9.73806 5.28612 9.75152 5.27541 9.76512 5.26477C9.77855 5.25423 9.79211 5.24383 9.80567 5.23346C9.81914 5.22319 9.83263 5.21296 9.8462 5.20286L9.88672 5.17311C9.90018 5.16332 9.91368 5.15359 9.92728 5.14397C9.9407 5.13445 9.95423 5.12503 9.9678 5.11567C9.98126 5.10635 9.99476 5.0971 10.0083 5.08795C10.0218 5.07891 10.0353 5.07 10.0489 5.06108C10.0623 5.05224 10.0758 5.04333 10.0894 5.03462C10.1028 5.02601 10.1164 5.01761 10.13 5.00914C10.1435 5.0007 10.1569 4.99216 10.1705 4.98389C10.1839 4.97573 10.1975 4.9678 10.211 4.95977C10.2245 4.95173 10.2379 4.94357 10.2516 4.93567C10.265 4.92791 10.2786 4.92049 10.2921 4.91287C10.3056 4.90524 10.319 4.89752 10.3326 4.89003C10.3461 4.88264 10.3596 4.87553 10.3732 4.86831C10.3867 4.86109 10.4001 4.85384 10.4137 4.84676C10.4271 4.83974 10.4407 4.83286 10.4542 4.82598L10.4948 4.80572C10.5083 4.79905 10.5217 4.79237 10.5353 4.78586C10.5488 4.77939 10.5623 4.77312 10.5758 4.76679C10.5894 4.76045 10.6028 4.75398 10.6164 4.74781C10.6298 4.74168 10.6434 4.73592 10.6569 4.72995C10.6704 4.72399 10.6839 4.71792 10.6974 4.71209C10.7109 4.70633 10.7245 4.70078 10.738 4.69515L10.7785 4.67848L10.819 4.66228L10.8596 4.64676C10.8731 4.64161 10.8865 4.63629 10.9001 4.63128C10.9135 4.62633 10.9272 4.62172 10.9407 4.61691C10.9542 4.6121 10.9676 4.60722 10.9812 4.60254L11.0217 4.58889L11.0623 4.57564C11.0758 4.5713 11.0892 4.56686 11.1028 4.56266C11.1162 4.55849 11.1298 4.55453 11.1433 4.55049C11.1568 4.54643 11.1703 4.54229 11.1839 4.53836C11.1973 4.53447 11.2109 4.53084 11.2244 4.52708L11.265 4.516C11.2784 4.51241 11.2919 4.50875 11.3055 4.50529C11.3189 4.50183 11.3325 4.49868 11.346 4.49536C11.3595 4.49204 11.373 4.48858 11.3866 4.4854C11.4 4.48225 11.4136 4.4793 11.4271 4.47628L11.4676 4.46741C11.4811 4.46449 11.4946 4.46154 11.5082 4.4588C11.5216 4.45609 11.5352 4.45358 11.5487 4.45097C11.5622 4.44836 11.5757 4.44565 11.5892 4.44318C11.6027 4.4407 11.6162 4.43847 11.6298 4.43613L11.6703 4.42935C11.6838 4.42718 11.6973 4.42485 11.7108 4.42278C11.7243 4.42071 11.7379 4.41898 11.7514 4.41705C11.7648 4.41515 11.7783 4.41312 11.7919 4.41133L11.8324 4.40621L11.873 4.40157C11.8865 4.40004 11.8999 4.39828 11.9135 4.39689C11.927 4.3955 11.9405 4.39448 11.954 4.39323L11.9946 4.38964C12.0081 4.38849 12.0216 4.38737 12.0351 4.38639C12.0486 4.3854 12.0621 4.38462 12.0757 4.38378C12.0892 4.38293 12.1027 4.38195 12.1162 4.3812C12.1297 4.38046 12.1432 4.37995 12.1567 4.37934L12.1973 4.37778C12.2108 4.3773 12.2242 4.37659 12.2378 4.37625C12.2513 4.37591 12.2648 4.37595 12.2783 4.37575C12.2918 4.37554 12.3053 4.3753 12.3189 4.37524L12.3594 4.375H12.3999H12.4405H12.481H12.5215H12.5621H12.6026H12.6431H12.6837H12.7242H12.7647H12.8053H12.8458H12.8863H12.9269H12.9674H13.008H13.0485H13.089H13.1296H13.1701H13.2107H13.2512H13.2917H13.3323H13.3728H13.4133H13.4539H13.4944H13.5349H13.5755H13.616H13.6565H13.6971H13.7376H13.7781H13.8187H13.8592H13.8997H13.9403H13.9808H14.0213H14.0619H14.1024H14.143H14.1835H14.224H14.2646H14.3051H14.3457H14.3862H14.4267H14.4673H14.5078H14.5483H14.5889H14.6294H14.6699H14.7105H14.751H14.7915H14.8321H14.8726H14.9131H14.9537H14.9942H15.0347H15.0753H15.1158H15.1563H15.1969H15.2374H15.278H15.3185H15.359H15.3996H15.4401H15.4807H15.5212H15.5617H15.6023H15.6428H15.6833H15.7239H15.7644H15.8049H15.8455H15.886H15.9265H15.9671H16.0076H16.0481H16.0887H16.1292H16.1697H16.2103H16.2508H16.2914H16.3319H16.3724H16.413H16.4535H16.494H16.5346H16.5751H16.6157H16.6562H16.6967H16.7373H16.7778H16.8183H16.8589H16.8994H16.9399H16.9805H17.021H17.0615H17.1021H17.1426H17.1831H17.2237H17.2642H17.3047H17.3453H17.3858H17.4264H17.4669H17.5074H17.548H17.5885H17.629H17.6696H17.7101H17.7506H17.7912H17.8317H17.8722H17.9128H17.9533H17.9938H18.0344H18.0749H18.1154H18.156H18.1965H18.237H18.2776H18.3181H18.3586H18.3992H18.4397H18.4803H18.5147V25.5542C18.5147 25.7384 18.5029 25.9199 18.4803 26.098C18.4694 26.1837 18.4556 26.2685 18.4397 26.3525C18.4276 26.4165 18.4141 26.4799 18.3992 26.5427C18.3866 26.5957 18.3732 26.6483 18.3586 26.7005C18.3459 26.7463 18.3323 26.7917 18.3181 26.8368C18.3052 26.8777 18.2917 26.9182 18.2776 26.9586C18.2646 26.9959 18.2511 27.033 18.237 27.0698C18.224 27.1042 18.2105 27.1384 18.1965 27.1723C18.1834 27.2043 18.1699 27.2361 18.156 27.2676C18.1428 27.2976 18.1293 27.3273 18.1154 27.357C18.1023 27.3852 18.0887 27.4132 18.0749 27.4411C18.0617 27.4679 18.0482 27.4945 18.0344 27.5209C18.0211 27.5463 18.0076 27.5717 17.9938 27.5968C17.9805 27.6211 17.9671 27.6454 17.9533 27.6694C17.94 27.6926 17.9265 27.7156 17.9128 27.7385C17.8995 27.7607 17.8859 27.7826 17.8722 27.8045C17.8589 27.8259 17.8454 27.8471 17.8317 27.8682C17.8183 27.8889 17.8049 27.9095 17.7912 27.9298C17.7778 27.9496 17.7643 27.9692 17.7506 27.9887C17.7373 28.0078 17.7238 28.0267 17.7101 28.0456C17.6967 28.0641 17.6832 28.0826 17.6696 28.1009C17.6562 28.1188 17.6427 28.1365 17.629 28.1542C17.6157 28.1714 17.6021 28.1885 17.5885 28.2056C17.5751 28.2224 17.5616 28.2392 17.548 28.2558C17.5346 28.2721 17.521 28.2881 17.5074 28.3041C17.494 28.3199 17.4805 28.3356 17.4669 28.3512C17.4534 28.3665 17.44 28.382 17.4264 28.3972C17.413 28.412 17.3994 28.4266 17.3858 28.4413C17.3723 28.4558 17.359 28.4704 17.3453 28.4847C17.3319 28.4988 17.3183 28.5126 17.3047 28.5265C17.2913 28.5402 17.2778 28.5539 17.2642 28.5674C17.2508 28.5808 17.2373 28.5941 17.2237 28.6073C17.2103 28.6203 17.1967 28.6331 17.1831 28.6459C17.1697 28.6586 17.1562 28.6713 17.1426 28.6839C17.1292 28.6962 17.1156 28.7082 17.1021 28.7204C17.0886 28.7325 17.0752 28.7447 17.0615 28.7566C17.0482 28.7682 17.0345 28.7796 17.021 28.7911C17.0075 28.8026 16.9941 28.8142 16.9805 28.8255C16.9671 28.8366 16.9535 28.8475 16.9399 28.8584C16.9264 28.8693 16.913 28.8803 16.8994 28.8911C16.886 28.9016 16.8724 28.9119 16.8589 28.9223C16.8454 28.9327 16.832 28.9431 16.8183 28.9533C16.8049 28.9634 16.7913 28.9732 16.7778 28.9831C16.7643 28.993 16.7509 29.003 16.7373 29.0127C16.7239 29.0222 16.7103 29.0316 16.6967 29.041C16.6832 29.0504 16.6698 29.0599 16.6562 29.0692C16.6428 29.0782 16.6292 29.0871 16.6157 29.096C16.6021 29.105 16.5887 29.1141 16.5751 29.1229C16.5617 29.1315 16.5481 29.1398 16.5346 29.1484C16.5211 29.1569 16.5076 29.1655 16.494 29.1738C16.4806 29.1821 16.467 29.1901 16.4535 29.1981C16.44 29.2062 16.4266 29.2143 16.413 29.2223C16.3995 29.2301 16.386 29.2377 16.3724 29.2454C16.359 29.2531 16.3455 29.2608 16.3319 29.2682C16.3184 29.2757 16.3049 29.2831 16.2914 29.2904L16.2508 29.3119C16.2373 29.319 16.2239 29.3261 16.2103 29.333C16.1968 29.3399 16.1833 29.3466 16.1697 29.3533C16.1562 29.36 16.1428 29.367 16.1292 29.3735C16.1158 29.38 16.1022 29.3862 16.0887 29.3926C16.0752 29.399 16.0617 29.4054 16.0481 29.4117C16.0347 29.4178 16.0211 29.4237 16.0076 29.4298L15.9671 29.4476L15.9265 29.4649C15.9131 29.4706 15.8995 29.4761 15.886 29.4816C15.8725 29.4871 15.859 29.4928 15.8455 29.4982C15.832 29.5035 15.8185 29.5085 15.8049 29.5136C15.7914 29.5188 15.778 29.5241 15.7644 29.5292C15.7509 29.5342 15.7374 29.539 15.7239 29.5438L15.6833 29.5582L15.6428 29.5722C15.6293 29.5767 15.6158 29.5811 15.6023 29.5854C15.5887 29.5899 15.5753 29.5944 15.5617 29.5987C15.5483 29.6029 15.5347 29.6068 15.5212 29.6109L15.4807 29.6231L15.4401 29.6347C15.4266 29.6385 15.4131 29.6421 15.3996 29.6457C15.386 29.6494 15.3726 29.6533 15.359 29.6567C15.3456 29.6602 15.332 29.6633 15.3185 29.6667C15.305 29.6701 15.2915 29.6734 15.278 29.6767L15.2374 29.6861L15.1969 29.695C15.1834 29.6979 15.1699 29.7011 15.1563 29.7039C15.1429 29.7067 15.1293 29.709 15.1158 29.7117C15.1023 29.7143 15.0888 29.717 15.0753 29.7195L15.0347 29.7269C15.0213 29.7292 15.0077 29.7314 14.9942 29.7336C14.9807 29.7358 14.9672 29.7383 14.9537 29.7404C14.9402 29.7425 14.9267 29.7442 14.9131 29.7462L14.8726 29.7519C14.8591 29.7538 14.8456 29.7556 14.8321 29.7573C14.8186 29.759 14.805 29.7604 14.7915 29.762C14.778 29.7635 14.7645 29.7652 14.751 29.7667C14.7375 29.7681 14.724 29.7693 14.7105 29.7706L14.6699 29.7742C14.6564 29.7754 14.6429 29.7768 14.6294 29.7778C14.6159 29.7788 14.6024 29.7795 14.5889 29.7804L14.5483 29.783L14.5078 29.7851C14.4943 29.7858 14.4808 29.7862 14.4673 29.7867C14.4537 29.7872 14.4402 29.7878 14.4267 29.7883C14.4132 29.7886 14.3997 29.7888 14.3862 29.789L14.3457 29.7895C14.3331 29.7896 14.3207 29.79 14.3081 29.79H14.2646H14.224H14.1835H14.143H14.1024H14.0619H14.0213H13.9808H13.9403H13.8997H13.8592H13.8187H13.7781H13.7376H13.6971H13.6565H13.616H13.5755H13.5349H13.4944H13.4539H13.4133H13.3728H13.3323H13.2917H13.2512H13.2107H13.1701H13.1296H13.089H13.0485H13.008H12.9674H12.9269H12.8863H12.8458H12.8053H12.7647H12.7242H12.6837H12.6431H12.6026H12.5621H12.5215H12.481H12.4405H12.3999H12.3594H12.3189H12.2783H12.2378H12.1973H12.1567H12.1162H12.0757H12.0351H11.9946H11.954H11.9135H11.873H11.8324H11.7919H11.7514H11.7108H11.6703H11.6298H11.5892H11.5487H11.5082H11.4676H11.4271H11.3866H11.346H11.3055H11.265H11.2244H11.1839H11.1433H11.1028H11.0623H11.0217H10.9812H10.9407H10.9001H10.8596H10.819H10.7785H10.738H10.6974H10.6569H10.6164H10.5758H10.5353H10.4948H10.4542H10.4137H10.3732H10.3326H10.2921H10.2516H10.211H10.1705H10.13H10.0894H10.0489H10.0083H9.9678H9.92728H9.88672H9.8462H9.80567H9.76512H9.7246H9.68404H9.64352H9.603H9.56244H9.52192H9.48136H9.44084H9.40032H9.35976H9.31924H9.27868H9.23816H9.19764H9.15708H9.11656H9.076H9.03548H8.99496H8.9544H8.91388H8.87332H8.8328H8.79228H8.75172H8.7112H8.67064H8.63012H8.5896H8.54904H8.50852H8.468H8.42744H8.38692H8.34637H8.30584H8.26532H8.22476H8.1377V20.8632C8.1377 20.8632 8.16765 20.8715 8.22476 20.886L8.26532 20.8962L8.30584 20.9062L8.34637 20.916L8.38692 20.9256L8.42744 20.9351L8.468 20.9445L8.50852 20.9537L8.54904 20.9628L8.5896 20.9717L8.63012 20.9805L8.67064 20.9893L8.7112 20.9979L8.75172 21.0064L8.79228 21.0147L8.8328 21.023L8.87332 21.0311L8.91388 21.0392L8.9544 21.0471L8.99496 21.055L9.03548 21.0628L9.076 21.0704L9.11656 21.078L9.15708 21.0854L9.19764 21.0928L9.23816 21.1001L9.27868 21.1072L9.31924 21.1143L9.35976 21.1212L9.40032 21.1281L9.44084 21.1349L9.48136 21.1416L9.52192 21.1482L9.56244 21.1547L9.603 21.1612L9.64352 21.1675L9.68404 21.1738L9.7246 21.1799L9.76512 21.186L9.80567 21.1919L9.8462 21.1978L9.88672 21.2036L9.92728 21.2093L9.9678 21.2149L10.0083 21.2205L10.0489 21.2259L10.0894 21.2313L10.13 21.2366L10.1705 21.2417L10.211 21.2468L10.2516 21.2518L10.2921 21.2568L10.3326 21.2615L10.3732 21.2663L10.4137 21.2709L10.4542 21.2755L10.4948 21.28L10.5353 21.2844L10.5758 21.2887L10.6164 21.2929L10.6569 21.297L10.6974 21.301L10.738 21.305L10.7785 21.3089L10.819 21.3126L10.8596 21.3164L10.9001 21.3199L10.9407 21.3234L10.9812 21.3269L11.0217 21.3302L11.0623 21.3335L11.1028 21.3366L11.1433 21.3397L11.1839 21.3426L11.2244 21.3455L11.265 21.3483L11.3055 21.351L11.346 21.3536L11.3866 21.3562L11.4271 21.3586L11.4676 21.361L11.5082 21.3632L11.5487 21.3654L11.5892 21.3675L11.6298 21.3694L11.6703 21.3713L11.7108 21.3731L11.7514 21.3748L11.7919 21.3765L11.8324 21.3779L11.873 21.3793L11.9135 21.3807L11.954 21.3819L11.9946 21.3831L12.0351 21.3841L12.0757 21.385L12.1162 21.386L12.1567 21.3867L12.1973 21.3873L12.2378 21.388L12.2783 21.3884L12.3189 21.3888L12.3594 21.3891L12.3999 21.3892L12.4405 21.3893L12.481 21.3893L12.5215 21.389L12.5621 21.3888L12.6026 21.3885L12.6431 21.3883L12.6837 21.3875L12.7242 21.3868L12.7647 21.3861L12.8053 21.3853L12.8458 21.3843L12.8863 21.383L12.9269 21.3818L12.9674 21.3805L13.008 21.3791L13.0485 21.3773L13.089 21.3756L13.1296 21.3737L13.1701 21.3719L13.2107 21.3697L13.2512 21.3673L13.2917 21.3649L13.3323 21.3626L13.3728 21.3599L13.4133 21.3569L13.4539 21.354L13.4944 21.3511L13.5349 21.3478L13.5755 21.3443L13.616 21.3408L13.6565 21.3372L13.6971 21.3334L13.7376 21.3292L13.7781 21.3251L13.8187 21.3209L13.8592 21.3164L13.8997 21.3116L13.9403 21.3068L13.9808 21.302L14.0213 21.2967L14.0619 21.2912L14.1024 21.2858L14.143 21.2802C14.1566 21.2782 14.1699 21.2761 14.1835 21.2741L14.224 21.2679L14.2646 21.2618L14.3051 21.2553C14.3187 21.2531 14.3321 21.2507 14.3457 21.2484L14.3862 21.2416C14.3996 21.2393 14.4134 21.2371 14.4267 21.2347C14.4404 21.2323 14.4537 21.2296 14.4673 21.2271L14.5078 21.2195L14.5483 21.2119L14.5889 21.2039C14.6025 21.2012 14.6159 21.1983 14.6294 21.1955L14.6699 21.1871L14.7105 21.1785C14.7242 21.1756 14.7374 21.1724 14.751 21.1694L14.7915 21.1601C14.805 21.157 14.8187 21.1541 14.8321 21.151C14.8458 21.1477 14.8591 21.1443 14.8726 21.141L14.9131 21.1309C14.9266 21.1276 14.9403 21.1243 14.9537 21.1209C14.9673 21.1174 14.9807 21.1138 14.9942 21.1102L15.0347 21.0993C15.0482 21.0956 15.0619 21.0921 15.0753 21.0883C15.0889 21.0846 15.1023 21.0806 15.1158 21.0768L15.1563 21.065C15.1698 21.061 15.1835 21.0571 15.1969 21.0531L15.2374 21.0406L15.278 21.0278C15.2914 21.0235 15.3052 21.0193 15.3185 21.015L15.359 21.0014L15.3996 20.9876C15.413 20.9829 15.4268 20.9784 15.4401 20.9737C15.4538 20.9689 15.4671 20.9638 15.4807 20.9589L15.5212 20.9441C15.5347 20.939 15.5483 20.9341 15.5617 20.9289C15.5754 20.9237 15.5887 20.9183 15.6023 20.913C15.6158 20.9077 15.6294 20.9024 15.6428 20.897L15.6833 20.8804L15.7239 20.8632C15.7373 20.8575 15.7511 20.852 15.7644 20.8461C15.7781 20.8401 15.7914 20.8339 15.8049 20.8278L15.8455 20.8094L15.886 20.7904C15.8996 20.784 15.9131 20.7774 15.9265 20.7708C15.94 20.7642 15.9538 20.7577 15.9671 20.751C15.9808 20.7441 15.9941 20.737 16.0076 20.73C16.0211 20.723 16.0348 20.7161 16.0481 20.7091C16.0618 20.7018 16.0752 20.6944 16.0887 20.687C16.1023 20.6796 16.1158 20.6721 16.1292 20.6646C16.1428 20.6569 16.1563 20.6492 16.1697 20.6415C16.1834 20.6336 16.1969 20.6255 16.2103 20.6175C16.2239 20.6094 16.2375 20.6013 16.2508 20.5931C16.2645 20.5847 16.2779 20.5761 16.2914 20.5676C16.3049 20.559 16.3186 20.5504 16.3319 20.5417C16.3456 20.5328 16.359 20.5236 16.3724 20.5145C16.386 20.5053 16.3996 20.4963 16.413 20.487C16.4267 20.4774 16.44 20.4677 16.4535 20.458C16.4671 20.4482 16.4807 20.4384 16.494 20.4286C16.5077 20.4184 16.5211 20.408 16.5346 20.3977C16.5482 20.3872 16.5618 20.3767 16.5751 20.3661C16.5888 20.3552 16.6023 20.3442 16.6157 20.3331C16.6293 20.3218 16.6428 20.3104 16.6562 20.299C16.6698 20.2873 16.6834 20.2757 16.6967 20.2639C16.7105 20.2517 16.7238 20.2393 16.7373 20.2269C16.7508 20.2144 16.7645 20.2019 16.7778 20.1892C16.7915 20.176 16.805 20.1627 16.8183 20.1493C16.832 20.1356 16.8455 20.1218 16.8589 20.108C16.8725 20.0938 16.8861 20.0797 16.8994 20.0653C16.9132 20.0503 16.9265 20.0351 16.9399 20.0199C16.9537 20.0043 16.9672 19.9885 16.9805 19.9727C16.9942 19.9564 17.0078 19.9401 17.021 19.9236C17.0347 19.9064 17.0483 19.8892 17.0615 19.8718C17.0754 19.8536 17.0888 19.8352 17.1021 19.8168C17.1159 19.7976 17.1293 19.7783 17.1426 19.7589C17.1564 19.7386 17.1699 19.7182 17.1831 19.6976C17.197 19.6761 17.2105 19.6543 17.2237 19.6324C17.2375 19.6093 17.2511 19.5861 17.2642 19.5627C17.2781 19.5378 17.2916 19.5128 17.3047 19.4876C17.3187 19.4606 17.3322 19.4335 17.3453 19.4061C17.3594 19.3767 17.3728 19.3471 17.3858 19.3172C17.3999 19.2847 17.4135 19.2521 17.4264 19.2191C17.4406 19.1827 17.4541 19.1461 17.4669 19.1091C17.4814 19.0672 17.4948 19.0248 17.5074 18.982C17.5222 18.9321 17.5356 18.8816 17.548 18.8307C17.5632 18.7675 17.5768 18.7036 17.5885 18.639C17.6059 18.5428 17.6193 18.4451 17.629 18.346C17.6426 18.208 17.6493 18.0674 17.6493 17.9246V13.01H17.5885H17.548H17.5074H17.4669H17.4264H17.3858H17.3453H17.3047H17.2642H17.2237H17.1831H17.1426H17.1021H17.0615H17.021H16.9805H16.9399H16.8994H16.8589H16.8183H16.7778H16.7373H16.6967H16.6562H16.6157H16.5751H16.5346H16.494H16.4535H16.413H16.3724H16.3319H16.2914H16.2508H16.2103H16.1697H16.1292H16.0887H16.0481H16.0076H15.9671H15.9265H15.886H15.8455H15.8049H15.7644H15.7239H15.6833H15.6428H15.6023H15.5617H15.5212H15.4807H15.4401H15.3996H15.359H15.3185H15.278H15.2374H15.1969H15.1563H15.1158H15.0753H15.0347H14.9942H14.9537H14.9131H14.8726H14.8321H14.7915H14.751H14.7105H14.6699H14.6294H14.5889H14.5483H14.5078H14.4673H14.4267H14.3862H14.3457H14.3051H14.2646H14.224H14.1835H14.143H14.1024H14.0619L14.0312 17.9246C14.0312 18.0016 14.0278 18.0773 14.0213 18.1515C14.0131 18.2461 13.9995 18.3383 13.9808 18.4279C13.9693 18.4833 13.9557 18.5377 13.9403 18.591C13.928 18.6335 13.9145 18.6753 13.8997 18.7164C13.8872 18.7514 13.8736 18.7858 13.8592 18.8198C13.8464 18.8501 13.8329 18.8799 13.8187 18.9093C13.8057 18.9361 13.7923 18.9626 13.7781 18.9885C13.7652 19.0125 13.7516 19.0359 13.7376 19.0592C13.7245 19.081 13.711 19.1026 13.6971 19.1238C13.6839 19.1438 13.6704 19.1634 13.6565 19.1828C13.6433 19.2013 13.6299 19.2196 13.616 19.2376C13.6028 19.2547 13.5893 19.2714 13.5755 19.288C13.5622 19.3039 13.5487 19.3196 13.5349 19.3351C13.5217 19.35 13.5082 19.3647 13.4944 19.3792C13.4811 19.3931 13.4676 19.407 13.4539 19.4206C13.4406 19.4337 13.4271 19.4467 13.4133 19.4594C13.4 19.4718 13.3865 19.4839 13.3728 19.4958C13.3595 19.5075 13.346 19.519 13.3323 19.5302C13.3189 19.5412 13.3054 19.552 13.2917 19.5627C13.2784 19.5731 13.2648 19.5833 13.2512 19.5934C13.2378 19.6032 13.2243 19.6129 13.2107 19.6224C13.1973 19.6318 13.1838 19.6409 13.1701 19.65C13.1567 19.6588 13.1432 19.6674 13.1296 19.676C13.1162 19.6843 13.1027 19.6925 13.089 19.7006C13.0757 19.7085 13.0621 19.7162 13.0485 19.7239C13.0351 19.7314 13.0216 19.7386 13.008 19.7459C12.9946 19.753 12.9811 19.76 12.9674 19.7668C12.954 19.7735 12.9405 19.7801 12.9269 19.7866C12.9135 19.793 12.9 19.7993 12.8863 19.8055C12.8729 19.8115 12.8595 19.8175 12.8458 19.8232C12.8325 19.8289 12.8189 19.8344 12.8053 19.8399C12.7919 19.8453 12.7783 19.8505 12.7647 19.8557C12.7513 19.8608 12.7379 19.8657 12.7242 19.8706C12.7108 19.8754 12.6973 19.8802 12.6837 19.8848C12.6703 19.8893 12.6567 19.8937 12.6431 19.898C12.6298 19.9022 12.6162 19.9063 12.6026 19.9103C12.5892 19.9143 12.5757 19.9183 12.5621 19.922C12.5486 19.9258 12.5351 19.9295 12.5215 19.933C12.5081 19.9365 12.4946 19.9399 12.481 19.9432C12.4676 19.9464 12.4541 19.9495 12.4405 19.9526C12.427 19.9556 12.4135 19.9586 12.3999 19.9614C12.3865 19.9642 12.373 19.967 12.3594 19.9696C12.346 19.9722 12.3324 19.9746 12.3189 19.977C12.3054 19.9794 12.2919 19.9817 12.2783 19.9839L12.2378 19.9902C12.2244 19.9921 12.2108 19.9939 12.1973 19.9957C12.1838 19.9975 12.1703 19.9993 12.1567 20.0009L12.1162 20.0054C12.1028 20.0068 12.0892 20.008 12.0757 20.0093C12.0622 20.0105 12.0487 20.0118 12.0351 20.0128C12.0217 20.0139 12.0082 20.0148 11.9946 20.0157C11.9811 20.0165 11.9676 20.0173 11.954 20.018C11.9405 20.0187 11.9271 20.0194 11.9135 20.02C11.9001 20.0205 11.8865 20.0208 11.873 20.0212L11.8324 20.0222C11.819 20.0224 11.8055 20.0225 11.7919 20.0226L11.7514 20.0226L11.7108 20.0223L11.6703 20.0218L11.6298 20.0209L11.5892 20.0198L11.5487 20.0185L11.5082 20.0168L11.4676 20.0149L11.4271 20.0129L11.3866 20.0104L11.346 20.0078L11.3055 20.0049L11.265 20.0017L11.2244 19.9983L11.1839 19.9946L11.1433 19.9907L11.1028 19.9865L11.0623 19.9821L11.0217 19.9775L10.9812 19.9725L10.9407 19.9674L10.9001 19.962L10.8596 19.9563L10.819 19.9504L10.7785 19.9443L10.738 19.9379L10.6974 19.9313L10.6569 19.9244L10.6164 19.9173L10.5758 19.91L10.5353 19.9024L10.4948 19.8946L10.4542 19.8866L10.4137 19.8783L10.3732 19.8698L10.3326 19.8611L10.2921 19.8521L10.2516 19.8429L10.211 19.8335L10.1705 19.8238L10.13 19.8139L10.0894 19.8038L10.0489 19.7936L10.0083 19.7829L9.9678 19.7722L9.92728 19.7612L9.88672 19.75L9.8462 19.7386L9.80567 19.7269L9.76512 19.7151L9.7246 19.703L9.68404 19.6907L9.64352 19.6782L9.603 19.6654L9.56244 19.6525L9.52192 19.6394L9.48136 19.6261L9.44084 19.6125L9.40032 19.5987L9.35976 19.5847L9.31924 19.5706L9.27868 19.5562L9.23816 19.5416L9.19764 19.5269L9.15708 19.5118L9.11656 19.4967L9.076 19.4813L9.03548 19.4657L8.99496 19.4499L8.9544 19.434L8.91388 19.4178L8.87332 19.4014L8.8328 19.3849L8.79228 19.3682L8.75172 19.3513L8.7112 19.3341L8.67064 19.3168L8.63012 19.2993L8.5896 19.2817L8.54904 19.2637L8.50852 19.2457L8.468 19.2275L8.42744 19.2091L8.38692 19.1905L8.34637 19.1717L8.30584 19.1528L8.26532 19.1336L8.22476 19.1144C8.19572 19.1004 8.16671 19.0864 8.1377 19.0723Z",fill:"#006CB9"}),Object(l.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M19.8644 14.0838C19.8348 14.1079 19.8057 14.1321 19.7773 14.1567V8.61115C19.7773 8.31625 19.8074 8.02839 19.8644 7.75042C19.8766 7.69075 19.8902 7.63162 19.9049 7.57289C19.9175 7.52251 19.9311 7.47253 19.9455 7.42288C19.9583 7.37866 19.9718 7.33475 19.986 7.29114C19.999 7.25129 20.0124 7.21164 20.0265 7.17233C20.0396 7.1359 20.0531 7.09965 20.0671 7.06369C20.0802 7.03008 20.0937 6.99663 20.1076 6.96343C20.1208 6.93212 20.1343 6.90101 20.1481 6.87007C20.1613 6.84069 20.1749 6.81152 20.1887 6.78251C20.2019 6.75479 20.2154 6.72734 20.2292 6.69997C20.2424 6.67367 20.256 6.64758 20.2698 6.62159C20.283 6.59655 20.2966 6.57167 20.3103 6.54694C20.3236 6.52298 20.3371 6.49912 20.3508 6.47547C20.3642 6.4525 20.3776 6.42963 20.3914 6.40692C20.4047 6.385 20.4182 6.36321 20.4319 6.34156C20.4452 6.32048 20.4588 6.29964 20.4725 6.27883C20.4858 6.25847 20.4993 6.23824 20.513 6.21814C20.5264 6.19842 20.5398 6.1787 20.5535 6.15925C20.5668 6.14041 20.5805 6.12188 20.5941 6.10331C20.6074 6.08501 20.6209 6.06681 20.6346 6.04875C20.648 6.03096 20.6614 6.01314 20.6751 5.99558C20.6884 5.97854 20.7021 5.96173 20.7157 5.94489C20.7291 5.92825 20.7426 5.91168 20.7562 5.89528C20.7696 5.87908 20.7831 5.86295 20.7968 5.84699C20.8101 5.83141 20.8237 5.81602 20.8373 5.80064C20.8507 5.78539 20.8642 5.77007 20.8778 5.75499C20.8912 5.74025 20.9048 5.72568 20.9183 5.71115C20.9317 5.69678 20.9453 5.68251 20.9589 5.66832C20.9723 5.65432 20.9858 5.64033 20.9994 5.6265C21.0128 5.61295 21.0264 5.59956 21.0399 5.58618C21.0534 5.57286 21.0668 5.55944 21.0805 5.54629C21.0938 5.53345 21.1075 5.52091 21.121 5.50824C21.1345 5.4956 21.1479 5.48293 21.1616 5.47049C21.175 5.45829 21.1886 5.4463 21.2021 5.43427C21.2156 5.42227 21.229 5.41031 21.2426 5.39852C21.2561 5.38689 21.2696 5.37548 21.2832 5.36402C21.2966 5.35267 21.3101 5.34132 21.3237 5.3301C21.3372 5.31906 21.3507 5.30811 21.3642 5.29723C21.3777 5.28642 21.3912 5.27568 21.4048 5.26504C21.4182 5.25454 21.4318 5.24413 21.4453 5.23377C21.4588 5.2235 21.4723 5.21326 21.4858 5.20317C21.4993 5.19314 21.5128 5.18324 21.5264 5.17338C21.5399 5.16362 21.5534 5.15386 21.5669 5.14424C21.5804 5.13472 21.5939 5.12533 21.6075 5.11594C21.6209 5.10663 21.6344 5.09734 21.648 5.08819C21.6614 5.07914 21.675 5.07023 21.6886 5.06132C21.702 5.05244 21.7155 5.04356 21.7291 5.03486C21.7425 5.02625 21.7561 5.01785 21.7696 5.00937C21.7831 5.00094 21.7966 4.9924 21.8102 4.98413C21.8236 4.97593 21.8372 4.968 21.8507 4.95997C21.8642 4.95194 21.8776 4.94374 21.8912 4.93588C21.9046 4.92812 21.9183 4.92066 21.9318 4.91304C21.9453 4.90541 21.9587 4.89772 21.9723 4.89027C21.9857 4.88288 21.9993 4.87576 22.0128 4.86851C22.0263 4.86129 22.0398 4.85404 22.0534 4.84696L22.0939 4.82619L22.1345 4.80589C22.1479 4.79925 22.1614 4.79254 22.175 4.78603C22.1885 4.77956 22.202 4.77329 22.2156 4.76696C22.2291 4.76065 22.2425 4.75415 22.2561 4.74798C22.2695 4.74185 22.2831 4.73609 22.2966 4.73012C22.3101 4.72416 22.3236 4.71809 22.3372 4.71226C22.3506 4.7065 22.3641 4.70091 22.3777 4.69529L22.4182 4.67862C22.4317 4.67316 22.4452 4.6677 22.4588 4.66238C22.4722 4.6571 22.4858 4.65202 22.4993 4.64686C22.5128 4.64171 22.5262 4.63639 22.5398 4.63138C22.5533 4.62643 22.5669 4.62182 22.5804 4.61701C22.5939 4.6122 22.6073 4.60732 22.6209 4.60264C22.6344 4.59797 22.6479 4.59349 22.6615 4.58899L22.702 4.57574C22.7155 4.5714 22.729 4.56696 22.7425 4.56273C22.756 4.55856 22.7696 4.55463 22.7831 4.5506C22.7966 4.54653 22.8101 4.54236 22.8236 4.53843C22.8371 4.53453 22.8506 4.53091 22.8641 4.52715L22.9047 4.51607C22.9182 4.51247 22.9317 4.50881 22.9452 4.50536C22.9587 4.50194 22.9722 4.49872 22.9857 4.4954C22.9992 4.49208 23.0127 4.48862 23.0263 4.48543C23.0398 4.48228 23.0533 4.47933 23.0668 4.47632L23.1074 4.46744C23.1209 4.46456 23.1343 4.46158 23.1479 4.45883C23.1614 4.45609 23.1749 4.45361 23.1885 4.45101C23.202 4.4484 23.2154 4.44565 23.229 4.44318L23.2695 4.43613L23.3101 4.42939C23.3236 4.42718 23.337 4.42485 23.3506 4.42278C23.3641 4.42071 23.3776 4.41898 23.3911 4.41705C23.4046 4.41515 23.4181 4.41316 23.4317 4.41136L23.4722 4.40624L23.5127 4.40157C23.5263 4.40004 23.5397 4.39828 23.5533 4.39689C23.5668 4.3955 23.5803 4.39448 23.5938 4.39323L23.6344 4.38964C23.6479 4.38849 23.6614 4.38737 23.6749 4.38639C23.6884 4.3854 23.7019 4.38462 23.7154 4.38378C23.7289 4.38293 23.7424 4.38195 23.756 4.3812C23.7695 4.38046 23.783 4.37995 23.7965 4.37934L23.837 4.37778C23.8506 4.3773 23.864 4.37659 23.8776 4.37625C23.8911 4.37591 23.9046 4.37595 23.9181 4.37575C23.9317 4.37554 23.9452 4.3753 23.9587 4.37524L23.9766 4.375H23.9992H24.0398H24.0803H24.1208H24.1614H24.2019H24.2424H24.283H24.3235H24.364H24.4046H24.4451H24.4856H24.5262H24.5667H24.6073H24.6478H24.6884H24.7289H24.7694H24.81H24.8505H24.891H24.9316H24.9721H25.0127H25.0532H25.0937H25.1343H25.1748H25.2153H25.2559H25.2964H25.3369H25.3775H25.418H25.4585H25.4991H25.5396H25.5802H25.6207H25.6613H25.7018H25.7423H25.7829H25.8234H25.8639H25.9045H25.945H25.9855H26.0261H26.0666H26.1072H26.1477H26.1882H26.2288H26.2693H26.3099H26.3504H26.3909H26.4315H26.472H26.5125H26.5531H26.5936H26.6342H26.6747H26.7152H26.7558H26.7963H26.8368H26.8774H26.9179H26.9584H26.999H27.0395H27.0801H27.1206H27.1612H27.2017H27.2422H27.2828H27.3233H27.3638H27.4044H27.4449H27.4854H27.526H27.5665H27.6071H27.6476H27.6882H27.7287H27.7692H27.8098H27.8503H27.8908H27.9314H27.9719H28.0124H28.053H28.0935H28.1341H28.1746H28.2151H28.2557H28.2962H28.3367H28.3773H28.4178H28.4583H28.4989H28.5394H28.58H28.6205H28.661H28.7016H28.7421H28.7827H28.8232H28.8637H28.9043H28.9448H28.9853H29.0259H29.0664H29.107H29.1475H29.1881H29.2286H29.2691H29.3097H29.3502H29.3907H29.4313H29.4718H29.5123H29.5529H29.5934H29.6339H29.6745H29.715H29.7556H29.7961H29.8366H29.8772H29.9177H29.9582H29.9988H30.0393H30.0799H30.1204H30.1548V25.5542C30.1548 25.7384 30.1431 25.9197 30.1204 26.0977C30.1095 26.1834 30.0958 26.2682 30.0799 26.3522C30.0678 26.4161 30.0543 26.4796 30.0393 26.5425C30.0267 26.5954 30.0133 26.6481 29.9988 26.7003C29.986 26.746 29.9725 26.7915 29.9582 26.8366C29.9454 26.8775 29.9318 26.918 29.9177 26.9583C29.9047 26.9956 29.8912 27.0327 29.8772 27.0696C29.8641 27.1039 29.8506 27.1381 29.8366 27.172C29.8235 27.204 29.81 27.2358 29.7961 27.2674C29.7829 27.2973 29.7694 27.3271 29.7556 27.3567C29.7423 27.3849 29.7288 27.413 29.715 27.4409C29.7018 27.4676 29.6883 27.4942 29.6745 27.5207C29.6612 27.5461 29.6477 27.5715 29.6339 27.5966C29.6206 27.621 29.6072 27.6452 29.5934 27.6692C29.5801 27.6924 29.5666 27.7154 29.5529 27.7382C29.5396 27.7604 29.526 27.7824 29.5123 27.8043C29.499 27.8256 29.4855 27.8469 29.4718 27.868C29.4584 27.8886 29.445 27.9093 29.4313 27.9296C29.4179 27.9494 29.4044 27.969 29.3907 27.9885C29.3774 28.0076 29.3638 28.0265 29.3502 28.0453C29.3368 28.0639 29.3233 28.0824 29.3097 28.1007C29.2963 28.1185 29.2828 28.1362 29.2691 28.1539C29.2558 28.1712 29.2422 28.1883 29.2286 28.2053C29.2151 28.2222 29.2017 28.239 29.1881 28.2556C29.1747 28.2718 29.1611 28.2879 29.1475 28.3039C29.1341 28.3197 29.1206 28.3353 29.107 28.3509C29.0935 28.3663 29.0801 28.3817 29.0664 28.3969C29.0531 28.4118 29.0394 28.4264 29.0259 28.441C29.0124 28.4556 28.999 28.4702 28.9853 28.4845C28.9719 28.4986 28.9584 28.5124 28.9448 28.5263C28.9314 28.54 28.9179 28.5536 28.9043 28.5672C28.8909 28.5806 28.8774 28.5939 28.8637 28.6071C28.8503 28.62 28.8368 28.6329 28.8232 28.6457C28.8097 28.6584 28.7963 28.6712 28.7827 28.6837C28.7693 28.696 28.7557 28.7081 28.7421 28.7202C28.7286 28.7323 28.7152 28.7445 28.7016 28.7564C28.6882 28.7681 28.6746 28.7795 28.661 28.791C28.6475 28.8025 28.6341 28.814 28.6205 28.8253C28.6071 28.8364 28.5935 28.8472 28.58 28.8582C28.5665 28.8691 28.5531 28.8801 28.5394 28.8909C28.526 28.9014 28.5124 28.9117 28.4989 28.9221C28.4854 28.9325 28.472 28.9429 28.4583 28.9532C28.445 28.9632 28.4314 28.9731 28.4178 28.983C28.4043 28.9928 28.3909 29.0028 28.3773 29.0125C28.3639 29.0221 28.3503 29.0314 28.3367 29.0408C28.3232 29.0502 28.3098 29.0597 28.2962 29.069C28.2828 29.0781 28.2692 29.0869 28.2557 29.0959C28.2422 29.1048 28.2288 29.1139 28.2151 29.1227C28.2017 29.1314 28.1881 29.1397 28.1746 29.1482C28.1611 29.1567 28.1477 29.1653 28.1341 29.1737C28.1206 29.1819 28.107 29.1899 28.0935 29.198C28.08 29.206 28.0666 29.2142 28.053 29.2221C28.0395 29.2299 28.026 29.2376 28.0124 29.2453L27.9719 29.2681L27.9314 29.2902L27.8908 29.3118C27.8773 29.3188 27.8639 29.326 27.8503 29.3329C27.8368 29.3398 27.8233 29.3465 27.8098 29.3532C27.7963 29.3599 27.7828 29.3668 27.7692 29.3734C27.7558 29.3799 27.7422 29.3861 27.7287 29.3925C27.7152 29.3988 27.7017 29.4053 27.6882 29.4115C27.6747 29.4177 27.6611 29.4236 27.6476 29.4297L27.6071 29.4475L27.5665 29.4648L27.526 29.4815C27.5125 29.487 27.499 29.4927 27.4854 29.4981C27.472 29.5034 27.4584 29.5084 27.4449 29.5135C27.4314 29.5187 27.418 29.524 27.4044 29.5291C27.3909 29.5341 27.3774 29.5389 27.3638 29.5437L27.3233 29.5581L27.2828 29.5721C27.2693 29.5766 27.2557 29.5809 27.2422 29.5853C27.2287 29.5898 27.2152 29.5944 27.2017 29.5986C27.1883 29.6028 27.1747 29.6067 27.1612 29.6108L27.1206 29.623L27.0801 29.6346C27.0666 29.6384 27.0531 29.642 27.0395 29.6456C27.026 29.6493 27.0126 29.6532 26.999 29.6567C26.9855 29.6602 26.972 29.6633 26.9584 29.6666C26.945 29.67 26.9315 29.6734 26.9179 29.6766L26.8774 29.686L26.8368 29.6949C26.8233 29.6978 26.8099 29.701 26.7963 29.7038C26.7829 29.7066 26.7693 29.709 26.7558 29.7116L26.7152 29.7194L26.6747 29.7268C26.6612 29.7292 26.6477 29.7313 26.6342 29.7336C26.6206 29.7358 26.6072 29.7382 26.5936 29.7403C26.5802 29.7424 26.5666 29.7442 26.5531 29.7462L26.5125 29.7519C26.499 29.7537 26.4855 29.7556 26.472 29.7573C26.4585 29.759 26.445 29.7604 26.4315 29.762C26.418 29.7635 26.4045 29.7652 26.3909 29.7666C26.3775 29.7681 26.3639 29.7693 26.3504 29.7706L26.3099 29.7742C26.2963 29.7754 26.2829 29.7768 26.2693 29.7778C26.2559 29.7788 26.2423 29.7795 26.2288 29.7804L26.1882 29.783L26.1477 29.7851C26.1342 29.7858 26.1207 29.7862 26.1072 29.7867C26.0936 29.7872 26.0802 29.7878 26.0666 29.7882C26.0532 29.7886 26.0396 29.7887 26.0261 29.789L25.9855 29.7895C25.9729 29.7896 25.9604 29.79 25.9477 29.79H25.945H25.9045H25.8639H25.8234H25.7829H25.7423H25.7018H25.6613H25.6207H25.5802H25.5396H25.4991H25.4585H25.418H25.3775H25.3369H25.2964H25.2559H25.2153H25.1748H25.1343H25.0937H25.0532H25.0127H24.9721H24.9316H24.891H24.8505H24.81H24.7694H24.7289H24.6884H24.6478H24.6073H24.5667H24.5262H24.4856H24.4451H24.4046H24.364H24.3235H24.283H24.2424H24.2019H24.1614H24.1208H24.0803H24.0398H23.9992H23.9587H23.9181H23.8776H23.837H23.7965H23.756H23.7154H23.6749H23.6344H23.5938H23.5533H23.5127H23.4722H23.4317H23.3911H23.3506H23.3101H23.2695H23.229H23.1885H23.1479H23.1074H23.0668H23.0263H22.9857H22.9452H22.9047H22.8641H22.8236H22.7831H22.7425H22.702H22.6615H22.6209H22.5804H22.5398H22.4993H22.4588H22.4182H22.3777H22.3372H22.2966H22.2561H22.2156H22.175H22.1345H22.0939H22.0534H22.0128H21.9723H21.9318H21.8912H21.8507H21.8102H21.7696H21.7291H21.6886H21.648H21.6075H21.5669H21.5264H21.4858H21.4453H21.4048H21.3642H21.3237H21.2832H21.2426H21.2021H21.1616H21.121H21.0805H21.0399H20.9994H20.9589H20.9183H20.8778H20.8373H20.7968H20.7562H20.7157H20.6751H20.6346H20.5941H20.5535H20.513H20.4725H20.4319H20.3914H20.3508H20.3103H20.2698H20.2292H20.1887H20.1481H20.1076H20.0671H20.0265H19.986H19.9455H19.9049H19.8644H19.7773V20.01C19.8057 20.0345 19.8348 20.0588 19.8644 20.0828C19.8778 20.0937 19.8913 20.1046 19.9049 20.1153C19.9183 20.126 19.9318 20.1366 19.9455 20.1471C19.9589 20.1575 19.9723 20.1679 19.986 20.1782C19.9994 20.1882 20.013 20.1982 20.0265 20.2081C20.0399 20.218 20.0535 20.2277 20.0671 20.2375C20.0805 20.2471 20.094 20.2566 20.1076 20.2662L20.1481 20.2941C20.1615 20.3032 20.1751 20.3123 20.1887 20.3213L20.2292 20.3479C20.2426 20.3567 20.2561 20.3654 20.2698 20.374C20.2831 20.3825 20.2967 20.3909 20.3103 20.3993L20.3508 20.4241C20.3643 20.4323 20.3778 20.4404 20.3914 20.4484C20.4048 20.4564 20.4183 20.4642 20.4319 20.472L20.4725 20.4952L20.513 20.5178L20.5535 20.5399C20.567 20.5471 20.5804 20.5545 20.5941 20.5617C20.6074 20.5687 20.621 20.5757 20.6346 20.5827L20.6751 20.6034L20.7157 20.6237L20.7562 20.6434C20.7697 20.6499 20.7831 20.6565 20.7968 20.6629L20.8373 20.6818L20.8778 20.7004L20.9183 20.7185L20.9589 20.7363L20.9994 20.7538L21.0399 20.7708L21.0805 20.7875L21.121 20.8038L21.1616 20.8199L21.2021 20.8354C21.2156 20.8406 21.229 20.8458 21.2426 20.8509L21.2832 20.8657C21.2967 20.8707 21.3101 20.8757 21.3237 20.8806C21.3371 20.8854 21.3507 20.8901 21.3642 20.8948L21.4048 20.909L21.4453 20.9227C21.4588 20.9272 21.4722 20.9319 21.4858 20.9364C21.4992 20.9408 21.5129 20.9451 21.5264 20.9494L21.5669 20.9625L21.6075 20.9751L21.648 20.9876L21.6886 20.9996L21.7291 21.0115L21.7696 21.0231L21.8102 21.0345L21.8507 21.0456L21.8912 21.0565L21.9318 21.0672L21.9723 21.0776L22.0128 21.0879L22.0534 21.0978L22.0939 21.1077L22.1345 21.1171L22.175 21.1264L22.2156 21.1355L22.2561 21.1444L22.2966 21.1532L22.3372 21.1616L22.3777 21.17L22.4182 21.178L22.4588 21.186L22.4993 21.1937L22.5398 21.2012L22.5804 21.2087L22.6209 21.2158L22.6615 21.2228L22.702 21.2296L22.7425 21.2363L22.7831 21.2429L22.8236 21.2491L22.8641 21.2553L22.9047 21.2613L22.9452 21.2671L22.9857 21.2728L23.0263 21.2782L23.0668 21.2836L23.1074 21.2888L23.1479 21.2938L23.1885 21.2988L23.229 21.3035L23.2695 21.3081L23.3101 21.3126L23.3506 21.3168L23.3911 21.321L23.4317 21.3251L23.4722 21.3289L23.5127 21.3328L23.5533 21.3363L23.5938 21.3398L23.6344 21.3433L23.6749 21.3464L23.7154 21.3495L23.756 21.3526L23.7965 21.3554L23.837 21.3581L23.8776 21.3608L23.9181 21.3632L23.9587 21.3656L23.9992 21.3679L24.0398 21.3699L24.0803 21.3719L24.1208 21.3739L24.1614 21.3756L24.2019 21.3773L24.2424 21.3789L24.283 21.3803L24.3235 21.3816L24.364 21.3829L24.4046 21.384L24.4451 21.385L24.4856 21.386L24.5262 21.3867L24.5667 21.3874L24.6073 21.3881L24.6478 21.3885L24.6884 21.3889L24.7289 21.3892L24.7694 21.3894L24.81 21.3895L24.8505 21.3895L24.891 21.3894L24.9316 21.3892L24.9721 21.389L25.0127 21.3886L25.0532 21.3881L25.0937 21.3876L25.1343 21.387L25.1748 21.3862L25.2153 21.3853L25.2559 21.3845L25.2964 21.3834L25.3369 21.3823L25.3775 21.3812L25.418 21.38L25.4585 21.3785L25.4991 21.3771L25.5396 21.3757L25.5802 21.374L25.6207 21.3723L25.6613 21.3706L25.6811 21.3698L25.7018 21.3688L25.7423 21.3668L25.7829 21.3646L25.8234 21.3624L25.8639 21.3599L25.9045 21.3574L25.945 21.3547L25.9855 21.3519L26.0261 21.3489L26.0666 21.3458L26.1072 21.3426L26.1477 21.3393L26.1882 21.3358L26.2288 21.3322L26.2693 21.3285L26.3099 21.3246L26.3504 21.3207L26.3909 21.3166L26.4315 21.3125L26.472 21.3082L26.5125 21.3038L26.5531 21.2993L26.5936 21.2947L26.6342 21.29L26.6747 21.2852L26.7152 21.2803L26.7558 21.2753L26.7963 21.2701L26.8368 21.2649L26.8774 21.2597L26.9179 21.2542L26.9584 21.2487L26.999 21.2431L27.0395 21.2374L27.0801 21.2317L27.1206 21.2258L27.1612 21.2198L27.2017 21.2137L27.2422 21.2076L27.2828 21.2014L27.3233 21.1951L27.3638 21.1887L27.4044 21.1822L27.4449 21.1756L27.4854 21.169L27.526 21.1622L27.5665 21.1554L27.6071 21.1485L27.6476 21.1415L27.6882 21.1344L27.7287 21.1273L27.7692 21.12L27.8098 21.1127L27.8503 21.1053L27.8908 21.0979L27.9314 21.0903L27.9719 21.0826L28.0124 21.0749L28.053 21.0671L28.0935 21.0593L28.1341 21.0513L28.1746 21.0433L28.2151 21.0352L28.2557 21.027L28.2962 21.0187L28.3367 21.0103L28.3773 21.0019L28.4178 20.9934L28.4583 20.9848L28.4989 20.976L28.5394 20.9673L28.58 20.9584L28.6205 20.9495L28.661 20.9404L28.7016 20.9313L28.7421 20.9221L28.7827 20.9127L28.8232 20.9033L28.8637 20.8937L28.9043 20.884L28.9448 20.8741L28.9851 20.8641V19.0723L28.9448 19.0925L28.9043 19.1127L28.8637 19.1326L28.8232 19.1524L28.7827 19.1721L28.7421 19.1915L28.7016 19.2107L28.661 19.2297L28.6205 19.2485L28.58 19.2672L28.5394 19.2856L28.4989 19.3038L28.4583 19.3217L28.4178 19.3395L28.3773 19.3571L28.3367 19.3744L28.2962 19.3916L28.2557 19.4085L28.2151 19.4252L28.1746 19.4417L28.1341 19.4579L28.0935 19.474L28.053 19.4897L28.0124 19.5053L27.9719 19.5207L27.9314 19.5358L27.8908 19.5506L27.8503 19.5653L27.8098 19.5797L27.7692 19.5939L27.7287 19.6079L27.6882 19.6216L27.6476 19.6351L27.6071 19.6484L27.5665 19.6614L27.526 19.6742L27.4854 19.6868L27.4449 19.6991L27.4044 19.7112L27.3638 19.7231L27.3233 19.7347L27.2828 19.7461L27.2422 19.7573L27.2017 19.7682L27.1612 19.7789L27.1206 19.7894L27.0801 19.7996L27.0395 19.8096L26.999 19.8195L26.9584 19.829L26.9179 19.8383L26.8774 19.8474L26.8368 19.8563L26.7963 19.8649L26.7558 19.8733L26.7152 19.8815L26.6747 19.8895L26.6342 19.8972L26.5936 19.9047L26.5531 19.912L26.5125 19.919L26.472 19.9258L26.4315 19.9324L26.3909 19.9389L26.3504 19.945L26.3099 19.9509L26.2693 19.9567L26.2288 19.9622L26.1882 19.9674L26.1477 19.9725L26.1072 19.9774L26.0666 19.982L26.0261 19.9864L25.9855 19.9906L25.945 19.9946L25.9045 19.9984L25.8639 20.002L25.8234 20.0053L25.7988 20.0072L25.7829 20.0083L25.7423 20.0111L25.7018 20.0138L25.6613 20.016L25.6207 20.0181L25.5802 20.02L25.5396 20.0213L25.4991 20.0226L25.4585 20.0235L25.418 20.0241L25.3775 20.0246C25.3639 20.0247 25.3505 20.0245 25.3369 20.0245L25.2964 20.0243L25.2559 20.0237L25.2153 20.0228L25.1748 20.0218C25.1612 20.0213 25.1478 20.0207 25.1343 20.0201C25.1208 20.0196 25.1072 20.0191 25.0937 20.0185L25.0532 20.0162L25.0127 20.0138L24.9721 20.0109L24.9316 20.0077C24.9181 20.0066 24.9045 20.0056 24.891 20.0044C24.8774 20.0031 24.864 20.0016 24.8505 20.0003L24.81 19.9962L24.7694 19.9914L24.7289 19.9865L24.6884 19.9811L24.6478 19.9753C24.6343 19.9733 24.6207 19.9714 24.6073 19.9692C24.5937 19.9671 24.5802 19.9648 24.5667 19.9625C24.5532 19.9602 24.5396 19.9581 24.5262 19.9557C24.5126 19.9533 24.4992 19.9506 24.4856 19.9481C24.4721 19.9455 24.4585 19.9431 24.4451 19.9404C24.4315 19.9377 24.4181 19.9347 24.4046 19.9319C24.3911 19.929 24.3775 19.9263 24.364 19.9233C24.3504 19.9203 24.337 19.9171 24.3235 19.9139L24.283 19.9043C24.2694 19.901 24.2559 19.8975 24.2424 19.894C24.2289 19.8905 24.2153 19.8871 24.2019 19.8835C24.1883 19.8798 24.1748 19.876 24.1614 19.8722C24.1478 19.8684 24.1342 19.8645 24.1208 19.8605C24.1072 19.8565 24.0937 19.8523 24.0803 19.8482C24.0667 19.844 24.0532 19.8398 24.0398 19.8354C24.0262 19.831 24.0127 19.8265 23.9992 19.8219C23.9857 19.8174 23.9721 19.8128 23.9587 19.8081C23.9451 19.8033 23.9316 19.7983 23.9181 19.7934C23.9046 19.7884 23.891 19.7835 23.8776 19.7784C23.864 19.7731 23.8505 19.7677 23.837 19.7623C23.8235 19.7569 23.8099 19.7516 23.7965 19.7461C23.7829 19.7404 23.7695 19.7345 23.756 19.7287C23.7424 19.7228 23.7288 19.717 23.7154 19.711C23.7018 19.7049 23.6884 19.6985 23.6749 19.6922C23.6613 19.6858 23.6478 19.6794 23.6344 19.6729C23.6208 19.6663 23.6072 19.6595 23.5938 19.6527C23.5802 19.6458 23.5667 19.6388 23.5533 19.6317C23.5397 19.6246 23.5261 19.6175 23.5127 19.6101C23.4991 19.6027 23.4857 19.5949 23.4722 19.5872C23.4587 19.5795 23.4451 19.5718 23.4317 19.5638C23.418 19.5557 23.4046 19.5474 23.3911 19.5392C23.3775 19.5307 23.364 19.5221 23.3506 19.5135C23.337 19.5048 23.3234 19.4962 23.3101 19.4872C23.2964 19.4781 23.283 19.4686 23.2695 19.4592C23.2559 19.4498 23.2424 19.4401 23.229 19.4304C23.2154 19.4206 23.2018 19.4107 23.1885 19.4006C23.1748 19.3902 23.1613 19.3796 23.1479 19.369C23.1343 19.3582 23.1208 19.3474 23.1074 19.3364C23.0938 19.3252 23.0802 19.314 23.0668 19.3025C23.0531 19.2907 23.0397 19.2787 23.0263 19.2666C23.0126 19.2543 22.9991 19.2419 22.9857 19.2293C22.9721 19.2164 22.9585 19.2035 22.9452 19.1904C22.9316 19.1769 22.918 19.1635 22.9047 19.1498C22.8909 19.1356 22.8775 19.1212 22.8641 19.1067C22.8504 19.0918 22.8369 19.0767 22.8236 19.0615C22.8099 19.0458 22.7964 19.03 22.7831 19.014C22.7694 18.9976 22.7558 18.9809 22.7425 18.9641C22.7288 18.9467 22.7152 18.929 22.702 18.9112C22.6883 18.8928 22.6747 18.8742 22.6615 18.8553C22.6477 18.8357 22.6341 18.8159 22.6209 18.7958C22.6071 18.7748 22.5936 18.7536 22.5804 18.7321C22.5665 18.7096 22.553 18.6868 22.5398 18.6638C22.5259 18.6396 22.5125 18.615 22.4993 18.5902C22.4853 18.5638 22.4719 18.5371 22.4588 18.5101C22.4448 18.4814 22.4313 18.4523 22.4182 18.4228C22.4042 18.3911 22.3906 18.3592 22.3777 18.3266C22.3634 18.2907 22.3501 18.254 22.3372 18.217C22.3228 18.176 22.3093 18.1344 22.2966 18.0921C22.282 18.0431 22.2684 17.9933 22.2561 17.9426C22.2407 17.8795 22.2273 17.8151 22.2156 17.7495C22.1981 17.6522 22.1845 17.5523 22.175 17.4496C22.1641 17.331 22.1585 17.2089 22.1585 17.0832C22.1585 16.9574 22.1641 16.8352 22.175 16.7165C22.1845 16.6138 22.1981 16.5138 22.2156 16.4165C22.2273 16.3509 22.2407 16.2864 22.2561 16.2233C22.2684 16.1726 22.282 16.1228 22.2966 16.0737C22.3093 16.0314 22.3228 15.9898 22.3372 15.9487C22.3501 15.9117 22.3634 15.8751 22.3777 15.8391C22.3906 15.8065 22.4042 15.7745 22.4182 15.7428C22.4313 15.7133 22.4448 15.6842 22.4588 15.6555C22.4719 15.6285 22.4853 15.6017 22.4993 15.5754C22.5125 15.5506 22.5259 15.526 22.5398 15.5017C22.553 15.4787 22.5665 15.4559 22.5804 15.4334C22.5936 15.4119 22.6071 15.3907 22.6209 15.3697C22.6341 15.3496 22.6477 15.3298 22.6615 15.3101C22.6747 15.2912 22.6883 15.2726 22.702 15.2542C22.7152 15.2363 22.7288 15.2188 22.7425 15.2013C22.7558 15.1845 22.7694 15.1678 22.7831 15.1514C22.7964 15.1353 22.8099 15.1195 22.8236 15.1039C22.8369 15.0886 22.8504 15.0735 22.8641 15.0586C22.8775 15.0441 22.8909 15.0296 22.9047 15.0155C22.918 15.0018 22.9316 14.9883 22.9452 14.9749C22.9585 14.9618 22.9721 14.9488 22.9857 14.936C22.9991 14.9234 23.0126 14.9109 23.0263 14.8986C23.0397 14.8865 23.0531 14.8745 23.0668 14.8627C23.0802 14.8512 23.0938 14.8401 23.1074 14.8288C23.1208 14.8178 23.1343 14.8069 23.1479 14.7962C23.1613 14.7855 23.1748 14.7749 23.1885 14.7646C23.2018 14.7545 23.2154 14.7446 23.229 14.7347C23.2424 14.725 23.2559 14.7154 23.2695 14.7059C23.283 14.6965 23.2964 14.6871 23.3101 14.6779C23.3234 14.669 23.337 14.6603 23.3506 14.6516C23.364 14.6429 23.3775 14.6344 23.3911 14.626C23.4046 14.6177 23.418 14.6094 23.4317 14.6013C23.4451 14.5934 23.4587 14.5856 23.4722 14.5779C23.4857 14.5702 23.4991 14.5625 23.5127 14.555C23.5261 14.5476 23.5397 14.5405 23.5533 14.5334C23.5667 14.5263 23.5802 14.5193 23.5938 14.5123C23.6072 14.5055 23.6208 14.4988 23.6344 14.4921C23.6478 14.4856 23.6613 14.4792 23.6749 14.4729C23.6884 14.4666 23.7018 14.4602 23.7154 14.4541C23.7288 14.448 23.7424 14.4422 23.756 14.4364C23.7695 14.4305 23.7829 14.4246 23.7965 14.419C23.8099 14.4134 23.8235 14.4081 23.837 14.4027C23.8505 14.3973 23.864 14.3919 23.8776 14.3867C23.891 14.3815 23.9046 14.3766 23.9181 14.3717C23.9316 14.3667 23.9451 14.3617 23.9587 14.3569C23.9721 14.3522 23.9857 14.3476 23.9992 14.3431C24.0127 14.3385 24.0262 14.334 24.0398 14.3296C24.0532 14.3252 24.0667 14.321 24.0803 14.3168C24.0937 14.3127 24.1072 14.3085 24.1208 14.3045L24.1614 14.2928C24.1748 14.289 24.1883 14.2852 24.2019 14.2815C24.2153 14.2779 24.2289 14.2744 24.2424 14.2709C24.2559 14.2675 24.2694 14.264 24.283 14.2606L24.3235 14.2511C24.337 14.2479 24.3504 14.2447 24.364 14.2417C24.3775 14.2387 24.3911 14.2359 24.4046 14.2331C24.4181 14.2302 24.4315 14.2272 24.4451 14.2245C24.4585 14.2218 24.4721 14.2194 24.4856 14.2169C24.4992 14.2144 24.5126 14.2117 24.5262 14.2092C24.5396 14.2068 24.5532 14.2047 24.5667 14.2025C24.5802 14.2002 24.5937 14.1979 24.6073 14.1957L24.6478 14.1897L24.6884 14.1838L24.7289 14.1784L24.7694 14.1735L24.81 14.1687L24.8505 14.1646C24.864 14.1633 24.8774 14.1618 24.891 14.1605C24.9045 14.1593 24.9181 14.1583 24.9316 14.1572L24.9721 14.154L25.0127 14.1512L25.0532 14.1487L25.0937 14.1464C25.1072 14.1458 25.1208 14.1453 25.1343 14.1448C25.1478 14.1442 25.1612 14.1436 25.1748 14.1431L25.2153 14.1421L25.2559 14.1412L25.2964 14.1406L25.3369 14.1405C25.3505 14.1404 25.3639 14.1402 25.3775 14.1403L25.418 14.1408L25.4585 14.1414L25.4991 14.1423L25.5396 14.1436L25.5802 14.145L25.6207 14.1469L25.6613 14.1489L25.7018 14.1511L25.7423 14.1538L25.7829 14.1566L25.7988 14.1577L25.8234 14.1596L25.8639 14.1629L25.9045 14.1664L25.945 14.1701L25.9855 14.174L26.0261 14.1782L26.0666 14.1826L26.1072 14.1871L26.1477 14.1919L26.1882 14.1969L26.2288 14.2021L26.2693 14.2075L26.3099 14.2132L26.3504 14.219L26.3909 14.2251L26.4315 14.2314L26.472 14.238L26.5125 14.2447L26.5531 14.2517L26.5936 14.2589L26.6342 14.2663L26.6747 14.274L26.7152 14.2819L26.7558 14.29L26.7963 14.2983L26.8368 14.3069L26.8774 14.3157L26.9179 14.3247L26.9584 14.3339L26.999 14.3434L27.0395 14.3532L27.0801 14.3631L27.1206 14.3733L27.1612 14.3837L27.2017 14.3944L27.2422 14.4053L27.2828 14.4164L27.3233 14.4278L27.3638 14.4394L27.4044 14.4513L27.4449 14.4634L27.4854 14.4757L27.526 14.4883L27.5665 14.501L27.6071 14.5141L27.6476 14.5274L27.6882 14.5409L27.7287 14.5546L27.7692 14.5686L27.8098 14.5828L27.8503 14.5973L27.8908 14.612L27.9314 14.6269L27.9719 14.6421L28.0124 14.6575L28.053 14.6732L28.0935 14.689L28.1341 14.7051L28.1746 14.7215L28.2151 14.738L28.2557 14.7548L28.2962 14.7719L28.3367 14.7891L28.3773 14.8066L28.4178 14.8243L28.4583 14.8422L28.4989 14.8603L28.5394 14.8787L28.58 14.8973L28.6205 14.916L28.661 14.935L28.7016 14.9542L28.7421 14.9736L28.7827 14.9932L28.8232 15.013L28.8637 15.033L28.9043 15.0531L28.9448 15.0735L28.9851 15.0939V13.3008L28.9448 13.2908L28.9043 13.2809L28.8637 13.2712L28.8232 13.2617L28.7827 13.2522L28.7421 13.2429L28.7016 13.2336L28.661 13.2245L28.6205 13.2155L28.58 13.2065L28.5394 13.1976L28.4989 13.1889L28.4583 13.1802L28.4178 13.1716L28.3773 13.1631L28.3367 13.1546L28.2962 13.1463L28.2557 13.138L28.2151 13.1298L28.1746 13.1217L28.1341 13.1137L28.0935 13.1057L28.053 13.0979L28.0124 13.0901L27.9719 13.0824L27.9314 13.0747L27.8908 13.0672L27.8503 13.0597L27.8098 13.0523L27.7692 13.045L27.7287 13.0378L27.6882 13.0307L27.6476 13.0236L27.6071 13.0166L27.5665 13.0097L27.526 13.0029L27.4854 12.9962L27.4449 12.9895L27.4044 12.983L27.3638 12.9765L27.3233 12.9701L27.2828 12.9638L27.2422 12.9576L27.2017 12.9514L27.1612 12.9454L27.1206 12.9394L27.0801 12.9336L27.0395 12.9278L26.999 12.9222L26.9584 12.9166L26.9179 12.9111L26.8774 12.9057L26.8368 12.9004L26.7963 12.8952L26.7558 12.8901L26.7152 12.8851L26.6747 12.8802L26.6342 12.8754L26.5936 12.8707L26.5531 12.8661L26.5125 12.8616L26.472 12.8573L26.4315 12.853L26.3909 12.8489L26.3504 12.8448L26.3099 12.8409L26.2693 12.837L26.2288 12.8334L26.1882 12.8298L26.1477 12.8263L26.1072 12.823L26.0666 12.8198L26.0261 12.8168L25.9855 12.8138L25.945 12.811L25.9045 12.8083L25.8639 12.8058L25.8234 12.8034L25.7829 12.8011L25.7423 12.799L25.7018 12.797L25.6811 12.796L25.6613 12.7952L25.6207 12.7935L25.5802 12.7918L25.5396 12.7901L25.4991 12.7887L25.4585 12.7873L25.418 12.7859L25.3775 12.7846L25.3369 12.7835L25.2964 12.7824L25.2559 12.7813L25.2153 12.7805L25.1748 12.7797L25.1343 12.7788L25.0937 12.7783L25.0532 12.7777L25.0127 12.7772L24.9721 12.7769L24.9316 12.7767L24.891 12.7764L24.8505 12.7763L24.81 12.7764L24.7694 12.7764L24.7289 12.7766L24.6884 12.777L24.6478 12.7774L24.6073 12.7778L24.5667 12.7785L24.5262 12.7792L24.4856 12.7799L24.4451 12.7809L24.4046 12.7819L24.364 12.7829L24.3235 12.7842L24.283 12.7856L24.2424 12.787L24.2019 12.7886L24.1614 12.7903L24.1208 12.792L24.0803 12.794L24.0398 12.796L23.9992 12.798L23.9587 12.8003L23.9181 12.8027L23.8776 12.8051L23.837 12.8078L23.7965 12.8105L23.756 12.8133L23.7154 12.8164L23.6749 12.8195L23.6344 12.8227L23.5938 12.8261L23.5533 12.8295L23.5127 12.8332L23.4722 12.837L23.4317 12.8408L23.3911 12.8449L23.3506 12.8491L23.3101 12.8533L23.2695 12.8579L23.229 12.8625L23.1885 12.8672L23.1479 12.8722L23.1074 12.8772L23.0668 12.8824L23.0263 12.8878L22.9857 12.8932L22.9452 12.8989L22.9047 12.9047L22.8641 12.9107L22.8236 12.9169L22.7831 12.9231L22.7425 12.9297L22.702 12.9364L22.6615 12.9432L22.6209 12.9502L22.5804 12.9573L22.5398 12.9648L22.4993 12.9723L22.4588 12.9801L22.4182 12.988L22.3777 12.996L22.3372 13.0045L22.2966 13.0129L22.2561 13.0216L22.2156 13.0306L22.175 13.0396L22.1345 13.049L22.0939 13.0584L22.0534 13.0683L22.0128 13.0782L21.9723 13.0885L21.9318 13.0989L21.8912 13.1096L21.8507 13.1205L21.8102 13.1316L21.7696 13.1431L21.7291 13.1546L21.6886 13.1666L21.648 13.1786L21.6075 13.1911L21.5669 13.2037L21.5264 13.2168C21.5129 13.2212 21.4992 13.2254 21.4858 13.2299L21.4453 13.2435C21.4318 13.2481 21.4182 13.2525 21.4048 13.2572L21.3642 13.2714L21.3237 13.2857C21.3101 13.2905 21.2967 13.2956 21.2832 13.3005C21.2696 13.3055 21.256 13.3104 21.2426 13.3154L21.2021 13.3309C21.1886 13.3361 21.175 13.3412 21.1616 13.3464L21.121 13.3625L21.0805 13.3788L21.0399 13.3956L20.9994 13.4126L20.9589 13.43L20.9183 13.4478L20.8778 13.4659L20.8373 13.4846L20.7968 13.5034C20.7831 13.5099 20.7697 13.5164 20.7562 13.523L20.7157 13.5427L20.6751 13.563L20.6346 13.5837C20.621 13.5908 20.6074 13.5977 20.5941 13.6048C20.5804 13.612 20.567 13.6193 20.5535 13.6266L20.513 13.6487L20.4725 13.6713C20.4588 13.679 20.4454 13.6867 20.4319 13.6945C20.4183 13.7023 20.4048 13.7101 20.3914 13.7181C20.3778 13.7261 20.3643 13.7342 20.3508 13.7424C20.3372 13.7506 20.3237 13.7589 20.3103 13.7672C20.2967 13.7756 20.2831 13.784 20.2698 13.7925C20.2561 13.8012 20.2426 13.8099 20.2292 13.8186L20.1887 13.8453C20.1751 13.8543 20.1615 13.8633 20.1481 13.8724L20.1076 13.9004C20.094 13.91 20.0805 13.9195 20.0671 13.9291C20.0535 13.9389 20.0399 13.9487 20.0265 13.9585C20.013 13.9685 19.9994 13.9784 19.986 13.9885C19.9723 13.9988 19.9589 14.0091 19.9455 14.0195C19.9318 14.0301 19.9183 14.0407 19.9049 14.0513C19.8913 14.0621 19.8778 14.0729 19.8644 14.0839V14.0838Z",fill:"#E10238"})),u=()=>Object(l.createElement)("svg",{width:"52",height:"35",viewBox:"0 0 52 35",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Object(l.createElement)("rect",{x:"0.878906",y:"0.5",width:"50",height:"34",rx:"3.5",fill:"white",stroke:"#F3F3F3"}),Object(l.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M44.0545 5.25735L34.3353 5.25488C34.3341 5.25488 34.3328 5.25488 34.3328 5.25488C34.3253 5.25488 34.3179 5.2562 34.3106 5.2562C32.9754 5.29641 31.3124 6.34915 31.0096 7.64726L26.4132 27.6401C26.1104 28.9503 26.9343 30.0165 28.2599 30.0361H38.4703C39.7756 29.9726 41.044 28.932 41.3417 27.6486L45.9382 7.65564C46.2459 6.33208 45.402 5.25735 44.0545 5.25735Z",fill:"#01798A"}),Object(l.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M26.4134 27.6401L31.0097 7.64729C31.3126 6.34917 32.9755 5.29643 34.3107 5.25622L30.4464 5.25376L23.484 5.25244C22.1451 5.27936 20.4605 6.33949 20.1577 7.64729L15.5601 27.6401C15.2561 28.9503 16.0813 30.0165 17.4059 30.0361H28.26C26.9345 30.0165 26.1105 28.9503 26.4134 27.6401",fill:"#024381"}),Object(l.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M15.5602 27.64L20.1578 7.64714C20.4606 6.33934 22.1452 5.27922 23.4841 5.2523L14.5649 5.25C13.2185 5.25 11.4923 6.32227 11.1846 7.64714L6.58694 27.64C6.55896 27.762 6.54344 27.8815 6.53418 27.9986V28.3695C6.62418 29.3246 7.36619 30.0201 8.43278 30.036H17.406C16.0814 30.0163 15.2562 28.9502 15.5602 27.64Z",fill:"#DD0228"}),Object(l.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M23.6716 19.8205H23.8404C23.9955 19.8205 24.0999 19.7693 24.1488 19.668L24.5874 19.0227H25.762L25.5171 19.4472H26.9254L26.7467 20.0975H25.0709C24.8779 20.3829 24.6403 20.5171 24.3547 20.5012H23.4818L23.6716 19.8205H23.6716ZM23.4788 20.7527H26.5643L26.3676 21.4591H25.1268L24.9374 22.1409H26.1449L25.9482 22.8473H24.7407L24.4602 23.8548C24.3908 24.0232 24.4821 24.099 24.7327 24.0818H25.7168L25.5345 24.7382H23.6451C23.287 24.7382 23.1641 24.5368 23.2765 24.1331L23.6351 22.8473H22.8633L23.0593 22.1409H23.8313L24.0205 21.4591H23.2827L23.4788 20.7527H23.4788ZM28.4035 19.018L28.355 19.4315C28.355 19.4315 28.937 19.002 29.4656 19.002H31.4189L30.6719 21.6601C30.61 21.964 30.3443 22.1151 29.8752 22.1151H27.6612L27.1426 23.9817C27.1128 24.0817 27.155 24.133 27.2667 24.133H27.7023L27.5422 24.7124H26.4347C26.0096 24.7124 25.8328 24.5867 25.903 24.3343L27.3684 19.018H28.4035H28.4035ZM30.0576 19.7693H28.3141L28.1056 20.4866C28.1056 20.4866 28.3959 20.2805 28.8811 20.2731C29.365 20.2657 29.9173 20.2731 29.9173 20.2731L30.0576 19.7693ZM29.4261 21.4333C29.555 21.4504 29.6271 21.4003 29.6358 21.282L29.7425 20.9039H27.9964L27.85 21.4333H29.4261ZM28.2483 22.2921H29.2547L29.236 22.7203H29.504C29.6394 22.7203 29.7065 22.6776 29.7065 22.5935L29.7858 22.3166H30.6223L30.5106 22.7203C30.4161 23.057 30.1656 23.2327 29.7586 23.2499H29.2225L29.22 23.9817C29.2101 24.0989 29.318 24.1587 29.54 24.1587H30.0439L29.8813 24.7381H28.6727C28.3339 24.754 28.1678 24.5953 28.1713 24.2587L28.2483 22.2921V22.2921Z",fill:"white"}),Object(l.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M16.0529 15.4764C15.9164 16.1339 15.6 16.639 15.1091 16.9976C14.6227 17.3502 13.9954 17.527 13.2273 17.527C12.5044 17.527 11.9745 17.3465 11.6364 16.9841C11.4018 16.7267 11.2852 16.3998 11.2852 16.0045C11.2852 15.8411 11.3051 15.6654 11.3448 15.4764L12.1631 11.5972H13.3991L12.5919 15.4325C12.5671 15.5386 12.5571 15.6374 12.5584 15.7265C12.5571 15.9229 12.6068 16.0839 12.7073 16.2095C12.8537 16.3962 13.0914 16.4889 13.4221 16.4889C13.8024 16.4889 14.1158 16.3974 14.359 16.2132C14.6022 16.0302 14.761 15.7704 14.8324 15.4325L15.6422 11.5972H16.8719L16.0529 15.4764Z",fill:"white"}),Object(l.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M21.2436 13.9502H22.2116L21.4534 17.4123H20.4873L21.2436 13.9502ZM21.5482 12.689H22.5248L22.3424 13.5293H21.3659L21.5482 12.689Z",fill:"white"}),Object(l.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M23.0688 17.1487C22.8156 16.9109 22.6878 16.59 22.6865 16.1826C22.6865 16.113 22.6908 16.0338 22.7002 15.9471C22.7095 15.8592 22.7214 15.7739 22.738 15.6946C22.8528 15.1323 23.0973 14.6858 23.4739 14.3564C23.8499 14.0258 24.3036 13.8599 24.8347 13.8599C25.2696 13.8599 25.6145 13.9794 25.8672 14.2185C26.1196 14.4589 26.2462 14.7833 26.2462 15.1957C26.2462 15.2664 26.2407 15.3481 26.2313 15.436C26.2201 15.525 26.2066 15.6104 26.1909 15.6946C26.0787 16.2484 25.8349 16.69 25.4583 17.0134C25.0816 17.3391 24.6293 17.5012 24.1019 17.5012C23.6651 17.5012 23.3213 17.3841 23.0688 17.1487M24.9136 16.4631C25.0843 16.2814 25.2065 16.0056 25.2809 15.6385C25.2921 15.5812 25.302 15.5214 25.3082 15.4616C25.3143 15.403 25.3168 15.3482 25.3168 15.2981C25.3168 15.0846 25.2616 14.9188 25.1506 14.8016C25.0402 14.6833 24.8832 14.6248 24.6804 14.6248C24.4122 14.6248 24.1939 14.7174 24.0227 14.9029C23.8501 15.0884 23.7279 15.3689 23.6509 15.7422C23.6404 15.7995 23.6317 15.8569 23.6237 15.913C23.6175 15.9703 23.6157 16.024 23.6168 16.0728C23.6168 16.285 23.6721 16.4485 23.7831 16.5644C23.8935 16.6803 24.0498 16.7376 24.2553 16.7376C24.5246 16.7376 24.743 16.6461 24.9136 16.4631Z",fill:"white"}),Object(l.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M32.5262 19.8496L32.7596 19.0421H33.9397L33.8888 19.3385C33.8888 19.3385 34.4918 19.0421 34.9261 19.0421C35.3606 19.0421 36.3854 19.0421 36.3854 19.0421L36.1535 19.8496H35.9239L34.8231 23.6582H35.0527L34.8343 24.4146H34.6047L34.5092 24.7427H33.3664L33.4617 24.4146H31.207L31.4268 23.6582H31.6527L32.7544 19.8496H32.5262H32.5262ZM33.7993 19.8498L33.4989 20.8805C33.4989 20.8805 34.0128 20.6866 34.4558 20.6318C34.5536 20.2718 34.6815 19.8498 34.6815 19.8498H33.7993V19.8498ZM33.3598 21.3637L33.0585 22.4433C33.0585 22.4433 33.628 22.1676 34.0188 22.1444C34.1317 21.7271 34.2447 21.3637 34.2447 21.3637H33.3598V21.3637ZM33.5808 23.6583L33.8067 22.8751H32.9258L32.6987 23.6583H33.5808ZM36.4352 18.9922H37.5447L37.5918 19.3946C37.5844 19.4971 37.6463 19.546 37.7779 19.546H37.9739L37.7756 20.2279H36.9601C36.6487 20.2437 36.4886 20.1267 36.4738 19.8741L36.4352 18.9922ZM36.1102 20.4548H39.7039L39.493 21.1868H38.3488L38.1526 21.8673H39.2957L39.0835 22.5981H37.8104L37.5224 23.0264H38.1455L38.2894 23.8839C38.3066 23.9693 38.3836 24.0108 38.5151 24.0108H38.7086L38.5053 24.717H37.8202C37.4653 24.7342 37.2818 24.6171 37.2667 24.3646L37.1016 23.5814L36.5346 24.4146C36.4005 24.65 36.1945 24.7599 35.9167 24.7427H34.8705L35.074 24.0363H35.4004C35.5345 24.0363 35.646 23.9778 35.7465 23.8595L36.634 22.5981H35.4898L35.7018 21.8673H36.9428L37.1402 21.1868H35.898L36.1102 20.4548Z",fill:"white"}),Object(l.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M17.1915 13.9492H18.0645L17.9647 14.4493L18.0899 14.3066C18.3729 14.009 18.7166 13.8613 19.1224 13.8613C19.4898 13.8613 19.7547 13.9663 19.921 14.1773C20.0847 14.3884 20.1294 14.6799 20.0519 15.0544L19.571 17.4137H18.6738L19.1081 15.2752C19.1529 15.0544 19.1405 14.8897 19.0715 14.7836C19.0033 14.6774 18.873 14.625 18.685 14.625C18.4542 14.625 18.26 14.6957 18.1017 14.8361C17.9429 14.9776 17.8381 15.174 17.7865 15.424L17.3863 17.4137H16.4873L17.1915 13.9492Z",fill:"white"}),Object(l.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M27.2021 13.9492H28.0758L27.9767 14.4493L28.1006 14.3066C28.3837 14.009 28.7287 13.8613 29.1332 13.8613C29.5005 13.8613 29.766 13.9663 29.931 14.1773C30.0937 14.3884 30.1408 14.6799 30.0614 15.0544L29.5823 17.4137H28.6839L29.1184 15.2752C29.1629 15.0544 29.1506 14.8897 29.0823 14.7836C29.0115 14.6774 28.8836 14.625 28.6964 14.625C28.4655 14.625 28.272 14.6957 28.1119 14.8361C27.953 14.9776 27.8476 15.174 27.798 15.424L27.396 17.4137H26.498L27.2021 13.9492",fill:"white"}),Object(l.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M31.5212 11.8018H34.0577C34.5454 11.8018 34.9225 11.9104 35.1818 12.1238C35.44 12.3398 35.5692 12.6497 35.5692 13.0534V13.0656C35.5692 13.1424 35.564 13.229 35.5567 13.3229C35.5441 13.4157 35.5279 13.5095 35.5071 13.6072C35.3954 14.1415 35.1359 14.571 34.7352 14.8967C34.333 15.2211 33.8567 15.3846 33.3082 15.3846H31.9479L31.5274 17.4133H30.3496L31.5212 11.8018M32.1554 14.4087H33.2835C33.5776 14.4087 33.8108 14.3415 33.9809 14.2086C34.1497 14.0744 34.2614 13.8695 34.3234 13.5914C34.3332 13.54 34.3394 13.4937 34.3469 13.451C34.3508 13.4108 34.3556 13.3704 34.3556 13.3315C34.3556 13.1326 34.2838 12.9887 34.1397 12.8984C33.9958 12.8068 33.7701 12.763 33.4572 12.763H32.4991L32.1554 14.4087",fill:"white"}),Object(l.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M40.8406 18.0833C40.4683 18.8615 40.1135 19.3152 39.9051 19.5263C39.6964 19.735 39.2833 20.2205 38.2881 20.1839L38.3737 19.5898C39.2112 19.3361 39.6642 18.1929 39.9223 17.6867L39.6146 13.9587L40.2624 13.9502H40.8059L40.8643 16.2888L41.8829 13.9502H42.9143L40.8406 18.0833Z",fill:"white"}),Object(l.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M37.9561 14.232L37.5464 14.509C37.1183 14.1796 36.7274 13.9759 35.9731 14.3199C34.9454 14.7883 34.0868 18.381 36.9161 17.1976L37.0774 17.3855L38.1905 17.4135L38.9215 14.1491L37.9561 14.232M37.3233 16.0168C37.1445 16.5353 36.7451 16.8781 36.4324 16.7805C36.1196 16.6853 36.008 16.1851 36.1891 15.6655C36.3678 15.1458 36.7698 14.8042 37.08 14.9018C37.3927 14.997 37.5056 15.4971 37.3233 16.0168Z",fill:"white"}),Object(l.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M34.3328 5.26107L30.4463 5.25342L34.3106 5.26981C34.318 5.26981 34.3253 5.26107 34.3328 5.26107",fill:"#E02F41"}),Object(l.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M30.4467 5.27406L23.5378 5.25C23.5204 5.25 23.5024 5.25765 23.4844 5.26531L30.4467 5.27406",fill:"#2E4F7D"}));const h=()=>Object(l.createElement)(l.Fragment,null,Object(l.createElement)(t.Text,{as:"h3",variant:"label",weight:"600",size:"12",lineHeight:"16px"},Object(c.__)("Accepted payment methods",'woocommerce')),Object(l.createElement)("div",{className:"woocommerce-task-payment-wcpay__accepted"},Object(l.createElement)(i,null),Object(l.createElement)(d,null),Object(l.createElement)(V,null),Object(l.createElement)(a,null),Object(l.createElement)(m,null),Object(l.createElement)(r,null),Object(l.createElement)(f,null),Object(l.createElement)(u,null),Object(l.createElement)(p,null),Object(l.createElement)(o,null)));var M=({width:C=196,height:H=41})=>Object(l.createElement)("svg",{width:C,height:H,viewBox:`0 0 ${C} ${H}`,fill:"none",xmlns:"http://www.w3.org/2000/svg"},Object(l.createElement)("title",null,"WooCommerce Payments"),Object(l.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M6.16119 0H60.1988C63.6186 0 66.387 2.74594 66.387 6.13799V26.598C66.387 29.99 63.6186 32.736 60.1988 32.736H40.8202L43.48 39.197L31.7823 32.736H6.18833C2.76858 32.736 0.000197874 29.99 0.000197874 26.598V6.13799C-0.0269431 2.77286 2.74143 0 6.16119 0Z",fill:"#7F54B3"}),Object(l.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M3.88666 5.40393C4.26664 4.89243 4.8366 4.62322 5.59655 4.56938C6.98073 4.46169 7.76782 5.1078 7.95781 6.50769C8.79918 12.1342 9.72197 16.8992 10.699 20.8028L16.6429 9.57669C17.1857 8.55369 17.8643 8.01527 18.6785 7.96143C19.8727 7.88066 20.6055 8.63445 20.904 10.2228C21.5826 13.8033 22.4511 16.8454 23.4824 19.4298C24.1881 12.5918 25.3823 7.6653 27.065 4.62322C27.4722 3.86943 28.0692 3.49254 28.8563 3.4387C29.4806 3.38486 30.0505 3.5733 30.5662 3.97712C31.0819 4.38093 31.3533 4.89243 31.4076 5.51161C31.4347 5.99619 31.3533 6.40001 31.1362 6.80383C30.0777 8.74214 29.2092 11.9996 28.5035 16.5223C27.825 20.9104 27.5807 24.3294 27.7436 26.7792C27.7978 27.4522 27.6893 28.0445 27.4179 28.556C27.0922 29.1483 26.6036 29.4713 25.9794 29.5252C25.2737 29.579 24.5409 29.256 23.8353 28.5291C21.3112 25.9716 19.3027 22.1488 17.8371 17.0607C16.073 20.5066 14.7702 23.091 13.9288 24.814C12.3275 27.8561 10.9705 29.4175 9.83053 29.4982C9.09773 29.5521 8.47349 28.9329 7.93067 27.6407C6.54648 24.114 5.05373 17.303 3.45241 7.20764C3.37099 6.5077 3.50669 5.88851 3.88666 5.40393ZM62.24 9.6307C61.263 7.93467 59.8245 6.91167 57.8975 6.50786C57.3818 6.40017 56.8933 6.34633 56.4319 6.34633C53.8263 6.34633 51.7094 7.69238 50.0537 10.3845C48.6424 12.6728 47.9368 15.2033 47.9368 17.9762C47.9368 20.0491 48.371 21.8259 49.2395 23.3066C50.2166 25.0026 51.6551 26.0256 53.5821 26.4294C54.0978 26.5371 54.5863 26.5909 55.0477 26.5909C57.6804 26.5909 59.7974 25.2449 61.4258 22.5528C62.8371 20.2376 63.5428 17.707 63.5428 14.9341C63.5428 12.8343 63.1086 11.0844 62.24 9.6307ZM58.8203 17.0878C58.4403 18.8646 57.7618 20.1837 56.7576 21.0721C55.9705 21.7721 55.2377 22.0682 54.5592 21.9336C53.9078 21.799 53.365 21.2337 52.9578 20.1837C52.6321 19.3492 52.4693 18.5146 52.4693 17.7339C52.4693 17.0609 52.5236 16.3879 52.6593 15.7687C52.9036 14.6649 53.365 13.5881 54.0978 12.5651C54.9934 11.246 55.9433 10.7075 56.9204 10.896C57.5718 11.0306 58.1146 11.5959 58.5217 12.6458C58.8474 13.4804 59.0103 14.315 59.0103 15.0957C59.0103 15.7956 58.9288 16.4686 58.8203 17.0878ZM40.8794 6.50786C42.7793 6.91167 44.2449 7.93467 45.222 9.6307C46.0905 11.0844 46.5247 12.8343 46.5247 14.9341C46.5247 17.707 45.8191 20.2376 44.4077 22.5528C42.7793 25.2449 40.6623 26.5909 38.0296 26.5909C37.5682 26.5909 37.0797 26.5371 36.564 26.4294C34.637 26.0256 33.1985 25.0026 32.2214 23.3066C31.3529 21.8259 30.9187 20.0491 30.9187 17.9762C30.9187 15.2033 31.6243 12.6728 33.0357 10.3845C34.6913 7.69238 36.8083 6.34633 39.4138 6.34633C39.8752 6.34633 40.3637 6.40017 40.8794 6.50786ZM39.7395 21.0721C40.7437 20.1837 41.4222 18.8646 41.8022 17.0878C41.9379 16.4686 41.9922 15.7956 41.9922 15.0957C41.9922 14.315 41.8293 13.4804 41.5036 12.6458C41.0965 11.5959 40.5537 11.0306 39.9023 10.896C38.9253 10.7075 37.9753 11.246 37.0797 12.5651C36.3469 13.5881 35.8855 14.6649 35.6412 15.7687C35.5055 16.3879 35.4512 17.0609 35.4512 17.7339C35.4512 18.5146 35.6141 19.3492 35.9398 20.1837C36.3469 21.2337 36.8897 21.799 37.5411 21.9336C38.2196 22.0682 38.9524 21.7721 39.7395 21.0721Z",fill:"white"}),Object(l.createElement)("path",{d:"M143.023 29.9316V38.217H144.057V35.26H146.141C147.697 35.26 148.805 34.1633 148.805 32.613C148.805 31.0341 147.72 29.9316 146.153 29.9316H143.023ZM144.057 30.8503H145.883C147.083 30.8503 147.743 31.4762 147.743 32.613C147.743 33.7097 147.06 34.3413 145.883 34.3413H144.057V30.8503Z",fill:"black"}),Object(l.createElement)("path",{d:"M151.866 38.3261C152.693 38.3261 153.37 37.9643 153.772 37.304H153.864V38.217H154.806V33.9796C154.806 32.6934 153.961 31.9183 152.451 31.9183C151.131 31.9183 150.155 32.5728 150.023 33.5662H151.022C151.159 33.0781 151.676 32.7968 152.417 32.7968C153.341 32.7968 153.818 33.2159 153.818 33.9796V34.5423L152.032 34.6514C150.591 34.7375 149.776 35.3748 149.776 36.483C149.776 37.6141 150.666 38.3261 151.866 38.3261ZM152.049 37.4591C151.332 37.4591 150.798 37.0916 150.798 36.46C150.798 35.8399 151.211 35.5126 152.153 35.4495L153.818 35.3404V35.9088C153.818 36.793 153.066 37.4591 152.049 37.4591Z",fill:"black"}),Object(l.createElement)("path",{d:"M156.93 40.4563C158.027 40.4563 158.52 40.0314 159.049 38.5959L161.466 32.0274H160.415L158.721 37.1203H158.63L156.93 32.0274H155.862L158.153 38.2227L158.038 38.5902C157.78 39.3366 157.47 39.6065 156.901 39.6065C156.763 39.6065 156.608 39.6007 156.488 39.5778V40.4218C156.626 40.4448 156.798 40.4563 156.93 40.4563Z",fill:"black"}),Object(l.createElement)("path",{d:"M162.787 38.217H163.774V34.3815C163.774 33.5087 164.4 32.8083 165.21 32.8083C165.99 32.8083 166.501 33.2791 166.501 34.014V38.217H167.489V34.238C167.489 33.4513 168.063 32.8083 168.924 32.8083C169.797 32.8083 170.228 33.2561 170.228 34.1691V38.217H171.215V33.9394C171.215 32.6417 170.509 31.9183 169.246 31.9183C168.39 31.9183 167.684 32.3489 167.351 33.0035H167.259C166.972 32.3604 166.387 31.9183 165.548 31.9183C164.722 31.9183 164.101 32.3145 163.82 33.0035H163.728V32.0274H162.787V38.217Z",fill:"black"}),Object(l.createElement)("path",{d:"M177.118 36.615C176.86 37.1605 176.32 37.4533 175.522 37.4533C174.471 37.4533 173.788 36.6782 173.736 35.4552V35.4093H178.186V35.0303C178.186 33.1068 177.17 31.9183 175.499 31.9183C173.799 31.9183 172.708 33.1815 172.708 35.1279C172.708 37.0859 173.782 38.3261 175.499 38.3261C176.854 38.3261 177.818 37.6715 178.106 36.615H177.118ZM175.487 32.791C176.469 32.791 177.124 33.5145 177.147 34.6112H173.736C173.811 33.5145 174.5 32.791 175.487 32.791Z",fill:"black"}),Object(l.createElement)("path",{d:"M179.736 38.217H180.724V34.5537C180.724 33.4686 181.361 32.8083 182.349 32.8083C183.336 32.8083 183.807 33.3365 183.807 34.4504V38.217H184.795V34.2092C184.795 32.7394 184.02 31.9183 182.63 31.9183C181.683 31.9183 181.08 32.3202 180.77 33.0035H180.678V32.0274H179.736V38.217Z",fill:"black"}),Object(l.createElement)("path",{d:"M187.017 30.4254V32.0274H186.018V32.8542H187.017V36.6093C187.017 37.7921 187.528 38.2629 188.802 38.2629C188.998 38.2629 189.187 38.24 189.382 38.2055V37.3729C189.199 37.3902 189.101 37.3959 188.923 37.3959C188.28 37.3959 188.004 37.0859 188.004 36.3567V32.8542H189.382V32.0274H188.004V30.4254H187.017Z",fill:"black"}),Object(l.createElement)("path",{d:"M190.617 33.7212C190.617 34.6169 191.145 35.1164 192.305 35.3978L193.367 35.6562C194.027 35.8169 194.349 36.104 194.349 36.5289C194.349 37.0973 193.752 37.4935 192.919 37.4935C192.127 37.4935 191.633 37.1605 191.467 36.638H190.45C190.559 37.6658 191.507 38.3261 192.885 38.3261C194.292 38.3261 195.365 37.5624 195.365 36.4543C195.365 35.5643 194.803 35.059 193.637 34.7777L192.684 34.548C191.955 34.37 191.61 34.1059 191.61 33.681C191.61 33.1298 192.184 32.7566 192.919 32.7566C193.666 32.7566 194.148 33.0839 194.28 33.5777H195.256C195.124 32.5614 194.223 31.9183 192.925 31.9183C191.61 31.9183 190.617 32.6934 190.617 33.7212Z",fill:"black"}),Object(l.createElement)("path",{d:"M73.2688 9.52456C71.4503 11.3014 70.5547 13.5627 70.5547 16.3087C70.5547 19.2431 71.4503 21.639 73.2416 23.4427C75.0329 25.2464 77.3671 26.1618 80.2711 26.1618C81.1125 26.1618 82.0625 26.0272 83.0938 25.731V21.3698C82.1439 21.639 81.3296 21.7736 80.624 21.7736C79.1855 21.7736 78.0456 21.289 77.1771 20.3468C76.3086 19.3777 75.8743 18.0854 75.8743 16.4433C75.8743 14.9088 76.3086 13.6435 77.1499 12.6743C78.0185 11.6782 79.0769 11.1937 80.3797 11.1937C81.2211 11.1937 82.1167 11.3283 83.0938 11.5975V7.23628C82.1982 6.99399 81.1939 6.8863 80.1354 6.8863C77.3671 6.85938 75.0872 7.74778 73.2688 9.52456ZM92.1046 6.85938C89.6076 6.85938 87.6535 7.69393 86.2422 9.33611C84.8308 10.9783 84.1523 13.2935 84.1523 16.2548C84.1523 19.4584 84.858 21.9082 86.2422 23.6043C87.6263 25.3003 89.6619 26.1618 92.3217 26.1618C94.9001 26.1618 96.8814 25.3003 98.2656 23.6043C99.6498 21.9082 100.355 19.5123 100.355 16.4433C100.355 13.3743 99.6498 11.0052 98.2384 9.33611C96.8 7.69393 94.7644 6.85938 92.1046 6.85938ZM94.2487 20.8583C93.7602 21.6121 93.0274 21.989 92.1046 21.989C91.2361 21.989 90.5847 21.6121 90.1233 20.8583C89.6619 20.1045 89.4448 18.5969 89.4448 16.3087C89.4448 12.782 90.3404 11.0321 92.1589 11.0321C94.0587 11.0321 95.0358 12.8089 95.0358 16.3894C95.0087 18.597 94.7373 20.1045 94.2487 20.8583ZM113.763 7.37088L112.786 11.4898C112.542 12.5397 112.297 13.6166 112.08 14.7203L111.538 17.5739C111.022 14.7203 110.316 11.3283 109.421 7.37088H103.124L100.763 25.7041H105.485L106.761 13.0781L109.99 25.7041H113.356L116.45 13.1051L117.78 25.7041H122.72L120.223 7.37088H113.763ZM136.371 7.37088L135.394 11.4898C135.15 12.5397 134.906 13.6166 134.689 14.7203L134.146 17.5739C133.63 14.7203 132.925 11.3283 132.029 7.37088H125.732L123.371 25.7041H128.093L129.369 13.0781L132.599 25.7041H135.964L139.031 13.1051L140.361 25.7041H145.301L142.804 7.37088H136.371ZM151.733 18.4623H156.157V14.6665H151.733V11.3013H156.836V7.3978H146.739V25.731H156.863V21.8275H151.733V18.4623ZM170.922 15.5549C171.438 14.7203 171.709 13.8588 171.709 12.9705C171.709 11.2475 171.03 9.87453 169.673 8.87845C168.316 7.88237 166.444 7.37088 164.11 7.37088H158.301V25.7041H163.295V17.3586H163.377L167.421 25.7041H172.686L168.696 17.4393C169.646 17.0086 170.406 16.3894 170.922 15.5549ZM163.268 15.2587V10.8975C164.462 10.9245 165.304 11.1129 165.819 11.4898C166.335 11.8667 166.579 12.4589 166.579 13.3204C166.579 14.5857 165.467 15.2318 163.268 15.2587ZM174.64 9.52456C172.822 11.3014 171.926 13.5627 171.926 16.3087C171.926 19.2431 172.822 21.639 174.613 23.4427C176.404 25.2464 178.738 26.1618 181.643 26.1618C182.484 26.1618 183.434 26.0272 184.465 25.731V21.3698C183.515 21.639 182.701 21.7736 181.995 21.7736C180.557 21.7736 179.417 21.289 178.548 20.3468C177.68 19.3777 177.246 18.0854 177.246 16.4433C177.246 14.9088 177.68 13.6435 178.521 12.6743C179.39 11.6782 180.448 11.1937 181.751 11.1937C182.592 11.1937 183.488 11.3283 184.465 11.5975V7.23628C183.57 6.99399 182.565 6.8863 181.507 6.8863C178.766 6.85938 176.459 7.74778 174.64 9.52456ZM190.843 21.7736V18.4354H195.267V14.6396H190.843V11.2744H195.973V7.37088H185.877V25.7041H196V21.8005H190.843V21.7736Z",fill:"black"}));const b=({logoWidth:C=196,logoHeight:H=41,children:e})=>Object(l.createElement)(L.CardHeader,{as:"h2"},Object(l.createElement)(M,{width:C,height:H}),e),Z=({description:C,heading:H,onLinkClick:e=(()=>{})})=>Object(l.createElement)(L.CardBody,null,H&&Object(l.createElement)(t.Text,{as:"h2"},H),Object(l.createElement)(t.Text,{className:"woocommerce-task-payment-wcpay__description",as:"p",lineHeight:"1.5em"},C,Object(l.createElement)("br",null),Object(l.createElement)(n.Link,{target:"_blank",type:"external",rel:"noreferrer",href:"https://woocommerce.com/payments/?utm_medium=product",onClick:e},Object(c.__)("Learn more",'woocommerce'))),Object(l.createElement)(h,null)),v=({children:C})=>Object(l.createElement)(L.CardFooter,null,C),O=({children:C})=>Object(l.createElement)(L.Card,{className:"woocommerce-task-payment-wcpay"},C),s=({isLocalPartner:C=!1})=>{const H=C?Object(c.__)("Local Partner",'woocommerce'):Object(c.__)("Recommended",'woocommerce');return Object(l.createElement)("div",{className:"woocommerce-task-payment__recommended-ribbon"},Object(l.createElement)("span",null,H))};var j=e(61),E=e.n(j);const w=()=>Object(l.createElement)("span",{className:"woocommerce-task-payment__setup_required"},Object(l.createElement)(E.a,null),Object(l.createElement)(t.Text,{variant:"small",size:"14",lineHeight:"20px"},Object(c.__)("Setup required",'woocommerce')));var R=()=>Object(l.createElement)("svg",{width:"36",height:"25",viewBox:"0 0 36 25",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Object(l.createElement)("rect",{x:"1.41431",y:"1",width:"33.7586",height:"23",rx:"3.5",fill:"white",stroke:"#F3F3F3"}),Object(l.createElement)("path",{d:"M17.645 14.9708V12.2642V12.2636H19.1074C19.7104 12.264 20.2171 12.0743 20.6276 11.6946C21.0425 11.3342 21.2745 10.816 21.2627 10.2759C21.2709 9.73881 21.0393 9.22448 20.6276 8.86525C20.2207 8.48344 19.6734 8.27511 19.1074 8.28658H16.7598V14.9708H17.645ZM17.6451 11.4427V9.10938V9.10885H19.1295C19.4604 9.09983 19.7793 9.22898 20.0054 9.46351C20.2328 9.678 20.3611 9.97262 20.3611 10.2803C20.3611 10.588 20.2328 10.8826 20.0054 11.0971C19.7766 11.3267 19.4586 11.4522 19.1295 11.4427H17.6451Z",fill:"#5F6368"}),Object(l.createElement)("path",{d:"M24.8518 10.7568C24.4731 10.4176 23.9567 10.248 23.3024 10.248C22.462 10.248 21.8273 10.5467 21.3985 11.144L22.1781 11.6203C22.4662 11.2157 22.8574 11.0134 23.3519 11.0134C23.6672 11.0098 23.9722 11.1216 24.2063 11.3264C24.4397 11.5136 24.5739 11.7927 24.5719 12.0864V12.2827C24.2318 12.096 23.7989 12.0027 23.2733 12.0027C22.6575 12.0034 22.1652 12.1435 21.7965 12.423C21.4278 12.7024 21.2434 13.0788 21.2434 13.552C21.2354 13.983 21.4281 14.3944 21.7679 14.672C22.1176 14.9707 22.5521 15.12 23.0715 15.12C23.68 15.12 24.1674 14.8587 24.534 14.336H24.5725V14.9707H25.4192V12.152C25.4195 11.5611 25.2304 11.096 24.8518 10.7568ZM22.4508 14.1307C22.2654 14.0011 22.156 13.7924 22.1572 13.5707C22.1572 13.3216 22.2776 13.1142 22.5201 12.9435C22.7602 12.7753 23.06 12.6912 23.4196 12.6912C23.9133 12.6912 24.2982 12.7979 24.5742 13.0112C24.5742 13.3718 24.4276 13.6859 24.1343 13.9536C23.8702 14.2099 23.5122 14.3541 23.1386 14.3547C22.8896 14.3592 22.6466 14.2801 22.4508 14.1307Z",fill:"#5F6368"}),Object(l.createElement)("path",{d:"M30.2792 10.3975L27.3235 16.9868H26.4097L27.5065 14.6812L25.563 10.3975H26.5251L27.9299 13.6828H27.9491L29.3154 10.3975H30.2792Z",fill:"#5F6368"}),Object(l.createElement)("path",{d:"M14.0677 11.6812C14.068 11.4195 14.0452 11.1583 13.9995 10.9004H10.2664V12.3793H12.4045C12.3161 12.8566 12.0305 13.2782 11.6139 13.5463V14.5063H12.89C13.6372 13.838 14.0677 12.8497 14.0677 11.6812Z",fill:"#4285F4"}),Object(l.createElement)("path",{d:"M10.2666 15.4332C11.3349 15.4332 12.2344 15.0929 12.8903 14.5063L11.6142 13.5463C11.259 13.7799 10.8016 13.9132 10.2666 13.9132C9.23409 13.9132 8.35771 13.238 8.04432 12.3281H6.72974V13.3175C7.40168 14.6145 8.77018 15.4331 10.2666 15.4332Z",fill:"#34A853"}),Object(l.createElement)("path",{d:"M8.04421 12.3283C7.87853 11.8516 7.87853 11.3353 8.04421 10.8585V9.86914H6.72962C6.1676 10.954 6.1676 12.2328 6.72962 13.3177L8.04421 12.3283Z",fill:"#FBBC04"}),Object(l.createElement)("path",{d:"M10.2666 9.27318C10.8312 9.26424 11.3766 9.47114 11.7852 9.84918L12.915 8.75318C12.1986 8.10042 11.2495 7.74205 10.2666 7.75318C8.77018 7.75325 7.40168 8.57187 6.72974 9.86892L8.04432 10.8582C8.35771 9.94838 9.23409 9.27318 10.2666 9.27318Z",fill:"#EA4335"}));const g=({id:C,...H})=>Object(l.createElement)(L.Fill,Object.assign({name:"woocommerce_payment_gateway_setup_"+C},H));g.Slot=({id:C,fillProps:H})=>Object(l.createElement)(L.Slot,{name:"woocommerce_payment_gateway_setup_"+C,fillProps:H});const x=({id:C,...H})=>Object(l.createElement)(L.Fill,Object.assign({name:"woocommerce_payment_gateway_configure_"+C},H));x.Slot=({id:C,fillProps:H})=>Object(l.createElement)(L.Slot,{name:"woocommerce_payment_gateway_configure_"+C,fillProps:H});const F=({id:C,...H})=>Object(l.createElement)(L.Fill,Object.assign({name:"woocommerce_onboarding_task_"+C},H));F.Slot=({id:C,fillProps:H})=>Object(l.createElement)(L.Slot,{name:"woocommerce_onboarding_task_"+C,fillProps:H});const _=({id:C,...H})=>Object(l.createElement)(L.Fill,Object.assign({name:"woocommerce_onboarding_task_list_item_"+C},H));_.Slot=({id:C,fillProps:H})=>Object(l.createElement)(L.Slot,{name:"woocommerce_onboarding_task_list_item_"+C,fillProps:H})},3:function(C,H){C.exports=window.wp.components},5:function(C,H){C.exports=window.React},61:function(C,H,e){"use strict";var L=Object.assign||function(C){for(var H,e=1;e<arguments.length;e++)for(var L in H=arguments[e])Object.prototype.hasOwnProperty.call(H,L)&&(C[L]=H[L]);return C};Object.defineProperty(H,"__esModule",{value:!0}),H.default=function(C){var H,e=C.size,t=void 0===e?24:e,l=C.onClick,c=(C.icon,C.className),i=function(C,H){var e={};for(var L in C)0<=H.indexOf(L)||Object.prototype.hasOwnProperty.call(C,L)&&(e[L]=C[L]);return e}(C,["size","onClick","icon","className"]),d=["gridicon","gridicons-notice-outline",c,(H=t,!(0!=H%18)&&"needs-offset"),!1,!1].filter(Boolean).join(" ");return n.default.createElement("svg",L({className:d,height:t,width:t,onClick:l},i,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"}),n.default.createElement("g",null,n.default.createElement("path",{d:"M12 4c4.41 0 8 3.59 8 8s-3.59 8-8 8-8-3.59-8-8 3.59-8 8-8m0-2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2zm1 13h-2v2h2v-2zm-2-2h2l.5-6h-3l.5 6z"})))};var t,l=e(5),n=(t=l)&&t.__esModule?t:{default:t};C.exports=H.default}});woocommerce-admin/dist/onboarding/style.css000064400000005227151335517650015131 0ustar00:root{--wp-admin-theme-color:#007cba;--wp-admin-theme-color-darker-10:#006ba1;--wp-admin-theme-color-darker-20:#005a87}body.admin-color-light{--wp-admin-theme-color:#0085ba;--wp-admin-theme-color-darker-10:#0073a1;--wp-admin-theme-color-darker-20:#006187}body.admin-color-modern{--wp-admin-theme-color:#3858e9;--wp-admin-theme-color-darker-10:#2145e6;--wp-admin-theme-color-darker-20:#183ad6}body.admin-color-blue{--wp-admin-theme-color:#096484;--wp-admin-theme-color-darker-10:#07526c;--wp-admin-theme-color-darker-20:#064054}body.admin-color-coffee{--wp-admin-theme-color:#46403c;--wp-admin-theme-color-darker-10:#383330;--wp-admin-theme-color-darker-20:#2b2724}body.admin-color-ectoplasm{--wp-admin-theme-color:#523f6d;--wp-admin-theme-color-darker-10:#46365d;--wp-admin-theme-color-darker-20:#3a2c4d}body.admin-color-midnight{--wp-admin-theme-color:#e14d43;--wp-admin-theme-color-darker-10:#dd382d;--wp-admin-theme-color-darker-20:#d02c21}body.admin-color-ocean{--wp-admin-theme-color:#627c83;--wp-admin-theme-color-darker-10:#576e74;--wp-admin-theme-color-darker-20:#4c6066}body.admin-color-sunrise{--wp-admin-theme-color:#dd823b;--wp-admin-theme-color-darker-10:#d97426;--wp-admin-theme-color-darker-20:#c36922}.woocommerce-task-payments .woocommerce-task-payment-wcpay .woocommerce-task-payment-wcpay__description{font-size:16px;margin-bottom:24px}.woocommerce-task-payments .woocommerce-task-payment-wcpay .components-card__header{margin-bottom:12px;justify-content:flex-start;padding:25px}.woocommerce-task-payments .woocommerce-task-payment-wcpay .components-card__header .woocommerce-pill{margin-left:12px}.woocommerce-task-payments .woocommerce-task-payment-wcpay .components-card__footer{flex-direction:column;align-items:flex-start}.woocommerce-task-payments .woocommerce-task-payment-wcpay .components-card__footer .components-button{margin-top:16px;margin-left:0}.woocommerce-task-payments .woocommerce-task-payment-wcpay .components-card__body h2{margin:0 0 20px}.woocommerce-task-payments .woocommerce-task-payment-wcpay .woocommerce-task-payment-wcpay__accepted{display:flex;margin-top:12px;flex-wrap:wrap;gap:12px}.woocommerce-task-payments .woocommerce-task-payment-wcpay .woocommerce-task-payment-wcpay__accepted h3{color:#40464d}.woocommerce-task-payment__recommended-ribbon{transform:rotate(-45deg) translate(-50%,-50%);background:#2c3338;color:#fff;font-size:11px;line-height:20px;position:absolute;top:0;left:0;line-height:1;padding:7px 40px;transform-origin:top left;margin-top:32px;margin-left:32px}.woocommerce-task-payment__recommended-ribbon span{max-width:70px}@media(max-width:600px){.woocommerce-task-payment__recommended-ribbon{margin-top:24px;margin-left:24px;font-size:9px}}woocommerce-admin/dist/onboarding/index.asset.php000064400000000264151335517650016211 0ustar00<?php return array('dependencies' => array('react', 'wc-components', 'wc-experimental', 'wp-components', 'wp-element', 'wp-i18n'), 'version' => '2314c81828c8eb725554bc3607dc8b1a');woocommerce-admin/dist/chunks/leaderboards.js000064400000011614151335517650015412 0ustar00(window.__wcAdmin_webpackJsonp=window.__wcAdmin_webpackJsonp||[]).push([[32],{504:function(e,t,a){"use strict";var r=a(0),o=a(2),s=a(1),l=a.n(s),n=a(21);function c({className:e}){const t=Object(o.__)("There was an error getting your stats. Please try again.",'woocommerce'),a=Object(o.__)("Reload",'woocommerce');return Object(r.createElement)(n.EmptyContent,{className:e,title:t,actionLabel:a,actionCallback:()=>{window.location.reload()}})}c.propTypes={className:l.a.string},t.a=c},509:function(e,t,a){"use strict";var r=a(53);const o=["a","b","em","i","strong","p","br"],s=["target","href","rel","name","download"];t.a=e=>({__html:Object(r.sanitize)(e,{ALLOWED_TAGS:o,ALLOWED_ATTR:s})})},601:function(e,t,a){},602:function(e,t,a){},620:function(e,t,a){"use strict";a.r(t);var r=a(0),o=a(2),s=a(14),l=a(1),n=a.n(l),c=a(3),d=a(7),i=a(21),m=a(11),b=a(13),u=a(16),g=a(12),p=a(20),w=a(504),O=a(509);a(601);class _ extends r.Component{getFormattedHeaders(){return this.props.headers.map((e,t)=>({isLeftAligned:0===t,hiddenByDefault:!1,isSortable:!1,key:e.label,label:e.label}))}getFormattedRows(){return this.props.rows.map(e=>e.map(e=>({display:Object(r.createElement)("div",{dangerouslySetInnerHTML:Object(O.a)(e.display)}),value:e.value})))}render(){const{isRequesting:e,isError:t,totalRows:a,title:s}=this.props,l="woocommerce-leaderboard";if(t)return Object(r.createElement)(w.a,{className:l});const n=this.getFormattedRows();return e||0!==n.length?Object(r.createElement)(i.TableCard,{className:l,headers:this.getFormattedHeaders(),isLoading:e,rows:n,rowsPerPage:a,showMenu:!1,title:s,totalRows:a}):Object(r.createElement)(c.Card,{className:l},Object(r.createElement)(c.CardHeader,null,Object(r.createElement)(p.Text,{size:16,weight:600,as:"h3",color:"#23282d"},s)),Object(r.createElement)(c.CardBody,{size:null},Object(r.createElement)(i.EmptyTable,null,Object(o.__)("No data recorded for the selected time period.",'woocommerce'))))}}_.propTypes={headers:n.a.arrayOf(n.a.shape({label:n.a.string})),id:n.a.string.isRequired,query:n.a.object,rows:n.a.arrayOf(n.a.arrayOf(n.a.shape({display:n.a.node,value:n.a.oneOfType([n.a.string,n.a.number,n.a.bool])}))).isRequired,title:n.a.string.isRequired,totalRows:n.a.number.isRequired},_.defaultProps={rows:[],isError:!1,isRequesting:!1};var h=Object(s.compose)(Object(d.withSelect)((e,t)=>{const{id:a,query:r,totalRows:o,filters:s}=t,{woocommerce_default_date_range:l}=e(m.SETTINGS_STORE_NAME).getSetting("wc_admin","wcAdminSettings"),n=Object(m.getFilterQuery)({filters:s,query:r}),c={id:a,per_page:o,persisted_query:Object(g.getPersistedQuery)(r),query:r,select:e,defaultDateRange:l,filterQuery:n};return Object(m.getLeaderboard)(c)}))(_);a(602);const j=e=>{const{allLeaderboards:t,controls:a,isFirst:s,isLast:l,hiddenBlocks:n,onMove:d,onRemove:b,onTitleBlur:g,onTitleChange:p,onToggleHiddenBlock:w,query:O,title:_,titleInput:j,filters:E}=e,{updateUserPreferences:y,...f}=Object(m.useUserPreferences)(),[T,R]=Object(r.useState)(parseInt(f.dashboard_leaderboard_rows||5,10)),k=e=>{R(parseInt(e,10));const t={dashboard_leaderboard_rows:parseInt(e,10)};y(t)};return Object(r.createElement)(r.Fragment,null,Object(r.createElement)("div",{className:"woocommerce-dashboard__dashboard-leaderboards"},Object(r.createElement)(i.SectionHeader,{title:_||Object(o.__)("Leaderboards",'woocommerce'),menu:Object(r.createElement)(i.EllipsisMenu,{label:Object(o.__)("Choose which leaderboards to display and other settings",'woocommerce'),renderContent:({onToggle:e})=>Object(r.createElement)(r.Fragment,null,Object(r.createElement)(i.MenuTitle,null,Object(o.__)("Leaderboards",'woocommerce')),(({allLeaderboards:e,hiddenBlocks:t,onToggleHiddenBlock:a})=>e.map(e=>{const o=!t.includes(e.id);return Object(r.createElement)(i.MenuItem,{checked:o,isCheckbox:!0,isClickable:!0,key:e.id,onInvoke:()=>{a(e.id)(),Object(u.recordEvent)("dash_leaderboards_toggle",{status:o?"off":"on",key:e.id})}},e.label)}))({allLeaderboards:t,hiddenBlocks:n,onToggleHiddenBlock:w}),Object(r.createElement)(c.SelectControl,{className:"woocommerce-dashboard__dashboard-leaderboards__select",label:Object(o.__)("Rows per table",'woocommerce'),value:T,options:Array.from({length:20},(e,t)=>({v:t+1,label:t+1})),onChange:k}),Object(r.createElement)(a,{onToggle:e,onMove:d,onRemove:b,isFirst:s,isLast:l,onTitleBlur:g,onTitleChange:p,titleInput:j}))})}),Object(r.createElement)("div",{className:"woocommerce-dashboard__columns"},(({allLeaderboards:e,hiddenBlocks:t,query:a,rowsPerTable:o,filters:s})=>e.map(e=>{if(!t.includes(e.id))return Object(r.createElement)(h,{headers:e.headers,id:e.id,key:e.id,query:a,title:e.label,totalRows:o,filters:s})}))({allLeaderboards:t,hiddenBlocks:n,query:O,rowsPerTable:T,filters:E}))))};j.propTypes={query:n.a.object.isRequired};t.default=Object(s.compose)(Object(d.withSelect)(e=>{const{getItems:t,getItemsError:a}=e(m.ITEMS_STORE_NAME),{leaderboards:r}=Object(b.f)("dataEndpoints",{leaderboards:[]});return{allLeaderboards:r,getItems:t,getItemsError:a}}))(j)}}]);woocommerce-admin/dist/chunks/1.js.LICENSE.txt000064400000000266151335517650015023 0ustar00/*! @license DOMPurify | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/2.2.2/LICENSE */
woocommerce-admin/dist/chunks/3.js000064400000547561151335517650013144 0ustar00(window.__wcAdmin_webpackJsonp=window.__wcAdmin_webpackJsonp||[]).push([[3,53],{271:function(C,e,H){"use strict";H.r(e),H.d(e,"WCPayCardHeader",(function(){return f})),H.d(e,"WCPayCardBody",(function(){return O})),H.d(e,"WCPayCardFooter",(function(){return j})),H.d(e,"WCPayCard",(function(){return M})),H.d(e,"RecommendedRibbon",(function(){return E})),H.d(e,"SetupRequired",(function(){return v})),H.d(e,"WCPayAcceptedMethods",(function(){return b})),H.d(e,"Visa",(function(){return i})),H.d(e,"MasterCard",(function(){return o})),H.d(e,"Amex",(function(){return r})),H.d(e,"ApplePay",(function(){return d})),H.d(e,"GooglePay",(function(){return g})),H.d(e,"WCPayLogo",(function(){return h})),H.d(e,"WooPaymentGatewaySetup",(function(){return R})),H.d(e,"WooPaymentGatewayConfigure",(function(){return _})),H.d(e,"WooOnboardingTask",(function(){return y})),H.d(e,"WooOnboardingTaskListItem",(function(){return k}));var L=H(3),t=H(20),l=H(0),n=H(21),c=H(2),i=()=>Object(l.createElement)("svg",{width:"51",height:"35",viewBox:"0 0 51 35",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Object(l.createElement)("rect",{x:"0.5",y:"0.5",width:"50",height:"34",rx:"3.5",fill:"white",stroke:"#F3F3F3"}),Object(l.createElement)("path",{d:"M22.6435 24.004H19.248L21.3718 11.7534H24.7671L22.6435 24.004Z",fill:"#15195A"}),Object(l.createElement)("path",{d:"M34.952 12.0528C34.2823 11.8049 33.22 11.5312 31.9066 11.5312C28.5534 11.5312 26.1922 13.1993 26.1777 15.5842C26.1499 17.3437 27.8683 18.321 29.1536 18.9077C30.4672 19.5072 30.9138 19.8985 30.9138 20.4329C30.9004 21.2536 29.8522 21.6319 28.8747 21.6319C27.5191 21.6319 26.7927 21.4369 25.6889 20.9803L25.2417 20.7845L24.7666 23.5345C25.563 23.873 27.0302 24.1733 28.5534 24.1865C32.1162 24.1865 34.4356 22.5442 34.4631 20.0028C34.4767 18.6082 33.5693 17.5396 31.613 16.6665C30.4254 16.1059 29.6981 15.728 29.6981 15.1544C29.7121 14.6331 30.3133 14.099 31.6539 14.099C32.7577 14.0729 33.5687 14.3204 34.1831 14.5681L34.4902 14.6982L34.952 12.0528Z",fill:"#15195A"}),Object(l.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M41.0301 11.7534H43.6565L46.3957 24.0039H43.2519C43.2519 24.0039 42.9442 22.5963 42.8467 22.1662H38.4873C38.3612 22.4919 37.7747 24.0039 37.7747 24.0039H34.2119L39.2554 12.7699C39.6049 11.9748 40.2202 11.7534 41.0301 11.7534ZM40.8208 16.2365C40.8208 16.2365 39.7448 18.9603 39.4652 19.6641H42.2875C42.1478 19.0516 41.5048 16.1192 41.5048 16.1192L41.2676 15.0636C41.1676 15.3355 41.0231 15.7092 40.9256 15.9612C40.8596 16.1321 40.8151 16.2471 40.8208 16.2365Z",fill:"#15195A"}),Object(l.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M4.53636 11.7534H9.99929C10.7398 11.7792 11.3406 12.0008 11.5361 12.7832L12.7233 18.4113C12.7234 18.4118 12.7236 18.4124 12.7238 18.4129L13.0871 20.1072L16.4124 11.7534H20.0028L14.6657 23.991H11.0752L8.04881 13.3464C7.00461 12.7769 5.81289 12.3188 4.48047 12.0009L4.53636 11.7534Z",fill:"#15195A"})),o=()=>Object(l.createElement)("svg",{width:"51",height:"35",viewBox:"0 0 51 35",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Object(l.createElement)("rect",{x:"0.5",y:"0.5",width:"50",height:"34",rx:"3.5",fill:"white",stroke:"#F3F3F3"}),Object(l.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M18.6846 27.0292V28.3215V29.6137H18.1154V29.2999C17.9349 29.5327 17.661 29.6787 17.2886 29.6787C16.5546 29.6787 15.9791 29.1112 15.9791 28.3215C15.9791 27.5324 16.5546 26.9642 17.2886 26.9642C17.661 26.9642 17.9349 27.1103 18.1154 27.343V27.0292H18.6846ZM17.3594 27.494C16.8667 27.494 16.5652 27.8672 16.5652 28.3215C16.5652 28.7757 16.8667 29.1489 17.3594 29.1489C17.8302 29.1489 18.148 28.7918 18.148 28.3215C18.148 27.8511 17.8302 27.494 17.3594 27.494ZM37.9186 28.3215C37.9186 27.8672 38.2201 27.494 38.7128 27.494C39.1842 27.494 39.5014 27.8511 39.5014 28.3215C39.5014 28.7918 39.1842 29.1489 38.7128 29.1489C38.2201 29.1489 37.9186 28.7757 37.9186 28.3215ZM40.0386 25.9913V28.3215V29.6137H39.4688V29.2999C39.2882 29.5327 39.0143 29.6787 38.642 29.6787C37.9079 29.6787 37.3325 29.1112 37.3325 28.3215C37.3325 27.5324 37.9079 26.9642 38.642 26.9642C39.0143 26.9642 39.2882 27.1103 39.4688 27.343V25.9913H40.0386ZM25.7496 27.4674C26.1163 27.4674 26.352 27.6945 26.4122 28.0943H25.0538C25.1146 27.7211 25.3441 27.4674 25.7496 27.4674ZM24.4571 28.3215C24.4571 27.5157 24.9937 26.9642 25.7609 26.9642C26.4943 26.9642 26.9983 27.5157 27.0039 28.3215C27.0039 28.397 26.9983 28.4675 26.9926 28.5375L25.0488 28.5375C25.1309 29.0029 25.465 29.1706 25.8317 29.1706C26.0944 29.1706 26.374 29.0728 26.5933 28.9001L26.8723 29.3167C26.5545 29.5815 26.1934 29.6787 25.7991 29.6787C25.0156 29.6787 24.4571 29.1434 24.4571 28.3215ZM32.6337 28.3215C32.6337 27.8672 32.9353 27.494 33.4279 27.494C33.8987 27.494 34.2165 27.8511 34.2165 28.3215C34.2165 28.7918 33.8987 29.1489 33.4279 29.1489C32.9353 29.1489 32.6337 28.7757 32.6337 28.3215ZM34.7529 27.0292V28.3215V29.6137H34.1837V29.2999C34.0026 29.5327 33.7293 29.6787 33.3569 29.6787C32.6229 29.6787 32.0475 29.1112 32.0475 28.3215C32.0475 27.5324 32.6229 26.9642 33.3569 26.9642C33.7293 26.9642 34.0026 27.1103 34.1837 27.343V27.0292H34.7529ZM29.4191 28.3215C29.4191 29.1056 29.972 29.6787 30.8157 29.6787C31.21 29.6787 31.4726 29.5921 31.7572 29.3705L31.4839 28.9162C31.2701 29.0679 31.0457 29.1489 30.7988 29.1489C30.3443 29.1434 30.0102 28.8191 30.0102 28.3215C30.0102 27.8239 30.3443 27.4996 30.7988 27.494C31.0457 27.494 31.2701 27.5751 31.4839 27.7267L31.7572 27.2724C31.4726 27.0509 31.21 26.9642 30.8157 26.9642C29.972 26.9642 29.4191 27.5373 29.4191 28.3215ZM36.0674 27.3431C36.2153 27.1159 36.4291 26.9643 36.7575 26.9643C36.8729 26.9643 37.0371 26.986 37.1631 27.0349L36.9876 27.5646C36.8672 27.5157 36.7469 27.4997 36.6315 27.4997C36.2592 27.4997 36.073 27.7373 36.073 28.165V29.6138H35.5032V27.0293H36.0674V27.3431ZM21.4996 27.2347C21.2257 27.0564 20.8483 26.9642 20.4321 26.9642C19.7689 26.9642 19.342 27.278 19.342 27.7917C19.342 28.2132 19.6599 28.4731 20.2453 28.5542L20.5142 28.5919C20.8264 28.6352 20.9737 28.7163 20.9737 28.8624C20.9737 29.0623 20.7656 29.1762 20.377 29.1762C19.9827 29.1762 19.6981 29.0518 19.5063 28.9057L19.238 29.3433C19.5502 29.5704 19.9444 29.6787 20.3713 29.6787C21.1273 29.6787 21.5654 29.3272 21.5654 28.8352C21.5654 28.3809 21.2207 28.1432 20.6509 28.0621L20.3826 28.0238C20.1363 27.9916 19.9388 27.9433 19.9388 27.77C19.9388 27.5806 20.125 27.4674 20.4371 27.4674C20.7712 27.4674 21.0947 27.5918 21.2533 27.689L21.4996 27.2347ZM28.1542 27.3431C28.3015 27.1159 28.5152 26.9643 28.8437 26.9643C28.959 26.9643 29.1233 26.986 29.2493 27.0349L29.0738 27.5646C28.9534 27.5157 28.833 27.4997 28.7177 27.4997C28.3454 27.4997 28.1592 27.7373 28.1592 28.165V29.6138H27.59V27.0293L28.1542 27.0293V27.3431ZM23.9862 27.0292H23.0553V26.2451H22.4799V27.0292H21.949V27.5429H22.4799V28.7219C22.4799 29.3216 22.7156 29.6787 23.3888 29.6787C23.6358 29.6787 23.9204 29.6032 24.1009 29.4788L23.9367 28.9973C23.7668 29.0945 23.5806 29.1434 23.4327 29.1434C23.1481 29.1434 23.0553 28.9701 23.0553 28.7108V27.5429H23.9862V27.0292ZM15.4758 27.9917V29.6138H14.9003V28.1755C14.9003 27.7373 14.7142 27.4941 14.3255 27.4941C13.9475 27.4941 13.6849 27.7324 13.6849 28.1811V29.6138H13.1095V28.1755C13.1095 27.7373 12.9183 27.4941 12.5403 27.4941C12.151 27.4941 11.899 27.7324 11.899 28.1811V29.6138H11.3242V27.0293H11.894V27.348C12.1078 27.0454 12.3811 26.9643 12.6606 26.9643C13.0606 26.9643 13.3451 27.1376 13.5257 27.4242C13.767 27.0615 14.1118 26.9587 14.4459 26.9643C15.0815 26.9699 15.4758 27.3808 15.4758 27.9917Z",fill:"#231F20"}),Object(l.createElement)("path",{d:"M29.9381 22.6376H21.3115V7.33105H29.9381V22.6376Z",fill:"#FF5F00"}),Object(l.createElement)("path",{d:"M21.8586 14.9846C21.8586 11.8796 23.331 9.11372 25.624 7.33129C23.9472 6.02789 21.831 5.24994 19.5311 5.24994C14.0864 5.24994 9.67285 9.60822 9.67285 14.9846C9.67285 20.361 14.0864 24.7192 19.5311 24.7192C21.831 24.7192 23.9472 23.9413 25.624 22.6379C23.331 20.8555 21.8586 18.0896 21.8586 14.9846Z",fill:"#EB001B"}),Object(l.createElement)("path",{d:"M41.5758 14.9846C41.5758 20.361 37.1622 24.7192 31.7175 24.7192C29.4177 24.7192 27.3014 23.9413 25.624 22.6379C27.9176 20.8555 29.3901 18.0896 29.3901 14.9846C29.3901 11.8796 27.9176 9.11372 25.624 7.33129C27.3014 6.02789 29.4177 5.24994 31.7175 5.24994C37.1622 5.24994 41.5758 9.60822 41.5758 14.9846Z",fill:"#F79E1B"})),a=()=>Object(l.createElement)("svg",{width:"51",height:"35",viewBox:"0 0 51 35",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Object(l.createElement)("rect",{x:"0.5",y:"0.5",width:"49.6897",height:"34",rx:"3.5",fill:"white",stroke:"#F3F3F3"}),Object(l.createElement)("path",{d:"M29.9708 22.8244H21.3047V7.35352H29.9708V22.8244Z",fill:"#6C6BBD"}),Object(l.createElement)("path",{d:"M21.8549 15.0891C21.8549 11.9507 23.3341 9.15521 25.6375 7.35365C23.9531 6.03626 21.8272 5.24995 19.5168 5.24995C14.0471 5.24995 9.61328 9.65501 9.61328 15.0891C9.61328 20.5232 14.0471 24.9282 19.5168 24.9282C21.8272 24.9282 23.9531 24.1419 25.6375 22.8245C23.3341 21.023 21.8549 18.2274 21.8549 15.0891Z",fill:"#EB001B"}),Object(l.createElement)("path",{d:"M41.6626 15.0891C41.6626 20.5232 37.2288 24.9282 31.7591 24.9282C29.4487 24.9282 27.3228 24.1419 25.6377 22.8245C27.9418 21.023 29.421 18.2274 29.421 15.0891C29.421 11.9507 27.9418 9.15521 25.6377 7.35365C27.3228 6.03626 29.4487 5.24995 31.7591 5.24995C37.2288 5.24995 41.6626 9.65501 41.6626 15.0891Z",fill:"#0099DF"}),Object(l.createElement)("path",{d:"M32.9036 27.1956C33.0188 27.1956 33.1845 27.2175 33.311 27.2669L33.1347 27.8024C33.0138 27.753 32.8929 27.7367 32.777 27.7367C32.403 27.7367 32.216 27.9769 32.216 28.4085V29.8735H31.6436V27.2613H32.2103V27.5784C32.3589 27.3489 32.5736 27.1956 32.9036 27.1956Z",fill:"#231F20"}),Object(l.createElement)("path",{d:"M30.7887 27.7807H29.8536V28.9611C29.8536 29.2232 29.9468 29.3984 30.2333 29.3984C30.382 29.3984 30.569 29.3489 30.739 29.2507L30.904 29.7368C30.7226 29.8625 30.4367 29.9395 30.1893 29.9395C29.5123 29.9395 29.2762 29.5785 29.2762 28.9717V27.7807H28.7422V27.2615H29.2762V26.469H29.8536V27.2615H30.7887V27.7807Z",fill:"#231F20"}),Object(l.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M24.1754 27.1958C24.9128 27.1958 25.4191 27.7532 25.4247 28.5676C25.4247 28.6433 25.4192 28.7135 25.4135 28.7842L25.4134 28.7859H23.4607C23.5432 29.2557 23.8788 29.4252 24.2472 29.4252C24.511 29.4252 24.7919 29.327 25.0116 29.1519L25.2925 29.5729C24.9732 29.8406 24.6105 29.9388 24.2144 29.9388C23.4273 29.9388 22.8662 29.3977 22.8662 28.5676C22.8662 27.7532 23.4052 27.1958 24.1754 27.1958ZM24.1648 27.7036C23.7574 27.7036 23.5269 27.9607 23.4658 28.3379H24.8304C24.77 27.9332 24.5332 27.7036 24.1648 27.7036Z",fill:"#231F20"}),Object(l.createElement)("path",{d:"M27.9386 27.9283C27.7793 27.8295 27.455 27.7038 27.1193 27.7038C26.8057 27.7038 26.6187 27.8189 26.6187 28.0103C26.6187 28.1848 26.8164 28.2342 27.0639 28.2668L27.3334 28.3049C27.9058 28.3875 28.2522 28.6277 28.2522 29.0868C28.2522 29.5841 27.812 29.9395 27.0532 29.9395C26.6237 29.9395 26.2277 29.83 25.9141 29.6004L26.1836 29.1575C26.3763 29.3052 26.6628 29.4309 27.0589 29.4309C27.4493 29.4309 27.6584 29.3164 27.6584 29.1137C27.6584 28.9667 27.5098 28.8842 27.1962 28.841L26.9266 28.8028C26.3379 28.7203 26.0186 28.4582 26.0186 28.0322C26.0186 27.513 26.4481 27.1958 27.1137 27.1958C27.5318 27.1958 27.9115 27.289 28.1861 27.4692L27.9386 27.9283Z",fill:"#231F20"}),Object(l.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M35.561 27.3015C35.3872 27.2308 35.1982 27.1958 34.9942 27.1958C34.7902 27.1958 34.6013 27.2308 34.4275 27.3015C34.2537 27.3716 34.1044 27.4685 33.9785 27.5918C33.8526 27.715 33.7537 27.8608 33.6819 28.0284C33.6101 28.1967 33.5742 28.3793 33.5742 28.5764C33.5742 28.7734 33.6101 28.9561 33.6819 29.1243C33.7537 29.292 33.8526 29.4384 33.9785 29.5616C34.1044 29.6848 34.2537 29.7812 34.4275 29.8519C34.6013 29.9219 34.7902 29.9569 34.9942 29.9569C35.1982 29.9569 35.3872 29.9219 35.561 29.8519C35.7348 29.7812 35.8853 29.6848 36.0118 29.5616C36.139 29.4384 36.2379 29.292 36.3097 29.1243C36.3815 28.9561 36.4174 28.7734 36.4174 28.5764C36.4174 28.3793 36.3815 28.1967 36.3097 28.0284C36.2379 27.8608 36.139 27.715 36.0118 27.5918C35.8853 27.4685 35.7348 27.3716 35.561 27.3015ZM34.666 27.7969C34.7674 27.7563 34.8763 27.7356 34.9941 27.7356C35.1118 27.7356 35.2214 27.7563 35.3221 27.7969C35.4235 27.8382 35.5117 27.8958 35.5854 27.9696C35.6603 28.0434 35.7182 28.1322 35.761 28.2354C35.8032 28.3386 35.824 28.4525 35.824 28.5763C35.824 28.7008 35.8032 28.8141 35.761 28.9173C35.7182 29.0205 35.6603 29.1093 35.5854 29.1831C35.5117 29.2569 35.4235 29.3145 35.3221 29.3558C35.2214 29.3971 35.1118 29.4171 34.9941 29.4171C34.8763 29.4171 34.7674 29.3971 34.666 29.3558C34.5652 29.3145 34.4777 29.2569 34.404 29.1831C34.3303 29.1093 34.2724 29.0205 34.2302 28.9173C34.188 28.8141 34.1672 28.7008 34.1672 28.5763C34.1672 28.4525 34.188 28.3386 34.2302 28.2354C34.2724 28.1322 34.3303 28.0434 34.404 27.9696C34.4777 27.8958 34.5652 27.8382 34.666 27.7969Z",fill:"#231F20"}),Object(l.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M22.2524 27.2615V28.5676V29.8737H21.6806V29.5566C21.4986 29.7918 21.224 29.9394 20.85 29.9394C20.1126 29.9394 19.5352 29.3652 19.5352 28.5676C19.5352 27.7694 20.1126 27.1958 20.85 27.1958C21.224 27.1958 21.4986 27.3434 21.6806 27.5786V27.2615H22.2524ZM20.9211 27.7312C20.4262 27.7312 20.1233 28.1084 20.1233 28.5675C20.1233 29.0267 20.4262 29.4033 20.9211 29.4033C21.394 29.4033 21.7133 29.0429 21.7133 28.5675C21.7133 28.0921 21.394 27.7312 20.9211 27.7312Z",fill:"#231F20"}),Object(l.createElement)("path",{d:"M19.0293 29.8735V28.234C19.0293 27.6166 18.6332 27.2012 17.9953 27.1956C17.6597 27.19 17.3127 27.2938 17.0709 27.6604C16.8896 27.3707 16.603 27.1956 16.2013 27.1956C15.9211 27.1956 15.6459 27.2775 15.4312 27.5834V27.2613H14.8594V29.8735H15.4368V28.4254C15.4368 27.9719 15.69 27.7311 16.0804 27.7311C16.4601 27.7311 16.6528 27.9769 16.6528 28.4198V29.8735H17.2302V28.4254C17.2302 27.9719 17.4947 27.7311 17.8738 27.7311C18.2649 27.7311 18.4519 27.9769 18.4519 28.4198V29.8735H19.0293V29.8735Z",fill:"#231F20"})),r=()=>Object(l.createElement)("svg",{width:"52",height:"35",viewBox:"0 0 52 35",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Object(l.createElement)("rect",{x:"1.18945",y:"0.5",width:"50",height:"34",rx:"3.5",fill:"#006FCF",stroke:"#F3F3F3"}),Object(l.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11.1205 25.2823V18.0771H19.3189L20.1985 19.1441L21.1072 18.0771H50.8653V24.7854C50.8653 24.7854 50.0871 25.2751 49.187 25.2823H32.7093L31.7176 24.1465V25.2823H28.4679V23.3435C28.4679 23.3435 28.0239 23.6141 27.0642 23.6141H25.9581V25.2823H21.0376L20.1593 24.1924L19.2675 25.2823H11.1205ZM1.56836 12.6465L3.41294 8.63574H6.60294L7.64976 10.8824V8.63574H11.6152L12.2384 10.2596L12.8425 8.63574H30.6434V9.4521C30.6434 9.4521 31.5792 8.63574 33.1171 8.63574L38.8928 8.65457L39.9215 10.8718V8.63574H43.24L44.1534 9.90939V8.63574H47.5023V15.841H44.1534L43.2781 14.5632V15.841H38.4025L37.9121 14.7052H36.6014L36.1191 15.841H32.8126C31.4893 15.841 30.6434 15.0413 30.6434 15.0413V15.841H25.658L24.6685 14.7052V15.841H6.13036L5.64039 14.7052H4.33383L3.84732 15.841H1.56836V12.6465ZM1.5779 14.9189L4.06583 9.52391H5.95199L8.43755 14.9189H6.7821L6.32542 13.8386H3.65672L3.19767 14.9189H1.5779ZM5.79982 12.6674L4.98636 10.7795L4.17053 12.6674H5.79982ZM8.60869 14.9182V9.52317L10.9105 9.53115L12.2493 13.0095L13.556 9.52317H15.8394V14.9182H14.3933V10.9429L12.8603 14.9182H11.592L10.0548 10.9429V14.9182H8.60869ZM16.8289 14.9182V9.52317H21.5479V10.73H18.2902V11.6528H21.4717V12.7886H18.2902V13.7469H21.5479V14.9182H16.8289ZM22.3851 14.9189V9.52391H25.6033C26.6696 9.52391 27.625 10.1389 27.625 11.2742C27.625 12.2447 26.8195 12.8698 26.0385 12.9313L27.9413 14.9189H26.1741L24.4402 13.0023H23.8313V14.9189H22.3851ZM25.4843 10.7306H23.8313V11.8664H25.5057C25.7956 11.8664 26.1694 11.6569 26.1694 11.2985C26.1694 11.0199 25.8809 10.7306 25.4843 10.7306ZM29.692 14.9182H28.2154V9.52317H29.692V14.9182ZM33.1931 14.9182H32.8744C31.3323 14.9182 30.396 13.7851 30.396 12.2429C30.396 10.6626 31.3218 9.52317 33.2692 9.52317H34.8676V10.8009H33.2108C32.4202 10.8009 31.8611 11.3763 31.8611 12.2562C31.8611 13.301 32.5004 13.7398 33.4215 13.7398H33.802L33.1931 14.9182ZM33.8521 14.9189L36.34 9.52391H38.2262L40.7117 14.9189H39.0563L38.5996 13.8386H35.9309L35.4719 14.9189H33.8521ZM38.074 12.6674L37.2605 10.7795L36.4447 12.6674H38.074ZM40.8805 14.9182V9.52317H42.7191L45.0667 12.9128V9.52317H46.5128V14.9182H44.7337L42.3267 11.4398V14.9182H40.8805ZM12.1099 24.3594V18.9643H16.8289V20.1711H13.5713V21.0939H16.7528V22.2297H13.5713V23.1881H16.8289V24.3594H12.1099ZM35.2329 24.3594V18.9643H39.9519V20.1711H36.6943V21.0939H39.8606V22.2297H36.6943V23.1881H39.9519V24.3594H35.2329ZM17.0121 24.3594L19.3097 21.6951L16.9574 18.9643H18.7793L20.1803 20.6525L21.586 18.9643H23.3366L21.0151 21.6618L23.317 24.3594H21.4953L20.1351 22.6978L18.8079 24.3594H17.0121ZM23.4887 24.3603V18.9653H26.6831C27.9938 18.9653 28.7595 19.7531 28.7595 20.7799C28.7595 22.0193 27.7832 22.6566 26.4952 22.6566H24.9729V24.3603H23.4887ZM26.5761 20.1853H24.973V21.4276H26.5714C26.9937 21.4276 27.2897 21.1665 27.2897 20.8064C27.2897 20.4232 26.9922 20.1853 26.5761 20.1853ZM29.3875 24.3594V18.9643H32.6056C33.672 18.9643 34.6274 19.5793 34.6274 20.7146C34.6274 21.6851 33.8218 22.3102 33.0409 22.3717L34.9437 24.3594H33.1765L31.4426 22.4427H30.8337V24.3594H29.3875ZM32.4867 20.171H30.8337V21.3068H32.5082C32.798 21.3068 33.1718 21.0974 33.1718 20.7389C33.1718 20.4603 32.8833 20.171 32.4867 20.171ZM40.6217 24.3594V23.1881H43.5159C43.9441 23.1881 44.1295 22.9722 44.1295 22.7355C44.1295 22.5087 43.9447 22.2794 43.5159 22.2794H42.208C41.0712 22.2794 40.4381 21.6334 40.4381 20.6636C40.4381 19.7985 41.0178 18.9643 42.7072 18.9643H45.5233L44.9144 20.1782H42.4788C42.0132 20.1782 41.8699 20.4061 41.8699 20.6237C41.8699 20.8473 42.047 21.0939 42.4027 21.0939H43.7727C45.04 21.0939 45.5899 21.7644 45.5899 22.6424C45.5899 23.5863 44.9772 24.3594 43.7038 24.3594H40.6217ZM45.7176 24.3594V23.1881H48.6118C49.04 23.1881 49.2254 22.9722 49.2254 22.7355C49.2254 22.5087 49.0406 22.2794 48.6118 22.2794H47.3039C46.1671 22.2794 45.534 21.6334 45.534 20.6636C45.534 19.7985 46.1138 18.9643 47.8031 18.9643H50.6192L50.0103 20.1782H47.5747C47.1092 20.1782 46.9658 20.4061 46.9658 20.6237C46.9658 20.8473 47.1429 21.0939 47.4986 21.0939H48.8687C50.1359 21.0939 50.6858 21.7644 50.6858 22.6424C50.6858 23.5863 50.0731 24.3594 48.7997 24.3594H45.7176Z",fill:"white"})),d=()=>Object(l.createElement)("svg",{width:"52",height:"35",viewBox:"0 0 52 35",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Object(l.createElement)("rect",{x:"0.878906",y:"0.5",width:"50",height:"34",rx:"3.5",fill:"white",stroke:"#F3F3F3"}),Object(l.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M15.8352 13.0607C15.4642 13.5024 14.8707 13.8507 14.2771 13.8009C14.2029 13.2038 14.4935 12.5693 14.8336 12.1774C15.2045 11.7233 15.8537 11.3999 16.3792 11.375C16.4411 11.997 16.1999 12.6066 15.8352 13.0607ZM16.373 13.9192C15.8501 13.8889 15.373 14.0774 14.9876 14.2297C14.7396 14.3277 14.5296 14.4106 14.3698 14.4106C14.1905 14.4106 13.9718 14.3232 13.7263 14.2251C13.4046 14.0965 13.0367 13.9495 12.651 13.9565C11.7669 13.969 10.9446 14.4728 10.4933 15.2753C9.56588 16.8801 10.2522 19.2563 11.1486 20.5626C11.5876 21.2095 12.1131 21.9186 12.8056 21.8937C13.1102 21.8822 13.3294 21.7886 13.5562 21.6918C13.8173 21.5803 14.0885 21.4645 14.512 21.4645C14.9208 21.4645 15.1802 21.5773 15.4292 21.6856C15.6659 21.7885 15.8933 21.8874 16.2308 21.8813C16.948 21.8689 17.3993 21.2344 17.8383 20.5875C18.312 19.8931 18.5202 19.2155 18.5518 19.1127L18.5555 19.1008C18.5547 19.1 18.5488 19.0973 18.5385 19.0926C18.3802 19.0196 17.1698 18.4621 17.1582 16.9672C17.1465 15.7124 18.1182 15.0767 18.2712 14.9766L18.2712 14.9766C18.2805 14.9705 18.2868 14.9664 18.2896 14.9642C17.6713 14.0436 16.7068 13.9441 16.373 13.9192ZM21.3377 21.8128V12.1153H24.9546C26.8217 12.1153 28.1263 13.4091 28.1263 15.3001C28.1263 17.1911 26.797 18.4974 24.9051 18.4974H22.8339V21.8128H21.3377ZM22.8339 13.3841H24.5589C25.8572 13.3841 26.5991 14.0808 26.5991 15.3062C26.5991 16.5317 25.8572 17.2346 24.5527 17.2346H22.8339V13.3841ZM33.0661 20.6496C32.6704 21.4085 31.7986 21.8874 30.8589 21.8874C29.4678 21.8874 28.4971 21.0539 28.4971 19.7974C28.4971 18.5533 29.4368 17.838 31.1742 17.7322L33.0413 17.6203V17.0853C33.0413 16.2953 32.5282 15.8661 31.6131 15.8661C30.8589 15.8661 30.3086 16.258 30.1973 16.8552H28.8495C28.8928 15.5986 30.0675 14.6842 31.6564 14.6842C33.369 14.6842 34.4819 15.5862 34.4819 16.9858V21.8128H33.097V20.6496H33.0661ZM31.2609 20.7368C30.4633 20.7368 29.9563 20.3511 29.9563 19.7602C29.9563 19.1506 30.4448 18.796 31.3784 18.74L33.0415 18.6343V19.1817C33.0415 20.0898 32.2748 20.7368 31.2609 20.7368ZM39.0756 22.1922C38.4759 23.8903 37.7897 24.4502 36.3306 24.4502C36.2193 24.4502 35.8483 24.4377 35.7617 24.4129V23.2496C35.8545 23.2621 36.0832 23.2745 36.2007 23.2745C36.8623 23.2745 37.2332 22.9946 37.462 22.2668L37.598 21.8376L35.0631 14.7775H36.6273L38.3894 20.5065H38.4203L40.1823 14.7775H41.7033L39.0756 22.1922Z",fill:"black"})),V=()=>Object(l.createElement)("svg",{width:"52",height:"35",viewBox:"0 0 52 35",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Object(l.createElement)("rect",{x:"1.18945",y:"0.5",width:"49.6897",height:"34",rx:"2.5",fill:"url(#paint0_linear)",stroke:"#F1F1F1"}),Object(l.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M19.7636 16.9816H26.6269C26.5657 15.4963 26.2201 13.9649 25.1717 12.9813C23.9229 11.8096 21.7355 11.375 19.781 11.375C17.7466 11.375 15.4968 11.8517 14.2414 13.1088C13.1588 14.1918 12.9248 15.9341 12.9248 17.4997C12.9248 19.1395 13.3827 21.0469 14.5571 22.1456C15.8059 23.3147 17.8294 23.625 19.781 23.625C21.6767 23.625 23.7302 23.2746 24.9718 22.1647C26.2099 21.0561 26.6377 19.1888 26.6377 17.4997V17.4918H19.7636V16.9816ZM27.0876 17.4921V23.3511H36.6352V23.3432C38.0322 23.267 39.1436 22.0059 39.1436 20.4575C39.1436 18.9084 38.0322 17.5664 36.6352 17.4895V17.4921H27.0876ZM36.5263 11.6203C37.8879 11.6203 38.9687 12.8032 38.9687 14.2957C38.9687 15.7087 37.9762 16.8626 36.7135 16.9816H27.0873V11.6118H36.2251C36.2813 11.6049 36.3468 11.6097 36.4108 11.6144C36.4508 11.6174 36.4901 11.6203 36.5263 11.6203Z",fill:"#FEFEFE"}),Object(l.createElement)("defs",null,Object(l.createElement)("linearGradient",{id:"paint0_linear",x1:"14.4385",y1:"-4.43215",x2:"2.09335",y2:"33.4202",gradientUnits:"userSpaceOnUse"},Object(l.createElement)("stop",{stopColor:"#222E72"}),Object(l.createElement)("stop",{offset:"0.591647",stopColor:"#40CBFF"}),Object(l.createElement)("stop",{offset:"1",stopColor:"#3CB792"})))),m=()=>Object(l.createElement)("svg",{width:"51",height:"35",viewBox:"0 0 51 35",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Object(l.createElement)("rect",{x:"1.18945",y:"0.5",width:"49",height:"34",rx:"3.5",fill:"white",stroke:"#F3F3F3"}),Object(l.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8.30356 21.1794C8.30356 20.493 7.95026 20.5381 7.6123 20.5309V20.3325C7.90535 20.347 8.20582 20.347 8.49964 20.347C8.8153 20.347 9.24386 20.3325 9.80068 20.3325C11.7479 20.3325 12.8085 21.6523 12.8085 23.0038C12.8085 23.7601 12.3724 25.6602 9.71022 25.6602C9.32704 25.6602 8.97313 25.6451 8.61983 25.6451C8.28172 25.6451 7.95026 25.6521 7.6123 25.6602V25.4616C8.06302 25.4154 8.28172 25.4004 8.30356 24.8815V21.1794ZM9.04049 24.759C9.04049 25.3469 9.4545 25.4153 9.82282 25.4153C11.4476 25.4153 11.9807 24.1715 11.9807 23.0344C11.9807 21.6071 11.0785 20.5769 9.62735 20.5769C9.31835 20.5769 9.17617 20.5992 9.04049 20.6074V24.759Z",fill:"#1A1919"}),Object(l.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M13.0713 25.4613H13.2138C13.4243 25.4613 13.5748 25.4613 13.5748 25.2088V23.1406C13.5748 22.8053 13.4622 22.7589 13.1836 22.6067V22.4849C13.537 22.377 13.9585 22.233 13.9882 22.2101C14.0412 22.1794 14.0856 22.1712 14.1239 22.1712C14.1608 22.1712 14.1762 22.2171 14.1762 22.2788V25.2088C14.1762 25.4613 14.342 25.4613 14.5528 25.4613H14.6801V25.6599C14.4244 25.6599 14.1608 25.6448 13.8909 25.6448C13.6202 25.6448 13.3493 25.6518 13.0713 25.6599V25.4613ZM13.8758 20.9962C13.6799 20.9962 13.5074 20.813 13.5074 20.6146C13.5074 20.4235 13.6881 20.2476 13.8758 20.2476C14.071 20.2476 14.2445 20.4084 14.2445 20.6146C14.2445 20.8211 14.0786 20.9962 13.8758 20.9962Z",fill:"#1A1919"}),Object(l.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M15.3957 23.1866C15.3957 22.9048 15.3126 22.8285 14.9598 22.6833V22.5383C15.2826 22.4316 15.5907 22.3319 15.952 22.1714C15.9748 22.1714 15.9966 22.1866 15.9966 22.2476V22.7439C16.426 22.4316 16.7944 22.1714 17.299 22.1714C17.9373 22.1714 18.1628 22.6447 18.1628 23.2401V25.209C18.1628 25.4614 18.3287 25.4614 18.5391 25.4614H18.6747V25.66C18.4107 25.66 18.1478 25.6449 17.8774 25.6449C17.6065 25.6449 17.3356 25.652 17.0649 25.66V25.4614H17.2005C17.4112 25.4614 17.561 25.4614 17.561 25.209V23.233C17.561 22.7974 17.299 22.5839 16.8699 22.5839C16.629 22.5839 16.2455 22.782 15.9966 22.9507V25.209C15.9966 25.4614 16.1628 25.4614 16.3735 25.4614H16.5085V25.66C16.2455 25.66 15.9822 25.6449 15.711 25.6449C15.4409 25.6449 15.1698 25.652 14.8994 25.66V25.4614H15.0351C15.2454 25.4614 15.3957 25.4614 15.3957 25.209V23.1866Z",fill:"#1A1919"}),Object(l.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M19.2463 23.5536C19.2309 23.6223 19.2309 23.7366 19.2463 23.9963C19.2906 24.7212 19.7503 25.3162 20.3512 25.3162C20.7654 25.3162 21.0889 25.0871 21.3666 24.8053L21.4716 24.9122C21.1256 25.3777 20.6972 25.7748 20.0811 25.7748C18.8851 25.7748 18.6445 24.5987 18.6445 24.1106C18.6445 22.6144 19.6369 22.1714 20.1627 22.1714C20.7725 22.1714 21.4272 22.5606 21.4342 23.3699C21.4342 23.4163 21.4342 23.4616 21.4272 23.5075L21.3592 23.5536H19.2463ZM20.5777 23.309C20.7653 23.309 20.7873 23.2097 20.7873 23.1177C20.7873 22.7291 20.5544 22.4161 20.1331 22.4161C19.6748 22.4161 19.3588 22.759 19.2687 23.309H20.5777Z",fill:"#1A1919"}),Object(l.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M21.6074 25.4614H21.8106C22.0203 25.4614 22.1709 25.4614 22.1709 25.209V23.0646C22.1709 22.8285 21.8929 22.782 21.78 22.721V22.6069C22.3289 22.3701 22.6298 22.1714 22.6986 22.1714C22.7426 22.1714 22.7652 22.1943 22.7652 22.2711V22.9581H22.781C22.9684 22.6605 23.2848 22.1714 23.7433 22.1714C23.9312 22.1714 24.1715 22.3011 24.1715 22.576C24.1715 22.782 24.0294 22.9661 23.8189 22.9661C23.585 22.9661 23.585 22.782 23.3215 22.782C23.1939 22.782 22.7728 22.9581 22.7728 23.4163V25.209C22.7728 25.4614 22.923 25.4614 23.1337 25.4614H23.5543V25.66C23.1408 25.652 22.8261 25.6449 22.5023 25.6449C22.194 25.6449 21.878 25.652 21.6074 25.66V25.4614Z",fill:"#1A1919"}),Object(l.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M24.5026 24.5985C24.6006 25.1022 24.9008 25.5303 25.4508 25.5303C25.8937 25.5303 26.059 25.2552 26.059 24.9882C26.059 24.0871 24.4202 24.3775 24.4202 23.1488C24.4202 22.7208 24.7587 22.1714 25.586 22.1714C25.8262 22.1714 26.1495 22.2406 26.4425 22.3934L26.4953 23.1712H26.3225C26.2473 22.6906 25.9845 22.416 25.5027 22.416C25.2019 22.416 24.9164 22.5913 24.9164 22.9195C24.9164 23.8131 26.6606 23.5378 26.6606 24.7362C26.6606 25.2396 26.2625 25.7746 25.3673 25.7746C25.0668 25.7746 24.7127 25.6675 24.4504 25.5149L24.3672 24.637L24.5026 24.5985Z",fill:"#1A1919"}),Object(l.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M33.4502 21.7134H33.2626C33.1195 20.8213 32.4953 20.4621 31.6537 20.4621C30.7879 20.4621 29.5325 21.0494 29.5325 22.8812C29.5325 24.4236 30.6158 25.5305 31.7736 25.5305C32.5173 25.5305 33.1353 25.0112 33.2854 24.2093L33.4584 24.2549L33.2854 25.3696C32.9696 25.5683 32.1196 25.7748 31.6227 25.7748C29.8638 25.7748 28.751 24.622 28.751 22.9048C28.751 21.3396 30.1271 20.2173 31.601 20.2173C32.2099 20.2173 32.7963 20.4163 33.3754 20.6226L33.4502 21.7134Z",fill:"#1A1919"}),Object(l.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M33.7217 25.461H33.864C34.0753 25.461 34.2254 25.461 34.2254 25.2086V20.9583C34.2254 20.4617 34.1128 20.4466 33.8267 20.3625V20.2402C34.1273 20.1411 34.4434 20.004 34.6017 19.9117C34.6834 19.8666 34.7441 19.8276 34.7662 19.8276C34.8122 19.8276 34.8271 19.874 34.8271 19.9353V25.2086C34.8271 25.461 34.9927 25.461 35.203 25.461H35.3303V25.6596C35.0754 25.6596 34.8122 25.6445 34.5413 25.6445C34.2707 25.6445 34.0003 25.6516 33.7217 25.6596V25.461Z",fill:"#1A1919"}),Object(l.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M38.5497 25.2394C38.5497 25.3773 38.632 25.3846 38.7594 25.3846C38.8502 25.3846 38.9625 25.3773 39.061 25.3773V25.538C38.7374 25.5682 38.1205 25.7285 37.9774 25.7744L37.9399 25.7512V25.1329C37.4892 25.5067 37.1429 25.7744 36.6082 25.7744C36.2023 25.7744 35.7815 25.5067 35.7815 24.8664V22.9118C35.7815 22.7131 35.7516 22.5223 35.3311 22.4847V22.3393C35.6019 22.3317 36.2023 22.2861 36.3003 22.2861C36.3838 22.2861 36.3838 22.3393 36.3838 22.5075V24.4765C36.3838 24.7057 36.3838 25.3614 37.0379 25.3614C37.2931 25.3614 37.6316 25.1635 37.9472 24.8967V22.843C37.9472 22.6905 37.5865 22.6065 37.3162 22.5306V22.3933C37.9923 22.3468 38.4139 22.2861 38.489 22.2861C38.5497 22.2861 38.5497 22.3393 38.5497 22.4235V25.2394Z",fill:"#1A1919"}),Object(l.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M40.0461 22.7206C40.3468 22.4617 40.753 22.171 41.1666 22.171C42.0391 22.171 42.5655 22.9427 42.5655 23.7745C42.5655 24.774 41.8433 25.7744 40.7674 25.7744C40.2116 25.7744 39.9182 25.5906 39.7223 25.5066L39.4974 25.6822L39.3397 25.5986C39.4069 25.1484 39.4449 24.7057 39.4449 24.2398V20.9583C39.4449 20.4617 39.3317 20.4466 39.0459 20.3625V20.2402C39.347 20.1411 39.6625 20.004 39.8203 19.9117C39.9033 19.8666 39.9633 19.8276 39.9862 19.8276C40.031 19.8276 40.0461 19.8742 40.0461 19.9353V22.7206ZM40.0461 24.7968C40.0461 25.0867 40.317 25.5756 40.8207 25.5756C41.6252 25.5756 41.9634 24.774 41.9634 24.0944C41.9634 23.2703 41.3475 22.5835 40.7611 22.5835C40.4816 22.5835 40.249 22.767 40.0461 22.9427V24.7968Z",fill:"#1A1919"}),Object(l.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11.6628 29.4042L11.671 29.3961V27.8391C11.671 27.4982 11.4374 27.4484 11.3148 27.4484H11.2246V27.3237C11.4173 27.3237 11.6055 27.3402 11.7976 27.3402C11.9653 27.3402 12.1338 27.3237 12.3009 27.3237V27.4484H12.2401C12.0677 27.4484 11.8753 27.4816 11.8753 27.9758V29.8655C11.8753 30.0111 11.8793 30.1563 11.8995 30.2852H11.744L9.63706 27.9008V29.6124C9.63706 29.974 9.7063 30.098 10.0213 30.098H10.091V30.2228C9.91508 30.2228 9.73929 30.2066 9.56334 30.2066C9.37964 30.2066 9.19115 30.2228 9.00684 30.2228V30.098H9.0643C9.3465 30.098 9.43246 29.9027 9.43246 29.5715V27.8216C9.43246 27.5893 9.24366 27.4484 9.06027 27.4484H9.00684V27.3237C9.16203 27.3237 9.32187 27.3402 9.47707 27.3402C9.6002 27.3402 9.71884 27.3237 9.84151 27.3237L11.6628 29.4042Z",fill:"#1A1919"}),Object(l.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11.899 30.3027L11.7305 30.2969L9.65398 27.9477V29.6124C9.65893 29.9735 9.71299 30.0761 10.0211 30.0801H10.1087V30.2406H10.0906C9.91356 30.2406 9.73746 30.2239 9.56291 30.2239C9.37968 30.2239 9.19165 30.2406 9.00625 30.2406H8.98828V30.0801H9.06387C9.33429 30.0785 9.41158 29.9021 9.41453 29.5714V27.8223C9.41375 27.6011 9.23501 27.4665 9.05999 27.4665H8.98828V27.3057H9.00625C9.16268 27.3057 9.32283 27.3219 9.47632 27.3219C9.59837 27.3219 9.71655 27.3057 9.85455 27.3121L11.6528 29.3667V27.8391C11.6508 27.5092 11.4336 27.4692 11.3145 27.4665H11.2062V27.3057H11.2244C11.4177 27.3057 11.606 27.3219 11.7971 27.3219C11.9636 27.3219 12.1314 27.3057 12.3005 27.3057H12.3185V27.4665H12.2396C12.0707 27.4709 11.8973 27.486 11.8924 27.9758V29.8655C11.8924 30.0109 11.8969 30.1559 11.9165 30.2819L11.9203 30.3027H11.899ZM11.7436 30.2666H11.879C11.8607 30.1416 11.8574 30.0037 11.8574 29.8655V27.9759C11.8574 27.4774 12.0633 27.4304 12.2395 27.4301H12.2826V27.3417C12.1214 27.343 11.9598 27.3581 11.797 27.3581C11.6096 27.3581 11.4275 27.343 11.2425 27.3417L11.2421 27.4301H11.3144C11.4402 27.4304 11.6882 27.4871 11.6882 27.8391L11.6827 29.4092L11.6747 29.4172L11.6607 29.4305L9.84099 27.3417C9.71941 27.3417 9.60107 27.3581 9.47624 27.3581C9.32631 27.3581 9.17266 27.343 9.02428 27.3417L9.02351 27.4301H9.0599C9.25181 27.4304 9.44929 27.5791 9.44929 27.8223V29.5714C9.44929 29.9037 9.35806 30.116 9.06378 30.1171L9.02428 30.116V30.2051C9.20147 30.2037 9.38408 30.1884 9.56282 30.1884C9.7335 30.1884 9.90387 30.2037 10.0727 30.2051V30.1171H10.021C9.69896 30.116 9.61919 29.9735 9.61888 29.6124V27.8544L11.7436 30.2666ZM11.6623 29.4042L11.6752 29.3922L11.6623 29.4042ZM11.6528 29.3961V29.3945L11.6495 29.3918L11.6528 29.3961Z",fill:"#1A1919"}),Object(l.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12.9145 27.5313C12.6072 27.5313 12.5953 27.6064 12.534 27.9092H12.4111C12.4272 27.7928 12.4475 27.6767 12.4602 27.5562C12.4766 27.4394 12.4849 27.3236 12.4849 27.2035H12.5829C12.6159 27.3281 12.7181 27.3236 12.8292 27.3236H14.9396C15.0507 27.3236 15.1528 27.3195 15.1611 27.1948L15.2588 27.2118C15.2431 27.3236 15.2263 27.4358 15.2144 27.5482C15.2063 27.6603 15.2063 27.7721 15.2063 27.8842L15.0834 27.9304C15.075 27.777 15.0547 27.5313 14.7806 27.5313H14.1094V29.7408C14.1094 30.0612 14.2529 30.0978 14.449 30.0978H14.527V30.2227C14.3673 30.2227 14.0808 30.2066 13.8602 30.2066C13.6144 30.2066 13.3277 30.2227 13.1681 30.2227V30.0978H13.2461C13.4716 30.0978 13.5856 30.0774 13.5856 29.7495V27.5313H12.9145Z",fill:"#1A1919"}),Object(l.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M14.5273 30.2405C14.366 30.2405 14.0798 30.224 13.8602 30.224C13.6147 30.224 13.3285 30.2405 13.168 30.2405H13.1505V30.08H13.2461C13.4716 30.0746 13.5622 30.0717 13.5673 29.7495V27.5491H12.9144V27.5128H13.6028V29.7495C13.6028 30.083 13.4703 30.1166 13.2461 30.1169H13.1855V30.2047C13.3469 30.2035 13.6226 30.1883 13.8602 30.1883C14.0731 30.1883 14.3465 30.2035 14.5087 30.2047V30.1169H14.4489C14.251 30.1166 14.0917 30.0673 14.0917 29.7409V27.5128H14.7805C15.055 27.5139 15.0914 27.7506 15.0999 27.9052L15.1885 27.872C15.1885 27.7635 15.1889 27.6549 15.1962 27.5458C15.2083 27.4384 15.2232 27.3329 15.2385 27.2265L15.1764 27.216C15.1573 27.3369 15.0419 27.3433 14.9394 27.3417H12.8077C12.7114 27.3419 12.6065 27.3372 12.5697 27.2213H12.5021C12.5015 27.3361 12.4938 27.4475 12.4783 27.5582C12.4661 27.6723 12.4473 27.7819 12.4324 27.892H12.5198C12.5735 27.6022 12.6085 27.5087 12.9144 27.5128V27.5491C12.6113 27.5552 12.618 27.6066 12.5512 27.9135L12.5483 27.9276H12.3906L12.3928 27.9061C12.4095 27.7902 12.4303 27.6736 12.4422 27.553C12.4592 27.4378 12.467 27.3225 12.467 27.2035V27.1851H12.5969L12.6 27.1982C12.6276 27.3029 12.7033 27.3037 12.8077 27.3056H14.9394C15.0534 27.3037 15.1364 27.3021 15.1434 27.1935L15.1448 27.1738L15.1634 27.1776L15.2791 27.1962L15.2761 27.2145C15.2599 27.326 15.2439 27.4378 15.2315 27.5491C15.2239 27.6604 15.2239 27.772 15.2239 27.8843V27.8968L15.212 27.9017L15.0672 27.9555L15.0663 27.9314C15.055 27.7752 15.0392 27.5491 14.7805 27.5491H14.1274V29.7409C14.1314 30.054 14.2537 30.0761 14.4489 30.08H14.5446V30.2405H14.5273Z",fill:"#1A1919"}),Object(l.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M15.3896 30.098H15.4473C15.5941 30.098 15.7501 30.0775 15.7501 29.8614V27.6856C15.7501 27.4691 15.5941 27.4486 15.4473 27.4486H15.3896V27.3237C15.6384 27.3237 16.0649 27.3402 16.408 27.3402C16.7523 27.3402 17.1773 27.3237 17.4555 27.3237C17.4484 27.5023 17.4523 27.7771 17.4643 27.9595L17.341 27.9925C17.3214 27.7224 17.2723 27.507 16.8425 27.507H16.2744V28.5944H16.7604C17.0059 28.5944 17.0593 28.4537 17.0836 28.2293H17.2063C17.1981 28.3915 17.1938 28.5534 17.1938 28.7152C17.1938 28.8733 17.1981 29.031 17.2063 29.1885L17.0836 29.2134C17.0593 28.9645 17.0471 28.8026 16.7644 28.8026H16.2744V29.7697C16.2744 30.0401 16.5107 30.0401 16.7728 30.0401C17.2639 30.0401 17.4806 30.0066 17.6034 29.5338L17.7176 29.5624C17.6644 29.7829 17.6157 30.0024 17.579 30.2228C17.3167 30.2228 16.8462 30.2068 16.4786 30.2068C16.1096 30.2068 15.6231 30.2228 15.3896 30.2228V30.098Z",fill:"#1A1919"}),Object(l.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M17.5784 30.2406C17.3159 30.2406 16.845 30.2233 16.478 30.2233C16.1093 30.2233 15.623 30.2406 15.3893 30.2406H15.3721V30.0801H15.4469C15.595 30.0776 15.7297 30.0644 15.7316 29.8614V27.6856C15.7297 27.4827 15.595 27.4692 15.4469 27.4665H15.3721V27.3057H15.3893C15.6392 27.3057 16.0649 27.3219 16.4078 27.3219C16.7518 27.3219 17.1766 27.3057 17.4553 27.3057H17.4734L17.4728 27.3248C17.4701 27.3869 17.4684 27.4608 17.4684 27.539C17.4684 27.6825 17.4728 27.8399 17.4808 27.9581L17.4816 27.9729L17.4678 27.9771L17.3239 28.0153L17.3233 27.9939C17.2992 27.7245 17.2635 27.5284 16.8422 27.5243H16.2907L16.2904 28.5762H16.76C16.9959 28.5737 17.038 28.4514 17.0659 28.2274L17.0668 28.2107H17.2242L17.2239 28.2297C17.216 28.392 17.2112 28.5534 17.2112 28.7152C17.2112 28.8722 17.216 29.0299 17.2239 29.1878L17.2242 29.2029L17.2093 29.2063L17.0668 29.2351L17.0659 29.2156C17.0376 28.962 17.0357 28.823 16.7642 28.8201H16.2907V29.7698C16.2913 30.0222 16.5057 30.0208 16.7724 30.0222C17.2651 30.0192 17.4624 29.9947 17.5857 29.5289L17.5899 29.5121L17.6071 29.5149L17.7383 29.5495L17.7345 29.5666C17.6814 29.7864 17.6326 30.006 17.5956 30.2258L17.5925 30.2406H17.5784ZM17.5634 30.2048C17.5992 29.9948 17.6458 29.785 17.696 29.576L17.6155 29.5554C17.4929 30.0199 17.2555 30.0614 16.7726 30.0583C16.5147 30.0583 16.257 30.0583 16.2556 29.7698V28.7846H16.7644C17.0501 28.7816 17.0789 28.9564 17.0994 29.1927L17.1877 29.1743C17.1798 29.0212 17.1757 28.8674 17.1757 28.7152C17.1757 28.5593 17.1798 28.4037 17.1877 28.2469H17.0994C17.0763 28.4639 17.0095 28.6153 16.7602 28.6126H16.2556V27.4884H16.8424C17.2679 27.4849 17.3384 27.7085 17.357 27.9698L17.4451 27.9454C17.438 27.8283 17.4332 27.6777 17.4332 27.539C17.4332 27.4679 17.435 27.4005 17.4373 27.3417C17.1593 27.343 16.7444 27.3581 16.408 27.3581C16.0717 27.3581 15.6579 27.343 15.4074 27.3417V27.4301H15.4471C15.5927 27.4304 15.7667 27.456 15.7677 27.6857V29.8614C15.7667 30.0907 15.5927 30.116 15.4471 30.1171H15.4074V30.2048C15.6456 30.204 16.1186 30.1884 16.4781 30.1884C16.8393 30.1884 17.2996 30.204 17.5634 30.2048Z",fill:"#1A1919"}),Object(l.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M18.27 27.7636C18.27 27.4608 18.1062 27.4484 17.9792 27.4484H17.9053V27.3237C18.0363 27.3237 18.29 27.3402 18.5398 27.3402C18.7849 27.3402 18.9816 27.3237 19.1984 27.3237C19.7132 27.3237 20.1725 27.4647 20.1725 28.0549C20.1725 28.4284 19.9268 28.6565 19.6037 28.7861L20.3031 29.8487C20.418 30.0244 20.4991 30.0736 20.7002 30.098V30.2228C20.5648 30.2228 20.4339 30.2068 20.2993 30.2068C20.1725 30.2068 20.041 30.2228 19.9148 30.2228C19.5994 29.8035 19.3291 29.3552 19.0634 28.8768H18.7937V29.7661C18.7937 30.0859 18.9407 30.098 19.1282 30.098H19.2024V30.2228C18.9687 30.2228 18.7324 30.2068 18.4986 30.2068C18.3022 30.2068 18.1099 30.2228 17.9053 30.2228V30.098H17.9792C18.1311 30.098 18.27 30.0277 18.27 29.8743V27.7636ZM18.7938 28.7271H18.9938C19.4035 28.7271 19.624 28.5697 19.624 28.0794C19.624 27.7101 19.3908 27.4733 19.0262 27.4733C18.9033 27.4733 18.851 27.4861 18.7938 27.4901V28.7271Z",fill:"#1A1919"}),Object(l.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M20.6994 30.2406C20.5622 30.2406 20.4321 30.2239 20.2975 30.2239C20.1728 30.2239 20.0419 30.2406 19.8994 30.2337C19.5855 29.8155 19.3165 29.3697 19.0522 28.8955H18.8105V29.7653C18.8149 30.078 18.9384 30.0757 19.1275 30.0801H19.2193V30.2406H19.2012C18.9674 30.2406 18.7296 30.2239 18.4977 30.2239C18.3023 30.2239 18.1101 30.2406 17.9045 30.2406H17.8867V30.0801H17.9784C18.1256 30.079 18.2499 30.0139 18.2505 29.8743V27.7636C18.2474 27.4692 18.1054 27.4706 17.9784 27.4665H17.8867V27.3057H17.9045C18.037 27.3057 18.2896 27.3219 18.5391 27.3219C18.7833 27.3219 18.9796 27.3057 19.1977 27.3057C19.7136 27.3068 20.1883 27.4509 20.1895 28.0543C20.1895 28.4291 19.9455 28.6633 19.6299 28.794L20.317 29.8388C20.4315 30.0111 20.5027 30.0541 20.7018 30.0801L20.7166 30.0824V30.2406H20.6994ZM18.7927 28.8589H19.0723L19.0774 28.8682C19.3438 29.3453 19.6127 29.7938 19.9139 30.2051C20.0385 30.2051 20.17 30.1884 20.2974 30.1884C20.428 30.1884 20.5544 30.2029 20.6814 30.2048V30.1136C20.4896 30.0899 20.3995 30.0311 20.2878 29.8589L19.5755 28.7778L19.5956 28.7695C19.9161 28.6414 20.1535 28.4195 20.1537 28.0543C20.1535 27.4782 19.712 27.3445 19.1976 27.3417C18.9821 27.3417 18.7854 27.3585 18.539 27.3585C18.2986 27.3585 18.0558 27.343 17.9219 27.3417V27.4301H17.9783C18.1053 27.4304 18.2861 27.4518 18.2861 27.7637V29.8743C18.2861 30.041 18.1323 30.1168 17.9783 30.1171H17.9219V30.2048C18.1186 30.204 18.3054 30.1884 18.4977 30.1884C18.7261 30.1884 18.9572 30.204 19.1835 30.2048V30.1171H19.1274C18.9411 30.1168 18.7746 30.0933 18.7746 29.7654V28.8589H18.7927ZM18.7926 28.7449H18.7745V27.4733L18.7901 27.472C18.8462 27.4674 18.9013 27.456 19.0251 27.456C19.3978 27.456 19.6405 27.7017 19.6408 28.0804C19.6397 28.5762 19.4055 28.7448 18.9927 28.7449H18.7926ZM18.993 28.7094C19.398 28.7053 19.6021 28.5628 19.6061 28.0803C19.6037 27.7174 19.3817 27.4923 19.0253 27.4908C18.9149 27.4908 18.8627 27.5011 18.8105 27.5063V28.7094H18.993Z",fill:"#1A1919"}),Object(l.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M23.4779 29.4042L23.485 29.3961V27.8391C23.485 27.4982 23.2526 27.4484 23.1297 27.4484H23.0401V27.3237C23.2324 27.3237 23.42 27.3402 23.6128 27.3402C23.781 27.3402 23.9475 27.3237 24.1165 27.3237V27.4484H24.0549C23.8829 27.4484 23.6907 27.4816 23.6907 27.9758V29.8655C23.6907 30.0111 23.6948 30.1563 23.7149 30.2852H23.56L21.453 27.9008V29.6124C21.453 29.974 21.522 30.098 21.8371 30.098H21.9068V30.2228C21.731 30.2228 21.5547 30.2066 21.3789 30.2066C21.1941 30.2066 21.0063 30.2228 20.8223 30.2228V30.098H20.8791C21.1616 30.098 21.248 29.9027 21.248 29.5715V27.8216C21.248 27.5893 21.0595 27.4484 20.8755 27.4484H20.8223V27.3237C20.9772 27.3237 21.1379 27.3402 21.2931 27.3402C21.4147 27.3402 21.534 27.3237 21.6569 27.3237L23.4779 29.4042Z",fill:"#1A1919"}),Object(l.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M23.7146 30.3027L23.5466 30.2969L21.4697 27.948V29.6122C21.4745 29.974 21.5284 30.0761 21.8369 30.0801H21.9237V30.2406H21.9059C21.729 30.2406 21.5534 30.2233 21.378 30.2233C21.1954 30.2233 21.0063 30.2406 20.822 30.2406H20.8037V30.0801H20.879C21.1493 30.079 21.2267 29.9021 21.2293 29.5704V27.8216C21.2289 27.6003 21.0504 27.4665 20.8754 27.4665H20.8037V27.3057H20.822C20.9783 27.3057 21.1384 27.3219 21.2928 27.3219C21.413 27.3219 21.5315 27.3057 21.6687 27.311L23.4676 29.3667V27.8391C23.4665 27.5092 23.2486 27.4684 23.1296 27.4665H23.0217V27.3057H23.0395C23.2328 27.3057 23.4214 27.3219 23.6127 27.3219C23.7794 27.3219 23.9469 27.3057 24.1156 27.3057H24.1337V27.4665H24.0547C23.8859 27.4706 23.712 27.486 23.708 27.9758V29.8655C23.708 30.0109 23.7115 30.1549 23.7324 30.2822L23.7344 30.3027H23.7146ZM23.5596 30.2666H23.6937C23.6757 30.1424 23.6722 30.0037 23.6722 29.8655V27.9759C23.6725 27.4774 23.8794 27.4312 24.0546 27.4301H24.0976V27.3417C23.9365 27.343 23.7748 27.3581 23.6125 27.3581C23.4245 27.3581 23.2422 27.343 23.0571 27.3417V27.4301H23.1294C23.2555 27.4312 23.5033 27.4871 23.5033 27.8391L23.4974 29.4092L23.49 29.4172L23.4772 29.4309L21.6566 27.3417C21.5349 27.3417 21.4163 27.3581 21.2927 27.3581C21.1409 27.3581 20.988 27.343 20.8393 27.3417V27.4301H20.8752C21.0678 27.4312 21.2646 27.5785 21.2646 27.8217V29.5705C21.2646 29.9037 21.1722 30.116 20.8788 30.1171L20.8393 30.1168V30.2049C21.016 30.2037 21.1983 30.1884 21.3778 30.1884C21.5495 30.1884 21.7195 30.2037 21.8887 30.2049V30.1171H21.8368C21.5148 30.1168 21.4345 29.974 21.4336 29.6123V27.855L23.5596 30.2666ZM23.4775 29.4042L23.4908 29.3922L23.4775 29.4042ZM23.4674 29.3961V29.395L23.4645 29.3918L23.4674 29.3961Z",fill:"#1A1919"}),Object(l.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M24.7741 29.6286C24.7329 29.7693 24.6835 29.8784 24.6835 29.9521C24.6835 30.0771 24.8559 30.0977 24.9905 30.0977H25.0362V30.2224C24.8718 30.2134 24.7049 30.2064 24.5402 30.2064C24.3929 30.2064 24.2464 30.2134 24.0986 30.2224V30.0977H24.1236C24.2828 30.0977 24.4183 30.002 24.479 29.8275L25.1337 27.9218C25.1872 27.7677 25.2609 27.5602 25.2858 27.4062C25.4159 27.3607 25.5803 27.2782 25.6577 27.2277C25.6704 27.2235 25.678 27.2192 25.6904 27.2192C25.7028 27.2192 25.7104 27.2192 25.7194 27.2323C25.7314 27.2651 25.7434 27.3026 25.7561 27.3357L26.5093 29.5082C26.5584 29.6531 26.607 29.8067 26.6594 29.932C26.7092 30.0485 26.7952 30.0977 26.9307 30.0977H26.9552V30.2224C26.7709 30.2134 26.5862 30.2064 26.3908 30.2064C26.1902 30.2064 25.985 30.2134 25.7763 30.2224V30.0977H25.8214C25.915 30.0977 26.0756 30.0812 26.0756 29.9773C26.0756 29.9237 26.0386 29.8114 25.9929 29.678L25.8335 29.1964H24.9048L24.7741 29.6286ZM25.3715 27.7887H25.363L24.9827 28.9642H25.7472L25.3715 27.7887Z",fill:"#1A1919"}),Object(l.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M26.954 30.2404C26.7702 30.2324 26.5857 30.2231 26.3909 30.2231C26.1903 30.2231 25.9861 30.2324 25.7774 30.2404L25.7585 30.2414V30.0791H25.8215C25.9163 30.0791 26.0569 30.0576 26.0572 29.9776C26.0582 29.9302 26.0215 29.8164 25.9764 29.6844L25.8206 29.2145H24.9181L24.7907 29.6342C24.7495 29.7754 24.6998 29.8851 24.7006 29.9527C24.702 30.0541 24.8547 30.0791 24.9905 30.0791H25.0534V30.2414L25.0348 30.2404C24.8713 30.2324 24.7043 30.2231 24.5406 30.2231C24.3945 30.2231 24.2466 30.2324 24.1001 30.2404L24.0811 30.2414V30.0791H24.1235C24.2756 30.0788 24.4026 29.9906 24.4618 29.8219L25.1171 27.9156C25.1699 27.7619 25.2442 27.5553 25.2796 27.3893C25.408 27.3451 25.5726 27.2613 25.6511 27.2112C25.6626 27.2071 25.6739 27.2017 25.6903 27.2017C25.7004 27.2011 25.7224 27.2038 25.7357 27.2255C25.7473 27.2596 25.7603 27.2969 25.7727 27.3303L26.5261 29.5025C26.5742 29.6479 26.6232 29.8013 26.6768 29.9244C26.7242 30.0351 26.7993 30.0788 26.9308 30.0791H26.9721V30.2414L26.954 30.2404ZM25.7943 30.2036C25.9968 30.1963 26.1955 30.1883 26.391 30.1883C26.5807 30.1883 26.7591 30.1963 26.9369 30.2036V30.1166H26.9309C26.7906 30.1176 26.6941 30.0616 26.6439 29.9391C26.5906 29.8137 26.5409 29.6595 26.4926 29.5141L25.7392 27.3417C25.7268 27.3086 25.7152 27.2715 25.7045 27.2419C25.7005 27.2378 25.7014 27.2378 25.6981 27.2378H25.6904C25.6822 27.2378 25.6772 27.2403 25.6667 27.243C25.588 27.2949 25.424 27.3768 25.3023 27.4092C25.2773 27.5666 25.2036 27.7741 25.1505 27.928L24.4958 29.8338C24.4335 30.0143 24.2896 30.1169 24.1236 30.1166H24.1168V30.2036C24.2571 30.1963 24.3987 30.1883 24.5407 30.1883C24.699 30.1883 24.8604 30.1963 25.017 30.2036V30.1166H24.9906C24.857 30.1147 24.6708 30.1 24.6661 29.9528C24.6665 29.8704 24.7166 29.7642 24.7568 29.6238L24.7741 29.629L24.7568 29.6233L24.8915 29.1795H25.8456L26.0095 29.6727C26.0555 29.8063 26.0926 29.917 26.0926 29.9777C26.0866 30.1048 25.9144 30.1143 25.8216 30.1166H25.7943V30.2036ZM24.958 28.9822L25.3497 27.7704H25.3717V27.7888L25.3674 27.7901L25.3717 27.7888V27.7704H25.384L25.7729 28.9822H24.958ZM25.0067 28.946H25.723L25.3669 27.8331L25.0067 28.946ZM25.3539 27.7943L25.3634 27.7913L25.3539 27.7943Z",fill:"#1A1919"}),Object(l.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M27.1347 27.5313C26.8279 27.5313 26.8155 27.6064 26.7538 27.9092H26.6309C26.647 27.7928 26.6679 27.6767 26.6806 27.5562C26.6965 27.4394 26.7044 27.3236 26.7044 27.2035H26.8034C26.8355 27.3281 26.938 27.3236 27.0484 27.3236H29.1601C29.2701 27.3236 29.3723 27.3195 29.3804 27.1948L29.4783 27.2118C29.4631 27.3236 29.4468 27.4358 29.434 27.5482C29.425 27.6603 29.425 27.7721 29.425 27.8842L29.3028 27.9304C29.2955 27.777 29.2749 27.5313 29.0001 27.5313H28.3292V29.7408C28.3292 30.0612 28.4726 30.0978 28.6687 30.0978H28.7469V30.2227C28.5871 30.2227 28.3011 30.2066 28.0797 30.2066C27.8346 30.2066 27.5475 30.2227 27.3879 30.2227V30.0978H27.4658C27.6914 30.0978 27.8055 30.0774 27.8055 29.7495V27.5313H27.1347Z",fill:"#1A1919"}),Object(l.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M28.748 30.2405C28.5872 30.2405 28.3003 30.224 28.0804 30.224C27.836 30.224 27.5495 30.2405 27.3892 30.2405H27.371V30.08H27.4669C27.6926 30.0746 27.783 30.0717 27.7885 29.7495L27.7881 27.5491H27.1358V27.5128H27.8242V29.7495C27.8242 30.083 27.6917 30.1158 27.4669 30.1166H27.4067V30.205C27.5684 30.2035 27.8433 30.1883 28.0804 30.1883C28.2943 30.1883 28.5681 30.2035 28.7297 30.205V30.1166H28.6696C28.4724 30.1158 28.313 30.0677 28.3127 29.7409V27.5128H29.0012C29.2761 27.5139 29.3119 27.7506 29.3198 27.9052L29.4087 27.872C29.4087 27.7635 29.4093 27.6549 29.4177 27.5463C29.4287 27.4392 29.4442 27.3329 29.459 27.227L29.3972 27.216C29.3785 27.3369 29.263 27.3436 29.1612 27.3417H27.0286C26.9321 27.3428 26.8277 27.3372 26.7905 27.221H26.7236C26.7227 27.3359 26.7146 27.4475 26.6985 27.5582C26.6874 27.6728 26.6677 27.7827 26.6521 27.892H26.74C26.7938 27.6022 26.8293 27.5082 27.1358 27.5128V27.5491C26.8323 27.5544 26.839 27.6066 26.7723 27.9135L26.7693 27.9276H26.6113L26.6138 27.907C26.631 27.7902 26.6511 27.6736 26.6631 27.554C26.6798 27.4378 26.6874 27.3225 26.6874 27.2035V27.1851H26.8173L26.8207 27.1982C26.8494 27.3029 26.9239 27.3037 27.0286 27.3056H29.1612C29.2744 27.3037 29.357 27.3021 29.3643 27.1938L29.3649 27.1738L29.3839 27.1776L29.5001 27.1962L29.4973 27.2145C29.4804 27.326 29.4649 27.4378 29.4525 27.5491C29.4442 27.6604 29.4442 27.7722 29.4442 27.8843V27.8968L29.4322 27.9017L29.2874 27.9555L29.2868 27.9314C29.2761 27.7752 29.2599 27.5491 29.0012 27.5491H28.3479V29.7409C28.3521 30.054 28.4746 30.0761 28.6696 30.08H28.765V30.2405H28.748Z",fill:"#1A1919"}),Object(l.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M29.6299 30.098H29.6872C29.8346 30.098 29.9895 30.0775 29.9895 29.8614V27.6856C29.9895 27.4691 29.8346 27.4486 29.6872 27.4486H29.6299V27.3237C29.7896 27.3237 30.0346 27.3402 30.2349 27.3402C30.4399 27.3402 30.6856 27.3237 30.8783 27.3237V27.4486H30.8208C30.6729 27.4486 30.5174 27.4691 30.5174 27.6856V29.8614C30.5174 30.0775 30.6729 30.098 30.8208 30.098H30.8783V30.2228C30.6817 30.2228 30.4359 30.2068 30.2316 30.2068C30.0307 30.2068 29.7896 30.2228 29.6299 30.2228V30.098Z",fill:"#1A1919"}),Object(l.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M30.8792 30.2406C30.6814 30.2406 30.4367 30.2233 30.2325 30.2233C30.0322 30.2233 29.7906 30.2406 29.6308 30.2406H29.6133V30.0801H29.6882C29.8357 30.0776 29.9717 30.0644 29.9726 29.8614V27.6856C29.9717 27.4827 29.8357 27.4692 29.6882 27.4665H29.6133V27.3057H29.6308C29.7906 27.3057 30.0367 27.3219 30.2358 27.3219C30.4397 27.3219 30.6852 27.3057 30.8792 27.3057H30.8962V27.4665H30.8218C30.6721 27.4692 30.5375 27.4827 30.5361 27.6856V29.8614C30.5375 30.0644 30.6721 30.0776 30.8218 30.0801H30.8962V30.2406H30.8792ZM30.8605 30.2048V30.1168H30.8218C30.6749 30.1168 30.5013 30.0907 30.5013 29.8614V27.6857C30.5013 27.456 30.6749 27.4304 30.8218 27.4301H30.8605V27.3417C30.6718 27.343 30.4349 27.3581 30.2357 27.3581C30.0415 27.3581 29.8073 27.343 29.6485 27.3417V27.4301H29.6882C29.8334 27.4304 30.0078 27.456 30.0083 27.6857V29.8614C30.0078 30.0907 29.8334 30.1168 29.6882 30.1168H29.6485V30.2048C29.8062 30.2029 30.0376 30.1884 30.2324 30.1884C30.4308 30.1884 30.6675 30.2037 30.8605 30.2048Z",fill:"#1A1919"}),Object(l.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M32.5103 27.2612C33.3826 27.2612 34.0779 27.81 34.0779 28.6947C34.0779 29.65 33.4026 30.285 32.5314 30.285C31.6636 30.285 31.001 29.6868 31.001 28.7937C31.001 27.9303 31.6595 27.2612 32.5103 27.2612ZM32.5722 30.1022C33.3663 30.1022 33.5048 29.3915 33.5048 28.7859C33.5048 28.179 33.1823 27.4442 32.5027 27.4442C31.7868 27.4442 31.5738 28.0922 31.5738 28.6482C31.5738 29.3915 31.9096 30.1022 32.5722 30.1022Z",fill:"#1A1919"}),Object(l.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M30.9824 28.7937C30.9841 27.9203 31.6503 27.2446 32.5099 27.2432V27.2795C31.6687 27.2795 31.018 27.9394 31.0171 28.7937C31.0188 29.6767 31.6718 30.266 32.5313 30.2663C33.3937 30.266 34.0592 29.6401 34.0603 28.694C34.0595 27.8204 33.3752 27.2803 32.5099 27.2795V27.2432C33.3884 27.2441 34.0936 27.7983 34.0951 28.694C34.0942 29.6593 33.4109 30.3009 32.5313 30.3024C31.656 30.3009 30.9841 29.6967 30.9824 28.7937ZM31.5555 28.6481C31.5567 28.0892 31.7715 27.4255 32.5021 27.4255C33.1969 27.4271 33.5209 28.1755 33.5223 28.7858C33.5209 29.3914 33.3806 30.1191 32.572 30.1191V30.0839C33.35 30.0833 33.4852 29.3914 33.4864 28.7858C33.4864 28.1842 33.1672 27.4632 32.5021 27.4621C31.8002 27.4629 31.5928 28.0949 31.5909 28.6481C31.5912 29.3879 31.9239 30.0828 32.572 30.0839V30.1191C31.8928 30.1185 31.5567 29.3958 31.5555 28.6481Z",fill:"#1A1919"}),Object(l.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M36.8353 29.4042L36.8439 29.3961V27.8391C36.8439 27.4982 36.6098 27.4484 36.4872 27.4484H36.3981V27.3237C36.5899 27.3237 36.7785 27.3402 36.9703 27.3402C37.1385 27.3402 37.3062 27.3237 37.4741 27.3237V27.4484H37.4126C37.2411 27.4484 37.048 27.4816 37.048 27.9758V29.8655C37.048 30.0111 37.0523 30.1563 37.0731 30.2852H36.9174L34.8098 27.9008V29.6124C34.8098 29.974 34.8796 30.098 35.194 30.098H35.2642V30.2228C35.0881 30.2228 34.9124 30.2066 34.7365 30.2066C34.5522 30.2066 34.3638 30.2228 34.1797 30.2228V30.098H34.2371C34.52 30.098 34.6053 29.9027 34.6053 29.5715V27.8216C34.6053 27.5893 34.4177 27.4484 34.2327 27.4484H34.1797V27.3237C34.3352 27.3237 34.4946 27.3402 34.6504 27.3402C34.7729 27.3402 34.8909 27.3237 35.0142 27.3237L36.8353 29.4042Z",fill:"#1A1919"}),Object(l.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M37.0729 30.3027L36.9036 30.2969L34.827 27.948V29.6124C34.8318 29.974 34.8859 30.0757 35.1932 30.0793H35.2813V30.2406H35.264C35.0868 30.2406 34.9111 30.2239 34.7361 30.2239C34.5527 30.2239 34.3644 30.2406 34.1788 30.2406H34.1621V30.0793H34.2366C34.5063 30.0785 34.584 29.9021 34.5873 29.5714V27.8216C34.5871 27.6003 34.4082 27.4665 34.2324 27.4665H34.1621V27.3057H34.1788C34.3357 27.3057 34.4953 27.3219 34.6498 27.3219C34.7713 27.3219 34.8888 27.3057 35.0276 27.3121L36.8255 29.3667V27.8391C36.8241 27.5092 36.6062 27.4692 36.4868 27.4665H36.379V27.3057H36.3977C36.5899 27.3057 36.7787 27.3219 36.9694 27.3219C37.1368 27.3219 37.3038 27.3057 37.4739 27.3057H37.4911V27.4665H37.4121C37.2434 27.4709 37.0693 27.4866 37.0659 27.9758V29.8655C37.0659 30.0109 37.0691 30.1559 37.089 30.2822L37.0925 30.3027H37.0729ZM36.9171 30.2666H37.0512C37.0339 30.1416 37.0298 30.0037 37.0298 29.8655V27.9759C37.0298 27.4766 37.2365 27.4312 37.4121 27.4301H37.4564V27.3417C37.2939 27.343 37.133 27.3581 36.9694 27.3581C36.7831 27.3581 36.6002 27.343 36.4149 27.3417V27.4301H36.4868C36.6132 27.4312 36.8602 27.4879 36.8602 27.8391L36.8559 29.4092L36.848 29.4172L36.835 29.4309L35.014 27.3417C34.8929 27.3417 34.7738 27.3581 34.6499 27.3581C34.499 27.3581 34.3454 27.343 34.1965 27.3417V27.4301H34.2325C34.4248 27.4312 34.6225 27.5785 34.6225 27.8217V29.5714C34.6225 29.9037 34.5311 30.116 34.2366 30.1171L34.1965 30.1168V30.2049C34.3742 30.2037 34.5563 30.1884 34.7361 30.1884C34.9068 30.1884 35.0764 30.2037 35.246 30.2049V30.1171H35.1932C34.8721 30.1168 34.7916 29.974 34.7916 29.6124V27.8544L36.9171 30.2666ZM36.8351 29.4042L36.8481 29.3922L36.8351 29.4042ZM36.8256 29.3961V29.395L36.8224 29.3918L36.8256 29.3961Z",fill:"#1A1919"}),Object(l.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M38.1311 29.6286C38.091 29.7693 38.0416 29.8784 38.0416 29.9521C38.0416 30.0771 38.214 30.0977 38.3481 30.0977H38.3938V30.2224C38.2299 30.2134 38.062 30.2064 37.8981 30.2064C37.7508 30.2064 37.6037 30.2134 37.457 30.2224V30.0977H37.4803C37.6407 30.0977 37.7762 30.002 37.836 29.8275L38.4921 27.9218C38.5449 27.7677 38.619 27.5602 38.6425 27.4062C38.774 27.3607 38.9373 27.2782 39.0161 27.2277C39.0276 27.2235 39.0358 27.2192 39.0485 27.2192C39.0604 27.2192 39.0681 27.2192 39.0765 27.2323C39.0889 27.2651 39.1011 27.3026 39.1135 27.3357L39.8664 29.5082C39.9152 29.6531 39.9646 29.8067 40.0181 29.932C40.0672 30.0485 40.153 30.0977 40.2879 30.0977H40.3131V30.2224C40.1286 30.2134 39.9443 30.2064 39.7478 30.2064C39.5477 30.2064 39.3428 30.2134 39.1338 30.2224V30.0977H39.1792C39.2728 30.0977 39.4332 30.0812 39.4332 29.9773C39.4332 29.9237 39.3965 29.8114 39.3508 29.678L39.1913 29.1964H38.2626L38.1311 29.6286ZM38.7292 27.7887H38.721L38.3395 28.9642H39.1059L38.7292 27.7887Z",fill:"#1A1919"}),Object(l.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M40.3115 30.2407C40.127 30.2333 39.9433 30.224 39.7482 30.224C39.5485 30.224 39.3435 30.2333 39.135 30.2407L39.1169 30.2416V30.0802H39.1791C39.2742 30.0802 39.4152 30.0578 39.4153 29.9778C39.4164 29.9305 39.3794 29.8172 39.3334 29.6846L39.1782 29.2147H38.2749L38.1485 29.6345C38.1073 29.7768 38.059 29.8854 38.0595 29.9527C38.0595 30.0544 38.213 30.0802 38.3482 30.0802H38.4107V30.2416L38.3923 30.2407C38.2289 30.2333 38.0613 30.224 37.8984 30.224C37.7517 30.224 37.6049 30.2333 37.4573 30.2407L37.4395 30.2416V30.0802H37.4805C37.6331 30.0794 37.7607 29.9907 37.8206 29.8222L38.475 27.9159C38.5275 27.7621 38.6014 27.5556 38.6373 27.3902C38.7659 27.3449 38.9302 27.2616 39.0098 27.2114C39.0204 27.2073 39.0318 27.2023 39.0486 27.2023C39.0591 27.2014 39.0806 27.204 39.0932 27.2267C39.1056 27.2594 39.1176 27.2971 39.131 27.3306L39.8834 29.5027C39.9326 29.6482 39.9814 29.8016 40.0346 29.9255C40.0827 30.0354 40.1568 30.0791 40.2876 30.0802H40.3299V30.2416L40.3115 30.2407ZM39.1516 30.204C39.354 30.1964 39.5531 30.1884 39.7482 30.1884C39.9384 30.1884 40.1164 30.1964 40.295 30.2037L40.2945 30.1167H40.2877C40.1491 30.117 40.0526 30.0617 40.0015 29.9392C39.9476 29.8138 39.8989 29.6596 39.8498 29.5146L39.0969 27.3418C39.0849 27.3087 39.0718 27.2716 39.0622 27.2428C39.0588 27.2379 39.0591 27.2379 39.0567 27.2379H39.0486C39.0398 27.2379 39.0353 27.2407 39.0255 27.2436C38.9455 27.2944 38.7817 27.3777 38.6609 27.4093C38.6355 27.5666 38.5612 27.7738 38.5085 27.9281L37.8532 29.8339C37.7909 30.0144 37.648 30.117 37.4806 30.1167H37.4745V30.2037C37.6155 30.1964 37.7561 30.1884 37.8984 30.1884C38.0569 30.1884 38.2187 30.1964 38.3759 30.2037V30.1167H38.3482C38.2152 30.1148 38.0287 30.1005 38.0234 29.9526C38.0245 29.8705 38.0749 29.7646 38.115 29.6239L38.1314 29.6291L38.115 29.6234L38.2496 29.1796H39.2033L39.3677 29.6728C39.4127 29.8064 39.4501 29.9171 39.4501 29.9777C39.4442 30.1049 39.2721 30.1144 39.1792 30.1167H39.1516V30.204ZM38.3155 28.9823L38.7084 27.7707H38.7296V27.7891L38.725 27.7904L38.7296 27.7891V27.7707H38.742L39.1289 28.9823H38.3155ZM38.3649 28.9463H39.0808L38.7249 27.834L38.3649 28.9463ZM38.7127 27.7946L38.7207 27.7916L38.7127 27.7946Z",fill:"#1A1919"}),Object(l.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M41.3443 29.8155C41.3443 29.9824 41.458 30.0316 41.5893 30.0489C41.7568 30.0614 41.9411 30.0614 42.1299 30.0401C42.3015 30.0192 42.4488 29.9202 42.5222 29.8155C42.5873 29.7243 42.6241 29.608 42.6492 29.5168H42.7676C42.7225 29.7535 42.6653 29.9864 42.6162 30.2228C42.2569 30.2228 41.8957 30.2068 41.5362 30.2068C41.1758 30.2068 40.816 30.2228 40.4561 30.2228V30.098H40.5127C40.6603 30.098 40.8205 30.0775 40.8205 29.82V27.6856C40.8205 27.4691 40.6603 27.4484 40.5127 27.4484H40.4561V27.3237C40.6726 27.3237 40.8857 27.3402 41.1022 27.3402C41.3113 27.3402 41.5155 27.3237 41.7247 27.3237V27.4484H41.6219C41.4664 27.4484 41.3443 27.4528 41.3443 27.6729V29.8155Z",fill:"#1A1919"}),Object(l.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M42.6158 30.2406C42.2549 30.2406 41.8945 30.2239 41.5356 30.2239C41.1757 30.2239 40.8156 30.2406 40.4547 30.2406H40.4375V30.0801H40.5122C40.6601 30.0765 40.8006 30.0659 40.8023 29.8201V27.6849C40.8006 27.4827 40.6607 27.4692 40.5122 27.4665H40.4375V27.3057H40.4547C40.6726 27.3057 40.8856 27.3219 41.1013 27.3219C41.3097 27.3219 41.5135 27.3057 41.7241 27.3057H41.7405V27.4665H41.6213C41.4625 27.4706 41.364 27.4633 41.3605 27.6729V29.8155C41.3615 29.9708 41.4618 30.0123 41.5897 30.0309C41.6617 30.0359 41.7379 30.0386 41.8166 30.0386C41.9167 30.0386 42.0206 30.0339 42.1264 30.0225C42.293 30.0024 42.4364 29.9046 42.5072 29.8056C42.5704 29.7168 42.606 29.603 42.6308 29.5126L42.6342 29.4989H42.7885L42.7849 29.5207C42.7386 29.7581 42.6823 29.9898 42.6327 30.2266L42.6294 30.2406H42.6158ZM42.6009 30.2048C42.6483 29.9792 42.7017 29.7586 42.746 29.5346H42.6616C42.6365 29.625 42.6 29.7365 42.5358 29.8269C42.4593 29.9344 42.3078 30.0359 42.1303 30.0583C42.0233 30.0693 41.9169 30.0749 41.8167 30.0749C41.7374 30.0749 41.6609 30.0713 41.5864 30.066C41.4533 30.0512 41.3246 29.9932 41.3248 29.8155V27.6729C41.3248 27.442 41.4687 27.4301 41.6214 27.4301H41.7056V27.3417C41.5041 27.343 41.3051 27.3585 41.1014 27.3585C40.89 27.3585 40.6826 27.343 40.4732 27.3417V27.4301H40.5123C40.6582 27.4301 40.8367 27.456 40.8367 27.6849V29.8201C40.8367 30.0889 40.6589 30.1168 40.5123 30.1168H40.4732V30.2048C40.8267 30.204 41.1804 30.1884 41.5357 30.1884C41.8915 30.1884 42.2467 30.204 42.6009 30.2048Z",fill:"#1A1919"}),Object(l.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M17.1602 12.6614C17.1602 8.77664 20.2628 5.62744 24.09 5.62744C27.9174 5.62744 31.0201 8.77664 31.0201 12.6614C31.0201 16.5462 27.9174 19.6956 24.09 19.6956C20.2628 19.6956 17.1602 16.5462 17.1602 12.6614Z",fill:"#FFFFFE"}),Object(l.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M28.2807 12.5227C28.2779 10.7214 27.1686 9.18519 25.6055 8.5768V16.4683C27.1686 15.8592 28.2779 14.3243 28.2807 12.5227ZM22.6238 16.4669V8.57771C21.0621 9.18799 19.9545 10.722 19.9503 12.5229C19.9545 14.3232 21.0621 15.8571 22.6238 16.4669ZM24.1156 5.85259C20.4863 5.85401 17.546 8.83908 17.5454 12.5228C17.546 16.206 20.4863 19.1906 24.1156 19.1913C27.7449 19.1906 30.6858 16.206 30.6867 12.5228C30.6858 8.83908 27.7449 5.85401 24.1156 5.85259ZM24.0995 19.8207C20.1281 19.8399 16.8594 16.5742 16.8594 12.5989C16.8594 8.25425 20.1281 5.24921 24.0995 5.25H25.9606C29.8851 5.24921 33.4668 8.25284 33.4668 12.5989C33.4668 16.5728 29.8851 19.8207 25.9606 19.8207H24.0995Z",fill:"#0069AA"}),Object(l.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7.60352 30.098H7.66098C7.80812 30.098 7.96362 30.0775 7.96362 29.8614V27.6856C7.96362 27.4691 7.80812 27.4486 7.66098 27.4486H7.60352V27.3237C7.76305 27.3237 8.00854 27.3402 8.20958 27.3402C8.41403 27.3402 8.65921 27.3237 8.85158 27.3237V27.4486H8.79381C8.64729 27.4486 8.49147 27.4691 8.49147 27.6856V29.8614C8.49147 30.0775 8.64729 30.098 8.79381 30.098H8.85158V30.2228C8.65534 30.2228 8.40923 30.2068 8.2054 30.2068C8.00451 30.2068 7.76305 30.2228 7.60352 30.2228V30.098Z",fill:"#1A1919"}),Object(l.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8.85181 30.2406C8.65387 30.2406 8.409 30.2239 8.20532 30.2239C8.00506 30.2239 7.76437 30.2406 7.60375 30.2406H7.58594V30.0801H7.6609C7.80944 30.0765 7.9445 30.0644 7.94574 29.8614V27.6856C7.9445 27.4824 7.80944 27.4692 7.6609 27.4665H7.58594V27.3057H7.60375C7.76437 27.3057 8.0097 27.3219 8.20981 27.3219C8.41333 27.3219 8.65836 27.3057 8.85181 27.3057H8.87009V27.4665H8.79482C8.64613 27.4692 8.51029 27.4824 8.50952 27.6856V29.8614C8.51029 30.0644 8.64613 30.0765 8.79482 30.0801H8.87009V30.2406H8.85181ZM8.83398 30.2051L8.83413 30.1168H8.79464C8.64827 30.1168 8.47433 30.0907 8.4734 29.8614V27.6857C8.47433 27.456 8.64827 27.4304 8.79464 27.4304H8.83398V27.3417C8.64517 27.3419 8.40804 27.3585 8.20963 27.3585C8.01525 27.3585 7.77998 27.343 7.62154 27.3417V27.4304H7.66072C7.80662 27.4304 7.98087 27.456 7.98087 27.6857V29.8614C7.98087 30.0907 7.80662 30.1168 7.66072 30.1168H7.62154V30.2051C7.77998 30.2037 8.01107 30.1884 8.20514 30.1884C8.40448 30.1884 8.64099 30.204 8.83398 30.2051Z",fill:"#1A1919"}),Object(l.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M42.7169 27.2061C42.9638 27.2061 43.1479 27.3985 43.1479 27.6444C43.1479 27.8901 42.9638 28.0804 42.7169 28.0804C42.4706 28.0804 42.2861 27.8901 42.2861 27.6444C42.2861 27.3985 42.4706 27.2061 42.7169 27.2061ZM42.7168 27.9992C42.9101 27.9992 43.0577 27.8324 43.0577 27.6443C43.0577 27.456 42.9118 27.288 42.7168 27.288C42.5229 27.288 42.3754 27.456 42.3754 27.6443C42.3754 27.8324 42.5229 27.9992 42.7168 27.9992ZM42.5025 27.8751V27.8538C42.5551 27.8461 42.565 27.8475 42.565 27.8149V27.4907C42.565 27.4451 42.5606 27.4294 42.5042 27.4319V27.4096H42.7247C42.8005 27.4096 42.8703 27.4464 42.8703 27.5259C42.8703 27.5908 42.8282 27.6391 42.7684 27.6578L42.8393 27.7581C42.8723 27.8034 42.91 27.8461 42.9341 27.8612V27.8751H42.8503C42.8101 27.8751 42.7745 27.7892 42.6955 27.674H42.6478V27.8189C42.6478 27.8475 42.6577 27.8461 42.7106 27.8538V27.8751H42.5025ZM42.6481 27.6444H42.6989C42.7545 27.6444 42.7802 27.6018 42.7802 27.5328C42.7802 27.4633 42.7406 27.4386 42.6961 27.4386H42.6481V27.6444Z",fill:"#1A1919"})),s=()=>Object(l.createElement)("svg",{width:"52",height:"35",viewBox:"0 0 52 35",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Object(l.createElement)("rect",{x:"0.878906",y:"0.5",width:"50",height:"34",rx:"3.5",fill:"white",stroke:"#F3F3F3"}),Object(l.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M17.1461 17.7823C17.1461 19.9191 18.8322 21.576 21.0021 21.576C21.6154 21.576 22.141 21.456 22.7888 21.1524V19.4832C22.2192 20.0506 21.7145 20.2795 21.0685 20.2795C19.6332 20.2795 18.6146 19.2439 18.6146 17.7717C18.6146 16.376 19.6654 15.2751 21.0021 15.2751C21.6818 15.2751 22.1963 15.5163 22.7888 16.0929V14.4246C22.1633 14.1089 21.649 13.978 21.0357 13.978C18.8768 13.978 17.1461 15.6685 17.1461 17.7823ZM13.4892 16.0168C13.4892 16.4097 13.7401 16.6173 14.5953 16.9321C16.2163 17.5222 16.6967 18.0449 16.6967 19.2001C16.6967 20.6072 15.6577 21.5872 14.177 21.5872C13.0926 21.5872 12.304 21.1622 11.6475 20.2031L12.5682 19.3209C12.8962 19.9523 13.4437 20.2907 14.1234 20.2907C14.7593 20.2907 15.2298 19.8542 15.2298 19.2653C15.2298 18.96 15.0873 18.6979 14.8025 18.5128C14.6594 18.4252 14.3754 18.2949 13.8174 18.0988C12.479 17.6197 12.0201 17.1068 12.0201 16.1053C12.0201 14.9155 13.006 14.0224 14.2987 14.0224C15.0997 14.0224 15.8327 14.2948 16.4455 14.8282L15.6998 15.7997C15.3286 15.3857 14.9775 15.211 14.5507 15.211C13.9366 15.211 13.4892 15.559 13.4892 16.0168ZM9.68583 21.4123H11.1109V14.1424H9.68583V21.4123ZM6.77288 19.6035C6.32524 20.006 5.74353 20.1815 4.82283 20.1815H4.44039V15.374H4.82283C5.74353 15.374 6.30238 15.538 6.77288 15.9621C7.26569 16.3986 7.56205 17.0755 7.56205 17.7717C7.56205 18.4697 7.26569 19.1671 6.77288 19.6035ZM5.10834 14.1424H3.0166V21.4121H5.09733C6.20374 21.4121 7.0025 21.1525 7.70389 20.5728C8.53737 19.8867 9.03017 18.8523 9.03017 17.7824C9.03017 15.6369 7.41938 14.1424 5.10834 14.1424ZM32.1394 14.1424L34.0875 19.0255L36.061 14.1424H37.6057L34.4496 21.5988H33.6828L30.5826 14.1424H32.1394ZM38.2501 21.4122H42.2913V20.1815H39.6741V18.2191H42.1951V16.9878H39.6741V15.3742H42.2913V14.1424H38.2501V21.4122ZM44.6585 17.4893H45.0748C45.9851 17.4893 46.4674 17.0958 46.4674 16.365C46.4674 15.6575 45.9851 15.2876 45.0974 15.2876H44.6585V17.4893ZM45.3485 14.1422C46.9918 14.1422 47.9339 14.9275 47.9339 16.2886C47.9339 17.4016 47.3429 18.1325 46.2695 18.3496L48.5695 21.4121H46.817L44.8447 18.4917H44.6587V21.4121H43.2353V14.1422H45.3485Z",fill:"#1D1D1B"}),Object(l.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M30.415 19.8859C31.5716 18.0862 31.0433 15.6953 29.235 14.5445C27.4267 13.3937 25.0236 13.9191 23.867 15.7188C22.7107 17.518 23.2391 19.9096 25.0474 21.0604C26.8557 22.2112 29.2587 21.6851 30.415 19.8859Z",fill:"url(#paint0_linear)"}),Object(l.createElement)("defs",null,Object(l.createElement)("linearGradient",{id:"paint0_linear",x1:"32.5088",y1:"16.6279",x2:"25.9795",y2:"12.4317",gradientUnits:"userSpaceOnUse"},Object(l.createElement)("stop",{stopColor:"#F6A000"}),Object(l.createElement)("stop",{offset:"0.623918",stopColor:"#E47E02"}),Object(l.createElement)("stop",{offset:"1",stopColor:"#D36002"})))),u=()=>Object(l.createElement)("svg",{width:"51",height:"35",viewBox:"0 0 51 35",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Object(l.createElement)("rect",{x:"0.878906",y:"0.5",width:"49",height:"34",rx:"3.5",fill:"white",stroke:"#F3F3F3"}),Object(l.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M33.473 17.5973H33.494H33.5346H33.5752H33.6158H33.6564H33.697H33.7376H33.7782H33.8188H33.8594H33.9H33.9406H33.9812H34.0218H34.0624H34.103H34.1436H34.1842H34.2248H34.2654H34.306H34.3466H34.3872H34.4278H34.4684H34.509H34.5496H34.5902H34.6308H34.6714H34.712H34.7527H34.7932H34.8338H34.8745H34.915H34.9556H34.9963H35.0368H35.0774H35.1181H35.1586H35.1992H35.2399H35.2805H35.321H35.3617H35.4023H35.4428H35.4835H35.5241H35.5646H35.6053H35.6459H35.6864H35.7271H35.7677H35.8083H35.8489H35.8895H35.9233L35.9301 17.5975C35.9426 17.5978 35.9563 17.5984 35.9707 17.5991C35.9837 17.5999 35.9973 17.6008 36.0113 17.6018C36.0246 17.6028 36.0383 17.604 36.0519 17.6052C36.0656 17.6065 36.0792 17.6079 36.0925 17.6093C36.1064 17.6109 36.1201 17.6126 36.1331 17.6143C36.1476 17.6163 36.1613 17.6183 36.1737 17.6205C36.1826 17.622 36.1909 17.6235 36.1982 17.6251L36.2143 17.6288C36.2279 17.632 36.2414 17.6354 36.2549 17.6392C36.2685 17.643 36.282 17.647 36.2955 17.6513C36.3091 17.6557 36.3227 17.6603 36.3361 17.6653C36.3497 17.6702 36.3632 17.6755 36.3767 17.681C36.3903 17.6866 36.4039 17.6926 36.4173 17.6987C36.431 17.705 36.4445 17.7116 36.4579 17.7185C36.4716 17.7254 36.4851 17.7328 36.4985 17.7403C36.5122 17.7481 36.5257 17.7562 36.5391 17.7646C36.5528 17.7732 36.5664 17.7821 36.5797 17.7913C36.5934 17.8008 36.607 17.8105 36.6203 17.8206C36.634 17.8311 36.6476 17.8419 36.6609 17.8531C36.6747 17.8646 36.6882 17.8766 36.7015 17.8889C36.7154 17.9017 36.7289 17.9148 36.7421 17.9284C36.7561 17.9426 36.7695 17.9574 36.7827 17.9725C36.7967 17.9885 36.8102 18.005 36.8233 18.0219C36.8374 18.0401 36.8509 18.0587 36.8639 18.0779C36.8781 18.0989 36.8917 18.1205 36.9045 18.1426C36.919 18.1675 36.9325 18.1932 36.9451 18.2196C36.96 18.2508 36.9736 18.283 36.9857 18.3161C37.002 18.3606 37.0156 18.4067 37.0263 18.4544C37.0449 18.5369 37.0549 18.6238 37.0549 18.7145C37.0549 18.8057 37.0449 18.893 37.0263 18.9758C37.0156 19.0235 37.002 19.0698 36.9857 19.1143C36.9736 19.1476 36.96 19.1798 36.9451 19.2111C36.9325 19.2375 36.919 19.2632 36.9045 19.2882C36.8917 19.3103 36.8782 19.3319 36.8639 19.3529C36.8509 19.3721 36.8374 19.3908 36.8233 19.409C36.8102 19.4259 36.7967 19.4423 36.7827 19.4584C36.7695 19.4734 36.756 19.4881 36.7421 19.5024C36.7289 19.516 36.7153 19.5291 36.7015 19.5419C36.6882 19.5541 36.6747 19.566 36.6609 19.5775C36.6476 19.5886 36.6341 19.5995 36.6203 19.6099C36.607 19.62 36.5934 19.6297 36.5797 19.6391C36.5664 19.6483 36.5528 19.6572 36.5391 19.6657C36.5257 19.674 36.5122 19.6821 36.4985 19.6898C36.4851 19.6974 36.4716 19.7046 36.4579 19.7116C36.4445 19.7184 36.431 19.7249 36.4173 19.7312C36.4039 19.7373 36.3903 19.7432 36.3767 19.7488C36.3632 19.7542 36.3497 19.7595 36.3361 19.7644C36.3227 19.7692 36.3091 19.7738 36.2955 19.7781C36.282 19.7824 36.2685 19.7863 36.2549 19.7901C36.2414 19.7937 36.2279 19.7971 36.2143 19.8003L36.1982 19.8039C36.1909 19.8056 36.1826 19.8073 36.1737 19.8089C36.1613 19.8111 36.1476 19.8132 36.1331 19.8152C36.1201 19.8169 36.1064 19.8186 36.0925 19.8202C36.0792 19.8217 36.0656 19.823 36.0519 19.8243C36.0383 19.8255 36.0246 19.8266 36.0113 19.8276C35.9973 19.8286 35.9837 19.8295 35.9707 19.8301C35.9563 19.8309 35.9426 19.8314 35.9301 19.8317L35.9083 19.832H35.8895H35.8489H35.8083H35.7677H35.7271H35.6864H35.6459H35.6053H35.5646H35.5241H35.4835H35.4428H35.4023H35.3617H35.321H35.2805H35.2399H35.1992H35.1586H35.1181H35.0774H35.0368H34.9963H34.9556H34.915H34.8745H34.8338H34.7932H34.7527H34.712H34.6714H34.6308H34.5902H34.5496H34.509H34.4684H34.4278H34.3872H34.3466H34.306H34.2654H34.2248H34.1842H34.1436H34.103H34.0624H34.0218H33.9812H33.9406H33.9H33.8594H33.8188H33.7782H33.7376H33.697H33.6564H33.6158H33.5752H33.5346H33.494H33.473V17.5973ZM36.7423 15.0681C36.7586 15.1431 36.7673 15.2226 36.7673 15.3062C36.7673 15.3898 36.7586 15.4691 36.7423 15.5441C36.7318 15.5923 36.7181 15.6385 36.7016 15.6829C36.6896 15.7153 36.676 15.7467 36.661 15.7769C36.6485 15.8023 36.6349 15.8269 36.6204 15.8508C36.6076 15.8718 36.594 15.8923 36.5798 15.9122C36.5668 15.9303 36.5533 15.9478 36.5392 15.9649C36.5261 15.9807 36.5126 15.9961 36.4986 16.011C36.4855 16.0251 36.472 16.0387 36.4581 16.0518C36.4448 16.0644 36.4313 16.0765 36.4174 16.0883C36.4042 16.0996 36.3906 16.1104 36.3768 16.121C36.3636 16.1311 36.35 16.1409 36.3363 16.1504C36.3229 16.1596 36.3094 16.1684 36.2956 16.1769C36.2823 16.1852 36.2687 16.1931 36.255 16.2007C36.2417 16.2082 36.2281 16.2154 36.2145 16.2222C36.2011 16.2289 36.1875 16.2353 36.1738 16.2415C36.1604 16.2475 36.1469 16.2532 36.1332 16.2586C36.1198 16.2639 36.1063 16.269 36.0926 16.2737C36.0792 16.2784 36.0657 16.2829 36.0521 16.287C36.0386 16.2911 36.0251 16.295 36.0114 16.2985C35.998 16.3021 35.9845 16.3053 35.9708 16.3083C35.9574 16.3113 35.9439 16.3139 35.9303 16.3164L35.9204 16.3182C35.9125 16.3195 35.902 16.3211 35.8896 16.3227C35.8777 16.3242 35.8639 16.3258 35.849 16.3273C35.8362 16.3286 35.8225 16.3299 35.8085 16.3311C35.7952 16.3322 35.7815 16.3332 35.7678 16.334C35.7542 16.3349 35.7405 16.3357 35.7272 16.3362C35.7132 16.3368 35.6995 16.3372 35.6867 16.3372L35.6802 16.3373H35.6461H35.6054H35.5648H35.5243H35.4836H35.443H35.4025H35.3619H35.3212H35.2807H35.2401H35.1994H35.1589H35.1183H35.0776H35.037H34.9965H34.9559H34.9152H34.8747H34.8341H34.7934H34.7529H34.7123H34.6716H34.6311H34.5905H34.5499H34.5092H34.4687H34.4281H34.3874H34.3469H34.3063H34.2657H34.2251H34.1845H34.1439H34.1033H34.0627H34.0221H33.9814H33.9409H33.9003H33.8597H33.8191H33.7785H33.7379H33.6973H33.6567H33.6161H33.5754H33.5349H33.4943H33.473V14.2751H33.4943H33.5349H33.5754H33.6161H33.6567H33.6973H33.7379H33.7785H33.8191H33.8597H33.9003H33.9409H33.9814H34.0221H34.0627H34.1033H34.1439H34.1845H34.2251H34.2657H34.3063H34.3469H34.3874H34.4281H34.4687H34.5092H34.5499H34.5905H34.6311H34.6716H34.7123H34.7529H34.7934H34.8341H34.8747H34.9152H34.9559H34.9965H35.037H35.0776H35.1183H35.1589H35.1994H35.2401H35.2807H35.3212H35.3619H35.4025H35.443H35.4836H35.5243H35.5648H35.6054H35.6461H35.6867H35.7037L35.7272 14.2759C35.7405 14.2764 35.7542 14.2772 35.7678 14.2781C35.7815 14.279 35.7952 14.28 35.8085 14.2811C35.8225 14.2822 35.8362 14.2835 35.849 14.2848C35.8639 14.2862 35.8777 14.2877 35.8896 14.2891C35.902 14.2905 35.9125 14.2919 35.9204 14.293L35.9303 14.2948C35.9439 14.2972 35.9574 14.3 35.9708 14.303C35.9845 14.306 35.998 14.3093 36.0114 14.3129C36.0251 14.3165 36.0386 14.3203 36.0521 14.3245C36.0657 14.3287 36.0792 14.3331 36.0926 14.3378C36.1063 14.3427 36.1198 14.3477 36.1332 14.3531C36.1469 14.3585 36.1604 14.3643 36.1738 14.3703C36.1875 14.3765 36.2011 14.3829 36.2145 14.3896C36.2281 14.3965 36.2417 14.4036 36.255 14.4111C36.2687 14.4187 36.2823 14.4267 36.2956 14.435C36.3094 14.4435 36.3229 14.4523 36.3363 14.4615C36.35 14.4709 36.3636 14.4808 36.3768 14.491C36.3906 14.5015 36.4042 14.5124 36.4174 14.5237C36.4313 14.5355 36.4448 14.5476 36.4581 14.5602C36.472 14.5733 36.4855 14.5869 36.4986 14.601C36.5126 14.6159 36.5261 14.6313 36.5392 14.6471C36.5533 14.6642 36.5668 14.6818 36.5798 14.6999C36.594 14.7197 36.6076 14.7402 36.6204 14.7613C36.6349 14.7851 36.6485 14.8097 36.661 14.8351C36.676 14.8654 36.6896 14.8968 36.7016 14.9292C36.7181 14.9736 36.7318 15.0199 36.7423 15.0681ZM41.7774 4.375H41.7941L41.794 25.5542C41.794 25.6807 41.7882 25.8059 41.7774 25.9296C41.7679 26.0385 41.7543 26.1462 41.7368 26.2526C41.725 26.324 41.7115 26.3948 41.6962 26.465C41.6838 26.5221 41.6703 26.5789 41.6556 26.6351C41.6429 26.6836 41.6293 26.7318 41.615 26.7796C41.602 26.8228 41.5886 26.8658 41.5744 26.9085C41.5614 26.9472 41.5478 26.9855 41.5338 27.0237C41.5207 27.0593 41.5071 27.0946 41.4932 27.1297C41.48 27.1627 41.4665 27.1954 41.4526 27.228C41.4394 27.2588 41.4258 27.2895 41.4119 27.3199C41.3987 27.3489 41.3852 27.3778 41.3714 27.4064C41.3581 27.4339 41.3446 27.4612 41.3307 27.4883C41.3175 27.5143 41.3039 27.5402 41.2901 27.5659C41.2769 27.5906 41.2632 27.615 41.2495 27.6394C41.2362 27.663 41.2227 27.6865 41.2089 27.7098C41.1956 27.7325 41.182 27.755 41.1683 27.7775C41.1549 27.7993 41.1414 27.8211 41.1277 27.8427C41.1144 27.8635 41.1007 27.8842 41.0871 27.9049C41.0737 27.9249 41.0601 27.9448 41.0465 27.9647C41.0331 27.9841 41.0195 28.0036 41.0058 28.0228C40.9924 28.0416 40.979 28.0603 40.9653 28.0789C40.9519 28.097 40.9383 28.1148 40.9246 28.1327C40.9112 28.1503 40.8977 28.1678 40.884 28.1852C40.8706 28.2022 40.8571 28.2191 40.8434 28.2359C40.83 28.2523 40.8164 28.2686 40.8028 28.2849C40.7893 28.3009 40.7759 28.3171 40.7622 28.3329C40.7488 28.3484 40.7352 28.3637 40.7216 28.379C40.7082 28.3941 40.6946 28.4091 40.681 28.424C40.6675 28.4387 40.6541 28.4534 40.6404 28.4679C40.627 28.4821 40.6134 28.4961 40.5998 28.5102C40.5863 28.5241 40.5729 28.5382 40.5592 28.5519C40.5458 28.5654 40.5321 28.5786 40.5186 28.5919C40.5051 28.605 40.4916 28.6182 40.4779 28.6313C40.4645 28.644 40.451 28.6567 40.4374 28.6693C40.4239 28.6818 40.4103 28.6942 40.3967 28.7065C40.3833 28.7187 40.3698 28.7308 40.3561 28.7428C40.3427 28.7546 40.3291 28.7664 40.3155 28.7781C40.302 28.7896 40.2886 28.8012 40.2749 28.8126C40.2615 28.8239 40.2479 28.8349 40.2343 28.846C40.2208 28.857 40.2073 28.8681 40.1937 28.8789C40.1803 28.8896 40.1667 28.9001 40.1531 28.9106C40.1396 28.9211 40.1261 28.9316 40.1125 28.942C40.0991 28.9521 40.0854 28.9621 40.0719 28.9721C40.0583 28.9821 40.0449 28.9921 40.0313 29.002C40.0178 29.0117 40.0042 29.0211 39.9907 29.0306C39.9771 29.0401 39.9637 29.0496 39.95 29.059C39.9366 29.0682 39.923 29.0772 39.9095 29.0862C39.896 29.0953 39.8825 29.1043 39.8688 29.1132C39.8554 29.122 39.8418 29.1306 39.8282 29.1392C39.8147 29.1477 39.8012 29.1563 39.7876 29.1647C39.7742 29.1731 39.7606 29.1813 39.747 29.1895L39.7064 29.2137C39.6929 29.2216 39.6794 29.2295 39.6658 29.2373C39.6524 29.2451 39.6388 29.2526 39.6252 29.2602C39.6117 29.2678 39.5982 29.2754 39.5846 29.2828C39.5711 29.2901 39.5575 29.2972 39.544 29.3044C39.5304 29.3115 39.517 29.3189 39.5034 29.326C39.4899 29.3329 39.4763 29.3395 39.4628 29.3463C39.4492 29.3531 39.4358 29.36 39.4221 29.3666C39.4087 29.3732 39.3951 29.3796 39.3816 29.3861L39.3409 29.4052L39.3003 29.4237C39.2868 29.4298 39.2733 29.4357 39.2597 29.4416C39.2462 29.4475 39.2327 29.4536 39.2191 29.4593C39.2057 29.4651 39.1921 29.4704 39.1785 29.476C39.165 29.4816 39.1515 29.4873 39.1379 29.4927C39.1244 29.4981 39.1109 29.5032 39.0973 29.5085C39.0838 29.5137 39.0703 29.5189 39.0567 29.524L39.0161 29.5391C39.0026 29.544 38.989 29.5487 38.9755 29.5535C38.9619 29.5583 38.9485 29.5632 38.9349 29.5679C38.9214 29.5724 38.9078 29.5767 38.8942 29.5811L38.8537 29.5944C38.8402 29.5987 38.8266 29.6028 38.813 29.607L38.7724 29.6192C38.7589 29.6232 38.7454 29.6273 38.7318 29.6311C38.7184 29.635 38.7048 29.6385 38.6912 29.6422C38.6777 29.6459 38.6642 29.6497 38.6506 29.6533L38.61 29.6636L38.5694 29.6735L38.5288 29.6833C38.5153 29.6864 38.5017 29.6892 38.4882 29.6922C38.4746 29.6952 38.4611 29.6983 38.4476 29.7011L38.407 29.7093L38.3663 29.7171C38.3528 29.7196 38.3393 29.7224 38.3257 29.7248C38.3123 29.7272 38.2987 29.7293 38.2851 29.7316L38.2445 29.7383L38.2039 29.7445L38.1633 29.7502C38.1498 29.7521 38.1363 29.7542 38.1227 29.7559C38.1092 29.7577 38.0956 29.759 38.0821 29.7606C38.0686 29.7622 38.0551 29.7638 38.0415 29.7653C38.028 29.7667 38.0145 29.7682 38.0009 29.7695C37.9874 29.7709 37.9738 29.772 37.9603 29.7732C37.9467 29.7744 37.9332 29.7757 37.9197 29.7768C37.9062 29.7778 37.8926 29.7787 37.8791 29.7796L37.8384 29.7822C37.8249 29.783 37.8114 29.784 37.7978 29.7847C37.7844 29.7854 37.7708 29.7857 37.7572 29.7863L37.7166 29.7878L37.676 29.7889C37.6625 29.7892 37.649 29.7892 37.6354 29.7894L37.5948 29.7899L37.5864 29.79H37.5542H37.5136H37.473H37.4324H37.3917H37.3512H37.3105H37.2699H37.2293H37.1887H37.1481H37.1075H37.0669H37.0263H36.9857H36.9451H36.9045H36.8638H36.8233H36.7826H36.742H36.7014H36.6608H36.6202H36.5796H36.539H36.4984H36.4578H36.4172H36.3766H36.3359H36.2954H36.2547H36.2141H36.1735H36.1329H36.0923H36.0517H36.0111H35.9705H35.9299H35.8893H35.8487H35.808H35.7675H35.7268H35.6862H35.6456H35.605H35.5644H35.5238H35.4832H35.4426H35.402H35.3614H35.3208H35.2801H35.2396H35.1989H35.1583H35.1177H35.0771H35.0365H34.9959H34.9553H34.9147H34.8741H34.8335H34.7929H34.7522H34.7117H34.671H34.6304H34.5898H34.5492H34.5086H34.468H34.4274H34.3868H34.3462H34.3056H34.265H34.2243H34.1838H34.1431H34.1025H34.0619H34.0213H33.9807H33.9401H33.8995H33.8589H33.8183H33.7777H33.7371H33.6964H33.6559H33.6152H33.5746H33.534H33.4934H33.4528H33.4122H33.3716H33.331H33.2904H33.2498H33.2092H33.1685H33.128H33.0873H33.0467H33.0061H32.9655H32.9249H32.8843H32.8437H32.8031H32.7625H32.7219H32.6813H32.6406H32.6H32.5594H32.5188H32.4782H32.4376H32.397H32.3564H32.3158H32.2752H32.2346H32.194H32.1534H32.1127H32.0721H32.0315H31.9909H31.9503H31.9097H31.8691H31.8285H31.7879H31.7473H31.7067H31.666H31.6255H31.5848H31.5442H31.5036H31.416V21.1545H31.5036H31.5442H31.5848H31.6255H31.666H31.7067H31.7473H31.7879H31.8285H31.8691H31.9097H31.9503H31.9909H32.0315H32.0721H32.1127H32.1534H32.194H32.2346H32.2752H32.3158H32.3564H32.397H32.4376H32.4782H32.5188H32.5594H32.6H32.6406H32.6813H32.7219H32.7625H32.8031H32.8437H32.8843H32.9249H32.9655H33.0061H33.0467H33.0873H33.128H33.1685H33.2092H33.2498H33.2904H33.331H33.3716H33.4122H33.4528H33.4934H33.534H33.5746H33.6152H33.6559H33.6964H33.7371H33.7777H33.8183H33.8589H33.8995H33.9401H33.9807H34.0213H34.0619H34.1025H34.1431H34.1838H34.2243H34.265H34.3056H34.3462H34.3868H34.4274H34.468H34.5086H34.5492H34.5898H34.6304H34.671H34.7117H34.7522H34.7929H34.8335H34.8741H34.9147H34.9553H34.9959H35.0365H35.0771H35.1177H35.1583H35.1989H35.2396H35.2801H35.3208H35.3614H35.402H35.4426H35.4832H35.5238H35.5644H35.605H35.6456H35.6862H35.7268H35.7675H35.808H35.8487H35.8893H35.9299H35.9705H36.0111H36.0517H36.0923H36.1329H36.1735H36.2141H36.2547H36.2954H36.3359H36.3766H36.4172H36.4578H36.4984H36.539H36.5796H36.6202H36.6608H36.7014H36.742H36.7826H36.8233H36.8638H36.9045H36.9451H36.9857H37.0263H37.0669H37.1075H37.1481H37.1887H37.2293H37.2699H37.3105H37.3512H37.3917H37.4324H37.473H37.5136H37.5542H37.5948H37.6354H37.676H37.7166H37.7572H37.7978H37.8384H37.8791H37.9197H37.9412L37.9603 21.1543L38.0009 21.154L38.0415 21.1532C38.0551 21.1528 38.0686 21.1526 38.0821 21.1521C38.0957 21.1517 38.1092 21.151 38.1227 21.1504L38.1633 21.1485L38.2039 21.146L38.2445 21.1432L38.2851 21.14L38.3257 21.1363C38.3393 21.135 38.3529 21.1337 38.3663 21.1323C38.3799 21.1309 38.3934 21.1293 38.407 21.1277L38.4476 21.1227C38.4611 21.1209 38.4747 21.1192 38.4882 21.1173C38.5018 21.1154 38.5153 21.1133 38.5288 21.1113C38.5424 21.1092 38.5559 21.1072 38.5694 21.105L38.61 21.0981L38.6506 21.0908C38.6642 21.0882 38.6778 21.0858 38.6912 21.0831C38.7048 21.0804 38.7183 21.0775 38.7318 21.0746L38.7724 21.0658C38.786 21.0627 38.7996 21.0597 38.813 21.0565C38.8267 21.0533 38.8402 21.0498 38.8537 21.0465C38.8672 21.0431 38.8808 21.0396 38.8942 21.0361C38.9078 21.0325 38.9214 21.0288 38.9349 21.0251C38.9485 21.0213 38.962 21.0174 38.9755 21.0134C38.9891 21.0095 39.0026 21.0054 39.0161 21.0013L39.0567 20.9885C39.0703 20.9841 39.0838 20.9796 39.0973 20.975C39.1109 20.9704 39.1245 20.9658 39.1379 20.961C39.1515 20.9562 39.1651 20.9514 39.1785 20.9464C39.1922 20.9413 39.2056 20.9361 39.2191 20.9308C39.2327 20.9256 39.2463 20.9202 39.2597 20.9147C39.2733 20.9092 39.2869 20.9037 39.3003 20.898C39.314 20.8923 39.3275 20.8864 39.3409 20.8804C39.3546 20.8744 39.3681 20.8682 39.3816 20.862C39.3951 20.8557 39.4087 20.8493 39.4221 20.8429C39.4357 20.8363 39.4493 20.8297 39.4628 20.823C39.4764 20.8161 39.4899 20.8091 39.5034 20.802C39.517 20.7949 39.5305 20.7875 39.544 20.7801C39.5576 20.7727 39.5712 20.7651 39.5846 20.7574C39.5982 20.7496 39.6118 20.7417 39.6252 20.7337C39.6388 20.7256 39.6524 20.7174 39.6658 20.709C39.6795 20.7004 39.693 20.6917 39.7064 20.683C39.7201 20.674 39.7336 20.6649 39.747 20.6558C39.7607 20.6464 39.7742 20.6369 39.7876 20.6274C39.8013 20.6176 39.8148 20.6077 39.8282 20.5976C39.8419 20.5874 39.8555 20.577 39.8688 20.5665C39.8825 20.5558 39.8961 20.5449 39.9095 20.5339C39.9232 20.5226 39.9367 20.5112 39.95 20.4996C39.9638 20.4878 39.9773 20.4757 39.9907 20.4636C40.0044 20.451 40.0179 20.4383 40.0313 20.4255C40.045 20.4123 40.0586 20.3989 40.0719 20.3854C40.0857 20.3714 40.0992 20.3572 40.1125 20.3428C40.1263 20.328 40.1398 20.3129 40.1531 20.2977C40.1669 20.2819 40.1805 20.2658 40.1937 20.2496C40.2075 20.2327 40.2211 20.2156 40.2343 20.1983C40.2481 20.1801 40.2618 20.1618 40.2749 20.1432C40.2889 20.1235 40.3023 20.1034 40.3155 20.0831C40.3295 20.0616 40.343 20.0399 40.3561 20.0179C40.3702 19.9942 40.3837 19.9701 40.3967 19.9458C40.4109 19.9193 40.4245 19.8926 40.4374 19.8654C40.4517 19.835 40.4652 19.8041 40.4779 19.7728C40.4926 19.7368 40.5061 19.7004 40.5186 19.6634C40.5338 19.6177 40.5473 19.5711 40.5592 19.5237C40.5765 19.4544 40.5901 19.3833 40.5998 19.3104C40.6116 19.222 40.6178 19.1312 40.6178 19.0378C40.6178 18.9469 40.6116 18.8586 40.5998 18.7728C40.5901 18.7024 40.5765 18.6337 40.5592 18.5668C40.5473 18.5213 40.5338 18.4766 40.5186 18.4327C40.5061 18.3968 40.4926 18.3613 40.4779 18.3266C40.4653 18.2964 40.4517 18.2667 40.4374 18.2375C40.4245 18.2112 40.4109 18.1853 40.3967 18.1598C40.3837 18.1363 40.3702 18.113 40.3561 18.0901C40.3431 18.0689 40.3295 18.0479 40.3155 18.0273C40.3024 18.0078 40.2889 17.9884 40.2749 17.9694C40.2618 17.9514 40.2482 17.9337 40.2343 17.9163C40.2211 17.8995 40.2075 17.883 40.1937 17.8667C40.1804 17.851 40.1669 17.8355 40.1531 17.8202C40.1398 17.8055 40.1263 17.791 40.1125 17.7767C40.0992 17.7628 40.0856 17.7492 40.0719 17.7357C40.0586 17.7226 40.045 17.7097 40.0313 17.697C40.0179 17.6846 40.0044 17.6724 39.9907 17.6604C39.9773 17.6486 39.9638 17.637 39.95 17.6255C39.9367 17.6143 39.9232 17.6033 39.9095 17.5924C39.8961 17.5817 39.8825 17.5712 39.8688 17.5608C39.8554 17.5507 39.8419 17.5407 39.8282 17.5307C39.8148 17.5211 39.8013 17.5115 39.7876 17.502C39.7742 17.4928 39.7607 17.4836 39.747 17.4745C39.7336 17.4657 39.7201 17.4569 39.7064 17.4482C39.693 17.4398 39.6795 17.4314 39.6658 17.4231C39.6524 17.415 39.6389 17.407 39.6252 17.3991C39.6118 17.3913 39.5982 17.3837 39.5846 17.3761C39.5712 17.3687 39.5576 17.3614 39.544 17.3541C39.5305 17.347 39.517 17.3399 39.5034 17.333C39.4899 17.3261 39.4764 17.3193 39.4628 17.3126C39.4493 17.3061 39.4358 17.2995 39.4221 17.2931C39.4087 17.2868 39.3951 17.2807 39.3816 17.2746C39.3681 17.2685 39.3546 17.2626 39.3409 17.2567C39.3275 17.251 39.3139 17.2453 39.3003 17.2396C39.2868 17.2341 39.2734 17.2285 39.2597 17.2231C39.2463 17.2178 39.2327 17.2126 39.2191 17.2074C39.2057 17.2023 39.1921 17.1974 39.1785 17.1925C39.165 17.1876 39.1515 17.1828 39.1379 17.1781C39.1244 17.1734 39.1109 17.1688 39.0973 17.1642C39.0838 17.1598 39.0703 17.1554 39.0567 17.1511C39.0432 17.1468 39.0296 17.1427 39.0161 17.1386L38.9755 17.1266C38.962 17.1227 38.9485 17.1188 38.9349 17.1151C38.9214 17.1114 38.9078 17.1078 38.8942 17.1043C38.8808 17.1008 38.8672 17.0974 38.8537 17.094C38.8402 17.0906 38.8266 17.0873 38.813 17.0841C38.7996 17.0809 38.786 17.0779 38.7724 17.0748C38.759 17.0718 38.7454 17.069 38.7318 17.0661C38.7183 17.0633 38.7048 17.0604 38.6912 17.0577L38.6506 17.0499L38.61 17.0426C38.5965 17.0403 38.583 17.0379 38.5694 17.0357L38.5288 17.0292C38.5153 17.0272 38.5017 17.0252 38.4882 17.0233L38.4476 17.0178L38.407 17.0126L38.3663 17.008L38.3257 17.0037L38.2851 16.9999L38.2445 16.9965L38.207 16.9936L38.207 16.9446L38.2445 16.9387L38.2851 16.932C38.2987 16.9296 38.3123 16.9273 38.3257 16.9248L38.3663 16.9169C38.38 16.9142 38.3935 16.9114 38.407 16.9085L38.4476 16.8996C38.4611 16.8965 38.4747 16.8934 38.4882 16.8902C38.5018 16.8869 38.5153 16.8834 38.5288 16.8799C38.5424 16.8764 38.5559 16.8728 38.5694 16.8691C38.583 16.8654 38.5965 16.8616 38.61 16.8577C38.6236 16.8538 38.6372 16.8498 38.6506 16.8457C38.6642 16.8416 38.6778 16.8373 38.6912 16.833C38.7049 16.8286 38.7184 16.824 38.7318 16.8195C38.7455 16.8148 38.759 16.81 38.7724 16.8052C38.7861 16.8003 38.7996 16.7954 38.813 16.7903C38.8267 16.7852 38.8402 16.7799 38.8537 16.7746C38.8673 16.7692 38.8808 16.7637 38.8942 16.7581C38.9079 16.7524 38.9214 16.7467 38.9349 16.7408C38.9485 16.7348 38.962 16.7287 38.9755 16.7225C38.9891 16.7162 39.0026 16.7098 39.0161 16.7033C39.0297 16.6967 39.0433 16.6899 39.0567 16.6831C39.0703 16.6761 39.0839 16.6691 39.0973 16.662C39.111 16.6547 39.1245 16.6472 39.1379 16.6398C39.1516 16.6321 39.1651 16.6243 39.1785 16.6165C39.1922 16.6084 39.2057 16.6003 39.2191 16.592C39.2328 16.5836 39.2463 16.575 39.2597 16.5664C39.2734 16.5575 39.2869 16.5485 39.3003 16.5394C39.314 16.53 39.3276 16.5206 39.3409 16.511C39.3547 16.5012 39.3682 16.4912 39.3816 16.4812C39.3953 16.4708 39.4088 16.4604 39.4221 16.4498C39.4359 16.4389 39.4494 16.4279 39.4628 16.4167C39.4765 16.4052 39.49 16.3935 39.5034 16.3817C39.5172 16.3695 39.5307 16.3571 39.544 16.3446C39.5577 16.3317 39.5713 16.3186 39.5846 16.3054C39.5984 16.2917 39.6119 16.2779 39.6252 16.2639C39.639 16.2493 39.6526 16.2345 39.6658 16.2195C39.6796 16.2039 39.6932 16.1881 39.7064 16.1721C39.7203 16.1554 39.7338 16.1385 39.747 16.1214C39.7609 16.1033 39.7745 16.085 39.7876 16.0665C39.8016 16.0469 39.8151 16.027 39.8282 16.007C39.8422 15.9856 39.8558 15.9639 39.8688 15.942C39.8829 15.9183 39.8965 15.8942 39.9095 15.8699C39.9237 15.8432 39.9372 15.8162 39.95 15.7888C39.9645 15.7581 39.978 15.7268 39.9907 15.6953C40.0054 15.6586 40.0189 15.6214 40.0313 15.5836C40.0467 15.5362 40.0603 15.488 40.0719 15.4393C40.0906 15.3601 40.1042 15.2793 40.1125 15.1971C40.1191 15.1322 40.1225 15.0665 40.1225 15.0001C40.1225 14.93 40.1191 14.8616 40.1125 14.795C40.1041 14.7098 40.0905 14.6275 40.0719 14.5481C40.0603 14.4985 40.0467 14.45 40.0313 14.4027C40.0189 14.3648 40.0054 14.3277 39.9907 14.2913C39.978 14.26 39.9644 14.2292 39.95 14.199C39.9372 14.172 39.9236 14.1455 39.9095 14.1194C39.8965 14.0955 39.8829 14.072 39.8688 14.0488C39.8557 14.0273 39.8422 14.0061 39.8282 13.9852C39.8151 13.9656 39.8015 13.9464 39.7876 13.9274C39.7745 13.9095 39.7609 13.8917 39.747 13.8743C39.7338 13.8576 39.7203 13.8411 39.7064 13.8249C39.6932 13.8095 39.6796 13.7943 39.6658 13.7793C39.6526 13.7649 39.639 13.7506 39.6252 13.7366C39.6119 13.723 39.5984 13.7097 39.5846 13.6965C39.5713 13.6837 39.5577 13.6711 39.544 13.6587C39.5307 13.6466 39.5171 13.6347 39.5034 13.623C39.49 13.6116 39.4765 13.6004 39.4628 13.5893C39.4494 13.5785 39.4359 13.5678 39.4221 13.5574C39.4088 13.5471 39.3952 13.5371 39.3816 13.5272C39.3682 13.5174 39.3546 13.5079 39.3409 13.4984C39.3275 13.4892 39.314 13.4801 39.3003 13.4711C39.2869 13.4623 39.2734 13.4537 39.2597 13.4451C39.2463 13.4367 39.2328 13.4285 39.2191 13.4204C39.2057 13.4124 39.1922 13.4045 39.1785 13.3968C39.1651 13.3891 39.1516 13.3816 39.1379 13.3742C39.1245 13.3669 39.111 13.3598 39.0973 13.3527C39.0839 13.3458 39.0703 13.339 39.0567 13.3322C39.0432 13.3256 39.0297 13.319 39.0161 13.3126C39.0026 13.3062 38.9891 13.2999 38.9755 13.2938C38.962 13.2878 38.9485 13.282 38.9349 13.2761C38.9214 13.2704 38.9078 13.2647 38.8942 13.2591C38.8808 13.2536 38.8672 13.2482 38.8537 13.2429C38.8402 13.2376 38.8267 13.2324 38.813 13.2273C38.7996 13.2223 38.7861 13.2174 38.7724 13.2126C38.759 13.2078 38.7454 13.2031 38.7318 13.1985C38.7184 13.194 38.7048 13.1895 38.6912 13.1852C38.6778 13.1808 38.6642 13.1766 38.6506 13.1724C38.6371 13.1683 38.6236 13.1641 38.61 13.1602C38.5965 13.1563 38.583 13.1525 38.5694 13.1488C38.5559 13.1451 38.5424 13.1415 38.5288 13.1379L38.4882 13.1275C38.4747 13.1242 38.4612 13.1209 38.4476 13.1177C38.4341 13.1145 38.4206 13.1115 38.407 13.1085L38.3663 13.0998C38.3528 13.097 38.3394 13.0941 38.3257 13.0915C38.3123 13.0888 38.2987 13.0864 38.2851 13.0839L38.2445 13.0767C38.231 13.0744 38.2175 13.0721 38.2039 13.0699L38.1633 13.0637L38.1227 13.0579L38.0821 13.0525L38.0415 13.0477L38.0009 13.0433L37.9603 13.0392L37.9197 13.0356L37.8791 13.0324L37.8384 13.0295L37.7978 13.0272L37.7817 13.0263L37.7572 13.0247L37.7166 13.0223L37.676 13.0201L37.6354 13.0179L37.5948 13.016L37.5542 13.0142L37.5136 13.0127L37.473 13.0114L37.4324 13.0105L37.3917 13.01L37.3694 13.0099H37.3512H37.3105H37.2699H37.2293H37.1887H37.1481H37.1075H37.0669H37.0263H36.9857H36.9451H36.9045H36.8638H36.8233H36.7826H36.742H36.7014H36.6608H36.6202H36.5796H36.539H36.4984H36.4578H36.4172H36.3766H36.3359H36.2954H36.2547H36.2141H36.1735H36.1329H36.0923H36.0517H36.0111H35.9705H35.9299H35.8893H35.8487H35.808H35.7675H35.7268H35.6862H35.6456H35.605H35.5644H35.5238H35.4832H35.4426H35.402H35.3614H35.3208H35.2801H35.2396H35.1989H35.1583H35.1177H35.0771H35.0365H34.9959H34.9553H34.9147H34.8741H34.8335H34.7929H34.7522H34.7117H34.671H34.6304H34.5898H34.5492H34.5086H34.468H34.4274H34.3868H34.3462H34.3056H34.265H34.2243H34.1838H34.1431H34.1025H34.0619H34.0213H33.9807H33.9401H33.8995H33.8589H33.8183H33.7777H33.7371H33.6964H33.6559H33.6152H33.5746H33.534H33.4934H33.4528H33.4122H33.3716H33.331H33.2904H33.2498H33.2092H33.1685H33.128H33.0873H33.0467H33.0061H32.9655H32.9249H32.8843H32.8437H32.8031H32.7625H32.7219H32.6813H32.6406H32.6H32.5594H32.5188H32.4782H32.4376H32.397H32.3564H32.3158H32.2752H32.2346H32.194H32.1534H32.1127H32.0721H32.0315H31.9909H31.9503H31.9097H31.8691H31.8285H31.7879H31.7473H31.7067H31.666H31.6255H31.5848H31.5442H31.5036H31.416V8.61119C31.416 8.31526 31.4463 8.02649 31.5036 7.74768C31.5159 7.68797 31.5295 7.62877 31.5442 7.57005C31.5569 7.5198 31.5705 7.46992 31.5848 7.42041C31.5977 7.37619 31.6112 7.33227 31.6255 7.28866C31.6385 7.24881 31.6519 7.20917 31.666 7.16986C31.6791 7.1334 31.6926 7.09714 31.7067 7.06115C31.7198 7.02754 31.7333 6.99409 31.7473 6.96092C31.7605 6.92961 31.774 6.89843 31.7879 6.8675C31.8011 6.83812 31.8147 6.80894 31.8285 6.77994C31.8417 6.75225 31.8553 6.72477 31.8691 6.69742C31.8824 6.67113 31.896 6.64504 31.9097 6.61905C31.923 6.594 31.9365 6.56913 31.9503 6.5444C31.9636 6.5204 31.9772 6.49662 31.9909 6.47293C32.0043 6.44996 32.0178 6.42708 32.0315 6.40441C32.0449 6.38242 32.0584 6.3606 32.0721 6.33888C32.0854 6.31784 32.0991 6.297 32.1127 6.27622C32.1261 6.25589 32.1396 6.23563 32.1534 6.21554C32.1668 6.19585 32.1802 6.17616 32.194 6.15671C32.2073 6.13787 32.2209 6.11927 32.2346 6.10066C32.2479 6.08236 32.2615 6.0642 32.2752 6.04614C32.2887 6.02835 32.3021 6.01049 32.3158 5.99294C32.3291 5.97586 32.3428 5.95905 32.3564 5.94218C32.3698 5.92554 32.3833 5.90904 32.397 5.89264C32.4105 5.87644 32.4239 5.86024 32.4376 5.84425C32.451 5.82866 32.4646 5.81335 32.4782 5.79796C32.4917 5.78271 32.5051 5.76743 32.5188 5.75239C32.5322 5.73765 32.5458 5.72304 32.5594 5.70847C32.5729 5.6941 32.5864 5.67984 32.6 5.66564C32.6135 5.65164 32.627 5.63765 32.6406 5.62382C32.6541 5.61024 32.6677 5.59685 32.6813 5.58347C32.6948 5.57015 32.7082 5.5567 32.7219 5.54358C32.7352 5.53074 32.7489 5.5182 32.7625 5.50553C32.776 5.49292 32.7894 5.48028 32.8031 5.46785C32.8165 5.45561 32.8301 5.44362 32.8437 5.43159C32.8572 5.41963 32.8707 5.40767 32.8843 5.39587C32.8978 5.38425 32.9113 5.3728 32.9249 5.36134C32.9384 5.34999 32.9519 5.33868 32.9655 5.32749C32.979 5.31641 32.9925 5.30547 33.0061 5.29459L33.0467 5.26243L33.0873 5.23112C33.1008 5.22085 33.1144 5.21066 33.128 5.20056C33.1414 5.19056 33.1549 5.1806 33.1685 5.17074L33.2092 5.1417C33.2226 5.13218 33.2362 5.12272 33.2498 5.11337L33.2904 5.08568L33.331 5.05875C33.3445 5.0499 33.358 5.04109 33.3716 5.03242L33.4122 5.00687C33.4257 4.99843 33.4392 4.98999 33.4528 4.98172C33.4663 4.97352 33.4799 4.96556 33.4934 4.95753C33.507 4.9495 33.5204 4.9414 33.534 4.93354C33.5474 4.92578 33.5611 4.91829 33.5746 4.91067C33.5882 4.90304 33.6016 4.89528 33.6152 4.88783C33.6287 4.88047 33.6423 4.87336 33.6559 4.86614C33.6694 4.85892 33.6828 4.85167 33.6964 4.84459C33.7099 4.83757 33.7235 4.83076 33.7371 4.82392C33.7506 4.81711 33.7641 4.81026 33.7777 4.80359L33.8183 4.78383C33.8318 4.77736 33.8453 4.77106 33.8589 4.76472C33.8724 4.75842 33.8859 4.75201 33.8995 4.74585C33.913 4.73975 33.9266 4.73392 33.9401 4.72795C33.9536 4.72199 33.9671 4.71592 33.9807 4.7101C33.9942 4.70434 34.0078 4.69885 34.0213 4.69322C34.0348 4.68763 34.0483 4.68197 34.0619 4.67651L34.1025 4.66042L34.1431 4.64487C34.1567 4.63972 34.1702 4.6345 34.1838 4.62952C34.1972 4.62457 34.2108 4.61993 34.2243 4.61511C34.2379 4.6103 34.2514 4.60539 34.265 4.60071C34.2784 4.59607 34.292 4.5917 34.3056 4.58719L34.3462 4.57394C34.3597 4.56961 34.3732 4.56523 34.3868 4.56103C34.4003 4.55686 34.4139 4.55293 34.4274 4.5489C34.4409 4.54484 34.4544 4.54063 34.468 4.53674C34.4815 4.53287 34.4951 4.52928 34.5086 4.52555C34.5221 4.52183 34.5356 4.51807 34.5492 4.51447L34.5898 4.5039C34.6033 4.50048 34.6169 4.49723 34.6304 4.49394C34.644 4.49065 34.6574 4.48713 34.671 4.48398C34.6845 4.48086 34.6981 4.47801 34.7117 4.475L34.7522 4.46608L34.7929 4.45765C34.8063 4.45494 34.8199 4.45239 34.8335 4.44982C34.847 4.44721 34.8605 4.44443 34.8741 4.44196C34.8876 4.43948 34.9012 4.43738 34.9147 4.43508L34.9553 4.4283C34.9688 4.42613 34.9824 4.4239 34.9959 4.42186C35.0094 4.41983 35.023 4.41803 35.0365 4.41614C35.0501 4.41424 35.0635 4.41217 35.0771 4.41041C35.0906 4.40865 35.1042 4.40709 35.1177 4.40546L35.1583 4.40079C35.1719 4.3993 35.1854 4.39764 35.1989 4.39628C35.2124 4.39492 35.226 4.39387 35.2396 4.39265L35.2801 4.38903L35.3208 4.38595C35.3343 4.38496 35.3478 4.38418 35.3614 4.38334C35.3749 4.38252 35.3884 4.38147 35.402 4.38076C35.4155 4.38005 35.4291 4.37964 35.4426 4.37907L35.4832 4.37754C35.4968 4.3771 35.5103 4.37652 35.5238 4.37622C35.5373 4.37591 35.5509 4.37588 35.5644 4.37568C35.5779 4.37547 35.5915 4.37524 35.605 4.37517L35.6152 4.37503H35.6456H35.6862H35.7268H35.7675H35.808H35.8487H35.8893H35.9299H35.9705H36.0111H36.0517H36.0923H36.1329H36.1735H36.2141H36.2547H36.2954H36.3359H36.3766H36.4172H36.4578H36.4984H36.539H36.5796H36.6202H36.6608H36.7014H36.742H36.7826H36.8233H36.8638H36.9045H36.9451H36.9857H37.0263H37.0669H37.1075H37.1481H37.1887H37.2293H37.2699H37.3105H37.3512H37.3917H37.4324H37.473H37.5136H37.5542H37.5948H37.6354H37.676H37.7166H37.7572H37.7978H37.8384H37.8791H37.9197H37.9603H38.0009H38.0415H38.0821H38.1227H38.1633H38.2039H38.2445H38.2851H38.3257H38.3663H38.407H38.4476H38.4882H38.5288H38.5694H38.61H38.6506H38.6912H38.7318H38.7724H38.813H38.8537H38.8942H38.9349H38.9755H39.0161H39.0567H39.0973H39.1379H39.1785H39.2191H39.2597H39.3003H39.3409H39.3816H39.4221H39.4628H39.5034H39.544H39.5846H39.6252H39.6658H39.7064H39.747H39.7876H39.8282H39.8688H39.9095H39.95H39.9907H40.0313H40.0719H40.1125H40.1531H40.1937H40.2343H40.2749H40.3155H40.3561H40.3967H40.4374H40.4779H40.5186H40.5592H40.5998H40.6404H40.681H40.7216H40.7622H40.8028H40.8434H40.884H40.9246H40.9653H41.0058H41.0465H41.0871H41.1277H41.1683H41.2089H41.2495H41.2901H41.3307H41.3714H41.4119H41.4526H41.4932H41.5338H41.5744H41.615H41.6556H41.6962H41.7368H41.7774V4.375Z",fill:"#54B230"}),Object(l.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8.1377 19.0723V8.61115C8.1377 8.31608 8.16772 8.02805 8.22476 7.74998C8.23702 7.69027 8.25061 7.63111 8.26532 7.57235C8.27791 7.52203 8.29147 7.47212 8.30584 7.42254C8.31867 7.37836 8.3322 7.33451 8.34637 7.29093C8.35936 7.25105 8.37279 7.21133 8.38692 7.17196C8.40001 7.13553 8.41341 7.09931 8.42744 7.06336C8.44054 7.02974 8.45407 6.99623 8.468 6.96302C8.48116 6.93171 8.49466 6.9006 8.50852 6.8697C8.52172 6.84032 8.53525 6.81118 8.54904 6.78217C8.56224 6.75445 8.57583 6.72694 8.5896 6.69956C8.60283 6.67326 8.61636 6.64717 8.63012 6.62121C8.64338 6.59617 8.65691 6.5713 8.67064 6.54656C8.68394 6.52261 8.69744 6.49879 8.7112 6.47513C8.72453 6.45216 8.73796 6.42925 8.75172 6.40655C8.76505 6.38459 8.77858 6.3628 8.79228 6.34112C8.80554 6.32011 8.81917 6.29923 8.8328 6.27846C8.84616 6.25813 8.85963 6.23787 8.87332 6.21777C8.88679 6.19805 8.90011 6.17836 8.91388 6.15888C8.92717 6.14007 8.94081 6.1215 8.9544 6.1029C8.9678 6.0846 8.98129 6.06644 8.99496 6.04838C9.00839 6.03062 9.02178 6.01273 9.03548 5.99518C9.04881 5.97813 9.06244 5.96136 9.076 5.94452C9.0894 5.92788 9.10289 5.91131 9.11656 5.89487C9.12999 5.87871 9.14342 5.86258 9.15708 5.84662C9.17044 5.831 9.18404 5.81565 9.19764 5.80023C9.21107 5.78495 9.2245 5.7697 9.23816 5.75466C9.25152 5.73992 9.26512 5.72538 9.27868 5.71084C9.29211 5.69644 9.30561 5.68217 9.31924 5.66798C9.33267 5.65398 9.34613 5.63999 9.35976 5.62616C9.37316 5.61257 9.38675 5.59919 9.40032 5.5858C9.41381 5.57249 9.42717 5.55907 9.44084 5.54595C9.4542 5.53311 9.46783 5.52057 9.48136 5.5079C9.49486 5.49526 9.50825 5.48259 9.52192 5.47015C9.53531 5.45795 9.54891 5.44599 9.56244 5.43396C9.57594 5.422 9.58936 5.41 9.603 5.39821C9.61642 5.38659 9.62995 5.37517 9.64352 5.36372C9.65695 5.35237 9.67044 5.34101 9.68404 5.32983C9.69747 5.31878 9.71103 5.30784 9.7246 5.29693C9.73806 5.28612 9.75152 5.27541 9.76512 5.26477C9.77855 5.25423 9.79211 5.24383 9.80567 5.23346C9.81914 5.22319 9.83263 5.21296 9.8462 5.20286L9.88672 5.17311C9.90018 5.16332 9.91368 5.15359 9.92728 5.14397C9.9407 5.13445 9.95423 5.12503 9.9678 5.11567C9.98126 5.10635 9.99476 5.0971 10.0083 5.08795C10.0218 5.07891 10.0353 5.07 10.0489 5.06108C10.0623 5.05224 10.0758 5.04333 10.0894 5.03462C10.1028 5.02601 10.1164 5.01761 10.13 5.00914C10.1435 5.0007 10.1569 4.99216 10.1705 4.98389C10.1839 4.97573 10.1975 4.9678 10.211 4.95977C10.2245 4.95173 10.2379 4.94357 10.2516 4.93567C10.265 4.92791 10.2786 4.92049 10.2921 4.91287C10.3056 4.90524 10.319 4.89752 10.3326 4.89003C10.3461 4.88264 10.3596 4.87553 10.3732 4.86831C10.3867 4.86109 10.4001 4.85384 10.4137 4.84676C10.4271 4.83974 10.4407 4.83286 10.4542 4.82598L10.4948 4.80572C10.5083 4.79905 10.5217 4.79237 10.5353 4.78586C10.5488 4.77939 10.5623 4.77312 10.5758 4.76679C10.5894 4.76045 10.6028 4.75398 10.6164 4.74781C10.6298 4.74168 10.6434 4.73592 10.6569 4.72995C10.6704 4.72399 10.6839 4.71792 10.6974 4.71209C10.7109 4.70633 10.7245 4.70078 10.738 4.69515L10.7785 4.67848L10.819 4.66228L10.8596 4.64676C10.8731 4.64161 10.8865 4.63629 10.9001 4.63128C10.9135 4.62633 10.9272 4.62172 10.9407 4.61691C10.9542 4.6121 10.9676 4.60722 10.9812 4.60254L11.0217 4.58889L11.0623 4.57564C11.0758 4.5713 11.0892 4.56686 11.1028 4.56266C11.1162 4.55849 11.1298 4.55453 11.1433 4.55049C11.1568 4.54643 11.1703 4.54229 11.1839 4.53836C11.1973 4.53447 11.2109 4.53084 11.2244 4.52708L11.265 4.516C11.2784 4.51241 11.2919 4.50875 11.3055 4.50529C11.3189 4.50183 11.3325 4.49868 11.346 4.49536C11.3595 4.49204 11.373 4.48858 11.3866 4.4854C11.4 4.48225 11.4136 4.4793 11.4271 4.47628L11.4676 4.46741C11.4811 4.46449 11.4946 4.46154 11.5082 4.4588C11.5216 4.45609 11.5352 4.45358 11.5487 4.45097C11.5622 4.44836 11.5757 4.44565 11.5892 4.44318C11.6027 4.4407 11.6162 4.43847 11.6298 4.43613L11.6703 4.42935C11.6838 4.42718 11.6973 4.42485 11.7108 4.42278C11.7243 4.42071 11.7379 4.41898 11.7514 4.41705C11.7648 4.41515 11.7783 4.41312 11.7919 4.41133L11.8324 4.40621L11.873 4.40157C11.8865 4.40004 11.8999 4.39828 11.9135 4.39689C11.927 4.3955 11.9405 4.39448 11.954 4.39323L11.9946 4.38964C12.0081 4.38849 12.0216 4.38737 12.0351 4.38639C12.0486 4.3854 12.0621 4.38462 12.0757 4.38378C12.0892 4.38293 12.1027 4.38195 12.1162 4.3812C12.1297 4.38046 12.1432 4.37995 12.1567 4.37934L12.1973 4.37778C12.2108 4.3773 12.2242 4.37659 12.2378 4.37625C12.2513 4.37591 12.2648 4.37595 12.2783 4.37575C12.2918 4.37554 12.3053 4.3753 12.3189 4.37524L12.3594 4.375H12.3999H12.4405H12.481H12.5215H12.5621H12.6026H12.6431H12.6837H12.7242H12.7647H12.8053H12.8458H12.8863H12.9269H12.9674H13.008H13.0485H13.089H13.1296H13.1701H13.2107H13.2512H13.2917H13.3323H13.3728H13.4133H13.4539H13.4944H13.5349H13.5755H13.616H13.6565H13.6971H13.7376H13.7781H13.8187H13.8592H13.8997H13.9403H13.9808H14.0213H14.0619H14.1024H14.143H14.1835H14.224H14.2646H14.3051H14.3457H14.3862H14.4267H14.4673H14.5078H14.5483H14.5889H14.6294H14.6699H14.7105H14.751H14.7915H14.8321H14.8726H14.9131H14.9537H14.9942H15.0347H15.0753H15.1158H15.1563H15.1969H15.2374H15.278H15.3185H15.359H15.3996H15.4401H15.4807H15.5212H15.5617H15.6023H15.6428H15.6833H15.7239H15.7644H15.8049H15.8455H15.886H15.9265H15.9671H16.0076H16.0481H16.0887H16.1292H16.1697H16.2103H16.2508H16.2914H16.3319H16.3724H16.413H16.4535H16.494H16.5346H16.5751H16.6157H16.6562H16.6967H16.7373H16.7778H16.8183H16.8589H16.8994H16.9399H16.9805H17.021H17.0615H17.1021H17.1426H17.1831H17.2237H17.2642H17.3047H17.3453H17.3858H17.4264H17.4669H17.5074H17.548H17.5885H17.629H17.6696H17.7101H17.7506H17.7912H17.8317H17.8722H17.9128H17.9533H17.9938H18.0344H18.0749H18.1154H18.156H18.1965H18.237H18.2776H18.3181H18.3586H18.3992H18.4397H18.4803H18.5147V25.5542C18.5147 25.7384 18.5029 25.9199 18.4803 26.098C18.4694 26.1837 18.4556 26.2685 18.4397 26.3525C18.4276 26.4165 18.4141 26.4799 18.3992 26.5427C18.3866 26.5957 18.3732 26.6483 18.3586 26.7005C18.3459 26.7463 18.3323 26.7917 18.3181 26.8368C18.3052 26.8777 18.2917 26.9182 18.2776 26.9586C18.2646 26.9959 18.2511 27.033 18.237 27.0698C18.224 27.1042 18.2105 27.1384 18.1965 27.1723C18.1834 27.2043 18.1699 27.2361 18.156 27.2676C18.1428 27.2976 18.1293 27.3273 18.1154 27.357C18.1023 27.3852 18.0887 27.4132 18.0749 27.4411C18.0617 27.4679 18.0482 27.4945 18.0344 27.5209C18.0211 27.5463 18.0076 27.5717 17.9938 27.5968C17.9805 27.6211 17.9671 27.6454 17.9533 27.6694C17.94 27.6926 17.9265 27.7156 17.9128 27.7385C17.8995 27.7607 17.8859 27.7826 17.8722 27.8045C17.8589 27.8259 17.8454 27.8471 17.8317 27.8682C17.8183 27.8889 17.8049 27.9095 17.7912 27.9298C17.7778 27.9496 17.7643 27.9692 17.7506 27.9887C17.7373 28.0078 17.7238 28.0267 17.7101 28.0456C17.6967 28.0641 17.6832 28.0826 17.6696 28.1009C17.6562 28.1188 17.6427 28.1365 17.629 28.1542C17.6157 28.1714 17.6021 28.1885 17.5885 28.2056C17.5751 28.2224 17.5616 28.2392 17.548 28.2558C17.5346 28.2721 17.521 28.2881 17.5074 28.3041C17.494 28.3199 17.4805 28.3356 17.4669 28.3512C17.4534 28.3665 17.44 28.382 17.4264 28.3972C17.413 28.412 17.3994 28.4266 17.3858 28.4413C17.3723 28.4558 17.359 28.4704 17.3453 28.4847C17.3319 28.4988 17.3183 28.5126 17.3047 28.5265C17.2913 28.5402 17.2778 28.5539 17.2642 28.5674C17.2508 28.5808 17.2373 28.5941 17.2237 28.6073C17.2103 28.6203 17.1967 28.6331 17.1831 28.6459C17.1697 28.6586 17.1562 28.6713 17.1426 28.6839C17.1292 28.6962 17.1156 28.7082 17.1021 28.7204C17.0886 28.7325 17.0752 28.7447 17.0615 28.7566C17.0482 28.7682 17.0345 28.7796 17.021 28.7911C17.0075 28.8026 16.9941 28.8142 16.9805 28.8255C16.9671 28.8366 16.9535 28.8475 16.9399 28.8584C16.9264 28.8693 16.913 28.8803 16.8994 28.8911C16.886 28.9016 16.8724 28.9119 16.8589 28.9223C16.8454 28.9327 16.832 28.9431 16.8183 28.9533C16.8049 28.9634 16.7913 28.9732 16.7778 28.9831C16.7643 28.993 16.7509 29.003 16.7373 29.0127C16.7239 29.0222 16.7103 29.0316 16.6967 29.041C16.6832 29.0504 16.6698 29.0599 16.6562 29.0692C16.6428 29.0782 16.6292 29.0871 16.6157 29.096C16.6021 29.105 16.5887 29.1141 16.5751 29.1229C16.5617 29.1315 16.5481 29.1398 16.5346 29.1484C16.5211 29.1569 16.5076 29.1655 16.494 29.1738C16.4806 29.1821 16.467 29.1901 16.4535 29.1981C16.44 29.2062 16.4266 29.2143 16.413 29.2223C16.3995 29.2301 16.386 29.2377 16.3724 29.2454C16.359 29.2531 16.3455 29.2608 16.3319 29.2682C16.3184 29.2757 16.3049 29.2831 16.2914 29.2904L16.2508 29.3119C16.2373 29.319 16.2239 29.3261 16.2103 29.333C16.1968 29.3399 16.1833 29.3466 16.1697 29.3533C16.1562 29.36 16.1428 29.367 16.1292 29.3735C16.1158 29.38 16.1022 29.3862 16.0887 29.3926C16.0752 29.399 16.0617 29.4054 16.0481 29.4117C16.0347 29.4178 16.0211 29.4237 16.0076 29.4298L15.9671 29.4476L15.9265 29.4649C15.9131 29.4706 15.8995 29.4761 15.886 29.4816C15.8725 29.4871 15.859 29.4928 15.8455 29.4982C15.832 29.5035 15.8185 29.5085 15.8049 29.5136C15.7914 29.5188 15.778 29.5241 15.7644 29.5292C15.7509 29.5342 15.7374 29.539 15.7239 29.5438L15.6833 29.5582L15.6428 29.5722C15.6293 29.5767 15.6158 29.5811 15.6023 29.5854C15.5887 29.5899 15.5753 29.5944 15.5617 29.5987C15.5483 29.6029 15.5347 29.6068 15.5212 29.6109L15.4807 29.6231L15.4401 29.6347C15.4266 29.6385 15.4131 29.6421 15.3996 29.6457C15.386 29.6494 15.3726 29.6533 15.359 29.6567C15.3456 29.6602 15.332 29.6633 15.3185 29.6667C15.305 29.6701 15.2915 29.6734 15.278 29.6767L15.2374 29.6861L15.1969 29.695C15.1834 29.6979 15.1699 29.7011 15.1563 29.7039C15.1429 29.7067 15.1293 29.709 15.1158 29.7117C15.1023 29.7143 15.0888 29.717 15.0753 29.7195L15.0347 29.7269C15.0213 29.7292 15.0077 29.7314 14.9942 29.7336C14.9807 29.7358 14.9672 29.7383 14.9537 29.7404C14.9402 29.7425 14.9267 29.7442 14.9131 29.7462L14.8726 29.7519C14.8591 29.7538 14.8456 29.7556 14.8321 29.7573C14.8186 29.759 14.805 29.7604 14.7915 29.762C14.778 29.7635 14.7645 29.7652 14.751 29.7667C14.7375 29.7681 14.724 29.7693 14.7105 29.7706L14.6699 29.7742C14.6564 29.7754 14.6429 29.7768 14.6294 29.7778C14.6159 29.7788 14.6024 29.7795 14.5889 29.7804L14.5483 29.783L14.5078 29.7851C14.4943 29.7858 14.4808 29.7862 14.4673 29.7867C14.4537 29.7872 14.4402 29.7878 14.4267 29.7883C14.4132 29.7886 14.3997 29.7888 14.3862 29.789L14.3457 29.7895C14.3331 29.7896 14.3207 29.79 14.3081 29.79H14.2646H14.224H14.1835H14.143H14.1024H14.0619H14.0213H13.9808H13.9403H13.8997H13.8592H13.8187H13.7781H13.7376H13.6971H13.6565H13.616H13.5755H13.5349H13.4944H13.4539H13.4133H13.3728H13.3323H13.2917H13.2512H13.2107H13.1701H13.1296H13.089H13.0485H13.008H12.9674H12.9269H12.8863H12.8458H12.8053H12.7647H12.7242H12.6837H12.6431H12.6026H12.5621H12.5215H12.481H12.4405H12.3999H12.3594H12.3189H12.2783H12.2378H12.1973H12.1567H12.1162H12.0757H12.0351H11.9946H11.954H11.9135H11.873H11.8324H11.7919H11.7514H11.7108H11.6703H11.6298H11.5892H11.5487H11.5082H11.4676H11.4271H11.3866H11.346H11.3055H11.265H11.2244H11.1839H11.1433H11.1028H11.0623H11.0217H10.9812H10.9407H10.9001H10.8596H10.819H10.7785H10.738H10.6974H10.6569H10.6164H10.5758H10.5353H10.4948H10.4542H10.4137H10.3732H10.3326H10.2921H10.2516H10.211H10.1705H10.13H10.0894H10.0489H10.0083H9.9678H9.92728H9.88672H9.8462H9.80567H9.76512H9.7246H9.68404H9.64352H9.603H9.56244H9.52192H9.48136H9.44084H9.40032H9.35976H9.31924H9.27868H9.23816H9.19764H9.15708H9.11656H9.076H9.03548H8.99496H8.9544H8.91388H8.87332H8.8328H8.79228H8.75172H8.7112H8.67064H8.63012H8.5896H8.54904H8.50852H8.468H8.42744H8.38692H8.34637H8.30584H8.26532H8.22476H8.1377V20.8632C8.1377 20.8632 8.16765 20.8715 8.22476 20.886L8.26532 20.8962L8.30584 20.9062L8.34637 20.916L8.38692 20.9256L8.42744 20.9351L8.468 20.9445L8.50852 20.9537L8.54904 20.9628L8.5896 20.9717L8.63012 20.9805L8.67064 20.9893L8.7112 20.9979L8.75172 21.0064L8.79228 21.0147L8.8328 21.023L8.87332 21.0311L8.91388 21.0392L8.9544 21.0471L8.99496 21.055L9.03548 21.0628L9.076 21.0704L9.11656 21.078L9.15708 21.0854L9.19764 21.0928L9.23816 21.1001L9.27868 21.1072L9.31924 21.1143L9.35976 21.1212L9.40032 21.1281L9.44084 21.1349L9.48136 21.1416L9.52192 21.1482L9.56244 21.1547L9.603 21.1612L9.64352 21.1675L9.68404 21.1738L9.7246 21.1799L9.76512 21.186L9.80567 21.1919L9.8462 21.1978L9.88672 21.2036L9.92728 21.2093L9.9678 21.2149L10.0083 21.2205L10.0489 21.2259L10.0894 21.2313L10.13 21.2366L10.1705 21.2417L10.211 21.2468L10.2516 21.2518L10.2921 21.2568L10.3326 21.2615L10.3732 21.2663L10.4137 21.2709L10.4542 21.2755L10.4948 21.28L10.5353 21.2844L10.5758 21.2887L10.6164 21.2929L10.6569 21.297L10.6974 21.301L10.738 21.305L10.7785 21.3089L10.819 21.3126L10.8596 21.3164L10.9001 21.3199L10.9407 21.3234L10.9812 21.3269L11.0217 21.3302L11.0623 21.3335L11.1028 21.3366L11.1433 21.3397L11.1839 21.3426L11.2244 21.3455L11.265 21.3483L11.3055 21.351L11.346 21.3536L11.3866 21.3562L11.4271 21.3586L11.4676 21.361L11.5082 21.3632L11.5487 21.3654L11.5892 21.3675L11.6298 21.3694L11.6703 21.3713L11.7108 21.3731L11.7514 21.3748L11.7919 21.3765L11.8324 21.3779L11.873 21.3793L11.9135 21.3807L11.954 21.3819L11.9946 21.3831L12.0351 21.3841L12.0757 21.385L12.1162 21.386L12.1567 21.3867L12.1973 21.3873L12.2378 21.388L12.2783 21.3884L12.3189 21.3888L12.3594 21.3891L12.3999 21.3892L12.4405 21.3893L12.481 21.3893L12.5215 21.389L12.5621 21.3888L12.6026 21.3885L12.6431 21.3883L12.6837 21.3875L12.7242 21.3868L12.7647 21.3861L12.8053 21.3853L12.8458 21.3843L12.8863 21.383L12.9269 21.3818L12.9674 21.3805L13.008 21.3791L13.0485 21.3773L13.089 21.3756L13.1296 21.3737L13.1701 21.3719L13.2107 21.3697L13.2512 21.3673L13.2917 21.3649L13.3323 21.3626L13.3728 21.3599L13.4133 21.3569L13.4539 21.354L13.4944 21.3511L13.5349 21.3478L13.5755 21.3443L13.616 21.3408L13.6565 21.3372L13.6971 21.3334L13.7376 21.3292L13.7781 21.3251L13.8187 21.3209L13.8592 21.3164L13.8997 21.3116L13.9403 21.3068L13.9808 21.302L14.0213 21.2967L14.0619 21.2912L14.1024 21.2858L14.143 21.2802C14.1566 21.2782 14.1699 21.2761 14.1835 21.2741L14.224 21.2679L14.2646 21.2618L14.3051 21.2553C14.3187 21.2531 14.3321 21.2507 14.3457 21.2484L14.3862 21.2416C14.3996 21.2393 14.4134 21.2371 14.4267 21.2347C14.4404 21.2323 14.4537 21.2296 14.4673 21.2271L14.5078 21.2195L14.5483 21.2119L14.5889 21.2039C14.6025 21.2012 14.6159 21.1983 14.6294 21.1955L14.6699 21.1871L14.7105 21.1785C14.7242 21.1756 14.7374 21.1724 14.751 21.1694L14.7915 21.1601C14.805 21.157 14.8187 21.1541 14.8321 21.151C14.8458 21.1477 14.8591 21.1443 14.8726 21.141L14.9131 21.1309C14.9266 21.1276 14.9403 21.1243 14.9537 21.1209C14.9673 21.1174 14.9807 21.1138 14.9942 21.1102L15.0347 21.0993C15.0482 21.0956 15.0619 21.0921 15.0753 21.0883C15.0889 21.0846 15.1023 21.0806 15.1158 21.0768L15.1563 21.065C15.1698 21.061 15.1835 21.0571 15.1969 21.0531L15.2374 21.0406L15.278 21.0278C15.2914 21.0235 15.3052 21.0193 15.3185 21.015L15.359 21.0014L15.3996 20.9876C15.413 20.9829 15.4268 20.9784 15.4401 20.9737C15.4538 20.9689 15.4671 20.9638 15.4807 20.9589L15.5212 20.9441C15.5347 20.939 15.5483 20.9341 15.5617 20.9289C15.5754 20.9237 15.5887 20.9183 15.6023 20.913C15.6158 20.9077 15.6294 20.9024 15.6428 20.897L15.6833 20.8804L15.7239 20.8632C15.7373 20.8575 15.7511 20.852 15.7644 20.8461C15.7781 20.8401 15.7914 20.8339 15.8049 20.8278L15.8455 20.8094L15.886 20.7904C15.8996 20.784 15.9131 20.7774 15.9265 20.7708C15.94 20.7642 15.9538 20.7577 15.9671 20.751C15.9808 20.7441 15.9941 20.737 16.0076 20.73C16.0211 20.723 16.0348 20.7161 16.0481 20.7091C16.0618 20.7018 16.0752 20.6944 16.0887 20.687C16.1023 20.6796 16.1158 20.6721 16.1292 20.6646C16.1428 20.6569 16.1563 20.6492 16.1697 20.6415C16.1834 20.6336 16.1969 20.6255 16.2103 20.6175C16.2239 20.6094 16.2375 20.6013 16.2508 20.5931C16.2645 20.5847 16.2779 20.5761 16.2914 20.5676C16.3049 20.559 16.3186 20.5504 16.3319 20.5417C16.3456 20.5328 16.359 20.5236 16.3724 20.5145C16.386 20.5053 16.3996 20.4963 16.413 20.487C16.4267 20.4774 16.44 20.4677 16.4535 20.458C16.4671 20.4482 16.4807 20.4384 16.494 20.4286C16.5077 20.4184 16.5211 20.408 16.5346 20.3977C16.5482 20.3872 16.5618 20.3767 16.5751 20.3661C16.5888 20.3552 16.6023 20.3442 16.6157 20.3331C16.6293 20.3218 16.6428 20.3104 16.6562 20.299C16.6698 20.2873 16.6834 20.2757 16.6967 20.2639C16.7105 20.2517 16.7238 20.2393 16.7373 20.2269C16.7508 20.2144 16.7645 20.2019 16.7778 20.1892C16.7915 20.176 16.805 20.1627 16.8183 20.1493C16.832 20.1356 16.8455 20.1218 16.8589 20.108C16.8725 20.0938 16.8861 20.0797 16.8994 20.0653C16.9132 20.0503 16.9265 20.0351 16.9399 20.0199C16.9537 20.0043 16.9672 19.9885 16.9805 19.9727C16.9942 19.9564 17.0078 19.9401 17.021 19.9236C17.0347 19.9064 17.0483 19.8892 17.0615 19.8718C17.0754 19.8536 17.0888 19.8352 17.1021 19.8168C17.1159 19.7976 17.1293 19.7783 17.1426 19.7589C17.1564 19.7386 17.1699 19.7182 17.1831 19.6976C17.197 19.6761 17.2105 19.6543 17.2237 19.6324C17.2375 19.6093 17.2511 19.5861 17.2642 19.5627C17.2781 19.5378 17.2916 19.5128 17.3047 19.4876C17.3187 19.4606 17.3322 19.4335 17.3453 19.4061C17.3594 19.3767 17.3728 19.3471 17.3858 19.3172C17.3999 19.2847 17.4135 19.2521 17.4264 19.2191C17.4406 19.1827 17.4541 19.1461 17.4669 19.1091C17.4814 19.0672 17.4948 19.0248 17.5074 18.982C17.5222 18.9321 17.5356 18.8816 17.548 18.8307C17.5632 18.7675 17.5768 18.7036 17.5885 18.639C17.6059 18.5428 17.6193 18.4451 17.629 18.346C17.6426 18.208 17.6493 18.0674 17.6493 17.9246V13.01H17.5885H17.548H17.5074H17.4669H17.4264H17.3858H17.3453H17.3047H17.2642H17.2237H17.1831H17.1426H17.1021H17.0615H17.021H16.9805H16.9399H16.8994H16.8589H16.8183H16.7778H16.7373H16.6967H16.6562H16.6157H16.5751H16.5346H16.494H16.4535H16.413H16.3724H16.3319H16.2914H16.2508H16.2103H16.1697H16.1292H16.0887H16.0481H16.0076H15.9671H15.9265H15.886H15.8455H15.8049H15.7644H15.7239H15.6833H15.6428H15.6023H15.5617H15.5212H15.4807H15.4401H15.3996H15.359H15.3185H15.278H15.2374H15.1969H15.1563H15.1158H15.0753H15.0347H14.9942H14.9537H14.9131H14.8726H14.8321H14.7915H14.751H14.7105H14.6699H14.6294H14.5889H14.5483H14.5078H14.4673H14.4267H14.3862H14.3457H14.3051H14.2646H14.224H14.1835H14.143H14.1024H14.0619L14.0312 17.9246C14.0312 18.0016 14.0278 18.0773 14.0213 18.1515C14.0131 18.2461 13.9995 18.3383 13.9808 18.4279C13.9693 18.4833 13.9557 18.5377 13.9403 18.591C13.928 18.6335 13.9145 18.6753 13.8997 18.7164C13.8872 18.7514 13.8736 18.7858 13.8592 18.8198C13.8464 18.8501 13.8329 18.8799 13.8187 18.9093C13.8057 18.9361 13.7923 18.9626 13.7781 18.9885C13.7652 19.0125 13.7516 19.0359 13.7376 19.0592C13.7245 19.081 13.711 19.1026 13.6971 19.1238C13.6839 19.1438 13.6704 19.1634 13.6565 19.1828C13.6433 19.2013 13.6299 19.2196 13.616 19.2376C13.6028 19.2547 13.5893 19.2714 13.5755 19.288C13.5622 19.3039 13.5487 19.3196 13.5349 19.3351C13.5217 19.35 13.5082 19.3647 13.4944 19.3792C13.4811 19.3931 13.4676 19.407 13.4539 19.4206C13.4406 19.4337 13.4271 19.4467 13.4133 19.4594C13.4 19.4718 13.3865 19.4839 13.3728 19.4958C13.3595 19.5075 13.346 19.519 13.3323 19.5302C13.3189 19.5412 13.3054 19.552 13.2917 19.5627C13.2784 19.5731 13.2648 19.5833 13.2512 19.5934C13.2378 19.6032 13.2243 19.6129 13.2107 19.6224C13.1973 19.6318 13.1838 19.6409 13.1701 19.65C13.1567 19.6588 13.1432 19.6674 13.1296 19.676C13.1162 19.6843 13.1027 19.6925 13.089 19.7006C13.0757 19.7085 13.0621 19.7162 13.0485 19.7239C13.0351 19.7314 13.0216 19.7386 13.008 19.7459C12.9946 19.753 12.9811 19.76 12.9674 19.7668C12.954 19.7735 12.9405 19.7801 12.9269 19.7866C12.9135 19.793 12.9 19.7993 12.8863 19.8055C12.8729 19.8115 12.8595 19.8175 12.8458 19.8232C12.8325 19.8289 12.8189 19.8344 12.8053 19.8399C12.7919 19.8453 12.7783 19.8505 12.7647 19.8557C12.7513 19.8608 12.7379 19.8657 12.7242 19.8706C12.7108 19.8754 12.6973 19.8802 12.6837 19.8848C12.6703 19.8893 12.6567 19.8937 12.6431 19.898C12.6298 19.9022 12.6162 19.9063 12.6026 19.9103C12.5892 19.9143 12.5757 19.9183 12.5621 19.922C12.5486 19.9258 12.5351 19.9295 12.5215 19.933C12.5081 19.9365 12.4946 19.9399 12.481 19.9432C12.4676 19.9464 12.4541 19.9495 12.4405 19.9526C12.427 19.9556 12.4135 19.9586 12.3999 19.9614C12.3865 19.9642 12.373 19.967 12.3594 19.9696C12.346 19.9722 12.3324 19.9746 12.3189 19.977C12.3054 19.9794 12.2919 19.9817 12.2783 19.9839L12.2378 19.9902C12.2244 19.9921 12.2108 19.9939 12.1973 19.9957C12.1838 19.9975 12.1703 19.9993 12.1567 20.0009L12.1162 20.0054C12.1028 20.0068 12.0892 20.008 12.0757 20.0093C12.0622 20.0105 12.0487 20.0118 12.0351 20.0128C12.0217 20.0139 12.0082 20.0148 11.9946 20.0157C11.9811 20.0165 11.9676 20.0173 11.954 20.018C11.9405 20.0187 11.9271 20.0194 11.9135 20.02C11.9001 20.0205 11.8865 20.0208 11.873 20.0212L11.8324 20.0222C11.819 20.0224 11.8055 20.0225 11.7919 20.0226L11.7514 20.0226L11.7108 20.0223L11.6703 20.0218L11.6298 20.0209L11.5892 20.0198L11.5487 20.0185L11.5082 20.0168L11.4676 20.0149L11.4271 20.0129L11.3866 20.0104L11.346 20.0078L11.3055 20.0049L11.265 20.0017L11.2244 19.9983L11.1839 19.9946L11.1433 19.9907L11.1028 19.9865L11.0623 19.9821L11.0217 19.9775L10.9812 19.9725L10.9407 19.9674L10.9001 19.962L10.8596 19.9563L10.819 19.9504L10.7785 19.9443L10.738 19.9379L10.6974 19.9313L10.6569 19.9244L10.6164 19.9173L10.5758 19.91L10.5353 19.9024L10.4948 19.8946L10.4542 19.8866L10.4137 19.8783L10.3732 19.8698L10.3326 19.8611L10.2921 19.8521L10.2516 19.8429L10.211 19.8335L10.1705 19.8238L10.13 19.8139L10.0894 19.8038L10.0489 19.7936L10.0083 19.7829L9.9678 19.7722L9.92728 19.7612L9.88672 19.75L9.8462 19.7386L9.80567 19.7269L9.76512 19.7151L9.7246 19.703L9.68404 19.6907L9.64352 19.6782L9.603 19.6654L9.56244 19.6525L9.52192 19.6394L9.48136 19.6261L9.44084 19.6125L9.40032 19.5987L9.35976 19.5847L9.31924 19.5706L9.27868 19.5562L9.23816 19.5416L9.19764 19.5269L9.15708 19.5118L9.11656 19.4967L9.076 19.4813L9.03548 19.4657L8.99496 19.4499L8.9544 19.434L8.91388 19.4178L8.87332 19.4014L8.8328 19.3849L8.79228 19.3682L8.75172 19.3513L8.7112 19.3341L8.67064 19.3168L8.63012 19.2993L8.5896 19.2817L8.54904 19.2637L8.50852 19.2457L8.468 19.2275L8.42744 19.2091L8.38692 19.1905L8.34637 19.1717L8.30584 19.1528L8.26532 19.1336L8.22476 19.1144C8.19572 19.1004 8.16671 19.0864 8.1377 19.0723Z",fill:"#006CB9"}),Object(l.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M19.8644 14.0838C19.8348 14.1079 19.8057 14.1321 19.7773 14.1567V8.61115C19.7773 8.31625 19.8074 8.02839 19.8644 7.75042C19.8766 7.69075 19.8902 7.63162 19.9049 7.57289C19.9175 7.52251 19.9311 7.47253 19.9455 7.42288C19.9583 7.37866 19.9718 7.33475 19.986 7.29114C19.999 7.25129 20.0124 7.21164 20.0265 7.17233C20.0396 7.1359 20.0531 7.09965 20.0671 7.06369C20.0802 7.03008 20.0937 6.99663 20.1076 6.96343C20.1208 6.93212 20.1343 6.90101 20.1481 6.87007C20.1613 6.84069 20.1749 6.81152 20.1887 6.78251C20.2019 6.75479 20.2154 6.72734 20.2292 6.69997C20.2424 6.67367 20.256 6.64758 20.2698 6.62159C20.283 6.59655 20.2966 6.57167 20.3103 6.54694C20.3236 6.52298 20.3371 6.49912 20.3508 6.47547C20.3642 6.4525 20.3776 6.42963 20.3914 6.40692C20.4047 6.385 20.4182 6.36321 20.4319 6.34156C20.4452 6.32048 20.4588 6.29964 20.4725 6.27883C20.4858 6.25847 20.4993 6.23824 20.513 6.21814C20.5264 6.19842 20.5398 6.1787 20.5535 6.15925C20.5668 6.14041 20.5805 6.12188 20.5941 6.10331C20.6074 6.08501 20.6209 6.06681 20.6346 6.04875C20.648 6.03096 20.6614 6.01314 20.6751 5.99558C20.6884 5.97854 20.7021 5.96173 20.7157 5.94489C20.7291 5.92825 20.7426 5.91168 20.7562 5.89528C20.7696 5.87908 20.7831 5.86295 20.7968 5.84699C20.8101 5.83141 20.8237 5.81602 20.8373 5.80064C20.8507 5.78539 20.8642 5.77007 20.8778 5.75499C20.8912 5.74025 20.9048 5.72568 20.9183 5.71115C20.9317 5.69678 20.9453 5.68251 20.9589 5.66832C20.9723 5.65432 20.9858 5.64033 20.9994 5.6265C21.0128 5.61295 21.0264 5.59956 21.0399 5.58618C21.0534 5.57286 21.0668 5.55944 21.0805 5.54629C21.0938 5.53345 21.1075 5.52091 21.121 5.50824C21.1345 5.4956 21.1479 5.48293 21.1616 5.47049C21.175 5.45829 21.1886 5.4463 21.2021 5.43427C21.2156 5.42227 21.229 5.41031 21.2426 5.39852C21.2561 5.38689 21.2696 5.37548 21.2832 5.36402C21.2966 5.35267 21.3101 5.34132 21.3237 5.3301C21.3372 5.31906 21.3507 5.30811 21.3642 5.29723C21.3777 5.28642 21.3912 5.27568 21.4048 5.26504C21.4182 5.25454 21.4318 5.24413 21.4453 5.23377C21.4588 5.2235 21.4723 5.21326 21.4858 5.20317C21.4993 5.19314 21.5128 5.18324 21.5264 5.17338C21.5399 5.16362 21.5534 5.15386 21.5669 5.14424C21.5804 5.13472 21.5939 5.12533 21.6075 5.11594C21.6209 5.10663 21.6344 5.09734 21.648 5.08819C21.6614 5.07914 21.675 5.07023 21.6886 5.06132C21.702 5.05244 21.7155 5.04356 21.7291 5.03486C21.7425 5.02625 21.7561 5.01785 21.7696 5.00937C21.7831 5.00094 21.7966 4.9924 21.8102 4.98413C21.8236 4.97593 21.8372 4.968 21.8507 4.95997C21.8642 4.95194 21.8776 4.94374 21.8912 4.93588C21.9046 4.92812 21.9183 4.92066 21.9318 4.91304C21.9453 4.90541 21.9587 4.89772 21.9723 4.89027C21.9857 4.88288 21.9993 4.87576 22.0128 4.86851C22.0263 4.86129 22.0398 4.85404 22.0534 4.84696L22.0939 4.82619L22.1345 4.80589C22.1479 4.79925 22.1614 4.79254 22.175 4.78603C22.1885 4.77956 22.202 4.77329 22.2156 4.76696C22.2291 4.76065 22.2425 4.75415 22.2561 4.74798C22.2695 4.74185 22.2831 4.73609 22.2966 4.73012C22.3101 4.72416 22.3236 4.71809 22.3372 4.71226C22.3506 4.7065 22.3641 4.70091 22.3777 4.69529L22.4182 4.67862C22.4317 4.67316 22.4452 4.6677 22.4588 4.66238C22.4722 4.6571 22.4858 4.65202 22.4993 4.64686C22.5128 4.64171 22.5262 4.63639 22.5398 4.63138C22.5533 4.62643 22.5669 4.62182 22.5804 4.61701C22.5939 4.6122 22.6073 4.60732 22.6209 4.60264C22.6344 4.59797 22.6479 4.59349 22.6615 4.58899L22.702 4.57574C22.7155 4.5714 22.729 4.56696 22.7425 4.56273C22.756 4.55856 22.7696 4.55463 22.7831 4.5506C22.7966 4.54653 22.8101 4.54236 22.8236 4.53843C22.8371 4.53453 22.8506 4.53091 22.8641 4.52715L22.9047 4.51607C22.9182 4.51247 22.9317 4.50881 22.9452 4.50536C22.9587 4.50194 22.9722 4.49872 22.9857 4.4954C22.9992 4.49208 23.0127 4.48862 23.0263 4.48543C23.0398 4.48228 23.0533 4.47933 23.0668 4.47632L23.1074 4.46744C23.1209 4.46456 23.1343 4.46158 23.1479 4.45883C23.1614 4.45609 23.1749 4.45361 23.1885 4.45101C23.202 4.4484 23.2154 4.44565 23.229 4.44318L23.2695 4.43613L23.3101 4.42939C23.3236 4.42718 23.337 4.42485 23.3506 4.42278C23.3641 4.42071 23.3776 4.41898 23.3911 4.41705C23.4046 4.41515 23.4181 4.41316 23.4317 4.41136L23.4722 4.40624L23.5127 4.40157C23.5263 4.40004 23.5397 4.39828 23.5533 4.39689C23.5668 4.3955 23.5803 4.39448 23.5938 4.39323L23.6344 4.38964C23.6479 4.38849 23.6614 4.38737 23.6749 4.38639C23.6884 4.3854 23.7019 4.38462 23.7154 4.38378C23.7289 4.38293 23.7424 4.38195 23.756 4.3812C23.7695 4.38046 23.783 4.37995 23.7965 4.37934L23.837 4.37778C23.8506 4.3773 23.864 4.37659 23.8776 4.37625C23.8911 4.37591 23.9046 4.37595 23.9181 4.37575C23.9317 4.37554 23.9452 4.3753 23.9587 4.37524L23.9766 4.375H23.9992H24.0398H24.0803H24.1208H24.1614H24.2019H24.2424H24.283H24.3235H24.364H24.4046H24.4451H24.4856H24.5262H24.5667H24.6073H24.6478H24.6884H24.7289H24.7694H24.81H24.8505H24.891H24.9316H24.9721H25.0127H25.0532H25.0937H25.1343H25.1748H25.2153H25.2559H25.2964H25.3369H25.3775H25.418H25.4585H25.4991H25.5396H25.5802H25.6207H25.6613H25.7018H25.7423H25.7829H25.8234H25.8639H25.9045H25.945H25.9855H26.0261H26.0666H26.1072H26.1477H26.1882H26.2288H26.2693H26.3099H26.3504H26.3909H26.4315H26.472H26.5125H26.5531H26.5936H26.6342H26.6747H26.7152H26.7558H26.7963H26.8368H26.8774H26.9179H26.9584H26.999H27.0395H27.0801H27.1206H27.1612H27.2017H27.2422H27.2828H27.3233H27.3638H27.4044H27.4449H27.4854H27.526H27.5665H27.6071H27.6476H27.6882H27.7287H27.7692H27.8098H27.8503H27.8908H27.9314H27.9719H28.0124H28.053H28.0935H28.1341H28.1746H28.2151H28.2557H28.2962H28.3367H28.3773H28.4178H28.4583H28.4989H28.5394H28.58H28.6205H28.661H28.7016H28.7421H28.7827H28.8232H28.8637H28.9043H28.9448H28.9853H29.0259H29.0664H29.107H29.1475H29.1881H29.2286H29.2691H29.3097H29.3502H29.3907H29.4313H29.4718H29.5123H29.5529H29.5934H29.6339H29.6745H29.715H29.7556H29.7961H29.8366H29.8772H29.9177H29.9582H29.9988H30.0393H30.0799H30.1204H30.1548V25.5542C30.1548 25.7384 30.1431 25.9197 30.1204 26.0977C30.1095 26.1834 30.0958 26.2682 30.0799 26.3522C30.0678 26.4161 30.0543 26.4796 30.0393 26.5425C30.0267 26.5954 30.0133 26.6481 29.9988 26.7003C29.986 26.746 29.9725 26.7915 29.9582 26.8366C29.9454 26.8775 29.9318 26.918 29.9177 26.9583C29.9047 26.9956 29.8912 27.0327 29.8772 27.0696C29.8641 27.1039 29.8506 27.1381 29.8366 27.172C29.8235 27.204 29.81 27.2358 29.7961 27.2674C29.7829 27.2973 29.7694 27.3271 29.7556 27.3567C29.7423 27.3849 29.7288 27.413 29.715 27.4409C29.7018 27.4676 29.6883 27.4942 29.6745 27.5207C29.6612 27.5461 29.6477 27.5715 29.6339 27.5966C29.6206 27.621 29.6072 27.6452 29.5934 27.6692C29.5801 27.6924 29.5666 27.7154 29.5529 27.7382C29.5396 27.7604 29.526 27.7824 29.5123 27.8043C29.499 27.8256 29.4855 27.8469 29.4718 27.868C29.4584 27.8886 29.445 27.9093 29.4313 27.9296C29.4179 27.9494 29.4044 27.969 29.3907 27.9885C29.3774 28.0076 29.3638 28.0265 29.3502 28.0453C29.3368 28.0639 29.3233 28.0824 29.3097 28.1007C29.2963 28.1185 29.2828 28.1362 29.2691 28.1539C29.2558 28.1712 29.2422 28.1883 29.2286 28.2053C29.2151 28.2222 29.2017 28.239 29.1881 28.2556C29.1747 28.2718 29.1611 28.2879 29.1475 28.3039C29.1341 28.3197 29.1206 28.3353 29.107 28.3509C29.0935 28.3663 29.0801 28.3817 29.0664 28.3969C29.0531 28.4118 29.0394 28.4264 29.0259 28.441C29.0124 28.4556 28.999 28.4702 28.9853 28.4845C28.9719 28.4986 28.9584 28.5124 28.9448 28.5263C28.9314 28.54 28.9179 28.5536 28.9043 28.5672C28.8909 28.5806 28.8774 28.5939 28.8637 28.6071C28.8503 28.62 28.8368 28.6329 28.8232 28.6457C28.8097 28.6584 28.7963 28.6712 28.7827 28.6837C28.7693 28.696 28.7557 28.7081 28.7421 28.7202C28.7286 28.7323 28.7152 28.7445 28.7016 28.7564C28.6882 28.7681 28.6746 28.7795 28.661 28.791C28.6475 28.8025 28.6341 28.814 28.6205 28.8253C28.6071 28.8364 28.5935 28.8472 28.58 28.8582C28.5665 28.8691 28.5531 28.8801 28.5394 28.8909C28.526 28.9014 28.5124 28.9117 28.4989 28.9221C28.4854 28.9325 28.472 28.9429 28.4583 28.9532C28.445 28.9632 28.4314 28.9731 28.4178 28.983C28.4043 28.9928 28.3909 29.0028 28.3773 29.0125C28.3639 29.0221 28.3503 29.0314 28.3367 29.0408C28.3232 29.0502 28.3098 29.0597 28.2962 29.069C28.2828 29.0781 28.2692 29.0869 28.2557 29.0959C28.2422 29.1048 28.2288 29.1139 28.2151 29.1227C28.2017 29.1314 28.1881 29.1397 28.1746 29.1482C28.1611 29.1567 28.1477 29.1653 28.1341 29.1737C28.1206 29.1819 28.107 29.1899 28.0935 29.198C28.08 29.206 28.0666 29.2142 28.053 29.2221C28.0395 29.2299 28.026 29.2376 28.0124 29.2453L27.9719 29.2681L27.9314 29.2902L27.8908 29.3118C27.8773 29.3188 27.8639 29.326 27.8503 29.3329C27.8368 29.3398 27.8233 29.3465 27.8098 29.3532C27.7963 29.3599 27.7828 29.3668 27.7692 29.3734C27.7558 29.3799 27.7422 29.3861 27.7287 29.3925C27.7152 29.3988 27.7017 29.4053 27.6882 29.4115C27.6747 29.4177 27.6611 29.4236 27.6476 29.4297L27.6071 29.4475L27.5665 29.4648L27.526 29.4815C27.5125 29.487 27.499 29.4927 27.4854 29.4981C27.472 29.5034 27.4584 29.5084 27.4449 29.5135C27.4314 29.5187 27.418 29.524 27.4044 29.5291C27.3909 29.5341 27.3774 29.5389 27.3638 29.5437L27.3233 29.5581L27.2828 29.5721C27.2693 29.5766 27.2557 29.5809 27.2422 29.5853C27.2287 29.5898 27.2152 29.5944 27.2017 29.5986C27.1883 29.6028 27.1747 29.6067 27.1612 29.6108L27.1206 29.623L27.0801 29.6346C27.0666 29.6384 27.0531 29.642 27.0395 29.6456C27.026 29.6493 27.0126 29.6532 26.999 29.6567C26.9855 29.6602 26.972 29.6633 26.9584 29.6666C26.945 29.67 26.9315 29.6734 26.9179 29.6766L26.8774 29.686L26.8368 29.6949C26.8233 29.6978 26.8099 29.701 26.7963 29.7038C26.7829 29.7066 26.7693 29.709 26.7558 29.7116L26.7152 29.7194L26.6747 29.7268C26.6612 29.7292 26.6477 29.7313 26.6342 29.7336C26.6206 29.7358 26.6072 29.7382 26.5936 29.7403C26.5802 29.7424 26.5666 29.7442 26.5531 29.7462L26.5125 29.7519C26.499 29.7537 26.4855 29.7556 26.472 29.7573C26.4585 29.759 26.445 29.7604 26.4315 29.762C26.418 29.7635 26.4045 29.7652 26.3909 29.7666C26.3775 29.7681 26.3639 29.7693 26.3504 29.7706L26.3099 29.7742C26.2963 29.7754 26.2829 29.7768 26.2693 29.7778C26.2559 29.7788 26.2423 29.7795 26.2288 29.7804L26.1882 29.783L26.1477 29.7851C26.1342 29.7858 26.1207 29.7862 26.1072 29.7867C26.0936 29.7872 26.0802 29.7878 26.0666 29.7882C26.0532 29.7886 26.0396 29.7887 26.0261 29.789L25.9855 29.7895C25.9729 29.7896 25.9604 29.79 25.9477 29.79H25.945H25.9045H25.8639H25.8234H25.7829H25.7423H25.7018H25.6613H25.6207H25.5802H25.5396H25.4991H25.4585H25.418H25.3775H25.3369H25.2964H25.2559H25.2153H25.1748H25.1343H25.0937H25.0532H25.0127H24.9721H24.9316H24.891H24.8505H24.81H24.7694H24.7289H24.6884H24.6478H24.6073H24.5667H24.5262H24.4856H24.4451H24.4046H24.364H24.3235H24.283H24.2424H24.2019H24.1614H24.1208H24.0803H24.0398H23.9992H23.9587H23.9181H23.8776H23.837H23.7965H23.756H23.7154H23.6749H23.6344H23.5938H23.5533H23.5127H23.4722H23.4317H23.3911H23.3506H23.3101H23.2695H23.229H23.1885H23.1479H23.1074H23.0668H23.0263H22.9857H22.9452H22.9047H22.8641H22.8236H22.7831H22.7425H22.702H22.6615H22.6209H22.5804H22.5398H22.4993H22.4588H22.4182H22.3777H22.3372H22.2966H22.2561H22.2156H22.175H22.1345H22.0939H22.0534H22.0128H21.9723H21.9318H21.8912H21.8507H21.8102H21.7696H21.7291H21.6886H21.648H21.6075H21.5669H21.5264H21.4858H21.4453H21.4048H21.3642H21.3237H21.2832H21.2426H21.2021H21.1616H21.121H21.0805H21.0399H20.9994H20.9589H20.9183H20.8778H20.8373H20.7968H20.7562H20.7157H20.6751H20.6346H20.5941H20.5535H20.513H20.4725H20.4319H20.3914H20.3508H20.3103H20.2698H20.2292H20.1887H20.1481H20.1076H20.0671H20.0265H19.986H19.9455H19.9049H19.8644H19.7773V20.01C19.8057 20.0345 19.8348 20.0588 19.8644 20.0828C19.8778 20.0937 19.8913 20.1046 19.9049 20.1153C19.9183 20.126 19.9318 20.1366 19.9455 20.1471C19.9589 20.1575 19.9723 20.1679 19.986 20.1782C19.9994 20.1882 20.013 20.1982 20.0265 20.2081C20.0399 20.218 20.0535 20.2277 20.0671 20.2375C20.0805 20.2471 20.094 20.2566 20.1076 20.2662L20.1481 20.2941C20.1615 20.3032 20.1751 20.3123 20.1887 20.3213L20.2292 20.3479C20.2426 20.3567 20.2561 20.3654 20.2698 20.374C20.2831 20.3825 20.2967 20.3909 20.3103 20.3993L20.3508 20.4241C20.3643 20.4323 20.3778 20.4404 20.3914 20.4484C20.4048 20.4564 20.4183 20.4642 20.4319 20.472L20.4725 20.4952L20.513 20.5178L20.5535 20.5399C20.567 20.5471 20.5804 20.5545 20.5941 20.5617C20.6074 20.5687 20.621 20.5757 20.6346 20.5827L20.6751 20.6034L20.7157 20.6237L20.7562 20.6434C20.7697 20.6499 20.7831 20.6565 20.7968 20.6629L20.8373 20.6818L20.8778 20.7004L20.9183 20.7185L20.9589 20.7363L20.9994 20.7538L21.0399 20.7708L21.0805 20.7875L21.121 20.8038L21.1616 20.8199L21.2021 20.8354C21.2156 20.8406 21.229 20.8458 21.2426 20.8509L21.2832 20.8657C21.2967 20.8707 21.3101 20.8757 21.3237 20.8806C21.3371 20.8854 21.3507 20.8901 21.3642 20.8948L21.4048 20.909L21.4453 20.9227C21.4588 20.9272 21.4722 20.9319 21.4858 20.9364C21.4992 20.9408 21.5129 20.9451 21.5264 20.9494L21.5669 20.9625L21.6075 20.9751L21.648 20.9876L21.6886 20.9996L21.7291 21.0115L21.7696 21.0231L21.8102 21.0345L21.8507 21.0456L21.8912 21.0565L21.9318 21.0672L21.9723 21.0776L22.0128 21.0879L22.0534 21.0978L22.0939 21.1077L22.1345 21.1171L22.175 21.1264L22.2156 21.1355L22.2561 21.1444L22.2966 21.1532L22.3372 21.1616L22.3777 21.17L22.4182 21.178L22.4588 21.186L22.4993 21.1937L22.5398 21.2012L22.5804 21.2087L22.6209 21.2158L22.6615 21.2228L22.702 21.2296L22.7425 21.2363L22.7831 21.2429L22.8236 21.2491L22.8641 21.2553L22.9047 21.2613L22.9452 21.2671L22.9857 21.2728L23.0263 21.2782L23.0668 21.2836L23.1074 21.2888L23.1479 21.2938L23.1885 21.2988L23.229 21.3035L23.2695 21.3081L23.3101 21.3126L23.3506 21.3168L23.3911 21.321L23.4317 21.3251L23.4722 21.3289L23.5127 21.3328L23.5533 21.3363L23.5938 21.3398L23.6344 21.3433L23.6749 21.3464L23.7154 21.3495L23.756 21.3526L23.7965 21.3554L23.837 21.3581L23.8776 21.3608L23.9181 21.3632L23.9587 21.3656L23.9992 21.3679L24.0398 21.3699L24.0803 21.3719L24.1208 21.3739L24.1614 21.3756L24.2019 21.3773L24.2424 21.3789L24.283 21.3803L24.3235 21.3816L24.364 21.3829L24.4046 21.384L24.4451 21.385L24.4856 21.386L24.5262 21.3867L24.5667 21.3874L24.6073 21.3881L24.6478 21.3885L24.6884 21.3889L24.7289 21.3892L24.7694 21.3894L24.81 21.3895L24.8505 21.3895L24.891 21.3894L24.9316 21.3892L24.9721 21.389L25.0127 21.3886L25.0532 21.3881L25.0937 21.3876L25.1343 21.387L25.1748 21.3862L25.2153 21.3853L25.2559 21.3845L25.2964 21.3834L25.3369 21.3823L25.3775 21.3812L25.418 21.38L25.4585 21.3785L25.4991 21.3771L25.5396 21.3757L25.5802 21.374L25.6207 21.3723L25.6613 21.3706L25.6811 21.3698L25.7018 21.3688L25.7423 21.3668L25.7829 21.3646L25.8234 21.3624L25.8639 21.3599L25.9045 21.3574L25.945 21.3547L25.9855 21.3519L26.0261 21.3489L26.0666 21.3458L26.1072 21.3426L26.1477 21.3393L26.1882 21.3358L26.2288 21.3322L26.2693 21.3285L26.3099 21.3246L26.3504 21.3207L26.3909 21.3166L26.4315 21.3125L26.472 21.3082L26.5125 21.3038L26.5531 21.2993L26.5936 21.2947L26.6342 21.29L26.6747 21.2852L26.7152 21.2803L26.7558 21.2753L26.7963 21.2701L26.8368 21.2649L26.8774 21.2597L26.9179 21.2542L26.9584 21.2487L26.999 21.2431L27.0395 21.2374L27.0801 21.2317L27.1206 21.2258L27.1612 21.2198L27.2017 21.2137L27.2422 21.2076L27.2828 21.2014L27.3233 21.1951L27.3638 21.1887L27.4044 21.1822L27.4449 21.1756L27.4854 21.169L27.526 21.1622L27.5665 21.1554L27.6071 21.1485L27.6476 21.1415L27.6882 21.1344L27.7287 21.1273L27.7692 21.12L27.8098 21.1127L27.8503 21.1053L27.8908 21.0979L27.9314 21.0903L27.9719 21.0826L28.0124 21.0749L28.053 21.0671L28.0935 21.0593L28.1341 21.0513L28.1746 21.0433L28.2151 21.0352L28.2557 21.027L28.2962 21.0187L28.3367 21.0103L28.3773 21.0019L28.4178 20.9934L28.4583 20.9848L28.4989 20.976L28.5394 20.9673L28.58 20.9584L28.6205 20.9495L28.661 20.9404L28.7016 20.9313L28.7421 20.9221L28.7827 20.9127L28.8232 20.9033L28.8637 20.8937L28.9043 20.884L28.9448 20.8741L28.9851 20.8641V19.0723L28.9448 19.0925L28.9043 19.1127L28.8637 19.1326L28.8232 19.1524L28.7827 19.1721L28.7421 19.1915L28.7016 19.2107L28.661 19.2297L28.6205 19.2485L28.58 19.2672L28.5394 19.2856L28.4989 19.3038L28.4583 19.3217L28.4178 19.3395L28.3773 19.3571L28.3367 19.3744L28.2962 19.3916L28.2557 19.4085L28.2151 19.4252L28.1746 19.4417L28.1341 19.4579L28.0935 19.474L28.053 19.4897L28.0124 19.5053L27.9719 19.5207L27.9314 19.5358L27.8908 19.5506L27.8503 19.5653L27.8098 19.5797L27.7692 19.5939L27.7287 19.6079L27.6882 19.6216L27.6476 19.6351L27.6071 19.6484L27.5665 19.6614L27.526 19.6742L27.4854 19.6868L27.4449 19.6991L27.4044 19.7112L27.3638 19.7231L27.3233 19.7347L27.2828 19.7461L27.2422 19.7573L27.2017 19.7682L27.1612 19.7789L27.1206 19.7894L27.0801 19.7996L27.0395 19.8096L26.999 19.8195L26.9584 19.829L26.9179 19.8383L26.8774 19.8474L26.8368 19.8563L26.7963 19.8649L26.7558 19.8733L26.7152 19.8815L26.6747 19.8895L26.6342 19.8972L26.5936 19.9047L26.5531 19.912L26.5125 19.919L26.472 19.9258L26.4315 19.9324L26.3909 19.9389L26.3504 19.945L26.3099 19.9509L26.2693 19.9567L26.2288 19.9622L26.1882 19.9674L26.1477 19.9725L26.1072 19.9774L26.0666 19.982L26.0261 19.9864L25.9855 19.9906L25.945 19.9946L25.9045 19.9984L25.8639 20.002L25.8234 20.0053L25.7988 20.0072L25.7829 20.0083L25.7423 20.0111L25.7018 20.0138L25.6613 20.016L25.6207 20.0181L25.5802 20.02L25.5396 20.0213L25.4991 20.0226L25.4585 20.0235L25.418 20.0241L25.3775 20.0246C25.3639 20.0247 25.3505 20.0245 25.3369 20.0245L25.2964 20.0243L25.2559 20.0237L25.2153 20.0228L25.1748 20.0218C25.1612 20.0213 25.1478 20.0207 25.1343 20.0201C25.1208 20.0196 25.1072 20.0191 25.0937 20.0185L25.0532 20.0162L25.0127 20.0138L24.9721 20.0109L24.9316 20.0077C24.9181 20.0066 24.9045 20.0056 24.891 20.0044C24.8774 20.0031 24.864 20.0016 24.8505 20.0003L24.81 19.9962L24.7694 19.9914L24.7289 19.9865L24.6884 19.9811L24.6478 19.9753C24.6343 19.9733 24.6207 19.9714 24.6073 19.9692C24.5937 19.9671 24.5802 19.9648 24.5667 19.9625C24.5532 19.9602 24.5396 19.9581 24.5262 19.9557C24.5126 19.9533 24.4992 19.9506 24.4856 19.9481C24.4721 19.9455 24.4585 19.9431 24.4451 19.9404C24.4315 19.9377 24.4181 19.9347 24.4046 19.9319C24.3911 19.929 24.3775 19.9263 24.364 19.9233C24.3504 19.9203 24.337 19.9171 24.3235 19.9139L24.283 19.9043C24.2694 19.901 24.2559 19.8975 24.2424 19.894C24.2289 19.8905 24.2153 19.8871 24.2019 19.8835C24.1883 19.8798 24.1748 19.876 24.1614 19.8722C24.1478 19.8684 24.1342 19.8645 24.1208 19.8605C24.1072 19.8565 24.0937 19.8523 24.0803 19.8482C24.0667 19.844 24.0532 19.8398 24.0398 19.8354C24.0262 19.831 24.0127 19.8265 23.9992 19.8219C23.9857 19.8174 23.9721 19.8128 23.9587 19.8081C23.9451 19.8033 23.9316 19.7983 23.9181 19.7934C23.9046 19.7884 23.891 19.7835 23.8776 19.7784C23.864 19.7731 23.8505 19.7677 23.837 19.7623C23.8235 19.7569 23.8099 19.7516 23.7965 19.7461C23.7829 19.7404 23.7695 19.7345 23.756 19.7287C23.7424 19.7228 23.7288 19.717 23.7154 19.711C23.7018 19.7049 23.6884 19.6985 23.6749 19.6922C23.6613 19.6858 23.6478 19.6794 23.6344 19.6729C23.6208 19.6663 23.6072 19.6595 23.5938 19.6527C23.5802 19.6458 23.5667 19.6388 23.5533 19.6317C23.5397 19.6246 23.5261 19.6175 23.5127 19.6101C23.4991 19.6027 23.4857 19.5949 23.4722 19.5872C23.4587 19.5795 23.4451 19.5718 23.4317 19.5638C23.418 19.5557 23.4046 19.5474 23.3911 19.5392C23.3775 19.5307 23.364 19.5221 23.3506 19.5135C23.337 19.5048 23.3234 19.4962 23.3101 19.4872C23.2964 19.4781 23.283 19.4686 23.2695 19.4592C23.2559 19.4498 23.2424 19.4401 23.229 19.4304C23.2154 19.4206 23.2018 19.4107 23.1885 19.4006C23.1748 19.3902 23.1613 19.3796 23.1479 19.369C23.1343 19.3582 23.1208 19.3474 23.1074 19.3364C23.0938 19.3252 23.0802 19.314 23.0668 19.3025C23.0531 19.2907 23.0397 19.2787 23.0263 19.2666C23.0126 19.2543 22.9991 19.2419 22.9857 19.2293C22.9721 19.2164 22.9585 19.2035 22.9452 19.1904C22.9316 19.1769 22.918 19.1635 22.9047 19.1498C22.8909 19.1356 22.8775 19.1212 22.8641 19.1067C22.8504 19.0918 22.8369 19.0767 22.8236 19.0615C22.8099 19.0458 22.7964 19.03 22.7831 19.014C22.7694 18.9976 22.7558 18.9809 22.7425 18.9641C22.7288 18.9467 22.7152 18.929 22.702 18.9112C22.6883 18.8928 22.6747 18.8742 22.6615 18.8553C22.6477 18.8357 22.6341 18.8159 22.6209 18.7958C22.6071 18.7748 22.5936 18.7536 22.5804 18.7321C22.5665 18.7096 22.553 18.6868 22.5398 18.6638C22.5259 18.6396 22.5125 18.615 22.4993 18.5902C22.4853 18.5638 22.4719 18.5371 22.4588 18.5101C22.4448 18.4814 22.4313 18.4523 22.4182 18.4228C22.4042 18.3911 22.3906 18.3592 22.3777 18.3266C22.3634 18.2907 22.3501 18.254 22.3372 18.217C22.3228 18.176 22.3093 18.1344 22.2966 18.0921C22.282 18.0431 22.2684 17.9933 22.2561 17.9426C22.2407 17.8795 22.2273 17.8151 22.2156 17.7495C22.1981 17.6522 22.1845 17.5523 22.175 17.4496C22.1641 17.331 22.1585 17.2089 22.1585 17.0832C22.1585 16.9574 22.1641 16.8352 22.175 16.7165C22.1845 16.6138 22.1981 16.5138 22.2156 16.4165C22.2273 16.3509 22.2407 16.2864 22.2561 16.2233C22.2684 16.1726 22.282 16.1228 22.2966 16.0737C22.3093 16.0314 22.3228 15.9898 22.3372 15.9487C22.3501 15.9117 22.3634 15.8751 22.3777 15.8391C22.3906 15.8065 22.4042 15.7745 22.4182 15.7428C22.4313 15.7133 22.4448 15.6842 22.4588 15.6555C22.4719 15.6285 22.4853 15.6017 22.4993 15.5754C22.5125 15.5506 22.5259 15.526 22.5398 15.5017C22.553 15.4787 22.5665 15.4559 22.5804 15.4334C22.5936 15.4119 22.6071 15.3907 22.6209 15.3697C22.6341 15.3496 22.6477 15.3298 22.6615 15.3101C22.6747 15.2912 22.6883 15.2726 22.702 15.2542C22.7152 15.2363 22.7288 15.2188 22.7425 15.2013C22.7558 15.1845 22.7694 15.1678 22.7831 15.1514C22.7964 15.1353 22.8099 15.1195 22.8236 15.1039C22.8369 15.0886 22.8504 15.0735 22.8641 15.0586C22.8775 15.0441 22.8909 15.0296 22.9047 15.0155C22.918 15.0018 22.9316 14.9883 22.9452 14.9749C22.9585 14.9618 22.9721 14.9488 22.9857 14.936C22.9991 14.9234 23.0126 14.9109 23.0263 14.8986C23.0397 14.8865 23.0531 14.8745 23.0668 14.8627C23.0802 14.8512 23.0938 14.8401 23.1074 14.8288C23.1208 14.8178 23.1343 14.8069 23.1479 14.7962C23.1613 14.7855 23.1748 14.7749 23.1885 14.7646C23.2018 14.7545 23.2154 14.7446 23.229 14.7347C23.2424 14.725 23.2559 14.7154 23.2695 14.7059C23.283 14.6965 23.2964 14.6871 23.3101 14.6779C23.3234 14.669 23.337 14.6603 23.3506 14.6516C23.364 14.6429 23.3775 14.6344 23.3911 14.626C23.4046 14.6177 23.418 14.6094 23.4317 14.6013C23.4451 14.5934 23.4587 14.5856 23.4722 14.5779C23.4857 14.5702 23.4991 14.5625 23.5127 14.555C23.5261 14.5476 23.5397 14.5405 23.5533 14.5334C23.5667 14.5263 23.5802 14.5193 23.5938 14.5123C23.6072 14.5055 23.6208 14.4988 23.6344 14.4921C23.6478 14.4856 23.6613 14.4792 23.6749 14.4729C23.6884 14.4666 23.7018 14.4602 23.7154 14.4541C23.7288 14.448 23.7424 14.4422 23.756 14.4364C23.7695 14.4305 23.7829 14.4246 23.7965 14.419C23.8099 14.4134 23.8235 14.4081 23.837 14.4027C23.8505 14.3973 23.864 14.3919 23.8776 14.3867C23.891 14.3815 23.9046 14.3766 23.9181 14.3717C23.9316 14.3667 23.9451 14.3617 23.9587 14.3569C23.9721 14.3522 23.9857 14.3476 23.9992 14.3431C24.0127 14.3385 24.0262 14.334 24.0398 14.3296C24.0532 14.3252 24.0667 14.321 24.0803 14.3168C24.0937 14.3127 24.1072 14.3085 24.1208 14.3045L24.1614 14.2928C24.1748 14.289 24.1883 14.2852 24.2019 14.2815C24.2153 14.2779 24.2289 14.2744 24.2424 14.2709C24.2559 14.2675 24.2694 14.264 24.283 14.2606L24.3235 14.2511C24.337 14.2479 24.3504 14.2447 24.364 14.2417C24.3775 14.2387 24.3911 14.2359 24.4046 14.2331C24.4181 14.2302 24.4315 14.2272 24.4451 14.2245C24.4585 14.2218 24.4721 14.2194 24.4856 14.2169C24.4992 14.2144 24.5126 14.2117 24.5262 14.2092C24.5396 14.2068 24.5532 14.2047 24.5667 14.2025C24.5802 14.2002 24.5937 14.1979 24.6073 14.1957L24.6478 14.1897L24.6884 14.1838L24.7289 14.1784L24.7694 14.1735L24.81 14.1687L24.8505 14.1646C24.864 14.1633 24.8774 14.1618 24.891 14.1605C24.9045 14.1593 24.9181 14.1583 24.9316 14.1572L24.9721 14.154L25.0127 14.1512L25.0532 14.1487L25.0937 14.1464C25.1072 14.1458 25.1208 14.1453 25.1343 14.1448C25.1478 14.1442 25.1612 14.1436 25.1748 14.1431L25.2153 14.1421L25.2559 14.1412L25.2964 14.1406L25.3369 14.1405C25.3505 14.1404 25.3639 14.1402 25.3775 14.1403L25.418 14.1408L25.4585 14.1414L25.4991 14.1423L25.5396 14.1436L25.5802 14.145L25.6207 14.1469L25.6613 14.1489L25.7018 14.1511L25.7423 14.1538L25.7829 14.1566L25.7988 14.1577L25.8234 14.1596L25.8639 14.1629L25.9045 14.1664L25.945 14.1701L25.9855 14.174L26.0261 14.1782L26.0666 14.1826L26.1072 14.1871L26.1477 14.1919L26.1882 14.1969L26.2288 14.2021L26.2693 14.2075L26.3099 14.2132L26.3504 14.219L26.3909 14.2251L26.4315 14.2314L26.472 14.238L26.5125 14.2447L26.5531 14.2517L26.5936 14.2589L26.6342 14.2663L26.6747 14.274L26.7152 14.2819L26.7558 14.29L26.7963 14.2983L26.8368 14.3069L26.8774 14.3157L26.9179 14.3247L26.9584 14.3339L26.999 14.3434L27.0395 14.3532L27.0801 14.3631L27.1206 14.3733L27.1612 14.3837L27.2017 14.3944L27.2422 14.4053L27.2828 14.4164L27.3233 14.4278L27.3638 14.4394L27.4044 14.4513L27.4449 14.4634L27.4854 14.4757L27.526 14.4883L27.5665 14.501L27.6071 14.5141L27.6476 14.5274L27.6882 14.5409L27.7287 14.5546L27.7692 14.5686L27.8098 14.5828L27.8503 14.5973L27.8908 14.612L27.9314 14.6269L27.9719 14.6421L28.0124 14.6575L28.053 14.6732L28.0935 14.689L28.1341 14.7051L28.1746 14.7215L28.2151 14.738L28.2557 14.7548L28.2962 14.7719L28.3367 14.7891L28.3773 14.8066L28.4178 14.8243L28.4583 14.8422L28.4989 14.8603L28.5394 14.8787L28.58 14.8973L28.6205 14.916L28.661 14.935L28.7016 14.9542L28.7421 14.9736L28.7827 14.9932L28.8232 15.013L28.8637 15.033L28.9043 15.0531L28.9448 15.0735L28.9851 15.0939V13.3008L28.9448 13.2908L28.9043 13.2809L28.8637 13.2712L28.8232 13.2617L28.7827 13.2522L28.7421 13.2429L28.7016 13.2336L28.661 13.2245L28.6205 13.2155L28.58 13.2065L28.5394 13.1976L28.4989 13.1889L28.4583 13.1802L28.4178 13.1716L28.3773 13.1631L28.3367 13.1546L28.2962 13.1463L28.2557 13.138L28.2151 13.1298L28.1746 13.1217L28.1341 13.1137L28.0935 13.1057L28.053 13.0979L28.0124 13.0901L27.9719 13.0824L27.9314 13.0747L27.8908 13.0672L27.8503 13.0597L27.8098 13.0523L27.7692 13.045L27.7287 13.0378L27.6882 13.0307L27.6476 13.0236L27.6071 13.0166L27.5665 13.0097L27.526 13.0029L27.4854 12.9962L27.4449 12.9895L27.4044 12.983L27.3638 12.9765L27.3233 12.9701L27.2828 12.9638L27.2422 12.9576L27.2017 12.9514L27.1612 12.9454L27.1206 12.9394L27.0801 12.9336L27.0395 12.9278L26.999 12.9222L26.9584 12.9166L26.9179 12.9111L26.8774 12.9057L26.8368 12.9004L26.7963 12.8952L26.7558 12.8901L26.7152 12.8851L26.6747 12.8802L26.6342 12.8754L26.5936 12.8707L26.5531 12.8661L26.5125 12.8616L26.472 12.8573L26.4315 12.853L26.3909 12.8489L26.3504 12.8448L26.3099 12.8409L26.2693 12.837L26.2288 12.8334L26.1882 12.8298L26.1477 12.8263L26.1072 12.823L26.0666 12.8198L26.0261 12.8168L25.9855 12.8138L25.945 12.811L25.9045 12.8083L25.8639 12.8058L25.8234 12.8034L25.7829 12.8011L25.7423 12.799L25.7018 12.797L25.6811 12.796L25.6613 12.7952L25.6207 12.7935L25.5802 12.7918L25.5396 12.7901L25.4991 12.7887L25.4585 12.7873L25.418 12.7859L25.3775 12.7846L25.3369 12.7835L25.2964 12.7824L25.2559 12.7813L25.2153 12.7805L25.1748 12.7797L25.1343 12.7788L25.0937 12.7783L25.0532 12.7777L25.0127 12.7772L24.9721 12.7769L24.9316 12.7767L24.891 12.7764L24.8505 12.7763L24.81 12.7764L24.7694 12.7764L24.7289 12.7766L24.6884 12.777L24.6478 12.7774L24.6073 12.7778L24.5667 12.7785L24.5262 12.7792L24.4856 12.7799L24.4451 12.7809L24.4046 12.7819L24.364 12.7829L24.3235 12.7842L24.283 12.7856L24.2424 12.787L24.2019 12.7886L24.1614 12.7903L24.1208 12.792L24.0803 12.794L24.0398 12.796L23.9992 12.798L23.9587 12.8003L23.9181 12.8027L23.8776 12.8051L23.837 12.8078L23.7965 12.8105L23.756 12.8133L23.7154 12.8164L23.6749 12.8195L23.6344 12.8227L23.5938 12.8261L23.5533 12.8295L23.5127 12.8332L23.4722 12.837L23.4317 12.8408L23.3911 12.8449L23.3506 12.8491L23.3101 12.8533L23.2695 12.8579L23.229 12.8625L23.1885 12.8672L23.1479 12.8722L23.1074 12.8772L23.0668 12.8824L23.0263 12.8878L22.9857 12.8932L22.9452 12.8989L22.9047 12.9047L22.8641 12.9107L22.8236 12.9169L22.7831 12.9231L22.7425 12.9297L22.702 12.9364L22.6615 12.9432L22.6209 12.9502L22.5804 12.9573L22.5398 12.9648L22.4993 12.9723L22.4588 12.9801L22.4182 12.988L22.3777 12.996L22.3372 13.0045L22.2966 13.0129L22.2561 13.0216L22.2156 13.0306L22.175 13.0396L22.1345 13.049L22.0939 13.0584L22.0534 13.0683L22.0128 13.0782L21.9723 13.0885L21.9318 13.0989L21.8912 13.1096L21.8507 13.1205L21.8102 13.1316L21.7696 13.1431L21.7291 13.1546L21.6886 13.1666L21.648 13.1786L21.6075 13.1911L21.5669 13.2037L21.5264 13.2168C21.5129 13.2212 21.4992 13.2254 21.4858 13.2299L21.4453 13.2435C21.4318 13.2481 21.4182 13.2525 21.4048 13.2572L21.3642 13.2714L21.3237 13.2857C21.3101 13.2905 21.2967 13.2956 21.2832 13.3005C21.2696 13.3055 21.256 13.3104 21.2426 13.3154L21.2021 13.3309C21.1886 13.3361 21.175 13.3412 21.1616 13.3464L21.121 13.3625L21.0805 13.3788L21.0399 13.3956L20.9994 13.4126L20.9589 13.43L20.9183 13.4478L20.8778 13.4659L20.8373 13.4846L20.7968 13.5034C20.7831 13.5099 20.7697 13.5164 20.7562 13.523L20.7157 13.5427L20.6751 13.563L20.6346 13.5837C20.621 13.5908 20.6074 13.5977 20.5941 13.6048C20.5804 13.612 20.567 13.6193 20.5535 13.6266L20.513 13.6487L20.4725 13.6713C20.4588 13.679 20.4454 13.6867 20.4319 13.6945C20.4183 13.7023 20.4048 13.7101 20.3914 13.7181C20.3778 13.7261 20.3643 13.7342 20.3508 13.7424C20.3372 13.7506 20.3237 13.7589 20.3103 13.7672C20.2967 13.7756 20.2831 13.784 20.2698 13.7925C20.2561 13.8012 20.2426 13.8099 20.2292 13.8186L20.1887 13.8453C20.1751 13.8543 20.1615 13.8633 20.1481 13.8724L20.1076 13.9004C20.094 13.91 20.0805 13.9195 20.0671 13.9291C20.0535 13.9389 20.0399 13.9487 20.0265 13.9585C20.013 13.9685 19.9994 13.9784 19.986 13.9885C19.9723 13.9988 19.9589 14.0091 19.9455 14.0195C19.9318 14.0301 19.9183 14.0407 19.9049 14.0513C19.8913 14.0621 19.8778 14.0729 19.8644 14.0839V14.0838Z",fill:"#E10238"})),p=()=>Object(l.createElement)("svg",{width:"52",height:"35",viewBox:"0 0 52 35",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Object(l.createElement)("rect",{x:"0.878906",y:"0.5",width:"50",height:"34",rx:"3.5",fill:"white",stroke:"#F3F3F3"}),Object(l.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M44.0545 5.25735L34.3353 5.25488C34.3341 5.25488 34.3328 5.25488 34.3328 5.25488C34.3253 5.25488 34.3179 5.2562 34.3106 5.2562C32.9754 5.29641 31.3124 6.34915 31.0096 7.64726L26.4132 27.6401C26.1104 28.9503 26.9343 30.0165 28.2599 30.0361H38.4703C39.7756 29.9726 41.044 28.932 41.3417 27.6486L45.9382 7.65564C46.2459 6.33208 45.402 5.25735 44.0545 5.25735Z",fill:"#01798A"}),Object(l.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M26.4134 27.6401L31.0097 7.64729C31.3126 6.34917 32.9755 5.29643 34.3107 5.25622L30.4464 5.25376L23.484 5.25244C22.1451 5.27936 20.4605 6.33949 20.1577 7.64729L15.5601 27.6401C15.2561 28.9503 16.0813 30.0165 17.4059 30.0361H28.26C26.9345 30.0165 26.1105 28.9503 26.4134 27.6401",fill:"#024381"}),Object(l.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M15.5602 27.64L20.1578 7.64714C20.4606 6.33934 22.1452 5.27922 23.4841 5.2523L14.5649 5.25C13.2185 5.25 11.4923 6.32227 11.1846 7.64714L6.58694 27.64C6.55896 27.762 6.54344 27.8815 6.53418 27.9986V28.3695C6.62418 29.3246 7.36619 30.0201 8.43278 30.036H17.406C16.0814 30.0163 15.2562 28.9502 15.5602 27.64Z",fill:"#DD0228"}),Object(l.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M23.6716 19.8205H23.8404C23.9955 19.8205 24.0999 19.7693 24.1488 19.668L24.5874 19.0227H25.762L25.5171 19.4472H26.9254L26.7467 20.0975H25.0709C24.8779 20.3829 24.6403 20.5171 24.3547 20.5012H23.4818L23.6716 19.8205H23.6716ZM23.4788 20.7527H26.5643L26.3676 21.4591H25.1268L24.9374 22.1409H26.1449L25.9482 22.8473H24.7407L24.4602 23.8548C24.3908 24.0232 24.4821 24.099 24.7327 24.0818H25.7168L25.5345 24.7382H23.6451C23.287 24.7382 23.1641 24.5368 23.2765 24.1331L23.6351 22.8473H22.8633L23.0593 22.1409H23.8313L24.0205 21.4591H23.2827L23.4788 20.7527H23.4788ZM28.4035 19.018L28.355 19.4315C28.355 19.4315 28.937 19.002 29.4656 19.002H31.4189L30.6719 21.6601C30.61 21.964 30.3443 22.1151 29.8752 22.1151H27.6612L27.1426 23.9817C27.1128 24.0817 27.155 24.133 27.2667 24.133H27.7023L27.5422 24.7124H26.4347C26.0096 24.7124 25.8328 24.5867 25.903 24.3343L27.3684 19.018H28.4035H28.4035ZM30.0576 19.7693H28.3141L28.1056 20.4866C28.1056 20.4866 28.3959 20.2805 28.8811 20.2731C29.365 20.2657 29.9173 20.2731 29.9173 20.2731L30.0576 19.7693ZM29.4261 21.4333C29.555 21.4504 29.6271 21.4003 29.6358 21.282L29.7425 20.9039H27.9964L27.85 21.4333H29.4261ZM28.2483 22.2921H29.2547L29.236 22.7203H29.504C29.6394 22.7203 29.7065 22.6776 29.7065 22.5935L29.7858 22.3166H30.6223L30.5106 22.7203C30.4161 23.057 30.1656 23.2327 29.7586 23.2499H29.2225L29.22 23.9817C29.2101 24.0989 29.318 24.1587 29.54 24.1587H30.0439L29.8813 24.7381H28.6727C28.3339 24.754 28.1678 24.5953 28.1713 24.2587L28.2483 22.2921V22.2921Z",fill:"white"}),Object(l.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M16.0529 15.4764C15.9164 16.1339 15.6 16.639 15.1091 16.9976C14.6227 17.3502 13.9954 17.527 13.2273 17.527C12.5044 17.527 11.9745 17.3465 11.6364 16.9841C11.4018 16.7267 11.2852 16.3998 11.2852 16.0045C11.2852 15.8411 11.3051 15.6654 11.3448 15.4764L12.1631 11.5972H13.3991L12.5919 15.4325C12.5671 15.5386 12.5571 15.6374 12.5584 15.7265C12.5571 15.9229 12.6068 16.0839 12.7073 16.2095C12.8537 16.3962 13.0914 16.4889 13.4221 16.4889C13.8024 16.4889 14.1158 16.3974 14.359 16.2132C14.6022 16.0302 14.761 15.7704 14.8324 15.4325L15.6422 11.5972H16.8719L16.0529 15.4764Z",fill:"white"}),Object(l.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M21.2436 13.9502H22.2116L21.4534 17.4123H20.4873L21.2436 13.9502ZM21.5482 12.689H22.5248L22.3424 13.5293H21.3659L21.5482 12.689Z",fill:"white"}),Object(l.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M23.0688 17.1487C22.8156 16.9109 22.6878 16.59 22.6865 16.1826C22.6865 16.113 22.6908 16.0338 22.7002 15.9471C22.7095 15.8592 22.7214 15.7739 22.738 15.6946C22.8528 15.1323 23.0973 14.6858 23.4739 14.3564C23.8499 14.0258 24.3036 13.8599 24.8347 13.8599C25.2696 13.8599 25.6145 13.9794 25.8672 14.2185C26.1196 14.4589 26.2462 14.7833 26.2462 15.1957C26.2462 15.2664 26.2407 15.3481 26.2313 15.436C26.2201 15.525 26.2066 15.6104 26.1909 15.6946C26.0787 16.2484 25.8349 16.69 25.4583 17.0134C25.0816 17.3391 24.6293 17.5012 24.1019 17.5012C23.6651 17.5012 23.3213 17.3841 23.0688 17.1487M24.9136 16.4631C25.0843 16.2814 25.2065 16.0056 25.2809 15.6385C25.2921 15.5812 25.302 15.5214 25.3082 15.4616C25.3143 15.403 25.3168 15.3482 25.3168 15.2981C25.3168 15.0846 25.2616 14.9188 25.1506 14.8016C25.0402 14.6833 24.8832 14.6248 24.6804 14.6248C24.4122 14.6248 24.1939 14.7174 24.0227 14.9029C23.8501 15.0884 23.7279 15.3689 23.6509 15.7422C23.6404 15.7995 23.6317 15.8569 23.6237 15.913C23.6175 15.9703 23.6157 16.024 23.6168 16.0728C23.6168 16.285 23.6721 16.4485 23.7831 16.5644C23.8935 16.6803 24.0498 16.7376 24.2553 16.7376C24.5246 16.7376 24.743 16.6461 24.9136 16.4631Z",fill:"white"}),Object(l.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M32.5262 19.8496L32.7596 19.0421H33.9397L33.8888 19.3385C33.8888 19.3385 34.4918 19.0421 34.9261 19.0421C35.3606 19.0421 36.3854 19.0421 36.3854 19.0421L36.1535 19.8496H35.9239L34.8231 23.6582H35.0527L34.8343 24.4146H34.6047L34.5092 24.7427H33.3664L33.4617 24.4146H31.207L31.4268 23.6582H31.6527L32.7544 19.8496H32.5262H32.5262ZM33.7993 19.8498L33.4989 20.8805C33.4989 20.8805 34.0128 20.6866 34.4558 20.6318C34.5536 20.2718 34.6815 19.8498 34.6815 19.8498H33.7993V19.8498ZM33.3598 21.3637L33.0585 22.4433C33.0585 22.4433 33.628 22.1676 34.0188 22.1444C34.1317 21.7271 34.2447 21.3637 34.2447 21.3637H33.3598V21.3637ZM33.5808 23.6583L33.8067 22.8751H32.9258L32.6987 23.6583H33.5808ZM36.4352 18.9922H37.5447L37.5918 19.3946C37.5844 19.4971 37.6463 19.546 37.7779 19.546H37.9739L37.7756 20.2279H36.9601C36.6487 20.2437 36.4886 20.1267 36.4738 19.8741L36.4352 18.9922ZM36.1102 20.4548H39.7039L39.493 21.1868H38.3488L38.1526 21.8673H39.2957L39.0835 22.5981H37.8104L37.5224 23.0264H38.1455L38.2894 23.8839C38.3066 23.9693 38.3836 24.0108 38.5151 24.0108H38.7086L38.5053 24.717H37.8202C37.4653 24.7342 37.2818 24.6171 37.2667 24.3646L37.1016 23.5814L36.5346 24.4146C36.4005 24.65 36.1945 24.7599 35.9167 24.7427H34.8705L35.074 24.0363H35.4004C35.5345 24.0363 35.646 23.9778 35.7465 23.8595L36.634 22.5981H35.4898L35.7018 21.8673H36.9428L37.1402 21.1868H35.898L36.1102 20.4548Z",fill:"white"}),Object(l.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M17.1915 13.9492H18.0645L17.9647 14.4493L18.0899 14.3066C18.3729 14.009 18.7166 13.8613 19.1224 13.8613C19.4898 13.8613 19.7547 13.9663 19.921 14.1773C20.0847 14.3884 20.1294 14.6799 20.0519 15.0544L19.571 17.4137H18.6738L19.1081 15.2752C19.1529 15.0544 19.1405 14.8897 19.0715 14.7836C19.0033 14.6774 18.873 14.625 18.685 14.625C18.4542 14.625 18.26 14.6957 18.1017 14.8361C17.9429 14.9776 17.8381 15.174 17.7865 15.424L17.3863 17.4137H16.4873L17.1915 13.9492Z",fill:"white"}),Object(l.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M27.2021 13.9492H28.0758L27.9767 14.4493L28.1006 14.3066C28.3837 14.009 28.7287 13.8613 29.1332 13.8613C29.5005 13.8613 29.766 13.9663 29.931 14.1773C30.0937 14.3884 30.1408 14.6799 30.0614 15.0544L29.5823 17.4137H28.6839L29.1184 15.2752C29.1629 15.0544 29.1506 14.8897 29.0823 14.7836C29.0115 14.6774 28.8836 14.625 28.6964 14.625C28.4655 14.625 28.272 14.6957 28.1119 14.8361C27.953 14.9776 27.8476 15.174 27.798 15.424L27.396 17.4137H26.498L27.2021 13.9492",fill:"white"}),Object(l.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M31.5212 11.8018H34.0577C34.5454 11.8018 34.9225 11.9104 35.1818 12.1238C35.44 12.3398 35.5692 12.6497 35.5692 13.0534V13.0656C35.5692 13.1424 35.564 13.229 35.5567 13.3229C35.5441 13.4157 35.5279 13.5095 35.5071 13.6072C35.3954 14.1415 35.1359 14.571 34.7352 14.8967C34.333 15.2211 33.8567 15.3846 33.3082 15.3846H31.9479L31.5274 17.4133H30.3496L31.5212 11.8018M32.1554 14.4087H33.2835C33.5776 14.4087 33.8108 14.3415 33.9809 14.2086C34.1497 14.0744 34.2614 13.8695 34.3234 13.5914C34.3332 13.54 34.3394 13.4937 34.3469 13.451C34.3508 13.4108 34.3556 13.3704 34.3556 13.3315C34.3556 13.1326 34.2838 12.9887 34.1397 12.8984C33.9958 12.8068 33.7701 12.763 33.4572 12.763H32.4991L32.1554 14.4087",fill:"white"}),Object(l.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M40.8406 18.0833C40.4683 18.8615 40.1135 19.3152 39.9051 19.5263C39.6964 19.735 39.2833 20.2205 38.2881 20.1839L38.3737 19.5898C39.2112 19.3361 39.6642 18.1929 39.9223 17.6867L39.6146 13.9587L40.2624 13.9502H40.8059L40.8643 16.2888L41.8829 13.9502H42.9143L40.8406 18.0833Z",fill:"white"}),Object(l.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M37.9561 14.232L37.5464 14.509C37.1183 14.1796 36.7274 13.9759 35.9731 14.3199C34.9454 14.7883 34.0868 18.381 36.9161 17.1976L37.0774 17.3855L38.1905 17.4135L38.9215 14.1491L37.9561 14.232M37.3233 16.0168C37.1445 16.5353 36.7451 16.8781 36.4324 16.7805C36.1196 16.6853 36.008 16.1851 36.1891 15.6655C36.3678 15.1458 36.7698 14.8042 37.08 14.9018C37.3927 14.997 37.5056 15.4971 37.3233 16.0168Z",fill:"white"}),Object(l.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M34.3328 5.26107L30.4463 5.25342L34.3106 5.26981C34.318 5.26981 34.3253 5.26107 34.3328 5.26107",fill:"#E02F41"}),Object(l.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M30.4467 5.27406L23.5378 5.25C23.5204 5.25 23.5024 5.25765 23.4844 5.26531L30.4467 5.27406",fill:"#2E4F7D"}));const b=()=>Object(l.createElement)(l.Fragment,null,Object(l.createElement)(t.Text,{as:"h3",variant:"label",weight:"600",size:"12",lineHeight:"16px"},Object(c.__)("Accepted payment methods",'woocommerce')),Object(l.createElement)("div",{className:"woocommerce-task-payment-wcpay__accepted"},Object(l.createElement)(i,null),Object(l.createElement)(o,null),Object(l.createElement)(a,null),Object(l.createElement)(r,null),Object(l.createElement)(m,null),Object(l.createElement)(V,null),Object(l.createElement)(s,null),Object(l.createElement)(p,null),Object(l.createElement)(u,null),Object(l.createElement)(d,null)));var h=({width:C=196,height:e=41})=>Object(l.createElement)("svg",{width:C,height:e,viewBox:`0 0 ${C} ${e}`,fill:"none",xmlns:"http://www.w3.org/2000/svg"},Object(l.createElement)("title",null,"WooCommerce Payments"),Object(l.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M6.16119 0H60.1988C63.6186 0 66.387 2.74594 66.387 6.13799V26.598C66.387 29.99 63.6186 32.736 60.1988 32.736H40.8202L43.48 39.197L31.7823 32.736H6.18833C2.76858 32.736 0.000197874 29.99 0.000197874 26.598V6.13799C-0.0269431 2.77286 2.74143 0 6.16119 0Z",fill:"#7F54B3"}),Object(l.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M3.88666 5.40393C4.26664 4.89243 4.8366 4.62322 5.59655 4.56938C6.98073 4.46169 7.76782 5.1078 7.95781 6.50769C8.79918 12.1342 9.72197 16.8992 10.699 20.8028L16.6429 9.57669C17.1857 8.55369 17.8643 8.01527 18.6785 7.96143C19.8727 7.88066 20.6055 8.63445 20.904 10.2228C21.5826 13.8033 22.4511 16.8454 23.4824 19.4298C24.1881 12.5918 25.3823 7.6653 27.065 4.62322C27.4722 3.86943 28.0692 3.49254 28.8563 3.4387C29.4806 3.38486 30.0505 3.5733 30.5662 3.97712C31.0819 4.38093 31.3533 4.89243 31.4076 5.51161C31.4347 5.99619 31.3533 6.40001 31.1362 6.80383C30.0777 8.74214 29.2092 11.9996 28.5035 16.5223C27.825 20.9104 27.5807 24.3294 27.7436 26.7792C27.7978 27.4522 27.6893 28.0445 27.4179 28.556C27.0922 29.1483 26.6036 29.4713 25.9794 29.5252C25.2737 29.579 24.5409 29.256 23.8353 28.5291C21.3112 25.9716 19.3027 22.1488 17.8371 17.0607C16.073 20.5066 14.7702 23.091 13.9288 24.814C12.3275 27.8561 10.9705 29.4175 9.83053 29.4982C9.09773 29.5521 8.47349 28.9329 7.93067 27.6407C6.54648 24.114 5.05373 17.303 3.45241 7.20764C3.37099 6.5077 3.50669 5.88851 3.88666 5.40393ZM62.24 9.6307C61.263 7.93467 59.8245 6.91167 57.8975 6.50786C57.3818 6.40017 56.8933 6.34633 56.4319 6.34633C53.8263 6.34633 51.7094 7.69238 50.0537 10.3845C48.6424 12.6728 47.9368 15.2033 47.9368 17.9762C47.9368 20.0491 48.371 21.8259 49.2395 23.3066C50.2166 25.0026 51.6551 26.0256 53.5821 26.4294C54.0978 26.5371 54.5863 26.5909 55.0477 26.5909C57.6804 26.5909 59.7974 25.2449 61.4258 22.5528C62.8371 20.2376 63.5428 17.707 63.5428 14.9341C63.5428 12.8343 63.1086 11.0844 62.24 9.6307ZM58.8203 17.0878C58.4403 18.8646 57.7618 20.1837 56.7576 21.0721C55.9705 21.7721 55.2377 22.0682 54.5592 21.9336C53.9078 21.799 53.365 21.2337 52.9578 20.1837C52.6321 19.3492 52.4693 18.5146 52.4693 17.7339C52.4693 17.0609 52.5236 16.3879 52.6593 15.7687C52.9036 14.6649 53.365 13.5881 54.0978 12.5651C54.9934 11.246 55.9433 10.7075 56.9204 10.896C57.5718 11.0306 58.1146 11.5959 58.5217 12.6458C58.8474 13.4804 59.0103 14.315 59.0103 15.0957C59.0103 15.7956 58.9288 16.4686 58.8203 17.0878ZM40.8794 6.50786C42.7793 6.91167 44.2449 7.93467 45.222 9.6307C46.0905 11.0844 46.5247 12.8343 46.5247 14.9341C46.5247 17.707 45.8191 20.2376 44.4077 22.5528C42.7793 25.2449 40.6623 26.5909 38.0296 26.5909C37.5682 26.5909 37.0797 26.5371 36.564 26.4294C34.637 26.0256 33.1985 25.0026 32.2214 23.3066C31.3529 21.8259 30.9187 20.0491 30.9187 17.9762C30.9187 15.2033 31.6243 12.6728 33.0357 10.3845C34.6913 7.69238 36.8083 6.34633 39.4138 6.34633C39.8752 6.34633 40.3637 6.40017 40.8794 6.50786ZM39.7395 21.0721C40.7437 20.1837 41.4222 18.8646 41.8022 17.0878C41.9379 16.4686 41.9922 15.7956 41.9922 15.0957C41.9922 14.315 41.8293 13.4804 41.5036 12.6458C41.0965 11.5959 40.5537 11.0306 39.9023 10.896C38.9253 10.7075 37.9753 11.246 37.0797 12.5651C36.3469 13.5881 35.8855 14.6649 35.6412 15.7687C35.5055 16.3879 35.4512 17.0609 35.4512 17.7339C35.4512 18.5146 35.6141 19.3492 35.9398 20.1837C36.3469 21.2337 36.8897 21.799 37.5411 21.9336C38.2196 22.0682 38.9524 21.7721 39.7395 21.0721Z",fill:"white"}),Object(l.createElement)("path",{d:"M143.023 29.9316V38.217H144.057V35.26H146.141C147.697 35.26 148.805 34.1633 148.805 32.613C148.805 31.0341 147.72 29.9316 146.153 29.9316H143.023ZM144.057 30.8503H145.883C147.083 30.8503 147.743 31.4762 147.743 32.613C147.743 33.7097 147.06 34.3413 145.883 34.3413H144.057V30.8503Z",fill:"black"}),Object(l.createElement)("path",{d:"M151.866 38.3261C152.693 38.3261 153.37 37.9643 153.772 37.304H153.864V38.217H154.806V33.9796C154.806 32.6934 153.961 31.9183 152.451 31.9183C151.131 31.9183 150.155 32.5728 150.023 33.5662H151.022C151.159 33.0781 151.676 32.7968 152.417 32.7968C153.341 32.7968 153.818 33.2159 153.818 33.9796V34.5423L152.032 34.6514C150.591 34.7375 149.776 35.3748 149.776 36.483C149.776 37.6141 150.666 38.3261 151.866 38.3261ZM152.049 37.4591C151.332 37.4591 150.798 37.0916 150.798 36.46C150.798 35.8399 151.211 35.5126 152.153 35.4495L153.818 35.3404V35.9088C153.818 36.793 153.066 37.4591 152.049 37.4591Z",fill:"black"}),Object(l.createElement)("path",{d:"M156.93 40.4563C158.027 40.4563 158.52 40.0314 159.049 38.5959L161.466 32.0274H160.415L158.721 37.1203H158.63L156.93 32.0274H155.862L158.153 38.2227L158.038 38.5902C157.78 39.3366 157.47 39.6065 156.901 39.6065C156.763 39.6065 156.608 39.6007 156.488 39.5778V40.4218C156.626 40.4448 156.798 40.4563 156.93 40.4563Z",fill:"black"}),Object(l.createElement)("path",{d:"M162.787 38.217H163.774V34.3815C163.774 33.5087 164.4 32.8083 165.21 32.8083C165.99 32.8083 166.501 33.2791 166.501 34.014V38.217H167.489V34.238C167.489 33.4513 168.063 32.8083 168.924 32.8083C169.797 32.8083 170.228 33.2561 170.228 34.1691V38.217H171.215V33.9394C171.215 32.6417 170.509 31.9183 169.246 31.9183C168.39 31.9183 167.684 32.3489 167.351 33.0035H167.259C166.972 32.3604 166.387 31.9183 165.548 31.9183C164.722 31.9183 164.101 32.3145 163.82 33.0035H163.728V32.0274H162.787V38.217Z",fill:"black"}),Object(l.createElement)("path",{d:"M177.118 36.615C176.86 37.1605 176.32 37.4533 175.522 37.4533C174.471 37.4533 173.788 36.6782 173.736 35.4552V35.4093H178.186V35.0303C178.186 33.1068 177.17 31.9183 175.499 31.9183C173.799 31.9183 172.708 33.1815 172.708 35.1279C172.708 37.0859 173.782 38.3261 175.499 38.3261C176.854 38.3261 177.818 37.6715 178.106 36.615H177.118ZM175.487 32.791C176.469 32.791 177.124 33.5145 177.147 34.6112H173.736C173.811 33.5145 174.5 32.791 175.487 32.791Z",fill:"black"}),Object(l.createElement)("path",{d:"M179.736 38.217H180.724V34.5537C180.724 33.4686 181.361 32.8083 182.349 32.8083C183.336 32.8083 183.807 33.3365 183.807 34.4504V38.217H184.795V34.2092C184.795 32.7394 184.02 31.9183 182.63 31.9183C181.683 31.9183 181.08 32.3202 180.77 33.0035H180.678V32.0274H179.736V38.217Z",fill:"black"}),Object(l.createElement)("path",{d:"M187.017 30.4254V32.0274H186.018V32.8542H187.017V36.6093C187.017 37.7921 187.528 38.2629 188.802 38.2629C188.998 38.2629 189.187 38.24 189.382 38.2055V37.3729C189.199 37.3902 189.101 37.3959 188.923 37.3959C188.28 37.3959 188.004 37.0859 188.004 36.3567V32.8542H189.382V32.0274H188.004V30.4254H187.017Z",fill:"black"}),Object(l.createElement)("path",{d:"M190.617 33.7212C190.617 34.6169 191.145 35.1164 192.305 35.3978L193.367 35.6562C194.027 35.8169 194.349 36.104 194.349 36.5289C194.349 37.0973 193.752 37.4935 192.919 37.4935C192.127 37.4935 191.633 37.1605 191.467 36.638H190.45C190.559 37.6658 191.507 38.3261 192.885 38.3261C194.292 38.3261 195.365 37.5624 195.365 36.4543C195.365 35.5643 194.803 35.059 193.637 34.7777L192.684 34.548C191.955 34.37 191.61 34.1059 191.61 33.681C191.61 33.1298 192.184 32.7566 192.919 32.7566C193.666 32.7566 194.148 33.0839 194.28 33.5777H195.256C195.124 32.5614 194.223 31.9183 192.925 31.9183C191.61 31.9183 190.617 32.6934 190.617 33.7212Z",fill:"black"}),Object(l.createElement)("path",{d:"M73.2688 9.52456C71.4503 11.3014 70.5547 13.5627 70.5547 16.3087C70.5547 19.2431 71.4503 21.639 73.2416 23.4427C75.0329 25.2464 77.3671 26.1618 80.2711 26.1618C81.1125 26.1618 82.0625 26.0272 83.0938 25.731V21.3698C82.1439 21.639 81.3296 21.7736 80.624 21.7736C79.1855 21.7736 78.0456 21.289 77.1771 20.3468C76.3086 19.3777 75.8743 18.0854 75.8743 16.4433C75.8743 14.9088 76.3086 13.6435 77.1499 12.6743C78.0185 11.6782 79.0769 11.1937 80.3797 11.1937C81.2211 11.1937 82.1167 11.3283 83.0938 11.5975V7.23628C82.1982 6.99399 81.1939 6.8863 80.1354 6.8863C77.3671 6.85938 75.0872 7.74778 73.2688 9.52456ZM92.1046 6.85938C89.6076 6.85938 87.6535 7.69393 86.2422 9.33611C84.8308 10.9783 84.1523 13.2935 84.1523 16.2548C84.1523 19.4584 84.858 21.9082 86.2422 23.6043C87.6263 25.3003 89.6619 26.1618 92.3217 26.1618C94.9001 26.1618 96.8814 25.3003 98.2656 23.6043C99.6498 21.9082 100.355 19.5123 100.355 16.4433C100.355 13.3743 99.6498 11.0052 98.2384 9.33611C96.8 7.69393 94.7644 6.85938 92.1046 6.85938ZM94.2487 20.8583C93.7602 21.6121 93.0274 21.989 92.1046 21.989C91.2361 21.989 90.5847 21.6121 90.1233 20.8583C89.6619 20.1045 89.4448 18.5969 89.4448 16.3087C89.4448 12.782 90.3404 11.0321 92.1589 11.0321C94.0587 11.0321 95.0358 12.8089 95.0358 16.3894C95.0087 18.597 94.7373 20.1045 94.2487 20.8583ZM113.763 7.37088L112.786 11.4898C112.542 12.5397 112.297 13.6166 112.08 14.7203L111.538 17.5739C111.022 14.7203 110.316 11.3283 109.421 7.37088H103.124L100.763 25.7041H105.485L106.761 13.0781L109.99 25.7041H113.356L116.45 13.1051L117.78 25.7041H122.72L120.223 7.37088H113.763ZM136.371 7.37088L135.394 11.4898C135.15 12.5397 134.906 13.6166 134.689 14.7203L134.146 17.5739C133.63 14.7203 132.925 11.3283 132.029 7.37088H125.732L123.371 25.7041H128.093L129.369 13.0781L132.599 25.7041H135.964L139.031 13.1051L140.361 25.7041H145.301L142.804 7.37088H136.371ZM151.733 18.4623H156.157V14.6665H151.733V11.3013H156.836V7.3978H146.739V25.731H156.863V21.8275H151.733V18.4623ZM170.922 15.5549C171.438 14.7203 171.709 13.8588 171.709 12.9705C171.709 11.2475 171.03 9.87453 169.673 8.87845C168.316 7.88237 166.444 7.37088 164.11 7.37088H158.301V25.7041H163.295V17.3586H163.377L167.421 25.7041H172.686L168.696 17.4393C169.646 17.0086 170.406 16.3894 170.922 15.5549ZM163.268 15.2587V10.8975C164.462 10.9245 165.304 11.1129 165.819 11.4898C166.335 11.8667 166.579 12.4589 166.579 13.3204C166.579 14.5857 165.467 15.2318 163.268 15.2587ZM174.64 9.52456C172.822 11.3014 171.926 13.5627 171.926 16.3087C171.926 19.2431 172.822 21.639 174.613 23.4427C176.404 25.2464 178.738 26.1618 181.643 26.1618C182.484 26.1618 183.434 26.0272 184.465 25.731V21.3698C183.515 21.639 182.701 21.7736 181.995 21.7736C180.557 21.7736 179.417 21.289 178.548 20.3468C177.68 19.3777 177.246 18.0854 177.246 16.4433C177.246 14.9088 177.68 13.6435 178.521 12.6743C179.39 11.6782 180.448 11.1937 181.751 11.1937C182.592 11.1937 183.488 11.3283 184.465 11.5975V7.23628C183.57 6.99399 182.565 6.8863 181.507 6.8863C178.766 6.85938 176.459 7.74778 174.64 9.52456ZM190.843 21.7736V18.4354H195.267V14.6396H190.843V11.2744H195.973V7.37088H185.877V25.7041H196V21.8005H190.843V21.7736Z",fill:"black"}));const f=({logoWidth:C=196,logoHeight:e=41,children:H})=>Object(l.createElement)(L.CardHeader,{as:"h2"},Object(l.createElement)(h,{width:C,height:e}),H),O=({description:C,heading:e,onLinkClick:H=(()=>{})})=>Object(l.createElement)(L.CardBody,null,e&&Object(l.createElement)(t.Text,{as:"h2"},e),Object(l.createElement)(t.Text,{className:"woocommerce-task-payment-wcpay__description",as:"p",lineHeight:"1.5em"},C,Object(l.createElement)("br",null),Object(l.createElement)(n.Link,{target:"_blank",type:"external",rel:"noreferrer",href:"https://woocommerce.com/payments/?utm_medium=product",onClick:H},Object(c.__)("Learn more",'woocommerce'))),Object(l.createElement)(b,null)),j=({children:C})=>Object(l.createElement)(L.CardFooter,null,C),M=({children:C})=>Object(l.createElement)(L.Card,{className:"woocommerce-task-payment-wcpay"},C),E=({isLocalPartner:C=!1})=>{const e=C?Object(c.__)("Local Partner",'woocommerce'):Object(c.__)("Recommended",'woocommerce');return Object(l.createElement)("div",{className:"woocommerce-task-payment__recommended-ribbon"},Object(l.createElement)("span",null,e))};var Z=H(61),w=H.n(Z);const v=()=>Object(l.createElement)("span",{className:"woocommerce-task-payment__setup_required"},Object(l.createElement)(w.a,null),Object(l.createElement)(t.Text,{variant:"small",size:"14",lineHeight:"20px"},Object(c.__)("Setup required",'woocommerce')));var g=()=>Object(l.createElement)("svg",{width:"36",height:"25",viewBox:"0 0 36 25",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Object(l.createElement)("rect",{x:"1.41431",y:"1",width:"33.7586",height:"23",rx:"3.5",fill:"white",stroke:"#F3F3F3"}),Object(l.createElement)("path",{d:"M17.645 14.9708V12.2642V12.2636H19.1074C19.7104 12.264 20.2171 12.0743 20.6276 11.6946C21.0425 11.3342 21.2745 10.816 21.2627 10.2759C21.2709 9.73881 21.0393 9.22448 20.6276 8.86525C20.2207 8.48344 19.6734 8.27511 19.1074 8.28658H16.7598V14.9708H17.645ZM17.6451 11.4427V9.10938V9.10885H19.1295C19.4604 9.09983 19.7793 9.22898 20.0054 9.46351C20.2328 9.678 20.3611 9.97262 20.3611 10.2803C20.3611 10.588 20.2328 10.8826 20.0054 11.0971C19.7766 11.3267 19.4586 11.4522 19.1295 11.4427H17.6451Z",fill:"#5F6368"}),Object(l.createElement)("path",{d:"M24.8518 10.7568C24.4731 10.4176 23.9567 10.248 23.3024 10.248C22.462 10.248 21.8273 10.5467 21.3985 11.144L22.1781 11.6203C22.4662 11.2157 22.8574 11.0134 23.3519 11.0134C23.6672 11.0098 23.9722 11.1216 24.2063 11.3264C24.4397 11.5136 24.5739 11.7927 24.5719 12.0864V12.2827C24.2318 12.096 23.7989 12.0027 23.2733 12.0027C22.6575 12.0034 22.1652 12.1435 21.7965 12.423C21.4278 12.7024 21.2434 13.0788 21.2434 13.552C21.2354 13.983 21.4281 14.3944 21.7679 14.672C22.1176 14.9707 22.5521 15.12 23.0715 15.12C23.68 15.12 24.1674 14.8587 24.534 14.336H24.5725V14.9707H25.4192V12.152C25.4195 11.5611 25.2304 11.096 24.8518 10.7568ZM22.4508 14.1307C22.2654 14.0011 22.156 13.7924 22.1572 13.5707C22.1572 13.3216 22.2776 13.1142 22.5201 12.9435C22.7602 12.7753 23.06 12.6912 23.4196 12.6912C23.9133 12.6912 24.2982 12.7979 24.5742 13.0112C24.5742 13.3718 24.4276 13.6859 24.1343 13.9536C23.8702 14.2099 23.5122 14.3541 23.1386 14.3547C22.8896 14.3592 22.6466 14.2801 22.4508 14.1307Z",fill:"#5F6368"}),Object(l.createElement)("path",{d:"M30.2792 10.3975L27.3235 16.9868H26.4097L27.5065 14.6812L25.563 10.3975H26.5251L27.9299 13.6828H27.9491L29.3154 10.3975H30.2792Z",fill:"#5F6368"}),Object(l.createElement)("path",{d:"M14.0677 11.6812C14.068 11.4195 14.0452 11.1583 13.9995 10.9004H10.2664V12.3793H12.4045C12.3161 12.8566 12.0305 13.2782 11.6139 13.5463V14.5063H12.89C13.6372 13.838 14.0677 12.8497 14.0677 11.6812Z",fill:"#4285F4"}),Object(l.createElement)("path",{d:"M10.2666 15.4332C11.3349 15.4332 12.2344 15.0929 12.8903 14.5063L11.6142 13.5463C11.259 13.7799 10.8016 13.9132 10.2666 13.9132C9.23409 13.9132 8.35771 13.238 8.04432 12.3281H6.72974V13.3175C7.40168 14.6145 8.77018 15.4331 10.2666 15.4332Z",fill:"#34A853"}),Object(l.createElement)("path",{d:"M8.04421 12.3283C7.87853 11.8516 7.87853 11.3353 8.04421 10.8585V9.86914H6.72962C6.1676 10.954 6.1676 12.2328 6.72962 13.3177L8.04421 12.3283Z",fill:"#FBBC04"}),Object(l.createElement)("path",{d:"M10.2666 9.27318C10.8312 9.26424 11.3766 9.47114 11.7852 9.84918L12.915 8.75318C12.1986 8.10042 11.2495 7.74205 10.2666 7.75318C8.77018 7.75325 7.40168 8.57187 6.72974 9.86892L8.04432 10.8582C8.35771 9.94838 9.23409 9.27318 10.2666 9.27318Z",fill:"#EA4335"}));const R=({id:C,...e})=>Object(l.createElement)(L.Fill,Object.assign({name:"woocommerce_payment_gateway_setup_"+C},e));R.Slot=({id:C,fillProps:e})=>Object(l.createElement)(L.Slot,{name:"woocommerce_payment_gateway_setup_"+C,fillProps:e});const _=({id:C,...e})=>Object(l.createElement)(L.Fill,Object.assign({name:"woocommerce_payment_gateway_configure_"+C},e));_.Slot=({id:C,fillProps:e})=>Object(l.createElement)(L.Slot,{name:"woocommerce_payment_gateway_configure_"+C,fillProps:e});const y=({id:C,...e})=>Object(l.createElement)(L.Fill,Object.assign({name:"woocommerce_onboarding_task_"+C},e));y.Slot=({id:C,fillProps:e})=>Object(l.createElement)(L.Slot,{name:"woocommerce_onboarding_task_"+C,fillProps:e});const k=({id:C,...e})=>Object(l.createElement)(L.Fill,Object.assign({name:"woocommerce_onboarding_task_list_item_"+C},e));k.Slot=({id:C,fillProps:e})=>Object(l.createElement)(L.Slot,{name:"woocommerce_onboarding_task_list_item_"+C,fillProps:e})},507:function(C,e,H){"use strict";H.d(e,"a",(function(){return t}));var L=H(7);function t(C){const{createNotice:e}=Object(L.dispatch)("core/notices");C.error_data&&C.errors&&Object.keys(C.errors).length?Object.keys(C.errors).forEach(H=>{e("error",C.errors[H].join(" "))}):C.message&&e(C.code?"error":"success",C.message)}},514:function(C,e,H){"use strict";var L=H(0),t=H(2),l=H(14),n=H(7),c=H(18),i=H.n(c),o=H(3),a=H(21),r=H(11),d=H(122);class V extends L.Component{constructor(C){super(C),this.state={isLoadingScripts:!1,isRequestStarted:!1}}async componentDidUpdate(C,e){const{hasErrors:H,isRequesting:L,onClose:l,onContinue:n,createNotice:c}=this.props,{isLoadingScripts:i,isRequestStarted:o}=this.state;if(!o)return;const a=!L&&!i&&(C.isRequesting||e.isLoadingScripts)&&!H,r=!L&&C.isRequesting&&H;a&&(l(),n()),r&&(c("error",Object(t.__)("There was a problem updating your preferences",'woocommerce')),l())}updateTracking({allowTracking:C}){const{updateOptions:e}=this.props;C&&"function"==typeof window.wcTracks.enable?(this.setState({isLoadingScripts:!0}),window.wcTracks.enable(()=>{this._isMounted&&(Object(d.initializeExPlat)(),this.setState({isLoadingScripts:!1}))})):C||(window.wcTracks.isEnabled=!1);const H=C?"yes":"no";this.setState({isRequestStarted:!0}),e({woocommerce_allow_tracking:H})}componentDidMount(){this._isMounted=!0}componentWillUnmount(){this._isMounted=!1}render(){const{allowTracking:C,isResolving:e,onClose:H,onContinue:l}=this.props;if(e)return null;if(C)return H(),l(),null;const{isRequesting:n,title:c=Object(t.__)("Build a better WooCommerce",'woocommerce'),message:r=i()({mixedString:Object(t.__)("Get improved features and faster fixes by sharing non-sensitive data via {{link}}usage tracking{{/link}} that shows us how WooCommerce is used. No personal data is tracked or stored.",'woocommerce'),components:{link:Object(L.createElement)(a.Link,{href:"https://woocommerce.com/usage-tracking?utm_medium=product",target:"_blank",type:"external"})}}),dismissActionText:d=Object(t.__)("No thanks",'woocommerce'),acceptActionText:V=Object(t.__)("Yes, count me in!",'woocommerce')}=this.props,{isRequestStarted:m}=this.state,s=m&&n;return Object(L.createElement)(o.Modal,{title:c,isDismissible:this.props.isDismissible,onRequestClose:()=>this.props.onClose(),className:"woocommerce-usage-modal"},Object(L.createElement)("div",{className:"woocommerce-usage-modal__wrapper"},Object(L.createElement)("div",{className:"woocommerce-usage-modal__message"},r),Object(L.createElement)("div",{className:"woocommerce-usage-modal__actions"},Object(L.createElement)(o.Button,{isSecondary:!0,isBusy:s,onClick:()=>this.updateTracking({allowTracking:!1})},d),Object(L.createElement)(o.Button,{isPrimary:!0,isBusy:s,onClick:()=>this.updateTracking({allowTracking:!0})},V))))}}e.a=Object(l.compose)(Object(n.withSelect)(C=>{const{getOption:e,getOptionsUpdatingError:H,isOptionsUpdating:L,hasFinishedResolution:t}=C(r.OPTIONS_STORE_NAME);return{allowTracking:"yes"===e("woocommerce_allow_tracking"),isRequesting:Boolean(L()),isResolving:!t("getOption",["woocommerce_allow_tracking"])||void 0===e("woocommerce_allow_tracking"),hasErrors:Boolean(H())}}),Object(n.withDispatch)(C=>{const{createNotice:e}=C("core/notices"),{updateOptions:H}=C(r.OPTIONS_STORE_NAME);return{createNotice:e,updateOptions:H}}))(V)},519:function(C,e,H){"use strict";H.r(e),H.d(e,"UsageModal",(function(){return a}));var L=H(0),t=H(2),l=H(12),n=H(18),c=H.n(n),i=H(21),o=H(514);const a=()=>{const C="1"===Object(l.getQuery)()["wcpay-connection-success"],[e,H]=Object(L.useState)(C);if(!e)return null;const n=()=>{H(!1),Object(l.updateQueryString)({"wcpay-connection-success":void 0})},a=Object(t.__)("Help us build a better WooCommerce Payments experience",'woocommerce'),r=c()({mixedString:Object(t.__)("By agreeing to share non-sensitive {{link}}usage data{{/link}}, you’ll help us improve features and optimize the WooCommerce Payments experience. You can opt out at any time.",'woocommerce'),components:{link:Object(L.createElement)(i.Link,{href:"https://woocommerce.com/usage-tracking?utm_medium=product",target:"_blank",type:"external"})}});return Object(L.createElement)(o.a,{isDismissible:!1,title:a,message:r,acceptActionText:Object(t.__)("I agree",'woocommerce'),dismissActionText:Object(t.__)("No thanks",'woocommerce'),onContinue:n,onClose:n})};e.default=a},539:function(C,e,H){"use strict";H.d(e,"b",(function(){return o})),H.d(e,"c",(function(){return a})),H.d(e,"a",(function(){return h}));var L=H(2),t=H(17),l=H.n(t),n=H(11),c=H(16),i=H(507);function o(C,e,H){const t=Object(L.__)("There was an error connecting to WooCommerce Payments. Please try again or connect later in store settings.",'woocommerce');H(["woocommerce-payments"]).then(()=>{Object(c.recordEvent)("woocommerce_payments_install",{context:"tasklist"}),l()({path:n.WC_ADMIN_NAMESPACE+"/plugins/connect-wcpay",method:"POST"}).then(C=>{window.location=C.connectUrl}).catch(()=>{e("error",t),C()})}).catch(e=>{Object(i.a)(e),C()})}function a(C){return["US","PR","AU","CA","DE","ES","FR","GB","IE","IT","NZ","AT","BE","NL","PL","PT","CH","HK","SG"].includes(C)}var r=H(0),d=H(18),V=H.n(d),m=H(21),s=H(20),u=H(271),p=H(542);const b=()=>V()({mixedString:Object(L.__)('Upon clicking "Get started", you agree to the {{link}}Terms of service{{/link}}. Next we’ll ask you to share a few details about your business to create your account.','woocommerce'),components:{link:Object(r.createElement)(m.Link,{href:"https://wordpress.com/tos/",target:"_blank",type:"external"})}}),h=({paymentGateway:C,onSetupCallback:e=null})=>{const{description:H,id:t,needsSetup:l,installed:n,enabled:i,installed:o}=C;return Object(r.createElement)(u.WCPayCard,null,Object(r.createElement)(u.WCPayCardHeader,null,n&&l?Object(r.createElement)(u.SetupRequired,null):Object(r.createElement)(m.Pill,null,Object(L.__)("Recommended",'woocommerce'))),Object(r.createElement)(u.WCPayCardBody,{description:H,onLinkClick:()=>{Object(c.recordEvent)("tasklist_payment_learn_more")}}),Object(r.createElement)(u.WCPayCardFooter,null,Object(r.createElement)(r.Fragment,null,Object(r.createElement)(s.Text,{lineHeight:"1.5em"},Object(r.createElement)(b,null)),Object(r.createElement)(p.a,{id:t,hasSetup:!0,needsSetup:l,isEnabled:i,isRecommended:!0,isInstalled:o,hasPlugins:!0,setupButtonText:Object(L.__)("Get started",'woocommerce'),onSetupCallback:e}))))};H(519)},542:function(C,e,H){"use strict";H.d(e,"a",(function(){return i}));var L=H(0),t=H(2),l=H(3),n=H(12),c=H(16);const i=({hasSetup:C=!1,needsSetup:e=!0,id:H,isEnabled:i=!1,isLoading:o=!1,isInstalled:a=!1,isRecommended:r=!1,hasPlugins:d,manageUrl:V=null,markConfigured:m,onSetUp:s=(()=>{}),onSetupCallback:u,setupButtonText:p=Object(t.__)("Set up",'woocommerce')})=>{const[b,h]=Object(L.useState)(!1),f="woocommerce-task-payment__action";if(o)return Object(L.createElement)(l.Spinner,null);const O=async()=>{if(s(H),u)return h(!0),void await new Promise(u).then(()=>{h(!1)}).catch(()=>{h(!1)});Object(n.updateQueryString)({id:H})},j=()=>Object(L.createElement)(l.Button,{className:f,isSecondary:!0,role:"button",href:V,onClick:()=>Object(c.recordEvent)("tasklist_payment_manage",{id:H})},Object(t.__)("Manage",'woocommerce')),M=()=>Object(L.createElement)(l.Button,{className:f,isPrimary:r,isSecondary:!r,isBusy:b,disabled:b,onClick:()=>O()},p);return C?d?e?a&&d?Object(L.createElement)("div",null,Object(L.createElement)(l.Button,{className:f,isPrimary:r,isSecondary:!r,isBusy:b,disabled:b,onClick:()=>O()},Object(t.__)("Finish setup",'woocommerce'))):Object(L.createElement)(M,null):Object(L.createElement)(j,null):i?Object(L.createElement)(j,null):Object(L.createElement)(M,null):i?Object(L.createElement)(j,null):Object(L.createElement)(l.Button,{className:f,isSecondary:!0,onClick:()=>m(H)},Object(t.__)("Enable",'woocommerce'))}}}]);woocommerce-admin/dist/chunks/12.style.css000064400000003031151335517650014512 0ustar00:root{--wp-admin-theme-color:#007cba;--wp-admin-theme-color-darker-10:#006ba1;--wp-admin-theme-color-darker-20:#005a87}body.admin-color-light{--wp-admin-theme-color:#0085ba;--wp-admin-theme-color-darker-10:#0073a1;--wp-admin-theme-color-darker-20:#006187}body.admin-color-modern{--wp-admin-theme-color:#3858e9;--wp-admin-theme-color-darker-10:#2145e6;--wp-admin-theme-color-darker-20:#183ad6}body.admin-color-blue{--wp-admin-theme-color:#096484;--wp-admin-theme-color-darker-10:#07526c;--wp-admin-theme-color-darker-20:#064054}body.admin-color-coffee{--wp-admin-theme-color:#46403c;--wp-admin-theme-color-darker-10:#383330;--wp-admin-theme-color-darker-20:#2b2724}body.admin-color-ectoplasm{--wp-admin-theme-color:#523f6d;--wp-admin-theme-color-darker-10:#46365d;--wp-admin-theme-color-darker-20:#3a2c4d}body.admin-color-midnight{--wp-admin-theme-color:#e14d43;--wp-admin-theme-color-darker-10:#dd382d;--wp-admin-theme-color-darker-20:#d02c21}body.admin-color-ocean{--wp-admin-theme-color:#627c83;--wp-admin-theme-color-darker-10:#576e74;--wp-admin-theme-color-darker-20:#4c6066}body.admin-color-sunrise{--wp-admin-theme-color:#dd823b;--wp-admin-theme-color-darker-10:#d97426;--wp-admin-theme-color-darker-20:#c36922}.woocommerce-table__product-categories>.woocommerce-table__breadcrumbs{display:inline-block;margin-right:12px}.woocommerce-table__product-categories .components-popover__content{padding:0 16px;text-align:left}.woocommerce-table__product-categories .components-popover__content .woocommerce-table__breadcrumbs{margin-top:12px;margin-bottom:12px}woocommerce-admin/dist/chunks/2.js000064400000023111151335517650013117 0ustar00(window.__wcAdmin_webpackJsonp=window.__wcAdmin_webpackJsonp||[]).push([[2],{169:function(e,t,n){"use strict";var i=n(23),s=n(22),r=n(25);n(1);function a(e,t){return e.replace(new RegExp("(^|\\s)"+t+"(?:\\s|$)","g"),"$1").replace(/\s+/g," ").replace(/^\s*|\s*$/g,"")}var o=n(5),l=n.n(o),c=n(65),u=function(e,t){return e&&t&&t.split(" ").forEach((function(t){return i=t,void((n=e).classList?n.classList.remove(i):"string"==typeof n.className?n.className=a(n.className,i):n.setAttribute("class",a(n.className&&n.className.baseVal||"",i)));var n,i}))},p=function(e){function t(){for(var t,n=arguments.length,i=new Array(n),s=0;s<n;s++)i[s]=arguments[s];return(t=e.call.apply(e,[this].concat(i))||this).appliedClasses={appear:{},enter:{},exit:{}},t.onEnter=function(e,n){var i=t.resolveArguments(e,n),s=i[0],r=i[1];t.removeClasses(s,"exit"),t.addClass(s,r?"appear":"enter","base"),t.props.onEnter&&t.props.onEnter(e,n)},t.onEntering=function(e,n){var i=t.resolveArguments(e,n),s=i[0],r=i[1]?"appear":"enter";t.addClass(s,r,"active"),t.props.onEntering&&t.props.onEntering(e,n)},t.onEntered=function(e,n){var i=t.resolveArguments(e,n),s=i[0],r=i[1]?"appear":"enter";t.removeClasses(s,r),t.addClass(s,r,"done"),t.props.onEntered&&t.props.onEntered(e,n)},t.onExit=function(e){var n=t.resolveArguments(e)[0];t.removeClasses(n,"appear"),t.removeClasses(n,"enter"),t.addClass(n,"exit","base"),t.props.onExit&&t.props.onExit(e)},t.onExiting=function(e){var n=t.resolveArguments(e)[0];t.addClass(n,"exit","active"),t.props.onExiting&&t.props.onExiting(e)},t.onExited=function(e){var n=t.resolveArguments(e)[0];t.removeClasses(n,"exit"),t.addClass(n,"exit","done"),t.props.onExited&&t.props.onExited(e)},t.resolveArguments=function(e,n){return t.props.nodeRef?[t.props.nodeRef.current,e]:[e,n]},t.getClassNames=function(e){var n=t.props.classNames,i="string"==typeof n,s=i?""+(i&&n?n+"-":"")+e:n[e];return{baseClassName:s,activeClassName:i?s+"-active":n[e+"Active"],doneClassName:i?s+"-done":n[e+"Done"]}},t}Object(r.a)(t,e);var n=t.prototype;return n.addClass=function(e,t,n){var i=this.getClassNames(t)[n+"ClassName"],s=this.getClassNames("enter").doneClassName;"appear"===t&&"done"===n&&s&&(i+=" "+s),"active"===n&&e&&e.scrollTop,i&&(this.appliedClasses[t][n]=i,function(e,t){e&&t&&t.split(" ").forEach((function(t){return i=t,void((n=e).classList?n.classList.add(i):function(e,t){return e.classList?!!t&&e.classList.contains(t):-1!==(" "+(e.className.baseVal||e.className)+" ").indexOf(" "+t+" ")}(n,i)||("string"==typeof n.className?n.className=n.className+" "+i:n.setAttribute("class",(n.className&&n.className.baseVal||"")+" "+i)));var n,i}))}(e,i))},n.removeClasses=function(e,t){var n=this.appliedClasses[t],i=n.base,s=n.active,r=n.done;this.appliedClasses[t]={},i&&u(e,i),s&&u(e,s),r&&u(e,r)},n.render=function(){var e=this.props,t=(e.classNames,Object(s.a)(e,["classNames"]));return l.a.createElement(c.a,Object(i.a)({},t,{onEnter:this.onEnter,onEntered:this.onEntered,onEntering:this.onEntering,onExit:this.onExit,onExiting:this.onExiting,onExited:this.onExited}))},t}(l.a.Component);p.defaultProps={classNames:""},p.propTypes={};t.a=p},172:function(e,t,n){"use strict";var i=n(22),s=n(23);var r=n(25),a=(n(1),n(5)),o=n.n(a),l=n(33);function c(e,t){var n=Object.create(null);return e&&a.Children.map(e,(function(e){return e})).forEach((function(e){n[e.key]=function(e){return t&&Object(a.isValidElement)(e)?t(e):e}(e)})),n}function u(e,t,n){return null!=n[t]?n[t]:e.props[t]}function p(e,t,n){var i=c(e.children),s=function(e,t){function n(n){return n in t?t[n]:e[n]}e=e||{},t=t||{};var i,s=Object.create(null),r=[];for(var a in e)a in t?r.length&&(s[a]=r,r=[]):r.push(a);var o={};for(var l in t){if(s[l])for(i=0;i<s[l].length;i++){var c=s[l][i];o[s[l][i]]=n(c)}o[l]=n(l)}for(i=0;i<r.length;i++)o[r[i]]=n(r[i]);return o}(t,i);return Object.keys(s).forEach((function(r){var o=s[r];if(Object(a.isValidElement)(o)){var l=r in t,c=r in i,p=t[r],d=Object(a.isValidElement)(p)&&!p.props.in;!c||l&&!d?c||!l||d?c&&l&&Object(a.isValidElement)(p)&&(s[r]=Object(a.cloneElement)(o,{onExited:n.bind(null,o),in:p.props.in,exit:u(o,"exit",e),enter:u(o,"enter",e)})):s[r]=Object(a.cloneElement)(o,{in:!1}):s[r]=Object(a.cloneElement)(o,{onExited:n.bind(null,o),in:!0,exit:u(o,"exit",e),enter:u(o,"enter",e)})}})),s}var d=Object.values||function(e){return Object.keys(e).map((function(t){return e[t]}))},f=function(e){function t(t,n){var i,s=(i=e.call(this,t,n)||this).handleExited.bind(function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(i));return i.state={contextValue:{isMounting:!0},handleExited:s,firstRender:!0},i}Object(r.a)(t,e);var n=t.prototype;return n.componentDidMount=function(){this.mounted=!0,this.setState({contextValue:{isMounting:!1}})},n.componentWillUnmount=function(){this.mounted=!1},t.getDerivedStateFromProps=function(e,t){var n,i,s=t.children,r=t.handleExited;return{children:t.firstRender?(n=e,i=r,c(n.children,(function(e){return Object(a.cloneElement)(e,{onExited:i.bind(null,e),in:!0,appear:u(e,"appear",n),enter:u(e,"enter",n),exit:u(e,"exit",n)})}))):p(e,s,r),firstRender:!1}},n.handleExited=function(e,t){var n=c(this.props.children);e.key in n||(e.props.onExited&&e.props.onExited(t),this.mounted&&this.setState((function(t){var n=Object(s.a)({},t.children);return delete n[e.key],{children:n}})))},n.render=function(){var e=this.props,t=e.component,n=e.childFactory,s=Object(i.a)(e,["component","childFactory"]),r=this.state.contextValue,a=d(this.state.children).map(n);return delete s.appear,delete s.enter,delete s.exit,null===t?o.a.createElement(l.a.Provider,{value:r},a):o.a.createElement(l.a.Provider,{value:r},o.a.createElement(t,s,a))},t}(o.a.Component);f.propTypes={},f.defaultProps={component:"div",childFactory:function(e){return e}};t.a=f},33:function(e,t,n){"use strict";var i=n(5),s=n.n(i);t.a=s.a.createContext(null)},65:function(e,t,n){"use strict";var i=n(22),s=n(25),r=(n(1),n(5)),a=n.n(r),o=n(29),l=n.n(o),c=!1,u=n(33),p=function(e){function t(t,n){var i;i=e.call(this,t,n)||this;var s,r=n&&!n.isMounting?t.enter:t.appear;return i.appearStatus=null,t.in?r?(s="exited",i.appearStatus="entering"):s="entered":s=t.unmountOnExit||t.mountOnEnter?"unmounted":"exited",i.state={status:s},i.nextCallback=null,i}Object(s.a)(t,e),t.getDerivedStateFromProps=function(e,t){return e.in&&"unmounted"===t.status?{status:"exited"}:null};var n=t.prototype;return n.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},n.componentDidUpdate=function(e){var t=null;if(e!==this.props){var n=this.state.status;this.props.in?"entering"!==n&&"entered"!==n&&(t="entering"):"entering"!==n&&"entered"!==n||(t="exiting")}this.updateStatus(!1,t)},n.componentWillUnmount=function(){this.cancelNextCallback()},n.getTimeouts=function(){var e,t,n,i=this.props.timeout;return e=t=n=i,null!=i&&"number"!=typeof i&&(e=i.exit,t=i.enter,n=void 0!==i.appear?i.appear:t),{exit:e,enter:t,appear:n}},n.updateStatus=function(e,t){void 0===e&&(e=!1),null!==t?(this.cancelNextCallback(),"entering"===t?this.performEnter(e):this.performExit()):this.props.unmountOnExit&&"exited"===this.state.status&&this.setState({status:"unmounted"})},n.performEnter=function(e){var t=this,n=this.props.enter,i=this.context?this.context.isMounting:e,s=this.props.nodeRef?[i]:[l.a.findDOMNode(this),i],r=s[0],a=s[1],o=this.getTimeouts(),u=i?o.appear:o.enter;!e&&!n||c?this.safeSetState({status:"entered"},(function(){t.props.onEntered(r)})):(this.props.onEnter(r,a),this.safeSetState({status:"entering"},(function(){t.props.onEntering(r,a),t.onTransitionEnd(u,(function(){t.safeSetState({status:"entered"},(function(){t.props.onEntered(r,a)}))}))})))},n.performExit=function(){var e=this,t=this.props.exit,n=this.getTimeouts(),i=this.props.nodeRef?void 0:l.a.findDOMNode(this);t&&!c?(this.props.onExit(i),this.safeSetState({status:"exiting"},(function(){e.props.onExiting(i),e.onTransitionEnd(n.exit,(function(){e.safeSetState({status:"exited"},(function(){e.props.onExited(i)}))}))}))):this.safeSetState({status:"exited"},(function(){e.props.onExited(i)}))},n.cancelNextCallback=function(){null!==this.nextCallback&&(this.nextCallback.cancel(),this.nextCallback=null)},n.safeSetState=function(e,t){t=this.setNextCallback(t),this.setState(e,t)},n.setNextCallback=function(e){var t=this,n=!0;return this.nextCallback=function(i){n&&(n=!1,t.nextCallback=null,e(i))},this.nextCallback.cancel=function(){n=!1},this.nextCallback},n.onTransitionEnd=function(e,t){this.setNextCallback(t);var n=this.props.nodeRef?this.props.nodeRef.current:l.a.findDOMNode(this),i=null==e&&!this.props.addEndListener;if(n&&!i){if(this.props.addEndListener){var s=this.props.nodeRef?[this.nextCallback]:[n,this.nextCallback],r=s[0],a=s[1];this.props.addEndListener(r,a)}null!=e&&setTimeout(this.nextCallback,e)}else setTimeout(this.nextCallback,0)},n.render=function(){var e=this.state.status;if("unmounted"===e)return null;var t=this.props,n=t.children,s=(t.in,t.mountOnEnter,t.unmountOnExit,t.appear,t.enter,t.exit,t.timeout,t.addEndListener,t.onEnter,t.onEntering,t.onEntered,t.onExit,t.onExiting,t.onExited,t.nodeRef,Object(i.a)(t,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]));return a.a.createElement(u.a.Provider,{value:null},"function"==typeof n?n(e,s):a.a.cloneElement(a.a.Children.only(n),s))},t}(a.a.Component);function d(){}p.contextType=u.a,p.propTypes={},p.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:d,onEntering:d,onEntered:d,onExit:d,onExiting:d,onExited:d},p.UNMOUNTED="unmounted",p.EXITED="exited",p.ENTERING="entering",p.ENTERED="entered",p.EXITING="exiting";t.a=p}}]);woocommerce-admin/dist/chunks/11.style.css000064400000002544151335517650014521 0ustar00:root{--wp-admin-theme-color:#007cba;--wp-admin-theme-color-darker-10:#006ba1;--wp-admin-theme-color-darker-20:#005a87}body.admin-color-light{--wp-admin-theme-color:#0085ba;--wp-admin-theme-color-darker-10:#0073a1;--wp-admin-theme-color-darker-20:#006187}body.admin-color-modern{--wp-admin-theme-color:#3858e9;--wp-admin-theme-color-darker-10:#2145e6;--wp-admin-theme-color-darker-20:#183ad6}body.admin-color-blue{--wp-admin-theme-color:#096484;--wp-admin-theme-color-darker-10:#07526c;--wp-admin-theme-color-darker-20:#064054}body.admin-color-coffee{--wp-admin-theme-color:#46403c;--wp-admin-theme-color-darker-10:#383330;--wp-admin-theme-color-darker-20:#2b2724}body.admin-color-ectoplasm{--wp-admin-theme-color:#523f6d;--wp-admin-theme-color-darker-10:#46365d;--wp-admin-theme-color-darker-20:#3a2c4d}body.admin-color-midnight{--wp-admin-theme-color:#e14d43;--wp-admin-theme-color-darker-10:#dd382d;--wp-admin-theme-color-darker-20:#d02c21}body.admin-color-ocean{--wp-admin-theme-color:#627c83;--wp-admin-theme-color-darker-10:#576e74;--wp-admin-theme-color-darker-20:#4c6066}body.admin-color-sunrise{--wp-admin-theme-color:#dd823b;--wp-admin-theme-color-darker-10:#d97426;--wp-admin-theme-color-darker-20:#c36922}.woocommerce-orders-table__status{flex-direction:row-reverse}.woocommerce-orders-table__status .woocommerce-order-status__indicator{margin-right:0;margin-left:8px}woocommerce-admin/dist/chunks/activity-panels-help.js000064400000026536151335517650017036 0ustar00(window.__wcAdmin_webpackJsonp=window.__wcAdmin_webpackJsonp||[]).push([[4],{473:function(e,t,o){"use strict";var c=o(0),m=o(8),n=Object(c.createElement)(m.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(c.createElement)(m.Path,{d:"M10.6 6L9.4 7l4.6 5-4.6 5 1.2 1 5.4-6z"}));t.a=n},520:function(e,t,o){"use strict";var c=o(0),m=o(6),n=o.n(m),r=o(1),i=o.n(r),a=o(20),u=o(21);o(521);class s extends c.Component{render(){const{className:e,menu:t,subtitle:o,title:m,unreadMessages:r}=this.props,i=n()({"woocommerce-layout__inbox-panel-header":o,"woocommerce-layout__activity-panel-header":!o},e),u=r||0;return Object(c.createElement)("div",{className:i},Object(c.createElement)("div",{className:"woocommerce-layout__inbox-title"},Object(c.createElement)(a.Text,{size:16,weight:600,color:"#23282d"},m),Object(c.createElement)(a.Text,{variant:"button",weight:"600",size:"14",lineHeight:"20px"},u>0&&Object(c.createElement)("span",{className:"woocommerce-layout__inbox-badge"},r))),Object(c.createElement)("div",{className:"woocommerce-layout__inbox-subtitle"},o&&Object(c.createElement)(a.Text,{variant:"body.small",size:"14",lineHeight:"20px"},o)),t&&Object(c.createElement)("div",{className:"woocommerce-layout__activity-panel-header-menu"},t))}}s.propTypes={className:i.a.string,unreadMessages:i.a.number,title:i.a.string.isRequired,subtitle:i.a.string,menu:i.a.shape({type:i.a.oneOf([u.EllipsisMenu])})},t.a=s},521:function(e,t,o){},582:function(e,t,o){"use strict";(function(e,c){var m,n=o(584);m="undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==e?e:c;var r=Object(n.a)(m);t.a=r}).call(this,o(78),o(583)(e))},583:function(e,t){e.exports=function(e){if(!e.webpackPolyfill){var t=Object.create(e);t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),Object.defineProperty(t,"exports",{enumerable:!0}),t.webpackPolyfill=1}return t}},584:function(e,t,o){"use strict";function c(e){var t,o=e.Symbol;return"function"==typeof o?o.observable?t=o.observable:(t=o("observable"),o.observable=t):t="@@observable",t}o.d(t,"a",(function(){return c}))},619:function(e,t,o){"use strict";o.r(t),o.d(t,"SETUP_TASK_HELP_ITEMS_FILTER",(function(){return O})),o.d(t,"HelpPanel",(function(){return j}));var c=o(0),m=o(2),n=o(20),r=o(7),i=o(30),a=o(116),u=o(498),s=o(473),l=o(4),d=o(13),p=o(21),_=o(11),w=(o(582),function(){return Math.random().toString(36).substring(7).split("").join(".")});w(),w();function h(){for(var e=arguments.length,t=new Array(e),o=0;o<e;o++)t[o]=arguments[o];return 0===t.length?function(e){return e}:1===t.length?t[0]:t.reduce((function(e,t){return function(){return e(t.apply(void 0,arguments))}}))}var g=o(16),b=o(520),f=o(60);const O="woocommerce_admin_setup_task_help_items";function k(e){const{taskName:t}=e;switch(t){case"products":return[{title:Object(m.__)("Adding and Managing Products",'woocommerce'),link:"https://docs.woocommerce.com/document/managing-products/?utm_source=help_panel&utm_medium=product"},{title:Object(m.__)("Import products using the CSV Importer and Exporter",'woocommerce'),link:"https://docs.woocommerce.com/document/product-csv-importer-exporter/?utm_source=help_panel&utm_medium=product"},{title:Object(m.__)("Migrate products using Cart2Cart",'woocommerce'),link:"https://woocommerce.com/products/cart2cart/?utm_source=help_panel&utm_medium=product"},{title:Object(m.__)("Learn more about setting up products",'woocommerce'),link:"https://docs.woocommerce.com/documentation/plugins/woocommerce/getting-started/setup-products/?utm_source=help_panel&utm_medium=product"}];case"appearance":return[{title:Object(m.__)("Showcase your products and tailor your shopping experience using Blocks",'woocommerce'),link:"https://docs.woocommerce.com/document/woocommerce-blocks/?utm_source=help_panel&utm_medium=product"},{title:Object(m.__)("Manage Store Notice, Catalog View and Product Images",'woocommerce'),link:"https://docs.woocommerce.com/document/woocommerce-customizer/?utm_source=help_panel&utm_medium=product"},{title:Object(m.__)("How to choose and change a theme",'woocommerce'),link:"https://docs.woocommerce.com/document/choose-change-theme/?utm_source=help_panel&utm_medium=product"}];case"shipping":return function({activePlugins:e,countryCode:t}){const o="US"===t&&!e.includes("woocommerce-services");return[{title:Object(m.__)("Setting up Shipping Zones",'woocommerce'),link:"https://docs.woocommerce.com/document/setting-up-shipping-zones/?utm_source=help_panel&utm_medium=product"},{title:Object(m.__)("Core Shipping Options",'woocommerce'),link:"https://docs.woocommerce.com/documentation/plugins/woocommerce/getting-started/shipping/core-shipping-options/?utm_source=help_panel&utm_medium=product"},{title:Object(m.__)("Product Shipping Classes",'woocommerce'),link:"https://docs.woocommerce.com/document/product-shipping-classes/?utm_source=help_panel&utm_medium=product"},o&&{title:Object(m.__)("WooCommerce Shipping setup and configuration",'woocommerce'),link:"https://docs.woocommerce.com/document/woocommerce-shipping-and-tax/?utm_source=help_panel&utm_medium=product#section-3"},{title:Object(m.__)("Learn more about configuring your shipping settings",'woocommerce'),link:"https://docs.woocommerce.com/documentation/plugins/woocommerce/getting-started/shipping/?utm_source=help_panel&utm_medium=product"}].filter(Boolean)}(e);case"tax":return function(e){const{countryCode:t}=e,{automatedTaxSupportedCountries:o=[],taxJarActivated:c}=e.getSetting("onboarding",{}),n=!c&&o.includes(t);return[{title:Object(m.__)("Setting up Taxes in WooCommerce",'woocommerce'),link:"https://docs.woocommerce.com/document/setting-up-taxes-in-woocommerce/?utm_source=help_panel&utm_medium=product"},n&&{title:Object(m.__)("Automated Tax calculation using WooCommerce Tax",'woocommerce'),link:"https://docs.woocommerce.com/document/woocommerce-services/?utm_source=help_panel&utm_medium=product#section-10"}].filter(Boolean)}(e);case"payments":return function(e){const{paymentGatewaySuggestions:t}=e;return[{title:Object(m.__)("Which Payment Option is Right for Me?",'woocommerce'),link:"https://docs.woocommerce.com/document/premium-payment-gateway-extensions/?utm_source=help_panel&utm_medium=product"},t.woocommerce_payments&&{title:Object(m.__)("WooCommerce Payments Start Up Guide",'woocommerce'),link:"https://docs.woocommerce.com/document/payments/?utm_source=help_panel&utm_medium=product"},t.woocommerce_payments&&{title:Object(m.__)("WooCommerce Payments FAQs",'woocommerce'),link:"https://docs.woocommerce.com/documentation/woocommerce-payments/woocommerce-payments-faqs/?utm_source=help_panel&utm_medium=product"},t.stripe&&{title:Object(m.__)("Stripe Setup and Configuration",'woocommerce'),link:"https://docs.woocommerce.com/document/stripe/?utm_source=help_panel&utm_medium=product"},t["ppcp-gateway"]&&{title:Object(m.__)("PayPal Checkout Setup and Configuration",'woocommerce'),link:"https://docs.woocommerce.com/document/2-0/woocommerce-paypal-payments/?utm_medium=product#section-3"},t.square_credit_card&&{title:Object(m.__)("Square - Get started",'woocommerce'),link:"https://docs.woocommerce.com/document/woocommerce-square/?utm_source=help_panel&utm_medium=product"},t.kco&&{title:Object(m.__)("Klarna - Introduction",'woocommerce'),link:"https://docs.woocommerce.com/document/klarna-checkout/?utm_source=help_panel&utm_medium=product"},t.klarna_payments&&{title:Object(m.__)("Klarna - Introduction",'woocommerce'),link:"https://docs.woocommerce.com/document/klarna-payments/?utm_source=help_panel&utm_medium=product"},t.payfast&&{title:Object(m.__)("PayFast Setup and Configuration",'woocommerce'),link:"https://docs.woocommerce.com/document/payfast-payment-gateway/?utm_source=help_panel&utm_medium=product"},t.eway&&{title:Object(m.__)("Eway Setup and Configuration",'woocommerce'),link:"https://docs.woocommerce.com/document/eway/?utm_source=help_panel&utm_medium=product"},{title:Object(m.__)("Direct Bank Transfer (BACS)",'woocommerce'),link:"https://docs.woocommerce.com/document/bacs/?utm_source=help_panel&utm_medium=product"},{title:Object(m.__)("Cash on Delivery",'woocommerce'),link:"https://docs.woocommerce.com/document/cash-on-delivery/?utm_source=help_panel&utm_medium=product"}].filter(Boolean)}(e);case"marketing":return function(e){const{activePlugins:t}=e;return[t.includes("mailpoet")&&{title:Object(m.__)("Get started with Mailpoet",'woocommerce'),link:"https://kb.mailpoet.com/category/114-getting-started"},t.includes("google-listings-and-ads")&&{title:Object(m.__)("Set up Google Listing & Ads",'woocommerce'),link:"https://docs.woocommerce.com/document/google-listings-and-ads/?utm_medium=product#get-started"},t.includes("mailchimp-for-woocommerce")&&{title:Object(m.__)("Connect Mailchimp for WooCommerce",'woocommerce'),link:"https://mailchimp.com/help/connect-or-disconnect-mailchimp-for-woocommerce/"},t.includes("creative-mail-by-constant-contact")&&{title:Object(m.__)("Set up Creative Mail for WooCommerce",'woocommerce'),link:"https://app.creativemail.com/kb/help/WooCommerce"}].filter(Boolean)}(e);default:return[{title:Object(m.__)("Get Support",'woocommerce'),link:"https://woocommerce.com/my-account/create-a-ticket/?utm_medium=product"},{title:Object(m.__)("Home Screen",'woocommerce'),link:"https://docs.woocommerce.com/document/home-screen?utm_medium=product"},{title:Object(m.__)("Inbox",'woocommerce'),link:"https://docs.woocommerce.com/document/home-screen?utm_medium=product#section-2"},{title:Object(m.__)("Stats Overview",'woocommerce'),link:"https://docs.woocommerce.com/document/home-screen?utm_medium=product#section-4"},{title:Object(m.__)("Store Management",'woocommerce'),link:"https://docs.woocommerce.com/document/home-screen?utm_medium=product#section-5"},{title:Object(m.__)("Store Setup Checklist",'woocommerce'),link:"https://docs.woocommerce.com/document/woocommerce-setup-wizard?utm_medium=product#store-setup-checklist"}]}}function y(e,t){const{taskName:o}=e;t&&e.recordEvent("help_panel_click",{task_name:o||"homescreen",link:t.currentTarget.href})}const j=e=>{const{taskName:t}=e;Object(c.useEffect)(()=>{e.recordEvent("help_panel_open",{task_name:t||"homescreen"})},[t]);const o=function(e){const t=k(e),o={title:Object(m.__)("WooCommerce Docs",'woocommerce'),link:"https://docs.woocommerce.com/?utm_source=help_panel&utm_medium=product"};t.push(o);const r=Object(i.applyFilters)(O,t,e.taskName,e);let d=Array.isArray(r)?r.filter(e=>e instanceof Object&&e.title&&e.link):[];d.length||(d=[o]);const p=Object(l.partial)(y,e);return d.map(e=>({title:Object(c.createElement)(n.Text,{as:"div",variant:"button",weight:"600",size:"14",lineHeight:"20px"},e.title),before:Object(c.createElement)(a.a,{icon:u.a}),after:Object(c.createElement)(a.a,{icon:s.a}),linkType:"external",target:"_blank",href:e.link,onClick:p}))}(e);return Object(c.createElement)(c.Fragment,null,Object(c.createElement)(b.a,{title:Object(m.__)("Documentation",'woocommerce')}),Object(c.createElement)(p.Section,null,Object(c.createElement)(p.List,{items:o,className:"woocommerce-quick-links__list"})))};j.defaultProps={getSetting:d.f,recordEvent:g.recordEvent};t.default=h(Object(r.withSelect)(e=>{const{getSettings:t}=e(_.SETTINGS_STORE_NAME),{getActivePlugins:o}=e(_.PLUGINS_STORE_NAME),{general:c={}}=t("general"),m=o(),n=e(_.ONBOARDING_STORE_NAME).getPaymentGatewaySuggestions().reduce((e,t)=>{const{id:o}=t;return e[o]=!0,e},{});return{activePlugins:m,countryCode:Object(f.b)(c.woocommerce_default_country),paymentGatewaySuggestions:n}}))(j)}}]);woocommerce-admin/dist/chunks/49.style.css000064400000012446151335517650014536 0ustar00:root{--wp-admin-theme-color:#007cba;--wp-admin-theme-color-darker-10:#006ba1;--wp-admin-theme-color-darker-20:#005a87}body.admin-color-light{--wp-admin-theme-color:#0085ba;--wp-admin-theme-color-darker-10:#0073a1;--wp-admin-theme-color-darker-20:#006187}body.admin-color-modern{--wp-admin-theme-color:#3858e9;--wp-admin-theme-color-darker-10:#2145e6;--wp-admin-theme-color-darker-20:#183ad6}body.admin-color-blue{--wp-admin-theme-color:#096484;--wp-admin-theme-color-darker-10:#07526c;--wp-admin-theme-color-darker-20:#064054}body.admin-color-coffee{--wp-admin-theme-color:#46403c;--wp-admin-theme-color-darker-10:#383330;--wp-admin-theme-color-darker-20:#2b2724}body.admin-color-ectoplasm{--wp-admin-theme-color:#523f6d;--wp-admin-theme-color-darker-10:#46365d;--wp-admin-theme-color-darker-20:#3a2c4d}body.admin-color-midnight{--wp-admin-theme-color:#e14d43;--wp-admin-theme-color-darker-10:#dd382d;--wp-admin-theme-color-darker-20:#d02c21}body.admin-color-ocean{--wp-admin-theme-color:#627c83;--wp-admin-theme-color-darker-10:#576e74;--wp-admin-theme-color-darker-20:#4c6066}body.admin-color-sunrise{--wp-admin-theme-color:#dd823b;--wp-admin-theme-color-darker-10:#d97426;--wp-admin-theme-color-darker-20:#c36922}.woocommerce-store-alerts{position:relative;margin:0 0 40px;margin-right:var(--large-gap);padding:24px;border:0;box-shadow:0 0 8px -2px rgba(0,0,0,.3)}.woocommerce-store-alerts:before{content:"";position:absolute;top:0;left:0;width:4px;height:100%;background:transparent}.woocommerce-store-alerts .components-card__header{margin-bottom:12px}.woocommerce-store-alerts a.components-button{min-height:36px;padding:4px 16px}@media(max-width:782px){.woocommerce-store-alerts a.components-button{min-height:36px;font-size:16px;line-height:1.625;padding:5px 16px}}.woocommerce-store-alerts a.components-button+.components-button{margin-left:10px}.woocommerce-store-alerts a.components-button.is-button{color:#757575}@media(max-width:782px){.woocommerce-store-alerts{margin-bottom:24px;padding:16px}.woocommerce-store-alerts .components-card__header{display:flex;flex-direction:column-reverse;align-items:flex-start}}.woocommerce-embed-page .woocommerce-store-alerts{margin:40px 20px 20px}@media(max-width:782px){.woocommerce-embed-page .woocommerce-store-alerts{margin-top:24px}}.is-alert-error:before{background-color:#dc3232}.is-alert-error .components-card__header h2 svg{color:#dc3232}.is-alert-update:before{background-color:#11a0d2}.is-alert-update .components-card__header h2 svg{color:#11a0d2}.components-card__body .woocommerce-store-alerts__message{margin-bottom:16px}.woocommerce-store-alerts__pagination{display:inline-flex;align-items:center;border:1px solid #b5bfc9;border-radius:4px;background:#f0f2f4;margin-left:16px;min-width:120px}.woocommerce-store-alerts__pagination .components-button{padding:4px/*!rtl:ignore*/}.rtl .woocommerce-store-alerts__pagination .components-button .arrow-left-icon,.rtl .woocommerce-store-alerts__pagination .components-button .arrow-right-icon{transform:scaleX(-1)}.woocommerce-store-alerts__pagination .woocommerce-store-alerts__pagination-label{padding:5px 12px;border-color:#b5bfc9;border-style:solid;border-width:0 1px;flex:1 1;font-size:14px;font-size:.875rem}@media(max-width:782px){.woocommerce-store-alerts__pagination{margin-left:0;margin-bottom:14px}.woocommerce-store-alerts__pagination .woocommerce-store-alerts__pagination-label{text-align:center}}.woocommerce-store-alerts__pagination button:first-child{border-top-right-radius:0;border-bottom-right-radius:0}.woocommerce-store-alerts__pagination button:last-child{border-top-left-radius:0;border-bottom-left-radius:0}.woocommerce-store-alerts.is-loading:before{animation:loading-fade 1.6s ease-in-out infinite;background-color:#f0f0f0;color:transparent}.woocommerce-store-alerts.is-loading:before:after{content:" "}@media screen and (prefers-reduced-motion:reduce){.woocommerce-store-alerts.is-loading:before{animation:none}}.woocommerce-store-alerts.is-loading .is-placeholder{animation:loading-fade 1.6s ease-in-out infinite;background-color:#f0f0f0;color:transparent;display:inline-block;height:16px}.woocommerce-store-alerts.is-loading .is-placeholder:after{content:" "}@media screen and (prefers-reduced-motion:reduce){.woocommerce-store-alerts.is-loading .is-placeholder{animation:none}}.woocommerce-store-alerts.is-loading .components-card__header .is-placeholder:first-child{width:340px;height:32px}.woocommerce-store-alerts.is-loading .components-card__header .is-placeholder:nth-child(2){width:137px;height:38px}.woocommerce-store-alerts.is-loading .components-card__footer .is-placeholder{min-width:120px;height:30px}.woocommerce-store-alerts.is-loading .components-card__body .is-placeholder:first-child{width:75%}.woocommerce-store-alerts.is-loading .components-card__body .is-placeholder:nth-child(2){width:45%}.woocommerce-store-alerts.is-loading .woocommerce-store-alerts__actions .is-placeholder{width:110px;height:26px}@media(max-width:782px){.woocommerce-store-alerts.is-loading .components-card__header h2{width:100%}.woocommerce-store-alerts.is-loading .components-card__header h2 .is-placeholder{width:50%}.woocommerce-store-alerts.is-loading .components-card__footer{margin-bottom:14px}}.woocommerce-store-alerts__snooze{display:inline-flex;margin-left:10px}.woocommerce-store-alerts__snooze .components-select-control__input{vertical-align:initial;min-height:36px}woocommerce-admin/dist/chunks/17.style.css000064400000012565151335517650014533 0ustar00@media(min-width:783px){.woocommerce-settings__wrapper{padding:0 13px}}.woocommerce-settings__actions{margin-bottom:40px}@media(min-width:1281px){.woocommerce-settings__actions{margin-left:15%}}.woocommerce-settings__actions button{margin-right:16px}.woocommerce-setting{display:flex;margin-bottom:24px}@media(max-width:1280px){.woocommerce-setting{flex-direction:column}}.woocommerce-setting__label{font-size:16px;font-size:1rem;margin-bottom:16px;padding-right:16px;font-weight:700}@media(min-width:1281px){.woocommerce-setting__label{width:15%}}.woocommerce-setting__input{display:flex;flex-direction:column}@media(min-width:1281px){.woocommerce-setting__input{width:35%}.woocommerce-setting__input .woocommerce-filters-filter{width:100%}}.woocommerce-setting__input label{width:100%;display:block;margin-bottom:12px;color:#757575}.woocommerce-setting__input .woocommerce-filters-filter label{margin-bottom:0}.woocommerce-setting__input button:not(.components-tab-panel__tabs-item){margin-bottom:12px;align-self:flex-start}.woocommerce-setting__input .components-base-control__field{display:flex}.woocommerce-setting__input .woocommerce-filters-date__content-controls{padding-bottom:0}.woocommerce-setting__options-group-label{display:block;font-weight:700;margin-bottom:12px}.woocommerce-setting__help{font-style:italic;color:#757575}:root{--wp-admin-theme-color:#007cba;--wp-admin-theme-color-darker-10:#006ba1;--wp-admin-theme-color-darker-20:#005a87}body.admin-color-light{--wp-admin-theme-color:#0085ba;--wp-admin-theme-color-darker-10:#0073a1;--wp-admin-theme-color-darker-20:#006187}body.admin-color-modern{--wp-admin-theme-color:#3858e9;--wp-admin-theme-color-darker-10:#2145e6;--wp-admin-theme-color-darker-20:#183ad6}body.admin-color-blue{--wp-admin-theme-color:#096484;--wp-admin-theme-color-darker-10:#07526c;--wp-admin-theme-color-darker-20:#064054}body.admin-color-coffee{--wp-admin-theme-color:#46403c;--wp-admin-theme-color-darker-10:#383330;--wp-admin-theme-color-darker-20:#2b2724}body.admin-color-ectoplasm{--wp-admin-theme-color:#523f6d;--wp-admin-theme-color-darker-10:#46365d;--wp-admin-theme-color-darker-20:#3a2c4d}body.admin-color-midnight{--wp-admin-theme-color:#e14d43;--wp-admin-theme-color-darker-10:#dd382d;--wp-admin-theme-color-darker-20:#d02c21}body.admin-color-ocean{--wp-admin-theme-color:#627c83;--wp-admin-theme-color-darker-10:#576e74;--wp-admin-theme-color-darker-20:#4c6066}body.admin-color-sunrise{--wp-admin-theme-color:#dd823b;--wp-admin-theme-color-darker-10:#d97426;--wp-admin-theme-color-darker-20:#c36922}.woocommerce-settings-historical-data__columns{display:grid;grid-column-gap:24px;grid-template-columns:calc(50% - 12px) calc(50% - 12px)}.woocommerce-settings-historical-data__columns .woocommerce-settings-historical-data__column{align-self:end;margin-top:12px}.woocommerce-settings-historical-data__columns .woocommerce-settings-historical-data__column:first-child{grid-column-start:1;grid-column-end:2;grid-row-start:1;grid-row-end:2}.woocommerce-settings-historical-data__columns .woocommerce-settings-historical-data__column:nth-child(2){grid-column-start:2;grid-column-end:3;grid-row-start:1;grid-row-end:2}@media(max-width:960px){.woocommerce-settings-historical-data__columns{grid-template-columns:100%}.woocommerce-settings-historical-data__columns .woocommerce-settings-historical-data__column:first-child{grid-column-start:1;grid-column-end:2;grid-row-start:1;grid-row-end:2}.woocommerce-settings-historical-data__columns .woocommerce-settings-historical-data__column:nth-child(2){grid-column-start:1;grid-column-end:2;grid-row-start:2;grid-row-end:3}}.woocommerce-settings-historical-data__columns .components-base-control__label,.woocommerce-settings-historical-data__columns .woocommerce-settings-historical-data__column-label{margin-bottom:12px}.woocommerce-settings-historical-data__columns .components-select-control__input{height:38px;padding:8px 2px}.woocommerce-settings-historical-data__columns .components-base-control__field{margin-bottom:0}.woocommerce-settings-historical-data__skip-checkbox{margin-top:24px}.woocommerce-settings-historical-data__skip-checkbox>.components-base-control__field{margin-bottom:0}.woocommerce-settings-historical-data__skip-checkbox>.components-base-control__field>.components-checkbox-control__label{display:inline-block;margin-bottom:0;width:auto}.woocommerce-settings-historical-data__progress-label{display:inline-block;font-weight:700;margin-bottom:12px;margin-top:24px}.woocommerce-settings-historical-data__progress-label+.woocommerce-settings-historical-data__progress-label{margin-left:.25em}.woocommerce-settings-historical-data__progress-bar{-webkit-appearance:none;appearance:none;border:0;height:8px;width:100%;background-color:#c4c4c4}.woocommerce-settings-historical-data__progress-bar::-moz-progress-bar{background-color:#0085ba}.woocommerce-settings-historical-data__progress-bar::-webkit-progress-bar{background-color:#c4c4c4}.woocommerce-settings-historical-data__progress-bar::-webkit-progress-value{background-color:#0085ba}.woocommerce-settings-historical-data__status{display:block;font-weight:700;margin-top:24px}.woocommerce-settings-historical-data__status>.components-spinner{float:none;height:12px;margin-left:6px;margin-right:6px;width:12px}.woocommerce-settings-historical-data__status>.components-spinner:before{left:2px;height:3px;top:2px;transform-origin:4px 4px;width:3px}.woocommerce-settings-historical-data__actions{align-items:center;display:flex}woocommerce-admin/dist/chunks/analytics-report-products.js000064400000040702151335517650020124 0ustar00(window.__wcAdmin_webpackJsonp=window.__wcAdmin_webpackJsonp||[]).push([[12],{477:function(e,t,r){"use strict";r.r(t);var o=r(0),a=r(2),c=r(14),n=r(1),s=r.n(n),i=r(11),l=r(7),m=r(529),d=r(510),u=r(530),b=r(508),p=r(504),_=r(511),y=r(532),g=r(505);class O extends o.Component{getChartMeta(){const{query:e,isSingleProductView:t,isSingleProductVariable:r}=this.props,o="compare-products"===e.filter&&e.products&&e.products.split(",").length>1||t&&r?"item-comparison":"time-comparison";return{compareObject:t&&r?"variations":"products",itemsLabel:t&&r?Object(a.__)("%d variations",'woocommerce'):Object(a.__)("%d products",'woocommerce'),mode:o}}render(){const{compareObject:e,itemsLabel:t,mode:r}=this.getChartMeta(),{path:a,query:c,isError:n,isRequesting:s,isSingleProductVariable:i}=this.props;if(n)return Object(o.createElement)(p.a,null);const l={...c};return"item-comparison"===r&&(l.segmentby="products"===e?"product":"variation"),Object(o.createElement)(o.Fragment,null,Object(o.createElement)(g.a,{query:c,path:a,filters:m.c,advancedFilters:m.a,report:"products"}),Object(o.createElement)(_.a,{mode:r,charts:m.b,endpoint:"products",isRequesting:s,query:l,selectedChart:Object(d.a)(c.chart,m.b),filters:m.c,advancedFilters:m.a}),Object(o.createElement)(b.a,{charts:m.b,mode:r,filters:m.c,advancedFilters:m.a,endpoint:"products",isRequesting:s,itemsLabel:t,path:a,query:l,selectedChart:Object(d.a)(l.chart,m.b)}),i?Object(o.createElement)(y.a,{baseSearchQuery:{filter:"single_product"},isRequesting:s,query:c,filters:m.c,advancedFilters:m.a}):Object(o.createElement)(u.a,{isRequesting:s,query:c,filters:m.c,advancedFilters:m.a}))}}O.propTypes={path:s.a.string.isRequired,query:s.a.object.isRequired},t.default=Object(c.compose)(Object(l.withSelect)((e,t)=>{const{query:r,isRequesting:o}=t,a=!r.search&&r.products&&1===r.products.split(",").length,{getItems:c,isResolving:n,getItemsError:s}=e(i.ITEMS_STORE_NAME);if(o)return{query:{...r},isSingleProductView:a,isRequesting:o};if(a){const e=parseInt(r.products,10),t={include:e},o=c("products",t),i=o&&o.get(e)&&"variable"===o.get(e).type,l=n("getItems",["products",t]),m=Boolean(s("products",t));return{query:{...r,"is-variable":i},isSingleProductView:a,isRequesting:l,isSingleProductVariable:i,isError:m}}return{query:r,isSingleProductView:a}}))(O)},502:function(e,t,r){"use strict";r.d(t,"e",(function(){return d})),r.d(t,"a",(function(){return u})),r.d(t,"b",(function(){return b})),r.d(t,"c",(function(){return p})),r.d(t,"d",(function(){return _})),r.d(t,"f",(function(){return y})),r.d(t,"h",(function(){return g})),r.d(t,"g",(function(){return O}));var o=r(15),a=r(17),c=r.n(a),n=r(4),s=r(12),i=r(11),l=r(13),m=r(503);function d(e,t=n.identity){return function(r="",a){const n="function"==typeof e?e(a):e,i=Object(s.getIdsFromQuery)(r);if(i.length<1)return Promise.resolve([]);const l={include:i.join(","),per_page:i.length};return c()({path:Object(o.addQueryArgs)(n,l)}).then(e=>e.map(t))}}d(i.NAMESPACE+"/products/attributes",e=>({key:e.id,label:e.name}));const u=d(i.NAMESPACE+"/products/categories",e=>({key:e.id,label:e.name})),b=d(i.NAMESPACE+"/coupons",e=>({key:e.id,label:e.code})),p=d(i.NAMESPACE+"/customers",e=>({key:e.id,label:e.name})),_=d(i.NAMESPACE+"/products",e=>({key:e.id,label:e.name})),y=d(i.NAMESPACE+"/taxes",e=>({key:e.id,label:Object(m.a)(e)}));function g({attributes:e,name:t}){const r=Object(l.f)("variationTitleAttributesSeparator"," - ");if(t&&t.indexOf(r)>-1)return t;const o=(e||[]).map(({option:e})=>e).join(", ");return o?t+r+o:t}const O=d(({products:e})=>e?i.NAMESPACE+`/products/${e}/variations`:i.NAMESPACE+"/variations",e=>({key:e.id,label:g(e)}))},503:function(e,t,r){"use strict";r.d(t,"a",(function(){return a}));var o=r(2);function a(e){return[e.country,e.state,e.name||Object(o.__)("TAX",'woocommerce'),e.priority].map(e=>e.toString().toUpperCase().trim()).filter(Boolean).join("-")}},513:function(e,t,r){"use strict";function o(e,t,r){return!!t&&(e&&t<=r==="instock")}r.d(t,"a",(function(){return o}))},518:function(e,t,r){"use strict";r.d(t,"a",(function(){return i}));var o=r(0),a=r(4),c=r(3),n=r(21),s=r(12);class i extends o.Component{getCategoryAncestorIds(e,t){const r=[];let o=e.parent;for(;o;)r.unshift(o),o=t.get(o).parent;return r}getCategoryAncestors(e,t){const r=this.getCategoryAncestorIds(e,t);if(r.length)return 1===r.length?t.get(Object(a.first)(r)).name+" › ":2===r.length?t.get(Object(a.first)(r)).name+" › "+t.get(Object(a.last)(r)).name+" › ":t.get(Object(a.first)(r)).name+" … "+t.get(Object(a.last)(r)).name+" › "}render(){const{categories:e,category:t,query:r}=this.props,a=Object(s.getPersistedQuery)(r);return t?Object(o.createElement)("div",{className:"woocommerce-table__breadcrumbs"},this.getCategoryAncestors(t,e),Object(o.createElement)(n.Link,{href:Object(s.getNewPath)(a,"/analytics/categories",{filter:"single_category",categories:t.id}),type:"wc-admin"},t.name)):Object(o.createElement)(c.Spinner,null)}}},529:function(e,t,r){"use strict";r.d(t,"b",(function(){return l})),r.d(t,"a",(function(){return u})),r.d(t,"c",(function(){return b}));var o=r(2),a=r(30),c=r(7),n=r(502),s=r(55);const{addCesSurveyForAnalytics:i}=Object(c.dispatch)(s.c),l=Object(a.applyFilters)("woocommerce_admin_products_report_charts",[{key:"items_sold",label:Object(o.__)("Items sold",'woocommerce'),order:"desc",orderby:"items_sold",type:"number"},{key:"net_revenue",label:Object(o.__)("Net sales",'woocommerce'),order:"desc",orderby:"net_revenue",type:"currency"},{key:"orders_count",label:Object(o.__)("Orders",'woocommerce'),order:"desc",orderby:"orders_count",type:"number"}]),m={label:Object(o.__)("Show",'woocommerce'),staticParams:["chartType","paged","per_page"],param:"filter",showFilters:()=>!0,filters:[{label:Object(o.__)("All products",'woocommerce'),value:"all"},{label:Object(o.__)("Single product",'woocommerce'),value:"select_product",chartMode:"item-comparison",subFilters:[{component:"Search",value:"single_product",chartMode:"item-comparison",path:["select_product"],settings:{type:"products",param:"products",getLabels:n.d,labels:{placeholder:Object(o.__)("Type to search for a product",'woocommerce'),button:Object(o.__)("Single product",'woocommerce')}}}]},{label:Object(o.__)("Comparison",'woocommerce'),value:"compare-products",chartMode:"item-comparison",settings:{type:"products",param:"products",getLabels:n.d,labels:{helpText:Object(o.__)("Check at least two products below to compare",'woocommerce'),placeholder:Object(o.__)("Search for products to compare",'woocommerce'),title:Object(o.__)("Compare Products",'woocommerce'),update:Object(o.__)("Compare",'woocommerce')},onClick:i}}]},d={showFilters:e=>"single_product"===e.filter&&!!e.products&&e["is-variable"],staticParams:["filter","products","chartType","paged","per_page"],param:"filter-variations",filters:[{label:Object(o.__)("All variations",'woocommerce'),chartMode:"item-comparison",value:"all"},{label:Object(o.__)("Single variation",'woocommerce'),value:"select_variation",subFilters:[{component:"Search",value:"single_variation",path:["select_variation"],settings:{type:"variations",param:"variations",getLabels:n.g,labels:{placeholder:Object(o.__)("Type to search for a variation",'woocommerce'),button:Object(o.__)("Single variation",'woocommerce')}}}]},{label:Object(o.__)("Comparison",'woocommerce'),chartMode:"item-comparison",value:"compare-variations",settings:{type:"variations",param:"variations",getLabels:n.g,labels:{helpText:Object(o.__)("Check at least two variations below to compare",'woocommerce'),placeholder:Object(o.__)("Search for variations to compare",'woocommerce'),title:Object(o.__)("Compare Variations",'woocommerce'),update:Object(o.__)("Compare",'woocommerce')}}}]},u=Object(a.applyFilters)("woocommerce_admin_products_report_advanced_filters",{filters:{},title:Object(o._x)("Products Match {{select /}} Filters","A sentence describing filters for Products. See screen shot for context: https://cloudup.com/cSsUY9VeCVJ",'woocommerce')});Object.keys(u.filters).length&&(m.filters.push({label:Object(o.__)("Advanced Filters",'woocommerce'),value:"advanced"}),d.filters.push({label:Object(o.__)("Advanced Filters",'woocommerce'),value:"advanced"}));const b=Object(a.applyFilters)("woocommerce_admin_products_report_filters",[m,d])},530:function(e,t,r){"use strict";var o=r(0),a=r(2),c=r(14),n=r(28),s=r(7),i=r(4),l=r(12),m=r(21),d=r(120),u=r(13),b=r(11),p=r(518),_=r(513),y=r(506),g=r(501);r(531);const O=Object(u.f)("manageStock","no"),j=Object(u.f)("stockStatuses",{});class h extends o.Component{constructor(){super(),this.getHeadersContent=this.getHeadersContent.bind(this),this.getRowsContent=this.getRowsContent.bind(this),this.getSummary=this.getSummary.bind(this)}getHeadersContent(){return[{label:Object(a.__)("Product title",'woocommerce'),key:"product_name",required:!0,isLeftAligned:!0,isSortable:!0},{label:Object(a.__)("SKU",'woocommerce'),key:"sku",hiddenByDefault:!0,isSortable:!0},{label:Object(a.__)("Items sold",'woocommerce'),key:"items_sold",required:!0,defaultSort:!0,isSortable:!0,isNumeric:!0},{label:Object(a.__)("Net sales",'woocommerce'),screenReaderLabel:Object(a.__)("Net sales",'woocommerce'),key:"net_revenue",required:!0,isSortable:!0,isNumeric:!0},{label:Object(a.__)("Orders",'woocommerce'),key:"orders_count",isSortable:!0,isNumeric:!0},{label:Object(a.__)("Category",'woocommerce'),key:"product_cat"},{label:Object(a.__)("Variations",'woocommerce'),key:"variations",isSortable:!0},"yes"===O?{label:Object(a.__)("Status",'woocommerce'),key:"stock_status"}:null,"yes"===O?{label:Object(a.__)("Stock",'woocommerce'),key:"stock",isNumeric:!0}:null].filter(Boolean)}getRowsContent(e=[]){const{query:t}=this.props,r=Object(l.getPersistedQuery)(t),{render:c,formatDecimal:s,getCurrencyConfig:b}=this.context,y=b();return Object(i.map)(e,e=>{const{product_id:i,items_sold:b,net_revenue:g,orders_count:h}=e,f=e.extended_info||{},{category_ids:w,low_stock_amount:v,manage_stock:S,sku:C,stock_status:k,stock_quantity:E,variations:q=[]}=f,A=Object(n.decodeEntities)(f.name),P=Object(l.getNewPath)(r,"/analytics/orders",{filter:"advanced",product_includes:i}),N=Object(l.getNewPath)(r,"/analytics/products",{filter:"single_product",products:i}),{categories:R}=this.props,x=w&&R&&w.map(e=>R.get(e)).filter(Boolean)||[],F=Object(_.a)(k,E,v)?Object(o.createElement)(m.Link,{href:Object(u.e)("post.php?action=edit&post="+i),type:"wp-admin"},Object(a._x)("Low","Indication of a low quantity",'woocommerce')):j[k];return[{display:Object(o.createElement)(m.Link,{href:N,type:"wc-admin"},A),value:A},{display:C,value:C},{display:Object(d.formatValue)(y,"number",b),value:b},{display:c(g),value:s(g)},{display:Object(o.createElement)(m.Link,{href:P,type:"wc-admin"},h),value:h},{display:Object(o.createElement)("div",{className:"woocommerce-table__product-categories"},x[0]&&Object(o.createElement)(p.a,{category:x[0],categories:R}),x.length>1&&Object(o.createElement)(m.Tag,{label:Object(a.sprintf)(Object(a._x)("+%d more","categories",'woocommerce'),x.length-1),popoverContents:x.map(e=>Object(o.createElement)(p.a,{category:e,categories:R,key:e.id,query:t}))})),value:x.map(e=>e.name).join(", ")},{display:Object(d.formatValue)(y,"number",q.length),value:q.length},"yes"===O?{display:S?F:Object(a.__)("N/A",'woocommerce'),value:S?j[k]:null}:null,"yes"===O?{display:S?Object(d.formatValue)(y,"number",E):Object(a.__)("N/A",'woocommerce'),value:E}:null].filter(Boolean)})}getSummary(e){const{products_count:t=0,items_sold:r=0,net_revenue:o=0,orders_count:c=0}=e,{formatAmount:n,getCurrencyConfig:s}=this.context,i=s();return[{label:Object(a._n)("Product","Products",t,'woocommerce'),value:Object(d.formatValue)(i,"number",t)},{label:Object(a._n)("Item sold","Items sold",r,'woocommerce'),value:Object(d.formatValue)(i,"number",r)},{label:Object(a.__)("Net sales",'woocommerce'),value:n(o)},{label:Object(a._n)("Orders","Orders",c,'woocommerce'),value:Object(d.formatValue)(i,"number",c)}]}render(){const{advancedFilters:e,baseSearchQuery:t,filters:r,hideCompare:c,isRequesting:n,query:s}=this.props,i={helpText:Object(a.__)("Check at least two products below to compare",'woocommerce'),placeholder:Object(a.__)("Search by product name or SKU",'woocommerce')};return Object(o.createElement)(y.a,{compareBy:c?void 0:"products",endpoint:"products",getHeadersContent:this.getHeadersContent,getRowsContent:this.getRowsContent,getSummary:this.getSummary,summaryFields:["products_count","items_sold","net_revenue","orders_count"],itemIdField:"product_id",isRequesting:n,labels:i,query:s,searchBy:"products",baseSearchQuery:t,tableQuery:{orderby:s.orderby||"items_sold",order:s.order||"desc",extended_info:!0,segmentby:s.segmentby},title:Object(a.__)("Products",'woocommerce'),columnPrefsKey:"products_report_columns",filters:r,advancedFilters:e})}}h.contextType=g.a,t.a=Object(c.compose)(Object(s.withSelect)((e,t)=>{const{query:r,isRequesting:o}=t,{getItems:a,getItemsError:c,isResolving:n}=e(b.ITEMS_STORE_NAME);if(o||r.search&&(!r.products||!r.products.length))return{};const s={per_page:-1};return{categories:a("categories",s),isError:Boolean(c("categories",s)),isRequesting:n("getItems",["categories",s])}}))(h)},531:function(e,t,r){},532:function(e,t,r){"use strict";var o=r(0),a=r(2),c=r(4),n=r(21),s=r(12),i=r(120),l=r(13),m=r(506),d=r(513),u=r(501),b=r(502);const p=Object(l.f)("manageStock","no"),_=Object(l.f)("stockStatuses",{});class y extends o.Component{constructor(){super(),this.getHeadersContent=this.getHeadersContent.bind(this),this.getRowsContent=this.getRowsContent.bind(this),this.getSummary=this.getSummary.bind(this)}getHeadersContent(){return[{label:Object(a.__)("Product / Variation title",'woocommerce'),key:"name",required:!0,isLeftAligned:!0},{label:Object(a.__)("SKU",'woocommerce'),key:"sku",hiddenByDefault:!0,isSortable:!0},{label:Object(a.__)("Items sold",'woocommerce'),key:"items_sold",required:!0,defaultSort:!0,isSortable:!0,isNumeric:!0},{label:Object(a.__)("Net sales",'woocommerce'),screenReaderLabel:Object(a.__)("Net sales",'woocommerce'),key:"net_revenue",required:!0,isSortable:!0,isNumeric:!0},{label:Object(a.__)("Orders",'woocommerce'),key:"orders_count",isSortable:!0,isNumeric:!0},"yes"===p?{label:Object(a.__)("Status",'woocommerce'),key:"stock_status"}:null,"yes"===p?{label:Object(a.__)("Stock",'woocommerce'),key:"stock",isNumeric:!0}:null].filter(Boolean)}getRowsContent(e=[]){const{query:t}=this.props,r=Object(s.getPersistedQuery)(t),{formatAmount:m,formatDecimal:u,getCurrencyConfig:y}=this.context;return Object(c.map)(e,e=>{const{items_sold:t,net_revenue:c,orders_count:g,product_id:O,variation_id:j}=e,h=e.extended_info||{},{stock_status:f,stock_quantity:w,low_stock_amount:v,sku:S}=h,C=(k=e,Object(b.h)(k.extended_info||{}));var k;const E=Object(s.getNewPath)(r,"/analytics/orders",{filter:"advanced",variation_includes:j}),q=Object(l.e)(`post.php?post=${O}&action=edit`);return[{display:Object(o.createElement)(n.Link,{href:q,type:"wp-admin"},C),value:C},{display:S,value:S},{display:Object(i.formatValue)(y(),"number",t),value:t},{display:m(c),value:u(c)},{display:Object(o.createElement)(n.Link,{href:E,type:"wc-admin"},g),value:g},"yes"===p?{display:Object(d.a)(f,w,v)?Object(o.createElement)(n.Link,{href:q,type:"wp-admin"},Object(a._x)("Low","Indication of a low quantity",'woocommerce')):_[f],value:_[f]}:null,"yes"===p?{display:w,value:w}:null].filter(Boolean)})}getSummary(e){const{variations_count:t=0,items_sold:r=0,net_revenue:o=0,orders_count:c=0}=e,{formatAmount:n,getCurrencyConfig:s}=this.context,l=s();return[{label:Object(a._n)("variation sold","variations sold",t,'woocommerce'),value:Object(i.formatValue)(l,"number",t)},{label:Object(a._n)("item sold","items sold",r,'woocommerce'),value:Object(i.formatValue)(l,"number",r)},{label:Object(a.__)("net sales",'woocommerce'),value:n(o)},{label:Object(a._n)("orders","orders",c,'woocommerce'),value:Object(i.formatValue)(l,"number",c)}]}render(){const{advancedFilters:e,baseSearchQuery:t,filters:r,isRequesting:c,query:n}=this.props,s={helpText:Object(a.__)("Check at least two variations below to compare",'woocommerce'),placeholder:Object(a.__)("Search by variation name or SKU",'woocommerce')};return Object(o.createElement)(m.a,{baseSearchQuery:t,compareBy:"variations",compareParam:"filter-variations",endpoint:"variations",getHeadersContent:this.getHeadersContent,getRowsContent:this.getRowsContent,isRequesting:c,itemIdField:"variation_id",labels:s,query:n,getSummary:this.getSummary,summaryFields:["variations_count","items_sold","net_revenue","orders_count"],tableQuery:{orderby:n.orderby||"items_sold",order:n.order||"desc",extended_info:!0,product_includes:n.products,variations:n.variations},title:Object(a.__)("Variations",'woocommerce'),columnPrefsKey:"variations_report_columns",filters:r,advancedFilters:e})}}y.contextType=u.a,t.a=y}}]);woocommerce-admin/dist/chunks/48.style.css000064400000005101151335517650014523 0ustar00.woocommerce-dismissable-list{margin:0 20px 10px;animation:isLoaded;animation-duration:.25s}@media(min-width:782px){.woocommerce-dismissable-list{margin-left:0;margin-right:0}}.woocommerce-dismissable-list .woocommerce-dismissable-list__controls{text-align:center}.woocommerce-services-item__logo{width:36px;height:auto}:root{--wp-admin-theme-color:#007cba;--wp-admin-theme-color-darker-10:#006ba1;--wp-admin-theme-color-darker-20:#005a87}body.admin-color-light{--wp-admin-theme-color:#0085ba;--wp-admin-theme-color-darker-10:#0073a1;--wp-admin-theme-color-darker-20:#006187}body.admin-color-modern{--wp-admin-theme-color:#3858e9;--wp-admin-theme-color-darker-10:#2145e6;--wp-admin-theme-color-darker-20:#183ad6}body.admin-color-blue{--wp-admin-theme-color:#096484;--wp-admin-theme-color-darker-10:#07526c;--wp-admin-theme-color-darker-20:#064054}body.admin-color-coffee{--wp-admin-theme-color:#46403c;--wp-admin-theme-color-darker-10:#383330;--wp-admin-theme-color-darker-20:#2b2724}body.admin-color-ectoplasm{--wp-admin-theme-color:#523f6d;--wp-admin-theme-color-darker-10:#46365d;--wp-admin-theme-color-darker-20:#3a2c4d}body.admin-color-midnight{--wp-admin-theme-color:#e14d43;--wp-admin-theme-color-darker-10:#dd382d;--wp-admin-theme-color-darker-20:#d02c21}body.admin-color-ocean{--wp-admin-theme-color:#627c83;--wp-admin-theme-color-darker-10:#576e74;--wp-admin-theme-color-darker-20:#4c6066}body.admin-color-sunrise{--wp-admin-theme-color:#dd823b;--wp-admin-theme-color-darker-10:#d97426;--wp-admin-theme-color-darker-20:#c36922}.woocommerce-recommended-shipping-extensions__more_options_cta .gridicon{margin-left:4px}.woocommerce-recommended-shipping-extensions .woocommerce-list__item>.woocommerce-list__item-inner{align-items:flex-start}.woocommerce-recommended-shipping-extensions .woocommerce-list__item:hover{background-color:#fff}.woocommerce-recommended-shipping-extensions .woocommerce-list__item:hover .woocommerce-list__item-title{color:#1e1e1e}.woocommerce-recommended-shipping-extensions .woocommerce-list__item-title{font-size:14px;color:#1e1e1e;font-weight:600}.woocommerce-recommended-shipping-extensions .woocommerce-pill{margin-left:4px;margin-top:4px;margin-bottom:4px;padding:2px 8px}@media(min-width:480px){.woocommerce-recommended-shipping-extensions .woocommerce-pill{margin-top:0;margin-bottom:0}}.woocommerce-recommended-shipping-extensions .woocommerce-list__item-after .components-button{margin-left:12px}.woocommerce-recommended-shipping-extensions .woocommerce-list__item-text,.woocommerce-recommended-shipping-extensions .woocommerce-recommended-shipping__header-heading{max-width:749px}woocommerce-admin/dist/chunks/0.js000064400000045112151335517650013122 0ustar00(window.__wcAdmin_webpackJsonp=window.__wcAdmin_webpackJsonp||[]).push([[0],{501:function(e,t,r){"use strict";r.d(t,"b",(function(){return l})),r.d(t,"a",(function(){return d}));var a=r(0),s=r(30),n=r(89),o=r.n(n),i=r(13);const c=o()(i.a),l=e=>{const t=c.getCurrencyConfig(),r=Object(s.applyFilters)("woocommerce_admin_report_currency",t,e);return o()(r)},d=Object(a.createContext)(c)},504:function(e,t,r){"use strict";var a=r(0),s=r(2),n=r(1),o=r.n(n),i=r(21);function c({className:e}){const t=Object(s.__)("There was an error getting your stats. Please try again.",'woocommerce'),r=Object(s.__)("Reload",'woocommerce');return Object(a.createElement)(i.EmptyContent,{className:e,title:t,actionLabel:r,actionCallback:()=>{window.location.reload()}})}c.propTypes={className:o.a.string},t.a=c},505:function(e,t,r){"use strict";var a=r(0),s=r(14),n=r(1),o=r.n(n),i=r(4),c=r(7),l=r(21),d=r(13),m=r(11),u=r(19),p=r(16),b=r(501),y=r(55);class g extends a.Component{constructor(){super(),this.onDateSelect=this.onDateSelect.bind(this),this.onFilterSelect=this.onFilterSelect.bind(this),this.onAdvancedFilterAction=this.onAdvancedFilterAction.bind(this)}onDateSelect(e){const{report:t,addCesSurveyForAnalytics:r}=this.props;r(),Object(p.recordEvent)("datepicker_update",{report:t,...Object(i.omitBy)(e,i.isUndefined)})}onFilterSelect(e){const{report:t,addCesSurveyForAnalytics:r}=this.props,a=e.filter||e["filter-variations"];["single_product","single_category","single_coupon","single_variation"].includes(a)&&r();const s={report:t,filter:e.filter||"all"};"single_product"===e.filter&&(s.filter_variation=e["filter-variations"]||"all"),Object(p.recordEvent)("analytics_filter",s)}onAdvancedFilterAction(e,t){const{report:r,addCesSurveyForAnalytics:a}=this.props;switch(e){case"add":Object(p.recordEvent)("analytics_filters_add",{report:r,filter:t.key});break;case"remove":Object(p.recordEvent)("analytics_filters_remove",{report:r,filter:t.key});break;case"filter":const e=Object.keys(t).reduce((e,r)=>(e[Object(i.snakeCase)(r)]=t[r],e),{});a(),Object(p.recordEvent)("analytics_filters_filter",{report:r,...e});break;case"clear_all":Object(p.recordEvent)("analytics_filters_clear_all",{report:r});break;case"match":Object(p.recordEvent)("analytics_filters_all_any",{report:r,value:t.match})}}render(){const{advancedFilters:e,filters:t,path:r,query:s,showDatePicker:n,defaultDateRange:o}=this.props,{period:i,compare:c,before:m,after:p}=Object(u.getDateParamsFromQuery)(s,o),{primary:b,secondary:y}=Object(u.getCurrentDates)(s,o),g={period:i,compare:c,before:m,after:p,primaryDate:b,secondaryDate:y},h=this.context;return Object(a.createElement)(l.ReportFilters,{query:s,siteLocale:d.b.siteLocale,currency:h.getCurrencyConfig(),path:r,filters:t,advancedFilters:e,showDatePicker:n,onDateSelect:this.onDateSelect,onFilterSelect:this.onFilterSelect,onAdvancedFilterAction:this.onAdvancedFilterAction,dateQuery:g,isoDateFormat:u.isoDateFormat})}}g.contextType=b.a,t.a=Object(s.compose)(Object(c.withSelect)(e=>{const{woocommerce_default_date_range:t}=e(m.SETTINGS_STORE_NAME).getSetting("wc_admin","wcAdminSettings");return{defaultDateRange:t}}),Object(c.withDispatch)(e=>{const{addCesSurveyForAnalytics:t}=e(y.c);return{addCesSurveyForAnalytics:t}}))(g),g.propTypes={advancedFilters:o.a.object,filters:o.a.array,path:o.a.string.isRequired,query:o.a.object,showDatePicker:o.a.bool,report:o.a.string.isRequired}},506:function(e,t,r){"use strict";var a=r(35),s=r.n(a),n=r(0),o=r(3),i=r(30),c=r(14),l=r(91),d=r(7),m=r(4),u=r(2),p=r(1),b=r.n(p),y=r(21),g=r(12),h=r(474),f=r(11),_=r(16),O=()=>Object(n.createElement)("svg",{role:"img","aria-hidden":"true",focusable:"false",version:"1.1",xmlns:"http://www.w3.org/2000/svg",x:"0px",y:"0px",viewBox:"0 0 24 24"},Object(n.createElement)("path",{d:"M18,9c-0.009,0-0.017,0.002-0.025,0.003C17.72,5.646,14.922,3,11.5,3C7.91,3,5,5.91,5,9.5c0,0.524,0.069,1.031,0.186,1.519 C5.123,11.016,5.064,11,5,11c-2.209,0-4,1.791-4,4c0,1.202,0.541,2.267,1.38,3h18.593C22.196,17.089,23,15.643,23,14 C23,11.239,20.761,9,18,9z M12,16l-4-5h3V8h2v3h3L12,16z"})),j=r(504);var v=r(55);r(515);const C=e=>{const{getHeadersContent:t,getRowsContent:r,getSummary:a,isRequesting:c,primaryData:d,tableData:p,endpoint:b,itemIdField:v,tableQuery:C,compareBy:w,compareParam:R,searchBy:S,labels:D={},...E}=e,{query:q,columnPrefsKey:F}=e,{items:T,query:k}=p,x=q[R]?Object(g.getIdsFromQuery)(q[w]):[],[P,A]=Object(n.useState)(x),N=Object(n.useRef)(null),{updateUserPreferences:I,...Q}=Object(f.useUserPreferences)();if(p.isError||d.isError)return Object(n.createElement)(j.a,null);let B=[];F&&(B=Q&&Q[F]?Q[F]:B);const L=(e,s,n)=>{const o=a?a(s,n):null;return Object(i.applyFilters)("woocommerce_admin_report_table",{endpoint:b,headers:t(),rows:r(e),totals:s,summary:o,items:T})},V=t=>{const{ids:r}=e;A(t?r:[])},M=(t,r)=>{const{ids:a}=e;if(r)A(Object(m.uniq)([a[t],...P]));else{const e=P.indexOf(a[t]);A([...P.slice(0,e),...P.slice(e+1)])}},H=t=>{const{ids:r=[]}=e,a=-1!==P.indexOf(r[t]);return{display:Object(n.createElement)(o.CheckboxControl,{onChange:Object(m.partial)(M,t),checked:a}),value:!1}},Y=()=>{const{ids:t=[]}=e,r=t.length>0,a=r&&t.length===P.length;return{cellClassName:"is-checkbox-column",key:"compare",label:Object(n.createElement)(o.CheckboxControl,{onChange:V,"aria-label":Object(u.__)("Select All"),checked:a,disabled:!r}),required:!0}},U=c||p.isRequesting||d.isRequesting,G=Object(m.get)(d,["data","totals"],{}),$=T.totalResults||0,z=$>0,J=Object(g.getSearchWords)(q).map(e=>({key:e,label:e})),{data:K}=T,W=L(K,G,$);let{headers:X,rows:Z}=W;const{summary:ee}=W;w&&(Z=Z.map((e,t)=>[H(t),...e]),X=[Y(),...X]);const te=((e,t)=>t?e.map(e=>({...e,visible:e.required||!t.includes(e.key)})):e.map(e=>({...e,visible:e.required||!e.hiddenByDefault})))(X,B);return Object(n.createElement)(n.Fragment,null,Object(n.createElement)("div",{className:"woocommerce-report-table__scroll-point",ref:N,"aria-hidden":!0}),Object(n.createElement)(y.TableCard,s()({className:"woocommerce-report-table",hasSearch:!!S,actions:[w&&Object(n.createElement)(y.CompareButton,{key:"compare",className:"woocommerce-table__compare",count:P.length,helpText:D.helpText||Object(u.__)("Check at least two items below to compare",'woocommerce'),onClick:()=>{w&&Object(g.onQueryChange)("compare")(w,R,P.join(","))},disabled:!z},D.compareButton||Object(u.__)("Compare",'woocommerce')),S&&Object(n.createElement)(y.Search,{allowFreeTextSearch:!0,inlineTags:!0,key:"search",onChange:t=>{const{baseSearchQuery:r,addCesSurveyForCustomerSearch:a}=e,s=t.map(e=>e.label.replace(",","%2C"));s.length?(Object(g.updateQueryString)({filter:void 0,[R]:void 0,[S]:void 0,...r,search:Object(m.uniq)(s).join(",")}),a()):Object(g.updateQueryString)({search:void 0}),Object(_.recordEvent)("analytics_table_filter",{report:b})},placeholder:D.placeholder||Object(u.__)("Search by item name",'woocommerce'),selected:J,showClearButton:!0,type:S,disabled:!z}),z&&Object(n.createElement)(o.Button,{key:"download",className:"woocommerce-table__download-button",disabled:U,onClick:()=>{const{createNotice:t,startExport:r,title:a}=e,s=Object.assign({},q),{data:n,totalResults:o}=T;let i="browser";if(delete s.extended_info,s.search&&delete s[S],n&&n.length===o){const{headers:e,rows:t}=L(n,o);Object(h.downloadCSVFile)(Object(h.generateCSVFileName)(a,s),Object(h.generateCSVDataFromTable)(e,t))}else i="email",r(b,k).then(()=>t("success",Object(u.sprintf)(Object(u.__)("Your %s Report will be emailed to you.",'woocommerce'),a))).catch(e=>t("error",e.message||Object(u.sprintf)(Object(u.__)("There was a problem exporting your %s Report. Please try again.",'woocommerce'),a)));Object(_.recordEvent)("analytics_table_download",{report:b,rows:o,download_type:i})}},Object(n.createElement)(O,null),Object(n.createElement)("span",{className:"woocommerce-table__download-button__label"},D.downloadButton||Object(u.__)("Download",'woocommerce')))],headers:te,isLoading:U,onQueryChange:g.onQueryChange,onColumnsChange:(e,t)=>{const r=X.map(e=>e.key).filter(t=>!e.includes(t));if(F){I({[F]:r})}if(t){const r={report:b,column:t,status:e.includes(t)?"on":"off"};Object(_.recordEvent)("analytics_table_header_toggle",r)}},onSort:(e,t)=>{Object(g.onQueryChange)("sort")(e,t);const r={report:b,column:e,direction:t};Object(_.recordEvent)("analytics_table_sort",r)},onPageChange:(e,t)=>{N.current.scrollIntoView();const r=N.current.nextSibling.querySelector(".woocommerce-table__table"),a=l.focus.focusable.find(r);a.length&&a[0].focus(),t&&("goto"===t?Object(_.recordEvent)("analytics_table_go_to_page",{report:b,page:e}):Object(_.recordEvent)("analytics_table_page_click",{report:b,direction:t}))},rows:Z,rowsPerPage:parseInt(k.per_page,10)||f.QUERY_DEFAULTS.pageSize,summary:ee,totalRows:$},E)))};C.propTypes={baseSearchQuery:b.a.object,compareBy:b.a.string,compareParam:b.a.string,columnPrefsKey:b.a.string,endpoint:b.a.string,extendItemsMethodNames:b.a.shape({getError:b.a.string,isRequesting:b.a.string,load:b.a.string}),extendedItemsStoreName:b.a.string,getHeadersContent:b.a.func.isRequired,getRowsContent:b.a.func.isRequired,getSummary:b.a.func,itemIdField:b.a.string,labels:b.a.shape({compareButton:b.a.string,downloadButton:b.a.string,helpText:b.a.string,placeholder:b.a.string}),primaryData:b.a.object,searchBy:b.a.string,summaryFields:b.a.arrayOf(b.a.string),tableData:b.a.object.isRequired,tableQuery:b.a.object,title:b.a.string.isRequired},C.defaultProps={primaryData:{},tableData:{items:{data:[],totalResults:0},query:{}},tableQuery:{},compareParam:"filter",downloadable:!1,onSearch:m.noop,baseSearchQuery:{}};const w=[],R={};t.a=Object(c.compose)(Object(d.withSelect)((e,t)=>{const{endpoint:r,getSummary:a,isRequesting:s,itemIdField:n,query:o,tableData:i,tableQuery:c,filters:l,advancedFilters:d,summaryFields:u,extendedItemsStoreName:p}=t,b=e(f.REPORTS_STORE_NAME),y=p?e(p):null,{woocommerce_default_date_range:g}=e(f.SETTINGS_STORE_NAME).getSetting("wc_admin","wcAdminSettings");if(s)return R;const h="categories"===r?"products":r,_=a?Object(f.getReportChartData)({endpoint:h,selector:b,dataType:"primary",query:o,filters:l,advancedFilters:d,defaultDateRange:g,fields:u}):R,O=i||Object(f.getReportTableData)({endpoint:r,query:o,selector:b,tableQuery:c,filters:l,advancedFilters:d,defaultDateRange:g}),j=y?function(e,t,r){const{extendItemsMethodNames:a,itemIdField:s}=t,n=r.items.data;if(!(Array.isArray(n)&&n.length&&a&&s))return r;const{[a.getError]:o,[a.isRequesting]:i,[a.load]:c}=e,l={include:n.map(e=>e[s]).join(","),per_page:n.length},d=c(l),u=!!i&&i(l),p=!!o&&o(l),b=n.map(e=>{const t=Object(m.first)(d.filter(t=>e.id===t.id));return{...e,...t}}),y=r.isRequesting||u,g=r.isError||p;return{...r,isRequesting:y,isError:g,items:{...r.items,data:b}}}(y,t,O):O;return{primaryData:_,ids:n&&j.items.data?j.items.data.map(e=>e[n]):w,tableData:j,query:o}}),Object(d.withDispatch)(e=>{const{startExport:t}=e(f.EXPORT_STORE_NAME),{createNotice:r}=e("core/notices"),{addCesSurveyForCustomerSearch:a}=e(v.c);return{createNotice:r,startExport:t,addCesSurveyForCustomerSearch:a}}))(C)},508:function(e,t,r){"use strict";var a=r(0),s=r(2),n=r(14),o=r(59),i=r(7),c=r(4),l=r(1),d=r.n(l),m=r(21),u=r(11),p=r(19),b=r(501),y=r(504),g=r(12);class h extends a.Component{shouldComponentUpdate(e){return e.isRequesting!==this.props.isRequesting||e.primaryData.isRequesting!==this.props.primaryData.isRequesting||e.secondaryData.isRequesting!==this.props.secondaryData.isRequesting||!Object(c.isEqual)(e.query,this.props.query)}getItemChartData(){const{primaryData:e,selectedChart:t}=this.props;return e.data.intervals.map((function(e){const r={};return e.subtotals.segments.forEach((function(e){if(e.segment_label){const a=r[e.segment_label]?e.segment_label+" (#"+e.segment_id+")":e.segment_label;r[e.segment_id]={label:a,value:e.subtotals[t.key]||0}}})),{date:Object(o.format)("Y-m-d\\TH:i:s",e.date_start),...r}}))}getTimeChartData(){const{query:e,primaryData:t,secondaryData:r,selectedChart:a,defaultDateRange:s}=this.props,n=Object(p.getIntervalForQuery)(e),{primary:i,secondary:c}=Object(p.getCurrentDates)(e,s);return t.data.intervals.map((function(t,s){const l=Object(p.getPreviousDate)(t.date_start,i.after,c.after,e.compare,n),d=r.data.intervals[s];return{date:Object(o.format)("Y-m-d\\TH:i:s",t.date_start),primary:{label:`${i.label} (${i.range})`,labelDate:t.date_start,value:t.subtotals[a.key]||0},secondary:{label:`${c.label} (${c.range})`,labelDate:l.format("YYYY-MM-DD HH:mm:ss"),value:d&&d.subtotals[a.key]||0}}}))}getTimeChartTotals(){const{primaryData:e,secondaryData:t,selectedChart:r}=this.props;return{primary:Object(c.get)(e,["data","totals",r.key],null),secondary:Object(c.get)(t,["data","totals",r.key],null)}}renderChart(e,t,r,n){const{emptySearchResults:o,filterParam:i,interactiveLegend:c,itemsLabel:l,legendPosition:d,path:b,query:y,selectedChart:g,showHeaderControls:h,primaryData:f}=this.props,_=Object(p.getIntervalForQuery)(y),O=Object(p.getAllowedIntervalsForQuery)(y),j=Object(p.getDateFormatsForInterval)(_,f.data.intervals.length),v=o?Object(s.__)("No data for the current search",'woocommerce'):Object(s.__)("No data for the selected date range",'woocommerce'),{formatAmount:C,getCurrencyConfig:w}=this.context;return Object(a.createElement)(m.Chart,{allowedIntervals:O,data:r,dateParser:"%Y-%m-%dT%H:%M:%S",emptyMessage:v,filterParam:i,interactiveLegend:c,interval:_,isRequesting:t,itemsLabel:l,legendPosition:d,legendTotals:n,mode:e,path:b,query:y,screenReaderFormat:j.screenReaderFormat,showHeaderControls:h,title:g.label,tooltipLabelFormat:j.tooltipLabelFormat,tooltipTitle:"time-comparison"===e&&g.label||null,tooltipValueFormat:Object(u.getTooltipValueFormat)(g.type,C),chartType:Object(p.getChartTypeForQuery)(y),valueType:g.type,xFormat:j.xFormat,x2Format:j.x2Format,currency:w()})}renderItemComparison(){const{isRequesting:e,primaryData:t}=this.props;if(t.isError)return Object(a.createElement)(y.a,null);const r=e||t.isRequesting,s=this.getItemChartData();return this.renderChart("item-comparison",r,s)}renderTimeComparison(){const{isRequesting:e,primaryData:t,secondaryData:r}=this.props;if(!t||t.isError||r.isError)return Object(a.createElement)(y.a,null);const s=e||t.isRequesting||r.isRequesting,n=this.getTimeChartData(),o=this.getTimeChartTotals();return this.renderChart("time-comparison",s,n,o)}render(){const{mode:e}=this.props;return"item-comparison"===e?this.renderItemComparison():this.renderTimeComparison()}}h.contextType=b.a,h.propTypes={filters:d.a.array,isRequesting:d.a.bool,itemsLabel:d.a.string,limitProperties:d.a.array,mode:d.a.string,path:d.a.string.isRequired,primaryData:d.a.object,query:d.a.object.isRequired,secondaryData:d.a.object,selectedChart:d.a.shape({key:d.a.string.isRequired,label:d.a.string.isRequired,order:d.a.oneOf(["asc","desc"]),orderby:d.a.string,type:d.a.oneOf(["average","number","currency"]).isRequired}).isRequired},h.defaultProps={isRequesting:!1,primaryData:{data:{intervals:[]},isError:!1,isRequesting:!1},secondaryData:{data:{intervals:[]},isError:!1,isRequesting:!1}};t.a=Object(n.compose)(Object(i.withSelect)((e,t)=>{const{charts:r,endpoint:a,filters:s,isRequesting:n,limitProperties:o,query:i,advancedFilters:l}=t,d=o||[a],m=function e(t,r,a={}){if(!t||0===t.length)return null;const s=t.slice(0),n=s.pop();if(n.showFilters(r,a)){const e=Object(g.flattenFilters)(n.filters),t=r[n.param]||n.defaultValue||"all";return Object(c.find)(e,{value:t})}return e(s,r,a)}(s,i),p=Object(c.get)(m,["settings","param"]),b=t.mode||function(e,t){if(e&&t){const r=Object(c.get)(e,["settings","param"]);if(!r||Object.keys(t).includes(r))return Object(c.get)(e,["chartMode"])}return null}(m,i)||"time-comparison",{woocommerce_default_date_range:y}=e(u.SETTINGS_STORE_NAME).getSetting("wc_admin","wcAdminSettings"),h=e(u.REPORTS_STORE_NAME),f={mode:b,filterParam:p,defaultDateRange:y};if(n)return f;const _=d.some(e=>i[e]&&i[e].length);if(i.search&&!_)return{...f,emptySearchResults:!0};const O=r&&r.map(e=>e.key),j=Object(u.getReportChartData)({endpoint:a,dataType:"primary",query:i,selector:h,limitBy:d,filters:s,advancedFilters:l,defaultDateRange:y,fields:O});if("item-comparison"===b)return{...f,primaryData:j};const v=Object(u.getReportChartData)({endpoint:a,dataType:"secondary",query:i,selector:h,limitBy:d,filters:s,advancedFilters:l,defaultDateRange:y,fields:O});return{...f,primaryData:j,secondaryData:v}}))(h)},510:function(e,t,r){"use strict";r.d(t,"a",(function(){return s}));var a=r(4);function s(e,t=[]){const r=Object(a.find)(t,{key:e});return r||t[0]}},511:function(e,t,r){"use strict";var a=r(0),s=r(2),n=r(14),o=r(7),i=r(1),c=r.n(i),l=r(12),d=r(21),m=r(120),u=r(11),p=r(19),b=r(16),y=r(504),g=r(501);class h extends a.Component{formatVal(e,t){const{formatAmount:r,getCurrencyConfig:a}=this.context;return"currency"===t?r(e):Object(m.formatValue)(a(),t,e)}getValues(e,t){const{emptySearchResults:r,summaryData:a}=this.props,{totals:s}=a,n=s.primary?s.primary[e]:0,o=s.secondary?s.secondary[e]:0,i=r?0:n,c=r?0:o;return{delta:Object(m.calculateDelta)(i,c),prevValue:this.formatVal(c,t),value:this.formatVal(i,t)}}render(){const{charts:e,query:t,selectedChart:r,summaryData:n,endpoint:o,report:i,defaultDateRange:c}=this.props,{isError:m,isRequesting:u}=n;if(m)return Object(a.createElement)(y.a,null);if(u)return Object(a.createElement)(d.SummaryListPlaceholder,{numberOfItems:e.length});const{compare:g}=Object(p.getDateParamsFromQuery)(t,c);return Object(a.createElement)(d.SummaryList,null,({onToggle:t})=>e.map(e=>{const{key:n,order:c,orderby:m,label:u,type:p,isReverseTrend:y}=e,h={chart:n};m&&(h.orderby=m),c&&(h.order=c);const f=Object(l.getNewPath)(h),_=r.key===n,{delta:O,prevValue:j,value:v}=this.getValues(n,p);return Object(a.createElement)(d.SummaryNumber,{key:n,delta:O,href:f,label:u,reverseTrend:y,prevLabel:"previous_period"===g?Object(s.__)("Previous period:",'woocommerce'):Object(s.__)("Previous year:",'woocommerce'),prevValue:j,selected:_,value:v,onLinkClickCallback:()=>{t&&t(),Object(b.recordEvent)("analytics_chart_tab_click",{report:i||o,key:n})}})}))}}h.propTypes={charts:c.a.array.isRequired,endpoint:c.a.string.isRequired,limitProperties:c.a.array,query:c.a.object.isRequired,selectedChart:c.a.shape({key:c.a.string.isRequired,label:c.a.string.isRequired,order:c.a.oneOf(["asc","desc"]),orderby:c.a.string,type:c.a.oneOf(["average","number","currency"]).isRequired}).isRequired,summaryData:c.a.object,report:c.a.string},h.defaultProps={summaryData:{totals:{primary:{},secondary:{}},isError:!1}},h.contextType=g.a,t.a=Object(n.compose)(Object(o.withSelect)((e,t)=>{const{charts:r,endpoint:a,limitProperties:s,query:n,filters:o,advancedFilters:i}=t,c=s||[a],l=c.some(e=>n[e]&&n[e].length);if(n.search&&!l)return{emptySearchResults:!0};const d=r&&r.map(e=>e.key),{woocommerce_default_date_range:m}=e(u.SETTINGS_STORE_NAME).getSetting("wc_admin","wcAdminSettings");return{summaryData:Object(u.getSummaryNumbers)({endpoint:a,query:n,select:e,limitBy:c,filters:o,advancedFilters:i,defaultDateRange:m,fields:d}),defaultDateRange:m}}))(h)},515:function(e,t,r){}}]);woocommerce-admin/dist/chunks/1.js000064400000042636151335517650013133 0ustar00/*! For license information please see 1.js.LICENSE.txt */
(window.__wcAdmin_webpackJsonp=window.__wcAdmin_webpackJsonp||[]).push([[1],{53:function(e,t,n){e.exports=function(){"use strict";var e=Object.hasOwnProperty,t=Object.setPrototypeOf,n=Object.isFrozen,r=Object.getPrototypeOf,o=Object.getOwnPropertyDescriptor,i=Object.freeze,a=Object.seal,l=Object.create,c="undefined"!=typeof Reflect&&Reflect,s=c.apply,u=c.construct;s||(s=function(e,t,n){return e.apply(t,n)}),i||(i=function(e){return e}),a||(a=function(e){return e}),u||(u=function(e,t){return new(Function.prototype.bind.apply(e,[null].concat(function(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}(t))))});var f,m=w(Array.prototype.forEach),p=w(Array.prototype.pop),d=w(Array.prototype.push),g=w(String.prototype.toLowerCase),h=w(String.prototype.match),y=w(String.prototype.replace),v=w(String.prototype.indexOf),b=w(String.prototype.trim),A=w(RegExp.prototype.test),T=(f=TypeError,function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return u(f,t)});function w(e){return function(t){for(var n=arguments.length,r=Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return s(e,t,r)}}function x(e,r){t&&t(e,null);for(var o=r.length;o--;){var i=r[o];if("string"==typeof i){var a=g(i);a!==i&&(n(r)||(r[o]=a),i=a)}e[i]=!0}return e}function S(t){var n=l(null),r=void 0;for(r in t)s(e,t,[r])&&(n[r]=t[r]);return n}function k(e,t){for(;null!==e;){var n=o(e,t);if(n){if(n.get)return w(n.get);if("function"==typeof n.value)return w(n.value)}e=r(e)}return function(e){return console.warn("fallback value for",e),null}}var _=i(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),E=i(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),R=i(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),D=i(["animate","color-profile","cursor","discard","fedropshadow","feimage","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),N=i(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover"]),O=i(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),L=i(["#text"]),M=i(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","xmlns","slot"]),F=i(["accent-height","accumulate","additive","alignment-baseline","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","targetx","targety","transform","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),I=i(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),C=i(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),z=a(/\{\{[\s\S]*|[\s\S]*\}\}/gm),U=a(/<%[\s\S]*|[\s\S]*%>/gm),H=a(/^data-[\-\w.\u00B7-\uFFFF]/),j=a(/^aria-[\-\w]+$/),P=a(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),B=a(/^(?:\w+script|data):/i),W=a(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),G="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};function q(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}var K=function(){return"undefined"==typeof window?null:window},V=function(e,t){if("object"!==(void 0===e?"undefined":G(e))||"function"!=typeof e.createPolicy)return null;var n=null;t.currentScript&&t.currentScript.hasAttribute("data-tt-policy-suffix")&&(n=t.currentScript.getAttribute("data-tt-policy-suffix"));var r="dompurify"+(n?"#"+n:"");try{return e.createPolicy(r,{createHTML:function(e){return e}})}catch(e){return console.warn("TrustedTypes policy "+r+" could not be created."),null}};return function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:K(),n=function(t){return e(t)};if(n.version="2.2.9",n.removed=[],!t||!t.document||9!==t.document.nodeType)return n.isSupported=!1,n;var r=t.document,o=t.document,a=t.DocumentFragment,l=t.HTMLTemplateElement,c=t.Node,s=t.Element,u=t.NodeFilter,f=t.NamedNodeMap,w=void 0===f?t.NamedNodeMap||t.MozNamedAttrMap:f,Y=t.Text,J=t.Comment,X=t.DOMParser,$=t.trustedTypes,Z=s.prototype,Q=k(Z,"cloneNode"),ee=k(Z,"nextSibling"),te=k(Z,"childNodes"),ne=k(Z,"parentNode");if("function"==typeof l){var re=o.createElement("template");re.content&&re.content.ownerDocument&&(o=re.content.ownerDocument)}var oe=V($,r),ie=oe&&Ce?oe.createHTML(""):"",ae=o,le=ae.implementation,ce=ae.createNodeIterator,se=ae.createDocumentFragment,ue=r.importNode,fe={};try{fe=S(o).documentMode?o.documentMode:{}}catch(e){}var me={};n.isSupported="function"==typeof ne&&le&&void 0!==le.createHTMLDocument&&9!==fe;var pe=z,de=U,ge=H,he=j,ye=B,ve=W,be=P,Ae=null,Te=x({},[].concat(q(_),q(E),q(R),q(N),q(L))),we=null,xe=x({},[].concat(q(M),q(F),q(I),q(C))),Se=null,ke=null,_e=!0,Ee=!0,Re=!1,De=!1,Ne=!1,Oe=!1,Le=!1,Me=!1,Fe=!1,Ie=!0,Ce=!1,ze=!0,Ue=!0,He=!1,je={},Pe=x({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]),Be=null,We=x({},["audio","video","img","source","image","track"]),Ge=null,qe=x({},["alt","class","for","id","label","name","pattern","placeholder","summary","title","value","style","xmlns"]),Ke="http://www.w3.org/1998/Math/MathML",Ve="http://www.w3.org/2000/svg",Ye="http://www.w3.org/1999/xhtml",Je=Ye,Xe=!1,$e=null,Ze=o.createElement("form"),Qe=function(e){$e&&$e===e||(e&&"object"===(void 0===e?"undefined":G(e))||(e={}),e=S(e),Ae="ALLOWED_TAGS"in e?x({},e.ALLOWED_TAGS):Te,we="ALLOWED_ATTR"in e?x({},e.ALLOWED_ATTR):xe,Ge="ADD_URI_SAFE_ATTR"in e?x(S(qe),e.ADD_URI_SAFE_ATTR):qe,Be="ADD_DATA_URI_TAGS"in e?x(S(We),e.ADD_DATA_URI_TAGS):We,Se="FORBID_TAGS"in e?x({},e.FORBID_TAGS):{},ke="FORBID_ATTR"in e?x({},e.FORBID_ATTR):{},je="USE_PROFILES"in e&&e.USE_PROFILES,_e=!1!==e.ALLOW_ARIA_ATTR,Ee=!1!==e.ALLOW_DATA_ATTR,Re=e.ALLOW_UNKNOWN_PROTOCOLS||!1,De=e.SAFE_FOR_TEMPLATES||!1,Ne=e.WHOLE_DOCUMENT||!1,Me=e.RETURN_DOM||!1,Fe=e.RETURN_DOM_FRAGMENT||!1,Ie=!1!==e.RETURN_DOM_IMPORT,Ce=e.RETURN_TRUSTED_TYPE||!1,Le=e.FORCE_BODY||!1,ze=!1!==e.SANITIZE_DOM,Ue=!1!==e.KEEP_CONTENT,He=e.IN_PLACE||!1,be=e.ALLOWED_URI_REGEXP||be,Je=e.NAMESPACE||Ye,De&&(Ee=!1),Fe&&(Me=!0),je&&(Ae=x({},[].concat(q(L))),we=[],!0===je.html&&(x(Ae,_),x(we,M)),!0===je.svg&&(x(Ae,E),x(we,F),x(we,C)),!0===je.svgFilters&&(x(Ae,R),x(we,F),x(we,C)),!0===je.mathMl&&(x(Ae,N),x(we,I),x(we,C))),e.ADD_TAGS&&(Ae===Te&&(Ae=S(Ae)),x(Ae,e.ADD_TAGS)),e.ADD_ATTR&&(we===xe&&(we=S(we)),x(we,e.ADD_ATTR)),e.ADD_URI_SAFE_ATTR&&x(Ge,e.ADD_URI_SAFE_ATTR),Ue&&(Ae["#text"]=!0),Ne&&x(Ae,["html","head","body"]),Ae.table&&(x(Ae,["tbody"]),delete Se.tbody),i&&i(e),$e=e)},et=x({},["mi","mo","mn","ms","mtext"]),tt=x({},["foreignobject","desc","title","annotation-xml"]),nt=x({},E);x(nt,R),x(nt,D);var rt=x({},N);x(rt,O);var ot=function(e){var t=ne(e);t&&t.tagName||(t={namespaceURI:Ye,tagName:"template"});var n=g(e.tagName),r=g(t.tagName);if(e.namespaceURI===Ve)return t.namespaceURI===Ye?"svg"===n:t.namespaceURI===Ke?"svg"===n&&("annotation-xml"===r||et[r]):Boolean(nt[n]);if(e.namespaceURI===Ke)return t.namespaceURI===Ye?"math"===n:t.namespaceURI===Ve?"math"===n&&tt[r]:Boolean(rt[n]);if(e.namespaceURI===Ye){if(t.namespaceURI===Ve&&!tt[r])return!1;if(t.namespaceURI===Ke&&!et[r])return!1;var o=x({},["title","style","font","a","script"]);return!rt[n]&&(o[n]||!nt[n])}return!1},it=function(e){d(n.removed,{element:e});try{e.parentNode.removeChild(e)}catch(t){try{e.outerHTML=ie}catch(t){e.remove()}}},at=function(e,t){try{d(n.removed,{attribute:t.getAttributeNode(e),from:t})}catch(e){d(n.removed,{attribute:null,from:t})}if(t.removeAttribute(e),"is"===e&&!we[e])if(Me||Fe)try{it(t)}catch(e){}else try{t.setAttribute(e,"")}catch(e){}},lt=function(e){var t=void 0,n=void 0;if(Le)e="<remove></remove>"+e;else{var r=h(e,/^[\r\n\t ]+/);n=r&&r[0]}var i=oe?oe.createHTML(e):e;if(Je===Ye)try{t=(new X).parseFromString(i,"text/html")}catch(e){}if(!t||!t.documentElement){t=le.createDocument(Je,"template",null);try{t.documentElement.innerHTML=Xe?"":i}catch(e){}}var a=t.body||t.documentElement;return e&&n&&a.insertBefore(o.createTextNode(n),a.childNodes[0]||null),Ne?t.documentElement:a},ct=function(e){return ce.call(e.ownerDocument||e,e,u.SHOW_ELEMENT|u.SHOW_COMMENT|u.SHOW_TEXT,null,!1)},st=function(e){return!(e instanceof Y||e instanceof J||"string"==typeof e.nodeName&&"string"==typeof e.textContent&&"function"==typeof e.removeChild&&e.attributes instanceof w&&"function"==typeof e.removeAttribute&&"function"==typeof e.setAttribute&&"string"==typeof e.namespaceURI&&"function"==typeof e.insertBefore)},ut=function(e){return"object"===(void 0===c?"undefined":G(c))?e instanceof c:e&&"object"===(void 0===e?"undefined":G(e))&&"number"==typeof e.nodeType&&"string"==typeof e.nodeName},ft=function(e,t,r){me[e]&&m(me[e],(function(e){e.call(n,t,r,$e)}))},mt=function(e){var t=void 0;if(ft("beforeSanitizeElements",e,null),st(e))return it(e),!0;if(h(e.nodeName,/[\u0080-\uFFFF]/))return it(e),!0;var r=g(e.nodeName);if(ft("uponSanitizeElement",e,{tagName:r,allowedTags:Ae}),!ut(e.firstElementChild)&&(!ut(e.content)||!ut(e.content.firstElementChild))&&A(/<[/\w]/g,e.innerHTML)&&A(/<[/\w]/g,e.textContent))return it(e),!0;if(!Ae[r]||Se[r]){if(Ue&&!Pe[r]){var o=ne(e)||e.parentNode,i=te(e)||e.childNodes;if(i&&o)for(var a=i.length-1;a>=0;--a)o.insertBefore(Q(i[a],!0),ee(e))}return it(e),!0}return e instanceof s&&!ot(e)?(it(e),!0):"noscript"!==r&&"noembed"!==r||!A(/<\/no(script|embed)/i,e.innerHTML)?(De&&3===e.nodeType&&(t=e.textContent,t=y(t,pe," "),t=y(t,de," "),e.textContent!==t&&(d(n.removed,{element:e.cloneNode()}),e.textContent=t)),ft("afterSanitizeElements",e,null),!1):(it(e),!0)},pt=function(e,t,n){if(ze&&("id"===t||"name"===t)&&(n in o||n in Ze))return!1;if(Ee&&A(ge,t));else if(_e&&A(he,t));else{if(!we[t]||ke[t])return!1;if(Ge[t]);else if(A(be,y(n,ve,"")));else if("src"!==t&&"xlink:href"!==t&&"href"!==t||"script"===e||0!==v(n,"data:")||!Be[e])if(Re&&!A(ye,y(n,ve,"")));else if(n)return!1}return!0},dt=function(e){var t=void 0,r=void 0,o=void 0,i=void 0;ft("beforeSanitizeAttributes",e,null);var a=e.attributes;if(a){var l={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:we};for(i=a.length;i--;){var c=t=a[i],s=c.name,u=c.namespaceURI;if(r=b(t.value),o=g(s),l.attrName=o,l.attrValue=r,l.keepAttr=!0,l.forceKeepAttr=void 0,ft("uponSanitizeAttribute",e,l),r=l.attrValue,!l.forceKeepAttr&&(at(s,e),l.keepAttr))if(A(/\/>/i,r))at(s,e);else{De&&(r=y(r,pe," "),r=y(r,de," "));var f=e.nodeName.toLowerCase();if(pt(f,o,r))try{u?e.setAttributeNS(u,s,r):e.setAttribute(s,r),p(n.removed)}catch(e){}}}ft("afterSanitizeAttributes",e,null)}},gt=function e(t){var n=void 0,r=ct(t);for(ft("beforeSanitizeShadowDOM",t,null);n=r.nextNode();)ft("uponSanitizeShadowNode",n,null),mt(n)||(n.content instanceof a&&e(n.content),dt(n));ft("afterSanitizeShadowDOM",t,null)};return n.sanitize=function(e,o){var i=void 0,l=void 0,s=void 0,u=void 0,f=void 0;if((Xe=!e)&&(e="\x3c!--\x3e"),"string"!=typeof e&&!ut(e)){if("function"!=typeof e.toString)throw T("toString is not a function");if("string"!=typeof(e=e.toString()))throw T("dirty is not a string, aborting")}if(!n.isSupported){if("object"===G(t.toStaticHTML)||"function"==typeof t.toStaticHTML){if("string"==typeof e)return t.toStaticHTML(e);if(ut(e))return t.toStaticHTML(e.outerHTML)}return e}if(Oe||Qe(o),n.removed=[],"string"==typeof e&&(He=!1),He);else if(e instanceof c)1===(l=(i=lt("\x3c!----\x3e")).ownerDocument.importNode(e,!0)).nodeType&&"BODY"===l.nodeName||"HTML"===l.nodeName?i=l:i.appendChild(l);else{if(!Me&&!De&&!Ne&&-1===e.indexOf("<"))return oe&&Ce?oe.createHTML(e):e;if(!(i=lt(e)))return Me?null:ie}i&&Le&&it(i.firstChild);for(var m=ct(He?e:i);s=m.nextNode();)3===s.nodeType&&s===u||mt(s)||(s.content instanceof a&&gt(s.content),dt(s),u=s);if(u=null,He)return e;if(Me){if(Fe)for(f=se.call(i.ownerDocument);i.firstChild;)f.appendChild(i.firstChild);else f=i;return Ie&&(f=ue.call(r,f,!0)),f}var p=Ne?i.outerHTML:i.innerHTML;return De&&(p=y(p,pe," "),p=y(p,de," ")),oe&&Ce?oe.createHTML(p):p},n.setConfig=function(e){Qe(e),Oe=!0},n.clearConfig=function(){$e=null,Oe=!1},n.isValidAttribute=function(e,t,n){$e||Qe({});var r=g(e),o=g(t);return pt(r,o,n)},n.addHook=function(e,t){"function"==typeof t&&(me[e]=me[e]||[],d(me[e],t))},n.removeHook=function(e){me[e]&&p(me[e])},n.removeHooks=function(e){me[e]&&(me[e]=[])},n.removeAllHooks=function(){me={}},n}()}()}}]);woocommerce-admin/dist/chunks/analytics-report.js000064400000003750151335517650016265 0ustar00(window.__wcAdmin_webpackJsonp=window.__wcAdmin_webpackJsonp||[]).push([[6],{501:function(e,t,r){"use strict";r.d(t,"b",(function(){return u})),r.d(t,"a",(function(){return p}));var n=r(0),c=r(30),s=r(89),o=r.n(s),a=r(13);const i=o()(a.a),u=e=>{const t=i.getCurrencyConfig(),r=Object(c.applyFilters)("woocommerce_admin_report_currency",t,e);return o()(r)},p=Object(n.createContext)(i)},504:function(e,t,r){"use strict";var n=r(0),c=r(2),s=r(1),o=r.n(s),a=r(21);function i({className:e}){const t=Object(c.__)("There was an error getting your stats. Please try again.",'woocommerce'),r=Object(c.__)("Reload",'woocommerce');return Object(n.createElement)(a.EmptyContent,{className:e,title:t,actionLabel:r,actionCallback:()=>{window.location.reload()}})}i.propTypes={className:o.a.string},t.a=i},545:function(e,t,r){},605:function(e,t,r){"use strict";r.r(t);var n=r(0),c=r(14),s=r(7),o=r(1),a=r.n(o),i=r(4),u=r(12),p=r(11),l=(r(545),r(504)),m=r(501),b=r(117);const d=({params:e,path:t})=>e.report||t.replace(/^\/+/,"");class j extends n.Component{constructor(){super(...arguments),this.state={hasError:!1}}componentDidCatch(e){this.setState({hasError:!0}),console.warn(e)}render(){if(this.state.hasError)return null;const{isError:e}=this.props;if(e)return Object(n.createElement)(l.a,null);const t=d(this.props),r=Object(i.find)(Object(b.a)(),{report:t});if(!r)return null;const c=r.component;return Object(n.createElement)(m.a.Provider,{value:Object(m.b)(Object(u.getQuery)())},Object(n.createElement)(c,this.props))}}j.propTypes={params:a.a.object.isRequired},t.default=Object(c.compose)(Object(s.withSelect)((e,t)=>{const r=Object(u.getQuery)(),{search:n}=r,c=e(p.ITEMS_STORE_NAME);if(!n)return{};const s=d(t),o=Object(u.getSearchWords)(r),a="categories"===s&&"single_category"===r.filter?"products":s,i=Object(p.searchItemsByString)(c,a,o,{per_page:100}),{isError:l,isRequesting:m,items:b}=i,j=Object.keys(b);return j.length?{isError:l,isRequesting:m,query:{...t.query,[a]:j.join(",")}}:{isError:l,isRequesting:m}}))(j)}}]);woocommerce-admin/dist/chunks/14.style.css000064400000004376151335517650014531 0ustar00:root{--wp-admin-theme-color:#007cba;--wp-admin-theme-color-darker-10:#006ba1;--wp-admin-theme-color-darker-20:#005a87}body.admin-color-light{--wp-admin-theme-color:#0085ba;--wp-admin-theme-color-darker-10:#0073a1;--wp-admin-theme-color-darker-20:#006187}body.admin-color-modern{--wp-admin-theme-color:#3858e9;--wp-admin-theme-color-darker-10:#2145e6;--wp-admin-theme-color-darker-20:#183ad6}body.admin-color-blue{--wp-admin-theme-color:#096484;--wp-admin-theme-color-darker-10:#07526c;--wp-admin-theme-color-darker-20:#064054}body.admin-color-coffee{--wp-admin-theme-color:#46403c;--wp-admin-theme-color-darker-10:#383330;--wp-admin-theme-color-darker-20:#2b2724}body.admin-color-ectoplasm{--wp-admin-theme-color:#523f6d;--wp-admin-theme-color-darker-10:#46365d;--wp-admin-theme-color-darker-20:#3a2c4d}body.admin-color-midnight{--wp-admin-theme-color:#e14d43;--wp-admin-theme-color-darker-10:#dd382d;--wp-admin-theme-color-darker-20:#d02c21}body.admin-color-ocean{--wp-admin-theme-color:#627c83;--wp-admin-theme-color-darker-10:#576e74;--wp-admin-theme-color-darker-20:#4c6066}body.admin-color-sunrise{--wp-admin-theme-color:#dd823b;--wp-admin-theme-color-darker-10:#d97426;--wp-admin-theme-color-darker-20:#c36922}.woocommerce-report-table__scroll-point{position:relative;top:-48px}@media(max-width:782px){.woocommerce-report-table__scroll-point{top:-62px}}.woocommerce-feature-enabled-activity-panels .woocommerce-report-table__scroll-point{top:-108px}@media(max-width:782px){.woocommerce-feature-enabled-activity-panels .woocommerce-report-table__scroll-point{top:-122px}}.woocommerce-report-table .woocommerce-search{flex-grow:1}.woocommerce-report-table .components-card__header{display:grid;grid-gap:12px;grid-template-columns:min-content 1fr min-content}.woocommerce-report-table .woocommerce-table__compare.components-button{padding:8px}.woocommerce-report-table .woocommerce-ellipsis-menu{justify-self:flex-end}button.woocommerce-table__download-button{padding:6px 12px;color:#000;text-decoration:none;align-items:center}button.woocommerce-table__download-button svg{margin-right:8px;height:24px;width:24px}@media(max-width:782px){button.woocommerce-table__download-button svg{margin-right:0}button.woocommerce-table__download-button .woocommerce-table__download-button__label{display:none}}woocommerce-admin/dist/chunks/store-performance.js000064400000011322151335517650016412 0ustar00(window.__wcAdmin_webpackJsonp=window.__wcAdmin_webpackJsonp||[]).push([[50],{525:function(e,t,r){"use strict";r.d(t,"b",(function(){return d})),r.d(t,"a",(function(){return u}));var a=r(9),n=r.n(a),o=r(4),c=r(19),s=r(11),i=r(12),l=r(120),m=r(13);const d=({indicator:e,primaryData:t,secondaryData:r,currency:a,formatAmount:n,persistedQuery:c})=>{const s=Object(o.find)(t.data,t=>t.stat===e.stat),d=Object(o.find)(r.data,t=>t.stat===e.stat);if(!s||!d)return{};const u=s._links&&s._links.report[0]&&s._links.report[0].href||"",p=function(e,t,r){return e?"/jetpack"===e?Object(m.e)("admin.php?page=jetpack#/dashboard"):Object(i.getNewPath)(t,e,{chart:r.chart}):""}(u,c,s),b="/jetpack"===u?"wp-admin":"wc-admin",f="currency"===s.format,y=Object(l.calculateDelta)(s.value,d.value);return{primaryValue:f?n(s.value):Object(l.formatValue)(a,s.format,s.value),secondaryValue:f?n(d.value):Object(l.formatValue)(a,d.format,d.value),delta:y,reportUrl:p,reportUrlType:b}},u=(e,t,r,a)=>{const{getReportItems:o,getReportItemsError:i,isResolving:l}=e(s.REPORTS_STORE_NAME),{woocommerce_default_date_range:m}=e(s.SETTINGS_STORE_NAME).getSetting("wc_admin","wcAdminSettings"),d=Object(c.getCurrentDates)(r,m),u=d.primary.before,p=d.secondary.before,b=t.map(e=>e.stat).join(","),f=Object(s.getFilterQuery)({filters:a,query:r}),y={...f,after:Object(c.appendTimestamp)(d.primary.after,"start"),before:Object(c.appendTimestamp)(u,u.isSame(n()(),"day")?"now":"end"),stats:b},g={...f,after:Object(c.appendTimestamp)(d.secondary.after,"start"),before:Object(c.appendTimestamp)(p,p.isSame(n()(),"day")?"now":"end"),stats:b};return{primaryData:o("performance-indicators",y),primaryError:i("performance-indicators",y)||null,primaryRequesting:l("getReportItems",["performance-indicators",y]),secondaryData:o("performance-indicators",g),secondaryError:i("performance-indicators",g)||null,secondaryRequesting:l("getReportItems",["performance-indicators",g]),defaultDateRange:m}}},603:function(e,t,r){},610:function(e,t,r){"use strict";r.r(t);var a=r(0),n=r(2),o=r(14),c=r(12),s=r(13),i=r(7),l=r(11),m=r(21),d=r(19),u=r(16),p=(r(603),r(501)),b=r(525);const{performanceIndicators:f}=Object(s.f)("dataEndpoints",{performanceIndicators:[]});class y extends a.Component{renderMenu(){const{hiddenBlocks:e,isFirst:t,isLast:r,onMove:o,onRemove:c,onTitleBlur:s,onTitleChange:i,onToggleHiddenBlock:l,titleInput:d,controls:p}=this.props;return Object(a.createElement)(m.EllipsisMenu,{label:Object(n.__)("Choose which analytics to display and the section name",'woocommerce'),renderContent:({onToggle:b})=>Object(a.createElement)(a.Fragment,null,Object(a.createElement)(m.MenuTitle,null,Object(n.__)("Display stats:",'woocommerce')),f.map((t,r)=>{const n=!e.includes(t.stat);return Object(a.createElement)(m.MenuItem,{checked:n,isCheckbox:!0,isClickable:!0,key:r,onInvoke:()=>{l(t.stat)(),Object(u.recordEvent)("dash_indicators_toggle",{status:n?"off":"on",key:t.stat})}},t.label)}),Object(a.createElement)(p,{onToggle:b,onMove:o,onRemove:c,isFirst:t,isLast:r,onTitleBlur:s,onTitleChange:i,titleInput:d}))})}renderList(){const{query:e,primaryRequesting:t,secondaryRequesting:r,primaryError:o,secondaryError:s,primaryData:i,secondaryData:l,userIndicators:p,defaultDateRange:f}=this.props;if(t||r)return Object(a.createElement)(m.SummaryListPlaceholder,{numberOfItems:p.length});if(o||s)return null;const y=Object(c.getPersistedQuery)(e),{compare:g}=Object(d.getDateParamsFromQuery)(e,f),O="previous_period"===g?Object(n.__)("Previous period:",'woocommerce'):Object(n.__)("Previous year:",'woocommerce'),{formatAmount:j,getCurrencyConfig:_}=this.context,h=_();return Object(a.createElement)(m.SummaryList,null,()=>p.map((e,t)=>{const{primaryValue:r,secondaryValue:n,delta:o,reportUrl:c,reportUrlType:s}=Object(b.b)({indicator:e,primaryData:i,secondaryData:l,currency:h,formatAmount:j,persistedQuery:y});return Object(a.createElement)(m.SummaryNumber,{key:t,href:c,hrefType:s,label:e.label,value:r,prevLabel:O,prevValue:n,delta:o,onLinkClickCallback:()=>{Object(u.recordEvent)("dash_indicators_click",{key:e.stat})}})}))}render(){const{userIndicators:e,title:t}=this.props;return Object(a.createElement)(a.Fragment,null,Object(a.createElement)(m.SectionHeader,{title:t||Object(n.__)("Store Performance",'woocommerce'),menu:this.renderMenu()}),e.length>0&&Object(a.createElement)("div",{className:"woocommerce-dashboard__store-performance"},this.renderList()))}}y.contextType=p.a,t.default=Object(o.compose)(Object(i.withSelect)((e,t)=>{const{hiddenBlocks:r,query:a,filters:n}=t,o=f.filter(e=>!r.includes(e.stat)),{woocommerce_default_date_range:c}=e(l.SETTINGS_STORE_NAME).getSetting("wc_admin","wcAdminSettings"),s={hiddenBlocks:r,userIndicators:o,indicators:f,defaultDateRange:c};if(0===o.length)return s;const i=Object(b.a)(e,o,a,n);return{...s,...i}}))(y)}}]);woocommerce-admin/dist/chunks/analytics-settings.js000064400000041741151335517650016614 0ustar00(window.__wcAdmin_webpackJsonp=window.__wcAdmin_webpackJsonp||[]).push([[17],{38:function(e,t){e.exports=function(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e},e.exports.default=e.exports,e.exports.__esModule=!0},546:function(e,t,a){},547:function(e,t,a){},548:function(e,t,a){},614:function(e,t,a){"use strict";a.r(t);var o=a(35),r=a.n(o),s=a(0),c=a(2),i=a(3),n=a(14),m=a(7),l=a(21),d=a(11),p=a(16),u=(a(546),a(255)),b=a(38),h=a.n(b),_=a(1),g=a.n(_),O=a(4);a(547);class j extends s.Component{constructor(e){super(e),h()(this,"renderInput",()=>{const{handleChange:e,name:t,inputText:a,inputType:o,options:c,value:n,component:m}=this.props,{disabled:l}=this.state;switch(o){case"checkboxGroup":return c.map(e=>e.options.length>0&&Object(s.createElement)("div",{className:"woocommerce-setting__options-group",key:e.key,"aria-labelledby":t+"-label"},e.label&&Object(s.createElement)("span",{className:"woocommerce-setting__options-group-label"},e.label),this.renderCheckboxOptions(e.options)));case"checkbox":return this.renderCheckboxOptions(c);case"button":return Object(s.createElement)(i.Button,{isSecondary:!0,onClick:this.handleInputCallback,disabled:l},a);case"component":const o=m;return Object(s.createElement)(o,r()({value:n,onChange:e},this.props));case"text":default:const d=Object(O.uniqueId)(t);return Object(s.createElement)("input",{id:d,type:"text",name:t,onChange:e,value:n,placeholder:a,disabled:l})}}),h()(this,"handleInputCallback",()=>{const{createNotice:e,callback:t}=this.props;if("function"==typeof t)return new Promise((a,o)=>{this.setState({disabled:!0}),t(a,o,e)}).then(()=>{this.setState({disabled:!1})}).catch(()=>{this.setState({disabled:!1})})}),this.state={disabled:!1}}renderCheckboxOptions(e){const{handleChange:t,name:a,value:o}=this.props,{disabled:r}=this.state;return e.map(e=>Object(s.createElement)(i.CheckboxControl,{key:a+"-"+e.value,label:e.label,name:a,checked:o&&o.includes(e.value),onChange:o=>t({target:{checked:o,name:a,type:"checkbox",value:e.value}}),disabled:r}))}render(){const{helpText:e,label:t,name:a}=this.props;return Object(s.createElement)("div",{className:"woocommerce-setting"},Object(s.createElement)("div",{className:"woocommerce-setting__label",id:a+"-label"},t),Object(s.createElement)("div",{className:"woocommerce-setting__input"},this.renderInput(),e&&Object(s.createElement)("span",{className:"woocommerce-setting__help"},e)))}}j.propTypes={callback:g.a.func,handleChange:g.a.func.isRequired,helpText:g.a.oneOfType([g.a.string,g.a.array]),inputText:g.a.string,inputType:g.a.oneOf(["button","checkbox","checkboxGroup","text","component"]),label:g.a.string.isRequired,name:g.a.string.isRequired,options:g.a.arrayOf(g.a.shape({value:g.a.string,label:g.a.string,description:g.a.string,key:g.a.string,options:g.a.array})),value:g.a.oneOfType([g.a.string,g.a.array])};var w=Object(n.compose)(Object(m.withDispatch)(e=>{const{createNotice:t}=e("core/notices");return{createNotice:t}}))(j),v=a(9),I=a.n(v);const S=(e,t,a)=>{const o={};if(a&&(o.skip_existing=!0),"all"!==t.label)if("custom"===t.label){const a=I()().diff(I()(t.date,e),"days",!0);o.days=Math.floor(a)}else o.days=parseInt(t.label,10);return o};var E=a(15);var k=Object(n.compose)([Object(m.withSelect)(e=>{const{getFormSettings:t}=e(d.IMPORT_STORE_NAME),{period:a,skipPrevious:o}=t();return{selectedPeriod:a,skipChecked:o}}),Object(m.withDispatch)(e=>{const{updateImportation:t,setImportStarted:a}=e(d.IMPORT_STORE_NAME),{createNotice:o}=e("core/notices");return{createNotice:o,setImportStarted:a,updateImportation:t}})])((function({clearStatusAndTotalsCache:e,createNotice:t,dateFormat:a,importDate:o,onImportStarted:r,selectedPeriod:n,stopImport:m,skipChecked:l,status:d,setImportStarted:u,updateImportation:b}){const h=()=>{const e=Object(E.addQueryArgs)("/wc-analytics/reports/import",S(a,n,l)),t=Object(c.__)("There was a problem rebuilding your report data.",'woocommerce');g(e,t,!0),r()},_=()=>{m();const e=Object(c.__)("There was a problem stopping your current import.",'woocommerce');g("/wc-analytics/reports/import/cancel",e)},g=(e,a,o=!1)=>{b(e,o).then(e=>{"success"===e.status?t("success",e.message):(t("error",a),u(!1),m())}).catch(e=>{e&&e.message&&(t("error",e.message),u(!1),m())})},O=()=>{const e=Object(c.__)("There was a problem deleting your previous data.",'woocommerce');g("/wc-analytics/reports/import/delete",e),Object(p.recordEvent)("analytics_import_delete_previous"),u(!1)},j=()=>{u(!1),e()};return Object(s.createElement)("div",{className:"woocommerce-settings__actions woocommerce-settings-historical-data__actions"},(()=>{const e="ready"!==d;return["initializing","customers","orders","finalizing"].includes(d)?Object(s.createElement)(s.Fragment,null,Object(s.createElement)(i.Button,{className:"woocommerce-settings-historical-data__action-button",isPrimary:!0,onClick:_},Object(c.__)("Stop Import",'woocommerce')),Object(s.createElement)("div",{className:"woocommerce-setting__help woocommerce-settings-historical-data__action-help"},Object(c.__)("Imported data will not be lost if the import is stopped.",'woocommerce'),Object(s.createElement)("br",null),Object(c.__)("Navigating away from this page will not affect the import.",'woocommerce'))):["ready","nothing"].includes(d)?o?Object(s.createElement)(s.Fragment,null,Object(s.createElement)(i.Button,{isPrimary:!0,onClick:h,disabled:e},Object(c.__)("Start",'woocommerce')),Object(s.createElement)(i.Button,{isSecondary:!0,onClick:O},Object(c.__)("Delete Previously Imported Data",'woocommerce'))):Object(s.createElement)(s.Fragment,null,Object(s.createElement)(i.Button,{isPrimary:!0,onClick:h,disabled:e},Object(c.__)("Start",'woocommerce'))):("error"===d&&t("error",Object(c.__)("Something went wrong with the importation process.",'woocommerce')),Object(s.createElement)(s.Fragment,null,Object(s.createElement)(i.Button,{isSecondary:!0,onClick:j},Object(c.__)("Re-import Data",'woocommerce')),Object(s.createElement)(i.Button,{isSecondary:!0,onClick:O},Object(c.__)("Delete Previously Imported Data",'woocommerce'))))})())})),y=a(19);var f=Object(m.withDispatch)(e=>{const{setImportPeriod:t}=e(d.IMPORT_STORE_NAME);return{setImportPeriod:t}})((function({dateFormat:e,disabled:t,setImportPeriod:a,value:o}){const r=t=>{t.date&&t.date.isValid?a(t.date.format(e),!0):a(t.text,!0)},n=t=>t.isValid()&&o.date.length===e.length?t.isAfter(new Date,"day")?y.dateValidationMessages.future:null:y.dateValidationMessages.invalid;return Object(s.createElement)("div",{className:"woocommerce-settings-historical-data__columns"},Object(s.createElement)("div",{className:"woocommerce-settings-historical-data__column"},Object(s.createElement)(i.SelectControl,{label:Object(c.__)("Import historical data",'woocommerce'),value:o.label,disabled:t,onChange:e=>{a(e)},options:[{label:"All",value:"all"},{label:"Last 365 days",value:"365"},{label:"Last 90 days",value:"90"},{label:"Last 30 days",value:"30"},{label:"Last 7 days",value:"7"},{label:"Last 24 hours",value:"1"},{label:"Custom",value:"custom"}]})),"custom"===o.label&&(()=>{const a=I()(o.date,e);return Object(s.createElement)("div",{className:"woocommerce-settings-historical-data__column"},Object(s.createElement)("div",{className:"woocommerce-settings-historical-data__column-label"},Object(c.__)("Beginning on",'woocommerce')),Object(s.createElement)(l.DatePicker,{date:a.isValid()?a.toDate():null,dateFormat:e,disabled:t,error:n(a),isInvalidDate:e=>I()(e).isAfter(new Date,"day"),onUpdate:r,text:o.date}))})())}));var C=function({label:e,progress:t,total:a}){const o=Object(c.sprintf)(Object(c.__)("Imported %(label)s",'woocommerce'),{label:e}),r=Object(O.isNil)(a)?null:Object(c.sprintf)(Object(c.__)("%(progress)s of %(total)s",'woocommerce'),{progress:t||0,total:a});return Object(s.createElement)("div",{className:"woocommerce-settings-historical-data__progress"},Object(s.createElement)("span",{className:"woocommerce-settings-historical-data__progress-label"},o),r&&Object(s.createElement)("span",{className:"woocommerce-settings-historical-data__progress-label"},r),Object(s.createElement)("progress",{className:"woocommerce-settings-historical-data__progress-bar",max:a,value:t||0}))},N=a(30);var T=function({importDate:e,status:t}){const a=Object(N.applyFilters)("woocommerce_admin_import_status",{nothing:Object(c.__)("Nothing To Import",'woocommerce'),ready:Object(c.__)("Ready To Import",'woocommerce'),initializing:[Object(c.__)("Initializing",'woocommerce'),Object(s.createElement)(i.Spinner,{key:"spinner"})],customers:[Object(c.__)("Importing Customers",'woocommerce'),Object(s.createElement)(i.Spinner,{key:"spinner"})],orders:[Object(c.__)("Importing Orders",'woocommerce'),Object(s.createElement)(i.Spinner,{key:"spinner"})],finalizing:[Object(c.__)("Finalizing",'woocommerce'),Object(s.createElement)(i.Spinner,{key:"spinner"})],finished:-1===e?Object(c.__)("All historical data imported",'woocommerce'):Object(c.sprintf)(Object(c.__)("Historical data from %s onward imported",'woocommerce'),I()(e).format("YYYY-MM-DD"))});return Object(s.createElement)("span",{className:"woocommerce-settings-historical-data__status"},Object(c.__)("Status:",'woocommerce')+" ",a[t])};var P=Object(m.withDispatch)(e=>{const{setSkipPrevious:t}=e(d.IMPORT_STORE_NAME);return{setSkipPrevious:t}})((function({checked:e,disabled:t,setSkipPrevious:a}){return Object(s.createElement)(i.CheckboxControl,{className:"woocommerce-settings-historical-data__skip-checkbox",checked:e,disabled:t,label:Object(c.__)("Skip previously imported customers and orders",'woocommerce'),onChange:e=>{a(e)}})}));a(548);class A extends s.Component{render(){const{customersProgress:e,customersTotal:t,dateFormat:a,importDate:o,inProgress:r,lastImportStartTimestamp:i,clearStatusAndTotalsCache:n,ordersProgress:m,ordersTotal:d,onImportStarted:p,period:u,stopImport:b,skipChecked:h,status:_}=this.props;return Object(s.createElement)(s.Fragment,null,Object(s.createElement)(l.SectionHeader,{title:Object(c.__)("Import historical data",'woocommerce')}),Object(s.createElement)("div",{className:"woocommerce-settings__wrapper"},Object(s.createElement)("div",{className:"woocommerce-setting"},Object(s.createElement)("div",{className:"woocommerce-setting__input"},Object(s.createElement)("span",{className:"woocommerce-setting__help"},Object(c.__)("This tool populates historical analytics data by processing customers and orders created prior to activating WooCommerce Admin.",'woocommerce')),"finished"!==_&&Object(s.createElement)(s.Fragment,null,Object(s.createElement)(f,{dateFormat:a,disabled:r,value:u}),Object(s.createElement)(P,{disabled:r,checked:h}),Object(s.createElement)(C,{label:Object(c.__)("Registered Customers",'woocommerce'),progress:e,total:t}),Object(s.createElement)(C,{label:Object(c.__)("Orders and Refunds",'woocommerce'),progress:m,total:d})),Object(s.createElement)(T,{importDate:o,status:_})))),Object(s.createElement)(k,{clearStatusAndTotalsCache:n,dateFormat:a,importDate:o,lastImportStartTimestamp:i,onImportStarted:p,stopImport:b,status:_}))}}var x=Object(m.withSelect)((e,t)=>{const{getImportError:a,getImportStatus:o,getImportTotals:r}=e(d.IMPORT_STORE_NAME),{activeImport:s,cacheNeedsClearing:c,dateFormat:i,inProgress:n,onImportStarted:m,onImportFinished:l,period:p,startStatusCheckInterval:u,skipChecked:b}=t,h=S(i,p,b),{customers:_,orders:g,lastImportStartTimestamp:j}=r(h),{customers:w,imported_from:v,is_importing:I,orders:E}=o(j),{imported:k,total:y}=w||{},{imported:f,total:C}=E||{},N=Boolean(a(j)||a(h));Boolean(!j&&!n&&!0===I)&&m();const T=Boolean(n&&!c&&!1===I&&(y>0||C>0)&&k===y&&f===C);let P={customersTotal:_,isError:N,ordersTotal:g};s&&(P={cacheNeedsClearing:c,customersProgress:k,customersTotal:Object(O.isNil)(y)?_:y,inProgress:n,isError:N,ordersProgress:f,ordersTotal:Object(O.isNil)(C)?g:C});const A=(({cacheNeedsClearing:e,customersProgress:t,customersTotal:a,isError:o,inProgress:r,ordersProgress:s,ordersTotal:c})=>o?"error":r?Object(O.isNil)(t)||Object(O.isNil)(s)||Object(O.isNil)(a)||Object(O.isNil)(c)||e?"initializing":t<a?"customers":s<c?"orders":"finalizing":a>0||c>0?t===a&&s===c?"finished":"ready":"nothing")(P);return"initializing"===A&&u(),T&&l(),{...P,importDate:v,status:A}})(A);class D extends s.Component{constructor(){super(...arguments),this.dateFormat=Object(c.__)("MM/DD/YYYY",'woocommerce'),this.intervalId=-1,this.lastImportStopTimestamp=0,this.cacheNeedsClearing=!0,this.onImportFinished=this.onImportFinished.bind(this),this.onImportStarted=this.onImportStarted.bind(this),this.clearStatusAndTotalsCache=this.clearStatusAndTotalsCache.bind(this),this.stopImport=this.stopImport.bind(this),this.startStatusCheckInterval=this.startStatusCheckInterval.bind(this),this.cancelStatusCheckInterval=this.cancelStatusCheckInterval.bind(this)}startStatusCheckInterval(){this.intervalId<0&&(this.cacheNeedsClearing=!0,this.intervalId=setInterval(()=>{this.clearCache("getImportStatus")},3*d.SECOND))}cancelStatusCheckInterval(){clearInterval(this.intervalId),this.intervalId=-1}clearCache(e,t){const{invalidateResolution:a,lastImportStartTimestamp:o}=this.props;a(e,["getImportStatus"===e?o:t]).then(()=>{this.cacheNeedsClearing=!1})}stopImport(){this.cancelStatusCheckInterval(),this.lastImportStopTimestamp=Date.now()}onImportFinished(){const{debouncedSpeak:e}=this.props;this.cacheNeedsClearing||(e("Import complete"),this.stopImport())}onImportStarted(){const{notes:e,setImportStarted:t,updateNote:a}=this.props,o=e.find(e=>"wc-admin-historical-data"===e.name);o&&a(o.id,{status:"actioned"}),t(!0)}clearStatusAndTotalsCache(){const{selectedPeriod:e,skipChecked:t}=this.props,a=S(this.dateFormat,e,t);this.clearCache("getImportTotals",a),this.clearCache("getImportStatus")}isImportationInProgress(){const{lastImportStartTimestamp:e}=this.props;return void 0!==e&&void 0===this.lastImportStopTimestamp||e>this.lastImportStopTimestamp}render(){const{activeImport:e,createNotice:t,lastImportStartTimestamp:a,selectedPeriod:o,skipChecked:r}=this.props;return Object(s.createElement)(x,{activeImport:e,cacheNeedsClearing:this.cacheNeedsClearing,createNotice:t,dateFormat:this.dateFormat,inProgress:this.isImportationInProgress(),onImportFinished:this.onImportFinished,onImportStarted:this.onImportStarted,lastImportStartTimestamp:a,clearStatusAndTotalsCache:this.clearStatusAndTotalsCache,period:o,skipChecked:r,startStatusCheckInterval:this.startStatusCheckInterval,stopImport:this.stopImport})}}var R=Object(n.compose)([Object(m.withSelect)(e=>{const{getNotes:t}=e(d.NOTES_STORE_NAME),{getImportStarted:a,getFormSettings:o}=e(d.IMPORT_STORE_NAME),r=t({page:1,per_page:d.QUERY_DEFAULTS.pageSize,type:"update",status:"unactioned"}),{activeImport:s,lastImportStartTimestamp:c}=a(),{period:i,skipPrevious:n}=o();return{activeImport:s,lastImportStartTimestamp:c,notes:r,selectedPeriod:i,skipChecked:n}}),Object(m.withDispatch)(e=>{const{updateNote:t}=e(d.NOTES_STORE_NAME),{invalidateResolution:a,setImportStarted:o}=e(d.IMPORT_STORE_NAME);return{invalidateResolution:a,setImportStarted:o,updateNote:t}}),i.withSpokenMessages])(D);t.default=Object(n.compose)(Object(m.withDispatch)(e=>{const{createNotice:t}=e("core/notices");return{createNotice:t}}))(({createNotice:e,query:t})=>{const{settingsError:a,isRequesting:o,isDirty:n,persistSettings:m,updateAndPersistSettings:b,updateSettings:h,wcAdminSettings:_}=Object(d.useSettings)("wc_admin",["wcAdminSettings"]),g=Object(s.useRef)(!1);Object(s.useEffect)(()=>{function e(e){if(n)return e.returnValue=Object(c.__)("You have unsaved changes. If you proceed, they will be lost.",'woocommerce'),e.returnValue}return window.addEventListener("beforeunload",e),()=>window.removeEventListener("beforeunload",e)},[n]),Object(s.useEffect)(()=>{o?g.current=!0:!o&&g.current&&(a?e("error",Object(c.__)("There was an error saving your settings. Please try again.",'woocommerce')):e("success",Object(c.__)("Your settings have been successfully saved.",'woocommerce')),g.current=!1)},[o,a,e]);const O=e=>{const{checked:t,name:a,type:o,value:r}=e.target,s={..._};s[a]="checkbox"===o?t?[...s[a],r]:s[a].filter(e=>e!==r):r,h("wcAdminSettings",s)};return Object(s.createElement)(s.Fragment,null,Object(s.createElement)(l.SectionHeader,{title:Object(c.__)("Analytics settings",'woocommerce')}),Object(s.createElement)("div",{className:"woocommerce-settings__wrapper"},Object.keys(u.b).map(e=>Object(s.createElement)(w,r()({handleChange:O,value:_[e],key:e,name:e},u.b[e]))),Object(s.createElement)("div",{className:"woocommerce-settings__actions"},Object(s.createElement)(i.Button,{isSecondary:!0,onClick:()=>{if(window.confirm(Object(c.__)("Are you sure you want to reset all settings to default values?",'woocommerce'))){const e=Object.keys(u.b).reduce((e,t)=>(e[t]=u.b[t].defaultValue,e),{});b("wcAdminSettings",e),Object(p.recordEvent)("analytics_settings_reset_defaults")}}},Object(c.__)("Reset defaults",'woocommerce')),Object(s.createElement)(i.Button,{isPrimary:!0,isBusy:o,onClick:()=>{m(),Object(p.recordEvent)("analytics_settings_save",_),t.period=void 0,t.compare=void 0,t.before=void 0,t.after=void 0,t.interval=void 0,t.type=void 0,window.wpNavMenuUrlUpdate(t)}},Object(c.__)("Save settings",'woocommerce')))),"true"===t.import?Object(s.createElement)(l.ScrollTo,{offset:"-56"},Object(s.createElement)(R,{createNotice:e})):Object(s.createElement)(R,{createNotice:e}))})}}]);woocommerce-admin/dist/chunks/analytics-report-categories.js000064400000034103151335517650020404 0ustar00(window.__wcAdmin_webpackJsonp=window.__wcAdmin_webpackJsonp||[]).push([[7],{479:function(e,t,r){"use strict";r.r(t);var o=r(0),c=r(1),a=r.n(c),s=r(2),n=r(30),i=r(7),m=r(502),l=r(55);const{addCesSurveyForAnalytics:d}=Object(i.dispatch)(l.c),u=Object(n.applyFilters)("woocommerce_admin_categories_report_charts",[{key:"items_sold",label:Object(s.__)("Items sold",'woocommerce'),order:"desc",orderby:"items_sold",type:"number"},{key:"net_revenue",label:Object(s.__)("Net sales",'woocommerce'),order:"desc",orderby:"net_revenue",type:"currency"},{key:"orders_count",label:Object(s.__)("Orders",'woocommerce'),order:"desc",orderby:"orders_count",type:"number"}]),b=Object(n.applyFilters)("woocommerce_admin_category_report_advanced_filters",{filters:{},title:Object(s._x)("Categories match {{select /}} filters","A sentence describing filters for Categories. See screen shot for context: https://cloudup.com/cSsUY9VeCVJ",'woocommerce')}),g=[{label:Object(s.__)("All categories",'woocommerce'),value:"all"},{label:Object(s.__)("Single category",'woocommerce'),value:"select_category",chartMode:"item-comparison",subFilters:[{component:"Search",value:"single_category",chartMode:"item-comparison",path:["select_category"],settings:{type:"categories",param:"categories",getLabels:m.a,labels:{placeholder:Object(s.__)("Type to search for a category",'woocommerce'),button:Object(s.__)("Single Category",'woocommerce')}}}]},{label:Object(s.__)("Comparison",'woocommerce'),value:"compare-categories",chartMode:"item-comparison",settings:{type:"categories",param:"categories",getLabels:m.a,labels:{helpText:Object(s.__)("Check at least two categories below to compare",'woocommerce'),placeholder:Object(s.__)("Search for categories to compare",'woocommerce'),title:Object(s.__)("Compare Categories",'woocommerce'),update:Object(s.__)("Compare",'woocommerce')},onClick:d}}];Object.keys(b.filters).length&&g.push({label:Object(s.__)("Advanced filters",'woocommerce'),value:"advanced"});const _=Object(n.applyFilters)("woocommerce_admin_categories_report_filters",[{label:Object(s.__)("Show",'woocommerce'),staticParams:["chartType","paged","per_page"],param:"filter",showFilters:()=>!0,filters:g}]);var p=r(14),y=r(4),O=r(12),j=r(21),h=r(120),f=r(11),w=r(518),v=r(506),C=r(501);class S extends o.Component{constructor(e){super(e),this.getRowsContent=this.getRowsContent.bind(this),this.getSummary=this.getSummary.bind(this)}getHeadersContent(){return[{label:Object(s.__)("Category",'woocommerce'),key:"category",required:!0,isSortable:!0,isLeftAligned:!0},{label:Object(s.__)("Items sold",'woocommerce'),key:"items_sold",required:!0,defaultSort:!0,isSortable:!0,isNumeric:!0},{label:Object(s.__)("Net sales",'woocommerce'),key:"net_revenue",isSortable:!0,isNumeric:!0},{label:Object(s.__)("Products",'woocommerce'),key:"products_count",isSortable:!0,isNumeric:!0},{label:Object(s.__)("Orders",'woocommerce'),key:"orders_count",isSortable:!0,isNumeric:!0}]}getRowsContent(e){const{render:t,formatDecimal:r,getCurrencyConfig:c}=this.context,{categories:a,query:s}=this.props;if(!a)return[];const n=c();return Object(y.map)(e,e=>{const{category_id:c,items_sold:i,net_revenue:m,products_count:l,orders_count:d}=e,u=a.get(c),b=Object(O.getPersistedQuery)(s);return[{display:Object(o.createElement)(w.a,{query:s,category:u,categories:a}),value:u&&u.name},{display:Object(h.formatValue)(n,"number",i),value:i},{display:t(m),value:r(m)},{display:u&&Object(o.createElement)(j.Link,{href:Object(O.getNewPath)(b,"/analytics/categories",{filter:"single_category",categories:u.id}),type:"wc-admin"},Object(h.formatValue)(n,"number",l)),value:l},{display:Object(h.formatValue)(n,"number",d),value:d}]})}getSummary(e,t=0){const{items_sold:r=0,net_revenue:o=0,orders_count:c=0}=e,{formatAmount:a,getCurrencyConfig:n}=this.context,i=n();return[{label:Object(s._n)("Category","Categories",t,'woocommerce'),value:Object(h.formatValue)(i,"number",t)},{label:Object(s._n)("Item sold","Items sold",r,'woocommerce'),value:Object(h.formatValue)(i,"number",r)},{label:Object(s.__)("Net sales",'woocommerce'),value:a(o)},{label:Object(s._n)("Order","Orders",c,'woocommerce'),value:Object(h.formatValue)(i,"number",c)}]}render(){const{advancedFilters:e,filters:t,isRequesting:r,query:c}=this.props,a={helpText:Object(s.__)("Check at least two categories below to compare",'woocommerce'),placeholder:Object(s.__)("Search by category name",'woocommerce')};return Object(o.createElement)(v.a,{compareBy:"categories",endpoint:"categories",getHeadersContent:this.getHeadersContent,getRowsContent:this.getRowsContent,getSummary:this.getSummary,summaryFields:["items_sold","net_revenue","orders_count"],isRequesting:r,itemIdField:"category_id",query:c,searchBy:"categories",labels:a,tableQuery:{orderby:c.orderby||"items_sold",order:c.order||"desc",extended_info:!0},title:Object(s.__)("Categories",'woocommerce'),columnPrefsKey:"categories_report_columns",filters:t,advancedFilters:e})}}S.contextType=C.a;var k=Object(p.compose)(Object(i.withSelect)((e,t)=>{const{isRequesting:r,query:o}=t;if(r||o.search&&(!o.categories||!o.categories.length))return{};const{getItems:c,getItemsError:a,isResolving:s}=e(f.ITEMS_STORE_NAME),n={per_page:-1};return{categories:c("categories",n),isError:Boolean(a("categories",n)),isRequesting:s("getItems",["categories",n])}}))(S),E=r(510),q=r(508),A=r(511),N=r(530),R=r(505);class P extends o.Component{getChartMeta(){const{query:e}=this.props,t="compare-categories"===e.filter&&e.categories&&e.categories.split(",").length>1,r="single_category"===e.filter&&!!e.categories,o=t||r?"item-comparison":"time-comparison";return{isSingleCategoryView:r,itemsLabel:r?Object(s.__)("%d products",'woocommerce'):Object(s.__)("%d categories",'woocommerce'),mode:o}}render(){const{isRequesting:e,query:t,path:r}=this.props,{mode:c,itemsLabel:a,isSingleCategoryView:s}=this.getChartMeta(),n={...t};return"item-comparison"===c&&(n.segmentby=s?"product":"category"),Object(o.createElement)(o.Fragment,null,Object(o.createElement)(R.a,{query:t,path:r,filters:_,advancedFilters:b,report:"categories"}),Object(o.createElement)(A.a,{charts:u,endpoint:"products",isRequesting:e,limitProperties:s?["products","categories"]:["categories"],query:n,selectedChart:Object(E.a)(t.chart,u),filters:_,advancedFilters:b,report:"categories"}),Object(o.createElement)(q.a,{charts:u,filters:_,advancedFilters:b,mode:c,endpoint:"products",limitProperties:s?["products","categories"]:["categories"],path:r,query:n,isRequesting:e,itemsLabel:a,selectedChart:Object(E.a)(t.chart,u)}),s?Object(o.createElement)(N.a,{isRequesting:e,query:n,baseSearchQuery:{filter:"single_category"},hideCompare:s,filters:_,advancedFilters:b}):Object(o.createElement)(k,{isRequesting:e,query:t,filters:_,advancedFilters:b}))}}P.propTypes={query:a.a.object.isRequired,path:a.a.string.isRequired};t.default=P},502:function(e,t,r){"use strict";r.d(t,"e",(function(){return d})),r.d(t,"a",(function(){return u})),r.d(t,"b",(function(){return b})),r.d(t,"c",(function(){return g})),r.d(t,"d",(function(){return _})),r.d(t,"f",(function(){return p})),r.d(t,"h",(function(){return y})),r.d(t,"g",(function(){return O}));var o=r(15),c=r(17),a=r.n(c),s=r(4),n=r(12),i=r(11),m=r(13),l=r(503);function d(e,t=s.identity){return function(r="",c){const s="function"==typeof e?e(c):e,i=Object(n.getIdsFromQuery)(r);if(i.length<1)return Promise.resolve([]);const m={include:i.join(","),per_page:i.length};return a()({path:Object(o.addQueryArgs)(s,m)}).then(e=>e.map(t))}}d(i.NAMESPACE+"/products/attributes",e=>({key:e.id,label:e.name}));const u=d(i.NAMESPACE+"/products/categories",e=>({key:e.id,label:e.name})),b=d(i.NAMESPACE+"/coupons",e=>({key:e.id,label:e.code})),g=d(i.NAMESPACE+"/customers",e=>({key:e.id,label:e.name})),_=d(i.NAMESPACE+"/products",e=>({key:e.id,label:e.name})),p=d(i.NAMESPACE+"/taxes",e=>({key:e.id,label:Object(l.a)(e)}));function y({attributes:e,name:t}){const r=Object(m.f)("variationTitleAttributesSeparator"," - ");if(t&&t.indexOf(r)>-1)return t;const o=(e||[]).map(({option:e})=>e).join(", ");return o?t+r+o:t}const O=d(({products:e})=>e?i.NAMESPACE+`/products/${e}/variations`:i.NAMESPACE+"/variations",e=>({key:e.id,label:y(e)}))},503:function(e,t,r){"use strict";r.d(t,"a",(function(){return c}));var o=r(2);function c(e){return[e.country,e.state,e.name||Object(o.__)("TAX",'woocommerce'),e.priority].map(e=>e.toString().toUpperCase().trim()).filter(Boolean).join("-")}},513:function(e,t,r){"use strict";function o(e,t,r){return!!t&&(e&&t<=r==="instock")}r.d(t,"a",(function(){return o}))},518:function(e,t,r){"use strict";r.d(t,"a",(function(){return i}));var o=r(0),c=r(4),a=r(3),s=r(21),n=r(12);class i extends o.Component{getCategoryAncestorIds(e,t){const r=[];let o=e.parent;for(;o;)r.unshift(o),o=t.get(o).parent;return r}getCategoryAncestors(e,t){const r=this.getCategoryAncestorIds(e,t);if(r.length)return 1===r.length?t.get(Object(c.first)(r)).name+" › ":2===r.length?t.get(Object(c.first)(r)).name+" › "+t.get(Object(c.last)(r)).name+" › ":t.get(Object(c.first)(r)).name+" … "+t.get(Object(c.last)(r)).name+" › "}render(){const{categories:e,category:t,query:r}=this.props,c=Object(n.getPersistedQuery)(r);return t?Object(o.createElement)("div",{className:"woocommerce-table__breadcrumbs"},this.getCategoryAncestors(t,e),Object(o.createElement)(s.Link,{href:Object(n.getNewPath)(c,"/analytics/categories",{filter:"single_category",categories:t.id}),type:"wc-admin"},t.name)):Object(o.createElement)(a.Spinner,null)}}},530:function(e,t,r){"use strict";var o=r(0),c=r(2),a=r(14),s=r(28),n=r(7),i=r(4),m=r(12),l=r(21),d=r(120),u=r(13),b=r(11),g=r(518),_=r(513),p=r(506),y=r(501);r(531);const O=Object(u.f)("manageStock","no"),j=Object(u.f)("stockStatuses",{});class h extends o.Component{constructor(){super(),this.getHeadersContent=this.getHeadersContent.bind(this),this.getRowsContent=this.getRowsContent.bind(this),this.getSummary=this.getSummary.bind(this)}getHeadersContent(){return[{label:Object(c.__)("Product title",'woocommerce'),key:"product_name",required:!0,isLeftAligned:!0,isSortable:!0},{label:Object(c.__)("SKU",'woocommerce'),key:"sku",hiddenByDefault:!0,isSortable:!0},{label:Object(c.__)("Items sold",'woocommerce'),key:"items_sold",required:!0,defaultSort:!0,isSortable:!0,isNumeric:!0},{label:Object(c.__)("Net sales",'woocommerce'),screenReaderLabel:Object(c.__)("Net sales",'woocommerce'),key:"net_revenue",required:!0,isSortable:!0,isNumeric:!0},{label:Object(c.__)("Orders",'woocommerce'),key:"orders_count",isSortable:!0,isNumeric:!0},{label:Object(c.__)("Category",'woocommerce'),key:"product_cat"},{label:Object(c.__)("Variations",'woocommerce'),key:"variations",isSortable:!0},"yes"===O?{label:Object(c.__)("Status",'woocommerce'),key:"stock_status"}:null,"yes"===O?{label:Object(c.__)("Stock",'woocommerce'),key:"stock",isNumeric:!0}:null].filter(Boolean)}getRowsContent(e=[]){const{query:t}=this.props,r=Object(m.getPersistedQuery)(t),{render:a,formatDecimal:n,getCurrencyConfig:b}=this.context,p=b();return Object(i.map)(e,e=>{const{product_id:i,items_sold:b,net_revenue:y,orders_count:h}=e,f=e.extended_info||{},{category_ids:w,low_stock_amount:v,manage_stock:C,sku:S,stock_status:k,stock_quantity:E,variations:q=[]}=f,A=Object(s.decodeEntities)(f.name),N=Object(m.getNewPath)(r,"/analytics/orders",{filter:"advanced",product_includes:i}),R=Object(m.getNewPath)(r,"/analytics/products",{filter:"single_product",products:i}),{categories:P}=this.props,x=w&&P&&w.map(e=>P.get(e)).filter(Boolean)||[],F=Object(_.a)(k,E,v)?Object(o.createElement)(l.Link,{href:Object(u.e)("post.php?action=edit&post="+i),type:"wp-admin"},Object(c._x)("Low","Indication of a low quantity",'woocommerce')):j[k];return[{display:Object(o.createElement)(l.Link,{href:R,type:"wc-admin"},A),value:A},{display:S,value:S},{display:Object(d.formatValue)(p,"number",b),value:b},{display:a(y),value:n(y)},{display:Object(o.createElement)(l.Link,{href:N,type:"wc-admin"},h),value:h},{display:Object(o.createElement)("div",{className:"woocommerce-table__product-categories"},x[0]&&Object(o.createElement)(g.a,{category:x[0],categories:P}),x.length>1&&Object(o.createElement)(l.Tag,{label:Object(c.sprintf)(Object(c._x)("+%d more","categories",'woocommerce'),x.length-1),popoverContents:x.map(e=>Object(o.createElement)(g.a,{category:e,categories:P,key:e.id,query:t}))})),value:x.map(e=>e.name).join(", ")},{display:Object(d.formatValue)(p,"number",q.length),value:q.length},"yes"===O?{display:C?F:Object(c.__)("N/A",'woocommerce'),value:C?j[k]:null}:null,"yes"===O?{display:C?Object(d.formatValue)(p,"number",E):Object(c.__)("N/A",'woocommerce'),value:E}:null].filter(Boolean)})}getSummary(e){const{products_count:t=0,items_sold:r=0,net_revenue:o=0,orders_count:a=0}=e,{formatAmount:s,getCurrencyConfig:n}=this.context,i=n();return[{label:Object(c._n)("Product","Products",t,'woocommerce'),value:Object(d.formatValue)(i,"number",t)},{label:Object(c._n)("Item sold","Items sold",r,'woocommerce'),value:Object(d.formatValue)(i,"number",r)},{label:Object(c.__)("Net sales",'woocommerce'),value:s(o)},{label:Object(c._n)("Orders","Orders",a,'woocommerce'),value:Object(d.formatValue)(i,"number",a)}]}render(){const{advancedFilters:e,baseSearchQuery:t,filters:r,hideCompare:a,isRequesting:s,query:n}=this.props,i={helpText:Object(c.__)("Check at least two products below to compare",'woocommerce'),placeholder:Object(c.__)("Search by product name or SKU",'woocommerce')};return Object(o.createElement)(p.a,{compareBy:a?void 0:"products",endpoint:"products",getHeadersContent:this.getHeadersContent,getRowsContent:this.getRowsContent,getSummary:this.getSummary,summaryFields:["products_count","items_sold","net_revenue","orders_count"],itemIdField:"product_id",isRequesting:s,labels:i,query:n,searchBy:"products",baseSearchQuery:t,tableQuery:{orderby:n.orderby||"items_sold",order:n.order||"desc",extended_info:!0,segmentby:n.segmentby},title:Object(c.__)("Products",'woocommerce'),columnPrefsKey:"products_report_columns",filters:r,advancedFilters:e})}}h.contextType=y.a,t.a=Object(a.compose)(Object(n.withSelect)((e,t)=>{const{query:r,isRequesting:o}=t,{getItems:c,getItemsError:a,isResolving:s}=e(b.ITEMS_STORE_NAME);if(o||r.search&&(!r.products||!r.products.length))return{};const n={per_page:-1};return{categories:c("categories",n),isError:Boolean(a("categories",n)),isRequesting:s("getItems",["categories",n])}}))(h)},531:function(e,t,r){}}]);woocommerce-admin/dist/chunks/32.style.css000064400000003741151335517650014524 0ustar00.woocommerce-leaderboard.woocommerce-empty-content{margin-bottom:24px}.woocommerce-leaderboard .woocommerce-card__body{padding:0}.woocommerce-leaderboard .woocommerce-table__table{margin-bottom:0}.woocommerce-leaderboard .woocommerce-table__table tr:last-child{border-bottom-style:none}:root{--wp-admin-theme-color:#007cba;--wp-admin-theme-color-darker-10:#006ba1;--wp-admin-theme-color-darker-20:#005a87}body.admin-color-light{--wp-admin-theme-color:#0085ba;--wp-admin-theme-color-darker-10:#0073a1;--wp-admin-theme-color-darker-20:#006187}body.admin-color-modern{--wp-admin-theme-color:#3858e9;--wp-admin-theme-color-darker-10:#2145e6;--wp-admin-theme-color-darker-20:#183ad6}body.admin-color-blue{--wp-admin-theme-color:#096484;--wp-admin-theme-color-darker-10:#07526c;--wp-admin-theme-color-darker-20:#064054}body.admin-color-coffee{--wp-admin-theme-color:#46403c;--wp-admin-theme-color-darker-10:#383330;--wp-admin-theme-color-darker-20:#2b2724}body.admin-color-ectoplasm{--wp-admin-theme-color:#523f6d;--wp-admin-theme-color-darker-10:#46365d;--wp-admin-theme-color-darker-20:#3a2c4d}body.admin-color-midnight{--wp-admin-theme-color:#e14d43;--wp-admin-theme-color-darker-10:#dd382d;--wp-admin-theme-color-darker-20:#d02c21}body.admin-color-ocean{--wp-admin-theme-color:#627c83;--wp-admin-theme-color-darker-10:#576e74;--wp-admin-theme-color-darker-20:#4c6066}body.admin-color-sunrise{--wp-admin-theme-color:#dd823b;--wp-admin-theme-color-darker-10:#d97426;--wp-admin-theme-color-darker-20:#c36922}.woocommerce-dashboard__dashboard-leaderboards .components-base-control__field{width:100%}.woocommerce-dashboard__dashboard-leaderboards .components-select-control__input{border:1px solid #ccc;height:34px}.woocommerce-dashboard__dashboard-leaderboards .woocommerce-dashboard__dashboard-leaderboards__select .components-base-control__field{padding:0 12px 4px}.woocommerce-dashboard__dashboard-leaderboards .woocommerce-dashboard__dashboard-leaderboards__select .woocommerce-ellipsis-menu__title{padding:10px 0 14px}woocommerce-admin/dist/chunks/analytics-report-customers.js000064400000056445151335517650020320 0ustar00(window.__wcAdmin_webpackJsonp=window.__wcAdmin_webpackJsonp||[]).push([[9],{480:function(e,t,r){"use strict";r.r(t),r.d(t,"default",(function(){return C}));var a=r(0),o=r(1),c=r.n(o),n=r(2),l=r(28),i=r(30),s=r(13),m=r(11),d=r(502);const{countries:u}=Object(s.f)("dataEndpoints",{countries:{}}),b=Object(i.applyFilters)("woocommerce_admin_customers_report_filters",[{label:Object(n.__)("Show",'woocommerce'),staticParams:["paged","per_page"],param:"filter",showFilters:()=>!0,filters:[{label:Object(n.__)("All Customers",'woocommerce'),value:"all"},{label:Object(n.__)("Single Customer",'woocommerce'),value:"select_customer",chartMode:"item-comparison",subFilters:[{component:"Search",value:"single_customer",chartMode:"item-comparison",path:["select_customer"],settings:{type:"customers",param:"customers",getLabels:d.c,labels:{placeholder:Object(n.__)("Type to search for a customer",'woocommerce'),button:Object(n.__)("Single Customer",'woocommerce')}}}]},{label:Object(n.__)("Advanced filters",'woocommerce'),value:"advanced"}]}]),_=Object(i.applyFilters)("woocommerce_admin_customers_report_advanced_filters",{title:Object(n._x)("Customers match {{select /}} filters","A sentence describing filters for Customers. See screen shot for context: https://cloudup.com/cCsm3GeXJbE",'woocommerce'),filters:{name:{labels:{add:Object(n.__)("Name",'woocommerce'),placeholder:Object(n.__)("Search",'woocommerce'),remove:Object(n.__)("Remove customer name filter",'woocommerce'),rule:Object(n.__)("Select a customer name filter match",'woocommerce'),title:Object(n.__)("{{title}}Name{{/title}} {{rule /}} {{filter /}}",'woocommerce'),filter:Object(n.__)("Select customer name",'woocommerce')},rules:[{value:"includes",label:Object(n._x)("Includes","customer names",'woocommerce')},{value:"excludes",label:Object(n._x)("Excludes","customer names",'woocommerce')}],input:{component:"Search",type:"customers",getLabels:Object(d.e)(m.NAMESPACE+"/customers",e=>({id:e.id,label:e.name}))}},country:{labels:{add:Object(n.__)("Country / Region",'woocommerce'),placeholder:Object(n.__)("Search",'woocommerce'),remove:Object(n.__)("Remove country / region filter",'woocommerce'),rule:Object(n.__)("Select a country / region filter match",'woocommerce'),title:Object(n.__)("{{title}}Country / Region{{/title}} {{rule /}} {{filter /}}",'woocommerce'),filter:Object(n.__)("Select country / region",'woocommerce')},rules:[{value:"includes",label:Object(n._x)("Includes","countries",'woocommerce')},{value:"excludes",label:Object(n._x)("Excludes","countries",'woocommerce')}],input:{component:"Search",type:"countries",getLabels:async e=>{const t=u.map(e=>({key:e.code,label:Object(l.decodeEntities)(e.name)})),r=e.split(",");return await t.filter(e=>r.includes(e.key))}}},username:{labels:{add:Object(n.__)("Username",'woocommerce'),placeholder:Object(n.__)("Search customer username",'woocommerce'),remove:Object(n.__)("Remove customer username filter",'woocommerce'),rule:Object(n.__)("Select a customer username filter match",'woocommerce'),title:Object(n.__)("{{title}}Username{{/title}} {{rule /}} {{filter /}}",'woocommerce'),filter:Object(n.__)("Select customer username",'woocommerce')},rules:[{value:"includes",label:Object(n._x)("Includes","customer usernames",'woocommerce')},{value:"excludes",label:Object(n._x)("Excludes","customer usernames",'woocommerce')}],input:{component:"Search",type:"usernames",getLabels:d.c}},email:{labels:{add:Object(n.__)("Email",'woocommerce'),placeholder:Object(n.__)("Search customer email",'woocommerce'),remove:Object(n.__)("Remove customer email filter",'woocommerce'),rule:Object(n.__)("Select a customer email filter match",'woocommerce'),title:Object(n.__)("{{title}}Email{{/title}} {{rule /}} {{filter /}}",'woocommerce'),filter:Object(n.__)("Select customer email",'woocommerce')},rules:[{value:"includes",label:Object(n._x)("Includes","customer emails",'woocommerce')},{value:"excludes",label:Object(n._x)("Excludes","customer emails",'woocommerce')}],input:{component:"Search",type:"emails",getLabels:Object(d.e)(m.NAMESPACE+"/customers",e=>({id:e.id,label:e.email}))}},orders_count:{labels:{add:Object(n.__)("No. of Orders",'woocommerce'),remove:Object(n.__)("Remove order filter",'woocommerce'),rule:Object(n.__)("Select an order count filter match",'woocommerce'),title:Object(n.__)("{{title}}No. of Orders{{/title}} {{rule /}} {{filter /}}",'woocommerce')},rules:[{value:"max",label:Object(n._x)("Less Than","number of orders",'woocommerce')},{value:"min",label:Object(n._x)("More Than","number of orders",'woocommerce')},{value:"between",label:Object(n._x)("Between","number of orders",'woocommerce')}],input:{component:"Number"}},total_spend:{labels:{add:Object(n.__)("Total Spend",'woocommerce'),remove:Object(n.__)("Remove total spend filter",'woocommerce'),rule:Object(n.__)("Select a total spend filter match",'woocommerce'),title:Object(n.__)("{{title}}Total Spend{{/title}} {{rule /}} {{filter /}}",'woocommerce')},rules:[{value:"max",label:Object(n._x)("Less Than","total spend by customer",'woocommerce')},{value:"min",label:Object(n._x)("More Than","total spend by customer",'woocommerce')},{value:"between",label:Object(n._x)("Between","total spend by customer",'woocommerce')}],input:{component:"Currency"}},avg_order_value:{labels:{add:Object(n.__)("AOV",'woocommerce'),remove:Object(n.__)("Remove average order value filter",'woocommerce'),rule:Object(n.__)("Select an average order value filter match",'woocommerce'),title:Object(n.__)("{{title}}AOV{{/title}} {{rule /}} {{filter /}}",'woocommerce')},rules:[{value:"max",label:Object(n._x)("Less Than","average order value of customer",'woocommerce')},{value:"min",label:Object(n._x)("More Than","average order value of customer",'woocommerce')},{value:"between",label:Object(n._x)("Between","average order value of customer",'woocommerce')}],input:{component:"Currency"}},registered:{labels:{add:Object(n.__)("Registered",'woocommerce'),remove:Object(n.__)("Remove registered filter",'woocommerce'),rule:Object(n.__)("Select a registered filter match",'woocommerce'),title:Object(n.__)("{{title}}Registered{{/title}} {{rule /}} {{filter /}}",'woocommerce'),filter:Object(n.__)("Select registered date",'woocommerce')},rules:[{value:"before",label:Object(n._x)("Before","date",'woocommerce')},{value:"after",label:Object(n._x)("After","date",'woocommerce')},{value:"between",label:Object(n._x)("Between","date",'woocommerce')}],input:{component:"Date"}},last_active:{labels:{add:Object(n.__)("Last active",'woocommerce'),remove:Object(n.__)("Remove last active filter",'woocommerce'),rule:Object(n.__)("Select a last active filter match",'woocommerce'),title:Object(n.__)("{{title}}Last active{{/title}} {{rule /}} {{filter /}}",'woocommerce'),filter:Object(n.__)("Select registered date",'woocommerce')},rules:[{value:"before",label:Object(n._x)("Before","date",'woocommerce')},{value:"after",label:Object(n._x)("After","date",'woocommerce')},{value:"between",label:Object(n._x)("Between","date",'woocommerce')}],input:{component:"Date"}}}});var p=r(3),O=r(21),j=r(120),y=r(19),g=r(506),f=r(501);const{countries:w}=Object(s.f)("dataEndpoints",{countries:{}});class h extends a.Component{constructor(){super(),this.getHeadersContent=this.getHeadersContent.bind(this),this.getRowsContent=this.getRowsContent.bind(this),this.getSummary=this.getSummary.bind(this)}getHeadersContent(){return[{label:Object(n.__)("Name",'woocommerce'),key:"name",required:!0,isLeftAligned:!0,isSortable:!0},{label:Object(n.__)("Username",'woocommerce'),key:"username",hiddenByDefault:!0},{label:Object(n.__)("Last active",'woocommerce'),key:"date_last_active",defaultSort:!0,isSortable:!0},{label:Object(n.__)("Date registered",'woocommerce'),key:"date_registered",isSortable:!0},{label:Object(n.__)("Email",'woocommerce'),key:"email"},{label:Object(n.__)("Orders",'woocommerce'),key:"orders_count",isSortable:!0,isNumeric:!0},{label:Object(n.__)("Total spend",'woocommerce'),key:"total_spend",isSortable:!0,isNumeric:!0},{label:Object(n.__)("AOV",'woocommerce'),screenReaderLabel:Object(n.__)("Average order value",'woocommerce'),key:"avg_order_value",isNumeric:!0},{label:Object(n.__)("Country / Region",'woocommerce'),key:"country",isSortable:!0},{label:Object(n.__)("City",'woocommerce'),key:"city",hiddenByDefault:!0,isSortable:!0},{label:Object(n.__)("Region",'woocommerce'),key:"state",hiddenByDefault:!0,isSortable:!0},{label:Object(n.__)("Postal code",'woocommerce'),key:"postcode",hiddenByDefault:!0,isSortable:!0}]}getCountryName(e){return void 0!==w[e]?w[e]:null}getRowsContent(e){const t=Object(s.f)("dateFormat",y.defaultTableDateFormat),{formatAmount:r,formatDecimal:o,getCurrencyConfig:c}=this.context;return null==e?void 0:e.map(e=>{const{avg_order_value:n,date_last_active:l,date_registered:i,email:m,name:d,user_id:u,orders_count:b,username:_,total_spend:y,postcode:g,city:f,state:w,country:h}=e,v=this.getCountryName(h),S=u?Object(a.createElement)(O.Link,{href:Object(s.e)("user-edit.php?user_id="+u),type:"wp-admin"},d):d,C=l?Object(a.createElement)(O.Date,{date:l,visibleFormat:t}):"—",E=i?Object(a.createElement)(O.Date,{date:i,visibleFormat:t}):"—",x=Object(a.createElement)(a.Fragment,null,Object(a.createElement)(p.Tooltip,{text:v},Object(a.createElement)("span",{"aria-hidden":"true"},h)),Object(a.createElement)("span",{className:"screen-reader-text"},v));return[{display:S,value:d},{display:_,value:_},{display:C,value:l},{display:E,value:i},{display:Object(a.createElement)("a",{href:"mailto:"+m},m),value:m},{display:Object(j.formatValue)(c(),"number",b),value:b},{display:r(y),value:o(y)},{display:r(n),value:o(n)},{display:x,value:h},{display:f,value:f},{display:w,value:w},{display:g,value:g}]})}getSummary(e){const{customers_count:t=0,avg_orders_count:r=0,avg_total_spend:a=0,avg_avg_order_value:o=0}=e,{formatAmount:c,getCurrencyConfig:l}=this.context,i=l();return[{label:Object(n._n)("customer","customers",t,'woocommerce'),value:Object(j.formatValue)(i,"number",t)},{label:Object(n._n)("Average order","Average orders",r,'woocommerce'),value:Object(j.formatValue)(i,"number",r)},{label:Object(n.__)("Average lifetime spend",'woocommerce'),value:c(a)},{label:Object(n.__)("Average order value",'woocommerce'),value:c(o)}]}render(){const{isRequesting:e,query:t,filters:r,advancedFilters:o}=this.props;return Object(a.createElement)(g.a,{endpoint:"customers",getHeadersContent:this.getHeadersContent,getRowsContent:this.getRowsContent,getSummary:this.getSummary,summaryFields:["customers_count","avg_orders_count","avg_total_spend","avg_avg_order_value"],isRequesting:e,itemIdField:"id",query:t,labels:{placeholder:Object(n.__)("Search by customer name",'woocommerce')},searchBy:"customers",title:Object(n.__)("Customers",'woocommerce'),columnPrefsKey:"customers_report_columns",filters:r,advancedFilters:o})}}h.contextType=f.a;var v=h,S=r(505);class C extends a.Component{render(){const{isRequesting:e,query:t,path:r}=this.props,o={orderby:"date_last_active",order:"desc",...t};return Object(a.createElement)(a.Fragment,null,Object(a.createElement)(S.a,{query:t,path:r,filters:b,showDatePicker:!1,advancedFilters:_,report:"customers"}),Object(a.createElement)(v,{isRequesting:e,query:o,filters:b,advancedFilters:_}))}}C.propTypes={query:c.a.object.isRequired}},501:function(e,t,r){"use strict";r.d(t,"b",(function(){return s})),r.d(t,"a",(function(){return m}));var a=r(0),o=r(30),c=r(89),n=r.n(c),l=r(13);const i=n()(l.a),s=e=>{const t=i.getCurrencyConfig(),r=Object(o.applyFilters)("woocommerce_admin_report_currency",t,e);return n()(r)},m=Object(a.createContext)(i)},502:function(e,t,r){"use strict";r.d(t,"e",(function(){return d})),r.d(t,"a",(function(){return u})),r.d(t,"b",(function(){return b})),r.d(t,"c",(function(){return _})),r.d(t,"d",(function(){return p})),r.d(t,"f",(function(){return O})),r.d(t,"h",(function(){return j})),r.d(t,"g",(function(){return y}));var a=r(15),o=r(17),c=r.n(o),n=r(4),l=r(12),i=r(11),s=r(13),m=r(503);function d(e,t=n.identity){return function(r="",o){const n="function"==typeof e?e(o):e,i=Object(l.getIdsFromQuery)(r);if(i.length<1)return Promise.resolve([]);const s={include:i.join(","),per_page:i.length};return c()({path:Object(a.addQueryArgs)(n,s)}).then(e=>e.map(t))}}d(i.NAMESPACE+"/products/attributes",e=>({key:e.id,label:e.name}));const u=d(i.NAMESPACE+"/products/categories",e=>({key:e.id,label:e.name})),b=d(i.NAMESPACE+"/coupons",e=>({key:e.id,label:e.code})),_=d(i.NAMESPACE+"/customers",e=>({key:e.id,label:e.name})),p=d(i.NAMESPACE+"/products",e=>({key:e.id,label:e.name})),O=d(i.NAMESPACE+"/taxes",e=>({key:e.id,label:Object(m.a)(e)}));function j({attributes:e,name:t}){const r=Object(s.f)("variationTitleAttributesSeparator"," - ");if(t&&t.indexOf(r)>-1)return t;const a=(e||[]).map(({option:e})=>e).join(", ");return a?t+r+a:t}const y=d(({products:e})=>e?i.NAMESPACE+`/products/${e}/variations`:i.NAMESPACE+"/variations",e=>({key:e.id,label:j(e)}))},503:function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));var a=r(2);function o(e){return[e.country,e.state,e.name||Object(a.__)("TAX",'woocommerce'),e.priority].map(e=>e.toString().toUpperCase().trim()).filter(Boolean).join("-")}},504:function(e,t,r){"use strict";var a=r(0),o=r(2),c=r(1),n=r.n(c),l=r(21);function i({className:e}){const t=Object(o.__)("There was an error getting your stats. Please try again.",'woocommerce'),r=Object(o.__)("Reload",'woocommerce');return Object(a.createElement)(l.EmptyContent,{className:e,title:t,actionLabel:r,actionCallback:()=>{window.location.reload()}})}i.propTypes={className:n.a.string},t.a=i},505:function(e,t,r){"use strict";var a=r(0),o=r(14),c=r(1),n=r.n(c),l=r(4),i=r(7),s=r(21),m=r(13),d=r(11),u=r(19),b=r(16),_=r(501),p=r(55);class O extends a.Component{constructor(){super(),this.onDateSelect=this.onDateSelect.bind(this),this.onFilterSelect=this.onFilterSelect.bind(this),this.onAdvancedFilterAction=this.onAdvancedFilterAction.bind(this)}onDateSelect(e){const{report:t,addCesSurveyForAnalytics:r}=this.props;r(),Object(b.recordEvent)("datepicker_update",{report:t,...Object(l.omitBy)(e,l.isUndefined)})}onFilterSelect(e){const{report:t,addCesSurveyForAnalytics:r}=this.props,a=e.filter||e["filter-variations"];["single_product","single_category","single_coupon","single_variation"].includes(a)&&r();const o={report:t,filter:e.filter||"all"};"single_product"===e.filter&&(o.filter_variation=e["filter-variations"]||"all"),Object(b.recordEvent)("analytics_filter",o)}onAdvancedFilterAction(e,t){const{report:r,addCesSurveyForAnalytics:a}=this.props;switch(e){case"add":Object(b.recordEvent)("analytics_filters_add",{report:r,filter:t.key});break;case"remove":Object(b.recordEvent)("analytics_filters_remove",{report:r,filter:t.key});break;case"filter":const e=Object.keys(t).reduce((e,r)=>(e[Object(l.snakeCase)(r)]=t[r],e),{});a(),Object(b.recordEvent)("analytics_filters_filter",{report:r,...e});break;case"clear_all":Object(b.recordEvent)("analytics_filters_clear_all",{report:r});break;case"match":Object(b.recordEvent)("analytics_filters_all_any",{report:r,value:t.match})}}render(){const{advancedFilters:e,filters:t,path:r,query:o,showDatePicker:c,defaultDateRange:n}=this.props,{period:l,compare:i,before:d,after:b}=Object(u.getDateParamsFromQuery)(o,n),{primary:_,secondary:p}=Object(u.getCurrentDates)(o,n),O={period:l,compare:i,before:d,after:b,primaryDate:_,secondaryDate:p},j=this.context;return Object(a.createElement)(s.ReportFilters,{query:o,siteLocale:m.b.siteLocale,currency:j.getCurrencyConfig(),path:r,filters:t,advancedFilters:e,showDatePicker:c,onDateSelect:this.onDateSelect,onFilterSelect:this.onFilterSelect,onAdvancedFilterAction:this.onAdvancedFilterAction,dateQuery:O,isoDateFormat:u.isoDateFormat})}}O.contextType=_.a,t.a=Object(o.compose)(Object(i.withSelect)(e=>{const{woocommerce_default_date_range:t}=e(d.SETTINGS_STORE_NAME).getSetting("wc_admin","wcAdminSettings");return{defaultDateRange:t}}),Object(i.withDispatch)(e=>{const{addCesSurveyForAnalytics:t}=e(p.c);return{addCesSurveyForAnalytics:t}}))(O),O.propTypes={advancedFilters:n.a.object,filters:n.a.array,path:n.a.string.isRequired,query:n.a.object,showDatePicker:n.a.bool,report:n.a.string.isRequired}},506:function(e,t,r){"use strict";var a=r(35),o=r.n(a),c=r(0),n=r(3),l=r(30),i=r(14),s=r(91),m=r(7),d=r(4),u=r(2),b=r(1),_=r.n(b),p=r(21),O=r(12),j=r(474),y=r(11),g=r(16),f=()=>Object(c.createElement)("svg",{role:"img","aria-hidden":"true",focusable:"false",version:"1.1",xmlns:"http://www.w3.org/2000/svg",x:"0px",y:"0px",viewBox:"0 0 24 24"},Object(c.createElement)("path",{d:"M18,9c-0.009,0-0.017,0.002-0.025,0.003C17.72,5.646,14.922,3,11.5,3C7.91,3,5,5.91,5,9.5c0,0.524,0.069,1.031,0.186,1.519 C5.123,11.016,5.064,11,5,11c-2.209,0-4,1.791-4,4c0,1.202,0.541,2.267,1.38,3h18.593C22.196,17.089,23,15.643,23,14 C23,11.239,20.761,9,18,9z M12,16l-4-5h3V8h2v3h3L12,16z"})),w=r(504);var h=r(55);r(515);const v=e=>{const{getHeadersContent:t,getRowsContent:r,getSummary:a,isRequesting:i,primaryData:m,tableData:b,endpoint:_,itemIdField:h,tableQuery:v,compareBy:S,compareParam:C,searchBy:E,labels:x={},...A}=e,{query:R,columnPrefsKey:F}=e,{items:k,query:D}=b,N=R[C]?Object(O.getIdsFromQuery)(R[S]):[],[q,T]=Object(c.useState)(N),P=Object(c.useRef)(null),{updateUserPreferences:B,...M}=Object(y.useUserPreferences)();if(b.isError||m.isError)return Object(c.createElement)(w.a,null);let L=[];F&&(L=M&&M[F]?M[F]:L);const Q=(e,o,c)=>{const n=a?a(o,c):null;return Object(l.applyFilters)("woocommerce_admin_report_table",{endpoint:_,headers:t(),rows:r(e),totals:o,summary:n,items:k})},I=t=>{const{ids:r}=e;T(t?r:[])},V=(t,r)=>{const{ids:a}=e;if(r)T(Object(d.uniq)([a[t],...q]));else{const e=q.indexOf(a[t]);T([...q.slice(0,e),...q.slice(e+1)])}},U=t=>{const{ids:r=[]}=e,a=-1!==q.indexOf(r[t]);return{display:Object(c.createElement)(n.CheckboxControl,{onChange:Object(d.partial)(V,t),checked:a}),value:!1}},H=()=>{const{ids:t=[]}=e,r=t.length>0,a=r&&t.length===q.length;return{cellClassName:"is-checkbox-column",key:"compare",label:Object(c.createElement)(n.CheckboxControl,{onChange:I,"aria-label":Object(u.__)("Select All"),checked:a,disabled:!r}),required:!0}},z=i||b.isRequesting||m.isRequesting,G=Object(d.get)(m,["data","totals"],{}),J=k.totalResults||0,K=J>0,X=Object(O.getSearchWords)(R).map(e=>({key:e,label:e})),{data:Y}=k,W=Q(Y,G,J);let{headers:$,rows:Z}=W;const{summary:ee}=W;S&&(Z=Z.map((e,t)=>[U(t),...e]),$=[H(),...$]);const te=((e,t)=>t?e.map(e=>({...e,visible:e.required||!t.includes(e.key)})):e.map(e=>({...e,visible:e.required||!e.hiddenByDefault})))($,L);return Object(c.createElement)(c.Fragment,null,Object(c.createElement)("div",{className:"woocommerce-report-table__scroll-point",ref:P,"aria-hidden":!0}),Object(c.createElement)(p.TableCard,o()({className:"woocommerce-report-table",hasSearch:!!E,actions:[S&&Object(c.createElement)(p.CompareButton,{key:"compare",className:"woocommerce-table__compare",count:q.length,helpText:x.helpText||Object(u.__)("Check at least two items below to compare",'woocommerce'),onClick:()=>{S&&Object(O.onQueryChange)("compare")(S,C,q.join(","))},disabled:!K},x.compareButton||Object(u.__)("Compare",'woocommerce')),E&&Object(c.createElement)(p.Search,{allowFreeTextSearch:!0,inlineTags:!0,key:"search",onChange:t=>{const{baseSearchQuery:r,addCesSurveyForCustomerSearch:a}=e,o=t.map(e=>e.label.replace(",","%2C"));o.length?(Object(O.updateQueryString)({filter:void 0,[C]:void 0,[E]:void 0,...r,search:Object(d.uniq)(o).join(",")}),a()):Object(O.updateQueryString)({search:void 0}),Object(g.recordEvent)("analytics_table_filter",{report:_})},placeholder:x.placeholder||Object(u.__)("Search by item name",'woocommerce'),selected:X,showClearButton:!0,type:E,disabled:!K}),K&&Object(c.createElement)(n.Button,{key:"download",className:"woocommerce-table__download-button",disabled:z,onClick:()=>{const{createNotice:t,startExport:r,title:a}=e,o=Object.assign({},R),{data:c,totalResults:n}=k;let l="browser";if(delete o.extended_info,o.search&&delete o[E],c&&c.length===n){const{headers:e,rows:t}=Q(c,n);Object(j.downloadCSVFile)(Object(j.generateCSVFileName)(a,o),Object(j.generateCSVDataFromTable)(e,t))}else l="email",r(_,D).then(()=>t("success",Object(u.sprintf)(Object(u.__)("Your %s Report will be emailed to you.",'woocommerce'),a))).catch(e=>t("error",e.message||Object(u.sprintf)(Object(u.__)("There was a problem exporting your %s Report. Please try again.",'woocommerce'),a)));Object(g.recordEvent)("analytics_table_download",{report:_,rows:n,download_type:l})}},Object(c.createElement)(f,null),Object(c.createElement)("span",{className:"woocommerce-table__download-button__label"},x.downloadButton||Object(u.__)("Download",'woocommerce')))],headers:te,isLoading:z,onQueryChange:O.onQueryChange,onColumnsChange:(e,t)=>{const r=$.map(e=>e.key).filter(t=>!e.includes(t));if(F){B({[F]:r})}if(t){const r={report:_,column:t,status:e.includes(t)?"on":"off"};Object(g.recordEvent)("analytics_table_header_toggle",r)}},onSort:(e,t)=>{Object(O.onQueryChange)("sort")(e,t);const r={report:_,column:e,direction:t};Object(g.recordEvent)("analytics_table_sort",r)},onPageChange:(e,t)=>{P.current.scrollIntoView();const r=P.current.nextSibling.querySelector(".woocommerce-table__table"),a=s.focus.focusable.find(r);a.length&&a[0].focus(),t&&("goto"===t?Object(g.recordEvent)("analytics_table_go_to_page",{report:_,page:e}):Object(g.recordEvent)("analytics_table_page_click",{report:_,direction:t}))},rows:Z,rowsPerPage:parseInt(D.per_page,10)||y.QUERY_DEFAULTS.pageSize,summary:ee,totalRows:J},A)))};v.propTypes={baseSearchQuery:_.a.object,compareBy:_.a.string,compareParam:_.a.string,columnPrefsKey:_.a.string,endpoint:_.a.string,extendItemsMethodNames:_.a.shape({getError:_.a.string,isRequesting:_.a.string,load:_.a.string}),extendedItemsStoreName:_.a.string,getHeadersContent:_.a.func.isRequired,getRowsContent:_.a.func.isRequired,getSummary:_.a.func,itemIdField:_.a.string,labels:_.a.shape({compareButton:_.a.string,downloadButton:_.a.string,helpText:_.a.string,placeholder:_.a.string}),primaryData:_.a.object,searchBy:_.a.string,summaryFields:_.a.arrayOf(_.a.string),tableData:_.a.object.isRequired,tableQuery:_.a.object,title:_.a.string.isRequired},v.defaultProps={primaryData:{},tableData:{items:{data:[],totalResults:0},query:{}},tableQuery:{},compareParam:"filter",downloadable:!1,onSearch:d.noop,baseSearchQuery:{}};const S=[],C={};t.a=Object(i.compose)(Object(m.withSelect)((e,t)=>{const{endpoint:r,getSummary:a,isRequesting:o,itemIdField:c,query:n,tableData:l,tableQuery:i,filters:s,advancedFilters:m,summaryFields:u,extendedItemsStoreName:b}=t,_=e(y.REPORTS_STORE_NAME),p=b?e(b):null,{woocommerce_default_date_range:O}=e(y.SETTINGS_STORE_NAME).getSetting("wc_admin","wcAdminSettings");if(o)return C;const j="categories"===r?"products":r,g=a?Object(y.getReportChartData)({endpoint:j,selector:_,dataType:"primary",query:n,filters:s,advancedFilters:m,defaultDateRange:O,fields:u}):C,f=l||Object(y.getReportTableData)({endpoint:r,query:n,selector:_,tableQuery:i,filters:s,advancedFilters:m,defaultDateRange:O}),w=p?function(e,t,r){const{extendItemsMethodNames:a,itemIdField:o}=t,c=r.items.data;if(!(Array.isArray(c)&&c.length&&a&&o))return r;const{[a.getError]:n,[a.isRequesting]:l,[a.load]:i}=e,s={include:c.map(e=>e[o]).join(","),per_page:c.length},m=i(s),u=!!l&&l(s),b=!!n&&n(s),_=c.map(e=>{const t=Object(d.first)(m.filter(t=>e.id===t.id));return{...e,...t}}),p=r.isRequesting||u,O=r.isError||b;return{...r,isRequesting:p,isError:O,items:{...r.items,data:_}}}(p,t,f):f;return{primaryData:g,ids:c&&w.items.data?w.items.data.map(e=>e[c]):S,tableData:w,query:n}}),Object(m.withDispatch)(e=>{const{startExport:t}=e(y.EXPORT_STORE_NAME),{createNotice:r}=e("core/notices"),{addCesSurveyForCustomerSearch:a}=e(h.c);return{createNotice:r,startExport:t,addCesSurveyForCustomerSearch:a}}))(v)},515:function(e,t,r){}}]);woocommerce-admin/dist/chunks/dashboard.js000064400000000702151335517650014706 0ustar00(window.__wcAdmin_webpackJsonp=window.__wcAdmin_webpackJsonp||[]).push([[25],{516:function(e,n,t){},606:function(e,n,t){"use strict";t.r(n);var c=t(0),r=t(21);t(516);const s=Object(c.lazy)(()=>t.e(24).then(t.bind(null,604)));class a extends c.Component{render(){const{path:e,query:n}=this.props;return Object(c.createElement)(c.Suspense,{fallback:Object(c.createElement)(r.Spinner,null)},Object(c.createElement)(s,{query:n,path:e}))}}n.default=a}}]);woocommerce-admin/dist/chunks/45.style.css000064400000005257151335517650014534 0ustar00:root{--wp-admin-theme-color:#007cba;--wp-admin-theme-color-darker-10:#006ba1;--wp-admin-theme-color-darker-20:#005a87}body.admin-color-light{--wp-admin-theme-color:#0085ba;--wp-admin-theme-color-darker-10:#0073a1;--wp-admin-theme-color-darker-20:#006187}body.admin-color-modern{--wp-admin-theme-color:#3858e9;--wp-admin-theme-color-darker-10:#2145e6;--wp-admin-theme-color-darker-20:#183ad6}body.admin-color-blue{--wp-admin-theme-color:#096484;--wp-admin-theme-color-darker-10:#07526c;--wp-admin-theme-color-darker-20:#064054}body.admin-color-coffee{--wp-admin-theme-color:#46403c;--wp-admin-theme-color-darker-10:#383330;--wp-admin-theme-color-darker-20:#2b2724}body.admin-color-ectoplasm{--wp-admin-theme-color:#523f6d;--wp-admin-theme-color-darker-10:#46365d;--wp-admin-theme-color-darker-20:#3a2c4d}body.admin-color-midnight{--wp-admin-theme-color:#e14d43;--wp-admin-theme-color-darker-10:#dd382d;--wp-admin-theme-color-darker-20:#d02c21}body.admin-color-ocean{--wp-admin-theme-color:#627c83;--wp-admin-theme-color-darker-10:#576e74;--wp-admin-theme-color-darker-20:#4c6066}body.admin-color-sunrise{--wp-admin-theme-color:#dd823b;--wp-admin-theme-color-darker-10:#d97426;--wp-admin-theme-color-darker-20:#c36922}.woocommerce-recommended-payments-card{margin:0 15px 10px 0;animation:isLoaded;animation-duration:.25s}.woocommerce-recommended-payments-card .woocommerce-list__item>.woocommerce-list__item-inner{align-items:flex-start}.woocommerce-recommended-payments-card .woocommerce-list__item:hover{background-color:#fff}.woocommerce-recommended-payments-card .woocommerce-list__item:hover .woocommerce-list__item-title{color:#1e1e1e}.woocommerce-recommended-payments-card .woocommerce-list__item-title{font-size:14px;color:#1e1e1e;font-weight:600}.woocommerce-recommended-payments-card .woocommerce-review-activity-card__section-controls{text-align:center}.woocommerce-recommended-payments-card .woocommerce-pill{margin-left:4px;padding:2px 8px}@media(max-width:480px){.woocommerce-recommended-payments-card .woocommerce-pill{margin-top:4px;margin-bottom:4px}}.woocommerce-recommended-payments-card .components-card__footer .gridicon{margin-left:4px}.woocommerce-recommended-payments-card .woocommerce-list__item-enter{opacity:0;max-height:100vh;transform:none}.woocommerce-recommended-payments-card .woocommerce-list__item-enter-active{opacity:1;transition:opacity .2s}.woocommerce-recommended-payments-card .woocommerce-list__item-after .components-button{margin-left:12px}.woocommerce-recommended-payments-card .woocommerce-list__item-text,.woocommerce-recommended-payments-card .woocommerce-recommended-payments__header-heading{max-width:749px}@media(max-width:782px){.woocommerce-recommended-payments-card{margin:0 0 10px}}woocommerce-admin/dist/chunks/customizable-dashboard.js000064400000035424151335517650017416 0ustar00(window.__wcAdmin_webpackJsonp=window.__wcAdmin_webpackJsonp||[]).push([[24],{168:function(e,t,n){"use strict";var o=Object.assign||function(e){for(var t,n=1;n<arguments.length;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e};Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t=e.size,n=void 0===t?24:t,r=e.onClick,c=(e.icon,e.className),i=function(e,t){var n={};for(var o in e)0<=t.indexOf(o)||Object.prototype.hasOwnProperty.call(e,o)&&(n[o]=e[o]);return n}(e,["size","onClick","icon","className"]),s=["gridicon","gridicons-chevron-down",c,!1,!1,!1].filter(Boolean).join(" ");return a.default.createElement("svg",o({className:s,height:n,width:n,onClick:r},i,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"}),a.default.createElement("g",null,a.default.createElement("path",{d:"M20 9l-8 8-8-8 1.414-1.414L12 14.172l6.586-6.586"})))};var r,c=n(5),a=(r=c)&&r.__esModule?r:{default:r};e.exports=t.default},501:function(e,t,n){"use strict";n.d(t,"b",(function(){return l})),n.d(t,"a",(function(){return d}));var o=n(0),r=n(30),c=n(89),a=n.n(c),i=n(13);const s=a()(i.a),l=e=>{const t=s.getCurrencyConfig(),n=Object(r.applyFilters)("woocommerce_admin_report_currency",t,e);return a()(n)},d=Object(o.createContext)(s)},505:function(e,t,n){"use strict";var o=n(0),r=n(14),c=n(1),a=n.n(c),i=n(4),s=n(7),l=n(21),d=n(13),m=n(11),u=n(19),p=n(16),b=n(501),h=n(55);class v extends o.Component{constructor(){super(),this.onDateSelect=this.onDateSelect.bind(this),this.onFilterSelect=this.onFilterSelect.bind(this),this.onAdvancedFilterAction=this.onAdvancedFilterAction.bind(this)}onDateSelect(e){const{report:t,addCesSurveyForAnalytics:n}=this.props;n(),Object(p.recordEvent)("datepicker_update",{report:t,...Object(i.omitBy)(e,i.isUndefined)})}onFilterSelect(e){const{report:t,addCesSurveyForAnalytics:n}=this.props,o=e.filter||e["filter-variations"];["single_product","single_category","single_coupon","single_variation"].includes(o)&&n();const r={report:t,filter:e.filter||"all"};"single_product"===e.filter&&(r.filter_variation=e["filter-variations"]||"all"),Object(p.recordEvent)("analytics_filter",r)}onAdvancedFilterAction(e,t){const{report:n,addCesSurveyForAnalytics:o}=this.props;switch(e){case"add":Object(p.recordEvent)("analytics_filters_add",{report:n,filter:t.key});break;case"remove":Object(p.recordEvent)("analytics_filters_remove",{report:n,filter:t.key});break;case"filter":const e=Object.keys(t).reduce((e,n)=>(e[Object(i.snakeCase)(n)]=t[n],e),{});o(),Object(p.recordEvent)("analytics_filters_filter",{report:n,...e});break;case"clear_all":Object(p.recordEvent)("analytics_filters_clear_all",{report:n});break;case"match":Object(p.recordEvent)("analytics_filters_all_any",{report:n,value:t.match})}}render(){const{advancedFilters:e,filters:t,path:n,query:r,showDatePicker:c,defaultDateRange:a}=this.props,{period:i,compare:s,before:m,after:p}=Object(u.getDateParamsFromQuery)(r,a),{primary:b,secondary:h}=Object(u.getCurrentDates)(r,a),v={period:i,compare:s,before:m,after:p,primaryDate:b,secondaryDate:h},_=this.context;return Object(o.createElement)(l.ReportFilters,{query:r,siteLocale:d.b.siteLocale,currency:_.getCurrencyConfig(),path:n,filters:t,advancedFilters:e,showDatePicker:c,onDateSelect:this.onDateSelect,onFilterSelect:this.onFilterSelect,onAdvancedFilterAction:this.onAdvancedFilterAction,dateQuery:v,isoDateFormat:u.isoDateFormat})}}v.contextType=b.a,t.a=Object(r.compose)(Object(s.withSelect)(e=>{const{woocommerce_default_date_range:t}=e(m.SETTINGS_STORE_NAME).getSetting("wc_admin","wcAdminSettings");return{defaultDateRange:t}}),Object(s.withDispatch)(e=>{const{addCesSurveyForAnalytics:t}=e(h.c);return{addCesSurveyForAnalytics:t}}))(v),v.propTypes={advancedFilters:a.a.object,filters:a.a.array,path:a.a.string.isRequired,query:a.a.object,showDatePicker:a.a.bool,report:a.a.string.isRequired}},591:function(e,t,n){"use strict";var o=Object.assign||function(e){for(var t,n=1;n<arguments.length;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e};Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n=e.size,r=void 0===n?24:n,c=e.onClick,i=(e.icon,e.className),s=function(e,t){var n={};for(var o in e)0<=t.indexOf(o)||Object.prototype.hasOwnProperty.call(e,o)&&(n[o]=e[o]);return n}(e,["size","onClick","icon","className"]),l=["gridicon","gridicons-list-ordered",i,(t=r,!(0!=t%18)&&"needs-offset"),!1,!1].filter(Boolean).join(" ");return a.default.createElement("svg",o({className:l,height:r,width:r,onClick:c},s,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"}),a.default.createElement("g",null,a.default.createElement("path",{d:"M8 19h13v-2H8v2zm0-6h13v-2H8v2zm0-8v2h13V5H8zm-4.425.252c.107-.096.197-.188.27-.275-.013.228-.02.48-.02.756V8h1.176V3.717H3.96L2.487 4.915l.6.738.487-.4zm.334 7.764c.474-.426.784-.715.93-.867.145-.153.26-.298.35-.436.087-.138.152-.278.194-.42.042-.143.063-.298.063-.466 0-.225-.06-.427-.18-.608s-.29-.32-.507-.417c-.218-.1-.465-.148-.742-.148-.22 0-.42.022-.596.067s-.34.11-.49.195c-.15.085-.337.226-.558.423l.636.744c.174-.15.33-.264.467-.34.138-.078.274-.117.41-.117.13 0 .232.032.304.097.073.064.11.152.11.264 0 .09-.02.176-.055.258-.036.082-.1.18-.192.294-.092.114-.287.328-.586.64L2.42 13.238V14h3.11v-.955H3.91v-.03zm.53 4.746v-.018c.306-.086.54-.225.702-.414.162-.19.243-.42.243-.685 0-.31-.126-.55-.378-.727-.252-.176-.6-.264-1.043-.264-.307 0-.58.033-.816.1s-.47.178-.696.334l.48.773c.293-.183.576-.274.85-.274.147 0 .263.027.35.082s.13.14.13.252c0 .3-.294.45-.882.45h-.27v.87h.264c.217 0 .393.017.527.05.136.03.233.08.294.143.06.064.09.154.09.27 0 .153-.057.265-.173.337-.115.07-.3.106-.554.106-.164 0-.343-.022-.538-.07-.194-.044-.385-.115-.573-.21v.96c.228.088.44.148.637.182.196.033.41.05.64.05.56 0 .998-.114 1.314-.343.315-.228.473-.542.473-.94.002-.585-.356-.923-1.07-1.013z"})))};var r,c=n(5),a=(r=c)&&r.__esModule?r:{default:r};e.exports=t.default},592:function(e,t,n){"use strict";var o=Object.assign||function(e){for(var t,n=1;n<arguments.length;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e};Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t=e.size,n=void 0===t?24:t,r=e.onClick,c=(e.icon,e.className),i=function(e,t){var n={};for(var o in e)0<=t.indexOf(o)||Object.prototype.hasOwnProperty.call(e,o)&&(n[o]=e[o]);return n}(e,["size","onClick","icon","className"]),s=["gridicon","gridicons-chevron-up",c,!1,!1,!1].filter(Boolean).join(" ");return a.default.createElement("svg",o({className:s,height:n,width:n,onClick:r},i,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"}),a.default.createElement("g",null,a.default.createElement("path",{d:"M4 15l8-8 8 8-1.414 1.414L12 9.828l-6.586 6.586"})))};var r,c=n(5),a=(r=c)&&r.__esModule?r:{default:r};e.exports=t.default},604:function(e,t,n){"use strict";n.r(t);var o=n(0),r=n(2),c=n(14),a=n(4),i=n(3),s=n(30),l=n(116),d=n(8),m=Object(o.createElement)(d.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(o.createElement)(d.Path,{d:"M2 12C2 6.44444 6.44444 2 12 2C17.5556 2 22 6.44444 22 12C22 17.5556 17.5556 22 12 22C6.44444 22 2 17.5556 2 12ZM13 11V7H11V11H7V13H11V17H13V13H17V11H13Z"})),u=n(7),p=n(21),b=n(11),h=n(12),v=n(19),_=n(16),O=(n(516),Object(o.createElement)(d.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"-2 -2 24 24"},Object(o.createElement)(d.Path,{d:"M2 11V9h12l-4-4 1-2 7 7-7 7-1-2 4-4H2z"}))),f=Object(o.createElement)(d.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(o.createElement)(d.Path,{fillRule:"evenodd",d:"M11.25 5h1.5v15h-1.5V5zM6 10h1.5v10H6V10zm12 4h-1.5v6H18v-6z",clipRule:"evenodd"})),j=n(591),g=n.n(j);const w=Object(o.lazy)(()=>n.e(26).then(n.bind(null,617))),y=Object(o.lazy)(()=>Promise.all([n.e(1),n.e(32)]).then(n.bind(null,620))),k=Object(o.lazy)(()=>n.e(50).then(n.bind(null,610)));var E=Object(s.applyFilters)("woocommerce_dashboard_default_sections",[{key:"store-performance",component:e=>Object(o.createElement)(o.Suspense,{fallback:Object(o.createElement)(p.Spinner,null)},Object(o.createElement)(k,e)),title:Object(r.__)("Performance",'woocommerce'),isVisible:!0,icon:O,hiddenBlocks:["coupons/amount","coupons/orders_count","downloads/download_count","taxes/order_tax","taxes/total_tax","taxes/shipping_tax","revenue/shipping","orders/avg_order_value","revenue/refunds","revenue/gross_sales"]},{key:"charts",component:e=>Object(o.createElement)(o.Suspense,{fallback:Object(o.createElement)(p.Spinner,null)},Object(o.createElement)(w,e)),title:Object(r.__)("Charts",'woocommerce'),isVisible:!0,icon:f,hiddenBlocks:["orders_avg_order_value","avg_items_per_order","products_items_sold","revenue_total_sales","revenue_refunds","coupons_amount","coupons_orders_count","revenue_shipping","taxes_total_tax","taxes_order_tax","taxes_shipping_tax","downloads_download_count"]},{key:"leaderboards",component:e=>Object(o.createElement)(o.Suspense,{fallback:Object(o.createElement)(p.Spinner,null)},Object(o.createElement)(y,e)),title:Object(r.__)("Leaderboards",'woocommerce'),isVisible:!0,icon:Object(o.createElement)(g.a,null),hiddenBlocks:["coupons","customers"]}]),C=n(35),S=n.n(C),x=Object(o.createElement)(d.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"-2 -2 24 24"},Object(o.createElement)(d.Path,{d:"M12 4h3c.6 0 1 .4 1 1v1H3V5c0-.6.5-1 1-1h3c.2-1.1 1.3-2 2.5-2s2.3.9 2.5 2zM8 4h3c-.2-.6-.9-1-1.5-1S8.2 3.4 8 4zM4 7h11l-.9 10.1c0 .5-.5.9-1 .9H5.9c-.5 0-.9-.4-1-.9L4 7z"})),M=n(592),B=n.n(M),F=n(168),T=n.n(F);class D extends o.Component{constructor(e){super(e),this.onMoveUp=this.onMoveUp.bind(this),this.onMoveDown=this.onMoveDown.bind(this)}onMoveUp(){const{onMove:e,onToggle:t}=this.props;e(-1),t()}onMoveDown(){const{onMove:e,onToggle:t}=this.props;e(1),t()}render(){const{onRemove:e,isFirst:t,isLast:n,onTitleBlur:c,onTitleChange:a,titleInput:s}=this.props;return Object(o.createElement)(o.Fragment,null,Object(o.createElement)("div",{className:"woocommerce-ellipsis-menu__item"},Object(o.createElement)(i.TextControl,{label:Object(r.__)("Section title",'woocommerce'),onBlur:c,onChange:a,required:!0,value:s})),Object(o.createElement)("div",{className:"woocommerce-dashboard-section-controls"},!t&&Object(o.createElement)(p.MenuItem,{isClickable:!0,onInvoke:this.onMoveUp},Object(o.createElement)(l.a,{icon:Object(o.createElement)(B.a,null),label:Object(r.__)("Move up"),size:20,className:"icon-control"}),Object(r.__)("Move up",'woocommerce')),!n&&Object(o.createElement)(p.MenuItem,{isClickable:!0,onInvoke:this.onMoveDown},Object(o.createElement)(l.a,{icon:Object(o.createElement)(T.a,null),size:20,label:Object(r.__)("Move down"),className:"icon-control"}),Object(r.__)("Move down",'woocommerce')),Object(o.createElement)(p.MenuItem,{isClickable:!0,onInvoke:e},Object(o.createElement)(l.a,{icon:x,size:20,label:Object(r.__)("Remove block"),className:"icon-control"}),Object(r.__)("Remove section",'woocommerce'))))}}var V=D;class z extends o.Component{constructor(e){super(e);const{title:t}=e;this.state={titleInput:t},this.onToggleHiddenBlock=this.onToggleHiddenBlock.bind(this),this.onTitleChange=this.onTitleChange.bind(this),this.onTitleBlur=this.onTitleBlur.bind(this)}onTitleChange(e){this.setState({titleInput:e})}onTitleBlur(){const{onTitleUpdate:e,title:t}=this.props,{titleInput:n}=this.state;""===n?this.setState({titleInput:t}):e&&e(n)}onToggleHiddenBlock(e){return()=>{const t=Object(a.xor)(this.props.hiddenBlocks,[e]);this.props.onChangeHiddenBlocks(t)}}render(){const{component:e,...t}=this.props,{titleInput:n}=this.state;return Object(o.createElement)("div",{className:"woocommerce-dashboard-section"},Object(o.createElement)(e,S()({onTitleChange:this.onTitleChange,onTitleBlur:this.onTitleBlur,onToggleHiddenBlock:this.onToggleHiddenBlock,titleInput:n,controls:V},t)))}}var H=n(505),N=n(501);const A=Object(s.applyFilters)("woocommerce_admin_dashboard_filters",[]);t.default=Object(c.compose)(Object(u.withSelect)(e=>{const{woocommerce_default_date_range:t}=e(b.SETTINGS_STORE_NAME).getSetting("wc_admin","wcAdminSettings");return{defaultDateRange:t}}))(({defaultDateRange:e,path:t,query:n})=>{const{updateUserPreferences:c,...s}=Object(b.useUserPreferences)(),d=Object(o.useMemo)(()=>(e=>{if(!e||0===e.length)return E.reduce((e,t)=>[...e,{...t}],[]);const t=E.map(e=>e.key),n=e.map(e=>e.key),o=new Set([...n,...t]),r=[];return o.forEach(t=>{const n=E.find(e=>e.key===t);if(!n)return;const o=e.find(e=>e.key===t);o&&delete o.icon,r.push({...n,...o})}),r})(s.dashboard_sections),[s.dashboard_sections]),u=e=>{c({dashboard_sections:e})},O=(e,t)=>{const n=d.map(n=>(delete n.icon,n.key===e?{...n,...t}:n));u(n)},f=e=>t=>{Object(_.recordEvent)("dash_section_rename",{key:e}),O(e,{title:t})},j=(e,t)=>()=>{t&&t();const n=d.findIndex(t=>e===t.key),o=d.splice(n,1).shift();o.isVisible=!o.isVisible,d.push(o),o.isVisible?Object(_.recordEvent)("dash_section_add",{key:o.key}):Object(_.recordEvent)("dash_section_remove",{key:o.key}),u(d)},g=(e,t)=>{const n=d.splice(e,1).shift(),o=e+t;if(d[t<0?o:o-1].isVisible||0===e||e===d.length-1){d.splice(o,0,n),u(d);const e={key:n.key,direction:t>0?"down":"up"};Object(_.recordEvent)("dash_section_order_change",e)}else g(e,t+t)};return Object(o.createElement)(N.a.Provider,{value:Object(N.b)(Object(h.getQuery)())},(()=>{const{period:c,compare:s,before:u,after:b}=Object(v.getDateParamsFromQuery)(n,e),{primary:h,secondary:_}=Object(v.getCurrentDates)(n,e),w={period:c,compare:s,before:u,after:b,primaryDate:h,secondaryDate:_},y=d.filter(e=>e.isVisible).map(e=>e.key);return Object(o.createElement)(o.Fragment,null,Object(o.createElement)(H.a,{report:"dashboard",query:n,path:t,dateQuery:w,isoDateFormat:v.isoDateFormat,filters:A}),d.map((e,r)=>{return e.isVisible?Object(o.createElement)(z,{component:e.component,hiddenBlocks:e.hiddenBlocks,key:e.key,onChangeHiddenBlocks:(c=e.key,e=>{O(c,{hiddenBlocks:e})}),onTitleUpdate:f(e.key),path:t,query:n,title:e.title,onMove:Object(a.partial)(g,r),onRemove:j(e.key),isFirst:e.key===y[0],isLast:e.key===y[y.length-1],filters:A}):null;var c}),(()=>{const e=d.filter(e=>!1===e.isVisible);return 0===e.length?null:Object(o.createElement)(i.Dropdown,{position:"top center",className:"woocommerce-dashboard-section__add-more",renderToggle:({onToggle:e,isOpen:t})=>Object(o.createElement)(i.Button,{onClick:e,title:Object(r.__)("Add more sections",'woocommerce'),"aria-expanded":t},Object(o.createElement)(l.a,{icon:m})),renderContent:({onToggle:t})=>Object(o.createElement)(o.Fragment,null,Object(o.createElement)(p.H,null,Object(r.__)("Dashboard Sections",'woocommerce')),Object(o.createElement)("div",{className:"woocommerce-dashboard-section__add-more-choices"},e.map(e=>Object(o.createElement)(i.Button,{key:e.key,onClick:j(e.key,t),className:"woocommerce-dashboard-section__add-more-btn",title:Object(r.sprintf)(Object(r.__)("Add %s section",'woocommerce'),e.title)},Object(o.createElement)(l.a,{className:e.key+"__icon",icon:e.icon,size:30}),Object(o.createElement)("span",{className:"woocommerce-dashboard-section__add-more-btn-title"},e.title)))))})})())})())})}}]);woocommerce-admin/dist/chunks/store-alerts.js000064400000012441151335517650015406 0ustar00(window.__wcAdmin_webpackJsonp=window.__wcAdmin_webpackJsonp||[]).push([[49],{473:function(e,t,r){"use strict";var a=r(0),n=r(8),o=Object(a.createElement)(n.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(a.createElement)(n.Path,{d:"M10.6 6L9.4 7l4.6 5-4.6 5 1.2 1 5.4-6z"}));t.a=o},509:function(e,t,r){"use strict";var a=r(53);const n=["a","b","em","i","strong","p","br"],o=["target","href","rel","name","download"];t.a=e=>({__html:Object(a.sanitize)(e,{ALLOWED_TAGS:n,ALLOWED_ATTR:o})})},544:function(e,t,r){},618:function(e,t,r){"use strict";r.r(t),r.d(t,"StoreAlerts",(function(){return S}));var a=r(0),n=r(2),o=r(3),s=r(6),l=r.n(s),c=r(18),i=r.n(c),m=r(14),d=r(7),u=r(9),p=r.n(u),b=r(116),h=r(291),_=r(473),O=r(13),j=r(11),g=r(16),E=r(20),w=r(509),A=r(1),N=r.n(A);class v extends a.Component{render(){const{hasMultipleAlerts:e}=this.props;return Object(a.createElement)(o.Card,{className:"woocommerce-store-alerts is-loading","aria-hidden":!0,size:null},Object(a.createElement)(o.CardHeader,{isBorderless:!0},Object(a.createElement)("span",{className:"is-placeholder"}),e&&Object(a.createElement)("span",{className:"is-placeholder"})),Object(a.createElement)(o.CardBody,null,Object(a.createElement)("div",{className:"woocommerce-store-alerts__message"},Object(a.createElement)("span",{className:"is-placeholder"}),Object(a.createElement)("span",{className:"is-placeholder"}))),Object(a.createElement)(o.CardFooter,{isBorderless:!0},Object(a.createElement)("span",{className:"is-placeholder"})))}}var x=v;v.propTypes={hasMultipleAlerts:N.a.bool},v.defaultProps={hasMultipleAlerts:!1};r(544);class S extends a.Component{constructor(e){super(e),this.state={currentIndex:0},this.previousAlert=this.previousAlert.bind(this),this.nextAlert=this.nextAlert.bind(this)}previousAlert(e){e.stopPropagation();const{currentIndex:t}=this.state;t>0&&this.setState({currentIndex:t-1})}nextAlert(e){e.stopPropagation();const t=this.getAlerts(),{currentIndex:r}=this.state;r<t.length-1&&this.setState({currentIndex:r+1})}renderActions(e){const{triggerNoteAction:t,updateNote:r}=this.props,s=e.actions.map(r=>Object(a.createElement)(o.Button,{key:r.name,isPrimary:r.primary,isSecondary:!r.primary,href:r.url||void 0,onClick:()=>t(e.id,r.id)},r.label)),l=[{value:p()().add(4,"hours").unix().toString(),label:Object(n.__)("Later Today",'woocommerce')},{value:p()().add(1,"day").hour(9).minute(0).second(0).millisecond(0).unix().toString(),label:Object(n.__)("Tomorrow",'woocommerce')},{value:p()().add(1,"week").hour(9).minute(0).second(0).millisecond(0).unix().toString(),label:Object(n.__)("Next Week",'woocommerce')},{value:p()().add(1,"month").hour(9).minute(0).second(0).millisecond(0).unix().toString(),label:Object(n.__)("Next Month",'woocommerce')}],c=e.is_snoozable&&Object(a.createElement)(o.SelectControl,{className:"woocommerce-store-alerts__snooze",options:[{label:Object(n.__)("Remind Me Later",'woocommerce'),value:"0"},...l],onChange:t=>{if("0"===t)return;const a=l.find(e=>e.value===t);(t=>{r(e.id,{status:"snoozed",date_reminder:t.value});const a={alert_name:e.name,alert_title:e.title,snooze_duration:t.value,snooze_label:t.label};Object(g.recordEvent)("store_alert_snooze",a)})({value:t,label:a&&a.label})}});if(s||c)return Object(a.createElement)("div",{className:"woocommerce-store-alerts__actions"},s,c)}getAlerts(){return(this.props.alerts||[]).filter(e=>"unactioned"===e.status)}render(){const e=this.getAlerts(),t=Object(O.f)("alertCount",0,e=>parseInt(e,10));if(t>0&&this.props.isLoading)return Object(a.createElement)(x,{hasMultipleAlerts:t>1});if(0===e.length)return null;const{currentIndex:r}=this.state,s=e.length,c=e[r],m=c.type,d=l()("woocommerce-store-alerts",{"is-alert-error":"error"===m,"is-alert-update":"update"===m});return Object(a.createElement)(o.Card,{className:d,size:null},Object(a.createElement)(o.CardHeader,{isBorderless:!0},Object(a.createElement)(E.Text,{variant:"title.medium",as:"h2",size:"24",lineHeight:"32px"},c.title),s>1&&Object(a.createElement)("div",{className:"woocommerce-store-alerts__pagination"},Object(a.createElement)(o.Button,{onClick:this.previousAlert,disabled:0===r,label:Object(n.__)("Previous Alert",'woocommerce')},Object(a.createElement)(b.a,{icon:h.a,className:"arrow-left-icon"})),Object(a.createElement)("span",{className:"woocommerce-store-alerts__pagination-label",role:"status","aria-live":"polite"},i()({mixedString:Object(n.__)("{{current /}} of {{total /}}",'woocommerce'),components:{current:Object(a.createElement)(a.Fragment,null,r+1),total:Object(a.createElement)(a.Fragment,null,s)}})),Object(a.createElement)(o.Button,{onClick:this.nextAlert,disabled:s-1===r,label:Object(n.__)("Next Alert",'woocommerce')},Object(a.createElement)(b.a,{icon:_.a,className:"arrow-right-icon"})))),Object(a.createElement)(o.CardBody,null,Object(a.createElement)("div",{className:"woocommerce-store-alerts__message",dangerouslySetInnerHTML:Object(w.a)(c.content)})),Object(a.createElement)(o.CardFooter,{isBorderless:!0},this.renderActions(c)))}}const f={page:1,per_page:j.QUERY_DEFAULTS.pageSize,type:"error,update",status:"unactioned"};t.default=Object(m.compose)(Object(d.withSelect)(e=>{const{getNotes:t,isResolving:r}=e(j.NOTES_STORE_NAME);return{alerts:t(f),isLoading:r("getNotes",[f])}}),Object(d.withDispatch)(e=>{const{triggerNoteAction:t,updateNote:r}=e(j.NOTES_STORE_NAME);return{triggerNoteAction:t,updateNote:r}}))(S)}}]);woocommerce-admin/dist/chunks/47.style.css000064400000052603151335517650014533 0ustar00.woocommerce-profile-wizard__business-details__free-features{display:flex;flex-direction:column;justify-content:center}.woocommerce-profile-wizard__business-details__free-features .woocommerce-admin__business-details__selective-extensions-bundle .woocommerce-admin__business-details__selective-extensions-bundle__category{font-size:11px;text-transform:uppercase;margin:25px 0 0 30px;color:#000;font-weight:500}.woocommerce-profile-wizard__business-details__free-features .woocommerce-admin__business-details__selective-extensions-bundle .woocommerce-admin__business-details__selective-extensions-bundle__extension{display:flex;padding:24px 30px;border-bottom:1px solid #e0e0e0;align-items:center}.woocommerce-profile-wizard__business-details__free-features .woocommerce-admin__business-details__selective-extensions-bundle .woocommerce-admin__business-details__selective-extensions-bundle__description{font-size:16px;color:#1e1e1e;margin:0;line-height:18px}.woocommerce-profile-wizard__business-details__free-features .woocommerce-admin__business-details__selective-extensions-bundle .woocommerce-admin__business-details__free-badge{padding:0 8px;border:1px solid #757575;border-radius:16px;margin-left:8px;color:#757575;font-size:12px;line-height:18px;height:20px}.woocommerce-profile-wizard__business-details__free-features .woocommerce-admin__business-details__selective-extensions-bundle .woocommerce-admin__business-details__selective-extensions-bundle__link{text-decoration:none}.woocommerce-profile-wizard__business-details__free-features .woocommerce-card__body{padding:0}.woocommerce-profile-wizard__business-details__free-features .components-base-control .components-base-control__field{margin-bottom:0;margin-right:21px}.woocommerce-profile-wizard__business-details__free-features .components-base-control .components-base-control__field .components-checkbox-control__input-container{margin-right:0;vertical-align:baseline}.woocommerce-profile-wizard__business-details__free-features .woocommerce-admin__business-details__selective-extensions-bundle__expand{margin-left:9px}.woocommerce-profile-wizard__business-details__free-features .woocommerce-profile-wizard__business-details__free-features__illustration{flex:1;width:100%;display:flex;justify-content:center;margin-top:34px;margin-bottom:18px}.woocommerce-profile-wizard__business-details__free-features .woocommerce-profile-wizard__business-details__free-features__illustration .fill-theme-color{fill:#007cba;fill:var(--wp-admin-theme-color)}.woocommerce-profile-wizard__business-details__free-features .woocommerce-profile-wizard__business-details__free-features__action{padding-top:12px;display:flex;justify-content:center;margin-bottom:12px}.woocommerce-profile-wizard__container.business-features .components-tab-panel__tabs{justify-content:center}.woocommerce-profile-wizard__container.business-features .components-tab-panel__tabs .components-tab-panel__tabs-item.is-disabled{color:#949494;cursor:default;pointer-events:none}.woocommerce-profile-wizard__container.business-features .components-tab-panel__tabs .components-tab-panel__tabs-item.is-active{pointer-events:none}.woocommerce-profile-wizard__container.business-features .components-card__body{padding:16px 16px 0}.business-details.woocommerce-profile-wizard__container .woocommerce-admin__business-details__spinner,.business-features.woocommerce-profile-wizard__container .woocommerce-admin__business-details__spinner{display:flex;justify-content:center}.business-details.woocommerce-profile-wizard__container .woocommerce-profile-wizard__step-header,.business-features.woocommerce-profile-wizard__container .woocommerce-profile-wizard__step-header{margin-top:28px}.woocommerce-profile-wizard__body .woocommerce-profile-wizard__product-types .woocommerce-product-wizard__product-types-label{display:inline-block;margin-right:4px}.woocommerce-profile-wizard__body .woocommerce-profile-wizard__product-types .woocommerce-profile-wizard__checkbox-group .woocommerce-profile-wizard__checkbox{display:flex;align-items:center;min-height:64px}.woocommerce-profile-wizard__body .woocommerce-profile-wizard__product-types .woocommerce-profile-wizard__checkbox-group .woocommerce-profile-wizard__checkbox .components-button{padding:0;height:auto}.woocommerce-profile-wizard__body .woocommerce-profile-wizard__product-types .components-base-control__field,.woocommerce-profile-wizard__body .woocommerce-profile-wizard__product-types .components-checkbox-control__label{display:flex;width:100%;align-items:center}.woocommerce-profile-wizard__body .woocommerce-profile-wizard__product-types .components-checkbox-control__label .woocommerce-pill{margin-left:auto}.woocommerce-profile-wizard__body .woocommerce-profile-wizard__product-types .components-popover .components-popover__content{min-width:360px}.woocommerce-profile-wizard__body .woocommerce-profile-wizard__product-types .woocommerce-profile-wizard__product-types-pricing-toggle.woocommerce-profile-wizard__checkbox{display:flex;align-items:center;justify-content:flex-end;color:#949494;margin-bottom:16px}.woocommerce-profile-wizard__body .woocommerce-profile-wizard__product-types .woocommerce-profile-wizard__product-types-pricing-toggle.woocommerce-profile-wizard__checkbox label{display:inline-flex;align-items:center;margin:auto}.woocommerce-profile-wizard__body .woocommerce-profile-wizard__product-types .woocommerce-profile-wizard__product-types-pricing-toggle.woocommerce-profile-wizard__checkbox .components-form-toggle{display:inline-flex;margin-left:16px}.woocommerce-profile-wizard__body .woocommerce-profile-wizard__product-types__spinner{text-align:center}@media screen and (max-width:438px){.woocommerce-profile-wizard__body .woocommerce-profile-wizard__product-types .woocommerce-product-wizard__product-types-label{width:min-content}}@media screen and (max-width:375px){.woocommerce-profile-wizard__body .woocommerce-profile-wizard__product-types .woocommerce-pill{white-space:nowrap}}.woocommerce-profile-wizard__store-details .woocommerce-admin__store-details__spinner{display:flex;justify-content:center}.woocommerce-profile-wizard__store-details .components-popover .components-popover__content{min-width:360px}.woocommerce-profile-wizard__newsletter-signup .components-base-control__field{display:flex;align-items:center}.woocommerce-profile-wizard__newsletter-signup .woocommerce-profile-wizard__powered-by-mailchimp{color:#a7aaad}.woocommerce-profile-wizard__body .woocommerce-profile-wizard__container>.woocommerce-profile-wizard__themes-tab-panel{margin-bottom:24px}@media(min-width:783px){.woocommerce-profile-wizard__body .woocommerce-profile-wizard__container>.woocommerce-profile-wizard__themes-tab-panel{max-width:810px}.woocommerce-profile-wizard__body .woocommerce-profile-wizard__container>.woocommerce-profile-wizard__themes-tab-panel .woocommerce-profile-wizard__themes{display:grid;grid-gap:24px;grid-template-columns:1fr 1fr}}.woocommerce-profile-wizard__themes-tab-panel .components-tab-panel__tabs{display:flex;justify-content:space-between;background:#fff;box-shadow:0 2px 1px -1px rgba(0,0,0,.2),0 1px 1px 0 rgba(0,0,0,.14),0 1px 3px 0 rgba(0,0,0,.12);border-radius:3px;margin-top:24px;margin-bottom:24px}.woocommerce-profile-wizard__themes-tab-panel .components-tab-panel__tabs button{border:0;color:#646970;display:flex;align-items:center;justify-content:center;background:transparent;height:48px;width:100%;font-size:14px;font-size:.875rem;font-weight:500;outline:none;padding:0 24px}p.woocommerce-profile-wizard__themes-skip-this-step{text-align:center}.woocommerce-profile-wizard__body .woocommerce-profile-wizard__theme.components-card{overflow:hidden}@media(min-width:783px){.woocommerce-profile-wizard__body .woocommerce-profile-wizard__theme.components-card{margin:0}}.woocommerce-profile-wizard__body .woocommerce-profile-wizard__theme.components-card .woocommerce-profile-wizard__theme-image{width:100%;height:300px;background-size:cover}.woocommerce-profile-wizard__body .woocommerce-profile-wizard__theme.components-card .woocommerce-profile-wizard__theme-name{margin-top:auto;margin-bottom:8px;font-size:24px;font-size:1.5rem;font-weight:400}.woocommerce-profile-wizard__body .woocommerce-profile-wizard__theme.components-card .woocommerce-profile-wizard__theme-name svg{max-width:18px;height:18px;margin-left:8px}.woocommerce-profile-wizard__body .woocommerce-profile-wizard__theme.components-card .woocommerce-profile-wizard__theme-name svg path{fill:#d63638}.woocommerce-profile-wizard__body .woocommerce-profile-wizard__theme.components-card .woocommerce-profile-wizard__theme-status{margin:0;font-size:14px}.woocommerce-profile-wizard__body .woocommerce-profile-wizard__theme.components-card .woocommerce-profile-wizard__theme-learn-more{display:inline-block}.woocommerce-profile-wizard__body .woocommerce-theme-uploader.components-card{margin:0;position:relative}.woocommerce-profile-wizard__body .woocommerce-theme-uploader.components-card.is-uploading .woocommerce-theme-uploader__dropzone-wrapper{min-height:382px}.woocommerce-profile-wizard__body .woocommerce-theme-uploader.components-card .woocommerce-theme-uploader__dropzone-wrapper{display:flex;flex-direction:column;align-items:center;justify-content:center;border-radius:2px;background:#f6f6f6;border:1px dashed #b0b5b8}.woocommerce-profile-wizard__body .woocommerce-theme-uploader.components-card .components-form-file-upload{flex:1 1 auto;width:100%;display:flex}.woocommerce-profile-wizard__body .woocommerce-theme-uploader.components-card .components-form-file-upload>.components-button{flex:1 1 auto;flex-direction:column;justify-content:center;margin:0;width:100%;height:100%;min-height:380px}.woocommerce-profile-wizard__body .woocommerce-theme-uploader.components-card .components-form-file-upload>.components-button>.gridicon{width:48px;height:48px}.woocommerce-profile-wizard__body .woocommerce-theme-uploader.components-card .components-form-file-upload>.components-button>.gridicon path{fill:#50575d}.woocommerce-profile-wizard__body .woocommerce-theme-uploader.components-card .components-form-file-upload>.components-button .dashicons-upload{display:none}.woocommerce-profile-wizard__body .woocommerce-theme-uploader.components-card .woocommerce-theme-uploader__title{margin:8px 0;font-size:24px;font-size:1.5rem;font-weight:400}.woocommerce-profile-wizard__body .woocommerce-theme-uploader.components-card p{font-size:14px;font-size:.875rem;margin:0}.woocommerce-theme-preview{position:fixed;top:0;left:0;width:100%;height:100%;max-width:100%!important;display:flex;flex-direction:column}.woocommerce-theme-preview .woocommerce-theme-preview__toolbar{background:#fff;flex-direction:row;display:flex;height:60px;border-bottom:1px solid #dcdcde;padding-left:16px;padding-right:16px;align-items:center}.woocommerce-theme-preview .woocommerce-theme-preview__toolbar .is-button.is-primary{height:40px;margin:0}@media(max-width:782px){.woocommerce-theme-preview .woocommerce-theme-preview__toolbar .is-button.is-primary{margin-left:auto}}.woocommerce-theme-preview .woocommerce-theme-preview__theme-name{padding-left:16px;color:#1d2327;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:50%}.woocommerce-theme-preview .woocommerce-theme-preview__close{padding:0 16px 0 0;color:#646970}.woocommerce-theme-preview .woocommerce-theme-preview__devices{margin-left:auto;margin-right:16px}.woocommerce-theme-preview .woocommerce-theme-preview__devices .woocommerce-theme-preview__device{padding:12px;color:#646970;margin:0;border-radius:50%}.woocommerce-theme-preview .woocommerce-theme-preview__devices .woocommerce-theme-preview__device.is-selected,.woocommerce-theme-preview .woocommerce-theme-preview__devices .woocommerce-theme-preview__device:focus{background:#646970;color:#fff}@media(max-width:782px){.woocommerce-theme-preview .woocommerce-theme-preview__devices{display:none}}.woocommerce-theme-preview .woocommerce-web-preview{flex:1;padding:40px 16px;overflow:scroll}.woocommerce-theme-preview .woocommerce-web-preview .woocommerce-web-preview__iframe-wrapper{height:100%;border-radius:3px;box-shadow:0 2px 1px -1px rgba(0,0,0,.2),0 1px 1px 0 rgba(0,0,0,.14),0 1px 3px 0 rgba(0,0,0,.12);overflow:hidden;margin:0 auto}.woocommerce-theme-preview .woocommerce-web-preview .woocommerce-web-preview__iframe-wrapper iframe{display:block}.woocommerce-theme-preview .woocommerce-web-preview.is-mobile .woocommerce-web-preview__iframe-wrapper{max-width:360px}.woocommerce-theme-preview .woocommerce-web-preview.is-tablet .woocommerce-web-preview__iframe-wrapper{max-width:768px}.woocommerce-theme-preview .woocommerce-web-preview.is-desktop{width:100%;padding:0}.woocommerce-theme-preview .woocommerce-web-preview.is-desktop .woocommerce-web-preview__iframe-wrapper{border-radius:0;box-shadow:none}.woocommerce-theme-preview-active{overflow:hidden}.woocommerce-theme-preview-active .woocommerce-profile-wizard__header{display:none}:root{--wp-admin-theme-color:#007cba;--wp-admin-theme-color-darker-10:#006ba1;--wp-admin-theme-color-darker-20:#005a87}body.admin-color-light{--wp-admin-theme-color:#0085ba;--wp-admin-theme-color-darker-10:#0073a1;--wp-admin-theme-color-darker-20:#006187}body.admin-color-modern{--wp-admin-theme-color:#3858e9;--wp-admin-theme-color-darker-10:#2145e6;--wp-admin-theme-color-darker-20:#183ad6}body.admin-color-blue{--wp-admin-theme-color:#096484;--wp-admin-theme-color-darker-10:#07526c;--wp-admin-theme-color-darker-20:#064054}body.admin-color-coffee{--wp-admin-theme-color:#46403c;--wp-admin-theme-color-darker-10:#383330;--wp-admin-theme-color-darker-20:#2b2724}body.admin-color-ectoplasm{--wp-admin-theme-color:#523f6d;--wp-admin-theme-color-darker-10:#46365d;--wp-admin-theme-color-darker-20:#3a2c4d}body.admin-color-midnight{--wp-admin-theme-color:#e14d43;--wp-admin-theme-color-darker-10:#dd382d;--wp-admin-theme-color-darker-20:#d02c21}body.admin-color-ocean{--wp-admin-theme-color:#627c83;--wp-admin-theme-color-darker-10:#576e74;--wp-admin-theme-color-darker-20:#4c6066}body.admin-color-sunrise{--wp-admin-theme-color:#dd823b;--wp-admin-theme-color-darker-10:#d97426;--wp-admin-theme-color-darker-20:#c36922}.woocommerce-profile-wizard__body .woocommerce-profile-wizard__step-header{text-align:center;margin:16px 0 24px}.woocommerce-profile-wizard__body .woocommerce-profile-wizard__step-header h2{margin-bottom:4px;color:#1e1e1e}.woocommerce-profile-wizard__body .woocommerce-profile-wizard__step-header p{color:#757575;display:flex;align-items:center;justify-content:center;line-height:1.5em}.woocommerce-profile-wizard__body .woocommerce-profile-wizard__step-header p .woocommerce-profile-wizard__tooltip-icon{height:16px}.woocommerce-profile-wizard__body .woocommerce-profile-wizard__header{height:60px;border-bottom:1px solid #dcdcde;display:flex;align-items:center;justify-content:center;background:#fff}.woocommerce-profile-wizard__body .woocommerce-profile-wizard__header-subtitle{font-weight:400;text-align:center;color:#757575;font-size:16px;line-height:24px;margin-top:8px;margin-bottom:32px;margin-right:8px;display:flex;justify-content:center}.woocommerce-profile-wizard__body .woocommerce-profile-wizard__intro-paragraph{margin-top:5px;margin-bottom:18px}.woocommerce-profile-wizard__body .woocommerce-profile-wizard__container{margin:36px auto 16px;text-align:left}.woocommerce-profile-wizard__body .woocommerce-profile-wizard__container>*{max-width:504px;margin-left:auto;margin-right:auto}@media(max-width:782px){.woocommerce-profile-wizard__body .woocommerce-profile-wizard__container{padding-left:16px;padding-right:16px;margin-bottom:72px;margin-top:0}}.woocommerce-profile-wizard__body .woocommerce-profile-wizard__container .components-popover__content>div{padding:16px 24px}.woocommerce-profile-wizard__body .woocommerce-profile-wizard__container .woocommerce-profile-wizard__footer{margin:34px auto;display:flex;justify-content:center}.woocommerce-profile-wizard__body .woocommerce-profile-wizard__container .woocommerce-profile-wizard__footer-link{display:flex;text-decoration:none}.woocommerce-profile-wizard__body .woocommerce-profile-wizard__container .woocommerce-profile-wizard__footnote{max-width:424px;margin:32px auto 25px}.woocommerce-profile-wizard__body .woocommerce-profile-wizard__container .woocommerce-profile-wizard__footnote p{color:#757575;text-align:center;margin-bottom:12px}.woocommerce-profile-wizard__body #woocommerce-layout__primary{text-align:center;margin:0;width:100%}.woocommerce-profile-wizard__body .woocommerce-layout .woocommerce-layout__main{padding-right:0}.woocommerce-profile-wizard__body .woocommerce-profile-wizard__error{display:block;padding:16px 24px;font-size:12px;color:#d63638}.woocommerce-profile-wizard__body .woocommerce-profile-wizard__benefit{display:flex}.woocommerce-profile-wizard__body .woocommerce-profile-wizard__benefit svg:first-child{width:24px;min-width:24px;margin-right:24px}.woocommerce-profile-wizard__body .woocommerce-profile-wizard__benefit .woocommerce-profile-wizard__benefit-title{font-size:16px;font-weight:400;margin-top:0;margin-bottom:8px}.woocommerce-profile-wizard__body .woocommerce-profile-wizard__benefit .woocommerce-profile-wizard__benefit-content{margin-left:16px}.woocommerce-profile-wizard__body .woocommerce-profile-wizard__benefit .woocommerce-profile-wizard__benefit-content p{padding-bottom:16px;margin-top:0;border-bottom:1px solid #dcdcde;font-size:14px}.woocommerce-profile-wizard__body .woocommerce-profile-wizard__benefit .woocommerce-profile-wizard__benefit-toggle{padding-top:36px;margin-left:16px}.woocommerce-profile-wizard__body .woocommerce-profile-wizard__benefit:last-child p{border-bottom:0;margin-bottom:0}.woocommerce-profile-wizard__body .woocommerce-profile-wizard__business-extension{background:#f6f6f6;height:100%;padding:12px 4px}.woocommerce-profile-wizard__body .woocommerce-profile-wizard__business-extension img{box-sizing:unset;max-width:100px;max-height:50%;vertical-align:middle}.woocommerce-profile-wizard__body .woocommerce-profile-wizard__tracking .woocommerce-profile-wizard__tracking-checkbox{margin-top:16px}.woocommerce-profile-wizard__body .woocommerce-profile-wizard__tracking .components-form-toggle{display:none}@media(max-width:782px){.woocommerce-profile-wizard__body .woocommerce-profile-wizard__tracking{display:flex;flex-direction:row-reverse;align-items:center;justify-content:flex-end}.woocommerce-profile-wizard__body .woocommerce-profile-wizard__tracking .components-form-toggle{display:inline-block}.woocommerce-profile-wizard__body .woocommerce-profile-wizard__tracking .components-checkbox-control__input{display:none}}.woocommerce-profile-wizard__body .woocommerce-profile-wizard__checkbox{margin-top:0;margin-bottom:0;position:relative;padding:12px 24px;min-height:62px;border-bottom:1px solid #f0f0f0;display:flex;align-items:center}.woocommerce-profile-wizard__body .woocommerce-profile-wizard__checkbox .components-base-control{position:relative}.woocommerce-profile-wizard__body .woocommerce-profile-wizard__checkbox .components-base-control__field{width:100%;margin:0}.woocommerce-profile-wizard__body .woocommerce-profile-wizard__checkbox label.components-checkbox-control__label{font-size:16px;margin-left:0}.woocommerce-profile-wizard__body .woocommerce-profile-wizard__checkbox .components-base-control__help{margin-left:48px;font-style:normal;color:#949494;font-size:14px;line-height:20px;margin-top:3px;margin-bottom:0}.woocommerce-profile-wizard__body .woocommerce-profile-wizard__checkbox svg.dashicon.components-checkbox-control__checked{left:1px;top:-1px}@media(max-width:600px){.woocommerce-profile-wizard__body svg.dashicon.components-checkbox-control__checked{left:-2px;top:-1px;width:21px;height:21px}}.woocommerce-profile-wizard__body .woocommerce-select-control__control{margin:16px 0;padding-right:40px;box-shadow:0 2px 6px rgba(0,0,0,.05)}.woocommerce-profile-wizard__body .woocommerce-select-control__control.is-active{border-color:#007cba;border-color:var(--wp-admin-theme-color)}.woocommerce-profile-wizard__body .woocommerce-select-control__control .components-base-control__label{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:calc(100% - 56px)}.woocommerce-profile-wizard__body .woocommerce-select-control__control:after{display:block;pointer-events:none;cursor:pointer;position:absolute;float:right;line-height:56px;font-family:dashicons,sans-serif;font-size:20px;content:"";z-index:1;height:24px;width:24px;margin-top:0;top:0;right:16px;bottom:16px;color:#000}.woocommerce-profile-wizard__body #wpadminbar{display:none}.woocommerce-profile-wizard__body #wpbody{padding-top:0}.woocommerce-profile-wizard__plugins-card .woocommerce-profile-wizard__plugins-actions{text-align:left;margin-left:44px}.woocommerce-profile-wizard__plugins-card .woocommerce-profile-wizard__plugins-actions button.is-button{height:40px;min-width:auto;display:initial;margin:16px 12px 0 0}.woocommerce-profile-wizard__header svg>g{transform:none}@media(max-width:782px){.woocommerce-profile-wizard__header{position:fixed;z-index:999;width:100%;bottom:0;border-top:1px solid #dcdcde;border-bottom:none}}.woocommerce-profile-wizard__header .woocommerce-stepper{margin:0 16px;width:100%}.woocommerce-profile-wizard__header .woocommerce-stepper__steps{margin:0}.woocommerce-profile-wizard__tooltip-icon{color:#50575e;display:flex;align-items:center;margin-left:4px;cursor:help}.woocommerce-business-extensions{display:flex;align-items:center;width:100%}.woocommerce-business-extensions label{display:flex;align-items:center}.woocommerce-business-extensions .components-checkbox-control__input-container{margin-right:16px}.woocommerce-business-extensions .woocommerce-business-extensions__label-subtext{display:block;color:#949494}.woocommerce-business-extensions .woocommerce-business-extensions__popover-wrapper{margin-left:auto}woocommerce-admin/dist/chunks/31.style.css000064400000114430151335517650014521 0ustar00.woocommerce-layout__activity-panel-header{height:50px;background:#e0e0e0;padding:16px;display:flex;justify-content:space-between;align-items:center}@media(min-width:783px){.woocommerce-layout__activity-panel-header{padding:16px 24px}}.woocommerce-layout__activity-panel-header h3{font-size:13px;font-weight:600;line-height:16px;margin:0;padding:0}.woocommerce-layout__activity-panel-header .woocommerce-ellipsis-menu__toggle.components-button:not(:disabled):not([aria-disabled=true]):focus,.woocommerce-layout__activity-panel-header .woocommerce-ellipsis-menu__toggle.components-button:not(:disabled):not([aria-disabled=true]):hover{box-shadow:none;border-radius:10px;background:#ccc}.woocommerce-layout__inbox-title{color:#1e1e1e;display:flex;align-items:center}.woocommerce-layout__inbox-subtitle{color:#757575}.woocommerce-layout__inbox-badge{margin-left:6px;background-color:#757575;border-radius:13px;padding:0 6px;color:#fff;display:inline-block;text-align:center;vertical-align:top}.woocommerce-homescreen .woocommerce-activity-panel{background:transparent;border:0}.woocommerce-homescreen .woocommerce-activity-panel .components-panel__body{background:#fff;border:1px solid #e0e0e0}.woocommerce-homescreen .woocommerce-activity-panel .components-panel__body.is-opened{margin-bottom:24px}.woocommerce-homescreen .woocommerce-activity-panel.components-panel>.components-panel__body:last-child,.woocommerce-homescreen .woocommerce-activity-panel .components-panel__body.is-opened .components-panel__body-toggle{border-bottom:1px solid #e0e0e0}.woocommerce-homescreen .woocommerce-activity-panel .components-panel__row{margin:0 -16px -16px}.woocommerce-homescreen .woocommerce-activity-panel .components-panel__row>div{width:100%}.woocommerce-homescreen .woocommerce-activity-panel .components-panel__body-toggle{border-radius:0}.woocommerce-homescreen .woocommerce-activity-panel .components-panel__body-toggle:disabled{opacity:1}.woocommerce-homescreen .woocommerce-activity-panel .woocommerce-activity-panel{margin-bottom:24px}.woocommerce-homescreen .woocommerce-activity-panel .components-panel__body-title p{margin-right:16px}.woocommerce-homescreen .woocommerce-activity-panel .woocommerce-activity-card{padding:20px var(--main-gap) var(--main-gap)}.woocommerce-homescreen .woocommerce-activity-panel .woocommerce-activity-card:not(:last-of-type){border-bottom:1px solid #e0e0e0}.woocommerce-homescreen .woocommerce-activity-panel .woocommerce-activity-card__header{margin-bottom:12px}.woocommerce-homescreen .woocommerce-activity-panel .woocommerce-empty-activity-card{margin:0;background:unset;text-align:center;padding:24px var(--main-gap) 4px}.woocommerce-homescreen .woocommerce-activity-panel .woocommerce-empty-activity-card h4{color:#1e1e1e}.woocommerce-homescreen .woocommerce-activity-panel .woocommerce-layout__activity-panel-outbound-link{display:flex;justify-content:space-between;align-items:center;height:50px;border-bottom:1px solid #f0f0f0;padding:16px 24px;padding:16px var(--main-gap);font-size:13px;font-weight:500;line-height:18px;margin:0;text-decoration:none}.woocommerce-homescreen .woocommerce-activity-panel .woocommerce-layout__activity-panel-outbound-link .gridicon{display:none}.woocommerce-homescreen .woocommerce-activity-panel .woocommerce-layout__activity-panel-outbound-link:active,.woocommerce-homescreen .woocommerce-activity-panel .woocommerce-layout__activity-panel-outbound-link:hover{background-color:#f0f0f0}.woocommerce-homescreen .woocommerce-activity-panel .woocommerce-layout__activity-panel-outbound-link:focus{background-color:#f0f0f0;box-shadow:inset 0 0 0 1px #5b9dd9,inset 0 0 0 2px #f0f0f0}.woocommerce-homescreen .woocommerce-activity-panel .woocommerce-layout__activity-panel-outbound-link:active .gridicon,.woocommerce-homescreen .woocommerce-activity-panel .woocommerce-layout__activity-panel-outbound-link:focus .gridicon,.woocommerce-homescreen .woocommerce-activity-panel .woocommerce-layout__activity-panel-outbound-link:hover .gridicon{display:initial}.woocommerce-homescreen .woocommerce-activity-panel .woocommerce-layout__activity-panel-empty{border-top:1px solid #e0e0e0;border-bottom:0}.woocommerce-homescreen .woocommerce-activity-panel .woocommerce-activity-card__button:focus{box-shadow:unset;outline:unset;border:1px solid #e0e0e0}.woocommerce-activity-panel .woocommerce-activity-card{position:relative;padding:24px;padding:var(--main-gap);background:#fff;border-bottom:1px solid #e0e0e0;color:#757575;font-size:13px;font-size:.8125rem}.woocommerce-activity-panel .woocommerce-activity-card:not(.woocommerce-empty-activity-card){display:grid;grid-template-columns:50px 1fr;grid-template-areas:"icon header" "icon body" "icon actions"}.woocommerce-activity-panel .woocommerce-activity-card__button{display:block;height:unset;background:none;align-items:unset;transition:unset;text-align:left;width:100%;padding:0}.woocommerce-activity-card__unread{position:absolute;top:18px;top:calc(var(--main-gap) - 6px);right:18px;right:calc(var(--main-gap) - 6px);width:6px;height:6px;border-radius:50%;background:#ca4a1f}.woocommerce-activity-card__icon{-ms-grid-row:1;-ms-grid-row-span:3;-ms-grid-column:1;grid-area:icon;fill:#e0e0e0}.woocommerce-activity-card__header{margin-bottom:16px;display:flex;flex-direction:column}.woocommerce-activity-card__header .woocommerce-activity-card__title{margin:0;font-size:14px;font-size:.875rem;order:2}.woocommerce-empty-activity-card .woocommerce-activity-card__header .woocommerce-activity-card__title{color:#1e1e1e;font-style:normal;line-height:24px;font-weight:400}.woocommerce-activity-card__button .woocommerce-activity-card__header .woocommerce-activity-card__title{margin-bottom:8px}.woocommerce-activity-card__header .woocommerce-activity-card__title a{text-decoration:none}.woocommerce-activity-card__header .woocommerce-activity-card__date{color:#757575;font-size:12px;font-size:.75rem;margin-bottom:12px;order:1}.woocommerce-activity-card__header .woocommerce-activity-card__subtitle{order:3}.woocommerce-activity-card__button .woocommerce-activity-card__header .woocommerce-activity-card__subtitle{margin-bottom:4px}@media(min-width:783px){.woocommerce-activity-card__header{-ms-grid-row:1;-ms-grid-column:2;grid-area:header;display:grid;grid-template:"title date" "subtitle date"/1fr auto}.woocommerce-activity-panel .woocommerce-activity-card.woocommerce-order-activity-card>.woocommerce-activity-card__header{-ms-grid-row:1;-ms-grid-column:1}.woocommerce-activity-card__header .woocommerce-activity-card__title{grid-area:title}.woocommerce-activity-card__header .woocommerce-activity-card__date{display:block;grid-area:date;justify-self:end;margin-bottom:0}.woocommerce-activity-card__header .woocommerce-activity-card__subtitle{grid-area:subtitle}}@media (min-width:783px){.woocommerce-activity-card__header .woocommerce-activity-card__title{-ms-grid-row:1;-ms-grid-column:1}.woocommerce-activity-card__header .woocommerce-activity-card__date{-ms-grid-row:1;-ms-grid-row-span:2;-ms-grid-column:2}.woocommerce-activity-card__header .woocommerce-activity-card__subtitle{-ms-grid-row:2;-ms-grid-column:1}}.woocommerce-activity-card__body{-ms-grid-row:2;-ms-grid-column:2;grid-area:body}.woocommerce-activity-panel .woocommerce-activity-card.woocommerce-order-activity-card>.woocommerce-activity-card__body{-ms-grid-row:2;-ms-grid-column:1}.woocommerce-activity-card__body>p:first-child{margin-top:0}.woocommerce-activity-card__body>p:last-child{margin-bottom:0}.woocommerce-empty-activity-card .woocommerce-activity-card__body{color:#757575;font-style:normal;font-weight:400;font-size:13px;font-size:.8125rem;line-height:20px}.woocommerce-activity-card__actions{-ms-grid-row:3;-ms-grid-column:2;grid-area:actions;margin-top:16px}.woocommerce-activity-panel .woocommerce-activity-card.woocommerce-order-activity-card>.woocommerce-activity-card__actions{-ms-grid-row:3;-ms-grid-column:1}.woocommerce-activity-card__actions>*+*{margin-left:.5em}.woocommerce-activity-card__actions .components-button{height:24px;padding:4px 10px;font-size:11px;font-size:.6875rem}.woocommerce-activity-card__actions .components-button.is-destructive:not(:hover){box-shadow:none}.woocommerce-activity-card.is-loading .is-placeholder{animation:loading-fade 1.6s ease-in-out infinite;background-color:#f0f0f0;color:transparent;display:inline-block;height:16px}.woocommerce-activity-card.is-loading .is-placeholder:after{content:" "}@media screen and (prefers-reduced-motion:reduce){.woocommerce-activity-card.is-loading .is-placeholder{animation:none}}.woocommerce-activity-card.is-loading .woocommerce-activity-card__title{width:80%}.woocommerce-activity-card.is-loading .woocommerce-activity-card__subtitle{margin-top:4px}.woocommerce-activity-card.is-loading .woocommerce-activity-card__date{width:100%;margin-bottom:16px}@media(min-width:783px){.woocommerce-activity-card.is-loading .woocommerce-activity-card__date{text-align:right;margin-bottom:0}}.woocommerce-activity-card.is-loading .woocommerce-activity-card__date .is-placeholder{width:68px}.woocommerce-activity-card.is-loading .woocommerce-activity-card__icon{margin-right:24px;margin-right:var(--main-gap)}.woocommerce-activity-card.is-loading .woocommerce-activity-card__icon .is-placeholder{height:33px;width:33px}.woocommerce-activity-card.is-loading .woocommerce-activity-card__body .is-placeholder{width:100%;margin-bottom:4px}.woocommerce-activity-card.is-loading .woocommerce-activity-card__body .is-placeholder:last-of-type{width:65%;margin-bottom:0}.woocommerce-activity-card.is-loading .woocommerce-activity-card__actions .is-placeholder{width:91px;height:24px}.woocommerce-activity-panel .woocommerce-activity-card.woocommerce-order-activity-card{grid-template-columns:1fr;grid-template-areas:"header" "body" "actions"}.woocommerce-activity-panel .woocommerce-activity-card.woocommerce-order-activity-card .woocommerce-activity-card__icon{display:none}.woocommerce-activity-panel .woocommerce-activity-card.woocommerce-order-activity-card .woocommerce-flag{display:inline-block}.woocommerce-activity-panel .woocommerce-activity-card.woocommerce-order-activity-card .woocommerce-activity-card__subtitle span+span:before{content:" • "}.woocommerce-activity-panel .woocommerce-activity-card.woocommerce-inbox-activity-card{grid-template-columns:72px 1fr;height:100%;opacity:1;padding:24px;padding:var(--main-gap)}@media screen and (prefers-reduced-motion:no-preference){.woocommerce-activity-panel .woocommerce-activity-card.woocommerce-inbox-activity-card{transition:opacity .3s,height 0s,padding 0s}}@media(max-width:782px){.woocommerce-activity-panel .woocommerce-activity-card.woocommerce-inbox-activity-card{grid-template-columns:64px 1fr}}.woocommerce-activity-panel .woocommerce-activity-card.woocommerce-inbox-activity-card .woocommerce-activity-card__header{margin-bottom:12px}.woocommerce-activity-panel .woocommerce-activity-card.woocommerce-inbox-activity-card.actioned{height:0;opacity:0;padding:0}@media screen and (prefers-reduced-motion:no-preference){.woocommerce-activity-panel .woocommerce-activity-card.woocommerce-inbox-activity-card.actioned{transition:opacity .3s,height 0s .3s,padding 0s .3s}}.woocommerce-stock-activity-card__image-overlay__product{height:33px;position:relative;width:33px}.woocommerce-stock-activity-card__image-overlay__product.is-placeholder:before{background-color:#757575;border-radius:2px;content:"";position:absolute;left:0;right:0;bottom:0;top:0;opacity:.1}@media screen and (prefers-reduced-motion:no-preference){.woocommerce-stock-activity-card{transition:opacity .3s}}.woocommerce-stock-activity-card.is-dimmed{opacity:.7}.woocommerce-stock-activity-card .woocommerce-stock-activity-card__stock-quantity{background:#f0f0f0;color:#757575;padding:3px 8px;border-radius:3px}.woocommerce-stock-activity-card .woocommerce-stock-activity-card__stock-quantity.out-of-stock{color:#d94f4f}.woocommerce-stock-activity-card .woocommerce-stock-activity-card__edit-quantity{display:inline-flex;width:50px;margin-right:10px}.woocommerce-stock-activity-card .woocommerce-stock-activity-card__edit-quantity input{border-radius:2px;height:30px}.woocommerce-stock-activity-card .woocommerce-stock-activity-card__edit-quantity input[type=number]{-moz-appearance:textfield}.woocommerce-stock-activity-card .woocommerce-stock-activity-card__edit-quantity input[type=number]::-webkit-inner-spin-button,.woocommerce-stock-activity-card .woocommerce-stock-activity-card__edit-quantity input[type=number]::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}.woocommerce-stock-activity-card .woocommerce-activity-card__subtitle{color:#757575;font-size:12px;font-size:.75rem}.woocommerce-empty-activity-card{background:#f0f0f0;margin:20px;border-bottom:unset}.woocommerce-activity-panel .woocommerce-order-empty__success-icon{font-size:36px}.woocommerce-activity-panel .woocommerce-activity-card.woocommerce-order-activity-card .woocommerce-activity-card__header{margin-bottom:4px}.woocommerce-activity-panel .woocommerce-activity-card.woocommerce-order-activity-card .woocommerce-activity-card__header .woocommerce-activity-card__title.is-placeholder{width:45%}.woocommerce-activity-panel .woocommerce-activity-card.woocommerce-order-activity-card .woocommerce-activity-card__body>.is-placeholder{width:30%}.woocommerce-activity-panel .woocommerce-activity-card.woocommerce-order-activity-card .woocommerce-activity-card__actions>.is-placeholder{height:24px;margin-top:4px;width:65px}.woocommerce-activity-panel .woocommerce-activity-card.woocommerce-order-activity-card .woocommerce-order-activity-card{cursor:pointer}.woocommerce-review-activity-card .woocommerce-rating{margin-top:4px}.woocommerce-review-activity-card .woocommerce-rating .gridicon{fill:#ffb900}.woocommerce-review-activity-card .woocommerce-activity-card__body>span>p:first-child{margin-top:0}.woocommerce-review-activity-card .woocommerce-activity-card__body>span>p:last-child{margin-bottom:0}.woocommerce-review-activity-card .woocommerce-review-activity-card__verified{display:inline-flex;margin-left:4px;position:relative;top:4px;color:#4ab866;font-size:12px;font-size:.75rem}.woocommerce-review-activity-card .woocommerce-review-activity-card__verified svg{width:18px;height:18px;fill:#4ab866}@media(max-width:782px){.woocommerce-review-activity-card .woocommerce-review-activity-card__image-overlay{margin-top:4px}}.woocommerce-review-activity-card.woocommerce-activity-card{padding:16px 24px}.woocommerce-review-activity-card .woocommerce-activity-card__header .woocommerce-activity-card__title{line-height:20px}#activity-panel-inbox{margin:0 24px}.woocommerce-layout__inbox-panel-header{padding:24px}.woocommerce-homepage-column .woocommerce-layout__inbox-panel-header{padding:0 24px}.woocommerce-inbox-message-enter{opacity:0;max-height:0;transform:translateX(50%)}.woocommerce-inbox-message-enter-active{transition:opacity .5s,transform .5s,max-height .5s}.woocommerce-inbox-message-enter-active,.woocommerce-inbox-message-exit{opacity:1;max-height:100vh;transform:translateX(0)}.woocommerce-inbox-message-exit-active{opacity:0;max-height:0;transform:translateX(50%);transition:opacity .5s,transform .5s,max-height .5s}.woocommerce-navigation-intro-modal{width:670px}@media(max-width:782px){.woocommerce-navigation-intro-modal{width:350px}}.woocommerce-navigation-intro-modal .components-guide__page-control{order:3;margin:16px 0}.woocommerce-navigation-intro-modal .components-guide__page-control li{margin:0}.woocommerce-navigation-intro-modal .components-modal__header{display:none}.woocommerce-navigation-intro-modal .components-guide__container{margin-top:0}.woocommerce-navigation-intro-modal .components-guide__footer{box-sizing:border-box;margin:0;height:0;overflow:visible}.woocommerce-navigation-intro-modal .components-guide__footer .components-button{position:absolute;bottom:100%;margin-bottom:16px}.woocommerce-navigation-intro-modal .components-guide__footer .components-guide__back-button{display:none}.woocommerce-navigation-intro-modal.components-modal__frame.components-guide{height:auto}.woocommerce-navigation-intro-modal .woocommerce-navigation-intro-modal__page-wrapper{display:grid;grid-template-columns:1fr 1fr}.woocommerce-navigation-intro-modal .woocommerce-navigation-intro-modal__page-wrapper img{max-width:100%}@media(max-width:782px){.woocommerce-navigation-intro-modal .woocommerce-navigation-intro-modal__page-wrapper{grid-template-columns:1fr}.woocommerce-navigation-intro-modal .woocommerce-navigation-intro-modal__page-wrapper .woocommerce-navigation-intro-modal__image-wrapper{grid-row:1;max-height:328px;overflow:hidden}}.woocommerce-navigation-intro-modal .woocommerce-navigation-intro-modal__page-text{padding:24px;display:flex;flex-direction:column;justify-content:center}.woocommerce-navigation-intro-modal .woocommerce-navigation-intro-modal__page-text h2{font-weight:700;margin-bottom:8px}.woocommerce-stats-overview .woocommerce-card__body{padding:0}.woocommerce-stats-overview .woocommerce-summary{margin:0}.woocommerce-stats-overview__more-btn{display:inline-block;padding:16px}.woocommerce-stats-overview__tabs .components-tab-panel__tabs{display:flex;justify-content:space-between;border-bottom:1px solid #e0e0e0}.woocommerce-stats-overview__tabs .components-tab-panel__tabs .components-button{width:33.33%;padding-right:24px;padding-left:24px}.woocommerce-stats-overview__stats{margin:0}.woocommerce-stats-overview__stats .woocommerce-summary__item-container{width:50%;display:inline-block}.woocommerce-stats-overview__stats.is-even .woocommerce-summary__item-container:nth-last-of-type(2) .woocommerce-summary__item,.woocommerce-stats-overview__stats .woocommerce-summary__item-container:last-of-type .woocommerce-summary__item{border-bottom:none}.woocommerce-stats-overview__stats .woocommerce-summary__item-container:nth-of-type(2n) .woocommerce-summary__item{border-right:none}.woocommerce-stats-overview__stats .woocommerce-summary__item{background-color:#fff}.woocommerce-stats-overview__stats .woocommerce-summary__item:active,.woocommerce-stats-overview__stats .woocommerce-summary__item:hover{background-color:#f0f0f0}article.woocommerce-stats-overview__install-jetpack-promo .woocommerce-stats-overview__install-jetpack-promo__content{padding:16px 24px}article.woocommerce-stats-overview__install-jetpack-promo h2{color:#1e1e1e;font-size:16px;font-size:1rem;font-style:normal;line-height:1.5;font-weight:400;margin:8px 0}article.woocommerce-stats-overview__install-jetpack-promo p{color:#757575;font-style:normal;font-weight:400;font-size:14px;font-size:.875rem;line-height:20px;margin:8px 0}article.woocommerce-stats-overview__install-jetpack-promo footer{padding:16px 24px;border-top:1px solid #f0f0f0;border-bottom:1px solid #f0f0f0}article.woocommerce-stats-overview__install-jetpack-promo footer button{margin-left:8px}article.woocommerce-stats-overview__install-jetpack-promo footer button:first-child{margin-left:0}.woocommerce-store-management-links__card-body.is-size-custom{padding:24px 0 8px}.woocommerce-quick-links__category{display:flex;flex-flow:row wrap;margin-bottom:8px}.woocommerce-quick-links__category .woocommerce-quick-links__category-header{margin:0 24px 8px;text-transform:uppercase;color:#757575;line-height:16px;font-size:11px;flex:1 100%}.woocommerce-quick-links__item{display:flex;flex:1 50%}.woocommerce-quick-links__item:hover{background-color:#f0f0f0}.woocommerce-quick-links__item .woocommerce-quick-links__item-link{width:100%;display:flex;align-items:center;text-decoration:none;padding:16px 27px 16px 24px}.woocommerce-quick-links__item .woocommerce-quick-links__item-link .woocommerce-quick-links__item-link__icon{fill:#007cba;fill:var(--wp-admin-theme-color)}.woocommerce-quick-links__item .woocommerce-quick-links__item-link .woocommerce-quick-links__item-link__text{margin-left:16px;flex:1;line-height:16px;font-size:13px}.woocommerce-homescreen.two-columns .woocommerce-quick-links__item{flex:1 100%}.woocommerce-task-dashboard__body .woocommerce-card__description{color:#646970}.woocommerce-task-dashboard__body .woocommerce-task-dashboard__container .woocommerce-task-payments{width:680px;margin:auto;max-width:100%}.woocommerce-task-dashboard__body .woocommerce-task-dashboard__container .woocommerce-task-card .wooocommerce-task-card__header{display:flex}.woocommerce-task-dashboard__body .woocommerce-task-dashboard__container .woocommerce-task-card .wooocommerce-task-card__header .woocommerce-badge{margin-left:16px}.woocommerce-task-dashboard__body .woocommerce-task-dashboard__container .woocommerce-task-card .woocommerce-list__item-text .woocommerce-pill{padding:1px 8px;margin-left:8px}.woocommerce-task-dashboard__body .woocommerce-task-dashboard__container .woocommerce-task-card .components-popover__content{min-width:unset}.woocommerce-task-dashboard__body .woocommerce-task-list__item-expandable-content,.woocommerce-task-dashboard__body .woocommerce-task__additional-info,.woocommerce-task-dashboard__body .woocommerce-task__estimated-time{color:#757575;font-weight:400;font-size:12px}.woocommerce-task-dashboard__body .woocommerce-task-list__item-expandable-content{font-size:13px}.woocommerce-task-dashboard__body #wpbody-content{position:relative}.woocommerce-task-dashboard__body .components-modal__screen-overlay{background:rgba(43,45,47,.4)}.woocommerce-task-dashboard__body .components-modal__frame .components-modal__header{border-bottom:0;margin-bottom:0}.woocommerce-task-dashboard__body .components-modal__frame .woocommerce-task-payments__stripe-error-wrapper{align-items:flex-end;flex-grow:1;display:flex;flex-direction:column}.woocommerce-shipping-rate{display:flex;padding-top:12px;padding-bottom:12px}.woocommerce-shipping-rate .woocommerce-shipping-rate__main{width:100%}.woocommerce-shipping-rate .woocommerce-shipping-rate__icon{padding-top:16px;margin-right:24px}.woocommerce-shipping-rate .woocommerce-shipping-rate__name{align-items:center;display:flex;padding-top:16px;font-size:16px;line-height:22px;color:#1d2327;margin-bottom:12px;border-top:1px solid #dcdcde}.woocommerce-shipping-rate .woocommerce-shipping-rate__name .components-form-toggle{margin-left:auto;height:18px}.woocommerce-shipping-rate .woocommerce-shipping-rate__control-wrapper .components-base-control{margin-bottom:0}.woocommerce-shipping-rate .woocommerce-shipping-rate__control-wrapper .components-base-control__label{display:block;position:relative;top:-8px;width:100%;font-size:12px}.woocommerce-shipping-rate .woocommerce-shipping-rate__control-wrapper .text-control-with-affixes__prefix,.woocommerce-shipping-rate .woocommerce-shipping-rate__control-wrapper .text-control-with-affixes__suffix{font-size:16px;line-height:24px;color:#646970;border:0;padding:0;align-items:center;display:flex;top:-11px}.woocommerce-shipping-rate .woocommerce-shipping-rate__control-wrapper .components-text-control__input{position:relative;top:-11px}.woocommerce-shipping-rate .woocommerce-shipping-rate__control-wrapper .text-control-with-affixes__prefix{margin-right:4px}.woocommerce-shipping-rate .woocommerce-shipping-rate__control-wrapper .text-control-with-affixes__suffix{margin-left:4px}.woocommerce-task-tax__automated-tax-control{display:flex;align-items:center;margin-top:16px}.woocommerce-task-tax__automated-tax-control i{margin-left:16px;margin-right:24px}.woocommerce-task-tax__automated-tax-control .woocommerce-task-tax__automated-tax-control-inner{border-top:1px solid #dcdcde;display:flex;align-items:center;flex:1;font-size:16px;padding-top:16px;padding-bottom:16px}.woocommerce-task-tax__automated-tax-control .components-form-toggle{margin-left:auto}.woocommerce-task-tax__success{display:flex;flex-direction:column;align-items:center;padding:40px;text-align:center}.woocommerce-task-tax__success .woocommerce-task-tax__success-icon{font-size:48px;height:48px;align-items:center;display:flex}.woocommerce-task-tax__success #woocommerce-task-tax__success-message{font-size:32px;font-weight:400}.woocommerce-task-tax__success p{margin-top:0;font-size:16px}.woocommerce-task-payments .components-card+.components-card{margin-top:24px}.woocommerce-task-payments .woocommerce-task-payment__setup_required{display:flex;align-items:center;font-size:14px;margin-left:12px;font-weight:400;gap:3px}.woocommerce-task-payments .woocommerce-task-payment__setup_required>svg{fill:#efb854}.woocommerce-task-payments .components-card__header{font-size:20px;font-weight:400;line-height:28px;margin:0}.woocommerce-task-payments .woocommerce-task-payment__recommended-pill{border:1px solid #dcdcde;border-radius:28px;display:inline-block;font-size:13px;margin-left:12px;padding:1px 10px}.woocommerce-task-payments .woocommerce-task-payment__recommended-pill span{max-width:70px}.woocommerce-task-payments .components-card__divider:last-child{display:none}.woocommerce-task-payment-method>h3{margin:0;color:#1d2327}.woocommerce-task-payment-method p{font-size:14px;color:#646970;font-weight:400;margin-top:16px;margin-bottom:16px}.woocommerce-task-payment-method__fields{display:grid;grid-template-columns:1fr 1fr;grid-gap:0 16px;margin-bottom:8px}.woocommerce-task-payment-method__fields .components-base-control{margin-bottom:0}.woocommerce-task-dashboard__container .woocommerce-stepper button.components-button.is-primary{margin:0 8px 0 0}.woocommerce-task-dashboard__container button.components-button.is-link{margin:0;height:auto;color:#50575e;font-weight:400}.woocommerce-task-payments__paypal-auto-create-account{margin-top:16px;margin-bottom:16px}.woocommerce-task-card__prompt{width:100%;min-width:100%;margin-bottom:24px;margin-top:-4px;cursor:default}.woocommerce-task-card__prompt .components-snackbar__content{display:block;align-items:unset;justify-content:unset}.woocommerce-task-card__prompt .components-snackbar__content span{margin-left:-24px}.woocommerce-task-card__prompt .woocommerce-task-card__prompt-actions button.is-link,.woocommerce-task-card__prompt .woocommerce-task-card__prompt-actions button.is-link:active,.woocommerce-task-card__prompt .woocommerce-task-card__prompt-actions button.is-link:focus{color:#fff;margin-left:24px;background:transparent}.woocommerce-task-card__prompt .woocommerce-task-card__prompt-actions button.is-link:hover{color:#fff}.woocommerce-task-card__prompt .woocommerce-task-card__prompt-pointer{border-bottom:10px solid #1e1e1e;border-left:10px solid transparent;border-right:10px solid transparent;position:relative;width:0;height:0;display:inline-block;top:-30px}.woocommerce-task-card__prompt .woocommerce-task-card__prompt-content{display:flex;align-items:baseline;justify-content:space-between;max-height:10px;margin-left:24px;position:relative;top:-40px}.woocommerce-task-card__prompt .woocommerce-task-card__prompt-actions{margin-right:-16px}.woocommerce-task-card__prompt:hover .woocommerce-task-card__prompt-pointer{border-bottom-color:#1e1e1e}.woocommerce-task-card__section-controls{text-align:center}.woocommerce-task-dashboard__container .woocommerce-task-card.is-loading .woocommerce-card__body{border-top:1px solid #dcdcde}.woocommerce-task-dashboard__container .woocommerce-task-card.is-loading .is-placeholder{animation:loading-fade 1.6s ease-in-out infinite;background-color:#f0f0f0;color:transparent;display:inline-block;height:16px}.woocommerce-task-dashboard__container .woocommerce-task-card.is-loading .is-placeholder:after{content:" "}@media screen and (prefers-reduced-motion:reduce){.woocommerce-task-dashboard__container .woocommerce-task-card.is-loading .is-placeholder{animation:none}}.woocommerce-task-dashboard__container .woocommerce-task-card.is-loading .woocommerce-card__title .is-placeholder{width:70%;height:28px}.woocommerce-task-dashboard__container .woocommerce-task-card.is-loading .woocommerce-list__item-before .is-placeholder{height:36px;width:36px}.woocommerce-task-dashboard__container .woocommerce-task-card.is-loading .woocommerce-list__item-text{width:100%}.woocommerce-task-dashboard__container .woocommerce-task-card.is-loading .woocommerce-list__item-text .woocommerce-list__item-title .is-placeholder{height:22px;width:60%}.woocommerce-task-dashboard__container .woocommerce-task-card.is-loading .woocommerce-list__item-after .is-placeholder{height:18px;width:60px}.woocommerce-task-dashboard__container .woocommerce-task__caption{color:#757575;margin-top:16px}.components-guide.woocommerce__welcome-modal.woocommerce__welcome-from-calypso-modal{height:440px}.components-guide.woocommerce__welcome-modal.woocommerce__welcome-from-calypso-modal ul.components-guide__page-control{display:none}.components-guide.woocommerce__welcome-modal.woocommerce__welcome-from-calypso-modal .woocommerce__welcome-modal__page-content{margin-top:16px}.components-guide.woocommerce__welcome-modal{max-width:517px;height:460px}.components-guide.woocommerce__welcome-modal .components-modal__header{height:0}.components-guide.woocommerce__welcome-modal .components-modal__header .components-button{color:#fff}.components-guide.woocommerce__welcome-modal .components-guide__container{margin-top:0}.components-guide.woocommerce__welcome-modal .components-guide__container .woocommerce__welcome-modal__page-content{padding:0 24px}.components-guide.woocommerce__welcome-modal .components-guide__container .woocommerce__welcome-modal__page-content .woocommerce__welcome-modal__page-content__header{font-size:24px;line-height:32px;margin:0 0 24px}.components-guide.woocommerce__welcome-modal .components-guide__container .woocommerce__welcome-modal__page-content .woocommerce__welcome-modal__page-content__body{font-size:16px;line-height:24px;margin:0 0 24px}.components-guide.woocommerce__welcome-modal .components-guide__footer{padding:0;margin:0 24px 24px;justify-content:flex-end;width:auto}.components-guide.woocommerce__welcome-modal .components-guide__footer .components-guide__back-button,.components-guide.woocommerce__welcome-modal .components-guide__footer .components-guide__finish-button,.components-guide.woocommerce__welcome-modal .components-guide__footer .components-guide__forward-button{position:static;padding:0 16px;font-weight:500;font-size:14px;line-height:18px}.components-guide.woocommerce__welcome-modal .components-guide__footer .components-guide__back-button,.components-guide.woocommerce__welcome-modal .components-guide__footer .components-guide__forward-button{color:#007cba;color:var(--wp-admin-theme-color)}.components-guide.woocommerce__welcome-modal .components-guide__footer .components-guide__finish-button,.components-guide.woocommerce__welcome-modal .components-guide__footer .components-guide__forward-button{margin-left:10px}.components-guide.woocommerce__welcome-modal .components-guide__footer .components-guide__forward-button{box-shadow:inset 0 0 0 1px #007cba;box-shadow:inset 0 0 0 1px var(--wp-admin-theme-color);outline:1px solid transparent}.components-guide.woocommerce__welcome-modal .fill-theme-color{fill:#007cba;fill:var(--wp-admin-theme-color)}.woocommerce-page #wpcontent,.woocommerce-page.woocommerce_page_wc-admin #wpbody-content{overflow-x:inherit!important}.woocommerce-homescreen{display:flex;max-width:1032px;margin:0 auto;justify-content:space-between;flex-direction:column}.woocommerce-homescreen .woocommerce-task-dashboard__container{width:100%;margin-bottom:24px}.woocommerce-homescreen.two-columns{flex-direction:row}.woocommerce-homescreen.two-columns .woocommerce-homescreen-column{width:calc(50% - 12px);margin:0}@media(max-width:782px){.woocommerce-homescreen.two-columns .woocommerce-homescreen-column{width:100%;position:inherit;top:auto}}.woocommerce-homescreen.two-columns .your-store-today{display:block}@media(max-width:782px){.woocommerce-homescreen.two-columns{flex-direction:column}.woocommerce-homescreen.two-columns .your-store-today{display:none}}@media(max-width:782px){.woocommerce-homescreen{margin-left:-16px;margin-right:-16px}}.woocommerce-homescreen-column{width:682px;top:100px;margin:0 auto;align-self:flex-start}.woocommerce-homescreen-column>div{margin-bottom:24px}@media(max-width:782px){.woocommerce-homescreen-column{width:100%;position:inherit;top:auto}}.woocommerce-homescreen-card .components-card__header.is-size-large,.woocommerce-homescreen-card .components-card__header.is-size-medium{min-height:63px;min-height:unset;display:grid;grid-template-columns:auto 24px}.woocommerce-homescreen-card .components-card__header.is-size-large>*,.woocommerce-homescreen-card .components-card__header.is-size-medium>*{align-self:center}.woocommerce-homescreen-card .components-card__footer.is-size-large{padding:0 8px}.woocommerce-layout__inbox-panel-header.your-store-today{display:none}:root{--wp-admin-theme-color:#007cba;--wp-admin-theme-color-darker-10:#006ba1;--wp-admin-theme-color-darker-20:#005a87}body.admin-color-light{--wp-admin-theme-color:#0085ba;--wp-admin-theme-color-darker-10:#0073a1;--wp-admin-theme-color-darker-20:#006187}body.admin-color-modern{--wp-admin-theme-color:#3858e9;--wp-admin-theme-color-darker-10:#2145e6;--wp-admin-theme-color-darker-20:#183ad6}body.admin-color-blue{--wp-admin-theme-color:#096484;--wp-admin-theme-color-darker-10:#07526c;--wp-admin-theme-color-darker-20:#064054}body.admin-color-coffee{--wp-admin-theme-color:#46403c;--wp-admin-theme-color-darker-10:#383330;--wp-admin-theme-color-darker-20:#2b2724}body.admin-color-ectoplasm{--wp-admin-theme-color:#523f6d;--wp-admin-theme-color-darker-10:#46365d;--wp-admin-theme-color-darker-20:#3a2c4d}body.admin-color-midnight{--wp-admin-theme-color:#e14d43;--wp-admin-theme-color-darker-10:#dd382d;--wp-admin-theme-color-darker-20:#d02c21}body.admin-color-ocean{--wp-admin-theme-color:#627c83;--wp-admin-theme-color-darker-10:#576e74;--wp-admin-theme-color-darker-20:#4c6066}body.admin-color-sunrise{--wp-admin-theme-color:#dd823b;--wp-admin-theme-color-darker-10:#d97426;--wp-admin-theme-color-darker-20:#c36922}#klarna-kp-banner,.woocommerce-page:not(.woocommerce-embed-page) #klarna-banner{display:none}.woocommerce-dashboard__columns{display:grid;grid-template-columns:calc(50% - 12px) calc(50% - 12px);grid-column-gap:24px}.woocommerce-dashboard__columns>div:first-child{grid-column-start:1;grid-column-end:2;grid-row-start:1;grid-row-end:2}.woocommerce-dashboard__columns>div:nth-child(2){grid-column-start:2;grid-column-end:3;grid-row-start:1;grid-row-end:2}.woocommerce-dashboard__columns>div:nth-child(3){grid-column-start:1;grid-column-end:2;grid-row-start:2;grid-row-end:3}.woocommerce-dashboard__columns>div:nth-child(4){grid-column-start:2;grid-column-end:3;grid-row-start:2;grid-row-end:3}.woocommerce-dashboard__columns>div:nth-child(5){grid-column-start:1;grid-column-end:2;grid-row-start:3;grid-row-end:4}.woocommerce-dashboard__columns>div:nth-child(6){grid-column-start:2;grid-column-end:3;grid-row-start:3;grid-row-end:4}.woocommerce-dashboard__columns>div:nth-child(7){grid-column-start:1;grid-column-end:2;grid-row-start:4;grid-row-end:5}.woocommerce-dashboard__columns>div:nth-child(8){grid-column-start:2;grid-column-end:3;grid-row-start:4;grid-row-end:5}.woocommerce-dashboard__columns>div:nth-child(9){grid-column-start:1;grid-column-end:2;grid-row-start:5;grid-row-end:6}.woocommerce-dashboard__columns>div:nth-child(10){grid-column-start:2;grid-column-end:3;grid-row-start:5;grid-row-end:6}.woocommerce-dashboard__columns>div:nth-child(11){grid-column-start:1;grid-column-end:2;grid-row-start:6;grid-row-end:7}.woocommerce-dashboard__columns>div:nth-child(12){grid-column-start:2;grid-column-end:3;grid-row-start:6;grid-row-end:7}.woocommerce-dashboard__columns>div:nth-child(13){grid-column-start:1;grid-column-end:2;grid-row-start:7;grid-row-end:8}.woocommerce-dashboard__columns>div:nth-child(14){grid-column-start:2;grid-column-end:3;grid-row-start:7;grid-row-end:8}@media(max-width:960px){.woocommerce-dashboard__columns{grid-template-columns:100%}.woocommerce-dashboard__columns>div:first-child{grid-column-start:1;grid-column-end:2;grid-row-start:1;grid-row-end:2}.woocommerce-dashboard__columns>div:nth-child(2){grid-column-start:1;grid-column-end:2;grid-row-start:2;grid-row-end:3}.woocommerce-dashboard__columns>div:nth-child(3){grid-column-start:1;grid-column-end:2;grid-row-start:3;grid-row-end:4}.woocommerce-dashboard__columns>div:nth-child(4){grid-column-start:1;grid-column-end:2;grid-row-start:4;grid-row-end:5}.woocommerce-dashboard__columns>div:nth-child(5){grid-column-start:1;grid-column-end:2;grid-row-start:5;grid-row-end:6}.woocommerce-dashboard__columns>div:nth-child(6){grid-column-start:1;grid-column-end:2;grid-row-start:6;grid-row-end:7}.woocommerce-dashboard__columns>div:nth-child(7){grid-column-start:1;grid-column-end:2;grid-row-start:7;grid-row-end:8}.woocommerce-dashboard__columns>div:nth-child(8){grid-column-start:1;grid-column-end:2;grid-row-start:8;grid-row-end:9}.woocommerce-dashboard__columns>div:nth-child(9){grid-column-start:1;grid-column-end:2;grid-row-start:9;grid-row-end:10}.woocommerce-dashboard__columns>div:nth-child(10){grid-column-start:1;grid-column-end:2;grid-row-start:10;grid-row-end:11}.woocommerce-dashboard__columns>div:nth-child(11){grid-column-start:1;grid-column-end:2;grid-row-start:11;grid-row-end:12}.woocommerce-dashboard__columns>div:nth-child(12){grid-column-start:1;grid-column-end:2;grid-row-start:12;grid-row-end:13}.woocommerce-dashboard__columns>div:nth-child(13){grid-column-start:1;grid-column-end:2;grid-row-start:13;grid-row-end:14}.woocommerce-dashboard__columns>div:nth-child(14){grid-column-start:1;grid-column-end:2;grid-row-start:14;grid-row-end:15}}.woocommerce-dashboard__widget{display:flex;align-items:center;text-align:center}.woocommerce-dashboard__widget-item{flex:1}.woocommerce-dashboard-section__add-more{margin:0 auto;width:84px;padding:0 24px 24px}.woocommerce-dashboard-section__add-more .components-popover__content{padding:0 16px 8px}.woocommerce-dashboard-section__add-more>button svg{fill:#757575}.woocommerce-dashboard-section__add-more-choices{display:flex;justify-content:center}.woocommerce-dashboard-section__add-more-btn{display:flex;flex-direction:column;align-items:center;padding:16px;margin:8px}.woocommerce-dashboard-section__add-more-btn.components-button{height:auto}.woocommerce-dashboard-section__add-more-btn .store-performance__icon{transform:rotate(-45deg)}.woocommerce-dashboard-section__add-more-btn-title{color:#757575;padding-top:8px}.woocommerce-dashboard-section-controls{border-top:1px solid #f0f0f0;padding-top:8px}.woocommerce-dashboard-section-controls .icon-control{margin:0 8px 0 0;vertical-align:bottom;fill:#757575}.woocommerce-dashboard-section-controls .woocommerce-ellipsis-menu__item{padding-bottom:10px}.components-card .woocommerce-ellipsis-menu__toggle{padding:0}.woocommerce-task-dashboard__body .woocommerce-task-dashboard__container .woocommerce-task-card{max-width:680px;margin-left:auto;margin-right:auto;margin-bottom:24px}.woocommerce-task-dashboard__body .woocommerce-task-dashboard__container .woocommerce-task-card .components-card__header.is-size-large{padding-bottom:12px}.woocommerce-task-dashboard__body .woocommerce-task-dashboard__container .woocommerce-task-card .components-card__header.is-size-large .woocommerce-card__menu{margin-top:8px}woocommerce-admin/dist/chunks/profile-wizard.js000064400000225523151335517650015727 0ustar00(window.__wcAdmin_webpackJsonp=window.__wcAdmin_webpackJsonp||[]).push([[47],{277:function(e,t,o){"use strict";var r=o(0),s=o(8),n=Object(r.createElement)(s.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},Object(r.createElement)(s.Path,{d:"M6.5 12.4L12 8l5.5 4.4-.9 1.2L12 10l-4.5 3.6-1-1.2z"}));t.a=n},278:function(e,t,o){"use strict";var r=o(0),s=o(8),n=Object(r.createElement)(s.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},Object(r.createElement)(s.Path,{d:"M17.5 11.6L12 16l-5.5-4.4.9-1.2L12 14l4.5-3.6 1 1.2z"}));t.a=n},501:function(e,t,o){"use strict";o.d(t,"b",(function(){return l})),o.d(t,"a",(function(){return m}));var r=o(0),s=o(30),n=o(89),c=o.n(n),i=o(13);const a=c()(i.a),l=e=>{const t=a.getCurrencyConfig(),o=Object(s.applyFilters)("woocommerce_admin_report_currency",t,e);return c()(o)},m=Object(r.createContext)(a)},507:function(e,t,o){"use strict";o.d(t,"a",(function(){return s}));var r=o(7);function s(e){const{createNotice:t}=Object(r.dispatch)("core/notices");e.error_data&&e.errors&&Object.keys(e.errors).length?Object.keys(e.errors).forEach(o=>{t("error",e.errors[o].join(" "))}):e.message&&t(e.code?"error":"success",e.message)}},509:function(e,t,o){"use strict";var r=o(53);const s=["a","b","em","i","strong","p","br"],n=["target","href","rel","name","download"];t.a=e=>({__html:Object(r.sanitize)(e,{ALLOWED_TAGS:s,ALLOWED_ATTR:n})})},514:function(e,t,o){"use strict";var r=o(0),s=o(2),n=o(14),c=o(7),i=o(18),a=o.n(i),l=o(3),m=o(21),d=o(11),u=o(122);class p extends r.Component{constructor(e){super(e),this.state={isLoadingScripts:!1,isRequestStarted:!1}}async componentDidUpdate(e,t){const{hasErrors:o,isRequesting:r,onClose:n,onContinue:c,createNotice:i}=this.props,{isLoadingScripts:a,isRequestStarted:l}=this.state;if(!l)return;const m=!r&&!a&&(e.isRequesting||t.isLoadingScripts)&&!o,d=!r&&e.isRequesting&&o;m&&(n(),c()),d&&(i("error",Object(s.__)("There was a problem updating your preferences",'woocommerce')),n())}updateTracking({allowTracking:e}){const{updateOptions:t}=this.props;e&&"function"==typeof window.wcTracks.enable?(this.setState({isLoadingScripts:!0}),window.wcTracks.enable(()=>{this._isMounted&&(Object(u.initializeExPlat)(),this.setState({isLoadingScripts:!1}))})):e||(window.wcTracks.isEnabled=!1);const o=e?"yes":"no";this.setState({isRequestStarted:!0}),t({woocommerce_allow_tracking:o})}componentDidMount(){this._isMounted=!0}componentWillUnmount(){this._isMounted=!1}render(){const{allowTracking:e,isResolving:t,onClose:o,onContinue:n}=this.props;if(t)return null;if(e)return o(),n(),null;const{isRequesting:c,title:i=Object(s.__)("Build a better WooCommerce",'woocommerce'),message:d=a()({mixedString:Object(s.__)("Get improved features and faster fixes by sharing non-sensitive data via {{link}}usage tracking{{/link}} that shows us how WooCommerce is used. No personal data is tracked or stored.",'woocommerce'),components:{link:Object(r.createElement)(m.Link,{href:"https://woocommerce.com/usage-tracking?utm_medium=product",target:"_blank",type:"external"})}}),dismissActionText:u=Object(s.__)("No thanks",'woocommerce'),acceptActionText:p=Object(s.__)("Yes, count me in!",'woocommerce')}=this.props,{isRequestStarted:b}=this.state,h=b&&c;return Object(r.createElement)(l.Modal,{title:i,isDismissible:this.props.isDismissible,onRequestClose:()=>this.props.onClose(),className:"woocommerce-usage-modal"},Object(r.createElement)("div",{className:"woocommerce-usage-modal__wrapper"},Object(r.createElement)("div",{className:"woocommerce-usage-modal__message"},d),Object(r.createElement)("div",{className:"woocommerce-usage-modal__actions"},Object(r.createElement)(l.Button,{isSecondary:!0,isBusy:h,onClick:()=>this.updateTracking({allowTracking:!1})},u),Object(r.createElement)(l.Button,{isPrimary:!0,isBusy:h,onClick:()=>this.updateTracking({allowTracking:!0})},p))))}}t.a=Object(n.compose)(Object(c.withSelect)(e=>{const{getOption:t,getOptionsUpdatingError:o,isOptionsUpdating:r,hasFinishedResolution:s}=e(d.OPTIONS_STORE_NAME);return{allowTracking:"yes"===t("woocommerce_allow_tracking"),isRequesting:Boolean(r()),isResolving:!s("getOption",["woocommerce_allow_tracking"])||void 0===t("woocommerce_allow_tracking"),hasErrors:Boolean(o())}}),Object(c.withDispatch)(e=>{const{createNotice:t}=e("core/notices"),{updateOptions:o}=e(d.OPTIONS_STORE_NAME);return{createNotice:t,updateOptions:o}}))(p)},526:function(e,t,o){"use strict";o.d(t,"a",(function(){return r})),o.d(t,"b",(function(){return s}));const r=(e,t,o="undefined")=>e&&Array.isArray(e)&&e.length?t?e.reduce((e,r)=>(r[t]||(r[t]=o),(e[r[t]]=e[r[t]]||[]).push(r),e),{}):e:{},s=(e,t)=>Object.entries(e).reduce((e,[o])=>({...e,[o]:t}),{})},527:function(e,t,o){"use strict";o.d(t,"b",(function(){return u})),o.d(t,"a",(function(){return p}));var r=o(35),s=o.n(r),n=o(0),c=o(2),i=o(28),a=o(4),l=o(13),m=o(21);const{countries:d}=Object(l.f)("dataEndpoints",{countries:{}});function u(e){const t={};return e.addressLine1.trim().length||(t.addressLine1=Object(c.__)("Please add an address",'woocommerce')),e.countryState.trim().length||(t.countryState=Object(c.__)("Please select a country / region",'woocommerce')),e.city.trim().length||(t.city=Object(c.__)("Please add a city",'woocommerce')),e.postCode.trim().length||(t.postCode=Object(c.__)("Please add a post code",'woocommerce')),t}function p(e){const{getInputProps:t,setValue:o}=e,r=Object(n.useMemo)(()=>d.reduce((e,t)=>{if(!t.states.length)return e.push({key:t.code,label:Object(i.decodeEntities)(t.name)}),e;const o=t.states.map(e=>({key:t.code+":"+e.code,label:Object(i.decodeEntities)(t.name)+" — "+Object(i.decodeEntities)(e.name)}));return e.push(...o),e},[]),[]),l=function(e,t,o){const[r,s]=Object(n.useState)(""),[c,i]=Object(n.useState)(""),l=Object(n.useRef)();return Object(n.useEffect)(()=>{const o=e.find(e=>e.key===t),n=o?o.label.split(/\u2013|\u2014|\-/):[],a=(n[0]||"").trim(),m=(n[1]||"").trim();l.current||a===r&&m===c||(s(a),i(m)),l.current=!1},[t]),Object(n.useEffect)(()=>{r||c||!t||(l.current=!0,o("countryState",""));let s=[];const n=new RegExp(Object(a.escapeRegExp)(r),"i"),i=new RegExp(Object(a.escapeRegExp)(c.replace(/\s/g,""))+"$","i");if((c.length||r.length)&&(s=e.filter(e=>(r.length?n:i).test(e.label))),r.length&&c.length){const e=c.length<3;s=s.filter(t=>i.test((e?t.key:t.label).replace("-","").replace(/\s/g,"")));const t=r.length<3;if(s.length>1){let e=[];e=s.filter(e=>n.test(t?e.key:e.label)),e.length>0&&(s=e)}if(s.length>1){let t=[];t=s.filter(t=>i.test((e?t.key:t.label).replace("-","").replace(/\s/g,""))),1===t.length&&(s=t)}}1===s.length&&t!==s[0].key&&(l.current=!0,o("countryState",s[0].key))},[r,c,e,o]),Object(n.createElement)(n.Fragment,null,Object(n.createElement)("input",{onChange:e=>s(e.target.value),value:r,name:"country",type:"text",className:"woocommerce-select-control__autofill-input",tabIndex:"-1",autoComplete:"country"}),Object(n.createElement)("input",{onChange:e=>i(e.target.value),value:c,name:"state",type:"text",className:"woocommerce-select-control__autofill-input",tabIndex:"-1",autoComplete:"address-level1"}))}(r,t("countryState").value,o);return Object(n.createElement)("div",{className:"woocommerce-store-address-fields"},Object(n.createElement)(m.TextControl,s()({label:Object(c.__)("Address line 1",'woocommerce'),required:!0,autoComplete:"address-line1"},t("addressLine1"))),Object(n.createElement)(m.TextControl,s()({label:Object(c.__)("Address line 2 (optional)",'woocommerce'),required:!0,autoComplete:"address-line2"},t("addressLine2"))),Object(n.createElement)(m.SelectControl,s()({label:Object(c.__)("Country / Region",'woocommerce'),required:!0,autoComplete:"new-password",options:r,excludeSelectedOptions:!1,showAllOnFocus:!0,isSearchable:!0},t("countryState"),{controlClassName:t("countryState").className}),l),Object(n.createElement)(m.TextControl,s()({label:Object(c.__)("City",'woocommerce'),required:!0},t("city"),{autoComplete:"address-level2"})),Object(n.createElement)(m.TextControl,s()({label:Object(c.__)("Post code",'woocommerce'),required:!0,autoComplete:"postal-code"},t("postCode"))))}},569:function(e,t,o){},570:function(e,t,o){},571:function(e,t,o){},572:function(e,t,o){},573:function(e,t,o){},574:function(e,t,o){"use strict";var r=Object.assign||function(e){for(var t,o=1;o<arguments.length;o++)for(var r in t=arguments[o])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e};Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,o=e.size,s=void 0===o?24:o,n=e.onClick,i=(e.icon,e.className),a=function(e,t){var o={};for(var r in e)0<=t.indexOf(r)||Object.prototype.hasOwnProperty.call(e,r)&&(o[r]=e[r]);return o}(e,["size","onClick","icon","className"]),l=["gridicon","gridicons-info",i,(t=s,!(0!=t%18)&&"needs-offset"),!1,!1].filter(Boolean).join(" ");return c.default.createElement("svg",r({className:l,height:s,width:s,onClick:n},a,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"}),c.default.createElement("g",null,c.default.createElement("path",{d:"M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2zm1 15h-2v-6h2v6zm0-8h-2V7h2v2z"})))};var s,n=o(5),c=(s=n)&&s.__esModule?s:{default:s};e.exports=t.default},575:function(e,t,o){},576:function(e,t,o){"use strict";var r=Object.assign||function(e){for(var t,o=1;o<arguments.length;o++)for(var r in t=arguments[o])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e};Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t=e.size,o=void 0===t?24:t,s=e.onClick,n=(e.icon,e.className),i=function(e,t){var o={};for(var r in e)0<=t.indexOf(r)||Object.prototype.hasOwnProperty.call(e,r)&&(o[r]=e[r]);return o}(e,["size","onClick","icon","className"]),a=["gridicon","gridicons-cloud-upload",n,!1,!1,!1].filter(Boolean).join(" ");return c.default.createElement("svg",r({className:a,height:o,width:o,onClick:s},i,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"}),c.default.createElement("g",null,c.default.createElement("path",{d:"M18 9c-.01 0-.017.002-.025.003C17.72 5.646 14.922 3 11.5 3 7.91 3 5 5.91 5 9.5c0 .524.07 1.03.186 1.52C5.123 11.015 5.064 11 5 11c-2.21 0-4 1.79-4 4 0 1.202.54 2.267 1.38 3h18.593C22.196 17.09 23 15.643 23 14c0-2.76-2.24-5-5-5zm-5 4v3h-2v-3H8l4-5 4 5h-3z"})))};var s,n=o(5),c=(s=n)&&s.__esModule?s:{default:s};e.exports=t.default},577:function(e,t,o){"use strict";var r=Object.assign||function(e){for(var t,o=1;o<arguments.length;o++)for(var r in t=arguments[o])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e};Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t=e.size,o=void 0===t?24:t,s=e.onClick,n=(e.icon,e.className),i=function(e,t){var o={};for(var r in e)0<=t.indexOf(r)||Object.prototype.hasOwnProperty.call(e,r)&&(o[r]=e[r]);return o}(e,["size","onClick","icon","className"]),a=["gridicon","gridicons-phone",n,!1,!1,!1].filter(Boolean).join(" ");return c.default.createElement("svg",r({className:a,height:o,width:o,onClick:s},i,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"}),c.default.createElement("g",null,c.default.createElement("path",{d:"M16 2H8c-1.104 0-2 .896-2 2v16c0 1.104.896 2 2 2h8c1.104 0 2-.896 2-2V4c0-1.104-.896-2-2-2zm-3 19h-2v-1h2v1zm3-2H8V5h8v14z"})))};var s,n=o(5),c=(s=n)&&s.__esModule?s:{default:s};e.exports=t.default},578:function(e,t,o){"use strict";var r=Object.assign||function(e){for(var t,o=1;o<arguments.length;o++)for(var r in t=arguments[o])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e};Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t=e.size,o=void 0===t?24:t,s=e.onClick,n=(e.icon,e.className),i=function(e,t){var o={};for(var r in e)0<=t.indexOf(r)||Object.prototype.hasOwnProperty.call(e,r)&&(o[r]=e[r]);return o}(e,["size","onClick","icon","className"]),a=["gridicon","gridicons-tablet",n,!1,!1,!1].filter(Boolean).join(" ");return c.default.createElement("svg",r({className:a,height:o,width:o,onClick:s},i,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"}),c.default.createElement("g",null,c.default.createElement("path",{d:"M18 2H6c-1.104 0-2 .896-2 2v16c0 1.104.896 2 2 2h12c1.104 0 2-.896 2-2V4c0-1.104-.896-2-2-2zm-5 19h-2v-1h2v1zm5-2H6V5h12v14z"})))};var s,n=o(5),c=(s=n)&&s.__esModule?s:{default:s};e.exports=t.default},579:function(e,t,o){"use strict";var r=Object.assign||function(e){for(var t,o=1;o<arguments.length;o++)for(var r in t=arguments[o])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e};Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t=e.size,o=void 0===t?24:t,s=e.onClick,n=(e.icon,e.className),i=function(e,t){var o={};for(var r in e)0<=t.indexOf(r)||Object.prototype.hasOwnProperty.call(e,r)&&(o[r]=e[r]);return o}(e,["size","onClick","icon","className"]),a=["gridicon","gridicons-computer",n,!1,!1,!1].filter(Boolean).join(" ");return c.default.createElement("svg",r({className:a,height:o,width:o,onClick:s},i,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"}),c.default.createElement("g",null,c.default.createElement("path",{d:"M20 2H4c-1.104 0-2 .896-2 2v12c0 1.104.896 2 2 2h6v2H7v2h10v-2h-3v-2h6c1.104 0 2-.896 2-2V4c0-1.104-.896-2-2-2zm0 14H4V4h16v12z"})))};var s,n=o(5),c=(s=n)&&s.__esModule?s:{default:s};e.exports=t.default},580:function(e,t,o){},607:function(e,t,o){"use strict";o.r(t);var r=o(0);t.default=({})=>Object(r.createElement)("div",null,"Settings page")},613:function(e,t,o){"use strict";o.r(t);var r=o(0),s=o(2),n=o(30),c=o(14),i=o(4),a=o(7),l=o(12),m=o(11),d=o(16),u=o(13),p=o(35),b=o.n(p),h=o(21),_=o(3),O=o(501),g=o(507);const j=[{key:"shopify",label:Object(s.__)("Shopify",'woocommerce')},{key:"bigcommerce",label:Object(s.__)("BigCommerce",'woocommerce')},{key:"magento",label:Object(s.__)("Magento",'woocommerce')},{key:"wix",label:Object(s.__)("Wix",'woocommerce')},{key:"amazon",label:Object(s.__)("Amazon",'woocommerce')},{key:"ebay",label:Object(s.__)("eBay",'woocommerce')},{key:"etsy",label:Object(s.__)("Etsy",'woocommerce')},{key:"squarespace",label:Object(s.__)("Squarespace",'woocommerce')},{key:"other",label:Object(s.__)("Other",'woocommerce')}],w=[{key:"no",label:Object(s.__)("No",'woocommerce')},{key:"other",label:Object(s.__)("Yes, on another platform",'woocommerce')},{key:"other-woocommerce",label:Object(s.__)("Yes, I own a different store powered by WooCommerce",'woocommerce')},{key:"brick-mortar",label:Object(s.__)("Yes, in person at physical stores and/or events",'woocommerce')},{key:"brick-mortar-other",label:Object(s.__)("Yes, on another platform and in person at physical stores and/or events",'woocommerce')}];var f=o(60),C=o(120);const E=(e,t)=>Object(C.formatValue)(e,"number",t),y=(e,t,o=!1,r=E)=>o?Object(s.sprintf)(Object(s._x)("%1$s - %2$s","store product count or revenue range",'woocommerce'),r(e,t),r(e,o)):Object(s.sprintf)(Object(s._x)("%s+","store product count or revenue",'woocommerce'),r(e,t)),v={US:1,EU:.9,IN:71.24,GB:.76,BR:4.19,VN:23172.5,ID:14031,BD:84.87,PK:154.8,RU:63.74,TR:5.75,MX:19.37,CA:1.32},S=(e,t)=>{const o=Object(f.c)(t);if("US"===o)return e;const r=v[o]||v.US,s=r.toString().split(".")[0].length,n=Math.pow(10,2+s);return Math.round(e*r/n)*n},k=(e,t,o)=>[{key:"none",label:Object(s.sprintf)(Object(s.__)("%s (I'm just getting started)",'woocommerce'),o(0))},{key:"up-to-2500",label:Object(s.sprintf)(Object(s.__)("Up to %s",'woocommerce'),o(S(2500,t)))},{key:"2500-10000",label:y(e,S(2500,t),S(1e4,t),(e,t)=>o(t))},{key:"10000-50000",label:y(e,S(1e4,t),S(5e4,t),(e,t)=>o(t))},{key:"50000-250000",label:y(e,S(5e4,t),S(25e4,t),(e,t)=>o(t))},{key:"more-than-250000",label:Object(s.sprintf)(Object(s.__)("More than %s",'woocommerce'),o(S(25e4,t)))},{key:"rather-not-say",label:Object(s.__)("I'd rather not say",'woocommerce')}];var N=o(20),T=o(116),P=o(277),x=o(278),I=o(18),M=o.n(I);const A=()=>Object(r.createElement)("svg",{width:"200",height:"148",viewBox:"0 0 200 148",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Object(r.createElement)("g",{clipPath:"url(#clip0)"},Object(r.createElement)("path",{d:"M197.563 2.53875e-09H62.909C62.3961 0.000450584 61.9043 0.205742 61.5416 0.570805C61.179 0.935868 60.975 1.43087 60.9746 1.94714V50.9404H93.5623C94.4445 50.9415 95.2902 51.2947 95.9141 51.9226C96.5379 52.5505 96.8888 53.4019 96.8899 54.2899V95.7402H197.563C197.843 95.7402 198.119 95.6791 198.373 95.5612C198.627 95.4432 198.853 95.2712 199.034 95.0569C199.05 95.0402 199.064 95.0222 199.076 95.0033C199.192 94.8612 199.285 94.7024 199.354 94.5322C199.451 94.2981 199.501 94.0468 199.5 93.7931V1.94714C199.499 1.43051 199.295 0.935241 198.932 0.57014C198.569 0.20504 198.077 -2.63458e-05 197.563 2.53875e-09Z",fill:"#F2F2F2"}),Object(r.createElement)("path",{d:"M199.222 7.80469H61.25V8.36132H199.222V7.80469Z",fill:"#CCCCCC"}),Object(r.createElement)("path",{d:"M65.95 5.84371C66.8662 5.84371 67.609 5.09607 67.609 4.17381C67.609 3.25155 66.8662 2.50391 65.95 2.50391C65.0338 2.50391 64.291 3.25155 64.291 4.17381C64.291 5.09607 65.0338 5.84371 65.95 5.84371Z",fill:"#CCCCCC"}),Object(r.createElement)("path",{d:"M70.72 5.84371C71.6363 5.84371 72.379 5.09607 72.379 4.17381C72.379 3.25155 71.6363 2.50391 70.72 2.50391C69.8038 2.50391 69.061 3.25155 69.061 4.17381C69.061 5.09607 69.8038 5.84371 70.72 5.84371Z",fill:"#CCCCCC"}),Object(r.createElement)("path",{d:"M75.4896 5.84371C76.4058 5.84371 77.1486 5.09607 77.1486 4.17381C77.1486 3.25155 76.4058 2.50391 75.4896 2.50391C74.5733 2.50391 73.8306 3.25155 73.8306 4.17381C73.8306 5.09607 74.5733 5.84371 75.4896 5.84371Z",fill:"#CCCCCC"}),Object(r.createElement)("path",{d:"M164.842 19.957H95.6295C94.8646 19.957 94.1311 20.2629 93.5903 20.8073C93.0494 21.3516 92.7456 22.09 92.7456 22.8599C92.7456 23.6298 93.0494 24.3681 93.5903 24.9125C94.1311 25.4569 94.8646 25.7627 95.6295 25.7627H164.842C165.607 25.7627 166.341 25.4569 166.882 24.9125C167.422 24.3681 167.726 23.6298 167.726 22.8599C167.726 22.09 167.422 21.3516 166.882 20.8073C166.341 20.2629 165.607 19.957 164.842 19.957ZM164.842 25.3161H95.6295C94.9823 25.3161 94.3616 25.0573 93.904 24.5967C93.4464 24.1361 93.1893 23.5113 93.1893 22.8599C93.1893 22.2084 93.4464 21.5837 93.904 21.123C94.3616 20.6624 94.9823 20.4036 95.6295 20.4036H164.842C165.489 20.4036 166.11 20.6624 166.568 21.123C167.025 21.5837 167.283 22.2084 167.283 22.8599C167.283 23.5113 167.025 24.1361 166.568 24.5967C166.11 25.0573 165.489 25.3161 164.842 25.3161Z",fill:"#CCCCCC"}),Object(r.createElement)("path",{d:"M186.022 43.0859H116.809C116.044 43.0859 115.31 43.3918 114.769 43.9362C114.229 44.4806 113.925 45.2189 113.925 45.9888C113.925 46.7587 114.229 47.497 114.769 48.0414C115.31 48.5858 116.044 48.8916 116.809 48.8916H186.022C186.786 48.8916 187.52 48.5858 188.061 48.0414C188.602 47.497 188.905 46.7587 188.905 45.9888C188.905 45.2189 188.602 44.4806 188.061 43.9362C187.52 43.3918 186.786 43.0859 186.022 43.0859Z",fill:"white"}),Object(r.createElement)("path",{d:"M186.022 53.8047H116.809C116.044 53.8047 115.31 54.1105 114.769 54.6549C114.229 55.1993 113.925 55.9376 113.925 56.7075C113.925 57.4774 114.229 58.2158 114.769 58.7601C115.31 59.3045 116.044 59.6104 116.809 59.6104H186.022C186.786 59.6104 187.52 59.3045 188.061 58.7601C188.602 58.2158 188.905 57.4774 188.905 56.7075C188.905 55.9376 188.602 55.1993 188.061 54.6549C187.52 54.1105 186.786 53.8047 186.022 53.8047Z",fill:"white"}),Object(r.createElement)("path",{d:"M186.022 64.5195H116.809C116.044 64.5195 115.31 64.8254 114.769 65.3698C114.229 65.9141 113.925 66.6525 113.925 67.4224C113.925 68.1923 114.229 68.9306 114.769 69.475C115.31 70.0194 116.044 70.3252 116.809 70.3252H186.022C186.786 70.3252 187.52 70.0194 188.061 69.475C188.602 68.9306 188.905 68.1923 188.905 67.4224C188.905 66.6525 188.602 65.9141 188.061 65.3698C187.52 64.8254 186.786 64.5195 186.022 64.5195Z",fill:"white"}),Object(r.createElement)("path",{d:"M105.623 38.2852H74.1183C73.4425 38.286 72.7947 38.5565 72.3168 39.0375C71.839 39.5185 71.5702 40.1706 71.5693 40.8508V50.9416H72.013V40.8508C72.0139 40.2891 72.2359 39.7506 72.6306 39.3533C73.0252 38.9561 73.5602 38.7326 74.1183 38.7317H105.623C106.182 38.7322 106.717 38.9556 107.112 39.3529C107.506 39.7502 107.728 40.289 107.729 40.8508V72.5633C107.728 73.1251 107.506 73.6638 107.112 74.0611C106.717 74.4585 106.182 74.6819 105.623 74.6824H96.8897V75.1289H105.623C106.299 75.1285 106.947 74.858 107.425 74.377C107.903 73.8959 108.172 73.2436 108.172 72.5633V40.8508C108.172 40.1705 107.903 39.5182 107.425 39.0371C106.947 38.556 106.299 38.2856 105.623 38.2852Z",fill:"#CCCCCC"}),Object(r.createElement)("path",{d:"M23.9309 70.9116C23.8195 70.9162 19.0705 70.5847 18.9492 70.5806L19.3758 66.294L22.0808 66.212L27.2495 56.5756C26.5327 55.1996 27.4148 53.3739 28.9355 53.0925C32 52.3914 33.0526 57.2443 29.9789 57.8901L25.7036 69.6652C25.5695 70.03 25.3278 70.3449 25.011 70.5676C24.6942 70.7904 24.3174 70.9104 23.9309 70.9116Z",fill:"#FFB8B8"}),Object(r.createElement)("path",{d:"M11.4107 73.118C6.89154 73.1291 6.49482 66.2544 11.024 65.7699C23.0006 65.0415 21.485 62.0137 22.3945 70.9448C22.4224 71.2097 22.3448 71.475 22.1787 71.6824C22.0126 71.8898 21.7715 72.0223 21.5084 72.051L11.803 73.0968C11.6727 73.1109 11.5417 73.1179 11.4107 73.118Z",className:"fill-theme-color"}),Object(r.createElement)("path",{d:"M10.3793 51.3852C16.605 54.9512 11.494 64.3601 5.15222 61.0097C-1.0733 57.4438 4.03771 48.0349 10.3793 51.3852Z",fill:"#FFB8B8"}),Object(r.createElement)("path",{d:"M16.0395 132.376L18.759 132.376L20.053 121.816L16.0391 121.817L16.0395 132.376Z",fill:"#FFB8B8"}),Object(r.createElement)("path",{d:"M15.4567 134.915L24.0042 134.915C23.9716 130.476 18.2546 131.755 15.4565 131.591L15.4567 134.915Z",fill:"#2F2E41"}),Object(r.createElement)("path",{d:"M4.28218 132.376L7.00167 132.376L8.29564 121.816L4.28174 121.817L4.28218 132.376Z",fill:"#FFB8B8"}),Object(r.createElement)("path",{d:"M3.69937 134.915L12.2469 134.915C12.2142 130.476 6.49728 131.755 3.69922 131.591L3.69937 134.915Z",fill:"#2F2E41"}),Object(r.createElement)("path",{d:"M7.37266 128.688C6.71536 128.507 3.14362 129.056 2.72209 128.335C1.24999 113.483 1.57722 98.9486 4.845 90.9619L16.0806 90.2695C18.5931 94.8863 24.3684 125.522 20.8847 127.385L16.4048 127.546C16.1493 127.554 15.8988 127.474 15.6952 127.318C15.4916 127.163 15.3475 126.941 15.2869 126.691L11.539 105.229C10.6057 103.916 8.77111 127.832 8.46815 127.742C8.42864 128.006 8.29626 128.247 8.09515 128.42C7.89404 128.594 7.63762 128.689 7.37266 128.688Z",fill:"#2F2E41"}),Object(r.createElement)("path",{d:"M4.48843 92.8373C-1.18427 86.8634 2.43414 70.8475 2.25101 71.1881C2.26655 70.7958 3.55141 64.7536 6.87506 63.762C9.51196 62.886 12.4305 65.5063 12.7906 68.1566L16.7406 91.6368C16.7611 91.7646 16.7514 91.8955 16.7123 92.0188C16.6733 92.1422 16.6059 92.2546 16.5158 92.3469C16.71 92.9556 4.76613 92.7153 4.48843 92.8373Z",className:"fill-theme-color"}),Object(r.createElement)("path",{d:"M6.32941 55.5845C6.82759 55.2675 7.07312 54.7238 7.36309 54.2285C8.89053 53.3522 10.6464 55.472 12.262 54.6809C16.8302 50.2665 12.1346 48.9642 7.92721 48.7314C6.9333 48.6081 6.08781 48.963 5.33637 49.5492C-3.06805 48.9031 0.962591 60.1519 6.26679 61.6376C7.2033 62.0505 7.90582 61.2148 7.07994 60.4551C5.93728 59.2493 4.52181 56.8221 6.32941 55.5845Z",fill:"#2F2E41"}),Object(r.createElement)("path",{d:"M93.5621 50.4922H32.779C31.7793 50.4936 30.8209 50.894 30.1139 51.6056C29.407 52.3172 29.0092 53.2819 29.0078 54.2882V131.548C29.0092 132.555 29.407 133.52 30.1139 134.231C30.8209 134.943 31.7793 135.343 32.779 135.345H93.5621C94.5619 135.343 95.5202 134.943 96.2272 134.231C96.9341 133.52 97.3319 132.555 97.3333 131.548V54.2882C97.3319 53.2819 96.9341 52.3172 96.2272 51.6056C95.5202 50.894 94.5619 50.4936 93.5621 50.4922ZM96.8896 131.548C96.8886 132.436 96.5376 133.288 95.9138 133.916C95.29 134.544 94.4443 134.897 93.5621 134.898H32.779C31.8968 134.897 31.0511 134.544 30.4273 133.916C29.8035 133.288 29.4526 132.436 29.4515 131.548V54.2882C29.4526 53.4002 29.8035 52.5489 30.4273 51.921C31.0511 51.2931 31.8968 50.9399 32.779 50.9388H93.5621C94.4443 50.9399 95.29 51.2931 95.9138 51.921C96.5376 52.5489 96.8886 53.4002 96.8896 54.2882V131.548Z",fill:"#3F3D56"}),Object(r.createElement)("path",{d:"M15.6527 83.0043C13.6494 83.2327 12.7698 78.5402 12.0039 77.3445L15.9936 75.7852L17.2918 78.1751L28.168 78.4472C28.2326 78.3591 28.3032 78.2755 28.3793 78.1971C30.5362 75.9238 34.0488 79.33 31.9 81.5984C31.663 81.8519 31.3752 82.0521 31.0557 82.1855C30.7362 82.319 30.3923 82.3828 30.0465 82.3727C29.7007 82.3627 29.361 82.2789 29.0497 82.1271C28.7384 81.9753 28.4626 81.7588 28.2405 81.4918C27.9719 81.5111 15.9153 83.0114 15.6527 83.0043Z",fill:"#FFB8B8"}),Object(r.createElement)("path",{d:"M12.6985 80.7664C12.0314 81.4133 6.91061 72.3318 6.5365 72.0751C3.94893 68.0267 10.0405 64.0298 12.6727 68.0562L17.9961 76.2911C18.1402 76.5145 18.1904 76.7864 18.1356 77.047C18.0808 77.3076 17.9255 77.5357 17.7039 77.6812C17.4613 77.7956 12.8697 81.0123 12.6985 80.7664Z",className:"fill-theme-color"}),Object(r.createElement)("path",{d:"M81.583 103.974H44.7583C40.9966 103.955 40.9809 98.1877 44.7584 98.168H81.583C85.3421 98.1857 85.3624 103.954 81.583 103.974Z",fill:"#CCCCCC"}),Object(r.createElement)("path",{d:"M81.583 114.692H44.7583C40.9966 114.674 40.9809 108.906 44.7584 108.887H81.583C85.3421 108.904 85.3624 114.673 81.583 114.692Z",fill:"#CCCCCC"}),Object(r.createElement)("path",{d:"M81.583 125.411H44.7583C40.9966 125.393 40.9809 119.625 44.7584 119.605H81.583C85.3421 119.623 85.3624 125.391 81.583 125.411Z",fill:"#CCCCCC"}),Object(r.createElement)("path",{d:"M95.3371 57.6387C94.1963 57.6387 93.0812 57.2982 92.1327 56.6603C91.1842 56.0223 90.4449 55.1156 90.0084 54.0548C89.5718 52.9939 89.4576 51.8266 89.6802 50.7004C89.9027 49.5742 90.452 48.5397 91.2587 47.7278C92.0653 46.9159 93.093 46.3629 94.2118 46.1389C95.3307 45.9149 96.4904 46.0299 97.5443 46.4693C98.5982 46.9087 99.499 47.6528 100.133 48.6076C100.767 49.5623 101.105 50.6848 101.105 51.833C101.103 53.3723 100.495 54.8479 99.4136 55.9363C98.3323 57.0247 96.8662 57.637 95.3371 57.6387Z",className:"fill-theme-color"}),Object(r.createElement)("path",{d:"M97.999 51.6121H95.5588V48.821C95.5588 48.7617 95.5355 48.7049 95.4939 48.6631C95.4523 48.6212 95.3958 48.5977 95.337 48.5977C95.2782 48.5977 95.2217 48.6212 95.1801 48.6631C95.1385 48.7049 95.1152 48.7617 95.1152 48.821V51.6121H92.675C92.6161 51.6121 92.5597 51.6357 92.5181 51.6775C92.4765 51.7194 92.4531 51.7762 92.4531 51.8354C92.4531 51.8947 92.4765 51.9515 92.5181 51.9933C92.5597 52.0352 92.6161 52.0587 92.675 52.0587H95.1152V54.8499C95.1152 54.9091 95.1385 54.9659 95.1801 55.0078C95.2217 55.0497 95.2782 55.0732 95.337 55.0732C95.3958 55.0732 95.4523 55.0497 95.4939 55.0078C95.5355 54.9659 95.5588 54.9091 95.5588 54.8499V52.0587H97.999C98.0579 52.0587 98.1143 52.0352 98.1559 51.9933C98.1975 51.9515 98.2209 51.8947 98.2209 51.8354C98.2209 51.7762 98.1975 51.7194 98.1559 51.6775C98.1143 51.6357 98.0579 51.6121 97.999 51.6121Z",fill:"white"}),Object(r.createElement)("path",{d:"M80.9177 91.2002H45.424C44.4535 91.1991 43.5232 90.8105 42.837 90.1198C42.1508 89.4291 41.7648 88.4926 41.7637 87.5158V67.5086C41.7648 66.5318 42.1508 65.5953 42.837 64.9046C43.5232 64.2139 44.4535 63.8253 45.424 63.8242H80.9177C81.8882 63.8253 82.8185 64.2139 83.5047 64.9046C84.1909 65.5953 84.5769 66.5318 84.578 67.5086V87.5158C84.5769 88.4926 84.1909 89.4291 83.5047 90.1198C82.8185 90.8105 81.8882 91.1991 80.9177 91.2002Z",className:"fill-theme-color"})),Object(r.createElement)("defs",null,Object(r.createElement)("clipPath",{id:"clip0"},Object(r.createElement)("rect",{width:"199",height:"148",fill:"white",transform:"translate(0.5)"}))));o(569);var R=o(509),B=o(526);const z=["basics"],F=()=>Object(r.createElement)("div",{className:"woocommerce-admin__business-details__free-badge"},Object(s.__)("Free",'woocommerce')),L=({onChange:e,description:t,isChecked:o})=>Object(r.createElement)("div",{className:"woocommerce-admin__business-details__selective-extensions-bundle__extension"},Object(r.createElement)(_.CheckboxControl,{id:"woocommerce-business-extensions__checkbox",checked:o,onChange:e}),Object(r.createElement)("p",{className:"woocommerce-admin__business-details__selective-extensions-bundle__description",dangerouslySetInnerHTML:Object(R.a)(t),onClick:e=>{const t=e.target.closest("a");t&&e.currentTarget.contains(t)&&t.href.startsWith("https://woocommerce.com/products/")&&Object(d.recordEvent)("storeprofiler_store_business_features_link_click",{extension_name:t.href.split("https://woocommerce.com/products/")[1]})}}),Object(r.createElement)(F,null)),D={install_extensions:!0},V=({isInstallingActivating:e,onSubmit:t})=>{const[o,n]=Object(r.useState)(!1),[c,i]=Object(r.useState)(D),{countryCode:l,freeExtensions:u,isResolving:p,profileItems:b}=Object(a.useSelect)(e=>{const{getFreeExtensions:t,getProfileItems:o,hasFinishedResolution:r}=e(m.ONBOARDING_STORE_NAME),{getSettings:s}=e(m.SETTINGS_STORE_NAME),{general:n={}}=s("general");return{countryCode:Object(f.b)(n.woocommerce_default_country),freeExtensions:t(),isResolving:!r("getFreeExtensions"),profileItems:o()}}),O=Object(r.useMemo)(()=>{const{product_types:e}=b;return u.filter(t=>(window.wcAdminFeatures&&window.wcAdminFeatures.subscriptions&&"US"===l&&e.includes("subscriptions")&&(t.plugins=t.plugins.filter(e=>"woocommerce-payments"!==e.key||"woocommerce-payments"===e.key&&!e.is_activated)),z.includes(t.key)))},[u,b]);Object(r.useEffect)(()=>{if(!e){const e=O.reduce((e,t)=>({...e,...t.plugins.reduce((e,{key:t,selected:o})=>({...e,[t]:null==o||o}),{})}),D);i(e)}},[O]);const g=e=>t=>{const o={...c,[e]:t},r=1===Object.entries(o).filter(([,e])=>e).length&&o.install_extensions;i(r?{...o,install_extensions:!1}:{...c,[e]:t,install_extensions:!0})};return Object(r.createElement)("div",{className:"woocommerce-profile-wizard__business-details__free-features"},Object(r.createElement)(_.Card,null,Object(r.createElement)("div",{className:"woocommerce-profile-wizard__business-details__free-features__illustration"},Object(r.createElement)(A,null)),Object(r.createElement)("div",{className:"woocommerce-admin__business-details__selective-extensions-bundle"},Object(r.createElement)("div",{className:"woocommerce-admin__business-details__selective-extensions-bundle__extension"},Object(r.createElement)(_.CheckboxControl,{checked:c.install_extensions,onChange:e=>{i(Object(B.b)(c,e))}}),Object(r.createElement)("p",{className:"woocommerce-admin__business-details__selective-extensions-bundle__description"},Object(s.__)("Add recommended business features to my site",'woocommerce')),Object(r.createElement)(_.Button,{className:"woocommerce-admin__business-details__selective-extensions-bundle__expand",onClick:()=>{n(!o),o||Object(d.recordEvent)("storeprofiler_store_business_features_accordion_click")}},Object(r.createElement)(T.a,{icon:o?P.a:x.a}))),o&&O.map(({plugins:e,key:t})=>Object(r.createElement)("div",{key:t},p?Object(r.createElement)(_.Spinner,null):e.map(({description:e,key:t})=>Object(r.createElement)(L,{key:t,description:e,isChecked:c[t],onChange:g(t)}))))),Object(r.createElement)("div",{className:"woocommerce-profile-wizard__business-details__free-features__action"},Object(r.createElement)(_.Button,{onClick:()=>{t(c)},isBusy:e,disabled:e,isPrimary:!0},Object(s.__)("Continue",'woocommerce')))),((e,t)=>{const o=Object.keys(e).filter(t=>e[t]&&"install_extensions"!==t);if(0===o.length)return null;const n=o.reduce((e,t)=>{const o=m.pluginNames[t];return e.includes(o)?e:[...e,o]},[]).join(", ");if(t)return Object(r.createElement)("div",{className:"woocommerce-profile-wizard__footnote"},Object(r.createElement)(N.Text,{variant:"caption",as:"p",size:"12",lineHeight:"16px"},Object(s.sprintf)(Object(s._n)("Installing the following plugin: %s","Installing the following plugins: %s",o.length,'woocommerce'),n)));const c=o.includes("jetpack")||o.includes("woocommerce-shipping"),i=Object(s.__)("User accounts are required to use these features.",'woocommerce');return Object(r.createElement)("div",{className:"woocommerce-profile-wizard__footnote"},Object(r.createElement)(N.Text,{variant:"caption",as:"p",size:"12",lineHeight:"16px"},Object(s.sprintf)(Object(s._n)("The following plugin will be installed for free: %1$s. %2$s","The following plugins will be installed for free: %1$s. %2$s",o.length,'woocommerce'),n,i)),c&&Object(r.createElement)(N.Text,{variant:"caption",as:"p",size:"12",lineHeight:"16px"},M()({mixedString:Object(s.__)("By installing Jetpack and WooCommerce Shipping plugins for free you agree to our {{link}}Terms of Service{{/link}}.",'woocommerce'),components:{link:Object(r.createElement)(h.Link,{href:"https://wordpress.com/tos/",target:"_blank",type:"external"})}})))})(c,e))};o(570);class H extends r.Component{constructor(){super(),this.state={isPopoverVisible:!1,isValid:!1,currentTab:"business-details",savedValues:null},this.onContinue=this.onContinue.bind(this),this.validate=this.validate.bind(this)}async onContinue(e){const{createNotice:t,goToNextStep:o,installAndActivatePlugins:r}=this.props,n=(e=>Object.keys(e).filter(t=>e[t]&&"install_extensions"!==t).map(e=>e.split(":")[0]).filter((e,t,o)=>o.indexOf(e)===t))(e);Object(d.recordEvent)("storeprofiler_store_business_features_continue",{all_extensions_installed:Object.values(e).every(e=>e),install_woocommerce_services:e["woocommerce-services:shipping"]||e["woocommerce-services:tax"],install_jetpack:e.jetpack,install_wcpay:e["woocommerce-payments"]});const c=[this.persistProfileItems({business_extensions:n})];n.length&&c.push(r(n).then(e=>{Object(g.a)(e)}).catch(e=>{throw Object(g.a)(e),new Error})),Promise.all(c).then(()=>{o()}).catch(()=>{t("error",Object(s.__)("There was a problem updating your business details",'woocommerce'))})}async persistProfileItems(e={}){const{updateProfileItems:t,createNotice:o}=this.props,{other_platform:r,other_platform_name:n,product_count:c,revenue:i,selling_venues:a,setup_client:l}=this.state.savedValues,m={other_platform:r,other_platform_name:"other"===r?n:"",product_count:c,revenue:i,selling_venues:a,setup_client:l,...e};return t(Object.entries(m).reduce((e,[t,o])=>""!==o?{...e,[t]:o}:e,{})).catch(()=>{o("error",Object(s.__)("There was a problem updating your business details",'woocommerce'))})}validate(e){const t={};return e.product_count.length||(t.product_count=Object(s.__)("This field is required",'woocommerce')),e.selling_venues.length||(t.selling_venues=Object(s.__)("This field is required",'woocommerce')),!e.other_platform.length&&["other","brick-mortar-other"].includes(e.selling_venues)&&(t.other_platform=Object(s.__)("This field is required",'woocommerce')),!e.other_platform_name&&"other"===e.other_platform&&["other","brick-mortar-other"].includes(e.selling_venues)&&(t.other_platform_name=Object(s.__)("This field is required",'woocommerce')),!e.revenue.length&&["other","brick-mortar","brick-mortar-other","other-woocommerce"].includes(e.selling_venues)&&(t.revenue=Object(s.__)("This field is required",'woocommerce')),0===Object.keys(t).length&&this.setState({isValid:!0}),t}trackBusinessDetailsStep({other_platform:e,other_platform_name:t,product_count:o,selling_venues:r,revenue:s,setup_client:n}){const{getCurrencyConfig:c}=this.context;Object(d.recordEvent)("storeprofiler_store_business_details_continue_variant",{already_selling:r,currency:c().code,product_number:o,revenue:s,used_platform:e,used_platform_name:t,setup_client:n})}renderBusinessDetailsStep(){const{goToNextStep:e,isInstallingActivating:t,hasInstallActivateError:o}=this.props,{formatAmount:n,getCurrencyConfig:c}=this.context,i=(a=c(),[{key:"0",label:Object(s.__)("I don't have any products yet.",'woocommerce')},{key:"1-10",label:y(a,1,10)},{key:"11-100",label:y(a,11,100)},{key:"101-1000",label:y(a,101,1e3)},{key:"1000+",label:y(a,1e3)}]);var a;return Object(r.createElement)(h.Form,{initialValues:this.state.savedValues||this.props.initialValues,onSubmit:e=>{this.setState({savedValues:e,currentTab:"free-features"}),this.trackBusinessDetailsStep(e)},onChange:(e,t,o)=>{this.setState({savedValues:t,isValid:o})},validate:this.validate},({getInputProps:a,handleSubmit:l,values:m,isValidForm:d})=>Object(r.createElement)(r.Fragment,null,Object(r.createElement)("div",{className:"woocommerce-profile-wizard__step-header"},Object(r.createElement)(_.__experimentalText,{variant:"title.small",as:"h2",size:"20",lineHeight:"28px"},Object(s.__)("Tell us about your business",'woocommerce')),Object(r.createElement)(_.__experimentalText,{variant:"body",as:"p"},Object(s.__)("We'd love to know if you are just getting started or you already have a business in place.",'woocommerce'))),Object(r.createElement)(_.Card,null,Object(r.createElement)(_.CardBody,null,Object(r.createElement)(h.SelectControl,b()({excludeSelectedOptions:!1,label:Object(s.__)("How many products do you plan to display?",'woocommerce'),options:i,required:!0},a("product_count"))),Object(r.createElement)(h.SelectControl,b()({excludeSelectedOptions:!1,label:Object(s.__)("Currently selling elsewhere?",'woocommerce'),options:w,required:!0},a("selling_venues"))),["other","brick-mortar","brick-mortar-other","other-woocommerce"].includes(m.selling_venues)&&Object(r.createElement)(h.SelectControl,b()({excludeSelectedOptions:!1,label:Object(s.__)("What's your current annual revenue?",'woocommerce'),options:k(c(),this.props.settings.woocommerce_default_country,n),required:!0},a("revenue"))),["other","brick-mortar-other"].includes(m.selling_venues)&&Object(r.createElement)(r.Fragment,null,Object(r.createElement)("div",{className:"business-competitors"},Object(r.createElement)(h.SelectControl,b()({excludeSelectedOptions:!1,label:Object(s.__)("Which platform is the store using?",'woocommerce'),options:j,required:!0},a("other_platform"))),"other"===m.other_platform&&Object(r.createElement)(h.TextControl,b()({label:Object(s.__)("What is the platform name?",'woocommerce'),required:!0},a("other_platform_name")))))),Object(r.createElement)(_.CardFooter,{isBorderless:!0},Object(r.createElement)(_.FlexItem,null,Object(r.createElement)("div",{className:"woocommerce-profile-wizard__client"},Object(r.createElement)(_.CheckboxControl,b()({label:Object(s.__)("I'm setting up a store for a client",'woocommerce')},a("setup_client")))))),Object(r.createElement)(_.CardFooter,{justify:"center"},Object(r.createElement)(_.Button,{isPrimary:!0,onClick:async()=>{await l(),this.persistProfileItems()},disabled:!d,isBusy:t},o?Object(s.__)("Retry",'woocommerce'):Object(s.__)("Continue",'woocommerce')),o&&Object(r.createElement)(_.Button,{onClick:()=>{this.persistProfileItems(),e()}},Object(s.__)("Continue without installing",'woocommerce'))))))}renderFreeFeaturesStep(){const{isInstallingActivating:e,settings:t,profileItems:o}=this.props,n=t.woocommerce_default_country?t.woocommerce_default_country:null;return Object(r.createElement)(r.Fragment,null,Object(r.createElement)("div",{className:"woocommerce-profile-wizard__step-header"},Object(r.createElement)(_.__experimentalText,{variant:"title.small",as:"h2",size:"20",lineHeight:"28px"},Object(s.__)("Included business features",'woocommerce')),Object(r.createElement)(_.__experimentalText,{variant:"body",as:"p"},Object(s.__)("We recommend enhancing your store with these free extensions",'woocommerce')),Object(r.createElement)(_.__experimentalText,{variant:"body",as:"p"},Object(s.__)("No commitment required - you can remove them at any time.",'woocommerce'))),Object(r.createElement)(V,{isInstallingActivating:e,onSubmit:this.onContinue,country:n,industry:o.industry,productTypes:o.product_types}))}render(){const{initialValues:e}=this.props;return Object(r.createElement)(_.TabPanel,{activeClass:"is-active",initialTabName:"current-tab",onSelect:t=>{this.state.currentTab!==t&&this.setState({currentTab:t,savedValues:this.state.savedValues||e})},tabs:[{name:"business-details"===this.state.currentTab?"current-tab":"business-details",id:"business-details",title:Object(s.__)("Business details",'woocommerce')},{name:"free-features"===this.state.currentTab?"current-tab":"free-features",id:"free-features",title:Object(s.__)("Free features",'woocommerce'),className:this.state.isValid?"":"is-disabled"}]},e=>Object(r.createElement)(r.Fragment,null,this.getTab(e.id)))}getTab(e){return"business-details"===e?this.renderBusinessDetailsStep():this.renderFreeFeaturesStep()}}H.contextType=O.a;const U=Object(c.compose)(Object(a.withSelect)(e=>{const{getSettings:t,getSettingsError:o}=e(m.SETTINGS_STORE_NAME),{getProfileItems:r,getOnboardingError:s}=e(m.ONBOARDING_STORE_NAME),{getPluginsError:n,isPluginsRequesting:c}=e(m.PLUGINS_STORE_NAME),{general:i={}}=t("general");return{hasInstallActivateError:n("installPlugins")||n("activatePlugins"),isError:Boolean(s("updateProfileItems")),profileItems:r(),isSettingsError:Boolean(o("general")),settings:i,isInstallingActivating:c("installPlugins")||c("activatePlugins")||c("getJetpackConnectUrl")}}),Object(a.withDispatch)(e=>{const{updateProfileItems:t}=e(m.ONBOARDING_STORE_NAME),{installAndActivatePlugins:o}=e(m.PLUGINS_STORE_NAME),{createNotice:r}=e("core/notices");return{createNotice:r,installAndActivatePlugins:o,updateProfileItems:t}}))(H);o(571);const q=e=>{const{profileItems:t,isLoading:o}=Object(a.useSelect)(e=>({isLoading:!e(m.ONBOARDING_STORE_NAME).hasFinishedResolution("getProfileItems")||!e(m.SETTINGS_STORE_NAME).hasFinishedResolution("getSettings",["general"]),profileItems:e(m.ONBOARDING_STORE_NAME).getProfileItems()}));if(o)return Object(r.createElement)("div",{className:"woocommerce-admin__business-details__spinner"},Object(r.createElement)(h.Spinner,null));const s={other_platform:t.other_platform||"",other_platform_name:t.other_platform_name||"",product_count:t.product_count||"",selling_venues:t.selling_venues||"",revenue:t.revenue||"",setup_client:t.setup_client||!1};return Object(r.createElement)(U,b()({},e,{initialValues:s}))},G=Object(u.f)("onboarding",{});class Z extends r.Component{constructor(e){let t=Object(i.get)(e,"profileItems",{}).industry||[];const{locationSettings:o}=e;if("US"!==Object(f.c)(o.woocommerce_default_country)){const e="cbd-other-hemp-derived-products";t=t.filter(t=>e!==t&&e!==t.slug)}super(),this.state={error:null,selected:t,textInputListContent:{}},this.onContinue=this.onContinue.bind(this),this.onIndustryChange=this.onIndustryChange.bind(this),this.onDetailChange=this.onDetailChange.bind(this)}async onContinue(){if(await this.validateField(),this.state.error)return;const{createNotice:e,goToNextStep:t,isError:o,updateProfileItems:r}=this.props,n=this.state.selected.map(e=>e.slug),c=this.state.selected.map(e=>e.detail).filter(e=>e).join(",");Object(d.recordEvent)("storeprofiler_store_industry_continue",{store_industry:n,industries_with_detail:c}),await r({industry:this.state.selected}),o?e("error",Object(s.__)("There was a problem updating your industries",'woocommerce')):t()}async validateField(){const e=this.state.selected.length?null:Object(s.__)("Please select at least one industry",'woocommerce');this.setState({error:e})}onIndustryChange(e){this.setState(t=>{const o=t.selected,r=Object(i.find)(o,{slug:e});if(r){const o=t.textInputListContent;return o[e]=r.detail,{selected:Object(i.filter)(t.selected,t=>t.slug!==e)||[],textInputListContent:o}}return o.push({slug:e,detail:t.textInputListContent[e]}),{selected:o}},()=>this.validateField())}onDetailChange(e,t){this.setState(o=>{const r=o.selected,s=o.textInputListContent;return r[Object(i.findIndex)(r,{slug:t})].detail=e,s[t]=e,{selected:r,textInputListContent:s}})}renderIndustryLabel(e,t,o){const{textInputListContent:s}=this.state;return Object(r.createElement)(r.Fragment,null,t.label,t.use_description&&o&&Object(r.createElement)(h.TextControl,{key:"text-control-"+e,label:t.description_label,value:o.detail||s[e]||"",onChange:t=>this.onDetailChange(t,e),className:"woocommerce-profile-wizard__text"}))}render(){const{industries:e}=G,{error:t,selected:o}=this.state,{locationSettings:n,isProfileItemsRequesting:c}=this.props,a=Object(f.c)(n.woocommerce_default_country),l=Object.keys(e),m="US"===a?l:l.filter(e=>"cbd-other-hemp-derived-products"!==e);return Object(r.createElement)(r.Fragment,null,Object(r.createElement)("div",{className:"woocommerce-profile-wizard__step-header"},Object(r.createElement)(N.Text,{variant:"title.small",as:"h2",size:"20",lineHeight:"28px"},Object(s.__)("In which industry does the store operate?",'woocommerce')),Object(r.createElement)(N.Text,{variant:"body",as:"p"},Object(s.__)("Choose any that apply",'woocommerce'))),Object(r.createElement)(_.Card,null,Object(r.createElement)(_.CardBody,{size:null},Object(r.createElement)("div",{className:"woocommerce-profile-wizard__checkbox-group"},m.map(t=>{const s=Object(i.find)(o,{slug:t});return Object(r.createElement)(_.CheckboxControl,{key:"checkbox-control-"+t,label:this.renderIndustryLabel(t,e[t],s),onChange:()=>this.onIndustryChange(t),checked:s||!1,className:"woocommerce-profile-wizard__checkbox"})}),t&&Object(r.createElement)("span",{className:"woocommerce-profile-wizard__error"},t))),Object(r.createElement)(_.CardFooter,{isBorderless:!0,justify:"center"},Object(r.createElement)(_.Button,{isPrimary:!0,onClick:this.onContinue,isBusy:c,disabled:!o.length||c},Object(s.__)("Continue",'woocommerce')))))}}var W=Object(c.compose)(Object(a.withSelect)(e=>{const{getProfileItems:t,getOnboardingError:o,isOnboardingRequesting:r}=e(m.ONBOARDING_STORE_NAME),{getSettings:s}=e(m.SETTINGS_STORE_NAME),{general:n={}}=s("general");return{isError:Boolean(o("updateProfileItems")),profileItems:t(),locationSettings:n,isProfileItemsRequesting:r("updateProfileItems")}}),Object(a.withDispatch)(e=>{const{updateProfileItems:t}=e(m.ONBOARDING_STORE_NAME),{createNotice:o}=e("core/notices");return{createNotice:o,updateProfileItems:t}}))(Z),J=o(8),$=Object(r.createElement)(J.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(r.createElement)(J.Path,{d:"M12 3.2c-4.8 0-8.8 3.9-8.8 8.8 0 4.8 3.9 8.8 8.8 8.8 4.8 0 8.8-3.9 8.8-8.8 0-4.8-4-8.8-8.8-8.8zm0 16c-4 0-7.2-3.3-7.2-7.2C4.8 8 8 4.8 12 4.8s7.2 3.3 7.2 7.2c0 4-3.2 7.2-7.2 7.2zM11 17h2v-6h-2v6zm0-8h2V7h-2v2z"}));function Y({annualPrice:e,description:t,isMonthlyPricing:o,label:n,moreUrl:c,slug:i}){const[a,l]=Object(r.useState)("");if(!e)return n;const m=Object(s.__)("This product type requires a paid extension.\nWe'll add this to a cart so that\nyou can purchase and install it later.",'woocommerce');return Object(r.createElement)(r.Fragment,null,Object(r.createElement)("span",{className:"woocommerce-product-wizard__product-types-label"},n),Object(r.createElement)(_.Button,{isTertiary:!0,label:Object(s.__)("Learn more about recommended free business features",'woocommerce'),onClick:()=>{l(!0)}},Object(r.createElement)(T.a,{icon:$})),a&&Object(r.createElement)(_.Popover,{focusOnMount:"container",position:"top center",onClose:()=>l(!1)},M()({mixedString:t+(c?" {{moreLink/}}":""),components:{moreLink:c?Object(r.createElement)(h.Link,{href:c,target:"_blank",type:"external",onClick:()=>Object(d.recordEvent)("storeprofiler_store_product_type_learn_more",{product_type:i})},Object(s.__)("Learn more",'woocommerce')):""}})),Object(r.createElement)(_.Tooltip,{text:m,position:"bottom center"},Object(r.createElement)(h.Pill,null,Object(r.createElement)("span",{className:"screen-reader-text"},m),o?Object(s.sprintf)(Object(s.__)("$%f per month",'woocommerce'),(e/12).toFixed(2)):Object(s.sprintf)(Object(s.__)("$%f per year",'woocommerce'),e))))}o(572);class Q extends r.Component{constructor(){super(),this.state={error:null,isMonthlyPricing:!0,selected:[],isWCPayInstalled:null},this.onContinue=this.onContinue.bind(this),this.onChange=this.onChange.bind(this)}componentDidMount(){const{installedPlugins:e,invalidateResolution:t}=this.props,{isWCPayInstalled:o}=this.state;t("getProductTypes",[]),null===o&&e&&this.setState({isWCPayInstalled:e.includes("woocommerce-payments")})}componentDidUpdate(e){const{profileItems:t,productTypes:o}=this.props;if(e.productTypes!==o){const e=Object.keys(o).filter(e=>!!o[e].default);this.setState({selected:t.product_types||e})}}validateField(){const e=this.state.selected.length?null:Object(s.__)("Please select at least one product type",'woocommerce');return this.setState({error:e}),!e}onContinue(){const{selected:e}=this.state,{installedPlugins:t=[]}=this.props;if(!this.validateField())return;const{countryCode:o,createNotice:r,goToNextStep:n,installAndActivatePlugins:c,updateProfileItems:i}=this.props;Object(d.recordEvent)("storeprofiler_store_product_type_continue",{product_type:e});const a=[i({product_types:e})];window.wcAdminFeatures&&window.wcAdminFeatures.subscriptions&&"US"===o&&!t.includes("woocommerce-payments")&&e.includes("subscriptions")&&a.push(c(["woocommerce-payments"]).then(e=>{Object(g.a)(e)}).catch(e=>{throw Object(g.a)(e),new Error})),Promise.all(a).then(()=>n()).catch(()=>r("error",Object(s.__)("There was a problem updating your product types",'woocommerce')))}onChange(e){this.setState(t=>{if(Object(i.includes)(t.selected,e))return{selected:Object(i.filter)(t.selected,t=>t!==e)||[]};const o=t.selected;return o.push(e),{selected:o}},()=>this.validateField())}render(){const{productTypes:e=[]}=this.props,{error:t,isMonthlyPricing:o,isWCPayInstalled:n,selected:c}=this.state,{countryCode:i,isInstallingActivating:a,isProductTypesRequesting:l,isProfileItemsRequesting:m}=this.props;return l?Object(r.createElement)("div",{className:"woocommerce-profile-wizard__product-types__spinner"},Object(r.createElement)(_.Spinner,null)):Object(r.createElement)("div",{className:"woocommerce-profile-wizard__product-types"},Object(r.createElement)("div",{className:"woocommerce-profile-wizard__step-header"},Object(r.createElement)(N.Text,{variant:"title.small",as:"h2",size:"20",lineHeight:"28px"},Object(s.__)("What type of products will be listed?",'woocommerce')),Object(r.createElement)(N.Text,{variant:"body",as:"p"},Object(s.__)("Choose any that apply",'woocommerce'))),Object(r.createElement)(_.Card,null,Object(r.createElement)(_.CardBody,{size:null},Object.keys(e).map(t=>Object(r.createElement)(_.CheckboxControl,{key:t,label:Object(r.createElement)(Y,{description:e[t].description,label:e[t].label,annualPrice:e[t].yearly_price,isMonthlyPricing:o,moreUrl:e[t].more_url,slug:t}),onChange:()=>this.onChange(t),checked:c.includes(t),className:"woocommerce-profile-wizard__checkbox"})),t&&Object(r.createElement)("span",{className:"woocommerce-profile-wizard__error"},t)),Object(r.createElement)(_.CardFooter,{isBorderless:!0,justify:"center"},Object(r.createElement)(_.Button,{isPrimary:!0,onClick:this.onContinue,isBusy:m||a,disabled:!c.length||m||a},Object(s.__)("Continue",'woocommerce')))),Object(r.createElement)("div",{className:"woocommerce-profile-wizard__card-help-footnote"},Object(r.createElement)("div",{className:"woocommerce-profile-wizard__product-types-pricing-toggle woocommerce-profile-wizard__checkbox"},Object(r.createElement)("label",{htmlFor:"woocommerce-product-types__pricing-toggle"},Object(r.createElement)(N.Text,{variant:"body",as:"p"},Object(s.__)("Display monthly prices",'woocommerce')),Object(r.createElement)(_.FormToggle,{id:"woocommerce-product-types__pricing-toggle",checked:o,onChange:()=>this.setState({isMonthlyPricing:!o})}))),Object(r.createElement)(N.Text,{variant:"caption",size:"12",lineHeight:"16px"},Object(s.__)("Billing is annual. All purchases are covered by our 30 day money back guarantee and include access to support and updates. Extensions will be added to a cart for you to purchase later.",'woocommerce')),window.wcAdminFeatures&&window.wcAdminFeatures.subscriptions&&"US"===i&&!n&&c.includes("subscriptions")&&Object(r.createElement)(N.Text,{variant:"body",size:"12",lineHeight:"16px",as:"p"},Object(s.__)("The following extensions will be added to your site for free: WooCommerce Payments. An account is required to use this feature.",'woocommerce'))))}}var K=Object(c.compose)(Object(a.withSelect)(e=>{const{getProfileItems:t,getProductTypes:o,getOnboardingError:r,hasFinishedResolution:s,isOnboardingRequesting:n}=e(m.ONBOARDING_STORE_NAME),{getSettings:c}=e(m.SETTINGS_STORE_NAME),{getInstalledPlugins:i,isPluginsRequesting:a}=e(m.PLUGINS_STORE_NAME),{general:l={}}=c("general");return{isError:Boolean(r("updateProfileItems")),profileItems:t(),isProfileItemsRequesting:n("updateProfileItems"),installedPlugins:i(),isInstallingActivating:a("installPlugins")||a("activatePlugins"),countryCode:Object(f.b)(l.woocommerce_default_country),productTypes:o(),isProductTypesRequesting:!s("getProductTypes")}}),Object(a.withDispatch)(e=>{const{updateProfileItems:t}=e(m.ONBOARDING_STORE_NAME),{createNotice:o}=e("core/notices"),{installAndActivatePlugins:r}=e(m.PLUGINS_STORE_NAME),{invalidateResolution:s}=e(m.ONBOARDING_STORE_NAME);return{createNotice:o,installAndActivatePlugins:r,invalidateResolution:s,updateProfileItems:t}}))(Q);class X extends r.Component{renderStepper(){const{currentStep:e,steps:t}=this.props,o=Object(i.filter)(t,e=>!!e.label),s=o.findIndex(t=>t.key===e);return o.map((e,t)=>{const r=o[t-1];return t<s&&(e.isComplete=!0),r&&!r.isComplete||(e.onClick=e=>Object(l.updateQueryString)({step:e})),e}),Object(r.createElement)(h.Stepper,{steps:o,currentStep:e})}render(){const e=this.props.steps.find(e=>e.key===this.props.currentStep);return e&&e.label?Object(r.createElement)("div",{className:"woocommerce-profile-wizard__header"},this.renderStepper()):null}}var ee=o(527),te=o(514);o(573);const oe=_.FlexItem||(({children:e,align:t})=>{const o={display:"flex","justify-content":t?"center":"flex-start"};return Object(r.createElement)("div",{style:o},e)}),re=()=>Object(r.createElement)("div",{className:"woocommerce-admin__store-details__spinner"},Object(r.createElement)(_.Spinner,null));class se extends r.Component{constructor(e){super(e),this.state={showUsageModal:!1,skipping:!1,isStoreDetailsPopoverVisible:!1,isSkipSetupPopoverVisible:!1},this.onContinue=this.onContinue.bind(this),this.onSubmit=this.onSubmit.bind(this)}deriveCurrencySettings(e){if(!e)return null;const t=this.context,o=Object(f.b)(e),{currencySymbols:r={},localeInfo:s={}}=Object(u.f)("onboarding",{});return t.getDataForCountry(o,s,r)}onSubmit(){this.setState({showUsageModal:!0,skipping:!1})}async onContinue(e){const{createNotice:t,goToNextStep:o,updateProfileItems:r,updateAndPersistSettingsForGroup:n,profileItems:c,settings:i,errorsRef:a}=this.props,l=this.deriveCurrencySettings(e.countryState);this.context.setCurrency(l),Object(d.recordEvent)("storeprofiler_store_details_continue",{store_country:Object(f.b)(e.countryState),derived_currency:l.currency_code,email_signup:e.isAgreeMarketing}),await n("general",{general:{...i,woocommerce_store_address:e.addressLine1,woocommerce_store_address_2:e.addressLine2,woocommerce_default_country:e.countryState,woocommerce_store_city:e.city,woocommerce_store_postcode:e.postCode,woocommerce_currency:l.code,woocommerce_currency_pos:l.symbolPosition,woocommerce_price_thousand_sep:l.thousandSeparator,woocommerce_price_decimal_sep:l.decimalSeparator,woocommerce_price_num_decimals:l.precision}});const m={is_agree_marketing:e.isAgreeMarketing,store_email:e.storeEmail};if("US"!==Object(f.c)(e.countryState)&&c.industry&&c.industry.length){const e="cbd-other-hemp-derived-products",t=c.industry.filter(t=>e!==t&&e!==t.slug);m.industry=t}let u=[];try{await r(m)}catch(e){var p;null!=e&&null!==(p=e.data)&&void 0!==p&&p.params&&(u=Object.values(e.data.params))}Boolean(a.current.settings)||u.length?(t("error",Object(s.__)("There was a problem saving your store details",'woocommerce')),u.forEach(e=>t("error",e))):o()}validateStoreDetails(e){const t=Object(ee.b)(e);return!e.isAgreeMarketing||e.storeEmail&&e.storeEmail.trim().length||(t.storeEmail=Object(s.__)("Please add an email address",'woocommerce')),e.storeEmail&&e.storeEmail.trim().length&&-1===e.storeEmail.indexOf("@")&&(t.storeEmail=Object(s.__)("Invalid email address",'woocommerce')),t}render(){const{showUsageModal:e,skipping:t,isStoreDetailsPopoverVisible:o,isSkipSetupPopoverVisible:n}=this.state,{skipProfiler:c,isLoading:i,isBusy:a,initialValues:l}=this.props,m=Object(s.__)("Manual setup is only recommended for\n experienced WooCommerce users or developers.",'woocommerce'),d=Object(s.__)("Your store address will help us configure currency\n options and shipping rules automatically.\n This information will not be publicly visible and can\n easily be changed later.",'woocommerce');return i?Object(r.createElement)("div",{className:"woocommerce-profile-wizard__store-details"},Object(r.createElement)(re,null)):Object(r.createElement)("div",{className:"woocommerce-profile-wizard__store-details"},Object(r.createElement)("div",{className:"woocommerce-profile-wizard__step-header"},Object(r.createElement)(N.Text,{variant:"title.small",as:"h2",size:"20",lineHeight:"28px"},Object(s.__)("Welcome to WooCommerce",'woocommerce')),Object(r.createElement)(N.Text,{variant:"body",as:"p"},Object(s.__)("Tell us about your store and we'll get you set up in no time",'woocommerce'),Object(r.createElement)(_.Button,{isTertiary:!0,label:Object(s.__)("Learn more about store details",'woocommerce'),onClick:()=>this.setState({isStoreDetailsPopoverVisible:!0})},Object(r.createElement)(T.a,{icon:$}))),o&&Object(r.createElement)(_.Popover,{focusOnMount:"container",position:"top center",onClose:()=>this.setState({isStoreDetailsPopoverVisible:!1})},d)),Object(r.createElement)(h.Form,{initialValues:l,onSubmit:this.onSubmit,validate:this.validateStoreDetails},({getInputProps:o,handleSubmit:n,values:i,isValidForm:l,setValue:m})=>Object(r.createElement)(_.Card,null,e&&Object(r.createElement)(te.a,{onContinue:()=>{t?c():this.onContinue(i)},onClose:()=>this.setState({showUsageModal:!1,skipping:!1})}),Object(r.createElement)(_.CardBody,null,Object(r.createElement)(ee.a,{getInputProps:o,setValue:m}),Object(r.createElement)(h.TextControl,b()({label:Object(s.__)("Email address",'woocommerce'),required:!0,autoComplete:"email"},o("storeEmail")))),Object(r.createElement)(_.CardFooter,null,Object(r.createElement)(oe,null,Object(r.createElement)("div",{className:"woocommerce-profile-wizard__newsletter-signup"},Object(r.createElement)(_.CheckboxControl,b()({label:Object(r.createElement)(r.Fragment,null,Object(s.__)("Get tips, product updates and inspiration straight to your mailbox.",'woocommerce')," ",Object(r.createElement)("span",{className:"woocommerce-profile-wizard__powered-by-mailchimp"},Object(s.__)("Powered by Mailchimp",'woocommerce')))},o("isAgreeMarketing")))))),Object(r.createElement)(_.CardFooter,{justify:"center"},Object(r.createElement)(_.Button,{isPrimary:!0,onClick:n,isBusy:a,disabled:!l||a},Object(s.__)("Continue",'woocommerce'))))),Object(r.createElement)("div",{className:"woocommerce-profile-wizard__footer"},Object(r.createElement)(_.Button,{isLink:!0,className:"woocommerce-profile-wizard__footer-link",onClick:()=>(this.setState({showUsageModal:!0,skipping:!0}),!1)},Object(s.__)("Skip setup store details",'woocommerce')),Object(r.createElement)(_.Button,{isTertiary:!0,label:m,onClick:()=>this.setState({isSkipSetupPopoverVisible:!0})},Object(r.createElement)(T.a,{icon:$})),n&&Object(r.createElement)(_.Popover,{focusOnMount:"container",position:"top center",onClose:()=>this.setState({isSkipSetupPopoverVisible:!1})},m)))}}se.contextType=O.a;var ne=Object(c.compose)(Object(a.withSelect)(e=>{const{getSettings:t,getSettingsError:o,isUpdateSettingsRequesting:s}=e(m.SETTINGS_STORE_NAME),{getProfileItems:n,isOnboardingRequesting:c,getEmailPrefill:i,hasFinishedResolution:a}=e(m.ONBOARDING_STORE_NAME),{isResolving:l}=e(m.OPTIONS_STORE_NAME),d=n(),u=i(),{general:p={}}=t("general"),b=c("updateProfileItems")||s("general")||l("getOption",["woocommerce_allow_tracking"]),h=!a("getProfileItems")||!a("getEmailPrefill"),_=Object(r.useRef)({settings:null});_.current={settings:o("general")};const O=p.woocommerce_store_address&&p.woocommerce_default_country||"";return{initialValues:{addressLine1:p.woocommerce_store_address||"",addressLine2:p.woocommerce_store_address_2||"",city:p.woocommerce_store_city||"",countryState:O,postCode:p.woocommerce_store_postcode||"",isAgreeMarketing:"boolean"!=typeof d.is_agree_marketing||d.is_agree_marketing,storeEmail:"string"==typeof d.store_email?d.store_email:u},isLoading:h,profileItems:d,isBusy:b,settings:p,errorsRef:_}}),Object(a.withDispatch)(e=>{const{createNotice:t}=e("core/notices"),{updateProfileItems:o}=e(m.ONBOARDING_STORE_NAME),{updateAndPersistSettingsForGroup:r}=e(m.SETTINGS_STORE_NAME);return{createNotice:t,updateProfileItems:o,updateAndPersistSettingsForGroup:r}}))(se),ce=o(17),ie=o.n(ce),ae=o(28),le=o(574),me=o.n(le),de=(o(575),o(6)),ue=o.n(de),pe=o(576),be=o.n(pe),he=o(1),_e=o.n(he),Oe=o(476);const ge=({children:e,className:t})=>Object(Oe.isWpVersion)("5.8",">=")?Object(r.createElement)("div",{className:t},e):Object(r.createElement)(_.DropZoneProvider,null,Object(r.createElement)("div",{className:t},e));class je extends r.Component{constructor(){super(),this.state={isUploading:!1},this.handleFilesUpload=this.handleFilesUpload.bind(this),this.handleFilesDrop=this.handleFilesDrop.bind(this)}handleFilesDrop(e){const t=e[0];this.uploadTheme(t)}handleFilesUpload(e){const t=e.target.files[0];this.uploadTheme(t)}uploadTheme(e){const{createNotice:t,onUploadComplete:o}=this.props;this.setState({isUploading:!0});const r=new window.FormData;return r.append("pluginzip",e),ie()({path:"/wc-admin/themes",method:"POST",body:r}).then(e=>{o(e),this.setState({isUploading:!1}),t(e.status,e.message)}).catch(e=>{this.setState({isUploading:!1}),e&&e.message&&t("error",e.message)})}render(){const{className:e}=this.props,{isUploading:t}=this.state,o=ue()("woocommerce-theme-uploader",e,{"is-uploading":t});return Object(r.createElement)(_.Card,{className:o},Object(r.createElement)(ge,{className:"woocommerce-theme-uploader__dropzone-wrapper"},t?Object(r.createElement)(r.Fragment,null,Object(r.createElement)(h.Spinner,null),Object(r.createElement)(h.H,{className:"woocommerce-theme-uploader__title"},Object(s.__)("Uploading theme",'woocommerce')),Object(r.createElement)("p",null,Object(s.__)("Your theme is being uploaded",'woocommerce'))):Object(r.createElement)(r.Fragment,null,Object(r.createElement)(_.FormFileUpload,{accept:".zip",onChange:this.handleFilesUpload},Object(r.createElement)(be.a,null),Object(r.createElement)(h.H,{className:"woocommerce-theme-uploader__title"},Object(s.__)("Upload a theme",'woocommerce')),Object(r.createElement)("p",null,Object(s.__)("Drop a theme zip file here to upload",'woocommerce'))),Object(r.createElement)(_.DropZone,{label:Object(s.__)("Drop your theme zip file here",'woocommerce'),onFilesDrop:this.handleFilesDrop}))))}}je.propTypes={className:_e.a.string,onUploadComplete:_e.a.func},je.defaultProps={onUploadComplete:i.noop};var we=Object(c.compose)(Object(a.withDispatch)(e=>{const{createNotice:t}=e("core/notices");return{createNotice:t}}))(je),fe=o(497),Ce=o(577),Ee=o.n(Ce),ye=o(578),ve=o.n(ye),Se=o(579),ke=o.n(Se);const Ne=[{key:"mobile",icon:Ee.a},{key:"tablet",icon:ve.a},{key:"desktop",icon:ke.a}];class Te extends r.Component{constructor(){super(...arguments),this.state={device:"desktop"},this.handleDeviceClick=this.handleDeviceClick.bind(this)}handleDeviceClick(e){const{theme:t}=this.props;Object(d.recordEvent)("storeprofiler_store_theme_demo_device",{device:e,theme:t.slug}),this.setState({device:e})}render(){const{isBusy:e,onChoose:t,onClose:o,theme:n}=this.props,{demo_url:c,slug:i,title:a}=n,{device:l}=this.state;return Object(r.createElement)("div",{className:"woocommerce-theme-preview"},Object(r.createElement)("div",{className:"woocommerce-theme-preview__toolbar"},Object(r.createElement)(_.Button,{className:"woocommerce-theme-preview__close",onClick:o},Object(r.createElement)(T.a,{icon:fe.a})),Object(r.createElement)("div",{className:"woocommerce-theme-preview__theme-name"},M()({mixedString:Object(s.sprintf)(Object(s.__)("{{strong}}%s{{/strong}} developed by WooCommerce",'woocommerce'),a),components:{strong:Object(r.createElement)("strong",null)}})),Object(r.createElement)("div",{className:"woocommerce-theme-preview__devices"},Ne.map(e=>{const t=e.icon;return Object(r.createElement)(_.Button,{key:e.key,className:ue()("woocommerce-theme-preview__device",{"is-selected":e.key===l}),onClick:()=>this.handleDeviceClick(e.key)},Object(r.createElement)(t,null))})),Object(r.createElement)(_.Button,{isPrimary:!0,onClick:()=>t(i,"preview"),isBusy:e},Object(s.__)("Choose",'woocommerce'))),Object(r.createElement)(h.WebPreview,{src:c,title:a,className:"is-"+l}))}}var Pe=Te;class xe extends r.Component{constructor(){super(...arguments),this.state={activeTab:"all",chosen:null,demo:null,uploadedThemes:[]},this.handleUploadComplete=this.handleUploadComplete.bind(this),this.onChoose=this.onChoose.bind(this),this.onClosePreview=this.onClosePreview.bind(this),this.onSelectTab=this.onSelectTab.bind(this),this.openDemo=this.openDemo.bind(this),this.skipStep=this.skipStep.bind(this)}componentDidUpdate(e){const{isError:t,isUpdatingProfileItems:o,createNotice:r}=this.props,{chosen:n}=this.state,c=!o&&e.isUpdatingProfileItems&&!t&&n,i=!o&&e.isRequesting&&t;c&&(this.setState({chosen:null}),this.props.goToNextStep()),i&&(this.setState({chosen:null}),r("error",Object(s.__)("There was a problem selecting your store theme",'woocommerce')))}onChoose(e,t=""){const{updateProfileItems:o}=this.props,{is_installed:r,price:s,slug:n}=e,{activeTheme:c=""}=Object(u.f)("onboarding",{});this.setState({chosen:n}),Object(d.recordEvent)("storeprofiler_store_theme_choose",{theme:n,location:t}),n!==c&&Object(f.d)(s)<=0?r?this.activateTheme(n):this.installTheme(n):o({theme:n})}installTheme(e){const{createNotice:t}=this.props;ie()({path:"/wc-admin/onboarding/themes/install?theme="+e,method:"POST"}).then(o=>{t("success",Object(s.sprintf)(Object(s.__)("%s was installed on your site",'woocommerce'),o.name)),this.activateTheme(e)}).catch(e=>{this.setState({chosen:null}),t("error",e.message)})}activateTheme(e){const{createNotice:t,updateProfileItems:o}=this.props;ie()({path:"/wc-admin/onboarding/themes/activate?theme="+e,method:"POST"}).then(r=>{t("success",Object(s.sprintf)(Object(s.__)("%s was activated on your site",'woocommerce'),r.name)),Object(u.g)("onboarding",{...Object(u.f)("onboarding",{}),activeTheme:r.slug}),o({theme:e})}).catch(e=>{this.setState({chosen:null}),t("error",e.message)})}onClosePreview(){const{demo:e}=this.state;Object(d.recordEvent)("storeprofiler_store_theme_demo_close",{theme:e.slug}),document.body.classList.remove("woocommerce-theme-preview-active"),this.setState({demo:null})}openDemo(e){Object(d.recordEvent)("storeprofiler_store_theme_live_demo",{theme:e.slug}),document.body.classList.add("woocommerce-theme-preview-active"),this.setState({demo:e})}skipStep(){const{activeTheme:e=""}=Object(u.f)("onboarding",{});Object(d.recordEvent)("storeprofiler_store_theme_skip_step",{activeTheme:e}),this.props.goToNextStep()}renderTheme(e){const{demo_url:t,has_woocommerce_support:o,image:n,slug:c,title:i}=e,{chosen:a}=this.state,{activeTheme:l=""}=Object(u.f)("onboarding",{});return Object(r.createElement)(_.Card,{className:"woocommerce-profile-wizard__theme",key:c},Object(r.createElement)(_.CardBody,{size:null},n&&Object(r.createElement)("div",{className:"woocommerce-profile-wizard__theme-image",style:{backgroundImage:`url(${n})`},role:"img","aria-label":i})),Object(r.createElement)(_.CardBody,{className:"woocommerce-profile-wizard__theme-details"},Object(r.createElement)(h.H,{className:"woocommerce-profile-wizard__theme-name"},i,!o&&Object(r.createElement)(_.Tooltip,{text:Object(s.__)("This theme does not support WooCommerce.",'woocommerce')},Object(r.createElement)("span",null,Object(r.createElement)(me.a,{role:"img","aria-hidden":"true",focusable:"false"})))),Object(r.createElement)("p",{className:"woocommerce-profile-wizard__theme-status"},this.getThemeStatus(e))),Object(r.createElement)(_.CardFooter,null,c===l?Object(r.createElement)(_.Button,{isPrimary:!0,onClick:()=>this.onChoose(e,"card"),isBusy:a===c,disabled:a===c},Object(s.__)("Continue with my active theme",'woocommerce')):Object(r.createElement)(_.Button,{isSecondary:!0,onClick:()=>this.onChoose(e,"card"),isBusy:a===c,disabled:a===c},Object(s.__)("Choose",'woocommerce')),t&&Object(r.createElement)(_.Button,{isTertiary:!0,onClick:()=>this.openDemo(e)},Object(s.__)("Live demo",'woocommerce'))))}getThemeStatus(e){const{is_installed:t,price:o,slug:r}=e,{activeTheme:n=""}=Object(u.f)("onboarding",{});return n===r?Object(s.__)("Currently active theme",'woocommerce'):t?Object(s.__)("Installed",'woocommerce'):Object(f.d)(o)<=0?Object(s.__)("Free",'woocommerce'):Object(s.sprintf)(Object(s.__)("%s per year",'woocommerce'),Object(ae.decodeEntities)(o))}doesActiveThemeSupportWooCommerce(){const{activeTheme:e=""}=Object(u.f)("onboarding",{}),t=this.getThemes().find(t=>t.slug===e);return t&&t.has_woocommerce_support}onSelectTab(e){Object(d.recordEvent)("storeprofiler_store_theme_navigate",{navigation:e}),this.setState({activeTab:e})}getPriceValue(e){return Number(Object(ae.decodeEntities)(e).replace(/[^0-9.-]+/g,""))}getThemes(e="all"){const{uploadedThemes:t}=this.state,{activeTheme:o="",themes:r=[]}=Object(u.f)("onboarding",{}),s=[...r.filter(e=>e&&(e.has_woocommerce_support||e.slug===o)),...t];switch(e){case"paid":return s.filter(e=>Object(f.d)(e.price)>0);case"free":return s.filter(e=>Object(f.d)(e.price)<=0);case"all":default:return s}}handleUploadComplete(e){"success"===e.status&&e.theme_data&&(this.setState({uploadedThemes:[...this.state.uploadedThemes,e.theme_data]}),Object(d.recordEvent)("storeprofiler_store_theme_upload",{theme:e.theme_data.slug}))}render(){const{activeTab:e,chosen:t,demo:o}=this.state,n=this.getThemes(e),c=this.doesActiveThemeSupportWooCommerce();return Object(r.createElement)(r.Fragment,null,Object(r.createElement)("div",{className:"woocommerce-profile-wizard__step-header"},Object(r.createElement)(N.Text,{variant:"title.small",as:"h2",size:"20",lineHeight:"28px"},Object(s.__)("Choose a theme",'woocommerce')),Object(r.createElement)(N.Text,{variant:"body",as:"p"},Object(s.__)("Choose how your store appears to customers. And don't worry, you can always switch themes and edit them later.",'woocommerce'))),Object(r.createElement)(_.TabPanel,{className:"woocommerce-profile-wizard__themes-tab-panel",activeClass:"is-active",onSelect:this.onSelectTab,tabs:[{name:"all",title:Object(s.__)("All themes",'woocommerce')},{name:"paid",title:Object(s.__)("Paid themes",'woocommerce')},{name:"free",title:Object(s.__)("Free themes",'woocommerce')}]},()=>Object(r.createElement)("div",{className:"woocommerce-profile-wizard__themes"},n&&n.map(e=>this.renderTheme(e)),Object(r.createElement)(we,{onUploadComplete:this.handleUploadComplete}))),o&&Object(r.createElement)(Pe,{theme:o,onChoose:()=>this.onChoose(o,"card"),onClose:this.onClosePreview,isBusy:t===o.slug}),c&&Object(r.createElement)("p",{className:"woocommerce-profile-wizard__themes-skip-this-step"},Object(r.createElement)(_.Button,{isLink:!0,className:"woocommerce-profile-wizard__skip",onClick:()=>this.skipStep()},Object(s.__)("Skip this step",'woocommerce'))))}}var Ie=Object(c.compose)(Object(a.withSelect)(e=>{const{getProfileItems:t,getOnboardingError:o,isOnboardingRequesting:r}=e(m.ONBOARDING_STORE_NAME);return{isError:Boolean(o("updateProfileItems")),isUpdatingProfileItems:r("updateProfileItems"),profileItems:t()}}),Object(a.withDispatch)(e=>{const{updateProfileItems:t}=e(m.ONBOARDING_STORE_NAME),{createNotice:o}=e("core/notices");return{createNotice:o,updateProfileItems:t}}))(xe);o(580);class Me extends r.Component{constructor(e){super(e),this.cachedActivePlugins=e.activePlugins,this.goToNextStep=this.goToNextStep.bind(this)}componentDidUpdate(e){const{step:t}=e.query,{step:o}=this.props.query,{isError:r,isGetProfileItemsRequesting:n,createNotice:c}=this.props;!n&&e.isRequesting&&r&&c("error",Object(s.__)("There was a problem finishing the setup wizard",'woocommerce')),t!==o&&(window.document.documentElement.scrollTop=0,Object(d.recordEvent)("storeprofiler_step_view",{step:this.getCurrentStep().key}))}componentDidMount(){document.body.classList.remove("woocommerce-admin-is-loading"),document.body.classList.add("woocommerce-onboarding"),document.body.classList.add("woocommerce-profile-wizard__body"),document.body.classList.add("woocommerce-admin-full-screen"),document.body.classList.add("is-wp-toolbar-disabled"),Object(d.recordEvent)("storeprofiler_step_view",{step:this.getCurrentStep().key})}componentWillUnmount(){document.body.classList.remove("woocommerce-onboarding"),document.body.classList.remove("woocommerce-profile-wizard__body"),document.body.classList.remove("woocommerce-admin-full-screen"),document.body.classList.remove("is-wp-toolbar-disabled")}getSteps(){const{profileItems:e}=this.props,t=[];return t.push({key:"store-details",container:ne,label:Object(s.__)("Store Details",'woocommerce'),isComplete:e.hasOwnProperty("setup_client")&&null!==e.setup_client}),t.push({key:"industry",container:W,label:Object(s.__)("Industry",'woocommerce'),isComplete:e.hasOwnProperty("industry")&&null!==e.industry}),t.push({key:"product-types",container:K,label:Object(s.__)("Product Types",'woocommerce'),isComplete:e.hasOwnProperty("product_types")&&null!==e.product_types}),t.push({key:"business-features",container:q,label:Object(s.__)("Business Details",'woocommerce'),isComplete:e.hasOwnProperty("product_count")&&null!==e.product_count}),t.push({key:"theme",container:Ie,label:Object(s.__)("Theme",'woocommerce'),isComplete:e.hasOwnProperty("theme")&&null!==e.theme}),Object(n.applyFilters)("woocommerce_admin_profile_wizard_steps",t)}getCurrentStep(){const{step:e}=this.props.query,t=this.getSteps().find(t=>t.key===e);return t||this.getSteps()[0]}async goToNextStep(){const{activePlugins:e,dismissedTasks:t,updateOptions:o}=this.props,r=this.getCurrentStep(),s=this.getSteps().findIndex(e=>e.key===r.key);Object(d.recordEvent)("storeprofiler_step_complete",{step:r.key}),t.length&&o({woocommerce_task_list_dismissed_tasks:[]}),this.cachedActivePlugins=e;const n=this.getSteps()[s+1];if(void 0!==n)return Object(l.updateQueryString)({step:n.key});this.completeProfiler()}completeProfiler(){const{activePlugins:e,isJetpackConnected:t,notes:o,updateNote:r,updateProfileItems:s,connectToJetpack:n}=this.props;Object(d.recordEvent)("storeprofiler_complete");const c=e.includes("jetpack")&&!t,i=o.find(e=>"wc-admin-onboarding-profiler-reminder"===e.name);i&&r(i.id,{status:"actioned"}),s({completed:!0}).then(()=>{const e=new URL(Object(l.getNewPath)({},"/",{}),window.location.href).href;c?(document.body.classList.add("woocommerce-admin-is-loading"),n(()=>e)):window.location.href=e})}skipProfiler(){const{createNotice:e,updateProfileItems:t}=this.props;t({skipped:!0}).then(()=>{Object(d.recordEvent)("storeprofiler_store_details_skip"),Object(l.getHistory)().push(Object(l.getNewPath)({},"/",{}))}).catch(()=>{e("error",Object(s.__)("There was a problem skipping the setup wizard",'woocommerce'))})}render(){const{query:e}=this.props,t=this.getCurrentStep(),o=t.key,s=Object(r.createElement)(t.container,{query:e,step:t,goToNextStep:this.goToNextStep,skipProfiler:()=>{this.skipProfiler()}}),n=this.getSteps().map(e=>Object(i.pick)(e,["key","label","isComplete"])),c="woocommerce-profile-wizard__container "+o;return Object(r.createElement)(r.Fragment,null,Object(r.createElement)(X,{currentStep:o,steps:n}),Object(r.createElement)("div",{className:c},s))}}t.default=Object(c.compose)(Object(a.withSelect)(e=>{const{getNotes:t}=e(m.NOTES_STORE_NAME),{getOption:o}=e(m.OPTIONS_STORE_NAME),{getProfileItems:r,getOnboardingError:s}=e(m.ONBOARDING_STORE_NAME),{getActivePlugins:n,getPluginsError:c,isJetpackConnected:i}=e(m.PLUGINS_STORE_NAME),a=r(),l=t({page:1,per_page:m.QUERY_DEFAULTS.pageSize,type:"update",status:"unactioned"}),d=n();return{dismissedTasks:o("woocommerce_task_list_dismissed_tasks")||[],getPluginsError:c,isError:Boolean(s("updateProfileItems")),isJetpackConnected:i(),notes:l,profileItems:a,activePlugins:d}}),Object(a.withDispatch)(e=>{const{connectToJetpackWithFailureRedirect:t,createErrorNotice:o}=e(m.PLUGINS_STORE_NAME),{updateNote:r}=e(m.NOTES_STORE_NAME),{updateOptions:s}=e(m.OPTIONS_STORE_NAME),{updateProfileItems:n}=e(m.ONBOARDING_STORE_NAME),{createNotice:c}=e("core/notices");return{connectToJetpack:e=>{t(e,o,u.e)},createNotice:c,updateNote:r,updateOptions:s,updateProfileItems:n}}),Object(u.f)("plugins")?Object(m.withPluginsHydration)({...Object(u.f)("plugins"),jetpackStatus:Object(u.f)("dataEndpoints",{}).jetpackStatus}):i.identity)(Me)}}]);woocommerce-admin/dist/chunks/34.style.css000064400000027011151335517650014522 0ustar00.woocommerce-marketing-overview{max-width:1032px;margin:0 auto}.woocommerce-marketing-overview .components-card{margin-bottom:24px}.woocommerce-marketing-installed-extensions-card__item{display:flex;align-items:center;padding:18px 24px}.woocommerce-marketing-installed-extensions-card__item h4{font-weight:400;font-size:16px;margin:0 0 5px;color:#1e1e1e}.woocommerce-marketing-installed-extensions-card__item p{color:#757575;margin:0}.woocommerce-marketing-installed-extensions-card__item:not(:last-child){border-bottom:1px solid #e0e0e0}.woocommerce-marketing-installed-extensions-card__item-text-and-actions{display:flex;flex-wrap:wrap;align-items:center;flex-grow:2;min-width:0}@media(min-width:601px){.woocommerce-marketing-installed-extensions-card__item-text-and-actions{flex-wrap:nowrap}}@media(min-width:601px){.woocommerce-marketing-installed-extensions-card__item-actions{text-align:right;white-space:nowrap;padding-left:25px}}@media(min-width:961px){.woocommerce-marketing-installed-extensions-card__item-description{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:550px}}.woocommerce-marketing-installed-extensions-card__item-links{margin:0;padding:0}.woocommerce-marketing-installed-extensions-card__item-links li{display:inline-block;margin:0 25px 0 0}@media(min-width:601px){.woocommerce-marketing-installed-extensions-card__item-links li{margin:0 0 0 30px}}.woocommerce-marketing-installed-extensions-card__item-links a{font-weight:600;color:#007cba!important;color:var(--wp-admin-theme-color)!important;text-decoration:none;font-size:14px}.woocommerce-marketing-installed-extensions-card .woocommerce-admin-marketing-product-icon{align-self:flex-start;margin-right:14px;margin-top:2px}.woocommerce-marketing-installed-extensions-card__item-text{min-width:0;flex-grow:2;margin:0 0 10px;width:100%}@media(min-width:601px){.woocommerce-marketing-installed-extensions-card__item-text{margin:0;width:auto}}.components-button.woocommerce-admin-marketing-button:not([disabled]){border-color:#007cba!important;border-color:var(--wp-admin-theme-color)!important;color:#007cba!important;color:var(--wp-admin-theme-color)!important}.woocommerce-admin-marketing-card .components-card__header .woocommerce-admin-marketing-card-subtitle{font-weight:400;margin-top:4px;color:#757575}.woocommerce-admin-marketing-product-icon{position:relative;overflow:hidden;width:36px;height:36px;border-radius:8px;background:#f0f0f0;color:#f0f0f0}.woocommerce-admin-marketing-product-icon svg{width:36px;height:36px}.woocommerce-marketing-slider,.woocommerce-marketing-slider>div{display:block;width:100%;overflow:hidden}.woocommerce-marketing-slider>div{white-space:normal;position:relative;height:100%}.woocommerce-marketing-slider__slide{top:0;left:0;width:100%;transition:transform .3s ease-in;position:relative}.woocommerce-marketing-slider .slide-enter,.woocommerce-marketing-slider .slide-exit{position:absolute}.woocommerce-marketing-slider.animate-right .slide-enter{transform:translateX(-100%)}.woocommerce-marketing-slider.animate-right .slide-enter-active,.woocommerce-marketing-slider.animate-right .slide-exit{transform:translateX(0)}.woocommerce-marketing-slider.animate-left .slide-enter,.woocommerce-marketing-slider.animate-right .slide-exit-active{transform:translateX(100%)}.woocommerce-marketing-slider.animate-left .slide-enter-active,.woocommerce-marketing-slider.animate-left .slide-exit{transform:translateX(0)}.woocommerce-marketing-slider.animate-left .slide-exit-active{transform:translateX(-100%)}@media screen and (prefers-reduced-motion:reduce){.woocommerce-marketing-slider .slide-enter-active,.woocommerce-marketing-slider .slide-exit-active{transition:none!important}}.woocommerce-marketing-recommended-extensions-card .components-card__body{padding:12px}.woocommerce-marketing-recommended-extensions-card__items{display:flex;flex-wrap:wrap}@media(min-width:601px){.woocommerce-marketing-recommended-extensions-card__items>.is-loading.woocommerce-marketing-recommended-extensions-item,.woocommerce-marketing-recommended-extensions-card__items>a{width:50%}}@media(min-width:961px){.woocommerce-marketing-recommended-extensions-card__items>.is-loading.woocommerce-marketing-recommended-extensions-item,.woocommerce-marketing-recommended-extensions-card__items>a{width:33.3%}.woocommerce-marketing-recommended-extensions-card__items--count-1>.is-loading.woocommerce-marketing-recommended-extensions-item,.woocommerce-marketing-recommended-extensions-card__items--count-1>a{width:100%}.woocommerce-marketing-recommended-extensions-card__items--count-2>.is-loading.woocommerce-marketing-recommended-extensions-item,.woocommerce-marketing-recommended-extensions-card__items--count-2>a{width:50%}.woocommerce-marketing-recommended-extensions-card__items--count-4>.is-loading.woocommerce-marketing-recommended-extensions-item,.woocommerce-marketing-recommended-extensions-card__items--count-4>a{width:25%}}.woocommerce-marketing-recommended-extensions-item{display:block;padding:12px;text-decoration:none;position:relative}.woocommerce-marketing-recommended-extensions-item h4{color:#1e1e1e;margin:-2px 0 3px;font-size:16px;line-height:1.3;transition:color .2s ease}.woocommerce-marketing-recommended-extensions-item p{color:#757575;margin:0}.woocommerce-marketing-recommended-extensions-item:hover h4{color:#007cba;color:var(--wp-admin-theme-color)}.woocommerce-marketing-recommended-extensions-item:hover p{color:#1e1e1e}.woocommerce-marketing-recommended-extensions-item__text{padding-left:46px}.woocommerce-marketing-recommended-extensions-item .woocommerce-admin-marketing-product-icon{position:absolute;top:12px;left:12px}.woocommerce-marketing-recommended-extensions-item.is-loading .is-placeholder{animation:loading-fade 1.6s ease-in-out infinite;background-color:#f0f0f0;color:transparent;display:inline-block;min-height:16px}.woocommerce-marketing-recommended-extensions-item.is-loading .is-placeholder:after{content:" "}@media screen and (prefers-reduced-motion:reduce){.woocommerce-marketing-recommended-extensions-item.is-loading .is-placeholder{animation:none}}.woocommerce-marketing-recommended-extensions-item.is-loading h4{width:80%}.woocommerce-marketing-recommended-extensions-item.is-loading p :last-child{width:60%}.woocommerce-marketing-knowledgebase-card .woocommerce-marketing-slider{margin:0 0 14px}.woocommerce-marketing-knowledgebase-card .woocommerce-pagination{justify-content:flex-start;flex-direction:row}.woocommerce-marketing-knowledgebase-card__page{width:100%;display:flex}@media(max-width:960px){.woocommerce-marketing-knowledgebase-card__page{display:block}}.woocommerce-marketing-knowledgebase-card__post{display:flex;flex-wrap:wrap;width:100%;text-decoration:none}.woocommerce-marketing-knowledgebase-card__post:not(:last-child){margin-bottom:16px}@media(min-width:961px){.woocommerce-marketing-knowledgebase-card__post{flex-wrap:nowrap;width:50%}.woocommerce-marketing-knowledgebase-card__post:not(:last-child){margin-bottom:0;padding-right:16px}}.woocommerce-marketing-knowledgebase-card__post-img{width:100%;padding-bottom:52%;overflow:hidden;position:relative;flex:none;border-radius:3px}@media(min-width:961px){.woocommerce-marketing-knowledgebase-card__post-img{width:144px;height:103px;margin-right:16px;padding-bottom:0}}.woocommerce-marketing-knowledgebase-card__post-img img{position:absolute;top:0;right:0;display:block;width:100%}@media(min-width:961px){.woocommerce-marketing-knowledgebase-card__post-img img{position:absolute;top:0;right:0;height:100%;width:auto}}.woocommerce-marketing-knowledgebase-card__post-text{margin:10px 0 0;flex:1}@media(min-width:961px){.woocommerce-marketing-knowledgebase-card__post-text{margin:0}}.woocommerce-marketing-knowledgebase-card__post h3{margin-top:0;margin-bottom:6px;font-size:16px;line-height:24px;font-weight:600;white-space:normal;color:#1e1e1e;transition:color .2s ease}.woocommerce-marketing-knowledgebase-card__post:hover h3{color:#007cba;color:var(--wp-admin-theme-color)}.woocommerce-marketing-knowledgebase-card__post-meta{display:flex;justify-content:flex-start;align-items:center;font-size:12px;line-height:17px;color:#757575;margin:0;padding:0;height:17px}.woocommerce-marketing-knowledgebase-card__post-meta .woocommerce-gravatar{margin:1px 0 0 5px}.woocommerce-marketing-knowledgebase-card__post.is-loading .is-placeholder{animation:loading-fade 1.6s ease-in-out infinite;background-color:#f0f0f0;color:transparent}.woocommerce-marketing-knowledgebase-card__post.is-loading .is-placeholder:after{content:" "}@media screen and (prefers-reduced-motion:reduce){.woocommerce-marketing-knowledgebase-card__post.is-loading .is-placeholder{animation:none}}.woocommerce-marketing-knowledgebase-card__post.is-loading p{width:40%}:root{--wp-admin-theme-color:#007cba;--wp-admin-theme-color-darker-10:#006ba1;--wp-admin-theme-color-darker-20:#005a87}body.admin-color-light{--wp-admin-theme-color:#0085ba;--wp-admin-theme-color-darker-10:#0073a1;--wp-admin-theme-color-darker-20:#006187}body.admin-color-modern{--wp-admin-theme-color:#3858e9;--wp-admin-theme-color-darker-10:#2145e6;--wp-admin-theme-color-darker-20:#183ad6}body.admin-color-blue{--wp-admin-theme-color:#096484;--wp-admin-theme-color-darker-10:#07526c;--wp-admin-theme-color-darker-20:#064054}body.admin-color-coffee{--wp-admin-theme-color:#46403c;--wp-admin-theme-color-darker-10:#383330;--wp-admin-theme-color-darker-20:#2b2724}body.admin-color-ectoplasm{--wp-admin-theme-color:#523f6d;--wp-admin-theme-color-darker-10:#46365d;--wp-admin-theme-color-darker-20:#3a2c4d}body.admin-color-midnight{--wp-admin-theme-color:#e14d43;--wp-admin-theme-color-darker-10:#dd382d;--wp-admin-theme-color-darker-20:#d02c21}body.admin-color-ocean{--wp-admin-theme-color:#627c83;--wp-admin-theme-color-darker-10:#576e74;--wp-admin-theme-color-darker-20:#4c6066}body.admin-color-sunrise{--wp-admin-theme-color:#dd823b;--wp-admin-theme-color-darker-10:#d97426;--wp-admin-theme-color-darker-20:#c36922}.woocommerce-marketing-overview-welcome-card{position:relative}.woocommerce-marketing-overview-welcome-card .components-card__body{display:flex;justify-content:center;align-items:center;flex-wrap:wrap;padding:22px}@media(min-width:601px){.woocommerce-marketing-overview-welcome-card .components-card__body{flex-wrap:nowrap}}@media(min-width:961px){.woocommerce-marketing-overview-welcome-card .components-card__body{padding:32px 108px}}.woocommerce-marketing-overview-welcome-card__hide-button{display:flex;align-items:center;padding:8px;margin:0;border:none;background:none;color:#757575;overflow:hidden;border-radius:4px;position:absolute;top:10px;right:10px}.woocommerce-marketing-overview-welcome-card__hide-button svg{fill:currentColor;outline:none}.woocommerce-marketing-overview-welcome-card__hide-button:not(:disabled):not([aria-disabled=true]):not(.is-default):hover{background-color:#fff;color:#1e1e1e;box-shadow:inset 0 0 0 1px #ccc,inset 0 0 0 2px #fff,0 1px 1px rgba(30,30,30,.2)}.woocommerce-marketing-overview-welcome-card__hide-button:not(:disabled):not([aria-disabled=true]):not(.is-default):active{outline:none;background-color:#fff;color:#1e1e1e;box-shadow:inset 0 0 0 1px #ccc,inset 0 0 0 2px #fff}.woocommerce-marketing-overview-welcome-card__hide-button:disabled:focus,.woocommerce-marketing-overview-welcome-card__hide-button[aria-disabled=true]:focus{box-shadow:none}.woocommerce-marketing-overview-welcome-card h3{font-size:20px;line-height:26px;font-weight:400;text-align:center;margin:1em 0 0}@media(min-width:601px){.woocommerce-marketing-overview-welcome-card h3{text-align:left;margin:0 0 0 20px}}@media(min-width:961px){.woocommerce-marketing-overview-welcome-card h3{font-size:24px;line-height:32px}}.woocommerce-marketing-overview-welcome-card img{width:231px;flex:none}woocommerce-admin/dist/chunks/analytics-report-taxes.js000064400000016127151335517650017411 0ustar00(window.__wcAdmin_webpackJsonp=window.__wcAdmin_webpackJsonp||[]).push([[15],{485:function(e,t,r){"use strict";r.r(t);var a=r(0),o=r(1),c=r.n(o),n=r(2),i=r(535),s=r(510),d=r(508),l=r(511),m=r(4),u=r(21),b=r(12),_=r(120),p=r(503),y=r(506),x=r(501);class h extends a.Component{constructor(){super(),this.getHeadersContent=this.getHeadersContent.bind(this),this.getRowsContent=this.getRowsContent.bind(this),this.getSummary=this.getSummary.bind(this)}getHeadersContent(){return[{label:Object(n.__)("Tax code",'woocommerce'),key:"tax_code",required:!0,isLeftAligned:!0,isSortable:!0},{label:Object(n.__)("Rate",'woocommerce'),key:"rate",isSortable:!0,isNumeric:!0},{label:Object(n.__)("Total tax",'woocommerce'),key:"total_tax",isSortable:!0},{label:Object(n.__)("Order tax",'woocommerce'),key:"order_tax",isSortable:!0},{label:Object(n.__)("Shipping tax",'woocommerce'),key:"shipping_tax",isSortable:!0},{label:Object(n.__)("Orders",'woocommerce'),key:"orders_count",required:!0,defaultSort:!0,isSortable:!0,isNumeric:!0}]}getRowsContent(e){const{render:t,formatDecimal:r,getCurrencyConfig:o}=this.context;return Object(m.map)(e,e=>{const{query:c}=this.props,{order_tax:n,orders_count:i,tax_rate:s,tax_rate_id:d,total_tax:l,shipping_tax:m}=e,y=Object(p.a)(e),x=Object(b.getPersistedQuery)(c),h=Object(b.getNewPath)(x,"/analytics/orders",{filter:"advanced",tax_rate_includes:d});return[{display:Object(a.createElement)(u.Link,{href:h,type:"wc-admin"},y),value:y},{display:s.toFixed(2)+"%",value:s},{display:t(l),value:r(l)},{display:t(n),value:r(n)},{display:t(m),value:r(m)},{display:Object(_.formatValue)(o(),"number",i),value:i}]})}getSummary(e){const{tax_codes:t=0,total_tax:r=0,order_tax:a=0,shipping_tax:o=0,orders_count:c=0}=e,{formatAmount:i,getCurrencyConfig:s}=this.context,d=s();return[{label:Object(n._n)("tax code","tax codes",t,'woocommerce'),value:Object(_.formatValue)(d,"number",t)},{label:Object(n.__)("total tax",'woocommerce'),value:i(r)},{label:Object(n.__)("order tax",'woocommerce'),value:i(a)},{label:Object(n.__)("shipping tax",'woocommerce'),value:i(o)},{label:Object(n._n)("order","orders",c,'woocommerce'),value:Object(_.formatValue)(d,"number",c)}]}render(){const{advancedFilters:e,filters:t,isRequesting:r,query:o}=this.props;return Object(a.createElement)(y.a,{compareBy:"taxes",endpoint:"taxes",getHeadersContent:this.getHeadersContent,getRowsContent:this.getRowsContent,getSummary:this.getSummary,summaryFields:["tax_codes","total_tax","order_tax","shipping_tax","orders_count"],isRequesting:r,itemIdField:"tax_rate_id",query:o,searchBy:"taxes",tableQuery:{orderby:o.orderby||"tax_rate_id"},title:Object(n.__)("Taxes",'woocommerce'),columnPrefsKey:"taxes_report_columns",filters:t,advancedFilters:e})}}h.contextType=x.a;var f=h,O=r(505);class j extends a.Component{getChartMeta(){const{query:e}=this.props,t="compare-taxes"===e.filter?"item-comparison":"time-comparison";return{itemsLabel:Object(n.__)("%d taxes",'woocommerce'),mode:t}}render(){const{isRequesting:e,query:t,path:r}=this.props,{mode:o,itemsLabel:c}=this.getChartMeta(),n={...t};return"item-comparison"===o&&(n.segmentby="tax_rate_id"),Object(a.createElement)(a.Fragment,null,Object(a.createElement)(O.a,{query:t,path:r,filters:i.c,advancedFilters:i.a,report:"taxes"}),Object(a.createElement)(l.a,{charts:i.b,endpoint:"taxes",isRequesting:e,query:n,selectedChart:Object(s.a)(t.chart,i.b),filters:i.c,advancedFilters:i.a}),Object(a.createElement)(d.a,{charts:i.b,filters:i.c,advancedFilters:i.a,mode:o,endpoint:"taxes",query:n,path:r,isRequesting:e,itemsLabel:c,selectedChart:Object(s.a)(t.chart,i.b)}),Object(a.createElement)(f,{isRequesting:e,query:t,filters:i.c,advancedFilters:i.a}))}}j.propTypes={query:c.a.object.isRequired};t.default=j},502:function(e,t,r){"use strict";r.d(t,"e",(function(){return m})),r.d(t,"a",(function(){return u})),r.d(t,"b",(function(){return b})),r.d(t,"c",(function(){return _})),r.d(t,"d",(function(){return p})),r.d(t,"f",(function(){return y})),r.d(t,"h",(function(){return x})),r.d(t,"g",(function(){return h}));var a=r(15),o=r(17),c=r.n(o),n=r(4),i=r(12),s=r(11),d=r(13),l=r(503);function m(e,t=n.identity){return function(r="",o){const n="function"==typeof e?e(o):e,s=Object(i.getIdsFromQuery)(r);if(s.length<1)return Promise.resolve([]);const d={include:s.join(","),per_page:s.length};return c()({path:Object(a.addQueryArgs)(n,d)}).then(e=>e.map(t))}}m(s.NAMESPACE+"/products/attributes",e=>({key:e.id,label:e.name}));const u=m(s.NAMESPACE+"/products/categories",e=>({key:e.id,label:e.name})),b=m(s.NAMESPACE+"/coupons",e=>({key:e.id,label:e.code})),_=m(s.NAMESPACE+"/customers",e=>({key:e.id,label:e.name})),p=m(s.NAMESPACE+"/products",e=>({key:e.id,label:e.name})),y=m(s.NAMESPACE+"/taxes",e=>({key:e.id,label:Object(l.a)(e)}));function x({attributes:e,name:t}){const r=Object(d.f)("variationTitleAttributesSeparator"," - ");if(t&&t.indexOf(r)>-1)return t;const a=(e||[]).map(({option:e})=>e).join(", ");return a?t+r+a:t}const h=m(({products:e})=>e?s.NAMESPACE+`/products/${e}/variations`:s.NAMESPACE+"/variations",e=>({key:e.id,label:x(e)}))},503:function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));var a=r(2);function o(e){return[e.country,e.state,e.name||Object(a.__)("TAX",'woocommerce'),e.priority].map(e=>e.toString().toUpperCase().trim()).filter(Boolean).join("-")}},535:function(e,t,r){"use strict";r.d(t,"b",(function(){return m})),r.d(t,"a",(function(){return u})),r.d(t,"c",(function(){return _}));var a=r(2),o=r(30),c=r(11),n=r(7),i=r(502),s=r(503),d=r(55);const{addCesSurveyForAnalytics:l}=Object(n.dispatch)(d.c),m=Object(o.applyFilters)("woocommerce_admin_taxes_report_charts",[{key:"total_tax",label:Object(a.__)("Total tax",'woocommerce'),order:"desc",orderby:"total_tax",type:"currency"},{key:"order_tax",label:Object(a.__)("Order tax",'woocommerce'),order:"desc",orderby:"order_tax",type:"currency"},{key:"shipping_tax",label:Object(a.__)("Shipping tax",'woocommerce'),order:"desc",orderby:"shipping_tax",type:"currency"},{key:"orders_count",label:Object(a.__)("Orders",'woocommerce'),order:"desc",orderby:"orders_count",type:"number"}]),u=Object(o.applyFilters)("woocommerce_admin_taxes_report_advanced_filters",{filters:{},title:Object(a._x)("Taxes match {{select /}} filters","A sentence describing filters for Taxes. See screen shot for context: https://cloudup.com/cSsUY9VeCVJ",'woocommerce')}),b=[{label:Object(a.__)("All taxes",'woocommerce'),value:"all"},{label:Object(a.__)("Comparison",'woocommerce'),value:"compare-taxes",chartMode:"item-comparison",settings:{type:"taxes",param:"taxes",getLabels:Object(i.e)(c.NAMESPACE+"/taxes",e=>({id:e.id,key:e.id,label:Object(s.a)(e)})),labels:{helpText:Object(a.__)("Check at least two tax codes below to compare",'woocommerce'),placeholder:Object(a.__)("Search for tax codes to compare",'woocommerce'),title:Object(a.__)("Compare Tax Codes",'woocommerce'),update:Object(a.__)("Compare",'woocommerce')},onClick:l}}];Object.keys(u.filters).length&&b.push({label:Object(a.__)("Advanced filters",'woocommerce'),value:"advanced"});const _=Object(o.applyFilters)("woocommerce_admin_taxes_report_filters",[{label:Object(a.__)("Show",'woocommerce'),staticParams:["chartType","paged","per_page"],param:"filter",showFilters:()=>!0,filters:b}])}}]);woocommerce-admin/dist/chunks/payment-recommendations.js000064400000013400151335517650017620 0ustar00(window.__wcAdmin_webpackJsonp=window.__wcAdmin_webpackJsonp||[]).push([[45],{537:function(e,t,n){"use strict";var c=Object.assign||function(e){for(var t,n=1;n<arguments.length;n++)for(var c in t=arguments[n])Object.prototype.hasOwnProperty.call(t,c)&&(e[c]=t[c]);return e};Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n=e.size,o=void 0===n?24:n,a=e.onClick,i=(e.icon,e.className),s=function(e,t){var n={};for(var c in e)0<=t.indexOf(c)||Object.prototype.hasOwnProperty.call(e,c)&&(n[c]=e[c]);return n}(e,["size","onClick","icon","className"]),l=["gridicon","gridicons-external",i,(t=o,!(0!=t%18)&&"needs-offset"),!1,!1].filter(Boolean).join(" ");return r.default.createElement("svg",c({className:l,height:o,width:o,onClick:a},s,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"}),r.default.createElement("g",null,r.default.createElement("path",{d:"M19 13v6c0 1.105-.895 2-2 2H5c-1.105 0-2-.895-2-2V7c0-1.105.895-2 2-2h6v2H5v12h12v-6h2zM13 3v2h4.586l-7.793 7.793 1.414 1.414L19 6.414V11h2V3h-8z"})))};var o,a=n(5),r=(o=a)&&o.__esModule?o:{default:o};e.exports=t.default},586:function(e,t,n){},609:function(e,t,n){"use strict";n.r(t),n.d(t,"getPaymentRecommendationData",(function(){return g}));var c=n(0),o=n(2),a=n(7),r=n(28),i=n(3),s=n(21),l=n(20),m=n(11),d=n(16),u=n(537),_=n.n(u),p=n(13),O=(n(586),n(60)),b=n(507),f=n(539);const w="woocommerce_setting_payments_recommendations_hidden";function g(e){const{getOption:t,isResolving:n}=e(m.OPTIONS_STORE_NAME),{getSettings:c}=e(m.SETTINGS_STORE_NAME),{getRecommendedPlugins:o}=e(m.PLUGINS_STORE_NAME),{general:a}=c("general"),r=t(w),i=a&&a.woocommerce_default_country?Object(O.b)(a.woocommerce_default_country):null,s=!!i&&Object(f.c)(i),l=n("getOption",[w]),d=!l&&"yes"!==r&&s;let u=null;d&&(u=o("payments"));return{displayable:d,recommendedPlugins:u,isLoading:l||void 0===r||void 0===a||void 0===u}}const v=document.querySelector('[data-gateway_id="pre_install_woocommerce_payments_promotion"]');t.default=()=>{const[e,t]=Object(c.useState)(null),{updateOptions:n}=Object(a.useDispatch)(m.OPTIONS_STORE_NAME),{installAndActivatePlugins:u}=Object(a.useDispatch)(m.PLUGINS_STORE_NAME),{displayable:O,recommendedPlugins:f,isLoading:j}=Object(a.useSelect)(g),h=Object(c.useRef)(!1),y=O&&f&&f.length>0;if(Object(c.useEffect)(()=>{if((y||v&&!j)&&!h.current){h.current=!0;const e=(f||[]).reduce((e,t)=>t.product?{...e,[t.product.replace(/\-/g,"_")+"_displayed"]:!0}:e,{woocommerce_payments_displayed:!!v});Object(d.recordEvent)("settings_payments_recommendations_pageview",e)}},[y,v,j]),!y)return null;const E=()=>{Object(d.recordEvent)("settings_payments_recommendations_dismiss",{}),n({[w]:"yes"})},N=(f||[]).map(n=>({key:n.slug,title:Object(c.createElement)(c.Fragment,null,n.title,n.recommended&&Object(c.createElement)(s.Pill,null,Object(o.__)("Recommended",'woocommerce'))),content:Object(r.decodeEntities)(n.copy),after:Object(c.createElement)(i.Button,{isSecondary:!0,onClick:()=>(n=>{e||(t(n.product),Object(d.recordEvent)("settings_payments_recommendations_setup",{extension_selected:n.product}),u([n.product]).then(()=>{window.location.href=Object(p.e)(n["setup-link"].replace("/wp-admin/",""))}).catch(e=>{Object(b.a)(e),t(null)}))})(n),isBusy:e===n.product,disabled:!!e},n["button-text"]),before:Object(c.createElement)("img",{src:n.icon,alt:""})}));return Object(c.createElement)(i.Card,{size:"medium",className:"woocommerce-recommended-payments-card"},Object(c.createElement)(i.CardHeader,null,Object(c.createElement)("div",{className:"woocommerce-recommended-payments-card__header"},Object(c.createElement)(l.Text,{variant:"title.small",as:"p",size:"20",lineHeight:"28px"},Object(o.__)("Recommended ways to get paid",'woocommerce')),Object(c.createElement)(l.Text,{className:"woocommerce-recommended-payments__header-heading",variant:"caption",as:"p",size:"12",lineHeight:"16px"},Object(o.__)('We recommend adding one of the following payment extensions to your store. The extension will be installed and activated for you when you click "Get started".','woocommerce'))),Object(c.createElement)("div",{className:"woocommerce-card__menu woocommerce-card__header-item"},Object(c.createElement)(s.EllipsisMenu,{label:Object(o.__)("Task List Options",'woocommerce'),renderContent:()=>Object(c.createElement)("div",{className:"woocommerce-review-activity-card__section-controls"},Object(c.createElement)(i.Button,{onClick:E},Object(o.__)("Hide this",'woocommerce')))}))),Object(c.createElement)(s.List,{items:N}),Object(c.createElement)(i.CardFooter,null,Object(c.createElement)(i.Button,{href:"https://woocommerce.com/product-category/woocommerce-extensions/payment-gateways/?utm_source=payments_recommendations",target:"_blank",isTertiary:!0},Object(o.__)("See more options",'woocommerce'),Object(c.createElement)(_.a,{size:18}))))}},61:function(e,t,n){"use strict";var c=Object.assign||function(e){for(var t,n=1;n<arguments.length;n++)for(var c in t=arguments[n])Object.prototype.hasOwnProperty.call(t,c)&&(e[c]=t[c]);return e};Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n=e.size,o=void 0===n?24:n,a=e.onClick,i=(e.icon,e.className),s=function(e,t){var n={};for(var c in e)0<=t.indexOf(c)||Object.prototype.hasOwnProperty.call(e,c)&&(n[c]=e[c]);return n}(e,["size","onClick","icon","className"]),l=["gridicon","gridicons-notice-outline",i,(t=o,!(0!=t%18)&&"needs-offset"),!1,!1].filter(Boolean).join(" ");return r.default.createElement("svg",c({className:l,height:o,width:o,onClick:a},s,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"}),r.default.createElement("g",null,r.default.createElement("path",{d:"M12 4c4.41 0 8 3.59 8 8s-3.59 8-8 8-8-3.59-8-8 3.59-8 8-8m0-2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2zm1 13h-2v2h2v-2zm-2-2h2l.5-6h-3l.5 6z"})))};var o,a=n(5),r=(o=a)&&o.__esModule?o:{default:o};e.exports=t.default}}]);woocommerce-admin/dist/chunks/task-list.js000064400000232100151335517650014671 0ustar00(window.__wcAdmin_webpackJsonp=window.__wcAdmin_webpackJsonp||[]).push([[51],{162:function(e,t,o){"use strict";o.d(t,"a",(function(){return s}));var c=o(15),n=o(13);const s=(e,t={})=>{const{pathname:o,search:s}=window.location,a=Object(n.f)("connectNonce","");return t={"wccom-site":Object(n.f)("siteUrl"),"wccom-back":o+s,"wccom-woo-version":Object(n.f)("wcVersion"),"wccom-connect-nonce":a,...t},Object(c.addQueryArgs)(e,t)}},473:function(e,t,o){"use strict";var c=o(0),n=o(8),s=Object(c.createElement)(n.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(c.createElement)(n.Path,{d:"M10.6 6L9.4 7l4.6 5-4.6 5 1.2 1 5.4-6z"}));t.a=s},475:function(e,t,o){"use strict";var c=o(0),n=o(8),s=Object(c.createElement)(n.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(c.createElement)(n.Path,{d:"M18.3 5.6L9.9 16.9l-4.6-3.4-.9 1.2 5.8 4.3 9.3-12.6z"}));t.a=s},526:function(e,t,o){"use strict";o.d(t,"a",(function(){return c})),o.d(t,"b",(function(){return n}));const c=(e,t,o="undefined")=>e&&Array.isArray(e)&&e.length?t?e.reduce((e,c)=>(c[t]||(c[t]=o),(e[c[t]]=e[c[t]]||[]).push(c),e),{}):e:{},n=(e,t)=>Object.entries(e).reduce((e,[o])=>({...e,[o]:t}),{})},527:function(e,t,o){"use strict";o.d(t,"b",(function(){return p})),o.d(t,"a",(function(){return u}));var c=o(35),n=o.n(c),s=o(0),a=o(2),i=o(28),r=o(4),l=o(13),m=o(21);const{countries:d}=Object(l.f)("dataEndpoints",{countries:{}});function p(e){const t={};return e.addressLine1.trim().length||(t.addressLine1=Object(a.__)("Please add an address",'woocommerce')),e.countryState.trim().length||(t.countryState=Object(a.__)("Please select a country / region",'woocommerce')),e.city.trim().length||(t.city=Object(a.__)("Please add a city",'woocommerce')),e.postCode.trim().length||(t.postCode=Object(a.__)("Please add a post code",'woocommerce')),t}function u(e){const{getInputProps:t,setValue:o}=e,c=Object(s.useMemo)(()=>d.reduce((e,t)=>{if(!t.states.length)return e.push({key:t.code,label:Object(i.decodeEntities)(t.name)}),e;const o=t.states.map(e=>({key:t.code+":"+e.code,label:Object(i.decodeEntities)(t.name)+" — "+Object(i.decodeEntities)(e.name)}));return e.push(...o),e},[]),[]),l=function(e,t,o){const[c,n]=Object(s.useState)(""),[a,i]=Object(s.useState)(""),l=Object(s.useRef)();return Object(s.useEffect)(()=>{const o=e.find(e=>e.key===t),s=o?o.label.split(/\u2013|\u2014|\-/):[],r=(s[0]||"").trim(),m=(s[1]||"").trim();l.current||r===c&&m===a||(n(r),i(m)),l.current=!1},[t]),Object(s.useEffect)(()=>{c||a||!t||(l.current=!0,o("countryState",""));let n=[];const s=new RegExp(Object(r.escapeRegExp)(c),"i"),i=new RegExp(Object(r.escapeRegExp)(a.replace(/\s/g,""))+"$","i");if((a.length||c.length)&&(n=e.filter(e=>(c.length?s:i).test(e.label))),c.length&&a.length){const e=a.length<3;n=n.filter(t=>i.test((e?t.key:t.label).replace("-","").replace(/\s/g,"")));const t=c.length<3;if(n.length>1){let e=[];e=n.filter(e=>s.test(t?e.key:e.label)),e.length>0&&(n=e)}if(n.length>1){let t=[];t=n.filter(t=>i.test((e?t.key:t.label).replace("-","").replace(/\s/g,""))),1===t.length&&(n=t)}}1===n.length&&t!==n[0].key&&(l.current=!0,o("countryState",n[0].key))},[c,a,e,o]),Object(s.createElement)(s.Fragment,null,Object(s.createElement)("input",{onChange:e=>n(e.target.value),value:c,name:"country",type:"text",className:"woocommerce-select-control__autofill-input",tabIndex:"-1",autoComplete:"country"}),Object(s.createElement)("input",{onChange:e=>i(e.target.value),value:a,name:"state",type:"text",className:"woocommerce-select-control__autofill-input",tabIndex:"-1",autoComplete:"address-level1"}))}(c,t("countryState").value,o);return Object(s.createElement)("div",{className:"woocommerce-store-address-fields"},Object(s.createElement)(m.TextControl,n()({label:Object(a.__)("Address line 1",'woocommerce'),required:!0,autoComplete:"address-line1"},t("addressLine1"))),Object(s.createElement)(m.TextControl,n()({label:Object(a.__)("Address line 2 (optional)",'woocommerce'),required:!0,autoComplete:"address-line2"},t("addressLine2"))),Object(s.createElement)(m.SelectControl,n()({label:Object(a.__)("Country / Region",'woocommerce'),required:!0,autoComplete:"new-password",options:c,excludeSelectedOptions:!1,showAllOnFocus:!0,isSearchable:!0},t("countryState"),{controlClassName:t("countryState").className}),l),Object(s.createElement)(m.TextControl,n()({label:Object(a.__)("City",'woocommerce'),required:!0},t("city"),{autoComplete:"address-level2"})),Object(s.createElement)(m.TextControl,n()({label:Object(a.__)("Post code",'woocommerce'),required:!0,autoComplete:"postal-code"},t("postCode"))))}},538:function(e,t,o){},593:function(e,t,o){},594:function(e,t,o){},595:function(e,t,o){},596:function(e,t,o){},597:function(e,t,o){},598:function(e,t,o){},611:function(e,t,o){"use strict";o.r(t);var c=o(0),n=o(2),s=o(3),a=o(475),i=o(7),r=o(11),l=o(122),m=o(16),d=o(21),p=(o(541),o(14)),u=o(4),_=o(28),b=o(13),g=o(60),h=o(509),O=o(162);class j extends c.Component{constructor(e){super(e),this.state={purchaseNowButtonBusy:!1,purchaseLaterButtonBusy:!1}}onClickPurchaseNow(){const{productIds:e,onClickPurchaseNow:t}=this.props;if(this.setState({purchaseNowButtonBusy:!0}),!e.length)return;Object(m.recordEvent)("tasklist_modal_proceed_checkout",{product_ids:e,purchase_install:!0});const o=Object(O.a)("https://woocommerce.com/cart?utm_medium=product",{"wccom-replace-with":e.join(",")});t?t(o):window.location=o}onClickPurchaseLater(){const{productIds:e}=this.props;Object(m.recordEvent)("tasklist_modal_proceed_checkout",{product_ids:e,purchase_install:!1}),this.setState({purchaseLaterButtonBusy:!0}),this.props.onClickPurchaseLater()}onClose(){const{onClose:e,productIds:t}=this.props;Object(m.recordEvent)("tasklist_modal_proceed_checkout",{product_ids:t,purchase_install:!1}),e()}renderProducts(){const{productIds:e,productTypes:t}=this.props,{themes:o=[]}=Object(b.f)("onboarding",{}),s=[];return e.forEach(e=>{const a=Object(u.find)(t,t=>t.product===e);a&&s.push({title:a.label,content:a.description});const i=Object(u.find)(o,t=>t.id===e);i&&s.push({title:Object(n.sprintf)(Object(n.__)("%s — %s per year",'woocommerce'),i.title,Object(_.decodeEntities)(i.price)),content:Object(c.createElement)("span",{dangerouslySetInnerHTML:Object(h.a)(i.excerpt)})})}),Object(c.createElement)(d.List,{items:s})}render(){const{purchaseNowButtonBusy:e,purchaseLaterButtonBusy:t}=this.state;return Object(c.createElement)(s.Modal,{title:Object(n.__)("Would you like to add the following paid features to your store now?",'woocommerce'),onRequestClose:()=>this.onClose(),className:"woocommerce-cart-modal"},this.renderProducts(),Object(c.createElement)("p",{className:"woocommerce-cart-modal__help-text"},Object(n.__)("You won't have access to this functionality until the extensions have been purchased and installed.",'woocommerce')),Object(c.createElement)("div",{className:"woocommerce-cart-modal__actions"},Object(c.createElement)(s.Button,{isLink:!0,isBusy:t,onClick:()=>this.onClickPurchaseLater()},Object(n.__)("I'll do it later",'woocommerce')),Object(c.createElement)(s.Button,{isPrimary:!0,isBusy:e,onClick:()=>this.onClickPurchaseNow()},Object(n.__)("Buy now",'woocommerce'))))}}var w=Object(p.compose)(Object(i.withSelect)(e=>{const{getInstalledPlugins:t}=e(r.PLUGINS_STORE_NAME),{getProductTypes:o,getProfileItems:c}=e(r.ONBOARDING_STORE_NAME),n=c(),s=t(),a=o();return{profileItems:n,productIds:Object(g.e)(a,n,!1,s),productTypes:a}}))(j),y=o(30),k=o(12),E=o(17),S=o.n(E);class v extends c.Component{constructor(e){super(e);const{hasHomepage:t,hasProducts:o}=e.tasksStatus;this.stepVisibility={homepage:!t,import:!o},this.state={isDirty:!1,isPending:!1,logo:null,stepIndex:0,isUpdatingLogo:!1,isUpdatingNotice:!1,storeNoticeText:e.demoStoreNotice||""},this.completeStep=this.completeStep.bind(this),this.createHomepage=this.createHomepage.bind(this),this.importProducts=this.importProducts.bind(this),this.updateLogo=this.updateLogo.bind(this),this.updateNotice=this.updateNotice.bind(this)}componentDidMount(){const{themeMods:e}=this.props.tasksStatus;e&&e.custom_logo&&this.setState({logo:{id:e.custom_logo}})}componentDidUpdate(e){const{isPending:t,logo:o}=this.state,{demoStoreNotice:c}=this.props;!o||o.url||t||(this.setState({isPending:!0}),wp.media.attachment(o.id).fetch().then(()=>{const e=wp.media.attachment(o.id).get("url");this.setState({isPending:!1,logo:{id:o.id,url:e}})})),c&&e.demoStoreNotice!==c&&this.setState({storeNoticeText:c})}completeStep(){const{stepIndex:e}=this.state;this.getSteps()[e+1]?this.setState({stepIndex:e+1}):Object(k.getHistory)().push(Object(k.getNewPath)({},"/",{}))}importProducts(){const{clearTaskStatusCache:e,createNotice:t}=this.props;this.setState({isPending:!0}),Object(m.recordEvent)("tasklist_appearance_import_demo",{}),S()({path:r.WC_ADMIN_NAMESPACE+"/onboarding/tasks/import_sample_products",method:"POST"}).then(o=>{o.failed&&o.failed.length?t("error",Object(n.__)("There was an error importing some of the sample products",'woocommerce')):(t("success",Object(n.__)("All sample products have been imported",'woocommerce')),e()),this.setState({isPending:!1}),this.completeStep()}).catch(e=>{t("error",e.message),this.setState({isPending:!1})})}createHomepage(){const{clearTaskStatusCache:e,createNotice:t}=this.props;this.setState({isPending:!0}),Object(m.recordEvent)("tasklist_appearance_create_homepage",{create_homepage:!0}),S()({path:"/wc-admin/onboarding/tasks/create_homepage",method:"POST"}).then(o=>{e(),t(o.status,o.message,{actions:o.edit_post_link?[{label:Object(n.__)("Customize",'woocommerce'),onClick:()=>{Object(m.queueRecordEvent)("tasklist_appearance_customize_homepage",{}),window.location=o.edit_post_link+"&wc_onboarding_active_task=homepage"}}]:null}),this.setState({isPending:!1}),this.completeStep()}).catch(e=>{t("error",e.message),this.setState({isPending:!1})})}async updateLogo(){const{clearTaskStatusCache:e,createNotice:t,stylesheet:o,themeMods:c,updateOptions:s}=this.props,{logo:a}=this.state,i={...c,custom_logo:a?a.id:null};Object(m.recordEvent)("tasklist_appearance_upload_logo"),this.setState({isUpdatingLogo:!0});const r=await s({["theme_mods_"+o]:i});e(),r.success?(this.setState({isUpdatingLogo:!1}),t("success",Object(n.__)("Store logo updated sucessfully",'woocommerce')),this.completeStep()):t("error",r.message)}async updateNotice(){const{clearTaskStatusCache:e,createNotice:t,updateOptions:o}=this.props,{storeNoticeText:c}=this.state;Object(m.recordEvent)("tasklist_appearance_set_store_notice",{added_text:Boolean(c.length)}),this.setState({isUpdatingNotice:!0});const s=await o({woocommerce_task_list_appearance_complete:!0,woocommerce_demo_store:c.length?"yes":"no",woocommerce_demo_store_notice:c});e(),s.success?(this.setState({isUpdatingNotice:!1}),t("success",Object(n.__)("🎨 Your store is looking great! Don't forget to continue personalizing it",'woocommerce')),this.completeStep()):t("error",s.message)}getSteps(){const{isDirty:e,isPending:t,logo:o,storeNoticeText:a,isUpdatingLogo:i}=this.state,r=[{key:"import",label:Object(n.__)("Import sample products",'woocommerce'),description:Object(n.__)("We’ll add some products that will make it easier to see what your store looks like",'woocommerce'),content:Object(c.createElement)(c.Fragment,null,Object(c.createElement)(s.Button,{onClick:this.importProducts,isBusy:t,isPrimary:!0},Object(n.__)("Import products",'woocommerce')),Object(c.createElement)(s.Button,{onClick:()=>this.completeStep()},Object(n.__)("Skip",'woocommerce'))),visible:this.stepVisibility.import},{key:"homepage",label:Object(n.__)("Create a custom homepage",'woocommerce'),description:Object(n.__)("Create a new homepage and customize it to suit your needs",'woocommerce'),content:Object(c.createElement)(c.Fragment,null,Object(c.createElement)(s.Button,{isPrimary:!0,isBusy:t,onClick:this.createHomepage},Object(n.__)("Create homepage",'woocommerce')),Object(c.createElement)(s.Button,{isTertiary:!0,onClick:()=>{Object(m.recordEvent)("tasklist_appearance_create_homepage",{create_homepage:!1}),this.completeStep()}},Object(n.__)("Skip",'woocommerce'))),visible:this.stepVisibility.homepage},{key:"logo",label:Object(n.__)("Upload a logo",'woocommerce'),description:Object(n.__)("Ensure your store is on-brand by adding your logo",'woocommerce'),content:t?null:Object(c.createElement)(c.Fragment,null,Object(c.createElement)(d.ImageUpload,{image:o,onChange:e=>this.setState({isDirty:!0,logo:e})}),Object(c.createElement)(s.Button,{disabled:!o&&!e,onClick:this.updateLogo,isBusy:i,isPrimary:!0},Object(n.__)("Proceed",'woocommerce')),Object(c.createElement)(s.Button,{isTertiary:!0,onClick:()=>this.completeStep()},Object(n.__)("Skip",'woocommerce'))),visible:!0},{key:"notice",label:Object(n.__)("Set a store notice",'woocommerce'),description:Object(n.__)("Optionally display a prominent notice across all pages of your store",'woocommerce'),content:Object(c.createElement)(c.Fragment,null,Object(c.createElement)(d.TextControl,{label:Object(n.__)("Store notice text",'woocommerce'),placeholder:Object(n.__)("Store notice text",'woocommerce'),value:a,onChange:e=>this.setState({storeNoticeText:e})}),Object(c.createElement)(s.Button,{onClick:this.updateNotice,isPrimary:!0},Object(n.__)("Complete task",'woocommerce'))),visible:!0}];return Object(u.filter)(r,e=>e.visible)}render(){const{isPending:e,stepIndex:t,isUpdatingLogo:o,isUpdatingNotice:n}=this.state,a=this.getSteps()[t].key;return Object(c.createElement)("div",{className:"woocommerce-task-appearance"},Object(c.createElement)(s.Card,{className:"woocommerce-task-card"},Object(c.createElement)(s.CardBody,null,Object(c.createElement)(d.Stepper,{isPending:n||o||e,isVertical:!0,currentStep:a,steps:this.getSteps()}))))}}var f=Object(p.compose)(Object(i.withSelect)(e=>{const{getOption:t}=e(r.OPTIONS_STORE_NAME),{getTasksStatus:o}=e(r.ONBOARDING_STORE_NAME),c=o();return{demoStoreNotice:t("woocommerce_demo_store_notice"),stylesheet:t("stylesheet"),tasksStatus:c}}),Object(i.withDispatch)(e=>{const{createNotice:t}=e("core/notices"),{updateOptions:o}=e(r.OPTIONS_STORE_NAME),{invalidateResolutionForStoreSelector:c}=e(r.ONBOARDING_STORE_NAME);return{clearTaskStatusCache:()=>c("getTasksStatus"),createNotice:t,updateOptions:o}}))(v),C=o(20),T=(o(593),o(507));o(594);const N=({description:e,imageUrl:t,installAndActivate:o=(()=>{}),isActive:a,isBusy:i,isDisabled:r,isInstalled:l,manageUrl:d,name:p,slug:u})=>Object(c.createElement)("div",{className:"woocommerce-plugin-list__plugin"},t&&Object(c.createElement)("div",{className:"woocommerce-plugin-list__plugin-logo"},Object(c.createElement)("img",{src:t,alt:Object(n.sprintf)(Object(n.__)("%s logo",'woocommerce'),p)})),Object(c.createElement)("div",{className:"woocommerce-plugin-list__plugin-text"},Object(c.createElement)(C.Text,{variant:"subtitle.small",as:"h4"},p),Object(c.createElement)(C.Text,{variant:"subtitle.small"},e)),Object(c.createElement)("div",{className:"woocommerce-plugin-list__plugin-action"},a&&d&&Object(c.createElement)(s.Button,{disabled:r,isBusy:i,isSecondary:!0,href:Object(b.e)(d),onClick:()=>Object(m.recordEvent)("marketing_manage",{extension_name:u})},Object(n.__)("Manage","woocommmerce-admin")),l&&!a&&Object(c.createElement)(s.Button,{disabled:r,isBusy:i,isSecondary:!0,onClick:()=>o(u)},Object(n.__)("Activate","woocommmerce-admin")),!l&&Object(c.createElement)(s.Button,{disabled:r,isBusy:i,isSecondary:!0,onClick:()=>o(u)},Object(n.__)("Get started","woocommmerce-admin"))));o(595);const x=({currentPlugin:e,installAndActivate:t=(()=>{}),plugins:o=[],title:n})=>Object(c.createElement)("div",{className:"woocommerce-plugin-list"},n&&Object(c.createElement)("div",{className:"woocommerce-plugin-list__title"},Object(c.createElement)(C.Text,{variant:"sectionheading",as:"h3"},n)),o.map(o=>{const{description:n,imageUrl:s,isActive:a,isInstalled:i,manageUrl:r,slug:l,name:m}=o;return Object(c.createElement)(N,{key:l,description:n,manageUrl:r,name:m,imageUrl:s,installAndActivate:t,isActive:a,isBusy:e===l,isDisabled:!!e,isInstalled:i,slug:l})})),P=["reach","grow"],A=(e,t,o)=>{const c=[],n=[];return e.forEach(e=>{if(!P.includes(e.key))return;const s=[];if(e.plugins.forEach(e=>{const n=((e,t,o)=>{const{description:c,image_url:n,key:s,manage_url:a,name:i}=e,r=s.split(":")[0];return{description:c,slug:r,imageUrl:n,isActive:t.includes(r),isInstalled:o.includes(r),manageUrl:a,name:i}})(e,t,o);n.isInstalled?c.push(n):s.push(n)}),!s.length)return;const a={...e,plugins:s};n.push(a)}),[c,n]},I=({trackedCompletedActions:e})=>{const[t,o]=Object(c.useState)(null),{installAndActivatePlugins:a}=Object(i.useDispatch)(r.PLUGINS_STORE_NAME),{updateOptions:l}=Object(i.useDispatch)(r.OPTIONS_STORE_NAME),{activePlugins:d,freeExtensions:p,installedPlugins:u,isResolving:_}=Object(i.useSelect)(e=>{const{getActivePlugins:t,getInstalledPlugins:o}=e(r.PLUGINS_STORE_NAME),{getFreeExtensions:c,hasFinishedResolution:n}=e(r.ONBOARDING_STORE_NAME);return{activePlugins:t(),freeExtensions:c(),installedPlugins:o(),isResolving:!n("getFreeExtensions")}}),[b,g]=Object(c.useMemo)(()=>A(p,d,u),[u,d,p]),h=t=>{o(t),a([t]).then(c=>{Object(m.recordEvent)("tasklist_marketing_install",{selected_extension:t,installed_extensions:b.map(e=>e.slug)}),e.includes("marketing")||l({woocommerce_task_list_tracked_completed_actions:[...e,"marketing"]}),Object(T.a)(c),o(null)}).catch(e=>{Object(T.a)(e),o(null)})};return _?Object(c.createElement)(s.Spinner,null):Object(c.createElement)("div",{className:"woocommerce-task-marketing"},!!b.length&&Object(c.createElement)(s.Card,{className:"woocommerce-task-card"},Object(c.createElement)(s.CardHeader,null,Object(c.createElement)(C.Text,{variant:"title.small",as:"h2",className:"woocommerce-task-card__title"},Object(n.__)("Installed marketing extensions",'woocommerce'))),Object(c.createElement)(x,{currentPlugin:t,installAndActivate:h,plugins:b})),!!g.length&&Object(c.createElement)(s.Card,{className:"woocommerce-task-card"},Object(c.createElement)(s.CardHeader,null,Object(c.createElement)(C.Text,{variant:"title.small",as:"h2",className:"woocommerce-task-card__title"},Object(n.__)("Recommended marketing extensions",'woocommerce')),Object(c.createElement)(C.Text,{as:"span"},Object(n.__)('We recommend adding one of the following marketing tools for your store. The extension will be installed and activated for you when you click "Get started".','woocommerce'))),g.map(e=>{const{key:o,title:n,plugins:s}=e;return Object(c.createElement)(x,{currentPlugin:t,installAndActivate:h,key:o,plugins:s,title:n})})))};var R=o(116),M=o(8),B=Object(c.createElement)(M.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(c.createElement)(M.Path,{d:"M18 5.5H6a.5.5 0 00-.5.5v3h13V6a.5.5 0 00-.5-.5zm.5 5H10v8h8a.5.5 0 00.5-.5v-7.5zM6 4h12a2 2 0 012 2v12a2 2 0 01-2 2H6a2 2 0 01-2-2V6a2 2 0 012-2z"})),G=o(473),L=Object(c.createElement)(M.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"-2 -2 24 24"},Object(c.createElement)(M.Path,{d:"M10 1c-5 0-9 4-9 9s4 9 9 9 9-4 9-9-4-9-9-9zm0 16c-3.9 0-7-3.1-7-7s3.1-7 7-7 7 3.1 7 7-3.1 7-7 7zm1-11H9v3H6v2h3v3h2v-3h3V9h-3V6zM10 1c-5 0-9 4-9 9s4 9 9 9 9-4 9-9-4-9-9-9zm0 16c-3.9 0-7-3.1-7-7s3.1-7 7-7 7 3.1 7 7-3.1 7-7 7zm1-11H9v3H6v2h3v3h2v-3h3V9h-3V6z"})),F=Object(c.createElement)(M.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},Object(c.createElement)(M.Path,{d:"M19 6.2h-5.9l-.6-1.1c-.3-.7-1-1.1-1.8-1.1H5c-1.1 0-2 .9-2 2v11.8c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V8.2c0-1.1-.9-2-2-2zm.5 11.6c0 .3-.2.5-.5.5H5c-.3 0-.5-.2-.5-.5V6c0-.3.2-.5.5-.5h5.8c.2 0 .4.1.4.3l1 2H19c.3 0 .5.2.5.5v9.5zM8 12.8h8v-1.5H8v1.5zm0 3h8v-1.5H8v1.5z"})),U=Object(c.createElement)(M.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(c.createElement)(M.Path,{d:"M18 11.3l-1-1.1-4 4V3h-1.5v11.3L7 10.2l-1 1.1 6.2 5.8 5.8-5.8zm.5 3.7v3.5h-13V15H4v5h16v-5h-1.5z"}));o(596);const D=()=>[{key:"physical",title:Object(n.__)("Physical product",'woocommerce'),subtitle:Object(n.__)("Tangible items that get delivered to customers",'woocommerce')},{key:"digital",title:Object(n.__)("Digital product",'woocommerce'),subtitle:Object(n.__)("Items that customers download or access through your website",'woocommerce')},{key:"variable",title:Object(n.__)("Variable product",'woocommerce'),subtitle:Object(n.__)("Products with several versions that customers can choose from",'woocommerce')},{key:"subscription",title:Object(n.__)("Subscription product",'woocommerce'),subtitle:Object(n.__)("Products that customers receive or gain access to regularly by paying in advance",'woocommerce')}];function z({onClose:e}){const[t,o]=Object(c.useState)(null),[a,l]=Object(c.useState)(!1),{createProductFromTemplate:d}=Object(i.useDispatch)(r.ITEMS_STORE_NAME),{countryCode:p,profileItems:u}=Object(i.useSelect)(e=>{const{getProfileItems:t}=e(r.ONBOARDING_STORE_NAME),{getSettings:o}=e(r.SETTINGS_STORE_NAME),{general:c={}}=o("general");return{countryCode:Object(g.b)(c.woocommerce_default_country),profileItems:t()}}),{installedPlugins:_}=Object(i.useSelect)(e=>{const{getInstalledPlugins:t}=e(r.PLUGINS_STORE_NAME);return{installedPlugins:t()}}),h=window.wcAdminFeatures&&!window.wcAdminFeatures.subscriptions||"US"!==p||!u.product_types.includes("subscriptions")||!_.includes("woocommerce-payments")?D().filter(e=>"subscription"!==e.key):D(),O=Object(y.applyFilters)("woocommerce_admin_onboarding_product_templates",h);return Object(c.createElement)(s.Modal,{title:Object(n.__)("Start with a template"),isDismissible:!0,onRequestClose:()=>e(),className:"woocommerce-product-template-modal"},Object(c.createElement)("div",{className:"woocommerce-product-template-modal__wrapper"},Object(c.createElement)("div",{className:"woocommerce-product-template-modal__list"},Object(c.createElement)(s.RadioControl,{selected:t,options:O.map(e=>({label:Object(c.createElement)(c.Fragment,null,Object(c.createElement)("span",{className:"woocommerce-product-template-modal__list-title"},e.title),Object(c.createElement)("span",{className:"woocommerce-product-template-modal__list-subtitle"},e.subtitle)),value:e.key})),onChange:o})),Object(c.createElement)("div",{className:"woocommerce-product-template-modal__actions"},Object(c.createElement)(s.Button,{isPrimary:!0,isBusy:a,disabled:!t||a,onClick:()=>{l(!0),Object(m.recordEvent)("tasklist_product_template_selection",{product_type:t}),"subscription"!==t?t?d({template_name:t,status:"draft"},{_fields:["id"]}).then(e=>{if(e&&e.id){const t=Object(b.e)(`post.php?post=${e.id}&action=edit&wc_onboarding_active_task=products&tutorial=true`);window.location=t}},e=>{Object(T.a)(e),l(!1)}):e&&(Object(m.recordEvent)("tasklist_product_template_dismiss"),e()):window.location=Object(b.e)("post-new.php?post_type=product&subscription_pointers=true")}},Object(n.__)("Go")))))}function H(){const[e,t]=Object(c.useState)(null),{countryCode:o,profileItems:a}=Object(i.useSelect)(e=>{const{getProfileItems:t}=e(r.ONBOARDING_STORE_NAME),{getSettings:o}=e(r.SETTINGS_STORE_NAME),{general:c={}}=o("general");return{countryCode:Object(g.b)(c.woocommerce_default_country),profileItems:t()}}),{installedPlugins:l}=Object(i.useSelect)(e=>{const{getInstalledPlugins:t}=e(r.PLUGINS_STORE_NAME);return{installedPlugins:t()}}),p=[{key:"addProductTemplate",title:Object(c.createElement)(c.Fragment,null,Object(n.__)("Start with a template",'woocommerce'),Object(c.createElement)(d.Pill,null,Object(n.__)("Recommended",'woocommerce'))),content:Object(n.__)("Use a template to add physical, digital, and variable products",'woocommerce'),before:Object(c.createElement)(R.a,{icon:B}),after:Object(c.createElement)(R.a,{icon:G.a}),onClick:()=>Object(m.recordEvent)("tasklist_add_product",{method:"product_template"})},{key:"addProductManually",title:Object(n.__)("Add manually",'woocommerce'),content:Object(n.__)("For small stores we recommend adding products manually",'woocommerce'),before:Object(c.createElement)(R.a,{icon:L}),after:Object(c.createElement)(R.a,{icon:G.a}),onClick:()=>Object(m.recordEvent)("tasklist_add_product",{method:"manually"}),href:Object(b.e)("post-new.php?post_type=product&wc_onboarding_active_task=products&tutorial=true")},{key:"importProducts",title:Object(n.__)("Import via CSV",'woocommerce'),content:Object(n.__)("For larger stores we recommend importing all products at once via CSV file",'woocommerce'),before:Object(c.createElement)(R.a,{icon:F}),after:Object(c.createElement)(R.a,{icon:G.a}),onClick:()=>Object(m.recordEvent)("tasklist_add_product",{method:"import"}),href:Object(b.e)("edit.php?post_type=product&page=product_importer&wc_onboarding_active_task=product-import")},{key:"migrateProducts",title:Object(n.__)("Import from another service",'woocommerce'),content:Object(n.__)("For stores currently selling elsewhere we suggest using a product migration service",'woocommerce'),before:Object(c.createElement)(R.a,{icon:U}),after:Object(c.createElement)(R.a,{icon:G.a}),onClick:()=>Object(m.recordEvent)("tasklist_add_product",{method:"migrate"}),href:"https://woocommerce.com/products/cart2cart/?utm_medium=product",target:"_blank"}];if(window.wcAdminFeatures&&window.wcAdminFeatures.subscriptions&&"US"===o&&a.product_types.includes("subscriptions")&&l.includes("woocommerce-payments")){p.find(({key:e})=>"addProductTemplate"===e).content=Object(n.__)("Use a template to add physical, digital, variable, and subscription products",'woocommerce')}const u=p.map(e=>({...e,onClick:()=>(e=>{e.onClick(),"addProductTemplate"===e.key&&t(!0)})(e)}));return Object(c.createElement)(c.Fragment,null,Object(c.createElement)(s.Card,{className:"woocommerce-task-card"},Object(c.createElement)(s.CardBody,{size:null},Object(c.createElement)(d.List,{items:u}))),e?Object(c.createElement)(z,{onClose:()=>t(null)}):null)}var q=o(35),V=o.n(q),J=o(18),W=o.n(J),Y=o(1),Z=o.n(Y);class $ extends c.Component{constructor(e){super(e),this.state={isConnecting:!1},this.connectJetpack=this.connectJetpack.bind(this),e.setIsPending(!0)}componentDidUpdate(e){const{createNotice:t,error:o,isRequesting:c,onError:n,setIsPending:s}=this.props;e.isRequesting&&!c&&s(!1),o&&o!==e.error&&(n&&n(),t("error",o))}async connectJetpack(){const{jetpackConnectUrl:e,onConnect:t}=this.props;this.setState({isConnecting:!0},()=>{t&&t(),window.location=e})}render(){const{hasErrors:e,isRequesting:t,onSkip:o,skipText:a,onAbort:i,abortText:r}=this.props;return Object(c.createElement)(c.Fragment,null,e?Object(c.createElement)(s.Button,{isPrimary:!0,onClick:()=>window.location.reload()},Object(n.__)("Retry",'woocommerce')):Object(c.createElement)(s.Button,{disabled:t,isBusy:this.state.isConnecting,isPrimary:!0,onClick:this.connectJetpack},Object(n.__)("Connect",'woocommerce')),o&&Object(c.createElement)(s.Button,{onClick:o},a||Object(n.__)("No thanks",'woocommerce')),i&&Object(c.createElement)(s.Button,{onClick:i},r||Object(n.__)("Abort",'woocommerce')))}}$.propTypes={createNotice:Z.a.func.isRequired,error:Z.a.string,hasErrors:Z.a.bool,isRequesting:Z.a.bool,jetpackConnectUrl:Z.a.string,onConnect:Z.a.func,onError:Z.a.func,onSkip:Z.a.func,redirectUrl:Z.a.string,skipText:Z.a.string,setIsPending:Z.a.func,onAbort:Z.a.func,abortText:Z.a.string},$.defaultProps={setIsPending:()=>{}};var Q=Object(p.compose)(Object(i.withSelect)((e,t)=>{const{getJetpackConnectUrl:o,isPluginsRequesting:c,getPluginsError:n}=e(r.PLUGINS_STORE_NAME),s={redirect_url:t.redirectUrl||window.location.href},a=c("getJetpackConnectUrl");return{error:n("getJetpackConnectUrl")||"",isRequesting:a,jetpackConnectUrl:o(s)}}),Object(i.withDispatch)(e=>{const{createNotice:t}=e("core/notices");return{createNotice:t}}))($),K=o(527);class X extends c.Component{constructor(){super(...arguments),this.onSubmit=this.onSubmit.bind(this)}async onSubmit(e){const{onComplete:t,createNotice:o,isSettingsError:c,updateAndPersistSettingsForGroup:s,settings:a}=this.props;await s("general",{general:{...a,woocommerce_store_address:e.addressLine1,woocommerce_store_address_2:e.addressLine2,woocommerce_default_country:e.countryState,woocommerce_store_city:e.city,woocommerce_store_postcode:e.postCode}}),c?o("error",Object(n.__)("There was a problem saving your store location",'woocommerce')):t(e)}getInitialValues(){const{settings:e}=this.props,{woocommerce_store_address:t,woocommerce_store_address_2:o,woocommerce_store_city:c,woocommerce_default_country:n,woocommerce_store_postcode:s}=e;return{addressLine1:t||"",addressLine2:o||"",city:c||"",countryState:n||"",postCode:s||""}}render(){const{isSettingsRequesting:e}=this.props;return e?null:Object(c.createElement)(d.Form,{initialValues:this.getInitialValues(),onSubmit:this.onSubmit,validate:K.b},({getInputProps:e,handleSubmit:t,setValue:o})=>Object(c.createElement)(c.Fragment,null,Object(c.createElement)(K.a,{getInputProps:e,setValue:o}),Object(c.createElement)(s.Button,{isPrimary:!0,onClick:t},Object(n.__)("Continue",'woocommerce'))))}}var ee=Object(c.createElement)(M.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"-2 -2 24 24"},Object(c.createElement)(M.Path,{d:"M9 0C4.03 0 0 4.03 0 9s4.03 9 9 9 9-4.03 9-9-4.03-9-9-9zM1.11 9.68h2.51c.04.91.167 1.814.38 2.7H1.84c-.403-.85-.65-1.764-.73-2.7zm8.57-5.4V1.19c.964.366 1.756 1.08 2.22 2 .205.347.386.708.54 1.08l-2.76.01zm3.22 1.35c.232.883.37 1.788.41 2.7H9.68v-2.7h3.22zM8.32 1.19v3.09H5.56c.154-.372.335-.733.54-1.08.462-.924 1.255-1.64 2.22-2.01zm0 4.44v2.7H4.7c.04-.912.178-1.817.41-2.7h3.21zm-4.7 2.69H1.11c.08-.936.327-1.85.73-2.7H4c-.213.886-.34 1.79-.38 2.7zM4.7 9.68h3.62v2.7H5.11c-.232-.883-.37-1.788-.41-2.7zm3.63 4v3.09c-.964-.366-1.756-1.08-2.22-2-.205-.347-.386-.708-.54-1.08l2.76-.01zm1.35 3.09v-3.04h2.76c-.154.372-.335.733-.54 1.08-.464.92-1.256 1.634-2.22 2v-.04zm0-4.44v-2.7h3.62c-.04.912-.178 1.817-.41 2.7H9.68zm4.71-2.7h2.51c-.08.936-.327 1.85-.73 2.7H14c.21-.87.337-1.757.38-2.65l.01-.05zm0-1.35c-.046-.894-.176-1.78-.39-2.65h2.16c.403.85.65 1.764.73 2.7l-2.5-.05zm1-4H13.6c-.324-.91-.793-1.76-1.39-2.52 1.244.56 2.325 1.426 3.14 2.52h.04zm-9.6-2.52c-.597.76-1.066 1.61-1.39 2.52H2.65c.815-1.094 1.896-1.96 3.14-2.52zm-3.15 12H4.4c.324.91.793 1.76 1.39 2.52-1.248-.567-2.33-1.445-3.14-2.55l-.01.03zm9.56 2.52c.597-.76 1.066-1.61 1.39-2.52h1.76c-.82 1.08-1.9 1.933-3.14 2.48l-.01.04z"})),te=o(501);class oe extends c.Component{constructor(){super(...arguments),this.updateShippingZones=this.updateShippingZones.bind(this)}getShippingMethods(e,t=null){return e&&e.methods&&Array.isArray(e.methods)?t?e.methods?e.methods.filter(e=>e.method_id===t):[]:e.methods:[]}disableShippingMethods(e,t){t.length&&t.forEach(t=>{S()({method:"POST",path:`/wc/v3/shipping/zones/${e.id}/methods/${t.instance_id}`,data:{enabled:!1}})})}async updateShippingZones(e){const{clearTaskStatusCache:t,createNotice:o,shippingZones:c}=this.props;let s=!1,a=!1;c.forEach(t=>{0===t.id?s=t.toggleable&&e[t.id+"_enabled"]:a=""!==e[t.id+"_rate"]&&parseFloat(e[t.id+"_rate"])!==parseFloat(0);const o=this.getShippingMethods(t),c=parseFloat(e[t.id+"_rate"])===parseFloat(0)?"free_shipping":"flat_rate",n=this.getShippingMethods(t,c).length?this.getShippingMethods(t,c)[0]:null;if(!t.toggleable||e[t.id+"_enabled"]){if(n){const e=o.filter(e=>e.instance_id!==n.instance_id);this.disableShippingMethods(t,e)}S()({method:"POST",path:n?`/wc/v3/shipping/zones/${t.id}/methods/${n.instance_id}`:`/wc/v3/shipping/zones/${t.id}/methods`,data:{method_id:c,enabled:!0,settings:{cost:e[t.id+"_rate"]}}})}else this.disableShippingMethods(t,o)}),Object(m.recordEvent)("tasklist_shipping_set_costs",{shipping_cost:a,rest_world:s}),t(),o("success",Object(n.__)("Your shipping rates have been updated",'woocommerce')),this.props.onComplete()}renderInputPrefix(){const{symbolPosition:e,symbol:t}=this.context.getCurrencyConfig();return 0===e.indexOf("right")?null:Object(c.createElement)("span",{className:"woocommerce-shipping-rate__control-prefix"},t)}renderInputSuffix(e){const{symbolPosition:t,symbol:o}=this.context.getCurrencyConfig();return 0===t.indexOf("right")?Object(c.createElement)("span",{className:"woocommerce-shipping-rate__control-suffix"},o):parseFloat(e)===parseFloat(0)?Object(c.createElement)("span",{className:"woocommerce-shipping-rate__control-suffix"},Object(n.__)("Free shipping",'woocommerce')):null}getFormattedRate(e){const{formatDecimalString:t}=this.context,o=t(e);return e.length&&o.length?t(e):t(0)}getInitialValues(){const{formatDecimalString:e}=this.context,t={};return this.props.shippingZones.forEach(o=>{const c=this.getShippingMethods(o),n=c.length&&c[0].settings.cost?this.getFormattedRate(c[0].settings.cost.value):e(0);t[o.id+"_rate"]=n,c.length&&c[0].enabled?t[o.id+"_enabled"]=!0:t[o.id+"_enabled"]=!1}),t}validate(e){const t={};return Object.keys(e).filter(e=>e.endsWith("_rate")).forEach(o=>{e[o]<0&&(t[o]=Object(n.__)("Shipping rates can not be negative numbers.",'woocommerce'))}),t}render(){const{buttonText:e,shippingZones:t}=this.props;return t.length?Object(c.createElement)(d.Form,{initialValues:this.getInitialValues(),onSubmit:this.updateShippingZones,validate:this.validate},({getInputProps:o,handleSubmit:a,setTouched:i,setValue:r,values:l})=>Object(c.createElement)(c.Fragment,null,Object(c.createElement)("div",{className:"woocommerce-shipping-rates"},t.map(e=>Object(c.createElement)("div",{className:"woocommerce-shipping-rate",key:e.id},Object(c.createElement)("div",{className:"woocommerce-shipping-rate__icon"},e.locations?e.locations.map(e=>Object(c.createElement)(d.Flag,{size:24,code:e.code,key:e.code})):Object(c.createElement)(R.a,{icon:ee})),Object(c.createElement)("div",{className:"woocommerce-shipping-rate__main"},e.toggleable?Object(c.createElement)("label",{htmlFor:"woocommerce-shipping-rate__toggle-"+e.id,className:"woocommerce-shipping-rate__name"},e.name,Object(c.createElement)(s.FormToggle,V()({id:"woocommerce-shipping-rate__toggle-"+e.id},o(e.id+"_enabled")))):Object(c.createElement)("div",{className:"woocommerce-shipping-rate__name"},e.name),(!e.toggleable||l[e.id+"_enabled"])&&Object(c.createElement)(d.TextControlWithAffixes,V()({label:Object(n.__)("Shipping cost",'woocommerce'),required:!0},o(e.id+"_rate"),{onBlur:()=>{i(e.id+"_rate"),r(e.id+"_rate",this.getFormattedRate(l[e.id+"_rate"]))},prefix:this.renderInputPrefix(),suffix:this.renderInputSuffix(l[e.id+"_rate"]),className:"muriel-input-text woocommerce-shipping-rate__control-wrapper"})))))),Object(c.createElement)(s.Button,{isPrimary:!0,onClick:a},e||Object(n.__)("Update",'woocommerce')))):null}}oe.propTypes={buttonText:Z.a.string,onComplete:Z.a.func.isRequired,createNotice:Z.a.func.isRequired,shippingZones:Z.a.array},oe.defaultProps={shippingZones:[]},oe.contextType=te.a;var ce=Object(p.compose)(Object(i.withDispatch)(e=>{const{invalidateResolutionForStoreSelector:t}=e(r.ONBOARDING_STORE_NAME);return{clearTaskStatusCache:()=>t("getTasksStatus")}}))(oe);class ne extends c.Component{constructor(e){super(e),this.initialState={isPending:!1,step:"store_location",shippingZones:[]},this.activePlugins=e.activePlugins,this.state=this.initialState,this.completeStep=this.completeStep.bind(this)}componentDidMount(){this.reset()}reset(){this.setState(this.initialState)}async fetchShippingZones(){this.setState({isPending:!0});const{countryCode:e,countryName:t}=this.props,o=[],c=await S()({path:"/wc/v3/shipping/zones"});let s=!1;if(await Promise.all(c.map(async t=>{if(0===t.id)return t.methods=await S()({path:`/wc/v3/shipping/zones/${t.id}/methods`}),t.name=Object(n.__)("Rest of the world",'woocommerce'),t.toggleable=!0,void o.push(t);t.locations=await S()({path:`/wc/v3/shipping/zones/${t.id}/locations`});t.locations.find(t=>e===t.code)&&(t.methods=await S()({path:`/wc/v3/shipping/zones/${t.id}/methods`}),o.push(t),s=!0)})),!s){const c=await S()({method:"POST",path:"/wc/v3/shipping/zones",data:{name:t}});c.locations=await S()({method:"POST",path:`/wc/v3/shipping/zones/${c.id}/locations`,data:[{code:e,type:"country"}]}),o.push(c)}o.reverse(),this.setState({isPending:!1,shippingZones:o})}componentDidUpdate(e,t){const{countryCode:o,settings:c}=this.props,{woocommerce_store_address:n,woocommerce_default_country:s,woocommerce_store_postcode:a}=c,{step:i}=this.state;"rates"!==i||e.countryCode===o&&"rates"===t.step||this.fetchShippingZones();const r=Boolean(n&&s&&a);"store_location"===i&&r&&this.completeStep()}completeStep(){const{createNotice:e}=this.props,{step:t}=this.state,o=this.getSteps(),c=o.findIndex(e=>e.key===t),s=o[c+1];s?this.setState({step:s.key}):(e("success",Object(n.__)("📦 Shipping is done! Don't worry, you can always change it later",'woocommerce')),Object(k.getHistory)().push(Object(k.getNewPath)({},"/",{})))}getPluginsToActivate(){const{countryCode:e}=this.props,t=[];return["GB","CA","AU"].includes(e)?t.push("woocommerce-shipstation-integration"):"US"===e&&(t.push("woocommerce-services"),t.push("jetpack")),Object(u.difference)(t,this.activePlugins)}getSteps(){const{countryCode:e,isJetpackConnected:t,settings:o}=this.props,s=this.getPluginsToActivate(),a=!t&&"US"===e,i=[{key:"store_location",label:Object(n.__)("Set store location",'woocommerce'),description:Object(n.__)("The address from which your business operates",'woocommerce'),content:Object(c.createElement)(X,V()({},this.props,{onComplete:e=>{const t=Object(g.b)(e.countryState);Object(m.recordEvent)("tasklist_shipping_set_location",{country:t}),this.completeStep()}})),visible:!0},{key:"rates",label:Object(n.__)("Set shipping costs",'woocommerce'),description:Object(n.__)("Define how much customers pay to ship to different destinations",'woocommerce'),content:Object(c.createElement)(ce,V()({buttonText:s.length||a?Object(n.__)("Proceed",'woocommerce'):Object(n.__)("Complete task",'woocommerce'),shippingZones:this.state.shippingZones,onComplete:this.completeStep},this.props)),visible:"disabled"!==o.woocommerce_ship_to_countries},{key:"label_printing",label:Object(n.__)("Enable shipping label printing",'woocommerce'),description:s.includes("woocommerce-shipstation-integration")?W()({mixedString:Object(n.__)("We recommend using ShipStation to save time at the post office by printing your shipping labels at home. Try ShipStation free for 30 days. {{link}}Learn more{{/link}}.",'woocommerce'),components:{link:Object(c.createElement)(d.Link,{href:"https://woocommerce.com/products/shipstation-integration?utm_medium=product",target:"_blank",type:"external"})}}):Object(n.__)("With WooCommerce Shipping you can save time by printing your USPS and DHL Express shipping labels at home",'woocommerce'),content:Object(c.createElement)(d.Plugins,V()({onComplete:(e,t)=>{Object(T.a)(t),Object(m.recordEvent)("tasklist_shipping_label_printing",{install:!0,plugins_to_activate:s}),this.completeStep()},onError:(e,t)=>Object(T.a)(t),onSkip:()=>{Object(m.recordEvent)("tasklist_shipping_label_printing",{install:!1,plugins_to_activate:s}),Object(k.getHistory)().push(Object(k.getNewPath)({},"/",{}))},pluginSlugs:s},this.props)),visible:s.length},{key:"connect",label:Object(n.__)("Connect your store",'woocommerce'),description:Object(n.__)("Connect your store to WordPress.com to enable label printing",'woocommerce'),content:Object(c.createElement)(Q,V()({redirectUrl:Object(b.e)("admin.php?page=wc-admin"),completeStep:this.completeStep},this.props,{onConnect:()=>{Object(m.recordEvent)("tasklist_shipping_connect_store")}})),visible:a}];return Object(u.filter)(i,e=>e.visible)}render(){const{isPending:e,step:t}=this.state,{isUpdateSettingsRequesting:o}=this.props;return Object(c.createElement)("div",{className:"woocommerce-task-shipping"},Object(c.createElement)(s.Card,{className:"woocommerce-task-card"},Object(c.createElement)(s.CardBody,null,Object(c.createElement)(d.Stepper,{isPending:e||o,isVertical:!0,currentStep:t,steps:this.getSteps()}))))}}var se=Object(p.compose)(Object(i.withSelect)(e=>{const{getSettings:t,isUpdateSettingsRequesting:o}=e(r.SETTINGS_STORE_NAME),{getActivePlugins:c,isJetpackConnected:n}=e(r.PLUGINS_STORE_NAME),{general:s={}}=t("general"),a=Object(g.b)(s.woocommerce_default_country),{countries:i=[]}=Object(b.f)("dataEndpoints",{}),l=a?i.find(e=>e.code===a):null,m=l?l.name:null,d=c();return{countryCode:a,countryName:m,isUpdateSettingsRequesting:o("general"),settings:s,activePlugins:d,isJetpackConnected:n()}}),Object(i.withDispatch)(e=>{const{createNotice:t}=e("core/notices"),{updateAndPersistSettingsForGroup:o}=e(r.SETTINGS_STORE_NAME);return{createNotice:t,updateAndPersistSettingsForGroup:o}}))(ne);class ae extends c.Component{constructor(e){super(e);const{hasCompleteAddress:t,pluginsToActivate:o}=e;this.initialState={isPending:!1,stepIndex:t?1:0,cachedPluginsToActivate:o},this.state=this.initialState,this.completeStep=this.completeStep.bind(this)}componentDidMount(){const{query:e}=this.props,{auto:t}=e;this.reset(),"true"===t&&this.enableAutomatedTax()}reset(){this.setState(this.initialState)}shouldShowSuccessScreen(){const{isJetpackConnected:e,hasCompleteAddress:t,pluginsToActivate:o}=this.props;return t&&!o.length&&e&&this.isTaxJarSupported()}isTaxJarSupported(){const{countryCode:e,tasksStatus:t}=this.props,{automatedTaxSupportedCountries:o=[],taxJarActivated:c}=t;return!c&&o.includes(e)}completeStep(){const{stepIndex:e}=this.state;this.getSteps()[e+1]&&this.setState({stepIndex:e+1})}async manuallyConfigureTaxRates(){const{generalSettings:e,updateAndPersistSettingsForGroup:t}=this.props;"yes"!==e.woocommerce_calc_taxes?(this.setState({isPending:!0}),t("general",{general:{...e,woocommerce_calc_taxes:"yes"}}).then(()=>this.redirectToTaxSettings()).catch(e=>Object(T.a)(e))):this.redirectToTaxSettings()}updateAutomatedTax(e){const{clearTaskStatusCache:t,createNotice:o,updateAndPersistSettingsForGroup:c,generalSettings:s,taxSettings:a}=this.props;Promise.all([c("tax",{tax:{...a,wc_connect_taxes_enabled:e?"yes":"no"}}),c("general",{general:{...s,woocommerce_calc_taxes:"yes"}})]).then(()=>{t(),e?(o("success",Object(n.__)("You're awesome! One less item on your to-do list ✅",'woocommerce')),Object(k.getHistory)().push(Object(k.getNewPath)({},"/",{}))):this.redirectToTaxSettings()}).catch(()=>{o("error",Object(n.__)("There was a problem updating your tax settings",'woocommerce'))})}redirectToTaxSettings(){window.location=Object(b.e)("admin.php?page=wc-settings&tab=tax&section=standard&wc_onboarding_active_task=tax")}doNotChargeSalesTax(){const{updateOptions:e}=this.props;Object(m.queueRecordEvent)("tasklist_tax_connect_store",{connect:!1,no_tax:!0}),e({woocommerce_no_sales_tax:!0,woocommerce_calc_taxes:"no"}).then(()=>{window.location=Object(b.e)("admin.php?page=wc-admin")})}getSteps(){const{generalSettings:e,isJetpackConnected:t,isPending:o,tosAccepted:a,updateOptions:i}=this.props,{cachedPluginsToActivate:r}=this.state;let l,p;r.includes("woocommerce-services")?(l=Object(n.__)("Install Jetpack and WooCommerce Tax",'woocommerce'),p=Object(n.__)("By installing Jetpack and WooCommerce Tax you agree to the {{link}}Terms of Service{{/link}}.",'woocommerce')):(l=Object(n.__)("Install Jetpack",'woocommerce'),p=Object(n.__)("By installing Jetpack you agree to the {{link}}Terms of Service{{/link}}.",'woocommerce'));const _=[{key:"store_location",label:Object(n.__)("Set store location",'woocommerce'),description:Object(n.__)("The address from which your business operates",'woocommerce'),content:Object(c.createElement)(X,V()({},this.props,{onComplete:e=>{const t=Object(g.b)(e.countryState);Object(m.recordEvent)("tasklist_tax_set_location",{country:t}),this.completeStep()},isSettingsRequesting:!1,settings:e})),visible:!0},{key:"plugins",label:l,description:Object(n.__)("Jetpack and WooCommerce Tax allow you to automate sales tax calculations",'woocommerce'),content:Object(c.createElement)(c.Fragment,null,Object(c.createElement)(d.Plugins,{onComplete:(e,t)=>{Object(T.a)(t),Object(m.recordEvent)("tasklist_tax_install_extensions",{install_extensions:!0}),i({woocommerce_setup_jetpack_opted_in:!0}),this.completeStep()},onError:(e,t)=>Object(T.a)(t),onSkip:()=>{Object(m.queueRecordEvent)("tasklist_tax_install_extensions",{install_extensions:!1}),this.manuallyConfigureTaxRates()},skipText:Object(n.__)("Set up manually",'woocommerce'),onAbort:()=>this.doNotChargeSalesTax(),abortText:Object(n.__)("I don't charge sales tax",'woocommerce')}),!a&&Object(c.createElement)(C.Text,{variant:"caption",className:"woocommerce-task__caption",size:"12",lineHeight:"16px"},W()({mixedString:p,components:{link:Object(c.createElement)(d.Link,{href:"https://wordpress.com/tos/",target:"_blank",type:"external"})}}))),visible:(r.length||!a)&&this.isTaxJarSupported()},{key:"connect",label:Object(n.__)("Connect your store",'woocommerce'),description:Object(n.__)("Connect your store to WordPress.com to enable automated sales tax calculations",'woocommerce'),content:Object(c.createElement)(Q,V()({},this.props,{onConnect:()=>{Object(m.recordEvent)("tasklist_tax_connect_store",{connect:!0,no_tax:!1})},onSkip:()=>{Object(m.queueRecordEvent)("tasklist_tax_connect_store",{connect:!1,no_tax:!1}),this.manuallyConfigureTaxRates()},skipText:Object(n.__)("Set up tax rates manually",'woocommerce'),onAbort:()=>this.doNotChargeSalesTax(),abortText:Object(n.__)("My business doesn't charge sales tax",'woocommerce')})),visible:!t&&this.isTaxJarSupported()},{key:"manual_configuration",label:Object(n.__)("Configure tax rates",'woocommerce'),description:Object(n.__)("Head over to the tax rate settings screen to configure your tax rates",'woocommerce'),content:Object(c.createElement)(c.Fragment,null,Object(c.createElement)(s.Button,{disabled:o,isPrimary:!0,isBusy:o,onClick:()=>{Object(m.recordEvent)("tasklist_tax_config_rates"),this.manuallyConfigureTaxRates()}},Object(n.__)("Configure",'woocommerce')),Object(c.createElement)("p",null,"yes"!==e.woocommerce_calc_taxes&&W()({mixedString:Object(n.__)('By clicking "Configure" you\'re enabling tax rates and calculations. More info {{link}}here{{/link}}.','woocommerce'),components:{link:Object(c.createElement)(d.Link,{href:"https://docs.woocommerce.com/document/setting-up-taxes-in-woocommerce/?utm_medium=product#section-1",target:"_blank",type:"external"})}}))),visible:!this.isTaxJarSupported()}];return Object(u.filter)(_,e=>e.visible)}enableAutomatedTax(){Object(m.recordEvent)("tasklist_tax_setup_automated_proceed",{setup_automatically:!0}),this.updateAutomatedTax(!0)}renderSuccessScreen(){const{isPending:e}=this.props;return Object(c.createElement)("div",{className:"woocommerce-task-tax__success"},Object(c.createElement)("span",{className:"woocommerce-task-tax__success-icon",role:"img","aria-labelledby":"woocommerce-task-tax__success-message"},"🎊"),Object(c.createElement)(d.H,{id:"woocommerce-task-tax__success-message"},Object(n.__)("Good news!",'woocommerce')),Object(c.createElement)("p",null,W()({mixedString:Object(n.__)("{{strong}}Jetpack{{/strong}} and {{strong}}WooCommerce Tax{{/strong}} can automate your sales tax calculations for you.",'woocommerce'),components:{strong:Object(c.createElement)("strong",null)}})),Object(c.createElement)(s.Button,{disabled:e,isPrimary:!0,isBusy:e,onClick:this.enableAutomatedTax.bind(this)},Object(n.__)("Yes please",'woocommerce')),Object(c.createElement)(s.Button,{disabled:e,isTertiary:!0,onClick:()=>{Object(m.recordEvent)("tasklist_tax_setup_automated_proceed",{setup_automatically:!1}),this.updateAutomatedTax(!1)}},Object(n.__)("No thanks, I'll set up manually",'woocommerce')),Object(c.createElement)(s.Button,{disabled:e,isTertiary:!0,onClick:()=>this.doNotChargeSalesTax()},Object(n.__)("I don't charge sales tax",'woocommerce')))}render(){const{stepIndex:e}=this.state,{isPending:t,isResolving:o}=this.props;if(o)return Object(c.createElement)(d.Spinner,null);const n=this.getSteps()[e];return Object(c.createElement)("div",{className:"woocommerce-task-tax"},Object(c.createElement)(s.Card,{className:"woocommerce-task-card"},Object(c.createElement)(s.CardBody,null,this.shouldShowSuccessScreen()?this.renderSuccessScreen():Object(c.createElement)(d.Stepper,{isPending:t||o,isVertical:!0,currentStep:n.key,steps:this.getSteps()}))))}}var ie=Object(p.compose)(Object(i.withSelect)(e=>{const{getSettings:t,isUpdateSettingsRequesting:o}=e(r.SETTINGS_STORE_NAME),{getOption:c,hasFinishedResolution:n}=e(r.OPTIONS_STORE_NAME),{getActivePlugins:s,isJetpackConnected:a,isPluginsRequesting:i}=e(r.PLUGINS_STORE_NAME),{getTasksStatus:l}=e(r.ONBOARDING_STORE_NAME),{general:m={}}=t("general"),d=Object(g.b)(m.woocommerce_default_country),{woocommerce_store_address:p,woocommerce_default_country:_,woocommerce_store_postcode:b}=m,h=Boolean(p&&_&&b),{tax:O={}}=t("tax"),j=s(),w=Object(u.difference)(["jetpack","woocommerce-services"],j),y=c("wc_connect_options")||{},k=c("woocommerce_setup_jetpack_opted_in"),E=y.tos_accepted||"1"===k,S=l(),v=o("tax")||o("general"),f=i("getJetpackConnectUrl")||!n("getOption",["woocommerce_setup_jetpack_opted_in"])||!n("getOption",["wc_connect_options"])||void 0===k||void 0===y;return{countryCode:d,generalSettings:m,hasCompleteAddress:h,isJetpackConnected:a(),isPending:v,isResolving:f,pluginsToActivate:w,tasksStatus:S,taxSettings:O,tosAccepted:E}}),Object(i.withDispatch)(e=>{const{createNotice:t}=e("core/notices"),{updateOptions:o}=e(r.OPTIONS_STORE_NAME),{updateAndPersistSettingsForGroup:c}=e(r.SETTINGS_STORE_NAME),{invalidateResolutionForStoreSelector:n}=e(r.ONBOARDING_STORE_NAME);return{clearTaskStatusCache:()=>n("getTasksStatus"),createNotice:t,updateAndPersistSettingsForGroup:c,updateOptions:o}}))(ae),re=o(6),le=o.n(re),me=o(271),de=o(542);o(538);const pe=({isRecommended:e,markConfigured:t,paymentGateway:o})=>{var n,a;const{image:i,content:r,id:l,plugins:d=[],title:p,loading:u,enabled:_=!1,installed:b=!1,needsSetup:g=!0,requiredSettings:h,settingsUrl:O,is_local_partner:j}=o,w=Object(C.useSlot)("woocommerce_payment_gateway_configure_"+l),y=Object(C.useSlot)("woocommerce_payment_gateway_setup_"+l),k=Boolean(null==w||null===(n=w.fills)||void 0===n?void 0:n.length)||Boolean(null==y||null===(a=y.fills)||void 0===a?void 0:a.length),E=Boolean(d.length||h.length||k),S=e&&g,v=le()("woocommerce-task-payment","woocommerce-task-card",g&&"woocommerce-task-payment-not-configured","woocommerce-task-payment-"+l);return Object(c.createElement)(c.Fragment,{key:l},Object(c.createElement)(s.CardBody,{style:{paddingLeft:0,marginBottom:0},className:v},Object(c.createElement)(s.CardMedia,{isBorderless:!0},Object(c.createElement)("img",{src:i,alt:p})),Object(c.createElement)("div",{className:"woocommerce-task-payment__description"},S&&Object(c.createElement)(me.RecommendedRibbon,{isLocalPartner:j}),Object(c.createElement)(C.Text,{as:"h3",className:"woocommerce-task-payment__title"},p,b&&g&&!!d.length&&Object(c.createElement)(me.SetupRequired,null)),Object(c.createElement)("div",{className:"woocommerce-task-payment__content"},r)),Object(c.createElement)("div",{className:"woocommerce-task-payment__footer"},Object(c.createElement)(de.a,{manageUrl:O,id:l,hasSetup:E,needsSetup:g,isEnabled:_,isInstalled:b,hasPlugins:Boolean(d.length),isRecommended:e,isLoading:u,markConfigured:t,onSetUp:()=>Object(m.recordEvent)("tasklist_payment_setup",{selected:l})}))),Object(c.createElement)(s.CardDivider,null))},ue=({heading:e,markConfigured:t,recommendation:o,paymentGateways:n})=>Object(c.createElement)(s.Card,null,Object(c.createElement)(s.CardHeader,{as:"h2"},e),n.map(e=>{const{id:n}=e;return Object(c.createElement)(pe,{key:n,isRecommended:o===n,markConfigured:t,paymentGateway:e})})),_e=()=>{const e=le()("woocommerce-task-payment","woocommerce-task-card");return Object(c.createElement)(c.Fragment,null,Object(c.createElement)(s.CardBody,{style:{paddingLeft:0,marginBottom:0},className:e},Object(c.createElement)(s.CardMedia,{isBorderless:!0},Object(c.createElement)("span",{className:"is-placeholder"})),Object(c.createElement)("div",{className:"woocommerce-task-payment__description"},Object(c.createElement)(C.Text,{as:"h3",className:"woocommerce-task-payment__title"},Object(c.createElement)("span",{className:"is-placeholder"})),Object(c.createElement)("div",{className:"woocommerce-task-payment__content"},Object(c.createElement)("span",{className:"is-placeholder"}))),Object(c.createElement)("div",{className:"woocommerce-task-payment__footer"},Object(c.createElement)("span",{className:"is-placeholder"}))),Object(c.createElement)(s.CardDivider,null))},be=()=>Object(c.createElement)(s.Card,{"aria-hidden":"true",className:"is-loading woocommerce-payment-gateway-suggestions-list-placeholder"},Object(c.createElement)(s.CardHeader,{as:"h2"},Object(c.createElement)("span",{className:"is-placeholder"})),Object(c.createElement)(_e,null),Object(c.createElement)(_e,null),Object(c.createElement)(_e,null)),ge=({markConfigured:e,paymentGateway:t})=>{var o;const{id:a,connectionUrl:l,setupHelpText:p,settingsUrl:u,title:_,requiredSettings:b}=t,{createNotice:g}=Object(i.useDispatch)("core/notices"),{updatePaymentGateway:O}=Object(i.useDispatch)(r.PAYMENT_GATEWAYS_STORE_NAME),j=Object(C.useSlot)("woocommerce_payment_gateway_configure_"+a),w=Boolean(null==j||null===(o=j.fills)||void 0===o?void 0:o.length),{isUpdating:y}=Object(i.useSelect)(e=>{const{isPaymentGatewayUpdating:t}=e(r.PAYMENT_GATEWAYS_STORE_NAME);return{isUpdating:t()}}),k=t=>{O(a,{enabled:!0,settings:t}).then(t=>{t&&t.id===a&&(e(a),g("success",Object(n.sprintf)(Object(n.__)("%s configured successfully",'woocommerce'),_)))}).catch(()=>{g("error",Object(n.__)("There was a problem saving your payment settings",'woocommerce'))})},E=p&&Object(c.createElement)("p",{dangerouslySetInnerHTML:Object(h.a)(p)}),S=Object(c.createElement)(d.DynamicForm,{fields:b,isBusy:y,onSubmit:k,submitLabel:Object(n.__)("Proceed",'woocommerce'),validate:e=>((e,t)=>{const o={},c=e=>t.find(t=>t.id===e);for(const[t,n]of Object.entries(e)){const e=c(t),s=e.label.replace(/([A-Z][a-z]+)/g,e=>e.toLowerCase());n||"checkbox"===e.type||(o[t]="Please enter your "+s)}return o})(e,b)});return w?Object(c.createElement)(me.WooPaymentGatewayConfigure.Slot,{fillProps:{defaultForm:S,defaultSubmit:k,defaultFields:b,markConfigured:()=>e(a),paymentGateway:t},id:a}):l?Object(c.createElement)(c.Fragment,null,E,Object(c.createElement)(s.Button,{isPrimary:!0,onClick:()=>Object(m.recordEvent)("tasklist_payment_connect_start",{payment_method:a}),href:l},Object(n.__)("Connect",'woocommerce'))):b.length?Object(c.createElement)(c.Fragment,null,E,S):Object(c.createElement)(c.Fragment,null,E||Object(c.createElement)("p",null,Object(n.__)("You can manage this payment gateway's settings by clicking the button below",'woocommerce')),Object(c.createElement)(s.Button,{isPrimary:!0,href:u},Object(n.__)("Set up",'woocommerce')))};o(597);const he=({markConfigured:e,paymentGateway:t})=>{var o;const{id:a,plugins:l=[],title:p,postInstallScripts:u,installed:_}=t,g=Object(C.useSlot)("woocommerce_payment_gateway_setup_"+a),h=Boolean(null==g||null===(o=g.fills)||void 0===o?void 0:o.length),[O,j]=Object(c.useState)(!1);Object(c.useEffect)(()=>{Object(m.recordEvent)("payments_task_stepper_view",{payment_method:a})},[]);const{invalidateResolutionForStoreSelector:w}=Object(i.useDispatch)(r.PAYMENT_GATEWAYS_STORE_NAME),{isOptionUpdating:y,isPaymentGatewayResolving:k,needsPluginInstall:E}=Object(i.useSelect)(e=>{const{isOptionsUpdating:t}=e(r.OPTIONS_STORE_NAME),{isResolving:o}=e(r.PAYMENT_GATEWAYS_STORE_NAME),c=e(r.PLUGINS_STORE_NAME).getActivePlugins(),n=l.filter(e=>!c.includes(e));return{isOptionUpdating:t(),isPaymentGatewayResolving:o("getPaymentGateways"),needsPluginInstall:!!n.length}});Object(c.useEffect)(()=>{if(!E)if(u&&u.length){const e=u.map(e=>Object(b.d)(e));Promise.all(e).then(()=>{j(!0)})}else j(!0)},[u,E]);const S=Object(c.useMemo)(()=>l&&l.length?{key:"install",label:Object(n.sprintf)(Object(n.__)("Install %s",'woocommerce'),p),content:Object(c.createElement)(d.Plugins,{onComplete:(e,t)=>{Object(T.a)(t),w("getPaymentGateways"),Object(m.recordEvent)("tasklist_payment_install_method",{plugins:l})},onError:(e,t)=>Object(T.a)(t),autoInstall:!0,pluginSlugs:l})}:null,[]),v=Object(c.useMemo)(()=>({key:"configure",label:Object(n.sprintf)(Object(n.__)("Configure your %(title)s account",'woocommerce'),{title:p}),content:_?Object(c.createElement)(ge,{markConfigured:e,paymentGateway:t}):null}),[_]),f=E||y||k||!O,N=Object(c.createElement)(d.Stepper,{isVertical:!0,isPending:f,currentStep:E?"install":"configure",steps:[S,v].filter(Boolean)});return Object(c.createElement)(s.Card,{className:"woocommerce-task-payment-method woocommerce-task-card"},Object(c.createElement)(s.CardBody,null,h?Object(c.createElement)(me.WooPaymentGatewaySetup.Slot,{fillProps:{defaultStepper:N,defaultInstallStep:S,defaultConfigureStep:v,markConfigured:()=>e(a),paymentGateway:t},id:a}):N))},Oe=()=>{const e=le()("is-loading","woocommerce-task-payment-method","woocommerce-task-card");return Object(c.createElement)(s.Card,{"aria-hidden":"true",className:e},Object(c.createElement)(s.CardBody,null,Object(c.createElement)(d.Stepper,{isVertical:!0,currentStep:"none",steps:[{key:"first",label:""},{key:"second",label:""}]})))};var je=o(539),we=o(88);const ye={account_name:"",account_number:"",bank_name:"",sort_code:"",iban:"",bic:""};Object(we.registerPlugin)("wc-admin-payment-gateway-setup-bacs",{render:()=>{const e=Object(i.useSelect)(e=>e(r.OPTIONS_STORE_NAME).isOptionsUpdating()),{createNotice:t}=Object(i.useDispatch)("core/notices"),{updateOptions:o}=Object(i.useDispatch)(r.OPTIONS_STORE_NAME),a=e=>{const t={};return e.account_number||e.iban||(t.account_number=t.iban=Object(n.__)("Please enter an account number or IBAN",'woocommerce')),t};return Object(c.createElement)(c.Fragment,null,Object(c.createElement)(me.WooPaymentGatewaySetup,{id:"bacs"},({markConfigured:i})=>Object(c.createElement)(d.Form,{initialValues:ye,onSubmit:e=>(async(e,c)=>{if((await o({woocommerce_bacs_settings:{enabled:"yes"},woocommerce_bacs_accounts:[e]})).success)return c(),void t("success",Object(n.__)("Direct bank transfer details added successfully",'woocommerce'));t("error",Object(n.__)("There was a problem saving your payment settings",'woocommerce'))})(e,i),validate:a},({getInputProps:t,handleSubmit:o})=>Object(c.createElement)(c.Fragment,null,Object(c.createElement)(d.H,null,Object(n.__)("Add your bank details",'woocommerce')),Object(c.createElement)("p",null,Object(n.__)("These details are required to receive payments via bank transfer",'woocommerce')),Object(c.createElement)("div",{className:"woocommerce-task-payment-method__fields"},Object(c.createElement)(d.TextControl,V()({label:Object(n.__)("Account name",'woocommerce'),required:!0},t("account_name"))),Object(c.createElement)(d.TextControl,V()({label:Object(n.__)("Account number",'woocommerce'),required:!0},t("account_number"))),Object(c.createElement)(d.TextControl,V()({label:Object(n.__)("Bank name",'woocommerce'),required:!0},t("bank_name"))),Object(c.createElement)(d.TextControl,V()({label:Object(n.__)("Sort code",'woocommerce'),required:!0},t("sort_code"))),Object(c.createElement)(d.TextControl,V()({label:Object(n.__)("IBAN",'woocommerce'),required:!0},t("iban"))),Object(c.createElement)(d.TextControl,V()({label:Object(n.__)("BIC / Swift",'woocommerce'),required:!0},t("bic")))),Object(c.createElement)(s.Button,{isPrimary:!0,isBusy:e,onClick:o},Object(n.__)("Save",'woocommerce'))))))},scope:'woocommerce'});const ke=({query:e})=>{const{invalidateResolutionForStoreSelector:t}=Object(i.useDispatch)(r.ONBOARDING_STORE_NAME),{updatePaymentGateway:o}=Object(i.useDispatch)(r.PAYMENT_GATEWAYS_STORE_NAME),{getPaymentGateway:s,paymentGatewaySuggestions:a,installedPaymentGateways:l,isResolving:d}=Object(i.useSelect)(e=>({getPaymentGateway:e(r.PAYMENT_GATEWAYS_STORE_NAME).getPaymentGateway,getOption:e(r.OPTIONS_STORE_NAME).getOption,installedPaymentGateways:e(r.PAYMENT_GATEWAYS_STORE_NAME).getPaymentGateways(),isResolving:e(r.ONBOARDING_STORE_NAME).isResolving("getPaymentGatewaySuggestions"),paymentGatewaySuggestions:e(r.ONBOARDING_STORE_NAME).getPaymentGatewaySuggestions()}),[]),p=Object(c.useMemo)(()=>{const e=l.reduce((e,t)=>(e[t.id]=t,e),{});return a.reduce((t,o)=>{const{id:c}=o,n=e[o.id]?e[c]:{},s={installed:!!e[c],postInstallScripts:n.post_install_scripts,enabled:n.enabled||!1,needsSetup:n.needs_setup,settingsUrl:n.settings_url,connectionUrl:n.connection_url,setupHelpText:n.setup_help_text,title:n.title,requiredSettings:n.required_settings_keys?n.required_settings_keys.map(e=>n.settings[e]).filter(Boolean):[],...o};return t.set(c,s),t},new Map)},[l,a]);Object(c.useEffect)(()=>{p.size&&Object(m.recordEvent)("tasklist_payments_options",{options:Array.from(p.values()).map(e=>e.id)})},[p]);const u=Object(c.useCallback)(async(e,c={})=>{if(!p.get(e))throw`Payment gateway ${e} not found in available gateways list`;(e=>{if(!e)return;const c=s(e);c&&!c.enabled&&o(e,{enabled:!0}).then(()=>{t("getTasksStatus")})})(e),Object(m.recordEvent)("tasklist_payment_connect_method",{payment_method:e}),Object(k.getHistory)().push(Object(k.getNewPath)({...c},"/",{}))},[p]),_=Object(c.useMemo)(()=>Array.from(p.values()).filter(e=>e.recommendation_priority).sort((e,t)=>e.recommendation_priority-t.recommendation_priority).map(e=>e.id).shift(),[p]),b=Object(c.useMemo)(()=>{if(!e.id||d||!p.size)return null;const t=p.get(e.id);if(!t)throw`Current gateway ${e.id} not found in available gateways list`;return t},[d,e,p]),[g,h,O]=Object(c.useMemo)(()=>Array.from(p.values()).reduce((e,t)=>{const[o,c,n]=e;return"woocommerce_payments"!==t.id||t.installed&&!t.needsSetup?t.enabled?c.push(t):n.push(t):o.push(t),e},[[],[],[]]),[p]);return e.id&&!b?Object(c.createElement)(Oe,null):b?Object(c.createElement)(he,{paymentGateway:b,markConfigured:u}):Object(c.createElement)("div",{className:"woocommerce-task-payments"},!p.size&&Object(c.createElement)(be,null),!!g.length&&Object(c.createElement)(je.a,{paymentGateway:g[0]}),!!h.length&&Object(c.createElement)(ue,{heading:Object(n.__)("Enabled payment gateways",'woocommerce'),recommendation:_,paymentGateways:h}),!!O.length&&Object(c.createElement)(ue,{heading:Object(n.__)("Additional payment gateways",'woocommerce'),recommendation:_,paymentGateways:O,markConfigured:u}))};var Ee=o(526),Se=o(543);function ve(e,t,o,c){Object(m.recordEvent)("task_view",{task_name:e,wcs_installed:c.includes("woocommerce-services"),wcs_active:o.includes("woocommerce-services"),jetpack_installed:c.includes("jetpack"),jetpack_active:o.includes("jetpack"),jetpack_connected:t})}function fe(e,t){if(e.completed||t.completed)return e.completed?1:-1;const o=e.level||3,c=t.level||3;return o===c?0:o>c?1:-1}o(598);function Ce(e,t,o){return[...new Set([...e,...t])].filter(e=>!o.includes(e))}var Te=({query:e,name:t,eventName:o,isComplete:a,dismissedTasks:l,remindMeLaterTasks:p,tasks:u,trackedCompletedTasks:_,title:b,collapsible:g=!1,onComplete:h,onHide:O,expandingItems:j=!1})=>{const{createNotice:w}=Object(i.useDispatch)("core/notices"),{updateOptions:y}=Object(i.useDispatch)(r.OPTIONS_STORE_NAME),{profileItems:E}=Object(i.useSelect)(e=>{const{getProfileItems:t}=e(r.ONBOARDING_STORE_NAME);return{profileItems:t()}}),S=Object(c.useRef)(e);Object(c.useEffect)(()=>{R()},[]),Object(c.useEffect)(()=>{const{task:t}=S.current,{task:o}=e;t!==o&&(window.document.documentElement.scrollTop=0,S.current=e),x(),P()},[e]);const v=Date.now(),f=u.filter(e=>e.visible&&!l.includes(e.key)&&(!p[e.key]||p[e.key]<v)),T=f.filter(e=>e.completed).map(e=>e.key),N=u.filter(e=>e.visible&&!e.completed&&!l.includes(e.key)),x=()=>{const e=`woocommerce_${t}_complete`,o=a?{[e]:"no"}:{[e]:"yes"};(!N.length&&!a||N.length&&a)&&(y({...o}),"function"==typeof h&&h())},P=()=>{const e=function(e,t){if(!t)return[];return e.filter(e=>t.includes(e))}(T,_),t=(o=e,c=_,f.filter(e=>c.includes(e.key)&&!o.includes(e.key)).map(e=>e.key));var o,c;(function(e,t,o){if(t.length>0)return!0;if(0===o.length)return!1;return!o.every(t=>e.indexOf(t)>=0)})(e,t,T)&&y({woocommerce_task_list_tracked_completed_tasks:Ce(T,_,t)})},A=e=>{const t=l.filter(t=>t!==e);y({woocommerce_task_list_dismissed_tasks:t}),Object(m.recordEvent)(o+"_undo_dismiss_task",{task_name:e})},I=e=>{const{[e]:t,...c}=p;y({woocommerce_task_list_remind_me_later_tasks:c}),Object(m.recordEvent)(o+"_undo_remindmelater_task",{task_name:e})},R=()=>{e.task||Object(m.recordEvent)(o+"_view",{number_tasks:f.length,store_connected:E.wccom_connected})},M=f.map(e=>(e.onClick||(e.onClick=t=>{if(Object(m.recordEvent)(o+"_click",{task_name:e.key}),"A"===t.target.nodeName)return!1;Object(k.updateQueryString)({task:e.key})}),e));if(!M.length)return Object(c.createElement)("div",{className:"woocommerce-task-dashboard__container"});const B=Object(n.sprintf)(Object(n._n)("Show %i more task.","Show %i more tasks.",M.length-2,'woocommerce'),M.length-2),G=Object(n.__)("Show less",'woocommerce'),L=g?C.CollapsibleList:C.List,F=g?{collapseLabel:G,expandLabel:B,show:2,onCollapse:()=>Object(m.recordEvent)(o+"_collapse"),onExpand:()=>Object(m.recordEvent)(o+"_expand")}:{};return Object(c.createElement)(c.Fragment,null,Object(c.createElement)("div",{className:"woocommerce-task-dashboard__container"},Object(c.createElement)(s.Card,{size:"large",className:"woocommerce-task-card woocommerce-homescreen-card"},Object(c.createElement)(s.CardHeader,{size:"medium"},Object(c.createElement)("div",{className:"wooocommerce-task-card__header"},Object(c.createElement)(C.Text,{size:"20",lineHeight:"28px",variant:"title.small"},b),Object(c.createElement)(d.Badge,{count:N.length})),Object(c.createElement)("div",{className:"woocommerce-card__menu woocommerce-card__header-item"},Object(c.createElement)(d.EllipsisMenu,{label:Object(n.__)("Task List Options",'woocommerce'),renderContent:()=>Object(c.createElement)("div",{className:"woocommerce-task-card__section-controls"},Object(c.createElement)(s.Button,{onClick:()=>(e=>{const c={[`woocommerce_${t}_hidden`]:"yes"};Object(m.recordEvent)(o+"_completed",{action:e,completed_task_count:T.length,incomplete_task_count:N.length}),y({...c}),"function"==typeof O&&O()})("remove_card")},Object(n.__)("Hide this",'woocommerce')))}))),Object(c.createElement)(L,V()({animation:"custom"},F),M.map(e=>Object(c.createElement)(C.TaskItem,{key:e.key,title:e.title,completed:e.completed,content:e.content,expandable:j&&e.expandable,expanded:j&&e.expanded,onClick:e.onClick,onDismiss:e.isDismissable?()=>(({key:e,onDismiss:t})=>{w("success",Object(n.__)("Task dismissed"),{actions:[{label:Object(n.__)("Undo",'woocommerce'),onClick:()=>A(e)}]}),Object(m.recordEvent)(o+"_dismiss_task",{task_name:e}),y({woocommerce_task_list_dismissed_tasks:[...l,e]}),t&&t()})(e):void 0,onSnooze:e.allowRemindMeLater?()=>(({key:e,onDismiss:t})=>{w("success",Object(n.__)("Task postponed until tomorrow",'woocommerce'),{actions:[{label:Object(n.__)("Undo",'woocommerce'),onClick:()=>I(e)}]}),Object(m.recordEvent)(o+"_remindmelater_task",{task_name:e});const c=Date.now()+864e5;y({woocommerce_task_list_remind_me_later_tasks:{...p,[e]:c}}),t&&t()})(e):void 0,time:e.time,level:e.level,action:e.action,actionLabel:e.actionLabel,additionalInfo:e.additionalInfo,showActionButton:e.showActionButton,onExpand:e.onExpand,onCollapse:e.onCollapse}))))))},Ne=o(253);const xe=({taskContainer:e,query:t})=>{const o=Object(c.useRef)(),{isJetpackConnected:n,activePlugins:s,installedPlugins:a}=Object(i.useSelect)(e=>{const{getActivePlugins:t,getInstalledPlugins:o,isJetpackConnected:c}=e(r.PLUGINS_STORE_NAME);return{activePlugins:t(),isJetpackConnected:c(),installedPlugins:o()}});return Object(c.useEffect)(()=>{const{task:e}=t;o.current!==e&&(window.document.documentElement.scrollTop=0),o.current=e,(()=>{const{task:e}=t;e&&ve(e,n,s,a)})()},[t]),e&&t.task?Object(c.createElement)("div",{className:"woocommerce-task-dashboard__container"},Object(c.cloneElement)(e,{query:t})):null};var Pe=o(540);const Ae=[],Ie=e=>{const{getFreeExtensions:t,getProductTypes:o,getProfileItems:c,getTasksStatus:n,hasFinishedResolution:s}=e(r.ONBOARDING_STORE_NAME),{getSettings:a}=e(r.SETTINGS_STORE_NAME),{getOption:i,hasFinishedResolution:l}=e(r.OPTIONS_STORE_NAME),{getActivePlugins:m,getInstalledPlugins:d,isJetpackConnected:p}=e(r.PLUGINS_STORE_NAME),u=c(),_=i("woocommerce_task_list_tracked_completed_tasks")||Ae,b=i("woocommerce_task_list_tracked_completed_actions")||Ae,{general:h={}}=a("general"),O=Object(g.b)(h.woocommerce_default_country),{woocommerce_store_address:j,woocommerce_default_country:w,woocommerce_store_postcode:y}=h,k=Boolean(j&&w&&y),E=m(),S=d(),v=n(),f=o();return{activePlugins:E,countryCode:O,dismissedTasks:i("woocommerce_task_list_dismissed_tasks"),freeExtensions:t(),remindMeLaterTasks:i("woocommerce_task_list_remind_me_later_tasks"),isExtendedTaskListComplete:"yes"===i("woocommerce_extended_task_list_complete"),isExtendedTaskListHidden:"yes"===i("woocommerce_extended_task_list_hidden"),isJetpackConnected:p(),isSetupTaskListHidden:"yes"===i("woocommerce_task_list_hidden"),isTaskListComplete:"yes"===i("woocommerce_task_list_complete"),installedPlugins:S,productTypes:f,trackedCompletedActions:b,onboardingStatus:v,profileItems:u,trackedCompletedTasks:_,hasCompleteAddress:k,isResolving:!(l("getOption",["woocommerce_task_list_complete"])&&l("getOption",["woocommerce_task_list_hidden"])&&l("getOption",["woocommerce_extended_task_list_complete"])&&l("getOption",["woocommerce_extended_task_list_hidden"])&&l("getOption",["woocommerce_task_list_remind_me_later_tasks"])&&l("getOption",["woocommerce_task_list_tracked_completed_tasks"])&&l("getOption",["woocommerce_task_list_dismissed_tasks"])&&s("getProductTypes"))}};t.default=({userPreferences:e,query:t})=>{const{createNotice:o}=Object(i.useDispatch)("core/notices"),{updateOptions:p}=Object(i.useDispatch)(r.OPTIONS_STORE_NAME),{invalidateResolutionForStoreSelector:u}=Object(i.useDispatch)(r.ONBOARDING_STORE_NAME),{installAndActivatePlugins:_}=Object(i.useDispatch)(r.PLUGINS_STORE_NAME),{trackedCompletedTasks:b,activePlugins:h,countryCode:O,freeExtensions:j,installedPlugins:E,productTypes:S,isJetpackConnected:v,onboardingStatus:C,profileItems:T,isSetupTaskListHidden:N,dismissedTasks:x,remindMeLaterTasks:P,isTaskListComplete:R,isExtendedTaskListHidden:M,isExtendedTaskListComplete:B,hasCompleteAddress:G,trackedCompletedActions:L,isResolving:F}=Object(i.useSelect)(Ie),[U,D]=Object(c.useState)(!1),[z,q]=Object(l.useExperiment)("woocommerce_tasklist_progression");Object(c.useEffect)(()=>{document.body.classList.add("woocommerce-onboarding"),document.body.classList.add("woocommerce-task-dashboard__body"),u("getProductTypes")},[]);const V=()=>{U||Object(m.recordEvent)("tasklist_purchase_extensions"),D(!U)},J=e=>Object(c.createElement)(Te,{name:"extended_task_list",eventName:"extended_tasklist",collapsible:!0,dismissedTasks:x||[],remindMeLaterTasks:P||[],isComplete:B,query:t,tasks:e,title:Object(n.__)("Things to do next",'woocommerce'),trackedCompletedTasks:b||[]}),W=function({activePlugins:e,countryCode:t,createNotice:o,freeExtensions:s,installAndActivatePlugins:a,installedPlugins:i,isJetpackConnected:r,onboardingStatus:l,profileItems:m,query:d,toggleCartModal:p,onTaskSelect:u,hasCompleteAddress:_,trackedCompletedActions:b,productTypes:h}){const{hasPaymentGateway:O,hasPhysicalProducts:j,hasProducts:w,isAppearanceComplete:E,isTaxComplete:S,shippingZonesCount:v,wcPayIsConnected:C}={hasPaymentGateway:!1,hasPhysicalProducts:!1,hasProducts:!1,isAppearanceComplete:!1,isTaxComplete:!1,shippingZonesCount:0,wcPayIsConnected:!1,...l},T=Object(g.a)(h,m,i),{products:N,remainingProducts:x,uniqueItemsList:P}=T,R=-1!==i.indexOf("woocommerce-payments"),M=-1!==e.indexOf("woocommerce-services"),{completed:B,product_types:G,business_extensions:L}=m,F=(L||[]).includes("woocommerce-payments");let U,D=Object(n.__)("Add paid extensions to my store",'woocommerce');if(1===P.length){var z;const{name:e}=P[0],t=Object(n.__)("Add %s to my store",'woocommerce');D=Object(n.sprintf)(t,e),U=null===(z=N.find(({label:t})=>t===e))||void 0===z?void 0:z.description}else{const e=P.map(({name:e})=>e),t=e.pop();let o=e.join(", ");e.length>1&&(o+=","),U=Object(n.sprintf)(Object(n.__)("Good choice! You chose to add %1$s and %2$s to your store.",'woocommerce'),o,t)}const{automatedTaxSupportedCountries:q=[],taxJarActivated:V}=l,J=!V&&q.includes(t),W=_&&M&&J;let Y=Object(n.__)("Let's go",'woocommerce'),Z=Object(n.__)("Set your store location and configure tax rate settings.",'woocommerce');W&&(Y=Object(n.__)("Yes please",'woocommerce'),Z=Object(n.__)("Good news! WooCommerce Services and Jetpack can automate your sales tax calculations for you.",'woocommerce'));const[$,Q]=A(s,e,i),K=[{key:"store_details",title:Object(n.__)("Store details",'woocommerce'),content:Object(n.__)("Your store address is required to set the origin country for shipping, currencies, and payment options.",'woocommerce'),container:null,action:Object(n.__)("Let's go",'woocommerce'),onClick:()=>{u("store_details"),Object(k.getHistory)().push(Object(k.getNewPath)({},"/setup-wizard",{}))},completed:B,visible:!0,time:Object(n.__)("4 minutes",'woocommerce'),type:"setup"},{key:"purchase",title:D,content:U,container:null,action:Object(n.__)("Purchase & install now",'woocommerce'),onClick:()=>(u("purchase"),x.length?p():null),visible:N.length,completed:N.length&&!x.length,time:Object(n.__)("2 minutes",'woocommerce'),isDismissable:!0,type:"setup"},{key:"products",title:Object(n.__)("Add my products",'woocommerce'),content:Object(n.__)("Start by adding the first product to your store. You can add your products manually, via CSV, or import them from another service.",'woocommerce'),container:Object(c.createElement)(H,null),onClick:()=>{u("products"),Object(k.updateQueryString)({task:"products"})},completed:w,visible:!0,time:Object(n.__)("1 minute per product",'woocommerce'),type:"setup"},{key:"woocommerce-payments",title:Object(n.__)("Get paid with WooCommerce Payments",'woocommerce'),content:Object(n.__)("You're only one step away from getting paid. Verify your business details to start managing transactions with WooCommerce Payments.",'woocommerce'),action:Object(n.__)("Finish setup","woocommmerce-admin"),expanded:!0,container:Object(c.createElement)(c.Fragment,null),completed:C,onClick:async t=>{if("A"===t.target.nodeName)return!1;await new Promise((t,c)=>(ve("wcpay",r,e,i),u("woocommerce-payments"),Object(je.b)(c,o,a)))},visible:F&&R&&Object(je.c)(t),additionalInfo:Object(n.__)('By setting up, you are agreeing to the <a href="https://wordpress.com/tos/" target="_blank">Terms of Service</a>','woocommerce'),time:Object(n.__)("2 minutes",'woocommerce'),type:"setup"},{key:"payments",title:Object(n.__)("Set up payments",'woocommerce'),content:Object(n.__)("Choose payment providers and enable payment methods at checkout.",'woocommerce'),container:Object(c.createElement)(ke,{query:d}),completed:O,onClick:()=>{u("payments"),Object(k.updateQueryString)({task:"payments"})},visible:window.wcAdminFeatures["payment-gateway-suggestions"]&&(!R||!F||!Object(je.c)(t)),time:Object(n.__)("2 minutes",'woocommerce'),type:"setup"},{key:"tax",title:Object(n.__)("Set up tax",'woocommerce'),content:Z,container:Object(c.createElement)(ie,null),action:Y,onClick:(e,t={})=>{const{isExpanded:o}=t;u("tax"),Object(k.updateQueryString)({task:"tax",auto:W&&o})},completed:S,visible:!0,time:Object(n.__)("1 minute",'woocommerce'),type:"setup"},{key:"shipping",title:Object(n.__)("Set up shipping",'woocommerce'),content:Object(n.__)("Set your store location and where you'll ship to.",'woocommerce'),container:Object(c.createElement)(se,null),action:Object(n.__)("Let's go",'woocommerce'),onClick:()=>{v>0?window.location=Object(Se.b)({type:"wc-settings",tab:"shipping"}).href:(u("shipping"),Object(k.updateQueryString)({task:"shipping"}))},completed:v>0,visible:G&&G.includes("physical")||j,time:Object(n.__)("1 minute",'woocommerce'),type:"setup"},{key:"marketing",title:Object(n.__)("Set up marketing tools",'woocommerce'),content:Object(n.__)("Add recommended marketing tools to reach new customers and grow your business",'woocommerce'),container:Object(c.createElement)(I,{trackedCompletedActions:b}),onClick:()=>{u("marketing"),Object(k.updateQueryString)({task:"marketing"})},completed:!!$.length&&b.includes("marketing")||!Q.length,visible:window.wcAdminFeatures&&window.wcAdminFeatures["remote-free-extensions"]&&(!!Q.length||!!$.length),time:Object(n.__)("1 minute",'woocommerce'),type:"setup"},{key:"appearance",title:Object(n.__)("Personalize my store",'woocommerce'),content:Object(n.__)("Add your logo, create a homepage, and start designing your store.",'woocommerce'),container:Object(c.createElement)(f,null),action:Object(n.__)("Let's go",'woocommerce'),onClick:()=>{u("appearance"),Object(k.updateQueryString)({task:"appearance"})},completed:E,visible:!0,time:Object(n.__)("2 minutes",'woocommerce'),type:"setup"}],X=Object(y.applyFilters)("woocommerce_admin_onboarding_task_list",K,d);for(const e of X)e.level=e.level?parseInt(e.level,10):3;return Object(Ee.a)(X,"type","extension")}({activePlugins:h,countryCode:O,createNotice:o,freeExtensions:j,installAndActivatePlugins:_,installedPlugins:E,isJetpackConnected:v,onboardingStatus:C,profileItems:T,query:t,toggleCartModal:V,onTaskSelect:t=>{const o=(t=>{const o=e.task_list_tracked_started_tasks;return o&&o[t]?o[t]:0})(t);Object(m.recordEvent)("tasklist_click",{task_name:t}),(e=>!!b&&b.includes(e))(t)||((t,o)=>{const c=e.task_list_tracked_started_tasks||{};e.updateUserPreferences({task_list_tracked_started_tasks:{...c||{},[t]:o}})})(t,o+1)},hasCompleteAddress:G,trackedCompletedActions:L,productTypes:S}),{extension:Y,setup:Z}=W,{task:$}=t,Q=Array.isArray(Y)&&Y.sort(fe),K=(e=>{const{task:o}=t,c=e.find(e=>e.key===o);return c||null})([...Q||[],...Z||[]]);if($&&!K)return null;if(K)return Object(c.createElement)(xe,{taskContainer:K.container,query:t});if(F)return Object(c.createElement)(Pe.a,null);const X="extended_task_list"===window.location.hash.substr(1);return Object(c.createElement)(c.Fragment,null,Z&&(!N||$)&&(z?Object(c.createElement)(Pe.a,null):Object(c.createElement)(Te,{name:"task_list",eventName:"tasklist",expandingItems:"treatment"===(null==q?void 0:q.variationName),dismissedTasks:x||[],remindMeLaterTasks:P||[],isComplete:R,query:t,tasks:Z,title:Object(n.__)("Get ready to start selling",'woocommerce'),trackedCompletedTasks:b||[],onComplete:()=>p({woocommerce_default_homepage_layout:"two_columns"}),onHide:()=>p({woocommerce_default_homepage_layout:"two_columns"})})),Q&&Object(c.createElement)(Ne.a,null,Object(c.createElement)(s.MenuGroup,{className:"woocommerce-layout__homescreen-display-options",label:Object(n.__)("Display",'woocommerce')},Object(c.createElement)(s.MenuItem,{className:"woocommerce-layout__homescreen-extension-tasklist-toggle",icon:!M&&a.a,isSelected:!M,role:"menuitemcheckbox",onClick:()=>{const e=!M;Object(m.recordEvent)(e?"extended_tasklist_hide":"extended_tasklist_show"),p({woocommerce_extended_task_list_hidden:e?"yes":"no"})}},Object(n.__)("Show things to do next",'woocommerce')))),Q&&!M&&(X?Object(c.createElement)(d.ScrollTo,{offset:"-20"},J(Q)):J(Q)),U&&Object(c.createElement)(w,{onClose:()=>V(),onClickPurchaseLater:()=>V()}))}}}]);woocommerce-admin/dist/chunks/51.style.css000064400000016705151335517650014531 0ustar00.woocommerce-task-marketing .components-card__header{flex-direction:column;align-items:flex-start;display:flex!important}.woocommerce-task-marketing .components-card__header h2{align-self:start!important;color:#1e1e1e;font-size:20px;margin-bottom:0}.woocommerce-task-marketing .components-card__header span{margin-left:0;margin-top:8px;color:#757575}.woocommerce-plugin-list__plugin{display:flex;padding:24px;border-top:1px solid #e0e0e0}.woocommerce-plugin-list__plugin:first-child{border-top:0}.woocommerce-plugin-list__plugin h4{margin-bottom:12px;font-weight:600;color:#1e1e1e}.woocommerce-plugin-list__plugin p{color:#757575;font-weight:400}.woocommerce-plugin-list__plugin-logo{margin-right:45px;display:flex;align-items:center}.woocommerce-plugin-list__plugin-logo img{width:50px}.woocommerce-plugin-list__plugin-text{max-width:370px;margin-right:16px}.woocommerce-plugin-list__plugin-action{display:flex;align-items:center;margin-left:auto}.woocommerce-plugin-list__title{padding:12px 30px;background:#e0e0e0;position:relative}.woocommerce-plugin-list__title h3{font-weight:500;color:#000}@media(min-width:601px){.woocommerce-product-template-modal{min-width:565px}}.woocommerce-product-template-modal .woocommerce-product-template-modal__actions{padding-top:24px}.woocommerce-product-template-modal__list .components-base-control{margin:0 -24px}.woocommerce-product-template-modal__list .components-base-control .components-base-control__field .components-radio-control__option{display:flex;text-decoration:none;width:100%;align-items:center;padding:16px 24px;margin-bottom:0;box-sizing:border-box;border-bottom:1px solid #f0f0f0}.woocommerce-product-template-modal__list .components-base-control .components-base-control__field .components-radio-control__option:first-child{border-top:1px solid #f0f0f0}.woocommerce-product-template-modal__list .components-base-control .components-base-control__field .components-radio-control__option .components-radio-control__input{margin-right:16px;flex:none}.woocommerce-product-template-modal__list .components-base-control .components-base-control__field .components-radio-control__option .components-radio-control__input:checked:before{box-sizing:border-box}.woocommerce-product-template-modal__list .components-base-control .components-base-control__field .components-radio-control__option .components-radio-control__input:focus{box-shadow:none}.woocommerce-product-template-modal__list .woocommerce-product-template-modal__list-title{color:#1e1e1e;display:block}.woocommerce-product-template-modal__list .woocommerce-product-template-modal__list-subtitle{color:#757575;margin-top:4px;display:block}.woocommerce-product-template-modal__actions{text-align:right}.woocommerce-task-payment{display:flex;flex-direction:row;align-items:center;position:relative;overflow:hidden}.woocommerce-task-payment .components-card__media{width:170px;flex-shrink:0}.woocommerce-task-payment .components-card__media .is-placeholder,.woocommerce-task-payment .components-card__media img,.woocommerce-task-payment .components-card__media svg{margin:auto;max-width:100px;display:block}.woocommerce-task-payment .components-card__media .is-placeholder{height:36px}.woocommerce-task-payment .woocommerce-task-payment__footer .is-placeholder{width:70px;height:36px}.woocommerce-task-payment>.components-form-toggle{min-width:52px}.woocommerce-task-payment .woocommerce-task-payment__title{display:flex;align-items:center;font-size:16px;font-weight:500;color:#2c3338;margin-top:0;margin-bottom:8px}.woocommerce-task-payment .woocommerce-task-payment__content{font-size:14px;color:#50575e;margin:0 36px 0 0}.woocommerce-task-payment .woocommerce-task-payment__content .text-style-strong{font-weight:700}.woocommerce-task-payment .woocommerce-task-payment__content p{font-size:12px}.woocommerce-task-payment .woocommerce-task-payment__description{flex:1}@media(max-width:600px){.woocommerce-task-payment{flex-wrap:wrap}.woocommerce-task-payment .woocommerce-task-payment__content{margin:0}.woocommerce-task-payment .components-card__media{order:1;flex-basis:50%}.woocommerce-task-payment .components-card__media>img,.woocommerce-task-payment .components-card__media>svg{margin:0 0 0 24px}.woocommerce-task-payment .woocommerce-task-payment__description{order:3;padding:24px 0 0 24px}.woocommerce-task-payment .woocommerce-task-payment__footer{flex-basis:50%;align-self:flex-start;order:2;text-align:right}}.woocommerce-payment-gateway-suggestions-list-placeholder .is-placeholder{animation:loading-fade 1.6s ease-in-out infinite;background-color:#f0f0f0;color:transparent;display:inline-block;max-width:240px;width:80%}.woocommerce-payment-gateway-suggestions-list-placeholder .is-placeholder:after{content:" "}@media screen and (prefers-reduced-motion:reduce){.woocommerce-payment-gateway-suggestions-list-placeholder .is-placeholder{animation:none}}.woocommerce-task-payment-method.is-loading .woocommerce-stepper__step-label{animation:loading-fade 1.6s ease-in-out infinite;background-color:#f0f0f0;color:transparent;display:inline-block;width:60%}.woocommerce-task-payment-method.is-loading .woocommerce-stepper__step-label:after{content:" "}@media screen and (prefers-reduced-motion:reduce){.woocommerce-task-payment-method.is-loading .woocommerce-stepper__step-label{animation:none}}.woocommerce-task-payment-method.is-loading .woocommerce-stepper__step-icon{animation:loading-fade 1.6s ease-in-out infinite;background-color:#f0f0f0;color:transparent}.woocommerce-task-payment-method.is-loading .woocommerce-stepper__step-icon:after{content:" "}@media screen and (prefers-reduced-motion:reduce){.woocommerce-task-payment-method.is-loading .woocommerce-stepper__step-icon{animation:none}}.woocommerce-task-payment-method.is-loading .woocommerce-stepper__step:first-child .woocommerce-stepper__step-label{width:30%}.woocommerce-task-payment-method.is-loading .woocommerce-stepper__step-number{display:none}:root{--wp-admin-theme-color:#007cba;--wp-admin-theme-color-darker-10:#006ba1;--wp-admin-theme-color-darker-20:#005a87}body.admin-color-light{--wp-admin-theme-color:#0085ba;--wp-admin-theme-color-darker-10:#0073a1;--wp-admin-theme-color-darker-20:#006187}body.admin-color-modern{--wp-admin-theme-color:#3858e9;--wp-admin-theme-color-darker-10:#2145e6;--wp-admin-theme-color-darker-20:#183ad6}body.admin-color-blue{--wp-admin-theme-color:#096484;--wp-admin-theme-color-darker-10:#07526c;--wp-admin-theme-color-darker-20:#064054}body.admin-color-coffee{--wp-admin-theme-color:#46403c;--wp-admin-theme-color-darker-10:#383330;--wp-admin-theme-color-darker-20:#2b2724}body.admin-color-ectoplasm{--wp-admin-theme-color:#523f6d;--wp-admin-theme-color-darker-10:#46365d;--wp-admin-theme-color-darker-20:#3a2c4d}body.admin-color-midnight{--wp-admin-theme-color:#e14d43;--wp-admin-theme-color-darker-10:#dd382d;--wp-admin-theme-color-darker-20:#d02c21}body.admin-color-ocean{--wp-admin-theme-color:#627c83;--wp-admin-theme-color-darker-10:#576e74;--wp-admin-theme-color-darker-20:#4c6066}body.admin-color-sunrise{--wp-admin-theme-color:#dd823b;--wp-admin-theme-color-darker-10:#d97426;--wp-admin-theme-color-darker-20:#c36922}.woocommerce-task-list__item{overflow:hidden}.woocommerce-task-list__item.woocommerce-list__item-enter{opacity:0;max-height:0}.woocommerce-task-list__item.woocommerce-list__item-enter-active{opacity:1;max-height:100px;transition:opacity .5s,max-height .5s}.woocommerce-task-list__item.woocommerce-list__item-exit{opacity:1;max-height:100px}.woocommerce-task-list__item.woocommerce-list__item-exit-active{opacity:0;max-height:0;transition:opacity .5s,max-height .5s}woocommerce-admin/dist/chunks/4.style.css000064400000004237151335517650014444 0ustar00:root{--wp-admin-theme-color:#007cba;--wp-admin-theme-color-darker-10:#006ba1;--wp-admin-theme-color-darker-20:#005a87}body.admin-color-light{--wp-admin-theme-color:#0085ba;--wp-admin-theme-color-darker-10:#0073a1;--wp-admin-theme-color-darker-20:#006187}body.admin-color-modern{--wp-admin-theme-color:#3858e9;--wp-admin-theme-color-darker-10:#2145e6;--wp-admin-theme-color-darker-20:#183ad6}body.admin-color-blue{--wp-admin-theme-color:#096484;--wp-admin-theme-color-darker-10:#07526c;--wp-admin-theme-color-darker-20:#064054}body.admin-color-coffee{--wp-admin-theme-color:#46403c;--wp-admin-theme-color-darker-10:#383330;--wp-admin-theme-color-darker-20:#2b2724}body.admin-color-ectoplasm{--wp-admin-theme-color:#523f6d;--wp-admin-theme-color-darker-10:#46365d;--wp-admin-theme-color-darker-20:#3a2c4d}body.admin-color-midnight{--wp-admin-theme-color:#e14d43;--wp-admin-theme-color-darker-10:#dd382d;--wp-admin-theme-color-darker-20:#d02c21}body.admin-color-ocean{--wp-admin-theme-color:#627c83;--wp-admin-theme-color-darker-10:#576e74;--wp-admin-theme-color-darker-20:#4c6066}body.admin-color-sunrise{--wp-admin-theme-color:#dd823b;--wp-admin-theme-color-darker-10:#d97426;--wp-admin-theme-color-darker-20:#c36922}.woocommerce-layout__activity-panel-header{height:50px;background:#e0e0e0;padding:16px;display:flex;justify-content:space-between;align-items:center}@media(min-width:783px){.woocommerce-layout__activity-panel-header{padding:16px 24px}}.woocommerce-layout__activity-panel-header h3{font-size:13px;font-weight:600;line-height:16px;margin:0;padding:0}.woocommerce-layout__activity-panel-header .woocommerce-ellipsis-menu__toggle.components-button:not(:disabled):not([aria-disabled=true]):focus,.woocommerce-layout__activity-panel-header .woocommerce-ellipsis-menu__toggle.components-button:not(:disabled):not([aria-disabled=true]):hover{box-shadow:none;border-radius:10px;background:#ccc}.woocommerce-layout__inbox-title{color:#1e1e1e;display:flex;align-items:center}.woocommerce-layout__inbox-subtitle{color:#757575}.woocommerce-layout__inbox-badge{margin-left:6px;background-color:#757575;border-radius:13px;padding:0 6px;color:#fff;display:inline-block;text-align:center;vertical-align:top}woocommerce-admin/dist/chunks/50.style.css000064400000003636151335517650014527 0ustar00:root{--wp-admin-theme-color:#007cba;--wp-admin-theme-color-darker-10:#006ba1;--wp-admin-theme-color-darker-20:#005a87}body.admin-color-light{--wp-admin-theme-color:#0085ba;--wp-admin-theme-color-darker-10:#0073a1;--wp-admin-theme-color-darker-20:#006187}body.admin-color-modern{--wp-admin-theme-color:#3858e9;--wp-admin-theme-color-darker-10:#2145e6;--wp-admin-theme-color-darker-20:#183ad6}body.admin-color-blue{--wp-admin-theme-color:#096484;--wp-admin-theme-color-darker-10:#07526c;--wp-admin-theme-color-darker-20:#064054}body.admin-color-coffee{--wp-admin-theme-color:#46403c;--wp-admin-theme-color-darker-10:#383330;--wp-admin-theme-color-darker-20:#2b2724}body.admin-color-ectoplasm{--wp-admin-theme-color:#523f6d;--wp-admin-theme-color-darker-10:#46365d;--wp-admin-theme-color-darker-20:#3a2c4d}body.admin-color-midnight{--wp-admin-theme-color:#e14d43;--wp-admin-theme-color-darker-10:#dd382d;--wp-admin-theme-color-darker-20:#d02c21}body.admin-color-ocean{--wp-admin-theme-color:#627c83;--wp-admin-theme-color-darker-10:#576e74;--wp-admin-theme-color-darker-20:#4c6066}body.admin-color-sunrise{--wp-admin-theme-color:#dd823b;--wp-admin-theme-color-darker-10:#d97426;--wp-admin-theme-color-darker-20:#c36922}.woocommerce-dashboard__store-performance{margin-bottom:24px}@media(max-width:782px){.woocommerce-dashboard__store-performance{border-width:0}}.woocommerce-dashboard__store-performance .woocommerce-summary__item{background-color:#fff}.woocommerce-dashboard__store-performance .woocommerce-summary__item:hover{background-color:#f0f0f0}.woocommerce-dashboard__store-performance .woocommerce-summary{background-color:#f0f0f0;margin:0}@media(max-width:782px){.woocommerce-dashboard__store-performance .woocommerce-summary.is-placeholder{border-top:0}.woocommerce-dashboard__store-performance .woocommerce-summary:not(.is-placeholder) .woocommerce-summary__item-container:first-child .woocommerce-summary__item{border-top:1px solid #ccc}}woocommerce-admin/dist/chunks/wcpay-usage-modal.js000064400000010021151335517650016271 0ustar00(window.__wcAdmin_webpackJsonp=window.__wcAdmin_webpackJsonp||[]).push([[53],{514:function(e,t,o){"use strict";var s=o(0),i=o(2),n=o(14),c=o(7),a=o(18),r=o.n(a),m=o(3),l=o(21),u=o(11),d=o(122);class p extends s.Component{constructor(e){super(e),this.state={isLoadingScripts:!1,isRequestStarted:!1}}async componentDidUpdate(e,t){const{hasErrors:o,isRequesting:s,onClose:n,onContinue:c,createNotice:a}=this.props,{isLoadingScripts:r,isRequestStarted:m}=this.state;if(!m)return;const l=!s&&!r&&(e.isRequesting||t.isLoadingScripts)&&!o,u=!s&&e.isRequesting&&o;l&&(n(),c()),u&&(a("error",Object(i.__)("There was a problem updating your preferences",'woocommerce')),n())}updateTracking({allowTracking:e}){const{updateOptions:t}=this.props;e&&"function"==typeof window.wcTracks.enable?(this.setState({isLoadingScripts:!0}),window.wcTracks.enable(()=>{this._isMounted&&(Object(d.initializeExPlat)(),this.setState({isLoadingScripts:!1}))})):e||(window.wcTracks.isEnabled=!1);const o=e?"yes":"no";this.setState({isRequestStarted:!0}),t({woocommerce_allow_tracking:o})}componentDidMount(){this._isMounted=!0}componentWillUnmount(){this._isMounted=!1}render(){const{allowTracking:e,isResolving:t,onClose:o,onContinue:n}=this.props;if(t)return null;if(e)return o(),n(),null;const{isRequesting:c,title:a=Object(i.__)("Build a better WooCommerce",'woocommerce'),message:u=r()({mixedString:Object(i.__)("Get improved features and faster fixes by sharing non-sensitive data via {{link}}usage tracking{{/link}} that shows us how WooCommerce is used. No personal data is tracked or stored.",'woocommerce'),components:{link:Object(s.createElement)(l.Link,{href:"https://woocommerce.com/usage-tracking?utm_medium=product",target:"_blank",type:"external"})}}),dismissActionText:d=Object(i.__)("No thanks",'woocommerce'),acceptActionText:p=Object(i.__)("Yes, count me in!",'woocommerce')}=this.props,{isRequestStarted:g}=this.state,w=g&&c;return Object(s.createElement)(m.Modal,{title:a,isDismissible:this.props.isDismissible,onRequestClose:()=>this.props.onClose(),className:"woocommerce-usage-modal"},Object(s.createElement)("div",{className:"woocommerce-usage-modal__wrapper"},Object(s.createElement)("div",{className:"woocommerce-usage-modal__message"},u),Object(s.createElement)("div",{className:"woocommerce-usage-modal__actions"},Object(s.createElement)(m.Button,{isSecondary:!0,isBusy:w,onClick:()=>this.updateTracking({allowTracking:!1})},d),Object(s.createElement)(m.Button,{isPrimary:!0,isBusy:w,onClick:()=>this.updateTracking({allowTracking:!0})},p))))}}t.a=Object(n.compose)(Object(c.withSelect)(e=>{const{getOption:t,getOptionsUpdatingError:o,isOptionsUpdating:s,hasFinishedResolution:i}=e(u.OPTIONS_STORE_NAME);return{allowTracking:"yes"===t("woocommerce_allow_tracking"),isRequesting:Boolean(s()),isResolving:!i("getOption",["woocommerce_allow_tracking"])||void 0===t("woocommerce_allow_tracking"),hasErrors:Boolean(o())}}),Object(c.withDispatch)(e=>{const{createNotice:t}=e("core/notices"),{updateOptions:o}=e(u.OPTIONS_STORE_NAME);return{createNotice:t,updateOptions:o}}))(p)},519:function(e,t,o){"use strict";o.r(t),o.d(t,"UsageModal",(function(){return l}));var s=o(0),i=o(2),n=o(12),c=o(18),a=o.n(c),r=o(21),m=o(514);const l=()=>{const e="1"===Object(n.getQuery)()["wcpay-connection-success"],[t,o]=Object(s.useState)(e);if(!t)return null;const c=()=>{o(!1),Object(n.updateQueryString)({"wcpay-connection-success":void 0})},l=Object(i.__)("Help us build a better WooCommerce Payments experience",'woocommerce'),u=a()({mixedString:Object(i.__)("By agreeing to share non-sensitive {{link}}usage data{{/link}}, you’ll help us improve features and optimize the WooCommerce Payments experience. You can opt out at any time.",'woocommerce'),components:{link:Object(s.createElement)(r.Link,{href:"https://woocommerce.com/usage-tracking?utm_medium=product",target:"_blank",type:"external"})}});return Object(s.createElement)(m.a,{isDismissible:!1,title:l,message:u,acceptActionText:Object(i.__)("I agree",'woocommerce'),dismissActionText:Object(i.__)("No thanks",'woocommerce'),onContinue:c,onClose:c})};t.default=l}}]);woocommerce-admin/dist/chunks/26.style.css000064400000007132151335517650014525 0ustar00.woocommerce-dashboard__chart-block-wrapper{cursor:pointer}.woocommerce-dashboard__chart-block-wrapper:hover .woocommerce-card__header,.woocommerce-dashboard__chart-block-wrapper:hover .woocommerce-chart{background:#f8f9f9}.woocommerce-dashboard__chart-block-wrapper:hover .woocommerce-legend__item button{background:transparent}.woocommerce-dashboard__chart-block-wrapper .woocommerce-chart{margin-top:0;margin-bottom:0;border:0}.woocommerce-dashboard__chart-block-wrapper .woocommerce-chart__footer{position:relative}.woocommerce-dashboard__chart-block-wrapper .woocommerce-chart__footer:after{content:"";position:absolute;width:100%;height:100%;left:0;top:0;cursor:pointer;z-index:1}.woocommerce-dashboard__chart-block .woocommerce-card__body{padding:0;position:relative}.woocommerce-dashboard__chart-block .woocommerce-card__body .woocommerce-chart{border:none;margin:0}.woocommerce-dashboard__chart-block .woocommerce-card__body .woocommerce-chart .woocommerce-legend__item>button{cursor:default}.woocommerce-dashboard__chart-block .woocommerce-card__body .woocommerce-chart .woocommerce-legend__item>button:hover{background:#f0f0f0}.woocommerce-dashboard__chart-block .woocommerce-card__body .woocommerce-chart .woocommerce-legend__item>button .woocommerce-legend__item-container{cursor:default}.woocommerce-dashboard__chart-block .woocommerce-card__body .woocommerce-chart .woocommerce-legend__item>button .woocommerce-legend__item-container .woocommerce-legend__item-checkmark.woocommerce-legend__item-checkmark-checked:after{display:none}.woocommerce-dashboard__chart-block .woocommerce-card__body .woocommerce-chart:hover,.woocommerce-dashboard__chart-block .woocommerce-card__body .woocommerce-chart:hover .woocommerce-legend__item>button,.woocommerce-dashboard__chart-block:hover{background:#f0f0f0}.woocommerce-dashboard__chart-block .screen-reader-text:focus{clip:auto;-webkit-clip-path:none;clip-path:none;z-index:1;left:6px;top:7px;height:auto;width:auto;display:block;font-size:14px;font-size:.875rem;font-weight:600;padding:15px 23px 14px;background:#f1f1f1;color:#0073aa;text-decoration:none;box-shadow:0 0 2px 2px rgba(0,0,0,.6)}:root{--wp-admin-theme-color:#007cba;--wp-admin-theme-color-darker-10:#006ba1;--wp-admin-theme-color-darker-20:#005a87}body.admin-color-light{--wp-admin-theme-color:#0085ba;--wp-admin-theme-color-darker-10:#0073a1;--wp-admin-theme-color-darker-20:#006187}body.admin-color-modern{--wp-admin-theme-color:#3858e9;--wp-admin-theme-color-darker-10:#2145e6;--wp-admin-theme-color-darker-20:#183ad6}body.admin-color-blue{--wp-admin-theme-color:#096484;--wp-admin-theme-color-darker-10:#07526c;--wp-admin-theme-color-darker-20:#064054}body.admin-color-coffee{--wp-admin-theme-color:#46403c;--wp-admin-theme-color-darker-10:#383330;--wp-admin-theme-color-darker-20:#2b2724}body.admin-color-ectoplasm{--wp-admin-theme-color:#523f6d;--wp-admin-theme-color-darker-10:#46365d;--wp-admin-theme-color-darker-20:#3a2c4d}body.admin-color-midnight{--wp-admin-theme-color:#e14d43;--wp-admin-theme-color-darker-10:#dd382d;--wp-admin-theme-color-darker-20:#d02c21}body.admin-color-ocean{--wp-admin-theme-color:#627c83;--wp-admin-theme-color-darker-10:#576e74;--wp-admin-theme-color-darker-20:#4c6066}body.admin-color-sunrise{--wp-admin-theme-color:#dd823b;--wp-admin-theme-color-darker-10:#d97426;--wp-admin-theme-color-darker-20:#c36922}.woocommerce-dashboard__dashboard-charts{border-bottom:0;border-right:0}.woocommerce-dashboard__dashboard-charts .woocommerce-section-header__actions{flex-grow:0}.woocommerce-dashboard__dashboard-charts .woocommerce-card__body{padding:0}.woocommerce-dashboard__dashboard-charts .woocommerce-summary{margin:0}woocommerce-admin/dist/chunks/5.style.css000064400000026404151335517650014445 0ustar00.woocommerce-layout__activity-panel-content .woocommerce-inbox-message,.woocommerce-layout__activity-panel-content .woocommerce-notification-panels>div{margin-top:24px}.woocommerce-layout__activity-panel-content .woocommerce-abbreviated-notifications{border-top:1px solid #e0e0e0}.woocommerce-layout__activity-panel-content .woocommerce-abbreviated-notifications>div{border:none;margin-bottom:0}.woocommerce-layout__activity-panel-content .woocommerce-abbreviated-notifications .woocommerce-abbreviated-notification h3{color:#007cba;color:var(--wp-admin-theme-color);font-weight:700;font-size:14px}.woocommerce-layout__activity-panel-content .woocommerce-abbreviated-notifications .woocommerce-abbreviated-notification div,.woocommerce-layout__activity-panel-content .woocommerce-abbreviated-notifications .woocommerce-abbreviated-notification p{color:#757575}.woocommerce-layout__activity-panel-content .woocommerce-abbreviated-notifications .woocommerce-abbreviated-notification .woocommerce-abbreviated-card__content{padding:12px 24px 12px 0}.woocommerce-layout__activity-panel-content .woocommerce-abbreviated-notifications .woocommerce-abbreviated-notification .woocommerce-abbreviated-card__content>:not(:first-child){margin-top:4px}.woocommerce-activity-panel .woocommerce-activity-card{position:relative;padding:24px;padding:var(--main-gap);background:#fff;border-bottom:1px solid #e0e0e0;color:#757575;font-size:13px;font-size:.8125rem}.woocommerce-activity-panel .woocommerce-activity-card:not(.woocommerce-empty-activity-card){display:grid;grid-template-columns:50px 1fr;grid-template-areas:"icon header" "icon body" "icon actions"}.woocommerce-activity-panel .woocommerce-activity-card__button{display:block;height:unset;background:none;align-items:unset;transition:unset;text-align:left;width:100%;padding:0}.woocommerce-activity-card__unread{position:absolute;top:18px;top:calc(var(--main-gap) - 6px);right:18px;right:calc(var(--main-gap) - 6px);width:6px;height:6px;border-radius:50%;background:#ca4a1f}.woocommerce-activity-card__icon{-ms-grid-row:1;-ms-grid-row-span:3;-ms-grid-column:1;grid-area:icon;fill:#e0e0e0}.woocommerce-activity-card__header{margin-bottom:16px;display:flex;flex-direction:column}.woocommerce-activity-card__header .woocommerce-activity-card__title{margin:0;font-size:14px;font-size:.875rem;order:2}.woocommerce-empty-activity-card .woocommerce-activity-card__header .woocommerce-activity-card__title{color:#1e1e1e;font-style:normal;line-height:24px;font-weight:400}.woocommerce-activity-card__button .woocommerce-activity-card__header .woocommerce-activity-card__title{margin-bottom:8px}.woocommerce-activity-card__header .woocommerce-activity-card__title a{text-decoration:none}.woocommerce-activity-card__header .woocommerce-activity-card__date{color:#757575;font-size:12px;font-size:.75rem;margin-bottom:12px;order:1}.woocommerce-activity-card__header .woocommerce-activity-card__subtitle{order:3}.woocommerce-activity-card__button .woocommerce-activity-card__header .woocommerce-activity-card__subtitle{margin-bottom:4px}@media(min-width:783px){.woocommerce-activity-card__header{-ms-grid-row:1;-ms-grid-column:2;grid-area:header;display:grid;grid-template:"title date" "subtitle date"/1fr auto}.woocommerce-activity-panel .woocommerce-activity-card.woocommerce-order-activity-card>.woocommerce-activity-card__header{-ms-grid-row:1;-ms-grid-column:1}.woocommerce-activity-card__header .woocommerce-activity-card__title{grid-area:title}.woocommerce-activity-card__header .woocommerce-activity-card__date{display:block;grid-area:date;justify-self:end;margin-bottom:0}.woocommerce-activity-card__header .woocommerce-activity-card__subtitle{grid-area:subtitle}}@media (min-width:783px){.woocommerce-activity-card__header .woocommerce-activity-card__title{-ms-grid-row:1;-ms-grid-column:1}.woocommerce-activity-card__header .woocommerce-activity-card__date{-ms-grid-row:1;-ms-grid-row-span:2;-ms-grid-column:2}.woocommerce-activity-card__header .woocommerce-activity-card__subtitle{-ms-grid-row:2;-ms-grid-column:1}}.woocommerce-activity-card__body{-ms-grid-row:2;-ms-grid-column:2;grid-area:body}.woocommerce-activity-panel .woocommerce-activity-card.woocommerce-order-activity-card>.woocommerce-activity-card__body{-ms-grid-row:2;-ms-grid-column:1}.woocommerce-activity-card__body>p:first-child{margin-top:0}.woocommerce-activity-card__body>p:last-child{margin-bottom:0}.woocommerce-empty-activity-card .woocommerce-activity-card__body{color:#757575;font-style:normal;font-weight:400;font-size:13px;font-size:.8125rem;line-height:20px}.woocommerce-activity-card__actions{-ms-grid-row:3;-ms-grid-column:2;grid-area:actions;margin-top:16px}.woocommerce-activity-panel .woocommerce-activity-card.woocommerce-order-activity-card>.woocommerce-activity-card__actions{-ms-grid-row:3;-ms-grid-column:1}.woocommerce-activity-card__actions>*+*{margin-left:.5em}.woocommerce-activity-card__actions .components-button{height:24px;padding:4px 10px;font-size:11px;font-size:.6875rem}.woocommerce-activity-card__actions .components-button.is-destructive:not(:hover){box-shadow:none}.woocommerce-activity-card.is-loading .is-placeholder{animation:loading-fade 1.6s ease-in-out infinite;background-color:#f0f0f0;color:transparent;display:inline-block;height:16px}.woocommerce-activity-card.is-loading .is-placeholder:after{content:" "}@media screen and (prefers-reduced-motion:reduce){.woocommerce-activity-card.is-loading .is-placeholder{animation:none}}.woocommerce-activity-card.is-loading .woocommerce-activity-card__title{width:80%}.woocommerce-activity-card.is-loading .woocommerce-activity-card__subtitle{margin-top:4px}.woocommerce-activity-card.is-loading .woocommerce-activity-card__date{width:100%;margin-bottom:16px}@media(min-width:783px){.woocommerce-activity-card.is-loading .woocommerce-activity-card__date{text-align:right;margin-bottom:0}}.woocommerce-activity-card.is-loading .woocommerce-activity-card__date .is-placeholder{width:68px}.woocommerce-activity-card.is-loading .woocommerce-activity-card__icon{margin-right:24px;margin-right:var(--main-gap)}.woocommerce-activity-card.is-loading .woocommerce-activity-card__icon .is-placeholder{height:33px;width:33px}.woocommerce-activity-card.is-loading .woocommerce-activity-card__body .is-placeholder{width:100%;margin-bottom:4px}.woocommerce-activity-card.is-loading .woocommerce-activity-card__body .is-placeholder:last-of-type{width:65%;margin-bottom:0}.woocommerce-activity-card.is-loading .woocommerce-activity-card__actions .is-placeholder{width:91px;height:24px}.woocommerce-activity-panel .woocommerce-activity-card.woocommerce-order-activity-card{grid-template-columns:1fr;grid-template-areas:"header" "body" "actions"}.woocommerce-activity-panel .woocommerce-activity-card.woocommerce-order-activity-card .woocommerce-activity-card__icon{display:none}.woocommerce-activity-panel .woocommerce-activity-card.woocommerce-order-activity-card .woocommerce-flag{display:inline-block}.woocommerce-activity-panel .woocommerce-activity-card.woocommerce-order-activity-card .woocommerce-activity-card__subtitle span+span:before{content:" • "}.woocommerce-activity-panel .woocommerce-activity-card.woocommerce-inbox-activity-card{grid-template-columns:72px 1fr;height:100%;opacity:1;padding:24px;padding:var(--main-gap)}@media screen and (prefers-reduced-motion:no-preference){.woocommerce-activity-panel .woocommerce-activity-card.woocommerce-inbox-activity-card{transition:opacity .3s,height 0s,padding 0s}}@media(max-width:782px){.woocommerce-activity-panel .woocommerce-activity-card.woocommerce-inbox-activity-card{grid-template-columns:64px 1fr}}.woocommerce-activity-panel .woocommerce-activity-card.woocommerce-inbox-activity-card .woocommerce-activity-card__header{margin-bottom:12px}.woocommerce-activity-panel .woocommerce-activity-card.woocommerce-inbox-activity-card.actioned{height:0;opacity:0;padding:0}@media screen and (prefers-reduced-motion:no-preference){.woocommerce-activity-panel .woocommerce-activity-card.woocommerce-inbox-activity-card.actioned{transition:opacity .3s,height 0s .3s,padding 0s .3s}}.woocommerce-stock-activity-card__image-overlay__product{height:33px;position:relative;width:33px}.woocommerce-stock-activity-card__image-overlay__product.is-placeholder:before{background-color:#757575;border-radius:2px;content:"";position:absolute;left:0;right:0;bottom:0;top:0;opacity:.1}@media screen and (prefers-reduced-motion:no-preference){.woocommerce-stock-activity-card{transition:opacity .3s}}.woocommerce-stock-activity-card.is-dimmed{opacity:.7}.woocommerce-stock-activity-card .woocommerce-stock-activity-card__stock-quantity{background:#f0f0f0;color:#757575;padding:3px 8px;border-radius:3px}.woocommerce-stock-activity-card .woocommerce-stock-activity-card__stock-quantity.out-of-stock{color:#d94f4f}.woocommerce-stock-activity-card .woocommerce-stock-activity-card__edit-quantity{display:inline-flex;width:50px;margin-right:10px}.woocommerce-stock-activity-card .woocommerce-stock-activity-card__edit-quantity input{border-radius:2px;height:30px}.woocommerce-stock-activity-card .woocommerce-stock-activity-card__edit-quantity input[type=number]{-moz-appearance:textfield}.woocommerce-stock-activity-card .woocommerce-stock-activity-card__edit-quantity input[type=number]::-webkit-inner-spin-button,.woocommerce-stock-activity-card .woocommerce-stock-activity-card__edit-quantity input[type=number]::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}.woocommerce-stock-activity-card .woocommerce-activity-card__subtitle{color:#757575;font-size:12px;font-size:.75rem}.woocommerce-empty-activity-card{background:#f0f0f0;margin:20px;border-bottom:unset}:root{--wp-admin-theme-color:#007cba;--wp-admin-theme-color-darker-10:#006ba1;--wp-admin-theme-color-darker-20:#005a87}body.admin-color-light{--wp-admin-theme-color:#0085ba;--wp-admin-theme-color-darker-10:#0073a1;--wp-admin-theme-color-darker-20:#006187}body.admin-color-modern{--wp-admin-theme-color:#3858e9;--wp-admin-theme-color-darker-10:#2145e6;--wp-admin-theme-color-darker-20:#183ad6}body.admin-color-blue{--wp-admin-theme-color:#096484;--wp-admin-theme-color-darker-10:#07526c;--wp-admin-theme-color-darker-20:#064054}body.admin-color-coffee{--wp-admin-theme-color:#46403c;--wp-admin-theme-color-darker-10:#383330;--wp-admin-theme-color-darker-20:#2b2724}body.admin-color-ectoplasm{--wp-admin-theme-color:#523f6d;--wp-admin-theme-color-darker-10:#46365d;--wp-admin-theme-color-darker-20:#3a2c4d}body.admin-color-midnight{--wp-admin-theme-color:#e14d43;--wp-admin-theme-color-darker-10:#dd382d;--wp-admin-theme-color-darker-20:#d02c21}body.admin-color-ocean{--wp-admin-theme-color:#627c83;--wp-admin-theme-color-darker-10:#576e74;--wp-admin-theme-color-darker-20:#4c6066}body.admin-color-sunrise{--wp-admin-theme-color:#dd823b;--wp-admin-theme-color-darker-10:#d97426;--wp-admin-theme-color-darker-20:#c36922}#activity-panel-inbox{margin:0 24px}.woocommerce-layout__inbox-panel-header{padding:24px}.woocommerce-homepage-column .woocommerce-layout__inbox-panel-header{padding:0 24px}.woocommerce-inbox-message-enter{opacity:0;max-height:0;transform:translateX(50%)}.woocommerce-inbox-message-enter-active{transition:opacity .5s,transform .5s,max-height .5s}.woocommerce-inbox-message-enter-active,.woocommerce-inbox-message-exit{opacity:1;max-height:100vh;transform:translateX(0)}.woocommerce-inbox-message-exit-active{opacity:0;max-height:0;transform:translateX(50%);transition:opacity .5s,transform .5s,max-height .5s}woocommerce-admin/dist/chunks/25.style.css000064400000014603151335517650014525 0ustar00:root{--wp-admin-theme-color:#007cba;--wp-admin-theme-color-darker-10:#006ba1;--wp-admin-theme-color-darker-20:#005a87}body.admin-color-light{--wp-admin-theme-color:#0085ba;--wp-admin-theme-color-darker-10:#0073a1;--wp-admin-theme-color-darker-20:#006187}body.admin-color-modern{--wp-admin-theme-color:#3858e9;--wp-admin-theme-color-darker-10:#2145e6;--wp-admin-theme-color-darker-20:#183ad6}body.admin-color-blue{--wp-admin-theme-color:#096484;--wp-admin-theme-color-darker-10:#07526c;--wp-admin-theme-color-darker-20:#064054}body.admin-color-coffee{--wp-admin-theme-color:#46403c;--wp-admin-theme-color-darker-10:#383330;--wp-admin-theme-color-darker-20:#2b2724}body.admin-color-ectoplasm{--wp-admin-theme-color:#523f6d;--wp-admin-theme-color-darker-10:#46365d;--wp-admin-theme-color-darker-20:#3a2c4d}body.admin-color-midnight{--wp-admin-theme-color:#e14d43;--wp-admin-theme-color-darker-10:#dd382d;--wp-admin-theme-color-darker-20:#d02c21}body.admin-color-ocean{--wp-admin-theme-color:#627c83;--wp-admin-theme-color-darker-10:#576e74;--wp-admin-theme-color-darker-20:#4c6066}body.admin-color-sunrise{--wp-admin-theme-color:#dd823b;--wp-admin-theme-color-darker-10:#d97426;--wp-admin-theme-color-darker-20:#c36922}#klarna-kp-banner,.woocommerce-page:not(.woocommerce-embed-page) #klarna-banner{display:none}.woocommerce-dashboard__columns{display:grid;grid-template-columns:calc(50% - 12px) calc(50% - 12px);grid-column-gap:24px}.woocommerce-dashboard__columns>div:first-child{grid-column-start:1;grid-column-end:2;grid-row-start:1;grid-row-end:2}.woocommerce-dashboard__columns>div:nth-child(2){grid-column-start:2;grid-column-end:3;grid-row-start:1;grid-row-end:2}.woocommerce-dashboard__columns>div:nth-child(3){grid-column-start:1;grid-column-end:2;grid-row-start:2;grid-row-end:3}.woocommerce-dashboard__columns>div:nth-child(4){grid-column-start:2;grid-column-end:3;grid-row-start:2;grid-row-end:3}.woocommerce-dashboard__columns>div:nth-child(5){grid-column-start:1;grid-column-end:2;grid-row-start:3;grid-row-end:4}.woocommerce-dashboard__columns>div:nth-child(6){grid-column-start:2;grid-column-end:3;grid-row-start:3;grid-row-end:4}.woocommerce-dashboard__columns>div:nth-child(7){grid-column-start:1;grid-column-end:2;grid-row-start:4;grid-row-end:5}.woocommerce-dashboard__columns>div:nth-child(8){grid-column-start:2;grid-column-end:3;grid-row-start:4;grid-row-end:5}.woocommerce-dashboard__columns>div:nth-child(9){grid-column-start:1;grid-column-end:2;grid-row-start:5;grid-row-end:6}.woocommerce-dashboard__columns>div:nth-child(10){grid-column-start:2;grid-column-end:3;grid-row-start:5;grid-row-end:6}.woocommerce-dashboard__columns>div:nth-child(11){grid-column-start:1;grid-column-end:2;grid-row-start:6;grid-row-end:7}.woocommerce-dashboard__columns>div:nth-child(12){grid-column-start:2;grid-column-end:3;grid-row-start:6;grid-row-end:7}.woocommerce-dashboard__columns>div:nth-child(13){grid-column-start:1;grid-column-end:2;grid-row-start:7;grid-row-end:8}.woocommerce-dashboard__columns>div:nth-child(14){grid-column-start:2;grid-column-end:3;grid-row-start:7;grid-row-end:8}@media(max-width:960px){.woocommerce-dashboard__columns{grid-template-columns:100%}.woocommerce-dashboard__columns>div:first-child{grid-column-start:1;grid-column-end:2;grid-row-start:1;grid-row-end:2}.woocommerce-dashboard__columns>div:nth-child(2){grid-column-start:1;grid-column-end:2;grid-row-start:2;grid-row-end:3}.woocommerce-dashboard__columns>div:nth-child(3){grid-column-start:1;grid-column-end:2;grid-row-start:3;grid-row-end:4}.woocommerce-dashboard__columns>div:nth-child(4){grid-column-start:1;grid-column-end:2;grid-row-start:4;grid-row-end:5}.woocommerce-dashboard__columns>div:nth-child(5){grid-column-start:1;grid-column-end:2;grid-row-start:5;grid-row-end:6}.woocommerce-dashboard__columns>div:nth-child(6){grid-column-start:1;grid-column-end:2;grid-row-start:6;grid-row-end:7}.woocommerce-dashboard__columns>div:nth-child(7){grid-column-start:1;grid-column-end:2;grid-row-start:7;grid-row-end:8}.woocommerce-dashboard__columns>div:nth-child(8){grid-column-start:1;grid-column-end:2;grid-row-start:8;grid-row-end:9}.woocommerce-dashboard__columns>div:nth-child(9){grid-column-start:1;grid-column-end:2;grid-row-start:9;grid-row-end:10}.woocommerce-dashboard__columns>div:nth-child(10){grid-column-start:1;grid-column-end:2;grid-row-start:10;grid-row-end:11}.woocommerce-dashboard__columns>div:nth-child(11){grid-column-start:1;grid-column-end:2;grid-row-start:11;grid-row-end:12}.woocommerce-dashboard__columns>div:nth-child(12){grid-column-start:1;grid-column-end:2;grid-row-start:12;grid-row-end:13}.woocommerce-dashboard__columns>div:nth-child(13){grid-column-start:1;grid-column-end:2;grid-row-start:13;grid-row-end:14}.woocommerce-dashboard__columns>div:nth-child(14){grid-column-start:1;grid-column-end:2;grid-row-start:14;grid-row-end:15}}.woocommerce-dashboard__widget{display:flex;align-items:center;text-align:center}.woocommerce-dashboard__widget-item{flex:1}.woocommerce-dashboard-section__add-more{margin:0 auto;width:84px;padding:0 24px 24px}.woocommerce-dashboard-section__add-more .components-popover__content{padding:0 16px 8px}.woocommerce-dashboard-section__add-more>button svg{fill:#757575}.woocommerce-dashboard-section__add-more-choices{display:flex;justify-content:center}.woocommerce-dashboard-section__add-more-btn{display:flex;flex-direction:column;align-items:center;padding:16px;margin:8px}.woocommerce-dashboard-section__add-more-btn.components-button{height:auto}.woocommerce-dashboard-section__add-more-btn .store-performance__icon{transform:rotate(-45deg)}.woocommerce-dashboard-section__add-more-btn-title{color:#757575;padding-top:8px}.woocommerce-dashboard-section-controls{border-top:1px solid #f0f0f0;padding-top:8px}.woocommerce-dashboard-section-controls .icon-control{margin:0 8px 0 0;vertical-align:bottom;fill:#757575}.woocommerce-dashboard-section-controls .woocommerce-ellipsis-menu__item{padding-bottom:10px}.components-card .woocommerce-ellipsis-menu__toggle{padding:0}.woocommerce-task-dashboard__body .woocommerce-task-dashboard__container .woocommerce-task-card{max-width:680px;margin-left:auto;margin-right:auto;margin-bottom:24px}.woocommerce-task-dashboard__body .woocommerce-task-dashboard__container .woocommerce-task-card .components-card__header.is-size-large{padding-bottom:12px}.woocommerce-task-dashboard__body .woocommerce-task-dashboard__container .woocommerce-task-card .components-card__header.is-size-large .woocommerce-card__menu{margin-top:8px}woocommerce-admin/dist/chunks/6.style.css000064400000002714151335517650014444 0ustar00:root{--wp-admin-theme-color:#007cba;--wp-admin-theme-color-darker-10:#006ba1;--wp-admin-theme-color-darker-20:#005a87}body.admin-color-light{--wp-admin-theme-color:#0085ba;--wp-admin-theme-color-darker-10:#0073a1;--wp-admin-theme-color-darker-20:#006187}body.admin-color-modern{--wp-admin-theme-color:#3858e9;--wp-admin-theme-color-darker-10:#2145e6;--wp-admin-theme-color-darker-20:#183ad6}body.admin-color-blue{--wp-admin-theme-color:#096484;--wp-admin-theme-color-darker-10:#07526c;--wp-admin-theme-color-darker-20:#064054}body.admin-color-coffee{--wp-admin-theme-color:#46403c;--wp-admin-theme-color-darker-10:#383330;--wp-admin-theme-color-darker-20:#2b2724}body.admin-color-ectoplasm{--wp-admin-theme-color:#523f6d;--wp-admin-theme-color-darker-10:#46365d;--wp-admin-theme-color-darker-20:#3a2c4d}body.admin-color-midnight{--wp-admin-theme-color:#e14d43;--wp-admin-theme-color-darker-10:#dd382d;--wp-admin-theme-color-darker-20:#d02c21}body.admin-color-ocean{--wp-admin-theme-color:#627c83;--wp-admin-theme-color-darker-10:#576e74;--wp-admin-theme-color-darker-20:#4c6066}body.admin-color-sunrise{--wp-admin-theme-color:#dd823b;--wp-admin-theme-color-darker-10:#d97426;--wp-admin-theme-color-darker-20:#c36922}.woocommerce-analytics__table-placeholder .woocommerce-card__body{padding:0}.woocommerce-analytics__table-placeholder .woocommerce-table__table{margin-bottom:0}.woocommerce-analytics__table-placeholder .woocommerce-table__table tr:last-child{border-bottom-style:none}woocommerce-admin/dist/chunks/dashboard-charts.js000064400000103735151335517650016202 0ustar00(window.__wcAdmin_webpackJsonp=window.__wcAdmin_webpackJsonp||[]).push([[26],{165:function(e,t,r){"use strict";var o=Object.assign||function(e){for(var t,r=1;r<arguments.length;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e};Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t=e.size,r=void 0===t?24:t,a=e.onClick,c=(e.icon,e.className),l=function(e,t){var r={};for(var o in e)0<=t.indexOf(o)||Object.prototype.hasOwnProperty.call(e,o)&&(r[o]=e[o]);return r}(e,["size","onClick","icon","className"]),i=["gridicon","gridicons-line-graph",c,!1,!1,!1].filter(Boolean).join(" ");return n.default.createElement("svg",o({className:i,height:r,width:r,onClick:a},l,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"}),n.default.createElement("g",null,n.default.createElement("path",{d:"M3 19h18v2H3zm3-3c1.1 0 2-.9 2-2 0-.5-.2-1-.5-1.3L8.8 10H9c.5 0 1-.2 1.3-.5l2.7 1.4v.1c0 1.1.9 2 2 2s2-.9 2-2c0-.5-.2-.9-.5-1.3L17.8 7h.2c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2c0 .5.2 1 .5 1.3L15.2 9H15c-.5 0-1 .2-1.3.5L11 8.2V8c0-1.1-.9-2-2-2s-2 .9-2 2c0 .5.2 1 .5 1.3L6.2 12H6c-1.1 0-2 .9-2 2s.9 2 2 2z"})))};var a,c=r(5),n=(a=c)&&a.__esModule?a:{default:a};e.exports=t.default},166:function(e,t,r){"use strict";var o=Object.assign||function(e){for(var t,r=1;r<arguments.length;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e};Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,r=e.size,a=void 0===r?24:r,c=e.onClick,l=(e.icon,e.className),i=function(e,t){var r={};for(var o in e)0<=t.indexOf(o)||Object.prototype.hasOwnProperty.call(e,o)&&(r[o]=e[o]);return r}(e,["size","onClick","icon","className"]),s=["gridicon","gridicons-stats-alt",l,!1,!1,(t=a,!(0!=t%18)&&"needs-offset-y")].filter(Boolean).join(" ");return n.default.createElement("svg",o({className:s,height:a,width:a,onClick:c},i,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"}),n.default.createElement("g",null,n.default.createElement("path",{d:"M21 21H3v-2h18v2zM8 10H4v7h4v-7zm6-7h-4v14h4V3zm6 3h-4v11h4V6z"})))};var a,c=r(5),n=(a=c)&&a.__esModule?a:{default:a};e.exports=t.default},38:function(e,t){e.exports=function(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e},e.exports.default=e.exports,e.exports.__esModule=!0},502:function(e,t,r){"use strict";r.d(t,"e",(function(){return d})),r.d(t,"a",(function(){return u})),r.d(t,"b",(function(){return _})),r.d(t,"c",(function(){return p})),r.d(t,"d",(function(){return b})),r.d(t,"f",(function(){return h})),r.d(t,"h",(function(){return O})),r.d(t,"g",(function(){return j}));var o=r(15),a=r(17),c=r.n(a),n=r(4),l=r(12),i=r(11),s=r(13),m=r(503);function d(e,t=n.identity){return function(r="",a){const n="function"==typeof e?e(a):e,i=Object(l.getIdsFromQuery)(r);if(i.length<1)return Promise.resolve([]);const s={include:i.join(","),per_page:i.length};return c()({path:Object(o.addQueryArgs)(n,s)}).then(e=>e.map(t))}}d(i.NAMESPACE+"/products/attributes",e=>({key:e.id,label:e.name}));const u=d(i.NAMESPACE+"/products/categories",e=>({key:e.id,label:e.name})),_=d(i.NAMESPACE+"/coupons",e=>({key:e.id,label:e.code})),p=d(i.NAMESPACE+"/customers",e=>({key:e.id,label:e.name})),b=d(i.NAMESPACE+"/products",e=>({key:e.id,label:e.name})),h=d(i.NAMESPACE+"/taxes",e=>({key:e.id,label:Object(m.a)(e)}));function O({attributes:e,name:t}){const r=Object(s.f)("variationTitleAttributesSeparator"," - ");if(t&&t.indexOf(r)>-1)return t;const o=(e||[]).map(({option:e})=>e).join(", ");return o?t+r+o:t}const j=d(({products:e})=>e?i.NAMESPACE+`/products/${e}/variations`:i.NAMESPACE+"/variations",e=>({key:e.id,label:O(e)}))},503:function(e,t,r){"use strict";r.d(t,"a",(function(){return a}));var o=r(2);function a(e){return[e.country,e.state,e.name||Object(o.__)("TAX",'woocommerce'),e.priority].map(e=>e.toString().toUpperCase().trim()).filter(Boolean).join("-")}},504:function(e,t,r){"use strict";var o=r(0),a=r(2),c=r(1),n=r.n(c),l=r(21);function i({className:e}){const t=Object(a.__)("There was an error getting your stats. Please try again.",'woocommerce'),r=Object(a.__)("Reload",'woocommerce');return Object(o.createElement)(l.EmptyContent,{className:e,title:t,actionLabel:r,actionCallback:()=>{window.location.reload()}})}i.propTypes={className:n.a.string},t.a=i},508:function(e,t,r){"use strict";var o=r(0),a=r(2),c=r(14),n=r(59),l=r(7),i=r(4),s=r(1),m=r.n(s),d=r(21),u=r(11),_=r(19),p=r(501),b=r(504),h=r(12);class O extends o.Component{shouldComponentUpdate(e){return e.isRequesting!==this.props.isRequesting||e.primaryData.isRequesting!==this.props.primaryData.isRequesting||e.secondaryData.isRequesting!==this.props.secondaryData.isRequesting||!Object(i.isEqual)(e.query,this.props.query)}getItemChartData(){const{primaryData:e,selectedChart:t}=this.props;return e.data.intervals.map((function(e){const r={};return e.subtotals.segments.forEach((function(e){if(e.segment_label){const o=r[e.segment_label]?e.segment_label+" (#"+e.segment_id+")":e.segment_label;r[e.segment_id]={label:o,value:e.subtotals[t.key]||0}}})),{date:Object(n.format)("Y-m-d\\TH:i:s",e.date_start),...r}}))}getTimeChartData(){const{query:e,primaryData:t,secondaryData:r,selectedChart:o,defaultDateRange:a}=this.props,c=Object(_.getIntervalForQuery)(e),{primary:l,secondary:i}=Object(_.getCurrentDates)(e,a);return t.data.intervals.map((function(t,a){const s=Object(_.getPreviousDate)(t.date_start,l.after,i.after,e.compare,c),m=r.data.intervals[a];return{date:Object(n.format)("Y-m-d\\TH:i:s",t.date_start),primary:{label:`${l.label} (${l.range})`,labelDate:t.date_start,value:t.subtotals[o.key]||0},secondary:{label:`${i.label} (${i.range})`,labelDate:s.format("YYYY-MM-DD HH:mm:ss"),value:m&&m.subtotals[o.key]||0}}}))}getTimeChartTotals(){const{primaryData:e,secondaryData:t,selectedChart:r}=this.props;return{primary:Object(i.get)(e,["data","totals",r.key],null),secondary:Object(i.get)(t,["data","totals",r.key],null)}}renderChart(e,t,r,c){const{emptySearchResults:n,filterParam:l,interactiveLegend:i,itemsLabel:s,legendPosition:m,path:p,query:b,selectedChart:h,showHeaderControls:O,primaryData:j}=this.props,w=Object(_.getIntervalForQuery)(b),y=Object(_.getAllowedIntervalsForQuery)(b),f=Object(_.getDateFormatsForInterval)(w,j.data.intervals.length),v=n?Object(a.__)("No data for the current search",'woocommerce'):Object(a.__)("No data for the selected date range",'woocommerce'),{formatAmount:g,getCurrencyConfig:x}=this.context;return Object(o.createElement)(d.Chart,{allowedIntervals:y,data:r,dateParser:"%Y-%m-%dT%H:%M:%S",emptyMessage:v,filterParam:l,interactiveLegend:i,interval:w,isRequesting:t,itemsLabel:s,legendPosition:m,legendTotals:c,mode:e,path:p,query:b,screenReaderFormat:f.screenReaderFormat,showHeaderControls:O,title:h.label,tooltipLabelFormat:f.tooltipLabelFormat,tooltipTitle:"time-comparison"===e&&h.label||null,tooltipValueFormat:Object(u.getTooltipValueFormat)(h.type,g),chartType:Object(_.getChartTypeForQuery)(b),valueType:h.type,xFormat:f.xFormat,x2Format:f.x2Format,currency:x()})}renderItemComparison(){const{isRequesting:e,primaryData:t}=this.props;if(t.isError)return Object(o.createElement)(b.a,null);const r=e||t.isRequesting,a=this.getItemChartData();return this.renderChart("item-comparison",r,a)}renderTimeComparison(){const{isRequesting:e,primaryData:t,secondaryData:r}=this.props;if(!t||t.isError||r.isError)return Object(o.createElement)(b.a,null);const a=e||t.isRequesting||r.isRequesting,c=this.getTimeChartData(),n=this.getTimeChartTotals();return this.renderChart("time-comparison",a,c,n)}render(){const{mode:e}=this.props;return"item-comparison"===e?this.renderItemComparison():this.renderTimeComparison()}}O.contextType=p.a,O.propTypes={filters:m.a.array,isRequesting:m.a.bool,itemsLabel:m.a.string,limitProperties:m.a.array,mode:m.a.string,path:m.a.string.isRequired,primaryData:m.a.object,query:m.a.object.isRequired,secondaryData:m.a.object,selectedChart:m.a.shape({key:m.a.string.isRequired,label:m.a.string.isRequired,order:m.a.oneOf(["asc","desc"]),orderby:m.a.string,type:m.a.oneOf(["average","number","currency"]).isRequired}).isRequired},O.defaultProps={isRequesting:!1,primaryData:{data:{intervals:[]},isError:!1,isRequesting:!1},secondaryData:{data:{intervals:[]},isError:!1,isRequesting:!1}};t.a=Object(c.compose)(Object(l.withSelect)((e,t)=>{const{charts:r,endpoint:o,filters:a,isRequesting:c,limitProperties:n,query:l,advancedFilters:s}=t,m=n||[o],d=function e(t,r,o={}){if(!t||0===t.length)return null;const a=t.slice(0),c=a.pop();if(c.showFilters(r,o)){const e=Object(h.flattenFilters)(c.filters),t=r[c.param]||c.defaultValue||"all";return Object(i.find)(e,{value:t})}return e(a,r,o)}(a,l),_=Object(i.get)(d,["settings","param"]),p=t.mode||function(e,t){if(e&&t){const r=Object(i.get)(e,["settings","param"]);if(!r||Object.keys(t).includes(r))return Object(i.get)(e,["chartMode"])}return null}(d,l)||"time-comparison",{woocommerce_default_date_range:b}=e(u.SETTINGS_STORE_NAME).getSetting("wc_admin","wcAdminSettings"),O=e(u.REPORTS_STORE_NAME),j={mode:p,filterParam:_,defaultDateRange:b};if(c)return j;const w=m.some(e=>l[e]&&l[e].length);if(l.search&&!w)return{...j,emptySearchResults:!0};const y=r&&r.map(e=>e.key),f=Object(u.getReportChartData)({endpoint:o,dataType:"primary",query:l,selector:O,limitBy:m,filters:a,advancedFilters:s,defaultDateRange:b,fields:y});if("item-comparison"===p)return{...j,primaryData:f};const v=Object(u.getReportChartData)({endpoint:o,dataType:"secondary",query:l,selector:O,limitBy:m,filters:a,advancedFilters:s,defaultDateRange:b,fields:y});return{...j,primaryData:f,secondaryData:v}}))(O)},528:function(e,t,r){"use strict";r.d(t,"b",(function(){return c})),r.d(t,"a",(function(){return n})),r.d(t,"c",(function(){return i}));var o=r(2),a=r(30);const c=Object(a.applyFilters)("woocommerce_admin_revenue_report_charts",[{key:"gross_sales",label:Object(o.__)("Gross sales",'woocommerce'),order:"desc",orderby:"gross_sales",type:"currency",isReverseTrend:!1},{key:"refunds",label:Object(o.__)("Returns",'woocommerce'),order:"desc",orderby:"refunds",type:"currency",isReverseTrend:!0},{key:"coupons",label:Object(o.__)("Coupons",'woocommerce'),order:"desc",orderby:"coupons",type:"currency",isReverseTrend:!1},{key:"net_revenue",label:Object(o.__)("Net sales",'woocommerce'),orderby:"net_revenue",type:"currency",isReverseTrend:!1},{key:"taxes",label:Object(o.__)("Taxes",'woocommerce'),order:"desc",orderby:"taxes",type:"currency",isReverseTrend:!1},{key:"shipping",label:Object(o.__)("Shipping",'woocommerce'),orderby:"shipping",type:"currency",isReverseTrend:!1},{key:"total_sales",label:Object(o.__)("Total sales",'woocommerce'),order:"desc",orderby:"total_sales",type:"currency",isReverseTrend:!1}]),n=Object(a.applyFilters)("woocommerce_admin_revenue_report_advanced_filters",{filters:{},title:Object(o._x)("Revenue Matches {{select /}} Filters","A sentence describing filters for Revenue. See screen shot for context: https://cloudup.com/cSsUY9VeCVJ",'woocommerce')}),l=[];Object.keys(n.filters).length&&(l.push({label:Object(o.__)("All Revenue",'woocommerce'),value:"all"}),l.push({label:Object(o.__)("Advanced Filters",'woocommerce'),value:"advanced"}));const i=Object(a.applyFilters)("woocommerce_admin_revenue_report_filters",[{label:Object(o.__)("Show",'woocommerce'),staticParams:["chartType","paged","per_page"],param:"filter",showFilters:()=>l.length>0,filters:l}])},529:function(e,t,r){"use strict";r.d(t,"b",(function(){return s})),r.d(t,"a",(function(){return u})),r.d(t,"c",(function(){return _}));var o=r(2),a=r(30),c=r(7),n=r(502),l=r(55);const{addCesSurveyForAnalytics:i}=Object(c.dispatch)(l.c),s=Object(a.applyFilters)("woocommerce_admin_products_report_charts",[{key:"items_sold",label:Object(o.__)("Items sold",'woocommerce'),order:"desc",orderby:"items_sold",type:"number"},{key:"net_revenue",label:Object(o.__)("Net sales",'woocommerce'),order:"desc",orderby:"net_revenue",type:"currency"},{key:"orders_count",label:Object(o.__)("Orders",'woocommerce'),order:"desc",orderby:"orders_count",type:"number"}]),m={label:Object(o.__)("Show",'woocommerce'),staticParams:["chartType","paged","per_page"],param:"filter",showFilters:()=>!0,filters:[{label:Object(o.__)("All products",'woocommerce'),value:"all"},{label:Object(o.__)("Single product",'woocommerce'),value:"select_product",chartMode:"item-comparison",subFilters:[{component:"Search",value:"single_product",chartMode:"item-comparison",path:["select_product"],settings:{type:"products",param:"products",getLabels:n.d,labels:{placeholder:Object(o.__)("Type to search for a product",'woocommerce'),button:Object(o.__)("Single product",'woocommerce')}}}]},{label:Object(o.__)("Comparison",'woocommerce'),value:"compare-products",chartMode:"item-comparison",settings:{type:"products",param:"products",getLabels:n.d,labels:{helpText:Object(o.__)("Check at least two products below to compare",'woocommerce'),placeholder:Object(o.__)("Search for products to compare",'woocommerce'),title:Object(o.__)("Compare Products",'woocommerce'),update:Object(o.__)("Compare",'woocommerce')},onClick:i}}]},d={showFilters:e=>"single_product"===e.filter&&!!e.products&&e["is-variable"],staticParams:["filter","products","chartType","paged","per_page"],param:"filter-variations",filters:[{label:Object(o.__)("All variations",'woocommerce'),chartMode:"item-comparison",value:"all"},{label:Object(o.__)("Single variation",'woocommerce'),value:"select_variation",subFilters:[{component:"Search",value:"single_variation",path:["select_variation"],settings:{type:"variations",param:"variations",getLabels:n.g,labels:{placeholder:Object(o.__)("Type to search for a variation",'woocommerce'),button:Object(o.__)("Single variation",'woocommerce')}}}]},{label:Object(o.__)("Comparison",'woocommerce'),chartMode:"item-comparison",value:"compare-variations",settings:{type:"variations",param:"variations",getLabels:n.g,labels:{helpText:Object(o.__)("Check at least two variations below to compare",'woocommerce'),placeholder:Object(o.__)("Search for variations to compare",'woocommerce'),title:Object(o.__)("Compare Variations",'woocommerce'),update:Object(o.__)("Compare",'woocommerce')}}}]},u=Object(a.applyFilters)("woocommerce_admin_products_report_advanced_filters",{filters:{},title:Object(o._x)("Products Match {{select /}} Filters","A sentence describing filters for Products. See screen shot for context: https://cloudup.com/cSsUY9VeCVJ",'woocommerce')});Object.keys(u.filters).length&&(m.filters.push({label:Object(o.__)("Advanced Filters",'woocommerce'),value:"advanced"}),d.filters.push({label:Object(o.__)("Advanced Filters",'woocommerce'),value:"advanced"}));const _=Object(a.applyFilters)("woocommerce_admin_products_report_filters",[m,d])},533:function(e,t,r){"use strict";r.d(t,"b",(function(){return l})),r.d(t,"c",(function(){return i})),r.d(t,"a",(function(){return s}));var o=r(2),a=r(30),c=r(13),n=r(502);const l=Object(a.applyFilters)("woocommerce_admin_orders_report_charts",[{key:"orders_count",label:Object(o.__)("Orders",'woocommerce'),type:"number"},{key:"net_revenue",label:Object(o.__)("Net sales",'woocommerce'),order:"desc",orderby:"net_total",type:"currency"},{key:"avg_order_value",label:Object(o.__)("Average order value",'woocommerce'),type:"currency"},{key:"avg_items_per_order",label:Object(o.__)("Average items per order",'woocommerce'),order:"desc",orderby:"num_items_sold",type:"average"}]),i=Object(a.applyFilters)("woocommerce_admin_orders_report_filters",[{label:Object(o.__)("Show",'woocommerce'),staticParams:["chartType","paged","per_page"],param:"filter",showFilters:()=>!0,filters:[{label:Object(o.__)("All orders",'woocommerce'),value:"all"},{label:Object(o.__)("Advanced filters",'woocommerce'),value:"advanced"}]}]),s=Object(a.applyFilters)("woocommerce_admin_orders_report_advanced_filters",{title:Object(o._x)("Orders match {{select /}} filters","A sentence describing filters for Orders. See screen shot for context: https://cloudup.com/cSsUY9VeCVJ",'woocommerce'),filters:{status:{labels:{add:Object(o.__)("Order Status",'woocommerce'),remove:Object(o.__)("Remove order status filter",'woocommerce'),rule:Object(o.__)("Select an order status filter match",'woocommerce'),title:Object(o.__)("{{title}}Order Status{{/title}} {{rule /}} {{filter /}}",'woocommerce'),filter:Object(o.__)("Select an order status",'woocommerce')},rules:[{value:"is",label:Object(o._x)("Is","order status",'woocommerce')},{value:"is_not",label:Object(o._x)("Is Not","order status",'woocommerce')}],input:{component:"SelectControl",options:Object.keys(c.c).map(e=>({value:e,label:c.c[e]}))}},product:{labels:{add:Object(o.__)("Products",'woocommerce'),placeholder:Object(o.__)("Search products",'woocommerce'),remove:Object(o.__)("Remove products filter",'woocommerce'),rule:Object(o.__)("Select a product filter match",'woocommerce'),title:Object(o.__)("{{title}}Product{{/title}} {{rule /}} {{filter /}}",'woocommerce'),filter:Object(o.__)("Select products",'woocommerce')},rules:[{value:"includes",label:Object(o._x)("Includes","products",'woocommerce')},{value:"excludes",label:Object(o._x)("Excludes","products",'woocommerce')}],input:{component:"Search",type:"products",getLabels:n.d}},variation:{labels:{add:Object(o.__)("Variations",'woocommerce'),placeholder:Object(o.__)("Search variations",'woocommerce'),remove:Object(o.__)("Remove variations filter",'woocommerce'),rule:Object(o.__)("Select a variation filter match",'woocommerce'),title:Object(o.__)("{{title}}Variation{{/title}} {{rule /}} {{filter /}}",'woocommerce'),filter:Object(o.__)("Select variation",'woocommerce')},rules:[{value:"includes",label:Object(o._x)("Includes","variations",'woocommerce')},{value:"excludes",label:Object(o._x)("Excludes","variations",'woocommerce')}],input:{component:"Search",type:"variations",getLabels:n.g}},coupon:{labels:{add:Object(o.__)("Coupon Codes",'woocommerce'),placeholder:Object(o.__)("Search coupons",'woocommerce'),remove:Object(o.__)("Remove coupon filter",'woocommerce'),rule:Object(o.__)("Select a coupon filter match",'woocommerce'),title:Object(o.__)("{{title}}Coupon code{{/title}} {{rule /}} {{filter /}}",'woocommerce'),filter:Object(o.__)("Select coupon codes",'woocommerce')},rules:[{value:"includes",label:Object(o._x)("Includes","coupon code",'woocommerce')},{value:"excludes",label:Object(o._x)("Excludes","coupon code",'woocommerce')}],input:{component:"Search",type:"coupons",getLabels:n.b}},customer_type:{labels:{add:Object(o.__)("Customer type",'woocommerce'),remove:Object(o.__)("Remove customer filter",'woocommerce'),rule:Object(o.__)("Select a customer filter match",'woocommerce'),title:Object(o.__)("{{title}}Customer is{{/title}} {{filter /}}",'woocommerce'),filter:Object(o.__)("Select a customer type",'woocommerce')},input:{component:"SelectControl",options:[{value:"new",label:Object(o.__)("New",'woocommerce')},{value:"returning",label:Object(o.__)("Returning",'woocommerce')}],defaultOption:"new"}},refunds:{labels:{add:Object(o.__)("Refunds",'woocommerce'),remove:Object(o.__)("Remove refunds filter",'woocommerce'),rule:Object(o.__)("Select a refund filter match",'woocommerce'),title:Object(o.__)("{{title}}Refunds{{/title}} {{filter /}}",'woocommerce'),filter:Object(o.__)("Select a refund type",'woocommerce')},input:{component:"SelectControl",options:[{value:"all",label:Object(o.__)("All",'woocommerce')},{value:"partial",label:Object(o.__)("Partially refunded",'woocommerce')},{value:"full",label:Object(o.__)("Fully refunded",'woocommerce')},{value:"none",label:Object(o.__)("None",'woocommerce')}],defaultOption:"all"}},tax_rate:{labels:{add:Object(o.__)("Tax Rates",'woocommerce'),placeholder:Object(o.__)("Search tax rates",'woocommerce'),remove:Object(o.__)("Remove tax rate filter",'woocommerce'),rule:Object(o.__)("Select a tax rate filter match",'woocommerce'),title:Object(o.__)("{{title}}Tax Rate{{/title}} {{rule /}} {{filter /}}",'woocommerce'),filter:Object(o.__)("Select tax rates",'woocommerce')},rules:[{value:"includes",label:Object(o._x)("Includes","tax rate",'woocommerce')},{value:"excludes",label:Object(o._x)("Excludes","tax rate",'woocommerce')}],input:{component:"Search",type:"taxes",getLabels:n.f}},attribute:{allowMultiple:!0,labels:{add:Object(o.__)("Attribute",'woocommerce'),placeholder:Object(o.__)("Search attributes",'woocommerce'),remove:Object(o.__)("Remove attribute filter",'woocommerce'),rule:Object(o.__)("Select a product attribute filter match",'woocommerce'),title:Object(o.__)("{{title}}Attribute{{/title}} {{rule /}} {{filter /}}",'woocommerce'),filter:Object(o.__)("Select attributes",'woocommerce')},rules:[{value:"is",label:Object(o._x)("Is","product attribute",'woocommerce')},{value:"is_not",label:Object(o._x)("Is Not","product attribute",'woocommerce')}],input:{component:"ProductAttribute"}}}})},534:function(e,t,r){"use strict";r.d(t,"b",(function(){return s})),r.d(t,"a",(function(){return m})),r.d(t,"c",(function(){return u}));var o=r(2),a=r(30),c=r(7),n=r(502),l=r(55);const{addCesSurveyForAnalytics:i}=Object(c.dispatch)(l.c),s=Object(a.applyFilters)("woocommerce_admin_coupons_report_charts",[{key:"orders_count",label:Object(o.__)("Discounted orders",'woocommerce'),order:"desc",orderby:"orders_count",type:"number"},{key:"amount",label:Object(o.__)("Amount",'woocommerce'),order:"desc",orderby:"amount",type:"currency"}]),m=Object(a.applyFilters)("woocommerce_admin_coupon_report_advanced_filters",{filters:{},title:Object(o._x)("Coupons match {{select /}} filters","A sentence describing filters for Coupons. See screen shot for context: https://cloudup.com/cSsUY9VeCVJ",'woocommerce')}),d=[{label:Object(o.__)("All coupons",'woocommerce'),value:"all"},{label:Object(o.__)("Single coupon",'woocommerce'),value:"select_coupon",chartMode:"item-comparison",subFilters:[{component:"Search",value:"single_coupon",chartMode:"item-comparison",path:["select_coupon"],settings:{type:"coupons",param:"coupons",getLabels:n.b,labels:{placeholder:Object(o.__)("Type to search for a coupon",'woocommerce'),button:Object(o.__)("Single Coupon",'woocommerce')}}}]},{label:Object(o.__)("Comparison",'woocommerce'),value:"compare-coupons",settings:{type:"coupons",param:"coupons",getLabels:n.b,labels:{title:Object(o.__)("Compare Coupon Codes",'woocommerce'),update:Object(o.__)("Compare",'woocommerce'),helpText:Object(o.__)("Check at least two coupon codes below to compare",'woocommerce')},onClick:i}}];Object.keys(m.filters).length&&d.push({label:Object(o.__)("Advanced filters",'woocommerce'),value:"advanced"});const u=Object(a.applyFilters)("woocommerce_admin_coupons_report_filters",[{label:Object(o.__)("Show",'woocommerce'),staticParams:["chartType","paged","per_page"],param:"filter",showFilters:()=>!0,filters:d}])},535:function(e,t,r){"use strict";r.d(t,"b",(function(){return d})),r.d(t,"a",(function(){return u})),r.d(t,"c",(function(){return p}));var o=r(2),a=r(30),c=r(11),n=r(7),l=r(502),i=r(503),s=r(55);const{addCesSurveyForAnalytics:m}=Object(n.dispatch)(s.c),d=Object(a.applyFilters)("woocommerce_admin_taxes_report_charts",[{key:"total_tax",label:Object(o.__)("Total tax",'woocommerce'),order:"desc",orderby:"total_tax",type:"currency"},{key:"order_tax",label:Object(o.__)("Order tax",'woocommerce'),order:"desc",orderby:"order_tax",type:"currency"},{key:"shipping_tax",label:Object(o.__)("Shipping tax",'woocommerce'),order:"desc",orderby:"shipping_tax",type:"currency"},{key:"orders_count",label:Object(o.__)("Orders",'woocommerce'),order:"desc",orderby:"orders_count",type:"number"}]),u=Object(a.applyFilters)("woocommerce_admin_taxes_report_advanced_filters",{filters:{},title:Object(o._x)("Taxes match {{select /}} filters","A sentence describing filters for Taxes. See screen shot for context: https://cloudup.com/cSsUY9VeCVJ",'woocommerce')}),_=[{label:Object(o.__)("All taxes",'woocommerce'),value:"all"},{label:Object(o.__)("Comparison",'woocommerce'),value:"compare-taxes",chartMode:"item-comparison",settings:{type:"taxes",param:"taxes",getLabels:Object(l.e)(c.NAMESPACE+"/taxes",e=>({id:e.id,key:e.id,label:Object(i.a)(e)})),labels:{helpText:Object(o.__)("Check at least two tax codes below to compare",'woocommerce'),placeholder:Object(o.__)("Search for tax codes to compare",'woocommerce'),title:Object(o.__)("Compare Tax Codes",'woocommerce'),update:Object(o.__)("Compare",'woocommerce')},onClick:m}}];Object.keys(u.filters).length&&_.push({label:Object(o.__)("Advanced filters",'woocommerce'),value:"advanced"});const p=Object(a.applyFilters)("woocommerce_admin_taxes_report_filters",[{label:Object(o.__)("Show",'woocommerce'),staticParams:["chartType","paged","per_page"],param:"filter",showFilters:()=>!0,filters:_}])},536:function(e,t,r){"use strict";r.d(t,"b",(function(){return n})),r.d(t,"c",(function(){return l})),r.d(t,"a",(function(){return i}));var o=r(2),a=r(30),c=r(502);const n=Object(a.applyFilters)("woocommerce_admin_downloads_report_charts",[{key:"download_count",label:Object(o.__)("Downloads",'woocommerce'),type:"number"}]),l=Object(a.applyFilters)("woocommerce_admin_downloads_report_filters",[{label:Object(o.__)("Show",'woocommerce'),staticParams:["chartType","paged","per_page"],param:"filter",showFilters:()=>!0,filters:[{label:Object(o.__)("All downloads",'woocommerce'),value:"all"},{label:Object(o.__)("Advanced filters",'woocommerce'),value:"advanced"}]}]),i=Object(a.applyFilters)("woocommerce_admin_downloads_report_advanced_filters",{title:Object(o._x)("Downloads match {{select /}} filters","A sentence describing filters for Downloads. See screen shot for context: https://cloudup.com/ccxhyH2mEDg",'woocommerce'),filters:{product:{labels:{add:Object(o.__)("Product",'woocommerce'),placeholder:Object(o.__)("Search",'woocommerce'),remove:Object(o.__)("Remove product filter",'woocommerce'),rule:Object(o.__)("Select a product filter match",'woocommerce'),title:Object(o.__)("{{title}}Product{{/title}} {{rule /}} {{filter /}}",'woocommerce'),filter:Object(o.__)("Select product",'woocommerce')},rules:[{value:"includes",label:Object(o._x)("Includes","products",'woocommerce')},{value:"excludes",label:Object(o._x)("Excludes","products",'woocommerce')}],input:{component:"Search",type:"products",getLabels:c.d}},customer:{labels:{add:Object(o.__)("Username",'woocommerce'),placeholder:Object(o.__)("Search customer username",'woocommerce'),remove:Object(o.__)("Remove customer username filter",'woocommerce'),rule:Object(o.__)("Select a customer username filter match",'woocommerce'),title:Object(o.__)("{{title}}Username{{/title}} {{rule /}} {{filter /}}",'woocommerce'),filter:Object(o.__)("Select customer username",'woocommerce')},rules:[{value:"includes",label:Object(o._x)("Includes","customer usernames",'woocommerce')},{value:"excludes",label:Object(o._x)("Excludes","customer usernames",'woocommerce')}],input:{component:"Search",type:"usernames",getLabels:c.c}},order:{labels:{add:Object(o.__)("Order #",'woocommerce'),placeholder:Object(o.__)("Search order number",'woocommerce'),remove:Object(o.__)("Remove order number filter",'woocommerce'),rule:Object(o.__)("Select a order number filter match",'woocommerce'),title:Object(o.__)("{{title}}Order #{{/title}} {{rule /}} {{filter /}}",'woocommerce'),filter:Object(o.__)("Select order number",'woocommerce')},rules:[{value:"includes",label:Object(o._x)("Includes","order numbers",'woocommerce')},{value:"excludes",label:Object(o._x)("Excludes","order numbers",'woocommerce')}],input:{component:"Search",type:"orders",getLabels:async e=>{const t=e.split(",");return await t.map(e=>({id:e,label:"#"+e}))}}},ip_address:{labels:{add:Object(o.__)("IP Address",'woocommerce'),placeholder:Object(o.__)("Search IP address",'woocommerce'),remove:Object(o.__)("Remove IP address filter",'woocommerce'),rule:Object(o.__)("Select an IP address filter match",'woocommerce'),title:Object(o.__)("{{title}}IP Address{{/title}} {{rule /}} {{filter /}}",'woocommerce'),filter:Object(o.__)("Select IP address",'woocommerce')},rules:[{value:"includes",label:Object(o._x)("Includes","IP addresses",'woocommerce')},{value:"excludes",label:Object(o._x)("Excludes","IP addresses",'woocommerce')}],input:{component:"Search",type:"downloadIps",getLabels:async e=>{const t=e.split(",");return await t.map(e=>({id:e,label:e}))}}}}})},599:function(e,t,r){},600:function(e,t,r){},617:function(e,t,r){"use strict";r.r(t);var o=r(0),a=r(2),c=r(6),n=r.n(c),l=r(165),i=r.n(l),s=r(166),m=r.n(s),d=r(1),u=r.n(d),_=r(3),p=r(21),b=r(11),h=r(19),O=r(16),j=r(38),w=r.n(j),y=r(12),f=r(13),v=r(20),g=r(508);r(599);class x extends o.Component{constructor(...e){super(...e),w()(this,"handleChartClick",()=>{const{selectedChart:e}=this.props;Object(y.getHistory)().push(this.getChartPath(e))})}getChartPath(e){return Object(y.getNewPath)({chart:e.key},"/analytics/"+e.endpoint,Object(y.getPersistedQuery)())}render(){const{charts:e,endpoint:t,path:r,query:c,selectedChart:n,filters:l}=this.props;return n?Object(o.createElement)("div",{role:"presentation",className:"woocommerce-dashboard__chart-block-wrapper",onClick:this.handleChartClick},Object(o.createElement)(_.Card,{className:"woocommerce-dashboard__chart-block"},Object(o.createElement)(_.CardHeader,null,Object(o.createElement)(v.Text,{as:"h3",size:16,weight:600,color:"#23282d"},n.label)),Object(o.createElement)(_.CardBody,{size:null},Object(o.createElement)("a",{className:"screen-reader-text",href:Object(f.e)(this.getChartPath(n))},Object(a.sprintf)(Object(a.__)("%s Report",'woocommerce'),n.label)),Object(o.createElement)(g.a,{charts:e,endpoint:t,query:c,interactiveLegend:!1,legendPosition:"bottom",path:r,selectedChart:n,showHeaderControls:!1,filters:l})))):null}}x.propTypes={charts:u.a.array,endpoint:u.a.string.isRequired,path:u.a.string.isRequired,query:u.a.object.isRequired,selectedChart:u.a.object.isRequired};var C=x,S=r(30),k=r(533),T=r(529),E=r(528),R=r(534),F=r(535),A=r(536);const P={revenue:E.b,orders:k.b,products:T.b,coupons:R.b,taxes:F.b,downloads:A.b},q=[{label:Object(a.__)("Total sales",'woocommerce'),report:"revenue",key:"total_sales"},{label:Object(a.__)("Net sales",'woocommerce'),report:"revenue",key:"net_revenue"},{label:Object(a.__)("Orders",'woocommerce'),report:"orders",key:"orders_count"},{label:Object(a.__)("Average order value",'woocommerce'),report:"orders",key:"avg_order_value"},{label:Object(a.__)("Items sold",'woocommerce'),report:"products",key:"items_sold"},{label:Object(a.__)("Returns",'woocommerce'),report:"revenue",key:"refunds"},{label:Object(a.__)("Discounted orders",'woocommerce'),report:"coupons",key:"orders_count"},{label:Object(a.__)("Gross discounted",'woocommerce'),report:"coupons",key:"amount"},{label:Object(a.__)("Total tax",'woocommerce'),report:"taxes",key:"total_tax"},{label:Object(a.__)("Order tax",'woocommerce'),report:"taxes",key:"order_tax"},{label:Object(a.__)("Shipping tax",'woocommerce'),report:"taxes",key:"shipping_tax"},{label:Object(a.__)("Shipping",'woocommerce'),report:"revenue",key:"shipping"},{label:Object(a.__)("Downloads",'woocommerce'),report:"downloads",key:"download_count"}],I=Object(S.applyFilters)("woocommerce_admin_dashboard_charts_filter",q.map(e=>({...P[e.report].find(t=>t.key===e.key),label:e.label,endpoint:e.report})));r(600);const D=e=>{const{controls:t,hiddenBlocks:r,isFirst:c,isLast:l,onMove:s,onRemove:d,onTitleBlur:u,onTitleChange:j,onToggleHiddenBlock:w,path:y,title:f,titleInput:v,filters:g}=e,{updateUserPreferences:x,...S}=Object(b.useUserPreferences)(),[k,T]=Object(o.useState)(S.dashboard_chart_type||"line"),[E,R]=Object(o.useState)(S.dashboard_chart_interval||"day"),F={...e.query,chartType:k,interval:E},A=e=>()=>{T(e);x({dashboard_chart_type:e}),Object(O.recordEvent)("dash_charts_type_toggle",{chart_type:e})};return Object(o.createElement)("div",{className:"woocommerce-dashboard__dashboard-charts"},Object(o.createElement)(p.SectionHeader,{title:f||Object(a.__)("Charts",'woocommerce'),menu:Object(o.createElement)(p.EllipsisMenu,{label:Object(a.__)("Choose which charts to display",'woocommerce'),renderContent:({onToggle:e})=>Object(o.createElement)(o.Fragment,null,Object(o.createElement)(p.MenuTitle,null,Object(a.__)("Charts",'woocommerce')),(({hiddenBlocks:e,onToggleHiddenBlock:t})=>I.map(r=>{const a=r.endpoint+"_"+r.key,c=!e.includes(a);return Object(o.createElement)(p.MenuItem,{checked:c,isCheckbox:!0,isClickable:!0,key:r.endpoint+"_"+r.key,onInvoke:()=>{t(a)(),Object(O.recordEvent)("dash_charts_chart_toggle",{status:c?"off":"on",key:a})}},r.label)}))({hiddenBlocks:r,onToggleHiddenBlock:w}),Object(o.createElement)(t,{onToggle:e,onMove:s,onRemove:d,isFirst:c,isLast:l,onTitleBlur:u,onTitleChange:j,titleInput:v}))}),className:"has-interval-select"},(({chartInterval:e,setInterval:t,query:r})=>{const c=Object(h.getAllowedIntervalsForQuery)(r);if(!c||c.length<1)return null;const n={hour:Object(a.__)("By hour",'woocommerce'),day:Object(a.__)("By day",'woocommerce'),week:Object(a.__)("By week",'woocommerce'),month:Object(a.__)("By month",'woocommerce'),quarter:Object(a.__)("By quarter",'woocommerce'),year:Object(a.__)("By year",'woocommerce')};return Object(o.createElement)(_.SelectControl,{className:"woocommerce-chart__interval-select",value:e,options:c.map(e=>({value:e,label:n[e]})),"aria-label":"Chart period",onChange:t})})({chartInterval:E,setInterval:e=>{R(e);x({dashboard_chart_interval:e}),Object(O.recordEvent)("dash_charts_interval",{interval:e})},query:F}),Object(o.createElement)(_.NavigableMenu,{className:"woocommerce-chart__types",orientation:"horizontal",role:"menubar"},Object(o.createElement)(_.Button,{className:n()("woocommerce-chart__type-button",{"woocommerce-chart__type-button-selected":!F.chartType||"line"===F.chartType}),title:Object(a.__)("Line chart",'woocommerce'),"aria-checked":"line"===F.chartType,role:"menuitemradio",tabIndex:"line"===F.chartType?0:-1,onClick:A("line")},Object(o.createElement)(i.a,null)),Object(o.createElement)(_.Button,{className:n()("woocommerce-chart__type-button",{"woocommerce-chart__type-button-selected":"bar"===F.chartType}),title:Object(a.__)("Bar chart",'woocommerce'),"aria-checked":"bar"===F.chartType,role:"menuitemradio",tabIndex:"bar"===F.chartType?0:-1,onClick:A("bar")},Object(o.createElement)(m.a,null)))),(({hiddenBlocks:e,path:t,query:r,filters:a})=>{const c=I.reduce((e,t)=>(void 0===e[t.endpoint]&&(e[t.endpoint]=[]),e[t.endpoint].push(t),e),{});return Object(o.createElement)("div",{className:"woocommerce-dashboard__columns"},I.map(n=>e.includes(n.endpoint+"_"+n.key)?null:Object(o.createElement)(C,{charts:c[n.endpoint],endpoint:n.endpoint,key:n.endpoint+"_"+n.key,path:t,query:r,selectedChart:n,filters:a})))})({hiddenBlocks:r,path:y,query:F,filters:g}))};D.propTypes={path:u.a.string.isRequired,query:u.a.object.isRequired};t.default=D}}]);woocommerce-admin/dist/chunks/7.style.css000064400000003031151335517650014436 0ustar00:root{--wp-admin-theme-color:#007cba;--wp-admin-theme-color-darker-10:#006ba1;--wp-admin-theme-color-darker-20:#005a87}body.admin-color-light{--wp-admin-theme-color:#0085ba;--wp-admin-theme-color-darker-10:#0073a1;--wp-admin-theme-color-darker-20:#006187}body.admin-color-modern{--wp-admin-theme-color:#3858e9;--wp-admin-theme-color-darker-10:#2145e6;--wp-admin-theme-color-darker-20:#183ad6}body.admin-color-blue{--wp-admin-theme-color:#096484;--wp-admin-theme-color-darker-10:#07526c;--wp-admin-theme-color-darker-20:#064054}body.admin-color-coffee{--wp-admin-theme-color:#46403c;--wp-admin-theme-color-darker-10:#383330;--wp-admin-theme-color-darker-20:#2b2724}body.admin-color-ectoplasm{--wp-admin-theme-color:#523f6d;--wp-admin-theme-color-darker-10:#46365d;--wp-admin-theme-color-darker-20:#3a2c4d}body.admin-color-midnight{--wp-admin-theme-color:#e14d43;--wp-admin-theme-color-darker-10:#dd382d;--wp-admin-theme-color-darker-20:#d02c21}body.admin-color-ocean{--wp-admin-theme-color:#627c83;--wp-admin-theme-color-darker-10:#576e74;--wp-admin-theme-color-darker-20:#4c6066}body.admin-color-sunrise{--wp-admin-theme-color:#dd823b;--wp-admin-theme-color-darker-10:#d97426;--wp-admin-theme-color-darker-20:#c36922}.woocommerce-table__product-categories>.woocommerce-table__breadcrumbs{display:inline-block;margin-right:12px}.woocommerce-table__product-categories .components-popover__content{padding:0 16px;text-align:left}.woocommerce-table__product-categories .components-popover__content .woocommerce-table__breadcrumbs{margin-top:12px;margin-bottom:12px}woocommerce-admin/dist/chunks/0.style.css000064400000004376151335517650014444 0ustar00:root{--wp-admin-theme-color:#007cba;--wp-admin-theme-color-darker-10:#006ba1;--wp-admin-theme-color-darker-20:#005a87}body.admin-color-light{--wp-admin-theme-color:#0085ba;--wp-admin-theme-color-darker-10:#0073a1;--wp-admin-theme-color-darker-20:#006187}body.admin-color-modern{--wp-admin-theme-color:#3858e9;--wp-admin-theme-color-darker-10:#2145e6;--wp-admin-theme-color-darker-20:#183ad6}body.admin-color-blue{--wp-admin-theme-color:#096484;--wp-admin-theme-color-darker-10:#07526c;--wp-admin-theme-color-darker-20:#064054}body.admin-color-coffee{--wp-admin-theme-color:#46403c;--wp-admin-theme-color-darker-10:#383330;--wp-admin-theme-color-darker-20:#2b2724}body.admin-color-ectoplasm{--wp-admin-theme-color:#523f6d;--wp-admin-theme-color-darker-10:#46365d;--wp-admin-theme-color-darker-20:#3a2c4d}body.admin-color-midnight{--wp-admin-theme-color:#e14d43;--wp-admin-theme-color-darker-10:#dd382d;--wp-admin-theme-color-darker-20:#d02c21}body.admin-color-ocean{--wp-admin-theme-color:#627c83;--wp-admin-theme-color-darker-10:#576e74;--wp-admin-theme-color-darker-20:#4c6066}body.admin-color-sunrise{--wp-admin-theme-color:#dd823b;--wp-admin-theme-color-darker-10:#d97426;--wp-admin-theme-color-darker-20:#c36922}.woocommerce-report-table__scroll-point{position:relative;top:-48px}@media(max-width:782px){.woocommerce-report-table__scroll-point{top:-62px}}.woocommerce-feature-enabled-activity-panels .woocommerce-report-table__scroll-point{top:-108px}@media(max-width:782px){.woocommerce-feature-enabled-activity-panels .woocommerce-report-table__scroll-point{top:-122px}}.woocommerce-report-table .woocommerce-search{flex-grow:1}.woocommerce-report-table .components-card__header{display:grid;grid-gap:12px;grid-template-columns:min-content 1fr min-content}.woocommerce-report-table .woocommerce-table__compare.components-button{padding:8px}.woocommerce-report-table .woocommerce-ellipsis-menu{justify-self:flex-end}button.woocommerce-table__download-button{padding:6px 12px;color:#000;text-decoration:none;align-items:center}button.woocommerce-table__download-button svg{margin-right:8px;height:24px;width:24px}@media(max-width:782px){button.woocommerce-table__download-button svg{margin-right:0}button.woocommerce-table__download-button .woocommerce-table__download-button__label{display:none}}woocommerce-admin/dist/chunks/analytics-report-revenue.js000064400000016055151335517650017736 0ustar00(window.__wcAdmin_webpackJsonp=window.__wcAdmin_webpackJsonp||[]).push([[13],{481:function(e,t,r){"use strict";r.r(t),r.d(t,"default",(function(){return F}));var a=r(0),s=r(1),o=r.n(s),n=r(528),c=r(510),l=r(508),i=r(511),d=r(2),m=r(59),u=r(7),b=r(14),p=r(4),_=r(21),y=r(120),v=r(13),O=r(11),j=r(19),g=r(32),f=r(506),w=r(501);const h=[],R=["orders_count","gross_sales","total_sales","refunds","coupons","taxes","shipping","net_revenue"];class S extends a.Component{constructor(){super(),this.getHeadersContent=this.getHeadersContent.bind(this),this.getRowsContent=this.getRowsContent.bind(this),this.getSummary=this.getSummary.bind(this)}getHeadersContent(){return[{label:Object(d.__)("Date",'woocommerce'),key:"date",required:!0,defaultSort:!0,isLeftAligned:!0,isSortable:!0},{label:Object(d.__)("Orders",'woocommerce'),key:"orders_count",required:!1,isSortable:!0,isNumeric:!0},{label:Object(d.__)("Gross sales",'woocommerce'),key:"gross_sales",required:!1,isSortable:!0,isNumeric:!0},{label:Object(d.__)("Returns",'woocommerce'),key:"refunds",required:!1,isSortable:!0,isNumeric:!0},{label:Object(d.__)("Coupons",'woocommerce'),key:"coupons",required:!1,isSortable:!0,isNumeric:!0},{label:Object(d.__)("Net sales",'woocommerce'),key:"net_revenue",required:!1,isSortable:!0,isNumeric:!0},{label:Object(d.__)("Taxes",'woocommerce'),key:"taxes",required:!1,isSortable:!0,isNumeric:!0},{label:Object(d.__)("Shipping",'woocommerce'),key:"shipping",required:!1,isSortable:!0,isNumeric:!0},{label:Object(d.__)("Total sales",'woocommerce'),key:"total_sales",required:!1,isSortable:!0,isNumeric:!0}]}getRowsContent(e=[]){const t=Object(v.f)("dateFormat",j.defaultTableDateFormat),{formatAmount:r,render:s,formatDecimal:o,getCurrencyConfig:n}=this.context;return e.map(e=>{const{coupons:c,gross_sales:l,total_sales:i,net_revenue:d,orders_count:u,refunds:b,shipping:p,taxes:v}=e.subtotals,O=Object(a.createElement)(_.Link,{href:"edit.php?post_type=shop_order&m="+Object(m.format)("Ymd",e.date_start),type:"wp-admin"},Object(y.formatValue)(n(),"number",u));return[{display:Object(a.createElement)(_.Date,{date:e.date_start,visibleFormat:t}),value:e.date_start},{display:O,value:Number(u)},{display:s(l),value:o(l)},{display:r(b),value:o(b)},{display:r(c),value:o(c)},{display:s(d),value:o(d)},{display:s(v),value:o(v)},{display:s(p),value:o(p)},{display:s(i),value:o(i)}]})}getSummary(e,t=0){const{orders_count:r=0,gross_sales:a=0,total_sales:s=0,refunds:o=0,coupons:n=0,taxes:c=0,shipping:l=0,net_revenue:i=0}=e,{formatAmount:m,getCurrencyConfig:u}=this.context,b=u();return[{label:Object(d._n)("day","days",t,'woocommerce'),value:Object(y.formatValue)(b,"number",t)},{label:Object(d._n)("order","orders",r,'woocommerce'),value:Object(y.formatValue)(b,"number",r)},{label:Object(d.__)("Gross sales",'woocommerce'),value:m(a)},{label:Object(d.__)("Returns",'woocommerce'),value:m(o)},{label:Object(d.__)("Coupons",'woocommerce'),value:m(n)},{label:Object(d.__)("Net sales",'woocommerce'),value:m(i)},{label:Object(d.__)("Taxes",'woocommerce'),value:m(c)},{label:Object(d.__)("Shipping",'woocommerce'),value:m(l)},{label:Object(d.__)("Total sales",'woocommerce'),value:m(s)}]}render(){const{advancedFilters:e,filters:t,tableData:r,query:s}=this.props;return Object(a.createElement)(f.a,{endpoint:"revenue",getHeadersContent:this.getHeadersContent,getRowsContent:this.getRowsContent,getSummary:this.getSummary,summaryFields:R,query:s,tableData:r,title:Object(d.__)("Revenue",'woocommerce'),columnPrefsKey:"revenue_report_columns",filters:t,advancedFilters:e})}}S.contextType=w.a;const T=Object(p.memoize)((e,t,r,a)=>({tableData:{items:{data:Object(p.get)(a,["data","intervals"],h),totalResults:Object(p.get)(a,["totalResults"],0)},isError:e,isRequesting:t,query:r}}),(e,t,r,a)=>[e,t,Object(g.stringify)(r),Object(p.get)(a,["totalResults"],0),Object(p.get)(a,["data","intervals"],h).length].join(":")),q=Object(p.memoize)((e,t,r,a,s)=>({interval:"day",orderby:t,order:e,page:r,per_page:a,after:Object(j.appendTimestamp)(s.primary.after,"start"),before:Object(j.appendTimestamp)(s.primary.before,"end")}),(e,t,r,a,s)=>[e,t,r,a,s.primary.after,s.primary.before].join(":"));var C=Object(b.compose)(Object(u.withSelect)((e,t)=>{const{query:r,filters:a,advancedFilters:s}=t,{woocommerce_default_date_range:o}=e(O.SETTINGS_STORE_NAME).getSetting("wc_admin","wcAdminSettings"),n=Object(j.getCurrentDates)(r,o),{getReportStats:c,getReportStatsError:l,isResolving:i}=e(O.REPORTS_STORE_NAME),d=q(r.order||"desc",r.orderby||"date",r.paged||1,r.per_page||O.QUERY_DEFAULTS.pageSize,n),m=Object(O.getReportTableQuery)({endpoint:"revenue",query:r,select:e,tableQuery:d,filters:a,advancedFilters:s}),u=c("revenue",m),b=Boolean(l("revenue",m)),p=i("getReportStats",["revenue",m]);return T(b,p,d,u)}))(S),k=r(505);class F extends a.Component{render(){const{path:e,query:t}=this.props;return Object(a.createElement)(a.Fragment,null,Object(a.createElement)(k.a,{query:t,path:e,report:"revenue",filters:n.c,advancedFilters:n.a}),Object(a.createElement)(i.a,{charts:n.b,endpoint:"revenue",query:t,selectedChart:Object(c.a)(t.chart,n.b),filters:n.c,advancedFilters:n.a}),Object(a.createElement)(l.a,{charts:n.b,endpoint:"revenue",path:e,query:t,selectedChart:Object(c.a)(t.chart,n.b),filters:n.c,advancedFilters:n.a}),Object(a.createElement)(C,{query:t,filters:n.c,advancedFilters:n.a}))}}F.propTypes={path:o.a.string.isRequired,query:o.a.object.isRequired}},528:function(e,t,r){"use strict";r.d(t,"b",(function(){return o})),r.d(t,"a",(function(){return n})),r.d(t,"c",(function(){return l}));var a=r(2),s=r(30);const o=Object(s.applyFilters)("woocommerce_admin_revenue_report_charts",[{key:"gross_sales",label:Object(a.__)("Gross sales",'woocommerce'),order:"desc",orderby:"gross_sales",type:"currency",isReverseTrend:!1},{key:"refunds",label:Object(a.__)("Returns",'woocommerce'),order:"desc",orderby:"refunds",type:"currency",isReverseTrend:!0},{key:"coupons",label:Object(a.__)("Coupons",'woocommerce'),order:"desc",orderby:"coupons",type:"currency",isReverseTrend:!1},{key:"net_revenue",label:Object(a.__)("Net sales",'woocommerce'),orderby:"net_revenue",type:"currency",isReverseTrend:!1},{key:"taxes",label:Object(a.__)("Taxes",'woocommerce'),order:"desc",orderby:"taxes",type:"currency",isReverseTrend:!1},{key:"shipping",label:Object(a.__)("Shipping",'woocommerce'),orderby:"shipping",type:"currency",isReverseTrend:!1},{key:"total_sales",label:Object(a.__)("Total sales",'woocommerce'),order:"desc",orderby:"total_sales",type:"currency",isReverseTrend:!1}]),n=Object(s.applyFilters)("woocommerce_admin_revenue_report_advanced_filters",{filters:{},title:Object(a._x)("Revenue Matches {{select /}} Filters","A sentence describing filters for Revenue. See screen shot for context: https://cloudup.com/cSsUY9VeCVJ",'woocommerce')}),c=[];Object.keys(n.filters).length&&(c.push({label:Object(a.__)("All Revenue",'woocommerce'),value:"all"}),c.push({label:Object(a.__)("Advanced Filters",'woocommerce'),value:"advanced"}));const l=Object(s.applyFilters)("woocommerce_admin_revenue_report_filters",[{label:Object(a.__)("Show",'woocommerce'),staticParams:["chartType","paged","per_page"],param:"filter",showFilters:()=>c.length>0,filters:c}])}}]);woocommerce-admin/dist/chunks/marketing-overview.js000064400000224261151335517650016614 0ustar00(window.__wcAdmin_webpackJsonp=window.__wcAdmin_webpackJsonp||[]).push([[34],{102:function(M,e,t){"use strict";t.d(e,"a",(function(){return D})),t.d(e,"b",(function(){return Y})),t.d(e,"c",(function(){return b}));var j={};t.r(j),t.d(j,"blank",(function(){return A})),t.d(j,"amazonEbayIntegration",(function(){return T})),t.d(j,"woocommerceAmazonEbayIntegration",(function(){return T})),t.d(j,"automatewoo",(function(){return r})),t.d(j,"automatewooAlt",(function(){return S})),t.d(j,"facebook",(function(){return O})),t.d(j,"facebookForWoocommerce",(function(){return O})),t.d(j,"pinterest",(function(){return o})),t.d(j,"pinterestForWoocommerce",(function(){return o})),t.d(j,"googleAds",(function(){return E})),t.d(j,"googleListingsAndAds",(function(){return E})),t.d(j,"hubspotForWoocommerce",(function(){return l})),t.d(j,"mailchimpForWoocommerce",(function(){return C})),t.d(j,"woocommerceStoreCredit",(function(){return s})),t.d(j,"woocommerceFreeGiftCoupons",(function(){return w})),t.d(j,"woocommerceUrlCoupons",(function(){return x})),t.d(j,"woocommerceGroupCoupons",(function(){return m})),t.d(j,"woocommerceSmartCoupons",(function(){return d}));var L=t(35),N=t.n(L),u=t(0),c=t(3),i=t(6),g=t.n(i),D=(t(272),M=>Object(u.createElement)(c.Button,N()({},M,{className:g()(M.className,"woocommerce-admin-marketing-button")}))),I=(t(77),t(1)),n=t.n(I),y=t(116),z=t(4),a=(t(274),t(8));var A=Object(u.createElement)(a.SVG,{width:"36",height:"36",fill:"none",xmlns:"http://www.w3.org/2000/svg"});var T=Object(u.createElement)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"100",height:"100",viewBox:"0 0 100 100"},Object(u.createElement)("defs",null,Object(u.createElement)("clipPath",{id:"b"},Object(u.createElement)("rect",{width:"100",height:"100"}))),Object(u.createElement)("g",{id:"a",clipPath:"url(#b)"},Object(u.createElement)("rect",{width:"100",height:"100",fill:"#fff"}),Object(u.createElement)("rect",{width:"100",height:"100",fill:"#eee"}),Object(u.createElement)("g",{transform:"translate(9 25.655)"},Object(u.createElement)(a.Path,{d:"M179.753,195.8c-4.732,3.488-11.591,5.349-17.5,5.349a31.66,31.66,0,0,1-21.374-8.156c-.443-.4-.046-.946.486-.634a43.018,43.018,0,0,0,21.384,5.671,42.523,42.523,0,0,0,16.312-3.335c.8-.34,1.471.525.688,1.106",transform:"translate(-129.235 -176.611)",fill:"#f90",fillRule:"evenodd"}),Object(u.createElement)(a.Path,{d:"M577.807,183.949c-.6-.773-4-.365-5.522-.184-.464.057-.535-.347-.117-.638,2.7-1.9,7.142-1.354,7.66-.716s-.135,5.09-2.676,7.213c-.39.326-.762.152-.588-.28.571-1.425,1.85-4.619,1.244-5.395",transform:"translate(-525.323 -167.01)",fill:"#f90",fillRule:"evenodd"}),Object(u.createElement)(a.Path,{d:"M572.708,6.758V4.908a.457.457,0,0,1,.468-.468h8.284a.461.461,0,0,1,.479.468V6.493a2.605,2.605,0,0,1-.624,1.163l-4.292,6.129a9.146,9.146,0,0,1,4.725,1.014.843.843,0,0,1,.44.72v1.974c0,.269-.3.585-.61.422a9.542,9.542,0,0,0-8.752.014c-.287.156-.588-.156-.588-.425V15.627a2.238,2.238,0,0,1,.3-1.272l4.973-7.132h-4.328a.458.458,0,0,1-.479-.464",transform:"translate(-525.64 -4.078)",fillRule:"evenodd"}),Object(u.createElement)(a.Path,{d:"M173.431,15.624h-2.52a.476.476,0,0,1-.45-.429V2.261a.473.473,0,0,1,.486-.464h2.35a.475.475,0,0,1,.457.432V3.92h.046a3.463,3.463,0,0,1,6.589,0,3.722,3.722,0,0,1,6.4-.982c.8,1.088.634,2.669.634,4.055l0,8.163a.476.476,0,0,1-.486.468h-2.517a.479.479,0,0,1-.454-.468V8.3a16.192,16.192,0,0,0-.071-2.424,1.312,1.312,0,0,0-1.482-1.113,1.674,1.674,0,0,0-1.506,1.06,7.831,7.831,0,0,0-.234,2.478v6.855a.476.476,0,0,1-.486.468h-2.517a.476.476,0,0,1-.454-.468l0-6.855c0-1.443.238-3.566-1.553-3.566-1.811,0-1.74,2.07-1.74,3.566v6.855a.476.476,0,0,1-.486.468",transform:"translate(-156.58 -1.399)",fillRule:"evenodd"}),Object(u.createElement)(a.Path,{d:"M714.982,1.524c3.739,0,5.763,3.211,5.763,7.295,0,3.945-2.237,7.075-5.763,7.075-3.672,0-5.671-3.211-5.671-7.213,0-4.027,2.024-7.156,5.671-7.156M715,4.164c-1.857,0-1.974,2.531-1.974,4.108s-.025,4.955,1.953,4.955c1.953,0,2.045-2.722,2.045-4.381a11.959,11.959,0,0,0-.376-3.431A1.577,1.577,0,0,0,715,4.164",transform:"translate(-651.552 -1.399)",fillRule:"evenodd"}),Object(u.createElement)(a.Path,{d:"M875.817,15.624h-2.51a.479.479,0,0,1-.454-.468l0-12.938a.477.477,0,0,1,.486-.422h2.336a.482.482,0,0,1,.45.362V4.136h.046c.705-1.769,1.694-2.612,3.435-2.612a3.307,3.307,0,0,1,2.942,1.524c.659,1.035.659,2.775.659,4.027v8.142a.484.484,0,0,1-.486.408h-2.527a.477.477,0,0,1-.447-.408V8.191c0-1.414.163-3.484-1.577-3.484a1.647,1.647,0,0,0-1.457,1.035,5.724,5.724,0,0,0-.4,2.449v6.965a.485.485,0,0,1-.493.468",transform:"translate(-801.775 -1.399)",fillRule:"evenodd"}),Object(u.createElement)(a.Path,{d:"M413.163,8.046a4.93,4.93,0,0,1-.471,2.673,2.048,2.048,0,0,1-1.744,1.145c-.968,0-1.535-.737-1.535-1.825,0-2.148,1.925-2.538,3.75-2.538v.546m2.541,6.143a.526.526,0,0,1-.6.06,6.143,6.143,0,0,1-1.446-1.68,4.991,4.991,0,0,1-4.154,1.833,3.575,3.575,0,0,1-3.771-3.927,4.277,4.277,0,0,1,2.687-4.119,17.463,17.463,0,0,1,4.739-.876V5.154a3.214,3.214,0,0,0-.308-1.825,1.677,1.677,0,0,0-1.414-.656,1.917,1.917,0,0,0-2.024,1.514.527.527,0,0,1-.439.461l-2.442-.262a.444.444,0,0,1-.376-.528C406.719.893,409.4,0,411.795,0a5.714,5.714,0,0,1,3.8,1.255C416.818,2.4,416.7,3.928,416.7,5.59V9.517a3.447,3.447,0,0,0,.95,2.336.477.477,0,0,1-.011.67c-.514.429-1.428,1.226-1.932,1.673l0-.007",transform:"translate(-372.698 0)",fillRule:"evenodd"}),Object(u.createElement)(a.Path,{d:"M7.426,8.046a4.93,4.93,0,0,1-.471,2.673,2.043,2.043,0,0,1-1.744,1.145c-.968,0-1.531-.737-1.531-1.825C3.679,7.89,5.6,7.5,7.426,7.5v.546m2.541,6.143a.526.526,0,0,1-.6.06,6.2,6.2,0,0,1-1.446-1.68A4.986,4.986,0,0,1,3.771,14.4,3.576,3.576,0,0,1,0,10.474,4.282,4.282,0,0,1,2.687,6.356,17.462,17.462,0,0,1,7.426,5.48V5.154a3.243,3.243,0,0,0-.3-1.825,1.686,1.686,0,0,0-1.414-.656A1.921,1.921,0,0,0,3.679,4.186a.527.527,0,0,1-.436.461L.8,4.385a.446.446,0,0,1-.376-.528C.985.893,3.662,0,6.058,0a5.714,5.714,0,0,1,3.8,1.255C11.08,2.4,10.963,3.928,10.963,5.59V9.517a3.447,3.447,0,0,0,.95,2.336.473.473,0,0,1-.007.67c-.514.429-1.428,1.226-1.932,1.673l-.007-.007",transform:"translate(0 0)",fillRule:"evenodd"})),Object(u.createElement)("g",{transform:"translate(18.9 54.637)"},Object(u.createElement)(a.Path,{d:"M8.055,26.308C3.716,26.308.1,28.149.1,33.7c0,4.4,2.431,7.171,8.067,7.171,6.633,0,7.059-4.37,7.059-4.37H12.011s-.689,2.353-4.04,2.353a4.4,4.4,0,0,1-4.693-4.428H15.562V32.807c0-2.557-1.623-6.5-7.507-6.5Zm-.112,2.073c2.6,0,4.37,1.592,4.37,3.977H3.349C3.349,29.826,5.661,28.381,7.943,28.381Z",transform:"translate(0 -20.83)",fill:"#e53238"}),Object(u.createElement)(a.Path,{d:"M75.169.1V17.254c0,.974-.069,2.341-.069,2.341h3.066s.11-.982.11-1.879c0,0,1.515,2.37,5.633,2.37a6.961,6.961,0,0,0,7.283-7.325A6.922,6.922,0,0,0,83.915,5.52c-4.279,0-5.609,2.311-5.609,2.311V.1Zm7.955,7.542c2.945,0,4.818,2.186,4.818,5.119a4.857,4.857,0,0,1-4.8,5.2c-3.143,0-4.839-2.454-4.839-5.175C78.306,10.254,79.827,7.642,83.123,7.642Z",transform:"translate(-59.609)",fill:"#0064d2"}),Object(u.createElement)(a.Path,{d:"M159.834,26.308c-6.528,0-6.947,3.574-6.947,4.146h3.249s.17-2.087,3.473-2.087c2.146,0,3.809.982,3.809,2.871v.672h-3.809c-5.057,0-7.731,1.479-7.731,4.482,0,2.955,2.47,4.562,5.809,4.562,4.55,0,6.015-2.514,6.015-2.514,0,1,.077,1.985.077,1.985h2.888s-.112-1.221-.112-2V31.669c0-4.428-3.572-5.36-6.722-5.36Zm3.585,7.619v.9c0,1.169-.721,4.075-4.968,4.075-2.326,0-3.323-1.161-3.323-2.507C155.128,33.943,158.486,33.927,163.419,33.927Z",transform:"translate(-120.634 -20.83)",fill:"#f5af02"}),Object(u.createElement)(a.Path,{d:"M214.879,29.041h3.655l5.246,10.51,5.234-10.51h3.311l-9.533,18.711h-3.473l2.751-5.216Z",transform:"translate(-170.706 -23.002)",fill:"#86b817"}))));var r=Object(u.createElement)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"100",height:"100",viewBox:"0 0 100 100"},Object(u.createElement)("defs",null,Object(u.createElement)("clipPath",{id:"b"},Object(u.createElement)("rect",{width:"100",height:"100"}))),Object(u.createElement)("g",{id:"a",clipPath:"url(#b)"},Object(u.createElement)("rect",{width:"100",height:"100",fill:"#fff"}),Object(u.createElement)("rect",{width:"100",height:"100",fill:"#7532e4"}),Object(u.createElement)("g",{transform:"translate(-43.503 -133.512)"},Object(u.createElement)(a.Path,{d:"M78.217,193.13H64.405l-2.823,7.764H54.6L67.648,166.9h7.669l12.934,33.995H81.059Zm-11.6-6.047h9.4L71.33,174.245Z",transform:"translate(0 0)",fill:"#1ff2e6"}),Object(u.createElement)(a.Path,{d:"M246.639,166.9h6.753l-9.4,33.995h-6.81l-7.764-24.208-7.764,24.208h-6.906L205.3,166.9h7l6.238,23.388,7.535-23.388h6.849l7.592,23.483Z",transform:"translate(-121.952)",fill:"#1ff2e6"}))));var S=Object(u.createElement)(a.SVG,{xmlns:"http://www.w3.org/2000/svg"},Object(u.createElement)(a.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M4.67708 14.1615h3.77084l.77604 2.1198h1.96354L7.65625 7H5.5625L2 16.2813h1.90625l.77083-2.1198zm3.17188-1.6511H5.28125l1.28646-3.50519 1.28125 3.50519zM22.9791 7h-1.8437l-1.6719 6.4115L17.3906 7h-1.8698l-2.0573 6.3854L11.7604 7H9.8489l2.5781 9.2813h1.8854l2.1198-6.60942 2.1198 6.60942h1.8594L22.9791 7z"}));var O=Object(u.createElement)(a.SVG,{width:"36",height:"36",viewBox:"0 0 36 36",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Object(u.createElement)(a.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M34 0H2C0.8 0 0 0.8 0 2V34C0 35 0.8 36 2 36H19.2V22H14.6V16.6H19.2V12.6C19.2 8 22 5.4 26.2 5.4C28.2 5.4 29.8 5.6 30.4 5.6V10.4H27.6C25.4 10.4 25 11.4 25 13V16.4H30.4L29.6 22H25V36H34C35 36 36 35.2 36 34V2C36 0.8 35.2 0 34 0Z",fill:"#3B5997"}));var o=Object(u.createElement)(a.SVG,{width:"303",height:"303",viewBox:"-30 -30 303 303",fill:"none",xmlns:"http://www.w3.org/2000/SVG"},Object(u.createElement)(a.Path,{fill:"#E60023",d:"M121.5,0C54.4,0,0,54.4,0,121.5C0,173,32,217,77.2,234.7c-1.1-9.6-2-24.4,0.4-34.9 c2.2-9.5,14.2-60.4,14.2-60.4s-3.6-7.3-3.6-18c0-16.9,9.8-29.5,22-29.5c10.4,0,15.4,7.8,15.4,17.1c0,10.4-6.6,26-10.1,40.5 c-2.9,12.1,6.1,22,18,22c21.6,0,38.2-22.8,38.2-55.6c0-29.1-20.9-49.4-50.8-49.4C86.3,66.5,66,92.4,66,119.2c0,10.4,4,21.6,9,27.7 c1,1.2,1.1,2.3,0.8,3.5c-0.9,3.8-3,12.1-3.4,13.8c-0.5,2.2-1.8,2.7-4.1,1.6c-15.2-7.1-24.7-29.2-24.7-47.1 c0-38.3,27.8-73.5,80.3-73.5c42.1,0,74.9,30,74.9,70.2c0,41.9-26.4,75.6-63,75.6c-12.3,0-23.9-6.4-27.8-14c0,0-6.1,23.2-7.6,28.9 c-2.7,10.6-10.1,23.8-15.1,31.9c11.4,3.5,23.4,5.4,36,5.4c67.1,0,121.5-54.4,121.5-121.5C243,54.4,188.6,0,121.5,0z"}));var E=Object(u.createElement)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"128",height:"128",viewBox:"0 0 128 128"},Object(u.createElement)("rect",{width:"128",height:"128",fill:"#eee"}),Object(u.createElement)(a.Path,{d:"M92.4539 42.3419c3.7531 0 6.7961-3.0427 6.7961-6.7959 0-3.7531-3.043-6.7958-6.7961-6.7958s-6.7958 3.0427-6.7958 6.7958c0 3.7532 3.0427 6.7959 6.7958 6.7959zm-48.1438-2.0744l20.848-20.8481c1.5904-1.5903 3.7989-2.562 6.2285-2.562h30.9214c1.161-.0041 2.312.2217 3.386.6642 1.073.4426 2.049 1.0932 2.87 1.9143.821.8212 1.472 1.7967 1.914 2.8704.443 1.0737.669 2.2244.665 3.3857v30.9213c0 2.4297-.972 4.6384-2.607 6.2285L87.7202 83.678 44.3101 40.2675z",fill:"#4285F4"}),Object(u.createElement)(a.Path,{d:"M87.7202 83.678l-25.6915 25.716c-1.6346 1.59-3.8431 2.606-6.2726 2.606-2.4294 0-4.6383-1.016-6.2285-2.606L18.6061 78.4725C16.9717 76.8821 16 74.6736 16 72.244c0-2.4737 1.0159-4.6824 2.6061-6.2726L44.31 40.2675 87.7202 83.678z",fill:"#34A853"}),Object(u.createElement)(a.Path,{d:"M33.6115 93.4777L18.6061 78.4723C16.9717 76.8825 16 74.6736 16 72.2442c0-2.4737 1.0159-4.6824 2.6061-6.2726L44.31 40.2677l21.2557 21.256-31.9542 31.954z",fill:"#FBBC05"}),Object(u.createElement)(a.Path,{d:"M108.092 18.9973c-1.607-1.3873-3.661-2.1473-5.784-2.1399H71.3866c-2.4296 0-4.6381.9717-6.2285 2.562l-20.848 20.8481 21.2556 21.256 21.649-21.649c-1.0082-1.2168-1.5589-2.7482-1.5565-4.3285 0-3.7531 3.0426-6.7958 6.7957-6.7958 1.5804-.0025 3.1118.5482 4.3287 1.5565l11.3094-11.3094z",fill:"#EA4335"}),Object(u.createElement)(a.Path,{d:"M65.5535 77.7372c7.6238 0 13.8041-6.1803 13.8041-13.8041S73.1773 50.129 65.5535 50.129s-13.8041 6.1803-13.8041 13.8041 6.1803 13.8041 13.8041 13.8041z",fill:"#4285F4"}),Object(u.createElement)(a.Path,{d:"M84.3608 59.8724H66.0013v7.877h10.568c-.9853 5.0043-5.1048 7.8771-10.568 7.8771-6.4483 0-11.6427-5.3749-11.6427-12.0473s5.1944-12.0473 11.6427-12.0473c2.7764 0 5.284 1.0194 7.2543 2.6875l5.7318-5.9311c-3.4928-3.1508-7.9708-5.0969-12.9861-5.0969-10.9261 0-19.7029 9.0819-19.7029 20.3878S55.0752 83.967 66.0013 83.967c9.8514 0 18.8073-7.4138 18.8073-20.3878 0-1.2047-.1791-2.5022-.4478-3.7068z",fill:"#fff"}));var l=Object(u.createElement)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"100",height:"100",viewBox:"0 0 100 100"},Object(u.createElement)("defs",null,Object(u.createElement)("clipPath",{id:"b"},Object(u.createElement)("rect",{width:"100",height:"100"}))),Object(u.createElement)("g",{id:"a",clipPath:"url(#b)"},Object(u.createElement)("rect",{width:"100",height:"100",fill:"#fff"}),Object(u.createElement)(a.Path,{d:"M100,100H0V0H100V100ZM40.665,75.539a6.446,6.446,0,1,0,6.447,6.447,6.376,6.376,0,0,0-.3-1.843L54.158,72.8A19.808,19.808,0,1,0,69.206,37.48h.015V28.455a6.959,6.959,0,0,0,4.013-6.273v-.211a6.971,6.971,0,0,0-6.952-6.953H66.07a6.97,6.97,0,0,0-6.952,6.953v.211a6.957,6.957,0,0,0,4.013,6.273V37.5a19.745,19.745,0,0,0-9.376,4.126L28.935,22.295a7.919,7.919,0,0,0-4.148-9.145,7.845,7.845,0,0,0-3.5-.817,7.919,7.919,0,1,0,3.938,14.786l24.4,19a19.775,19.775,0,0,0,.3,22.3l-7.426,7.427A6.362,6.362,0,0,0,40.665,75.539Zm25.522-8.321h0l-.023,0a10.164,10.164,0,0,1,.023-20.328H66.2a10.166,10.166,0,0,1-.012,20.333Z",fill:"#ff7a59"})));var C=Object(u.createElement)(a.SVG,{width:"36",height:"36",viewBox:"0 0 36 36",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Object(u.createElement)("rect",{width:"36",height:"36",rx:"3",fill:"#FFE071"}),Object(u.createElement)(a.Path,{d:"M24.0534 17.2863C24.2392 17.2638 24.4176 17.2625 24.5813 17.2863C24.6764 17.0647 24.6923 16.6823 24.6071 16.2661C24.4808 15.6471 24.3091 15.2728 23.9546 15.331C23.6002 15.3892 23.5873 15.8374 23.7143 16.4564C23.7848 16.8043 23.9117 17.1023 24.0534 17.2863Z",fill:"black"}),Object(u.createElement)(a.Path,{d:"M21.0119 17.7757C21.2652 17.8889 21.4209 17.9647 21.4823 17.899C21.5215 17.8576 21.5099 17.7794 21.4491 17.6786C21.3241 17.4702 21.0665 17.2587 20.7937 17.1404C20.2357 16.895 19.5697 16.9764 19.0559 17.3532C18.886 17.4802 18.7254 17.6555 18.7487 17.7625C18.756 17.7969 18.7812 17.8232 18.8413 17.8314C18.9811 17.8476 19.4698 17.5954 20.0321 17.5603C20.4294 17.5353 20.7587 17.6624 21.0119 17.7757Z",fill:"black"}),Object(u.createElement)(a.Path,{d:"M20.5024 18.073C20.1725 18.1262 19.9904 18.237 19.8733 18.3409C19.7733 18.4298 19.712 18.5281 19.7126 18.5975C19.7126 18.6307 19.7267 18.6495 19.7378 18.6589C19.7531 18.6726 19.7709 18.6802 19.7923 18.6802C19.8671 18.6802 20.0339 18.6119 20.0339 18.6119C20.4932 18.4442 20.7961 18.4642 21.0966 18.4993C21.2627 18.518 21.3406 18.5287 21.3774 18.4705C21.3884 18.4536 21.4013 18.4179 21.3682 18.3628C21.2903 18.2339 20.9568 18.0179 20.5024 18.073Z",fill:"black"}),Object(u.createElement)(a.Path,{d:"M23.0263 19.1626C23.2501 19.2753 23.4972 19.2309 23.5775 19.0644C23.6578 18.8973 23.5413 18.6713 23.3169 18.5587C23.0925 18.446 22.846 18.4904 22.7657 18.6569C22.6859 18.824 22.8025 19.0506 23.0263 19.1626Z",fill:"black"}),Object(u.createElement)(a.Path,{d:"M24.4673 17.8777C24.2851 17.8746 24.1343 18.0786 24.13 18.3334C24.1257 18.5881 24.2698 18.7971 24.4519 18.8003C24.634 18.8034 24.7849 18.5994 24.7892 18.3446C24.7935 18.0899 24.6494 17.8809 24.4673 17.8777Z",fill:"black"}),Object(u.createElement)(a.Path,{d:"M12.2373 22.4735C12.1919 22.4153 12.1177 22.4335 12.0454 22.4504C11.9951 22.4623 11.9381 22.476 11.8755 22.4748C11.7419 22.4723 11.6284 22.4134 11.5646 22.3139C11.4819 22.1837 11.4868 21.9903 11.5781 21.7682C11.5904 21.7381 11.6051 21.7049 11.6211 21.6686C11.767 21.3344 12.0117 20.7743 11.7369 20.241C11.5303 19.8398 11.1937 19.5895 10.7884 19.5369C10.3996 19.4868 9.99919 19.6339 9.7441 19.9212C9.34124 20.3749 9.27808 20.9921 9.35595 21.2099C9.38477 21.29 9.42892 21.3119 9.46142 21.3163C9.5301 21.3257 9.63127 21.275 9.69505 21.1003C9.69934 21.0878 9.70547 21.0684 9.71344 21.0434C9.74165 20.9514 9.79438 20.7799 9.88084 20.6422C9.98508 20.4763 10.147 20.3618 10.3371 20.3205C10.5308 20.2779 10.7289 20.3161 10.8944 20.4269C11.1765 20.6153 11.285 20.9683 11.1648 21.305C11.1023 21.479 11.0011 21.812 11.0238 22.0855C11.0692 22.6394 11.4028 22.8616 11.7026 22.8854C11.9939 22.8966 12.1981 22.7295 12.2496 22.6075C12.279 22.5361 12.2539 22.4923 12.2373 22.4735Z",fill:"black"}),Object(u.createElement)(a.Path,{d:"M29.0624 21.4609C29.0513 21.4209 28.979 21.1511 28.8796 20.8263C28.7803 20.5015 28.6773 20.2724 28.6773 20.2724C29.0759 19.6634 29.0826 19.1189 29.0299 18.8109C28.9735 18.4285 28.8177 18.1031 28.5031 17.7663C28.1892 17.4296 27.5466 17.0847 26.6434 16.8262C26.5403 16.7968 26.1994 16.7011 26.1694 16.6917C26.1669 16.6717 26.1442 15.5513 26.124 15.0706C26.1093 14.7233 26.0798 14.18 25.9149 13.6455C25.7181 12.922 25.3759 12.2886 24.9479 11.8836C26.1283 10.635 26.8647 9.25926 26.8629 8.07947C26.8592 5.81 24.1293 5.1234 20.7642 6.54542C20.7605 6.54667 20.0565 6.85147 20.051 6.8546C20.048 6.85147 18.7621 5.56402 18.7431 5.5465C14.907 2.13103 2.91255 15.7391 6.7474 19.0444L7.58562 19.7692C7.36794 20.3437 7.28271 21.0028 7.35261 21.7107C7.44213 22.6201 7.90202 23.4926 8.64704 24.166C9.35404 24.8057 10.2842 25.2106 11.1868 25.21C12.6793 28.72 16.0886 30.8737 20.0872 30.9951C24.3758 31.1253 27.9758 29.0711 29.4842 25.3815C29.583 25.1224 30.0018 23.9557 30.0018 22.9255C30.0005 21.8903 29.4272 21.4609 29.0624 21.4609ZM11.5161 24.2236C11.3861 24.2461 11.2531 24.2555 11.1188 24.2518C9.82374 24.2161 8.42445 23.0263 8.28526 21.6143C8.13135 20.054 8.91255 18.8535 10.2953 18.5687C10.4608 18.5349 10.6601 18.5149 10.876 18.5268C11.651 18.57 12.7928 19.1777 13.0534 20.9002C13.2845 22.4261 12.9172 23.9801 11.5161 24.2236ZM10.0696 17.6361C9.20872 17.807 8.45021 18.3052 7.98603 18.9931C7.70887 18.7571 7.19195 18.3002 7.10059 18.1218C6.35986 16.686 7.90877 13.8946 8.99104 12.318C11.6657 8.42245 15.8544 5.4739 17.7939 6.00903C18.1091 6.10041 19.1533 7.33591 19.1533 7.33591C19.1533 7.33591 17.2151 8.43372 15.4172 9.96402C12.9951 11.8667 11.1654 14.6338 10.0696 17.6361ZM23.6657 23.6403C23.694 23.6284 23.7136 23.5952 23.7099 23.5627C23.7056 23.5226 23.6706 23.4932 23.6314 23.4976C23.6314 23.4976 21.6024 23.8043 19.6856 23.0876C19.8941 22.3948 20.4496 22.6451 21.2884 22.714C22.8012 22.806 24.1563 22.5807 25.1582 22.2871C26.0265 22.033 27.1664 21.5317 28.0525 20.8182C28.3511 21.4879 28.4565 22.2252 28.4565 22.2252C28.4565 22.2252 28.6877 22.1832 28.8809 22.304C29.0636 22.4186 29.1973 22.657 29.1059 23.2735C28.9195 24.4252 28.44 25.3596 27.6343 26.2196C27.1437 26.7585 26.5477 27.2273 25.8665 27.5684C25.5047 27.7624 25.119 27.9301 24.7118 28.0659C21.6735 29.0786 18.5628 27.9652 17.5603 25.5737C17.4799 25.394 17.4125 25.2056 17.3592 25.0091C16.9318 23.4331 17.2948 21.5423 18.4285 20.3525V20.3519C18.4984 20.2761 18.5696 20.1866 18.5696 20.0746C18.5696 19.9807 18.5113 19.8818 18.4604 19.8111C18.0637 19.224 16.6896 18.2232 16.9655 16.2861C17.1635 14.8948 18.3556 13.9146 19.4673 13.9728C19.5611 13.9778 19.6549 13.9835 19.7487 13.9891C20.2307 14.0179 20.6507 14.0811 21.0468 14.098C21.7103 14.1274 22.3069 14.0285 23.0139 13.4277C23.2525 13.2249 23.4438 13.049 23.7669 12.9933C23.8006 12.9877 23.8853 12.9564 24.0545 12.9645C24.2268 12.9739 24.3911 13.0221 24.5389 13.1222C25.1055 13.5072 25.1858 14.4391 25.2153 15.1213C25.2318 15.5106 25.2778 16.4526 25.2937 16.7224C25.3299 17.3407 25.4887 17.4277 25.8113 17.536C25.9922 17.5967 26.1608 17.6424 26.4085 17.7131C27.1584 17.9278 27.603 18.1462 27.8838 18.426C28.0512 18.6013 28.1285 18.7872 28.153 18.9643C28.2413 19.6227 27.6521 20.4364 26.0921 21.1755C24.3868 21.9836 22.3174 22.1882 20.888 22.0255C20.7783 22.013 20.3883 21.9679 20.3871 21.9679C19.2435 21.8108 18.591 23.3192 19.2778 24.3525C19.7199 25.0185 20.9248 25.4522 22.1303 25.4522C24.8939 25.4529 27.0186 24.248 27.8084 23.2078C27.8323 23.1765 27.8342 23.1734 27.8716 23.1158C27.9102 23.0557 27.8783 23.0232 27.8299 23.057C27.1842 23.5076 24.3169 25.2976 21.2492 24.7594C21.2492 24.7594 20.8764 24.6968 20.5361 24.5616C20.2656 24.4546 19.6997 24.1886 19.631 23.5958C22.107 24.3788 23.6657 23.6403 23.6657 23.6403ZM19.7444 23.1677C19.7444 23.1684 19.7444 23.1684 19.7444 23.1677C19.745 23.169 19.745 23.169 19.745 23.1696C19.745 23.169 19.7444 23.1684 19.7444 23.1677ZM15.0088 12.3023C15.9599 11.1807 17.1304 10.2056 18.1784 9.65858C18.2145 9.6398 18.2532 9.67986 18.2336 9.71616C18.1502 9.87013 17.9901 10.1993 17.9392 10.4497C17.9313 10.4885 17.9729 10.5179 18.0048 10.4954C18.6573 10.0416 19.7916 9.55531 20.7875 9.49272C20.8304 9.49022 20.8506 9.54592 20.8169 9.57283C20.6654 9.69113 20.4999 9.85511 20.3791 10.021C20.3582 10.0491 20.3779 10.0898 20.4122 10.0898C21.1112 10.0948 22.0966 10.3446 22.7386 10.712C22.7821 10.737 22.7509 10.8227 22.7024 10.8115C21.7305 10.5843 20.1406 10.4115 18.488 10.8227C17.0133 11.1901 15.8875 11.7572 15.0665 12.3668C15.0254 12.3981 14.9757 12.3418 15.0088 12.3023Z",fill:"black"}));var s=Object(u.createElement)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(u.createElement)(a.Path,{d:"M3.25 12a8.75 8.75 0 1117.5 0 8.75 8.75 0 01-17.5 0zM12 4.75a7.25 7.25 0 100 14.5 7.25 7.25 0 000-14.5zm-1.338 4.877c-.314.22-.412.452-.412.623 0 .171.098.403.412.623.312.218.783.377 1.338.377.825 0 1.605.233 2.198.648.59.414 1.052 1.057 1.052 1.852 0 .795-.461 1.438-1.052 1.852-.41.286-.907.486-1.448.582v.316a.75.75 0 01-1.5 0v-.316a3.64 3.64 0 01-1.448-.582c-.59-.414-1.052-1.057-1.052-1.852a.75.75 0 011.5 0c0 .171.098.403.412.623.312.218.783.377 1.338.377s1.026-.159 1.338-.377c.314-.22.412-.452.412-.623 0-.171-.098-.403-.412-.623-.312-.218-.783-.377-1.338-.377-.825 0-1.605-.233-2.198-.648-.59-.414-1.052-1.057-1.052-1.852 0-.795.461-1.438 1.052-1.852a3.64 3.64 0 011.448-.582V7.5a.75.75 0 011.5 0v.316c.54.096 1.039.296 1.448.582.59.414 1.052 1.057 1.052 1.852a.75.75 0 01-1.5 0c0-.171-.098-.403-.412-.623-.312-.218-.783-.377-1.338-.377s-1.026.159-1.338.377z"}));var w=Object(u.createElement)(a.SVG,{xmlns:"http://www.w3.org/2000/svg"},Object(u.createElement)(a.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M14.75 9C16.1307 9 17.25 7.88071 17.25 6.5C17.25 5.11929 16.1307 4 14.75 4C13.3693 4 12.25 5.11929 12.25 6.5C12.25 5.11929 11.1307 4 9.75 4C8.36929 4 7.25 5.11929 7.25 6.5C7.25 7.88071 8.36929 9 9.75 9H4V20L20 20V9L14.75 9ZM14.75 7.5C15.3023 7.5 15.75 7.05228 15.75 6.5C15.75 5.94772 15.3023 5.5 14.75 5.5C14.1977 5.5 13.75 5.94772 13.75 6.5V7.5H14.75ZM18.5 18.5V10.5H13V18.5H18.5ZM11.5 18.5H5.5L5.5 10.5H11.5L11.5 18.5ZM8.75 6.5C8.75 7.05228 9.19772 7.5 9.75 7.5H10.75V6.5C10.75 5.94772 10.3023 5.5 9.75 5.5C9.19772 5.5 8.75 5.94772 8.75 6.5Z"}));var x=Object(u.createElement)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(u.createElement)(a.Path,{d:"M15.6 7.2H14v1.5h1.6c2 0 3.7 1.7 3.7 3.7s-1.7 3.7-3.7 3.7H14v1.5h1.6c2.8 0 5.2-2.3 5.2-5.2 0-2.9-2.3-5.2-5.2-5.2zM4.7 12.4c0-2 1.7-3.7 3.7-3.7H10V7.2H8.4c-2.9 0-5.2 2.3-5.2 5.2 0 2.9 2.3 5.2 5.2 5.2H10v-1.5H8.4c-2 0-3.7-1.7-3.7-3.7zm4.6.9h5.3v-1.5H9.3v1.5z"}));var m=Object(u.createElement)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(u.createElement)(a.Path,{d:"M17.5 9a2 2 0 11-4 0 2 2 0 014 0zm-4.25 8v-2a2.75 2.75 0 00-2.75-2.75h-4A2.75 2.75 0 003.75 15v2h1.5v-2c0-.69.56-1.25 1.25-1.25h4c.69 0 1.25.56 1.25 1.25v2h1.5zm7-2v2h-1.5v-2c0-.69-.56-1.25-1.25-1.25H15v-1.5h2.5A2.75 2.75 0 0120.25 15zM8.5 11a2 2 0 100-4 2 2 0 000 4z"}));var d=Object(u.createElement)(a.SVG,{xmlns:"http://www.w3.org/2000/svg"},Object(u.createElement)(a.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M15 16.5H9V15h6v1.5zM15.0052 5.99481c-1.6597-1.65973-4.3507-1.65973-6.0104 0-1.65973 1.65973-1.65973 4.35069 0 6.01039.29289.2929.29289.7678 0 1.0607-.2929.2929-.76777.2929-1.06066 0-2.24552-2.2455-2.24552-5.88624 0-8.13175 2.24556-2.24551 5.88616-2.24551 8.13176 0 2.2455 2.24551 2.2455 5.88625 0 8.13175-.2929.2929-.7678.2929-1.0607 0-.2929-.2929-.2929-.7678 0-1.0607 1.6597-1.6597 1.6597-4.35066 0-6.01039zM14 19.5h-4V18h4v1.5z"}));class k extends u.Component{render(){const M=Object(z.camelCase)(this.props.product);let e=A;return M in j&&(e=j[M]),Object(u.createElement)("div",{className:g()(this.props.className,"woocommerce-admin-marketing-product-icon")},Object(u.createElement)(y.a,{icon:e}))}}k.propTypes={product:n.a.string.isRequired,className:n.a.string};var Y=k,Q=t(172),U=t(169);t(275);const h=({children:M,animationKey:e,animate:t})=>{const[j,L]=Object(u.useState)(null),N=Object(u.useRef)(),c=g()("woocommerce-marketing-slider",t&&"animate-"+t),i={};j&&(i.height=j);const D=Object(z.debounce)(()=>{const M=N.current.querySelector(".woocommerce-marketing-slider__slide");L(M.clientHeight)},50);Object(u.useEffect)(()=>(window.addEventListener("resize",D),()=>{window.removeEventListener("resize",D)}),[]);return Object(u.createElement)("div",{className:c,ref:N,style:i},Object(u.createElement)(Q.a,null,Object(u.createElement)(U.a,{timeout:320,classNames:"slide",key:e,onEnter:()=>{const M=N.current.querySelector(".slide-enter");L(M.clientHeight)}},Object(u.createElement)("div",{className:"woocommerce-marketing-slider__slide"},M))))};h.propTypes={animationKey:n.a.any.isRequired,animate:n.a.oneOf([null,"left","right"])};var b=h},121:function(M,e,t){},162:function(M,e,t){"use strict";t.d(e,"a",(function(){return N}));var j=t(15),L=t(13);const N=(M,e={})=>{const{pathname:t,search:N}=window.location,u=Object(L.f)("connectNonce","");return e={"wccom-site":Object(L.f)("siteUrl"),"wccom-back":t+N,"wccom-woo-version":Object(L.f)("wcVersion"),"wccom-connect-nonce":u,...e},Object(j.addQueryArgs)(M,e)}},163:function(M,e,t){},170:function(M,e,t){"use strict";var j=t(35),L=t.n(j),N=t(0),u=t(2),c=t(14),i=t(6),g=t.n(i),D=t(7),I=t(1),n=t.n(I),y=(t(121),t(16)),z=t(102),a=t(162);const A=({title:M,description:e,url:t,product:j,category:L})=>{const u="woocommerce-marketing-recommended-extensions-item",c=Object(a.a)(t);return"coupons"===L&&"automatewoo"===j&&(j="automatewoo-alt"),Object(N.createElement)("a",{href:c,className:u,onClick:()=>{Object(y.recordEvent)("marketing_recommended_extension",{name:M})}},Object(N.createElement)(z.b,{product:j}),Object(N.createElement)("div",{className:u+"__text"},Object(N.createElement)("h4",null,M),Object(N.createElement)("p",null,e)))};A.propTypes={title:n.a.string.isRequired,description:n.a.string.isRequired,url:n.a.string.isRequired,product:n.a.string.isRequired,category:n.a.string.isRequired};var T=A;var r=()=>{const M="is-loading woocommerce-marketing-recommended-extensions-item";return Object(N.createElement)("div",{className:M,"aria-hidden":"true"},Object(N.createElement)("div",{className:"woocommerce-admin-marketing-product-icon is-placeholder"}),Object(N.createElement)("div",{className:M+"__text"},Object(N.createElement)("h4",{className:"is-placeholder","aria-hidden":"true"}),Object(N.createElement)("p",null,Object(N.createElement)("span",{className:"is-placeholder"}),Object(N.createElement)("span",{className:"is-placeholder"}),Object(N.createElement)("span",{className:"is-placeholder"}))))},S=t(46),O=t(77);const o=({extensions:M,isLoading:e,title:t,description:j,category:u})=>{if(0===M.length&&!e)return null;const c=u?"woocommerce-marketing-recommended-extensions-card__category-"+u:"";return Object(N.createElement)(O.a,{title:t,description:j,className:g()("woocommerce-marketing-recommended-extensions-card",c)},e?Object(N.createElement)("div",{className:g()("woocommerce-marketing-recommended-extensions-card__items","woocommerce-marketing-recommended-extensions-card__items--count-5")},[...Array(5).keys()].map(M=>Object(N.createElement)(r,{key:M}))):Object(N.createElement)("div",{className:g()("woocommerce-marketing-recommended-extensions-card__items","woocommerce-marketing-recommended-extensions-card__items--count-"+M.length)},M.map(M=>Object(N.createElement)(T,L()({key:M.product,category:u},M)))))};o.propTypes={extensions:n.a.arrayOf(n.a.object).isRequired,isLoading:n.a.bool.isRequired,title:n.a.string,description:n.a.string,category:n.a.string},o.defaultProps={title:Object(u.__)("Recommended extensions",'woocommerce'),description:Object(u.__)("Great marketing requires the right tools. Take your marketing to the next level with our recommended marketing extensions.",'woocommerce')};e.a=Object(c.compose)(Object(D.withSelect)((M,e)=>{const{getRecommendedPlugins:t,isResolving:j}=M(S.b);return{extensions:t(e.category),isLoading:j("getRecommendedPlugins",[e.category])}}),Object(D.withDispatch)(M=>{const{createNotice:e}=M("core/notices");return{createNotice:e}}))(o)},171:function(M,e,t){"use strict";var j=t(0),L=t(14),N=t(2),u=t(6),c=t.n(u),i=t(7),g=t(1),D=t.n(g),I=t(21),n=t(16),y=(t(163),t(102)),z=t(46),a=t(77),A=t(18),T=t.n(A);var r=()=>T()({mixedString:Object(N.__)("Read {{link}}the WooCommerce blog{{/link}} for more tips on marketing your store",'woocommerce'),components:{link:Object(j.createElement)(I.Link,{type:"external",href:"https://woocommerce.com/blog/marketing/coupons/?utm_medium=product",target:"_blank"})}});var S=M=>{const e="woocommerce-marketing-knowledgebase-card__post";return Object(j.createElement)("div",{className:"is-loading "+e,key:M,"aria-hidden":"true"},Object(j.createElement)("div",{className:e+"-img is-placeholder"}),Object(j.createElement)("div",{className:e+"-text"},Object(j.createElement)("h3",{className:"is-placeholder","aria-hidden":"true"}),Object(j.createElement)("p",{className:e+"-meta is-placeholder"})))};const O=({posts:M,isLoading:e,error:t,title:L,description:u,category:i})=>{const[g,D]=Object(j.useState)(1),[z,A]=Object(j.useState)(null),T=M=>{let e;M>g?(e="left",Object(n.recordEvent)("marketing_knowledge_carousel",{direction:"forward",page:M})):(e="right",Object(n.recordEvent)("marketing_knowledge_carousel",{direction:"back",page:M})),D(M),A(e)},O=()=>{const e=M.slice(2*(g-1),2*(g-1)+2),t=c()("woocommerce-marketing-knowledgebase-card__page",{"page-with-single-post":1===e.length}),L=e.map((M,e)=>Object(j.createElement)("a",{className:"woocommerce-marketing-knowledgebase-card__post",href:M.link,key:e,onClick:()=>{(M=>{Object(n.recordEvent)("marketing_knowledge_article",{title:M.title})})(M)},target:"_blank",rel:"noopener noreferrer"},M.image&&Object(j.createElement)("div",{className:"woocommerce-marketing-knowledgebase-card__post-img"},Object(j.createElement)("img",{src:M.image,alt:""})),Object(j.createElement)("div",{className:"woocommerce-marketing-knowledgebase-card__post-text"},Object(j.createElement)("h3",null,M.title),Object(j.createElement)("p",{className:"woocommerce-marketing-knowledgebase-card__post-meta"},Object(N.__)("By",'woocommerce')+" ",M.author_name,M.author_avatar&&Object(j.createElement)("img",{src:M.author_avatar.replace("s=96","s=32"),className:"woocommerce-gravatar",alt:"",width:"16",height:"16"})))));return Object(j.createElement)("div",{className:t},L)},o=i?"woocommerce-marketing-knowledgebase-card__category-"+i:"";return Object(j.createElement)(a.a,{title:L,description:u,className:c()("woocommerce-marketing-knowledgebase-card",o)},e?Object(j.createElement)("div",{className:"woocommerce-marketing-knowledgebase-card__posts"},Object(j.createElement)("div",{className:"woocommerce-marketing-knowledgebase-card__page"},Object(j.createElement)(S,null),Object(j.createElement)(S,null))):t?(()=>{const M=Object(N.__)("Oops, our posts aren't loading right now",'woocommerce');return Object(j.createElement)(I.EmptyContent,{title:M,message:Object(j.createElement)(r,null),illustration:"",actionLabel:""})})():0===M.length?(()=>{const M=Object(N.__)("No posts yet",'woocommerce');return Object(j.createElement)(I.EmptyContent,{title:M,message:Object(j.createElement)(r,null),illustration:"",actionLabel:""})})():Object(j.createElement)("div",{className:"woocommerce-marketing-knowledgebase-card__posts"},Object(j.createElement)(y.c,{animationKey:g,animate:z},O()),Object(j.createElement)(I.Pagination,{page:g,perPage:2,total:M.length,onPageChange:T,showPagePicker:!1,showPerPagePicker:!1,showPageArrowsLabel:!1})))};O.propTypes={posts:D.a.arrayOf(D.a.object).isRequired,isLoading:D.a.bool.isRequired,title:D.a.string,description:D.a.string,category:D.a.string},O.defaultProps={title:Object(N.__)("WooCommerce knowledge base",'woocommerce'),description:Object(N.__)("Learn the ins and outs of successful marketing from the experts at WooCommerce.",'woocommerce')};e.a=Object(L.compose)(Object(i.withSelect)((M,e)=>{const{getBlogPosts:t,getBlogPostsError:j,isResolving:L}=M(z.b);return{posts:t(e.category),isLoading:L("getBlogPosts",[e.category]),error:j(e.category)}}),Object(i.withDispatch)(M=>{const{createNotice:e}=M("core/notices");return{createNotice:e}}))(O)},272:function(M,e,t){},273:function(M,e,t){},274:function(M,e,t){},275:function(M,e,t){},276:function(M,e,t){"use strict";var j={};t.r(j),t.d(j,"receiveInstalledPlugins",(function(){return I})),t.d(j,"receiveActivatingPlugin",(function(){return n})),t.d(j,"removeActivatingPlugin",(function(){return y})),t.d(j,"receiveRecommendedPlugins",(function(){return z})),t.d(j,"receiveBlogPosts",(function(){return a})),t.d(j,"handleFetchError",(function(){return A})),t.d(j,"setError",(function(){return T})),t.d(j,"activateInstalledPlugin",(function(){return r})),t.d(j,"loadInstalledPluginsAfterActivation",(function(){return S}));var L={};t.r(L),t.d(L,"getInstalledPlugins",(function(){return O})),t.d(L,"getActivatingPlugins",(function(){return o})),t.d(L,"getRecommendedPlugins",(function(){return E})),t.d(L,"getBlogPosts",(function(){return l})),t.d(L,"getBlogPostsError",(function(){return C}));var N={};t.r(N),t.d(N,"getRecommendedPlugins",(function(){return s})),t.d(N,"getBlogPosts",(function(){return w}));var u=t(10),c=t(7),i=t(46),g=t(2);var D={SET_INSTALLED_PLUGINS:"SET_INSTALLED_PLUGINS",SET_ACTIVATING_PLUGIN:"SET_ACTIVATING_PLUGIN",REMOVE_ACTIVATING_PLUGIN:"REMOVE_ACTIVATING_PLUGIN",SET_RECOMMENDED_PLUGINS:"SET_RECOMMENDED_PLUGINS",SET_BLOG_POSTS:"SET_BLOG_POSTS",SET_ERROR:"SET_ERROR"};function I(M){return{type:D.SET_INSTALLED_PLUGINS,plugins:M}}function n(M){return{type:D.SET_ACTIVATING_PLUGIN,pluginSlug:M}}function y(M){return{type:D.REMOVE_ACTIVATING_PLUGIN,pluginSlug:M}}function z(M,e){return{type:D.SET_RECOMMENDED_PLUGINS,data:{plugins:M,category:e}}}function a(M,e){return{type:D.SET_BLOG_POSTS,data:{posts:M,category:e}}}function A(M,e){const{createNotice:t}=Object(c.dispatch)("core/notices");t("error",e),console.log(M)}function T(M,e){return{type:D.SET_ERROR,category:M,error:e}}function*r(M){const{createNotice:e}=Object(c.dispatch)("core/notices");yield n(M);try{if(!(yield Object(u.apiFetch)({path:i.a+"/overview/activate-plugin",method:"POST",data:{plugin:M}})))throw new Error;yield e("success",Object(g.__)("The extension has been successfully activated.",'woocommerce')),yield S(M)}catch(e){yield A(e,Object(g.__)("There was an error trying to activate the extension.",'woocommerce')),yield y(M)}return!0}function*S(M){try{const e=yield Object(u.apiFetch)({path:i.a+"/overview/installed-plugins"});if(!e)throw new Error;yield I(e),yield y(M)}catch(M){yield A(M,Object(g.__)("There was an error loading installed extensions.",'woocommerce'))}}function O(M){return M.installedPlugins}function o(M){return M.activatingPlugins}function E(M,e){return M.recommendedPlugins[e]||[]}function l(M,e){return M.blogPosts[e]||[]}function C(M,e){return M.errors.blogPosts&&M.errors.blogPosts[e]}function*s(M){try{const e=yield M?"&category="+M:"",t=yield Object(u.apiFetch)({path:`${i.a}/recommended?per_page=6${e}`});if(!t)throw new Error;yield z(t,M)}catch(M){yield A(M,Object(g.__)("There was an error loading recommended extensions.",'woocommerce'))}}function*w(M){try{const e=yield M?"?category="+M:"",t=yield Object(u.apiFetch)({path:`${i.a}/knowledge-base${e}`,method:"GET"});if(!t)throw new Error;yield a(t,M)}catch(e){yield T(M,e)}}var x=t(13),m=t(4);const{installedExtensions:d}=Object(x.f)("marketing",{}),k={installedPlugins:d,activatingPlugins:[],recommendedPlugins:{},blogPosts:{},errors:{}};var Y=(M=k,e)=>{switch(e.type){case D.SET_INSTALLED_PLUGINS:return{...M,installedPlugins:e.plugins};case D.SET_ACTIVATING_PLUGIN:return{...M,activatingPlugins:[...M.activatingPlugins,e.pluginSlug]};case D.REMOVE_ACTIVATING_PLUGIN:return{...M,activatingPlugins:Object(m.without)(M.activatingPlugins,e.pluginSlug)};case D.SET_RECOMMENDED_PLUGINS:return{...M,recommendedPlugins:{...M.recommendedPlugins,[e.data.category]:e.data.plugins}};case D.SET_BLOG_POSTS:return{...M,blogPosts:{...M.blogPosts,[e.data.category]:e.data.posts}};case D.SET_ERROR:return{...M,errors:{...M.errors,blogPosts:{...M.errors.blogPosts,[e.category]:e.error}}};default:return M}};Object(c.registerStore)(i.b,{actions:j,selectors:L,resolvers:N,controls:u.controls,reducer:Y})},46:function(M,e,t){"use strict";t.d(e,"b",(function(){return j})),t.d(e,"a",(function(){return L}));const j="wc/marketing",L="/wc-admin/marketing"},564:function(M,e,t){},565:function(M,e,t){},566:function(M,e,t){"use strict";var j=Object.assign||function(M){for(var e,t=1;t<arguments.length;t++)for(var j in e=arguments[t])Object.prototype.hasOwnProperty.call(e,j)&&(M[j]=e[j]);return M};Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(M){var e=M.size,t=void 0===e?24:e,L=M.onClick,N=(M.icon,M.className),c=function(M,e){var t={};for(var j in M)0<=e.indexOf(j)||Object.prototype.hasOwnProperty.call(M,j)&&(t[j]=M[j]);return t}(M,["size","onClick","icon","className"]),i=["gridicon","gridicons-cross",N,!1,!1,!1].filter(Boolean).join(" ");return u.default.createElement("svg",j({className:i,height:t,width:t,onClick:L},c,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"}),u.default.createElement("g",null,u.default.createElement("path",{d:"M18.36 19.78L12 13.41l-6.36 6.37-1.42-1.42L10.59 12 4.22 5.64l1.42-1.42L12 10.59l6.36-6.36 1.41 1.41L13.41 12l6.36 6.36z"})))};var L,N=t(5),u=(L=N)&&L.__esModule?L:{default:L};M.exports=e.default},567:function(M,e,t){},568:function(M,e){M.exports="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMzEiIGhlaWdodD0iMTY1IiBmaWxsPSJub25lIj4KICA8ZGVmcy8+CiAgPGcgY2xpcC1wYXRoPSJ1cmwoI2NsaXAwKSI+CiAgICA8cGF0aCBmaWxsPSIjRjJGMkYyIiBkPSJNMjMxIDk5LjI2M2MwIDI4LjgyOS0xNy4yMSAzOC44OTUtMzguNDM4IDM4Ljg5NS0yMS4yMjkgMC0zOC40MzktMTAuMDY2LTM4LjQzOS0zOC44OTUgMC0yOC44MyAzOC40MzktNjUuNTA1IDM4LjQzOS02NS41MDVTMjMxIDcwLjQzMyAyMzEgOTkuMjYzeiIvPgogICAgPHBhdGggZmlsbD0iIzNGM0Q1NiIgZD0iTTE5MS4xNjEgMTMzLjc0OGwuMzk0LTI0LjEyNyAxNi4zODMtMjkuODUtMTYuMzIxIDI2LjA2NS4xNzctMTAuODQ5IDExLjI5MS0yMS41OTYtMTEuMjQ1IDE4LjcyNS4zMTktMTkuNTEyIDEyLjA5MS0xNy4xOTMtMTIuMDQxIDE0LjEyNS4xOTgtMzUuNzc4LTEuMjQ5IDQ3LjM2My4xMDItMS45NTMtMTIuMjkzLTE4Ljc0IDEyLjA5NiAyMi40OS0xLjE0NSAyMS43OTItLjAzNC0uNTc4LTE0LjE3Mi0xOS43MiAxNC4xMjkgMjEuNzYzLS4xNDMgMi43MjUtLjAyNi4wNDEuMDEyLjIyNC0yLjkwNiA1NS4yODdoMy44ODJsLjQ2Ni0yOC41NTcgMTQuMDk0LTIxLjcxLTE0LjA1OSAxOS41NjN6Ii8+CiAgICA8cGF0aCBmaWxsPSIjRjJGMkYyIiBkPSJNMjAuNzkgMTQ3LjAyNWMwIDcuNzk2LTQuNjU0IDEwLjUxOC0xMC4zOTUgMTAuNTE4UzAgMTU0LjgyMSAwIDE0Ny4wMjVjMC03Ljc5NiAxMC4zOTUtMTcuNzE0IDEwLjM5NS0xNy43MTRzMTAuMzk0IDkuOTE4IDEwLjM5NCAxNy43MTR6Ii8+CiAgICA8cGF0aCBmaWxsPSIjM0YzRDU2IiBkPSJNMTAuMDE2IDE1Ni4zNTFsLjEwNi02LjUyNSA0LjQzLTguMDcyLTQuNDEzIDcuMDQ4LjA0OC0yLjkzMyAzLjA1My01Ljg0LTMuMDQgNS4wNjMuMDg1LTUuMjc2IDMuMjctNC42NDktMy4yNTYgMy44MTkuMDU0LTkuNjc1LS4zMzggMTIuODA4LjAyNy0uNTI4LTMuMzI0LTUuMDY4IDMuMjcxIDYuMDgyLS4zMSA1Ljg5My0uMDA5LS4xNTYtMy44MzItNS4zMzMgMy44MiA1Ljg4NS0uMDM4LjczNy0uMDA3LjAxMS4wMDMuMDYxLS43ODYgMTQuOTUxaDEuMDVsLjEyNi03LjcyMyAzLjgxMi01Ljg3MS0zLjgwMiA1LjI5MXoiLz4KICAgIDxwYXRoIHN0cm9rZT0iIzNGM0Q1NiIgc3Ryb2tlLW1pdGVybGltaXQ9IjEwIiBzdHJva2Utd2lkdGg9IjIiIGQ9Ik0xIDE2NWgyMzAiLz4KICAgIDxwYXRoIGZpbGw9IiMwNzdDQjIiIGQ9Ik0yMTAuODQ1IDE1Ny42NjZjMCA1LjI3My0zLjE0OCA3LjExNS03LjAzMSA3LjExNWExMi4xNTMgMTIuMTUzIDAgMDEtLjgwNC0uMDI4Yy0zLjUwNC0uMjQ3LTYuMjI3LTIuMTgzLTYuMjI3LTcuMDg3IDAtNS4wNzUgNi41MTMtMTEuNDc5IDcuMDAyLTExLjk1M2wuMDAxLS4wMDEuMDI4LS4wMjdzNy4wMzEgNi43MDggNy4wMzEgMTEuOTgxeiIvPgogICAgPHBhdGggZmlsbD0iIzNGM0Q1NiIgZD0iTTIwMy41NTcgMTYzLjk3NGwyLjU3Mi0zLjU3OS0yLjU3OCAzLjk3Mi0uMDA3LjQxYy0uMTgtLjAwMy0uMzU4LS4wMTItLjUzNC0uMDI0bC4yNzctNS4yNzYtLjAwMi0uMDQxLjAwNS0uMDA3LjAyNi0uNDk4LTIuNTg1LTMuOTgyIDIuNTkzIDMuNjA4LjAwNi4xMDYuMjA5LTMuOTg3LTIuMjEyLTQuMTEzIDIuMjM5IDMuNDE0LjIxOC04LjI2NC4wMDEtLjAyOHYuMDI3bC0uMDM2IDYuNTE3IDIuMjAyLTIuNTg0LTIuMjExIDMuMTQ1LS4wNTggMy41NjkgMi4wNTYtMy40MjUtMi4wNjUgMy45NS0uMDMzIDEuOTg0IDIuOTg2LTQuNzY3LTIuOTk3IDUuNDYtLjA3MiA0LjQxM3pNMTM1Ljg4MSAzNy4zNGgtMS4zNWEuNTQuNTQgMCAwMC0uNTQuNTM4djE4Ljg3OGEuNTQuNTQgMCAwMC41NC41MzhoMS4zNWMuMjk5IDAgLjU0LS4yNDEuNTQtLjUzOFYzNy44NzhhLjUzOC41MzggMCAwMC0uNTQtLjUzOHpNNTQuMjEyIDIxLjcwOGgtLjY1NmEuMzU0LjM1NCAwIDAwLS4zNTQuMzUzdjUuODYzYzAgLjE5NS4xNTkuMzUzLjM1NC4zNTNoLjY1NmEuMzU0LjM1NCAwIDAwLjM1NC0uMzUzdi01Ljg2M2EuMzU0LjM1NCAwIDAwLS4zNTQtLjM1M3pNNTQuMjkxIDMzLjczNWgtLjczOGMtLjIyIDAtLjQuMTc4LS40LjM5OFY0NC43N2MwIC4yMi4xOC4zOTguNC4zOThoLjczOGMuMjIgMCAuNC0uMTc4LjQtLjM5OFYzNC4xMzJhLjM5OS4zOTkgMCAwMC0uNC0uMzk3ek01NC4yNiA0OS4xN2gtLjcwMmEuMzguMzggMCAwMC0uMzguMzc4djEwLjc3NWMwIC4yMS4xNy4zNzkuMzguMzc5aC43MDNjLjIxIDAgLjM4LS4xNy4zOC0uMzc5VjQ5LjU0OGEuMzguMzggMCAwMC0uMzgtLjM3OXoiLz4KICAgIDxwYXRoIGZpbGw9IiMzRjNENTYiIGQ9Ik0xMjYuODkyIDBINjIuMzg3Yy00LjY0NSAwLTguNDExIDMuNzUtOC40MTEgOC4zNzdWMTU2LjIzYzAgNC42MjcgMy43NjYgOC4zNzcgOC40MTEgOC4zNzdoNjQuNTA1YzQuNjQ2IDAgOC40MTItMy43NSA4LjQxMi04LjM3N1Y4LjM3N2MwLTQuNjI2LTMuNzY2LTguMzc3LTguNDEyLTguMzc3eiIvPgogICAgPHBhdGggZmlsbD0iI0U2RThFQyIgZD0iTTk3LjU1MiA0LjkxNkg4Ny4zOTNjLS4zMyAwLS42LjI2Ny0uNi41OTZ2MS4xMDRjMCAuMzMuMjcuNTk2LjYuNTk2aDEwLjE1OWMuMzMgMCAuNTk5LS4yNjcuNTk5LS41OTZWNS41MTJhLjU5OC41OTggMCAwMC0uNTk5LS41OTZ6TTEwMS4xNzYgNy4zNjdjLjcyMyAwIDEuMzA4LS41ODQgMS4zMDgtMS4zMDMgMC0uNzItLjU4NS0xLjMwMy0xLjMwOC0xLjMwMy0uNzIyIDAtMS4zMDguNTg0LTEuMzA4IDEuMzAzIDAgLjcyLjU4NiAxLjMwMyAxLjMwOCAxLjMwM3oiLz4KICAgIDxwYXRoIGZpbGw9IiNmZmYiIGQ9Ik0xMzAuMjgxIDEwLjcydjE0My4xNjhhNi40MTkgNi40MTkgMCAwMS0xLjg5MiA0LjU0OCA2LjQ4IDYuNDggMCAwMS00LjU2NyAxLjg4M0g2NS40NTdhNi40NzcgNi40NzcgMCAwMS00LjU2Ni0xLjg4MyA2LjQyIDYuNDIgMCAwMS0xLjg5My00LjU0OFYxMC43MjFhNi40MSA2LjQxIDAgMDExLjg5Mi00LjU1IDYuNDYyIDYuNDYyIDAgMDE0LjU2Ny0xLjg4M2g4LjczNHYxLjExN2MwIDEuNDA1LjU2MSAyLjc1MiAxLjU1OCAzLjc0NWE1LjMzMiA1LjMzMiAwIDAwMy43NjEgMS41NTJoMjkuNjgyYzEuNDEgMCAyLjc2My0uNTU4IDMuNzYxLTEuNTUxYTUuMjg4IDUuMjg4IDAgMDAxLjU1OC0zLjc0NlY0LjI4OGg5LjMxMWE2LjQ4NCA2LjQ4NCAwIDAxNC41NjcgMS44ODQgNi40MjEgNi40MjEgMCAwMTEuODkyIDQuNTQ5eiIvPgogICAgPHBhdGggZmlsbD0iI0YyRjJGMiIgZD0iTTEzMC4zMjEgMzcuNDc3SDU4LjkxNXY4MS42NzNoNzEuNDA2VjM3LjQ3N3oiLz4KICAgIDxwYXRoIGZpbGw9IiNGRjY1ODQiIGQ9Ik02NC4xIDEzMC40NTJsLS4zNzctLjMzOGMtMS4zMzUtMS4yMjEtMi4yMTYtMi4wMTMtMi4yMTYtM2ExLjM5MyAxLjM5MyAwIDAxLjQxLTEuMDE0IDEuNDEzIDEuNDEzIDAgMDExLjAxNi0uNDE0IDEuNTM4IDEuNTM4IDAgMDExLjE2Ni41NDUgMS41NCAxLjU0IDAgMDExLjE2Ny0uNTQ1IDEuNDAxIDEuNDAxIDAgMDExLjAxNi40MTQgMS4zOTQgMS4zOTQgMCAwMS40MSAxLjAxNGMwIC45ODctLjg4MiAxLjc3OS0yLjIxNyAzbC0uMzc2LjMzOHoiLz4KICAgIDxwYXRoIGZpbGw9IiNGMkYyRjIiIGQ9Ik03Ny43MjggMTI5LjIwM2wuNzI3LjIwN2EyLjQzOCAyLjQzOCAwIDAxMS42NjUtMS41NTggMi40NjMgMi40NjMgMCAwMTIuMjMyLjQ4NmwtMS4xMSAxLjA3MmgyLjc3di0yLjY4MmwtMS4xMTYgMS4wNjVhMy4yMjYgMy4yMjYgMCAwMC0yLjk2NC0uNjc5IDMuMjAyIDMuMjAyIDAgMDAtMi4yMDQgMi4wODl6Ii8+CiAgICA8cGF0aCBmaWxsPSIjMDc3Q0IyIiBkPSJNNjMuNjI4IDMxLjM3NWMxLjgyMyAwIDMuMy0xLjQ3IDMuMy0zLjI4NWEzLjI5MiAzLjI5MiAwIDAwLTMuMy0zLjI4NiAzLjI5MiAzLjI5MiAwIDAwLTMuMjk5IDMuMjg2IDMuMjkyIDMuMjkyIDAgMDAzLjMgMy4yODV6TTEwMC4xNTYgMjYuMjEySDY5LjUxOXYzLjc1NWgzMC42Mzd2LTMuNzU1eiIvPgogICAgPHBhdGggZmlsbD0iI0YyRjJGMiIgZD0iTTkyLjE0NCAxMzYuMDQ4SDYxLjUwOHYzLjc1NWgzMC42MzZ2LTMuNzU1ek0xMjYuMzE1IDE0NC4yMzRINjEuNTA4djMuNzU1aDY0LjgwN3YtMy43NTV6TTc0LjcwNSAxMzAuMjE0bC0uODEyLTEuNDE1YTIuMDggMi4wOCAwIDAwLS44NjYtMi41OTcgMi4xIDIuMSAwIDAwLTIuNzA0LjQ4OSAyLjA4NSAyLjA4NSAwIDAwMS40MjMgMy4zODIgMi4xIDIuMSAwIDAwMS40Mi0uMzdsMS41MzkuNTExeiIvPgogICAgPHBhdGggZmlsbD0iIzJGMkU0MSIgZD0iTTg4LjU3NiA1Ni42MzJhOS40NDkgOS40NDkgMCAwMC0zLjM5IDEuNDIgOS40MDggOS40MDggMCAwMC0yLjU4NyAyLjYwNSA5LjM2NSA5LjM2NSAwIDAwLTEuMzY4IDcuMDU0bDEuOTQ1IDkuNDY4IDIuMTc4LS40NDQuMTU0LTEuMDAzLjQ1Ni44NzkgMTMuMjQzLTIuNy4xNTQtMS4wMDMuNDU2Ljg4IDEuODI5LS4zNzMtMS45NDUtOS40NjhhOS4zNjYgOS4zNjYgMCAwMC0xLjQyNy0zLjM3NiA5LjQwOCA5LjQwOCAwIDAwLTIuNjE1LTIuNTc2IDkuNDUgOS40NSAwIDAwLTcuMDgzLTEuMzYzeiIvPgogICAgPHBhdGggZmlsbD0iIzlGNjE2QSIgZD0iTTEwNC45ODcgODUuNjc4bDExLjMxMiA2LjgwNi0xLjQxNCAzLjI4Ni0xMC42MDUtNC45MjguNzA3LTUuMTYzeiIvPgogICAgPHBhdGggZmlsbD0iIzA3N0NCMiIgZD0iTTkwLjYxMiA5My40MjNzLTIyLjg2IDAtMjYuNjMgNS44NjhjLTMuNzcgNS44NjctLjcwNyAxNC4wODEgMTEuMDc2IDE1Ljk1OSAxMS43ODMgMS44NzcgNDcuNjA0IDIuODE2IDUwLjQzMi00LjIyNSAyLjgyOC03LjA0LjcwNy0xMS4wMy43MDctMTEuMDNzLTEyLjI1NS04LjQ1LTM1LjU4NS02LjU3MnoiLz4KICAgIDxwYXRoIGZpbGw9IiMwNzdDQjIiIGQ9Ik0xMTAuODc4IDk5LjA1NmwxMi40OTEgNC42OTRzNS4xODQtMy43NTUgMi41OTItNy45OGMtMi41OTItNC4yMjQtMTQuMzc2LTI4LjYzMi0xNC4zNzYtMjguNjMycy0zLjI5OS00LjY5NC45NDMtNy4yNzZjNC4yNDItMi41ODEgNS44OTIgMS42NDMgNS44OTIgMS42NDNzLS4yMzYuOTM5IDEuNDE0LjIzNWMxLjY0OS0uNzA0IDQuNzEzIDEuNjQzIDMuMDYzIDUuMzk4LTEuNjQ5IDMuNzU1LTIuODI4IDQuNjk0LjcwNyA0LjQ1OSAxLjI3Ny0uMDg1IDIuNC0uOTk2IDMuMzEzLTIuMTI1IDEuNzUyLTIuMTY1Ljk3LTMuOTEuODM3LTYuNjg2LS4yMjctNC43NTctLjU5OC03Ljg2LTEuNzkzLTkuNzMtMS42NS0yLjU4MS00LjAwNi00LjY5NC0xMC4xMzQtMy41Mi02LjEyNyAxLjE3My0xNS4wODIgNy4wNC0xMi45NjEgMTUuNDkgMi4xMjEgOC40NDkgNi44MzQgMTcuODM2IDYuODM0IDE3LjgzNnMzLjI5OSAxMy4xNDMgMS4xNzggMTYuMTk0eiIvPgogICAgPHBhdGggZmlsbD0iIzAwMCIgZD0iTTExMC44NzggOTkuMDU2Yy0yLjAzNi41NTktNC41OTMuODMtNy4zNDUuOTE1LTQuODAzLjE0OC0xMC4yMS0uMjc0LTE0LjUyNi0uNzUzLTQuNjY0LS41MTktOC4wNTgtMS4xLTguMDU4LTEuMSAxLjU3Ny0xLjQ2NSA0LTIuMDQ1IDYuODQ2LTIuMjU2IDMuNTM1LS4yNjMgNy43MjUuMDM3IDExLjc3Mi0uMDkyYTIwLjQxIDIwLjQxIDAgMDE0LjQ1MS4zMzRjNC40NjQuODQ3IDYuODYgMi45NTIgNi44NiAyLjk1MnoiIG9wYWNpdHk9Ii4xIi8+CiAgICA8cGF0aCBmaWxsPSIjOUY2MTZBIiBkPSJNOTAuNDk0IDczLjgyNmMzLjY0NCAwIDYuNTk5LTIuOTQyIDYuNTk5LTYuNTcgMC0zLjYzLTIuOTU1LTYuNTcyLTYuNTk5LTYuNTcycy02LjU5OSAyLjk0Mi02LjU5OSA2LjU3MWMwIDMuNjMgMi45NTUgNi41NzIgNi41OTkgNi41NzJ6Ii8+CiAgICA8cGF0aCBmaWxsPSIjOUY2MTZBIiBkPSJNODkuNjcgNzIuNTM2czEuMTc4IDQuNDU5IDAgNC42OTRjLTEuMTc5LjIzNC00LjAwNyAxLjQwOC00LjAwNyAxLjQwOGwzLjUzNSAxLjQwOCA2LjU5OSA2LjEwMiA1LjY1NSAyLjgxNiAyLjgyOC0uOTM5di01LjE2M2wtNC4yNDItNi41NzFzLTIuODI4LjkzOS0zLjUzNC0yLjExMmMtLjcwNy0zLjA1MS0yLjEyMS00LjIyNS0yLjEyMS00LjIyNWwtNC43MTQgMi41ODJ6Ii8+CiAgICA8cGF0aCBmaWxsPSIjOUY2MTZBIiBkPSJNODguMDIgNzguODcySDg1LjE5cy00Ljk0OSAxLjY0My03Ljc3NyA1LjM5OGMtMi44MjggMy43NTUtNy4zMDUgNy41MS03LjMwNSA3LjUxcy0zLjA2NCA0LjIyNS0xLjQxNCAxMC4wOTJjMS42NSA1Ljg2OCA0LjAwNiAxMC4wOTIgNi4xMjcgOC45MTkgMi4xMjEtMS4xNzQtMy4wNjQtOS42MjMtMy4wNjQtOS42MjNsMS40MTQtNS4xNjNzNy4zMDYtOC40NDkgMTAuMzctOC4yMTRjMy4wNjMuMjM0IDMuMjk5IDIuODE2IDMuMjk5IDIuODE2bDYuNTk4IDEuODc4IDIuMTIxLTQuNDYtMS4xNzgtNC42OTMtNi4zNjMtNC40NnoiLz4KICAgIDxwYXRoIGZpbGw9IiMzRjNENTYiIGQ9Ik0xMDQuOTg3IDkzLjY1OGE4LjY2OCA4LjY2OCAwIDAwLS45NjggMi40NDYgMTkuMDE4IDE5LjAxOCAwIDAwLS40ODYgMy44NjdjLTQuODAyLjE0OC0xMC4yMDktLjI3NC0xNC41MjYtLjc1My0uMzgyLTEuMDE0LS44MDEtMi4xOC0xLjIxMS0zLjM1Ni0xLjEwNi0zLjE3OC0yLjEzMy02LjQyMS0yLjEzMy02Ljg5OCAwLS45MzkgNC45NDkuNzA0IDYuMTI3LjQ3IDEuMTc5LS4yMzUgMS42NS0zLjk5IDAtNS44NjgtMS42NS0xLjg3Ny02LjQ4LTUuMDQ2LTYuNDgtNS4wNDZsMS42NS0uNDY5czMuNjUyIDIuNjk5IDExLjE5MyA3LjE1OGM3LjU0MSA0LjQ2IDQuNDc4LTIuNTgxIDQuNDc4LTIuNTgxbC00LjM2LTYuNjloMS44ODVzMy42NTMgNi4yMiA1LjUzOCA5LjAzN2MxLjg4NiAyLjgxNiAxLjE3OSA1LjYzMi0uNzA3IDguNjgzeiIvPgogICAgPHBhdGggZmlsbD0iIzJGMkU0MSIgZD0iTTk1LjE2MyA1OC4zOWwtMTEuOTUxIDIuNDM1IDEuNSA3LjMwNCAxMS45NTItMi40MzYtMS41LTcuMzAzeiIvPgogICAgPHBhdGggZmlsbD0iIzNGM0Q1NiIgZD0iTTEyMC44OTQgNTkuMjc2YTMuNTI3IDMuNTI3IDAgMDAzLjUzNS0zLjUyIDMuNTI3IDMuNTI3IDAgMDAtMy41MzUtMy41MjEgMy41MjggMy41MjggMCAwMC0zLjUzNSAzLjUyIDMuNTI4IDMuNTI4IDAgMDAzLjUzNSAzLjUyeiIvPgogICAgPHBhdGggZmlsbD0iI2ZmZiIgZD0iTTEyMC44OTQgNTcuNjMzYzEuMDQxIDAgMS44ODUtLjg0IDEuODg1LTEuODc4YTEuODgxIDEuODgxIDAgMDAtMS44ODUtMS44NzdjLTEuMDQxIDAtMS44ODUuODQtMS44ODUgMS44NzdzLjg0NCAxLjg3OCAxLjg4NSAxLjg3OHoiLz4KICAgIDxwYXRoIGZpbGw9IiMwNzdDQjIiIGQ9Ik0xNy4xNDIgOTYuMzkxbC0uMjQxIDEuODUyYy0uMDgyLjYyNy0uMTYzIDEuMjU0LS4yMDcgMS44ODUtLjE0NiAyLjA5OC4xMjYgNC4yMDUuMDU0IDYuMzA3LS4wNTUgMS42MTgtLjMxNCAzLjIzNS0uMTg5IDQuODQ5LjExIDEuNDI4LjUxOSAyLjgxNS45MjUgNC4xODlsLjU4IDEuOTYzYS4zNzcuMzc3IDAgMDAuMTc1LjI5MmMuMDUuMDMyLjEwNi4wNTIuMTY1LjA1OGEuMzguMzggMCAwMC4xNzQtLjAybDIuNTY2LS4yMzJjLS4xNjQtLjc1LS4zNDctMS41MzMtLjQzNS0yLjI5Ni0uMDctLjYwNC0uMTEyLTEuMjEtLjE1Ni0xLjgxNmE1OTMuNzMgNTkzLjczIDAgMDAtLjQ0Ni01LjY2NGwtLjI3MS0zLjMxNmMtLjExOC0xLjQzOC0uMjM3LTIuODg1LS42MDEtNC4yODJhOC41MTggOC41MTggMCAwMC0yLjA5My0zLjc2OXoiLz4KICAgIDxwYXRoIGZpbGw9IiMwMDAiIGQ9Ik0xNy4xNDIgOTYuMzkxbC0uMjQxIDEuODUyYy0uMDgyLjYyNy0uMTYzIDEuMjU0LS4yMDcgMS44ODUtLjE0NiAyLjA5OC4xMjYgNC4yMDUuMDU0IDYuMzA3LS4wNTUgMS42MTgtLjMxNCAzLjIzNS0uMTg5IDQuODQ5LjExIDEuNDI4LjUxOSAyLjgxNS45MjUgNC4xODlsLjU4IDEuOTYzYS4zNzcuMzc3IDAgMDAuMTc1LjI5MmMuMDUuMDMyLjEwNi4wNTIuMTY1LjA1OGEuMzguMzggMCAwMC4xNzQtLjAybDIuNTY2LS4yMzJjLS4xNjQtLjc1LS4zNDctMS41MzMtLjQzNS0yLjI5Ni0uMDctLjYwNC0uMTEyLTEuMjEtLjE1Ni0xLjgxNmE1OTMuNzMgNTkzLjczIDAgMDAtLjQ0Ni01LjY2NGwtLjI3MS0zLjMxNmMtLjExOC0xLjQzOC0uMjM3LTIuODg1LS42MDEtNC4yODJhOC41MTggOC41MTggMCAwMC0yLjA5My0zLjc2OXoiIG9wYWNpdHk9Ii4xIi8+CiAgICA8cGF0aCBmaWxsPSIjM0YzRDU2IiBkPSJNMjEuNzE0IDE1OS44OTZhNy40OTMgNy40OTMgMCAwMC0uMzk0LjkxMmMtLjI5NC44NjEtLjM0IDEuNzg1LS4zODEgMi42OTQtLjAyLjE3NS0uMDA0LjM1My4wNDguNTIyLjEyNi4zMjcuNDkuNDkyLjgyOS41ODMgMS40MjEuMzgxIDIuOTIuMDIzIDQuMzg3LS4xMDggMS40MzktLjEyOCAyLjkwNS0uMDM1IDQuMzE0LS4zNTIuMjA5LS4wMzkuNDEtLjEwOC41OTgtLjIwNi4zNTctLjIzMi42MjQtLjU3OC43NTUtLjk4Mi4wNDMtLjEwNC4wNzItLjIxMi4wODYtLjMyMy4wNDYtLjQ3OC0uMzcyLS44OTQtLjgyOC0xLjA1MS0uNDU3LS4xNTctLjk1Mi0uMTMyLTEuNDMzLS4xODFhNC41MjQgNC41MjQgMCAwMS0yLjYzNi0xLjIwMSA0LjQ5MyA0LjQ5MyAwIDAxLTEuMzU4LTIuNTUxYy0uMDE4LS4xMDUtMi4zNzQtLjA0My0yLjYyMi4wOTItLjI5LjE1OS0uNDY2LjU1NS0uNjMuODIzLS4yNjQuNDMyLS41MS44NzUtLjczNSAxLjMyOXoiLz4KICAgIDxwYXRoIGZpbGw9IiMwMDAiIGQ9Ik0yMS43MTQgMTU5Ljg5NmE3LjQ5MyA3LjQ5MyAwIDAwLS4zOTQuOTEyYy0uMjk0Ljg2MS0uMzQgMS43ODUtLjM4MSAyLjY5NC0uMDIuMTc1LS4wMDQuMzUzLjA0OC41MjIuMTI2LjMyNy40OS40OTIuODI5LjU4MyAxLjQyMS4zODEgMi45Mi4wMjMgNC4zODctLjEwOCAxLjQzOS0uMTI4IDIuOTA1LS4wMzUgNC4zMTQtLjM1Mi4yMDktLjAzOS40MS0uMTA4LjU5OC0uMjA2LjM1Ny0uMjMyLjYyNC0uNTc4Ljc1NS0uOTgyLjA0My0uMTA0LjA3Mi0uMjEyLjA4Ni0uMzIzLjA0Ni0uNDc4LS4zNzItLjg5NC0uODI4LTEuMDUxLS40NTctLjE1Ny0uOTUyLS4xMzItMS40MzMtLjE4MWE0LjUyNCA0LjUyNCAwIDAxLTIuNjM2LTEuMjAxIDQuNDkzIDQuNDkzIDAgMDEtMS4zNTgtMi41NTFjLS4wMTgtLjEwNS0yLjM3NC0uMDQzLTIuNjIyLjA5Mi0uMjkuMTU5LS40NjYuNTU1LS42My44MjMtLjI2NC40MzItLjUxLjg3NS0uNzM1IDEuMzI5eiIgb3BhY2l0eT0iLjEiLz4KICAgIDxwYXRoIGZpbGw9IiMzRjNENTYiIGQ9Ik0yNS42MjEgMTYwLjExOWE3LjU0NyA3LjU0NyAwIDAwLS4zOTQuOTExYy0uMjk0Ljg2Mi0uMzM5IDEuNzg1LS4zOCAyLjY5NGExLjI4IDEuMjggMCAwMC4wNDcuNTIyYy4xMjYuMzI3LjQ5LjQ5My44MjkuNTg0IDEuNDIxLjM4MSAyLjkyLjAyMiA0LjM4Ny0uMTA4IDEuNDM5LS4xMjkgMi45MDUtLjAzNiA0LjMxNS0uMzUyLjIwOC0uMDM5LjQxLS4xMDkuNTk3LS4yMDdhMS44NSAxLjg1IDAgMDAuNzU1LS45ODJjLjA0My0uMTAzLjA3Mi0uMjEyLjA4Ni0uMzIyLjA0Ni0uNDc5LS4zNzItLjg5NC0uODI4LTEuMDUyLS40NTYtLjE1Ny0uOTUyLS4xMzEtMS40MzItLjE4YTQuNTI1IDQuNTI1IDAgMDEtMi42MzctMS4yMDIgNC40OSA0LjQ5IDAgMDEtMS4zNTgtMi41NTFjLS4wMTctLjEwNC0yLjM3NC0uMDQzLTIuNjIyLjA5My0uMjkuMTU5LS40NjYuNTU1LS42My44MjItLjI2NC40MzItLjUxLjg3NS0uNzM1IDEuMzN6Ii8+CiAgICA8cGF0aCBmaWxsPSIjMkYyRTQxIiBkPSJNMzUuODEzIDEzNi45NTFjLjAzIDQuNzEzLTEuMzQ2IDkuMzItMi45NiAxMy43NWExMjQuOTA2IDEyNC45MDYgMCAwMS0yLjAzNCA1LjIxNmMtLjQyNSAxLjAyMS0uOTAzIDIuMTU0LS40NDggMy4xNjItMS4zMS0uNDk2LTIuNjUtLjc4OS00LjAzMy0uNTYuNTI2LTEuMDY4LjQ3Ni0yLjMxMi41LTMuNTAxYTMwLjM2IDMwLjM2IDAgMDEuNTIyLTQuODEgMjYuNzQgMjYuNzQgMCAwMTIuMzYtNi45NTQgNS4yMyA1LjIzIDAgMDAuNDU5LTEuNDY1IDkuMjg3IDkuMjg3IDAgMDAtLjE5NS0zLjM4NCAyMC4xNDcgMjAuMTQ3IDAgMDAtMi44MjQtNi44OTJsLS4wMTQuMTQxYTIwLjUxNyAyMC41MTcgMCAwMS0uMzU1IDIuMDg2Yy0uMzA5IDEuNDYtLjY3IDIuOTItLjYxNiA0LjM4OGEyMy41MiAyMy41MiAwIDAxLS4yODkgNC42NTMgNy4wMiA3LjAyIDAgMDEtLjQ3IDEuNzU5Yy0uMTUuMzM3LS4zNDguNjU0LS40NjcgMS4wMDRhNC41NiA0LjU2IDAgMDAtLjE4MyAxLjI0MmMtLjE3NiAzLjU0OS0uMDAyIDguMDkxLjcyNiAxMS41N2E2LjgwNiA2LjgwNiAwIDAwLTMuNTMuODAxYy0uODgtMi40NzUtMS40NDEtNS45ODktMS44Ni04LjU5NGEyNS4zMzcgMjUuMzM3IDAgMDEuMjg0LTkuMjZjLjIwNi0xLjAxNi4yODQtMi4wNTMuMjMtMy4wODgtLjA5NC0yLjA2LS42MDItNC4wNzYtMS4xMDgtNi4wNzdhMTM0MDguMzg3IDEzNDA4LjM4NyAwIDAxLTEuODctNy4zODdjLS4yNDMtLjk2My0uNDg4LTEuOTQ2LS40MTItMi45MzZhNy4zMDEgNy4zMDEgMCAwMS4zNDEtMS41OTYgMTcuODE2IDE3LjgxNiAwIDAxMi40MjUtNC45MzljNC4yMi4yMzYgOC40OS0uMTU3IDEyLjcwMy0uNDhhLjg2Ljg2IDAgMDEuNTk3LjEwMS44NC44NCAwIDAxLjI0LjU0MWwxLjU4MyA4LjkzMmMuMjU3IDEuMjQ0LjQwOCAyLjUwNy40NSAzLjc3NS4wMDkgMS4yNjQtLjE5NyAyLjUyNC0uMTUgMy43ODguMDY1IDEuNzAyLjM4OCAzLjMxMS4zOTggNS4wMTR6Ii8+CiAgICA8cGF0aCBmaWxsPSIjMDAwIiBkPSJNMjcuMTQ2IDEzMS42NTRjLS4wODIuNzAxLS4yIDEuMzk3LS4zNTUgMi4wODYtLjkxOC0xLjU4MS0xLjkwNy0zLjEyMi0yLjc1Mi00Ljc0Mi0uMjE4LS40MTgtLjQyNS0uODQxLS42MzQtMS4yNjNsLS42MjItMS4yNjZjLS4xMTctLjIzNy0uMjM0LS40NzUtLjMzOS0uNzE4YTUuMTk2IDUuMTk2IDAgMDEtLjM5Mi0xLjA5N2MuMzA3LS4wNTYgMS4wNjQuNzY5IDEuMjkyLjk4NC40NjcuNDU4LjkwNy45NDIgMS4zMiAxLjQ0OS40OTkuNTYzLjk1NyAxLjE2IDEuMzcgMS43ODhhOC42OCA4LjY4IDAgMDExLjExMiAyLjc3OXoiIG9wYWNpdHk9Ii4xIi8+CiAgICA8cGF0aCBmaWxsPSIjRUZCN0I5IiBkPSJNMzAuNjYzIDg4LjI3MXMtMi4zNDUgMy43MTktMS45MSA0LjQ5N2MuNDMzLjc3OC03LjM4Mi0uNjkyLTcuMzgyLS42OTJzNC4yNTUtMy43MTggMy44Mi01LjI3NWMtLjQzMy0xLjU1NiA1LjQ3MiAxLjQ3IDUuNDcyIDEuNDd6Ii8+CiAgICA8cGF0aCBmaWxsPSIjRUZCN0I5IiBkPSJNMjguNTc4IDg5LjM5NWMyLjkyNiAwIDUuMjk3LTIuMzYxIDUuMjk3LTUuMjc1IDAtMi45MTMtMi4zNzEtNS4yNzUtNS4yOTctNS4yNzUtMi45MjUgMC01LjI5NyAyLjM2Mi01LjI5NyA1LjI3NSAwIDIuOTE0IDIuMzcyIDUuMjc1IDUuMjk3IDUuMjc1eiIvPgogICAgPHBhdGggZmlsbD0iIzA3N0NCMiIgZD0iTTMwLjc0IDkyLjE3YTUuMzg0IDUuMzg0IDAgMDAtMi4yMjctMS43OSA4LjA1IDguMDUgMCAwMC0xLjU4My0uMzg4bC0yLjExMy0uMzdjLS41MTgtLjA5MS0xLjA3Mi0uMTc4LTEuNTUzLjAzNS0uMjQ1LjEyNC0uNDY5LjI4Ni0uNjYyLjQ4Mi0uNzM0LjY3Ny0xLjQ0NiAxLjQyMi0yLjM2NyAxLjgxMy0uMjUyLjEwNy0uNTE2LjE4Ni0uNzY3LjI5NC0xLjAzLjQ0Mi0xLjgwMSAxLjM2NC0yLjIzOSAyLjM5My0uNDU5IDEuMDc5LS40NzIgMi4yNDktLjQzNiAzLjQyYTUuOTggNS45OCAwIDAwLjExOSAxLjIwNGMuMTA3LjM3Ny4yNC43NDYuNCAxLjEwNC4yOTMuNzY0LjUzNyAxLjU0NS43MzMgMi4zNGE3My42OCA3My42OCAwIDAxMS4zNjUgNi4zMjVjLjAzMi4zMDYuMTIyLjYwMy4yNjcuODc1LjIwNC4yNzEuNDUuNTA3LjczLjY5OS4yMjIuMTgzLjQyNy4zODUuNjEyLjYwNC4wOTEuMDk0LjE1Ny4yMDguMTk0LjMzMy4wNjkuMzE0LS4yMS41ODQtLjQzOC44MTRhMy45MjcgMy45MjcgMCAwMC0uOTg5IDEuNzE1LjY4LjY4IDAgMDAtLjE1Ny40NzQuODIuODIgMCAwMS4wNS4zNzQuODcuODcgMCAwMS0uMi4zMDkgMS4xNjEgMS4xNjEgMCAwMC0uMjIuOTMyIDE0LjkyIDE0LjkyIDAgMDA1LjE4NyAxLjIxYy40MzguMDIuODc4LjAyIDEuMzEzLjA3NC4zMS4wMzguNjE2LjEwMy45MjcuMTM5LjQ1Mi4wNDIuOTA2LjA1MyAxLjM1OS4wMzQgMi4zNTgtLjA0NiA0Ljc4NC0uMTA3IDYuOTUtMS4wMzguMjAzLTEuMTA2LS4yMzYtMi4yMzMtLjUxMi0zLjMyMy0uNDM4LTEuNzM0LS41NDgtMy41MzItLjg3NC01LjI5LS4yMjQtMS4yMDQtLjU0OC0yLjM4OC0uNzM0LTMuNTk4LS4xODYtMS4yMS0uMjMtMi40NjQuMTA1LTMuNjQyLjI5Ni0xLjA0NC4zODUtMi4xMDYuNjkyLTMuMTQ3LjMwNi0xLjA0LjUyMS0yLjE2OC4xNzUtMy4xOTctLjQzLTEuMjc0LTEuNzU4LTIuMjgzLTMuMTA2LTIuMjEzeiIvPgogICAgPHBhdGggZmlsbD0iIzJGMkU0MSIgZD0iTTMzLjM0MiA4MS4zMjRjLjI1Ny0uOTM3LS4yNS0xLjkxMi0uODU1LTIuNjczLS42NTEtLjgxOC0xLjQ5My0xLjU1NS0yLjUyLTEuNzYtLjgzNS0uMTY4LTEuNy4wMzQtMi41NDktLjAzMy0uNzUyLS4wNi0xLjQ3My0uMzI4LTIuMjIyLS40MjVhNy4wNjcgNy4wNjcgMCAwMC0yLjAzLjA3NyA3LjU4IDcuNTggMCAwMC0xLjg1Mi41MTVjLTIuMjU1Ljk5NS0zLjU3NiAzLjQ1Mi0zLjg4MyA1Ljg5LS4zMDYgMi40MzcuMjMxIDQuODkyLjc2NiA3LjI5bC40ODMgMi4xNjdjLjUwMiAyLjI1NiAxLjAwNyA0LjUyNCAxLjE0MSA2LjgzLjEzNSAyLjMwOC0uMTE2IDQuNjc2LTEuMDY5IDYuNzgzYTE0LjYwNyAxNC42MDcgMCAwMDYuNzMtNy41ODhjLjM0My0uODkyLjU5Ni0xLjgxOC45NzYtMi42OTUuMzI2LS43NTUuNzQ0LTEuNDcgMS4wMzQtMi4yNC4zMjYtLjg2OS40ODMtMS43OTIuNDYxLTIuNzItLjAxNi0uNjk4LS4xMzMtMS4zOTItLjExMy0yLjA4OS4wMi0uNjk3LjE5OS0xLjQyNS42ODMtMS45My40My0uNDQ3IDEuMDQxLS42NjMgMS41OTYtLjk0NWE2LjYyIDYuNjIgMCAwMDIuMjMtMS44NTNjLjM1LS40NTMuMzY4LS42NDcuNDU3LTEuMTcuMDg2LS41MDcuNC0uOTM4LjUzNi0xLjQzMXoiLz4KICAgIDxwYXRoIGZpbGw9IiNFRkI3QjkiIGQ9Ik0zMy4zNSAxMjAuOTU0Yy4wNTMuNTQyLS4wNDYgMS4wOTguMDczIDEuNjMuMDkuMzk5LjI5OC43NjMuNDIgMS4xNTQuMTIyLjQ1My4xODQuOTIuMTg2IDEuMzg5LjAxOC4zOTMtLjAxMy44NzEtLjM2MiAxLjA1Ni0uMTUzLjA4MS0uMzM3LjA4Mi0uNDk3LjE1LS4xNi4wNjgtLjI5Ny4yNjEtLjIwNS40MDguMDc3LjEyMy4yNTEuMTI1LjM5NC4xNTQuMTQzLjAyOS4zLjE3Ny4yMTguMjk3YS4yNTIuMjUyIDAgMDEtLjEyOC4wOCAxLjQ4NSAxLjQ4NSAwIDAwLS40MS4xOTcuNDEzLjQxMyAwIDAwLS4xNjkuMzk3LjI0My4yNDMgMCAwMC4xMzcuMTY3LjI1My4yNTMgMCAwMC4yMTUtLjAwNWMtLjA2NC4xMzYtLjA5OS4yODQtLjEwMi40MzUuNTU5LjIzOSAxLjE4OC0uMDc0IDEuNzE0LS4zNzhhNi41NiA2LjU2IDAgMDAuNjYtLjQxOCAzLjI2IDMuMjYgMCAwMDEuMjcxLTIuNzg0IDYuMzYzIDYuMzYzIDAgMDAtLjEyNC0uNzk2Yy0uMDgxLS40NTctLjE5LS45MDktLjMyMi0xLjM1My0uMTUtLjQ2OS0uMzU4LS45MTgtLjUzNS0xLjM3Ny0uMzc3LS45NzktLjYyLTIuMDA0LS45Ni0yLjk5N2EuMzQuMzQgMCAwMC0uMTM3LS4yNDEuMzQyLjM0MiAwIDAwLS4yNzEtLjA2NCA0LjAxNSA0LjAxNSAwIDAwLTEuMTQuMTA0Yy0uMjI2LjA2Ni0uNTk2LjIxLS42OTcuNDQ2LS4wOTEuMjEyLjA2MS40MDEuMTU4LjU4M2E0LjgzIDQuODMgMCAwMS42MTMgMS43NjZ6Ii8+CiAgICA8cGF0aCBmaWxsPSIjMDAwIiBkPSJNMzIuOTkgOTQuNDUyYy4xMTQuMTE0LjIwOC4yNDYuMjgxLjM4OS43NTMgMS4zNjIuNzYyIDIuOTkyLjc5OCA0LjU0Ny4wNCAxLjc0OS4xMzYgMy40OTcuMjMyIDUuMjQ1bC4yODcgNS4yMjZjLjAyOC40OTkuMDU1IDEgLjEyNiAxLjQ5NS4zMzguMDg1LjM1Mi41Mi4zMTMuODY1LS4yNDIgMi4xMzMtLjg0NSA0LjMyOC0uMjE0IDYuMzgxYS42NDEuNjQxIDAgMDAuMTQ4LjI4NCAxLjcwOSAxLjcwOSAwIDAwLS45OC0uMDEzYy0uMzE0LjA2Ni0uNjE2LjE4LS45My4yNTItLjM5OS4wOS0uODUuMTI5LTEuMTIzLjQzM2EyMS41NzYgMjEuNTc2IDAgMDEtLjczMy0yLjgxOWMtLjE0OS0uODY4LS4xOS0xLjc3LS41NDUtMi41NzctLjE0My0uMzI1LS4zMzQtLjYyNy0uNTEtLjkzNy0uOTE5LTEuNjMyLTEuMzctMy40NzYtMS44MS01LjI5NWE3LjY5MiA3LjY5MiAwIDAxLS4xNC0yLjYzYy4wNjMtLjQwMS4xLS44MDYuMTEtMS4yMTFhOS42OTQgOS42OTQgMCAwMC0uMTY4LTEuMjczIDguNTI1IDguNTI1IDAgMDEuMjU1LTMuNjg4Yy4zMy0xLjExLjYxOS0yLjI3OSAxLjMwOC0zLjIxMi42ODktLjkzMiAyLjEzMy0xLjQ0NiAzLjI5Ni0xLjQ2MnoiIG9wYWNpdHk9Ii4xIi8+CiAgICA8cGF0aCBmaWxsPSIjMDc3Q0IyIiBkPSJNMzMuMjUxIDk0LjI3OWMuMTEzLjExNC4yMDguMjQ2LjI4LjM4OS43NTQgMS4zNjIuNzYzIDIuOTkyLjc5OSA0LjU0Ny4wNCAxLjc1LjEzNSAzLjQ5Ny4yMzIgNS4yNDVsLjI4NyA1LjIyNmMuMDI4LjUuMDU1IDEgLjEyNiAxLjQ5NS4zMzguMDg1LjM1Mi41Mi4zMTMuODY1LS4yNDMgMi4xMzMtLjg0NSA0LjMyOC0uMjE0IDYuMzgxYS42MzUuNjM1IDAgMDAuMTQ3LjI4NCAxLjcwOSAxLjcwOSAwIDAwLS45NzktLjAxM2MtLjMxNC4wNjYtLjYxNy4xODEtLjkzLjI1Mi0uMzk5LjA5LS44NS4xMjktMS4xMjMuNDMzYTIxLjYwOCAyMS42MDggMCAwMS0uNzMzLTIuODE5Yy0uMTUtLjg2OC0uMTktMS43Ny0uNTQ1LTIuNTc3LS4xNDMtLjMyNS0uMzM1LS42MjctLjUxLS45MzctLjkyLTEuNjMxLTEuMzctMy40NzYtMS44MS01LjI5NWE3LjY5IDcuNjkgMCAwMS0uMTQtMi42M2MuMDYzLS40MDEuMS0uODA1LjExLTEuMjExYTkuNjkzIDkuNjkzIDAgMDAtLjE2OC0xLjI3MyA4LjUyMyA4LjUyMyAwIDAxLjI1NS0zLjY4OGMuMzMtMS4xMS42MTgtMi4yNzkgMS4zMDgtMy4yMTIuNjg5LS45MzIgMi4xMzMtMS40NDYgMy4yOTUtMS40NjJ6Ii8+CiAgICA8ZyBmaWxsPSIjMDAwIiBvcGFjaXR5PSIuMSI+CiAgICAgIDxwYXRoIGQ9Ik0zMi40ODcgNzguNjUxYy0uNjUxLS44MTgtMS40OTMtMS41NTUtMi41Mi0xLjc2LS44MzUtLjE2OC0xLjcuMDM0LTIuNTQ5LS4wMzMtLjc1Mi0uMDYtMS40NzMtLjMyOC0yLjIyMi0uNDI1YTcuMDY3IDcuMDY3IDAgMDAtMi4wMy4wNzcgNy41OCA3LjU4IDAgMDAtMS44NTIuNTE1Yy0uMzIuMTQyLS42MjYuMzE1LS45MTMuNTE1YTcuOTgxIDcuOTgxIDAgMDExLjYzNS0uNDI1IDcuMDcgNy4wNyAwIDAxMi4wMzEtLjA3NmMuNzQ5LjA5NiAxLjQ3LjM2NSAyLjIyMi40MjQuODUuMDY3IDEuNzE0LS4xMzQgMi41NS4wMzMgMS4wMjcuMjA1IDEuODY4Ljk0MyAyLjUxOSAxLjc2LjYwNi43NjEgMS4xMTMgMS43MzYuODU1IDIuNjczLS4xMzYuNDkzLS40NS45MjQtLjUzNiAxLjQzMi0uMDkuNTIzLS4xMDguNzE2LS40NTcgMS4xN2E2LjYzOSA2LjYzOSAwIDAxLTEuNjA4IDEuNDljLjE3LS4wOC4zNC0uMTU4LjUwNy0uMjQzYTYuNjIgNi42MiAwIDAwMi4yMy0xLjg1M2MuMzUtLjQ1My4zNjgtLjY0Ny40NTctMS4xNy4wODYtLjUwNy40LS45MzguNTM2LTEuNDMxLjI1OC0uOTM3LS4yNS0xLjkxMi0uODU1LTIuNjczek0yOC41MjMgODYuNzI0Yy4wOS0uMDk0LjE5LS4xOC4yOTYtLjI1Ni0uNTA2LjI0NC0xLjAzOS40NTktMS40MjUuODYxLS40ODQuNTA1LS42NjIgMS4yMzItLjY4MyAxLjkzLS4wMi42OTcuMDk3IDEuMzkuMTE0IDIuMDg4YTcuMjY0IDcuMjY0IDAgMDEtLjQ2MiAyLjcyMWMtLjI5Ljc3LS43MDggMS40ODUtMS4wMzQgMi4yNC0uMzguODc2LS42MzMgMS44MDItLjk3NiAyLjY5NGExNC42MTcgMTQuNjE3IDAgMDEtNS41NjQgNi44OTVsLS4wMzcuMDg4YTE0LjYwNyAxNC42MDcgMCAwMDYuNzMtNy41ODhjLjM0My0uODkyLjU5Ni0xLjgxOC45NzYtMi42OTUuMzI2LS43NTUuNzQ0LTEuNDcgMS4wMzQtMi4yNC4zMjYtLjg2OS40ODMtMS43OTIuNDYxLTIuNzItLjAxNi0uNjk4LS4xMzMtMS4zOTItLjExMy0yLjA4OS4wMi0uNjk3LjE5OS0xLjQyNS42ODMtMS45M3oiIG9wYWNpdHk9Ii4xIi8+CiAgICA8L2c+CiAgICA8cGF0aCBmaWxsPSIjMkYyRTQxIiBkPSJNMTQ0Ljg1MyAxNjQuMjU4Yy0uMjUyLjMwMy0uNjg0LjM2NC0xLjA3NC40MDRhNi4xMjEgNi4xMjEgMCAwMS0xLjUyNC4wMjljLS42MDMtLjA4OS0uOTY0LjI1Mi0xLjUxNC0uMDEtLjMzMy0uMTU5LS44NDUuMTU4LTEuMTc4IDAtLjQ1Ny0uMjE4LTIuMDMzLS4yNjMtMi4zMS0uNjg3LS4yNzgtLjQyNS0uMjUtMS4wOTYuMTg5LTEuMzQ2YTIuOTUgMi45NSAwIDAxLjM4NS0uMTVjLjczNi0uMjkyIDIuMjI2LTIuNDkgMy4wMDgtMi42MDMuMzg4LS4wMTguNzc0LjA3MiAxLjExMy4yNjEuNzcyLjM0MSAyLjEzNC42MTEgMi40NzEgMS40NzYuMjYyLjY3NS45OCAxLjk2Ny40MzQgMi42MjZ6TTE1MC4zOTYgMTY0LjA4NGMuMjUyLjMwMy42ODQuMzY0IDEuMDc0LjQwNGE2LjEyMSA2LjEyMSAwIDAwMS41MjQuMDI5Yy42MDMtLjA4OSAxLjMzNi40MjYgMS44ODcuMTY0LjMzMy0uMTU5Ljg0NS0uMDc2IDEuMTc4LS4yMzUuNDU3LS4yMTggMi42MDIuMjY4IDIuODgtLjE1Ny4yNzgtLjQyNS4yNDktMS4wOTUtLjE5LTEuMzQ2YTIuODk2IDIuODk2IDAgMDAtLjM4NS0uMTVjLS43MzUtLjI5MS0zLjE2OC0yLjk2LTMuOTUtMy4wNzJhMi4wODggMi4wODggMCAwMC0xLjExMy4yNjFjLS43NzIuMzQxLTIuMTM0LjYxMS0yLjQ3MSAxLjQ3Ni0uMjYyLjY3NS0uOTggMS45NjctLjQzNCAyLjYyNnoiLz4KICAgIDxwYXRoIGZpbGw9IiMyRjJFNDEiIGQ9Ik0xNTIuODMyIDExNi4xNjFjLjI0MS40NjEuNDUyLjkzOC42MzEgMS40MjcgMi4xMzkgNS42MzYgMi4zMTggMTEuNzk1IDIuNDA3IDE3LjgyLS4wMDguOTc5LjA0OCAxLjk1OC4xNjggMi45MzEuMDg5LjYxNi4yMzEgMS4yNC4xNCAxLjg1Ni0uMDc5LjUzMy0uMzMxIDEuMDU5LS4yMzEgMS41ODguMDQ1LjIzNy4xNi40NTcuMjA1LjY5NS4wMzQuMjYuMDI3LjUyNC0uMDIyLjc4M2wtLjI4NiAyLjEyNWMtLjE2NCAxLjIxLS41NDEgMi4zNzctLjUyIDMuNTk4LjAxNC44MzMuMDI4IDEuNjY4LjEyMSAyLjQ5Ni4wOTQuODQxLjI3MSAxLjY3NS4yOCAyLjUyMS4wMDYuNjMzLS4wODEgMS4yNjQtLjEzNyAxLjg5NWExOS40OTMgMTkuNDkzIDAgMDAtLjA1NCAyLjY4Yy4wMzQuNjg5LjExMyAxLjQwNC40OCAxLjk4OS0uNDExLjU4Ni0uODE4IDEuMTEyLTEuNDc2IDEuMzk5LTEuMzM2LjU4NC0yLjg3LjM4Ni00LjMxNC4xNzcuMDgtLjI2NS4yMDQtLjU2Ni4wODgtLjgxOGExLjYzIDEuNjMgMCAwMC0uMjQ4LS4zMzYgMy45NTYgMy45NTYgMCAwMS0uNjQzLTEuNDg5Yy0uMTc1LS42MzQtLjM1LTEuMzE3LjAxLTEuOTI2YTEuMjMgMS4yMyAwIDAwLjE1Ni0uNzE1Yy0uMjk5LTMuOTk1LTEuMTkyLTguMTI5LS4zNy0xMi4wNS4wODgtLjQxOS4xOTMtLjgzNS4yNDItMS4yNi4wNDQtLjYxMS4wNTEtMS4yMjQuMDIyLTEuODM2bC0uMDE3LS44NTFjLS4wNDMtLjkwOS0uMDA2LTEuODQxLS4xODktMi43NC0uMTMxLS42NDQtLjM3Ni0xLjI5MS0uMDc0LTEuOTQ3YTEuMDczIDEuMDczIDAgMDAtLjA0NS0uOTQ1IDE3LjMyNCAxNy4zMjQgMCAwMS0xLjUyMi0zLjQ5OCA2LjA4MyA2LjA4MyAwIDAwLS4zMi0uOTk2IDcuMDQzIDcuMDQzIDAgMDAtLjYzMy0uOTY5Yy0uNzE2LTEuMDM0LTEuMTQ0LTIuMjMzLTEuNTY0LTMuNDE3LjA0NS0uMTA5LjAxMS0uMjYtLjEwNi0uMjQ0YS40NDguNDQ4IDAgMDAtLjI3Ni4yMDVjLS41NzYuNzctLjYyNCAxLjc5OC0uNjUgMi43NTgtLjA0My44OTItLjAyOCAxLjc4Ni4wNDYgMi42NzYuMDQ5LjQ2Ny4xMzEuOTI5LjE3MyAxLjM5Ni4wNTUuODcyLjA0MSAxLjc0Ni0uMDQyIDIuNjE1bC0uMjkzIDQuMjc3Yy0uMDQuMzU0LS4wMTkuNzEyLjA2MyAxLjA1OC4xODguNTk5LjI4IDEuMjI1LjI3MiAxLjg1M2EzMy4yNzcgMzMuMjc3IDAgMDAuNjY4IDcuNjk5Yy4xNDQuNjk5LjMxIDEuMzk0LjQzMiAyLjA5Ny4yODcgMS42NTcuMzI2IDMuMzQ2LjM2NSA1LjAyNy4wMjMgMS4wMzQuMDQgMi4xMDQtLjM2OCAzLjA1NS0uMTYuMjkzLS4yNzguNjA3LS4zNDkuOTMyYTEuOTkyIDEuOTkyIDAgMDEtLjA2Ny40OThjLS4xMi4zMDgtLjQ4LjQzOS0uODA0LjUwOWE2LjUxNCA2LjUxNCAwIDAxLTEuODUzLjEzMSAxLjA4IDEuMDggMCAwMS0uNDIzLS4wOTNjLS4yMzEtLjEyLS4zNTQtLjM3My0uNTMtLjU2NS0uMzgtLjQxMy0xLjAxMi0uNTM5LTEuMzU4LS45ODEtLjQzMy0uNTUzLS4yNTEtMS4zNTMuMDA2LTIuMDA1LjI1OC0uNjUyLjU3Ny0xLjM2LjM1NS0yLjAyNS0uMjYxLS43ODQtMS4xODgtMS4yMDYtMS40MzctMS45OTQuNzEtMy4xNzctMS4wMzMtNi40NjMtLjg4NC05LjcxNC4wMzUtLjc1OC4xNjctMS41MDkuMTctMi4yNjguMDA3LTEuOTUzLS44NDMtMy44NTMtLjcwMy01LjgwMS4zNTUtNC45NS0xLjMzOC05Ljg5Mi0yLjA1NS0xNC44MDNhOS42MzkgOS42MzkgMCAwMS0uMTUxLTIuMjI0Yy4xMDYtMS4yMjkuNjc5LTIuMzczIDEuMzY4LTMuMzk5LjQ5NC0uNzM0IDEuMDg4LTEuNDUzIDEuOTA2LTEuNzk3LjY3My0uMjgzIDEuNDI4LS4yODIgMi4xNTktLjI3NiAxLjgyNC4wMTQgMy42NDguMDI4IDUuNDcxLjA2MWExOC4wNjYgMTguMDY2IDAgMDEzLjY5OS4zMjljLjk4Ny4yMjUgMS45MS42ODMgMi45MTEuODI2eiIvPgogICAgPHBhdGggZmlsbD0iI0ExNjE2QSIgZD0iTTEyMy4zNjQgOTMuNTk0Yy0uMTc2LS44NjEuMTU4LTEuNzgyLS4xMDQtMi42MjItLjA5NC0uMzAyLS4zMjUtLjYxNy0uNjQzLS42MDgtLjMwOS4wMDgtLjUxOC4zMS0uNzkyLjQ1Mi0uNDQyLjIzLS45NzkuMDIxLTEuNDItLjIxLS40NDEtLjIzLS45MzMtLjQ5LTEuNDEyLS4zNTItLjA1Ni4yOTguMTQ2LjU4My4zNjYuNzkzLjI0NC4xODQuNDQ2LjQxNy41OTMuNjg0LjA3Mi4yOS4wOTkuNTg3LjA4MS44ODUuMDUuNjgyLjQ4NCAxLjI2OS45MTcgMS44LjY5OC44NTQgMS40NCAxLjY3MyAyLjIyMiAyLjQ1My0uMDAyLS4wMDEgMS4xODYtMS40NjUgMS4xNjMtMS43Mi0uMDIxLS4yNDItLjQyMS0uNDY3LS41NjYtLjY2MmEyLjI2MiAyLjI2MiAwIDAxLS40MDUtLjg5M3pNMTU4LjcyOCAxMTEuNjE4Yy4xMDYuMjc0LjE4NS41NTcuMjM3Ljg0NS4zMDYgMS40NzkuNDk5IDIuOTc4LjY5IDQuNDc2LjA1LjQuMTAxLjgwMS4xMTcgMS4yMDNhNS40OSA1LjQ5IDAgMDEtLjU3MyAyLjc2NyAzLjg4NSAzLjg4NSAwIDAxLTIuMDgyIDEuODY4Yy0uMjc5LjA5OC0uNjY3LjExNi0uNzg5LS4xNTJhLjU3LjU3IDAgMDEuMDAzLS4zODJjLjExLS4zOTkuMzMzLS43NTcuNDc4LTEuMTQ0YTMuMDc4IDMuMDc4IDAgMDAuMTAzLTEuODA5Yy0uMDU3LS4yMjktLjE3Ny0uNDg1LS40MS0uNTMxYTIuMDUyIDIuMDUyIDAgMDEtLjI3MiAxLjUzOS41NDIuNTQyIDAgMDEtLjMxOC4yNjguNDI5LjQyOSAwIDAxLS40NDctLjI4NyAxLjIzNyAxLjIzNyAwIDAxLS4wMzYtLjU3Yy4wNzUtLjk2MS4yMjItMS45MTUuNDQtMi44NTMuMjU5LTEuMDMxLjY3LTIuMDQ4LjY0NC0zLjExLS4wMjQtLjk2My0uNDA5LTEuOTA4LS4zMDEtMi44NjVhLjI4Ni4yODYgMCAwMS4wNTUtLjE2NC4zLjMgMCAwMS4xMi0uMDc0Yy4yNy0uMTExLjU0OC0uMjAzLjgzMS0uMjc0LjE2Ny0uMDQyLjczOC0uMjQuODk5LS4xNTEuMTI5LjA3MS4xNjkuNS4yMzQuNjQ1LjExNS4yNTcuMjY4LjQ5NS4zNzcuNzU1ek0xMzkuNjU1IDgzLjEwM2EzLjkzOSAzLjkzOSAwIDAwMy45NDYtMy45M2MwLTIuMTctMS43NjctMy45My0zLjk0Ni0zLjkzYTMuOTM5IDMuOTM5IDAgMDAtMy45NDcgMy45M2MwIDIuMTcgMS43NjcgMy45MyAzLjk0NyAzLjkzeiIvPgogICAgPHBhdGggZmlsbD0iI0ExNjE2QSIgZD0iTTE0My4xOTEgODIuMDE3YzAgLjI1LjAyLjUwMS4wNi43NDguMDU0LjI1LjEzMS40OTUuMjMuNzMxLjEzMi4zODUuMzE4Ljc0OC41NTMgMS4wOC4yMzguMzM1LjU5NS41NjYuOTk5LjY0OGEyOC41MDcgMjguNTA3IDAgMDEtOC41MzQgMi40NTZjLjQ2Ni0uMzA4Ljg1My0uNzIgMS4xMzItMS4yMDMuMTQ4LS4zMS4yNDktLjY0LjMtLjk4YTguMTkgOC4xOSAwIDAwLS4zNzEtNC4yMzljLS4wNDktLjEzNC0uMDk3LS4yOTgtLjAwNC0uNDA2YS4zOC4zOCAwIDAxLjE0LS4wOSA4LjgzMiA4LjgzMiAwIDAxMy43MS0uNjljLjMyNS4wMDIuNjUuMDE3Ljk3NS4wNC4xNzQuMDEzLjU1OS0uMDI0LjY5OC4xMDMuMTY1LjE1Mi4wODIuNjIzLjA4OC44M2wuMDI0Ljk3MnoiLz4KICAgIDxwYXRoIGZpbGw9IiNEMENERTEiIGQ9Ik0xNDUuMjggODQuODc3YTQuMjQgNC4yNCAwIDAwLTUuMDUyLTEuMjU0Yy0xLjg3OS44OTMtMi44MDQgMy4wMzgtNC40NTYgNC4yOTktLjM3Ni4yOC0uNzc2LjUyNi0xLjE5Ni43MzQtLjI0OC4xMzYtLjUxMy4yNC0uNzg4LjMxLS4zMDguMDY4LS42MzEuMDU5LS45MzguMTMyYTIuNDE2IDIuNDE2IDAgMDAtMS4zOTcgMS4wOCA3LjU1NCA3LjU1NCAwIDAxLS41MTQuNzg5Yy0uMTcyLjIwNC0uMzg3LjM2OS0uNTY5LjU2NC0uNjU3LjcwMy0uODM2IDEuNzEzLS45ODYgMi42NjJhMTIuNjU0IDEyLjY1NCAwIDAxLTEuNjc2IDEuNDcyIDIuMzggMi4zOCAwIDAxLS42MjIuMzQzYy0uNTc4LjE4Ny0xLjIxNi0uMDUtMS43MDgtLjQwNS0uNDkzLS4zNTQtLjg5NC0uODIyLTEuMzgtMS4xODVhNTAuNzQzIDUwLjc0MyAwIDAxLTEuMzg4IDEuODg2LjYxLjYxIDAgMDEtLjMxMS4yNTRjLS4wODkuMjk5LjEyNS42MDkuMjg2Ljg3N2wuODYgMS40NGE3LjIyMSA3LjIyMSAwIDAwMS4wMzkgMS40NWMuNDExLjQ0MS45NzMuNzEzIDEuNTc1Ljc2M2EzLjIgMy4yIDAgMDAxLjExMS0uMjEyYzEuNjM5LS41NDkgMy4xNDUtMS40MjYgNC43MDUtMi4xNzEuMjgzLS4xNjEuNTk5LS4yNTMuOTI0LS4yN2EuNzQ0Ljc0NCAwIDAxLjczMS41MjNjLjE3OS45LjM1NiAxLjc5Ny42MDIgMi42OC4yMzIuODM0LjQ0OCAxLjY3Mi42NDcgMi41MTQuMTMzLjUxNS4yMjggMS4wNC4yODQgMS41NjkuMDI2LjMuMDI4LjYwMi4wMzEuOTA0bC4wMzMgMy42NDNjLjAwNC4zOTMtLjIyMS42MzctLjM5NC45OWEyLjMyNyAyLjMyNyAwIDAwLS4xMTEgMS43NTFjLjA5Ny4yODQuMjQ5LjU0Ny4zNTcuODI3LjI2LjY3OC4yNSAxLjQyNS4yMzYgMi4xNTFsLS4wMzEgMS42NjJhLjM1OC4zNTggMCAwMC4wMzYuMjAxYy4xMDIuMTU4LjM0OC4wNjUuNTAzLS4wNDJsLjc4MS0uNTM5YzEuMDQ0LjE0NCAyLjA5OS4xOTQgMy4xNTMuMTUyIDIuOTk2LS4wNDMgNS45OTMuMDc2IDguOTgyLjI4NC45OTguMDcgMi4wMjkuMTQ1IDIuOTcyLS4xODcuNDc4LS4xNjguOTE5LS40MzYgMS40MDgtLjU3MS4yMDEtLjAzMi4zOTMtLjExLjU1OC0uMjI5LjI3NC0uMjUyLjIwMS0uNjk1LjA5LTEuMDQ5LS4wOTgtLjMxLS4yMDktLjYxNS0uMzMzLS45MTZhNS4zMTcgNS4zMTcgMCAwMS0uMzExLS44NTdjLS4xNS0uNjYzLS4wMDQtMS40My0uNDE5LTEuOTctLjkyOC0xLjIwOS0uMjcxLTMuMDY5LS42Ni00LjU0LS4xMjYtLjQ3Ni0uMzEzLS45MzUtLjQzMS0xLjQxMy0uMDc0LS4zLS4xMjEtLjYwNi0uMTY4LS45MTJhMTAuOTUyIDEwLjk1MiAwIDAxLS4xODEtMi4wMDRjLjAxMi0uMzM2LjA1NC0uNjcuMDk3LTEuMDA0bC4yOTUtMi4zMThjLjM2OC42ODUuNjI0IDEuNDI1Ljc1OCAyLjE5MS4yNjkgMS4xNDQuNTk5IDIuMjczLjk5IDMuMzgxLjIyMi42NjkuNDQ1IDEuMzM4LjY4NSAyIC4xNTIuMzc3LjI2OS43NjcuMzUgMS4xNjUuMDUzLjMyMS4wNTQuNjQ5LjA5Mi45NzJhNC40MiA0LjQyIDAgMDAuNzExIDEuOTQxYy4wNzEuMTM1LjE5LjI0LjMzMy4yOTRhLjY1LjY1IDAgMDAuMjkxLS4wMTIgMTEuNTA5IDExLjUwOSAwIDAwMi45OTYtMS4wMzIgMS4xOSAxLjE5IDAgMDAuNTA2LS4zOTRjLjI1NS0uNDEyLS4wMy0uOTI3LS4xNTQtMS4zOTUtLjEzMi0uNTAyLS4xMDEtMS4xMDYtLjQ5OC0xLjQ0My0xLjM4Mi0xLjE3MS0uNjk2LTMuNTQ5LTEuMzg4LTUuMjItLjEyMS0uMjkzLS4yNjMtLjU3OC0uMzY4LS44NzgtLjA4LS4yMjktLjEzOC0uNDY1LS4xOTYtLjcwMS0uNDgzLTEuOTQ2LTEtMy44ODMtMS41NTEtNS44MTItLjU3MS0yLS41MDktNC4wODItMS4yMjgtNi4wMzRhNi4zNTEgNi4zNTEgMCAwMC0uNTI3LTEuMTc3IDMuMTkgMy4xOSAwIDAwLS45NTMtLjk3OGMtMS4wNDMtLjY4Ny0yLjA5Ny0xLjI3Mi0zLjMyMi0xLjUyMS0xLjIyNi0uMjUtMi41NTItLjIxLTMuODAzLS4yMDV6Ii8+CiAgICA8cGF0aCBmaWxsPSIjMkYyRTQxIiBkPSJNMTM2LjA2OCA4MC4xMzVjLS41My0uMjg1LS4zOS0xLjA1Ny0uNDgxLTEuNjUtLjE4NS0xLjIyMi0xLjU3LTEuOTQ2LTEuODk2LTMuMTM3LjM3NC4wNDUuNzUzLS4wMDggMS4wOTktLjE1NWExLjY2NCAxLjY2NCAwIDAwLS4yMjEtMS4xNDVjMS4xMzktLjQ2IDIuMDYxLTEuMzY1IDMuMjE4LTEuNzggMS40NTUtLjUyMyAzLjA3NS0uMjAyIDQuNTQyLjI4My43MzMuMjQzIDEuNDk1LjU1NyAxLjkzNyAxLjE4Ny40ODcuNjkuNDc5IDEuNi40NTMgMi40NDQtLjA0MSAxLjMyMy0uMDkzIDIuNjk0LS42ODUgMy44OC0uNzUzIDEuNTA5LTIuODg1IDIuOTA3LTQuNjQ3IDIuNDk4LS43MzItLjE3LS45NDgtLjYyOC0xLjI1Ny0xLjI2Mi0uMTkyLS4zOTUtLjI2NC0uODUzLS42OTctMS4wNTgtLjQyMy0uMjAxLS45MzUuMTI1LTEuMzY1LS4xMDV6Ii8+CiAgICA8ZyBmaWxsPSIjMDAwIiBvcGFjaXR5PSIuMSI+CiAgICAgIDxwYXRoIGQ9Ik0xNTIuMDcyIDEwOC4zMTZjLjAwNS4xMDQuMDA4LjIwOS4wMDkuMzE1YTguMTYzIDguMTYzIDAgMDEtLjAwOS0uMzE1ek0xMzQuOTc4IDExMi4yNjRjLjI2LjY3OC4yNSAxLjQyNS4yMzcgMi4xNWwtLjAxMS41NjlhMy44NzQgMy44NzQgMCAwMC0uMjI2LTEuMTQ3Yy0uMTA3LS4yOC0uMjU5LS41NDMtLjM1Ni0uODI3YTIuMzIgMi4zMiAwIDAxLjAxNy0xLjUyOGMuMDk3LjI2Ny4yMzcuNTE4LjMzOS43ODN6IiBvcGFjaXR5PSIuMSIvPgogICAgPC9nPgogICAgPHBhdGggZmlsbD0iIzAwMCIgZD0iTTEzNC43OTEgNzQuNjIxbC0uMDA0LjAwMmExLjY1IDEuNjUgMCAwMC0uMjE4LS41NzUgNS4xMiA1LjEyIDAgMDAuMTk5LS4wODZjLjA1Mi4yMTYuMDU5LjQ0LjAyMy42NTl6IiBvcGFjaXR5PSIuMSIvPgogICAgPHBhdGggZmlsbD0iI0ZGNjU4NCIgZD0iTTEwLjQyIDY2LjYwOWwtLjkzLS44MzZjLTMuMzA0LTMuMDItNS40ODUtNC45ODEtNS40ODUtNy40MjNhMy40NjIgMy40NjIgMCAwMTEuMDE0LTIuNTEgMy40OSAzLjQ5IDAgMDEyLjUxNC0xLjAyNSAzLjgwOCAzLjgwOCAwIDAxMi44ODcgMS4zNSAzLjc5MiAzLjc5MiAwIDAxMi44ODYtMS4zNSAzLjUwMiAzLjUwMiAwIDAxMi41MTQgMS4wMjUgMy40NzUgMy40NzUgMCAwMTEuMDE0IDIuNTFjMCAyLjQ0Mi0yLjE4IDQuNDAyLTUuNDg0IDcuNDIzbC0uOTMuODM2eiIvPgogICAgPHBhdGggc3Ryb2tlPSIjM0YzRDU2IiBzdHJva2UtbWl0ZXJsaW1pdD0iMTAiIHN0cm9rZS13aWR0aD0iMiIgZD0iTTEyLjA3IDY0LjQ5NmwtLjkzLS44MzVjLTMuMzAzLTMuMDItNS40ODQtNC45ODEtNS40ODQtNy40MjNhMy40NjIgMy40NjIgMCAwMTEuMDE0LTIuNTEgMy40OSAzLjQ5IDAgMDEyLjUxNC0xLjAyNSAzLjgwOCAzLjgwOCAwIDAxMi44ODYgMS4zNSAzLjc5MiAzLjc5MiAwIDAxMi44ODctMS4zNSAzLjUwMiAzLjUwMiAwIDAxMi41MTQgMS4wMjUgMy40NzQgMy40NzQgMCAwMTEuMDE0IDIuNTFjMCAyLjQ0Mi0yLjE4MSA0LjQwMi01LjQ4NSA3LjQyM2wtLjkzLjgzNXoiLz4KICA8L2c+CiAgPGRlZnM+CiAgICA8Y2xpcFBhdGggaWQ9ImNsaXAwIj4KICAgICAgPHBhdGggZmlsbD0iI2ZmZiIgZD0iTTAgMGgyMzF2MTY1SDB6Ii8+CiAgICA8L2NsaXBQYXRoPgogIDwvZGVmcz4KPC9zdmc+Cg=="},615:function(M,e,t){"use strict";t.r(e);var j=t(0),L=t(13),N=t(11),u=(t(564),t(35)),c=t.n(u),i=t(2),g=t(14),D=t(7),I=t(1),n=t.n(I),y=t(3),z=t(20),a=(t(565),t(21)),A=t(16),T=t(102);class r extends j.Component{constructor(M){super(M),this.onActivateClick=this.onActivateClick.bind(this),this.onFinishSetupClick=this.onFinishSetupClick.bind(this)}getLinks(){const{docsUrl:M,settingsUrl:e,supportUrl:t,dashboardUrl:L}=this.props,N=[];return M&&N.push({key:"docs",href:M,text:Object(i.__)("Docs",'woocommerce')}),t&&N.push({key:"support",href:t,text:Object(i.__)("Get support",'woocommerce')}),e&&N.push({key:"settings",href:e,text:Object(i.__)("Settings",'woocommerce')}),L&&N.push({key:"dashboard",href:L,text:Object(i.__)("Dashboard",'woocommerce')}),Object(j.createElement)("ul",{className:"woocommerce-marketing-installed-extensions-card__item-links"},N.map(M=>Object(j.createElement)("li",{key:M.key},Object(j.createElement)(a.Link,{href:M.href,type:"external",onClick:this.onLinkClick.bind(this,M)},M.text))))}onLinkClick(M){const{name:e}=this.props;Object(A.recordEvent)("marketing_installed_options",{name:e,link:M.key})}onActivateClick(){const{activatePlugin:M,name:e}=this.props;Object(A.recordEvent)("marketing_installed_activate",{name:e}),M()}onFinishSetupClick(){const{name:M}=this.props;Object(A.recordEvent)("marketing_installed_finish_setup",{name:M})}getActivateButton(){const{isLoading:M}=this.props;return Object(j.createElement)(T.a,{isSecondary:!0,onClick:this.onActivateClick,disabled:M},Object(i.__)("Activate",'woocommerce'))}getFinishSetupButton(){return Object(j.createElement)(T.a,{isSecondary:!0,href:this.props.settingsUrl,onClick:this.onFinishSetupClick},Object(i.__)("Finish setup",'woocommerce'))}render(){const{name:M,description:e,status:t,slug:L}=this.props;let N=null;switch(t){case"installed":N=this.getActivateButton();break;case"activated":N=this.getFinishSetupButton();break;case"configured":N=this.getLinks()}return Object(j.createElement)("div",{className:"woocommerce-marketing-installed-extensions-card__item"},Object(j.createElement)(T.b,{product:L}),Object(j.createElement)("div",{className:"woocommerce-marketing-installed-extensions-card__item-text-and-actions"},Object(j.createElement)("div",{className:"woocommerce-marketing-installed-extensions-card__item-text"},Object(j.createElement)("h4",null,M),"configured"===t||Object(j.createElement)("p",{className:"woocommerce-marketing-installed-extensions-card__item-description"},e)),Object(j.createElement)("div",{className:"woocommerce-marketing-installed-extensions-card__item-actions"},N)))}}r.defaultProps={isLoading:!1},r.propTypes={name:n.a.string.isRequired,slug:n.a.string.isRequired,description:n.a.string.isRequired,status:n.a.string.isRequired,settingsUrl:n.a.string,docsUrl:n.a.string,supportUrl:n.a.string,dashboardUrl:n.a.string,activatePlugin:n.a.func.isRequired};var S=r,O=t(46);class o extends j.Component{activatePlugin(M){const{activateInstalledPlugin:e}=this.props;e(M)}isActivatingPlugin(M){const{activatingPlugins:e}=this.props;return e.includes(M)}render(){const{plugins:M}=this.props;if(0===M.length)return null;const e=Object(i.__)("Installed marketing extensions",'woocommerce');return Object(j.createElement)(y.Card,{className:"woocommerce-marketing-installed-extensions-card"},Object(j.createElement)(y.CardHeader,null,Object(j.createElement)(z.Text,{variant:"title.small",size:"20",lineHeight:"28px"},e)),M.map(M=>Object(j.createElement)(S,c()({key:M.slug},M,{activatePlugin:()=>this.activatePlugin(M.slug),isLoading:this.isActivatingPlugin(M.slug)}))))}}o.propTypes={plugins:n.a.arrayOf(n.a.object).isRequired,activatingPlugins:n.a.arrayOf(n.a.string).isRequired};var E=Object(g.compose)(Object(D.withSelect)(M=>{const{getInstalledPlugins:e,getActivatingPlugins:t}=M(O.b);return{plugins:e(),activatingPlugins:t()}}),Object(D.withDispatch)(M=>{const{activateInstalledPlugin:e}=M(O.b);return{activateInstalledPlugin:e}}))(o),l=t(170),C=t(171),s=t(566),w=t.n(s),x=(t(567),t(568)),m=t.n(x);const d=({isHidden:M,updateOptions:e})=>M?null:Object(j.createElement)(y.Card,{className:"woocommerce-marketing-overview-welcome-card"},Object(j.createElement)(y.CardBody,null,Object(j.createElement)(y.Button,{label:Object(i.__)("Hide",'woocommerce'),onClick:()=>{e({woocommerce_marketing_overview_welcome_hidden:"yes"}),Object(A.recordEvent)("marketing_intro_close",{})},className:"woocommerce-marketing-overview-welcome-card__hide-button"},Object(j.createElement)(w.a,null)),Object(j.createElement)("img",{src:m.a,alt:""}),Object(j.createElement)("h3",null,Object(i.__)("Grow your customer base and increase your sales with marketing tools built for WooCommerce",'woocommerce'))));d.propTypes={isHidden:n.a.bool.isRequired,updateOptions:n.a.func.isRequired};var k=Object(g.compose)(Object(D.withSelect)(M=>{const{getOption:e,isOptionsUpdating:t}=M(N.OPTIONS_STORE_NAME),j=t();return{isHidden:"yes"===e("woocommerce_marketing_overview_welcome_hidden")||j}}),Object(D.withDispatch)(M=>{const{updateOptions:e}=M(N.OPTIONS_STORE_NAME);return{updateOptions:e}}))(d);t(276);e.default=Object(N.withOptionsHydration)({...Object(L.f)("preloadOptions",{})})(()=>{const M=Object(L.f)("allowMarketplaceSuggestions",!1);return Object(j.createElement)("div",{className:"woocommerce-marketing-overview"},Object(j.createElement)(k,null),Object(j.createElement)(E,null),M&&Object(j.createElement)(l.a,{category:"marketing"}),Object(j.createElement)(C.a,{category:"marketing"}))})},77:function(M,e,t){"use strict";var j=t(0),L=t(3),N=t(1),u=t.n(N),c=t(6),i=t.n(c),g=t(20);t(273);const D=M=>{const{title:e,description:t,children:N,className:u}=M;return Object(j.createElement)(L.Card,{className:i()(u,"woocommerce-admin-marketing-card")},Object(j.createElement)(L.CardHeader,null,Object(j.createElement)("div",null,Object(j.createElement)(g.Text,{variant:"title.small",as:"p",size:"20",lineHeight:"28px"},e),Object(j.createElement)(g.Text,{variant:"subtitle.small",as:"p",className:"woocommerce-admin-marketing-card-subtitle",size:"14",lineHeight:"20px"},t))),Object(j.createElement)(L.CardBody,null,N))};D.propTypes={title:u.a.string,description:u.a.string,className:u.a.string,children:u.a.node},e.a=D}}]);woocommerce-admin/dist/chunks/activity-panels-inbox.js000064400000021245151335517650017215 0ustar00(window.__wcAdmin_webpackJsonp=window.__wcAdmin_webpackJsonp||[]).push([[5],{512:function(e,t,c){"use strict";c.d(t,"a",(function(){return N})),c.d(t,"b",(function(){return O}));var a=c(0),n=c(6),o=c.n(n),s=c(61),i=c.n(s),r=c(9),l=c.n(r),m=c(1),d=c.n(m),u=c(21),b=c(3),_=(c(522),c(4));class p extends a.Component{render(){const{className:e,hasAction:t,hasDate:c,hasSubtitle:n,lines:s}=this.props,i=o()("woocommerce-activity-card is-loading",e);return Object(a.createElement)("div",{className:i,"aria-hidden":!0},Object(a.createElement)("span",{className:"woocommerce-activity-card__icon"},Object(a.createElement)("span",{className:"is-placeholder"})),Object(a.createElement)("div",{className:"woocommerce-activity-card__header"},Object(a.createElement)("div",{className:"woocommerce-activity-card__title is-placeholder"}),n&&Object(a.createElement)("div",{className:"woocommerce-activity-card__subtitle is-placeholder"}),c&&Object(a.createElement)("div",{className:"woocommerce-activity-card__date"},Object(a.createElement)("span",{className:"is-placeholder"}))),Object(a.createElement)("div",{className:"woocommerce-activity-card__body"},Object(_.range)(s).map(e=>Object(a.createElement)("span",{className:"is-placeholder",key:e}))),t&&Object(a.createElement)("div",{className:"woocommerce-activity-card__actions"},Object(a.createElement)("span",{className:"is-placeholder"})))}}p.propTypes={className:d.a.string,hasAction:d.a.bool,hasDate:d.a.bool,hasSubtitle:d.a.bool,lines:d.a.number},p.defaultProps={hasAction:!1,hasDate:!1,hasSubtitle:!1,lines:1};var O=p;class N extends a.Component{getCard(){const{actions:e,className:t,children:c,date:n,icon:s,subtitle:i,title:r,unread:m}=this.props,d=o()("woocommerce-activity-card",t),b=Array.isArray(e)?e:[e],_=/\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}/.test(n)?l.a.utc(n).fromNow():n;return Object(a.createElement)("section",{className:d},m&&Object(a.createElement)("span",{className:"woocommerce-activity-card__unread"}),s&&Object(a.createElement)("span",{className:"woocommerce-activity-card__icon","aria-hidden":!0},s),r&&Object(a.createElement)("header",{className:"woocommerce-activity-card__header"},Object(a.createElement)(u.H,{className:"woocommerce-activity-card__title"},r),i&&Object(a.createElement)("div",{className:"woocommerce-activity-card__subtitle"},i),_&&Object(a.createElement)("span",{className:"woocommerce-activity-card__date"},_)),c&&Object(a.createElement)(u.Section,{className:"woocommerce-activity-card__body"},c),e&&Object(a.createElement)("footer",{className:"woocommerce-activity-card__actions"},b.map((e,t)=>Object(a.cloneElement)(e,{key:t}))))}render(){const{onClick:e}=this.props;return e?Object(a.createElement)(b.Button,{className:"woocommerce-activity-card__button",onClick:e},this.getCard()):this.getCard()}}N.propTypes={actions:d.a.oneOfType([d.a.arrayOf(d.a.element),d.a.element]),onClick:d.a.func,className:d.a.string,children:d.a.node,date:d.a.string,icon:d.a.node,subtitle:d.a.node,title:d.a.oneOfType([d.a.string,d.a.node]),unread:d.a.bool},N.defaultProps={icon:Object(a.createElement)(i.a,{size:48}),unread:!1}},517:function(e,t,c){"use strict";function a(e){return e?e.substr(1).split("&").reduce((e,t)=>{const c=t.split("="),a=c[0];let n=decodeURIComponent(c[1]);return n=isNaN(Number(n))?n:Number(n),e[a]=n,e},{}):{}}function n(){let e="";const{page:t,path:c,post_type:n}=a(window.location.search);if(t){const a="wc-admin"===t?"home_screen":t;e=c?c.replace(/\//g,"_").substring(1):a}else n&&(e=n);return e}c.d(t,"b",(function(){return a})),c.d(t,"a",(function(){return n}))},522:function(e,t,c){},523:function(e,t,c){"use strict";var a=c(0),n=c(2),o=c(21),s=c(11),i=c(7),r=c(16),l=c(172),m=c(169),d=c(20),u=c(512),b=c(164),_=c(517);c(524);const p=(e,t)=>{Object(r.recordEvent)("inbox_action_click",{note_name:e.name,note_title:e.title,note_content_inner_link:t})},O=({hasNotes:e,isBatchUpdating:t,lastRead:c,notes:o,onDismiss:s,onNoteActionClick:i})=>{if(t)return;if(!e)return Object(a.createElement)(u.a,{className:"woocommerce-empty-activity-card",title:Object(n.__)("Your inbox is empty",'woocommerce'),icon:!1},Object(n.__)("As things begin to happen in your store your inbox will start to fill up. You'll see things like achievements, new feature announcements, extension recommendations and more!",'woocommerce'));const b=Object(_.a)(),O=e=>{Object(r.recordEvent)("inbox_note_view",{note_content:e.content,note_name:e.name,note_title:e.title,note_type:e.type,screen:b})},N=Object.keys(o).map(e=>o[e]);return Object(a.createElement)(l.a,{role:"menu"},N.map(e=>{const{id:t,is_deleted:n}=e;return n?null:Object(a.createElement)(m.a,{key:t,timeout:500,classNames:"woocommerce-inbox-message"},Object(a.createElement)(d.InboxNoteCard,{key:t,note:e,lastRead:c,onDismiss:s,onNoteActionClick:i,onBodyLinkClick:p,onNoteVisible:O}))}))},N={page:1,per_page:s.QUERY_DEFAULTS.pageSize,status:"unactioned",type:s.QUERY_DEFAULTS.noteTypes,orderby:"date",order:"desc",_fields:["id","name","title","content","type","status","actions","date_created","date_created_gmt","layout","image","is_deleted"]};t.a=()=>{const{createNotice:e}=Object(i.useDispatch)("core/notices"),{batchUpdateNotes:t,removeAllNotes:c,removeNote:l,updateNote:m,triggerNoteAction:u}=Object(i.useDispatch)(s.NOTES_STORE_NAME),{isError:p,isResolvingNotes:h,isBatchUpdating:j,notes:v}=Object(i.useSelect)(e=>{const{getNotes:t,getNotesError:c,isResolving:a,isNotesRequesting:n}=e(s.NOTES_STORE_NAME);return{notes:t(N),isError:Boolean(c("getNotes",[N])),isResolvingNotes:a("getNotes",[N]),isBatchUpdating:n("batchUpdateNotes")}}),{updateUserPreferences:w,...y}=Object(s.useUserPreferences)(),[g]=Object(a.useState)(y.activity_panel_inbox_last_read),[E,f]=Object(a.useState)();Object(a.useEffect)(()=>{const e=Date.now();w({activity_panel_inbox_last_read:e})},[]);const C=async(a=!1)=>{const o="all"===E.type,s=Object(_.a)();if(Object(r.recordEvent)("inbox_action_dismiss",{note_name:E.note.name,note_title:E.note.title,note_name_dismiss_all:o,note_name_dismiss_confirmation:a,screen:s}),a){const a=E.note.id,s=!a||o;try{let o=[];if(s)o=await c({status:N.status});else{const e=await l(a);o=[e]}f(void 0),e("success",o.length>1?Object(n.__)("All messages dismissed",'woocommerce'):Object(n.__)("Message dismissed",'woocommerce'),{actions:[{label:Object(n.__)("Undo",'woocommerce'),onClick:()=>{o.length>1?t(o.map(e=>e.id),{is_deleted:0}):m(a,{is_deleted:0})}}]})}catch(t){const c=s?v.length:1;e("error",Object(n._n)("Message could not be dismissed","Messages could not be dismissed",c,'woocommerce')),f(void 0)}}else f(void 0)};if(p){const e=Object(n.__)("There was an error getting your inbox. Please try again.",'woocommerce'),t=Object(n.__)("Reload",'woocommerce'),c=()=>{window.location.reload()};return Object(a.createElement)(o.EmptyContent,{title:e,actionLabel:t,actionURL:null,actionCallback:c})}const k=Object(b.b)(v);return Object(a.createElement)(a.Fragment,null,Object(a.createElement)("div",{className:"woocommerce-homepage-notes-wrapper"},(h||j)&&Object(a.createElement)(o.Section,null,Object(a.createElement)(d.InboxNotePlaceholder,{className:"banner message-is-unread"})),Object(a.createElement)(o.Section,null,!h&&!j&&O({hasNotes:k,isBatchUpdating:j,lastRead:g,notes:v,onDismiss:(e,t)=>{f({note:e,type:t})},onNoteActionClick:(e,t)=>{u(e.id,t.id)}})),E&&Object(a.createElement)(d.InboxDismissConfirmationModal,{onClose:C,onDismiss:()=>C(!0)})))}},524:function(e,t,c){},585:function(e,t,c){},608:function(e,t,c){"use strict";c.r(t),c.d(t,"InboxPanel",(function(){return s}));var a=c(0),n=(c(585),c(523)),o=c(254);const s=({hasAbbreviatedNotifications:e,thingsToDoNextCount:t})=>Object(a.createElement)("div",{className:"woocommerce-notification-panels"},e&&Object(a.createElement)(o.b,{thingsToDoNextCount:t}),Object(a.createElement)(n.a,null));t.default=s},61:function(e,t,c){"use strict";var a=Object.assign||function(e){for(var t,c=1;c<arguments.length;c++)for(var a in t=arguments[c])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e};Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,c=e.size,n=void 0===c?24:c,o=e.onClick,i=(e.icon,e.className),r=function(e,t){var c={};for(var a in e)0<=t.indexOf(a)||Object.prototype.hasOwnProperty.call(e,a)&&(c[a]=e[a]);return c}(e,["size","onClick","icon","className"]),l=["gridicon","gridicons-notice-outline",i,(t=n,!(0!=t%18)&&"needs-offset"),!1,!1].filter(Boolean).join(" ");return s.default.createElement("svg",a({className:l,height:n,width:n,onClick:o},r,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"}),s.default.createElement("g",null,s.default.createElement("path",{d:"M12 4c4.41 0 8 3.59 8 8s-3.59 8-8 8-8-3.59-8-8 3.59-8 8-8m0-2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2zm1 13h-2v2h2v-2zm-2-2h2l.5-6h-3l.5 6z"})))};var n,o=c(5),s=(n=o)&&n.__esModule?n:{default:n};e.exports=t.default}}]);woocommerce-admin/dist/chunks/analytics-report-variations.js000064400000024337151335517650020446 0ustar00(window.__wcAdmin_webpackJsonp=window.__wcAdmin_webpackJsonp||[]).push([[16],{482:function(e,t,o){"use strict";o.r(t);var r=o(0),a=o(2),c=o(1),i=o.n(c),n=o(30),s=o(7),m=o(502),l=o(55);const{addCesSurveyForAnalytics:d}=Object(s.dispatch)(l.c),u=Object(n.applyFilters)("woocommerce_admin_variations_report_charts",[{key:"items_sold",label:Object(a.__)("Items sold",'woocommerce'),order:"desc",orderby:"items_sold",type:"number"},{key:"net_revenue",label:Object(a.__)("Net sales",'woocommerce'),order:"desc",orderby:"net_revenue",type:"currency"},{key:"orders_count",label:Object(a.__)("Orders",'woocommerce'),order:"desc",orderby:"orders_count",type:"number"}]),b=Object(n.applyFilters)("woocommerce_admin_variations_report_filters",[{label:Object(a.__)("Show",'woocommerce'),staticParams:["chartType","paged","per_page"],param:"filter-variations",showFilters:()=>!0,filters:[{label:Object(a.__)("All variations",'woocommerce'),chartMode:"item-comparison",value:"all"},{label:Object(a.__)("Single variation",'woocommerce'),value:"select_variation",subFilters:[{component:"Search",value:"single_variation",path:["select_variation"],settings:{type:"variations",param:"variations",getLabels:m.g,labels:{placeholder:Object(a.__)("Type to search for a variation",'woocommerce'),button:Object(a.__)("Single variation",'woocommerce')}}}]},{label:Object(a.__)("Comparison",'woocommerce'),chartMode:"item-comparison",value:"compare-variations",settings:{type:"variations",param:"variations",getLabels:m.g,labels:{helpText:Object(a.__)("Check at least two variations below to compare",'woocommerce'),placeholder:Object(a.__)("Search for variations to compare",'woocommerce'),title:Object(a.__)("Compare Variations",'woocommerce'),update:Object(a.__)("Compare",'woocommerce')},onClick:d}},{label:Object(a.__)("Advanced filters",'woocommerce'),value:"advanced"}]}]),_=Object(n.applyFilters)("woocommerce_admin_variations_report_advanced_filters",{title:Object(a._x)("Variations match {{select /}} filters","A sentence describing filters for Variations. See screen shot for context: https://cloudup.com/cSsUY9VeCVJ",'woocommerce'),filters:{attribute:{allowMultiple:!0,labels:{add:Object(a.__)("Attribute",'woocommerce'),placeholder:Object(a.__)("Search attributes",'woocommerce'),remove:Object(a.__)("Remove attribute filter",'woocommerce'),rule:Object(a.__)("Select a product attribute filter match",'woocommerce'),title:Object(a.__)("{{title}}Attribute{{/title}} {{rule /}} {{filter /}}",'woocommerce'),filter:Object(a.__)("Select attributes",'woocommerce')},rules:[{value:"is",label:Object(a._x)("Is","product attribute",'woocommerce')},{value:"is_not",label:Object(a._x)("Is Not","product attribute",'woocommerce')}],input:{component:"ProductAttribute"}},category:{labels:{add:Object(a.__)("Categories",'woocommerce'),placeholder:Object(a.__)("Search categories",'woocommerce'),remove:Object(a.__)("Remove categories filter",'woocommerce'),rule:Object(a.__)("Select a category filter match",'woocommerce'),title:Object(a.__)("{{title}}Category{{/title}} {{rule /}} {{filter /}}",'woocommerce'),filter:Object(a.__)("Select categories",'woocommerce')},rules:[{value:"includes",label:Object(a._x)("Includes","categories",'woocommerce')},{value:"excludes",label:Object(a._x)("Excludes","categories",'woocommerce')}],input:{component:"Search",type:"categories",getLabels:m.a}},product:{labels:{add:Object(a.__)("Products",'woocommerce'),placeholder:Object(a.__)("Search products",'woocommerce'),remove:Object(a.__)("Remove products filter",'woocommerce'),rule:Object(a.__)("Select a product filter match",'woocommerce'),title:Object(a.__)("{{title}}Product{{/title}} {{rule /}} {{filter /}}",'woocommerce'),filter:Object(a.__)("Select products",'woocommerce')},rules:[{value:"includes",label:Object(a._x)("Includes","products",'woocommerce')},{value:"excludes",label:Object(a._x)("Excludes","products",'woocommerce')}],input:{component:"Search",type:"variableProducts",getLabels:m.d}}}});var p=o(510),v=o(508),j=o(504),O=o(511),y=o(532),f=o(505);const w=e=>{const{itemsLabel:t,mode:o}=(({query:e})=>{const t="compare-variations"===e["filter-variations"]&&e.variations&&e.variations.split(",").length>1;return{compareObject:"variations",itemsLabel:Object(a.__)("%d variations",'woocommerce'),mode:t?"item-comparison":"time-comparison"}})(e),{path:c,query:i,isError:n,isRequesting:s}=e;if(n)return Object(r.createElement)(j.a,null);const m={...i};return"item-comparison"===o&&(m.segmentby="variation"),Object(r.createElement)(r.Fragment,null,Object(r.createElement)(f.a,{query:i,path:c,filters:b,advancedFilters:_,report:"variations"}),Object(r.createElement)(O.a,{mode:o,charts:u,endpoint:"variations",isRequesting:s,query:m,selectedChart:Object(p.a)(i.chart,u),filters:b,advancedFilters:_}),Object(r.createElement)(v.a,{charts:u,mode:o,filters:b,advancedFilters:_,endpoint:"variations",isRequesting:s,itemsLabel:t,path:c,query:m,selectedChart:Object(p.a)(m.chart,u)}),Object(r.createElement)(y.a,{isRequesting:s,query:i,filters:b,advancedFilters:_}))};w.propTypes={path:i.a.string.isRequired,query:i.a.object.isRequired};t.default=w},502:function(e,t,o){"use strict";o.d(t,"e",(function(){return d})),o.d(t,"a",(function(){return u})),o.d(t,"b",(function(){return b})),o.d(t,"c",(function(){return _})),o.d(t,"d",(function(){return p})),o.d(t,"f",(function(){return v})),o.d(t,"h",(function(){return j})),o.d(t,"g",(function(){return O}));var r=o(15),a=o(17),c=o.n(a),i=o(4),n=o(12),s=o(11),m=o(13),l=o(503);function d(e,t=i.identity){return function(o="",a){const i="function"==typeof e?e(a):e,s=Object(n.getIdsFromQuery)(o);if(s.length<1)return Promise.resolve([]);const m={include:s.join(","),per_page:s.length};return c()({path:Object(r.addQueryArgs)(i,m)}).then(e=>e.map(t))}}d(s.NAMESPACE+"/products/attributes",e=>({key:e.id,label:e.name}));const u=d(s.NAMESPACE+"/products/categories",e=>({key:e.id,label:e.name})),b=d(s.NAMESPACE+"/coupons",e=>({key:e.id,label:e.code})),_=d(s.NAMESPACE+"/customers",e=>({key:e.id,label:e.name})),p=d(s.NAMESPACE+"/products",e=>({key:e.id,label:e.name})),v=d(s.NAMESPACE+"/taxes",e=>({key:e.id,label:Object(l.a)(e)}));function j({attributes:e,name:t}){const o=Object(m.f)("variationTitleAttributesSeparator"," - ");if(t&&t.indexOf(o)>-1)return t;const r=(e||[]).map(({option:e})=>e).join(", ");return r?t+o+r:t}const O=d(({products:e})=>e?s.NAMESPACE+`/products/${e}/variations`:s.NAMESPACE+"/variations",e=>({key:e.id,label:j(e)}))},503:function(e,t,o){"use strict";o.d(t,"a",(function(){return a}));var r=o(2);function a(e){return[e.country,e.state,e.name||Object(r.__)("TAX",'woocommerce'),e.priority].map(e=>e.toString().toUpperCase().trim()).filter(Boolean).join("-")}},513:function(e,t,o){"use strict";function r(e,t,o){return!!t&&(e&&t<=o==="instock")}o.d(t,"a",(function(){return r}))},532:function(e,t,o){"use strict";var r=o(0),a=o(2),c=o(4),i=o(21),n=o(12),s=o(120),m=o(13),l=o(506),d=o(513),u=o(501),b=o(502);const _=Object(m.f)("manageStock","no"),p=Object(m.f)("stockStatuses",{});class v extends r.Component{constructor(){super(),this.getHeadersContent=this.getHeadersContent.bind(this),this.getRowsContent=this.getRowsContent.bind(this),this.getSummary=this.getSummary.bind(this)}getHeadersContent(){return[{label:Object(a.__)("Product / Variation title",'woocommerce'),key:"name",required:!0,isLeftAligned:!0},{label:Object(a.__)("SKU",'woocommerce'),key:"sku",hiddenByDefault:!0,isSortable:!0},{label:Object(a.__)("Items sold",'woocommerce'),key:"items_sold",required:!0,defaultSort:!0,isSortable:!0,isNumeric:!0},{label:Object(a.__)("Net sales",'woocommerce'),screenReaderLabel:Object(a.__)("Net sales",'woocommerce'),key:"net_revenue",required:!0,isSortable:!0,isNumeric:!0},{label:Object(a.__)("Orders",'woocommerce'),key:"orders_count",isSortable:!0,isNumeric:!0},"yes"===_?{label:Object(a.__)("Status",'woocommerce'),key:"stock_status"}:null,"yes"===_?{label:Object(a.__)("Stock",'woocommerce'),key:"stock",isNumeric:!0}:null].filter(Boolean)}getRowsContent(e=[]){const{query:t}=this.props,o=Object(n.getPersistedQuery)(t),{formatAmount:l,formatDecimal:u,getCurrencyConfig:v}=this.context;return Object(c.map)(e,e=>{const{items_sold:t,net_revenue:c,orders_count:j,product_id:O,variation_id:y}=e,f=e.extended_info||{},{stock_status:w,stock_quantity:h,low_stock_amount:g,sku:S}=f,k=(C=e,Object(b.h)(C.extended_info||{}));var C;const A=Object(n.getNewPath)(o,"/analytics/orders",{filter:"advanced",variation_includes:y}),E=Object(m.e)(`post.php?post=${O}&action=edit`);return[{display:Object(r.createElement)(i.Link,{href:E,type:"wp-admin"},k),value:k},{display:S,value:S},{display:Object(s.formatValue)(v(),"number",t),value:t},{display:l(c),value:u(c)},{display:Object(r.createElement)(i.Link,{href:A,type:"wc-admin"},j),value:j},"yes"===_?{display:Object(d.a)(w,h,g)?Object(r.createElement)(i.Link,{href:E,type:"wp-admin"},Object(a._x)("Low","Indication of a low quantity",'woocommerce')):p[w],value:p[w]}:null,"yes"===_?{display:h,value:h}:null].filter(Boolean)})}getSummary(e){const{variations_count:t=0,items_sold:o=0,net_revenue:r=0,orders_count:c=0}=e,{formatAmount:i,getCurrencyConfig:n}=this.context,m=n();return[{label:Object(a._n)("variation sold","variations sold",t,'woocommerce'),value:Object(s.formatValue)(m,"number",t)},{label:Object(a._n)("item sold","items sold",o,'woocommerce'),value:Object(s.formatValue)(m,"number",o)},{label:Object(a.__)("net sales",'woocommerce'),value:i(r)},{label:Object(a._n)("orders","orders",c,'woocommerce'),value:Object(s.formatValue)(m,"number",c)}]}render(){const{advancedFilters:e,baseSearchQuery:t,filters:o,isRequesting:c,query:i}=this.props,n={helpText:Object(a.__)("Check at least two variations below to compare",'woocommerce'),placeholder:Object(a.__)("Search by variation name or SKU",'woocommerce')};return Object(r.createElement)(l.a,{baseSearchQuery:t,compareBy:"variations",compareParam:"filter-variations",endpoint:"variations",getHeadersContent:this.getHeadersContent,getRowsContent:this.getRowsContent,isRequesting:c,itemIdField:"variation_id",labels:n,query:i,getSummary:this.getSummary,summaryFields:["variations_count","items_sold","net_revenue","orders_count"],tableQuery:{orderby:i.orderby||"items_sold",order:i.order||"desc",extended_info:!0,product_includes:i.products,variations:i.variations},title:Object(a.__)("Variations",'woocommerce'),columnPrefsKey:"variations_report_columns",filters:o,advancedFilters:e})}}v.contextType=u.a,t.a=v}}]);woocommerce-admin/dist/chunks/analytics-report-coupons.js000064400000017142151335517650017751 0ustar00(window.__wcAdmin_webpackJsonp=window.__wcAdmin_webpackJsonp||[]).push([[8],{484:function(e,t,o){"use strict";o.r(t);var n=o(0),r=o(1),c=o.n(r),a=o(2),s=o(534),i=o(4),u=o(21),m=o(12),d=o(120),l=o(13),p=o(19),b=o(506),_=o(501);class y extends n.Component{constructor(){super(),this.getHeadersContent=this.getHeadersContent.bind(this),this.getRowsContent=this.getRowsContent.bind(this),this.getSummary=this.getSummary.bind(this)}getHeadersContent(){return[{label:Object(a.__)("Coupon code",'woocommerce'),key:"code",required:!0,isLeftAligned:!0,isSortable:!0},{label:Object(a.__)("Orders",'woocommerce'),key:"orders_count",required:!0,defaultSort:!0,isSortable:!0,isNumeric:!0},{label:Object(a.__)("Amount discounted",'woocommerce'),key:"amount",isSortable:!0,isNumeric:!0},{label:Object(a.__)("Created",'woocommerce'),key:"created"},{label:Object(a.__)("Expires",'woocommerce'),key:"expires"},{label:Object(a.__)("Type",'woocommerce'),key:"type"}]}getRowsContent(e){const{query:t}=this.props,o=Object(m.getPersistedQuery)(t),r=Object(l.f)("dateFormat",p.defaultTableDateFormat),{formatAmount:c,formatDecimal:s,getCurrencyConfig:b}=this.context;return Object(i.map)(e,e=>{const{amount:t,coupon_id:i,orders_count:l}=e,p=e.extended_info||{},{code:_,date_created:y,date_expires:f,discount_type:j}=p,O=i>0?Object(m.getNewPath)(o,"/analytics/coupons",{filter:"single_coupon",coupons:i}):null,h=null===O?_:Object(n.createElement)(u.Link,{href:O,type:"wc-admin"},_),g=i>0?Object(m.getNewPath)(o,"/analytics/orders",{filter:"advanced",coupon_includes:i}):null;return[{display:h,value:_},{display:null===g?l:Object(n.createElement)(u.Link,{href:g,type:"wc-admin"},Object(d.formatValue)(b(),"number",l)),value:l},{display:c(t),value:s(t)},{display:y?Object(n.createElement)(u.Date,{date:y,visibleFormat:r}):Object(a.__)("N/A",'woocommerce'),value:y},{display:f?Object(n.createElement)(u.Date,{date:f,visibleFormat:r}):Object(a.__)("N/A",'woocommerce'),value:f},{display:this.getCouponType(j),value:j}]})}getSummary(e){const{coupons_count:t=0,orders_count:o=0,amount:n=0}=e,{formatAmount:r,getCurrencyConfig:c}=this.context,s=c();return[{label:Object(a._n)("Coupon","Coupons",t,'woocommerce'),value:Object(d.formatValue)(s,"number",t)},{label:Object(a._n)("Order","Orders",o,'woocommerce'),value:Object(d.formatValue)(s,"number",o)},{label:Object(a.__)("Amount discounted",'woocommerce'),value:r(n)}]}getCouponType(e){return{percent:Object(a.__)("Percentage",'woocommerce'),fixed_cart:Object(a.__)("Fixed cart",'woocommerce'),fixed_product:Object(a.__)("Fixed product",'woocommerce')}[e]||Object(a.__)("N/A",'woocommerce')}render(){const{advancedFilters:e,filters:t,isRequesting:o,query:r}=this.props;return Object(n.createElement)(b.a,{compareBy:"coupons",endpoint:"coupons",getHeadersContent:this.getHeadersContent,getRowsContent:this.getRowsContent,getSummary:this.getSummary,summaryFields:["coupons_count","orders_count","amount"],isRequesting:o,itemIdField:"coupon_id",query:r,searchBy:"coupons",tableQuery:{orderby:r.orderby||"orders_count",order:r.order||"desc",extended_info:!0},title:Object(a.__)("Coupons",'woocommerce'),columnPrefsKey:"coupons_report_columns",filters:t,advancedFilters:e})}}y.contextType=_.a;var f=y,j=o(510),O=o(508),h=o(511),g=o(505);class w extends n.Component{getChartMeta(){const{query:e}=this.props,t="compare-coupons"===e.filter&&e.coupons&&e.coupons.split(",").length>1?"item-comparison":"time-comparison";return{itemsLabel:Object(a.__)("%d coupons",'woocommerce'),mode:t}}render(){const{isRequesting:e,query:t,path:o}=this.props,{mode:r,itemsLabel:c}=this.getChartMeta(),a={...t};return"item-comparison"===r&&(a.segmentby="coupon"),Object(n.createElement)(n.Fragment,null,Object(n.createElement)(g.a,{query:t,path:o,filters:s.c,advancedFilters:s.a,report:"coupons"}),Object(n.createElement)(h.a,{charts:s.b,endpoint:"coupons",isRequesting:e,query:a,selectedChart:Object(j.a)(t.chart,s.b),filters:s.c,advancedFilters:s.a}),Object(n.createElement)(O.a,{charts:s.b,filters:s.c,advancedFilters:s.a,mode:r,endpoint:"coupons",path:o,query:a,isRequesting:e,itemsLabel:c,selectedChart:Object(j.a)(t.chart,s.b)}),Object(n.createElement)(f,{isRequesting:e,query:t,filters:s.c,advancedFilters:s.a}))}}w.propTypes={query:c.a.object.isRequired};t.default=w},502:function(e,t,o){"use strict";o.d(t,"e",(function(){return d})),o.d(t,"a",(function(){return l})),o.d(t,"b",(function(){return p})),o.d(t,"c",(function(){return b})),o.d(t,"d",(function(){return _})),o.d(t,"f",(function(){return y})),o.d(t,"h",(function(){return f})),o.d(t,"g",(function(){return j}));var n=o(15),r=o(17),c=o.n(r),a=o(4),s=o(12),i=o(11),u=o(13),m=o(503);function d(e,t=a.identity){return function(o="",r){const a="function"==typeof e?e(r):e,i=Object(s.getIdsFromQuery)(o);if(i.length<1)return Promise.resolve([]);const u={include:i.join(","),per_page:i.length};return c()({path:Object(n.addQueryArgs)(a,u)}).then(e=>e.map(t))}}d(i.NAMESPACE+"/products/attributes",e=>({key:e.id,label:e.name}));const l=d(i.NAMESPACE+"/products/categories",e=>({key:e.id,label:e.name})),p=d(i.NAMESPACE+"/coupons",e=>({key:e.id,label:e.code})),b=d(i.NAMESPACE+"/customers",e=>({key:e.id,label:e.name})),_=d(i.NAMESPACE+"/products",e=>({key:e.id,label:e.name})),y=d(i.NAMESPACE+"/taxes",e=>({key:e.id,label:Object(m.a)(e)}));function f({attributes:e,name:t}){const o=Object(u.f)("variationTitleAttributesSeparator"," - ");if(t&&t.indexOf(o)>-1)return t;const n=(e||[]).map(({option:e})=>e).join(", ");return n?t+o+n:t}const j=d(({products:e})=>e?i.NAMESPACE+`/products/${e}/variations`:i.NAMESPACE+"/variations",e=>({key:e.id,label:f(e)}))},503:function(e,t,o){"use strict";o.d(t,"a",(function(){return r}));var n=o(2);function r(e){return[e.country,e.state,e.name||Object(n.__)("TAX",'woocommerce'),e.priority].map(e=>e.toString().toUpperCase().trim()).filter(Boolean).join("-")}},534:function(e,t,o){"use strict";o.d(t,"b",(function(){return u})),o.d(t,"a",(function(){return m})),o.d(t,"c",(function(){return l}));var n=o(2),r=o(30),c=o(7),a=o(502),s=o(55);const{addCesSurveyForAnalytics:i}=Object(c.dispatch)(s.c),u=Object(r.applyFilters)("woocommerce_admin_coupons_report_charts",[{key:"orders_count",label:Object(n.__)("Discounted orders",'woocommerce'),order:"desc",orderby:"orders_count",type:"number"},{key:"amount",label:Object(n.__)("Amount",'woocommerce'),order:"desc",orderby:"amount",type:"currency"}]),m=Object(r.applyFilters)("woocommerce_admin_coupon_report_advanced_filters",{filters:{},title:Object(n._x)("Coupons match {{select /}} filters","A sentence describing filters for Coupons. See screen shot for context: https://cloudup.com/cSsUY9VeCVJ",'woocommerce')}),d=[{label:Object(n.__)("All coupons",'woocommerce'),value:"all"},{label:Object(n.__)("Single coupon",'woocommerce'),value:"select_coupon",chartMode:"item-comparison",subFilters:[{component:"Search",value:"single_coupon",chartMode:"item-comparison",path:["select_coupon"],settings:{type:"coupons",param:"coupons",getLabels:a.b,labels:{placeholder:Object(n.__)("Type to search for a coupon",'woocommerce'),button:Object(n.__)("Single Coupon",'woocommerce')}}}]},{label:Object(n.__)("Comparison",'woocommerce'),value:"compare-coupons",settings:{type:"coupons",param:"coupons",getLabels:a.b,labels:{title:Object(n.__)("Compare Coupon Codes",'woocommerce'),update:Object(n.__)("Compare",'woocommerce'),helpText:Object(n.__)("Check at least two coupon codes below to compare",'woocommerce')},onClick:i}}];Object.keys(m.filters).length&&d.push({label:Object(n.__)("Advanced filters",'woocommerce'),value:"advanced"});const l=Object(r.applyFilters)("woocommerce_admin_coupons_report_filters",[{label:Object(n.__)("Show",'woocommerce'),staticParams:["chartType","paged","per_page"],param:"filter",showFilters:()=>!0,filters:d}])}}]);woocommerce-admin/dist/chunks/shipping-recommendations.js000064400000021363151335517650017773 0ustar00(window.__wcAdmin_webpackJsonp=window.__wcAdmin_webpackJsonp||[]).push([[48],{507:function(e,t,c){"use strict";c.d(t,"a",(function(){return o}));var i=c(7);function o(e){const{createNotice:t}=Object(i.dispatch)("core/notices");e.error_data&&e.errors&&Object.keys(e.errors).length?Object.keys(e.errors).forEach(c=>{t("error",e.errors[c].join(" "))}):e.message&&t(e.code?"error":"success",e.message)}},537:function(e,t,c){"use strict";var i=Object.assign||function(e){for(var t,c=1;c<arguments.length;c++)for(var i in t=arguments[c])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e};Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,c=e.size,o=void 0===c?24:c,n=e.onClick,j=(e.icon,e.className),M=function(e,t){var c={};for(var i in e)0<=t.indexOf(i)||Object.prototype.hasOwnProperty.call(e,i)&&(c[i]=e[i]);return c}(e,["size","onClick","icon","className"]),u=["gridicon","gridicons-external",j,(t=o,!(0!=t%18)&&"needs-offset"),!1,!1].filter(Boolean).join(" ");return s.default.createElement("svg",i({className:u,height:o,width:o,onClick:n},M,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"}),s.default.createElement("g",null,s.default.createElement("path",{d:"M19 13v6c0 1.105-.895 2-2 2H5c-1.105 0-2-.895-2-2V7c0-1.105.895-2 2-2h6v2H5v12h12v-6h2zM13 3v2h4.586l-7.793 7.793 1.414 1.414L19 6.414V11h2V3h-8z"})))};var o,n=c(5),s=(o=n)&&o.__esModule?o:{default:o};e.exports=t.default},587:function(e,t,c){},588:function(e,t,c){},589:function(e,t){e.exports="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxMjAgMTIwIj48cGF0aCBmaWxsPSIjN2Q1N2E0IiBkPSJNMCAwaDEyMHYxMjBIMHoiLz48cGF0aCBmaWxsPSIjZmZmIiBkPSJNNjcuNDggNTMuNTVjLTEuMTktLjI2LTIuMzMuNDItMy40MyAyLjAzLS44NyAxLjI2LTEuNDUgMi41Ni0xLjc0IDMuOTEtLjE2Ljc3LS4yNCAxLjU4LS4yNCAyLjQxIDAgLjk3LjE5IDEuOTYuNTggMi45OS40OCAxLjI2IDEuMTMgMS45NiAxLjkzIDIuMTIuOC4xNiAxLjY5LS4xOSAyLjY2LTEuMDYgMS4yMi0xLjA5IDIuMDYtMi43MiAyLjUxLTQuODguMTYtLjc3LjI0LTEuNTguMjQtMi40MSAwLS45Ny0uMTktMS45Ni0uNTgtMi45OS0uNDgtMS4yNS0xLjEyLTEuOTYtMS45My0yLjEyem0yMC42MiAwYy0xLjE5LS4yNi0yLjMzLjQyLTMuNDMgMi4wMy0uODcgMS4yNi0xLjQ1IDIuNTYtMS43NCAzLjkxLS4xNi43Ny0uMjQgMS41OC0uMjQgMi40MSAwIC45Ny4xOSAxLjk2LjU4IDIuOTkuNDggMS4yNiAxLjEzIDEuOTYgMS45MyAyLjEyLjguMTYgMS42OS0uMTkgMi42Ni0xLjA2IDEuMjItMS4wOSAyLjA2LTIuNzIgMi41MS00Ljg4LjE2LS43Ny4yNC0xLjU4LjI0LTIuNDEgMC0uOTctLjE5LTEuOTYtLjU4LTIuOTktLjQ4LTEuMjUtMS4xMi0xLjk2LTEuOTMtMi4xMnoiLz48cGF0aCBmaWxsPSIjZmZmIiBkPSJNOTIuNzYgNDBIMjcuMjRjLTQuMTQgMC03LjUgMy4zNi03LjUgNy41djI0Ljk4YzAgNC4xNCAzLjM2IDcuNSA3LjUgNy41aDMxLjA0bDE0LjE5IDcuOS0zLjIyLTcuOWgyMy41YzQuMTQgMCA3LjUtMy4zNiA3LjUtNy41VjQ3LjVjLjAxLTQuMTQtMy4zNS03LjUtNy40OS03LjV6TTUyLjc0IDcyLjkxYy4wNi44NC0uMDcgMS41NS0uMzggMi4xNi0uNC43NC0uOTggMS4xMy0xLjc1IDEuMTktLjg3LjA2LTEuNzMtLjM1LTIuNi0xLjIyLTMuMDYtMy4xNC01LjQ5LTcuODEtNy4yOC0xNC0yLjEyIDQuMjEtMy43MSA3LjM3LTQuNzUgOS40OC0xLjkzIDMuNzItMy41OSA1LjYyLTQuOTcgNS43Mi0uOS4wNi0xLjY2LS42OS0yLjI5LTIuMjYtMS42OS00LjMtMy41LTEyLjYzLTUuNDQtMjQuOTctLjEzLS44Ni4wNS0xLjYuNTItMi4yMS40Ny0uNjEgMS4xNi0uOTUgMi4wNi0xLjAyIDEuNjctLjEyIDIuNjMuNjcgMi44OCAyLjM2IDEuMDMgNi44NiAyLjE0IDEyLjY5IDMuMzEgMTcuNDhsNy4yMS0xMy43MmMuNjYtMS4yNCAxLjQ4LTEuOSAyLjQ3LTEuOTcgMS40NC0uMSAyLjM1LjgyIDIuNzEgMi43Ni44MiA0LjM2IDEuODYgOC4xMSAzLjEyIDExLjI1Ljg2LTguMzUgMi4zMS0xNC4zOSA0LjM0LTE4LjExLjQ4LS45IDEuMjEtMS4zOSAyLjE3LTEuNDYuNzctLjA1IDEuNDYuMTYgMi4wOC42NS42Mi40OS45NSAxLjEyIDEgMS44OS4wNC41OC0uMDcgMS4xLS4zMiAxLjU3LTEuMjggMi4zOC0yLjM0IDYuMzQtMy4xOCAxMS44OS0uODIgNS4zNC0xLjEzIDkuNTMtLjkxIDEyLjU0em0yMC4yLTUuMTZjLTEuOTYgMy4yOC00LjU0IDQuOTItNy43MiA0LjkyLS41OCAwLTEuMTgtLjA3LTEuNzktLjE5LTIuMzItLjQ4LTQuMDctMS43NS01LjI2LTMuODEtMS4wNi0xLjgtMS41OS0zLjk3LTEuNTktNi41MiAwLTMuMzguODUtNi40NyAyLjU2LTkuMjcgMi0zLjI4IDQuNTctNC45MiA3LjcyLTQuOTIuNTggMCAxLjE3LjA3IDEuNzkuMTkgMi4zMi40OCA0LjA3IDEuNzUgNS4yNiAzLjgxIDEuMDYgMS43NyAxLjU5IDMuOTMgMS41OSA2LjQ3LS4wMSAzLjM4LS44NiA2LjQ4LTIuNTYgOS4zMnptMjAuNjIgMGMtMS45NiAzLjI4LTQuNTQgNC45Mi03LjcyIDQuOTItLjU4IDAtMS4xNy0uMDctMS43OC0uMTktMi4zMi0uNDgtNC4wNy0xLjc1LTUuMjYtMy44MS0xLjA2LTEuOC0xLjU5LTMuOTctMS41OS02LjUyIDAtMy4zOC44NS02LjQ3IDIuNTYtOS4yNyAyLTMuMjggNC41Ny00LjkyIDcuNzItNC45Mi41OCAwIDEuMTcuMDcgMS43OC4xOSAyLjMyLjQ4IDQuMDcgMS43NSA1LjI2IDMuODEgMS4wNiAxLjc3IDEuNTkgMy45MyAxLjU5IDYuNDcgMCAzLjM4LS44NiA2LjQ4LTIuNTYgOS4zMnoiLz48L3N2Zz4K"},590:function(e,t,c){},616:function(e,t,c){"use strict";c.r(t);var i=c(0),o=c(2),n=c(7),s=c(20),j=c(11),M=c(537),u=c.n(M),r=c(3),m=c(507),a=c(21),L=c(6),l=c.n(L);c(587);const N=Object(i.createContext)(""),O=({children:e,onDismiss:t=(()=>null)})=>{const{updateOptions:c}=Object(n.useDispatch)(j.OPTIONS_STORE_NAME),s=Object(i.useContext)(N),M=()=>{t(),c({[s]:"yes"})};return Object(i.createElement)(r.CardHeader,null,Object(i.createElement)("div",{className:"woocommerce-dismissable-list__header"},e),Object(i.createElement)("div",null,Object(i.createElement)(a.EllipsisMenu,{label:Object(o.__)("Task List Options",'woocommerce'),renderContent:()=>Object(i.createElement)("div",{className:"woocommerce-dismissable-list__controls"},Object(i.createElement)(r.Button,{onClick:M},Object(o.__)("Hide this",'woocommerce')))})))},g=({children:e,className:t,dismissOptionName:c})=>Object(n.useSelect)(e=>{const{getOption:t,hasFinishedResolution:i}=e(j.OPTIONS_STORE_NAME),o=i("getOption",[c]),n="yes"===t(c);return o&&!n})?Object(i.createElement)(r.Card,{size:"medium",className:l()("woocommerce-dismissable-list",t)},Object(i.createElement)(N.Provider,{value:c},e)):null;var S=c(13),y=(c(588),c(589)),E=c.n(y);var T=({onSetupClick:e,pluginsBeingSetup:t})=>{Object(S.f)("wcAdminAssetUrl","");const{createSuccessNotice:c}=Object(n.useDispatch)("core/notices"),s=Object(n.useSelect)(e=>e(j.PLUGINS_STORE_NAME).isJetpackConnected());return Object(i.createElement)("div",{className:"woocommerce-list__item-inner woocommerce-services-item"},Object(i.createElement)("div",{className:"woocommerce-list__item-before"},Object(i.createElement)("img",{className:"woocommerce-services-item__logo",src:E.a,alt:""})),Object(i.createElement)("div",{className:"woocommerce-list__item-text"},Object(i.createElement)("span",{className:"woocommerce-list__item-title"},Object(o.__)("Woocommerce Shipping",'woocommerce'),Object(i.createElement)(a.Pill,null,Object(o.__)("Recommended",'woocommerce'))),Object(i.createElement)("span",{className:"woocommerce-list__item-content"},Object(o.__)("Print USPS and DHL Express labels straight from your WooCommerce dashboard and save on shipping.",'woocommerce'),Object(i.createElement)("br",null),Object(i.createElement)(r.ExternalLink,{href:"https://woocommerce.com/woocommerce-shipping/"},Object(o.__)("Learn more",'woocommerce')))),Object(i.createElement)("div",{className:"woocommerce-list__item-after"},Object(i.createElement)(r.Button,{isSecondary:!0,onClick:()=>{e(["woocommerce-services"]).then(()=>{const e=[];s||e.push({url:Object(S.e)("plugins.php"),label:Object(o.__)("Finish the setup by connecting your store to Jetpack.",'woocommerce')}),c(Object(o.__)("🎉 WooCommerce Shipping is installed!",'woocommerce'),{actions:e})})},isBusy:t.includes("woocommerce-services"),disabled:t.length>0},Object(o.__)("Get started",'woocommerce'))))};c(590);const d=({children:e})=>Object(i.createElement)(g,{className:"woocommerce-recommended-shipping-extensions",dismissOptionName:"woocommerce_settings_shipping_recommendations_hidden"},Object(i.createElement)(O,null,Object(i.createElement)(s.Text,{variant:"title.small",as:"p",size:"20",lineHeight:"28px"},Object(o.__)("Recommended shipping solutions",'woocommerce')),Object(i.createElement)(s.Text,{className:"woocommerce-recommended-shipping__header-heading",variant:"caption",as:"p",size:"12",lineHeight:"16px"},Object(o.__)('We recommend adding one of the following shipping extensions to your store. The extension will be installed and activated for you when you click "Get started".','woocommerce'))),Object(i.createElement)("ul",{className:"woocommerce-list"},i.Children.map(e,e=>Object(i.createElement)("li",{className:"woocommerce-list__item"},e))),Object(i.createElement)(r.CardFooter,null,Object(i.createElement)(r.Button,{className:"woocommerce-recommended-shipping-extensions__more_options_cta",href:"https://woocommerce.com/product-category/woocommerce-extensions/shipping-methods/?utm_source=shipping_recommendations",target:"_blank",isTertiary:!0},Object(o.__)("See more options",'woocommerce'),Object(i.createElement)(r.VisuallyHidden,null,Object(o.__)("(opens in a new tab)",'woocommerce')),Object(i.createElement)(u.a,{size:18}))));t.default=()=>{const[e,t]=(()=>{const[e,t]=Object(i.useState)([]),{installAndActivatePlugins:c}=Object(n.useDispatch)(j.PLUGINS_STORE_NAME);return[e,i=>e.length>0?Promise.resolve():(t(i),c(i).then(()=>{t([])}).catch(e=>(Object(m.a)(e),t([]),Promise.reject())))]})();return Object(n.useSelect)(e=>e(j.PLUGINS_STORE_NAME).getActivePlugins()).includes("woocommerce-services")?null:Object(i.createElement)(d,null,Object(i.createElement)(T,{pluginsBeingSetup:e,onSetupClick:t}))}}}]);woocommerce-admin/dist/chunks/analytics-report-orders.js000064400000031620151335517650017556 0ustar00(window.__wcAdmin_webpackJsonp=window.__wcAdmin_webpackJsonp||[]).push([[11],{483:function(e,t,o){"use strict";o.r(t),o.d(t,"default",(function(){return h}));var r=o(0),c=o(1),a=o.n(c),n=o(533),m=o(510),l=o(2),i=o(4),s=o(21),d=o(120),u=o(13),b=o(12),_=o(19),p=o(506),O=o(501);o(581);class j extends r.Component{constructor(){super(),this.getHeadersContent=this.getHeadersContent.bind(this),this.getRowsContent=this.getRowsContent.bind(this),this.getSummary=this.getSummary.bind(this)}getHeadersContent(){return[{label:Object(l.__)("Date",'woocommerce'),key:"date",required:!0,defaultSort:!0,isLeftAligned:!0,isSortable:!0},{label:Object(l.__)("Order #",'woocommerce'),screenReaderLabel:Object(l.__)("Order Number",'woocommerce'),key:"order_number",required:!0},{label:Object(l.__)("Status",'woocommerce'),key:"status",required:!1,isSortable:!1},{label:Object(l.__)("Customer",'woocommerce'),key:"customer_id",required:!1,isSortable:!1},{label:Object(l.__)("Customer type",'woocommerce'),key:"customer_type",required:!1,isSortable:!1},{label:Object(l.__)("Product(s)",'woocommerce'),screenReaderLabel:Object(l.__)("Products",'woocommerce'),key:"products",required:!1,isSortable:!1},{label:Object(l.__)("Items sold",'woocommerce'),key:"num_items_sold",required:!1,isSortable:!0,isNumeric:!0},{label:Object(l.__)("Coupon(s)",'woocommerce'),screenReaderLabel:Object(l.__)("Coupons",'woocommerce'),key:"coupons",required:!1,isSortable:!1},{label:Object(l.__)("Net sales",'woocommerce'),screenReaderLabel:Object(l.__)("Net sales",'woocommerce'),key:"net_total",required:!0,isSortable:!0,isNumeric:!0}]}getCustomerName(e){const{first_name:t,last_name:o}=e||{};return t||o?[t,o].join(" "):""}getRowsContent(e){const{query:t}=this.props,o=Object(b.getPersistedQuery)(t),c=Object(u.f)("dateFormat",_.defaultTableDateFormat),{render:a,getCurrencyConfig:n}=this.context;return Object(i.map)(e,e=>{const{currency:t,date_created:m,net_total:i,num_items_sold:_,order_id:p,order_number:O,parent_id:j,status:w,customer_type:f}=e,y=e.extended_info||{},{coupons:v,customer:h,products:S}=y,g=S.sort((e,t)=>t.quantity-e.quantity).map(e=>({label:e.name,quantity:e.quantity,href:Object(b.getNewPath)(o,"/analytics/products",{filter:"single_product",products:e.id})})),C=v.map(e=>({label:e.code,href:Object(b.getNewPath)(o,"/analytics/coupons",{filter:"single_coupon",coupons:e.id})}));return[{display:Object(r.createElement)(s.Date,{date:m,visibleFormat:c}),value:m},{display:Object(r.createElement)(s.Link,{href:"post.php?post="+(j||p)+"&action=edit"+(j?"#order_refunds":""),type:"wp-admin"},O),value:O},{display:Object(r.createElement)(s.OrderStatus,{className:"woocommerce-orders-table__status",order:{status:w},orderStatusMap:Object(u.f)("orderStatuses",{})}),value:w},{display:this.getCustomerName(h),value:this.getCustomerName(h)},{display:(x=f,x.charAt(0).toUpperCase()+x.slice(1)),value:f},{display:this.renderList(g.length?[g[0]]:[],g.map(e=>({label:Object(l.sprintf)(Object(l.__)("%s× %s",'woocommerce'),e.quantity,e.label),href:e.href}))),value:g.map(({quantity:e,label:t})=>Object(l.sprintf)(Object(l.__)("%s× %s",'woocommerce'),e,t)).join(", ")},{display:Object(d.formatValue)(n(),"number",_),value:_},{display:this.renderList(C.length?[C[0]]:[],C),value:C.map(e=>e.label).join(", ")},{display:a(i,t),value:i}];var x})}getSummary(e){const{orders_count:t=0,total_customers:o=0,products:r=0,num_items_sold:c=0,coupons_count:a=0,net_revenue:n=0}=e,{formatAmount:m,getCurrencyConfig:i}=this.context,s=i();return[{label:Object(l._n)("Order","Orders",t,'woocommerce'),value:Object(d.formatValue)(s,"number",t)},{label:Object(l._n)(" Customer"," Customers",o,'woocommerce'),value:Object(d.formatValue)(s,"number",o)},{label:Object(l._n)("Product","Products",r,'woocommerce'),value:Object(d.formatValue)(s,"number",r)},{label:Object(l._n)("Item sold","Items sold",c,'woocommerce'),value:Object(d.formatValue)(s,"number",c)},{label:Object(l._n)("Coupon","Coupons",a,'woocommerce'),value:Object(d.formatValue)(s,"number",a)},{label:Object(l.__)("net sales",'woocommerce'),value:m(n)}]}renderLinks(e=[]){return e.map((e,t)=>Object(r.createElement)(s.Link,{href:e.href,key:t,type:"wc-admin"},e.label))}renderList(e,t){return Object(r.createElement)(r.Fragment,null,this.renderLinks(e),t.length>1&&Object(r.createElement)(s.ViewMoreList,{items:this.renderLinks(t)}))}render(){const{query:e,filters:t,advancedFilters:o}=this.props;return Object(r.createElement)(p.a,{endpoint:"orders",getHeadersContent:this.getHeadersContent,getRowsContent:this.getRowsContent,getSummary:this.getSummary,summaryFields:["orders_count","total_customers","products","num_items_sold","coupons_count","net_revenue"],query:e,tableQuery:{extended_info:!0},title:Object(l.__)("Orders",'woocommerce'),columnPrefsKey:"orders_report_columns",filters:t,advancedFilters:o})}}j.contextType=O.a;var w=j,f=o(508),y=o(511),v=o(505);class h extends r.Component{render(){const{path:e,query:t}=this.props;return Object(r.createElement)(r.Fragment,null,Object(r.createElement)(v.a,{query:t,path:e,filters:n.c,advancedFilters:n.a,report:"orders"}),Object(r.createElement)(y.a,{charts:n.b,endpoint:"orders",query:t,selectedChart:Object(m.a)(t.chart,n.b),filters:n.c,advancedFilters:n.a}),Object(r.createElement)(f.a,{charts:n.b,endpoint:"orders",path:e,query:t,selectedChart:Object(m.a)(t.chart,n.b),filters:n.c,advancedFilters:n.a}),Object(r.createElement)(w,{query:t,filters:n.c,advancedFilters:n.a}))}}h.propTypes={path:a.a.string.isRequired,query:a.a.object.isRequired}},502:function(e,t,o){"use strict";o.d(t,"e",(function(){return d})),o.d(t,"a",(function(){return u})),o.d(t,"b",(function(){return b})),o.d(t,"c",(function(){return _})),o.d(t,"d",(function(){return p})),o.d(t,"f",(function(){return O})),o.d(t,"h",(function(){return j})),o.d(t,"g",(function(){return w}));var r=o(15),c=o(17),a=o.n(c),n=o(4),m=o(12),l=o(11),i=o(13),s=o(503);function d(e,t=n.identity){return function(o="",c){const n="function"==typeof e?e(c):e,l=Object(m.getIdsFromQuery)(o);if(l.length<1)return Promise.resolve([]);const i={include:l.join(","),per_page:l.length};return a()({path:Object(r.addQueryArgs)(n,i)}).then(e=>e.map(t))}}d(l.NAMESPACE+"/products/attributes",e=>({key:e.id,label:e.name}));const u=d(l.NAMESPACE+"/products/categories",e=>({key:e.id,label:e.name})),b=d(l.NAMESPACE+"/coupons",e=>({key:e.id,label:e.code})),_=d(l.NAMESPACE+"/customers",e=>({key:e.id,label:e.name})),p=d(l.NAMESPACE+"/products",e=>({key:e.id,label:e.name})),O=d(l.NAMESPACE+"/taxes",e=>({key:e.id,label:Object(s.a)(e)}));function j({attributes:e,name:t}){const o=Object(i.f)("variationTitleAttributesSeparator"," - ");if(t&&t.indexOf(o)>-1)return t;const r=(e||[]).map(({option:e})=>e).join(", ");return r?t+o+r:t}const w=d(({products:e})=>e?l.NAMESPACE+`/products/${e}/variations`:l.NAMESPACE+"/variations",e=>({key:e.id,label:j(e)}))},503:function(e,t,o){"use strict";o.d(t,"a",(function(){return c}));var r=o(2);function c(e){return[e.country,e.state,e.name||Object(r.__)("TAX",'woocommerce'),e.priority].map(e=>e.toString().toUpperCase().trim()).filter(Boolean).join("-")}},533:function(e,t,o){"use strict";o.d(t,"b",(function(){return m})),o.d(t,"c",(function(){return l})),o.d(t,"a",(function(){return i}));var r=o(2),c=o(30),a=o(13),n=o(502);const m=Object(c.applyFilters)("woocommerce_admin_orders_report_charts",[{key:"orders_count",label:Object(r.__)("Orders",'woocommerce'),type:"number"},{key:"net_revenue",label:Object(r.__)("Net sales",'woocommerce'),order:"desc",orderby:"net_total",type:"currency"},{key:"avg_order_value",label:Object(r.__)("Average order value",'woocommerce'),type:"currency"},{key:"avg_items_per_order",label:Object(r.__)("Average items per order",'woocommerce'),order:"desc",orderby:"num_items_sold",type:"average"}]),l=Object(c.applyFilters)("woocommerce_admin_orders_report_filters",[{label:Object(r.__)("Show",'woocommerce'),staticParams:["chartType","paged","per_page"],param:"filter",showFilters:()=>!0,filters:[{label:Object(r.__)("All orders",'woocommerce'),value:"all"},{label:Object(r.__)("Advanced filters",'woocommerce'),value:"advanced"}]}]),i=Object(c.applyFilters)("woocommerce_admin_orders_report_advanced_filters",{title:Object(r._x)("Orders match {{select /}} filters","A sentence describing filters for Orders. See screen shot for context: https://cloudup.com/cSsUY9VeCVJ",'woocommerce'),filters:{status:{labels:{add:Object(r.__)("Order Status",'woocommerce'),remove:Object(r.__)("Remove order status filter",'woocommerce'),rule:Object(r.__)("Select an order status filter match",'woocommerce'),title:Object(r.__)("{{title}}Order Status{{/title}} {{rule /}} {{filter /}}",'woocommerce'),filter:Object(r.__)("Select an order status",'woocommerce')},rules:[{value:"is",label:Object(r._x)("Is","order status",'woocommerce')},{value:"is_not",label:Object(r._x)("Is Not","order status",'woocommerce')}],input:{component:"SelectControl",options:Object.keys(a.c).map(e=>({value:e,label:a.c[e]}))}},product:{labels:{add:Object(r.__)("Products",'woocommerce'),placeholder:Object(r.__)("Search products",'woocommerce'),remove:Object(r.__)("Remove products filter",'woocommerce'),rule:Object(r.__)("Select a product filter match",'woocommerce'),title:Object(r.__)("{{title}}Product{{/title}} {{rule /}} {{filter /}}",'woocommerce'),filter:Object(r.__)("Select products",'woocommerce')},rules:[{value:"includes",label:Object(r._x)("Includes","products",'woocommerce')},{value:"excludes",label:Object(r._x)("Excludes","products",'woocommerce')}],input:{component:"Search",type:"products",getLabels:n.d}},variation:{labels:{add:Object(r.__)("Variations",'woocommerce'),placeholder:Object(r.__)("Search variations",'woocommerce'),remove:Object(r.__)("Remove variations filter",'woocommerce'),rule:Object(r.__)("Select a variation filter match",'woocommerce'),title:Object(r.__)("{{title}}Variation{{/title}} {{rule /}} {{filter /}}",'woocommerce'),filter:Object(r.__)("Select variation",'woocommerce')},rules:[{value:"includes",label:Object(r._x)("Includes","variations",'woocommerce')},{value:"excludes",label:Object(r._x)("Excludes","variations",'woocommerce')}],input:{component:"Search",type:"variations",getLabels:n.g}},coupon:{labels:{add:Object(r.__)("Coupon Codes",'woocommerce'),placeholder:Object(r.__)("Search coupons",'woocommerce'),remove:Object(r.__)("Remove coupon filter",'woocommerce'),rule:Object(r.__)("Select a coupon filter match",'woocommerce'),title:Object(r.__)("{{title}}Coupon code{{/title}} {{rule /}} {{filter /}}",'woocommerce'),filter:Object(r.__)("Select coupon codes",'woocommerce')},rules:[{value:"includes",label:Object(r._x)("Includes","coupon code",'woocommerce')},{value:"excludes",label:Object(r._x)("Excludes","coupon code",'woocommerce')}],input:{component:"Search",type:"coupons",getLabels:n.b}},customer_type:{labels:{add:Object(r.__)("Customer type",'woocommerce'),remove:Object(r.__)("Remove customer filter",'woocommerce'),rule:Object(r.__)("Select a customer filter match",'woocommerce'),title:Object(r.__)("{{title}}Customer is{{/title}} {{filter /}}",'woocommerce'),filter:Object(r.__)("Select a customer type",'woocommerce')},input:{component:"SelectControl",options:[{value:"new",label:Object(r.__)("New",'woocommerce')},{value:"returning",label:Object(r.__)("Returning",'woocommerce')}],defaultOption:"new"}},refunds:{labels:{add:Object(r.__)("Refunds",'woocommerce'),remove:Object(r.__)("Remove refunds filter",'woocommerce'),rule:Object(r.__)("Select a refund filter match",'woocommerce'),title:Object(r.__)("{{title}}Refunds{{/title}} {{filter /}}",'woocommerce'),filter:Object(r.__)("Select a refund type",'woocommerce')},input:{component:"SelectControl",options:[{value:"all",label:Object(r.__)("All",'woocommerce')},{value:"partial",label:Object(r.__)("Partially refunded",'woocommerce')},{value:"full",label:Object(r.__)("Fully refunded",'woocommerce')},{value:"none",label:Object(r.__)("None",'woocommerce')}],defaultOption:"all"}},tax_rate:{labels:{add:Object(r.__)("Tax Rates",'woocommerce'),placeholder:Object(r.__)("Search tax rates",'woocommerce'),remove:Object(r.__)("Remove tax rate filter",'woocommerce'),rule:Object(r.__)("Select a tax rate filter match",'woocommerce'),title:Object(r.__)("{{title}}Tax Rate{{/title}} {{rule /}} {{filter /}}",'woocommerce'),filter:Object(r.__)("Select tax rates",'woocommerce')},rules:[{value:"includes",label:Object(r._x)("Includes","tax rate",'woocommerce')},{value:"excludes",label:Object(r._x)("Excludes","tax rate",'woocommerce')}],input:{component:"Search",type:"taxes",getLabels:n.f}},attribute:{allowMultiple:!0,labels:{add:Object(r.__)("Attribute",'woocommerce'),placeholder:Object(r.__)("Search attributes",'woocommerce'),remove:Object(r.__)("Remove attribute filter",'woocommerce'),rule:Object(r.__)("Select a product attribute filter match",'woocommerce'),title:Object(r.__)("{{title}}Attribute{{/title}} {{rule /}} {{filter /}}",'woocommerce'),filter:Object(r.__)("Select attributes",'woocommerce')},rules:[{value:"is",label:Object(r._x)("Is","product attribute",'woocommerce')},{value:"is_not",label:Object(r._x)("Is Not","product attribute",'woocommerce')}],input:{component:"ProductAttribute"}}}})},581:function(e,t,o){}}]);woocommerce-admin/dist/chunks/9.style.css000064400000004376151335517650014455 0ustar00:root{--wp-admin-theme-color:#007cba;--wp-admin-theme-color-darker-10:#006ba1;--wp-admin-theme-color-darker-20:#005a87}body.admin-color-light{--wp-admin-theme-color:#0085ba;--wp-admin-theme-color-darker-10:#0073a1;--wp-admin-theme-color-darker-20:#006187}body.admin-color-modern{--wp-admin-theme-color:#3858e9;--wp-admin-theme-color-darker-10:#2145e6;--wp-admin-theme-color-darker-20:#183ad6}body.admin-color-blue{--wp-admin-theme-color:#096484;--wp-admin-theme-color-darker-10:#07526c;--wp-admin-theme-color-darker-20:#064054}body.admin-color-coffee{--wp-admin-theme-color:#46403c;--wp-admin-theme-color-darker-10:#383330;--wp-admin-theme-color-darker-20:#2b2724}body.admin-color-ectoplasm{--wp-admin-theme-color:#523f6d;--wp-admin-theme-color-darker-10:#46365d;--wp-admin-theme-color-darker-20:#3a2c4d}body.admin-color-midnight{--wp-admin-theme-color:#e14d43;--wp-admin-theme-color-darker-10:#dd382d;--wp-admin-theme-color-darker-20:#d02c21}body.admin-color-ocean{--wp-admin-theme-color:#627c83;--wp-admin-theme-color-darker-10:#576e74;--wp-admin-theme-color-darker-20:#4c6066}body.admin-color-sunrise{--wp-admin-theme-color:#dd823b;--wp-admin-theme-color-darker-10:#d97426;--wp-admin-theme-color-darker-20:#c36922}.woocommerce-report-table__scroll-point{position:relative;top:-48px}@media(max-width:782px){.woocommerce-report-table__scroll-point{top:-62px}}.woocommerce-feature-enabled-activity-panels .woocommerce-report-table__scroll-point{top:-108px}@media(max-width:782px){.woocommerce-feature-enabled-activity-panels .woocommerce-report-table__scroll-point{top:-122px}}.woocommerce-report-table .woocommerce-search{flex-grow:1}.woocommerce-report-table .components-card__header{display:grid;grid-gap:12px;grid-template-columns:min-content 1fr min-content}.woocommerce-report-table .woocommerce-table__compare.components-button{padding:8px}.woocommerce-report-table .woocommerce-ellipsis-menu{justify-self:flex-end}button.woocommerce-table__download-button{padding:6px 12px;color:#000;text-decoration:none;align-items:center}button.woocommerce-table__download-button svg{margin-right:8px;height:24px;width:24px}@media(max-width:782px){button.woocommerce-table__download-button svg{margin-right:0}button.woocommerce-table__download-button .woocommerce-table__download-button__label{display:none}}woocommerce-admin/dist/chunks/homescreen.js000064400000422007151335517650015115 0ustar00(window.__wcAdmin_webpackJsonp=window.__wcAdmin_webpackJsonp||[]).push([[31],{167:function(e,t,a){"use strict";var c=Object.assign||function(e){for(var t,a=1;a<arguments.length;a++)for(var c in t=arguments[a])Object.prototype.hasOwnProperty.call(t,c)&&(e[c]=t[c]);return e};Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,a=e.size,r=void 0===a?24:a,n=e.onClick,l=(e.icon,e.className),s=function(e,t){var a={};for(var c in e)0<=t.indexOf(c)||Object.prototype.hasOwnProperty.call(e,c)&&(a[c]=e[c]);return a}(e,["size","onClick","icon","className"]),i=["gridicon","gridicons-star",l,(t=r,!(0!=t%18)&&"needs-offset"),!1,!1].filter(Boolean).join(" ");return o.default.createElement("svg",c({className:i,height:r,width:r,onClick:n},s,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"}),o.default.createElement("g",null,o.default.createElement("path",{d:"M12 2l2.582 6.953L22 9.257l-5.822 4.602L18.18 21 12 16.89 5.82 21l2.002-7.14L2 9.256l7.418-.304"})))};var r,n=a(5),o=(r=n)&&r.__esModule?r:{default:r};e.exports=t.default},501:function(e,t,a){"use strict";a.d(t,"b",(function(){return i})),a.d(t,"a",(function(){return m}));var c=a(0),r=a(30),n=a(89),o=a.n(n),l=a(13);const s=o()(l.a),i=e=>{const t=s.getCurrencyConfig(),a=Object(r.applyFilters)("woocommerce_admin_report_currency",t,e);return o()(a)},m=Object(c.createContext)(s)},509:function(e,t,a){"use strict";var c=a(53);const r=["a","b","em","i","strong","p","br"],n=["target","href","rel","name","download"];t.a=e=>({__html:Object(c.sanitize)(e,{ALLOWED_TAGS:r,ALLOWED_ATTR:n})})},512:function(e,t,a){"use strict";a.d(t,"a",(function(){return O})),a.d(t,"b",(function(){return v}));var c=a(0),r=a(6),n=a.n(r),o=a(61),l=a.n(o),s=a(9),i=a.n(s),m=a(1),A=a.n(m),d=a(21),b=a(3),u=(a(522),a(4));class p extends c.Component{render(){const{className:e,hasAction:t,hasDate:a,hasSubtitle:r,lines:o}=this.props,l=n()("woocommerce-activity-card is-loading",e);return Object(c.createElement)("div",{className:l,"aria-hidden":!0},Object(c.createElement)("span",{className:"woocommerce-activity-card__icon"},Object(c.createElement)("span",{className:"is-placeholder"})),Object(c.createElement)("div",{className:"woocommerce-activity-card__header"},Object(c.createElement)("div",{className:"woocommerce-activity-card__title is-placeholder"}),r&&Object(c.createElement)("div",{className:"woocommerce-activity-card__subtitle is-placeholder"}),a&&Object(c.createElement)("div",{className:"woocommerce-activity-card__date"},Object(c.createElement)("span",{className:"is-placeholder"}))),Object(c.createElement)("div",{className:"woocommerce-activity-card__body"},Object(u.range)(o).map(e=>Object(c.createElement)("span",{className:"is-placeholder",key:e}))),t&&Object(c.createElement)("div",{className:"woocommerce-activity-card__actions"},Object(c.createElement)("span",{className:"is-placeholder"})))}}p.propTypes={className:A.a.string,hasAction:A.a.bool,hasDate:A.a.bool,hasSubtitle:A.a.bool,lines:A.a.number},p.defaultProps={hasAction:!1,hasDate:!1,hasSubtitle:!1,lines:1};var v=p;class O extends c.Component{getCard(){const{actions:e,className:t,children:a,date:r,icon:o,subtitle:l,title:s,unread:m}=this.props,A=n()("woocommerce-activity-card",t),b=Array.isArray(e)?e:[e],u=/\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}/.test(r)?i.a.utc(r).fromNow():r;return Object(c.createElement)("section",{className:A},m&&Object(c.createElement)("span",{className:"woocommerce-activity-card__unread"}),o&&Object(c.createElement)("span",{className:"woocommerce-activity-card__icon","aria-hidden":!0},o),s&&Object(c.createElement)("header",{className:"woocommerce-activity-card__header"},Object(c.createElement)(d.H,{className:"woocommerce-activity-card__title"},s),l&&Object(c.createElement)("div",{className:"woocommerce-activity-card__subtitle"},l),u&&Object(c.createElement)("span",{className:"woocommerce-activity-card__date"},u)),a&&Object(c.createElement)(d.Section,{className:"woocommerce-activity-card__body"},a),e&&Object(c.createElement)("footer",{className:"woocommerce-activity-card__actions"},b.map((e,t)=>Object(c.cloneElement)(e,{key:t}))))}render(){const{onClick:e}=this.props;return e?Object(c.createElement)(b.Button,{className:"woocommerce-activity-card__button",onClick:e},this.getCard()):this.getCard()}}O.propTypes={actions:A.a.oneOfType([A.a.arrayOf(A.a.element),A.a.element]),onClick:A.a.func,className:A.a.string,children:A.a.node,date:A.a.string,icon:A.a.node,subtitle:A.a.node,title:A.a.oneOfType([A.a.string,A.a.node]),unread:A.a.bool},O.defaultProps={icon:Object(c.createElement)(l.a,{size:48}),unread:!1}},516:function(e,t,a){},517:function(e,t,a){"use strict";function c(e){return e?e.substr(1).split("&").reduce((e,t)=>{const a=t.split("="),c=a[0];let r=decodeURIComponent(a[1]);return r=isNaN(Number(r))?r:Number(r),e[c]=r,e},{}):{}}function r(){let e="";const{page:t,path:a,post_type:r}=c(window.location.search);if(t){const c="wc-admin"===t?"home_screen":t;e=a?a.replace(/\//g,"_").substring(1):c}else r&&(e=r);return e}a.d(t,"b",(function(){return c})),a.d(t,"a",(function(){return r}))},520:function(e,t,a){"use strict";var c=a(0),r=a(6),n=a.n(r),o=a(1),l=a.n(o),s=a(20),i=a(21);a(521);class m extends c.Component{render(){const{className:e,menu:t,subtitle:a,title:r,unreadMessages:o}=this.props,l=n()({"woocommerce-layout__inbox-panel-header":a,"woocommerce-layout__activity-panel-header":!a},e),i=o||0;return Object(c.createElement)("div",{className:l},Object(c.createElement)("div",{className:"woocommerce-layout__inbox-title"},Object(c.createElement)(s.Text,{size:16,weight:600,color:"#23282d"},r),Object(c.createElement)(s.Text,{variant:"button",weight:"600",size:"14",lineHeight:"20px"},i>0&&Object(c.createElement)("span",{className:"woocommerce-layout__inbox-badge"},o))),Object(c.createElement)("div",{className:"woocommerce-layout__inbox-subtitle"},a&&Object(c.createElement)(s.Text,{variant:"body.small",size:"14",lineHeight:"20px"},a)),t&&Object(c.createElement)("div",{className:"woocommerce-layout__activity-panel-header-menu"},t))}}m.propTypes={className:l.a.string,unreadMessages:l.a.number,title:l.a.string.isRequired,subtitle:l.a.string,menu:l.a.shape({type:l.a.oneOf([i.EllipsisMenu])})},t.a=m},521:function(e,t,a){},522:function(e,t,a){},523:function(e,t,a){"use strict";var c=a(0),r=a(2),n=a(21),o=a(11),l=a(7),s=a(16),i=a(172),m=a(169),A=a(20),d=a(512),b=a(164),u=a(517);a(524);const p=(e,t)=>{Object(s.recordEvent)("inbox_action_click",{note_name:e.name,note_title:e.title,note_content_inner_link:t})},v=({hasNotes:e,isBatchUpdating:t,lastRead:a,notes:n,onDismiss:o,onNoteActionClick:l})=>{if(t)return;if(!e)return Object(c.createElement)(d.a,{className:"woocommerce-empty-activity-card",title:Object(r.__)("Your inbox is empty",'woocommerce'),icon:!1},Object(r.__)("As things begin to happen in your store your inbox will start to fill up. You'll see things like achievements, new feature announcements, extension recommendations and more!",'woocommerce'));const b=Object(u.a)(),v=e=>{Object(s.recordEvent)("inbox_note_view",{note_content:e.content,note_name:e.name,note_title:e.title,note_type:e.type,screen:b})},O=Object.keys(n).map(e=>n[e]);return Object(c.createElement)(i.a,{role:"menu"},O.map(e=>{const{id:t,is_deleted:r}=e;return r?null:Object(c.createElement)(m.a,{key:t,timeout:500,classNames:"woocommerce-inbox-message"},Object(c.createElement)(A.InboxNoteCard,{key:t,note:e,lastRead:a,onDismiss:o,onNoteActionClick:l,onBodyLinkClick:p,onNoteVisible:v}))}))},O={page:1,per_page:o.QUERY_DEFAULTS.pageSize,status:"unactioned",type:o.QUERY_DEFAULTS.noteTypes,orderby:"date",order:"desc",_fields:["id","name","title","content","type","status","actions","date_created","date_created_gmt","layout","image","is_deleted"]};t.a=()=>{const{createNotice:e}=Object(l.useDispatch)("core/notices"),{batchUpdateNotes:t,removeAllNotes:a,removeNote:i,updateNote:m,triggerNoteAction:d}=Object(l.useDispatch)(o.NOTES_STORE_NAME),{isError:p,isResolvingNotes:w,isBatchUpdating:f,notes:h}=Object(l.useSelect)(e=>{const{getNotes:t,getNotesError:a,isResolving:c,isNotesRequesting:r}=e(o.NOTES_STORE_NAME);return{notes:t(O),isError:Boolean(a("getNotes",[O])),isResolvingNotes:c("getNotes",[O]),isBatchUpdating:r("batchUpdateNotes")}}),{updateUserPreferences:j,...E}=Object(o.useUserPreferences)(),[g]=Object(c.useState)(E.activity_panel_inbox_last_read),[k,B]=Object(c.useState)();Object(c.useEffect)(()=>{const e=Date.now();j({activity_panel_inbox_last_read:e})},[]);const S=async(c=!1)=>{const n="all"===k.type,o=Object(u.a)();if(Object(s.recordEvent)("inbox_action_dismiss",{note_name:k.note.name,note_title:k.note.title,note_name_dismiss_all:n,note_name_dismiss_confirmation:c,screen:o}),c){const c=k.note.id,o=!c||n;try{let n=[];if(o)n=await a({status:O.status});else{const e=await i(c);n=[e]}B(void 0),e("success",n.length>1?Object(r.__)("All messages dismissed",'woocommerce'):Object(r.__)("Message dismissed",'woocommerce'),{actions:[{label:Object(r.__)("Undo",'woocommerce'),onClick:()=>{n.length>1?t(n.map(e=>e.id),{is_deleted:0}):m(c,{is_deleted:0})}}]})}catch(t){const a=o?h.length:1;e("error",Object(r._n)("Message could not be dismissed","Messages could not be dismissed",a,'woocommerce')),B(void 0)}}else B(void 0)};if(p){const e=Object(r.__)("There was an error getting your inbox. Please try again.",'woocommerce'),t=Object(r.__)("Reload",'woocommerce'),a=()=>{window.location.reload()};return Object(c.createElement)(n.EmptyContent,{title:e,actionLabel:t,actionURL:null,actionCallback:a})}const y=Object(b.b)(h);return Object(c.createElement)(c.Fragment,null,Object(c.createElement)("div",{className:"woocommerce-homepage-notes-wrapper"},(w||f)&&Object(c.createElement)(n.Section,null,Object(c.createElement)(A.InboxNotePlaceholder,{className:"banner message-is-unread"})),Object(c.createElement)(n.Section,null,!w&&!f&&v({hasNotes:y,isBatchUpdating:f,lastRead:g,notes:h,onDismiss:(e,t)=>{B({note:e,type:t})},onNoteActionClick:(e,t)=>{d(e.id,t.id)}})),k&&Object(c.createElement)(A.InboxDismissConfirmationModal,{onClose:S,onDismiss:()=>S(!0)})))}},524:function(e,t,a){},525:function(e,t,a){"use strict";a.d(t,"b",(function(){return A})),a.d(t,"a",(function(){return d}));var c=a(9),r=a.n(c),n=a(4),o=a(19),l=a(11),s=a(12),i=a(120),m=a(13);const A=({indicator:e,primaryData:t,secondaryData:a,currency:c,formatAmount:r,persistedQuery:o})=>{const l=Object(n.find)(t.data,t=>t.stat===e.stat),A=Object(n.find)(a.data,t=>t.stat===e.stat);if(!l||!A)return{};const d=l._links&&l._links.report[0]&&l._links.report[0].href||"",b=function(e,t,a){return e?"/jetpack"===e?Object(m.e)("admin.php?page=jetpack#/dashboard"):Object(s.getNewPath)(t,e,{chart:a.chart}):""}(d,o,l),u="/jetpack"===d?"wp-admin":"wc-admin",p="currency"===l.format,v=Object(i.calculateDelta)(l.value,A.value);return{primaryValue:p?r(l.value):Object(i.formatValue)(c,l.format,l.value),secondaryValue:p?r(A.value):Object(i.formatValue)(c,A.format,A.value),delta:v,reportUrl:b,reportUrlType:u}},d=(e,t,a,c)=>{const{getReportItems:n,getReportItemsError:s,isResolving:i}=e(l.REPORTS_STORE_NAME),{woocommerce_default_date_range:m}=e(l.SETTINGS_STORE_NAME).getSetting("wc_admin","wcAdminSettings"),A=Object(o.getCurrentDates)(a,m),d=A.primary.before,b=A.secondary.before,u=t.map(e=>e.stat).join(","),p=Object(l.getFilterQuery)({filters:c,query:a}),v={...p,after:Object(o.appendTimestamp)(A.primary.after,"start"),before:Object(o.appendTimestamp)(d,d.isSame(r()(),"day")?"now":"end"),stats:u},O={...p,after:Object(o.appendTimestamp)(A.secondary.after,"start"),before:Object(o.appendTimestamp)(b,b.isSame(r()(),"day")?"now":"end"),stats:u};return{primaryData:n("performance-indicators",v),primaryError:s("performance-indicators",v)||null,primaryRequesting:i("getReportItems",["performance-indicators",v]),secondaryData:n("performance-indicators",O),secondaryError:s("performance-indicators",O)||null,secondaryRequesting:i("getReportItems",["performance-indicators",O]),defaultDateRange:m}}},540:function(e,t,a){"use strict";var c=a(0);a(541);t.a=e=>{const{numTasks:t=5}=e;return Object(c.createElement)("div",{className:"woocommerce-task-dashboard__container"},Object(c.createElement)("div",{className:"woocommerce-card woocommerce-task-card is-loading","aria-hidden":!0},Object(c.createElement)("div",{className:"woocommerce-card__header"},Object(c.createElement)("div",{className:"woocommerce-card__title-wrapper"},Object(c.createElement)("div",{className:"woocommerce-card__title woocommerce-card__header-item"},Object(c.createElement)("span",{className:"is-placeholder"})))),Object(c.createElement)("div",{className:"woocommerce-card__body"},Object(c.createElement)("div",{className:"woocommerce-list"},Array.from(new Array(t)).map((e,t)=>Object(c.createElement)("div",{key:t,className:"woocommerce-list__item has-action"},Object(c.createElement)("div",{className:"woocommerce-list__item-inner"},Object(c.createElement)("div",{className:"woocommerce-list__item-before"},Object(c.createElement)("span",{className:"is-placeholder"})),Object(c.createElement)("div",{className:"woocommerce-list__item-text"},Object(c.createElement)("div",{className:"woocommerce-list__item-title"},Object(c.createElement)("span",{className:"is-placeholder"}))),Object(c.createElement)("div",{className:"woocommerce-list__item-after"},Object(c.createElement)("span",{className:"is-placeholder"})))))))))}},541:function(e,t,a){},543:function(e,t,a){"use strict";a.d(t,"b",(function(){return k})),a.d(t,"a",(function(){return B}));var c=a(0),r=a(2),n=a(30),o=a(3),l=a(8),s=Object(c.createElement)(l.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(c.createElement)(l.Path,{fillRule:"evenodd",d:"M6.863 13.644L5 13.25h-.5a.5.5 0 01-.5-.5v-3a.5.5 0 01.5-.5H5L18 6.5h2V16h-2l-3.854-.815.026.008a3.75 3.75 0 01-7.31-1.549zm1.477.313a2.251 2.251 0 004.356.921l-4.356-.921zm-2.84-3.28L18.157 8h.343v6.5h-.343L5.5 11.823v-1.146z",clipRule:"evenodd"})),i=a(499),m=Object(c.createElement)(l.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"-2 -2 24 24"},Object(c.createElement)(l.Path,{d:"M18.33 3.57s.27-.8-.31-1.36c-.53-.52-1.22-.24-1.22-.24-.61.3-5.76 3.47-7.67 5.57-.86.96-2.06 3.79-1.09 4.82.92.98 3.96-.17 4.79-1 2.06-2.06 5.21-7.17 5.5-7.79zM1.4 17.65c2.37-1.56 1.46-3.41 3.23-4.64.93-.65 2.22-.62 3.08.29.63.67.8 2.57-.16 3.46-1.57 1.45-4 1.55-6.15.89z"})),A=Object(c.createElement)(l.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(c.createElement)(l.Path,{d:"M12 4L4 7.9V20h16V7.9L12 4zm6.5 14.5H14V13h-4v5.5H5.5V8.8L12 5.7l6.5 3.1v9.7z"})),d=Object(c.createElement)(l.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(c.createElement)(l.Path,{d:"M20.1 5.1L16.9 2 6.2 12.7l-1.3 4.4 4.5-1.3L20.1 5.1zM4 20.8h8v-1.5H4v1.5z"})),b=Object(c.createElement)(l.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(c.createElement)(l.Path,{fillRule:"evenodd",d:"M5.5 9.5v-2h13v2h-13zm0 3v4h13v-4h-13zM4 7a1 1 0 011-1h14a1 1 0 011 1v10a1 1 0 01-1 1H5a1 1 0 01-1-1V7z",clipRule:"evenodd"})),u=Object(c.createElement)(l.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(c.createElement)(l.Path,{fillRule:"evenodd",d:"M6.5 8a1.5 1.5 0 103 0 1.5 1.5 0 00-3 0zM8 5a3 3 0 100 6 3 3 0 000-6zm6.5 11a1.5 1.5 0 103 0 1.5 1.5 0 00-3 0zm1.5-3a3 3 0 100 6 3 3 0 000-6zM5.47 17.41a.75.75 0 001.06 1.06L18.47 6.53a.75.75 0 10-1.06-1.06L5.47 17.41z",clipRule:"evenodd"})),p=Object(c.createElement)(l.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(c.createElement)(l.Path,{d:"M3 6.75C3 5.784 3.784 5 4.75 5H15V7.313l.05.027 5.056 2.73.394.212v3.468a1.75 1.75 0 01-1.75 1.75h-.012a2.5 2.5 0 11-4.975 0H9.737a2.5 2.5 0 11-4.975 0H3V6.75zM13.5 14V6.5H4.75a.25.25 0 00-.25.25V14h.965a2.493 2.493 0 011.785-.75c.7 0 1.332.287 1.785.75H13.5zm4.535 0h.715a.25.25 0 00.25-.25v-2.573l-4-2.16v4.568a2.487 2.487 0 011.25-.335c.7 0 1.332.287 1.785.75zM6.282 15.5a1.002 1.002 0 00.968 1.25 1 1 0 10-.968-1.25zm9 0a1 1 0 101.937.498 1 1 0 00-1.938-.498z"})),v=a(13),O=a(16),w=a(20);a(558),a(559);const f=({title:e,children:t})=>Object(c.createElement)("div",{className:"woocommerce-quick-links__category"},Object(c.createElement)("h3",{className:"woocommerce-quick-links__category-header"},e),t);var h=a(116),j=a(500),E=a(21);a(560);const g=({icon:e,title:t,href:a,linkType:r,onClick:n})=>{const o="external"===r;return Object(c.createElement)("div",{className:"woocommerce-quick-links__item"},Object(c.createElement)(E.Link,{onClick:n,href:a,type:r,target:o?"_blank":null,className:"woocommerce-quick-links__item-link"},Object(c.createElement)(h.a,{className:"woocommerce-quick-links__item-link__icon",icon:e}),Object(c.createElement)(w.Text,{className:"woocommerce-quick-links__item-link__text",as:"div",variant:"button",weight:"600",size:"14",lineHeight:"20px"},t),o&&Object(c.createElement)(h.a,{icon:j.a})))};function k({path:e,tab:t=null,type:a,href:c=null}){return{"wc-admin":{href:"admin.php?page=wc-admin&path=%2F"+e,linkType:"wc-admin"},"wp-admin":{href:e,linkType:"wp-admin"},"wc-settings":{href:"admin.php?page=wc-settings&tab="+t,linkType:"wp-admin"}}[a]||{href:c,linkType:"external"}}const B=()=>{const e=Object(v.f)("shopUrl"),t=Object(n.applyFilters)("woocommerce_admin_homescreen_quicklinks",[]).reduce((e,{icon:t,href:a,title:c})=>(new URL(a,window.location.href).origin===window.location.origin&&e.push({icon:t,link:{href:a,linkType:"wp-admin"},title:c,listItemTag:"quick-links-extension-link"}),e),[]);const a=function(e){return[{title:Object(r.__)("Marketing & Merchandising",'woocommerce'),items:[{title:Object(r.__)("Marketing",'woocommerce'),link:k({type:"wc-admin",path:"marketing"}),icon:s,listItemTag:"marketing"},{title:Object(r.__)("Add products",'woocommerce'),link:k({type:"wp-admin",path:"post-new.php?post_type=product"}),icon:i.a,listItemTag:"add-products"},{title:Object(r.__)("Personalize my store",'woocommerce'),link:k({type:"wp-admin",path:"customize.php"}),icon:m,listItemTag:"personalize-store"},{title:Object(r.__)("View my store",'woocommerce'),link:k({type:"external",href:e}),icon:A,listItemTag:"view-store"}]},{title:Object(r.__)("Settings",'woocommerce'),items:[{title:Object(r.__)("Store details",'woocommerce'),link:k({type:"wc-settings",tab:"general"}),icon:d,listItemTag:"edit-store-details"},{title:Object(r.__)("Payments",'woocommerce'),link:k({type:"wc-settings",tab:"checkout"}),icon:b,listItemTag:"payment-settings"},{title:Object(r.__)("Tax",'woocommerce'),link:k({type:"wc-settings",tab:"tax"}),icon:u,listItemTag:"tax-settings"},{title:Object(r.__)("Shipping",'woocommerce'),link:k({type:"wc-settings",tab:"shipping"}),icon:p,listItemTag:"shipping-settings"}]}]}(e),l={title:Object(r.__)("Extensions",'woocommerce'),items:t},h=t.length?[...a,l]:a;return Object(c.createElement)(o.Card,{size:"medium"},Object(c.createElement)(o.CardHeader,{size:"medium"},Object(c.createElement)(w.Text,{variant:"title.small",size:"20",lineHeight:"28px"},Object(r.__)("Store management",'woocommerce'))),Object(c.createElement)(o.CardBody,{size:"custom",className:"woocommerce-store-management-links__card-body"},h.map(e=>Object(c.createElement)(f,{key:e.title,title:e.title},e.items.map(({icon:e,listItemTag:t,title:a,link:{href:r,linkType:n}})=>Object(c.createElement)(g,{icon:e,key:`${a}_${t}_${r}`,title:a,linkType:n,href:r,onClick:()=>{Object(O.recordEvent)("home_quick_links_click",{task_name:t})}}))))))}},549:function(e,t,a){},550:function(e,t,a){},551:function(e,t,a){"use strict";var c=Object.assign||function(e){for(var t,a=1;a<arguments.length;a++)for(var c in t=arguments[a])Object.prototype.hasOwnProperty.call(t,c)&&(e[c]=t[c]);return e};Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,a=e.size,r=void 0===a?24:a,n=e.onClick,l=(e.icon,e.className),s=function(e,t){var a={};for(var c in e)0<=t.indexOf(c)||Object.prototype.hasOwnProperty.call(e,c)&&(a[c]=e[c]);return a}(e,["size","onClick","icon","className"]),i=["gridicon","gridicons-star-outline",l,(t=r,!(0!=t%18)&&"needs-offset"),!1,!1].filter(Boolean).join(" ");return o.default.createElement("svg",c({className:i,height:r,width:r,onClick:n},s,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"}),o.default.createElement("g",null,o.default.createElement("path",{d:"M12 6.308l1.176 3.167.347.936.997.042 3.374.14-2.647 2.09-.784.62.27.963.91 3.25-2.813-1.872-.83-.553-.83.552-2.814 1.87.91-3.248.27-.962-.783-.62-2.648-2.092 3.374-.14.996-.04.347-.936L12 6.308M12 2L9.418 8.953 2 9.257l5.822 4.602L5.82 21 12 16.89 18.18 21l-2.002-7.14L22 9.256l-7.418-.305L12 2z"})))};var r,n=a(5),o=(r=n)&&r.__esModule?r:{default:r};e.exports=t.default},552:function(e,t,a){},553:function(e,t,a){},554:function(e,t){e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAd4AAAIMCAYAAABbgM16AAAACXBIWXMAABYlAAAWJQFJUiTwAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAADyySURBVHgB7d17tOV1Xf/x7xjJKDEjFWAqxxuoBKwQRg3H9UOGftVMmsIKA8skWQhlLfFG/ZFcpD8KL+AqC0Jg7JeCaYJZQ/WLAdcKER1MFygaJMQIcmkpM0RC/TrzO88vvA+f85nvZe9z+Zx99n4+1tprzpzzve3v2ef7+n6u31VTU1O7KkmSVML0UypJklSMwStJUkEGryRJBRm8kiQVZPBKklSQwStJUkEGryRJBRm8kiQVZPBKklSQwStJUkEGryRJBRm8kiQVZPBKklSQwStJUkEGryRJBRm8kiQVZPBKklSQwStJUkEGryRJBRm8kiQVZPBKklSQwStJUkEGryRJBRm8kiQVZPBKklSQwStJUkEGryRJBRm8kiQVZPBKklTQHtWYWbNmTfXTP/3T1XOe85zqkEMOqX7yJ3+y/h7/T33nO9+pXzt37qy+/vWvV1/84herb3zjG/X/JUlaKqumpqZ2VSscwXrKKafUgctrIQjgT33qU/W/BLMkSYtoekUHLyH7jne8Y8Fh2+Yf/uEfqksvvbQOYUmSFsHKDN5BApfSKlXH27dvn61STkX18wEHHFBXR+dV0fm23vWudxnAkqSFWlnBSzh+8IMfbAxcgpWgnW81Mdtmuz/3cz9X/ezP/mzjMp/+9KerCy64wCpoSdJ8rZzgPeGEE6qzzjqrLqmmCEHC9rLLLlu0jlERwpSqmzplEb6EsCRJQ1oZwXv22WdXb3nLW+Z8r1QA/tIv/VJjABP05557biVJ0hBGO3gp3X7yk5+s22BTdHi68MILiw79OeOMM+oATlG1/cu//MsOQZIkDWp0g5cSJqGbljSXu5NT2zERvrb7SpIGMJrBS0n3mmuumRNwo1K65JguueSSOaVwQnfjxo2WfCVJfaZHcsrIvFRJ56lRCDaOibbmfHhShLEkSX1+aO3atedUI4SOVOlwHkL33e9+d7Xc6FXNDcERRxxRvfCFL6z23HPPOT8nfGfOZfX5z3++kiSpxa6RCl56EP/u7/7u7P+pXn7zm99cLbdo2+3z0pe+tLrnnnvq45YkqcGukalqJtzSXsNU55566qnVKKBH86AYa9w1C5YkabKNzNOJCLc0sObTU5j1KTXT/sorXT/9ms5bTS/GBDftk2klB8V2qC4flZsGSdJoGYngZZYo2lADoZmPmUUEM/+yDBNYpEOLCO90O8MiYBmutFC0UfOenNtZkpQbieBl/uUUpUZKrn0I2TTchimZNmmrIuZBC8M+AYkbB0rtkiSllr2NNx5aPx87duyY8/8bb7yxWoi///u/b/z+oNNSpkOMFuPZwJKk8bPsE2j82Z/9Wf1EoEHwfFzCjRIo/xKI+dheJraINltK0vlDFXKUmL/+9a/X2+6qGqZXc1+QcjzsPybXYHuWeiVJiellrWqmpJuGLsNw8nmZU5RoeThBl3QoD2OATznllM7lCd33ve99VR8eyNA3pIj3wz7pXAWCmuB3RitJUljWqua0BBlzHneF1KAl40Apts+gnbEovQ6yvbwUPkhbtRbXvvvuW99MUeNhjYOkUbOswZuGHsEWD7NvM2y7KdvsG5JEiXTQbdLjuevGIEq3aVvxsDcLS+UVr3hFdcwxx8y+nv70pxdZdzm89rWvrQ499NDq+c9/fv0ZG/XjlTRZlq2qOQ+8CKu+Kt1hh+lQ9ds0NCmV945uQ6jySMK27UUos624qRiV6uZf+IVfqMMo7LXXXtXf/M3f9K73Iz/yI9Vv/dZv1ctjenq6rp7/z//8z2pUPfLII50/f/pMEBPKgfcjSaUsW4k3b8uN4KPE2xVSfW22ub42YTDutq8TVhgkoPMq6VHs3fzyl798oOVe9rKXzYbuSsENxXXXXVd96Utfqs4///zdbhKYa/u8886rX29729sqSSpp2YI3DaM0bPmXUmqbYaqGY3t9YTnouGF0VV/H8KZ81qxRnEKS0u8hhxzSucyqVauq17zmNdVKQ4n3j/7oj6o/+IM/qMNXkkbJSJR4GR6U6uvENGypt218bmqYtti2qsm0fTpdpi/glktfqD7vec+bUyW73Kgi3m+//erXOO4/tv/0IdukF+O4+taf77HFdp9uO7s0a9naeHmEXsg7VEWpsq2kOGy7KT2NaZftqk4eZpttJd70faTLdA2RWk6UerkgtrXX0i7c57d/+7dnbyzuvPPO6g//8A8bl+OpUwQ5qAYe5GlP4PjoLEWnrjQYKNVSmr3yyiurBx98cM46VKPz3GTcd9991TnnnFN/HZ3D0qrzvffee3Y4GdtsOv5YL20j79p/l6c85Sn18fBeaC/na94jx5tun3PJOWorscd54eYpfT9dx8W+/+RP/qT+mn3/5m/+Zn2u6PkdN1gPPPDAnN8Px/SGN7xhzrHdcsst1R//8R+3vu+2Y2PbbJftS5Ns2Uq8aag2hV1fdfMww3TynsZt4mI9yPaapFXa+UMZRklcVLkocoFsQjBs2LCh/vrWW2+tL5pNrr/++tlSDe3BTSUbwo0LPMv8+I//+MDVv/vvv3/1oQ99qA6GvDTGsROGH/jAB2YDPf1ZHFO6Hl9Hb+d0Wb7H67nPfe6c7RBUhDI3F2nwpPvn5/n++6THxtAn2prz7XOMZ555ZmNbfHpe8vb3rvOS75ttc0OUng++z3YJTX7O+8uP7bDDDqvnSW/6XXcdG9vmXL7//e+3BKyJNrLB29cpainG9B511FHVfMVwqJB+PWptvARp9Pxt62SVVo93lVDuuuuu2W0RVAw9yq1bt272awKc0twg6Bkewcl6tNu+973vrV8R3oT6oB2k2C/vhfcfOHa+x2vbtm1zlj/55JNnQ4fluGGh3ZjPZtyIEDQE5HyChPNFECFKmelNCT/Px5nzPUIvzgvviePh3KTHxXnh+Lv2zY0m7ys6o6U3VwRn+nOOLf35M5/5zN1u2vJjY3mOKT9ndG6L9y1NopF5LGAuOkW1daTi+1ThDvrQ+UGqe2Oc8HyeKtRVQh9FXEyjipGQTduk6VQVE0/cf//91ec///nWiSgefvjh+qId7cUEVR7UaYizrUGkIU61KFXAaWDfdttts1XIu3bt6qwyD4QaL0psEagcP6GVI1DjPbF/xnCnwcP7YP+cvwihQavPU03b5lzH+Wb7BFn8PA01jp1jSIdPcfMQ1cm8x3TdJqeffvrs+rwPSqOUVHmx/fTY+Iyzvzh33FCl7/noo4+ePT6q+N/znvfsdmyxfWpHKJFz4yZNmmV/SEKXvuphhgENatAS8iA9ppuqjlfaIwDTMbx5qBKUcQEd5Mbmy1/+8uzXaekWeYDOt30vL1GyrbPOOqt+MUXnYo8rJhgCIZuHF6GUhs7BBx9czUfTtrds2TInsKiODgQaYckrDzawrXR76bopzh+l0HR9tp2WuLm5SbeV//7SqmR+z1Rxx3KbN2/e7djYfqzP8nkVtjQpRjp4mx6CkBq0dzNVvYN2cBpkm3kvZY6zb4asUcNFMapco5NVePWrX13/S0lykFIcpeW4yHIxTs8PX8cFmhJrV+krFyVcLtK0g1I9ycV9qXtas7+0Cp5j5n3krzR45nNMBFRa7R04l32TgKSixzHHwA3AoOOu+0qbTb+rf//3f29dPg1Sak2azhmfqTBKPealkpatqjnttdzW+SimkGwrhcaY3r7S5jDjfgfZZr69pmrm9D2NaigTqnGxjKpSSkjRqYrSDxdfgqgLARJV11HCjarrtORISW5QbJMq0+gBjOhdjOi9u3Xr1iWfeSqt+m1TepKROBeE1yhMcJJ2YuMz8Du/8zu96/zYj/1YJU2iZQveQTsf9U0hOch0j4M+CGGQbeahS6g2LZu+p1EN3iipcuGmPTMNYkomw1QLp1XSVDdTjckFOEq/MdXkMKiapCqZ0EurvxG9d3lx3PNpX+2SD13qK4Hy/kqI4Uh5NW16jNFGu5wGqdn4wQ9+UEmTaNmCl4twVP92BW/0Fm4rFcd0j21V0mw7fwpSXy/jrm3mwdsW0Ok+YkarURQl1agijpIdF85hZn3i90m1aXTo4UV1Y1Qndg1J6hK9mcE26ZBDiToNYm6U2P5ilXwJUaq5Y/vcRIzK2FM6MEXoxrnJe5ZTU1A6eNMbE87fO9/5zpGez1taTsvWxpuWkPpmdlrImN48KBnu0IdttnXcyoccUSJvkr6nQXteLweCNy6ajOmMsPnbv/3bahhpiTbaSNN29UF7M3eJmwHCJu3Ny/4Wu70wnRxiVNoi0w5M4HeXtq+H5SjtcgzpjZXtt1K7ZQvefC7jrkkm+sbgdvVYTgOUXtJsa5AeyE3V03npuW3eZpZLS7yj3OOZC2YEZlywqWaezxzHaRsuwZv2ch22NMqFm8kbeDW1Fw4zHrgL77lpDG7aU5tSZlPvYEqecYw8wWmpcR7TkG0KWD63yxG8aY9nbhDaxhDTpBHnbCXOAy4thmWras7DiICkd3DbspQa23omd033mJZQY/s33nhjb4erpm0O0qmqablRLvHic5/73JxevMxGNZ9q4egpHTNBBUJs2O3RezbtOET4/uVf/mU9rphHFXLRjn1w0R/mRiEtzTLRBD2mCY2YTANp1XksQzty9ATmfKVTIjaNBV4K7D+GZ7H/GD7EcXBM0TFuOXDjFeeESTIuuuiiupqe882NS3p8/M6YdlKaRMvauSqdIIM79bbgBaXVriFBzLJz4YUXzvle+rg/9hclZy4Gfc/oBVXY6QxaeSm4rSSel4qX+1m8fdKQAT2F5yMCMO/4M5/Sc4yTjWk8CZumWbHADdAwwc6y6fsl4Hml40zzXtUx3WGTmPmpBMIt5q0m4PJj4lhies6qMH5njKmmOSem7aT5oslHPvKRed3cSeNgWcfxUvIMhGpXdXPfFJJN42/TauY0JAd5VCDSKuy8mrltjDHvIV1vpcxodfnll9elNl4L6aREW27e0eamm26q5oMQ4XiaxrqC7zN95LA9mqO0FaXc0DThAzM35csFqrpjqsZSCDd6eufnJKa0ZOKK5fTtb3979pw1id+ZD0rQJFs1NTW1q1omhBRPOgncKXddxLiwdFUR0yM3DdQbbrhhtq311FNPnRO+hPIll1xS9YltUvr94Ac/WLXtK+TLrV+/fsVNrrEQtO997GMfm62C5QK7GNWwbC8m/ae3LKWlYSaZGGT7fdujVBztwVSfLneJLc7JUpyPxbDUvzNphZpe1hJvXvLsG287zBSSBHSEblrNHAatAo6gT0vUbWN3kVZhc7yTFLrYtGnTbOhSspxvtXUuOoHxoqS52BfwQbbHfuMYRqGaNM7JUpyPxbDUvzNppVr2KSPT4ThUN3eVaPumkCS4o7q6rZo5sJ1BqoEJ3HzKybYbAEq7aW/mklWQy4mSIDUAtDemj1YknJZ6VilJWmmWPXgpOaalx7SaNtf3XN10/O0g7ayDPCqQbeZV0m2BmpZ2u0rF44bqRII3HWOaPoBekvSkkXhIQlrqpcR4xhlntC7b1fMZlHopnUbJsysAB61uTku7bWN3o2Qc6GAyiSjl0imK0LXXqiTtbiSexxul3rQ9te2JP31TSLKNtJq5r9R56aWXDjS0KDSVnvObBY59Ukq7iAfJS5L6jcxjASkhRukzqnfbwpWw7JIGaV877rDtsE2BSm/rOFZuFtqmkZQkaWSCNw8sqncZjN9k0NLkIO2sg47pRVMpnGNMq5h5D5PWk1mSNLiRCV5Q+kxLs/QSbqoGzjtktRk0UPuGKYW89Myxpb14Ofa+NmhJ0mQbqeAFk6encxvTdtoUvumsV20GnTWqb5gS8tIzx5S263LMHLskSV1GLnjB0JS0urYpfPvaZocZzkPo9gV5V+iyr3iOrSRJXUYyeAnCpvClE1M6G1VXsA7bq7gvyGm7pQMVx9AUuqP+IARJ0mgYyeBFBFpa7cxQIYIvHnzfVZU87MMJusb08jMC/5prrpkzsxbHtnHjRjtTSZIGNrLBCwKNYEs7XBGAzG7Fi+BrCsv5zhrVNkyJHtZpaTuW5dgs6UqShjHSwRvotMQ437RkSamXEmiTQXsp59rCOh1PTNByLHakkiTNx4oIXtDzmKrnvAq5aZKNtHp6UJRqjzrqqM4SLMFMKdchQ5Kk+VrW5/HOF+2sVDWnVb85ApQA5uk4lJTzQCWwWf+QQw6pQ7dtliwQuHSumqRpICVJS2J6RQZvIIAZ2tP1KMGFMHAlSYtsZQdvoOTKgxF4FOBCQ5iQpY14kEk1JEka0ngEb4oqY6qOCWCqkaNKOa+WjurntDp60McESpI0T+MXvJIkjbDpFdOrWZKkcWDwSpJUkMErSVJBBq8kSQUZvJIkFWTwSpJUkMErSVJBBq8kSQUZvJIkFWTwSpJUkMErSVJBBq8kSQUZvJIkFWTwSpJUkMErSVJBBq8kSQUZvJIkFWTwSpJUkMErSVJBBq8kSQUZvJIkFWTwSpJUkMErSVJBBq8kSQUZvJIkFWTwSpJUkMErSVJBBq8kSQUZvJIkFWTwSpJUkMErSVJBBq8kSQUZvJIkFWTwSpJUkMErSVJBBq8kSQUZvJIkFWTwSpJUkMErSVJBBq8kSQUZvJIkFWTwSpJUkMErSVJBBq8kSQUZvJIkFWTwSpJUkMErSVJBBq8kSQUZvJIkFWTwSpJUkMErSVJBBq8kSQUZvJIkFWTwSpJUkMErSVJBBq8kSQUZvJIkFWTwSpJUkMErSVJBBq8kSQUZvJIkFWTwSpJUkMErSVJBBq8kSQUZvJIkFWTwSpJUkMErSVJBBq8kSQUZvJIkFWTwSpJUkMErSVJBBq8kSQUZvJIkFWTwSpJUkMErSVJBBq8kSQUZvJIkFWTwSpJUkMErSVJBBq8kSQUZvJIkFWTwSpJUkMErSVJBBq8kSQUZvJIkFWTwSpJUkMErSVJBBq8kSQUZvJIkFWTwSpJUkMErSVJBBq8kSQUZvJIkFWTwSpJUkMErSVJBBq8kSQUZvJIkFTQxwbt+/fr6JUnSctqjmgB56N5www2VJEnLYexLvHnorl27ttJca9asqV/zseeee9br8u+kWsj5kzR5xrrEe+ihh84J3bvvvrvasmVLtRQOOOCA1lDfsWNH9dhjj1UPPPBANYpOP/30+t8rrrii2r59+zCrVuvWravP8a233rpk53bUnXTSSfXvfj7nT9LkGdvg3W+//apNmzbN/p/Qu+qqq6qlcthhh9VB3+XRRx+tbr/99rqqe+fOnZUkafKMZfBS7XfiiSfO/p8SJ6FLqXOpEa5NJdupqalq9erVdUC/6EUvqsN327ZtlSRpsoxd8BK6VP0RciB0r7zyyvrfEu64447WKteo+qZacsOGDXVIU0UrSZocY9W5KkI32loJtpKh24eQTY/n2GOPnehOSZI0icamxEuAjXLohiiBn3baafUx0zmpaXhT/CzttEVVOR3EqKLuaiM+8sgjq4MOOmh2PfZJ9Xffeul+o72afd5///0Dt0tzvKxPG3vsmxuOvpJ97JfjjpuRWJf33LVv9sXxsm7o2+/GjRvrf7du3VqfJ2oi4phplkibCxZ6TiQpNTbBm4YuuKCOai9iQoFOVgQFF/M8eAkA2qijujz/GevRgza/6FPiP/7442cDhJsP0L7Mi/XyUElx/uiQlvfOZnu0S7PPrnPaNEkJ22LfBBfrN7Wzt73fWJfz1fR+wU0GNQdN76Vrv7S1g17IaSc8pLUQeS1KesxxTiRpGGMRvFw4I2xA6I5622kELxd0LvRpMBx33HF1CBFy1157bf0vP6c0GcHIv5ScU1FqI6hoZ46hLSz/+te/vtp///3rbV988cWNx8T67CcNWI4xbZfO9xmi1Mn7omTN+qwT60cv87xneXSEy99vvm/Cb/PmzXPOE+tG6LLPKNFzPlmX42W/bbUKYBnOVxwz4t+0FiWWic9VvB/Op80Fkoax4tt4uTCnw3hWSm/hdLxnWprad999Z0vEMS40woavI/gozeWlsCjFpaGLqN6mypavuyYRSffJKx2f27TPQBCxLMEa6xNg/D5ifcKQm4cUvz9CN0q1+b45bkru7JcATbE93hP74GYrSsSxboRt1zAvliXQb7755nrf6flOq+s5DpaJY2M51kNTzYQktfEhCSMgLTE9+OCD9UW+bfgTARVVyMPMlsS22G5XuzdB1bRPQib2mQdnvn6TaKdF2g7L+46bhbZ9c6wEHvLg5fu8n7b9Rsm160ajbb+gGjuOv+mcsd6kThoiaf5WfPBy4UyrlSlB5RfocULYtgVFhBtVoJTyhp3GsKsjWt8Y6ChNt4kQTJsE0q8p4beJ3y9BPeiUnyw7SBVw1zFTNY9bbrmldZlR7UcgaXSNRRsvpQ5ChqpQrIQxsk996lNnv24KNUqWhGe8p0EC55prrqnbS6MNGNGjmWBbyvPR17u3qfSZ9rruCvYobYPfcxqWhGucpwjyxZiPO91G13vjuPuq7yUpNTa9mqmaJXSilEKnGy72o1oiieNEPnSFDjsRuODCzvCVuMhTXdvUrsjP6DhFEPEiiAiEtJMTbaFdpctR1BbKTeO2Y6hPrJOeR0kaBWMTvFxor7766tkSX/RIvfzyy0dyrGV0+Inq4UA1eQyhyTtJhZh+sk06fpXwjbG1URK+6KKLFn36zL5q3bR0G6Ik21dapMNZyHt/s270hs7PFe97vsGblrIHfW+SNIix6lyVTw8Z4Ttqj2xLq5Dz6t8DDzyw/jd62TYZ5kJPKEUnJMIk7dC0mPoCLsIzvQmiI1no6rQVtQPpE554H/H9thuUhYjaBXS9t/SmQJIGMXa9miN809LUKIUvAUMbNGJ2pVTf0JS2oTGUbLs6lkVb71KJ2Z2acO6ZbAJpNTfHFCX+riE/MSlHum56ntpK731Pi+oT+6N3c1upd5w78klaGmM5nKgpfJnRaTkmOogHxdPGSjV4PMAhjjEXJTcu9vnNQkwK0YTwIaD4eT57FNJS9lK08XKum4KfGw3eM2J8ciqGAlEKz4+bc8f7iRJ+OmwoHVb1yle+snG9hZbsYxhTVNGnv4/F2oekyTO2z+OldEdHoujdS4mQNsG2mZcWS3Rs6kIpjx7ITUNZCBeqm7nY84B6liVUo6MUk4OkEzsEtsW6MW0jx8A5IJyoko0evyyzFPNXE1JRmuemgX1wg5FOX9l2o5EeN+ty3KxL0EXJtum4+R6d6Ag/biqiRM9xsB7tvk3TSQ6K/cU2OOcxYQd4X+yDY+Bc284raVBjG7ygGpeSSVx8uTgzOT6hV1pUq3JMXe2RLPexj31sdorHKKUSXNxIRPA2iXCKaRbTMIh9L+WQInqWR+in7aJdNxrpcRO66XuOdfl50zmLmaTy90sAcyy0Jy8keJv20fT7WGiVtqTJsmrmQrKrGnPp5P1cxNtmOho1XOhjwoxh22e54aBUFp2EFrsXc5/oLBXzTA9qvsfNOqzLOkvVi73EPiSNvemJCF6kwStJ0jKZnOCVJGkETPuQBEmSCjJ4JUkqyOCVJKkgg1eSpIIMXkmSCjJ4JUkqyOCVJKkgg1eSpIIMXkmSCjJ4JUkqyOCVJKkgg1eSpIIMXkmSCjJ4JUkqyOCVJKkgg1eSpIIMXkmSCjJ4JUkqyOCVJKkgg1eSpIIMXkmSCjJ4JUkqyOCVJKkgg1eSpIIMXkmSCjJ4JUkqyOCVJKkgg1eSpIIMXkmSCjJ4JUkqyOCVJKkgg1eSpIIMXkmSCjJ4JUkqyOCVJKkgg1eSpIIMXkmSCjJ4JUkqyOCVJKkgg1eSpIIMXkmSCjJ4JUkqyOCVJKkgg1eSpIIMXkmSCjJ4JUkqyOCVJKkgg1eSpIIMXkmSCjJ4JUkqyOCVJKkgg1eSpIIMXkmSCjJ4JUkqyOCVJKkgg1eSpIIMXkmSCjJ4JUkqyOCVJKkgg1eSpIIMXkmSCjJ4JUkqyOCVJKkgg1eSpIIMXkmSCjJ4JUkqyOCVJKkgg1eSpIIMXkmSCjJ4JUkqyOCVJKkgg1eSpIIMXkmSCjJ4JUkqyOCVJKkgg1eSpIIMXkmSCjJ4JUkqyOCVJKkgg1eSpIIMXkmSCjJ4JUkqyOCVJKkgg1eSpIIMXkmSCjJ4JUkqyOCVJKkgg3fCPetZz6pfkqQy9qjGwLp166qXvexls///1re+VW3durVznd/4jd+Y/frhhx+u/uIv/qJz+de97nVzAuqzn/1sde+991Yrzd5771396q/+arVhw4bqxS9+8Zyfcd6++c1vVn/9139dffnLX64kSYtv1dTU1K5qhSMUzzvvvNn/Ex5veMMbWpcncD71qU/N/p/gXb9+fdXln/7pn6o1a9bM/v+EE06og2olOfPMM+vQHcS1115bvf/971+RNxeSNMKmx6KqOS/dvuQlL6lLdm3S0jFYNv9eiqBOQ/eee+5ZUaHL++NGY9DQxbHHHltdeumlu5WKJUkLMxbBS4k1D0LCtw1V04N8L+ShvG3btmoloTYgD9CdO3fW1eXnn39+9d73vrf60z/90/qGIvXsZz+7uvDCC20DlqRFNBZtvKBNMg0XgrStnXLY4M1/1td+PEqohqc9N8V5OeOMM+oblhThy/Lvec97Zkv4hO+5555bnXrqqZUkaeHGJngJw7QqtS1I+X5abRwo1VIlm4cR8tJzXzUzJcS0lEw7Ke3OTdvuwzFxQ0EAgm0MU9WddiIDoXvKKae0Lh+dxqhmDrwXXn0drhZyrKybNg+kbctsM34HfL/tONLzzr5ZruucL8c+m6T7Yt3YTp+8JqLp+NkWn722tnreP9tJ9z/fppTF/NxL42xsgpcLBdWnEaptVc3p99Pl42f5BS8fbtN1EaO0+Cu/8iut+ybUKFUO0mGJfRKalFab2qvZBttim21YN784U63ch6p0zkNcRJ/ylKdURxxxRGsYPOc5z6lLxW3t5H3Hyvbp+MX5w/T0dLVp06b6+03b/c53vlOdffbZs8dDyLB+0/4/8pGPVBdffPFI7DPH75ebxbbf71VXXdW6HY6TJoTYP8d/+OGH1zeWv//7vz/7e+f7HHd+7tkn++f9z2f/KfbJttp+/7EdO+pJjxubcbx5O2+UvnLHHHPM7NfXXXfdnDBJfxbyEG1q32VflBC5EHa1LXOR+7u/+7vqF3/xF6su/JzOUG0XRXBhZX8s17ZM/n4GHQK1a9eu2RuEeLW183Ksn/zkJzs7p8WxfuhDH+rs9Jav89GPfrRxuwQ92+L3y9eXXXZZ6/7f9ra31UE6Svtcu3Zt/XkhrLp+v2xny5YtA5+zl7/85fVx9bXJH3zwwfXnsC300/3zu+3aPzcfXecCxx13XH1e7SsgPW6sJtAgSFNNF4P0e1RPp0E6SNtvvg80lXwoTVM65pWjRNJ2oeLixM/zi11Ud7LdFEFAB6gm+U3AMG3TnJef//mfn31RaspxoW86Vt5z07H+zM/8zEAhSGmOUIoLddPNAuHFvrmgx/5ZLt8nuIHpCoaS+2Q/BHj+M84XN0Z5rUIEfh+2++53v7t3ObZ3wQUXtH6+8g52hHTb/qPE3vQ++Kyl22K/6XmTJtnYVDUjD7m8xJuHKOFCSTnaQWMYUtomlW8jvzBygY3qykBP4XRCDi7mhGMahJQACbQcpYf8PdERKg0CLnaEfeAizjHk1Yn5sS9mVR8X+ve9731zvveNb3yjeuc73zlnP5zbtJ2Z6u9B2otZhnNIyTt+H/m24v394z/+Y31jEMuxD44tmhE4Vkr/o7DPPJC3b99ed1xLzxkhdckll8y2lbf9fnN8vrgJ+PjHPz67LJ/n2DbHdNppp80pebJ/3kd6A8px8/lK95//zjjG9Lw89NBD9e8+3Q77YTvRuY913vjGNw5UfS2Ns7Eq8fJHn5Y+8lJF2rs3OsHk66TL5ON7my7cebUxF+18FiwufHRoSksAXJTy3sbcGKQXRZbPQxdsn3BP5SWPpmq9xRx7nM/k1RQgyM8HF/+3vvWtvdu/7bbb6veY3gRxwc7Dh/1ywU+Xo7R10UUXzVnumc98ZrXc+4zgC7S/Np0z2pPTXuSs95rXvKbqw3ExcUzaTMDvPI6T31d+k8h+8uYTanXSGo58/03v4wMf+MBu22H/bCf9++qq3pYmxdjN1ZxWBXOhSf/I0xJgulz6dVoqzkuMeTVz3ouTCxwXvSb8jKkYU3kbbH5RpOTSVkolDNILGsdaqg2NC+/RRx89+38uvARUW+9VfpbfEHVdfNke773p+1/5ylfmfC8/p+H666+f8/++i32JfeYd9Qjrtt9v3pN6kHPW14EpvxHtavP/0pe+VN8wsQyvRx55pHVb3CC2nZMdO3bM+RnvoasfhDQJxi5481JdBGlX6TW9U09LofmFKt92HnRN7bmpvOSUbz/fXlcJlZAbpE17qUQ1ZOg71rbfS5vvfve7VR/C5r777qsWy1LvMw+c22+/fTaM8xel5TwU+26sun4H0TM98D762vxjchVeaQ1LfpMXne/aXun74DicDU2TbqzaeMHFJG//JKDyO/T0IsU6MddzjGvkYpGGQ9PYymHCB30X0nx7fUHetb2m0md+EVyIpgcsdMn32zSWetwddNBBc/6ftx/34ffXd4PTt37qP/7jP6r5yEver3jFK+pe0oPaa6+9KmmSjV2JN9q2QgREWq2bt0XloRql3jRcBpnQYLEnCljI9lg3722bB3splK4cw7lwi32zkvdgllTG2JV4kc5iFW1jaTVfUxUbYRyl4phuMr3QDTIUZ7E7jbTNpDUoSkdpSb9rGs2mfafvJ2ZUCvnkI12oXnQM5+5oehhm3u+FPqox/yxxI7YYN0QcV1sbb5O+mhxp3I1l8HIxS3v55s+ebbrYcfGIar+ons63mcsvZH1tV/nP8wtQvr2mmbSG2V56MwHOSVvnrxxPJ0qHCzF8hp68gWrKNHj7qrG7pjecFHnbMDdGfUOEFlP++ZrvzVD+u6MDVcn3Ia10Y1fVjDys0hBum0s3HVYU0+kFquSagiLfz7CPI8zb6/Lt9XVAyn+eby8f1sSxDfJowFWrVlWnn3767P+pKs577KbHSon2ta99bev28t7fmMRST/77TXuGLzV+h+nng99Z1wxqMSVlvNLhQ/mkISU79UnjYCyDN2+z7SvtNv0sLQ20rZPvJw/sFNvLQy+vvs7/z/JtpRL2k5Y4m+aQ5vjykggdz/qmrOTpRPl+03PARfxzn/tclR9r201HHsrzeZDAOIiHBoSYmKIN5zSCb9BpL7vkv7Ou/dMnIiaHycds8/tPq5aZ0avrho4apzTE7dWsSTeWwYu2sBw0eFNd7bt51S0XoHwOXkqmH/7wh3ebHKOpOjsPcmaySi9UEe55wOel2/T48k5WTHuYXwDZLsfJHML5RbTpwQ4ca9o5h4sv8/qm75FtEvTpsTaF9qTgvV9xxRWz/48HMjTdXHHO4iEOefDNV9ONGJ+DfPw4nwNuvtLjzms88v9zrE3hy7SisQ9eDGlazIlcpJVoLNt4kbbZBoKiq82Ui1I6FCn0hTXrpRevCMYIq6aLJjNSNWG8JOEXpVnW5UEI0bkp7/QEbgzaOrdwDOwrn4qyaarLJkyk0DTFXzz1hvl3A1MCMqyk61g/8YlPDNURZ9zwWWEWqChpxjkjjOJGJp8sI871QsUMUwRr9HCPB1jwuW/7nXHM+U0inwtuyNK/sQjfKNXT9JKXlJ0uUhrjEm88JjDV14O0aaKHQapFmWCgqcSZz1QEjun3fu/3Wu/6+X4+vSRifHF+UeT4+h71x/s+4YQThh4+cvXVV1fveMc7Wn/OxZdQz89z27HyeLh8qstJQ/jQSa1pXnGqZPPHQMYcyIvVGY2OUEwTOejn66abbqrDugnBm9f4xFSoTY+kZNlJvumSwtiWeCNE++ZazrFMWgU7aLUYgcKybc/jJZy46BDQfRfRCF9KE7S1NQ3biafADHohS7eZlniasG0ukoMMdaG0TYj0HSvTMQ7zdKRxRvgxpzI1DnRia/pdDPN5GRZzQfNZYP+09zftn32y77YmjBDNEGynqb2Y98Fnb9DPkzQJVk1NTe2qtKjiWcBxQYuOT/PtUBRT9BFqcSFb6MWY8M17YbNNwnEhHZ/YLtvkWGOGsEnsSDUMfr+cMz4v/H7j4QbLtf/5fr4W+3Mvjalpg1eSpHKmx7aNV5KkUWTwSpJUkMErSVJBBq8kSQUZvJIkFWTwSpJUkMErSVJBBq8kSQUZvJIkFWTwSpJUkMErSVJBBq8kSQUZvJIkFWTwSpJUkMErSVJBBq8kSQUZvJIkFWTwSpJUkMErSVJBBq8kSQUZvJIkFWTwSpJUkMErSVJBBq8kSQUZvJIkFWTwSpJUkMErSVJBBq8kSQUZvJIkFWTwSpJUkMErSVJBBq8kSQUZvJIkFbRHJUnSopi0stx0NR8LDt67f+2jlSRJk2W6mvrzt1bzYVWzJEkFGbySJBVk8EqSVJDBK0lSQQavJEkFGbySJBVk8EqSVJDBK0lSQQavJEkFGbySJBVk8EqSVJDBK0lSQQavJEkFGbySJBVk8EqSVJDBK0lSQQavJEkFGbySJBVk8EqSVJDBK0lSQQavJEkFGbySJBW0RzUmXv38farnPeNp1V3f/0F1/V3f713+ec9YPbPOj9Zfb/7neytJWgyvft4+1esP3q967j5Pq56xeo/qa999uLr+zu9XV3/zgUrC2ATvyS99VvXmmRchOkjwErqXH39I/bXBK2mhXjBzM3/p8YfWhYAU/3/7K6eqrTPhe8pnbq3ueujRSpNtbIJXkpYLbXbXnrKurnV76NH/V334xn+rvjpT0uXrKBRsmAngvzrx8OrIi75YabIZvJK0QIQrofvtmdLssZdumynV/mD2Z1Qz//lMrdq1b1lXHf7svesQ/pi1bBPNzlWStABcRN80E6b4P1+5Z07oBsKXF8v+r6wqWpPHEm8HOka8/ajnPt5xa5+n1d+j8xZtwp+/83uNbTWHP3Pvuj2HDhUX3nh33dHi7A0vrNd/6Af/XX31voerc7f+6+y66c/T7XfdEcdxvf7gfatnPO2HB15P0tKhtNvVv+Tf6kB+vBOoJpvB2+Lwn9i7um6maoiQSz3eG3qf+q72uE98rW7HSbE81U7XP+P71drVP1yds+EF6Q/r7bL+MTPVUW9+6bPn/jzZ/j4z614400407HHRm/LXP3Nr3bYkaelNz7yOuWxb73Jrn/ib3eHf5sQzeBsQYle98afqcCNY33HNt2YDlnC7YNNL6rtWlnnpR77YGHKUYE/eZ3V17nX/Wm3+yr31MoRiXbqdWffyJ3o/fnimVHzhF/6tLgHX29744jpcz54J5M3/fM+cbafHRbUV2+Zf/s+2L9j04roUfNcxL6yPWdJo4G+Xv1FC+rO3Oaxo0o1d8BJqJz/R3tLl1R3tLOc8EY6EIXeyafhdfduDddj989uOqpc546ip6pzrvt1wHI+H7jlbn/wZVcGUlCmxsn/+f8aWJwOS7VKKvvNdr6rD9Ojn/Wj12WTsX35cgeNLt33GTFU3+7bUKy0/2nXPmvnbxV3fe9TmII1f8BJor15g54XXzdyZ4pytzeFVDxeYKaVSwnz7K5/bGLy48At37/a9u77/ZLvwh5t+PhOevAjYfZ72Q43HRVVyk+jAwfvn5oM2ZknL66yZGih6Mn9v5rpx7OX9VdIaf2MXvJQGr7/ze73LEWxNAU1np2g/7aoSouRL8LIspdu8oxXh2VfifOjR/64GlR4X4drma9/dWb+vn5qprpa0vM6ZCV2ajahiPuUzX2/s8azJM3bBS+j++swHvA8lwqbgfcbTnjwlXcGZ/gHRnrvUs9Gkx7XrvP/du7w9J6Xl9esz15izn+g8ed5M08/Vtu3qCXauyjxj9ePDc0atfTSOC10l3vC1rLe1pHKOn2kWuuyJKWnzvh6SwZv56n0763+p1uXVFsD5cJ6lxjjdMMjQBUnL44iZZp5LDV11cOaqTNr56fCOdtK0mvqrBUqXTLzRtG9Jo4MHJfzVE0P+DF21MXgzlHCjKvfsY17Yulz87LO3PVikWjo9rjd3DJei7fqcY15gOEuFEbrxoARDV10M3gb80YDwysOXO9mY5ALpONxSx0W4Nt0U8D0edcgkHWnJXdLSSkP3Q1+429BVJ9t4G8SsUAQZUzoyIQXVyfXQoScebg2WKTk8ID+uk4/4idmA5UZguY5LmmSUXv7qjYfPjiR458z1gleb6emq+qGz/2+lyWXwtuCOlVB7+1FTs/Mrh3S6xuU6rph6Mh02tJzHJU2ydLif1GfV1NTUrmoB7v61j1bjjpIk4Us7K72LR2WoUR28+6weueOSpPE3XU39+VureZj2Nm0AacemURLTS0qSVg47V0mSVJDBK0lSQQavJEkFGbySJBVk8EqSVJDBK0lSQQavJEkFGbySJBVk8EqSVJDBK0lSQQavJEkFGbySJBVk8EqSVJDBK0lSQQavJEkFGbySJBVk8EqSVJDBK0lSQQavJEkFGbySJBW0ampqalclSZJKmLbEK0lSQQavJEkFGbySJBVk8EqSVJDBK0lSQQavJEkFGbySJBVk8EqSVJDBK0lSQQavJEkFGbySJBVk8EqSVJDBK0lSQQavJEkFGbySJBVk8EqSVJDBK0lSQQavJEkFGbySJBVk8EqSFsWRRx5Z7bnnnpW6GbySpAUjdI899tjqpJNOMnx7GLwFrFmzpn75YZQ0ru64445qx44d1X777Vdt2LChUrtVU1NTu6oxRMgdeuih9Ydg7dq19fcee+yx6vbbb6/uvvvuaufOnVUpp512Wn0MW7ZsqW699dZK0vg64IADqoMOOqj+m+c69MADD1Tbt2+vrz3jjvd84okn1v9u27at2rp1a6XdTO9RjaH169fX1R6rV6/e7Wf8QYAPxQ033FCHsSQtFLVamzZtqmYKM3O+z//XrVtX3/Bz813ypr80SrxXXXVVHb68Z66vXGc11w/N3JmcU40J7i7f9KY3VQcffHC1xx57VI8++mj11a9+tX5xt8mHYq+99qoD+VnPelb1ghe8oLrtttuq//mf/6mWEh9A9skxcPcrafycfPLJ1f77719fd2666ab65p5rz6pVq2Zr3ghhvjfOHnnkkeree++tDjvssNmbEEr8mrVrrIL36KOPni3Rcpf16U9/urrzzjvrsOPF1zfffHP9cz4QhDABvNTVvwavNN5o1iJouLn/+Mc/Xv+tf+9736tLt9G8xc+55rDMuF8HeN+8T67HXGsn4T0PYdfYdK6iXYWAA6HbVb3Bz6699tr6az4UrCtJ80Xwgpt4QiZHiY/wRV4VPa44F3Edpgre6+yTxqaNNz74fOgHaVOg5Bt3Y7QJX3nllXN+Tq88qq6/8IUvVLt27aqXiT8Y2jDSuzeWI/TZHl/TrnH//ffXxzFoew7Hzys6gvE++OC2dQRjXwceeGDdk5Bl0v1zh512aojj44Ofb9/OXtLi4G8qwrVJ/B3TFjwp4lrM9fP444+vrrjiCku+1RgFb1QxR1XyIAgowpRXBGa6PUKKO1VCOO2olQ4L4o+IcWsRaIE2HaqW6EzRhfX5QLJ8KtqD+GPmw5qHb2yf7/OhTtdPjzU/Ptqf+Hlsn3Wbti9pcPmNe5OnPvWp9b+T1qGT8I2b/+OOO87rTTUmwbvvvvvOhk3XHWeO0iIDvkFwNXUA4OeEFR+euFNL79gi1FiG0L/lllvqPyy2R/UK61NibhOhS8AS0myb9Smdsj7bZh+bN29u/IONUjIdOXjvLJN+qOP42G5sH+n2+XeQC4ek+eEG+EUvelH99SQMK8pRA8c1musV16RJD9+xaONNS5tN7Stt0mXzEmsgUAklQpVg5hUBmFYNs0xULfNzlrv44ourhx56qHFYU6wfocv66bb5mu+xf/ZB6bbtvfOh5sWNBOvF++KGJI4vrx5nOYJ4mBsVSfNDzRKiiWcS0a+GJrgoTEzyhEJjEbxpsA1bjdMX1ARu2zJph4q2douuAeSxfhqW+bFF1TntuU3YL6XdPk2l7gh3S7vS0iF0uXGOm/hJxtCq0FYgmQQTP2Vk310Xd2htol21q9RIuPEH17U+1dN9+2d8YJOujgoPPvjg7L65wyToJ6ljh7TcCN0o7V5zzTVD1ciNG5q00hq+ST4XY9HGmwZb3kmqT9x1zafDQ6zb9wHi5/ndHccZ3yMU+8y3WoYPOB0aoi0XhDWBTtX0JLY3SSVwoxuhSzPUJP+t0UGVDquG7uPGIngp2YW2TlJN0nFlS/lBaAr1NIgJwaXq6UjI8kHnvXIhoCcz5yh6Rbf1mpY0f4RM3Oj2zSsw7rj5oEczBST6mkx66GIsgpdfZAyT4QM/aPCmY3/nM7Ys9tnXVtFUWk0/fIwVXsq7YfaVduoghAndGNfb1Wta0nC4qd24cWP9taE7t6rdMbyPG5s23uiERKAM0o7JMgudRzQdmtO1n7b22Wi/zcfwLrXo0czdJwjftl7dkgbH3ztNO9yMT3ro8qCaCF06mdqs9aSxCV569lICpXQZVTxdGF8bYTPfP44IbMK+rQ02PnhNaGMFJe+29Ql1thGl82HEujGVZi6ffUvS/KWT1Ux66FLzGHMkcB4GGXkxScYmeNPHT1GS5Rm4TSVJwohHVqUPU5hvm0Ma9vzB5SXtGEbQt350fMrXj0kuusK7D+vSsaEpfNOxhVYBSfOXhi61b5Mcula19xur5/HygaeKh0DhD4DHdBEohFvMJpVWqS70Q8E2qUKJbvKnn3767NAi/s+xEK583TQxOutT3csfLDcCvGL9tPp3vnMqx8Ts7JvwZSxw3GSwr2ib9rnE0sLEyAFQxcqry/nnn1+No7SqPZ55rt2NVfAiuu0TNNGDN0cYsdxiPCMynkbC/mjLjYAl7AllPnyUsNvEDFfcIca80SEm0FhINQ09mqOqOg//xTwP0iSb5MkgQlrqzx/UorlWzVyMd1Vjig9AOo8z2p72s1j748NH6XE+VbdUWceNAqG72MfJtmOcM9u3lCtpsVDKp12Xax9DFL2+tJoe6+CVJJVD+NJp1LG6nQxeSZIKmp74uZolSSrJ4JUkqSCDV5KkggxeSZIKMnglSSrI4JUkqSCDV5KkggxeSZIKMnglSSrI4JUkqSCDV5KkggxeSZIKMnglSSrI4JUkqSCDV5KkggxeSZIKMnglSSrI4JUkqSCDV5KkggxeSZIKMnglSSrI4JUkqSCDV5KkggxeSZIKMnglSSrI4JUkqSCDV5KkggxeSZIKMnglSSrI4JUkqSCDV5KkggxeSZIKMnglSSrI4JUkqSCDV5KkggxeSZIKMnglSSrI4JUkqSCDV5KkggxeSdKiOPLII6s999yzUjeDV5K0YITuscceW5100kmGbw+DdwStWbOmfknSSnHHHXdUO3bsqPbbb79qw4YNldqtmpqa2lWNgQMOOKBau3Zt488ee+yx6tFHH622b99erQRnnnlm/e8VV1yxYo5ZkrgGn3jiifW/27Ztq7Zu3VppN9N7VGPisMMOqw499NDOZbgbu/nmm+sPhIZDCZw/Js7hzp07K0nKcX246qqr6vBdt25dXei54YYbKs01dlXNlGzvvvvu3V58n+CgCmTjxo2VhvOqV72qbrvhBkeS2jzwwAN1+GL9+vX1S3ONTYk30M6wZcuW3b5PYz93YHwICA+qcG+99dZKkrS4uL5yHd60aVN9zaUk7PX2SRPTuSqqPCj9oq9aWpI0fwRtVDMTwPTD0ePGrsTbhw/D1NRU/aIUTCCDDwVhHCVhusYfdNBBdfV03L2laPOkBM0yIe7q+u7sovQd4c8x3H///fWHtKv9lDtH9kup/vbbb29chm3yXvqW4RWd0br2T9U8xxt/NLzf6HHdVGsQ55Hz27dtSeMtgpdr1/HHH193GKUqetJNXPASjmH16tWzwUsIUQW9atWqujs8wdi0DmK8Wo5tEDis+5nPfKYxaNg2HQ/Yd/591uWD2YZQYxm22xaq/Jzga1qGwOTOM0Ix3z/vnxuMNEzj5iNdjhc4V+myeXtOtKvHtvkjtKOFNFn4m4/CxnHHHVdf4yb9Jnzigjcd2E0w5A488MA6FAmUf/mXf6mDOcIZhFqELsFGD2nu4FiHYKSESNAQcFdeeeWcbRN8fPBYljAn5OLuj4CLu8KlEqHL+6Z39y233FK/t7jR4BhYhmOK44obAd4zP+f9Rq/w/LxE6DKEILZN8MbPeFHV7xApabJwTeC6x7WATpqTHr4TF7xRNUywpMER+HB0lcwiXAjmtPqZbRGmbPfkk0+uA44gTkOGdWNIDqGclqTZHstSGl4KafUv+06re9hv7JtluHmIm4b444hzxb9NfzDcsMT7SIdr8R45l7zvGJJk8EqT59prr6323Xffav/996/Dd/PmzY3X4EkwUcEbPZrRNpa3a9xZOklH2zIEGiVhAp5SZBoyEXwxw0uO73FcTdXYCxXtyQRjWxsLd6Uc93z+GP7rv/6r/nfXrub5WJp6mkuaLDRPhbSpb9KMXfASjk3jdAm9CE2Cp60DFB2B2kTbJus3BWeI4E3bUqnijv1TDduG41qK4I1jb2sbRlrFPCzOG+EeNzZRgpck0IzFdaipxm/SjF3wRiepNpQo59vBJ4KzqW04FR+otD05gi/9eZOlugOMzlx9xz5ftBlzfijlc/55sa+oAeBlr2ZpMtF8RWHE0H3c2AVvXOhTBACBxvcXEmwRXktdPcLx5r2eVwKqqjnHhG5Uy8fQLUrx9mqWJg9NfNyQc11jRqtJD138fyoXoVevZmSfAAAAAElFTkSuQmCC"},555:function(e,t){e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAeAAAAIMCAYAAAAtun/xAAAACXBIWXMAABYlAAAWJQFJUiTwAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAACcMSURBVHgB7d1d7G1lfSfwhWUACxwqVBSQ07SBtlJNNOJgQhpTGNtiWhsxNjg2E2qTGXqjvWJuNNNEb8a5Kd5ok6niREdSqlYnETMONNMZjYyYdqKlVkia8qZiweHFCgjnzP+74Pl3nXXW2nv/X3/n7P/nk+z8X/Z6edbae6/vep71rGefcvjw4aMdALCfjryoAwD2nQAGgAICGAAKCGAAKCCAAaCAAAaAAgIYAAoIYAAoIIABoIAABoACAhgACghgACgggAGggAAGgAICGAAKCGAAKCCAAaCAAAaAAgIYAAoIYAAoIIABoIAABoACAhgACghgACgggAGggAAGgAICGAAKCGAAKCCAAaCAAAaAAgIYAAoIYAAoIIABoIAABoACAhgACghgACgggAGggAAGgAICGAAKCGAAKCCAAaCAAAaAAgIYAAoIYAAoIIABoIAABoACAhgACghgACgggAGggAAGgAICGAAKHJgAvvLKK/sHAJwITu0OgHH4fvnLX+4AoNLa14DH4XvOOed0AFBtrWvAr3rVq44J3/vuu6/7whe+0O22Sy65pDvjjDO6hx9+uH/Mufjii/sTgMcee6y7//77Z6c7dOhQd/jw4f73b37zm92JJttx6aWX9tty+umnd08//XS/b++5557u8ccf7zjY2udh2fu8ae/3vI/yHoKDYm0D+Pzzz+/e/OY3b/6dYPzsZz/b7YWf//mf78M+IXTLLbfMTnfVVVd1L3vZy/oDzU033TQ73eWXX94/UuYTKYATvNmnU60ICeSrr766+8Y3vtHdcccd/TZyMOW9m0DNe3eVAM60eV8lsAUwB8laBnDOqK+77rrNv/PBTvjuVSgkeBPACddFZWrPp9aYMJs7OOW5ttwTRQL2rW996+bfOVCmfNmn2Z48nwPpq1/96v7nzTffLIQBFli7AE7QveMd7+ibwCLhm1ppfu6Vdta+KFhTIx9KSE1Nl2W0oD5RagPZp9dcc03/+9z+/PrXv9697nWv62vBqSEnrBe1BgAcdGvVCauFb2sifeqpp/Y8fCM1ve9973v973O14NQQW5mi1XLH2v+zzFWa7/ZDrqO3a3qL9mdC+Pbbb+9/zwnG3DYCsEY14NQcK8K3SVgmfNMB5a677jru+dap6rbbbutrh/m7dWCamq4F+lhCLc3dbbrM366dLbtenPXl+lxOBvJ7ZN7Ml+bkqQ5UOalJs3Lk9q1l+zMh3Jqj83Oulj9XjmzHVNN12+7vf//7/f7N73nk9W4nQClf24ZMnxOH9n5oy5/aR5ku25nnct09Zcuyp+ZrZW/PT617ytTrtmi+tJikRSHT5Zr6cHvbidCq+3TZ+yJly7ytlWbVbdpPJ9p7ZpVynYgdKDmxrE0AD8M3ctBa1CN5t+UgkA/iVA34pS996eaBs107bQE1/pC2g+C999573HLmBhPJPFlWfma7p+S5XBdvTfNNypWypGyf+tSnjjvgtsCIVWvkKcPUyUXkIJcTkK2WI8/nRCD7Lsse74dsX7v2nNdh/HxbftY7PkFKmdolgXEnszZffqaD2fh9Nl731Dan813KNJb5sk3pmT9+H2Qb81z2R5a5aBCZZa9t5p3ap5HtbScT42Wmc+FnPvOZ8paY7b539/I9s0q5Fn0eIdYigHMQGV5jzZt+v88+E/apdefDmLIMw7+FWDuQ5Wf7gA7lINGmHXfAGoZvDgZ55IDTwjfPtYP8+EPfOqW1W6XSTNzK1+bNQSPhMg6RVsZMv2prwtyJT8rRwner5WjawS01l3ZQzLwJuTZvytz2UZbResTn+axj6mAabf/lYJ5yZfpW28187TJCez7yXLvunWnHg7wMX5dW5lamtuyUbe4WtuyrLCPvhzbvcL+s+tpee+21/T4dyj7L+vO+TcvFsGxtezPfxz72sbKa8E7eu81W3zPZ1mGP/6wjJ19z+z2vTZadz3U+w+39Mvd5hOYnNt5gf9idxIZv9MgH4c477+z223PPPdf97M/+bP+BffTRR7uHHnpo87k3vvGN/f/z4W4Hj5yZn3feeceU9cILL9ys9fzlX/7l5v/zYc+BMLJ9ea4dDH74wx/2H/zMk4NKljFuTs6B5qKLLuqn+cQnPtGXL+XNI+VJbTsHjbPOOqv/37DGc8UVV/Rlz/Z861vf6nZiJ+VoJxo54OWAlv02nPfUU0/tD7JnnnnmMfsoz2dfZJrs20yXVojst6Y1Sz777LN9026mzXyZJtO2+7ez7I9//OObz+fxne98p19GqyUnyKZet2GZ2+s2XPa55557zEljq72lvPl/evFnf2VbhmVfdZ9mecP3Rcr2lre8pf/91ltv7dcxLFte65Qt79H4+7//+25VbX2tv0Neu0WPrKfdnjfcf3v9nsnr/XM/93PHvWci+ynLes1rXtO/BtkfU/s9r+Gf/dmfbe7X9p545JFHule+8pX95zGf+7ZvYeCoL2PYRa3X8rjzUavVtufzwc7BKWfLw+bMVsMaN/m1+XMQmhtGs13HHS4nWlNmZN6pGkKW2w58U02lsdNbioblSJPrsnJMNYu2ckzVYIfhNdV7vO3zVpYp7URm6v+R/Tv1/Nz1+va65WA/V+tur2frE7BomrHhPp279zrlzf4eL6O9ztmmuSbmNk9bx1a1+3uXPeaWv5vv3an9P7zMM/WeGbb6DF+bcbmmZNntfbHd/cf6O+kDOB+A4cF3XCPeTy0Ah9dNh/f0Dg8grczDsGzNveODwbAZeJH2/LBpe/j7otuahp2M9mK4zmE5Fl1T/Pa3v93/bKNsjbUQXWRuPy07iVjWxD7XDDu33HTIi0X3cw/3xdR+b53spqz62iYMWhPpeN6pvgZN297tvidS7jTdLnvM7Z/deu/u5D2zqFx5bRbNl85fw+lhbC2uAecMfzh8Y5qH8qHb7+vA+cCNrwO3gB0f6FqnrWGv6WGNaWirATzuRBStM8+c4UEq+7Id9IcH4Z0YlmORYchlnv3sSLfbWuecNrLZMlPbuyg8Vt2ni+bNZyWPZYbviVUl8NPrf5lh7/CpMm7lvbvT9+kqWrmyrhtvvHHp9PtRJk5Oa9MLOtfI0imi9UJOx5hlYzPvhXZNKgeUrHtuVKvWaSvlzQd0O52ddtPcAW54HW+/y7EuB668nqu8pqvU1HbbqmU7kUc1q3zPrDJaXcXnmZPD2gRwPoR//ud/3odwa75M78b97sHZhqVMYLXhJ/MBHJ8ItOar1ht6rvdztPIvawacqhG1g/qyeXOrVDM8oLWaeuZfNHzmUPZ9uw1pfOAe37KxqBwn+xc7tH2ffbiXPWGX7dMpKVvrNDZ3fbpa239bec/sx4lCK1fWZbQ3dmKtOmGNR2pqIZwg3C/tWlUbjCLmQms4baspT13rap05lo0s1Q5Ew+Bq16GWzd9aDsbXtVpNPeY6Ro1df/313Q033NC3QjRtH7ThOlcpx8lec2ivw161Hqy6T/N8PgPD2mF7X5zIo5W1Mm7lPbMfLV7Dcu1FfwkOjrXrBd1CeFjz288QbiPs5MOZkYxirgNJuy7cwnpu+Mn2v1YLnZLty8AJ4/Vlf7Ra9aIAbfcYj8s6vDUkvTmXhfBwJKF0sNmtcpyM2jYsGpYzr9vcACvLDPfpomvM7YRo2OGvvTYp29xnYydl2w0n6ntmWK72GZ/S7gc2JCtz1vI2pKkQzv2Y+3V9qAVmOzOfu07Urr+1wJq7nSVn9e3gkts2hgfSyAc8JxltmeMD0fB2kvHBNPukDUgwnHYoTZStNpr1Tx2Q23Lac1NfRdeaOufKMRyFau72jpNJtr+99tm2cdC1+4SzL7ZbS277qQ1KMTR8bfNZGL4erWxzrURtXPXhCVWFnb5390p7L0+NoBX5X/us+I5s5qzt9wEntHLdrX0ncA5w+/UNPe26aYxvP1o07aJbQtLTOzWZ9k1D45G3YmqM4MjBNgenVpvJWXvmz7w50LZrbHNjPbdrXe36+nAZmT4nGsPlZJvblzIMtdthlpUj27ouHVfSC7jtt9RCWyCPX7ftXiNe9bXN8sf7dNWyVZ4M7fS9u1fG7+XUdtv6s++qysXJZW0DOFILy1lyuxaZ5rZ8rd4qt0bsxDAcl90KNQ7rOQnBDLXXhggc1pjaLVdzgxVEOxDkAJbAHN72MRxKb07mbWPmtpGOxreOpBxf+cpXFnbqaeVoNautluNk006Ksr255Wy4veMhILdru/t0WLbxrUC7VbbdsNP37l6Xq+33YUvBOr6X2X2nbLyZj3ZrbngdKx+KdWjeTAC3nsbL7pMca7c9bWfepg2h2Gznlq/dKMfJpr1u2d69aJrcyT5t1yr3qmy74UR9z+zk88iBdeRABHAMAxgAih2cAAaAE8gRX8YAAAUEMAAUEMAAUEAAA0ABAQwABQQwABQQwABQQAADQAEBDAAFBDAAFBDAAFBAAANAAQEMAAUEMAAUEMAAUEAAA0ABAQwABQQwABQQwABQQAADQAEBDAAFBDAAFBDAAFBAAANAAQEMAAUEMAAUEMAAUEAAA0ABAQwABQQwABQQwABQQAADQAEBDAAFBDAAFBDAAFBAAANAAQEMAAUEMAAUEMAAUEAAA0ABAQwABQQwABQQwABQQAADQAEBDAAFBDAAFBDAAFBAAANAAQEMAAUEMAAUEMAAUEAAA0ABAQwABQQwABQQwABQQAADQAEBDAAFBDAAFBDAAFBAAANAAQEMAAUEMAAUEMAAUEAAA0ABAQwABQQwABQQwABQQAADQAEBDAAFBDAAFBDAAFBAAANAAQEMAAUEMAAUEMAAUEAAA0ABAQwABQQwABQQwABQQAADQAEBDAAFBDAAFBDAAFBAAANAAQEMAAUEMAAUEMAAUODU7gA5++yz+8cTTzzRP040KduNN964+fff/d3fdZ/4xCc6ANbPWgdwAu23fuu3ul/5lV/pfvEXf7H/u0kAf+tb3+o+//nPd1/72te6hx56qKvWytukXAIYYD2tbQD/zu/8Tvf7v//7x4TuUP7/+te/vn8kfD/3uc91H/7whzsA2A9rGcDvf//7j6lJLnPhhRf2YZ2f73vf+zoA2GtrF8C5hjoVvmnO/Yu/+Iu+6Tm138svv7y76qqrjpmmzSeEAdhraxXACdA0PQ/lOu8f/MEfHHeNN9dWU+P9oz/6o/768HAZd911V98kDQB7Za0COM3IQw8++GD3e7/3e7M9nhPKef5P/uRPjgnhLGcqgFsv6uH8zS/8wi/0y2idu+Y6dbVrz/mZaTLtTntk50Ri2Mls1eUu2p4sM+WMLCs9sldZ97LtB+B5axPAaU5OGAwtCt8mz6eG/MUvfnHzfy180mw9NG7e/vVf//XNW4daWEU6c407dGWZuTY9nK5J2H/wgx/stirN6DlZmFpmW27KMReGraNak/2Vk5ZxObOccbP8snW3W6i0JABMW5uBOHKr0VAO/KvWwjLdOGzf8pa3LJ0vofrRj350NoSa1I5vvfXW2ekS6nl+rsf2lITfsnVnuZkm61/FBRdcsNL2rLLurDNBPm6VAOB5axPAwybkuOOOO7qtyP3AQ8tCKBbd5tQkpG+66abJ6RL8jz/++OZ0q4ZVphtPm2bfnHRku1OLHa4/YTluHZiSwF42XaYZrzsnL63WPz6RWVRLBjjI1qYJelzL2+o1yHFwrBJYCZYE6Cc/+ck++FoP62Gzd7u9aShBlebZNl1C7YYbbjiuV/aUqaBOE/r4hGN4K1bKlL/TxLxseyJB3loQxtszbhmYWnem+cAHPnDM3+P9C3DQrUUAT4XlXKehOVOBneUuC/KE2ty6xiNbRa71jke3StgloP70T/+0O3ToULfIuJd3ljdV288122FHqtbxa9k18fe+973HtQYMXXTRRZu/Z99MrTvzZztarX9YIwfgeQdqLOjdluBcFPTjWnmCaG5oyYRZgmscsGPD5tyE6aKhKnPf83D61LAXdYpKmC4K37EEfLZxah8YQhNgMd+GtAPLwmp87TP3Fy+yynXrYagn0BOCc49x7X1ZZ6xl5ZsqYzqP5V7q1PRX7ewFwBrXgFdpbh1PP7bT+3PHy1zWLL6suXvc1J6OZ8Pbp7ZanrFVtjc12/Q4HzZFp2bdrl+fiF9yAXAiWosa8LA3cTPuFb3MuPa2G19ZOA68E/ErELeqDV4y16mqDTSSTl85OXAbEsC0takBp3Y5bPLNQBFb6Xk77oGcWtxOjQN3K/f5rmKr3xe8W52hWgjnpCX7Lfs6v091IEsAL7tWDXAQrU0A5/rlMIDTmWl4q88y4wDejRGcxs2vy25tWvb8eFuOHj1aOtJUTgCGzeoJ4rQ8vPOd7zymiTohLIABjrU2nbDGB/jUNpf1KG6m7tVdpUPSMuNa9LKvSFz2fAJ4GOoJud2uVe9E9lleh9/+7d8+5pJAyrjKfdUAB8naBHDCaVwbTLAuC+HxeMixlWEsF0ntcBxEc9dEE1CrfIfxcBsXLS9Sq8+12PbYaS/ldm23PebKm9diq/dhAxw0a9ULOoNSpBl02PyZL0pI8LReuU2mS/iOm55znXT8RQrblSDKKFnDkGy/D0eaShlSzlWkhpkm3na9NduQ9YzLnO3LMoc1z51uV/bNMHRT7qmezln38HJA5tMbGuBYaxXA7ZuN8vWCww5BCY0WHAmCuebQ1Fanvjt4JxKYGYpxfE10quaae2yXDUeZbfzIRz5yTGBnWdm+BF2ez3XYqeEvd7pd7UsrWrjm5CE9nfO/VuPNyc74/ufdOqEBWCdrNxBHgiDXIOd6/M6Fb/vu4N1uOm0nBct6IOf5Vb+SMKE+9XWHCb6pr2Wc+nrE7Zralqw3NfE8psJ3K6NrARwUazkSVmpqCeEc/JcFX2q9mS7T79V1yyw34T7VY3m4/q3UUDPP29/+9oW3WuW5d73rXbtaA80JxTXXXNOPNb1o3+7FugHWySmHDx8+2q25dnvMsMdwgmTYdLpfUobWGar1at6NAT+yzNbMnd7Xu7HcVbRhLyvWDXASO3IgAhgATjBHfBkDABQQwABQQAADQAEBDAAFBDAAFBDAAFBAAANAAQEMAAUEMAAUEMAAUEAAA0ABAQwABQQwABQQwABQQAADQAEBDAAFBDAAFBDAAFBAAANAAQEMAAUEMAAUEMAAUEAAA0ABAQwABQQwABQQwABQQAADQAEBDAAFBDAAFBDAAFBAAANAAQEMAAUEMAAUEMAAUODUbhc8e+Z53SNXvqv78bkXd0dO+8kOANbRi+/7q+4lX7ulO/WHj3Q7dcrhw4ePdjuQ8P3ub/4HwQvAgfCiZ57sXv7f3r/TED6y4yboH7z+OuELwIFx5LSz+lbfndpxAP/o8Gs7ADhIfnzuRd1O6YQFAFu0Gy2/AhgACghgACgggAGggAAGgAICGAAKCGAAKCCAAaCAAAaAAgIYAAoIYAAoIIABoIAABoACAhgACghgACgggAGggAAGgAICGAAKnNqx6dBpL+of8cCTzx7z3CvOen5XPf7Mkf5xsmnbdrKWH2DdrHUNOKF57SVnd286/JMrTf/Kc0/r/ufbf6b75DUXHffcf/zl8/vn3nT4zO5kdP1l5/Tlf++//OkOgHprXQN+92vP7d62EcDxr297qLvzuz/qAOBEsLY14NR+W/jGqrVgANgPaxvAV7z8xf3Pdr3zbZce6gDgRLG2AXztpc/Xfj9w5z92dz/6dN8BqYUyAFRby2vAaX5+wwth+9/v+2F30cbfl517evee175k41pwzXXgK15+RvemnznzmE5cf/voM92X/uGH3afvfWJynjShX3HBi/tpcv36d3/pnL5TWdz8N491H7v7seOmf9vGicdFL/TYfvDJZ7tP3/PE7PKnyvi7v/RTfWe0SOtByvihv3r0uF7hcdnGdNdvTH/3I093N2+UZbj+rDvX3ReVb9nyAdbZWgZwevxGwueJjYP8ZzYC6D2vPXcjWE7vzt6oCT+xz7fhvHsj+N/zmnOP+/8rzvoXfSAnlP7d7d89rlwJxITWA0/8uHvvFef10zdnn3Zs48VHrn75cT20M31q/a84+9Tu6NFuofdtLP/6y37quP/nxCXLTUvCOMhThpTvFWee2h06/UWjbTxl87e0PqR8wxaIhG/K15afsP7bjZYKgINiLQM4Nc340n1P9j9Tu/rqRg0yteIExs2jmuNeyvpaMH1so9b6pfuer80meBJICef8/E+/fH53w0YITy5jI6APnfYT3U1/9YM+pBJeDz75483nE54tfLOOm+/+f/02Zx05GXn3xvrvXhBuKUPCN8tt8+f3zJ/nsuz3XvHTfbmnaqqvPO/0vqb+1e/8qN+3mXd4MvGeF7Yx8974vx7e7I2eloosN8tPQP/G5+7f95MjgCprF8CpNaZmlYP9l+77p83//4+NZtwE8K9uhPN+BnACLD60EZ43/fWjm/9PILbHf73mwj6EElJTt0ple+Zuo0qItZrr1Dpu/N8P94GY5uspmb+dIIxruZk/JwWf3Chf9t0HN04Sxs3KkRpugvsD/+cfJ9fxr144OUhT83AbWiB/+KqX93+fU9A6AVBl7Tphtd7Od37n2LBqwdI3yZ61P+cdCdXWbPzpex+fnCaB9NUXQmnuVqlsy9w9zK3mmzAbhu/Qhzb+Pzf6VZs/65i7Vpxgj9aEPyW15jmpvc9Jud75xYf6h+vAwEGydgHcAmUcJjnQt6Ab3h+8l1Ibj4TbonBJ7Tze9DNnTT6/qPk4Tb/xt4/MT5Nt/9I/PLlw/q8uGKSkXZtNTXfq5CXbtmj7WvnT3Jzm6NbJC+AgW6sm6ARrG+8410jHYXHnd5/qm1LTc/emv/5Bt9fmxpUee+yF2umhmdrlorGbW4307iUdmObK0OZPJ7U8lllUm53z7zeamdOMndaAXI/OI+VJsLce3mq/wEGzVgHc7v1NkGXc4zntnuATZWjKyuueLVAf2DhheeCJ5SG4nS9ySLi+8db7+hOk/lr3Bc9fBsgjf+f5XH9OBzWAg2JtAnh472/uS50LityS8/ztPz+5bwE8V7NtWk39gUHP5lU9saT23Fx23umT/09LQe7nzS1bH9rjVoFcFmiXBp7vBX7GRmvEOf3rkV7QxusGDpK1CeB2j2lqU7/5+Qdmp2u3vKSzVpqh97L2mUEm+rJdsHgErle+EI4PPrH1ZtjcIxxzAbu5jpnrrm3+N2yU8UP70CzftB7gCeS0VjzfKnGGAAYOjLXphNVu95nrbNTkAJ/acQ74v7rHXy3YanuHXhiwYsrwSyO20wTbbrXKCcjcUJv9YBmDQTzm5k8v57kyvvs1L+kfW7Vs3rwWdxuAAziA1iKA05zZAmbZPb7DHsFvu3Rve0O3gS0iPYDHIZxwSuekSM191SEjh4a3MeU+3fGtTKlVZt1zTfLD+dMyMO64lr8/vPH/dNCaC/FFnr8H+ade6OR1fAinfO3SQTrJARwUa9EEff0Lg0ykJrVKb9pP3/tk3wSdWt9eD02Ze3DfcMEZfe0yAZnvKM5116z3shdqnCnzO297sNuuYS/jj1x9Qb8fsk0XnXXqPw9KsnHSkSBcNn+ag1sz8LiMH5q5z3iRBHDuI85Qmun9fO0lhzZH80q4t1p7TlQ0PwMHyVoEcLvf9ua/WW2Eq2Ez9LsuO2dPb0nKen7jcw/04fO2S8/qQ+4Vgy8jyG04Cbad3IbzfIA/9MI6zt4MzVYDz/Lb+NirzD8es3k4POV2fKyf97m+DLlWPaxlp8NcTogWDeQBsI5OOXz48NFuB+77N/+5Y3WXDb4QIr2eH9/l2ndOKlLb3snyWxlTU9/t+3Nb+WIvlg+wP450h//Lv+124MhafhnDiWyvOxwlcHfalLuXZdyN8gGsg7UbihIATgYCGAAKCGAAKCCAAaCAAAaAAgIYAAoIYAAoIIABoIAABoACAhgACghgACgggAGggAAGgAICGAAKCGAAKCCAAaDAjgP4lGf+qQMAtmbHAXzao/d3AHCQvPj+/9vt1I4D+LyvfFQtGIAD45Rnnuxe8rVbup065fDhw0e7HXr2rPO6H1x+Xfejw6/tAGAdpbKZVt9UPE998pFuh47sSgADAFtyRC9oACgggAGggAAGgAICGAAKCGAAKCCAAaCAAAaAAgIYAAoIYAAoIIABoIAABoACAhgACghgACgggAGggAAGgAICGAAKCGAAKCCAAaCAAAaAAgIYAAoIYAAoIIC36PTTT+8OHTrU/6yYv9rJXn6AE8VPnHPOOX/YrakExaWXXtptbGP36KOPdrvh137t17o3v/nN3XPPPdfdf//93VbtdP5qb3jDG7prr722u/DCC7tvfvObHQDbcvTUbo1deeWV3atf/er+90996lMnZeABsJ7Wtgk6td8WvpGaMACcKNY2gA8fPtz/fOqpp/qfwzAGgGprG8CvetWr+p933HFH973vfa/vNHTxxRd3AHAiWMtrwGl+bjXge+65p++E9bKXvay/JnzLLbcsnT/hnUfmi4cffri76667Vr6GnPUk7Ifzf/nLX+5/7tT555/fl23YpP7YY4/1HaLmOkVl2ksuuaS79957u/vuu6+7/PLL+//lpCT7JycpQyl7tqGVf9nyxzJ/ytheg6effro/Cco+ePzxxye36XWve10/XcoyXv8f//EfdwDrZi0DOAETCYwc1PMzB/SEcEIn/5uS59761rduBkeTIEhgJUAWyfzveMc7+kCZmn8cdFuVkLr66quP+3+WnzJnu9PZbLx9KU+a4BN+2Q/D8p1xxhnHTJse2q31YLz8zDe375osP4+xVobsg5zMDGW/5bkEfZY/NT/AulnLAG61w9TuIgf21PwSIjnQjwOgueqqqzbDN2H7jW98ow+thEfCLcGQZc3J/C3cpubP86kJbkdCsYVvtivbkBp1wjHLb+vOCcRcLb/V6lO2lCNhN6yRZvta+Gb5eQzLn8ei7R+G79T2Z9ltH0y1JuRkINPktcq6l4U9wMls7QK4Nf0mKFoAR35PuKYpdiqAh72mx7W0BN0XvvCFvkNXq11PrXfZ/DGuXa6qBVtq821Zbdl5ZHtT+842pixTAZf9MlUDjWz/MDyHtf1W/qxjrnaa+YfX3ae2PzXdnBzNXQrI8wnfz372sx3Aulu7TlgtBMYB1K5fJqDatcWhFqwJmbka8qIm6FbrXjT/7bff3m3H8HryXBmyve2EY+4kodUspwyv185d6826W6/yqfnbic/cOtr/M+3cSFo7baYHOFmsXQC3IEzz51CCJQEUU7XQ1nQ8rDWPDZcxN/+ijkqtM9JWtWW3mu6cVvbxNehmqgPUeB0p36J1zG3fKvsvJwktwMfX2ZtF6wZYJ2vVBJ1gzXXEBF0O5GkWHUoAtM5K45pkq2EuCqlFzw97DC/y/e9/v+8MthWrLrs9P1XDX6btq2U9tefK0AK4XStexljSwEG3dgEcObjfcMMNs9O1e4KnrpPONbFWaj2VT4ZOSQnoVWqxarrAQbc2ATy897f18J2S2mG7LWgYwAne9twip5122sLnx7f1TJVzq1pYzTUtN61WuZ2gfuaZZ/qfy8o/93xrGcg+HXYSA2Da2gRwC9+E1cc//vHZ6dILOt/mkx7LaYZuYdWahpeNljXXfJzgSXjP9bJuloXolGHT8qL7mNv17+1cZ8484wE+psztnzb/dk4wAA6itemE1W6PWdQJKFpHoHZLTNM6bbUBJ6ZkIIy5GvK3v/3tzfnnQijzL6thTsk2tTLPXV8dtgBs52sCM0pWjPfLUMJ3rvNUu3bcboOaK2O7V9g1YOCgW4sAfulLX7oZjF//+tcXTpvaYwubYW/oBHOraWYwi3GItvtX564RZ5lt/tyPO56/DaSxnWvMKXPbrpRhHMJZV2r17Tag7XztYhusJKZGw0qo5v9zhrdBZbrx9idwU8aUP/vSIBvAQbcWTdAtkJbdptOkttvGKh426WYAiOuuu64PsnTiyvKG14bzd0JmbjCKuflTo07NNwGXa6XbGYwjzeVZTsIro0mlNp1tzXJbjT3rShm228Hptttu2yx/QrSN/NW2P7+nHHPbn2u/119//XHbPyxjlmGgDYA1qQG3ZtFF116HhvejDmuTCYxcP241wYRGC+kET8ZZXmRu/sj8Ow2ezJ/BPFooDpvLs86seydf+JDlZoSq1oTd1pGfOfHIc4vCPScyN998cz9/O/FoZczfeX3yvB7QAF13ysYB8mjHcRK67csH2pcE7Of8y2TZrfa+F8vfjfK3Mmb+ZfdXAxwwRwQwAOy/I2s3FCUAnAwEMAAUEMAAUEAAA0ABAQwABQQwABQQwABQQAADQAEBDAAFBDAAFBDAAFBAAANAAQEMAAUEMAAUEMAAUEAAA0ABAQwABQQwABQQwABQQAADQAEBDAAFBDAAFBDAAFBAAANAAQEMAAUEMAAUEMAAUEAAA0ABAQwABQQwABQQwABQQAADQAEBDAAFBDAAFBDAAFBAAANAAQEMAAUEMAAUEMAAUEAAA0ABAQwABQQwABQQwABQQAADQAEBDAAFBDAAFBDAAFBAAANAAQEMAAUEMAAUEMAAUEAAA0ABAQwABQQwABQQwABQQAADQAEBDAAFBDAAFBDAAFBAAANAAQEMAAUEMAAUEMAAUEAAA0ABAQwABQQwABQQwABQQAADQAEBDAAFBDAAFBDAAFBAAANAAQEMAAUEMAAUEMAAUEAAA0ABAQwABQQwABQQwABQQAADQAEBDAAFBDAAFBDAAFBAAANAAQEMAAUEMAAUEMAAUEAAA0ABAQwABQQwABQQwABQQAADQAEBDAAFBDAAFBDAAFBAAANAAQEMAAUEMAAUEMAAUEAAA0ABAQwABQQwABQQwABQQAADQAEBDAAFBDAAFBDAAFBAAANAAQEMAAUEMAAUEMAAUEAAA0ABAQwABQQwABQQwABQQAADQAEBDAAFBDAAFBDAAFBAAANAAQEMAAUEMAAUEMAAUEAAA0ABAQwABQQwABQQwABQQAADQAEBDAAFBDAAFBDAAFBAAANAAQEMAAUEMAAUEMAAUEAAA0ABAQwABQQwABQQwABQQAADQAEBDAAFBDAAFBDAAFBAAANAAQEMAAUEMAAUEMAAUEAAA0ABAQwABQQwABQQwABQQAADQAEBDAAFBDAAFBDAAFBAAANAAQEMAAUEMAAUEMAAUEAAA0ABAQwABQQwABQQwABQQAADQAEBDAAFBDAAFBDAAFBAAANAAQEMAAUEMAAUEMAAUEAAA0ABAQwABQQwABQQwABQQAADQAEBDAAFBDAAFBDAAFBAAANAAQEMAAUEMAAUEMAAUEAAA0ABAQwABQQwABQQwABQQAADQAEBDAAFBDAAFBDAAFBAAANAgf8PPRYHyXbtxakAAAAASUVORK5CYII="},556:function(e,t){e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAd4AAAIMCAYAAABbgM16AAAACXBIWXMAABYlAAAWJQFJUiTwAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAADfmSURBVHgB7d19kF11nefxHxgnjQwdHiaJBNM8TB7QSZxIoo6ELaDjVpmsCGFLN7FciaCCa43gE1W7JQLiXygCU0WZlALRVRPLGjuIlfiHCeCaMEjiqGQFkowwHRGSLJA0AyQKnb2fk3xvfvfX59x7u/v2t7vPfb+qbnXn3vN0T9+cz/k93uO6uroOBwAA4KH/+AAAANwQvAAAOCJ4AQBwRPACAOCI4AUAwBHBCwCAI4IXAABHBC8AAI4IXgAAHBG8AAA4IngBAHBE8AIA4IjgBQDAEcELAIAjghcAAEcELwAAjgheAAAcEbwAADgieAEAcETwAgDgiOAFAMARwQsAgCOCFwAARwQvAACOCF4AABwRvAAAOCJ4AQBwRPACAOCI4AUAwBHBCwCAI4IXAABHBC8AAI4IXgAAHBG8AAA4IngBAHBE8AIA4IjgBQDAEcELAIAjghcAAEcELwAAjgheAAAcEbwAADgieAEAcETwAgDgiOAFAMARwQsAgCOCFwAARwQvAACOCF4AABwRvAAAOCJ4AQBwRPACAFpm2mlvzB4oRvACAFpCgXLLijPCzZUHihG8AICWWDDrxPDO2Ucfs94UkI/gBQAMm8Lk6ksmV3//5CVTAvIRvACAYbPSrqHUW2xCaAOf+tSnav79pz/9Kdx3330BqOekk04KH/nIR2qe+973vhdeeumlwnUWLFgQ3vnOdza9/LRp08Kll15a/fczzzwTfvKTnwRgPFEJ7pLzTx7wnEq9j972dECt0gevLoRp8OpCuGnTproXxJE0e/bs0NnZWf33o48+GtAcBdUZZxzruKGg0o3USHj55ZezUNQ+pb+/P2zdurXw73X88cdnQd3d3V19Tp8xhW8RbT/+fPb09BC8GHemTX5juDQJXrFS76M7Xgk4pvRVzXFpwqgkE18cvd15553h7rvvrj7QPP097bx961vfqildtpqCVjdoRsF68cUX111HN3qxCy+8sHBZbS9eXvvbtm1bAMaTrG33v0wpfI223oFKH7xFF8oPfOADAWhk586dNf+eOXNm4bIK0bgmQ84999xQj2o/YipRA+NJUWnX0NY7UKmDV6Xa+ELY19dX/V0lJZV8gXriEq/UC9JZs2YNeE6fsaJSedrk8MQTT4xYtTnQSie96fgwe/rEcOl7Tg63X9NVd1mFzPX/7fTQPe+kLIC1brsrdRtvXKpVW+ANN9wQ7rnnnupzqras1/4m1r5n6l0YB7PscGg/8cVc+9FFu5k26/gYtbytYwGhn3quKAT0ugLD2lm13JNPPhkGQ+vHATaY4x+u+H02s289rzZdO9/2/tP3XFQNrefPO++83Hbh+fPn1/z717/+dWh07PG517Hpcz3Y82+G8zlC+SkgNQPVuW85IUz7G81G9Vfh3Okd2c/Bhufsynp3/I9jAf3SK/3hid2vVn6+Hp7848Hw5O6D4Znn/xz+9PxfstfKrrTBq4tK3I6rKjxdoFTqtVKGLpSNgldBHYfV29/+9sJlb7nllpoL2fve975qeOm1vPZm+d3vflf9Xb2tdYOQRx131BGnqKSudb/5zW8WBr7ex89+9rMB+yrars6NtmcXYi2jZdPl/vjHP4aPf/zjdW80rIdw3vrm5z//efj6178+YDvvete7wre//e0ByyvUdF71ELWRzps3L3fb1smuqPSpTk2rVq0asG9tU58bW0/71O95YRdvO/6cad/adnrsafvuAw88EPLo73b99dcX1tLomPV3aranvv4GuiktKr0XnQu0l09V2mY/sui0MBIU3Db0qPsdx2p97vrJ3rDqp/tC2ZW2zJ9eYNVTVAESX9y0TFpKHYt0sVVnIl1861WPK9h/9KMfDarjmMKoaLu6QH/xi1/MftcyRaH/lre8Jfzwhz8c0F4Zv67jqnfTIO9973vrbmeotF/dQNXriLV06dJs33lt/w8++GDNv/PaedNOVd///vervxcFZhp8Km2mdDz2Ny06d/oM6+ZDnc3qnd9JkyZVP0f1qszrnQu0j6//8Llw35b9wUtPZV/tELpS2uBNq5mtqi8tVRSVQseSO+64Y0BoqESl95RerHXh1fLNhJcu2DaURduL28DNZZddlm3PxrNqmbySkC7qX/jCFwY8r5KdSqvxDY62oeNWCS2tgtV2tHyr2t8VIkXjuNV+q89GvG/daKTnzmpKTF6AX3TRRdXfH3nkkfCDH/yg5vU06HQ+4nOi85BW8b71rW8NX/3qVwecCx2/lk//Xu9+97vDN77xjZBHf4ebb74593Okv0X6OdK5+MpXvjKivcYxtqnC98bVz7iEr0JX+2oXpQzetO0q7imaXrC8gldVuqqm1iMNLntej7SaWceXXvxuvfXWcMEFF4SrrroqfOhDH8qqtOMAEZVqGtF2td6VV16ZbU+PvG2ptLV///5w3XXXVZfRI63azCvZqSQYB8zvf//77Jj10HvVe1iyZEnNPtPhXr/61a+q50dVqkbVs/F5TauZVdK++uqrQ3rudOxaT+9n8eLFNdvMu4FQIMZVy2loKtTisNaQIGsbttfT9t80iB966KGaf2ud22+/veY5nTs79zpv+lvo/cT0N8j7TOu5tCbEPkf299DfIQ5gC2u0L4/wbbfQlVIGb141s8m7iI7lu/q0tKaLZdourSDXhTgtlTXzvr72ta/V3JhoW2qvjSng1PYa9/DVcjfeeOOAUldadX/gwIEs2Ozxuc99bsCNh9qIb7vttuq/0yAbqrQp4a677spt01d7Zlzy1nrx/vPaX+NzG/dctrG4NtmGUQerWPxva0eOKSTjY9+9e3fuubN2eKNz9/73v79mGT334Q9/uOa5vHOhv8MnPvGJmr/pWP//gZE3kuHbjqErpQzeeJq/uJrZpDMDNZoUYbTo4h9ffPVeijqD6YIctytKo/el7aXDZWxb6QW+aDalNJDScawKlDh4izrspAF+4oknhuFIA0jhdv/99+cuq9d++tOf1qybhk08sUV6YxAvG5d043VUwrXagHT9eB17PZ14Y82aNYXnTtXa6U1X/LnR7/H+dDOUdvaKX4s/R3lBjvaj8L2hEpDf2/hCaJXvbXy+LUNXShe86UUmb0IChc1oVDcPVjw1ojQaNpLeYKQdflLN9lodyd6tCqN0GshWiT8H9h6smjh9pNXraQeqtJ3XSqxpSMZ/A3324nXiqt44rPOGGsVV0boxqDetqII7/ZzH20+rtRtNUZp2JqPEC3PrD58N37x/+B2g7rp/b2Vbz4V2VbrhROmk9nklNatujsdm6vexNmdyXiefetKATEufo0nnWDc4uhmw0t9ITmCibcfvX+298VCqRvJ6u6t0bzdp9h40n7MFmwIyDS1bx8bzql08HUaUriOnn356zb/r/e21jfhvr33F5/bNb35z09uS9HPERDOIraqEpibD0Njcofj5tr7KNtqj93KR0gVv2oHExnim0ouJekGP9y8rGKvjLhuNPx4Jrd5XXjusAvfZZ58trGHROpoUw8Jan021i6czXOXVygz2pintER1X1Q/2XKTbIniR6nvl9TBU06b8VWh3pQretAetNDtOVxdFdVwaS7P2DPZYxuKYZA3nSXtY23AYmzlLDx17WlsxHOm5U1XyypUrQ7Pyzr1KpvZerJ1WJWmTN9uXmjWsZ7BVq8cl3qJvV4on4LB1630e0nBUSbzovajndj3ptpjJCjWOD0Mu7coZp7wxtLtSBe9w2mptCMtY+p7e9ILXKFjT19N2S28Kp3g4j0qAX/7yl3Or/zU7VauDNw6vw4cPD/tva53O7DwrQOO/Ud6Uj/GUkzof+ozFwVv0pQgqScfBq30WVRGnnbV0nuO//XPP1balpVXPqbSJY7Q/RxhbZp/RETrf9IYwVCdV1tVUlJoesl2VqnNV2gnkgx/8YHXcY94j7SHczEw99cKv1TMupVXf9WYvkvTGY6hz+LaKlfCM3k9R7+iRaI9Oh40Nt8o0/ZrAeMhW0ZSP6bAiVbnbey1q3007UylY4wk6UjaHcyx+7+nnqNEXhKRzSI/25whjy0knDD10M8MsMZdBaYI3HfeoC6QuGFZKyXukwZt3QUpLnUWl6viCOlhFF0Grko2XKyoV5o23LJr710v6vore51CHrGi9otJbGoRaNh0THbNpF+1RNO1mXKqNbyzSIUGxeFhReg6KSrxpIOvvXnTTpzG68WdPxxFXX6fHpqrmonOhqvP4M54OtQLmzx7eV/wpdM44rb2rm0sTvOmY1bzxqak02CQN1vT1dKJ/m3ax3kW9Ea1bdFFNS4h5+1LVZfplDnnjl73p/MbDad72trcNuHHQedRMUc3OL513I1RU06Bxu/H+te90Jiux86dt6XHJJZfkzpssRee03rlOhxWZet8EpHXSsEyn3tS5szm0Td54ZT2Xjtu1Dm8xnYd0H2Phc4SxQ4FRr7T66JMvhyu//nT2eOb//blwuZltXuItRRuvLkBp8DZb2tMFLi4ppt9YpACPw8IudmmHIesk08yYx3SbFuaSfjuR/q0q8Hi7Fr7x2NSYLvKayWq06YKvyRjiC7zOm96rzpdKaVYFrH83M5Z3x44dNf+2L2Cw/cXTRmoyCM24pTmHzac//emsw5f2p9DTPtPg1oQURT3E068JtP3mVRnH4qFIpt7XANpsYfriAyvN2pAo65CWNyRLn5e86nx9zvVafAyNPkc6Bs1kBcTOOG1gr2QFrsb3bt1xrFPf4v+1M/u+3msumRzO+JvadWZPPyG0s1KUeNMvvFewNdsTs9F8w7pgxVPyFVHANDucR8GeVwIqojmF80rw6ZzBYqE7VoYWKcTSzjlWLa7A07nWdIgaZtMMC5BmrVu3bsDfz/avz00auvrbpPMfx9I22/i46q2Thmy9rwE0jz/+eHYTlp4/q+JOQ1df56ewLjoGva+8c5f3OdLc3I2+6hFtKGmf1Xfofmn1M+Gq256uCV1z38P7swC+4d5nakrA7d6zuRTBm3aKaqaa2eRNj5hWh+rCnXcBFAVd3vzJjfapSel1EWwmgHUTofDVMRRVgWo7OgZN+j+WOsOo1Kkbgbz3qn8rLJYtW9b0Bd6+GKHeuUjp75f3pQ4xlWL1ZRH1QtfEbbaSN4wolfeZbKYKV+FcdP7i7XzpS1/Kbl7q3XDqtUbnzj5H+pvUu5lAe1KPZjnwyuvZzFOL/+fO8JMm5nBOA9h6Nrer47q6ug4HNE3tYDYrki5erQo5lTisCrGZZW2aRfuavvHS89SG0uh96rhbMUbUSn7NbMt6AMd/w1Ydh4f486e/vcJxqMcef46klZ9nlJMCU9XH9z38Ynjplf4wVNrGo5UScpsOKeoneAEA8NNfym8nAgBgrCJ4AQBwRPACAOCI4AUAwBHBCwCAI4IXAABHBC8AAI4IXgAAHBG8AAA4IngBAHBE8AIA4IjgBQDAEcELAIAjghcAAEcELwAAjgheAAAcEbwAADgieAEAcETwAgDgiOAFAMARwQsAgCOCFwAARwQvAACOCF4AABwRvAAAOCJ4AQBwRPACAOCI4AUAwBHBCwCAI4IXAABHBC8AAI4IXgAAHBG8AAA4mhAAAGiJ40J7ORyGYtjB2/vRbwcAANpLf+j67ifDUFDVDACAI4IXAABHBC8AAI4IXgAAHBG8AAA4IngBAHBE8AIA4IjgBQDAEcELAIAjghcAAEcELwAAjgheAAAcEbwAADgieAEAcETwAgDgiOAFAMARwQsAgCOCFwAARwQvAACOCF4AABwRvAAAOCJ4x4CzTu7IHkNxcseEbF39bFfDOX8A4K00V+uLzj6lcvE9Ife1p198New/+Fr4zXMvhbHoqc//p+znxfdsDQ8+9eJgVg3Xvacr3Nj9t2H1v/4pfOzH/ze0G905PnDVgtBV+dsvGsL5AwBvpQneFe+YFq6oPOpR+K57fG+4edO/haf3HwwAAHgrXf1kVrJ9dmDJViViVccqoC9765RK+P4h3PHwvwcAADyVLnhVoi2qclXoqlpW7YG3L5kVXjz4l/CdShUtAABe2qpzldpBL757a7Wa+Y4ls9u6UxIAwF/bpc7T+1/Nwvepz1+Qha46J930wB8GLKfXrn3PmUc6bZ1ypNPW/lf/Eh566sWsirpeG/G1lW2qOtvWU+eu31aqvxutF+93xXnTqvtUp7Bm26UvOuuUcO35Z4Z5p59U3bduOBqV7G2/l711cjj5hDfWrPvQUy/U3bf2tWLetHDp26ZUn6u3X93t3X3534X+ys/Pr38yO083Xvy32Xb03H/9/m9qOsLVOye9tNUDGGfasrin8FWVtMLxisrFPA1eBcADVy4YWBquVFHrtUvfNrmm5GxUhd3z4XnV0FN7syi89dB6S3/w29w2aDnz5BPCvZVAqumdfXSfOlb1ei5aVxReN3WfM+CYtG/dYGh9O6Zm3q+t+4fK+VqU837ls5XtfqNSc5CydT9TeX1Rut/jj1T7K2R/WbmRuafyno2eO/mEY8dxTmU7G69akHtOPlA5J/+5sm0AGE/atp71vsf3HSmVVi7oCpw4GHo+/PfZcwq5z254Mvup1xUk914+J1tHPy9OLvo3dR8ptSmgPvbj7dWhLVpe29Rr+nn2bb/MPSatr9LcxT8+FrA6xmq79OLZA/Zp5r35pCzMdENx58O92foqSaoEa6VJHfPSH/ymZj1t10I3fr/xvs+pHL/Cb/5d/1JznhSKFrra5x1bjpTota3LK+veVnntvMp+i2oVVPLV+lpH6/72aCnX9n9qZTsWuraMlaC13bsr7+efs7/VGwMAjBdtG7zxeE9d2K1qc97pf12pJj2YXfzVSSsOGq1j1dRHxg131JQCbThTHLqSVW9XAlOlYdufnsuTlkpVXatlFY55+zQK1nQsr96DHno/KkkrhLWN+NgU9gpKbTNv37+oLLvt0/+QhW8aoB+oVC1rWw89/UK4adOx57WNeyrrarsK3/8+b1pu8MoLlWXn3/VwbkncboxUCj5Sw3DsnG2q7Ffrbfv0e7L99AcAGB+YuSrUVm3+5tn/yAJIVcJ5YaCLvz1vbbjN0Drarh5FoXtTpc0yb58Kt7jausjNm/LDTQFqYXvZucfaYRVYdrNQtG9VM9+55ciwq3/8hzNrXrtjS2/2fm4q2K+VXIsmNlFYfqVgv/pg/mMl6O34886ZQvuqyk0OAIwnBO8gqcS5/+Bfcl+zcFPpUoE22GkM/70gkKVon/G+n66z/m+f7ct+/v3R9mdR9bS5r1JFXeS7//ps9vPkN01o+j0p1OMbmiKF7/n4UO1s9b/rdAyr1+YNAGNR21Y1n3zCG6q/7391YIlLvYPV8eqis0/N/t1M4Kia94GjbZKrj3YYUhiqFK2215EcM1wvdOU3z/1H9vOsU469j2qv66gUnycOfa0TV3VbqVnnyTqVtWLe5LM6j5WS1UO6+Nhey46/6+Tmax8AYDS1bfDOe3Nn9fd06IraYuMqXQWNdbDSRV5tj3njf/Xa2bf9n+r0lQoihbAeal9Vj+PPrt+RhfB4sv/P+aGc9jjW+bGZw5qpGgeAdtS2wWttm+mk+jZ2N+2ZHLvo86fUnXhDbZKrj5ZuFb4XVkrP151/5tHe0H8XHrzthbolzKE4pUHPXiuFqqOVsZLsWQ1Ki/Om/vWxdY7WDqiN4p8rNyha99eVoP38hicHnKvuyvu+qBLMQxGXso/0Wi4Yr3t8qHbAAoDxoC3beFdkVaNHSmKrk+pflUxFHYqKvunmrEFUa6r0p6E26pWrsLX5olvtwgYlS2vbjaukVQVu6pVMrXZg/yvHvuFJ78PaYK+qVLG3+luBrHah4bFFNwUAMB60XfCq7fb2o2NPVapN210bdQgqCk2F0E0Xn5MNuclzpK135DoCHZmF68zc11TaVfW4rPv9vhAfkwVm0Tc76QNyw9FJOdY9uTfa37ESdl7HL6330fOGd4Nx3+/3HundfH5Xbg2DXvtMwXsGgLGq9MFrXxSvYTQaC6vOT9Vxq3cPnIzioaNBdG3lYp92ElJ43Z4zS5OoClaTTeh1TViRuiIqZa97fF9oNZUQb+w+Z0D46kbjgaPVvXrP9z1R27588wP/lv3MvkAiOe5sHO7i2dWq3FuiYUPWIetIMOevd8UwSvba3z89vDv7XWOI784mLulo6T4AYDSUro1XAdKoKlelPPVAzusJrDGplx6duEFfUG9jaI90lOrIqo0vrVRHp9XN2pZCzKZtXHHe6VlVrkqDGrZjPX61TKMeyEOhqvELzz41+9ala8+fnrXlWnWwZOOIc2409P7i476ucsOhknl2w3LKCdWS5i3JcfcffU7hd2XlfHdXbiqs6lo3GJ2V9dTuq9eHSmOIbRuXV865HlZC1/vSsenYFb70agYwXrRN5yqV9h586oWsarlee6TC5R13/Ut1ikcrpSq4NJ2iJo249Gg7cEqhrcA7MsXjCTXhrH0282UFw6HpIBWeV7zjjMpx1+676EYjPm59uUP8nm1dhVveOftG5Vy8cLSkH79f62zVW9nmcIJ34D46qsf2wtG/xz9VXqfUC2A8Oa6rq+twGIbej347lFUWJqd0VIfIDIaVNrNOQi++2vJezI1YQMVDe5ox1OO2EqjWaeZblIbCYx8A0Jz+0PXdT4Yh6Cd4AQAYtKEHL1NGAgDgiOAFAMARwQsAgCOCFwAARwQvAACOCF4AABwRvAAAOCJ4AQBwRPACAOCI4AUAwBHBCwCAI4IXAABHBC8AAI4IXgAAHBG8AAA4IngBAHBE8AIA4IjgBQDAEcELAIAjghcAAEfHdXV1HQ4AAMBDPyVeAAAcEbwAADgieAEAcETwAgDgiOAFAMARwQsAgCOCFwAARwQvAACOCF4AABwRvAAAOCJ4AQBwRPACAOCI4AUAwBHBCwCAI4IXAABHBC8AAI4IXgAAHBG8AAA4IngBAHBE8AIA4IjgBQDA0YSAMWPixInZ49ChQ9ljqNuYNGlS9vPAgQOhr6+v+lpnZ2f2M34OAOCrFME7Y8aM0NHREfbu3Zs9ikyfPj0LJQXS7t27C5dTQHV1dWW/b9++PXhZtGhRmDNnTti8eXP2GKz58+eHhQsXZudCent7w9q1a7Pf9b6vvvrq7Pdbb701AABGRymCd9asWVlgxUGTp7u7O0ydOjUrTd55552Fyy1YsCB7KMQ9g3c4dPOh4BadB91c6AEAGFtKEbwKGgWvQrWISrH2uqphVfotKvXqNdvueDFz5szs586dO0NPT08AAIxNpehcpbARC9Q8U6ZMqfm3VSWntA0LaNvueKCqZKlXhQ4AGH2lCF5VHe/Zsyf7vajUayXCgwcPZj+LAtqe1zbHY4jZ+wMAjE2l6dWskFToqq1z69atA163Eu6GDRvC0qVLs39bD+K85SzIUwpmVWvbclpfbakqHRe1B6vDk6q69brajdV+rG2IjnXbtm2hGeo8pZK79rlp06bsucWLF2c/rcSr7drNw65duwZVatf50LHpJkW/i96bjlvbSc+V2sy1nI4/r1ObHdtgX9e5suMwdhzjpc0dAIqUJngVDLpY55V4J0+eXO3NrOXUdqvg1IU9vZBblbRCK6UA1SOldbQt/bRAjCkItT/tf8mSJdWQFOuB3IjtWyXauAPZ3Llza5aLq9A1bKjZ4NWxL1u2bMDx6Fjt2NesWVMzFEnr6LV9+/YNCFa9Zzu2+EbBKFzt9fg1nUcFsh2H3q9+t+PQdnXzBADjVWmCVxd+u0grEOIgsDCyqmP91HNpu69Kb7Zs2rEqDl2VUvVQCFno6jUFv+SFr6j3tfahoUIqUSuQmhlTm4Zu/N5WrlyZ/VQpXjcd2veOHTuy55odC6wQtNDVtjdu3Fjdh703Bd/y5cvD6tWrq9tVqOt85dUyxOc2rz09Ps+2PR2HStE6Dm1P58leU0lerymsdc6GMtwKAMaC0sxcpQu0hUV6obcqSwtT+5mWFi0sVLpLqz4tdHXBV7hZYGo5Pbd+/frs3wrfeh28FJxaXiVq3QA0GvJTL3RFx6GHBZSWS59rxMb+WqlWx2WTeKhGQPvVdhW+dnMhViuQV8tg51w3GHrfVnVt4urw+PxYzYTOcXz8Og49p79dui0AGE9KNWWkVaumwWdBbK8rWBQkNsuTsbBIO1XZ+gqEopKWgsECPW6bTI+v3gQfqUah2wo6B3GVb15Y631bO3QcvDZWWNuIS7hWc6DzYVX5RTc5cc2CVS8XVb/bTUBRjQIAjAelCl67iMcl3nhMblqCkjgkLQzSdlF7vlHw2etpFXb6ejM8QlfiY63XHmznK71ZsXXyzrlKs1aijfdjY6rTmoV4WJhm2Yo7eQFAWZQqeNXJx0qydqG3YE07S9lFXu2TxsIjDbnBBm8cTENhUz+KSt8jFbpix9qoyjsephSHYV4tQ1y1b6XivBuctGZBN0ZWo6DjUrv1tddem7U/q323qAofAMaT0n07kQWshWjRLFTWGUslr3jiDT0/2lMtqqrVgs46N422uLYgDt68dnXrBW2vKZzjc5y2uccUvKtWrco6V9mQLm1PVdzq3KUwti97AIDxqHTBaxdzlaqKqjTFOmNZ6bioN7NYR6pGJdlmS4+N6LgUPupdLApeG/fbahbwjYY1aUiWiUNYv1uHJ51HG7oVl2bT6uiiEq+xzlXf+c53sjm11eErbhrQkCwAGK9KF7x2kdcFOh1GVG9ZK43ltXNayatRVaeF03C/ds8mq1CHJgscfQHCSJT0VD0v9abbFOu5HPcej49XdL7TjmxitQvavt0MNVuzYDOIqde4VUPb5CcAMB6VLnht+khdmNVWKkWdhqxa2kK6aJpIe04luaJwUqBonG69/Q2FSr32flTV2urAUfhZKb9eqdqqu/Pem62vc5NXjWxhHQdzXs2C9q/9FPUKt/HJADCelS54xYLSSmlF3zJkHX+sirhomkiFhgWOqjnTYFDgKBRtm60MXoXWunXrquNo1cbZalaS1JCftD1ZQa+OTXaO8oZTWac2C9a0B7nYObGvLsw7R9qH9q9znJbudRwXXHBB9rv+Hs2OUQaAsaY0M1fFbPpIyQuBomXzpok0qupcsWJFNfzSmbJEoVvv+4CHStvVV/0p3BVsCqdWztykGxVtz4YwqaZA70/vTQFo7b9apqh6WOfOSsx58ynrdYWuzY+dV7OgDlXahs7xNddcU+0VLbrZsU5nfO0hgPGslMEbh2KjSfXTkC6isNB0iVYVGo9L1b60n3iKw1ZTUKnaWeGlY7AvDWgVC1WbHjLupazzotfrfVuTfSeyHWsqrl0oOs86d7px0TFomFd8DDrHWk/zNI92r3MAGI7jKhe3wwGDZtMg2rcTlanq03ooj/Z7K/M5BtC2+gleAAD89JeycxUAAGMVwQsAgCOCFwAARwQvAACOCF4AABwRvAAAOCJ4AQBwRPACAOCI4AUAwBHBCwCAI4IXAABHBC8AAI4IXgAAHBG8AAA4IngBAHBE8AIA4IjgBQDAEcELAIAjghcAAEcELwAAjgheAAAcEbwAADgieAEAcETwAgDgiOAFAMARwQsAgCOCFwAARwQvAACOCF4AABwRvAAAOCJ4AQBwRPACAOCI4AUAwBHBCwCAI4IXAABHBC8AAI4IXgAAHBG8AAA4IngBAHBE8AIA4IjgBQDAEcELAIAjghcAAEcTQklMnz49TJo0KRw4cCDs3r07AAAwFpUmeOfOnRvmzJkTtm/fTvACAMYsqpoBAHBE8AIA4IjgBQDAUWnaeIers7MzLFiwIHR1dYWJEydmz6mjltqM9ahHy2tdtTHLoUOHwp49e8LmzZtDX19fWLhwYbb9LVu2ZNtMaT091Dksb30AQHkQvOFI8HV3d4eOjo6a5xWECmIF55o1a3JDUIG6fPnyamiaKVOmhFmzZoX169dnPa61HQV4GrzLli3LXjMHDx7MtmXra7979+4NAIByaPvgVXAuWbIk+723tzcrZVrQzZw5MwtdBaHCdfXq1VlpNF7XQleBqnV37tyZvabg1Hb1UJjm0bYVulpXAW29sbU93Qho/9r+ypUra/YLABi/2r6NNw7dtWvXZuGnkNNDJVQ9Z6VQDVmKKTT1vF7Xclre1tV2FNT79+8fUBo2M2bMyH4qsOMhUArinp6e7JhU5Vy0PgBg/Gnr4FWJ1ap5N23alLuMtfOKBaWZP39+9nPXrl25bbcK4KLtilVtp1XcRmGuB1XNAFAebR28qg4WBWS9cFPJU+K2WJk6dWr287HHHitcVyXZoqpmq5ZWlbOqlu14AADl1dZtvBacqs6tZ9++fdXfrT03rv5t1PNYwZ5Xqt22bVvWjqttqVe0Htq2bgIUygp8ejUDQLnQq3kUKWRXrVqV9apWANt803ro33pd4bx169YAACiHtg5ea5dt1HlJbcHGqo3jNl1VEee18ZpG24/HCmtbelhvalVBq0TO/NMAUA5t3cYbB69NmpHH2l61fDysx9p+VVItYpNqNEvVzAph9Yi2kFfpFwBQDm0dvHHHJ5Uwi6jt1ZZP1xcNM8rrGKUwL9quStF6TY+80FfAW7ADAMqj7cfxagytKFzTkFQgLl26tDpW15Y1antVKdiWU+lWAaxQ1e8rVqzIlsvr1axg1XAkC9+UStGauUqoZgaA8jiuq6vrcCgBTYTRbLWuAjQOUbWjWqlWQaqHeiErQK03sia0sOE/MYWypn3Ma8fVdjQO117X9I9xiCp4Fy1aVF1W1cw2WYcNXVK41xsLDAAYV/rp1RyOTJ6h0LMOTXGIqrrXXs8T90yOvyRByys06031qB7LVvLV0KZ4v/RoBoByKk2Jt1VUVayqYwVi2plqqD7zmc9kJee0xBvTPuNOXIzfBYBSosSbGsz0jPatQwrnopJpXF1dL0xtfmcAQLkRvMMUd4xKw9e+vUhUZV1vrC8AoD1Q1TxMca/kuIOU2mzjqmN1siJ4AaDt9RO8LaBOVdYxK6YA1mQY6kHN9+kCAALB21p0kAIANEDwAgDgqL/tZ64CAMATwQsAgCOCFwAARwQvAACOCF4AABwRvAAAOCJ4AQBwRPACAOCI4AUAwBHBCwCAI4IXAABHBC8AAI4IXgAAHBG8AAA4IngBAHBE8AIA4IjgBQDAEcELAIAjghcAAEcELwAAjgheAAAcEbwAADgieAEAcETwAgDgiOAFAMARwQsAgCOCFwAARwQvAACOCF4AABwRvAAAOCJ4AQBwRPACAOCI4AUAwBHBCwCAI4IXAABHBC8AAI4IXgAAHBG8AAA4mhBKauLEiWHOnDlhypQpYdKkSdlzhw4dCjt37gy9vb2hr68vAADg7biurq7DoWQWLlwY5s+fHzo6OgqX2bp1a9i8eXMWxgAAOOkvVfCqlLt8+fKslCsHDx4M27dvD3v37s3+rednzpxZLQHr+TVr1hC+AAAv5Qre7u7usGDBgux3lWg3bdqUu5xKxHqIqp57enoCAAAO+kvTuWr69OnV0FUVclHo2ut6iErAWhcAAA+l6VyljlRy4MCBaqjWo2UUuJUSf1b6Xbt2bc3rixcvzn4qwIuqohsto6pv3Qwo3PW7HZ+qv/Wot80tW7Zkyw5lmaHsFwDgozTBq5CRbdu2Nb2OqpkVvFOnTs0CKg7PuXPnZj8VbkXBW28ZtScvW7ZsQAcvtS9rnwr9DRs2FG5TAVkUvPWWabRfnaf169fTrg0Ao6QUwTt58uRq0OzZs6fp9Xbt2hUWLVqUha6CyTphDVdnZ2c1/DR0SaXr3bt3V4c4qYSt8FT41asSH8p+ly5dmrtfBa7awPVT+2/lfgEAzStFG6/1UpbBhGdcWrSe0K2gYLPwUxW2wk8UtCqRq8Qpqg62quBW7VfnQu8r3a9Kx9aJrNX7BQA0rxTBG1erDrYKVUOOWkmBZlXBRaVKlbStZG7LtoJVt1uwpxTEuhlo9X4BAM1jysgWs5KzbgDqlb737dtXs/xwqc3YbkCspJsnHtMMAPBXijbeuNSadpJqxMKqVZ2NrNpbx3H99dc3XF7tsq0QVx177hcAMDilCF4rPYpKcvVKfLF4/G5RD+LhsGrdelrVoSuubvfcLwBgcEoRvApNlXoVPmrnTINXpUGrWlXgWOlWw2ukUbXwYFjpW9tMxwaPpLjU77lfAMDglKaN18bvqtNQXjXqkiVLsnmcNdxGbGiPaDxvkaLev0VVtVb6tiFKQ1X0BQ9FxxPfbDATFwCMXaUJXs3NrFKfgkkhG7PSp163mao0fteCMW+mKytBWqk4ZT2IUyp9W1WvviGpiI3nTUPSqryLOj8V7Vfv0fZrNxSD2S8AwMcbKuFzUyiB119/Pbz22mvhnHPOyQJVAaNS4Msvv5y9rmCy1xWmFmwK3bwS72mnnZYtc+qpp2avx52vbDKKCROO1NSrtB2/rvBUyXvatGnZv9Oqbwt+HUc665WOXetpNq3HH3+85jWFpW4qbL8amxt/r7DtV+sOdr8AABeHS/d9vPE3D4nCSA+FjEItLknW+wajdOpFtQGrFKzn9ZwCW+Guba5atWpA56z4OOwYbLu2zfjLGoy2d8UVVzS1X32lYV64DmW/AAAX/aUp8RoFkUqoKqkqnBQ2+qkS7IknnpgtoyBTqfH555/PJrPIo5LyU089Fc4+++xsG1pX21Gp+Re/+EV45JFHshmg9Fpa4rXjUOgp8LSePbRfVQlrkou8LyzQdor2q30qMG2/aYl3OPsFALgoX4k3psCJ53EWhY+eV0crUYlXJd96FGI2PngovZ+1P3XG0vpW+m5GvN/BrDfc/QIARkx/qYO3HnV8Ununwujee+8dUHIEAGAEtG/wig0JUvhSGgQAOOgvzffxDgWlXACAN74kAQAARwQvAACOCF4AABwRvAAAOCJ4AQBwRPACAOCI4AUAwBHBCwCAI4IXAABHBC8AAI4IXgAAHBG8AAA4IngBAHBE8AIA4IjgBQDAEcELAIAjghcAAEcELwAAjgheAAAcEbwAADgieAEAcETwAgDgiOAFAMARwQsAgCOCFwAARwQvAACOCF4AABwRvAAAOCJ4AQBwRPACAOCI4AUAwBHBCwCAI4IXAABHBC8AAI4IXgAAHBG8AAA4IngBAHBE8AIA4IjgBQDAEcELAIAjghcAAEcTQklNmTIlTJ8+Pfs5adKk7Lm9e/eGnTt3ht27dwcAAEbDcV1dXYdDiUycODF0d3eHuXPnFi5z4MCB0NPTkwXxaNFx6qbg0KFDo3ocAABX/aUK3s7OzrB8+fJqCbe3tzcr4SrcFHRTp04Nc+bMqS6/fv36sH379jAadBxLlizJjnHt2rUBANAW+ktV1bxw4cJq6G7atCls3bp1wDKbN28Oy5Yty5ZbtGhRFnx9fX0BAAAPpelcpfZcq15WuOaFrqiaWSXMgwcPZqXgBQsWBAAAvJSmxDt//vzsp4JVwVuPltm2bVtWQlZYq3ScUpDPnDkze8TrqWq6qHp68eLF2U9tTyVqbV/tuKKw1/qqYta2rWSu6m9bT1Xi6bGo+lw3B4M5DgDA2FWa4J01a1b2U4HaDJWIVc2cR4GpR0phWWkTz4JwzZo1WVDGrMStXtNqv82j9eN2ZpW6bT0Fahy8Wk4dxTo6Oqqv6xjsOBTgGzZsCACA8aMUwTt58uTq70VhmlJo5g0rUgnTQlfhrIfagBWQKnUqCFWKVfgWlay1jEJS61qPZf1bNm7cGH75y19m27I2ZnXyyjsOC11tR/uyoLdAVmDv27evsFodADD2lCJ4rdpWhjs0R4GoMFQox8Gq0FPVrlUhK/yKglfLrl69ekCJ2F6zh8nr3KUSrUI3LQWLjsNuBPQTADB+lCJ4rSq2FVRVXa+6WqEc957OE5dOh6pRoDY6TgDA2MSUkYOgMGymhGnVysNhJXcF/IoVK7L2XEq3ADD+laLEq6FBRuHUitKmqpJV3Wu9kuuVcEeCVXVbz2hNDCIqcTP1JQCMX6UIXnUwMgqp4QRSOvuVQl1BvmfPnmqgK5A9KHjVnquhUirxauiR9m09qx977LGs/Xe4NxoAAD+lCF5V7Sog1darDkfNBG9cbRx3blq6dGkWuipVqgdyui0FoFfwSty5Sser/WvolErk6tWsY2XKSQAYP0rTxmuTSSiMmmkLVUBfc8014WMf+1j1OZvPWTTEZ6xV5apku2vXruzYrEe1500AAGD4ShO86uFr00BqjGs98VhdtZWauHd0UfVtPPlFKxT1yNZ+dIwq4eZpdrwyAGBsKU3wxlNFqtSrKmMFbEpBZm246fSSVmUt559/fs16zXzd4FCoTdo6cMVsvLBmwErfRzzHNAEMAONLqb6dSKVelSAVWDbPsoLJSq8KXSthKmD1nbzp0B8FsWaUUsCqGteG9di6avfV68Olkra1S2u4kI7DvsBBNBuVSr0KYFWJ633Ysep9aT2tz5SRADC+lCp4RcGpgLJJLtI2UIWV2kltuZTCW0Ft61vvZgWwglodsVoRvNqHQlZfkKB25XS4kr2u45gxY0bN+9B7UHCr01UrxgwDAPwcV7mgHw4lpSpcVdPGXzKgAG12+I3WV7Wu1hvJ7+y1HtbpVJJ5x6LXdTwMIQKAcam/1MELAMAY08+UkQAAOCJ4AQBwRPACAOCI4AUAwBHBCwCAI4IXAABHBC8AAI4IXgAAHBG8AAA4IngBAHBE8AIA4IjgBQDAEcELAIAjghcAAEcELwAAjgheAAAcEbwAADgieAEAcETwAgDgiOAFAMARwQsAgCOCFwAARwQvAACOCF4AABwRvAAAOCJ4AQBwRPACAOCI4AUAwBHBCwCAI4IXAABHBC8AAI4IXgAAHBG8AAA4IngBAHBE8AIA4IjgBQDAEcELAIAjghcAAEcELwAAjgheAAAcEbwAADgieAEAcETwAgDgaEIoqYkTJ4Y5c+aEKVOmhEmTJmXPHTp0KOzcuTP09vaGvr6+AACAt+O6uroOh5JZuHBhmD9/fujo6ChcZvPmzdmjLKZPn5793Lt3b3aDAQAYk/pLF7zLli0LlfeU/X7gwIGshKswEpV+Z86cWS0B6/k1a9aM+6DS+7n66quz31etWpW9bwDAmNRfqqrm7u7uaugWlWg3bdqUlYj1UBDrp54DAMBDaTpXdXZ2hgULFmS/N6pG1mtbt27Nftc6ag8GAMBDaUq8KrmKqlmbabvVMup8pXbguXPnVoNY9LzaTHft2pVVVedpdhk9rGpbx6bld+zYUbdzl7arGwKVyEVV4Xv27MmOOV5Pr6dt2Sr1Hzx4MPtdJfm4Gl03GNquth8f0/bt2+lwBgBOShO8aruVbdu2NbW8AkntoQqjtI1X1dUKTAVRUajWW0bbXLp0abXa2yjs9JzCUm3LeUG3ZMmSbLtGIar1FLK6QVi/fn0WlLYfPZd3HmTLli3V96YageXLl1cD18JZx6OHArjomAAArVOK4J08eXK11KeSYbMUSiPRscramhVmKnWqNKn9qKSpYFX4KQRXr15ds38rISsUN2zYUF1Py+t5leoXLVqUBb2e3717d1i5cmV1e6LwtM5VcYjaftWhbOPGjdm6okDXTYJe0zJr164NAICRU4o2XivFifVgHi0zZsyolkIVYhaSorBT2CoYdczWJm2spKuSaryeVZ+rpKsbi7gkrXCNA9b+HT+nkrGtoxKzha7ofOk4FfIAgJFXihJv3MZZVIJVIBaN61WwxWE0HBaeCsm8YT06Pr2m0quNvU0VdfZSaA5F/L7ztq3jpKQLAD5KO3NVSqXLtM3VqLTXquCx0ndR27DtT8GbHo/CX8/pNbXJqr26FSV4BatKylOnTs2qk1V6pjMVAIyOUgSvdRSSvM5SkhdgCsm4mroVFG6idtNmaP9WMlbPapWCFb6qrtZD702BPNypLtVmHLflis6JArlez2wAQGuVInj37dtX/V2dhfKqjfMmybAORyPRwUqB1sx245sGLa+St6rFZ82aVR32o57K1lt5qFNdWluutqnqcIW7zpX1llb49/T0jHobOQCUXSmCV6GhAFNbpgKq2fZaVefa+q1ix2EdpIZCJVA9xMJR1c8KYf1UyXcobdJ6nzZuV6x0bWON1TNavaSZ6xkARk5pZq6y8bsqvTUzE5VC19pYi0Ks3nYstFPxvNCtoO0pKDXm2Hoep2N3h0rvW6VnlYR1w6D3G48DBgC0XmmCV+2jFh7NtK9qPKzYFynErPq3KDzj0E7ZtupNRamSpkqu8UQZWtbmkC5az0J9sFNc2v7S4UsmLvFT2gWAkVWa4FVgWNunQnHFihW5pVKFkL7BKG4zTVl4Wg/jmLZ5+eWX17TNxmwYkcJRVbfpMdgkGlZ1HB+/ZrTS85qAI2XfrBQfn4mDU9vIY9vNC1+9ZkOOaOMFgJFVuq8FtFKjUZBYMCm84rCr11Ep/XpBPRRO2oa1k2o/edvQMlrfwsyqiONe1HlDmFQCth7H2oeO3aaMtGPRc5qEo97xah3rqGXvPZ6K0nozi9axYyrbdxQDwBjU/4bKRfemUCI29ObUU0/NAuXEE08Mp512WvaIgzCe87hoOxa0+mnb0rrr1q3Lnldoabm0jfjll18OTzzxRHV9C1z9W6H4yCOPZMN7UgpEbV/LaliSjlk/9W9b7/777294vBMmTMh+V7u3VR3rnCiE9bptVw8t18z5AAC0xOHSlXhjCqx4HmcbEzuYdkxVGSustI6Ca7BtoLa+aP1mx+EOdT1R9Xa9eai1XRvvPJT3BAAYsv5SBy8AAGNMf2k6VwEAMB4QvAAAOCJ4AQBwRPACAOCI4AUAwBHBCwCAI4IXAABHBC8AAI4IXgAAHBG8AAA4IngBAHBE8AIA4IjgBQDAEcELAIAjghcAAEcELwAAjgheAAAcEbwAADgieAEAcETwAgDgiOAFAMARwQsAgCOCFwAARwQvAACOCF4AABwRvAAAOCJ4AQBwRPACAOCI4AUAwBHBCwCAI4IXAABHBC8AAI4IXgAAHBG8AAA4IngBAHBE8AIA4IjgBQDAEcELAIAjghcAAEcELwAAjgheAAAcEbwAADgieMeRzs7OMHPmzAAAGL8mhJKaOHFimDNnTpgyZUqYNGlS9tyhQ4fCzp07Q29vb+jr6wvjiUJ3xYoVoaOjI3sPPT09AQAw/vx/r2/ogW+RvKYAAAAASUVORK5CYII="},557:function(e,t,a){},558:function(e,t,a){},559:function(e,t,a){},560:function(e,t,a){},561:function(e,t,a){},562:function(e,t,a){},563:function(e,t,a){},61:function(e,t,a){"use strict";var c=Object.assign||function(e){for(var t,a=1;a<arguments.length;a++)for(var c in t=arguments[a])Object.prototype.hasOwnProperty.call(t,c)&&(e[c]=t[c]);return e};Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,a=e.size,r=void 0===a?24:a,n=e.onClick,l=(e.icon,e.className),s=function(e,t){var a={};for(var c in e)0<=t.indexOf(c)||Object.prototype.hasOwnProperty.call(e,c)&&(a[c]=e[c]);return a}(e,["size","onClick","icon","className"]),i=["gridicon","gridicons-notice-outline",l,(t=r,!(0!=t%18)&&"needs-offset"),!1,!1].filter(Boolean).join(" ");return o.default.createElement("svg",c({className:i,height:r,width:r,onClick:n},s,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"}),o.default.createElement("g",null,o.default.createElement("path",{d:"M12 4c4.41 0 8 3.59 8 8s-3.59 8-8 8-8-3.59-8-8 3.59-8 8-8m0-2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2zm1 13h-2v2h2v-2zm-2-2h2l.5-6h-3l.5 6z"})))};var r,n=a(5),o=(r=n)&&r.__esModule?r:{default:r};e.exports=t.default},612:function(e,t,a){"use strict";a.r(t);var c=a(0),r=a(14),n=a(7),o=a(4),l=a(13),s=a(11),i=a(12),m=a(6),A=a.n(m),d=a(1),b=a.n(d),u=a(2),p=a(520),v=a(21),O=a(3),w=a(16),f=(a(549),a(66)),h=a(18),j=a.n(h),E=a(512);a(550);function g(e){Object(w.recordEvent)("activity_panel_orders_"+e,{})}function k(e){if(0===e.length)return Object(c.createElement)(c.Fragment,null,Object(c.createElement)(E.a,{className:"woocommerce-empty-activity-card",title:"",icon:""},Object(c.createElement)("span",{className:"woocommerce-order-empty__success-icon",role:"img","aria-labelledby":"woocommerce-order-empty-message"},"🎉"),Object(c.createElement)(v.H,{id:"woocommerce-order-empty-message"},Object(u.__)("You’ve fulfilled all your orders",'woocommerce'))),Object(c.createElement)(v.Link,{href:"edit.php?post_type=shop_order",onClick:()=>g("orders_manage"),className:"woocommerce-layout__activity-panel-outbound-link woocommerce-layout__activity-panel-empty",type:"wp-admin"},Object(u.__)("Manage all orders",'woocommerce')));const t=e=>{const{first_name:t,last_name:a}=e.customer||{};if(!t&&!a)return"";return`{{customerLink}}${[t,a].join(" ")}{{/customerLink}}`},a=e=>{const{id:a,number:r,customer:n}=e;let o=null;return n&&n.customer_id&&(o=window.wcAdminFeatures.analytics?Object(i.getNewPath)({},"/analytics/customers",{filter:"single_customer",customers:n.customer_id}):Object(l.e)("user-edit.php?user_id="+n.customer_id)),Object(c.createElement)(c.Fragment,null,j()({mixedString:Object(u.sprintf)(Object(u.__)("{{orderLink}}Order #%(orderNumber)s{{/orderLink}} %(customerString)s",'woocommerce'),{orderNumber:r,customerString:t(e)}),components:{orderLink:Object(c.createElement)(v.Link,{href:Object(l.e)("post.php?action=edit&post="+a),onClick:()=>g("order_number"),type:"wp-admin"}),destinationFlag:n&&n.country?Object(c.createElement)(v.Flag,{code:n&&n.country,round:!1}):null,customerLink:o?Object(c.createElement)(v.Link,{href:o,onClick:()=>g("customer_name"),type:"wc-admin"}):Object(c.createElement)("span",null)}}))},r=[];return e.forEach(e=>{const{date_created_gmt:t,products:n,id:o}=e,s=n?n.length:0;r.push(Object(c.createElement)(E.a,{key:o,className:"woocommerce-order-activity-card",title:a(e),date:t,onClick:({target:e})=>{g("orders_begin_fulfillment"),e.href||(window.location.href=Object(l.e)("post.php?action=edit&post="+o))},subtitle:Object(c.createElement)("div",null,Object(c.createElement)("span",null,Object(u.sprintf)(Object(u._n)("%d product","%d products",s,'woocommerce'),s)),Object(c.createElement)("span",null,e.total_formatted))},Object(c.createElement)(v.OrderStatus,{order:e,orderStatusMap:Object(l.f)("orderStatuses",{})})))}),Object(c.createElement)(c.Fragment,null,r,Object(c.createElement)(v.Link,{href:"edit.php?post_type=shop_order",className:"woocommerce-layout__activity-panel-outbound-link",onClick:()=>g("orders_manage"),type:"wp-admin"},Object(u.__)("Manage all orders",'woocommerce')))}function B({countUnreadOrders:e,orderStatuses:t}){const a=Object(c.useMemo)(()=>({page:1,per_page:5,status:t,_fields:["id","number","status","total_formatted","customer","products","customer_id","date_created_gmt"]}),[t]),{orders:r=[],isRequesting:o,isError:i}=Object(n.useSelect)(c=>{const{getItems:r,getItemsError:n,isResolving:o}=c(s.ITEMS_STORE_NAME);if(!t.length&&0===e)return{isRequesting:!1};const l=r("orders",a,null),i=o("getItems",["orders",a]);if(i||null===e||null===l)return{isError:Boolean(n("orders",a)),isRequesting:!0,orderStatuses:t};const m=l?Array.from(l.values()):l;return{orders:m,isError:Boolean(n("orders",m)),isRequesting:i,orderStatuses:t}});if(i){if(!t.length&&window.wcAdminFeatures.analytics)return Object(c.createElement)(v.EmptyContent,{title:Object(u.__)("You currently don't have any actionable statuses. To display orders here, select orders that require further review in settings.",'woocommerce'),actionLabel:Object(u.__)("Settings",'woocommerce'),actionURL:Object(l.e)("admin.php?page=wc-admin&path=/analytics/settings")});const e=Object(u.__)("There was an error getting your orders. Please try again.",'woocommerce'),a=Object(u.__)("Reload",'woocommerce'),r=()=>{window.location.reload()};return Object(c.createElement)(c.Fragment,null,Object(c.createElement)(v.EmptyContent,{title:e,actionLabel:a,actionURL:null,actionCallback:r}))}return Object(c.createElement)(c.Fragment,null,Object(c.createElement)(v.Section,null,o?Object(c.createElement)(E.b,{className:"woocommerce-order-activity-card",hasAction:!0,hasDate:!0,lines:1}):k(r)))}B.propTypes={isError:b.a.bool,isRequesting:b.a.bool,countUnreadOrders:b.a.number,orders:b.a.array.isRequired,orderStatuses:b.a.array},B.defaultProps={orders:[],isError:!1,isRequesting:!1};var S=B,y=a(27),N=a(9),C=a.n(N);class q extends c.Component{constructor(e){super(e),this.state={quantity:e.product.stock_quantity,editing:!1,edited:!1},this.beginEdit=this.beginEdit.bind(this),this.cancelEdit=this.cancelEdit.bind(this),this.onQuantityChange=this.onQuantityChange.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this),this.onSubmit=this.onSubmit.bind(this)}recordStockEvent(e,t={}){Object(w.recordEvent)("activity_panel_stock_"+e,t)}beginEdit(){const{product:e}=this.props;this.setState({editing:!0,quantity:e.stock_quantity},()=>{this.quantityInput&&this.quantityInput.focus()}),this.recordStockEvent("update_stock")}cancelEdit(){const{product:e}=this.props;this.setState({editing:!1,quantity:e.stock_quantity}),this.recordStockEvent("cancel")}handleKeyDown(e){e.keyCode===y.ESCAPE&&this.cancelEdit()}onQuantityChange(e){this.setState({quantity:e.target.value})}async onSubmit(){const{product:e,updateProductStock:t,createNotice:a}=this.props,c=parseInt(this.state.quantity,10);if(e.stock_quantity===c)return void this.setState({editing:!1});this.setState({editing:!1,edited:!0});await t(e,c)?a("success",Object(u.sprintf)(Object(u.__)("%s stock updated",'woocommerce'),e.name),{actions:[{label:Object(u.__)("Undo",'woocommerce'),onClick:()=>{t(e,e.stock_quantity),this.recordStockEvent("undo")}}]}):a("error",Object(u.sprintf)(Object(u.__)("%s stock could not be updated",'woocommerce'),e.name)),this.recordStockEvent("save",{quantity:c})}getActions(){const{editing:e}=this.state;return e?[Object(c.createElement)(O.Button,{key:"save",type:"submit",isPrimary:!0},Object(u.__)("Save",'woocommerce')),Object(c.createElement)(O.Button,{key:"cancel",type:"reset"},Object(u.__)("Cancel",'woocommerce'))]:[Object(c.createElement)(O.Button,{key:"update",isSecondary:!0,onClick:this.beginEdit},Object(u.__)("Update stock",'woocommerce'))]}getBody(){const{product:e}=this.props,{editing:t,quantity:a}=this.state;return t?Object(c.createElement)(c.Fragment,null,Object(c.createElement)(O.BaseControl,{className:"woocommerce-stock-activity-card__edit-quantity"},Object(c.createElement)("input",{className:"components-text-control__input",type:"number",value:a,onKeyDown:this.handleKeyDown,onChange:this.onQuantityChange,ref:e=>{this.quantityInput=e}})),Object(c.createElement)("span",null,Object(u.__)("in stock",'woocommerce'))):Object(c.createElement)("span",{className:A()("woocommerce-stock-activity-card__stock-quantity",{"out-of-stock":e.stock_quantity<1})},Object(u.sprintf)(Object(u.__)("%d in stock",'woocommerce'),e.stock_quantity))}render(){const{product:e}=this.props,{edited:t,editing:a}=this.state,r=Object(l.f)("notifyLowStockAmount",0),n=Number.isFinite(e.low_stock_amount)?e.low_stock_amount:r,s=e.stock_quantity<=n,i=e.last_order_date?Object(u.sprintf)(Object(u.__)("Last ordered %s",'woocommerce'),C.a.utc(e.last_order_date).fromNow()):null;if(!s&&!t)return null;const m=Object(c.createElement)(v.Link,{href:"post.php?action=edit&post="+(e.parent_id||e.id),onClick:()=>this.recordStockEvent("product_name"),type:"wp-admin"},e.name);let d=null;"variation"===e.type&&(d=Object.values(e.attributes).map(e=>e.option).join(", "));const b=Object(o.get)(e,["images",0])||Object(o.get)(e,["image"]),p=A()("woocommerce-stock-activity-card__image-overlay__product",{"is-placeholder":!b||!b.src}),O=Object(c.createElement)("div",{className:"woocommerce-stock-activity-card__image-overlay"},Object(c.createElement)("div",{className:p},Object(c.createElement)(v.ProductImage,{product:e}))),w=A()("woocommerce-stock-activity-card",{"is-dimmed":!a&&!s}),f=Object(c.createElement)(E.a,{className:w,title:m,subtitle:d,icon:O,date:i,actions:this.getActions()},this.getBody());return a?Object(c.createElement)("form",{onReset:this.cancelEdit,onSubmit:this.onSubmit},f):f}}const V={page:1,per_page:5,status:"publish",_fields:["attributes","id","images","last_order_date","low_stock_amount","name","parent_id","stock_quantity","type"]};class z extends c.Component{constructor(e){super(e),this.updateStock=this.updateStock.bind(this)}async updateStock(e,t){const{invalidateResolution:a,updateProductStock:c,products:r}=this.props,n=await c(e,t);return n&&(a("getItems",["products/low-in-stock",V]),r.length<2&&a("getItemsTotalCount",["products",f.b,null])),n}renderProducts(){const{products:e,createNotice:t}=this.props;return e.map(e=>Object(c.createElement)(q,{key:e.id,product:e,updateProductStock:this.updateStock,createNotice:t}))}render(){const{countLowStockProducts:e,isError:t,isRequesting:a,products:r}=this.props;if(t){const e=Object(u.__)("There was an error getting your low stock products. Please try again.",'woocommerce'),t=Object(u.__)("Reload",'woocommerce'),a=()=>{window.location.reload()};return Object(c.createElement)(v.EmptyContent,{title:e,actionLabel:t,actionURL:null,actionCallback:a})}if(a||!r.length){const t=Math.min(5,null!=e?e:1),a=Array.from(new Array(t)).map((e,t)=>Object(c.createElement)(E.b,{key:t,className:"woocommerce-stock-activity-card",hasAction:!0,lines:1}));return Object(c.createElement)(v.Section,null,a)}return Object(c.createElement)(v.Section,null,this.renderProducts())}}z.propTypes={countLowStockProducts:b.a.number,products:b.a.array.isRequired,isError:b.a.bool,isRequesting:b.a.bool},z.defaultProps={products:[],isError:!1,isRequesting:!1};var U=Object(r.compose)(Object(n.withSelect)(e=>{const{getItems:t,getItemsError:a,isResolving:c}=e(s.ITEMS_STORE_NAME);return{products:Array.from(t("products/low-in-stock",V).values()),isError:Boolean(a("products/low-in-stock",V)),isRequesting:c("getItems",["products/low-in-stock",V])}}),Object(n.withDispatch)(e=>{const{invalidateResolution:t,updateProductStock:a}=e(s.ITEMS_STORE_NAME),{createNotice:c}=e("core/notices");return{createNotice:c,invalidateResolution:t,updateProductStock:a}}))(z),M=a(167),Q=a.n(M),X=a(551),T=a.n(X),P=(a(552),()=>Object(c.createElement)("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Object(c.createElement)("mask",{id:"mask0","mask-type":"alpha",maskUnits:"userSpaceOnUse",x:"1",y:"1",width:"14",height:"14"},Object(c.createElement)("path",{d:"M7.99992 1.33301C4.31992 1.33301 1.33325 4.31967 1.33325 7.99967C1.33325 11.6797 4.31992 14.6663 7.99992 14.6663C11.6799 14.6663 14.6666 11.6797 14.6666 7.99967C14.6666 4.31967 11.6799 1.33301 7.99992 1.33301ZM7.99992 13.333C5.05992 13.333 2.66659 10.9397 2.66659 7.99967C2.66659 5.05967 5.05992 2.66634 7.99992 2.66634C10.9399 2.66634 13.3333 5.05967 13.3333 7.99967C13.3333 10.9397 10.9399 13.333 7.99992 13.333ZM6.66658 9.44634L11.0599 5.05301L11.9999 5.99967L6.66658 11.333L3.99992 8.66634L4.93992 7.72634L6.66658 9.44634Z",fill:"white"})),Object(c.createElement)("g",{mask:"url(#mask0)"},Object(c.createElement)("rect",{width:"16",height:"16",fill:"#4AB866"})))),J=a(501),I=a(509),H=a(103);const W={page:1,per_page:H.a,status:"hold",_embed:1};class D extends c.Component{recordReviewEvent(e,t){Object(w.recordEvent)("reviews_"+e,t||{})}deleteReview(e){const{deleteReview:t,createNotice:a,updateReview:c,clearReviewsCache:r}=this.props;e&&t(e).then(()=>{r(),a("success",Object(u.__)("Review successfully deleted.",'woocommerce'),{actions:[{label:Object(u.__)("Undo",'woocommerce'),onClick:()=>{c(e,{status:"untrash"},{_embed:1}).then(()=>r())}}]})}).catch(()=>{a("error",Object(u.__)("Review could not be deleted.",'woocommerce'))})}updateReviewStatus(e,t,a){const{createNotice:c,updateReview:r,clearReviewsCache:n}=this.props;e&&r(e,{status:t}).then(()=>{n(),c("success",Object(u.__)("Review successfully updated.",'woocommerce'),{actions:[{label:Object(u.__)("Undo",'woocommerce'),onClick:()=>{r(e,{status:a},{_embed:1}).then(()=>n())}}]})}).catch(()=>{c("error",Object(u.__)("Review could not be updated.",'woocommerce'))})}renderReview(e){const t=e&&e._embedded&&e._embedded.up&&e._embedded.up[0]||null;if(e.isUpdating)return Object(c.createElement)(E.b,{key:e.id,className:"woocommerce-review-activity-card",hasAction:!0,hasDate:!0,lines:1});if(Object(o.isNull)(t)||e.status!==W.status)return null;const a=j()({mixedString:Object(u.sprintf)(Object(u.__)("{{authorLink}}%s{{/authorLink}}{{verifiedCustomerIcon/}} reviewed {{productLink}}%s{{/productLink}}",'woocommerce'),e.reviewer,t.name),components:{productLink:Object(c.createElement)(v.Link,{href:t.permalink,onClick:()=>this.recordReviewEvent("product"),type:"external"}),authorLink:Object(c.createElement)(v.Link,{href:Object(l.e)("admin.php?page=wc-admin&path=%2Fcustomers&search="+e.reviewer),onClick:()=>this.recordReviewEvent("customer"),type:"external"}),verifiedCustomerIcon:e.verified?Object(c.createElement)("span",{className:"woocommerce-review-activity-card__verified"},Object(c.createElement)(O.Tooltip,{text:Object(u.__)("Verified owner",'woocommerce')},Object(c.createElement)("span",null,Object(c.createElement)(P,null)))):null}}),r=Object(c.createElement)(c.Fragment,null,Object(c.createElement)(v.ReviewRating,{review:e,icon:T.a,outlineIcon:Q.a,size:13})),n=Object(o.get)(t,["images",0])||Object(o.get)(t,["image"]),s=A()("woocommerce-review-activity-card__image-overlay__product",{"is-placeholder":!n||!n.src}),i=Object(c.createElement)("div",{className:"woocommerce-review-activity-card__image-overlay"},Object(c.createElement)("div",{className:s},Object(c.createElement)(v.ProductImage,{product:t,width:33,height:33}))),m={date:e.date_created_gmt,status:e.status},d=[Object(c.createElement)(O.Button,{key:"approve-action",isSecondary:!0,onClick:()=>{this.recordReviewEvent("approve",m),this.updateReviewStatus(e.id,"approved",e.status)}},Object(u.__)("Approve",'woocommerce')),Object(c.createElement)(O.Button,{key:"spam-action",isTertiary:!0,onClick:()=>{this.recordReviewEvent("mark_as_spam",m),this.updateReviewStatus(e.id,"spam",e.status)}},Object(u.__)("Mark as spam",'woocommerce')),Object(c.createElement)(O.Button,{key:"delete-action",isDestructive:!0,isTertiary:!0,onClick:()=>{this.recordReviewEvent("delete",m),this.deleteReview(e.id)}},Object(u.__)("Delete",'woocommerce'))];return Object(c.createElement)(E.a,{className:"woocommerce-review-activity-card",key:e.id,title:a,subtitle:r,date:e.date_created_gmt,icon:i,actions:d},Object(c.createElement)("span",{dangerouslySetInnerHTML:Object(I.a)(e.review)}))}renderReviews(e){const t=e.map(e=>this.renderReview(e,this.props));return 0===t.filter(Boolean).length?Object(c.createElement)(c.Fragment,null):Object(c.createElement)(c.Fragment,null,t,Object(c.createElement)(v.Link,{href:Object(l.e)("edit-comments.php?comment_type=review"),onClick:()=>this.recordReviewEvent("reviews_manage"),className:"woocommerce-layout__activity-panel-outbound-link woocommerce-layout__activity-panel-empty",type:"wp-admin"},Object(u.__)("Manage all reviews",'woocommerce')))}render(){const{isRequesting:e,isError:t,reviews:a}=this.props;if(t){const e=Object(u.__)("There was an error getting your reviews. Please try again.",'woocommerce'),t=Object(u.__)("Reload",'woocommerce'),a=()=>{window.location.reload()};return Object(c.createElement)(c.Fragment,null,Object(c.createElement)(v.EmptyContent,{title:e,actionLabel:t,actionURL:null,actionCallback:a}))}return Object(c.createElement)(c.Fragment,null,Object(c.createElement)(v.Section,null,e||!a.length?Object(c.createElement)(E.b,{className:"woocommerce-review-activity-card",hasAction:!0,hasDate:!0,lines:1}):Object(c.createElement)(c.Fragment,null,this.renderReviews(a))))}}D.propTypes={reviews:b.a.array.isRequired,isError:b.a.bool,isRequesting:b.a.bool},D.defaultProps={reviews:[],isError:!1,isRequesting:!1},D.contextType=J.a;var x=Object(r.compose)([Object(n.withSelect)((e,t)=>{const{hasUnapprovedReviews:a}=t,{getReviews:c,getReviewsError:r,isResolving:n}=e(s.REVIEWS_STORE_NAME);let o=[],l=!1,i=!1;return a&&(o=c(W),l=Boolean(r(W)),i=n("getReviews",[W])),{reviews:o,isError:l,isRequesting:i}}),Object(n.withDispatch)((e,t)=>{const{deleteReview:a,updateReview:c,invalidateResolution:r}=e(s.REVIEWS_STORE_NAME),{createNotice:n}=e("core/notices");return{deleteReview:a,createNotice:n,updateReview:c,clearReviewsCache:()=>{r("getReviews",[W]),t.reviews&&t.reviews.length<2&&r("getReviewsTotalCount",[H.c])}}})])(D);var F=a(517);const L=()=>{const e=Object(n.useSelect)(e=>{const t=Object(l.f)("orderCount",0),a=Object(f.c)(e),c=Object(l.f)("reviewsEnabled","no"),r=Object(f.d)(e,a),n=Object(l.f)("manageStock","no"),o=Object(f.a)(e),i=Object(H.b)(e),m=Object(l.f)("publishedProductCount",0),{getOption:A}=e(s.OPTIONS_STORE_NAME);return{countLowStockProducts:o,countUnapprovedReviews:i,countUnreadOrders:r,isTaskListHidden:A("woocommerce_task_list_hidden"),manageStock:n,publishedProductCount:m,reviewsEnabled:c,totalOrderCount:t,orderStatuses:a}}),t=function({countLowStockProducts:e,countUnapprovedReviews:t,countUnreadOrders:a,isTaskListHidden:r,manageStock:n,orderStatuses:o,publishedProductCount:l,reviewsEnabled:s,totalOrderCount:i}){return"yes"!==r?[]:[i>0&&{className:"woocommerce-homescreen-card",count:a,collapsible:!0,id:"orders-panel",initialOpen:!1,panel:Object(c.createElement)(S,{countUnreadOrders:a,orderStatuses:o}),title:Object(u.__)("Orders",'woocommerce')},i>0&&l>0&&"yes"===n&&{className:"woocommerce-homescreen-card",count:e,id:"stock-panel",initialOpen:!1,collapsible:0!==e,panel:Object(c.createElement)(U,{countLowStockProducts:e}),title:Object(u.__)("Stock",'woocommerce')},l>0&&"yes"===s&&{className:"woocommerce-homescreen-card",id:"reviews-panel",count:t,initialOpen:!1,collapsible:0!==t,panel:Object(c.createElement)(x,{hasUnapprovedReviews:t>0}),title:Object(u.__)("Reviews",'woocommerce')}].filter(Boolean)}(e);if(Object(c.useEffect)(()=>{if(void 0!==e.isTaskListHidden){const a=t.reduce((e,t)=>(e[Object(o.snakeCase)(t.id)]=!0,e),{task_list:"yes"!==e.isTaskListHidden});Object(w.recordEvent)("activity_panel_visible_panels",a)}},[e.isTaskListHidden]),0===t.length)return null;const a=e=>{const{opened_panel:t}=Object(F.b)(window.location.search);return e===t};return Object(c.createElement)(O.Panel,{className:"woocommerce-activity-panel"},t.map(e=>{const{className:t,count:r,id:n,initialOpen:o,panel:l,title:s,collapsible:i}=e;return i?Object(c.createElement)(O.PanelBody,{title:[Object(c.createElement)(O.__experimentalText,{key:s,variant:"title.small",size:"20",lineHeight:"28px"},s),null!==r&&Object(c.createElement)(v.Badge,{key:s+"-badge",count:r})],key:n,className:t,initialOpen:a(n)||o,collapsible:i,disabled:!i,onToggle:e=>{e&&Object(w.recordEvent)("activity_panel_open",{tab:n})}},Object(c.createElement)(O.PanelRow,null,l)):Object(c.createElement)("div",{className:"components-panel__body",key:n},Object(c.createElement)("h2",{className:"components-panel__body-title"},Object(c.createElement)(O.Button,{className:"components-panel__body-toggle","aria-expanded":!1,disabled:!0},Object(c.createElement)(O.__experimentalText,{variant:"title.small",size:"20",lineHeight:"28px"},s),null!==r&&Object(c.createElement)(v.Badge,{count:r}))))}))},R=({children:e,shouldStick:t=!1})=>{const[a,r]=Object(c.useState)(!1),n=Object(c.useRef)(null),o=Object(c.useRef)(null),l=Object(c.useCallback)(()=>{if(!n.current)return;const{bottom:e,top:t}=n.current.getBoundingClientRect();null===o.current&&(o.current=t);const a=e<window.innerHeight;t===o.current&&r(a)},[]);return Object(c.useLayoutEffect)(()=>{if(t)return l(),window.addEventListener("resize",l),window.addEventListener("scroll",l),()=>{window.removeEventListener("resize",l),window.removeEventListener("scroll",l)}},[l,t]),Object(c.createElement)("div",{className:"woocommerce-homescreen-column",ref:n,style:{position:t&&a?"sticky":"static"}},e)};var _=a(523),G=a(20),K=(a(553),a(554)),Z=a.n(K),Y=a(555),$=a.n(Y),ee=a(556),te=a.n(ee);const ae=()=>{const[e,t]=Object(c.useState)(!0),{updateOptions:a}=Object(n.useDispatch)(s.OPTIONS_STORE_NAME),{isDismissed:r,isResolving:o,isWelcomeModalShown:l}=Object(n.useSelect)(e=>{const{getOption:t,isResolving:a}=e(s.OPTIONS_STORE_NAME),c=t("woocommerce_navigation_intro_modal_dismissed");return{isDismissed:"yes"===c,isWelcomeModalShown:"yes"!==t("woocommerce_task_list_welcome_modal_dismissed"),isResolving:void 0===c||a("getOption",["woocommerce_navigation_intro_modal_dismissed"])||a("getOption",["woocommerce_task_list_welcome_modal_dismissed"])}}),i=()=>{a({woocommerce_navigation_intro_modal_dismissed:"yes"}),Object(w.recordEvent)("navigation_intro_modal_close",{}),t(!1)};if(Object(c.useEffect)(()=>{o||!l||r||i()},[r,o,l]),!e||r||o||l)return null;const m=(e,t,a)=>({content:Object(c.createElement)("div",{className:"woocommerce-navigation-intro-modal__page-wrapper"},Object(c.createElement)("div",{className:"woocommerce-navigation-intro-modal__page-text"},Object(c.createElement)(G.Text,{variant:"title.large",as:"h2",size:"32",lineHeight:"40px"},e),Object(c.createElement)(G.Text,{as:"p",variant:"body.large",size:"16",lineHeight:"24px"},t)),Object(c.createElement)("div",{className:"woocommerce-navigation-intro-modal__image-wrapper"},Object(c.createElement)("img",{alt:e,src:a})))});return Object(c.createElement)(O.Guide,{className:"woocommerce-navigation-intro-modal",onFinish:i,pages:[m(Object(u.__)("A new navigation for WooCommerce",'woocommerce'),Object(u.__)("All of your store management features in one place",'woocommerce'),Z.a),m(Object(u.__)("Focus on managing your store",'woocommerce'),Object(u.__)("Give your attention to key areas of WooCommerce with little distraction",'woocommerce'),$.a),m(Object(u.__)("Easily find and favorite your extensions",'woocommerce'),Object(u.__)("They'll appear in the top level of the navigation for quick access",'woocommerce'),te.a)]})};var ce=a(122),re=(a(557),a(30));const ne=Object(re.applyFilters)("woocommerce_admin_homepage_default_stats",["revenue/total_sales","revenue/net_revenue","orders/orders_count","products/items_sold","jetpack/stats/visitors","jetpack/stats/views"]),oe=["revenue/net_revenue","products/items_sold"];var le=a(525);var se=Object(n.withSelect)((e,{stats:t,query:a})=>{if(0!==t.length)return Object(le.a)(e,t,a)})(({stats:e,primaryData:t,secondaryData:a,primaryRequesting:r,secondaryRequesting:n,primaryError:o,secondaryError:l,query:s})=>{const{formatAmount:m,getCurrencyConfig:d}=Object(c.useContext)(J.a);if(o||l)return null;const b=Object(i.getPersistedQuery)(s),p=d();return Object(c.createElement)("ul",{className:A()("woocommerce-stats-overview__stats",{"is-even":e.length%2==0})},e.map(e=>{if(r||n)return Object(c.createElement)(v.SummaryNumberPlaceholder,{key:e.stat});const{primaryValue:o,secondaryValue:l,delta:s,reportUrl:i,reportUrlType:A}=Object(le.b)({indicator:e,primaryData:t,secondaryData:a,currency:p,formatAmount:m,persistedQuery:b});return Object(c.createElement)(v.SummaryNumber,{isHomescreen:!0,key:e.stat,href:i,hrefType:A,label:e.label,value:o,prevLabel:Object(u.__)("Previous period:",'woocommerce'),prevValue:l,delta:s,onLinkClickCallback:()=>{Object(w.recordEvent)("statsoverview_indicators_click",{key:e.stat})}})}))}),ie=a(10);Object(u.__)("Facebook for WooCommerce",'woocommerce'),Object(u.__)("Jetpack",'woocommerce'),Object(u.__)("Klarna Checkout for WooCommerce",'woocommerce'),Object(u.__)("Klarna Payments for WooCommerce",'woocommerce'),Object(u.__)("Mailchimp for WooCommerce",'woocommerce'),Object(u.__)("Creative Mail for WooCommerce",'woocommerce'),Object(u.__)("WooCommerce PayPal",'woocommerce'),Object(u.__)("WooCommerce Stripe",'woocommerce'),Object(u.__)("WooCommerce PayFast",'woocommerce'),Object(u.__)("WooCommerce Payments",'woocommerce'),Object(u.__)("WooCommerce Shipping & Tax",'woocommerce'),Object(u.__)("WooCommerce Shipping & Tax",'woocommerce'),Object(u.__)("WooCommerce Shipping & Tax",'woocommerce'),Object(u.__)("WooCommerce ShipStation Gateway",'woocommerce'),Object(u.__)("Mercado Pago payments for WooCommerce",'woocommerce'),Object(u.__)("Google Listings and Ads",'woocommerce'),Object(u.__)("Razorpay",'woocommerce'),Object(u.__)("MailPoet",'woocommerce');let me;!function(e){e.UPDATE_ACTIVE_PLUGINS="UPDATE_ACTIVE_PLUGINS",e.UPDATE_INSTALLED_PLUGINS="UPDATE_INSTALLED_PLUGINS",e.SET_IS_REQUESTING="SET_IS_REQUESTING",e.SET_ERROR="SET_ERROR",e.UPDATE_JETPACK_CONNECTION="UPDATE_JETPACK_CONNECTION",e.UPDATE_JETPACK_CONNECT_URL="UPDATE_JETPACK_CONNECT_URL",e.SET_PAYPAL_ONBOARDING_STATUS="SET_PAYPAL_ONBOARDING_STATUS",e.SET_RECOMMENDED_PLUGINS="SET_RECOMMENDED_PLUGINS"}(me||(me={}));const Ae=n.controls&&n.controls.dispatch?n.controls.dispatch:ie.dispatch;n.controls&&n.controls.resolveSelect?n.controls.resolveSelect:ie.select;const de=e=>Ae("core/notices","createNotice","error",e);const be=({onClickInstall:e,onClickDismiss:t,isBusy:a,jetpackInstallState:r})=>Object(c.createElement)("article",{className:"woocommerce-stats-overview__install-jetpack-promo"},Object(c.createElement)("div",{className:"woocommerce-stats-overview__install-jetpack-promo__content"},Object(c.createElement)(v.H,null,Object(u.__)("Get traffic stats with Jetpack",'woocommerce')),Object(c.createElement)("p",null,Object(u.__)("Keep an eye on your views and visitors metrics with Jetpack. Requires Jetpack plugin and a WordPress.com account.",'woocommerce'))),Object(c.createElement)("footer",null,Object(c.createElement)(O.Button,{isSecondary:!0,onClick:()=>{Object(w.recordEvent)("statsoverview_install_jetpack"),e()},disabled:a,isBusy:a},(e=>({unavailable:Object(u.__)("Get Jetpack",'woocommerce'),installed:Object(u.__)("Activate Jetpack",'woocommerce'),activated:Object(u.__)("Connect Jetpack",'woocommerce')}[e]||""))(r)),Object(c.createElement)(O.Button,{isTertiary:!0,onClick:()=>{Object(w.recordEvent)("statsoverview_dismiss_install_jetpack"),t()},disabled:a,isBusy:a},Object(u.__)("No thanks",'woocommerce')))),ue=()=>{const{currentUserCan:e}=Object(s.useUser)(),{updateUserPreferences:t,...a}=Object(s.useUserPreferences)(),{canUserInstallPlugins:r,jetpackInstallState:o,isBusy:i}=Object(n.useSelect)(t=>{const{getPluginInstallState:a,isPluginsRequesting:c}=t(s.PLUGINS_STORE_NAME),r=a("jetpack");return{isBusy:c("getJetpackConnectUrl")||c("installPlugins")||c("activatePlugins"),jetpackInstallState:r,canUserInstallPlugins:e("install_plugins")}}),{installJetpackAndConnect:m}=Object(n.useDispatch)(s.PLUGINS_STORE_NAME);if(!r)return null;return Object(c.createElement)(be,{jetpackInstallState:o,isBusy:i,onClickInstall:()=>{m(de,l.e)},onClickDismiss:()=>{const e=a.homepage_stats||{};e.installJetpackDismissed=!0,t({homepage_stats:e})}})},{performanceIndicators:pe=[]}=Object(l.f)("dataEndpoints",{performanceIndicators:[]}),ve=pe.filter(e=>ne.includes(e.stat));var Oe=()=>{const{updateUserPreferences:e,...t}=Object(s.useUserPreferences)(),a=Object(o.get)(t,["homepage_stats","hiddenStats"],oe),r=Object(n.useSelect)(e=>e(s.PLUGINS_STORE_NAME).isJetpackConnected(),[]),l=(t.homepage_stats||{}).installJetpackDismissed,m=ve.filter(e=>!a.includes(e.stat)),A=Object(c.createElement)(G.Text,{variant:"title.small",size:"20",lineHeight:"28px"},Object(u.__)("Stats overview",'woocommerce'));return Object(c.createElement)(O.Card,{size:"large",className:"woocommerce-stats-overview woocommerce-homescreen-card"},Object(c.createElement)(O.CardHeader,{size:"medium"},Object(c.createElement)(ce.Experiment,{name:"woocommerce_test_experiment",defaultExperience:A,treatmentExperience:A,loadingExperience:A}),Object(c.createElement)(v.EllipsisMenu,{label:Object(u.__)("Choose which values to display",'woocommerce'),renderContent:()=>Object(c.createElement)(c.Fragment,null,Object(c.createElement)(v.MenuTitle,null,Object(u.__)("Display stats:",'woocommerce')),ve.map(t=>{const r=!a.includes(t.stat);return Object(c.createElement)(v.MenuItem,{checked:r,isCheckbox:!0,isClickable:!0,key:t.stat,onInvoke:()=>(t=>{const c=Object(o.xor)(a,[t]);e({homepage_stats:{hiddenStats:c}}),Object(w.recordEvent)("statsoverview_indicators_toggle",{indicator_name:t,status:c.includes(t)?"off":"on"})})(t.stat)},t.label)}))})),Object(c.createElement)(O.TabPanel,{className:"woocommerce-stats-overview__tabs",onSelect:e=>{Object(w.recordEvent)("statsoverview_date_picker_update",{period:e})},tabs:[{title:Object(u.__)("Today",'woocommerce'),name:"today"},{title:Object(u.__)("Week to date",'woocommerce'),name:"week"},{title:Object(u.__)("Month to date",'woocommerce'),name:"month"}]},e=>Object(c.createElement)(c.Fragment,null,!r&&!l&&Object(c.createElement)(ue,null),Object(c.createElement)(se,{query:{period:e.name,compare:"previous_period"},stats:m}))),Object(c.createElement)(O.CardFooter,null,Object(c.createElement)(v.Link,{className:"woocommerce-stats-overview__more-btn",href:Object(i.getNewPath)({},"/analytics/overview"),type:"wc-admin",onClick:()=>{Object(w.recordEvent)("statsoverview_indicators_click",{key:"view_detailed_stats"})}},Object(u.__)("View detailed stats",'woocommerce'))))},we=a(543),fe=a(540);const he=()=>Object(c.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"517",height:"160",fill:"none"},Object(c.createElement)("defs",null),Object(c.createElement)("g",{clipPath:"url(#clip0)"},Object(c.createElement)("path",{className:"fill-theme-color",d:"M0 0h517v160H0z"}),Object(c.createElement)("path",{fill:"#fff",fillOpacity:".65",d:"M125.85 217.924l-1.055-.321c-34.868-10.598-101.138-36.619-95.91-101.998 7.156-89.462 89.192-28.933 194.231-87.715 161.485-90.37 242.851-42.249 253.957 78.717 10.842 118.101-82.942 115.494-138.938 123.306-118.486 16.529-165.516 2.231-212.285-11.989z"}),Object(c.createElement)("path",{fill:"#F6F7F7",d:"M125 33h267v185H125z"}),Object(c.createElement)("path",{fill:"#CCC",d:"M327.367 93.974a6.417 6.417 0 00-6.285 7.671 6.418 6.418 0 005.035 5.044 6.405 6.405 0 006.579-2.73 6.427 6.427 0 00-.797-8.105 6.404 6.404 0 00-4.532-1.88zm0 11.615a5.18 5.18 0 01-3.668-1.522 5.2 5.2 0 01-1.23-5.38 5.196 5.196 0 014.168-3.447 5.18 5.18 0 014.967 2.137 5.201 5.201 0 01-1.546 7.453 5.186 5.186 0 01-2.706.75l.015.009z"}),Object(c.createElement)("path",{fill:"#CCC",d:"M329.332 103.181l.806-.811a.354.354 0 00.078-.391.365.365 0 00-.078-.116l-1.456-1.461 1.456-1.458a.363.363 0 00.105-.254.36.36 0 00-.105-.254l-.806-.81a.354.354 0 00-.254-.106.356.356 0 00-.255.106l-1.456 1.458-1.456-1.458a.35.35 0 00-.253-.105.355.355 0 00-.253.105l-.809.826a.362.362 0 00-.078.39.363.363 0 00.078.117l1.456 1.458-1.456 1.461a.369.369 0 00-.105.254.356.356 0 00.105.254l.809.81a.354.354 0 00.39.078.354.354 0 00.116-.078l1.456-1.461 1.456 1.461a.366.366 0 00.509-.015zM314.559 145.63a6.413 6.413 0 00-2.722-4.13 6.429 6.429 0 00-4.883-.957l-.192.046c-.346.08-.684.191-1.01.33a6.437 6.437 0 00-3.892 5.926 6.433 6.433 0 003.907 5.916l.183.074a6.402 6.402 0 007.999-2.997 6.423 6.423 0 00.735-3.001 6.196 6.196 0 00-.125-1.207zm-1.184 1.978a.028.028 0 010 .018v.058a5.213 5.213 0 01-.913 2.181 5.191 5.191 0 01-4.068 2.146 5.162 5.162 0 01-3.445-1.2 5.2 5.2 0 01.693-8.443 4.936 4.936 0 011.026-.464l.192-.058a5.176 5.176 0 014.527.859 5.201 5.201 0 012.058 4.129 4.906 4.906 0 01-.07.774z"}),Object(c.createElement)("path",{fill:"#CCC",d:"M310.223 149.613l.808-.81a.349.349 0 00.078-.116.348.348 0 000-.275.353.353 0 00-.078-.117l-1.455-1.458 1.455-1.458a.36.36 0 00.079-.393.36.36 0 00-.079-.117l-.808-.807a.362.362 0 00-.391-.078.349.349 0 00-.116.078l-1.455 1.464-1.465-1.464a.366.366 0 00-.254-.106.36.36 0 00-.253.106l-.809.807a.358.358 0 00-.078.393.358.358 0 00.078.117l1.459 1.458-1.459 1.458a.356.356 0 00-.078.392.382.382 0 00.078.116l.809.81a.365.365 0 00.253.106.366.366 0 00.254-.106l1.458-1.458 1.456 1.458a.353.353 0 00.513 0zM295.605 51.781l-.583-.587a.297.297 0 00-.219-.093.31.31 0 00-.22.093l-3.662 3.635-1.547-1.562a.308.308 0 00-.437 0l-.589.584a.313.313 0 00-.093.22.307.307 0 00.093.22l2.35 2.372a.31.31 0 00.339.07.297.297 0 00.1-.07l4.465-4.439a.316.316 0 00.097-.22.313.313 0 00-.094-.223zm0 0l-.583-.587a.297.297 0 00-.219-.093.31.31 0 00-.22.093l-3.662 3.635-1.547-1.562a.308.308 0 00-.437 0l-.589.584a.313.313 0 00-.093.22.307.307 0 00.093.22l2.35 2.372a.31.31 0 00.339.07.297.297 0 00.1-.07l4.465-4.439a.316.316 0 00.097-.22.313.313 0 00-.094-.223zm0 0l-.583-.587a.297.297 0 00-.219-.093.31.31 0 00-.22.093l-3.662 3.635-1.547-1.562a.308.308 0 00-.437 0l-.589.584a.313.313 0 00-.093.22.307.307 0 00.093.22l2.35 2.372a.31.31 0 00.339.07.297.297 0 00.1-.07l4.465-4.439a.316.316 0 00.097-.22.313.313 0 00-.094-.223zm0 0l-.583-.587a.297.297 0 00-.219-.093.31.31 0 00-.22.093l-3.662 3.635-1.547-1.562a.308.308 0 00-.437 0l-.589.584a.313.313 0 00-.093.22.307.307 0 00.093.22l2.35 2.372a.31.31 0 00.339.07.297.297 0 00.1-.07l4.465-4.439a.316.316 0 00.097-.22.313.313 0 00-.094-.223zm-3.628-4.619a6.402 6.402 0 00-5.921 3.963 6.432 6.432 0 001.389 6.996 6.404 6.404 0 009.86-.973 6.428 6.428 0 00-.797-8.106 6.403 6.403 0 00-4.531-1.88zm0 11.616a5.186 5.186 0 01-4.793-3.208 5.2 5.2 0 011.124-5.663 5.186 5.186 0 015.654-1.126 5.204 5.204 0 011.685 8.476 5.17 5.17 0 01-3.67 1.515v.006zm3.628-6.99l-.583-.588a.298.298 0 00-.219-.093.31.31 0 00-.22.093l-3.662 3.635-1.547-1.562a.308.308 0 00-.437 0l-.589.584a.313.313 0 00-.093.22.307.307 0 00.093.22l2.35 2.372c.029.03.063.053.1.07a.31.31 0 00.239 0 .297.297 0 00.1-.07l4.465-4.438a.304.304 0 00.075-.347.31.31 0 00-.072-.103v.006zm0 0l-.583-.588a.298.298 0 00-.219-.093.31.31 0 00-.22.093l-3.662 3.635-1.547-1.562a.308.308 0 00-.437 0l-.589.584a.313.313 0 00-.093.22.307.307 0 00.093.22l2.35 2.372c.029.03.063.053.1.07a.31.31 0 00.239 0 .297.297 0 00.1-.07l4.465-4.438a.304.304 0 00.075-.347.31.31 0 00-.072-.103v.006zm0 0l-.583-.588a.298.298 0 00-.219-.093.31.31 0 00-.22.093l-3.662 3.635-1.547-1.562a.308.308 0 00-.437 0l-.589.584a.313.313 0 00-.093.22.307.307 0 00.093.22l2.35 2.372c.029.03.063.053.1.07a.31.31 0 00.239 0 .297.297 0 00.1-.07l4.465-4.438a.304.304 0 00.075-.347.31.31 0 00-.072-.103v.006zm0 0l-.583-.588a.298.298 0 00-.219-.093.31.31 0 00-.22.093l-3.662 3.635-1.547-1.562a.308.308 0 00-.437 0l-.589.584a.313.313 0 00-.093.22.307.307 0 00.093.22l2.35 2.372c.029.03.063.053.1.07a.31.31 0 00.239 0 .297.297 0 00.1-.07l4.465-4.438a.304.304 0 00.075-.347.31.31 0 00-.072-.103v.006zm0 0l-.583-.588a.298.298 0 00-.219-.093.31.31 0 00-.22.093l-3.662 3.635-1.547-1.562a.308.308 0 00-.437 0l-.589.584a.313.313 0 00-.093.22.307.307 0 00.093.22l2.35 2.372c.029.03.063.053.1.07a.31.31 0 00.239 0 .297.297 0 00.1-.07l4.465-4.438a.304.304 0 00.075-.347.31.31 0 00-.072-.103v.006zM306.96 98.595l-.582-.59a.311.311 0 00-.22-.093.308.308 0 00-.22.093l-3.662 3.635-1.547-1.562a.31.31 0 00-.22-.094.303.303 0 00-.22.094l-.589.584a.31.31 0 000 .44l2.347 2.372c.029.03.063.053.101.069a.302.302 0 00.339-.069l4.467-4.438a.312.312 0 00.097-.22.308.308 0 00-.091-.22zm0 0l-.582-.59a.311.311 0 00-.22-.093.308.308 0 00-.22.093l-3.662 3.635-1.547-1.562a.31.31 0 00-.22-.094.303.303 0 00-.22.094l-.589.584a.31.31 0 000 .44l2.347 2.372c.029.03.063.053.101.069a.302.302 0 00.339-.069l4.467-4.438a.312.312 0 00.097-.22.308.308 0 00-.091-.22zm0 0l-.582-.59a.311.311 0 00-.22-.093.308.308 0 00-.22.093l-3.662 3.635-1.547-1.562a.31.31 0 00-.22-.094.303.303 0 00-.22.094l-.589.584a.31.31 0 000 .44l2.347 2.372c.029.03.063.053.101.069a.302.302 0 00.339-.069l4.467-4.438a.312.312 0 00.097-.22.308.308 0 00-.091-.22zm0 0l-.582-.59a.311.311 0 00-.22-.093.308.308 0 00-.22.093l-3.662 3.635-1.547-1.562a.31.31 0 00-.22-.094.303.303 0 00-.22.094l-.589.584a.31.31 0 000 .44l2.347 2.372c.029.03.063.053.101.069a.302.302 0 00.339-.069l4.467-4.438a.312.312 0 00.097-.22.308.308 0 00-.091-.22zm-3.628-4.621a6.417 6.417 0 00-6.285 7.671 6.412 6.412 0 005.035 5.044 6.401 6.401 0 006.578-2.73 6.42 6.42 0 00-.797-8.105 6.4 6.4 0 00-4.531-1.88zm0 11.615a5.18 5.18 0 01-4.793-3.208 5.201 5.201 0 013.781-7.085 5.179 5.179 0 015.326 2.21c.57.854.874 1.86.874 2.887a5.202 5.202 0 01-1.516 3.677 5.178 5.178 0 01-3.672 1.516v.003zm3.628-6.99l-.582-.59a.31.31 0 00-.22-.094.308.308 0 00-.22.093l-3.662 3.635-1.547-1.562a.31.31 0 00-.22-.094.302.302 0 00-.22.094l-.589.584a.31.31 0 000 .44l2.347 2.372c.029.03.063.053.101.069a.302.302 0 00.339-.069l4.467-4.438a.3.3 0 00.098-.22.304.304 0 00-.092-.223v.002zm0 0l-.582-.59a.31.31 0 00-.22-.094.308.308 0 00-.22.093l-3.662 3.635-1.547-1.562a.31.31 0 00-.22-.094.302.302 0 00-.22.094l-.589.584a.31.31 0 000 .44l2.347 2.372c.029.03.063.053.101.069a.302.302 0 00.339-.069l4.467-4.438a.3.3 0 00.098-.22.304.304 0 00-.092-.223v.002zm0 0l-.582-.59a.31.31 0 00-.22-.094.308.308 0 00-.22.093l-3.662 3.635-1.547-1.562a.31.31 0 00-.22-.094.302.302 0 00-.22.094l-.589.584a.31.31 0 000 .44l2.347 2.372c.029.03.063.053.101.069a.302.302 0 00.339-.069l4.467-4.438a.3.3 0 00.098-.22.304.304 0 00-.092-.223v.002zm0 0l-.582-.59a.31.31 0 00-.22-.094.308.308 0 00-.22.093l-3.662 3.635-1.547-1.562a.31.31 0 00-.22-.094.302.302 0 00-.22.094l-.589.584a.31.31 0 000 .44l2.347 2.372c.029.03.063.053.101.069a.302.302 0 00.339-.069l4.467-4.438a.3.3 0 00.098-.22.304.304 0 00-.092-.223v.002zm0 0l-.582-.59a.31.31 0 00-.22-.094.308.308 0 00-.22.093l-3.662 3.635-1.547-1.562a.31.31 0 00-.22-.094.302.302 0 00-.22.094l-.589.584a.31.31 0 000 .44l2.347 2.372c.029.03.063.053.101.069a.302.302 0 00.339-.069l4.467-4.438a.3.3 0 00.098-.22.304.304 0 00-.092-.223v.002zM287.774 145.407l-.582-.59a.303.303 0 00-.101-.069.302.302 0 00-.339.069l-3.662 3.634-1.547-1.562a.31.31 0 00-.439 0l-.589.584a.301.301 0 00-.07.34c.017.038.04.072.07.1l2.346 2.372a.301.301 0 00.339.07.321.321 0 00.101-.07l4.467-4.438a.309.309 0 00.097-.219.309.309 0 00-.091-.221zm0 0l-.582-.59a.303.303 0 00-.101-.069.302.302 0 00-.339.069l-3.662 3.634-1.547-1.562a.31.31 0 00-.439 0l-.589.584a.301.301 0 00-.07.34c.017.038.04.072.07.1l2.346 2.372a.301.301 0 00.339.07.321.321 0 00.101-.07l4.467-4.438a.309.309 0 00.097-.219.309.309 0 00-.091-.221zm0 0l-.582-.59a.303.303 0 00-.101-.069.302.302 0 00-.339.069l-3.662 3.634-1.547-1.562a.31.31 0 00-.439 0l-.589.584a.301.301 0 00-.07.34c.017.038.04.072.07.1l2.346 2.372a.301.301 0 00.339.07.321.321 0 00.101-.07l4.467-4.438a.309.309 0 00.097-.219.309.309 0 00-.091-.221zm0 0l-.582-.59a.303.303 0 00-.101-.069.302.302 0 00-.339.069l-3.662 3.634-1.547-1.562a.31.31 0 00-.439 0l-.589.584a.301.301 0 00-.07.34c.017.038.04.072.07.1l2.346 2.372a.301.301 0 00.339.07.321.321 0 00.101-.07l4.467-4.438a.309.309 0 00.097-.219.309.309 0 00-.091-.221zm-3.628-4.622a6.416 6.416 0 00-6.285 7.671 6.414 6.414 0 005.035 5.044 6.393 6.393 0 003.702-.365 6.418 6.418 0 003.957-5.931 6.43 6.43 0 00-1.877-4.539 6.403 6.403 0 00-4.532-1.88zm0 11.616a5.181 5.181 0 01-2.882-.876 5.2 5.2 0 011.87-9.418 5.186 5.186 0 015.326 2.21c.57.855.874 1.859.874 2.887a5.191 5.191 0 01-1.515 3.678 5.163 5.163 0 01-3.673 1.516v.003zm3.628-6.991l-.582-.59a.303.303 0 00-.101-.069.302.302 0 00-.339.069l-3.662 3.634-1.547-1.562a.31.31 0 00-.439 0l-.589.584a.301.301 0 00-.07.34c.017.038.04.072.07.1l2.346 2.372a.301.301 0 00.339.07.321.321 0 00.101-.07l4.467-4.438a.297.297 0 00.098-.22.293.293 0 00-.023-.121.284.284 0 00-.069-.102v.003zm0 0l-.582-.59a.303.303 0 00-.101-.069.302.302 0 00-.339.069l-3.662 3.634-1.547-1.562a.31.31 0 00-.439 0l-.589.584a.301.301 0 00-.07.34c.017.038.04.072.07.1l2.346 2.372a.301.301 0 00.339.07.321.321 0 00.101-.07l4.467-4.438a.297.297 0 00.098-.22.293.293 0 00-.023-.121.284.284 0 00-.069-.102v.003zm0 0l-.582-.59a.303.303 0 00-.101-.069.302.302 0 00-.339.069l-3.662 3.634-1.547-1.562a.31.31 0 00-.439 0l-.589.584a.301.301 0 00-.07.34c.017.038.04.072.07.1l2.346 2.372a.301.301 0 00.339.07.321.321 0 00.101-.07l4.467-4.438a.297.297 0 00.098-.22.293.293 0 00-.023-.121.284.284 0 00-.069-.102v.003zm0 0l-.582-.59a.303.303 0 00-.101-.069.302.302 0 00-.339.069l-3.662 3.634-1.547-1.562a.31.31 0 00-.439 0l-.589.584a.301.301 0 00-.07.34c.017.038.04.072.07.1l2.346 2.372a.301.301 0 00.339.07.321.321 0 00.101-.07l4.467-4.438a.297.297 0 00.098-.22.293.293 0 00-.023-.121.284.284 0 00-.069-.102v.003zm0 0l-.582-.59a.303.303 0 00-.101-.069.302.302 0 00-.339.069l-3.662 3.634-1.547-1.562a.31.31 0 00-.439 0l-.589.584a.301.301 0 00-.07.34c.017.038.04.072.07.1l2.346 2.372a.301.301 0 00.339.07.321.321 0 00.101-.07l4.467-4.438a.297.297 0 00.098-.22.293.293 0 00-.023-.121.284.284 0 00-.069-.102v.003zM349.568 75.187l-.583-.578a.298.298 0 00-.219-.093.306.306 0 00-.22.093l-1.904 1.895-.687.682-.058.055-.357.358-.638.632-1.547-1.562a.308.308 0 00-.44 0l-.589.584a.312.312 0 00-.093.22.307.307 0 00.093.22l2.216 2.241.131.132a.304.304 0 00.44.003l1.849-1.835.61-.61 2.002-1.99a.306.306 0 00-.006-.447zm0 0l-.583-.578a.298.298 0 00-.219-.093.306.306 0 00-.22.093l-1.904 1.895-.687.682-.058.055-.357.358-.638.632-1.547-1.562a.308.308 0 00-.44 0l-.589.584a.312.312 0 00-.093.22.307.307 0 00.093.22l2.216 2.241.131.132a.304.304 0 00.44.003l1.849-1.835.61-.61 2.002-1.99a.306.306 0 00-.006-.447zm0 0l-.583-.578a.298.298 0 00-.219-.093.306.306 0 00-.22.093l-1.904 1.895-.687.682-.058.055-.357.358-.638.632-1.547-1.562a.308.308 0 00-.44 0l-.589.584a.312.312 0 00-.093.22.307.307 0 00.093.22l2.216 2.241.131.132a.304.304 0 00.44.003l1.849-1.835.61-.61 2.002-1.99a.306.306 0 00-.006-.447zm0 0l-.583-.578a.298.298 0 00-.219-.093.306.306 0 00-.22.093l-1.904 1.895-.687.682-.058.055-.357.358-.638.632-1.547-1.562a.308.308 0 00-.44 0l-.589.584a.312.312 0 00-.093.22.307.307 0 00.093.22l2.216 2.241.131.132a.304.304 0 00.44.003l1.849-1.835.61-.61 2.002-1.99a.306.306 0 00-.006-.447zm-3.628-4.619a6.402 6.402 0 00-4.17 1.5 6.422 6.422 0 00-1.386 8.21 6.415 6.415 0 003.447 2.79 6.4 6.4 0 004.477-.092c.317-.126.624-.278.915-.456a6.418 6.418 0 002.93-7.236 6.422 6.422 0 00-2.309-3.413 6.4 6.4 0 00-3.904-1.303zm2.273 11.087a5.056 5.056 0 01-.665.272 5.213 5.213 0 01-3.406-.067 5.197 5.197 0 01-1.681-8.731 5.182 5.182 0 018.501 2.56 5.195 5.195 0 01-2.749 5.966zm1.355-6.468l-.583-.578a.298.298 0 00-.219-.093.306.306 0 00-.22.093l-1.904 1.895-.687.682-.058.055-.357.358-.638.632-1.547-1.562a.308.308 0 00-.44 0l-.589.584a.312.312 0 00-.093.22.307.307 0 00.093.22l2.216 2.241.131.132a.304.304 0 00.44.003l1.849-1.835.61-.61 2.002-1.99a.306.306 0 00-.006-.447zm0 0l-.583-.578a.298.298 0 00-.219-.093.306.306 0 00-.22.093l-1.904 1.895-.687.682-.058.055-.357.358-.638.632-1.547-1.562a.308.308 0 00-.44 0l-.589.584a.312.312 0 00-.093.22.307.307 0 00.093.22l2.216 2.241.131.132a.304.304 0 00.44.003l1.849-1.835.61-.61 2.002-1.99a.306.306 0 00-.006-.447zm0 0l-.583-.578a.298.298 0 00-.219-.093.306.306 0 00-.22.093l-1.904 1.895-.687.682-.058.055-.357.358-.638.632-1.547-1.562a.308.308 0 00-.44 0l-.589.584a.312.312 0 00-.093.22.307.307 0 00.093.22l2.216 2.241.131.132a.304.304 0 00.44.003l1.849-1.835.61-.61 2.002-1.99a.306.306 0 00-.006-.447zm0 0l-.583-.578a.298.298 0 00-.219-.093.306.306 0 00-.22.093l-1.904 1.895-.687.682-.058.055-.357.358-.638.632-1.547-1.562a.308.308 0 00-.44 0l-.589.584a.312.312 0 00-.093.22.307.307 0 00.093.22l2.216 2.241.131.132a.304.304 0 00.44.003l1.849-1.835.61-.61 2.002-1.99a.306.306 0 00-.006-.447zm0 0l-.583-.578a.298.298 0 00-.219-.093.306.306 0 00-.22.093l-1.904 1.895-.687.682-.058.055-.357.358-.638.632-1.547-1.562a.308.308 0 00-.44 0l-.589.584a.312.312 0 00-.093.22.307.307 0 00.093.22l2.216 2.241.131.132a.304.304 0 00.44.003l1.849-1.835.61-.61 2.002-1.99a.306.306 0 00-.006-.447z"}),Object(c.createElement)("path",{className:"fill-theme-color",d:"M268.92 47H150.08c-3.358 0-6.08 2.91-6.08 6.5s2.722 6.5 6.08 6.5h118.84c3.358 0 6.08-2.91 6.08-6.5s-2.722-6.5-6.08-6.5z",opacity:".6"}),Object(c.createElement)("path",{className:"fill-theme-color",d:"M321.919 71H150.081c-3.359 0-6.081 2.686-6.081 6s2.722 6 6.081 6h171.838c3.359 0 6.081-2.686 6.081-6s-2.722-6-6.081-6z",opacity:".3"}),Object(c.createElement)("path",{className:"fill-theme-color",d:"M279.927 94H150.073c-3.354 0-6.073 2.91-6.073 6.5s2.719 6.5 6.073 6.5h129.854c3.354 0 6.073-2.91 6.073-6.5s-2.719-6.5-6.073-6.5z",opacity:".6"}),Object(c.createElement)("path",{className:"fill-theme-color",d:"M321.919 118H150.081c-3.359 0-6.081 2.686-6.081 6s2.722 6 6.081 6h171.838c3.359 0 6.081-2.686 6.081-6s-2.722-6-6.081-6z",opacity:".3"}),Object(c.createElement)("path",{className:"fill-theme-color",d:"M261.916 141H150.084c-3.36 0-6.084 2.686-6.084 6s2.724 6 6.084 6h111.832c3.36 0 6.084-2.686 6.084-6s-2.724-6-6.084-6z",opacity:".1"}),Object(c.createElement)("path",{fill:"#CCC",d:"M316.161 47.162a6.4 6.4 0 00-5.92 3.963 6.432 6.432 0 001.389 6.996 6.404 6.404 0 009.86-.973 6.428 6.428 0 00-.797-8.106 6.404 6.404 0 00-4.532-1.88zm0 11.616a5.18 5.18 0 01-2.882-.876 5.198 5.198 0 011.87-9.417 5.181 5.181 0 015.326 2.21c.57.854.874 1.859.874 2.887a5.195 5.195 0 01-3.201 4.8c-.63.26-1.305.392-1.987.39v.006z"}),Object(c.createElement)("path",{fill:"#CCC",d:"M318.127 56.366l.808-.807a.35.35 0 00.078-.117.346.346 0 000-.276.35.35 0 00-.078-.117l-1.458-1.458 1.455-1.458a.35.35 0 00.078-.117.346.346 0 000-.277.35.35 0 00-.078-.117l-.808-.807a.364.364 0 00-.254-.105.358.358 0 00-.253.105l-1.456 1.458-1.455-1.458a.361.361 0 00-.51 0l-.806.807a.365.365 0 00-.107.255.365.365 0 00.107.256l1.456 1.458-1.453 1.455a.365.365 0 00-.079.394.381.381 0 00.079.116l.806.807a.353.353 0 00.255.106.363.363 0 00.255-.106l1.455-1.458 1.456 1.458a.352.352 0 00.253.107.356.356 0 00.254-.104zM369.966 70.568a6.402 6.402 0 00-5.921 3.963 6.432 6.432 0 001.389 6.995 6.404 6.404 0 0010.94-4.539 6.403 6.403 0 00-3.953-5.935 6.383 6.383 0 00-2.455-.484zm0 11.616a5.179 5.179 0 01-3.17-1.076 5.203 5.203 0 01-1.621-6.136 5.187 5.187 0 015.512-3.13 5.186 5.186 0 012.985 1.519 5.2 5.2 0 01-1.158 8.146 5.18 5.18 0 01-2.548.674v.003z"}),Object(c.createElement)("path",{fill:"#CCC",d:"M371.925 79.772l.808-.807a.363.363 0 000-.51l-1.458-1.459 1.458-1.458a.348.348 0 00.078-.116.343.343 0 000-.275.346.346 0 00-.078-.116l-.808-.81a.358.358 0 00-.507 0l-1.452 1.458-1.456-1.458a.358.358 0 00-.507 0l-.808.81a.36.36 0 00-.078.391.348.348 0 00.078.116l1.455 1.458-1.455 1.458a.364.364 0 000 .51l.808.808a.35.35 0 00.507 0l1.456-1.458 1.458 1.458a.358.358 0 00.501 0z"}),Object(c.createElement)("path",{className:"fill-theme-color",d:"M344 94h90v80h-90z"}),Object(c.createElement)("path",{fill:"#fff",fillOpacity:".65",d:"M364.607 150.419H357v25.307h7.607v-25.307zM379.317 132h-7.607v43.455h7.607V132zM394.026 136h-7.607v61.603h7.607V136zM408.736 123h-7.607v55.726h7.607V123zM423.445 132.197h-7.607v38.342h7.607v-38.342z",opacity:".2"}),Object(c.createElement)("path",{fill:"#fff",d:"M356.331 134l-.331-.495 15.486-21.052 13.65 14.005 11.039-17.456 4.84 5.868 13.168-11.268 14.625 14.021L451.763 99l.237.594-23.213 18.833-14.619-14.015-13.201 11.297-4.748-5.756-11.014 17.418-13.677-14.031L356.331 134z"})),Object(c.createElement)("defs",null,Object(c.createElement)("clipPath",{id:"clip0"},Object(c.createElement)("path",{fill:"#fff",d:"M0 0h517v160H0z"})))),je=({title:e,body:t})=>Object(c.createElement)("div",{className:"woocommerce__welcome-modal__page-content"},Object(c.createElement)("h2",{className:"woocommerce__welcome-modal__page-content__header"},e),Object(c.createElement)("p",{className:"woocommerce__welcome-modal__page-content__body"},t));a(561);const Ee={image:Object(c.createElement)(he,null),content:Object(c.createElement)(je,{title:Object(u.__)("Welcome to your new store management experience",'woocommerce'),body:j()({mixedString:Object(u.__)("We've designed your navigation and home screen to help you focus on the things that matter most in managing your online store. {{link}}Learn more{{/link}} about these changes – or explore on your own.",'woocommerce'),components:{link:Object(c.createElement)(v.Link,{href:"https://wordpress.com/support/new-woocommerce-experience-on-wordpress-dot-com/",type:"external",target:"_blank"})}})})};function ge({onClose:e}){const[t,a]=Object(c.useState)(!0);if(Object(c.useEffect)(()=>{Object(w.recordEvent)("welcome_from_calypso_modal_open")},[]),!t)return null;const r=A()("woocommerce__welcome-modal","woocommerce__welcome-from-calypso-modal");return Object(c.createElement)(O.Guide,{onFinish:()=>{e&&e(),a(!1),Object(w.recordEvent)("welcome_from_calypso_modal_close")},className:r,finishButtonText:Object(u.__)("Let's go",'woocommerce'),pages:[Ee]})}a(562);const ke=[{image:Object(c.createElement)(he,null),content:Object(c.createElement)(je,{title:Object(u.__)("Welcome to your WooCommerce store’s online HQ!",'woocommerce'),body:Object(u.__)("Here's where you’ll find setup suggestions, tips and tools, and key data on your store’s performance and earnings — all the basics for store management and growth.",'woocommerce')})},{image:Object(c.createElement)(()=>Object(c.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"517",height:"160",fill:"none"},Object(c.createElement)("defs",null),Object(c.createElement)("g",{clipPath:"url(#clip0)"},Object(c.createElement)("path",{className:"fill-theme-color",d:"M0 0h517v160H0z"}),Object(c.createElement)("path",{fill:"#fff",fillOpacity:".65",d:"M33.576 185.926c-6.271-.911-14.742-.279-17.182 7.085-1.239 3.736-.178 7.645.98 11.08 4.89 14.682 11.49 28.444 19.643 40.954 3.897 5.965 8.253 11.884 9.592 19.504 1.34 7.619-.56 16.084-2.934 23.945-5.595 18.62-13.762 36.371-24.188 52.572 16.006 9.711 34.165 19.634 52.684 12.57 11.09-4.232 21.041-14.268 32.365-15.961 7.562-1.132 14.735 1.648 21.594 4.467a998.376 998.376 0 0195.343 45.227c13.023 7.042 26.207 14.481 40.901 16.153 14.694 1.672 31.486-3.518 41.947-17.66 1.611-2.179 3.241-4.669 5.483-5.546 2.02-.776 4.069-.045 5.952.688l113.896 44.033c6.241 2.411 12.718 4.853 19.534 3.832 6.606-.985 12.833-5.095 18.858-9.148 13.771-9.237 29.242-21.105 32.239-39.005 2.407-14.347-4.339-27.253-11.974-37.283-7.636-10.03-16.705-19.204-20.353-32.315-5.549-19.955 2.798-42.949 9.281-64.164a405.4 405.4 0 0013.244-58.574c2.588-17.377 4.004-35.179.91-51.659-3.095-16.481-11.265-31.624-24.089-38.27-16.746-8.681-38.828-2.057-54.255-13.347-13.04-9.513-17.58-29.035-25.856-44.316-14.698-27.146-41.453-40.923-67.958-50.405-28.1-10.066-58.213-16.679-88.607-10-6.962 1.527-14.047 3.833-20.152 8.649-9.36 7.388-15.196 19.616-22.986 29.33C156.104 57.468 100.341 49.156 68.22 87.48c-11.398 13.594-17.581 31.878-18.797 49.831-1.31 19.318 8.69 33.652 8.706 50.888-7.135 2.277-17.21-1.211-24.553-2.273z"}),Object(c.createElement)("path",{fill:"#F6F7F7",d:"M113 33h267v185H113z"}),Object(c.createElement)("path",{className:"fill-theme-color",d:"M248.466 73.79h-114.69V47.88h114.69V73.79zm-114.015-.673h113.341V48.554H134.451v24.563z"}),Object(c.createElement)("path",{fill:"#CCC",d:"M155.702 56.63h-12.818v12.786h12.818V56.63z"}),Object(c.createElement)("path",{className:"fill-theme-color",d:"M154.016 67.733h-13.493V54.274h13.493v13.46zm-12.819-.673h12.144V54.947h-12.144V67.06z"}),Object(c.createElement)("path",{className:"fill-theme-color",d:"M225.267 56.966h-50v.673h50v-.673z",opacity:".7"}),Object(c.createElement)("path",{className:"fill-theme-color",d:"M235.311 61.677h-60.044v.673h60.044v-.673z",opacity:".5"}),Object(c.createElement)("path",{className:"fill-theme-color",d:"M225.267 66.387h-50v.673h50v-.673z",opacity:".2"}),Object(c.createElement)("path",{className:"fill-theme-color",d:"M248.466 147.142h-114.69v-25.909h114.69v25.909zm-114.015-.673h113.341v-24.563H134.451v24.563z"}),Object(c.createElement)("path",{fill:"#CCC",d:"M155.702 129.981h-12.818v12.786h12.818v-12.786z"}),Object(c.createElement)("path",{className:"fill-theme-color",d:"M154.016 141.085h-13.493v-13.459h13.493v13.459zm-12.819-.673h12.144v-12.113h-12.144v12.113z"}),Object(c.createElement)("path",{className:"fill-theme-color",d:"M235.311 130.318h-60.044v.673h60.044v-.673z",opacity:".7"}),Object(c.createElement)("path",{className:"fill-theme-color",d:"M225.267 135.028h-50v.673h50v-.673z",opacity:".5"}),Object(c.createElement)("path",{className:"fill-theme-color",d:"M215.267 139.739h-40v.673h40v-.673z",opacity:".2"}),Object(c.createElement)("path",{className:"fill-theme-color",d:"M289.62 110.465H174.93V84.557h114.69v25.908zm-114.016-.672h113.341V85.23H175.604v24.563z"}),Object(c.createElement)("path",{fill:"#CCC",d:"M267.694 106.092h12.818V93.305h-12.818v12.787z"}),Object(c.createElement)("path",{className:"fill-theme-color",d:"M282.873 104.409H269.38V90.95h13.493v13.459zm-12.818-.673h12.144V91.623h-12.144v12.113z"}),Object(c.createElement)("path",{className:"fill-theme-color",d:"M248.129 93.642h-60.044v.673h60.044v-.673z",opacity:".7"}),Object(c.createElement)("path",{className:"fill-theme-color",d:"M238.085 98.353h-50v.672h50v-.672z",opacity:".5"}),Object(c.createElement)("path",{className:"fill-theme-color",d:"M243.085 103.063h-55v.673h55v-.673z",opacity:".2"}),Object(c.createElement)("path",{className:"fill-theme-color",d:"M266.035 66.154a5.363 5.363 0 005.369-5.356 5.363 5.363 0 00-5.369-5.356c-2.966 0-5.37 2.398-5.37 5.356 0 2.958 2.404 5.356 5.37 5.356zM273.793 140.515c2.966 0 5.37-2.398 5.37-5.356 0-2.958-2.404-5.356-5.37-5.356a5.363 5.363 0 00-5.369 5.356 5.363 5.363 0 005.369 5.356zM153.706 102.83a5.363 5.363 0 005.37-5.356c0-2.959-2.404-5.357-5.37-5.357s-5.37 2.398-5.37 5.357a5.363 5.363 0 005.37 5.356z",opacity:".5"}),Object(c.createElement)("path",{className:"fill-theme-color",d:"M401.276 172h-70.552a8.79 8.79 0 01-6.169-2.517 8.532 8.532 0 01-2.555-6.078V131.56a3.368 3.368 0 011.078-2.471l37.386-34.915A8.113 8.113 0 01366 92c2.06 0 4.041.778 5.536 2.174l35.645 33.289a8.882 8.882 0 012.084 2.944 8.78 8.78 0 01.735 3.515v29.483c0 2.28-.919 4.466-2.555 6.078a8.79 8.79 0 01-6.169 2.517z"}),Object(c.createElement)("path",{fill:"#F0F0F0",d:"M393.267 106h-54.534c-2.614 0-4.733 2.053-4.733 4.585v52.83c0 2.532 2.119 4.585 4.733 4.585h54.534c2.614 0 4.733-2.053 4.733-4.585v-52.83c0-2.532-2.119-4.585-4.733-4.585z"}),Object(c.createElement)("path",{className:"fill-theme-color",d:"M366 150.493l-41.579-20.323a1.667 1.667 0 00-1.631.091 1.695 1.695 0 00-.579.619 1.725 1.725 0 00-.211.826v34.967a5.345 5.345 0 001.543 3.767 5.261 5.261 0 003.725 1.56h77.464a5.261 5.261 0 003.725-1.56 5.345 5.345 0 001.543-3.767v-34.368c0-.352-.088-.699-.257-1.008a2.069 2.069 0 00-1.688-1.071 2.035 2.035 0 00-1.009.205L366 150.493zM390 118h-48v2h48v-2zM390 124h-48v2h48v-2z"}),Object(c.createElement)("path",{className:"fill-theme-color",d:"M384 130h-42v2h42v-2z"}),Object(c.createElement)("path",{fill:"#fff",d:"M335 112a7 7 0 100-14 7 7 0 000 14z"}),Object(c.createElement)("path",{className:"fill-theme-color",d:"M336 98a8.003 8.003 0 00-7.391 4.939 7.992 7.992 0 00-.455 4.622 7.993 7.993 0 006.285 6.285A8 8 0 00344 106a8.022 8.022 0 00-8-8zm-1.642 12.265l-4.1-4.1 1.15-1.15 2.954 2.954 6.234-6.234 1.15 1.15-7.388 7.38z"})),Object(c.createElement)("defs",null,Object(c.createElement)("clipPath",{id:"clip0"},Object(c.createElement)("path",{fill:"#fff",d:"M0 0h517v160H0z"})))),null),content:Object(c.createElement)(je,{title:Object(u.__)("A personalized inbox full of relevant advice",'woocommerce'),body:Object(u.__)("Check your inbox for helpful growth tips tailored to your store and notifications about key traffic and sales milestones. We look forward to celebrating them with you!",'woocommerce')})},{image:Object(c.createElement)(()=>Object(c.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"517",height:"160",fill:"none"},Object(c.createElement)("defs",null),Object(c.createElement)("g",{clipPath:"url(#clip0)"},Object(c.createElement)("path",{className:"fill-theme-color",d:"M0 0h517v160H0z"}),Object(c.createElement)("path",{fill:"#fff",fillOpacity:".65",d:"M30.501 63.74c7.21-10.372 19.533-17.051 31.735-22.399l2.057-.888c12.774-5.469 25.944-10.008 39.27-14.127 7.129-2.21 14.285-4.313 21.448-6.389l5.615-1.62c7.29-2.106 14.596-4.21 21.916-6.315a6165.97 6165.97 0 0121.511-6.139 3346.684 3346.684 0 0127.597-7.677 2189.847 2189.847 0 0121.603-5.782c9.237-2.42 18.491-4.764 27.761-7.035 7.246-1.77 14.502-3.483 21.767-5.14a1152.381 1152.381 0 0128.025-6 940.985 940.985 0 0119.106-3.654l2.908-.52c27.416-4.852 55.724-8.222 82.193-2.775l.715.151c.355.074.71.148 1.067.23a87.181 87.181 0 0114.309 4.404c8.282 3.398 15.644 8.247 20.596 14.967 7.763 10.54 8.624 24.398 6.126 37.281-2.498 12.884-8.007 25.346-12.299 37.974-1.257 3.7-2.378 7.49-3.34 11.33-5.997 24.068-5.398 49.993 11.766 67.323a93.715 93.715 0 007.029 6.227c3.928 3.218 7.905 6.424 11.03 10.3 7.28 9.017 9.211 20.756 10.296 32.099 1.425 15.086 1.236 31.775-9.516 44.175-11.153 12.875-30.519 17.317-48.211 18.232-27.498 1.457-54.442-3.316-81.339-6.956-26.898-3.641-54.739-6.141-81.787-.263a121.18 121.18 0 00-17.082 5.062 108.9 108.9 0 00-21.21 10.677c-9.622 6.318-17.826 14.22-23.006 23.613-11.123 20.092-39.488 28.645-62.664 24.15-22.115-4.288-39.921-20.774-44.019-40.738-4.538-22.229 6.615-44.308 16.332-66.515a358.83 358.83 0 003.437-8.081 238.988 238.988 0 001.795-4.513 165.185 165.185 0 002.828-7.947c4.39-13.591 6.016-28.984-2.295-40.321-4.658-6.347-11.477-10.355-19.238-13.393-17.388-6.801-39.481-8.722-52.38-21.167C22.84 94.854 21.359 76.92 30.502 63.74z"}),Object(c.createElement)("path",{fill:"#F6F7F7",d:"M124 33h267v185H124z"}),Object(c.createElement)("path",{className:"fill-theme-color",d:"M169 152.005V229a734.947 734.947 0 01-15.628-.991l-2.372-.181v-75.823c0-.395.072-.785.212-1.15.14-.365.345-.696.604-.975.258-.279.565-.5.903-.651a2.61 2.61 0 011.066-.229h12.43c.366 0 .728.078 1.066.229.338.151.645.372.903.651.259.279.464.61.604.975.14.365.212.755.212 1.15z",opacity:".7"}),Object(c.createElement)("path",{className:"fill-theme-color",d:"M186 229.733V127.377c0-.63.31-1.235.861-1.681.551-.446 1.299-.696 2.079-.696h13.12c.386 0 .768.061 1.125.181.357.119.681.294.954.515.273.221.489.483.637.771.148.289.224.598.224.91V230l-19-.267z",opacity:".5"}),Object(c.createElement)("path",{className:"fill-theme-color",d:"M225 230.002v-97.406a2.843 2.843 0 012.843-2.845h12.689a2.844 2.844 0 012.844 2.845v97.196l-18.376.21z",opacity:".7"}),Object(c.createElement)("path",{className:"fill-theme-color",d:"M282 88.368v140.224c-6 .145-12 .281-18 .408V88.368c0-.628.293-1.23.816-1.674.522-.445 1.231-.694 1.969-.694h12.43c.738 0 1.447.25 1.969.694.523.444.816 1.046.816 1.674z",opacity:".5"}),Object(c.createElement)("path",{className:"fill-theme-color",d:"M319 112.954v115.709c-6 .12-12 .232-18 .337V112.954c0-.518.293-1.015.816-1.382.522-.366 1.231-.572 1.969-.572h12.43c.738 0 1.447.206 1.969.572.523.367.816.864.816 1.382z",opacity:".7"}),Object(c.createElement)("path",{stroke:"#CCC",strokeLinecap:"round",strokeMiterlimit:"10",strokeWidth:"2",d:"M160.125 133.501l41.91-46.767 41.91 23.545 41.91-72.248 41.909 34.511"}),Object(c.createElement)("path",{className:"fill-theme-color",d:"M160 139.005c2.761 0 5-2.24 5-5.003a5.002 5.002 0 00-5-5.002c-2.761 0-5 2.24-5 5.002a5.002 5.002 0 005 5.003zM201.5 93.007c4.142 0 7.5-3.36 7.5-7.504A7.502 7.502 0 00201.5 78c-4.142 0-7.5 3.36-7.5 7.504a7.502 7.502 0 007.5 7.503zM243.784 119.31c4.985 0 9.026-4.043 9.026-9.031s-4.041-9.031-9.026-9.031c-4.986 0-9.027 4.043-9.027 9.031s4.041 9.031 9.027 9.031zM286.027 46.062c4.985 0 9.027-4.043 9.027-9.031S291.012 28 286.027 28c-4.986 0-9.027 4.043-9.027 9.031s4.041 9.031 9.027 9.031zM327.5 80.007c4.142 0 7.5-3.36 7.5-7.504A7.502 7.502 0 00327.5 65c-4.142 0-7.5 3.36-7.5 7.504a7.502 7.502 0 007.5 7.503zM408 137l-36 2-18-30.926c5.588-3.326 12.033-5.083 18.606-5.074C392.154 103 408 118.222 408 137zM351.107 110l-.143.088c-7.887 4.836-13.573 12.518-15.859 21.429a35.211 35.211 0 003.603 26.338l.084.145L370 140.317 351.107 110zm-12.19 47.543a34.886 34.886 0 01-3.485-25.944c2.25-8.77 7.826-16.342 15.566-21.138l18.531 29.738-30.612 17.344zM408.664 138.651l-35.891 2.797 10.3 32.297.162-.046c7.808-2.265 14.585-6.957 19.211-13.301 4.626-6.344 6.824-13.96 6.23-21.588l-.012-.159zm-35.447 3.081l35.134-2.738c1.116 15.348-9.387 29.753-25.051 34.355l-10.083-31.617zM370.719 142.639l-30.714 17.335.088.131c3.977 5.942 9.926 10.554 16.982 13.165 7.056 2.61 14.849 3.083 22.245 1.349l.164-.038-8.765-31.942zm-30.249 17.435l30.034-16.951 8.57 31.234c-7.278 1.673-14.935 1.192-21.871-1.374-6.936-2.566-12.794-7.086-16.733-12.909z"}),Object(c.createElement)("path",{fill:"#fff",d:"M423 97h-17v-1h17v1zM423 101h-17v-3h17v3zM416 104h-17.979l-.05.068L384 122.821l.28.179 13.92-18.685H416V104z"})),Object(c.createElement)("defs",null,Object(c.createElement)("clipPath",{id:"clip0"},Object(c.createElement)("path",{fill:"#fff",d:"M0 0h517v160H0z"})))),null),content:Object(c.createElement)(je,{title:Object(u.__)("Good data leads to smart business decisions",'woocommerce'),body:Object(u.__)("Monitor your stats to improve performance, increase sales, and track your progress toward revenue goals. The more you know, the better you can serve your customers and grow your store.",'woocommerce')})}],Be=({onClose:e})=>{const[t,a]=Object(c.useState)(!0);return Object(c.useEffect)(()=>{Object(w.recordEvent)("task_list_welcome_modal_open")},[]),Object(c.createElement)(c.Fragment,null,t&&Object(c.createElement)(O.Guide,{onFinish:()=>{a(!1),e(),Object(w.recordEvent)("task_list_welcome_modal_close")},className:"woocommerce__welcome-modal",finishButtonText:Object(u.__)("Let's go",'woocommerce'),pages:ke}))};a(563),a(516);const Se=Object(c.lazy)(()=>Promise.all([a.e(3),a.e(51)]).then(a.bind(null,611))),ye=({defaultHomescreenLayout:e,isBatchUpdating:t,query:a,taskListComplete:r,bothTaskListsHidden:n,shouldShowWelcomeModal:o,shouldShowWelcomeFromCalypsoModal:l,isTaskListHidden:i,updateOptions:m})=>{const d=Object(s.useUserPreferences)(),b=r||i,v=b||window.wcAdminFeatures.analytics,O="two_columns"===(d.homepage_layout||e)&&v,[w,f]=Object(c.useState)(!0),h=!1===n,j=!a.task;t&&!w&&f(!0);const E=Object(c.useRef)(!0),g=Object(c.useCallback)(()=>{E.current=window.innerWidth>=782},[]);Object(c.useLayoutEffect)(()=>(g(),window.addEventListener("resize",g),()=>{window.removeEventListener("resize",g)}),[g]);const k=E.current&&O,B=()=>{const e=Boolean(a.task);return Object(c.createElement)(c.Suspense,{fallback:e?null:Object(c.createElement)(fe.a,null)},Object(c.createElement)(Se,{query:a,userPreferences:d}))};return Object(c.createElement)("div",{className:A()("woocommerce-homescreen",{"two-columns":O})},j?Object(c.createElement)(c.Fragment,null,Object(c.createElement)(R,{shouldStick:k},Object(c.createElement)(p.a,{className:"your-store-today",title:Object(u.__)("Your store today",'woocommerce'),subtitle:Object(u.__)("To do's, tips, and insights for your business",'woocommerce')}),Object(c.createElement)(L,null),h&&B(),Object(c.createElement)(_.a,null)),Object(c.createElement)(R,{shouldStick:k},window.wcAdminFeatures.analytics&&Object(c.createElement)(Oe,null),b&&Object(c.createElement)(we.a,null))):B(),o&&Object(c.createElement)(Be,{onClose:()=>{m({woocommerce_task_list_welcome_modal_dismissed:"yes"})}}),l&&Object(c.createElement)(ge,{onClose:()=>{m({woocommerce_welcome_from_calypso_modal_dismissed:"yes"})}}),window.wcAdminFeatures.navigation&&Object(c.createElement)(ae,null))};ye.propTypes={taskListComplete:b.a.bool,bothTaskListsHidden:b.a.bool,query:b.a.object.isRequired,shouldShowWelcomeModal:b.a.bool,shouldShowWelcomeFromCalypsoModal:b.a.bool,updateOptions:b.a.func.isRequired};var Ne=Object(r.compose)(Object(n.withSelect)(e=>{const{isNotesRequesting:t}=e(s.NOTES_STORE_NAME),{getOption:a,hasFinishedResolution:c}=e(s.OPTIONS_STORE_NAME),r="yes"===a("woocommerce_welcome_from_calypso_modal_dismissed"),n=c("getOption",["woocommerce_welcome_from_calypso_modal_dismissed"]),o=!!window.location.search.match("from-calypso"),l=n&&!r&&o,i="yes"===a("woocommerce_task_list_welcome_modal_dismissed"),m=c("getOption",["woocommerce_task_list_welcome_modal_dismissed"])&&!i&&n&&!r,A=a("woocommerce_default_homepage_layout")||"single_column",d="yes"===a("woocommerce_task_list_hidden");return{defaultHomescreenLayout:A,isBatchUpdating:t("batchUpdateNotes"),shouldShowWelcomeModal:m,shouldShowWelcomeFromCalypsoModal:l,isTaskListHidden:d,bothTaskListsHidden:d&&"yes"===a("woocommerce_extended_task_list_hidden"),taskListComplete:"yes"===a("woocommerce_task_list_complete")}}),Object(n.withDispatch)(e=>({updateOptions:e(s.OPTIONS_STORE_NAME).updateOptions})))(ye);const Ce=Object(l.f)("onboarding",{});t.default=Object(r.compose)(Ce.profile||Ce.tasksStatus?Object(s.withOnboardingHydration)({profileItems:Ce.profile,tasksStatus:Ce.tasksStatus}):o.identity,Object(n.withSelect)(e=>{const{getProfileItems:t}=e(s.ONBOARDING_STORE_NAME);return{profileItems:t()}}))(({profileItems:e,query:t})=>{const{completed:a,skipped:r}=e||{};return a||r||Object(i.getHistory)().push(Object(i.getNewPath)({},"/setup-wizard",{})),Object(c.createElement)(Ne,{query:t})})}}]);woocommerce-admin/dist/chunks/analytics-report-stock.js000064400000035600151335517650017405 0ustar00(window.__wcAdmin_webpackJsonp=window.__wcAdmin_webpackJsonp||[]).push([[14],{478:function(e,t,r){"use strict";r.r(t),r.d(t,"default",(function(){return f}));var a=r(0),o=r(1),c=r.n(o),n=r(2),s=r(30);const i=Object(s.applyFilters)("woocommerce_admin_stock_report_advanced_filters",{filters:{},title:Object(n._x)("Products Match {{select /}} Filters","A sentence describing filters for Products. See screen shot for context: https://cloudup.com/cSsUY9VeCVJ",'woocommerce')}),l=Object(s.applyFilters)("woocommerce_admin_stock_report_filters",[{label:Object(n.__)("Show",'woocommerce'),staticParams:["paged","per_page"],param:"type",showFilters:()=>!0,filters:[{label:Object(n.__)("All products",'woocommerce'),value:"all"},{label:Object(n.__)("Out of stock",'woocommerce'),value:"outofstock"},{label:Object(n.__)("Low stock",'woocommerce'),value:"lowstock"},{label:Object(n.__)("In stock",'woocommerce'),value:"instock"},{label:Object(n.__)("On backorder",'woocommerce'),value:"onbackorder"}]},{label:Object(n.__)("Filter by",'woocommerce'),staticParams:["paged","per_page"],param:"filter",showFilters:()=>Object.keys(i.filters).length,filters:[{label:Object(n.__)("All Products",'woocommerce'),value:"all"},{label:Object(n.__)("Advanced Filters",'woocommerce'),value:"advanced"}]}]);var d=r(28),m=r(21),u=r(12),b=r(120),p=r(13),_=r(506);var y=r(501);const g=Object(p.f)("stockStatuses",{});class h extends a.Component{constructor(){super(),this.getHeadersContent=this.getHeadersContent.bind(this),this.getRowsContent=this.getRowsContent.bind(this),this.getSummary=this.getSummary.bind(this)}getHeadersContent(){return[{label:Object(n.__)("Product / Variation",'woocommerce'),key:"title",required:!0,isLeftAligned:!0,isSortable:!0},{label:Object(n.__)("SKU",'woocommerce'),key:"sku",isSortable:!0},{label:Object(n.__)("Status",'woocommerce'),key:"stock_status",isSortable:!0,defaultSort:!0},{label:Object(n.__)("Stock",'woocommerce'),key:"stock_quantity",isSortable:!0}]}getRowsContent(e=[]){const{query:t}=this.props,r=Object(u.getPersistedQuery)(t);return e.map(e=>{const{id:t,manage_stock:o,parent_id:c,sku:s,stock_quantity:i,stock_status:l,low_stock_amount:_}=e,y=Object(d.decodeEntities)(e.name),h=Object(u.getNewPath)(r,"/analytics/products",{filter:"single_product",products:c||t}),O=Object(a.createElement)(m.Link,{href:h,type:"wc-admin"},y),j=Object(p.e)("post.php?action=edit&post="+(c||t));var f,w,v;return[{display:O,value:y},{display:s,value:s},{display:(f=l,v=_,(w=i)&&f&&w<=v==="instock"?Object(a.createElement)(m.Link,{href:j,type:"wp-admin"},Object(n._x)("Low","Indication of a low quantity",'woocommerce')):Object(a.createElement)(m.Link,{href:j,type:"wp-admin"},g[l])),value:g[l]},{display:o?Object(b.formatValue)(this.context.getCurrencyConfig(),"number",i):Object(n.__)("N/A",'woocommerce'),value:i}]})}getSummary(e){const{products:t=0,outofstock:r=0,lowstock:a=0,instock:o=0,onbackorder:c=0}=e,s=this.context.getCurrencyConfig();return[{label:Object(n._n)("Product","Products",t,'woocommerce'),value:Object(b.formatValue)(s,"number",t)},{label:Object(n.__)("Out of stock",'woocommerce'),value:Object(b.formatValue)(s,"number",r)},{label:Object(n.__)("Low stock",'woocommerce'),value:Object(b.formatValue)(s,"number",a)},{label:Object(n.__)("On backorder",'woocommerce'),value:Object(b.formatValue)(s,"number",c)},{label:Object(n.__)("In stock",'woocommerce'),value:Object(b.formatValue)(s,"number",o)}]}render(){const{advancedFilters:e,filters:t,query:r}=this.props;return Object(a.createElement)(_.a,{endpoint:"stock",getHeadersContent:this.getHeadersContent,getRowsContent:this.getRowsContent,getSummary:this.getSummary,summaryFields:["products","outofstock","lowstock","instock","onbackorder"],query:r,tableQuery:{orderby:r.orderby||"stock_status",order:r.order||"asc",type:r.type||"all"},title:Object(n.__)("Stock",'woocommerce'),filters:t,advancedFilters:e})}}h.contextType=y.a;var O=h,j=r(505);class f extends a.Component{render(){const{query:e,path:t}=this.props;return Object(a.createElement)(a.Fragment,null,Object(a.createElement)(j.a,{query:e,path:t,showDatePicker:!1,filters:l,advancedFilters:i,report:"stock"}),Object(a.createElement)(O,{query:e,filters:l,advancedFilters:i}))}}f.propTypes={query:c.a.object.isRequired}},501:function(e,t,r){"use strict";r.d(t,"b",(function(){return l})),r.d(t,"a",(function(){return d}));var a=r(0),o=r(30),c=r(89),n=r.n(c),s=r(13);const i=n()(s.a),l=e=>{const t=i.getCurrencyConfig(),r=Object(o.applyFilters)("woocommerce_admin_report_currency",t,e);return n()(r)},d=Object(a.createContext)(i)},504:function(e,t,r){"use strict";var a=r(0),o=r(2),c=r(1),n=r.n(c),s=r(21);function i({className:e}){const t=Object(o.__)("There was an error getting your stats. Please try again.",'woocommerce'),r=Object(o.__)("Reload",'woocommerce');return Object(a.createElement)(s.EmptyContent,{className:e,title:t,actionLabel:r,actionCallback:()=>{window.location.reload()}})}i.propTypes={className:n.a.string},t.a=i},505:function(e,t,r){"use strict";var a=r(0),o=r(14),c=r(1),n=r.n(c),s=r(4),i=r(7),l=r(21),d=r(13),m=r(11),u=r(19),b=r(16),p=r(501),_=r(55);class y extends a.Component{constructor(){super(),this.onDateSelect=this.onDateSelect.bind(this),this.onFilterSelect=this.onFilterSelect.bind(this),this.onAdvancedFilterAction=this.onAdvancedFilterAction.bind(this)}onDateSelect(e){const{report:t,addCesSurveyForAnalytics:r}=this.props;r(),Object(b.recordEvent)("datepicker_update",{report:t,...Object(s.omitBy)(e,s.isUndefined)})}onFilterSelect(e){const{report:t,addCesSurveyForAnalytics:r}=this.props,a=e.filter||e["filter-variations"];["single_product","single_category","single_coupon","single_variation"].includes(a)&&r();const o={report:t,filter:e.filter||"all"};"single_product"===e.filter&&(o.filter_variation=e["filter-variations"]||"all"),Object(b.recordEvent)("analytics_filter",o)}onAdvancedFilterAction(e,t){const{report:r,addCesSurveyForAnalytics:a}=this.props;switch(e){case"add":Object(b.recordEvent)("analytics_filters_add",{report:r,filter:t.key});break;case"remove":Object(b.recordEvent)("analytics_filters_remove",{report:r,filter:t.key});break;case"filter":const e=Object.keys(t).reduce((e,r)=>(e[Object(s.snakeCase)(r)]=t[r],e),{});a(),Object(b.recordEvent)("analytics_filters_filter",{report:r,...e});break;case"clear_all":Object(b.recordEvent)("analytics_filters_clear_all",{report:r});break;case"match":Object(b.recordEvent)("analytics_filters_all_any",{report:r,value:t.match})}}render(){const{advancedFilters:e,filters:t,path:r,query:o,showDatePicker:c,defaultDateRange:n}=this.props,{period:s,compare:i,before:m,after:b}=Object(u.getDateParamsFromQuery)(o,n),{primary:p,secondary:_}=Object(u.getCurrentDates)(o,n),y={period:s,compare:i,before:m,after:b,primaryDate:p,secondaryDate:_},g=this.context;return Object(a.createElement)(l.ReportFilters,{query:o,siteLocale:d.b.siteLocale,currency:g.getCurrencyConfig(),path:r,filters:t,advancedFilters:e,showDatePicker:c,onDateSelect:this.onDateSelect,onFilterSelect:this.onFilterSelect,onAdvancedFilterAction:this.onAdvancedFilterAction,dateQuery:y,isoDateFormat:u.isoDateFormat})}}y.contextType=p.a,t.a=Object(o.compose)(Object(i.withSelect)(e=>{const{woocommerce_default_date_range:t}=e(m.SETTINGS_STORE_NAME).getSetting("wc_admin","wcAdminSettings");return{defaultDateRange:t}}),Object(i.withDispatch)(e=>{const{addCesSurveyForAnalytics:t}=e(_.c);return{addCesSurveyForAnalytics:t}}))(y),y.propTypes={advancedFilters:n.a.object,filters:n.a.array,path:n.a.string.isRequired,query:n.a.object,showDatePicker:n.a.bool,report:n.a.string.isRequired}},506:function(e,t,r){"use strict";var a=r(35),o=r.n(a),c=r(0),n=r(3),s=r(30),i=r(14),l=r(91),d=r(7),m=r(4),u=r(2),b=r(1),p=r.n(b),_=r(21),y=r(12),g=r(474),h=r(11),O=r(16),j=()=>Object(c.createElement)("svg",{role:"img","aria-hidden":"true",focusable:"false",version:"1.1",xmlns:"http://www.w3.org/2000/svg",x:"0px",y:"0px",viewBox:"0 0 24 24"},Object(c.createElement)("path",{d:"M18,9c-0.009,0-0.017,0.002-0.025,0.003C17.72,5.646,14.922,3,11.5,3C7.91,3,5,5.91,5,9.5c0,0.524,0.069,1.031,0.186,1.519 C5.123,11.016,5.064,11,5,11c-2.209,0-4,1.791-4,4c0,1.202,0.541,2.267,1.38,3h18.593C22.196,17.089,23,15.643,23,14 C23,11.239,20.761,9,18,9z M12,16l-4-5h3V8h2v3h3L12,16z"})),f=r(504);var w=r(55);r(515);const v=e=>{const{getHeadersContent:t,getRowsContent:r,getSummary:a,isRequesting:i,primaryData:d,tableData:b,endpoint:p,itemIdField:w,tableQuery:v,compareBy:S,compareParam:k,searchBy:C,labels:E={},...F}=e,{query:R,columnPrefsKey:q}=e,{items:x,query:D}=b,A=R[k]?Object(y.getIdsFromQuery)(R[S]):[],[P,T]=Object(c.useState)(A),N=Object(c.useRef)(null),{updateUserPreferences:Q,...I}=Object(h.useUserPreferences)();if(b.isError||d.isError)return Object(c.createElement)(f.a,null);let B=[];q&&(B=I&&I[q]?I[q]:B);const V=(e,o,c)=>{const n=a?a(o,c):null;return Object(s.applyFilters)("woocommerce_admin_report_table",{endpoint:p,headers:t(),rows:r(e),totals:o,summary:n,items:x})},L=t=>{const{ids:r}=e;T(t?r:[])},M=(t,r)=>{const{ids:a}=e;if(r)T(Object(m.uniq)([a[t],...P]));else{const e=P.indexOf(a[t]);T([...P.slice(0,e),...P.slice(e+1)])}},H=t=>{const{ids:r=[]}=e,a=-1!==P.indexOf(r[t]);return{display:Object(c.createElement)(n.CheckboxControl,{onChange:Object(m.partial)(M,t),checked:a}),value:!1}},U=()=>{const{ids:t=[]}=e,r=t.length>0,a=r&&t.length===P.length;return{cellClassName:"is-checkbox-column",key:"compare",label:Object(c.createElement)(n.CheckboxControl,{onChange:L,"aria-label":Object(u.__)("Select All"),checked:a,disabled:!r}),required:!0}},z=i||b.isRequesting||d.isRequesting,J=Object(m.get)(d,["data","totals"],{}),K=x.totalResults||0,Y=K>0,G=Object(y.getSearchWords)(R).map(e=>({key:e,label:e})),{data:W}=x,X=V(W,J,K);let{headers:Z,rows:$}=X;const{summary:ee}=X;S&&($=$.map((e,t)=>[H(t),...e]),Z=[U(),...Z]);const te=((e,t)=>t?e.map(e=>({...e,visible:e.required||!t.includes(e.key)})):e.map(e=>({...e,visible:e.required||!e.hiddenByDefault})))(Z,B);return Object(c.createElement)(c.Fragment,null,Object(c.createElement)("div",{className:"woocommerce-report-table__scroll-point",ref:N,"aria-hidden":!0}),Object(c.createElement)(_.TableCard,o()({className:"woocommerce-report-table",hasSearch:!!C,actions:[S&&Object(c.createElement)(_.CompareButton,{key:"compare",className:"woocommerce-table__compare",count:P.length,helpText:E.helpText||Object(u.__)("Check at least two items below to compare",'woocommerce'),onClick:()=>{S&&Object(y.onQueryChange)("compare")(S,k,P.join(","))},disabled:!Y},E.compareButton||Object(u.__)("Compare",'woocommerce')),C&&Object(c.createElement)(_.Search,{allowFreeTextSearch:!0,inlineTags:!0,key:"search",onChange:t=>{const{baseSearchQuery:r,addCesSurveyForCustomerSearch:a}=e,o=t.map(e=>e.label.replace(",","%2C"));o.length?(Object(y.updateQueryString)({filter:void 0,[k]:void 0,[C]:void 0,...r,search:Object(m.uniq)(o).join(",")}),a()):Object(y.updateQueryString)({search:void 0}),Object(O.recordEvent)("analytics_table_filter",{report:p})},placeholder:E.placeholder||Object(u.__)("Search by item name",'woocommerce'),selected:G,showClearButton:!0,type:C,disabled:!Y}),Y&&Object(c.createElement)(n.Button,{key:"download",className:"woocommerce-table__download-button",disabled:z,onClick:()=>{const{createNotice:t,startExport:r,title:a}=e,o=Object.assign({},R),{data:c,totalResults:n}=x;let s="browser";if(delete o.extended_info,o.search&&delete o[C],c&&c.length===n){const{headers:e,rows:t}=V(c,n);Object(g.downloadCSVFile)(Object(g.generateCSVFileName)(a,o),Object(g.generateCSVDataFromTable)(e,t))}else s="email",r(p,D).then(()=>t("success",Object(u.sprintf)(Object(u.__)("Your %s Report will be emailed to you.",'woocommerce'),a))).catch(e=>t("error",e.message||Object(u.sprintf)(Object(u.__)("There was a problem exporting your %s Report. Please try again.",'woocommerce'),a)));Object(O.recordEvent)("analytics_table_download",{report:p,rows:n,download_type:s})}},Object(c.createElement)(j,null),Object(c.createElement)("span",{className:"woocommerce-table__download-button__label"},E.downloadButton||Object(u.__)("Download",'woocommerce')))],headers:te,isLoading:z,onQueryChange:y.onQueryChange,onColumnsChange:(e,t)=>{const r=Z.map(e=>e.key).filter(t=>!e.includes(t));if(q){Q({[q]:r})}if(t){const r={report:p,column:t,status:e.includes(t)?"on":"off"};Object(O.recordEvent)("analytics_table_header_toggle",r)}},onSort:(e,t)=>{Object(y.onQueryChange)("sort")(e,t);const r={report:p,column:e,direction:t};Object(O.recordEvent)("analytics_table_sort",r)},onPageChange:(e,t)=>{N.current.scrollIntoView();const r=N.current.nextSibling.querySelector(".woocommerce-table__table"),a=l.focus.focusable.find(r);a.length&&a[0].focus(),t&&("goto"===t?Object(O.recordEvent)("analytics_table_go_to_page",{report:p,page:e}):Object(O.recordEvent)("analytics_table_page_click",{report:p,direction:t}))},rows:$,rowsPerPage:parseInt(D.per_page,10)||h.QUERY_DEFAULTS.pageSize,summary:ee,totalRows:K},F)))};v.propTypes={baseSearchQuery:p.a.object,compareBy:p.a.string,compareParam:p.a.string,columnPrefsKey:p.a.string,endpoint:p.a.string,extendItemsMethodNames:p.a.shape({getError:p.a.string,isRequesting:p.a.string,load:p.a.string}),extendedItemsStoreName:p.a.string,getHeadersContent:p.a.func.isRequired,getRowsContent:p.a.func.isRequired,getSummary:p.a.func,itemIdField:p.a.string,labels:p.a.shape({compareButton:p.a.string,downloadButton:p.a.string,helpText:p.a.string,placeholder:p.a.string}),primaryData:p.a.object,searchBy:p.a.string,summaryFields:p.a.arrayOf(p.a.string),tableData:p.a.object.isRequired,tableQuery:p.a.object,title:p.a.string.isRequired},v.defaultProps={primaryData:{},tableData:{items:{data:[],totalResults:0},query:{}},tableQuery:{},compareParam:"filter",downloadable:!1,onSearch:m.noop,baseSearchQuery:{}};const S=[],k={};t.a=Object(i.compose)(Object(d.withSelect)((e,t)=>{const{endpoint:r,getSummary:a,isRequesting:o,itemIdField:c,query:n,tableData:s,tableQuery:i,filters:l,advancedFilters:d,summaryFields:u,extendedItemsStoreName:b}=t,p=e(h.REPORTS_STORE_NAME),_=b?e(b):null,{woocommerce_default_date_range:y}=e(h.SETTINGS_STORE_NAME).getSetting("wc_admin","wcAdminSettings");if(o)return k;const g="categories"===r?"products":r,O=a?Object(h.getReportChartData)({endpoint:g,selector:p,dataType:"primary",query:n,filters:l,advancedFilters:d,defaultDateRange:y,fields:u}):k,j=s||Object(h.getReportTableData)({endpoint:r,query:n,selector:p,tableQuery:i,filters:l,advancedFilters:d,defaultDateRange:y}),f=_?function(e,t,r){const{extendItemsMethodNames:a,itemIdField:o}=t,c=r.items.data;if(!(Array.isArray(c)&&c.length&&a&&o))return r;const{[a.getError]:n,[a.isRequesting]:s,[a.load]:i}=e,l={include:c.map(e=>e[o]).join(","),per_page:c.length},d=i(l),u=!!s&&s(l),b=!!n&&n(l),p=c.map(e=>{const t=Object(m.first)(d.filter(t=>e.id===t.id));return{...e,...t}}),_=r.isRequesting||u,y=r.isError||b;return{...r,isRequesting:_,isError:y,items:{...r.items,data:p}}}(_,t,j):j;return{primaryData:O,ids:c&&f.items.data?f.items.data.map(e=>e[c]):S,tableData:f,query:n}}),Object(d.withDispatch)(e=>{const{startExport:t}=e(h.EXPORT_STORE_NAME),{createNotice:r}=e("core/notices"),{addCesSurveyForCustomerSearch:a}=e(w.c);return{createNotice:r,startExport:t,addCesSurveyForCustomerSearch:a}}))(v)},515:function(e,t,r){}}]);woocommerce-admin/dist/chunks/analytics-report-downloads.js000064400000021155151335517650020254 0ustar00(window.__wcAdmin_webpackJsonp=window.__wcAdmin_webpackJsonp||[]).push([[10],{486:function(e,t,r){"use strict";r.r(t),r.d(t,"default",(function(){return A}));var o=r(0),c=r(1),a=r.n(c),n=r(536),d=r(2),l=r(7),m=r(4),i=r(9),s=r.n(i),u=r(21),b=r(12),_=r(120),p=r(13),w=r(11),f=r(19),O=r(506),j=r(501);class y extends o.Component{constructor(){super(),this.getHeadersContent=this.getHeadersContent.bind(this),this.getRowsContent=this.getRowsContent.bind(this),this.getSummary=this.getSummary.bind(this)}getHeadersContent(){return[{label:Object(d.__)("Date",'woocommerce'),key:"date",defaultSort:!0,required:!0,isLeftAligned:!0,isSortable:!0},{label:Object(d.__)("Product title",'woocommerce'),key:"product",isSortable:!0,required:!0},{label:Object(d.__)("File name",'woocommerce'),key:"file_name"},{label:Object(d.__)("Order #",'woocommerce'),screenReaderLabel:Object(d.__)("Order Number",'woocommerce'),key:"order_number"},{label:Object(d.__)("Username",'woocommerce'),key:"user_id"},{label:Object(d.__)("IP",'woocommerce'),key:"ip_address"}]}getRowsContent(e){const{query:t}=this.props,r=Object(b.getPersistedQuery)(t),c=Object(p.f)("dateFormat",f.defaultTableDateFormat);return Object(m.map)(e,e=>{const{_embedded:t,date:a,file_name:n,file_path:l,ip_address:m,order_id:i,order_number:s,product_id:_,username:w}=e,{code:f,name:O}=t.product[0];let j,y;if("woocommerce_rest_product_invalid_id"===f)j=Object(d.__)("(Deleted)",'woocommerce'),y=Object(d.__)("(Deleted)",'woocommerce');else{const e=Object(b.getNewPath)(r,"/analytics/products",{filter:"single_product",products:_});j=Object(o.createElement)(u.Link,{href:e,type:"wc-admin"},O),y=O}return[{display:Object(o.createElement)(u.Date,{date:a,visibleFormat:c}),value:a},{display:j,value:y},{display:Object(o.createElement)(u.Link,{href:l,type:"external"},n),value:n},{display:Object(o.createElement)(u.Link,{href:Object(p.e)(`post.php?post=${i}&action=edit`),type:"wp-admin"},s),value:s},{display:w,value:w},{display:m,value:m}]})}getSummary(e){const{download_count:t=0}=e,{query:r,defaultDateRange:o}=this.props,c=Object(f.getCurrentDates)(r,o),a=s()(c.primary.after),n=s()(c.primary.before).diff(a,"days")+1,l=this.context.getCurrencyConfig();return[{label:Object(d._n)("day","days",n,'woocommerce'),value:Object(_.formatValue)(l,"number",n)},{label:Object(d._n)("Download","Downloads",t,'woocommerce'),value:Object(_.formatValue)(l,"number",t)}]}render(){const{query:e,filters:t,advancedFilters:r}=this.props;return Object(o.createElement)(O.a,{endpoint:"downloads",getHeadersContent:this.getHeadersContent,getRowsContent:this.getRowsContent,getSummary:this.getSummary,summaryFields:["download_count"],query:e,tableQuery:{_embed:!0},title:Object(d.__)("Downloads",'woocommerce'),columnPrefsKey:"downloads_report_columns",filters:t,advancedFilters:r})}}y.contextType=j.a;var h=Object(l.withSelect)(e=>{const{woocommerce_default_date_range:t}=e(w.SETTINGS_STORE_NAME).getSetting("wc_admin","wcAdminSettings");return{defaultDateRange:t}})(y),v=r(510),g=r(508),S=r(511),E=r(505);class A extends o.Component{render(){const{query:e,path:t}=this.props;return Object(o.createElement)(o.Fragment,null,Object(o.createElement)(E.a,{query:e,path:t,filters:n.c,advancedFilters:n.a,report:"downloads"}),Object(o.createElement)(S.a,{charts:n.b,endpoint:"downloads",query:e,selectedChart:Object(v.a)(e.chart,n.b),filters:n.c,advancedFilters:n.a}),Object(o.createElement)(g.a,{charts:n.b,endpoint:"downloads",path:t,query:e,selectedChart:Object(v.a)(e.chart,n.b),filters:n.c,advancedFilters:n.a}),Object(o.createElement)(h,{query:e,filters:n.c,advancedFilters:n.a}))}}A.propTypes={query:a.a.object.isRequired}},502:function(e,t,r){"use strict";r.d(t,"e",(function(){return s})),r.d(t,"a",(function(){return u})),r.d(t,"b",(function(){return b})),r.d(t,"c",(function(){return _})),r.d(t,"d",(function(){return p})),r.d(t,"f",(function(){return w})),r.d(t,"h",(function(){return f})),r.d(t,"g",(function(){return O}));var o=r(15),c=r(17),a=r.n(c),n=r(4),d=r(12),l=r(11),m=r(13),i=r(503);function s(e,t=n.identity){return function(r="",c){const n="function"==typeof e?e(c):e,l=Object(d.getIdsFromQuery)(r);if(l.length<1)return Promise.resolve([]);const m={include:l.join(","),per_page:l.length};return a()({path:Object(o.addQueryArgs)(n,m)}).then(e=>e.map(t))}}s(l.NAMESPACE+"/products/attributes",e=>({key:e.id,label:e.name}));const u=s(l.NAMESPACE+"/products/categories",e=>({key:e.id,label:e.name})),b=s(l.NAMESPACE+"/coupons",e=>({key:e.id,label:e.code})),_=s(l.NAMESPACE+"/customers",e=>({key:e.id,label:e.name})),p=s(l.NAMESPACE+"/products",e=>({key:e.id,label:e.name})),w=s(l.NAMESPACE+"/taxes",e=>({key:e.id,label:Object(i.a)(e)}));function f({attributes:e,name:t}){const r=Object(m.f)("variationTitleAttributesSeparator"," - ");if(t&&t.indexOf(r)>-1)return t;const o=(e||[]).map(({option:e})=>e).join(", ");return o?t+r+o:t}const O=s(({products:e})=>e?l.NAMESPACE+`/products/${e}/variations`:l.NAMESPACE+"/variations",e=>({key:e.id,label:f(e)}))},503:function(e,t,r){"use strict";r.d(t,"a",(function(){return c}));var o=r(2);function c(e){return[e.country,e.state,e.name||Object(o.__)("TAX",'woocommerce'),e.priority].map(e=>e.toString().toUpperCase().trim()).filter(Boolean).join("-")}},536:function(e,t,r){"use strict";r.d(t,"b",(function(){return n})),r.d(t,"c",(function(){return d})),r.d(t,"a",(function(){return l}));var o=r(2),c=r(30),a=r(502);const n=Object(c.applyFilters)("woocommerce_admin_downloads_report_charts",[{key:"download_count",label:Object(o.__)("Downloads",'woocommerce'),type:"number"}]),d=Object(c.applyFilters)("woocommerce_admin_downloads_report_filters",[{label:Object(o.__)("Show",'woocommerce'),staticParams:["chartType","paged","per_page"],param:"filter",showFilters:()=>!0,filters:[{label:Object(o.__)("All downloads",'woocommerce'),value:"all"},{label:Object(o.__)("Advanced filters",'woocommerce'),value:"advanced"}]}]),l=Object(c.applyFilters)("woocommerce_admin_downloads_report_advanced_filters",{title:Object(o._x)("Downloads match {{select /}} filters","A sentence describing filters for Downloads. See screen shot for context: https://cloudup.com/ccxhyH2mEDg",'woocommerce'),filters:{product:{labels:{add:Object(o.__)("Product",'woocommerce'),placeholder:Object(o.__)("Search",'woocommerce'),remove:Object(o.__)("Remove product filter",'woocommerce'),rule:Object(o.__)("Select a product filter match",'woocommerce'),title:Object(o.__)("{{title}}Product{{/title}} {{rule /}} {{filter /}}",'woocommerce'),filter:Object(o.__)("Select product",'woocommerce')},rules:[{value:"includes",label:Object(o._x)("Includes","products",'woocommerce')},{value:"excludes",label:Object(o._x)("Excludes","products",'woocommerce')}],input:{component:"Search",type:"products",getLabels:a.d}},customer:{labels:{add:Object(o.__)("Username",'woocommerce'),placeholder:Object(o.__)("Search customer username",'woocommerce'),remove:Object(o.__)("Remove customer username filter",'woocommerce'),rule:Object(o.__)("Select a customer username filter match",'woocommerce'),title:Object(o.__)("{{title}}Username{{/title}} {{rule /}} {{filter /}}",'woocommerce'),filter:Object(o.__)("Select customer username",'woocommerce')},rules:[{value:"includes",label:Object(o._x)("Includes","customer usernames",'woocommerce')},{value:"excludes",label:Object(o._x)("Excludes","customer usernames",'woocommerce')}],input:{component:"Search",type:"usernames",getLabels:a.c}},order:{labels:{add:Object(o.__)("Order #",'woocommerce'),placeholder:Object(o.__)("Search order number",'woocommerce'),remove:Object(o.__)("Remove order number filter",'woocommerce'),rule:Object(o.__)("Select a order number filter match",'woocommerce'),title:Object(o.__)("{{title}}Order #{{/title}} {{rule /}} {{filter /}}",'woocommerce'),filter:Object(o.__)("Select order number",'woocommerce')},rules:[{value:"includes",label:Object(o._x)("Includes","order numbers",'woocommerce')},{value:"excludes",label:Object(o._x)("Excludes","order numbers",'woocommerce')}],input:{component:"Search",type:"orders",getLabels:async e=>{const t=e.split(",");return await t.map(e=>({id:e,label:"#"+e}))}}},ip_address:{labels:{add:Object(o.__)("IP Address",'woocommerce'),placeholder:Object(o.__)("Search IP address",'woocommerce'),remove:Object(o.__)("Remove IP address filter",'woocommerce'),rule:Object(o.__)("Select an IP address filter match",'woocommerce'),title:Object(o.__)("{{title}}IP Address{{/title}} {{rule /}} {{filter /}}",'woocommerce'),filter:Object(o.__)("Select IP address",'woocommerce')},rules:[{value:"includes",label:Object(o._x)("Includes","IP addresses",'woocommerce')},{value:"excludes",label:Object(o._x)("Excludes","IP addresses",'woocommerce')}],input:{component:"Search",type:"downloadIps",getLabels:async e=>{const t=e.split(",");return await t.map(e=>({id:e,label:e}))}}}}})}}]);woocommerce-admin/dist/tracks/index.js000064400000023442151335517650014070 0ustar00this.wc=this.wc||{},this.wc.tracks=function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=450)}({128:function(e,t){var n,r,o=e.exports={};function s(){throw new Error("setTimeout has not been defined")}function i(){throw new Error("clearTimeout has not been defined")}function c(e){if(n===setTimeout)return setTimeout(e,0);if((n===s||!n)&&setTimeout)return n=setTimeout,setTimeout(e,0);try{return n(e,0)}catch(t){try{return n.call(null,e,0)}catch(t){return n.call(this,e,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:s}catch(e){n=s}try{r="function"==typeof clearTimeout?clearTimeout:i}catch(e){r=i}}();var a,u=[],l=!1,f=-1;function d(){l&&a&&(l=!1,a.length?u=a.concat(u):f=-1,u.length&&C())}function C(){if(!l){var e=c(d);l=!0;for(var t=u.length;t;){for(a=u,u=[];++f<t;)a&&a[f].run();f=-1,t=u.length}a=null,l=!1,function(e){if(r===clearTimeout)return clearTimeout(e);if((r===i||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(e);try{r(e)}catch(t){try{return r.call(null,e)}catch(t){return r.call(this,e)}}}(e)}}function g(e,t){this.fun=e,this.array=t}function p(){}o.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];u.push(new g(e,t)),1!==u.length||l||c(C)},g.prototype.run=function(){this.fun.apply(null,this.array)},o.title="browser",o.browser=!0,o.env={},o.argv=[],o.version="",o.versions={},o.on=p,o.addListener=p,o.once=p,o.off=p,o.removeListener=p,o.removeAllListeners=p,o.emit=p,o.prependListener=p,o.prependOnceListener=p,o.listeners=function(e){return[]},o.binding=function(e){throw new Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(e){throw new Error("process.chdir is not supported")},o.umask=function(){return 0}},268:function(e,t,n){(function(r){t.formatArgs=function(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const n="color: "+this.color;t.splice(1,0,n,"color: inherit");let r=0,o=0;t[0].replace(/%[a-zA-Z%]/g,e=>{"%%"!==e&&(r++,"%c"===e&&(o=r))}),t.splice(o,0,n)},t.save=function(e){try{e?t.storage.setItem("debug",e):t.storage.removeItem("debug")}catch(e){}},t.load=function(){let e;try{e=t.storage.getItem("debug")}catch(e){}!e&&void 0!==r&&"env"in r&&(e=r.env.DEBUG);return e},t.useColors=function(){if("undefined"!=typeof window&&window.process&&("renderer"===window.process.type||window.process.__nwjs))return!0;if("undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;return"undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},t.storage=function(){try{return localStorage}catch(e){}}(),t.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],t.log=console.debug||console.log||(()=>{}),e.exports=n(451)(t);const{formatters:o}=e.exports;o.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}}).call(this,n(128))},450:function(e,t,n){"use strict";n.r(t),n.d(t,"recordEvent",(function(){return s})),n.d(t,"queueRecordEvent",(function(){return c})),n.d(t,"recordPageView",(function(){return a}));var r=n(268);const o=n.n(r)()("wc-admin:tracks");function s(e,t){if(o("recordevent %s %o","wcadmin_"+e,t,{_tqk:window._tkq,shouldRecord:!!window._tkq&&!!window.wcTracks&&!!window.wcTracks.isEnabled}),!window.wcTracks||"function"!=typeof window.wcTracks.recordEvent)return!1;window.wcTracks.recordEvent(e,t)}const i={localStorageKey:()=>"tracksQueue",clear(){window.localStorage&&window.localStorage.removeItem(i.localStorageKey())},get(){if(!window.localStorage)return[];let e=window.localStorage.getItem(i.localStorageKey());return e=e?JSON.parse(e):[],e=Array.isArray(e)?e:[],e},add(...e){if(!window.localStorage)return o("Unable to queue, running now",{args:e}),void s.apply(null,e||void 0);let t=i.get();const n={args:e};t.push(n),t=t.slice(-100),o("Adding new item to queue.",n),window.localStorage.setItem(i.localStorageKey(),JSON.stringify(t))},process(){if(!window.localStorage)return;const e=i.get();i.clear(),o("Processing items in queue.",e),e.forEach(e=>{"object"==typeof e&&(o("Processing item in queue.",e),s.apply(null,e.args||void 0))})}};function c(e,t){i.add(e,t)}function a(e,t){e&&(s("page_view",{path:e,...t}),i.process())}},451:function(e,t,n){e.exports=function(e){function t(e){let n,o=null;function s(...e){if(!s.enabled)return;const r=s,o=Number(new Date),i=o-(n||o);r.diff=i,r.prev=n,r.curr=o,n=o,e[0]=t.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");let c=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,(n,o)=>{if("%%"===n)return"%";c++;const s=t.formatters[o];if("function"==typeof s){const t=e[c];n=s.call(r,t),e.splice(c,1),c--}return n}),t.formatArgs.call(r,e);(r.log||t.log).apply(r,e)}return s.namespace=e,s.useColors=t.useColors(),s.color=t.selectColor(e),s.extend=r,s.destroy=t.destroy,Object.defineProperty(s,"enabled",{enumerable:!0,configurable:!1,get:()=>null===o?t.enabled(e):o,set:e=>{o=e}}),"function"==typeof t.init&&t.init(s),s}function r(e,n){const r=t(this.namespace+(void 0===n?":":n)+e);return r.log=this.log,r}function o(e){return e.toString().substring(2,e.toString().length-2).replace(/\.\*\?$/,"*")}return t.debug=t,t.default=t,t.coerce=function(e){if(e instanceof Error)return e.stack||e.message;return e},t.disable=function(){const e=[...t.names.map(o),...t.skips.map(o).map(e=>"-"+e)].join(",");return t.enable(""),e},t.enable=function(e){let n;t.save(e),t.names=[],t.skips=[];const r=("string"==typeof e?e:"").split(/[\s,]+/),o=r.length;for(n=0;n<o;n++)r[n]&&("-"===(e=r[n].replace(/\*/g,".*?"))[0]?t.skips.push(new RegExp("^"+e.substr(1)+"$")):t.names.push(new RegExp("^"+e+"$")))},t.enabled=function(e){if("*"===e[e.length-1])return!0;let n,r;for(n=0,r=t.skips.length;n<r;n++)if(t.skips[n].test(e))return!1;for(n=0,r=t.names.length;n<r;n++)if(t.names[n].test(e))return!0;return!1},t.humanize=n(452),t.destroy=function(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")},Object.keys(e).forEach(n=>{t[n]=e[n]}),t.names=[],t.skips=[],t.formatters={},t.selectColor=function(e){let n=0;for(let t=0;t<e.length;t++)n=(n<<5)-n+e.charCodeAt(t),n|=0;return t.colors[Math.abs(n)%t.colors.length]},t.enable(t.load()),t}},452:function(e,t){var n=1e3,r=6e4,o=60*r,s=24*o;function i(e,t,n,r){var o=t>=1.5*n;return Math.round(e/n)+" "+r+(o?"s":"")}e.exports=function(e,t){t=t||{};var c=typeof e;if("string"===c&&e.length>0)return function(e){if((e=String(e)).length>100)return;var t=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(!t)return;var i=parseFloat(t[1]);switch((t[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return 315576e5*i;case"weeks":case"week":case"w":return 6048e5*i;case"days":case"day":case"d":return i*s;case"hours":case"hour":case"hrs":case"hr":case"h":return i*o;case"minutes":case"minute":case"mins":case"min":case"m":return i*r;case"seconds":case"second":case"secs":case"sec":case"s":return i*n;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return i;default:return}}(e);if("number"===c&&isFinite(e))return t.long?function(e){var t=Math.abs(e);if(t>=s)return i(e,t,s,"day");if(t>=o)return i(e,t,o,"hour");if(t>=r)return i(e,t,r,"minute");if(t>=n)return i(e,t,n,"second");return e+" ms"}(e):function(e){var t=Math.abs(e);if(t>=s)return Math.round(e/s)+"d";if(t>=o)return Math.round(e/o)+"h";if(t>=r)return Math.round(e/r)+"m";if(t>=n)return Math.round(e/n)+"s";return e+"ms"}(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))}}});woocommerce-admin/dist/tracks/index.asset.php000064400000000137151335517650015355 0ustar00<?php return array('dependencies' => array(), 'version' => '7a2a026afeeff2c451e1332c64bfaa93');woocommerce-admin/dist/payment-recommendations/style-rtl.css000064400000005262151335517650020447 0ustar00:root{--wp-admin-theme-color:#007cba;--wp-admin-theme-color-darker-10:#006ba1;--wp-admin-theme-color-darker-20:#005a87}body.admin-color-light{--wp-admin-theme-color:#0085ba;--wp-admin-theme-color-darker-10:#0073a1;--wp-admin-theme-color-darker-20:#006187}body.admin-color-modern{--wp-admin-theme-color:#3858e9;--wp-admin-theme-color-darker-10:#2145e6;--wp-admin-theme-color-darker-20:#183ad6}body.admin-color-blue{--wp-admin-theme-color:#096484;--wp-admin-theme-color-darker-10:#07526c;--wp-admin-theme-color-darker-20:#064054}body.admin-color-coffee{--wp-admin-theme-color:#46403c;--wp-admin-theme-color-darker-10:#383330;--wp-admin-theme-color-darker-20:#2b2724}body.admin-color-ectoplasm{--wp-admin-theme-color:#523f6d;--wp-admin-theme-color-darker-10:#46365d;--wp-admin-theme-color-darker-20:#3a2c4d}body.admin-color-midnight{--wp-admin-theme-color:#e14d43;--wp-admin-theme-color-darker-10:#dd382d;--wp-admin-theme-color-darker-20:#d02c21}body.admin-color-ocean{--wp-admin-theme-color:#627c83;--wp-admin-theme-color-darker-10:#576e74;--wp-admin-theme-color-darker-20:#4c6066}body.admin-color-sunrise{--wp-admin-theme-color:#dd823b;--wp-admin-theme-color-darker-10:#d97426;--wp-admin-theme-color-darker-20:#c36922}.woocommerce-recommended-payments-card{margin:0 0 10px 15px;animation:isLoaded;animation-duration:.25s}.woocommerce-recommended-payments-card .woocommerce-list__item>.woocommerce-list__item-inner{align-items:flex-start}.woocommerce-recommended-payments-card .woocommerce-list__item:hover{background-color:#fff}.woocommerce-recommended-payments-card .woocommerce-list__item:hover .woocommerce-list__item-title{color:#1e1e1e}.woocommerce-recommended-payments-card .woocommerce-list__item-title{font-size:14px;color:#1e1e1e;font-weight:600}.woocommerce-recommended-payments-card .woocommerce-review-activity-card__section-controls{text-align:center}.woocommerce-recommended-payments-card .woocommerce-pill{margin-right:4px;padding:2px 8px}@media(max-width:480px){.woocommerce-recommended-payments-card .woocommerce-pill{margin-top:4px;margin-bottom:4px}}.woocommerce-recommended-payments-card .components-card__footer .gridicon{margin-right:4px}.woocommerce-recommended-payments-card .woocommerce-list__item-enter{opacity:0;max-height:100vh;transform:none}.woocommerce-recommended-payments-card .woocommerce-list__item-enter-active{opacity:1;transition:opacity .2s}.woocommerce-recommended-payments-card .woocommerce-list__item-after .components-button{margin-right:12px}.woocommerce-recommended-payments-card .woocommerce-list__item-text,.woocommerce-recommended-payments-card .woocommerce-recommended-payments__header-heading{max-width:749px}@media(max-width:782px){.woocommerce-recommended-payments-card{margin:0 0 10px}}woocommerce-admin/dist/analytics-report-orders/style-rtl.css000064400000002544151335517650020401 0ustar00:root{--wp-admin-theme-color:#007cba;--wp-admin-theme-color-darker-10:#006ba1;--wp-admin-theme-color-darker-20:#005a87}body.admin-color-light{--wp-admin-theme-color:#0085ba;--wp-admin-theme-color-darker-10:#0073a1;--wp-admin-theme-color-darker-20:#006187}body.admin-color-modern{--wp-admin-theme-color:#3858e9;--wp-admin-theme-color-darker-10:#2145e6;--wp-admin-theme-color-darker-20:#183ad6}body.admin-color-blue{--wp-admin-theme-color:#096484;--wp-admin-theme-color-darker-10:#07526c;--wp-admin-theme-color-darker-20:#064054}body.admin-color-coffee{--wp-admin-theme-color:#46403c;--wp-admin-theme-color-darker-10:#383330;--wp-admin-theme-color-darker-20:#2b2724}body.admin-color-ectoplasm{--wp-admin-theme-color:#523f6d;--wp-admin-theme-color-darker-10:#46365d;--wp-admin-theme-color-darker-20:#3a2c4d}body.admin-color-midnight{--wp-admin-theme-color:#e14d43;--wp-admin-theme-color-darker-10:#dd382d;--wp-admin-theme-color-darker-20:#d02c21}body.admin-color-ocean{--wp-admin-theme-color:#627c83;--wp-admin-theme-color-darker-10:#576e74;--wp-admin-theme-color-darker-20:#4c6066}body.admin-color-sunrise{--wp-admin-theme-color:#dd823b;--wp-admin-theme-color-darker-10:#d97426;--wp-admin-theme-color-darker-20:#c36922}.woocommerce-orders-table__status{flex-direction:row-reverse}.woocommerce-orders-table__status .woocommerce-order-status__indicator{margin-left:0;margin-right:8px}woocommerce-admin/dist/navigation-opt-out/style.css000064400000002557151335517650016556 0ustar00:root{--wp-admin-theme-color:#007cba;--wp-admin-theme-color-darker-10:#006ba1;--wp-admin-theme-color-darker-20:#005a87}body.admin-color-light{--wp-admin-theme-color:#0085ba;--wp-admin-theme-color-darker-10:#0073a1;--wp-admin-theme-color-darker-20:#006187}body.admin-color-modern{--wp-admin-theme-color:#3858e9;--wp-admin-theme-color-darker-10:#2145e6;--wp-admin-theme-color-darker-20:#183ad6}body.admin-color-blue{--wp-admin-theme-color:#096484;--wp-admin-theme-color-darker-10:#07526c;--wp-admin-theme-color-darker-20:#064054}body.admin-color-coffee{--wp-admin-theme-color:#46403c;--wp-admin-theme-color-darker-10:#383330;--wp-admin-theme-color-darker-20:#2b2724}body.admin-color-ectoplasm{--wp-admin-theme-color:#523f6d;--wp-admin-theme-color-darker-10:#46365d;--wp-admin-theme-color-darker-20:#3a2c4d}body.admin-color-midnight{--wp-admin-theme-color:#e14d43;--wp-admin-theme-color-darker-10:#dd382d;--wp-admin-theme-color-darker-20:#d02c21}body.admin-color-ocean{--wp-admin-theme-color:#627c83;--wp-admin-theme-color-darker-10:#576e74;--wp-admin-theme-color-darker-20:#4c6066}body.admin-color-sunrise{--wp-admin-theme-color:#dd823b;--wp-admin-theme-color-darker-10:#d97426;--wp-admin-theme-color-darker-20:#c36922}.woocommerce-navigation-opt-out-modal__actions{text-align:right;margin-top:24px}.woocommerce-navigation-opt-out-modal__actions .components-button.is-primary{margin-left:16px}woocommerce-admin/dist/navigation-opt-out/style-rtl.css000064400000002557151335517650017355 0ustar00:root{--wp-admin-theme-color:#007cba;--wp-admin-theme-color-darker-10:#006ba1;--wp-admin-theme-color-darker-20:#005a87}body.admin-color-light{--wp-admin-theme-color:#0085ba;--wp-admin-theme-color-darker-10:#0073a1;--wp-admin-theme-color-darker-20:#006187}body.admin-color-modern{--wp-admin-theme-color:#3858e9;--wp-admin-theme-color-darker-10:#2145e6;--wp-admin-theme-color-darker-20:#183ad6}body.admin-color-blue{--wp-admin-theme-color:#096484;--wp-admin-theme-color-darker-10:#07526c;--wp-admin-theme-color-darker-20:#064054}body.admin-color-coffee{--wp-admin-theme-color:#46403c;--wp-admin-theme-color-darker-10:#383330;--wp-admin-theme-color-darker-20:#2b2724}body.admin-color-ectoplasm{--wp-admin-theme-color:#523f6d;--wp-admin-theme-color-darker-10:#46365d;--wp-admin-theme-color-darker-20:#3a2c4d}body.admin-color-midnight{--wp-admin-theme-color:#e14d43;--wp-admin-theme-color-darker-10:#dd382d;--wp-admin-theme-color-darker-20:#d02c21}body.admin-color-ocean{--wp-admin-theme-color:#627c83;--wp-admin-theme-color-darker-10:#576e74;--wp-admin-theme-color-darker-20:#4c6066}body.admin-color-sunrise{--wp-admin-theme-color:#dd823b;--wp-admin-theme-color-darker-10:#d97426;--wp-admin-theme-color-darker-20:#c36922}.woocommerce-navigation-opt-out-modal__actions{text-align:left;margin-top:24px}.woocommerce-navigation-opt-out-modal__actions .components-button.is-primary{margin-right:16px}woocommerce-admin/dist/analytics-report/style-rtl.css000064400000002714151335517650017104 0ustar00:root{--wp-admin-theme-color:#007cba;--wp-admin-theme-color-darker-10:#006ba1;--wp-admin-theme-color-darker-20:#005a87}body.admin-color-light{--wp-admin-theme-color:#0085ba;--wp-admin-theme-color-darker-10:#0073a1;--wp-admin-theme-color-darker-20:#006187}body.admin-color-modern{--wp-admin-theme-color:#3858e9;--wp-admin-theme-color-darker-10:#2145e6;--wp-admin-theme-color-darker-20:#183ad6}body.admin-color-blue{--wp-admin-theme-color:#096484;--wp-admin-theme-color-darker-10:#07526c;--wp-admin-theme-color-darker-20:#064054}body.admin-color-coffee{--wp-admin-theme-color:#46403c;--wp-admin-theme-color-darker-10:#383330;--wp-admin-theme-color-darker-20:#2b2724}body.admin-color-ectoplasm{--wp-admin-theme-color:#523f6d;--wp-admin-theme-color-darker-10:#46365d;--wp-admin-theme-color-darker-20:#3a2c4d}body.admin-color-midnight{--wp-admin-theme-color:#e14d43;--wp-admin-theme-color-darker-10:#dd382d;--wp-admin-theme-color-darker-20:#d02c21}body.admin-color-ocean{--wp-admin-theme-color:#627c83;--wp-admin-theme-color-darker-10:#576e74;--wp-admin-theme-color-darker-20:#4c6066}body.admin-color-sunrise{--wp-admin-theme-color:#dd823b;--wp-admin-theme-color-darker-10:#d97426;--wp-admin-theme-color-darker-20:#c36922}.woocommerce-analytics__table-placeholder .woocommerce-card__body{padding:0}.woocommerce-analytics__table-placeholder .woocommerce-table__table{margin-bottom:0}.woocommerce-analytics__table-placeholder .woocommerce-table__table tr:last-child{border-bottom-style:none}woocommerce-admin/dist/task-list/style-rtl.css000064400000016702151335517650015521 0ustar00.woocommerce-task-marketing .components-card__header{flex-direction:column;align-items:flex-start;display:flex!important}.woocommerce-task-marketing .components-card__header h2{align-self:start!important;color:#1e1e1e;font-size:20px;margin-bottom:0}.woocommerce-task-marketing .components-card__header span{margin-right:0;margin-top:8px;color:#757575}.woocommerce-plugin-list__plugin{display:flex;padding:24px;border-top:1px solid #e0e0e0}.woocommerce-plugin-list__plugin:first-child{border-top:0}.woocommerce-plugin-list__plugin h4{margin-bottom:12px;font-weight:600;color:#1e1e1e}.woocommerce-plugin-list__plugin p{color:#757575;font-weight:400}.woocommerce-plugin-list__plugin-logo{margin-left:45px;display:flex;align-items:center}.woocommerce-plugin-list__plugin-logo img{width:50px}.woocommerce-plugin-list__plugin-text{max-width:370px;margin-left:16px}.woocommerce-plugin-list__plugin-action{display:flex;align-items:center;margin-right:auto}.woocommerce-plugin-list__title{padding:12px 30px;background:#e0e0e0;position:relative}.woocommerce-plugin-list__title h3{font-weight:500;color:#000}@media(min-width:601px){.woocommerce-product-template-modal{min-width:565px}}.woocommerce-product-template-modal .woocommerce-product-template-modal__actions{padding-top:24px}.woocommerce-product-template-modal__list .components-base-control{margin:0 -24px}.woocommerce-product-template-modal__list .components-base-control .components-base-control__field .components-radio-control__option{display:flex;text-decoration:none;width:100%;align-items:center;padding:16px 24px;margin-bottom:0;box-sizing:border-box;border-bottom:1px solid #f0f0f0}.woocommerce-product-template-modal__list .components-base-control .components-base-control__field .components-radio-control__option:first-child{border-top:1px solid #f0f0f0}.woocommerce-product-template-modal__list .components-base-control .components-base-control__field .components-radio-control__option .components-radio-control__input{margin-left:16px;flex:none}.woocommerce-product-template-modal__list .components-base-control .components-base-control__field .components-radio-control__option .components-radio-control__input:checked:before{box-sizing:border-box}.woocommerce-product-template-modal__list .components-base-control .components-base-control__field .components-radio-control__option .components-radio-control__input:focus{box-shadow:none}.woocommerce-product-template-modal__list .woocommerce-product-template-modal__list-title{color:#1e1e1e;display:block}.woocommerce-product-template-modal__list .woocommerce-product-template-modal__list-subtitle{color:#757575;margin-top:4px;display:block}.woocommerce-product-template-modal__actions{text-align:left}.woocommerce-task-payment{display:flex;flex-direction:row;align-items:center;position:relative;overflow:hidden}.woocommerce-task-payment .components-card__media{width:170px;flex-shrink:0}.woocommerce-task-payment .components-card__media .is-placeholder,.woocommerce-task-payment .components-card__media img,.woocommerce-task-payment .components-card__media svg{margin:auto;max-width:100px;display:block}.woocommerce-task-payment .components-card__media .is-placeholder{height:36px}.woocommerce-task-payment .woocommerce-task-payment__footer .is-placeholder{width:70px;height:36px}.woocommerce-task-payment>.components-form-toggle{min-width:52px}.woocommerce-task-payment .woocommerce-task-payment__title{display:flex;align-items:center;font-size:16px;font-weight:500;color:#2c3338;margin-top:0;margin-bottom:8px}.woocommerce-task-payment .woocommerce-task-payment__content{font-size:14px;color:#50575e;margin:0 0 0 36px}.woocommerce-task-payment .woocommerce-task-payment__content .text-style-strong{font-weight:700}.woocommerce-task-payment .woocommerce-task-payment__content p{font-size:12px}.woocommerce-task-payment .woocommerce-task-payment__description{flex:1}@media(max-width:600px){.woocommerce-task-payment{flex-wrap:wrap}.woocommerce-task-payment .woocommerce-task-payment__content{margin:0}.woocommerce-task-payment .components-card__media{order:1;flex-basis:50%}.woocommerce-task-payment .components-card__media>img,.woocommerce-task-payment .components-card__media>svg{margin:0 24px 0 0}.woocommerce-task-payment .woocommerce-task-payment__description{order:3;padding:24px 24px 0 0}.woocommerce-task-payment .woocommerce-task-payment__footer{flex-basis:50%;align-self:flex-start;order:2;text-align:left}}.woocommerce-payment-gateway-suggestions-list-placeholder .is-placeholder{animation:loading-fade 1.6s ease-in-out infinite;background-color:#f0f0f0;color:transparent;display:inline-block;max-width:240px;width:80%}.woocommerce-payment-gateway-suggestions-list-placeholder .is-placeholder:after{content:" "}@media screen and (prefers-reduced-motion:reduce){.woocommerce-payment-gateway-suggestions-list-placeholder .is-placeholder{animation:none}}.woocommerce-task-payment-method.is-loading .woocommerce-stepper__step-label{animation:loading-fade 1.6s ease-in-out infinite;background-color:#f0f0f0;color:transparent;display:inline-block;width:60%}.woocommerce-task-payment-method.is-loading .woocommerce-stepper__step-label:after{content:" "}@media screen and (prefers-reduced-motion:reduce){.woocommerce-task-payment-method.is-loading .woocommerce-stepper__step-label{animation:none}}.woocommerce-task-payment-method.is-loading .woocommerce-stepper__step-icon{animation:loading-fade 1.6s ease-in-out infinite;background-color:#f0f0f0;color:transparent}.woocommerce-task-payment-method.is-loading .woocommerce-stepper__step-icon:after{content:" "}@media screen and (prefers-reduced-motion:reduce){.woocommerce-task-payment-method.is-loading .woocommerce-stepper__step-icon{animation:none}}.woocommerce-task-payment-method.is-loading .woocommerce-stepper__step:first-child .woocommerce-stepper__step-label{width:30%}.woocommerce-task-payment-method.is-loading .woocommerce-stepper__step-number{display:none}:root{--wp-admin-theme-color:#007cba;--wp-admin-theme-color-darker-10:#006ba1;--wp-admin-theme-color-darker-20:#005a87}body.admin-color-light{--wp-admin-theme-color:#0085ba;--wp-admin-theme-color-darker-10:#0073a1;--wp-admin-theme-color-darker-20:#006187}body.admin-color-modern{--wp-admin-theme-color:#3858e9;--wp-admin-theme-color-darker-10:#2145e6;--wp-admin-theme-color-darker-20:#183ad6}body.admin-color-blue{--wp-admin-theme-color:#096484;--wp-admin-theme-color-darker-10:#07526c;--wp-admin-theme-color-darker-20:#064054}body.admin-color-coffee{--wp-admin-theme-color:#46403c;--wp-admin-theme-color-darker-10:#383330;--wp-admin-theme-color-darker-20:#2b2724}body.admin-color-ectoplasm{--wp-admin-theme-color:#523f6d;--wp-admin-theme-color-darker-10:#46365d;--wp-admin-theme-color-darker-20:#3a2c4d}body.admin-color-midnight{--wp-admin-theme-color:#e14d43;--wp-admin-theme-color-darker-10:#dd382d;--wp-admin-theme-color-darker-20:#d02c21}body.admin-color-ocean{--wp-admin-theme-color:#627c83;--wp-admin-theme-color-darker-10:#576e74;--wp-admin-theme-color-darker-20:#4c6066}body.admin-color-sunrise{--wp-admin-theme-color:#dd823b;--wp-admin-theme-color-darker-10:#d97426;--wp-admin-theme-color-darker-20:#c36922}.woocommerce-task-list__item{overflow:hidden}.woocommerce-task-list__item.woocommerce-list__item-enter{opacity:0;max-height:0}.woocommerce-task-list__item.woocommerce-list__item-enter-active{opacity:1;max-height:100px;transition:opacity .5s,max-height .5s}.woocommerce-task-list__item.woocommerce-list__item-exit{opacity:1;max-height:100px}.woocommerce-task-list__item.woocommerce-list__item-exit-active{opacity:0;max-height:0;transition:opacity .5s,max-height .5s}woocommerce-admin/dist/homescreen/style-rtl.css000064400000114440151335517650015734 0ustar00.woocommerce-layout__activity-panel-header{height:50px;background:#e0e0e0;padding:16px;display:flex;justify-content:space-between;align-items:center}@media(min-width:783px){.woocommerce-layout__activity-panel-header{padding:16px 24px}}.woocommerce-layout__activity-panel-header h3{font-size:13px;font-weight:600;line-height:16px;margin:0;padding:0}.woocommerce-layout__activity-panel-header .woocommerce-ellipsis-menu__toggle.components-button:not(:disabled):not([aria-disabled=true]):focus,.woocommerce-layout__activity-panel-header .woocommerce-ellipsis-menu__toggle.components-button:not(:disabled):not([aria-disabled=true]):hover{box-shadow:none;border-radius:10px;background:#ccc}.woocommerce-layout__inbox-title{color:#1e1e1e;display:flex;align-items:center}.woocommerce-layout__inbox-subtitle{color:#757575}.woocommerce-layout__inbox-badge{margin-right:6px;background-color:#757575;border-radius:13px;padding:0 6px;color:#fff;display:inline-block;text-align:center;vertical-align:top}.woocommerce-homescreen .woocommerce-activity-panel{background:transparent;border:0}.woocommerce-homescreen .woocommerce-activity-panel .components-panel__body{background:#fff;border:1px solid #e0e0e0}.woocommerce-homescreen .woocommerce-activity-panel .components-panel__body.is-opened{margin-bottom:24px}.woocommerce-homescreen .woocommerce-activity-panel.components-panel>.components-panel__body:last-child,.woocommerce-homescreen .woocommerce-activity-panel .components-panel__body.is-opened .components-panel__body-toggle{border-bottom:1px solid #e0e0e0}.woocommerce-homescreen .woocommerce-activity-panel .components-panel__row{margin:0 -16px -16px}.woocommerce-homescreen .woocommerce-activity-panel .components-panel__row>div{width:100%}.woocommerce-homescreen .woocommerce-activity-panel .components-panel__body-toggle{border-radius:0}.woocommerce-homescreen .woocommerce-activity-panel .components-panel__body-toggle:disabled{opacity:1}.woocommerce-homescreen .woocommerce-activity-panel .woocommerce-activity-panel{margin-bottom:24px}.woocommerce-homescreen .woocommerce-activity-panel .components-panel__body-title p{margin-left:16px}.woocommerce-homescreen .woocommerce-activity-panel .woocommerce-activity-card{padding:20px var(--main-gap) var(--main-gap)}.woocommerce-homescreen .woocommerce-activity-panel .woocommerce-activity-card:not(:last-of-type){border-bottom:1px solid #e0e0e0}.woocommerce-homescreen .woocommerce-activity-panel .woocommerce-activity-card__header{margin-bottom:12px}.woocommerce-homescreen .woocommerce-activity-panel .woocommerce-empty-activity-card{margin:0;background:unset;text-align:center;padding:24px var(--main-gap) 4px}.woocommerce-homescreen .woocommerce-activity-panel .woocommerce-empty-activity-card h4{color:#1e1e1e}.woocommerce-homescreen .woocommerce-activity-panel .woocommerce-layout__activity-panel-outbound-link{display:flex;justify-content:space-between;align-items:center;height:50px;border-bottom:1px solid #f0f0f0;padding:16px 24px;padding:16px var(--main-gap);font-size:13px;font-weight:500;line-height:18px;margin:0;text-decoration:none}.woocommerce-homescreen .woocommerce-activity-panel .woocommerce-layout__activity-panel-outbound-link .gridicon{display:none}.woocommerce-homescreen .woocommerce-activity-panel .woocommerce-layout__activity-panel-outbound-link:active,.woocommerce-homescreen .woocommerce-activity-panel .woocommerce-layout__activity-panel-outbound-link:hover{background-color:#f0f0f0}.woocommerce-homescreen .woocommerce-activity-panel .woocommerce-layout__activity-panel-outbound-link:focus{background-color:#f0f0f0;box-shadow:inset 0 0 0 1px #5b9dd9,inset 0 0 0 2px #f0f0f0}.woocommerce-homescreen .woocommerce-activity-panel .woocommerce-layout__activity-panel-outbound-link:active .gridicon,.woocommerce-homescreen .woocommerce-activity-panel .woocommerce-layout__activity-panel-outbound-link:focus .gridicon,.woocommerce-homescreen .woocommerce-activity-panel .woocommerce-layout__activity-panel-outbound-link:hover .gridicon{display:initial}.woocommerce-homescreen .woocommerce-activity-panel .woocommerce-layout__activity-panel-empty{border-top:1px solid #e0e0e0;border-bottom:0}.woocommerce-homescreen .woocommerce-activity-panel .woocommerce-activity-card__button:focus{box-shadow:unset;outline:unset;border:1px solid #e0e0e0}.woocommerce-activity-panel .woocommerce-activity-card{position:relative;padding:24px;padding:var(--main-gap);background:#fff;border-bottom:1px solid #e0e0e0;color:#757575;font-size:13px;font-size:.8125rem}.woocommerce-activity-panel .woocommerce-activity-card:not(.woocommerce-empty-activity-card){display:grid;grid-template-columns:50px 1fr;grid-template-areas:"icon header" "icon body" "icon actions"}.woocommerce-activity-panel .woocommerce-activity-card__button{display:block;height:unset;background:none;align-items:unset;transition:unset;text-align:right;width:100%;padding:0}.woocommerce-activity-card__unread{position:absolute;top:18px;top:calc(var(--main-gap) - 6px);left:18px;left:calc(var(--main-gap) - 6px);width:6px;height:6px;border-radius:50%;background:#ca4a1f}.woocommerce-activity-card__icon{-ms-grid-row:1;-ms-grid-row-span:3;-ms-grid-column:1;grid-area:icon;fill:#e0e0e0}.woocommerce-activity-card__header{margin-bottom:16px;display:flex;flex-direction:column}.woocommerce-activity-card__header .woocommerce-activity-card__title{margin:0;font-size:14px;font-size:.875rem;order:2}.woocommerce-empty-activity-card .woocommerce-activity-card__header .woocommerce-activity-card__title{color:#1e1e1e;font-style:normal;line-height:24px;font-weight:400}.woocommerce-activity-card__button .woocommerce-activity-card__header .woocommerce-activity-card__title{margin-bottom:8px}.woocommerce-activity-card__header .woocommerce-activity-card__title a{text-decoration:none}.woocommerce-activity-card__header .woocommerce-activity-card__date{color:#757575;font-size:12px;font-size:.75rem;margin-bottom:12px;order:1}.woocommerce-activity-card__header .woocommerce-activity-card__subtitle{order:3}.woocommerce-activity-card__button .woocommerce-activity-card__header .woocommerce-activity-card__subtitle{margin-bottom:4px}@media(min-width:783px){.woocommerce-activity-card__header{-ms-grid-row:1;-ms-grid-column:2;grid-area:header;display:grid;grid-template:"title date" "subtitle date"/1fr auto}.woocommerce-activity-panel .woocommerce-activity-card.woocommerce-order-activity-card>.woocommerce-activity-card__header{-ms-grid-row:1;-ms-grid-column:1}.woocommerce-activity-card__header .woocommerce-activity-card__title{grid-area:title}.woocommerce-activity-card__header .woocommerce-activity-card__date{display:block;grid-area:date;justify-self:end;margin-bottom:0}.woocommerce-activity-card__header .woocommerce-activity-card__subtitle{grid-area:subtitle}}@media (min-width:783px){.woocommerce-activity-card__header .woocommerce-activity-card__title{-ms-grid-row:1;-ms-grid-column:1}.woocommerce-activity-card__header .woocommerce-activity-card__date{-ms-grid-row:1;-ms-grid-row-span:2;-ms-grid-column:2}.woocommerce-activity-card__header .woocommerce-activity-card__subtitle{-ms-grid-row:2;-ms-grid-column:1}}.woocommerce-activity-card__body{-ms-grid-row:2;-ms-grid-column:2;grid-area:body}.woocommerce-activity-panel .woocommerce-activity-card.woocommerce-order-activity-card>.woocommerce-activity-card__body{-ms-grid-row:2;-ms-grid-column:1}.woocommerce-activity-card__body>p:first-child{margin-top:0}.woocommerce-activity-card__body>p:last-child{margin-bottom:0}.woocommerce-empty-activity-card .woocommerce-activity-card__body{color:#757575;font-style:normal;font-weight:400;font-size:13px;font-size:.8125rem;line-height:20px}.woocommerce-activity-card__actions{-ms-grid-row:3;-ms-grid-column:2;grid-area:actions;margin-top:16px}.woocommerce-activity-panel .woocommerce-activity-card.woocommerce-order-activity-card>.woocommerce-activity-card__actions{-ms-grid-row:3;-ms-grid-column:1}.woocommerce-activity-card__actions>*+*{margin-right:.5em}.woocommerce-activity-card__actions .components-button{height:24px;padding:4px 10px;font-size:11px;font-size:.6875rem}.woocommerce-activity-card__actions .components-button.is-destructive:not(:hover){box-shadow:none}.woocommerce-activity-card.is-loading .is-placeholder{animation:loading-fade 1.6s ease-in-out infinite;background-color:#f0f0f0;color:transparent;display:inline-block;height:16px}.woocommerce-activity-card.is-loading .is-placeholder:after{content:" "}@media screen and (prefers-reduced-motion:reduce){.woocommerce-activity-card.is-loading .is-placeholder{animation:none}}.woocommerce-activity-card.is-loading .woocommerce-activity-card__title{width:80%}.woocommerce-activity-card.is-loading .woocommerce-activity-card__subtitle{margin-top:4px}.woocommerce-activity-card.is-loading .woocommerce-activity-card__date{width:100%;margin-bottom:16px}@media(min-width:783px){.woocommerce-activity-card.is-loading .woocommerce-activity-card__date{text-align:left;margin-bottom:0}}.woocommerce-activity-card.is-loading .woocommerce-activity-card__date .is-placeholder{width:68px}.woocommerce-activity-card.is-loading .woocommerce-activity-card__icon{margin-left:24px;margin-left:var(--main-gap)}.woocommerce-activity-card.is-loading .woocommerce-activity-card__icon .is-placeholder{height:33px;width:33px}.woocommerce-activity-card.is-loading .woocommerce-activity-card__body .is-placeholder{width:100%;margin-bottom:4px}.woocommerce-activity-card.is-loading .woocommerce-activity-card__body .is-placeholder:last-of-type{width:65%;margin-bottom:0}.woocommerce-activity-card.is-loading .woocommerce-activity-card__actions .is-placeholder{width:91px;height:24px}.woocommerce-activity-panel .woocommerce-activity-card.woocommerce-order-activity-card{grid-template-columns:1fr;grid-template-areas:"header" "body" "actions"}.woocommerce-activity-panel .woocommerce-activity-card.woocommerce-order-activity-card .woocommerce-activity-card__icon{display:none}.woocommerce-activity-panel .woocommerce-activity-card.woocommerce-order-activity-card .woocommerce-flag{display:inline-block}.woocommerce-activity-panel .woocommerce-activity-card.woocommerce-order-activity-card .woocommerce-activity-card__subtitle span+span:before{content:" • "}.woocommerce-activity-panel .woocommerce-activity-card.woocommerce-inbox-activity-card{grid-template-columns:72px 1fr;height:100%;opacity:1;padding:24px;padding:var(--main-gap)}@media screen and (prefers-reduced-motion:no-preference){.woocommerce-activity-panel .woocommerce-activity-card.woocommerce-inbox-activity-card{transition:opacity .3s,height 0s,padding 0s}}@media(max-width:782px){.woocommerce-activity-panel .woocommerce-activity-card.woocommerce-inbox-activity-card{grid-template-columns:64px 1fr}}.woocommerce-activity-panel .woocommerce-activity-card.woocommerce-inbox-activity-card .woocommerce-activity-card__header{margin-bottom:12px}.woocommerce-activity-panel .woocommerce-activity-card.woocommerce-inbox-activity-card.actioned{height:0;opacity:0;padding:0}@media screen and (prefers-reduced-motion:no-preference){.woocommerce-activity-panel .woocommerce-activity-card.woocommerce-inbox-activity-card.actioned{transition:opacity .3s,height 0s .3s,padding 0s .3s}}.woocommerce-stock-activity-card__image-overlay__product{height:33px;position:relative;width:33px}.woocommerce-stock-activity-card__image-overlay__product.is-placeholder:before{background-color:#757575;border-radius:2px;content:"";position:absolute;right:0;left:0;bottom:0;top:0;opacity:.1}@media screen and (prefers-reduced-motion:no-preference){.woocommerce-stock-activity-card{transition:opacity .3s}}.woocommerce-stock-activity-card.is-dimmed{opacity:.7}.woocommerce-stock-activity-card .woocommerce-stock-activity-card__stock-quantity{background:#f0f0f0;color:#757575;padding:3px 8px;border-radius:3px}.woocommerce-stock-activity-card .woocommerce-stock-activity-card__stock-quantity.out-of-stock{color:#d94f4f}.woocommerce-stock-activity-card .woocommerce-stock-activity-card__edit-quantity{display:inline-flex;width:50px;margin-left:10px}.woocommerce-stock-activity-card .woocommerce-stock-activity-card__edit-quantity input{border-radius:2px;height:30px}.woocommerce-stock-activity-card .woocommerce-stock-activity-card__edit-quantity input[type=number]{-moz-appearance:textfield}.woocommerce-stock-activity-card .woocommerce-stock-activity-card__edit-quantity input[type=number]::-webkit-inner-spin-button,.woocommerce-stock-activity-card .woocommerce-stock-activity-card__edit-quantity input[type=number]::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}.woocommerce-stock-activity-card .woocommerce-activity-card__subtitle{color:#757575;font-size:12px;font-size:.75rem}.woocommerce-empty-activity-card{background:#f0f0f0;margin:20px;border-bottom:unset}.woocommerce-activity-panel .woocommerce-order-empty__success-icon{font-size:36px}.woocommerce-activity-panel .woocommerce-activity-card.woocommerce-order-activity-card .woocommerce-activity-card__header{margin-bottom:4px}.woocommerce-activity-panel .woocommerce-activity-card.woocommerce-order-activity-card .woocommerce-activity-card__header .woocommerce-activity-card__title.is-placeholder{width:45%}.woocommerce-activity-panel .woocommerce-activity-card.woocommerce-order-activity-card .woocommerce-activity-card__body>.is-placeholder{width:30%}.woocommerce-activity-panel .woocommerce-activity-card.woocommerce-order-activity-card .woocommerce-activity-card__actions>.is-placeholder{height:24px;margin-top:4px;width:65px}.woocommerce-activity-panel .woocommerce-activity-card.woocommerce-order-activity-card .woocommerce-order-activity-card{cursor:pointer}.woocommerce-review-activity-card .woocommerce-rating{margin-top:4px}.woocommerce-review-activity-card .woocommerce-rating .gridicon{fill:#ffb900}.woocommerce-review-activity-card .woocommerce-activity-card__body>span>p:first-child{margin-top:0}.woocommerce-review-activity-card .woocommerce-activity-card__body>span>p:last-child{margin-bottom:0}.woocommerce-review-activity-card .woocommerce-review-activity-card__verified{display:inline-flex;margin-right:4px;position:relative;top:4px;color:#4ab866;font-size:12px;font-size:.75rem}.woocommerce-review-activity-card .woocommerce-review-activity-card__verified svg{width:18px;height:18px;fill:#4ab866}@media(max-width:782px){.woocommerce-review-activity-card .woocommerce-review-activity-card__image-overlay{margin-top:4px}}.woocommerce-review-activity-card.woocommerce-activity-card{padding:16px 24px}.woocommerce-review-activity-card .woocommerce-activity-card__header .woocommerce-activity-card__title{line-height:20px}#activity-panel-inbox{margin:0 24px}.woocommerce-layout__inbox-panel-header{padding:24px}.woocommerce-homepage-column .woocommerce-layout__inbox-panel-header{padding:0 24px}.woocommerce-inbox-message-enter{opacity:0;max-height:0;transform:translateX(-50%)}.woocommerce-inbox-message-enter-active{transition:opacity .5s,transform .5s,max-height .5s}.woocommerce-inbox-message-enter-active,.woocommerce-inbox-message-exit{opacity:1;max-height:100vh;transform:translateX(0)}.woocommerce-inbox-message-exit-active{opacity:0;max-height:0;transform:translateX(-50%);transition:opacity .5s,transform .5s,max-height .5s}.woocommerce-navigation-intro-modal{width:670px}@media(max-width:782px){.woocommerce-navigation-intro-modal{width:350px}}.woocommerce-navigation-intro-modal .components-guide__page-control{order:3;margin:16px 0}.woocommerce-navigation-intro-modal .components-guide__page-control li{margin:0}.woocommerce-navigation-intro-modal .components-modal__header{display:none}.woocommerce-navigation-intro-modal .components-guide__container{margin-top:0}.woocommerce-navigation-intro-modal .components-guide__footer{box-sizing:border-box;margin:0;height:0;overflow:visible}.woocommerce-navigation-intro-modal .components-guide__footer .components-button{position:absolute;bottom:100%;margin-bottom:16px}.woocommerce-navigation-intro-modal .components-guide__footer .components-guide__back-button{display:none}.woocommerce-navigation-intro-modal.components-modal__frame.components-guide{height:auto}.woocommerce-navigation-intro-modal .woocommerce-navigation-intro-modal__page-wrapper{display:grid;grid-template-columns:1fr 1fr}.woocommerce-navigation-intro-modal .woocommerce-navigation-intro-modal__page-wrapper img{max-width:100%}@media(max-width:782px){.woocommerce-navigation-intro-modal .woocommerce-navigation-intro-modal__page-wrapper{grid-template-columns:1fr}.woocommerce-navigation-intro-modal .woocommerce-navigation-intro-modal__page-wrapper .woocommerce-navigation-intro-modal__image-wrapper{grid-row:1;max-height:328px;overflow:hidden}}.woocommerce-navigation-intro-modal .woocommerce-navigation-intro-modal__page-text{padding:24px;display:flex;flex-direction:column;justify-content:center}.woocommerce-navigation-intro-modal .woocommerce-navigation-intro-modal__page-text h2{font-weight:700;margin-bottom:8px}.woocommerce-stats-overview .woocommerce-card__body{padding:0}.woocommerce-stats-overview .woocommerce-summary{margin:0}.woocommerce-stats-overview__more-btn{display:inline-block;padding:16px}.woocommerce-stats-overview__tabs .components-tab-panel__tabs{display:flex;justify-content:space-between;border-bottom:1px solid #e0e0e0}.woocommerce-stats-overview__tabs .components-tab-panel__tabs .components-button{width:33.33%;padding-left:24px;padding-right:24px}.woocommerce-stats-overview__stats{margin:0}.woocommerce-stats-overview__stats .woocommerce-summary__item-container{width:50%;display:inline-block}.woocommerce-stats-overview__stats.is-even .woocommerce-summary__item-container:nth-last-of-type(2) .woocommerce-summary__item,.woocommerce-stats-overview__stats .woocommerce-summary__item-container:last-of-type .woocommerce-summary__item{border-bottom:none}.woocommerce-stats-overview__stats .woocommerce-summary__item-container:nth-of-type(2n) .woocommerce-summary__item{border-left:none}.woocommerce-stats-overview__stats .woocommerce-summary__item{background-color:#fff}.woocommerce-stats-overview__stats .woocommerce-summary__item:active,.woocommerce-stats-overview__stats .woocommerce-summary__item:hover{background-color:#f0f0f0}article.woocommerce-stats-overview__install-jetpack-promo .woocommerce-stats-overview__install-jetpack-promo__content{padding:16px 24px}article.woocommerce-stats-overview__install-jetpack-promo h2{color:#1e1e1e;font-size:16px;font-size:1rem;font-style:normal;line-height:1.5;font-weight:400;margin:8px 0}article.woocommerce-stats-overview__install-jetpack-promo p{color:#757575;font-style:normal;font-weight:400;font-size:14px;font-size:.875rem;line-height:20px;margin:8px 0}article.woocommerce-stats-overview__install-jetpack-promo footer{padding:16px 24px;border-top:1px solid #f0f0f0;border-bottom:1px solid #f0f0f0}article.woocommerce-stats-overview__install-jetpack-promo footer button{margin-right:8px}article.woocommerce-stats-overview__install-jetpack-promo footer button:first-child{margin-right:0}.woocommerce-store-management-links__card-body.is-size-custom{padding:24px 0 8px}.woocommerce-quick-links__category{display:flex;flex-flow:row wrap;margin-bottom:8px}.woocommerce-quick-links__category .woocommerce-quick-links__category-header{margin:0 24px 8px;text-transform:uppercase;color:#757575;line-height:16px;font-size:11px;flex:1 100%}.woocommerce-quick-links__item{display:flex;flex:1 50%}.woocommerce-quick-links__item:hover{background-color:#f0f0f0}.woocommerce-quick-links__item .woocommerce-quick-links__item-link{width:100%;display:flex;align-items:center;text-decoration:none;padding:16px 24px 16px 27px}.woocommerce-quick-links__item .woocommerce-quick-links__item-link .woocommerce-quick-links__item-link__icon{fill:#007cba;fill:var(--wp-admin-theme-color)}.woocommerce-quick-links__item .woocommerce-quick-links__item-link .woocommerce-quick-links__item-link__text{margin-right:16px;flex:1;line-height:16px;font-size:13px}.woocommerce-homescreen.two-columns .woocommerce-quick-links__item{flex:1 100%}.woocommerce-task-dashboard__body .woocommerce-card__description{color:#646970}.woocommerce-task-dashboard__body .woocommerce-task-dashboard__container .woocommerce-task-payments{width:680px;margin:auto;max-width:100%}.woocommerce-task-dashboard__body .woocommerce-task-dashboard__container .woocommerce-task-card .wooocommerce-task-card__header{display:flex}.woocommerce-task-dashboard__body .woocommerce-task-dashboard__container .woocommerce-task-card .wooocommerce-task-card__header .woocommerce-badge{margin-right:16px}.woocommerce-task-dashboard__body .woocommerce-task-dashboard__container .woocommerce-task-card .woocommerce-list__item-text .woocommerce-pill{padding:1px 8px;margin-right:8px}.woocommerce-task-dashboard__body .woocommerce-task-dashboard__container .woocommerce-task-card .components-popover__content{min-width:unset}.woocommerce-task-dashboard__body .woocommerce-task-list__item-expandable-content,.woocommerce-task-dashboard__body .woocommerce-task__additional-info,.woocommerce-task-dashboard__body .woocommerce-task__estimated-time{color:#757575;font-weight:400;font-size:12px}.woocommerce-task-dashboard__body .woocommerce-task-list__item-expandable-content{font-size:13px}.woocommerce-task-dashboard__body #wpbody-content{position:relative}.woocommerce-task-dashboard__body .components-modal__screen-overlay{background:rgba(43,45,47,.4)}.woocommerce-task-dashboard__body .components-modal__frame .components-modal__header{border-bottom:0;margin-bottom:0}.woocommerce-task-dashboard__body .components-modal__frame .woocommerce-task-payments__stripe-error-wrapper{align-items:flex-end;flex-grow:1;display:flex;flex-direction:column}.woocommerce-shipping-rate{display:flex;padding-top:12px;padding-bottom:12px}.woocommerce-shipping-rate .woocommerce-shipping-rate__main{width:100%}.woocommerce-shipping-rate .woocommerce-shipping-rate__icon{padding-top:16px;margin-left:24px}.woocommerce-shipping-rate .woocommerce-shipping-rate__name{align-items:center;display:flex;padding-top:16px;font-size:16px;line-height:22px;color:#1d2327;margin-bottom:12px;border-top:1px solid #dcdcde}.woocommerce-shipping-rate .woocommerce-shipping-rate__name .components-form-toggle{margin-right:auto;height:18px}.woocommerce-shipping-rate .woocommerce-shipping-rate__control-wrapper .components-base-control{margin-bottom:0}.woocommerce-shipping-rate .woocommerce-shipping-rate__control-wrapper .components-base-control__label{display:block;position:relative;top:-8px;width:100%;font-size:12px}.woocommerce-shipping-rate .woocommerce-shipping-rate__control-wrapper .text-control-with-affixes__prefix,.woocommerce-shipping-rate .woocommerce-shipping-rate__control-wrapper .text-control-with-affixes__suffix{font-size:16px;line-height:24px;color:#646970;border:0;padding:0;align-items:center;display:flex;top:-11px}.woocommerce-shipping-rate .woocommerce-shipping-rate__control-wrapper .components-text-control__input{position:relative;top:-11px}.woocommerce-shipping-rate .woocommerce-shipping-rate__control-wrapper .text-control-with-affixes__prefix{margin-left:4px}.woocommerce-shipping-rate .woocommerce-shipping-rate__control-wrapper .text-control-with-affixes__suffix{margin-right:4px}.woocommerce-task-tax__automated-tax-control{display:flex;align-items:center;margin-top:16px}.woocommerce-task-tax__automated-tax-control i{margin-right:16px;margin-left:24px}.woocommerce-task-tax__automated-tax-control .woocommerce-task-tax__automated-tax-control-inner{border-top:1px solid #dcdcde;display:flex;align-items:center;flex:1;font-size:16px;padding-top:16px;padding-bottom:16px}.woocommerce-task-tax__automated-tax-control .components-form-toggle{margin-right:auto}.woocommerce-task-tax__success{display:flex;flex-direction:column;align-items:center;padding:40px;text-align:center}.woocommerce-task-tax__success .woocommerce-task-tax__success-icon{font-size:48px;height:48px;align-items:center;display:flex}.woocommerce-task-tax__success #woocommerce-task-tax__success-message{font-size:32px;font-weight:400}.woocommerce-task-tax__success p{margin-top:0;font-size:16px}.woocommerce-task-payments .components-card+.components-card{margin-top:24px}.woocommerce-task-payments .woocommerce-task-payment__setup_required{display:flex;align-items:center;font-size:14px;margin-right:12px;font-weight:400;gap:3px}.woocommerce-task-payments .woocommerce-task-payment__setup_required>svg{fill:#efb854}.woocommerce-task-payments .components-card__header{font-size:20px;font-weight:400;line-height:28px;margin:0}.woocommerce-task-payments .woocommerce-task-payment__recommended-pill{border:1px solid #dcdcde;border-radius:28px;display:inline-block;font-size:13px;margin-right:12px;padding:1px 10px}.woocommerce-task-payments .woocommerce-task-payment__recommended-pill span{max-width:70px}.woocommerce-task-payments .components-card__divider:last-child{display:none}.woocommerce-task-payment-method>h3{margin:0;color:#1d2327}.woocommerce-task-payment-method p{font-size:14px;color:#646970;font-weight:400;margin-top:16px;margin-bottom:16px}.woocommerce-task-payment-method__fields{display:grid;grid-template-columns:1fr 1fr;grid-gap:0 16px;margin-bottom:8px}.woocommerce-task-payment-method__fields .components-base-control{margin-bottom:0}.woocommerce-task-dashboard__container .woocommerce-stepper button.components-button.is-primary{margin:0 0 0 8px}.woocommerce-task-dashboard__container button.components-button.is-link{margin:0;height:auto;color:#50575e;font-weight:400}.woocommerce-task-payments__paypal-auto-create-account{margin-top:16px;margin-bottom:16px}.woocommerce-task-card__prompt{width:100%;min-width:100%;margin-bottom:24px;margin-top:-4px;cursor:default}.woocommerce-task-card__prompt .components-snackbar__content{display:block;align-items:unset;justify-content:unset}.woocommerce-task-card__prompt .components-snackbar__content span{margin-right:-24px}.woocommerce-task-card__prompt .woocommerce-task-card__prompt-actions button.is-link,.woocommerce-task-card__prompt .woocommerce-task-card__prompt-actions button.is-link:active,.woocommerce-task-card__prompt .woocommerce-task-card__prompt-actions button.is-link:focus{color:#fff;margin-right:24px;background:transparent}.woocommerce-task-card__prompt .woocommerce-task-card__prompt-actions button.is-link:hover{color:#fff}.woocommerce-task-card__prompt .woocommerce-task-card__prompt-pointer{border-bottom:10px solid #1e1e1e;border-right:10px solid transparent;border-left:10px solid transparent;position:relative;width:0;height:0;display:inline-block;top:-30px}.woocommerce-task-card__prompt .woocommerce-task-card__prompt-content{display:flex;align-items:baseline;justify-content:space-between;max-height:10px;margin-right:24px;position:relative;top:-40px}.woocommerce-task-card__prompt .woocommerce-task-card__prompt-actions{margin-left:-16px}.woocommerce-task-card__prompt:hover .woocommerce-task-card__prompt-pointer{border-bottom-color:#1e1e1e}.woocommerce-task-card__section-controls{text-align:center}.woocommerce-task-dashboard__container .woocommerce-task-card.is-loading .woocommerce-card__body{border-top:1px solid #dcdcde}.woocommerce-task-dashboard__container .woocommerce-task-card.is-loading .is-placeholder{animation:loading-fade 1.6s ease-in-out infinite;background-color:#f0f0f0;color:transparent;display:inline-block;height:16px}.woocommerce-task-dashboard__container .woocommerce-task-card.is-loading .is-placeholder:after{content:" "}@media screen and (prefers-reduced-motion:reduce){.woocommerce-task-dashboard__container .woocommerce-task-card.is-loading .is-placeholder{animation:none}}.woocommerce-task-dashboard__container .woocommerce-task-card.is-loading .woocommerce-card__title .is-placeholder{width:70%;height:28px}.woocommerce-task-dashboard__container .woocommerce-task-card.is-loading .woocommerce-list__item-before .is-placeholder{height:36px;width:36px}.woocommerce-task-dashboard__container .woocommerce-task-card.is-loading .woocommerce-list__item-text{width:100%}.woocommerce-task-dashboard__container .woocommerce-task-card.is-loading .woocommerce-list__item-text .woocommerce-list__item-title .is-placeholder{height:22px;width:60%}.woocommerce-task-dashboard__container .woocommerce-task-card.is-loading .woocommerce-list__item-after .is-placeholder{height:18px;width:60px}.woocommerce-task-dashboard__container .woocommerce-task__caption{color:#757575;margin-top:16px}.components-guide.woocommerce__welcome-modal.woocommerce__welcome-from-calypso-modal{height:440px}.components-guide.woocommerce__welcome-modal.woocommerce__welcome-from-calypso-modal ul.components-guide__page-control{display:none}.components-guide.woocommerce__welcome-modal.woocommerce__welcome-from-calypso-modal .woocommerce__welcome-modal__page-content{margin-top:16px}.components-guide.woocommerce__welcome-modal{max-width:517px;height:460px}.components-guide.woocommerce__welcome-modal .components-modal__header{height:0}.components-guide.woocommerce__welcome-modal .components-modal__header .components-button{color:#fff}.components-guide.woocommerce__welcome-modal .components-guide__container{margin-top:0}.components-guide.woocommerce__welcome-modal .components-guide__container .woocommerce__welcome-modal__page-content{padding:0 24px}.components-guide.woocommerce__welcome-modal .components-guide__container .woocommerce__welcome-modal__page-content .woocommerce__welcome-modal__page-content__header{font-size:24px;line-height:32px;margin:0 0 24px}.components-guide.woocommerce__welcome-modal .components-guide__container .woocommerce__welcome-modal__page-content .woocommerce__welcome-modal__page-content__body{font-size:16px;line-height:24px;margin:0 0 24px}.components-guide.woocommerce__welcome-modal .components-guide__footer{padding:0;margin:0 24px 24px;justify-content:flex-end;width:auto}.components-guide.woocommerce__welcome-modal .components-guide__footer .components-guide__back-button,.components-guide.woocommerce__welcome-modal .components-guide__footer .components-guide__finish-button,.components-guide.woocommerce__welcome-modal .components-guide__footer .components-guide__forward-button{position:static;padding:0 16px;font-weight:500;font-size:14px;line-height:18px}.components-guide.woocommerce__welcome-modal .components-guide__footer .components-guide__back-button,.components-guide.woocommerce__welcome-modal .components-guide__footer .components-guide__forward-button{color:#007cba;color:var(--wp-admin-theme-color)}.components-guide.woocommerce__welcome-modal .components-guide__footer .components-guide__finish-button,.components-guide.woocommerce__welcome-modal .components-guide__footer .components-guide__forward-button{margin-right:10px}.components-guide.woocommerce__welcome-modal .components-guide__footer .components-guide__forward-button{box-shadow:inset 0 0 0 1px #007cba;box-shadow:inset 0 0 0 1px var(--wp-admin-theme-color);outline:1px solid transparent}.components-guide.woocommerce__welcome-modal .fill-theme-color{fill:#007cba;fill:var(--wp-admin-theme-color)}.woocommerce-page #wpcontent,.woocommerce-page.woocommerce_page_wc-admin #wpbody-content{overflow-x:inherit!important}.woocommerce-homescreen{display:flex;max-width:1032px;margin:0 auto;justify-content:space-between;flex-direction:column}.woocommerce-homescreen .woocommerce-task-dashboard__container{width:100%;margin-bottom:24px}.woocommerce-homescreen.two-columns{flex-direction:row}.woocommerce-homescreen.two-columns .woocommerce-homescreen-column{width:calc(50% - 12px);margin:0}@media(max-width:782px){.woocommerce-homescreen.two-columns .woocommerce-homescreen-column{width:100%;position:inherit;top:auto}}.woocommerce-homescreen.two-columns .your-store-today{display:block}@media(max-width:782px){.woocommerce-homescreen.two-columns{flex-direction:column}.woocommerce-homescreen.two-columns .your-store-today{display:none}}@media(max-width:782px){.woocommerce-homescreen{margin-right:-16px;margin-left:-16px}}.woocommerce-homescreen-column{width:682px;top:100px;margin:0 auto;align-self:flex-start}.woocommerce-homescreen-column>div{margin-bottom:24px}@media(max-width:782px){.woocommerce-homescreen-column{width:100%;position:inherit;top:auto}}.woocommerce-homescreen-card .components-card__header.is-size-large,.woocommerce-homescreen-card .components-card__header.is-size-medium{min-height:63px;min-height:unset;display:grid;grid-template-columns:auto 24px}.woocommerce-homescreen-card .components-card__header.is-size-large>*,.woocommerce-homescreen-card .components-card__header.is-size-medium>*{align-self:center}.woocommerce-homescreen-card .components-card__footer.is-size-large{padding:0 8px}.woocommerce-layout__inbox-panel-header.your-store-today{display:none}:root{--wp-admin-theme-color:#007cba;--wp-admin-theme-color-darker-10:#006ba1;--wp-admin-theme-color-darker-20:#005a87}body.admin-color-light{--wp-admin-theme-color:#0085ba;--wp-admin-theme-color-darker-10:#0073a1;--wp-admin-theme-color-darker-20:#006187}body.admin-color-modern{--wp-admin-theme-color:#3858e9;--wp-admin-theme-color-darker-10:#2145e6;--wp-admin-theme-color-darker-20:#183ad6}body.admin-color-blue{--wp-admin-theme-color:#096484;--wp-admin-theme-color-darker-10:#07526c;--wp-admin-theme-color-darker-20:#064054}body.admin-color-coffee{--wp-admin-theme-color:#46403c;--wp-admin-theme-color-darker-10:#383330;--wp-admin-theme-color-darker-20:#2b2724}body.admin-color-ectoplasm{--wp-admin-theme-color:#523f6d;--wp-admin-theme-color-darker-10:#46365d;--wp-admin-theme-color-darker-20:#3a2c4d}body.admin-color-midnight{--wp-admin-theme-color:#e14d43;--wp-admin-theme-color-darker-10:#dd382d;--wp-admin-theme-color-darker-20:#d02c21}body.admin-color-ocean{--wp-admin-theme-color:#627c83;--wp-admin-theme-color-darker-10:#576e74;--wp-admin-theme-color-darker-20:#4c6066}body.admin-color-sunrise{--wp-admin-theme-color:#dd823b;--wp-admin-theme-color-darker-10:#d97426;--wp-admin-theme-color-darker-20:#c36922}#klarna-kp-banner,.woocommerce-page:not(.woocommerce-embed-page) #klarna-banner{display:none}.woocommerce-dashboard__columns{display:grid;grid-template-columns:calc(50% - 12px) calc(50% - 12px);grid-column-gap:24px}.woocommerce-dashboard__columns>div:first-child{grid-column-start:1;grid-column-end:2;grid-row-start:1;grid-row-end:2}.woocommerce-dashboard__columns>div:nth-child(2){grid-column-start:2;grid-column-end:3;grid-row-start:1;grid-row-end:2}.woocommerce-dashboard__columns>div:nth-child(3){grid-column-start:1;grid-column-end:2;grid-row-start:2;grid-row-end:3}.woocommerce-dashboard__columns>div:nth-child(4){grid-column-start:2;grid-column-end:3;grid-row-start:2;grid-row-end:3}.woocommerce-dashboard__columns>div:nth-child(5){grid-column-start:1;grid-column-end:2;grid-row-start:3;grid-row-end:4}.woocommerce-dashboard__columns>div:nth-child(6){grid-column-start:2;grid-column-end:3;grid-row-start:3;grid-row-end:4}.woocommerce-dashboard__columns>div:nth-child(7){grid-column-start:1;grid-column-end:2;grid-row-start:4;grid-row-end:5}.woocommerce-dashboard__columns>div:nth-child(8){grid-column-start:2;grid-column-end:3;grid-row-start:4;grid-row-end:5}.woocommerce-dashboard__columns>div:nth-child(9){grid-column-start:1;grid-column-end:2;grid-row-start:5;grid-row-end:6}.woocommerce-dashboard__columns>div:nth-child(10){grid-column-start:2;grid-column-end:3;grid-row-start:5;grid-row-end:6}.woocommerce-dashboard__columns>div:nth-child(11){grid-column-start:1;grid-column-end:2;grid-row-start:6;grid-row-end:7}.woocommerce-dashboard__columns>div:nth-child(12){grid-column-start:2;grid-column-end:3;grid-row-start:6;grid-row-end:7}.woocommerce-dashboard__columns>div:nth-child(13){grid-column-start:1;grid-column-end:2;grid-row-start:7;grid-row-end:8}.woocommerce-dashboard__columns>div:nth-child(14){grid-column-start:2;grid-column-end:3;grid-row-start:7;grid-row-end:8}@media(max-width:960px){.woocommerce-dashboard__columns{grid-template-columns:100%}.woocommerce-dashboard__columns>div:first-child{grid-column-start:1;grid-column-end:2;grid-row-start:1;grid-row-end:2}.woocommerce-dashboard__columns>div:nth-child(2){grid-column-start:1;grid-column-end:2;grid-row-start:2;grid-row-end:3}.woocommerce-dashboard__columns>div:nth-child(3){grid-column-start:1;grid-column-end:2;grid-row-start:3;grid-row-end:4}.woocommerce-dashboard__columns>div:nth-child(4){grid-column-start:1;grid-column-end:2;grid-row-start:4;grid-row-end:5}.woocommerce-dashboard__columns>div:nth-child(5){grid-column-start:1;grid-column-end:2;grid-row-start:5;grid-row-end:6}.woocommerce-dashboard__columns>div:nth-child(6){grid-column-start:1;grid-column-end:2;grid-row-start:6;grid-row-end:7}.woocommerce-dashboard__columns>div:nth-child(7){grid-column-start:1;grid-column-end:2;grid-row-start:7;grid-row-end:8}.woocommerce-dashboard__columns>div:nth-child(8){grid-column-start:1;grid-column-end:2;grid-row-start:8;grid-row-end:9}.woocommerce-dashboard__columns>div:nth-child(9){grid-column-start:1;grid-column-end:2;grid-row-start:9;grid-row-end:10}.woocommerce-dashboard__columns>div:nth-child(10){grid-column-start:1;grid-column-end:2;grid-row-start:10;grid-row-end:11}.woocommerce-dashboard__columns>div:nth-child(11){grid-column-start:1;grid-column-end:2;grid-row-start:11;grid-row-end:12}.woocommerce-dashboard__columns>div:nth-child(12){grid-column-start:1;grid-column-end:2;grid-row-start:12;grid-row-end:13}.woocommerce-dashboard__columns>div:nth-child(13){grid-column-start:1;grid-column-end:2;grid-row-start:13;grid-row-end:14}.woocommerce-dashboard__columns>div:nth-child(14){grid-column-start:1;grid-column-end:2;grid-row-start:14;grid-row-end:15}}.woocommerce-dashboard__widget{display:flex;align-items:center;text-align:center}.woocommerce-dashboard__widget-item{flex:1}.woocommerce-dashboard-section__add-more{margin:0 auto;width:84px;padding:0 24px 24px}.woocommerce-dashboard-section__add-more .components-popover__content{padding:0 16px 8px}.woocommerce-dashboard-section__add-more>button svg{fill:#757575}.woocommerce-dashboard-section__add-more-choices{display:flex;justify-content:center}.woocommerce-dashboard-section__add-more-btn{display:flex;flex-direction:column;align-items:center;padding:16px;margin:8px}.woocommerce-dashboard-section__add-more-btn.components-button{height:auto}.woocommerce-dashboard-section__add-more-btn .store-performance__icon{transform:rotate(45deg)}.woocommerce-dashboard-section__add-more-btn-title{color:#757575;padding-top:8px}.woocommerce-dashboard-section-controls{border-top:1px solid #f0f0f0;padding-top:8px}.woocommerce-dashboard-section-controls .icon-control{margin:0 0 0 8px;vertical-align:bottom;fill:#757575}.woocommerce-dashboard-section-controls .woocommerce-ellipsis-menu__item{padding-bottom:10px}.components-card .woocommerce-ellipsis-menu__toggle{padding:0}.woocommerce-task-dashboard__body .woocommerce-task-dashboard__container .woocommerce-task-card{max-width:680px;margin-right:auto;margin-left:auto;margin-bottom:24px}.woocommerce-task-dashboard__body .woocommerce-task-dashboard__container .woocommerce-task-card .components-card__header.is-size-large{padding-bottom:12px}.woocommerce-task-dashboard__body .woocommerce-task-dashboard__container .woocommerce-task-card .components-card__header.is-size-large .woocommerce-card__menu{margin-top:8px}woocommerce-admin/dist/wp-admin-scripts/marketing-coupons.js000064400000165757151335517650020360 0ustar00/*! For license information please see marketing-coupons.js.LICENSE.txt */
this.wc=this.wc||{},this.wc.marketingCoupons=function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=469)}({0:function(e,t){e.exports=window.wp.element},1:function(e,t,n){e.exports=n(47)()},10:function(e,t){e.exports=window.wp.dataControls},102:function(e,t,n){"use strict";n.d(t,"a",(function(){return u})),n.d(t,"b",(function(){return R})),n.d(t,"c",(function(){return L}));var r={};n.r(r),n.d(r,"blank",(function(){return g})),n.d(r,"amazonEbayIntegration",(function(){return b})),n.d(r,"woocommerceAmazonEbayIntegration",(function(){return b})),n.d(r,"automatewoo",(function(){return E})),n.d(r,"automatewooAlt",(function(){return v})),n.d(r,"facebook",(function(){return O})),n.d(r,"facebookForWoocommerce",(function(){return O})),n.d(r,"pinterest",(function(){return w})),n.d(r,"pinterestForWoocommerce",(function(){return w})),n.d(r,"googleAds",(function(){return C})),n.d(r,"googleListingsAndAds",(function(){return C})),n.d(r,"hubspotForWoocommerce",(function(){return j})),n.d(r,"mailchimpForWoocommerce",(function(){return y})),n.d(r,"woocommerceStoreCredit",(function(){return x})),n.d(r,"woocommerceFreeGiftCoupons",(function(){return P})),n.d(r,"woocommerceUrlCoupons",(function(){return _})),n.d(r,"woocommerceGroupCoupons",(function(){return k})),n.d(r,"woocommerceSmartCoupons",(function(){return S}));var o=n(35),c=n.n(o),a=n(0),i=n(3),s=n(6),l=n.n(s),u=(n(272),e=>Object(a.createElement)(i.Button,c()({},e,{className:l()(e.className,"woocommerce-admin-marketing-button")}))),d=(n(77),n(1)),m=n.n(d),p=n(116),f=n(4),h=(n(274),n(8));var g=Object(a.createElement)(h.SVG,{width:"36",height:"36",fill:"none",xmlns:"http://www.w3.org/2000/svg"});var b=Object(a.createElement)(h.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"100",height:"100",viewBox:"0 0 100 100"},Object(a.createElement)("defs",null,Object(a.createElement)("clipPath",{id:"b"},Object(a.createElement)("rect",{width:"100",height:"100"}))),Object(a.createElement)("g",{id:"a",clipPath:"url(#b)"},Object(a.createElement)("rect",{width:"100",height:"100",fill:"#fff"}),Object(a.createElement)("rect",{width:"100",height:"100",fill:"#eee"}),Object(a.createElement)("g",{transform:"translate(9 25.655)"},Object(a.createElement)(h.Path,{d:"M179.753,195.8c-4.732,3.488-11.591,5.349-17.5,5.349a31.66,31.66,0,0,1-21.374-8.156c-.443-.4-.046-.946.486-.634a43.018,43.018,0,0,0,21.384,5.671,42.523,42.523,0,0,0,16.312-3.335c.8-.34,1.471.525.688,1.106",transform:"translate(-129.235 -176.611)",fill:"#f90",fillRule:"evenodd"}),Object(a.createElement)(h.Path,{d:"M577.807,183.949c-.6-.773-4-.365-5.522-.184-.464.057-.535-.347-.117-.638,2.7-1.9,7.142-1.354,7.66-.716s-.135,5.09-2.676,7.213c-.39.326-.762.152-.588-.28.571-1.425,1.85-4.619,1.244-5.395",transform:"translate(-525.323 -167.01)",fill:"#f90",fillRule:"evenodd"}),Object(a.createElement)(h.Path,{d:"M572.708,6.758V4.908a.457.457,0,0,1,.468-.468h8.284a.461.461,0,0,1,.479.468V6.493a2.605,2.605,0,0,1-.624,1.163l-4.292,6.129a9.146,9.146,0,0,1,4.725,1.014.843.843,0,0,1,.44.72v1.974c0,.269-.3.585-.61.422a9.542,9.542,0,0,0-8.752.014c-.287.156-.588-.156-.588-.425V15.627a2.238,2.238,0,0,1,.3-1.272l4.973-7.132h-4.328a.458.458,0,0,1-.479-.464",transform:"translate(-525.64 -4.078)",fillRule:"evenodd"}),Object(a.createElement)(h.Path,{d:"M173.431,15.624h-2.52a.476.476,0,0,1-.45-.429V2.261a.473.473,0,0,1,.486-.464h2.35a.475.475,0,0,1,.457.432V3.92h.046a3.463,3.463,0,0,1,6.589,0,3.722,3.722,0,0,1,6.4-.982c.8,1.088.634,2.669.634,4.055l0,8.163a.476.476,0,0,1-.486.468h-2.517a.479.479,0,0,1-.454-.468V8.3a16.192,16.192,0,0,0-.071-2.424,1.312,1.312,0,0,0-1.482-1.113,1.674,1.674,0,0,0-1.506,1.06,7.831,7.831,0,0,0-.234,2.478v6.855a.476.476,0,0,1-.486.468h-2.517a.476.476,0,0,1-.454-.468l0-6.855c0-1.443.238-3.566-1.553-3.566-1.811,0-1.74,2.07-1.74,3.566v6.855a.476.476,0,0,1-.486.468",transform:"translate(-156.58 -1.399)",fillRule:"evenodd"}),Object(a.createElement)(h.Path,{d:"M714.982,1.524c3.739,0,5.763,3.211,5.763,7.295,0,3.945-2.237,7.075-5.763,7.075-3.672,0-5.671-3.211-5.671-7.213,0-4.027,2.024-7.156,5.671-7.156M715,4.164c-1.857,0-1.974,2.531-1.974,4.108s-.025,4.955,1.953,4.955c1.953,0,2.045-2.722,2.045-4.381a11.959,11.959,0,0,0-.376-3.431A1.577,1.577,0,0,0,715,4.164",transform:"translate(-651.552 -1.399)",fillRule:"evenodd"}),Object(a.createElement)(h.Path,{d:"M875.817,15.624h-2.51a.479.479,0,0,1-.454-.468l0-12.938a.477.477,0,0,1,.486-.422h2.336a.482.482,0,0,1,.45.362V4.136h.046c.705-1.769,1.694-2.612,3.435-2.612a3.307,3.307,0,0,1,2.942,1.524c.659,1.035.659,2.775.659,4.027v8.142a.484.484,0,0,1-.486.408h-2.527a.477.477,0,0,1-.447-.408V8.191c0-1.414.163-3.484-1.577-3.484a1.647,1.647,0,0,0-1.457,1.035,5.724,5.724,0,0,0-.4,2.449v6.965a.485.485,0,0,1-.493.468",transform:"translate(-801.775 -1.399)",fillRule:"evenodd"}),Object(a.createElement)(h.Path,{d:"M413.163,8.046a4.93,4.93,0,0,1-.471,2.673,2.048,2.048,0,0,1-1.744,1.145c-.968,0-1.535-.737-1.535-1.825,0-2.148,1.925-2.538,3.75-2.538v.546m2.541,6.143a.526.526,0,0,1-.6.06,6.143,6.143,0,0,1-1.446-1.68,4.991,4.991,0,0,1-4.154,1.833,3.575,3.575,0,0,1-3.771-3.927,4.277,4.277,0,0,1,2.687-4.119,17.463,17.463,0,0,1,4.739-.876V5.154a3.214,3.214,0,0,0-.308-1.825,1.677,1.677,0,0,0-1.414-.656,1.917,1.917,0,0,0-2.024,1.514.527.527,0,0,1-.439.461l-2.442-.262a.444.444,0,0,1-.376-.528C406.719.893,409.4,0,411.795,0a5.714,5.714,0,0,1,3.8,1.255C416.818,2.4,416.7,3.928,416.7,5.59V9.517a3.447,3.447,0,0,0,.95,2.336.477.477,0,0,1-.011.67c-.514.429-1.428,1.226-1.932,1.673l0-.007",transform:"translate(-372.698 0)",fillRule:"evenodd"}),Object(a.createElement)(h.Path,{d:"M7.426,8.046a4.93,4.93,0,0,1-.471,2.673,2.043,2.043,0,0,1-1.744,1.145c-.968,0-1.531-.737-1.531-1.825C3.679,7.89,5.6,7.5,7.426,7.5v.546m2.541,6.143a.526.526,0,0,1-.6.06,6.2,6.2,0,0,1-1.446-1.68A4.986,4.986,0,0,1,3.771,14.4,3.576,3.576,0,0,1,0,10.474,4.282,4.282,0,0,1,2.687,6.356,17.462,17.462,0,0,1,7.426,5.48V5.154a3.243,3.243,0,0,0-.3-1.825,1.686,1.686,0,0,0-1.414-.656A1.921,1.921,0,0,0,3.679,4.186a.527.527,0,0,1-.436.461L.8,4.385a.446.446,0,0,1-.376-.528C.985.893,3.662,0,6.058,0a5.714,5.714,0,0,1,3.8,1.255C11.08,2.4,10.963,3.928,10.963,5.59V9.517a3.447,3.447,0,0,0,.95,2.336.473.473,0,0,1-.007.67c-.514.429-1.428,1.226-1.932,1.673l-.007-.007",transform:"translate(0 0)",fillRule:"evenodd"})),Object(a.createElement)("g",{transform:"translate(18.9 54.637)"},Object(a.createElement)(h.Path,{d:"M8.055,26.308C3.716,26.308.1,28.149.1,33.7c0,4.4,2.431,7.171,8.067,7.171,6.633,0,7.059-4.37,7.059-4.37H12.011s-.689,2.353-4.04,2.353a4.4,4.4,0,0,1-4.693-4.428H15.562V32.807c0-2.557-1.623-6.5-7.507-6.5Zm-.112,2.073c2.6,0,4.37,1.592,4.37,3.977H3.349C3.349,29.826,5.661,28.381,7.943,28.381Z",transform:"translate(0 -20.83)",fill:"#e53238"}),Object(a.createElement)(h.Path,{d:"M75.169.1V17.254c0,.974-.069,2.341-.069,2.341h3.066s.11-.982.11-1.879c0,0,1.515,2.37,5.633,2.37a6.961,6.961,0,0,0,7.283-7.325A6.922,6.922,0,0,0,83.915,5.52c-4.279,0-5.609,2.311-5.609,2.311V.1Zm7.955,7.542c2.945,0,4.818,2.186,4.818,5.119a4.857,4.857,0,0,1-4.8,5.2c-3.143,0-4.839-2.454-4.839-5.175C78.306,10.254,79.827,7.642,83.123,7.642Z",transform:"translate(-59.609)",fill:"#0064d2"}),Object(a.createElement)(h.Path,{d:"M159.834,26.308c-6.528,0-6.947,3.574-6.947,4.146h3.249s.17-2.087,3.473-2.087c2.146,0,3.809.982,3.809,2.871v.672h-3.809c-5.057,0-7.731,1.479-7.731,4.482,0,2.955,2.47,4.562,5.809,4.562,4.55,0,6.015-2.514,6.015-2.514,0,1,.077,1.985.077,1.985h2.888s-.112-1.221-.112-2V31.669c0-4.428-3.572-5.36-6.722-5.36Zm3.585,7.619v.9c0,1.169-.721,4.075-4.968,4.075-2.326,0-3.323-1.161-3.323-2.507C155.128,33.943,158.486,33.927,163.419,33.927Z",transform:"translate(-120.634 -20.83)",fill:"#f5af02"}),Object(a.createElement)(h.Path,{d:"M214.879,29.041h3.655l5.246,10.51,5.234-10.51h3.311l-9.533,18.711h-3.473l2.751-5.216Z",transform:"translate(-170.706 -23.002)",fill:"#86b817"}))));var E=Object(a.createElement)(h.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"100",height:"100",viewBox:"0 0 100 100"},Object(a.createElement)("defs",null,Object(a.createElement)("clipPath",{id:"b"},Object(a.createElement)("rect",{width:"100",height:"100"}))),Object(a.createElement)("g",{id:"a",clipPath:"url(#b)"},Object(a.createElement)("rect",{width:"100",height:"100",fill:"#fff"}),Object(a.createElement)("rect",{width:"100",height:"100",fill:"#7532e4"}),Object(a.createElement)("g",{transform:"translate(-43.503 -133.512)"},Object(a.createElement)(h.Path,{d:"M78.217,193.13H64.405l-2.823,7.764H54.6L67.648,166.9h7.669l12.934,33.995H81.059Zm-11.6-6.047h9.4L71.33,174.245Z",transform:"translate(0 0)",fill:"#1ff2e6"}),Object(a.createElement)(h.Path,{d:"M246.639,166.9h6.753l-9.4,33.995h-6.81l-7.764-24.208-7.764,24.208h-6.906L205.3,166.9h7l6.238,23.388,7.535-23.388h6.849l7.592,23.483Z",transform:"translate(-121.952)",fill:"#1ff2e6"}))));var v=Object(a.createElement)(h.SVG,{xmlns:"http://www.w3.org/2000/svg"},Object(a.createElement)(h.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M4.67708 14.1615h3.77084l.77604 2.1198h1.96354L7.65625 7H5.5625L2 16.2813h1.90625l.77083-2.1198zm3.17188-1.6511H5.28125l1.28646-3.50519 1.28125 3.50519zM22.9791 7h-1.8437l-1.6719 6.4115L17.3906 7h-1.8698l-2.0573 6.3854L11.7604 7H9.8489l2.5781 9.2813h1.8854l2.1198-6.60942 2.1198 6.60942h1.8594L22.9791 7z"}));var O=Object(a.createElement)(h.SVG,{width:"36",height:"36",viewBox:"0 0 36 36",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Object(a.createElement)(h.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M34 0H2C0.8 0 0 0.8 0 2V34C0 35 0.8 36 2 36H19.2V22H14.6V16.6H19.2V12.6C19.2 8 22 5.4 26.2 5.4C28.2 5.4 29.8 5.6 30.4 5.6V10.4H27.6C25.4 10.4 25 11.4 25 13V16.4H30.4L29.6 22H25V36H34C35 36 36 35.2 36 34V2C36 0.8 35.2 0 34 0Z",fill:"#3B5997"}));var w=Object(a.createElement)(h.SVG,{width:"303",height:"303",viewBox:"-30 -30 303 303",fill:"none",xmlns:"http://www.w3.org/2000/SVG"},Object(a.createElement)(h.Path,{fill:"#E60023",d:"M121.5,0C54.4,0,0,54.4,0,121.5C0,173,32,217,77.2,234.7c-1.1-9.6-2-24.4,0.4-34.9 c2.2-9.5,14.2-60.4,14.2-60.4s-3.6-7.3-3.6-18c0-16.9,9.8-29.5,22-29.5c10.4,0,15.4,7.8,15.4,17.1c0,10.4-6.6,26-10.1,40.5 c-2.9,12.1,6.1,22,18,22c21.6,0,38.2-22.8,38.2-55.6c0-29.1-20.9-49.4-50.8-49.4C86.3,66.5,66,92.4,66,119.2c0,10.4,4,21.6,9,27.7 c1,1.2,1.1,2.3,0.8,3.5c-0.9,3.8-3,12.1-3.4,13.8c-0.5,2.2-1.8,2.7-4.1,1.6c-15.2-7.1-24.7-29.2-24.7-47.1 c0-38.3,27.8-73.5,80.3-73.5c42.1,0,74.9,30,74.9,70.2c0,41.9-26.4,75.6-63,75.6c-12.3,0-23.9-6.4-27.8-14c0,0-6.1,23.2-7.6,28.9 c-2.7,10.6-10.1,23.8-15.1,31.9c11.4,3.5,23.4,5.4,36,5.4c67.1,0,121.5-54.4,121.5-121.5C243,54.4,188.6,0,121.5,0z"}));var C=Object(a.createElement)(h.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"128",height:"128",viewBox:"0 0 128 128"},Object(a.createElement)("rect",{width:"128",height:"128",fill:"#eee"}),Object(a.createElement)(h.Path,{d:"M92.4539 42.3419c3.7531 0 6.7961-3.0427 6.7961-6.7959 0-3.7531-3.043-6.7958-6.7961-6.7958s-6.7958 3.0427-6.7958 6.7958c0 3.7532 3.0427 6.7959 6.7958 6.7959zm-48.1438-2.0744l20.848-20.8481c1.5904-1.5903 3.7989-2.562 6.2285-2.562h30.9214c1.161-.0041 2.312.2217 3.386.6642 1.073.4426 2.049 1.0932 2.87 1.9143.821.8212 1.472 1.7967 1.914 2.8704.443 1.0737.669 2.2244.665 3.3857v30.9213c0 2.4297-.972 4.6384-2.607 6.2285L87.7202 83.678 44.3101 40.2675z",fill:"#4285F4"}),Object(a.createElement)(h.Path,{d:"M87.7202 83.678l-25.6915 25.716c-1.6346 1.59-3.8431 2.606-6.2726 2.606-2.4294 0-4.6383-1.016-6.2285-2.606L18.6061 78.4725C16.9717 76.8821 16 74.6736 16 72.244c0-2.4737 1.0159-4.6824 2.6061-6.2726L44.31 40.2675 87.7202 83.678z",fill:"#34A853"}),Object(a.createElement)(h.Path,{d:"M33.6115 93.4777L18.6061 78.4723C16.9717 76.8825 16 74.6736 16 72.2442c0-2.4737 1.0159-4.6824 2.6061-6.2726L44.31 40.2677l21.2557 21.256-31.9542 31.954z",fill:"#FBBC05"}),Object(a.createElement)(h.Path,{d:"M108.092 18.9973c-1.607-1.3873-3.661-2.1473-5.784-2.1399H71.3866c-2.4296 0-4.6381.9717-6.2285 2.562l-20.848 20.8481 21.2556 21.256 21.649-21.649c-1.0082-1.2168-1.5589-2.7482-1.5565-4.3285 0-3.7531 3.0426-6.7958 6.7957-6.7958 1.5804-.0025 3.1118.5482 4.3287 1.5565l11.3094-11.3094z",fill:"#EA4335"}),Object(a.createElement)(h.Path,{d:"M65.5535 77.7372c7.6238 0 13.8041-6.1803 13.8041-13.8041S73.1773 50.129 65.5535 50.129s-13.8041 6.1803-13.8041 13.8041 6.1803 13.8041 13.8041 13.8041z",fill:"#4285F4"}),Object(a.createElement)(h.Path,{d:"M84.3608 59.8724H66.0013v7.877h10.568c-.9853 5.0043-5.1048 7.8771-10.568 7.8771-6.4483 0-11.6427-5.3749-11.6427-12.0473s5.1944-12.0473 11.6427-12.0473c2.7764 0 5.284 1.0194 7.2543 2.6875l5.7318-5.9311c-3.4928-3.1508-7.9708-5.0969-12.9861-5.0969-10.9261 0-19.7029 9.0819-19.7029 20.3878S55.0752 83.967 66.0013 83.967c9.8514 0 18.8073-7.4138 18.8073-20.3878 0-1.2047-.1791-2.5022-.4478-3.7068z",fill:"#fff"}));var j=Object(a.createElement)(h.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"100",height:"100",viewBox:"0 0 100 100"},Object(a.createElement)("defs",null,Object(a.createElement)("clipPath",{id:"b"},Object(a.createElement)("rect",{width:"100",height:"100"}))),Object(a.createElement)("g",{id:"a",clipPath:"url(#b)"},Object(a.createElement)("rect",{width:"100",height:"100",fill:"#fff"}),Object(a.createElement)(h.Path,{d:"M100,100H0V0H100V100ZM40.665,75.539a6.446,6.446,0,1,0,6.447,6.447,6.376,6.376,0,0,0-.3-1.843L54.158,72.8A19.808,19.808,0,1,0,69.206,37.48h.015V28.455a6.959,6.959,0,0,0,4.013-6.273v-.211a6.971,6.971,0,0,0-6.952-6.953H66.07a6.97,6.97,0,0,0-6.952,6.953v.211a6.957,6.957,0,0,0,4.013,6.273V37.5a19.745,19.745,0,0,0-9.376,4.126L28.935,22.295a7.919,7.919,0,0,0-4.148-9.145,7.845,7.845,0,0,0-3.5-.817,7.919,7.919,0,1,0,3.938,14.786l24.4,19a19.775,19.775,0,0,0,.3,22.3l-7.426,7.427A6.362,6.362,0,0,0,40.665,75.539Zm25.522-8.321h0l-.023,0a10.164,10.164,0,0,1,.023-20.328H66.2a10.166,10.166,0,0,1-.012,20.333Z",fill:"#ff7a59"})));var y=Object(a.createElement)(h.SVG,{width:"36",height:"36",viewBox:"0 0 36 36",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Object(a.createElement)("rect",{width:"36",height:"36",rx:"3",fill:"#FFE071"}),Object(a.createElement)(h.Path,{d:"M24.0534 17.2863C24.2392 17.2638 24.4176 17.2625 24.5813 17.2863C24.6764 17.0647 24.6923 16.6823 24.6071 16.2661C24.4808 15.6471 24.3091 15.2728 23.9546 15.331C23.6002 15.3892 23.5873 15.8374 23.7143 16.4564C23.7848 16.8043 23.9117 17.1023 24.0534 17.2863Z",fill:"black"}),Object(a.createElement)(h.Path,{d:"M21.0119 17.7757C21.2652 17.8889 21.4209 17.9647 21.4823 17.899C21.5215 17.8576 21.5099 17.7794 21.4491 17.6786C21.3241 17.4702 21.0665 17.2587 20.7937 17.1404C20.2357 16.895 19.5697 16.9764 19.0559 17.3532C18.886 17.4802 18.7254 17.6555 18.7487 17.7625C18.756 17.7969 18.7812 17.8232 18.8413 17.8314C18.9811 17.8476 19.4698 17.5954 20.0321 17.5603C20.4294 17.5353 20.7587 17.6624 21.0119 17.7757Z",fill:"black"}),Object(a.createElement)(h.Path,{d:"M20.5024 18.073C20.1725 18.1262 19.9904 18.237 19.8733 18.3409C19.7733 18.4298 19.712 18.5281 19.7126 18.5975C19.7126 18.6307 19.7267 18.6495 19.7378 18.6589C19.7531 18.6726 19.7709 18.6802 19.7923 18.6802C19.8671 18.6802 20.0339 18.6119 20.0339 18.6119C20.4932 18.4442 20.7961 18.4642 21.0966 18.4993C21.2627 18.518 21.3406 18.5287 21.3774 18.4705C21.3884 18.4536 21.4013 18.4179 21.3682 18.3628C21.2903 18.2339 20.9568 18.0179 20.5024 18.073Z",fill:"black"}),Object(a.createElement)(h.Path,{d:"M23.0263 19.1626C23.2501 19.2753 23.4972 19.2309 23.5775 19.0644C23.6578 18.8973 23.5413 18.6713 23.3169 18.5587C23.0925 18.446 22.846 18.4904 22.7657 18.6569C22.6859 18.824 22.8025 19.0506 23.0263 19.1626Z",fill:"black"}),Object(a.createElement)(h.Path,{d:"M24.4673 17.8777C24.2851 17.8746 24.1343 18.0786 24.13 18.3334C24.1257 18.5881 24.2698 18.7971 24.4519 18.8003C24.634 18.8034 24.7849 18.5994 24.7892 18.3446C24.7935 18.0899 24.6494 17.8809 24.4673 17.8777Z",fill:"black"}),Object(a.createElement)(h.Path,{d:"M12.2373 22.4735C12.1919 22.4153 12.1177 22.4335 12.0454 22.4504C11.9951 22.4623 11.9381 22.476 11.8755 22.4748C11.7419 22.4723 11.6284 22.4134 11.5646 22.3139C11.4819 22.1837 11.4868 21.9903 11.5781 21.7682C11.5904 21.7381 11.6051 21.7049 11.6211 21.6686C11.767 21.3344 12.0117 20.7743 11.7369 20.241C11.5303 19.8398 11.1937 19.5895 10.7884 19.5369C10.3996 19.4868 9.99919 19.6339 9.7441 19.9212C9.34124 20.3749 9.27808 20.9921 9.35595 21.2099C9.38477 21.29 9.42892 21.3119 9.46142 21.3163C9.5301 21.3257 9.63127 21.275 9.69505 21.1003C9.69934 21.0878 9.70547 21.0684 9.71344 21.0434C9.74165 20.9514 9.79438 20.7799 9.88084 20.6422C9.98508 20.4763 10.147 20.3618 10.3371 20.3205C10.5308 20.2779 10.7289 20.3161 10.8944 20.4269C11.1765 20.6153 11.285 20.9683 11.1648 21.305C11.1023 21.479 11.0011 21.812 11.0238 22.0855C11.0692 22.6394 11.4028 22.8616 11.7026 22.8854C11.9939 22.8966 12.1981 22.7295 12.2496 22.6075C12.279 22.5361 12.2539 22.4923 12.2373 22.4735Z",fill:"black"}),Object(a.createElement)(h.Path,{d:"M29.0624 21.4609C29.0513 21.4209 28.979 21.1511 28.8796 20.8263C28.7803 20.5015 28.6773 20.2724 28.6773 20.2724C29.0759 19.6634 29.0826 19.1189 29.0299 18.8109C28.9735 18.4285 28.8177 18.1031 28.5031 17.7663C28.1892 17.4296 27.5466 17.0847 26.6434 16.8262C26.5403 16.7968 26.1994 16.7011 26.1694 16.6917C26.1669 16.6717 26.1442 15.5513 26.124 15.0706C26.1093 14.7233 26.0798 14.18 25.9149 13.6455C25.7181 12.922 25.3759 12.2886 24.9479 11.8836C26.1283 10.635 26.8647 9.25926 26.8629 8.07947C26.8592 5.81 24.1293 5.1234 20.7642 6.54542C20.7605 6.54667 20.0565 6.85147 20.051 6.8546C20.048 6.85147 18.7621 5.56402 18.7431 5.5465C14.907 2.13103 2.91255 15.7391 6.7474 19.0444L7.58562 19.7692C7.36794 20.3437 7.28271 21.0028 7.35261 21.7107C7.44213 22.6201 7.90202 23.4926 8.64704 24.166C9.35404 24.8057 10.2842 25.2106 11.1868 25.21C12.6793 28.72 16.0886 30.8737 20.0872 30.9951C24.3758 31.1253 27.9758 29.0711 29.4842 25.3815C29.583 25.1224 30.0018 23.9557 30.0018 22.9255C30.0005 21.8903 29.4272 21.4609 29.0624 21.4609ZM11.5161 24.2236C11.3861 24.2461 11.2531 24.2555 11.1188 24.2518C9.82374 24.2161 8.42445 23.0263 8.28526 21.6143C8.13135 20.054 8.91255 18.8535 10.2953 18.5687C10.4608 18.5349 10.6601 18.5149 10.876 18.5268C11.651 18.57 12.7928 19.1777 13.0534 20.9002C13.2845 22.4261 12.9172 23.9801 11.5161 24.2236ZM10.0696 17.6361C9.20872 17.807 8.45021 18.3052 7.98603 18.9931C7.70887 18.7571 7.19195 18.3002 7.10059 18.1218C6.35986 16.686 7.90877 13.8946 8.99104 12.318C11.6657 8.42245 15.8544 5.4739 17.7939 6.00903C18.1091 6.10041 19.1533 7.33591 19.1533 7.33591C19.1533 7.33591 17.2151 8.43372 15.4172 9.96402C12.9951 11.8667 11.1654 14.6338 10.0696 17.6361ZM23.6657 23.6403C23.694 23.6284 23.7136 23.5952 23.7099 23.5627C23.7056 23.5226 23.6706 23.4932 23.6314 23.4976C23.6314 23.4976 21.6024 23.8043 19.6856 23.0876C19.8941 22.3948 20.4496 22.6451 21.2884 22.714C22.8012 22.806 24.1563 22.5807 25.1582 22.2871C26.0265 22.033 27.1664 21.5317 28.0525 20.8182C28.3511 21.4879 28.4565 22.2252 28.4565 22.2252C28.4565 22.2252 28.6877 22.1832 28.8809 22.304C29.0636 22.4186 29.1973 22.657 29.1059 23.2735C28.9195 24.4252 28.44 25.3596 27.6343 26.2196C27.1437 26.7585 26.5477 27.2273 25.8665 27.5684C25.5047 27.7624 25.119 27.9301 24.7118 28.0659C21.6735 29.0786 18.5628 27.9652 17.5603 25.5737C17.4799 25.394 17.4125 25.2056 17.3592 25.0091C16.9318 23.4331 17.2948 21.5423 18.4285 20.3525V20.3519C18.4984 20.2761 18.5696 20.1866 18.5696 20.0746C18.5696 19.9807 18.5113 19.8818 18.4604 19.8111C18.0637 19.224 16.6896 18.2232 16.9655 16.2861C17.1635 14.8948 18.3556 13.9146 19.4673 13.9728C19.5611 13.9778 19.6549 13.9835 19.7487 13.9891C20.2307 14.0179 20.6507 14.0811 21.0468 14.098C21.7103 14.1274 22.3069 14.0285 23.0139 13.4277C23.2525 13.2249 23.4438 13.049 23.7669 12.9933C23.8006 12.9877 23.8853 12.9564 24.0545 12.9645C24.2268 12.9739 24.3911 13.0221 24.5389 13.1222C25.1055 13.5072 25.1858 14.4391 25.2153 15.1213C25.2318 15.5106 25.2778 16.4526 25.2937 16.7224C25.3299 17.3407 25.4887 17.4277 25.8113 17.536C25.9922 17.5967 26.1608 17.6424 26.4085 17.7131C27.1584 17.9278 27.603 18.1462 27.8838 18.426C28.0512 18.6013 28.1285 18.7872 28.153 18.9643C28.2413 19.6227 27.6521 20.4364 26.0921 21.1755C24.3868 21.9836 22.3174 22.1882 20.888 22.0255C20.7783 22.013 20.3883 21.9679 20.3871 21.9679C19.2435 21.8108 18.591 23.3192 19.2778 24.3525C19.7199 25.0185 20.9248 25.4522 22.1303 25.4522C24.8939 25.4529 27.0186 24.248 27.8084 23.2078C27.8323 23.1765 27.8342 23.1734 27.8716 23.1158C27.9102 23.0557 27.8783 23.0232 27.8299 23.057C27.1842 23.5076 24.3169 25.2976 21.2492 24.7594C21.2492 24.7594 20.8764 24.6968 20.5361 24.5616C20.2656 24.4546 19.6997 24.1886 19.631 23.5958C22.107 24.3788 23.6657 23.6403 23.6657 23.6403ZM19.7444 23.1677C19.7444 23.1684 19.7444 23.1684 19.7444 23.1677C19.745 23.169 19.745 23.169 19.745 23.1696C19.745 23.169 19.7444 23.1684 19.7444 23.1677ZM15.0088 12.3023C15.9599 11.1807 17.1304 10.2056 18.1784 9.65858C18.2145 9.6398 18.2532 9.67986 18.2336 9.71616C18.1502 9.87013 17.9901 10.1993 17.9392 10.4497C17.9313 10.4885 17.9729 10.5179 18.0048 10.4954C18.6573 10.0416 19.7916 9.55531 20.7875 9.49272C20.8304 9.49022 20.8506 9.54592 20.8169 9.57283C20.6654 9.69113 20.4999 9.85511 20.3791 10.021C20.3582 10.0491 20.3779 10.0898 20.4122 10.0898C21.1112 10.0948 22.0966 10.3446 22.7386 10.712C22.7821 10.737 22.7509 10.8227 22.7024 10.8115C21.7305 10.5843 20.1406 10.4115 18.488 10.8227C17.0133 11.1901 15.8875 11.7572 15.0665 12.3668C15.0254 12.3981 14.9757 12.3418 15.0088 12.3023Z",fill:"black"}));var x=Object(a.createElement)(h.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(a.createElement)(h.Path,{d:"M3.25 12a8.75 8.75 0 1117.5 0 8.75 8.75 0 01-17.5 0zM12 4.75a7.25 7.25 0 100 14.5 7.25 7.25 0 000-14.5zm-1.338 4.877c-.314.22-.412.452-.412.623 0 .171.098.403.412.623.312.218.783.377 1.338.377.825 0 1.605.233 2.198.648.59.414 1.052 1.057 1.052 1.852 0 .795-.461 1.438-1.052 1.852-.41.286-.907.486-1.448.582v.316a.75.75 0 01-1.5 0v-.316a3.64 3.64 0 01-1.448-.582c-.59-.414-1.052-1.057-1.052-1.852a.75.75 0 011.5 0c0 .171.098.403.412.623.312.218.783.377 1.338.377s1.026-.159 1.338-.377c.314-.22.412-.452.412-.623 0-.171-.098-.403-.412-.623-.312-.218-.783-.377-1.338-.377-.825 0-1.605-.233-2.198-.648-.59-.414-1.052-1.057-1.052-1.852 0-.795.461-1.438 1.052-1.852a3.64 3.64 0 011.448-.582V7.5a.75.75 0 011.5 0v.316c.54.096 1.039.296 1.448.582.59.414 1.052 1.057 1.052 1.852a.75.75 0 01-1.5 0c0-.171-.098-.403-.412-.623-.312-.218-.783-.377-1.338-.377s-1.026.159-1.338.377z"}));var P=Object(a.createElement)(h.SVG,{xmlns:"http://www.w3.org/2000/svg"},Object(a.createElement)(h.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M14.75 9C16.1307 9 17.25 7.88071 17.25 6.5C17.25 5.11929 16.1307 4 14.75 4C13.3693 4 12.25 5.11929 12.25 6.5C12.25 5.11929 11.1307 4 9.75 4C8.36929 4 7.25 5.11929 7.25 6.5C7.25 7.88071 8.36929 9 9.75 9H4V20L20 20V9L14.75 9ZM14.75 7.5C15.3023 7.5 15.75 7.05228 15.75 6.5C15.75 5.94772 15.3023 5.5 14.75 5.5C14.1977 5.5 13.75 5.94772 13.75 6.5V7.5H14.75ZM18.5 18.5V10.5H13V18.5H18.5ZM11.5 18.5H5.5L5.5 10.5H11.5L11.5 18.5ZM8.75 6.5C8.75 7.05228 9.19772 7.5 9.75 7.5H10.75V6.5C10.75 5.94772 10.3023 5.5 9.75 5.5C9.19772 5.5 8.75 5.94772 8.75 6.5Z"}));var _=Object(a.createElement)(h.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(a.createElement)(h.Path,{d:"M15.6 7.2H14v1.5h1.6c2 0 3.7 1.7 3.7 3.7s-1.7 3.7-3.7 3.7H14v1.5h1.6c2.8 0 5.2-2.3 5.2-5.2 0-2.9-2.3-5.2-5.2-5.2zM4.7 12.4c0-2 1.7-3.7 3.7-3.7H10V7.2H8.4c-2.9 0-5.2 2.3-5.2 5.2 0 2.9 2.3 5.2 5.2 5.2H10v-1.5H8.4c-2 0-3.7-1.7-3.7-3.7zm4.6.9h5.3v-1.5H9.3v1.5z"}));var k=Object(a.createElement)(h.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(a.createElement)(h.Path,{d:"M17.5 9a2 2 0 11-4 0 2 2 0 014 0zm-4.25 8v-2a2.75 2.75 0 00-2.75-2.75h-4A2.75 2.75 0 003.75 15v2h1.5v-2c0-.69.56-1.25 1.25-1.25h4c.69 0 1.25.56 1.25 1.25v2h1.5zm7-2v2h-1.5v-2c0-.69-.56-1.25-1.25-1.25H15v-1.5h2.5A2.75 2.75 0 0120.25 15zM8.5 11a2 2 0 100-4 2 2 0 000 4z"}));var S=Object(a.createElement)(h.SVG,{xmlns:"http://www.w3.org/2000/svg"},Object(a.createElement)(h.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M15 16.5H9V15h6v1.5zM15.0052 5.99481c-1.6597-1.65973-4.3507-1.65973-6.0104 0-1.65973 1.65973-1.65973 4.35069 0 6.01039.29289.2929.29289.7678 0 1.0607-.2929.2929-.76777.2929-1.06066 0-2.24552-2.2455-2.24552-5.88624 0-8.13175 2.24556-2.24551 5.88616-2.24551 8.13176 0 2.2455 2.24551 2.2455 5.88625 0 8.13175-.2929.2929-.7678.2929-1.0607 0-.2929-.2929-.2929-.7678 0-1.0607 1.6597-1.6597 1.6597-4.35066 0-6.01039zM14 19.5h-4V18h4v1.5z"}));class N extends a.Component{render(){const e=Object(f.camelCase)(this.props.product);let t=g;return e in r&&(t=r[e]),Object(a.createElement)("div",{className:l()(this.props.className,"woocommerce-admin-marketing-product-icon")},Object(a.createElement)(p.a,{icon:t}))}}N.propTypes={product:m.a.string.isRequired,className:m.a.string};var R=N,T=n(172),M=n(169);n(275);const V=({children:e,animationKey:t,animate:n})=>{const[r,o]=Object(a.useState)(null),c=Object(a.useRef)(),i=l()("woocommerce-marketing-slider",n&&"animate-"+n),s={};r&&(s.height=r);const u=Object(f.debounce)(()=>{const e=c.current.querySelector(".woocommerce-marketing-slider__slide");o(e.clientHeight)},50);Object(a.useEffect)(()=>(window.addEventListener("resize",u),()=>{window.removeEventListener("resize",u)}),[]);return Object(a.createElement)("div",{className:i,ref:c,style:s},Object(a.createElement)(T.a,null,Object(a.createElement)(M.a,{timeout:320,classNames:"slide",key:t,onEnter:()=>{const e=c.current.querySelector(".slide-enter");o(e.clientHeight)}},Object(a.createElement)("div",{className:"woocommerce-marketing-slider__slide"},e))))};V.propTypes={animationKey:m.a.any.isRequired,animate:m.a.oneOf([null,"left","right"])};var L=V},116:function(e,t,n){"use strict";function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var o=n(22);var c=n(0);function a(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}t.a=function(e){var t=e.icon,n=e.size,i=void 0===n?24:n,s=function(e,t){if(null==e)return{};var n,r,c=Object(o.a)(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(c[n]=e[n])}return c}(e,["icon","size"]);return Object(c.cloneElement)(t,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?a(Object(n),!0).forEach((function(t){r(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):a(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({width:i,height:i},s))}},121:function(e,t,n){},13:function(e,t,n){"use strict";n.d(t,"a",(function(){return s})),n.d(t,"b",(function(){return l})),n.d(t,"c",(function(){return u})),n.d(t,"f",(function(){return d})),n.d(t,"g",(function(){return m})),n.d(t,"e",(function(){return p})),n.d(t,"d",(function(){return f}));var r=n(2);const o=["wcAdminSettings","preloadSettings"],c="object"==typeof wcSettings?wcSettings:{},a=Object.keys(c).reduce((e,t)=>(o.includes(t)||(e[t]=c[t]),e),{});Object.keys(c.admin||{}).forEach(e=>{o.includes(e)||(a[e]=c.admin[e])});const i=a.adminUrl,s=(a.countries,a.currency),l=a.locale,u=a.orderStatuses;a.siteTitle,a.wcAssetUrl;function d(e,t=!1,n=(e=>e)){if(o.includes(e))throw new Error(Object(r.__)("Mutable settings should be accessed via data store."));return n(a.hasOwnProperty(e)?a[e]:t,t)}function m(e,t,n=(e=>e)){if(o.includes(e))throw new Error(Object(r.__)("Mutable settings should be mutated via data store."));a[e]=n(t)}function p(e){return(i||"")+e}function f(e){return new Promise((t,n)=>{document.querySelector(`#${e.handle}-js`)&&t();const r=document.createElement("script");r.src=e.src,r.id=e.handle+"-js",r.async=!0,r.onload=t,r.onerror=n,document.body.appendChild(r)})}},14:function(e,t){e.exports=window.wp.compose},15:function(e,t){e.exports=window.wp.url},16:function(e,t){e.exports=window.wc.tracks},162:function(e,t,n){"use strict";n.d(t,"a",(function(){return c}));var r=n(15),o=n(13);const c=(e,t={})=>{const{pathname:n,search:c}=window.location,a=Object(o.f)("connectNonce","");return t={"wccom-site":Object(o.f)("siteUrl"),"wccom-back":n+c,"wccom-woo-version":Object(o.f)("wcVersion"),"wccom-connect-nonce":a,...t},Object(r.addQueryArgs)(e,t)}},163:function(e,t,n){},169:function(e,t,n){"use strict";var r=n(23),o=n(22),c=n(25);n(1);function a(e,t){return e.replace(new RegExp("(^|\\s)"+t+"(?:\\s|$)","g"),"$1").replace(/\s+/g," ").replace(/^\s*|\s*$/g,"")}var i=n(5),s=n.n(i),l=n(65),u=function(e,t){return e&&t&&t.split(" ").forEach((function(t){return r=t,void((n=e).classList?n.classList.remove(r):"string"==typeof n.className?n.className=a(n.className,r):n.setAttribute("class",a(n.className&&n.className.baseVal||"",r)));var n,r}))},d=function(e){function t(){for(var t,n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return(t=e.call.apply(e,[this].concat(r))||this).appliedClasses={appear:{},enter:{},exit:{}},t.onEnter=function(e,n){var r=t.resolveArguments(e,n),o=r[0],c=r[1];t.removeClasses(o,"exit"),t.addClass(o,c?"appear":"enter","base"),t.props.onEnter&&t.props.onEnter(e,n)},t.onEntering=function(e,n){var r=t.resolveArguments(e,n),o=r[0],c=r[1]?"appear":"enter";t.addClass(o,c,"active"),t.props.onEntering&&t.props.onEntering(e,n)},t.onEntered=function(e,n){var r=t.resolveArguments(e,n),o=r[0],c=r[1]?"appear":"enter";t.removeClasses(o,c),t.addClass(o,c,"done"),t.props.onEntered&&t.props.onEntered(e,n)},t.onExit=function(e){var n=t.resolveArguments(e)[0];t.removeClasses(n,"appear"),t.removeClasses(n,"enter"),t.addClass(n,"exit","base"),t.props.onExit&&t.props.onExit(e)},t.onExiting=function(e){var n=t.resolveArguments(e)[0];t.addClass(n,"exit","active"),t.props.onExiting&&t.props.onExiting(e)},t.onExited=function(e){var n=t.resolveArguments(e)[0];t.removeClasses(n,"exit"),t.addClass(n,"exit","done"),t.props.onExited&&t.props.onExited(e)},t.resolveArguments=function(e,n){return t.props.nodeRef?[t.props.nodeRef.current,e]:[e,n]},t.getClassNames=function(e){var n=t.props.classNames,r="string"==typeof n,o=r?""+(r&&n?n+"-":"")+e:n[e];return{baseClassName:o,activeClassName:r?o+"-active":n[e+"Active"],doneClassName:r?o+"-done":n[e+"Done"]}},t}Object(c.a)(t,e);var n=t.prototype;return n.addClass=function(e,t,n){var r=this.getClassNames(t)[n+"ClassName"],o=this.getClassNames("enter").doneClassName;"appear"===t&&"done"===n&&o&&(r+=" "+o),"active"===n&&e&&e.scrollTop,r&&(this.appliedClasses[t][n]=r,function(e,t){e&&t&&t.split(" ").forEach((function(t){return r=t,void((n=e).classList?n.classList.add(r):function(e,t){return e.classList?!!t&&e.classList.contains(t):-1!==(" "+(e.className.baseVal||e.className)+" ").indexOf(" "+t+" ")}(n,r)||("string"==typeof n.className?n.className=n.className+" "+r:n.setAttribute("class",(n.className&&n.className.baseVal||"")+" "+r)));var n,r}))}(e,r))},n.removeClasses=function(e,t){var n=this.appliedClasses[t],r=n.base,o=n.active,c=n.done;this.appliedClasses[t]={},r&&u(e,r),o&&u(e,o),c&&u(e,c)},n.render=function(){var e=this.props,t=(e.classNames,Object(o.a)(e,["classNames"]));return s.a.createElement(l.a,Object(r.a)({},t,{onEnter:this.onEnter,onEntered:this.onEntered,onEntering:this.onEntering,onExit:this.onExit,onExiting:this.onExiting,onExited:this.onExited}))},t}(s.a.Component);d.defaultProps={classNames:""},d.propTypes={};t.a=d},170:function(e,t,n){"use strict";var r=n(35),o=n.n(r),c=n(0),a=n(2),i=n(14),s=n(6),l=n.n(s),u=n(7),d=n(1),m=n.n(d),p=(n(121),n(16)),f=n(102),h=n(162);const g=({title:e,description:t,url:n,product:r,category:o})=>{const a="woocommerce-marketing-recommended-extensions-item",i=Object(h.a)(n);return"coupons"===o&&"automatewoo"===r&&(r="automatewoo-alt"),Object(c.createElement)("a",{href:i,className:a,onClick:()=>{Object(p.recordEvent)("marketing_recommended_extension",{name:e})}},Object(c.createElement)(f.b,{product:r}),Object(c.createElement)("div",{className:a+"__text"},Object(c.createElement)("h4",null,e),Object(c.createElement)("p",null,t)))};g.propTypes={title:m.a.string.isRequired,description:m.a.string.isRequired,url:m.a.string.isRequired,product:m.a.string.isRequired,category:m.a.string.isRequired};var b=g;var E=()=>{const e="is-loading woocommerce-marketing-recommended-extensions-item";return Object(c.createElement)("div",{className:e,"aria-hidden":"true"},Object(c.createElement)("div",{className:"woocommerce-admin-marketing-product-icon is-placeholder"}),Object(c.createElement)("div",{className:e+"__text"},Object(c.createElement)("h4",{className:"is-placeholder","aria-hidden":"true"}),Object(c.createElement)("p",null,Object(c.createElement)("span",{className:"is-placeholder"}),Object(c.createElement)("span",{className:"is-placeholder"}),Object(c.createElement)("span",{className:"is-placeholder"}))))},v=n(46),O=n(77);const w=({extensions:e,isLoading:t,title:n,description:r,category:a})=>{if(0===e.length&&!t)return null;const i=a?"woocommerce-marketing-recommended-extensions-card__category-"+a:"";return Object(c.createElement)(O.a,{title:n,description:r,className:l()("woocommerce-marketing-recommended-extensions-card",i)},t?Object(c.createElement)("div",{className:l()("woocommerce-marketing-recommended-extensions-card__items","woocommerce-marketing-recommended-extensions-card__items--count-5")},[...Array(5).keys()].map(e=>Object(c.createElement)(E,{key:e}))):Object(c.createElement)("div",{className:l()("woocommerce-marketing-recommended-extensions-card__items","woocommerce-marketing-recommended-extensions-card__items--count-"+e.length)},e.map(e=>Object(c.createElement)(b,o()({key:e.product,category:a},e)))))};w.propTypes={extensions:m.a.arrayOf(m.a.object).isRequired,isLoading:m.a.bool.isRequired,title:m.a.string,description:m.a.string,category:m.a.string},w.defaultProps={title:Object(a.__)("Recommended extensions",'woocommerce'),description:Object(a.__)("Great marketing requires the right tools. Take your marketing to the next level with our recommended marketing extensions.",'woocommerce')};t.a=Object(i.compose)(Object(u.withSelect)((e,t)=>{const{getRecommendedPlugins:n,isResolving:r}=e(v.b);return{extensions:n(t.category),isLoading:r("getRecommendedPlugins",[t.category])}}),Object(u.withDispatch)(e=>{const{createNotice:t}=e("core/notices");return{createNotice:t}}))(w)},171:function(e,t,n){"use strict";var r=n(0),o=n(14),c=n(2),a=n(6),i=n.n(a),s=n(7),l=n(1),u=n.n(l),d=n(21),m=n(16),p=(n(163),n(102)),f=n(46),h=n(77),g=n(18),b=n.n(g);var E=()=>b()({mixedString:Object(c.__)("Read {{link}}the WooCommerce blog{{/link}} for more tips on marketing your store",'woocommerce'),components:{link:Object(r.createElement)(d.Link,{type:"external",href:"https://woocommerce.com/blog/marketing/coupons/?utm_medium=product",target:"_blank"})}});var v=e=>{const t="woocommerce-marketing-knowledgebase-card__post";return Object(r.createElement)("div",{className:"is-loading "+t,key:e,"aria-hidden":"true"},Object(r.createElement)("div",{className:t+"-img is-placeholder"}),Object(r.createElement)("div",{className:t+"-text"},Object(r.createElement)("h3",{className:"is-placeholder","aria-hidden":"true"}),Object(r.createElement)("p",{className:t+"-meta is-placeholder"})))};const O=({posts:e,isLoading:t,error:n,title:o,description:a,category:s})=>{const[l,u]=Object(r.useState)(1),[f,g]=Object(r.useState)(null),b=e=>{let t;e>l?(t="left",Object(m.recordEvent)("marketing_knowledge_carousel",{direction:"forward",page:e})):(t="right",Object(m.recordEvent)("marketing_knowledge_carousel",{direction:"back",page:e})),u(e),g(t)},O=()=>{const t=e.slice(2*(l-1),2*(l-1)+2),n=i()("woocommerce-marketing-knowledgebase-card__page",{"page-with-single-post":1===t.length}),o=t.map((e,t)=>Object(r.createElement)("a",{className:"woocommerce-marketing-knowledgebase-card__post",href:e.link,key:t,onClick:()=>{(e=>{Object(m.recordEvent)("marketing_knowledge_article",{title:e.title})})(e)},target:"_blank",rel:"noopener noreferrer"},e.image&&Object(r.createElement)("div",{className:"woocommerce-marketing-knowledgebase-card__post-img"},Object(r.createElement)("img",{src:e.image,alt:""})),Object(r.createElement)("div",{className:"woocommerce-marketing-knowledgebase-card__post-text"},Object(r.createElement)("h3",null,e.title),Object(r.createElement)("p",{className:"woocommerce-marketing-knowledgebase-card__post-meta"},Object(c.__)("By",'woocommerce')+" ",e.author_name,e.author_avatar&&Object(r.createElement)("img",{src:e.author_avatar.replace("s=96","s=32"),className:"woocommerce-gravatar",alt:"",width:"16",height:"16"})))));return Object(r.createElement)("div",{className:n},o)},w=s?"woocommerce-marketing-knowledgebase-card__category-"+s:"";return Object(r.createElement)(h.a,{title:o,description:a,className:i()("woocommerce-marketing-knowledgebase-card",w)},t?Object(r.createElement)("div",{className:"woocommerce-marketing-knowledgebase-card__posts"},Object(r.createElement)("div",{className:"woocommerce-marketing-knowledgebase-card__page"},Object(r.createElement)(v,null),Object(r.createElement)(v,null))):n?(()=>{const e=Object(c.__)("Oops, our posts aren't loading right now",'woocommerce');return Object(r.createElement)(d.EmptyContent,{title:e,message:Object(r.createElement)(E,null),illustration:"",actionLabel:""})})():0===e.length?(()=>{const e=Object(c.__)("No posts yet",'woocommerce');return Object(r.createElement)(d.EmptyContent,{title:e,message:Object(r.createElement)(E,null),illustration:"",actionLabel:""})})():Object(r.createElement)("div",{className:"woocommerce-marketing-knowledgebase-card__posts"},Object(r.createElement)(p.c,{animationKey:l,animate:f},O()),Object(r.createElement)(d.Pagination,{page:l,perPage:2,total:e.length,onPageChange:b,showPagePicker:!1,showPerPagePicker:!1,showPageArrowsLabel:!1})))};O.propTypes={posts:u.a.arrayOf(u.a.object).isRequired,isLoading:u.a.bool.isRequired,title:u.a.string,description:u.a.string,category:u.a.string},O.defaultProps={title:Object(c.__)("WooCommerce knowledge base",'woocommerce'),description:Object(c.__)("Learn the ins and outs of successful marketing from the experts at WooCommerce.",'woocommerce')};t.a=Object(o.compose)(Object(s.withSelect)((e,t)=>{const{getBlogPosts:n,getBlogPostsError:r,isResolving:o}=e(f.b);return{posts:n(t.category),isLoading:o("getBlogPosts",[t.category]),error:r(t.category)}}),Object(s.withDispatch)(e=>{const{createNotice:t}=e("core/notices");return{createNotice:t}}))(O)},172:function(e,t,n){"use strict";var r=n(22),o=n(23);var c=n(25),a=(n(1),n(5)),i=n.n(a),s=n(33);function l(e,t){var n=Object.create(null);return e&&a.Children.map(e,(function(e){return e})).forEach((function(e){n[e.key]=function(e){return t&&Object(a.isValidElement)(e)?t(e):e}(e)})),n}function u(e,t,n){return null!=n[t]?n[t]:e.props[t]}function d(e,t,n){var r=l(e.children),o=function(e,t){function n(n){return n in t?t[n]:e[n]}e=e||{},t=t||{};var r,o=Object.create(null),c=[];for(var a in e)a in t?c.length&&(o[a]=c,c=[]):c.push(a);var i={};for(var s in t){if(o[s])for(r=0;r<o[s].length;r++){var l=o[s][r];i[o[s][r]]=n(l)}i[s]=n(s)}for(r=0;r<c.length;r++)i[c[r]]=n(c[r]);return i}(t,r);return Object.keys(o).forEach((function(c){var i=o[c];if(Object(a.isValidElement)(i)){var s=c in t,l=c in r,d=t[c],m=Object(a.isValidElement)(d)&&!d.props.in;!l||s&&!m?l||!s||m?l&&s&&Object(a.isValidElement)(d)&&(o[c]=Object(a.cloneElement)(i,{onExited:n.bind(null,i),in:d.props.in,exit:u(i,"exit",e),enter:u(i,"enter",e)})):o[c]=Object(a.cloneElement)(i,{in:!1}):o[c]=Object(a.cloneElement)(i,{onExited:n.bind(null,i),in:!0,exit:u(i,"exit",e),enter:u(i,"enter",e)})}})),o}var m=Object.values||function(e){return Object.keys(e).map((function(t){return e[t]}))},p=function(e){function t(t,n){var r,o=(r=e.call(this,t,n)||this).handleExited.bind(function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(r));return r.state={contextValue:{isMounting:!0},handleExited:o,firstRender:!0},r}Object(c.a)(t,e);var n=t.prototype;return n.componentDidMount=function(){this.mounted=!0,this.setState({contextValue:{isMounting:!1}})},n.componentWillUnmount=function(){this.mounted=!1},t.getDerivedStateFromProps=function(e,t){var n,r,o=t.children,c=t.handleExited;return{children:t.firstRender?(n=e,r=c,l(n.children,(function(e){return Object(a.cloneElement)(e,{onExited:r.bind(null,e),in:!0,appear:u(e,"appear",n),enter:u(e,"enter",n),exit:u(e,"exit",n)})}))):d(e,o,c),firstRender:!1}},n.handleExited=function(e,t){var n=l(this.props.children);e.key in n||(e.props.onExited&&e.props.onExited(t),this.mounted&&this.setState((function(t){var n=Object(o.a)({},t.children);return delete n[e.key],{children:n}})))},n.render=function(){var e=this.props,t=e.component,n=e.childFactory,o=Object(r.a)(e,["component","childFactory"]),c=this.state.contextValue,a=m(this.state.children).map(n);return delete o.appear,delete o.enter,delete o.exit,null===t?i.a.createElement(s.a.Provider,{value:c},a):i.a.createElement(s.a.Provider,{value:c},i.a.createElement(t,o,a))},t}(i.a.Component);p.propTypes={},p.defaultProps={component:"div",childFactory:function(e){return e}};t.a=p},18:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o=i(n(5)),c=i(n(69)),a=i(n(72));function i(e){return e&&e.__esModule?e:{default:e}}var s=void 0;function l(e,t){var n,a,i,u,d,m,p,f,h=[],g={};for(m=0;m<e.length;m++)if("string"!==(d=e[m]).type){if(!t.hasOwnProperty(d.value)||void 0===t[d.value])throw new Error("Invalid interpolation, missing component node: `"+d.value+"`");if("object"!==r(t[d.value]))throw new Error("Invalid interpolation, component node must be a ReactElement or null: `"+d.value+"`","\n> "+s);if("componentClose"===d.type)throw new Error("Missing opening component token: `"+d.value+"`");if("componentOpen"===d.type){n=t[d.value],i=m;break}h.push(t[d.value])}else h.push(d.value);return n&&(u=function(e,t){var n,r,o=t[e],c=0;for(r=e+1;r<t.length;r++)if((n=t[r]).value===o.value){if("componentOpen"===n.type){c++;continue}if("componentClose"===n.type){if(0===c)return r;c--}}throw new Error("Missing closing component token `"+o.value+"`")}(i,e),p=l(e.slice(i+1,u),t),a=o.default.cloneElement(n,{},p),h.push(a),u<e.length-1&&(f=l(e.slice(u+1),t),h=h.concat(f))),1===h.length?h[0]:(h.forEach((function(e,t){e&&(g["interpolation-child-"+t]=e)})),(0,c.default)(g))}t.default=function(e){var t=e.mixedString,n=e.components,o=e.throwErrors;if(s=t,!n)return t;if("object"!==(void 0===n?"undefined":r(n))){if(o)throw new Error("Interpolation Error: unable to process `"+t+"` because components is not an object");return t}var c=(0,a.default)(t);try{return l(c,n)}catch(e){if(o)throw new Error("Interpolation Error: unable to process `"+t+"` because of error `"+e.message+"`");return t}}},2:function(e,t){e.exports=window.wp.i18n},20:function(e,t){e.exports=window.wc.experimental},21:function(e,t){e.exports=window.wc.components},22:function(e,t,n){"use strict";function r(e,t){if(null==e)return{};var n,r,o={},c=Object.keys(e);for(r=0;r<c.length;r++)n=c[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}n.d(t,"a",(function(){return r}))},23:function(e,t,n){"use strict";function r(){return(r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}n.d(t,"a",(function(){return r}))},25:function(e,t,n){"use strict";function r(e,t){return(r=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function o(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,r(e,t)}n.d(t,"a",(function(){return o}))},272:function(e,t,n){},273:function(e,t,n){},274:function(e,t,n){},275:function(e,t,n){},276:function(e,t,n){"use strict";var r={};n.r(r),n.d(r,"receiveInstalledPlugins",(function(){return d})),n.d(r,"receiveActivatingPlugin",(function(){return m})),n.d(r,"removeActivatingPlugin",(function(){return p})),n.d(r,"receiveRecommendedPlugins",(function(){return f})),n.d(r,"receiveBlogPosts",(function(){return h})),n.d(r,"handleFetchError",(function(){return g})),n.d(r,"setError",(function(){return b})),n.d(r,"activateInstalledPlugin",(function(){return E})),n.d(r,"loadInstalledPluginsAfterActivation",(function(){return v}));var o={};n.r(o),n.d(o,"getInstalledPlugins",(function(){return O})),n.d(o,"getActivatingPlugins",(function(){return w})),n.d(o,"getRecommendedPlugins",(function(){return C})),n.d(o,"getBlogPosts",(function(){return j})),n.d(o,"getBlogPostsError",(function(){return y}));var c={};n.r(c),n.d(c,"getRecommendedPlugins",(function(){return x})),n.d(c,"getBlogPosts",(function(){return P}));var a=n(10),i=n(7),s=n(46),l=n(2);var u={SET_INSTALLED_PLUGINS:"SET_INSTALLED_PLUGINS",SET_ACTIVATING_PLUGIN:"SET_ACTIVATING_PLUGIN",REMOVE_ACTIVATING_PLUGIN:"REMOVE_ACTIVATING_PLUGIN",SET_RECOMMENDED_PLUGINS:"SET_RECOMMENDED_PLUGINS",SET_BLOG_POSTS:"SET_BLOG_POSTS",SET_ERROR:"SET_ERROR"};function d(e){return{type:u.SET_INSTALLED_PLUGINS,plugins:e}}function m(e){return{type:u.SET_ACTIVATING_PLUGIN,pluginSlug:e}}function p(e){return{type:u.REMOVE_ACTIVATING_PLUGIN,pluginSlug:e}}function f(e,t){return{type:u.SET_RECOMMENDED_PLUGINS,data:{plugins:e,category:t}}}function h(e,t){return{type:u.SET_BLOG_POSTS,data:{posts:e,category:t}}}function g(e,t){const{createNotice:n}=Object(i.dispatch)("core/notices");n("error",t),console.log(e)}function b(e,t){return{type:u.SET_ERROR,category:e,error:t}}function*E(e){const{createNotice:t}=Object(i.dispatch)("core/notices");yield m(e);try{if(!(yield Object(a.apiFetch)({path:s.a+"/overview/activate-plugin",method:"POST",data:{plugin:e}})))throw new Error;yield t("success",Object(l.__)("The extension has been successfully activated.",'woocommerce')),yield v(e)}catch(t){yield g(t,Object(l.__)("There was an error trying to activate the extension.",'woocommerce')),yield p(e)}return!0}function*v(e){try{const t=yield Object(a.apiFetch)({path:s.a+"/overview/installed-plugins"});if(!t)throw new Error;yield d(t),yield p(e)}catch(e){yield g(e,Object(l.__)("There was an error loading installed extensions.",'woocommerce'))}}function O(e){return e.installedPlugins}function w(e){return e.activatingPlugins}function C(e,t){return e.recommendedPlugins[t]||[]}function j(e,t){return e.blogPosts[t]||[]}function y(e,t){return e.errors.blogPosts&&e.errors.blogPosts[t]}function*x(e){try{const t=yield e?"&category="+e:"",n=yield Object(a.apiFetch)({path:`${s.a}/recommended?per_page=6${t}`});if(!n)throw new Error;yield f(n,e)}catch(e){yield g(e,Object(l.__)("There was an error loading recommended extensions.",'woocommerce'))}}function*P(e){try{const t=yield e?"?category="+e:"",n=yield Object(a.apiFetch)({path:`${s.a}/knowledge-base${t}`,method:"GET"});if(!n)throw new Error;yield h(n,e)}catch(t){yield b(e,t)}}var _=n(13),k=n(4);const{installedExtensions:S}=Object(_.f)("marketing",{}),N={installedPlugins:S,activatingPlugins:[],recommendedPlugins:{},blogPosts:{},errors:{}};var R=(e=N,t)=>{switch(t.type){case u.SET_INSTALLED_PLUGINS:return{...e,installedPlugins:t.plugins};case u.SET_ACTIVATING_PLUGIN:return{...e,activatingPlugins:[...e.activatingPlugins,t.pluginSlug]};case u.REMOVE_ACTIVATING_PLUGIN:return{...e,activatingPlugins:Object(k.without)(e.activatingPlugins,t.pluginSlug)};case u.SET_RECOMMENDED_PLUGINS:return{...e,recommendedPlugins:{...e.recommendedPlugins,[t.data.category]:t.data.plugins}};case u.SET_BLOG_POSTS:return{...e,blogPosts:{...e.blogPosts,[t.data.category]:t.data.posts}};case u.SET_ERROR:return{...e,errors:{...e.errors,blogPosts:{...e.errors.blogPosts,[t.category]:t.error}}};default:return e}};Object(i.registerStore)(s.b,{actions:r,selectors:o,resolvers:c,controls:a.controls,reducer:R})},29:function(e,t){e.exports=window.ReactDOM},3:function(e,t){e.exports=window.wp.components},33:function(e,t,n){"use strict";var r=n(5),o=n.n(r);t.a=o.a.createContext(null)},35:function(e,t){function n(){return e.exports=n=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},e.exports.default=e.exports,e.exports.__esModule=!0,n.apply(this,arguments)}e.exports=n,e.exports.default=e.exports,e.exports.__esModule=!0},4:function(e,t){e.exports=window.lodash},453:function(e,t,n){},46:function(e,t,n){"use strict";n.d(t,"b",(function(){return r})),n.d(t,"a",(function(){return o}));const r="wc/marketing",o="/wc-admin/marketing"},469:function(e,t,n){"use strict";n.r(t);var r=n(0),o=n(2),c=n(13),a=(n(453),n(170)),i=n(171);n(276);var s=()=>{const e=Object(c.f)("allowMarketplaceSuggestions",!1);return Object(r.createElement)("div",{className:"woocommerce-marketing-coupons"},e&&Object(r.createElement)(a.a,{title:Object(o.__)("Recommended coupon extensions",'woocommerce'),description:Object(o.__)("Take your coupon marketing to the next level with our recommended coupon extensions.",'woocommerce'),category:"coupons"}),Object(r.createElement)(i.a,{category:"coupons",description:Object(o.__)("Learn the ins and outs of successful coupon marketing from the experts at WooCommerce.",'woocommerce')}))};const l=document.getElementById("posts-filter");if(l){const e=document.createElement("div");e.setAttribute("id","coupon-root"),Object(r.render)(Object(r.createElement)(s,null),l.parentNode.appendChild(e))}},47:function(e,t,n){"use strict";var r=n(48);function o(){}function c(){}c.resetWarningCache=o,e.exports=function(){function e(e,t,n,o,c,a){if(a!==r){var i=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw i.name="Invariant Violation",i}}function t(){return e}e.isRequired=e;var n={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:c,resetWarningCache:o};return n.PropTypes=n,n}},48:function(e,t,n){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},5:function(e,t){e.exports=window.React},50:function(e,t,n){"use strict";function r(e){return function(){return e}}var o=function(){};o.thatReturns=r,o.thatReturnsFalse=r(!1),o.thatReturnsTrue=r(!0),o.thatReturnsNull=r(null),o.thatReturnsThis=function(){return this},o.thatReturnsArgument=function(e){return e},e.exports=o},6:function(e,t,n){!function(){"use strict";var t={}.hasOwnProperty;function n(){for(var e=[],r=0;r<arguments.length;r++){var o=arguments[r];if(o){var c=typeof o;if("string"===c||"number"===c)e.push(o);else if(Array.isArray(o)){if(o.length){var a=n.apply(null,o);a&&e.push(a)}}else if("object"===c)if(o.toString===Object.prototype.toString)for(var i in o)t.call(o,i)&&o[i]&&e.push(i);else e.push(o.toString())}}return e.join(" ")}e.exports?(n.default=n,e.exports=n):"function"==typeof define&&"object"==typeof define.amd&&define.amd?define("classnames",[],(function(){return n})):window.classNames=n}()},65:function(e,t,n){"use strict";var r=n(22),o=n(25),c=(n(1),n(5)),a=n.n(c),i=n(29),s=n.n(i),l=!1,u=n(33),d=function(e){function t(t,n){var r;r=e.call(this,t,n)||this;var o,c=n&&!n.isMounting?t.enter:t.appear;return r.appearStatus=null,t.in?c?(o="exited",r.appearStatus="entering"):o="entered":o=t.unmountOnExit||t.mountOnEnter?"unmounted":"exited",r.state={status:o},r.nextCallback=null,r}Object(o.a)(t,e),t.getDerivedStateFromProps=function(e,t){return e.in&&"unmounted"===t.status?{status:"exited"}:null};var n=t.prototype;return n.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},n.componentDidUpdate=function(e){var t=null;if(e!==this.props){var n=this.state.status;this.props.in?"entering"!==n&&"entered"!==n&&(t="entering"):"entering"!==n&&"entered"!==n||(t="exiting")}this.updateStatus(!1,t)},n.componentWillUnmount=function(){this.cancelNextCallback()},n.getTimeouts=function(){var e,t,n,r=this.props.timeout;return e=t=n=r,null!=r&&"number"!=typeof r&&(e=r.exit,t=r.enter,n=void 0!==r.appear?r.appear:t),{exit:e,enter:t,appear:n}},n.updateStatus=function(e,t){void 0===e&&(e=!1),null!==t?(this.cancelNextCallback(),"entering"===t?this.performEnter(e):this.performExit()):this.props.unmountOnExit&&"exited"===this.state.status&&this.setState({status:"unmounted"})},n.performEnter=function(e){var t=this,n=this.props.enter,r=this.context?this.context.isMounting:e,o=this.props.nodeRef?[r]:[s.a.findDOMNode(this),r],c=o[0],a=o[1],i=this.getTimeouts(),u=r?i.appear:i.enter;!e&&!n||l?this.safeSetState({status:"entered"},(function(){t.props.onEntered(c)})):(this.props.onEnter(c,a),this.safeSetState({status:"entering"},(function(){t.props.onEntering(c,a),t.onTransitionEnd(u,(function(){t.safeSetState({status:"entered"},(function(){t.props.onEntered(c,a)}))}))})))},n.performExit=function(){var e=this,t=this.props.exit,n=this.getTimeouts(),r=this.props.nodeRef?void 0:s.a.findDOMNode(this);t&&!l?(this.props.onExit(r),this.safeSetState({status:"exiting"},(function(){e.props.onExiting(r),e.onTransitionEnd(n.exit,(function(){e.safeSetState({status:"exited"},(function(){e.props.onExited(r)}))}))}))):this.safeSetState({status:"exited"},(function(){e.props.onExited(r)}))},n.cancelNextCallback=function(){null!==this.nextCallback&&(this.nextCallback.cancel(),this.nextCallback=null)},n.safeSetState=function(e,t){t=this.setNextCallback(t),this.setState(e,t)},n.setNextCallback=function(e){var t=this,n=!0;return this.nextCallback=function(r){n&&(n=!1,t.nextCallback=null,e(r))},this.nextCallback.cancel=function(){n=!1},this.nextCallback},n.onTransitionEnd=function(e,t){this.setNextCallback(t);var n=this.props.nodeRef?this.props.nodeRef.current:s.a.findDOMNode(this),r=null==e&&!this.props.addEndListener;if(n&&!r){if(this.props.addEndListener){var o=this.props.nodeRef?[this.nextCallback]:[n,this.nextCallback],c=o[0],a=o[1];this.props.addEndListener(c,a)}null!=e&&setTimeout(this.nextCallback,e)}else setTimeout(this.nextCallback,0)},n.render=function(){var e=this.state.status;if("unmounted"===e)return null;var t=this.props,n=t.children,o=(t.in,t.mountOnEnter,t.unmountOnExit,t.appear,t.enter,t.exit,t.timeout,t.addEndListener,t.onEnter,t.onEntering,t.onEntered,t.onExit,t.onExiting,t.onExited,t.nodeRef,Object(r.a)(t,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]));return a.a.createElement(u.a.Provider,{value:null},"function"==typeof n?n(e,o):a.a.cloneElement(a.a.Children.only(n),o))},t}(a.a.Component);function m(){}d.contextType=u.a,d.propTypes={},d.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:m,onEntering:m,onEntered:m,onExit:m,onExiting:m,onExited:m},d.UNMOUNTED="unmounted",d.EXITED="exited",d.ENTERING="entering",d.ENTERED="entered",d.EXITING="exiting";t.a=d},69:function(e,t,n){"use strict";var r=n(5),o="function"==typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103,c=n(50),a=n(70),i=n(71),s="function"==typeof Symbol&&Symbol.iterator;function l(e,t){return e&&"object"==typeof e&&null!=e.key?(n=e.key,r={"=":"=0",":":"=2"},"$"+(""+n).replace(/[=:]/g,(function(e){return r[e]}))):t.toString(36);var n,r}function u(e,t,n,r){var c,i=typeof e;if("undefined"!==i&&"boolean"!==i||(e=null),null===e||"string"===i||"number"===i||"object"===i&&e.$$typeof===o)return n(r,e,""===t?"."+l(e,0):t),1;var d=0,m=""===t?".":t+":";if(Array.isArray(e))for(var p=0;p<e.length;p++)d+=u(c=e[p],m+l(c,p),n,r);else{var f=function(e){var t=e&&(s&&e[s]||e["@@iterator"]);if("function"==typeof t)return t}(e);if(f){0;for(var h,g=f.call(e),b=0;!(h=g.next()).done;)d+=u(c=h.value,m+l(c,b++),n,r)}else if("object"===i){0;var E=""+e;a(!1,"Objects are not valid as a React child (found: %s).%s","[object Object]"===E?"object with keys {"+Object.keys(e).join(", ")+"}":E,"")}}return d}var d=/\/+/g;function m(e){return(""+e).replace(d,"$&/")}var p,f,h=g,g=function(e){if(this.instancePool.length){var t=this.instancePool.pop();return this.call(t,e),t}return new this(e)},b=function(e){a(e instanceof this,"Trying to release an instance into a pool of a different type."),e.destructor(),this.instancePool.length<this.poolSize&&this.instancePool.push(e)};function E(e,t,n,r){this.result=e,this.keyPrefix=t,this.func=n,this.context=r,this.count=0}function v(e,t,n){var o,a,i=e.result,s=e.keyPrefix,l=e.func,u=e.context,d=l.call(u,t,e.count++);Array.isArray(d)?O(d,i,n,c.thatReturnsArgument):null!=d&&(r.isValidElement(d)&&(o=d,a=s+(!d.key||t&&t.key===d.key?"":m(d.key)+"/")+n,d=r.cloneElement(o,{key:a},void 0!==o.props?o.props.children:void 0)),i.push(d))}function O(e,t,n,r,o){var c="";null!=n&&(c=m(n)+"/");var a=E.getPooled(t,c,r,o);!function(e,t,n){null==e||u(e,"",t,n)}(e,v,a),E.release(a)}E.prototype.destructor=function(){this.result=null,this.keyPrefix=null,this.func=null,this.context=null,this.count=0},p=function(e,t,n,r){if(this.instancePool.length){var o=this.instancePool.pop();return this.call(o,e,t,n,r),o}return new this(e,t,n,r)},(f=E).instancePool=[],f.getPooled=p||h,f.poolSize||(f.poolSize=10),f.release=b;e.exports=function(e){if("object"!=typeof e||!e||Array.isArray(e))return i(!1,"React.addons.createFragment only accepts a single object. Got: %s",e),e;if(r.isValidElement(e))return i(!1,"React.addons.createFragment does not accept a ReactElement without a wrapper object."),e;a(1!==e.nodeType,"React.addons.createFragment(...): Encountered an invalid child; DOM elements are not valid children of React components.");var t=[];for(var n in e)O(e[n],t,n,c.thatReturnsArgument);return t}},7:function(e,t){e.exports=window.wp.data},70:function(e,t,n){"use strict";e.exports=function(e,t,n,r,o,c,a,i){if(!e){var s;if(void 0===t)s=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var l=[n,r,o,c,a,i],u=0;(s=new Error(t.replace(/%s/g,(function(){return l[u++]})))).name="Invariant Violation"}throw s.framesToPop=1,s}}},71:function(e,t,n){"use strict";var r=n(50);e.exports=r},72:function(e,t,n){"use strict";function r(e){return e.match(/^\{\{\//)?{type:"componentClose",value:e.replace(/\W/g,"")}:e.match(/\/\}\}$/)?{type:"componentSelfClosing",value:e.replace(/\W/g,"")}:e.match(/^\{\{/)?{type:"componentOpen",value:e.replace(/\W/g,"")}:{type:"string",value:e}}e.exports=function(e){return e.split(/(\{\{\/?\s*\w+\s*\/?\}\})/g).map(r)}},77:function(e,t,n){"use strict";var r=n(0),o=n(3),c=n(1),a=n.n(c),i=n(6),s=n.n(i),l=n(20);n(273);const u=e=>{const{title:t,description:n,children:c,className:a}=e;return Object(r.createElement)(o.Card,{className:s()(a,"woocommerce-admin-marketing-card")},Object(r.createElement)(o.CardHeader,null,Object(r.createElement)("div",null,Object(r.createElement)(l.Text,{variant:"title.small",as:"p",size:"20",lineHeight:"28px"},t),Object(r.createElement)(l.Text,{variant:"subtitle.small",as:"p",className:"woocommerce-admin-marketing-card-subtitle",size:"14",lineHeight:"20px"},n))),Object(r.createElement)(o.CardBody,null,c))};u.propTypes={title:a.a.string,description:a.a.string,className:a.a.string,children:a.a.node},t.a=u},8:function(e,t){e.exports=window.wp.primitives}});woocommerce-admin/dist/wp-admin-scripts/beta-features-tracking-modal.asset.php000064400000000313151335517650023575 0ustar00<?php return array('dependencies' => array('wc-explat', 'wc-store-data', 'wc-tracks', 'wp-components', 'wp-compose', 'wp-data', 'wp-element', 'wp-i18n'), 'version' => '04305dd3c6a3465d8af4e91d1f58c70f');woocommerce-admin/dist/wp-admin-scripts/payment-method-promotions.js.LICENSE.txt000064400000000266151335517650023733 0ustar00/*! @license DOMPurify | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/2.2.2/LICENSE */
woocommerce-admin/dist/wp-admin-scripts/onboarding-product-notice.js000064400000005136151335517650021752 0ustar00this.wc=this.wc||{},this.wc.onboardingProductNotice=function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=456)}({13:function(e,t,n){"use strict";n.d(t,"a",(function(){return d})),n.d(t,"b",(function(){return s})),n.d(t,"c",(function(){return a})),n.d(t,"f",(function(){return f})),n.d(t,"g",(function(){return l})),n.d(t,"e",(function(){return p})),n.d(t,"d",(function(){return b}));var r=n(2);const o=["wcAdminSettings","preloadSettings"],c="object"==typeof wcSettings?wcSettings:{},i=Object.keys(c).reduce((e,t)=>(o.includes(t)||(e[t]=c[t]),e),{});Object.keys(c.admin||{}).forEach(e=>{o.includes(e)||(i[e]=c.admin[e])});const u=i.adminUrl,d=(i.countries,i.currency),s=i.locale,a=i.orderStatuses;i.siteTitle,i.wcAssetUrl;function f(e,t=!1,n=(e=>e)){if(o.includes(e))throw new Error(Object(r.__)("Mutable settings should be accessed via data store."));return n(i.hasOwnProperty(e)?i[e]:t,t)}function l(e,t,n=(e=>e)){if(o.includes(e))throw new Error(Object(r.__)("Mutable settings should be mutated via data store."));i[e]=n(t)}function p(e){return(u||"")+e}function b(e){return new Promise((t,n)=>{document.querySelector(`#${e.handle}-js`)&&t();const r=document.createElement("script");r.src=e.src,r.id=e.handle+"-js",r.async=!0,r.onload=t,r.onerror=n,document.body.appendChild(r)})}},2:function(e,t){e.exports=window.wp.i18n},456:function(e,t,n){"use strict";n.r(t);var r=n(2),o=n(7),c=n(51),i=n.n(c),u=n(13);i()(()=>{Object(o.dispatch)("core/notices").createSuccessNotice(Object(r.__)("🎉 Congrats on adding your first product!",'woocommerce'),{id:"WOOCOMMERCE_ONBOARDING_PRODUCT_NOTICE",actions:[{url:Object(u.e)("admin.php?page=wc-admin"),label:Object(r.__)("Continue setup.",'woocommerce')}]})})},51:function(e,t){e.exports=window.wp.domReady},7:function(e,t){e.exports=window.wp.data}});woocommerce-admin/dist/wp-admin-scripts/onboarding-homepage-notice.js000064400000007103151335517650022053 0ustar00this.wc=this.wc||{},this.wc.onboardingHomepageNotice=function(e){var t={};function n(o){if(t[o])return t[o].exports;var r=t[o]={i:o,l:!1,exports:{}};return e[o].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=e,n.c=t,n.d=function(e,t,o){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)n.d(o,r,function(t){return e[t]}.bind(null,r));return o},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=455)}({13:function(e,t,n){"use strict";n.d(t,"a",(function(){return u})),n.d(t,"b",(function(){return a})),n.d(t,"c",(function(){return d})),n.d(t,"f",(function(){return l})),n.d(t,"g",(function(){return p})),n.d(t,"e",(function(){return f})),n.d(t,"d",(function(){return b}));var o=n(2);const r=["wcAdminSettings","preloadSettings"],c="object"==typeof wcSettings?wcSettings:{},i=Object.keys(c).reduce((e,t)=>(r.includes(t)||(e[t]=c[t]),e),{});Object.keys(c.admin||{}).forEach(e=>{r.includes(e)||(i[e]=c.admin[e])});const s=i.adminUrl,u=(i.countries,i.currency),a=i.locale,d=i.orderStatuses;i.siteTitle,i.wcAssetUrl;function l(e,t=!1,n=(e=>e)){if(r.includes(e))throw new Error(Object(o.__)("Mutable settings should be accessed via data store."));return n(i.hasOwnProperty(e)?i[e]:t,t)}function p(e,t,n=(e=>e)){if(r.includes(e))throw new Error(Object(o.__)("Mutable settings should be mutated via data store."));i[e]=n(t)}function f(e){return(s||"")+e}function b(e){return new Promise((t,n)=>{document.querySelector(`#${e.handle}-js`)&&t();const o=document.createElement("script");o.src=e.src,o.id=e.handle+"-js",o.async=!0,o.onload=t,o.onerror=n,document.body.appendChild(o)})}},16:function(e,t){e.exports=window.wc.tracks},2:function(e,t){e.exports=window.wp.i18n},455:function(e,t,n){"use strict";n.r(t);var o=n(7),r=n(2),c=n(51),i=n.n(c),s=n(13),u=n(16);const a=()=>{if(!document.querySelector(".editor-post-publish-button").classList.contains("is-busy")){return new Promise(e=>{window.requestAnimationFrame(e)}).then(()=>a())}return Promise.resolve(!0)},d=()=>{if(document.querySelector(".editor-post-publish-button").classList.contains("is-busy")){return new Promise(e=>{window.requestAnimationFrame(e)}).then(()=>d())}return Promise.resolve(!0)};i()(()=>{const e=document.querySelector(".editor-post-publish-button");e&&e.addEventListener("click",a().then(()=>(()=>{const e=document.querySelector(".editor-post-publish-button");e.classList.contains("is-clicked")||(e.classList.add("is-clicked"),d().then(()=>{const e=null!==document.querySelector(".components-snackbar__content")?"snackbar":"default";Object(o.dispatch)("core/notices").removeNotice("SAVE_POST_NOTICE_ID"),Object(o.dispatch)("core/notices").createSuccessNotice(Object(r.__)("🏠 Nice work creating your store's homepage!",'woocommerce'),{id:"WOOCOMMERCE_ONBOARDING_HOME_PAGE_NOTICE",type:e,actions:[{label:Object(r.__)("Continue setup.",'woocommerce'),onClick:()=>{Object(u.queueRecordEvent)("tasklist_appearance_continue_setup",{}),window.location=Object(s.e)("admin.php?page=wc-admin&task=appearance")}}]})}))})()))})},51:function(e,t){e.exports=window.wp.domReady},7:function(e,t){e.exports=window.wp.data}});woocommerce-admin/dist/wp-admin-scripts/navigation-opt-out.js000064400000004342151335517650020435 0ustar00this.wc=this.wc||{},this.wc.navigationOptOut=function(e){var t={};function n(o){if(t[o])return t[o].exports;var r=t[o]={i:o,l:!1,exports:{}};return e[o].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=e,n.c=t,n.d=function(e,t,o){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)n.d(o,r,function(t){return e[t]}.bind(null,r));return o},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=470)}({0:function(e,t){e.exports=window.wp.element},2:function(e,t){e.exports=window.wp.i18n},3:function(e,t){e.exports=window.wp.components},454:function(e,t,n){},470:function(e,t,n){"use strict";n.r(t);var o=n(0),r=n(2),i=n(3);class a extends o.Component{constructor(e){super(e),this.state={isModalOpen:!0}}render(){const{isModalOpen:e}=this.state;return e&&window.surveyData&&window.surveyData.url?Object(o.createElement)(i.Modal,{title:Object(r.__)("Help us improve",'woocommerce'),onRequestClose:()=>this.setState({isModalOpen:!1}),className:"woocommerce-navigation-opt-out-modal"},Object(o.createElement)("p",null,Object(r.__)("Take this 2-minute survey to share why you're opting out of the new navigation",'woocommerce')),Object(o.createElement)("div",{className:"woocommerce-navigation-opt-out-modal__actions"},Object(o.createElement)(i.Button,{isDefault:!0,onClick:()=>this.setState({isModalOpen:!1})},Object(r.__)("No thanks",'woocommerce')),Object(o.createElement)(i.Button,{isPrimary:!0,target:"_blank",href:window.surveyData.url,onClick:()=>this.setState({isModalOpen:!1})},Object(r.__)("Share feedback",'woocommerce')))):null}}n(454);const c=document.createElement("div");c.setAttribute("id","navigation-opt-out-root"),Object(o.render)(Object(o.createElement)(a,null),document.body.appendChild(c))}});woocommerce-admin/dist/wp-admin-scripts/print-shipping-label-banner.asset.php000064400000000362151335517650023453 0ustar00<?php return array('dependencies' => array('lodash', 'react', 'wc-store-data', 'wc-tracks', 'wp-api-fetch', 'wp-components', 'wp-compose', 'wp-data', 'wp-element', 'wp-i18n', 'wp-primitives'), 'version' => '207bd4a9450c501561a210abccb8b98a');woocommerce-admin/dist/wp-admin-scripts/onboarding-tax-notice.js000064400000006162151335517650021066 0ustar00this.wc=this.wc||{},this.wc.onboardingTaxNotice=function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=458)}({13:function(e,t,n){"use strict";n.d(t,"a",(function(){return s})),n.d(t,"b",(function(){return a})),n.d(t,"c",(function(){return d})),n.d(t,"f",(function(){return l})),n.d(t,"g",(function(){return f})),n.d(t,"e",(function(){return m})),n.d(t,"d",(function(){return w}));var r=n(2);const o=["wcAdminSettings","preloadSettings"],c="object"==typeof wcSettings?wcSettings:{},i=Object.keys(c).reduce((e,t)=>(o.includes(t)||(e[t]=c[t]),e),{});Object.keys(c.admin||{}).forEach(e=>{o.includes(e)||(i[e]=c.admin[e])});const u=i.adminUrl,s=(i.countries,i.currency),a=i.locale,d=i.orderStatuses;i.siteTitle,i.wcAssetUrl;function l(e,t=!1,n=(e=>e)){if(o.includes(e))throw new Error(Object(r.__)("Mutable settings should be accessed via data store."));return n(i.hasOwnProperty(e)?i[e]:t,t)}function f(e,t,n=(e=>e)){if(o.includes(e))throw new Error(Object(r.__)("Mutable settings should be mutated via data store."));i[e]=n(t)}function m(e){return(u||"")+e}function w(e){return new Promise((t,n)=>{document.querySelector(`#${e.handle}-js`)&&t();const r=document.createElement("script");r.src=e.src,r.id=e.handle+"-js",r.async=!0,r.onload=t,r.onerror=n,document.body.appendChild(r)})}},2:function(e,t){e.exports=window.wp.i18n},458:function(e,t,n){"use strict";n.r(t);var r=n(2),o=n(7),c=n(51),i=n.n(c),u=n(13);const s=e=>{if(e&&!e.disabled){return new Promise(e=>{window.requestAnimationFrame(e)}).then(()=>s(e))}return Promise.resolve(!0)},a=()=>{const e=document.querySelector(".woocommerce-save-button");e.classList.contains("has-tax")||s(e).then(()=>{document.querySelector(".wc_tax_rates .tips")&&(e.classList.add("has-tax"),Object(o.dispatch)("core/notices").createSuccessNotice(Object(r.__)("You've added your first tax rate!",'woocommerce'),{id:"WOOCOMMERCE_ONBOARDING_TAX_NOTICE",actions:[{url:Object(u.e)("admin.php?page=wc-admin"),label:Object(r.__)("Continue setup.",'woocommerce')}]}))})};i()(()=>{const e=document.querySelector(".woocommerce-save-button");window.htmlSettingsTaxLocalizeScript&&window.htmlSettingsTaxLocalizeScript.rates&&!window.htmlSettingsTaxLocalizeScript.rates.length&&e&&e.addEventListener("click",a)})},51:function(e,t){e.exports=window.wp.domReady},7:function(e,t){e.exports=window.wp.data}});woocommerce-admin/dist/wp-admin-scripts/onboarding-tax-notice.asset.php000064400000000203151335517650022345 0ustar00<?php return array('dependencies' => array('wp-data', 'wp-dom-ready', 'wp-i18n'), 'version' => '3a1c1b7dfec2cabcf5569b104f10c39c');woocommerce-admin/dist/wp-admin-scripts/marketing-coupons.asset.php000064400000000440151335517650021622 0ustar00<?php return array('dependencies' => array('lodash', 'react', 'react-dom', 'wc-components', 'wc-experimental', 'wc-tracks', 'wp-components', 'wp-compose', 'wp-data', 'wp-data-controls', 'wp-element', 'wp-i18n', 'wp-primitives', 'wp-url'), 'version' => '4af1314387dc264b42bf411e55353dfc');woocommerce-admin/dist/wp-admin-scripts/onboarding-homepage-notice.asset.php000064400000000220151335517650023335 0ustar00<?php return array('dependencies' => array('wc-tracks', 'wp-data', 'wp-dom-ready', 'wp-i18n'), 'version' => '3fae113f8619a42153cff94451551e5f');woocommerce-admin/dist/wp-admin-scripts/navigation-opt-out.asset.php000064400000000207151335517650021722 0ustar00<?php return array('dependencies' => array('wp-components', 'wp-element', 'wp-i18n'), 'version' => '205a7405994f921f360c8c432395d1fe');woocommerce-admin/dist/wp-admin-scripts/marketing-coupons.js.LICENSE.txt000064400000000174151335517650022234 0ustar00/*!
  Copyright (c) 2018 Jed Watson.
  Licensed under the MIT License (MIT), see
  http://jedwatson.github.io/classnames
*/
woocommerce-admin/dist/wp-admin-scripts/onboarding-product-notice.asset.php000064400000000203151335517650023231 0ustar00<?php return array('dependencies' => array('wp-data', 'wp-dom-ready', 'wp-i18n'), 'version' => '639d52b2145c57904473c5bc8f963293');woocommerce-admin/dist/wp-admin-scripts/onboarding-product-import-notice.asset.php000064400000000170151335517650024544 0ustar00<?php return array('dependencies' => array('wp-dom-ready', 'wp-i18n'), 'version' => '3e422d80fcf2901bce4540543a1e1ed0');woocommerce-admin/dist/wp-admin-scripts/onboarding-product-import-notice.js000064400000005273151335517650023264 0ustar00this.wc=this.wc||{},this.wc.onboardingProductImportNotice=function(t){var e={};function n(r){if(e[r])return e[r].exports;var o=e[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)n.d(r,o,function(e){return t[e]}.bind(null,o));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=457)}({13:function(t,e,n){"use strict";n.d(e,"a",(function(){return s})),n.d(e,"b",(function(){return d})),n.d(e,"c",(function(){return a})),n.d(e,"f",(function(){return l})),n.d(e,"g",(function(){return f})),n.d(e,"e",(function(){return p})),n.d(e,"d",(function(){return b}));var r=n(2);const o=["wcAdminSettings","preloadSettings"],c="object"==typeof wcSettings?wcSettings:{},u=Object.keys(c).reduce((t,e)=>(o.includes(e)||(t[e]=c[e]),t),{});Object.keys(c.admin||{}).forEach(t=>{o.includes(t)||(u[t]=c.admin[t])});const i=u.adminUrl,s=(u.countries,u.currency),d=u.locale,a=u.orderStatuses;u.siteTitle,u.wcAssetUrl;function l(t,e=!1,n=(t=>t)){if(o.includes(t))throw new Error(Object(r.__)("Mutable settings should be accessed via data store."));return n(u.hasOwnProperty(t)?u[t]:e,e)}function f(t,e,n=(t=>t)){if(o.includes(t))throw new Error(Object(r.__)("Mutable settings should be mutated via data store."));u[t]=n(e)}function p(t){return(i||"")+t}function b(t){return new Promise((e,n)=>{document.querySelector(`#${t.handle}-js`)&&e();const r=document.createElement("script");r.src=t.src,r.id=t.handle+"-js",r.async=!0,r.onload=e,r.onerror=n,document.body.appendChild(r)})}},2:function(t,e){t.exports=window.wp.i18n},457:function(t,e,n){"use strict";n.r(e);var r=n(2),o=n(51),c=n.n(o),u=n(13);c()(()=>{const t=document.querySelector(".wc-actions");if(t){const e=document.querySelector(".wc-actions .button-primary");e&&(e.classList.remove("button"),e.classList.remove("button-primary"));const n=document.createElement("a");n.classList.add("button"),n.classList.add("button-primary"),n.setAttribute("href",Object(u.e)("admin.php?page=wc-admin")),n.innerText=Object(r.__)("Continue setup",'woocommerce'),t.appendChild(n)}})},51:function(t,e){t.exports=window.wp.domReady}});woocommerce-admin/dist/wp-admin-scripts/beta-features-tracking-modal.js000064400000007011151335517650022306 0ustar00this.wc=this.wc||{},this.wc.betaFeaturesTrackingModal=function(e){var t={};function n(o){if(t[o])return t[o].exports;var r=t[o]={i:o,l:!1,exports:{}};return e[o].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=e,n.c=t,n.d=function(e,t,o){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)n.d(o,r,function(t){return e[t]}.bind(null,r));return o},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=471)}({0:function(e,t){e.exports=window.wp.element},11:function(e,t){e.exports=window.wc.data},122:function(e,t){e.exports=window.wc.explat},14:function(e,t){e.exports=window.wp.compose},16:function(e,t){e.exports=window.wc.tracks},2:function(e,t){e.exports=window.wp.i18n},3:function(e,t){e.exports=window.wp.components},459:function(e,t,n){},471:function(e,t,n){"use strict";n.r(t);var o=n(0),r=n(2),c=n(3),a=n(7),i=n(14),u=n(11),s=n(16),d=n(122);const l=Object(i.compose)(Object(a.withDispatch)(e=>{const{updateOptions:t}=e(u.OPTIONS_STORE_NAME);return{updateOptions:t}}))(({updateOptions:e})=>{const[t,n]=Object(o.useState)(!1),[a,i]=Object(o.useState)(!1),u=Object(o.useRef)(document.querySelector("#woocommerce_navigation_enabled")),l=async t=>("function"==typeof window.wcTracks.enable&&(t?window.wcTracks.enable(()=>{Object(d.initializeExPlat)()}):window.wcTracks.isEnabled=!1),t&&Object(s.recordEvent)("settings_features_tracking_enabled"),e({woocommerce_allow_tracking:t?"yes":"no"}));return Object(o.useEffect)(()=>{if(!u.current)return;const e=e=>{e.target.checked&&(e.target.checked=!1,n(!0))},t=u.current;return t.addEventListener("change",e,!1),()=>t.removeEventListener("change",e)},[]),u.current&&t?Object(o.createElement)(c.Modal,{title:Object(r.__)("Build a Better WooCommerce",'woocommerce'),onRequestClose:()=>n(!1),className:"woocommerce-beta-features-tracking-modal"},Object(o.createElement)("p",null,Object(r.__)("Testing new features requires sharing non-sensitive data via ",'woocommerce'),Object(o.createElement)("a",{href:"https://woocommerce.com/usage-tracking?utm_medium=product"},Object(r.__)("usage tracking",'woocommerce')),Object(r.__)(". Gathering usage data allows us to make WooCommerce better — your store will be considered as we evaluate new features, judge the quality of an update, or determine if an improvement makes sense. No personal data is tracked or stored and you can opt-out at any time.",'woocommerce')),Object(o.createElement)("div",{className:"woocommerce-beta-features-tracking-modal__checkbox"},Object(o.createElement)(c.CheckboxControl,{label:"Enable usage tracking",onChange:i,checked:a})),Object(o.createElement)("div",{className:"woocommerce-beta-features-tracking-modal__actions"},Object(o.createElement)(c.Button,{isPrimary:!0,onClick:async()=>{a?(await l(!0),u.current.checked=!0):await l(!1),n(!1)}},Object(r.__)("Save",'woocommerce')))):null});n(459);const m=document.createElement("div");m.setAttribute("id","beta-features-tracking"),Object(o.render)(Object(o.createElement)(l,null),document.body.appendChild(m))},7:function(e,t){e.exports=window.wp.data}});woocommerce-admin/dist/wp-admin-scripts/print-shipping-label-banner.js000064400000053076151335517650022174 0ustar00this.wc=this.wc||{},this.wc.printShippingLabelBanner=function(e){var t={};function n(o){if(t[o])return t[o].exports;var i=t[o]={i:o,l:!1,exports:{}};return e[o].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,o){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(o,i,function(t){return e[t]}.bind(null,i));return o},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=466)}({0:function(e,t){e.exports=window.wp.element},1:function(e,t,n){e.exports=n(47)()},11:function(e,t){e.exports=window.wc.data},116:function(e,t,n){"use strict";function o(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var i=n(22);var r=n(0);function s(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}t.a=function(e){var t=e.icon,n=e.size,c=void 0===n?24:n,a=function(e,t){if(null==e)return{};var n,o,r=Object(i.a)(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(o=0;o<s.length;o++)n=s[o],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}(e,["icon","size"]);return Object(r.cloneElement)(t,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?s(Object(n),!0).forEach((function(t){o(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):s(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({width:c,height:c},a))}},13:function(e,t,n){"use strict";n.d(t,"a",(function(){return a})),n.d(t,"b",(function(){return l})),n.d(t,"c",(function(){return u})),n.d(t,"f",(function(){return d})),n.d(t,"g",(function(){return p})),n.d(t,"e",(function(){return m})),n.d(t,"d",(function(){return h}));var o=n(2);const i=["wcAdminSettings","preloadSettings"],r="object"==typeof wcSettings?wcSettings:{},s=Object.keys(r).reduce((e,t)=>(i.includes(t)||(e[t]=r[t]),e),{});Object.keys(r.admin||{}).forEach(e=>{i.includes(e)||(s[e]=r.admin[e])});const c=s.adminUrl,a=(s.countries,s.currency),l=s.locale,u=s.orderStatuses;s.siteTitle,s.wcAssetUrl;function d(e,t=!1,n=(e=>e)){if(i.includes(e))throw new Error(Object(o.__)("Mutable settings should be accessed via data store."));return n(s.hasOwnProperty(e)?s[e]:t,t)}function p(e,t,n=(e=>e)){if(i.includes(e))throw new Error(Object(o.__)("Mutable settings should be mutated via data store."));s[e]=n(t)}function m(e){return(c||"")+e}function h(e){return new Promise((t,n)=>{document.querySelector(`#${e.handle}-js`)&&t();const o=document.createElement("script");o.src=e.src,o.id=e.handle+"-js",o.async=!0,o.onload=t,o.onerror=n,document.body.appendChild(o)})}},14:function(e,t){e.exports=window.wp.compose},16:function(e,t){e.exports=window.wc.tracks},17:function(e,t){e.exports=window.wp.apiFetch},18:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i=c(n(5)),r=c(n(69)),s=c(n(72));function c(e){return e&&e.__esModule?e:{default:e}}var a=void 0;function l(e,t){var n,s,c,u,d,p,m,h,f=[],b={};for(p=0;p<e.length;p++)if("string"!==(d=e[p]).type){if(!t.hasOwnProperty(d.value)||void 0===t[d.value])throw new Error("Invalid interpolation, missing component node: `"+d.value+"`");if("object"!==o(t[d.value]))throw new Error("Invalid interpolation, component node must be a ReactElement or null: `"+d.value+"`","\n> "+a);if("componentClose"===d.type)throw new Error("Missing opening component token: `"+d.value+"`");if("componentOpen"===d.type){n=t[d.value],c=p;break}f.push(t[d.value])}else f.push(d.value);return n&&(u=function(e,t){var n,o,i=t[e],r=0;for(o=e+1;o<t.length;o++)if((n=t[o]).value===i.value){if("componentOpen"===n.type){r++;continue}if("componentClose"===n.type){if(0===r)return o;r--}}throw new Error("Missing closing component token `"+i.value+"`")}(c,e),m=l(e.slice(c+1,u),t),s=i.default.cloneElement(n,{},m),f.push(s),u<e.length-1&&(h=l(e.slice(u+1),t),f=f.concat(h))),1===f.length?f[0]:(f.forEach((function(e,t){e&&(b["interpolation-child-"+t]=e)})),(0,r.default)(b))}t.default=function(e){var t=e.mixedString,n=e.components,i=e.throwErrors;if(a=t,!n)return t;if("object"!==(void 0===n?"undefined":o(n))){if(i)throw new Error("Interpolation Error: unable to process `"+t+"` because components is not an object");return t}var r=(0,s.default)(t);try{return l(r,n)}catch(e){if(i)throw new Error("Interpolation Error: unable to process `"+t+"` because of error `"+e.message+"`");return t}}},2:function(e,t){e.exports=window.wp.i18n},22:function(e,t,n){"use strict";function o(e,t){if(null==e)return{};var n,o,i={},r=Object.keys(e);for(o=0;o<r.length;o++)n=r[o],t.indexOf(n)>=0||(i[n]=e[n]);return i}n.d(t,"a",(function(){return o}))},251:function(e,t,n){},3:function(e,t){e.exports=window.wp.components},38:function(e,t){e.exports=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e},e.exports.default=e.exports,e.exports.__esModule=!0},4:function(e,t){e.exports=window.lodash},466:function(e,t,n){"use strict";n.r(t);var o=n(0),i=n(11),r=n(13),s=n(38),c=n.n(s),a=n(2),l=n(3),u=n(14),d=n(18),p=n.n(d),m=n(1),h=n.n(m),f=n(4),b=n(7),w=n(16);n(251);class g extends o.Component{constructor(...e){super(...e),c()(this,"setDismissed",e=>{this.props.updateOptions({woocommerce_shipping_dismissed_timestamp:e})}),c()(this,"hideBanner",()=>{document.getElementById("woocommerce-admin-print-label").style.display="none"}),c()(this,"remindMeLaterClicked",()=>{const{onCloseAll:e,trackElementClicked:t}=this.props;this.setDismissed(Date.now()),e(),this.hideBanner(),t("shipping_banner_dismiss_modal_remind_me_later")}),c()(this,"closeForeverClicked",()=>{const{onCloseAll:e,trackElementClicked:t}=this.props;this.setDismissed(-1),e(),this.hideBanner(),t("shipping_banner_dismiss_modal_close_forever")})}render(){const{onClose:e,visible:t}=this.props;return t?Object(o.createElement)(l.Modal,{title:Object(a.__)("Are you sure?",'woocommerce'),onRequestClose:e,className:"wc-admin-shipping-banner__dismiss-modal"},Object(o.createElement)("p",{className:"wc-admin-shipping-banner__dismiss-modal-help-text"},Object(a.__)("With WooCommerce Shipping you can Print shipping labels from your WooCommerce dashboard at the lowest USPS rates.",'woocommerce')),Object(o.createElement)("div",{className:"wc-admin-shipping-banner__dismiss-modal-actions"},Object(o.createElement)(l.Button,{isSecondary:!0,onClick:this.remindMeLaterClicked},Object(a.__)("Remind me later",'woocommerce')),Object(o.createElement)(l.Button,{isPrimary:!0,onClick:this.closeForeverClicked},Object(a.__)("I don't need this",'woocommerce')))):null}}var y=Object(u.compose)(Object(b.withDispatch)(e=>{const{updateOptions:t}=e(i.OPTIONS_STORE_NAME);return{updateOptions:t}}))(g),v=n(116),O=n(8),_=Object(o.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"-2 -2 24 24"},Object(o.createElement)(O.Path,{d:"M10 2c4.42 0 8 3.58 8 8s-3.58 8-8 8-8-3.58-8-8 3.58-8 8-8zm1.13 9.38l.35-6.46H8.52l.35 6.46h2.26zm-.09 3.36c.24-.23.37-.55.37-.96 0-.42-.12-.74-.36-.97s-.59-.35-1.06-.35-.82.12-1.07.35-.37.55-.37.97c0 .41.13.73.38.96.26.23.61.34 1.06.34s.8-.11 1.05-.34z"}));const j="install",S="activate",E="setup",k="start",P={["download"]:Object(a.__)("download",'woocommerce'),[j]:Object(a.__)("install",'woocommerce'),[S]:Object(a.__)("activate",'woocommerce'),[E]:Object(a.__)("set up",'woocommerce'),[k]:Object(a.__)("start",'woocommerce')};function x({isSetupError:e,errorReason:t}){return e?Object(o.createElement)("div",{className:"wc-admin-shipping-banner-install-error"},Object(o.createElement)(v.a,{icon:_,className:"warning-icon"}),(e=>{const t=e in P?P[e]:P[E];return Object(a.sprintf)(Object(a.__)("Unable to %s the plugin. Refresh the page and try again.",'woocommerce'),t)})(t)):null}var C=n(17),A=n.n(C);const R=Object(r.f)("wcAdminAssetUrl","");class B extends o.Component{constructor(e){super(e),c()(this,"isSetupError",()=>this.state.wcsSetupError),c()(this,"closeDismissModal",()=>{this.setState({isDismissModalOpen:!1}),this.trackElementClicked("shipping_banner_dismiss_modal_close_button")}),c()(this,"openDismissModal",()=>{this.setState({isDismissModalOpen:!0}),this.trackElementClicked("shipping_banner_dimiss")}),c()(this,"hideBanner",()=>{this.setState({showShippingBanner:!1})}),c()(this,"createShippingLabelClicked",()=>{const{activePlugins:e}=this.props;this.setState({isShippingLabelButtonBusy:!0}),this.trackElementClicked("shipping_banner_create_label"),e.includes("woocommerce-services")?this.acceptTosAndGetWCSAssets():this.installAndActivatePlugins("woocommerce-services")}),c()(this,"woocommerceServiceLinkClicked",()=>{this.trackElementClicked("shipping_banner_woocommerce_service_link")}),c()(this,"trackBannerEvent",(e,t={})=>{const{activePlugins:n,isJetpackConnected:o}=this.props;Object(w.recordEvent)(e,{banner_name:"wcadmin_install_wcs_prompt",jetpack_installed:n.includes("jetpack"),jetpack_connected:o,wcs_installed:n.includes("woocommerce-services"),...t})}),c()(this,"trackImpression",()=>{this.trackBannerEvent("banner_impression")}),c()(this,"trackElementClicked",e=>{this.trackBannerEvent("banner_element_clicked",{element:e})}),c()(this,"getInstallText",()=>{const{activePlugins:e}=this.props;return e.includes("woocommerce-services")?Object(a.__)('You\'ve already installed WooCommerce Shipping. By clicking "Create shipping label", you agree to its {{tosLink}}Terms of Service{{/tosLink}}.','woocommerce'):Object(a.__)('By clicking "Create shipping label", {{wcsLink}}WooCommerce Shipping{{/wcsLink}} will be installed and you agree to its {{tosLink}}Terms of Service{{/tosLink}}.','woocommerce')});const t=new URL(window.location.href).searchParams.get("post");this.state={showShippingBanner:!0,isDismissModalOpen:!1,setupErrorReason:E,orderId:parseInt(t,10),wcsAssetsLoaded:!1,wcsAssetsLoading:!1,wcsSetupError:!1,isShippingLabelButtonBusy:!1,installText:this.getInstallText(),isWcsModalOpen:!1}}componentDidMount(){const{showShippingBanner:e}=this.state;e&&this.trackImpression()}async installAndActivatePlugins(e){const{installPlugins:t,activatePlugins:n,isRequesting:o}=this.props;if(o)return!1;if(!0!==(await t([e])).success)return void this.setState({setupErrorReason:j,wcsSetupError:!0});!0===(await n([e])).success?this.acceptTosAndGetWCSAssets():this.setState({setupErrorReason:S,wcsSetupError:!0})}acceptTosAndGetWCSAssets(){return A()({path:"/wc/v1/connect/tos",method:"POST",data:{accepted:!0}}).then(()=>A()({path:"/wc/v1/connect/assets",method:"GET"})).then(e=>this.loadWcsAssets(e)).catch(()=>this.setState({wcsSetupError:!0}))}generateMetaBoxHtml(e,t,n){const o=JSON.stringify(n).replace(/"/g,"&quot;");return`\n<div id="${e}" class="postbox">\n\t<div class="postbox-header">\n\t\t<h2 class="hndle"><span>${t}</span></h2>\n\t\t<div class="handle-actions">\n\t\t\t<button type="button" class="handlediv" aria-expanded="true">\n\t\t\t\t<span class="screen-reader-text">${Object(a.__)("Toggle panel:",'woocommerce')} ${t}</span>\n\t\t\t\t<span class="toggle-indicator" aria-hidden="true"></span>\n\t\t\t</button>\n\t\t</div>\n\t</div>\n\t<div class="inside">\n\t\t<div class="wcc-root woocommerce wc-connect-create-shipping-label" data-args="${o}">\n\t\t</div>\n\t</div>\n</div>\n`}loadWcsAssets({assets:e}){if(this.state.wcsAssetsLoaded||this.state.wcsAssetsLoading)return void this.openWcsModal();this.setState({wcsAssetsLoading:!0});const t=e.wc_connect_admin_script,n=e.wc_connect_admin_style;if(void 0===window.wcsPluginData){const e=t.substring(0,t.lastIndexOf("/")+1);window.wcsPluginData={assetPath:e}}const{orderId:o}=this.state,{itemsCount:i}=this.props,r=this.generateMetaBoxHtml("woocommerce-order-label",Object(a.__)("Shipping Label",'woocommerce'),{order:{id:o},context:"shipping_label",items:i});document.getElementById("woocommerce-order-data").insertAdjacentHTML("beforebegin",r);const s=this.generateMetaBoxHtml("woocommerce-order-shipment-tracking",Object(a.__)("Shipment Tracking",'woocommerce'),{order:{id:o},context:"shipment_tracking",items:i});document.getElementById("woocommerce-order-actions").insertAdjacentHTML("afterend",s),window.jQuery&&(window.jQuery("#normal-sortables").sortable("refresh"),window.jQuery("#side-sortables").sortable("refresh"),window.jQuery("#woocommerce-order-label").hide()),Promise.all([new Promise((e,n)=>{const o=document.createElement("script");o.src=t,o.async=!0,o.onload=e,o.onerror=n,document.body.appendChild(o)}),new Promise((e,t)=>{if(""!==n){const o=document.getElementsByTagName("head")[0],i=document.createElement("link");i.rel="stylesheet",i.type="text/css",i.href=n,i.media="all",i.onload=e,i.onerror=t,o.appendChild(i)}else e()})]).then(()=>{this.setState({wcsAssetsLoaded:!0,wcsAssetsLoading:!1,isShippingLabelButtonBusy:!1}),this.openWcsModal()})}openWcsModal(){window.wcsGetAppStoreAsync&&window.wcsGetAppStoreAsync("wc-connect-create-shipping-label").then(e=>{const t=e.getState(),{orderId:n}=this.state,o=t.ui.selectedSiteId,i=e.subscribe(()=>{const t=e.getState(),r=Object(f.get)(t,["extensions","woocommerce","woocommerceServices",o,"shippingLabel",n],null),s=Object(f.get)(t,["extensions","woocommerce","woocommerceServices",o,"labelSettings"],null),c=Object(f.get)(t,["extensions","woocommerce","woocommerceServices",o,"packages"],null),l=Object(f.get)(t,["extensions","woocommerce","sites",o,"data","locations"]);r&&s&&s.meta&&c&&l&&(r.loaded&&s.meta.isLoaded&&c.isLoaded&&Object(f.isArray)(l)&&!this.state.isWcsModalOpen?(window.jQuery&&(this.setState({isWcsModalOpen:!0}),window.jQuery(".shipping-label__new-label-button").click()),e.dispatch({type:"NOTICE_CREATE",notice:{duration:1e4,status:"is-success",text:Object(a.__)("Plugin installed and activated",'woocommerce')}})):r.showPurchaseDialog&&(i(),window.jQuery&&window.jQuery("#woocommerce-order-label").show()))});document.getElementById("woocommerce-admin-print-label").style.display="none"})}render(){const{isDismissModalOpen:e,showShippingBanner:t,isShippingLabelButtonBusy:n}=this.state;return t?Object(o.createElement)("div",null,Object(o.createElement)("div",{className:"wc-admin-shipping-banner-container"},Object(o.createElement)("img",{className:"wc-admin-shipping-banner-illustration",src:R+"shippingillustration.svg",alt:Object(a.__)("Shipping ",'woocommerce')}),Object(o.createElement)("div",{className:"wc-admin-shipping-banner-blob"},Object(o.createElement)("h3",null,Object(a.__)("Print discounted shipping labels with a click.",'woocommerce')),Object(o.createElement)("p",null,p()({mixedString:this.state.installText,components:{tosLink:Object(o.createElement)(l.ExternalLink,{href:"https://wordpress.com/tos",target:"_blank",type:"external"}),wcsLink:Object(o.createElement)(l.ExternalLink,{href:"https://woocommerce.com/products/shipping/?utm_medium=product",target:"_blank",type:"external",onClick:this.woocommerceServiceLinkClicked})}})),Object(o.createElement)(x,{isSetupError:this.isSetupError(),errorReason:this.state.setupErrorReason})),Object(o.createElement)(l.Button,{disabled:n,isPrimary:!0,isBusy:n,onClick:this.createShippingLabelClicked},Object(a.__)("Create shipping label",'woocommerce')),Object(o.createElement)("button",{onClick:this.openDismissModal,type:"button",className:"notice-dismiss",disabled:this.state.isShippingLabelButtonBusy},Object(o.createElement)("span",{className:"screen-reader-text"},Object(a.__)("Close Print Label Banner.",'woocommerce')))),Object(o.createElement)(y,{visible:e,onClose:this.closeDismissModal,onCloseAll:this.hideBanner,trackElementClicked:this.trackElementClicked})):null}}B.propTypes={itemsCount:h.a.number.isRequired,isJetpackConnected:h.a.bool.isRequired,activePlugins:h.a.array.isRequired,activatePlugins:h.a.func.isRequired,installPlugins:h.a.func.isRequired,isRequesting:h.a.bool.isRequired};var L=Object(u.compose)(Object(b.withSelect)(e=>{const{isPluginsRequesting:t,isJetpackConnected:n,getActivePlugins:o}=e(i.PLUGINS_STORE_NAME);return{isRequesting:t("activatePlugins")||t("installPlugins"),isJetpackConnected:n(),activePlugins:o()}}),Object(b.withDispatch)(e=>{const{activatePlugins:t,installPlugins:n}=e(i.PLUGINS_STORE_NAME);return{activatePlugins:t,installPlugins:n}}))(B);const T=document.getElementById("wc-admin-shipping-banner-root"),M=T.dataset.args&&JSON.parse(T.dataset.args)||{},I=Object(i.withPluginsHydration)({...Object(r.f)("plugins"),jetpackStatus:Object(r.f)("dataEndpoints",{}).jetpackStatus})(L);Object(o.render)(Object(o.createElement)(I,{itemsCount:M.items}),T)},47:function(e,t,n){"use strict";var o=n(48);function i(){}function r(){}r.resetWarningCache=i,e.exports=function(){function e(e,t,n,i,r,s){if(s!==o){var c=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw c.name="Invariant Violation",c}}function t(){return e}e.isRequired=e;var n={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:r,resetWarningCache:i};return n.PropTypes=n,n}},48:function(e,t,n){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},5:function(e,t){e.exports=window.React},50:function(e,t,n){"use strict";function o(e){return function(){return e}}var i=function(){};i.thatReturns=o,i.thatReturnsFalse=o(!1),i.thatReturnsTrue=o(!0),i.thatReturnsNull=o(null),i.thatReturnsThis=function(){return this},i.thatReturnsArgument=function(e){return e},e.exports=i},69:function(e,t,n){"use strict";var o=n(5),i="function"==typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103,r=n(50),s=n(70),c=n(71),a="function"==typeof Symbol&&Symbol.iterator;function l(e,t){return e&&"object"==typeof e&&null!=e.key?(n=e.key,o={"=":"=0",":":"=2"},"$"+(""+n).replace(/[=:]/g,(function(e){return o[e]}))):t.toString(36);var n,o}function u(e,t,n,o){var r,c=typeof e;if("undefined"!==c&&"boolean"!==c||(e=null),null===e||"string"===c||"number"===c||"object"===c&&e.$$typeof===i)return n(o,e,""===t?"."+l(e,0):t),1;var d=0,p=""===t?".":t+":";if(Array.isArray(e))for(var m=0;m<e.length;m++)d+=u(r=e[m],p+l(r,m),n,o);else{var h=function(e){var t=e&&(a&&e[a]||e["@@iterator"]);if("function"==typeof t)return t}(e);if(h){0;for(var f,b=h.call(e),w=0;!(f=b.next()).done;)d+=u(r=f.value,p+l(r,w++),n,o)}else if("object"===c){0;var g=""+e;s(!1,"Objects are not valid as a React child (found: %s).%s","[object Object]"===g?"object with keys {"+Object.keys(e).join(", ")+"}":g,"")}}return d}var d=/\/+/g;function p(e){return(""+e).replace(d,"$&/")}var m,h,f=b,b=function(e){if(this.instancePool.length){var t=this.instancePool.pop();return this.call(t,e),t}return new this(e)},w=function(e){s(e instanceof this,"Trying to release an instance into a pool of a different type."),e.destructor(),this.instancePool.length<this.poolSize&&this.instancePool.push(e)};function g(e,t,n,o){this.result=e,this.keyPrefix=t,this.func=n,this.context=o,this.count=0}function y(e,t,n){var i,s,c=e.result,a=e.keyPrefix,l=e.func,u=e.context,d=l.call(u,t,e.count++);Array.isArray(d)?v(d,c,n,r.thatReturnsArgument):null!=d&&(o.isValidElement(d)&&(i=d,s=a+(!d.key||t&&t.key===d.key?"":p(d.key)+"/")+n,d=o.cloneElement(i,{key:s},void 0!==i.props?i.props.children:void 0)),c.push(d))}function v(e,t,n,o,i){var r="";null!=n&&(r=p(n)+"/");var s=g.getPooled(t,r,o,i);!function(e,t,n){null==e||u(e,"",t,n)}(e,y,s),g.release(s)}g.prototype.destructor=function(){this.result=null,this.keyPrefix=null,this.func=null,this.context=null,this.count=0},m=function(e,t,n,o){if(this.instancePool.length){var i=this.instancePool.pop();return this.call(i,e,t,n,o),i}return new this(e,t,n,o)},(h=g).instancePool=[],h.getPooled=m||f,h.poolSize||(h.poolSize=10),h.release=w;e.exports=function(e){if("object"!=typeof e||!e||Array.isArray(e))return c(!1,"React.addons.createFragment only accepts a single object. Got: %s",e),e;if(o.isValidElement(e))return c(!1,"React.addons.createFragment does not accept a ReactElement without a wrapper object."),e;s(1!==e.nodeType,"React.addons.createFragment(...): Encountered an invalid child; DOM elements are not valid children of React components.");var t=[];for(var n in e)v(e[n],t,n,r.thatReturnsArgument);return t}},7:function(e,t){e.exports=window.wp.data},70:function(e,t,n){"use strict";e.exports=function(e,t,n,o,i,r,s,c){if(!e){var a;if(void 0===t)a=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var l=[n,o,i,r,s,c],u=0;(a=new Error(t.replace(/%s/g,(function(){return l[u++]})))).name="Invariant Violation"}throw a.framesToPop=1,a}}},71:function(e,t,n){"use strict";var o=n(50);e.exports=o},72:function(e,t,n){"use strict";function o(e){return e.match(/^\{\{\//)?{type:"componentClose",value:e.replace(/\W/g,"")}:e.match(/\/\}\}$/)?{type:"componentSelfClosing",value:e.replace(/\W/g,"")}:e.match(/^\{\{/)?{type:"componentOpen",value:e.replace(/\W/g,"")}:{type:"string",value:e}}e.exports=function(e){return e.split(/(\{\{\/?\s*\w+\s*\/?\}\})/g).map(o)}},8:function(e,t){e.exports=window.wp.primitives}});woocommerce-admin/dist/wp-admin-scripts/payment-method-promotions.js000064400000052172151335517650022037 0ustar00/*! For license information please see payment-method-promotions.js.LICENSE.txt */
this.wc=this.wc||{},this.wc.paymentMethodPromotions=function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=472)}({0:function(e,t){e.exports=window.wp.element},11:function(e,t){e.exports=window.wc.data},16:function(e,t){e.exports=window.wc.tracks},2:function(e,t){e.exports=window.wp.i18n},21:function(e,t){e.exports=window.wc.components},3:function(e,t){e.exports=window.wp.components},460:function(e,t,n){},472:function(e,t,n){"use strict";n.r(t);var r=n(0),o=n(21),i=n(3),a=n(11),l=n(16),c=n(7),s=n(53),u=n(2);n(460);function m(e){return{__html:Object(s.sanitize)(e,{ALLOWED_TAGS:["a","img","br"],ALLOWED_ATTR:["href","src","class","alt","target"]})}}const d=({pluginSlug:e,sortColumnContent:t,descriptionColumnContent:n,title:s,titleLink:d,subTitleContent:p})=>{const[f,g]=Object(r.useState)(!1),{installAndActivatePlugins:y}=Object(c.useDispatch)(a.PLUGINS_STORE_NAME),{createNotice:h}=Object(c.useDispatch)("core/notices"),{gatewayIsActive:v,paymentGateway:b}=Object(c.useSelect)(t=>{const{getPaymentGateway:n}=t(a.PAYMENT_GATEWAYS_STORE_NAME),r=t(a.PLUGINS_STORE_NAME).getActivePlugins(),o=r&&r.includes(e);let i;return o&&(i=n(e.replace(/\-/g,"_"))),{gatewayIsActive:o,paymentGateway:i}});Object(r.useEffect)(()=>{v&&b&&b.settings_url&&(window.location.href=b.settings_url)},[v,b]);return Object(r.createElement)(r.Fragment,null,Object(r.createElement)("td",{className:"sort ui-sortable-handle",width:"1%",dangerouslySetInnerHTML:{__html:t}}),Object(r.createElement)("td",{className:"name"},Object(r.createElement)("div",{className:"wc-payment-gateway-method_name"},Object(r.createElement)(o.Link,{target:"_blank",type:"external",rel:"noreferrer",href:d},s),p?Object(r.createElement)("div",{className:"pre-install-payment-gateway_subtitle",dangerouslySetInnerHTML:m(p)}):null)),Object(r.createElement)("td",{className:"pre-install-payment-gateway_status"}),Object(r.createElement)("td",{className:"description",dangerouslySetInnerHTML:m(n)}),Object(r.createElement)("td",{className:"action"},Object(r.createElement)(i.Button,{className:"button alignright",onClick:()=>{f||(g(!0),Object(l.recordEvent)("settings_payments_recommendations_setup",{extension_selected:e}),y([e]).catch(e=>{e.message&&h("error",e.message),g(!1)}))},isSecondary:!0,isBusy:f,"aria-disabled":f},Object(u.__)("Install",'woocommerce'))))};[{gatewayId:"pre_install_woocommerce_payments_promotion",pluginSlug:"woocommerce-payments",link:"https://woocommerce.com/payments/?utm_medium=product"}].forEach(e=>{const t=document.querySelector(`[data-gateway_id="${e.gatewayId}"]`);if(t){const n=t.children[0].innerHTML,o=t.children[3].innerHTML,i=t.getElementsByClassName("wc-payment-gateway-method-title"),a=t.getElementsByClassName("gateway-subtitle");Object(r.render)(Object(r.createElement)(d,{pluginSlug:e.pluginSlug,sortColumnContent:n,descriptionColumnContent:o,title:1===i.length?i[0].innerHTML:void 0,titleLink:e.link,subTitleContent:1===a.length?a[0].innerHTML:void 0}),t)}})},53:function(e,t,n){e.exports=function(){"use strict";var e=Object.hasOwnProperty,t=Object.setPrototypeOf,n=Object.isFrozen,r=Object.getPrototypeOf,o=Object.getOwnPropertyDescriptor,i=Object.freeze,a=Object.seal,l=Object.create,c="undefined"!=typeof Reflect&&Reflect,s=c.apply,u=c.construct;s||(s=function(e,t,n){return e.apply(t,n)}),i||(i=function(e){return e}),a||(a=function(e){return e}),u||(u=function(e,t){return new(Function.prototype.bind.apply(e,[null].concat(function(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}(t))))});var m,d=A(Array.prototype.forEach),p=A(Array.prototype.pop),f=A(Array.prototype.push),g=A(String.prototype.toLowerCase),y=A(String.prototype.match),h=A(String.prototype.replace),v=A(String.prototype.indexOf),b=A(String.prototype.trim),w=A(RegExp.prototype.test),T=(m=TypeError,function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return u(m,t)});function A(e){return function(t){for(var n=arguments.length,r=Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return s(e,t,r)}}function _(e,r){t&&t(e,null);for(var o=r.length;o--;){var i=r[o];if("string"==typeof i){var a=g(i);a!==i&&(n(r)||(r[o]=a),i=a)}e[i]=!0}return e}function S(t){var n=l(null),r=void 0;for(r in t)s(e,t,[r])&&(n[r]=t[r]);return n}function x(e,t){for(;null!==e;){var n=o(e,t);if(n){if(n.get)return A(n.get);if("function"==typeof n.value)return A(n.value)}e=r(e)}return function(e){return console.warn("fallback value for",e),null}}var O=i(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),E=i(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),N=i(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),k=i(["animate","color-profile","cursor","discard","fedropshadow","feimage","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),L=i(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover"]),M=i(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),R=i(["#text"]),D=i(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","xmlns","slot"]),j=i(["accent-height","accumulate","additive","alignment-baseline","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","targetx","targety","transform","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),C=i(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),I=i(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),F=a(/\{\{[\s\S]*|[\s\S]*\}\}/gm),H=a(/<%[\s\S]*|[\s\S]*%>/gm),z=a(/^data-[\-\w.\u00B7-\uFFFF]/),P=a(/^aria-[\-\w]+$/),U=a(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),B=a(/^(?:\w+script|data):/i),G=a(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),W="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};function q(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}var Y=function(){return"undefined"==typeof window?null:window},K=function(e,t){if("object"!==(void 0===e?"undefined":W(e))||"function"!=typeof e.createPolicy)return null;var n=null;t.currentScript&&t.currentScript.hasAttribute("data-tt-policy-suffix")&&(n=t.currentScript.getAttribute("data-tt-policy-suffix"));var r="dompurify"+(n?"#"+n:"");try{return e.createPolicy(r,{createHTML:function(e){return e}})}catch(e){return console.warn("TrustedTypes policy "+r+" could not be created."),null}};return function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Y(),n=function(t){return e(t)};if(n.version="2.2.9",n.removed=[],!t||!t.document||9!==t.document.nodeType)return n.isSupported=!1,n;var r=t.document,o=t.document,a=t.DocumentFragment,l=t.HTMLTemplateElement,c=t.Node,s=t.Element,u=t.NodeFilter,m=t.NamedNodeMap,A=void 0===m?t.NamedNodeMap||t.MozNamedAttrMap:m,V=t.Text,$=t.Comment,X=t.DOMParser,Z=t.trustedTypes,J=s.prototype,Q=x(J,"cloneNode"),ee=x(J,"nextSibling"),te=x(J,"childNodes"),ne=x(J,"parentNode");if("function"==typeof l){var re=o.createElement("template");re.content&&re.content.ownerDocument&&(o=re.content.ownerDocument)}var oe=K(Z,r),ie=oe&&Ie?oe.createHTML(""):"",ae=o,le=ae.implementation,ce=ae.createNodeIterator,se=ae.createDocumentFragment,ue=r.importNode,me={};try{me=S(o).documentMode?o.documentMode:{}}catch(e){}var de={};n.isSupported="function"==typeof ne&&le&&void 0!==le.createHTMLDocument&&9!==me;var pe=F,fe=H,ge=z,ye=P,he=B,ve=G,be=U,we=null,Te=_({},[].concat(q(O),q(E),q(N),q(L),q(R))),Ae=null,_e=_({},[].concat(q(D),q(j),q(C),q(I))),Se=null,xe=null,Oe=!0,Ee=!0,Ne=!1,ke=!1,Le=!1,Me=!1,Re=!1,De=!1,je=!1,Ce=!0,Ie=!1,Fe=!0,He=!0,ze=!1,Pe={},Ue=_({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]),Be=null,Ge=_({},["audio","video","img","source","image","track"]),We=null,qe=_({},["alt","class","for","id","label","name","pattern","placeholder","summary","title","value","style","xmlns"]),Ye="http://www.w3.org/1998/Math/MathML",Ke="http://www.w3.org/2000/svg",Ve="http://www.w3.org/1999/xhtml",$e=Ve,Xe=!1,Ze=null,Je=o.createElement("form"),Qe=function(e){Ze&&Ze===e||(e&&"object"===(void 0===e?"undefined":W(e))||(e={}),e=S(e),we="ALLOWED_TAGS"in e?_({},e.ALLOWED_TAGS):Te,Ae="ALLOWED_ATTR"in e?_({},e.ALLOWED_ATTR):_e,We="ADD_URI_SAFE_ATTR"in e?_(S(qe),e.ADD_URI_SAFE_ATTR):qe,Be="ADD_DATA_URI_TAGS"in e?_(S(Ge),e.ADD_DATA_URI_TAGS):Ge,Se="FORBID_TAGS"in e?_({},e.FORBID_TAGS):{},xe="FORBID_ATTR"in e?_({},e.FORBID_ATTR):{},Pe="USE_PROFILES"in e&&e.USE_PROFILES,Oe=!1!==e.ALLOW_ARIA_ATTR,Ee=!1!==e.ALLOW_DATA_ATTR,Ne=e.ALLOW_UNKNOWN_PROTOCOLS||!1,ke=e.SAFE_FOR_TEMPLATES||!1,Le=e.WHOLE_DOCUMENT||!1,De=e.RETURN_DOM||!1,je=e.RETURN_DOM_FRAGMENT||!1,Ce=!1!==e.RETURN_DOM_IMPORT,Ie=e.RETURN_TRUSTED_TYPE||!1,Re=e.FORCE_BODY||!1,Fe=!1!==e.SANITIZE_DOM,He=!1!==e.KEEP_CONTENT,ze=e.IN_PLACE||!1,be=e.ALLOWED_URI_REGEXP||be,$e=e.NAMESPACE||Ve,ke&&(Ee=!1),je&&(De=!0),Pe&&(we=_({},[].concat(q(R))),Ae=[],!0===Pe.html&&(_(we,O),_(Ae,D)),!0===Pe.svg&&(_(we,E),_(Ae,j),_(Ae,I)),!0===Pe.svgFilters&&(_(we,N),_(Ae,j),_(Ae,I)),!0===Pe.mathMl&&(_(we,L),_(Ae,C),_(Ae,I))),e.ADD_TAGS&&(we===Te&&(we=S(we)),_(we,e.ADD_TAGS)),e.ADD_ATTR&&(Ae===_e&&(Ae=S(Ae)),_(Ae,e.ADD_ATTR)),e.ADD_URI_SAFE_ATTR&&_(We,e.ADD_URI_SAFE_ATTR),He&&(we["#text"]=!0),Le&&_(we,["html","head","body"]),we.table&&(_(we,["tbody"]),delete Se.tbody),i&&i(e),Ze=e)},et=_({},["mi","mo","mn","ms","mtext"]),tt=_({},["foreignobject","desc","title","annotation-xml"]),nt=_({},E);_(nt,N),_(nt,k);var rt=_({},L);_(rt,M);var ot=function(e){var t=ne(e);t&&t.tagName||(t={namespaceURI:Ve,tagName:"template"});var n=g(e.tagName),r=g(t.tagName);if(e.namespaceURI===Ke)return t.namespaceURI===Ve?"svg"===n:t.namespaceURI===Ye?"svg"===n&&("annotation-xml"===r||et[r]):Boolean(nt[n]);if(e.namespaceURI===Ye)return t.namespaceURI===Ve?"math"===n:t.namespaceURI===Ke?"math"===n&&tt[r]:Boolean(rt[n]);if(e.namespaceURI===Ve){if(t.namespaceURI===Ke&&!tt[r])return!1;if(t.namespaceURI===Ye&&!et[r])return!1;var o=_({},["title","style","font","a","script"]);return!rt[n]&&(o[n]||!nt[n])}return!1},it=function(e){f(n.removed,{element:e});try{e.parentNode.removeChild(e)}catch(t){try{e.outerHTML=ie}catch(t){e.remove()}}},at=function(e,t){try{f(n.removed,{attribute:t.getAttributeNode(e),from:t})}catch(e){f(n.removed,{attribute:null,from:t})}if(t.removeAttribute(e),"is"===e&&!Ae[e])if(De||je)try{it(t)}catch(e){}else try{t.setAttribute(e,"")}catch(e){}},lt=function(e){var t=void 0,n=void 0;if(Re)e="<remove></remove>"+e;else{var r=y(e,/^[\r\n\t ]+/);n=r&&r[0]}var i=oe?oe.createHTML(e):e;if($e===Ve)try{t=(new X).parseFromString(i,"text/html")}catch(e){}if(!t||!t.documentElement){t=le.createDocument($e,"template",null);try{t.documentElement.innerHTML=Xe?"":i}catch(e){}}var a=t.body||t.documentElement;return e&&n&&a.insertBefore(o.createTextNode(n),a.childNodes[0]||null),Le?t.documentElement:a},ct=function(e){return ce.call(e.ownerDocument||e,e,u.SHOW_ELEMENT|u.SHOW_COMMENT|u.SHOW_TEXT,null,!1)},st=function(e){return!(e instanceof V||e instanceof $||"string"==typeof e.nodeName&&"string"==typeof e.textContent&&"function"==typeof e.removeChild&&e.attributes instanceof A&&"function"==typeof e.removeAttribute&&"function"==typeof e.setAttribute&&"string"==typeof e.namespaceURI&&"function"==typeof e.insertBefore)},ut=function(e){return"object"===(void 0===c?"undefined":W(c))?e instanceof c:e&&"object"===(void 0===e?"undefined":W(e))&&"number"==typeof e.nodeType&&"string"==typeof e.nodeName},mt=function(e,t,r){de[e]&&d(de[e],(function(e){e.call(n,t,r,Ze)}))},dt=function(e){var t=void 0;if(mt("beforeSanitizeElements",e,null),st(e))return it(e),!0;if(y(e.nodeName,/[\u0080-\uFFFF]/))return it(e),!0;var r=g(e.nodeName);if(mt("uponSanitizeElement",e,{tagName:r,allowedTags:we}),!ut(e.firstElementChild)&&(!ut(e.content)||!ut(e.content.firstElementChild))&&w(/<[/\w]/g,e.innerHTML)&&w(/<[/\w]/g,e.textContent))return it(e),!0;if(!we[r]||Se[r]){if(He&&!Ue[r]){var o=ne(e)||e.parentNode,i=te(e)||e.childNodes;if(i&&o)for(var a=i.length-1;a>=0;--a)o.insertBefore(Q(i[a],!0),ee(e))}return it(e),!0}return e instanceof s&&!ot(e)?(it(e),!0):"noscript"!==r&&"noembed"!==r||!w(/<\/no(script|embed)/i,e.innerHTML)?(ke&&3===e.nodeType&&(t=e.textContent,t=h(t,pe," "),t=h(t,fe," "),e.textContent!==t&&(f(n.removed,{element:e.cloneNode()}),e.textContent=t)),mt("afterSanitizeElements",e,null),!1):(it(e),!0)},pt=function(e,t,n){if(Fe&&("id"===t||"name"===t)&&(n in o||n in Je))return!1;if(Ee&&w(ge,t));else if(Oe&&w(ye,t));else{if(!Ae[t]||xe[t])return!1;if(We[t]);else if(w(be,h(n,ve,"")));else if("src"!==t&&"xlink:href"!==t&&"href"!==t||"script"===e||0!==v(n,"data:")||!Be[e])if(Ne&&!w(he,h(n,ve,"")));else if(n)return!1}return!0},ft=function(e){var t=void 0,r=void 0,o=void 0,i=void 0;mt("beforeSanitizeAttributes",e,null);var a=e.attributes;if(a){var l={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Ae};for(i=a.length;i--;){var c=t=a[i],s=c.name,u=c.namespaceURI;if(r=b(t.value),o=g(s),l.attrName=o,l.attrValue=r,l.keepAttr=!0,l.forceKeepAttr=void 0,mt("uponSanitizeAttribute",e,l),r=l.attrValue,!l.forceKeepAttr&&(at(s,e),l.keepAttr))if(w(/\/>/i,r))at(s,e);else{ke&&(r=h(r,pe," "),r=h(r,fe," "));var m=e.nodeName.toLowerCase();if(pt(m,o,r))try{u?e.setAttributeNS(u,s,r):e.setAttribute(s,r),p(n.removed)}catch(e){}}}mt("afterSanitizeAttributes",e,null)}},gt=function e(t){var n=void 0,r=ct(t);for(mt("beforeSanitizeShadowDOM",t,null);n=r.nextNode();)mt("uponSanitizeShadowNode",n,null),dt(n)||(n.content instanceof a&&e(n.content),ft(n));mt("afterSanitizeShadowDOM",t,null)};return n.sanitize=function(e,o){var i=void 0,l=void 0,s=void 0,u=void 0,m=void 0;if((Xe=!e)&&(e="\x3c!--\x3e"),"string"!=typeof e&&!ut(e)){if("function"!=typeof e.toString)throw T("toString is not a function");if("string"!=typeof(e=e.toString()))throw T("dirty is not a string, aborting")}if(!n.isSupported){if("object"===W(t.toStaticHTML)||"function"==typeof t.toStaticHTML){if("string"==typeof e)return t.toStaticHTML(e);if(ut(e))return t.toStaticHTML(e.outerHTML)}return e}if(Me||Qe(o),n.removed=[],"string"==typeof e&&(ze=!1),ze);else if(e instanceof c)1===(l=(i=lt("\x3c!----\x3e")).ownerDocument.importNode(e,!0)).nodeType&&"BODY"===l.nodeName||"HTML"===l.nodeName?i=l:i.appendChild(l);else{if(!De&&!ke&&!Le&&-1===e.indexOf("<"))return oe&&Ie?oe.createHTML(e):e;if(!(i=lt(e)))return De?null:ie}i&&Re&&it(i.firstChild);for(var d=ct(ze?e:i);s=d.nextNode();)3===s.nodeType&&s===u||dt(s)||(s.content instanceof a&&gt(s.content),ft(s),u=s);if(u=null,ze)return e;if(De){if(je)for(m=se.call(i.ownerDocument);i.firstChild;)m.appendChild(i.firstChild);else m=i;return Ce&&(m=ue.call(r,m,!0)),m}var p=Le?i.outerHTML:i.innerHTML;return ke&&(p=h(p,pe," "),p=h(p,fe," ")),oe&&Ie?oe.createHTML(p):p},n.setConfig=function(e){Qe(e),Me=!0},n.clearConfig=function(){Ze=null,Me=!1},n.isValidAttribute=function(e,t,n){Ze||Qe({});var r=g(e),o=g(t);return pt(r,o,n)},n.addHook=function(e,t){"function"==typeof t&&(de[e]=de[e]||[],f(de[e],t))},n.removeHook=function(e){de[e]&&p(de[e])},n.removeHooks=function(e){de[e]&&(de[e]=[])},n.removeAllHooks=function(){de={}},n}()}()},7:function(e,t){e.exports=window.wp.data}});woocommerce-admin/dist/wp-admin-scripts/payment-method-promotions.asset.php000064400000000301151335517650023313 0ustar00<?php return array('dependencies' => array('wc-components', 'wc-store-data', 'wc-tracks', 'wp-components', 'wp-data', 'wp-element', 'wp-i18n'), 'version' => '66b49b02f28289f0e588316aa494b85e');woocommerce-admin/dist/explat/index.asset.php000064400000000146151335517650015363 0ustar00<?php return array('dependencies' => array('react'), 'version' => '45e33a519a830bddc4370fcba320ad2b');woocommerce-admin/dist/explat/index.js000064400000055534151335517650014105 0ustar00/*! For license information please see index.js.LICENSE.txt */
this.wc=this.wc||{},this.wc.explat=function(e){var t={};function r(n){if(t[n])return t[n].exports;var i=t[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)r.d(n,i,function(t){return e[t]}.bind(null,i));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=463)}({266:function(e,t,r){"use strict";t.parse=function(e,t){if("string"!=typeof e)throw new TypeError("argument str must be a string");for(var r={},i=t||{},a=e.split(o),c=i.decode||n,l=0;l<a.length;l++){var u=a[l],f=u.indexOf("=");if(!(f<0)){var p=u.substr(0,f).trim(),d=u.substr(++f,u.length).trim();'"'==d[0]&&(d=d.slice(1,-1)),null==r[p]&&(r[p]=s(d,c))}}return r},t.serialize=function(e,t,r){var n=r||{},o=n.encode||i;if("function"!=typeof o)throw new TypeError("option encode is invalid");if(!a.test(e))throw new TypeError("argument name is invalid");var s=o(t);if(s&&!a.test(s))throw new TypeError("argument val is invalid");var c=e+"="+s;if(null!=n.maxAge){var l=n.maxAge-0;if(isNaN(l)||!isFinite(l))throw new TypeError("option maxAge is invalid");c+="; Max-Age="+Math.floor(l)}if(n.domain){if(!a.test(n.domain))throw new TypeError("option domain is invalid");c+="; Domain="+n.domain}if(n.path){if(!a.test(n.path))throw new TypeError("option path is invalid");c+="; Path="+n.path}if(n.expires){if("function"!=typeof n.expires.toUTCString)throw new TypeError("option expires is invalid");c+="; Expires="+n.expires.toUTCString()}n.httpOnly&&(c+="; HttpOnly");n.secure&&(c+="; Secure");if(n.sameSite){switch("string"==typeof n.sameSite?n.sameSite.toLowerCase():n.sameSite){case!0:c+="; SameSite=Strict";break;case"lax":c+="; SameSite=Lax";break;case"strict":c+="; SameSite=Strict";break;case"none":c+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}}return c};var n=decodeURIComponent,i=encodeURIComponent,o=/; */,a=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/;function s(e,t){try{return t(e)}catch(t){return e}}},32:function(e,t,r){"use strict";var n=r(67),i=r(68),o=r(39);e.exports={formats:o,parse:i,stringify:n}},39:function(e,t,r){"use strict";var n=String.prototype.replace,i=/%20/g,o="RFC1738",a="RFC3986";e.exports={default:a,formatters:{RFC1738:function(e){return n.call(e,i,"+")},RFC3986:function(e){return String(e)}},RFC1738:o,RFC3986:a}},463:function(e,t,r){"use strict";r.r(t),r.d(t,"initializeExPlat",(function(){return k})),r.d(t,"loadExperimentAssignment",(function(){return _})),r.d(t,"dangerouslyGetExperimentAssignment",(function(){return I})),r.d(t,"useExperiment",(function(){return L})),r.d(t,"Experiment",(function(){return M})),r.d(t,"ProvideExperimentData",(function(){return H}));var n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)};var i=function(){return(i=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)};function o(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{c(n.next(e))}catch(e){o(e)}}function s(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}c((n=n.apply(e,t||[])).next())}))}function a(e,t){var r,n,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,n=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=t.call(e,a)}catch(e){o=[6,e],n=0}finally{r=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}}Object.create;Object.create;var s=Date.now();function c(){var e=Date.now();return s=s<e?e:s+1}function l(e){return c()<1e3*e.ttl+e.retrievedTimestamp}var u=function(e,t){return void 0===t&&(t=60),{experimentName:e,variationName:null,retrievedTimestamp:c(),ttl:Math.max(60,t),isFallbackExperimentAssignment:!0}};function f(e){return"object"==typeof e&&null!==e}function p(e){return"string"==typeof e&&""!==e}function d(e){if(!function(e){return f(e)&&p(e.experimentName)&&(p(e.variationName)||null===e.variationName)&&"number"==typeof e.retrievedTimestamp&&"number"==typeof e.ttl&&0!==e.ttl}(e))throw new Error("Invalid ExperimentAssignment");return e}var m="undefined"!=typeof window&&window.localStorage?window.localStorage:{_data:{},setItem:function(e,t){this._data[e]=t},getItem:function(e){return this._data.hasOwnProperty(e)?this._data[e]:void 0},removeItem:function(e){delete this._data[e]},clear:function(){this._data={}}};function y(e){if(function(e){return f(e)&&f(e.variations)&&"number"==typeof e.ttl&&0<e.ttl}(e))return e;throw new Error("Invalid FetchExperimentAssignmentResponse")}function h(e,t){return o(this,void 0,void 0,(function(){var r,n,i,s,f,p,h,v,g,w,b;return a(this,(function(x){switch(x.label){case 0:return r=c(),f=y,h=(p=e).fetchExperimentAssignment,b={},[4,(E=e.getAnonId,o(void 0,void 0,void 0,(function(){var e,t,r;return a(this,(function(n){switch(n.label){case 0:return[4,E()];case 1:return(e=n.sent())?(m.setItem("explat-last-anon-id",e),m.setItem("explat-last-anon-id-retrieval-time",String(c())),[2,e]):(t=m.getItem("explat-last-anon-id"),r=m.getItem("explat-last-anon-id-retrieval-time"),t&&r&&c()-parseInt(r,10)<864e5?[2,t]:[2,null])}}))})))];case 1:return[4,h.apply(p,[(b.anonId=x.sent(),b.experimentName=t,b)])];case 2:if(n=f.apply(void 0,[x.sent()]),i=n.variations,s=n.ttl,v=Math.max(60,s),(g=Object.entries(i).map((function(e){return{experimentName:e[0],variationName:e[1],retrievedTimestamp:r,ttl:v}})).map(d)).length>1)throw new Error("Received multiple experiment assignments while trying to fetch exactly one.");if(0===g.length)return[2,u(t,v)];if((w=g[0]).experimentName!==t)throw new Error("Newly fetched ExperimentAssignment's experiment name does not match request.");if(!l(w))throw new Error("Newly fetched experiment isn't alive.");return[2,w]}var E}))}))}var v=function(e){return"explat-experiment--"+e};function g(e){d(e);var t=w(e.experimentName);if(t&&e.retrievedTimestamp<t.retrievedTimestamp)throw new Error("Trying to store an older experiment assignment than is present in the store, likely a race condition.");m.setItem(v(e.experimentName),JSON.stringify(e))}function w(e){var t=m.getItem(v(e));if(t)return d(JSON.parse(t))}!function(e){function t(r){var n=e.call(this,r)||this;return Error.captureStackTrace&&Error.captureStackTrace(n,t),n.name="MissingExperimentAssignmentError",n}(function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)})(t,e)}(Error);var b="undefined"==typeof window?function(e){var t=this;return{loadExperimentAssignment:function(r){return o(t,void 0,void 0,(function(){return a(this,(function(t){return e.logError({message:"Attempting to load ExperimentAssignment in SSR context",experimentName:r}),[2,u(r)]}))}))},dangerouslyGetExperimentAssignment:function(t){return e.logError({message:"Attempting to dangerously get ExperimentAssignment in SSR context",experimentName:t}),u(t)},config:e}}:function(e){var t=this;if("undefined"==typeof window)throw new Error("Running outside of a browser context.");var r={},n=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];try{e.logError.apply(e,t)}catch(e){}};return{loadExperimentAssignment:function(i){return o(t,void 0,void 0,(function(){var s,c,f,d;return a(this,(function(m){switch(m.label){case 0:if(m.trys.push([0,2,,3]),!p(i))throw new Error('Invalid experimentName: "'+i+'"');return(f=w(i))&&l(f)?[2,f]:(void 0===r[i]&&(r[i]=function(r){return n=function(){return o(t,void 0,void 0,(function(){var t;return a(this,(function(n){switch(n.label){case 0:return[4,h(e,r)];case 1:return g(t=n.sent()),[2,t]}}))}))},i=null,function(){return i||(i=n().finally((function(){i=null}))),i};var n,i}(i)),[4,(y=r[i](),v=1e4,Promise.race([y,new Promise((function(e,t){return setTimeout((function(){return t(new Error("Promise has timed-out."))}),v)}))]))]);case 1:if(!(s=m.sent()))throw new Error("Could not fetch ExperimentAssignment");return[2,s];case 2:return c=m.sent(),n({message:c.message,experimentName:i,source:"loadExperimentAssignment-initialError"}),[3,3];case 3:try{return(f=w(i))?[2,f]:(g(d=u(i)),[2,d])}catch(e){return n({message:e.message,experimentName:i,source:"loadExperimentAssignment-fallbackError"}),[2,u(i)]}return[2]}var y,v}))}))},dangerouslyGetExperimentAssignment:function(t){try{if(!p(t))throw new Error("Invalid experimentName: "+t);var r=w(t);if(!r)throw new Error("Trying to dangerously get an ExperimentAssignment that hasn't loaded.");return e.isDevelopmentMode&&r&&c()-r.retrievedTimestamp<1e3&&n({message:"Warning: Trying to dangerously get an ExperimentAssignment too soon after loading it.",experimentName:t,source:"dangerouslyGetExperimentAssignment"}),r}catch(e){return n({message:e.message,experimentName:t,source:"dangerouslyGetExperimentAssignment-error"}),u(t)}},config:e}},x=r(5),E=r.n(x),O={isEligible:!0};const j=e=>{const t=e=>{0};try{const{message:n,...i}=e,o={message:n,properties:{...i,context:"explat",explat_client:"woocommerce"}};{var r;if(null===(r=window.wcTracks)||void 0===r||!r.isEnabled)throw new Error("Tracking is disabled, can't send error to the server");const e=new window.FormData;e.append("error",JSON.stringify(o)),window.fetch("https://public-api.wordpress.com/rest/v1.1/js-error",{method:"POST",body:e}).catch(t)}}catch(e){t()}};var S=r(32);var N=r(266),A=r.n(N);let T=null;const P=async()=>{let e=0;return T=new Promise(t=>{const r=()=>{const n=A.a.parse(document.cookie).tk_ai||null;"string"!=typeof n||""===n?99<=e?t(null):(e+=1,setTimeout(r,50)):t(n)};r()}),T},k=()=>{var e;null!==(e=window.wcTracks)&&void 0!==e&&e.isEnabled&&P().catch(e=>j({message:e.message}))};k();const D=b({fetchExperimentAssignment:async({experimentName:e,anonId:t})=>{var r,n,i,o,a,s,c,l;if(null===(r=window.wcTracks)||void 0===r||!r.isEnabled)throw new Error("Tracking is disabled, can't fetch experimentAssignment");const u=Object(S.stringify)({experiment_name:e,anon_id:null!=t?t:void 0,woo_country_code:(null===(n=window.wcSettings)||void 0===n||null===(i=n.preloadSettings)||void 0===i||null===(o=i.general)||void 0===o?void 0:o.woocommerce_default_country)||(null===(a=window.wcSettings)||void 0===a||null===(s=a.admin)||void 0===s||null===(c=s.preloadSettings)||void 0===c||null===(l=c.general)||void 0===l?void 0:l.woocommerce_default_country)}),f=await window.fetch("https://public-api.wordpress.com/wpcom/v2/experiments/0.1.0/assignments/woocommerce?"+u);return await f.json()},getAnonId:async()=>{var e;return null!==(e=window.wcTracks)&&void 0!==e&&e.isEnabled?await T:null},logError:j,isDevelopmentMode:!1}),{loadExperimentAssignment:_,dangerouslyGetExperimentAssignment:I}=D,C=(R=D,{useExperiment:F=function(e,t){void 0===t&&(t={});var r=i(i({},O),t),n=Object(x.useState)(e)[0],o=Object(x.useState)([!0,null]),a=o[0],s=o[1];return Object(x.useEffect)((function(){var t=!0;return r.isEligible&&R.loadExperimentAssignment(e).then((function(e){t&&s([!1,e])})),function(){t=!1}}),[e,r.isEligible]),e===n||n.startsWith("explat_test")||R.config.logError({message:"[ExPlat] useExperiment: experimentName should never change between renders!"}),r.isEligible?a:[!1,null]},Experiment:function(e){var t=e.defaultExperience,r=e.treatmentExperience,n=e.loadingExperience,i=e.name,o=e.options,a=F(i,o),s=a[0],c=a[1];return s?E.a.createElement(E.a.Fragment,null,n):(null==c?void 0:c.variationName)?E.a.createElement(E.a.Fragment,null,r):E.a.createElement(E.a.Fragment,null,t)},ProvideExperimentData:function(e){var t=e.children,r=e.name,n=e.options,i=F(r,n);return t(i[0],i[1])}});var R,F;const{useExperiment:L,Experiment:M,ProvideExperimentData:H}=C},49:function(e,t,r){"use strict";var n=r(39),i=Object.prototype.hasOwnProperty,o=Array.isArray,a=function(){for(var e=[],t=0;t<256;++t)e.push("%"+((t<16?"0":"")+t.toString(16)).toUpperCase());return e}(),s=function(e,t){for(var r=t&&t.plainObjects?Object.create(null):{},n=0;n<e.length;++n)void 0!==e[n]&&(r[n]=e[n]);return r};e.exports={arrayToObject:s,assign:function(e,t){return Object.keys(t).reduce((function(e,r){return e[r]=t[r],e}),e)},combine:function(e,t){return[].concat(e,t)},compact:function(e){for(var t=[{obj:{o:e},prop:"o"}],r=[],n=0;n<t.length;++n)for(var i=t[n],a=i.obj[i.prop],s=Object.keys(a),c=0;c<s.length;++c){var l=s[c],u=a[l];"object"==typeof u&&null!==u&&-1===r.indexOf(u)&&(t.push({obj:a,prop:l}),r.push(u))}return function(e){for(;e.length>1;){var t=e.pop(),r=t.obj[t.prop];if(o(r)){for(var n=[],i=0;i<r.length;++i)void 0!==r[i]&&n.push(r[i]);t.obj[t.prop]=n}}}(t),e},decode:function(e,t,r){var n=e.replace(/\+/g," ");if("iso-8859-1"===r)return n.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(n)}catch(e){return n}},encode:function(e,t,r,i,o){if(0===e.length)return e;var s=e;if("symbol"==typeof e?s=Symbol.prototype.toString.call(e):"string"!=typeof e&&(s=String(e)),"iso-8859-1"===r)return escape(s).replace(/%u[0-9a-f]{4}/gi,(function(e){return"%26%23"+parseInt(e.slice(2),16)+"%3B"}));for(var c="",l=0;l<s.length;++l){var u=s.charCodeAt(l);45===u||46===u||95===u||126===u||u>=48&&u<=57||u>=65&&u<=90||u>=97&&u<=122||o===n.RFC1738&&(40===u||41===u)?c+=s.charAt(l):u<128?c+=a[u]:u<2048?c+=a[192|u>>6]+a[128|63&u]:u<55296||u>=57344?c+=a[224|u>>12]+a[128|u>>6&63]+a[128|63&u]:(l+=1,u=65536+((1023&u)<<10|1023&s.charCodeAt(l)),c+=a[240|u>>18]+a[128|u>>12&63]+a[128|u>>6&63]+a[128|63&u])}return c},isBuffer:function(e){return!(!e||"object"!=typeof e)&&!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))},isRegExp:function(e){return"[object RegExp]"===Object.prototype.toString.call(e)},maybeMap:function(e,t){if(o(e)){for(var r=[],n=0;n<e.length;n+=1)r.push(t(e[n]));return r}return t(e)},merge:function e(t,r,n){if(!r)return t;if("object"!=typeof r){if(o(t))t.push(r);else{if(!t||"object"!=typeof t)return[t,r];(n&&(n.plainObjects||n.allowPrototypes)||!i.call(Object.prototype,r))&&(t[r]=!0)}return t}if(!t||"object"!=typeof t)return[t].concat(r);var a=t;return o(t)&&!o(r)&&(a=s(t,n)),o(t)&&o(r)?(r.forEach((function(r,o){if(i.call(t,o)){var a=t[o];a&&"object"==typeof a&&r&&"object"==typeof r?t[o]=e(a,r,n):t.push(r)}else t[o]=r})),t):Object.keys(r).reduce((function(t,o){var a=r[o];return i.call(t,o)?t[o]=e(t[o],a,n):t[o]=a,t}),a)}}},5:function(e,t){e.exports=window.React},67:function(e,t,r){"use strict";var n=r(49),i=r(39),o=Object.prototype.hasOwnProperty,a={brackets:function(e){return e+"[]"},comma:"comma",indices:function(e,t){return e+"["+t+"]"},repeat:function(e){return e}},s=Array.isArray,c=Array.prototype.push,l=function(e,t){c.apply(e,s(t)?t:[t])},u=Date.prototype.toISOString,f=i.default,p={addQueryPrefix:!1,allowDots:!1,charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encoder:n.encode,encodeValuesOnly:!1,format:f,formatter:i.formatters[f],indices:!1,serializeDate:function(e){return u.call(e)},skipNulls:!1,strictNullHandling:!1},d=function e(t,r,i,o,a,c,u,f,d,m,y,h,v,g){var w,b=t;if("function"==typeof u?b=u(r,b):b instanceof Date?b=m(b):"comma"===i&&s(b)&&(b=n.maybeMap(b,(function(e){return e instanceof Date?m(e):e}))),null===b){if(o)return c&&!v?c(r,p.encoder,g,"key",y):r;b=""}if("string"==typeof(w=b)||"number"==typeof w||"boolean"==typeof w||"symbol"==typeof w||"bigint"==typeof w||n.isBuffer(b))return c?[h(v?r:c(r,p.encoder,g,"key",y))+"="+h(c(b,p.encoder,g,"value",y))]:[h(r)+"="+h(String(b))];var x,E=[];if(void 0===b)return E;if("comma"===i&&s(b))x=[{value:b.length>0?b.join(",")||null:void 0}];else if(s(u))x=u;else{var O=Object.keys(b);x=f?O.sort(f):O}for(var j=0;j<x.length;++j){var S=x[j],N="object"==typeof S&&void 0!==S.value?S.value:b[S];if(!a||null!==N){var A=s(b)?"function"==typeof i?i(r,S):r:r+(d?"."+S:"["+S+"]");l(E,e(N,A,i,o,a,c,u,f,d,m,y,h,v,g))}}return E};e.exports=function(e,t){var r,n=e,c=function(e){if(!e)return p;if(null!==e.encoder&&void 0!==e.encoder&&"function"!=typeof e.encoder)throw new TypeError("Encoder has to be a function.");var t=e.charset||p.charset;if(void 0!==e.charset&&"utf-8"!==e.charset&&"iso-8859-1"!==e.charset)throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var r=i.default;if(void 0!==e.format){if(!o.call(i.formatters,e.format))throw new TypeError("Unknown format option provided.");r=e.format}var n=i.formatters[r],a=p.filter;return("function"==typeof e.filter||s(e.filter))&&(a=e.filter),{addQueryPrefix:"boolean"==typeof e.addQueryPrefix?e.addQueryPrefix:p.addQueryPrefix,allowDots:void 0===e.allowDots?p.allowDots:!!e.allowDots,charset:t,charsetSentinel:"boolean"==typeof e.charsetSentinel?e.charsetSentinel:p.charsetSentinel,delimiter:void 0===e.delimiter?p.delimiter:e.delimiter,encode:"boolean"==typeof e.encode?e.encode:p.encode,encoder:"function"==typeof e.encoder?e.encoder:p.encoder,encodeValuesOnly:"boolean"==typeof e.encodeValuesOnly?e.encodeValuesOnly:p.encodeValuesOnly,filter:a,format:r,formatter:n,serializeDate:"function"==typeof e.serializeDate?e.serializeDate:p.serializeDate,skipNulls:"boolean"==typeof e.skipNulls?e.skipNulls:p.skipNulls,sort:"function"==typeof e.sort?e.sort:null,strictNullHandling:"boolean"==typeof e.strictNullHandling?e.strictNullHandling:p.strictNullHandling}}(t);"function"==typeof c.filter?n=(0,c.filter)("",n):s(c.filter)&&(r=c.filter);var u,f=[];if("object"!=typeof n||null===n)return"";u=t&&t.arrayFormat in a?t.arrayFormat:t&&"indices"in t?t.indices?"indices":"repeat":"indices";var m=a[u];r||(r=Object.keys(n)),c.sort&&r.sort(c.sort);for(var y=0;y<r.length;++y){var h=r[y];c.skipNulls&&null===n[h]||l(f,d(n[h],h,m,c.strictNullHandling,c.skipNulls,c.encode?c.encoder:null,c.filter,c.sort,c.allowDots,c.serializeDate,c.format,c.formatter,c.encodeValuesOnly,c.charset))}var v=f.join(c.delimiter),g=!0===c.addQueryPrefix?"?":"";return c.charsetSentinel&&("iso-8859-1"===c.charset?g+="utf8=%26%2310003%3B&":g+="utf8=%E2%9C%93&"),v.length>0?g+v:""}},68:function(e,t,r){"use strict";var n=r(49),i=Object.prototype.hasOwnProperty,o=Array.isArray,a={allowDots:!1,allowPrototypes:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decoder:n.decode,delimiter:"&",depth:5,ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictNullHandling:!1},s=function(e){return e.replace(/&#(\d+);/g,(function(e,t){return String.fromCharCode(parseInt(t,10))}))},c=function(e,t){return e&&"string"==typeof e&&t.comma&&e.indexOf(",")>-1?e.split(","):e},l=function(e,t,r,n){if(e){var o=r.allowDots?e.replace(/\.([^.[]+)/g,"[$1]"):e,a=/(\[[^[\]]*])/g,s=r.depth>0&&/(\[[^[\]]*])/.exec(o),l=s?o.slice(0,s.index):o,u=[];if(l){if(!r.plainObjects&&i.call(Object.prototype,l)&&!r.allowPrototypes)return;u.push(l)}for(var f=0;r.depth>0&&null!==(s=a.exec(o))&&f<r.depth;){if(f+=1,!r.plainObjects&&i.call(Object.prototype,s[1].slice(1,-1))&&!r.allowPrototypes)return;u.push(s[1])}return s&&u.push("["+o.slice(s.index)+"]"),function(e,t,r,n){for(var i=n?t:c(t,r),o=e.length-1;o>=0;--o){var a,s=e[o];if("[]"===s&&r.parseArrays)a=[].concat(i);else{a=r.plainObjects?Object.create(null):{};var l="["===s.charAt(0)&&"]"===s.charAt(s.length-1)?s.slice(1,-1):s,u=parseInt(l,10);r.parseArrays||""!==l?!isNaN(u)&&s!==l&&String(u)===l&&u>=0&&r.parseArrays&&u<=r.arrayLimit?(a=[])[u]=i:a[l]=i:a={0:i}}i=a}return i}(u,t,r,n)}};e.exports=function(e,t){var r=function(e){if(!e)return a;if(null!==e.decoder&&void 0!==e.decoder&&"function"!=typeof e.decoder)throw new TypeError("Decoder has to be a function.");if(void 0!==e.charset&&"utf-8"!==e.charset&&"iso-8859-1"!==e.charset)throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var t=void 0===e.charset?a.charset:e.charset;return{allowDots:void 0===e.allowDots?a.allowDots:!!e.allowDots,allowPrototypes:"boolean"==typeof e.allowPrototypes?e.allowPrototypes:a.allowPrototypes,arrayLimit:"number"==typeof e.arrayLimit?e.arrayLimit:a.arrayLimit,charset:t,charsetSentinel:"boolean"==typeof e.charsetSentinel?e.charsetSentinel:a.charsetSentinel,comma:"boolean"==typeof e.comma?e.comma:a.comma,decoder:"function"==typeof e.decoder?e.decoder:a.decoder,delimiter:"string"==typeof e.delimiter||n.isRegExp(e.delimiter)?e.delimiter:a.delimiter,depth:"number"==typeof e.depth||!1===e.depth?+e.depth:a.depth,ignoreQueryPrefix:!0===e.ignoreQueryPrefix,interpretNumericEntities:"boolean"==typeof e.interpretNumericEntities?e.interpretNumericEntities:a.interpretNumericEntities,parameterLimit:"number"==typeof e.parameterLimit?e.parameterLimit:a.parameterLimit,parseArrays:!1!==e.parseArrays,plainObjects:"boolean"==typeof e.plainObjects?e.plainObjects:a.plainObjects,strictNullHandling:"boolean"==typeof e.strictNullHandling?e.strictNullHandling:a.strictNullHandling}}(t);if(""===e||null==e)return r.plainObjects?Object.create(null):{};for(var u="string"==typeof e?function(e,t){var r,l={},u=t.ignoreQueryPrefix?e.replace(/^\?/,""):e,f=t.parameterLimit===1/0?void 0:t.parameterLimit,p=u.split(t.delimiter,f),d=-1,m=t.charset;if(t.charsetSentinel)for(r=0;r<p.length;++r)0===p[r].indexOf("utf8=")&&("utf8=%E2%9C%93"===p[r]?m="utf-8":"utf8=%26%2310003%3B"===p[r]&&(m="iso-8859-1"),d=r,r=p.length);for(r=0;r<p.length;++r)if(r!==d){var y,h,v=p[r],g=v.indexOf("]="),w=-1===g?v.indexOf("="):g+1;-1===w?(y=t.decoder(v,a.decoder,m,"key"),h=t.strictNullHandling?null:""):(y=t.decoder(v.slice(0,w),a.decoder,m,"key"),h=n.maybeMap(c(v.slice(w+1),t),(function(e){return t.decoder(e,a.decoder,m,"value")}))),h&&t.interpretNumericEntities&&"iso-8859-1"===m&&(h=s(h)),v.indexOf("[]=")>-1&&(h=o(h)?[h]:h),i.call(l,y)?l[y]=n.combine(l[y],h):l[y]=h}return l}(e,r):e,f=r.plainObjects?Object.create(null):{},p=Object.keys(u),d=0;d<p.length;++d){var m=p[d],y=l(m,u[m],r,"string"==typeof e);f=n.merge(f,y,r)}return n.compact(f)}}});woocommerce-admin/dist/explat/index.js.LICENSE.txt000064400000001644151335517650015775 0ustar00/*!
 * cookie
 * Copyright(c) 2012-2014 Roman Shtylman
 * Copyright(c) 2015 Douglas Christopher Wilson
 * MIT Licensed
 */

/*! *****************************************************************************
Copyright (c) Microsoft Corporation.

Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */
woocommerce-admin/dist/data/index.js.LICENSE.txt000064400000000170151335517650015402 0ustar00/*!
 * Determine if an object is a Buffer
 *
 * @author   Feross Aboukhadijeh <https://feross.org>
 * @license  MIT
 */
woocommerce-admin/dist/data/index.js000064400000230266151335517650013516 0ustar00/*! For license information please see index.js.LICENSE.txt */
this.wc=this.wc||{},this.wc.data=function(t){var e={};function r(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)r.d(n,o,function(e){return t[e]}.bind(null,o));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=462)}({0:function(t,e){t.exports=window.wp.element},10:function(t,e){t.exports=window.wp.dataControls},12:function(t,e){t.exports=window.wc.navigation},14:function(t,e){t.exports=window.wp.compose},15:function(t,e){t.exports=window.wp.url},17:function(t,e){t.exports=window.wp.apiFetch},19:function(t,e){t.exports=window.wc.date},2:function(t,e){t.exports=window.wp.i18n},250:function(t,e){var r={utf8:{stringToBytes:function(t){return r.bin.stringToBytes(unescape(encodeURIComponent(t)))},bytesToString:function(t){return decodeURIComponent(escape(r.bin.bytesToString(t)))}},bin:{stringToBytes:function(t){for(var e=[],r=0;r<t.length;r++)e.push(255&t.charCodeAt(r));return e},bytesToString:function(t){for(var e=[],r=0;r<t.length;r++)e.push(String.fromCharCode(t[r]));return e.join("")}}};t.exports=r},267:function(t,e,r){var n,o,s,i,a;n=r(448),o=r(250).utf8,s=r(449),i=r(250).bin,(a=function(t,e){t.constructor==String?t=e&&"binary"===e.encoding?i.stringToBytes(t):o.stringToBytes(t):s(t)?t=Array.prototype.slice.call(t,0):Array.isArray(t)||t.constructor===Uint8Array||(t=t.toString());for(var r=n.bytesToWords(t),c=8*t.length,u=1732584193,d=-271733879,E=-1732584194,S=271733878,l=0;l<r.length;l++)r[l]=16711935&(r[l]<<8|r[l]>>>24)|4278255360&(r[l]<<24|r[l]>>>8);r[c>>>5]|=128<<c%32,r[14+(c+64>>>9<<4)]=c;var T=a._ff,_=a._gg,p=a._hh,g=a._ii;for(l=0;l<r.length;l+=16){var f=u,y=d,R=E,m=S;u=T(u,d,E,S,r[l+0],7,-680876936),S=T(S,u,d,E,r[l+1],12,-389564586),E=T(E,S,u,d,r[l+2],17,606105819),d=T(d,E,S,u,r[l+3],22,-1044525330),u=T(u,d,E,S,r[l+4],7,-176418897),S=T(S,u,d,E,r[l+5],12,1200080426),E=T(E,S,u,d,r[l+6],17,-1473231341),d=T(d,E,S,u,r[l+7],22,-45705983),u=T(u,d,E,S,r[l+8],7,1770035416),S=T(S,u,d,E,r[l+9],12,-1958414417),E=T(E,S,u,d,r[l+10],17,-42063),d=T(d,E,S,u,r[l+11],22,-1990404162),u=T(u,d,E,S,r[l+12],7,1804603682),S=T(S,u,d,E,r[l+13],12,-40341101),E=T(E,S,u,d,r[l+14],17,-1502002290),u=_(u,d=T(d,E,S,u,r[l+15],22,1236535329),E,S,r[l+1],5,-165796510),S=_(S,u,d,E,r[l+6],9,-1069501632),E=_(E,S,u,d,r[l+11],14,643717713),d=_(d,E,S,u,r[l+0],20,-373897302),u=_(u,d,E,S,r[l+5],5,-701558691),S=_(S,u,d,E,r[l+10],9,38016083),E=_(E,S,u,d,r[l+15],14,-660478335),d=_(d,E,S,u,r[l+4],20,-405537848),u=_(u,d,E,S,r[l+9],5,568446438),S=_(S,u,d,E,r[l+14],9,-1019803690),E=_(E,S,u,d,r[l+3],14,-187363961),d=_(d,E,S,u,r[l+8],20,1163531501),u=_(u,d,E,S,r[l+13],5,-1444681467),S=_(S,u,d,E,r[l+2],9,-51403784),E=_(E,S,u,d,r[l+7],14,1735328473),u=p(u,d=_(d,E,S,u,r[l+12],20,-1926607734),E,S,r[l+5],4,-378558),S=p(S,u,d,E,r[l+8],11,-2022574463),E=p(E,S,u,d,r[l+11],16,1839030562),d=p(d,E,S,u,r[l+14],23,-35309556),u=p(u,d,E,S,r[l+1],4,-1530992060),S=p(S,u,d,E,r[l+4],11,1272893353),E=p(E,S,u,d,r[l+7],16,-155497632),d=p(d,E,S,u,r[l+10],23,-1094730640),u=p(u,d,E,S,r[l+13],4,681279174),S=p(S,u,d,E,r[l+0],11,-358537222),E=p(E,S,u,d,r[l+3],16,-722521979),d=p(d,E,S,u,r[l+6],23,76029189),u=p(u,d,E,S,r[l+9],4,-640364487),S=p(S,u,d,E,r[l+12],11,-421815835),E=p(E,S,u,d,r[l+15],16,530742520),u=g(u,d=p(d,E,S,u,r[l+2],23,-995338651),E,S,r[l+0],6,-198630844),S=g(S,u,d,E,r[l+7],10,1126891415),E=g(E,S,u,d,r[l+14],15,-1416354905),d=g(d,E,S,u,r[l+5],21,-57434055),u=g(u,d,E,S,r[l+12],6,1700485571),S=g(S,u,d,E,r[l+3],10,-1894986606),E=g(E,S,u,d,r[l+10],15,-1051523),d=g(d,E,S,u,r[l+1],21,-2054922799),u=g(u,d,E,S,r[l+8],6,1873313359),S=g(S,u,d,E,r[l+15],10,-30611744),E=g(E,S,u,d,r[l+6],15,-1560198380),d=g(d,E,S,u,r[l+13],21,1309151649),u=g(u,d,E,S,r[l+4],6,-145523070),S=g(S,u,d,E,r[l+11],10,-1120210379),E=g(E,S,u,d,r[l+2],15,718787259),d=g(d,E,S,u,r[l+9],21,-343485551),u=u+f>>>0,d=d+y>>>0,E=E+R>>>0,S=S+m>>>0}return n.endian([u,d,E,S])})._ff=function(t,e,r,n,o,s,i){var a=t+(e&r|~e&n)+(o>>>0)+i;return(a<<s|a>>>32-s)+e},a._gg=function(t,e,r,n,o,s,i){var a=t+(e&n|r&~n)+(o>>>0)+i;return(a<<s|a>>>32-s)+e},a._hh=function(t,e,r,n,o,s,i){var a=t+(e^r^n)+(o>>>0)+i;return(a<<s|a>>>32-s)+e},a._ii=function(t,e,r,n,o,s,i){var a=t+(r^(e|~n))+(o>>>0)+i;return(a<<s|a>>>32-s)+e},a._blocksize=16,a._digestsize=16,t.exports=function(t,e){if(null==t)throw new Error("Illegal argument "+t);var r=n.wordsToBytes(a(t,e));return e&&e.asBytes?r:e&&e.asString?i.bytesToString(r):n.bytesToHex(r)}},30:function(t,e){t.exports=window.wp.hooks},4:function(t,e){t.exports=window.lodash},43:function(t,e){t.exports=window.wp.deprecated},447:function(t,e){t.exports=window.wp.coreData},448:function(t,e){var r,n;r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n={rotl:function(t,e){return t<<e|t>>>32-e},rotr:function(t,e){return t<<32-e|t>>>e},endian:function(t){if(t.constructor==Number)return 16711935&n.rotl(t,8)|4278255360&n.rotl(t,24);for(var e=0;e<t.length;e++)t[e]=n.endian(t[e]);return t},randomBytes:function(t){for(var e=[];t>0;t--)e.push(Math.floor(256*Math.random()));return e},bytesToWords:function(t){for(var e=[],r=0,n=0;r<t.length;r++,n+=8)e[n>>>5]|=t[r]<<24-n%32;return e},wordsToBytes:function(t){for(var e=[],r=0;r<32*t.length;r+=8)e.push(t[r>>>5]>>>24-r%32&255);return e},bytesToHex:function(t){for(var e=[],r=0;r<t.length;r++)e.push((t[r]>>>4).toString(16)),e.push((15&t[r]).toString(16));return e.join("")},hexToBytes:function(t){for(var e=[],r=0;r<t.length;r+=2)e.push(parseInt(t.substr(r,2),16));return e},bytesToBase64:function(t){for(var e=[],n=0;n<t.length;n+=3)for(var o=t[n]<<16|t[n+1]<<8|t[n+2],s=0;s<4;s++)8*n+6*s<=8*t.length?e.push(r.charAt(o>>>6*(3-s)&63)):e.push("=");return e.join("")},base64ToBytes:function(t){t=t.replace(/[^A-Z0-9+\/]/gi,"");for(var e=[],n=0,o=0;n<t.length;o=++n%4)0!=o&&e.push((r.indexOf(t.charAt(n-1))&Math.pow(2,-2*o+8)-1)<<2*o|r.indexOf(t.charAt(n))>>>6-2*o);return e}},t.exports=n},449:function(t,e){function r(t){return!!t.constructor&&"function"==typeof t.constructor.isBuffer&&t.constructor.isBuffer(t)}t.exports=function(t){return null!=t&&(r(t)||function(t){return"function"==typeof t.readFloatLE&&"function"==typeof t.slice&&r(t.slice(0,0))}(t)||!!t._isBuffer)}},462:function(t,e,r){"use strict";r.r(e),r.d(e,"SETTINGS_STORE_NAME",(function(){return ht})),r.d(e,"withSettingsHydration",(function(){return Ut})),r.d(e,"useSettings",(function(){return wt})),r.d(e,"PLUGINS_STORE_NAME",(function(){return ke})),r.d(e,"pluginNames",(function(){return Nt})),r.d(e,"withPluginsHydration",(function(){return Me})),r.d(e,"ONBOARDING_STORE_NAME",(function(){return Fr})),r.d(e,"withOnboardingHydration",(function(){return Lr})),r.d(e,"USER_STORE_NAME",(function(){return qr})),r.d(e,"withCurrentUserHydration",(function(){return Yr})),r.d(e,"useUser",(function(){return Qr})),r.d(e,"useUserPreferences",(function(){return Kr})),r.d(e,"OPTIONS_STORE_NAME",(function(){return Ae})),r.d(e,"withOptionsHydration",(function(){return Vr})),r.d(e,"useOptionsHydration",(function(){return Wr})),r.d(e,"REVIEWS_STORE_NAME",(function(){return un})),r.d(e,"NOTES_STORE_NAME",(function(){return Dn})),r.d(e,"REPORTS_STORE_NAME",(function(){return Hn})),r.d(e,"ITEMS_STORE_NAME",(function(){return To})),r.d(e,"getLeaderboard",(function(){return $n})),r.d(e,"searchItemsByString",(function(){return Bn})),r.d(e,"NAVIGATION_STORE_NAME",(function(){return Lo})),r.d(e,"withNavigationHydration",(function(){return qo})),r.d(e,"PAYMENT_GATEWAYS_STORE_NAME",(function(){return cs})),r.d(e,"getFilterQuery",(function(){return ls})),r.d(e,"getSummaryNumbers",(function(){return ps})),r.d(e,"getReportTableData",(function(){return hs})),r.d(e,"getReportTableQuery",(function(){return As})),r.d(e,"getReportChartData",(function(){return Os})),r.d(e,"getTooltipValueFormat",(function(){return Is})),r.d(e,"MAX_PER_PAGE",(function(){return nt})),r.d(e,"QUERY_DEFAULTS",(function(){return dt})),r.d(e,"NAMESPACE",(function(){return tt})),r.d(e,"WC_ADMIN_NAMESPACE",(function(){return et})),r.d(e,"WCS_NAMESPACE",(function(){return rt})),r.d(e,"SECOND",(function(){return ot})),r.d(e,"MINUTE",(function(){return st})),r.d(e,"HOUR",(function(){return it})),r.d(e,"DAY",(function(){return at})),r.d(e,"WEEK",(function(){return ct})),r.d(e,"MONTH",(function(){return ut})),r.d(e,"EXPORT_STORE_NAME",(function(){return Fs})),r.d(e,"IMPORT_STORE_NAME",(function(){return ei})),r.d(e,"getFreeExtensions",(function(){return je})),r.d(e,"getProfileItems",(function(){return Fe})),r.d(e,"getTasksStatus",(function(){return Le})),r.d(e,"getTaskLists",(function(){return Qe})),r.d(e,"getPaymentGatewaySuggestions",(function(){return xe})),r.d(e,"getOnboardingError",(function(){return Ke})),r.d(e,"isOnboardingRequesting",(function(){return We})),r.d(e,"getEmailPrefill",(function(){return Ve})),r.d(e,"getProductTypes",(function(){return He}));var n={};r.r(n),r.d(n,"getSettingsGroupNames",(function(){return x})),r.d(n,"getSettings",(function(){return K})),r.d(n,"getDirtyKeys",(function(){return W})),r.d(n,"getIsDirty",(function(){return V})),r.d(n,"getSettingsForGroup",(function(){return H})),r.d(n,"isUpdateSettingsRequesting",(function(){return J})),r.d(n,"getSetting",(function(){return $})),r.d(n,"getLastSettingsErrorForGroup",(function(){return B})),r.d(n,"getSettingsError",(function(){return z}));var o={};r.r(o),r.d(o,"updateSettingsForGroup",(function(){return lt})),r.d(o,"updateErrorForGroup",(function(){return Tt})),r.d(o,"setIsRequesting",(function(){return _t})),r.d(o,"clearIsDirty",(function(){return pt})),r.d(o,"updateAndPersistSettingsForGroup",(function(){return gt})),r.d(o,"persistSettingsForGroup",(function(){return ft})),r.d(o,"clearSettings",(function(){return yt}));var s={};r.r(s),r.d(s,"getSettings",(function(){return mt})),r.d(s,"getSettingsForGroup",(function(){return Ot}));var i={};r.r(i),r.d(i,"getActivePlugins",(function(){return bt})),r.d(i,"getInstalledPlugins",(function(){return Ct})),r.d(i,"isPluginsRequesting",(function(){return Dt})),r.d(i,"getPluginsError",(function(){return Gt})),r.d(i,"isJetpackConnected",(function(){return kt})),r.d(i,"getJetpackConnectUrl",(function(){return Mt})),r.d(i,"getPluginInstallState",(function(){return jt})),r.d(i,"getPaypalOnboardingStatus",(function(){return Ft})),r.d(i,"getRecommendedPlugins",(function(){return Lt}));var a={};r.r(a),r.d(a,"formatErrors",(function(){return xt})),r.d(a,"updateActivePlugins",(function(){return Wt})),r.d(a,"updateInstalledPlugins",(function(){return Vt})),r.d(a,"setIsRequesting",(function(){return Ht})),r.d(a,"setError",(function(){return Jt})),r.d(a,"updateIsJetpackConnected",(function(){return $t})),r.d(a,"updateJetpackConnectUrl",(function(){return Bt})),r.d(a,"installPlugins",(function(){return zt})),r.d(a,"activatePlugins",(function(){return Zt})),r.d(a,"installAndActivatePlugins",(function(){return Xt})),r.d(a,"createErrorNotice",(function(){return te})),r.d(a,"connectToJetpack",(function(){return ee})),r.d(a,"installJetpackAndConnect",(function(){return re})),r.d(a,"connectToJetpackWithFailureRedirect",(function(){return ne})),r.d(a,"setPaypalOnboardingStatus",(function(){return oe})),r.d(a,"setRecommendedPlugins",(function(){return se}));var c={};r.r(c),r.d(c,"getOption",(function(){return ae})),r.d(c,"getOptionsRequestingError",(function(){return ce})),r.d(c,"isOptionsUpdating",(function(){return ue})),r.d(c,"getOptionsUpdatingError",(function(){return de}));var u={};r.r(u),r.d(u,"receiveOptions",(function(){return Se})),r.d(u,"setRequestingError",(function(){return le})),r.d(u,"setUpdatingError",(function(){return Te})),r.d(u,"setIsUpdating",(function(){return _e})),r.d(u,"updateOptions",(function(){return pe}));var d={};r.r(d),r.d(d,"getOption",(function(){return Oe}));var E={};r.r(E),r.d(E,"getActivePlugins",(function(){return Pe})),r.d(E,"getInstalledPlugins",(function(){return ve})),r.d(E,"isJetpackConnected",(function(){return Ue})),r.d(E,"getJetpackConnectUrl",(function(){return we})),r.d(E,"getPaypalOnboardingStatus",(function(){return be})),r.d(E,"getRecommendedPlugins",(function(){return De}));var S={};r.r(S),r.d(S,"getFreeExtensions",(function(){return je})),r.d(S,"getProfileItems",(function(){return Fe})),r.d(S,"getTasksStatus",(function(){return Le})),r.d(S,"getTaskLists",(function(){return Qe})),r.d(S,"getPaymentGatewaySuggestions",(function(){return xe})),r.d(S,"getOnboardingError",(function(){return Ke})),r.d(S,"isOnboardingRequesting",(function(){return We})),r.d(S,"getEmailPrefill",(function(){return Ve})),r.d(S,"getProductTypes",(function(){return He}));var l={};r.r(l),r.d(l,"getFreeExtensionsError",(function(){return $e})),r.d(l,"getFreeExtensionsSuccess",(function(){return Be})),r.d(l,"setError",(function(){return ze})),r.d(l,"setIsRequesting",(function(){return Ze})),r.d(l,"setProfileItems",(function(){return Xe})),r.d(l,"getTaskListsError",(function(){return tr})),r.d(l,"getTaskListsSuccess",(function(){return er})),r.d(l,"snoozeTaskError",(function(){return rr})),r.d(l,"snoozeTaskRequest",(function(){return nr})),r.d(l,"snoozeTaskSuccess",(function(){return or})),r.d(l,"undoSnoozeTaskError",(function(){return sr})),r.d(l,"undoSnoozeTaskRequest",(function(){return ir})),r.d(l,"undoSnoozeTaskSuccess",(function(){return ar})),r.d(l,"dismissTaskError",(function(){return cr})),r.d(l,"dismissTaskRequest",(function(){return ur})),r.d(l,"dismissTaskSuccess",(function(){return dr})),r.d(l,"undoDismissTaskError",(function(){return Er})),r.d(l,"undoDismissTaskRequest",(function(){return Sr})),r.d(l,"undoDismissTaskSuccess",(function(){return lr})),r.d(l,"hideTaskListError",(function(){return Tr})),r.d(l,"hideTaskListRequest",(function(){return _r})),r.d(l,"hideTaskListSuccess",(function(){return pr})),r.d(l,"setTasksStatus",(function(){return gr})),r.d(l,"setPaymentMethods",(function(){return fr})),r.d(l,"setEmailPrefill",(function(){return yr})),r.d(l,"getProductTypesSuccess",(function(){return Rr})),r.d(l,"getProductTypesError",(function(){return mr})),r.d(l,"updateProfileItems",(function(){return Or})),r.d(l,"snoozeTask",(function(){return Ir})),r.d(l,"undoSnoozeTask",(function(){return Ar})),r.d(l,"dismissTask",(function(){return hr})),r.d(l,"undoDismissTask",(function(){return Pr})),r.d(l,"hideTaskList",(function(){return vr}));var T={};r.r(T),r.d(T,"getProfileItems",(function(){return Ur})),r.d(T,"getEmailPrefill",(function(){return wr})),r.d(T,"getTasksStatus",(function(){return Nr})),r.d(T,"getTaskLists",(function(){return br})),r.d(T,"getPaymentGatewaySuggestions",(function(){return Cr})),r.d(T,"getFreeExtensions",(function(){return Dr})),r.d(T,"getProductTypes",(function(){return Gr}));var _={};r.r(_),r.d(_,"getReviews",(function(){return Hr})),r.d(_,"getReviewsTotalCount",(function(){return Jr})),r.d(_,"getReviewsError",(function(){return $r}));var p={};r.r(p),r.d(p,"updateReviews",(function(){return zr})),r.d(p,"updateReview",(function(){return Zr})),r.d(p,"deleteReview",(function(){return Xr})),r.d(p,"setReviewIsUpdating",(function(){return tn})),r.d(p,"setReview",(function(){return en})),r.d(p,"setError",(function(){return rn}));var g={};r.r(g),r.d(g,"getReviews",(function(){return sn})),r.d(g,"getReviewsTotalCount",(function(){return an}));var f={};r.r(f),r.d(f,"getNotes",(function(){return pn})),r.d(f,"getNotesError",(function(){return gn})),r.d(f,"isNotesRequesting",(function(){return fn}));var y={};r.r(y),r.d(y,"triggerNoteAction",(function(){return Rn})),r.d(y,"removeNote",(function(){return mn})),r.d(y,"removeAllNotes",(function(){return On})),r.d(y,"batchUpdateNotes",(function(){return In})),r.d(y,"updateNote",(function(){return An})),r.d(y,"setNote",(function(){return hn})),r.d(y,"setNoteIsUpdating",(function(){return Pn})),r.d(y,"setNotes",(function(){return vn})),r.d(y,"setNotesQuery",(function(){return Un})),r.d(y,"setError",(function(){return wn})),r.d(y,"setIsRequesting",(function(){return Nn}));var R={};r.r(R),r.d(R,"getNotes",(function(){return bn}));var m={};r.r(m),r.d(m,"getReportItemsError",(function(){return kn})),r.d(m,"getReportItems",(function(){return Mn})),r.d(m,"getReportStats",(function(){return jn})),r.d(m,"getReportStatsError",(function(){return Fn}));var O={};r.r(O),r.d(O,"setReportItemsError",(function(){return qn})),r.d(O,"setReportItems",(function(){return Yn})),r.d(O,"setReportStats",(function(){return Qn})),r.d(O,"setReportStatsError",(function(){return xn}));var I={};r.r(I),r.d(I,"getReportItems",(function(){return Kn})),r.d(I,"getReportStats",(function(){return Wn}));var A={};r.r(A),r.d(A,"getItems",(function(){return Zn})),r.d(A,"getItemsTotalCount",(function(){return Xn})),r.d(A,"getItemsError",(function(){return to}));var h={};r.r(h),r.d(h,"setItem",(function(){return ro})),r.d(h,"setItems",(function(){return no})),r.d(h,"setItemsTotalCount",(function(){return oo})),r.d(h,"setError",(function(){return so})),r.d(h,"updateProductStock",(function(){return io})),r.d(h,"createProductFromTemplate",(function(){return ao}));var P={};r.r(P),r.d(P,"getItems",(function(){return uo})),r.d(P,"getReviewsTotalCount",(function(){return Eo})),r.d(P,"getItemsTotalCount",(function(){return So}));var v={};r.r(v),r.d(v,"getMenuItems",(function(){return po})),r.d(v,"getFavorites",(function(){return go})),r.d(v,"isNavigationRequesting",(function(){return fo})),r.d(v,"getPersistedQuery",(function(){return yo}));var U={};r.r(U),r.d(U,"setMenuItems",(function(){return Oo})),r.d(U,"addMenuItems",(function(){return Io})),r.d(U,"getFavoritesFailure",(function(){return Ao})),r.d(U,"getFavoritesRequest",(function(){return ho})),r.d(U,"getFavoritesSuccess",(function(){return Po})),r.d(U,"addFavoriteRequest",(function(){return vo})),r.d(U,"addFavoriteFailure",(function(){return Uo})),r.d(U,"addFavoriteSuccess",(function(){return wo})),r.d(U,"removeFavoriteRequest",(function(){return No})),r.d(U,"removeFavoriteFailure",(function(){return bo})),r.d(U,"removeFavoriteSuccess",(function(){return Co})),r.d(U,"onLoad",(function(){return Do})),r.d(U,"onHistoryChange",(function(){return Go})),r.d(U,"addFavorite",(function(){return ko})),r.d(U,"removeFavorite",(function(){return Mo}));var w={};r.r(w),r.d(w,"getFavorites",(function(){return Fo}));var N={};r.r(N),r.d(N,"getPaymentGatewaysRequest",(function(){return xo})),r.d(N,"getPaymentGatewaysSuccess",(function(){return Ko})),r.d(N,"getPaymentGatewaysError",(function(){return Wo})),r.d(N,"getPaymentGatewayRequest",(function(){return Vo})),r.d(N,"getPaymentGatewayError",(function(){return Ho})),r.d(N,"getPaymentGatewaySuccess",(function(){return Jo})),r.d(N,"updatePaymentGatewaySuccess",(function(){return $o})),r.d(N,"updatePaymentGatewayRequest",(function(){return Bo})),r.d(N,"updatePaymentGatewayError",(function(){return zo})),r.d(N,"updatePaymentGateway",(function(){return Zo}));var b={};r.r(b),r.d(b,"getPaymentGateways",(function(){return ts})),r.d(b,"getPaymentGateway",(function(){return es}));var C={};r.r(C),r.d(C,"getPaymentGateway",(function(){return rs})),r.d(C,"getPaymentGateways",(function(){return ns})),r.d(C,"getPaymentGatewayError",(function(){return os})),r.d(C,"isPaymentGatewayUpdating",(function(){return ss}));var D={};r.r(D),r.d(D,"isExportRequesting",(function(){return ws})),r.d(D,"getExportId",(function(){return Ns})),r.d(D,"getError",(function(){return bs}));var G={};r.r(G),r.d(G,"setExportId",(function(){return Ds})),r.d(G,"setIsRequesting",(function(){return Gs})),r.d(G,"setError",(function(){return ks})),r.d(G,"startExport",(function(){return Ms}));var k={};r.r(k),r.d(k,"getImportStarted",(function(){return Ls})),r.d(k,"getFormSettings",(function(){return qs})),r.d(k,"getImportStatus",(function(){return Ys})),r.d(k,"getImportTotals",(function(){return Qs})),r.d(k,"getImportError",(function(){return xs}));var M={};r.r(M),r.d(M,"setImportStarted",(function(){return Ws})),r.d(M,"setImportPeriod",(function(){return Vs})),r.d(M,"setSkipPrevious",(function(){return Hs})),r.d(M,"setImportStatus",(function(){return Js})),r.d(M,"setImportTotals",(function(){return $s})),r.d(M,"setImportError",(function(){return Bs})),r.d(M,"updateImportation",(function(){return zs}));var j={};r.r(j),r.d(j,"getImportStatus",(function(){return Zs})),r.d(j,"getImportTotals",(function(){return Xs}));r(447);var F=r(7),L=r(10);const q="wc/admin/settings";function Y(t,e){return`${t}:${JSON.stringify(e,Object.keys(e).sort())}`}function Q(t){const e=t.indexOf(":");return e<0?t:t.substring(0,e)}const x=t=>[...new Set(Object.keys(t).map(t=>Q(t)))],K=(t,e)=>{const r={},n=t[e]&&t[e].data||[];return 0===n.length||n.forEach(n=>{r[n]=t[Y(e,n)].data}),r},W=(t,e)=>t[e].dirty||[],V=(t,e,r=[])=>{const n=W(t,e);return 0!==n.length&&r.some(t=>n.includes(t))},H=(t,e,r)=>{const n=K(t,e);return r.reduce((t,e)=>(t[e]=n[e]||{},t),{})},J=(t,e)=>t[e]&&Boolean(t[e].isRequesting);function $(t,e,r,n=!1,o=(t=>t)){const s=Y(e,r);return o(t[s]&&t[s].data||n,n)}const B=(t,e)=>{const r=t[e].data;return 0===r.length?t[e].error:[...r].pop().error},z=(t,e,r)=>r?t[Y(e,r)].error||!1:t[e]&&t[e].error||!1;var Z=r(2),X=r(4);const tt="/wc-analytics",et="/wc-admin",rt="/wc/v1",nt=100,ot=1e3,st=60*ot,it=60*st,at=24*it,ct=7*at,ut=365*at/12,dt={pageSize:25,period:"month",compare:"previous_year",noteTypes:["info","marketing","survey","warning"]};var Et={UPDATE_SETTINGS_FOR_GROUP:"UPDATE_SETTINGS_FOR_GROUP",UPDATE_ERROR_FOR_GROUP:"UPDATE_ERROR_FOR_GROUP",CLEAR_SETTINGS:"CLEAR_SETTINGS",SET_IS_REQUESTING:"SET_IS_REQUESTING",CLEAR_IS_DIRTY:"CLEAR_IS_DIRTY"};const St=F.controls&&F.controls.resolveSelect?F.controls.resolveSelect:L.select;function lt(t,e,r=new Date){return{type:Et.UPDATE_SETTINGS_FOR_GROUP,group:t,data:e,time:r}}function Tt(t,e,r,n=new Date){return{type:Et.UPDATE_ERROR_FOR_GROUP,group:t,data:e,error:r,time:n}}function _t(t,e){return{type:Et.SET_IS_REQUESTING,group:t,isRequesting:e}}function pt(t){return{type:Et.CLEAR_IS_DIRTY,group:t}}function*gt(t,e){yield lt(t,e),yield*ft(t)}function*ft(t){yield _t(t,!0);const e=yield St(q,"getDirtyKeys",t);if(0===e.length)return void(yield _t(t,!1));const r=yield St(q,"getSettingsForGroup",t,e),n=`${tt}/settings/${t}/batch`,o=e.reduce((t,e)=>{const n=Object.keys(r[e]).map(t=>({id:t,value:r[e][t]}));return Object(X.concat)(t,n)},[]);try{const e=yield Object(L.apiFetch)({path:n,method:"POST",data:{update:o}});if(yield _t(t,!1),!e)throw new Error(Object(Z.__)("There was a problem updating your settings.",'woocommerce'));yield pt(t)}catch(e){throw yield Tt(t,null,e),yield _t(t,!1),e}}function yt(){return{type:Et.CLEAR_SETTINGS}}const Rt=F.controls&&F.controls.dispatch?F.controls.dispatch:L.dispatch;function*mt(t){yield Rt(q,"setIsRequesting",t,!0);try{const e=tt+"/settings/"+t,r=yield Object(L.apiFetch)({path:e,method:"GET"});return lt(t,{[t]:r.reduce((t,e)=>(t[e.id]=e.value,t),{})})}catch(e){return Tt(t,null,e.message)}}function*Ot(t){return mt(t)}const It=(t,{group:e,groupIds:r,data:n,time:o,error:s})=>(r.forEach(r=>{t[Y(e,r)]={data:n[r],lastReceived:o,error:s}}),t);var At=(t={},{type:e,group:r,data:n,error:o,time:s,isRequesting:i})=>{const a={};switch(e){case Et.SET_IS_REQUESTING:t={...t,[r]:{...t[r],isRequesting:i}};break;case Et.CLEAR_IS_DIRTY:t={...t,[r]:{...t[r],dirty:[]}};break;case Et.UPDATE_SETTINGS_FOR_GROUP:case Et.UPDATE_ERROR_FOR_GROUP:const e=n?Object.keys(n):[];t=null===n?{...t,[r]:{data:t[r]?t[r].data:[],error:o,lastReceived:s}}:{...t,[r]:{data:t[r]&&t[r].data?[...t[r].data,...e]:e,error:o,lastReceived:s,isRequesting:!1,dirty:t[r]&&t[r].dirty?Object(X.union)(t[r].dirty,e):e},...It(a,{group:r,groupIds:e,data:n,time:s,error:o})};break;case Et.CLEAR_SETTINGS:t={}}return t};Object(F.registerStore)(q,{reducer:At,actions:o,controls:L.controls,selectors:n,resolvers:s});const ht=q;var Pt=r(14),vt=r(0);const Ut=(t,e)=>Object(Pt.createHigherOrderComponent)(r=>n=>{const o=Object(vt.useRef)(e);return Object(F.useSelect)((e,r)=>{if(!o.current)return;const{isResolving:n,hasFinishedResolution:s}=e(q),{startResolution:i,finishResolution:a,updateSettingsForGroup:c,clearIsDirty:u}=r.dispatch(q);n("getSettings",[t])||s("getSettings",[t])||(i("getSettings",[t]),c(t,o.current),u(t),a("getSettings",[t]))},[]),Object(vt.createElement)(r,Object.assign({},n))},"withSettingsHydration"),wt=(t,e=[])=>{const{requestedSettings:r,settingsError:n,isRequesting:o,isDirty:s}=Object(F.useSelect)(r=>{const{getLastSettingsErrorForGroup:n,getSettingsForGroup:o,getIsDirty:s,isUpdateSettingsRequesting:i}=r(q);return{requestedSettings:o(t,e),settingsError:Boolean(n(t)),isRequesting:i(t),isDirty:s(t,e)}},[t,...e.sort()]),{persistSettingsForGroup:i,updateAndPersistSettingsForGroup:a,updateSettingsForGroup:c}=Object(F.useDispatch)(q),u=Object(vt.useCallback)((e,r)=>{c(t,{[e]:r})},[t]);return{settingsError:n,isRequesting:o,isDirty:s,...r,persistSettings:Object(vt.useCallback)(()=>{i(t)},[t]),updateAndPersistSettings:Object(vt.useCallback)((e,r)=>{a(t,{[e]:r})},[t]),updateSettings:u}},Nt={"facebook-for-woocommerce":Object(Z.__)("Facebook for WooCommerce",'woocommerce'),jetpack:Object(Z.__)("Jetpack",'woocommerce'),"klarna-checkout-for-woocommerce":Object(Z.__)("Klarna Checkout for WooCommerce",'woocommerce'),"klarna-payments-for-woocommerce":Object(Z.__)("Klarna Payments for WooCommerce",'woocommerce'),"mailchimp-for-woocommerce":Object(Z.__)("Mailchimp for WooCommerce",'woocommerce'),"creative-mail-by-constant-contact":Object(Z.__)("Creative Mail for WooCommerce",'woocommerce'),"woocommerce-gateway-paypal-express-checkout":Object(Z.__)("WooCommerce PayPal",'woocommerce'),"woocommerce-gateway-stripe":Object(Z.__)("WooCommerce Stripe",'woocommerce'),"woocommerce-payfast-gateway":Object(Z.__)("WooCommerce PayFast",'woocommerce'),"woocommerce-payments":Object(Z.__)("WooCommerce Payments",'woocommerce'),"woocommerce-services":Object(Z.__)("WooCommerce Shipping & Tax",'woocommerce'),"woocommerce-services:shipping":Object(Z.__)("WooCommerce Shipping & Tax",'woocommerce'),"woocommerce-services:tax":Object(Z.__)("WooCommerce Shipping & Tax",'woocommerce'),"woocommerce-shipstation-integration":Object(Z.__)("WooCommerce ShipStation Gateway",'woocommerce'),"woocommerce-mercadopago":Object(Z.__)("Mercado Pago payments for WooCommerce",'woocommerce'),"google-listings-and-ads":Object(Z.__)("Google Listings and Ads",'woocommerce'),"woo-razorpay":Object(Z.__)("Razorpay",'woocommerce'),mailpoet:Object(Z.__)("MailPoet",'woocommerce')},bt=t=>t.active||[],Ct=t=>t.installed||[],Dt=(t,e)=>t.requesting[e]||!1,Gt=(t,e)=>t.errors[e]||!1,kt=t=>t.jetpackConnection,Mt=(t,e)=>t.jetpackConnectUrls[e.redirect_url],jt=(t,e)=>t.active.includes(e)?"activated":t.installed.includes(e)?"installed":"unavailable",Ft=t=>t.paypalOnboardingStatus,Lt=(t,e)=>t.recommended[e];var qt;!function(t){t.UPDATE_ACTIVE_PLUGINS="UPDATE_ACTIVE_PLUGINS",t.UPDATE_INSTALLED_PLUGINS="UPDATE_INSTALLED_PLUGINS",t.SET_IS_REQUESTING="SET_IS_REQUESTING",t.SET_ERROR="SET_ERROR",t.UPDATE_JETPACK_CONNECTION="UPDATE_JETPACK_CONNECTION",t.UPDATE_JETPACK_CONNECT_URL="UPDATE_JETPACK_CONNECT_URL",t.SET_PAYPAL_ONBOARDING_STATUS="SET_PAYPAL_ONBOARDING_STATUS",t.SET_RECOMMENDED_PLUGINS="SET_RECOMMENDED_PLUGINS"}(qt||(qt={}));const Yt=F.controls&&F.controls.dispatch?F.controls.dispatch:L.dispatch,Qt=F.controls&&F.controls.resolveSelect?F.controls.resolveSelect:L.select;function xt(t){return void 0===t.errors?"string"==typeof t?t:t.message:(Object.keys(t.errors).forEach(e=>{t.errors[e]=t.errors[e].map(t=>Nt[e]?t.replace(`\`${e}\``,Nt[e]):t)}),"")}const Kt=(t,e="install")=>Object(Z.sprintf)(Object(Z._n)("Could not %(actionType)s %(pluginName)s plugin, %(error)s","Could not %(actionType)s the following plugins: %(pluginName)s with these Errors: %(error)s",Object.keys(t).length||1,'woocommerce'),{actionType:e,pluginName:Object.keys(t).join(", "),error:Object.values(t).join(", \n")});function Wt(t,e=!1){return{type:qt.UPDATE_ACTIVE_PLUGINS,active:t,replace:e}}function Vt(t,e=!1){return{type:qt.UPDATE_INSTALLED_PLUGINS,installed:t,replace:e}}function Ht(t,e){return{type:qt.SET_IS_REQUESTING,selector:t,isRequesting:e}}function Jt(t,e){return{type:qt.SET_ERROR,selector:t,error:e}}function $t(t){return{type:qt.UPDATE_JETPACK_CONNECTION,jetpackConnection:t}}function Bt(t,e){return{type:qt.UPDATE_JETPACK_CONNECT_URL,jetpackConnectUrl:e,redirectUrl:t}}function*zt(t){yield Ht("installPlugins",!0);try{const e=yield Object(L.apiFetch)({path:et+"/plugins/install",method:"POST",data:{plugins:t.join(",")}});if(e.data.installed.length&&(yield Vt(e.data.installed)),Object.keys(e.errors.errors).length)throw e.errors.errors;return yield Ht("installPlugins",!1),e}catch(e){throw 1!==t.length||e[t[0]]||(e={[t[0]]:e.message}),yield Jt("installPlugins",e),new Error(Kt(e))}}function*Zt(t){yield Ht("activatePlugins",!0);try{const e=yield Object(L.apiFetch)({path:et+"/plugins/activate",method:"POST",data:{plugins:t.join(",")}});if(e.data.activated.length&&(yield Wt(e.data.activated)),Object.keys(e.errors.errors).length)throw e.errors.errors;return yield Ht("activatePlugins",!1),e}catch(e){throw 1!==t.length||e[t[0]]||(e={[t[0]]:e.message}),yield Jt("activatePlugins",e),new Error(Kt(e,"activate"))}}function*Xt(t){try{yield Yt("wc/admin/plugins","installPlugins",t);return yield Yt("wc/admin/plugins","activatePlugins",t)}catch(t){throw t}}const te=t=>Yt("core/notices","createNotice","error",t);function*ee(t){const e=yield Qt("wc/admin/plugins","getJetpackConnectUrl",{redirect_url:t("admin.php?page=wc-admin")}),r=yield Qt("wc/admin/plugins","getPluginsError","getJetpackConnectUrl");if(r)throw new Error(r);return e}function*re(t,e){try{yield Yt("wc/admin/plugins","installPlugins",["jetpack"]),yield Yt("wc/admin/plugins","activatePlugins",["jetpack"]);const t=yield Yt("wc/admin/plugins","connectToJetpack",e);window.location.href=t}catch(e){yield t(e.message)}}function*ne(t,e,r){try{const t=yield Yt("wc/admin/plugins","connectToJetpack",r);window.location.href=t}catch(r){yield e(r.message),window.location.href=t}}function oe(t){return{type:qt.SET_PAYPAL_ONBOARDING_STATUS,paypalOnboardingStatus:t}}function se(t,e){return{type:qt.SET_RECOMMENDED_PLUGINS,recommendedType:t,plugins:e}}var ie=r(15);const ae=(t,e)=>t[e],ce=(t,e)=>t.requestingErrors[e]||!1,ue=t=>t.isUpdating||!1,de=t=>t.updatingError||!1;var Ee={RECEIVE_OPTIONS:"RECEIVE_OPTIONS",SET_IS_REQUESTING:"SET_IS_REQUESTING",SET_IS_UPDATING:"SET_IS_UPDATING",SET_REQUESTING_ERROR:"SET_REQUESTING_ERROR",SET_UPDATING_ERROR:"SET_UPDATING_ERROR"};function Se(t){return{type:Ee.RECEIVE_OPTIONS,options:t}}function le(t,e){return{type:Ee.SET_REQUESTING_ERROR,error:t,name:e}}function Te(t){return{type:Ee.SET_UPDATING_ERROR,error:t}}function _e(t){return{type:Ee.SET_IS_UPDATING,isUpdating:t}}function*pe(t){yield _e(!0),yield Se(t);try{const e=yield Object(L.apiFetch)({path:et+"/options",method:"POST",data:t});return yield _e(!1),{success:!0,...e}}catch(t){return yield Te(t),{success:!1,...t}}}var ge=r(17),fe=r.n(ge);let ye=[];const Re={},me={...L.controls,BATCH_FETCH:({optionName:t})=>(ye.push(t),new Promise(t=>{setTimeout((function(){const e=ye.join(",");if(Re[e])return Re[e].then(e=>{t(e)});const r=et+"/options?options="+e;Re[e]=fe()({path:r}),Re[e].then(e=>t(e)),setTimeout(()=>{ye=[],delete Re[e]},1)}),1)}))};function*Oe(t){try{const r=yield(e=t,{type:"BATCH_FETCH",optionName:e});yield Se(r)}catch(e){yield le(e,t)}var e}var Ie=(t={isUpdating:!1,requestingErrors:{}},{type:e,options:r,error:n,isUpdating:o,name:s})=>{switch(e){case Ee.RECEIVE_OPTIONS:t={...t,...r};break;case Ee.SET_IS_UPDATING:t={...t,isUpdating:o};break;case Ee.SET_REQUESTING_ERROR:t={...t,requestingErrors:{[s]:n}};break;case Ee.SET_UPDATING_ERROR:t={...t,error:n,updatingError:n,isUpdating:!1}}return t};Object(F.registerStore)("wc/admin/options",{reducer:Ie,actions:u,controls:me,selectors:c,resolvers:d});const Ae="wc/admin/options",he=F.controls&&F.controls.resolveSelect?F.controls.resolveSelect:L.select;function*Pe(){yield Ht("getActivePlugins",!0);try{const t=et+"/plugins/active",e=yield Object(L.apiFetch)({path:t,method:"GET"});yield Wt(e.plugins,!0)}catch(t){yield Jt("getActivePlugins",t)}}function*ve(){yield Ht("getInstalledPlugins",!0);try{const t=et+"/plugins/installed",e=yield Object(L.apiFetch)({path:t,method:"GET"});yield Vt(e.plugins,!0)}catch(t){yield Jt("getInstalledPlugins",t)}}function*Ue(){yield Ht("isJetpackConnected",!0);try{const t="/jetpack/v4/connection",e=yield Object(L.apiFetch)({path:t,method:"GET"});yield $t(e.isActive)}catch(t){yield Jt("isJetpackConnected",t)}yield Ht("isJetpackConnected",!1)}function*we(t){yield Ht("getJetpackConnectUrl",!0);try{const e=Object(ie.addQueryArgs)(et+"/plugins/connect-jetpack",t),r=yield Object(L.apiFetch)({path:e,method:"GET"});yield Bt(t.redirect_url,r.connectAction)}catch(t){yield Jt("getJetpackConnectUrl",t)}yield Ht("getJetpackConnectUrl",!1)}function*Ne(){const t=yield he(Ae,"getOption","woocommerce-ppcp-settings"),e=t.merchant_email_production&&t.merchant_id_production&&t.client_id_production&&t.client_secret_production;yield oe({production:{state:e?"onboarded":"unknown",onboarded:!!e}})}function*be(){yield Ht("getPaypalOnboardingStatus",!0);const t=yield he("wc/admin/plugins","getPluginsError","getPaypalOnboardingStatus");if(t&&t.data&&404===t.data.status)yield Ne();else try{const t="/wc-paypal/v1/onboarding/get-status",e=yield Object(L.apiFetch)({path:t,method:"GET"});yield oe(e)}catch(t){yield Ne(),yield Jt("getPaypalOnboardingStatus",t)}yield Ht("getPaypalOnboardingStatus",!1)}const Ce=["payments"];function*De(t){if(!Ce.includes(t))return[];yield Ht("getRecommendedPlugins",!0);try{const e=et+"/plugins/recommended-payment-plugins",r=yield Object(L.apiFetch)({path:e,method:"GET"});yield se(t,r)}catch(t){yield Jt("getRecommendedPlugins",t)}yield Ht("getRecommendedPlugins",!1)}var Ge=(t={active:[],installed:[],requesting:{},errors:{},jetpackConnectUrls:{},recommended:{}},e)=>{if(e&&"type"in e)switch(e.type){case qt.UPDATE_ACTIVE_PLUGINS:t={...t,active:e.replace?e.active:Object(X.concat)(t.active,e.active),requesting:{...t.requesting,getActivePlugins:!1,activatePlugins:!1},errors:{...t.errors,getActivePlugins:!1,activatePlugins:!1}};break;case qt.UPDATE_INSTALLED_PLUGINS:t={...t,installed:e.replace?e.installed:Object(X.concat)(t.installed,e.installed),requesting:{...t.requesting,getInstalledPlugins:!1,installPlugins:!1},errors:{...t.errors,getInstalledPlugins:!1,installPlugin:!1}};break;case qt.SET_IS_REQUESTING:t={...t,requesting:{...t.requesting,[e.selector]:e.isRequesting}};break;case qt.SET_ERROR:t={...t,requesting:{...t.requesting,[e.selector]:!1},errors:{...t.errors,[e.selector]:e.error}};break;case qt.UPDATE_JETPACK_CONNECTION:t={...t,jetpackConnection:e.jetpackConnection};break;case qt.UPDATE_JETPACK_CONNECT_URL:t={...t,jetpackConnectUrls:{...t.jetpackConnectUrls,[e.redirectUrl]:e.jetpackConnectUrl}};break;case qt.SET_PAYPAL_ONBOARDING_STATUS:t={...t,paypalOnboardingStatus:e.paypalOnboardingStatus};break;case qt.SET_RECOMMENDED_PLUGINS:t={...t,recommended:{...t.recommended,[e.recommendedType]:e.plugins}}}return t};Object(F.registerStore)("wc/admin/plugins",{reducer:Ge,actions:a,controls:L.controls,selectors:i,resolvers:E});const ke="wc/admin/plugins",Me=t=>Object(Pt.createHigherOrderComponent)(e=>r=>{const n=Object(vt.useRef)(t);return Object(F.useSelect)((t,e)=>{if(!n.current)return;const{isResolving:r,hasFinishedResolution:o}=t("wc/admin/plugins"),{startResolution:s,finishResolution:i,updateActivePlugins:a,updateInstalledPlugins:c,updateIsJetpackConnected:u}=e.dispatch("wc/admin/plugins");r("getActivePlugins",[])||o("getActivePlugins",[])||(s("getActivePlugins",[]),s("getInstalledPlugins",[]),s("isJetpackConnected",[]),a(n.current.activePlugins,!0),c(n.current.installedPlugins,!0),u(!(!n.current.jetpackStatus||!n.current.jetpackStatus.isActive)),i("getActivePlugins",[]),i("getInstalledPlugins",[]),i("isJetpackConnected",[]))},[]),Object(vt.createElement)(e,Object.assign({},r))},"withPluginsHydration"),je=t=>t.freeExtensions||[],Fe=t=>t.profileItems||{},Le=t=>t.tasksStatus||{},qe=[],Ye=[],Qe=t=>t.taskLists||qe,xe=t=>t.paymentMethods||[],Ke=(t,e)=>t.errors[e]||!1,We=(t,e)=>t.requesting[e]||!1,Ve=t=>t.emailPrefill||"",He=t=>t.productTypes||Ye;var Je={SET_ERROR:"SET_ERROR",SET_IS_REQUESTING:"SET_IS_REQUESTING",SET_PROFILE_ITEMS:"SET_PROFILE_ITEMS",SET_EMAIL_PREFILL:"SET_EMAIL_PREFILL",SET_TASKS_STATUS:"SET_TASKS_STATUS",GET_PAYMENT_METHODS_SUCCESS:"GET_PAYMENT_METHODS_SUCCESS",GET_PRODUCT_TYPES_SUCCESS:"GET_PRODUCT_TYPES_SUCCESS",GET_PRODUCT_TYPES_ERROR:"GET_PRODUCT_TYPES_ERROR",GET_FREE_EXTENSIONS_ERROR:"GET_FREE_EXTENSIONS_ERROR",GET_FREE_EXTENSIONS_SUCCESS:"GET_FREE_EXTENSIONS_SUCCESS",GET_TASK_LISTS_ERROR:"GET_TASK_LISTS_ERROR",GET_TASK_LISTS_SUCCESS:"GET_TASK_LISTS_SUCCESS",DISMISS_TASK_ERROR:"DISMISS_TASK_ERROR",DISMISS_TASK_REQUEST:"DISMISS_TASK_REQUEST",DISMISS_TASK_SUCCESS:"DISMISS_TASK_SUCCESS",UNDO_DISMISS_TASK_ERROR:"UNDO_DISMISS_TASK_ERROR",UNDO_DISMISS_TASK_REQUEST:"UNDO_DISMISS_TASK_REQUEST",UNDO_DISMISS_TASK_SUCCESS:"UNDO_DISMISS_TASK_SUCCESS",SNOOZE_TASK_ERROR:"SNOOZE_TASK_ERROR",SNOOZE_TASK_REQUEST:"SNOOZE_TASK_REQUEST",SNOOZE_TASK_SUCCESS:"SNOOZE_TASK_SUCCESS",UNDO_SNOOZE_TASK_ERROR:"UNDO_SNOOZE_TASK_ERROR",UNDO_SNOOZE_TASK_REQUEST:"UNDO_SNOOZE_TASK_REQUEST",UNDO_SNOOZE_TASK_SUCCESS:"UNDO_SNOOZE_TASK_SUCCESS",HIDE_TASK_LIST_ERROR:"HIDE_TASK_LIST_ERROR",HIDE_TASK_LIST_REQUEST:"HIDE_TASK_LIST_REQUEST",HIDE_TASK_LIST_SUCCESS:"HIDE_TASK_LIST_SUCCESS"};function $e(t){return{type:Je.GET_FREE_EXTENSIONS_ERROR,error:t}}function Be(t){return{type:Je.GET_FREE_EXTENSIONS_SUCCESS,freeExtensions:t}}function ze(t,e){return{type:Je.SET_ERROR,selector:t,error:e}}function Ze(t,e){return{type:Je.SET_IS_REQUESTING,selector:t,isRequesting:e}}function Xe(t,e=!1){return{type:Je.SET_PROFILE_ITEMS,profileItems:t,replace:e}}function tr(t){return{type:Je.GET_TASK_LISTS_ERROR,error:t}}function er(t){return{type:Je.GET_TASK_LISTS_SUCCESS,taskLists:t}}function rr(t,e){return{type:Je.SNOOZE_TASK_ERROR,taskId:t,error:e}}function nr(t){return{type:Je.SNOOZE_TASK_REQUEST,taskId:t}}function or(t){return{type:Je.SNOOZE_TASK_SUCCESS,task:t}}function sr(t,e){return{type:Je.UNDO_SNOOZE_TASK_ERROR,taskId:t,error:e}}function ir(t){return{type:Je.UNDO_SNOOZE_TASK_REQUEST,taskId:t}}function ar(t){return{type:Je.UNDO_SNOOZE_TASK_SUCCESS,task:t}}function cr(t,e){return{type:Je.DISMISS_TASK_ERROR,taskId:t,error:e}}function ur(t){return{type:Je.DISMISS_TASK_REQUEST,taskId:t}}function dr(t){return{type:Je.DISMISS_TASK_SUCCESS,task:t}}function Er(t,e){return{type:Je.UNDO_DISMISS_TASK_ERROR,taskId:t,error:e}}function Sr(t){return{type:Je.UNDO_DISMISS_TASK_REQUEST,taskId:t}}function lr(t){return{type:Je.UNDO_DISMISS_TASK_SUCCESS,task:t}}function Tr(t,e){return{type:Je.HIDE_TASK_LIST_ERROR,taskListId:t,error:e}}function _r(t){return{type:Je.HIDE_TASK_LIST_REQUEST,taskListId:t}}function pr(t){return{type:Je.HIDE_TASK_LIST_SUCCESS,taskList:t}}function gr(t){return{type:Je.SET_TASKS_STATUS,tasksStatus:t}}function fr(t){return{type:Je.GET_PAYMENT_METHODS_SUCCESS,paymentMethods:t}}function yr(t){return{type:Je.SET_EMAIL_PREFILL,emailPrefill:t}}function Rr(t){return{type:Je.GET_PRODUCT_TYPES_SUCCESS,productTypes:t}}function mr(t){return{type:Je.GET_PRODUCT_TYPES_ERROR,error:t}}function*Or(t){yield Ze("updateProfileItems",!0),yield ze("updateProfileItems",null);try{const e=yield Object(L.apiFetch)({path:et+"/onboarding/profile",method:"POST",data:t});if(e&&"success"===e.status)return yield Xe(t),yield Ze("updateProfileItems",!1),e;throw new Error}catch(t){throw yield ze("updateProfileItems",t),yield Ze("updateProfileItems",!1),t}}function*Ir(t){yield nr(t);try{const e=yield Object(L.apiFetch)({path:`${et}/onboarding/tasks/${t}/snooze`,method:"POST"});yield or(e)}catch(e){throw yield rr(t,e),new Error}}function*Ar(t){yield ir(t);try{const e=yield Object(L.apiFetch)({path:`${et}/onboarding/tasks/${t}/undo_snooze`,method:"POST"});yield ar(e)}catch(e){throw yield sr(t,e),new Error}}function*hr(t){yield ur(t);try{const e=yield Object(L.apiFetch)({path:`${et}/onboarding/tasks/${t}/dismiss`,method:"POST"});yield dr(e)}catch(e){throw yield cr(t,e),new Error}}function*Pr(t){yield Sr(t);try{const e=yield Object(L.apiFetch)({path:`${et}/onboarding/tasks/${t}/undo_dismiss`,method:"POST"});yield lr(e)}catch(e){throw yield Er(t,e),new Error}}function*vr(t){yield _r(t);try{const e=yield Object(L.apiFetch)({path:`${et}/onboarding/tasks/${t}/hide`,method:"POST"});yield pr(e)}catch(e){throw yield Tr(t,e),new Error}}function*Ur(){try{const t=yield Object(L.apiFetch)({path:et+"/onboarding/profile",method:"GET"});yield Xe(t,!0)}catch(t){yield ze("getProfileItems",t)}}function*wr(){try{const t=yield Object(L.apiFetch)({path:et+"/onboarding/profile/experimental_get_email_prefill",method:"GET"});yield yr(t.email)}catch(t){yield ze("getEmailPrefill",t)}}function*Nr(){try{const t=yield Object(L.apiFetch)({path:et+"/onboarding/tasks/status",method:"GET"});yield gr(t)}catch(t){yield ze("getTasksStatus",t)}}function*br(){try{const t=yield Object(L.apiFetch)({path:et+"/onboarding/tasks",method:"GET"});yield er(t)}catch(t){yield tr(t)}}function*Cr(){try{const t=yield Object(L.apiFetch)({path:et+"/onboarding/payments",method:"GET"});yield fr(t)}catch(t){yield ze("getPaymentGatewaySuggestions",t)}}function*Dr(){try{const t=yield Object(L.apiFetch)({path:et+"/onboarding/free-extensions",method:"GET"});yield Be(t)}catch(t){yield $e(t)}}function*Gr(){try{const t=yield Object(L.apiFetch)({path:et+"/onboarding/product-types",method:"GET"});yield Rr(t)}catch(t){yield mr(t)}}const kr={errors:{},freeExtensions:[],profileItems:{business_extensions:null,completed:null,industry:null,other_platform:null,other_platform_name:null,product_count:null,product_types:null,revenue:null,selling_venues:null,setup_client:null,skipped:null,theme:null,wccom_connected:null,is_agree_marketing:null,store_email:null},emailPrefill:"",paymentMethods:[],productTypes:[],requesting:{},taskLists:[],tasksStatus:{}},Mr=(t,e)=>t.map(t=>({...t,tasks:t.tasks.map(t=>e.id===t.id?{...t,...e}:t)}));var jr=(t=kr,{freeExtensions:e,type:r,profileItems:n,emailPrefill:o,paymentMethods:s,productTypes:i,replace:a,error:c,isRequesting:u,selector:d,task:E,taskId:S,taskListId:l,taskList:T,taskLists:_,tasksStatus:p})=>{switch(r){case Je.SET_PROFILE_ITEMS:return{...t,profileItems:a?n:{...t.profileItems,...n}};case Je.SET_EMAIL_PREFILL:return{...t,emailPrefill:o};case Je.SET_TASKS_STATUS:return{...t,tasksStatus:{...t.tasksStatus,...p}};case Je.SET_ERROR:return{...t,errors:{...t.errors,[d]:c}};case Je.SET_IS_REQUESTING:return{...t,requesting:{...t.requesting,[d]:u}};case Je.GET_PAYMENT_METHODS_SUCCESS:return{...t,paymentMethods:s};case Je.GET_PRODUCT_TYPES_SUCCESS:return{...t,productTypes:i};case Je.GET_PRODUCT_TYPES_ERROR:return{...t,errors:{...t.errors,productTypes:c}};case Je.GET_FREE_EXTENSIONS_ERROR:return{...t,errors:{...t.errors,getFreeExtensions:c}};case Je.GET_FREE_EXTENSIONS_SUCCESS:return{...t,freeExtensions:e};case Je.GET_TASK_LISTS_ERROR:return{...t,errors:{...t.errors,getTaskLists:c}};case Je.GET_TASK_LISTS_SUCCESS:return{...t,taskLists:_};case Je.DISMISS_TASK_ERROR:return{...t,errors:{...t.errors,dismissTask:c},taskLists:Mr(t.taskLists,{id:S,isDismissed:!1})};case Je.DISMISS_TASK_REQUEST:return{...t,requesting:{...t.requesting,dismissTask:!0},taskLists:Mr(t.taskLists,{id:S,isDismissed:!0})};case Je.DISMISS_TASK_SUCCESS:return{...t,requesting:{...t.requesting,dismissTask:!1},taskLists:Mr(t.taskLists,E)};case Je.UNDO_DISMISS_TASK_ERROR:return{...t,errors:{...t.errors,undoDismissTask:c},taskLists:Mr(t.taskLists,{id:S,isDismissed:!0})};case Je.UNDO_DISMISS_TASK_REQUEST:return{...t,requesting:{...t.requesting,undoDismissTask:!0},taskLists:Mr(t.taskLists,{id:S,isDismissed:!1})};case Je.UNDO_DISMISS_TASK_SUCCESS:return{...t,requesting:{...t.requesting,undoDismissTask:!1},taskLists:Mr(t.taskLists,E)};case Je.SNOOZE_TASK_ERROR:return{...t,errors:{...t.errors,snoozeTask:c},taskLists:Mr(t.taskLists,{id:S,isSnoozed:!1})};case Je.SNOOZE_TASK_REQUEST:return{...t,requesting:{...t.requesting,snoozeTask:!0},taskLists:Mr(t.taskLists,{id:S,isSnoozed:!0})};case Je.SNOOZE_TASK_SUCCESS:return{...t,requesting:{...t.requesting,snoozeTask:!1},taskLists:Mr(t.taskLists,E)};case Je.UNDO_SNOOZE_TASK_ERROR:return{...t,errors:{...t.errors,undoSnoozeTask:c},taskLists:Mr(t.taskLists,{id:S,isSnoozed:!0})};case Je.UNDO_SNOOZE_TASK_REQUEST:return{...t,requesting:{...t.requesting,undoSnoozeTask:!0},taskLists:Mr(t.taskLists,{id:S,isSnoozed:!1})};case Je.UNDO_SNOOZE_TASK_SUCCESS:return{...t,requesting:{...t.requesting,undoSnoozeTask:!1},taskLists:Mr(t.taskLists,E)};case Je.HIDE_TASK_LIST_ERROR:return{...t,errors:{...t.errors,hideTaskList:c},taskLists:t.taskLists.map(t=>l===t.id?{...t,isHidden:!1}:t)};case Je.HIDE_TASK_LIST_REQUEST:return{...t,requesting:{...t.requesting,hideTaskList:!0},taskLists:t.taskLists.map(t=>l===t.id?{...t,isHidden:!0}:t)};case Je.HIDE_TASK_LIST_SUCCESS:return{...t,requesting:{...t.requesting,hideTaskList:!1},taskLists:t.taskLists.map(t=>l===t.id?T:t)};default:return t}};Object(F.registerStore)("wc/admin/onboarding",{reducer:jr,actions:l,controls:L.controls,selectors:S,resolvers:T});const Fr="wc/admin/onboarding",Lr=t=>{let e=!1,r=!1;return Object(Pt.createHigherOrderComponent)(n=>o=>{const s=Object(vt.useRef)(t);return Object(F.useSelect)((t,n)=>{if(!s.current)return;const{isResolving:o,hasFinishedResolution:i}=t("wc/admin/onboarding"),{startResolution:a,finishResolution:c,setProfileItems:u,setTasksStatus:d}=n.dispatch("wc/admin/onboarding"),{profileItems:E,tasksStatus:S}=s.current;!E||e||o("getProfileItems",[])||i("getProfileItems",[])||(a("getProfileItems",[]),u(E,!0),c("getProfileItems",[]),e=!0),!S||r||o("getTasksStatus",[])||i("getTasksStatus",[])||(a("getTasksStatus",[]),d(S,!0),c("getTasksStatus",[]),r=!0)},[]),Object(vt.createElement)(n,Object.assign({},o))},"withOnboardingHydration")},qr="core",Yr=t=>Object(Pt.createHigherOrderComponent)(e=>r=>{const n=Object(vt.useRef)(t);return Object(F.useSelect)((t,e)=>{if(!n.current)return;const{isResolving:r,hasFinishedResolution:o}=t("core"),{startResolution:s,finishResolution:i,receiveCurrentUser:a}=e.dispatch("core");r("getCurrentUser")||o("getCurrentUser")||(s("getCurrentUser",[]),a(n.current),i("getCurrentUser",[]))}),Object(vt.createElement)(e,Object.assign({},r))},"withCurrentUserHydration"),Qr=()=>{const t=Object(F.useSelect)(t=>{const{getCurrentUser:e,hasStartedResolution:r,hasFinishedResolution:n}=t("core");return{isRequesting:r("getCurrentUser")&&!n("getCurrentUser"),user:e(),getCurrentUser:e}});return{currentUserCan:e=>!(!t.user||!t.user.is_super_admin)||!(!t.user||!t.user.capabilities[e]),user:t.user,isRequesting:t.isRequesting}},xr=t=>{const e=t.woocommerce_meta||{};return Object(X.mapValues)(e,(t,e)=>{if(!t||0===t.length)return"";try{return JSON.parse(t)}catch(r){return console.error(`Error parsing value '${t}' for ${e}`,r.message),""}})};const Kr=()=>{const t=Object(F.useDispatch)("core"),{addEntities:e,receiveCurrentUser:r,saveEntityRecord:n}=t;let{saveUser:o}=t;const s=Object(F.useSelect)(t=>{const{getCurrentUser:e,getEntity:r,getEntityRecord:n,getLastEntitySaveError:o,hasStartedResolution:s,hasFinishedResolution:i}=t("core");return{isRequesting:s("getCurrentUser")&&!i("getCurrentUser"),user:e(),getCurrentUser:e,getEntity:r,getEntityRecord:n,getLastEntitySaveError:o}}),i=s.user?xr(s.user):{};return{isRequesting:s.isRequesting,...i,updateUserPreferences:t=>{"function"!=typeof o&&(o=async t=>(Boolean(s.getEntity("root","user"))||await e([{name:"user",kind:"root",baseURL:"/wp/v2/users",plural:"users"}]),await n("root","user",t),s.getEntityRecord("root","user",t.id)));const i=s.getCurrentUser();return async function(t,e,r,n,o){const s=Object(X.mapValues)(o,JSON.stringify);if(0===Object.keys(s).length)return{error:new Error("Invalid woocommerce_meta data for update."),updatedUser:void 0};t({...e,woocommerce_meta:{...e.woocommerce_meta,...s}});const i=await r({id:e.id,woocommerce_meta:s});if(void 0===i){return{error:n("root","user",e.id),updatedUser:i}}return{updatedUser:{...i,woocommerce_meta:xr(i)}}}(r,i,o,s.getLastEntitySaveError,t)}}},Wr=t=>{const e=Object(vt.useRef)(t);Object(F.useSelect)((t,r)=>{if(!e.current)return;const{isResolving:n,hasFinishedResolution:o}=t("wc/admin/options"),{startResolution:s,finishResolution:i,receiveOptions:a}=r.dispatch("wc/admin/options");Object.keys(e.current).forEach(t=>{n("getOption",[t])||o("getOption",[t])||(s("getOption",[t]),a({[t]:e.current[t]}),i("getOption",[t]))})},[])},Vr=t=>Object(Pt.createHigherOrderComponent)(e=>r=>(Wr(t),Object(vt.createElement)(e,Object.assign({},r))),"withOptionsHydration"),Hr=(t,e)=>{const r=JSON.stringify(e);return(t.reviews[r]&&t.reviews[r].data||[]).map(e=>t.data[e])},Jr=(t,e)=>{const r=JSON.stringify(e);return t.reviews[r]&&t.reviews[r].totalCount},$r=(t,e)=>{const r=JSON.stringify(e);return t.errors[r]};var Br={UPDATE_REVIEWS:"UPDATE_REVIEWS",SET_REVIEW:"SET_REVIEW",SET_ERROR:"SET_ERROR",SET_REVIEW_IS_UPDATING:"SET_REVIEW_IS_UPDATING"};function zr(t,e,r){return{type:Br.UPDATE_REVIEWS,reviews:e,query:t,totalCount:r}}function*Zr(t,e,r){yield tn(t,!0);try{const n=Object(ie.addQueryArgs)(`${tt}/products/reviews/${t}`,r||{}),o=yield Object(L.apiFetch)({path:n,method:"PUT",data:e});yield en(t,o),yield tn(t,!1)}catch(e){throw yield rn("updateReview",e),yield tn(t,!1),new Error}}function*Xr(t){yield tn(t,!0);try{const e=`${tt}/products/reviews/${t}`,r=yield Object(L.apiFetch)({path:e,method:"DELETE"});return yield en(t,r),yield tn(t,!1),r}catch(e){throw yield rn("deleteReview",e),yield tn(t,!1),new Error}}function tn(t,e){return{type:Br.SET_REVIEW_IS_UPDATING,reviewId:t,isUpdating:e}}function en(t,e){return{type:Br.SET_REVIEW,reviewId:t,reviewData:e}}function rn(t,e){return{type:Br.SET_ERROR,query:t,error:e}}const nn=t=>({type:"FETCH_WITH_HEADERS",options:t});var on={...L.controls,FETCH_WITH_HEADERS:({options:t})=>fe()({...t,parse:!1}).then(t=>Promise.all([t.headers,t.status,t.json()])).then(([t,e,r])=>({headers:t,status:e,data:r}))};function*sn(t){try{const e=Object(ie.addQueryArgs)(tt+"/products/reviews",t),r=yield nn({path:e,method:"GET"}),n=parseInt(r.headers.get("x-wp-total"),10);yield zr(t,r.data,n)}catch(e){yield rn(t,e)}}function*an(t){yield sn(t)}var cn=(t={reviews:{},errors:{},data:{}},{type:e,query:r,reviews:n,reviewId:o,reviewData:s,totalCount:i,error:a,isUpdating:c})=>{switch(e){case Br.UPDATE_REVIEWS:const e=[],u=n.reduce((r,n)=>(e.push(n.id),r[n.id]={...t.data[n.id]||{},...n},r),{});return{...t,reviews:{...t.reviews,[JSON.stringify(r)]:{data:e,totalCount:i}},data:{...t.data,...u}};case Br.SET_REVIEW:return{...t,data:{...t.data,[o]:s}};case Br.SET_ERROR:return{...t,errors:{...t.errors,[JSON.stringify(r)]:a}};case Br.SET_REVIEW_IS_UPDATING:return{...t,data:{...t.data,[o]:{...t.data[o],isUpdating:c}}};default:return t}};Object(F.registerStore)("wc/admin/reviews",{reducer:cn,actions:p,controls:on,selectors:_,resolvers:g});const un="wc/admin/reviews";var dn,En;function Sn(t){return[t]}function ln(){var t={clear:function(){t.head=null}};return t}function Tn(t,e,r){var n;if(t.length!==e.length)return!1;for(n=r;n<t.length;n++)if(t[n]!==e[n])return!1;return!0}dn={},En="undefined"!=typeof WeakMap;var _n=function(t,e){var r,n;function o(){r=En?new WeakMap:ln()}function s(){var r,o,s,i,a,c=arguments.length;for(i=new Array(c),s=0;s<c;s++)i[s]=arguments[s];for(a=e.apply(null,i),(r=n(a)).isUniqueByDependants||(r.lastDependants&&!Tn(a,r.lastDependants,0)&&r.clear(),r.lastDependants=a),o=r.head;o;){if(Tn(o.args,i,1))return o!==r.head&&(o.prev.next=o.next,o.next&&(o.next.prev=o.prev),o.next=r.head,o.prev=null,r.head.prev=o,r.head=o),o.val;o=o.next}return o={val:t.apply(null,i)},i[0]=null,o.args=i,r.head&&(r.head.prev=o,o.next=r.head),r.head=o,o.val}return e||(e=Sn),n=En?function(t){var e,n,o,s,i,a=r,c=!0;for(e=0;e<t.length;e++){if(n=t[e],!(i=n)||"object"!=typeof i){c=!1;break}a.has(n)?a=a.get(n):(o=new WeakMap,a.set(n,o),a=o)}return a.has(dn)||((s=ln()).isUniqueByDependants=c,a.set(dn,s)),a.get(dn)}:function(){return r},s.getDependants=e,s.clear=o,o(),s};const pn=_n((t,e)=>(t.noteQueries[JSON.stringify(e)]||[]).map(e=>t.notes[e]),(t,e)=>[t.noteQueries[JSON.stringify(e)],t.notes]),gn=(t,e)=>t.errors[e]||!1,fn=(t,e)=>t.requesting[e]||!1;var yn={SET_ERROR:"SET_ERROR",SET_NOTE:"SET_NOTE",SET_NOTE_IS_UPDATING:"SET_NOTE_IS_UPDATING",SET_NOTES:"SET_NOTES",SET_NOTES_QUERY:"SET_NOTES_QUERY",SET_IS_REQUESTING:"SET_IS_REQUESTING"};function*Rn(t,e){yield Nn("triggerNoteAction",!0);const r=`${tt}/admin/notes/${t}/action/${e}`;try{const e=yield Object(L.apiFetch)({path:r,method:"POST"});yield An(t,e),yield Nn("triggerNoteAction",!1)}catch(t){throw yield wn("triggerNoteAction",t),yield Nn("triggerNoteAction",!1),new Error}}function*mn(t){yield Nn("removeNote",!0),yield Pn(t,!0);try{const e=`${tt}/admin/notes/delete/${t}`,r=yield Object(L.apiFetch)({path:e,method:"DELETE"});return yield hn(t,r),yield Nn("removeNote",!1),r}catch(e){throw yield wn("removeNote",e),yield Nn("removeNote",!1),yield Pn(t,!1),new Error}}function*On(t={}){yield Nn("removeAllNotes",!0);try{const e=Object(ie.addQueryArgs)(tt+"/admin/notes/delete/all",t),r=yield Object(L.apiFetch)({path:e,method:"DELETE"});return yield vn(r),yield Nn("removeAllNotes",!1),r}catch(t){throw yield wn("removeAllNotes",t),yield Nn("removeAllNotes",!1),new Error}}function*In(t,e){yield Nn("batchUpdateNotes",!0);try{const r=tt+"/admin/notes/update",n=yield Object(L.apiFetch)({path:r,method:"PUT",data:{noteIds:t,...e}});yield vn(n),yield Nn("batchUpdateNotes",!1)}catch(t){throw yield wn("updateNote",t),yield Nn("batchUpdateNotes",!1),new Error}}function*An(t,e){yield Nn("updateNote",!0),yield Pn(t,!0);try{const r=`${tt}/admin/notes/${t}`,n=yield Object(L.apiFetch)({path:r,method:"PUT",data:e});yield hn(t,n),yield Nn("updateNote",!1),yield Pn(t,!1)}catch(e){throw yield wn("updateNote",e),yield Nn("updateNote",!1),yield Pn(t,!1),new Error}}function hn(t,e){return{type:yn.SET_NOTE,noteId:t,noteFields:e}}function Pn(t,e){return{type:yn.SET_NOTE_IS_UPDATING,noteId:t,isUpdating:e}}function vn(t){return{type:yn.SET_NOTES,notes:t}}function Un(t,e){return{type:yn.SET_NOTES_QUERY,query:t,noteIds:e}}function wn(t,e){return{type:yn.SET_ERROR,error:e,selector:t}}function Nn(t,e){return{type:yn.SET_IS_REQUESTING,selector:t,isRequesting:e}}function*bn(t={}){const e=Object(ie.addQueryArgs)(tt+"/admin/notes",t);try{const r=yield Object(L.apiFetch)({path:e});yield vn(r),yield Un(t,r.map(t=>t.id))}catch(t){yield wn("getNotes",t)}}var Cn=(t={errors:{},noteQueries:{},notes:{},requesting:{}},{error:e,isRequesting:r,isUpdating:n,noteFields:o,noteId:s,noteIds:i,notes:a,query:c,selector:u,type:d})=>{switch(d){case yn.SET_NOTES:t={...t,notes:{...t.notes,...a.reduce((t,e)=>(t[e.id]=e,t),{})}};break;case yn.SET_NOTES_QUERY:t={...t,noteQueries:{...t.noteQueries,[JSON.stringify(c)]:i}};break;case yn.SET_ERROR:t={...t,errors:{...t.errors,[u]:e}};break;case yn.SET_NOTE:t={...t,notes:{...t.notes,[s]:o}};break;case yn.SET_NOTE_IS_UPDATING:t={...t,notes:{...t.notes,[s]:{...t.notes[s],isUpdating:n}}};break;case yn.SET_IS_REQUESTING:t={...t,requesting:{...t.requesting,[u]:r}}}return t};Object(F.registerStore)("wc/admin/notes",{reducer:Cn,actions:y,controls:L.controls,selectors:f,resolvers:R});const Dn="wc/admin/notes",Gn={},kn=(t,e,r)=>{const n=Y(e,r);return t.itemErrors[n]||!1},Mn=(t,e,r)=>{const n=Y(e,r);return t.items[n]||Gn},jn=(t,e,r)=>{const n=Y(e,r);return t.stats[n]||Gn},Fn=(t,e,r)=>{const n=Y(e,r);return t.statErrors[n]||!1};var Ln={SET_ITEM_ERROR:"SET_ITEM_ERROR",SET_STAT_ERROR:"SET_STAT_ERROR",SET_REPORT_ITEMS:"SET_REPORT_ITEMS",SET_REPORT_STATS:"SET_REPORT_STATS"};function qn(t,e,r){const n=Y(t,e);return{type:Ln.SET_ITEM_ERROR,resourceName:n,error:r}}function Yn(t,e,r){const n=Y(t,e);return{type:Ln.SET_REPORT_ITEMS,resourceName:n,items:r}}function Qn(t,e,r){const n=Y(t,e);return{type:Ln.SET_REPORT_STATS,resourceName:n,stats:r}}function xn(t,e,r){const n=Y(t,e);return{type:Ln.SET_STAT_ERROR,resourceName:n,error:r}}function*Kn(t,e){const r={parse:!1,path:Object(ie.addQueryArgs)(`${tt}/reports/${t}`,e)};try{const n=yield nn(r),o=n.data,s=parseInt(n.headers.get("x-wp-total"),10),i=parseInt(n.headers.get("x-wp-totalpages"),10);yield Yn(t,e,{data:o,totalResults:s,totalPages:i})}catch(r){yield qn(t,e,r)}}function*Wn(t,e){const r={parse:!1,path:Object(ie.addQueryArgs)(`${tt}/reports/${t}/stats`,e)};try{const n=yield nn(r),o=n.data,s=parseInt(n.headers.get("x-wp-total"),10),i=parseInt(n.headers.get("x-wp-totalpages"),10);yield Qn(t,e,{data:o,totalResults:s,totalPages:i})}catch(r){yield xn(t,e,r)}}var Vn=(t={itemErrors:{},items:{},statErrors:{},stats:{}},{type:e,items:r,stats:n,error:o,resourceName:s})=>{switch(e){case Ln.SET_REPORT_ITEMS:return{...t,items:{...t.items,[s]:r}};case Ln.SET_REPORT_STATS:return{...t,stats:{...t.stats,[s]:n}};case Ln.SET_ITEM_ERROR:return{...t,itemErrors:{...t.itemErrors,[s]:o}};case Ln.SET_STAT_ERROR:return{...t,statErrors:{...t.statErrors,[s]:o}};default:return t}};Object(F.registerStore)("wc/admin/reports",{reducer:Vn,actions:O,controls:on,selectors:m,resolvers:I});const Hn="wc/admin/reports";var Jn=r(19);function $n(t){const{per_page:e,persisted_query:r,query:n,select:o,filterQuery:s}=t,{getItems:i,getItemsError:a,isResolving:c}=o("wc/admin/items"),u={isRequesting:!1,isError:!1,rows:[]},d=Object(Jn.getCurrentDates)(n,t.defaultDateRange),E={...s,after:Object(Jn.appendTimestamp)(d.primary.after,"start"),before:Object(Jn.appendTimestamp)(d.primary.before,"end"),per_page:e,persisted_query:JSON.stringify(r)},S=i("leaderboards",E);if(c("getItems",["leaderboards",E]))return{...u,isRequesting:!0};if(a("leaderboards",E))return{...u,isError:!0};const l=S.get(t.id);return{...u,rows:null==l?void 0:l.rows}}function Bn(t,e,r,n={}){const{getItems:o,getItemsError:s,isResolving:i}=t,a={};let c=!1,u=!1;return r.forEach(t=>{const r={search:t,per_page:10,...n};o(e,r).forEach((t,e)=>{a[e]=t}),i("getItems",[e,r])&&(c=!0),s(e,r)&&(u=!0)}),{items:a,isRequesting:c,isError:u}}function zn(t,e){const{_fields:r,page:n,per_page:o,...s}=e;return Y("total-"+t,s)}const Zn=_n((t,e,r,n=new Map)=>{const o=Y(e,r),s=t.items[o]&&t.items[o].data;return s?s.reduce((r,n)=>(r.set(n,t.data[e][n]),r),new Map):n},(t,e,r)=>{const n=Y(e,r);return[t.items[n]]}),Xn=(t,e,r,n=0)=>{const o=zn(e,r);return t.items.hasOwnProperty(o)?t.items[o]:n},to=(t,e,r)=>{const n=Y(e,r);return t.errors[n]};var eo={SET_ITEM:"SET_ITEM",SET_ITEMS:"SET_ITEMS",SET_ITEMS_TOTAL_COUNT:"SET_ITEMS_TOTAL_COUNT",SET_ERROR:"SET_ERROR"};function ro(t,e,r){return{type:eo.SET_ITEM,id:e,item:r,itemType:t}}function no(t,e,r,n){return{type:eo.SET_ITEMS,items:r,itemType:t,query:e,totalCount:n}}function oo(t,e,r){return{type:eo.SET_ITEMS_TOTAL_COUNT,itemType:t,query:e,totalCount:r}}function so(t,e,r){return{type:eo.SET_ERROR,itemType:t,query:e,error:r}}function*io(t,e){const r={...t,stock_quantity:e},{id:n,parent_id:o,type:s}=r;yield ro("products",n,r);let i=tt;switch(s){case"variation":i+=`/products/${o}/variations/${n}`;break;case"variable":case"simple":default:i+="/products/"+n}try{return yield Object(L.apiFetch)({path:i,method:"PUT",data:r}),!0}catch(e){return yield ro("products",n,t),yield so("products",n,e),!1}}function*ao(t,e){try{const r=Object(ie.addQueryArgs)(et+"/onboarding/tasks/create_product_from_template",e||{}),n=yield Object(L.apiFetch)({path:r,method:"POST",data:t});return yield ro("products",n.id,n),n}catch(t){throw yield so("createProductFromTemplate",e,t),t}}function*co(t,e){const r="categories"===t?"products/categories":t,n=Object(ie.addQueryArgs)(`${tt}/${r}`,e),o=-1===e.per_page,s=o?L.apiFetch:nn,i=yield s({path:n,method:"GET"});if(o)return{items:i,totalCount:i.length};const a=parseInt(i.headers.get("x-wp-total"),10);return{items:i.data,totalCount:a}}function*uo(t,e){try{const{items:r,totalCount:n}=yield co(t,e);yield oo(t,e,n),yield no(t,e,r)}catch(r){yield so(t,e,r)}}function*Eo(t,e){yield So(t,e)}function*So(t,e){try{const r={...e,page:1,per_page:1},{totalCount:n}=yield co(t,r);yield oo(t,e,n)}catch(r){yield so(t,e,r)}}var lo=(t={items:{},errors:{},data:{}},{type:e,id:r,itemType:n,query:o,item:s,items:i,totalCount:a,error:c})=>{switch(e){case eo.SET_ITEM:const e=t.data[n]||{};return{...t,data:{...t.data,[n]:{...e,[r]:{...e[r]||{},...s}}}};case eo.SET_ITEMS:const u=[],d=i.reduce((t,e)=>(u.push(e.id),t[e.id]=e,t),{}),E=Y(n,o);return{...t,items:{...t.items,[E]:{data:u}},data:{...t.data,[n]:{...t.data[n],...d}}};case eo.SET_ITEMS_TOTAL_COUNT:const S=zn(n,o);return{...t,items:{...t.items,[S]:a}};case eo.SET_ERROR:return{...t,errors:{...t.errors,[Y(n,o)]:c}};default:return t}};Object(F.registerStore)("wc/admin/items",{reducer:lo,actions:h,controls:on,selectors:A,resolvers:P});const To="wc/admin/items";var _o=r(30);const po=t=>Object(_o.applyFilters)("woocommerce_navigation_menu_items",t.menuItems),go=t=>t.favorites||[],fo=(t,e)=>t.requesting[e]||!1,yo=t=>t.persistedQuery||{};var Ro=r(12);var mo={ADD_MENU_ITEMS:"ADD_MENU_ITEMS",SET_MENU_ITEMS:"SET_MENU_ITEMS",ON_HISTORY_CHANGE:"ON_HISTORY_CHANGE",ADD_FAVORITE_FAILURE:"ADD_FAVORITE_FAILURE",ADD_FAVORITE_REQUEST:"ADD_FAVORITE_REQUEST",ADD_FAVORITE_SUCCESS:"ADD_FAVORITE_SUCCESS",GET_FAVORITES_FAILURE:"GET_FAVORITES_FAILURE",GET_FAVORITES_REQUEST:"GET_FAVORITES_REQUEST",GET_FAVORITES_SUCCESS:"GET_FAVORITES_SUCCESS",REMOVE_FAVORITE_FAILURE:"REMOVE_FAVORITE_FAILURE",REMOVE_FAVORITE_REQUEST:"REMOVE_FAVORITE_REQUEST",REMOVE_FAVORITE_SUCCESS:"REMOVE_FAVORITE_SUCCESS"};function Oo(t){return{type:mo.SET_MENU_ITEMS,menuItems:t}}function Io(t){return{type:mo.ADD_MENU_ITEMS,menuItems:t}}function Ao(t){return{type:mo.GET_FAVORITES_FAILURE,error:t}}function ho(t){return{type:mo.GET_FAVORITES_REQUEST,favorites:t}}function Po(t){return{type:mo.GET_FAVORITES_SUCCESS,favorites:t}}function vo(t){return{type:mo.ADD_FAVORITE_REQUEST,favorite:t}}function Uo(t,e){return{type:mo.ADD_FAVORITE_FAILURE,favorite:t,error:e}}function wo(t){return{type:mo.ADD_FAVORITE_SUCCESS,favorite:t}}function No(t){return{type:mo.REMOVE_FAVORITE_REQUEST,favorite:t}}function bo(t,e){return{type:mo.REMOVE_FAVORITE_FAILURE,favorite:t,error:e}}function Co(t,e){return{type:mo.REMOVE_FAVORITE_SUCCESS,favorite:t,error:e}}function*Do(){yield Go()}function*Go(){const t=Object(Ro.getPersistedQuery)();if(!Object.keys(t).length)return null;yield{type:mo.ON_HISTORY_CHANGE,persistedQuery:t}}function*ko(t){yield vo(t);try{const e=yield fe()({path:et+"/navigation/favorites/me",method:"POST",data:{item_id:t}});if(e)return yield wo(t),e;throw new Error}catch(e){throw yield Uo(t,e),new Error}}function*Mo(t){yield No(t);try{const e=yield fe()({path:et+"/navigation/favorites/me",method:"DELETE",data:{item_id:t}});if(e)return yield Co(t),e;throw new Error}catch(e){throw yield bo(t,e),new Error}}var jo=(t={error:null,menuItems:[],favorites:[],requesting:{},persistedQuery:{}},{type:e,error:r,favorite:n,favorites:o,menuItems:s,persistedQuery:i})=>{switch(e){case mo.SET_MENU_ITEMS:t={...t,menuItems:s};break;case mo.ADD_MENU_ITEMS:t={...t,menuItems:[...t.menuItems,...s]};break;case mo.ON_HISTORY_CHANGE:t={...t,persistedQuery:i};break;case mo.GET_FAVORITES_FAILURE:t={...t,requesting:{...t.requesting,getFavorites:!1}};break;case mo.GET_FAVORITES_REQUEST:t={...t,requesting:{...t.requesting,getFavorites:!0}};break;case mo.GET_FAVORITES_SUCCESS:t={...t,favorites:o,requesting:{...t.requesting,getFavorites:!1}};break;case mo.ADD_FAVORITE_FAILURE:t={...t,error:r,requesting:{...t.requesting,addFavorite:!1}};break;case mo.ADD_FAVORITE_REQUEST:t={...t,requesting:{...t.requesting,addFavorite:!0}};break;case mo.ADD_FAVORITE_SUCCESS:const e=t.favorites.includes(n)?t.favorites:[...t.favorites,n];t={...t,favorites:e,menuItems:t.menuItems.map(t=>t.id===n?{...t,menuId:"favorites"}:t),requesting:{...t.requesting,addFavorite:!1}};break;case mo.REMOVE_FAVORITE_FAILURE:t={...t,requesting:{...t.requesting,error:r,removeFavorite:!1}};break;case mo.REMOVE_FAVORITE_REQUEST:t={...t,requesting:{...t.requesting,removeFavorite:!0}};break;case mo.REMOVE_FAVORITE_SUCCESS:const a=t.favorites.filter(t=>t!==n);t={...t,favorites:a,menuItems:t.menuItems.map(t=>t.id===n?{...t,menuId:"plugins"}:t),requesting:{...t.requesting,removeFavorite:!1}}}return t};function*Fo(){yield ho();try{const t=yield Object(L.apiFetch)({path:et+"/navigation/favorites/me"});if(t)return void(yield Po(t));throw new Error}catch(t){throw yield Ao(t),new Error}}Object(F.registerStore)("woocommerce-navigation",{reducer:jo,actions:U,controls:L.controls,resolvers:w,selectors:v}),(async()=>{const{onLoad:t,onHistoryChange:e}=Object(F.dispatch)("woocommerce-navigation");await t(),Object(Ro.addHistoryListener)(async()=>{setTimeout(async()=>{await e()},0)})})();const Lo="woocommerce-navigation",qo=t=>Object(Pt.createHigherOrderComponent)(e=>r=>{const n=Object(vt.useRef)(t);return Object(F.useSelect)((t,e)=>{if(!n.current)return;const{isResolving:r,hasFinishedResolution:o}=t("woocommerce-navigation"),{startResolution:s,finishResolution:i,setMenuItems:a}=e.dispatch("woocommerce-navigation");r("getMenuItems")||o("getMenuItems")||(s("getMenuItems",[]),a(n.current.menuItems),i("getMenuItems",[]))}),Object(vt.createElement)(e,Object.assign({},r))},"withNavigationHydration");var Yo;!function(t){t.GET_PAYMENT_GATEWAYS_REQUEST="GET_PAYMENT_GATEWAYS_REQUEST",t.GET_PAYMENT_GATEWAYS_SUCCESS="GET_PAYMENT_GATEWAYS_SUCCESS",t.GET_PAYMENT_GATEWAYS_ERROR="GET_PAYMENT_GATEWAYS_ERROR",t.UPDATE_PAYMENT_GATEWAY_REQUEST="UPDATE_PAYMENT_GATEWAY_REQUEST",t.UPDATE_PAYMENT_GATEWAY_SUCCESS="UPDATE_PAYMENT_GATEWAY_SUCCESS",t.UPDATE_PAYMENT_GATEWAY_ERROR="UPDATE_PAYMENT_GATEWAY_ERROR",t.GET_PAYMENT_GATEWAY_REQUEST="GET_PAYMENT_GATEWAY_REQUEST",t.GET_PAYMENT_GATEWAY_SUCCESS="GET_PAYMENT_GATEWAY_SUCCESS",t.GET_PAYMENT_GATEWAY_ERROR="GET_PAYMENT_GATEWAY_ERROR"}(Yo||(Yo={}));const Qo="wc/payment-gateways";function xo(){return{type:Yo.GET_PAYMENT_GATEWAYS_REQUEST}}function Ko(t){return{type:Yo.GET_PAYMENT_GATEWAYS_SUCCESS,paymentGateways:t}}function Wo(t){return{type:Yo.GET_PAYMENT_GATEWAYS_ERROR,error:t}}function Vo(){return{type:Yo.GET_PAYMENT_GATEWAY_REQUEST}}function Ho(t){return{type:Yo.GET_PAYMENT_GATEWAY_ERROR,error:t}}function Jo(t){return{type:Yo.GET_PAYMENT_GATEWAY_SUCCESS,paymentGateway:t}}function $o(t){return{type:Yo.UPDATE_PAYMENT_GATEWAY_SUCCESS,paymentGateway:t}}function Bo(){return{type:Yo.UPDATE_PAYMENT_GATEWAY_REQUEST}}function zo(t){return{type:Yo.UPDATE_PAYMENT_GATEWAY_ERROR,error:t}}function*Zo(t,e){try{yield Bo();const r=yield Object(L.apiFetch)({method:"PUT",path:"wc/v3/payment_gateways/"+t,body:JSON.stringify(e)});if(r&&r.id===t)return yield $o(r),r}catch(t){throw yield zo(t),t}}const Xo=F.controls&&F.controls.dispatch?F.controls.dispatch:L.dispatch;function*ts(){yield xo();try{const t=yield Object(L.apiFetch)({path:"wc/v3/payment_gateways"});yield Ko(t);for(let e=0;e<t.length;e++)yield Xo(Qo,"finishResolution","getPaymentGateway",[t[e].id])}catch(t){yield Wo(t)}}function*es(t){yield Vo();try{const e=yield Object(L.apiFetch)({path:"wc/v3/payment_gateways/"+t});if(e&&e.id)return yield Jo(e),e}catch(t){yield Ho(t)}}function rs(t,e){return t.paymentGateways.find(t=>t.id===e)}function ns(t){return t.paymentGateways}function os(t,e){return t.errors[e]||null}function ss(t){return t.isUpdating||!1}function is(t,e){const r=t.paymentGateways.findIndex(t=>t.id===e.id);return-1===r?{...t,paymentGateways:[...t.paymentGateways,e],isUpdating:!1}:{...t,paymentGateways:[...t.paymentGateways.slice(0,r),e,...t.paymentGateways.slice(r+1)],isUpdating:!1}}var as=(t={paymentGateways:[],isUpdating:!1,errors:{}},e)=>{if(e&&"type"in e)switch(e.type){case Yo.GET_PAYMENT_GATEWAYS_REQUEST:case Yo.GET_PAYMENT_GATEWAY_REQUEST:return t;case Yo.GET_PAYMENT_GATEWAYS_SUCCESS:return{...t,paymentGateways:e.paymentGateways};case Yo.GET_PAYMENT_GATEWAYS_ERROR:return{...t,errors:{...t.errors,getPaymentGateways:e.error}};case Yo.GET_PAYMENT_GATEWAY_ERROR:return{...t,errors:{...t.errors,getPaymentGateway:e.error}};case Yo.UPDATE_PAYMENT_GATEWAY_REQUEST:return{...t,isUpdating:!0};case Yo.UPDATE_PAYMENT_GATEWAY_SUCCESS:case Yo.GET_PAYMENT_GATEWAY_SUCCESS:return is(t,e.paymentGateway);case Yo.UPDATE_PAYMENT_GATEWAY_ERROR:return{...t,errors:{...t.errors,updatePaymentGateway:e.error},isUpdating:!1}}return t};const cs=Qo;Object(F.registerStore)(Qo,{actions:N,selectors:C,resolvers:b,controls:L.controls,reducer:as});var us=r(9),ds=r.n(us),Es=r(43),Ss=r.n(Es);function ls(t){const{endpoint:e,query:r,limitBy:n,filters:o=[],advancedFilters:s={}}=t;if(r.search){return(n||[e]).reduce((t,e)=>(t[e]=r[e],t),{})}return o.map(t=>function(t,e,r){const n=r[t.param];if(!n)return{};if("advanced"===n){const t=Object(Ro.getActiveFiltersFromQuery)(r,e.filters);if(0===t.length)return{};const n=Object(Ro.getQueryFromActiveFilters)(t.map(t=>function(t,e){const r=t.filters[e.key];if("Date"!==Object(X.get)(r,["input","component"]))return e;const{rule:n,value:o}=e,s={after:"start",before:"end"};if(Array.isArray(o)){const[t,r]=o;return Object.assign({},e,{value:[Object(Jn.appendTimestamp)(ds()(t),s.after),Object(Jn.appendTimestamp)(ds()(r),s.before)]})}return Object.assign({},e,{value:Object(Jn.appendTimestamp)(ds()(o),s[n])})}(e,t)),{},e.filters);return{match:r.match||"all",...n}}const o=Object(X.find)(Object(Ro.flattenFilters)(t.filters),{value:n});if(!o)return{};if(o.settings&&o.settings.param){const{param:t}=o.settings;return r[t]?{[t]:r[t]}:{}}return{[t.param]:n}}(t,s,r)).reduce((t,e)=>Object.assign(t,e),{})}const Ts=["stock","customers"];function _s(t){const{endpoint:e,dataType:r,query:n,fields:o}=t,s=Object(Jn.getCurrentDates)(n,t.defaultDateRange),i=Object(Jn.getIntervalForQuery)(n),a=ls(t),c=s[r].before;return Object(X.includes)(Ts,e)?{...a,fields:o}:{order:"asc",interval:i,per_page:nt,after:Object(Jn.appendTimestamp)(s[r].after,"start"),before:Object(Jn.appendTimestamp)(c,"end"),segmentby:n.segmentby,fields:o,...a}}function ps(t){const{endpoint:e,select:r}=t,{getReportStats:n,getReportStatsError:o,isResolving:s}=r("wc/admin/reports"),i={isRequesting:!1,isError:!1,totals:{primary:null,secondary:null}},a=_s({...t,dataType:"primary"}),c=n(e,a);if(s("getReportStats",[e,a]))return{...i,isRequesting:!0};if(o(e,a))return{...i,isError:!0};const u=c&&c.data&&c.data.totals||null,d=_s({...t,dataType:"secondary"}),E=n(e,d);if(s("getReportStats",[e,d]))return{...i,isRequesting:!0};if(o(e,d))return{...i,isError:!0};const S=E&&E.data&&E.data.totals||null;return{...i,totals:{primary:u,secondary:S}}}const gs={isEmpty:!1,isError:!1,isRequesting:!0,data:{totals:{},intervals:[]}},fs={isEmpty:!1,isError:!0,isRequesting:!1,data:{totals:{},intervals:[]}},ys={isEmpty:!0,isError:!1,isRequesting:!1,data:{totals:{},intervals:[]}},Rs=[],ms=Object(X.memoize)((t,e,r)=>({isEmpty:!1,isError:!1,isRequesting:!1,data:{totals:e,intervals:r}}),(t,e,r)=>[t,e.length,r.length].join(":"));function Os(t){const{endpoint:e}=t;let r=t.selector;t.select&&!t.selector&&(Ss()("option.select",{version:"1.7.0",hint:"You can pass the report selectors through option.selector now."}),r=t.select("wc/admin/reports"));const{getReportStats:n,getReportStatsError:o,isResolving:s}=r,i=_s(t),a=n(e,i);if(s("getReportStats",[e,i]))return gs;if(o(e,i))return fs;if(function(t,e){return!t||(!t.data||(!(t.data.totals&&!Object(X.isNull)(t.data.totals))||!(Object(X.includes)(Ts,e)||t.data.intervals&&0!==t.data.intervals.length)))}(a,e))return ys;const c=a&&a.data&&a.data.totals||null;let u=a&&a.data&&a.data.intervals||Rs;if(a.totalResults>nt){let t=!0,r=!1;const c=[],d=Math.ceil(a.totalResults/nt);let E=1;for(let a=2;a<=d;a++){const u={...i,page:a},S=n(e,u);if(!s("getReportStats",[e,u])){if(o(e,u)){r=!0,t=!1;break}if(c.push(S),E++,E===d){t=!1;break}}}if(t)return gs;if(r)return fs;Object(X.forEach)(c,(function(t){t.data&&t.data.intervals&&Array.isArray(t.data.intervals)&&(u=u.concat(t.data.intervals))}))}return ms(Y(e,i),c,u)}function Is(t,e){switch(t){case"currency":return e;case"percent":return".0%";case"number":return",";case"average":return",.2r";default:return","}}function As(t){const{query:e,tableQuery:r={}}=t,n=ls(t),o=Object(Jn.getCurrentDates)(e,t.defaultDateRange),s=Object(X.includes)(Ts,t.endpoint);return{orderby:e.orderby||"date",order:e.order||"desc",after:s?void 0:Object(Jn.appendTimestamp)(o.primary.after,"start"),before:s?void 0:Object(Jn.appendTimestamp)(o.primary.before,"end"),page:e.paged||1,per_page:e.per_page||dt.pageSize,...n,...r}}function hs(t){const{endpoint:e}=t;let r=t.selector;t.select&&!t.selector&&(Ss()("option.select",{version:"1.7.0",hint:"You can pass the report selectors through option.selector now."}),r=t.select("wc/admin/reports"));const{getReportItems:n,getReportItemsError:o,hasFinishedResolution:s}=r,i=As(t),a={query:i,isRequesting:!1,isError:!1,items:{data:[],totalResults:0}},c=n(e,i);return s("getReportItems",[e,i])?o(e,i)?{...a,isError:!0}:{...a,items:c}:{...a,isRequesting:!0}}var Ps=r(267),vs=r.n(Ps);const Us=t=>vs()(Y("export",t)),ws=(t,e,r)=>Boolean(t.requesting[e]&&t.requesting[e][Us(r)]),Ns=(t,e,r)=>t.exportIds[e]&&t.exportIds[e][Us(r)],bs=(t,e,r)=>t.errors[e]&&t.errors[e][Us(r)];var Cs={START_EXPORT:"START_EXPORT",SET_EXPORT_ID:"SET_EXPORT_ID",SET_ERROR:"SET_ERROR",SET_IS_REQUESTING:"SET_IS_REQUESTING"};function Ds(t,e,r){return{type:Cs.SET_EXPORT_ID,exportType:t,exportArgs:e,exportId:r}}function Gs(t,e,r){return{type:Cs.SET_IS_REQUESTING,selector:t,selectorArgs:e,isRequesting:r}}function ks(t,e,r){return{type:Cs.SET_ERROR,selector:t,selectorArgs:e,error:r}}function*Ms(t,e){yield Gs("startExport",{type:t,args:e},!0);try{const r=yield nn({path:`${tt}/reports/${t}/export`,method:"POST",data:{report_args:e,email:!0}});yield Gs("startExport",{type:t,args:e},!1);const{export_id:n,message:o}=r.data;if(!n)throw new Error(o);return yield Ds(t,e,n),r.data}catch(r){throw yield ks("startExport",{type:t,args:e},r.message),yield Gs("startExport",{type:t,args:e},!1),r}}var js=(t={errors:{},requesting:{},exportMeta:{},exportIds:{}},{error:e,exportArgs:r,exportId:n,exportType:o,isRequesting:s,selector:i,selectorArgs:a,type:c})=>{switch(c){case Cs.SET_IS_REQUESTING:return{...t,requesting:{...t.requesting,[i]:{...t.requesting[i],[Us(a)]:s}}};case Cs.SET_EXPORT_ID:return{...t,exportMeta:{...t.exportMeta,[n]:{exportType:o,exportArgs:r}},exportIds:{...t.exportIds,[o]:{...t.exportIds[o],[Us({type:o,args:r})]:n}}};case Cs.SET_ERROR:return{...t,errors:{...t.errors,[i]:{...t.errors[i],[Us(a)]:e}}};default:return t}};Object(F.registerStore)("wc/admin/export",{reducer:js,actions:G,controls:on,selectors:D});const Fs="wc/admin/export",Ls=t=>{const{activeImport:e,lastImportStartTimestamp:r}=t;return{activeImport:e,lastImportStartTimestamp:r}||{}},qs=t=>{const{period:e,skipPrevious:r}=t;return{period:e,skipPrevious:r}||{}},Ys=(t,e)=>{const r=JSON.stringify(e);return t.importStatus[r]||{}},Qs=(t,e)=>{const{importTotals:r,lastImportStartTimestamp:n}=t;return{...r[JSON.stringify(e)],lastImportStartTimestamp:n}||{}},xs=(t,e)=>{const r=JSON.stringify(e);return t.errors[r]||!1};var Ks={SET_IMPORT_DATE:"SET_IMPORT_DATE",SET_IMPORT_ERROR:"SET_IMPORT_ERROR",SET_IMPORT_PERIOD:"SET_IMPORT_PERIOD",SET_IMPORT_STARTED:"SET_IMPORT_STARTED",SET_IMPORT_STATUS:"SET_IMPORT_STATUS",SET_IMPORT_TOTALS:"SET_IMPORT_TOTALS",SET_SKIP_IMPORTED:"SET_SKIP_IMPORTED"};function Ws(t){return{type:Ks.SET_IMPORT_STARTED,activeImport:t}}function Vs(t,e){return e?{type:Ks.SET_IMPORT_DATE,date:t}:{type:Ks.SET_IMPORT_PERIOD,date:t}}function Hs(t){return{type:Ks.SET_SKIP_IMPORTED,skipPrevious:t}}function Js(t,e){return{type:Ks.SET_IMPORT_STATUS,importStatus:e,query:t}}function $s(t,e){return{type:Ks.SET_IMPORT_TOTALS,importTotals:e,query:t}}function Bs(t,e){return{type:Ks.SET_IMPORT_ERROR,error:e,query:t}}function*zs(t,e=!1){yield Ws(e);try{return yield Object(L.apiFetch)({path:t,method:"POST"})}catch(e){throw yield Bs(t,e),e}}function*Zs(t){try{const e=Object(ie.addQueryArgs)(tt+"/reports/import/status",Object(X.omit)(t,["timestamp"])),r=yield Object(L.apiFetch)({path:e});yield Js(t,r)}catch(e){yield Bs(t,e)}}function*Xs(t){try{const e=Object(ie.addQueryArgs)(tt+"/reports/import/totals",t),r=yield Object(L.apiFetch)({path:e});yield $s(t,r)}catch(e){yield Bs(t,e)}}var ti=(t={activeImport:!1,importStatus:{},importTotals:{},errors:{},lastImportStartTimestamp:0,period:{date:ds()().format(Object(Z.__)("MM/DD/YYYY",'woocommerce')),label:"all"},skipPrevious:!0},{type:e,query:r,importStatus:n,importTotals:o,activeImport:s,date:i,error:a,skipPrevious:c})=>{switch(e){case Ks.SET_IMPORT_STARTED:t={...t,activeImport:s,lastImportStartTimestamp:s?Date.now():t.lastImportStartTimestamp};break;case Ks.SET_IMPORT_PERIOD:t={...t,period:{...t.period,label:i},activeImport:!1};break;case Ks.SET_IMPORT_DATE:t={...t,period:{date:i,label:"custom"},activeImport:!1};break;case Ks.SET_SKIP_IMPORTED:t={...t,skipPrevious:c,activeImport:!1};break;case Ks.SET_IMPORT_STATUS:t={...t,importStatus:{...t.importStatus,[JSON.stringify(r)]:n},errors:{...t.errors,[JSON.stringify(r)]:!1}};break;case Ks.SET_IMPORT_TOTALS:t={...t,importTotals:{...t.importTotals,[JSON.stringify(r)]:o}};break;case Ks.SET_IMPORT_ERROR:t={...t,errors:{...t.errors,[JSON.stringify(r)]:a}}}return t};Object(F.registerStore)("wc/admin/import",{reducer:ti,actions:M,controls:L.controls,selectors:k,resolvers:j});const ei="wc/admin/import"},7:function(t,e){t.exports=window.wp.data},9:function(t,e){t.exports=window.moment}});woocommerce-admin/dist/data/index.asset.php000064400000000432151335517650014775 0ustar00<?php return array('dependencies' => array('lodash', 'moment', 'wc-date', 'wc-navigation', 'wp-api-fetch', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-data-controls', 'wp-deprecated', 'wp-element', 'wp-hooks', 'wp-i18n', 'wp-url'), 'version' => '3dbf416e43e296bd27152079dca2aa58');woocommerce-admin/dist/number/index.asset.php000064400000000137151335517650015356 0ustar00<?php return array('dependencies' => array(), 'version' => 'b48ae75e90fdf3f96e5674d53763a593');woocommerce-admin/dist/number/index.js000064400000004270151335517650014067 0ustar00this.wc=this.wc||{},this.wc.number=function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=445)}({445:function(e,t,n){"use strict";n.r(t),n.d(t,"numberFormat",(function(){return i})),n.d(t,"formatValue",(function(){return u})),n.d(t,"calculateDelta",(function(){return o}));const r=n(446);function i({precision:e=null,decimalSeparator:t=".",thousandSeparator:n=","},i){if("number"!=typeof i&&(i=parseFloat(i)),isNaN(i))return"";let u=parseInt(e,10);if(isNaN(u)){const[,e]=i.toString().split(".");u=e?e.length:0}return r(i,u,t,n)}function u(e,t,n){if(!Number.isFinite(n))return null;switch(t){case"average":return Math.round(n);case"number":return i({...e,precision:null},n)}}function o(e,t){return Number.isFinite(e)&&Number.isFinite(t)?0===t?0:Math.round((e-t)/t*100):null}},446:function(e,t,n){"use strict";e.exports=function(e,t,n,r){e=(e+"").replace(/[^0-9+\-Ee.]/g,"");var i=isFinite(+e)?+e:0,u=isFinite(+t)?Math.abs(t):0,o=void 0===r?",":r,a=void 0===n?".":n,c="";return(c=(u?function(e,t){if(-1===(""+e).indexOf("e"))return+(Math.round(e+"e+"+t)+"e-"+t);var n=(""+e).split("e"),r="";return+n[1]+t>0&&(r="+"),(+(Math.round(+n[0]+"e"+r+(+n[1]+t))+"e-"+t)).toFixed(t)}(i,u).toString():""+Math.round(i)).split("."))[0].length>3&&(c[0]=c[0].replace(/\B(?=(?:\d{3})+(?!\d))/g,o)),(c[1]||"").length<u&&(c[1]=c[1]||"",c[1]+=new Array(u-c[1].length+1).join("0")),c.join(a)}}});woocommerce-admin/dist/store-alerts/style-rtl.css000064400000012433151335517650016227 0ustar00:root{--wp-admin-theme-color:#007cba;--wp-admin-theme-color-darker-10:#006ba1;--wp-admin-theme-color-darker-20:#005a87}body.admin-color-light{--wp-admin-theme-color:#0085ba;--wp-admin-theme-color-darker-10:#0073a1;--wp-admin-theme-color-darker-20:#006187}body.admin-color-modern{--wp-admin-theme-color:#3858e9;--wp-admin-theme-color-darker-10:#2145e6;--wp-admin-theme-color-darker-20:#183ad6}body.admin-color-blue{--wp-admin-theme-color:#096484;--wp-admin-theme-color-darker-10:#07526c;--wp-admin-theme-color-darker-20:#064054}body.admin-color-coffee{--wp-admin-theme-color:#46403c;--wp-admin-theme-color-darker-10:#383330;--wp-admin-theme-color-darker-20:#2b2724}body.admin-color-ectoplasm{--wp-admin-theme-color:#523f6d;--wp-admin-theme-color-darker-10:#46365d;--wp-admin-theme-color-darker-20:#3a2c4d}body.admin-color-midnight{--wp-admin-theme-color:#e14d43;--wp-admin-theme-color-darker-10:#dd382d;--wp-admin-theme-color-darker-20:#d02c21}body.admin-color-ocean{--wp-admin-theme-color:#627c83;--wp-admin-theme-color-darker-10:#576e74;--wp-admin-theme-color-darker-20:#4c6066}body.admin-color-sunrise{--wp-admin-theme-color:#dd823b;--wp-admin-theme-color-darker-10:#d97426;--wp-admin-theme-color-darker-20:#c36922}.woocommerce-store-alerts{position:relative;margin:0 0 40px;margin-left:var(--large-gap);padding:24px;border:0;box-shadow:0 0 8px -2px rgba(0,0,0,.3)}.woocommerce-store-alerts:before{content:"";position:absolute;top:0;right:0;width:4px;height:100%;background:transparent}.woocommerce-store-alerts .components-card__header{margin-bottom:12px}.woocommerce-store-alerts a.components-button{min-height:36px;padding:4px 16px}@media(max-width:782px){.woocommerce-store-alerts a.components-button{min-height:36px;font-size:16px;line-height:1.625;padding:5px 16px}}.woocommerce-store-alerts a.components-button+.components-button{margin-right:10px}.woocommerce-store-alerts a.components-button.is-button{color:#757575}@media(max-width:782px){.woocommerce-store-alerts{margin-bottom:24px;padding:16px}.woocommerce-store-alerts .components-card__header{display:flex;flex-direction:column-reverse;align-items:flex-start}}.woocommerce-embed-page .woocommerce-store-alerts{margin:40px 20px 20px}@media(max-width:782px){.woocommerce-embed-page .woocommerce-store-alerts{margin-top:24px}}.is-alert-error:before{background-color:#dc3232}.is-alert-error .components-card__header h2 svg{color:#dc3232}.is-alert-update:before{background-color:#11a0d2}.is-alert-update .components-card__header h2 svg{color:#11a0d2}.components-card__body .woocommerce-store-alerts__message{margin-bottom:16px}.woocommerce-store-alerts__pagination{display:inline-flex;align-items:center;border:1px solid #b5bfc9;border-radius:4px;background:#f0f2f4;margin-right:16px;min-width:120px}.woocommerce-store-alerts__pagination .components-button{padding:4px}.rtl .woocommerce-store-alerts__pagination .components-button .arrow-left-icon,.rtl .woocommerce-store-alerts__pagination .components-button .arrow-right-icon{transform:scaleX(-1)}.woocommerce-store-alerts__pagination .woocommerce-store-alerts__pagination-label{padding:5px 12px;border-color:#b5bfc9;border-style:solid;border-width:0 1px;flex:1 1;font-size:14px;font-size:.875rem}@media(max-width:782px){.woocommerce-store-alerts__pagination{margin-right:0;margin-bottom:14px}.woocommerce-store-alerts__pagination .woocommerce-store-alerts__pagination-label{text-align:center}}.woocommerce-store-alerts__pagination button:first-child{border-top-left-radius:0;border-bottom-left-radius:0}.woocommerce-store-alerts__pagination button:last-child{border-top-right-radius:0;border-bottom-right-radius:0}.woocommerce-store-alerts.is-loading:before{animation:loading-fade 1.6s ease-in-out infinite;background-color:#f0f0f0;color:transparent}.woocommerce-store-alerts.is-loading:before:after{content:" "}@media screen and (prefers-reduced-motion:reduce){.woocommerce-store-alerts.is-loading:before{animation:none}}.woocommerce-store-alerts.is-loading .is-placeholder{animation:loading-fade 1.6s ease-in-out infinite;background-color:#f0f0f0;color:transparent;display:inline-block;height:16px}.woocommerce-store-alerts.is-loading .is-placeholder:after{content:" "}@media screen and (prefers-reduced-motion:reduce){.woocommerce-store-alerts.is-loading .is-placeholder{animation:none}}.woocommerce-store-alerts.is-loading .components-card__header .is-placeholder:first-child{width:340px;height:32px}.woocommerce-store-alerts.is-loading .components-card__header .is-placeholder:nth-child(2){width:137px;height:38px}.woocommerce-store-alerts.is-loading .components-card__footer .is-placeholder{min-width:120px;height:30px}.woocommerce-store-alerts.is-loading .components-card__body .is-placeholder:first-child{width:75%}.woocommerce-store-alerts.is-loading .components-card__body .is-placeholder:nth-child(2){width:45%}.woocommerce-store-alerts.is-loading .woocommerce-store-alerts__actions .is-placeholder{width:110px;height:26px}@media(max-width:782px){.woocommerce-store-alerts.is-loading .components-card__header h2{width:100%}.woocommerce-store-alerts.is-loading .components-card__header h2 .is-placeholder{width:50%}.woocommerce-store-alerts.is-loading .components-card__footer{margin-bottom:14px}}.woocommerce-store-alerts__snooze{display:inline-flex;margin-right:10px}.woocommerce-store-alerts__snooze .components-select-control__input{vertical-align:initial;min-height:36px}woocommerce-admin/dist/shipping-recommendations/style-rtl.css000064400000005104151335517650020606 0ustar00.woocommerce-dismissable-list{margin:0 20px 10px;animation:isLoaded;animation-duration:.25s}@media(min-width:782px){.woocommerce-dismissable-list{margin-right:0;margin-left:0}}.woocommerce-dismissable-list .woocommerce-dismissable-list__controls{text-align:center}.woocommerce-services-item__logo{width:36px;height:auto}:root{--wp-admin-theme-color:#007cba;--wp-admin-theme-color-darker-10:#006ba1;--wp-admin-theme-color-darker-20:#005a87}body.admin-color-light{--wp-admin-theme-color:#0085ba;--wp-admin-theme-color-darker-10:#0073a1;--wp-admin-theme-color-darker-20:#006187}body.admin-color-modern{--wp-admin-theme-color:#3858e9;--wp-admin-theme-color-darker-10:#2145e6;--wp-admin-theme-color-darker-20:#183ad6}body.admin-color-blue{--wp-admin-theme-color:#096484;--wp-admin-theme-color-darker-10:#07526c;--wp-admin-theme-color-darker-20:#064054}body.admin-color-coffee{--wp-admin-theme-color:#46403c;--wp-admin-theme-color-darker-10:#383330;--wp-admin-theme-color-darker-20:#2b2724}body.admin-color-ectoplasm{--wp-admin-theme-color:#523f6d;--wp-admin-theme-color-darker-10:#46365d;--wp-admin-theme-color-darker-20:#3a2c4d}body.admin-color-midnight{--wp-admin-theme-color:#e14d43;--wp-admin-theme-color-darker-10:#dd382d;--wp-admin-theme-color-darker-20:#d02c21}body.admin-color-ocean{--wp-admin-theme-color:#627c83;--wp-admin-theme-color-darker-10:#576e74;--wp-admin-theme-color-darker-20:#4c6066}body.admin-color-sunrise{--wp-admin-theme-color:#dd823b;--wp-admin-theme-color-darker-10:#d97426;--wp-admin-theme-color-darker-20:#c36922}.woocommerce-recommended-shipping-extensions__more_options_cta .gridicon{margin-right:4px}.woocommerce-recommended-shipping-extensions .woocommerce-list__item>.woocommerce-list__item-inner{align-items:flex-start}.woocommerce-recommended-shipping-extensions .woocommerce-list__item:hover{background-color:#fff}.woocommerce-recommended-shipping-extensions .woocommerce-list__item:hover .woocommerce-list__item-title{color:#1e1e1e}.woocommerce-recommended-shipping-extensions .woocommerce-list__item-title{font-size:14px;color:#1e1e1e;font-weight:600}.woocommerce-recommended-shipping-extensions .woocommerce-pill{margin-right:4px;margin-top:4px;margin-bottom:4px;padding:2px 8px}@media(min-width:480px){.woocommerce-recommended-shipping-extensions .woocommerce-pill{margin-top:0;margin-bottom:0}}.woocommerce-recommended-shipping-extensions .woocommerce-list__item-after .components-button{margin-right:12px}.woocommerce-recommended-shipping-extensions .woocommerce-list__item-text,.woocommerce-recommended-shipping-extensions .woocommerce-recommended-shipping__header-heading{max-width:749px}woocommerce-admin/dist/dashboard-charts/style-rtl.css000064400000007133151335517650017015 0ustar00.woocommerce-dashboard__chart-block-wrapper{cursor:pointer}.woocommerce-dashboard__chart-block-wrapper:hover .woocommerce-card__header,.woocommerce-dashboard__chart-block-wrapper:hover .woocommerce-chart{background:#f8f9f9}.woocommerce-dashboard__chart-block-wrapper:hover .woocommerce-legend__item button{background:transparent}.woocommerce-dashboard__chart-block-wrapper .woocommerce-chart{margin-top:0;margin-bottom:0;border:0}.woocommerce-dashboard__chart-block-wrapper .woocommerce-chart__footer{position:relative}.woocommerce-dashboard__chart-block-wrapper .woocommerce-chart__footer:after{content:"";position:absolute;width:100%;height:100%;right:0;top:0;cursor:pointer;z-index:1}.woocommerce-dashboard__chart-block .woocommerce-card__body{padding:0;position:relative}.woocommerce-dashboard__chart-block .woocommerce-card__body .woocommerce-chart{border:none;margin:0}.woocommerce-dashboard__chart-block .woocommerce-card__body .woocommerce-chart .woocommerce-legend__item>button{cursor:default}.woocommerce-dashboard__chart-block .woocommerce-card__body .woocommerce-chart .woocommerce-legend__item>button:hover{background:#f0f0f0}.woocommerce-dashboard__chart-block .woocommerce-card__body .woocommerce-chart .woocommerce-legend__item>button .woocommerce-legend__item-container{cursor:default}.woocommerce-dashboard__chart-block .woocommerce-card__body .woocommerce-chart .woocommerce-legend__item>button .woocommerce-legend__item-container .woocommerce-legend__item-checkmark.woocommerce-legend__item-checkmark-checked:after{display:none}.woocommerce-dashboard__chart-block .woocommerce-card__body .woocommerce-chart:hover,.woocommerce-dashboard__chart-block .woocommerce-card__body .woocommerce-chart:hover .woocommerce-legend__item>button,.woocommerce-dashboard__chart-block:hover{background:#f0f0f0}.woocommerce-dashboard__chart-block .screen-reader-text:focus{clip:auto;-webkit-clip-path:none;clip-path:none;z-index:1;right:6px;top:7px;height:auto;width:auto;display:block;font-size:14px;font-size:.875rem;font-weight:600;padding:15px 23px 14px;background:#f1f1f1;color:#0073aa;text-decoration:none;box-shadow:0 0 2px 2px rgba(0,0,0,.6)}:root{--wp-admin-theme-color:#007cba;--wp-admin-theme-color-darker-10:#006ba1;--wp-admin-theme-color-darker-20:#005a87}body.admin-color-light{--wp-admin-theme-color:#0085ba;--wp-admin-theme-color-darker-10:#0073a1;--wp-admin-theme-color-darker-20:#006187}body.admin-color-modern{--wp-admin-theme-color:#3858e9;--wp-admin-theme-color-darker-10:#2145e6;--wp-admin-theme-color-darker-20:#183ad6}body.admin-color-blue{--wp-admin-theme-color:#096484;--wp-admin-theme-color-darker-10:#07526c;--wp-admin-theme-color-darker-20:#064054}body.admin-color-coffee{--wp-admin-theme-color:#46403c;--wp-admin-theme-color-darker-10:#383330;--wp-admin-theme-color-darker-20:#2b2724}body.admin-color-ectoplasm{--wp-admin-theme-color:#523f6d;--wp-admin-theme-color-darker-10:#46365d;--wp-admin-theme-color-darker-20:#3a2c4d}body.admin-color-midnight{--wp-admin-theme-color:#e14d43;--wp-admin-theme-color-darker-10:#dd382d;--wp-admin-theme-color-darker-20:#d02c21}body.admin-color-ocean{--wp-admin-theme-color:#627c83;--wp-admin-theme-color-darker-10:#576e74;--wp-admin-theme-color-darker-20:#4c6066}body.admin-color-sunrise{--wp-admin-theme-color:#dd823b;--wp-admin-theme-color-darker-10:#d97426;--wp-admin-theme-color-darker-20:#c36922}.woocommerce-dashboard__dashboard-charts{border-bottom:0;border-left:0}.woocommerce-dashboard__dashboard-charts .woocommerce-section-header__actions{flex-grow:0}.woocommerce-dashboard__dashboard-charts .woocommerce-card__body{padding:0}.woocommerce-dashboard__dashboard-charts .woocommerce-summary{margin:0}woocommerce-admin/dist/analytics-report-stock/style-rtl.css000064400000004374151335517650020231 0ustar00:root{--wp-admin-theme-color:#007cba;--wp-admin-theme-color-darker-10:#006ba1;--wp-admin-theme-color-darker-20:#005a87}body.admin-color-light{--wp-admin-theme-color:#0085ba;--wp-admin-theme-color-darker-10:#0073a1;--wp-admin-theme-color-darker-20:#006187}body.admin-color-modern{--wp-admin-theme-color:#3858e9;--wp-admin-theme-color-darker-10:#2145e6;--wp-admin-theme-color-darker-20:#183ad6}body.admin-color-blue{--wp-admin-theme-color:#096484;--wp-admin-theme-color-darker-10:#07526c;--wp-admin-theme-color-darker-20:#064054}body.admin-color-coffee{--wp-admin-theme-color:#46403c;--wp-admin-theme-color-darker-10:#383330;--wp-admin-theme-color-darker-20:#2b2724}body.admin-color-ectoplasm{--wp-admin-theme-color:#523f6d;--wp-admin-theme-color-darker-10:#46365d;--wp-admin-theme-color-darker-20:#3a2c4d}body.admin-color-midnight{--wp-admin-theme-color:#e14d43;--wp-admin-theme-color-darker-10:#dd382d;--wp-admin-theme-color-darker-20:#d02c21}body.admin-color-ocean{--wp-admin-theme-color:#627c83;--wp-admin-theme-color-darker-10:#576e74;--wp-admin-theme-color-darker-20:#4c6066}body.admin-color-sunrise{--wp-admin-theme-color:#dd823b;--wp-admin-theme-color-darker-10:#d97426;--wp-admin-theme-color-darker-20:#c36922}.woocommerce-report-table__scroll-point{position:relative;top:-48px}@media(max-width:782px){.woocommerce-report-table__scroll-point{top:-62px}}.woocommerce-feature-enabled-activity-panels .woocommerce-report-table__scroll-point{top:-108px}@media(max-width:782px){.woocommerce-feature-enabled-activity-panels .woocommerce-report-table__scroll-point{top:-122px}}.woocommerce-report-table .woocommerce-search{flex-grow:1}.woocommerce-report-table .components-card__header{display:grid;grid-gap:12px;grid-template-columns:min-content 1fr min-content}.woocommerce-report-table .woocommerce-table__compare.components-button{padding:8px}.woocommerce-report-table .woocommerce-ellipsis-menu{justify-self:flex-end}button.woocommerce-table__download-button{padding:6px 12px;color:#000;text-decoration:none;align-items:center}button.woocommerce-table__download-button svg{margin-left:8px;height:24px;width:24px}@media(max-width:782px){button.woocommerce-table__download-button svg{margin-left:0}button.woocommerce-table__download-button .woocommerce-table__download-button__label{display:none}}woocommerce-admin/dist/components/style.css000064400000255117151335517650015201 0ustar00:root{--wp-admin-theme-color:#007cba;--wp-admin-theme-color-darker-10:#006ba1;--wp-admin-theme-color-darker-20:#005a87}body.admin-color-light{--wp-admin-theme-color:#0085ba;--wp-admin-theme-color-darker-10:#0073a1;--wp-admin-theme-color-darker-20:#006187}body.admin-color-modern{--wp-admin-theme-color:#3858e9;--wp-admin-theme-color-darker-10:#2145e6;--wp-admin-theme-color-darker-20:#183ad6}body.admin-color-blue{--wp-admin-theme-color:#096484;--wp-admin-theme-color-darker-10:#07526c;--wp-admin-theme-color-darker-20:#064054}body.admin-color-coffee{--wp-admin-theme-color:#46403c;--wp-admin-theme-color-darker-10:#383330;--wp-admin-theme-color-darker-20:#2b2724}body.admin-color-ectoplasm{--wp-admin-theme-color:#523f6d;--wp-admin-theme-color-darker-10:#46365d;--wp-admin-theme-color-darker-20:#3a2c4d}body.admin-color-midnight{--wp-admin-theme-color:#e14d43;--wp-admin-theme-color-darker-10:#dd382d;--wp-admin-theme-color-darker-20:#d02c21}body.admin-color-ocean{--wp-admin-theme-color:#627c83;--wp-admin-theme-color-darker-10:#576e74;--wp-admin-theme-color-darker-20:#4c6066}body.admin-color-sunrise{--wp-admin-theme-color:#dd823b;--wp-admin-theme-color-darker-10:#d97426;--wp-admin-theme-color-darker-20:#c36922}.woocommerce-abbreviated-card a{display:flex;flex-direction:row;border-bottom:1px solid #e0e0e0;text-decoration:none}.woocommerce-abbreviated-card__icon{display:flex;align-items:center;padding:16px 24px}.woocommerce-abbreviated-card__icon svg{fill:#007cba;fill:var(--wp-admin-theme-color)}.woocommerce-calendar{width:100%;background-color:#f0f0f0;border-top:1px solid #ccc;height:396px}.woocommerce-calendar.is-mobile{height:100%}.woocommerce-calendar__react-dates{width:100%;overflow-x:hidden}.woocommerce-calendar__react-dates .DayPicker{margin:0 auto}.woocommerce-calendar__react-dates .CalendarMonth_table{margin-top:10px}.woocommerce-calendar__react-dates .CalendarDay__selected_span{background:#007cba;background:var(--wp-admin-theme-color);border:1px solid #ccc}.woocommerce-calendar__react-dates .CalendarDay__selected_span:hover{background:#006ba1;background:var(--wp-admin-theme-color-darker-10);border:1px solid #f0f0f0}.woocommerce-calendar__react-dates .CalendarDay__selected{background:#005a87;background:var(--wp-admin-theme-color-darker-20);border:1px solid #ccc}.woocommerce-calendar__react-dates .CalendarDay__hovered_span,.woocommerce-calendar__react-dates .CalendarDay__selected:hover{background:#006ba1;background:var(--wp-admin-theme-color-darker-10);border:1px solid #f0f0f0}.woocommerce-calendar__react-dates .CalendarDay__hovered_span{color:#fff}.woocommerce-calendar__react-dates .CalendarDay__hovered_span:hover{color:#fff;background:#007cba;background:var(--wp-admin-theme-color)}.woocommerce-calendar__react-dates .CalendarDay__blocked_out_of_range{color:#ccc}.woocommerce-calendar__react-dates .CalendarMonth,.woocommerce-calendar__react-dates .CalendarMonthGrid,.woocommerce-calendar__react-dates .DayPicker,.woocommerce-calendar__react-dates .DayPicker_transitionContainer{background-color:#f0f0f0}.woocommerce-calendar__react-dates .DayPicker_weekHeader_li{color:#757575}.woocommerce-calendar__react-dates .DayPickerNavigation_button:focus{outline:2px solid #bfe7f3}.woocommerce-calendar__react-dates.is-core-datepicker .components-datetime__date{padding-left:0}.woocommerce-calendar__react-dates.is-core-datepicker .CalendarDay__default{background-color:transparent}.woocommerce-calendar__react-dates.is-core-datepicker .CalendarDay__selected{background:#533582;border:none}.woocommerce-calendar__inputs{padding:1em;width:100%;max-width:500px;display:grid;grid-template-columns:43% 14% 43%;margin:0 auto}.woocommerce-calendar__inputs .components-base-control{margin:0}.woocommerce-calendar__inputs-to{display:flex;align-items:center;justify-content:center;grid-column-start:2}.woocommerce-calendar__input{position:relative}.woocommerce-calendar__input .calendar-icon{position:absolute;top:50%;transform:translateY(-50%);left:7px}.woocommerce-calendar__input .calendar-icon path{fill:#757575}.woocommerce-calendar__input:first-child{grid-column-start:1}.woocommerce-calendar__input:last-child{grid-column-start:3}.woocommerce-calendar__input.is-empty .calendar-icon path{fill:#757575}.woocommerce-calendar__input.is-error .calendar-icon path{fill:#d94f4f}.woocommerce-calendar__input.is-error .woocommerce-calendar__input-text{border:1px solid #d94f4f;box-shadow:inset 0 0 8px #d94f4f}.woocommerce-calendar__input.is-error .woocommerce-calendar__input-text:focus{box-shadow:inset 0 0 8px #d94f4f,0 0 6px rgba(30,140,190,.8)}.woocommerce-calendar__input .woocommerce-calendar__input-text{color:#757575;border-radius:3px;padding:10px 10px 10px 30px;width:100%;font-size:13px;font-size:.8125rem}.woocommerce-calendar__input .woocommerce-calendar__input-text::placeholder{color:#757575}.woocommerce-filters-date__content.is-mobile .woocommerce-calendar__input-error .components-popover__content{height:auto}.woocommerce-calendar__input-error{display:none}.is-error .woocommerce-calendar__input-text:focus+span .woocommerce-calendar__input-error{display:block;left:50%!important;position:absolute;top:auto!important}.woocommerce-calendar__input-error .components-popover__content{background-color:#757575;color:#fff;padding:.5em;border:none}.woocommerce-calendar__input-error.components-popover .components-popover__content{min-width:100px;width:100px;text-align:center}.woocommerce-calendar__input-error.components-popover:not(.no-arrow):not(.is-mobile).is-bottom:before{border-bottom-color:#757575;z-index:1;top:-6px}.woocommerce-calendar__input-error.components-popover:not(.no-arrow):not(.is-mobile).is-top:after{border-top-color:#757575;z-index:1;top:0}.woocommerce-calendar__date-picker-title{font-size:12px;font-size:.75rem;font-weight:100;text-transform:uppercase;text-align:center;color:#757575;width:100%;margin:0;padding:1em;background-color:#fff}.woocommerce-chart{margin-top:-16px;margin-bottom:24px;background:#fff;border:1px solid #e2e4e7;border-top:0}@media(max-width:782px){.woocommerce-chart{margin-left:-16px;margin-right:-16px;margin-bottom:12px;border-left:none;border-right:none;width:auto}}.woocommerce-chart .woocommerce-chart__header{min-height:50px;border-bottom:1px solid #e2e4e7;display:flex;flex-flow:row wrap;justify-content:space-between;align-items:center;width:100%}.woocommerce-chart .woocommerce-chart__header .woocommerce-chart__title{margin-left:24px;margin-right:16px}.woocommerce-chart .woocommerce-chart__body{display:flex;flex-direction:row;justify-content:flex-start;align-items:flex-start;width:100%}.woocommerce-chart .woocommerce-chart__body.woocommerce-chart__body-column{flex-direction:column}.woocommerce-chart .woocommerce-chart__footer{width:100%}.woocommerce-chart-placeholder{animation:loading-fade 1.6s ease-in-out infinite;background-color:#f0f0f0;color:transparent;padding:0;width:100%;display:flex;align-items:center;justify-content:center}.woocommerce-chart-placeholder:after{content:" "}@media screen and (prefers-reduced-motion:reduce){.woocommerce-chart-placeholder{animation:none}}.woocommerce-chart-placeholder .components-spinner{margin:0}.woocommerce-chart__interval-select{align-items:start;border-right:1px solid #e2e4e7;display:flex;flex-direction:column;justify-content:center;margin:0 0 0 auto;min-height:50px;padding:8px 16px 0}@media(max-width:960px){.woocommerce-chart__interval-select{width:100%;order:1;margin-top:-8px;margin-left:0;padding-left:8px;border-right:0;min-height:0}}#wpbody .woocommerce-chart__interval-select .components-select-control__input{font-size:13px;font-size:.8125rem;border:0;box-shadow:none}#wpbody .woocommerce-chart__interval-select .components-select-control__input .components-input-control__backdrop{display:none}#wpbody .woocommerce-chart__interval-select .components-select-control__input:not(:disabled):not([aria-disabled=true]):focus{background-color:#fff;color:#1e1e1e;box-shadow:inset 0 0 0 1px #757575,inset 0 0 0 2px #fff;outline:2px solid transparent;outline-offset:-2px}#wpbody .woocommerce-chart__interval-select .components-select-control__input:not(:disabled):not([aria-disabled=true]):focus~.components-input-control__backdrop{display:block}#wpbody .woocommerce-chart__interval-select .components-select-control__input~.components-input-control__backdrop{display:none}.woocommerce-chart__types{padding:0 8px;white-space:nowrap}.woocommerce-chart__type-button{background:transparent!important}.woocommerce-chart__type-button.components-button{color:#e2e4e7;display:inline-flex;padding:8px}.woocommerce-chart__type-button.components-button.woocommerce-chart__type-button-selected{color:#757575}@media(max-width:960px){.woocommerce-summary+.woocommerce-chart .woocommerce-chart__title{display:none}.woocommerce-summary+.woocommerce-chart .woocommerce-chart__interval-select{width:auto;order:0;margin-top:0}}.woocommerce-legend.has-total{padding-bottom:50px;position:relative}.woocommerce-legend.woocommerce-legend__direction-column{border-right:1px solid #ccc;min-width:320px}.woocommerce-chart__footer .woocommerce-legend.woocommerce-legend__direction-column{border-right:none}.woocommerce-legend__list{color:#24292d;display:flex;height:100%;margin:0}.woocommerce-legend__direction-column .woocommerce-legend__list{flex-direction:column;height:300px;overflow:auto}.woocommerce-chart__footer .woocommerce-legend__direction-column .woocommerce-legend__list{border-top:1px solid #ccc;height:100%;max-height:none;min-height:none}.has-total.woocommerce-legend__direction-column .woocommerce-legend__list{height:250px}.woocommerce-chart__footer .has-total.woocommerce-legend__direction-column .woocommerce-legend__list{height:auto;max-height:220px;min-height:none}.woocommerce-legend__direction-row .woocommerce-legend__list{flex-direction:row}.woocommerce-legend__item>button{display:flex;justify-content:center;align-items:center;background-color:#fff;color:#757575;cursor:pointer;display:inline-flex;flex-direction:row;flex-wrap:nowrap;justify-content:space-between;width:100%;border:none;padding:0}.woocommerce-legend__item>button .woocommerce-legend__item-container{display:flex;flex-direction:row;flex-wrap:nowrap;position:relative;padding:3px 0 3px 24px;font-size:13px;-webkit-user-select:none;user-select:none;width:100%}.woocommerce-legend__item>button .woocommerce-legend__item-container:hover input~.woocommerce-legend__item-checkmark{background-color:#e0e0e0}.woocommerce-legend__item>button .woocommerce-legend__item-container .woocommerce-legend__item-checkmark{border:1px solid #ccc;position:absolute;top:4px;left:0;height:16px;width:16px;background-color:#fff}.woocommerce-legend__item>button .woocommerce-legend__item-container .woocommerce-legend__item-checkmark:after{content:"";position:absolute;display:none}.woocommerce-legend__item>button .woocommerce-legend__item-container .woocommerce-legend__item-checkmark.woocommerce-legend__item-checkmark-checked{background-color:currentColor;border-color:currentColor}.woocommerce-legend__item>button .woocommerce-legend__item-container .woocommerce-legend__item-checkmark.woocommerce-legend__item-checkmark-checked:after{display:block;left:5px;top:2px;width:3px;height:6px;border:solid #fff;border-width:0 2px 2px 0;transform:rotate(45deg)/*!rtl:ignore*/}.rtl .woocommerce-legend__item>button .woocommerce-legend__item-container .woocommerce-legend__item-checkmark.woocommerce-legend__item-checkmark-checked:after{transform:rotate(45deg) scaleX(-1)}.woocommerce-legend__item>button .woocommerce-legend__item-container .woocommerce-legend__item-total{margin-left:auto;font-weight:700}.woocommerce-legend__item>button:focus{outline:none}.woocommerce-legend__item>button:focus .woocommerce-legend__item-container .woocommerce-legend__item-checkmark{outline:2px solid #ccc}.woocommerce-legend__item>button:hover{background-color:#f0f0f0}.woocommerce-legend__direction-column .woocommerce-legend__item{margin:0;padding:0}.woocommerce-legend__direction-column .woocommerce-legend__item>button{min-height:36px;padding:0 17px;text-align:left}.woocommerce-legend__direction-column .woocommerce-legend__item:first-child{margin-top:12px}.woocommerce-legend__direction-column .woocommerce-legend__item:last-child:after{content:"";display:block;height:12px;width:100%}.woocommerce-legend__direction-row .woocommerce-legend__item{padding:0;margin:0}.woocommerce-legend__direction-row .woocommerce-legend__item>button{padding:0 17px}.woocommerce-legend__direction-row .woocommerce-legend__item>button .woocommerce-legend__item-container{height:50px;align-items:center}.woocommerce-legend__direction-row .woocommerce-legend__item>button .woocommerce-legend__item-container .woocommerce-legend__item-checkmark{top:17px}.woocommerce-legend__direction-row .woocommerce-legend__item>button .woocommerce-legend__item-container .woocommerce-legend__item-title{margin-right:17px}.woocommerce-legend__total{align-items:center;background:#fff;border-top:1px solid #ccc;bottom:0;color:#757575;display:flex;height:50px;justify-content:center;left:0;position:absolute;right:0;text-transform:uppercase}.woocommerce-legend__total:before{background:linear-gradient(180deg,transparent,rgba(0,0,0,.2));bottom:100%;content:"";height:20px;left:0;opacity:0;pointer-events:none;position:absolute;right:0;transition:opacity .3s}.is-scrollable .woocommerce-legend__total:before{opacity:1}.woocommerce-chart__body-row .d3-chart__container{width:calc(100% - 320px)}.d3-chart__container{position:relative;width:100%}.d3-chart__container svg{overflow:visible}.d3-chart__container .d3-chart__empty-message{align-items:center;bottom:0;color:#757575;display:flex;font-size:18px;font-size:1.125rem;font-weight:700;justify-content:center;left:0;line-height:1.5;margin:0 auto;max-width:50%;padding-bottom:48px;pointer-events:none;position:absolute;right:0;top:0;text-align:center}@media(max-width:782px){.d3-chart__container .d3-chart__empty-message{font-size:13px;font-size:.8125rem}}.d3-chart__container .d3-chart__tooltip{border:1px solid #ccc;position:absolute;display:flex;min-width:324px;height:auto;background-color:#fff;text-align:left;padding:17px;box-shadow:0 3px 20px 0 rgba(18,24,30,.1),0 1px 3px 0 rgba(18,24,30,.1);flex-direction:column;flex-wrap:nowrap;justify-content:flex-start;pointer-events:none;visibility:hidden;z-index:1}@media(max-width:600px){.d3-chart__container .d3-chart__tooltip{min-width:auto;width:calc(100% - 48px)}}.d3-chart__container .d3-chart__tooltip h4{text-align:left;line-height:18px;width:100%;text-transform:uppercase;font-size:11px;color:#757575;margin-top:0}.d3-chart__container .d3-chart__tooltip ul{list-style:none;margin-bottom:2px;margin-top:2px;font-size:14px}.d3-chart__container .d3-chart__tooltip ul li{display:flex;flex-direction:row;flex-wrap:nowrap;justify-content:flex-start;align-items:center}.d3-chart__container .d3-chart__tooltip ul li.key-row{display:flex;flex-direction:row;justify-content:space-between;width:100%}.d3-chart__container .d3-chart__tooltip ul li.key-row .key-container{width:100%;min-width:100px}.d3-chart__container .d3-chart__tooltip ul li.key-row .key-container .key-color{display:inline-block;width:16px;height:16px;margin-right:8px}.d3-chart__container .d3-chart__tooltip ul li.key-row .key-container .key-key{margin-right:6px}.d3-chart__container .d3-chart__tooltip ul li.key-row .key-value{font-weight:600}.d3-chart__container .bargrouprect{shape-rendering:crispEdges}.d3-chart__container .grid .tick line{stroke:#f0f0f0;stroke-width:1;shape-rendering:crispEdges}.d3-chart__container .grid .tick:first-child line{stroke:#757575}.d3-chart__container .grid.with-positive-ticks .tick:last-child line{opacity:0}.d3-chart__container .tick{padding-top:10px;stroke-width:1}.d3-chart__container .y-axis{text-anchor:start}.d3-chart__container .y-axis.ticktext{fill:#757575}.d3-chart__container .axis-month .tick text,.d3-chart__container .y-axis .tick text{font-size:10px}.d3-chart__container .focus-grid line{stroke:rgba(0,0,0,.1);stroke-width:1px}.d3-chart__container .barfocus{fill:rgba(0,0,0,.1)}.d3-base{background:transparent;overflow-x:auto;overflow-y:hidden;position:relative;width:100%;height:100%}.woocommerce-page .woocommerce-dropdown-button{background-color:#fff;position:relative;border:1px solid #757575;color:#1e1e1e;border-radius:4px;padding:0 40px 0 0;width:100%;height:auto}.woocommerce-page .woocommerce-dropdown-button:after{content:"";background:#1e1e1e;-webkit-mask:url(data:image/svg+xml;charset=US-ASCII,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M5%206l5%205%205-5%202%201-7%207-7-7%202-1z%22%20%2F%3E%3C%2Fsvg%3E) no-repeat right 0 top 55%;mask:url(data:image/svg+xml;charset=US-ASCII,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M5%206l5%205%205-5%202%201-7%207-7-7%202-1z%22%20%2F%3E%3C%2Fsvg%3E) no-repeat right 0 top 55%;position:absolute;right:14px;width:32px;height:48px}.woocommerce-page .woocommerce-dropdown-button.is-open:after{transform:translateX(12px) translateY(2px) rotate(180deg)}.woocommerce-page .woocommerce-dropdown-button.is-open,.woocommerce-page .woocommerce-dropdown-button:active,.woocommerce-page .woocommerce-dropdown-button:hover{color:#007cba;color:var(--wp-admin-theme-color)}.woocommerce-page .woocommerce-dropdown-button.is-open:after,.woocommerce-page .woocommerce-dropdown-button:active:after,.woocommerce-page .woocommerce-dropdown-button:hover:after{background:#007cba;background:var(--wp-admin-theme-color)}.woocommerce-page .woocommerce-dropdown-button.is-multi-line .woocommerce-dropdown-button__labels{flex-direction:column}.woocommerce-page .woocommerce-dropdown-button:not(:focus):not(.is-open){border-color:#757575}.woocommerce-dropdown-button__labels{text-align:left;padding:8px 12px;min-height:48px;display:flex;align-items:center;width:100%;justify-content:space-around}@media(max-width:400px){.woocommerce-dropdown-button__labels{min-height:46px}}.woocommerce-dropdown-button__labels span{width:100%;text-align:left}.woocommerce-dropdown-button__labels span:last-child{font-size:12px;font-size:.75rem;margin:0}.woocommerce-dropdown-button__labels span:first-child{font-size:13px;font-size:.8125rem;font-weight:600}@media(max-width:400px){.woocommerce-dropdown-button__labels span:last-child{font-size:10px;font-size:.625rem}.woocommerce-dropdown-button__labels span:first-child{font-size:12px;font-size:.75rem}}.woocommerce-ellipsis-menu{text-align:center}.woocommerce-ellipsis-menu .woocommerce-ellipsis-menu__toggle{justify-content:center;vertical-align:middle;width:24px;padding:0}.woocommerce-ellipsis-menu .woocommerce-ellipsis-menu__toggle .gridicon{transform:rotate(90deg)}.woocommerce-ellipsis-menu__popover{text-align:left}.woocommerce-ellipsis-menu__popover:not(.is-mobile):after,.woocommerce-ellipsis-menu__popover:not(.is-mobile):before{margin-left:-16px}.woocommerce-ellipsis-menu__popover .components-popover__content{width:182px;padding:2px}.woocommerce-ellipsis-menu__popover .woocommerce-ellipsis-menu__content{width:100%}.woocommerce-ellipsis-menu__popover .woocommerce-ellipsis-menu__item,.woocommerce-ellipsis-menu__popover .woocommerce-ellipsis-menu__title{padding:4px 12px}.woocommerce-ellipsis-menu__popover .woocommerce-ellipsis-menu__item{cursor:pointer;color:#757575}.woocommerce-ellipsis-menu__popover .woocommerce-ellipsis-menu__item:focus{box-shadow:inset 0 0 0 1px #6c7781,inset 0 0 0 2px #fff;outline:2px solid transparent;outline-offset:-2px}.woocommerce-ellipsis-menu__popover .woocommerce-ellipsis-menu__item .components-form-toggle{margin-right:8px}.woocommerce-ellipsis-menu__popover .components-base-control__label,.woocommerce-ellipsis-menu__popover .woocommerce-ellipsis-menu__title{color:#1e1e1e;padding-top:8px;padding-bottom:8px;font-size:15px;font-size:.9375rem;margin-bottom:4px}.woocommerce-ellipsis-menu__popover .components-toggle-control .components-base-control__field{margin:4px 0}.woocommerce-ellipsis-menu__popover .components-base-control{margin:0}.woocommerce-empty-content{margin-bottom:16px;text-align:center}.woocommerce-empty-content .woocommerce-empty-content__illustration{max-width:100%}.woocommerce-empty-content .woocommerce-empty-content__actions .components-button+.components-button{margin-left:16px}.woocommerce-filters-advanced{margin:24px 0}.woocommerce-filters-advanced .components-card__body{background-color:#f0f0f0;overflow:initial}.woocommerce-filters-advanced .components-card__body.is-size-small:hover,.woocommerce-filters-advanced .components-card__body ul li:hover{background-color:#e0e0e0}.woocommerce-filters-advanced .components-select-control .components-input-control__container .components-select-control__input{height:38px;padding:0 0 0 8px;margin:0}.woocommerce-filters-advanced .components-card__header .components-base-control__field{margin-bottom:0}.woocommerce-filters-advanced .components-card__header p{display:flex;line-height:38px}@media(max-width:782px){.woocommerce-filters-advanced{margin:16px 0;border:1px solid #ccc}}@media(max-width:400px){.woocommerce-filters-advanced{margin:12px 0}}.woocommerce-filters-advanced .woocommerce-filters-advanced__title-select{width:70px;display:inline-block;margin:0 8px}.woocommerce-filters-advanced__list{margin:0}.woocommerce-filters-advanced__list-item{padding:0 16px 0 0;margin:0;display:grid;grid-template-columns:1fr 40px;border-bottom:1px solid #ccc}.woocommerce-filters-advanced__list-item:hover{background-color:#e0e0e0}.woocommerce-filters-advanced__list-item .woocommerce-filters-advanced__line-item:first-child{grid-column-start:1;grid-column-end:2;grid-row-start:1;grid-row-end:2}.woocommerce-filters-advanced__list-item .woocommerce-filters-advanced__line-item:nth-child(2){grid-column-start:2;grid-column-end:3;grid-row-start:1;grid-row-end:2}.woocommerce-filters-advanced__list-item fieldset{padding:8px 8px 8px 16px}.woocommerce-filters-advanced__list-item .woocommerce-filters-advanced__remove{width:40px;height:38px;align-self:center;color:#757575;padding:8px}@media(max-width:400px){.woocommerce-filters-advanced__list-item .woocommerce-filters-advanced__remove{position:absolute;top:0;right:4px}}.woocommerce-filters-advanced__list-item .components-form-token-field{border-radius:4px}@media(max-width:400px){.woocommerce-filters-advanced__list-item{display:block;position:relative;padding:8px 8px 0 0}}.woocommerce-filters-advanced__add-filter{margin:0;display:block}.woocommerce-filters-advanced__add-filter div div{display:inline-block}.woocommerce-filters-advanced__add-filter .components-popover:not(.is-mobile) .components-popover__content{min-width:180px}.woocommerce-filters-advanced__add-filter .components-popover__content>div{width:100%}.woocommerce-filters-advanced__fieldset{display:flex;align-items:center}.woocommerce-filters-advanced__fieldset>div{padding:0 4px}@media(max-width:782px){.woocommerce-filters-advanced__fieldset>div{width:100%;padding:4px 0}}@media(max-width:782px){.woocommerce-filters-advanced__fieldset{display:block}}.woocommerce-filters-advanced__fieldset.is-english{display:grid;grid-template-columns:100px 150px 1fr}.woocommerce-filters-advanced__fieldset.is-english .woocommerce-filters-advanced__fieldset-item:first-child{grid-column-start:1;grid-column-end:2;grid-row-start:1;grid-row-end:2}.woocommerce-filters-advanced__fieldset.is-english .woocommerce-filters-advanced__fieldset-item:nth-child(2){grid-column-start:2;grid-column-end:3;grid-row-start:1;grid-row-end:2}.woocommerce-filters-advanced__fieldset.is-english .woocommerce-filters-advanced__fieldset-item:nth-child(3){grid-column-start:3;grid-column-end:4;grid-row-start:1;grid-row-end:2}.woocommerce-filters-advanced__fieldset.is-english .woocommerce-filters-advanced__fieldset-item:first-child{display:flex;align-items:center}.woocommerce-filters-advanced__fieldset.is-english .woocommerce-filters-advanced__fieldset-item .components-base-control__field{margin-bottom:0}@media(max-width:782px){.woocommerce-filters-advanced__fieldset.is-english{display:block}}.woocommerce-filters-advanced__rule{width:150px}.woocommerce-filters-advanced__input{width:100%}.woocommerce-filters-advanced__input.woocommerce-search.woocommerce-select-control .woocommerce-select-control__control{height:38px}.woocommerce-filters-advanced__add-filter-dropdown{display:inline-block}.woocommerce-filters-advanced__add-button{align-items:center;color:#757575;padding:8px}.woocommerce-filters-advanced__add-button svg{fill:currentColor;margin:0 6px 0 0}.woocommerce-filters-advanced__controls .components-button{margin-right:16px}.woocommerce-filters-advanced__add-dropdown{padding:8px 0}.woocommerce-filters-advanced__add-dropdown li{margin:0}.woocommerce-filters-advanced__add-dropdown .components-button{width:100%;padding:8px}.woocommerce-filters-advanced__add-dropdown .components-button:hover{background-color:#e0e0e0}.woocommerce-filters-advanced__add-dropdown .components-button:not(:disabled):not([aria-disabled=true]):focus{background-color:#f0f0f0;box-shadow:none}.woocommerce-filters-advanced__input-range{align-items:center;display:grid;grid-template-columns:1fr}.woocommerce-filters-advanced__input-range.is-between{grid-template-columns:1fr 36px 1fr}.woocommerce-filters-advanced__input-range input{height:38px;margin:0}.woocommerce-filters-advanced__input-range .separator{text-align:center}.woocommerce-filters-advanced__attribute-fieldset{align-items:center;display:grid;grid-template-columns:1fr 20px 1fr}.woocommerce-filters-advanced__attribute-fieldset .woocommerce-filters-advanced__attribute-field-separator{padding:0 6px}.woocommerce-filters-date__content.is-mobile .components-popover__header{border:none;height:0}.woocommerce-filters-date__content.is-mobile .components-popover__close{transform:translateY(22px)}.woocommerce-filters-date__content.is-mobile .components-tab-panel__tab-content{height:calc(100% - 46px);overflow:auto}.woocommerce-filters-date__content.components-dropdown__content .components-popover__content>div{padding:0}.woocommerce-filters-date__tabs{height:calc(100% - 42px);border-top:1px solid #ccc}.woocommerce-filters-date__tabs .components-tab-panel__tabs{display:flex;justify-content:space-between}.woocommerce-filters-date__tabs .components-tab-panel__tabs .components-button{display:block;text-align:center;width:50%}.woocommerce-filters-date__tabs .components-tab-panel__tab-content{display:flex;flex-direction:column;align-items:center}.woocommerce-filters-date__tabs:first-child{grid-column-start:1;grid-column-end:2;grid-row-start:1;grid-row-end:2}.woocommerce-filters-date__tabs:nth-child(2){grid-column-start:2;grid-column-end:3;grid-row-start:1;grid-row-end:2}.woocommerce-filters-date__text{font-size:12px;font-size:.75rem;font-weight:100;text-transform:uppercase;text-align:center;color:#757575;width:100%;margin:0;padding:1em;background-color:#fff}.woocommerce-filters-date__content-controls{display:flex;flex-direction:column;width:100%;align-items:center;padding-bottom:1em;background-color:#fff}.woocommerce-filters-date__content-controls.is-custom{border-top:1px solid #ccc}.woocommerce-filters-date__button-group{padding-top:1em;display:flex;justify-content:center;width:100%}.woocommerce-filters-date__button-group .woocommerce-filters-date__button{justify-content:center;width:40%;height:34px;margin:0 12px}.woocommerce-filters-filter__content.is-mobile .components-popover__header-title{font-size:12px;font-size:.75rem;font-weight:100;text-transform:uppercase;text-align:center;color:#757575}.woocommerce-filters-filter__content.is-mobile .woocommerce-filters-filter__content-list-item:last-child{border-bottom:1px solid #ccc}.woocommerce-filters-filter__content-list{margin:0;width:100%;min-width:100%}.woocommerce-filters-filter__content-list-item{border:1px solid transparent;border-bottom-color:#ccc;margin:0}.woocommerce-filters-filter__content-list-item:last-child{border-bottom:1px solid transparent}.woocommerce-filters-filter__content-list-item.is-selected .woocommerce-filters-filter__button,.woocommerce-filters-filter__content-list-item.is-selected .woocommerce-filters-filter__button.components-button:not(:disabled):not([aria-disabled=true]):focus{background-color:#fff}.woocommerce-filters-filter__content-list-item.is-selected .woocommerce-filters-filter__button:before{content:"";width:8px;height:8px;background-color:#7f54b3;position:absolute;top:50%;left:1em;transform:translate(50%,-50%)}.woocommerce-filters-filter__content-list-item .woocommerce-filters-filter__button{position:relative;align-items:center;display:flex;width:100%;padding:1em 1em 1em 3em;background-color:#f0f0f0;text-align:left}.woocommerce-filters-filter__content-list-item .woocommerce-filters-filter__button.components-button{color:#757575}.woocommerce-filters-filter__content-list-item .woocommerce-filters-filter__button:hover{background-color:#e0e0e0;color:#757575}.woocommerce-filters-filter__content-list-item .woocommerce-filters-filter__button.components-button:not(:disabled):not([aria-disabled=true]):focus{background-color:#f0f0f0}.woocommerce-filters-filter__content-list-item .woocommerce-filters-filter__button svg{position:absolute;left:1em}.woocommerce-filters .components-base-control__field{margin-bottom:0}@media(max-width:400px){.woocommerce-filters{margin-left:-8px;margin-right:-8px}}.woocommerce-filters__basic-filters{display:flex;margin-bottom:24px}@media(max-width:1280px){.woocommerce-filters__basic-filters{flex-direction:column}}@media(max-width:782px){.woocommerce-filters__basic-filters{margin-bottom:16px}}.woocommerce-filters__advanced-filters .components-card__body{background-color:#f0f0f0}.woocommerce-filters__advanced-filters .components-card__footer .components-button{margin-right:16px}.woocommerce-filters-filter{width:25%;padding:0 12px;min-height:82px;display:flex;flex-direction:column;justify-content:flex-end}.woocommerce-filters-filter:first-child{padding-left:0}.woocommerce-filters-filter:last-child{padding-right:0}@media(max-width:1440px){.woocommerce-filters-filter{width:33.3%}}@media(max-width:1280px){.woocommerce-filters-filter{width:50%;padding:0;min-height:78px}}@media(max-width:782px){.woocommerce-filters-filter{width:100%}}.woocommerce-filters-label{margin:7px 0;display:block}@media(max-width:1280px){.woocommerce-filters-label{margin:5px 0}}.woocommerce-filters-date__content .components-popover__content,.woocommerce-filters-filter__content .components-popover__content{width:320px;border:1px solid #ccc;background-color:#fff}.woocommerce-filters-date__content .woocommerce-calendar__input-error .components-popover__content,.woocommerce-filters-filter__content .woocommerce-calendar__input-error .components-popover__content{background-color:#757575}.woocommerce-filters-date__content.is-mobile .components-popover__content,.woocommerce-filters-filter__content.is-mobile .components-popover__content{width:100%;height:100%;border:none}.woocommerce-filters-filter__search .woocommerce-search__autocomplete-results{position:static}.woocommerce-filters-filter__search .woocommerce-search__inline-container{overflow:hidden}.woocommerce-filters-filter__search .woocommerce-search__inline-container:not(.is-active){border:none}.woocommerce-filters-advanced__list-item .components-base-control+.components-base-control{margin-bottom:0}.woocommerce-flag span{vertical-align:middle}.woocommerce-flag .woocommerce-flag__fallback{background:#f0f0f0;color:transparent;width:24px;height:18px;display:block;overflow:hidden}.woocommerce-image-upload .woocommerce-image-upload__image-preview{font-size:16px;margin-right:2em}.woocommerce-image-upload .woocommerce-image-upload__image-preview img{max-width:240px;height:auto}.woocommerce-image-upload .woocommerce-image-upload__add-image{margin:16px 0}.woocommerce-image-upload.has-image{display:flex;align-items:center}.woocommerce-list{margin:0;padding:0}a.woocommerce-list__item{color:inherit}.woocommerce-list__item{display:flex;align-items:center;margin-bottom:0;text-decoration:none;background-color:#fff}.woocommerce-list__item.has-gutters{padding:16px 24px}.woocommerce-list__item.has-action{cursor:pointer}.woocommerce-list__item:focus{box-shadow:inset 0 0 0 1px #006088,inset 0 0 0 2px #fff}.woocommerce-list__item:focus-visible{box-shadow:none}.woocommerce-list__item:not(.transitions-disabled).woocommerce-list__item-enter{opacity:0;max-height:0;transform:translateX(50%)}.woocommerce-list__item:not(.transitions-disabled).woocommerce-list__item-enter-active{opacity:1;max-height:100vh;transform:translateX(0);transition:opacity .5s,transform .5s,max-height .5s}.woocommerce-list__item:not(.transitions-disabled).woocommerce-list__item-exit{opacity:1;max-height:100vh;transform:translateX(0)}.woocommerce-list__item:not(.transitions-disabled).woocommerce-list__item-exit-active{opacity:0;max-height:0;transform:translateX(50%);transition:opacity .5s,transform .5s,max-height .5s}.woocommerce-list__item>.woocommerce-list__item-inner{text-decoration:none;width:100%;display:flex;align-items:center;padding:16px 24px}.woocommerce-list__item>.woocommerce-list__item-inner:focus{box-shadow:inset 0 0 0 1px #006088,inset 0 0 0 2px #fff}.woocommerce-list__item .woocommerce-list__item-title{color:#1d2327}.woocommerce-list__item .woocommerce-list__item-content{margin-top:4px;display:block;font-size:14px;line-height:20px;color:#50575d}.woocommerce-list__item .woocommerce-list__item-before{margin-right:20px;display:flex;align-items:center}.woocommerce-list__item .woocommerce-list__item-after{display:flex;align-items:center;margin-left:auto}.woocommerce-list__item:not(:first-child){border-top:1px solid #f0f0f0}.woocommerce-list__item:hover{background-color:#f0f0f0}.woocommerce-list__item:hover .woocommerce-list__item-title{color:#007cba;color:var(--wp-admin-theme-color)}.woocommerce-list__item:hover .woocommerce-list__item-before>svg{fill:#007cba;fill:var(--wp-admin-theme-color)}.woocommerce-list__item .woocommerce-list__item-title,.woocommerce-list__item .woocommerce-list__item-title>div{color:#007cba;color:var(--wp-admin-theme-color)}.woocommerce-list__item .woocommerce-list__item-before>svg{fill:#007cba;fill:var(--wp-admin-theme-color)}.woocommerce-list__item .woocommerce-list__item-after>svg{fill:#1e1e1e}.woocommerce-list__item.is-complete .woocommerce-task__icon{background-color:#007cba;background-color:var(--wp-admin-theme-color)}.woocommerce-list__item.is-complete .woocommerce-list__item-title{color:#757575}.woocommerce-list__item.is-complete .woocommerce-list__item-content{display:none}.woocommerce-list__item-title{color:#2c3338}.woocommerce-list__item-content{color:#646970}.woocommerce-order-status{display:flex;align-items:center}.woocommerce-order-status__indicator{min-width:16px;width:16px;height:16px;display:block;background:#ccc;margin-right:8px;border-radius:50%;border:3px solid #f0f0f0}.woocommerce-order-status__indicator.is-processing{background:#4ab866;border-color:#93d5a4}.woocommerce-order-status__indicator.is-on-hold{background:#ffb900;border-color:#ffd566}.woocommerce-pagination{display:flex;flex-direction:row;flex-wrap:nowrap;justify-content:center;align-items:center}@media(max-width:782px){.woocommerce-pagination{flex-direction:column}}.woocommerce-pagination input{border-radius:4px}.woocommerce-pagination__page-arrows{display:flex;flex-direction:row}.woocommerce-pagination__page-arrows-buttons{display:inline-flex;align-items:baseline;border:1px solid #b5bfc9;border-radius:4px;background:#f0f2f4}.woocommerce-pagination__page-arrows-buttons .components-button{color:#24292d;height:30px;width:32px;justify-content:center}.woocommerce-pagination__page-arrows-buttons .components-button:not(:disabled):not([aria-disabled=true]):hover{color:#757575}.woocommerce-pagination__page-arrows-buttons button:first-child{border-top-right-radius:0;border-bottom-right-radius:0;border-right:2px solid #d3d9de}.woocommerce-pagination__page-arrows-buttons button:last-child{border-top-left-radius:0;border-bottom-left-radius:0}.woocommerce-pagination__page-arrows-buttons .woocommerce-pagination__link{padding:4px}.woocommerce-pagination__page-arrows-label{margin-top:8px;margin-right:8px}.woocommerce-pagination__page-picker{margin-left:16px}@media(max-width:782px){.woocommerce-pagination__page-picker{margin-top:16px;margin-left:0}}.woocommerce-pagination__page-picker .woocommerce-pagination__page-picker-input{margin-left:8px;width:60px;height:34px;box-shadow:none}.woocommerce-pagination__per-page-picker{margin-left:16px}@media(max-width:782px){.woocommerce-pagination__per-page-picker{margin-top:16px;margin-left:0}}.woocommerce-pagination__per-page-picker .components-base-control{margin-bottom:0}.woocommerce-pagination__per-page-picker .components-base-control .components-base-control__field{display:flex;flex-direction:row;align-items:baseline;margin-bottom:0}.woocommerce-pagination__per-page-picker .components-base-control .components-select-control__input{width:60px;height:34px;box-shadow:none}.woocommerce-pagination__per-page-picker .components-base-control .components-base-control__label{margin-right:8px}.woocommerce-pagination__page-picker-input.has-error,.woocommerce-pagination__page-picker-input.has-error:focus{border-color:#d94f4f;box-shadow:0 0 2px #d94f4f}.woocommerce-pill{border:1px solid #757575;border-radius:28px;color:#757575;display:inline-block;padding:4px 8px}@media(max-width:320px){.woocommerce-pill{font-size:11px}}.woocommerce-product-image{border-radius:2px}.woocommerce-rating{position:relative;vertical-align:middle;display:inline-block;overflow:hidden;white-space:nowrap}.woocommerce-rating .gridicon{fill:#e0e0e0}.woocommerce-rating .woocommerce-rating__star-outline{position:absolute;left:0;top:0;white-space:nowrap;overflow:hidden}.woocommerce-rating .woocommerce-rating__star-outline .gridicon{fill:#757575}.woocommerce-search.woocommerce-select-control{position:relative}.woocommerce-search.woocommerce-select-control .woocommerce-select-control__control-icon{position:absolute;top:50%;left:10px;transform:translateY(-50%);color:#ccc;font-size:20px}.woocommerce-search.woocommerce-select-control:not(.has-inline-tags) .woocommerce-tag{margin:8px 6px 0 0}.woocommerce-search.woocommerce-select-control .woocommerce-select-control__control{height:auto;font-size:13px;width:100%;padding:3px 2px 3px 36px;border-radius:4px;border:1px solid #757575;box-shadow:0 2px 6px rgba(0,0,0,.05)}.woocommerce-search.woocommerce-select-control .woocommerce-select-control__control.is-active{border-color:#007cba;border-color:var(--wp-admin-theme-color)}.woocommerce-search.woocommerce-select-control .components-base-control .woocommerce-select-control__control-input{margin:0;font-size:13px;min-height:auto}.woocommerce-search.woocommerce-select-control .components-base-control .woocommerce-select-control__control-input[type=number]::-webkit-inner-spin-button,.woocommerce-search.woocommerce-select-control .components-base-control .woocommerce-select-control__control-input[type=number]::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}.woocommerce-search.woocommerce-select-control .components-base-control .components-base-control__label{font-size:13px;color:#72777c;margin:0;width:calc(100% - 36px);top:50%;left:36px}.woocommerce-search.woocommerce-select-control.has-inline-tags .has-tags.components-base-control .components-base-control__label,.woocommerce-search.woocommerce-select-control .is-active.components-base-control .components-base-control__label,.woocommerce-search.woocommerce-select-control .with-value.components-base-control .components-base-control__label{display:none}.woocommerce-search.woocommerce-select-control .components-base-control .woocommerce-select-control__tags{margin:0}.woocommerce-search.woocommerce-select-control .components-base-control .woocommerce-tag{max-height:24px}.woocommerce-search.woocommerce-select-control .woocommerce-select-control__listbox{border:1px solid #ccc;top:38px}.woocommerce-search.woocommerce-select-control.is-static-results .woocommerce-select-control__listbox{position:static}.woocommerce-search.woocommerce-select-control .woocommerce-select-control__option{margin-bottom:0;display:flex;flex-direction:row;flex-grow:1;flex-shrink:0;align-items:center;padding:12px;color:#7f54b3;text-align:left;background:#f0f0f0;border-bottom:1px solid #f0f0f0;font-size:13px;min-height:43px;height:auto}.woocommerce-search.woocommerce-select-control .woocommerce-select-control__option:last-of-type{border-bottom:none}.woocommerce-search.woocommerce-select-control .woocommerce-select-control__option:hover{box-shadow:none;color:#7f54b3;background:#e0e0e0}.woocommerce-search.woocommerce-select-control .woocommerce-select-control__option.is-selected,.woocommerce-search.woocommerce-select-control .woocommerce-select-control__option:active,.woocommerce-search.woocommerce-select-control .woocommerce-select-control__option:focus{color:#7f54b3;background:#fff;box-shadow:inset 0 0 0 1px #e0e0e0,inset 0 0 0 2px #24292d}.woocommerce-search.woocommerce-select-control .woocommerce-select-control__option .woocommerce-search__result-thumbnail{margin-right:12px}.woocommerce-search__result-name{text-decoration:underline}.woocommerce-search-list{width:100%;padding:0 0 16px;text-align:left}.woocommerce-search-list__selected{margin:16px 0;padding:16px 0 0;min-height:76px;border-top:1px solid #f0f0f0}.woocommerce-search-list__selected .woocommerce-search-list__selected-header{margin-bottom:8px}.woocommerce-search-list__selected .woocommerce-search-list__selected-header button{margin-left:12px}.woocommerce-search-list__selected .woocommerce-tag__text{max-width:13em}.woocommerce-search-list__selected ul{list-style:none}.woocommerce-search-list__selected ul li{float:left}.woocommerce-search-list__search{margin:16px 0;padding:16px 0 0;border-top:1px solid #f0f0f0}.woocommerce-search-list__search .components-base-control__field{margin-bottom:16px}.woocommerce-search-list__list{border:1px solid #e0e0e0;padding:0;max-height:17em;overflow-x:hidden;overflow-y:auto}.woocommerce-search-list__list li{margin-bottom:0}.woocommerce-search-list__list.is-loading,.woocommerce-search-list__list.is-not-found{padding:12px 0;text-align:center;border:none}.woocommerce-search-list__list.is-not-found .woocommerce-search-list__not-found-icon,.woocommerce-search-list__list.is-not-found .woocommerce-search-list__not-found-text{display:inline-block}.woocommerce-search-list__list.is-not-found .woocommerce-search-list__not-found-icon{margin-right:16px}.woocommerce-search-list__list.is-not-found .woocommerce-search-list__not-found-icon .gridicon{vertical-align:top;margin-top:-1px}.woocommerce-search-list__list .components-spinner{float:none;margin:0 auto}.woocommerce-search-list__list .components-menu-group__label{clip:rect(1px,1px,1px,1px);-webkit-clip-path:inset(50%);clip-path:inset(50%);height:1px;width:1px;margin:-1px;overflow:hidden;overflow-wrap:normal!important;word-wrap:normal!important}.woocommerce-search-list__list>[role=menu]{border:1px solid #f0f0f0;border-bottom:none}.woocommerce-search-list__list .woocommerce-search-list__item{display:flex;align-items:center;margin-bottom:0;padding:12px 16px;background:#fff;border-bottom:1px solid #f0f0f0;color:#757575}.woocommerce-search-list__list .woocommerce-search-list__item:active,.woocommerce-search-list__list .woocommerce-search-list__item:focus,.woocommerce-search-list__list .woocommerce-search-list__item:hover{background:#f0f0f0}.woocommerce-search-list__list .woocommerce-search-list__item:active,.woocommerce-search-list__list .woocommerce-search-list__item:focus{box-shadow:none}.woocommerce-search-list__list .woocommerce-search-list__item .woocommerce-search-list__item-input{margin:0 8px 0 0}.woocommerce-search-list__list .woocommerce-search-list__item .woocommerce-search-list__item-label{display:flex;flex:1}.woocommerce-search-list__list .woocommerce-search-list__item.depth-0+.depth-1{margin-top:-1px}.woocommerce-search-list__list .woocommerce-search-list__item:not(.depth-0){border-bottom:0!important}.woocommerce-search-list__list .woocommerce-search-list__item:not(.depth-0)+.depth-0{border-top:1px solid #f0f0f0}.woocommerce-search-list__list .woocommerce-search-list__item[class*=depth-] .woocommerce-search-list__item-label:before{margin-right:4px;content:"— — — — — "}.woocommerce-search-list__list .woocommerce-search-list__item.depth-0 .woocommerce-search-list__item-label:before{margin-right:0;content:""}.woocommerce-search-list__list .woocommerce-search-list__item.depth-1 .woocommerce-search-list__item-label:before{content:"— "}.woocommerce-search-list__list .woocommerce-search-list__item.depth-2 .woocommerce-search-list__item-label:before{content:"— — "}.woocommerce-search-list__list .woocommerce-search-list__item.depth-3 .woocommerce-search-list__item-label:before{content:"— — — "}.woocommerce-search-list__list .woocommerce-search-list__item.depth-4 .woocommerce-search-list__item-label:before{content:"— — — — "}.woocommerce-search-list__list .woocommerce-search-list__item .woocommerce-search-list__item-name{display:inline-block}.woocommerce-search-list__list .woocommerce-search-list__item .woocommerce-search-list__item-prefix{display:none;color:#757575}.woocommerce-search-list__list .woocommerce-search-list__item.is-searching .woocommerce-search-list__item-label,.woocommerce-search-list__list .woocommerce-search-list__item.is-skip-level .woocommerce-search-list__item-label{display:inline-block}.woocommerce-search-list__list .woocommerce-search-list__item.is-searching .woocommerce-search-list__item-prefix,.woocommerce-search-list__list .woocommerce-search-list__item.is-skip-level .woocommerce-search-list__item-prefix{display:inline}.woocommerce-search-list__list .woocommerce-search-list__item.is-searching .woocommerce-search-list__item-prefix:after,.woocommerce-search-list__list .woocommerce-search-list__item.is-skip-level .woocommerce-search-list__item-prefix:after{margin-right:4px;content:" ›"}.woocommerce-search-list__list .woocommerce-search-list__item.is-searching .woocommerce-search-list__item-name{color:#1e1e1e}.woocommerce-search-list__list .woocommerce-search-list__item.has-count>.components-menu-item__item{width:100%}.woocommerce-search-list__list .woocommerce-search-list__item .woocommerce-search-list__item-count{flex:0 1 auto;padding:2px 8px;border:1px solid #f0f0f0;border-radius:12px;font-size:.8em;line-height:1.4;color:#757575;background:#fff;white-space:nowrap}.woocommerce-search-list__list li:last-child .woocommerce-search-list__item{border-bottom:none}.woocommerce-search-list.is-compact .woocommerce-search-list__selected{margin:0 0 16px;padding:0;border-top:none;min-height:54px}.woocommerce-search-list.is-compact .woocommerce-search-list__search{margin:0 0 16px;padding:0;border-top:none}.woocommerce-section-header{padding:13px;border-bottom:none;display:flex;justify-content:space-between}@media(max-width:782px){.woocommerce-section-header{margin-left:-16px;margin-right:-16px;margin-bottom:12px;border-left:none;border-right:none;width:auto}}.woocommerce-section-header hr{align-self:center;flex-grow:1;height:1px;margin:0 10px}@media(max-width:782px){.woocommerce-section-header.has-interval-select{position:relative;padding-bottom:30px}.woocommerce-section-header.has-interval-select .woocommerce-chart__interval-select{position:absolute;left:0;bottom:0;padding-left:6px}}.woocommerce-section-header__actions,.woocommerce-section-header__menu{text-align:right}.woocommerce-section-header__actions{display:flex;flex-grow:1;justify-content:flex-end}.woocommerce-section-header__actions .components-base-control{padding-top:0;min-height:34px}.woocommerce-section-header__actions .components-base-control .components-base-control__field{margin-bottom:0}.woocommerce-section-header__actions .components-base-control .components-base-control__field select{background:transparent}.woocommerce-ellipsis-menu__toggle{padding:0}.woocommerce-section-header__menu{display:flex;flex-direction:column;justify-content:center}.woocommerce-section-header__title{margin:0 16px 0 0;padding:3px 0;font-size:20px;font-size:1.25rem;line-height:2.2;font-weight:400}.woocommerce-segmented-selection{width:100%;color:#757575}.woocommerce-segmented-selection__container{width:100%;grid-template-columns:1fr 1fr;display:grid;border-top:1px solid #ccc;border-bottom:1px solid #ccc;background-color:#ccc}.woocommerce-segmented-selection__item:nth-child(2n){border-left:1px solid #ccc;border-top:1px solid #ccc}.woocommerce-segmented-selection__item:nth-child(odd){border-top:1px solid #ccc}.woocommerce-segmented-selection__item:nth-child(-n+2){border-top:0}.woocommerce-segmented-selection__label{background-color:#f0f0f0;padding:12px 12px 12px 36px;position:relative;display:block;height:100%}.woocommerce-segmented-selection__label:active,.woocommerce-segmented-selection__label:hover{background-color:#e0e0e0}.woocommerce-segmented-selection__input{opacity:0;position:absolute;left:-9999px}.woocommerce-segmented-selection__input:active+label .woocommerce-segmented-selection__label{background-color:#e0e0e0}.woocommerce-segmented-selection__input:checked+label .woocommerce-segmented-selection__label{background-color:#fff;font-weight:600}.woocommerce-segmented-selection__input:checked+label .woocommerce-segmented-selection__label:before{content:"";width:8px;height:8px;background-color:#007cba;background-color:var(--wp-admin-theme-color);position:absolute;top:50%;transform:translate(-20px,-50%)}.woocommerce-segmented-selection__input:focus+label .woocommerce-segmented-selection__label{box-shadow:inset 0 0 0 1px #24292d}.woocommerce-select-control{position:relative}.woocommerce-select-control .components-base-control{height:56px;display:flex;align-items:center;border:1px solid #a7aaad;border-radius:3px;background:#fff;padding:12px;position:relative}.woocommerce-select-control .components-base-control .woocommerce-select-control__tags{margin:12px 4px 0 0}.woocommerce-select-control .components-base-control .woocommerce-tag{max-height:20px}.woocommerce-select-control .components-base-control .components-base-control__field{display:flex;align-items:center;flex:1;margin-bottom:0;max-width:100%}.woocommerce-select-control .components-base-control .components-base-control__label{position:absolute;top:50%;transform:translateY(-50%);color:#646970;font-size:16px}.woocommerce-select-control .components-base-control .woocommerce-select-control__control-input{font-size:16px;border:0;box-shadow:none;color:#2c3338;margin:12px 0 0;padding-left:0;padding-right:0;width:100%;line-height:24px;text-align:left;letter-spacing:inherit;background:transparent}.woocommerce-select-control .components-base-control .woocommerce-select-control__control-input::-webkit-search-cancel-button{display:none}.woocommerce-select-control .components-base-control .woocommerce-select-control__control-input:focus{outline:none}.woocommerce-select-control .components-base-control i{color:#636d75;margin-right:12px;width:24px}.woocommerce-select-control .components-base-control.is-active{box-shadow:0 0 0 1px #006088;border-color:#006088}.woocommerce-select-control .components-base-control.has-tags .components-base-control__label,.woocommerce-select-control .components-base-control.with-value .components-base-control__label{font-size:12px;margin-top:-12px}.woocommerce-select-control .components-base-control.is-disabled{opacity:.5}.woocommerce-select-control .components-base-control.is-disabled .components-base-control__label{cursor:default}.woocommerce-select-control .woocommerce-select-control__autofill-input{position:absolute;z-index:-1}.woocommerce-select-control .woocommerce-select-control__tags{position:relative;margin:12px 0 0}.woocommerce-select-control .woocommerce-select-control__tags.has-clear{padding-right:24px}.woocommerce-select-control .woocommerce-tag{max-height:24px}.woocommerce-select-control .woocommerce-select-control__clear{position:absolute;right:10px;top:calc(50% - 10px)}.woocommerce-select-control .woocommerce-select-control__clear>.clear-icon{color:#c9c9c9}.woocommerce-select-control .woocommerce-select-control__listbox{background:#fff;display:flex;flex-direction:column;align-items:stretch;box-shadow:0 3px 5px rgba(0,0,0,.2),0 1px 18px rgba(0,0,0,.12),0 6px 10px rgba(0,0,0,.14);border-radius:3px;position:absolute;left:0;right:0;top:57px;z-index:10;overflow-y:auto;max-height:350px}.woocommerce-select-control .woocommerce-select-control__listbox.is-static{position:static}.woocommerce-select-control .woocommerce-select-control__option{padding:16px;min-height:56px;font-size:16px;text-align:left}.woocommerce-select-control .woocommerce-select-control__option.is-selected,.woocommerce-select-control .woocommerce-select-control__option:hover{background:#f6f7f7}.woocommerce-select-control.is-searchable .components-base-control__label{left:48px}.woocommerce-select-control.is-searchable .components-base-control.is-active .components-base-control__label{font-size:12px;margin-top:-12px}.woocommerce-stepper .woocommerce-stepper__steps{display:flex;justify-content:space-around;margin-bottom:24px}.woocommerce-stepper .woocommerce-stepper__step{padding:8px;font-weight:400;position:relative}.woocommerce-stepper .woocommerce-stepper__step .woocommerce-stepper__step-label-wrapper{display:flex;text-align:left;border:0;background-color:transparent;padding:0}.woocommerce-stepper .woocommerce-stepper__step .woocommerce-stepper__step-label-wrapper:focus{outline:none;box-shadow:none}.woocommerce-stepper .woocommerce-stepper__step button.woocommerce-stepper__step-label-wrapper{cursor:pointer}.woocommerce-stepper .woocommerce-stepper__step .woocommerce-stepper__step-text{width:100%}.woocommerce-stepper .woocommerce-stepper__step .woocommerce-stepper__step-label{color:#1e1e1e;line-height:24px;font-size:16px}.woocommerce-stepper .woocommerce-stepper__step .woocommerce-stepper__step-description{display:none;font-size:14px;color:#757575;font-weight:400;margin-top:2px}.woocommerce-stepper .woocommerce-stepper__step .woocommerce-stepper__step-icon svg{display:none}.woocommerce-stepper .woocommerce-stepper__step .woocommerce-spinner{display:block;margin-right:12px;max-height:24px;min-width:24px;width:24px;border-radius:50%;background:#007cba;background:var(--wp-admin-theme-color)}.woocommerce-stepper .woocommerce-stepper__step .woocommerce-spinner__circle{stroke:#fff}.woocommerce-stepper .woocommerce-stepper__step.is-active .woocommerce-stepper__step-icon,.woocommerce-stepper .woocommerce-stepper__step.is-complete .woocommerce-stepper__step-icon{background:#007cba;background:var(--wp-admin-theme-color);color:#fff}.woocommerce-stepper .woocommerce-stepper__step.is-active .woocommerce-stepper__step-label,.woocommerce-stepper .woocommerce-stepper__step.is-complete .woocommerce-stepper__step-label{color:#1e1e1e}.woocommerce-stepper .woocommerce-stepper__step.is-active .woocommerce-stepper__step-icon{font-weight:600}.woocommerce-stepper .woocommerce-stepper__step.is-active .woocommerce-stepper__step-label{font-weight:600;margin:0}.woocommerce-stepper .woocommerce-stepper__step.is-complete .woocommerce-stepper__step-number{display:none}.woocommerce-stepper .woocommerce-stepper__step.is-complete svg{display:inline}.woocommerce-stepper .woocommerce-stepper__step-icon{font-size:16px;display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;min-width:24px;margin-right:12px;background:#f0f0f0;color:#757575;border-radius:50%}.woocommerce-stepper .woocommerce-stepper__step-divider{align-self:flex-start;flex-grow:1;border-bottom:1px solid #f0f0f0;margin-top:20px}.woocommerce-stepper .woocommerce-stepper__step-divider:last-child{display:none}@media(max-width:782px){.woocommerce-stepper .woocommerce-stepper__step-label{display:none;padding-top:24px}.woocommerce-stepper .woocommerce-stepper__step-icon{margin-right:0}}.woocommerce-stepper.is-vertical .woocommerce-stepper__steps{align-items:normal;flex-direction:column;margin-bottom:0}.woocommerce-stepper.is-vertical .woocommerce-stepper__step{padding-bottom:36px}.woocommerce-stepper.is-vertical .woocommerce-stepper__step:after{content:"";position:absolute;left:20px;top:40px;height:calc(100% - 40px);border-left:1px solid #f0f0f0}.woocommerce-stepper.is-vertical .woocommerce-stepper__step:last-child{padding-bottom:8px}.woocommerce-stepper.is-vertical .woocommerce-stepper__step:last-child:after{display:none}.woocommerce-stepper.is-vertical .woocommerce-stepper__step-label{display:initial}.woocommerce-stepper.is-vertical .woocommerce-stepper__step-icon{margin-right:12px}.woocommerce-stepper.is-vertical .woocommerce-stepper__step-description{display:block}.woocommerce-stepper.is-vertical .woocommerce-stepper_content{margin-top:16px;margin-left:36px}@keyframes rotate{0%{transform:rotate(0deg)}to{transform:rotate(270deg)}}@keyframes growAndShrink{0%,to{stroke-dashoffset:200}50%{stroke-dashoffset:50;transform:rotate(135deg)}to{transform:rotate(450deg)}}.woocommerce-spinner{animation:rotate 2s linear infinite;width:40px;min-width:40px;height:40px;max-height:40px}.woocommerce-spinner__circle{stroke-dasharray:200;stroke-dashoffset:0;transform-origin:center;animation:growAndShrink 2s ease-in-out infinite;stroke:#1d2327}.woocommerce-summary{margin:16px 0;display:grid;border-color:#e0e0e0;border-style:solid;border-width:1px 0 0 1px;background-color:#f0f0f0;box-shadow:inset -1px -1px 0 #e0e0e0;width:100%}@media(max-width:782px){.woocommerce-summary{border-width:0}.woocommerce-summary.is-placeholder{border-top:0}.woocommerce-summary .woocommerce-summary__item-container.is-placeholder{border-top:1px solid #e0e0e0}}.woocommerce-summary .components-popover:not(.components-tooltip){position:static!important;top:auto!important;left:auto!important;right:auto!important;bottom:auto!important;margin-top:0!important;margin-left:0}.woocommerce-summary .components-popover:not(.components-tooltip) .components-popover__header{display:none}.woocommerce-summary .components-popover:not(.components-tooltip) .components-popover__content{position:static;left:auto;right:auto;margin:0;width:100%;max-width:100%!important;max-height:100%!important;box-shadow:none;border:none;transform:none}.woocommerce-summary .components-popover:not(.components-tooltip) .components-popover__content .woocommerce-summary__item.is-selected{display:none}.components-popover__content .woocommerce-summary{max-height:100%;margin-top:0;margin-bottom:0;overflow-y:auto;border:none}.woocommerce-summary .woocommerce-summary__item-delta,.woocommerce-summary .woocommerce-summary__item-value{flex:1 0 auto}.woocommerce-summary .woocommerce-summary__item-delta{flex:0 1 auto;display:flex}.woocommerce-summary,.woocommerce-summary.has-1-items,.woocommerce-summary.has-one-item{grid-template-columns:1fr}.woocommerce-summary.has-2-items{grid-template-columns:repeat(2,1fr)}.woocommerce-summary.has-2-items .woocommerce-summary__item-container:nth-of-type(2n) .woocommerce-summary__item{border-right-color:#e0e0e0}.woocommerce-summary.has-2-items .woocommerce-summary__item-container:nth-of-type(odd):nth-last-of-type(-n+2) .woocommerce-summary__item,.woocommerce-summary.has-2-items .woocommerce-summary__item-container:nth-of-type(odd):nth-last-of-type(-n+2)~.woocommerce-summary__item-container .woocommerce-summary__item{border-bottom-color:#e0e0e0}.woocommerce-summary.has-3-items{grid-template-columns:repeat(3,1fr)}.woocommerce-summary.has-3-items .woocommerce-summary__item-container:nth-of-type(3n) .woocommerce-summary__item{border-right-color:#e0e0e0}.woocommerce-summary.has-3-items .woocommerce-summary__item-container:nth-of-type(3n+1):nth-last-of-type(-n+3) .woocommerce-summary__item,.woocommerce-summary.has-3-items .woocommerce-summary__item-container:nth-of-type(3n+1):nth-last-of-type(-n+3)~.woocommerce-summary__item-container .woocommerce-summary__item{border-bottom-color:#e0e0e0}.woocommerce-summary.has-4-items,.woocommerce-summary.has-7-items,.woocommerce-summary.has-8-items{grid-template-columns:repeat(4,1fr)}.woocommerce-summary.has-4-items .woocommerce-summary__item-container:nth-of-type(4n) .woocommerce-summary__item,.woocommerce-summary.has-7-items .woocommerce-summary__item-container:nth-of-type(4n) .woocommerce-summary__item,.woocommerce-summary.has-8-items .woocommerce-summary__item-container:nth-of-type(4n) .woocommerce-summary__item{border-right-color:#e0e0e0}.woocommerce-summary.has-4-items .woocommerce-summary__item-container:nth-of-type(4n+1):nth-last-of-type(-n+4) .woocommerce-summary__item,.woocommerce-summary.has-4-items .woocommerce-summary__item-container:nth-of-type(4n+1):nth-last-of-type(-n+4)~.woocommerce-summary__item-container .woocommerce-summary__item,.woocommerce-summary.has-7-items .woocommerce-summary__item-container:nth-of-type(4n+1):nth-last-of-type(-n+4) .woocommerce-summary__item,.woocommerce-summary.has-7-items .woocommerce-summary__item-container:nth-of-type(4n+1):nth-last-of-type(-n+4)~.woocommerce-summary__item-container .woocommerce-summary__item,.woocommerce-summary.has-8-items .woocommerce-summary__item-container:nth-of-type(4n+1):nth-last-of-type(-n+4) .woocommerce-summary__item,.woocommerce-summary.has-8-items .woocommerce-summary__item-container:nth-of-type(4n+1):nth-last-of-type(-n+4)~.woocommerce-summary__item-container .woocommerce-summary__item{border-bottom-color:#e0e0e0}.woocommerce-summary.has-5-items{grid-template-columns:repeat(5,1fr)}.woocommerce-summary.has-5-items .woocommerce-summary__item-container:nth-of-type(5n) .woocommerce-summary__item{border-right-color:#e0e0e0}.woocommerce-summary.has-5-items .woocommerce-summary__item-container:nth-of-type(5n+1):nth-last-of-type(-n+5) .woocommerce-summary__item,.woocommerce-summary.has-5-items .woocommerce-summary__item-container:nth-of-type(5n+1):nth-last-of-type(-n+5)~.woocommerce-summary__item-container .woocommerce-summary__item{border-bottom-color:#e0e0e0}.woocommerce-summary.has-5-items.is-placeholder .woocommerce-summary__item-prev-label,.woocommerce-summary.has-5-items .woocommerce-summary__item-value .woocommerce-summary__item-prev-label{margin-right:calc(100% - 80px)}@media(min-width:1441px){.woocommerce-summary.has-6-items{grid-template-columns:repeat(6,1fr)}.woocommerce-summary.has-6-items .woocommerce-summary__item-container:nth-of-type(6n) .woocommerce-summary__item{border-right-color:#e0e0e0}.woocommerce-summary.has-6-items .woocommerce-summary__item-container:nth-of-type(6n+1):nth-last-of-type(-n+6) .woocommerce-summary__item,.woocommerce-summary.has-6-items .woocommerce-summary__item-container:nth-of-type(6n+1):nth-last-of-type(-n+6)~.woocommerce-summary__item-container .woocommerce-summary__item{border-bottom-color:#e0e0e0}.woocommerce-summary.has-6-items.is-placeholder .woocommerce-summary__item-prev-label,.woocommerce-summary.has-6-items .woocommerce-summary__item-value .woocommerce-summary__item-prev-label{margin-right:calc(100% - 80px)}.woocommerce-summary.has-9-items,.woocommerce-summary.has-10-items{grid-template-columns:repeat(5,1fr)}.woocommerce-summary.has-9-items .woocommerce-summary__item-container:nth-of-type(5n) .woocommerce-summary__item,.woocommerce-summary.has-10-items .woocommerce-summary__item-container:nth-of-type(5n) .woocommerce-summary__item{border-right-color:#e0e0e0}.woocommerce-summary.has-9-items .woocommerce-summary__item-container:nth-of-type(5n+1):nth-last-of-type(-n+5) .woocommerce-summary__item,.woocommerce-summary.has-9-items .woocommerce-summary__item-container:nth-of-type(5n+1):nth-last-of-type(-n+5)~.woocommerce-summary__item-container .woocommerce-summary__item,.woocommerce-summary.has-10-items .woocommerce-summary__item-container:nth-of-type(5n+1):nth-last-of-type(-n+5) .woocommerce-summary__item,.woocommerce-summary.has-10-items .woocommerce-summary__item-container:nth-of-type(5n+1):nth-last-of-type(-n+5)~.woocommerce-summary__item-container .woocommerce-summary__item{border-bottom-color:#e0e0e0}.woocommerce-summary.has-9-items.is-placeholder .woocommerce-summary__item-prev-label,.woocommerce-summary.has-9-items .woocommerce-summary__item-value .woocommerce-summary__item-prev-label,.woocommerce-summary.has-10-items.is-placeholder .woocommerce-summary__item-prev-label,.woocommerce-summary.has-10-items .woocommerce-summary__item-value .woocommerce-summary__item-prev-label{margin-right:calc(100% - 80px)}}@media(max-width:1440px){.woocommerce-summary.has-4-items.is-placeholder .woocommerce-summary__item-prev-label,.woocommerce-summary.has-4-items .woocommerce-summary__item-value .woocommerce-summary__item-prev-label,.woocommerce-summary.has-7-items.is-placeholder .woocommerce-summary__item-prev-label,.woocommerce-summary.has-7-items .woocommerce-summary__item-value .woocommerce-summary__item-prev-label,.woocommerce-summary.has-8-items.is-placeholder .woocommerce-summary__item-prev-label,.woocommerce-summary.has-8-items .woocommerce-summary__item-value .woocommerce-summary__item-prev-label{margin-right:calc(100% - 80px)}.woocommerce-summary.has-6-items,.woocommerce-summary.has-9-items{grid-template-columns:repeat(3,1fr)}.woocommerce-summary.has-6-items .woocommerce-summary__item-container:nth-of-type(3n) .woocommerce-summary__item,.woocommerce-summary.has-9-items .woocommerce-summary__item-container:nth-of-type(3n) .woocommerce-summary__item{border-right-color:#e0e0e0}.woocommerce-summary.has-6-items .woocommerce-summary__item-container:nth-of-type(3n+1):nth-last-of-type(-n+3) .woocommerce-summary__item,.woocommerce-summary.has-6-items .woocommerce-summary__item-container:nth-of-type(3n+1):nth-last-of-type(-n+3)~.woocommerce-summary__item-container .woocommerce-summary__item,.woocommerce-summary.has-9-items .woocommerce-summary__item-container:nth-of-type(3n+1):nth-last-of-type(-n+3) .woocommerce-summary__item,.woocommerce-summary.has-9-items .woocommerce-summary__item-container:nth-of-type(3n+1):nth-last-of-type(-n+3)~.woocommerce-summary__item-container .woocommerce-summary__item{border-bottom-color:#e0e0e0}.woocommerce-summary.has-10-items{grid-template-columns:repeat(4,1fr)}.woocommerce-summary.has-10-items .woocommerce-summary__item-container:nth-of-type(4n) .woocommerce-summary__item{border-right-color:#e0e0e0}.woocommerce-summary.has-10-items .woocommerce-summary__item-container:nth-of-type(4n+1):nth-last-of-type(-n+4) .woocommerce-summary__item,.woocommerce-summary.has-10-items .woocommerce-summary__item-container:nth-of-type(4n+1):nth-last-of-type(-n+4)~.woocommerce-summary__item-container .woocommerce-summary__item{border-bottom-color:#e0e0e0}.woocommerce-summary.has-10-items.is-placeholder .woocommerce-summary__item-prev-label,.woocommerce-summary.has-10-items .woocommerce-summary__item-value .woocommerce-summary__item-prev-label{margin-right:calc(100% - 80px)}.woocommerce-summary.has-9-items .woocommerce-summary__item-container:nth-of-type(5n) .woocommerce-summary__item,.woocommerce-summary.has-10-items .woocommerce-summary__item-container:nth-of-type(5n) .woocommerce-summary__item{border-right-color:#e0e0e0}}@media(max-width:960px){.woocommerce-summary .woocommerce-summary__item{border-right-color:#e0e0e0}}@media(max-width:782px){.woocommerce-summary .woocommerce-summary__item-container{margin-left:-16px;margin-right:-16px;width:auto}.woocommerce-summary .woocommerce-summary__item-container .woocommerce-summary__item{border-right:none}.woocommerce-summary .components-popover.components-popover{margin-left:-16px;margin-right:-16px}.woocommerce-summary .components-popover.components-popover .woocommerce-summary__item-container{margin-left:0;margin-right:0}}.woocommerce-summary__item-container{margin-bottom:0}.woocommerce-summary__item-container:last-of-type .woocommerce-summary__item{border-bottom-color:#e0e0e0!important}.woocommerce-summary__item-container.is-dropdown-button{padding:0;list-style:none;border-right:1px solid #e0e0e0}.woocommerce-summary__item-container.is-dropdown-button .components-button{border-bottom:1px solid #e0e0e0;text-align:left;display:block}@media(max-width:782px){.woocommerce-summary__item-container.is-dropdown-button{border-right:none}}.woocommerce-summary__item-container.is-placeholder .woocommerce-summary__item{height:117px}.woocommerce-summary__item-container.is-placeholder .woocommerce-summary__item-label{animation:loading-fade 1.6s ease-in-out infinite;background-color:#f0f0f0;color:transparent;display:inline-block;height:20px;margin-top:2.2px;max-width:110px;width:70%}.woocommerce-summary__item-container.is-placeholder .woocommerce-summary__item-label:after{content:" "}@media screen and (prefers-reduced-motion:reduce){.woocommerce-summary__item-container.is-placeholder .woocommerce-summary__item-label{animation:none}}.woocommerce-summary__item-container.is-placeholder .woocommerce-summary__item-data{justify-content:space-between}.woocommerce-summary__item-container.is-placeholder .woocommerce-summary__item-value{animation:loading-fade 1.6s ease-in-out infinite;background-color:#f0f0f0;color:transparent;display:inline-block;height:28px;width:60px;max-width:60px}.woocommerce-summary__item-container.is-placeholder .woocommerce-summary__item-value:after{content:" "}@media screen and (prefers-reduced-motion:reduce){.woocommerce-summary__item-container.is-placeholder .woocommerce-summary__item-value{animation:none}}.woocommerce-summary__item-container.is-placeholder .woocommerce-summary__item-delta{animation:loading-fade 1.6s ease-in-out infinite;background-color:#f0f0f0;color:transparent;width:60px;border-radius:2px}.woocommerce-summary__item-container.is-placeholder .woocommerce-summary__item-delta:after{content:" "}@media screen and (prefers-reduced-motion:reduce){.woocommerce-summary__item-container.is-placeholder .woocommerce-summary__item-delta{animation:none}}.woocommerce-summary__item{display:flex;flex-direction:column;height:100%;padding:24px;background-color:#f8f9fa;border-bottom:1px solid #e0e0e0;border-right:1px solid #e0e0e0;line-height:1.4em;text-decoration:none;color:#1e1e1e}.woocommerce-summary__item.components-button{height:auto;padding:16px;align-items:normal}.woocommerce-summary__item:hover{background-color:#f0f0f0}.woocommerce-summary__item:hover,.woocommerce-summary__item:hover .woocommerce-summary__item-label{color:#007cba;color:var(--wp-admin-theme-color)}.woocommerce-summary__item:active{background-color:#f0f0f0}.woocommerce-summary__item:focus{box-shadow:inset -1px 1px 0 #757575,inset 1px -1px 0 #757575!important}.woocommerce-summary__item.is-selected:focus{box-shadow:inset -1px -1px 0 #757575,inset 1px 0 0 #757575,inset 0 4px 0 #007cba!important;box-shadow:inset -1px -1px 0 #757575,inset 1px 0 0 #757575,inset 0 4px 0 var(--wp-admin-theme-color)!important}.is-dropdown-button .woocommerce-summary__item{position:relative;width:100%;padding-right:56px}@media(max-width:782px){.is-dropdown-button .woocommerce-summary__item{border-right:none}}.woocommerce-summary__item .woocommerce-summary__item-data{display:flex;justify-content:space-between}.woocommerce-summary__item .woocommerce-summary__item-label{display:block;margin-bottom:16px;color:#757575}.woocommerce-summary__item .woocommerce-summary__item-value{margin-bottom:4px;font-weight:500;color:#1e1e1e}.woocommerce-summary__item .woocommerce-summary__item-delta{padding:5px;border-radius:3px;height:min-content;background-color:#f0f0f0;color:#1e1e1e}.woocommerce-summary__item.is-selected{background:#fff;box-shadow:inset 0 4px 0 #007cba;box-shadow:inset 0 4px 0 var(--wp-admin-theme-color)}.woocommerce-summary__item.is-selected .woocommerce-summary__item-value{font-weight:600}.woocommerce-summary__item.is-selected .woocommerce-summary__item-delta{font-weight:400}.woocommerce-summary__item.is-good-trend .woocommerce-summary__item-delta{background-color:#4ab866;color:#fff}.woocommerce-summary__item.is-bad-trend .woocommerce-summary__item-delta{background-color:#d94f4f;color:#fff}.woocommerce-summary__item .woocommerce-summary__toggle{position:absolute;top:44px;right:16px;transition:transform .2s ease}@media screen and (prefers-reduced-motion:reduce){.woocommerce-summary__item .woocommerce-summary__toggle{transition:none}}.is-dropdown-expanded .woocommerce-summary__item .woocommerce-summary__toggle{transform:rotate(-180deg)}.components-popover__content .woocommerce-summary__item .woocommerce-summary__item-delta,.components-popover__content .woocommerce-summary__item .woocommerce-summary__item-label,.components-popover__content .woocommerce-summary__item .woocommerce-summary__item-value{margin-bottom:0}.woocommerce-table{margin-bottom:40px}.woocommerce-table .woocommerce-table__actions{display:inline-flex;justify-content:flex-end;align-items:center}.woocommerce-table .woocommerce-table__actions>*{margin-right:16px}.woocommerce-table .woocommerce-table__actions>:last-child{margin-right:0}.woocommerce-table .woocommerce-table__actions>div{width:100%}.woocommerce-table .components-card__footer{flex-direction:column}.woocommerce-table .components-card__footer>*{padding-right:0}.woocommerce-table.is-empty{align-items:center;background:#f0f0f0;color:#757575;display:flex;height:calc(17px + 1.1375rem + (33px + 1.1375rem)*var(--number-of-rows));justify-content:center;padding:16px;text-align:center}.woocommerce-table .woocommerce-pagination{margin-bottom:16px;z-index:1;background:#fff;position:relative}.woocommerce-table .components-card__header{align-items:center;text-align:left;display:grid;width:100%;grid-template-columns:auto 1fr auto}@media(max-width:960px){.woocommerce-table.has-search .woocommerce-table__actions{grid-gap:12px;grid-template-columns:auto 1fr;grid-row-start:2;grid-row-end:2;grid-column-start:1;grid-column-end:4;margin:0}}.woocommerce-table .woocommerce-search .woocommerce-select-control__control{height:38px}.woocommerce-table .woocommerce-compare-button{padding:3px 12px;height:auto}.woocommerce-table .woocommerce-ellipsis-menu{justify-content:flex-end;display:flex}.woocommerce-table__caption{font-size:24px;font-size:1.5rem;text-align:left}.components-card__body{position:relative}.woocommerce-table__table{overflow-x:auto}.woocommerce-table__table:after,.woocommerce-table__table:before{content:"";position:absolute;top:0;width:60px;height:100%;opacity:0;pointer-events:none;transition:opacity .3s;z-index:1}.woocommerce-table__table:after{right:0;background:linear-gradient(90deg,hsla(0,0%,100%,0),#fff)}.woocommerce-table__table:before{left:0;background:linear-gradient(90deg,#fff,hsla(0,0%,100%,0))}.woocommerce-table__table.is-scrollable-left:before,.woocommerce-table__table.is-scrollable-right:after{opacity:1}.woocommerce-table__table table{border-collapse:collapse;width:100%}.woocommerce-table__table tr:focus-within,.woocommerce-table__table tr:hover{background-color:#e0e0e0}.woocommerce-table__table tr:focus-within td,.woocommerce-table__table tr:focus-within th,.woocommerce-table__table tr:hover td,.woocommerce-table__table tr:hover th{background:transparent}.woocommerce-table__empty-item,.woocommerce-table__header,.woocommerce-table__item{padding:16px 24px}.woocommerce-table__header,.woocommerce-table__item{font-size:13px;font-size:.8125rem;text-align:left;border-bottom:1px solid #e2e4e7}.woocommerce-table__header>a:only-child,.woocommerce-table__item>a:only-child{display:block}.woocommerce-table__header a:focus,.woocommerce-table__header a:hover,.woocommerce-table__item a:focus,.woocommerce-table__item a:hover{color:#533582}.woocommerce-table__header .is-placeholder,.woocommerce-table__item .is-placeholder{animation:loading-fade 1.6s ease-in-out infinite;background-color:#f0f0f0;color:transparent;display:inline-block;height:16px;max-width:120px;width:80%}.woocommerce-table__header .is-placeholder:after,.woocommerce-table__item .is-placeholder:after{content:" "}@media screen and (prefers-reduced-motion:reduce){.woocommerce-table__header .is-placeholder,.woocommerce-table__item .is-placeholder{animation:none}}.woocommerce-table__header:not(.is-left-aligned),.woocommerce-table__item:not(.is-left-aligned){text-align:right}.woocommerce-table__header:not(.is-left-aligned) button,.woocommerce-table__item:not(.is-left-aligned) button{justify-content:flex-end;padding-right:24px;padding-left:24px}.woocommerce-table__header.is-numeric .is-placeholder,.woocommerce-table__item.is-numeric .is-placeholder{max-width:40px}.woocommerce-table__header .is-negative,.woocommerce-table__item .is-negative{color:#d94f4f;font-weight:700}.woocommerce-table__header.is-sorted,.woocommerce-table__item.is-sorted{background-color:#f0f0f0}.woocommerce-table__header.is-checkbox-column,.woocommerce-table__item.is-checkbox-column{width:33px;max-width:33px;padding-right:0;padding-left:16px}.woocommerce-table__header.is-checkbox-column+th,.woocommerce-table__item.is-checkbox-column+th{border-left:0}.woocommerce-table tr:last-child .woocommerce-table__item{border-bottom:0}.woocommerce-table__empty-item{text-align:center;font-size:18px;font-size:1.125rem;color:#757575;font-weight:700}@media(max-width:782px){.woocommerce-table__empty-item{font-size:13px;font-size:.8125rem}}th.woocommerce-table__item{font-weight:400}.woocommerce-table__header{padding:8px 24px;background-color:#f8f9fa;font-weight:700;white-space:nowrap}.woocommerce-table__header.is-left-aligned.is-sortable{padding-left:16px}.woocommerce-table__header.is-left-aligned.is-sortable svg{display:inline-flex;order:1;margin-left:0}.woocommerce-table__header .components-button.is-button{height:auto;width:100%;padding:8px 24px 8px 0;vertical-align:middle;line-height:1;border:none;background:transparent!important;box-shadow:none!important;align-items:center}.woocommerce-table__header .components-button.is-button:active,.woocommerce-table__header .components-button.is-button:hover{box-shadow:none!important}.woocommerce-table__header.is-sortable{padding:0}.woocommerce-table__header.is-sortable svg{visibility:hidden;margin-left:4px}.woocommerce-table__header.is-sortable .components-button:focus svg,.woocommerce-table__header.is-sortable .components-button:hover svg,.woocommerce-table__header.is-sortable.is-sorted .components-button svg{visibility:visible}.woocommerce-table__summary{text-align:center;margin:0}.woocommerce-table__summary-item{display:inline-block;margin-bottom:0;margin-left:8px;margin-right:8px}.woocommerce-table__summary-item .is-placeholder{animation:loading-fade 1.6s ease-in-out infinite;background-color:#f0f0f0;color:transparent;display:inline-block;height:16px;width:200px}.woocommerce-table__summary-item .is-placeholder:after{content:" "}@media screen and (prefers-reduced-motion:reduce){.woocommerce-table__summary-item .is-placeholder{animation:none}}.woocommerce-table__summary-item .woocommerce-table__summary-label,.woocommerce-table__summary-item .woocommerce-table__summary-value{display:inline-block}.woocommerce-table__summary-item .woocommerce-table__summary-label{margin-left:4px}.woocommerce-table__summary-item .woocommerce-table__summary-value{font-weight:600}.woocommerce-tag{display:inline-flex;margin:1px 4px 1px 0;overflow:hidden;vertical-align:middle}.woocommerce-tag .woocommerce-tag__remove,.woocommerce-tag .woocommerce-tag__text{display:inline-block;line-height:24px;background:#f0f0f0;transition:all .2s cubic-bezier(.4,1,.4,1)}.woocommerce-tag .woocommerce-tag__text{align-self:center;padding:0 8px;border-radius:12px;color:#757575;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.woocommerce-tag.has-remove .woocommerce-tag__text{padding:0 4px 0 8px;border-radius:12px 0 0 12px}.woocommerce-tag .woocommerce-tag__remove{cursor:pointer;height:inherit;padding:0 2px;border-radius:0 12px 12px 0;color:#757575;line-height:10px;text-indent:0;height:24px}.woocommerce-tag .woocommerce-tag__remove:hover{color:#1e1e1e}.muriel-input-text{background:#fff;border:1px solid #a7aaad;border-radius:3px;height:56px;box-shadow:none;padding:12px 12px 4px;position:relative;box-shadow:0 2px 6px rgba(0,0,0,.05)}.muriel-input-text:hover{border-color:#787c82}.muriel-input-text label{color:#646970;font-size:14px;line-height:21px}.muriel-input-text label.components-base-control__label{margin:0}.muriel-input-text .components-text-control__input,.muriel-input-text .components-text-control__input[type=color],.muriel-input-text .components-text-control__input[type=date],.muriel-input-text .components-text-control__input[type=datetime-local],.muriel-input-text .components-text-control__input[type=datetime],.muriel-input-text .components-text-control__input[type=email],.muriel-input-text .components-text-control__input[type=month],.muriel-input-text .components-text-control__input[type=number],.muriel-input-text .components-text-control__input[type=password],.muriel-input-text .components-text-control__input[type=tel],.muriel-input-text .components-text-control__input[type=text],.muriel-input-text .components-text-control__input[type=time],.muriel-input-text .components-text-control__input[type=url],.muriel-input-text .components-text-control__input[type=week]{border:0;box-shadow:none;font-size:16px;line-height:21px;margin:0;padding:0;min-height:30px}.muriel-input-text .components-text-control__input:focus,.muriel-input-text .components-text-control__input[type=color]:focus,.muriel-input-text .components-text-control__input[type=date]:focus,.muriel-input-text .components-text-control__input[type=datetime-local]:focus,.muriel-input-text .components-text-control__input[type=datetime]:focus,.muriel-input-text .components-text-control__input[type=email]:focus,.muriel-input-text .components-text-control__input[type=month]:focus,.muriel-input-text .components-text-control__input[type=number]:focus,.muriel-input-text .components-text-control__input[type=password]:focus,.muriel-input-text .components-text-control__input[type=tel]:focus,.muriel-input-text .components-text-control__input[type=text]:focus,.muriel-input-text .components-text-control__input[type=time]:focus,.muriel-input-text .components-text-control__input[type=url]:focus,.muriel-input-text .components-text-control__input[type=week]:focus{box-shadow:none}.muriel-input-text.active{box-shadow:0 0 0 2px #007cba;box-shadow:0 0 0 2px var(--wp-admin-theme-color);border-color:transparent}.muriel-input-text.active input{color:#2c3338}.muriel-input-text.with-value .components-base-control__label{display:block;position:relative;top:-8px;width:100%;font-size:12px}.muriel-input-text.with-value input{color:#2c3338;position:relative;top:-12px}.muriel-input-text.empty label{display:none}.muriel-input-text.empty input{color:#646970}.muriel-input-text.has-error{box-shadow:none}.muriel-input-text.disabled label{display:none}.muriel-input-text.disabled input{color:#a7aaad}.muriel-input-text.disabled input::placeholder{color:#a7aaad;opacity:1}.muriel-input-text.disabled input:-ms-input-placeholder{color:#a7aaad}.muriel-input-text.disabled input::-ms-input-placeholder{color:#a7aaad}.text-control-with-affixes{display:inline-flex;flex-direction:row;width:100%}.text-control-with-affixes input[type=email],.text-control-with-affixes input[type=number],.text-control-with-affixes input[type=password],.text-control-with-affixes input[type=text],.text-control-with-affixes input[type=url]{flex-grow:1;margin:0}.text-control-with-affixes input[type=email]:disabled,.text-control-with-affixes input[type=number]:disabled,.text-control-with-affixes input[type=password]:disabled,.text-control-with-affixes input[type=text]:disabled,.text-control-with-affixes input[type=url]:disabled{border-right-width:0}.text-control-with-affixes input[type=email]:disabled+.text-control-with-affixes__suffix,.text-control-with-affixes input[type=number]:disabled+.text-control-with-affixes__suffix,.text-control-with-affixes input[type=password]:disabled+.text-control-with-affixes__suffix,.text-control-with-affixes input[type=text]:disabled+.text-control-with-affixes__suffix,.text-control-with-affixes input[type=url]:disabled+.text-control-with-affixes__suffix{border-left:1px solid #f0f0f0}.text-control-with-affixes.text-control-with-prefix input{border-top-left-radius:0;border-bottom-left-radius:0}.text-control-with-affixes.text-control-with-suffix input{border-top-right-radius:0;border-bottom-right-radius:0}.text-control-with-affixes__prefix,.text-control-with-affixes__suffix{position:relative;background:#fff;border:1px solid #757575;color:#757575;padding:7px 14px;white-space:nowrap;flex:1 0 auto;font-size:14px;line-height:1.5}.disabled .text-control-with-affixes__prefix,.disabled .text-control-with-affixes__suffix{background:hsla(0,0%,100%,.5);border-color:hsla(0,0%,87.1%,.75);box-shadow:inset 0 1px 2px rgba(0,0,0,.04);color:rgba(51,51,51,.5)}.text-control-with-affixes__prefix{border-right:none;border-radius:4px 0 0 4px}.text-control-with-affixes__prefix+input[type=email]:disabled,.text-control-with-affixes__prefix+input[type=number]:disabled,.text-control-with-affixes__prefix+input[type=password]:disabled,.text-control-with-affixes__prefix+input[type=text]:disabled,.text-control-with-affixes__prefix+input[type=url]:disabled{border-left-color:#f0f0f0}.text-control-with-affixes__suffix{border-left:none;border-radius:0 4px 4px 0}.woocommerce-timeline ul{margin:0;padding-left:0;list-style-type:none}.woocommerce-timeline ul li{margin-bottom:0}.woocommerce-timeline .woocommerce-timeline-group .woocommerce-timeline-group__title{color:#1d2327;font-size:12px;font-weight:600;text-transform:uppercase;margin:0 0 16px;display:inline-block}.woocommerce-timeline .woocommerce-timeline-group hr{float:right;width:calc(100% - 40px);margin-bottom:16px;border:.5px solid #e3dfe2}.woocommerce-timeline .woocommerce-timeline-item .woocommerce-timeline-item__top-border{min-height:16px;border-left:1px solid #c3c4c7;margin:0 12px}.woocommerce-timeline .woocommerce-timeline-item .woocommerce-timeline-item__title{display:flex;align-items:center;flex-direction:row;justify-content:space-between;color:#2c3338}.woocommerce-timeline .woocommerce-timeline-item .woocommerce-timeline-item__title *{font-size:16px}.woocommerce-timeline .woocommerce-timeline-item .woocommerce-timeline-item__headline{display:flex;align-items:center;flex-direction:row;margin:8px 0}.woocommerce-timeline .woocommerce-timeline-item .woocommerce-timeline-item__headline *{margin:0}.woocommerce-timeline .woocommerce-timeline-item .woocommerce-timeline-item__headline>*{padding:0 16px}.woocommerce-timeline .woocommerce-timeline-item .woocommerce-timeline-item__headline svg{fill:#fff;padding:4px;background:#c3c4c7;border-radius:9999px;box-sizing:content-box;width:16px;height:16px}.woocommerce-timeline .woocommerce-timeline-item .woocommerce-timeline-item__headline svg.is-success{background:#4ab866}.woocommerce-timeline .woocommerce-timeline-item .woocommerce-timeline-item__headline svg.is-warning{background:#ffb900}.woocommerce-timeline .woocommerce-timeline-item .woocommerce-timeline-item__headline svg.is-error{background:#d94f4f}.woocommerce-timeline .woocommerce-timeline-item .woocommerce-timeline-item__timestamp{font-size:14px;line-height:16px}.woocommerce-timeline .woocommerce-timeline-item .woocommerce-timeline-item__body{display:flex;flex-direction:column;color:#50575e;margin:0 12px;padding:8px 36px;border-left:1px solid #c3c4c7}.woocommerce-timeline .woocommerce-timeline-item .woocommerce-timeline-item__body *{margin:0;font-size:14px}.woocommerce-timeline ul :last-child.woocommerce-timeline-group hr:last-child{display:none}.woocommerce-view-more-list{padding-left:4px;margin:0 0 0 4px;vertical-align:middle}.woocommerce-view-more-list__popover{margin:0;padding:16px;text-align:left}.woocommerce-view-more-list__popover__item{display:block;margin:16px 0}.woocommerce-view-more-list__popover__item:first-child{margin-top:0}.woocommerce-view-more-list__popover__item:last-child{margin-bottom:0}.woocommerce-web-preview{width:100%;display:flex;align-items:center;justify-content:center;background:#f6f7f7}.woocommerce-web-preview.is-loading .woocommerce-web-preview__iframe-wrapper{display:none}.woocommerce-web-preview .woocommerce-web-preview__iframe-wrapper{width:100%}.woocommerce-web-preview iframe{width:100%;height:100%;min-height:400px}.woocommerce-badge{background-color:#f0f0f0;border-radius:20px;display:inline-block;text-align:center;font-style:normal;font-weight:600;font-size:14px;line-height:27px;align-items:center;width:32px;height:28px}.woocommerce-component_dynamic-form .components-base-control{margin-top:16px;margin-bottom:16px;position:relative}.woocommerce-component_dynamic-form .components-base-control.has-error .components-base-control__help{left:0!important}woocommerce-admin/dist/components/index.js000064400002250305151335517650014770 0ustar00/*! For license information please see index.js.LICENSE.txt */
this.wc=this.wc||{},this.wc.components=function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=461)}([function(e,t){e.exports=window.wp.element},function(e,t,n){e.exports=n(47)()},function(e,t){e.exports=window.wp.i18n},function(e,t){e.exports=window.wp.components},function(e,t){e.exports=window.lodash},function(e,t){e.exports=window.React},function(e,t,n){!function(){"use strict";var t={}.hasOwnProperty;function n(){for(var e=[],r=0;r<arguments.length;r++){var o=arguments[r];if(o){var a=typeof o;if("string"===a||"number"===a)e.push(o);else if(Array.isArray(o)){if(o.length){var i=n.apply(null,o);i&&e.push(i)}}else if("object"===a)if(o.toString===Object.prototype.toString)for(var s in o)t.call(o,s)&&o[s]&&e.push(s);else e.push(o.toString())}}return e.join(" ")}e.exports?(n.default=n,e.exports=n):"function"==typeof define&&"object"==typeof define.amd&&define.amd?define("classnames",[],(function(){return n})):window.classNames=n}()},function(e,t){e.exports=window.wp.data},function(e,t){e.exports=window.wp.primitives},function(e,t){e.exports=window.moment},,function(e,t){e.exports=window.wc.data},function(e,t){e.exports=window.wc.navigation},,function(e,t){e.exports=window.wp.compose},function(e,t){e.exports=window.wp.url},,function(e,t){e.exports=window.wp.apiFetch},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o=s(n(5)),a=s(n(69)),i=s(n(72));function s(e){return e&&e.__esModule?e:{default:e}}var c=void 0;function l(e,t){var n,i,s,u,d,f,p,h,m=[],b={};for(f=0;f<e.length;f++)if("string"!==(d=e[f]).type){if(!t.hasOwnProperty(d.value)||void 0===t[d.value])throw new Error("Invalid interpolation, missing component node: `"+d.value+"`");if("object"!==r(t[d.value]))throw new Error("Invalid interpolation, component node must be a ReactElement or null: `"+d.value+"`","\n> "+c);if("componentClose"===d.type)throw new Error("Missing opening component token: `"+d.value+"`");if("componentOpen"===d.type){n=t[d.value],s=f;break}m.push(t[d.value])}else m.push(d.value);return n&&(u=function(e,t){var n,r,o=t[e],a=0;for(r=e+1;r<t.length;r++)if((n=t[r]).value===o.value){if("componentOpen"===n.type){a++;continue}if("componentClose"===n.type){if(0===a)return r;a--}}throw new Error("Missing closing component token `"+o.value+"`")}(s,e),p=l(e.slice(s+1,u),t),i=o.default.cloneElement(n,{},p),m.push(i),u<e.length-1&&(h=l(e.slice(u+1),t),m=m.concat(h))),1===m.length?m[0]:(m.forEach((function(e,t){e&&(b["interpolation-child-"+t]=e)})),(0,a.default)(b))}t.default=function(e){var t=e.mixedString,n=e.components,o=e.throwErrors;if(c=t,!n)return t;if("object"!==(void 0===n?"undefined":r(n))){if(o)throw new Error("Interpolation Error: unable to process `"+t+"` because components is not an object");return t}var a=(0,i.default)(t);try{return l(a,n)}catch(e){if(o)throw new Error("Interpolation Error: unable to process `"+t+"` because of error `"+e.message+"`");return t}}},function(e,t){e.exports=window.wc.date},,,function(e,t,n){"use strict";function r(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";function r(){return(r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.DISPLAY_FORMAT="L",t.ISO_FORMAT="YYYY-MM-DD",t.ISO_MONTH_FORMAT="YYYY-MM",t.START_DATE="startDate",t.END_DATE="endDate",t.HORIZONTAL_ORIENTATION="horizontal",t.VERTICAL_ORIENTATION="vertical",t.VERTICAL_SCROLLABLE="verticalScrollable",t.ICON_BEFORE_POSITION="before",t.ICON_AFTER_POSITION="after",t.INFO_POSITION_TOP="top",t.INFO_POSITION_BOTTOM="bottom",t.INFO_POSITION_BEFORE="before",t.INFO_POSITION_AFTER="after",t.ANCHOR_LEFT="left",t.ANCHOR_RIGHT="right",t.OPEN_DOWN="down",t.OPEN_UP="up",t.DAY_SIZE=39,t.BLOCKED_MODIFIER="blocked",t.WEEKDAYS=[0,1,2,3,4,5,6],t.FANG_WIDTH_PX=20,t.FANG_HEIGHT_PX=10,t.DEFAULT_VERTICAL_SPACING=22,t.MODIFIER_KEY_NAMES=new Set(["Shift","Control","Alt","Meta"])},function(e,t,n){"use strict";function r(e,t){return(r=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function o(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,r(e,t)}n.d(t,"a",(function(){return o}))},function(e,t,n){"use strict";var r=SyntaxError,o=Function,a=TypeError,i=function(e){try{return o('"use strict"; return ('+e+").constructor;")()}catch(e){}},s=Object.getOwnPropertyDescriptor;if(s)try{s({},"")}catch(e){s=null}var c=function(){throw new a},l=s?function(){try{return c}catch(e){try{return s(arguments,"callee").get}catch(e){return c}}}():c,u=n(196)(),d=Object.getPrototypeOf||function(e){return e.__proto__},f={},p="undefined"==typeof Uint8Array?void 0:d(Uint8Array),h={"%AggregateError%":"undefined"==typeof AggregateError?void 0:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?void 0:ArrayBuffer,"%ArrayIteratorPrototype%":u?d([][Symbol.iterator]()):void 0,"%AsyncFromSyncIteratorPrototype%":void 0,"%AsyncFunction%":f,"%AsyncGenerator%":f,"%AsyncGeneratorFunction%":f,"%AsyncIteratorPrototype%":f,"%Atomics%":"undefined"==typeof Atomics?void 0:Atomics,"%BigInt%":"undefined"==typeof BigInt?void 0:BigInt,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?void 0:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":"undefined"==typeof Float32Array?void 0:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?void 0:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?void 0:FinalizationRegistry,"%Function%":o,"%GeneratorFunction%":f,"%Int8Array%":"undefined"==typeof Int8Array?void 0:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?void 0:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?void 0:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":u?d(d([][Symbol.iterator]())):void 0,"%JSON%":"object"==typeof JSON?JSON:void 0,"%Map%":"undefined"==typeof Map?void 0:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&u?d((new Map)[Symbol.iterator]()):void 0,"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?void 0:Promise,"%Proxy%":"undefined"==typeof Proxy?void 0:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":"undefined"==typeof Reflect?void 0:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?void 0:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&u?d((new Set)[Symbol.iterator]()):void 0,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?void 0:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":u?d(""[Symbol.iterator]()):void 0,"%Symbol%":u?Symbol:void 0,"%SyntaxError%":r,"%ThrowTypeError%":l,"%TypedArray%":p,"%TypeError%":a,"%Uint8Array%":"undefined"==typeof Uint8Array?void 0:Uint8Array,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?void 0:Uint8ClampedArray,"%Uint16Array%":"undefined"==typeof Uint16Array?void 0:Uint16Array,"%Uint32Array%":"undefined"==typeof Uint32Array?void 0:Uint32Array,"%URIError%":URIError,"%WeakMap%":"undefined"==typeof WeakMap?void 0:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?void 0:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?void 0:WeakSet},m={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},b=n(147),g=n(74),y=b.call(Function.call,Array.prototype.concat),v=b.call(Function.apply,Array.prototype.splice),_=b.call(Function.call,String.prototype.replace),O=b.call(Function.call,String.prototype.slice),w=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,k=/\\(\\)?/g,S=function(e){var t=O(e,0,1),n=O(e,-1);if("%"===t&&"%"!==n)throw new r("invalid intrinsic syntax, expected closing `%`");if("%"===n&&"%"!==t)throw new r("invalid intrinsic syntax, expected opening `%`");var o=[];return _(e,w,(function(e,t,n,r){o[o.length]=n?_(r,k,"$1"):t||e})),o},D=function(e,t){var n,o=e;if(g(m,o)&&(o="%"+(n=m[o])[0]+"%"),g(h,o)){var s=h[o];if(s===f&&(s=function e(t){var n;if("%AsyncFunction%"===t)n=i("async function () {}");else if("%GeneratorFunction%"===t)n=i("function* () {}");else if("%AsyncGeneratorFunction%"===t)n=i("async function* () {}");else if("%AsyncGenerator%"===t){var r=e("%AsyncGeneratorFunction%");r&&(n=r.prototype)}else if("%AsyncIteratorPrototype%"===t){var o=e("%AsyncGenerator%");o&&(n=d(o.prototype))}return h[t]=n,n}(o)),void 0===s&&!t)throw new a("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:n,name:o,value:s}}throw new r("intrinsic "+e+" does not exist!")};e.exports=function(e,t){if("string"!=typeof e||0===e.length)throw new a("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof t)throw new a('"allowMissing" argument must be a boolean');var n=S(e),o=n.length>0?n[0]:"",i=D("%"+o+"%",t),c=i.name,l=i.value,u=!1,d=i.alias;d&&(o=d[0],v(n,y([0,1],d)));for(var f=1,p=!0;f<n.length;f+=1){var m=n[f],b=O(m,0,1),_=O(m,-1);if(('"'===b||"'"===b||"`"===b||'"'===_||"'"===_||"`"===_)&&b!==_)throw new r("property names with quotes must have matching quotes");if("constructor"!==m&&p||(u=!0),g(h,c="%"+(o+="."+m)+"%"))l=h[c];else if(null!=l){if(!(m in l)){if(!t)throw new a("base intrinsic for "+e+" exists, but the property is not available.");return}if(s&&f+1>=n.length){var w=s(l,m);l=(p=!!w)&&"get"in w&&!("originalValue"in w.get)?w.get:l[m]}else p=g(l,m),l=l[m];p&&!u&&(h[c]=l)}}return l}},function(e,t){e.exports=window.wp.keycodes},function(e,t){e.exports=window.wp.htmlEntities},function(e,t){e.exports=window.ReactDOM},,function(e,t,n){e.exports=n(354)},,function(e,t,n){"use strict";var r=n(5),o=n.n(r);t.a=o.a.createContext(null)},,,function(e,t,n){"use strict";var r=n(57),o=n(95),a=n(197),i=n(198),s=n(351),c=o.apply(i()),l=function(e,t){return c(Object,arguments)};r(l,{getPolyfill:i,implementation:a,shim:s}),e.exports=l},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r="Interact with the calendar and add the check-in date for your trip.",o="Move backward to switch to the previous month.",a="Move forward to switch to the next month.",i="page up and page down keys",s="Home and end keys",c="Escape key",l="Select the date in focus.",u="Move backward (left) and forward (right) by one day.",d="Move backward (up) and forward (down) by one week.",f="Return to the date input field.",p="Press the down arrow key to interact with the calendar and\n  select a date. Press the question mark key to get the keyboard shortcuts for changing dates.",h=function(e){var t=e.date;return"Choose "+String(t)+" as your check-in date. It’s available."},m=function(e){var t=e.date;return"Choose "+String(t)+" as your check-out date. It’s available."},b=function(e){return e.date},g=function(e){var t=e.date;return"Not available. "+String(t)},y=function(e){var t=e.date;return"Selected. "+String(t)};t.default={calendarLabel:"Calendar",closeDatePicker:"Close",focusStartDate:r,clearDate:"Clear Date",clearDates:"Clear Dates",jumpToPrevMonth:o,jumpToNextMonth:a,keyboardShortcuts:"Keyboard Shortcuts",showKeyboardShortcutsPanel:"Open the keyboard shortcuts panel.",hideKeyboardShortcutsPanel:"Close the shortcuts panel.",openThisPanel:"Open this panel.",enterKey:"Enter key",leftArrowRightArrow:"Right and left arrow keys",upArrowDownArrow:"up and down arrow keys",pageUpPageDown:i,homeEnd:s,escape:c,questionMark:"Question mark",selectFocusedDate:l,moveFocusByOneDay:u,moveFocusByOneWeek:d,moveFocusByOneMonth:"Switch months.",moveFocustoStartAndEndOfWeek:"Go to the first or last day of a week.",returnFocusToInput:f,keyboardNavigationInstructions:p,chooseAvailableStartDate:h,chooseAvailableEndDate:m,dateIsUnavailable:g,dateIsSelected:y};t.DateRangePickerPhrases={calendarLabel:"Calendar",closeDatePicker:"Close",clearDates:"Clear Dates",focusStartDate:r,jumpToPrevMonth:o,jumpToNextMonth:a,keyboardShortcuts:"Keyboard Shortcuts",showKeyboardShortcutsPanel:"Open the keyboard shortcuts panel.",hideKeyboardShortcutsPanel:"Close the shortcuts panel.",openThisPanel:"Open this panel.",enterKey:"Enter key",leftArrowRightArrow:"Right and left arrow keys",upArrowDownArrow:"up and down arrow keys",pageUpPageDown:i,homeEnd:s,escape:c,questionMark:"Question mark",selectFocusedDate:l,moveFocusByOneDay:u,moveFocusByOneWeek:d,moveFocusByOneMonth:"Switch months.",moveFocustoStartAndEndOfWeek:"Go to the first or last day of a week.",returnFocusToInput:f,keyboardNavigationInstructions:p,chooseAvailableStartDate:h,chooseAvailableEndDate:m,dateIsUnavailable:g,dateIsSelected:y},t.DateRangePickerInputPhrases={focusStartDate:r,clearDates:"Clear Dates",keyboardNavigationInstructions:p},t.SingleDatePickerPhrases={calendarLabel:"Calendar",closeDatePicker:"Close",clearDate:"Clear Date",jumpToPrevMonth:o,jumpToNextMonth:a,keyboardShortcuts:"Keyboard Shortcuts",showKeyboardShortcutsPanel:"Open the keyboard shortcuts panel.",hideKeyboardShortcutsPanel:"Close the shortcuts panel.",openThisPanel:"Open this panel.",enterKey:"Enter key",leftArrowRightArrow:"Right and left arrow keys",upArrowDownArrow:"up and down arrow keys",pageUpPageDown:i,homeEnd:s,escape:c,questionMark:"Question mark",selectFocusedDate:l,moveFocusByOneDay:u,moveFocusByOneWeek:d,moveFocusByOneMonth:"Switch months.",moveFocustoStartAndEndOfWeek:"Go to the first or last day of a week.",returnFocusToInput:f,keyboardNavigationInstructions:p,chooseAvailableDate:b,dateIsUnavailable:g,dateIsSelected:y},t.SingleDatePickerInputPhrases={clearDate:"Clear Date",keyboardNavigationInstructions:p},t.DayPickerPhrases={calendarLabel:"Calendar",jumpToPrevMonth:o,jumpToNextMonth:a,keyboardShortcuts:"Keyboard Shortcuts",showKeyboardShortcutsPanel:"Open the keyboard shortcuts panel.",hideKeyboardShortcutsPanel:"Close the shortcuts panel.",openThisPanel:"Open this panel.",enterKey:"Enter key",leftArrowRightArrow:"Right and left arrow keys",upArrowDownArrow:"up and down arrow keys",pageUpPageDown:i,homeEnd:s,escape:c,questionMark:"Question mark",selectFocusedDate:l,moveFocusByOneDay:u,moveFocusByOneWeek:d,moveFocusByOneMonth:"Switch months.",moveFocustoStartAndEndOfWeek:"Go to the first or last day of a week.",returnFocusToInput:f,chooseAvailableStartDate:h,chooseAvailableEndDate:m,chooseAvailableDate:b,dateIsUnavailable:g,dateIsSelected:y},t.DayPickerKeyboardShortcutsPhrases={keyboardShortcuts:"Keyboard Shortcuts",showKeyboardShortcutsPanel:"Open the keyboard shortcuts panel.",hideKeyboardShortcutsPanel:"Close the shortcuts panel.",openThisPanel:"Open this panel.",enterKey:"Enter key",leftArrowRightArrow:"Right and left arrow keys",upArrowDownArrow:"up and down arrow keys",pageUpPageDown:i,homeEnd:s,escape:c,questionMark:"Question mark",selectFocusedDate:l,moveFocusByOneDay:u,moveFocusByOneWeek:d,moveFocusByOneMonth:"Switch months.",moveFocustoStartAndEndOfWeek:"Go to the first or last day of a week.",returnFocusToInput:f},t.DayPickerNavigationPhrases={jumpToPrevMonth:o,jumpToNextMonth:a},t.CalendarDayPhrases={chooseAvailableDate:b,dateIsUnavailable:g,dateIsSelected:y}},,,function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return Object.keys(e).reduce((function(e,t){return(0,r.default)({},e,function(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}({},t,o.default.oneOfType([o.default.string,o.default.func,o.default.node])))}),{})};var r=a(n(36)),o=a(n(1));function a(e){return e&&e.__esModule?e:{default:e}}},,function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.withStylesPropTypes=t.css=void 0;var r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();t.withStyles=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.stylesPropName,s=void 0===n?"styles":n,u=t.themePropName,f=void 0===u?"theme":u,g=t.cssPropName,w=void 0===g?"css":g,k=t.flushBefore,S=void 0!==k&&k,D=t.pureComponent,C=void 0!==D&&D,E=void 0,j=void 0,F=void 0,P=void 0,M=v(C);function x(e){return e===l.DIRECTIONS.LTR?d.default.resolveLTR:d.default.resolveRTL}function T(e){return e===l.DIRECTIONS.LTR?F:P}function N(t,n){var r=T(t),o=t===l.DIRECTIONS.LTR?E:j,a=d.default.get();return o&&r===a||(t===l.DIRECTIONS.RTL?(j=e?d.default.createRTL(e):y,P=a,o=j):(E=e?d.default.createLTR(e):y,F=a,o=E)),o}function I(e,t){return{resolveMethod:x(e),styleDef:N(e)}}return function(e){var t=e.displayName||e.name||"Component",n=function(t){function n(e,t){p(this,n);var r=h(this,(n.__proto__||Object.getPrototypeOf(n)).call(this,e,t)),o=r.context[l.CHANNEL]?r.context[l.CHANNEL].getState():O;return r.state=I(o),r}return m(n,t),o(n,[{key:"componentDidMount",value:function(){var e=this;this.context[l.CHANNEL]&&(this.channelUnsubscribe=this.context[l.CHANNEL].subscribe((function(t){e.setState(I(t))})))}},{key:"componentWillUnmount",value:function(){this.channelUnsubscribe&&this.channelUnsubscribe()}},{key:"render",value:function(){var t;S&&d.default.flush();var n=this.state,o=n.resolveMethod,a=n.styleDef;return i.default.createElement(e,r({},this.props,(b(t={},f,d.default.get()),b(t,s,a()),b(t,w,o),t)))}}]),n}(M);return n.WrappedComponent=e,n.displayName="withStyles("+String(t)+")",n.contextTypes=_,e.propTypes&&(n.propTypes=(0,a.default)({},e.propTypes),delete n.propTypes[s],delete n.propTypes[f],delete n.propTypes[w]),e.defaultProps&&(n.defaultProps=(0,a.default)({},e.defaultProps)),(0,c.default)(n,e)}};var a=f(n(36)),i=f(n(5)),s=f(n(1)),c=f(n(118)),l=n(355),u=f(n(356)),d=f(n(199));function f(e){return e&&e.__esModule?e:{default:e}}function p(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function h(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function m(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function b(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}t.css=d.default.resolveLTR,t.withStylesPropTypes={styles:s.default.object.isRequired,theme:s.default.object.isRequired,css:s.default.func.isRequired};var g={},y=function(){return g};function v(e){if(e){if(!i.default.PureComponent)throw new ReferenceError("withStyles() pureComponent option requires React 15.3.0 or later");return i.default.PureComponent}return i.default.Component}var _=b({},l.CHANNEL,u.default),O=l.DIRECTIONS.LTR},function(e,t){e.exports=window.wp.deprecated},function(e,t,n){(function(t){var n=function(e){return e&&e.Math==Math&&e};e.exports=n("object"==typeof globalThis&&globalThis)||n("object"==typeof window&&window)||n("object"==typeof self&&self)||n("object"==typeof t&&t)||function(){return this}()||Function("return this")()}).call(this,n(78))},function(e,t,n){"use strict";var r=n(401);e.exports=function(e){return"symbol"==typeof e?"Symbol":"bigint"==typeof e?"BigInt":r(e)}},,function(e,t,n){"use strict";var r=n(48);function o(){}function a(){}a.resetWarningCache=o,e.exports=function(){function e(e,t,n,o,a,i){if(i!==r){var s=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name="Invariant Violation",s}}function t(){return e}e.isRequired=e;var n={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:a,resetWarningCache:o};return n.PropTypes=n,n}},function(e,t,n){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},,function(e,t,n){"use strict";function r(e){return function(){return e}}var o=function(){};o.thatReturns=r,o.thatReturnsFalse=r(!1),o.thatReturnsTrue=r(!0),o.thatReturnsNull=r(null),o.thatReturnsThis=function(){return this},o.thatReturnsArgument=function(e){return e},e.exports=o},,,function(e,t,n){e.exports=function(){"use strict";var e=Object.hasOwnProperty,t=Object.setPrototypeOf,n=Object.isFrozen,r=Object.getPrototypeOf,o=Object.getOwnPropertyDescriptor,a=Object.freeze,i=Object.seal,s=Object.create,c="undefined"!=typeof Reflect&&Reflect,l=c.apply,u=c.construct;l||(l=function(e,t,n){return e.apply(t,n)}),a||(a=function(e){return e}),i||(i=function(e){return e}),u||(u=function(e,t){return new(Function.prototype.bind.apply(e,[null].concat(function(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}(t))))});var d,f=w(Array.prototype.forEach),p=w(Array.prototype.pop),h=w(Array.prototype.push),m=w(String.prototype.toLowerCase),b=w(String.prototype.match),g=w(String.prototype.replace),y=w(String.prototype.indexOf),v=w(String.prototype.trim),_=w(RegExp.prototype.test),O=(d=TypeError,function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return u(d,t)});function w(e){return function(t){for(var n=arguments.length,r=Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return l(e,t,r)}}function k(e,r){t&&t(e,null);for(var o=r.length;o--;){var a=r[o];if("string"==typeof a){var i=m(a);i!==a&&(n(r)||(r[o]=i),a=i)}e[a]=!0}return e}function S(t){var n=s(null),r=void 0;for(r in t)l(e,t,[r])&&(n[r]=t[r]);return n}function D(e,t){for(;null!==e;){var n=o(e,t);if(n){if(n.get)return w(n.get);if("function"==typeof n.value)return w(n.value)}e=r(e)}return function(e){return console.warn("fallback value for",e),null}}var C=a(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),E=a(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),j=a(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),F=a(["animate","color-profile","cursor","discard","fedropshadow","feimage","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),P=a(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover"]),M=a(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),x=a(["#text"]),T=a(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","xmlns","slot"]),N=a(["accent-height","accumulate","additive","alignment-baseline","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","targetx","targety","transform","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),I=a(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),R=a(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),A=i(/\{\{[\s\S]*|[\s\S]*\}\}/gm),L=i(/<%[\s\S]*|[\s\S]*%>/gm),U=i(/^data-[\-\w.\u00B7-\uFFFF]/),B=i(/^aria-[\-\w]+$/),H=i(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),K=i(/^(?:\w+script|data):/i),z=i(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),q="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};function V(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}var W=function(){return"undefined"==typeof window?null:window},G=function(e,t){if("object"!==(void 0===e?"undefined":q(e))||"function"!=typeof e.createPolicy)return null;var n=null;t.currentScript&&t.currentScript.hasAttribute("data-tt-policy-suffix")&&(n=t.currentScript.getAttribute("data-tt-policy-suffix"));var r="dompurify"+(n?"#"+n:"");try{return e.createPolicy(r,{createHTML:function(e){return e}})}catch(e){return console.warn("TrustedTypes policy "+r+" could not be created."),null}};return function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:W(),n=function(t){return e(t)};if(n.version="2.2.9",n.removed=[],!t||!t.document||9!==t.document.nodeType)return n.isSupported=!1,n;var r=t.document,o=t.document,i=t.DocumentFragment,s=t.HTMLTemplateElement,c=t.Node,l=t.Element,u=t.NodeFilter,d=t.NamedNodeMap,w=void 0===d?t.NamedNodeMap||t.MozNamedAttrMap:d,Y=t.Text,$=t.Comment,Q=t.DOMParser,Z=t.trustedTypes,X=l.prototype,J=D(X,"cloneNode"),ee=D(X,"nextSibling"),te=D(X,"childNodes"),ne=D(X,"parentNode");if("function"==typeof s){var re=o.createElement("template");re.content&&re.content.ownerDocument&&(o=re.content.ownerDocument)}var oe=G(Z,r),ae=oe&&Re?oe.createHTML(""):"",ie=o,se=ie.implementation,ce=ie.createNodeIterator,le=ie.createDocumentFragment,ue=r.importNode,de={};try{de=S(o).documentMode?o.documentMode:{}}catch(e){}var fe={};n.isSupported="function"==typeof ne&&se&&void 0!==se.createHTMLDocument&&9!==de;var pe=A,he=L,me=U,be=B,ge=K,ye=z,ve=H,_e=null,Oe=k({},[].concat(V(C),V(E),V(j),V(P),V(x))),we=null,ke=k({},[].concat(V(T),V(N),V(I),V(R))),Se=null,De=null,Ce=!0,Ee=!0,je=!1,Fe=!1,Pe=!1,Me=!1,xe=!1,Te=!1,Ne=!1,Ie=!0,Re=!1,Ae=!0,Le=!0,Ue=!1,Be={},He=k({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]),Ke=null,ze=k({},["audio","video","img","source","image","track"]),qe=null,Ve=k({},["alt","class","for","id","label","name","pattern","placeholder","summary","title","value","style","xmlns"]),We="http://www.w3.org/1998/Math/MathML",Ge="http://www.w3.org/2000/svg",Ye="http://www.w3.org/1999/xhtml",$e=Ye,Qe=!1,Ze=null,Xe=o.createElement("form"),Je=function(e){Ze&&Ze===e||(e&&"object"===(void 0===e?"undefined":q(e))||(e={}),e=S(e),_e="ALLOWED_TAGS"in e?k({},e.ALLOWED_TAGS):Oe,we="ALLOWED_ATTR"in e?k({},e.ALLOWED_ATTR):ke,qe="ADD_URI_SAFE_ATTR"in e?k(S(Ve),e.ADD_URI_SAFE_ATTR):Ve,Ke="ADD_DATA_URI_TAGS"in e?k(S(ze),e.ADD_DATA_URI_TAGS):ze,Se="FORBID_TAGS"in e?k({},e.FORBID_TAGS):{},De="FORBID_ATTR"in e?k({},e.FORBID_ATTR):{},Be="USE_PROFILES"in e&&e.USE_PROFILES,Ce=!1!==e.ALLOW_ARIA_ATTR,Ee=!1!==e.ALLOW_DATA_ATTR,je=e.ALLOW_UNKNOWN_PROTOCOLS||!1,Fe=e.SAFE_FOR_TEMPLATES||!1,Pe=e.WHOLE_DOCUMENT||!1,Te=e.RETURN_DOM||!1,Ne=e.RETURN_DOM_FRAGMENT||!1,Ie=!1!==e.RETURN_DOM_IMPORT,Re=e.RETURN_TRUSTED_TYPE||!1,xe=e.FORCE_BODY||!1,Ae=!1!==e.SANITIZE_DOM,Le=!1!==e.KEEP_CONTENT,Ue=e.IN_PLACE||!1,ve=e.ALLOWED_URI_REGEXP||ve,$e=e.NAMESPACE||Ye,Fe&&(Ee=!1),Ne&&(Te=!0),Be&&(_e=k({},[].concat(V(x))),we=[],!0===Be.html&&(k(_e,C),k(we,T)),!0===Be.svg&&(k(_e,E),k(we,N),k(we,R)),!0===Be.svgFilters&&(k(_e,j),k(we,N),k(we,R)),!0===Be.mathMl&&(k(_e,P),k(we,I),k(we,R))),e.ADD_TAGS&&(_e===Oe&&(_e=S(_e)),k(_e,e.ADD_TAGS)),e.ADD_ATTR&&(we===ke&&(we=S(we)),k(we,e.ADD_ATTR)),e.ADD_URI_SAFE_ATTR&&k(qe,e.ADD_URI_SAFE_ATTR),Le&&(_e["#text"]=!0),Pe&&k(_e,["html","head","body"]),_e.table&&(k(_e,["tbody"]),delete Se.tbody),a&&a(e),Ze=e)},et=k({},["mi","mo","mn","ms","mtext"]),tt=k({},["foreignobject","desc","title","annotation-xml"]),nt=k({},E);k(nt,j),k(nt,F);var rt=k({},P);k(rt,M);var ot=function(e){var t=ne(e);t&&t.tagName||(t={namespaceURI:Ye,tagName:"template"});var n=m(e.tagName),r=m(t.tagName);if(e.namespaceURI===Ge)return t.namespaceURI===Ye?"svg"===n:t.namespaceURI===We?"svg"===n&&("annotation-xml"===r||et[r]):Boolean(nt[n]);if(e.namespaceURI===We)return t.namespaceURI===Ye?"math"===n:t.namespaceURI===Ge?"math"===n&&tt[r]:Boolean(rt[n]);if(e.namespaceURI===Ye){if(t.namespaceURI===Ge&&!tt[r])return!1;if(t.namespaceURI===We&&!et[r])return!1;var o=k({},["title","style","font","a","script"]);return!rt[n]&&(o[n]||!nt[n])}return!1},at=function(e){h(n.removed,{element:e});try{e.parentNode.removeChild(e)}catch(t){try{e.outerHTML=ae}catch(t){e.remove()}}},it=function(e,t){try{h(n.removed,{attribute:t.getAttributeNode(e),from:t})}catch(e){h(n.removed,{attribute:null,from:t})}if(t.removeAttribute(e),"is"===e&&!we[e])if(Te||Ne)try{at(t)}catch(e){}else try{t.setAttribute(e,"")}catch(e){}},st=function(e){var t=void 0,n=void 0;if(xe)e="<remove></remove>"+e;else{var r=b(e,/^[\r\n\t ]+/);n=r&&r[0]}var a=oe?oe.createHTML(e):e;if($e===Ye)try{t=(new Q).parseFromString(a,"text/html")}catch(e){}if(!t||!t.documentElement){t=se.createDocument($e,"template",null);try{t.documentElement.innerHTML=Qe?"":a}catch(e){}}var i=t.body||t.documentElement;return e&&n&&i.insertBefore(o.createTextNode(n),i.childNodes[0]||null),Pe?t.documentElement:i},ct=function(e){return ce.call(e.ownerDocument||e,e,u.SHOW_ELEMENT|u.SHOW_COMMENT|u.SHOW_TEXT,null,!1)},lt=function(e){return!(e instanceof Y||e instanceof $||"string"==typeof e.nodeName&&"string"==typeof e.textContent&&"function"==typeof e.removeChild&&e.attributes instanceof w&&"function"==typeof e.removeAttribute&&"function"==typeof e.setAttribute&&"string"==typeof e.namespaceURI&&"function"==typeof e.insertBefore)},ut=function(e){return"object"===(void 0===c?"undefined":q(c))?e instanceof c:e&&"object"===(void 0===e?"undefined":q(e))&&"number"==typeof e.nodeType&&"string"==typeof e.nodeName},dt=function(e,t,r){fe[e]&&f(fe[e],(function(e){e.call(n,t,r,Ze)}))},ft=function(e){var t=void 0;if(dt("beforeSanitizeElements",e,null),lt(e))return at(e),!0;if(b(e.nodeName,/[\u0080-\uFFFF]/))return at(e),!0;var r=m(e.nodeName);if(dt("uponSanitizeElement",e,{tagName:r,allowedTags:_e}),!ut(e.firstElementChild)&&(!ut(e.content)||!ut(e.content.firstElementChild))&&_(/<[/\w]/g,e.innerHTML)&&_(/<[/\w]/g,e.textContent))return at(e),!0;if(!_e[r]||Se[r]){if(Le&&!He[r]){var o=ne(e)||e.parentNode,a=te(e)||e.childNodes;if(a&&o)for(var i=a.length-1;i>=0;--i)o.insertBefore(J(a[i],!0),ee(e))}return at(e),!0}return e instanceof l&&!ot(e)?(at(e),!0):"noscript"!==r&&"noembed"!==r||!_(/<\/no(script|embed)/i,e.innerHTML)?(Fe&&3===e.nodeType&&(t=e.textContent,t=g(t,pe," "),t=g(t,he," "),e.textContent!==t&&(h(n.removed,{element:e.cloneNode()}),e.textContent=t)),dt("afterSanitizeElements",e,null),!1):(at(e),!0)},pt=function(e,t,n){if(Ae&&("id"===t||"name"===t)&&(n in o||n in Xe))return!1;if(Ee&&_(me,t));else if(Ce&&_(be,t));else{if(!we[t]||De[t])return!1;if(qe[t]);else if(_(ve,g(n,ye,"")));else if("src"!==t&&"xlink:href"!==t&&"href"!==t||"script"===e||0!==y(n,"data:")||!Ke[e])if(je&&!_(ge,g(n,ye,"")));else if(n)return!1}return!0},ht=function(e){var t=void 0,r=void 0,o=void 0,a=void 0;dt("beforeSanitizeAttributes",e,null);var i=e.attributes;if(i){var s={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:we};for(a=i.length;a--;){var c=t=i[a],l=c.name,u=c.namespaceURI;if(r=v(t.value),o=m(l),s.attrName=o,s.attrValue=r,s.keepAttr=!0,s.forceKeepAttr=void 0,dt("uponSanitizeAttribute",e,s),r=s.attrValue,!s.forceKeepAttr&&(it(l,e),s.keepAttr))if(_(/\/>/i,r))it(l,e);else{Fe&&(r=g(r,pe," "),r=g(r,he," "));var d=e.nodeName.toLowerCase();if(pt(d,o,r))try{u?e.setAttributeNS(u,l,r):e.setAttribute(l,r),p(n.removed)}catch(e){}}}dt("afterSanitizeAttributes",e,null)}},mt=function e(t){var n=void 0,r=ct(t);for(dt("beforeSanitizeShadowDOM",t,null);n=r.nextNode();)dt("uponSanitizeShadowNode",n,null),ft(n)||(n.content instanceof i&&e(n.content),ht(n));dt("afterSanitizeShadowDOM",t,null)};return n.sanitize=function(e,o){var a=void 0,s=void 0,l=void 0,u=void 0,d=void 0;if((Qe=!e)&&(e="\x3c!--\x3e"),"string"!=typeof e&&!ut(e)){if("function"!=typeof e.toString)throw O("toString is not a function");if("string"!=typeof(e=e.toString()))throw O("dirty is not a string, aborting")}if(!n.isSupported){if("object"===q(t.toStaticHTML)||"function"==typeof t.toStaticHTML){if("string"==typeof e)return t.toStaticHTML(e);if(ut(e))return t.toStaticHTML(e.outerHTML)}return e}if(Me||Je(o),n.removed=[],"string"==typeof e&&(Ue=!1),Ue);else if(e instanceof c)1===(s=(a=st("\x3c!----\x3e")).ownerDocument.importNode(e,!0)).nodeType&&"BODY"===s.nodeName||"HTML"===s.nodeName?a=s:a.appendChild(s);else{if(!Te&&!Fe&&!Pe&&-1===e.indexOf("<"))return oe&&Re?oe.createHTML(e):e;if(!(a=st(e)))return Te?null:ae}a&&xe&&at(a.firstChild);for(var f=ct(Ue?e:a);l=f.nextNode();)3===l.nodeType&&l===u||ft(l)||(l.content instanceof i&&mt(l.content),ht(l),u=l);if(u=null,Ue)return e;if(Te){if(Ne)for(d=le.call(a.ownerDocument);a.firstChild;)d.appendChild(a.firstChild);else d=a;return Ie&&(d=ue.call(r,d,!0)),d}var p=Pe?a.outerHTML:a.innerHTML;return Fe&&(p=g(p,pe," "),p=g(p,he," ")),oe&&Re?oe.createHTML(p):p},n.setConfig=function(e){Je(e),Me=!0},n.clearConfig=function(){Ze=null,Me=!1},n.isValidAttribute=function(e,t,n){Ze||Je({});var r=m(e),o=m(t);return pt(r,o,n)},n.addHook=function(e,t){"function"==typeof t&&(fe[e]=fe[e]||[],h(fe[e],t))},n.removeHook=function(e){fe[e]&&p(fe[e])},n.removeHooks=function(e){fe[e]&&(fe[e]=[])},n.removeAllHooks=function(){fe={}},n}()}()},function(e,t){e.exports=window.wp.viewport},,function(e,t){var n={}.hasOwnProperty;e.exports=function(e,t){return n.call(e,t)}},function(e,t,n){"use strict";var r=n(194),o="function"==typeof Symbol&&"symbol"==typeof Symbol("foo"),a=Object.prototype.toString,i=Array.prototype.concat,s=Object.defineProperty,c=s&&function(){var e={};try{for(var t in s(e,"x",{enumerable:!1,value:e}),e)return!1;return e.x===e}catch(e){return!1}}(),l=function(e,t,n,r){var o;(!(t in e)||"function"==typeof(o=r)&&"[object Function]"===a.call(o)&&r())&&(c?s(e,t,{configurable:!0,enumerable:!1,value:n,writable:!0}):e[t]=n)},u=function(e,t){var n=arguments.length>2?arguments[2]:{},a=r(t);o&&(a=i.call(a,Object.getOwnPropertySymbols(t)));for(var s=0;s<a.length;s+=1)l(e,a[s],t[a[s]],n[a[s]])};u.supportsDescriptors=!!c,e.exports=u},function(e,t,n){var r=n(9),o=n(352),a=n(353);e.exports={momentObj:a.createMomentChecker("object",(function(e){return"object"==typeof e}),(function(e){return o.isValidMoment(e)}),"Moment"),momentString:a.createMomentChecker("string",(function(e){return"string"==typeof e}),(function(e){return o.isValidMoment(r(e))}),"Moment"),momentDurationObj:a.createMomentChecker("object",(function(e){return"object"==typeof e}),(function(e){return r.isDuration(e)}),"Duration")}},function(e,t){e.exports=window.wp.date},,function(e,t,n){"use strict";var r=Object.assign||function(e){for(var t,n=1;n<arguments.length;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e};Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n=e.size,o=void 0===n?24:n,a=e.onClick,s=(e.icon,e.className),c=function(e,t){var n={};for(var r in e)0<=t.indexOf(r)||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}(e,["size","onClick","icon","className"]),l=["gridicon","gridicons-notice-outline",s,(t=o,!(0!=t%18)&&"needs-offset"),!1,!1].filter(Boolean).join(" ");return i.default.createElement("svg",r({className:l,height:o,width:o,onClick:a},c,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"}),i.default.createElement("g",null,i.default.createElement("path",{d:"M12 4c4.41 0 8 3.59 8 8s-3.59 8-8 8-8-3.59-8-8 3.59-8 8-8m0-2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2zm1 13h-2v2h2v-2zm-2-2h2l.5-6h-3l.5 6z"})))};var o,a=n(5),i=(o=a)&&o.__esModule?o:{default:o};e.exports=t.default},function(e,t){e.exports=function(e){try{return!!e()}catch(e){return!0}}},function(e,t,n){var r=n(44),o=n(183),a=n(56),i=n(184),s=n(192),c=n(318),l=o("wks"),u=r.Symbol,d=c?u:u&&u.withoutSetter||i;e.exports=function(e){return a(l,e)&&(s||"string"==typeof l[e])||(s&&a(u,e)?l[e]=u[e]:l[e]=d("Symbol."+e)),l[e]}},function(e,t,n){"use strict";var r=n(26),o=n(95),a=o(r("String.prototype.indexOf"));e.exports=function(e,t){var n=r(e,!!t);return"function"==typeof n&&a(e,".prototype.")>-1?o(n):n}},function(e,t,n){"use strict";var r=n(22),o=n(25),a=(n(1),n(5)),i=n.n(a),s=n(29),c=n.n(s),l=!1,u=n(33),d=function(e){function t(t,n){var r;r=e.call(this,t,n)||this;var o,a=n&&!n.isMounting?t.enter:t.appear;return r.appearStatus=null,t.in?a?(o="exited",r.appearStatus="entering"):o="entered":o=t.unmountOnExit||t.mountOnEnter?"unmounted":"exited",r.state={status:o},r.nextCallback=null,r}Object(o.a)(t,e),t.getDerivedStateFromProps=function(e,t){return e.in&&"unmounted"===t.status?{status:"exited"}:null};var n=t.prototype;return n.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},n.componentDidUpdate=function(e){var t=null;if(e!==this.props){var n=this.state.status;this.props.in?"entering"!==n&&"entered"!==n&&(t="entering"):"entering"!==n&&"entered"!==n||(t="exiting")}this.updateStatus(!1,t)},n.componentWillUnmount=function(){this.cancelNextCallback()},n.getTimeouts=function(){var e,t,n,r=this.props.timeout;return e=t=n=r,null!=r&&"number"!=typeof r&&(e=r.exit,t=r.enter,n=void 0!==r.appear?r.appear:t),{exit:e,enter:t,appear:n}},n.updateStatus=function(e,t){void 0===e&&(e=!1),null!==t?(this.cancelNextCallback(),"entering"===t?this.performEnter(e):this.performExit()):this.props.unmountOnExit&&"exited"===this.state.status&&this.setState({status:"unmounted"})},n.performEnter=function(e){var t=this,n=this.props.enter,r=this.context?this.context.isMounting:e,o=this.props.nodeRef?[r]:[c.a.findDOMNode(this),r],a=o[0],i=o[1],s=this.getTimeouts(),u=r?s.appear:s.enter;!e&&!n||l?this.safeSetState({status:"entered"},(function(){t.props.onEntered(a)})):(this.props.onEnter(a,i),this.safeSetState({status:"entering"},(function(){t.props.onEntering(a,i),t.onTransitionEnd(u,(function(){t.safeSetState({status:"entered"},(function(){t.props.onEntered(a,i)}))}))})))},n.performExit=function(){var e=this,t=this.props.exit,n=this.getTimeouts(),r=this.props.nodeRef?void 0:c.a.findDOMNode(this);t&&!l?(this.props.onExit(r),this.safeSetState({status:"exiting"},(function(){e.props.onExiting(r),e.onTransitionEnd(n.exit,(function(){e.safeSetState({status:"exited"},(function(){e.props.onExited(r)}))}))}))):this.safeSetState({status:"exited"},(function(){e.props.onExited(r)}))},n.cancelNextCallback=function(){null!==this.nextCallback&&(this.nextCallback.cancel(),this.nextCallback=null)},n.safeSetState=function(e,t){t=this.setNextCallback(t),this.setState(e,t)},n.setNextCallback=function(e){var t=this,n=!0;return this.nextCallback=function(r){n&&(n=!1,t.nextCallback=null,e(r))},this.nextCallback.cancel=function(){n=!1},this.nextCallback},n.onTransitionEnd=function(e,t){this.setNextCallback(t);var n=this.props.nodeRef?this.props.nodeRef.current:c.a.findDOMNode(this),r=null==e&&!this.props.addEndListener;if(n&&!r){if(this.props.addEndListener){var o=this.props.nodeRef?[this.nextCallback]:[n,this.nextCallback],a=o[0],i=o[1];this.props.addEndListener(a,i)}null!=e&&setTimeout(this.nextCallback,e)}else setTimeout(this.nextCallback,0)},n.render=function(){var e=this.state.status;if("unmounted"===e)return null;var t=this.props,n=t.children,o=(t.in,t.mountOnEnter,t.unmountOnExit,t.appear,t.enter,t.exit,t.timeout,t.addEndListener,t.onEnter,t.onEntering,t.onEntered,t.onExit,t.onExiting,t.onExited,t.nodeRef,Object(r.a)(t,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]));return i.a.createElement(u.a.Provider,{value:null},"function"==typeof n?n(e,o):i.a.cloneElement(i.a.Children.only(n),o))},t}(i.a.Component);function f(){}d.contextType=u.a,d.propTypes={},d.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:f,onEntering:f,onEntered:f,onExit:f,onExiting:f,onExited:f},d.UNMOUNTED="unmounted",d.EXITED="exited",d.ENTERING="entering",d.ENTERED="entered",d.EXITING="exiting";t.a=d},,,,function(e,t,n){"use strict";var r=n(5),o="function"==typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103,a=n(50),i=n(70),s=n(71),c="function"==typeof Symbol&&Symbol.iterator;function l(e,t){return e&&"object"==typeof e&&null!=e.key?(n=e.key,r={"=":"=0",":":"=2"},"$"+(""+n).replace(/[=:]/g,(function(e){return r[e]}))):t.toString(36);var n,r}function u(e,t,n,r){var a,s=typeof e;if("undefined"!==s&&"boolean"!==s||(e=null),null===e||"string"===s||"number"===s||"object"===s&&e.$$typeof===o)return n(r,e,""===t?"."+l(e,0):t),1;var d=0,f=""===t?".":t+":";if(Array.isArray(e))for(var p=0;p<e.length;p++)d+=u(a=e[p],f+l(a,p),n,r);else{var h=function(e){var t=e&&(c&&e[c]||e["@@iterator"]);if("function"==typeof t)return t}(e);if(h){0;for(var m,b=h.call(e),g=0;!(m=b.next()).done;)d+=u(a=m.value,f+l(a,g++),n,r)}else if("object"===s){0;var y=""+e;i(!1,"Objects are not valid as a React child (found: %s).%s","[object Object]"===y?"object with keys {"+Object.keys(e).join(", ")+"}":y,"")}}return d}var d=/\/+/g;function f(e){return(""+e).replace(d,"$&/")}var p,h,m=b,b=function(e){if(this.instancePool.length){var t=this.instancePool.pop();return this.call(t,e),t}return new this(e)},g=function(e){i(e instanceof this,"Trying to release an instance into a pool of a different type."),e.destructor(),this.instancePool.length<this.poolSize&&this.instancePool.push(e)};function y(e,t,n,r){this.result=e,this.keyPrefix=t,this.func=n,this.context=r,this.count=0}function v(e,t,n){var o,i,s=e.result,c=e.keyPrefix,l=e.func,u=e.context,d=l.call(u,t,e.count++);Array.isArray(d)?_(d,s,n,a.thatReturnsArgument):null!=d&&(r.isValidElement(d)&&(o=d,i=c+(!d.key||t&&t.key===d.key?"":f(d.key)+"/")+n,d=r.cloneElement(o,{key:i},void 0!==o.props?o.props.children:void 0)),s.push(d))}function _(e,t,n,r,o){var a="";null!=n&&(a=f(n)+"/");var i=y.getPooled(t,a,r,o);!function(e,t,n){null==e||u(e,"",t,n)}(e,v,i),y.release(i)}y.prototype.destructor=function(){this.result=null,this.keyPrefix=null,this.func=null,this.context=null,this.count=0},p=function(e,t,n,r){if(this.instancePool.length){var o=this.instancePool.pop();return this.call(o,e,t,n,r),o}return new this(e,t,n,r)},(h=y).instancePool=[],h.getPooled=p||m,h.poolSize||(h.poolSize=10),h.release=g;e.exports=function(e){if("object"!=typeof e||!e||Array.isArray(e))return s(!1,"React.addons.createFragment only accepts a single object. Got: %s",e),e;if(r.isValidElement(e))return s(!1,"React.addons.createFragment does not accept a ReactElement without a wrapper object."),e;i(1!==e.nodeType,"React.addons.createFragment(...): Encountered an invalid child; DOM elements are not valid children of React components.");var t=[];for(var n in e)_(e[n],t,n,a.thatReturnsArgument);return t}},function(e,t,n){"use strict";e.exports=function(e,t,n,r,o,a,i,s){if(!e){var c;if(void 0===t)c=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var l=[n,r,o,a,i,s],u=0;(c=new Error(t.replace(/%s/g,(function(){return l[u++]})))).name="Invariant Violation"}throw c.framesToPop=1,c}}},function(e,t,n){"use strict";var r=n(50);e.exports=r},function(e,t,n){"use strict";function r(e){return e.match(/^\{\{\//)?{type:"componentClose",value:e.replace(/\W/g,"")}:e.match(/\/\}\}$/)?{type:"componentSelfClosing",value:e.replace(/\W/g,"")}:e.match(/^\{\{/)?{type:"componentOpen",value:e.replace(/\W/g,"")}:{type:"string",value:e}}e.exports=function(e){return e.split(/(\{\{\/?\s*\w+\s*\/?\}\})/g).map(r)}},function(e,t,n){var r=n(93);e.exports=function(e){if(!r(e))throw TypeError(String(e)+" is not an object");return e}},function(e,t,n){"use strict";var r=n(147);e.exports=r.call(Function.call,Object.prototype.hasOwnProperty)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,o=n(1),a=(r=o)&&r.__esModule?r:{default:r},i=n(24);t.default=a.default.oneOf(i.WEEKDAYS)},,,function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t,n){var r=n(62);e.exports=!r((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]}))},function(e,t,n){var r=n(79),o=n(94),a=n(105);e.exports=r?function(e,t,n){return o.f(e,t,a(1,n))}:function(e,t,n){return e[t]=n,e}},function(e,t,n){"use strict";var r=Object.prototype.hasOwnProperty;function o(e,t){return e===t?0!==e||0!==t||1/e==1/t:e!=e&&t!=t}function a(e,t){if(o(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;var n=Object.keys(e),a=Object.keys(t);if(n.length!==a.length)return!1;for(var i=0;i<n.length;i++)if(!r.call(t,n[i])||!o(e[n[i]],t[n[i]]))return!1;return!0}e.exports=function(e,t,n){return!a(e.props,t)||!a(e.state,n)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){return!(!a.default.isMoment(e)||!a.default.isMoment(t))&&(e.date()===t.date()&&e.month()===t.month()&&e.year()===t.year())};var r,o=n(9),a=(r=o)&&r.__esModule?r:{default:r}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){var n=t?[t,i.DISPLAY_FORMAT,i.ISO_FORMAT]:[i.DISPLAY_FORMAT,i.ISO_FORMAT],r=(0,a.default)(e,n,!0);return r.isValid()?r.hour(12):null};var r,o=n(9),a=(r=o)&&r.__esModule?r:{default:r},i=n(24)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,o=n(1),a=(r=o)&&r.__esModule?r:{default:r},i=n(24);t.default=a.default.oneOf([i.HORIZONTAL_ORIENTATION,i.VERTICAL_ORIENTATION,i.VERTICAL_SCROLLABLE])},function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){return!("undefined"==typeof window||!("ontouchstart"in window||window.DocumentTouch&&"undefined"!=typeof document&&document instanceof window.DocumentTouch))||!("undefined"==typeof navigator||!navigator.maxTouchPoints&&!navigator.msMaxTouchPoints)},e.exports=t.default},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,o=n(1),a=(r=o)&&r.__esModule?r:{default:r},i=n(24);t.default=a.default.oneOf([i.OPEN_DOWN,i.OPEN_UP])},function(e,t,n){"use strict";e.exports=function(e){return"string"==typeof e||"symbol"==typeof e}},,function(e,t){e.exports=window.wc.currency},,function(e,t){e.exports=window.wp.dom},,function(e,t){e.exports=function(e){return"object"==typeof e?null!==e:"function"==typeof e}},function(e,t,n){var r=n(79),o=n(178),a=n(73),i=n(134),s=Object.defineProperty;t.f=r?s:function(e,t,n){if(a(e),t=i(t,!0),a(n),o)try{return s(e,t,n)}catch(e){}if("get"in n||"set"in n)throw TypeError("Accessors not supported");return"value"in n&&(e[t]=n.value),e}},function(e,t,n){"use strict";var r=n(147),o=n(26),a=o("%Function.prototype.apply%"),i=o("%Function.prototype.call%"),s=o("%Reflect.apply%",!0)||r.call(i,a),c=o("%Object.getOwnPropertyDescriptor%",!0),l=o("%Object.defineProperty%",!0),u=o("%Math.max%");if(l)try{l({},"a",{value:1})}catch(e){l=null}e.exports=function(e){var t=s(r,i,arguments);if(c&&l){var n=c(t,"length");n.configurable&&l(t,"length",{value:1+u(0,e.length-(arguments.length-1))})}return t};var d=function(){return s(r,a,arguments)};l?l(e.exports,"apply",{value:d}):e.exports.apply=d},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,o=n(1),a=(r=o)&&r.__esModule?r:{default:r},i=n(24);t.default=a.default.oneOf([i.ICON_BEFORE_POSITION,i.ICON_AFTER_POSITION])},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,o=n(1),a=(r=o)&&r.__esModule?r:{default:r},i=n(24);t.default=a.default.oneOf([i.INFO_POSITION_TOP,i.INFO_POSITION_BOTTOM,i.INFO_POSITION_BEFORE,i.INFO_POSITION_AFTER])},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){return!(!r.default.isMoment(e)||!r.default.isMoment(t))&&!(0,o.default)(e,t)};var r=a(n(9)),o=a(n(99));function a(e){return e&&e.__esModule?e:{default:e}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){if(!a.default.isMoment(e)||!a.default.isMoment(t))return!1;var n=e.year(),r=e.month(),o=t.year(),i=t.month(),s=n===o,c=r===i;return s&&c?e.date()<t.date():s?r<i:n<o};var r,o=n(9),a=(r=o)&&r.__esModule?r:{default:r}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,o=n(5),a=(r=o)&&r.__esModule?r:{default:r};var i=function(e){return a.default.createElement("svg",e,a.default.createElement("path",{fillRule:"evenodd",d:"M11.53.47a.75.75 0 0 0-1.061 0l-4.47 4.47L1.529.47A.75.75 0 1 0 .468 1.531l4.47 4.47-4.47 4.47a.75.75 0 1 0 1.061 1.061l4.47-4.47 4.47 4.47a.75.75 0 1 0 1.061-1.061l-4.47-4.47 4.47-4.47a.75.75 0 0 0 0-1.061z"}))};i.defaultProps={viewBox:"0 0 12 12"},t.default=i},function(e,t,n){"use strict";var r=Object.assign||function(e){for(var t,n=1;n<arguments.length;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e};Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t=e.size,n=void 0===t?24:t,o=e.onClick,a=(e.icon,e.className),s=function(e,t){var n={};for(var r in e)0<=t.indexOf(r)||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}(e,["size","onClick","icon","className"]),c=["gridicon","gridicons-cross-small",a,!1,!1,!1].filter(Boolean).join(" ");return i.default.createElement("svg",r({className:c,height:n,width:n,onClick:o},s,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"}),i.default.createElement("g",null,i.default.createElement("path",{d:"M17.705 7.705l-1.41-1.41L12 10.59 7.705 6.295l-1.41 1.41L10.59 12l-4.295 4.295 1.41 1.41L12 13.41l4.295 4.295 1.41-1.41L13.41 12l4.295-4.295z"})))};var o,a=n(5),i=(o=a)&&o.__esModule?o:{default:o};e.exports=t.default},,,function(e,t,n){"use strict";e.exports=n(129)},function(e,t){e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},function(e,t){e.exports={}},function(e,t){var n=/^\[object .+?Constructor\]$/;function r(e){return!!e&&"object"==typeof e}var o,a,i,s=Object.prototype,c=Function.prototype.toString,l=s.hasOwnProperty,u=s.toString,d=RegExp("^"+c.call(l).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),f=(a="isArray",function(e){return null!=e&&(function(e){return function(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}(e)&&"[object Function]"==u.call(e)}(e)?d.test(c.call(e)):r(e)&&n.test(e))}(i=null==(o=Array)?void 0:o[a])?i:void 0);var p=f||function(e){return r(e)&&function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}(e.length)&&"[object Array]"==u.call(e)};e.exports=p},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,o=n(1),a=(r=o)&&r.__esModule?r:{default:r},i=n(31);function s(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function c(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}t.default=(0,i.and)([a.default.instanceOf(Set),function(e,t){for(var n=arguments.length,r=Array(n>2?n-2:0),o=2;o<n;o++)r[o-2]=arguments[o];var i=e[t],l=void 0;return[].concat(c(i)).some((function(e,n){var o,i=String(t)+": index "+String(n);return null!=(l=(o=a.default.string).isRequired.apply(o,[s({},i,e),i].concat(r)))})),null==l?null:l}],"Modifiers (Set of Strings)")},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){var n=r.default.isMoment(e)?e:(0,o.default)(e,t);return n?n.format(a.ISO_FORMAT):null};var r=i(n(9)),o=i(n(83)),a=n(24);function i(e){return e&&e.__esModule?e:{default:e}}},function(e,t,n){"use strict";n.r(t),n.d(t,"addEventListener",(function(){return c}));var r=!("undefined"==typeof window||!window.document||!window.document.createElement);var o=void 0;function a(){return void 0===o&&(o=function(){if(!r)return!1;if(!window.addEventListener||!window.removeEventListener||!Object.defineProperty)return!1;var e=!1;try{var t=Object.defineProperty({},"passive",{get:function(){e=!0}}),n=function(){};window.addEventListener("testPassiveEventSupport",n,t),window.removeEventListener("testPassiveEventSupport",n,t)}catch(e){}return e}()),o}function i(e){e.handlers===e.nextHandlers&&(e.nextHandlers=e.handlers.slice())}function s(e){this.target=e,this.events={}}s.prototype.getEventHandlers=function(e,t){var n,r=String(e)+" "+String((n=t)?!0===n?100:(n.capture<<0)+(n.passive<<1)+(n.once<<2):0);return this.events[r]||(this.events[r]={handlers:[],handleEvent:void 0},this.events[r].nextHandlers=this.events[r].handlers),this.events[r]},s.prototype.handleEvent=function(e,t,n){var r=this.getEventHandlers(e,t);r.handlers=r.nextHandlers,r.handlers.forEach((function(e){e&&e(n)}))},s.prototype.add=function(e,t,n){var r=this,o=this.getEventHandlers(e,n);i(o),0===o.nextHandlers.length&&(o.handleEvent=this.handleEvent.bind(this,e,n),this.target.addEventListener(e,o.handleEvent,n)),o.nextHandlers.push(t);var a=!0;return function(){if(a){a=!1,i(o);var s=o.nextHandlers.indexOf(t);o.nextHandlers.splice(s,1),0===o.nextHandlers.length&&(r.target&&r.target.removeEventListener(e,o.handleEvent,n),o.handleEvent=void 0)}}};function c(e,t,n,r){e.__consolidated_events_handlers__||(e.__consolidated_events_handlers__=new s(e));var o=function(e){if(e)return a()?e:!!e.capture}(r);return e.__consolidated_events_handlers__.add(t,n,o)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){var n=r.default.isMoment(e)?e:(0,o.default)(e,t);return n?n.format(a.ISO_MONTH_FORMAT):null};var r=i(n(9)),o=i(n(83)),a=n(24);function i(e){return e&&e.__esModule?e:{default:e}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,o=n(1),a=(r=o)&&r.__esModule?r:{default:r},i=n(24);t.default=a.default.oneOfType([a.default.bool,a.default.oneOf([i.START_DATE,i.END_DATE])])},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){return!(!r.default.isMoment(e)||!r.default.isMoment(t))&&(!(0,o.default)(e,t)&&!(0,a.default)(e,t))};var r=i(n(9)),o=i(n(99)),a=i(n(82));function i(e){return e&&e.__esModule?e:{default:e}}},function(e,t,n){"use strict";var r=n(26)("%TypeError%"),o=n(399),a=n(87),i=n(45);e.exports=function(e,t){if("Object"!==i(e))throw new r("Assertion failed: Type(O) is not Object");if(!a(t))throw new r("Assertion failed: IsPropertyKey(P) is not true, got "+o(t));return e[t]}},function(e,t,n){"use strict";var r=n(26)("%Array%"),o=!r.isArray&&n(64)("Object.prototype.toString");e.exports=r.isArray||function(e){return"[object Array]"===o(e)}},function(e,t,n){"use strict";function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var o=n(22);var a=n(0);function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}t.a=function(e){var t=e.icon,n=e.size,s=void 0===n?24:n,c=function(e,t){if(null==e)return{};var n,r,a=Object(o.a)(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}(e,["icon","size"]);return Object(a.cloneElement)(t,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?i(Object(n),!0).forEach((function(t){r(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):i(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({width:s,height:s},c))}},,function(e,t,n){"use strict";var r=n(104),o={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},a={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},i={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},s={};function c(e){return r.isMemo(e)?i:s[e.$$typeof]||o}s[r.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},s[r.Memo]=i;var l=Object.defineProperty,u=Object.getOwnPropertyNames,d=Object.getOwnPropertySymbols,f=Object.getOwnPropertyDescriptor,p=Object.getPrototypeOf,h=Object.prototype;e.exports=function e(t,n,r){if("string"!=typeof n){if(h){var o=p(n);o&&o!==h&&e(t,o,r)}var i=u(n);d&&(i=i.concat(d(n)));for(var s=c(t),m=c(n),b=0;b<i.length;++b){var g=i[b];if(!(a[g]||r&&r[g]||m&&m[g]||s&&s[g])){var y=f(n,g);try{l(t,g,y)}catch(e){}}}}return t}},,,,,,,,,,,function(e,t,n){"use strict";var r="function"==typeof Symbol&&Symbol.for,o=r?Symbol.for("react.element"):60103,a=r?Symbol.for("react.portal"):60106,i=r?Symbol.for("react.fragment"):60107,s=r?Symbol.for("react.strict_mode"):60108,c=r?Symbol.for("react.profiler"):60114,l=r?Symbol.for("react.provider"):60109,u=r?Symbol.for("react.context"):60110,d=r?Symbol.for("react.async_mode"):60111,f=r?Symbol.for("react.concurrent_mode"):60111,p=r?Symbol.for("react.forward_ref"):60112,h=r?Symbol.for("react.suspense"):60113,m=r?Symbol.for("react.suspense_list"):60120,b=r?Symbol.for("react.memo"):60115,g=r?Symbol.for("react.lazy"):60116,y=r?Symbol.for("react.block"):60121,v=r?Symbol.for("react.fundamental"):60117,_=r?Symbol.for("react.responder"):60118,O=r?Symbol.for("react.scope"):60119;function w(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case o:switch(e=e.type){case d:case f:case i:case c:case s:case h:return e;default:switch(e=e&&e.$$typeof){case u:case p:case g:case b:case l:return e;default:return t}}case a:return t}}}function k(e){return w(e)===f}t.AsyncMode=d,t.ConcurrentMode=f,t.ContextConsumer=u,t.ContextProvider=l,t.Element=o,t.ForwardRef=p,t.Fragment=i,t.Lazy=g,t.Memo=b,t.Portal=a,t.Profiler=c,t.StrictMode=s,t.Suspense=h,t.isAsyncMode=function(e){return k(e)||w(e)===d},t.isConcurrentMode=k,t.isContextConsumer=function(e){return w(e)===u},t.isContextProvider=function(e){return w(e)===l},t.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===o},t.isForwardRef=function(e){return w(e)===p},t.isFragment=function(e){return w(e)===i},t.isLazy=function(e){return w(e)===g},t.isMemo=function(e){return w(e)===b},t.isPortal=function(e){return w(e)===a},t.isProfiler=function(e){return w(e)===c},t.isStrictMode=function(e){return w(e)===s},t.isSuspense=function(e){return w(e)===h},t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===i||e===f||e===c||e===s||e===h||e===m||"object"==typeof e&&null!==e&&(e.$$typeof===g||e.$$typeof===b||e.$$typeof===l||e.$$typeof===u||e.$$typeof===p||e.$$typeof===v||e.$$typeof===_||e.$$typeof===O||e.$$typeof===y)},t.typeOf=w},function(e,t,n){var r=n(44),o=n(175).f,a=n(80),i=n(180),s=n(135),c=n(302),l=n(307);e.exports=function(e,t){var n,u,d,f,p,h=e.target,m=e.global,b=e.stat;if(n=m?r:b?r[h]||s(h,{}):(r[h]||{}).prototype)for(u in t){if(f=t[u],d=e.noTargetGet?(p=o(n,u))&&p.value:n[u],!l(m?u:h+(b?".":"#")+u,e.forced)&&void 0!==d){if(typeof f==typeof d)continue;c(f,d)}(e.sham||d&&d.sham)&&a(f,"sham",!0),i(n,u,f,e)}}},function(e,t,n){var r=n(177),o=n(133);e.exports=function(e){return r(o(e))}},function(e,t){var n={}.toString;e.exports=function(e){return n.call(e).slice(8,-1)}},function(e,t){e.exports=function(e){if(null==e)throw TypeError("Can't call method on "+e);return e}},function(e,t,n){var r=n(93);e.exports=function(e,t){if(!r(e))return e;var n,o;if(t&&"function"==typeof(n=e.toString)&&!r(o=n.call(e)))return o;if("function"==typeof(n=e.valueOf)&&!r(o=n.call(e)))return o;if(!t&&"function"==typeof(n=e.toString)&&!r(o=n.call(e)))return o;throw TypeError("Can't convert object to primitive value")}},function(e,t,n){var r=n(44),o=n(80);e.exports=function(e,t){try{o(r,e,t)}catch(n){r[e]=t}return t}},function(e,t,n){var r=n(44),o=n(135),a=r["__core-js_shared__"]||o("__core-js_shared__",{});e.exports=a},function(e,t,n){var r=n(183),o=n(184),a=r("keys");e.exports=function(e){return a[e]||(a[e]=o(e))}},function(e,t){e.exports=!1},function(e,t){e.exports={}},function(e,t,n){var r=n(141),o=n(44),a=function(e){return"function"==typeof e?e:void 0};e.exports=function(e,t){return arguments.length<2?a(r[e])||a(o[e]):r[e]&&r[e][t]||o[e]&&o[e][t]}},function(e,t,n){var r=n(44);e.exports=r},function(e,t){var n=Math.ceil,r=Math.floor;e.exports=function(e){return isNaN(e=+e)?0:(e>0?r:n)(e)}},function(e,t){e.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},function(e,t,n){var r=n(133);e.exports=function(e){return Object(r(e))}},function(e,t,n){var r=n(341),o=n(342),a=n(107),i=/^\d+$/,s=Object.prototype.hasOwnProperty,c=r(Object,"keys");var l,u=(l="length",function(e){return null==e?void 0:e[l]});function d(e,t){return t=null==t?9007199254740991:t,(e="number"==typeof e||i.test(e)?+e:-1)>-1&&e%1==0&&e<t}function f(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}function p(e){for(var t=function(e){if(null==e)return[];h(e)||(e=Object(e));var t=e.length;t=t&&f(t)&&(a(e)||o(e))&&t||0;var n=e.constructor,r=-1,i="function"==typeof n&&n.prototype===e,c=Array(t),l=t>0;for(;++r<t;)c[r]=r+"";for(var u in e)l&&d(u,t)||"constructor"==u&&(i||!s.call(e,u))||c.push(u);return c}(e),n=t.length,r=n&&e.length,i=!!r&&f(r)&&(a(e)||o(e)),c=-1,l=[];++c<n;){var u=t[c];(i&&d(u,r)||s.call(e,u))&&l.push(u)}return l}function h(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}var m=c?function(e){var t,n=null==e?void 0:e.constructor;return"function"==typeof n&&n.prototype===e||"function"!=typeof e&&(null!=(t=e)&&f(u(t)))?p(e):h(e)?c(e):[]}:p;e.exports=m},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PureCalendarDay=void 0;var r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=y(n(36)),i=y(n(5)),s=y(n(1)),c=y(n(81)),l=y(n(58)),u=n(31),d=n(42),f=y(n(9)),p=n(37),h=y(n(40)),m=y(n(200)),b=y(n(108)),g=n(24);function y(e){return e&&e.__esModule?e:{default:e}}function v(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}var O=(0,u.forbidExtraProps)((0,a.default)({},d.withStylesPropTypes,{day:l.default.momentObj,daySize:u.nonNegativeInteger,isOutsideDay:s.default.bool,modifiers:b.default,isFocused:s.default.bool,tabIndex:s.default.oneOf([0,-1]),onDayClick:s.default.func,onDayMouseEnter:s.default.func,onDayMouseLeave:s.default.func,renderDayContents:s.default.func,ariaLabelFormat:s.default.string,phrases:s.default.shape((0,h.default)(p.CalendarDayPhrases))})),w={day:(0,f.default)(),daySize:g.DAY_SIZE,isOutsideDay:!1,modifiers:new Set,isFocused:!1,tabIndex:-1,onDayClick:function(){},onDayMouseEnter:function(){},onDayMouseLeave:function(){},renderDayContents:null,ariaLabelFormat:"dddd, LL",phrases:p.CalendarDayPhrases},k=function(e){function t(){var e;v(this,t);for(var n=arguments.length,r=Array(n),o=0;o<n;o++)r[o]=arguments[o];var a=_(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(r)));return a.setButtonRef=a.setButtonRef.bind(a),a}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),o(t,[{key:"shouldComponentUpdate",value:function(e,t){return(0,c.default)(this,e,t)}},{key:"componentDidUpdate",value:function(e){var t=this.props,n=t.isFocused,r=t.tabIndex;0===r&&(n||r!==e.tabIndex)&&this.buttonRef.focus()}},{key:"onDayClick",value:function(e,t){(0,this.props.onDayClick)(e,t)}},{key:"onDayMouseEnter",value:function(e,t){(0,this.props.onDayMouseEnter)(e,t)}},{key:"onDayMouseLeave",value:function(e,t){(0,this.props.onDayMouseLeave)(e,t)}},{key:"onKeyDown",value:function(e,t){var n=this.props.onDayClick,r=t.key;"Enter"!==r&&" "!==r||n(e,t)}},{key:"setButtonRef",value:function(e){this.buttonRef=e}},{key:"render",value:function(){var e=this,t=this.props,n=t.day,o=t.ariaLabelFormat,a=t.daySize,s=t.isOutsideDay,c=t.modifiers,l=t.renderDayContents,u=t.tabIndex,f=t.styles,p=t.phrases;if(!n)return i.default.createElement("td",null);var h=(0,m.default)(n,o,a,c,p),b=h.daySizeStyles,g=h.useDefaultCursor,y=h.selected,v=h.hoveredSpan,_=h.isOutsideRange,O=h.ariaLabel;return i.default.createElement("td",r({},(0,d.css)(f.CalendarDay,g&&f.CalendarDay__defaultCursor,f.CalendarDay__default,s&&f.CalendarDay__outside,c.has("today")&&f.CalendarDay__today,c.has("first-day-of-week")&&f.CalendarDay__firstDayOfWeek,c.has("last-day-of-week")&&f.CalendarDay__lastDayOfWeek,c.has("hovered-offset")&&f.CalendarDay__hovered_offset,c.has("highlighted-calendar")&&f.CalendarDay__highlighted_calendar,c.has("blocked-minimum-nights")&&f.CalendarDay__blocked_minimum_nights,c.has("blocked-calendar")&&f.CalendarDay__blocked_calendar,v&&f.CalendarDay__hovered_span,c.has("selected-span")&&f.CalendarDay__selected_span,c.has("last-in-range")&&f.CalendarDay__last_in_range,c.has("selected-start")&&f.CalendarDay__selected_start,c.has("selected-end")&&f.CalendarDay__selected_end,y&&f.CalendarDay__selected,_&&f.CalendarDay__blocked_out_of_range,b),{role:"button",ref:this.setButtonRef,"aria-label":O,onMouseEnter:function(t){e.onDayMouseEnter(n,t)},onMouseLeave:function(t){e.onDayMouseLeave(n,t)},onMouseUp:function(e){e.currentTarget.blur()},onClick:function(t){e.onDayClick(n,t)},onKeyDown:function(t){e.onKeyDown(n,t)},tabIndex:u}),l?l(n,c):n.format("D"))}}]),t}(i.default.Component);k.propTypes=O,k.defaultProps=w,t.PureCalendarDay=k,t.default=(0,d.withStyles)((function(e){var t=e.reactDates,n=t.color;return{CalendarDay:{boxSizing:"border-box",cursor:"pointer",fontSize:t.font.size,textAlign:"center",":active":{outline:0}},CalendarDay__defaultCursor:{cursor:"default"},CalendarDay__default:{border:"1px solid "+String(n.core.borderLight),color:n.text,background:n.background,":hover":{background:n.core.borderLight,border:"1px double "+String(n.core.borderLight),color:"inherit"}},CalendarDay__hovered_offset:{background:n.core.borderBright,border:"1px double "+String(n.core.borderLight),color:"inherit"},CalendarDay__outside:{border:0,background:n.outside.backgroundColor,color:n.outside.color,":hover":{border:0}},CalendarDay__blocked_minimum_nights:{background:n.minimumNights.backgroundColor,border:"1px solid "+String(n.minimumNights.borderColor),color:n.minimumNights.color,":hover":{background:n.minimumNights.backgroundColor_hover,color:n.minimumNights.color_active},":active":{background:n.minimumNights.backgroundColor_active,color:n.minimumNights.color_active}},CalendarDay__highlighted_calendar:{background:n.highlighted.backgroundColor,color:n.highlighted.color,":hover":{background:n.highlighted.backgroundColor_hover,color:n.highlighted.color_active},":active":{background:n.highlighted.backgroundColor_active,color:n.highlighted.color_active}},CalendarDay__selected_span:{background:n.selectedSpan.backgroundColor,border:"1px solid "+String(n.selectedSpan.borderColor),color:n.selectedSpan.color,":hover":{background:n.selectedSpan.backgroundColor_hover,border:"1px solid "+String(n.selectedSpan.borderColor),color:n.selectedSpan.color_active},":active":{background:n.selectedSpan.backgroundColor_active,border:"1px solid "+String(n.selectedSpan.borderColor),color:n.selectedSpan.color_active}},CalendarDay__last_in_range:{borderRight:n.core.primary},CalendarDay__selected:{background:n.selected.backgroundColor,border:"1px solid "+String(n.selected.borderColor),color:n.selected.color,":hover":{background:n.selected.backgroundColor_hover,border:"1px solid "+String(n.selected.borderColor),color:n.selected.color_active},":active":{background:n.selected.backgroundColor_active,border:"1px solid "+String(n.selected.borderColor),color:n.selected.color_active}},CalendarDay__hovered_span:{background:n.hoveredSpan.backgroundColor,border:"1px solid "+String(n.hoveredSpan.borderColor),color:n.hoveredSpan.color,":hover":{background:n.hoveredSpan.backgroundColor_hover,border:"1px solid "+String(n.hoveredSpan.borderColor),color:n.hoveredSpan.color_active},":active":{background:n.hoveredSpan.backgroundColor_active,border:"1px solid "+String(n.hoveredSpan.borderColor),color:n.hoveredSpan.color_active}},CalendarDay__blocked_calendar:{background:n.blocked_calendar.backgroundColor,border:"1px solid "+String(n.blocked_calendar.borderColor),color:n.blocked_calendar.color,":hover":{background:n.blocked_calendar.backgroundColor_hover,border:"1px solid "+String(n.blocked_calendar.borderColor),color:n.blocked_calendar.color_active},":active":{background:n.blocked_calendar.backgroundColor_active,border:"1px solid "+String(n.blocked_calendar.borderColor),color:n.blocked_calendar.color_active}},CalendarDay__blocked_out_of_range:{background:n.blocked_out_of_range.backgroundColor,border:"1px solid "+String(n.blocked_out_of_range.borderColor),color:n.blocked_out_of_range.color,":hover":{background:n.blocked_out_of_range.backgroundColor_hover,border:"1px solid "+String(n.blocked_out_of_range.borderColor),color:n.blocked_out_of_range.color_active},":active":{background:n.blocked_out_of_range.backgroundColor_active,border:"1px solid "+String(n.blocked_out_of_range.borderColor),color:n.blocked_out_of_range.color_active}},CalendarDay__selected_start:{},CalendarDay__selected_end:{},CalendarDay__today:{},CalendarDay__firstDayOfWeek:{},CalendarDay__lastDayOfWeek:{}}}))(k)},function(e,t,n){"use strict";var r=n(350);e.exports=Function.prototype.bind||r},function(e,t,n){"use strict";e.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var e={},t=Symbol("test"),n=Object(t);if("string"==typeof t)return!1;if("[object Symbol]"!==Object.prototype.toString.call(t))return!1;if("[object Symbol]"!==Object.prototype.toString.call(n))return!1;for(t in e[t]=42,e)return!1;if("function"==typeof Object.keys&&0!==Object.keys(e).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(e).length)return!1;var r=Object.getOwnPropertySymbols(e);if(1!==r.length||r[0]!==t)return!1;if(!Object.prototype.propertyIsEnumerable.call(e,t))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var o=Object.getOwnPropertyDescriptor(e,t);if(42!==o.value||!0!==o.enumerable)return!1}return!0}},function(e,t,n){e.exports=n(366)},function(e,t,n){"use strict";var r=n(57),o=n(95),a=n(207),i=n(209),s=n(368),c=o(i(),Object);r(c,{getPolyfill:i,implementation:a,shim:s}),e.exports=c},function(e,t,n){"use strict";function r(e,t,n){var r="number"==typeof t,o="number"==typeof n,a="number"==typeof e;return r&&o?t+n:r&&a?t+e:r?t:o&&a?n+e:o?n:a?2*e:0}Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){var n=e.font.input,o=n.lineHeight,a=n.lineHeight_small,i=e.spacing,s=i.inputPadding,c=i.displayTextPaddingVertical,l=i.displayTextPaddingTop,u=i.displayTextPaddingBottom,d=i.displayTextPaddingVertical_small,f=i.displayTextPaddingTop_small,p=i.displayTextPaddingBottom_small,h=t?a:o,m=t?r(d,f,p):r(c,l,u);return parseInt(h,10)+2*s+m}},function(e,t){e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){var n=r.default.isMoment(e)?e:(0,o.default)(e,t);return n?n.format(a.DISPLAY_FORMAT):null};var r=i(n(9)),o=i(n(83)),a=n(24);function i(e){return e&&e.__esModule?e:{default:e}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t,n,a){var i=t.clone().startOf("month");a&&(i=i.startOf("week"));if((0,r.default)(e,i))return!1;var s=t.clone().add(n-1,"months").endOf("month");a&&(s=s.endOf("week"));return!(0,o.default)(e,s)};var r=a(n(99)),o=a(n(113));function a(e){return e&&e.__esModule?e:{default:e}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PureDayPicker=t.defaultProps=void 0;var r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=M(n(36)),i=M(n(5)),s=M(n(1)),c=M(n(81)),l=n(31),u=n(42),d=M(n(9)),f=M(n(222)),p=M(n(85)),h=M(n(149)),m=n(37),b=M(n(40)),g=M(n(204)),y=M(n(383)),v=n(386),_=M(v),O=M(n(388)),w=M(n(205)),k=M(n(203)),S=M(n(389)),D=M(n(154)),C=M(n(108)),E=M(n(84)),j=M(n(75)),F=M(n(97)),P=n(24);function M(e){return e&&e.__esModule?e:{default:e}}function x(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}var T=(0,l.forbidExtraProps)((0,a.default)({},u.withStylesPropTypes,{enableOutsideDays:s.default.bool,numberOfMonths:s.default.number,orientation:E.default,withPortal:s.default.bool,onOutsideClick:s.default.func,hidden:s.default.bool,initialVisibleMonth:s.default.func,firstDayOfWeek:j.default,renderCalendarInfo:s.default.func,calendarInfoPosition:F.default,hideKeyboardShortcutsPanel:s.default.bool,daySize:l.nonNegativeInteger,isRTL:s.default.bool,verticalHeight:l.nonNegativeInteger,noBorder:s.default.bool,transitionDuration:l.nonNegativeInteger,verticalBorderSpacing:l.nonNegativeInteger,horizontalMonthPadding:l.nonNegativeInteger,navPrev:s.default.node,navNext:s.default.node,noNavButtons:s.default.bool,onPrevMonthClick:s.default.func,onNextMonthClick:s.default.func,onMonthChange:s.default.func,onYearChange:s.default.func,onMultiplyScrollableMonths:s.default.func,renderMonthText:(0,l.mutuallyExclusiveProps)(s.default.func,"renderMonthText","renderMonthElement"),renderMonthElement:(0,l.mutuallyExclusiveProps)(s.default.func,"renderMonthText","renderMonthElement"),modifiers:s.default.objectOf(s.default.objectOf(C.default)),renderCalendarDay:s.default.func,renderDayContents:s.default.func,onDayClick:s.default.func,onDayMouseEnter:s.default.func,onDayMouseLeave:s.default.func,isFocused:s.default.bool,getFirstFocusableDay:s.default.func,onBlur:s.default.func,showKeyboardShortcuts:s.default.bool,monthFormat:s.default.string,weekDayFormat:s.default.string,phrases:s.default.shape((0,b.default)(m.DayPickerPhrases)),dayAriaLabelFormat:s.default.string})),N=t.defaultProps={enableOutsideDays:!1,numberOfMonths:2,orientation:P.HORIZONTAL_ORIENTATION,withPortal:!1,onOutsideClick:function(){},hidden:!1,initialVisibleMonth:function(){return(0,d.default)()},firstDayOfWeek:null,renderCalendarInfo:null,calendarInfoPosition:P.INFO_POSITION_BOTTOM,hideKeyboardShortcutsPanel:!1,daySize:P.DAY_SIZE,isRTL:!1,verticalHeight:null,noBorder:!1,transitionDuration:void 0,verticalBorderSpacing:void 0,horizontalMonthPadding:13,navPrev:null,navNext:null,noNavButtons:!1,onPrevMonthClick:function(){},onNextMonthClick:function(){},onMonthChange:function(){},onYearChange:function(){},onMultiplyScrollableMonths:function(){},renderMonthText:null,renderMonthElement:null,modifiers:{},renderCalendarDay:void 0,renderDayContents:null,onDayClick:function(){},onDayMouseEnter:function(){},onDayMouseLeave:function(){},isFocused:!1,getFirstFocusableDay:null,onBlur:function(){},showKeyboardShortcuts:!1,monthFormat:"MMMM YYYY",weekDayFormat:"dd",phrases:m.DayPickerPhrases,dayAriaLabelFormat:void 0},I=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e)),r=e.hidden?(0,d.default)():e.initialVisibleMonth(),o=r.clone().startOf("month");e.getFirstFocusableDay&&(o=e.getFirstFocusableDay(r));var a=e.horizontalMonthPadding,i=e.isRTL&&n.isHorizontal()?-(0,w.default)(e.daySize,a):0;return n.hasSetInitialVisibleMonth=!e.hidden,n.state={currentMonth:r,monthTransition:null,translationValue:i,scrollableMonthMultiple:1,calendarMonthWidth:(0,w.default)(e.daySize,a),focusedDate:!e.hidden||e.isFocused?o:null,nextFocusedDate:null,showKeyboardShortcuts:e.showKeyboardShortcuts,onKeyboardShortcutsPanelClose:function(){},isTouchDevice:(0,p.default)(),withMouseInteractions:!0,calendarInfoWidth:0,monthTitleHeight:null,hasSetHeight:!1},n.setCalendarMonthWeeks(r),n.calendarMonthGridHeight=0,n.setCalendarInfoWidthTimeout=null,n.onKeyDown=n.onKeyDown.bind(n),n.throttledKeyDown=(0,f.default)(n.onFinalKeyDown,200,{trailing:!1}),n.onPrevMonthClick=n.onPrevMonthClick.bind(n),n.onNextMonthClick=n.onNextMonthClick.bind(n),n.onMonthChange=n.onMonthChange.bind(n),n.onYearChange=n.onYearChange.bind(n),n.multiplyScrollableMonths=n.multiplyScrollableMonths.bind(n),n.updateStateAfterMonthTransition=n.updateStateAfterMonthTransition.bind(n),n.openKeyboardShortcutsPanel=n.openKeyboardShortcutsPanel.bind(n),n.closeKeyboardShortcutsPanel=n.closeKeyboardShortcutsPanel.bind(n),n.setCalendarInfoRef=n.setCalendarInfoRef.bind(n),n.setContainerRef=n.setContainerRef.bind(n),n.setTransitionContainerRef=n.setTransitionContainerRef.bind(n),n.setMonthTitleHeight=n.setMonthTitleHeight.bind(n),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),o(t,[{key:"componentDidMount",value:function(){var e=this.state.currentMonth;this.calendarInfo?this.setState({isTouchDevice:(0,p.default)(),calendarInfoWidth:(0,k.default)(this.calendarInfo,"width",!0,!0)}):this.setState({isTouchDevice:(0,p.default)()}),this.setCalendarMonthWeeks(e)}},{key:"componentWillReceiveProps",value:function(e){var t=e.hidden,n=e.isFocused,r=e.showKeyboardShortcuts,o=e.onBlur,a=e.renderMonthText,i=e.horizontalMonthPadding,s=this.state.currentMonth;t||this.hasSetInitialVisibleMonth||(this.hasSetInitialVisibleMonth=!0,this.setState({currentMonth:e.initialVisibleMonth()}));var c=this.props,l=c.daySize,u=c.isFocused,d=c.renderMonthText;if(e.daySize!==l&&this.setState({calendarMonthWidth:(0,w.default)(e.daySize,i)}),n!==u)if(n){var f=this.getFocusedDay(s),p=this.state.onKeyboardShortcutsPanelClose;e.showKeyboardShortcuts&&(p=o),this.setState({showKeyboardShortcuts:r,onKeyboardShortcutsPanelClose:p,focusedDate:f,withMouseInteractions:!1})}else this.setState({focusedDate:null});a!==d&&this.setState({monthTitleHeight:null})}},{key:"shouldComponentUpdate",value:function(e,t){return(0,c.default)(this,e,t)}},{key:"componentWillUpdate",value:function(){var e=this,t=this.props.transitionDuration;this.calendarInfo&&(this.setCalendarInfoWidthTimeout=setTimeout((function(){var t=e.state.calendarInfoWidth,n=(0,k.default)(e.calendarInfo,"width",!0,!0);t!==n&&e.setState({calendarInfoWidth:n})}),t))}},{key:"componentDidUpdate",value:function(e){var t=this.props,n=t.orientation,r=t.daySize,o=t.isFocused,a=t.numberOfMonths,i=this.state,s=i.focusedDate,c=i.monthTitleHeight;if(this.isHorizontal()&&(n!==e.orientation||r!==e.daySize)){var l=this.calendarMonthWeeks.slice(1,a+1),u=c+Math.max.apply(Math,[0].concat(x(l)))*(r-1)+1;this.adjustDayPickerHeight(u)}e.isFocused||!o||s||this.container.focus()}},{key:"componentWillUnmount",value:function(){clearTimeout(this.setCalendarInfoWidthTimeout)}},{key:"onKeyDown",value:function(e){e.stopPropagation(),P.MODIFIER_KEY_NAMES.has(e.key)||this.throttledKeyDown(e)}},{key:"onFinalKeyDown",value:function(e){this.setState({withMouseInteractions:!1});var t=this.props,n=t.onBlur,r=t.isRTL,o=this.state,a=o.focusedDate,i=o.showKeyboardShortcuts;if(a){var s=a.clone(),c=!1,l=(0,S.default)(),u=function(){l&&l.focus()};switch(e.key){case"ArrowUp":e.preventDefault(),s.subtract(1,"week"),c=this.maybeTransitionPrevMonth(s);break;case"ArrowLeft":e.preventDefault(),r?s.add(1,"day"):s.subtract(1,"day"),c=this.maybeTransitionPrevMonth(s);break;case"Home":e.preventDefault(),s.startOf("week"),c=this.maybeTransitionPrevMonth(s);break;case"PageUp":e.preventDefault(),s.subtract(1,"month"),c=this.maybeTransitionPrevMonth(s);break;case"ArrowDown":e.preventDefault(),s.add(1,"week"),c=this.maybeTransitionNextMonth(s);break;case"ArrowRight":e.preventDefault(),r?s.subtract(1,"day"):s.add(1,"day"),c=this.maybeTransitionNextMonth(s);break;case"End":e.preventDefault(),s.endOf("week"),c=this.maybeTransitionNextMonth(s);break;case"PageDown":e.preventDefault(),s.add(1,"month"),c=this.maybeTransitionNextMonth(s);break;case"?":this.openKeyboardShortcutsPanel(u);break;case"Escape":i?this.closeKeyboardShortcutsPanel():n()}c||this.setState({focusedDate:s})}}},{key:"onPrevMonthClick",value:function(e,t){var n=this.props,r=n.daySize,o=n.isRTL,a=n.numberOfMonths,i=this.state,s=i.calendarMonthWidth,c=i.monthTitleHeight;t&&t.preventDefault();var l=void 0;if(this.isVertical())l=c+this.calendarMonthWeeks[0]*(r-1)+1;else if(this.isHorizontal()){l=s,o&&(l=-2*s);var u=this.calendarMonthWeeks.slice(0,a),d=c+Math.max.apply(Math,[0].concat(x(u)))*(r-1)+1;this.adjustDayPickerHeight(d)}this.setState({monthTransition:"prev",translationValue:l,focusedDate:null,nextFocusedDate:e})}},{key:"onMonthChange",value:function(e){this.setCalendarMonthWeeks(e),this.calculateAndSetDayPickerHeight(),this.setState({monthTransition:"month_selection",translationValue:1e-5,focusedDate:null,nextFocusedDate:e,currentMonth:e})}},{key:"onYearChange",value:function(e){this.setCalendarMonthWeeks(e),this.calculateAndSetDayPickerHeight(),this.setState({monthTransition:"year_selection",translationValue:1e-4,focusedDate:null,nextFocusedDate:e,currentMonth:e})}},{key:"onNextMonthClick",value:function(e,t){var n=this.props,r=n.isRTL,o=n.numberOfMonths,a=n.daySize,i=this.state,s=i.calendarMonthWidth,c=i.monthTitleHeight;t&&t.preventDefault();var l=void 0;if(this.isVertical()&&(l=-(c+this.calendarMonthWeeks[1]*(a-1)+1)),this.isHorizontal()){l=-s,r&&(l=0);var u=this.calendarMonthWeeks.slice(2,o+2),d=c+Math.max.apply(Math,[0].concat(x(u)))*(a-1)+1;this.adjustDayPickerHeight(d)}this.setState({monthTransition:"next",translationValue:l,focusedDate:null,nextFocusedDate:e})}},{key:"getFirstDayOfWeek",value:function(){var e=this.props.firstDayOfWeek;return null==e?d.default.localeData().firstDayOfWeek():e}},{key:"getFirstVisibleIndex",value:function(){var e=this.props.orientation,t=this.state.monthTransition;if(e===P.VERTICAL_SCROLLABLE)return 0;var n=1;return"prev"===t?n-=1:"next"===t&&(n+=1),n}},{key:"getFocusedDay",value:function(e){var t=this.props,n=t.getFirstFocusableDay,r=t.numberOfMonths,o=void 0;return n&&(o=n(e)),!e||o&&(0,D.default)(o,e,r)||(o=e.clone().startOf("month")),o}},{key:"setMonthTitleHeight",value:function(e){var t=this;this.setState({monthTitleHeight:e},(function(){t.calculateAndSetDayPickerHeight()}))}},{key:"setCalendarMonthWeeks",value:function(e){var t=this.props.numberOfMonths;this.calendarMonthWeeks=[];for(var n=e.clone().subtract(1,"months"),r=this.getFirstDayOfWeek(),o=0;o<t+2;o+=1){var a=(0,O.default)(n,r);this.calendarMonthWeeks.push(a),n=n.add(1,"months")}}},{key:"setContainerRef",value:function(e){this.container=e}},{key:"setCalendarInfoRef",value:function(e){this.calendarInfo=e}},{key:"setTransitionContainerRef",value:function(e){this.transitionContainer=e}},{key:"maybeTransitionNextMonth",value:function(e){var t=this.props.numberOfMonths,n=this.state,r=n.currentMonth,o=n.focusedDate,a=e.month(),i=o.month(),s=(0,D.default)(e,r,t);return a!==i&&!s&&(this.onNextMonthClick(e),!0)}},{key:"maybeTransitionPrevMonth",value:function(e){var t=this.props.numberOfMonths,n=this.state,r=n.currentMonth,o=n.focusedDate,a=e.month(),i=o.month(),s=(0,D.default)(e,r,t);return a!==i&&!s&&(this.onPrevMonthClick(e),!0)}},{key:"multiplyScrollableMonths",value:function(e){var t=this.props.onMultiplyScrollableMonths;e&&e.preventDefault(),t&&t(e),this.setState((function(e){return{scrollableMonthMultiple:e.scrollableMonthMultiple+1}}))}},{key:"isHorizontal",value:function(){return this.props.orientation===P.HORIZONTAL_ORIENTATION}},{key:"isVertical",value:function(){var e=this.props.orientation;return e===P.VERTICAL_ORIENTATION||e===P.VERTICAL_SCROLLABLE}},{key:"updateStateAfterMonthTransition",value:function(){var e=this,t=this.props,n=t.onPrevMonthClick,r=t.onNextMonthClick,o=t.numberOfMonths,a=t.onMonthChange,i=t.onYearChange,s=t.isRTL,c=this.state,l=c.currentMonth,u=c.monthTransition,d=c.focusedDate,f=c.nextFocusedDate,p=c.withMouseInteractions,h=c.calendarMonthWidth;if(u){var m=l.clone(),b=this.getFirstDayOfWeek();if("prev"===u){m.subtract(1,"month"),n&&n(m);var g=m.clone().subtract(1,"month"),y=(0,O.default)(g,b);this.calendarMonthWeeks=[y].concat(x(this.calendarMonthWeeks.slice(0,-1)))}else if("next"===u){m.add(1,"month"),r&&r(m);var v=m.clone().add(o,"month"),_=(0,O.default)(v,b);this.calendarMonthWeeks=[].concat(x(this.calendarMonthWeeks.slice(1)),[_])}else"month_selection"===u?a&&a(m):"year_selection"===u&&i&&i(m);var w=null;f?w=f:d||p||(w=this.getFocusedDay(m)),this.setState({currentMonth:m,monthTransition:null,translationValue:s&&this.isHorizontal()?-h:0,nextFocusedDate:null,focusedDate:w},(function(){if(p){var t=(0,S.default)();t&&t!==document.body&&e.container.contains(t)&&t.blur()}}))}}},{key:"adjustDayPickerHeight",value:function(e){var t=this,n=e+23;n!==this.calendarMonthGridHeight&&(this.transitionContainer.style.height=String(n)+"px",this.calendarMonthGridHeight||setTimeout((function(){t.setState({hasSetHeight:!0})}),0),this.calendarMonthGridHeight=n)}},{key:"calculateAndSetDayPickerHeight",value:function(){var e=this.props,t=e.daySize,n=e.numberOfMonths,r=this.state.monthTitleHeight,o=this.calendarMonthWeeks.slice(1,n+1),a=r+Math.max.apply(Math,[0].concat(x(o)))*(t-1)+1;this.isHorizontal()&&this.adjustDayPickerHeight(a)}},{key:"openKeyboardShortcutsPanel",value:function(e){this.setState({showKeyboardShortcuts:!0,onKeyboardShortcutsPanelClose:e})}},{key:"closeKeyboardShortcutsPanel",value:function(){var e=this.state.onKeyboardShortcutsPanelClose;e&&e(),this.setState({onKeyboardShortcutsPanelClose:null,showKeyboardShortcuts:!1})}},{key:"renderNavigation",value:function(){var e=this,t=this.props,n=t.navPrev,r=t.navNext,o=t.noNavButtons,a=t.orientation,s=t.phrases,c=t.isRTL;if(o)return null;var l=void 0;return l=a===P.VERTICAL_SCROLLABLE?this.multiplyScrollableMonths:function(t){e.onNextMonthClick(null,t)},i.default.createElement(y.default,{onPrevMonthClick:function(t){e.onPrevMonthClick(null,t)},onNextMonthClick:l,navPrev:n,navNext:r,orientation:a,phrases:s,isRTL:c})}},{key:"renderWeekHeader",value:function(e){var t=this.props,n=t.daySize,o=t.horizontalMonthPadding,a=t.orientation,s=t.weekDayFormat,c=t.styles,l=this.state.calendarMonthWidth,f=a===P.VERTICAL_SCROLLABLE,p={left:e*l},h={marginLeft:-l/2},m={};this.isHorizontal()?m=p:this.isVertical()&&!f&&(m=h);for(var b=this.getFirstDayOfWeek(),g=[],y=0;y<7;y+=1)g.push(i.default.createElement("li",r({key:y},(0,u.css)(c.DayPicker_weekHeader_li,{width:n})),i.default.createElement("small",null,(0,d.default)().day((y+b)%7).format(s))));return i.default.createElement("div",r({},(0,u.css)(c.DayPicker_weekHeader,this.isVertical()&&c.DayPicker_weekHeader__vertical,f&&c.DayPicker_weekHeader__verticalScrollable,m,{padding:"0 "+String(o)+"px"}),{key:"week-"+String(e)}),i.default.createElement("ul",(0,u.css)(c.DayPicker_weekHeader_ul),g))}},{key:"render",value:function(){for(var e=this,t=this.state,n=t.calendarMonthWidth,o=t.currentMonth,a=t.monthTransition,s=t.translationValue,c=t.scrollableMonthMultiple,l=t.focusedDate,d=t.showKeyboardShortcuts,f=t.isTouchDevice,p=t.hasSetHeight,m=t.calendarInfoWidth,b=t.monthTitleHeight,y=this.props,O=y.enableOutsideDays,w=y.numberOfMonths,k=y.orientation,S=y.modifiers,D=y.withPortal,C=y.onDayClick,E=y.onDayMouseEnter,j=y.onDayMouseLeave,F=y.firstDayOfWeek,M=y.renderMonthText,x=y.renderCalendarDay,T=y.renderDayContents,N=y.renderCalendarInfo,I=y.renderMonthElement,R=y.calendarInfoPosition,A=y.hideKeyboardShortcutsPanel,L=y.onOutsideClick,U=y.monthFormat,B=y.daySize,H=y.isFocused,K=y.isRTL,z=y.styles,q=y.theme,V=y.phrases,W=y.verticalHeight,G=y.dayAriaLabelFormat,Y=y.noBorder,$=y.transitionDuration,Q=y.verticalBorderSpacing,Z=y.horizontalMonthPadding,X=q.reactDates.spacing.dayPickerHorizontalPadding,J=this.isHorizontal(),ee=this.isVertical()?1:w,te=[],ne=0;ne<ee;ne+=1)te.push(this.renderWeekHeader(ne));var re=k===P.VERTICAL_SCROLLABLE,oe=void 0;J?oe=this.calendarMonthGridHeight:!this.isVertical()||re||D||(oe=W||1.75*n);var ae=null!==a,ie=!ae&&H,se=v.BOTTOM_RIGHT;this.isVertical()&&(se=D?v.TOP_LEFT:v.TOP_RIGHT);var ce=J&&p,le=R===P.INFO_POSITION_TOP,ue=R===P.INFO_POSITION_BOTTOM,de=R===P.INFO_POSITION_BEFORE,fe=R===P.INFO_POSITION_AFTER,pe=de||fe,he=N&&i.default.createElement("div",r({ref:this.setCalendarInfoRef},(0,u.css)(pe&&z.DayPicker_calendarInfo__horizontal)),N()),me=N&&pe?m:0,be=this.getFirstVisibleIndex(),ge=n*w+2*X,ye=ge+me+1,ve={width:J&&ge,height:oe},_e={width:J&&ge},Oe={width:J&&ye,marginLeft:J&&D?-ye/2:null,marginTop:J&&D?-n/2:null};return i.default.createElement("div",r({role:"application","aria-label":V.calendarLabel},(0,u.css)(z.DayPicker,J&&z.DayPicker__horizontal,re&&z.DayPicker__verticalScrollable,J&&D&&z.DayPicker_portal__horizontal,this.isVertical()&&D&&z.DayPicker_portal__vertical,Oe,!b&&z.DayPicker__hidden,!Y&&z.DayPicker__withBorder)),i.default.createElement(h.default,{onOutsideClick:L},(le||de)&&he,i.default.createElement("div",(0,u.css)(_e,pe&&J&&z.DayPicker_wrapper__horizontal),i.default.createElement("div",r({},(0,u.css)(z.DayPicker_weekHeaders,J&&z.DayPicker_weekHeaders__horizontal),{"aria-hidden":"true",role:"presentation"}),te),i.default.createElement("div",r({},(0,u.css)(z.DayPicker_focusRegion),{ref:this.setContainerRef,onClick:function(e){e.stopPropagation()},onKeyDown:this.onKeyDown,onMouseUp:function(){e.setState({withMouseInteractions:!0})},role:"region",tabIndex:-1}),!re&&this.renderNavigation(),i.default.createElement("div",r({},(0,u.css)(z.DayPicker_transitionContainer,ce&&z.DayPicker_transitionContainer__horizontal,this.isVertical()&&z.DayPicker_transitionContainer__vertical,re&&z.DayPicker_transitionContainer__verticalScrollable,ve),{ref:this.setTransitionContainerRef}),i.default.createElement(g.default,{setMonthTitleHeight:b?void 0:this.setMonthTitleHeight,translationValue:s,enableOutsideDays:O,firstVisibleMonthIndex:be,initialMonth:o,isAnimating:ae,modifiers:S,orientation:k,numberOfMonths:w*c,onDayClick:C,onDayMouseEnter:E,onDayMouseLeave:j,onMonthChange:this.onMonthChange,onYearChange:this.onYearChange,renderMonthText:M,renderCalendarDay:x,renderDayContents:T,renderMonthElement:I,onMonthTransitionEnd:this.updateStateAfterMonthTransition,monthFormat:U,daySize:B,firstDayOfWeek:F,isFocused:ie,focusedDate:l,phrases:V,isRTL:K,dayAriaLabelFormat:G,transitionDuration:$,verticalBorderSpacing:Q,horizontalMonthPadding:Z}),re&&this.renderNavigation()),!f&&!A&&i.default.createElement(_.default,{block:this.isVertical()&&!D,buttonLocation:se,showKeyboardShortcutsPanel:d,openKeyboardShortcutsPanel:this.openKeyboardShortcutsPanel,closeKeyboardShortcutsPanel:this.closeKeyboardShortcutsPanel,phrases:V}))),(ue||fe)&&he))}}]),t}(i.default.Component);I.propTypes=T,I.defaultProps=N,t.PureDayPicker=I,t.default=(0,u.withStyles)((function(e){var t=e.reactDates,n=t.color,r=t.font,o=t.noScrollBarOnVerticalScrollable,i=t.spacing,s=t.zIndex;return{DayPicker:{background:n.background,position:"relative",textAlign:"left"},DayPicker__horizontal:{background:n.background},DayPicker__verticalScrollable:{height:"100%"},DayPicker__hidden:{visibility:"hidden"},DayPicker__withBorder:{boxShadow:"0 2px 6px rgba(0, 0, 0, 0.05), 0 0 0 1px rgba(0, 0, 0, 0.07)",borderRadius:3},DayPicker_portal__horizontal:{boxShadow:"none",position:"absolute",left:"50%",top:"50%"},DayPicker_portal__vertical:{position:"initial"},DayPicker_focusRegion:{outline:"none"},DayPicker_calendarInfo__horizontal:{display:"inline-block",verticalAlign:"top"},DayPicker_wrapper__horizontal:{display:"inline-block",verticalAlign:"top"},DayPicker_weekHeaders:{position:"relative"},DayPicker_weekHeaders__horizontal:{marginLeft:i.dayPickerHorizontalPadding},DayPicker_weekHeader:{color:n.placeholderText,position:"absolute",top:62,zIndex:s+2,textAlign:"left"},DayPicker_weekHeader__vertical:{left:"50%"},DayPicker_weekHeader__verticalScrollable:{top:0,display:"table-row",borderBottom:"1px solid "+String(n.core.border),background:n.background,marginLeft:0,left:0,width:"100%",textAlign:"center"},DayPicker_weekHeader_ul:{listStyle:"none",margin:"1px 0",paddingLeft:0,paddingRight:0,fontSize:r.size},DayPicker_weekHeader_li:{display:"inline-block",textAlign:"center"},DayPicker_transitionContainer:{position:"relative",overflow:"hidden",borderRadius:3},DayPicker_transitionContainer__horizontal:{transition:"height 0.2s ease-in-out"},DayPicker_transitionContainer__vertical:{width:"100%"},DayPicker_transitionContainer__verticalScrollable:(0,a.default)({paddingTop:20,height:"100%",position:"absolute",top:0,bottom:0,right:0,left:0,overflowY:"scroll"},o&&{"-webkitOverflowScrolling":"touch","::-webkit-scrollbar":{"-webkit-appearance":"none",display:"none"}})}}))(I)},function(e,t,n){"use strict";var r=n(26),o=r("%TypeError%"),a=r("%SyntaxError%"),i=n(74),s={"Property Descriptor":function(e,t){if("Object"!==e(t))return!1;var n={"[[Configurable]]":!0,"[[Enumerable]]":!0,"[[Get]]":!0,"[[Set]]":!0,"[[Value]]":!0,"[[Writable]]":!0};for(var r in t)if(i(t,r)&&!n[r])return!1;var a=i(t,"[[Value]]"),s=i(t,"[[Get]]")||i(t,"[[Set]]");if(a&&s)throw new o("Property Descriptors may not be both accessor and data descriptors");return!0}};e.exports=function(e,t,n,r){var i=s[t];if("function"!=typeof i)throw new a("unknown record type: "+t);if(!i(e,r))throw new o(n+" must be a "+t)}},function(e,t,n){"use strict";e.exports=Number.isNaN||function(e){return e!=e}},function(e,t,n){"use strict";var r,o,a=Function.prototype.toString,i="object"==typeof Reflect&&null!==Reflect&&Reflect.apply;if("function"==typeof i&&"function"==typeof Object.defineProperty)try{r=Object.defineProperty({},"length",{get:function(){throw o}}),o={},i((function(){throw 42}),null,r)}catch(e){e!==o&&(i=null)}else i=null;var s=/^\s*class\b/,c=function(e){try{var t=a.call(e);return s.test(t)}catch(e){return!1}},l=Object.prototype.toString,u="function"==typeof Symbol&&!!Symbol.toStringTag,d="object"==typeof document&&void 0===document.all&&void 0!==document.all?document.all:{};e.exports=i?function(e){if(e===d)return!0;if(!e)return!1;if("function"!=typeof e&&"object"!=typeof e)return!1;if("function"==typeof e&&!e.prototype)return!0;try{i(e,null,r)}catch(e){if(e!==o)return!1}return!c(e)}:function(e){if(e===d)return!0;if(!e)return!1;if("function"!=typeof e&&"object"!=typeof e)return!1;if("function"==typeof e&&!e.prototype)return!0;if(u)return function(e){try{return!c(e)&&(a.call(e),!0)}catch(e){return!1}}(e);if(c(e))return!1;var t=l.call(e);return"[object Function]"===t||"[object GeneratorFunction]"===t}},,,,,,,function(e,t,n){"use strict";var r=Object.assign||function(e){for(var t,n=1;n<arguments.length;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e};Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t=e.size,n=void 0===t?24:t,o=e.onClick,a=(e.icon,e.className),s=function(e,t){var n={};for(var r in e)0<=t.indexOf(r)||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}(e,["size","onClick","icon","className"]),c=["gridicon","gridicons-line-graph",a,!1,!1,!1].filter(Boolean).join(" ");return i.default.createElement("svg",r({className:c,height:n,width:n,onClick:o},s,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"}),i.default.createElement("g",null,i.default.createElement("path",{d:"M3 19h18v2H3zm3-3c1.1 0 2-.9 2-2 0-.5-.2-1-.5-1.3L8.8 10H9c.5 0 1-.2 1.3-.5l2.7 1.4v.1c0 1.1.9 2 2 2s2-.9 2-2c0-.5-.2-.9-.5-1.3L17.8 7h.2c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2c0 .5.2 1 .5 1.3L15.2 9H15c-.5 0-1 .2-1.3.5L11 8.2V8c0-1.1-.9-2-2-2s-2 .9-2 2c0 .5.2 1 .5 1.3L6.2 12H6c-1.1 0-2 .9-2 2s.9 2 2 2z"})))};var o,a=n(5),i=(o=a)&&o.__esModule?o:{default:o};e.exports=t.default},function(e,t,n){"use strict";var r=Object.assign||function(e){for(var t,n=1;n<arguments.length;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e};Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n=e.size,o=void 0===n?24:n,a=e.onClick,s=(e.icon,e.className),c=function(e,t){var n={};for(var r in e)0<=t.indexOf(r)||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}(e,["size","onClick","icon","className"]),l=["gridicon","gridicons-stats-alt",s,!1,!1,(t=o,!(0!=t%18)&&"needs-offset-y")].filter(Boolean).join(" ");return i.default.createElement("svg",r({className:l,height:o,width:o,onClick:a},c,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"}),i.default.createElement("g",null,i.default.createElement("path",{d:"M21 21H3v-2h18v2zM8 10H4v7h4v-7zm6-7h-4v14h4V3zm6 3h-4v11h4V6z"})))};var o,a=n(5),i=(o=a)&&o.__esModule?o:{default:o};e.exports=t.default},function(e,t,n){"use strict";var r=Object.assign||function(e){for(var t,n=1;n<arguments.length;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e};Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n=e.size,o=void 0===n?24:n,a=e.onClick,s=(e.icon,e.className),c=function(e,t){var n={};for(var r in e)0<=t.indexOf(r)||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}(e,["size","onClick","icon","className"]),l=["gridicon","gridicons-star",s,(t=o,!(0!=t%18)&&"needs-offset"),!1,!1].filter(Boolean).join(" ");return i.default.createElement("svg",r({className:l,height:o,width:o,onClick:a},c,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"}),i.default.createElement("g",null,i.default.createElement("path",{d:"M12 2l2.582 6.953L22 9.257l-5.822 4.602L18.18 21 12 16.89 5.82 21l2.002-7.14L2 9.256l7.418-.304"})))};var o,a=n(5),i=(o=a)&&o.__esModule?o:{default:o};e.exports=t.default},function(e,t,n){"use strict";var r=Object.assign||function(e){for(var t,n=1;n<arguments.length;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e};Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t=e.size,n=void 0===t?24:t,o=e.onClick,a=(e.icon,e.className),s=function(e,t){var n={};for(var r in e)0<=t.indexOf(r)||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}(e,["size","onClick","icon","className"]),c=["gridicon","gridicons-chevron-down",a,!1,!1,!1].filter(Boolean).join(" ");return i.default.createElement("svg",r({className:c,height:n,width:n,onClick:o},s,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"}),i.default.createElement("g",null,i.default.createElement("path",{d:"M20 9l-8 8-8-8 1.414-1.414L12 14.172l6.586-6.586"})))};var o,a=n(5),i=(o=a)&&o.__esModule?o:{default:o};e.exports=t.default},function(e,t,n){"use strict";var r=n(23),o=n(22),a=n(25);n(1);function i(e,t){return e.replace(new RegExp("(^|\\s)"+t+"(?:\\s|$)","g"),"$1").replace(/\s+/g," ").replace(/^\s*|\s*$/g,"")}var s=n(5),c=n.n(s),l=n(65),u=function(e,t){return e&&t&&t.split(" ").forEach((function(t){return r=t,void((n=e).classList?n.classList.remove(r):"string"==typeof n.className?n.className=i(n.className,r):n.setAttribute("class",i(n.className&&n.className.baseVal||"",r)));var n,r}))},d=function(e){function t(){for(var t,n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return(t=e.call.apply(e,[this].concat(r))||this).appliedClasses={appear:{},enter:{},exit:{}},t.onEnter=function(e,n){var r=t.resolveArguments(e,n),o=r[0],a=r[1];t.removeClasses(o,"exit"),t.addClass(o,a?"appear":"enter","base"),t.props.onEnter&&t.props.onEnter(e,n)},t.onEntering=function(e,n){var r=t.resolveArguments(e,n),o=r[0],a=r[1]?"appear":"enter";t.addClass(o,a,"active"),t.props.onEntering&&t.props.onEntering(e,n)},t.onEntered=function(e,n){var r=t.resolveArguments(e,n),o=r[0],a=r[1]?"appear":"enter";t.removeClasses(o,a),t.addClass(o,a,"done"),t.props.onEntered&&t.props.onEntered(e,n)},t.onExit=function(e){var n=t.resolveArguments(e)[0];t.removeClasses(n,"appear"),t.removeClasses(n,"enter"),t.addClass(n,"exit","base"),t.props.onExit&&t.props.onExit(e)},t.onExiting=function(e){var n=t.resolveArguments(e)[0];t.addClass(n,"exit","active"),t.props.onExiting&&t.props.onExiting(e)},t.onExited=function(e){var n=t.resolveArguments(e)[0];t.removeClasses(n,"exit"),t.addClass(n,"exit","done"),t.props.onExited&&t.props.onExited(e)},t.resolveArguments=function(e,n){return t.props.nodeRef?[t.props.nodeRef.current,e]:[e,n]},t.getClassNames=function(e){var n=t.props.classNames,r="string"==typeof n,o=r?""+(r&&n?n+"-":"")+e:n[e];return{baseClassName:o,activeClassName:r?o+"-active":n[e+"Active"],doneClassName:r?o+"-done":n[e+"Done"]}},t}Object(a.a)(t,e);var n=t.prototype;return n.addClass=function(e,t,n){var r=this.getClassNames(t)[n+"ClassName"],o=this.getClassNames("enter").doneClassName;"appear"===t&&"done"===n&&o&&(r+=" "+o),"active"===n&&e&&e.scrollTop,r&&(this.appliedClasses[t][n]=r,function(e,t){e&&t&&t.split(" ").forEach((function(t){return r=t,void((n=e).classList?n.classList.add(r):function(e,t){return e.classList?!!t&&e.classList.contains(t):-1!==(" "+(e.className.baseVal||e.className)+" ").indexOf(" "+t+" ")}(n,r)||("string"==typeof n.className?n.className=n.className+" "+r:n.setAttribute("class",(n.className&&n.className.baseVal||"")+" "+r)));var n,r}))}(e,r))},n.removeClasses=function(e,t){var n=this.appliedClasses[t],r=n.base,o=n.active,a=n.done;this.appliedClasses[t]={},r&&u(e,r),o&&u(e,o),a&&u(e,a)},n.render=function(){var e=this.props,t=(e.classNames,Object(o.a)(e,["classNames"]));return c.a.createElement(l.a,Object(r.a)({},t,{onEnter:this.onEnter,onEntered:this.onEntered,onEntering:this.onEntering,onExit:this.onExit,onExiting:this.onExiting,onExited:this.onExited}))},t}(c.a.Component);d.defaultProps={classNames:""},d.propTypes={};t.a=d},,,function(e,t,n){"use strict";var r=n(22),o=n(23);var a=n(25),i=(n(1),n(5)),s=n.n(i),c=n(33);function l(e,t){var n=Object.create(null);return e&&i.Children.map(e,(function(e){return e})).forEach((function(e){n[e.key]=function(e){return t&&Object(i.isValidElement)(e)?t(e):e}(e)})),n}function u(e,t,n){return null!=n[t]?n[t]:e.props[t]}function d(e,t,n){var r=l(e.children),o=function(e,t){function n(n){return n in t?t[n]:e[n]}e=e||{},t=t||{};var r,o=Object.create(null),a=[];for(var i in e)i in t?a.length&&(o[i]=a,a=[]):a.push(i);var s={};for(var c in t){if(o[c])for(r=0;r<o[c].length;r++){var l=o[c][r];s[o[c][r]]=n(l)}s[c]=n(c)}for(r=0;r<a.length;r++)s[a[r]]=n(a[r]);return s}(t,r);return Object.keys(o).forEach((function(a){var s=o[a];if(Object(i.isValidElement)(s)){var c=a in t,l=a in r,d=t[a],f=Object(i.isValidElement)(d)&&!d.props.in;!l||c&&!f?l||!c||f?l&&c&&Object(i.isValidElement)(d)&&(o[a]=Object(i.cloneElement)(s,{onExited:n.bind(null,s),in:d.props.in,exit:u(s,"exit",e),enter:u(s,"enter",e)})):o[a]=Object(i.cloneElement)(s,{in:!1}):o[a]=Object(i.cloneElement)(s,{onExited:n.bind(null,s),in:!0,exit:u(s,"exit",e),enter:u(s,"enter",e)})}})),o}var f=Object.values||function(e){return Object.keys(e).map((function(t){return e[t]}))},p=function(e){function t(t,n){var r,o=(r=e.call(this,t,n)||this).handleExited.bind(function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(r));return r.state={contextValue:{isMounting:!0},handleExited:o,firstRender:!0},r}Object(a.a)(t,e);var n=t.prototype;return n.componentDidMount=function(){this.mounted=!0,this.setState({contextValue:{isMounting:!1}})},n.componentWillUnmount=function(){this.mounted=!1},t.getDerivedStateFromProps=function(e,t){var n,r,o=t.children,a=t.handleExited;return{children:t.firstRender?(n=e,r=a,l(n.children,(function(e){return Object(i.cloneElement)(e,{onExited:r.bind(null,e),in:!0,appear:u(e,"appear",n),enter:u(e,"enter",n),exit:u(e,"exit",n)})}))):d(e,o,a),firstRender:!1}},n.handleExited=function(e,t){var n=l(this.props.children);e.key in n||(e.props.onExited&&e.props.onExited(t),this.mounted&&this.setState((function(t){var n=Object(o.a)({},t.children);return delete n[e.key],{children:n}})))},n.render=function(){var e=this.props,t=e.component,n=e.childFactory,o=Object(r.a)(e,["component","childFactory"]),a=this.state.contextValue,i=f(this.state.children).map(n);return delete o.appear,delete o.enter,delete o.exit,null===t?s.a.createElement(c.a.Provider,{value:a},i):s.a.createElement(c.a.Provider,{value:a},s.a.createElement(t,o,i))},t}(s.a.Component);p.propTypes={},p.defaultProps={component:"div",childFactory:function(e){return e}};t.a=p},,function(e,t,n){var r=n(299);e.exports=r},function(e,t,n){var r=n(79),o=n(176),a=n(105),i=n(131),s=n(134),c=n(56),l=n(178),u=Object.getOwnPropertyDescriptor;t.f=r?u:function(e,t){if(e=i(e),t=s(t,!0),l)try{return u(e,t)}catch(e){}if(c(e,t))return a(!o.f.call(e,t),e[t])}},function(e,t,n){"use strict";var r={}.propertyIsEnumerable,o=Object.getOwnPropertyDescriptor,a=o&&!r.call({1:2},1);t.f=a?function(e){var t=o(this,e);return!!t&&t.enumerable}:r},function(e,t,n){var r=n(62),o=n(132),a="".split;e.exports=r((function(){return!Object("z").propertyIsEnumerable(0)}))?function(e){return"String"==o(e)?a.call(e,""):Object(e)}:Object},function(e,t,n){var r=n(79),o=n(62),a=n(179);e.exports=!r&&!o((function(){return 7!=Object.defineProperty(a("div"),"a",{get:function(){return 7}}).a}))},function(e,t,n){var r=n(44),o=n(93),a=r.document,i=o(a)&&o(a.createElement);e.exports=function(e){return i?a.createElement(e):{}}},function(e,t,n){var r=n(44),o=n(80),a=n(56),i=n(135),s=n(181),c=n(182),l=c.get,u=c.enforce,d=String(String).split("String");(e.exports=function(e,t,n,s){var c,l=!!s&&!!s.unsafe,f=!!s&&!!s.enumerable,p=!!s&&!!s.noTargetGet;"function"==typeof n&&("string"!=typeof t||a(n,"name")||o(n,"name",t),(c=u(n)).source||(c.source=d.join("string"==typeof t?t:""))),e!==r?(l?!p&&e[t]&&(f=!0):delete e[t],f?e[t]=n:o(e,t,n)):f?e[t]=n:i(t,n)})(Function.prototype,"toString",(function(){return"function"==typeof this&&l(this).source||s(this)}))},function(e,t,n){var r=n(136),o=Function.toString;"function"!=typeof r.inspectSource&&(r.inspectSource=function(e){return o.call(e)}),e.exports=r.inspectSource},function(e,t,n){var r,o,a,i=n(301),s=n(44),c=n(93),l=n(80),u=n(56),d=n(136),f=n(137),p=n(139),h=s.WeakMap;if(i){var m=d.state||(d.state=new h),b=m.get,g=m.has,y=m.set;r=function(e,t){return t.facade=e,y.call(m,e,t),t},o=function(e){return b.call(m,e)||{}},a=function(e){return g.call(m,e)}}else{var v=f("state");p[v]=!0,r=function(e,t){return t.facade=e,l(e,v,t),t},o=function(e){return u(e,v)?e[v]:{}},a=function(e){return u(e,v)}}e.exports={set:r,get:o,has:a,enforce:function(e){return a(e)?o(e):r(e,{})},getterFor:function(e){return function(t){var n;if(!c(t)||(n=o(t)).type!==e)throw TypeError("Incompatible receiver, "+e+" required");return n}}}},function(e,t,n){var r=n(138),o=n(136);(e.exports=function(e,t){return o[e]||(o[e]=void 0!==t?t:{})})("versions",[]).push({version:"3.9.1",mode:r?"pure":"global",copyright:"© 2021 Denis Pushkarev (zloirock.ru)"})},function(e,t){var n=0,r=Math.random();e.exports=function(e){return"Symbol("+String(void 0===e?"":e)+")_"+(++n+r).toString(36)}},function(e,t,n){var r=n(56),o=n(131),a=n(305).indexOf,i=n(139);e.exports=function(e,t){var n,s=o(e),c=0,l=[];for(n in s)!r(i,n)&&r(s,n)&&l.push(n);for(;t.length>c;)r(s,n=t[c++])&&(~a(l,n)||l.push(n));return l}},function(e,t,n){var r=n(142),o=Math.min;e.exports=function(e){return e>0?o(r(e),9007199254740991):0}},function(e,t){t.f=Object.getOwnPropertySymbols},function(e,t,n){var r=n(185),o=n(143);e.exports=Object.keys||function(e){return r(e,o)}},function(e,t,n){var r=n(309);e.exports=r},function(e,t,n){"use strict";var r,o,a,i=n(62),s=n(191),c=n(80),l=n(56),u=n(63),d=n(138),f=u("iterator"),p=!1;[].keys&&("next"in(a=[].keys())?(o=s(s(a)))!==Object.prototype&&(r=o):p=!0);var h=null==r||i((function(){var e={};return r[f].call(e)!==e}));h&&(r={}),d&&!h||l(r,f)||c(r,f,(function(){return this})),e.exports={IteratorPrototype:r,BUGGY_SAFARI_ITERATORS:p}},function(e,t,n){var r=n(56),o=n(144),a=n(137),i=n(314),s=a("IE_PROTO"),c=Object.prototype;e.exports=i?Object.getPrototypeOf:function(e){return e=o(e),r(e,s)?e[s]:"function"==typeof e.constructor&&e instanceof e.constructor?e.constructor.prototype:e instanceof Object?c:null}},function(e,t,n){var r=n(315),o=n(316),a=n(62);e.exports=!!Object.getOwnPropertySymbols&&!a((function(){return!Symbol.sham&&(r?38===o:o>37&&o<41)}))},function(e,t,n){var r=n(94).f,o=n(56),a=n(63)("toStringTag");e.exports=function(e,t,n){e&&!o(e=n?e:e.prototype,a)&&r(e,a,{configurable:!0,value:t})}},function(e,t,n){"use strict";var r=Array.prototype.slice,o=n(195),a=Object.keys,i=a?function(e){return a(e)}:n(349),s=Object.keys;i.shim=function(){Object.keys?function(){var e=Object.keys(arguments);return e&&e.length===arguments.length}(1,2)||(Object.keys=function(e){return o(e)?s(r.call(e)):s(e)}):Object.keys=i;return Object.keys||i},e.exports=i},function(e,t,n){"use strict";var r=Object.prototype.toString;e.exports=function(e){var t=r.call(e),n="[object Arguments]"===t;return n||(n="[object Array]"!==t&&null!==e&&"object"==typeof e&&"number"==typeof e.length&&e.length>=0&&"[object Function]"===r.call(e.callee)),n}},function(e,t,n){"use strict";var r="undefined"!=typeof Symbol&&Symbol,o=n(148);e.exports=function(){return"function"==typeof r&&("function"==typeof Symbol&&("symbol"==typeof r("foo")&&("symbol"==typeof Symbol("bar")&&o())))}},function(e,t,n){"use strict";var r=n(194),o=function(e){return null!=e},a=n(148)(),i=n(64),s=Object,c=i("Array.prototype.push"),l=i("Object.prototype.propertyIsEnumerable"),u=a?Object.getOwnPropertySymbols:null;e.exports=function(e,t){if(!o(e))throw new TypeError("target must be an object");var n,i,d,f,p,h,m,b=s(e);for(n=1;n<arguments.length;++n){i=s(arguments[n]),f=r(i);var g=a&&(Object.getOwnPropertySymbols||u);if(g)for(p=g(i),d=0;d<p.length;++d)m=p[d],l(i,m)&&c(f,m);for(d=0;d<f.length;++d)h=i[m=f[d]],l(i,m)&&(b[m]=h)}return b}},function(e,t,n){"use strict";var r=n(197);e.exports=function(){return Object.assign?function(){if(!Object.assign)return!1;for(var e="abcdefghijklmnopqrst",t=e.split(""),n={},r=0;r<t.length;++r)n[t[r]]=t[r];var o=Object.assign({},n),a="";for(var i in o)a+=i;return e!==a}()||function(){if(!Object.assign||!Object.preventExtensions)return!1;var e=Object.preventExtensions({1:2});try{Object.assign(e,"xy")}catch(t){return"y"===e[1]}return!1}()?r:Object.assign:r}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=void 0,o=void 0;function a(e,t){var n=t(e(o));return function(){return n}}function i(e){return a(e,r.createLTR||r.create)}function s(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];var o=r.resolve(t);return o}function c(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return r.resolveLTR?r.resolveLTR(t):s(t)}t.default={registerTheme:function(e){o=e},registerInterface:function(e){r=e},create:i,createLTR:i,createRTL:function(e){return a(e,r.createRTL||r.create)},get:function(){return o},resolve:c,resolveLTR:c,resolveRTL:function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return r.resolveRTL?r.resolveRTL(t):s(t)},flush:function(){r.flush&&r.flush()}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t,n,r,o){var s=o.chooseAvailableDate,c=o.dateIsUnavailable,l=o.dateIsSelected,u={width:n,height:n-1},d=r.has("blocked-minimum-nights")||r.has("blocked-calendar")||r.has("blocked-out-of-range"),f=r.has("selected")||r.has("selected-start")||r.has("selected-end"),p=!f&&(r.has("hovered-span")||r.has("after-hovered-start")),h=r.has("blocked-out-of-range"),m={date:e.format(t)},b=(0,a.default)(s,m);r.has(i.BLOCKED_MODIFIER)?b=(0,a.default)(c,m):f&&(b=(0,a.default)(l,m));return{daySizeStyles:u,useDefaultCursor:d,selected:f,hoveredSpan:p,isOutsideRange:h,ariaLabel:b}};var r,o=n(357),a=(r=o)&&r.__esModule?r:{default:r},i=n(24)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=D(n(36)),i=D(n(5)),s=D(n(1)),c=D(n(81)),l=D(n(58)),u=n(31),d=n(42),f=D(n(9)),p=n(37),h=D(n(40)),m=D(n(358)),b=D(n(146)),g=D(n(203)),y=D(n(360)),v=D(n(82)),_=D(n(109)),O=D(n(108)),w=D(n(84)),k=D(n(75)),S=n(24);function D(e){return e&&e.__esModule?e:{default:e}}var C=(0,u.forbidExtraProps)((0,a.default)({},d.withStylesPropTypes,{month:l.default.momentObj,horizontalMonthPadding:u.nonNegativeInteger,isVisible:s.default.bool,enableOutsideDays:s.default.bool,modifiers:s.default.objectOf(O.default),orientation:w.default,daySize:u.nonNegativeInteger,onDayClick:s.default.func,onDayMouseEnter:s.default.func,onDayMouseLeave:s.default.func,onMonthSelect:s.default.func,onYearSelect:s.default.func,renderMonthText:(0,u.mutuallyExclusiveProps)(s.default.func,"renderMonthText","renderMonthElement"),renderCalendarDay:s.default.func,renderDayContents:s.default.func,renderMonthElement:(0,u.mutuallyExclusiveProps)(s.default.func,"renderMonthText","renderMonthElement"),firstDayOfWeek:k.default,setMonthTitleHeight:s.default.func,verticalBorderSpacing:u.nonNegativeInteger,focusedDate:l.default.momentObj,isFocused:s.default.bool,monthFormat:s.default.string,phrases:s.default.shape((0,h.default)(p.CalendarDayPhrases)),dayAriaLabelFormat:s.default.string})),E={month:(0,f.default)(),horizontalMonthPadding:13,isVisible:!0,enableOutsideDays:!1,modifiers:{},orientation:S.HORIZONTAL_ORIENTATION,daySize:S.DAY_SIZE,onDayClick:function(){},onDayMouseEnter:function(){},onDayMouseLeave:function(){},onMonthSelect:function(){},onYearSelect:function(){},renderMonthText:null,renderCalendarDay:function(e){return i.default.createElement(b.default,e)},renderDayContents:null,renderMonthElement:null,firstDayOfWeek:null,setMonthTitleHeight:null,focusedDate:null,isFocused:!1,monthFormat:"MMMM YYYY",phrases:p.CalendarDayPhrases,dayAriaLabelFormat:void 0,verticalBorderSpacing:void 0},j=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.state={weeks:(0,y.default)(e.month,e.enableOutsideDays,null==e.firstDayOfWeek?f.default.localeData().firstDayOfWeek():e.firstDayOfWeek)},n.setCaptionRef=n.setCaptionRef.bind(n),n.setMonthTitleHeight=n.setMonthTitleHeight.bind(n),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),o(t,[{key:"componentDidMount",value:function(){this.setMonthTitleHeightTimeout=setTimeout(this.setMonthTitleHeight,0)}},{key:"componentWillReceiveProps",value:function(e){var t=e.month,n=e.enableOutsideDays,r=e.firstDayOfWeek,o=this.props,a=o.month,i=o.enableOutsideDays,s=o.firstDayOfWeek;t.isSame(a)&&n===i&&r===s||this.setState({weeks:(0,y.default)(t,n,null==r?f.default.localeData().firstDayOfWeek():r)})}},{key:"shouldComponentUpdate",value:function(e,t){return(0,c.default)(this,e,t)}},{key:"componentWillUnmount",value:function(){this.setMonthTitleHeightTimeout&&clearTimeout(this.setMonthTitleHeightTimeout)}},{key:"setMonthTitleHeight",value:function(){var e=this.props.setMonthTitleHeight;e&&e((0,g.default)(this.captionRef,"height",!0,!0))}},{key:"setCaptionRef",value:function(e){this.captionRef=e}},{key:"render",value:function(){var e=this.props,t=e.dayAriaLabelFormat,n=e.daySize,o=e.focusedDate,a=e.horizontalMonthPadding,s=e.isFocused,c=e.isVisible,l=e.modifiers,u=e.month,f=e.monthFormat,p=e.onDayClick,h=e.onDayMouseEnter,b=e.onDayMouseLeave,g=e.onMonthSelect,y=e.onYearSelect,O=e.orientation,w=e.phrases,k=e.renderCalendarDay,D=e.renderDayContents,C=e.renderMonthElement,E=e.renderMonthText,j=e.styles,F=e.verticalBorderSpacing,P=this.state.weeks,M=E?E(u):u.format(f),x=O===S.VERTICAL_SCROLLABLE;return i.default.createElement("div",r({},(0,d.css)(j.CalendarMonth,{padding:"0 "+String(a)+"px"}),{"data-visible":c}),i.default.createElement("div",r({ref:this.setCaptionRef},(0,d.css)(j.CalendarMonth_caption,x&&j.CalendarMonth_caption__verticalScrollable)),C?C({month:u,onMonthSelect:g,onYearSelect:y}):i.default.createElement("strong",null,M)),i.default.createElement("table",r({},(0,d.css)(!F&&j.CalendarMonth_table,F&&j.CalendarMonth_verticalSpacing,F&&{borderSpacing:"0px "+String(F)+"px"}),{role:"presentation"}),i.default.createElement("tbody",null,P.map((function(e,r){return i.default.createElement(m.default,{key:r},e.map((function(e,r){return k({key:r,day:e,daySize:n,isOutsideDay:!e||e.month()!==u.month(),tabIndex:c&&(0,v.default)(e,o)?0:-1,isFocused:s,onDayMouseEnter:h,onDayMouseLeave:b,onDayClick:p,renderDayContents:D,phrases:w,modifiers:l[(0,_.default)(e)],ariaLabelFormat:t})})))})))))}}]),t}(i.default.Component);j.propTypes=C,j.defaultProps=E,t.default=(0,d.withStyles)((function(e){var t=e.reactDates,n=t.color,r=t.font,o=t.spacing;return{CalendarMonth:{background:n.background,textAlign:"center",verticalAlign:"top",userSelect:"none"},CalendarMonth_table:{borderCollapse:"collapse",borderSpacing:0},CalendarMonth_verticalSpacing:{borderCollapse:"separate"},CalendarMonth_caption:{color:n.text,fontSize:r.captionSize,textAlign:"center",paddingTop:o.captionPaddingTop,paddingBottom:o.captionPaddingBottom,captionSide:"initial"},CalendarMonth_caption__verticalScrollable:{paddingTop:12,paddingBottom:7}}}))(j)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r={white:"#fff",gray:"#484848",grayLight:"#82888a",grayLighter:"#cacccd",grayLightest:"#f2f2f2",borderMedium:"#c4c4c4",border:"#dbdbdb",borderLight:"#e4e7e7",borderLighter:"#eceeee",borderBright:"#f4f5f5",primary:"#00a699",primaryShade_1:"#33dacd",primaryShade_2:"#66e2da",primaryShade_3:"#80e8e0",primaryShade_4:"#b2f1ec",primary_dark:"#008489",secondary:"#007a87",yellow:"#ffe8bc",yellow_dark:"#ffce71"};t.default={reactDates:{zIndex:0,border:{input:{border:0,borderTop:0,borderRight:0,borderBottom:"2px solid transparent",borderLeft:0,outlineFocused:0,borderFocused:0,borderTopFocused:0,borderLeftFocused:0,borderBottomFocused:"2px solid "+String(r.primary_dark),borderRightFocused:0,borderRadius:0},pickerInput:{borderWidth:1,borderStyle:"solid",borderRadius:2}},color:{core:r,disabled:r.grayLightest,background:r.white,backgroundDark:"#f2f2f2",backgroundFocused:r.white,border:"rgb(219, 219, 219)",text:r.gray,textDisabled:r.border,textFocused:"#007a87",placeholderText:"#757575",outside:{backgroundColor:r.white,backgroundColor_active:r.white,backgroundColor_hover:r.white,color:r.gray,color_active:r.gray,color_hover:r.gray},highlighted:{backgroundColor:r.yellow,backgroundColor_active:r.yellow_dark,backgroundColor_hover:r.yellow_dark,color:r.gray,color_active:r.gray,color_hover:r.gray},minimumNights:{backgroundColor:r.white,backgroundColor_active:r.white,backgroundColor_hover:r.white,borderColor:r.borderLighter,color:r.grayLighter,color_active:r.grayLighter,color_hover:r.grayLighter},hoveredSpan:{backgroundColor:r.primaryShade_4,backgroundColor_active:r.primaryShade_3,backgroundColor_hover:r.primaryShade_4,borderColor:r.primaryShade_3,borderColor_active:r.primaryShade_3,borderColor_hover:r.primaryShade_3,color:r.secondary,color_active:r.secondary,color_hover:r.secondary},selectedSpan:{backgroundColor:r.primaryShade_2,backgroundColor_active:r.primaryShade_1,backgroundColor_hover:r.primaryShade_1,borderColor:r.primaryShade_1,borderColor_active:r.primary,borderColor_hover:r.primary,color:r.white,color_active:r.white,color_hover:r.white},selected:{backgroundColor:r.primary,backgroundColor_active:r.primary,backgroundColor_hover:r.primary,borderColor:r.primary,borderColor_active:r.primary,borderColor_hover:r.primary,color:r.white,color_active:r.white,color_hover:r.white},blocked_calendar:{backgroundColor:r.grayLighter,backgroundColor_active:r.grayLighter,backgroundColor_hover:r.grayLighter,borderColor:r.grayLighter,borderColor_active:r.grayLighter,borderColor_hover:r.grayLighter,color:r.grayLight,color_active:r.grayLight,color_hover:r.grayLight},blocked_out_of_range:{backgroundColor:r.white,backgroundColor_active:r.white,backgroundColor_hover:r.white,borderColor:r.borderLight,borderColor_active:r.borderLight,borderColor_hover:r.borderLight,color:r.grayLighter,color_active:r.grayLighter,color_hover:r.grayLighter}},spacing:{dayPickerHorizontalPadding:9,captionPaddingTop:22,captionPaddingBottom:37,inputPadding:0,displayTextPaddingVertical:void 0,displayTextPaddingTop:11,displayTextPaddingBottom:9,displayTextPaddingHorizontal:void 0,displayTextPaddingLeft:11,displayTextPaddingRight:11,displayTextPaddingVertical_small:void 0,displayTextPaddingTop_small:7,displayTextPaddingBottom_small:5,displayTextPaddingHorizontal_small:void 0,displayTextPaddingLeft_small:7,displayTextPaddingRight_small:7},sizing:{inputWidth:130,inputWidth_small:97,arrowWidth:24},noScrollBarOnVerticalScrollable:!1,font:{size:14,captionSize:18,input:{size:19,lineHeight:"24px",size_small:15,lineHeight_small:"18px",letterSpacing_small:"0.2px",styleDisabled:"italic"}}}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(!e)return 0;var o="width"===t?"Left":"Top",a="width"===t?"Right":"Bottom",i=!n||r?window.getComputedStyle(e):null,s=e.offsetWidth,c=e.offsetHeight,l="width"===t?s:c;n||(l-=parseFloat(i["padding"+o])+parseFloat(i["padding"+a])+parseFloat(i["border"+o+"Width"])+parseFloat(i["border"+a+"Width"]));r&&(l+=parseFloat(i["margin"+o])+parseFloat(i["margin"+a]));return l}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=E(n(36)),i=E(n(5)),s=E(n(1)),c=E(n(81)),l=E(n(58)),u=n(31),d=n(42),f=E(n(9)),p=n(110),h=n(37),m=E(n(40)),b=E(n(201)),g=E(n(361)),y=E(n(362)),v=E(n(205)),_=E(n(111)),O=E(n(363)),w=E(n(364)),k=E(n(108)),S=E(n(84)),D=E(n(75)),C=n(24);function E(e){return e&&e.__esModule?e:{default:e}}var j=(0,u.forbidExtraProps)((0,a.default)({},d.withStylesPropTypes,{enableOutsideDays:s.default.bool,firstVisibleMonthIndex:s.default.number,horizontalMonthPadding:u.nonNegativeInteger,initialMonth:l.default.momentObj,isAnimating:s.default.bool,numberOfMonths:s.default.number,modifiers:s.default.objectOf(s.default.objectOf(k.default)),orientation:S.default,onDayClick:s.default.func,onDayMouseEnter:s.default.func,onDayMouseLeave:s.default.func,onMonthTransitionEnd:s.default.func,onMonthChange:s.default.func,onYearChange:s.default.func,renderMonthText:(0,u.mutuallyExclusiveProps)(s.default.func,"renderMonthText","renderMonthElement"),renderCalendarDay:s.default.func,renderDayContents:s.default.func,translationValue:s.default.number,renderMonthElement:(0,u.mutuallyExclusiveProps)(s.default.func,"renderMonthText","renderMonthElement"),daySize:u.nonNegativeInteger,focusedDate:l.default.momentObj,isFocused:s.default.bool,firstDayOfWeek:D.default,setMonthTitleHeight:s.default.func,isRTL:s.default.bool,transitionDuration:u.nonNegativeInteger,verticalBorderSpacing:u.nonNegativeInteger,monthFormat:s.default.string,phrases:s.default.shape((0,m.default)(h.CalendarDayPhrases)),dayAriaLabelFormat:s.default.string})),F={enableOutsideDays:!1,firstVisibleMonthIndex:0,horizontalMonthPadding:13,initialMonth:(0,f.default)(),isAnimating:!1,numberOfMonths:1,modifiers:{},orientation:C.HORIZONTAL_ORIENTATION,onDayClick:function(){},onDayMouseEnter:function(){},onDayMouseLeave:function(){},onMonthChange:function(){},onYearChange:function(){},onMonthTransitionEnd:function(){},renderMonthText:null,renderCalendarDay:void 0,renderDayContents:null,translationValue:null,renderMonthElement:null,daySize:C.DAY_SIZE,focusedDate:null,isFocused:!1,firstDayOfWeek:null,setMonthTitleHeight:null,isRTL:!1,transitionDuration:200,verticalBorderSpacing:void 0,monthFormat:"MMMM YYYY",phrases:h.CalendarDayPhrases,dayAriaLabelFormat:void 0};function P(e,t,n){var r=e.clone();n||(r=r.subtract(1,"month"));for(var o=[],a=0;a<(n?t:t+2);a+=1)o.push(r),r=r.clone().add(1,"month");return o}var M=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e)),r=e.orientation===C.VERTICAL_SCROLLABLE;return n.state={months:P(e.initialMonth,e.numberOfMonths,r)},n.isTransitionEndSupported=(0,g.default)(),n.onTransitionEnd=n.onTransitionEnd.bind(n),n.setContainerRef=n.setContainerRef.bind(n),n.locale=f.default.locale(),n.onMonthSelect=n.onMonthSelect.bind(n),n.onYearSelect=n.onYearSelect.bind(n),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),o(t,[{key:"componentDidMount",value:function(){this.removeEventListener=(0,p.addEventListener)(this.container,"transitionend",this.onTransitionEnd)}},{key:"componentWillReceiveProps",value:function(e){var t=this,n=e.initialMonth,r=e.numberOfMonths,o=e.orientation,a=this.state.months,i=this.props,s=i.initialMonth,c=i.numberOfMonths!==r,l=a;s.isSame(n,"month")||c||((0,w.default)(s,n)?(l=a.slice(1)).push(a[a.length-1].clone().add(1,"month")):(0,O.default)(s,n)?(l=a.slice(0,a.length-1)).unshift(a[0].clone().subtract(1,"month")):l=P(n,r,o===C.VERTICAL_SCROLLABLE));c&&(l=P(n,r,o===C.VERTICAL_SCROLLABLE));var u=f.default.locale();this.locale!==u&&(this.locale=u,l=l.map((function(e){return e.locale(t.locale)}))),this.setState({months:l})}},{key:"shouldComponentUpdate",value:function(e,t){return(0,c.default)(this,e,t)}},{key:"componentDidUpdate",value:function(){var e=this.props,t=e.isAnimating,n=e.transitionDuration,r=e.onMonthTransitionEnd;this.isTransitionEndSupported&&n||!t||r()}},{key:"componentWillUnmount",value:function(){this.removeEventListener&&this.removeEventListener()}},{key:"onTransitionEnd",value:function(){(0,this.props.onMonthTransitionEnd)()}},{key:"onMonthSelect",value:function(e,t){var n=e.clone(),r=this.props,o=r.onMonthChange,a=r.orientation,i=this.state.months,s=a===C.VERTICAL_SCROLLABLE,c=i.indexOf(e);s||(c-=1),n.set("month",t).subtract(c,"months"),o(n)}},{key:"onYearSelect",value:function(e,t){var n=e.clone(),r=this.props,o=r.onYearChange,a=r.orientation,i=this.state.months,s=a===C.VERTICAL_SCROLLABLE,c=i.indexOf(e);s||(c-=1),n.set("year",t).subtract(c,"months"),o(n)}},{key:"setContainerRef",value:function(e){this.container=e}},{key:"render",value:function(){var e=this,t=this.props,n=t.enableOutsideDays,o=t.firstVisibleMonthIndex,s=t.horizontalMonthPadding,c=t.isAnimating,l=t.modifiers,u=t.numberOfMonths,f=t.monthFormat,p=t.orientation,h=t.translationValue,m=t.daySize,g=t.onDayMouseEnter,O=t.onDayMouseLeave,w=t.onDayClick,k=t.renderMonthText,S=t.renderCalendarDay,D=t.renderDayContents,E=t.renderMonthElement,j=t.onMonthTransitionEnd,F=t.firstDayOfWeek,P=t.focusedDate,M=t.isFocused,x=t.isRTL,T=t.styles,N=t.phrases,I=t.dayAriaLabelFormat,R=t.transitionDuration,A=t.verticalBorderSpacing,L=t.setMonthTitleHeight,U=this.state.months,B=p===C.VERTICAL_ORIENTATION,H=p===C.VERTICAL_SCROLLABLE,K=p===C.HORIZONTAL_ORIENTATION,z=(0,v.default)(m,s),q=B||H?z:(u+2)*z,V=(B||H?"translateY":"translateX")+"("+String(h)+"px)";return i.default.createElement("div",r({},(0,d.css)(T.CalendarMonthGrid,K&&T.CalendarMonthGrid__horizontal,B&&T.CalendarMonthGrid__vertical,H&&T.CalendarMonthGrid__vertical_scrollable,c&&T.CalendarMonthGrid__animating,c&&R&&{transition:"transform "+String(R)+"ms ease-in-out"},(0,a.default)({},(0,y.default)(V),{width:q})),{ref:this.setContainerRef,onTransitionEnd:j}),U.map((function(t,a){var y=a>=o&&a<o+u,v=0===a&&!y,C=0===a&&c&&y,j=(0,_.default)(t);return i.default.createElement("div",r({key:j},(0,d.css)(K&&T.CalendarMonthGrid_month__horizontal,v&&T.CalendarMonthGrid_month__hideForAnimation,C&&!B&&!x&&{position:"absolute",left:-z},C&&!B&&x&&{position:"absolute",right:0},C&&B&&{position:"absolute",top:-h},!y&&!c&&T.CalendarMonthGrid_month__hidden)),i.default.createElement(b.default,{month:t,isVisible:y,enableOutsideDays:n,modifiers:l[j],monthFormat:f,orientation:p,onDayMouseEnter:g,onDayMouseLeave:O,onDayClick:w,onMonthSelect:e.onMonthSelect,onYearSelect:e.onYearSelect,renderMonthText:k,renderCalendarDay:S,renderDayContents:D,renderMonthElement:E,firstDayOfWeek:F,daySize:m,focusedDate:y?P:null,isFocused:M,phrases:N,setMonthTitleHeight:L,dayAriaLabelFormat:I,verticalBorderSpacing:A,horizontalMonthPadding:s}))})))}}]),t}(i.default.Component);M.propTypes=j,M.defaultProps=F,t.default=(0,d.withStyles)((function(e){var t=e.reactDates,n=t.color,r=t.noScrollBarOnVerticalScrollable,o=t.spacing,i=t.zIndex;return{CalendarMonthGrid:{background:n.background,textAlign:"left",zIndex:i},CalendarMonthGrid__animating:{zIndex:i+1},CalendarMonthGrid__horizontal:{position:"absolute",left:o.dayPickerHorizontalPadding},CalendarMonthGrid__vertical:{margin:"0 auto"},CalendarMonthGrid__vertical_scrollable:(0,a.default)({margin:"0 auto",overflowY:"scroll"},r&&{"-webkitOverflowScrolling":"touch","::-webkit-scrollbar":{"-webkit-appearance":"none",display:"none"}}),CalendarMonthGrid_month__horizontal:{display:"inline-block",verticalAlign:"top",minHeight:"100%"},CalendarMonthGrid_month__hideForAnimation:{position:"absolute",zIndex:i-1,opacity:0,pointerEvents:"none"},CalendarMonthGrid_month__hidden:{visibility:"hidden"}}}))(M)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){return 7*e+2*t+1}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){return!(!a.default.isMoment(e)||!a.default.isMoment(t))&&(e.month()===t.month()&&e.year()===t.year())};var r,o=n(9),a=(r=o)&&r.__esModule?r:{default:r}},function(e,t,n){"use strict";var r=n(208),o=n(64)("Object.prototype.propertyIsEnumerable");e.exports=function(e){var t=r(e),n=[];for(var a in t)o(t,a)&&n.push(t[a]);return n}},function(e,t,n){"use strict";e.exports=n(367)},function(e,t,n){"use strict";var r=n(207);e.exports=function(){return"function"==typeof Object.values?Object.values:r}},function(e,t,n){"use strict";e.exports=function(e){if(arguments.length<1)throw new TypeError("1 argument is required");if("object"!=typeof e)throw new TypeError("Argument 1 (”other“) to Node.contains must be an instance of Node");var t=e;do{if(this===t)return!0;t&&(t=t.parentNode)}while(t);return!1}},function(e,t,n){"use strict";var r=n(210);e.exports=function(){if("undefined"!=typeof document){if(document.contains)return document.contains;if(document.body&&document.body.contains)try{if("boolean"==typeof document.body.contains.call(document,""))return document.body.contains}catch(e){}}return r}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=b(n(1)),o=b(n(58)),a=n(31),i=n(37),s=b(n(40)),c=b(n(213)),l=b(n(96)),u=b(n(214)),d=b(n(112)),f=b(n(215)),p=b(n(86)),h=b(n(75)),m=b(n(97));function b(e){return e&&e.__esModule?e:{default:e}}t.default={startDate:o.default.momentObj,endDate:o.default.momentObj,onDatesChange:r.default.func.isRequired,focusedInput:c.default,onFocusChange:r.default.func.isRequired,onClose:r.default.func,startDateId:r.default.string.isRequired,startDatePlaceholderText:r.default.string,endDateId:r.default.string.isRequired,endDatePlaceholderText:r.default.string,disabled:d.default,required:r.default.bool,readOnly:r.default.bool,screenReaderInputMessage:r.default.string,showClearDates:r.default.bool,showDefaultInputIcon:r.default.bool,inputIconPosition:l.default,customInputIcon:r.default.node,customArrowIcon:r.default.node,customCloseIcon:r.default.node,noBorder:r.default.bool,block:r.default.bool,small:r.default.bool,regular:r.default.bool,keepFocusOnInput:r.default.bool,renderMonthText:(0,a.mutuallyExclusiveProps)(r.default.func,"renderMonthText","renderMonthElement"),renderMonthElement:(0,a.mutuallyExclusiveProps)(r.default.func,"renderMonthText","renderMonthElement"),orientation:u.default,anchorDirection:f.default,openDirection:p.default,horizontalMargin:r.default.number,withPortal:r.default.bool,withFullScreenPortal:r.default.bool,appendToBody:r.default.bool,disableScroll:r.default.bool,daySize:a.nonNegativeInteger,isRTL:r.default.bool,firstDayOfWeek:h.default,initialVisibleMonth:r.default.func,numberOfMonths:r.default.number,keepOpenOnDateSelect:r.default.bool,reopenPickerOnClearDates:r.default.bool,renderCalendarInfo:r.default.func,calendarInfoPosition:m.default,hideKeyboardShortcutsPanel:r.default.bool,verticalHeight:a.nonNegativeInteger,transitionDuration:a.nonNegativeInteger,verticalSpacing:a.nonNegativeInteger,navPrev:r.default.node,navNext:r.default.node,onPrevMonthClick:r.default.func,onNextMonthClick:r.default.func,renderCalendarDay:r.default.func,renderDayContents:r.default.func,minimumNights:r.default.number,enableOutsideDays:r.default.bool,isDayBlocked:r.default.func,isOutsideRange:r.default.func,isDayHighlighted:r.default.func,displayFormat:r.default.oneOfType([r.default.string,r.default.func]),monthFormat:r.default.string,weekDayFormat:r.default.string,phrases:r.default.shape((0,s.default)(i.DateRangePickerPhrases)),dayAriaLabelFormat:r.default.string}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,o=n(1),a=(r=o)&&r.__esModule?r:{default:r},i=n(24);t.default=a.default.oneOf([i.START_DATE,i.END_DATE])},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,o=n(1),a=(r=o)&&r.__esModule?r:{default:r},i=n(24);t.default=a.default.oneOf([i.HORIZONTAL_ORIENTATION,i.VERTICAL_ORIENTATION])},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,o=n(1),a=(r=o)&&r.__esModule?r:{default:r},i=n(24);t.default=a.default.oneOf([i.ANCHOR_LEFT,i.ANCHOR_RIGHT])},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t,n,o){var a="undefined"!=typeof window?window.innerWidth:0,i=e===r.ANCHOR_LEFT?a-n:n,s=o||0;return function(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}({},e,Math.min(t+i-s,0))};var r=n(24)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t,n){var o=n.getBoundingClientRect(),a=o.left,i=o.top;e===r.OPEN_UP&&(i=-(window.innerHeight-o.bottom));t===r.ANCHOR_RIGHT&&(a=-(window.innerWidth-o.right));return{transform:"translate3d("+String(Math.round(a))+"px, "+String(Math.round(i))+"px, 0)"}};var r=n(24)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getScrollParent=o,t.getScrollAncestorsOverflowY=a,t.default=function(e){var t=a(e),n=function(e){return t.forEach((function(t,n){n.style.setProperty("overflow-y",e?"hidden":t)}))};return n(!0),function(){return n(!1)}};var r=function(){return document.scrollingElement||document.documentElement};function o(e){var t=e.parentElement;if(null==t)return r();var n=window.getComputedStyle(t).overflowY;return"visible"!==n&&"hidden"!==n&&t.scrollHeight>t.clientHeight?t:o(t)}function a(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Map,n=r(),i=o(e);return t.set(i,i.style.overflowY),i===n?t:a(i,t)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=_(n(5)),a=_(n(1)),i=_(n(9)),s=_(n(58)),c=n(31),l=_(n(86)),u=n(37),d=_(n(40)),f=_(n(220)),p=_(n(96)),h=_(n(112)),m=_(n(83)),b=_(n(153)),g=_(n(98)),y=_(n(99)),v=n(24);function _(e){return e&&e.__esModule?e:{default:e}}var O=(0,c.forbidExtraProps)({startDate:s.default.momentObj,startDateId:a.default.string,startDatePlaceholderText:a.default.string,isStartDateFocused:a.default.bool,endDate:s.default.momentObj,endDateId:a.default.string,endDatePlaceholderText:a.default.string,isEndDateFocused:a.default.bool,screenReaderMessage:a.default.string,showClearDates:a.default.bool,showCaret:a.default.bool,showDefaultInputIcon:a.default.bool,inputIconPosition:p.default,disabled:h.default,required:a.default.bool,readOnly:a.default.bool,openDirection:l.default,noBorder:a.default.bool,block:a.default.bool,small:a.default.bool,regular:a.default.bool,verticalSpacing:c.nonNegativeInteger,keepOpenOnDateSelect:a.default.bool,reopenPickerOnClearDates:a.default.bool,withFullScreenPortal:a.default.bool,minimumNights:c.nonNegativeInteger,isOutsideRange:a.default.func,displayFormat:a.default.oneOfType([a.default.string,a.default.func]),onFocusChange:a.default.func,onClose:a.default.func,onDatesChange:a.default.func,onKeyDownArrowDown:a.default.func,onKeyDownQuestionMark:a.default.func,customInputIcon:a.default.node,customArrowIcon:a.default.node,customCloseIcon:a.default.node,isFocused:a.default.bool,phrases:a.default.shape((0,d.default)(u.DateRangePickerInputPhrases)),isRTL:a.default.bool}),w={startDate:null,startDateId:v.START_DATE,startDatePlaceholderText:"Start Date",isStartDateFocused:!1,endDate:null,endDateId:v.END_DATE,endDatePlaceholderText:"End Date",isEndDateFocused:!1,screenReaderMessage:"",showClearDates:!1,showCaret:!1,showDefaultInputIcon:!1,inputIconPosition:v.ICON_BEFORE_POSITION,disabled:!1,required:!1,readOnly:!1,openDirection:v.OPEN_DOWN,noBorder:!1,block:!1,small:!1,regular:!1,verticalSpacing:void 0,keepOpenOnDateSelect:!1,reopenPickerOnClearDates:!1,withFullScreenPortal:!1,minimumNights:1,isOutsideRange:function(e){return!(0,g.default)(e,(0,i.default)())},displayFormat:function(){return i.default.localeData().longDateFormat("L")},onFocusChange:function(){},onClose:function(){},onDatesChange:function(){},onKeyDownArrowDown:function(){},onKeyDownQuestionMark:function(){},customInputIcon:null,customArrowIcon:null,customCloseIcon:null,isFocused:!1,phrases:u.DateRangePickerInputPhrases,isRTL:!1},k=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.onClearFocus=n.onClearFocus.bind(n),n.onStartDateChange=n.onStartDateChange.bind(n),n.onStartDateFocus=n.onStartDateFocus.bind(n),n.onEndDateChange=n.onEndDateChange.bind(n),n.onEndDateFocus=n.onEndDateFocus.bind(n),n.clearDates=n.clearDates.bind(n),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),r(t,[{key:"onClearFocus",value:function(){var e=this.props,t=e.onFocusChange,n=e.onClose,r=e.startDate,o=e.endDate;t(null),n({startDate:r,endDate:o})}},{key:"onEndDateChange",value:function(e){var t=this.props,n=t.startDate,r=t.isOutsideRange,o=t.minimumNights,a=t.keepOpenOnDateSelect,i=t.onDatesChange,s=(0,m.default)(e,this.getDisplayFormat());!s||r(s)||n&&(0,y.default)(s,n.clone().add(o,"days"))?i({startDate:n,endDate:null}):(i({startDate:n,endDate:s}),a||this.onClearFocus())}},{key:"onEndDateFocus",value:function(){var e=this.props,t=e.startDate,n=e.onFocusChange,r=e.withFullScreenPortal,o=e.disabled;t||!r||o&&o!==v.END_DATE?o&&o!==v.START_DATE||n(v.END_DATE):n(v.START_DATE)}},{key:"onStartDateChange",value:function(e){var t=this.props.endDate,n=this.props,r=n.isOutsideRange,o=n.minimumNights,a=n.onDatesChange,i=n.onFocusChange,s=n.disabled,c=(0,m.default)(e,this.getDisplayFormat()),l=c&&(0,y.default)(t,c.clone().add(o,"days"));!c||r(c)||s===v.END_DATE&&l?a({startDate:null,endDate:t}):(l&&(t=null),a({startDate:c,endDate:t}),i(v.END_DATE))}},{key:"onStartDateFocus",value:function(){var e=this.props,t=e.disabled,n=e.onFocusChange;t&&t!==v.END_DATE||n(v.START_DATE)}},{key:"getDisplayFormat",value:function(){var e=this.props.displayFormat;return"string"==typeof e?e:e()}},{key:"getDateString",value:function(e){var t=this.getDisplayFormat();return e&&t?e&&e.format(t):(0,b.default)(e)}},{key:"clearDates",value:function(){var e=this.props,t=e.onDatesChange,n=e.reopenPickerOnClearDates,r=e.onFocusChange;t({startDate:null,endDate:null}),n&&r(v.START_DATE)}},{key:"render",value:function(){var e=this.props,t=e.startDate,n=e.startDateId,r=e.startDatePlaceholderText,a=e.isStartDateFocused,i=e.endDate,s=e.endDateId,c=e.endDatePlaceholderText,l=e.isEndDateFocused,u=e.screenReaderMessage,d=e.showClearDates,p=e.showCaret,h=e.showDefaultInputIcon,m=e.inputIconPosition,b=e.customInputIcon,g=e.customArrowIcon,y=e.customCloseIcon,v=e.disabled,_=e.required,O=e.readOnly,w=e.openDirection,k=e.isFocused,S=e.phrases,D=e.onKeyDownArrowDown,C=e.onKeyDownQuestionMark,E=e.isRTL,j=e.noBorder,F=e.block,P=e.small,M=e.regular,x=e.verticalSpacing,T=this.getDateString(t),N=this.getDateString(i);return o.default.createElement(f.default,{startDate:T,startDateId:n,startDatePlaceholderText:r,isStartDateFocused:a,endDate:N,endDateId:s,endDatePlaceholderText:c,isEndDateFocused:l,isFocused:k,disabled:v,required:_,readOnly:O,openDirection:w,showCaret:p,showDefaultInputIcon:h,inputIconPosition:m,customInputIcon:b,customArrowIcon:g,customCloseIcon:y,phrases:S,onStartDateChange:this.onStartDateChange,onStartDateFocus:this.onStartDateFocus,onStartDateShiftTab:this.onClearFocus,onEndDateChange:this.onEndDateChange,onEndDateFocus:this.onEndDateFocus,onEndDateTab:this.onClearFocus,showClearDates:d,onClearDates:this.clearDates,screenReaderMessage:u,onKeyDownArrowDown:D,onKeyDownQuestionMark:C,isRTL:E,noBorder:j,block:F,small:P,regular:M,verticalSpacing:x})}}]),t}(o.default.Component);t.default=k,k.propTypes=O,k.defaultProps=w},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},o=_(n(36)),a=_(n(5)),i=_(n(1)),s=n(31),c=n(42),l=n(37),u=_(n(40)),d=_(n(86)),f=_(n(221)),p=_(n(96)),h=_(n(112)),m=_(n(225)),b=_(n(226)),g=_(n(100)),y=_(n(227)),v=n(24);function _(e){return e&&e.__esModule?e:{default:e}}var O=(0,s.forbidExtraProps)((0,o.default)({},c.withStylesPropTypes,{startDateId:i.default.string,startDatePlaceholderText:i.default.string,screenReaderMessage:i.default.string,endDateId:i.default.string,endDatePlaceholderText:i.default.string,onStartDateFocus:i.default.func,onEndDateFocus:i.default.func,onStartDateChange:i.default.func,onEndDateChange:i.default.func,onStartDateShiftTab:i.default.func,onEndDateTab:i.default.func,onClearDates:i.default.func,onKeyDownArrowDown:i.default.func,onKeyDownQuestionMark:i.default.func,startDate:i.default.string,endDate:i.default.string,isStartDateFocused:i.default.bool,isEndDateFocused:i.default.bool,showClearDates:i.default.bool,disabled:h.default,required:i.default.bool,readOnly:i.default.bool,openDirection:d.default,showCaret:i.default.bool,showDefaultInputIcon:i.default.bool,inputIconPosition:p.default,customInputIcon:i.default.node,customArrowIcon:i.default.node,customCloseIcon:i.default.node,noBorder:i.default.bool,block:i.default.bool,small:i.default.bool,regular:i.default.bool,verticalSpacing:s.nonNegativeInteger,isFocused:i.default.bool,phrases:i.default.shape((0,u.default)(l.DateRangePickerInputPhrases)),isRTL:i.default.bool})),w={startDateId:v.START_DATE,endDateId:v.END_DATE,startDatePlaceholderText:"Start Date",endDatePlaceholderText:"End Date",screenReaderMessage:"",onStartDateFocus:function(){},onEndDateFocus:function(){},onStartDateChange:function(){},onEndDateChange:function(){},onStartDateShiftTab:function(){},onEndDateTab:function(){},onClearDates:function(){},onKeyDownArrowDown:function(){},onKeyDownQuestionMark:function(){},startDate:"",endDate:"",isStartDateFocused:!1,isEndDateFocused:!1,showClearDates:!1,disabled:!1,required:!1,readOnly:!1,openDirection:v.OPEN_DOWN,showCaret:!1,showDefaultInputIcon:!1,inputIconPosition:v.ICON_BEFORE_POSITION,customInputIcon:null,customArrowIcon:null,customCloseIcon:null,noBorder:!1,block:!1,small:!1,regular:!1,verticalSpacing:void 0,isFocused:!1,phrases:l.DateRangePickerInputPhrases,isRTL:!1};function k(e){var t=e.startDate,n=e.startDateId,o=e.startDatePlaceholderText,i=e.screenReaderMessage,s=e.isStartDateFocused,l=e.onStartDateChange,u=e.onStartDateFocus,d=e.onStartDateShiftTab,p=e.endDate,h=e.endDateId,_=e.endDatePlaceholderText,O=e.isEndDateFocused,w=e.onEndDateChange,k=e.onEndDateFocus,S=e.onEndDateTab,D=e.onKeyDownArrowDown,C=e.onKeyDownQuestionMark,E=e.onClearDates,j=e.showClearDates,F=e.disabled,P=e.required,M=e.readOnly,x=e.showCaret,T=e.openDirection,N=e.showDefaultInputIcon,I=e.inputIconPosition,R=e.customInputIcon,A=e.customArrowIcon,L=e.customCloseIcon,U=e.isFocused,B=e.phrases,H=e.isRTL,K=e.noBorder,z=e.block,q=e.verticalSpacing,V=e.small,W=e.regular,G=e.styles,Y=R||a.default.createElement(y.default,(0,c.css)(G.DateRangePickerInput_calendarIcon_svg)),$=A||a.default.createElement(m.default,(0,c.css)(G.DateRangePickerInput_arrow_svg));H&&($=a.default.createElement(b.default,(0,c.css)(G.DateRangePickerInput_arrow_svg))),V&&($="-");var Q=L||a.default.createElement(g.default,(0,c.css)(G.DateRangePickerInput_clearDates_svg,V&&G.DateRangePickerInput_clearDates_svg__small)),Z=i||B.keyboardNavigationInstructions,X=(N||null!==R)&&a.default.createElement("button",r({},(0,c.css)(G.DateRangePickerInput_calendarIcon),{type:"button",disabled:F,"aria-label":B.focusStartDate,onClick:D}),Y),J=F===v.START_DATE||!0===F,ee=F===v.END_DATE||!0===F;return a.default.createElement("div",(0,c.css)(G.DateRangePickerInput,F&&G.DateRangePickerInput__disabled,H&&G.DateRangePickerInput__rtl,!K&&G.DateRangePickerInput__withBorder,z&&G.DateRangePickerInput__block,j&&G.DateRangePickerInput__showClearDates),I===v.ICON_BEFORE_POSITION&&X,a.default.createElement(f.default,{id:n,placeholder:o,displayValue:t,screenReaderMessage:Z,focused:s,isFocused:U,disabled:J,required:P,readOnly:M,showCaret:x,openDirection:T,onChange:l,onFocus:u,onKeyDownShiftTab:d,onKeyDownArrowDown:D,onKeyDownQuestionMark:C,verticalSpacing:q,small:V,regular:W}),a.default.createElement("div",r({},(0,c.css)(G.DateRangePickerInput_arrow),{"aria-hidden":"true",role:"presentation"}),$),a.default.createElement(f.default,{id:h,placeholder:_,displayValue:p,screenReaderMessage:Z,focused:O,isFocused:U,disabled:ee,required:P,readOnly:M,showCaret:x,openDirection:T,onChange:w,onFocus:k,onKeyDownTab:S,onKeyDownArrowDown:D,onKeyDownQuestionMark:C,verticalSpacing:q,small:V,regular:W}),j&&a.default.createElement("button",r({type:"button","aria-label":B.clearDates},(0,c.css)(G.DateRangePickerInput_clearDates,V&&G.DateRangePickerInput_clearDates__small,!L&&G.DateRangePickerInput_clearDates_default,!(t||p)&&G.DateRangePickerInput_clearDates__hide),{onClick:E,disabled:F}),Q),I===v.ICON_AFTER_POSITION&&X)}k.propTypes=O,k.defaultProps=w,t.default=(0,c.withStyles)((function(e){var t=e.reactDates,n=t.border,r=t.color,o=t.sizing;return{DateRangePickerInput:{backgroundColor:r.background,display:"inline-block"},DateRangePickerInput__disabled:{background:r.disabled},DateRangePickerInput__withBorder:{borderColor:r.border,borderWidth:n.pickerInput.borderWidth,borderStyle:n.pickerInput.borderStyle,borderRadius:n.pickerInput.borderRadius},DateRangePickerInput__rtl:{direction:"rtl"},DateRangePickerInput__block:{display:"block"},DateRangePickerInput__showClearDates:{paddingRight:30},DateRangePickerInput_arrow:{display:"inline-block",verticalAlign:"middle",color:r.text},DateRangePickerInput_arrow_svg:{verticalAlign:"middle",fill:r.text,height:o.arrowWidth,width:o.arrowWidth},DateRangePickerInput_clearDates:{background:"none",border:0,color:"inherit",font:"inherit",lineHeight:"normal",overflow:"visible",cursor:"pointer",padding:10,margin:"0 10px 0 5px",position:"absolute",right:0,top:"50%",transform:"translateY(-50%)"},DateRangePickerInput_clearDates__small:{padding:6},DateRangePickerInput_clearDates_default:{":focus":{background:r.core.border,borderRadius:"50%"},":hover":{background:r.core.border,borderRadius:"50%"}},DateRangePickerInput_clearDates__hide:{visibility:"hidden"},DateRangePickerInput_clearDates_svg:{fill:r.core.grayLight,height:12,width:15,verticalAlign:"middle"},DateRangePickerInput_clearDates_svg__small:{height:9},DateRangePickerInput_calendarIcon:{background:"none",border:0,color:"inherit",font:"inherit",lineHeight:"normal",overflow:"visible",cursor:"pointer",display:"inline-block",verticalAlign:"middle",padding:10,margin:"0 5px 0 10px"},DateRangePickerInput_calendarIcon_svg:{fill:r.core.grayLight,height:15,width:14,verticalAlign:"middle"}}}))(k)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=m(n(36)),i=m(n(5)),s=m(n(1)),c=n(31),l=n(42),u=m(n(222)),d=m(n(85)),f=m(n(151)),p=m(n(86)),h=n(24);function m(e){return e&&e.__esModule?e:{default:e}}var b="M0,"+String(h.FANG_HEIGHT_PX)+" "+String(h.FANG_WIDTH_PX)+","+String(h.FANG_HEIGHT_PX)+" "+h.FANG_WIDTH_PX/2+",0z",g="M0,"+String(h.FANG_HEIGHT_PX)+" "+h.FANG_WIDTH_PX/2+",0 "+String(h.FANG_WIDTH_PX)+","+String(h.FANG_HEIGHT_PX),y="M0,0 "+String(h.FANG_WIDTH_PX)+",0 "+h.FANG_WIDTH_PX/2+","+String(h.FANG_HEIGHT_PX)+"z",v="M0,0 "+h.FANG_WIDTH_PX/2+","+String(h.FANG_HEIGHT_PX)+" "+String(h.FANG_WIDTH_PX)+",0",_=(0,c.forbidExtraProps)((0,a.default)({},l.withStylesPropTypes,{id:s.default.string.isRequired,placeholder:s.default.string,displayValue:s.default.string,screenReaderMessage:s.default.string,focused:s.default.bool,disabled:s.default.bool,required:s.default.bool,readOnly:s.default.bool,openDirection:p.default,showCaret:s.default.bool,verticalSpacing:c.nonNegativeInteger,small:s.default.bool,block:s.default.bool,regular:s.default.bool,onChange:s.default.func,onFocus:s.default.func,onKeyDownShiftTab:s.default.func,onKeyDownTab:s.default.func,onKeyDownArrowDown:s.default.func,onKeyDownQuestionMark:s.default.func,isFocused:s.default.bool})),O={placeholder:"Select Date",displayValue:"",screenReaderMessage:"",focused:!1,disabled:!1,required:!1,readOnly:null,openDirection:h.OPEN_DOWN,showCaret:!1,verticalSpacing:h.DEFAULT_VERTICAL_SPACING,small:!1,block:!1,regular:!1,onChange:function(){},onFocus:function(){},onKeyDownShiftTab:function(){},onKeyDownTab:function(){},onKeyDownArrowDown:function(){},onKeyDownQuestionMark:function(){},isFocused:!1},w=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.state={dateString:"",isTouchDevice:!1},n.onChange=n.onChange.bind(n),n.onKeyDown=n.onKeyDown.bind(n),n.setInputRef=n.setInputRef.bind(n),n.throttledKeyDown=(0,u.default)(n.onFinalKeyDown,300,{trailing:!1}),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),o(t,[{key:"componentDidMount",value:function(){this.setState({isTouchDevice:(0,d.default)()})}},{key:"componentWillReceiveProps",value:function(e){this.state.dateString&&e.displayValue&&this.setState({dateString:""})}},{key:"componentDidUpdate",value:function(e){var t=this.props,n=t.focused,r=t.isFocused;e.focused===n&&e.isFocused===r||n&&r&&this.inputRef.focus()}},{key:"onChange",value:function(e){var t=this.props,n=t.onChange,r=t.onKeyDownQuestionMark,o=e.target.value;"?"===o[o.length-1]?r(e):this.setState({dateString:o},(function(){return n(o)}))}},{key:"onKeyDown",value:function(e){e.stopPropagation(),h.MODIFIER_KEY_NAMES.has(e.key)||this.throttledKeyDown(e)}},{key:"onFinalKeyDown",value:function(e){var t=this.props,n=t.onKeyDownShiftTab,r=t.onKeyDownTab,o=t.onKeyDownArrowDown,a=t.onKeyDownQuestionMark,i=e.key;"Tab"===i?e.shiftKey?n(e):r(e):"ArrowDown"===i?o(e):"?"===i&&(e.preventDefault(),a(e))}},{key:"setInputRef",value:function(e){this.inputRef=e}},{key:"render",value:function(){var e=this.state,t=e.dateString,n=e.isTouchDevice,o=this.props,a=o.id,s=o.placeholder,c=o.displayValue,u=o.screenReaderMessage,d=o.focused,p=o.showCaret,m=o.onFocus,_=o.disabled,O=o.required,w=o.readOnly,k=o.openDirection,S=o.verticalSpacing,D=o.small,C=o.regular,E=o.block,j=o.styles,F=o.theme.reactDates,P=t||c||"",M="DateInput__screen-reader-message-"+String(a),x=p&&d,T=(0,f.default)(F,D);return i.default.createElement("div",(0,l.css)(j.DateInput,D&&j.DateInput__small,E&&j.DateInput__block,x&&j.DateInput__withFang,_&&j.DateInput__disabled,x&&k===h.OPEN_DOWN&&j.DateInput__openDown,x&&k===h.OPEN_UP&&j.DateInput__openUp),i.default.createElement("input",r({},(0,l.css)(j.DateInput_input,D&&j.DateInput_input__small,C&&j.DateInput_input__regular,w&&j.DateInput_input__readOnly,d&&j.DateInput_input__focused,_&&j.DateInput_input__disabled),{"aria-label":s,type:"text",id:a,name:a,ref:this.setInputRef,value:P,onChange:this.onChange,onKeyDown:this.onKeyDown,onFocus:m,placeholder:s,autoComplete:"off",disabled:_,readOnly:"boolean"==typeof w?w:n,required:O,"aria-describedby":u&&M})),x&&i.default.createElement("svg",r({role:"presentation",focusable:"false"},(0,l.css)(j.DateInput_fang,k===h.OPEN_DOWN&&{top:T+S-h.FANG_HEIGHT_PX-1},k===h.OPEN_UP&&{bottom:T+S-h.FANG_HEIGHT_PX-1})),i.default.createElement("path",r({},(0,l.css)(j.DateInput_fangShape),{d:k===h.OPEN_DOWN?b:y})),i.default.createElement("path",r({},(0,l.css)(j.DateInput_fangStroke),{d:k===h.OPEN_DOWN?g:v}))),u&&i.default.createElement("p",r({},(0,l.css)(j.DateInput_screenReaderMessage),{id:M}),u))}}]),t}(i.default.Component);w.propTypes=_,w.defaultProps=O,t.default=(0,l.withStyles)((function(e){var t=e.reactDates,n=t.border,r=t.color,o=t.sizing,a=t.spacing,i=t.font,s=t.zIndex;return{DateInput:{margin:0,padding:a.inputPadding,background:r.background,position:"relative",display:"inline-block",width:o.inputWidth,verticalAlign:"middle"},DateInput__small:{width:o.inputWidth_small},DateInput__block:{width:"100%"},DateInput__disabled:{background:r.disabled,color:r.textDisabled},DateInput_input:{fontWeight:200,fontSize:i.input.size,lineHeight:i.input.lineHeight,color:r.text,backgroundColor:r.background,width:"100%",padding:String(a.displayTextPaddingVertical)+"px "+String(a.displayTextPaddingHorizontal)+"px",paddingTop:a.displayTextPaddingTop,paddingBottom:a.displayTextPaddingBottom,paddingLeft:a.displayTextPaddingLeft,paddingRight:a.displayTextPaddingRight,border:n.input.border,borderTop:n.input.borderTop,borderRight:n.input.borderRight,borderBottom:n.input.borderBottom,borderLeft:n.input.borderLeft,borderRadius:n.input.borderRadius},DateInput_input__small:{fontSize:i.input.size_small,lineHeight:i.input.lineHeight_small,letterSpacing:i.input.letterSpacing_small,padding:String(a.displayTextPaddingVertical_small)+"px "+String(a.displayTextPaddingHorizontal_small)+"px",paddingTop:a.displayTextPaddingTop_small,paddingBottom:a.displayTextPaddingBottom_small,paddingLeft:a.displayTextPaddingLeft_small,paddingRight:a.displayTextPaddingRight_small},DateInput_input__regular:{fontWeight:"auto"},DateInput_input__readOnly:{userSelect:"none"},DateInput_input__focused:{outline:n.input.outlineFocused,background:r.backgroundFocused,border:n.input.borderFocused,borderTop:n.input.borderTopFocused,borderRight:n.input.borderRightFocused,borderBottom:n.input.borderBottomFocused,borderLeft:n.input.borderLeftFocused},DateInput_input__disabled:{background:r.disabled,fontStyle:i.input.styleDisabled},DateInput_screenReaderMessage:{border:0,clip:"rect(0, 0, 0, 0)",height:1,margin:-1,overflow:"hidden",padding:0,position:"absolute",width:1},DateInput_fang:{position:"absolute",width:h.FANG_WIDTH_PX,height:h.FANG_HEIGHT_PX,left:22,zIndex:s+2},DateInput_fangShape:{fill:r.background},DateInput_fangStroke:{stroke:r.core.border,fill:"transparent"}}}))(w)},function(e,t,n){var r=n(371),o=n(152);e.exports=function(e,t,n){var a=!0,i=!0;if("function"!=typeof e)throw new TypeError("Expected a function");return o(n)&&(a="leading"in n?!!n.leading:a,i="trailing"in n?!!n.trailing:i),r(e,t,{leading:a,maxWait:t,trailing:i})}},function(e,t,n){var r=n(373),o="object"==typeof self&&self&&self.Object===Object&&self,a=r||o||Function("return this")();e.exports=a},function(e,t,n){var r=n(223).Symbol;e.exports=r},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,o=n(5),a=(r=o)&&r.__esModule?r:{default:r};var i=function(e){return a.default.createElement("svg",e,a.default.createElement("path",{d:"M694.4 242.4l249.1 249.1c11 11 11 21 0 32L694.4 772.7c-5 5-10 7-16 7s-11-2-16-7c-11-11-11-21 0-32l210.1-210.1H67.1c-13 0-23-10-23-23s10-23 23-23h805.4L662.4 274.5c-21-21.1 11-53.1 32-32.1z"}))};i.defaultProps={viewBox:"0 0 1000 1000"},t.default=i},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,o=n(5),a=(r=o)&&r.__esModule?r:{default:r};var i=function(e){return a.default.createElement("svg",e,a.default.createElement("path",{d:"M336.2 274.5l-210.1 210h805.4c13 0 23 10 23 23s-10 23-23 23H126.1l210.1 210.1c11 11 11 21 0 32-5 5-10 7-16 7s-11-2-16-7l-249.1-249c-11-11-11-21 0-32l249.1-249.1c21-21.1 53 10.9 32 32z"}))};i.defaultProps={viewBox:"0 0 1000 1000"},t.default=i},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,o=n(5),a=(r=o)&&r.__esModule?r:{default:r};var i=function(e){return a.default.createElement("svg",e,a.default.createElement("path",{d:"M107.2 1392.9h241.1v-241.1H107.2v241.1zm294.7 0h267.9v-241.1H401.9v241.1zm-294.7-294.7h241.1V830.4H107.2v267.8zm294.7 0h267.9V830.4H401.9v267.8zM107.2 776.8h241.1V535.7H107.2v241.1zm616.2 616.1h267.9v-241.1H723.4v241.1zM401.9 776.8h267.9V535.7H401.9v241.1zm642.9 616.1H1286v-241.1h-241.1v241.1zm-321.4-294.7h267.9V830.4H723.4v267.8zM428.7 375V133.9c0-7.3-2.7-13.5-8-18.8-5.3-5.3-11.6-8-18.8-8h-53.6c-7.3 0-13.5 2.7-18.8 8-5.3 5.3-8 11.6-8 18.8V375c0 7.3 2.7 13.5 8 18.8 5.3 5.3 11.6 8 18.8 8h53.6c7.3 0 13.5-2.7 18.8-8 5.3-5.3 8-11.5 8-18.8zm616.1 723.2H1286V830.4h-241.1v267.8zM723.4 776.8h267.9V535.7H723.4v241.1zm321.4 0H1286V535.7h-241.1v241.1zm26.8-401.8V133.9c0-7.3-2.7-13.5-8-18.8-5.3-5.3-11.6-8-18.8-8h-53.6c-7.3 0-13.5 2.7-18.8 8-5.3 5.3-8 11.6-8 18.8V375c0 7.3 2.7 13.5 8 18.8 5.3 5.3 11.6 8 18.8 8h53.6c7.3 0 13.5-2.7 18.8-8 5.4-5.3 8-11.5 8-18.8zm321.5-53.6v1071.4c0 29-10.6 54.1-31.8 75.3-21.2 21.2-46.3 31.8-75.3 31.8H107.2c-29 0-54.1-10.6-75.3-31.8C10.6 1447 0 1421.9 0 1392.9V321.4c0-29 10.6-54.1 31.8-75.3s46.3-31.8 75.3-31.8h107.2v-80.4c0-36.8 13.1-68.4 39.3-94.6S311.4 0 348.3 0h53.6c36.8 0 68.4 13.1 94.6 39.3 26.2 26.2 39.3 57.8 39.3 94.6v80.4h321.5v-80.4c0-36.8 13.1-68.4 39.3-94.6C922.9 13.1 954.4 0 991.3 0h53.6c36.8 0 68.4 13.1 94.6 39.3s39.3 57.8 39.3 94.6v80.4H1286c29 0 54.1 10.6 75.3 31.8 21.2 21.2 31.8 46.3 31.8 75.3z"}))};i.defaultProps={viewBox:"0 0 1393.1 1500"},t.default=i},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],r=!0,o=!1,a=void 0;try{for(var i,s=e[Symbol.iterator]();!(r=(i=s.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){o=!0,a=e}finally{try{!r&&s.return&&s.return()}finally{if(o)throw a}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")},o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=x(n(36)),i=x(n(5)),s=x(n(1)),c=x(n(58)),l=n(31),u=x(n(9)),d=x(n(150)),f=x(n(85)),p=n(37),h=x(n(40)),m=x(n(98)),b=x(n(229)),g=x(n(82)),y=x(n(113)),v=x(n(99)),_=x(n(230)),O=x(n(154)),w=x(n(382)),k=x(n(109)),S=x(n(111)),D=x(n(112)),C=x(n(213)),E=x(n(84)),j=x(n(75)),F=x(n(97)),P=n(24),M=x(n(155));function x(e){return e&&e.__esModule?e:{default:e}}function T(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var N=(0,l.forbidExtraProps)({startDate:c.default.momentObj,endDate:c.default.momentObj,onDatesChange:s.default.func,startDateOffset:s.default.func,endDateOffset:s.default.func,focusedInput:C.default,onFocusChange:s.default.func,onClose:s.default.func,keepOpenOnDateSelect:s.default.bool,minimumNights:s.default.number,disabled:D.default,isOutsideRange:s.default.func,isDayBlocked:s.default.func,isDayHighlighted:s.default.func,renderMonthText:(0,l.mutuallyExclusiveProps)(s.default.func,"renderMonthText","renderMonthElement"),renderMonthElement:(0,l.mutuallyExclusiveProps)(s.default.func,"renderMonthText","renderMonthElement"),enableOutsideDays:s.default.bool,numberOfMonths:s.default.number,orientation:E.default,withPortal:s.default.bool,initialVisibleMonth:s.default.func,hideKeyboardShortcutsPanel:s.default.bool,daySize:l.nonNegativeInteger,noBorder:s.default.bool,verticalBorderSpacing:l.nonNegativeInteger,horizontalMonthPadding:l.nonNegativeInteger,navPrev:s.default.node,navNext:s.default.node,noNavButtons:s.default.bool,onPrevMonthClick:s.default.func,onNextMonthClick:s.default.func,onOutsideClick:s.default.func,renderCalendarDay:s.default.func,renderDayContents:s.default.func,renderCalendarInfo:s.default.func,calendarInfoPosition:F.default,firstDayOfWeek:j.default,verticalHeight:l.nonNegativeInteger,transitionDuration:l.nonNegativeInteger,onBlur:s.default.func,isFocused:s.default.bool,showKeyboardShortcuts:s.default.bool,monthFormat:s.default.string,weekDayFormat:s.default.string,phrases:s.default.shape((0,h.default)(p.DayPickerPhrases)),dayAriaLabelFormat:s.default.string,isRTL:s.default.bool}),I={startDate:void 0,endDate:void 0,onDatesChange:function(){},startDateOffset:void 0,endDateOffset:void 0,focusedInput:null,onFocusChange:function(){},onClose:function(){},keepOpenOnDateSelect:!1,minimumNights:1,disabled:!1,isOutsideRange:function(){},isDayBlocked:function(){},isDayHighlighted:function(){},renderMonthText:null,enableOutsideDays:!1,numberOfMonths:1,orientation:P.HORIZONTAL_ORIENTATION,withPortal:!1,hideKeyboardShortcutsPanel:!1,initialVisibleMonth:null,daySize:P.DAY_SIZE,navPrev:null,navNext:null,noNavButtons:!1,onPrevMonthClick:function(){},onNextMonthClick:function(){},onOutsideClick:function(){},renderCalendarDay:void 0,renderDayContents:null,renderCalendarInfo:null,renderMonthElement:null,calendarInfoPosition:P.INFO_POSITION_BOTTOM,firstDayOfWeek:null,verticalHeight:null,noBorder:!1,transitionDuration:void 0,verticalBorderSpacing:void 0,horizontalMonthPadding:13,onBlur:function(){},isFocused:!1,showKeyboardShortcuts:!1,monthFormat:"MMMM YYYY",weekDayFormat:"dd",phrases:p.DayPickerPhrases,dayAriaLabelFormat:void 0,isRTL:!1},R=function(e,t){return t===P.START_DATE?e.chooseAvailableStartDate:t===P.END_DATE?e.chooseAvailableEndDate:e.chooseAvailableDate},A=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));n.isTouchDevice=(0,f.default)(),n.today=(0,u.default)(),n.modifiers={today:function(e){return n.isToday(e)},blocked:function(e){return n.isBlocked(e)},"blocked-calendar":function(t){return e.isDayBlocked(t)},"blocked-out-of-range":function(t){return e.isOutsideRange(t)},"highlighted-calendar":function(t){return e.isDayHighlighted(t)},valid:function(e){return!n.isBlocked(e)},"selected-start":function(e){return n.isStartDate(e)},"selected-end":function(e){return n.isEndDate(e)},"blocked-minimum-nights":function(e){return n.doesNotMeetMinimumNights(e)},"selected-span":function(e){return n.isInSelectedSpan(e)},"last-in-range":function(e){return n.isLastInRange(e)},hovered:function(e){return n.isHovered(e)},"hovered-span":function(e){return n.isInHoveredSpan(e)},"hovered-offset":function(e){return n.isInHoveredSpan(e)},"after-hovered-start":function(e){return n.isDayAfterHoveredStartDate(e)},"first-day-of-week":function(e){return n.isFirstDayOfWeek(e)},"last-day-of-week":function(e){return n.isLastDayOfWeek(e)}};var r=n.getStateForNewMonth(e),o=r.currentMonth,i=r.visibleDays,s=R(e.phrases,e.focusedInput);return n.state={hoverDate:null,currentMonth:o,phrases:(0,a.default)({},e.phrases,{chooseAvailableDate:s}),visibleDays:i},n.onDayClick=n.onDayClick.bind(n),n.onDayMouseEnter=n.onDayMouseEnter.bind(n),n.onDayMouseLeave=n.onDayMouseLeave.bind(n),n.onPrevMonthClick=n.onPrevMonthClick.bind(n),n.onNextMonthClick=n.onNextMonthClick.bind(n),n.onMonthChange=n.onMonthChange.bind(n),n.onYearChange=n.onYearChange.bind(n),n.onMultiplyScrollableMonths=n.onMultiplyScrollableMonths.bind(n),n.getFirstFocusableDay=n.getFirstFocusableDay.bind(n),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),o(t,[{key:"componentWillReceiveProps",value:function(e){var t=this,n=e.startDate,r=e.endDate,o=e.focusedInput,i=e.minimumNights,s=e.isOutsideRange,c=e.isDayBlocked,l=e.isDayHighlighted,f=e.phrases,p=e.initialVisibleMonth,h=e.numberOfMonths,m=e.enableOutsideDays,b=this.props,y=b.startDate,v=b.endDate,_=b.focusedInput,O=b.minimumNights,w=b.isOutsideRange,k=b.isDayBlocked,S=b.isDayHighlighted,D=b.phrases,C=b.initialVisibleMonth,E=b.numberOfMonths,j=b.enableOutsideDays,F=this.state.visibleDays,M=!1,x=!1,T=!1;s!==w&&(this.modifiers["blocked-out-of-range"]=function(e){return s(e)},M=!0),c!==k&&(this.modifiers["blocked-calendar"]=function(e){return c(e)},x=!0),l!==S&&(this.modifiers["highlighted-calendar"]=function(e){return l(e)},T=!0);var N=M||x||T,I=n!==y,A=r!==v,L=o!==_;if(h!==E||m!==j||p!==C&&!_&&L){var U=this.getStateForNewMonth(e),B=U.currentMonth;F=U.visibleDays,this.setState({currentMonth:B,visibleDays:F})}var H={};if(I&&(H=this.deleteModifier(H,y,"selected-start"),H=this.addModifier(H,n,"selected-start"),y)){var K=y.clone().add(1,"day"),z=y.clone().add(O+1,"days");H=this.deleteModifierFromRange(H,K,z,"after-hovered-start")}if(A&&(H=this.deleteModifier(H,v,"selected-end"),H=this.addModifier(H,r,"selected-end")),(I||A)&&(y&&v&&(H=this.deleteModifierFromRange(H,y,v.clone().add(1,"day"),"selected-span")),n&&r&&(H=this.deleteModifierFromRange(H,n,r.clone().add(1,"day"),"hovered-span"),H=this.addModifierToRange(H,n.clone().add(1,"day"),r,"selected-span"))),!this.isTouchDevice&&I&&n&&!r){var q=n.clone().add(1,"day"),V=n.clone().add(i+1,"days");H=this.addModifierToRange(H,q,V,"after-hovered-start")}if(O>0&&(L||I||i!==O)){var W=y||this.today;H=this.deleteModifierFromRange(H,W,W.clone().add(O,"days"),"blocked-minimum-nights"),H=this.deleteModifierFromRange(H,W,W.clone().add(O,"days"),"blocked")}(L||N)&&(0,d.default)(F).forEach((function(e){Object.keys(e).forEach((function(e){var n=(0,u.default)(e),r=!1;(L||M)&&(s(n)?(H=t.addModifier(H,n,"blocked-out-of-range"),r=!0):H=t.deleteModifier(H,n,"blocked-out-of-range")),(L||x)&&(c(n)?(H=t.addModifier(H,n,"blocked-calendar"),r=!0):H=t.deleteModifier(H,n,"blocked-calendar")),H=r?t.addModifier(H,n,"blocked"):t.deleteModifier(H,n,"blocked"),(L||T)&&(H=l(n)?t.addModifier(H,n,"highlighted-calendar"):t.deleteModifier(H,n,"highlighted-calendar"))}))})),i>0&&n&&o===P.END_DATE&&(H=this.addModifierToRange(H,n,n.clone().add(i,"days"),"blocked-minimum-nights"),H=this.addModifierToRange(H,n,n.clone().add(i,"days"),"blocked"));var G=(0,u.default)();if((0,g.default)(this.today,G)||(H=this.deleteModifier(H,this.today,"today"),H=this.addModifier(H,G,"today"),this.today=G),Object.keys(H).length>0&&this.setState({visibleDays:(0,a.default)({},F,H)}),L||f!==D){var Y=R(f,o);this.setState({phrases:(0,a.default)({},f,{chooseAvailableDate:Y})})}}},{key:"onDayClick",value:function(e,t){var n=this.props,r=n.keepOpenOnDateSelect,o=n.minimumNights,a=n.onBlur,i=n.focusedInput,s=n.onFocusChange,c=n.onClose,l=n.onDatesChange,u=n.startDateOffset,d=n.endDateOffset,f=n.disabled;if(t&&t.preventDefault(),!this.isBlocked(e)){var p=this.props,h=p.startDate,b=p.endDate;if(u||d)h=(0,w.default)(u,e),b=(0,w.default)(d,e),r||(s(null),c({startDate:h,endDate:b}));else if(i===P.START_DATE){var g=b&&b.clone().subtract(o,"days"),_=(0,v.default)(g,e)||(0,y.default)(h,b),O=f===P.END_DATE;O&&_||(h=e,_&&(b=null)),O&&!_?(s(null),c({startDate:h,endDate:b})):O||s(P.END_DATE)}else if(i===P.END_DATE){var k=h&&h.clone().add(o,"days");h?(0,m.default)(e,k)?(b=e,r||(s(null),c({startDate:h,endDate:b}))):f!==P.START_DATE&&(h=e,b=null):(b=e,s(P.START_DATE))}l({startDate:h,endDate:b}),a()}}},{key:"onDayMouseEnter",value:function(e){if(!this.isTouchDevice){var t=this.props,n=t.startDate,r=t.endDate,o=t.focusedInput,i=t.minimumNights,s=t.startDateOffset,c=t.endDateOffset,l=this.state,u=l.hoverDate,d=l.visibleDays,f=null;if(o){var p=s||c,h={};if(p){var m=(0,w.default)(s,e),b=(0,w.default)(c,e,(function(e){return e.add(1,"day")}));f={start:m,end:b},this.state.dateOffset&&this.state.dateOffset.start&&this.state.dateOffset.end&&(h=this.deleteModifierFromRange(h,this.state.dateOffset.start,this.state.dateOffset.end,"hovered-offset")),h=this.addModifierToRange(h,m,b,"hovered-offset")}if(!p){if(h=this.deleteModifier(h,u,"hovered"),h=this.addModifier(h,e,"hovered"),n&&!r&&o===P.END_DATE){if((0,y.default)(u,n)){var _=u.clone().add(1,"day");h=this.deleteModifierFromRange(h,n,_,"hovered-span")}if(!this.isBlocked(e)&&(0,y.default)(e,n)){var O=e.clone().add(1,"day");h=this.addModifierToRange(h,n,O,"hovered-span")}}if(!n&&r&&o===P.START_DATE&&((0,v.default)(u,r)&&(h=this.deleteModifierFromRange(h,u,r,"hovered-span")),!this.isBlocked(e)&&(0,v.default)(e,r)&&(h=this.addModifierToRange(h,e,r,"hovered-span"))),n){var k=n.clone().add(1,"day"),S=n.clone().add(i+1,"days");if(h=this.deleteModifierFromRange(h,k,S,"after-hovered-start"),(0,g.default)(e,n)){var D=n.clone().add(1,"day"),C=n.clone().add(i+1,"days");h=this.addModifierToRange(h,D,C,"after-hovered-start")}}}this.setState({hoverDate:e,dateOffset:f,visibleDays:(0,a.default)({},d,h)})}}}},{key:"onDayMouseLeave",value:function(e){var t=this.props,n=t.startDate,r=t.endDate,o=t.minimumNights,i=this.state,s=i.hoverDate,c=i.visibleDays,l=i.dateOffset;if(!this.isTouchDevice&&s){var u={};if(u=this.deleteModifier(u,s,"hovered"),l&&(u=this.deleteModifierFromRange(u,this.state.dateOffset.start,this.state.dateOffset.end,"hovered-offset")),n&&!r&&(0,y.default)(s,n)){var d=s.clone().add(1,"day");u=this.deleteModifierFromRange(u,n,d,"hovered-span")}if(!n&&r&&(0,y.default)(r,s)&&(u=this.deleteModifierFromRange(u,s,r,"hovered-span")),n&&(0,g.default)(e,n)){var f=n.clone().add(1,"day"),p=n.clone().add(o+1,"days");u=this.deleteModifierFromRange(u,f,p,"after-hovered-start")}this.setState({hoverDate:null,visibleDays:(0,a.default)({},c,u)})}}},{key:"onPrevMonthClick",value:function(){var e=this.props,t=e.onPrevMonthClick,n=e.numberOfMonths,r=e.enableOutsideDays,o=this.state,i=o.currentMonth,s=o.visibleDays,c={};Object.keys(s).sort().slice(0,n+1).forEach((function(e){c[e]=s[e]}));var l=i.clone().subtract(2,"months"),u=(0,_.default)(l,1,r,!0),d=i.clone().subtract(1,"month");this.setState({currentMonth:d,visibleDays:(0,a.default)({},c,this.getModifiers(u))},(function(){t(d.clone())}))}},{key:"onNextMonthClick",value:function(){var e=this.props,t=e.onNextMonthClick,n=e.numberOfMonths,r=e.enableOutsideDays,o=this.state,i=o.currentMonth,s=o.visibleDays,c={};Object.keys(s).sort().slice(1).forEach((function(e){c[e]=s[e]}));var l=i.clone().add(n+1,"month"),u=(0,_.default)(l,1,r,!0),d=i.clone().add(1,"month");this.setState({currentMonth:d,visibleDays:(0,a.default)({},c,this.getModifiers(u))},(function(){t(d.clone())}))}},{key:"onMonthChange",value:function(e){var t=this.props,n=t.numberOfMonths,r=t.enableOutsideDays,o=t.orientation===P.VERTICAL_SCROLLABLE,a=(0,_.default)(e,n,r,o);this.setState({currentMonth:e.clone(),visibleDays:this.getModifiers(a)})}},{key:"onYearChange",value:function(e){var t=this.props,n=t.numberOfMonths,r=t.enableOutsideDays,o=t.orientation===P.VERTICAL_SCROLLABLE,a=(0,_.default)(e,n,r,o);this.setState({currentMonth:e.clone(),visibleDays:this.getModifiers(a)})}},{key:"onMultiplyScrollableMonths",value:function(){var e=this.props,t=e.numberOfMonths,n=e.enableOutsideDays,r=this.state,o=r.currentMonth,i=r.visibleDays,s=Object.keys(i).length,c=o.clone().add(s,"month"),l=(0,_.default)(c,t,n,!0);this.setState({visibleDays:(0,a.default)({},i,this.getModifiers(l))})}},{key:"getFirstFocusableDay",value:function(e){var t=this,n=this.props,o=n.startDate,a=n.endDate,i=n.focusedInput,s=n.minimumNights,c=n.numberOfMonths,l=e.clone().startOf("month");if(i===P.START_DATE&&o?l=o.clone():i===P.END_DATE&&!a&&o?l=o.clone().add(s,"days"):i===P.END_DATE&&a&&(l=a.clone()),this.isBlocked(l)){for(var u=[],d=e.clone().add(c-1,"months").endOf("month"),f=l.clone();!(0,y.default)(f,d);)f=f.clone().add(1,"day"),u.push(f);var p=u.filter((function(e){return!t.isBlocked(e)}));p.length>0&&(l=r(p,1)[0])}return l}},{key:"getModifiers",value:function(e){var t=this,n={};return Object.keys(e).forEach((function(r){n[r]={},e[r].forEach((function(e){n[r][(0,k.default)(e)]=t.getModifiersForDay(e)}))})),n}},{key:"getModifiersForDay",value:function(e){var t=this;return new Set(Object.keys(this.modifiers).filter((function(n){return t.modifiers[n](e)})))}},{key:"getStateForNewMonth",value:function(e){var t=this,n=e.initialVisibleMonth,r=e.numberOfMonths,o=e.enableOutsideDays,a=e.orientation,i=e.startDate,s=(n||(i?function(){return i}:function(){return t.today}))(),c=a===P.VERTICAL_SCROLLABLE;return{currentMonth:s,visibleDays:this.getModifiers((0,_.default)(s,r,o,c))}}},{key:"addModifier",value:function(e,t,n){var r=this.props,o=r.numberOfMonths,i=r.enableOutsideDays,s=r.orientation,c=this.state,l=c.currentMonth,u=c.visibleDays,d=l,f=o;if(s===P.VERTICAL_SCROLLABLE?f=Object.keys(u).length:(d=d.clone().subtract(1,"month"),f+=2),!t||!(0,O.default)(t,d,f,i))return e;var p=(0,k.default)(t),h=(0,a.default)({},e);if(i)h=Object.keys(u).filter((function(e){return Object.keys(u[e]).indexOf(p)>-1})).reduce((function(t,r){var o=e[r]||u[r],i=new Set(o[p]);return i.add(n),(0,a.default)({},t,T({},r,(0,a.default)({},o,T({},p,i))))}),h);else{var m=(0,S.default)(t),b=e[m]||u[m],g=new Set(b[p]);g.add(n),h=(0,a.default)({},h,T({},m,(0,a.default)({},b,T({},p,g))))}return h}},{key:"addModifierToRange",value:function(e,t,n,r){for(var o=e,a=t.clone();(0,v.default)(a,n);)o=this.addModifier(o,a,r),a=a.clone().add(1,"day");return o}},{key:"deleteModifier",value:function(e,t,n){var r=this.props,o=r.numberOfMonths,i=r.enableOutsideDays,s=r.orientation,c=this.state,l=c.currentMonth,u=c.visibleDays,d=l,f=o;if(s===P.VERTICAL_SCROLLABLE?f=Object.keys(u).length:(d=d.clone().subtract(1,"month"),f+=2),!t||!(0,O.default)(t,d,f,i))return e;var p=(0,k.default)(t),h=(0,a.default)({},e);if(i)h=Object.keys(u).filter((function(e){return Object.keys(u[e]).indexOf(p)>-1})).reduce((function(t,r){var o=e[r]||u[r],i=new Set(o[p]);return i.delete(n),(0,a.default)({},t,T({},r,(0,a.default)({},o,T({},p,i))))}),h);else{var m=(0,S.default)(t),b=e[m]||u[m],g=new Set(b[p]);g.delete(n),h=(0,a.default)({},h,T({},m,(0,a.default)({},b,T({},p,g))))}return h}},{key:"deleteModifierFromRange",value:function(e,t,n,r){for(var o=e,a=t.clone();(0,v.default)(a,n);)o=this.deleteModifier(o,a,r),a=a.clone().add(1,"day");return o}},{key:"doesNotMeetMinimumNights",value:function(e){var t=this.props,n=t.startDate,r=t.isOutsideRange,o=t.focusedInput,a=t.minimumNights;if(o!==P.END_DATE)return!1;if(n){var i=e.diff(n.clone().startOf("day").hour(12),"days");return i<a&&i>=0}return r((0,u.default)(e).subtract(a,"days"))}},{key:"isDayAfterHoveredStartDate",value:function(e){var t=this.props,n=t.startDate,r=t.endDate,o=t.minimumNights,a=(this.state||{}).hoverDate;return!!n&&!r&&!this.isBlocked(e)&&(0,b.default)(a,e)&&o>0&&(0,g.default)(a,n)}},{key:"isEndDate",value:function(e){var t=this.props.endDate;return(0,g.default)(e,t)}},{key:"isHovered",value:function(e){var t=(this.state||{}).hoverDate;return!!this.props.focusedInput&&(0,g.default)(e,t)}},{key:"isInHoveredSpan",value:function(e){var t=this.props,n=t.startDate,r=t.endDate,o=(this.state||{}).hoverDate,a=!!n&&!r&&(e.isBetween(n,o)||(0,g.default)(o,e)),i=!!r&&!n&&(e.isBetween(o,r)||(0,g.default)(o,e)),s=o&&!this.isBlocked(o);return(a||i)&&s}},{key:"isInSelectedSpan",value:function(e){var t=this.props,n=t.startDate,r=t.endDate;return e.isBetween(n,r)}},{key:"isLastInRange",value:function(e){var t=this.props.endDate;return this.isInSelectedSpan(e)&&(0,b.default)(e,t)}},{key:"isStartDate",value:function(e){var t=this.props.startDate;return(0,g.default)(e,t)}},{key:"isBlocked",value:function(e){var t=this.props,n=t.isDayBlocked,r=t.isOutsideRange;return n(e)||r(e)||this.doesNotMeetMinimumNights(e)}},{key:"isToday",value:function(e){return(0,g.default)(e,this.today)}},{key:"isFirstDayOfWeek",value:function(e){var t=this.props.firstDayOfWeek;return e.day()===(t||u.default.localeData().firstDayOfWeek())}},{key:"isLastDayOfWeek",value:function(e){var t=this.props.firstDayOfWeek;return e.day()===((t||u.default.localeData().firstDayOfWeek())+6)%7}},{key:"render",value:function(){var e=this.props,t=e.numberOfMonths,n=e.orientation,r=e.monthFormat,o=e.renderMonthText,a=e.navPrev,s=e.navNext,c=e.noNavButtons,l=e.onOutsideClick,u=e.withPortal,d=e.enableOutsideDays,f=e.firstDayOfWeek,p=e.hideKeyboardShortcutsPanel,h=e.daySize,m=e.focusedInput,b=e.renderCalendarDay,g=e.renderDayContents,y=e.renderCalendarInfo,v=e.renderMonthElement,_=e.calendarInfoPosition,O=e.onBlur,w=e.isFocused,k=e.showKeyboardShortcuts,S=e.isRTL,D=e.weekDayFormat,C=e.dayAriaLabelFormat,E=e.verticalHeight,j=e.noBorder,F=e.transitionDuration,P=e.verticalBorderSpacing,x=e.horizontalMonthPadding,T=this.state,N=T.currentMonth,I=T.phrases,R=T.visibleDays;return i.default.createElement(M.default,{orientation:n,enableOutsideDays:d,modifiers:R,numberOfMonths:t,onDayClick:this.onDayClick,onDayMouseEnter:this.onDayMouseEnter,onDayMouseLeave:this.onDayMouseLeave,onPrevMonthClick:this.onPrevMonthClick,onNextMonthClick:this.onNextMonthClick,onMonthChange:this.onMonthChange,onYearChange:this.onYearChange,onMultiplyScrollableMonths:this.onMultiplyScrollableMonths,monthFormat:r,renderMonthText:o,withPortal:u,hidden:!m,initialVisibleMonth:function(){return N},daySize:h,onOutsideClick:l,navPrev:a,navNext:s,noNavButtons:c,renderCalendarDay:b,renderDayContents:g,renderCalendarInfo:y,renderMonthElement:v,calendarInfoPosition:_,firstDayOfWeek:f,hideKeyboardShortcutsPanel:p,isFocused:w,getFirstFocusableDay:this.getFirstFocusableDay,onBlur:O,showKeyboardShortcuts:k,phrases:I,isRTL:S,weekDayFormat:D,dayAriaLabelFormat:C,verticalHeight:E,verticalBorderSpacing:P,noBorder:j,transitionDuration:F,horizontalMonthPadding:x})}}]),t}(i.default.Component);t.default=A,A.propTypes=N,A.defaultProps=I},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){if(!r.default.isMoment(e)||!r.default.isMoment(t))return!1;var n=(0,r.default)(e).add(1,"day");return(0,o.default)(n,t)};var r=a(n(9)),o=a(n(82));function a(e){return e&&e.__esModule?e:{default:e}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t,n,a){if(!r.default.isMoment(e))return{};for(var i={},s=a?e.clone():e.clone().subtract(1,"month"),c=0;c<(a?t:t+2);c+=1){var l=[],u=s.clone(),d=u.clone().startOf("month").hour(12),f=u.clone().endOf("month").hour(12),p=d.clone();if(n)for(var h=0;h<p.weekday();h+=1){var m=p.clone().subtract(h+1,"day");l.unshift(m)}for(;p<f;)l.push(p.clone()),p.add(1,"day");if(n&&0!==p.weekday())for(var b=p.weekday(),g=0;b<7;b+=1,g+=1){var y=p.clone().add(g,"day");l.push(y)}i[(0,o.default)(s)]=l,s=s.clone().add(1,"month")}return i};var r=a(n(9)),o=a(n(111));function a(e){return e&&e.__esModule?e:{default:e}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],r=!0,o=!1,a=void 0;try{for(var i,s=e[Symbol.iterator]();!(r=(i=s.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){o=!0,a=e}finally{try{!r&&s.return&&s.return()}finally{if(o)throw a}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")},o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=C(n(36)),i=C(n(5)),s=C(n(1)),c=C(n(58)),l=n(31),u=C(n(9)),d=C(n(150)),f=C(n(85)),p=n(37),h=C(n(40)),m=C(n(82)),b=C(n(113)),g=C(n(230)),y=C(n(154)),v=C(n(109)),_=C(n(111)),O=C(n(84)),w=C(n(75)),k=C(n(97)),S=n(24),D=C(n(155));function C(e){return e&&e.__esModule?e:{default:e}}function E(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var j=(0,l.forbidExtraProps)({date:c.default.momentObj,onDateChange:s.default.func,focused:s.default.bool,onFocusChange:s.default.func,onClose:s.default.func,keepOpenOnDateSelect:s.default.bool,isOutsideRange:s.default.func,isDayBlocked:s.default.func,isDayHighlighted:s.default.func,renderMonthText:(0,l.mutuallyExclusiveProps)(s.default.func,"renderMonthText","renderMonthElement"),renderMonthElement:(0,l.mutuallyExclusiveProps)(s.default.func,"renderMonthText","renderMonthElement"),enableOutsideDays:s.default.bool,numberOfMonths:s.default.number,orientation:O.default,withPortal:s.default.bool,initialVisibleMonth:s.default.func,firstDayOfWeek:w.default,hideKeyboardShortcutsPanel:s.default.bool,daySize:l.nonNegativeInteger,verticalHeight:l.nonNegativeInteger,noBorder:s.default.bool,verticalBorderSpacing:l.nonNegativeInteger,transitionDuration:l.nonNegativeInteger,horizontalMonthPadding:l.nonNegativeInteger,navPrev:s.default.node,navNext:s.default.node,onPrevMonthClick:s.default.func,onNextMonthClick:s.default.func,onOutsideClick:s.default.func,renderCalendarDay:s.default.func,renderDayContents:s.default.func,renderCalendarInfo:s.default.func,calendarInfoPosition:k.default,onBlur:s.default.func,isFocused:s.default.bool,showKeyboardShortcuts:s.default.bool,monthFormat:s.default.string,weekDayFormat:s.default.string,phrases:s.default.shape((0,h.default)(p.DayPickerPhrases)),dayAriaLabelFormat:s.default.string,isRTL:s.default.bool}),F={date:void 0,onDateChange:function(){},focused:!1,onFocusChange:function(){},onClose:function(){},keepOpenOnDateSelect:!1,isOutsideRange:function(){},isDayBlocked:function(){},isDayHighlighted:function(){},renderMonthText:null,enableOutsideDays:!1,numberOfMonths:1,orientation:S.HORIZONTAL_ORIENTATION,withPortal:!1,hideKeyboardShortcutsPanel:!1,initialVisibleMonth:null,firstDayOfWeek:null,daySize:S.DAY_SIZE,verticalHeight:null,noBorder:!1,verticalBorderSpacing:void 0,transitionDuration:void 0,horizontalMonthPadding:13,navPrev:null,navNext:null,onPrevMonthClick:function(){},onNextMonthClick:function(){},onOutsideClick:function(){},renderCalendarDay:void 0,renderDayContents:null,renderCalendarInfo:null,renderMonthElement:null,calendarInfoPosition:S.INFO_POSITION_BOTTOM,onBlur:function(){},isFocused:!1,showKeyboardShortcuts:!1,monthFormat:"MMMM YYYY",weekDayFormat:"dd",phrases:p.DayPickerPhrases,dayAriaLabelFormat:void 0,isRTL:!1},P=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));n.isTouchDevice=!1,n.today=(0,u.default)(),n.modifiers={today:function(e){return n.isToday(e)},blocked:function(e){return n.isBlocked(e)},"blocked-calendar":function(t){return e.isDayBlocked(t)},"blocked-out-of-range":function(t){return e.isOutsideRange(t)},"highlighted-calendar":function(t){return e.isDayHighlighted(t)},valid:function(e){return!n.isBlocked(e)},hovered:function(e){return n.isHovered(e)},selected:function(e){return n.isSelected(e)},"first-day-of-week":function(e){return n.isFirstDayOfWeek(e)},"last-day-of-week":function(e){return n.isLastDayOfWeek(e)}};var r=n.getStateForNewMonth(e),o=r.currentMonth,a=r.visibleDays;return n.state={hoverDate:null,currentMonth:o,visibleDays:a},n.onDayMouseEnter=n.onDayMouseEnter.bind(n),n.onDayMouseLeave=n.onDayMouseLeave.bind(n),n.onDayClick=n.onDayClick.bind(n),n.onPrevMonthClick=n.onPrevMonthClick.bind(n),n.onNextMonthClick=n.onNextMonthClick.bind(n),n.onMonthChange=n.onMonthChange.bind(n),n.onYearChange=n.onYearChange.bind(n),n.getFirstFocusableDay=n.getFirstFocusableDay.bind(n),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),o(t,[{key:"componentDidMount",value:function(){this.isTouchDevice=(0,f.default)()}},{key:"componentWillReceiveProps",value:function(e){var t=this,n=e.date,r=e.focused,o=e.isOutsideRange,i=e.isDayBlocked,s=e.isDayHighlighted,c=e.initialVisibleMonth,l=e.numberOfMonths,f=e.enableOutsideDays,p=this.props,h=p.isOutsideRange,b=p.isDayBlocked,g=p.isDayHighlighted,y=p.numberOfMonths,v=p.enableOutsideDays,_=p.initialVisibleMonth,O=p.focused,w=p.date,k=this.state.visibleDays,S=!1,D=!1,C=!1;o!==h&&(this.modifiers["blocked-out-of-range"]=function(e){return o(e)},S=!0),i!==b&&(this.modifiers["blocked-calendar"]=function(e){return i(e)},D=!0),s!==g&&(this.modifiers["highlighted-calendar"]=function(e){return s(e)},C=!0);var E=S||D||C;if(l!==y||f!==v||c!==_&&!O&&r){var j=this.getStateForNewMonth(e),F=j.currentMonth;k=j.visibleDays,this.setState({currentMonth:F,visibleDays:k})}var P=r!==O,M={};n!==w&&(M=this.deleteModifier(M,w,"selected"),M=this.addModifier(M,n,"selected")),(P||E)&&(0,d.default)(k).forEach((function(e){Object.keys(e).forEach((function(e){var n=(0,u.default)(e);M=t.isBlocked(n)?t.addModifier(M,n,"blocked"):t.deleteModifier(M,n,"blocked"),(P||S)&&(M=o(n)?t.addModifier(M,n,"blocked-out-of-range"):t.deleteModifier(M,n,"blocked-out-of-range")),(P||D)&&(M=i(n)?t.addModifier(M,n,"blocked-calendar"):t.deleteModifier(M,n,"blocked-calendar")),(P||C)&&(M=s(n)?t.addModifier(M,n,"highlighted-calendar"):t.deleteModifier(M,n,"highlighted-calendar"))}))}));var x=(0,u.default)();(0,m.default)(this.today,x)||(M=this.deleteModifier(M,this.today,"today"),M=this.addModifier(M,x,"today"),this.today=x),Object.keys(M).length>0&&this.setState({visibleDays:(0,a.default)({},k,M)})}},{key:"componentWillUpdate",value:function(){this.today=(0,u.default)()}},{key:"onDayClick",value:function(e,t){if(t&&t.preventDefault(),!this.isBlocked(e)){var n=this.props,r=n.onDateChange,o=n.keepOpenOnDateSelect,a=n.onFocusChange,i=n.onClose;r(e),o||(a({focused:!1}),i({date:e}))}}},{key:"onDayMouseEnter",value:function(e){if(!this.isTouchDevice){var t=this.state,n=t.hoverDate,r=t.visibleDays,o=this.deleteModifier({},n,"hovered");o=this.addModifier(o,e,"hovered"),this.setState({hoverDate:e,visibleDays:(0,a.default)({},r,o)})}}},{key:"onDayMouseLeave",value:function(){var e=this.state,t=e.hoverDate,n=e.visibleDays;if(!this.isTouchDevice&&t){var r=this.deleteModifier({},t,"hovered");this.setState({hoverDate:null,visibleDays:(0,a.default)({},n,r)})}}},{key:"onPrevMonthClick",value:function(){var e=this.props,t=e.onPrevMonthClick,n=e.numberOfMonths,r=e.enableOutsideDays,o=this.state,i=o.currentMonth,s=o.visibleDays,c={};Object.keys(s).sort().slice(0,n+1).forEach((function(e){c[e]=s[e]}));var l=i.clone().subtract(1,"month"),u=(0,g.default)(l,1,r);this.setState({currentMonth:l,visibleDays:(0,a.default)({},c,this.getModifiers(u))},(function(){t(l.clone())}))}},{key:"onNextMonthClick",value:function(){var e=this.props,t=e.onNextMonthClick,n=e.numberOfMonths,r=e.enableOutsideDays,o=this.state,i=o.currentMonth,s=o.visibleDays,c={};Object.keys(s).sort().slice(1).forEach((function(e){c[e]=s[e]}));var l=i.clone().add(n,"month"),u=(0,g.default)(l,1,r),d=i.clone().add(1,"month");this.setState({currentMonth:d,visibleDays:(0,a.default)({},c,this.getModifiers(u))},(function(){t(d.clone())}))}},{key:"onMonthChange",value:function(e){var t=this.props,n=t.numberOfMonths,r=t.enableOutsideDays,o=t.orientation===S.VERTICAL_SCROLLABLE,a=(0,g.default)(e,n,r,o);this.setState({currentMonth:e.clone(),visibleDays:this.getModifiers(a)})}},{key:"onYearChange",value:function(e){var t=this.props,n=t.numberOfMonths,r=t.enableOutsideDays,o=t.orientation===S.VERTICAL_SCROLLABLE,a=(0,g.default)(e,n,r,o);this.setState({currentMonth:e.clone(),visibleDays:this.getModifiers(a)})}},{key:"getFirstFocusableDay",value:function(e){var t=this,n=this.props,o=n.date,a=n.numberOfMonths,i=e.clone().startOf("month");if(o&&(i=o.clone()),this.isBlocked(i)){for(var s=[],c=e.clone().add(a-1,"months").endOf("month"),l=i.clone();!(0,b.default)(l,c);)l=l.clone().add(1,"day"),s.push(l);var u=s.filter((function(e){return!t.isBlocked(e)&&(0,b.default)(e,i)}));if(u.length>0){var d=r(u,1);i=d[0]}}return i}},{key:"getModifiers",value:function(e){var t=this,n={};return Object.keys(e).forEach((function(r){n[r]={},e[r].forEach((function(e){n[r][(0,v.default)(e)]=t.getModifiersForDay(e)}))})),n}},{key:"getModifiersForDay",value:function(e){var t=this;return new Set(Object.keys(this.modifiers).filter((function(n){return t.modifiers[n](e)})))}},{key:"getStateForNewMonth",value:function(e){var t=this,n=e.initialVisibleMonth,r=e.date,o=e.numberOfMonths,a=e.enableOutsideDays,i=(n||(r?function(){return r}:function(){return t.today}))();return{currentMonth:i,visibleDays:this.getModifiers((0,g.default)(i,o,a))}}},{key:"addModifier",value:function(e,t,n){var r=this.props,o=r.numberOfMonths,i=r.enableOutsideDays,s=r.orientation,c=this.state,l=c.currentMonth,u=c.visibleDays,d=l,f=o;if(s===S.VERTICAL_SCROLLABLE?f=Object.keys(u).length:(d=d.clone().subtract(1,"month"),f+=2),!t||!(0,y.default)(t,d,f,i))return e;var p=(0,v.default)(t),h=(0,a.default)({},e);if(i)h=Object.keys(u).filter((function(e){return Object.keys(u[e]).indexOf(p)>-1})).reduce((function(t,r){var o=e[r]||u[r],i=new Set(o[p]);return i.add(n),(0,a.default)({},t,E({},r,(0,a.default)({},o,E({},p,i))))}),h);else{var m=(0,_.default)(t),b=e[m]||u[m],g=new Set(b[p]);g.add(n),h=(0,a.default)({},h,E({},m,(0,a.default)({},b,E({},p,g))))}return h}},{key:"deleteModifier",value:function(e,t,n){var r=this.props,o=r.numberOfMonths,i=r.enableOutsideDays,s=r.orientation,c=this.state,l=c.currentMonth,u=c.visibleDays,d=l,f=o;if(s===S.VERTICAL_SCROLLABLE?f=Object.keys(u).length:(d=d.clone().subtract(1,"month"),f+=2),!t||!(0,y.default)(t,d,f,i))return e;var p=(0,v.default)(t),h=(0,a.default)({},e);if(i)h=Object.keys(u).filter((function(e){return Object.keys(u[e]).indexOf(p)>-1})).reduce((function(t,r){var o=e[r]||u[r],i=new Set(o[p]);return i.delete(n),(0,a.default)({},t,E({},r,(0,a.default)({},o,E({},p,i))))}),h);else{var m=(0,_.default)(t),b=e[m]||u[m],g=new Set(b[p]);g.delete(n),h=(0,a.default)({},h,E({},m,(0,a.default)({},b,E({},p,g))))}return h}},{key:"isBlocked",value:function(e){var t=this.props,n=t.isDayBlocked,r=t.isOutsideRange;return n(e)||r(e)}},{key:"isHovered",value:function(e){var t=(this.state||{}).hoverDate;return(0,m.default)(e,t)}},{key:"isSelected",value:function(e){var t=this.props.date;return(0,m.default)(e,t)}},{key:"isToday",value:function(e){return(0,m.default)(e,this.today)}},{key:"isFirstDayOfWeek",value:function(e){var t=this.props.firstDayOfWeek;return e.day()===(t||u.default.localeData().firstDayOfWeek())}},{key:"isLastDayOfWeek",value:function(e){var t=this.props.firstDayOfWeek;return e.day()===((t||u.default.localeData().firstDayOfWeek())+6)%7}},{key:"render",value:function(){var e=this.props,t=e.numberOfMonths,n=e.orientation,r=e.monthFormat,o=e.renderMonthText,a=e.navPrev,s=e.navNext,c=e.onOutsideClick,l=e.withPortal,u=e.focused,d=e.enableOutsideDays,f=e.hideKeyboardShortcutsPanel,p=e.daySize,h=e.firstDayOfWeek,m=e.renderCalendarDay,b=e.renderDayContents,g=e.renderCalendarInfo,y=e.renderMonthElement,v=e.calendarInfoPosition,_=e.isFocused,O=e.isRTL,w=e.phrases,k=e.dayAriaLabelFormat,S=e.onBlur,C=e.showKeyboardShortcuts,E=e.weekDayFormat,j=e.verticalHeight,F=e.noBorder,P=e.transitionDuration,M=e.verticalBorderSpacing,x=e.horizontalMonthPadding,T=this.state,N=T.currentMonth,I=T.visibleDays;return i.default.createElement(D.default,{orientation:n,enableOutsideDays:d,modifiers:I,numberOfMonths:t,onDayClick:this.onDayClick,onDayMouseEnter:this.onDayMouseEnter,onDayMouseLeave:this.onDayMouseLeave,onPrevMonthClick:this.onPrevMonthClick,onNextMonthClick:this.onNextMonthClick,onMonthChange:this.onMonthChange,onYearChange:this.onYearChange,monthFormat:r,withPortal:l,hidden:!u,hideKeyboardShortcutsPanel:f,initialVisibleMonth:function(){return N},firstDayOfWeek:h,onOutsideClick:c,navPrev:a,navNext:s,renderMonthText:o,renderCalendarDay:m,renderDayContents:b,renderCalendarInfo:g,renderMonthElement:y,calendarInfoPosition:v,isFocused:_,getFirstFocusableDay:this.getFirstFocusableDay,onBlur:S,phrases:w,daySize:p,isRTL:O,showKeyboardShortcuts:C,weekDayFormat:E,dayAriaLabelFormat:k,verticalHeight:j,noBorder:F,transitionDuration:P,verticalBorderSpacing:M,horizontalMonthPadding:x})}}]),t}(i.default.Component);t.default=P,P.propTypes=j,P.defaultProps=F},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=h(n(1)),o=h(n(58)),a=n(31),i=n(37),s=h(n(40)),c=h(n(96)),l=h(n(214)),u=h(n(215)),d=h(n(86)),f=h(n(75)),p=h(n(97));function h(e){return e&&e.__esModule?e:{default:e}}t.default={date:o.default.momentObj,onDateChange:r.default.func.isRequired,focused:r.default.bool,onFocusChange:r.default.func.isRequired,id:r.default.string.isRequired,placeholder:r.default.string,disabled:r.default.bool,required:r.default.bool,readOnly:r.default.bool,screenReaderInputMessage:r.default.string,showClearDate:r.default.bool,customCloseIcon:r.default.node,showDefaultInputIcon:r.default.bool,inputIconPosition:c.default,customInputIcon:r.default.node,noBorder:r.default.bool,block:r.default.bool,small:r.default.bool,regular:r.default.bool,verticalSpacing:a.nonNegativeInteger,keepFocusOnInput:r.default.bool,renderMonthText:(0,a.mutuallyExclusiveProps)(r.default.func,"renderMonthText","renderMonthElement"),renderMonthElement:(0,a.mutuallyExclusiveProps)(r.default.func,"renderMonthText","renderMonthElement"),orientation:l.default,anchorDirection:u.default,openDirection:d.default,horizontalMargin:r.default.number,withPortal:r.default.bool,withFullScreenPortal:r.default.bool,appendToBody:r.default.bool,disableScroll:r.default.bool,initialVisibleMonth:r.default.func,firstDayOfWeek:f.default,numberOfMonths:r.default.number,keepOpenOnDateSelect:r.default.bool,reopenPickerOnClearDate:r.default.bool,renderCalendarInfo:r.default.func,calendarInfoPosition:p.default,hideKeyboardShortcutsPanel:r.default.bool,daySize:a.nonNegativeInteger,isRTL:r.default.bool,verticalHeight:a.nonNegativeInteger,transitionDuration:a.nonNegativeInteger,horizontalMonthPadding:a.nonNegativeInteger,navPrev:r.default.node,navNext:r.default.node,onPrevMonthClick:r.default.func,onNextMonthClick:r.default.func,onClose:r.default.func,renderCalendarDay:r.default.func,renderDayContents:r.default.func,enableOutsideDays:r.default.bool,isDayBlocked:r.default.func,isOutsideRange:r.default.func,isDayHighlighted:r.default.func,displayFormat:r.default.oneOfType([r.default.string,r.default.func]),monthFormat:r.default.string,weekDayFormat:r.default.string,phrases:r.default.shape((0,s.default)(i.SingleDatePickerPhrases)),dayAriaLabelFormat:r.default.string}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},o=g(n(36)),a=g(n(5)),i=g(n(1)),s=n(31),c=n(42),l=n(37),u=g(n(40)),d=g(n(221)),f=g(n(96)),p=g(n(100)),h=g(n(227)),m=g(n(86)),b=n(24);function g(e){return e&&e.__esModule?e:{default:e}}var y=(0,s.forbidExtraProps)((0,o.default)({},c.withStylesPropTypes,{id:i.default.string.isRequired,placeholder:i.default.string,displayValue:i.default.string,screenReaderMessage:i.default.string,focused:i.default.bool,isFocused:i.default.bool,disabled:i.default.bool,required:i.default.bool,readOnly:i.default.bool,openDirection:m.default,showCaret:i.default.bool,showClearDate:i.default.bool,customCloseIcon:i.default.node,showDefaultInputIcon:i.default.bool,inputIconPosition:f.default,customInputIcon:i.default.node,isRTL:i.default.bool,noBorder:i.default.bool,block:i.default.bool,small:i.default.bool,regular:i.default.bool,verticalSpacing:s.nonNegativeInteger,onChange:i.default.func,onClearDate:i.default.func,onFocus:i.default.func,onKeyDownShiftTab:i.default.func,onKeyDownTab:i.default.func,onKeyDownArrowDown:i.default.func,onKeyDownQuestionMark:i.default.func,phrases:i.default.shape((0,u.default)(l.SingleDatePickerInputPhrases))})),v={placeholder:"Select Date",displayValue:"",screenReaderMessage:"",focused:!1,isFocused:!1,disabled:!1,required:!1,readOnly:!1,openDirection:b.OPEN_DOWN,showCaret:!1,showClearDate:!1,showDefaultInputIcon:!1,inputIconPosition:b.ICON_BEFORE_POSITION,customCloseIcon:null,customInputIcon:null,isRTL:!1,noBorder:!1,block:!1,small:!1,regular:!1,verticalSpacing:void 0,onChange:function(){},onClearDate:function(){},onFocus:function(){},onKeyDownShiftTab:function(){},onKeyDownTab:function(){},onKeyDownArrowDown:function(){},onKeyDownQuestionMark:function(){},phrases:l.SingleDatePickerInputPhrases};function _(e){var t=e.id,n=e.placeholder,o=e.displayValue,i=e.focused,s=e.isFocused,l=e.disabled,u=e.required,f=e.readOnly,m=e.showCaret,g=e.showClearDate,y=e.showDefaultInputIcon,v=e.inputIconPosition,_=e.phrases,O=e.onClearDate,w=e.onChange,k=e.onFocus,S=e.onKeyDownShiftTab,D=e.onKeyDownTab,C=e.onKeyDownArrowDown,E=e.onKeyDownQuestionMark,j=e.screenReaderMessage,F=e.customCloseIcon,P=e.customInputIcon,M=e.openDirection,x=e.isRTL,T=e.noBorder,N=e.block,I=e.small,R=e.regular,A=e.verticalSpacing,L=e.styles,U=P||a.default.createElement(h.default,(0,c.css)(L.SingleDatePickerInput_calendarIcon_svg)),B=F||a.default.createElement(p.default,(0,c.css)(L.SingleDatePickerInput_clearDate_svg,I&&L.SingleDatePickerInput_clearDate_svg__small)),H=j||_.keyboardNavigationInstructions,K=(y||null!==P)&&a.default.createElement("button",r({},(0,c.css)(L.SingleDatePickerInput_calendarIcon),{type:"button",disabled:l,"aria-label":_.focusStartDate,onClick:k}),U);return a.default.createElement("div",(0,c.css)(L.SingleDatePickerInput,l&&L.SingleDatePickerInput__disabled,x&&L.SingleDatePickerInput__rtl,!T&&L.SingleDatePickerInput__withBorder,N&&L.SingleDatePickerInput__block,g&&L.SingleDatePickerInput__showClearDate),v===b.ICON_BEFORE_POSITION&&K,a.default.createElement(d.default,{id:t,placeholder:n,displayValue:o,screenReaderMessage:H,focused:i,isFocused:s,disabled:l,required:u,readOnly:f,showCaret:m,onChange:w,onFocus:k,onKeyDownShiftTab:S,onKeyDownTab:D,onKeyDownArrowDown:C,onKeyDownQuestionMark:E,openDirection:M,verticalSpacing:A,small:I,regular:R,block:N}),g&&a.default.createElement("button",r({},(0,c.css)(L.SingleDatePickerInput_clearDate,I&&L.SingleDatePickerInput_clearDate__small,!F&&L.SingleDatePickerInput_clearDate__default,!o&&L.SingleDatePickerInput_clearDate__hide),{type:"button","aria-label":_.clearDate,disabled:l,onMouseEnter:this&&this.onClearDateMouseEnter,onMouseLeave:this&&this.onClearDateMouseLeave,onClick:O}),B),v===b.ICON_AFTER_POSITION&&K)}_.propTypes=y,_.defaultProps=v,t.default=(0,c.withStyles)((function(e){var t=e.reactDates,n=t.border,r=t.color;return{SingleDatePickerInput:{display:"inline-block",backgroundColor:r.background},SingleDatePickerInput__withBorder:{borderColor:r.border,borderWidth:n.pickerInput.borderWidth,borderStyle:n.pickerInput.borderStyle,borderRadius:n.pickerInput.borderRadius},SingleDatePickerInput__rtl:{direction:"rtl"},SingleDatePickerInput__disabled:{backgroundColor:r.disabled},SingleDatePickerInput__block:{display:"block"},SingleDatePickerInput__showClearDate:{paddingRight:30},SingleDatePickerInput_clearDate:{background:"none",border:0,color:"inherit",font:"inherit",lineHeight:"normal",overflow:"visible",cursor:"pointer",padding:10,margin:"0 10px 0 5px",position:"absolute",right:0,top:"50%",transform:"translateY(-50%)"},SingleDatePickerInput_clearDate__default:{":focus":{background:r.core.border,borderRadius:"50%"},":hover":{background:r.core.border,borderRadius:"50%"}},SingleDatePickerInput_clearDate__small:{padding:6},SingleDatePickerInput_clearDate__hide:{visibility:"hidden"},SingleDatePickerInput_clearDate_svg:{fill:r.core.grayLight,height:12,width:15,verticalAlign:"middle"},SingleDatePickerInput_clearDate_svg__small:{height:9},SingleDatePickerInput_calendarIcon:{background:"none",border:0,color:"inherit",font:"inherit",lineHeight:"normal",overflow:"visible",cursor:"pointer",display:"inline-block",verticalAlign:"middle",padding:10,margin:"0 5px 0 10px"},SingleDatePickerInput_calendarIcon_svg:{fill:r.core.grayLight,height:15,width:14,verticalAlign:"middle"}}}))(_)},function(e,t,n){"use strict";var r=n(398),o=n(411),a=n(114),i=n(246),s=n(245),c=n(435);e.exports=function(){var e=c(this),t=s(a(e,"length")),n=1;arguments.length>0&&void 0!==arguments[0]&&(n=i(arguments[0]));var l=r(e,0);return o(l,e,t,0,n),l}},function(e,t,n){"use strict";var r=n(26)("%Object.defineProperty%",!0);if(r)try{r({},"a",{value:1})}catch(e){r=null}var o=n(64)("Object.prototype.propertyIsEnumerable");e.exports=function(e,t,n,a,i,s){if(!r){if(!e(s))return!1;if(!s["[[Configurable]]"]||!s["[[Writable]]"])return!1;if(i in a&&o(a,i)!==!!s["[[Enumerable]]"])return!1;var c=s["[[Value]]"];return a[i]=c,t(a[i],c)}return r(a,i,n(s)),!0}},function(e,t,n){"use strict";var r=n(156),o=n(45);e.exports=function(e){if(void 0===e)return e;r(o,"Property Descriptor","Desc",e);var t={};return"[[Value]]"in e&&(t.value=e["[[Value]]"]),"[[Writable]]"in e&&(t.writable=e["[[Writable]]"]),"[[Get]]"in e&&(t.get=e["[[Get]]"]),"[[Set]]"in e&&(t.set=e["[[Set]]"]),"[[Enumerable]]"in e&&(t.enumerable=e["[[Enumerable]]"]),"[[Configurable]]"in e&&(t.configurable=e["[[Configurable]]"]),t}},function(e,t,n){"use strict";var r=n(74),o=n(156),a=n(45);e.exports=function(e){return void 0!==e&&(o(a,"Property Descriptor","Desc",e),!(!r(e,"[[Value]]")&&!r(e,"[[Writable]]")))}},function(e,t,n){"use strict";var r=n(157);e.exports=function(e,t){return e===t?0!==e||1/e==1/t:r(e)&&r(t)}},function(e,t,n){"use strict";var r=n(74),o=n(26)("%TypeError%"),a=n(45),i=n(240),s=n(407);e.exports=function(e){if("Object"!==a(e))throw new o("ToPropertyDescriptor requires an object");var t={};if(r(e,"enumerable")&&(t["[[Enumerable]]"]=i(e.enumerable)),r(e,"configurable")&&(t["[[Configurable]]"]=i(e.configurable)),r(e,"value")&&(t["[[Value]]"]=e.value),r(e,"writable")&&(t["[[Writable]]"]=i(e.writable)),r(e,"get")){var n=e.get;if(void 0!==n&&!s(n))throw new o("getter must be a function");t["[[Get]]"]=n}if(r(e,"set")){var c=e.set;if(void 0!==c&&!s(c))throw new o("setter must be a function");t["[[Set]]"]=c}if((r(t,"[[Get]]")||r(t,"[[Set]]"))&&(r(t,"[[Value]]")||r(t,"[[Writable]]")))throw new o("Invalid property descriptor. Cannot both specify accessors and a value or writable attribute");return t}},function(e,t,n){"use strict";e.exports=function(e){return!!e}},function(e,t,n){"use strict";var r=Number.isNaN||function(e){return e!=e};e.exports=Number.isFinite||function(e){return"number"==typeof e&&!r(e)&&e!==1/0&&e!==-1/0}},function(e,t,n){"use strict";var r=n(26),o=r("%Math%"),a=r("%Number%");e.exports=a.MAX_SAFE_INTEGER||o.pow(2,53)-1},function(e,t,n){"use strict";var r=n(148);e.exports=function(){return r()&&!!Symbol.toStringTag}},function(e,t,n){"use strict";e.exports=function(e){return null===e||"function"!=typeof e&&"object"!=typeof e}},function(e,t,n){"use strict";var r=n(242),o=n(246);e.exports=function(e){var t=o(e);return t<=0?0:t>r?r:t}},function(e,t,n){"use strict";var r=n(422),o=n(429);e.exports=function(e){var t=o(e);return 0!==t&&(t=r(t)),0===t?0:t}},function(e,t,n){"use strict";e.exports=function(e){return null===e||"function"!=typeof e&&"object"!=typeof e}},function(e,t,n){"use strict";var r=Object.prototype.toString;if(n(196)()){var o=Symbol.prototype.toString,a=/^Symbol\(.*\)$/;e.exports=function(e){if("symbol"==typeof e)return!0;if("[object Symbol]"!==r.call(e))return!1;try{return function(e){return"symbol"==typeof e.valueOf()&&a.test(o.call(e))}(e)}catch(e){return!1}}}else e.exports=function(e){return!1}},function(e,t,n){"use strict";var r=n(234);e.exports=function(){return Array.prototype.flat||r}},,,function(e,t,n){"use strict";n.r(t),n.d(t,"Portal",(function(){return _})),n.d(t,"PortalWithState",(function(){return S}));var r=n(29),o=n.n(r),a=n(5),i=n.n(a),s=n(1),c=n.n(s),l=!("undefined"==typeof window||!window.document||!window.document.createElement),u=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();function d(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function f(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}var p=function(e){function t(){return d(this,t),f(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),u(t,[{key:"componentWillUnmount",value:function(){this.defaultNode&&document.body.removeChild(this.defaultNode),this.defaultNode=null}},{key:"render",value:function(){return l?(this.props.node||this.defaultNode||(this.defaultNode=document.createElement("div"),document.body.appendChild(this.defaultNode)),o.a.createPortal(this.props.children,this.props.node||this.defaultNode)):null}}]),t}(i.a.Component);p.propTypes={children:c.a.node.isRequired,node:c.a.any};var h=p,m=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();function b(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function g(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}var y=function(e){function t(){return b(this,t),g(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),m(t,[{key:"componentDidMount",value:function(){this.renderPortal()}},{key:"componentDidUpdate",value:function(e){this.renderPortal()}},{key:"componentWillUnmount",value:function(){o.a.unmountComponentAtNode(this.defaultNode||this.props.node),this.defaultNode&&document.body.removeChild(this.defaultNode),this.defaultNode=null,this.portal=null}},{key:"renderPortal",value:function(e){this.props.node||this.defaultNode||(this.defaultNode=document.createElement("div"),document.body.appendChild(this.defaultNode));var t=this.props.children;"function"==typeof this.props.children.type&&(t=i.a.cloneElement(this.props.children)),this.portal=o.a.unstable_renderSubtreeIntoContainer(this,t,this.props.node||this.defaultNode)}},{key:"render",value:function(){return null}}]),t}(i.a.Component),v=y;y.propTypes={children:c.a.node.isRequired,node:c.a.any};var _=o.a.createPortal?h:v,O=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();var w=27,k=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.portalNode=null,n.state={active:!!e.defaultOpen},n.openPortal=n.openPortal.bind(n),n.closePortal=n.closePortal.bind(n),n.wrapWithPortal=n.wrapWithPortal.bind(n),n.handleOutsideMouseClick=n.handleOutsideMouseClick.bind(n),n.handleKeydown=n.handleKeydown.bind(n),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),O(t,[{key:"componentDidMount",value:function(){this.props.closeOnEsc&&document.addEventListener("keydown",this.handleKeydown),this.props.closeOnOutsideClick&&document.addEventListener("click",this.handleOutsideMouseClick)}},{key:"componentWillUnmount",value:function(){this.props.closeOnEsc&&document.removeEventListener("keydown",this.handleKeydown),this.props.closeOnOutsideClick&&document.removeEventListener("click",this.handleOutsideMouseClick)}},{key:"openPortal",value:function(e){this.state.active||(e&&e.nativeEvent&&e.nativeEvent.stopImmediatePropagation(),this.setState({active:!0},this.props.onOpen))}},{key:"closePortal",value:function(){this.state.active&&this.setState({active:!1},this.props.onClose)}},{key:"wrapWithPortal",value:function(e){var t=this;return this.state.active?i.a.createElement(_,{node:this.props.node,key:"react-portal",ref:function(e){return t.portalNode=e}},e):null}},{key:"handleOutsideMouseClick",value:function(e){if(this.state.active){var t=this.portalNode&&(this.portalNode.props.node||this.portalNode.defaultNode);!t||t.contains(e.target)||e.button&&0!==e.button||this.closePortal()}}},{key:"handleKeydown",value:function(e){e.keyCode===w&&this.state.active&&this.closePortal()}},{key:"render",value:function(){return this.props.children({openPortal:this.openPortal,closePortal:this.closePortal,portal:this.wrapWithPortal,isOpen:this.state.active})}}]),t}(i.a.Component);k.propTypes={children:c.a.func.isRequired,defaultOpen:c.a.bool,node:c.a.any,closeOnEsc:c.a.bool,closeOnOutsideClick:c.a.bool,onOpen:c.a.func,onClose:c.a.func},k.defaultProps={onOpen:function(){},onClose:function(){}};var S=k},,,,,,,,function(e,t,n){"use strict";var r=Object.assign||function(e){for(var t,n=1;n<arguments.length;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e};Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n=e.size,o=void 0===n?24:n,a=e.onClick,s=(e.icon,e.className),c=function(e,t){var n={};for(var r in e)0<=t.indexOf(r)||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}(e,["size","onClick","icon","className"]),l=["gridicon","gridicons-add-outline",s,(t=o,!(0!=t%18)&&"needs-offset"),!1,!1].filter(Boolean).join(" ");return i.default.createElement("svg",r({className:l,height:o,width:o,onClick:a},c,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"}),i.default.createElement("g",null,i.default.createElement("path",{d:"M12 4c4.41 0 8 3.59 8 8s-3.59 8-8 8-8-3.59-8-8 3.59-8 8-8m0-2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2zm5 9h-4V7h-2v4H7v2h4v4h2v-4h4v-2z"})))};var o,a=n(5),i=(o=a)&&o.__esModule?o:{default:o};e.exports=t.default},function(e,t,n){"use strict";var r=n(336),o=n(337),a={countryCode:function(e){if(!e)throw new Error("Expected 1 country code as the first argument");return o(r,(function(t){return t.code===e.toUpperCase()}))},get data(){return r}};["emoji","code","name","unicode"].forEach((function(e){Object.defineProperty(a,e+"s",{get:function(){return r.map((function(t){return t[e]}))}})})),r.forEach((function(e,t){a[e.code]=r[t]})),e.exports=a},function(e,t,n){e.exports=n(348)},function(e,t,n){"use strict";var r=Object.assign||function(e){for(var t,n=1;n<arguments.length;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e};Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t=e.size,n=void 0===t?24:t,o=e.onClick,a=(e.icon,e.className),s=function(e,t){var n={};for(var r in e)0<=t.indexOf(r)||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}(e,["size","onClick","icon","className"]),c=["gridicon","gridicons-ellipsis",a,!1,!1,!1].filter(Boolean).join(" ");return i.default.createElement("svg",r({className:c,height:n,width:n,onClick:o},s,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"}),i.default.createElement("g",null,i.default.createElement("path",{d:"M7 12c0 1.104-.896 2-2 2s-2-.896-2-2 .896-2 2-2 2 .896 2 2zm12-2c-1.104 0-2 .896-2 2s.896 2 2 2 2-.896 2-2-.896-2-2-2zm-7 0c-1.104 0-2 .896-2 2s.896 2 2 2 2-.896 2-2-.896-2-2-2z"})))};var o,a=n(5),i=(o=a)&&o.__esModule?o:{default:o};e.exports=t.default},,,,,,,,,,,,,,function(e,t,n){"use strict";var r=n(0),o=n(8),a=Object(r.createElement)(o.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},Object(r.createElement)(o.Path,{d:"M6.5 12.4L12 8l5.5 4.4-.9 1.2L12 10l-4.5 3.6-1-1.2z"}));t.a=a},function(e,t,n){"use strict";var r=n(0),o=n(8),a=Object(r.createElement)(o.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},Object(r.createElement)(o.Path,{d:"M17.5 11.6L12 16l-5.5-4.4.9-1.2L12 14l4.5-3.6 1 1.2z"}));t.a=a},,,,,,,,,,,,,function(e,t,n){"use strict";var r=n(0),o=n(8),a=Object(r.createElement)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(r.createElement)(o.Path,{d:"M14.6 7l-1.2-1L8 12l5.4 6 1.2-1-4.6-5z"}));t.a=a},,,,,,,,function(e,t,n){n(300);var r=n(141);e.exports=r.Object.assign},function(e,t,n){var r=n(130),o=n(308);r({target:"Object",stat:!0,forced:Object.assign!==o},{assign:o})},function(e,t,n){var r=n(44),o=n(181),a=r.WeakMap;e.exports="function"==typeof a&&/native code/.test(o(a))},function(e,t,n){var r=n(56),o=n(303),a=n(175),i=n(94);e.exports=function(e,t){for(var n=o(t),s=i.f,c=a.f,l=0;l<n.length;l++){var u=n[l];r(e,u)||s(e,u,c(t,u))}}},function(e,t,n){var r=n(140),o=n(304),a=n(187),i=n(73);e.exports=r("Reflect","ownKeys")||function(e){var t=o.f(i(e)),n=a.f;return n?t.concat(n(e)):t}},function(e,t,n){var r=n(185),o=n(143).concat("length","prototype");t.f=Object.getOwnPropertyNames||function(e){return r(e,o)}},function(e,t,n){var r=n(131),o=n(186),a=n(306),i=function(e){return function(t,n,i){var s,c=r(t),l=o(c.length),u=a(i,l);if(e&&n!=n){for(;l>u;)if((s=c[u++])!=s)return!0}else for(;l>u;u++)if((e||u in c)&&c[u]===n)return e||u||0;return!e&&-1}};e.exports={includes:i(!0),indexOf:i(!1)}},function(e,t,n){var r=n(142),o=Math.max,a=Math.min;e.exports=function(e,t){var n=r(e);return n<0?o(n+t,0):a(n,t)}},function(e,t,n){var r=n(62),o=/#|\.prototype\./,a=function(e,t){var n=s[i(e)];return n==l||n!=c&&("function"==typeof t?r(t):!!t)},i=a.normalize=function(e){return String(e).replace(o,".").toLowerCase()},s=a.data={},c=a.NATIVE="N",l=a.POLYFILL="P";e.exports=a},function(e,t,n){"use strict";var r=n(79),o=n(62),a=n(188),i=n(187),s=n(176),c=n(144),l=n(177),u=Object.assign,d=Object.defineProperty;e.exports=!u||o((function(){if(r&&1!==u({b:1},u(d({},"a",{enumerable:!0,get:function(){d(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var e={},t={},n=Symbol();return e[n]=7,"abcdefghijklmnopqrst".split("").forEach((function(e){t[e]=e})),7!=u({},e)[n]||"abcdefghijklmnopqrst"!=a(u({},t)).join("")}))?function(e,t){for(var n=c(e),o=arguments.length,u=1,d=i.f,f=s.f;o>u;)for(var p,h=l(arguments[u++]),m=d?a(h).concat(d(h)):a(h),b=m.length,g=0;b>g;)p=m[g++],r&&!f.call(h,p)||(n[p]=h[p]);return n}:u},function(e,t,n){n(310),n(324);var r=n(141);e.exports=r.Array.from},function(e,t,n){"use strict";var r=n(311).charAt,o=n(182),a=n(312),i=o.set,s=o.getterFor("String Iterator");a(String,"String",(function(e){i(this,{type:"String Iterator",string:String(e),index:0})}),(function(){var e,t=s(this),n=t.string,o=t.index;return o>=n.length?{value:void 0,done:!0}:(e=r(n,o),t.index+=e.length,{value:e,done:!1})}))},function(e,t,n){var r=n(142),o=n(133),a=function(e){return function(t,n){var a,i,s=String(o(t)),c=r(n),l=s.length;return c<0||c>=l?e?"":void 0:(a=s.charCodeAt(c))<55296||a>56319||c+1===l||(i=s.charCodeAt(c+1))<56320||i>57343?e?s.charAt(c):a:e?s.slice(c,c+2):i-56320+(a-55296<<10)+65536}};e.exports={codeAt:a(!1),charAt:a(!0)}},function(e,t,n){"use strict";var r=n(130),o=n(313),a=n(191),i=n(322),s=n(193),c=n(80),l=n(180),u=n(63),d=n(138),f=n(106),p=n(190),h=p.IteratorPrototype,m=p.BUGGY_SAFARI_ITERATORS,b=u("iterator"),g=function(){return this};e.exports=function(e,t,n,u,p,y,v){o(n,t,u);var _,O,w,k=function(e){if(e===p&&j)return j;if(!m&&e in C)return C[e];switch(e){case"keys":case"values":case"entries":return function(){return new n(this,e)}}return function(){return new n(this)}},S=t+" Iterator",D=!1,C=e.prototype,E=C[b]||C["@@iterator"]||p&&C[p],j=!m&&E||k(p),F="Array"==t&&C.entries||E;if(F&&(_=a(F.call(new e)),h!==Object.prototype&&_.next&&(d||a(_)===h||(i?i(_,h):"function"!=typeof _[b]&&c(_,b,g)),s(_,S,!0,!0),d&&(f[S]=g))),"values"==p&&E&&"values"!==E.name&&(D=!0,j=function(){return E.call(this)}),d&&!v||C[b]===j||c(C,b,j),f[t]=j,p)if(O={values:k("values"),keys:y?j:k("keys"),entries:k("entries")},v)for(w in O)(m||D||!(w in C))&&l(C,w,O[w]);else r({target:t,proto:!0,forced:m||D},O);return O}},function(e,t,n){"use strict";var r=n(190).IteratorPrototype,o=n(319),a=n(105),i=n(193),s=n(106),c=function(){return this};e.exports=function(e,t,n){var l=t+" Iterator";return e.prototype=o(r,{next:a(1,n)}),i(e,l,!1,!0),s[l]=c,e}},function(e,t,n){var r=n(62);e.exports=!r((function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype}))},function(e,t,n){var r=n(132),o=n(44);e.exports="process"==r(o.process)},function(e,t,n){var r,o,a=n(44),i=n(317),s=a.process,c=s&&s.versions,l=c&&c.v8;l?o=(r=l.split("."))[0]+r[1]:i&&(!(r=i.match(/Edge\/(\d+)/))||r[1]>=74)&&(r=i.match(/Chrome\/(\d+)/))&&(o=r[1]),e.exports=o&&+o},function(e,t,n){var r=n(140);e.exports=r("navigator","userAgent")||""},function(e,t,n){var r=n(192);e.exports=r&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},function(e,t,n){var r,o=n(73),a=n(320),i=n(143),s=n(139),c=n(321),l=n(179),u=n(137),d=u("IE_PROTO"),f=function(){},p=function(e){return"<script>"+e+"<\/script>"},h=function(){try{r=document.domain&&new ActiveXObject("htmlfile")}catch(e){}var e,t;h=r?function(e){e.write(p("")),e.close();var t=e.parentWindow.Object;return e=null,t}(r):((t=l("iframe")).style.display="none",c.appendChild(t),t.src=String("javascript:"),(e=t.contentWindow.document).open(),e.write(p("document.F=Object")),e.close(),e.F);for(var n=i.length;n--;)delete h.prototype[i[n]];return h()};s[d]=!0,e.exports=Object.create||function(e,t){var n;return null!==e?(f.prototype=o(e),n=new f,f.prototype=null,n[d]=e):n=h(),void 0===t?n:a(n,t)}},function(e,t,n){var r=n(79),o=n(94),a=n(73),i=n(188);e.exports=r?Object.defineProperties:function(e,t){a(e);for(var n,r=i(t),s=r.length,c=0;s>c;)o.f(e,n=r[c++],t[n]);return e}},function(e,t,n){var r=n(140);e.exports=r("document","documentElement")},function(e,t,n){var r=n(73),o=n(323);e.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,n={};try{(e=Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set).call(n,[]),t=n instanceof Array}catch(e){}return function(n,a){return r(n),o(a),t?e.call(n,a):n.__proto__=a,n}}():void 0)},function(e,t,n){var r=n(93);e.exports=function(e){if(!r(e)&&null!==e)throw TypeError("Can't set "+String(e)+" as a prototype");return e}},function(e,t,n){var r=n(130),o=n(325);r({target:"Array",stat:!0,forced:!n(335)((function(e){Array.from(e)}))},{from:o})},function(e,t,n){"use strict";var r=n(326),o=n(144),a=n(328),i=n(330),s=n(186),c=n(331),l=n(332);e.exports=function(e){var t,n,u,d,f,p,h=o(e),m="function"==typeof this?this:Array,b=arguments.length,g=b>1?arguments[1]:void 0,y=void 0!==g,v=l(h),_=0;if(y&&(g=r(g,b>2?arguments[2]:void 0,2)),null==v||m==Array&&i(v))for(n=new m(t=s(h.length));t>_;_++)p=y?g(h[_],_):h[_],c(n,_,p);else for(f=(d=v.call(h)).next,n=new m;!(u=f.call(d)).done;_++)p=y?a(d,g,[u.value,_],!0):u.value,c(n,_,p);return n.length=_,n}},function(e,t,n){var r=n(327);e.exports=function(e,t,n){if(r(e),void 0===t)return e;switch(n){case 0:return function(){return e.call(t)};case 1:return function(n){return e.call(t,n)};case 2:return function(n,r){return e.call(t,n,r)};case 3:return function(n,r,o){return e.call(t,n,r,o)}}return function(){return e.apply(t,arguments)}}},function(e,t){e.exports=function(e){if("function"!=typeof e)throw TypeError(String(e)+" is not a function");return e}},function(e,t,n){var r=n(73),o=n(329);e.exports=function(e,t,n,a){try{return a?t(r(n)[0],n[1]):t(n)}catch(t){throw o(e),t}}},function(e,t,n){var r=n(73);e.exports=function(e){var t=e.return;if(void 0!==t)return r(t.call(e)).value}},function(e,t,n){var r=n(63),o=n(106),a=r("iterator"),i=Array.prototype;e.exports=function(e){return void 0!==e&&(o.Array===e||i[a]===e)}},function(e,t,n){"use strict";var r=n(134),o=n(94),a=n(105);e.exports=function(e,t,n){var i=r(t);i in e?o.f(e,i,a(0,n)):e[i]=n}},function(e,t,n){var r=n(333),o=n(106),a=n(63)("iterator");e.exports=function(e){if(null!=e)return e[a]||e["@@iterator"]||o[r(e)]}},function(e,t,n){var r=n(334),o=n(132),a=n(63)("toStringTag"),i="Arguments"==o(function(){return arguments}());e.exports=r?o:function(e){var t,n,r;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(n=function(e,t){try{return e[t]}catch(e){}}(t=Object(e),a))?n:i?o(t):"Object"==(r=o(t))&&"function"==typeof t.callee?"Arguments":r}},function(e,t,n){var r={};r[n(63)("toStringTag")]="z",e.exports="[object z]"===String(r)},function(e,t,n){var r=n(63)("iterator"),o=!1;try{var a=0,i={next:function(){return{done:!!a++}},return:function(){o=!0}};i[r]=function(){return this},Array.from(i,(function(){throw 2}))}catch(e){}e.exports=function(e,t){if(!t&&!o)return!1;var n=!1;try{var a={};a[r]=function(){return{next:function(){return{done:n=!0}}}},e(a)}catch(e){}return n}},function(e){e.exports=JSON.parse('[{"code":"AD","emoji":"🇦🇩","unicode":"U+1F1E6 U+1F1E9","name":"Andorra","title":"flag for Andorra","dialCode":"+376"},{"code":"AE","emoji":"🇦🇪","unicode":"U+1F1E6 U+1F1EA","name":"United Arab Emirates","title":"flag for United Arab Emirates","dialCode":"+971"},{"code":"AF","emoji":"🇦🇫","unicode":"U+1F1E6 U+1F1EB","name":"Afghanistan","title":"flag for Afghanistan","dialCode":"+93"},{"code":"AG","emoji":"🇦🇬","unicode":"U+1F1E6 U+1F1EC","name":"Antigua and Barbuda","title":"flag for Antigua and Barbuda","dialCode":"+1268"},{"code":"AI","emoji":"🇦🇮","unicode":"U+1F1E6 U+1F1EE","name":"Anguilla","title":"flag for Anguilla","dialCode":"+1 264"},{"code":"AL","emoji":"🇦🇱","unicode":"U+1F1E6 U+1F1F1","name":"Albania","title":"flag for Albania","dialCode":"+355"},{"code":"AM","emoji":"🇦🇲","unicode":"U+1F1E6 U+1F1F2","name":"Armenia","title":"flag for Armenia","dialCode":"+374"},{"code":"AO","emoji":"🇦🇴","unicode":"U+1F1E6 U+1F1F4","name":"Angola","title":"flag for Angola","dialCode":"+244"},{"code":"AQ","emoji":"🇦🇶","unicode":"U+1F1E6 U+1F1F6","name":"Antarctica","title":"flag for Antarctica","dialCode":null},{"code":"AR","emoji":"🇦🇷","unicode":"U+1F1E6 U+1F1F7","name":"Argentina","title":"flag for Argentina","dialCode":"+54"},{"code":"AS","emoji":"🇦🇸","unicode":"U+1F1E6 U+1F1F8","name":"American Samoa","title":"flag for American Samoa","dialCode":"+1 684"},{"code":"AT","emoji":"🇦🇹","unicode":"U+1F1E6 U+1F1F9","name":"Austria","title":"flag for Austria","dialCode":"+43"},{"code":"AU","emoji":"🇦🇺","unicode":"U+1F1E6 U+1F1FA","name":"Australia","title":"flag for Australia","dialCode":"+61"},{"code":"AW","emoji":"🇦🇼","unicode":"U+1F1E6 U+1F1FC","name":"Aruba","title":"flag for Aruba","dialCode":"+297"},{"code":"AX","emoji":"🇦🇽","unicode":"U+1F1E6 U+1F1FD","name":"Åland Islands","title":"flag for Åland Islands","dialCode":""},{"code":"AZ","emoji":"🇦🇿","unicode":"U+1F1E6 U+1F1FF","name":"Azerbaijan","title":"flag for Azerbaijan","dialCode":"+994"},{"code":"BA","emoji":"🇧🇦","unicode":"U+1F1E7 U+1F1E6","name":"Bosnia and Herzegovina","title":"flag for Bosnia and Herzegovina","dialCode":"+387"},{"code":"BB","emoji":"🇧🇧","unicode":"U+1F1E7 U+1F1E7","name":"Barbados","title":"flag for Barbados","dialCode":"+1 246"},{"code":"BD","emoji":"🇧🇩","unicode":"U+1F1E7 U+1F1E9","name":"Bangladesh","title":"flag for Bangladesh","dialCode":"+880"},{"code":"BE","emoji":"🇧🇪","unicode":"U+1F1E7 U+1F1EA","name":"Belgium","title":"flag for Belgium","dialCode":"+32"},{"code":"BF","emoji":"🇧🇫","unicode":"U+1F1E7 U+1F1EB","name":"Burkina Faso","title":"flag for Burkina Faso","dialCode":"+226"},{"code":"BG","emoji":"🇧🇬","unicode":"U+1F1E7 U+1F1EC","name":"Bulgaria","title":"flag for Bulgaria","dialCode":"+359"},{"code":"BH","emoji":"🇧🇭","unicode":"U+1F1E7 U+1F1ED","name":"Bahrain","title":"flag for Bahrain","dialCode":"+973"},{"code":"BI","emoji":"🇧🇮","unicode":"U+1F1E7 U+1F1EE","name":"Burundi","title":"flag for Burundi","dialCode":"+257"},{"code":"BJ","emoji":"🇧🇯","unicode":"U+1F1E7 U+1F1EF","name":"Benin","title":"flag for Benin","dialCode":"+229"},{"code":"BL","emoji":"🇧🇱","unicode":"U+1F1E7 U+1F1F1","name":"Saint Barthélemy","title":"flag for Saint Barthélemy","dialCode":"+590"},{"code":"BM","emoji":"🇧🇲","unicode":"U+1F1E7 U+1F1F2","name":"Bermuda","title":"flag for Bermuda","dialCode":"+1 441"},{"code":"BN","emoji":"🇧🇳","unicode":"U+1F1E7 U+1F1F3","name":"Brunei Darussalam","title":"flag for Brunei Darussalam","dialCode":"+673"},{"code":"BO","emoji":"🇧🇴","unicode":"U+1F1E7 U+1F1F4","name":"Bolivia","title":"flag for Bolivia","dialCode":"+591"},{"code":"BQ","emoji":"🇧🇶","unicode":"U+1F1E7 U+1F1F6","name":"Bonaire, Sint Eustatius and Saba","title":"flag for Bonaire, Sint Eustatius and Saba"},{"code":"BR","emoji":"🇧🇷","unicode":"U+1F1E7 U+1F1F7","name":"Brazil","title":"flag for Brazil","dialCode":"+55"},{"code":"BS","emoji":"🇧🇸","unicode":"U+1F1E7 U+1F1F8","name":"Bahamas","title":"flag for Bahamas","dialCode":"+1 242"},{"code":"BT","emoji":"🇧🇹","unicode":"U+1F1E7 U+1F1F9","name":"Bhutan","title":"flag for Bhutan","dialCode":"+975"},{"code":"BV","emoji":"🇧🇻","unicode":"U+1F1E7 U+1F1FB","name":"Bouvet Island","title":"flag for Bouvet Island"},{"code":"BW","emoji":"🇧🇼","unicode":"U+1F1E7 U+1F1FC","name":"Botswana","title":"flag for Botswana","dialCode":"+267"},{"code":"BY","emoji":"🇧🇾","unicode":"U+1F1E7 U+1F1FE","name":"Belarus","title":"flag for Belarus","dialCode":"+375"},{"code":"BZ","emoji":"🇧🇿","unicode":"U+1F1E7 U+1F1FF","name":"Belize","title":"flag for Belize","dialCode":"+501"},{"code":"CA","emoji":"🇨🇦","unicode":"U+1F1E8 U+1F1E6","name":"Canada","title":"flag for Canada","dialCode":"+1"},{"code":"CC","emoji":"🇨🇨","unicode":"U+1F1E8 U+1F1E8","name":"Cocos (Keeling) Islands","title":"flag for Cocos (Keeling) Islands","dialCode":"+61"},{"code":"CD","emoji":"🇨🇩","unicode":"U+1F1E8 U+1F1E9","name":"Congo","title":"flag for Congo","dialCode":"+243"},{"code":"CF","emoji":"🇨🇫","unicode":"U+1F1E8 U+1F1EB","name":"Central African Republic","title":"flag for Central African Republic","dialCode":"+236"},{"code":"CG","emoji":"🇨🇬","unicode":"U+1F1E8 U+1F1EC","name":"Congo","title":"flag for Congo","dialCode":"+242"},{"code":"CH","emoji":"🇨🇭","unicode":"U+1F1E8 U+1F1ED","name":"Switzerland","title":"flag for Switzerland","dialCode":"+41"},{"code":"CI","emoji":"🇨🇮","unicode":"U+1F1E8 U+1F1EE","name":"Côte D\'Ivoire","title":"flag for Côte D\'Ivoire","dialCode":"+225"},{"code":"CK","emoji":"🇨🇰","unicode":"U+1F1E8 U+1F1F0","name":"Cook Islands","title":"flag for Cook Islands","dialCode":"+682"},{"code":"CL","emoji":"🇨🇱","unicode":"U+1F1E8 U+1F1F1","name":"Chile","title":"flag for Chile","dialCode":"+56"},{"code":"CM","emoji":"🇨🇲","unicode":"U+1F1E8 U+1F1F2","name":"Cameroon","title":"flag for Cameroon","dialCode":"+237"},{"code":"CN","emoji":"🇨🇳","unicode":"U+1F1E8 U+1F1F3","name":"China","title":"flag for China","dialCode":"+86"},{"code":"CO","emoji":"🇨🇴","unicode":"U+1F1E8 U+1F1F4","name":"Colombia","title":"flag for Colombia","dialCode":"+57"},{"code":"CR","emoji":"🇨🇷","unicode":"U+1F1E8 U+1F1F7","name":"Costa Rica","title":"flag for Costa Rica","dialCode":"+506"},{"code":"CU","emoji":"🇨🇺","unicode":"U+1F1E8 U+1F1FA","name":"Cuba","title":"flag for Cuba","dialCode":"+53"},{"code":"CV","emoji":"🇨🇻","unicode":"U+1F1E8 U+1F1FB","name":"Cape Verde","title":"flag for Cape Verde","dialCode":"+238"},{"code":"CW","emoji":"🇨🇼","unicode":"U+1F1E8 U+1F1FC","name":"Curaçao","title":"flag for Curaçao"},{"code":"CX","emoji":"🇨🇽","unicode":"U+1F1E8 U+1F1FD","name":"Christmas Island","title":"flag for Christmas Island","dialCode":"+61"},{"code":"CY","emoji":"🇨🇾","unicode":"U+1F1E8 U+1F1FE","name":"Cyprus","title":"flag for Cyprus","dialCode":"+537"},{"code":"CZ","emoji":"🇨🇿","unicode":"U+1F1E8 U+1F1FF","name":"Czech Republic","title":"flag for Czech Republic","dialCode":"+420"},{"code":"DE","emoji":"🇩🇪","unicode":"U+1F1E9 U+1F1EA","name":"Germany","title":"flag for Germany","dialCode":"+49"},{"code":"DJ","emoji":"🇩🇯","unicode":"U+1F1E9 U+1F1EF","name":"Djibouti","title":"flag for Djibouti","dialCode":"+253"},{"code":"DK","emoji":"🇩🇰","unicode":"U+1F1E9 U+1F1F0","name":"Denmark","title":"flag for Denmark","dialCode":"+45"},{"code":"DM","emoji":"🇩🇲","unicode":"U+1F1E9 U+1F1F2","name":"Dominica","title":"flag for Dominica","dialCode":"+1 767"},{"code":"DO","emoji":"🇩🇴","unicode":"U+1F1E9 U+1F1F4","name":"Dominican Republic","title":"flag for Dominican Republic","dialCode":"+1 849"},{"code":"DZ","emoji":"🇩🇿","unicode":"U+1F1E9 U+1F1FF","name":"Algeria","title":"flag for Algeria","dialCode":"+213"},{"code":"EC","emoji":"🇪🇨","unicode":"U+1F1EA U+1F1E8","name":"Ecuador","title":"flag for Ecuador","dialCode":"+593"},{"code":"EE","emoji":"🇪🇪","unicode":"U+1F1EA U+1F1EA","name":"Estonia","title":"flag for Estonia","dialCode":"+372"},{"code":"EG","emoji":"🇪🇬","unicode":"U+1F1EA U+1F1EC","name":"Egypt","title":"flag for Egypt","dialCode":"+20"},{"code":"EH","emoji":"🇪🇭","unicode":"U+1F1EA U+1F1ED","name":"Western Sahara","title":"flag for Western Sahara"},{"code":"ER","emoji":"🇪🇷","unicode":"U+1F1EA U+1F1F7","name":"Eritrea","title":"flag for Eritrea","dialCode":"+291"},{"code":"ES","emoji":"🇪🇸","unicode":"U+1F1EA U+1F1F8","name":"Spain","title":"flag for Spain","dialCode":"+34"},{"code":"ET","emoji":"🇪🇹","unicode":"U+1F1EA U+1F1F9","name":"Ethiopia","title":"flag for Ethiopia","dialCode":"+251"},{"code":"EU","emoji":"🇪🇺","unicode":"U+1F1EA U+1F1FA","name":"European Union","title":"flag for European Union"},{"code":"FI","emoji":"🇫🇮","unicode":"U+1F1EB U+1F1EE","name":"Finland","title":"flag for Finland","dialCode":"+358"},{"code":"FJ","emoji":"🇫🇯","unicode":"U+1F1EB U+1F1EF","name":"Fiji","title":"flag for Fiji","dialCode":"+679"},{"code":"FK","emoji":"🇫🇰","unicode":"U+1F1EB U+1F1F0","name":"Falkland Islands (Malvinas)","title":"flag for Falkland Islands (Malvinas)","dialCode":"+500"},{"code":"FM","emoji":"🇫🇲","unicode":"U+1F1EB U+1F1F2","name":"Micronesia","title":"flag for Micronesia","dialCode":"+691"},{"code":"FO","emoji":"🇫🇴","unicode":"U+1F1EB U+1F1F4","name":"Faroe Islands","title":"flag for Faroe Islands","dialCode":"+298"},{"code":"FR","emoji":"🇫🇷","unicode":"U+1F1EB U+1F1F7","name":"France","title":"flag for France","dialCode":"+33"},{"code":"GA","emoji":"🇬🇦","unicode":"U+1F1EC U+1F1E6","name":"Gabon","title":"flag for Gabon","dialCode":"+241"},{"code":"GB","emoji":"🇬🇧","unicode":"U+1F1EC U+1F1E7","name":"United Kingdom","title":"flag for United Kingdom","dialCode":"+44"},{"code":"GD","emoji":"🇬🇩","unicode":"U+1F1EC U+1F1E9","name":"Grenada","title":"flag for Grenada","dialCode":"+1 473"},{"code":"GE","emoji":"🇬🇪","unicode":"U+1F1EC U+1F1EA","name":"Georgia","title":"flag for Georgia","dialCode":"+995"},{"code":"GF","emoji":"🇬🇫","unicode":"U+1F1EC U+1F1EB","name":"French Guiana","title":"flag for French Guiana","dialCode":"+594"},{"code":"GG","emoji":"🇬🇬","unicode":"U+1F1EC U+1F1EC","name":"Guernsey","title":"flag for Guernsey","dialCode":"+44"},{"code":"GH","emoji":"🇬🇭","unicode":"U+1F1EC U+1F1ED","name":"Ghana","title":"flag for Ghana","dialCode":"+233"},{"code":"GI","emoji":"🇬🇮","unicode":"U+1F1EC U+1F1EE","name":"Gibraltar","title":"flag for Gibraltar","dialCode":"+350"},{"code":"GL","emoji":"🇬🇱","unicode":"U+1F1EC U+1F1F1","name":"Greenland","title":"flag for Greenland","dialCode":"+299"},{"code":"GM","emoji":"🇬🇲","unicode":"U+1F1EC U+1F1F2","name":"Gambia","title":"flag for Gambia","dialCode":"+220"},{"code":"GN","emoji":"🇬🇳","unicode":"U+1F1EC U+1F1F3","name":"Guinea","title":"flag for Guinea","dialCode":"+224"},{"code":"GP","emoji":"🇬🇵","unicode":"U+1F1EC U+1F1F5","name":"Guadeloupe","title":"flag for Guadeloupe","dialCode":"+590"},{"code":"GQ","emoji":"🇬🇶","unicode":"U+1F1EC U+1F1F6","name":"Equatorial Guinea","title":"flag for Equatorial Guinea","dialCode":"+240"},{"code":"GR","emoji":"🇬🇷","unicode":"U+1F1EC U+1F1F7","name":"Greece","title":"flag for Greece","dialCode":"+30"},{"code":"GS","emoji":"🇬🇸","unicode":"U+1F1EC U+1F1F8","name":"South Georgia","title":"flag for South Georgia","dialCode":"+500"},{"code":"GT","emoji":"🇬🇹","unicode":"U+1F1EC U+1F1F9","name":"Guatemala","title":"flag for Guatemala","dialCode":"+502"},{"code":"GU","emoji":"🇬🇺","unicode":"U+1F1EC U+1F1FA","name":"Guam","title":"flag for Guam","dialCode":"+1 671"},{"code":"GW","emoji":"🇬🇼","unicode":"U+1F1EC U+1F1FC","name":"Guinea-Bissau","title":"flag for Guinea-Bissau","dialCode":"+245"},{"code":"GY","emoji":"🇬🇾","unicode":"U+1F1EC U+1F1FE","name":"Guyana","title":"flag for Guyana","dialCode":"+595"},{"code":"HK","emoji":"🇭🇰","unicode":"U+1F1ED U+1F1F0","name":"Hong Kong","title":"flag for Hong Kong","dialCode":"+852"},{"code":"HM","emoji":"🇭🇲","unicode":"U+1F1ED U+1F1F2","name":"Heard Island and Mcdonald Islands","title":"flag for Heard Island and Mcdonald Islands"},{"code":"HN","emoji":"🇭🇳","unicode":"U+1F1ED U+1F1F3","name":"Honduras","title":"flag for Honduras","dialCode":"+504"},{"code":"HR","emoji":"🇭🇷","unicode":"U+1F1ED U+1F1F7","name":"Croatia","title":"flag for Croatia","dialCode":"+385"},{"code":"HT","emoji":"🇭🇹","unicode":"U+1F1ED U+1F1F9","name":"Haiti","title":"flag for Haiti","dialCode":"+509"},{"code":"HU","emoji":"🇭🇺","unicode":"U+1F1ED U+1F1FA","name":"Hungary","title":"flag for Hungary","dialCode":"+36"},{"code":"ID","emoji":"🇮🇩","unicode":"U+1F1EE U+1F1E9","name":"Indonesia","title":"flag for Indonesia","dialCode":"+62"},{"code":"IE","emoji":"🇮🇪","unicode":"U+1F1EE U+1F1EA","name":"Ireland","title":"flag for Ireland","dialCode":"+353"},{"code":"IL","emoji":"🇮🇱","unicode":"U+1F1EE U+1F1F1","name":"Israel","title":"flag for Israel","dialCode":"+972"},{"code":"IM","emoji":"🇮🇲","unicode":"U+1F1EE U+1F1F2","name":"Isle of Man","title":"flag for Isle of Man","dialCode":"+44"},{"code":"IN","emoji":"🇮🇳","unicode":"U+1F1EE U+1F1F3","name":"India","title":"flag for India","dialCode":"+91"},{"code":"IO","emoji":"🇮🇴","unicode":"U+1F1EE U+1F1F4","name":"British Indian Ocean Territory","title":"flag for British Indian Ocean Territory","dialCode":"+246"},{"code":"IQ","emoji":"🇮🇶","unicode":"U+1F1EE U+1F1F6","name":"Iraq","title":"flag for Iraq","dialCode":"+964"},{"code":"IR","emoji":"🇮🇷","unicode":"U+1F1EE U+1F1F7","name":"Iran","title":"flag for Iran","dialCode":"+98"},{"code":"IS","emoji":"🇮🇸","unicode":"U+1F1EE U+1F1F8","name":"Iceland","title":"flag for Iceland","dialCode":"+354"},{"code":"IT","emoji":"🇮🇹","unicode":"U+1F1EE U+1F1F9","name":"Italy","title":"flag for Italy","dialCode":"+39"},{"code":"JE","emoji":"🇯🇪","unicode":"U+1F1EF U+1F1EA","name":"Jersey","title":"flag for Jersey","dialCode":"+44"},{"code":"JM","emoji":"🇯🇲","unicode":"U+1F1EF U+1F1F2","name":"Jamaica","title":"flag for Jamaica","dialCode":"+1 876"},{"code":"JO","emoji":"🇯🇴","unicode":"U+1F1EF U+1F1F4","name":"Jordan","title":"flag for Jordan","dialCode":"+962"},{"code":"JP","emoji":"🇯🇵","unicode":"U+1F1EF U+1F1F5","name":"Japan","title":"flag for Japan","dialCode":"+81"},{"code":"KE","emoji":"🇰🇪","unicode":"U+1F1F0 U+1F1EA","name":"Kenya","title":"flag for Kenya","dialCode":"+254"},{"code":"KG","emoji":"🇰🇬","unicode":"U+1F1F0 U+1F1EC","name":"Kyrgyzstan","title":"flag for Kyrgyzstan","dialCode":"+996"},{"code":"KH","emoji":"🇰🇭","unicode":"U+1F1F0 U+1F1ED","name":"Cambodia","title":"flag for Cambodia","dialCode":"+855"},{"code":"KI","emoji":"🇰🇮","unicode":"U+1F1F0 U+1F1EE","name":"Kiribati","title":"flag for Kiribati","dialCode":"+686"},{"code":"KM","emoji":"🇰🇲","unicode":"U+1F1F0 U+1F1F2","name":"Comoros","title":"flag for Comoros","dialCode":"+269"},{"code":"KN","emoji":"🇰🇳","unicode":"U+1F1F0 U+1F1F3","name":"Saint Kitts and Nevis","title":"flag for Saint Kitts and Nevis","dialCode":"+1 869"},{"code":"KP","emoji":"🇰🇵","unicode":"U+1F1F0 U+1F1F5","name":"North Korea","title":"flag for North Korea","dialCode":"+850"},{"code":"KR","emoji":"🇰🇷","unicode":"U+1F1F0 U+1F1F7","name":"South Korea","title":"flag for South Korea","dialCode":"+82"},{"code":"KW","emoji":"🇰🇼","unicode":"U+1F1F0 U+1F1FC","name":"Kuwait","title":"flag for Kuwait","dialCode":"+965"},{"code":"KY","emoji":"🇰🇾","unicode":"U+1F1F0 U+1F1FE","name":"Cayman Islands","title":"flag for Cayman Islands","dialCode":"+ 345"},{"code":"KZ","emoji":"🇰🇿","unicode":"U+1F1F0 U+1F1FF","name":"Kazakhstan","title":"flag for Kazakhstan","dialCode":"+7 7"},{"code":"LA","emoji":"🇱🇦","unicode":"U+1F1F1 U+1F1E6","name":"Lao People\'s Democratic Republic","title":"flag for Lao People\'s Democratic Republic","dialCode":"+856"},{"code":"LB","emoji":"🇱🇧","unicode":"U+1F1F1 U+1F1E7","name":"Lebanon","title":"flag for Lebanon","dialCode":"+961"},{"code":"LC","emoji":"🇱🇨","unicode":"U+1F1F1 U+1F1E8","name":"Saint Lucia","title":"flag for Saint Lucia","dialCode":"+1 758"},{"code":"LI","emoji":"🇱🇮","unicode":"U+1F1F1 U+1F1EE","name":"Liechtenstein","title":"flag for Liechtenstein","dialCode":"+423"},{"code":"LK","emoji":"🇱🇰","unicode":"U+1F1F1 U+1F1F0","name":"Sri Lanka","title":"flag for Sri Lanka","dialCode":"+94"},{"code":"LR","emoji":"🇱🇷","unicode":"U+1F1F1 U+1F1F7","name":"Liberia","title":"flag for Liberia","dialCode":"+231"},{"code":"LS","emoji":"🇱🇸","unicode":"U+1F1F1 U+1F1F8","name":"Lesotho","title":"flag for Lesotho","dialCode":"+266"},{"code":"LT","emoji":"🇱🇹","unicode":"U+1F1F1 U+1F1F9","name":"Lithuania","title":"flag for Lithuania","dialCode":"+370"},{"code":"LU","emoji":"🇱🇺","unicode":"U+1F1F1 U+1F1FA","name":"Luxembourg","title":"flag for Luxembourg","dialCode":"+352"},{"code":"LV","emoji":"🇱🇻","unicode":"U+1F1F1 U+1F1FB","name":"Latvia","title":"flag for Latvia","dialCode":"+371"},{"code":"LY","emoji":"🇱🇾","unicode":"U+1F1F1 U+1F1FE","name":"Libya","title":"flag for Libya","dialCode":"+218"},{"code":"MA","emoji":"🇲🇦","unicode":"U+1F1F2 U+1F1E6","name":"Morocco","title":"flag for Morocco","dialCode":"+212"},{"code":"MC","emoji":"🇲🇨","unicode":"U+1F1F2 U+1F1E8","name":"Monaco","title":"flag for Monaco","dialCode":"+377"},{"code":"MD","emoji":"🇲🇩","unicode":"U+1F1F2 U+1F1E9","name":"Moldova","title":"flag for Moldova","dialCode":"+373"},{"code":"ME","emoji":"🇲🇪","unicode":"U+1F1F2 U+1F1EA","name":"Montenegro","title":"flag for Montenegro","dialCode":"+382"},{"code":"MF","emoji":"🇲🇫","unicode":"U+1F1F2 U+1F1EB","name":"Saint Martin (French Part)","title":"flag for Saint Martin (French Part)","dialCode":"+590"},{"code":"MG","emoji":"🇲🇬","unicode":"U+1F1F2 U+1F1EC","name":"Madagascar","title":"flag for Madagascar","dialCode":"+261"},{"code":"MH","emoji":"🇲🇭","unicode":"U+1F1F2 U+1F1ED","name":"Marshall Islands","title":"flag for Marshall Islands","dialCode":"+692"},{"code":"MK","emoji":"🇲🇰","unicode":"U+1F1F2 U+1F1F0","name":"Macedonia","title":"flag for Macedonia","dialCode":"+389"},{"code":"ML","emoji":"🇲🇱","unicode":"U+1F1F2 U+1F1F1","name":"Mali","title":"flag for Mali","dialCode":"+223"},{"code":"MM","emoji":"🇲🇲","unicode":"U+1F1F2 U+1F1F2","name":"Myanmar","title":"flag for Myanmar","dialCode":"+95"},{"code":"MN","emoji":"🇲🇳","unicode":"U+1F1F2 U+1F1F3","name":"Mongolia","title":"flag for Mongolia","dialCode":"+976"},{"code":"MO","emoji":"🇲🇴","unicode":"U+1F1F2 U+1F1F4","name":"Macao","title":"flag for Macao","dialCode":"+853"},{"code":"MP","emoji":"🇲🇵","unicode":"U+1F1F2 U+1F1F5","name":"Northern Mariana Islands","title":"flag for Northern Mariana Islands","dialCode":"+1 670"},{"code":"MQ","emoji":"🇲🇶","unicode":"U+1F1F2 U+1F1F6","name":"Martinique","title":"flag for Martinique","dialCode":"+596"},{"code":"MR","emoji":"🇲🇷","unicode":"U+1F1F2 U+1F1F7","name":"Mauritania","title":"flag for Mauritania","dialCode":"+222"},{"code":"MS","emoji":"🇲🇸","unicode":"U+1F1F2 U+1F1F8","name":"Montserrat","title":"flag for Montserrat","dialCode":"+1664"},{"code":"MT","emoji":"🇲🇹","unicode":"U+1F1F2 U+1F1F9","name":"Malta","title":"flag for Malta","dialCode":"+356"},{"code":"MU","emoji":"🇲🇺","unicode":"U+1F1F2 U+1F1FA","name":"Mauritius","title":"flag for Mauritius","dialCode":"+230"},{"code":"MV","emoji":"🇲🇻","unicode":"U+1F1F2 U+1F1FB","name":"Maldives","title":"flag for Maldives","dialCode":"+960"},{"code":"MW","emoji":"🇲🇼","unicode":"U+1F1F2 U+1F1FC","name":"Malawi","title":"flag for Malawi","dialCode":"+265"},{"code":"MX","emoji":"🇲🇽","unicode":"U+1F1F2 U+1F1FD","name":"Mexico","title":"flag for Mexico","dialCode":"+52"},{"code":"MY","emoji":"🇲🇾","unicode":"U+1F1F2 U+1F1FE","name":"Malaysia","title":"flag for Malaysia","dialCode":"+60"},{"code":"MZ","emoji":"🇲🇿","unicode":"U+1F1F2 U+1F1FF","name":"Mozambique","title":"flag for Mozambique","dialCode":"+258"},{"code":"NA","emoji":"🇳🇦","unicode":"U+1F1F3 U+1F1E6","name":"Namibia","title":"flag for Namibia","dialCode":"+264"},{"code":"NC","emoji":"🇳🇨","unicode":"U+1F1F3 U+1F1E8","name":"New Caledonia","title":"flag for New Caledonia","dialCode":"+687"},{"code":"NE","emoji":"🇳🇪","unicode":"U+1F1F3 U+1F1EA","name":"Niger","title":"flag for Niger","dialCode":"+227"},{"code":"NF","emoji":"🇳🇫","unicode":"U+1F1F3 U+1F1EB","name":"Norfolk Island","title":"flag for Norfolk Island","dialCode":"+672"},{"code":"NG","emoji":"🇳🇬","unicode":"U+1F1F3 U+1F1EC","name":"Nigeria","title":"flag for Nigeria","dialCode":"+234"},{"code":"NI","emoji":"🇳🇮","unicode":"U+1F1F3 U+1F1EE","name":"Nicaragua","title":"flag for Nicaragua","dialCode":"+505"},{"code":"NL","emoji":"🇳🇱","unicode":"U+1F1F3 U+1F1F1","name":"Netherlands","title":"flag for Netherlands","dialCode":"+31"},{"code":"NO","emoji":"🇳🇴","unicode":"U+1F1F3 U+1F1F4","name":"Norway","title":"flag for Norway","dialCode":"+47"},{"code":"NP","emoji":"🇳🇵","unicode":"U+1F1F3 U+1F1F5","name":"Nepal","title":"flag for Nepal","dialCode":"+977"},{"code":"NR","emoji":"🇳🇷","unicode":"U+1F1F3 U+1F1F7","name":"Nauru","title":"flag for Nauru","dialCode":"+674"},{"code":"NU","emoji":"🇳🇺","unicode":"U+1F1F3 U+1F1FA","name":"Niue","title":"flag for Niue","dialCode":"+683"},{"code":"NZ","emoji":"🇳🇿","unicode":"U+1F1F3 U+1F1FF","name":"New Zealand","title":"flag for New Zealand","dialCode":"+64"},{"code":"OM","emoji":"🇴🇲","unicode":"U+1F1F4 U+1F1F2","name":"Oman","title":"flag for Oman","dialCode":"+968"},{"code":"PA","emoji":"🇵🇦","unicode":"U+1F1F5 U+1F1E6","name":"Panama","title":"flag for Panama","dialCode":"+507"},{"code":"PE","emoji":"🇵🇪","unicode":"U+1F1F5 U+1F1EA","name":"Peru","title":"flag for Peru","dialCode":"+51"},{"code":"PF","emoji":"🇵🇫","unicode":"U+1F1F5 U+1F1EB","name":"French Polynesia","title":"flag for French Polynesia","dialCode":"+689"},{"code":"PG","emoji":"🇵🇬","unicode":"U+1F1F5 U+1F1EC","name":"Papua New Guinea","title":"flag for Papua New Guinea","dialCode":"+675"},{"code":"PH","emoji":"🇵🇭","unicode":"U+1F1F5 U+1F1ED","name":"Philippines","title":"flag for Philippines","dialCode":"+63"},{"code":"PK","emoji":"🇵🇰","unicode":"U+1F1F5 U+1F1F0","name":"Pakistan","title":"flag for Pakistan","dialCode":"+92"},{"code":"PL","emoji":"🇵🇱","unicode":"U+1F1F5 U+1F1F1","name":"Poland","title":"flag for Poland","dialCode":"+48"},{"code":"PM","emoji":"🇵🇲","unicode":"U+1F1F5 U+1F1F2","name":"Saint Pierre and Miquelon","title":"flag for Saint Pierre and Miquelon","dialCode":"+508"},{"code":"PN","emoji":"🇵🇳","unicode":"U+1F1F5 U+1F1F3","name":"Pitcairn","title":"flag for Pitcairn","dialCode":"+872"},{"code":"PR","emoji":"🇵🇷","unicode":"U+1F1F5 U+1F1F7","name":"Puerto Rico","title":"flag for Puerto Rico","dialCode":"+1 939"},{"code":"PS","emoji":"🇵🇸","unicode":"U+1F1F5 U+1F1F8","name":"Palestinian Territory","title":"flag for Palestinian Territory","dialCode":"+970"},{"code":"PT","emoji":"🇵🇹","unicode":"U+1F1F5 U+1F1F9","name":"Portugal","title":"flag for Portugal","dialCode":"+351"},{"code":"PW","emoji":"🇵🇼","unicode":"U+1F1F5 U+1F1FC","name":"Palau","title":"flag for Palau","dialCode":"+680"},{"code":"PY","emoji":"🇵🇾","unicode":"U+1F1F5 U+1F1FE","name":"Paraguay","title":"flag for Paraguay","dialCode":"+595"},{"code":"QA","emoji":"🇶🇦","unicode":"U+1F1F6 U+1F1E6","name":"Qatar","title":"flag for Qatar","dialCode":"+974"},{"code":"RE","emoji":"🇷🇪","unicode":"U+1F1F7 U+1F1EA","name":"Réunion","title":"flag for Réunion","dialCode":"+262"},{"code":"RO","emoji":"🇷🇴","unicode":"U+1F1F7 U+1F1F4","name":"Romania","title":"flag for Romania","dialCode":"+40"},{"code":"RS","emoji":"🇷🇸","unicode":"U+1F1F7 U+1F1F8","name":"Serbia","title":"flag for Serbia","dialCode":"+381"},{"code":"RU","emoji":"🇷🇺","unicode":"U+1F1F7 U+1F1FA","name":"Russia","title":"flag for Russia","dialCode":"+7"},{"code":"RW","emoji":"🇷🇼","unicode":"U+1F1F7 U+1F1FC","name":"Rwanda","title":"flag for Rwanda","dialCode":"+250"},{"code":"SA","emoji":"🇸🇦","unicode":"U+1F1F8 U+1F1E6","name":"Saudi Arabia","title":"flag for Saudi Arabia","dialCode":"+966"},{"code":"SB","emoji":"🇸🇧","unicode":"U+1F1F8 U+1F1E7","name":"Solomon Islands","title":"flag for Solomon Islands","dialCode":"+677"},{"code":"SC","emoji":"🇸🇨","unicode":"U+1F1F8 U+1F1E8","name":"Seychelles","title":"flag for Seychelles","dialCode":"+248"},{"code":"SD","emoji":"🇸🇩","unicode":"U+1F1F8 U+1F1E9","name":"Sudan","title":"flag for Sudan","dialCode":"+249"},{"code":"SE","emoji":"🇸🇪","unicode":"U+1F1F8 U+1F1EA","name":"Sweden","title":"flag for Sweden","dialCode":"+46"},{"code":"SG","emoji":"🇸🇬","unicode":"U+1F1F8 U+1F1EC","name":"Singapore","title":"flag for Singapore","dialCode":"+65"},{"code":"SH","emoji":"🇸🇭","unicode":"U+1F1F8 U+1F1ED","name":"Saint Helena, Ascension and Tristan Da Cunha","title":"flag for Saint Helena, Ascension and Tristan Da Cunha","dialCode":"+290"},{"code":"SI","emoji":"🇸🇮","unicode":"U+1F1F8 U+1F1EE","name":"Slovenia","title":"flag for Slovenia","dialCode":"+386"},{"code":"SJ","emoji":"🇸🇯","unicode":"U+1F1F8 U+1F1EF","name":"Svalbard and Jan Mayen","title":"flag for Svalbard and Jan Mayen","dialCode":"+47"},{"code":"SK","emoji":"🇸🇰","unicode":"U+1F1F8 U+1F1F0","name":"Slovakia","title":"flag for Slovakia","dialCode":"+421"},{"code":"SL","emoji":"🇸🇱","unicode":"U+1F1F8 U+1F1F1","name":"Sierra Leone","title":"flag for Sierra Leone","dialCode":"+232"},{"code":"SM","emoji":"🇸🇲","unicode":"U+1F1F8 U+1F1F2","name":"San Marino","title":"flag for San Marino","dialCode":"+378"},{"code":"SN","emoji":"🇸🇳","unicode":"U+1F1F8 U+1F1F3","name":"Senegal","title":"flag for Senegal","dialCode":"+221"},{"code":"SO","emoji":"🇸🇴","unicode":"U+1F1F8 U+1F1F4","name":"Somalia","title":"flag for Somalia","dialCode":"+252"},{"code":"SR","emoji":"🇸🇷","unicode":"U+1F1F8 U+1F1F7","name":"Suriname","title":"flag for Suriname","dialCode":"+597"},{"code":"SS","emoji":"🇸🇸","unicode":"U+1F1F8 U+1F1F8","name":"South Sudan","title":"flag for South Sudan"},{"code":"ST","emoji":"🇸🇹","unicode":"U+1F1F8 U+1F1F9","name":"Sao Tome and Principe","title":"flag for Sao Tome and Principe","dialCode":"+239"},{"code":"SV","emoji":"🇸🇻","unicode":"U+1F1F8 U+1F1FB","name":"El Salvador","title":"flag for El Salvador","dialCode":"+503"},{"code":"SX","emoji":"🇸🇽","unicode":"U+1F1F8 U+1F1FD","name":"Sint Maarten (Dutch Part)","title":"flag for Sint Maarten (Dutch Part)"},{"code":"SY","emoji":"🇸🇾","unicode":"U+1F1F8 U+1F1FE","name":"Syrian Arab Republic","title":"flag for Syrian Arab Republic","dialCode":"+963"},{"code":"SZ","emoji":"🇸🇿","unicode":"U+1F1F8 U+1F1FF","name":"Swaziland","title":"flag for Swaziland","dialCode":"+268"},{"code":"TC","emoji":"🇹🇨","unicode":"U+1F1F9 U+1F1E8","name":"Turks and Caicos Islands","title":"flag for Turks and Caicos Islands","dialCode":"+1 649"},{"code":"TD","emoji":"🇹🇩","unicode":"U+1F1F9 U+1F1E9","name":"Chad","title":"flag for Chad","dialCode":"+235"},{"code":"TF","emoji":"🇹🇫","unicode":"U+1F1F9 U+1F1EB","name":"French Southern Territories","title":"flag for French Southern Territories"},{"code":"TG","emoji":"🇹🇬","unicode":"U+1F1F9 U+1F1EC","name":"Togo","title":"flag for Togo","dialCode":"+228"},{"code":"TH","emoji":"🇹🇭","unicode":"U+1F1F9 U+1F1ED","name":"Thailand","title":"flag for Thailand","dialCode":"+66"},{"code":"TJ","emoji":"🇹🇯","unicode":"U+1F1F9 U+1F1EF","name":"Tajikistan","title":"flag for Tajikistan","dialCode":"+992"},{"code":"TK","emoji":"🇹🇰","unicode":"U+1F1F9 U+1F1F0","name":"Tokelau","title":"flag for Tokelau","dialCode":"+690"},{"code":"TL","emoji":"🇹🇱","unicode":"U+1F1F9 U+1F1F1","name":"Timor-Leste","title":"flag for Timor-Leste","dialCode":"+670"},{"code":"TM","emoji":"🇹🇲","unicode":"U+1F1F9 U+1F1F2","name":"Turkmenistan","title":"flag for Turkmenistan","dialCode":"+993"},{"code":"TN","emoji":"🇹🇳","unicode":"U+1F1F9 U+1F1F3","name":"Tunisia","title":"flag for Tunisia","dialCode":"+216"},{"code":"TO","emoji":"🇹🇴","unicode":"U+1F1F9 U+1F1F4","name":"Tonga","title":"flag for Tonga","dialCode":"+676"},{"code":"TR","emoji":"🇹🇷","unicode":"U+1F1F9 U+1F1F7","name":"Turkey","title":"flag for Turkey","dialCode":"+90"},{"code":"TT","emoji":"🇹🇹","unicode":"U+1F1F9 U+1F1F9","name":"Trinidad and Tobago","title":"flag for Trinidad and Tobago","dialCode":"+1 868"},{"code":"TV","emoji":"🇹🇻","unicode":"U+1F1F9 U+1F1FB","name":"Tuvalu","title":"flag for Tuvalu","dialCode":"+688"},{"code":"TW","emoji":"🇹🇼","unicode":"U+1F1F9 U+1F1FC","name":"Taiwan","title":"flag for Taiwan","dialCode":"+886"},{"code":"TZ","emoji":"🇹🇿","unicode":"U+1F1F9 U+1F1FF","name":"Tanzania","title":"flag for Tanzania","dialCode":"+255"},{"code":"UA","emoji":"🇺🇦","unicode":"U+1F1FA U+1F1E6","name":"Ukraine","title":"flag for Ukraine","dialCode":"+380"},{"code":"UG","emoji":"🇺🇬","unicode":"U+1F1FA U+1F1EC","name":"Uganda","title":"flag for Uganda","dialCode":"+256"},{"code":"UM","emoji":"🇺🇲","unicode":"U+1F1FA U+1F1F2","name":"United States Minor Outlying Islands","title":"flag for United States Minor Outlying Islands"},{"code":"US","emoji":"🇺🇸","unicode":"U+1F1FA U+1F1F8","name":"United States","title":"flag for United States","dialCode":"+1"},{"code":"UY","emoji":"🇺🇾","unicode":"U+1F1FA U+1F1FE","name":"Uruguay","title":"flag for Uruguay","dialCode":"+598"},{"code":"UZ","emoji":"🇺🇿","unicode":"U+1F1FA U+1F1FF","name":"Uzbekistan","title":"flag for Uzbekistan","dialCode":"+998"},{"code":"VA","emoji":"🇻🇦","unicode":"U+1F1FB U+1F1E6","name":"Vatican City","title":"flag for Vatican City","dialCode":"+379"},{"code":"VC","emoji":"🇻🇨","unicode":"U+1F1FB U+1F1E8","name":"Saint Vincent and The Grenadines","title":"flag for Saint Vincent and The Grenadines","dialCode":"+1 784"},{"code":"VE","emoji":"🇻🇪","unicode":"U+1F1FB U+1F1EA","name":"Venezuela","title":"flag for Venezuela","dialCode":"+58"},{"code":"VG","emoji":"🇻🇬","unicode":"U+1F1FB U+1F1EC","name":"Virgin Islands, British","title":"flag for Virgin Islands, British","dialCode":"+1 284"},{"code":"VI","emoji":"🇻🇮","unicode":"U+1F1FB U+1F1EE","name":"Virgin Islands, U.S.","title":"flag for Virgin Islands, U.S.","dialCode":"+1 340"},{"code":"VN","emoji":"🇻🇳","unicode":"U+1F1FB U+1F1F3","name":"Viet Nam","title":"flag for Viet Nam","dialCode":"+84"},{"code":"VU","emoji":"🇻🇺","unicode":"U+1F1FB U+1F1FA","name":"Vanuatu","title":"flag for Vanuatu","dialCode":"+678"},{"code":"WF","emoji":"🇼🇫","unicode":"U+1F1FC U+1F1EB","name":"Wallis and Futuna","title":"flag for Wallis and Futuna","dialCode":"+681"},{"code":"WS","emoji":"🇼🇸","unicode":"U+1F1FC U+1F1F8","name":"Samoa","title":"flag for Samoa","dialCode":"+685"},{"code":"XK","emoji":"🇽🇰","unicode":"U+1F1FD U+1F1F0","name":"Kosovo","title":"flag for Kosovo","dialCode":"+383"},{"code":"YE","emoji":"🇾🇪","unicode":"U+1F1FE U+1F1EA","name":"Yemen","title":"flag for Yemen","dialCode":"+967"},{"code":"YT","emoji":"🇾🇹","unicode":"U+1F1FE U+1F1F9","name":"Mayotte","title":"flag for Mayotte","dialCode":"+262"},{"code":"ZA","emoji":"🇿🇦","unicode":"U+1F1FF U+1F1E6","name":"South Africa","title":"flag for South Africa","dialCode":"+27"},{"code":"ZM","emoji":"🇿🇲","unicode":"U+1F1FF U+1F1F2","name":"Zambia","title":"flag for Zambia","dialCode":"+260"},{"code":"ZW","emoji":"🇿🇼","unicode":"U+1F1FF U+1F1FC","name":"Zimbabwe","title":"flag for Zimbabwe","dialCode":"+263"}]')},function(e,t,n){var r=n(338),o=n(345),a=n(346),i=n(347),s=n(107);var c,l,u=(c=o,function(e,t,n){if(t=r(t,n,3),s(e)){var o=i(e,t,l);return o>-1?e[o]:void 0}return a(e,t,c)});e.exports=u},function(e,t,n){var r=n(339),o=n(343),a=n(107),i=n(344),s=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\n\\]|\\.)*?\1)\]/,c=/^\w*$/,l=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\n\\]|\\.)*?)\2)\]/g,u=/\\(\\)?/g;function d(e,t,n){if(null!=e){void 0!==n&&n in h(e)&&(t=[n]);for(var r=0,o=t.length;null!=e&&r<o;)e=e[t[r++]];return r&&r==o?e:void 0}}function f(e,t){var n=typeof e;return!!("string"==n&&c.test(e)||"number"==n)||!a(e)&&(!s.test(e)||null!=t&&e in h(t))}function p(e){return e==e&&!b(e)}function h(e){return b(e)?e:Object(e)}function m(e){if(a(e))return e;var t=[];return function(e){return null==e?"":e+""}(e).replace(l,(function(e,n,r,o){t.push(r?o.replace(u,"$1"):n||e)})),t}function b(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function g(e){return e}e.exports=function(e,t,n){var s,c,l=typeof e;return"function"==l?void 0===t?e:o(e,t,n):null==e?g:"object"==l?function(e){var t=function(e){var t=i(e),n=t.length;for(;n--;)t[n][2]=p(t[n][1]);return t}(e);if(1==t.length&&t[0][2]){var n=t[0][0],o=t[0][1];return function(e){return null!=e&&(e[n]===o&&(void 0!==o||n in h(e)))}}return function(e){return function(e,t,n){var o=t.length,a=o,i=!n;if(null==e)return!a;e=h(e);for(;o--;){var s=t[o];if(i&&s[2]?s[1]!==e[s[0]]:!(s[0]in e))return!1}for(;++o<a;){var c=(s=t[o])[0],l=e[c],u=s[1];if(i&&s[2]){if(void 0===l&&!(c in e))return!1}else{var d=n?n(l,u,c):void 0;if(!(void 0===d?r(u,l,n,!0):d))return!1}}return!0}(e,t)}}(e):void 0===t?f(s=e)?(c=s,function(e){return null==e?void 0:e[c]}):function(e){var t=e+"";return e=m(e),function(n){return d(n,e,t)}}(s):function(e,t){var n=a(e),o=f(e)&&p(t),i=e+"";return e=m(e),function(a){if(null==a)return!1;var s,c,l=i;if(a=h(a),(n||!o)&&!(l in a)){if(null==(a=1==e.length?a:d(a,function(e,t,n){var r=-1,o=e.length;(t=null==t?0:+t||0)<0&&(t=-t>o?0:o+t);(n=void 0===n||n>o?o:+n||0)<0&&(n+=o);o=t>n?0:n-t>>>0,t>>>=0;var a=Array(o);for(;++r<o;)a[r]=e[r+t];return a}(e,0,-1))))return!1;l=(c=(s=e)?s.length:0)?s[c-1]:void 0,a=h(a)}return a[l]===t?void 0!==t||l in a:r(t,a[l],void 0,!0)}}(e,t)}},function(e,t,n){var r=n(107),o=n(340),a=n(145),i="[object Object]";var s=Object.prototype,c=s.hasOwnProperty,l=s.toString;function u(e,t){for(var n=-1,r=e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}function d(e,t,n,r,o,a,i){var s=-1,c=e.length,l=t.length;if(c!=l&&!(o&&l>c))return!1;for(;++s<c;){var d=e[s],f=t[s],p=r?r(o?f:d,o?d:f,s):void 0;if(void 0!==p){if(p)continue;return!1}if(o){if(!u(t,(function(e){return d===e||n(d,e,r,o,a,i)})))return!1}else if(d!==f&&!n(d,f,r,o,a,i))return!1}return!0}function f(e,t,n,r,o,i,s){var l=a(e),u=l.length;if(u!=a(t).length&&!o)return!1;for(var d=u;d--;){var f=l[d];if(!(o?f in t:c.call(t,f)))return!1}for(var p=o;++d<u;){var h=e[f=l[d]],m=t[f],b=r?r(o?m:h,o?h:m,f):void 0;if(!(void 0===b?n(h,m,r,o,i,s):b))return!1;p||(p="constructor"==f)}if(!p){var g=e.constructor,y=t.constructor;if(g!=y&&"constructor"in e&&"constructor"in t&&!("function"==typeof g&&g instanceof g&&"function"==typeof y&&y instanceof y))return!1}return!0}e.exports=function e(t,n,a,s,u,p){return t===n||(null==t||null==n||!function(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}(t)&&!function(e){return!!e&&"object"==typeof e}(n)?t!=t&&n!=n:function(e,t,n,a,s,u,p){var h=r(e),m=r(t),b="[object Array]",g="[object Array]";h||("[object Arguments]"==(b=l.call(e))?b=i:b!=i&&(h=o(e)));m||("[object Arguments]"==(g=l.call(t))?g=i:g!=i&&(m=o(t)));var y=b==i,v=g==i,_=b==g;if(_&&!h&&!y)return function(e,t,n){switch(n){case"[object Boolean]":case"[object Date]":return+e==+t;case"[object Error]":return e.name==t.name&&e.message==t.message;case"[object Number]":return e!=+e?t!=+t:e==+t;case"[object RegExp]":case"[object String]":return e==t+""}return!1}(e,t,b);if(!s){var O=y&&c.call(e,"__wrapped__"),w=v&&c.call(t,"__wrapped__");if(O||w)return n(O?e.value():e,w?t.value():t,a,s,u,p)}if(!_)return!1;u||(u=[]),p||(p=[]);var k=u.length;for(;k--;)if(u[k]==e)return p[k]==t;u.push(e),p.push(t);var S=(h?d:f)(e,t,n,a,s,u,p);return u.pop(),p.pop(),S}(t,n,e,a,s,u,p))}},function(e,t){var n={};n["[object Float32Array]"]=n["[object Float64Array]"]=n["[object Int8Array]"]=n["[object Int16Array]"]=n["[object Int32Array]"]=n["[object Uint8Array]"]=n["[object Uint8ClampedArray]"]=n["[object Uint16Array]"]=n["[object Uint32Array]"]=!0,n["[object Arguments]"]=n["[object Array]"]=n["[object ArrayBuffer]"]=n["[object Boolean]"]=n["[object DataView]"]=n["[object Date]"]=n["[object Error]"]=n["[object Function]"]=n["[object Map]"]=n["[object Number]"]=n["[object Object]"]=n["[object RegExp]"]=n["[object Set]"]=n["[object String]"]=n["[object WeakMap]"]=!1;var r=Object.prototype.toString;e.exports=function(e){return function(e){return!!e&&"object"==typeof e}(e)&&function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}(e.length)&&!!n[r.call(e)]}},function(e,t){var n=/^\[object .+?Constructor\]$/;var r=Object.prototype,o=Function.prototype.toString,a=r.hasOwnProperty,i=r.toString,s=RegExp("^"+o.call(a).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");e.exports=function(e,t){var r=null==e?void 0:e[t];return function(e){if(null==e)return!1;if(function(e){return function(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}(e)&&"[object Function]"==i.call(e)}(e))return s.test(o.call(e));return function(e){return!!e&&"object"==typeof e}(e)&&n.test(e)}(r)?r:void 0}},function(e,t){var n=Object.prototype,r=n.hasOwnProperty,o=n.toString,a=n.propertyIsEnumerable;e.exports=function(e){return function(e){return function(e){return!!e&&"object"==typeof e}(e)&&function(e){return null!=e&&function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}(e.length)&&!function(e){var t=function(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}(e)?o.call(e):"";return"[object Function]"==t||"[object GeneratorFunction]"==t}(e)}(e)}(e)&&r.call(e,"callee")&&(!a.call(e,"callee")||"[object Arguments]"==o.call(e))}},function(e,t){function n(e){return e}e.exports=function(e,t,r){if("function"!=typeof e)return n;if(void 0===t)return e;switch(r){case 1:return function(n){return e.call(t,n)};case 3:return function(n,r,o){return e.call(t,n,r,o)};case 4:return function(n,r,o,a){return e.call(t,n,r,o,a)};case 5:return function(n,r,o,a,i){return e.call(t,n,r,o,a,i)}}return function(){return e.apply(t,arguments)}}},function(e,t,n){var r=n(145);e.exports=function(e){var t;e=function(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}(t=e)?t:Object(t);for(var n=-1,o=r(e),a=o.length,i=Array(a);++n<a;){var s=o[n];i[n]=[s,e[s]]}return i}},function(e,t,n){var r,o,a=n(145),i=(r=function(e,t){return s(e,t,a)},function(e,t){var n,a=e?l(e):0;if(!("number"==typeof(n=a)&&n>-1&&n%1==0&&n<=9007199254740991))return r(e,t);for(var i=o?a:-1,s=u(e);(o?i--:++i<a)&&!1!==t(s[i],i,s););return e}),s=function(e){return function(t,n,r){for(var o=u(t),a=r(t),i=a.length,s=e?i:-1;e?s--:++s<i;){var c=a[s];if(!1===n(o[c],c,o))break}return t}}();var c,l=(c="length",function(e){return null==e?void 0:e[c]});function u(e){return function(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}(e)?e:Object(e)}e.exports=i},function(e,t){e.exports=function(e,t,n,r){var o;return n(e,(function(e,n,a){if(t(e,n,a))return o=r?n:e,!1})),o}},function(e,t){e.exports=function(e,t,n){for(var r=e.length,o=n?r:-1;n?o--:++o<r;)if(t(e[o],o,e))return o;return-1}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(146);Object.defineProperty(t,"CalendarDay",{enumerable:!0,get:function(){return k(r).default}});var o=n(201);Object.defineProperty(t,"CalendarMonth",{enumerable:!0,get:function(){return k(o).default}});var a=n(204);Object.defineProperty(t,"CalendarMonthGrid",{enumerable:!0,get:function(){return k(a).default}});var i=n(365);Object.defineProperty(t,"DateRangePicker",{enumerable:!0,get:function(){return k(i).default}});var s=n(220);Object.defineProperty(t,"DateRangePickerInput",{enumerable:!0,get:function(){return k(s).default}});var c=n(219);Object.defineProperty(t,"DateRangePickerInputController",{enumerable:!0,get:function(){return k(c).default}});var l=n(212);Object.defineProperty(t,"DateRangePickerShape",{enumerable:!0,get:function(){return k(l).default}});var u=n(155);Object.defineProperty(t,"DayPicker",{enumerable:!0,get:function(){return k(u).default}});var d=n(228);Object.defineProperty(t,"DayPickerRangeController",{enumerable:!0,get:function(){return k(d).default}});var f=n(231);Object.defineProperty(t,"DayPickerSingleDateController",{enumerable:!0,get:function(){return k(f).default}});var p=n(390);Object.defineProperty(t,"SingleDatePicker",{enumerable:!0,get:function(){return k(p).default}});var h=n(233);Object.defineProperty(t,"SingleDatePickerInput",{enumerable:!0,get:function(){return k(h).default}});var m=n(232);Object.defineProperty(t,"SingleDatePickerShape",{enumerable:!0,get:function(){return k(m).default}});var b=n(98);Object.defineProperty(t,"isInclusivelyAfterDay",{enumerable:!0,get:function(){return k(b).default}});var g=n(391);Object.defineProperty(t,"isInclusivelyBeforeDay",{enumerable:!0,get:function(){return k(g).default}});var y=n(229);Object.defineProperty(t,"isNextDay",{enumerable:!0,get:function(){return k(y).default}});var v=n(82);Object.defineProperty(t,"isSameDay",{enumerable:!0,get:function(){return k(v).default}});var _=n(109);Object.defineProperty(t,"toISODateString",{enumerable:!0,get:function(){return k(_).default}});var O=n(153);Object.defineProperty(t,"toLocalizedDateString",{enumerable:!0,get:function(){return k(O).default}});var w=n(83);function k(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"toMomentObject",{enumerable:!0,get:function(){return k(w).default}})},function(e,t,n){"use strict";var r;if(!Object.keys){var o=Object.prototype.hasOwnProperty,a=Object.prototype.toString,i=n(195),s=Object.prototype.propertyIsEnumerable,c=!s.call({toString:null},"toString"),l=s.call((function(){}),"prototype"),u=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],d=function(e){var t=e.constructor;return t&&t.prototype===e},f={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},p=function(){if("undefined"==typeof window)return!1;for(var e in window)try{if(!f["$"+e]&&o.call(window,e)&&null!==window[e]&&"object"==typeof window[e])try{d(window[e])}catch(e){return!0}}catch(e){return!0}return!1}();r=function(e){var t=null!==e&&"object"==typeof e,n="[object Function]"===a.call(e),r=i(e),s=t&&"[object String]"===a.call(e),f=[];if(!t&&!n&&!r)throw new TypeError("Object.keys called on a non-object");var h=l&&n;if(s&&e.length>0&&!o.call(e,0))for(var m=0;m<e.length;++m)f.push(String(m));if(r&&e.length>0)for(var b=0;b<e.length;++b)f.push(String(b));else for(var g in e)h&&"prototype"===g||!o.call(e,g)||f.push(String(g));if(c)for(var y=function(e){if("undefined"==typeof window||!p)return d(e);try{return d(e)}catch(e){return!1}}(e),v=0;v<u.length;++v)y&&"constructor"===u[v]||!o.call(e,u[v])||f.push(u[v]);return f}}e.exports=r},function(e,t,n){"use strict";var r="Function.prototype.bind called on incompatible ",o=Array.prototype.slice,a=Object.prototype.toString;e.exports=function(e){var t=this;if("function"!=typeof t||"[object Function]"!==a.call(t))throw new TypeError(r+t);for(var n,i=o.call(arguments,1),s=function(){if(this instanceof n){var r=t.apply(this,i.concat(o.call(arguments)));return Object(r)===r?r:this}return t.apply(e,i.concat(o.call(arguments)))},c=Math.max(0,t.length-i.length),l=[],u=0;u<c;u++)l.push("$"+u);if(n=Function("binder","return function ("+l.join(",")+"){ return binder.apply(this,arguments); }")(s),t.prototype){var d=function(){};d.prototype=t.prototype,n.prototype=new d,d.prototype=null}return n}},function(e,t,n){"use strict";var r=n(57),o=n(198);e.exports=function(){var e=o();return r(Object,{assign:e},{assign:function(){return Object.assign!==e}}),e}},function(e,t,n){var r=n(9);e.exports={isValidMoment:function(e){return!("function"==typeof r.isMoment&&!r.isMoment(e))&&("function"==typeof e.isValid?e.isValid():!isNaN(e))}}},function(e,t){var n={invalidPredicate:"`predicate` must be a function",invalidPropValidator:"`propValidator` must be a function",requiredCore:"is marked as required",invalidTypeCore:"Invalid input type",predicateFailureCore:"Failed to succeed with predicate",anonymousMessage:"<<anonymous>>",baseInvalidMessage:"Invalid "};function r(e){if("function"!=typeof e)throw new Error(n.invalidPropValidator);var t=e.bind(null,!1,null);return t.isRequired=e.bind(null,!0,null),t.withPredicate=function(t){if("function"!=typeof t)throw new Error(n.invalidPredicate);var r=e.bind(null,!1,t);return r.isRequired=e.bind(null,!0,t),r},t}function o(e,t,r){return new Error("The prop `"+e+"` "+n.requiredCore+" in `"+t+"`, but its value is `"+r+"`.")}e.exports={constructPropValidatorVariations:r,createMomentChecker:function(e,t,a,i){return r((function(r,s,c,l,u,d,f){var p=c[l],h=typeof p,m=function(e,t,n,r){var a=void 0===r,i=null===r;if(e){if(a)return o(n,t,"undefined");if(i)return o(n,t,"null")}return a||i?null:-1}(r,u=u||n.anonymousMessage,f=f||l,p);if(-1!==m)return m;if(t&&!t(p))return new Error(n.invalidTypeCore+": `"+l+"` of type `"+h+"` supplied to `"+u+"`, expected `"+e+"`.");if(!a(p))return new Error(n.baseInvalidMessage+d+" `"+l+"` of type `"+h+"` supplied to `"+u+"`, expected `"+i+"`.");if(s&&!s(p)){var b=s.name||n.anonymousMessage;return new Error(n.baseInvalidMessage+d+" `"+l+"` of type `"+h+"` supplied to `"+u+"`. "+n.predicateFailureCore+" `"+b+"`.")}return null}))},messages:n}},function(e,t,n){"use strict";function r(){return null}function o(){return r}r.isRequired=r,e.exports={and:o,between:o,booleanSome:o,childrenHavePropXorChildren:o,childrenOf:o,childrenOfType:o,childrenSequenceOf:o,componentWithName:o,disallowedIf:o,elementType:o,empty:o,explicitNull:o,forbidExtraProps:Object,integer:o,keysOf:o,mutuallyExclusiveProps:o,mutuallyExclusiveTrueProps:o,nChildren:o,nonNegativeInteger:r,nonNegativeNumber:o,numericString:o,object:o,or:o,predicate:o,range:o,ref:o,requiredBy:o,restrictedProp:o,sequenceOf:o,shape:o,stringEndsWith:o,stringStartsWith:o,uniqueArray:o,uniqueArrayOf:o,valuesOf:o,withShape:o}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.CHANNEL="__direction__",t.DIRECTIONS={LTR:"ltr",RTL:"rtl"}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,o=n(1),a=(r=o)&&r.__esModule?r:{default:r};t.default=a.default.shape({getState:a.default.func,setState:a.default.func,subscribe:a.default.func})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){if("string"==typeof e)return e;if("function"==typeof e)return e(t);return""}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=l;var r=s(n(5)),o=n(31),a=s(n(146)),i=s(n(359));function s(e){return e&&e.__esModule?e:{default:e}}var c=(0,o.forbidExtraProps)({children:(0,o.or)([(0,o.childrenOfType)(a.default),(0,o.childrenOfType)(i.default)]).isRequired});function l(e){var t=e.children;return r.default.createElement("tr",null,t)}l.propTypes=c},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PureCustomizableCalendarDay=t.selectedStyles=t.lastInRangeStyles=t.selectedSpanStyles=t.hoveredSpanStyles=t.blockedOutOfRangeStyles=t.blockedCalendarStyles=t.blockedMinNightsStyles=t.highlightedCalendarStyles=t.outsideStyles=t.defaultStyles=void 0;var r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=g(n(36)),i=g(n(5)),s=g(n(1)),c=g(n(81)),l=g(n(58)),u=n(31),d=n(42),f=g(n(9)),p=n(37),h=g(n(40)),m=g(n(200)),b=n(24);function g(e){return e&&e.__esModule?e:{default:e}}function y(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function v(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}var _=g(n(202)).default.reactDates.color;function O(e,t){if(!e)return null;var n=e.hover;return t&&n?n:e}var w=s.default.shape({background:s.default.string,border:(0,u.or)([s.default.string,s.default.number]),color:s.default.string,hover:s.default.shape({background:s.default.string,border:(0,u.or)([s.default.string,s.default.number]),color:s.default.string})}),k=(0,u.forbidExtraProps)((0,a.default)({},d.withStylesPropTypes,{day:l.default.momentObj,daySize:u.nonNegativeInteger,isOutsideDay:s.default.bool,modifiers:s.default.instanceOf(Set),isFocused:s.default.bool,tabIndex:s.default.oneOf([0,-1]),onDayClick:s.default.func,onDayMouseEnter:s.default.func,onDayMouseLeave:s.default.func,renderDayContents:s.default.func,ariaLabelFormat:s.default.string,defaultStyles:w,outsideStyles:w,todayStyles:w,firstDayOfWeekStyles:w,lastDayOfWeekStyles:w,highlightedCalendarStyles:w,blockedMinNightsStyles:w,blockedCalendarStyles:w,blockedOutOfRangeStyles:w,hoveredSpanStyles:w,selectedSpanStyles:w,lastInRangeStyles:w,selectedStyles:w,selectedStartStyles:w,selectedEndStyles:w,afterHoveredStartStyles:w,phrases:s.default.shape((0,h.default)(p.CalendarDayPhrases))})),S=t.defaultStyles={border:"1px solid "+String(_.core.borderLight),color:_.text,background:_.background,hover:{background:_.core.borderLight,border:"1px double "+String(_.core.borderLight),color:"inherit"}},D=t.outsideStyles={background:_.outside.backgroundColor,border:0,color:_.outside.color},C=t.highlightedCalendarStyles={background:_.highlighted.backgroundColor,color:_.highlighted.color,hover:{background:_.highlighted.backgroundColor_hover,color:_.highlighted.color_active}},E=t.blockedMinNightsStyles={background:_.minimumNights.backgroundColor,border:"1px solid "+String(_.minimumNights.borderColor),color:_.minimumNights.color,hover:{background:_.minimumNights.backgroundColor_hover,color:_.minimumNights.color_active}},j=t.blockedCalendarStyles={background:_.blocked_calendar.backgroundColor,border:"1px solid "+String(_.blocked_calendar.borderColor),color:_.blocked_calendar.color,hover:{background:_.blocked_calendar.backgroundColor_hover,border:"1px solid "+String(_.blocked_calendar.borderColor),color:_.blocked_calendar.color_active}},F=t.blockedOutOfRangeStyles={background:_.blocked_out_of_range.backgroundColor,border:"1px solid "+String(_.blocked_out_of_range.borderColor),color:_.blocked_out_of_range.color,hover:{background:_.blocked_out_of_range.backgroundColor_hover,border:"1px solid "+String(_.blocked_out_of_range.borderColor),color:_.blocked_out_of_range.color_active}},P=t.hoveredSpanStyles={background:_.hoveredSpan.backgroundColor,border:"1px solid "+String(_.hoveredSpan.borderColor),color:_.hoveredSpan.color,hover:{background:_.hoveredSpan.backgroundColor_hover,border:"1px solid "+String(_.hoveredSpan.borderColor),color:_.hoveredSpan.color_active}},M=t.selectedSpanStyles={background:_.selectedSpan.backgroundColor,border:"1px solid "+String(_.selectedSpan.borderColor),color:_.selectedSpan.color,hover:{background:_.selectedSpan.backgroundColor_hover,border:"1px solid "+String(_.selectedSpan.borderColor),color:_.selectedSpan.color_active}},x=t.lastInRangeStyles={borderRight:_.core.primary},T=t.selectedStyles={background:_.selected.backgroundColor,border:"1px solid "+String(_.selected.borderColor),color:_.selected.color,hover:{background:_.selected.backgroundColor_hover,border:"1px solid "+String(_.selected.borderColor),color:_.selected.color_active}},N={day:(0,f.default)(),daySize:b.DAY_SIZE,isOutsideDay:!1,modifiers:new Set,isFocused:!1,tabIndex:-1,onDayClick:function(){},onDayMouseEnter:function(){},onDayMouseLeave:function(){},renderDayContents:null,ariaLabelFormat:"dddd, LL",defaultStyles:S,outsideStyles:D,todayStyles:{},highlightedCalendarStyles:C,blockedMinNightsStyles:E,blockedCalendarStyles:j,blockedOutOfRangeStyles:F,hoveredSpanStyles:P,selectedSpanStyles:M,lastInRangeStyles:x,selectedStyles:T,selectedStartStyles:{},selectedEndStyles:{},afterHoveredStartStyles:{},firstDayOfWeekStyles:{},lastDayOfWeekStyles:{},phrases:p.CalendarDayPhrases},I=function(e){function t(){var e;y(this,t);for(var n=arguments.length,r=Array(n),o=0;o<n;o++)r[o]=arguments[o];var a=v(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(r)));return a.state={isHovered:!1},a.setButtonRef=a.setButtonRef.bind(a),a}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),o(t,[{key:"shouldComponentUpdate",value:function(e,t){return(0,c.default)(this,e,t)}},{key:"componentDidUpdate",value:function(e){var t=this.props,n=t.isFocused,r=t.tabIndex;0===r&&(n||r!==e.tabIndex)&&this.buttonRef.focus()}},{key:"onDayClick",value:function(e,t){(0,this.props.onDayClick)(e,t)}},{key:"onDayMouseEnter",value:function(e,t){var n=this.props.onDayMouseEnter;this.setState({isHovered:!0}),n(e,t)}},{key:"onDayMouseLeave",value:function(e,t){var n=this.props.onDayMouseLeave;this.setState({isHovered:!1}),n(e,t)}},{key:"onKeyDown",value:function(e,t){var n=this.props.onDayClick,r=t.key;"Enter"!==r&&" "!==r||n(e,t)}},{key:"setButtonRef",value:function(e){this.buttonRef=e}},{key:"render",value:function(){var e=this,t=this.props,n=t.day,o=t.ariaLabelFormat,a=t.daySize,s=t.isOutsideDay,c=t.modifiers,l=t.tabIndex,u=t.renderDayContents,f=t.styles,p=t.phrases,h=t.defaultStyles,b=t.outsideStyles,g=t.todayStyles,y=t.firstDayOfWeekStyles,v=t.lastDayOfWeekStyles,_=t.highlightedCalendarStyles,w=t.blockedMinNightsStyles,k=t.blockedCalendarStyles,S=t.blockedOutOfRangeStyles,D=t.hoveredSpanStyles,C=t.selectedSpanStyles,E=t.lastInRangeStyles,j=t.selectedStyles,F=t.selectedStartStyles,P=t.selectedEndStyles,M=t.afterHoveredStartStyles,x=this.state.isHovered;if(!n)return i.default.createElement("td",null);var T=(0,m.default)(n,o,a,c,p),N=T.daySizeStyles,I=T.useDefaultCursor,R=T.selected,A=T.hoveredSpan,L=T.isOutsideRange,U=T.ariaLabel;return i.default.createElement("td",r({},(0,d.css)(f.CalendarDay,I&&f.CalendarDay__defaultCursor,N,O(h,x),s&&O(b,x),c.has("today")&&O(g,x),c.has("first-day-of-week")&&O(y,x),c.has("last-day-of-week")&&O(v,x),c.has("highlighted-calendar")&&O(_,x),c.has("blocked-minimum-nights")&&O(w,x),c.has("blocked-calendar")&&O(k,x),A&&O(D,x),c.has("after-hovered-start")&&O(M,x),c.has("selected-span")&&O(C,x),c.has("last-in-range")&&O(E,x),R&&O(j,x),c.has("selected-start")&&O(F,x),c.has("selected-end")&&O(P,x),L&&O(S,x)),{role:"button",ref:this.setButtonRef,"aria-label":U,onMouseEnter:function(t){e.onDayMouseEnter(n,t)},onMouseLeave:function(t){e.onDayMouseLeave(n,t)},onMouseUp:function(e){e.currentTarget.blur()},onClick:function(t){e.onDayClick(n,t)},onKeyDown:function(t){e.onKeyDown(n,t)},tabIndex:l}),u?u(n,c):n.format("D"))}}]),t}(i.default.Component);I.propTypes=k,I.defaultProps=N,t.PureCustomizableCalendarDay=I,t.default=(0,d.withStyles)((function(e){return{CalendarDay:{boxSizing:"border-box",cursor:"pointer",fontSize:e.reactDates.font.size,textAlign:"center",":active":{outline:0}},CalendarDay__defaultCursor:{cursor:"default"}}}))(I)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:a.default.localeData().firstDayOfWeek();if(!a.default.isMoment(e)||!e.isValid())throw new TypeError("`month` must be a valid moment object");if(-1===i.WEEKDAYS.indexOf(n))throw new TypeError("`firstDayOfWeek` must be an integer between 0 and 6");for(var r=e.clone().startOf("month").hour(12),o=e.clone().endOf("month").hour(12),s=(r.day()+7-n)%7,c=(n+6-o.day())%7,l=r.clone().subtract(s,"day"),u=o.clone().add(c,"day"),d=u.diff(l,"days")+1,f=l.clone(),p=[],h=0;h<d;h+=1){h%7==0&&p.push([]);var m=null;(h>=s&&h<d-c||t)&&(m=f.clone()),p[p.length-1].push(m),f.add(1,"day")}return p};var r,o=n(9),a=(r=o)&&r.__esModule?r:{default:r},i=n(24)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){return!("undefined"==typeof window||!("TransitionEvent"in window))}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return{transform:e,msTransform:e,MozTransform:e,WebkitTransform:e}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){return!(!r.default.isMoment(e)||!r.default.isMoment(t))&&(0,o.default)(e.clone().subtract(1,"month"),t)};var r=a(n(9)),o=a(n(206));function a(e){return e&&e.__esModule?e:{default:e}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){return!(!r.default.isMoment(e)||!r.default.isMoment(t))&&(0,o.default)(e.clone().add(1,"month"),t)};var r=a(n(9)),o=a(n(206));function a(e){return e&&e.__esModule?e:{default:e}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PureDateRangePicker=void 0;var r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=C(n(36)),i=C(n(5)),s=C(n(81)),c=C(n(9)),l=n(42),u=n(252),d=n(31),f=n(110),p=C(n(85)),h=C(n(149)),m=C(n(212)),b=n(37),g=C(n(216)),y=C(n(217)),v=C(n(151)),_=C(n(98)),O=C(n(218)),w=C(n(219)),k=C(n(228)),S=C(n(100)),D=n(24);function C(e){return e&&e.__esModule?e:{default:e}}var E=(0,d.forbidExtraProps)((0,a.default)({},l.withStylesPropTypes,m.default)),j={startDate:null,endDate:null,focusedInput:null,startDatePlaceholderText:"Start Date",endDatePlaceholderText:"End Date",disabled:!1,required:!1,readOnly:!1,screenReaderInputMessage:"",showClearDates:!1,showDefaultInputIcon:!1,inputIconPosition:D.ICON_BEFORE_POSITION,customInputIcon:null,customArrowIcon:null,customCloseIcon:null,noBorder:!1,block:!1,small:!1,regular:!1,keepFocusOnInput:!1,renderMonthText:null,orientation:D.HORIZONTAL_ORIENTATION,anchorDirection:D.ANCHOR_LEFT,openDirection:D.OPEN_DOWN,horizontalMargin:0,withPortal:!1,withFullScreenPortal:!1,appendToBody:!1,disableScroll:!1,initialVisibleMonth:null,numberOfMonths:2,keepOpenOnDateSelect:!1,reopenPickerOnClearDates:!1,renderCalendarInfo:null,calendarInfoPosition:D.INFO_POSITION_BOTTOM,hideKeyboardShortcutsPanel:!1,daySize:D.DAY_SIZE,isRTL:!1,firstDayOfWeek:null,verticalHeight:null,transitionDuration:void 0,verticalSpacing:D.DEFAULT_VERTICAL_SPACING,navPrev:null,navNext:null,onPrevMonthClick:function(){},onNextMonthClick:function(){},onClose:function(){},renderCalendarDay:void 0,renderDayContents:null,renderMonthElement:null,minimumNights:1,enableOutsideDays:!1,isDayBlocked:function(){return!1},isOutsideRange:function(e){return!(0,_.default)(e,(0,c.default)())},isDayHighlighted:function(){return!1},displayFormat:function(){return c.default.localeData().longDateFormat("L")},monthFormat:"MMMM YYYY",weekDayFormat:"dd",phrases:b.DateRangePickerPhrases,dayAriaLabelFormat:void 0},F=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.state={dayPickerContainerStyles:{},isDateRangePickerInputFocused:!1,isDayPickerFocused:!1,showKeyboardShortcuts:!1},n.isTouchDevice=!1,n.onOutsideClick=n.onOutsideClick.bind(n),n.onDateRangePickerInputFocus=n.onDateRangePickerInputFocus.bind(n),n.onDayPickerFocus=n.onDayPickerFocus.bind(n),n.onDayPickerBlur=n.onDayPickerBlur.bind(n),n.showKeyboardShortcutsPanel=n.showKeyboardShortcutsPanel.bind(n),n.responsivizePickerPosition=n.responsivizePickerPosition.bind(n),n.disableScroll=n.disableScroll.bind(n),n.setDayPickerContainerRef=n.setDayPickerContainerRef.bind(n),n.setContainerRef=n.setContainerRef.bind(n),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),o(t,[{key:"componentDidMount",value:function(){this.removeEventListener=(0,f.addEventListener)(window,"resize",this.responsivizePickerPosition,{passive:!0}),this.responsivizePickerPosition(),this.disableScroll(),this.props.focusedInput&&this.setState({isDateRangePickerInputFocused:!0}),this.isTouchDevice=(0,p.default)()}},{key:"shouldComponentUpdate",value:function(e,t){return(0,s.default)(this,e,t)}},{key:"componentDidUpdate",value:function(e){var t=this.props.focusedInput;!e.focusedInput&&t&&this.isOpened()?(this.responsivizePickerPosition(),this.disableScroll()):!e.focusedInput||t||this.isOpened()||this.enableScroll&&this.enableScroll()}},{key:"componentWillUnmount",value:function(){this.removeEventListener&&this.removeEventListener(),this.enableScroll&&this.enableScroll()}},{key:"onOutsideClick",value:function(e){var t=this.props,n=t.onFocusChange,r=t.onClose,o=t.startDate,a=t.endDate,i=t.appendToBody;this.isOpened()&&(i&&this.dayPickerContainer.contains(e.target)||(this.setState({isDateRangePickerInputFocused:!1,isDayPickerFocused:!1,showKeyboardShortcuts:!1}),n(null),r({startDate:o,endDate:a})))}},{key:"onDateRangePickerInputFocus",value:function(e){var t=this.props,n=t.onFocusChange,r=t.readOnly,o=t.withPortal,a=t.withFullScreenPortal,i=t.keepFocusOnInput;e&&(o||a||r&&!i||this.isTouchDevice&&!i?this.onDayPickerFocus():this.onDayPickerBlur()),n(e)}},{key:"onDayPickerFocus",value:function(){var e=this.props,t=e.focusedInput,n=e.onFocusChange;t||n(D.START_DATE),this.setState({isDateRangePickerInputFocused:!1,isDayPickerFocused:!0,showKeyboardShortcuts:!1})}},{key:"onDayPickerBlur",value:function(){this.setState({isDateRangePickerInputFocused:!0,isDayPickerFocused:!1,showKeyboardShortcuts:!1})}},{key:"setDayPickerContainerRef",value:function(e){this.dayPickerContainer=e}},{key:"setContainerRef",value:function(e){this.container=e}},{key:"isOpened",value:function(){var e=this.props.focusedInput;return e===D.START_DATE||e===D.END_DATE}},{key:"disableScroll",value:function(){var e=this.props,t=e.appendToBody,n=e.disableScroll;(t||n)&&this.isOpened()&&(this.enableScroll=(0,O.default)(this.container))}},{key:"responsivizePickerPosition",value:function(){if(this.setState({dayPickerContainerStyles:{}}),this.isOpened()){var e=this.props,t=e.openDirection,n=e.anchorDirection,r=e.horizontalMargin,o=e.withPortal,i=e.withFullScreenPortal,s=e.appendToBody,c=this.state.dayPickerContainerStyles,l=n===D.ANCHOR_LEFT;if(!o&&!i){var u=this.dayPickerContainer.getBoundingClientRect(),d=c[n]||0,f=l?u[D.ANCHOR_RIGHT]:u[D.ANCHOR_LEFT];this.setState({dayPickerContainerStyles:(0,a.default)({},(0,g.default)(n,d,f,r),s&&(0,y.default)(t,n,this.container))})}}}},{key:"showKeyboardShortcutsPanel",value:function(){this.setState({isDateRangePickerInputFocused:!1,isDayPickerFocused:!0,showKeyboardShortcuts:!0})}},{key:"maybeRenderDayPickerWithPortal",value:function(){var e=this.props,t=e.withPortal,n=e.withFullScreenPortal,r=e.appendToBody;return this.isOpened()?t||n||r?i.default.createElement(u.Portal,null,this.renderDayPicker()):this.renderDayPicker():null}},{key:"renderDayPicker",value:function(){var e=this.props,t=e.anchorDirection,n=e.openDirection,o=e.isDayBlocked,a=e.isDayHighlighted,s=e.isOutsideRange,u=e.numberOfMonths,d=e.orientation,f=e.monthFormat,p=e.renderMonthText,h=e.navPrev,m=e.navNext,b=e.onPrevMonthClick,g=e.onNextMonthClick,y=e.onDatesChange,_=e.onFocusChange,O=e.withPortal,w=e.withFullScreenPortal,C=e.daySize,E=e.enableOutsideDays,j=e.focusedInput,F=e.startDate,P=e.endDate,M=e.minimumNights,x=e.keepOpenOnDateSelect,T=e.renderCalendarDay,N=e.renderDayContents,I=e.renderCalendarInfo,R=e.renderMonthElement,A=e.calendarInfoPosition,L=e.firstDayOfWeek,U=e.initialVisibleMonth,B=e.hideKeyboardShortcutsPanel,H=e.customCloseIcon,K=e.onClose,z=e.phrases,q=e.dayAriaLabelFormat,V=e.isRTL,W=e.weekDayFormat,G=e.styles,Y=e.verticalHeight,$=e.transitionDuration,Q=e.verticalSpacing,Z=e.small,X=e.disabled,J=e.theme.reactDates,ee=this.state,te=ee.dayPickerContainerStyles,ne=ee.isDayPickerFocused,re=ee.showKeyboardShortcuts,oe=!w&&O?this.onOutsideClick:void 0,ae=U||function(){return F||P||(0,c.default)()},ie=H||i.default.createElement(S.default,(0,l.css)(G.DateRangePicker_closeButton_svg)),se=(0,v.default)(J,Z),ce=O||w;return i.default.createElement("div",r({ref:this.setDayPickerContainerRef},(0,l.css)(G.DateRangePicker_picker,t===D.ANCHOR_LEFT&&G.DateRangePicker_picker__directionLeft,t===D.ANCHOR_RIGHT&&G.DateRangePicker_picker__directionRight,d===D.HORIZONTAL_ORIENTATION&&G.DateRangePicker_picker__horizontal,d===D.VERTICAL_ORIENTATION&&G.DateRangePicker_picker__vertical,!ce&&n===D.OPEN_DOWN&&{top:se+Q},!ce&&n===D.OPEN_UP&&{bottom:se+Q},ce&&G.DateRangePicker_picker__portal,w&&G.DateRangePicker_picker__fullScreenPortal,V&&G.DateRangePicker_picker__rtl,te),{onClick:oe}),i.default.createElement(k.default,{orientation:d,enableOutsideDays:E,numberOfMonths:u,onPrevMonthClick:b,onNextMonthClick:g,onDatesChange:y,onFocusChange:_,onClose:K,focusedInput:j,startDate:F,endDate:P,monthFormat:f,renderMonthText:p,withPortal:ce,daySize:C,initialVisibleMonth:ae,hideKeyboardShortcutsPanel:B,navPrev:h,navNext:m,minimumNights:M,isOutsideRange:s,isDayHighlighted:a,isDayBlocked:o,keepOpenOnDateSelect:x,renderCalendarDay:T,renderDayContents:N,renderCalendarInfo:I,renderMonthElement:R,calendarInfoPosition:A,isFocused:ne,showKeyboardShortcuts:re,onBlur:this.onDayPickerBlur,phrases:z,dayAriaLabelFormat:q,isRTL:V,firstDayOfWeek:L,weekDayFormat:W,verticalHeight:Y,transitionDuration:$,disabled:X}),w&&i.default.createElement("button",r({},(0,l.css)(G.DateRangePicker_closeButton),{type:"button",onClick:this.onOutsideClick,"aria-label":z.closeDatePicker}),ie))}},{key:"render",value:function(){var e=this.props,t=e.startDate,n=e.startDateId,o=e.startDatePlaceholderText,a=e.endDate,s=e.endDateId,c=e.endDatePlaceholderText,u=e.focusedInput,d=e.screenReaderInputMessage,f=e.showClearDates,p=e.showDefaultInputIcon,m=e.inputIconPosition,b=e.customInputIcon,g=e.customArrowIcon,y=e.customCloseIcon,v=e.disabled,_=e.required,O=e.readOnly,k=e.openDirection,S=e.phrases,C=e.isOutsideRange,E=e.minimumNights,j=e.withPortal,F=e.withFullScreenPortal,P=e.displayFormat,M=e.reopenPickerOnClearDates,x=e.keepOpenOnDateSelect,T=e.onDatesChange,N=e.onClose,I=e.isRTL,R=e.noBorder,A=e.block,L=e.verticalSpacing,U=e.small,B=e.regular,H=e.styles,K=this.state.isDateRangePickerInputFocused,z=!j&&!F,q=L<D.FANG_HEIGHT_PX,V=i.default.createElement(w.default,{startDate:t,startDateId:n,startDatePlaceholderText:o,isStartDateFocused:u===D.START_DATE,endDate:a,endDateId:s,endDatePlaceholderText:c,isEndDateFocused:u===D.END_DATE,displayFormat:P,showClearDates:f,showCaret:!j&&!F&&!q,showDefaultInputIcon:p,inputIconPosition:m,customInputIcon:b,customArrowIcon:g,customCloseIcon:y,disabled:v,required:_,readOnly:O,openDirection:k,reopenPickerOnClearDates:M,keepOpenOnDateSelect:x,isOutsideRange:C,minimumNights:E,withFullScreenPortal:F,onDatesChange:T,onFocusChange:this.onDateRangePickerInputFocus,onKeyDownArrowDown:this.onDayPickerFocus,onKeyDownQuestionMark:this.showKeyboardShortcutsPanel,onClose:N,phrases:S,screenReaderMessage:d,isFocused:K,isRTL:I,noBorder:R,block:A,small:U,regular:B,verticalSpacing:L});return i.default.createElement("div",r({ref:this.setContainerRef},(0,l.css)(H.DateRangePicker,A&&H.DateRangePicker__block)),z&&i.default.createElement(h.default,{onOutsideClick:this.onOutsideClick},V,this.maybeRenderDayPickerWithPortal()),!z&&V,!z&&this.maybeRenderDayPickerWithPortal())}}]),t}(i.default.Component);F.propTypes=E,F.defaultProps=j,t.PureDateRangePicker=F,t.default=(0,l.withStyles)((function(e){var t=e.reactDates,n=t.color,r=t.zIndex;return{DateRangePicker:{position:"relative",display:"inline-block"},DateRangePicker__block:{display:"block"},DateRangePicker_picker:{zIndex:r+1,backgroundColor:n.background,position:"absolute"},DateRangePicker_picker__rtl:{direction:"rtl"},DateRangePicker_picker__directionLeft:{left:0},DateRangePicker_picker__directionRight:{right:0},DateRangePicker_picker__portal:{backgroundColor:"rgba(0, 0, 0, 0.3)",position:"fixed",top:0,left:0,height:"100%",width:"100%"},DateRangePicker_picker__fullScreenPortal:{backgroundColor:n.background},DateRangePicker_closeButton:{background:"none",border:0,color:"inherit",font:"inherit",lineHeight:"normal",overflow:"visible",cursor:"pointer",position:"absolute",top:0,right:0,padding:15,zIndex:r+2,":hover":{color:"darken("+String(n.core.grayLighter)+", 10%)",textDecoration:"none"},":focus":{color:"darken("+String(n.core.grayLighter)+", 10%)",textDecoration:"none"}},DateRangePicker_closeButton_svg:{height:15,width:15,fill:n.core.grayLighter}}}))(F)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=u(n(5)),a=u(n(1)),i=n(31),s=n(110),c=u(n(150)),l=u(n(369));function u(e){return e&&e.__esModule?e:{default:e}}function d(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function f(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}var p={BLOCK:"block",FLEX:"flex",INLINE:"inline",INLINE_BLOCK:"inline-block",CONTENTS:"contents"},h=(0,i.forbidExtraProps)({children:a.default.node.isRequired,onOutsideClick:a.default.func.isRequired,disabled:a.default.bool,useCapture:a.default.bool,display:a.default.oneOf((0,c.default)(p))}),m={disabled:!1,useCapture:!0,display:p.BLOCK},b=function(e){function t(){var e;d(this,t);for(var n=arguments.length,r=Array(n),o=0;o<n;o++)r[o]=arguments[o];var a=f(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(r)));return a.onMouseDown=a.onMouseDown.bind(a),a.onMouseUp=a.onMouseUp.bind(a),a.setChildNodeRef=a.setChildNodeRef.bind(a),a}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),r(t,[{key:"componentDidMount",value:function(){var e=this.props,t=e.disabled,n=e.useCapture;t||this.addMouseDownEventListener(n)}},{key:"componentDidUpdate",value:function(e){var t=e.disabled,n=this.props,r=n.disabled,o=n.useCapture;t!==r&&(r?this.removeEventListeners():this.addMouseDownEventListener(o))}},{key:"componentWillUnmount",value:function(){this.removeEventListeners()}},{key:"onMouseDown",value:function(e){var t=this.props.useCapture;this.childNode&&(0,l.default)(this.childNode,e.target)||(this.removeMouseUp&&(this.removeMouseUp(),this.removeMouseUp=null),this.removeMouseUp=(0,s.addEventListener)(document,"mouseup",this.onMouseUp,{capture:t}))}},{key:"onMouseUp",value:function(e){var t=this.props.onOutsideClick,n=this.childNode&&(0,l.default)(this.childNode,e.target);this.removeMouseUp&&(this.removeMouseUp(),this.removeMouseUp=null),n||t(e)}},{key:"setChildNodeRef",value:function(e){this.childNode=e}},{key:"addMouseDownEventListener",value:function(e){this.removeMouseDown=(0,s.addEventListener)(document,"mousedown",this.onMouseDown,{capture:e})}},{key:"removeEventListeners",value:function(){this.removeMouseDown&&this.removeMouseDown(),this.removeMouseUp&&this.removeMouseUp()}},{key:"render",value:function(){var e=this.props,t=e.children,n=e.display;return o.default.createElement("div",{ref:this.setChildNodeRef,style:n!==p.BLOCK&&(0,c.default)(p).includes(n)?{display:n}:void 0},t)}}]),t}(o.default.Component);t.default=b,b.propTypes=h,b.defaultProps=m},function(e,t,n){"use strict";var r=n(26)("%TypeError%");e.exports=function(e,t){if(null==e)throw new r(t||"Cannot call method on "+e);return e}},function(e,t,n){"use strict";var r=n(209),o=n(57);e.exports=function(){var e=r();return o(Object,{values:e},{values:function(){return Object.values!==e}}),e}},function(e,t,n){"use strict";var r=n(57),o=n(210),a=n(211),i=a(),s=function(e,t){return i.apply(e,[t])};r(s,{getPolyfill:a,implementation:o,shim:n(370)}),e.exports=s},function(e,t,n){"use strict";var r=n(57),o=n(211);e.exports=function(){var e=o();return"undefined"!=typeof document&&(r(document,{contains:e},{contains:function(){return document.contains!==e}}),"undefined"!=typeof Element&&r(Element.prototype,{contains:e},{contains:function(){return Element.prototype.contains!==e}})),e}},function(e,t,n){var r=n(152),o=n(372),a=n(374),i=Math.max,s=Math.min;e.exports=function(e,t,n){var c,l,u,d,f,p,h=0,m=!1,b=!1,g=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function y(t){var n=c,r=l;return c=l=void 0,h=t,d=e.apply(r,n)}function v(e){return h=e,f=setTimeout(O,t),m?y(e):d}function _(e){var n=e-p;return void 0===p||n>=t||n<0||b&&e-h>=u}function O(){var e=o();if(_(e))return w(e);f=setTimeout(O,function(e){var n=t-(e-p);return b?s(n,u-(e-h)):n}(e))}function w(e){return f=void 0,g&&c?y(e):(c=l=void 0,d)}function k(){var e=o(),n=_(e);if(c=arguments,l=this,p=e,n){if(void 0===f)return v(p);if(b)return clearTimeout(f),f=setTimeout(O,t),y(p)}return void 0===f&&(f=setTimeout(O,t)),d}return t=a(t)||0,r(n)&&(m=!!n.leading,u=(b="maxWait"in n)?i(a(n.maxWait)||0,t):u,g="trailing"in n?!!n.trailing:g),k.cancel=function(){void 0!==f&&clearTimeout(f),h=0,c=p=l=f=void 0},k.flush=function(){return void 0===f?d:w(o())},k}},function(e,t,n){var r=n(223);e.exports=function(){return r.Date.now()}},function(e,t,n){(function(t){var n="object"==typeof t&&t&&t.Object===Object&&t;e.exports=n}).call(this,n(78))},function(e,t,n){var r=n(375),o=n(152),a=n(377),i=/^[-+]0x[0-9a-f]+$/i,s=/^0b[01]+$/i,c=/^0o[0-7]+$/i,l=parseInt;e.exports=function(e){if("number"==typeof e)return e;if(a(e))return NaN;if(o(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=o(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=r(e);var n=s.test(e);return n||c.test(e)?l(e.slice(2),n?2:8):i.test(e)?NaN:+e}},function(e,t,n){var r=n(376),o=/^\s+/;e.exports=function(e){return e?e.slice(0,r(e)+1).replace(o,""):e}},function(e,t){var n=/\s/;e.exports=function(e){for(var t=e.length;t--&&n.test(e.charAt(t)););return t}},function(e,t,n){var r=n(378),o=n(381);e.exports=function(e){return"symbol"==typeof e||o(e)&&"[object Symbol]"==r(e)}},function(e,t,n){var r=n(224),o=n(379),a=n(380),i=r?r.toStringTag:void 0;e.exports=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":i&&i in Object(e)?o(e):a(e)}},function(e,t,n){var r=n(224),o=Object.prototype,a=o.hasOwnProperty,i=o.toString,s=r?r.toStringTag:void 0;e.exports=function(e){var t=a.call(e,s),n=e[s];try{e[s]=void 0;var r=!0}catch(e){}var o=i.call(e);return r&&(t?e[s]=n:delete e[s]),o}},function(e,t){var n=Object.prototype.toString;e.exports=function(e){return n.call(e)}},function(e,t){e.exports=function(e){return null!=e&&"object"==typeof e}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:r;return e?n(e(t.clone())):t};var r=function(e){return e}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},o=g(n(36)),a=g(n(5)),i=g(n(1)),s=n(31),c=n(42),l=n(37),u=g(n(40)),d=g(n(226)),f=g(n(225)),p=g(n(384)),h=g(n(385)),m=g(n(84)),b=n(24);function g(e){return e&&e.__esModule?e:{default:e}}function y(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}var v=(0,s.forbidExtraProps)((0,o.default)({},c.withStylesPropTypes,{navPrev:i.default.node,navNext:i.default.node,orientation:m.default,onPrevMonthClick:i.default.func,onNextMonthClick:i.default.func,phrases:i.default.shape((0,u.default)(l.DayPickerNavigationPhrases)),isRTL:i.default.bool})),_={navPrev:null,navNext:null,orientation:b.HORIZONTAL_ORIENTATION,onPrevMonthClick:function(){},onNextMonthClick:function(){},phrases:l.DayPickerNavigationPhrases,isRTL:!1};function O(e){var t=e.navPrev,n=e.navNext,o=e.onPrevMonthClick,i=e.onNextMonthClick,s=e.orientation,l=e.phrases,u=e.isRTL,m=e.styles,g=s===b.HORIZONTAL_ORIENTATION,v=s!==b.HORIZONTAL_ORIENTATION,_=s===b.VERTICAL_SCROLLABLE,O=t,w=n,k=!1,S=!1;if(!O){k=!0;var D=v?p.default:d.default;u&&!v&&(D=f.default),O=a.default.createElement(D,(0,c.css)(g&&m.DayPickerNavigation_svg__horizontal,v&&m.DayPickerNavigation_svg__vertical))}if(!w){S=!0;var C=v?h.default:f.default;u&&!v&&(C=d.default),w=a.default.createElement(C,(0,c.css)(g&&m.DayPickerNavigation_svg__horizontal,v&&m.DayPickerNavigation_svg__vertical))}var E=_?S:S||k;return a.default.createElement("div",c.css.apply(void 0,[m.DayPickerNavigation,g&&m.DayPickerNavigation__horizontal].concat(y(v&&[m.DayPickerNavigation__vertical,E&&m.DayPickerNavigation__verticalDefault]),y(_&&[m.DayPickerNavigation__verticalScrollable,E&&m.DayPickerNavigation__verticalScrollableDefault]))),!_&&a.default.createElement("div",r({role:"button",tabIndex:"0"},c.css.apply(void 0,[m.DayPickerNavigation_button,k&&m.DayPickerNavigation_button__default].concat(y(g&&[m.DayPickerNavigation_button__horizontal].concat(y(k&&[m.DayPickerNavigation_button__horizontalDefault,!u&&m.DayPickerNavigation_leftButton__horizontalDefault,u&&m.DayPickerNavigation_rightButton__horizontalDefault]))),y(v&&[m.DayPickerNavigation_button__vertical].concat(y(k&&[m.DayPickerNavigation_button__verticalDefault,m.DayPickerNavigation_prevButton__verticalDefault]))))),{"aria-label":l.jumpToPrevMonth,onClick:o,onKeyUp:function(e){var t=e.key;"Enter"!==t&&" "!==t||o(e)},onMouseUp:function(e){e.currentTarget.blur()}}),O),a.default.createElement("div",r({role:"button",tabIndex:"0"},c.css.apply(void 0,[m.DayPickerNavigation_button,S&&m.DayPickerNavigation_button__default].concat(y(g&&[m.DayPickerNavigation_button__horizontal].concat(y(S&&[m.DayPickerNavigation_button__horizontalDefault,u&&m.DayPickerNavigation_leftButton__horizontalDefault,!u&&m.DayPickerNavigation_rightButton__horizontalDefault]))),y(v&&[m.DayPickerNavigation_button__vertical,m.DayPickerNavigation_nextButton__vertical].concat(y(S&&[m.DayPickerNavigation_button__verticalDefault,m.DayPickerNavigation_nextButton__verticalDefault,_&&m.DayPickerNavigation_nextButton__verticalScrollableDefault]))))),{"aria-label":l.jumpToNextMonth,onClick:i,onKeyUp:function(e){var t=e.key;"Enter"!==t&&" "!==t||i(e)},onMouseUp:function(e){e.currentTarget.blur()}}),w))}O.propTypes=v,O.defaultProps=_,t.default=(0,c.withStyles)((function(e){var t=e.reactDates,n=t.color;return{DayPickerNavigation:{position:"relative",zIndex:t.zIndex+2},DayPickerNavigation__horizontal:{height:0},DayPickerNavigation__vertical:{},DayPickerNavigation__verticalScrollable:{},DayPickerNavigation__verticalDefault:{position:"absolute",width:"100%",height:52,bottom:0,left:0},DayPickerNavigation__verticalScrollableDefault:{position:"relative"},DayPickerNavigation_button:{cursor:"pointer",userSelect:"none",border:0,padding:0,margin:0},DayPickerNavigation_button__default:{border:"1px solid "+String(n.core.borderLight),backgroundColor:n.background,color:n.placeholderText,":focus":{border:"1px solid "+String(n.core.borderMedium)},":hover":{border:"1px solid "+String(n.core.borderMedium)},":active":{background:n.backgroundDark}},DayPickerNavigation_button__horizontal:{},DayPickerNavigation_button__horizontalDefault:{position:"absolute",top:18,lineHeight:.78,borderRadius:3,padding:"6px 9px"},DayPickerNavigation_leftButton__horizontalDefault:{left:22},DayPickerNavigation_rightButton__horizontalDefault:{right:22},DayPickerNavigation_button__vertical:{},DayPickerNavigation_button__verticalDefault:{padding:5,background:n.background,boxShadow:"0 0 5px 2px rgba(0, 0, 0, 0.1)",position:"relative",display:"inline-block",height:"100%",width:"50%"},DayPickerNavigation_prevButton__verticalDefault:{},DayPickerNavigation_nextButton__verticalDefault:{borderLeft:0},DayPickerNavigation_nextButton__verticalScrollableDefault:{width:"100%"},DayPickerNavigation_svg__horizontal:{height:19,width:19,fill:n.core.grayLight,display:"block"},DayPickerNavigation_svg__vertical:{height:42,width:42,fill:n.text,display:"block"}}}))(O)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,o=n(5),a=(r=o)&&r.__esModule?r:{default:r};var i=function(e){return a.default.createElement("svg",e,a.default.createElement("path",{d:"M32.1 712.6l453.2-452.2c11-11 21-11 32 0l453.2 452.2c4 5 6 10 6 16 0 13-10 23-22 23-7 0-12-2-16-7L501.3 308.5 64.1 744.7c-4 5-9 7-15 7-7 0-12-2-17-7-9-11-9-21 0-32.1z"}))};i.defaultProps={viewBox:"0 0 1000 1000"},t.default=i},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,o=n(5),a=(r=o)&&r.__esModule?r:{default:r};var i=function(e){return a.default.createElement("svg",e,a.default.createElement("path",{d:"M967.5 288.5L514.3 740.7c-11 11-21 11-32 0L29.1 288.5c-4-5-6-11-6-16 0-13 10-23 23-23 6 0 11 2 15 7l437.2 436.2 437.2-436.2c4-5 9-7 16-7 6 0 11 2 16 7 9 10.9 9 21 0 32z"}))};i.defaultProps={viewBox:"0 0 1000 1000"},t.default=i},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BOTTOM_RIGHT=t.TOP_RIGHT=t.TOP_LEFT=void 0;var r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=h(n(36)),i=h(n(5)),s=h(n(1)),c=n(31),l=n(42),u=n(37),d=h(n(40)),f=h(n(387)),p=h(n(100));function h(e){return e&&e.__esModule?e:{default:e}}function m(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function b(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}var g=t.TOP_LEFT="top-left",y=t.TOP_RIGHT="top-right",v=t.BOTTOM_RIGHT="bottom-right",_=(0,c.forbidExtraProps)((0,a.default)({},l.withStylesPropTypes,{block:s.default.bool,buttonLocation:s.default.oneOf([g,y,v]),showKeyboardShortcutsPanel:s.default.bool,openKeyboardShortcutsPanel:s.default.func,closeKeyboardShortcutsPanel:s.default.func,phrases:s.default.shape((0,d.default)(u.DayPickerKeyboardShortcutsPhrases))})),O={block:!1,buttonLocation:v,showKeyboardShortcutsPanel:!1,openKeyboardShortcutsPanel:function(){},closeKeyboardShortcutsPanel:function(){},phrases:u.DayPickerKeyboardShortcutsPhrases};function w(e){return[{unicode:"↵",label:e.enterKey,action:e.selectFocusedDate},{unicode:"←/→",label:e.leftArrowRightArrow,action:e.moveFocusByOneDay},{unicode:"↑/↓",label:e.upArrowDownArrow,action:e.moveFocusByOneWeek},{unicode:"PgUp/PgDn",label:e.pageUpPageDown,action:e.moveFocusByOneMonth},{unicode:"Home/End",label:e.homeEnd,action:e.moveFocustoStartAndEndOfWeek},{unicode:"Esc",label:e.escape,action:e.returnFocusToInput},{unicode:"?",label:e.questionMark,action:e.openThisPanel}]}var k=function(e){function t(){var e;m(this,t);for(var n=arguments.length,r=Array(n),o=0;o<n;o++)r[o]=arguments[o];var a=b(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(r))),i=a.props.phrases;return a.keyboardShortcuts=w(i),a.onShowKeyboardShortcutsButtonClick=a.onShowKeyboardShortcutsButtonClick.bind(a),a.setShowKeyboardShortcutsButtonRef=a.setShowKeyboardShortcutsButtonRef.bind(a),a.setHideKeyboardShortcutsButtonRef=a.setHideKeyboardShortcutsButtonRef.bind(a),a.handleFocus=a.handleFocus.bind(a),a.onKeyDown=a.onKeyDown.bind(a),a}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),o(t,[{key:"componentWillReceiveProps",value:function(e){var t=this.props.phrases;e.phrases!==t&&(this.keyboardShortcuts=w(e.phrases))}},{key:"componentDidUpdate",value:function(){this.handleFocus()}},{key:"onKeyDown",value:function(e){e.stopPropagation();var t=this.props.closeKeyboardShortcutsPanel;switch(e.key){case"Enter":case" ":case"Spacebar":case"Escape":t();break;case"ArrowUp":case"ArrowDown":break;case"Tab":case"Home":case"End":case"PageUp":case"PageDown":case"ArrowLeft":case"ArrowRight":e.preventDefault()}}},{key:"onShowKeyboardShortcutsButtonClick",value:function(){var e=this;(0,this.props.openKeyboardShortcutsPanel)((function(){e.showKeyboardShortcutsButton.focus()}))}},{key:"setShowKeyboardShortcutsButtonRef",value:function(e){this.showKeyboardShortcutsButton=e}},{key:"setHideKeyboardShortcutsButtonRef",value:function(e){this.hideKeyboardShortcutsButton=e}},{key:"handleFocus",value:function(){this.hideKeyboardShortcutsButton&&this.hideKeyboardShortcutsButton.focus()}},{key:"render",value:function(){var e=this,t=this.props,n=t.block,o=t.buttonLocation,a=t.showKeyboardShortcutsPanel,s=t.closeKeyboardShortcutsPanel,c=t.styles,u=t.phrases,d=a?u.hideKeyboardShortcutsPanel:u.showKeyboardShortcutsPanel,h=o===v,m=o===y,b=o===g;return i.default.createElement("div",null,i.default.createElement("button",r({ref:this.setShowKeyboardShortcutsButtonRef},(0,l.css)(c.DayPickerKeyboardShortcuts_buttonReset,c.DayPickerKeyboardShortcuts_show,h&&c.DayPickerKeyboardShortcuts_show__bottomRight,m&&c.DayPickerKeyboardShortcuts_show__topRight,b&&c.DayPickerKeyboardShortcuts_show__topLeft),{type:"button","aria-label":d,onClick:this.onShowKeyboardShortcutsButtonClick,onKeyDown:function(t){"Enter"===t.key?t.preventDefault():"Space"===t.key&&e.onShowKeyboardShortcutsButtonClick(t)},onMouseUp:function(e){e.currentTarget.blur()}}),i.default.createElement("span",(0,l.css)(c.DayPickerKeyboardShortcuts_showSpan,h&&c.DayPickerKeyboardShortcuts_showSpan__bottomRight,m&&c.DayPickerKeyboardShortcuts_showSpan__topRight,b&&c.DayPickerKeyboardShortcuts_showSpan__topLeft),"?")),a&&i.default.createElement("div",r({},(0,l.css)(c.DayPickerKeyboardShortcuts_panel),{role:"dialog","aria-labelledby":"DayPickerKeyboardShortcuts_title","aria-describedby":"DayPickerKeyboardShortcuts_description"}),i.default.createElement("div",r({},(0,l.css)(c.DayPickerKeyboardShortcuts_title),{id:"DayPickerKeyboardShortcuts_title"}),u.keyboardShortcuts),i.default.createElement("button",r({ref:this.setHideKeyboardShortcutsButtonRef},(0,l.css)(c.DayPickerKeyboardShortcuts_buttonReset,c.DayPickerKeyboardShortcuts_close),{type:"button",tabIndex:"0","aria-label":u.hideKeyboardShortcutsPanel,onClick:s,onKeyDown:this.onKeyDown}),i.default.createElement(p.default,(0,l.css)(c.DayPickerKeyboardShortcuts_closeSvg))),i.default.createElement("ul",r({},(0,l.css)(c.DayPickerKeyboardShortcuts_list),{id:"DayPickerKeyboardShortcuts_description"}),this.keyboardShortcuts.map((function(e){var t=e.unicode,r=e.label,o=e.action;return i.default.createElement(f.default,{key:r,unicode:t,label:r,action:o,block:n})})))))}}]),t}(i.default.Component);k.propTypes=_,k.defaultProps=O,t.default=(0,l.withStyles)((function(e){var t=e.reactDates,n=t.color,r=t.font,o=t.zIndex;return{DayPickerKeyboardShortcuts_buttonReset:{background:"none",border:0,borderRadius:0,color:"inherit",font:"inherit",lineHeight:"normal",overflow:"visible",padding:0,cursor:"pointer",fontSize:r.size,":active":{outline:"none"}},DayPickerKeyboardShortcuts_show:{width:22,position:"absolute",zIndex:o+2},DayPickerKeyboardShortcuts_show__bottomRight:{borderTop:"26px solid transparent",borderRight:"33px solid "+String(n.core.primary),bottom:0,right:0,":hover":{borderRight:"33px solid "+String(n.core.primary_dark)}},DayPickerKeyboardShortcuts_show__topRight:{borderBottom:"26px solid transparent",borderRight:"33px solid "+String(n.core.primary),top:0,right:0,":hover":{borderRight:"33px solid "+String(n.core.primary_dark)}},DayPickerKeyboardShortcuts_show__topLeft:{borderBottom:"26px solid transparent",borderLeft:"33px solid "+String(n.core.primary),top:0,left:0,":hover":{borderLeft:"33px solid "+String(n.core.primary_dark)}},DayPickerKeyboardShortcuts_showSpan:{color:n.core.white,position:"absolute"},DayPickerKeyboardShortcuts_showSpan__bottomRight:{bottom:0,right:-28},DayPickerKeyboardShortcuts_showSpan__topRight:{top:1,right:-28},DayPickerKeyboardShortcuts_showSpan__topLeft:{top:1,left:-28},DayPickerKeyboardShortcuts_panel:{overflow:"auto",background:n.background,border:"1px solid "+String(n.core.border),borderRadius:2,position:"absolute",top:0,bottom:0,right:0,left:0,zIndex:o+2,padding:22,margin:33},DayPickerKeyboardShortcuts_title:{fontSize:16,fontWeight:"bold",margin:0},DayPickerKeyboardShortcuts_list:{listStyle:"none",padding:0,fontSize:r.size},DayPickerKeyboardShortcuts_close:{position:"absolute",right:22,top:22,zIndex:o+2,":active":{outline:"none"}},DayPickerKeyboardShortcuts_closeSvg:{height:15,width:15,fill:n.core.grayLighter,":hover":{fill:n.core.grayLight},":focus":{fill:n.core.grayLight}}}}))(k)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},o=l(n(36)),a=l(n(5)),i=l(n(1)),s=n(31),c=n(42);function l(e){return e&&e.__esModule?e:{default:e}}var u=(0,s.forbidExtraProps)((0,o.default)({},c.withStylesPropTypes,{unicode:i.default.string.isRequired,label:i.default.string.isRequired,action:i.default.string.isRequired,block:i.default.bool}));function d(e){var t=e.unicode,n=e.label,o=e.action,i=e.block,s=e.styles;return a.default.createElement("li",(0,c.css)(s.KeyboardShortcutRow,i&&s.KeyboardShortcutRow__block),a.default.createElement("div",(0,c.css)(s.KeyboardShortcutRow_keyContainer,i&&s.KeyboardShortcutRow_keyContainer__block),a.default.createElement("span",r({},(0,c.css)(s.KeyboardShortcutRow_key),{role:"img","aria-label":String(n)+","}),t)),a.default.createElement("div",(0,c.css)(s.KeyboardShortcutRow_action),o))}d.propTypes=u,d.defaultProps={block:!1},t.default=(0,c.withStyles)((function(e){return{KeyboardShortcutRow:{listStyle:"none",margin:"6px 0"},KeyboardShortcutRow__block:{marginBottom:16},KeyboardShortcutRow_keyContainer:{display:"inline-block",whiteSpace:"nowrap",textAlign:"right",marginRight:6},KeyboardShortcutRow_keyContainer__block:{textAlign:"left",display:"inline"},KeyboardShortcutRow_key:{fontFamily:"monospace",fontSize:12,textTransform:"uppercase",background:e.reactDates.color.core.grayLightest,padding:"2px 6px"},KeyboardShortcutRow_action:{display:"inline",wordBreak:"break-word",marginLeft:8}}}))(d)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:a.default.localeData().firstDayOfWeek(),n=e.clone().startOf("month"),r=i(n,t);return Math.ceil((r+e.daysInMonth())/7)};var r,o=n(9),a=(r=o)&&r.__esModule?r:{default:r};function i(e,t){return(e.day()-t+7)%7}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){return"undefined"!=typeof document&&document.activeElement}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PureSingleDatePicker=void 0;var r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=E(n(36)),i=E(n(5)),s=E(n(9)),c=n(42),l=n(252),u=n(31),d=n(110),f=E(n(85)),p=E(n(149)),h=E(n(232)),m=n(37),b=E(n(83)),g=E(n(153)),y=E(n(216)),v=E(n(217)),_=E(n(151)),O=E(n(98)),w=E(n(218)),k=E(n(233)),S=E(n(231)),D=E(n(100)),C=n(24);function E(e){return e&&e.__esModule?e:{default:e}}var j=(0,u.forbidExtraProps)((0,a.default)({},c.withStylesPropTypes,h.default)),F={date:null,focused:!1,id:"date",placeholder:"Date",disabled:!1,required:!1,readOnly:!1,screenReaderInputMessage:"",showClearDate:!1,showDefaultInputIcon:!1,inputIconPosition:C.ICON_BEFORE_POSITION,customInputIcon:null,customCloseIcon:null,noBorder:!1,block:!1,small:!1,regular:!1,verticalSpacing:C.DEFAULT_VERTICAL_SPACING,keepFocusOnInput:!1,orientation:C.HORIZONTAL_ORIENTATION,anchorDirection:C.ANCHOR_LEFT,openDirection:C.OPEN_DOWN,horizontalMargin:0,withPortal:!1,withFullScreenPortal:!1,appendToBody:!1,disableScroll:!1,initialVisibleMonth:null,firstDayOfWeek:null,numberOfMonths:2,keepOpenOnDateSelect:!1,reopenPickerOnClearDate:!1,renderCalendarInfo:null,calendarInfoPosition:C.INFO_POSITION_BOTTOM,hideKeyboardShortcutsPanel:!1,daySize:C.DAY_SIZE,isRTL:!1,verticalHeight:null,transitionDuration:void 0,horizontalMonthPadding:13,navPrev:null,navNext:null,onPrevMonthClick:function(){},onNextMonthClick:function(){},onClose:function(){},renderMonthText:null,renderCalendarDay:void 0,renderDayContents:null,renderMonthElement:null,enableOutsideDays:!1,isDayBlocked:function(){return!1},isOutsideRange:function(e){return!(0,O.default)(e,(0,s.default)())},isDayHighlighted:function(){},displayFormat:function(){return s.default.localeData().longDateFormat("L")},monthFormat:"MMMM YYYY",weekDayFormat:"dd",phrases:m.SingleDatePickerPhrases,dayAriaLabelFormat:void 0},P=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.isTouchDevice=!1,n.state={dayPickerContainerStyles:{},isDayPickerFocused:!1,isInputFocused:!1,showKeyboardShortcuts:!1},n.onDayPickerFocus=n.onDayPickerFocus.bind(n),n.onDayPickerBlur=n.onDayPickerBlur.bind(n),n.showKeyboardShortcutsPanel=n.showKeyboardShortcutsPanel.bind(n),n.onChange=n.onChange.bind(n),n.onFocus=n.onFocus.bind(n),n.onClearFocus=n.onClearFocus.bind(n),n.clearDate=n.clearDate.bind(n),n.responsivizePickerPosition=n.responsivizePickerPosition.bind(n),n.disableScroll=n.disableScroll.bind(n),n.setDayPickerContainerRef=n.setDayPickerContainerRef.bind(n),n.setContainerRef=n.setContainerRef.bind(n),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),o(t,[{key:"componentDidMount",value:function(){this.removeEventListener=(0,d.addEventListener)(window,"resize",this.responsivizePickerPosition,{passive:!0}),this.responsivizePickerPosition(),this.disableScroll(),this.props.focused&&this.setState({isInputFocused:!0}),this.isTouchDevice=(0,f.default)()}},{key:"componentDidUpdate",value:function(e){var t=this.props.focused;!e.focused&&t?(this.responsivizePickerPosition(),this.disableScroll()):e.focused&&!t&&this.enableScroll&&this.enableScroll()}},{key:"componentWillUnmount",value:function(){this.removeEventListener&&this.removeEventListener(),this.enableScroll&&this.enableScroll()}},{key:"onChange",value:function(e){var t=this.props,n=t.isOutsideRange,r=t.keepOpenOnDateSelect,o=t.onDateChange,a=t.onFocusChange,i=t.onClose,s=(0,b.default)(e,this.getDisplayFormat());s&&!n(s)?(o(s),r||(a({focused:!1}),i({date:s}))):o(null)}},{key:"onFocus",value:function(){var e=this.props,t=e.disabled,n=e.onFocusChange,r=e.readOnly,o=e.withPortal,a=e.withFullScreenPortal,i=e.keepFocusOnInput;o||a||r&&!i||this.isTouchDevice&&!i?this.onDayPickerFocus():this.onDayPickerBlur(),t||n({focused:!0})}},{key:"onClearFocus",value:function(e){var t=this.props,n=t.date,r=t.focused,o=t.onFocusChange,a=t.onClose,i=t.appendToBody;r&&(i&&this.dayPickerContainer.contains(e.target)||(this.setState({isInputFocused:!1,isDayPickerFocused:!1}),o({focused:!1}),a({date:n})))}},{key:"onDayPickerFocus",value:function(){this.setState({isInputFocused:!1,isDayPickerFocused:!0,showKeyboardShortcuts:!1})}},{key:"onDayPickerBlur",value:function(){this.setState({isInputFocused:!0,isDayPickerFocused:!1,showKeyboardShortcuts:!1})}},{key:"getDateString",value:function(e){var t=this.getDisplayFormat();return e&&t?e&&e.format(t):(0,g.default)(e)}},{key:"getDisplayFormat",value:function(){var e=this.props.displayFormat;return"string"==typeof e?e:e()}},{key:"setDayPickerContainerRef",value:function(e){this.dayPickerContainer=e}},{key:"setContainerRef",value:function(e){this.container=e}},{key:"clearDate",value:function(){var e=this.props,t=e.onDateChange,n=e.reopenPickerOnClearDate,r=e.onFocusChange;t(null),n&&r({focused:!0})}},{key:"disableScroll",value:function(){var e=this.props,t=e.appendToBody,n=e.disableScroll,r=e.focused;(t||n)&&r&&(this.enableScroll=(0,w.default)(this.container))}},{key:"responsivizePickerPosition",value:function(){this.setState({dayPickerContainerStyles:{}});var e=this.props,t=e.openDirection,n=e.anchorDirection,r=e.horizontalMargin,o=e.withPortal,i=e.withFullScreenPortal,s=e.appendToBody,c=e.focused,l=this.state.dayPickerContainerStyles;if(c){var u=n===C.ANCHOR_LEFT;if(!o&&!i){var d=this.dayPickerContainer.getBoundingClientRect(),f=l[n]||0,p=u?d[C.ANCHOR_RIGHT]:d[C.ANCHOR_LEFT];this.setState({dayPickerContainerStyles:(0,a.default)({},(0,y.default)(n,f,p,r),s&&(0,v.default)(t,n,this.container))})}}}},{key:"showKeyboardShortcutsPanel",value:function(){this.setState({isInputFocused:!1,isDayPickerFocused:!0,showKeyboardShortcuts:!0})}},{key:"maybeRenderDayPickerWithPortal",value:function(){var e=this.props,t=e.focused,n=e.withPortal,r=e.withFullScreenPortal,o=e.appendToBody;return t?n||r||o?i.default.createElement(l.Portal,null,this.renderDayPicker()):this.renderDayPicker():null}},{key:"renderDayPicker",value:function(){var e=this.props,t=e.anchorDirection,n=e.openDirection,o=e.onDateChange,a=e.date,s=e.onFocusChange,l=e.focused,u=e.enableOutsideDays,d=e.numberOfMonths,f=e.orientation,p=e.monthFormat,h=e.navPrev,m=e.navNext,b=e.onPrevMonthClick,g=e.onNextMonthClick,y=e.onClose,v=e.withPortal,O=e.withFullScreenPortal,w=e.keepOpenOnDateSelect,k=e.initialVisibleMonth,E=e.renderMonthText,j=e.renderCalendarDay,F=e.renderDayContents,P=e.renderCalendarInfo,M=e.renderMonthElement,x=e.calendarInfoPosition,T=e.hideKeyboardShortcutsPanel,N=e.firstDayOfWeek,I=e.customCloseIcon,R=e.phrases,A=e.dayAriaLabelFormat,L=e.daySize,U=e.isRTL,B=e.isOutsideRange,H=e.isDayBlocked,K=e.isDayHighlighted,z=e.weekDayFormat,q=e.styles,V=e.verticalHeight,W=e.transitionDuration,G=e.verticalSpacing,Y=e.horizontalMonthPadding,$=e.small,Q=e.theme.reactDates,Z=this.state,X=Z.dayPickerContainerStyles,J=Z.isDayPickerFocused,ee=Z.showKeyboardShortcuts,te=!O&&v?this.onClearFocus:void 0,ne=I||i.default.createElement(D.default,null),re=(0,_.default)(Q,$),oe=v||O;return i.default.createElement("div",r({ref:this.setDayPickerContainerRef},(0,c.css)(q.SingleDatePicker_picker,t===C.ANCHOR_LEFT&&q.SingleDatePicker_picker__directionLeft,t===C.ANCHOR_RIGHT&&q.SingleDatePicker_picker__directionRight,n===C.OPEN_DOWN&&q.SingleDatePicker_picker__openDown,n===C.OPEN_UP&&q.SingleDatePicker_picker__openUp,!oe&&n===C.OPEN_DOWN&&{top:re+G},!oe&&n===C.OPEN_UP&&{bottom:re+G},f===C.HORIZONTAL_ORIENTATION&&q.SingleDatePicker_picker__horizontal,f===C.VERTICAL_ORIENTATION&&q.SingleDatePicker_picker__vertical,oe&&q.SingleDatePicker_picker__portal,O&&q.SingleDatePicker_picker__fullScreenPortal,U&&q.SingleDatePicker_picker__rtl,X),{onClick:te}),i.default.createElement(S.default,{date:a,onDateChange:o,onFocusChange:s,orientation:f,enableOutsideDays:u,numberOfMonths:d,monthFormat:p,withPortal:oe,focused:l,keepOpenOnDateSelect:w,hideKeyboardShortcutsPanel:T,initialVisibleMonth:k,navPrev:h,navNext:m,onPrevMonthClick:b,onNextMonthClick:g,onClose:y,renderMonthText:E,renderCalendarDay:j,renderDayContents:F,renderCalendarInfo:P,renderMonthElement:M,calendarInfoPosition:x,isFocused:J,showKeyboardShortcuts:ee,onBlur:this.onDayPickerBlur,phrases:R,dayAriaLabelFormat:A,daySize:L,isRTL:U,isOutsideRange:B,isDayBlocked:H,isDayHighlighted:K,firstDayOfWeek:N,weekDayFormat:z,verticalHeight:V,transitionDuration:W,horizontalMonthPadding:Y}),O&&i.default.createElement("button",r({},(0,c.css)(q.SingleDatePicker_closeButton),{"aria-label":R.closeDatePicker,type:"button",onClick:this.onClearFocus}),i.default.createElement("div",(0,c.css)(q.SingleDatePicker_closeButton_svg),ne)))}},{key:"render",value:function(){var e=this.props,t=e.id,n=e.placeholder,o=e.disabled,a=e.focused,s=e.required,l=e.readOnly,u=e.openDirection,d=e.showClearDate,f=e.showDefaultInputIcon,h=e.inputIconPosition,m=e.customCloseIcon,b=e.customInputIcon,g=e.date,y=e.phrases,v=e.withPortal,_=e.withFullScreenPortal,O=e.screenReaderInputMessage,w=e.isRTL,S=e.noBorder,D=e.block,E=e.small,j=e.regular,F=e.verticalSpacing,P=e.styles,M=this.state.isInputFocused,x=this.getDateString(g),T=!v&&!_,N=F<C.FANG_HEIGHT_PX,I=i.default.createElement(k.default,{id:t,placeholder:n,focused:a,isFocused:M,disabled:o,required:s,readOnly:l,openDirection:u,showCaret:!v&&!_&&!N,onClearDate:this.clearDate,showClearDate:d,showDefaultInputIcon:f,inputIconPosition:h,customCloseIcon:m,customInputIcon:b,displayValue:x,onChange:this.onChange,onFocus:this.onFocus,onKeyDownShiftTab:this.onClearFocus,onKeyDownTab:this.onClearFocus,onKeyDownArrowDown:this.onDayPickerFocus,onKeyDownQuestionMark:this.showKeyboardShortcutsPanel,screenReaderMessage:O,phrases:y,isRTL:w,noBorder:S,block:D,small:E,regular:j,verticalSpacing:F});return i.default.createElement("div",r({ref:this.setContainerRef},(0,c.css)(P.SingleDatePicker,D&&P.SingleDatePicker__block)),T&&i.default.createElement(p.default,{onOutsideClick:this.onClearFocus},I,this.maybeRenderDayPickerWithPortal()),!T&&I,!T&&this.maybeRenderDayPickerWithPortal())}}]),t}(i.default.Component);P.propTypes=j,P.defaultProps=F,t.PureSingleDatePicker=P,t.default=(0,c.withStyles)((function(e){var t=e.reactDates,n=t.color,r=t.zIndex;return{SingleDatePicker:{position:"relative",display:"inline-block"},SingleDatePicker__block:{display:"block"},SingleDatePicker_picker:{zIndex:r+1,backgroundColor:n.background,position:"absolute"},SingleDatePicker_picker__rtl:{direction:"rtl"},SingleDatePicker_picker__directionLeft:{left:0},SingleDatePicker_picker__directionRight:{right:0},SingleDatePicker_picker__portal:{backgroundColor:"rgba(0, 0, 0, 0.3)",position:"fixed",top:0,left:0,height:"100%",width:"100%"},SingleDatePicker_picker__fullScreenPortal:{backgroundColor:n.background},SingleDatePicker_closeButton:{background:"none",border:0,color:"inherit",font:"inherit",lineHeight:"normal",overflow:"visible",cursor:"pointer",position:"absolute",top:0,right:0,padding:15,zIndex:r+2,":hover":{color:"darken("+String(n.core.grayLighter)+", 10%)",textDecoration:"none"},":focus":{color:"darken("+String(n.core.grayLighter)+", 10%)",textDecoration:"none"}},SingleDatePicker_closeButton_svg:{height:15,width:15,fill:n.core.grayLighter}}}))(P)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){return!(!r.default.isMoment(e)||!r.default.isMoment(t))&&!(0,o.default)(e,t)};var r=a(n(9)),o=a(n(113));function a(e){return e&&e.__esModule?e:{default:e}}},function(e,t,n){n(393)},function(e,t,n){"use strict";var r,o=n(394);(0,((r=o)&&r.__esModule?r:{default:r}).default)()},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){(0,o.default)(r.default)};var r=a(n(395)),o=a(n(441));function a(e){return e&&e.__esModule?e:{default:e}}},function(e,t,n){e.exports=n(396).default},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});var r=c(n(397)),o=c(n(437)),a=n(438),i=c(n(439)),s=c(n(440));function c(e){return e&&e.__esModule?e:{default:e}}t.default={create:function(e){var t={},n=Object.keys(e),r=(o.default.get(a.GLOBAL_CACHE_KEY)||{}).namespace,s=void 0===r?"":r;return n.forEach((function(e){var n=(0,i.default)(s,e);t[e]=n})),t},resolve:function(e){var t=(0,r.default)(e,1/0),n=(0,s.default)(t),o=n.classNames,a=n.hasInlineStyles,i=n.inlineStyles,c={className:o.map((function(e,t){return String(e)+" "+String(e)+"_"+String(t+1)})).join(" ")};return a&&(c.style=i),c}}},function(e,t,n){"use strict";var r=n(57),o=n(95),a=n(234),i=n(249),s=i(),c=n(436),l=o(s);r(l,{getPolyfill:i,implementation:a,shim:c}),e.exports=l},function(e,t,n){"use strict";var r=n(26),o=r("%Array%"),a=r("%Symbol.species%",!0),i=r("%TypeError%"),s=n(114),c=n(115),l=n(402),u=n(408),d=n(45);e.exports=function(e,t){if(!u(t)||t<0)throw new i("Assertion failed: length must be an integer >= 0");var n,r=0===t?0:t;if(c(e)&&(n=s(e,"constructor"),a&&"Object"===d(n)&&null===(n=s(n,a))&&(n=void 0)),void 0===n)return o(r);if(!l(n))throw new i("C must be a constructor");return new n(r)}},function(e,t,n){var r="function"==typeof Map&&Map.prototype,o=Object.getOwnPropertyDescriptor&&r?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,a=r&&o&&"function"==typeof o.get?o.get:null,i=r&&Map.prototype.forEach,s="function"==typeof Set&&Set.prototype,c=Object.getOwnPropertyDescriptor&&s?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,l=s&&c&&"function"==typeof c.get?c.get:null,u=s&&Set.prototype.forEach,d="function"==typeof WeakMap&&WeakMap.prototype?WeakMap.prototype.has:null,f="function"==typeof WeakSet&&WeakSet.prototype?WeakSet.prototype.has:null,p="function"==typeof WeakRef&&WeakRef.prototype?WeakRef.prototype.deref:null,h=Boolean.prototype.valueOf,m=Object.prototype.toString,b=Function.prototype.toString,g=String.prototype.match,y="function"==typeof BigInt?BigInt.prototype.valueOf:null,v=Object.getOwnPropertySymbols,_="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?Symbol.prototype.toString:null,O="function"==typeof Symbol&&"object"==typeof Symbol.iterator,w=Object.prototype.propertyIsEnumerable,k=("function"==typeof Reflect?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(e){return e.__proto__}:null),S=n(400).custom,D=S&&P(S)?S:null,C="function"==typeof Symbol&&void 0!==Symbol.toStringTag?Symbol.toStringTag:null;function E(e,t,n){var r="double"===(n.quoteStyle||t)?'"':"'";return r+e+r}function j(e){return String(e).replace(/"/g,"&quot;")}function F(e){return!("[object Array]"!==T(e)||C&&"object"==typeof e&&C in e)}function P(e){if(O)return e&&"object"==typeof e&&e instanceof Symbol;if("symbol"==typeof e)return!0;if(!e||"object"!=typeof e||!_)return!1;try{return _.call(e),!0}catch(e){}return!1}e.exports=function e(t,n,r,o){var s=n||{};if(x(s,"quoteStyle")&&"single"!==s.quoteStyle&&"double"!==s.quoteStyle)throw new TypeError('option "quoteStyle" must be "single" or "double"');if(x(s,"maxStringLength")&&("number"==typeof s.maxStringLength?s.maxStringLength<0&&s.maxStringLength!==1/0:null!==s.maxStringLength))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var c=!x(s,"customInspect")||s.customInspect;if("boolean"!=typeof c&&"symbol"!==c)throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(x(s,"indent")&&null!==s.indent&&"\t"!==s.indent&&!(parseInt(s.indent,10)===s.indent&&s.indent>0))throw new TypeError('options "indent" must be "\\t", an integer > 0, or `null`');if(void 0===t)return"undefined";if(null===t)return"null";if("boolean"==typeof t)return t?"true":"false";if("string"==typeof t)return function e(t,n){if(t.length>n.maxStringLength){var r=t.length-n.maxStringLength,o="... "+r+" more character"+(r>1?"s":"");return e(t.slice(0,n.maxStringLength),n)+o}return E(t.replace(/(['\\])/g,"\\$1").replace(/[\x00-\x1f]/g,I),"single",n)}(t,s);if("number"==typeof t)return 0===t?1/0/t>0?"0":"-0":String(t);if("bigint"==typeof t)return String(t)+"n";var m=void 0===s.depth?5:s.depth;if(void 0===r&&(r=0),r>=m&&m>0&&"object"==typeof t)return F(t)?"[Array]":"[Object]";var v=function(e,t){var n;if("\t"===e.indent)n="\t";else{if(!("number"==typeof e.indent&&e.indent>0))return null;n=Array(e.indent+1).join(" ")}return{base:n,prev:Array(t+1).join(n)}}(s,r);if(void 0===o)o=[];else if(N(o,t)>=0)return"[Circular]";function w(t,n,a){if(n&&(o=o.slice()).push(n),a){var i={depth:s.depth};return x(s,"quoteStyle")&&(i.quoteStyle=s.quoteStyle),e(t,i,r+1,o)}return e(t,s,r+1,o)}if("function"==typeof t){var S=function(e){if(e.name)return e.name;var t=g.call(b.call(e),/^function\s*([\w$]+)/);if(t)return t[1];return null}(t),M=B(t,w);return"[Function"+(S?": "+S:" (anonymous)")+"]"+(M.length>0?" { "+M.join(", ")+" }":"")}if(P(t)){var H=O?String(t).replace(/^(Symbol\(.*\))_[^)]*$/,"$1"):_.call(t);return"object"!=typeof t||O?H:R(H)}if(function(e){if(!e||"object"!=typeof e)return!1;if("undefined"!=typeof HTMLElement&&e instanceof HTMLElement)return!0;return"string"==typeof e.nodeName&&"function"==typeof e.getAttribute}(t)){for(var K="<"+String(t.nodeName).toLowerCase(),z=t.attributes||[],q=0;q<z.length;q++)K+=" "+z[q].name+"="+E(j(z[q].value),"double",s);return K+=">",t.childNodes&&t.childNodes.length&&(K+="..."),K+="</"+String(t.nodeName).toLowerCase()+">"}if(F(t)){if(0===t.length)return"[]";var V=B(t,w);return v&&!function(e){for(var t=0;t<e.length;t++)if(N(e[t],"\n")>=0)return!1;return!0}(V)?"["+U(V,v)+"]":"[ "+V.join(", ")+" ]"}if(function(e){return!("[object Error]"!==T(e)||C&&"object"==typeof e&&C in e)}(t)){var W=B(t,w);return 0===W.length?"["+String(t)+"]":"{ ["+String(t)+"] "+W.join(", ")+" }"}if("object"==typeof t&&c){if(D&&"function"==typeof t[D])return t[D]();if("symbol"!==c&&"function"==typeof t.inspect)return t.inspect()}if(function(e){if(!a||!e||"object"!=typeof e)return!1;try{a.call(e);try{l.call(e)}catch(e){return!0}return e instanceof Map}catch(e){}return!1}(t)){var G=[];return i.call(t,(function(e,n){G.push(w(n,t,!0)+" => "+w(e,t))})),L("Map",a.call(t),G,v)}if(function(e){if(!l||!e||"object"!=typeof e)return!1;try{l.call(e);try{a.call(e)}catch(e){return!0}return e instanceof Set}catch(e){}return!1}(t)){var Y=[];return u.call(t,(function(e){Y.push(w(e,t))})),L("Set",l.call(t),Y,v)}if(function(e){if(!d||!e||"object"!=typeof e)return!1;try{d.call(e,d);try{f.call(e,f)}catch(e){return!0}return e instanceof WeakMap}catch(e){}return!1}(t))return A("WeakMap");if(function(e){if(!f||!e||"object"!=typeof e)return!1;try{f.call(e,f);try{d.call(e,d)}catch(e){return!0}return e instanceof WeakSet}catch(e){}return!1}(t))return A("WeakSet");if(function(e){if(!p||!e||"object"!=typeof e)return!1;try{return p.call(e),!0}catch(e){}return!1}(t))return A("WeakRef");if(function(e){return!("[object Number]"!==T(e)||C&&"object"==typeof e&&C in e)}(t))return R(w(Number(t)));if(function(e){if(!e||"object"!=typeof e||!y)return!1;try{return y.call(e),!0}catch(e){}return!1}(t))return R(w(y.call(t)));if(function(e){return!("[object Boolean]"!==T(e)||C&&"object"==typeof e&&C in e)}(t))return R(h.call(t));if(function(e){return!("[object String]"!==T(e)||C&&"object"==typeof e&&C in e)}(t))return R(w(String(t)));if(!function(e){return!("[object Date]"!==T(e)||C&&"object"==typeof e&&C in e)}(t)&&!function(e){return!("[object RegExp]"!==T(e)||C&&"object"==typeof e&&C in e)}(t)){var $=B(t,w),Q=k?k(t)===Object.prototype:t instanceof Object||t.constructor===Object,Z=t instanceof Object?"":"null prototype",X=!Q&&C&&Object(t)===t&&C in t?T(t).slice(8,-1):Z?"Object":"",J=(Q||"function"!=typeof t.constructor?"":t.constructor.name?t.constructor.name+" ":"")+(X||Z?"["+[].concat(X||[],Z||[]).join(": ")+"] ":"");return 0===$.length?J+"{}":v?J+"{"+U($,v)+"}":J+"{ "+$.join(", ")+" }"}return String(t)};var M=Object.prototype.hasOwnProperty||function(e){return e in this};function x(e,t){return M.call(e,t)}function T(e){return m.call(e)}function N(e,t){if(e.indexOf)return e.indexOf(t);for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return-1}function I(e){var t=e.charCodeAt(0),n={8:"b",9:"t",10:"n",12:"f",13:"r"}[t];return n?"\\"+n:"\\x"+(t<16?"0":"")+t.toString(16).toUpperCase()}function R(e){return"Object("+e+")"}function A(e){return e+" { ? }"}function L(e,t,n,r){return e+" ("+t+") {"+(r?U(n,r):n.join(", "))+"}"}function U(e,t){if(0===e.length)return"";var n="\n"+t.prev+t.base;return n+e.join(","+n)+"\n"+t.prev}function B(e,t){var n=F(e),r=[];if(n){r.length=e.length;for(var o=0;o<e.length;o++)r[o]=x(e,o)?t(e[o],e):""}var a,i="function"==typeof v?v(e):[];if(O){a={};for(var s=0;s<i.length;s++)a["$"+i[s]]=i[s]}for(var c in e)x(e,c)&&(n&&String(Number(c))===c&&c<e.length||O&&a["$"+c]instanceof Symbol||(/[^\w$]/.test(c)?r.push(t(c,e)+": "+t(e[c],e)):r.push(c+": "+t(e[c],e))));if("function"==typeof v)for(var l=0;l<i.length;l++)w.call(e,i[l])&&r.push("["+t(i[l])+"]: "+t(e[i[l]],e));return r}},function(e,t){},function(e,t,n){"use strict";e.exports=function(e){return null===e?"Null":void 0===e?"Undefined":"function"==typeof e||"object"==typeof e?"Object":"number"==typeof e?"Number":"boolean"==typeof e?"Boolean":"string"==typeof e?"String":void 0}},function(e,t,n){"use strict";var r=n(403)("%Reflect.construct%",!0),o=n(404);try{o({},"",{"[[Get]]":function(){}})}catch(e){o=null}if(o&&r){var a={},i={};o(i,"length",{"[[Get]]":function(){throw a},"[[Enumerable]]":!0}),e.exports=function(e){try{r(e,i)}catch(e){return e===a}}}else e.exports=function(e){return"function"==typeof e&&!!e.prototype}},function(e,t,n){"use strict";e.exports=n(26)},function(e,t,n){"use strict";var r=n(26)("%TypeError%"),o=n(405),a=n(235),i=n(236),s=n(406),c=n(237),l=n(87),u=n(238),d=n(239),f=n(45);e.exports=function(e,t,n){if("Object"!==f(e))throw new r("Assertion failed: Type(O) is not Object");if(!l(t))throw new r("Assertion failed: IsPropertyKey(P) is not true");var p=o({Type:f,IsDataDescriptor:c,IsAccessorDescriptor:s},n)?n:d(n);if(!o({Type:f,IsDataDescriptor:c,IsAccessorDescriptor:s},p))throw new r("Assertion failed: Desc is not a valid Property Descriptor");return a(c,u,i,e,t,p)}},function(e,t,n){"use strict";var r=n(26),o=n(74),a=r("%TypeError%");e.exports=function(e,t){if("Object"!==e.Type(t))return!1;var n={"[[Configurable]]":!0,"[[Enumerable]]":!0,"[[Get]]":!0,"[[Set]]":!0,"[[Value]]":!0,"[[Writable]]":!0};for(var r in t)if(o(t,r)&&!n[r])return!1;if(e.IsDataDescriptor(t)&&e.IsAccessorDescriptor(t))throw new a("Property Descriptors may not be both accessor and data descriptors");return!0}},function(e,t,n){"use strict";var r=n(74),o=n(156),a=n(45);e.exports=function(e){return void 0!==e&&(o(a,"Property Descriptor","Desc",e),!(!r(e,"[[Get]]")&&!r(e,"[[Set]]")))}},function(e,t,n){"use strict";e.exports=n(158)},function(e,t,n){"use strict";var r=n(409),o=n(410),a=n(157),i=n(241);e.exports=function(e){if("number"!=typeof e||a(e)||!i(e))return!1;var t=r(e);return o(t)===t}},function(e,t,n){"use strict";var r=n(26)("%Math.abs%");e.exports=function(e){return r(e)}},function(e,t,n){"use strict";var r=Math.floor;e.exports=function(e){return r(e)}},function(e,t,n){"use strict";var r=n(26)("%TypeError%"),o=n(242),a=n(412),i=n(413),s=n(114),c=n(420),l=n(115),u=n(421),d=n(434);e.exports=function e(t,n,f,p,h){var m;arguments.length>5&&(m=arguments[5]);for(var b=p,g=0;g<f;){var y=d(g),v=c(n,y);if(!0===v){var _=s(n,y);if(void 0!==m){if(arguments.length<=6)throw new r("Assertion failed: thisArg is required when mapperFunction is provided");_=a(m,arguments[6],[_,g,n])}var O=!1;if(h>0&&(O=l(_)),O){var w=u(_);b=e(t,_,w,b,h-1)}else{if(b>=o)throw new r("index too large");i(t,d(b),_),b+=1}}g+=1}return b}},function(e,t,n){"use strict";var r=n(26),o=n(64),a=r("%TypeError%"),i=n(115),s=r("%Reflect.apply%",!0)||o("%Function.prototype.apply%");e.exports=function(e,t){var n=arguments.length>2?arguments[2]:[];if(!i(n))throw new a("Assertion failed: optional `argumentsList`, if provided, must be a List");return s(e,t,n)}},function(e,t,n){"use strict";var r=n(26)("%TypeError%"),o=n(414),a=n(87),i=n(45);e.exports=function(e,t,n){if("Object"!==i(e))throw new r("Assertion failed: Type(O) is not Object");if(!a(t))throw new r("Assertion failed: IsPropertyKey(P) is not true");var s=o(e,t,n);if(!s)throw new r("unable to create data property");return s}},function(e,t,n){"use strict";var r=n(26)("%TypeError%"),o=n(235),a=n(236),i=n(415),s=n(237),c=n(419),l=n(87),u=n(238),d=n(45);e.exports=function(e,t,n){if("Object"!==d(e))throw new r("Assertion failed: Type(O) is not Object");if(!l(t))throw new r("Assertion failed: IsPropertyKey(P) is not true");var f=i(e,t),p=!f||c(e);return!(f&&(!f["[[Writable]]"]||!f["[[Configurable]]"])||!p)&&o(s,u,a,e,t,{"[[Configurable]]":!0,"[[Enumerable]]":!0,"[[Value]]":n,"[[Writable]]":!0})}},function(e,t,n){"use strict";var r=n(26),o=n(416),a=r("%TypeError%"),i=n(64)("Object.prototype.propertyIsEnumerable"),s=n(74),c=n(115),l=n(87),u=n(417),d=n(239),f=n(45);e.exports=function(e,t){if("Object"!==f(e))throw new a("Assertion failed: O must be an Object");if(!l(t))throw new a("Assertion failed: P must be a Property Key");if(s(e,t)){if(!o){var n=c(e)&&"length"===t,r=u(e)&&"lastIndex"===t;return{"[[Configurable]]":!(n||r),"[[Enumerable]]":i(e,t),"[[Value]]":e[t],"[[Writable]]":!0}}return d(o(e,t))}}},function(e,t,n){"use strict";var r=n(26)("%Object.getOwnPropertyDescriptor%");if(r)try{r([],"length")}catch(e){r=null}e.exports=r},function(e,t,n){"use strict";var r=n(26)("%Symbol.match%",!0),o=n(418),a=n(240);e.exports=function(e){if(!e||"object"!=typeof e)return!1;if(r){var t=e[r];if(void 0!==t)return a(t)}return o(e)}},function(e,t,n){"use strict";var r,o,a,i,s=n(64),c=n(243)();if(c){r=s("Object.prototype.hasOwnProperty"),o=s("RegExp.prototype.exec"),a={};var l=function(){throw a};i={toString:l,valueOf:l},"symbol"==typeof Symbol.toPrimitive&&(i[Symbol.toPrimitive]=l)}var u=s("Object.prototype.toString"),d=Object.getOwnPropertyDescriptor;e.exports=c?function(e){if(!e||"object"!=typeof e)return!1;var t=d(e,"lastIndex");if(!(t&&r(t,"value")))return!1;try{o(e,i)}catch(e){return e===a}}:function(e){return!(!e||"object"!=typeof e&&"function"!=typeof e)&&"[object RegExp]"===u(e)}},function(e,t,n){"use strict";var r=n(26)("%Object%"),o=n(244),a=r.preventExtensions,i=r.isExtensible;e.exports=a?function(e){return!o(e)&&i(e)}:function(e){return!o(e)}},function(e,t,n){"use strict";var r=n(26)("%TypeError%"),o=n(87),a=n(45);e.exports=function(e,t){if("Object"!==a(e))throw new r("Assertion failed: `O` must be an Object");if(!o(t))throw new r("Assertion failed: `P` must be a Property Key");return t in e}},function(e,t,n){"use strict";var r=n(26)("%TypeError%"),o=n(114),a=n(245),i=n(45);e.exports=function(e){if("Object"!==i(e))throw new r("Assertion failed: `obj` must be an Object");return a(o(e,"length"))}},function(e,t,n){"use strict";var r=n(423),o=n(424),a=n(425),i=n(157),s=n(241),c=n(428);e.exports=function(e){var t=a(e);return i(t)?0:0!==t&&s(t)?c(t)*o(r(t)):t}},function(e,t,n){"use strict";var r=n(26)("%Math.abs%");e.exports=function(e){return r(e)}},function(e,t,n){"use strict";var r=Math.floor;e.exports=function(e){return r(e)}},function(e,t,n){"use strict";var r=n(426);e.exports=function(e){var t=r(e,Number);if("string"!=typeof t)return+t;var n=t.replace(/^[ \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u0085]+|[ \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u0085]+$/g,"");return/^0[ob]|^[+-]0x/.test(n)?NaN:+n}},function(e,t,n){"use strict";e.exports=n(427)},function(e,t,n){"use strict";var r=Object.prototype.toString,o=n(247),a=n(158),i=function(e){var t;if((t=arguments.length>1?arguments[1]:"[object Date]"===r.call(e)?String:Number)===String||t===Number){var n,i,s=t===String?["toString","valueOf"]:["valueOf","toString"];for(i=0;i<s.length;++i)if(a(e[s[i]])&&(n=e[s[i]](),o(n)))return n;throw new TypeError("No default value")}throw new TypeError("invalid [[DefaultValue]] hint supplied")};e.exports=function(e){return o(e)?e:arguments.length>1?i(e,arguments[1]):i(e)}},function(e,t,n){"use strict";e.exports=function(e){return e>=0?1:-1}},function(e,t,n){"use strict";var r=n(26),o=r("%TypeError%"),a=r("%Number%"),i=r("%RegExp%"),s=r("%parseInt%"),c=n(64),l=n(430),u=n(244),d=c("String.prototype.slice"),f=l(/^0b[01]+$/i),p=l(/^0o[0-7]+$/i),h=l(/^[-+]0x[0-9a-f]+$/i),m=l(new i("["+["…","​","￾"].join("")+"]","g")),b=["\t\n\v\f\r   ᠎    ","          \u2028","\u2029\ufeff"].join(""),g=new RegExp("(^["+b+"]+)|(["+b+"]+$)","g"),y=c("String.prototype.replace"),v=n(431);e.exports=function e(t){var n=u(t)?t:v(t,a);if("symbol"==typeof n)throw new o("Cannot convert a Symbol value to a number");if("bigint"==typeof n)throw new o("Conversion from 'BigInt' to 'number' is not allowed.");if("string"==typeof n){if(f(n))return e(s(d(n,2),2));if(p(n))return e(s(d(n,2),8));if(m(n)||h(n))return NaN;var r=function(e){return y(e,g,"")}(n);if(r!==n)return e(r)}return a(n)}},function(e,t,n){"use strict";var r=n(26)("RegExp.prototype.test"),o=n(95);e.exports=function(e){return o(r,e)}},function(e,t,n){"use strict";var r=n(432);e.exports=function(e){return arguments.length>1?r(e,arguments[1]):r(e)}},function(e,t,n){"use strict";var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator,o=n(247),a=n(158),i=n(433),s=n(248),c=function(e,t){if(null==e)throw new TypeError("Cannot call method on "+e);if("string"!=typeof t||"number"!==t&&"string"!==t)throw new TypeError('hint must be "string" or "number"');var n,r,i,s="string"===t?["toString","valueOf"]:["valueOf","toString"];for(i=0;i<s.length;++i)if(n=e[s[i]],a(n)&&(r=n.call(e),o(r)))return r;throw new TypeError("No default value")},l=function(e,t){var n=e[t];if(null!=n){if(!a(n))throw new TypeError(n+" returned for property "+t+" of object "+e+" is not a function");return n}};e.exports=function(e){if(o(e))return e;var t,n="default";if(arguments.length>1&&(arguments[1]===String?n="string":arguments[1]===Number&&(n="number")),r&&(Symbol.toPrimitive?t=l(e,Symbol.toPrimitive):s(e)&&(t=Symbol.prototype.valueOf)),void 0!==t){var a=t.call(e,n);if(o(a))return a;throw new TypeError("unable to convert exotic object to primitive")}return"default"===n&&(i(e)||s(e))&&(n="string"),c(e,"default"===n?"number":n)}},function(e,t,n){"use strict";var r=Date.prototype.getDay,o=Object.prototype.toString,a=n(243)();e.exports=function(e){return"object"==typeof e&&null!==e&&(a?function(e){try{return r.call(e),!0}catch(e){return!1}}(e):"[object Date]"===o.call(e))}},function(e,t,n){"use strict";var r=n(26),o=r("%String%"),a=r("%TypeError%");e.exports=function(e){if("symbol"==typeof e)throw new a("Cannot convert a Symbol value to a string");return o(e)}},function(e,t,n){"use strict";var r=n(26)("%Object%"),o=n(208);e.exports=function(e){return o(e),r(e)}},function(e,t,n){"use strict";var r=n(57),o=n(249);e.exports=function(){var e=o();return r(Array.prototype,{flat:e},{flat:function(){return Array.prototype.flat!==e}}),e}},function(e,t,n){"use strict";(function(t){var r=n(57),o=n(248),a="__ global cache key __";"function"==typeof Symbol&&o(Symbol("foo"))&&"function"==typeof Symbol.for&&(a=Symbol.for(a));var i=function(){return!0},s=function(){if(!t[a]){var e={};e[a]={};var n={};n[a]=i,r(t,e,n)}return t[a]},c=s(),l=function(e){return o(e)?Symbol.prototype.valueOf.call(e):typeof e+" | "+String(e)},u=function(e){if(!function(e){return null===e||"object"!=typeof e&&"function"!=typeof e}(e))throw new TypeError("key must not be an object")},d={clear:function(){delete t[a],c=s()},delete:function(e){return u(e),delete c[l(e)],!d.has(e)},get:function(e){return u(e),c[l(e)]},has:function(e){return u(e),l(e)in c},set:function(e,t){u(e);var n=l(e),o={};o[n]=t;var a={};return a[n]=i,r(c,o,a),d.has(e)},setIfMissingThenGet:function(e,t){if(d.has(e))return d.get(e);var n=t();return d.set(e,n),n}};e.exports=d}).call(this,n(78))},function(e,t){Object.defineProperty(t,"__esModule",{value:!0});t.GLOBAL_CACHE_KEY="reactWithStylesInterfaceCSS",t.MAX_SPECIFICITY=20},function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){return(e.length>0?String(e)+"__":"")+String(t)}},function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){for(var t=[],n=!1,r={},o=0;o<e.length;o++){var a=e[o];a&&("string"==typeof a?t.push(a):(Object.assign(r,a),n=!0))}return{classNames:t,hasInlineStyles:n,inlineStyles:r}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){r.default.registerInterface(e),r.default.registerTheme(o.default)};var r=a(n(199)),o=a(n(202));function a(e){return e&&e.__esModule?e:{default:e}}},,,,,,,,,,,,,,,,,,,,function(e,t,n){"use strict";n.r(t),n.d(t,"AbbreviatedCard",(function(){return h})),n.d(t,"AdvancedFilters",(function(){return We})),n.d(t,"AnimationSlider",(function(){return Qe})),n.d(t,"Chart",(function(){return _s})),n.d(t,"ChartPlaceholder",(function(){return Dt})),n.d(t,"CompareButton",(function(){return ws})),n.d(t,"CompareFilter",(function(){return ks})),n.d(t,"Date",(function(){return Cs})),n.d(t,"DateRangeFilterPicker",(function(){return zs})),n.d(t,"DateRange",(function(){return Ns})),n.d(t,"DatePicker",(function(){return Ie})),n.d(t,"DropdownButton",(function(){return Bs})),n.d(t,"EllipsisMenu",(function(){return Gs})),n.d(t,"EmptyContent",(function(){return $s})),n.d(t,"Flag",(function(){return J})),n.d(t,"Form",(function(){return Js})),n.d(t,"FilterPicker",(function(){return rc})),n.d(t,"H",(function(){return Te})),n.d(t,"Section",(function(){return xe})),n.d(t,"ImageUpload",(function(){return ic})),n.d(t,"Link",(function(){return f})),n.d(t,"List",(function(){return dc})),n.d(t,"MenuItem",(function(){return pc})),n.d(t,"MenuTitle",(function(){return mc})),n.d(t,"OrderStatus",(function(){return gc})),n.d(t,"Pagination",(function(){return Oc})),n.d(t,"Pill",(function(){return wc})),n.d(t,"Plugins",(function(){return Cc})),n.d(t,"ProductImage",(function(){return ce})),n.d(t,"ProductRating",(function(){return xc})),n.d(t,"Rating",(function(){return Pc})),n.d(t,"ReportFilters",(function(){return Nc})),n.d(t,"ReviewRating",(function(){return Rc})),n.d(t,"Search",(function(){return be})),n.d(t,"SearchListControl",(function(){return Vc})),n.d(t,"SearchListItem",(function(){return Hc})),n.d(t,"SectionHeader",(function(){return Gc})),n.d(t,"SegmentedSelection",(function(){return js})),n.d(t,"SelectControl",(function(){return K})),n.d(t,"ScrollTo",(function(){return $c})),n.d(t,"Spinner",(function(){return Zc})),n.d(t,"Stepper",(function(){return el})),n.d(t,"SummaryList",(function(){return al})),n.d(t,"SummaryListPlaceholder",(function(){return cl})),n.d(t,"SummaryNumberPlaceholder",(function(){return il})),n.d(t,"SummaryNumber",(function(){return fl})),n.d(t,"Table",(function(){return bl})),n.d(t,"TableCard",(function(){return kl})),n.d(t,"EmptyTable",(function(){return Dl})),n.d(t,"TablePlaceholder",(function(){return yl})),n.d(t,"TableSummary",(function(){return _l})),n.d(t,"TableSummaryPlaceholder",(function(){return Ol})),n.d(t,"Tag",(function(){return N})),n.d(t,"TextControl",(function(){return El})),n.d(t,"TextControlWithAffixes",(function(){return we})),n.d(t,"Timeline",(function(){return Ul})),n.d(t,"ViewMoreList",(function(){return Hl})),n.d(t,"WebPreview",(function(){return zl})),n.d(t,"Badge",(function(){return ql})),n.d(t,"DynamicForm",(function(){return Gl}));var r=n(0),o=n(3),a=n(6),i=n.n(a),s=n(1),c=n.n(s),l=n(4),u=n(12);function d({children:e,href:t,type:n,...o}){const a=(e,t)=>{if(t.ctrlKey||t.metaKey||t.altKey||t.shiftKey)return;t.preventDefault();!1!==(!e||e(t))&&Object(u.getHistory)().push(t.target.closest("a").getAttribute("href"))},i={...o,"data-link-type":n};return"wc-admin"===n&&(i.onClick=Object(l.partial)(a,i.onClick)),Object(r.createElement)("a",Object.assign({href:t},i),e)}d.propTypes={href:c.a.string.isRequired,type:c.a.oneOf(["wp-admin","wc-admin","external"]).isRequired},d.defaultProps={type:"wc-admin"},d.contextTypes={router:c.a.object};var f=d;const p=({children:e,className:t,href:n,icon:a,onClick:s,type:c})=>Object(r.createElement)(o.Card,{className:i()("woocommerce-abbreviated-card",t)},Object(r.createElement)(o.CardBody,{size:null},Object(r.createElement)(f,{href:n,onClick:s,type:c},Object(r.createElement)("div",{className:"woocommerce-abbreviated-card__icon"},Object(r.createElement)(o.Icon,{icon:a})),Object(r.createElement)("div",{className:"woocommerce-abbreviated-card__content"},e))));p.propTypes={children:c.a.node.isRequired,className:c.a.string,href:c.a.string.isRequired,icon:c.a.element.isRequired,onClick:c.a.func,type:c.a.oneOf(["wp-admin","wc-admin","external"])};var h=p,m=n(2),b=n(260),g=n.n(b),y=n(18),v=n.n(y),_=n(101),O=n.n(_);function w(e){let t="";const n=e=>{if(Object(l.isString)(e)||Object(l.isNumber)(e))t+=e;else if(Object(l.isArray)(e))e.forEach(n);else if(e&&e.props){const{children:t}=e.props;Object(l.isArray)(t)?t.forEach(n):n(t)}};return n(e),t}class k extends r.Component{constructor({filter:e,config:t,onFilterChange:n}){super(...arguments);const r=t.input.options;this.state={options:r},this.updateOptions=this.updateOptions.bind(this),!r&&t.input.getOptions&&t.input.getOptions().then(this.updateOptions).then(r=>{if(!e.value){const e=Object(u.getDefaultOptionValue)(t,r);n("value",e)}})}updateOptions(e){return this.setState({options:e}),e}getScreenReaderText(e,t){if(""===e.value)return"";const n=Object(l.find)(t.rules,{value:e.rule})||{},o=Object(l.find)(t.input.options,{value:e.value})||{};return w(v()({mixedString:t.labels.title,components:{filter:Object(r.createElement)(r.Fragment,null,o.label),rule:Object(r.createElement)(r.Fragment,null,n.label),title:Object(r.createElement)(r.Fragment,null)}}))}render(){const{className:e,config:t,filter:n,onFilterChange:a,isEnglish:s}=this.props,{options:c}=this.state,{rule:u,value:d}=n,{labels:f,rules:p}=t,h=v()({mixedString:f.title,components:{title:Object(r.createElement)("span",{className:e}),rule:Object(r.createElement)(o.SelectControl,{className:i()(e,"woocommerce-filters-advanced__rule"),options:p,value:u,onChange:Object(l.partial)(a,"rule"),"aria-label":f.rule}),filter:c?Object(r.createElement)(o.SelectControl,{className:i()(e,"woocommerce-filters-advanced__input"),options:c,value:d,onChange:Object(l.partial)(a,"value"),"aria-label":f.filter}):Object(r.createElement)(o.Spinner,null)}}),m=this.getScreenReaderText(n,t);return Object(r.createElement)("fieldset",{className:"woocommerce-filters-advanced__line-item",tabIndex:"0"},Object(r.createElement)("legend",{className:"screen-reader-text"},f.add||""),Object(r.createElement)("div",{className:i()("woocommerce-filters-advanced__fieldset",{"is-english":s})},h),m&&Object(r.createElement)("span",{className:"screen-reader-text"},m))}}k.propTypes={config:c.a.shape({labels:c.a.shape({rule:c.a.string,title:c.a.string,filter:c.a.string}),rules:c.a.arrayOf(c.a.object),input:c.a.object}).isRequired,filter:c.a.shape({key:c.a.string,rule:c.a.string,value:c.a.string}).isRequired,onFilterChange:c.a.func.isRequired};var S=k,D=n(14),C=n(27);class E extends r.Component{constructor(){super(...arguments),this.handleKeyDown=this.handleKeyDown.bind(this),this.select=this.select.bind(this),this.optionRefs={},this.listbox=Object(r.createRef)()}componentDidUpdate(e){const{options:t,selectedIndex:n}=this.props;Object(l.isEqual)(t,e.options)||(this.optionRefs={}),n!==e.selectedIndex&&this.scrollToOption(n)}getOptionRef(e){return this.optionRefs.hasOwnProperty(e)||(this.optionRefs[e]=Object(r.createRef)()),this.optionRefs[e]}select(e){const{onSelect:t}=this.props;e.isDisabled||t(e)}scrollToOption(e){const t=this.listbox.current;if(t.scrollHeight<=t.clientHeight)return;if(!this.optionRefs[e])return;const n=this.optionRefs[e].current,r=t.clientHeight+t.scrollTop,o=n.offsetTop+n.offsetHeight;o>r?t.scrollTop=o-t.clientHeight:n.offsetTop<t.scrollTop&&(t.scrollTop=n.offsetTop)}handleKeyDown(e){const{decrementSelectedIndex:t,incrementSelectedIndex:n,options:r,onSearch:o,selectedIndex:a,setExpanded:i}=this.props;if(0!==r.length)switch(e.keyCode){case C.UP:t(),e.preventDefault(),e.stopPropagation();break;case C.DOWN:n(),e.preventDefault(),e.stopPropagation();break;case C.ENTER:r[a]&&this.select(r[a]),e.preventDefault(),e.stopPropagation();break;case C.LEFT:case C.RIGHT:i(!1);break;case C.ESCAPE:return i(!1),void o(null);case C.TAB:r[a]&&this.select(r[a]),i(!1)}}toggleKeyEvents(e){const{node:t}=this.props;t[e?"addEventListener":"removeEventListener"]("keydown",this.handleKeyDown,!0)}componentDidMount(){const{selectedIndex:e}=this.props;e>-1&&this.scrollToOption(e),this.toggleKeyEvents(!0)}componentWillUnmount(){this.toggleKeyEvents(!1)}render(){const{instanceId:e,listboxId:t,options:n,selectedIndex:a,staticList:s}=this.props,c=i()("woocommerce-select-control__listbox",{"is-static":s});return Object(r.createElement)("div",{ref:this.listbox,id:t,role:"listbox",className:c,tabIndex:"-1"},n.map((t,n)=>Object(r.createElement)(o.Button,{ref:this.getOptionRef(n),key:t.key,id:`woocommerce-select-control__option-${e}-${t.key}`,role:"option","aria-selected":n===a,disabled:t.isDisabled,className:i()("woocommerce-select-control__option",{"is-selected":n===a}),onClick:()=>this.select(t),tabIndex:"-1"},t.label)))}}E.propTypes={instanceId:c.a.number,listboxId:c.a.string,node:c.a.instanceOf(Element).isRequired,onSelect:c.a.func,options:c.a.arrayOf(c.a.shape({isDisabled:c.a.bool,key:c.a.oneOfType([c.a.number,c.a.string]).isRequired,keywords:c.a.arrayOf(c.a.oneOfType([c.a.string,c.a.number])),label:c.a.oneOfType([c.a.string,c.a.object]),value:c.a.any})).isRequired,selectedIndex:c.a.number,staticList:c.a.bool};var j=E,F=n(116),P=n(8),M=Object(r.createElement)(P.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},Object(r.createElement)(P.Path,{d:"M12 21C16.9706 21 21 16.9706 21 12C21 7.02944 16.9706 3 12 3C7.02944 3 3 7.02944 3 12C3 16.9706 7.02944 21 12 21ZM15.5303 8.46967C15.8232 8.76256 15.8232 9.23744 15.5303 9.53033L13.0607 12L15.5303 14.4697C15.8232 14.7626 15.8232 15.2374 15.5303 15.5303C15.2374 15.8232 14.7626 15.8232 14.4697 15.5303L12 13.0607L9.53033 15.5303C9.23744 15.8232 8.76256 15.8232 8.46967 15.5303C8.17678 15.2374 8.17678 14.7626 8.46967 14.4697L10.9393 12L8.46967 9.53033C8.17678 9.23744 8.17678 8.76256 8.46967 8.46967C8.76256 8.17678 9.23744 8.17678 9.53033 8.46967L12 10.9393L14.4697 8.46967C14.7626 8.17678 15.2374 8.17678 15.5303 8.46967Z"})),x=n(28);const T=({id:e,instanceId:t,isVisible:n,label:a,popoverContents:s,remove:c,screenReaderLabel:l,setState:u,className:d})=>{if(l=l||a,!a)return null;a=Object(x.decodeEntities)(a);const f=i()("woocommerce-tag",d,{"has-remove":!!c}),p="woocommerce-tag__label-"+t,h=Object(r.createElement)(r.Fragment,null,Object(r.createElement)("span",{className:"screen-reader-text"},l),Object(r.createElement)("span",{"aria-hidden":"true"},a));return Object(r.createElement)("span",{className:f},s?Object(r.createElement)(o.Button,{className:"woocommerce-tag__text",id:p,onClick:()=>u(()=>({isVisible:!0}))},h):Object(r.createElement)("span",{className:"woocommerce-tag__text",id:p},h),s&&n&&Object(r.createElement)(o.Popover,{onClose:()=>u(()=>({isVisible:!1}))},s),c&&Object(r.createElement)(o.Button,{className:"woocommerce-tag__remove",onClick:c(e),label:Object(m.sprintf)(Object(m.__)("Remove %s",'woocommerce'),a),"aria-describedby":p},Object(r.createElement)(F.a,{icon:M,size:20,className:"clear-icon"})))};T.propTypes={id:c.a.oneOfType([c.a.number,c.a.string]),label:c.a.string.isRequired,popoverContents:c.a.node,remove:c.a.func,screenReaderLabel:c.a.string};var N=Object(D.withState)({isVisible:!1})(Object(D.withInstanceId)(T));class I extends r.Component{constructor(e){super(e),this.removeAll=this.removeAll.bind(this),this.removeResult=this.removeResult.bind(this)}removeAll(){const{onChange:e}=this.props;e([])}removeResult(e){return()=>{const{selected:t,onChange:n}=this.props,r=Object(l.findIndex)(t,{key:e});n([...t.slice(0,r),...t.slice(r+1)])}}render(){const{selected:e,showClearButton:t}=this.props;return e.length?Object(r.createElement)(r.Fragment,null,Object(r.createElement)("div",{className:"woocommerce-select-control__tags"},e.map((t,n)=>{if(!t.label)return null;const o=Object(m.sprintf)(Object(m.__)("%1$s (%2$s of %3$s)",'woocommerce'),t.label,n+1,e.length);return Object(r.createElement)(N,{key:t.key,id:t.key,label:t.label,remove:this.removeResult,screenReaderLabel:o})})),t&&Object(r.createElement)(o.Button,{className:"woocommerce-select-control__clear",isLink:!0,onClick:this.removeAll},Object(r.createElement)(F.a,{icon:M,className:"clear-icon"}),Object(r.createElement)("span",{className:"screen-reader-text"},Object(m.__)("Clear all",'woocommerce')))):null}}I.propTypes={onChange:c.a.func,onSelect:c.a.func,selected:c.a.arrayOf(c.a.shape({key:c.a.oneOfType([c.a.number,c.a.string]).isRequired,label:c.a.string})),showClearButton:c.a.bool};var R=I,A=Object(r.createElement)(P.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(r.createElement)(P.Path,{d:"M13.5 6C10.5 6 8 8.5 8 11.5c0 1.1.3 2.1.9 3l-3.4 3 1 1.1 3.4-2.9c1 .9 2.2 1.4 3.6 1.4 3 0 5.5-2.5 5.5-5.5C19 8.5 16.5 6 13.5 6zm0 9.5c-2.2 0-4-1.8-4-4s1.8-4 4-4 4 1.8 4 4-1.8 4-4 4z"}));class L extends r.Component{constructor(e){super(e),this.state={isActive:!1},this.input=Object(r.createRef)(),this.updateSearch=this.updateSearch.bind(this),this.onFocus=this.onFocus.bind(this),this.onBlur=this.onBlur.bind(this),this.onKeyDown=this.onKeyDown.bind(this)}updateSearch(e){return t=>{e(t.target.value)}}onFocus(e){const{isSearchable:t,setExpanded:n,showAllOnFocus:r,updateSearchOptions:o}=this.props;return a=>{this.setState({isActive:!0}),t&&r?(a.target.select(),o("")):t?e(a.target.value):n(!0)}}onBlur(){const{onBlur:e}=this.props;"function"==typeof e&&e(),this.setState({isActive:!1})}onKeyDown(e){const{decrementSelectedIndex:t,incrementSelectedIndex:n,selected:r,onChange:o,query:a,setExpanded:i}=this.props;C.BACKSPACE===e.keyCode&&!a&&r.length&&o([...r.slice(0,-1)]),C.DOWN===e.keyCode&&(n(),i(!0),e.preventDefault(),e.stopPropagation()),C.UP===e.keyCode&&(t(),i(!0),e.preventDefault(),e.stopPropagation())}renderButton(){const{multiple:e,selected:t}=this.props;return e||!t.length?null:Object(r.createElement)("div",{className:"woocommerce-select-control__control-value"},t[0].label)}renderInput(){const{activeId:e,disabled:t,hasTags:n,inlineTags:o,instanceId:a,isExpanded:i,isSearchable:s,listboxId:c,onSearch:l,placeholder:u,searchInputType:d,autoComplete:f}=this.props,{isActive:p}=this.state;return Object(r.createElement)("input",{autoComplete:f||"off",className:"woocommerce-select-control__control-input",id:`woocommerce-select-control-${a}__control-input`,ref:this.input,type:s?d:"button",value:this.getInputValue(),placeholder:p?u:"",onChange:this.updateSearch(l),onFocus:this.onFocus(l),onBlur:this.onBlur,onKeyDown:this.onKeyDown,role:"combobox","aria-autocomplete":"list","aria-expanded":i,"aria-haspopup":"true","aria-owns":c,"aria-controls":c,"aria-activedescendant":e,"aria-describedby":n&&o?"search-inline-input-"+a:null,disabled:t})}getInputValue(){const{inlineTags:e,isFocused:t,isSearchable:n,multiple:r,query:o,selected:a}=this.props,i=a.length?a[0].label:"";return r||t||e?n&&t&&o?o:"":i}render(){const{className:e,disabled:t,hasTags:n,help:o,inlineTags:a,instanceId:s,isSearchable:c,label:l,query:u}=this.props,{isActive:d}=this.state;return Object(r.createElement)("div",{className:i()("components-base-control","woocommerce-select-control__control",e,{empty:!u||0===u.length,"is-active":d,"has-tags":a&&n,"with-value":this.getInputValue().length,"has-error":!!o,"is-disabled":t}),onClick:()=>{this.input.current.focus()}},c&&Object(r.createElement)(F.a,{className:"woocommerce-select-control__control-icon",icon:A}),a&&Object(r.createElement)(R,Object.assign({},this.props)),Object(r.createElement)("div",{className:"components-base-control__field"},!!l&&Object(r.createElement)("label",{htmlFor:`woocommerce-select-control-${s}__control-input`,className:"components-base-control__label"},l),this.renderInput(),a&&Object(r.createElement)("span",{id:"search-inline-input-"+s,className:"screen-reader-text"},Object(m.__)("Move backward for selected items",'woocommerce')),!!o&&Object(r.createElement)("p",{id:`woocommerce-select-control-${s}__help`,className:"components-base-control__help"},o)))}}L.propTypes={hasTags:c.a.bool,help:c.a.oneOfType([c.a.string,c.a.node]),inlineTags:c.a.bool,isSearchable:c.a.bool,instanceId:c.a.number,label:c.a.string,listboxId:c.a.string,onBlur:c.a.func,onChange:c.a.func,onSearch:c.a.func,placeholder:c.a.string,query:c.a.string,selected:c.a.arrayOf(c.a.shape({key:c.a.oneOfType([c.a.number,c.a.string]).isRequired,label:c.a.string})),showAllOnFocus:c.a.bool,autoComplete:c.a.string};var U=L;const B={isExpanded:!1,isFocused:!1,query:""};class H extends r.Component{constructor(e){super(e);const{selected:t,options:n,excludeSelectedOptions:r}=e;this.state={...B,searchOptions:[],selectedIndex:t&&null!=n&&n.length&&!r?n.findIndex(e=>e.key===t):null},this.bindNode=this.bindNode.bind(this),this.decrementSelectedIndex=this.decrementSelectedIndex.bind(this),this.incrementSelectedIndex=this.incrementSelectedIndex.bind(this),this.onAutofillChange=this.onAutofillChange.bind(this),this.updateSearchOptions=Object(l.debounce)(this.updateSearchOptions.bind(this),e.searchDebounceTime),this.search=this.search.bind(this),this.selectOption=this.selectOption.bind(this),this.setExpanded=this.setExpanded.bind(this),this.setNewValue=this.setNewValue.bind(this)}bindNode(e){this.node=e}reset(e=this.getSelected()){const{multiple:t,excludeSelectedOptions:n}=this.props,r={...B};!t&&e.length&&e[0].key&&(r.selectedIndex=n?null:this.props.options.findIndex(t=>t.key===e[0].key)),this.setState(r)}handleFocusOutside(){this.reset()}hasMultiple(){const{multiple:e,selected:t}=this.props;return!!e&&(Array.isArray(t)?t.some(e=>Boolean(e.label)):Boolean(t))}getSelected(){const{multiple:e,options:t,selected:n}=this.props;if(e||Array.isArray(n))return n;const r=t.find(e=>e.key===n);return r?[r]:[]}selectOption(e){const{multiple:t,selected:n}=this.props,r=t?[...n,e]:[e];this.reset(r);-1===(Array.isArray(n)?n:[{key:n}]).findIndex(t=>t.key===e.key)&&this.setNewValue(r);const o=this.props.excludeSelectedOptions?null:this.getOptions().findIndex(t=>t.key===e.key);this.setState({selectedIndex:o})}setNewValue(e){const{onChange:t,selected:n,multiple:r}=this.props,{query:o}=this.state;r||Array.isArray(n)?t(e,o):t(e.length>0?e[0].key:"",o)}decrementSelectedIndex(){const{selectedIndex:e}=this.state,t=this.getOptions(),n=null!==e?(0===e?t.length:e)-1:t.length-1;this.setState({selectedIndex:n})}incrementSelectedIndex(){const{selectedIndex:e}=this.state,t=this.getOptions(),n=null!==e?(e+1)%t.length:0;this.setState({selectedIndex:n})}announce(e){const{debouncedSpeak:t}=this.props;t&&(e.length?t(Object(m.sprintf)(Object(m._n)("%d result found, use up and down arrow keys to navigate.","%d results found, use up and down arrow keys to navigate.",e.length,'woocommerce'),e.length),"assertive"):t(Object(m.__)("No results.",'woocommerce'),"assertive"))}getOptions(){const{isSearchable:e,options:t,excludeSelectedOptions:n}=this.props,{searchOptions:r}=this.state,o=this.getSelected().map(e=>e.key),a=e?r:t;return n?a.filter(e=>!o.includes(e.key)):a}getOptionsByQuery(e,t){const{getSearchExpression:n,maxResults:r,onFilter:o}=this.props,a=[],i=n(Object(l.escapeRegExp)(t?t.trim():"")),s=i?new RegExp(i,"i"):/^$/;for(let t=0;t<e.length;t++){const n=e[t];let{keywords:o=[]}=n;"string"==typeof n.label&&(o=[...o,n.label]);if(o.some(e=>s.test(e))&&(a.push(n),r&&a.length===r))break}return o(a,t)}setExpanded(e){this.setState({isExpanded:e})}search(e){const t=this.cacheSearchOptions||[],n=null===e||e.length||this.props.hideBeforeSearch?this.getOptionsByQuery(t,e):t;this.setState({query:e,isFocused:!0,searchOptions:n,selectedIndex:(null==e?void 0:e.length)>0?null:this.state.selectedIndex},()=>{this.setState({isExpanded:Boolean(this.getOptions().length)})}),this.updateSearchOptions(e)}updateSearchOptions(e){const{hideBeforeSearch:t,options:n,onSearch:r}=this.props,o=this.activePromise=Promise.resolve(r(n,e)).then(n=>{if(o!==this.activePromise)return;this.cacheSearchOptions=n;const r=null===e||e.length||t?this.getOptionsByQuery(n,e):n;this.setState({searchOptions:r,selectedIndex:(null==e?void 0:e.length)>0?null:this.state.selectedIndex},()=>{this.setState({isExpanded:Boolean(this.getOptions().length)}),this.announce(r)})})}onAutofillChange(e){const{options:t}=this.props,n=this.getOptionsByQuery(t,e.target.value);1===n.length&&this.selectOption(n[0])}render(){const{autofill:e,children:t,className:n,disabled:o,controlClassName:a,inlineTags:s,instanceId:c,isSearchable:l,options:u}=this.props,{isExpanded:d,isFocused:f,selectedIndex:p}=this.state,h=this.hasMultiple(),{key:m=""}=u[p]||{},b=d?"woocommerce-select-control__listbox-"+c:null,g=d?`woocommerce-select-control__option-${c}-${m}`:null;return Object(r.createElement)("div",{className:i()("woocommerce-select-control",n,{"has-inline-tags":h&&s,"is-focused":f,"is-searchable":l}),ref:this.bindNode},e&&Object(r.createElement)("input",{onChange:this.onAutofillChange,name:e,type:"text",className:"woocommerce-select-control__autofill-input",tabIndex:"-1"}),t,Object(r.createElement)(U,Object.assign({},this.props,this.state,{activeId:g,className:a,disabled:o,hasTags:h,isExpanded:d,listboxId:b,onSearch:this.search,selected:this.getSelected(),onChange:this.setNewValue,setExpanded:this.setExpanded,updateSearchOptions:this.updateSearchOptions,decrementSelectedIndex:this.decrementSelectedIndex,incrementSelectedIndex:this.incrementSelectedIndex})),!s&&h&&Object(r.createElement)(R,Object.assign({},this.props,{selected:this.getSelected()})),d&&Object(r.createElement)(j,Object.assign({},this.props,this.state,{activeId:g,listboxId:b,node:this.node,onSelect:this.selectOption,onSearch:this.search,options:this.getOptions(),decrementSelectedIndex:this.decrementSelectedIndex,incrementSelectedIndex:this.incrementSelectedIndex,setExpanded:this.setExpanded})))}}H.propTypes={autofill:c.a.string,children:c.a.node,className:c.a.string,controlClassName:c.a.string,disabled:c.a.bool,excludeSelectedOptions:c.a.bool,onFilter:c.a.func,getSearchExpression:c.a.func,help:c.a.oneOfType([c.a.string,c.a.node]),inlineTags:c.a.bool,isSearchable:c.a.bool,label:c.a.string,onChange:c.a.func,onSearch:c.a.func,options:c.a.arrayOf(c.a.shape({isDisabled:c.a.bool,key:c.a.oneOfType([c.a.number,c.a.string]).isRequired,keywords:c.a.arrayOf(c.a.oneOfType([c.a.string,c.a.number])),label:c.a.oneOfType([c.a.string,c.a.object]),value:c.a.any})).isRequired,placeholder:c.a.string,searchDebounceTime:c.a.number,selected:c.a.oneOfType([c.a.string,c.a.arrayOf(c.a.shape({key:c.a.oneOfType([c.a.number,c.a.string]).isRequired,label:c.a.string}))]),maxResults:c.a.number,multiple:c.a.bool,showClearButton:c.a.bool,searchInputType:c.a.oneOf(["text","search","number","email","tel","url"]),hideBeforeSearch:c.a.bool,showAllOnFocus:c.a.bool,staticList:c.a.bool,autoComplete:c.a.string},H.defaultProps={autofill:null,excludeSelectedOptions:!0,getSearchExpression:l.identity,inlineTags:!1,isSearchable:!1,onChange:l.noop,onFilter:l.identity,onSearch:e=>Promise.resolve(e),maxResults:0,multiple:!1,searchDebounceTime:0,searchInputType:"search",selected:[],showAllOnFocus:!1,showClearButton:!1,hideBeforeSearch:!1,staticList:!1,autoComplete:"off"};var K=Object(D.compose)([o.withSpokenMessages,D.withInstanceId,o.withFocusOutside])(H),z=n(15),q=n(17),V=n.n(q);function W(e,t){if(!t)return null;const n=e.toLocaleLowerCase().indexOf(t.toLocaleLowerCase());return{suggestionBeforeMatch:Object(x.decodeEntities)(e.substring(0,n)),suggestionMatch:Object(x.decodeEntities)(e.substring(n,n+t.length)),suggestionAfterMatch:Object(x.decodeEntities)(e.substring(n+t.length))}}function G(e){return[e.country,e.state,e.name||Object(m.__)("TAX",'woocommerce'),e.priority].filter(Boolean).map(e=>e.toString().toUpperCase().trim()).join("-")}var Y={name:"attributes",className:"woocommerce-search__product-result",options(e){const t=e?{search:e,per_page:10,orderby:"count"}:{};return V()({path:Object(z.addQueryArgs)("/wc-analytics/products/attributes",t)})},isDebounced:!0,getOptionIdentifier:e=>e.id,getOptionKeywords:e=>[e.name],getFreeTextOptions:e=>[{key:"name",label:Object(r.createElement)("span",{key:"name",className:"woocommerce-search__result-name"},v()({mixedString:Object(m.__)("All attributes with names that include {{query /}}",'woocommerce'),components:{query:Object(r.createElement)("strong",{className:"components-form-token-field__suggestion-match"},e)}})),value:{id:e,name:e}}],getOptionLabel(e,t){const n=W(e.name,t)||{};return Object(r.createElement)("span",{key:"name",className:"woocommerce-search__result-name","aria-label":e.name},n.suggestionBeforeMatch,Object(r.createElement)("strong",{className:"components-form-token-field__suggestion-match"},n.suggestionMatch),n.suggestionAfterMatch)},getOptionCompletion:e=>({key:e.id,label:e.name})},$={name:"categories",className:"woocommerce-search__product-result",options(e){const t=e?{search:e,per_page:10,orderby:"count"}:{};return V()({path:Object(z.addQueryArgs)("/wc-analytics/products/categories",t)})},isDebounced:!0,getOptionIdentifier:e=>e.id,getOptionKeywords:e=>[e.name],getFreeTextOptions:e=>[{key:"title",label:Object(r.createElement)("span",{key:"name",className:"woocommerce-search__result-name"},v()({mixedString:Object(m.__)("All categories with titles that include {{query /}}",'woocommerce'),components:{query:Object(r.createElement)("strong",{className:"components-form-token-field__suggestion-match"},e)}})),value:{id:e,name:e}}],getOptionLabel(e,t){const n=W(e.name,t)||{};return Object(r.createElement)("span",{key:"name",className:"woocommerce-search__result-name","aria-label":e.name},n.suggestionBeforeMatch,Object(r.createElement)("strong",{className:"components-form-token-field__suggestion-match"},n.suggestionMatch),n.suggestionAfterMatch)},getOptionCompletion:e=>({key:e.id,label:e.name})},Q=n(261),Z=n.n(Q);const X=({code:e,order:t,className:n,size:o,hideFromScreenReader:a})=>{const s=i()("woocommerce-flag",n);let c=e||"unknown";t&&t.shipping&&t.shipping.country?c=t.shipping.country:t&&t.billing&&t.billing.country&&(c=t.billing.country);const u={fontSize:o},d=Object(l.get)(Z.a.countryCode(c),"emoji");return Object(r.createElement)("div",{className:s,style:u,"aria-hidden":a},d&&Object(r.createElement)("span",null,d),!d&&Object(r.createElement)("span",{className:"woocommerce-flag__fallback"},"Invalid country flag"))};X.propTypes={code:c.a.string,order:c.a.object,className:c.a.string,size:c.a.number};var J=X;let ee=null;var te={name:"countries",className:"woocommerce-search__country-result",isDebounced:!0,options:()=>ee?Promise.resolve(ee):V()({path:"/wc-analytics/data/countries"}).then(e=>(ee=e,ee)),getOptionIdentifier:e=>e.code,getSearchExpression:e=>"^"+e,getOptionKeywords:e=>[e.code,Object(x.decodeEntities)(e.name)],getOptionLabel(e,t){const n=Object(x.decodeEntities)(e.name),o=W(n,t)||{};return Object(r.createElement)(r.Fragment,null,Object(r.createElement)(J,{key:"thumbnail",className:"woocommerce-search__result-thumbnail",code:e.code,size:18,hideFromScreenReader:!0}),Object(r.createElement)("span",{key:"name",className:"woocommerce-search__result-name","aria-label":n},t?Object(r.createElement)(r.Fragment,null,o.suggestionBeforeMatch,Object(r.createElement)("strong",{className:"components-form-token-field__suggestion-match"},o.suggestionMatch),o.suggestionAfterMatch):n))},getOptionCompletion:e=>({key:e.code,label:Object(x.decodeEntities)(e.name)})},ne={name:"coupons",className:"woocommerce-search__coupon-result",options(e){const t=e?{search:e,per_page:10}:{};return V()({path:Object(z.addQueryArgs)("/wc-analytics/coupons",t)})},isDebounced:!0,getOptionIdentifier:e=>e.id,getOptionKeywords:e=>[e.code],getFreeTextOptions:e=>[{key:"code",label:Object(r.createElement)("span",{key:"name",className:"woocommerce-search__result-name"},v()({mixedString:Object(m.__)("All coupons with codes that include {{query /}}",'woocommerce'),components:{query:Object(r.createElement)("strong",{className:"components-form-token-field__suggestion-match"},e)}})),value:{id:e,code:e}}],getOptionLabel(e,t){const n=W(e.code,t)||{};return Object(r.createElement)("span",{key:"name",className:"woocommerce-search__result-name","aria-label":e.code},n.suggestionBeforeMatch,Object(r.createElement)("strong",{className:"components-form-token-field__suggestion-match"},n.suggestionMatch),n.suggestionAfterMatch)},getOptionCompletion:e=>({key:e.id,label:e.code})},re={name:"customers",className:"woocommerce-search__customers-result",options(e){const t=e?{search:e,searchby:"name",per_page:10}:{};return V()({path:Object(z.addQueryArgs)("/wc-analytics/customers",t)})},isDebounced:!0,getOptionIdentifier:e=>e.id,getOptionKeywords:e=>[e.name],getFreeTextOptions:e=>[{key:"name",label:Object(r.createElement)("span",{key:"name",className:"woocommerce-search__result-name"},v()({mixedString:Object(m.__)("All customers with names that include {{query /}}",'woocommerce'),components:{query:Object(r.createElement)("strong",{className:"components-form-token-field__suggestion-match"},e)}})),value:{id:e,name:e}}],getOptionLabel(e,t){const n=W(e.name,t)||{};return Object(r.createElement)("span",{key:"name",className:"woocommerce-search__result-name","aria-label":e.name},n.suggestionBeforeMatch,Object(r.createElement)("strong",{className:"components-form-token-field__suggestion-match"},n.suggestionMatch),n.suggestionAfterMatch)},getOptionCompletion:e=>({key:e.id,label:e.name})},oe={name:"download-ips",className:"woocommerce-search__download-ip-result",options(e){const t=e?{match:e}:{};return V()({path:Object(z.addQueryArgs)("/wc-analytics/data/download-ips",t)})},isDebounced:!0,getOptionIdentifier:e=>e.user_ip_address,getOptionKeywords:e=>[e.user_ip_address],getOptionLabel(e,t){const n=W(e.user_ip_address,t)||{};return Object(r.createElement)("span",{key:"name",className:"woocommerce-search__result-name","aria-label":e.user_ip_address},n.suggestionBeforeMatch,Object(r.createElement)("strong",{className:"components-form-token-field__suggestion-match"},n.suggestionMatch),n.suggestionAfterMatch)},getOptionCompletion:e=>({key:e.user_ip_address,label:e.user_ip_address})},ae={name:"emails",className:"woocommerce-search__emails-result",options(e){const t=e?{search:e,searchby:"email",per_page:10}:{};return V()({path:Object(z.addQueryArgs)("/wc-analytics/customers",t)})},isDebounced:!0,getOptionIdentifier:e=>e.id,getOptionKeywords:e=>[e.email],getOptionLabel(e,t){const n=W(e.email,t)||{};return Object(r.createElement)("span",{key:"name",className:"woocommerce-search__result-name","aria-label":e.email},n.suggestionBeforeMatch,Object(r.createElement)("strong",{className:"components-form-token-field__suggestion-match"},n.suggestionMatch),n.suggestionAfterMatch)},getOptionCompletion:e=>({key:e.id,label:e.email})},ie={name:"orders",className:"woocommerce-search__order-result",options(e){const t=e?{number:e,per_page:10}:{};return V()({path:Object(z.addQueryArgs)("/wc-analytics/orders",t)})},isDebounced:!0,getOptionIdentifier:e=>e.id,getOptionKeywords:e=>["#"+e.number],getOptionLabel(e,t){const n=W("#"+e.number,t)||{};return Object(r.createElement)("span",{key:"name",className:"woocommerce-search__result-name","aria-label":"#"+e.number},n.suggestionBeforeMatch,Object(r.createElement)("strong",{className:"components-form-token-field__suggestion-match"},n.suggestionMatch),n.suggestionAfterMatch)},getOptionCompletion:e=>({key:e.id,label:"#"+e.number})};const se=({product:e,alt:t,width:n,height:o,className:a,...s})=>{const c=Object(l.get)(e,["images",0])||Object(l.get)(e,["image"]),u=c&&c.src||!1,d=t||c&&c.alt||"",f=i()("woocommerce-product-image",a,{"is-placeholder":!u});return Object(r.createElement)("img",Object.assign({className:f,src:u||"data:image/svg+xml;utf8,%3Csvg width='421' height='421' xmlns='http://www.w3.org/2000/svg' xmlns:svg='http://www.w3.org/2000/svg'%3E%3Cstyle type='text/css'%3E.st0%7Bfill:url(%23SVGID_1_);stroke:%23717275;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10%7D .st1%7Bfill:%23FFFFFF;%7D .st2%7Bfill:%23717275;%7D .st3%7Bfill:%23DCDDE0;stroke:%23717275;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;%7D%3C/style%3E%3CradialGradient cx='105.8248' cy='287.7805' gradientUnits='userSpaceOnUse' id='SVGID_1_' r='372.6935'%3E%3Cstop offset='0.2613' stop-color='%23DCDDE0'/%3E%3Cstop offset='0.633' stop-color='%23D8DADD'/%3E%3Cstop offset='0.9665' stop-color='%23CECFD3'/%3E%3Cstop offset='1' stop-color='%23CCCED2'/%3E%3C/radialGradient%3E%3Cg class='layer' display='inline'%3E%3Ctitle%3ELayer 2%3C/title%3E%3Crect fill='%23ffffff' height='417.99996' id='svg_7' stroke-dasharray='null' stroke-linecap='null' stroke-linejoin='null' stroke-width='null' width='417.99996' x='1.50002' y='1.5'/%3E%3C/g%3E%3Cg class='layer' display='inline'%3E%3Ctitle%3ELayer 1%3C/title%3E%3Cg id='svg_2'/%3E%3Cg id='svg_6'%3E%3Cpath class='st0' d='m330.44409,336.12693c-0.12194,0.36582 0,0.67068 0.30485,0.79262c1.40232,-0.79262 3.17047,-1.0365 4.63377,-0.48776c0.67068,-1.46329 0.12194,-2.43882 0.06097,-3.90212c-0.91456,-15.66945 -0.73165,-31.9486 -0.73165,-47.73998c0,-16.34012 -0.30485,-32.74121 0.54874,-48.9594c0.79262,-15.9743 1.89009,-31.5218 1.28038,-47.55707c-0.60971,-15.79139 -0.06097,-31.70471 0.73165,-47.37416c0.36582,-8.04812 0.79262,-15.66945 0.36582,-23.77854c-0.48776,-9.08462 -0.36582,-21.88845 -0.36582,-30.97307c0,-1.0365 0.18291,-1.82912 -0.79262,-2.43882c-0.79262,-0.48776 -1.52427,-0.42679 -2.43882,-0.42679c-2.49979,0 -4.87765,-0.36582 -7.37744,-0.36582c-1.52427,0 -2.86562,0 -4.32891,0.30485c-0.79262,0.12194 -1.52427,0.06097 -2.31688,0.06097c-0.85359,0 -1.52427,0.18291 -2.31688,0.36582c-6.88968,1.15844 -15.73042,2.49979 -22.62009,1.76815c-6.88968,-0.73165 -13.71839,-0.67068 -20.54709,-2.01203c-6.46288,-1.28038 -12.92577,-0.42679 -19.38865,-0.42679c-4.146,0 -8.23103,0 -12.37703,0c-3.96309,0 -7.80424,-0.73165 -11.8283,-0.73165c-6.52385,0.06097 -13.10868,0.12194 -19.63253,0.36582c-4.51182,0.18291 -8.84074,0 -13.35256,0.42679c-6.82871,0.60971 -13.77936,1.09747 -20.66903,1.0365c-3.59727,0 -7.07259,0.24388 -10.60889,-0.42679c-3.17047,-0.60971 -6.58483,-0.12194 -9.7553,0.18291c-3.96309,0.36582 -7.86521,1.0365 -11.8283,1.0365c-3.84115,-0.06097 -7.74327,-0.85359 -11.58441,-0.85359c-4.38988,-0.12194 -8.59686,0.42679 -12.98674,0.12194c-5.36541,-0.36582 -10.60889,-0.06097 -15.91333,-0.12194c-0.91456,0 -1.34135,0.24388 -2.13397,0.36582c-0.79262,0.12194 -1.40232,0.36582 -2.19494,0.36582c-0.85359,0 -1.34135,-0.30485 -2.13397,-0.36582c-1.64621,-0.18291 -5.91415,-0.06097 -7.49938,-0.48776c-1.70718,-0.42679 -3.41435,-0.91456 -5.12153,-1.34135c-1.40232,1.34135 -1.52427,3.5363 -1.64621,5.48735c-0.85359,21.58359 -0.73165,43.16719 -0.60971,64.75078c0,4.99959 0.06097,9.99918 0.60971,14.9378c0.42679,3.84115 1.15844,7.6823 1.46329,11.52344c0.48776,6.219 -0.06097,12.49897 -0.36582,18.71798c-0.36582,7.31647 -0.36582,14.63295 0.06097,21.94942c0.97553,18.90089 -0.48776,40.30157 -0.79262,59.20246c-0.36582,18.41312 -0.67068,37.1311 3.90212,54.99549c4.63377,-1.82912 17.13274,1.15844 22.55912,1.40232c5.85318,0.24388 11.8283,0.30485 17.74245,0.30485c6.76774,0 13.59644,-0.36582 20.30321,0c8.47491,0.42679 16.09624,2.31688 24.63212,1.82912c4.146,-0.24388 8.65783,0.36582 12.68189,0.36582c3.29241,0 9.87724,-1.09747 12.25509,0.73165c8.77977,0 20.18127,0.12194 28.90007,-0.73165c9.08462,-0.85359 19.38865,-1.21941 28.47327,-0.36582c7.37744,0.73165 14.45003,1.34135 21.82748,0.36582c4.63377,-0.60971 9.14559,-1.09747 13.9013,-1.09747c4.32891,0 8.292,-1.58524 12.49897,-1.46329c4.63377,0.12194 9.38947,1.40232 14.02324,1.89009c3.04853,0.30485 9.63336,-2.49979 12.49897,-1.21941l-0.00003,-0.00001z' fill='black' id='svg_1'/%3E%3Cpath class='st1' d='m313.79912,275.40021c-1.09747,0 -3.90212,-4.20697 -4.99959,-5.85318c-0.42679,-0.67068 -0.79262,-1.21941 -1.0365,-1.52427c-1.76815,-2.25591 -4.02406,-4.51182 -6.219,-6.6458c-0.67068,-0.67068 -1.40232,-1.40232 -2.073,-2.073c-3.5363,-3.59727 -9.02365,-7.98715 -13.16965,-9.51141c-1.40232,-0.48776 -2.56077,-1.21941 -3.71921,-1.82912c-2.19494,-1.28038 -4.20697,-2.43882 -7.49938,-2.49979c-0.30485,0 -0.67068,0 -0.97553,0c-3.78018,0 -7.49938,0.48776 -11.34053,1.09747c-7.19453,1.09747 -16.82789,7.49938 -21.52262,14.32809c-0.73165,1.09747 -1.15844,2.31688 -1.21941,3.5363c-2.31688,-0.54874 -5.6093,-3.17047 -7.62133,-4.75571c-0.30485,-0.24388 -0.60971,-0.48776 -0.85359,-0.67068c-2.74368,-2.13397 -4.75571,-4.5728 -6.95065,-7.2555c-1.28038,-1.52427 -2.62174,-3.1095 -4.08503,-4.63377c-7.92618,-8.17006 -16.88886,-15.48653 -25.54668,-22.55912c-4.51182,-3.65824 -9.14559,-7.43841 -13.59644,-11.27956c-5.79221,-4.99959 -10.365,-9.81627 -14.45003,-15.12071c-0.42679,-0.54874 -0.85359,-1.09747 -1.21941,-1.64621c-1.58524,-2.13397 -3.23144,-4.26794 -5.12153,-6.15803c-0.67068,-0.67068 -2.31688,-1.89009 -4.20697,-3.23144c-2.98756,-2.19494 -7.56035,-5.48735 -7.92618,-6.70677c-0.42679,-1.40232 -3.5363,-3.5363 -3.59727,-3.5363c-0.85359,-0.48776 -1.76815,-1.40232 -1.82912,-2.62174l-0.06097,-0.85359l-0.79262,0.36582c-2.86562,1.34135 -4.93862,3.41435 -7.07259,5.6093c-0.36582,0.36582 -0.67068,0.73165 -1.0365,1.0365c-5.67027,5.73124 -11.15762,11.64539 -16.27915,17.49856c-2.49979,2.86562 -5.12153,6.03609 -7.31647,9.38947c-0.60971,0.91456 -1.15844,2.01203 -1.70718,3.17047c-0.91456,1.89009 -1.89009,3.84115 -3.04853,4.99959c-0.36582,-0.54874 -0.73165,-1.64621 -0.91456,-2.13397c-0.06097,-0.18291 -0.12194,-0.42679 -0.18291,-0.54874c-1.28038,-3.17047 -0.79262,-6.52385 -0.30485,-10.06015c0.36582,-2.49979 0.73165,-4.99959 0.48776,-7.62133c-0.12194,-0.97553 -0.30485,-2.01203 -0.48776,-3.04853c-0.60971,-3.47532 -1.21941,-7.01162 -0.73165,-10.24306c1.21941,-9.63336 2.43882,-19.51059 3.04853,-29.32686c0.97553,-9.69433 0.42679,-18.83992 -0.18291,-28.53424c-0.12194,-2.43882 -0.30485,-4.99959 -0.42679,-7.49938c0,-1.0365 -0.06097,-2.13397 -0.06097,-3.17047c-0.12194,-3.17047 -0.24388,-6.219 0.60971,-9.20656c0.18291,-0.12194 0.48776,-0.30485 0.85359,-0.36582l2.37785,1.0365c2.25591,0.91456 5.1825,1.40232 8.90171,1.40232c3.41435,0 7.01162,-0.36582 10.54791,-0.73165c3.23144,-0.30485 6.34094,-0.60971 9.02365,-0.60971c0.67068,0 1.28038,0 1.89009,0.06097c1.52427,0.12194 3.04853,0.30485 4.51182,0.48776c2.13397,0.24388 4.38988,0.54874 6.58483,0.54874c0.54874,0 1.09747,0 1.58524,0c3.90212,0 7.92618,-0.18291 11.76733,-0.36582c3.17047,-0.12194 6.46288,-0.30485 9.69433,-0.36582c5.48735,-0.06097 11.09665,-0.36582 16.46206,-0.60971c2.25591,-0.12194 4.45085,-0.24388 6.70677,-0.30485c4.38988,-0.18291 8.90171,-0.18291 13.23062,-0.18291c3.1095,0 6.34094,0 9.57238,-0.06097c6.6458,-0.18291 13.35256,-0.54874 19.81545,-0.97553c6.88968,-0.42679 14.08421,-0.85359 21.09583,-0.97553c1.76815,-0.06097 3.5363,-0.06097 5.24347,-0.06097c3.84115,-0.06097 7.80424,-0.06097 11.76733,-0.30485c2.25591,-0.12194 4.5728,-0.36582 6.82871,-0.54874c3.78018,-0.36582 7.74327,-0.67068 11.58441,-0.67068c1.40232,0 2.74368,0.06097 4.02406,0.12194c1.89009,0.12194 3.78018,0.48776 5.79221,0.85359c2.62174,0.48776 5.30444,0.91456 7.92618,0.91456c0.67068,0 1.34135,-0.06097 1.95106,-0.12194c-0.73165,1.40232 -0.73165,3.17047 -0.67068,4.08503c0.12194,2.31688 0.12194,4.81668 0.12194,7.19453c0,9.38947 -0.97553,18.29118 -2.01203,27.74163c-0.36582,3.23144 -0.73165,6.6458 -1.0365,9.99918c-0.60971,13.65742 0,28.10745 0.60971,40.8503l0,4.63377c0.30485,4.146 0,8.23103 -0.30485,12.13315c-0.30485,3.90212 -0.60971,7.92618 -0.30485,11.95024c1.28038,12.07218 1.82912,23.71757 1.64621,34.6313l0.42679,10.60889l0.06097,0.06097c0.48776,1.34135 0.97553,6.95065 -0.24388,8.77977c-0.36582,0.42679 -0.60971,0.48776 -0.79262,0.48776l0,0l-0.00004,0.00002z' id='svg_3'/%3E%3Cpath class='st2' d='m296.54444,101.02428c1.40232,0 2.68271,0.06097 3.96309,0.12194c1.82912,0.12194 3.71921,0.48776 5.73124,0.79262c2.62174,0.48776 5.36541,0.97553 8.04812,0.97553c0.36582,0 0.67068,0 1.0365,0c-0.36582,1.21941 -0.36582,2.49979 -0.36582,3.41435c0.12194,2.31688 0.12194,4.75571 0.12194,7.13356c0,9.38947 -0.97553,18.29118 -2.01203,27.68065c-0.36582,3.29241 -0.73165,6.6458 -1.0365,9.99918l0,0l0,0c-0.60971,13.59644 0,28.10745 0.60971,40.8503l0,4.63377l0,0.06097l0,0.06097c0.30485,4.02406 0,8.10909 -0.30485,12.01121c-0.30485,3.90212 -0.60971,7.98715 -0.30485,12.01121l0,0l0,0c1.28038,12.01121 1.82912,23.65659 1.64621,34.50936l0,0.06097l0,0.06097l0.42679,10.48694l0,0.18291l0.06097,0.18291c0.48776,1.34135 0.85359,6.70677 -0.18291,8.292c-0.06097,0.06097 -0.12194,0.18291 -0.18291,0.18291c-1.0365,-0.36582 -3.65824,-4.26794 -4.51182,-5.54833c-0.48776,-0.67068 -0.79262,-1.21941 -1.09747,-1.58524c-1.82912,-2.31688 -4.08503,-4.51182 -6.219,-6.70677c-0.67068,-0.67068 -1.40232,-1.34135 -2.073,-2.073c-3.59727,-3.65824 -9.14559,-8.04812 -13.41353,-9.63336c-1.34135,-0.48776 -2.49979,-1.15844 -3.59727,-1.82912c-2.13397,-1.21941 -4.32891,-2.49979 -7.80424,-2.62174c-0.30485,0 -0.67068,0 -0.97553,0c-3.84115,0 -7.56035,0.48776 -11.46247,1.09747c-7.37744,1.09747 -17.19371,7.62133 -21.94942,14.57197c-0.67068,0.97553 -1.09747,2.01203 -1.28038,3.1095c-2.13397,-0.79262 -4.93862,-3.04853 -6.70677,-4.45085c-0.30485,-0.24388 -0.60971,-0.48776 -0.85359,-0.67068c-2.68271,-2.073 -4.69474,-4.51182 -6.88968,-7.13356c-1.28038,-1.52427 -2.62174,-3.1095 -4.08503,-4.69474c-7.92618,-8.17006 -16.88886,-15.48653 -25.60765,-22.55912c-4.51182,-3.65824 -9.14559,-7.43841 -13.53547,-11.27956c-5.73124,-4.99959 -10.30403,-9.7553 -14.38906,-15.05974c-0.42679,-0.54874 -0.85359,-1.09747 -1.21941,-1.64621c-1.58524,-2.13397 -3.29241,-4.32891 -5.1825,-6.219c-0.73165,-0.73165 -2.31688,-1.89009 -4.26794,-3.29241c-2.37785,-1.70718 -7.31647,-5.30444 -7.6823,-6.40191c-0.48776,-1.70718 -3.84115,-3.90212 -3.84115,-3.90212c-0.67068,-0.42679 -1.46329,-1.15844 -1.52427,-2.13397l-0.12194,-1.70718l-1.58524,0.73165c-2.98756,1.34135 -5.1825,3.59727 -7.2555,5.73124c-0.36582,0.36582 -0.67068,0.73165 -1.0365,1.0365c-5.67027,5.73124 -11.15762,11.64539 -16.27915,17.49856c-2.56077,2.92659 -5.1825,6.09706 -7.37744,9.45044c-0.60971,0.91456 -1.15844,2.073 -1.76815,3.29241c-0.73165,1.46329 -1.46329,3.04853 -2.37785,4.146c-0.18291,-0.48776 -0.42679,-0.97553 -0.48776,-1.28038c-0.06097,-0.24388 -0.18291,-0.42679 -0.24388,-0.54874c-1.21941,-2.98756 -0.79262,-6.27997 -0.24388,-9.69433c0.36582,-2.49979 0.73165,-5.12153 0.48776,-7.74327l0,0l0,0c-0.12194,-0.97553 -0.30485,-1.95106 -0.48776,-2.98756c-0.60971,-3.41435 -1.15844,-6.95065 -0.73165,-10.06015c1.21941,-9.63336 2.43882,-19.51059 3.04853,-29.32686c0.97553,-9.7553 0.42679,-18.90089 -0.18291,-28.65618c-0.12194,-2.43882 -0.30485,-4.93862 -0.42679,-7.43841c0,-1.09747 -0.06097,-2.13397 -0.06097,-3.23144c-0.12194,-3.04853 -0.18291,-5.97512 0.54874,-8.84074c0.06097,-0.06097 0.18291,-0.06097 0.24388,-0.12194l2.25591,0.97553c2.31688,0.97553 5.30444,1.46329 9.14559,1.46329c3.41435,0 7.07259,-0.36582 10.60889,-0.73165c3.23144,-0.30485 6.27997,-0.60971 8.96268,-0.60971c0.67068,0 1.28038,0 1.82912,0.06097c1.46329,0.12194 2.98756,0.30485 4.45085,0.42679c2.19494,0.24388 4.38988,0.54874 6.6458,0.54874c0.54874,0 1.09747,0 1.58524,0c3.96309,0 7.92618,-0.18291 11.76733,-0.36582c3.17047,-0.12194 6.46288,-0.30485 9.69433,-0.36582c5.48735,-0.06097 11.09665,-0.36582 16.46206,-0.60971c2.25591,-0.12194 4.45085,-0.24388 6.70677,-0.30485c4.38988,-0.18291 8.84074,-0.18291 13.16965,-0.18291c3.1095,0 6.40191,0 9.57238,-0.06097c6.6458,-0.18291 13.35256,-0.54874 19.87642,-0.97553c6.88968,-0.42679 14.02324,-0.85359 21.09583,-0.97553c1.76815,-0.06097 3.5363,-0.06097 5.24347,-0.06097c3.84115,-0.06097 7.86521,-0.06097 11.76733,-0.30485c2.31688,-0.12194 4.63377,-0.36582 6.88968,-0.54874c3.78018,-0.30485 7.74327,-0.67068 11.52344,-0.67068l0,0m0,-1.21941c-6.15803,0 -12.31606,0.85359 -18.47409,1.21941c-5.67027,0.30485 -11.34053,0.24388 -16.94983,0.36582c-13.65742,0.24388 -27.25386,1.58524 -40.97225,1.95106c-7.62133,0.18291 -15.18168,-0.06097 -22.80301,0.30485c-7.74327,0.30485 -15.42556,0.79262 -23.16883,0.91456c-7.13356,0.12194 -14.26712,0.73165 -21.46165,0.73165c-0.54874,0 -1.0365,0 -1.58524,0c-3.71921,-0.06097 -7.37744,-0.73165 -11.03568,-1.0365c-0.60971,-0.06097 -1.21941,-0.06097 -1.89009,-0.06097c-5.6093,0 -13.04771,1.34135 -19.51059,1.34135c-3.23144,0 -6.27997,-0.30485 -8.7188,-1.34135l-2.49979,-1.09747c-0.91456,0 -1.52427,0.60971 -1.52427,0.60971c-1.21941,4.26794 -0.60971,8.53588 -0.60971,12.80383c0.60971,12.19412 1.82912,23.77854 0.60971,35.97266c-0.60971,9.7553 -1.82912,19.51059 -3.04853,29.26589c-0.60971,4.26794 0.60971,9.14559 1.21941,13.41353c0.60971,6.09706 -2.43882,12.19412 -0.12194,17.80342c0.30485,0.73165 0.97553,2.80465 1.64621,3.29241c2.31688,-1.70718 3.65824,-6.15803 5.30444,-8.7188c2.13397,-3.29241 4.75571,-6.46288 7.2555,-9.3285c5.24347,-5.97512 10.66986,-11.8283 16.21818,-17.43759c2.49979,-2.49979 4.69474,-5.06056 7.92618,-6.58483c0.12194,1.34135 1.0365,2.43882 2.13397,3.1095c0.24388,0.12194 2.98756,2.073 3.29241,3.17047c0.60971,2.19494 10.42597,8.35297 12.25509,10.24306c2.37785,2.37785 4.32891,5.12153 6.34094,7.74327c4.38988,5.67027 9.14559,10.54791 14.57197,15.24265c12.98674,11.27956 27.07095,21.40068 39.08216,33.77771c3.90212,4.02406 6.6458,8.47491 11.09665,11.88927c2.31688,1.82912 6.6458,5.48735 9.51141,5.67027c-0.12194,-1.40232 0.36582,-2.74368 1.15844,-3.90212c4.32891,-6.34094 13.65742,-12.92577 21.09583,-14.08421c3.65824,-0.54874 7.49938,-1.09747 11.27956,-1.09747c0.30485,0 0.60971,0 0.97553,0c4.81668,0.12194 6.95065,2.80465 10.97471,4.32891c4.26794,1.58524 9.69433,6.03609 12.98674,9.38947c2.74368,2.80465 5.85318,5.67027 8.17006,8.65783c0.97553,1.28038 4.63377,7.56035 6.52385,7.56035c0,0 0.06097,0 0.06097,0c2.74368,-0.18291 2.073,-8.41394 1.46329,-10.12112l-0.42679,-10.48694c0.18291,-11.52344 -0.42679,-23.10786 -1.64621,-34.69227c-0.60971,-7.92618 1.21941,-15.85236 0.60971,-24.02242l0,-4.69474c-0.60971,-13.35256 -1.21941,-27.3758 -0.60971,-40.78933c1.21941,-12.80383 3.04853,-24.99795 3.04853,-37.80177c0,-2.43882 0,-4.87765 -0.12194,-7.19453c-0.06097,-1.58524 0.12194,-3.84115 1.52427,-4.87765c-1.09747,0.24388 -2.25591,0.30485 -3.41435,0.30485c-4.5728,0 -9.26753,-1.46329 -13.65742,-1.76815c-1.34135,0.12194 -2.68271,0.06097 -4.08503,0.06097l0,0l0.00003,0zm22.80301,1.09747c-0.67068,0 -1.21941,0.18291 -1.64621,0.48776c0.60971,-0.12194 1.21941,-0.30485 1.82912,-0.48776c-0.06097,0 -0.12194,0 -0.18291,0l0,0z' id='svg_4'/%3E%3Cpath class='st3' d='m235.75674,146.69126c-3.1095,3.41435 -4.38988,9.81627 -4.81668,14.20615c-0.60971,6.03609 -1.46329,10.97471 2.74368,15.66945c4.63377,5.12153 12.55994,9.87724 19.20574,11.64539c3.47532,0.97553 7.49938,-0.73165 10.7918,-1.40232c7.92618,-1.70718 11.95024,-6.52385 15.42556,-13.9013c4.20697,-8.77977 0.67068,-15.73042 -2.86562,-23.96145c-3.84115,-8.90171 -15.5475,-12.92577 -24.81504,-11.70636c-3.78018,0.48776 -5.91415,2.80465 -8.90171,4.87765c-1.64621,1.15844 -6.52385,2.80465 -6.76774,4.5728l0.00001,-0.00001z' id='svg_5'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E",width:n,height:o,alt:d},s))};se.propTypes={width:c.a.number,height:c.a.number,className:c.a.string,product:c.a.object,alt:c.a.string},se.defaultProps={width:33,height:33,className:""};var ce=se,le={name:"products",className:"woocommerce-search__product-result",options(e){const t=e?{search:e,per_page:10,orderby:"popularity"}:{};return V()({path:Object(z.addQueryArgs)("/wc-analytics/products",t)})},isDebounced:!0,getOptionIdentifier:e=>e.id,getOptionKeywords:e=>[e.name,e.sku],getFreeTextOptions:e=>[{key:"title",label:Object(r.createElement)("span",{key:"name",className:"woocommerce-search__result-name"},v()({mixedString:Object(m.__)("All products with titles that include {{query /}}",'woocommerce'),components:{query:Object(r.createElement)("strong",{className:"components-form-token-field__suggestion-match"},e)}})),value:{id:e,name:e}}],getOptionLabel(e,t){const n=W(e.name,t)||{};return Object(r.createElement)(r.Fragment,null,Object(r.createElement)(ce,{key:"thumbnail",className:"woocommerce-search__result-thumbnail",product:e,width:18,height:18,alt:""}),Object(r.createElement)("span",{key:"name",className:"woocommerce-search__result-name","aria-label":e.name},n.suggestionBeforeMatch,Object(r.createElement)("strong",{className:"components-form-token-field__suggestion-match"},n.suggestionMatch),n.suggestionAfterMatch))},getOptionCompletion:e=>({key:e.id,label:e.name})},ue={name:"taxes",className:"woocommerce-search__tax-result",options(e){const t=e?{code:e,per_page:10}:{};return V()({path:Object(z.addQueryArgs)("/wc-analytics/taxes",t)})},isDebounced:!0,getOptionIdentifier:e=>e.id,getOptionKeywords:e=>[e.id,G(e)],getFreeTextOptions:e=>[{key:"code",label:Object(r.createElement)("span",{key:"name",className:"woocommerce-search__result-name"},v()({mixedString:Object(m.__)("All taxes with codes that include {{query /}}",'woocommerce'),components:{query:Object(r.createElement)("strong",{className:"components-form-token-field__suggestion-match"},e)}})),value:{id:e,name:e}}],getOptionLabel(e,t){const n=W(G(e),t)||{};return Object(r.createElement)("span",{key:"name",className:"woocommerce-search__result-name","aria-label":e.code},n.suggestionBeforeMatch,Object(r.createElement)("strong",{className:"components-form-token-field__suggestion-match"},n.suggestionMatch),n.suggestionAfterMatch)},getOptionCompletion:e=>({key:e.id,label:G(e)})},de={name:"usernames",className:"woocommerce-search__usernames-result",options(e){const t=e?{search:e,searchby:"username",per_page:10}:{};return V()({path:Object(z.addQueryArgs)("/wc-analytics/customers",t)})},isDebounced:!0,getOptionIdentifier:e=>e.id,getOptionKeywords:e=>[e.username],getOptionLabel(e,t){const n=W(e.username,t)||{};return Object(r.createElement)("span",{key:"name",className:"woocommerce-search__result-name","aria-label":e.username},n.suggestionBeforeMatch,Object(r.createElement)("strong",{className:"components-form-token-field__suggestion-match"},n.suggestionMatch),n.suggestionAfterMatch)},getOptionCompletion:e=>({key:e.id,label:e.username})},fe={...le,name:"products",options(e){const t=e?{search:e,per_page:10,orderby:"popularity",type:"variable"}:{};return V()({path:Object(z.addQueryArgs)("/wc-analytics/products",t)})}};function pe({attributes:e,name:t}){const n=window.wcSettings.variationTitleAttributesSeparator||" - ";if(t.indexOf(n)>-1)return t;const r=e.map(({option:e})=>e).join(", ");return r?t+n+r:t}var he={name:"variations",className:"woocommerce-search__product-result",options(e){const t=e?{search:e,per_page:30,_fields:["attributes","description","id","name","sku"]}:{},n=Object(u.getQuery)().products;return n?(n.includes(",")&&console.warn("Invalid product id supplied to Variations autocompleter"),V()({path:Object(z.addQueryArgs)(`/wc-analytics/products/${n}/variations`,t)})):V()({path:Object(z.addQueryArgs)("/wc-analytics/variations",t)})},isDebounced:!0,getOptionIdentifier:e=>e.id,getOptionKeywords:e=>[pe(e),e.sku],getOptionLabel(e,t){const n=W(pe(e),t)||{};return Object(r.createElement)(r.Fragment,null,Object(r.createElement)(ce,{key:"thumbnail",className:"woocommerce-search__result-thumbnail",product:e,width:18,height:18,alt:""}),Object(r.createElement)("span",{key:"name",className:"woocommerce-search__result-name","aria-label":e.description},n.suggestionBeforeMatch,Object(r.createElement)("strong",{className:"components-form-token-field__suggestion-match"},n.suggestionMatch),n.suggestionAfterMatch))},getOptionCompletion:e=>({key:e.id,label:pe(e)})};class me extends r.Component{constructor(e){super(e),this.state={options:[]},this.appendFreeTextSearch=this.appendFreeTextSearch.bind(this),this.fetchOptions=this.fetchOptions.bind(this),this.updateSelected=this.updateSelected.bind(this)}getAutocompleter(){switch(this.props.type){case"attributes":return Y;case"categories":return $;case"countries":return te;case"coupons":return ne;case"customers":return re;case"downloadIps":return oe;case"emails":return ae;case"orders":return ie;case"products":return le;case"taxes":return ue;case"usernames":return de;case"variableProducts":return fe;case"variations":return he;case"custom":if(!this.props.autocompleter||"object"!=typeof this.props.autocompleter)throw new Error("Invalid autocompleter provided to Search component, it requires a completer object when using 'custom' type.");return this.props.autocompleter;default:return{}}}getFormattedOptions(e,t){const n=this.getAutocompleter(),r=[];return e.forEach(e=>{const o={key:n.getOptionIdentifier(e),label:n.getOptionLabel(e,t),keywords:n.getOptionKeywords(e).filter(Boolean),value:e};r.push(o)}),r}fetchOptions(e,t){if(!t)return[];const n=this.getAutocompleter().options;return Promise.resolve("function"==typeof n?n(t):n||[]).then(async e=>{const n=this.getFormattedOptions(e,t);return this.setState({options:n}),n})}updateSelected(e){const{onChange:t}=this.props,n=this.getAutocompleter();t(e.map(e=>e.value?n.getOptionCompletion(e.value):e))}appendFreeTextSearch(e,t){const{allowFreeTextSearch:n}=this.props;if(!t||!t.length)return[];if(!n)return e;return[...this.getAutocompleter().getFreeTextOptions(t),...e]}render(){const e=this.getAutocompleter(),{className:t,inlineTags:n,placeholder:o,selected:a,showClearButton:s,staticResults:c,disabled:l,multiple:u}=this.props,{options:d}=this.state,f=e.inputType?e.inputType:"text";return Object(r.createElement)("div",null,Object(r.createElement)(K,{className:i()("woocommerce-search",t,{"is-static-results":c}),disabled:l,hideBeforeSearch:!0,inlineTags:n,isSearchable:!0,getSearchExpression:e.getSearchExpression,multiple:u,placeholder:o,onChange:this.updateSelected,onFilter:this.appendFreeTextSearch,onSearch:this.fetchOptions,options:d,searchDebounceTime:500,searchInputType:f,selected:a,showClearButton:s}))}}me.propTypes={allowFreeTextSearch:c.a.bool,className:c.a.string,onChange:c.a.func,type:c.a.oneOf(["attributes","categories","countries","coupons","customers","downloadIps","emails","orders","products","taxes","usernames","variableProducts","variations","custom"]).isRequired,autocompleter:c.a.object,placeholder:c.a.string,selected:c.a.oneOfType([c.a.string,c.a.arrayOf(c.a.shape({key:c.a.oneOfType([c.a.number,c.a.string]).isRequired,label:c.a.string}))]),inlineTags:c.a.bool,showClearButton:c.a.bool,staticResults:c.a.bool,disabled:c.a.bool},me.defaultProps={allowFreeTextSearch:!1,onChange:l.noop,selected:[],inlineTags:!1,showClearButton:!1,staticResults:!1,disabled:!1,multiple:!0};var be=me;class ge extends r.Component{constructor({filter:e,config:t,query:n}){super(...arguments),this.onSearchChange=this.onSearchChange.bind(this),this.state={selected:[]},this.updateLabels=this.updateLabels.bind(this),e.value.length&&t.input.getLabels(e.value,n).then(e=>{const t=e.map(e=>({key:e.id,...e}));this.updateLabels(t)})}componentDidUpdate(e){const{config:t,filter:n,query:r}=this.props,{filter:o}=e;if(n.value.length&&!Object(l.isEqual)(o,n)){const{selected:e}=this.state,o=e.map(e=>e.key);Object(u.getIdsFromQuery)(n.value).every(e=>!o.includes(e))&&t.input.getLabels(n.value,r).then(this.updateLabels)}}updateLabels(e){const t=this.state.selected.map(e=>e.key),n=e.map(e=>e.key);Object(l.isEqual)(n.sort(),t.sort())||this.setState({selected:e})}onSearchChange(e){this.setState({selected:e});const{onFilterChange:t}=this.props;t("value",e.map(e=>e.key).join(","))}getScreenReaderText(e,t){const{selected:n}=this.state;if(0===n.length)return"";const o=Object(l.find)(t.rules,{value:e.rule})||{},a=n.map(e=>e.label).join(", ");return w(v()({mixedString:t.labels.title,components:{filter:Object(r.createElement)(r.Fragment,null,a),rule:Object(r.createElement)(r.Fragment,null,o.label),title:Object(r.createElement)(r.Fragment,null)}}))}render(){const{className:e,config:t,filter:n,onFilterChange:a,isEnglish:s}=this.props,{selected:c}=this.state,{rule:u}=n,{input:d,labels:f,rules:p}=t,h=v()({mixedString:f.title,components:{title:Object(r.createElement)("span",{className:e}),rule:Object(r.createElement)(o.SelectControl,{className:i()(e,"woocommerce-filters-advanced__rule"),options:p,value:u,onChange:Object(l.partial)(a,"rule"),"aria-label":f.rule}),filter:Object(r.createElement)(be,{className:i()(e,"woocommerce-filters-advanced__input"),onChange:this.onSearchChange,type:d.type,autocompleter:d.autocompleter,placeholder:f.placeholder,selected:c,inlineTags:!0,"aria-label":f.filter})}}),m=this.getScreenReaderText(n,t);return Object(r.createElement)("fieldset",{className:"woocommerce-filters-advanced__line-item",tabIndex:"0"},Object(r.createElement)("legend",{className:"screen-reader-text"},f.add||""),Object(r.createElement)("div",{className:i()("woocommerce-filters-advanced__fieldset",{"is-english":s})},h),m&&Object(r.createElement)("span",{className:"screen-reader-text"},m))}}ge.propTypes={config:c.a.shape({labels:c.a.shape({placeholder:c.a.string,rule:c.a.string,title:c.a.string}),rules:c.a.arrayOf(c.a.object),input:c.a.object}).isRequired,filter:c.a.shape({key:c.a.string,rule:c.a.string,value:c.a.string}).isRequired,onFilterChange:c.a.func.isRequired,query:c.a.object};var ye=ge,ve=n(89),_e=n.n(ve);class Oe extends r.Component{constructor(e){super(e),this.state={isFocused:!1}}handleFocusOutside(){this.setState({isFocused:!1})}handleOnClick(e,t){this.setState({isFocused:!0}),"function"==typeof t&&t(e)}render(){const{label:e,value:t,help:n,className:a,instanceId:s,onChange:c,onClick:l,prefix:u,suffix:d,type:f,disabled:p,...h}=this.props,{isFocused:m}=this.state,b="inspector-text-control-with-affixes-"+s,g=[];n&&g.push(b+"__help"),u&&g.push(b+"__prefix"),d&&g.push(b+"__suffix");const y=i()(a,{"with-value":""!==t,empty:""===t,active:m&&!p}),v=i()("text-control-with-affixes",{"text-control-with-prefix":u,"text-control-with-suffix":d,disabled:p});return Object(r.createElement)(o.BaseControl,{label:e,id:b,help:n,className:y,onClick:e=>this.handleOnClick(e,l)},Object(r.createElement)("div",{className:v},u&&Object(r.createElement)("span",{id:b+"__prefix",className:"text-control-with-affixes__prefix"},u),Object(r.createElement)("input",Object.assign({className:"components-text-control__input",type:f,id:b,value:t,onChange:e=>c(e.target.value),"aria-describedby":g.join(" "),disabled:p,onFocus:()=>this.setState({isFocused:!0})},h)),d&&Object(r.createElement)("span",{id:b+"__suffix",className:"text-control-with-affixes__suffix"},d)))}}Oe.defaultProps={type:"text"},Oe.propTypes={label:c.a.string,help:c.a.string,type:c.a.string,value:c.a.string.isRequired,className:c.a.string,onChange:c.a.func.isRequired,prefix:c.a.node,suffix:c.a.node,disabled:c.a.bool};var we=Object(D.compose)([D.withInstanceId,o.withFocusOutside])(Oe);class ke extends r.Component{getBetweenString(){return Object(m._x)("{{rangeStart /}}{{span}} and {{/span}}{{rangeEnd /}}","Numerical range inputs arranged on a single line",'woocommerce')}getScreenReaderText(e,t){const{currency:n}=this.props,o=Object(l.find)(t.rules,{value:e.rule})||{};let[a,i]=Object(l.isArray)(e.value)?e.value:[e.value];if(!a||"between"===o.value&&!i)return"";if("currency"===Object(l.get)(t,["input","type"],"number")){const{formatAmount:e}=_e()(n);a=e(a),i=e(i)}let s=a;return"between"===o.value&&(s=v()({mixedString:this.getBetweenString(),components:{rangeStart:Object(r.createElement)(r.Fragment,null,a),rangeEnd:Object(r.createElement)(r.Fragment,null,i),span:Object(r.createElement)(r.Fragment,null)}})),w(v()({mixedString:t.labels.title,components:{filter:Object(r.createElement)(r.Fragment,null,s),rule:Object(r.createElement)(r.Fragment,null,o.label),title:Object(r.createElement)(r.Fragment,null)}}))}getFormControl({type:e,value:t,label:n,onChange:a,currencySymbol:i,symbolPosition:s}){return"currency"===e?0===s.indexOf("right")?Object(r.createElement)(we,{suffix:Object(r.createElement)("span",{dangerouslySetInnerHTML:{__html:i}}),className:"woocommerce-filters-advanced__input",type:"number",value:t||"","aria-label":n,onChange:a}):Object(r.createElement)(we,{prefix:Object(r.createElement)("span",{dangerouslySetInnerHTML:{__html:i}}),className:"woocommerce-filters-advanced__input",type:"number",value:t||"","aria-label":n,onChange:a}):Object(r.createElement)(o.TextControl,{className:"woocommerce-filters-advanced__input",type:"number",value:t||"","aria-label":n,onChange:a})}getFilterInputs(){const{config:e,filter:t,onFilterChange:n,currency:r}=this.props,{symbol:o,symbolPosition:a}=r;if("between"===t.rule)return this.getRangeInput();const i=Object(l.get)(e,["input","type"],"number"),[s,c]=Object(l.isArray)(t.value)?t.value:[t.value];Boolean(c)&&n("value",s||c);let u="";return u="lessthan"===t.rule?Object(m._x)("%(field)s maximum amount","maximum value input",'woocommerce'):Object(m._x)("%(field)s minimum amount","minimum value input",'woocommerce'),this.getFormControl({type:i,value:s||c,label:Object(m.sprintf)(u,{field:Object(l.get)(e,["labels","add"])}),onChange:Object(l.partial)(n,"value"),currencySymbol:o,symbolPosition:a})}getRangeInput(){const{config:e,filter:t,onFilterChange:n,currency:o}=this.props,{symbol:a,symbolPosition:i}=o,s=Object(l.get)(e,["input","type"],"number"),[c,u]=Object(l.isArray)(t.value)?t.value:[t.value];return v()({mixedString:this.getBetweenString(),components:{rangeStart:this.getFormControl({type:s,value:c||"",label:Object(m.sprintf)(Object(m.__)("%(field)s range start",'woocommerce'),{field:Object(l.get)(e,["labels","add"])}),onChange:e=>{n("value",[e,u])},currencySymbol:a,symbolPosition:i}),rangeEnd:this.getFormControl({type:s,value:u||"",label:Object(m.sprintf)(Object(m.__)("%(field)s range end",'woocommerce'),{field:Object(l.get)(e,["labels","add"])}),onChange:e=>{n("value",[c,e])},currencySymbol:a,symbolPosition:i}),span:Object(r.createElement)("span",{className:"separator"})}})}render(){const{className:e,config:t,filter:n,onFilterChange:a,isEnglish:s}=this.props,{rule:c}=n,{labels:u,rules:d}=t,f=v()({mixedString:u.title,components:{title:Object(r.createElement)("span",{className:e}),rule:Object(r.createElement)(o.SelectControl,{className:i()(e,"woocommerce-filters-advanced__rule"),options:d,value:c,onChange:Object(l.partial)(a,"rule"),"aria-label":u.rule}),filter:Object(r.createElement)("div",{className:i()(e,"woocommerce-filters-advanced__input-range",{"is-between":"between"===c})},this.getFilterInputs())}}),p=this.getScreenReaderText(n,t);return Object(r.createElement)("fieldset",{className:"woocommerce-filters-advanced__line-item",tabIndex:"0"},Object(r.createElement)("legend",{className:"screen-reader-text"},u.add||""),Object(r.createElement)("div",{className:i()("woocommerce-filters-advanced__fieldset",{"is-english":s})},f),p&&Object(r.createElement)("span",{className:"screen-reader-text"},p))}}var Se=ke,De=n(19),Ce=n(9),Ee=n.n(Ce),je=(n(174),n(189),Object(r.createElement)(P.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},Object(r.createElement)(P.Path,{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm.5 16c0 .3-.2.5-.5.5H5c-.3 0-.5-.2-.5-.5V7h15v12zM9 10H7v2h2v-2zm0 4H7v2h2v-2zm4-4h-2v2h2v-2zm4 0h-2v2h2v-2zm-4 4h-2v2h2v-2zm4 0h-2v2h2v-2z"})));const Fe=({disabled:e,value:t,onChange:n,dateFormat:a,label:s,describedBy:c,error:u,onFocus:d,onKeyDown:f,errorPosition:p})=>{const h=i()("woocommerce-calendar__input",{"is-empty":0===t.length,"is-error":u}),m=Object(l.uniqueId)("_woo-dates-input");return Object(r.createElement)("div",{className:h},Object(r.createElement)("input",{type:"text",className:"woocommerce-calendar__input-text",value:t,onChange:n,"aria-label":s,id:m,"aria-describedby":m+"-message",placeholder:a.toLowerCase(),onFocus:d,onKeyDown:f,disabled:e}),u&&Object(r.createElement)(o.Popover,{className:"woocommerce-calendar__input-error",focusOnMount:!1,position:p},u),Object(r.createElement)(F.a,{icon:je,className:"calendar-icon"}),Object(r.createElement)("p",{className:"screen-reader-text",id:m+"-message"},u||c))};Fe.propTypes={disabled:c.a.bool,value:c.a.string,onChange:c.a.func.isRequired,dateFormat:c.a.string.isRequired,label:c.a.string.isRequired,describedBy:c.a.string.isRequired,error:c.a.string,errorPosition:c.a.string,onFocus:c.a.func,onKeyDown:c.a.func},Fe.defaultProps={disabled:!1,onFocus:()=>{},errorPosition:"bottom center",onKeyDown:l.noop};var Pe=Fe;const Me=Object(r.createContext)(2);function xe({component:e,children:t,...n}){const o=e||"div";return Object(r.createElement)(Me.Consumer,null,a=>Object(r.createElement)(Me.Provider,{value:a+1},!1===e?t:Object(r.createElement)(o,Object.assign({},n),t)))}function Te(e){const t=Object(r.useContext)(Me),n="h"+Math.min(t,6);return Object(r.createElement)(n,Object.assign({},e))}xe.propTypes={component:c.a.oneOfType([c.a.func,c.a.string,c.a.bool]),children:c.a.node,className:c.a.string};class Ne extends r.Component{constructor(e){super(e),this.onDateChange=this.onDateChange.bind(this),this.onInputChange=this.onInputChange.bind(this)}handleKeyDown(e,t,{keyCode:n}){C.TAB===n&&e&&t()}handleFocus(e,t){e||t()}onDateChange(e,t){const{onUpdate:n,dateFormat:r}=this.props,o=Ee()(t);n({date:o,text:t?o.format(r):"",error:null}),e()}onInputChange(e){const t=e.target.value,{dateFormat:n}=this.props,r=Object(De.toMoment)(n,t),o=r?null:De.dateValidationMessages.invalid;this.props.onUpdate({date:r,text:t,error:t.length>0?o:null})}render(){const{date:e,disabled:t,text:n,dateFormat:a,error:i,isInvalidDate:s}=this.props;return Object(r.createElement)(o.Dropdown,{position:"bottom center",focusOnMount:!1,renderToggle:({isOpen:e,onToggle:o})=>Object(r.createElement)(Pe,{disabled:t,value:n,onChange:this.onInputChange,dateFormat:a,label:Object(m.__)("Choose a date",'woocommerce'),error:i,describedBy:Object(m.sprintf)(Object(m.__)("Date input describing a selected date in format %s",'woocommerce'),a),onFocus:Object(l.partial)(this.handleFocus,e,o),"aria-expanded":e,focusOnMount:!1,onKeyDown:Object(l.partial)(this.handleKeyDown,e,o),errorPosition:"top center"}),renderContent:({onToggle:t})=>Object(r.createElement)(xe,{component:!1},Object(r.createElement)(Te,{className:"woocommerce-calendar__date-picker-title"},Object(m.__)("select a date",'woocommerce')),Object(r.createElement)("div",{className:"woocommerce-calendar__react-dates is-core-datepicker"},Object(r.createElement)(o.DatePicker,{currentDate:e,onChange:Object(l.partial)(this.onDateChange,t),isInvalidDate:s})))})}}Ne.propTypes={date:c.a.object,disabled:c.a.bool,text:c.a.string,error:c.a.string,onUpdate:c.a.func.isRequired,dateFormat:c.a.string.isRequired,isInvalidDate:c.a.func};var Ie=Ne;const Re=Object(m.__)("MMM D, YYYY",'woocommerce'),Ae=Object(m.__)("MM/DD/YYYY",'woocommerce');class Le extends r.Component{constructor({filter:e}){super(...arguments);const[t,n]=Array.isArray(e.value)?e.value:[null,e.value],r=t?Object(De.toMoment)(De.isoDateFormat,t):null,o=n?Object(De.toMoment)(De.isoDateFormat,n):null;this.state={before:o,beforeText:o?o.format(Ae):"",beforeError:null,after:r,afterText:r?r.format(Ae):"",afterError:null,rule:e.rule},this.onSingleDateChange=this.onSingleDateChange.bind(this),this.onRangeDateChange=this.onRangeDateChange.bind(this),this.onRuleChange=this.onRuleChange.bind(this)}getBetweenString(){return Object(m._x)("{{after /}}{{span}} and {{/span}}{{before /}}","Date range inputs arranged on a single line",'woocommerce')}getScreenReaderText(e,t){const n=Object(l.find)(t.rules,{value:e})||{},{before:o,after:a}=this.state;if(!o||"between"===n.value&&!a)return"";let i=o.format(Re);return"between"===n.value&&(i=v()({mixedString:this.getBetweenString(),components:{after:Object(r.createElement)(r.Fragment,null,a.format(Re)),before:Object(r.createElement)(r.Fragment,null,o.format(Re)),span:Object(r.createElement)(r.Fragment,null)}})),w(v()({mixedString:t.labels.title,components:{filter:Object(r.createElement)(r.Fragment,null,i),rule:Object(r.createElement)(r.Fragment,null,n.label),title:Object(r.createElement)(r.Fragment,null)}}))}onSingleDateChange({date:e,text:t,error:n}){const{onFilterChange:r}=this.props;this.setState({before:e,beforeText:t,beforeError:n}),e&&r("value",e.format(De.isoDateFormat))}onRangeDateChange(e,{date:t,text:n,error:r}){const{onFilterChange:o}=this.props;if(this.setState({[e]:t,[e+"Text"]:n,[e+"Error"]:r}),t){const{before:n,after:r}=this.state;let a=null,i=null;"after"===e&&(a=t.format(De.isoDateFormat),i=n?n.format(De.isoDateFormat):null),"before"===e&&(a=r?r.format(De.isoDateFormat):null,i=t.format(De.isoDateFormat)),a&&i&&o("value",[a,i])}}onRuleChange(e){const{onFilterChange:t}=this.props,{rule:n}=this.state;let r=null,o=!1;[n,e].includes("between")&&(r={before:null,beforeText:"",beforeError:null,after:null,afterText:"",afterError:null},o=!0),this.setState({rule:e,...r}),t("rule",e,o)}isFutureDate(e){return Ee()().isBefore(Ee()(e),"day")}getFormControl({date:e,error:t,onUpdate:n,text:o}){return Object(r.createElement)(Ie,{date:e,dateFormat:Ae,error:t,isInvalidDate:this.isFutureDate,onUpdate:n,text:o})}getRangeInput(){const{before:e,beforeText:t,beforeError:n,after:o,afterText:a,afterError:i}=this.state;return v()({mixedString:this.getBetweenString(),components:{after:this.getFormControl({date:o,error:i,onUpdate:Object(l.partial)(this.onRangeDateChange,"after"),text:a}),before:this.getFormControl({date:e,error:n,onUpdate:Object(l.partial)(this.onRangeDateChange,"before"),text:t}),span:Object(r.createElement)("span",{className:"separator"})}})}getFilterInputs(){const{before:e,beforeText:t,beforeError:n,rule:r}=this.state;return"between"===r?this.getRangeInput():this.getFormControl({date:e,error:n,onUpdate:this.onSingleDateChange,text:t})}render(){const{className:e,config:t,isEnglish:n}=this.props,{rule:a}=this.state,{labels:s,rules:c}=t,l=this.getScreenReaderText(a,t),u=v()({mixedString:s.title,components:{title:Object(r.createElement)("span",{className:e}),rule:Object(r.createElement)(o.SelectControl,{className:i()(e,"woocommerce-filters-advanced__rule"),options:c,value:a,onChange:this.onRuleChange,"aria-label":s.rule}),filter:Object(r.createElement)("div",{className:i()(e,"woocommerce-filters-advanced__input-range",{"is-between":"between"===a})},this.getFilterInputs())}});return Object(r.createElement)("fieldset",{className:"woocommerce-filters-advanced__line-item",tabIndex:"0"},Object(r.createElement)("legend",{className:"screen-reader-text"},s.add||""),Object(r.createElement)("div",{className:i()("woocommerce-filters-advanced__fieldset",{"is-english":n})},u),l&&Object(r.createElement)("span",{className:"screen-reader-text"},l))}}var Ue=Le;const Be=e=>{const{className:t,config:n,filter:a,isEnglish:s,onFilterChange:c}=e,{rule:u,value:d}=a,{labels:f,rules:p}=n,[h,b]=Object(r.useState)([]);Object(r.useEffect)(()=>{!h.length&&Array.isArray(d)&&d[0]&&V()({path:"/wc-analytics/products/attributes/"+d[0]}).then(({id:e,name:t})=>[{key:e.toString(),label:t}]).then(b)},[d,h]);const[g,y]=Object(r.useState)([]);Object(r.useEffect)(()=>{h.length&&(y(!1),V()({path:`/wc-analytics/products/attributes/${h[0].key}/terms?per_page=100`}).then(e=>e.map(({id:e,name:t})=>({key:e.toString(),label:t}))).then(y))},[h]);const[_,O]=Object(r.useState)(Array.isArray(d)&&d[1]||""),k=(({attributeTerms:e,config:t,filter:n,selectedAttribute:o,selectedAttributeTerm:a})=>{if(!e||0===e.length||!o||0===o.length||""===a)return"";const i=Array.isArray(t.rules)&&t.rules.find(e=>e.value===n.rule)||{},s=o[0].label,c=e.find(({key:e})=>e===a),l=c&&c.label;if(!s||!l)return"";const u=v()({mixedString:Object(m.__)("{{attribute /}} {{equals /}} {{value /}}",'woocommerce'),components:{attribute:Object(r.createElement)(r.Fragment,null,s),equals:Object(r.createElement)(r.Fragment,null,i.label),value:Object(r.createElement)(r.Fragment,null,l)}});return w(v()({mixedString:t.labels.title,components:{filter:Object(r.createElement)(r.Fragment,null,u),rule:Object(r.createElement)(r.Fragment,null),title:Object(r.createElement)(r.Fragment,null)}}))})({attributeTerms:g,config:n,filter:a,selectedAttribute:h,selectedAttributeTerm:_});return Object(r.createElement)("fieldset",{className:"woocommerce-filters-advanced__line-item",tabIndex:"0"},Object(r.createElement)("legend",{className:"screen-reader-text"},f.add||""),Object(r.createElement)("div",{className:i()("woocommerce-filters-advanced__fieldset",{"is-english":s})},v()({mixedString:f.title,components:{title:Object(r.createElement)("span",{className:t}),rule:Object(r.createElement)(o.SelectControl,{className:i()(t,"woocommerce-filters-advanced__rule"),options:p,value:u,onChange:Object(l.partial)(c,"rule"),"aria-label":f.rule}),filter:Object(r.createElement)("div",{className:i()(t,"woocommerce-filters-advanced__attribute-fieldset")},Array.isArray(d)&&d.length&&!h.length?Object(r.createElement)(o.Spinner,null):Object(r.createElement)(be,{className:"woocommerce-filters-advanced__input woocommerce-search",onChange:([e])=>{b(e?[e]:[]),O(""),c("value",[e&&e.key].filter(Boolean))},type:"attributes",placeholder:Object(m.__)("Attribute name",'woocommerce'),multiple:!1,selected:h,inlineTags:!0,"aria-label":Object(m.__)("Attribute name",'woocommerce')}),h.length>0&&(g.length?Object(r.createElement)(r.Fragment,null,Object(r.createElement)("span",{className:"woocommerce-filters-advanced__attribute-field-separator"},"="),Object(r.createElement)(K,{className:"woocommerce-filters-advanced__input woocommerce-search",placeholder:Object(m.__)("Attribute value",'woocommerce'),inlineTags:!0,isSearchable:!0,multiple:!1,showAllOnFocus:!0,options:g,selected:_,onChange:e=>{"string"!=typeof e&&(e=""),O(e),c("value",[h[0].key,e].filter(Boolean))}})):Object(r.createElement)(o.Spinner,null)))}})),k&&Object(r.createElement)("span",{className:"screen-reader-text"},k))};Be.propTypes={config:c.a.shape({labels:c.a.shape({rule:c.a.string,title:c.a.string,filter:c.a.string}),rules:c.a.arrayOf(c.a.object),input:c.a.object}).isRequired,filter:c.a.shape({key:c.a.string,rule:c.a.string,value:c.a.arrayOf(c.a.oneOfType([c.a.string,c.a.number]))}).isRequired,onFilterChange:c.a.func.isRequired};var He=Be;var Ke=e=>{const{config:t,currency:n,filter:a,isEnglish:s,onFilterChange:c,query:l,removeFilter:u}=e,{key:d}=a;let f=t.filters[d];const{input:p,labels:h}=f,m={Currency:Se,Date:Ue,Number:Se,ProductAttribute:He,Search:ye,SelectControl:S};if(!m.hasOwnProperty(p.component))return;"Currency"===p.component&&(f={...f,input:{type:"currency",component:"Currency"}});const b=m[p.component];return Object(r.createElement)("li",{className:"woocommerce-filters-advanced__list-item"},Object(r.createElement)(b,{className:"woocommerce-filters-advanced__fieldset-item",currency:n,filter:a,config:f,onFilterChange:c,isEnglish:s,query:l}),Object(r.createElement)(o.Button,{className:i()("woocommerce-filters-advanced__line-item","woocommerce-filters-advanced__remove"),label:h.remove,onClick:u},Object(r.createElement)(O.a,null)))};const ze=o.Text||o.__experimentalText,qe=[{value:"all",label:Object(m.__)("All",'woocommerce')},{value:"any",label:Object(m.__)("Any",'woocommerce')}];class Ve extends r.Component{constructor({query:e,config:t}){super(...arguments),this.instanceCounts={};const n=Object(u.getActiveFiltersFromQuery)(e,t.filters).map(e=>(t.filters[e.key].allowMultiple&&(e.instance=this.getInstanceNumber(e.key)),e));this.state={match:e.match||"all",activeFilters:n},this.filterListRef=Object(r.createRef)(),this.onMatchChange=this.onMatchChange.bind(this),this.onFilterChange=this.onFilterChange.bind(this),this.getAvailableFilterKeys=this.getAvailableFilterKeys.bind(this),this.addFilter=this.addFilter.bind(this),this.removeFilter=this.removeFilter.bind(this),this.clearFilters=this.clearFilters.bind(this),this.getUpdateHref=this.getUpdateHref.bind(this),this.onFilter=this.onFilter.bind(this)}componentDidUpdate(e){const{config:t,query:n}=this.props,{query:r}=e;if(!Object(l.isEqual)(r,n)){const e=Object(u.getActiveFiltersFromQuery)(n,t.filters);this.instanceCounts={};const r=e.map(e=>(t.filters[e.key].allowMultiple&&(e.instance=this.getInstanceNumber(e.key)),e));this.setState({activeFilters:r})}}getInstanceNumber(e){return this.instanceCounts.hasOwnProperty(e)||(this.instanceCounts[e]=1),this.instanceCounts[e]++}onMatchChange(e){const{onAdvancedFilterAction:t}=this.props;this.setState({match:e}),t("match",{match:e})}onFilterChange(e,t,n,r=!1){const o=[...this.state.activeFilters];o[e]={...o[e],[t]:n,...!0===r?{value:null}:{}},this.setState({activeFilters:o})}removeFilter(e){const{onAdvancedFilterAction:t}=this.props,n=[...this.state.activeFilters];if(t("remove",n[e]),n.splice(e,1),this.setState({activeFilters:n}),0===n.length){Object(u.getHistory)().push(this.getUpdateHref([]))}}getTitle(){const{match:e}=this.state,{config:t}=this.props;return v()({mixedString:t.title,components:{select:Object(r.createElement)(o.SelectControl,{className:"woocommerce-filters-advanced__title-select",options:qe,value:e,onChange:this.onMatchChange,"aria-label":Object(m.__)("Choose to apply any or all filters",'woocommerce')})}})}getAvailableFilterKeys(){const{config:e}=this.props,t=this.state.activeFilters.map(e=>e.key),n=Object.keys(e.filters).filter(t=>e.filters[t].allowMultiple||!1);return[...Object(l.difference)(Object.keys(e.filters),t,n),...n]}addFilter(e,t){const{onAdvancedFilterAction:n,config:r}=this.props,o=r.filters[e],a={key:e};Array.isArray(o.rules)&&o.rules.length&&(a.rule=o.rules[0].value),o.input&&o.input.options&&(a.value=Object(u.getDefaultOptionValue)(o,o.input.options)),o.input&&"Search"===o.input.component&&(a.value=""),o.allowMultiple&&(a.instance=this.getInstanceNumber(e)),this.setState(e=>({activeFilters:[...e.activeFilters,a]})),n("add",a),t(),setTimeout(()=>{this.filterListRef.current.querySelector("li:last-of-type fieldset").focus()})}clearFilters(){const{onAdvancedFilterAction:e}=this.props;e("clear_all"),this.setState({activeFilters:[],match:"all"})}getUpdateHref(e,t){const{path:n,query:r,config:o}=this.props,a=Object(u.getQueryFromActiveFilters)(e,r,o.filters),i="all"===t?void 0:t;return Object(u.getNewPath)({...a,match:i},n,r)}isEnglish(){return/en[-|_]/.test(this.props.siteLocale)}onFilter(){const{onAdvancedFilterAction:e,query:t,config:n}=this.props,{activeFilters:r,match:o}=this.state;e("filter",{...Object(u.getQueryFromActiveFilters)(r,t,n.filters),match:o})}orderFilters(e,t){const n=window.location.search,r=n.indexOf(e.key),o=n.indexOf(t.key);return-1===r||-1===o?0:r-o}render(){const{config:e,query:t,currency:n}=this.props,{activeFilters:a,match:i}=this.state,s=this.getAvailableFilterKeys(),c=this.getUpdateHref(a,i),u="admin.php"+window.location.search===c||0===a.length,d=this.isEnglish();return Object(r.createElement)(o.Card,{className:"woocommerce-filters-advanced",size:"small"},Object(r.createElement)(o.CardHeader,{justify:"flex-start"},Object(r.createElement)(ze,{variant:"subtitle.small",as:"p",weight:"600",size:"14",lineHeight:"20px",isBlock:"false"},this.getTitle())),!!a.length&&Object(r.createElement)(o.CardBody,{size:null},Object(r.createElement)("ul",{className:"woocommerce-filters-advanced__list",ref:this.filterListRef},a.sort(this.orderFilters).map((o,a)=>{const{instance:i,key:s}=o;return Object(r.createElement)(Ke,{key:s+(i||""),config:e,currency:n,filter:o,isEnglish:d,onFilterChange:Object(l.partial)(this.onFilterChange,a),query:t,removeFilter:()=>this.removeFilter(a)})}))),s.length>0&&Object(r.createElement)(o.CardBody,null,Object(r.createElement)("div",{className:"woocommerce-filters-advanced__add-filter"},Object(r.createElement)(o.Dropdown,{className:"woocommerce-filters-advanced__add-filter-dropdown",position:"bottom center",renderToggle:({isOpen:e,onToggle:t})=>Object(r.createElement)(o.Button,{className:"woocommerce-filters-advanced__add-button",onClick:t,"aria-expanded":e},Object(r.createElement)(g.a,null),Object(m.__)("Add a Filter",'woocommerce')),renderContent:({onClose:t})=>Object(r.createElement)("ul",{className:"woocommerce-filters-advanced__add-dropdown"},s.map(n=>Object(r.createElement)("li",{key:n},Object(r.createElement)(o.Button,{onClick:Object(l.partial)(this.addFilter,n,t)},e.filters[n].labels.add))))}))),Object(r.createElement)(o.CardFooter,{align:"center"},Object(r.createElement)("div",{className:"woocommerce-filters-advanced__controls"},u&&Object(r.createElement)(o.Button,{isPrimary:!0,disabled:!0},Object(m.__)("Filter",'woocommerce')),!u&&Object(r.createElement)(f,{className:"components-button is-primary is-button",type:"wc-admin",href:c,onClick:this.onFilter},Object(m.__)("Filter",'woocommerce')),a.length>0&&Object(r.createElement)(f,{type:"wc-admin",href:this.getUpdateHref([]),onClick:this.clearFilters},Object(m.__)("Clear all filters",'woocommerce')))))}}Ve.propTypes={config:c.a.shape({title:c.a.string,filters:c.a.objectOf(c.a.shape({labels:c.a.shape({add:c.a.string,remove:c.a.string,rule:c.a.string,title:c.a.string,filter:c.a.string}),rules:c.a.arrayOf(c.a.object),input:c.a.object}))}).isRequired,path:c.a.string.isRequired,query:c.a.object,onAdvancedFilterAction:c.a.func,siteLocale:c.a.string,currency:c.a.object.isRequired},Ve.defaultProps={query:{},onAdvancedFilterAction:()=>{},siteLocale:"en_US"};var We=Ve,Ge=n(172),Ye=n(169);class $e extends r.Component{constructor(){super(),this.state={animate:null},this.container=Object(r.createRef)(),this.onExited=this.onExited.bind(this)}onExited(){const{onExited:e}=this.props;e&&e(this.container.current)}render(){const{children:e,animationKey:t,animate:n}=this.props,o=i()("woocommerce-slide-animation",n&&"animate-"+n);return Object(r.createElement)("div",{className:o,ref:this.container},Object(r.createElement)(Ge.a,null,Object(r.createElement)(Ye.a,Object.assign({timeout:200,classNames:"slide",key:t},this.props,{onExited:this.onExited}),t=>e({status:t}))))}}$e.propTypes={children:c.a.func.isRequired,animationKey:c.a.any.isRequired,animate:c.a.oneOf([null,"left","right"]),onExited:c.a.func};var Qe=$e;function Ze(e,t){if((n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"))<0)return null;var n,r=e.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+e.slice(n+1)]}var Xe=function(e){return(e=Ze(Math.abs(e)))?e[1]:NaN},Je=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function et(e){if(!(t=Je.exec(e)))throw new Error("invalid format: "+e);var t;return new tt({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}function tt(e){this.fill=void 0===e.fill?" ":e.fill+"",this.align=void 0===e.align?">":e.align+"",this.sign=void 0===e.sign?"-":e.sign+"",this.symbol=void 0===e.symbol?"":e.symbol+"",this.zero=!!e.zero,this.width=void 0===e.width?void 0:+e.width,this.comma=!!e.comma,this.precision=void 0===e.precision?void 0:+e.precision,this.trim=!!e.trim,this.type=void 0===e.type?"":e.type+""}et.prototype=tt.prototype,tt.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(void 0===this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(void 0===this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};var nt,rt,ot,at,it=function(e,t){var n=Ze(e,t);if(!n)return e+"";var r=n[0],o=n[1];return o<0?"0."+new Array(-o).join("0")+r:r.length>o+1?r.slice(0,o+1)+"."+r.slice(o+1):r+new Array(o-r.length+2).join("0")},st={"%":function(e,t){return(100*e).toFixed(t)},b:function(e){return Math.round(e).toString(2)},c:function(e){return e+""},d:function(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)},e:function(e,t){return e.toExponential(t)},f:function(e,t){return e.toFixed(t)},g:function(e,t){return e.toPrecision(t)},o:function(e){return Math.round(e).toString(8)},p:function(e,t){return it(100*e,t)},r:it,s:function(e,t){var n=Ze(e,t);if(!n)return e+"";var r=n[0],o=n[1],a=o-(nt=3*Math.max(-8,Math.min(8,Math.floor(o/3))))+1,i=r.length;return a===i?r:a>i?r+new Array(a-i+1).join("0"):a>0?r.slice(0,a)+"."+r.slice(a):"0."+new Array(1-a).join("0")+Ze(e,Math.max(0,t+a-1))[0]},X:function(e){return Math.round(e).toString(16).toUpperCase()},x:function(e){return Math.round(e).toString(16)}},ct=function(e){return e},lt=Array.prototype.map,ut=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"],dt=function(e){var t,n,r=void 0===e.grouping||void 0===e.thousands?ct:(t=lt.call(e.grouping,Number),n=e.thousands+"",function(e,r){for(var o=e.length,a=[],i=0,s=t[0],c=0;o>0&&s>0&&(c+s+1>r&&(s=Math.max(1,r-c)),a.push(e.substring(o-=s,o+s)),!((c+=s+1)>r));)s=t[i=(i+1)%t.length];return a.reverse().join(n)}),o=void 0===e.currency?"":e.currency[0]+"",a=void 0===e.currency?"":e.currency[1]+"",i=void 0===e.decimal?".":e.decimal+"",s=void 0===e.numerals?ct:function(e){return function(t){return t.replace(/[0-9]/g,(function(t){return e[+t]}))}}(lt.call(e.numerals,String)),c=void 0===e.percent?"%":e.percent+"",l=void 0===e.minus?"-":e.minus+"",u=void 0===e.nan?"NaN":e.nan+"";function d(e){var t=(e=et(e)).fill,n=e.align,d=e.sign,f=e.symbol,p=e.zero,h=e.width,m=e.comma,b=e.precision,g=e.trim,y=e.type;"n"===y?(m=!0,y="g"):st[y]||(void 0===b&&(b=12),g=!0,y="g"),(p||"0"===t&&"="===n)&&(p=!0,t="0",n="=");var v="$"===f?o:"#"===f&&/[boxX]/.test(y)?"0"+y.toLowerCase():"",_="$"===f?a:/[%p]/.test(y)?c:"",O=st[y],w=/[defgprs%]/.test(y);function k(e){var o,a,c,f=v,k=_;if("c"===y)k=O(e)+k,e="";else{var S=(e=+e)<0||1/e<0;if(e=isNaN(e)?u:O(Math.abs(e),b),g&&(e=function(e){e:for(var t,n=e.length,r=1,o=-1;r<n;++r)switch(e[r]){case".":o=t=r;break;case"0":0===o&&(o=r),t=r;break;default:if(!+e[r])break e;o>0&&(o=0)}return o>0?e.slice(0,o)+e.slice(t+1):e}(e)),S&&0==+e&&"+"!==d&&(S=!1),f=(S?"("===d?d:l:"-"===d||"("===d?"":d)+f,k=("s"===y?ut[8+nt/3]:"")+k+(S&&"("===d?")":""),w)for(o=-1,a=e.length;++o<a;)if(48>(c=e.charCodeAt(o))||c>57){k=(46===c?i+e.slice(o+1):e.slice(o))+k,e=e.slice(0,o);break}}m&&!p&&(e=r(e,1/0));var D=f.length+e.length+k.length,C=D<h?new Array(h-D+1).join(t):"";switch(m&&p&&(e=r(C+e,C.length?h-k.length:1/0),C=""),n){case"<":e=f+e+k+C;break;case"=":e=f+C+e+k;break;case"^":e=C.slice(0,D=C.length>>1)+f+e+k+C.slice(D);break;default:e=C+f+e+k}return s(e)}return b=void 0===b?6:/[gprs]/.test(y)?Math.max(1,Math.min(21,b)):Math.max(0,Math.min(20,b)),k.toString=function(){return e+""},k}return{format:d,formatPrefix:function(e,t){var n=d(((e=et(e)).type="f",e)),r=3*Math.max(-8,Math.min(8,Math.floor(Xe(t)/3))),o=Math.pow(10,-r),a=ut[8+r/3];return function(e){return n(o*e)+a}}}};function ft(e){return rt=dt(e),ot=rt.format,at=rt.formatPrefix,rt}ft({decimal:".",thousands:",",grouping:[3],currency:["$",""],minus:"-"});var pt=n(165),ht=n.n(pt),mt=n(166),bt=n.n(mt),gt=function(e){for(var t=e.length/6|0,n=new Array(t),r=0;r<t;)n[r]="#"+e.slice(6*r,6*++r);return n};function yt(e){var t=e.length;return function(n){return e[Math.max(0,Math.min(t-1,Math.floor(n*t)))]}}var vt=yt(gt("44015444025645045745055946075a46085c460a5d460b5e470d60470e6147106347116447136548146748166848176948186a481a6c481b6d481c6e481d6f481f70482071482173482374482475482576482677482878482979472a7a472c7a472d7b472e7c472f7d46307e46327e46337f463480453581453781453882443983443a83443b84433d84433e85423f854240864241864142874144874045884046883f47883f48893e49893e4a893e4c8a3d4d8a3d4e8a3c4f8a3c508b3b518b3b528b3a538b3a548c39558c39568c38588c38598c375a8c375b8d365c8d365d8d355e8d355f8d34608d34618d33628d33638d32648e32658e31668e31678e31688e30698e306a8e2f6b8e2f6c8e2e6d8e2e6e8e2e6f8e2d708e2d718e2c718e2c728e2c738e2b748e2b758e2a768e2a778e2a788e29798e297a8e297b8e287c8e287d8e277e8e277f8e27808e26818e26828e26828e25838e25848e25858e24868e24878e23888e23898e238a8d228b8d228c8d228d8d218e8d218f8d21908d21918c20928c20928c20938c1f948c1f958b1f968b1f978b1f988b1f998a1f9a8a1e9b8a1e9c891e9d891f9e891f9f881fa0881fa1881fa1871fa28720a38620a48621a58521a68522a78522a88423a98324aa8325ab8225ac8226ad8127ad8128ae8029af7f2ab07f2cb17e2db27d2eb37c2fb47c31b57b32b67a34b67935b77937b87838b9773aba763bbb753dbc743fbc7340bd7242be7144bf7046c06f48c16e4ac16d4cc26c4ec36b50c46a52c56954c56856c66758c7655ac8645cc8635ec96260ca6063cb5f65cb5e67cc5c69cd5b6ccd5a6ece5870cf5773d05675d05477d1537ad1517cd2507fd34e81d34d84d44b86d54989d5488bd6468ed64590d74393d74195d84098d83e9bd93c9dd93ba0da39a2da37a5db36a8db34aadc32addc30b0dd2fb2dd2db5de2bb8de29bade28bddf26c0df25c2df23c5e021c8e020cae11fcde11dd0e11cd2e21bd5e21ad8e219dae319dde318dfe318e2e418e5e419e7e419eae51aece51befe51cf1e51df4e61ef6e620f8e621fbe723fde725"));yt(gt("00000401000501010601010802010902020b02020d03030f03031204041405041606051806051a07061c08071e0907200a08220b09240c09260d0a290e0b2b100b2d110c2f120d31130d34140e36150e38160f3b180f3d19103f1a10421c10441d11471e114920114b21114e22115024125325125527125829115a2a115c2c115f2d11612f116331116533106734106936106b38106c390f6e3b0f703d0f713f0f72400f74420f75440f764510774710784910784a10794c117a4e117b4f127b51127c52137c54137d56147d57157e59157e5a167e5c167f5d177f5f187f601880621980641a80651a80671b80681c816a1c816b1d816d1d816e1e81701f81721f817320817521817621817822817922827b23827c23827e24828025828125818326818426818627818827818928818b29818c29818e2a81902a81912b81932b80942c80962c80982d80992d809b2e7f9c2e7f9e2f7fa02f7fa1307ea3307ea5317ea6317da8327daa337dab337cad347cae347bb0357bb2357bb3367ab5367ab73779b83779ba3878bc3978bd3977bf3a77c03a76c23b75c43c75c53c74c73d73c83e73ca3e72cc3f71cd4071cf4070d0416fd2426fd3436ed5446dd6456cd8456cd9466bdb476adc4869de4968df4a68e04c67e24d66e34e65e44f64e55064e75263e85362e95462ea5661eb5760ec5860ed5a5fee5b5eef5d5ef05f5ef1605df2625df2645cf3655cf4675cf4695cf56b5cf66c5cf66e5cf7705cf7725cf8745cf8765cf9785df9795df97b5dfa7d5efa7f5efa815ffb835ffb8560fb8761fc8961fc8a62fc8c63fc8e64fc9065fd9266fd9467fd9668fd9869fd9a6afd9b6bfe9d6cfe9f6dfea16efea36ffea571fea772fea973feaa74feac76feae77feb078feb27afeb47bfeb67cfeb77efeb97ffebb81febd82febf84fec185fec287fec488fec68afec88cfeca8dfecc8ffecd90fecf92fed194fed395fed597fed799fed89afdda9cfddc9efddea0fde0a1fde2a3fde3a5fde5a7fde7a9fde9aafdebacfcecaefceeb0fcf0b2fcf2b4fcf4b6fcf6b8fcf7b9fcf9bbfcfbbdfcfdbf")),yt(gt("00000401000501010601010802010a02020c02020e03021004031204031405041706041907051b08051d09061f0a07220b07240c08260d08290e092b10092d110a30120a32140b34150b37160b39180c3c190c3e1b0c411c0c431e0c451f0c48210c4a230c4c240c4f260c51280b53290b552b0b572d0b592f0a5b310a5c320a5e340a5f3609613809623909633b09643d09653e0966400a67420a68440a68450a69470b6a490b6a4a0c6b4c0c6b4d0d6c4f0d6c510e6c520e6d540f6d550f6d57106e59106e5a116e5c126e5d126e5f136e61136e62146e64156e65156e67166e69166e6a176e6c186e6d186e6f196e71196e721a6e741a6e751b6e771c6d781c6d7a1d6d7c1d6d7d1e6d7f1e6c801f6c82206c84206b85216b87216b88226a8a226a8c23698d23698f24699025689225689326679526679727669827669a28659b29649d29649f2a63a02a63a22b62a32c61a52c60a62d60a82e5fa92e5eab2f5ead305dae305cb0315bb1325ab3325ab43359b63458b73557b93556ba3655bc3754bd3853bf3952c03a51c13a50c33b4fc43c4ec63d4dc73e4cc83f4bca404acb4149cc4248ce4347cf4446d04545d24644d34743d44842d54a41d74b3fd84c3ed94d3dda4e3cdb503bdd513ade5238df5337e05536e15635e25734e35933e45a31e55c30e65d2fe75e2ee8602de9612bea632aeb6429eb6628ec6726ed6925ee6a24ef6c23ef6e21f06f20f1711ff1731df2741cf3761bf37819f47918f57b17f57d15f67e14f68013f78212f78410f8850ff8870ef8890cf98b0bf98c0af98e09fa9008fa9207fa9407fb9606fb9706fb9906fb9b06fb9d07fc9f07fca108fca309fca50afca60cfca80dfcaa0ffcac11fcae12fcb014fcb216fcb418fbb61afbb81dfbba1ffbbc21fbbe23fac026fac228fac42afac62df9c72ff9c932f9cb35f8cd37f8cf3af7d13df7d340f6d543f6d746f5d949f5db4cf4dd4ff4df53f4e156f3e35af3e55df2e661f2e865f2ea69f1ec6df1ed71f1ef75f1f179f2f27df2f482f3f586f3f68af4f88ef5f992f6fa96f8fb9af9fc9dfafda1fcffa4")),yt(gt("0d088710078813078916078a19068c1b068d1d068e20068f2206902406912605912805922a05932c05942e05952f059631059733059735049837049938049a3a049a3c049b3e049c3f049c41049d43039e44039e46039f48039f4903a04b03a14c02a14e02a25002a25102a35302a35502a45601a45801a45901a55b01a55c01a65e01a66001a66100a76300a76400a76600a76700a86900a86a00a86c00a86e00a86f00a87100a87201a87401a87501a87701a87801a87a02a87b02a87d03a87e03a88004a88104a78305a78405a78606a68707a68808a68a09a58b0aa58d0ba58e0ca48f0da4910ea3920fa39410a29511a19613a19814a099159f9a169f9c179e9d189d9e199da01a9ca11b9ba21d9aa31e9aa51f99a62098a72197a82296aa2395ab2494ac2694ad2793ae2892b02991b12a90b22b8fb32c8eb42e8db52f8cb6308bb7318ab83289ba3388bb3488bc3587bd3786be3885bf3984c03a83c13b82c23c81c33d80c43e7fc5407ec6417dc7427cc8437bc9447aca457acb4679cc4778cc4977cd4a76ce4b75cf4c74d04d73d14e72d24f71d35171d45270d5536fd5546ed6556dd7566cd8576bd9586ada5a6ada5b69db5c68dc5d67dd5e66de5f65de6164df6263e06363e16462e26561e26660e3685fe4695ee56a5de56b5de66c5ce76e5be76f5ae87059e97158e97257ea7457eb7556eb7655ec7754ed7953ed7a52ee7b51ef7c51ef7e50f07f4ff0804ef1814df1834cf2844bf3854bf3874af48849f48948f58b47f58c46f68d45f68f44f79044f79143f79342f89441f89540f9973ff9983ef99a3efa9b3dfa9c3cfa9e3bfb9f3afba139fba238fca338fca537fca636fca835fca934fdab33fdac33fdae32fdaf31fdb130fdb22ffdb42ffdb52efeb72dfeb82cfeba2cfebb2bfebd2afebe2afec029fdc229fdc328fdc527fdc627fdc827fdca26fdcb26fccd25fcce25fcd025fcd225fbd324fbd524fbd724fad824fada24f9dc24f9dd25f8df25f8e125f7e225f7e425f6e626f6e826f5e926f5eb27f4ed27f3ee27f3f027f2f227f1f426f1f525f0f724f0f921"));function _t(e,t){if(e.length!==t.length)return!1;for(var n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}var Ot=function(e,t){var n;void 0===t&&(t=_t);var r,o=[],a=!1;return function(){for(var i=[],s=0;s<arguments.length;s++)i[s]=arguments[s];return a&&n===this&&t(i,o)||(r=e.apply(this,i),a=!0,n=this,o=i),r}},wt=n(54),kt=n(53);class St extends r.Component{render(){const{height:e}=this.props;return Object(r.createElement)("div",{"aria-hidden":"true",className:"woocommerce-chart-placeholder",style:{height:e}},Object(r.createElement)(o.Spinner,null))}}St.propTypes={height:c.a.number},St.defaultProps={height:0};var Dt=St,Ct=new Date,Et=new Date;function jt(e,t,n,r){function o(t){return e(t=0===arguments.length?new Date:new Date(+t)),t}return o.floor=function(t){return e(t=new Date(+t)),t},o.ceil=function(n){return e(n=new Date(n-1)),t(n,1),e(n),n},o.round=function(e){var t=o(e),n=o.ceil(e);return e-t<n-e?t:n},o.offset=function(e,n){return t(e=new Date(+e),null==n?1:Math.floor(n)),e},o.range=function(n,r,a){var i,s=[];if(n=o.ceil(n),a=null==a?1:Math.floor(a),!(n<r&&a>0))return s;do{s.push(i=new Date(+n)),t(n,a),e(n)}while(i<n&&n<r);return s},o.filter=function(n){return jt((function(t){if(t>=t)for(;e(t),!n(t);)t.setTime(t-1)}),(function(e,r){if(e>=e)if(r<0)for(;++r<=0;)for(;t(e,-1),!n(e););else for(;--r>=0;)for(;t(e,1),!n(e););}))},n&&(o.count=function(t,r){return Ct.setTime(+t),Et.setTime(+r),e(Ct),e(Et),Math.floor(n(Ct,Et))},o.every=function(e){return e=Math.floor(e),isFinite(e)&&e>0?e>1?o.filter(r?function(t){return r(t)%e==0}:function(t){return o.count(0,t)%e==0}):o:null}),o}function Ft(e){return jt((function(t){t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)}),(function(e,t){e.setUTCDate(e.getUTCDate()+7*t)}),(function(e,t){return(t-e)/6048e5}))}var Pt=Ft(0),Mt=Ft(1),xt=Ft(2),Tt=Ft(3),Nt=Ft(4),It=Ft(5),Rt=Ft(6),At=(Pt.range,Mt.range,xt.range,Tt.range,Nt.range,It.range,Rt.range,jt((function(e){e.setUTCHours(0,0,0,0)}),(function(e,t){e.setUTCDate(e.getUTCDate()+t)}),(function(e,t){return(t-e)/864e5}),(function(e){return e.getUTCDate()-1}))),Lt=At;At.range;function Ut(e){return jt((function(t){t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)}),(function(e,t){e.setDate(e.getDate()+7*t)}),(function(e,t){return(t-e-6e4*(t.getTimezoneOffset()-e.getTimezoneOffset()))/6048e5}))}var Bt=Ut(0),Ht=Ut(1),Kt=Ut(2),zt=Ut(3),qt=Ut(4),Vt=Ut(5),Wt=Ut(6),Gt=(Bt.range,Ht.range,Kt.range,zt.range,qt.range,Vt.range,Wt.range,jt((function(e){e.setHours(0,0,0,0)}),(function(e,t){e.setDate(e.getDate()+t)}),(function(e,t){return(t-e-6e4*(t.getTimezoneOffset()-e.getTimezoneOffset()))/864e5}),(function(e){return e.getDate()-1}))),Yt=Gt,$t=(Gt.range,jt((function(e){e.setMonth(0,1),e.setHours(0,0,0,0)}),(function(e,t){e.setFullYear(e.getFullYear()+t)}),(function(e,t){return t.getFullYear()-e.getFullYear()}),(function(e){return e.getFullYear()})));$t.every=function(e){return isFinite(e=Math.floor(e))&&e>0?jt((function(t){t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)}),(function(t,n){t.setFullYear(t.getFullYear()+n*e)})):null};var Qt=$t,Zt=($t.range,jt((function(e){e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)}),(function(e,t){e.setUTCFullYear(e.getUTCFullYear()+t)}),(function(e,t){return t.getUTCFullYear()-e.getUTCFullYear()}),(function(e){return e.getUTCFullYear()})));Zt.every=function(e){return isFinite(e=Math.floor(e))&&e>0?jt((function(t){t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)}),(function(t,n){t.setUTCFullYear(t.getUTCFullYear()+n*e)})):null};var Xt=Zt;Zt.range;function Jt(e){if(0<=e.y&&e.y<100){var t=new Date(-1,e.m,e.d,e.H,e.M,e.S,e.L);return t.setFullYear(e.y),t}return new Date(e.y,e.m,e.d,e.H,e.M,e.S,e.L)}function en(e){if(0<=e.y&&e.y<100){var t=new Date(Date.UTC(-1,e.m,e.d,e.H,e.M,e.S,e.L));return t.setUTCFullYear(e.y),t}return new Date(Date.UTC(e.y,e.m,e.d,e.H,e.M,e.S,e.L))}function tn(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}var nn,rn,on,an={"-":"",_:" ",0:"0"},sn=/^\s*\d+/,cn=/^%/,ln=/[\\^$*+?|[\]().{}]/g;function un(e,t,n){var r=e<0?"-":"",o=(r?-e:e)+"",a=o.length;return r+(a<n?new Array(n-a+1).join(t)+o:o)}function dn(e){return e.replace(ln,"\\$&")}function fn(e){return new RegExp("^(?:"+e.map(dn).join("|")+")","i")}function pn(e){for(var t={},n=-1,r=e.length;++n<r;)t[e[n].toLowerCase()]=n;return t}function hn(e,t,n){var r=sn.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function mn(e,t,n){var r=sn.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function bn(e,t,n){var r=sn.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function gn(e,t,n){var r=sn.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function yn(e,t,n){var r=sn.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function vn(e,t,n){var r=sn.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function _n(e,t,n){var r=sn.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function On(e,t,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(n,n+6));return r?(e.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function wn(e,t,n){var r=sn.exec(t.slice(n,n+1));return r?(e.q=3*r[0]-3,n+r[0].length):-1}function kn(e,t,n){var r=sn.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function Sn(e,t,n){var r=sn.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function Dn(e,t,n){var r=sn.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function Cn(e,t,n){var r=sn.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function En(e,t,n){var r=sn.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function jn(e,t,n){var r=sn.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function Fn(e,t,n){var r=sn.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function Pn(e,t,n){var r=sn.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function Mn(e,t,n){var r=cn.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function xn(e,t,n){var r=sn.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function Tn(e,t,n){var r=sn.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function Nn(e,t){return un(e.getDate(),t,2)}function In(e,t){return un(e.getHours(),t,2)}function Rn(e,t){return un(e.getHours()%12||12,t,2)}function An(e,t){return un(1+Yt.count(Qt(e),e),t,3)}function Ln(e,t){return un(e.getMilliseconds(),t,3)}function Un(e,t){return Ln(e,t)+"000"}function Bn(e,t){return un(e.getMonth()+1,t,2)}function Hn(e,t){return un(e.getMinutes(),t,2)}function Kn(e,t){return un(e.getSeconds(),t,2)}function zn(e){var t=e.getDay();return 0===t?7:t}function qn(e,t){return un(Bt.count(Qt(e)-1,e),t,2)}function Vn(e){var t=e.getDay();return t>=4||0===t?qt(e):qt.ceil(e)}function Wn(e,t){return e=Vn(e),un(qt.count(Qt(e),e)+(4===Qt(e).getDay()),t,2)}function Gn(e){return e.getDay()}function Yn(e,t){return un(Ht.count(Qt(e)-1,e),t,2)}function $n(e,t){return un(e.getFullYear()%100,t,2)}function Qn(e,t){return un((e=Vn(e)).getFullYear()%100,t,2)}function Zn(e,t){return un(e.getFullYear()%1e4,t,4)}function Xn(e,t){var n=e.getDay();return un((e=n>=4||0===n?qt(e):qt.ceil(e)).getFullYear()%1e4,t,4)}function Jn(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+un(t/60|0,"0",2)+un(t%60,"0",2)}function er(e,t){return un(e.getUTCDate(),t,2)}function tr(e,t){return un(e.getUTCHours(),t,2)}function nr(e,t){return un(e.getUTCHours()%12||12,t,2)}function rr(e,t){return un(1+Lt.count(Xt(e),e),t,3)}function or(e,t){return un(e.getUTCMilliseconds(),t,3)}function ar(e,t){return or(e,t)+"000"}function ir(e,t){return un(e.getUTCMonth()+1,t,2)}function sr(e,t){return un(e.getUTCMinutes(),t,2)}function cr(e,t){return un(e.getUTCSeconds(),t,2)}function lr(e){var t=e.getUTCDay();return 0===t?7:t}function ur(e,t){return un(Pt.count(Xt(e)-1,e),t,2)}function dr(e){var t=e.getUTCDay();return t>=4||0===t?Nt(e):Nt.ceil(e)}function fr(e,t){return e=dr(e),un(Nt.count(Xt(e),e)+(4===Xt(e).getUTCDay()),t,2)}function pr(e){return e.getUTCDay()}function hr(e,t){return un(Mt.count(Xt(e)-1,e),t,2)}function mr(e,t){return un(e.getUTCFullYear()%100,t,2)}function br(e,t){return un((e=dr(e)).getUTCFullYear()%100,t,2)}function gr(e,t){return un(e.getUTCFullYear()%1e4,t,4)}function yr(e,t){var n=e.getUTCDay();return un((e=n>=4||0===n?Nt(e):Nt.ceil(e)).getUTCFullYear()%1e4,t,4)}function vr(){return"+0000"}function _r(){return"%"}function Or(e){return+e}function wr(e){return Math.floor(+e/1e3)}nn=function(e){var t=e.dateTime,n=e.date,r=e.time,o=e.periods,a=e.days,i=e.shortDays,s=e.months,c=e.shortMonths,l=fn(o),u=pn(o),d=fn(a),f=pn(a),p=fn(i),h=pn(i),m=fn(s),b=pn(s),g=fn(c),y=pn(c),v={a:function(e){return i[e.getDay()]},A:function(e){return a[e.getDay()]},b:function(e){return c[e.getMonth()]},B:function(e){return s[e.getMonth()]},c:null,d:Nn,e:Nn,f:Un,g:Qn,G:Xn,H:In,I:Rn,j:An,L:Ln,m:Bn,M:Hn,p:function(e){return o[+(e.getHours()>=12)]},q:function(e){return 1+~~(e.getMonth()/3)},Q:Or,s:wr,S:Kn,u:zn,U:qn,V:Wn,w:Gn,W:Yn,x:null,X:null,y:$n,Y:Zn,Z:Jn,"%":_r},_={a:function(e){return i[e.getUTCDay()]},A:function(e){return a[e.getUTCDay()]},b:function(e){return c[e.getUTCMonth()]},B:function(e){return s[e.getUTCMonth()]},c:null,d:er,e:er,f:ar,g:br,G:yr,H:tr,I:nr,j:rr,L:or,m:ir,M:sr,p:function(e){return o[+(e.getUTCHours()>=12)]},q:function(e){return 1+~~(e.getUTCMonth()/3)},Q:Or,s:wr,S:cr,u:lr,U:ur,V:fr,w:pr,W:hr,x:null,X:null,y:mr,Y:gr,Z:vr,"%":_r},O={a:function(e,t,n){var r=p.exec(t.slice(n));return r?(e.w=h[r[0].toLowerCase()],n+r[0].length):-1},A:function(e,t,n){var r=d.exec(t.slice(n));return r?(e.w=f[r[0].toLowerCase()],n+r[0].length):-1},b:function(e,t,n){var r=g.exec(t.slice(n));return r?(e.m=y[r[0].toLowerCase()],n+r[0].length):-1},B:function(e,t,n){var r=m.exec(t.slice(n));return r?(e.m=b[r[0].toLowerCase()],n+r[0].length):-1},c:function(e,n,r){return S(e,t,n,r)},d:Sn,e:Sn,f:Pn,g:_n,G:vn,H:Cn,I:Cn,j:Dn,L:Fn,m:kn,M:En,p:function(e,t,n){var r=l.exec(t.slice(n));return r?(e.p=u[r[0].toLowerCase()],n+r[0].length):-1},q:wn,Q:xn,s:Tn,S:jn,u:mn,U:bn,V:gn,w:hn,W:yn,x:function(e,t,r){return S(e,n,t,r)},X:function(e,t,n){return S(e,r,t,n)},y:_n,Y:vn,Z:On,"%":Mn};function w(e,t){return function(n){var r,o,a,i=[],s=-1,c=0,l=e.length;for(n instanceof Date||(n=new Date(+n));++s<l;)37===e.charCodeAt(s)&&(i.push(e.slice(c,s)),null!=(o=an[r=e.charAt(++s)])?r=e.charAt(++s):o="e"===r?" ":"0",(a=t[r])&&(r=a(n,o)),i.push(r),c=s+1);return i.push(e.slice(c,s)),i.join("")}}function k(e,t){return function(n){var r,o,a=tn(1900,void 0,1);if(S(a,e,n+="",0)!=n.length)return null;if("Q"in a)return new Date(a.Q);if("s"in a)return new Date(1e3*a.s+("L"in a?a.L:0));if(t&&!("Z"in a)&&(a.Z=0),"p"in a&&(a.H=a.H%12+12*a.p),void 0===a.m&&(a.m="q"in a?a.q:0),"V"in a){if(a.V<1||a.V>53)return null;"w"in a||(a.w=1),"Z"in a?(o=(r=en(tn(a.y,0,1))).getUTCDay(),r=o>4||0===o?Mt.ceil(r):Mt(r),r=Lt.offset(r,7*(a.V-1)),a.y=r.getUTCFullYear(),a.m=r.getUTCMonth(),a.d=r.getUTCDate()+(a.w+6)%7):(o=(r=Jt(tn(a.y,0,1))).getDay(),r=o>4||0===o?Ht.ceil(r):Ht(r),r=Yt.offset(r,7*(a.V-1)),a.y=r.getFullYear(),a.m=r.getMonth(),a.d=r.getDate()+(a.w+6)%7)}else("W"in a||"U"in a)&&("w"in a||(a.w="u"in a?a.u%7:"W"in a?1:0),o="Z"in a?en(tn(a.y,0,1)).getUTCDay():Jt(tn(a.y,0,1)).getDay(),a.m=0,a.d="W"in a?(a.w+6)%7+7*a.W-(o+5)%7:a.w+7*a.U-(o+6)%7);return"Z"in a?(a.H+=a.Z/100|0,a.M+=a.Z%100,en(a)):Jt(a)}}function S(e,t,n,r){for(var o,a,i=0,s=t.length,c=n.length;i<s;){if(r>=c)return-1;if(37===(o=t.charCodeAt(i++))){if(o=t.charAt(i++),!(a=O[o in an?t.charAt(i++):o])||(r=a(e,n,r))<0)return-1}else if(o!=n.charCodeAt(r++))return-1}return r}return v.x=w(n,v),v.X=w(r,v),v.c=w(t,v),_.x=w(n,_),_.X=w(r,_),_.c=w(t,_),{format:function(e){var t=w(e+="",v);return t.toString=function(){return e},t},parse:function(e){var t=k(e+="",!1);return t.toString=function(){return e},t},utcFormat:function(e){var t=w(e+="",_);return t.toString=function(){return e},t},utcParse:function(e){var t=k(e+="",!0);return t.toString=function(){return e},t}}}({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]}),rn=nn.format,nn.parse,nn.utcFormat,on=nn.utcParse;const kr=(e,t=ot)=>"function"==typeof e?e:t(e),Sr=e=>[...new Set(e.reduce((e,t)=>e.concat(Object.keys(t)),[]))].filter(e=>"date"!==e),Dr=[[],[.5],[.333,.667],[.2,.5,.8],[.12,.375,.625,.88],[0,.25,.5,.75,1]],Cr=(e,t)=>n=>{const r=e.length>5?5:e.length,o=Object(l.findIndex)(e,e=>e.key===n),a=o<=4?Dr[r][o]:0;return t(a)};class Er extends r.Component{constructor(){super(),this.listRef=Object(r.createRef)(),this.state={isScrollable:!1}}componentDidMount(){this.updateListScroll(),window.addEventListener("resize",this.updateListScroll)}componentWillUnmount(){window.removeEventListener("resize",this.updateListScroll)}updateListScroll(){if(!this||!this.listRef)return;const e=this.listRef.current,t=e.scrollHeight-e.scrollTop<=e.offsetHeight;this.setState({isScrollable:!t})}render(){const{colorScheme:e,data:t,handleLegendHover:n,handleLegendToggle:o,interactive:a,legendDirection:s,legendValueFormat:c,instanceId:l,totalLabel:u}=this.props,{isScrollable:d}=this.state,f=t.filter(e=>e.visible),p=f.length,h="column"===s&&t.length>5&&u,b=t.length>5?f:t;return Object(r.createElement)("div",{className:i()("woocommerce-legend","woocommerce-legend__direction-"+s,{"has-total":h,"is-scrollable":d},this.props.className)},Object(r.createElement)("ul",{className:"woocommerce-legend__list",ref:this.listRef,onScroll:h?this.updateListScroll:null},t.map(t=>Object(r.createElement)("li",{className:i()("woocommerce-legend__item",{"woocommerce-legend__item-checked":t.visible}),key:t.key,id:`woocommerce-legend-${l}__item__${t.key}`,onMouseEnter:n,onMouseLeave:n,onBlur:n,onFocus:n},Object(r.createElement)("button",{role:"checkbox","aria-checked":t.visible?"true":"false",onClick:o,id:`woocommerce-legend-${l}__item-button__${t.key}`,disabled:t.visible&&p<=1||!t.visible&&p>=5||!a,title:p>=5?Object(m.sprintf)(Object(m.__)("You may select up to %d items.",'woocommerce'),5):""},Object(r.createElement)("div",{className:"woocommerce-legend__item-container"},Object(r.createElement)("span",{className:i()("woocommerce-legend__item-checkmark",{"woocommerce-legend__item-checkmark-checked":t.visible}),style:t.visible?{color:Cr(b,e)(t.key)}:null}),Object(r.createElement)("span",{className:"woocommerce-legend__item-title"},t.label),Object(r.createElement)("span",{className:"woocommerce-legend__item-total"},kr(c)(t.total))))))),h&&Object(r.createElement)("div",{className:"woocommerce-legend__total"},u))}}Er.propTypes={className:c.a.string,colorScheme:c.a.func,data:c.a.array.isRequired,handleLegendToggle:c.a.func,handleLegendHover:c.a.func,interactive:c.a.bool,legendDirection:c.a.oneOf(["row","column"]),legendValueFormat:c.a.oneOfType([c.a.string,c.a.func]),totalLabel:c.a.string,instanceId:c.a.number},Er.defaultProps={interactive:!0,legendDirection:"row",legendValueFormat:","};var jr=Object(D.withInstanceId)(Er);function Fr(){}var Pr=function(e){return null==e?Fr:function(){return this.querySelector(e)}};function Mr(){return[]}var xr=function(e){return new Array(e.length)};function Tr(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}Tr.prototype={constructor:Tr,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function Nr(e,t,n,r,o,a){for(var i,s=0,c=t.length,l=a.length;s<l;++s)(i=t[s])?(i.__data__=a[s],r[s]=i):n[s]=new Tr(e,a[s]);for(;s<c;++s)(i=t[s])&&(o[s]=i)}function Ir(e,t,n,r,o,a,i){var s,c,l,u={},d=t.length,f=a.length,p=new Array(d);for(s=0;s<d;++s)(c=t[s])&&(p[s]=l="$"+i.call(c,c.__data__,s,t),l in u?o[s]=c:u[l]=c);for(s=0;s<f;++s)(c=u[l="$"+i.call(e,a[s],s,a)])?(r[s]=c,c.__data__=a[s],u[l]=null):n[s]=new Tr(e,a[s]);for(s=0;s<d;++s)(c=t[s])&&u[p[s]]===c&&(o[s]=c)}function Rr(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}var Ar="http://www.w3.org/1999/xhtml",Lr={svg:"http://www.w3.org/2000/svg",xhtml:Ar,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"},Ur=function(e){var t=e+="",n=t.indexOf(":");return n>=0&&"xmlns"!==(t=e.slice(0,n))&&(e=e.slice(n+1)),Lr.hasOwnProperty(t)?{space:Lr[t],local:e}:e};function Br(e){return function(){this.removeAttribute(e)}}function Hr(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Kr(e,t){return function(){this.setAttribute(e,t)}}function zr(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function qr(e,t){return function(){var n=t.apply(this,arguments);null==n?this.removeAttribute(e):this.setAttribute(e,n)}}function Vr(e,t){return function(){var n=t.apply(this,arguments);null==n?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}var Wr=function(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView};function Gr(e){return function(){this.style.removeProperty(e)}}function Yr(e,t,n){return function(){this.style.setProperty(e,t,n)}}function $r(e,t,n){return function(){var r=t.apply(this,arguments);null==r?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function Qr(e,t){return e.style.getPropertyValue(t)||Wr(e).getComputedStyle(e,null).getPropertyValue(t)}function Zr(e){return function(){delete this[e]}}function Xr(e,t){return function(){this[e]=t}}function Jr(e,t){return function(){var n=t.apply(this,arguments);null==n?delete this[e]:this[e]=n}}function eo(e){return e.trim().split(/^|\s+/)}function to(e){return e.classList||new no(e)}function no(e){this._node=e,this._names=eo(e.getAttribute("class")||"")}function ro(e,t){for(var n=to(e),r=-1,o=t.length;++r<o;)n.add(t[r])}function oo(e,t){for(var n=to(e),r=-1,o=t.length;++r<o;)n.remove(t[r])}function ao(e){return function(){ro(this,e)}}function io(e){return function(){oo(this,e)}}function so(e,t){return function(){(t.apply(this,arguments)?ro:oo)(this,e)}}no.prototype={add:function(e){this._names.indexOf(e)<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function co(){this.textContent=""}function lo(e){return function(){this.textContent=e}}function uo(e){return function(){var t=e.apply(this,arguments);this.textContent=null==t?"":t}}function fo(){this.innerHTML=""}function po(e){return function(){this.innerHTML=e}}function ho(e){return function(){var t=e.apply(this,arguments);this.innerHTML=null==t?"":t}}function mo(){this.nextSibling&&this.parentNode.appendChild(this)}function bo(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function go(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===Ar&&t.documentElement.namespaceURI===Ar?t.createElement(e):t.createElementNS(n,e)}}function yo(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}var vo=function(e){var t=Ur(e);return(t.local?yo:go)(t)};function _o(){return null}function Oo(){var e=this.parentNode;e&&e.removeChild(this)}function wo(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function ko(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}var So={},Do=null;"undefined"!=typeof document&&("onmouseenter"in document.documentElement||(So={mouseenter:"mouseover",mouseleave:"mouseout"}));function Co(e,t,n){return e=Eo(e,t,n),function(t){var n=t.relatedTarget;n&&(n===this||8&n.compareDocumentPosition(this))||e.call(this,t)}}function Eo(e,t,n){return function(r){var o=Do;Do=r;try{e.call(this,this.__data__,t,n)}finally{Do=o}}}function jo(e){return e.trim().split(/^|\s+/).map((function(e){var t="",n=e.indexOf(".");return n>=0&&(t=e.slice(n+1),e=e.slice(0,n)),{type:e,name:t}}))}function Fo(e){return function(){var t=this.__on;if(t){for(var n,r=0,o=-1,a=t.length;r<a;++r)n=t[r],e.type&&n.type!==e.type||n.name!==e.name?t[++o]=n:this.removeEventListener(n.type,n.listener,n.capture);++o?t.length=o:delete this.__on}}}function Po(e,t,n){var r=So.hasOwnProperty(e.type)?Co:Eo;return function(o,a,i){var s,c=this.__on,l=r(t,a,i);if(c)for(var u=0,d=c.length;u<d;++u)if((s=c[u]).type===e.type&&s.name===e.name)return this.removeEventListener(s.type,s.listener,s.capture),this.addEventListener(s.type,s.listener=l,s.capture=n),void(s.value=t);this.addEventListener(e.type,l,n),s={type:e.type,name:e.name,value:t,listener:l,capture:n},c?c.push(s):this.__on=[s]}}function Mo(e,t,n){var r=Wr(e),o=r.CustomEvent;"function"==typeof o?o=new o(t,n):(o=r.document.createEvent("Event"),n?(o.initEvent(t,n.bubbles,n.cancelable),o.detail=n.detail):o.initEvent(t,!1,!1)),e.dispatchEvent(o)}function xo(e,t){return function(){return Mo(this,e,t)}}function To(e,t){return function(){return Mo(this,e,t.apply(this,arguments))}}var No=[null];function Io(e,t){this._groups=e,this._parents=t}function Ro(){return new Io([[document.documentElement]],No)}Io.prototype=Ro.prototype={constructor:Io,select:function(e){"function"!=typeof e&&(e=Pr(e));for(var t=this._groups,n=t.length,r=new Array(n),o=0;o<n;++o)for(var a,i,s=t[o],c=s.length,l=r[o]=new Array(c),u=0;u<c;++u)(a=s[u])&&(i=e.call(a,a.__data__,u,s))&&("__data__"in a&&(i.__data__=a.__data__),l[u]=i);return new Io(r,this._parents)},selectAll:function(e){var t;"function"!=typeof e&&(e=null==(t=e)?Mr:function(){return this.querySelectorAll(t)});for(var n=this._groups,r=n.length,o=[],a=[],i=0;i<r;++i)for(var s,c=n[i],l=c.length,u=0;u<l;++u)(s=c[u])&&(o.push(e.call(s,s.__data__,u,c)),a.push(s));return new Io(o,a)},filter:function(e){var t;"function"!=typeof e&&(t=e,e=function(){return this.matches(t)});for(var n=this._groups,r=n.length,o=new Array(r),a=0;a<r;++a)for(var i,s=n[a],c=s.length,l=o[a]=[],u=0;u<c;++u)(i=s[u])&&e.call(i,i.__data__,u,s)&&l.push(i);return new Io(o,this._parents)},data:function(e,t){if(!e)return h=new Array(this.size()),u=-1,this.each((function(e){h[++u]=e})),h;var n,r=t?Ir:Nr,o=this._parents,a=this._groups;"function"!=typeof e&&(n=e,e=function(){return n});for(var i=a.length,s=new Array(i),c=new Array(i),l=new Array(i),u=0;u<i;++u){var d=o[u],f=a[u],p=f.length,h=e.call(d,d&&d.__data__,u,o),m=h.length,b=c[u]=new Array(m),g=s[u]=new Array(m);r(d,f,b,g,l[u]=new Array(p),h,t);for(var y,v,_=0,O=0;_<m;++_)if(y=b[_]){for(_>=O&&(O=_+1);!(v=g[O])&&++O<m;);y._next=v||null}}return(s=new Io(s,o))._enter=c,s._exit=l,s},enter:function(){return new Io(this._enter||this._groups.map(xr),this._parents)},exit:function(){return new Io(this._exit||this._groups.map(xr),this._parents)},join:function(e,t,n){var r=this.enter(),o=this,a=this.exit();return r="function"==typeof e?e(r):r.append(e+""),null!=t&&(o=t(o)),null==n?a.remove():n(a),r&&o?r.merge(o).order():o},merge:function(e){for(var t=this._groups,n=e._groups,r=t.length,o=n.length,a=Math.min(r,o),i=new Array(r),s=0;s<a;++s)for(var c,l=t[s],u=n[s],d=l.length,f=i[s]=new Array(d),p=0;p<d;++p)(c=l[p]||u[p])&&(f[p]=c);for(;s<r;++s)i[s]=t[s];return new Io(i,this._parents)},order:function(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var r,o=e[t],a=o.length-1,i=o[a];--a>=0;)(r=o[a])&&(i&&4^r.compareDocumentPosition(i)&&i.parentNode.insertBefore(r,i),i=r);return this},sort:function(e){function t(t,n){return t&&n?e(t.__data__,n.__data__):!t-!n}e||(e=Rr);for(var n=this._groups,r=n.length,o=new Array(r),a=0;a<r;++a){for(var i,s=n[a],c=s.length,l=o[a]=new Array(c),u=0;u<c;++u)(i=s[u])&&(l[u]=i);l.sort(t)}return new Io(o,this._parents).order()},call:function(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this},nodes:function(){var e=new Array(this.size()),t=-1;return this.each((function(){e[++t]=this})),e},node:function(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],o=0,a=r.length;o<a;++o){var i=r[o];if(i)return i}return null},size:function(){var e=0;return this.each((function(){++e})),e},empty:function(){return!this.node()},each:function(e){for(var t=this._groups,n=0,r=t.length;n<r;++n)for(var o,a=t[n],i=0,s=a.length;i<s;++i)(o=a[i])&&e.call(o,o.__data__,i,a);return this},attr:function(e,t){var n=Ur(e);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((null==t?n.local?Hr:Br:"function"==typeof t?n.local?Vr:qr:n.local?zr:Kr)(n,t))},style:function(e,t,n){return arguments.length>1?this.each((null==t?Gr:"function"==typeof t?$r:Yr)(e,t,null==n?"":n)):Qr(this.node(),e)},property:function(e,t){return arguments.length>1?this.each((null==t?Zr:"function"==typeof t?Jr:Xr)(e,t)):this.node()[e]},classed:function(e,t){var n=eo(e+"");if(arguments.length<2){for(var r=to(this.node()),o=-1,a=n.length;++o<a;)if(!r.contains(n[o]))return!1;return!0}return this.each(("function"==typeof t?so:t?ao:io)(n,t))},text:function(e){return arguments.length?this.each(null==e?co:("function"==typeof e?uo:lo)(e)):this.node().textContent},html:function(e){return arguments.length?this.each(null==e?fo:("function"==typeof e?ho:po)(e)):this.node().innerHTML},raise:function(){return this.each(mo)},lower:function(){return this.each(bo)},append:function(e){var t="function"==typeof e?e:vo(e);return this.select((function(){return this.appendChild(t.apply(this,arguments))}))},insert:function(e,t){var n="function"==typeof e?e:vo(e),r=null==t?_o:"function"==typeof t?t:Pr(t);return this.select((function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)}))},remove:function(){return this.each(Oo)},clone:function(e){return this.select(e?ko:wo)},datum:function(e){return arguments.length?this.property("__data__",e):this.node().__data__},on:function(e,t,n){var r,o,a=jo(e+""),i=a.length;if(!(arguments.length<2)){for(s=t?Po:Fo,null==n&&(n=!1),r=0;r<i;++r)this.each(s(a[r],t,n));return this}var s=this.node().__on;if(s)for(var c,l=0,u=s.length;l<u;++l)for(r=0,c=s[l];r<i;++r)if((o=a[r]).type===c.type&&o.name===c.name)return c.value},dispatch:function(e,t){return this.each(("function"==typeof t?To:xo)(e,t))}};var Ao=function(e){return"string"==typeof e?new Io([[document.querySelector(e)]],[document.documentElement]):new Io([[e]],No)};class Lo extends r.Component{constructor(e){super(e),this.chartRef=Object(r.createRef)()}componentDidMount(){this.drawUpdatedChart()}shouldComponentUpdate(e){return this.props.className!==e.className||!Object(l.isEqual)(this.props.data,e.data)||!Object(l.isEqual)(this.props.orderedKeys,e.orderedKeys)||this.props.drawChart!==e.drawChart||this.props.height!==e.height||this.props.chartType!==e.chartType||this.props.width!==e.width}componentDidUpdate(){this.drawUpdatedChart()}componentWillUnmount(){this.deleteChart()}delayedScroll(){const{tooltip:e}=this.props;return Object(l.throttle)(()=>{e&&e.hide()},300)}deleteChart(){Ao(this.chartRef.current).selectAll("svg").remove()}drawUpdatedChart(){const{drawChart:e}=this.props;e(this.getContainer())}getContainer(){const{className:e,height:t,width:n}=this.props;this.deleteChart();const r=Ao(this.chartRef.current).append("svg").attr("viewBox",`0 0 ${n} ${t}`).attr("height",t).attr("width",n).attr("preserveAspectRatio","xMidYMid meet");return e&&r.attr("class",e+"__viewbox"),r.append("g")}render(){const{className:e}=this.props;return Object(r.createElement)("div",{className:i()("d3-base",e),ref:this.chartRef,onScroll:this.delayedScroll()})}}Lo.propTypes={className:c.a.string,data:c.a.array,orderedKeys:c.a.array,tooltip:c.a.object,chartType:c.a.string};var Uo=function(e,t){return e<t?-1:e>t?1:e>=t?0:NaN},Bo=function(e){var t;return 1===e.length&&(t=e,e=function(e,n){return Uo(t(e),n)}),{left:function(t,n,r,o){for(null==r&&(r=0),null==o&&(o=t.length);r<o;){var a=r+o>>>1;e(t[a],n)<0?r=a+1:o=a}return r},right:function(t,n,r,o){for(null==r&&(r=0),null==o&&(o=t.length);r<o;){var a=r+o>>>1;e(t[a],n)>0?o=a:r=a+1}return r}}};var Ho=Bo(Uo),Ko=Ho.right,zo=(Ho.left,Ko);var qo=Array.prototype,Vo=(qo.slice,qo.map,function(e,t,n){e=+e,t=+t,n=(o=arguments.length)<2?(t=e,e=0,1):o<3?1:+n;for(var r=-1,o=0|Math.max(0,Math.ceil((t-e)/n)),a=new Array(o);++r<o;)a[r]=e+r*n;return a}),Wo=Math.sqrt(50),Go=Math.sqrt(10),Yo=Math.sqrt(2),$o=function(e,t,n){var r,o,a,i,s=-1;if(n=+n,(e=+e)===(t=+t)&&n>0)return[e];if((r=t<e)&&(o=e,e=t,t=o),0===(i=Qo(e,t,n))||!isFinite(i))return[];if(i>0)for(e=Math.ceil(e/i),t=Math.floor(t/i),a=new Array(o=Math.ceil(t-e+1));++s<o;)a[s]=(e+s)*i;else for(e=Math.floor(e*i),t=Math.ceil(t*i),a=new Array(o=Math.ceil(e-t+1));++s<o;)a[s]=(e-s)/i;return r&&a.reverse(),a};function Qo(e,t,n){var r=(t-e)/Math.max(0,n),o=Math.floor(Math.log(r)/Math.LN10),a=r/Math.pow(10,o);return o>=0?(a>=Wo?10:a>=Go?5:a>=Yo?2:1)*Math.pow(10,o):-Math.pow(10,-o)/(a>=Wo?10:a>=Go?5:a>=Yo?2:1)}function Zo(e,t,n){var r=Math.abs(t-e)/Math.max(0,n),o=Math.pow(10,Math.floor(Math.log(r)/Math.LN10)),a=r/o;return a>=Wo?o*=10:a>=Go?o*=5:a>=Yo&&(o*=2),t<e?-o:o}function Xo(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e)}return this}function Jo(){}function ea(e,t){var n=new Jo;if(e instanceof Jo)e.each((function(e,t){n.set(t,e)}));else if(Array.isArray(e)){var r,o=-1,a=e.length;if(null==t)for(;++o<a;)n.set(o,e[o]);else for(;++o<a;)n.set(t(r=e[o],o,e),r)}else if(e)for(var i in e)n.set(i,e[i]);return n}Jo.prototype=ea.prototype={constructor:Jo,has:function(e){return"$"+e in this},get:function(e){return this["$"+e]},set:function(e,t){return this["$"+e]=t,this},remove:function(e){var t="$"+e;return t in this&&delete this[t]},clear:function(){for(var e in this)"$"===e[0]&&delete this[e]},keys:function(){var e=[];for(var t in this)"$"===t[0]&&e.push(t.slice(1));return e},values:function(){var e=[];for(var t in this)"$"===t[0]&&e.push(this[t]);return e},entries:function(){var e=[];for(var t in this)"$"===t[0]&&e.push({key:t.slice(1),value:this[t]});return e},size:function(){var e=0;for(var t in this)"$"===t[0]&&++e;return e},empty:function(){for(var e in this)if("$"===e[0])return!1;return!0},each:function(e){for(var t in this)"$"===t[0]&&e(this[t],t.slice(1),this)}};var ta=ea;function na(){}var ra=ta.prototype;function oa(e,t){var n=new na;if(e instanceof na)e.each((function(e){n.add(e)}));else if(e){var r=-1,o=e.length;if(null==t)for(;++r<o;)n.add(e[r]);else for(;++r<o;)n.add(t(e[r],r,e))}return n}na.prototype=oa.prototype={constructor:na,has:ra.has,add:function(e){return this["$"+(e+="")]=e,this},remove:ra.remove,clear:ra.clear,values:ra.keys,size:ra.size,empty:ra.empty,each:ra.each};var aa=Array.prototype,ia=aa.map,sa=aa.slice,ca={name:"implicit"};function la(){var e=ta(),t=[],n=[],r=ca;function o(o){var a=o+"",i=e.get(a);if(!i){if(r!==ca)return r;e.set(a,i=t.push(o))}return n[(i-1)%n.length]}return o.domain=function(n){if(!arguments.length)return t.slice();t=[],e=ta();for(var r,a,i=-1,s=n.length;++i<s;)e.has(a=(r=n[i])+"")||e.set(a,t.push(r));return o},o.range=function(e){return arguments.length?(n=sa.call(e),o):n.slice()},o.unknown=function(e){return arguments.length?(r=e,o):r},o.copy=function(){return la(t,n).unknown(r)},Xo.apply(o,arguments),o}function ua(){var e,t,n=la().unknown(void 0),r=n.domain,o=n.range,a=[0,1],i=!1,s=0,c=0,l=.5;function u(){var n=r().length,u=a[1]<a[0],d=a[u-0],f=a[1-u];e=(f-d)/Math.max(1,n-s+2*c),i&&(e=Math.floor(e)),d+=(f-d-e*(n-s))*l,t=e*(1-s),i&&(d=Math.round(d),t=Math.round(t));var p=Vo(n).map((function(t){return d+e*t}));return o(u?p.reverse():p)}return delete n.unknown,n.domain=function(e){return arguments.length?(r(e),u()):r()},n.range=function(e){return arguments.length?(a=[+e[0],+e[1]],u()):a.slice()},n.rangeRound=function(e){return a=[+e[0],+e[1]],i=!0,u()},n.bandwidth=function(){return t},n.step=function(){return e},n.round=function(e){return arguments.length?(i=!!e,u()):i},n.padding=function(e){return arguments.length?(s=Math.min(1,c=+e),u()):s},n.paddingInner=function(e){return arguments.length?(s=Math.min(1,e),u()):s},n.paddingOuter=function(e){return arguments.length?(c=+e,u()):c},n.align=function(e){return arguments.length?(l=Math.max(0,Math.min(1,e)),u()):l},n.copy=function(){return ua(r(),a).round(i).paddingInner(s).paddingOuter(c).align(l)},Xo.apply(u(),arguments)}var da=function(e,t,n){e.prototype=t.prototype=n,n.constructor=e};function fa(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function pa(){}var ha="\\s*([+-]?\\d+)\\s*",ma="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",ba="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",ga=/^#([0-9a-f]{3,8})$/,ya=new RegExp("^rgb\\("+[ha,ha,ha]+"\\)$"),va=new RegExp("^rgb\\("+[ba,ba,ba]+"\\)$"),_a=new RegExp("^rgba\\("+[ha,ha,ha,ma]+"\\)$"),Oa=new RegExp("^rgba\\("+[ba,ba,ba,ma]+"\\)$"),wa=new RegExp("^hsl\\("+[ma,ba,ba]+"\\)$"),ka=new RegExp("^hsla\\("+[ma,ba,ba,ma]+"\\)$"),Sa={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function Da(){return this.rgb().formatHex()}function Ca(){return this.rgb().formatRgb()}function Ea(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=ga.exec(e))?(n=t[1].length,t=parseInt(t[1],16),6===n?ja(t):3===n?new xa(t>>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===n?Fa(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===n?Fa(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|240&t,((15&t)<<4|15&t)/255):null):(t=ya.exec(e))?new xa(t[1],t[2],t[3],1):(t=va.exec(e))?new xa(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=_a.exec(e))?Fa(t[1],t[2],t[3],t[4]):(t=Oa.exec(e))?Fa(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=wa.exec(e))?Ra(t[1],t[2]/100,t[3]/100,1):(t=ka.exec(e))?Ra(t[1],t[2]/100,t[3]/100,t[4]):Sa.hasOwnProperty(e)?ja(Sa[e]):"transparent"===e?new xa(NaN,NaN,NaN,0):null}function ja(e){return new xa(e>>16&255,e>>8&255,255&e,1)}function Fa(e,t,n,r){return r<=0&&(e=t=n=NaN),new xa(e,t,n,r)}function Pa(e){return e instanceof pa||(e=Ea(e)),e?new xa((e=e.rgb()).r,e.g,e.b,e.opacity):new xa}function Ma(e,t,n,r){return 1===arguments.length?Pa(e):new xa(e,t,n,null==r?1:r)}function xa(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}function Ta(){return"#"+Ia(this.r)+Ia(this.g)+Ia(this.b)}function Na(){var e=this.opacity;return(1===(e=isNaN(e)?1:Math.max(0,Math.min(1,e)))?"rgb(":"rgba(")+Math.max(0,Math.min(255,Math.round(this.r)||0))+", "+Math.max(0,Math.min(255,Math.round(this.g)||0))+", "+Math.max(0,Math.min(255,Math.round(this.b)||0))+(1===e?")":", "+e+")")}function Ia(e){return((e=Math.max(0,Math.min(255,Math.round(e)||0)))<16?"0":"")+e.toString(16)}function Ra(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new La(e,t,n,r)}function Aa(e){if(e instanceof La)return new La(e.h,e.s,e.l,e.opacity);if(e instanceof pa||(e=Ea(e)),!e)return new La;if(e instanceof La)return e;var t=(e=e.rgb()).r/255,n=e.g/255,r=e.b/255,o=Math.min(t,n,r),a=Math.max(t,n,r),i=NaN,s=a-o,c=(a+o)/2;return s?(i=t===a?(n-r)/s+6*(n<r):n===a?(r-t)/s+2:(t-n)/s+4,s/=c<.5?a+o:2-a-o,i*=60):s=c>0&&c<1?0:i,new La(i,s,c,e.opacity)}function La(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}function Ua(e,t,n){return 255*(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)}function Ba(e,t,n,r,o){var a=e*e,i=a*e;return((1-3*e+3*a-i)*t+(4-6*a+3*i)*n+(1+3*e+3*a-3*i)*r+i*o)/6}da(pa,Ea,{copy:function(e){return Object.assign(new this.constructor,this,e)},displayable:function(){return this.rgb().displayable()},hex:Da,formatHex:Da,formatHsl:function(){return Aa(this).formatHsl()},formatRgb:Ca,toString:Ca}),da(xa,Ma,fa(pa,{brighter:function(e){return e=null==e?1/.7:Math.pow(1/.7,e),new xa(this.r*e,this.g*e,this.b*e,this.opacity)},darker:function(e){return e=null==e?.7:Math.pow(.7,e),new xa(this.r*e,this.g*e,this.b*e,this.opacity)},rgb:function(){return this},displayable:function(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:Ta,formatHex:Ta,formatRgb:Na,toString:Na})),da(La,(function(e,t,n,r){return 1===arguments.length?Aa(e):new La(e,t,n,null==r?1:r)}),fa(pa,{brighter:function(e){return e=null==e?1/.7:Math.pow(1/.7,e),new La(this.h,this.s,this.l*e,this.opacity)},darker:function(e){return e=null==e?.7:Math.pow(.7,e),new La(this.h,this.s,this.l*e,this.opacity)},rgb:function(){var e=this.h%360+360*(this.h<0),t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,o=2*n-r;return new xa(Ua(e>=240?e-240:e+120,o,r),Ua(e,o,r),Ua(e<120?e+240:e-120,o,r),this.opacity)},displayable:function(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl:function(){var e=this.opacity;return(1===(e=isNaN(e)?1:Math.max(0,Math.min(1,e)))?"hsl(":"hsla(")+(this.h||0)+", "+100*(this.s||0)+"%, "+100*(this.l||0)+"%"+(1===e?")":", "+e+")")}}));var Ha=function(e){return function(){return e}};function Ka(e,t){return function(n){return e+n*t}}function za(e){return 1==(e=+e)?qa:function(t,n){return n-t?function(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}(t,n,e):Ha(isNaN(t)?n:t)}}function qa(e,t){var n=t-e;return n?Ka(e,n):Ha(isNaN(e)?t:e)}var Va=function e(t){var n=za(t);function r(e,t){var r=n((e=Ma(e)).r,(t=Ma(t)).r),o=n(e.g,t.g),a=n(e.b,t.b),i=qa(e.opacity,t.opacity);return function(t){return e.r=r(t),e.g=o(t),e.b=a(t),e.opacity=i(t),e+""}}return r.gamma=e,r}(1);function Wa(e){return function(t){var n,r,o=t.length,a=new Array(o),i=new Array(o),s=new Array(o);for(n=0;n<o;++n)r=Ma(t[n]),a[n]=r.r||0,i[n]=r.g||0,s[n]=r.b||0;return a=e(a),i=e(i),s=e(s),r.opacity=1,function(e){return r.r=a(e),r.g=i(e),r.b=s(e),r+""}}}Wa((function(e){var t=e.length-1;return function(n){var r=n<=0?n=0:n>=1?(n=1,t-1):Math.floor(n*t),o=e[r],a=e[r+1],i=r>0?e[r-1]:2*o-a,s=r<t-1?e[r+2]:2*a-o;return Ba((n-r/t)*t,i,o,a,s)}})),Wa((function(e){var t=e.length;return function(n){var r=Math.floor(((n%=1)<0?++n:n)*t),o=e[(r+t-1)%t],a=e[r%t],i=e[(r+1)%t],s=e[(r+2)%t];return Ba((n-r/t)*t,o,a,i,s)}}));var Ga=function(e,t){t||(t=[]);var n,r=e?Math.min(t.length,e.length):0,o=t.slice();return function(a){for(n=0;n<r;++n)o[n]=e[n]*(1-a)+t[n]*a;return o}};function Ya(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function $a(e,t){var n,r=t?t.length:0,o=e?Math.min(r,e.length):0,a=new Array(o),i=new Array(r);for(n=0;n<o;++n)a[n]=ni(e[n],t[n]);for(;n<r;++n)i[n]=t[n];return function(e){for(n=0;n<o;++n)i[n]=a[n](e);return i}}var Qa=function(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}},Za=function(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}},Xa=function(e,t){var n,r={},o={};for(n in null!==e&&"object"==typeof e||(e={}),null!==t&&"object"==typeof t||(t={}),t)n in e?r[n]=ni(e[n],t[n]):o[n]=t[n];return function(e){for(n in r)o[n]=r[n](e);return o}},Ja=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,ei=new RegExp(Ja.source,"g");var ti=function(e,t){var n,r,o,a=Ja.lastIndex=ei.lastIndex=0,i=-1,s=[],c=[];for(e+="",t+="";(n=Ja.exec(e))&&(r=ei.exec(t));)(o=r.index)>a&&(o=t.slice(a,o),s[i]?s[i]+=o:s[++i]=o),(n=n[0])===(r=r[0])?s[i]?s[i]+=r:s[++i]=r:(s[++i]=null,c.push({i:i,x:Za(n,r)})),a=ei.lastIndex;return a<t.length&&(o=t.slice(a),s[i]?s[i]+=o:s[++i]=o),s.length<2?c[0]?function(e){return function(t){return e(t)+""}}(c[0].x):function(e){return function(){return e}}(t):(t=c.length,function(e){for(var n,r=0;r<t;++r)s[(n=c[r]).i]=n.x(e);return s.join("")})},ni=function(e,t){var n,r=typeof t;return null==t||"boolean"===r?Ha(t):("number"===r?Za:"string"===r?(n=Ea(t))?(t=n,Va):ti:t instanceof Ea?Va:t instanceof Date?Qa:Ya(t)?Ga:Array.isArray(t)?$a:"function"!=typeof t.valueOf&&"function"!=typeof t.toString||isNaN(t)?Xa:Za)(e,t)},ri=function(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}},oi=function(e){return+e},ai=[0,1];function ii(e){return e}function si(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:(n=isNaN(t)?NaN:.5,function(){return n});var n}function ci(e){var t,n=e[0],r=e[e.length-1];return n>r&&(t=n,n=r,r=t),function(e){return Math.max(n,Math.min(r,e))}}function li(e,t,n){var r=e[0],o=e[1],a=t[0],i=t[1];return o<r?(r=si(o,r),a=n(i,a)):(r=si(r,o),a=n(a,i)),function(e){return a(r(e))}}function ui(e,t,n){var r=Math.min(e.length,t.length)-1,o=new Array(r),a=new Array(r),i=-1;for(e[r]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++i<r;)o[i]=si(e[i],e[i+1]),a[i]=n(t[i],t[i+1]);return function(t){var n=zo(e,t,1,r)-1;return a[n](o[n](t))}}function di(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function fi(){var e,t,n,r,o,a,i=ai,s=ai,c=ni,l=ii;function u(){return r=Math.min(i.length,s.length)>2?ui:li,o=a=null,d}function d(t){return isNaN(t=+t)?n:(o||(o=r(i.map(e),s,c)))(e(l(t)))}return d.invert=function(n){return l(t((a||(a=r(s,i.map(e),Za)))(n)))},d.domain=function(e){return arguments.length?(i=ia.call(e,oi),l===ii||(l=ci(i)),u()):i.slice()},d.range=function(e){return arguments.length?(s=sa.call(e),u()):s.slice()},d.rangeRound=function(e){return s=sa.call(e),c=ri,u()},d.clamp=function(e){return arguments.length?(l=e?ci(i):ii,d):l!==ii},d.interpolate=function(e){return arguments.length?(c=e,u()):c},d.unknown=function(e){return arguments.length?(n=e,d):n},function(n,r){return e=n,t=r,u()}}function pi(e,t){return fi()(e,t)}var hi=function(e,t,n,r){var o,a=Zo(e,t,n);switch((r=et(null==r?",f":r)).type){case"s":var i=Math.max(Math.abs(e),Math.abs(t));return null!=r.precision||isNaN(o=function(e,t){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(Xe(t)/3)))-Xe(Math.abs(e)))}(a,i))||(r.precision=o),at(r,i);case"":case"e":case"g":case"p":case"r":null!=r.precision||isNaN(o=function(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,Xe(t)-Xe(e))+1}(a,Math.max(Math.abs(e),Math.abs(t))))||(r.precision=o-("e"===r.type));break;case"f":case"%":null!=r.precision||isNaN(o=function(e){return Math.max(0,-Xe(Math.abs(e)))}(a))||(r.precision=o-2*("%"===r.type))}return ot(r)};function mi(e){var t=e.domain;return e.ticks=function(e){var n=t();return $o(n[0],n[n.length-1],null==e?10:e)},e.tickFormat=function(e,n){var r=t();return hi(r[0],r[r.length-1],null==e?10:e,n)},e.nice=function(n){null==n&&(n=10);var r,o=t(),a=0,i=o.length-1,s=o[a],c=o[i];return c<s&&(r=s,s=c,c=r,r=a,a=i,i=r),(r=Qo(s,c,n))>0?r=Qo(s=Math.floor(s/r)*r,c=Math.ceil(c/r)*r,n):r<0&&(r=Qo(s=Math.ceil(s*r)/r,c=Math.floor(c*r)/r,n)),r>0?(o[a]=Math.floor(s/r)*r,o[i]=Math.ceil(c/r)*r,t(o)):r<0&&(o[a]=Math.ceil(s*r)/r,o[i]=Math.floor(c*r)/r,t(o)),e},e}var bi=function(e,t){var n,r=0,o=(e=e.slice()).length-1,a=e[r],i=e[o];return i<a&&(n=r,r=o,o=n,n=a,a=i,i=n),e[r]=t.floor(a),e[o]=t.ceil(i),e};var gi=jt((function(e){e.setDate(1),e.setHours(0,0,0,0)}),(function(e,t){e.setMonth(e.getMonth()+t)}),(function(e,t){return t.getMonth()-e.getMonth()+12*(t.getFullYear()-e.getFullYear())}),(function(e){return e.getMonth()})),yi=gi,vi=(gi.range,jt((function(e){e.setTime(e-e.getMilliseconds()-1e3*e.getSeconds()-6e4*e.getMinutes())}),(function(e,t){e.setTime(+e+36e5*t)}),(function(e,t){return(t-e)/36e5}),(function(e){return e.getHours()}))),_i=vi,Oi=(vi.range,jt((function(e){e.setTime(e-e.getMilliseconds()-1e3*e.getSeconds())}),(function(e,t){e.setTime(+e+6e4*t)}),(function(e,t){return(t-e)/6e4}),(function(e){return e.getMinutes()}))),wi=Oi,ki=(Oi.range,jt((function(e){e.setTime(e-e.getMilliseconds())}),(function(e,t){e.setTime(+e+1e3*t)}),(function(e,t){return(t-e)/1e3}),(function(e){return e.getUTCSeconds()}))),Si=ki,Di=(ki.range,jt((function(){}),(function(e,t){e.setTime(+e+t)}),(function(e,t){return t-e})));Di.every=function(e){return e=Math.floor(e),isFinite(e)&&e>0?e>1?jt((function(t){t.setTime(Math.floor(t/e)*e)}),(function(t,n){t.setTime(+t+n*e)}),(function(t,n){return(n-t)/e})):Di:null};var Ci=Di;Di.range;function Ei(e){return new Date(e)}function ji(e){return e instanceof Date?+e:+new Date(+e)}function Fi(e,t,n,r,o,a,i,s,c){var l=pi(ii,ii),u=l.invert,d=l.domain,f=c(".%L"),p=c(":%S"),h=c("%I:%M"),m=c("%I %p"),b=c("%a %d"),g=c("%b %d"),y=c("%B"),v=c("%Y"),_=[[i,1,1e3],[i,5,5e3],[i,15,15e3],[i,30,3e4],[a,1,6e4],[a,5,3e5],[a,15,9e5],[a,30,18e5],[o,1,36e5],[o,3,108e5],[o,6,216e5],[o,12,432e5],[r,1,864e5],[r,2,1728e5],[n,1,6048e5],[t,1,2592e6],[t,3,7776e6],[e,1,31536e6]];function O(s){return(i(s)<s?f:a(s)<s?p:o(s)<s?h:r(s)<s?m:t(s)<s?n(s)<s?b:g:e(s)<s?y:v)(s)}function w(t,n,r,o){if(null==t&&(t=10),"number"==typeof t){var a=Math.abs(r-n)/t,i=Bo((function(e){return e[2]})).right(_,a);i===_.length?(o=Zo(n/31536e6,r/31536e6,t),t=e):i?(o=(i=_[a/_[i-1][2]<_[i][2]/a?i-1:i])[1],t=i[0]):(o=Math.max(Zo(n,r,t),1),t=s)}return null==o?t:t.every(o)}return l.invert=function(e){return new Date(u(e))},l.domain=function(e){return arguments.length?d(ia.call(e,ji)):d().map(Ei)},l.ticks=function(e,t){var n,r=d(),o=r[0],a=r[r.length-1],i=a<o;return i&&(n=o,o=a,a=n),n=(n=w(e,o,a,t))?n.range(o,a+1):[],i?n.reverse():n},l.tickFormat=function(e,t){return null==t?O:c(t)},l.nice=function(e,t){var n=d();return(e=w(e,n[0],n[n.length-1],t))?d(bi(n,e)):l},l.copy=function(){return di(l,Fi(e,t,n,r,o,a,i,s,c))},l}var Pi=jt((function(e){e.setUTCDate(1),e.setUTCHours(0,0,0,0)}),(function(e,t){e.setUTCMonth(e.getUTCMonth()+t)}),(function(e,t){return t.getUTCMonth()-e.getUTCMonth()+12*(t.getUTCFullYear()-e.getUTCFullYear())}),(function(e){return e.getUTCMonth()})),Mi=(Pi.range,jt((function(e){e.setUTCMinutes(0,0,0)}),(function(e,t){e.setTime(+e+36e5*t)}),(function(e,t){return(t-e)/36e5}),(function(e){return e.getUTCHours()}))),xi=(Mi.range,jt((function(e){e.setUTCSeconds(0,0)}),(function(e,t){e.setTime(+e+6e4*t)}),(function(e,t){return(t-e)/6e4}),(function(e){return e.getUTCMinutes()})));xi.range;const Ti=(e,t,n=!1)=>ua().domain(e.filter(e=>e.visible).map(e=>e.key)).rangeRound([0,t.bandwidth()]).padding(n?0:.07),Ni=(e,t)=>function(){return Xo.apply(Fi(Qt,yi,Bt,Yt,_i,wi,Si,Ci,rn).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}().domain([Ee()(e[0],"YYYY-MM-DD HH:mm").toDate(),Ee()(e[e.length-1],"YYYY-MM-DD HH:mm").toDate()]).rangeRound([0,t]),Ii=e=>{const{lower:t,upper:n}=(e=>{let t=Number.NEGATIVE_INFINITY,n=Number.POSITIVE_INFINITY;return e.forEach(e=>{for(const[r,o]of Object.entries(e))"date"!==r&&Number.isFinite(o.value)&&o.value>t&&(t=o.value),"date"!==r&&Number.isFinite(o.value)&&o.value<n&&(n=o.value)}),{upper:t,lower:n}})(e),r=((e,t)=>{if(!Number.isFinite(e)||!Number.isFinite(t))return 1;if(0===t&&0===e)return 1/3;const n=4/3*Math.max(-e,t),r=3*Math.pow(10,(Math.log(n)*Math.LOG10E+1|0)-2),o=Math.ceil(n/r)*r/3;return t<1&&e>-1?Math.round(4*o)/4:Math.ceil(o)})(t,n),o={lower:0,upper:0,step:r};return(Number.isFinite(t)||t<0)&&(o.lower=Math.floor(t/r)*r,o.lower===t&&0!==t&&(o.lower-=r)),(Number.isFinite(n)||n>0)&&(o.upper=Math.ceil(n/r)*r,o.upper===n&&0!==n&&(o.upper+=r)),o},Ri=(e,t,n)=>function e(){var t=pi(ii,ii);return t.copy=function(){return di(t,e())},Xo.apply(t,arguments),mi(t)}().domain([Math.min(t,0),0===n&&0===t?1:Math.max(n,0)]).rangeRound([e,0]);var Ai=Array.prototype.slice,Li=function(e){return e};function Ui(e){return"translate("+(e+.5)+",0)"}function Bi(e){return"translate(0,"+(e+.5)+")"}function Hi(e){return function(t){return+e(t)}}function Ki(e){var t=Math.max(0,e.bandwidth()-1)/2;return e.round()&&(t=Math.round(t)),function(n){return+e(n)+t}}function zi(){return!this.__axis}function qi(e,t){var n=[],r=null,o=null,a=6,i=6,s=3,c=1===e||4===e?-1:1,l=4===e||2===e?"x":"y",u=1===e||3===e?Ui:Bi;function d(d){var f=null==r?t.ticks?t.ticks.apply(t,n):t.domain():r,p=null==o?t.tickFormat?t.tickFormat.apply(t,n):Li:o,h=Math.max(a,0)+s,m=t.range(),b=+m[0]+.5,g=+m[m.length-1]+.5,y=(t.bandwidth?Ki:Hi)(t.copy()),v=d.selection?d.selection():d,_=v.selectAll(".domain").data([null]),O=v.selectAll(".tick").data(f,t).order(),w=O.exit(),k=O.enter().append("g").attr("class","tick"),S=O.select("line"),D=O.select("text");_=_.merge(_.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),O=O.merge(k),S=S.merge(k.append("line").attr("stroke","currentColor").attr(l+"2",c*a)),D=D.merge(k.append("text").attr("fill","currentColor").attr(l,c*h).attr("dy",1===e?"0em":3===e?"0.71em":"0.32em")),d!==v&&(_=_.transition(d),O=O.transition(d),S=S.transition(d),D=D.transition(d),w=w.transition(d).attr("opacity",1e-6).attr("transform",(function(e){return isFinite(e=y(e))?u(e):this.getAttribute("transform")})),k.attr("opacity",1e-6).attr("transform",(function(e){var t=this.parentNode.__axis;return u(t&&isFinite(t=t(e))?t:y(e))}))),w.remove(),_.attr("d",4===e||2==e?i?"M"+c*i+","+b+"H0.5V"+g+"H"+c*i:"M0.5,"+b+"V"+g:i?"M"+b+","+c*i+"V0.5H"+g+"V"+c*i:"M"+b+",0.5H"+g),O.attr("opacity",1).attr("transform",(function(e){return u(y(e))})),S.attr(l+"2",c*a),D.attr(l,c*h).text(p),v.filter(zi).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",2===e?"start":4===e?"end":"middle"),v.each((function(){this.__axis=y}))}return d.scale=function(e){return arguments.length?(t=e,d):t},d.ticks=function(){return n=Ai.call(arguments),d},d.tickArguments=function(e){return arguments.length?(n=null==e?[]:Ai.call(e),d):n.slice()},d.tickValues=function(e){return arguments.length?(r=null==e?null:Ai.call(e),d):r&&r.slice()},d.tickFormat=function(e){return arguments.length?(o=e,d):o},d.tickSize=function(e){return arguments.length?(a=i=+e,d):a},d.tickSizeInner=function(e){return arguments.length?(a=+e,d):a},d.tickSizeOuter=function(e){return arguments.length?(i=+e,d):i},d.tickPadding=function(e){return arguments.length?(s=+e,d):s},d}function Vi(e){return qi(3,e)}function Wi(e){return qi(4,e)}const Gi=e=>{const t=[];for(let n=1;n<=Math.floor(Math.sqrt(e));n++)e%n==0&&(t.push(n),e/n!==n&&t.push(e/n));return t.sort((e,t)=>e-t),t},Yi=(e,t,n,r)=>{const o=((e,t)=>{if(e<783)return 7;if(e>=783&&e<=1130)return 12;if(e>1130&&e<=1365){if("time-comparison"===t)return 16;if("item-comparison"===t)return 12}else if(e>1365){if("time-comparison"===t)return 31;if("item-comparison"===t)return 16}return 16})(t,n);var a;if((e.length>=63&&"day"===r||e.length>=9&&"week"===r)&&(e=(a=e).filter((e,t)=>0===t||Ee()(e).toDate().getMonth()!==Ee()(a[t-1]).toDate().getMonth())),e.length<=o||"hour"===r&&(e=>{const t=Ee()(e[0]).toDate(),n=Ee()(e[e.length-1]).toDate();return t.getDate()===n.getDate()&&t.getMonth()===n.getMonth()&&t.getFullYear()===n.getFullYear()})(e)&&t>783)return e;return((e,t)=>{const n=[];for(let r=0;r<e.length;r+=t)n.push(e[r]);return n[0]!==e[0]&&n.unshift(e[0]),n})(e,((e,t)=>{let n=[],r=1;for(;n.length<=3;)n=Gi(e.length-r),r+=1;return n.find(n=>e.length/n<t)})(e,o))},$i=(e,t,n,r)=>{const o=Ee()(e).toDate();let a=0!==t?n[t-1]:n[t];return a=a instanceof Date?a:Ee()(a).toDate(),0===t?r(o):((e,t,n=new RegExp([" |,"],"g"))=>{const r=e.split(n),o=t.split(n),a=new Array,i=e.length>t.length?r:o;for(let e=0;e<i.length;e++)r[e]!==o[e]&&a.push(o[e]);return a})(r(a),r(o)).join(" ")},Qi=(e,t,n)=>{const r=[];for(let o=0;o<e;o++){const a=(o+1)/e*t,i=n?Math.round(a):a;r[r.length-1]!==i&&r.push(i)}return r},Zi=(e,t)=>{if(e>=0)return[];const n=Math.ceil(-e/t);return Qi(n,e,e<-1)},Xi=(e,t)=>{if(e<=0)return[];const n=Math.ceil(e/t);return Qi(n,e,e>1)},Ji=(e,t,n,r,o)=>{const a=(i=t.yScale.domain()[0],s=t.yScale.domain()[1],c=t.step,[0,...Zi(i,c),...Xi(s,c)]);var i,s,c;const l=t.xScale.range()[1],u=o?l+r.left+r.right/2-15:-r.left/2-15,d=t.yMin>=0||t.yMax>0?" with-positive-ticks":"";e.append("g").attr("class","grid"+d).attr("transform",`translate(-${r.left}, 0)`).call(Wi(t.yScale).tickValues(a).tickSize(-l-r.left-r.right).tickFormat("")),e.append("g").attr("class","axis y-axis").attr("aria-hidden","true").attr("transform","translate("+u+", 12)").attr("text-anchor","start").call(Wi(t.yScale).tickValues(0===t.yMax&&0===t.yMin?[a[0]]:a).tickFormat(e=>e>-1&&e<1&&n.yBelow1Format?n.yBelow1Format(e):n.yFormat(e)))},es=(e,t,n,r,o,a)=>{((e,t,n,r)=>{const o=n.yScale.range()[0];let a=Yi(t.uniqueDates,n.xScale.range()[1],t.mode,t.interval);"line"===t.chartType&&(a=a.map(e=>Ee()(e).toDate())),e.append("g").attr("class","axis").attr("aria-hidden","true").attr("transform",`translate(0, ${o})`).call(Vi(n.xScale).tickValues(a).tickFormat((e,n)=>"hour"===t.interval?r.xFormat(e instanceof Date?e:Ee()(e).toDate()):$i(e,n,a,r.xFormat))),e.append("g").attr("class","axis axis-month").attr("aria-hidden","true").attr("transform",`translate(0, ${o+14})`).call(Vi(n.xScale).tickValues(a).tickFormat((e,t)=>$i(e,t,a,r.x2Format))),e.append("g").attr("class","pipes").attr("transform",`translate(0, ${o})`).call(Vi(n.xScale).tickValues(a).tickSize(5).tickFormat(""))})(e,t,n,r),Ji(e,n,r,o,a),e.selectAll(".domain").remove(),e.selectAll(".axis .tick line").remove()};var ts=Math.PI,ns=2*ts,rs=ns-1e-6;function os(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function as(){return new os}os.prototype=as.prototype={constructor:os,moveTo:function(e,t){this._+="M"+(this._x0=this._x1=+e)+","+(this._y0=this._y1=+t)},closePath:function(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")},lineTo:function(e,t){this._+="L"+(this._x1=+e)+","+(this._y1=+t)},quadraticCurveTo:function(e,t,n,r){this._+="Q"+ +e+","+ +t+","+(this._x1=+n)+","+(this._y1=+r)},bezierCurveTo:function(e,t,n,r,o,a){this._+="C"+ +e+","+ +t+","+ +n+","+ +r+","+(this._x1=+o)+","+(this._y1=+a)},arcTo:function(e,t,n,r,o){e=+e,t=+t,n=+n,r=+r,o=+o;var a=this._x1,i=this._y1,s=n-e,c=r-t,l=a-e,u=i-t,d=l*l+u*u;if(o<0)throw new Error("negative radius: "+o);if(null===this._x1)this._+="M"+(this._x1=e)+","+(this._y1=t);else if(d>1e-6)if(Math.abs(u*s-c*l)>1e-6&&o){var f=n-a,p=r-i,h=s*s+c*c,m=f*f+p*p,b=Math.sqrt(h),g=Math.sqrt(d),y=o*Math.tan((ts-Math.acos((h+d-m)/(2*b*g)))/2),v=y/g,_=y/b;Math.abs(v-1)>1e-6&&(this._+="L"+(e+v*l)+","+(t+v*u)),this._+="A"+o+","+o+",0,0,"+ +(u*f>l*p)+","+(this._x1=e+_*s)+","+(this._y1=t+_*c)}else this._+="L"+(this._x1=e)+","+(this._y1=t);else;},arc:function(e,t,n,r,o,a){e=+e,t=+t,a=!!a;var i=(n=+n)*Math.cos(r),s=n*Math.sin(r),c=e+i,l=t+s,u=1^a,d=a?r-o:o-r;if(n<0)throw new Error("negative radius: "+n);null===this._x1?this._+="M"+c+","+l:(Math.abs(this._x1-c)>1e-6||Math.abs(this._y1-l)>1e-6)&&(this._+="L"+c+","+l),n&&(d<0&&(d=d%ns+ns),d>rs?this._+="A"+n+","+n+",0,1,"+u+","+(e-i)+","+(t-s)+"A"+n+","+n+",0,1,"+u+","+(this._x1=c)+","+(this._y1=l):d>1e-6&&(this._+="A"+n+","+n+",0,"+ +(d>=ts)+","+u+","+(this._x1=e+n*Math.cos(o))+","+(this._y1=t+n*Math.sin(o))))},rect:function(e,t,n,r){this._+="M"+(this._x0=this._x1=+e)+","+(this._y0=this._y1=+t)+"h"+ +n+"v"+ +r+"h"+-n+"Z"},toString:function(){return this._}};var is=as,ss=function(e){return function(){return e}};function cs(e){this._context=e}cs.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t)}}};var ls=function(e){return new cs(e)};function us(e){return e[0]}function ds(e){return e[1]}const fs=(e,t)=>function(){var e=us,t=ds,n=ss(!0),r=null,o=ls,a=null;function i(i){var s,c,l,u=i.length,d=!1;for(null==r&&(a=o(l=is())),s=0;s<=u;++s)!(s<u&&n(c=i[s],s,i))===d&&((d=!d)?a.lineStart():a.lineEnd()),d&&a.point(+e(c,s,i),+t(c,s,i));if(l)return a=null,l+""||null}return i.x=function(t){return arguments.length?(e="function"==typeof t?t:ss(+t),i):e},i.y=function(e){return arguments.length?(t="function"==typeof e?e:ss(+e),i):t},i.defined=function(e){return arguments.length?(n="function"==typeof e?e:ss(!!e),i):n},i.curve=function(e){return arguments.length?(o=e,null!=r&&(a=o(r)),i):o},i.context=function(e){return arguments.length?(null==e?r=a=null:a=o(r=e),i):r},i}().x(t=>e(Ee()(t.date).toDate())).y(e=>t(e.value)),ps=(e,t,n,r,o,a)=>{const i=r.yScale.range()[0],s=r.xScale.range()[1],c=fs(r.xScale,r.yScale),u=((e,t)=>t.map(t=>({key:t.key,focus:t.focus,visible:t.visible,label:t.label,values:e.map(e=>({date:e.date,focus:t.focus,value:Object(l.get)(e,[t.key,"value"],0),visible:t.visible}))})))(t,n.visibleKeys),d=e.append("g").attr("class","lines").selectAll(".line-g").data(u.filter(e=>e.visible).reverse()).enter().append("g").attr("class","line-g").attr("role","region").attr("aria-label",e=>e.label||e.key),f=((e,t,n,r,o)=>{const a=n.slice().reverse();return t.map((n,i)=>{const s=Object(l.first)(e.filter(e=>e.date===n)),c=o(Ee()(n).toDate()),u=o(i>=1?Ee()(t[i-1]).toDate():Ee()(t[0]).toDate()),d=i<t.length-1?o(Ee()(t[i+1]).toDate()):o(Ee()(t[t.length-1]).toDate());let f=0===i?d-c:c-u;const p=0===i?0:c-f/2;return f=0===i||i===t.length-1?f/2:f,{date:n,start:t.length>1?p:0,width:t.length>1?f:r,values:a.map(({key:e})=>{const t=s[e];return t?{key:e,value:t.value,date:n}:null}).filter(Boolean)}})})(t,n.uniqueDates,n.visibleKeys,s,r.xScale);let p=s<=1365||n.uniqueDates.length>50?2:3;p=s<=783?1.25:p;const h=s<=1365?4:6;n.uniqueDates.length>1&&d.append("path").attr("fill","none").attr("stroke-width",p).attr("stroke-linejoin","round").attr("stroke-linecap","round").attr("stroke",e=>n.getColor(e.key)).style("opacity",e=>{const t=e.focus?1:.1;return e.visible?t:0}).attr("d",e=>c(e.values));s/n.uniqueDates.length>36&&d.selectAll("circle").data((e,t)=>e.values.map(n=>({...n,i:t,visible:e.visible,key:e.key}))).enter().append("circle").attr("r",h).attr("fill",e=>n.getColor(e.key)).attr("stroke","#fff").attr("stroke-width",p+1).style("opacity",e=>{const t=e.focus?1:.1;return e.visible?t:0}).attr("cx",e=>r.xScale(Ee()(e.date).toDate())).attr("cy",e=>r.yScale(e.value)).attr("tabindex","0").attr("role","graphics-symbol").attr("aria-label",e=>`${o.screenReaderFormat(e.date instanceof Date?e.date:Ee()(e.date).toDate())} ${a.valueFormat(e.value)}`).on("focus",(e,n,r)=>{a.show(t.find(t=>t.date===e.date),r[n].parentNode,Do.target)}).on("blur",()=>a.hide());const m=e.append("g").attr("class","focusspaces").selectAll(".focus").data(f).enter().append("g").attr("class","focus"),b=m.append("g").attr("class","focus-grid").attr("opacity","0");b.append("line").attr("x1",e=>r.xScale(Ee()(e.date).toDate())).attr("y1",0).attr("x2",e=>r.xScale(Ee()(e.date).toDate())).attr("y2",i),b.selectAll("circle").data(e=>e.values).enter().append("circle").attr("r",h+2).attr("fill",e=>n.getColor(e.key)).attr("stroke","#fff").attr("stroke-width",p+2).attr("cx",e=>r.xScale(Ee()(e.date).toDate())).attr("cy",e=>r.yScale(e.value)),m.append("rect").attr("class","focus-g").attr("x",e=>e.start).attr("y",0).attr("width",e=>e.width).attr("height",i).attr("opacity",0).on("mouseover",(e,r,o)=>{const i=(0===r||r===f.length-1)&&n.uniqueDates.length>1?0:.5;a.show(t.find(t=>t.date===e.date),Do.target,o[r].parentNode,i)}).on("mouseout",()=>a.hide())};var hs=class{constructor(){this.ref=null,this.chart=null,this.position="",this.title="",this.labelFormat="",this.valueFormat="",this.visibleKeys="",this.getColor=null,this.margin=24}calculateXPosition(e,t,n){const r=this.ref.getBoundingClientRect(),o=this.ref.parentNode.querySelector(".d3-base").getBoundingClientRect(),a=Math.max(o.left,t.left);if("below"===this.position)return Math.max(this.margin,Math.min(e.left+.5*e.width-r.width/2-a,o.width-r.width-this.margin));const i=e.left+e.width*n+this.margin-a;return i+r.width+this.margin>o.width?Math.max(this.margin,e.left+e.width*(1-n)-r.width-this.margin-a):i}calculateYPosition(e,t){if("below"===this.position)return t.height;const n=this.ref.getBoundingClientRect(),r=e.top+this.margin-t.top;return r+n.height+this.margin>t.height?Math.max(0,e.top-n.height-this.margin-t.top):r}calculatePosition(e,t=1){const n=e.getBoundingClientRect(),r=this.chart.getBoundingClientRect();return"below"===this.position&&(t=0),{x:this.calculateXPosition(n,r,t),y:this.calculateYPosition(n,r)}}hide(){Ao(this.chart).selectAll(".barfocus, .focus-grid").attr("opacity","0"),Ao(this.ref).style("visibility","hidden")}getTooltipRowLabel(e,t){return e[t.key].labelDate?this.labelFormat(Ee()(e[t.key].labelDate).toDate()):t.label||t.key}show(e,t,n,r=1){if(!this.visibleKeys.length)return;Ao(n).select(".focus-grid, .barfocus").attr("opacity","1");const o=this.calculatePosition(t,r),a=this.visibleKeys.map(t=>`\n\t\t\t\t\t<li class="key-row">\n\t\t\t\t\t\t<div class="key-container">\n\t\t\t\t\t\t\t<span\n\t\t\t\t\t\t\t\tclass="key-color"\n\t\t\t\t\t\t\t\tstyle="background-color: ${this.getColor(t.key)}">\n\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t<span class="key-key">${this.getTooltipRowLabel(e,t)}</span>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<span class="key-value">${this.valueFormat(e[t.key].value)}</span>\n\t\t\t\t\t</li>\n\t\t\t\t`),i=this.title?this.title:this.labelFormat(Ee()(e.date).toDate());Ao(this.ref).style("left",o.x+"px").style("top",o.y+"px").style("visibility","visible").html(`\n\t\t\t\t<div>\n\t\t\t\t\t<h4>${i}</h4>\n\t\t\t\t\t<ul>\n\t\t\t\t\t${a.join("")}\n\t\t\t\t\t</ul>\n\t\t\t\t</div>\n\t\t\t`)}};const ms=()=>"rtl"===document.documentElement.dir;class bs extends r.Component{constructor(e){super(e),this.drawChart=this.drawChart.bind(this),this.getParams=this.getParams.bind(this),this.tooltipRef=Object(r.createRef)()}getFormatParams(){const{screenReaderFormat:e,xFormat:t,x2Format:n,yFormat:r,yBelow1Format:o}=this.props;return{screenReaderFormat:kr(e,rn),xFormat:kr(t,rn),x2Format:kr(n,rn),yBelow1Format:kr(o),yFormat:kr(r)}}getScaleParams(e){const{data:t,height:n,orderedKeys:r,chartType:o}=this.props,a=this.getMargin(),i=n-a.top-a.bottom,s=this.getWidth()-a.left-a.right,{upper:c,lower:l,step:u}=Ii(t),d=Ri(i,l,c);if("line"===o)return{step:u,xScale:Ni(e,s),yMax:c,yMin:l,yScale:d};const f=this.shouldBeCompact(),p=((e,t,n=!1)=>ua().domain(e).range([0,t]).paddingInner(n?0:.1))(e,s,f);return{step:u,xGroupScale:Ti(r,p,f),xScale:p,yMax:c,yMin:l,yScale:d}}getParams(e){const{chartType:t,colorScheme:n,data:r,interval:o,mode:a,orderedKeys:i}=this.props,s=i||(e=>Sr(e).map(t=>({key:t,focus:!0,total:e.reduce((e,n)=>e+n[t].value,0),visible:!0})).sort((e,t)=>t.total-e.total))(r),c=s.filter(e=>e.visible),l=s.length>5?c:s;return{getColor:Cr(l,n),interval:o,mode:a,chartType:t,uniqueDates:e,visibleKeys:c}}createTooltip(e,t,n){const{tooltipLabelFormat:r,tooltipPosition:o,tooltipTitle:a,tooltipValueFormat:i}=this.props,s=new hs;s.ref=this.tooltipRef.current,s.chart=e,s.position=o,s.title=a,s.labelFormat=kr(r,rn),s.valueFormat=kr(i),s.visibleKeys=n,s.getColor=t,this.tooltip=s}drawChart(e){const{data:t,dateParser:n,chartType:r}=this.props,o=this.getMargin(),a=((e,t)=>{const n=on(t);return[...new Set(e.map(e=>e.date))].sort((e,t)=>n(e)-n(t))})(t,n),i=this.getFormatParams(),s=this.getParams(a),c=this.getScaleParams(a),u=e.attr("id","chart").append("g").attr("transform",`translate(${o.left}, ${o.top})`);this.createTooltip(u.node(),s.getColor,s.visibleKeys),es(u,s,c,i,o,ms()),"line"===r&&ps(u,t,s,c,i,this.tooltip),"bar"===r&&((e,t,n,r,o,a)=>{const i=r.yScale.range()[0],s=e.append("g").attr("class","bars").selectAll("g").data(t).enter().append("g").attr("transform",e=>`translate(${r.xScale(e.date)}, 0)`).attr("class","bargroup").attr("role","region").attr("aria-label",e=>"item-comparison"===n.mode?o.screenReaderFormat(e.date instanceof Date?e.date:Ee()(e.date).toDate()):null);s.append("rect").attr("class","barfocus").attr("x",0).attr("y",0).attr("width",r.xGroupScale.range()[1]).attr("height",i).attr("opacity","0").on("mouseover",(e,n,r)=>{a.show(t.find(t=>t.date===e.date),Do.target,r[n].parentNode)}).on("mouseout",()=>a.hide());const c=r.yScale(0);s.selectAll(".bar").data(e=>n.visibleKeys.map(t=>({key:t.key,focus:t.focus,value:Object(l.get)(e,[t.key,"value"],0),label:t.label,visible:t.visible,date:e.date}))).enter().append("rect").attr("class","bar").attr("x",e=>r.xGroupScale(e.key)).attr("y",e=>Math.min(c,r.yScale(e.value))).attr("width",r.xGroupScale.bandwidth()).attr("height",e=>Math.abs(c-r.yScale(e.value))).attr("fill",e=>n.getColor(e.key)).attr("pointer-events","none").attr("tabindex","0").attr("aria-label",e=>{let r=e.label||e.key;if("time-comparison"===n.mode){const n=t.find(t=>t.date===e.date);r=o.screenReaderFormat(Ee()(n[e.key].labelDate).toDate())}return`${r} ${a.valueFormat(e.value)}`}).style("opacity",e=>{const t=e.focus?1:.1;return e.visible?t:0}).on("focus",(e,n,r)=>{const o=e.value>0?Do.target:Do.target.parentNode;a.show(t.find(t=>t.date===e.date),o,r[n].parentNode)}).on("blur",()=>a.hide())})(u,t,s,c,i,this.tooltip)}shouldBeCompact(){const{data:e,chartType:t,width:n}=this.props;if("bar"!==t)return!1;const r=this.getMargin(),o=n-r.left-r.right,a=e&&e.length?Object.keys(e[0]).length-1:0;return o<e.length*(a+1)}getMargin(){const{margin:e}=this.props;return ms()?{bottom:e.bottom,left:e.right,right:e.left,top:e.top}:e}getWidth(){const{data:e,chartType:t,width:n}=this.props;if("bar"!==t)return n;const r=this.getMargin(),o=e&&e.length?Object.keys(e[0]).length-1:0,a=this.shouldBeCompact()?e.length*o:e.length*(o+1);return Math.max(n,a+r.left+r.right)}getEmptyMessage(){const{baseValue:e,data:t,emptyMessage:n}=this.props;if(n&&((e,t=0)=>{for(let n=0;n<e.length;n++)for(const[r,o]of Object.entries(e[n]))if("date"!==r&&!Object(l.isNil)(o.value)&&o.value!==t)return!1;return!0})(t,e))return Object(r.createElement)("div",{className:"d3-chart__empty-message"},n)}render(){const{className:e,data:t,height:n,orderedKeys:o,chartType:a}=this.props,s=this.getWidth();return Object(r.createElement)("div",{className:i()("d3-chart__container",e),style:{height:n}},this.getEmptyMessage(),Object(r.createElement)("div",{className:"d3-chart__tooltip",ref:this.tooltipRef}),Object(r.createElement)(Lo,{className:i()(e),data:t,drawChart:this.drawChart,height:n,orderedKeys:o,tooltip:this.tooltip,chartType:a,width:s}))}}bs.propTypes={baseValue:c.a.number,className:c.a.string,colorScheme:c.a.func,data:c.a.array.isRequired,dateParser:c.a.string.isRequired,emptyMessage:c.a.string,height:c.a.number,interval:c.a.oneOf(["hour","day","week","month","quarter","year"]),margin:c.a.shape({bottom:c.a.number,left:c.a.number,right:c.a.number,top:c.a.number}),mode:c.a.oneOf(["item-comparison","time-comparison"]),screenReaderFormat:c.a.oneOfType([c.a.string,c.a.func]),orderedKeys:c.a.array,tooltipLabelFormat:c.a.oneOfType([c.a.string,c.a.func]),tooltipValueFormat:c.a.oneOfType([c.a.string,c.a.func]),tooltipPosition:c.a.oneOf(["below","over"]),tooltipTitle:c.a.string,chartType:c.a.oneOf(["bar","line"]),width:c.a.number,xFormat:c.a.oneOfType([c.a.string,c.a.func]),x2Format:c.a.oneOfType([c.a.string,c.a.func]),yBelow1Format:c.a.oneOfType([c.a.string,c.a.func]),yFormat:c.a.oneOfType([c.a.string,c.a.func])},bs.defaultProps={baseValue:0,data:[],dateParser:"%Y-%m-%dT%H:%M:%S",height:200,margin:{bottom:30,left:40,right:0,top:20},mode:"time-comparison",screenReaderFormat:"%B %-d, %Y",tooltipPosition:"over",tooltipLabelFormat:"%B %-d, %Y",tooltipValueFormat:",",chartType:"line",width:600,xFormat:"%Y-%m-%d",x2Format:"",yBelow1Format:".3~f",yFormat:".3~s"};var gs=bs;function ys(e,t){switch(t){case"left_space":return[e+" ",""];case"right":return["",e];case"right_space":return[""," "+e];case"left":default:return[e,""]}}class vs extends r.Component{constructor(e){super(e),this.chartBodyRef=Object(r.createRef)();const t=this.getDataKeys();this.state={focusedKeys:[],visibleKeys:t.slice(0,5),width:0},this.prevDataKeys=t.sort(),this.handleTypeToggle=this.handleTypeToggle.bind(this),this.handleLegendToggle=this.handleLegendToggle.bind(this),this.handleLegendHover=this.handleLegendHover.bind(this),this.updateDimensions=this.updateDimensions.bind(this),this.getVisibleData=Ot(this.getVisibleData),this.getOrderedKeys=Ot(this.getOrderedKeys),this.setInterval=this.setInterval.bind(this)}getDataKeys(){const{data:e,filterParam:t,mode:n,query:r}=this.props;if("item-comparison"===n){const e=t?Object(u.getIdsFromQuery)(r[t]):[];return this.getOrderedKeys([],[],e).map(e=>e.key)}return Sr(e)}componentDidUpdate(){const{data:e}=this.props;if(!e||!e.length)return;const t=Sr(e).sort();if(!Object(l.isEqual)(t,this.prevDataKeys)){const e=this.getDataKeys();this.prevDataKeys=t,this.setState({visibleKeys:e.slice(0,5)})}}componentDidMount(){this.updateDimensions(),this.setD3DefaultFormat(),window.addEventListener("resize",this.updateDimensions)}componentWillUnmount(){window.removeEventListener("resize",this.updateDimensions)}setD3DefaultFormat(){const{symbol:e,symbolPosition:t,decimalSeparator:n,thousandSeparator:r}=this.props.currency;ft({decimal:n,thousands:r,grouping:[3],currency:ys(e,t)})}getOrderedKeys(e,t,n=[]){const{data:r,legendTotals:o,mode:a}=this.props;if(!r||0===r.length)return[];const i=r.reduce((e,t)=>(Object.entries(t).forEach(([t,n])=>{"date"===t||e[t]||(e[t]=n.label)}),e),{}),s=Object.entries(i).map(([n,a])=>(a=Object(kt.sanitize)(a,{ALLOWED_TAGS:[]}),{focus:0===e.length||e.includes(n),key:n,label:a,total:o&&void 0!==o[n]?o[n]:r.reduce((e,t)=>e+t[n].value,0),visible:t.includes(n)}));return"item-comparison"===a?s.sort((e,t)=>t.total-e.total).filter(e=>e.total>0||n.includes(parseInt(e.key,10))):s}handleTypeToggle(e){if(this.props.chartType!==e){const{path:t,query:n}=this.props;Object(u.updateQueryString)({chartType:e},t,n)}}handleLegendToggle(e){const{interactiveLegend:t}=this.props;if(!t)return;const n=e.currentTarget.id.split("_").pop(),{focusedKeys:r,visibleKeys:o}=this.state;o.includes(n)?this.setState({focusedKeys:Object(l.without)(r,n),visibleKeys:Object(l.without)(o,n)}):this.setState({focusedKeys:r.concat([n]),visibleKeys:o.concat([n])})}handleLegendHover(e){if("mouseleave"===e.type||"blur"===e.type)this.setState({focusedKeys:[]});else if("mouseenter"===e.type||"focus"===e.type){const t=e.currentTarget.id.split("__").pop();this.setState({focusedKeys:[t]})}}updateDimensions(){this.setState({width:this.chartBodyRef.current.offsetWidth})}getVisibleData(e,t){const n=t.filter(e=>e.visible);return e.map(e=>{const t={date:e.date};return n.forEach(n=>{t[n.key]=e[n.key]}),t})}setInterval(e){const{path:t,query:n}=this.props;Object(u.updateQueryString)({interval:e},t,n)}renderIntervalSelector(){const{interval:e,allowedIntervals:t}=this.props;if(!t||t.length<1)return null;const n={hour:Object(m.__)("By hour",'woocommerce'),day:Object(m.__)("By day",'woocommerce'),week:Object(m.__)("By week",'woocommerce'),month:Object(m.__)("By month",'woocommerce'),quarter:Object(m.__)("By quarter",'woocommerce'),year:Object(m.__)("By year",'woocommerce')};return Object(r.createElement)("div",{className:"woocommerce-chart__interval-select"},Object(r.createElement)(o.SelectControl,{value:e,options:t.map(e=>({value:e,label:n[e]})),onChange:this.setInterval}))}getChartHeight(){const{isViewportLarge:e,isViewportMobile:t}=this.props;return t?180:e?300:220}getLegendPosition(){const{legendPosition:e,mode:t,isViewportWide:n}=this.props;return e||(n&&"time-comparison"===t?"top":n&&"item-comparison"===t?"side":"bottom")}render(){const{focusedKeys:e,visibleKeys:t,width:n}=this.state,{baseValue:a,chartType:s,data:c,dateParser:d,emptyMessage:f,filterParam:p,interactiveLegend:h,interval:b,isRequesting:g,isViewportLarge:y,itemsLabel:v,mode:_,query:O,screenReaderFormat:w,showHeaderControls:k,title:S,tooltipLabelFormat:D,tooltipValueFormat:C,tooltipTitle:E,valueType:j,xFormat:F,x2Format:P,yBelow1Format:M,yFormat:x}=this.props,T=p?Object(u.getIdsFromQuery)(O[p]):[],N=this.getOrderedKeys(e,t,T),I=g?null:this.getVisibleData(c,N),R=this.getLegendPosition(),A="top"===R?"row":"column",L="side"===R?"row":"column",U=this.getChartHeight(),B="hidden"!==R&&g?null:Object(r.createElement)(jr,{colorScheme:vt,data:N,handleLegendHover:this.handleLegendHover,handleLegendToggle:this.handleLegendToggle,interactive:h,legendDirection:A,legendValueFormat:C,totalLabel:Object(m.sprintf)(v,N.length)});let H=x,K=M;if(!x)switch(j){case"average":H=",.0f";break;case"currency":H="$.3~s",K="$.3~f";break;case"number":H=",.0f"}return Object(r.createElement)("div",{className:"woocommerce-chart"},k&&Object(r.createElement)("div",{className:"woocommerce-chart__header"},Object(r.createElement)(Te,{className:"woocommerce-chart__title"},S),"top"===R&&B,this.renderIntervalSelector(),Object(r.createElement)(o.NavigableMenu,{className:"woocommerce-chart__types",orientation:"horizontal",role:"menubar"},Object(r.createElement)(o.Button,{className:i()("woocommerce-chart__type-button",{"woocommerce-chart__type-button-selected":"line"===s}),title:Object(m.__)("Line chart",'woocommerce'),"aria-checked":"line"===s,role:"menuitemradio",tabIndex:"line"===s?0:-1,onClick:Object(l.partial)(this.handleTypeToggle,"line")},Object(r.createElement)(ht.a,null)),Object(r.createElement)(o.Button,{className:i()("woocommerce-chart__type-button",{"woocommerce-chart__type-button-selected":"bar"===s}),title:Object(m.__)("Bar chart",'woocommerce'),"aria-checked":"bar"===s,role:"menuitemradio",tabIndex:"bar"===s?0:-1,onClick:Object(l.partial)(this.handleTypeToggle,"bar")},Object(r.createElement)(bt.a,null)))),Object(r.createElement)(xe,{component:!1},Object(r.createElement)("div",{className:i()("woocommerce-chart__body","woocommerce-chart__body-"+L),ref:this.chartBodyRef},"side"===R&&B,g&&Object(r.createElement)(r.Fragment,null,Object(r.createElement)("span",{className:"screen-reader-text"},Object(m.__)("Your requested data is loading",'woocommerce')),Object(r.createElement)(Dt,{height:U})),!g&&n>0&&Object(r.createElement)(gs,{baseValue:a,chartType:s,colorScheme:vt,data:I,dateParser:d,height:U,emptyMessage:f,interval:b,margin:{bottom:50,left:80,right:30,top:0},mode:_,orderedKeys:N,screenReaderFormat:w,tooltipLabelFormat:D,tooltipValueFormat:C,tooltipPosition:y?"over":"below",tooltipTitle:E,valueType:j,width:"row"===L?n-320:n,xFormat:F,x2Format:P,yBelow1Format:K,yFormat:H})),"bottom"===R&&Object(r.createElement)("div",{className:"woocommerce-chart__footer"},B)))}}vs.propTypes={allowedIntervals:c.a.array,baseValue:c.a.number,chartType:c.a.oneOf(["bar","line"]),data:c.a.array.isRequired,dateParser:c.a.string.isRequired,emptyMessage:c.a.string,filterParam:c.a.string,itemsLabel:c.a.string,mode:c.a.oneOf(["item-comparison","time-comparison"]),path:c.a.string,query:c.a.object,interactiveLegend:c.a.bool,interval:c.a.oneOf(["hour","day","week","month","quarter","year"]),intervalData:c.a.object,isRequesting:c.a.bool,legendPosition:c.a.oneOf(["bottom","side","top","hidden"]),legendTotals:c.a.object,screenReaderFormat:c.a.oneOfType([c.a.string,c.a.func]),showHeaderControls:c.a.bool,title:c.a.string,tooltipLabelFormat:c.a.oneOfType([c.a.string,c.a.func]),tooltipValueFormat:c.a.oneOfType([c.a.string,c.a.func]),tooltipTitle:c.a.string,valueType:c.a.string,xFormat:c.a.string,x2Format:c.a.string,yBelow1Format:c.a.string,yFormat:c.a.string,currency:c.a.object},vs.defaultProps={baseValue:0,chartType:"line",data:[],dateParser:"%Y-%m-%dT%H:%M:%S",interactiveLegend:!0,interval:"day",isRequesting:!1,mode:"time-comparison",screenReaderFormat:"%B %-d, %Y",showHeaderControls:!0,tooltipLabelFormat:"%B %-d, %Y",tooltipValueFormat:",",xFormat:"%d",x2Format:"%b %Y",currency:{symbol:"$",symbolPosition:"left",decimalSeparator:".",thousandSeparator:","}};var _s=Object(wt.withViewportMatch)({isViewportMobile:"< medium",isViewportLarge:">= large",isViewportWide:">= wide"})(vs);const Os=({className:e,count:t,children:n,disabled:a,helpText:s,onClick:c})=>!a&&t<2?Object(r.createElement)(o.Tooltip,{text:s},Object(r.createElement)("span",{className:e},Object(r.createElement)(o.Button,{className:"woocommerce-compare-button",disabled:!0,isSecondary:!0},n))):Object(r.createElement)(o.Button,{className:i()("woocommerce-compare-button",e),onClick:c,disabled:a,isSecondary:!0},n);Os.propTypes={className:c.a.string,count:c.a.number.isRequired,children:c.a.node.isRequired,helpText:c.a.string.isRequired,onClick:c.a.func.isRequired,disabled:c.a.bool};var ws=Os;class ks extends r.Component{constructor({getLabels:e,param:t,query:n}){super(...arguments),this.state={selected:[]},this.clearQuery=this.clearQuery.bind(this),this.updateQuery=this.updateQuery.bind(this),this.updateLabels=this.updateLabels.bind(this),this.onButtonClicked=this.onButtonClicked.bind(this),n[t]&&e(n[t],n).then(this.updateLabels)}componentDidUpdate({param:e,query:t},{selected:n}){const{getLabels:r,param:o,query:a}=this.props,{selected:i}=this.state;if(e!==o||n.length>0&&0===i.length)return void this.clearQuery();const s=Object(u.getIdsFromQuery)(t[o]),c=Object(u.getIdsFromQuery)(a[o]);Object(l.isEqual)(s.sort(),c.sort())||r(a[o],a).then(this.updateLabels)}clearQuery(){const{param:e,path:t,query:n}=this.props;this.setState({selected:[]}),Object(u.updateQueryString)({[e]:void 0},t,n)}updateLabels(e){this.setState({selected:e})}updateQuery(){const{param:e,path:t,query:n}=this.props,{selected:r}=this.state,o=r.map(e=>e.key);Object(u.updateQueryString)({[e]:o.join(",")},t,n)}onButtonClicked(e){this.updateQuery(e),Object(l.isFunction)(this.props.onClick)&&this.props.onClick(e)}render(){const{labels:e,type:t,autocompleter:n}=this.props,{selected:a}=this.state;return Object(r.createElement)(o.Card,{className:"woocommerce-filters__compare"},Object(r.createElement)(o.CardHeader,null,Object(r.createElement)(ze,{variant:"subtitle.small",weight:"600",size:"14",lineHeight:"20px"},e.title)),Object(r.createElement)(o.CardBody,null,Object(r.createElement)(be,{autocompleter:n,type:t,selected:a,placeholder:e.placeholder,onChange:e=>{this.setState({selected:e})}})),Object(r.createElement)(o.CardFooter,{justify:"flex-start"},Object(r.createElement)(ws,{count:a.length,helpText:e.helpText,onClick:this.onButtonClicked},e.update),a.length>0&&Object(r.createElement)(o.Button,{isLink:!0,onClick:this.clearQuery},Object(m.__)("Clear all",'woocommerce'))))}}ks.propTypes={getLabels:c.a.func.isRequired,labels:c.a.shape({placeholder:c.a.string,title:c.a.string,update:c.a.string}),param:c.a.string.isRequired,path:c.a.string.isRequired,query:c.a.object,type:c.a.string.isRequired,autocompleter:c.a.object},ks.defaultProps={labels:{},query:{}};var Ss=n(59);const Ds=({date:e,machineFormat:t,screenReaderFormat:n,visibleFormat:o})=>Object(r.createElement)("time",{dateTime:Object(Ss.format)(t,e)},Object(r.createElement)("span",{"aria-hidden":"true"},Object(Ss.format)(o,e)),Object(r.createElement)("span",{className:"screen-reader-text"},Object(Ss.format)(n,e)));Ds.propTypes={date:c.a.oneOfType([c.a.string,c.a.object]).isRequired,machineFormat:c.a.string,screenReaderFormat:c.a.string,visibleFormat:c.a.string},Ds.defaultProps={machineFormat:"Y-m-d H:i:s",screenReaderFormat:"F j, Y",visibleFormat:"Y-m-d"};var Cs=Ds;class Es extends r.Component{render(){const{className:e,options:t,selected:n,onSelect:o,name:a,legend:s}=this.props;return Object(r.createElement)("fieldset",{className:"woocommerce-segmented-selection"},Object(r.createElement)("legend",{className:"screen-reader-text"},s),Object(r.createElement)("div",{className:i()(e,"woocommerce-segmented-selection__container")},t.map(({value:e,label:t})=>{if(!e||!t)return null;const i=Object(l.uniqueId)(e+"_");return Object(r.createElement)("div",{className:"woocommerce-segmented-selection__item",key:e},Object(r.createElement)("input",{className:"woocommerce-segmented-selection__input",type:"radio",name:a,id:i,checked:n===e,onChange:Object(l.partial)(o,{[a]:e})}),Object(r.createElement)("label",{htmlFor:i},Object(r.createElement)("span",{className:"woocommerce-segmented-selection__label"},t)))})))}}Es.propTypes={className:c.a.string,options:c.a.arrayOf(c.a.shape({value:c.a.string.isRequired,label:c.a.string.isRequired})).isRequired,selected:c.a.string,onSelect:c.a.func.isRequired,name:c.a.string.isRequired,legend:c.a.string.isRequired};var js=Es;class Fs extends r.Component{render(){const{onSelect:e,compare:t}=this.props;return Object(r.createElement)(js,{options:De.periods,selected:t,onSelect:e,name:"compare",legend:Object(m.__)("compare to",'woocommerce')})}}Fs.propTypes={onSelect:c.a.func.isRequired,compare:c.a.string};var Ps=Fs,Ms=n(262),xs=(n(392),{calendarLabel:Object(m.__)("Calendar",'woocommerce'),closeDatePicker:Object(m.__)("Close",'woocommerce'),focusStartDate:Object(m.__)("Interact with the calendar and select start and end dates.",'woocommerce'),clearDate:Object(m.__)("Clear Date",'woocommerce'),clearDates:Object(m.__)("Clear Dates",'woocommerce'),jumpToPrevMonth:Object(m.__)("Move backward to switch to the previous month.",'woocommerce'),jumpToNextMonth:Object(m.__)("Move forward to switch to the next month.",'woocommerce'),enterKey:Object(m.__)("Enter key",'woocommerce'),leftArrowRightArrow:Object(m.__)("Right and left arrow keys",'woocommerce'),upArrowDownArrow:Object(m.__)("up and down arrow keys",'woocommerce'),pageUpPageDown:Object(m.__)("page up and page down keys",'woocommerce'),homeEnd:Object(m.__)("Home and end keys",'woocommerce'),escape:Object(m.__)("Escape key",'woocommerce'),questionMark:Object(m.__)("Question mark",'woocommerce'),selectFocusedDate:Object(m.__)("Select the date in focus.",'woocommerce'),moveFocusByOneDay:Object(m.__)("Move backward (left) and forward (right) by one day.",'woocommerce'),moveFocusByOneWeek:Object(m.__)("Move backward (up) and forward (down) by one week.",'woocommerce'),moveFocusByOneMonth:Object(m.__)("Switch months.",'woocommerce'),moveFocustoStartAndEndOfWeek:Object(m.__)("Go to the first or last day of a week.",'woocommerce'),returnFocusToInput:Object(m.__)("Return to the date input field.",'woocommerce'),keyboardNavigationInstructions:Object(m.__)("Press the down arrow key to interact with the calendar and select a date.",'woocommerce'),chooseAvailableStartDate:({date:e})=>Object(m.sprintf)(Object(m.__)("Select %s as a start date.",'woocommerce'),e),chooseAvailableEndDate:({date:e})=>Object(m.sprintf)(Object(m.__)("Select %s as an end date.",'woocommerce'),e),chooseAvailableDate:({date:e})=>e,dateIsUnavailable:({date:e})=>Object(m.sprintf)(Object(m.__)("%s is not selectable.",'woocommerce'),e),dateIsSelected:({date:e})=>Object(m.sprintf)(Object(m.__)("Selected. %s",'woocommerce'),e)});class Ts extends r.Component{constructor(e){super(e),this.onDatesChange=this.onDatesChange.bind(this),this.onFocusChange=this.onFocusChange.bind(this),this.onInputChange=this.onInputChange.bind(this),this.nodeRef=Object(r.createRef)(),this.keepFocusInside=this.keepFocusInside.bind(this)}keepFocusInside(e,t){if(!this.nodeRef.current)return;const{losesFocusTo:n}=this.props;if("container"!==e||!t.target||!t.target.classList.contains("DayPickerNavigation_button")&&!t.target.classList.contains("CalendarDay")||t.relatedTarget&&(t.relatedTarget.classList.contains("DayPickerNavigation_button")||t.relatedTarget.classList.contains("CalendarDay"))){if("onPrevMonthClick"===e||"onNextMonthClick"===e){const e=this.nodeRef.current.querySelector(".DayPickerNavigation_button");e&&e.focus()}}else{if(t.relatedTarget&&(t.relatedTarget.classList.contains("DayPickerNavigation_button")||t.relatedTarget.classList.contains("CalendarDay")))return;if(t.relatedTarget&&n&&n.contains(t.relatedTarget))return;const e=this.nodeRef.current.querySelector(".DayPicker_focusRegion");e&&e.focus()}}onDatesChange({startDate:e,endDate:t}){const{onUpdate:n,shortDateFormat:r}=this.props;n({after:e,before:t,afterText:e?e.format(r):"",beforeText:t?t.format(r):"",afterError:null,beforeError:null})}onFocusChange(e){this.props.onUpdate({focusedInput:e||"startDate"})}onInputChange(e,t){const n=t.target.value,{after:r,before:o,shortDateFormat:a}=this.props,{date:i,error:s}=Object(De.validateDateInputForRange)(e,n,o,r,a);this.props.onUpdate({[e]:i,[e+"Text"]:n,[e+"Error"]:n.length>0?s:null})}setTnitialVisibleMonth(e,t){return()=>{const n=t||Ee()();return e?n.clone().subtract(1,"month"):n}}render(){const{after:e,before:t,focusedInput:n,afterText:o,beforeText:a,afterError:s,beforeError:c,shortDateFormat:u,isViewportMobile:d,isViewportSmall:f,isInvalidDate:p}=this.props,h=d&&!f;return Object(r.createElement)("div",{className:i()("woocommerce-calendar",{"is-mobile":d})},Object(r.createElement)("div",{className:"woocommerce-calendar__inputs"},Object(r.createElement)(Pe,{value:o,onChange:Object(l.partial)(this.onInputChange,"after"),dateFormat:u,label:Object(m.__)("Start Date",'woocommerce'),error:s,describedBy:Object(m.sprintf)(Object(m.__)("Date input describing a selected date range's start date in format %s",'woocommerce'),u),onFocus:()=>this.onFocusChange("startDate")}),Object(r.createElement)("div",{className:"woocommerce-calendar__inputs-to"},Object(m.__)("to",'woocommerce')),Object(r.createElement)(Pe,{value:a,onChange:Object(l.partial)(this.onInputChange,"before"),dateFormat:u,label:Object(m.__)("End Date",'woocommerce'),error:c,describedBy:Object(m.sprintf)(Object(m.__)("Date input describing a selected date range's end date in format %s",'woocommerce'),u),onFocus:()=>this.onFocusChange("endDate")})),Object(r.createElement)("div",{className:"woocommerce-calendar__react-dates",ref:this.nodeRef,onBlur:Object(l.partial)(this.keepFocusInside,"container"),tabIndex:-1},Object(r.createElement)(Ms.DayPickerRangeController,{onNextMonthClick:Object(l.partial)(this.keepFocusInside,"onNextMonthClick"),onPrevMonthClick:Object(l.partial)(this.keepFocusInside,"onPrevMonthClick"),onDatesChange:this.onDatesChange,onFocusChange:this.onFocusChange,focusedInput:n,startDate:e,endDate:t,orientation:"horizontal",numberOfMonths:h?2:1,isOutsideRange:e=>p&&p(e.toDate()),minimumNights:0,hideKeyboardShortcutsPanel:!0,noBorder:!0,isRTL:"rtl"===document.documentElement.dir,initialVisibleMonth:this.setTnitialVisibleMonth(h,t),phrases:xs})))}}Ts.propTypes={after:c.a.object,afterError:c.a.string,afterText:c.a.string,before:c.a.object,beforeError:c.a.string,beforeText:c.a.string,focusedInput:c.a.string,isInvalidDate:c.a.func,onUpdate:c.a.func.isRequired,shortDateFormat:c.a.string.isRequired,losesFocusTo:c.a.instanceOf(Element)};var Ns=Object(wt.withViewportMatch)({isViewportMobile:"< medium",isViewportSmall:"< small"})(Ts);class Is extends r.Component{render(){const{onSelect:e,period:t}=this.props;return Object(r.createElement)(js,{options:Object(l.filter)(De.presetValues,e=>"custom"!==e.value),selected:t,onSelect:e,name:"period",legend:Object(m.__)("select a preset period",'woocommerce')})}}Is.propTypes={onSelect:c.a.func.isRequired,period:c.a.string};var Rs=Is;class As extends r.Component{constructor(){super(),this.onTabSelect=this.onTabSelect.bind(this),this.controlsRef=Object(r.createRef)()}onTabSelect(e){const{onUpdate:t,period:n}=this.props;"period"===e&&"custom"===n&&t({period:"today"})}isFutureDate(e){return Ee()().isBefore(Ee()(e),"day")}render(){const{period:e,compare:t,after:n,before:a,onUpdate:s,onClose:c,onSelect:l,isValidSelection:u,resetCustomValues:d,focusedInput:f,afterText:p,beforeText:h,afterError:b,beforeError:g,shortDateFormat:y}=this.props;return Object(r.createElement)("div",null,Object(r.createElement)(Te,{className:"screen-reader-text",tabIndex:"0"},Object(m.__)("Select date range and comparison",'woocommerce')),Object(r.createElement)(xe,{component:!1},Object(r.createElement)(Te,{className:"woocommerce-filters-date__text"},Object(m.__)("select a date range",'woocommerce')),Object(r.createElement)(o.TabPanel,{tabs:[{name:"period",title:Object(m.__)("Presets",'woocommerce'),className:"woocommerce-filters-date__tab"},{name:"custom",title:Object(m.__)("Custom",'woocommerce'),className:"woocommerce-filters-date__tab"}],className:"woocommerce-filters-date__tabs",activeClass:"is-active",initialTabName:"custom"===e?"custom":"period",onSelect:this.onTabSelect},v=>Object(r.createElement)(r.Fragment,null,"period"===v.name&&Object(r.createElement)(Rs,{onSelect:s,period:e}),"custom"===v.name&&Object(r.createElement)(Ns,{after:n,before:a,onUpdate:s,isInvalidDate:this.isFutureDate,focusedInput:f,afterText:p,beforeText:h,afterError:b,beforeError:g,shortDateFormat:y,losesFocusTo:this.controlsRef.current}),Object(r.createElement)("div",{className:i()("woocommerce-filters-date__content-controls",{"is-custom":"custom"===v.name}),ref:this.controlsRef},Object(r.createElement)(Te,{className:"woocommerce-filters-date__text"},Object(m.__)("compare to",'woocommerce')),Object(r.createElement)(Ps,{onSelect:s,compare:t}),Object(r.createElement)("div",{className:"woocommerce-filters-date__button-group"},"custom"===v.name&&Object(r.createElement)(o.Button,{className:"woocommerce-filters-date__button",isSecondary:!0,onClick:d,disabled:!(n||a)},Object(m.__)("Reset",'woocommerce')),u(v.name)?Object(r.createElement)(o.Button,{className:"woocommerce-filters-date__button",onClick:l(v.name,c),isPrimary:!0},Object(m.__)("Update",'woocommerce')):Object(r.createElement)(o.Button,{className:"woocommerce-filters-date__button",isPrimary:!0,disabled:!0},Object(m.__)("Update",'woocommerce'))))))))}}As.propTypes={period:c.a.string.isRequired,compare:c.a.string.isRequired,onUpdate:c.a.func.isRequired,onClose:c.a.func.isRequired,onSelect:c.a.func.isRequired,resetCustomValues:c.a.func.isRequired,focusedInput:c.a.string,afterText:c.a.string,beforeText:c.a.string,afterError:c.a.string,beforeError:c.a.string,shortDateFormat:c.a.string.isRequired};var Ls=As;const Us=e=>{const{labels:t,isOpen:n,...a}=e,s=i()("woocommerce-dropdown-button",{"is-open":n,"is-multi-line":t.length>1});return Object(r.createElement)(o.Button,Object.assign({className:s,"aria-expanded":n},a),Object(r.createElement)("div",{className:"woocommerce-dropdown-button__labels"},t.map((e,t)=>Object(r.createElement)("span",{key:t},Object(x.decodeEntities)(e)))))};Us.propTypes={labels:c.a.array.isRequired,isOpen:c.a.bool};var Bs=Us;const Hs=Object(m.__)("MM/DD/YYYY",'woocommerce');class Ks extends r.Component{constructor(e){super(e),this.state=this.getResetState(),this.update=this.update.bind(this),this.onSelect=this.onSelect.bind(this),this.isValidSelection=this.isValidSelection.bind(this),this.resetCustomValues=this.resetCustomValues.bind(this)}formatDate(e,t){return e&&e._isAMomentObject&&"function"==typeof e.format?e.format(t):""}getResetState(){const{period:e,compare:t,before:n,after:r}=this.props.dateQuery;return{period:e,compare:t,before:n,after:r,focusedInput:"startDate",afterText:this.formatDate(r,Hs),beforeText:this.formatDate(n,Hs),afterError:null,beforeError:null}}update(e){this.setState(e)}onSelect(e,t){const{isoDateFormat:n,onRangeSelect:r}=this.props;return o=>{const{period:a,compare:i,after:s,before:c}=this.state,l={period:"custom"===e?"custom":a,compare:i};"custom"===e?(l.after=this.formatDate(s,n),l.before=this.formatDate(c,n)):(l.after=void 0,l.before=void 0),r(l),t(o)}}getButtonLabel(){const{primaryDate:e,secondaryDate:t}=this.props.dateQuery;return[`${e.label} (${e.range})`,`${Object(m.__)("vs.",'woocommerce')} ${t.label} (${t.range})`]}isValidSelection(e){const{compare:t,after:n,before:r}=this.state;return"custom"!==e||t&&n&&r}resetCustomValues(){this.setState({after:null,before:null,focusedInput:"startDate",afterText:"",beforeText:"",afterError:null,beforeError:null})}render(){const{period:e,compare:t,after:n,before:a,focusedInput:s,afterText:c,beforeText:l,afterError:u,beforeError:d}=this.state,{isViewportMobile:f}=this.props,p=i()("woocommerce-filters-date__content",{"is-mobile":f});return Object(r.createElement)("div",{className:"woocommerce-filters-filter"},Object(r.createElement)("span",{className:"woocommerce-filters-label"},Object(m.__)("Date range",'woocommerce'),":"),Object(r.createElement)(o.Dropdown,{contentClassName:p,position:"bottom",expandOnMobile:!0,renderToggle:({isOpen:e,onToggle:t})=>Object(r.createElement)(Bs,{onClick:t,isOpen:e,labels:this.getButtonLabel()}),renderContent:({onClose:o})=>Object(r.createElement)(Ls,{period:e,compare:t,after:n,before:a,onUpdate:this.update,onClose:o,onSelect:this.onSelect,isValidSelection:this.isValidSelection,resetCustomValues:this.resetCustomValues,focusedInput:s,afterText:c,beforeText:l,afterError:u,beforeError:d,shortDateFormat:Hs})}))}}Ks.propTypes={onRangeSelect:c.a.func.isRequired,dateQuery:c.a.shape({period:c.a.string.isRequired,compare:c.a.string.isRequired,before:c.a.object,after:c.a.object,primaryDate:c.a.shape({label:c.a.string.isRequired,range:c.a.string.isRequired}).isRequired,secondaryDate:c.a.shape({label:c.a.string.isRequired,range:c.a.string.isRequired}).isRequired}).isRequired};var zs=Object(wt.withViewportMatch)({isViewportMobile:"< medium"})(Ks),qs=n(263),Vs=n.n(qs);class Ws extends r.Component{render(){const{label:e,renderContent:t,className:n}=this.props;if(!t)return null;return Object(r.createElement)("div",{className:i()(n,"woocommerce-ellipsis-menu")},Object(r.createElement)(o.Dropdown,{contentClassName:"woocommerce-ellipsis-menu__popover",position:"bottom left",renderToggle:({onToggle:t,isOpen:n})=>{const a=i()("woocommerce-ellipsis-menu__toggle",{"is-opened":n});return Object(r.createElement)(o.Button,{className:a,onClick:e=>{this.props.onToggle&&this.props.onToggle(e),t(e)},title:e,"aria-expanded":n},Object(r.createElement)(F.a,{icon:Object(r.createElement)(Vs.a,null)}))},renderContent:e=>Object(r.createElement)(o.NavigableMenu,{className:"woocommerce-ellipsis-menu__content"},t(e))}))}}Ws.propTypes={label:c.a.string.isRequired,renderContent:c.a.func,className:c.a.string,onToggle:c.a.func};var Gs=Ws;class Ys extends r.Component{renderIllustration(){const{illustrationWidth:e,illustrationHeight:t,illustration:n}=this.props;return Object(r.createElement)("img",{alt:"",src:n,width:e,height:t,className:"woocommerce-empty-content__illustration"})}renderActionButtons(e){const t="secondary"===e?this.props.secondaryActionLabel:this.props.actionLabel,n="secondary"===e?this.props.secondaryActionURL:this.props.actionURL,a="secondary"===e?this.props.secondaryActionCallback:this.props.actionCallback,i="secondary"!==e;return n&&a?Object(r.createElement)(o.Button,{className:"woocommerce-empty-content__action",isPrimary:i,onClick:a,href:n},t):n?Object(r.createElement)(o.Button,{className:"woocommerce-empty-content__action",isPrimary:i,href:n},t):a?Object(r.createElement)(o.Button,{className:"woocommerce-empty-content__action",isPrimary:i,onClick:a},t):null}renderActions(){const{actionLabel:e,secondaryActionLabel:t}=this.props;return Object(r.createElement)("div",{className:"woocommerce-empty-content__actions"},e&&this.renderActionButtons("primary"),t&&this.renderActionButtons("secondary"))}render(){const{className:e,title:t,message:n,illustration:o}=this.props;return Object(r.createElement)("div",{className:i()("woocommerce-empty-content",e)},o&&this.renderIllustration(),t?Object(r.createElement)(Te,{className:"woocommerce-empty-content__title"},t):null,n?Object(r.createElement)("p",{className:"woocommerce-empty-content__message"},n):null,this.renderActions())}}Ys.propTypes={title:c.a.string.isRequired,message:c.a.node,illustration:c.a.string,illustrationHeight:c.a.number,illustrationWidth:c.a.number,actionLabel:c.a.string.isRequired,actionURL:c.a.string,actionCallback:c.a.func,secondaryActionLabel:c.a.string,secondaryActionURL:c.a.string,secondaryActionCallback:c.a.func,className:c.a.string},Ys.defaultProps={illustration:'data:image/svg+xml;utf8,%3Csvg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 400 400"%3E%3Cpath d="M226.153073,88.3099993 L355.380187,301.446227 C363.970299,315.614028 359.448689,334.062961 345.280888,342.653073 C340.591108,345.496544 335.21158,347 329.727115,347 L71.2728854,347 C54.7043429,347 41.2728854,333.568542 41.2728854,317 C41.2728854,311.515534 42.7763415,306.136007 45.6198127,301.446227 L174.846927,88.3099993 C183.437039,74.1421985 201.885972,69.6205881 216.053773,78.2106999 C220.184157,80.7150022 223.64877,84.1796157 226.153073,88.3099993 Z M184.370159,153 L186.899684,255.024156 L213.459691,255.024156 L215.989216,153 L184.370159,153 Z M200.179688,307.722584 C209.770801,307.722584 217.359375,300.450201 217.359375,291.175278 C217.359375,281.900355 209.770801,274.627972 200.179688,274.627972 C190.588574,274.627972 183,281.900355 183,291.175278 C183,300.450201 190.588574,307.722584 200.179688,307.722584 Z" id="Combined-Shape" stroke="%23979797" fill="%2395588A" fill-rule="nonzero"%3E%3C/path%3E%3C/svg%3E',illustrationWidth:400};var $s=Ys,Qs=n(43),Zs=n.n(Qs);class Xs extends r.Component{constructor(e){super(),this.state={values:e.initialValues,errors:e.errors,touched:e.touched},this.getInputProps=this.getInputProps.bind(this),this.handleSubmit=this.handleSubmit.bind(this),this.setTouched=this.setTouched.bind(this),this.setValue=this.setValue.bind(this)}componentDidMount(){this.validate()}async isValidForm(){return await this.validate(),!Object.keys(this.state.errors).length}validate(e=(()=>{})){const{values:t}=this.state,n=this.props.validate(t);this.setState({errors:n},e)}setValue(e,t){this.setState(n=>({values:{...n.values,[e]:t}}),()=>{this.validate(()=>{const{onChange:n,onChangeCallback:r}=this.props,o=r||n;r&&Zs()("onChangeCallback",{version:"9.0.0",alternative:"onChange",plugin:"@woocommerce/components"}),o({name:e,value:t},this.state.values,!Object.keys(this.state.errors||{}).length)})})}setTouched(e,t=!0){this.setState(n=>({touched:{...n.touched,[e]:t}}))}handleChange(e,t){const{values:n}=this.state;t.target?"checkbox"===t.target.type?this.setValue(e,!n[e]):this.setValue(e,t.target.value):this.setValue(e,t)}handleBlur(e){this.setTouched(e)}async handleSubmit(){const{values:e}=this.state,{onSubmitCallback:t,onSubmit:n}=this.props,r={};if(Object.keys(e).map(e=>r[e]=!0),this.setState({touched:r}),await this.isValidForm()){const r=t||n;t&&Zs()("onSubmitCallback",{version:"9.0.0",alternative:"onSubmit",plugin:"@woocommerce/components"}),r(e)}}getInputProps(e){const{errors:t,touched:n,values:r}=this.state;return{value:r[e],checked:Boolean(r[e]),selected:r[e],onChange:t=>this.handleChange(e,t),onBlur:()=>this.handleBlur(e),className:n[e]&&t[e]?"has-error":null,help:n[e]?t[e]:null}}getStateAndHelpers(){const{values:e,errors:t,touched:n}=this.state;return{values:e,errors:t,touched:n,setTouched:this.setTouched,setValue:this.setValue,handleSubmit:this.handleSubmit,getInputProps:this.getInputProps,isValidForm:!Object.keys(t).length}}render(){const e=this.props.children(this.getStateAndHelpers());return Object(r.cloneElement)(e)}}Xs.propTypes={children:c.a.any,errors:c.a.object,initialValues:c.a.object.isRequired,touched:c.a.object,onSubmitCallback:c.a.func,onSubmit:c.a.func,onChangeCallback:c.a.func,onChange:c.a.func,validate:c.a.func},Xs.defaultProps={errors:{},initialValues:{},onSubmitCallback:null,onSubmit:()=>{},onChangeCallback:null,onChange:()=>{},touched:{},validate:()=>{}};var Js=Xs,ec=n(91),tc=n(291);class nc extends r.Component{constructor(e){super(e);const t=this.getFilter();if(this.state={nav:t.path||[],animate:null,selectedTag:null},this.selectSubFilter=this.selectSubFilter.bind(this),this.getVisibleFilters=this.getVisibleFilters.bind(this),this.updateSelectedTag=this.updateSelectedTag.bind(this),this.onTagChange=this.onTagChange.bind(this),this.onContentMount=this.onContentMount.bind(this),this.goBack=this.goBack.bind(this),t.settings&&t.settings.getLabels){const{query:e}=this.props,{param:n,getLabels:r}=t.settings;r(e[n],e).then(this.updateSelectedTag)}}componentDidUpdate({query:e}){const{query:t,config:n}=this.props;if(e[n.param]!==t[[n.param]]){const e=this.getFilter();if(e&&"Search"===e.component){this.setState({nav:e.path||[]});const{param:n,getLabels:r}=e.settings;r(t[n],t).then(this.updateSelectedTag)}}}updateSelectedTag(e){this.setState({selectedTag:e[0]})}getFilter(e){const{config:t,query:n}=this.props,r=Object(u.flattenFilters)(t.filters);return e=e||n[t.param]||t.defaultValue||"all",Object(l.find)(r,{value:e})||{}}getButtonLabel(e){if("Search"===e.component){const{selectedTag:t}=this.state;return[t&&t.label,Object(l.get)(e,"settings.labels.button")]}return e?[e.label]:[]}getVisibleFilters(e,t){if(0===t.length)return e;const n=t[0],r=Object(l.find)(e,{value:n});return this.getVisibleFilters(r&&r.subFilters,t.slice(1))}selectSubFilter(e){this.setState(t=>({nav:[...t.nav,e],animate:"left"}))}goBack(){this.setState(e=>({nav:e.nav.slice(0,-1),animate:"right"}))}getAllFilterParams(){const{config:e}=this.props,t=[],n=e=>{e.forEach(e=>{e.settings&&!t.includes(e.settings.param)&&t.push(e.settings.param),e.subFilters&&n(e.subFilters)})};return n(e.filters),t}update(e,t={}){const{path:n,query:r,config:o,onFilterSelect:a,advancedFilters:i}=this.props;let s={[o.param]:(o.defaultValue||"all")===e?void 0:e,...t};if(o.staticParams.forEach(e=>{s[e]=r[e]}),this.getAllFilterParams().forEach(e=>{s[e]||(s[e]=void 0)}),"filter"===o.param&&"advanced"!==e){const e=Object(u.getQueryFromActiveFilters)([],r,i.filters||{});s={...s,...e}}Object(u.updateQueryString)(s,n,r),a(s)}onTagChange(e,t,n,r){const o=Object(l.last)(r),{value:a,settings:i}=e,{param:s}=i;o?(this.update(a,{[s]:o.key}),t()):this.update(n.defaultValue||"all"),this.updateSelectedTag([o])}renderButton(e,t,n){if(e.component){const{type:o,labels:a,autocompleter:i}=e.settings,s=this.getFilter().value===e.value?this.state.selectedTag:null;return Object(r.createElement)(be,{autocompleter:i,className:"woocommerce-filters-filter__search",type:o,placeholder:a.placeholder,selected:s?[s]:[],onChange:Object(l.partial)(this.onTagChange,e,t,n),inlineTags:!0,staticResults:!0})}const a=n=>{t(n),this.update(e.value,e.query||{}),this.setState({selectedTag:null})},i=Object(l.partial)(this.selectSubFilter,e.value),s=this.getFilter(),c=s.value===e.value||s.path&&Object(l.includes)(s.path,e.value);return Object(r.createElement)(o.Button,{className:"woocommerce-filters-filter__button",onClick:n=>{c?t(n):e.subFilters?i(n):a(n)}},e.label)}onContentMount(e){const{nav:t}=this.state,n=!!t.length&&this.getFilter(t[t.length-1])?1:0,r=ec.focus.tabbable.find(e)[n];setTimeout(()=>{r.focus()},0)}render(){const{config:e}=this.props,{nav:t,animate:n}=this.state,a=this.getVisibleFilters(e.filters,t),s=!!t.length&&this.getFilter(t[t.length-1]),c=this.getFilter();return Object(r.createElement)("div",{className:"woocommerce-filters-filter"},e.label&&Object(r.createElement)("span",{className:"woocommerce-filters-label"},e.label,":"),Object(r.createElement)(o.Dropdown,{contentClassName:"woocommerce-filters-filter__content",position:"bottom",expandOnMobile:!0,headerTitle:Object(m.__)("filter report to show:",'woocommerce'),renderToggle:({isOpen:e,onToggle:t})=>Object(r.createElement)(Bs,{onClick:t,isOpen:e,labels:this.getButtonLabel(c)}),renderContent:({onClose:u})=>Object(r.createElement)(Qe,{animationKey:t,animate:n,onExited:this.onContentMount},()=>Object(r.createElement)("ul",{className:"woocommerce-filters-filter__content-list"},s&&Object(r.createElement)("li",{className:"woocommerce-filters-filter__content-list-item"},Object(r.createElement)(o.Button,{className:"woocommerce-filters-filter__button",onClick:this.goBack},Object(r.createElement)(F.a,{icon:tc.a}),s.label)),a.map(t=>Object(r.createElement)("li",{key:t.value,className:i()("woocommerce-filters-filter__content-list-item",{"is-selected":c.value===t.value||c.path&&Object(l.includes)(c.path,t.value)})},this.renderButton(t,u,e)))))}))}}nc.propTypes={config:c.a.shape({label:c.a.string,staticParams:c.a.array.isRequired,param:c.a.string.isRequired,defaultValue:c.a.string,showFilters:c.a.func.isRequired,filters:c.a.arrayOf(c.a.shape({chartMode:c.a.oneOf(["item-comparison","time-comparison"]),component:c.a.string,label:c.a.string,path:c.a.string,subFilters:c.a.array,value:c.a.string.isRequired}))}).isRequired,path:c.a.string.isRequired,query:c.a.object,onFilterSelect:c.a.func,advancedFilters:c.a.object},nc.defaultProps={query:{},onFilterSelect:()=>{}};var rc=nc,oc=Object(r.createElement)(P.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(r.createElement)(P.Path,{d:"M18.5 15v3.5H13V6.7l4.5 4.1 1-1.1-6.2-5.8-5.8 5.8 1 1.1 4-4v11.7h-6V15H4v5h16v-5z"}));class ac extends r.Component{constructor(){super(...arguments),this.state={frame:!1},this.openModal=this.openModal.bind(this),this.handleImageSelect=this.handleImageSelect.bind(this),this.removeImage=this.removeImage.bind(this)}openModal(){if(this.state.frame)return void this.state.frame.open();const e=wp.media({title:Object(m.__)("Select or upload image"),button:{text:Object(m.__)("Select")},library:{type:"image"},multiple:!1});e.on("select",this.handleImageSelect),e.open(),this.setState({frame:e})}handleImageSelect(){const{onChange:e}=this.props;e(this.state.frame.state().get("selection").first().toJSON())}removeImage(){const{onChange:e}=this.props;e(null)}render(){const{className:e,image:t}=this.props;return Object(r.createElement)(r.Fragment,null,!!t&&Object(r.createElement)("div",{className:i()("woocommerce-image-upload","has-image",e)},Object(r.createElement)("div",{className:"woocommerce-image-upload__image-preview"},Object(r.createElement)("img",{src:t.url,alt:""})),Object(r.createElement)(o.Button,{isSecondary:!0,className:"woocommerce-image-upload__remove-image",onClick:this.removeImage},Object(m.__)("Remove image",'woocommerce'))),!t&&Object(r.createElement)("div",{className:i()("woocommerce-image-upload","no-image",e)},Object(r.createElement)(o.Button,{className:"woocommerce-image-upload__add-image",onClick:this.openModal,isSecondary:!0},Object(r.createElement)(F.a,{icon:oc}),Object(m.__)("Add an image",'woocommerce'))))}}var ic=ac;function sc(e){const{href:t,linkType:n}=e;return n||(t?"external":null)}function cc(e){const{item:t}=e,{before:n,title:o,after:a,content:i,onClick:s,href:c,target:l,listItemTag:u}=t,d="function"==typeof s||c,p=c?f:"div",h={className:"woocommerce-list__item-inner",onClick:"function"==typeof s?s:null,"aria-disabled":d?"false":null,tabIndex:d?"0":null,role:d?"menuitem":null,onKeyDown:e=>d?function(e,t){"function"==typeof t&&e.keyCode===C.ENTER&&t()}(e,s):null,target:c?l:null,type:sc(t),href:c,"data-list-item-tag":u};return Object(r.createElement)(p,Object.assign({},h),n&&Object(r.createElement)("div",{className:"woocommerce-list__item-before"},n),Object(r.createElement)("div",{className:"woocommerce-list__item-text"},Object(r.createElement)("span",{className:"woocommerce-list__item-title"},o),i&&Object(r.createElement)("span",{className:"woocommerce-list__item-content"},i)),a&&Object(r.createElement)("div",{className:"woocommerce-list__item-after"},a))}cc.propTypes={item:c.a.shape({after:c.a.node,before:c.a.node,className:c.a.string,content:c.a.oneOfType([c.a.string,c.a.node]),href:c.a.string,onClick:c.a.func,target:c.a.string,title:c.a.oneOfType([c.a.string,c.a.node])}).isRequired};var lc=cc;function uc(e){const{className:t,items:n,children:o}=e,a=i()("woocommerce-list",t);return Zs()("List with items prop is deprecated",{version:"9.0.0",hint:"See ExperimentalList / ExperimentalListItem for the new API that will replace this component in future versions."}),Object(r.createElement)(Ge.a,{component:"ul",className:a,role:"menu"},n.map((e,t)=>{const{className:n,href:a,key:s,onClick:c}=e,l="function"==typeof c||a,u=i()("woocommerce-list__item",n,{"has-action":l});return Object(r.createElement)(Ye.a,{key:s||t,timeout:500,classNames:"woocommerce-list__item"},Object(r.createElement)("li",{className:u},o?o(e,t):Object(r.createElement)(lc,{item:e})))}))}uc.propTypes={className:c.a.string,items:c.a.arrayOf(c.a.shape({after:c.a.node,before:c.a.node,className:c.a.string,content:c.a.oneOfType([c.a.string,c.a.node]),href:c.a.string,onClick:c.a.func,target:c.a.string,title:c.a.oneOfType([c.a.string,c.a.node]),key:c.a.string}))};var dc=uc;class fc extends r.Component{constructor(){super(...arguments),this.onClick=this.onClick.bind(this),this.onFocusFormToggle=this.onFocusFormToggle.bind(this),this.onKeyDown=this.onKeyDown.bind(this),this.container=Object(r.createRef)()}onClick(e){const{isClickable:t,onInvoke:n}=this.props;t&&(e.preventDefault(),n())}onKeyDown(e){if(e.target.isSameNode(e.currentTarget)&&(e.keyCode!==C.ENTER&&e.keyCode!==C.SPACE||(e.preventDefault(),this.props.onInvoke()),e.keyCode===C.UP&&e.preventDefault(),e.keyCode===C.DOWN)){e.preventDefault();(e.target.nextSibling||e.target.parentNode.querySelector(".woocommerce-ellipsis-menu__item")).focus()}}onFocusFormToggle(){this.container.current.focus()}render(){const{checked:e,children:t,isCheckbox:n}=this.props;return n?Object(r.createElement)("div",{"aria-checked":e,ref:this.container,role:"menuitemcheckbox",tabIndex:"0",onKeyDown:this.onKeyDown,onClick:this.onClick,className:"woocommerce-ellipsis-menu__item"},Object(r.createElement)(o.BaseControl,{className:"components-toggle-control"},Object(r.createElement)(o.FormToggle,{"aria-hidden":"true",checked:e,onChange:this.props.onInvoke,onFocus:this.onFocusFormToggle,onClick:e=>e.stopPropagation(),tabIndex:"-1"}),t)):Object(r.createElement)("div",{role:"menuitem",tabIndex:"0",onKeyDown:this.onKeyDown,onClick:this.onClick,className:"woocommerce-ellipsis-menu__item"},t)}}fc.propTypes={checked:c.a.bool,children:c.a.node,isCheckbox:c.a.bool,isClickable:c.a.bool,onInvoke:c.a.func.isRequired},fc.defaultProps={isClickable:!1,isCheckbox:!1};var pc=fc;const hc=({children:e})=>Object(r.createElement)("div",{className:"woocommerce-ellipsis-menu__title"},e);hc.propTypes={children:c.a.node};var mc=hc;const bc=({order:e,className:t,orderStatusMap:n})=>{const{status:o}=e,a=i()("woocommerce-order-status",t),s=i()("woocommerce-order-status__indicator",{["is-"+o]:!0}),c=n[o]||o;return Object(r.createElement)("div",{className:a},Object(r.createElement)("span",{className:s}),c)};bc.propTypes={order:c.a.object.isRequired,className:c.a.string,orderStatusMap:c.a.object};var gc=bc,yc=n(473);const vc=[25,50,75,100];class _c extends r.Component{constructor(e){super(e),this.state={inputValue:this.props.page},this.previousPage=this.previousPage.bind(this),this.nextPage=this.nextPage.bind(this),this.onInputChange=this.onInputChange.bind(this),this.onInputBlur=this.onInputBlur.bind(this),this.perPageChange=this.perPageChange.bind(this),this.selectInputValue=this.selectInputValue.bind(this)}previousPage(e){e.stopPropagation();const{page:t,onPageChange:n}=this.props;t-1<1||n(t-1,"previous")}nextPage(e){e.stopPropagation();const{page:t,onPageChange:n}=this.props;t+1>this.pageCount||n(t+1,"next")}perPageChange(e){const{onPerPageChange:t,onPageChange:n,total:r,page:o}=this.props;t(parseInt(e,10));const a=Math.ceil(r/parseInt(e,10));o>a&&n(a)}onInputChange(e){this.setState({inputValue:e.target.value})}onInputBlur(e){const{onPageChange:t,page:n}=this.props,r=parseInt(e.target.value,10);r!==n&&Number.isFinite(r)&&r>0&&this.pageCount&&this.pageCount>=r&&t(r,"goto")}selectInputValue(e){e.target.select()}renderPageArrows(){const{page:e,showPageArrowsLabel:t}=this.props;if(this.pageCount<=1)return null;const n=i()("woocommerce-pagination__link",{"is-active":e>1}),a=i()("woocommerce-pagination__link",{"is-active":e<this.pageCount});return Object(r.createElement)("div",{className:"woocommerce-pagination__page-arrows"},t&&Object(r.createElement)("span",{className:"woocommerce-pagination__page-arrows-label",role:"status","aria-live":"polite"},Object(m.sprintf)(Object(m.__)("Page %d of %d",'woocommerce'),e,this.pageCount)),Object(r.createElement)("div",{className:"woocommerce-pagination__page-arrows-buttons"},Object(r.createElement)(o.Button,{className:n,disabled:!(e>1),onClick:this.previousPage,label:Object(m.__)("Previous Page",'woocommerce')},Object(r.createElement)(F.a,{icon:tc.a})),Object(r.createElement)(o.Button,{className:a,disabled:!(e<this.pageCount),onClick:this.nextPage,label:Object(m.__)("Next Page",'woocommerce')},Object(r.createElement)(F.a,{icon:yc.a}))))}renderPagePicker(){const{page:e}=this.props,{inputValue:t}=this.state,n=e<1||e>this.pageCount,o=i()("woocommerce-pagination__page-picker-input",{"has-error":n}),a=Object(l.uniqueId)("woocommerce-pagination-page-picker-");return Object(r.createElement)("div",{className:"woocommerce-pagination__page-picker"},Object(r.createElement)("label",{htmlFor:a,className:"woocommerce-pagination__page-picker-label"},Object(m.__)("Go to page",'woocommerce'),Object(r.createElement)("input",{id:a,className:o,"aria-invalid":n,type:"number",onClick:this.selectInputValue,onChange:this.onInputChange,onBlur:this.onInputBlur,value:t,min:1,max:this.pageCount})))}renderPerPagePicker(){const e=vc.map(e=>({value:e,label:e}));return Object(r.createElement)("div",{className:"woocommerce-pagination__per-page-picker"},Object(r.createElement)(o.SelectControl,{label:Object(m.__)("Rows per page",'woocommerce'),value:this.props.perPage,onChange:this.perPageChange,options:e}))}render(){const{total:e,perPage:t,className:n,showPagePicker:o,showPerPagePicker:a}=this.props;this.pageCount=Math.ceil(e/t);const s=i()("woocommerce-pagination",n);return this.pageCount<=1?e>vc[0]&&Object(r.createElement)("div",{className:s},this.renderPerPagePicker())||null:Object(r.createElement)("div",{className:s},this.renderPageArrows(),o&&this.renderPagePicker(),a&&this.renderPerPagePicker())}}_c.propTypes={page:c.a.number.isRequired,onPageChange:c.a.func,perPage:c.a.number.isRequired,onPerPageChange:c.a.func,total:c.a.number.isRequired,className:c.a.string,showPagePicker:c.a.bool,showPerPagePicker:c.a.bool,showPageArrowsLabel:c.a.bool},_c.defaultProps={onPageChange:l.noop,onPerPageChange:l.noop,showPagePicker:!0,showPerPagePicker:!0,showPageArrowsLabel:!0};var Oc=_c;function wc({children:e}){return Object(r.createElement)(ze,{className:"woocommerce-pill",variant:"caption",as:"span",size:"12",lineHeight:"16px"},e)}var kc=n(7),Sc=n(11);class Dc extends r.Component{constructor(){super(...arguments),this.state={hasErrors:!1},this.installAndActivate=this.installAndActivate.bind(this),this.skipInstaller=this.skipInstaller.bind(this),this.handleErrors=this.handleErrors.bind(this),this.handleSuccess=this.handleSuccess.bind(this)}componentDidMount(){const{autoInstall:e}=this.props;e&&this.installAndActivate()}async installAndActivate(e){e&&e.preventDefault();const{installAndActivatePlugins:t,isRequesting:n,pluginSlugs:r}=this.props;if(n)return!1;t(r).then(e=>{this.handleSuccess(e.data.activated,e)}).catch(e=>{this.handleErrors(e.errors,e)})}handleErrors(e,t){const{onError:n}=this.props;this.setState({hasErrors:!0}),n(e,t)}handleSuccess(e,t){const{onComplete:n}=this.props;n(e,t)}skipInstaller(){this.props.onSkip()}render(){const{isRequesting:e,skipText:t,autoInstall:n,pluginSlugs:a,onAbort:i,abortText:s}=this.props,{hasErrors:c}=this.state;return c?Object(r.createElement)(r.Fragment,null,Object(r.createElement)(o.Button,{isPrimary:!0,isBusy:e,onClick:this.installAndActivate},Object(m.__)("Retry",'woocommerce')),Object(r.createElement)(o.Button,{onClick:this.skipInstaller},Object(m.__)("Continue without installing",'woocommerce'))):n?null:0===a.length?Object(r.createElement)(r.Fragment,null,Object(r.createElement)(o.Button,{isPrimary:!0,isBusy:e,onClick:this.skipInstaller},Object(m.__)("Continue",'woocommerce'))):Object(r.createElement)(r.Fragment,null,Object(r.createElement)(o.Button,{isBusy:e,isPrimary:!0,onClick:this.installAndActivate},Object(m.__)("Install & enable",'woocommerce')),Object(r.createElement)(o.Button,{isTertiary:!0,onClick:this.skipInstaller},t||Object(m.__)("No thanks",'woocommerce')),i&&Object(r.createElement)(o.Button,{isTertiary:!0,onClick:i},s||Object(m.__)("Abort",'woocommerce')))}}Dc.propTypes={onComplete:c.a.func.isRequired,onError:c.a.func,onSkip:c.a.func,skipText:c.a.string,autoInstall:c.a.bool,pluginSlugs:c.a.arrayOf(c.a.string),onAbort:c.a.func,abortText:c.a.string},Dc.defaultProps={autoInstall:!1,onError:()=>{},onSkip:()=>{},pluginSlugs:["jetpack","woocommerce-services"]};var Cc=Object(D.compose)(Object(kc.withSelect)(e=>{const{getActivePlugins:t,getInstalledPlugins:n,isPluginsRequesting:r}=e(Sc.PLUGINS_STORE_NAME);return{isRequesting:r("activatePlugins")||r("installPlugins"),activePlugins:t(),installedPlugins:n()}}),Object(kc.withDispatch)(e=>{const{installAndActivatePlugins:t}=e(Sc.PLUGINS_STORE_NAME);return{installAndActivatePlugins:t}}))(Dc),Ec=n(167),jc=n.n(Ec);class Fc extends r.Component{stars(e){const{size:t,totalStars:n}=this.props,o={width:t+"px",height:t+"px"},a=[];for(let t=0;t<n;t++){const n=e||jc.a;a.push(Object(r.createElement)(n,{key:"star-"+t,style:o}))}return a}render(){const{rating:e,totalStars:t,className:n,icon:o,outlineIcon:a}=this.props,s=i()("woocommerce-rating",n),c=100/t,l={width:Math.round(c*e)+"%"},u=Object(m.sprintf)(Object(m.__)("%1$s out of %2$s stars.",'woocommerce'),e,t);return Object(r.createElement)("div",{className:s,"aria-label":u},this.stars(o),Object(r.createElement)("div",{className:"woocommerce-rating__star-outline",style:l},this.stars(a||o)))}}Fc.propTypes={rating:c.a.number,totalStars:c.a.number,size:c.a.number,className:c.a.string,icon:c.a.elementType,outlineIcon:c.a.elementType},Fc.defaultProps={rating:0,totalStars:5,size:18};var Pc=Fc;const Mc=({product:e,...t})=>{const n=e&&e.average_rating||0;return Object(r.createElement)(Pc,Object.assign({rating:n},t))};Mc.propTypes={product:c.a.object.isRequired};var xc=Mc;class Tc extends r.Component{constructor(){super(),this.renderCard=this.renderCard.bind(this),this.onRangeSelect=this.onRangeSelect.bind(this)}renderCard(e){const{siteLocale:t,advancedFilters:n,query:o,path:a,onAdvancedFilterAction:i,currency:s}=this.props,{filters:c,param:u}=e;if(!o[u])return null;if(0===o[u].indexOf("compare")){const e=Object(l.find)(c,{value:o[u]});if(!e)return null;const{settings:t={}}=e;return Object(r.createElement)("div",{key:u,className:"woocommerce-filters__advanced-filters"},Object(r.createElement)(ks,Object.assign({path:a,query:o},t)))}return"advanced"===o[u]?Object(r.createElement)("div",{key:u,className:"woocommerce-filters__advanced-filters"},Object(r.createElement)(We,{siteLocale:t,currency:s,config:n,path:a,query:o,onAdvancedFilterAction:i})):void 0}onRangeSelect(e){const{query:t,path:n,onDateSelect:r}=this.props;Object(u.updateQueryString)(e,n,t),r(e)}getDateQuery(e){const{period:t,compare:n,before:r,after:o}=Object(De.getDateParamsFromQuery)(e),{primary:a,secondary:i}=Object(De.getCurrentDates)(e);return{period:t,compare:n,before:r,after:o,primaryDate:a,secondaryDate:i}}render(){const{dateQuery:e,filters:t,query:n,path:o,showDatePicker:a,onFilterSelect:i,isoDateFormat:s,advancedFilters:c}=this.props;return Object(r.createElement)(r.Fragment,null,Object(r.createElement)(Te,{className:"screen-reader-text"},Object(m.__)("Filters",'woocommerce')),Object(r.createElement)(xe,{component:"div",className:"woocommerce-filters"},Object(r.createElement)("div",{className:"woocommerce-filters__basic-filters"},a&&Object(r.createElement)(zs,{key:JSON.stringify(n),dateQuery:e||this.getDateQuery(n),onRangeSelect:this.onRangeSelect,isoDateFormat:s}),t.map(e=>e.showFilters(n)?Object(r.createElement)(rc,{key:e.param,config:e,advancedFilters:c,query:n,path:o,onFilterSelect:i}):null)),t.map(this.renderCard)))}}Tc.propTypes={siteLocale:c.a.string,advancedFilters:c.a.object,filters:c.a.array,path:c.a.string.isRequired,query:c.a.object,showDatePicker:c.a.bool,onDateSelect:c.a.func,onFilterSelect:c.a.func,onAdvancedFilterAction:c.a.func,currency:c.a.object,dateQuery:c.a.shape({period:c.a.string.isRequired,compare:c.a.string.isRequired,before:c.a.object,after:c.a.object,primaryDate:c.a.shape({label:c.a.string.isRequired,range:c.a.string.isRequired}).isRequired,secondaryDate:c.a.shape({label:c.a.string.isRequired,range:c.a.string.isRequired})}),isoDateFormat:c.a.string},Tc.defaultProps={siteLocale:"en_US",advancedFilters:{title:"",filters:{}},filters:[],query:{},showDatePicker:!0,onDateSelect:()=>{},currency:_e()().getCurrencyConfig()};var Nc=Tc;const Ic=({review:e,...t})=>{const n=e&&e.rating||0;return Object(r.createElement)(Pc,Object.assign({rating:n},t))};Ic.propTypes={review:c.a.object.isRequired};var Rc=Ic,Ac=n(61),Lc=n.n(Ac);function Uc(e,t=e){const n=Object(l.groupBy)(e,"parent"),r=Object(l.keyBy)(t,"id"),o=(e={})=>{if(!e.parent)return e.name?[e.name]:[];return[...o(r[e.parent]),e.name]},a=e=>e.map(e=>{const t=n[e.id];return delete n[e.id],{...e,breadcrumbs:o(r[e.parent]),children:t&&t.length?a(t):[]}}),i=a(n[0]||[]);return delete n[0],Object(l.forEach)(n,e=>{i.push(...a(e||[]))}),i}const Bc=({countLabel:e,className:t,depth:n=0,controlId:o="",item:a,isSelected:i,isSingle:s,onSelect:c,search:u="",...d})=>{const f=!Object(l.isNil)(e)||!Object(l.isNil)(a.count),p=[t,"woocommerce-search-list__item"];p.push("depth-"+n),s&&p.push("is-radio-button"),f&&p.push("has-count");const h=a.breadcrumbs&&a.breadcrumbs.length,m=d.name||"search-list-item-"+o,b=`${m}-${a.id}`;return Object(r.createElement)("label",{htmlFor:b,className:p.join(" ")},s?Object(r.createElement)("input",Object.assign({type:"radio",id:b,name:m,value:a.value,onChange:c(a),checked:i,className:"woocommerce-search-list__item-input"},d)):Object(r.createElement)("input",Object.assign({type:"checkbox",id:b,name:m,value:a.value,onChange:c(a),checked:i,className:"woocommerce-search-list__item-input"},d)),Object(r.createElement)("span",{className:"woocommerce-search-list__item-label"},h?Object(r.createElement)("span",{className:"woocommerce-search-list__item-prefix"},1===(g=a.breadcrumbs).length?Object(l.first)(g):2===g.length?Object(l.first)(g)+" › "+Object(l.last)(g):Object(l.first)(g)+" … "+Object(l.last)(g)):null,Object(r.createElement)("span",{className:"woocommerce-search-list__item-name"},function(e,t){if(!t)return e;const n=new RegExp(Object(l.escapeRegExp)(t),"ig");return e.split(n).map((e,n)=>0===n?e:Object(r.createElement)(r.Fragment,{key:n},Object(r.createElement)("strong",null,t),e))}(a.name,u))),!!f&&Object(r.createElement)("span",{className:"woocommerce-search-list__item-count"},e||a.count));var g};Bc.propTypes={className:c.a.string,countLabel:c.a.node,controlId:c.a.node,depth:c.a.number,item:c.a.object,name:c.a.string,isSelected:c.a.bool,isSingle:c.a.bool,onSelect:c.a.func,search:c.a.string};var Hc=Bc;const Kc={clear:Object(m.__)("Clear all selected items",'woocommerce'),noItems:Object(m.__)("No items found.",'woocommerce'),noResults:Object(m.__)("No results for %s",'woocommerce'),search:Object(m.__)("Search for items",'woocommerce'),selected:e=>Object(m.sprintf)(Object(m._n)("%d item selected","%d items selected",e,'woocommerce'),e),updated:Object(m.__)("Search results updated.",'woocommerce')};class zc extends r.Component{constructor(){super(...arguments),this.onSelect=this.onSelect.bind(this),this.onRemove=this.onRemove.bind(this),this.onClear=this.onClear.bind(this),this.isSelected=this.isSelected.bind(this),this.defaultRenderItem=this.defaultRenderItem.bind(this),this.renderList=this.renderList.bind(this)}componentDidUpdate(e){const{onSearch:t,search:n}=this.props;n!==e.search&&"function"==typeof t&&t(n)}onRemove(e){const{isSingle:t,onChange:n,selected:r}=this.props;return()=>{t&&n([]);const o=Object(l.findIndex)(r,{id:e});n([...r.slice(0,o),...r.slice(o+1)])}}onSelect(e){const{isSingle:t,onChange:n,selected:r}=this.props;return()=>{this.isSelected(e)?this.onRemove(e.id)():n(t?[e]:[...r,e])}}onClear(){this.props.onChange([])}isSelected(e){return-1!==Object(l.findIndex)(this.props.selected,{id:e.id})}getFilteredList(e,t){const{isHierarchical:n}=this.props;if(!t)return n?Uc(e):e;const r={...Kc,...this.props.messages},o=new RegExp(Object(l.escapeRegExp)(t),"i");this.props.debouncedSpeak(r.updated);const a=e.map(e=>!!o.test(e.name)&&e).filter(Boolean);return n?Uc(a,e):a}defaultRenderItem(e){return Object(r.createElement)(Hc,Object.assign({},e))}renderList(e,t=0){const{isSingle:n,search:o,instanceId:a}=this.props,i=this.props.renderItem||this.defaultRenderItem;return e?e.map(e=>Object(r.createElement)(r.Fragment,{key:e.id},Object(r.createElement)("li",null,i({item:e,isSelected:this.isSelected(e),onSelect:this.onSelect,isSingle:n,search:o,depth:t,controlId:a})),this.renderList(e.children,t+1))):null}renderListSection(){const{isLoading:e,search:t}=this.props,n={...Kc,...this.props.messages};if(e)return Object(r.createElement)("div",{className:"woocommerce-search-list__list is-loading"},Object(r.createElement)(o.Spinner,null));const a=this.getFilteredList(this.props.list,t);return a.length?Object(r.createElement)("ul",{className:"woocommerce-search-list__list"},this.renderList(a)):Object(r.createElement)("div",{className:"woocommerce-search-list__list is-not-found"},Object(r.createElement)("span",{className:"woocommerce-search-list__not-found-icon"},Object(r.createElement)(Lc.a,{role:"img","aria-hidden":"true",focusable:"false"})),Object(r.createElement)("span",{className:"woocommerce-search-list__not-found-text"},t?Object(m.sprintf)(n.noResults,t):n.noItems))}renderSelectedSection(){const{isLoading:e,isSingle:t,selected:n}=this.props,a={...Kc,...this.props.messages};if(e||t||!n)return null;const i=n.length;return Object(r.createElement)("div",{className:"woocommerce-search-list__selected"},Object(r.createElement)("div",{className:"woocommerce-search-list__selected-header"},Object(r.createElement)("strong",null,a.selected(i)),i>0?Object(r.createElement)(o.Button,{isLink:!0,isDestructive:!0,onClick:this.onClear,"aria-label":a.clear},Object(m.__)("Clear all",'woocommerce')):null),i>0?Object(r.createElement)("ul",null,n.map((e,t)=>Object(r.createElement)("li",{key:t},Object(r.createElement)(N,{label:e.name,id:e.id,remove:this.onRemove})))):null)}render(){const{className:e="",isCompact:t,search:n,setState:a}=this.props,s={...Kc,...this.props.messages};return Object(r.createElement)("div",{className:i()("woocommerce-search-list",e,{"is-compact":t})},this.renderSelectedSection(),Object(r.createElement)("div",{className:"woocommerce-search-list__search"},Object(r.createElement)(o.TextControl,{label:s.search,type:"search",value:n,onChange:e=>a({search:e})})),this.renderListSection())}}zc.propTypes={className:c.a.string,isCompact:c.a.bool,isHierarchical:c.a.bool,isLoading:c.a.bool,isSingle:c.a.bool,list:c.a.arrayOf(c.a.shape({id:c.a.number,name:c.a.string})),messages:c.a.shape({clear:c.a.string,noItems:c.a.string,noResults:c.a.string,search:c.a.string,selected:c.a.func,updated:c.a.string}),onChange:c.a.func.isRequired,onSearch:c.a.func,renderItem:c.a.func,selected:c.a.array.isRequired,search:c.a.string,setState:c.a.func,debouncedSpeak:c.a.func,instanceId:c.a.number};var qc,Vc=Object(D.compose)([Object(D.withState)({search:""}),o.withSpokenMessages,D.withInstanceId])(zc);class Wc extends r.Component{render(){const{children:e,menu:t,title:n}=this.props,o=i()("woocommerce-section-header",this.props.className);return Object(r.createElement)("div",{className:o},Object(r.createElement)(Te,{className:"woocommerce-section-header__title woocommerce-section-header__header-item"},n),Object(r.createElement)("hr",{role:"presentation"}),e&&Object(r.createElement)("div",{className:"woocommerce-section-header__actions woocommerce-section-header__header-item"},e),t&&Object(r.createElement)("div",{className:"woocommerce-section-header__menu woocommerce-section-header__header-item"},t))}}Wc.propTypes={className:c.a.string,menu:(qc=Gs,(e,t,n)=>{if(e[t])return e[t].type&&e[t].type===qc?void 0:new Error(`Invalid ${t} passed to ${n}. Must be \``+qc.name+"`")}),title:c.a.oneOfType([c.a.string,c.a.node]).isRequired};var Gc=Wc;class Yc extends r.Component{constructor(e){super(e),this.scrollTo=this.scrollTo.bind(this)}componentDidMount(){setTimeout(this.scrollTo,250)}scrollTo(){const{offset:e}=this.props;this.ref.current&&this.ref.current.offsetTop?window.scrollTo(0,this.ref.current.offsetTop+parseInt(e,10)):setTimeout(this.scrollTo,250)}render(){const{children:e}=this.props;return this.ref=Object(r.createRef)(),Object(r.createElement)("span",{ref:this.ref},e)}}Yc.propTypes={offset:c.a.string},Yc.defaultProps={offset:"0"};var $c=Yc;class Qc extends r.Component{render(){const{className:e}=this.props,t=i()("woocommerce-spinner",e);return Object(r.createElement)("svg",{className:t,viewBox:"0 0 100 100",xmlns:"http://www.w3.org/2000/svg"},Object(r.createElement)("circle",{className:"woocommerce-spinner__circle",fill:"none",strokeWidth:"5",strokeLinecap:"round",cx:"50",cy:"50",r:"30"}))}}Qc.propTypes={className:c.a.string};var Zc=Qc,Xc=()=>Object(r.createElement)("svg",{role:"img","aria-hidden":"true",focusable:"false",width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Object(r.createElement)("mask",{id:"mask0","mask-type":"alpha",maskUnits:"userSpaceOnUse",x:"2",y:"3",width:"14",height:"12"},Object(r.createElement)("path",{d:"M6.59631 11.9062L3.46881 8.77875L2.40381 9.83625L6.59631 14.0287L15.5963\n                5.02875L14.5388 3.97125L6.59631 11.9062Z",fill:"white"})),Object(r.createElement)("g",{mask:"url(#mask0)"},Object(r.createElement)("rect",{width:"18",height:"18",fill:"white"})));class Jc extends r.Component{renderCurrentStepContent(){const{currentStep:e,steps:t}=this.props,n=t.find(t=>e===t.key);return n.content?Object(r.createElement)("div",{className:"woocommerce-stepper_content"},n.content):null}render(){const{className:e,currentStep:t,steps:n,isVertical:o,isPending:a}=this.props,s=n.findIndex(e=>t===e.key),c=i()("woocommerce-stepper",e,{"is-vertical":o});return Object(r.createElement)("div",{className:c},Object(r.createElement)("div",{className:"woocommerce-stepper__steps"},n.map((e,n)=>{const{key:c,label:l,description:u,isComplete:d,onClick:f}=e,p=c===t,h=i()("woocommerce-stepper__step",{"is-active":p,"is-complete":void 0!==d?d:s>n}),m=p&&a?Object(r.createElement)(Zc,null):Object(r.createElement)("div",{className:"woocommerce-stepper__step-icon"},Object(r.createElement)("span",{className:"woocommerce-stepper__step-number"},n+1),Object(r.createElement)(Xc,null)),b="function"==typeof f?"button":"div";return Object(r.createElement)(r.Fragment,{key:c},Object(r.createElement)("div",{className:h},Object(r.createElement)(b,{className:"woocommerce-stepper__step-label-wrapper",onClick:"function"==typeof f?()=>f(c):null},m,Object(r.createElement)("div",{className:"woocommerce-stepper__step-text"},Object(r.createElement)("span",{className:"woocommerce-stepper__step-label"},l),u&&Object(r.createElement)("span",{className:"woocommerce-stepper__step-description"},u))),p&&o&&this.renderCurrentStepContent()),!o&&Object(r.createElement)("div",{className:"woocommerce-stepper__step-divider"}))})),!o&&this.renderCurrentStepContent())}}Jc.propTypes={className:c.a.string,currentStep:c.a.string.isRequired,steps:c.a.arrayOf(c.a.shape({content:c.a.node,description:c.a.oneOfType([c.a.string,c.a.array]),isComplete:c.a.bool,key:c.a.string.isRequired,label:c.a.string.isRequired,onClick:c.a.func})).isRequired,isVertical:c.a.bool,isPending:c.a.bool},Jc.defaultProps={isVertical:!1,isPending:!1};var el=Jc;function tl(e){return e<10?`has-${e}-items`:"has-10-items"}const nl=({label:e,orientation:t,itemCount:n,items:a})=>{const s=Object(l.uniqueId)("woocommerce-summary-helptext-"),c=tl(n),u=i()("woocommerce-summary",{[c]:"horizontal"===t});return Object(r.createElement)(o.NavigableMenu,{"aria-label":e,"aria-describedby":s,orientation:t,stopNavigationEvents:!0},Object(r.createElement)("p",{id:s,className:"screen-reader-text"},Object(m.__)("List of data points available for filtering. Use arrow keys to cycle through the list. Click a data point for a detailed report.",'woocommerce')),Object(r.createElement)("ul",{className:u},a))};nl.propTypes={label:c.a.string,orientation:c.a.oneOf(["vertical","horizontal"]).isRequired,items:c.a.node.isRequired,itemCount:c.a.number.isRequired};var rl=nl;const ol=({children:e,isDropdownBreakpoint:t,label:n})=>{const a=e({}),i=r.Children.count(a)||1,s=t?"vertical":"horizontal",c=Object(r.createElement)(rl,{label:n,orientation:s,itemCount:i,items:a});if(!t||i<2)return c;const l=a.find(e=>!!e.props.selected);return l?Object(r.createElement)(o.Dropdown,{className:"woocommerce-summary",position:"bottom",headerTitle:n,renderToggle:({isOpen:e,onToggle:t})=>Object(r.cloneElement)(l,{onToggle:t,isOpen:e}),renderContent:t=>Object(r.createElement)(rl,{label:n,orientation:s,itemCount:i,items:e(t)})}):c};ol.propTypes={children:c.a.func.isRequired,label:c.a.string},ol.defaultProps={label:Object(m.__)("Performance Indicators",'woocommerce')};var al=Object(wt.withViewportMatch)({isDropdownBreakpoint:"< large"})(ol);const il=({className:e})=>Object(r.createElement)("li",{"data-testid":"summary-placeholder",className:i()("woocommerce-summary__item-container is-placeholder",e)},Object(r.createElement)("div",{className:"woocommerce-summary__item"},Object(r.createElement)("div",{className:"woocommerce-summary__item-label"}),Object(r.createElement)("div",{className:"woocommerce-summary__item-data"},Object(r.createElement)("div",{className:"woocommerce-summary__item-value"}),Object(r.createElement)("div",{className:"woocommerce-summary__item-delta"}))));class sl extends r.Component{render(){const{isDropdownBreakpoint:e}=this.props,t=e?1:this.props.numberOfItems,n=tl(t),o=i()("woocommerce-summary",{[n]:!e,"is-placeholder":!0});return Object(r.createElement)("ul",{className:o,"aria-hidden":"true"},Object(l.range)(t).map(e=>Object(r.createElement)(il,{key:e})))}}sl.propTypes={numberOfItems:c.a.number.isRequired},sl.defaultProps={numberOfRows:5};var cl=Object(wt.withViewportMatch)({isDropdownBreakpoint:"< large"})(sl),ll=n(168),ul=n.n(ll);const dl=({children:e,delta:t,href:n,hrefType:a,isOpen:s,label:c,onToggle:u,prevLabel:d,prevValue:p,reverseTrend:h,selected:b,value:g,onLinkClickCallback:y})=>{const v=i()("woocommerce-summary__item-container",{"is-dropdown-button":u,"is-dropdown-expanded":s}),_=i()("woocommerce-summary__item",{"is-selected":b,"is-good-trend":h?t<0:t>0,"is-bad-trend":h?t>0:t<0});let O,w=t>0?Object(m.sprintf)(Object(m.__)("Up %f%% from %s",'woocommerce'),t,d):Object(m.sprintf)(Object(m.__)("Down %f%% from %s",'woocommerce'),Math.abs(t),d);t||(w=Object(m.sprintf)(Object(m.__)("No change from %s",'woocommerce'),d));const k={className:_,"aria-current":b?"page":null};if(u||n){const e=!!u;O=e?o.Button:f,e?(k.onClick=u,k["aria-expanded"]=s):(k.href=n,k.role="menuitem",k.onClick=y,k.type=a)}else O="div";return Object(r.createElement)("li",{className:v},Object(r.createElement)(O,Object.assign({},k),Object(r.createElement)("div",{className:"woocommerce-summary__item-label"},Object(r.createElement)(ze,{variant:"body.small",size:"14",lineHeight:"20px"},c)),Object(r.createElement)("div",{className:"woocommerce-summary__item-data"},Object(r.createElement)("div",{className:"woocommerce-summary__item-value"},Object(r.createElement)(ze,{variant:"title.small",size:"20",lineHeight:"28px"},Object(l.isNil)(g)?Object(m.__)("N/A",'woocommerce'):g)),Object(r.createElement)(o.Tooltip,{text:Object(l.isNil)(p)?Object(m.__)("N/A",'woocommerce'):`${d} ${p}`,position:"top center"},Object(r.createElement)("div",{className:"woocommerce-summary__item-delta",role:"presentation","aria-label":w},Object(r.createElement)(ze,{variant:"caption",size:"12",lineHeight:"16px"},Object(l.isNil)(t)?Object(m.__)("N/A",'woocommerce'):Object(m.sprintf)(Object(m.__)("%f%%",'woocommerce'),t))))),u?Object(r.createElement)(ul.a,{className:"woocommerce-summary__toggle",size:24}):null,e))};dl.propTypes={delta:c.a.number,href:c.a.string,hrefType:c.a.oneOf(["wp-admin","wc-admin","external"]).isRequired,isOpen:c.a.bool,label:c.a.string.isRequired,onToggle:c.a.func,prevLabel:c.a.string,prevValue:c.a.oneOfType([c.a.number,c.a.string]),reverseTrend:c.a.bool,selected:c.a.bool,value:c.a.oneOfType([c.a.number,c.a.string]),onLinkClickCallback:c.a.func},dl.defaultProps={href:"",hrefType:"wc-admin",isOpen:!1,prevLabel:Object(m.__)("Previous period:",'woocommerce'),reverseTrend:!1,selected:!1,onLinkClickCallback:l.noop};var fl=dl,pl=n(277),hl=n(278);class ml extends r.Component{constructor(e){super(e),this.state={tabIndex:null,isScrollableRight:!1,isScrollableLeft:!1},this.container=Object(r.createRef)(),this.sortBy=this.sortBy.bind(this),this.updateTableShadow=this.updateTableShadow.bind(this),this.getRowKey=this.getRowKey.bind(this)}componentDidMount(){const{scrollWidth:e,clientWidth:t}=this.container.current,n=e>t;this.setState({tabIndex:n?"0":null}),this.updateTableShadow(),window.addEventListener("resize",this.updateTableShadow)}componentDidUpdate(){this.updateTableShadow()}componentWillUnmount(){window.removeEventListener("resize",this.updateTableShadow)}sortBy(e){const{headers:t,query:n}=this.props;return()=>{const r=n.orderby||Object(l.get)(Object(l.find)(t,{defaultSort:!0}),"key",!1),o=n.order||Object(l.get)(Object(l.find)(t,{key:r}),"defaultOrder","desc");let a="desc";e===r&&(a="desc"===o?"asc":"desc"),this.props.onSort(e,a)}}updateTableShadow(){const e=this.container.current,{isScrollableRight:t,isScrollableLeft:n}=this.state,r=e.scrollWidth-e.scrollLeft<=e.offsetWidth;r&&t?this.setState({isScrollableRight:!1}):r||this.state.isScrollableRight||this.setState({isScrollableRight:!0});const o=e.scrollLeft<=0;o&&n?this.setState({isScrollableLeft:!1}):o||n||this.setState({isScrollableLeft:!0})}getRowKey(e,t){return this.props.rowKey&&"function"==typeof this.props.rowKey?this.props.rowKey(e,t):t}render(){const{ariaHidden:e,caption:t,classNames:n,headers:a,instanceId:s,query:c,rowHeader:u,rows:d}=this.props,{isScrollableRight:f,isScrollableLeft:p,tabIndex:h}=this.state,b=i()("woocommerce-table__table",n,{"is-scrollable-right":f,"is-scrollable-left":p}),g=c.orderby||Object(l.get)(Object(l.find)(a,{defaultSort:!0}),"key",!1),y=c.order||Object(l.get)(Object(l.find)(a,{key:g}),"defaultOrder","desc"),v=!!d.length;return Object(r.createElement)("div",{className:b,ref:this.container,tabIndex:h,"aria-hidden":e,"aria-labelledby":"caption-"+s,role:"group",onScroll:this.updateTableShadow},Object(r.createElement)("table",null,Object(r.createElement)("caption",{id:"caption-"+s,className:"woocommerce-table__caption screen-reader-text"},t,"0"===h&&Object(r.createElement)("small",null,Object(m.__)("(scroll to see more)",'woocommerce'))),Object(r.createElement)("tbody",null,Object(r.createElement)("tr",null,a.map((e,t)=>{const{cellClassName:n,isLeftAligned:a,isSortable:c,isNumeric:u,key:d,label:f,screenReaderLabel:p}=e,h=`header-${s}-${t}`,b={className:i()("woocommerce-table__header",n,{"is-left-aligned":a||!u,"is-sortable":c,"is-sorted":g===d,"is-numeric":u})};c&&(b["aria-sort"]="none",g===d&&(b["aria-sort"]="asc"===y?"ascending":"descending"));const _=g===d&&"asc"!==y?Object(m.sprintf)(Object(m.__)("Sort by %s in ascending order",'woocommerce'),p||f):Object(m.sprintf)(Object(m.__)("Sort by %s in descending order",'woocommerce'),p||f),O=Object(r.createElement)(r.Fragment,null,Object(r.createElement)("span",{"aria-hidden":Boolean(p)},f),p&&Object(r.createElement)("span",{className:"screen-reader-text"},p));return Object(r.createElement)("th",Object.assign({role:"columnheader",scope:"col",key:e.key||t},b),c?Object(r.createElement)(r.Fragment,null,Object(r.createElement)(o.Button,{"aria-describedby":h,onClick:v?this.sortBy(d):l.noop},g===d&&"asc"===y?Object(r.createElement)(F.a,{icon:pl.a}):Object(r.createElement)(F.a,{icon:hl.a}),O),Object(r.createElement)("span",{className:"screen-reader-text",id:h},_)):O)})),v?d.map((e,t)=>Object(r.createElement)("tr",{key:this.getRowKey(e,t)},e.map((n,o)=>{const{cellClassName:s,isLeftAligned:c,isNumeric:l}=a[o],d=u===o,f=d?"th":"td",p=i()("woocommerce-table__item",s,{"is-left-aligned":c||!l,"is-numeric":l,"is-sorted":g===a[o].key}),h=this.getRowKey(e,t).toString()+o;return Object(r.createElement)(f,{scope:d?"row":null,key:h,className:p},(e=>e.display||null)(n))}))):Object(r.createElement)("tr",null,Object(r.createElement)("td",{className:"woocommerce-table__empty-item",colSpan:a.length},Object(m.__)("No data to display",'woocommerce'))))))}}ml.propTypes={ariaHidden:c.a.bool,caption:c.a.string.isRequired,className:c.a.string,headers:c.a.arrayOf(c.a.shape({defaultSort:c.a.bool,defaultOrder:c.a.string,isLeftAligned:c.a.bool,isNumeric:c.a.bool,isSortable:c.a.bool,key:c.a.string,label:c.a.node,required:c.a.bool,screenReaderLabel:c.a.string})),onSort:c.a.func,query:c.a.object,rows:c.a.arrayOf(c.a.arrayOf(c.a.shape({display:c.a.node,value:c.a.oneOfType([c.a.string,c.a.number,c.a.bool])}))).isRequired,rowHeader:c.a.oneOfType([c.a.number,c.a.bool]),rowKey:c.a.func},ml.defaultProps={ariaHidden:!1,headers:[],onSort:l.noop,query:{},rowHeader:0};var bl=Object(D.withInstanceId)(ml);class gl extends r.Component{render(){const{numberOfRows:e,...t}=this.props,n=Object(l.range)(e).map(()=>this.props.headers.map(()=>({display:Object(r.createElement)("span",{className:"is-placeholder"})})));return Object(r.createElement)(bl,Object.assign({ariaHidden:!0,classNames:"is-loading",rows:n},t))}}gl.propTypes={query:c.a.object,caption:c.a.string.isRequired,headers:c.a.arrayOf(c.a.shape({hiddenByDefault:c.a.bool,defaultSort:c.a.bool,isSortable:c.a.bool,key:c.a.string,label:c.a.node,required:c.a.bool})),numberOfRows:c.a.number},gl.defaultProps={numberOfRows:5};var yl=gl;const vl=({data:e})=>Object(r.createElement)("ul",{className:"woocommerce-table__summary",role:"complementary"},e.map(({label:e,value:t},n)=>Object(r.createElement)("li",{className:"woocommerce-table__summary-item",key:n},Object(r.createElement)("span",{className:"woocommerce-table__summary-value"},t),Object(r.createElement)("span",{className:"woocommerce-table__summary-label"},e))));vl.propTypes={data:c.a.array};var _l=vl;const Ol=()=>Object(r.createElement)("ul",{className:"woocommerce-table__summary is-loading",role:"complementary"},Object(r.createElement)("li",{className:"woocommerce-table__summary-item"},Object(r.createElement)("span",{className:"is-placeholder"})));class wl extends r.Component{constructor(e){super(e);const t=this.getShowCols(e.headers);this.state={showCols:t},this.onColumnToggle=this.onColumnToggle.bind(this),this.onPageChange=this.onPageChange.bind(this)}componentDidUpdate({headers:e,query:t}){const{headers:n,onColumnsChange:r,query:o}=this.props,{showCols:a}=this.state;if(Object(l.isEqual)(n,e)||this.setState({showCols:this.getShowCols(n)}),o.orderby!==t.orderby&&!a.includes(o.orderby)){const e=a.concat(o.orderby);this.setState({showCols:e}),r(e)}}getShowCols(e){return e.map(({key:e,visible:t})=>!(void 0!==t&&!t)&&e).filter(Boolean)}getVisibleHeaders(){const{headers:e}=this.props,{showCols:t}=this.state;return e.filter(({key:e})=>t.includes(e))}getVisibleRows(){const{headers:e,rows:t}=this.props,{showCols:n}=this.state;return t.map(t=>e.map(({key:e},r)=>n.includes(e)&&t[r]).filter(Boolean))}onColumnToggle(e){const{headers:t,query:n,onQueryChange:r,onColumnsChange:o}=this.props;return()=>{this.setState(a=>{if(a.showCols.includes(e)){if(n.orderby===e){const e=Object(l.find)(t,{defaultSort:!0})||Object(l.first)(t)||{};r("sort")(e.key,"desc")}const i=Object(l.without)(a.showCols,e);return o(i,e),{showCols:i}}const i=[...a.showCols,e];return o(i,e),{showCols:i}})}}onPageChange(...e){const{onPageChange:t,onQueryChange:n}=this.props;t&&t(...e),n&&n("paged")(...e)}render(){const{actions:e,className:t,hasSearch:n,isLoading:a,onQueryChange:s,onSort:c,query:l,rowHeader:u,rowsPerPage:d,showMenu:f,summary:p,title:h,totalRows:b,rowKey:g}=this.props,{showCols:y}=this.state,v=this.props.headers,_=this.getVisibleHeaders(),O=this.getVisibleRows(),w=i()("woocommerce-table",t,{"has-actions":!!e,"has-menu":f,"has-search":n});return Object(r.createElement)(o.Card,{className:w},Object(r.createElement)(o.CardHeader,null,Object(r.createElement)(o.__experimentalText,{size:16,weight:600,as:"h2",color:"#23282d"},h),Object(r.createElement)("div",{className:"woocommerce-table__actions"},e),f&&Object(r.createElement)(Gs,{label:Object(m.__)("Choose which values to display",'woocommerce'),renderContent:()=>Object(r.createElement)(r.Fragment,null,Object(r.createElement)(mc,null,Object(m.__)("Columns:",'woocommerce')),v.map(({key:e,label:t,required:n})=>n?null:Object(r.createElement)(pc,{checked:y.includes(e),isCheckbox:!0,isClickable:!0,key:e,onInvoke:this.onColumnToggle(e)},t)))})),Object(r.createElement)(o.CardBody,{size:null},a?Object(r.createElement)(r.Fragment,null,Object(r.createElement)("span",{className:"screen-reader-text"},Object(m.__)("Your requested data is loading",'woocommerce')),Object(r.createElement)(yl,{numberOfRows:d,headers:_,rowHeader:u,caption:h,query:l})):Object(r.createElement)(bl,{rows:O,headers:_,rowHeader:u,caption:h,query:l,onSort:c||s("sort"),rowKey:g})),Object(r.createElement)(o.CardFooter,{justify:"center"},a?Object(r.createElement)(Ol,null):Object(r.createElement)(r.Fragment,null,Object(r.createElement)(Oc,{key:parseInt(l.paged,10)||1,page:parseInt(l.paged,10)||1,perPage:d,total:b,onPageChange:this.onPageChange,onPerPageChange:s("per_page")}),p&&Object(r.createElement)(_l,{data:p}))))}}wl.propTypes={hasSearch:c.a.bool,headers:c.a.arrayOf(c.a.shape({hiddenByDefault:c.a.bool,defaultSort:c.a.bool,isSortable:c.a.bool,key:c.a.string,label:c.a.oneOfType([c.a.string,c.a.node]),required:c.a.bool})),ids:c.a.arrayOf(c.a.number),isLoading:c.a.bool,onQueryChange:c.a.func,onColumnsChange:c.a.func,onSort:c.a.func,query:c.a.object,rowHeader:c.a.oneOfType([c.a.number,c.a.bool]),rows:c.a.arrayOf(c.a.arrayOf(c.a.shape({display:c.a.node,value:c.a.oneOfType([c.a.string,c.a.number,c.a.bool])}))).isRequired,rowsPerPage:c.a.number.isRequired,showMenu:c.a.bool,summary:c.a.arrayOf(c.a.shape({label:c.a.node,value:c.a.oneOfType([c.a.string,c.a.number])})),title:c.a.string.isRequired,totalRows:c.a.number.isRequired,rowKey:c.a.func},wl.defaultProps={isLoading:!1,onQueryChange:()=>()=>{},onColumnsChange:()=>{},onSort:void 0,query:{},rowHeader:0,rows:[],showMenu:!0};var kl=wl;const Sl=({children:e,numberOfRows:t})=>Object(r.createElement)("div",{className:"woocommerce-table is-empty",style:{"--number-of-rows":t}},e);Sl.propTypes={numberOfRows:c.a.number},Sl.defaultProps={numberOfRows:5};var Dl=Sl;const Cl=Object(o.withFocusOutside)(class extends r.Component{constructor(e){super(e),this.state={isFocused:!1}}handleFocusOutside(){this.setState({isFocused:!1})}handleOnClick(e,t){this.setState({isFocused:!0}),"function"==typeof t&&t(e)}render(){const{isFocused:e}=this.state,{className:t,onClick:n,...a}=this.props,{label:s,value:c,disabled:l}=a,u=""===c,d=e&&!l;return Object(r.createElement)(o.TextControl,Object.assign({className:i()("muriel-component","muriel-input-text",t,{disabled:l,empty:u,active:d,"with-value":!u}),placeholder:s,onClick:e=>this.handleOnClick(e,n),onFocus:()=>this.setState({isFocused:!0})},a))}});Cl.propTypes={className:c.a.string,disabled:c.a.bool,label:c.a.string,onClick:c.a.func,value:c.a.string};var El=Cl;const jl=e=>{const{item:t,className:n,clockFormat:o}=e,a=i()("woocommerce-timeline-item",n),s=Object(Ss.format)(o,t.date);return Object(r.createElement)("li",{className:a},Object(r.createElement)("div",{className:"woocommerce-timeline-item__top-border"}),Object(r.createElement)("div",{className:"woocommerce-timeline-item__title"},Object(r.createElement)("div",{className:"woocommerce-timeline-item__headline"},t.icon,Object(r.createElement)("span",null,t.headline)),Object(r.createElement)("span",{className:"woocommerce-timeline-item__timestamp"},t.hideTimestamp?null:s)),Object(r.createElement)("div",{className:"woocommerce-timeline-item__body"},(t.body||[]).map((e,t)=>Object(r.createElement)("span",{key:"timeline-item-body-"+t},e))))};jl.propTypes={className:c.a.string,item:c.a.shape({date:c.a.instanceOf(Date).isRequired,icon:c.a.element.isRequired,headline:c.a.oneOfType([c.a.element,c.a.string]).isRequired,body:c.a.arrayOf(c.a.oneOfType([c.a.element,c.a.string])),hideTimestamp:c.a.bool,clockFormat:c.a.string}).isRequired},jl.defaultProps={className:"",item:{}};var Fl=jl;const Pl="asc",Ml="desc",xl=(e,t)=>e.date.getTime()-t.date.getTime(),Tl=(e,t)=>t.date.getTime()-e.date.getTime(),Nl=e=>{switch(e){case Pl:return xl;case Ml:default:return Tl}},Il=e=>(t,n)=>{const r=t.findIndex(t=>((t,n)=>Ee()(t.date).isSame(Ee()(n.date),e))(t,n));return r>=0?(t[r].items.push(n),t):[...t,{date:n.date,items:[n]}]},Rl=e=>{const{group:t,className:n,orderBy:o,clockFormat:a}=e,s=i()("woocommerce-timeline-group",n);return Object(r.createElement)("li",{className:s},Object(r.createElement)("p",{className:"woocommerce-timeline-group__title"},t.title),Object(r.createElement)("ul",null,t.items.sort(Nl(o)).map((e,n)=>{const o=t.title+"-"+n;return Object(r.createElement)(Fl,{key:o,item:e,clockFormat:a})})),Object(r.createElement)("hr",null))};Rl.propTypes={className:c.a.string,group:c.a.shape({title:c.a.string,items:c.a.arrayOf(c.a.shape({date:c.a.instanceOf(Date).isRequired,icon:c.a.element.isRequired,headline:c.a.oneOfType([c.a.element,c.a.string]).isRequired,body:c.a.arrayOf(c.a.oneOfType([c.a.element,c.a.string])),hideTimestamp:c.a.bool})).isRequired}).isRequired,orderBy:c.a.oneOf(["asc","desc"]),clockFormat:c.a.string},Rl.defaultProps={className:"",group:{title:"",items:[]},orderBy:"desc"};var Al=Rl;const Ll=e=>{const{className:t,items:n,groupBy:o,orderBy:a,dateFormat:s,clockFormat:c}=e,l=i()("woocommerce-timeline",t);if(!n||0===n.length)return Object(r.createElement)("div",{className:l},Object(r.createElement)("p",{className:"timeline_no_events"},Object(m.__)("No data to display",'woocommerce')));return Object(r.createElement)("div",{className:l},Object(r.createElement)("ul",null,n.reduce(Il(o),[]).map(e=>({...e,title:Object(Ss.format)(s,e.date)})).sort(Nl(a)).map(e=>Object(r.createElement)(Al,{key:e.date.getTime().toString(),group:e,orderBy:a,clockFormat:c}))))};Ll.propTypes={className:c.a.string,items:c.a.arrayOf(c.a.shape({date:c.a.instanceOf(Date).isRequired,icon:c.a.element.isRequired,headline:c.a.oneOfType([c.a.element,c.a.string]).isRequired,body:c.a.arrayOf(c.a.oneOfType([c.a.element,c.a.string])),hideTimestamp:c.a.bool})).isRequired,groupBy:c.a.oneOf(["day","week","month"]),orderBy:c.a.oneOf(["asc","desc"]),dateFormat:c.a.string,clockFormat:c.a.string},Ll.defaultProps={className:"",items:[],groupBy:"day",orderBy:"desc",dateFormat:Object(m.__)("F j, Y",'woocommerce'),clockFormat:Object(m.__)("g:ia",'woocommerce')};var Ul=Ll;const Bl=({items:e})=>Object(r.createElement)(N,{className:"woocommerce-view-more-list",label:Object(m.sprintf)(Object(m.__)("+%d more",'woocommerce'),e.length-1),popoverContents:Object(r.createElement)("ul",{className:"woocommerce-view-more-list__popover"},e.map((e,t)=>Object(r.createElement)("li",{key:t,className:"woocommerce-view-more-list__popover__item"},e)))});Bl.propTypes={items:c.a.arrayOf(c.a.node)},Bl.defaultProps={items:[]};var Hl=Bl;class Kl extends r.Component{constructor(e){super(e),this.state={isLoading:!0},this.iframeRef=Object(r.createRef)(),this.setLoaded=this.setLoaded.bind(this)}componentDidMount(){this.iframeRef.current.addEventListener("load",this.setLoaded)}setLoaded(){this.setState({isLoading:!1}),this.props.onLoad()}render(){const{className:e,loadingContent:t,src:n,title:o}=this.props,{isLoading:a}=this.state,s=i()("woocommerce-web-preview",e,{"is-loading":a});return Object(r.createElement)("div",{className:s},a&&t,Object(r.createElement)("div",{className:"woocommerce-web-preview__iframe-wrapper"},Object(r.createElement)("iframe",{ref:this.iframeRef,title:o,src:n})))}}Kl.propTypes={className:c.a.string,loadingContent:c.a.node,onLoad:c.a.func,src:c.a.string.isRequired,title:c.a.string.isRequired},Kl.defaultProps={loadingContent:Object(r.createElement)(Zc,null),onLoad:l.noop};var zl=Kl;const ql=({count:e,className:t="",...n})=>Object(r.createElement)("span",Object.assign({className:"woocommerce-badge "+t},n),e),Vl=({field:e,type:t="text",...n})=>{const{label:o,description:a}=e;return Object(r.createElement)(El,Object.assign({type:t,title:a,label:o},n))},Wl={text:Vl,password:e=>Object(r.createElement)(Vl,Object.assign({},e,{type:"password"})),checkbox:({field:e,onChange:t,...n})=>{const{label:a,description:i}=e;return Object(r.createElement)(o.CheckboxControl,Object.assign({onChange:e=>t(e),title:i,label:a},n))},select:({field:e,...t})=>{const{description:n,label:o,options:a={}}=e,i=Object(r.useMemo)(()=>(e=>Object.entries(e).map(([e,t])=>({key:e,label:t,value:{id:e}})))(a),[a]);return Object(r.createElement)(K,Object.assign({title:n,label:o,options:i},t))},default:Vl},Gl=({fields:e=[],isBusy:t=!1,onSubmit:n=(()=>{}),onChange:a=(()=>{}),validate:i=(()=>({})),submitLabel:s=Object(m.__)("Proceed",'woocommerce')})=>{const c=e instanceof Array?e:Object.values(e),l=Object(r.useMemo)(()=>(e=>e.reduce((e,t)=>({...e,[t.id]:"checkbox"===t.type?"yes"===t.value:t.value}),{}))(c),[c]);return Object(r.createElement)(Js,{initialValues:l,onChange:a,onSubmit:n,validate:i},({getInputProps:e,handleSubmit:n})=>Object(r.createElement)("div",{className:"woocommerce-component_dynamic-form"},c.map(t=>{if(t.type&&!(t.type in Wl))return console.warn(`Field type of ${t.type} not current supported in DynamicForm component`),null;const n=Wl[t.type||"default"];return Object(r.createElement)(n,Object.assign({key:t.id,field:t},e(t.id)))}),Object(r.createElement)(o.Button,{isPrimary:!0,isBusy:t,onClick:()=>{n()}},s)))}},,,,,,,,,,,,function(e,t,n){"use strict";var r=n(0),o=n(8),a=Object(r.createElement)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(r.createElement)(o.Path,{d:"M10.6 6L9.4 7l4.6 5-4.6 5 1.2 1 5.4-6z"}));t.a=a}]);woocommerce-admin/dist/components/index.js.LICENSE.txt000064400000001052151335517650016656 0ustar00/*!
  Copyright (c) 2018 Jed Watson.
  Licensed under the MIT License (MIT), see
  http://jedwatson.github.io/classnames
*/

/*! @license DOMPurify | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/2.2.2/LICENSE */

/** @license React v16.13.1
 * react-is.production.min.js
 *
 * Copyright (c) Facebook, Inc. and its affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */
woocommerce-admin/dist/components/style-rtl.css000064400000255114151335517650015775 0ustar00:root{--wp-admin-theme-color:#007cba;--wp-admin-theme-color-darker-10:#006ba1;--wp-admin-theme-color-darker-20:#005a87}body.admin-color-light{--wp-admin-theme-color:#0085ba;--wp-admin-theme-color-darker-10:#0073a1;--wp-admin-theme-color-darker-20:#006187}body.admin-color-modern{--wp-admin-theme-color:#3858e9;--wp-admin-theme-color-darker-10:#2145e6;--wp-admin-theme-color-darker-20:#183ad6}body.admin-color-blue{--wp-admin-theme-color:#096484;--wp-admin-theme-color-darker-10:#07526c;--wp-admin-theme-color-darker-20:#064054}body.admin-color-coffee{--wp-admin-theme-color:#46403c;--wp-admin-theme-color-darker-10:#383330;--wp-admin-theme-color-darker-20:#2b2724}body.admin-color-ectoplasm{--wp-admin-theme-color:#523f6d;--wp-admin-theme-color-darker-10:#46365d;--wp-admin-theme-color-darker-20:#3a2c4d}body.admin-color-midnight{--wp-admin-theme-color:#e14d43;--wp-admin-theme-color-darker-10:#dd382d;--wp-admin-theme-color-darker-20:#d02c21}body.admin-color-ocean{--wp-admin-theme-color:#627c83;--wp-admin-theme-color-darker-10:#576e74;--wp-admin-theme-color-darker-20:#4c6066}body.admin-color-sunrise{--wp-admin-theme-color:#dd823b;--wp-admin-theme-color-darker-10:#d97426;--wp-admin-theme-color-darker-20:#c36922}.woocommerce-abbreviated-card a{display:flex;flex-direction:row;border-bottom:1px solid #e0e0e0;text-decoration:none}.woocommerce-abbreviated-card__icon{display:flex;align-items:center;padding:16px 24px}.woocommerce-abbreviated-card__icon svg{fill:#007cba;fill:var(--wp-admin-theme-color)}.woocommerce-calendar{width:100%;background-color:#f0f0f0;border-top:1px solid #ccc;height:396px}.woocommerce-calendar.is-mobile{height:100%}.woocommerce-calendar__react-dates{width:100%;overflow-x:hidden}.woocommerce-calendar__react-dates .DayPicker{margin:0 auto}.woocommerce-calendar__react-dates .CalendarMonth_table{margin-top:10px}.woocommerce-calendar__react-dates .CalendarDay__selected_span{background:#007cba;background:var(--wp-admin-theme-color);border:1px solid #ccc}.woocommerce-calendar__react-dates .CalendarDay__selected_span:hover{background:#006ba1;background:var(--wp-admin-theme-color-darker-10);border:1px solid #f0f0f0}.woocommerce-calendar__react-dates .CalendarDay__selected{background:#005a87;background:var(--wp-admin-theme-color-darker-20);border:1px solid #ccc}.woocommerce-calendar__react-dates .CalendarDay__hovered_span,.woocommerce-calendar__react-dates .CalendarDay__selected:hover{background:#006ba1;background:var(--wp-admin-theme-color-darker-10);border:1px solid #f0f0f0}.woocommerce-calendar__react-dates .CalendarDay__hovered_span{color:#fff}.woocommerce-calendar__react-dates .CalendarDay__hovered_span:hover{color:#fff;background:#007cba;background:var(--wp-admin-theme-color)}.woocommerce-calendar__react-dates .CalendarDay__blocked_out_of_range{color:#ccc}.woocommerce-calendar__react-dates .CalendarMonth,.woocommerce-calendar__react-dates .CalendarMonthGrid,.woocommerce-calendar__react-dates .DayPicker,.woocommerce-calendar__react-dates .DayPicker_transitionContainer{background-color:#f0f0f0}.woocommerce-calendar__react-dates .DayPicker_weekHeader_li{color:#757575}.woocommerce-calendar__react-dates .DayPickerNavigation_button:focus{outline:2px solid #bfe7f3}.woocommerce-calendar__react-dates.is-core-datepicker .components-datetime__date{padding-right:0}.woocommerce-calendar__react-dates.is-core-datepicker .CalendarDay__default{background-color:transparent}.woocommerce-calendar__react-dates.is-core-datepicker .CalendarDay__selected{background:#533582;border:none}.woocommerce-calendar__inputs{padding:1em;width:100%;max-width:500px;display:grid;grid-template-columns:43% 14% 43%;margin:0 auto}.woocommerce-calendar__inputs .components-base-control{margin:0}.woocommerce-calendar__inputs-to{display:flex;align-items:center;justify-content:center;grid-column-start:2}.woocommerce-calendar__input{position:relative}.woocommerce-calendar__input .calendar-icon{position:absolute;top:50%;transform:translateY(-50%);right:7px}.woocommerce-calendar__input .calendar-icon path{fill:#757575}.woocommerce-calendar__input:first-child{grid-column-start:1}.woocommerce-calendar__input:last-child{grid-column-start:3}.woocommerce-calendar__input.is-empty .calendar-icon path{fill:#757575}.woocommerce-calendar__input.is-error .calendar-icon path{fill:#d94f4f}.woocommerce-calendar__input.is-error .woocommerce-calendar__input-text{border:1px solid #d94f4f;box-shadow:inset 0 0 8px #d94f4f}.woocommerce-calendar__input.is-error .woocommerce-calendar__input-text:focus{box-shadow:inset 0 0 8px #d94f4f,0 0 6px rgba(30,140,190,.8)}.woocommerce-calendar__input .woocommerce-calendar__input-text{color:#757575;border-radius:3px;padding:10px 30px 10px 10px;width:100%;font-size:13px;font-size:.8125rem}.woocommerce-calendar__input .woocommerce-calendar__input-text::placeholder{color:#757575}.woocommerce-filters-date__content.is-mobile .woocommerce-calendar__input-error .components-popover__content{height:auto}.woocommerce-calendar__input-error{display:none}.is-error .woocommerce-calendar__input-text:focus+span .woocommerce-calendar__input-error{display:block;right:50%!important;position:absolute;top:auto!important}.woocommerce-calendar__input-error .components-popover__content{background-color:#757575;color:#fff;padding:.5em;border:none}.woocommerce-calendar__input-error.components-popover .components-popover__content{min-width:100px;width:100px;text-align:center}.woocommerce-calendar__input-error.components-popover:not(.no-arrow):not(.is-mobile).is-bottom:before{border-bottom-color:#757575;z-index:1;top:-6px}.woocommerce-calendar__input-error.components-popover:not(.no-arrow):not(.is-mobile).is-top:after{border-top-color:#757575;z-index:1;top:0}.woocommerce-calendar__date-picker-title{font-size:12px;font-size:.75rem;font-weight:100;text-transform:uppercase;text-align:center;color:#757575;width:100%;margin:0;padding:1em;background-color:#fff}.woocommerce-chart{margin-top:-16px;margin-bottom:24px;background:#fff;border:1px solid #e2e4e7;border-top:0}@media(max-width:782px){.woocommerce-chart{margin-right:-16px;margin-left:-16px;margin-bottom:12px;border-right:none;border-left:none;width:auto}}.woocommerce-chart .woocommerce-chart__header{min-height:50px;border-bottom:1px solid #e2e4e7;display:flex;flex-flow:row wrap;justify-content:space-between;align-items:center;width:100%}.woocommerce-chart .woocommerce-chart__header .woocommerce-chart__title{margin-right:24px;margin-left:16px}.woocommerce-chart .woocommerce-chart__body{display:flex;flex-direction:row;justify-content:flex-start;align-items:flex-start;width:100%}.woocommerce-chart .woocommerce-chart__body.woocommerce-chart__body-column{flex-direction:column}.woocommerce-chart .woocommerce-chart__footer{width:100%}.woocommerce-chart-placeholder{animation:loading-fade 1.6s ease-in-out infinite;background-color:#f0f0f0;color:transparent;padding:0;width:100%;display:flex;align-items:center;justify-content:center}.woocommerce-chart-placeholder:after{content:" "}@media screen and (prefers-reduced-motion:reduce){.woocommerce-chart-placeholder{animation:none}}.woocommerce-chart-placeholder .components-spinner{margin:0}.woocommerce-chart__interval-select{align-items:start;border-left:1px solid #e2e4e7;display:flex;flex-direction:column;justify-content:center;margin:0 auto 0 0;min-height:50px;padding:8px 16px 0}@media(max-width:960px){.woocommerce-chart__interval-select{width:100%;order:1;margin-top:-8px;margin-right:0;padding-right:8px;border-left:0;min-height:0}}#wpbody .woocommerce-chart__interval-select .components-select-control__input{font-size:13px;font-size:.8125rem;border:0;box-shadow:none}#wpbody .woocommerce-chart__interval-select .components-select-control__input .components-input-control__backdrop{display:none}#wpbody .woocommerce-chart__interval-select .components-select-control__input:not(:disabled):not([aria-disabled=true]):focus{background-color:#fff;color:#1e1e1e;box-shadow:inset 0 0 0 1px #757575,inset 0 0 0 2px #fff;outline:2px solid transparent;outline-offset:-2px}#wpbody .woocommerce-chart__interval-select .components-select-control__input:not(:disabled):not([aria-disabled=true]):focus~.components-input-control__backdrop{display:block}#wpbody .woocommerce-chart__interval-select .components-select-control__input~.components-input-control__backdrop{display:none}.woocommerce-chart__types{padding:0 8px;white-space:nowrap}.woocommerce-chart__type-button{background:transparent!important}.woocommerce-chart__type-button.components-button{color:#e2e4e7;display:inline-flex;padding:8px}.woocommerce-chart__type-button.components-button.woocommerce-chart__type-button-selected{color:#757575}@media(max-width:960px){.woocommerce-summary+.woocommerce-chart .woocommerce-chart__title{display:none}.woocommerce-summary+.woocommerce-chart .woocommerce-chart__interval-select{width:auto;order:0;margin-top:0}}.woocommerce-legend.has-total{padding-bottom:50px;position:relative}.woocommerce-legend.woocommerce-legend__direction-column{border-left:1px solid #ccc;min-width:320px}.woocommerce-chart__footer .woocommerce-legend.woocommerce-legend__direction-column{border-left:none}.woocommerce-legend__list{color:#24292d;display:flex;height:100%;margin:0}.woocommerce-legend__direction-column .woocommerce-legend__list{flex-direction:column;height:300px;overflow:auto}.woocommerce-chart__footer .woocommerce-legend__direction-column .woocommerce-legend__list{border-top:1px solid #ccc;height:100%;max-height:none;min-height:none}.has-total.woocommerce-legend__direction-column .woocommerce-legend__list{height:250px}.woocommerce-chart__footer .has-total.woocommerce-legend__direction-column .woocommerce-legend__list{height:auto;max-height:220px;min-height:none}.woocommerce-legend__direction-row .woocommerce-legend__list{flex-direction:row}.woocommerce-legend__item>button{display:flex;justify-content:center;align-items:center;background-color:#fff;color:#757575;cursor:pointer;display:inline-flex;flex-direction:row;flex-wrap:nowrap;justify-content:space-between;width:100%;border:none;padding:0}.woocommerce-legend__item>button .woocommerce-legend__item-container{display:flex;flex-direction:row;flex-wrap:nowrap;position:relative;padding:3px 24px 3px 0;font-size:13px;-webkit-user-select:none;user-select:none;width:100%}.woocommerce-legend__item>button .woocommerce-legend__item-container:hover input~.woocommerce-legend__item-checkmark{background-color:#e0e0e0}.woocommerce-legend__item>button .woocommerce-legend__item-container .woocommerce-legend__item-checkmark{border:1px solid #ccc;position:absolute;top:4px;right:0;height:16px;width:16px;background-color:#fff}.woocommerce-legend__item>button .woocommerce-legend__item-container .woocommerce-legend__item-checkmark:after{content:"";position:absolute;display:none}.woocommerce-legend__item>button .woocommerce-legend__item-container .woocommerce-legend__item-checkmark.woocommerce-legend__item-checkmark-checked{background-color:currentColor;border-color:currentColor}.woocommerce-legend__item>button .woocommerce-legend__item-container .woocommerce-legend__item-checkmark.woocommerce-legend__item-checkmark-checked:after{display:block;right:5px;top:2px;width:3px;height:6px;border:solid #fff;border-width:0 0 2px 2px;transform:rotate(-45deg)}.rtl .woocommerce-legend__item>button .woocommerce-legend__item-container .woocommerce-legend__item-checkmark.woocommerce-legend__item-checkmark-checked:after{transform:rotate(45deg) scaleX(-1)}.woocommerce-legend__item>button .woocommerce-legend__item-container .woocommerce-legend__item-total{margin-right:auto;font-weight:700}.woocommerce-legend__item>button:focus{outline:none}.woocommerce-legend__item>button:focus .woocommerce-legend__item-container .woocommerce-legend__item-checkmark{outline:2px solid #ccc}.woocommerce-legend__item>button:hover{background-color:#f0f0f0}.woocommerce-legend__direction-column .woocommerce-legend__item{margin:0;padding:0}.woocommerce-legend__direction-column .woocommerce-legend__item>button{min-height:36px;padding:0 17px;text-align:right}.woocommerce-legend__direction-column .woocommerce-legend__item:first-child{margin-top:12px}.woocommerce-legend__direction-column .woocommerce-legend__item:last-child:after{content:"";display:block;height:12px;width:100%}.woocommerce-legend__direction-row .woocommerce-legend__item{padding:0;margin:0}.woocommerce-legend__direction-row .woocommerce-legend__item>button{padding:0 17px}.woocommerce-legend__direction-row .woocommerce-legend__item>button .woocommerce-legend__item-container{height:50px;align-items:center}.woocommerce-legend__direction-row .woocommerce-legend__item>button .woocommerce-legend__item-container .woocommerce-legend__item-checkmark{top:17px}.woocommerce-legend__direction-row .woocommerce-legend__item>button .woocommerce-legend__item-container .woocommerce-legend__item-title{margin-left:17px}.woocommerce-legend__total{align-items:center;background:#fff;border-top:1px solid #ccc;bottom:0;color:#757575;display:flex;height:50px;justify-content:center;right:0;position:absolute;left:0;text-transform:uppercase}.woocommerce-legend__total:before{background:linear-gradient(-180deg,transparent,rgba(0,0,0,.2));bottom:100%;content:"";height:20px;right:0;opacity:0;pointer-events:none;position:absolute;left:0;transition:opacity .3s}.is-scrollable .woocommerce-legend__total:before{opacity:1}.woocommerce-chart__body-row .d3-chart__container{width:calc(100% - 320px)}.d3-chart__container{position:relative;width:100%}.d3-chart__container svg{overflow:visible}.d3-chart__container .d3-chart__empty-message{align-items:center;bottom:0;color:#757575;display:flex;font-size:18px;font-size:1.125rem;font-weight:700;justify-content:center;right:0;line-height:1.5;margin:0 auto;max-width:50%;padding-bottom:48px;pointer-events:none;position:absolute;left:0;top:0;text-align:center}@media(max-width:782px){.d3-chart__container .d3-chart__empty-message{font-size:13px;font-size:.8125rem}}.d3-chart__container .d3-chart__tooltip{border:1px solid #ccc;position:absolute;display:flex;min-width:324px;height:auto;background-color:#fff;text-align:right;padding:17px;box-shadow:0 3px 20px 0 rgba(18,24,30,.1),0 1px 3px 0 rgba(18,24,30,.1);flex-direction:column;flex-wrap:nowrap;justify-content:flex-start;pointer-events:none;visibility:hidden;z-index:1}@media(max-width:600px){.d3-chart__container .d3-chart__tooltip{min-width:auto;width:calc(100% - 48px)}}.d3-chart__container .d3-chart__tooltip h4{text-align:right;line-height:18px;width:100%;text-transform:uppercase;font-size:11px;color:#757575;margin-top:0}.d3-chart__container .d3-chart__tooltip ul{list-style:none;margin-bottom:2px;margin-top:2px;font-size:14px}.d3-chart__container .d3-chart__tooltip ul li{display:flex;flex-direction:row;flex-wrap:nowrap;justify-content:flex-start;align-items:center}.d3-chart__container .d3-chart__tooltip ul li.key-row{display:flex;flex-direction:row;justify-content:space-between;width:100%}.d3-chart__container .d3-chart__tooltip ul li.key-row .key-container{width:100%;min-width:100px}.d3-chart__container .d3-chart__tooltip ul li.key-row .key-container .key-color{display:inline-block;width:16px;height:16px;margin-left:8px}.d3-chart__container .d3-chart__tooltip ul li.key-row .key-container .key-key{margin-left:6px}.d3-chart__container .d3-chart__tooltip ul li.key-row .key-value{font-weight:600}.d3-chart__container .bargrouprect{shape-rendering:crispEdges}.d3-chart__container .grid .tick line{stroke:#f0f0f0;stroke-width:1;shape-rendering:crispEdges}.d3-chart__container .grid .tick:first-child line{stroke:#757575}.d3-chart__container .grid.with-positive-ticks .tick:last-child line{opacity:0}.d3-chart__container .tick{padding-top:10px;stroke-width:1}.d3-chart__container .y-axis{text-anchor:start}.d3-chart__container .y-axis.ticktext{fill:#757575}.d3-chart__container .axis-month .tick text,.d3-chart__container .y-axis .tick text{font-size:10px}.d3-chart__container .focus-grid line{stroke:rgba(0,0,0,.1);stroke-width:1px}.d3-chart__container .barfocus{fill:rgba(0,0,0,.1)}.d3-base{background:transparent;overflow-x:auto;overflow-y:hidden;position:relative;width:100%;height:100%}.woocommerce-page .woocommerce-dropdown-button{background-color:#fff;position:relative;border:1px solid #757575;color:#1e1e1e;border-radius:4px;padding:0 0 0 40px;width:100%;height:auto}.woocommerce-page .woocommerce-dropdown-button:after{content:"";background:#1e1e1e;-webkit-mask:url(data:image/svg+xml;charset=US-ASCII,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M5%206l5%205%205-5%202%201-7%207-7-7%202-1z%22%20%2F%3E%3C%2Fsvg%3E) no-repeat right 0 top 55%;mask:url(data:image/svg+xml;charset=US-ASCII,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M5%206l5%205%205-5%202%201-7%207-7-7%202-1z%22%20%2F%3E%3C%2Fsvg%3E) no-repeat right 0 top 55%;position:absolute;left:14px;width:32px;height:48px}.woocommerce-page .woocommerce-dropdown-button.is-open:after{transform:translateX(-12px) translateY(2px) rotate(-180deg)}.woocommerce-page .woocommerce-dropdown-button.is-open,.woocommerce-page .woocommerce-dropdown-button:active,.woocommerce-page .woocommerce-dropdown-button:hover{color:#007cba;color:var(--wp-admin-theme-color)}.woocommerce-page .woocommerce-dropdown-button.is-open:after,.woocommerce-page .woocommerce-dropdown-button:active:after,.woocommerce-page .woocommerce-dropdown-button:hover:after{background:#007cba;background:var(--wp-admin-theme-color)}.woocommerce-page .woocommerce-dropdown-button.is-multi-line .woocommerce-dropdown-button__labels{flex-direction:column}.woocommerce-page .woocommerce-dropdown-button:not(:focus):not(.is-open){border-color:#757575}.woocommerce-dropdown-button__labels{text-align:right;padding:8px 12px;min-height:48px;display:flex;align-items:center;width:100%;justify-content:space-around}@media(max-width:400px){.woocommerce-dropdown-button__labels{min-height:46px}}.woocommerce-dropdown-button__labels span{width:100%;text-align:right}.woocommerce-dropdown-button__labels span:last-child{font-size:12px;font-size:.75rem;margin:0}.woocommerce-dropdown-button__labels span:first-child{font-size:13px;font-size:.8125rem;font-weight:600}@media(max-width:400px){.woocommerce-dropdown-button__labels span:last-child{font-size:10px;font-size:.625rem}.woocommerce-dropdown-button__labels span:first-child{font-size:12px;font-size:.75rem}}.woocommerce-ellipsis-menu{text-align:center}.woocommerce-ellipsis-menu .woocommerce-ellipsis-menu__toggle{justify-content:center;vertical-align:middle;width:24px;padding:0}.woocommerce-ellipsis-menu .woocommerce-ellipsis-menu__toggle .gridicon{transform:rotate(-90deg)}.woocommerce-ellipsis-menu__popover{text-align:right}.woocommerce-ellipsis-menu__popover:not(.is-mobile):after,.woocommerce-ellipsis-menu__popover:not(.is-mobile):before{margin-right:-16px}.woocommerce-ellipsis-menu__popover .components-popover__content{width:182px;padding:2px}.woocommerce-ellipsis-menu__popover .woocommerce-ellipsis-menu__content{width:100%}.woocommerce-ellipsis-menu__popover .woocommerce-ellipsis-menu__item,.woocommerce-ellipsis-menu__popover .woocommerce-ellipsis-menu__title{padding:4px 12px}.woocommerce-ellipsis-menu__popover .woocommerce-ellipsis-menu__item{cursor:pointer;color:#757575}.woocommerce-ellipsis-menu__popover .woocommerce-ellipsis-menu__item:focus{box-shadow:inset 0 0 0 1px #6c7781,inset 0 0 0 2px #fff;outline:2px solid transparent;outline-offset:-2px}.woocommerce-ellipsis-menu__popover .woocommerce-ellipsis-menu__item .components-form-toggle{margin-left:8px}.woocommerce-ellipsis-menu__popover .components-base-control__label,.woocommerce-ellipsis-menu__popover .woocommerce-ellipsis-menu__title{color:#1e1e1e;padding-top:8px;padding-bottom:8px;font-size:15px;font-size:.9375rem;margin-bottom:4px}.woocommerce-ellipsis-menu__popover .components-toggle-control .components-base-control__field{margin:4px 0}.woocommerce-ellipsis-menu__popover .components-base-control{margin:0}.woocommerce-empty-content{margin-bottom:16px;text-align:center}.woocommerce-empty-content .woocommerce-empty-content__illustration{max-width:100%}.woocommerce-empty-content .woocommerce-empty-content__actions .components-button+.components-button{margin-right:16px}.woocommerce-filters-advanced{margin:24px 0}.woocommerce-filters-advanced .components-card__body{background-color:#f0f0f0;overflow:initial}.woocommerce-filters-advanced .components-card__body.is-size-small:hover,.woocommerce-filters-advanced .components-card__body ul li:hover{background-color:#e0e0e0}.woocommerce-filters-advanced .components-select-control .components-input-control__container .components-select-control__input{height:38px;padding:0 8px 0 0;margin:0}.woocommerce-filters-advanced .components-card__header .components-base-control__field{margin-bottom:0}.woocommerce-filters-advanced .components-card__header p{display:flex;line-height:38px}@media(max-width:782px){.woocommerce-filters-advanced{margin:16px 0;border:1px solid #ccc}}@media(max-width:400px){.woocommerce-filters-advanced{margin:12px 0}}.woocommerce-filters-advanced .woocommerce-filters-advanced__title-select{width:70px;display:inline-block;margin:0 8px}.woocommerce-filters-advanced__list{margin:0}.woocommerce-filters-advanced__list-item{padding:0 0 0 16px;margin:0;display:grid;grid-template-columns:1fr 40px;border-bottom:1px solid #ccc}.woocommerce-filters-advanced__list-item:hover{background-color:#e0e0e0}.woocommerce-filters-advanced__list-item .woocommerce-filters-advanced__line-item:first-child{grid-column-start:1;grid-column-end:2;grid-row-start:1;grid-row-end:2}.woocommerce-filters-advanced__list-item .woocommerce-filters-advanced__line-item:nth-child(2){grid-column-start:2;grid-column-end:3;grid-row-start:1;grid-row-end:2}.woocommerce-filters-advanced__list-item fieldset{padding:8px 16px 8px 8px}.woocommerce-filters-advanced__list-item .woocommerce-filters-advanced__remove{width:40px;height:38px;align-self:center;color:#757575;padding:8px}@media(max-width:400px){.woocommerce-filters-advanced__list-item .woocommerce-filters-advanced__remove{position:absolute;top:0;left:4px}}.woocommerce-filters-advanced__list-item .components-form-token-field{border-radius:4px}@media(max-width:400px){.woocommerce-filters-advanced__list-item{display:block;position:relative;padding:8px 0 0 8px}}.woocommerce-filters-advanced__add-filter{margin:0;display:block}.woocommerce-filters-advanced__add-filter div div{display:inline-block}.woocommerce-filters-advanced__add-filter .components-popover:not(.is-mobile) .components-popover__content{min-width:180px}.woocommerce-filters-advanced__add-filter .components-popover__content>div{width:100%}.woocommerce-filters-advanced__fieldset{display:flex;align-items:center}.woocommerce-filters-advanced__fieldset>div{padding:0 4px}@media(max-width:782px){.woocommerce-filters-advanced__fieldset>div{width:100%;padding:4px 0}}@media(max-width:782px){.woocommerce-filters-advanced__fieldset{display:block}}.woocommerce-filters-advanced__fieldset.is-english{display:grid;grid-template-columns:100px 150px 1fr}.woocommerce-filters-advanced__fieldset.is-english .woocommerce-filters-advanced__fieldset-item:first-child{grid-column-start:1;grid-column-end:2;grid-row-start:1;grid-row-end:2}.woocommerce-filters-advanced__fieldset.is-english .woocommerce-filters-advanced__fieldset-item:nth-child(2){grid-column-start:2;grid-column-end:3;grid-row-start:1;grid-row-end:2}.woocommerce-filters-advanced__fieldset.is-english .woocommerce-filters-advanced__fieldset-item:nth-child(3){grid-column-start:3;grid-column-end:4;grid-row-start:1;grid-row-end:2}.woocommerce-filters-advanced__fieldset.is-english .woocommerce-filters-advanced__fieldset-item:first-child{display:flex;align-items:center}.woocommerce-filters-advanced__fieldset.is-english .woocommerce-filters-advanced__fieldset-item .components-base-control__field{margin-bottom:0}@media(max-width:782px){.woocommerce-filters-advanced__fieldset.is-english{display:block}}.woocommerce-filters-advanced__rule{width:150px}.woocommerce-filters-advanced__input{width:100%}.woocommerce-filters-advanced__input.woocommerce-search.woocommerce-select-control .woocommerce-select-control__control{height:38px}.woocommerce-filters-advanced__add-filter-dropdown{display:inline-block}.woocommerce-filters-advanced__add-button{align-items:center;color:#757575;padding:8px}.woocommerce-filters-advanced__add-button svg{fill:currentColor;margin:0 0 0 6px}.woocommerce-filters-advanced__controls .components-button{margin-left:16px}.woocommerce-filters-advanced__add-dropdown{padding:8px 0}.woocommerce-filters-advanced__add-dropdown li{margin:0}.woocommerce-filters-advanced__add-dropdown .components-button{width:100%;padding:8px}.woocommerce-filters-advanced__add-dropdown .components-button:hover{background-color:#e0e0e0}.woocommerce-filters-advanced__add-dropdown .components-button:not(:disabled):not([aria-disabled=true]):focus{background-color:#f0f0f0;box-shadow:none}.woocommerce-filters-advanced__input-range{align-items:center;display:grid;grid-template-columns:1fr}.woocommerce-filters-advanced__input-range.is-between{grid-template-columns:1fr 36px 1fr}.woocommerce-filters-advanced__input-range input{height:38px;margin:0}.woocommerce-filters-advanced__input-range .separator{text-align:center}.woocommerce-filters-advanced__attribute-fieldset{align-items:center;display:grid;grid-template-columns:1fr 20px 1fr}.woocommerce-filters-advanced__attribute-fieldset .woocommerce-filters-advanced__attribute-field-separator{padding:0 6px}.woocommerce-filters-date__content.is-mobile .components-popover__header{border:none;height:0}.woocommerce-filters-date__content.is-mobile .components-popover__close{transform:translateY(22px)}.woocommerce-filters-date__content.is-mobile .components-tab-panel__tab-content{height:calc(100% - 46px);overflow:auto}.woocommerce-filters-date__content.components-dropdown__content .components-popover__content>div{padding:0}.woocommerce-filters-date__tabs{height:calc(100% - 42px);border-top:1px solid #ccc}.woocommerce-filters-date__tabs .components-tab-panel__tabs{display:flex;justify-content:space-between}.woocommerce-filters-date__tabs .components-tab-panel__tabs .components-button{display:block;text-align:center;width:50%}.woocommerce-filters-date__tabs .components-tab-panel__tab-content{display:flex;flex-direction:column;align-items:center}.woocommerce-filters-date__tabs:first-child{grid-column-start:1;grid-column-end:2;grid-row-start:1;grid-row-end:2}.woocommerce-filters-date__tabs:nth-child(2){grid-column-start:2;grid-column-end:3;grid-row-start:1;grid-row-end:2}.woocommerce-filters-date__text{font-size:12px;font-size:.75rem;font-weight:100;text-transform:uppercase;text-align:center;color:#757575;width:100%;margin:0;padding:1em;background-color:#fff}.woocommerce-filters-date__content-controls{display:flex;flex-direction:column;width:100%;align-items:center;padding-bottom:1em;background-color:#fff}.woocommerce-filters-date__content-controls.is-custom{border-top:1px solid #ccc}.woocommerce-filters-date__button-group{padding-top:1em;display:flex;justify-content:center;width:100%}.woocommerce-filters-date__button-group .woocommerce-filters-date__button{justify-content:center;width:40%;height:34px;margin:0 12px}.woocommerce-filters-filter__content.is-mobile .components-popover__header-title{font-size:12px;font-size:.75rem;font-weight:100;text-transform:uppercase;text-align:center;color:#757575}.woocommerce-filters-filter__content.is-mobile .woocommerce-filters-filter__content-list-item:last-child{border-bottom:1px solid #ccc}.woocommerce-filters-filter__content-list{margin:0;width:100%;min-width:100%}.woocommerce-filters-filter__content-list-item{border:1px solid transparent;border-bottom-color:#ccc;margin:0}.woocommerce-filters-filter__content-list-item:last-child{border-bottom:1px solid transparent}.woocommerce-filters-filter__content-list-item.is-selected .woocommerce-filters-filter__button,.woocommerce-filters-filter__content-list-item.is-selected .woocommerce-filters-filter__button.components-button:not(:disabled):not([aria-disabled=true]):focus{background-color:#fff}.woocommerce-filters-filter__content-list-item.is-selected .woocommerce-filters-filter__button:before{content:"";width:8px;height:8px;background-color:#7f54b3;position:absolute;top:50%;right:1em;transform:translate(-50%,-50%)}.woocommerce-filters-filter__content-list-item .woocommerce-filters-filter__button{position:relative;align-items:center;display:flex;width:100%;padding:1em 3em 1em 1em;background-color:#f0f0f0;text-align:right}.woocommerce-filters-filter__content-list-item .woocommerce-filters-filter__button.components-button{color:#757575}.woocommerce-filters-filter__content-list-item .woocommerce-filters-filter__button:hover{background-color:#e0e0e0;color:#757575}.woocommerce-filters-filter__content-list-item .woocommerce-filters-filter__button.components-button:not(:disabled):not([aria-disabled=true]):focus{background-color:#f0f0f0}.woocommerce-filters-filter__content-list-item .woocommerce-filters-filter__button svg{position:absolute;right:1em}.woocommerce-filters .components-base-control__field{margin-bottom:0}@media(max-width:400px){.woocommerce-filters{margin-right:-8px;margin-left:-8px}}.woocommerce-filters__basic-filters{display:flex;margin-bottom:24px}@media(max-width:1280px){.woocommerce-filters__basic-filters{flex-direction:column}}@media(max-width:782px){.woocommerce-filters__basic-filters{margin-bottom:16px}}.woocommerce-filters__advanced-filters .components-card__body{background-color:#f0f0f0}.woocommerce-filters__advanced-filters .components-card__footer .components-button{margin-left:16px}.woocommerce-filters-filter{width:25%;padding:0 12px;min-height:82px;display:flex;flex-direction:column;justify-content:flex-end}.woocommerce-filters-filter:first-child{padding-right:0}.woocommerce-filters-filter:last-child{padding-left:0}@media(max-width:1440px){.woocommerce-filters-filter{width:33.3%}}@media(max-width:1280px){.woocommerce-filters-filter{width:50%;padding:0;min-height:78px}}@media(max-width:782px){.woocommerce-filters-filter{width:100%}}.woocommerce-filters-label{margin:7px 0;display:block}@media(max-width:1280px){.woocommerce-filters-label{margin:5px 0}}.woocommerce-filters-date__content .components-popover__content,.woocommerce-filters-filter__content .components-popover__content{width:320px;border:1px solid #ccc;background-color:#fff}.woocommerce-filters-date__content .woocommerce-calendar__input-error .components-popover__content,.woocommerce-filters-filter__content .woocommerce-calendar__input-error .components-popover__content{background-color:#757575}.woocommerce-filters-date__content.is-mobile .components-popover__content,.woocommerce-filters-filter__content.is-mobile .components-popover__content{width:100%;height:100%;border:none}.woocommerce-filters-filter__search .woocommerce-search__autocomplete-results{position:static}.woocommerce-filters-filter__search .woocommerce-search__inline-container{overflow:hidden}.woocommerce-filters-filter__search .woocommerce-search__inline-container:not(.is-active){border:none}.woocommerce-filters-advanced__list-item .components-base-control+.components-base-control{margin-bottom:0}.woocommerce-flag span{vertical-align:middle}.woocommerce-flag .woocommerce-flag__fallback{background:#f0f0f0;color:transparent;width:24px;height:18px;display:block;overflow:hidden}.woocommerce-image-upload .woocommerce-image-upload__image-preview{font-size:16px;margin-left:2em}.woocommerce-image-upload .woocommerce-image-upload__image-preview img{max-width:240px;height:auto}.woocommerce-image-upload .woocommerce-image-upload__add-image{margin:16px 0}.woocommerce-image-upload.has-image{display:flex;align-items:center}.woocommerce-list{margin:0;padding:0}a.woocommerce-list__item{color:inherit}.woocommerce-list__item{display:flex;align-items:center;margin-bottom:0;text-decoration:none;background-color:#fff}.woocommerce-list__item.has-gutters{padding:16px 24px}.woocommerce-list__item.has-action{cursor:pointer}.woocommerce-list__item:focus{box-shadow:inset 0 0 0 1px #006088,inset 0 0 0 2px #fff}.woocommerce-list__item:focus-visible{box-shadow:none}.woocommerce-list__item:not(.transitions-disabled).woocommerce-list__item-enter{opacity:0;max-height:0;transform:translateX(-50%)}.woocommerce-list__item:not(.transitions-disabled).woocommerce-list__item-enter-active{opacity:1;max-height:100vh;transform:translateX(0);transition:opacity .5s,transform .5s,max-height .5s}.woocommerce-list__item:not(.transitions-disabled).woocommerce-list__item-exit{opacity:1;max-height:100vh;transform:translateX(0)}.woocommerce-list__item:not(.transitions-disabled).woocommerce-list__item-exit-active{opacity:0;max-height:0;transform:translateX(-50%);transition:opacity .5s,transform .5s,max-height .5s}.woocommerce-list__item>.woocommerce-list__item-inner{text-decoration:none;width:100%;display:flex;align-items:center;padding:16px 24px}.woocommerce-list__item>.woocommerce-list__item-inner:focus{box-shadow:inset 0 0 0 1px #006088,inset 0 0 0 2px #fff}.woocommerce-list__item .woocommerce-list__item-title{color:#1d2327}.woocommerce-list__item .woocommerce-list__item-content{margin-top:4px;display:block;font-size:14px;line-height:20px;color:#50575d}.woocommerce-list__item .woocommerce-list__item-before{margin-left:20px;display:flex;align-items:center}.woocommerce-list__item .woocommerce-list__item-after{display:flex;align-items:center;margin-right:auto}.woocommerce-list__item:not(:first-child){border-top:1px solid #f0f0f0}.woocommerce-list__item:hover{background-color:#f0f0f0}.woocommerce-list__item:hover .woocommerce-list__item-title{color:#007cba;color:var(--wp-admin-theme-color)}.woocommerce-list__item:hover .woocommerce-list__item-before>svg{fill:#007cba;fill:var(--wp-admin-theme-color)}.woocommerce-list__item .woocommerce-list__item-title,.woocommerce-list__item .woocommerce-list__item-title>div{color:#007cba;color:var(--wp-admin-theme-color)}.woocommerce-list__item .woocommerce-list__item-before>svg{fill:#007cba;fill:var(--wp-admin-theme-color)}.woocommerce-list__item .woocommerce-list__item-after>svg{fill:#1e1e1e}.woocommerce-list__item.is-complete .woocommerce-task__icon{background-color:#007cba;background-color:var(--wp-admin-theme-color)}.woocommerce-list__item.is-complete .woocommerce-list__item-title{color:#757575}.woocommerce-list__item.is-complete .woocommerce-list__item-content{display:none}.woocommerce-list__item-title{color:#2c3338}.woocommerce-list__item-content{color:#646970}.woocommerce-order-status{display:flex;align-items:center}.woocommerce-order-status__indicator{min-width:16px;width:16px;height:16px;display:block;background:#ccc;margin-left:8px;border-radius:50%;border:3px solid #f0f0f0}.woocommerce-order-status__indicator.is-processing{background:#4ab866;border-color:#93d5a4}.woocommerce-order-status__indicator.is-on-hold{background:#ffb900;border-color:#ffd566}.woocommerce-pagination{display:flex;flex-direction:row;flex-wrap:nowrap;justify-content:center;align-items:center}@media(max-width:782px){.woocommerce-pagination{flex-direction:column}}.woocommerce-pagination input{border-radius:4px}.woocommerce-pagination__page-arrows{display:flex;flex-direction:row}.woocommerce-pagination__page-arrows-buttons{display:inline-flex;align-items:baseline;border:1px solid #b5bfc9;border-radius:4px;background:#f0f2f4}.woocommerce-pagination__page-arrows-buttons .components-button{color:#24292d;height:30px;width:32px;justify-content:center}.woocommerce-pagination__page-arrows-buttons .components-button:not(:disabled):not([aria-disabled=true]):hover{color:#757575}.woocommerce-pagination__page-arrows-buttons button:first-child{border-top-left-radius:0;border-bottom-left-radius:0;border-left:2px solid #d3d9de}.woocommerce-pagination__page-arrows-buttons button:last-child{border-top-right-radius:0;border-bottom-right-radius:0}.woocommerce-pagination__page-arrows-buttons .woocommerce-pagination__link{padding:4px}.woocommerce-pagination__page-arrows-label{margin-top:8px;margin-left:8px}.woocommerce-pagination__page-picker{margin-right:16px}@media(max-width:782px){.woocommerce-pagination__page-picker{margin-top:16px;margin-right:0}}.woocommerce-pagination__page-picker .woocommerce-pagination__page-picker-input{margin-right:8px;width:60px;height:34px;box-shadow:none}.woocommerce-pagination__per-page-picker{margin-right:16px}@media(max-width:782px){.woocommerce-pagination__per-page-picker{margin-top:16px;margin-right:0}}.woocommerce-pagination__per-page-picker .components-base-control{margin-bottom:0}.woocommerce-pagination__per-page-picker .components-base-control .components-base-control__field{display:flex;flex-direction:row;align-items:baseline;margin-bottom:0}.woocommerce-pagination__per-page-picker .components-base-control .components-select-control__input{width:60px;height:34px;box-shadow:none}.woocommerce-pagination__per-page-picker .components-base-control .components-base-control__label{margin-left:8px}.woocommerce-pagination__page-picker-input.has-error,.woocommerce-pagination__page-picker-input.has-error:focus{border-color:#d94f4f;box-shadow:0 0 2px #d94f4f}.woocommerce-pill{border:1px solid #757575;border-radius:28px;color:#757575;display:inline-block;padding:4px 8px}@media(max-width:320px){.woocommerce-pill{font-size:11px}}.woocommerce-product-image{border-radius:2px}.woocommerce-rating{position:relative;vertical-align:middle;display:inline-block;overflow:hidden;white-space:nowrap}.woocommerce-rating .gridicon{fill:#e0e0e0}.woocommerce-rating .woocommerce-rating__star-outline{position:absolute;right:0;top:0;white-space:nowrap;overflow:hidden}.woocommerce-rating .woocommerce-rating__star-outline .gridicon{fill:#757575}.woocommerce-search.woocommerce-select-control{position:relative}.woocommerce-search.woocommerce-select-control .woocommerce-select-control__control-icon{position:absolute;top:50%;right:10px;transform:translateY(-50%);color:#ccc;font-size:20px}.woocommerce-search.woocommerce-select-control:not(.has-inline-tags) .woocommerce-tag{margin:8px 0 0 6px}.woocommerce-search.woocommerce-select-control .woocommerce-select-control__control{height:auto;font-size:13px;width:100%;padding:3px 36px 3px 2px;border-radius:4px;border:1px solid #757575;box-shadow:0 2px 6px rgba(0,0,0,.05)}.woocommerce-search.woocommerce-select-control .woocommerce-select-control__control.is-active{border-color:#007cba;border-color:var(--wp-admin-theme-color)}.woocommerce-search.woocommerce-select-control .components-base-control .woocommerce-select-control__control-input{margin:0;font-size:13px;min-height:auto}.woocommerce-search.woocommerce-select-control .components-base-control .woocommerce-select-control__control-input[type=number]::-webkit-inner-spin-button,.woocommerce-search.woocommerce-select-control .components-base-control .woocommerce-select-control__control-input[type=number]::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}.woocommerce-search.woocommerce-select-control .components-base-control .components-base-control__label{font-size:13px;color:#72777c;margin:0;width:calc(100% - 36px);top:50%;right:36px}.woocommerce-search.woocommerce-select-control.has-inline-tags .has-tags.components-base-control .components-base-control__label,.woocommerce-search.woocommerce-select-control .is-active.components-base-control .components-base-control__label,.woocommerce-search.woocommerce-select-control .with-value.components-base-control .components-base-control__label{display:none}.woocommerce-search.woocommerce-select-control .components-base-control .woocommerce-select-control__tags{margin:0}.woocommerce-search.woocommerce-select-control .components-base-control .woocommerce-tag{max-height:24px}.woocommerce-search.woocommerce-select-control .woocommerce-select-control__listbox{border:1px solid #ccc;top:38px}.woocommerce-search.woocommerce-select-control.is-static-results .woocommerce-select-control__listbox{position:static}.woocommerce-search.woocommerce-select-control .woocommerce-select-control__option{margin-bottom:0;display:flex;flex-direction:row;flex-grow:1;flex-shrink:0;align-items:center;padding:12px;color:#7f54b3;text-align:right;background:#f0f0f0;border-bottom:1px solid #f0f0f0;font-size:13px;min-height:43px;height:auto}.woocommerce-search.woocommerce-select-control .woocommerce-select-control__option:last-of-type{border-bottom:none}.woocommerce-search.woocommerce-select-control .woocommerce-select-control__option:hover{box-shadow:none;color:#7f54b3;background:#e0e0e0}.woocommerce-search.woocommerce-select-control .woocommerce-select-control__option.is-selected,.woocommerce-search.woocommerce-select-control .woocommerce-select-control__option:active,.woocommerce-search.woocommerce-select-control .woocommerce-select-control__option:focus{color:#7f54b3;background:#fff;box-shadow:inset 0 0 0 1px #e0e0e0,inset 0 0 0 2px #24292d}.woocommerce-search.woocommerce-select-control .woocommerce-select-control__option .woocommerce-search__result-thumbnail{margin-left:12px}.woocommerce-search__result-name{text-decoration:underline}.woocommerce-search-list{width:100%;padding:0 0 16px;text-align:right}.woocommerce-search-list__selected{margin:16px 0;padding:16px 0 0;min-height:76px;border-top:1px solid #f0f0f0}.woocommerce-search-list__selected .woocommerce-search-list__selected-header{margin-bottom:8px}.woocommerce-search-list__selected .woocommerce-search-list__selected-header button{margin-right:12px}.woocommerce-search-list__selected .woocommerce-tag__text{max-width:13em}.woocommerce-search-list__selected ul{list-style:none}.woocommerce-search-list__selected ul li{float:right}.woocommerce-search-list__search{margin:16px 0;padding:16px 0 0;border-top:1px solid #f0f0f0}.woocommerce-search-list__search .components-base-control__field{margin-bottom:16px}.woocommerce-search-list__list{border:1px solid #e0e0e0;padding:0;max-height:17em;overflow-x:hidden;overflow-y:auto}.woocommerce-search-list__list li{margin-bottom:0}.woocommerce-search-list__list.is-loading,.woocommerce-search-list__list.is-not-found{padding:12px 0;text-align:center;border:none}.woocommerce-search-list__list.is-not-found .woocommerce-search-list__not-found-icon,.woocommerce-search-list__list.is-not-found .woocommerce-search-list__not-found-text{display:inline-block}.woocommerce-search-list__list.is-not-found .woocommerce-search-list__not-found-icon{margin-left:16px}.woocommerce-search-list__list.is-not-found .woocommerce-search-list__not-found-icon .gridicon{vertical-align:top;margin-top:-1px}.woocommerce-search-list__list .components-spinner{float:none;margin:0 auto}.woocommerce-search-list__list .components-menu-group__label{clip:rect(1px,1px,1px,1px);-webkit-clip-path:inset(50%);clip-path:inset(50%);height:1px;width:1px;margin:-1px;overflow:hidden;overflow-wrap:normal!important;word-wrap:normal!important}.woocommerce-search-list__list>[role=menu]{border:1px solid #f0f0f0;border-bottom:none}.woocommerce-search-list__list .woocommerce-search-list__item{display:flex;align-items:center;margin-bottom:0;padding:12px 16px;background:#fff;border-bottom:1px solid #f0f0f0;color:#757575}.woocommerce-search-list__list .woocommerce-search-list__item:active,.woocommerce-search-list__list .woocommerce-search-list__item:focus,.woocommerce-search-list__list .woocommerce-search-list__item:hover{background:#f0f0f0}.woocommerce-search-list__list .woocommerce-search-list__item:active,.woocommerce-search-list__list .woocommerce-search-list__item:focus{box-shadow:none}.woocommerce-search-list__list .woocommerce-search-list__item .woocommerce-search-list__item-input{margin:0 0 0 8px}.woocommerce-search-list__list .woocommerce-search-list__item .woocommerce-search-list__item-label{display:flex;flex:1}.woocommerce-search-list__list .woocommerce-search-list__item.depth-0+.depth-1{margin-top:-1px}.woocommerce-search-list__list .woocommerce-search-list__item:not(.depth-0){border-bottom:0!important}.woocommerce-search-list__list .woocommerce-search-list__item:not(.depth-0)+.depth-0{border-top:1px solid #f0f0f0}.woocommerce-search-list__list .woocommerce-search-list__item[class*=depth-] .woocommerce-search-list__item-label:before{margin-left:4px;content:"— — — — — "}.woocommerce-search-list__list .woocommerce-search-list__item.depth-0 .woocommerce-search-list__item-label:before{margin-left:0;content:""}.woocommerce-search-list__list .woocommerce-search-list__item.depth-1 .woocommerce-search-list__item-label:before{content:"— "}.woocommerce-search-list__list .woocommerce-search-list__item.depth-2 .woocommerce-search-list__item-label:before{content:"— — "}.woocommerce-search-list__list .woocommerce-search-list__item.depth-3 .woocommerce-search-list__item-label:before{content:"— — — "}.woocommerce-search-list__list .woocommerce-search-list__item.depth-4 .woocommerce-search-list__item-label:before{content:"— — — — "}.woocommerce-search-list__list .woocommerce-search-list__item .woocommerce-search-list__item-name{display:inline-block}.woocommerce-search-list__list .woocommerce-search-list__item .woocommerce-search-list__item-prefix{display:none;color:#757575}.woocommerce-search-list__list .woocommerce-search-list__item.is-searching .woocommerce-search-list__item-label,.woocommerce-search-list__list .woocommerce-search-list__item.is-skip-level .woocommerce-search-list__item-label{display:inline-block}.woocommerce-search-list__list .woocommerce-search-list__item.is-searching .woocommerce-search-list__item-prefix,.woocommerce-search-list__list .woocommerce-search-list__item.is-skip-level .woocommerce-search-list__item-prefix{display:inline}.woocommerce-search-list__list .woocommerce-search-list__item.is-searching .woocommerce-search-list__item-prefix:after,.woocommerce-search-list__list .woocommerce-search-list__item.is-skip-level .woocommerce-search-list__item-prefix:after{margin-left:4px;content:" ›"}.woocommerce-search-list__list .woocommerce-search-list__item.is-searching .woocommerce-search-list__item-name{color:#1e1e1e}.woocommerce-search-list__list .woocommerce-search-list__item.has-count>.components-menu-item__item{width:100%}.woocommerce-search-list__list .woocommerce-search-list__item .woocommerce-search-list__item-count{flex:0 1 auto;padding:2px 8px;border:1px solid #f0f0f0;border-radius:12px;font-size:.8em;line-height:1.4;color:#757575;background:#fff;white-space:nowrap}.woocommerce-search-list__list li:last-child .woocommerce-search-list__item{border-bottom:none}.woocommerce-search-list.is-compact .woocommerce-search-list__selected{margin:0 0 16px;padding:0;border-top:none;min-height:54px}.woocommerce-search-list.is-compact .woocommerce-search-list__search{margin:0 0 16px;padding:0;border-top:none}.woocommerce-section-header{padding:13px;border-bottom:none;display:flex;justify-content:space-between}@media(max-width:782px){.woocommerce-section-header{margin-right:-16px;margin-left:-16px;margin-bottom:12px;border-right:none;border-left:none;width:auto}}.woocommerce-section-header hr{align-self:center;flex-grow:1;height:1px;margin:0 10px}@media(max-width:782px){.woocommerce-section-header.has-interval-select{position:relative;padding-bottom:30px}.woocommerce-section-header.has-interval-select .woocommerce-chart__interval-select{position:absolute;right:0;bottom:0;padding-right:6px}}.woocommerce-section-header__actions,.woocommerce-section-header__menu{text-align:left}.woocommerce-section-header__actions{display:flex;flex-grow:1;justify-content:flex-end}.woocommerce-section-header__actions .components-base-control{padding-top:0;min-height:34px}.woocommerce-section-header__actions .components-base-control .components-base-control__field{margin-bottom:0}.woocommerce-section-header__actions .components-base-control .components-base-control__field select{background:transparent}.woocommerce-ellipsis-menu__toggle{padding:0}.woocommerce-section-header__menu{display:flex;flex-direction:column;justify-content:center}.woocommerce-section-header__title{margin:0 0 0 16px;padding:3px 0;font-size:20px;font-size:1.25rem;line-height:2.2;font-weight:400}.woocommerce-segmented-selection{width:100%;color:#757575}.woocommerce-segmented-selection__container{width:100%;grid-template-columns:1fr 1fr;display:grid;border-top:1px solid #ccc;border-bottom:1px solid #ccc;background-color:#ccc}.woocommerce-segmented-selection__item:nth-child(2n){border-right:1px solid #ccc;border-top:1px solid #ccc}.woocommerce-segmented-selection__item:nth-child(odd){border-top:1px solid #ccc}.woocommerce-segmented-selection__item:nth-child(-n+2){border-top:0}.woocommerce-segmented-selection__label{background-color:#f0f0f0;padding:12px 36px 12px 12px;position:relative;display:block;height:100%}.woocommerce-segmented-selection__label:active,.woocommerce-segmented-selection__label:hover{background-color:#e0e0e0}.woocommerce-segmented-selection__input{opacity:0;position:absolute;right:-9999px}.woocommerce-segmented-selection__input:active+label .woocommerce-segmented-selection__label{background-color:#e0e0e0}.woocommerce-segmented-selection__input:checked+label .woocommerce-segmented-selection__label{background-color:#fff;font-weight:600}.woocommerce-segmented-selection__input:checked+label .woocommerce-segmented-selection__label:before{content:"";width:8px;height:8px;background-color:#007cba;background-color:var(--wp-admin-theme-color);position:absolute;top:50%;transform:translate(20px,-50%)}.woocommerce-segmented-selection__input:focus+label .woocommerce-segmented-selection__label{box-shadow:inset 0 0 0 1px #24292d}.woocommerce-select-control{position:relative}.woocommerce-select-control .components-base-control{height:56px;display:flex;align-items:center;border:1px solid #a7aaad;border-radius:3px;background:#fff;padding:12px;position:relative}.woocommerce-select-control .components-base-control .woocommerce-select-control__tags{margin:12px 0 0 4px}.woocommerce-select-control .components-base-control .woocommerce-tag{max-height:20px}.woocommerce-select-control .components-base-control .components-base-control__field{display:flex;align-items:center;flex:1;margin-bottom:0;max-width:100%}.woocommerce-select-control .components-base-control .components-base-control__label{position:absolute;top:50%;transform:translateY(-50%);color:#646970;font-size:16px}.woocommerce-select-control .components-base-control .woocommerce-select-control__control-input{font-size:16px;border:0;box-shadow:none;color:#2c3338;margin:12px 0 0;padding-right:0;padding-left:0;width:100%;line-height:24px;text-align:right;letter-spacing:inherit;background:transparent}.woocommerce-select-control .components-base-control .woocommerce-select-control__control-input::-webkit-search-cancel-button{display:none}.woocommerce-select-control .components-base-control .woocommerce-select-control__control-input:focus{outline:none}.woocommerce-select-control .components-base-control i{color:#636d75;margin-left:12px;width:24px}.woocommerce-select-control .components-base-control.is-active{box-shadow:0 0 0 1px #006088;border-color:#006088}.woocommerce-select-control .components-base-control.has-tags .components-base-control__label,.woocommerce-select-control .components-base-control.with-value .components-base-control__label{font-size:12px;margin-top:-12px}.woocommerce-select-control .components-base-control.is-disabled{opacity:.5}.woocommerce-select-control .components-base-control.is-disabled .components-base-control__label{cursor:default}.woocommerce-select-control .woocommerce-select-control__autofill-input{position:absolute;z-index:-1}.woocommerce-select-control .woocommerce-select-control__tags{position:relative;margin:12px 0 0}.woocommerce-select-control .woocommerce-select-control__tags.has-clear{padding-left:24px}.woocommerce-select-control .woocommerce-tag{max-height:24px}.woocommerce-select-control .woocommerce-select-control__clear{position:absolute;left:10px;top:calc(50% - 10px)}.woocommerce-select-control .woocommerce-select-control__clear>.clear-icon{color:#c9c9c9}.woocommerce-select-control .woocommerce-select-control__listbox{background:#fff;display:flex;flex-direction:column;align-items:stretch;box-shadow:0 3px 5px rgba(0,0,0,.2),0 1px 18px rgba(0,0,0,.12),0 6px 10px rgba(0,0,0,.14);border-radius:3px;position:absolute;right:0;left:0;top:57px;z-index:10;overflow-y:auto;max-height:350px}.woocommerce-select-control .woocommerce-select-control__listbox.is-static{position:static}.woocommerce-select-control .woocommerce-select-control__option{padding:16px;min-height:56px;font-size:16px;text-align:right}.woocommerce-select-control .woocommerce-select-control__option.is-selected,.woocommerce-select-control .woocommerce-select-control__option:hover{background:#f6f7f7}.woocommerce-select-control.is-searchable .components-base-control__label{right:48px}.woocommerce-select-control.is-searchable .components-base-control.is-active .components-base-control__label{font-size:12px;margin-top:-12px}.woocommerce-stepper .woocommerce-stepper__steps{display:flex;justify-content:space-around;margin-bottom:24px}.woocommerce-stepper .woocommerce-stepper__step{padding:8px;font-weight:400;position:relative}.woocommerce-stepper .woocommerce-stepper__step .woocommerce-stepper__step-label-wrapper{display:flex;text-align:right;border:0;background-color:transparent;padding:0}.woocommerce-stepper .woocommerce-stepper__step .woocommerce-stepper__step-label-wrapper:focus{outline:none;box-shadow:none}.woocommerce-stepper .woocommerce-stepper__step button.woocommerce-stepper__step-label-wrapper{cursor:pointer}.woocommerce-stepper .woocommerce-stepper__step .woocommerce-stepper__step-text{width:100%}.woocommerce-stepper .woocommerce-stepper__step .woocommerce-stepper__step-label{color:#1e1e1e;line-height:24px;font-size:16px}.woocommerce-stepper .woocommerce-stepper__step .woocommerce-stepper__step-description{display:none;font-size:14px;color:#757575;font-weight:400;margin-top:2px}.woocommerce-stepper .woocommerce-stepper__step .woocommerce-stepper__step-icon svg{display:none}.woocommerce-stepper .woocommerce-stepper__step .woocommerce-spinner{display:block;margin-left:12px;max-height:24px;min-width:24px;width:24px;border-radius:50%;background:#007cba;background:var(--wp-admin-theme-color)}.woocommerce-stepper .woocommerce-stepper__step .woocommerce-spinner__circle{stroke:#fff}.woocommerce-stepper .woocommerce-stepper__step.is-active .woocommerce-stepper__step-icon,.woocommerce-stepper .woocommerce-stepper__step.is-complete .woocommerce-stepper__step-icon{background:#007cba;background:var(--wp-admin-theme-color);color:#fff}.woocommerce-stepper .woocommerce-stepper__step.is-active .woocommerce-stepper__step-label,.woocommerce-stepper .woocommerce-stepper__step.is-complete .woocommerce-stepper__step-label{color:#1e1e1e}.woocommerce-stepper .woocommerce-stepper__step.is-active .woocommerce-stepper__step-icon{font-weight:600}.woocommerce-stepper .woocommerce-stepper__step.is-active .woocommerce-stepper__step-label{font-weight:600;margin:0}.woocommerce-stepper .woocommerce-stepper__step.is-complete .woocommerce-stepper__step-number{display:none}.woocommerce-stepper .woocommerce-stepper__step.is-complete svg{display:inline}.woocommerce-stepper .woocommerce-stepper__step-icon{font-size:16px;display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;min-width:24px;margin-left:12px;background:#f0f0f0;color:#757575;border-radius:50%}.woocommerce-stepper .woocommerce-stepper__step-divider{align-self:flex-start;flex-grow:1;border-bottom:1px solid #f0f0f0;margin-top:20px}.woocommerce-stepper .woocommerce-stepper__step-divider:last-child{display:none}@media(max-width:782px){.woocommerce-stepper .woocommerce-stepper__step-label{display:none;padding-top:24px}.woocommerce-stepper .woocommerce-stepper__step-icon{margin-left:0}}.woocommerce-stepper.is-vertical .woocommerce-stepper__steps{align-items:normal;flex-direction:column;margin-bottom:0}.woocommerce-stepper.is-vertical .woocommerce-stepper__step{padding-bottom:36px}.woocommerce-stepper.is-vertical .woocommerce-stepper__step:after{content:"";position:absolute;right:20px;top:40px;height:calc(100% - 40px);border-right:1px solid #f0f0f0}.woocommerce-stepper.is-vertical .woocommerce-stepper__step:last-child{padding-bottom:8px}.woocommerce-stepper.is-vertical .woocommerce-stepper__step:last-child:after{display:none}.woocommerce-stepper.is-vertical .woocommerce-stepper__step-label{display:initial}.woocommerce-stepper.is-vertical .woocommerce-stepper__step-icon{margin-left:12px}.woocommerce-stepper.is-vertical .woocommerce-stepper__step-description{display:block}.woocommerce-stepper.is-vertical .woocommerce-stepper_content{margin-top:16px;margin-right:36px}@keyframes rotate{0%{transform:rotate(0deg)}to{transform:rotate(-270deg)}}@keyframes growAndShrink{0%,to{stroke-dashoffset:200}50%{stroke-dashoffset:50;transform:rotate(-135deg)}to{transform:rotate(-450deg)}}.woocommerce-spinner{animation:rotate 2s linear infinite;width:40px;min-width:40px;height:40px;max-height:40px}.woocommerce-spinner__circle{stroke-dasharray:200;stroke-dashoffset:0;transform-origin:center;animation:growAndShrink 2s ease-in-out infinite;stroke:#1d2327}.woocommerce-summary{margin:16px 0;display:grid;border-color:#e0e0e0;border-style:solid;border-width:1px 1px 0 0;background-color:#f0f0f0;box-shadow:inset 1px -1px 0 #e0e0e0;width:100%}@media(max-width:782px){.woocommerce-summary{border-width:0}.woocommerce-summary.is-placeholder{border-top:0}.woocommerce-summary .woocommerce-summary__item-container.is-placeholder{border-top:1px solid #e0e0e0}}.woocommerce-summary .components-popover:not(.components-tooltip){position:static!important;top:auto!important;right:auto!important;left:auto!important;bottom:auto!important;margin-top:0!important;margin-right:0}.woocommerce-summary .components-popover:not(.components-tooltip) .components-popover__header{display:none}.woocommerce-summary .components-popover:not(.components-tooltip) .components-popover__content{position:static;right:auto;left:auto;margin:0;width:100%;max-width:100%!important;max-height:100%!important;box-shadow:none;border:none;transform:none}.woocommerce-summary .components-popover:not(.components-tooltip) .components-popover__content .woocommerce-summary__item.is-selected{display:none}.components-popover__content .woocommerce-summary{max-height:100%;margin-top:0;margin-bottom:0;overflow-y:auto;border:none}.woocommerce-summary .woocommerce-summary__item-delta,.woocommerce-summary .woocommerce-summary__item-value{flex:1 0 auto}.woocommerce-summary .woocommerce-summary__item-delta{flex:0 1 auto;display:flex}.woocommerce-summary,.woocommerce-summary.has-1-items,.woocommerce-summary.has-one-item{grid-template-columns:1fr}.woocommerce-summary.has-2-items{grid-template-columns:repeat(2,1fr)}.woocommerce-summary.has-2-items .woocommerce-summary__item-container:nth-of-type(2n) .woocommerce-summary__item{border-left-color:#e0e0e0}.woocommerce-summary.has-2-items .woocommerce-summary__item-container:nth-of-type(odd):nth-last-of-type(-n+2) .woocommerce-summary__item,.woocommerce-summary.has-2-items .woocommerce-summary__item-container:nth-of-type(odd):nth-last-of-type(-n+2)~.woocommerce-summary__item-container .woocommerce-summary__item{border-bottom-color:#e0e0e0}.woocommerce-summary.has-3-items{grid-template-columns:repeat(3,1fr)}.woocommerce-summary.has-3-items .woocommerce-summary__item-container:nth-of-type(3n) .woocommerce-summary__item{border-left-color:#e0e0e0}.woocommerce-summary.has-3-items .woocommerce-summary__item-container:nth-of-type(3n+1):nth-last-of-type(-n+3) .woocommerce-summary__item,.woocommerce-summary.has-3-items .woocommerce-summary__item-container:nth-of-type(3n+1):nth-last-of-type(-n+3)~.woocommerce-summary__item-container .woocommerce-summary__item{border-bottom-color:#e0e0e0}.woocommerce-summary.has-4-items,.woocommerce-summary.has-7-items,.woocommerce-summary.has-8-items{grid-template-columns:repeat(4,1fr)}.woocommerce-summary.has-4-items .woocommerce-summary__item-container:nth-of-type(4n) .woocommerce-summary__item,.woocommerce-summary.has-7-items .woocommerce-summary__item-container:nth-of-type(4n) .woocommerce-summary__item,.woocommerce-summary.has-8-items .woocommerce-summary__item-container:nth-of-type(4n) .woocommerce-summary__item{border-left-color:#e0e0e0}.woocommerce-summary.has-4-items .woocommerce-summary__item-container:nth-of-type(4n+1):nth-last-of-type(-n+4) .woocommerce-summary__item,.woocommerce-summary.has-4-items .woocommerce-summary__item-container:nth-of-type(4n+1):nth-last-of-type(-n+4)~.woocommerce-summary__item-container .woocommerce-summary__item,.woocommerce-summary.has-7-items .woocommerce-summary__item-container:nth-of-type(4n+1):nth-last-of-type(-n+4) .woocommerce-summary__item,.woocommerce-summary.has-7-items .woocommerce-summary__item-container:nth-of-type(4n+1):nth-last-of-type(-n+4)~.woocommerce-summary__item-container .woocommerce-summary__item,.woocommerce-summary.has-8-items .woocommerce-summary__item-container:nth-of-type(4n+1):nth-last-of-type(-n+4) .woocommerce-summary__item,.woocommerce-summary.has-8-items .woocommerce-summary__item-container:nth-of-type(4n+1):nth-last-of-type(-n+4)~.woocommerce-summary__item-container .woocommerce-summary__item{border-bottom-color:#e0e0e0}.woocommerce-summary.has-5-items{grid-template-columns:repeat(5,1fr)}.woocommerce-summary.has-5-items .woocommerce-summary__item-container:nth-of-type(5n) .woocommerce-summary__item{border-left-color:#e0e0e0}.woocommerce-summary.has-5-items .woocommerce-summary__item-container:nth-of-type(5n+1):nth-last-of-type(-n+5) .woocommerce-summary__item,.woocommerce-summary.has-5-items .woocommerce-summary__item-container:nth-of-type(5n+1):nth-last-of-type(-n+5)~.woocommerce-summary__item-container .woocommerce-summary__item{border-bottom-color:#e0e0e0}.woocommerce-summary.has-5-items.is-placeholder .woocommerce-summary__item-prev-label,.woocommerce-summary.has-5-items .woocommerce-summary__item-value .woocommerce-summary__item-prev-label{margin-left:calc(100% - 80px)}@media(min-width:1441px){.woocommerce-summary.has-6-items{grid-template-columns:repeat(6,1fr)}.woocommerce-summary.has-6-items .woocommerce-summary__item-container:nth-of-type(6n) .woocommerce-summary__item{border-left-color:#e0e0e0}.woocommerce-summary.has-6-items .woocommerce-summary__item-container:nth-of-type(6n+1):nth-last-of-type(-n+6) .woocommerce-summary__item,.woocommerce-summary.has-6-items .woocommerce-summary__item-container:nth-of-type(6n+1):nth-last-of-type(-n+6)~.woocommerce-summary__item-container .woocommerce-summary__item{border-bottom-color:#e0e0e0}.woocommerce-summary.has-6-items.is-placeholder .woocommerce-summary__item-prev-label,.woocommerce-summary.has-6-items .woocommerce-summary__item-value .woocommerce-summary__item-prev-label{margin-left:calc(100% - 80px)}.woocommerce-summary.has-9-items,.woocommerce-summary.has-10-items{grid-template-columns:repeat(5,1fr)}.woocommerce-summary.has-9-items .woocommerce-summary__item-container:nth-of-type(5n) .woocommerce-summary__item,.woocommerce-summary.has-10-items .woocommerce-summary__item-container:nth-of-type(5n) .woocommerce-summary__item{border-left-color:#e0e0e0}.woocommerce-summary.has-9-items .woocommerce-summary__item-container:nth-of-type(5n+1):nth-last-of-type(-n+5) .woocommerce-summary__item,.woocommerce-summary.has-9-items .woocommerce-summary__item-container:nth-of-type(5n+1):nth-last-of-type(-n+5)~.woocommerce-summary__item-container .woocommerce-summary__item,.woocommerce-summary.has-10-items .woocommerce-summary__item-container:nth-of-type(5n+1):nth-last-of-type(-n+5) .woocommerce-summary__item,.woocommerce-summary.has-10-items .woocommerce-summary__item-container:nth-of-type(5n+1):nth-last-of-type(-n+5)~.woocommerce-summary__item-container .woocommerce-summary__item{border-bottom-color:#e0e0e0}.woocommerce-summary.has-9-items.is-placeholder .woocommerce-summary__item-prev-label,.woocommerce-summary.has-9-items .woocommerce-summary__item-value .woocommerce-summary__item-prev-label,.woocommerce-summary.has-10-items.is-placeholder .woocommerce-summary__item-prev-label,.woocommerce-summary.has-10-items .woocommerce-summary__item-value .woocommerce-summary__item-prev-label{margin-left:calc(100% - 80px)}}@media(max-width:1440px){.woocommerce-summary.has-4-items.is-placeholder .woocommerce-summary__item-prev-label,.woocommerce-summary.has-4-items .woocommerce-summary__item-value .woocommerce-summary__item-prev-label,.woocommerce-summary.has-7-items.is-placeholder .woocommerce-summary__item-prev-label,.woocommerce-summary.has-7-items .woocommerce-summary__item-value .woocommerce-summary__item-prev-label,.woocommerce-summary.has-8-items.is-placeholder .woocommerce-summary__item-prev-label,.woocommerce-summary.has-8-items .woocommerce-summary__item-value .woocommerce-summary__item-prev-label{margin-left:calc(100% - 80px)}.woocommerce-summary.has-6-items,.woocommerce-summary.has-9-items{grid-template-columns:repeat(3,1fr)}.woocommerce-summary.has-6-items .woocommerce-summary__item-container:nth-of-type(3n) .woocommerce-summary__item,.woocommerce-summary.has-9-items .woocommerce-summary__item-container:nth-of-type(3n) .woocommerce-summary__item{border-left-color:#e0e0e0}.woocommerce-summary.has-6-items .woocommerce-summary__item-container:nth-of-type(3n+1):nth-last-of-type(-n+3) .woocommerce-summary__item,.woocommerce-summary.has-6-items .woocommerce-summary__item-container:nth-of-type(3n+1):nth-last-of-type(-n+3)~.woocommerce-summary__item-container .woocommerce-summary__item,.woocommerce-summary.has-9-items .woocommerce-summary__item-container:nth-of-type(3n+1):nth-last-of-type(-n+3) .woocommerce-summary__item,.woocommerce-summary.has-9-items .woocommerce-summary__item-container:nth-of-type(3n+1):nth-last-of-type(-n+3)~.woocommerce-summary__item-container .woocommerce-summary__item{border-bottom-color:#e0e0e0}.woocommerce-summary.has-10-items{grid-template-columns:repeat(4,1fr)}.woocommerce-summary.has-10-items .woocommerce-summary__item-container:nth-of-type(4n) .woocommerce-summary__item{border-left-color:#e0e0e0}.woocommerce-summary.has-10-items .woocommerce-summary__item-container:nth-of-type(4n+1):nth-last-of-type(-n+4) .woocommerce-summary__item,.woocommerce-summary.has-10-items .woocommerce-summary__item-container:nth-of-type(4n+1):nth-last-of-type(-n+4)~.woocommerce-summary__item-container .woocommerce-summary__item{border-bottom-color:#e0e0e0}.woocommerce-summary.has-10-items.is-placeholder .woocommerce-summary__item-prev-label,.woocommerce-summary.has-10-items .woocommerce-summary__item-value .woocommerce-summary__item-prev-label{margin-left:calc(100% - 80px)}.woocommerce-summary.has-9-items .woocommerce-summary__item-container:nth-of-type(5n) .woocommerce-summary__item,.woocommerce-summary.has-10-items .woocommerce-summary__item-container:nth-of-type(5n) .woocommerce-summary__item{border-left-color:#e0e0e0}}@media(max-width:960px){.woocommerce-summary .woocommerce-summary__item{border-left-color:#e0e0e0}}@media(max-width:782px){.woocommerce-summary .woocommerce-summary__item-container{margin-right:-16px;margin-left:-16px;width:auto}.woocommerce-summary .woocommerce-summary__item-container .woocommerce-summary__item{border-left:none}.woocommerce-summary .components-popover.components-popover{margin-right:-16px;margin-left:-16px}.woocommerce-summary .components-popover.components-popover .woocommerce-summary__item-container{margin-right:0;margin-left:0}}.woocommerce-summary__item-container{margin-bottom:0}.woocommerce-summary__item-container:last-of-type .woocommerce-summary__item{border-bottom-color:#e0e0e0!important}.woocommerce-summary__item-container.is-dropdown-button{padding:0;list-style:none;border-left:1px solid #e0e0e0}.woocommerce-summary__item-container.is-dropdown-button .components-button{border-bottom:1px solid #e0e0e0;text-align:right;display:block}@media(max-width:782px){.woocommerce-summary__item-container.is-dropdown-button{border-left:none}}.woocommerce-summary__item-container.is-placeholder .woocommerce-summary__item{height:117px}.woocommerce-summary__item-container.is-placeholder .woocommerce-summary__item-label{animation:loading-fade 1.6s ease-in-out infinite;background-color:#f0f0f0;color:transparent;display:inline-block;height:20px;margin-top:2.2px;max-width:110px;width:70%}.woocommerce-summary__item-container.is-placeholder .woocommerce-summary__item-label:after{content:" "}@media screen and (prefers-reduced-motion:reduce){.woocommerce-summary__item-container.is-placeholder .woocommerce-summary__item-label{animation:none}}.woocommerce-summary__item-container.is-placeholder .woocommerce-summary__item-data{justify-content:space-between}.woocommerce-summary__item-container.is-placeholder .woocommerce-summary__item-value{animation:loading-fade 1.6s ease-in-out infinite;background-color:#f0f0f0;color:transparent;display:inline-block;height:28px;width:60px;max-width:60px}.woocommerce-summary__item-container.is-placeholder .woocommerce-summary__item-value:after{content:" "}@media screen and (prefers-reduced-motion:reduce){.woocommerce-summary__item-container.is-placeholder .woocommerce-summary__item-value{animation:none}}.woocommerce-summary__item-container.is-placeholder .woocommerce-summary__item-delta{animation:loading-fade 1.6s ease-in-out infinite;background-color:#f0f0f0;color:transparent;width:60px;border-radius:2px}.woocommerce-summary__item-container.is-placeholder .woocommerce-summary__item-delta:after{content:" "}@media screen and (prefers-reduced-motion:reduce){.woocommerce-summary__item-container.is-placeholder .woocommerce-summary__item-delta{animation:none}}.woocommerce-summary__item{display:flex;flex-direction:column;height:100%;padding:24px;background-color:#f8f9fa;border-bottom:1px solid #e0e0e0;border-left:1px solid #e0e0e0;line-height:1.4em;text-decoration:none;color:#1e1e1e}.woocommerce-summary__item.components-button{height:auto;padding:16px;align-items:normal}.woocommerce-summary__item:hover{background-color:#f0f0f0}.woocommerce-summary__item:hover,.woocommerce-summary__item:hover .woocommerce-summary__item-label{color:#007cba;color:var(--wp-admin-theme-color)}.woocommerce-summary__item:active{background-color:#f0f0f0}.woocommerce-summary__item:focus{box-shadow:inset 1px 1px 0 #757575,inset -1px -1px 0 #757575!important}.woocommerce-summary__item.is-selected:focus{box-shadow:inset 1px -1px 0 #757575,inset -1px 0 0 #757575,inset 0 4px 0 #007cba!important;box-shadow:inset 1px -1px 0 #757575,inset -1px 0 0 #757575,inset 0 4px 0 var(--wp-admin-theme-color)!important}.is-dropdown-button .woocommerce-summary__item{position:relative;width:100%;padding-left:56px}@media(max-width:782px){.is-dropdown-button .woocommerce-summary__item{border-left:none}}.woocommerce-summary__item .woocommerce-summary__item-data{display:flex;justify-content:space-between}.woocommerce-summary__item .woocommerce-summary__item-label{display:block;margin-bottom:16px;color:#757575}.woocommerce-summary__item .woocommerce-summary__item-value{margin-bottom:4px;font-weight:500;color:#1e1e1e}.woocommerce-summary__item .woocommerce-summary__item-delta{padding:5px;border-radius:3px;height:min-content;background-color:#f0f0f0;color:#1e1e1e}.woocommerce-summary__item.is-selected{background:#fff;box-shadow:inset 0 4px 0 #007cba;box-shadow:inset 0 4px 0 var(--wp-admin-theme-color)}.woocommerce-summary__item.is-selected .woocommerce-summary__item-value{font-weight:600}.woocommerce-summary__item.is-selected .woocommerce-summary__item-delta{font-weight:400}.woocommerce-summary__item.is-good-trend .woocommerce-summary__item-delta{background-color:#4ab866;color:#fff}.woocommerce-summary__item.is-bad-trend .woocommerce-summary__item-delta{background-color:#d94f4f;color:#fff}.woocommerce-summary__item .woocommerce-summary__toggle{position:absolute;top:44px;left:16px;transition:transform .2s ease}@media screen and (prefers-reduced-motion:reduce){.woocommerce-summary__item .woocommerce-summary__toggle{transition:none}}.is-dropdown-expanded .woocommerce-summary__item .woocommerce-summary__toggle{transform:rotate(180deg)}.components-popover__content .woocommerce-summary__item .woocommerce-summary__item-delta,.components-popover__content .woocommerce-summary__item .woocommerce-summary__item-label,.components-popover__content .woocommerce-summary__item .woocommerce-summary__item-value{margin-bottom:0}.woocommerce-table{margin-bottom:40px}.woocommerce-table .woocommerce-table__actions{display:inline-flex;justify-content:flex-end;align-items:center}.woocommerce-table .woocommerce-table__actions>*{margin-left:16px}.woocommerce-table .woocommerce-table__actions>:last-child{margin-left:0}.woocommerce-table .woocommerce-table__actions>div{width:100%}.woocommerce-table .components-card__footer{flex-direction:column}.woocommerce-table .components-card__footer>*{padding-left:0}.woocommerce-table.is-empty{align-items:center;background:#f0f0f0;color:#757575;display:flex;height:calc(17px + 1.1375rem + (33px + 1.1375rem)*var(--number-of-rows));justify-content:center;padding:16px;text-align:center}.woocommerce-table .woocommerce-pagination{margin-bottom:16px;z-index:1;background:#fff;position:relative}.woocommerce-table .components-card__header{align-items:center;text-align:right;display:grid;width:100%;grid-template-columns:auto 1fr auto}@media(max-width:960px){.woocommerce-table.has-search .woocommerce-table__actions{grid-gap:12px;grid-template-columns:auto 1fr;grid-row-start:2;grid-row-end:2;grid-column-start:1;grid-column-end:4;margin:0}}.woocommerce-table .woocommerce-search .woocommerce-select-control__control{height:38px}.woocommerce-table .woocommerce-compare-button{padding:3px 12px;height:auto}.woocommerce-table .woocommerce-ellipsis-menu{justify-content:flex-end;display:flex}.woocommerce-table__caption{font-size:24px;font-size:1.5rem;text-align:right}.components-card__body{position:relative}.woocommerce-table__table{overflow-x:auto}.woocommerce-table__table:after,.woocommerce-table__table:before{content:"";position:absolute;top:0;width:60px;height:100%;opacity:0;pointer-events:none;transition:opacity .3s;z-index:1}.woocommerce-table__table:after{left:0;background:linear-gradient(-90deg,hsla(0,0%,100%,0),#fff)}.woocommerce-table__table:before{right:0;background:linear-gradient(-90deg,#fff,hsla(0,0%,100%,0))}.woocommerce-table__table.is-scrollable-left:before,.woocommerce-table__table.is-scrollable-right:after{opacity:1}.woocommerce-table__table table{border-collapse:collapse;width:100%}.woocommerce-table__table tr:focus-within,.woocommerce-table__table tr:hover{background-color:#e0e0e0}.woocommerce-table__table tr:focus-within td,.woocommerce-table__table tr:focus-within th,.woocommerce-table__table tr:hover td,.woocommerce-table__table tr:hover th{background:transparent}.woocommerce-table__empty-item,.woocommerce-table__header,.woocommerce-table__item{padding:16px 24px}.woocommerce-table__header,.woocommerce-table__item{font-size:13px;font-size:.8125rem;text-align:right;border-bottom:1px solid #e2e4e7}.woocommerce-table__header>a:only-child,.woocommerce-table__item>a:only-child{display:block}.woocommerce-table__header a:focus,.woocommerce-table__header a:hover,.woocommerce-table__item a:focus,.woocommerce-table__item a:hover{color:#533582}.woocommerce-table__header .is-placeholder,.woocommerce-table__item .is-placeholder{animation:loading-fade 1.6s ease-in-out infinite;background-color:#f0f0f0;color:transparent;display:inline-block;height:16px;max-width:120px;width:80%}.woocommerce-table__header .is-placeholder:after,.woocommerce-table__item .is-placeholder:after{content:" "}@media screen and (prefers-reduced-motion:reduce){.woocommerce-table__header .is-placeholder,.woocommerce-table__item .is-placeholder{animation:none}}.woocommerce-table__header:not(.is-left-aligned),.woocommerce-table__item:not(.is-left-aligned){text-align:left}.woocommerce-table__header:not(.is-left-aligned) button,.woocommerce-table__item:not(.is-left-aligned) button{justify-content:flex-end;padding-left:24px;padding-right:24px}.woocommerce-table__header.is-numeric .is-placeholder,.woocommerce-table__item.is-numeric .is-placeholder{max-width:40px}.woocommerce-table__header .is-negative,.woocommerce-table__item .is-negative{color:#d94f4f;font-weight:700}.woocommerce-table__header.is-sorted,.woocommerce-table__item.is-sorted{background-color:#f0f0f0}.woocommerce-table__header.is-checkbox-column,.woocommerce-table__item.is-checkbox-column{width:33px;max-width:33px;padding-left:0;padding-right:16px}.woocommerce-table__header.is-checkbox-column+th,.woocommerce-table__item.is-checkbox-column+th{border-right:0}.woocommerce-table tr:last-child .woocommerce-table__item{border-bottom:0}.woocommerce-table__empty-item{text-align:center;font-size:18px;font-size:1.125rem;color:#757575;font-weight:700}@media(max-width:782px){.woocommerce-table__empty-item{font-size:13px;font-size:.8125rem}}th.woocommerce-table__item{font-weight:400}.woocommerce-table__header{padding:8px 24px;background-color:#f8f9fa;font-weight:700;white-space:nowrap}.woocommerce-table__header.is-left-aligned.is-sortable{padding-right:16px}.woocommerce-table__header.is-left-aligned.is-sortable svg{display:inline-flex;order:1;margin-right:0}.woocommerce-table__header .components-button.is-button{height:auto;width:100%;padding:8px 0 8px 24px;vertical-align:middle;line-height:1;border:none;background:transparent!important;box-shadow:none!important;align-items:center}.woocommerce-table__header .components-button.is-button:active,.woocommerce-table__header .components-button.is-button:hover{box-shadow:none!important}.woocommerce-table__header.is-sortable{padding:0}.woocommerce-table__header.is-sortable svg{visibility:hidden;margin-right:4px}.woocommerce-table__header.is-sortable .components-button:focus svg,.woocommerce-table__header.is-sortable .components-button:hover svg,.woocommerce-table__header.is-sortable.is-sorted .components-button svg{visibility:visible}.woocommerce-table__summary{text-align:center;margin:0}.woocommerce-table__summary-item{display:inline-block;margin-bottom:0;margin-right:8px;margin-left:8px}.woocommerce-table__summary-item .is-placeholder{animation:loading-fade 1.6s ease-in-out infinite;background-color:#f0f0f0;color:transparent;display:inline-block;height:16px;width:200px}.woocommerce-table__summary-item .is-placeholder:after{content:" "}@media screen and (prefers-reduced-motion:reduce){.woocommerce-table__summary-item .is-placeholder{animation:none}}.woocommerce-table__summary-item .woocommerce-table__summary-label,.woocommerce-table__summary-item .woocommerce-table__summary-value{display:inline-block}.woocommerce-table__summary-item .woocommerce-table__summary-label{margin-right:4px}.woocommerce-table__summary-item .woocommerce-table__summary-value{font-weight:600}.woocommerce-tag{display:inline-flex;margin:1px 0 1px 4px;overflow:hidden;vertical-align:middle}.woocommerce-tag .woocommerce-tag__remove,.woocommerce-tag .woocommerce-tag__text{display:inline-block;line-height:24px;background:#f0f0f0;transition:all .2s cubic-bezier(.4,1,.4,1)}.woocommerce-tag .woocommerce-tag__text{align-self:center;padding:0 8px;border-radius:12px;color:#757575;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.woocommerce-tag.has-remove .woocommerce-tag__text{padding:0 8px 0 4px;border-radius:0 12px 12px 0}.woocommerce-tag .woocommerce-tag__remove{cursor:pointer;height:inherit;padding:0 2px;border-radius:12px 0 0 12px;color:#757575;line-height:10px;text-indent:0;height:24px}.woocommerce-tag .woocommerce-tag__remove:hover{color:#1e1e1e}.muriel-input-text{background:#fff;border:1px solid #a7aaad;border-radius:3px;height:56px;box-shadow:none;padding:12px 12px 4px;position:relative;box-shadow:0 2px 6px rgba(0,0,0,.05)}.muriel-input-text:hover{border-color:#787c82}.muriel-input-text label{color:#646970;font-size:14px;line-height:21px}.muriel-input-text label.components-base-control__label{margin:0}.muriel-input-text .components-text-control__input,.muriel-input-text .components-text-control__input[type=color],.muriel-input-text .components-text-control__input[type=date],.muriel-input-text .components-text-control__input[type=datetime-local],.muriel-input-text .components-text-control__input[type=datetime],.muriel-input-text .components-text-control__input[type=email],.muriel-input-text .components-text-control__input[type=month],.muriel-input-text .components-text-control__input[type=number],.muriel-input-text .components-text-control__input[type=password],.muriel-input-text .components-text-control__input[type=tel],.muriel-input-text .components-text-control__input[type=text],.muriel-input-text .components-text-control__input[type=time],.muriel-input-text .components-text-control__input[type=url],.muriel-input-text .components-text-control__input[type=week]{border:0;box-shadow:none;font-size:16px;line-height:21px;margin:0;padding:0;min-height:30px}.muriel-input-text .components-text-control__input:focus,.muriel-input-text .components-text-control__input[type=color]:focus,.muriel-input-text .components-text-control__input[type=date]:focus,.muriel-input-text .components-text-control__input[type=datetime-local]:focus,.muriel-input-text .components-text-control__input[type=datetime]:focus,.muriel-input-text .components-text-control__input[type=email]:focus,.muriel-input-text .components-text-control__input[type=month]:focus,.muriel-input-text .components-text-control__input[type=number]:focus,.muriel-input-text .components-text-control__input[type=password]:focus,.muriel-input-text .components-text-control__input[type=tel]:focus,.muriel-input-text .components-text-control__input[type=text]:focus,.muriel-input-text .components-text-control__input[type=time]:focus,.muriel-input-text .components-text-control__input[type=url]:focus,.muriel-input-text .components-text-control__input[type=week]:focus{box-shadow:none}.muriel-input-text.active{box-shadow:0 0 0 2px #007cba;box-shadow:0 0 0 2px var(--wp-admin-theme-color);border-color:transparent}.muriel-input-text.active input{color:#2c3338}.muriel-input-text.with-value .components-base-control__label{display:block;position:relative;top:-8px;width:100%;font-size:12px}.muriel-input-text.with-value input{color:#2c3338;position:relative;top:-12px}.muriel-input-text.empty label{display:none}.muriel-input-text.empty input{color:#646970}.muriel-input-text.has-error{box-shadow:none}.muriel-input-text.disabled label{display:none}.muriel-input-text.disabled input{color:#a7aaad}.muriel-input-text.disabled input::placeholder{color:#a7aaad;opacity:1}.muriel-input-text.disabled input:-ms-input-placeholder{color:#a7aaad}.muriel-input-text.disabled input::-ms-input-placeholder{color:#a7aaad}.text-control-with-affixes{display:inline-flex;flex-direction:row;width:100%}.text-control-with-affixes input[type=email],.text-control-with-affixes input[type=number],.text-control-with-affixes input[type=password],.text-control-with-affixes input[type=text],.text-control-with-affixes input[type=url]{flex-grow:1;margin:0}.text-control-with-affixes input[type=email]:disabled,.text-control-with-affixes input[type=number]:disabled,.text-control-with-affixes input[type=password]:disabled,.text-control-with-affixes input[type=text]:disabled,.text-control-with-affixes input[type=url]:disabled{border-left-width:0}.text-control-with-affixes input[type=email]:disabled+.text-control-with-affixes__suffix,.text-control-with-affixes input[type=number]:disabled+.text-control-with-affixes__suffix,.text-control-with-affixes input[type=password]:disabled+.text-control-with-affixes__suffix,.text-control-with-affixes input[type=text]:disabled+.text-control-with-affixes__suffix,.text-control-with-affixes input[type=url]:disabled+.text-control-with-affixes__suffix{border-right:1px solid #f0f0f0}.text-control-with-affixes.text-control-with-prefix input{border-top-right-radius:0;border-bottom-right-radius:0}.text-control-with-affixes.text-control-with-suffix input{border-top-left-radius:0;border-bottom-left-radius:0}.text-control-with-affixes__prefix,.text-control-with-affixes__suffix{position:relative;background:#fff;border:1px solid #757575;color:#757575;padding:7px 14px;white-space:nowrap;flex:1 0 auto;font-size:14px;line-height:1.5}.disabled .text-control-with-affixes__prefix,.disabled .text-control-with-affixes__suffix{background:hsla(0,0%,100%,.5);border-color:hsla(0,0%,87.1%,.75);box-shadow:inset 0 1px 2px rgba(0,0,0,.04);color:rgba(51,51,51,.5)}.text-control-with-affixes__prefix{border-left:none;border-radius:0 4px 4px 0}.text-control-with-affixes__prefix+input[type=email]:disabled,.text-control-with-affixes__prefix+input[type=number]:disabled,.text-control-with-affixes__prefix+input[type=password]:disabled,.text-control-with-affixes__prefix+input[type=text]:disabled,.text-control-with-affixes__prefix+input[type=url]:disabled{border-right-color:#f0f0f0}.text-control-with-affixes__suffix{border-right:none;border-radius:4px 0 0 4px}.woocommerce-timeline ul{margin:0;padding-right:0;list-style-type:none}.woocommerce-timeline ul li{margin-bottom:0}.woocommerce-timeline .woocommerce-timeline-group .woocommerce-timeline-group__title{color:#1d2327;font-size:12px;font-weight:600;text-transform:uppercase;margin:0 0 16px;display:inline-block}.woocommerce-timeline .woocommerce-timeline-group hr{float:left;width:calc(100% - 40px);margin-bottom:16px;border:.5px solid #e3dfe2}.woocommerce-timeline .woocommerce-timeline-item .woocommerce-timeline-item__top-border{min-height:16px;border-right:1px solid #c3c4c7;margin:0 12px}.woocommerce-timeline .woocommerce-timeline-item .woocommerce-timeline-item__title{display:flex;align-items:center;flex-direction:row;justify-content:space-between;color:#2c3338}.woocommerce-timeline .woocommerce-timeline-item .woocommerce-timeline-item__title *{font-size:16px}.woocommerce-timeline .woocommerce-timeline-item .woocommerce-timeline-item__headline{display:flex;align-items:center;flex-direction:row;margin:8px 0}.woocommerce-timeline .woocommerce-timeline-item .woocommerce-timeline-item__headline *{margin:0}.woocommerce-timeline .woocommerce-timeline-item .woocommerce-timeline-item__headline>*{padding:0 16px}.woocommerce-timeline .woocommerce-timeline-item .woocommerce-timeline-item__headline svg{fill:#fff;padding:4px;background:#c3c4c7;border-radius:9999px;box-sizing:content-box;width:16px;height:16px}.woocommerce-timeline .woocommerce-timeline-item .woocommerce-timeline-item__headline svg.is-success{background:#4ab866}.woocommerce-timeline .woocommerce-timeline-item .woocommerce-timeline-item__headline svg.is-warning{background:#ffb900}.woocommerce-timeline .woocommerce-timeline-item .woocommerce-timeline-item__headline svg.is-error{background:#d94f4f}.woocommerce-timeline .woocommerce-timeline-item .woocommerce-timeline-item__timestamp{font-size:14px;line-height:16px}.woocommerce-timeline .woocommerce-timeline-item .woocommerce-timeline-item__body{display:flex;flex-direction:column;color:#50575e;margin:0 12px;padding:8px 36px;border-right:1px solid #c3c4c7}.woocommerce-timeline .woocommerce-timeline-item .woocommerce-timeline-item__body *{margin:0;font-size:14px}.woocommerce-timeline ul :last-child.woocommerce-timeline-group hr:last-child{display:none}.woocommerce-view-more-list{padding-right:4px;margin:0 4px 0 0;vertical-align:middle}.woocommerce-view-more-list__popover{margin:0;padding:16px;text-align:right}.woocommerce-view-more-list__popover__item{display:block;margin:16px 0}.woocommerce-view-more-list__popover__item:first-child{margin-top:0}.woocommerce-view-more-list__popover__item:last-child{margin-bottom:0}.woocommerce-web-preview{width:100%;display:flex;align-items:center;justify-content:center;background:#f6f7f7}.woocommerce-web-preview.is-loading .woocommerce-web-preview__iframe-wrapper{display:none}.woocommerce-web-preview .woocommerce-web-preview__iframe-wrapper{width:100%}.woocommerce-web-preview iframe{width:100%;height:100%;min-height:400px}.woocommerce-badge{background-color:#f0f0f0;border-radius:20px;display:inline-block;text-align:center;font-style:normal;font-weight:600;font-size:14px;line-height:27px;align-items:center;width:32px;height:28px}.woocommerce-component_dynamic-form .components-base-control{margin-top:16px;margin-bottom:16px;position:relative}.woocommerce-component_dynamic-form .components-base-control.has-error .components-base-control__help{right:0!important}woocommerce-admin/dist/components/index.asset.php000064400000000611151335517650016250 0ustar00<?php return array('dependencies' => array('lodash', 'moment', 'react', 'react-dom', 'wc-currency', 'wc-date', 'wc-navigation', 'wc-store-data', 'wp-api-fetch', 'wp-components', 'wp-compose', 'wp-data', 'wp-date', 'wp-deprecated', 'wp-dom', 'wp-element', 'wp-html-entities', 'wp-i18n', 'wp-keycodes', 'wp-primitives', 'wp-url', 'wp-viewport'), 'version' => 'a1fceacf677e4fa8bac4dd89559b9947');woocommerce-admin/dist/analytics-report-customers/style-rtl.css000064400000004374151335517650021132 0ustar00:root{--wp-admin-theme-color:#007cba;--wp-admin-theme-color-darker-10:#006ba1;--wp-admin-theme-color-darker-20:#005a87}body.admin-color-light{--wp-admin-theme-color:#0085ba;--wp-admin-theme-color-darker-10:#0073a1;--wp-admin-theme-color-darker-20:#006187}body.admin-color-modern{--wp-admin-theme-color:#3858e9;--wp-admin-theme-color-darker-10:#2145e6;--wp-admin-theme-color-darker-20:#183ad6}body.admin-color-blue{--wp-admin-theme-color:#096484;--wp-admin-theme-color-darker-10:#07526c;--wp-admin-theme-color-darker-20:#064054}body.admin-color-coffee{--wp-admin-theme-color:#46403c;--wp-admin-theme-color-darker-10:#383330;--wp-admin-theme-color-darker-20:#2b2724}body.admin-color-ectoplasm{--wp-admin-theme-color:#523f6d;--wp-admin-theme-color-darker-10:#46365d;--wp-admin-theme-color-darker-20:#3a2c4d}body.admin-color-midnight{--wp-admin-theme-color:#e14d43;--wp-admin-theme-color-darker-10:#dd382d;--wp-admin-theme-color-darker-20:#d02c21}body.admin-color-ocean{--wp-admin-theme-color:#627c83;--wp-admin-theme-color-darker-10:#576e74;--wp-admin-theme-color-darker-20:#4c6066}body.admin-color-sunrise{--wp-admin-theme-color:#dd823b;--wp-admin-theme-color-darker-10:#d97426;--wp-admin-theme-color-darker-20:#c36922}.woocommerce-report-table__scroll-point{position:relative;top:-48px}@media(max-width:782px){.woocommerce-report-table__scroll-point{top:-62px}}.woocommerce-feature-enabled-activity-panels .woocommerce-report-table__scroll-point{top:-108px}@media(max-width:782px){.woocommerce-feature-enabled-activity-panels .woocommerce-report-table__scroll-point{top:-122px}}.woocommerce-report-table .woocommerce-search{flex-grow:1}.woocommerce-report-table .components-card__header{display:grid;grid-gap:12px;grid-template-columns:min-content 1fr min-content}.woocommerce-report-table .woocommerce-table__compare.components-button{padding:8px}.woocommerce-report-table .woocommerce-ellipsis-menu{justify-self:flex-end}button.woocommerce-table__download-button{padding:6px 12px;color:#000;text-decoration:none;align-items:center}button.woocommerce-table__download-button svg{margin-left:8px;height:24px;width:24px}@media(max-width:782px){button.woocommerce-table__download-button svg{margin-left:0}button.woocommerce-table__download-button .woocommerce-table__download-button__label{display:none}}woocommerce-admin/dist/date/index.js000064400000046257151335517650013527 0ustar00this.wc=this.wc||{},this.wc.date=function(e){var t={};function r(o){if(t[o])return t[o].exports;var n=t[o]={i:o,l:!1,exports:{}};return e[o].call(n.exports,n,n.exports,r),n.l=!0,n.exports}return r.m=e,r.c=t,r.d=function(e,t,o){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(r.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)r.d(o,n,function(t){return e[t]}.bind(null,n));return o},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=444)}({2:function(e,t){e.exports=window.wp.i18n},32:function(e,t,r){"use strict";var o=r(67),n=r(68),a=r(39);e.exports={formats:a,parse:n,stringify:o}},39:function(e,t,r){"use strict";var o=String.prototype.replace,n=/%20/g,a="RFC1738",i="RFC3986";e.exports={default:i,formatters:{RFC1738:function(e){return o.call(e,n,"+")},RFC3986:function(e){return String(e)}},RFC1738:a,RFC3986:i}},4:function(e,t){e.exports=window.lodash},444:function(e,t,r){"use strict";r.r(t),r.d(t,"isoDateFormat",(function(){return s})),r.d(t,"defaultDateTimeFormat",(function(){return u})),r.d(t,"presetValues",(function(){return l})),r.d(t,"periods",(function(){return d})),r.d(t,"appendTimestamp",(function(){return f})),r.d(t,"toMoment",(function(){return m})),r.d(t,"getRangeLabel",(function(){return p})),r.d(t,"getStoreTimeZoneMoment",(function(){return y})),r.d(t,"getLastPeriod",(function(){return b})),r.d(t,"getCurrentPeriod",(function(){return h})),r.d(t,"getDateParamsFromQuery",(function(){return g})),r.d(t,"getCurrentDates",(function(){return j})),r.d(t,"getDateDifferenceInDays",(function(){return _})),r.d(t,"getPreviousDate",(function(){return k})),r.d(t,"getAllowedIntervalsForQuery",(function(){return S})),r.d(t,"getIntervalForQuery",(function(){return Y})),r.d(t,"getChartTypeForQuery",(function(){return D})),r.d(t,"dayTicksThreshold",(function(){return x})),r.d(t,"weekTicksThreshold",(function(){return M})),r.d(t,"defaultTableDateFormat",(function(){return L})),r.d(t,"getDateFormatsForInterval",(function(){return E})),r.d(t,"loadLocaleData",(function(){return P})),r.d(t,"dateValidationMessages",(function(){return N})),r.d(t,"validateDateInputForRange",(function(){return T}));var o=r(9),n=r.n(o),a=r(4),i=r(2),c=r(32);const s="YYYY-MM-DD",u="YYYY-MM-DDTHH:mm:ss",l=[{value:"today",label:Object(i.__)("Today",'woocommerce')},{value:"yesterday",label:Object(i.__)("Yesterday",'woocommerce')},{value:"week",label:Object(i.__)("Week to date",'woocommerce')},{value:"last_week",label:Object(i.__)("Last week",'woocommerce')},{value:"month",label:Object(i.__)("Month to date",'woocommerce')},{value:"last_month",label:Object(i.__)("Last month",'woocommerce')},{value:"quarter",label:Object(i.__)("Quarter to date",'woocommerce')},{value:"last_quarter",label:Object(i.__)("Last quarter",'woocommerce')},{value:"year",label:Object(i.__)("Year to date",'woocommerce')},{value:"last_year",label:Object(i.__)("Last year",'woocommerce')},{value:"custom",label:Object(i.__)("Custom",'woocommerce')}],d=[{value:"previous_period",label:Object(i.__)("Previous period",'woocommerce')},{value:"previous_year",label:Object(i.__)("Previous year",'woocommerce')}],f=(e,t)=>{if("start"===t)return e.startOf("day").format(u);if("now"===t)return e.format(u);if("end"===t)return e.endOf("day").format(u);throw new Error("appendTimestamp requires second parameter to be either `start`, `now` or `end`")};function m(e,t){if(n.a.isMoment(t))return t.isValid()?t:null;if("string"==typeof t){const r=n()(t,[s,e],!0);return r.isValid()?r:null}throw new Error("toMoment requires a string to be passed as an argument")}function p(e,t){const r=e.year()===t.year(),o=r&&e.month()===t.month(),n=r&&o&&e.isSame(t,"day"),a=Object(i.__)("MMM D, YYYY",'woocommerce');if(n)return e.format(a);if(o){const r=e.date();return e.format(a).replace(r,`${r} - ${t.date()}`)}if(r){const r=Object(i.__)("MMM D",'woocommerce');return`${e.format(r)} - ${t.format(a)}`}return`${e.format(a)} - ${t.format(a)}`}function y(){return window.wcSettings&&window.wcSettings.timeZone?["+","-"].includes(window.wcSettings.timeZone.charAt(0))?n()().utcOffset(window.wcSettings.timeZone):n()().tz(window.wcSettings.timeZone):n()()}function b(e,t){const r=y().startOf(e).subtract(1,e),o=r.clone().endOf(e);let a,i;if("previous_period"===t)if("year"===e)a=n()().startOf(e).subtract(2,e),i=a.clone().endOf(e);else{const e=o.diff(r,"days");i=r.clone().subtract(1,"days"),a=i.clone().subtract(e,"days")}else"week"===e?(a=r.clone().subtract(1,"years"),i=o.clone().subtract(1,"years")):(a=r.clone().subtract(1,"years"),i=a.clone().endOf(e));return"month"===e&&(i=i.clone().endOf("month")),{primaryStart:r,primaryEnd:o,secondaryStart:a,secondaryEnd:i}}function h(e,t){const r=y().startOf(e),o=y(),n=o.diff(r,"days");let a,i;return"previous_period"===t?(a=r.clone().subtract(1,e),i=o.clone().subtract(1,e)):(a=r.clone().subtract(1,"years"),i=a.clone().add(n+1,"days").subtract(1,"seconds")),{primaryStart:r,primaryEnd:o,secondaryStart:a,secondaryEnd:i}}const w=Object(a.memoize)((e,t,r,o)=>{switch(e){case"today":return h("day",t);case"yesterday":return b("day",t);case"week":return h("week",t);case"last_week":return b("week",t);case"month":return h("month",t);case"last_month":return b("month",t);case"quarter":return h("quarter",t);case"last_quarter":return b("quarter",t);case"year":return h("year",t);case"last_year":return b("year",t);case"custom":const e=o.diff(r,"days");if("previous_period"===t){const t=r.clone().subtract(1,"days");return{primaryStart:r,primaryEnd:o,secondaryStart:t.clone().subtract(e,"days"),secondaryEnd:t}}return{primaryStart:r,primaryEnd:o,secondaryStart:r.clone().subtract(1,"years"),secondaryEnd:o.clone().subtract(1,"years")}}},(e,t,r,o)=>[e,t,r&&r.format(),o&&o.format()].join(":")),v=Object(a.memoize)((e,t,r,o,a)=>{if(e&&t)return{period:e,compare:t,after:r?n()(r):null,before:o?n()(o):null};const i=Object(c.parse)(a.replace(/&amp;/g,"&"));return{period:i.period,compare:i.compare,after:i.after?n()(i.after):null,before:i.before?n()(i.before):null}},(e,t,r,o,n)=>[e,t,r,o,n].join(":")),g=(e,t="period=month&compare=previous_year")=>{const{period:r,compare:o,after:n,before:a}=e;return v(r,o,n,a,t)},O=Object(a.memoize)((e,t,r,o,n,i)=>({primary:{label:Object(a.find)(l,t=>t.value===e).label,range:p(r,o),after:r,before:o},secondary:{label:Object(a.find)(d,e=>e.value===t).label,range:p(n,i),after:n,before:i}}),(e,t,r,o,n,a)=>[e,t,r&&r.format(),o&&o.format(),n&&n.format(),a&&a.format()].join(":")),j=(e,t="period=month&compare=previous_year")=>{const{period:r,compare:o,after:n,before:a}=g(e,t),{primaryStart:i,primaryEnd:c,secondaryStart:s,secondaryEnd:u}=w(r,o,n,a);return O(r,o,i,c,s,u)},_=(e,t)=>{const r=n()(e),o=n()(t);return r.diff(o,"days")},k=(e,t,r,o,a)=>{const i=n()(e);if("previous_year"===o)return i.clone().subtract(1,"years");const c=n()(t),s=n()(r),u=c.diff(s,a);return i.clone().subtract(u,a)};function S(e){let t=[];if("custom"===e.period){const{primary:r}=j(e),o=_(r.before,r.after);t=o>=365?["day","week","month","quarter","year"]:o>=90?["day","week","month","quarter"]:o>=28?["day","week","month"]:o>=7?["day","week"]:o>1&&o<7?["day"]:["hour","day"]}else switch(e.period){case"today":case"yesterday":t=["hour","day"];break;case"week":case"last_week":t=["day"];break;case"month":case"last_month":t=["day","week"];break;case"quarter":case"last_quarter":t=["day","week","month"];break;case"year":case"last_year":t=["day","week","month","quarter"];break;default:t=["day"]}return t}function Y(e){const t=S(e),r=t[0];let o=e.interval||r;return e.interval&&!t.includes(e.interval)&&(o=r),o}function D({chartType:e}){return["line","bar"].includes(e)?e:"line"}const x=63,M=9,L="m/d/Y";function E(e,t=0){let r="%B %-d, %Y",o="%B %-d, %Y",n="%Y-%m-%d",a="%b %Y",c=L;switch(e){case"hour":r="%_I%p %B %-d, %Y",o="%_I%p %b %-d, %Y",n="%_I%p",a="%b %-d, %Y",c="h A";break;case"day":t<x?n="%-d":(n="%b",a="%Y");break;case"week":t<M?(n="%-d",a="%b %Y"):(n="%b",a="%Y"),r=Object(i.__)("Week of %B %-d, %Y",'woocommerce'),o=Object(i.__)("Week of %B %-d, %Y",'woocommerce');break;case"quarter":case"month":r="%B %Y",o="%B %Y",n="%b",a="%Y";break;case"year":r="%Y",o="%Y",n="%Y"}return{screenReaderFormat:r,tooltipLabelFormat:o,xFormat:n,x2Format:a,tableFormat:c}}function P({userLocale:e,weekdaysShort:t}){"en"!==n.a.locale()&&n.a.updateLocale(e,{longDateFormat:{L:Object(i.__)("MM/DD/YYYY",'woocommerce'),LL:Object(i.__)("MMMM D, YYYY",'woocommerce'),LLL:Object(i.__)("D MMMM YYYY LT",'woocommerce'),LLLL:Object(i.__)("dddd, D MMMM YYYY LT",'woocommerce'),LT:Object(i.__)("HH:mm",'woocommerce')},weekdaysMin:t})}const N={invalid:Object(i.__)("Invalid date",'woocommerce'),future:Object(i.__)("Select a date in the past",'woocommerce'),startAfterEnd:Object(i.__)("Start date must be before end date",'woocommerce'),endBeforeStart:Object(i.__)("Start date must be before end date",'woocommerce')};function T(e,t,r,o,a){const i=m(a,t);return i?n()().isBefore(i,"day")?{date:null,error:N.future}:"after"===e&&r&&i.isAfter(r,"day")?{date:null,error:N.startAfterEnd}:"before"===e&&o&&i.isBefore(o,"day")?{date:null,error:N.endBeforeStart}:{date:i}:{date:null,error:N.invalid}}},49:function(e,t,r){"use strict";var o=r(39),n=Object.prototype.hasOwnProperty,a=Array.isArray,i=function(){for(var e=[],t=0;t<256;++t)e.push("%"+((t<16?"0":"")+t.toString(16)).toUpperCase());return e}(),c=function(e,t){for(var r=t&&t.plainObjects?Object.create(null):{},o=0;o<e.length;++o)void 0!==e[o]&&(r[o]=e[o]);return r};e.exports={arrayToObject:c,assign:function(e,t){return Object.keys(t).reduce((function(e,r){return e[r]=t[r],e}),e)},combine:function(e,t){return[].concat(e,t)},compact:function(e){for(var t=[{obj:{o:e},prop:"o"}],r=[],o=0;o<t.length;++o)for(var n=t[o],i=n.obj[n.prop],c=Object.keys(i),s=0;s<c.length;++s){var u=c[s],l=i[u];"object"==typeof l&&null!==l&&-1===r.indexOf(l)&&(t.push({obj:i,prop:u}),r.push(l))}return function(e){for(;e.length>1;){var t=e.pop(),r=t.obj[t.prop];if(a(r)){for(var o=[],n=0;n<r.length;++n)void 0!==r[n]&&o.push(r[n]);t.obj[t.prop]=o}}}(t),e},decode:function(e,t,r){var o=e.replace(/\+/g," ");if("iso-8859-1"===r)return o.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(o)}catch(e){return o}},encode:function(e,t,r,n,a){if(0===e.length)return e;var c=e;if("symbol"==typeof e?c=Symbol.prototype.toString.call(e):"string"!=typeof e&&(c=String(e)),"iso-8859-1"===r)return escape(c).replace(/%u[0-9a-f]{4}/gi,(function(e){return"%26%23"+parseInt(e.slice(2),16)+"%3B"}));for(var s="",u=0;u<c.length;++u){var l=c.charCodeAt(u);45===l||46===l||95===l||126===l||l>=48&&l<=57||l>=65&&l<=90||l>=97&&l<=122||a===o.RFC1738&&(40===l||41===l)?s+=c.charAt(u):l<128?s+=i[l]:l<2048?s+=i[192|l>>6]+i[128|63&l]:l<55296||l>=57344?s+=i[224|l>>12]+i[128|l>>6&63]+i[128|63&l]:(u+=1,l=65536+((1023&l)<<10|1023&c.charCodeAt(u)),s+=i[240|l>>18]+i[128|l>>12&63]+i[128|l>>6&63]+i[128|63&l])}return s},isBuffer:function(e){return!(!e||"object"!=typeof e)&&!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))},isRegExp:function(e){return"[object RegExp]"===Object.prototype.toString.call(e)},maybeMap:function(e,t){if(a(e)){for(var r=[],o=0;o<e.length;o+=1)r.push(t(e[o]));return r}return t(e)},merge:function e(t,r,o){if(!r)return t;if("object"!=typeof r){if(a(t))t.push(r);else{if(!t||"object"!=typeof t)return[t,r];(o&&(o.plainObjects||o.allowPrototypes)||!n.call(Object.prototype,r))&&(t[r]=!0)}return t}if(!t||"object"!=typeof t)return[t].concat(r);var i=t;return a(t)&&!a(r)&&(i=c(t,o)),a(t)&&a(r)?(r.forEach((function(r,a){if(n.call(t,a)){var i=t[a];i&&"object"==typeof i&&r&&"object"==typeof r?t[a]=e(i,r,o):t.push(r)}else t[a]=r})),t):Object.keys(r).reduce((function(t,a){var i=r[a];return n.call(t,a)?t[a]=e(t[a],i,o):t[a]=i,t}),i)}}},67:function(e,t,r){"use strict";var o=r(49),n=r(39),a=Object.prototype.hasOwnProperty,i={brackets:function(e){return e+"[]"},comma:"comma",indices:function(e,t){return e+"["+t+"]"},repeat:function(e){return e}},c=Array.isArray,s=Array.prototype.push,u=function(e,t){s.apply(e,c(t)?t:[t])},l=Date.prototype.toISOString,d=n.default,f={addQueryPrefix:!1,allowDots:!1,charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encoder:o.encode,encodeValuesOnly:!1,format:d,formatter:n.formatters[d],indices:!1,serializeDate:function(e){return l.call(e)},skipNulls:!1,strictNullHandling:!1},m=function e(t,r,n,a,i,s,l,d,m,p,y,b,h,w){var v,g=t;if("function"==typeof l?g=l(r,g):g instanceof Date?g=p(g):"comma"===n&&c(g)&&(g=o.maybeMap(g,(function(e){return e instanceof Date?p(e):e}))),null===g){if(a)return s&&!h?s(r,f.encoder,w,"key",y):r;g=""}if("string"==typeof(v=g)||"number"==typeof v||"boolean"==typeof v||"symbol"==typeof v||"bigint"==typeof v||o.isBuffer(g))return s?[b(h?r:s(r,f.encoder,w,"key",y))+"="+b(s(g,f.encoder,w,"value",y))]:[b(r)+"="+b(String(g))];var O,j=[];if(void 0===g)return j;if("comma"===n&&c(g))O=[{value:g.length>0?g.join(",")||null:void 0}];else if(c(l))O=l;else{var _=Object.keys(g);O=d?_.sort(d):_}for(var k=0;k<O.length;++k){var S=O[k],Y="object"==typeof S&&void 0!==S.value?S.value:g[S];if(!i||null!==Y){var D=c(g)?"function"==typeof n?n(r,S):r:r+(m?"."+S:"["+S+"]");u(j,e(Y,D,n,a,i,s,l,d,m,p,y,b,h,w))}}return j};e.exports=function(e,t){var r,o=e,s=function(e){if(!e)return f;if(null!==e.encoder&&void 0!==e.encoder&&"function"!=typeof e.encoder)throw new TypeError("Encoder has to be a function.");var t=e.charset||f.charset;if(void 0!==e.charset&&"utf-8"!==e.charset&&"iso-8859-1"!==e.charset)throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var r=n.default;if(void 0!==e.format){if(!a.call(n.formatters,e.format))throw new TypeError("Unknown format option provided.");r=e.format}var o=n.formatters[r],i=f.filter;return("function"==typeof e.filter||c(e.filter))&&(i=e.filter),{addQueryPrefix:"boolean"==typeof e.addQueryPrefix?e.addQueryPrefix:f.addQueryPrefix,allowDots:void 0===e.allowDots?f.allowDots:!!e.allowDots,charset:t,charsetSentinel:"boolean"==typeof e.charsetSentinel?e.charsetSentinel:f.charsetSentinel,delimiter:void 0===e.delimiter?f.delimiter:e.delimiter,encode:"boolean"==typeof e.encode?e.encode:f.encode,encoder:"function"==typeof e.encoder?e.encoder:f.encoder,encodeValuesOnly:"boolean"==typeof e.encodeValuesOnly?e.encodeValuesOnly:f.encodeValuesOnly,filter:i,format:r,formatter:o,serializeDate:"function"==typeof e.serializeDate?e.serializeDate:f.serializeDate,skipNulls:"boolean"==typeof e.skipNulls?e.skipNulls:f.skipNulls,sort:"function"==typeof e.sort?e.sort:null,strictNullHandling:"boolean"==typeof e.strictNullHandling?e.strictNullHandling:f.strictNullHandling}}(t);"function"==typeof s.filter?o=(0,s.filter)("",o):c(s.filter)&&(r=s.filter);var l,d=[];if("object"!=typeof o||null===o)return"";l=t&&t.arrayFormat in i?t.arrayFormat:t&&"indices"in t?t.indices?"indices":"repeat":"indices";var p=i[l];r||(r=Object.keys(o)),s.sort&&r.sort(s.sort);for(var y=0;y<r.length;++y){var b=r[y];s.skipNulls&&null===o[b]||u(d,m(o[b],b,p,s.strictNullHandling,s.skipNulls,s.encode?s.encoder:null,s.filter,s.sort,s.allowDots,s.serializeDate,s.format,s.formatter,s.encodeValuesOnly,s.charset))}var h=d.join(s.delimiter),w=!0===s.addQueryPrefix?"?":"";return s.charsetSentinel&&("iso-8859-1"===s.charset?w+="utf8=%26%2310003%3B&":w+="utf8=%E2%9C%93&"),h.length>0?w+h:""}},68:function(e,t,r){"use strict";var o=r(49),n=Object.prototype.hasOwnProperty,a=Array.isArray,i={allowDots:!1,allowPrototypes:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decoder:o.decode,delimiter:"&",depth:5,ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictNullHandling:!1},c=function(e){return e.replace(/&#(\d+);/g,(function(e,t){return String.fromCharCode(parseInt(t,10))}))},s=function(e,t){return e&&"string"==typeof e&&t.comma&&e.indexOf(",")>-1?e.split(","):e},u=function(e,t,r,o){if(e){var a=r.allowDots?e.replace(/\.([^.[]+)/g,"[$1]"):e,i=/(\[[^[\]]*])/g,c=r.depth>0&&/(\[[^[\]]*])/.exec(a),u=c?a.slice(0,c.index):a,l=[];if(u){if(!r.plainObjects&&n.call(Object.prototype,u)&&!r.allowPrototypes)return;l.push(u)}for(var d=0;r.depth>0&&null!==(c=i.exec(a))&&d<r.depth;){if(d+=1,!r.plainObjects&&n.call(Object.prototype,c[1].slice(1,-1))&&!r.allowPrototypes)return;l.push(c[1])}return c&&l.push("["+a.slice(c.index)+"]"),function(e,t,r,o){for(var n=o?t:s(t,r),a=e.length-1;a>=0;--a){var i,c=e[a];if("[]"===c&&r.parseArrays)i=[].concat(n);else{i=r.plainObjects?Object.create(null):{};var u="["===c.charAt(0)&&"]"===c.charAt(c.length-1)?c.slice(1,-1):c,l=parseInt(u,10);r.parseArrays||""!==u?!isNaN(l)&&c!==u&&String(l)===u&&l>=0&&r.parseArrays&&l<=r.arrayLimit?(i=[])[l]=n:i[u]=n:i={0:n}}n=i}return n}(l,t,r,o)}};e.exports=function(e,t){var r=function(e){if(!e)return i;if(null!==e.decoder&&void 0!==e.decoder&&"function"!=typeof e.decoder)throw new TypeError("Decoder has to be a function.");if(void 0!==e.charset&&"utf-8"!==e.charset&&"iso-8859-1"!==e.charset)throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var t=void 0===e.charset?i.charset:e.charset;return{allowDots:void 0===e.allowDots?i.allowDots:!!e.allowDots,allowPrototypes:"boolean"==typeof e.allowPrototypes?e.allowPrototypes:i.allowPrototypes,arrayLimit:"number"==typeof e.arrayLimit?e.arrayLimit:i.arrayLimit,charset:t,charsetSentinel:"boolean"==typeof e.charsetSentinel?e.charsetSentinel:i.charsetSentinel,comma:"boolean"==typeof e.comma?e.comma:i.comma,decoder:"function"==typeof e.decoder?e.decoder:i.decoder,delimiter:"string"==typeof e.delimiter||o.isRegExp(e.delimiter)?e.delimiter:i.delimiter,depth:"number"==typeof e.depth||!1===e.depth?+e.depth:i.depth,ignoreQueryPrefix:!0===e.ignoreQueryPrefix,interpretNumericEntities:"boolean"==typeof e.interpretNumericEntities?e.interpretNumericEntities:i.interpretNumericEntities,parameterLimit:"number"==typeof e.parameterLimit?e.parameterLimit:i.parameterLimit,parseArrays:!1!==e.parseArrays,plainObjects:"boolean"==typeof e.plainObjects?e.plainObjects:i.plainObjects,strictNullHandling:"boolean"==typeof e.strictNullHandling?e.strictNullHandling:i.strictNullHandling}}(t);if(""===e||null==e)return r.plainObjects?Object.create(null):{};for(var l="string"==typeof e?function(e,t){var r,u={},l=t.ignoreQueryPrefix?e.replace(/^\?/,""):e,d=t.parameterLimit===1/0?void 0:t.parameterLimit,f=l.split(t.delimiter,d),m=-1,p=t.charset;if(t.charsetSentinel)for(r=0;r<f.length;++r)0===f[r].indexOf("utf8=")&&("utf8=%E2%9C%93"===f[r]?p="utf-8":"utf8=%26%2310003%3B"===f[r]&&(p="iso-8859-1"),m=r,r=f.length);for(r=0;r<f.length;++r)if(r!==m){var y,b,h=f[r],w=h.indexOf("]="),v=-1===w?h.indexOf("="):w+1;-1===v?(y=t.decoder(h,i.decoder,p,"key"),b=t.strictNullHandling?null:""):(y=t.decoder(h.slice(0,v),i.decoder,p,"key"),b=o.maybeMap(s(h.slice(v+1),t),(function(e){return t.decoder(e,i.decoder,p,"value")}))),b&&t.interpretNumericEntities&&"iso-8859-1"===p&&(b=c(b)),h.indexOf("[]=")>-1&&(b=a(b)?[b]:b),n.call(u,y)?u[y]=o.combine(u[y],b):u[y]=b}return u}(e,r):e,d=r.plainObjects?Object.create(null):{},f=Object.keys(l),m=0;m<f.length;++m){var p=f[m],y=u(p,l[p],r,"string"==typeof e);d=o.merge(d,y,r)}return o.compact(d)}},9:function(e,t){e.exports=window.moment}});woocommerce-admin/dist/date/index.asset.php000064400000000174151335517650015004 0ustar00<?php return array('dependencies' => array('lodash', 'moment', 'wp-i18n'), 'version' => '7a03d21f11c22ca9f88598d837b11ec9');woocommerce-admin/dist/activity-panels-inbox/style-rtl.css000064400000026402151335517650020035 0ustar00.woocommerce-layout__activity-panel-content .woocommerce-inbox-message,.woocommerce-layout__activity-panel-content .woocommerce-notification-panels>div{margin-top:24px}.woocommerce-layout__activity-panel-content .woocommerce-abbreviated-notifications{border-top:1px solid #e0e0e0}.woocommerce-layout__activity-panel-content .woocommerce-abbreviated-notifications>div{border:none;margin-bottom:0}.woocommerce-layout__activity-panel-content .woocommerce-abbreviated-notifications .woocommerce-abbreviated-notification h3{color:#007cba;color:var(--wp-admin-theme-color);font-weight:700;font-size:14px}.woocommerce-layout__activity-panel-content .woocommerce-abbreviated-notifications .woocommerce-abbreviated-notification div,.woocommerce-layout__activity-panel-content .woocommerce-abbreviated-notifications .woocommerce-abbreviated-notification p{color:#757575}.woocommerce-layout__activity-panel-content .woocommerce-abbreviated-notifications .woocommerce-abbreviated-notification .woocommerce-abbreviated-card__content{padding:12px 0 12px 24px}.woocommerce-layout__activity-panel-content .woocommerce-abbreviated-notifications .woocommerce-abbreviated-notification .woocommerce-abbreviated-card__content>:not(:first-child){margin-top:4px}.woocommerce-activity-panel .woocommerce-activity-card{position:relative;padding:24px;padding:var(--main-gap);background:#fff;border-bottom:1px solid #e0e0e0;color:#757575;font-size:13px;font-size:.8125rem}.woocommerce-activity-panel .woocommerce-activity-card:not(.woocommerce-empty-activity-card){display:grid;grid-template-columns:50px 1fr;grid-template-areas:"icon header" "icon body" "icon actions"}.woocommerce-activity-panel .woocommerce-activity-card__button{display:block;height:unset;background:none;align-items:unset;transition:unset;text-align:right;width:100%;padding:0}.woocommerce-activity-card__unread{position:absolute;top:18px;top:calc(var(--main-gap) - 6px);left:18px;left:calc(var(--main-gap) - 6px);width:6px;height:6px;border-radius:50%;background:#ca4a1f}.woocommerce-activity-card__icon{-ms-grid-row:1;-ms-grid-row-span:3;-ms-grid-column:1;grid-area:icon;fill:#e0e0e0}.woocommerce-activity-card__header{margin-bottom:16px;display:flex;flex-direction:column}.woocommerce-activity-card__header .woocommerce-activity-card__title{margin:0;font-size:14px;font-size:.875rem;order:2}.woocommerce-empty-activity-card .woocommerce-activity-card__header .woocommerce-activity-card__title{color:#1e1e1e;font-style:normal;line-height:24px;font-weight:400}.woocommerce-activity-card__button .woocommerce-activity-card__header .woocommerce-activity-card__title{margin-bottom:8px}.woocommerce-activity-card__header .woocommerce-activity-card__title a{text-decoration:none}.woocommerce-activity-card__header .woocommerce-activity-card__date{color:#757575;font-size:12px;font-size:.75rem;margin-bottom:12px;order:1}.woocommerce-activity-card__header .woocommerce-activity-card__subtitle{order:3}.woocommerce-activity-card__button .woocommerce-activity-card__header .woocommerce-activity-card__subtitle{margin-bottom:4px}@media(min-width:783px){.woocommerce-activity-card__header{-ms-grid-row:1;-ms-grid-column:2;grid-area:header;display:grid;grid-template:"title date" "subtitle date"/1fr auto}.woocommerce-activity-panel .woocommerce-activity-card.woocommerce-order-activity-card>.woocommerce-activity-card__header{-ms-grid-row:1;-ms-grid-column:1}.woocommerce-activity-card__header .woocommerce-activity-card__title{grid-area:title}.woocommerce-activity-card__header .woocommerce-activity-card__date{display:block;grid-area:date;justify-self:end;margin-bottom:0}.woocommerce-activity-card__header .woocommerce-activity-card__subtitle{grid-area:subtitle}}@media (min-width:783px){.woocommerce-activity-card__header .woocommerce-activity-card__title{-ms-grid-row:1;-ms-grid-column:1}.woocommerce-activity-card__header .woocommerce-activity-card__date{-ms-grid-row:1;-ms-grid-row-span:2;-ms-grid-column:2}.woocommerce-activity-card__header .woocommerce-activity-card__subtitle{-ms-grid-row:2;-ms-grid-column:1}}.woocommerce-activity-card__body{-ms-grid-row:2;-ms-grid-column:2;grid-area:body}.woocommerce-activity-panel .woocommerce-activity-card.woocommerce-order-activity-card>.woocommerce-activity-card__body{-ms-grid-row:2;-ms-grid-column:1}.woocommerce-activity-card__body>p:first-child{margin-top:0}.woocommerce-activity-card__body>p:last-child{margin-bottom:0}.woocommerce-empty-activity-card .woocommerce-activity-card__body{color:#757575;font-style:normal;font-weight:400;font-size:13px;font-size:.8125rem;line-height:20px}.woocommerce-activity-card__actions{-ms-grid-row:3;-ms-grid-column:2;grid-area:actions;margin-top:16px}.woocommerce-activity-panel .woocommerce-activity-card.woocommerce-order-activity-card>.woocommerce-activity-card__actions{-ms-grid-row:3;-ms-grid-column:1}.woocommerce-activity-card__actions>*+*{margin-right:.5em}.woocommerce-activity-card__actions .components-button{height:24px;padding:4px 10px;font-size:11px;font-size:.6875rem}.woocommerce-activity-card__actions .components-button.is-destructive:not(:hover){box-shadow:none}.woocommerce-activity-card.is-loading .is-placeholder{animation:loading-fade 1.6s ease-in-out infinite;background-color:#f0f0f0;color:transparent;display:inline-block;height:16px}.woocommerce-activity-card.is-loading .is-placeholder:after{content:" "}@media screen and (prefers-reduced-motion:reduce){.woocommerce-activity-card.is-loading .is-placeholder{animation:none}}.woocommerce-activity-card.is-loading .woocommerce-activity-card__title{width:80%}.woocommerce-activity-card.is-loading .woocommerce-activity-card__subtitle{margin-top:4px}.woocommerce-activity-card.is-loading .woocommerce-activity-card__date{width:100%;margin-bottom:16px}@media(min-width:783px){.woocommerce-activity-card.is-loading .woocommerce-activity-card__date{text-align:left;margin-bottom:0}}.woocommerce-activity-card.is-loading .woocommerce-activity-card__date .is-placeholder{width:68px}.woocommerce-activity-card.is-loading .woocommerce-activity-card__icon{margin-left:24px;margin-left:var(--main-gap)}.woocommerce-activity-card.is-loading .woocommerce-activity-card__icon .is-placeholder{height:33px;width:33px}.woocommerce-activity-card.is-loading .woocommerce-activity-card__body .is-placeholder{width:100%;margin-bottom:4px}.woocommerce-activity-card.is-loading .woocommerce-activity-card__body .is-placeholder:last-of-type{width:65%;margin-bottom:0}.woocommerce-activity-card.is-loading .woocommerce-activity-card__actions .is-placeholder{width:91px;height:24px}.woocommerce-activity-panel .woocommerce-activity-card.woocommerce-order-activity-card{grid-template-columns:1fr;grid-template-areas:"header" "body" "actions"}.woocommerce-activity-panel .woocommerce-activity-card.woocommerce-order-activity-card .woocommerce-activity-card__icon{display:none}.woocommerce-activity-panel .woocommerce-activity-card.woocommerce-order-activity-card .woocommerce-flag{display:inline-block}.woocommerce-activity-panel .woocommerce-activity-card.woocommerce-order-activity-card .woocommerce-activity-card__subtitle span+span:before{content:" • "}.woocommerce-activity-panel .woocommerce-activity-card.woocommerce-inbox-activity-card{grid-template-columns:72px 1fr;height:100%;opacity:1;padding:24px;padding:var(--main-gap)}@media screen and (prefers-reduced-motion:no-preference){.woocommerce-activity-panel .woocommerce-activity-card.woocommerce-inbox-activity-card{transition:opacity .3s,height 0s,padding 0s}}@media(max-width:782px){.woocommerce-activity-panel .woocommerce-activity-card.woocommerce-inbox-activity-card{grid-template-columns:64px 1fr}}.woocommerce-activity-panel .woocommerce-activity-card.woocommerce-inbox-activity-card .woocommerce-activity-card__header{margin-bottom:12px}.woocommerce-activity-panel .woocommerce-activity-card.woocommerce-inbox-activity-card.actioned{height:0;opacity:0;padding:0}@media screen and (prefers-reduced-motion:no-preference){.woocommerce-activity-panel .woocommerce-activity-card.woocommerce-inbox-activity-card.actioned{transition:opacity .3s,height 0s .3s,padding 0s .3s}}.woocommerce-stock-activity-card__image-overlay__product{height:33px;position:relative;width:33px}.woocommerce-stock-activity-card__image-overlay__product.is-placeholder:before{background-color:#757575;border-radius:2px;content:"";position:absolute;right:0;left:0;bottom:0;top:0;opacity:.1}@media screen and (prefers-reduced-motion:no-preference){.woocommerce-stock-activity-card{transition:opacity .3s}}.woocommerce-stock-activity-card.is-dimmed{opacity:.7}.woocommerce-stock-activity-card .woocommerce-stock-activity-card__stock-quantity{background:#f0f0f0;color:#757575;padding:3px 8px;border-radius:3px}.woocommerce-stock-activity-card .woocommerce-stock-activity-card__stock-quantity.out-of-stock{color:#d94f4f}.woocommerce-stock-activity-card .woocommerce-stock-activity-card__edit-quantity{display:inline-flex;width:50px;margin-left:10px}.woocommerce-stock-activity-card .woocommerce-stock-activity-card__edit-quantity input{border-radius:2px;height:30px}.woocommerce-stock-activity-card .woocommerce-stock-activity-card__edit-quantity input[type=number]{-moz-appearance:textfield}.woocommerce-stock-activity-card .woocommerce-stock-activity-card__edit-quantity input[type=number]::-webkit-inner-spin-button,.woocommerce-stock-activity-card .woocommerce-stock-activity-card__edit-quantity input[type=number]::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}.woocommerce-stock-activity-card .woocommerce-activity-card__subtitle{color:#757575;font-size:12px;font-size:.75rem}.woocommerce-empty-activity-card{background:#f0f0f0;margin:20px;border-bottom:unset}:root{--wp-admin-theme-color:#007cba;--wp-admin-theme-color-darker-10:#006ba1;--wp-admin-theme-color-darker-20:#005a87}body.admin-color-light{--wp-admin-theme-color:#0085ba;--wp-admin-theme-color-darker-10:#0073a1;--wp-admin-theme-color-darker-20:#006187}body.admin-color-modern{--wp-admin-theme-color:#3858e9;--wp-admin-theme-color-darker-10:#2145e6;--wp-admin-theme-color-darker-20:#183ad6}body.admin-color-blue{--wp-admin-theme-color:#096484;--wp-admin-theme-color-darker-10:#07526c;--wp-admin-theme-color-darker-20:#064054}body.admin-color-coffee{--wp-admin-theme-color:#46403c;--wp-admin-theme-color-darker-10:#383330;--wp-admin-theme-color-darker-20:#2b2724}body.admin-color-ectoplasm{--wp-admin-theme-color:#523f6d;--wp-admin-theme-color-darker-10:#46365d;--wp-admin-theme-color-darker-20:#3a2c4d}body.admin-color-midnight{--wp-admin-theme-color:#e14d43;--wp-admin-theme-color-darker-10:#dd382d;--wp-admin-theme-color-darker-20:#d02c21}body.admin-color-ocean{--wp-admin-theme-color:#627c83;--wp-admin-theme-color-darker-10:#576e74;--wp-admin-theme-color-darker-20:#4c6066}body.admin-color-sunrise{--wp-admin-theme-color:#dd823b;--wp-admin-theme-color-darker-10:#d97426;--wp-admin-theme-color-darker-20:#c36922}#activity-panel-inbox{margin:0 24px}.woocommerce-layout__inbox-panel-header{padding:24px}.woocommerce-homepage-column .woocommerce-layout__inbox-panel-header{padding:0 24px}.woocommerce-inbox-message-enter{opacity:0;max-height:0;transform:translateX(-50%)}.woocommerce-inbox-message-enter-active{transition:opacity .5s,transform .5s,max-height .5s}.woocommerce-inbox-message-enter-active,.woocommerce-inbox-message-exit{opacity:1;max-height:100vh;transform:translateX(0)}.woocommerce-inbox-message-exit-active{opacity:0;max-height:0;transform:translateX(-50%);transition:opacity .5s,transform .5s,max-height .5s}woocommerce-admin/dist/payment-method-promotions/style-rtl.css000064400000004011151335517650020736 0ustar00:root{--wp-admin-theme-color:#007cba;--wp-admin-theme-color-darker-10:#006ba1;--wp-admin-theme-color-darker-20:#005a87}body.admin-color-light{--wp-admin-theme-color:#0085ba;--wp-admin-theme-color-darker-10:#0073a1;--wp-admin-theme-color-darker-20:#006187}body.admin-color-modern{--wp-admin-theme-color:#3858e9;--wp-admin-theme-color-darker-10:#2145e6;--wp-admin-theme-color-darker-20:#183ad6}body.admin-color-blue{--wp-admin-theme-color:#096484;--wp-admin-theme-color-darker-10:#07526c;--wp-admin-theme-color-darker-20:#064054}body.admin-color-coffee{--wp-admin-theme-color:#46403c;--wp-admin-theme-color-darker-10:#383330;--wp-admin-theme-color-darker-20:#2b2724}body.admin-color-ectoplasm{--wp-admin-theme-color:#523f6d;--wp-admin-theme-color-darker-10:#46365d;--wp-admin-theme-color-darker-20:#3a2c4d}body.admin-color-midnight{--wp-admin-theme-color:#e14d43;--wp-admin-theme-color-darker-10:#dd382d;--wp-admin-theme-color-darker-20:#d02c21}body.admin-color-ocean{--wp-admin-theme-color:#627c83;--wp-admin-theme-color-darker-10:#576e74;--wp-admin-theme-color-darker-20:#4c6066}body.admin-color-sunrise{--wp-admin-theme-color:#dd823b;--wp-admin-theme-color-darker-10:#d97426;--wp-admin-theme-color-darker-20:#c36922}[data-gateway_id=pre_install_woocommerce_payments_promotion]>.status a{visibility:hidden!important}[data-gateway_id=pre_install_woocommerce_payments_promotion]>.action .is-secondary,[data-gateway_id=pre_install_woocommerce_payments_promotion]>.action.is-secondary:hover{box-shadow:none}[data-gateway_id=pre_install_woocommerce_payments_promotion]>.action a{position:relative;display:none}.wc_gateways .name .wc-payment-gateway-method-name{display:inline-flex}.wc_gateways .name .wc-payment-gateway-method-name img{height:24px;width:auto;margin-right:4px}.wc_gateways .wc-payment-gateway-method_name{display:flex}.wc_gateways .wc-payment-gateway-method_name .pre-install-payment-gateway_subtitle{margin-right:16px}.wc_gateways .wc-payment-gateway-method_name .pre-install-payment-gateway_subtitle>img{height:24px;width:auto;margin-right:4px}woocommerce-admin/dist/payment-method-promotions/style.css000064400000004006151335517650020143 0ustar00:root{--wp-admin-theme-color:#007cba;--wp-admin-theme-color-darker-10:#006ba1;--wp-admin-theme-color-darker-20:#005a87}body.admin-color-light{--wp-admin-theme-color:#0085ba;--wp-admin-theme-color-darker-10:#0073a1;--wp-admin-theme-color-darker-20:#006187}body.admin-color-modern{--wp-admin-theme-color:#3858e9;--wp-admin-theme-color-darker-10:#2145e6;--wp-admin-theme-color-darker-20:#183ad6}body.admin-color-blue{--wp-admin-theme-color:#096484;--wp-admin-theme-color-darker-10:#07526c;--wp-admin-theme-color-darker-20:#064054}body.admin-color-coffee{--wp-admin-theme-color:#46403c;--wp-admin-theme-color-darker-10:#383330;--wp-admin-theme-color-darker-20:#2b2724}body.admin-color-ectoplasm{--wp-admin-theme-color:#523f6d;--wp-admin-theme-color-darker-10:#46365d;--wp-admin-theme-color-darker-20:#3a2c4d}body.admin-color-midnight{--wp-admin-theme-color:#e14d43;--wp-admin-theme-color-darker-10:#dd382d;--wp-admin-theme-color-darker-20:#d02c21}body.admin-color-ocean{--wp-admin-theme-color:#627c83;--wp-admin-theme-color-darker-10:#576e74;--wp-admin-theme-color-darker-20:#4c6066}body.admin-color-sunrise{--wp-admin-theme-color:#dd823b;--wp-admin-theme-color-darker-10:#d97426;--wp-admin-theme-color-darker-20:#c36922}[data-gateway_id=pre_install_woocommerce_payments_promotion]>.status a{visibility:hidden!important}[data-gateway_id=pre_install_woocommerce_payments_promotion]>.action .is-secondary,[data-gateway_id=pre_install_woocommerce_payments_promotion]>.action.is-secondary:hover{box-shadow:none}[data-gateway_id=pre_install_woocommerce_payments_promotion]>.action a{position:relative;display:none}.wc_gateways .name .wc-payment-gateway-method-name{display:inline-flex}.wc_gateways .name .wc-payment-gateway-method-name img{height:24px;width:auto;margin-left:4px}.wc_gateways .wc-payment-gateway-method_name{display:flex}.wc_gateways .wc-payment-gateway-method_name .pre-install-payment-gateway_subtitle{margin-left:16px}.wc_gateways .wc-payment-gateway-method_name .pre-install-payment-gateway_subtitle>img{height:24px;width:auto;margin-left:4px}woocommerce-admin/dist/app/style-rtl.css000064400000072273151335517650014373 0ustar00.woocommerce-page .wrap{margin:0}.woocommerce-page #wpcontent,.woocommerce-page.woocommerce_page_wc-admin #wpbody-content{padding:0;overflow-x:hidden!important;min-height:calc(100vh - 32px)}@media(min-width:783px){.woocommerce-page #wpbody-content{padding-right:0}}@media(max-width:782px){.woocommerce-page .wp-responsive-open #woocommerce-embedded-root,.woocommerce-page .wp-responsive-open #wpbody{position:relative;left:-14.5em}.woocommerce-page #wpbody-content,.woocommerce-page #wpcontent{min-height:calc(100vh - 46px)}}@media(min-width:961px){.woocommerce-page #toplevel_page_wcadmin--analytics.menu-top>a:focus,.woocommerce-page #toplevel_page_woocommerce.menu-top>a:focus{padding-bottom:1px}}#wpbody,.woocommerce-layout *{box-sizing:border-box}#wpbody{display:inline-block;width:100%;padding-top:0;margin-top:60px}#wpfooter{display:none}.woocommerce_page_wc-admin .woocommerce-filters-date__content:not(.is-mobile){z-index:2}@media(max-width:600px){#wpadminbar{position:fixed}html.wp-toolbar{padding-top:46px}}@media(max-width:782px){.jetpack-masterbar #wpadminbar #wp-admin-bar-menu-toggle{margin-top:-10px}.jetpack-masterbar #wpwrap .woocommerce-layout__header-heading{padding-right:60px}.jetpack-masterbar.wp-admin .wrap h1,.jetpack-masterbar.wp-admin .wrap h2{padding-right:0}}.woocommerce-page .wp-has-current-submenu:after{left:0;content:" ";height:0;width:0;position:absolute;pointer-events:none;border:8px solid transparent;border-left-color:#f1f1f1;top:0;margin-top:10px}@media(max-width:960px){.woocommerce-page .wp-has-current-submenu:after{border-width:4px;margin-top:14px}}:root{--large-gap:40px;--main-gap:24px}@media(max-width:960px){:root{--large-gap:24px}}@media(max-width:782px){:root{--large-gap:16px;--main-gap:16px}}@keyframes loading-fade{0%{opacity:.7}50%{opacity:1}to{opacity:.7}}.woocommerce-layout select:hover{color:#1e1e1e}.woocommerce-layout select.components-select-control__input{max-width:100%;line-height:1}body.woocommerce-page .components-button.is-primary:not(:disabled),body.woocommerce-page .components-snackbar .components-button.is-tertiary,body.woocommerce-page .components-snackbar .components-button.is-tertiary:not(:disabled):not([aria-disabled=true]):hover{color:#fff}.woocommerce-embed-page #wpbody .woocommerce-layout,.woocommerce-embed-page .woocommerce-layout__notice-list-hide+.wrap{padding-top:10px}.woocommerce-embed-page #wpbody-content,.woocommerce-embed-page #wpcontent{overflow-x:initial!important}.woocommerce-embed-page #wpbody-content{padding-top:0}.woocommerce-embed-page #wpbody-content .notice{margin-top:15px}.woocommerce-embed-page .wrap{padding:0 20px}@media(max-width:782px){.woocommerce-embed-page .wrap p.search-box{width:calc(100% - 40px)}}.woocommerce-embed-page .wrap .wrap{padding:0}.woocommerce-embed-page #screen-meta{border-left:0;margin:0}.woocommerce-embed-page #screen-meta-links{position:relative}.woocommerce-embed-page .notice{padding:1px 12px}.woocommerce-embed-page .woocommerce-layout__header.is-scrolled{box-shadow:0 8px 16px 0 rgba(85,93,102,.3)}.woocommerce-embed-page .woocommerce-layout__header .woocommerce-layout__header-heading{margin-top:0;margin-bottom:0}.woocommerce-embed-page #screen-meta-links.is-hidden-by-notices,.woocommerce-embed-page #screen-meta.is-hidden-by-notices{display:none!important}.woocommerce-embed-page .woocommerce-layout__primary{margin:0}@media(max-width:782px){.woocommerce-embed-page .woocommerce-layout__primary{padding-top:10px}}@keyframes isLoaded{0%{opacity:0}to{opacity:1}}.woocommerce-embed-page .woocommerce-layout__activity-panel-tabs{animation:isLoaded;animation-duration:2s}.woocommerce-embed-page .woocommerce-layout__notice-list-show{margin-top:10px;margin-bottom:16px}@media(max-width:600px){.woocommerce-embed-page .woocommerce-layout__notice-list-show{margin-top:80px;margin-bottom:-16px}}@media(min-width:601px)and (max-width:782px){.woocommerce-embed-page .woocommerce-layout__notice-list-show{margin-top:32px}}.woocommerce-embed-page .woocommerce-activity-card__actions a.components-button:not(.is-primary){color:#757575}.woocommerce-layout{margin:0;padding:0}.woocommerce-layout__primary{margin:var(--large-gap) var(--large-gap) 0 0}@media(max-width:782px){.woocommerce-layout__primary{margin-top:20px}}.woocommerce-layout .woocommerce-layout__main{padding-left:40px;padding-left:var(--large-gap);max-width:100%}.woocommerce-admin-is-loading #adminmenumain,.woocommerce-admin-is-loading #wpadminbar,.woocommerce-admin-is-loading #wpbody-content,.woocommerce-admin-is-loading #wpcontent,.woocommerce-admin-is-loading #wpfooter,.woocommerce-admin-is-loading .components-modal__screen-overlay,.woocommerce-admin-is-loading .error,.woocommerce-admin-is-loading .notice,.woocommerce-admin-is-loading .update-nag,.woocommerce-admin-is-loading .updated,.woocommerce-admin-is-loading .woocommerce-layout__header,.woocommerce-admin-is-loading .woocommerce-message,.woocommerce-admin-is-loading .woocommerce-store-alerts,.woocommerce-page .update-nag{display:none}.woocommerce-admin-full-screen{background:#f6f7f7;color:#50575e;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif}.woocommerce-admin-full-screen #wpwrap{top:0}.woocommerce-admin-full-screen #wpbody-content{min-height:100vh!important}.woocommerce-admin-full-screen #adminmenumain,.woocommerce-admin-full-screen #wpcontent>*,.woocommerce-admin-full-screen .error,.woocommerce-admin-full-screen .notice,.woocommerce-admin-full-screen .update-nag,.woocommerce-admin-full-screen .updated,.woocommerce-admin-full-screen .woocommerce-layout__header,.woocommerce-admin-full-screen .woocommerce-message,.woocommerce-admin-full-screen .woocommerce-store-alerts{display:none}.woocommerce-admin-full-screen #wpcontent{margin-right:0!important}.woocommerce-admin-full-screen #wpcontent>#wpbody{display:block;margin-top:0!important}.woocommerce-admin-full-screen.has-woocommerce-navigation #wpbody{padding-right:0}.is-wp-toolbar-disabled #wpadminbar{display:none!important}.wp-toolbar .is-wp-toolbar-disabled{margin-top:-32px}@media(max-width:600px){.wp-toolbar .is-wp-toolbar-disabled{margin-top:-46px}}.woocommerce-onboarding .muriel-component{margin-top:16px;margin-bottom:16px}.woocommerce-onboarding .components-base-control.has-error{margin-bottom:32px!important;border-color:#d63638}@media(max-width:782px){.woocommerce-onboarding .components-base-control.has-error{margin-bottom:44px!important}}.woocommerce-onboarding .components-base-control.has-error .components-base-control__help{top:100%;right:12px;position:absolute;margin-top:4px;font-size:12px;font-style:normal;color:#d63638}.woocommerce-onboarding .components-form-toggle{display:inline-block}.woocommerce-onboarding .components-form-toggle label{font-size:14px}.woocommerce-onboarding .components-form-toggle .components-base-control{display:inline-block}.woocommerce-onboarding .components-form-toggle .components-base-control__field{margin-bottom:0}.woocommerce-page .components-modal__frame .components-button.is-button,.woocommerce-profile-wizard__body .components-button.is-button,.woocommerce-task-dashboard__container .components-button.is-button{height:48px;padding-right:25px;padding-left:25px;text-align:center;font-size:14px;line-height:36px;font-weight:500;align-items:center}.woocommerce-page .components-modal__frame .components-button.is-button:disabled,.woocommerce-profile-wizard__body .components-button.is-button:disabled,.woocommerce-task-dashboard__container .components-button.is-button:disabled{cursor:not-allowed}.components-modal__header .components-button svg+span{display:none}.components-modal__frame.woocommerce-usage-modal{width:600px;max-width:100%}.components-modal__frame.woocommerce-usage-modal .components-modal__header{border-bottom:0;margin-bottom:0}.components-modal__frame.woocommerce-usage-modal .woocommerce-usage-modal__wrapper{flex-grow:1;display:flex;flex-direction:column}.components-modal__frame.woocommerce-usage-modal .woocommerce-usage-modal__wrapper a{color:#50575e}.components-modal__frame.woocommerce-usage-modal .woocommerce-usage-modal__wrapper button.is-primary{align-self:flex-end}.components-modal__frame.woocommerce-usage-modal .woocommerce-usage-modal__actions{display:flex;justify-content:flex-end;margin-top:16px}.components-modal__frame.woocommerce-usage-modal .woocommerce-usage-modal__actions button{margin-right:16px}.woocommerce-payments__usage-modal .components-modal__header{height:auto;padding:24px 24px 0}.woocommerce-payments__usage-modal .components-modal__header .components-modal__header-heading{font-size:24px;line-height:32px;margin:0 0 24px}.woocommerce-payments__usage-modal .woocommerce-payments__usage-modal-message{padding:16px 0;font-size:16px;line-height:24px}.woocommerce-payments__usage-modal .woocommerce-payments__usage-footer{display:flex;justify-content:flex-end;padding:16px 0}.woocommerce-payments__usage-modal .woocommerce-payments__usage-footer button{margin-right:16px}.components-modal__frame.woocommerce-cart-modal{width:600px;max-width:100%}.components-modal__frame.woocommerce-cart-modal .components-modal__header{border-bottom:0;margin-bottom:16px;margin-top:16px}.components-modal__frame.woocommerce-cart-modal .components-modal__header button{display:none}.components-modal__frame.woocommerce-cart-modal .components-modal__header-heading{font-style:normal;font-weight:400;font-size:24px;line-height:32px}.components-modal__frame.woocommerce-cart-modal .woocommerce-list{margin-top:24px}.components-modal__frame.woocommerce-cart-modal .woocommerce-list .woocommerce-list__item:first-child{border-top:1px solid #dcdcde}.components-modal__frame.woocommerce-cart-modal .woocommerce-list__item{border-bottom:1px solid #dcdcde}.components-modal__frame.woocommerce-cart-modal .woocommerce-cart-modal__help-text{font-size:16px;line-height:24px}.components-modal__frame.woocommerce-cart-modal .woocommerce-cart-modal__actions{text-align:left}.components-modal__frame.woocommerce-cart-modal .woocommerce-cart-modal__actions button.is-link{margin-left:16px;text-decoration:none;font-weight:600;font-size:14px}.components-modal__frame.woocommerce-cart-modal .woocommerce-cart-modal__actions button.is-primary{align-self:flex-end}.woocommerce-layout__header{background:#fff;box-sizing:border-box;padding:0;position:fixed;width:calc(100% - 160px);top:32px;z-index:1001}.woocommerce-layout__header.is-scrolled{box-shadow:0 8px 8px 0 rgba(85,93,102,.3)}.woocommerce-layout__header .woocommerce-layout__header-wrapper{display:flex;align-items:center;min-height:60px}.woocommerce-layout__header .woocommerce-layout__header-back-button{cursor:pointer;margin-right:var(--large-gap);display:flex}.woocommerce-layout__header .woocommerce-layout__header-back-button:focus{box-shadow:inset 1px -1px 0 #757575,inset -1px 1px 0 #757575}@media(max-width:782px){.woocommerce-layout__header{flex-flow:row wrap;top:46px;width:100%}}@media(min-width:783px)and (max-width:960px){.woocommerce-layout__header{width:calc(100% - 36px)}}.woocommerce-layout__header .woocommerce-layout__header-breadcrumbs-wrapper{display:flex;justify-content:space-between;flex-direction:row}.woocommerce-layout__header .woocommerce-layout__header-heading{display:flex;align-items:center;padding:0 40px 0 0;padding:0 var(--large-gap) 0 0;flex:1 auto;height:60px;background:#fff;font-weight:600;font-size:14px}.woocommerce-layout__header .woocommerce-layout__header-heading.with-back-button{padding-right:24px}.folded .woocommerce-layout__header{width:calc(100% - 36px)}@media(max-width:782px){.folded .woocommerce-layout__header{width:100%}}.is-wp-toolbar-disabled .woocommerce-layout__header{top:0}.has-woocommerce-navigation .woocommerce-layout__header{right:0;width:100%}.woocommerce-page #contextual-help-link-wrap,.woocommerce-page #screen-options-link-wrap{margin-top:-1px}.wp-responsive-open .woocommerce-layout__header{margin-right:2px}.woocommerce-layout__activity-panel{display:flex;flex-direction:row;align-items:center;height:60px}.woocommerce-layout__activity-panel-tabs{width:100%;display:flex;height:60px;justify-content:flex-end}.woocommerce-layout__activity-panel-tabs .dashicon,.woocommerce-layout__activity-panel-tabs .gridicon{width:100%}.woocommerce-layout__activity-panel-tabs svg{width:24px;height:24px}.woocommerce-layout__activity-panel-tabs svg.woocommerce-layout__activity-panel-tab-icon{fill:none}.woocommerce-layout__activity-panel-tabs svg.woocommerce-layout__activity-panel-tab-icon path,.woocommerce-layout__activity-panel-tabs svg.woocommerce-layout__activity-panel-tab-icon rect{stroke:currentColor}.woocommerce-layout__activity-panel-tabs svg.setup-progress path:first-child{stroke:"#DCDCDE"}.woocommerce-layout__activity-panel-tabs .woocommerce-layout__homescreen-display-options svg.woocommerce-layout__activity-panel-tab-icon{height:14px}.woocommerce-layout__activity-panel-tabs .woocommerce-layout__homescreen-extension-tasklist-toggle{min-width:205px}.woocommerce-layout__activity-panel-tabs .components-icon-button{display:initial;text-indent:0;border-radius:0}.woocommerce-layout__activity-panel-tabs .components-icon-button.has-text svg{margin:0}.woocommerce-layout__activity-panel-tabs .woocommerce-layout__activity-panel-tab{display:flex;flex-direction:column;justify-content:center;align-items:center;position:relative;border:none;outline:none;cursor:pointer;background-color:#fff;max-width:min-content;min-width:80px;width:100%;height:60px;color:#757575;white-space:nowrap}.woocommerce-layout__activity-panel-tabs .woocommerce-layout__activity-panel-tab:before{background-color:#007cba;background-color:var(--wp-admin-theme-color);bottom:0;content:"";height:0;opacity:0;transition-property:height,opacity;transition-duration:.3s;transition-timing-function:ease-in-out;right:0;position:absolute;left:0}.woocommerce-layout__activity-panel-tabs .woocommerce-layout__activity-panel-tab.is-active,.woocommerce-layout__activity-panel-tabs .woocommerce-layout__activity-panel-tab.is-opened{color:#1e1e1e;box-shadow:none}.woocommerce-layout__activity-panel-tabs .woocommerce-layout__activity-panel-tab.is-active:before,.woocommerce-layout__activity-panel-tabs .woocommerce-layout__activity-panel-tab.is-opened:before{height:3px;opacity:1}.woocommerce-layout__activity-panel-tabs .woocommerce-layout__activity-panel-tab.has-unread:after,.woocommerce-layout__activity-panel-tabs .woocommerce-layout__activity-panel-tab.woocommerce-layout__activity-panel-tab-wordpress-notices:after{content:" ";position:absolute;padding:1px;background:#d94f4f;border:2px solid #fff;width:4px;height:4px;display:inline-block;border-radius:50%;top:8px;right:50%}@media(min-width:783px)and (max-width:960px){.woocommerce-layout__activity-panel-tabs .woocommerce-layout__activity-panel-tab.has-unread:after,.woocommerce-layout__activity-panel-tabs .woocommerce-layout__activity-panel-tab.woocommerce-layout__activity-panel-tab-wordpress-notices:after{left:18px;right:auto;margin-right:0}}@media(min-width:961px){.woocommerce-layout__activity-panel-tabs .woocommerce-layout__activity-panel-tab.has-unread:after,.woocommerce-layout__activity-panel-tabs .woocommerce-layout__activity-panel-tab.woocommerce-layout__activity-panel-tab-wordpress-notices:after{left:28px;right:auto;margin-right:0}}.woocommerce-layout__activity-panel-tabs .woocommerce-layout__activity-panel-tab.components-button:not(:disabled):not([aria-disabled=true]):hover,.woocommerce-layout__activity-panel-tabs .woocommerce-layout__activity-panel-tab:hover{background-color:#f0f0f0;box-shadow:none}.woocommerce-layout__activity-panel-tabs .woocommerce-layout__activity-panel-tab.components-button:not(:disabled):not([aria-disabled=true]):hover.has-unread:after,.woocommerce-layout__activity-panel-tabs .woocommerce-layout__activity-panel-tab.components-button:not(:disabled):not([aria-disabled=true]):hover.woocommerce-layout__activity-panel-tab-wordpress-notices:after,.woocommerce-layout__activity-panel-tabs .woocommerce-layout__activity-panel-tab:hover.has-unread:after,.woocommerce-layout__activity-panel-tabs .woocommerce-layout__activity-panel-tab:hover.woocommerce-layout__activity-panel-tab-wordpress-notices:after{border-color:#e0e0e0}.woocommerce-layout__activity-panel-tabs .woocommerce-layout__activity-panel-tab.components-button:not(:disabled):not([aria-disabled=true]):focus,.woocommerce-layout__activity-panel-tabs .woocommerce-layout__activity-panel-tab:focus{box-shadow:inset 1px -1px 0 #757575,inset -1px 1px 0 #757575}@media(max-width:782px){.woocommerce-layout__activity-panel-tabs .woocommerce-layout__activity-panel-tab.display-options{display:none}}.woocommerce-layout__activity-panel-tabs .woocommerce-layout__activity-panel-popover{margin-top:0;z-index:1001}.woocommerce-layout__activity-panel-tabs .woocommerce-layout__activity-panel-popover .components-menu-group{padding:12px}.woocommerce-layout__activity-panel-toggle-bubble.has-unread:after{content:" ";position:absolute;padding:1px;background:#ca4a1f;border:2px solid #fff;width:4px;height:4px;display:inline-block;border-radius:50%;top:6px;left:4px}@keyframes tabSwitch{0%,to{transform:translateX(0)}50%{transform:translateX(-100px)}}.woocommerce-layout__activity-panel-wrapper{height:calc(100vh - 106px);background:#f0f0f0;width:430px;transform:translateX(-100%);transition-property:transform box-shadow;transition-duration:.3s;transition-timing-function:ease-in-out;position:fixed;left:0;top:106px;z-index:1000;overflow-x:hidden;overflow-y:auto}@media(max-width:782px){.woocommerce-layout__activity-panel-wrapper{width:100%}}@media screen and (prefers-reduced-motion:reduce){.woocommerce-layout__activity-panel-wrapper{transition-duration:1ms}}@media(min-width:783px){.woocommerce-layout__activity-panel-wrapper{height:calc(100vh - 92px);top:92px}}.has-woocommerce-navigation .woocommerce-layout__activity-panel-wrapper{height:calc(100vh - 60px);top:60px}.woocommerce-layout__activity-panel-wrapper.is-open{transform:none;box-shadow:0 12px 12px 0 rgba(85,93,102,.3)}.woocommerce-layout__activity-panel-wrapper.is-switching{animation:tabSwitch;animation-duration:.3s}@media screen and (prefers-reduced-motion:reduce){.woocommerce-layout__activity-panel-wrapper.is-switching{animation:none}}.woocommerce-layout__activity-panel-wrapper .woocommerce-empty-content{padding-right:24px;padding-left:24px}.woocommerce-layout__activity-panel-avatar-flag-overlay{position:relative;top:-12px}.woocommerce-layout__activity-panel-avatar-flag-overlay .woocommerce-flag{position:relative;top:16px;border:2px solid #fff}.woocommerce-layout__notice-list-hide{display:none}.highlight-tooltip__container{position:absolute;width:0;height:0}.highlight-tooltip__container.highlight-tooltip__show{top:0;right:0;width:100%;height:100%}.highlight-tooltip__portal{width:100%;height:100%;position:relative}.highlight-tooltip__portal .highlight-tooltip__overlay{position:fixed;top:0;left:0;bottom:0;right:0;background-color:rgba(0,0,0,.35);z-index:100000;animation:edit-post__fade-in-animation .2s ease-out 0s;animation-fill-mode:forwards}@media(prefers-reduced-motion:reduce){.highlight-tooltip__portal .highlight-tooltip__overlay{animation-duration:1ms}}.highlight-tooltip__popover .components-card{min-width:360px}.highlight-tooltip__popover .components-card__header{font-size:16px;font-size:1rem;font-weight:600;box-sizing:border-box}.highlight-tooltip__popover .components-card__footer{justify-content:flex-end;box-sizing:border-box}.woocommerce-layout__show-app-banner{padding-top:56px}@media(min-width:783px){.woocommerce-layout__show-app-banner{padding-top:0}}.woocommerce-mobile-app-banner{background-color:#3c2861;width:100%;display:flex;height:56px;align-items:center;padding:0 4px 0 6px}@media(min-width:401px){.woocommerce-mobile-app-banner{padding:0 10px 0 13px}}@media(min-width:783px){.woocommerce-mobile-app-banner{display:none}}.woocommerce-mobile-app-banner .gridicon{fill:#fff;margin-left:10px}.woocommerce-mobile-app-banner .components-button.is-secondary{margin-right:auto;color:#fff;box-shadow:inset 0 0 0 1px #fff}.woocommerce-mobile-app-banner .components-button.is-secondary:active,.woocommerce-mobile-app-banner .components-button.is-secondary:hover{color:#fff;box-shadow:inset 0 0 0 1px #fff;background:none}.woocommerce-mobile-app-banner .woocommerce-mobile-app-banner__description{color:#fff;margin-right:8px}@media(min-width:401px){.woocommerce-mobile-app-banner .woocommerce-mobile-app-banner__description{margin-right:13px}}.woocommerce-mobile-app-banner .woocommerce-mobile-app-banner__description .woocommerce-mobile-app-banner__description__text{margin:0;font-size:10px}.woocommerce-mobile-app-banner .woocommerce-mobile-app-banner__description .woocommerce-mobile-app-banner__description__text:first-child{font-weight:700}@media(min-width:401px){.woocommerce-mobile-app-banner .woocommerce-mobile-app-banner__description .woocommerce-mobile-app-banner__description__text{margin-right:13px;font-size:13px}}.woocommerce-navigation{display:grid;grid-template-rows:min-content 1fr;height:100%}.woocommerce-navigation .woocommerce-navigation__wrapper h2>span{width:100%}.woocommerce-navigation .woocommerce-navigation__wrapper .components-navigation__menu{overflow-y:auto;margin-bottom:0;padding-bottom:24px}.woocommerce-navigation .woocommerce-navigation__wrapper .components-navigation__group+.components-navigation__group{margin-top:24px}.woocommerce-navigation .woocommerce-navigation__wrapper .components-navigation__item{margin-bottom:0}.woocommerce-navigation .woocommerce-navigation__wrapper .components-navigation__item .components-button{opacity:1}.woocommerce-navigation .woocommerce-navigation__wrapper .components-navigation__item:not(:hover) .components-button{color:#949494}.woocommerce-navigation .woocommerce-navigation__wrapper .components-navigation__item:hover .components-button{color:#ddd}.woocommerce-navigation .woocommerce-navigation__wrapper .components-navigation__item.is-active .components-button{color:#fff}.woocommerce-navigation .woocommerce-navigation__wrapper .components-navigation__item a.components-button{padding:6px 16px}.woocommerce-navigation .woocommerce-navigation__wrapper .components-navigation__item:not(:hover) a.components-button{color:#949494}.woocommerce-navigation .woocommerce-navigation__wrapper .components-navigation__item.is-active a.components-button{color:#fff}.woocommerce-navigation .woocommerce-navigation__wrapper .components-navigation{height:100%}.woocommerce-navigation .woocommerce-navigation__wrapper .components-navigation>div{height:100%;display:grid;grid-template-rows:1fr min-content}.woocommerce-navigation .woocommerce-navigation__wrapper.is-root .components-navigation__menu-secondary{border-top:1px solid #2c3338;margin:0 -8px;padding:16px 8px 12px}.woocommerce-navigation .woocommerce-navigation__wrapper .components-navigation__group-title,.woocommerce-navigation .woocommerce-navigation__wrapper .components-navigation__menu-title{color:#f0f0f0;opacity:1}.woocommerce-navigation .woocommerce-navigation__wrapper .components-navigation__back-button{color:#949494;opacity:1}.woocommerce-navigation .woocommerce-navigation__wrapper .components-navigation__back-button,.woocommerce-navigation .woocommerce-navigation__wrapper .components-navigation__back-button span{font-size:13px;line-height:normal}.woocommerce-navigation .woocommerce-navigation__wrapper .components-navigation__back-button:hover,.woocommerce-navigation .woocommerce-navigation__wrapper .components-navigation__back-button:hover:not(:disabled){color:#ddd}.woocommerce-navigation-header{display:flex;align-items:center;border:none;border-radius:0;height:auto}.woocommerce-navigation-header .woocommerce-navigation-header__site-icon.components-button{padding:12px;height:60px;color:#fff}.woocommerce-navigation-header .woocommerce-navigation-header__site-icon.components-button:focus,.woocommerce-navigation-header .woocommerce-navigation-header__site-icon.components-button:hover,.woocommerce-navigation-header .woocommerce-navigation-header__site-icon.components-button:not([aria-disabled=true]):active{color:#fff}.woocommerce-navigation-header .woocommerce-navigation-header__site-title.components-button{padding-right:0;color:#ccc;font-weight:600}.woocommerce-navigation-header .woocommerce-navigation-header__site-title.components-button:active,.woocommerce-navigation-header .woocommerce-navigation-header__site-title.components-button:focus,.woocommerce-navigation-header .woocommerce-navigation-header__site-title.components-button:hover{color:#e0e0e0}.woocommerce-navigation{position:relative;width:240px;box-sizing:border-box;background-color:#1e1e1e;z-index:1100}@media(max-width:960px){.woocommerce-navigation{width:60px;height:60px}}.woocommerce-navigation .components-navigation{box-sizing:border-box}.woocommerce-navigation .components-navigation__menu-title{overflow:visible}.woocommerce-navigation__wrapper{background-color:#1e1e1e;position:absolute;top:60px;width:100%;height:calc(100vh - 92px);overflow-y:auto}.is-wp-toolbar-disabled .woocommerce-navigation__wrapper{height:calc(100vh - 60px)}body.is-wc-nav-expanded .woocommerce-navigation{width:240px;height:100%}body.is-wc-nav-expanded font>.xdebug-error{margin-right:256px}body.is-wc-nav-folded .woocommerce-navigation{width:60px;height:60px;overflow:hidden}body.is-wc-nav-folded .woocommerce-navigation .woocommerce-navigation-header>*{display:none}body.is-wc-nav-folded .woocommerce-navigation .woocommerce-navigation-header__site-icon{display:block}body.is-wc-nav-folded .woocommerce-navigation .components-navigation{display:none}body.is-wc-nav-folded .woocommerce-transient-notices{right:16px}body.is-wc-nav-folded #wpbody{padding-right:0}.has-woocommerce-navigation #adminmenuback,.has-woocommerce-navigation #adminmenuwrap{display:none!important}.has-woocommerce-navigation.woocommerce_page_wc-reports .woo-nav-tab-wrapper,.has-woocommerce-navigation.woocommerce_page_wc-settings .woo-nav-tab-wrapper,.has-woocommerce-navigation.woocommerce_page_wc-status .woo-nav-tab-wrapper{display:none}.has-woocommerce-navigation.woocommerce_page_wc-reports .woocommerce .subsubsub,.has-woocommerce-navigation.woocommerce_page_wc-settings .woocommerce .subsubsub,.has-woocommerce-navigation.woocommerce_page_wc-status .woocommerce .subsubsub{font-size:14px;margin:5px 0}.has-woocommerce-navigation #wpcontent,.has-woocommerce-navigation #wpfooter{margin-right:0}@media(max-width:960px){.has-woocommerce-navigation #wpcontent,.has-woocommerce-navigation #wpfooter{margin-right:0}}.has-woocommerce-navigation #wpbody{padding-right:240px}@media(max-width:960px){.has-woocommerce-navigation #wpbody{padding-right:0}}.has-woocommerce-navigation .woocommerce-layout__header.is-embed-loading:before{content:"";position:fixed;width:240px;height:100%;background:#1e1e1e}@media(max-width:960px){.has-woocommerce-navigation .woocommerce-layout__header.is-embed-loading:before{width:60px;height:60px}}.has-woocommerce-navigation #woocommerce-embedded-root.is-embed-loading{margin-bottom:-32px}.has-woocommerce-navigation:not(.is-wp-toolbar-disabled) #wpbody-content{margin-top:32px}.has-woocommerce-navigation font>.xdebug-error{margin-top:60px}.woocommerce-navigation-category-title{display:flex;align-items:center;font-size:20px;line-height:28px}.woocommerce-navigation-category-title .woocommerce-navigation-favorite-button{margin-right:auto}.woocommerce-navigation-favorite-button.components-button .star-empty-icon{color:#949494}.woocommerce-navigation-favorite-button.components-button .star-filled-icon{color:#ffb900}.woocommerce-transient-notices{position:fixed;bottom:12px;right:176px;z-index:99999;width:auto}@media(max-width:960px){.woocommerce-transient-notices{right:50px}}@media(max-width:782px){.woocommerce-transient-notices{right:16px}}.woocommerce-profile-wizard__body .woocommerce-transient-notices{right:unset}.woocommerce-profile-wizard__body .woocommerce-transient-notices .components-snackbar{margin-right:auto;margin-left:auto}.has-woocommerce-navigation .woocommerce-transient-notices{right:256px}.components-snackbar.components-snackbar-explicit-dismiss{cursor:default}.components-snackbar .components-snackbar__content-with-icon{margin-right:32px}.components-snackbar .components-snackbar__icon{position:absolute;top:24px;right:26px}.components-snackbar .components-snackbar__dismiss-button{margin-right:32px;cursor:pointer}:root{--wp-admin-theme-color:#007cba;--wp-admin-theme-color-darker-10:#006ba1;--wp-admin-theme-color-darker-20:#005a87}body.admin-color-light{--wp-admin-theme-color:#0085ba;--wp-admin-theme-color-darker-10:#0073a1;--wp-admin-theme-color-darker-20:#006187}body.admin-color-modern{--wp-admin-theme-color:#3858e9;--wp-admin-theme-color-darker-10:#2145e6;--wp-admin-theme-color-darker-20:#183ad6}body.admin-color-blue{--wp-admin-theme-color:#096484;--wp-admin-theme-color-darker-10:#07526c;--wp-admin-theme-color-darker-20:#064054}body.admin-color-coffee{--wp-admin-theme-color:#46403c;--wp-admin-theme-color-darker-10:#383330;--wp-admin-theme-color-darker-20:#2b2724}body.admin-color-ectoplasm{--wp-admin-theme-color:#523f6d;--wp-admin-theme-color-darker-10:#46365d;--wp-admin-theme-color-darker-20:#3a2c4d}body.admin-color-midnight{--wp-admin-theme-color:#e14d43;--wp-admin-theme-color-darker-10:#dd382d;--wp-admin-theme-color-darker-20:#d02c21}body.admin-color-ocean{--wp-admin-theme-color:#627c83;--wp-admin-theme-color-darker-10:#576e74;--wp-admin-theme-color-darker-20:#4c6066}body.admin-color-sunrise{--wp-admin-theme-color:#dd823b;--wp-admin-theme-color-darker-10:#d97426;--wp-admin-theme-color-darker-20:#c36922}.woocommerce-embedded-layout__primary{padding:0 20px}.woocommerce-embedded-layout__primary .components-card__footer,.woocommerce-embedded-layout__primary .components-card__header{box-sizing:border-box}@media(max-width:782px){.woocommerce-embedded-layout__primary{padding:0}}woocommerce-admin/dist/app/index.asset.php000064400000001114151335517650014642 0ustar00<?php return array('dependencies' => array('lodash', 'moment', 'react', 'react-dom', 'wc-components', 'wc-csv', 'wc-currency', 'wc-customer-effort-score', 'wc-date', 'wc-experimental', 'wc-explat', 'wc-navigation', 'wc-notices', 'wc-number', 'wc-settings', 'wc-store-data', 'wc-tracks', 'wp-a11y', 'wp-api-fetch', 'wp-components', 'wp-compose', 'wp-data', 'wp-data-controls', 'wp-date', 'wp-dom', 'wp-element', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-keycodes', 'wp-notices', 'wp-plugins', 'wp-primitives', 'wp-url', 'wp-warning'), 'version' => 'bcf6645772787a314f98c4ccf548c7d6');woocommerce-admin/dist/app/style.css000064400000072237151335517650013574 0ustar00.woocommerce-page .wrap{margin:0}.woocommerce-page #wpcontent,.woocommerce-page.woocommerce_page_wc-admin #wpbody-content{padding:0;overflow-x:hidden!important;min-height:calc(100vh - 32px)}@media(min-width:783px){.woocommerce-page #wpbody-content{padding-left:0}}@media(max-width:782px){.woocommerce-page .wp-responsive-open #woocommerce-embedded-root,.woocommerce-page .wp-responsive-open #wpbody{position:relative;right:-14.5em}.woocommerce-page #wpbody-content,.woocommerce-page #wpcontent{min-height:calc(100vh - 46px)}}@media(min-width:961px){.woocommerce-page #toplevel_page_wcadmin--analytics.menu-top>a:focus,.woocommerce-page #toplevel_page_woocommerce.menu-top>a:focus{padding-bottom:1px}}#wpbody,.woocommerce-layout *{box-sizing:border-box}#wpbody{display:inline-block;width:100%;padding-top:0;margin-top:60px}#wpfooter{display:none}.woocommerce_page_wc-admin .woocommerce-filters-date__content:not(.is-mobile){z-index:2}@media(max-width:600px){#wpadminbar{position:fixed}html.wp-toolbar{padding-top:46px}}@media(max-width:782px){.jetpack-masterbar #wpadminbar #wp-admin-bar-menu-toggle{margin-top:-10px}.jetpack-masterbar #wpwrap .woocommerce-layout__header-heading{padding-left:60px}.jetpack-masterbar.wp-admin .wrap h1,.jetpack-masterbar.wp-admin .wrap h2{padding-left:0}}.woocommerce-page .wp-has-current-submenu:after{right:0;content:" ";height:0;width:0;position:absolute;pointer-events:none;border:8px solid transparent;border-right-color:#f1f1f1;top:0;margin-top:10px}@media(max-width:960px){.woocommerce-page .wp-has-current-submenu:after{border-width:4px;margin-top:14px}}:root{--large-gap:40px;--main-gap:24px}@media(max-width:960px){:root{--large-gap:24px}}@media(max-width:782px){:root{--large-gap:16px;--main-gap:16px}}@keyframes loading-fade{0%{opacity:.7}50%{opacity:1}to{opacity:.7}}.woocommerce-layout select:hover{color:#1e1e1e}.woocommerce-layout select.components-select-control__input{max-width:100%;line-height:1}body.woocommerce-page .components-button.is-primary:not(:disabled),body.woocommerce-page .components-snackbar .components-button.is-tertiary,body.woocommerce-page .components-snackbar .components-button.is-tertiary:not(:disabled):not([aria-disabled=true]):hover{color:#fff}.woocommerce-embed-page #wpbody .woocommerce-layout,.woocommerce-embed-page .woocommerce-layout__notice-list-hide+.wrap{padding-top:10px}.woocommerce-embed-page #wpbody-content,.woocommerce-embed-page #wpcontent{overflow-x:initial!important}.woocommerce-embed-page #wpbody-content{padding-top:0}.woocommerce-embed-page #wpbody-content .notice{margin-top:15px}.woocommerce-embed-page .wrap{padding:0 20px}@media(max-width:782px){.woocommerce-embed-page .wrap p.search-box{width:calc(100% - 40px)}}.woocommerce-embed-page .wrap .wrap{padding:0}.woocommerce-embed-page #screen-meta{border-right:0;margin:0}.woocommerce-embed-page #screen-meta-links{position:relative}.woocommerce-embed-page .notice{padding:1px 12px}.woocommerce-embed-page .woocommerce-layout__header.is-scrolled{box-shadow:0 8px 16px 0 rgba(85,93,102,.3)}.woocommerce-embed-page .woocommerce-layout__header .woocommerce-layout__header-heading{margin-top:0;margin-bottom:0}.woocommerce-embed-page #screen-meta-links.is-hidden-by-notices,.woocommerce-embed-page #screen-meta.is-hidden-by-notices{display:none!important}.woocommerce-embed-page .woocommerce-layout__primary{margin:0}@media(max-width:782px){.woocommerce-embed-page .woocommerce-layout__primary{padding-top:10px}}@keyframes isLoaded{0%{opacity:0}to{opacity:1}}.woocommerce-embed-page .woocommerce-layout__activity-panel-tabs{animation:isLoaded;animation-duration:2s}.woocommerce-embed-page .woocommerce-layout__notice-list-show{margin-top:10px;margin-bottom:16px}@media(max-width:600px){.woocommerce-embed-page .woocommerce-layout__notice-list-show{margin-top:80px;margin-bottom:-16px}}@media(min-width:601px)and (max-width:782px){.woocommerce-embed-page .woocommerce-layout__notice-list-show{margin-top:32px}}.woocommerce-embed-page .woocommerce-activity-card__actions a.components-button:not(.is-primary){color:#757575}.woocommerce-layout{margin:0;padding:0}.woocommerce-layout__primary{margin:var(--large-gap) 0 0 var(--large-gap)}@media(max-width:782px){.woocommerce-layout__primary{margin-top:20px}}.woocommerce-layout .woocommerce-layout__main{padding-right:40px;padding-right:var(--large-gap);max-width:100%}.woocommerce-admin-is-loading #adminmenumain,.woocommerce-admin-is-loading #wpadminbar,.woocommerce-admin-is-loading #wpbody-content,.woocommerce-admin-is-loading #wpcontent,.woocommerce-admin-is-loading #wpfooter,.woocommerce-admin-is-loading .components-modal__screen-overlay,.woocommerce-admin-is-loading .error,.woocommerce-admin-is-loading .notice,.woocommerce-admin-is-loading .update-nag,.woocommerce-admin-is-loading .updated,.woocommerce-admin-is-loading .woocommerce-layout__header,.woocommerce-admin-is-loading .woocommerce-message,.woocommerce-admin-is-loading .woocommerce-store-alerts,.woocommerce-page .update-nag{display:none}.woocommerce-admin-full-screen{background:#f6f7f7;color:#50575e;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif}.woocommerce-admin-full-screen #wpwrap{top:0}.woocommerce-admin-full-screen #wpbody-content{min-height:100vh!important}.woocommerce-admin-full-screen #adminmenumain,.woocommerce-admin-full-screen #wpcontent>*,.woocommerce-admin-full-screen .error,.woocommerce-admin-full-screen .notice,.woocommerce-admin-full-screen .update-nag,.woocommerce-admin-full-screen .updated,.woocommerce-admin-full-screen .woocommerce-layout__header,.woocommerce-admin-full-screen .woocommerce-message,.woocommerce-admin-full-screen .woocommerce-store-alerts{display:none}.woocommerce-admin-full-screen #wpcontent{margin-left:0!important}.woocommerce-admin-full-screen #wpcontent>#wpbody{display:block;margin-top:0!important}.woocommerce-admin-full-screen.has-woocommerce-navigation #wpbody{padding-left:0}.is-wp-toolbar-disabled #wpadminbar{display:none!important}.wp-toolbar .is-wp-toolbar-disabled{margin-top:-32px}@media(max-width:600px){.wp-toolbar .is-wp-toolbar-disabled{margin-top:-46px}}.woocommerce-onboarding .muriel-component{margin-top:16px;margin-bottom:16px}.woocommerce-onboarding .components-base-control.has-error{margin-bottom:32px!important;border-color:#d63638}@media(max-width:782px){.woocommerce-onboarding .components-base-control.has-error{margin-bottom:44px!important}}.woocommerce-onboarding .components-base-control.has-error .components-base-control__help{top:100%;left:12px;position:absolute;margin-top:4px;font-size:12px;font-style:normal;color:#d63638}.woocommerce-onboarding .components-form-toggle{display:inline-block}.woocommerce-onboarding .components-form-toggle label{font-size:14px}.woocommerce-onboarding .components-form-toggle .components-base-control{display:inline-block}.woocommerce-onboarding .components-form-toggle .components-base-control__field{margin-bottom:0}.woocommerce-page .components-modal__frame .components-button.is-button,.woocommerce-profile-wizard__body .components-button.is-button,.woocommerce-task-dashboard__container .components-button.is-button{height:48px;padding-left:25px;padding-right:25px;text-align:center;font-size:14px;line-height:36px;font-weight:500;align-items:center}.woocommerce-page .components-modal__frame .components-button.is-button:disabled,.woocommerce-profile-wizard__body .components-button.is-button:disabled,.woocommerce-task-dashboard__container .components-button.is-button:disabled{cursor:not-allowed}.components-modal__header .components-button svg+span{display:none}.components-modal__frame.woocommerce-usage-modal{width:600px;max-width:100%}.components-modal__frame.woocommerce-usage-modal .components-modal__header{border-bottom:0;margin-bottom:0}.components-modal__frame.woocommerce-usage-modal .woocommerce-usage-modal__wrapper{flex-grow:1;display:flex;flex-direction:column}.components-modal__frame.woocommerce-usage-modal .woocommerce-usage-modal__wrapper a{color:#50575e}.components-modal__frame.woocommerce-usage-modal .woocommerce-usage-modal__wrapper button.is-primary{align-self:flex-end}.components-modal__frame.woocommerce-usage-modal .woocommerce-usage-modal__actions{display:flex;justify-content:flex-end;margin-top:16px}.components-modal__frame.woocommerce-usage-modal .woocommerce-usage-modal__actions button{margin-left:16px}.woocommerce-payments__usage-modal .components-modal__header{height:auto;padding:24px 24px 0}.woocommerce-payments__usage-modal .components-modal__header .components-modal__header-heading{font-size:24px;line-height:32px;margin:0 0 24px}.woocommerce-payments__usage-modal .woocommerce-payments__usage-modal-message{padding:16px 0;font-size:16px;line-height:24px}.woocommerce-payments__usage-modal .woocommerce-payments__usage-footer{display:flex;justify-content:flex-end;padding:16px 0}.woocommerce-payments__usage-modal .woocommerce-payments__usage-footer button{margin-left:16px}.components-modal__frame.woocommerce-cart-modal{width:600px;max-width:100%}.components-modal__frame.woocommerce-cart-modal .components-modal__header{border-bottom:0;margin-bottom:16px;margin-top:16px}.components-modal__frame.woocommerce-cart-modal .components-modal__header button{display:none}.components-modal__frame.woocommerce-cart-modal .components-modal__header-heading{font-style:normal;font-weight:400;font-size:24px;line-height:32px}.components-modal__frame.woocommerce-cart-modal .woocommerce-list{margin-top:24px}.components-modal__frame.woocommerce-cart-modal .woocommerce-list .woocommerce-list__item:first-child{border-top:1px solid #dcdcde}.components-modal__frame.woocommerce-cart-modal .woocommerce-list__item{border-bottom:1px solid #dcdcde}.components-modal__frame.woocommerce-cart-modal .woocommerce-cart-modal__help-text{font-size:16px;line-height:24px}.components-modal__frame.woocommerce-cart-modal .woocommerce-cart-modal__actions{text-align:right}.components-modal__frame.woocommerce-cart-modal .woocommerce-cart-modal__actions button.is-link{margin-right:16px;text-decoration:none;font-weight:600;font-size:14px}.components-modal__frame.woocommerce-cart-modal .woocommerce-cart-modal__actions button.is-primary{align-self:flex-end}.woocommerce-layout__header{background:#fff;box-sizing:border-box;padding:0;position:fixed;width:calc(100% - 160px);top:32px;z-index:1001}.woocommerce-layout__header.is-scrolled{box-shadow:0 8px 8px 0 rgba(85,93,102,.3)}.woocommerce-layout__header .woocommerce-layout__header-wrapper{display:flex;align-items:center;min-height:60px}.woocommerce-layout__header .woocommerce-layout__header-back-button{cursor:pointer;margin-left:var(--large-gap);display:flex}.woocommerce-layout__header .woocommerce-layout__header-back-button:focus{box-shadow:inset -1px -1px 0 #757575,inset 1px 1px 0 #757575}@media(max-width:782px){.woocommerce-layout__header{flex-flow:row wrap;top:46px;width:100%}}@media(min-width:783px)and (max-width:960px){.woocommerce-layout__header{width:calc(100% - 36px)}}.woocommerce-layout__header .woocommerce-layout__header-breadcrumbs-wrapper{display:flex;justify-content:space-between;flex-direction:row}.woocommerce-layout__header .woocommerce-layout__header-heading{display:flex;align-items:center;padding:0 0 0 40px;padding:0 0 0 var(--large-gap);flex:1 auto;height:60px;background:#fff;font-weight:600;font-size:14px}.woocommerce-layout__header .woocommerce-layout__header-heading.with-back-button{padding-left:24px}.folded .woocommerce-layout__header{width:calc(100% - 36px)}@media(max-width:782px){.folded .woocommerce-layout__header{width:100%}}.is-wp-toolbar-disabled .woocommerce-layout__header{top:0}.has-woocommerce-navigation .woocommerce-layout__header{left:0;width:100%}.woocommerce-page #contextual-help-link-wrap,.woocommerce-page #screen-options-link-wrap{margin-top:-1px}.wp-responsive-open .woocommerce-layout__header{margin-left:2px}.woocommerce-layout__activity-panel{display:flex;flex-direction:row;align-items:center;height:60px}.woocommerce-layout__activity-panel-tabs{width:100%;display:flex;height:60px;justify-content:flex-end}.woocommerce-layout__activity-panel-tabs .dashicon,.woocommerce-layout__activity-panel-tabs .gridicon{width:100%}.woocommerce-layout__activity-panel-tabs svg{width:24px;height:24px}.woocommerce-layout__activity-panel-tabs svg.woocommerce-layout__activity-panel-tab-icon{fill:none}.woocommerce-layout__activity-panel-tabs svg.woocommerce-layout__activity-panel-tab-icon path,.woocommerce-layout__activity-panel-tabs svg.woocommerce-layout__activity-panel-tab-icon rect{stroke:currentColor}.woocommerce-layout__activity-panel-tabs svg.setup-progress path:first-child{stroke:"#DCDCDE"}.woocommerce-layout__activity-panel-tabs .woocommerce-layout__homescreen-display-options svg.woocommerce-layout__activity-panel-tab-icon{height:14px}.woocommerce-layout__activity-panel-tabs .woocommerce-layout__homescreen-extension-tasklist-toggle{min-width:205px}.woocommerce-layout__activity-panel-tabs .components-icon-button{display:initial;text-indent:0;border-radius:0}.woocommerce-layout__activity-panel-tabs .components-icon-button.has-text svg{margin:0}.woocommerce-layout__activity-panel-tabs .woocommerce-layout__activity-panel-tab{display:flex;flex-direction:column;justify-content:center;align-items:center;position:relative;border:none;outline:none;cursor:pointer;background-color:#fff;max-width:min-content;min-width:80px;width:100%;height:60px;color:#757575;white-space:nowrap}.woocommerce-layout__activity-panel-tabs .woocommerce-layout__activity-panel-tab:before{background-color:#007cba;background-color:var(--wp-admin-theme-color);bottom:0;content:"";height:0;opacity:0;transition-property:height,opacity;transition-duration:.3s;transition-timing-function:ease-in-out;left:0;position:absolute;right:0}.woocommerce-layout__activity-panel-tabs .woocommerce-layout__activity-panel-tab.is-active,.woocommerce-layout__activity-panel-tabs .woocommerce-layout__activity-panel-tab.is-opened{color:#1e1e1e;box-shadow:none}.woocommerce-layout__activity-panel-tabs .woocommerce-layout__activity-panel-tab.is-active:before,.woocommerce-layout__activity-panel-tabs .woocommerce-layout__activity-panel-tab.is-opened:before{height:3px;opacity:1}.woocommerce-layout__activity-panel-tabs .woocommerce-layout__activity-panel-tab.has-unread:after,.woocommerce-layout__activity-panel-tabs .woocommerce-layout__activity-panel-tab.woocommerce-layout__activity-panel-tab-wordpress-notices:after{content:" ";position:absolute;padding:1px;background:#d94f4f;border:2px solid #fff;width:4px;height:4px;display:inline-block;border-radius:50%;top:8px;left:50%}@media(min-width:783px)and (max-width:960px){.woocommerce-layout__activity-panel-tabs .woocommerce-layout__activity-panel-tab.has-unread:after,.woocommerce-layout__activity-panel-tabs .woocommerce-layout__activity-panel-tab.woocommerce-layout__activity-panel-tab-wordpress-notices:after{right:18px;left:auto;margin-left:0}}@media(min-width:961px){.woocommerce-layout__activity-panel-tabs .woocommerce-layout__activity-panel-tab.has-unread:after,.woocommerce-layout__activity-panel-tabs .woocommerce-layout__activity-panel-tab.woocommerce-layout__activity-panel-tab-wordpress-notices:after{right:28px;left:auto;margin-left:0}}.woocommerce-layout__activity-panel-tabs .woocommerce-layout__activity-panel-tab.components-button:not(:disabled):not([aria-disabled=true]):hover,.woocommerce-layout__activity-panel-tabs .woocommerce-layout__activity-panel-tab:hover{background-color:#f0f0f0;box-shadow:none}.woocommerce-layout__activity-panel-tabs .woocommerce-layout__activity-panel-tab.components-button:not(:disabled):not([aria-disabled=true]):hover.has-unread:after,.woocommerce-layout__activity-panel-tabs .woocommerce-layout__activity-panel-tab.components-button:not(:disabled):not([aria-disabled=true]):hover.woocommerce-layout__activity-panel-tab-wordpress-notices:after,.woocommerce-layout__activity-panel-tabs .woocommerce-layout__activity-panel-tab:hover.has-unread:after,.woocommerce-layout__activity-panel-tabs .woocommerce-layout__activity-panel-tab:hover.woocommerce-layout__activity-panel-tab-wordpress-notices:after{border-color:#e0e0e0}.woocommerce-layout__activity-panel-tabs .woocommerce-layout__activity-panel-tab.components-button:not(:disabled):not([aria-disabled=true]):focus,.woocommerce-layout__activity-panel-tabs .woocommerce-layout__activity-panel-tab:focus{box-shadow:inset -1px -1px 0 #757575,inset 1px 1px 0 #757575}@media(max-width:782px){.woocommerce-layout__activity-panel-tabs .woocommerce-layout__activity-panel-tab.display-options{display:none}}.woocommerce-layout__activity-panel-tabs .woocommerce-layout__activity-panel-popover{margin-top:0;z-index:1001}.woocommerce-layout__activity-panel-tabs .woocommerce-layout__activity-panel-popover .components-menu-group{padding:12px}.woocommerce-layout__activity-panel-toggle-bubble.has-unread:after{content:" ";position:absolute;padding:1px;background:#ca4a1f;border:2px solid #fff;width:4px;height:4px;display:inline-block;border-radius:50%;top:6px;right:4px}@keyframes tabSwitch{0%,to{transform:translateX(0)}50%{transform:translateX(100px)}}.woocommerce-layout__activity-panel-wrapper{height:calc(100vh - 106px);background:#f0f0f0;width:430px;transform:translateX(100%);transition-property:transform box-shadow;transition-duration:.3s;transition-timing-function:ease-in-out;position:fixed;right:0;top:106px;z-index:1000;overflow-x:hidden;overflow-y:auto}@media(max-width:782px){.woocommerce-layout__activity-panel-wrapper{width:100%}}@media screen and (prefers-reduced-motion:reduce){.woocommerce-layout__activity-panel-wrapper{transition-duration:1ms}}@media(min-width:783px){.woocommerce-layout__activity-panel-wrapper{height:calc(100vh - 92px);top:92px}}.has-woocommerce-navigation .woocommerce-layout__activity-panel-wrapper{height:calc(100vh - 60px);top:60px}.woocommerce-layout__activity-panel-wrapper.is-open{transform:none;box-shadow:0 12px 12px 0 rgba(85,93,102,.3)}.woocommerce-layout__activity-panel-wrapper.is-switching{animation:tabSwitch;animation-duration:.3s}@media screen and (prefers-reduced-motion:reduce){.woocommerce-layout__activity-panel-wrapper.is-switching{animation:none}}.woocommerce-layout__activity-panel-wrapper .woocommerce-empty-content{padding-left:24px;padding-right:24px}.woocommerce-layout__activity-panel-avatar-flag-overlay{position:relative;top:-12px}.woocommerce-layout__activity-panel-avatar-flag-overlay .woocommerce-flag{position:relative;top:16px;border:2px solid #fff}.woocommerce-layout__notice-list-hide{display:none}.highlight-tooltip__container{position:absolute;width:0;height:0}.highlight-tooltip__container.highlight-tooltip__show{top:0;left:0;width:100%;height:100%}.highlight-tooltip__portal{width:100%;height:100%;position:relative}.highlight-tooltip__portal .highlight-tooltip__overlay{position:fixed;top:0;right:0;bottom:0;left:0;background-color:rgba(0,0,0,.35);z-index:100000;animation:edit-post__fade-in-animation .2s ease-out 0s;animation-fill-mode:forwards}@media(prefers-reduced-motion:reduce){.highlight-tooltip__portal .highlight-tooltip__overlay{animation-duration:1ms}}.highlight-tooltip__popover .components-card{min-width:360px}.highlight-tooltip__popover .components-card__header{font-size:16px;font-size:1rem;font-weight:600;box-sizing:border-box}.highlight-tooltip__popover .components-card__footer{justify-content:flex-end;box-sizing:border-box}.woocommerce-layout__show-app-banner{padding-top:56px}@media(min-width:783px){.woocommerce-layout__show-app-banner{padding-top:0}}.woocommerce-mobile-app-banner{background-color:#3c2861;width:100%;display:flex;height:56px;align-items:center;padding:0 6px 0 4px}@media(min-width:401px){.woocommerce-mobile-app-banner{padding:0 13px 0 10px}}@media(min-width:783px){.woocommerce-mobile-app-banner{display:none}}.woocommerce-mobile-app-banner .gridicon{fill:#fff;margin-right:10px}.woocommerce-mobile-app-banner .components-button.is-secondary{margin-left:auto;color:#fff;box-shadow:inset 0 0 0 1px #fff}.woocommerce-mobile-app-banner .components-button.is-secondary:active,.woocommerce-mobile-app-banner .components-button.is-secondary:hover{color:#fff;box-shadow:inset 0 0 0 1px #fff;background:none}.woocommerce-mobile-app-banner .woocommerce-mobile-app-banner__description{color:#fff;margin-left:8px}@media(min-width:401px){.woocommerce-mobile-app-banner .woocommerce-mobile-app-banner__description{margin-left:13px}}.woocommerce-mobile-app-banner .woocommerce-mobile-app-banner__description .woocommerce-mobile-app-banner__description__text{margin:0;font-size:10px}.woocommerce-mobile-app-banner .woocommerce-mobile-app-banner__description .woocommerce-mobile-app-banner__description__text:first-child{font-weight:700}@media(min-width:401px){.woocommerce-mobile-app-banner .woocommerce-mobile-app-banner__description .woocommerce-mobile-app-banner__description__text{margin-left:13px;font-size:13px}}.woocommerce-navigation{display:grid;grid-template-rows:min-content 1fr;height:100%}.woocommerce-navigation .woocommerce-navigation__wrapper h2>span{width:100%}.woocommerce-navigation .woocommerce-navigation__wrapper .components-navigation__menu{overflow-y:auto;margin-bottom:0;padding-bottom:24px}.woocommerce-navigation .woocommerce-navigation__wrapper .components-navigation__group+.components-navigation__group{margin-top:24px}.woocommerce-navigation .woocommerce-navigation__wrapper .components-navigation__item{margin-bottom:0}.woocommerce-navigation .woocommerce-navigation__wrapper .components-navigation__item .components-button{opacity:1}.woocommerce-navigation .woocommerce-navigation__wrapper .components-navigation__item:not(:hover) .components-button{color:#949494}.woocommerce-navigation .woocommerce-navigation__wrapper .components-navigation__item:hover .components-button{color:#ddd}.woocommerce-navigation .woocommerce-navigation__wrapper .components-navigation__item.is-active .components-button{color:#fff}.woocommerce-navigation .woocommerce-navigation__wrapper .components-navigation__item a.components-button{padding:6px 16px}.woocommerce-navigation .woocommerce-navigation__wrapper .components-navigation__item:not(:hover) a.components-button{color:#949494}.woocommerce-navigation .woocommerce-navigation__wrapper .components-navigation__item.is-active a.components-button{color:#fff}.woocommerce-navigation .woocommerce-navigation__wrapper .components-navigation{height:100%}.woocommerce-navigation .woocommerce-navigation__wrapper .components-navigation>div{height:100%;display:grid;grid-template-rows:1fr min-content}.woocommerce-navigation .woocommerce-navigation__wrapper.is-root .components-navigation__menu-secondary{border-top:1px solid #2c3338;margin:0 -8px;padding:16px 8px 12px}.woocommerce-navigation .woocommerce-navigation__wrapper .components-navigation__group-title,.woocommerce-navigation .woocommerce-navigation__wrapper .components-navigation__menu-title{color:#f0f0f0;opacity:1}.woocommerce-navigation .woocommerce-navigation__wrapper .components-navigation__back-button{color:#949494;opacity:1}.woocommerce-navigation .woocommerce-navigation__wrapper .components-navigation__back-button,.woocommerce-navigation .woocommerce-navigation__wrapper .components-navigation__back-button span{font-size:13px;line-height:normal}.woocommerce-navigation .woocommerce-navigation__wrapper .components-navigation__back-button:hover,.woocommerce-navigation .woocommerce-navigation__wrapper .components-navigation__back-button:hover:not(:disabled){color:#ddd}.woocommerce-navigation-header{display:flex;align-items:center;border:none;border-radius:0;height:auto}.woocommerce-navigation-header .woocommerce-navigation-header__site-icon.components-button{padding:12px;height:60px;color:#fff}.woocommerce-navigation-header .woocommerce-navigation-header__site-icon.components-button:focus,.woocommerce-navigation-header .woocommerce-navigation-header__site-icon.components-button:hover,.woocommerce-navigation-header .woocommerce-navigation-header__site-icon.components-button:not([aria-disabled=true]):active{color:#fff}.woocommerce-navigation-header .woocommerce-navigation-header__site-title.components-button{padding-left:0;color:#ccc;font-weight:600}.woocommerce-navigation-header .woocommerce-navigation-header__site-title.components-button:active,.woocommerce-navigation-header .woocommerce-navigation-header__site-title.components-button:focus,.woocommerce-navigation-header .woocommerce-navigation-header__site-title.components-button:hover{color:#e0e0e0}.woocommerce-navigation{position:relative;width:240px;box-sizing:border-box;background-color:#1e1e1e;z-index:1100}@media(max-width:960px){.woocommerce-navigation{width:60px;height:60px}}.woocommerce-navigation .components-navigation{box-sizing:border-box}.woocommerce-navigation .components-navigation__menu-title{overflow:visible}.woocommerce-navigation__wrapper{background-color:#1e1e1e;position:absolute;top:60px;width:100%;height:calc(100vh - 92px);overflow-y:auto}.is-wp-toolbar-disabled .woocommerce-navigation__wrapper{height:calc(100vh - 60px)}body.is-wc-nav-expanded .woocommerce-navigation{width:240px;height:100%}body.is-wc-nav-expanded font>.xdebug-error{margin-left:256px}body.is-wc-nav-folded .woocommerce-navigation{width:60px;height:60px;overflow:hidden}body.is-wc-nav-folded .woocommerce-navigation .woocommerce-navigation-header>*{display:none}body.is-wc-nav-folded .woocommerce-navigation .woocommerce-navigation-header__site-icon{display:block}body.is-wc-nav-folded .woocommerce-navigation .components-navigation{display:none}body.is-wc-nav-folded .woocommerce-transient-notices{left:16px}body.is-wc-nav-folded #wpbody{padding-left:0}.has-woocommerce-navigation #adminmenuback,.has-woocommerce-navigation #adminmenuwrap{display:none!important}.has-woocommerce-navigation.woocommerce_page_wc-reports .woo-nav-tab-wrapper,.has-woocommerce-navigation.woocommerce_page_wc-settings .woo-nav-tab-wrapper,.has-woocommerce-navigation.woocommerce_page_wc-status .woo-nav-tab-wrapper{display:none}.has-woocommerce-navigation.woocommerce_page_wc-reports .woocommerce .subsubsub,.has-woocommerce-navigation.woocommerce_page_wc-settings .woocommerce .subsubsub,.has-woocommerce-navigation.woocommerce_page_wc-status .woocommerce .subsubsub{font-size:14px;margin:5px 0}.has-woocommerce-navigation #wpcontent,.has-woocommerce-navigation #wpfooter{margin-left:0}@media(max-width:960px){.has-woocommerce-navigation #wpcontent,.has-woocommerce-navigation #wpfooter{margin-left:0}}.has-woocommerce-navigation #wpbody{padding-left:240px}@media(max-width:960px){.has-woocommerce-navigation #wpbody{padding-left:0}}.has-woocommerce-navigation .woocommerce-layout__header.is-embed-loading:before{content:"";position:fixed;width:240px;height:100%;background:#1e1e1e}@media(max-width:960px){.has-woocommerce-navigation .woocommerce-layout__header.is-embed-loading:before{width:60px;height:60px}}.has-woocommerce-navigation #woocommerce-embedded-root.is-embed-loading{margin-bottom:-32px}.has-woocommerce-navigation:not(.is-wp-toolbar-disabled) #wpbody-content{margin-top:32px}.has-woocommerce-navigation font>.xdebug-error{margin-top:60px}.woocommerce-navigation-category-title{display:flex;align-items:center;font-size:20px;line-height:28px}.woocommerce-navigation-category-title .woocommerce-navigation-favorite-button{margin-left:auto}.woocommerce-navigation-favorite-button.components-button .star-empty-icon{color:#949494}.woocommerce-navigation-favorite-button.components-button .star-filled-icon{color:#ffb900}.woocommerce-transient-notices{position:fixed;bottom:12px;left:176px;z-index:99999;width:auto}@media(max-width:960px){.woocommerce-transient-notices{left:50px}}@media(max-width:782px){.woocommerce-transient-notices{left:16px}}.woocommerce-profile-wizard__body .woocommerce-transient-notices{left:unset}.woocommerce-profile-wizard__body .woocommerce-transient-notices .components-snackbar{margin-left:auto;margin-right:auto}.has-woocommerce-navigation .woocommerce-transient-notices{left:256px}.components-snackbar.components-snackbar-explicit-dismiss{cursor:default}.components-snackbar .components-snackbar__content-with-icon{margin-left:32px}.components-snackbar .components-snackbar__icon{position:absolute;top:24px;left:26px}.components-snackbar .components-snackbar__dismiss-button{margin-left:32px;cursor:pointer}:root{--wp-admin-theme-color:#007cba;--wp-admin-theme-color-darker-10:#006ba1;--wp-admin-theme-color-darker-20:#005a87}body.admin-color-light{--wp-admin-theme-color:#0085ba;--wp-admin-theme-color-darker-10:#0073a1;--wp-admin-theme-color-darker-20:#006187}body.admin-color-modern{--wp-admin-theme-color:#3858e9;--wp-admin-theme-color-darker-10:#2145e6;--wp-admin-theme-color-darker-20:#183ad6}body.admin-color-blue{--wp-admin-theme-color:#096484;--wp-admin-theme-color-darker-10:#07526c;--wp-admin-theme-color-darker-20:#064054}body.admin-color-coffee{--wp-admin-theme-color:#46403c;--wp-admin-theme-color-darker-10:#383330;--wp-admin-theme-color-darker-20:#2b2724}body.admin-color-ectoplasm{--wp-admin-theme-color:#523f6d;--wp-admin-theme-color-darker-10:#46365d;--wp-admin-theme-color-darker-20:#3a2c4d}body.admin-color-midnight{--wp-admin-theme-color:#e14d43;--wp-admin-theme-color-darker-10:#dd382d;--wp-admin-theme-color-darker-20:#d02c21}body.admin-color-ocean{--wp-admin-theme-color:#627c83;--wp-admin-theme-color-darker-10:#576e74;--wp-admin-theme-color-darker-20:#4c6066}body.admin-color-sunrise{--wp-admin-theme-color:#dd823b;--wp-admin-theme-color-darker-10:#d97426;--wp-admin-theme-color-darker-20:#c36922}.woocommerce-embedded-layout__primary{padding:0 20px}.woocommerce-embedded-layout__primary .components-card__footer,.woocommerce-embedded-layout__primary .components-card__header{box-sizing:border-box}@media(max-width:782px){.woocommerce-embedded-layout__primary{padding:0}}woocommerce-admin/dist/app/index.js000064400000442707151335517650013372 0ustar00/*! For license information please see index.js.LICENSE.txt */
this.wc=this.wc||{},this.wc.app=function(e){function t(t){for(var n,r,i=t[0],a=t[1],c=0,s=[];c<i.length;c++)r=i[c],Object.prototype.hasOwnProperty.call(o,r)&&o[r]&&s.push(o[r][0]),o[r]=0;for(n in a)Object.prototype.hasOwnProperty.call(a,n)&&(e[n]=a[n]);for(u&&u(t);s.length;)s.shift()()}var n={},r={18:0},o={18:0};function i(e){var t=function(e){return a.p+"chunks/"+({4:"activity-panels-help",5:"activity-panels-inbox",6:"analytics-report",7:"analytics-report-categories",8:"analytics-report-coupons",9:"analytics-report-customers",10:"analytics-report-downloads",11:"analytics-report-orders",12:"analytics-report-products",13:"analytics-report-revenue",14:"analytics-report-stock",15:"analytics-report-taxes",16:"analytics-report-variations",17:"analytics-settings",24:"customizable-dashboard",25:"dashboard",26:"dashboard-charts",31:"homescreen",32:"leaderboards",34:"marketing-overview",45:"payment-recommendations",47:"profile-wizard",48:"shipping-recommendations",49:"store-alerts",50:"store-performance",51:"task-list",53:"wcpay-usage-modal"}[e]||e)+".js"}(e);return window.wcAdminAssets&&window.wcAdminAssets.version&&(t+="?ver="+window.wcAdminAssets.version),t}function a(t){if(n[t])return n[t].exports;var r=n[t]={i:t,l:!1,exports:{}};return e[t].call(r.exports,r,r.exports,a),r.l=!0,r.exports}a.e=function(e){var t=[];r[e]?t.push(r[e]):0!==r[e]&&{0:1,4:1,5:1,6:1,7:1,9:1,11:1,12:1,14:1,17:1,25:1,26:1,31:1,32:1,34:1,45:1,47:1,48:1,49:1,50:1,51:1}[e]&&t.push(r[e]=new Promise((function(t,n){for(var o="chunks/"+e+".style.css",i=a.p+o,c=document.getElementsByTagName("link"),s=0;s<c.length;s++){var l=(d=c[s]).getAttribute("data-href")||d.getAttribute("href");if("stylesheet"===d.rel&&(l===o||l===i))return t()}var u=document.getElementsByTagName("style");for(s=0;s<u.length;s++){var d;if((l=(d=u[s]).getAttribute("data-href"))===o||l===i)return t()}var m=document.createElement("link");m.rel="stylesheet",m.type="text/css",m.setAttribute("data-webpack",!0),m.onload=t,m.onerror=function(t){var o=t&&t.target&&t.target.src||i,a=new Error("Loading CSS chunk "+e+" failed.\n("+o+")");a.code="CSS_CHUNK_LOAD_FAILED",a.request=o,delete r[e],m.parentNode.removeChild(m),n(a)},m.href=i,window.wcAdminAssets&&window.wcAdminAssets.version&&(m.href+="?ver="+window.wcAdminAssets.version),document.getElementsByTagName("head")[0].appendChild(m)})).then((function(){r[e]=0})));var n=o[e];if(0!==n)if(n)t.push(n[2]);else{var c=new Promise((function(t,r){n=o[e]=[t,r]}));t.push(n[2]=c);var s,l=document.createElement("script");l.charset="utf-8",l.timeout=120,a.nc&&l.setAttribute("nonce",a.nc),l.src=i(e);var u=new Error;s=function(t){l.onerror=l.onload=null,clearTimeout(d);var n=o[e];if(0!==n){if(n){var r=t&&("load"===t.type?"missing":t.type),i=t&&t.target&&t.target.src;u.message="Loading chunk "+e+" failed.\n("+r+": "+i+")",u.name="ChunkLoadError",u.type=r,u.request=i,n[1](u)}o[e]=void 0}};var d=setTimeout((function(){s({type:"timeout",target:l})}),12e4);l.onerror=l.onload=s,document.head.appendChild(l)}return Promise.all(t)},a.m=e,a.c=n,a.d=function(e,t,n){a.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},a.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},a.t=function(e,t){if(1&t&&(e=a(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(a.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)a.d(n,r,function(t){return e[t]}.bind(null,r));return n},a.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return a.d(t,"a",t),t},a.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},a.p="",a.oe=function(e){throw console.error(e),e};var c=window.__wcAdmin_webpackJsonp=window.__wcAdmin_webpackJsonp||[],s=c.push.bind(c);c.push=t,c=c.slice();for(var l=0;l<c.length;l++)t(c[l]);var u=s;return a(a.s=279)}({0:function(e,t){e.exports=window.wp.element},1:function(e,t,n){e.exports=n(47)()},10:function(e,t){e.exports=window.wp.dataControls},101:function(e,t,n){"use strict";var r=Object.assign||function(e){for(var t,n=1;n<arguments.length;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e};Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t=e.size,n=void 0===t?24:t,o=e.onClick,i=(e.icon,e.className),c=function(e,t){var n={};for(var r in e)0<=t.indexOf(r)||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}(e,["size","onClick","icon","className"]),s=["gridicon","gridicons-cross-small",i,!1,!1,!1].filter(Boolean).join(" ");return a.default.createElement("svg",r({className:s,height:n,width:n,onClick:o},c,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"}),a.default.createElement("g",null,a.default.createElement("path",{d:"M17.705 7.705l-1.41-1.41L12 10.59 7.705 6.295l-1.41 1.41L10.59 12l-4.295 4.295 1.41 1.41L12 13.41l4.295 4.295 1.41-1.41L13.41 12l4.295-4.295z"})))};var o,i=n(5),a=(o=i)&&o.__esModule?o:{default:o};e.exports=t.default},103:function(e,t,n){"use strict";n.d(t,"a",(function(){return o})),n.d(t,"c",(function(){return i})),n.d(t,"b",(function(){return a}));var r=n(11);const o=5,i={page:1,per_page:1,status:"hold",_embed:1,_fields:["id"]};function a(e){const{getReviewsTotalCount:t,getReviewsError:n,isResolving:o}=e(r.REVIEWS_STORE_NAME),a=t(i),c=Boolean(n(i)),s=o("getReviewsTotalCount",[i]);return c||s&&void 0===a?null:a}},104:function(e,t,n){"use strict";e.exports=n(129)},11:function(e,t){e.exports=window.wc.data},116:function(e,t,n){"use strict";function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var o=n(22);var i=n(0);function a(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}t.a=function(e){var t=e.icon,n=e.size,c=void 0===n?24:n,s=function(e,t){if(null==e)return{};var n,r,i=Object(o.a)(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}(e,["icon","size"]);return Object(i.cloneElement)(t,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?a(Object(n),!0).forEach((function(t){r(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):a(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({width:c,height:c},s))}},117:function(e,t,n){"use strict";var r=n(2),o=n(30),i=n(13),a=n(0);const c=Object(i.f)("manageStock","no"),s=Object(a.lazy)(()=>Promise.all([n.e(0),n.e(13)]).then(n.bind(null,481))),l=Object(a.lazy)(()=>Promise.all([n.e(0),n.e(12)]).then(n.bind(null,477))),u=Object(a.lazy)(()=>Promise.all([n.e(0),n.e(16)]).then(n.bind(null,482))),d=Object(a.lazy)(()=>Promise.all([n.e(0),n.e(11)]).then(n.bind(null,483))),m=Object(a.lazy)(()=>Promise.all([n.e(0),n.e(7)]).then(n.bind(null,479))),p=Object(a.lazy)(()=>Promise.all([n.e(0),n.e(8)]).then(n.bind(null,484))),f=Object(a.lazy)(()=>Promise.all([n.e(0),n.e(15)]).then(n.bind(null,485))),h=Object(a.lazy)(()=>Promise.all([n.e(0),n.e(10)]).then(n.bind(null,486))),b=Object(a.lazy)(()=>n.e(14).then(n.bind(null,478))),v=Object(a.lazy)(()=>n.e(9).then(n.bind(null,480)));t.a=()=>{const e=[{report:"revenue",title:Object(r.__)("Revenue",'woocommerce'),component:s,navArgs:{id:"woocommerce-analytics-revenue"}},{report:"products",title:Object(r.__)("Products",'woocommerce'),component:l,navArgs:{id:"woocommerce-analytics-products"}},{report:"variations",title:Object(r.__)("Variations",'woocommerce'),component:u,navArgs:{id:"woocommerce-analytics-variations"}},{report:"orders",title:Object(r.__)("Orders",'woocommerce'),component:d,navArgs:{id:"woocommerce-analytics-orders"}},{report:"categories",title:Object(r.__)("Categories",'woocommerce'),component:m,navArgs:{id:"woocommerce-analytics-categories"}},{report:"coupons",title:Object(r.__)("Coupons",'woocommerce'),component:p,navArgs:{id:"woocommerce-analytics-coupons"}},{report:"taxes",title:Object(r.__)("Taxes",'woocommerce'),component:f,navArgs:{id:"woocommerce-analytics-taxes"}},"yes"===c?{report:"stock",title:Object(r.__)("Stock",'woocommerce'),component:b,navArgs:{id:"woocommerce-analytics-stock"}}:null,{report:"customers",title:Object(r.__)("Customers",'woocommerce'),component:v},{report:"downloads",title:Object(r.__)("Downloads",'woocommerce'),component:h,navArgs:{id:"woocommerce-analytics-downloads"}}].filter(Boolean);return Object(o.applyFilters)("woocommerce_admin_reports_list",e)}},118:function(e,t,n){"use strict";var r=n(104),o={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},i={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},a={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},c={};function s(e){return r.isMemo(e)?a:c[e.$$typeof]||o}c[r.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},c[r.Memo]=a;var l=Object.defineProperty,u=Object.getOwnPropertyNames,d=Object.getOwnPropertySymbols,m=Object.getOwnPropertyDescriptor,p=Object.getPrototypeOf,f=Object.prototype;e.exports=function e(t,n,r){if("string"!=typeof n){if(f){var o=p(n);o&&o!==f&&e(t,o,r)}var a=u(n);d&&(a=a.concat(d(n)));for(var c=s(t),h=s(n),b=0;b<a.length;++b){var v=a[b];if(!(i[v]||r&&r[v]||h&&h[v]||c&&c[v])){var g=m(n,v);try{l(t,v,g)}catch(e){}}}}return t}},119:function(e,t,n){"use strict";n.d(t,"c",(function(){return ht})),n.d(t,"b",(function(){return yt})),n.d(t,"a",(function(){return wt}));var r=n(35),o=n.n(r),i=n(0),a=n(3),c=n(14),s=n(7),l=n(25),u=n(5),d=n.n(u),m=n(1),p=n.n(m),f=n(52),h=n(160),b=n(41),v=n(23),g=n(161),y=n.n(g),w=(n(104),n(22)),O=(n(118),function(e){var t=Object(h.a)();return t.displayName=e,t}("Router-History")),j=function(e){var t=Object(h.a)();return t.displayName=e,t}("Router"),_=function(e){function t(t){var n;return(n=e.call(this,t)||this).state={location:t.history.location},n._isMounted=!1,n._pendingLocation=null,t.staticContext||(n.unlisten=t.history.listen((function(e){n._isMounted?n.setState({location:e}):n._pendingLocation=e}))),n}Object(l.a)(t,e),t.computeRootMatch=function(e){return{path:"/",url:"/",params:{},isExact:"/"===e}};var n=t.prototype;return n.componentDidMount=function(){this._isMounted=!0,this._pendingLocation&&this.setState({location:this._pendingLocation})},n.componentWillUnmount=function(){this.unlisten&&this.unlisten()},n.render=function(){return d.a.createElement(j.Provider,{value:{history:this.props.history,location:this.state.location,match:t.computeRootMatch(this.state.location.pathname),staticContext:this.props.staticContext}},d.a.createElement(O.Provider,{children:this.props.children||null,value:this.props.history}))},t}(d.a.Component);d.a.Component;d.a.Component;var E={},k=0;function x(e,t){void 0===t&&(t={}),("string"==typeof t||Array.isArray(t))&&(t={path:t});var n=t,r=n.path,o=n.exact,i=void 0!==o&&o,a=n.strict,c=void 0!==a&&a,s=n.sensitive,l=void 0!==s&&s;return[].concat(r).reduce((function(t,n){if(!n&&""!==n)return null;if(t)return t;var r=function(e,t){var n=""+t.end+t.strict+t.sensitive,r=E[n]||(E[n]={});if(r[e])return r[e];var o=[],i={regexp:y()(e,o,t),keys:o};return k<1e4&&(r[e]=i,k++),i}(n,{end:i,strict:c,sensitive:l}),o=r.regexp,a=r.keys,s=o.exec(e);if(!s)return null;var u=s[0],d=s.slice(1),m=e===u;return i&&!m?null:{path:n,url:"/"===n&&""===u?"/":u,isExact:m,params:a.reduce((function(e,t,n){return e[t.name]=d[n],e}),{})}}),null)}var S=function(e){function t(){return e.apply(this,arguments)||this}return Object(l.a)(t,e),t.prototype.render=function(){var e=this;return d.a.createElement(j.Consumer,null,(function(t){t||Object(b.a)(!1);var n=e.props.location||t.location,r=e.props.computedMatch?e.props.computedMatch:e.props.path?x(n.pathname,e.props):t.match,o=Object(v.a)({},t,{location:n,match:r}),i=e.props,a=i.children,c=i.component,s=i.render;return Array.isArray(a)&&0===a.length&&(a=null),d.a.createElement(j.Provider,{value:o},o.match?a?"function"==typeof a?a(o):a:c?d.a.createElement(c,o):s?s(o):null:"function"==typeof a?a(o):null)}))},t}(d.a.Component);function C(e){return"/"===e.charAt(0)?e:"/"+e}function T(e,t){if(!e)return t;var n=C(e);return 0!==t.pathname.indexOf(n)?t:Object(v.a)({},t,{pathname:t.pathname.substr(n.length)})}function A(e){return"string"==typeof e?e:Object(f.d)(e)}function P(e){return function(){Object(b.a)(!1)}}function N(){}d.a.Component;var R=function(e){function t(){return e.apply(this,arguments)||this}return Object(l.a)(t,e),t.prototype.render=function(){var e=this;return d.a.createElement(j.Consumer,null,(function(t){t||Object(b.a)(!1);var n,r,o=e.props.location||t.location;return d.a.Children.forEach(e.props.children,(function(e){if(null==r&&d.a.isValidElement(e)){n=e;var i=e.props.path||e.props.from;r=i?x(o.pathname,Object(v.a)({},e.props,{path:i})):t.match}})),r?d.a.cloneElement(n,{location:o,computedMatch:r}):null}))},t}(d.a.Component);d.a.useContext;var M=n(4),L=n(32),V=n(21),I=n(12),F=n(13),D=n(11),z=n(16),B=(n(282),n(88)),U=(n(283),n(30)),H=n(2),q=n(117),$=n(60);const W=Object(i.lazy)(()=>n.e(6).then(n.bind(null,605))),Q=Object(i.lazy)(()=>n.e(17).then(n.bind(null,614))),G=Object(i.lazy)(()=>n.e(25).then(n.bind(null,606))),Y=Object(i.lazy)(()=>Promise.all([n.e(1),n.e(2),n.e(31)]).then(n.bind(null,612))),Z=Object(i.lazy)(()=>Promise.all([n.e(2),n.e(34)]).then(n.bind(null,615))),K=Object(i.lazy)(()=>Promise.all([n.e(1),n.e(47)]).then(n.bind(null,613))),J=Object(i.lazy)(()=>Promise.all([n.e(1),n.e(47)]).then(n.bind(null,607))),X=()=>{const e=[],t=[["",Object(F.f)("woocommerceTranslation")]];return e.push({container:Y,path:"/",breadcrumbs:[...t,Object(H.__)("Home",'woocommerce')],wpOpenMenu:"toplevel_page_woocommerce",navArgs:{id:"woocommerce-home"},capability:"manage_woocommerce"}),window.wcAdminFeatures.analytics&&(e.push({container:G,path:"/analytics/overview",breadcrumbs:[...t,["/analytics/overview",Object(H.__)("Analytics",'woocommerce')],Object(H.__)("Overview",'woocommerce')],wpOpenMenu:"toplevel_page_wc-admin-path--analytics-overview",navArgs:{id:"woocommerce-analytics-overview"},capability:"view_woocommerce_reports"}),e.push({container:Q,path:"/analytics/settings",breadcrumbs:[...t,["/analytics/revenue",Object(H.__)("Analytics",'woocommerce')],Object(H.__)("Settings",'woocommerce')],wpOpenMenu:"toplevel_page_wc-admin-path--analytics-overview",navArgs:{id:"woocommerce-analytics-settings"},capability:"view_woocommerce_reports"}),e.push({container:W,path:"/customers",breadcrumbs:[...t,Object(H.__)("Customers",'woocommerce')],wpOpenMenu:"toplevel_page_woocommerce",navArgs:{id:"woocommerce-analytics-customers"},capability:"view_woocommerce_reports"}),e.push({container:W,path:"/analytics/:report",breadcrumbs:({match:e})=>{const n=Object(M.find)(Object(q.a)(),{report:e.params.report});return n?[...t,["/analytics/revenue",Object(H.__)("Analytics",'woocommerce')],n.title]:[]},wpOpenMenu:"toplevel_page_wc-admin-path--analytics-overview",capability:"view_woocommerce_reports"})),window.wcAdminFeatures.marketing&&e.push({container:Z,path:"/marketing",breadcrumbs:[...t,["/marketing",Object(H.__)("Marketing",'woocommerce')],Object(H.__)("Overview",'woocommerce')],wpOpenMenu:"toplevel_page_woocommerce-marketing",navArgs:{id:"woocommerce-marketing-overview"},capability:"view_woocommerce_reports"}),window.wcAdminFeatures.onboarding&&e.push({container:K,path:"/setup-wizard",breadcrumbs:[...t,["/setup-wizard",Object(H.__)("Setup Wizard",'woocommerce')]],capability:"manage_woocommerce"}),window.wcAdminFeatures.settings&&e.push({container:J,path:"/settings/:page",breadcrumbs:({match:e})=>{const n=Object(F.f)("settingsPages"),r=n[e.params.page];return r?[...t,[n.general?"/settings/general":"/settings/"+Object.keys(n)[0],Object(H.__)("Settings",'woocommerce')],r]:[]},wpOpenMenu:"toplevel_page_woocommerce",capability:"manage_woocommerce"}),Object(U.applyFilters)("woocommerce_admin_pages_list",e)};class ee extends i.Component{componentDidMount(){window.document.documentElement.scrollTop=0,window.document.body.classList.remove("woocommerce-admin-is-loading")}componentDidUpdate(e){const t=Object(M.omit)(e.query,"chartType","filter","paged"),n=Object(M.omit)(this.props.query,"chartType","filter","paged");e.query.paged>1&&!Object(M.isEqual)(t,n)&&Object(I.getHistory)().replace(Object(I.getNewPath)({paged:1})),e.match.url!==this.props.match.url&&(window.document.documentElement.scrollTop=0)}render(){const{page:e,match:t,query:n}=this.props,{url:r,params:o}=t;return window.wpNavMenuUrlUpdate(n),window.wpNavMenuClassChange(e,r),Object(i.createElement)(i.Suspense,{fallback:Object(i.createElement)(V.Spinner,null)},Object(i.createElement)(e.container,{params:o,path:r,pathMatch:e.path,query:n}))}}window.wpNavMenuUrlUpdate=function(e){const t=Object(I.getPersistedQuery)(e),n=Object(I.getQueryExcludedScreens)();Array.from(document.querySelectorAll("#adminmenu a")).forEach(e=>function(e,t,n){if(Object($.f)(e.href)){const r=Object(M.last)(e.href.split("?")),o=Object(L.parse)(r),i=o.path||"homescreen",a=Object(I.getScreenFromPath)(i),c=n.includes(a),s="admin.php?"+Object(L.stringify)(Object.assign(o,c?{}:t));e.href=s,e.onclick=e=>{e.preventDefault(),Object(I.getHistory)().push(s)}}}(e,t,n))},window.wpNavMenuClassChange=function(e,t){Array.from(document.getElementsByClassName("current")).forEach((function(e){e.classList.remove("current")}));Array.from(document.querySelectorAll(".wp-has-current-submenu")).forEach((function(e){e.classList.remove("wp-has-current-submenu"),e.classList.remove("wp-menu-open"),e.classList.remove("selected"),e.classList.add("wp-not-current-submenu"),e.classList.add("menu-top")}));const n="/"===t?"admin.php?page=wc-admin":"admin.php?page=wc-admin&path="+encodeURIComponent(t),r="/"===t?`li > a[href$="${n}"], li > a[href*="${n}?"]`:`li > a[href*="${n}"]`,o=document.querySelectorAll(r);if(Array.from(o).forEach((function(e){e.parentElement.classList.add("current")})),e.wpOpenMenu){const t=document.querySelector("#"+e.wpOpenMenu);t&&(t.classList.remove("wp-not-current-submenu"),t.classList.add("wp-has-current-submenu"),t.classList.add("wp-menu-open"),t.classList.add("current"))}document.querySelector("#wpwrap").classList.remove("wp-responsive-open")};var te=n(6),ne=n.n(te),re=n(28),oe=n(20),ie=n(116),ae=n(291),ce=n(27),se=(n(284),n(8)),le=Object(i.createElement)(se.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(i.createElement)(se.Path,{fillRule:"evenodd",d:"M6 5.5h12a.5.5 0 01.5.5v7H14a2 2 0 11-4 0H5.5V6a.5.5 0 01.5-.5zm-.5 9V18a.5.5 0 00.5.5h12a.5.5 0 00.5-.5v-3.5h-3.337a3.5 3.5 0 01-6.326 0H5.5zM4 13V6a2 2 0 012-2h12a2 2 0 012 2v12a2 2 0 01-2 2H6a2 2 0 01-2-2v-5z",clipRule:"evenodd"})),ue=Object(i.createElement)(se.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(i.createElement)(se.Path,{d:"M12 4.75a7.25 7.25 0 100 14.5 7.25 7.25 0 000-14.5zM3.25 12a8.75 8.75 0 1117.5 0 8.75 8.75 0 01-17.5 0zM12 8.75a1.5 1.5 0 01.167 2.99c-.465.052-.917.44-.917 1.01V14h1.5v-.845A3 3 0 109 10.25h1.5a1.5 1.5 0 011.5-1.5zM11.25 15v1.5h1.5V15h-1.5z"})),de=n(500),me=(n(285),n(164));const pe={page:1,per_page:D.QUERY_DEFAULTS.pageSize,status:"unactioned",type:D.QUERY_DEFAULTS.noteTypes,orderby:"date",order:"desc"};function fe(e){const{getNotes:t,getNotesError:n,isResolving:r}=e(D.NOTES_STORE_NAME),{getCurrentUser:o}=e(D.USER_STORE_NAME),i=o(),a=parseInt(i&&i.woocommerce_meta&&i.woocommerce_meta.activity_panel_inbox_last_read,10);if(!a)return null;t(pe);const c=Boolean(n("getNotes",[pe])),s=r("getNotes",[pe]);if(c||s)return null;const l=t(pe);return Object(me.a)(l,a)>0}const he=({icon:e,title:t,name:n,unread:r,selected:o,isPanelOpen:c,onTabClick:s})=>{const l=ne()("woocommerce-layout__activity-panel-tab",{"is-active":c&&o,"has-unread":r}),u="activity-panel-tab-"+n;return Object(i.createElement)(a.Button,{role:"tab",className:l,"aria-selected":o,"aria-controls":"activity-panel-"+n,key:u,id:u,onClick:()=>{s(n)}},e,t," ",r&&Object(i.createElement)("span",{className:"screen-reader-text"},Object(H.__)("unread activity",'woocommerce')))},be=({tabs:e,onTabClick:t,selectedTab:n,tabOpen:r=!1})=>{const[{tabOpen:c,currentTab:s},l]=Object(i.useState)({tabOpen:r,currentTab:n});return Object(i.useEffect)(()=>{l({tabOpen:r,currentTab:n})},[r,n]),Object(i.createElement)(a.NavigableMenu,{role:"tablist",orientation:"horizontal",className:"woocommerce-layout__activity-panel-tabs"},e&&e.map((e,n)=>{if(e.component){const{component:t,options:r}=e;return Object(i.createElement)(t,o()({key:n},r))}return Object(i.createElement)(he,o()({key:n,index:n,isPanelOpen:c,selected:s===e.name},e,{onTabClick:()=>{const n=s!==e.name&&""!==s||!c;n&&s===e.name||Object(z.recordEvent)("activity_panel_open",{tab:e.name}),l({tabOpen:n,currentTab:e.name}),t(e,n)}}))}))},ve=()=>Object(i.createElement)("svg",{className:"woocommerce-layout__activity-panel-tab-icon setup-progress",width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Object(i.createElement)("path",{d:"M12 20C16.4183 20 20 16.4183 20 12C20 7.58172 16.4183 4 12 4C7.58172 4 4 7.58172 4 12C4 16.4183 7.58172 20 12 20Z",stroke:"#DCDCDE",strokeWidth:"2"}),Object(i.createElement)("path",{d:"M4 12V12C4 16.4183 7.58172 20 12 20V20C16.4183 20 20 16.4183 20 12V12C20 7.58172 16.4183 4 12 4V4",strokeWidth:"2",strokeLinecap:"round"}));var ge=n(253),ye=n(497);n(286);const we="highlight-tooltip__show";function Oe({title:e,closeButtonText:t,content:n,show:r=!0,id:o,onClose:c,delay:s,onShow:l=M.noop,useAnchor:u=!1}){const[d,m]=Object(i.useState)(s>0?null:r),[p,f]=Object(i.useState)(null),[h,b]=Object(i.useState)(null);function v(){if(u){const e=document.getElementById(o);b(e.getBoundingClientRect())}}Object(i.useEffect)(()=>{const e=document.getElementById(o);let t,n;e&&!p&&(u?(n=document.createElement("div"),document.body.appendChild(n)):n=e.parentElement,t=document.createElement("div"),t.classList.add("highlight-tooltip__container"),n.appendChild(t),f(t));const r=g(t);return()=>{if(t){const e=t.parentElement;e.removeChild(t),u&&e.remove()}r&&clearTimeout(r)}},[]),Object(i.useEffect)(()=>{!d&&p&&p.classList.remove(we)},[d]),Object(i.useEffect)(()=>{r!==d&&null!==d&&p&&(m(r),r?p&&g(p):p.classList.remove(we))},[r]),Object(i.useLayoutEffect)(()=>(window.addEventListener("resize",v),()=>window.removeEventListener("resize",v)),[]);const g=e=>{let t=null;return s>0?t=setTimeout(()=>{t=null,y(e)},s):d||y(e),t},y=e=>{const t=document.getElementById(o);t&&u&&b(t.getBoundingClientRect()),e&&e.classList.add(we),m(!0),l()},w=()=>{m(!1),c&&c()};return p?Object(i.createPortal)(Object(i.createElement)("div",{className:"highlight-tooltip__portal"},d?Object(i.createElement)(i.Fragment,null,Object(i.createElement)(a.IsolatedEventContainer,{className:"highlight-tooltip__overlay"}),Object(i.createElement)(a.Popover,{className:"highlight-tooltip__popover",noArrow:!1,anchorRect:h,focusOnMount:"container"},Object(i.createElement)(a.Card,{size:"medium"},Object(i.createElement)(a.CardHeader,null,e,Object(i.createElement)(a.Button,{isSmall:!0,onClick:w,icon:ye.a})),Object(i.createElement)(a.CardBody,null,n||null),Object(i.createElement)(a.CardFooter,{isBorderless:!0},Object(i.createElement)(a.Button,{size:"small",isPrimary:!0,onClick:w},t||Object(H.__)("Close",'woocommerce')))))):null),p):null}Oe.propTypes={id:p.a.string.isRequired,title:p.a.string.isRequired,closeButtonText:p.a.string.isRequired,content:p.a.oneOfType([p.a.string,p.a.node]),show:p.a.bool,onClose:p.a.func,delay:p.a.number,onShow:p.a.func,useAnchor:p.a.bool};var je=n(91);const _e=["button","submit"];function Ee(e){const t=Object(i.useRef)(e);Object(i.useEffect)(()=>{t.current=e},[e]);const n=Object(i.useRef)(!1),r=Object(i.useRef)(),o=Object(i.useCallback)(()=>{clearTimeout(r.current)},[]);Object(i.useEffect)(()=>()=>o(),[]),Object(i.useEffect)(()=>{e||o()},[e,o]);const a=Object(i.useCallback)(e=>{const{type:t,target:r}=e;Object(M.includes)(["mouseup","touchend"],t)?n.current=!1:function(e){if(!(e instanceof window.HTMLElement))return!1;switch(e.nodeName){case"A":case"BUTTON":return!0;case"INPUT":return Object(M.includes)(_e,e.type)}return!1}(r)&&(n.current=!0)},[]),c=Object(i.useCallback)(e=>{e.persist(),n.current||(r.current=setTimeout(()=>{document.hasFocus()?"function"==typeof t.current&&t.current(e):e.preventDefault()},0))},[]);return{onFocus:o,onMouseDown:a,onMouseUp:a,onTouchStart:a,onTouchEnd:a,onBlur:c}}const ke=({content:e,isPanelOpen:t,isPanelSwitching:n,currentTab:r,tab:a,closePanel:c,clearPanel:s})=>{const l="woocommerce-layout__activity-panel-wrapper",u=function(e="firstElement"){const t=Object(i.useRef)(e);return Object(i.useEffect)(()=>{t.current=e},[e]),Object(i.useCallback)(e=>{if(!e||!1===t.current)return;if(e.contains(e.ownerDocument.activeElement))return;let n=e;if("firstElement"===t.current){const t=je.focus.tabbable.find(e)[0];t&&(n=t)}n.focus()},[])}(),d=Ee(e=>{const n=e.relatedTarget&&(e.relatedTarget.closest(".woocommerce-inbox-dismiss-confirmation_modal")||e.relatedTarget.closest(".components-snackbar__action"));t&&!n&&c()}),m=Object(i.useRef)(null),p=Object(i.useCallback)(e=>{m.current=e,u(e)},[]);if(!a)return Object(i.createElement)("div",{className:l});if(!e)return null;const f=ne()(l,{"is-open":t,"is-switching":n});return Object(i.createElement)("div",o()({className:f,tabIndex:0,role:"tabpanel","aria-label":a.title,onTransitionEnd:e=>{e&&"transform"===e.propertyName&&(s(),m.current&&t&&a&&u(m.current))}},d,{ref:p}),Object(i.createElement)("div",{className:"woocommerce-layout__activity-panel-content",key:"activity-panel-"+r,id:"activity-panel-"+r},Object(i.createElement)(i.Suspense,{fallback:Object(i.createElement)(V.Spinner,null)},e)))};var xe=n(66),Se=n(103),Ce=n(254);const Te=Object(i.lazy)(()=>n.e(4).then(n.bind(null,619))),Ae=Object(i.lazy)(()=>Promise.all([n.e(2),n.e(5)]).then(n.bind(null,608))),Pe=({isEmbedded:e,query:t,userPreferencesData:n})=>{const[r,o]=Object(i.useState)(""),[a,c]=Object(i.useState)(!1),[l,u]=Object(i.useState)(!1),[d,m]=Object(i.useState)(!1),{fills:p}=Object(oe.useSlot)(Ce.a),f=Boolean(null==p?void 0:p.length),h=(e,n)=>{let r={};if("wc-admin"===t.page&&"appearance"===t.task){var o;const{getTasksStatus:t}=e(D.ONBOARDING_STORE_NAME),i=t();r={set_notice:n("woocommerce_demo_store_notice")?"Y":"N",create_homepage:!0===i.hasHomepage?"Y":"N",upload_logo:null!==(o=i.themeMods)&&void 0!==o&&o.custom_logo?"Y":"N"}}return r};function b(e,t,n){const r=Object(xe.c)(e),o=!(!t||!l)&&Object(xe.d)(e,r)>0,i=!(!t||!l)&&Object(Se.b)(e),a=!(!t||!l)&&Object(xe.a)(e);return n>0||o||i||a||f}const{hasUnreadNotes:v,hasAbbreviatedNotifications:g,thingsToDoNextCount:y,requestingTaskListOptions:w,setupTaskListComplete:O,setupTaskListHidden:j,trackedCompletedTasks:_,previewSiteBtnTrackData:E}=Object(s.useSelect)(e=>{const{getOption:n,isResolving:r}=e(D.OPTIONS_STORE_NAME),o="yes"===n("woocommerce_task_list_hidden"),i="yes"===n("woocommerce_extended_task_list_hidden"),a=function(e,t,n){return!e||n?0:e.filter(e=>e.visible&&!e.completed&&!t.includes(e.key)).length}(Object(U.applyFilters)("woocommerce_admin_onboarding_task_list",[],t),n("woocommerce_task_list_dismissed_tasks")||[],i);return{hasUnreadNotes:fe(e),hasAbbreviatedNotifications:b(e,o,a),thingsToDoNextCount:a,requestingTaskListOptions:r("getOption",["woocommerce_task_list_complete"])||r("getOption",["woocommerce_task_list_hidden"]),setupTaskListComplete:"yes"===n("woocommerce_task_list_complete"),setupTaskListHidden:o,trackedCompletedTasks:n("woocommerce_task_list_tracked_completed_tasks")||[],previewSiteBtnTrackData:h(e,n)}}),{updateOptions:k}=Object(s.useDispatch)(D.OPTIONS_STORE_NAME),{currentUserCan:x}=Object(D.useUser)(),S=()=>"wc-admin"===t.page&&!t.path,C=()=>t.task&&!t.path&&(!0===w||!1===j&&!1===O),T=()=>{Object($.f)(window.location.href)?Object(I.getHistory)().push(Object(I.getNewPath)({},"/",{})):window.location.href=Object(F.e)("admin.php?page=wc-admin")},A=()=>{const n={name:"inbox",title:Object(H.__)("Inbox",'woocommerce'),icon:Object(i.createElement)(ie.a,{icon:le}),unread:v||g,visible:(e||!S())&&!C()},r={name:"setup",title:Object(H.__)("Finish setup",'woocommerce'),icon:Object(i.createElement)(ve,null),onClick:()=>(window.location.href!==Object(F.e)("admin.php?page=wc-admin")&&("no"===j?T():k({woocommerce_task_list_hidden:"no"}).then(T)),null),visible:x("manage_woocommerce")&&!O&&!j&&!C()&&(!S()||e)},o={name:"help",title:Object(H.__)("Help",'woocommerce'),icon:Object(i.createElement)(ie.a,{icon:ue}),visible:S()&&!e||C()},a={component:ge.b,visible:!e&&S()&&!C()};return[n,r,{name:"previewSite",title:Object(H.__)("Preview site",'woocommerce'),icon:Object(i.createElement)(ie.a,{icon:de.a}),visible:"wc-admin"===t.page&&"appearance"===t.task,onClick:()=>(window.open(Object(F.f)("siteUrl")),Object(z.recordEvent)("wcadmin_tasklist_previewsite",E),null)},a,o].filter(e=>e.visible)},P=A(),N=Object(M.uniqueId)("activity-panel-header_"),R=(()=>{const{task:e}=t,r=n&&n.task_list_tracked_started_tasks,o=n&&n.help_panel_highlight_shown;return!(!(e&&"yes"!==o&&(r||{})[e]>1)||_.includes(e))})();return Object(i.createElement)("div",null,Object(i.createElement)(V.H,{id:N,className:"screen-reader-text"},Object(H.__)("Store Activity",'woocommerce')),Object(i.createElement)(V.Section,{component:"aside",id:"woocommerce-activity-panel",className:"woocommerce-layout__activity-panel","aria-labelledby":N},Object(i.createElement)(be,{tabs:P,tabOpen:l,selectedTab:r,onTabClick:(e,t)=>{e.onClick?e.onClick():(({name:e},t)=>{const n=e!==r&&""!==r&&t&&l;a||(o(e),u(t),m(n))})(e,t)}}),Object(i.createElement)(ke,{currentTab:!0,isPanelOpen:l,isPanelSwitching:d,tab:Object(M.find)(A(),{name:r}),content:(e=>{const{task:n}=t;switch(e){case"inbox":return Object(i.createElement)(Ae,{hasAbbreviatedNotifications:g,thingsToDoNextCount:y});case"help":return Object(i.createElement)(Te,{taskName:n});default:return null}})(r),closePanel:()=>(c(!0),void u(!1)),clearPanel:()=>{l||(c(!1),m(!1),o(""))}})),R?Object(i.createElement)(Oe,{delay:1e3,useAnchor:!0,title:Object(H.__)("We're here for help",'woocommerce'),content:Object(H.__)("If you have any questions, feel free to explore the WooCommerce docs listed here.",'woocommerce'),closeButtonText:Object(H.__)("Got it",'woocommerce'),id:"activity-panel-tab-help",onClose:()=>(Object(z.recordEvent)("help_tooltip_click"),void(n&&n.updateUserPreferences&&n.updateUserPreferences({help_panel_highlight_shown:"yes"}))),onShow:()=>Object(z.recordEvent)("help_tooltip_view")}):null)};Pe.defaultProps={getHistory:I.getHistory};var Ne=Pe,Re=n(101),Me=n.n(Re);const Le=()=>/iPhone|iPad|iPod/i.test(window.navigator.userAgent)?"ios":/Android/i.test(window.navigator.userAgent)?"android":"unknown",Ve=()=>Object(i.createElement)("svg",{width:"37",height:"37",viewBox:"0 0 92 92",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Object(i.createElement)("rect",{width:"92",height:"92",rx:"21.3953",fill:"#7F54B3"}),Object(i.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M72.5937 28.043H19.8094C16.4781 28.0459 13.7783 30.7705 13.7754 34.1324V54.4501C13.7783 57.812 16.4781 60.5366 19.8094 60.5395H44.8229L56.2573 66.9607L53.6672 60.5395H72.599C74.2009 60.5402 75.7374 59.8983 76.8702 58.7552C78.0029 57.612 78.639 56.0614 78.6383 54.4447V34.1324C78.6376 32.5157 78.0002 30.9657 76.8664 29.8235C75.7327 28.6814 74.1956 28.0408 72.5937 28.043ZM19.1057 32.4208C18.4658 32.4324 17.8646 32.7359 17.467 33.2482C17.0888 33.7635 16.9404 34.4175 17.058 35.0502C18.5962 45.0986 20.0338 51.8757 21.371 55.3816C21.8779 56.658 22.4896 57.2703 23.2063 57.2185C24.3075 57.1489 25.6263 55.5968 27.1627 52.5621C27.9964 50.8412 29.2602 48.2662 30.9539 44.837C32.3785 49.88 34.309 53.6787 36.7456 56.2331C37.4291 56.9436 38.1204 57.2748 38.8195 57.2266C39.4185 57.1931 39.953 56.8315 40.217 56.2813C40.4753 55.7358 40.5806 55.1278 40.5211 54.5248C40.3516 52.0703 40.5919 48.667 41.2421 44.3149C41.9081 39.8057 42.7523 36.5818 43.7749 34.6432C43.9822 34.2526 44.0733 33.8087 44.037 33.366C44.0039 32.7587 43.7116 32.1969 43.2374 31.829C42.7745 31.4367 42.1799 31.2446 41.5803 31.2935C40.8334 31.3325 40.1682 31.7885 39.8499 32.4797C38.2331 35.5019 37.0812 40.4109 36.3943 47.2068C35.2823 44.2394 34.4509 41.1703 33.9114 38.0412C33.623 36.4613 32.9037 35.7125 31.7536 35.7946C30.9592 35.8589 30.3063 36.3944 29.7819 37.4012L24.0348 48.5643C23.0997 44.6692 22.2205 39.9289 21.3972 34.3433C21.1997 32.9652 20.4358 32.3244 19.1057 32.4208ZM69.9089 34.6877C71.6969 35.0381 73.2407 36.2 74.1186 37.8559C74.9693 39.3247 75.3946 41.1161 75.3946 43.23C75.4148 45.9567 74.7062 48.6357 73.3477 50.9687C71.7778 53.7023 69.7195 55.0691 67.1727 55.0691C66.6933 55.0668 66.2153 55.0128 65.7467 54.9078C63.9584 54.5581 62.4143 53.396 61.5371 51.7396C60.6864 50.2452 60.261 48.4411 60.261 46.3272C60.2357 43.6127 60.945 40.9454 62.3079 38.6295C63.9023 35.8959 65.9607 34.5291 68.4829 34.5291C68.9623 34.5304 69.4402 34.5836 69.9089 34.6877ZM68.7937 49.4848C69.7707 48.5773 70.4399 47.2269 70.8012 45.4337V45.4419C70.9315 44.7826 70.9959 44.1112 70.9933 43.4382C70.986 42.5849 70.8291 41.74 70.5302 40.9452C70.1443 39.901 69.6304 39.3124 68.9884 39.1793C68.0378 38.9643 67.1239 39.5256 66.2469 40.8632C65.5812 41.8393 65.109 42.9432 64.8577 44.1106C64.7276 44.7708 64.6632 45.4432 64.6657 46.1171C64.6739 46.9677 64.8308 47.8096 65.1287 48.6019C65.5146 49.6388 66.0294 50.2274 66.6731 50.3678C67.3169 50.5081 68.0237 50.2138 68.7937 49.4848ZM57.9079 37.8559C57.0291 36.2008 55.4854 35.0392 53.6976 34.6877C53.2279 34.5837 52.749 34.5306 52.2687 34.5291C49.7443 34.5291 47.6856 35.8959 46.0927 38.6295C44.7295 40.9454 44.0201 43.6127 44.0454 46.3272C44.0454 48.4411 44.4699 50.2452 45.319 51.7396C46.1976 53.3949 47.7414 54.5566 49.5294 54.9078C49.999 55.0126 50.4779 55.0667 50.9582 55.0691C53.5055 55.0691 55.5642 53.7023 57.1343 50.9687C58.4922 48.6355 59.2001 45.9565 59.1789 43.23C59.1789 41.1161 58.7544 39.3247 57.9053 37.8559H57.9079ZM54.5903 45.4337C54.2307 47.2269 53.5614 48.5773 52.5825 49.4848C51.8115 50.2065 51.101 50.5017 50.4589 50.3678C49.8169 50.2338 49.3011 49.6461 48.9169 48.6019C48.6181 47.8097 48.4603 46.9678 48.4511 46.1171C48.4495 45.4431 48.5148 44.7707 48.6459 44.1106C48.8971 42.9432 49.3694 41.8393 50.0353 40.8632C50.9124 39.5256 51.8264 38.9643 52.7773 39.1793C53.4193 39.3124 53.9333 39.901 54.3193 40.9452C54.617 41.7404 54.7739 42.585 54.7824 43.4382C54.785 44.1112 54.7207 44.7826 54.5903 45.4419V45.4337Z",fill:"white"}));n(287);const Ie=({onInstall:e,onDismiss:t})=>{Object(i.useEffect)(()=>{const e=document.getElementsByClassName("woocommerce-layout")[0];return"android"===Le()&&e&&e.classList.add("woocommerce-layout__show-app-banner"),()=>{e&&e.classList.remove("woocommerce-layout__show-app-banner")}},[]);const[n,r]=Object(i.useState)(!1);return"android"!==Le()||n?null:Object(i.createElement)("div",{className:"woocommerce-mobile-app-banner"},Object(i.createElement)(ie.a,{icon:Object(i.createElement)(Me.a,{"data-testid":"dismiss-btn"}),onClick:()=>{t(),r(!0),Object(z.recordEvent)("wcadmin_mobile_android_banner_click",{action:"dismiss"})}}),Object(i.createElement)(Ve,null),Object(i.createElement)("div",{className:"woocommerce-mobile-app-banner__description"},Object(i.createElement)("p",{className:"woocommerce-mobile-app-banner__description__text"},Object(H.__)("Run your store from anywhere",'woocommerce')),Object(i.createElement)("p",{className:"woocommerce-mobile-app-banner__description__text"},Object(H.__)("Download the WooCommerce app",'woocommerce'))),Object(i.createElement)(a.Button,{href:"https://play.google.com/store/apps/details?id=com.woocommerce.android",isSecondary:!0,onClick:()=>{e(),r(!0),Object(z.recordEvent)("wcadmin_mobile_android_banner_click",{action:"install"})}},Object(H.__)("Install",'woocommerce')))};function Fe(){const[e,t]=Object(i.useState)(!1),n=Object(i.useRef)(null);return Object(i.useEffect)(()=>{const e=()=>{t(window.pageYOffset>20)},r=()=>{n.current=window.requestAnimationFrame(e)};return window.addEventListener("scroll",r),()=>{window.removeEventListener("scroll",r),window.cancelAnimationFrame(n.current)}},[]),e}n(288);const De=(e,t,n=null)=>{if(!t)return 0;const r=0===(o=t).indexOf("http")?o:Object(F.e)(o);var o;const{href:i}=e;if(r===i)return Number.MAX_SAFE_INTEGER;const a=(e=>{const t=e.replace(/[-\/\\^$*+?.()|[\]{}]/gi,"\\$&"),[n,r,o]=t.split(/\\\?|#/),i=o?`(.*#${o}$)`:"";return"^"+n+(r?r.split("&").reduce((e,t)=>`${e}(?=.*[?|&]${t}(&|$|#))`,""):"")+i})(r),c=new RegExp(n||a,"i");return(decodeURIComponent(i).match(c)||[]).length},ze=e=>{let t=null,n=0;return e.forEach(e=>{const r=De(window.location,e.url,e.matchExpression);r>0&&r>=n&&(n=r,t=e)}),t||null},Be=["primary","favorites","plugins","secondary"],Ue={woocommerce:{id:"woocommerce",isCategory:!0,menuId:"primary",migrate:!0,order:10,parent:"",title:"WooCommerce"}};var He=Object(i.createElement)(se.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"-2 -2 24 24"},Object(i.createElement)(se.Path,{d:"M20 10c0-5.51-4.49-10-10-10C4.48 0 0 4.49 0 10c0 5.52 4.48 10 10 10 5.51 0 10-4.48 10-10zM7.78 15.37L4.37 6.22c.55-.02 1.17-.08 1.17-.08.5-.06.44-1.13-.06-1.11 0 0-1.45.11-2.37.11-.18 0-.37 0-.58-.01C4.12 2.69 6.87 1.11 10 1.11c2.33 0 4.45.87 6.05 2.34-.68-.11-1.65.39-1.65 1.58 0 .74.45 1.36.9 2.1.35.61.55 1.36.55 2.46 0 1.49-1.4 5-1.4 5l-3.03-8.37c.54-.02.82-.17.82-.17.5-.05.44-1.25-.06-1.22 0 0-1.44.12-2.38.12-.87 0-2.33-.12-2.33-.12-.5-.03-.56 1.2-.06 1.22l.92.08 1.26 3.41zM17.41 10c.24-.64.74-1.87.43-4.25.7 1.29 1.05 2.71 1.05 4.25 0 3.29-1.73 6.24-4.4 7.78.97-2.59 1.94-5.2 2.92-7.78zM6.1 18.09C3.12 16.65 1.11 13.53 1.11 10c0-1.3.23-2.48.72-3.59C3.25 10.3 4.67 14.2 6.1 18.09zm4.03-6.63l2.58 6.98c-.86.29-1.76.45-2.71.45-.79 0-1.57-.11-2.29-.33.81-2.38 1.62-4.74 2.42-7.1z"}));var qe=()=>{const e=Object(F.f)("siteTitle",""),t=Object(F.f)("homeUrl",""),n=Fe(),[r,o]=Object(i.useState)(document.body.classList.contains(!1)),c="is-wc-nav-folded",l="is-wc-nav-expanded",u=()=>{document.body.classList.add(c),document.body.classList.remove(l),o(!0)},d=()=>{document.body.classList.remove(c),document.body.classList.add(l),o(!1)},m=(e=document.body.clientWidth)=>{e<=960?u():d()};Object(i.useEffect)(()=>{m();const e=[{eventName:"orientationchange",handler:e=>m(e.target.screen.availWidth)},{eventName:"resize",handler:Object(M.debounce)(()=>m(),200)}];for(const{eventName:t,handler:n}of e)window.addEventListener(t,n,!1);Object(I.addHistoryListener)(()=>m())},[]);let p=Object(i.createElement)(ie.a,{size:"36px",icon:He});const{isRequestingSiteIcon:f,siteIconUrl:h}=Object(s.useSelect)(e=>{const{isResolving:t}=e("core/data"),{getEntityRecord:n}=e("core"),r=n("root","__unstableBase",void 0)||{};return{isRequestingSiteIcon:t("core","getEntityRecord",["root","__unstableBase",void 0]),siteIconUrl:r.siteIconUrl}});h?p=Object(i.createElement)("img",{alt:Object(H.__)("Site Icon"),src:h}):f&&(p=null);const b=ne()("woocommerce-navigation-header",{"is-scrolled":n});return Object(i.createElement)("div",{className:b},Object(i.createElement)(a.Button,{onClick:()=>{document.body.classList.contains(c)?d():u()},className:"woocommerce-navigation-header__site-icon","aria-label":"Fold navigation",role:"switch","aria-checked":r?"true":"false"},p),Object(i.createElement)(a.Button,{href:t,className:"woocommerce-navigation-header__site-title",as:"span"},Object(re.decodeEntities)(e)))},$e=(n(289),Object(i.createElement)(se.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(i.createElement)(se.Path,{d:"M11.776 4.454a.25.25 0 01.448 0l2.069 4.192a.25.25 0 00.188.137l4.626.672a.25.25 0 01.139.426l-3.348 3.263a.25.25 0 00-.072.222l.79 4.607a.25.25 0 01-.362.263l-4.138-2.175a.25.25 0 00-.232 0l-4.138 2.175a.25.25 0 01-.363-.263l.79-4.607a.25.25 0 00-.071-.222L4.754 9.881a.25.25 0 01.139-.426l4.626-.672a.25.25 0 00.188-.137l2.069-4.192z"}))),We=Object(i.createElement)(se.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(i.createElement)(se.Path,{fillRule:"evenodd",d:"M9.706 8.646a.25.25 0 01-.188.137l-4.626.672a.25.25 0 00-.139.427l3.348 3.262a.25.25 0 01.072.222l-.79 4.607a.25.25 0 00.362.264l4.138-2.176a.25.25 0 01.233 0l4.137 2.175a.25.25 0 00.363-.263l-.79-4.607a.25.25 0 01.072-.222l3.347-3.262a.25.25 0 00-.139-.427l-4.626-.672a.25.25 0 01-.188-.137l-2.069-4.192a.25.25 0 00-.448 0L9.706 8.646zM12 7.39l-.948 1.921a1.75 1.75 0 01-1.317.957l-2.12.308 1.534 1.495c.412.402.6.982.503 1.55l-.362 2.11 1.896-.997a1.75 1.75 0 011.629 0l1.895.997-.362-2.11a1.75 1.75 0 01.504-1.55l1.533-1.495-2.12-.308a1.75 1.75 0 01-1.317-.957L12 7.39z",clipRule:"evenodd"}));n(290);const Qe=({id:e})=>{const{favorites:t,isResolving:n}=Object(s.useSelect)(e=>({favorites:e(D.NAVIGATION_STORE_NAME).getFavorites(),isResolving:e(D.NAVIGATION_STORE_NAME).isResolving("getFavorites")})),{addFavorite:r,removeFavorite:o}=Object(s.useDispatch)(D.NAVIGATION_STORE_NAME),c=t.includes(e);return n?null:Object(i.createElement)(a.Button,{id:"woocommerce-navigation-favorite-button",className:"woocommerce-navigation-favorite-button",isTertiary:!0,onClick:()=>{(c?o:r)(e),Object(z.recordEvent)("navigation_favorite",{id:e,action:c?"unfavorite":"favorite"})},"aria-label":c?Object(H.__)("Add this item to your favorites.",'woocommerce'):Object(H.__)("Remove this item from your favorites.",'woocommerce')},Object(i.createElement)(ie.a,{icon:c?$e:We,className:`star-${c?"filled":"empty"}-icon`}))};const Ge="woocommerce_navigation_favorites_tooltip_hidden",Ye=()=>{const{isFavoritesResolving:e,isOptionResolving:t,isTooltipHidden:n}=Object(s.useSelect)(e=>{const{getOption:t,isResolving:n}=e(D.OPTIONS_STORE_NAME);return{isFavoritesResolving:e(D.NAVIGATION_STORE_NAME).isResolving("getFavorites"),isOptionResolving:n("getOption",[Ge]),isTooltipHidden:"yes"===t(Ge)}}),{updateOptions:r}=Object(s.useDispatch)(D.OPTIONS_STORE_NAME);return e||n||t||document.body.classList.contains("is-wc-nav-folded")?null:Object(i.createElement)(Oe,{delay:1e3,title:Object(H.__)("Introducing favorites",'woocommerce'),content:Object(H.__)("You can now favorite your extensions to pin them in the top level of the navigation.",'woocommerce'),closeButtonText:Object(H.__)("Got it",'woocommerce'),id:"woocommerce-navigation-favorite-button",onClose:()=>r({[Ge]:"yes"}),useAnchor:!0})};var Ze=({category:e})=>{const{id:t,menuId:n,title:r}=e,o="woocommerce-navigation-category-title";return["plugins","favorites"].includes(n)?Object(i.createElement)("span",{className:o},Object(i.createElement)("span",{className:o+"__text"},r),Object(i.createElement)(Qe,{id:t}),Object(i.createElement)(Ye,null)):Object(i.createElement)("span",{className:o},r)};var Ke=({item:e})=>{var t;const n=Object(oe.useSlot)("woocommerce_navigation_"+e.id),r=Boolean(null==n||null===(t=n.fills)||void 0===t?void 0:t.length),o=e=>{Object(z.recordEvent)("navigation_click",{menu_item:e})};return r&&!e.isCategory?Object(i.createElement)(oe.NavigationItem,{key:e.id,item:e.id},Object(i.createElement)("div",{onClick:()=>o(e.id)},Object(i.createElement)(I.WooNavigationItem.Slot,{name:e.id}))):Object(i.createElement)(oe.NavigationItem,{key:e.id,item:e.id,title:e.title,href:e.url,navigateToMenu:!e.url&&e.id,onClick:()=>o(e.id),hideIfTargetMenuEmpty:!0})};const Je=({category:e,onBackClick:t,pluginItems:n,primaryItems:r})=>{if(!r.length&&!n.length)return null;const o=Object(U.applyFilters)("woocommerce_navigation_root_back_label",Object(H.__)("WordPress Dashboard",'woocommerce')),a=Object(U.applyFilters)("woocommerce_navigation_root_back_url",window.wcNavigation.rootBackUrl),c="woocommerce"===e.id&&a;return Object(i.createElement)(oe.NavigationMenu,{title:Object(i.createElement)(Ze,{category:e}),menu:e.id,parentMenu:e.parent,backButtonLabel:c?o:e.backButtonLabel||null,onBackButtonClick:c?()=>{t("woocommerce"),window.location=a}:()=>t(e.id)},!!r.length&&Object(i.createElement)(oe.NavigationGroup,null,r.map(e=>Object(i.createElement)(Ke,{key:e.id,item:e}))),!!n.length&&Object(i.createElement)(oe.NavigationGroup,{title:"woocommerce"===e.id?Object(H.__)("Extensions",'woocommerce'):null},n.map(e=>Object(i.createElement)(Ke,{key:e.id,item:e}))))},Xe=({category:e,items:t,onBackClick:n})=>{if(!t.length)return null;const r="woocommerce"===e.id;return Object(i.createElement)(oe.NavigationMenu,{className:"components-navigation__menu-secondary",title:!r&&Object(i.createElement)(Ze,{category:e}),menu:e.id,parentMenu:e.parent,backButtonLabel:e.backButtonLabel||null,onBackButtonClick:r?null:()=>n(e.id)},Object(i.createElement)(oe.NavigationGroup,{onBackButtonClick:()=>n(e.id)},t.map(e=>Object(i.createElement)(Ke,{key:e.id,item:e}))))};var et=()=>{const{menuItems:e}=Object(s.useSelect)(e=>({menuItems:e(D.NAVIGATION_STORE_NAME).getMenuItems()}));Object(i.useEffect)(()=>{document.documentElement.classList.remove("wp-toolbar"),document.body.classList.add("has-woocommerce-navigation");const e=document.getElementById("adminmenumain");e&&e.classList.add("folded")},[]);const[t,n]=Object(i.useState)("woocommerce-home"),[r,o]=Object(i.useState)("woocommerce");Object(i.useEffect)(()=>{const r=ze(e);r&&t!==r&&(n(r),o(r.parent));return Object(I.addHistoryListener)(()=>{setTimeout(()=>{const t=ze(e);t&&(n(t),o(t.parent))},0)})},[e]);const{currentUserCan:a}=Object(D.useUser)(),{categories:c,items:l}=Object(i.useMemo)(()=>((e,t)=>{const n={...Ue};return{items:(e=>e.sort((e,t)=>e.order===t.order?e.title.localeCompare(t.title):e.order-t.order))(e).reduce((e,r)=>{if(e[r.parent]||(e[r.parent]={},Be.forEach(t=>{e[r.parent][t]=[]})),!e[r.parent][r.menuId])return e;if(t&&r.capability&&!t(r.capability))return e;r.isCategory&&(n[r.id]=r);const o=e[r.parent][r.menuId];return o&&o.push(r),e},{}),categories:n}})(e,a),[e,a]),u=Object(i.useRef)(null),d=e=>{Object(z.recordEvent)("navigation_back_click",{category:e})},m="woocommerce"===r,p=ne()("woocommerce-navigation",{"is-root":m});return Object(i.createElement)("div",{className:p},Object(i.createElement)(qe,null),Object(i.createElement)("div",{className:"woocommerce-navigation__wrapper",ref:u},Object(i.createElement)(oe.Navigation,{activeItem:t?t.id:null,activeMenu:r,onActivateMenu:(...e)=>{u&&u.current&&(u.current.scrollTop=0),o(...e)}},Object.values(c).map(e=>{const t=l[e.id];return!!t&&[Object(i.createElement)(Je,{key:e.id,category:e,onBackClick:d,primaryItems:[...t.primary,...t.favorites],pluginItems:t.plugins}),Object(i.createElement)(Xe,{key:"secondary/"+e.id,category:e,onBackClick:d,items:t.secondary})]}))))};var tt=Object(D.withNavigationHydration)(window.wcNavigation)(et);const nt=()=>{if(new URL(window.location.href).searchParams.get("task")){const e=Object(H.__)("WooCommerce Home",'woocommerce'),t=()=>{Object(z.recordEvent)("topbar_back_button",{page_name:rt(window.title)}),Object(I.updateQueryString)({},Object(I.getHistory)().location.pathname,{})};return Object(i.createElement)(a.Tooltip,{text:e},Object(i.createElement)("div",{tabIndex:"0",role:"button","data-testid":"header-back-button",className:"woocommerce-layout__header-back-button",onKeyDown:({keyCode:e})=>{e!==ce.ENTER&&e!==ce.SPACE||t()}},Object(i.createElement)(ie.a,{icon:ae.a,onClick:t})))}return null},rt=e=>{const t=new URL(window.location.href).searchParams.get("task");return{payments:Object(H.__)("Set up payments",'woocommerce'),tax:Object(H.__)("Add tax rates",'woocommerce'),appearance:Object(H.__)("Personalize your store",'woocommerce'),marketing:Object(H.__)("Set up marketing tools",'woocommerce'),products:Object(H.__)("Add products",'woocommerce'),shipping:Object(H.__)("Set up shipping costs",'woocommerce')}[t]||e},ot=({sections:e,isEmbedded:t=!1,query:n})=>{const r=Object(i.useRef)(null),o=Object(F.f)("siteTitle",""),a=e.slice(-1)[0],c=Fe(),{updateUserPreferences:s,...l}=Object(D.useUserPreferences)(),u="yes"===l.android_app_banner_dismissed;let d=null;const m=ne()("woocommerce-layout__header",{"is-scrolled":c});Object(i.useLayoutEffect)(()=>(p(),window.addEventListener("resize",p),()=>{window.removeEventListener("resize",p);const e=document.querySelector("#wpbody");e&&(e.style.marginTop=null)}),[u]);const p=()=>{clearTimeout(d),d=setTimeout((function(){const e=document.querySelector("#wpbody");e&&r.current&&(e.style.marginTop=r.current.offsetHeight+"px")}),200)};Object(i.useEffect)(()=>{if(!t){const t=e.map(e=>Array.isArray(e)?e[1]:e).reverse().join(" &lsaquo; "),n=Object(re.decodeEntities)(Object(H.sprintf)(Object(H.__)("%1$s &lsaquo; %2$s &#8212; WooCommerce",'woocommerce'),t,o));document.title!==n&&(document.title=n)}},[t,e,o]);const f=()=>{s({android_app_banner_dismissed:"yes"})},h=nt()?"with-back-button":"";return Object(i.createElement)("div",{className:m,ref:r},!u&&Object(i.createElement)(Ie,{onDismiss:f,onInstall:f}),Object(i.createElement)("div",{className:"woocommerce-layout__header-wrapper"},window.wcAdminFeatures.navigation&&Object(i.createElement)(tt,null),nt(),Object(i.createElement)(oe.Text,{className:"woocommerce-layout__header-heading "+h,as:"h1"},rt(Object(re.decodeEntities)(a))),window.wcAdminFeatures["activity-panels"]&&Object(i.createElement)(Ne,{isEmbedded:t,query:n,userPreferencesData:{...l,updateUserPreferences:s}})))};class it extends i.Component{render(){return Object(i.createElement)("div",{id:"woocommerce-layout__notice-list",className:"woocommerce-layout__notice-list"})}}var at=it,ct=n(159),st=n(256);var lt=function({notices:e,className:t,children:n,onRemove:r=M.noop,onRemove2:a=M.noop}){const s=Object(c.useReducedMotion)(),[l]=Object(i.useState)(()=>new WeakMap),u=Object(ct.useTransition)(e,e=>e.id,{from:{opacity:0,height:0},enter:e=>async t=>await t({opacity:1,height:l.get(e).offsetHeight}),leave:()=>async e=>{await e({opacity:0}),await e({height:0})},immediate:s});t=ne()("components-snackbar-list",t);const d=e=>()=>{r(e.id),a(e.id)};return Object(i.createElement)("div",{className:t},n,u.map(({item:e,key:t,props:n})=>Object(i.createElement)(ct.animated.div,{key:t,style:n},Object(i.createElement)("div",{className:"components-snackbar-list__notice-container",ref:t=>t&&l.set(e,t)},Object(i.createElement)(st.a,o()({},Object(M.omit)(e,["content"]),{onRemove:d(e)}),e.content)))))};n(296);const ut="woocommerce_admin_transient_notices_queue";function dt(e){const{removeNotice:t}=Object(s.useDispatch)("core/notices"),{createNotice:n,removeNotice:r}=Object(s.useDispatch)("core/notices2"),{updateOptions:o}=Object(s.useDispatch)(D.OPTIONS_STORE_NAME),{currentUser:a={},notices:c=[],notices2:l=[],noticesQueue:u={}}=Object(s.useSelect)(e=>({currentUser:e(D.USER_STORE_NAME).getCurrentUser(),notices:e("core/notices").getNotices(),notices2:e("core/notices2").getNotices(),noticesQueue:e(D.OPTIONS_STORE_NAME).getOption(ut)}));Object(i.useEffect)(()=>{Object.values(u).filter(e=>e.user_id===a.id||!e.user_id).forEach(e=>{const t=Object(U.applyFilters)("woocommerce_admin_queued_notice_filter",e);n(t.status,t.content,{onDismiss:()=>{(e=>{const t={...u};delete t[e],o({[ut]:t})})(t.id)},...t.options||{}})})},[]);const{className:d}=e,m=ne()("woocommerce-transient-notices","components-notices__snackbar",d),p=c.concat(l);return Object(i.createElement)(lt,{notices:p,className:m,onRemove:t,onRemove2:r})}dt.propTypes={className:p.a.string,notices:p.a.array};var mt=dt;Object(B.registerPlugin)("wc-admin-navigation",{render:()=>{const{persistedQuery:e}=Object(s.useSelect)(e=>({persistedQuery:e(D.NAVIGATION_STORE_NAME).getPersistedQuery()}));if(!Object($.f)(window.location.href))return null;const t=Object(q.a)().filter(e=>e.navArgs),n=X().filter(e=>e.navArgs).map(e=>"/analytics/settings"===e.path?{...e,breadcrumbs:[Object(H.__)("Analytics",'woocommerce')]}:e);return Object(i.createElement)(i.Fragment,null,n.map(t=>Object(i.createElement)(I.WooNavigationItem,{item:t.navArgs.id,key:t.navArgs.id},Object(i.createElement)(V.Link,{className:"components-button",href:Object(I.getNewPath)(Object(I.pathIsExcluded)(t.path)?{}:e,t.path,{}),type:"wc-admin"},t.breadcrumbs[t.breadcrumbs.length-1]))),t.map(t=>Object(i.createElement)(I.WooNavigationItem,{item:t.navArgs.id,key:t.navArgs.id},Object(i.createElement)(V.Link,{className:"components-button",href:Object(I.getNewPath)(Object(I.pathIsExcluded)(t.report)?{}:e,"/analytics/"+t.report,{}),type:"wc-admin"},t.title))))},scope:"woocommerce-navigation"});const pt=Object(i.lazy)(()=>Promise.all([n.e(1),n.e(49)]).then(n.bind(null,618))),ft=Object(i.lazy)(()=>n.e(53).then(n.bind(null,519)));class ht extends i.Component{render(){const{children:e}=this.props;return Object(i.createElement)("div",{className:"woocommerce-layout__primary",id:"woocommerce-layout__primary"},window.wcAdminFeatures["store-alerts"]&&Object(i.createElement)(i.Suspense,{fallback:Object(i.createElement)(V.Spinner,null)},Object(i.createElement)(pt,null)),Object(i.createElement)(at,null),e)}}class bt extends i.Component{componentDidMount(){this.recordPageViewTrack()}componentDidUpdate(e){const t=Object(M.get)(e,"location.pathname"),n=Object(M.get)(this.props,"location.pathname");t&&n&&t!==n&&this.recordPageViewTrack()}recordPageViewTrack(){const{activePlugins:e,installedPlugins:t,isEmbedded:n,isJetpackConnected:r}=this.props,o={has_navigation:!!window.wcNavigation};if(n){const e=document.location.pathname+document.location.search;return void Object(z.recordPageView)(e,{is_embedded:!0,...o})}const i=Object(M.get)(this.props,"location.pathname");if(!i)return;let a=i.substring(1).replace(/\//g,"_");0===a.length&&(a="home_screen"),Object(z.recordPageView)(a,{jetpack_installed:t.includes("jetpack"),jetpack_active:e.includes("jetpack"),jetpack_connected:r,...o})}getQuery(e){if(!e)return{};const t=e.substring(1);return Object(L.parse)(t)}isWCPaySettingsPage(){const{page:e,section:t,tab:n}=Object(I.getQuery)();return"wc-settings"===e&&"checkout"===n&&"woocommerce_payments"===t}render(){const{isEmbedded:e,...t}=this.props,{location:n,page:r}=this.props,{breadcrumbs:c}=r,s=this.getQuery(n&&n.search);return Object(i.createElement)(a.SlotFillProvider,null,Object(i.createElement)("div",{className:"woocommerce-layout"},Object(i.createElement)(ot,{sections:Object(M.isFunction)(c)?c(this.props):c,isEmbedded:e,query:s}),Object(i.createElement)(mt,null),!e&&Object(i.createElement)(ht,null,Object(i.createElement)("div",{className:"woocommerce-layout__main"},Object(i.createElement)(ee,o()({},t,{query:s})))),e&&this.isWCPaySettingsPage()&&Object(i.createElement)(i.Suspense,{fallback:null},Object(i.createElement)(ft,null))),Object(i.createElement)(B.PluginArea,{scope:'woocommerce'}),window.wcAdminFeatures.navigation&&Object(i.createElement)(B.PluginArea,{scope:"woocommerce-navigation"}),window.wcAdminFeatures.tasks&&Object(i.createElement)(B.PluginArea,{scope:"woocommerce-tasks"}))}}bt.propTypes={isEmbedded:p.a.bool,page:p.a.shape({container:p.a.oneOfType([p.a.func,p.a.object]),path:p.a.string,breadcrumbs:p.a.oneOfType([p.a.func,p.a.arrayOf(p.a.oneOfType([p.a.arrayOf(p.a.string),p.a.string]))]).isRequired,wpOpenMenu:p.a.string}).isRequired};const vt=Object(F.f)("dataEndpoints"),gt=Object(c.compose)(Object(D.withPluginsHydration)({...Object(F.f)("plugins",{}),jetpackStatus:vt&&vt.jetpackStatus||!1}),Object(s.withSelect)((e,{isEmbedded:t})=>{if(t)return;const{getActivePlugins:n,getInstalledPlugins:r,isJetpackConnected:o}=e(D.PLUGINS_STORE_NAME);return{activePlugins:n(),isJetpackConnected:o(),installedPlugins:r()}}))(bt),yt=Object(c.compose)(window.wcSettings.admin?Object(D.withOptionsHydration)({...Object(F.f)("preloadOptions",{})}):M.identity)(()=>{const{currentUserCan:e}=Object(D.useUser)();return Object(i.createElement)(_,{history:Object(I.getHistory)()},Object(i.createElement)(R,null,X().filter(t=>!t.capability||e(t.capability)).map(e=>Object(i.createElement)(S,{key:e.path,path:e.path,exact:!0,render:t=>Object(i.createElement)(gt,o()({page:e},t))}))))}),wt=Object(c.compose)(Object(F.f)("preloadOptions")?Object(D.withOptionsHydration)({...Object(F.f)("preloadOptions")}):M.identity)(()=>Object(i.createElement)(gt,{page:{breadcrumbs:Object(F.f)("embedBreadcrumbs",[])},isEmbedded:!0}))},12:function(e,t){e.exports=window.wc.navigation},120:function(e,t){e.exports=window.wc.number},122:function(e,t){e.exports=window.wc.explat},127:function(e,t){e.exports=window.wp.notices},128:function(e,t){var n,r,o=e.exports={};function i(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function c(e){if(n===setTimeout)return setTimeout(e,0);if((n===i||!n)&&setTimeout)return n=setTimeout,setTimeout(e,0);try{return n(e,0)}catch(t){try{return n.call(null,e,0)}catch(t){return n.call(this,e,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:i}catch(e){n=i}try{r="function"==typeof clearTimeout?clearTimeout:a}catch(e){r=a}}();var s,l=[],u=!1,d=-1;function m(){u&&s&&(u=!1,s.length?l=s.concat(l):d=-1,l.length&&p())}function p(){if(!u){var e=c(m);u=!0;for(var t=l.length;t;){for(s=l,l=[];++d<t;)s&&s[d].run();d=-1,t=l.length}s=null,u=!1,function(e){if(r===clearTimeout)return clearTimeout(e);if((r===a||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(e);try{r(e)}catch(t){try{return r.call(null,e)}catch(t){return r.call(this,e)}}}(e)}}function f(e,t){this.fun=e,this.array=t}function h(){}o.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];l.push(new f(e,t)),1!==l.length||u||c(p)},f.prototype.run=function(){this.fun.apply(null,this.array)},o.title="browser",o.browser=!0,o.env={},o.argv=[],o.version="",o.versions={},o.on=h,o.addListener=h,o.once=h,o.off=h,o.removeListener=h,o.removeAllListeners=h,o.emit=h,o.prependListener=h,o.prependOnceListener=h,o.listeners=function(e){return[]},o.binding=function(e){throw new Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(e){throw new Error("process.chdir is not supported")},o.umask=function(){return 0}},129:function(e,t,n){"use strict";var r="function"==typeof Symbol&&Symbol.for,o=r?Symbol.for("react.element"):60103,i=r?Symbol.for("react.portal"):60106,a=r?Symbol.for("react.fragment"):60107,c=r?Symbol.for("react.strict_mode"):60108,s=r?Symbol.for("react.profiler"):60114,l=r?Symbol.for("react.provider"):60109,u=r?Symbol.for("react.context"):60110,d=r?Symbol.for("react.async_mode"):60111,m=r?Symbol.for("react.concurrent_mode"):60111,p=r?Symbol.for("react.forward_ref"):60112,f=r?Symbol.for("react.suspense"):60113,h=r?Symbol.for("react.suspense_list"):60120,b=r?Symbol.for("react.memo"):60115,v=r?Symbol.for("react.lazy"):60116,g=r?Symbol.for("react.block"):60121,y=r?Symbol.for("react.fundamental"):60117,w=r?Symbol.for("react.responder"):60118,O=r?Symbol.for("react.scope"):60119;function j(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case o:switch(e=e.type){case d:case m:case a:case s:case c:case f:return e;default:switch(e=e&&e.$$typeof){case u:case p:case v:case b:case l:return e;default:return t}}case i:return t}}}function _(e){return j(e)===m}t.AsyncMode=d,t.ConcurrentMode=m,t.ContextConsumer=u,t.ContextProvider=l,t.Element=o,t.ForwardRef=p,t.Fragment=a,t.Lazy=v,t.Memo=b,t.Portal=i,t.Profiler=s,t.StrictMode=c,t.Suspense=f,t.isAsyncMode=function(e){return _(e)||j(e)===d},t.isConcurrentMode=_,t.isContextConsumer=function(e){return j(e)===u},t.isContextProvider=function(e){return j(e)===l},t.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===o},t.isForwardRef=function(e){return j(e)===p},t.isFragment=function(e){return j(e)===a},t.isLazy=function(e){return j(e)===v},t.isMemo=function(e){return j(e)===b},t.isPortal=function(e){return j(e)===i},t.isProfiler=function(e){return j(e)===s},t.isStrictMode=function(e){return j(e)===c},t.isSuspense=function(e){return j(e)===f},t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===a||e===m||e===s||e===c||e===f||e===h||"object"==typeof e&&null!==e&&(e.$$typeof===v||e.$$typeof===b||e.$$typeof===l||e.$$typeof===u||e.$$typeof===p||e.$$typeof===y||e.$$typeof===w||e.$$typeof===O||e.$$typeof===g)},t.typeOf=j},13:function(e,t,n){"use strict";n.d(t,"a",(function(){return s})),n.d(t,"b",(function(){return l})),n.d(t,"c",(function(){return u})),n.d(t,"f",(function(){return d})),n.d(t,"g",(function(){return m})),n.d(t,"e",(function(){return p})),n.d(t,"d",(function(){return f}));var r=n(2);const o=["wcAdminSettings","preloadSettings"],i="object"==typeof wcSettings?wcSettings:{},a=Object.keys(i).reduce((e,t)=>(o.includes(t)||(e[t]=i[t]),e),{});Object.keys(i.admin||{}).forEach(e=>{o.includes(e)||(a[e]=i.admin[e])});const c=a.adminUrl,s=(a.countries,a.currency),l=a.locale,u=a.orderStatuses;a.siteTitle,a.wcAssetUrl;function d(e,t=!1,n=(e=>e)){if(o.includes(e))throw new Error(Object(r.__)("Mutable settings should be accessed via data store."));return n(a.hasOwnProperty(e)?a[e]:t,t)}function m(e,t,n=(e=>e)){if(o.includes(e))throw new Error(Object(r.__)("Mutable settings should be mutated via data store."));a[e]=n(t)}function p(e){return(c||"")+e}function f(e){return new Promise((t,n)=>{document.querySelector(`#${e.handle}-js`)&&t();const r=document.createElement("script");r.src=e.src,r.id=e.handle+"-js",r.async=!0,r.onload=t,r.onerror=n,document.body.appendChild(r)})}},14:function(e,t){e.exports=window.wp.compose},15:function(e,t){e.exports=window.wp.url},159:function(e,t,n){"use strict";function r(e){return e&&"object"==typeof e&&"default"in e?e.default:e}Object.defineProperty(t,"__esModule",{value:!0});var o=r(n(35)),i=r(n(292)),a=n(5),c=r(a),s=r(n(293)),l=r(n(295)),u={arr:Array.isArray,obj:function(e){return"[object Object]"===Object.prototype.toString.call(e)},fun:function(e){return"function"==typeof e},str:function(e){return"string"==typeof e},num:function(e){return"number"==typeof e},und:function(e){return void 0===e},nul:function(e){return null===e},set:function(e){return e instanceof Set},map:function(e){return e instanceof Map},equ:function(e,t){if(typeof e!=typeof t)return!1;if(u.str(e)||u.num(e))return e===t;if(u.obj(e)&&u.obj(t)&&Object.keys(e).length+Object.keys(t).length===0)return!0;var n;for(n in e)if(!(n in t))return!1;for(n in t)if(e[n]!==t[n])return!1;return!u.und(n)||e===t}};function d(){var e=a.useState(!1)[1];return a.useCallback((function(){return e((function(e){return!e}))}),[])}function m(e,t){return u.und(e)||u.nul(e)?t:e}function p(e){return u.und(e)?[]:u.arr(e)?e:[e]}function f(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return u.fun(e)?e.apply(void 0,n):e}function h(e){var t=function(e){return e.to,e.from,e.config,e.onStart,e.onRest,e.onFrame,e.children,e.reset,e.reverse,e.force,e.immediate,e.delay,e.attach,e.destroyed,e.interpolateTo,e.ref,e.lazy,i(e,["to","from","config","onStart","onRest","onFrame","children","reset","reverse","force","immediate","delay","attach","destroyed","interpolateTo","ref","lazy"])}(e);if(u.und(t))return o({to:t},e);var n=Object.keys(e).reduce((function(n,r){var i;return u.und(t[r])?o({},n,((i={})[r]=e[r],i)):n}),{});return o({to:t},n)}var b,v,g=function(){function e(){this.payload=void 0,this.children=[]}var t=e.prototype;return t.getAnimatedValue=function(){return this.getValue()},t.getPayload=function(){return this.payload||this},t.attach=function(){},t.detach=function(){},t.getChildren=function(){return this.children},t.addChild=function(e){0===this.children.length&&this.attach(),this.children.push(e)},t.removeChild=function(e){var t=this.children.indexOf(e);this.children.splice(t,1),0===this.children.length&&this.detach()},e}(),y=function(e){function t(){for(var t,n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return(t=e.call.apply(e,[this].concat(r))||this).payload=[],t.attach=function(){return t.payload.forEach((function(e){return e instanceof g&&e.addChild(l(t))}))},t.detach=function(){return t.payload.forEach((function(e){return e instanceof g&&e.removeChild(l(t))}))},t}return s(t,e),t}(g),w=function(e){function t(){for(var t,n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return(t=e.call.apply(e,[this].concat(r))||this).payload={},t.attach=function(){return Object.values(t.payload).forEach((function(e){return e instanceof g&&e.addChild(l(t))}))},t.detach=function(){return Object.values(t.payload).forEach((function(e){return e instanceof g&&e.removeChild(l(t))}))},t}s(t,e);var n=t.prototype;return n.getValue=function(e){void 0===e&&(e=!1);var t={};for(var n in this.payload){var r=this.payload[n];(!e||r instanceof g)&&(t[n]=r instanceof g?r[e?"getAnimatedValue":"getValue"]():r)}return t},n.getAnimatedValue=function(){return this.getValue(!0)},t}(g);function O(e,t){b={fn:e,transform:t}}function j(e){v=e}var _,E=function(e){return"undefined"!=typeof window?window.requestAnimationFrame(e):-1},k=function(e){"undefined"!=typeof window&&window.cancelAnimationFrame(e)};function x(e){_=e}var S,C=function(){return Date.now()};function T(e){S=e}var A,P,N=function(e){return e.current};function R(e){A=e}var M=Object.freeze({get applyAnimatedValues(){return b},injectApplyAnimatedValues:O,get colorNames(){return v},injectColorNames:j,get requestFrame(){return E},get cancelFrame(){return k},injectFrame:function(e,t){E=e,k=t},get interpolation(){return _},injectStringInterpolator:x,get now(){return C},injectNow:function(e){C=e},get defaultElement(){return S},injectDefaultElement:T,get animatedApi(){return N},injectAnimatedApi:function(e){N=e},get createAnimatedStyle(){return A},injectCreateAnimatedStyle:R,get manualFrameloop(){return P},injectManualFrameloop:function(e){P=e}}),L=function(e){function t(t,n){var r;return(r=e.call(this)||this).update=void 0,r.payload=t.style?o({},t,{style:A(t.style)}):t,r.update=n,r.attach(),r}return s(t,e),t}(w),V=!1,I=new Set,F=function e(){if(!V)return!1;var t=C(),n=I,r=Array.isArray(n),o=0;for(n=r?n:n[Symbol.iterator]();;){var i;if(r){if(o>=n.length)break;i=n[o++]}else{if((o=n.next()).done)break;i=o.value}for(var a=i,c=!1,s=0;s<a.configs.length;s++){for(var l=a.configs[s],u=void 0,d=void 0,m=0;m<l.animatedValues.length;m++){var p=l.animatedValues[m];if(!p.done){var f=l.fromValues[m],h=l.toValues[m],b=p.lastPosition,v=h instanceof g,y=Array.isArray(l.initialVelocity)?l.initialVelocity[m]:l.initialVelocity;if(v&&(h=h.getValue()),l.immediate)p.setValue(h),p.done=!0;else if("string"!=typeof f&&"string"!=typeof h){if(void 0!==l.duration)b=f+l.easing((t-p.startTime)/l.duration)*(h-f),u=t>=p.startTime+l.duration;else if(l.decay)b=f+y/(1-.998)*(1-Math.exp(-(1-.998)*(t-p.startTime))),(u=Math.abs(p.lastPosition-b)<.1)&&(h=b);else{d=void 0!==p.lastTime?p.lastTime:t,y=void 0!==p.lastVelocity?p.lastVelocity:l.initialVelocity,t>d+64&&(d=t);for(var w=Math.floor(t-d),O=0;O<w;++O){b+=1*(y+=1*((-l.tension*(b-h)+-l.friction*y)/l.mass)/1e3)/1e3}var j=!(!l.clamp||0===l.tension)&&(f<h?b>h:b<h),_=Math.abs(y)<=l.precision,k=0===l.tension||Math.abs(h-b)<=l.precision;u=j||_&&k,p.lastVelocity=y,p.lastTime=t}v&&!l.toValues[m].done&&(u=!1),u?(p.value!==h&&(b=h),p.done=!0):c=!0,p.setValue(b),p.lastPosition=b}else p.setValue(h),p.done=!0}}a.props.onFrame&&(a.values[l.name]=l.interpolation.getValue())}a.props.onFrame&&a.props.onFrame(a.values),c||(I.delete(a),a.stop(!0))}return I.size?P?P():E(e):V=!1,V};function D(e,t,n){if("function"==typeof e)return e;if(Array.isArray(e))return D({range:e,output:t,extrapolate:n});if(_&&"string"==typeof e.output[0])return _(e);var r=e,o=r.output,i=r.range||[0,1],a=r.extrapolateLeft||r.extrapolate||"extend",c=r.extrapolateRight||r.extrapolate||"extend",s=r.easing||function(e){return e};return function(e){var t=function(e,t){for(var n=1;n<t.length-1&&!(t[n]>=e);++n);return n-1}(e,i);return function(e,t,n,r,o,i,a,c,s){var l=s?s(e):e;if(l<t){if("identity"===a)return l;"clamp"===a&&(l=t)}if(l>n){if("identity"===c)return l;"clamp"===c&&(l=n)}if(r===o)return r;if(t===n)return e<=t?r:o;t===-1/0?l=-l:n===1/0?l-=t:l=(l-t)/(n-t);l=i(l),r===-1/0?l=-l:o===1/0?l+=r:l=l*(o-r)+r;return l}(e,i[t],i[t+1],o[t],o[t+1],s,a,c,r.map)}}var z=function(e){function t(n,r,o,i){var a;return(a=e.call(this)||this).calc=void 0,a.payload=n instanceof y&&!(n instanceof t)?n.getPayload():Array.isArray(n)?n:[n],a.calc=D(r,o,i),a}s(t,e);var n=t.prototype;return n.getValue=function(){return this.calc.apply(this,this.payload.map((function(e){return e.getValue()})))},n.updateConfig=function(e,t,n){this.calc=D(e,t,n)},n.interpolate=function(e,n,r){return new t(this,e,n,r)},t}(y);var B=function(e){function t(t){var n;return(n=e.call(this)||this).animatedStyles=new Set,n.value=void 0,n.startPosition=void 0,n.lastPosition=void 0,n.lastVelocity=void 0,n.startTime=void 0,n.lastTime=void 0,n.done=!1,n.setValue=function(e,t){void 0===t&&(t=!0),n.value=e,t&&n.flush()},n.value=t,n.startPosition=t,n.lastPosition=t,n}s(t,e);var n=t.prototype;return n.flush=function(){0===this.animatedStyles.size&&function e(t,n){"update"in t?n.add(t):t.getChildren().forEach((function(t){return e(t,n)}))}(this,this.animatedStyles),this.animatedStyles.forEach((function(e){return e.update()}))},n.clearStyles=function(){this.animatedStyles.clear()},n.getValue=function(){return this.value},n.interpolate=function(e,t,n){return new z(this,e,t,n)},t}(g),U=function(e){function t(t){var n;return(n=e.call(this)||this).payload=t.map((function(e){return new B(e)})),n}s(t,e);var n=t.prototype;return n.setValue=function(e,t){var n=this;void 0===t&&(t=!0),Array.isArray(e)?e.length===this.payload.length&&e.forEach((function(e,r){return n.payload[r].setValue(e,t)})):this.payload.forEach((function(n){return n.setValue(e,t)}))},n.getValue=function(){return this.payload.map((function(e){return e.getValue()}))},n.interpolate=function(e,t){return new z(this,e,t)},t}(y),H=0,q=function(){function e(){var e=this;this.id=void 0,this.idle=!0,this.hasChanged=!1,this.guid=0,this.local=0,this.props={},this.merged={},this.animations={},this.interpolations={},this.values={},this.configs=[],this.listeners=[],this.queue=[],this.localQueue=void 0,this.getValues=function(){return e.interpolations},this.id=H++}var t=e.prototype;return t.update=function(e){if(!e)return this;var t=h(e),n=t.delay,r=void 0===n?0:n,a=t.to,c=i(t,["delay","to"]);if(u.arr(a)||u.fun(a))this.queue.push(o({},c,{delay:r,to:a}));else if(a){var s={};Object.entries(a).forEach((function(e){var t,n=e[0],i=e[1],a=o({to:(t={},t[n]=i,t),delay:f(r,n)},c),l=s[a.delay]&&s[a.delay].to;s[a.delay]=o({},s[a.delay],a,{to:o({},l,a.to)})})),this.queue=Object.values(s)}return this.queue=this.queue.sort((function(e,t){return e.delay-t.delay})),this.diff(c),this},t.start=function(e){var t,n=this;if(this.queue.length){this.idle=!1,this.localQueue&&this.localQueue.forEach((function(e){var t=e.from,r=void 0===t?{}:t,i=e.to,a=void 0===i?{}:i;u.obj(r)&&(n.merged=o({},r,n.merged)),u.obj(a)&&(n.merged=o({},n.merged,a))}));var r=this.local=++this.guid,a=this.localQueue=this.queue;this.queue=[],a.forEach((function(t,o){var c=t.delay,s=i(t,["delay"]),l=function(t){o===a.length-1&&r===n.guid&&t&&(n.idle=!0,n.props.onRest&&n.props.onRest(n.merged)),e&&e()},d=u.arr(s.to)||u.fun(s.to);c?setTimeout((function(){r===n.guid&&(d?n.runAsync(s,l):n.diff(s).start(l))}),c):d?n.runAsync(s,l):n.diff(s).start(l)}))}else u.fun(e)&&this.listeners.push(e),this.props.onStart&&this.props.onStart(),t=this,I.has(t)||I.add(t),V||(V=!0,E(P||F));return this},t.stop=function(e){return this.listeners.forEach((function(t){return t(e)})),this.listeners=[],this},t.pause=function(e){var t;return this.stop(!0),e&&(t=this,I.has(t)&&I.delete(t)),this},t.runAsync=function(e,t){var n=this,r=(e.delay,i(e,["delay"])),a=this.local,c=Promise.resolve(void 0);if(u.arr(r.to))for(var s=function(e){var t=e,i=o({},r,h(r.to[t]));u.arr(i.config)&&(i.config=i.config[t]),c=c.then((function(){if(a===n.guid)return new Promise((function(e){return n.diff(i).start(e)}))}))},l=0;l<r.to.length;l++)s(l);else if(u.fun(r.to)){var d,m=0;c=c.then((function(){return r.to((function(e){var t=o({},r,h(e));if(u.arr(t.config)&&(t.config=t.config[m]),m++,a===n.guid)return d=new Promise((function(e){return n.diff(t).start(e)}))}),(function(e){return void 0===e&&(e=!0),n.stop(e)})).then((function(){return d}))}))}c.then(t)},t.diff=function(e){var t=this;this.props=o({},this.props,e);var n=this.props,r=n.from,i=void 0===r?{}:r,a=n.to,c=void 0===a?{}:a,s=n.config,l=void 0===s?{}:s,d=n.reverse,h=n.attach,b=n.reset,g=n.immediate;if(d){var y=[c,i];i=y[0],c=y[1]}this.merged=o({},i,this.merged,c),this.hasChanged=!1;var w=h&&h(this);if(this.animations=Object.entries(this.merged).reduce((function(e,n){var r=n[0],a=n[1],c=e[r]||{},s=u.num(a),d=u.str(a)&&!a.startsWith("#")&&!/\d/.test(a)&&!v[a],h=u.arr(a),y=!s&&!h&&!d,O=u.und(i[r])?a:i[r],j=s||h||d?a:1,E=f(l,r);w&&(j=w.animations[r].parent);var k,x=c.parent,S=c.interpolation,T=p(w?j.getPayload():j),A=a;y&&(A=_({range:[0,1],output:[a,a]})(1));var P,N=S&&S.getValue(),R=!u.und(x)&&c.animatedValues.some((function(e){return!e.done})),M=!u.equ(A,N),L=!u.equ(A,c.previous),V=!u.equ(E,c.config);if(b||L&&M||V){var I;if(s||d)x=S=c.parent||new B(O);else if(h)x=S=c.parent||new U(O);else if(y){var F=c.interpolation&&c.interpolation.calc(c.parent.value);F=void 0===F||b?O:F,c.parent?(x=c.parent).setValue(0,!1):x=new B(0);var D={output:[F,a]};c.interpolation?(S=c.interpolation,c.interpolation.updateConfig(D)):S=x.interpolate(D)}return T=p(w?j.getPayload():j),k=p(x.getPayload()),b&&!y&&x.setValue(O,!1),t.hasChanged=!0,k.forEach((function(e){e.startPosition=e.value,e.lastPosition=e.value,e.lastVelocity=R?e.lastVelocity:void 0,e.lastTime=R?e.lastTime:void 0,e.startTime=C(),e.done=!1,e.animatedStyles.clear()})),f(g,r)&&x.setValue(y?j:a,!1),o({},e,((I={})[r]=o({},c,{name:r,parent:x,interpolation:S,animatedValues:k,toValues:T,previous:A,config:E,fromValues:p(x.getValue()),immediate:f(g,r),initialVelocity:m(E.velocity,0),clamp:m(E.clamp,!1),precision:m(E.precision,.01),tension:m(E.tension,170),friction:m(E.friction,26),mass:m(E.mass,1),duration:E.duration,easing:m(E.easing,(function(e){return e})),decay:E.decay}),I))}return M?e:(y&&(x.setValue(1,!1),S.updateConfig({output:[A,A]})),x.done=!0,t.hasChanged=!0,o({},e,((P={})[r]=o({},e[r],{previous:A}),P)))}),this.animations),this.hasChanged)for(var O in this.configs=Object.values(this.animations),this.values={},this.interpolations={},this.animations)this.interpolations[O]=this.animations[O].interpolation,this.values[O]=this.animations[O].interpolation.getValue();return this},t.destroy=function(){this.stop(),this.props={},this.merged={},this.animations={},this.interpolations={},this.values={},this.configs=[],this.local=0},e}(),$=function(e,t){var n=a.useRef(!1),r=a.useRef(),o=u.fun(t),i=a.useMemo((function(){var n;return r.current&&(r.current.map((function(e){return e.destroy()})),r.current=void 0),[new Array(e).fill().map((function(e,r){var i=new q,a=o?f(t,r,i):t[r];return 0===r&&(n=a.ref),i.update(a),n||i.start(),i})),n]}),[e]),c=i[0],s=i[1];r.current=c;a.useImperativeHandle(s,(function(){return{start:function(){return Promise.all(r.current.map((function(e){return new Promise((function(t){return e.start(t)}))})))},stop:function(e){return r.current.forEach((function(t){return t.stop(e)}))},get controllers(){return r.current}}}));var l=a.useMemo((function(){return function(e){return r.current.map((function(t,n){t.update(o?f(e,n,t):e[n]),s||t.start()}))}}),[e]);a.useEffect((function(){n.current?o||l(t):s||r.current.forEach((function(e){return e.start()}))})),a.useEffect((function(){return n.current=!0,function(){return r.current.forEach((function(e){return e.destroy()}))}}),[]);var d=r.current.map((function(e){return e.getValues()}));return o?[d,l,function(e){return r.current.forEach((function(t){return t.pause(e)}))}]:d},W=0,Q=function(e,t){return("function"==typeof t?e.map(t):p(t)).map(String)},G=function(e){var t=e.items,n=e.keys,r=void 0===n?function(e){return e}:n,a=i(e,["items","keys"]);return t=p(void 0!==t?t:null),o({items:t,keys:Q(t,r)},a)};function Y(e,t){var n=function(){if(o){if(i>=r.length)return"break";a=r[i++]}else{if((i=r.next()).done)return"break";a=i.value}var n=a.key,c=function(e){return e.key!==n};(u.und(t)||t===n)&&(e.current.instances.delete(n),e.current.transitions=e.current.transitions.filter(c),e.current.deleted=e.current.deleted.filter(c))},r=e.current.deleted,o=Array.isArray(r),i=0;for(r=o?r:r[Symbol.iterator]();;){var a;if("break"===n())break}e.current.forceUpdate()}var Z=function(e){function t(t){var n;return void 0===t&&(t={}),n=e.call(this)||this,!t.transform||t.transform instanceof g||(t=b.transform(t)),n.payload=t,n}return s(t,e),t}(w),K={transparent:0,aliceblue:4042850303,antiquewhite:4209760255,aqua:16777215,aquamarine:2147472639,azure:4043309055,beige:4126530815,bisque:4293182719,black:255,blanchedalmond:4293643775,blue:65535,blueviolet:2318131967,brown:2771004159,burlywood:3736635391,burntsienna:3934150143,cadetblue:1604231423,chartreuse:2147418367,chocolate:3530104575,coral:4286533887,cornflowerblue:1687547391,cornsilk:4294499583,crimson:3692313855,cyan:16777215,darkblue:35839,darkcyan:9145343,darkgoldenrod:3095792639,darkgray:2846468607,darkgreen:6553855,darkgrey:2846468607,darkkhaki:3182914559,darkmagenta:2332068863,darkolivegreen:1433087999,darkorange:4287365375,darkorchid:2570243327,darkred:2332033279,darksalmon:3918953215,darkseagreen:2411499519,darkslateblue:1211993087,darkslategray:793726975,darkslategrey:793726975,darkturquoise:13554175,darkviolet:2483082239,deeppink:4279538687,deepskyblue:12582911,dimgray:1768516095,dimgrey:1768516095,dodgerblue:512819199,firebrick:2988581631,floralwhite:4294635775,forestgreen:579543807,fuchsia:4278255615,gainsboro:3705462015,ghostwhite:4177068031,gold:4292280575,goldenrod:3668254975,gray:2155905279,green:8388863,greenyellow:2919182335,grey:2155905279,honeydew:4043305215,hotpink:4285117695,indianred:3445382399,indigo:1258324735,ivory:4294963455,khaki:4041641215,lavender:3873897215,lavenderblush:4293981695,lawngreen:2096890111,lemonchiffon:4294626815,lightblue:2916673279,lightcoral:4034953471,lightcyan:3774873599,lightgoldenrodyellow:4210742015,lightgray:3553874943,lightgreen:2431553791,lightgrey:3553874943,lightpink:4290167295,lightsalmon:4288707327,lightseagreen:548580095,lightskyblue:2278488831,lightslategray:2005441023,lightslategrey:2005441023,lightsteelblue:2965692159,lightyellow:4294959359,lime:16711935,limegreen:852308735,linen:4210091775,magenta:4278255615,maroon:2147483903,mediumaquamarine:1724754687,mediumblue:52735,mediumorchid:3126187007,mediumpurple:2473647103,mediumseagreen:1018393087,mediumslateblue:2070474495,mediumspringgreen:16423679,mediumturquoise:1221709055,mediumvioletred:3340076543,midnightblue:421097727,mintcream:4127193855,mistyrose:4293190143,moccasin:4293178879,navajowhite:4292783615,navy:33023,oldlace:4260751103,olive:2155872511,olivedrab:1804477439,orange:4289003775,orangered:4282712319,orchid:3664828159,palegoldenrod:4008225535,palegreen:2566625535,paleturquoise:2951671551,palevioletred:3681588223,papayawhip:4293907967,peachpuff:4292524543,peru:3448061951,pink:4290825215,plum:3718307327,powderblue:2967529215,purple:2147516671,rebeccapurple:1714657791,red:4278190335,rosybrown:3163525119,royalblue:1097458175,saddlebrown:2336560127,salmon:4202722047,sandybrown:4104413439,seagreen:780883967,seashell:4294307583,sienna:2689740287,silver:3233857791,skyblue:2278484991,slateblue:1784335871,slategray:1887473919,slategrey:1887473919,snow:4294638335,springgreen:16744447,steelblue:1182971135,tan:3535047935,teal:8421631,thistle:3636451583,tomato:4284696575,turquoise:1088475391,violet:4001558271,wheat:4125012991,white:4294967295,whitesmoke:4126537215,yellow:4294902015,yellowgreen:2597139199},J="[-+]?\\d*\\.?\\d+";function X(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return"\\(\\s*("+t.join(")\\s*,\\s*(")+")\\s*\\)"}var ee=new RegExp("rgb"+X(J,J,J)),te=new RegExp("rgba"+X(J,J,J,J)),ne=new RegExp("hsl"+X(J,"[-+]?\\d*\\.?\\d+%","[-+]?\\d*\\.?\\d+%")),re=new RegExp("hsla"+X(J,"[-+]?\\d*\\.?\\d+%","[-+]?\\d*\\.?\\d+%",J)),oe=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,ie=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,ae=/^#([0-9a-fA-F]{6})$/,ce=/^#([0-9a-fA-F]{8})$/;function se(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function le(e,t,n){var r=n<.5?n*(1+t):n+t-n*t,o=2*n-r,i=se(o,r,e+1/3),a=se(o,r,e),c=se(o,r,e-1/3);return Math.round(255*i)<<24|Math.round(255*a)<<16|Math.round(255*c)<<8}function ue(e){var t=parseInt(e,10);return t<0?0:t>255?255:t}function de(e){return(parseFloat(e)%360+360)%360/360}function me(e){var t=parseFloat(e);return t<0?0:t>1?255:Math.round(255*t)}function pe(e){var t=parseFloat(e);return t<0?0:t>100?1:t/100}function fe(e){var t,n,r="number"==typeof(t=e)?t>>>0===t&&t>=0&&t<=4294967295?t:null:(n=ae.exec(t))?parseInt(n[1]+"ff",16)>>>0:K.hasOwnProperty(t)?K[t]:(n=ee.exec(t))?(ue(n[1])<<24|ue(n[2])<<16|ue(n[3])<<8|255)>>>0:(n=te.exec(t))?(ue(n[1])<<24|ue(n[2])<<16|ue(n[3])<<8|me(n[4]))>>>0:(n=oe.exec(t))?parseInt(n[1]+n[1]+n[2]+n[2]+n[3]+n[3]+"ff",16)>>>0:(n=ce.exec(t))?parseInt(n[1],16)>>>0:(n=ie.exec(t))?parseInt(n[1]+n[1]+n[2]+n[2]+n[3]+n[3]+n[4]+n[4],16)>>>0:(n=ne.exec(t))?(255|le(de(n[1]),pe(n[2]),pe(n[3])))>>>0:(n=re.exec(t))?(le(de(n[1]),pe(n[2]),pe(n[3]))|me(n[4]))>>>0:null;return null===r?e:"rgba("+((4278190080&(r=r||0))>>>24)+", "+((16711680&r)>>>16)+", "+((65280&r)>>>8)+", "+(255&r)/255+")"}var he=/[+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,be=/(#(?:[0-9a-f]{2}){2,4}|(#[0-9a-f]{3})|(rgb|hsl)a?\((-?\d+%?[,\s]+){2,3}\s*[\d\.]+%?\))/gi,ve=new RegExp("("+Object.keys(K).join("|")+")","g"),ge={animationIterationCount:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},ye=["Webkit","Ms","Moz","O"];function we(e,t,n){return null==t||"boolean"==typeof t||""===t?"":n||"number"!=typeof t||0===t||ge.hasOwnProperty(e)&&ge[e]?(""+t).trim():t+"px"}ge=Object.keys(ge).reduce((function(e,t){return ye.forEach((function(n){return e[function(e,t){return e+t.charAt(0).toUpperCase()+t.substring(1)}(n,t)]=e[t]})),e}),ge);var Oe={};R((function(e){return new Z(e)})),T("div"),x((function(e){var t=e.output.map((function(e){return e.replace(be,fe)})).map((function(e){return e.replace(ve,fe)})),n=t[0].match(he).map((function(){return[]}));t.forEach((function(e){e.match(he).forEach((function(e,t){return n[t].push(+e)}))}));var r=t[0].match(he).map((function(t,r){return D(o({},e,{output:n[r]}))}));return function(e){var n=0;return t[0].replace(he,(function(){return r[n++](e)})).replace(/rgba\(([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+)\)/gi,(function(e,t,n,r,o){return"rgba("+Math.round(t)+", "+Math.round(n)+", "+Math.round(r)+", "+o+")"}))}})),j(K),O((function(e,t){if(!e.nodeType||void 0===e.setAttribute)return!1;var n=t.style,r=t.children,o=t.scrollTop,a=t.scrollLeft,c=i(t,["style","children","scrollTop","scrollLeft"]),s="filter"===e.nodeName||e.parentNode&&"filter"===e.parentNode.nodeName;for(var l in void 0!==o&&(e.scrollTop=o),void 0!==a&&(e.scrollLeft=a),void 0!==r&&(e.textContent=r),n)if(n.hasOwnProperty(l)){var u=0===l.indexOf("--"),d=we(l,n[l],u);"float"===l&&(l="cssFloat"),u?e.style.setProperty(l,d):e.style[l]=d}for(var m in c){var p=s?m:Oe[m]||(Oe[m]=m.replace(/([A-Z])/g,(function(e){return"-"+e.toLowerCase()})));void 0!==e.getAttribute(p)&&e.setAttribute(p,c[m])}}),(function(e){return e}));var je,_e,Ee=(je=function(e){return a.forwardRef((function(t,n){var r=d(),s=a.useRef(!0),l=a.useRef(null),m=a.useRef(null),p=a.useCallback((function(e){var t=l.current;l.current=new L(e,(function(){var e=!1;m.current&&(e=b.fn(m.current,l.current.getAnimatedValue())),m.current&&!1!==e||r()})),t&&t.detach()}),[]);a.useEffect((function(){return function(){s.current=!1,l.current&&l.current.detach()}}),[]),a.useImperativeHandle(n,(function(){return N(m,s,r)})),p(t);var f,h=l.current.getValue(),v=(h.scrollTop,h.scrollLeft,i(h,["scrollTop","scrollLeft"])),g=(f=e,!u.fun(f)||f.prototype instanceof c.Component?function(e){return m.current=function(e,t){return t&&(u.fun(t)?t(e):u.obj(t)&&(t.current=e)),e}(e,n)}:void 0);return c.createElement(e,o({},v,{ref:g}))}))},void 0===(_e=!1)&&(_e=!0),function(e){return(u.arr(e)?e:Object.keys(e)).reduce((function(e,t){var n=_e?t[0].toLowerCase()+t.substring(1):t;return e[n]=je(n),e}),je)}),ke=Ee(["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"]);t.apply=Ee,t.config={default:{tension:170,friction:26},gentle:{tension:120,friction:14},wobbly:{tension:180,friction:12},stiff:{tension:210,friction:20},slow:{tension:280,friction:60},molasses:{tension:280,friction:120}},t.update=F,t.animated=ke,t.a=ke,t.interpolate=function(e,t,n){return e&&new z(e,t,n)},t.Globals=M,t.useSpring=function(e){var t=u.fun(e),n=$(1,t?e:[e]),r=n[0],o=n[1],i=n[2];return t?[r[0],o,i]:r},t.useTrail=function(e,t){var n=a.useRef(!1),r=u.fun(t),i=f(t),c=a.useRef(),s=$(e,(function(e,t){return 0===e&&(c.current=[]),c.current.push(t),o({},i,{config:f(i.config,e),attach:e>0&&function(){return c.current[e-1]}})})),l=s[0],d=s[1],m=s[2],p=a.useMemo((function(){return function(e){return d((function(t,n){e.reverse;var r=e.reverse?t+1:t-1,a=c.current[r];return o({},e,{config:f(e.config||i.config,t),attach:a&&function(){return a}})}))}}),[e,i.reverse]);return a.useEffect((function(){n.current&&!r&&p(t)})),a.useEffect((function(){n.current=!0}),[]),r?[l,p,m]:l},t.useTransition=function(e,t,n){var r=o({items:e,keys:t||function(e){return e}},n),c=G(r),s=c.lazy,l=void 0!==s&&s,u=(c.unique,c.reset),m=void 0!==u&&u,p=(c.enter,c.leave,c.update,c.onDestroyed),h=(c.keys,c.items,c.onFrame),b=c.onRest,v=c.onStart,g=c.ref,y=i(c,["lazy","unique","reset","enter","leave","update","onDestroyed","keys","items","onFrame","onRest","onStart","ref"]),w=d(),O=a.useRef(!1),j=a.useRef({mounted:!1,first:!0,deleted:[],current:{},transitions:[],prevProps:{},paused:!!r.ref,instances:!O.current&&new Map,forceUpdate:w});return a.useImperativeHandle(r.ref,(function(){return{start:function(){return Promise.all(Array.from(j.current.instances).map((function(e){var t=e[1];return new Promise((function(e){return t.start(e)}))})))},stop:function(e){return Array.from(j.current.instances).forEach((function(t){return t[1].stop(e)}))},get controllers(){return Array.from(j.current.instances).map((function(e){return e[1]}))}}})),j.current=function(e,t){var n=e.first,r=e.prevProps,a=i(e,["first","prevProps"]),c=G(t),s=c.items,l=c.keys,u=c.initial,d=c.from,m=c.enter,p=c.leave,h=c.update,b=c.trail,v=void 0===b?0:b,g=c.unique,y=c.config,w=c.order,O=void 0===w?["enter","leave","update"]:w,j=G(r),_=j.keys,E=j.items,k=o({},a.current),x=[].concat(a.deleted),S=Object.keys(k),C=new Set(S),T=new Set(l),A=l.filter((function(e){return!C.has(e)})),P=a.transitions.filter((function(e){return!e.destroyed&&!T.has(e.originalKey)})).map((function(e){return e.originalKey})),N=l.filter((function(e){return C.has(e)})),R=-v;for(;O.length;){switch(O.shift()){case"enter":A.forEach((function(e,t){g&&x.find((function(t){return t.originalKey===e}))&&(x=x.filter((function(t){return t.originalKey!==e})));var r=l.indexOf(e),o=s[r],i=n&&void 0!==u?"initial":"enter";k[e]={slot:i,originalKey:e,key:g?String(e):W++,item:o,trail:R+=v,config:f(y,o,i),from:f(n&&void 0!==u?u||{}:d,o),to:f(m,o)}}));break;case"leave":P.forEach((function(e){var t=_.indexOf(e),n=E[t];x.unshift(o({},k[e],{slot:"leave",destroyed:!0,left:_[Math.max(0,t-1)],right:_[Math.min(_.length,t+1)],trail:R+=v,config:f(y,n,"leave"),to:f(p,n)})),delete k[e]}));break;case"update":N.forEach((function(e){var t=l.indexOf(e),n=s[t];k[e]=o({},k[e],{item:n,slot:"update",trail:R+=v,config:f(y,n,"update"),to:f(h,n)})}))}}var M=l.map((function(e){return k[e]}));return x.forEach((function(e){var t,n=e.left,r=(e.right,i(e,["left","right"]));-1!==(t=M.findIndex((function(e){return e.originalKey===n})))&&(t+=1),t=Math.max(0,t),M=[].concat(M.slice(0,t),[r],M.slice(t))})),o({},a,{changed:A.length||P.length||N.length,first:n&&0===A.length,transitions:M,current:k,deleted:x,prevProps:t})}(j.current,r),j.current.changed&&j.current.transitions.forEach((function(e){var t=e.slot,n=e.from,r=e.to,i=e.config,a=e.trail,c=e.key,s=e.item;j.current.instances.has(c)||j.current.instances.set(c,new q);var u=j.current.instances.get(c),d=o({},y,{to:r,from:n,config:i,ref:g,onRest:function(n){j.current.mounted&&(e.destroyed&&(g||l||Y(j,c),p&&p(s)),!Array.from(j.current.instances).some((function(e){return!e[1].idle}))&&(g||l)&&j.current.deleted.length>0&&Y(j),b&&b(s,t,n))},onStart:v&&function(){return v(s,t)},onFrame:h&&function(e){return h(s,t,e)},delay:a,reset:m&&"enter"===t});u.update(d),j.current.paused||u.start()})),a.useEffect((function(){return j.current.mounted=O.current=!0,function(){j.current.mounted=O.current=!1,Array.from(j.current.instances).map((function(e){return e[1].destroy()})),j.current.instances.clear()}}),[]),j.current.transitions.map((function(e){var t=e.item,n=e.slot,r=e.key;return{item:t,key:r,state:n,props:j.current.instances.get(r).getValues()}}))},t.useChain=function(e,t,n){void 0===n&&(n=1e3);var r=a.useRef();a.useEffect((function(){u.equ(e,r.current)?e.forEach((function(e){var t=e.current;return t&&t.start()})):t?e.forEach((function(e,r){var i=e.current;if(i){var a=i.controllers;if(a.length){var c=n*t[r];a.forEach((function(e){e.queue=e.queue.map((function(e){return o({},e,{delay:e.delay+c})})),e.start()}))}}})):e.reduce((function(e,t,n){var r=t.current;return e.then((function(){return r.start()}))}),Promise.resolve()),r.current=e}))},t.useSprings=$},16:function(e,t){e.exports=window.wc.tracks},160:function(e,t,n){"use strict";(function(e){var r=n(5),o=n.n(r),i=n(25),a=n(1),c=n.n(a),s="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==e?e:{};function l(e){var t=[];return{on:function(e){t.push(e)},off:function(e){t=t.filter((function(t){return t!==e}))},get:function(){return e},set:function(n,r){e=n,t.forEach((function(t){return t(e,r)}))}}}var u=o.a.createContext||function(e,t){var n,o,a,u="__create-react-context-"+((s[a="__global_unique_id__"]=(s[a]||0)+1)+"__"),d=function(e){function n(){var t;return(t=e.apply(this,arguments)||this).emitter=l(t.props.value),t}Object(i.a)(n,e);var r=n.prototype;return r.getChildContext=function(){var e;return(e={})[u]=this.emitter,e},r.componentWillReceiveProps=function(e){if(this.props.value!==e.value){var n,r=this.props.value,o=e.value;((i=r)===(a=o)?0!==i||1/i==1/a:i!=i&&a!=a)?n=0:(n="function"==typeof t?t(r,o):1073741823,0!==(n|=0)&&this.emitter.set(e.value,n))}var i,a},r.render=function(){return this.props.children},n}(r.Component);d.childContextTypes=((n={})[u]=c.a.object.isRequired,n);var m=function(t){function n(){var e;return(e=t.apply(this,arguments)||this).state={value:e.getValue()},e.onUpdate=function(t,n){0!=((0|e.observedBits)&n)&&e.setState({value:e.getValue()})},e}Object(i.a)(n,t);var r=n.prototype;return r.componentWillReceiveProps=function(e){var t=e.observedBits;this.observedBits=null==t?1073741823:t},r.componentDidMount=function(){this.context[u]&&this.context[u].on(this.onUpdate);var e=this.props.observedBits;this.observedBits=null==e?1073741823:e},r.componentWillUnmount=function(){this.context[u]&&this.context[u].off(this.onUpdate)},r.getValue=function(){return this.context[u]?this.context[u].get():e},r.render=function(){return(e=this.props.children,Array.isArray(e)?e[0]:e)(this.state.value);var e},n}(r.Component);return m.contextTypes=((o={})[u]=c.a.object,o),{Provider:d,Consumer:m}};t.a=u}).call(this,n(78))},161:function(e,t,n){var r=n(297);e.exports=p,e.exports.parse=i,e.exports.compile=function(e,t){return c(i(e,t),t)},e.exports.tokensToFunction=c,e.exports.tokensToRegExp=m;var o=new RegExp(["(\\\\.)","([\\/.])?(?:(?:\\:(\\w+)(?:\\(((?:\\\\.|[^\\\\()])+)\\))?|\\(((?:\\\\.|[^\\\\()])+)\\))([+*?])?|(\\*))"].join("|"),"g");function i(e,t){for(var n,r=[],i=0,a=0,c="",u=t&&t.delimiter||"/";null!=(n=o.exec(e));){var d=n[0],m=n[1],p=n.index;if(c+=e.slice(a,p),a=p+d.length,m)c+=m[1];else{var f=e[a],h=n[2],b=n[3],v=n[4],g=n[5],y=n[6],w=n[7];c&&(r.push(c),c="");var O=null!=h&&null!=f&&f!==h,j="+"===y||"*"===y,_="?"===y||"*"===y,E=n[2]||u,k=v||g;r.push({name:b||i++,prefix:h||"",delimiter:E,optional:_,repeat:j,partial:O,asterisk:!!w,pattern:k?l(k):w?".*":"[^"+s(E)+"]+?"})}}return a<e.length&&(c+=e.substr(a)),c&&r.push(c),r}function a(e){return encodeURI(e).replace(/[\/?#]/g,(function(e){return"%"+e.charCodeAt(0).toString(16).toUpperCase()}))}function c(e,t){for(var n=new Array(e.length),o=0;o<e.length;o++)"object"==typeof e[o]&&(n[o]=new RegExp("^(?:"+e[o].pattern+")$",d(t)));return function(t,o){for(var i="",c=t||{},s=(o||{}).pretty?a:encodeURIComponent,l=0;l<e.length;l++){var u=e[l];if("string"!=typeof u){var d,m=c[u.name];if(null==m){if(u.optional){u.partial&&(i+=u.prefix);continue}throw new TypeError('Expected "'+u.name+'" to be defined')}if(r(m)){if(!u.repeat)throw new TypeError('Expected "'+u.name+'" to not repeat, but received `'+JSON.stringify(m)+"`");if(0===m.length){if(u.optional)continue;throw new TypeError('Expected "'+u.name+'" to not be empty')}for(var p=0;p<m.length;p++){if(d=s(m[p]),!n[l].test(d))throw new TypeError('Expected all "'+u.name+'" to match "'+u.pattern+'", but received `'+JSON.stringify(d)+"`");i+=(0===p?u.prefix:u.delimiter)+d}}else{if(d=u.asterisk?encodeURI(m).replace(/[?#]/g,(function(e){return"%"+e.charCodeAt(0).toString(16).toUpperCase()})):s(m),!n[l].test(d))throw new TypeError('Expected "'+u.name+'" to match "'+u.pattern+'", but received "'+d+'"');i+=u.prefix+d}}else i+=u}return i}}function s(e){return e.replace(/([.+*?=^!:${}()[\]|\/\\])/g,"\\$1")}function l(e){return e.replace(/([=!:$\/()])/g,"\\$1")}function u(e,t){return e.keys=t,e}function d(e){return e&&e.sensitive?"":"i"}function m(e,t,n){r(t)||(n=t||n,t=[]);for(var o=(n=n||{}).strict,i=!1!==n.end,a="",c=0;c<e.length;c++){var l=e[c];if("string"==typeof l)a+=s(l);else{var m=s(l.prefix),p="(?:"+l.pattern+")";t.push(l),l.repeat&&(p+="(?:"+m+p+")*"),a+=p=l.optional?l.partial?m+"("+p+")?":"(?:"+m+"("+p+"))?":m+"("+p+")"}}var f=s(n.delimiter||"/"),h=a.slice(-f.length)===f;return o||(a=(h?a.slice(0,-f.length):a)+"(?:"+f+"(?=$))?"),a+=i?"$":o&&h?"":"(?="+f+"|$)",u(new RegExp("^"+a,d(n)),t)}function p(e,t,n){return r(t)||(n=t||n,t=[]),n=n||{},e instanceof RegExp?function(e,t){var n=e.source.match(/\((?!\?)/g);if(n)for(var r=0;r<n.length;r++)t.push({name:r,prefix:null,delimiter:null,optional:!1,repeat:!1,partial:!1,asterisk:!1,pattern:null});return u(e,t)}(e,t):r(e)?function(e,t,n){for(var r=[],o=0;o<e.length;o++)r.push(p(e[o],t,n).source);return u(new RegExp("(?:"+r.join("|")+")",d(n)),t)}(e,t,n):function(e,t,n){return m(i(e,n),t,n)}(e,t,n)}},164:function(e,t,n){"use strict";n.d(t,"a",(function(){return o})),n.d(t,"b",(function(){return i}));var r=n(4);function o(e,t){return Object(r.filter)(e,e=>{const{is_deleted:n,date_created_gmt:r,status:o}=e;if(!n){return(!t||!r||new Date(r+"Z").getTime()>t)&&"unactioned"===o}}).length}function i(e){return Object(r.filter)(e,e=>{const{is_deleted:t}=e;return!t}).length>0}},17:function(e,t){e.exports=window.wp.apiFetch},18:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o=c(n(5)),i=c(n(69)),a=c(n(72));function c(e){return e&&e.__esModule?e:{default:e}}var s=void 0;function l(e,t){var n,a,c,u,d,m,p,f,h=[],b={};for(m=0;m<e.length;m++)if("string"!==(d=e[m]).type){if(!t.hasOwnProperty(d.value)||void 0===t[d.value])throw new Error("Invalid interpolation, missing component node: `"+d.value+"`");if("object"!==r(t[d.value]))throw new Error("Invalid interpolation, component node must be a ReactElement or null: `"+d.value+"`","\n> "+s);if("componentClose"===d.type)throw new Error("Missing opening component token: `"+d.value+"`");if("componentOpen"===d.type){n=t[d.value],c=m;break}h.push(t[d.value])}else h.push(d.value);return n&&(u=function(e,t){var n,r,o=t[e],i=0;for(r=e+1;r<t.length;r++)if((n=t[r]).value===o.value){if("componentOpen"===n.type){i++;continue}if("componentClose"===n.type){if(0===i)return r;i--}}throw new Error("Missing closing component token `"+o.value+"`")}(c,e),p=l(e.slice(c+1,u),t),a=o.default.cloneElement(n,{},p),h.push(a),u<e.length-1&&(f=l(e.slice(u+1),t),h=h.concat(f))),1===h.length?h[0]:(h.forEach((function(e,t){e&&(b["interpolation-child-"+t]=e)})),(0,i.default)(b))}t.default=function(e){var t=e.mixedString,n=e.components,o=e.throwErrors;if(s=t,!n)return t;if("object"!==(void 0===n?"undefined":r(n))){if(o)throw new Error("Interpolation Error: unable to process `"+t+"` because components is not an object");return t}var i=(0,a.default)(t);try{return l(i,n)}catch(e){if(o)throw new Error("Interpolation Error: unable to process `"+t+"` because of error `"+e.message+"`");return t}}},19:function(e,t){e.exports=window.wc.date},2:function(e,t){e.exports=window.wp.i18n},20:function(e,t){e.exports=window.wc.experimental},21:function(e,t){e.exports=window.wc.components},22:function(e,t,n){"use strict";function r(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}n.d(t,"a",(function(){return r}))},23:function(e,t,n){"use strict";function r(){return(r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}n.d(t,"a",(function(){return r}))},25:function(e,t,n){"use strict";function r(e,t){return(r=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function o(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,r(e,t)}n.d(t,"a",(function(){return o}))},253:function(e,t,n){"use strict";n.d(t,"a",(function(){return u})),n.d(t,"b",(function(){return p}));var r=n(0),o=n(3),i=n(7),a=n(2),c=n(11),s=n(16);const l=()=>Object(r.createElement)(r.Fragment,null,Object(r.createElement)("svg",{className:"woocommerce-layout__activity-panel-tab-icon",width:"24",height:"24",viewBox:"3 3 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Object(r.createElement)("path",{d:"M13.8053 15.3982C13.8053 15.7965 13.4867 16.1947 13.0089 16.1947H6.79646C6.55752 16.1947 6.39823 16.115 6.23894 15.9558C6.07965 15.7965 6 15.6372 6 15.3982V6.79646C6 6.63717 6.15929 6.39823 6.23894 6.23894C6.39823 6.07965 6.55752 6 6.79646 6H13.0089C13.4071 6 13.8053 6.31858 13.8053 6.79646V15.3982Z",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),Object(r.createElement)("path",{d:"M23.9203 10.6195C23.9203 11.0177 23.6017 11.4159 23.1238 11.4159H16.9115C16.6725 11.4159 16.5132 11.3363 16.3539 11.177C16.1946 11.0177 16.115 10.8584 16.115 10.6195V6.79646C16.115 6.39823 16.4336 6 16.9115 6H23.1238C23.5221 6 23.9203 6.31858 23.9203 6.79646V10.6195Z",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),Object(r.createElement)("path",{d:"M13.8053 23.2035C13.8053 23.4424 13.7257 23.6017 13.5664 23.761C13.4071 23.9203 13.2478 23.9999 13.0089 23.9999H6.79646C6.39823 23.9999 6 23.6813 6 23.2035V19.3804C6 19.1415 6.07965 18.9822 6.23894 18.8229C6.39823 18.6636 6.55752 18.584 6.79646 18.584H13.0089C13.4071 18.584 13.8053 18.9026 13.8053 19.3804V23.2035Z",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),Object(r.createElement)("path",{d:"M16.9912 23.9999C16.7522 23.9999 16.5929 23.9202 16.4336 23.7609C16.2743 23.6016 16.1947 23.4423 16.1947 23.2034V14.6016C16.1947 14.3627 16.2743 14.2034 16.4336 14.0441C16.5929 13.8848 16.7522 13.8052 16.9912 13.8052H23.2036C23.4425 13.8052 23.6018 13.8848 23.7611 14.0441C23.9204 14.2034 24 14.3627 24 14.6016V23.2034C24 23.6016 23.6814 23.9999 23.2036 23.9999H16.9912Z",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})),Object(a.__)("Display",'woocommerce')),{Fill:u,Slot:d}=Object(o.createSlotFill)("DisplayOptions");u.Slot=d;const m=[{value:"single_column",label:Object(r.createElement)(r.Fragment,null,Object(r.createElement)(()=>Object(r.createElement)("svg",{className:"woocommerce-layout__activity-panel-tab-icon",width:"12",height:"14",viewBox:"0 0 12 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Object(r.createElement)("rect",{x:"0.5",y:"0.5",width:"11",height:"13",strokeWidth:"1"})),null),Object(a.__)("Single column",'woocommerce'))},{value:"two_columns",label:Object(r.createElement)(r.Fragment,null,Object(r.createElement)(()=>Object(r.createElement)("svg",{className:"woocommerce-layout__activity-panel-tab-icon",width:"18",height:"14",viewBox:"0 0 18 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Object(r.createElement)("rect",{x:"0.5",y:"0.5",width:"7",height:"13",strokeWidth:"1"}),Object(r.createElement)("rect",{x:"9.5",y:"0.5",width:"7",height:"13",strokeWidth:"1"})),null),Object(a.__)("Two columns",'woocommerce'))}],p=()=>{const{defaultHomescreenLayout:e,taskListComplete:t,isTaskListHidden:n}=Object(i.useSelect)(e=>{const{getOption:t}=e(c.OPTIONS_STORE_NAME);return{defaultHomescreenLayout:t("woocommerce_default_homepage_layout")||"single_column",taskListComplete:"yes"===t("woocommerce_task_list_complete"),isTaskListHidden:"yes"===t("woocommerce_task_list_hidden")}}),{updateUserPreferences:u,homepage_layout:p}=Object(c.useUserPreferences)(),f=t||n||window.wcAdminFeatures.analytics;return Object(r.createElement)(d,null,t=>0!==t.length||f?Object(r.createElement)(o.DropdownMenu,{icon:Object(r.createElement)(l,null),label:Object(a.__)("Display options",'woocommerce'),toggleProps:{className:"woocommerce-layout__activity-panel-tab display-options",onClick:()=>Object(s.recordEvent)("homescreen_display_click")},popoverProps:{className:"woocommerce-layout__activity-panel-popover"}},({onClose:n})=>Object(r.createElement)(r.Fragment,null,t,f?Object(r.createElement)(o.MenuGroup,{className:"woocommerce-layout__homescreen-display-options",label:Object(a.__)("Layout",'woocommerce')},Object(r.createElement)(o.MenuItemsChoice,{choices:m,onSelect:e=>{u({homepage_layout:e}),n(),Object(s.recordEvent)("homescreen_display_option",{display_option:e})},value:p||e})):null)):null)}},254:function(e,t,n){"use strict";n.d(t,"a",(function(){return y})),n.d(t,"b",(function(){return w}));var r=n(0),o=n(2),i=n(20),a=n(16),c=n(21),s=n(7),l=n(11),u=n(498),d=n(8),m=Object(r.createElement)(d.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},Object(r.createElement)(d.Path,{d:"M18 4H6c-1.1 0-2 .9-2 2v12.9c0 .6.5 1.1 1.1 1.1.3 0 .5-.1.8-.3L8.5 17H18c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm.5 11c0 .3-.2.5-.5.5H7.9l-2.4 2.4V6c0-.3.2-.5.5-.5h12c.3 0 .5.2.5.5v9z"})),p=n(499),f=n(3),h=n(66),b=n(103),v=n(60);const g=()=>Object(r.createElement)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},Object(r.createElement)("path",{d:"M0 0h24v24H0z",fill:"none"}),Object(r.createElement)("path",{d:"M12 22c1.1 0 2-.9 2-2h-4c0 1.1.9 2 2 2zm6-6v-5c0-3.07-1.63-5.64-4.5-6.32V4c0-.83-.67-1.5-1.5-1.5s-1.5.67-1.5 1.5v.68C7.64 5.36 6 7.92 6 11v5l-2 2v1h16v-1l-2-2zm-2 1H8v-6c0-2.48 1.51-4.5 4-4.5s4 2.02 4 4.5v6z"})),y="AbbreviatedNotification",w=({thingsToDoNextCount:e})=>{const{ordersToProcessCount:t,reviewsToModerateCount:n,stockNoticesCount:d,isSetupTaskListHidden:w,isExtendedTaskListHidden:O}=Object(s.useSelect)(e=>{const{getOption:t}=e(l.OPTIONS_STORE_NAME),n=Object(h.c)(e);return{ordersToProcessCount:Object(h.d)(e,n),reviewsToModerateCount:Object(b.b)(e),stockNoticesCount:Object(h.a)(e),isSetupTaskListHidden:"yes"===t("woocommerce_task_list_hidden"),isExtendedTaskListHidden:"yes"===t("woocommerce_extended_task_list_hidden")}}),j=e=>{Object(a.recordEvent)("activity_panel_click",{task:e})},{Slot:_}=Object(f.createSlotFill)(y),E=Object(v.f)(window.location.href);return Object(r.createElement)("div",{className:"woocommerce-abbreviated-notifications"},e>0&&!O&&Object(r.createElement)(c.AbbreviatedCard,{className:"woocommerce-abbreviated-notification",icon:Object(r.createElement)(g,null),href:"admin.php?page=wc-admin#extended_task_list",onClick:()=>j("thingsToDoNext"),type:E?"wc-admin":"wp-admin"},Object(r.createElement)(i.Text,{as:"h3"},Object(o.__)("Things to do next",'woocommerce')),Object(r.createElement)(i.Text,{as:"p"},Object(o.sprintf)(Object(o._n)("You have %d new thing to do","You have %d new things to do",e,'woocommerce'),e))),t>0&&w&&Object(r.createElement)(c.AbbreviatedCard,{className:"woocommerce-abbreviated-notification",icon:u.a,href:"admin.php?page=wc-admin&opened_panel=orders-panel",onClick:()=>j("ordersToProcess"),type:E?"wc-admin":"wp-admin"},Object(r.createElement)(i.Text,{as:"h3"},Object(o.__)("Orders to fulfill",'woocommerce')),Object(r.createElement)(i.Text,null,Object(o.sprintf)(Object(o._n)("You have %d order to fulfill","You have %d orders to fulfill",t,'woocommerce'),t))),n>0&&w&&Object(r.createElement)(c.AbbreviatedCard,{className:"woocommerce-abbreviated-notification",icon:m,href:"admin.php?page=wc-admin&opened_panel=reviews-panel",onClick:()=>j("reviewsToModerate"),type:E?"wc-admin":"wp-admin"},Object(r.createElement)(i.Text,{as:"h3"},Object(o.__)("Reviews to moderate",'woocommerce')),Object(r.createElement)(i.Text,null,Object(o.sprintf)(Object(o._n)("You have %d review to moderate","You have %d reviews to moderate",n,'woocommerce'),n))),d>0&&w&&Object(r.createElement)(c.AbbreviatedCard,{className:"woocommerce-abbreviated-notification",icon:p.a,href:"admin.php?page=wc-admin&opened_panel=stock-panel",onClick:()=>j("stockNotices"),type:E?"wc-admin":"wp-admin"},Object(r.createElement)(i.Text,{as:"h3"},Object(o.__)("Inventory to review",'woocommerce')),Object(r.createElement)(i.Text,null,Object(o.__)("You have inventory to review and update",'woocommerce'))),!O&&Object(r.createElement)(_,null))}},255:function(e,t,n){"use strict";n.d(t,"a",(function(){return f})),n.d(t,"b",(function(){return y}));var r=n(0),o=n(2),i=n(30),a=n(18),c=n.n(a),s=n(13),l=n(32),u=n(21),d=n(11),m=n(19);var p=({value:e,onChange:t})=>{const{wcAdminSettings:n}=Object(d.useSettings)("wc_admin",["wcAdminSettings"]),{woocommerce_default_date_range:o}=n,i=Object(l.parse)(e.replace(/&amp;/g,"&")),{period:a,compare:c,before:s,after:p}=Object(m.getDateParamsFromQuery)(i,o),{primary:f,secondary:h}=Object(m.getCurrentDates)(i,o),b={period:a,compare:c,before:s,after:p,primaryDate:f,secondaryDate:h};return Object(r.createElement)(u.DateRangeFilterPicker,{query:i,onRangeSelect:e=>{t({target:{name:"woocommerce_default_date_range",value:Object(l.stringify)(e)}})},dateQuery:b,isoDateFormat:m.isoDateFormat})};const f=["processing","on-hold"],h=["completed","processing","refunded","cancelled","failed","pending","on-hold"],b=Object.keys(s.c).filter(e=>"refunded"!==e).map(e=>({value:e,label:s.c[e],description:Object(o.sprintf)(Object(o.__)("Exclude the %s status from reports",'woocommerce'),s.c[e])})),v=Object(s.f)("unregisteredOrderStatuses",{}),g=[{key:"defaultStatuses",options:b.filter(e=>h.includes(e.value))},{key:"customStatuses",label:Object(o.__)("Custom Statuses",'woocommerce'),options:b.filter(e=>!h.includes(e.value))},{key:"unregisteredStatuses",label:Object(o.__)("Unregistered Statuses",'woocommerce'),options:Object.keys(v).map(e=>({value:e,label:e,description:Object(o.sprintf)(Object(o.__)("Exclude the %s status from reports",'woocommerce'),e)}))}],y=Object(i.applyFilters)("woocommerce_admin_analytics_settings",{woocommerce_excluded_report_order_statuses:{label:Object(o.__)("Excluded statuses:",'woocommerce'),inputType:"checkboxGroup",options:g,helpText:c()({mixedString:Object(o.__)("Orders with these statuses are excluded from the totals in your reports. The {{strong}}Refunded{{/strong}} status can not be excluded.",'woocommerce'),components:{strong:Object(r.createElement)("strong",null)}}),defaultValue:["pending","cancelled","failed"]},woocommerce_actionable_order_statuses:{label:Object(o.__)("Actionable statuses:",'woocommerce'),inputType:"checkboxGroup",options:g,helpText:Object(o.__)("Orders with these statuses require action on behalf of the store admin. These orders will show up in the Home Screen - Orders task.",'woocommerce'),defaultValue:f},woocommerce_default_date_range:{name:"woocommerce_default_date_range",label:Object(o.__)("Default date range:",'woocommerce'),inputType:"component",component:p,helpText:Object(o.__)("Select a default date range. When no range is selected, reports will be viewed by the default date range.",'woocommerce'),defaultValue:"period=month&compare=previous_year"}})},256:function(e,t,n){"use strict";(function(e){var r=n(0),o=n(4),i=n(6),a=n.n(i),c=n(257),s=n(2),l=(n(258),n(3));t.a=Object(r.forwardRef)((function({className:t,children:n,spokenMessage:i=n,politeness:u="polite",actions:d=[],onRemove:m=o.noop,icon:p=null,explicitDismiss:f=!1,onDismiss:h=null},b){function v(e){e&&e.preventDefault&&e.preventDefault(),h(),m()}h=h||o.noop,function(e,t){const n="string"==typeof e?e:Object(r.renderToString)(e);Object(r.useEffect)(()=>{n&&Object(c.speak)(n,t)},[n,t])}(i,u),Object(r.useEffect)(()=>{const e=setTimeout(()=>{f||(h(),m())},1e4);return()=>clearTimeout(e)},[f,h,m]);const g=a()(t,"components-snackbar",{"components-snackbar-explicit-dismiss":!!f});d&&d.length>1&&(void 0!==e&&e.env,d=[d[0]]);const y=a()("components-snackbar__content",{"components-snackbar__content-with-icon":!!p});return Object(r.createElement)("div",{ref:b,className:g,onClick:f?o.noop:v,tabIndex:"0",role:f?"":"button",onKeyPress:f?o.noop:v,"aria-label":f?"":Object(s.__)("Dismiss this notice")},Object(r.createElement)("div",{className:y},p&&Object(r.createElement)("div",{className:"components-snackbar__icon"},p),n,d.map(({label:e,onClick:t,url:n},o)=>Object(r.createElement)(l.Button,{key:o,href:n,isTertiary:!0,onClick:e=>function(e,t){e.stopPropagation(),m(),t&&t(e)}(e,t),className:"components-snackbar__action"},e)),f&&Object(r.createElement)("span",{role:"button","aria-label":"Dismiss this notice",tabIndex:"0",className:"components-snackbar__dismiss-button",onClick:v,onKeyPress:v},"✕")))}))}).call(this,n(128))},257:function(e,t){e.exports=window.wp.a11y},258:function(e,t){e.exports=window.wp.warning},259:function(e,t){e.exports=window.wc.customerEffortScore},269:function(e,t,n){"use strict";n.d(t,"a",(function(){return A}));var r={};n.r(r),n.d(r,"setCesSurveyQueue",(function(){return O})),n.d(r,"addCesSurvey",(function(){return j})),n.d(r,"addCesSurveyForAnalytics",(function(){return _})),n.d(r,"addCesSurveyForCustomerSearch",(function(){return E}));var o={};n.r(o),n.d(o,"getCesSurveyQueue",(function(){return k}));var i={};n.r(i),n.d(i,"getCesSurveyQueue",(function(){return x}));var a=n(0),c=n(1),s=n.n(c),l=n(16),u=n(259),d=n.n(u),m=n(14),p=n(7),f=n(11),h=n(2);function b({action:e,trackProps:t,label:n,onSubmitLabel:r=Object(h.__)("Thank you for your feedback!",'woocommerce'),cesShownForActions:o,allowTracking:i,resolving:c,storeAgeInWeeks:s,updateOptions:u,createNotice:m}){const[p,f]=Object(a.useState)(!1);if(c)return null;if(!i)return null;if(-1!==o.indexOf(e)&&!p)return null;const b=()=>{u({woocommerce_ces_shown_for_actions:[e,...o]})};return Object(a.createElement)(d.a,{recordScoreCallback:(n,o)=>{Object(l.recordEvent)("ces_feedback",{action:e,score:n,comments:o||"",store_age:s,...t}),m("success",r)},label:n,onNoticeShownCallback:()=>{Object(l.recordEvent)("ces_snackbar_view",{action:e,store_age:s,...t})},onNoticeDismissedCallback:()=>{Object(l.recordEvent)("ces_snackbar_dismiss",{action:e,store_age:s,...t}),b()},onModalShownCallback:()=>{f(!0),Object(l.recordEvent)("ces_view",{action:e,store_age:s,...t}),b()},icon:Object(a.createElement)("span",{style:{height:21,width:21},role:"img","aria-label":Object(h.__)("Pencil icon",'woocommerce')},"✏️")})}b.propTypes={action:s.a.string.isRequired,trackProps:s.a.object,label:s.a.string.isRequired,onSubmitLabel:s.a.string,cesShownForActions:s.a.arrayOf(s.a.string).isRequired,allowTracking:s.a.bool,resolving:s.a.bool.isRequired,storeAgeInWeeks:s.a.number,updateOptions:s.a.func,createNotice:s.a.func};var v=Object(m.compose)(Object(p.withSelect)(e=>{const{getOption:t,isResolving:n}=e(f.OPTIONS_STORE_NAME),r=t("woocommerce_ces_shown_for_actions")||[],o=function(e){if(0===e)return null;const t=Date.now()-1e3*e;return Math.round(t/f.WEEK)}(t("woocommerce_admin_install_timestamp")||0);return{cesShownForActions:r,allowTracking:"yes"===(t("woocommerce_allow_tracking")||"no"),storeAgeInWeeks:o,resolving:n("getOption",["woocommerce_ces_shown_for_actions"])||null===o||n("getOption",["woocommerce_admin_install_timestamp"])||n("getOption",["woocommerce_allow_tracking"])}}),Object(p.withDispatch)(e=>{const{updateOptions:t}=e(f.OPTIONS_STORE_NAME),{createNotice:n}=e("core/notices");return{updateOptions:t,createNotice:n}}))(b),g=n(55),y=n(10);var w={SET_CES_SURVEY_QUEUE:"SET_CES_SURVEY_QUEUE",ADD_CES_SURVEY:"ADD_CES_SURVEY"};function O(e){return{type:w.SET_CES_SURVEY_QUEUE,queue:e}}function j(e,t,n=window.pagenow,r=window.adminpage,o,i={}){return{type:w.ADD_CES_SURVEY,action:e,label:t,pageNow:n,adminPage:r,onsubmit_label:o,props:i}}function _(){return j("analytics_filtered",Object(h.__)("How easy was it to filter your store analytics?",'woocommerce'),"woocommerce_page_wc-admin","woocommerce_page_wc-admin")}function E(){return j("ces_search",Object(h.__)("How easy was it to use search?",'woocommerce'),"woocommerce_page_wc-admin","woocommerce_page_wc-admin",void 0,{search_area:"customer"})}function*k(){const e=yield Object(y.apiFetch)({path:`${g.a}/options?options=${g.b}`});if(!e)throw new Error;yield O(e[g.b]||[])}function x(e){return e.queue}const S={queue:[]};var C=(e=S,t)=>{switch(t.type){case w.SET_CES_SURVEY_QUEUE:return{...e,queue:t.queue};case w.ADD_CES_SURVEY:if(e.queue.filter(e=>e.action===t.action).length)return e;const n={action:t.action,label:t.label,pagenow:t.pageNow,adminpage:t.adminPage,onSubmitLabel:t.onSubmitLabel,props:t.props};return{...e,queue:[...e.queue,n]};default:return e}};Object(p.registerStore)(g.c,{actions:r,selectors:i,resolvers:o,controls:y.controls,reducer:C});function T({queue:e,resolving:t,clearQueue:n}){if(t)return null;const r=e.filter(e=>e.pagenow===window.pagenow&&e.adminpage===window.adminpage);return r.length&&n(),Object(a.createElement)(a.Fragment,null,r.map((e,t)=>Object(a.createElement)(v,{key:t,action:e.action,label:e.label,onSubmitLabel:e.onsubmit_label,trackProps:e.props||{}})))}T.propTypes={queue:s.a.arrayOf(s.a.object),resolving:s.a.bool,clearQueue:s.a.func};var A=Object(m.compose)(Object(p.withSelect)(e=>{const{getCesSurveyQueue:t,isResolving:n}=e(g.c);return{queue:t(),resolving:n("getOption",[g.b])}}),Object(p.withDispatch)(e=>{const{updateOptions:t}=e(f.OPTIONS_STORE_NAME);return{clearQueue:()=>{t({woocommerce_clear_ces_tracks_queue_for_page:{pagenow:window.pagenow,adminpage:window.adminpage}})}}}))(T)},27:function(e,t){e.exports=window.wp.keycodes},270:function(e,t,n){"use strict";n.d(t,"a",(function(){return f}));var r=n(35),o=n.n(r),i=n(0),a=n(30),c=n(32),s=n(7),l=n(11);var u=({children:e})=>{const{currentUserCan:t}=Object(l.useUser)(),n=Object(s.useSelect)(e=>{const{getOption:t,hasFinishedResolution:n}=e(l.OPTIONS_STORE_NAME),r=n("getOption",["woocommerce_show_marketplace_suggestions"]),o="no"!==t("woocommerce_show_marketplace_suggestions");return r&&o});return t("install_plugins")&&n?Object(i.createElement)(i.Fragment,null,e):null};const d=Object(i.lazy)(()=>Promise.all([n.e(3),n.e(45)]).then(n.bind(null,609))),m=Object(i.lazy)(()=>n.e(48).then(n.bind(null,616)));n(298);const p=[({page:e,tab:t,section:n})=>"wc-settings"!==e||"checkout"!==t||n?null:Object(i.createElement)(u,null,Object(i.createElement)(i.Suspense,{fallback:null},Object(i.createElement)(d,null))),({page:e,tab:t,section:n,zone_id:r})=>"wc-settings"!==e||"shipping"!==t||Boolean(n)||Boolean(r)?null:Object(i.createElement)(u,null,Object(i.createElement)(i.Suspense,{fallback:null},Object(i.createElement)(m,null)))],f=()=>{const e=Object(c.parse)(location.search.substring(1));let t={page:"",tab:""};void 0!==e.page&&(t=e);const n=Object(a.applyFilters)("woocommerce_admin_embedded_layout_components",p,t);return Object(i.createElement)("div",{className:"woocommerce-embedded-layout__primary",id:"woocommerce-embedded-layout__primary"},n.map((e,n)=>Object(i.createElement)(e,o()({key:n},t))))}},279:function(e,t,n){"use strict";n.r(t),function(e){var t=n(0),r=(n(127),n(11)),o=n(13),i=(n(281),n(119)),a=n(269),c=n(270);n.p=e.wcAdminAssets.path;const s=document.getElementById("root"),l=document.getElementById("woocommerce-embedded-root"),u=Object(o.f)("currentUserData");if(s){let e=Object(r.withSettingsHydration)("wc_admin",window.wcSettings.admin)(i.b);const n=!!window.wcSettings.admin&&window.wcSettings.admin.preloadSettings;n&&n.general&&(e=Object(r.withSettingsHydration)("general",{general:n.general})(e)),u&&(e=Object(r.withCurrentUserHydration)(u)(e)),Object(t.render)(Object(t.createElement)(e,null),s)}else if(l){let e=Object(r.withSettingsHydration)("wc_admin",window.wcSettings.admin)(i.a);u&&(e=Object(r.withCurrentUserHydration)(u)(e)),Object(t.render)(Object(t.createElement)(e,null),l),l.classList.remove("is-embed-loading");const n=document.getElementById("wpbody-content"),o=n.querySelector(".wrap.woocommerce")||n.querySelector(".wrap"),a=document.createElement("div");Object(t.render)(Object(t.createElement)("div",{className:"woocommerce-layout"},Object(t.createElement)(i.c,null)),n.insertBefore(a,o));const s=document.createElement("div");Object(t.render)(Object(t.createElement)(c.a,null),n.insertBefore(s,o.nextSibling))}window.wcAdminFeatures&&!0===window.wcAdminFeatures["customer-effort-score-tracks"]&&function(){const e=s||l;Object(t.render)(Object(t.createElement)(a.a,null),e.insertBefore(document.createElement("div"),null))}()}.call(this,n(78))},28:function(e,t){e.exports=window.wp.htmlEntities},281:function(e,t,n){},282:function(e,t){e.exports=window.wc.notices},283:function(e,t,n){},284:function(e,t,n){},285:function(e,t,n){},286:function(e,t,n){},287:function(e,t,n){},288:function(e,t,n){},289:function(e,t,n){},29:function(e,t){e.exports=window.ReactDOM},290:function(e,t,n){},291:function(e,t,n){"use strict";var r=n(0),o=n(8),i=Object(r.createElement)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(r.createElement)(o.Path,{d:"M14.6 7l-1.2-1L8 12l5.4 6 1.2-1-4.6-5z"}));t.a=i},292:function(e,t){e.exports=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o},e.exports.default=e.exports,e.exports.__esModule=!0},293:function(e,t,n){var r=n(294);e.exports=function(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,r(e,t)},e.exports.default=e.exports,e.exports.__esModule=!0},294:function(e,t){function n(t,r){return e.exports=n=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},e.exports.default=e.exports,e.exports.__esModule=!0,n(t,r)}e.exports=n,e.exports.default=e.exports,e.exports.__esModule=!0},295:function(e,t){e.exports=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e},e.exports.default=e.exports,e.exports.__esModule=!0},296:function(e,t,n){},297:function(e,t){e.exports=Array.isArray||function(e){return"[object Array]"==Object.prototype.toString.call(e)}},298:function(e,t,n){},3:function(e,t){e.exports=window.wp.components},30:function(e,t){e.exports=window.wp.hooks},32:function(e,t,n){"use strict";var r=n(67),o=n(68),i=n(39);e.exports={formats:i,parse:o,stringify:r}},35:function(e,t){function n(){return e.exports=n=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},e.exports.default=e.exports,e.exports.__esModule=!0,n.apply(this,arguments)}e.exports=n,e.exports.default=e.exports,e.exports.__esModule=!0},39:function(e,t,n){"use strict";var r=String.prototype.replace,o=/%20/g,i="RFC1738",a="RFC3986";e.exports={default:a,formatters:{RFC1738:function(e){return r.call(e,o,"+")},RFC3986:function(e){return String(e)}},RFC1738:i,RFC3986:a}},4:function(e,t){e.exports=window.lodash},41:function(e,t,n){"use strict";t.a=function(e,t){if(!e)throw new Error("Invariant failed")}},47:function(e,t,n){"use strict";var r=n(48);function o(){}function i(){}i.resetWarningCache=o,e.exports=function(){function e(e,t,n,o,i,a){if(a!==r){var c=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw c.name="Invariant Violation",c}}function t(){return e}e.isRequired=e;var n={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:i,resetWarningCache:o};return n.PropTypes=n,n}},474:function(e,t){e.exports=window.wc.csvExport},476:function(e,t){e.exports=window.wc.wcSettings},48:function(e,t,n){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},49:function(e,t,n){"use strict";var r=n(39),o=Object.prototype.hasOwnProperty,i=Array.isArray,a=function(){for(var e=[],t=0;t<256;++t)e.push("%"+((t<16?"0":"")+t.toString(16)).toUpperCase());return e}(),c=function(e,t){for(var n=t&&t.plainObjects?Object.create(null):{},r=0;r<e.length;++r)void 0!==e[r]&&(n[r]=e[r]);return n};e.exports={arrayToObject:c,assign:function(e,t){return Object.keys(t).reduce((function(e,n){return e[n]=t[n],e}),e)},combine:function(e,t){return[].concat(e,t)},compact:function(e){for(var t=[{obj:{o:e},prop:"o"}],n=[],r=0;r<t.length;++r)for(var o=t[r],a=o.obj[o.prop],c=Object.keys(a),s=0;s<c.length;++s){var l=c[s],u=a[l];"object"==typeof u&&null!==u&&-1===n.indexOf(u)&&(t.push({obj:a,prop:l}),n.push(u))}return function(e){for(;e.length>1;){var t=e.pop(),n=t.obj[t.prop];if(i(n)){for(var r=[],o=0;o<n.length;++o)void 0!==n[o]&&r.push(n[o]);t.obj[t.prop]=r}}}(t),e},decode:function(e,t,n){var r=e.replace(/\+/g," ");if("iso-8859-1"===n)return r.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(r)}catch(e){return r}},encode:function(e,t,n,o,i){if(0===e.length)return e;var c=e;if("symbol"==typeof e?c=Symbol.prototype.toString.call(e):"string"!=typeof e&&(c=String(e)),"iso-8859-1"===n)return escape(c).replace(/%u[0-9a-f]{4}/gi,(function(e){return"%26%23"+parseInt(e.slice(2),16)+"%3B"}));for(var s="",l=0;l<c.length;++l){var u=c.charCodeAt(l);45===u||46===u||95===u||126===u||u>=48&&u<=57||u>=65&&u<=90||u>=97&&u<=122||i===r.RFC1738&&(40===u||41===u)?s+=c.charAt(l):u<128?s+=a[u]:u<2048?s+=a[192|u>>6]+a[128|63&u]:u<55296||u>=57344?s+=a[224|u>>12]+a[128|u>>6&63]+a[128|63&u]:(l+=1,u=65536+((1023&u)<<10|1023&c.charCodeAt(l)),s+=a[240|u>>18]+a[128|u>>12&63]+a[128|u>>6&63]+a[128|63&u])}return s},isBuffer:function(e){return!(!e||"object"!=typeof e)&&!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))},isRegExp:function(e){return"[object RegExp]"===Object.prototype.toString.call(e)},maybeMap:function(e,t){if(i(e)){for(var n=[],r=0;r<e.length;r+=1)n.push(t(e[r]));return n}return t(e)},merge:function e(t,n,r){if(!n)return t;if("object"!=typeof n){if(i(t))t.push(n);else{if(!t||"object"!=typeof t)return[t,n];(r&&(r.plainObjects||r.allowPrototypes)||!o.call(Object.prototype,n))&&(t[n]=!0)}return t}if(!t||"object"!=typeof t)return[t].concat(n);var a=t;return i(t)&&!i(n)&&(a=c(t,r)),i(t)&&i(n)?(n.forEach((function(n,i){if(o.call(t,i)){var a=t[i];a&&"object"==typeof a&&n&&"object"==typeof n?t[i]=e(a,n,r):t.push(n)}else t[i]=n})),t):Object.keys(n).reduce((function(t,i){var a=n[i];return o.call(t,i)?t[i]=e(t[i],a,r):t[i]=a,t}),a)}}},497:function(e,t,n){"use strict";var r=n(0),o=n(8),i=Object(r.createElement)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(r.createElement)(o.Path,{d:"M13 11.8l6.1-6.3-1-1-6.1 6.2-6.1-6.2-1 1 6.1 6.3-6.5 6.7 1 1 6.5-6.6 6.5 6.6 1-1z"}));t.a=i},498:function(e,t,n){"use strict";var r=n(0),o=n(8),i=Object(r.createElement)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(r.createElement)(o.Path,{d:"M7 5.5h10a.5.5 0 01.5.5v12a.5.5 0 01-.5.5H7a.5.5 0 01-.5-.5V6a.5.5 0 01.5-.5zM17 4H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V6a2 2 0 00-2-2zm-1 3.75H8v1.5h8v-1.5zM8 11h8v1.5H8V11zm6 3.25H8v1.5h6v-1.5z"}));t.a=i},499:function(e,t,n){"use strict";var r=n(0),o=n(8),i=Object(r.createElement)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(r.createElement)(o.Path,{fillRule:"evenodd",d:"M5 5.5h14a.5.5 0 01.5.5v1.5a.5.5 0 01-.5.5H5a.5.5 0 01-.5-.5V6a.5.5 0 01.5-.5zM4 9.232A2 2 0 013 7.5V6a2 2 0 012-2h14a2 2 0 012 2v1.5a2 2 0 01-1 1.732V18a2 2 0 01-2 2H6a2 2 0 01-2-2V9.232zm1.5.268V18a.5.5 0 00.5.5h12a.5.5 0 00.5-.5V9.5h-13z",clipRule:"evenodd"}));t.a=i},5:function(e,t){e.exports=window.React},50:function(e,t,n){"use strict";function r(e){return function(){return e}}var o=function(){};o.thatReturns=r,o.thatReturnsFalse=r(!1),o.thatReturnsTrue=r(!0),o.thatReturnsNull=r(null),o.thatReturnsThis=function(){return this},o.thatReturnsArgument=function(e){return e},e.exports=o},500:function(e,t,n){"use strict";var r=n(0),o=n(8),i=Object(r.createElement)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(r.createElement)(o.Path,{d:"M18.2 17c0 .7-.6 1.2-1.2 1.2H7c-.7 0-1.2-.6-1.2-1.2V7c0-.7.6-1.2 1.2-1.2h3.2V4.2H7C5.5 4.2 4.2 5.5 4.2 7v10c0 1.5 1.2 2.8 2.8 2.8h10c1.5 0 2.8-1.2 2.8-2.8v-3.6h-1.5V17zM14.9 3v1.5h3.7l-6.4 6.4 1.1 1.1 6.4-6.4v3.7h1.5V3h-6.3z"}));t.a=i},52:function(e,t,n){"use strict";n.d(t,"a",(function(){return w})),n.d(t,"c",(function(){return j})),n.d(t,"b",(function(){return f})),n.d(t,"e",(function(){return h})),n.d(t,"d",(function(){return p}));var r=n(23);function o(e){return"/"===e.charAt(0)}function i(e,t){for(var n=t,r=n+1,o=e.length;r<o;n+=1,r+=1)e[n]=e[r];e.pop()}var a=function(e,t){void 0===t&&(t="");var n,r=e&&e.split("/")||[],a=t&&t.split("/")||[],c=e&&o(e),s=t&&o(t),l=c||s;if(e&&o(e)?a=r:r.length&&(a.pop(),a=a.concat(r)),!a.length)return"/";if(a.length){var u=a[a.length-1];n="."===u||".."===u||""===u}else n=!1;for(var d=0,m=a.length;m>=0;m--){var p=a[m];"."===p?i(a,m):".."===p?(i(a,m),d++):d&&(i(a,m),d--)}if(!l)for(;d--;d)a.unshift("..");!l||""===a[0]||a[0]&&o(a[0])||a.unshift("");var f=a.join("/");return n&&"/"!==f.substr(-1)&&(f+="/"),f};function c(e){return e.valueOf?e.valueOf():Object.prototype.valueOf.call(e)}var s=function e(t,n){if(t===n)return!0;if(null==t||null==n)return!1;if(Array.isArray(t))return Array.isArray(n)&&t.length===n.length&&t.every((function(t,r){return e(t,n[r])}));if("object"==typeof t||"object"==typeof n){var r=c(t),o=c(n);return r!==t||o!==n?e(r,o):Object.keys(Object.assign({},t,n)).every((function(r){return e(t[r],n[r])}))}return!1},l=n(41);function u(e){return"/"===e.charAt(0)?e:"/"+e}function d(e,t){return function(e,t){return 0===e.toLowerCase().indexOf(t.toLowerCase())&&-1!=="/?#".indexOf(e.charAt(t.length))}(e,t)?e.substr(t.length):e}function m(e){return"/"===e.charAt(e.length-1)?e.slice(0,-1):e}function p(e){var t=e.pathname,n=e.search,r=e.hash,o=t||"/";return n&&"?"!==n&&(o+="?"===n.charAt(0)?n:"?"+n),r&&"#"!==r&&(o+="#"===r.charAt(0)?r:"#"+r),o}function f(e,t,n,o){var i;"string"==typeof e?(i=function(e){var t=e||"/",n="",r="",o=t.indexOf("#");-1!==o&&(r=t.substr(o),t=t.substr(0,o));var i=t.indexOf("?");return-1!==i&&(n=t.substr(i),t=t.substr(0,i)),{pathname:t,search:"?"===n?"":n,hash:"#"===r?"":r}}(e)).state=t:(void 0===(i=Object(r.a)({},e)).pathname&&(i.pathname=""),i.search?"?"!==i.search.charAt(0)&&(i.search="?"+i.search):i.search="",i.hash?"#"!==i.hash.charAt(0)&&(i.hash="#"+i.hash):i.hash="",void 0!==t&&void 0===i.state&&(i.state=t));try{i.pathname=decodeURI(i.pathname)}catch(e){throw e instanceof URIError?new URIError('Pathname "'+i.pathname+'" could not be decoded. This is likely caused by an invalid percent-encoding.'):e}return n&&(i.key=n),o?i.pathname?"/"!==i.pathname.charAt(0)&&(i.pathname=a(i.pathname,o.pathname)):i.pathname=o.pathname:i.pathname||(i.pathname="/"),i}function h(e,t){return e.pathname===t.pathname&&e.search===t.search&&e.hash===t.hash&&e.key===t.key&&s(e.state,t.state)}function b(){var e=null;var t=[];return{setPrompt:function(t){return e=t,function(){e===t&&(e=null)}},confirmTransitionTo:function(t,n,r,o){if(null!=e){var i="function"==typeof e?e(t,n):e;"string"==typeof i?"function"==typeof r?r(i,o):o(!0):o(!1!==i)}else o(!0)},appendListener:function(e){var n=!0;function r(){n&&e.apply(void 0,arguments)}return t.push(r),function(){n=!1,t=t.filter((function(e){return e!==r}))}},notifyListeners:function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];t.forEach((function(e){return e.apply(void 0,n)}))}}}var v=!("undefined"==typeof window||!window.document||!window.document.createElement);function g(e,t){t(window.confirm(e))}function y(){try{return window.history.state||{}}catch(e){return{}}}function w(e){void 0===e&&(e={}),v||Object(l.a)(!1);var t,n=window.history,o=(-1===(t=window.navigator.userAgent).indexOf("Android 2.")&&-1===t.indexOf("Android 4.0")||-1===t.indexOf("Mobile Safari")||-1!==t.indexOf("Chrome")||-1!==t.indexOf("Windows Phone"))&&window.history&&"pushState"in window.history,i=!(-1===window.navigator.userAgent.indexOf("Trident")),a=e,c=a.forceRefresh,s=void 0!==c&&c,h=a.getUserConfirmation,w=void 0===h?g:h,O=a.keyLength,j=void 0===O?6:O,_=e.basename?m(u(e.basename)):"";function E(e){var t=e||{},n=t.key,r=t.state,o=window.location,i=o.pathname+o.search+o.hash;return _&&(i=d(i,_)),f(i,r,n)}function k(){return Math.random().toString(36).substr(2,j)}var x=b();function S(e){Object(r.a)(D,e),D.length=n.length,x.notifyListeners(D.location,D.action)}function C(e){(function(e){return void 0===e.state&&-1===navigator.userAgent.indexOf("CriOS")})(e)||P(E(e.state))}function T(){P(E(y()))}var A=!1;function P(e){if(A)A=!1,S();else{x.confirmTransitionTo(e,"POP",w,(function(t){t?S({action:"POP",location:e}):function(e){var t=D.location,n=R.indexOf(t.key);-1===n&&(n=0);var r=R.indexOf(e.key);-1===r&&(r=0);var o=n-r;o&&(A=!0,L(o))}(e)}))}}var N=E(y()),R=[N.key];function M(e){return _+p(e)}function L(e){n.go(e)}var V=0;function I(e){1===(V+=e)&&1===e?(window.addEventListener("popstate",C),i&&window.addEventListener("hashchange",T)):0===V&&(window.removeEventListener("popstate",C),i&&window.removeEventListener("hashchange",T))}var F=!1;var D={length:n.length,action:"POP",location:N,createHref:M,push:function(e,t){var r=f(e,t,k(),D.location);x.confirmTransitionTo(r,"PUSH",w,(function(e){if(e){var t=M(r),i=r.key,a=r.state;if(o)if(n.pushState({key:i,state:a},null,t),s)window.location.href=t;else{var c=R.indexOf(D.location.key),l=R.slice(0,c+1);l.push(r.key),R=l,S({action:"PUSH",location:r})}else window.location.href=t}}))},replace:function(e,t){var r=f(e,t,k(),D.location);x.confirmTransitionTo(r,"REPLACE",w,(function(e){if(e){var t=M(r),i=r.key,a=r.state;if(o)if(n.replaceState({key:i,state:a},null,t),s)window.location.replace(t);else{var c=R.indexOf(D.location.key);-1!==c&&(R[c]=r.key),S({action:"REPLACE",location:r})}else window.location.replace(t)}}))},go:L,goBack:function(){L(-1)},goForward:function(){L(1)},block:function(e){void 0===e&&(e=!1);var t=x.setPrompt(e);return F||(I(1),F=!0),function(){return F&&(F=!1,I(-1)),t()}},listen:function(e){var t=x.appendListener(e);return I(1),function(){I(-1),t()}}};return D}function O(e,t,n){return Math.min(Math.max(e,t),n)}function j(e){void 0===e&&(e={});var t=e,n=t.getUserConfirmation,o=t.initialEntries,i=void 0===o?["/"]:o,a=t.initialIndex,c=void 0===a?0:a,s=t.keyLength,l=void 0===s?6:s,u=b();function d(e){Object(r.a)(w,e),w.length=w.entries.length,u.notifyListeners(w.location,w.action)}function m(){return Math.random().toString(36).substr(2,l)}var h=O(c,0,i.length-1),v=i.map((function(e){return f(e,void 0,"string"==typeof e?m():e.key||m())})),g=p;function y(e){var t=O(w.index+e,0,w.entries.length-1),r=w.entries[t];u.confirmTransitionTo(r,"POP",n,(function(e){e?d({action:"POP",location:r,index:t}):d()}))}var w={length:v.length,action:"POP",location:v[h],index:h,entries:v,createHref:g,push:function(e,t){var r=f(e,t,m(),w.location);u.confirmTransitionTo(r,"PUSH",n,(function(e){if(e){var t=w.index+1,n=w.entries.slice(0);n.length>t?n.splice(t,n.length-t,r):n.push(r),d({action:"PUSH",location:r,index:t,entries:n})}}))},replace:function(e,t){var r=f(e,t,m(),w.location);u.confirmTransitionTo(r,"REPLACE",n,(function(e){e&&(w.entries[w.index]=r,d({action:"REPLACE",location:r}))}))},go:y,goBack:function(){y(-1)},goForward:function(){y(1)},canGo:function(e){var t=w.index+e;return t>=0&&t<w.entries.length},block:function(e){return void 0===e&&(e=!1),u.setPrompt(e)},listen:function(e){return u.appendListener(e)}};return w}},55:function(e,t,n){"use strict";n.d(t,"c",(function(){return r})),n.d(t,"a",(function(){return o})),n.d(t,"b",(function(){return i}));const r="wc/customer-effort-score",o="/wc-admin",i="woocommerce_ces_tracks_queue"},59:function(e,t){e.exports=window.wp.date},6:function(e,t,n){!function(){"use strict";var t={}.hasOwnProperty;function n(){for(var e=[],r=0;r<arguments.length;r++){var o=arguments[r];if(o){var i=typeof o;if("string"===i||"number"===i)e.push(o);else if(Array.isArray(o)){if(o.length){var a=n.apply(null,o);a&&e.push(a)}}else if("object"===i)if(o.toString===Object.prototype.toString)for(var c in o)t.call(o,c)&&o[c]&&e.push(c);else e.push(o.toString())}}return e.join(" ")}e.exports?(n.default=n,e.exports=n):"function"==typeof define&&"object"==typeof define.amd&&define.amd?define("classnames",[],(function(){return n})):window.classNames=n}()},60:function(e,t,n){"use strict";n.d(t,"b",(function(){return a})),n.d(t,"c",(function(){return c})),n.d(t,"e",(function(){return s})),n.d(t,"a",(function(){return l})),n.d(t,"d",(function(){return d})),n.d(t,"f",(function(){return m}));var r=n(28),o=n(4),i=n(13);function a(e){return e?e.split(":")[0]:null}function c(e){let t=a(e);return Object(o.without)(Object(i.f)("onboarding",{euCountries:[]}).euCountries,"GB").includes(t)&&(t="EU"),t}function s(e,t,n=!1,r){return u(t,n,r,e).map(e=>e.id||e.product)}function l(e,t,n){const r={};r.products=u(t,!0,n,e),r.remainingProducts=u(t,!1,n,e);const o=[...new Set([...r.products,...r.remainingProducts])];return r.uniqueItemsList=o.map(e=>{let t;return t=e.label?{type:"extension",name:e.label}:{type:"theme",name:e.title},t}),r}function u(e,t=!1,n,r){const o=[];if(!r)return o;(e.product_types||[]).forEach(e=>{r[e]&&r[e].product&&(t||!n.includes(r[e].slug))&&o.push(r[e])});const a=Object(i.f)("onboarding",{});let c=null;return a&&a.themes&&(c=a.themes.find(t=>t.slug===e.theme)),c&&c.id&&d(c.price)>0&&(t||!c.is_installed)&&o.push(c),o}function d(e){return Number(Object(r.decodeEntities)(e).replace(/[^0-9.-]+/g,""))}function m(e){return/admin.php\?page=wc-admin/.test(e)}},66:function(e,t,n){"use strict";n.d(t,"d",(function(){return i})),n.d(t,"c",(function(){return a})),n.d(t,"b",(function(){return c})),n.d(t,"a",(function(){return s}));var r=n(11),o=n(255);function i(e,t){const{getItemsTotalCount:n,getItemsError:o,isResolving:i}=e(r.ITEMS_STORE_NAME);if(!t.length)return 0;const a={page:1,per_page:1,status:t,_fields:["id"]},c=n("orders",a,null),s=Boolean(o("orders",a)),l=i("getItemsTotalCount",["orders",a,null]);return s||l?null:c}function a(e){const{getSetting:t}=e(r.SETTINGS_STORE_NAME),{woocommerce_actionable_order_statuses:n=o.a}=t("wc_admin","wcAdminSettings",{});return n}const c={page:1,per_page:1,low_in_stock:!0,status:"publish",_fields:["id"]};function s(e){const{getItemsTotalCount:t,getItemsError:n,isResolving:o}=e(r.ITEMS_STORE_NAME),i=t("products/low-in-stock",c,null),a=Boolean(n("products/low-in-stock",c)),s=o("getItemsTotalCount",["products/low-in-stock",c,null]);return a||s&&null===i?null:i}},67:function(e,t,n){"use strict";var r=n(49),o=n(39),i=Object.prototype.hasOwnProperty,a={brackets:function(e){return e+"[]"},comma:"comma",indices:function(e,t){return e+"["+t+"]"},repeat:function(e){return e}},c=Array.isArray,s=Array.prototype.push,l=function(e,t){s.apply(e,c(t)?t:[t])},u=Date.prototype.toISOString,d=o.default,m={addQueryPrefix:!1,allowDots:!1,charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encoder:r.encode,encodeValuesOnly:!1,format:d,formatter:o.formatters[d],indices:!1,serializeDate:function(e){return u.call(e)},skipNulls:!1,strictNullHandling:!1},p=function e(t,n,o,i,a,s,u,d,p,f,h,b,v,g){var y,w=t;if("function"==typeof u?w=u(n,w):w instanceof Date?w=f(w):"comma"===o&&c(w)&&(w=r.maybeMap(w,(function(e){return e instanceof Date?f(e):e}))),null===w){if(i)return s&&!v?s(n,m.encoder,g,"key",h):n;w=""}if("string"==typeof(y=w)||"number"==typeof y||"boolean"==typeof y||"symbol"==typeof y||"bigint"==typeof y||r.isBuffer(w))return s?[b(v?n:s(n,m.encoder,g,"key",h))+"="+b(s(w,m.encoder,g,"value",h))]:[b(n)+"="+b(String(w))];var O,j=[];if(void 0===w)return j;if("comma"===o&&c(w))O=[{value:w.length>0?w.join(",")||null:void 0}];else if(c(u))O=u;else{var _=Object.keys(w);O=d?_.sort(d):_}for(var E=0;E<O.length;++E){var k=O[E],x="object"==typeof k&&void 0!==k.value?k.value:w[k];if(!a||null!==x){var S=c(w)?"function"==typeof o?o(n,k):n:n+(p?"."+k:"["+k+"]");l(j,e(x,S,o,i,a,s,u,d,p,f,h,b,v,g))}}return j};e.exports=function(e,t){var n,r=e,s=function(e){if(!e)return m;if(null!==e.encoder&&void 0!==e.encoder&&"function"!=typeof e.encoder)throw new TypeError("Encoder has to be a function.");var t=e.charset||m.charset;if(void 0!==e.charset&&"utf-8"!==e.charset&&"iso-8859-1"!==e.charset)throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var n=o.default;if(void 0!==e.format){if(!i.call(o.formatters,e.format))throw new TypeError("Unknown format option provided.");n=e.format}var r=o.formatters[n],a=m.filter;return("function"==typeof e.filter||c(e.filter))&&(a=e.filter),{addQueryPrefix:"boolean"==typeof e.addQueryPrefix?e.addQueryPrefix:m.addQueryPrefix,allowDots:void 0===e.allowDots?m.allowDots:!!e.allowDots,charset:t,charsetSentinel:"boolean"==typeof e.charsetSentinel?e.charsetSentinel:m.charsetSentinel,delimiter:void 0===e.delimiter?m.delimiter:e.delimiter,encode:"boolean"==typeof e.encode?e.encode:m.encode,encoder:"function"==typeof e.encoder?e.encoder:m.encoder,encodeValuesOnly:"boolean"==typeof e.encodeValuesOnly?e.encodeValuesOnly:m.encodeValuesOnly,filter:a,format:n,formatter:r,serializeDate:"function"==typeof e.serializeDate?e.serializeDate:m.serializeDate,skipNulls:"boolean"==typeof e.skipNulls?e.skipNulls:m.skipNulls,sort:"function"==typeof e.sort?e.sort:null,strictNullHandling:"boolean"==typeof e.strictNullHandling?e.strictNullHandling:m.strictNullHandling}}(t);"function"==typeof s.filter?r=(0,s.filter)("",r):c(s.filter)&&(n=s.filter);var u,d=[];if("object"!=typeof r||null===r)return"";u=t&&t.arrayFormat in a?t.arrayFormat:t&&"indices"in t?t.indices?"indices":"repeat":"indices";var f=a[u];n||(n=Object.keys(r)),s.sort&&n.sort(s.sort);for(var h=0;h<n.length;++h){var b=n[h];s.skipNulls&&null===r[b]||l(d,p(r[b],b,f,s.strictNullHandling,s.skipNulls,s.encode?s.encoder:null,s.filter,s.sort,s.allowDots,s.serializeDate,s.format,s.formatter,s.encodeValuesOnly,s.charset))}var v=d.join(s.delimiter),g=!0===s.addQueryPrefix?"?":"";return s.charsetSentinel&&("iso-8859-1"===s.charset?g+="utf8=%26%2310003%3B&":g+="utf8=%E2%9C%93&"),v.length>0?g+v:""}},68:function(e,t,n){"use strict";var r=n(49),o=Object.prototype.hasOwnProperty,i=Array.isArray,a={allowDots:!1,allowPrototypes:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decoder:r.decode,delimiter:"&",depth:5,ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictNullHandling:!1},c=function(e){return e.replace(/&#(\d+);/g,(function(e,t){return String.fromCharCode(parseInt(t,10))}))},s=function(e,t){return e&&"string"==typeof e&&t.comma&&e.indexOf(",")>-1?e.split(","):e},l=function(e,t,n,r){if(e){var i=n.allowDots?e.replace(/\.([^.[]+)/g,"[$1]"):e,a=/(\[[^[\]]*])/g,c=n.depth>0&&/(\[[^[\]]*])/.exec(i),l=c?i.slice(0,c.index):i,u=[];if(l){if(!n.plainObjects&&o.call(Object.prototype,l)&&!n.allowPrototypes)return;u.push(l)}for(var d=0;n.depth>0&&null!==(c=a.exec(i))&&d<n.depth;){if(d+=1,!n.plainObjects&&o.call(Object.prototype,c[1].slice(1,-1))&&!n.allowPrototypes)return;u.push(c[1])}return c&&u.push("["+i.slice(c.index)+"]"),function(e,t,n,r){for(var o=r?t:s(t,n),i=e.length-1;i>=0;--i){var a,c=e[i];if("[]"===c&&n.parseArrays)a=[].concat(o);else{a=n.plainObjects?Object.create(null):{};var l="["===c.charAt(0)&&"]"===c.charAt(c.length-1)?c.slice(1,-1):c,u=parseInt(l,10);n.parseArrays||""!==l?!isNaN(u)&&c!==l&&String(u)===l&&u>=0&&n.parseArrays&&u<=n.arrayLimit?(a=[])[u]=o:a[l]=o:a={0:o}}o=a}return o}(u,t,n,r)}};e.exports=function(e,t){var n=function(e){if(!e)return a;if(null!==e.decoder&&void 0!==e.decoder&&"function"!=typeof e.decoder)throw new TypeError("Decoder has to be a function.");if(void 0!==e.charset&&"utf-8"!==e.charset&&"iso-8859-1"!==e.charset)throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var t=void 0===e.charset?a.charset:e.charset;return{allowDots:void 0===e.allowDots?a.allowDots:!!e.allowDots,allowPrototypes:"boolean"==typeof e.allowPrototypes?e.allowPrototypes:a.allowPrototypes,arrayLimit:"number"==typeof e.arrayLimit?e.arrayLimit:a.arrayLimit,charset:t,charsetSentinel:"boolean"==typeof e.charsetSentinel?e.charsetSentinel:a.charsetSentinel,comma:"boolean"==typeof e.comma?e.comma:a.comma,decoder:"function"==typeof e.decoder?e.decoder:a.decoder,delimiter:"string"==typeof e.delimiter||r.isRegExp(e.delimiter)?e.delimiter:a.delimiter,depth:"number"==typeof e.depth||!1===e.depth?+e.depth:a.depth,ignoreQueryPrefix:!0===e.ignoreQueryPrefix,interpretNumericEntities:"boolean"==typeof e.interpretNumericEntities?e.interpretNumericEntities:a.interpretNumericEntities,parameterLimit:"number"==typeof e.parameterLimit?e.parameterLimit:a.parameterLimit,parseArrays:!1!==e.parseArrays,plainObjects:"boolean"==typeof e.plainObjects?e.plainObjects:a.plainObjects,strictNullHandling:"boolean"==typeof e.strictNullHandling?e.strictNullHandling:a.strictNullHandling}}(t);if(""===e||null==e)return n.plainObjects?Object.create(null):{};for(var u="string"==typeof e?function(e,t){var n,l={},u=t.ignoreQueryPrefix?e.replace(/^\?/,""):e,d=t.parameterLimit===1/0?void 0:t.parameterLimit,m=u.split(t.delimiter,d),p=-1,f=t.charset;if(t.charsetSentinel)for(n=0;n<m.length;++n)0===m[n].indexOf("utf8=")&&("utf8=%E2%9C%93"===m[n]?f="utf-8":"utf8=%26%2310003%3B"===m[n]&&(f="iso-8859-1"),p=n,n=m.length);for(n=0;n<m.length;++n)if(n!==p){var h,b,v=m[n],g=v.indexOf("]="),y=-1===g?v.indexOf("="):g+1;-1===y?(h=t.decoder(v,a.decoder,f,"key"),b=t.strictNullHandling?null:""):(h=t.decoder(v.slice(0,y),a.decoder,f,"key"),b=r.maybeMap(s(v.slice(y+1),t),(function(e){return t.decoder(e,a.decoder,f,"value")}))),b&&t.interpretNumericEntities&&"iso-8859-1"===f&&(b=c(b)),v.indexOf("[]=")>-1&&(b=i(b)?[b]:b),o.call(l,h)?l[h]=r.combine(l[h],b):l[h]=b}return l}(e,n):e,d=n.plainObjects?Object.create(null):{},m=Object.keys(u),p=0;p<m.length;++p){var f=m[p],h=l(f,u[f],n,"string"==typeof e);d=r.merge(d,h,n)}return r.compact(d)}},69:function(e,t,n){"use strict";var r=n(5),o="function"==typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103,i=n(50),a=n(70),c=n(71),s="function"==typeof Symbol&&Symbol.iterator;function l(e,t){return e&&"object"==typeof e&&null!=e.key?(n=e.key,r={"=":"=0",":":"=2"},"$"+(""+n).replace(/[=:]/g,(function(e){return r[e]}))):t.toString(36);var n,r}function u(e,t,n,r){var i,c=typeof e;if("undefined"!==c&&"boolean"!==c||(e=null),null===e||"string"===c||"number"===c||"object"===c&&e.$$typeof===o)return n(r,e,""===t?"."+l(e,0):t),1;var d=0,m=""===t?".":t+":";if(Array.isArray(e))for(var p=0;p<e.length;p++)d+=u(i=e[p],m+l(i,p),n,r);else{var f=function(e){var t=e&&(s&&e[s]||e["@@iterator"]);if("function"==typeof t)return t}(e);if(f){0;for(var h,b=f.call(e),v=0;!(h=b.next()).done;)d+=u(i=h.value,m+l(i,v++),n,r)}else if("object"===c){0;var g=""+e;a(!1,"Objects are not valid as a React child (found: %s).%s","[object Object]"===g?"object with keys {"+Object.keys(e).join(", ")+"}":g,"")}}return d}var d=/\/+/g;function m(e){return(""+e).replace(d,"$&/")}var p,f,h=b,b=function(e){if(this.instancePool.length){var t=this.instancePool.pop();return this.call(t,e),t}return new this(e)},v=function(e){a(e instanceof this,"Trying to release an instance into a pool of a different type."),e.destructor(),this.instancePool.length<this.poolSize&&this.instancePool.push(e)};function g(e,t,n,r){this.result=e,this.keyPrefix=t,this.func=n,this.context=r,this.count=0}function y(e,t,n){var o,a,c=e.result,s=e.keyPrefix,l=e.func,u=e.context,d=l.call(u,t,e.count++);Array.isArray(d)?w(d,c,n,i.thatReturnsArgument):null!=d&&(r.isValidElement(d)&&(o=d,a=s+(!d.key||t&&t.key===d.key?"":m(d.key)+"/")+n,d=r.cloneElement(o,{key:a},void 0!==o.props?o.props.children:void 0)),c.push(d))}function w(e,t,n,r,o){var i="";null!=n&&(i=m(n)+"/");var a=g.getPooled(t,i,r,o);!function(e,t,n){null==e||u(e,"",t,n)}(e,y,a),g.release(a)}g.prototype.destructor=function(){this.result=null,this.keyPrefix=null,this.func=null,this.context=null,this.count=0},p=function(e,t,n,r){if(this.instancePool.length){var o=this.instancePool.pop();return this.call(o,e,t,n,r),o}return new this(e,t,n,r)},(f=g).instancePool=[],f.getPooled=p||h,f.poolSize||(f.poolSize=10),f.release=v;e.exports=function(e){if("object"!=typeof e||!e||Array.isArray(e))return c(!1,"React.addons.createFragment only accepts a single object. Got: %s",e),e;if(r.isValidElement(e))return c(!1,"React.addons.createFragment does not accept a ReactElement without a wrapper object."),e;a(1!==e.nodeType,"React.addons.createFragment(...): Encountered an invalid child; DOM elements are not valid children of React components.");var t=[];for(var n in e)w(e[n],t,n,i.thatReturnsArgument);return t}},7:function(e,t){e.exports=window.wp.data},70:function(e,t,n){"use strict";e.exports=function(e,t,n,r,o,i,a,c){if(!e){var s;if(void 0===t)s=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var l=[n,r,o,i,a,c],u=0;(s=new Error(t.replace(/%s/g,(function(){return l[u++]})))).name="Invariant Violation"}throw s.framesToPop=1,s}}},71:function(e,t,n){"use strict";var r=n(50);e.exports=r},72:function(e,t,n){"use strict";function r(e){return e.match(/^\{\{\//)?{type:"componentClose",value:e.replace(/\W/g,"")}:e.match(/\/\}\}$/)?{type:"componentSelfClosing",value:e.replace(/\W/g,"")}:e.match(/^\{\{/)?{type:"componentOpen",value:e.replace(/\W/g,"")}:{type:"string",value:e}}e.exports=function(e){return e.split(/(\{\{\/?\s*\w+\s*\/?\}\})/g).map(r)}},78:function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n},8:function(e,t){e.exports=window.wp.primitives},88:function(e,t){e.exports=window.wp.plugins},89:function(e,t){e.exports=window.wc.currency},9:function(e,t){e.exports=window.moment},91:function(e,t){e.exports=window.wp.dom}});woocommerce-admin/dist/app/index.js.LICENSE.txt000064400000000563151335517650015257 0ustar00/*!
  Copyright (c) 2018 Jed Watson.
  Licensed under the MIT License (MIT), see
  http://jedwatson.github.io/classnames
*/

/** @license React v16.13.1
 * react-is.production.min.js
 *
 * Copyright (c) Facebook, Inc. and its affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */
woocommerce-admin/dist/leaderboards/style-rtl.css000064400000003741151335517650016234 0ustar00.woocommerce-leaderboard.woocommerce-empty-content{margin-bottom:24px}.woocommerce-leaderboard .woocommerce-card__body{padding:0}.woocommerce-leaderboard .woocommerce-table__table{margin-bottom:0}.woocommerce-leaderboard .woocommerce-table__table tr:last-child{border-bottom-style:none}:root{--wp-admin-theme-color:#007cba;--wp-admin-theme-color-darker-10:#006ba1;--wp-admin-theme-color-darker-20:#005a87}body.admin-color-light{--wp-admin-theme-color:#0085ba;--wp-admin-theme-color-darker-10:#0073a1;--wp-admin-theme-color-darker-20:#006187}body.admin-color-modern{--wp-admin-theme-color:#3858e9;--wp-admin-theme-color-darker-10:#2145e6;--wp-admin-theme-color-darker-20:#183ad6}body.admin-color-blue{--wp-admin-theme-color:#096484;--wp-admin-theme-color-darker-10:#07526c;--wp-admin-theme-color-darker-20:#064054}body.admin-color-coffee{--wp-admin-theme-color:#46403c;--wp-admin-theme-color-darker-10:#383330;--wp-admin-theme-color-darker-20:#2b2724}body.admin-color-ectoplasm{--wp-admin-theme-color:#523f6d;--wp-admin-theme-color-darker-10:#46365d;--wp-admin-theme-color-darker-20:#3a2c4d}body.admin-color-midnight{--wp-admin-theme-color:#e14d43;--wp-admin-theme-color-darker-10:#dd382d;--wp-admin-theme-color-darker-20:#d02c21}body.admin-color-ocean{--wp-admin-theme-color:#627c83;--wp-admin-theme-color-darker-10:#576e74;--wp-admin-theme-color-darker-20:#4c6066}body.admin-color-sunrise{--wp-admin-theme-color:#dd823b;--wp-admin-theme-color-darker-10:#d97426;--wp-admin-theme-color-darker-20:#c36922}.woocommerce-dashboard__dashboard-leaderboards .components-base-control__field{width:100%}.woocommerce-dashboard__dashboard-leaderboards .components-select-control__input{border:1px solid #ccc;height:34px}.woocommerce-dashboard__dashboard-leaderboards .woocommerce-dashboard__dashboard-leaderboards__select .components-base-control__field{padding:0 12px 4px}.woocommerce-dashboard__dashboard-leaderboards .woocommerce-dashboard__dashboard-leaderboards__select .woocommerce-ellipsis-menu__title{padding:10px 0 14px}woocommerce-admin/dist/marketing-coupons/style-rtl.css000064400000022132151335517650017245 0ustar00.woocommerce-marketing-coupons{padding-top:16px}.woocommerce-marketing-coupons *{box-sizing:border-box}.woocommerce-marketing-coupons .components-card{margin-bottom:24px}.woocommerce-marketing-coupons .woocommerce-marketing-recommended-extensions-item .woocommerce-admin-marketing-product-icon{background:#fff;color:#fff;overflow:hidden;display:flex;align-items:center;justify-content:center;transition:background .2s ease}.woocommerce-marketing-coupons .woocommerce-marketing-recommended-extensions-item .woocommerce-admin-marketing-product-icon:not(.is-placeholder){border:1px solid #007cba;border:1px solid var(--wp-admin-theme-color)}.woocommerce-marketing-coupons .woocommerce-marketing-recommended-extensions-item .woocommerce-admin-marketing-product-icon svg{width:24px;height:24px;transition:fill .2s ease;fill:#007cba;fill:var(--wp-admin-theme-color)}.woocommerce-marketing-coupons .woocommerce-marketing-recommended-extensions-item:hover .woocommerce-admin-marketing-product-icon:not(.is-placeholder){background:#007cba!important;background:var(--wp-admin-theme-color)!important}.woocommerce-marketing-coupons .woocommerce-marketing-recommended-extensions-item:hover .woocommerce-admin-marketing-product-icon:not(.is-placeholder) svg{fill:#fff!important}.woocommerce-marketing-recommended-extensions-card .components-card__body{padding:12px}.woocommerce-marketing-recommended-extensions-card__items{display:flex;flex-wrap:wrap}@media(min-width:601px){.woocommerce-marketing-recommended-extensions-card__items>.is-loading.woocommerce-marketing-recommended-extensions-item,.woocommerce-marketing-recommended-extensions-card__items>a{width:50%}}@media(min-width:961px){.woocommerce-marketing-recommended-extensions-card__items>.is-loading.woocommerce-marketing-recommended-extensions-item,.woocommerce-marketing-recommended-extensions-card__items>a{width:33.3%}.woocommerce-marketing-recommended-extensions-card__items--count-1>.is-loading.woocommerce-marketing-recommended-extensions-item,.woocommerce-marketing-recommended-extensions-card__items--count-1>a{width:100%}.woocommerce-marketing-recommended-extensions-card__items--count-2>.is-loading.woocommerce-marketing-recommended-extensions-item,.woocommerce-marketing-recommended-extensions-card__items--count-2>a{width:50%}.woocommerce-marketing-recommended-extensions-card__items--count-4>.is-loading.woocommerce-marketing-recommended-extensions-item,.woocommerce-marketing-recommended-extensions-card__items--count-4>a{width:25%}}.woocommerce-marketing-recommended-extensions-item{display:block;padding:12px;text-decoration:none;position:relative}.woocommerce-marketing-recommended-extensions-item h4{color:#1e1e1e;margin:-2px 0 3px;font-size:16px;line-height:1.3;transition:color .2s ease}.woocommerce-marketing-recommended-extensions-item p{color:#757575;margin:0}.woocommerce-marketing-recommended-extensions-item:hover h4{color:#007cba;color:var(--wp-admin-theme-color)}.woocommerce-marketing-recommended-extensions-item:hover p{color:#1e1e1e}.woocommerce-marketing-recommended-extensions-item__text{padding-right:46px}.woocommerce-marketing-recommended-extensions-item .woocommerce-admin-marketing-product-icon{position:absolute;top:12px;right:12px}.woocommerce-marketing-recommended-extensions-item.is-loading .is-placeholder{animation:loading-fade 1.6s ease-in-out infinite;background-color:#f0f0f0;color:transparent;display:inline-block;min-height:16px}.woocommerce-marketing-recommended-extensions-item.is-loading .is-placeholder:after{content:" "}@media screen and (prefers-reduced-motion:reduce){.woocommerce-marketing-recommended-extensions-item.is-loading .is-placeholder{animation:none}}.woocommerce-marketing-recommended-extensions-item.is-loading h4{width:80%}.woocommerce-marketing-recommended-extensions-item.is-loading p :last-child{width:60%}.components-button.woocommerce-admin-marketing-button:not([disabled]){border-color:#007cba!important;border-color:var(--wp-admin-theme-color)!important;color:#007cba!important;color:var(--wp-admin-theme-color)!important}.woocommerce-admin-marketing-card .components-card__header .woocommerce-admin-marketing-card-subtitle{font-weight:400;margin-top:4px;color:#757575}.woocommerce-admin-marketing-product-icon{position:relative;overflow:hidden;width:36px;height:36px;border-radius:8px;background:#f0f0f0;color:#f0f0f0}.woocommerce-admin-marketing-product-icon svg{width:36px;height:36px}.woocommerce-marketing-slider,.woocommerce-marketing-slider>div{display:block;width:100%;overflow:hidden}.woocommerce-marketing-slider>div{white-space:normal;position:relative;height:100%}.woocommerce-marketing-slider__slide{top:0;right:0;width:100%;transition:transform .3s ease-in;position:relative}.woocommerce-marketing-slider .slide-enter,.woocommerce-marketing-slider .slide-exit{position:absolute}.woocommerce-marketing-slider.animate-right .slide-enter{transform:translateX(100%)}.woocommerce-marketing-slider.animate-right .slide-enter-active,.woocommerce-marketing-slider.animate-right .slide-exit{transform:translateX(0)}.woocommerce-marketing-slider.animate-left .slide-enter,.woocommerce-marketing-slider.animate-right .slide-exit-active{transform:translateX(-100%)}.woocommerce-marketing-slider.animate-left .slide-enter-active,.woocommerce-marketing-slider.animate-left .slide-exit{transform:translateX(0)}.woocommerce-marketing-slider.animate-left .slide-exit-active{transform:translateX(100%)}@media screen and (prefers-reduced-motion:reduce){.woocommerce-marketing-slider .slide-enter-active,.woocommerce-marketing-slider .slide-exit-active{transition:none!important}}:root{--wp-admin-theme-color:#007cba;--wp-admin-theme-color-darker-10:#006ba1;--wp-admin-theme-color-darker-20:#005a87}body.admin-color-light{--wp-admin-theme-color:#0085ba;--wp-admin-theme-color-darker-10:#0073a1;--wp-admin-theme-color-darker-20:#006187}body.admin-color-modern{--wp-admin-theme-color:#3858e9;--wp-admin-theme-color-darker-10:#2145e6;--wp-admin-theme-color-darker-20:#183ad6}body.admin-color-blue{--wp-admin-theme-color:#096484;--wp-admin-theme-color-darker-10:#07526c;--wp-admin-theme-color-darker-20:#064054}body.admin-color-coffee{--wp-admin-theme-color:#46403c;--wp-admin-theme-color-darker-10:#383330;--wp-admin-theme-color-darker-20:#2b2724}body.admin-color-ectoplasm{--wp-admin-theme-color:#523f6d;--wp-admin-theme-color-darker-10:#46365d;--wp-admin-theme-color-darker-20:#3a2c4d}body.admin-color-midnight{--wp-admin-theme-color:#e14d43;--wp-admin-theme-color-darker-10:#dd382d;--wp-admin-theme-color-darker-20:#d02c21}body.admin-color-ocean{--wp-admin-theme-color:#627c83;--wp-admin-theme-color-darker-10:#576e74;--wp-admin-theme-color-darker-20:#4c6066}body.admin-color-sunrise{--wp-admin-theme-color:#dd823b;--wp-admin-theme-color-darker-10:#d97426;--wp-admin-theme-color-darker-20:#c36922}.woocommerce-marketing-knowledgebase-card .woocommerce-marketing-slider{margin:0 0 14px}.woocommerce-marketing-knowledgebase-card .woocommerce-pagination{justify-content:flex-start;flex-direction:row}.woocommerce-marketing-knowledgebase-card__page{width:100%;display:flex}@media(max-width:960px){.woocommerce-marketing-knowledgebase-card__page{display:block}}.woocommerce-marketing-knowledgebase-card__post{display:flex;flex-wrap:wrap;width:100%;text-decoration:none}.woocommerce-marketing-knowledgebase-card__post:not(:last-child){margin-bottom:16px}@media(min-width:961px){.woocommerce-marketing-knowledgebase-card__post{flex-wrap:nowrap;width:50%}.woocommerce-marketing-knowledgebase-card__post:not(:last-child){margin-bottom:0;padding-left:16px}}.woocommerce-marketing-knowledgebase-card__post-img{width:100%;padding-bottom:52%;overflow:hidden;position:relative;flex:none;border-radius:3px}@media(min-width:961px){.woocommerce-marketing-knowledgebase-card__post-img{width:144px;height:103px;margin-left:16px;padding-bottom:0}}.woocommerce-marketing-knowledgebase-card__post-img img{position:absolute;top:0;left:0;display:block;width:100%}@media(min-width:961px){.woocommerce-marketing-knowledgebase-card__post-img img{position:absolute;top:0;left:0;height:100%;width:auto}}.woocommerce-marketing-knowledgebase-card__post-text{margin:10px 0 0;flex:1}@media(min-width:961px){.woocommerce-marketing-knowledgebase-card__post-text{margin:0}}.woocommerce-marketing-knowledgebase-card__post h3{margin-top:0;margin-bottom:6px;font-size:16px;line-height:24px;font-weight:600;white-space:normal;color:#1e1e1e;transition:color .2s ease}.woocommerce-marketing-knowledgebase-card__post:hover h3{color:#007cba;color:var(--wp-admin-theme-color)}.woocommerce-marketing-knowledgebase-card__post-meta{display:flex;justify-content:flex-start;align-items:center;font-size:12px;line-height:17px;color:#757575;margin:0;padding:0;height:17px}.woocommerce-marketing-knowledgebase-card__post-meta .woocommerce-gravatar{margin:1px 5px 0 0}.woocommerce-marketing-knowledgebase-card__post.is-loading .is-placeholder{animation:loading-fade 1.6s ease-in-out infinite;background-color:#f0f0f0;color:transparent}.woocommerce-marketing-knowledgebase-card__post.is-loading .is-placeholder:after{content:" "}@media screen and (prefers-reduced-motion:reduce){.woocommerce-marketing-knowledgebase-card__post.is-loading .is-placeholder{animation:none}}.woocommerce-marketing-knowledgebase-card__post.is-loading p{width:40%}woocommerce-admin/dist/marketing-coupons/style.css000064400000022134151335517650016450 0ustar00.woocommerce-marketing-coupons{padding-top:16px}.woocommerce-marketing-coupons *{box-sizing:border-box}.woocommerce-marketing-coupons .components-card{margin-bottom:24px}.woocommerce-marketing-coupons .woocommerce-marketing-recommended-extensions-item .woocommerce-admin-marketing-product-icon{background:#fff;color:#fff;overflow:hidden;display:flex;align-items:center;justify-content:center;transition:background .2s ease}.woocommerce-marketing-coupons .woocommerce-marketing-recommended-extensions-item .woocommerce-admin-marketing-product-icon:not(.is-placeholder){border:1px solid #007cba;border:1px solid var(--wp-admin-theme-color)}.woocommerce-marketing-coupons .woocommerce-marketing-recommended-extensions-item .woocommerce-admin-marketing-product-icon svg{width:24px;height:24px;transition:fill .2s ease;fill:#007cba;fill:var(--wp-admin-theme-color)}.woocommerce-marketing-coupons .woocommerce-marketing-recommended-extensions-item:hover .woocommerce-admin-marketing-product-icon:not(.is-placeholder){background:#007cba!important;background:var(--wp-admin-theme-color)!important}.woocommerce-marketing-coupons .woocommerce-marketing-recommended-extensions-item:hover .woocommerce-admin-marketing-product-icon:not(.is-placeholder) svg{fill:#fff!important}.woocommerce-marketing-recommended-extensions-card .components-card__body{padding:12px}.woocommerce-marketing-recommended-extensions-card__items{display:flex;flex-wrap:wrap}@media(min-width:601px){.woocommerce-marketing-recommended-extensions-card__items>.is-loading.woocommerce-marketing-recommended-extensions-item,.woocommerce-marketing-recommended-extensions-card__items>a{width:50%}}@media(min-width:961px){.woocommerce-marketing-recommended-extensions-card__items>.is-loading.woocommerce-marketing-recommended-extensions-item,.woocommerce-marketing-recommended-extensions-card__items>a{width:33.3%}.woocommerce-marketing-recommended-extensions-card__items--count-1>.is-loading.woocommerce-marketing-recommended-extensions-item,.woocommerce-marketing-recommended-extensions-card__items--count-1>a{width:100%}.woocommerce-marketing-recommended-extensions-card__items--count-2>.is-loading.woocommerce-marketing-recommended-extensions-item,.woocommerce-marketing-recommended-extensions-card__items--count-2>a{width:50%}.woocommerce-marketing-recommended-extensions-card__items--count-4>.is-loading.woocommerce-marketing-recommended-extensions-item,.woocommerce-marketing-recommended-extensions-card__items--count-4>a{width:25%}}.woocommerce-marketing-recommended-extensions-item{display:block;padding:12px;text-decoration:none;position:relative}.woocommerce-marketing-recommended-extensions-item h4{color:#1e1e1e;margin:-2px 0 3px;font-size:16px;line-height:1.3;transition:color .2s ease}.woocommerce-marketing-recommended-extensions-item p{color:#757575;margin:0}.woocommerce-marketing-recommended-extensions-item:hover h4{color:#007cba;color:var(--wp-admin-theme-color)}.woocommerce-marketing-recommended-extensions-item:hover p{color:#1e1e1e}.woocommerce-marketing-recommended-extensions-item__text{padding-left:46px}.woocommerce-marketing-recommended-extensions-item .woocommerce-admin-marketing-product-icon{position:absolute;top:12px;left:12px}.woocommerce-marketing-recommended-extensions-item.is-loading .is-placeholder{animation:loading-fade 1.6s ease-in-out infinite;background-color:#f0f0f0;color:transparent;display:inline-block;min-height:16px}.woocommerce-marketing-recommended-extensions-item.is-loading .is-placeholder:after{content:" "}@media screen and (prefers-reduced-motion:reduce){.woocommerce-marketing-recommended-extensions-item.is-loading .is-placeholder{animation:none}}.woocommerce-marketing-recommended-extensions-item.is-loading h4{width:80%}.woocommerce-marketing-recommended-extensions-item.is-loading p :last-child{width:60%}.components-button.woocommerce-admin-marketing-button:not([disabled]){border-color:#007cba!important;border-color:var(--wp-admin-theme-color)!important;color:#007cba!important;color:var(--wp-admin-theme-color)!important}.woocommerce-admin-marketing-card .components-card__header .woocommerce-admin-marketing-card-subtitle{font-weight:400;margin-top:4px;color:#757575}.woocommerce-admin-marketing-product-icon{position:relative;overflow:hidden;width:36px;height:36px;border-radius:8px;background:#f0f0f0;color:#f0f0f0}.woocommerce-admin-marketing-product-icon svg{width:36px;height:36px}.woocommerce-marketing-slider,.woocommerce-marketing-slider>div{display:block;width:100%;overflow:hidden}.woocommerce-marketing-slider>div{white-space:normal;position:relative;height:100%}.woocommerce-marketing-slider__slide{top:0;left:0;width:100%;transition:transform .3s ease-in;position:relative}.woocommerce-marketing-slider .slide-enter,.woocommerce-marketing-slider .slide-exit{position:absolute}.woocommerce-marketing-slider.animate-right .slide-enter{transform:translateX(-100%)}.woocommerce-marketing-slider.animate-right .slide-enter-active,.woocommerce-marketing-slider.animate-right .slide-exit{transform:translateX(0)}.woocommerce-marketing-slider.animate-left .slide-enter,.woocommerce-marketing-slider.animate-right .slide-exit-active{transform:translateX(100%)}.woocommerce-marketing-slider.animate-left .slide-enter-active,.woocommerce-marketing-slider.animate-left .slide-exit{transform:translateX(0)}.woocommerce-marketing-slider.animate-left .slide-exit-active{transform:translateX(-100%)}@media screen and (prefers-reduced-motion:reduce){.woocommerce-marketing-slider .slide-enter-active,.woocommerce-marketing-slider .slide-exit-active{transition:none!important}}:root{--wp-admin-theme-color:#007cba;--wp-admin-theme-color-darker-10:#006ba1;--wp-admin-theme-color-darker-20:#005a87}body.admin-color-light{--wp-admin-theme-color:#0085ba;--wp-admin-theme-color-darker-10:#0073a1;--wp-admin-theme-color-darker-20:#006187}body.admin-color-modern{--wp-admin-theme-color:#3858e9;--wp-admin-theme-color-darker-10:#2145e6;--wp-admin-theme-color-darker-20:#183ad6}body.admin-color-blue{--wp-admin-theme-color:#096484;--wp-admin-theme-color-darker-10:#07526c;--wp-admin-theme-color-darker-20:#064054}body.admin-color-coffee{--wp-admin-theme-color:#46403c;--wp-admin-theme-color-darker-10:#383330;--wp-admin-theme-color-darker-20:#2b2724}body.admin-color-ectoplasm{--wp-admin-theme-color:#523f6d;--wp-admin-theme-color-darker-10:#46365d;--wp-admin-theme-color-darker-20:#3a2c4d}body.admin-color-midnight{--wp-admin-theme-color:#e14d43;--wp-admin-theme-color-darker-10:#dd382d;--wp-admin-theme-color-darker-20:#d02c21}body.admin-color-ocean{--wp-admin-theme-color:#627c83;--wp-admin-theme-color-darker-10:#576e74;--wp-admin-theme-color-darker-20:#4c6066}body.admin-color-sunrise{--wp-admin-theme-color:#dd823b;--wp-admin-theme-color-darker-10:#d97426;--wp-admin-theme-color-darker-20:#c36922}.woocommerce-marketing-knowledgebase-card .woocommerce-marketing-slider{margin:0 0 14px}.woocommerce-marketing-knowledgebase-card .woocommerce-pagination{justify-content:flex-start;flex-direction:row}.woocommerce-marketing-knowledgebase-card__page{width:100%;display:flex}@media(max-width:960px){.woocommerce-marketing-knowledgebase-card__page{display:block}}.woocommerce-marketing-knowledgebase-card__post{display:flex;flex-wrap:wrap;width:100%;text-decoration:none}.woocommerce-marketing-knowledgebase-card__post:not(:last-child){margin-bottom:16px}@media(min-width:961px){.woocommerce-marketing-knowledgebase-card__post{flex-wrap:nowrap;width:50%}.woocommerce-marketing-knowledgebase-card__post:not(:last-child){margin-bottom:0;padding-right:16px}}.woocommerce-marketing-knowledgebase-card__post-img{width:100%;padding-bottom:52%;overflow:hidden;position:relative;flex:none;border-radius:3px}@media(min-width:961px){.woocommerce-marketing-knowledgebase-card__post-img{width:144px;height:103px;margin-right:16px;padding-bottom:0}}.woocommerce-marketing-knowledgebase-card__post-img img{position:absolute;top:0;right:0;display:block;width:100%}@media(min-width:961px){.woocommerce-marketing-knowledgebase-card__post-img img{position:absolute;top:0;right:0;height:100%;width:auto}}.woocommerce-marketing-knowledgebase-card__post-text{margin:10px 0 0;flex:1}@media(min-width:961px){.woocommerce-marketing-knowledgebase-card__post-text{margin:0}}.woocommerce-marketing-knowledgebase-card__post h3{margin-top:0;margin-bottom:6px;font-size:16px;line-height:24px;font-weight:600;white-space:normal;color:#1e1e1e;transition:color .2s ease}.woocommerce-marketing-knowledgebase-card__post:hover h3{color:#007cba;color:var(--wp-admin-theme-color)}.woocommerce-marketing-knowledgebase-card__post-meta{display:flex;justify-content:flex-start;align-items:center;font-size:12px;line-height:17px;color:#757575;margin:0;padding:0;height:17px}.woocommerce-marketing-knowledgebase-card__post-meta .woocommerce-gravatar{margin:1px 0 0 5px}.woocommerce-marketing-knowledgebase-card__post.is-loading .is-placeholder{animation:loading-fade 1.6s ease-in-out infinite;background-color:#f0f0f0;color:transparent}.woocommerce-marketing-knowledgebase-card__post.is-loading .is-placeholder:after{content:" "}@media screen and (prefers-reduced-motion:reduce){.woocommerce-marketing-knowledgebase-card__post.is-loading .is-placeholder{animation:none}}.woocommerce-marketing-knowledgebase-card__post.is-loading p{width:40%}woocommerce-admin/dist/profile-wizard/style-rtl.css000064400000052614151335517650016546 0ustar00.woocommerce-profile-wizard__business-details__free-features{display:flex;flex-direction:column;justify-content:center}.woocommerce-profile-wizard__business-details__free-features .woocommerce-admin__business-details__selective-extensions-bundle .woocommerce-admin__business-details__selective-extensions-bundle__category{font-size:11px;text-transform:uppercase;margin:25px 30px 0 0;color:#000;font-weight:500}.woocommerce-profile-wizard__business-details__free-features .woocommerce-admin__business-details__selective-extensions-bundle .woocommerce-admin__business-details__selective-extensions-bundle__extension{display:flex;padding:24px 30px;border-bottom:1px solid #e0e0e0;align-items:center}.woocommerce-profile-wizard__business-details__free-features .woocommerce-admin__business-details__selective-extensions-bundle .woocommerce-admin__business-details__selective-extensions-bundle__description{font-size:16px;color:#1e1e1e;margin:0;line-height:18px}.woocommerce-profile-wizard__business-details__free-features .woocommerce-admin__business-details__selective-extensions-bundle .woocommerce-admin__business-details__free-badge{padding:0 8px;border:1px solid #757575;border-radius:16px;margin-right:8px;color:#757575;font-size:12px;line-height:18px;height:20px}.woocommerce-profile-wizard__business-details__free-features .woocommerce-admin__business-details__selective-extensions-bundle .woocommerce-admin__business-details__selective-extensions-bundle__link{text-decoration:none}.woocommerce-profile-wizard__business-details__free-features .woocommerce-card__body{padding:0}.woocommerce-profile-wizard__business-details__free-features .components-base-control .components-base-control__field{margin-bottom:0;margin-left:21px}.woocommerce-profile-wizard__business-details__free-features .components-base-control .components-base-control__field .components-checkbox-control__input-container{margin-left:0;vertical-align:baseline}.woocommerce-profile-wizard__business-details__free-features .woocommerce-admin__business-details__selective-extensions-bundle__expand{margin-right:9px}.woocommerce-profile-wizard__business-details__free-features .woocommerce-profile-wizard__business-details__free-features__illustration{flex:1;width:100%;display:flex;justify-content:center;margin-top:34px;margin-bottom:18px}.woocommerce-profile-wizard__business-details__free-features .woocommerce-profile-wizard__business-details__free-features__illustration .fill-theme-color{fill:#007cba;fill:var(--wp-admin-theme-color)}.woocommerce-profile-wizard__business-details__free-features .woocommerce-profile-wizard__business-details__free-features__action{padding-top:12px;display:flex;justify-content:center;margin-bottom:12px}.woocommerce-profile-wizard__container.business-features .components-tab-panel__tabs{justify-content:center}.woocommerce-profile-wizard__container.business-features .components-tab-panel__tabs .components-tab-panel__tabs-item.is-disabled{color:#949494;cursor:default;pointer-events:none}.woocommerce-profile-wizard__container.business-features .components-tab-panel__tabs .components-tab-panel__tabs-item.is-active{pointer-events:none}.woocommerce-profile-wizard__container.business-features .components-card__body{padding:16px 16px 0}.business-details.woocommerce-profile-wizard__container .woocommerce-admin__business-details__spinner,.business-features.woocommerce-profile-wizard__container .woocommerce-admin__business-details__spinner{display:flex;justify-content:center}.business-details.woocommerce-profile-wizard__container .woocommerce-profile-wizard__step-header,.business-features.woocommerce-profile-wizard__container .woocommerce-profile-wizard__step-header{margin-top:28px}.woocommerce-profile-wizard__body .woocommerce-profile-wizard__product-types .woocommerce-product-wizard__product-types-label{display:inline-block;margin-left:4px}.woocommerce-profile-wizard__body .woocommerce-profile-wizard__product-types .woocommerce-profile-wizard__checkbox-group .woocommerce-profile-wizard__checkbox{display:flex;align-items:center;min-height:64px}.woocommerce-profile-wizard__body .woocommerce-profile-wizard__product-types .woocommerce-profile-wizard__checkbox-group .woocommerce-profile-wizard__checkbox .components-button{padding:0;height:auto}.woocommerce-profile-wizard__body .woocommerce-profile-wizard__product-types .components-base-control__field,.woocommerce-profile-wizard__body .woocommerce-profile-wizard__product-types .components-checkbox-control__label{display:flex;width:100%;align-items:center}.woocommerce-profile-wizard__body .woocommerce-profile-wizard__product-types .components-checkbox-control__label .woocommerce-pill{margin-right:auto}.woocommerce-profile-wizard__body .woocommerce-profile-wizard__product-types .components-popover .components-popover__content{min-width:360px}.woocommerce-profile-wizard__body .woocommerce-profile-wizard__product-types .woocommerce-profile-wizard__product-types-pricing-toggle.woocommerce-profile-wizard__checkbox{display:flex;align-items:center;justify-content:flex-end;color:#949494;margin-bottom:16px}.woocommerce-profile-wizard__body .woocommerce-profile-wizard__product-types .woocommerce-profile-wizard__product-types-pricing-toggle.woocommerce-profile-wizard__checkbox label{display:inline-flex;align-items:center;margin:auto}.woocommerce-profile-wizard__body .woocommerce-profile-wizard__product-types .woocommerce-profile-wizard__product-types-pricing-toggle.woocommerce-profile-wizard__checkbox .components-form-toggle{display:inline-flex;margin-right:16px}.woocommerce-profile-wizard__body .woocommerce-profile-wizard__product-types__spinner{text-align:center}@media screen and (max-width:438px){.woocommerce-profile-wizard__body .woocommerce-profile-wizard__product-types .woocommerce-product-wizard__product-types-label{width:min-content}}@media screen and (max-width:375px){.woocommerce-profile-wizard__body .woocommerce-profile-wizard__product-types .woocommerce-pill{white-space:nowrap}}.woocommerce-profile-wizard__store-details .woocommerce-admin__store-details__spinner{display:flex;justify-content:center}.woocommerce-profile-wizard__store-details .components-popover .components-popover__content{min-width:360px}.woocommerce-profile-wizard__newsletter-signup .components-base-control__field{display:flex;align-items:center}.woocommerce-profile-wizard__newsletter-signup .woocommerce-profile-wizard__powered-by-mailchimp{color:#a7aaad}.woocommerce-profile-wizard__body .woocommerce-profile-wizard__container>.woocommerce-profile-wizard__themes-tab-panel{margin-bottom:24px}@media(min-width:783px){.woocommerce-profile-wizard__body .woocommerce-profile-wizard__container>.woocommerce-profile-wizard__themes-tab-panel{max-width:810px}.woocommerce-profile-wizard__body .woocommerce-profile-wizard__container>.woocommerce-profile-wizard__themes-tab-panel .woocommerce-profile-wizard__themes{display:grid;grid-gap:24px;grid-template-columns:1fr 1fr}}.woocommerce-profile-wizard__themes-tab-panel .components-tab-panel__tabs{display:flex;justify-content:space-between;background:#fff;box-shadow:0 2px 1px -1px rgba(0,0,0,.2),0 1px 1px 0 rgba(0,0,0,.14),0 1px 3px 0 rgba(0,0,0,.12);border-radius:3px;margin-top:24px;margin-bottom:24px}.woocommerce-profile-wizard__themes-tab-panel .components-tab-panel__tabs button{border:0;color:#646970;display:flex;align-items:center;justify-content:center;background:transparent;height:48px;width:100%;font-size:14px;font-size:.875rem;font-weight:500;outline:none;padding:0 24px}p.woocommerce-profile-wizard__themes-skip-this-step{text-align:center}.woocommerce-profile-wizard__body .woocommerce-profile-wizard__theme.components-card{overflow:hidden}@media(min-width:783px){.woocommerce-profile-wizard__body .woocommerce-profile-wizard__theme.components-card{margin:0}}.woocommerce-profile-wizard__body .woocommerce-profile-wizard__theme.components-card .woocommerce-profile-wizard__theme-image{width:100%;height:300px;background-size:cover}.woocommerce-profile-wizard__body .woocommerce-profile-wizard__theme.components-card .woocommerce-profile-wizard__theme-name{margin-top:auto;margin-bottom:8px;font-size:24px;font-size:1.5rem;font-weight:400}.woocommerce-profile-wizard__body .woocommerce-profile-wizard__theme.components-card .woocommerce-profile-wizard__theme-name svg{max-width:18px;height:18px;margin-right:8px}.woocommerce-profile-wizard__body .woocommerce-profile-wizard__theme.components-card .woocommerce-profile-wizard__theme-name svg path{fill:#d63638}.woocommerce-profile-wizard__body .woocommerce-profile-wizard__theme.components-card .woocommerce-profile-wizard__theme-status{margin:0;font-size:14px}.woocommerce-profile-wizard__body .woocommerce-profile-wizard__theme.components-card .woocommerce-profile-wizard__theme-learn-more{display:inline-block}.woocommerce-profile-wizard__body .woocommerce-theme-uploader.components-card{margin:0;position:relative}.woocommerce-profile-wizard__body .woocommerce-theme-uploader.components-card.is-uploading .woocommerce-theme-uploader__dropzone-wrapper{min-height:382px}.woocommerce-profile-wizard__body .woocommerce-theme-uploader.components-card .woocommerce-theme-uploader__dropzone-wrapper{display:flex;flex-direction:column;align-items:center;justify-content:center;border-radius:2px;background:#f6f6f6;border:1px dashed #b0b5b8}.woocommerce-profile-wizard__body .woocommerce-theme-uploader.components-card .components-form-file-upload{flex:1 1 auto;width:100%;display:flex}.woocommerce-profile-wizard__body .woocommerce-theme-uploader.components-card .components-form-file-upload>.components-button{flex:1 1 auto;flex-direction:column;justify-content:center;margin:0;width:100%;height:100%;min-height:380px}.woocommerce-profile-wizard__body .woocommerce-theme-uploader.components-card .components-form-file-upload>.components-button>.gridicon{width:48px;height:48px}.woocommerce-profile-wizard__body .woocommerce-theme-uploader.components-card .components-form-file-upload>.components-button>.gridicon path{fill:#50575d}.woocommerce-profile-wizard__body .woocommerce-theme-uploader.components-card .components-form-file-upload>.components-button .dashicons-upload{display:none}.woocommerce-profile-wizard__body .woocommerce-theme-uploader.components-card .woocommerce-theme-uploader__title{margin:8px 0;font-size:24px;font-size:1.5rem;font-weight:400}.woocommerce-profile-wizard__body .woocommerce-theme-uploader.components-card p{font-size:14px;font-size:.875rem;margin:0}.woocommerce-theme-preview{position:fixed;top:0;right:0;width:100%;height:100%;max-width:100%!important;display:flex;flex-direction:column}.woocommerce-theme-preview .woocommerce-theme-preview__toolbar{background:#fff;flex-direction:row;display:flex;height:60px;border-bottom:1px solid #dcdcde;padding-right:16px;padding-left:16px;align-items:center}.woocommerce-theme-preview .woocommerce-theme-preview__toolbar .is-button.is-primary{height:40px;margin:0}@media(max-width:782px){.woocommerce-theme-preview .woocommerce-theme-preview__toolbar .is-button.is-primary{margin-right:auto}}.woocommerce-theme-preview .woocommerce-theme-preview__theme-name{padding-right:16px;color:#1d2327;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:50%}.woocommerce-theme-preview .woocommerce-theme-preview__close{padding:0 0 0 16px;color:#646970}.woocommerce-theme-preview .woocommerce-theme-preview__devices{margin-right:auto;margin-left:16px}.woocommerce-theme-preview .woocommerce-theme-preview__devices .woocommerce-theme-preview__device{padding:12px;color:#646970;margin:0;border-radius:50%}.woocommerce-theme-preview .woocommerce-theme-preview__devices .woocommerce-theme-preview__device.is-selected,.woocommerce-theme-preview .woocommerce-theme-preview__devices .woocommerce-theme-preview__device:focus{background:#646970;color:#fff}@media(max-width:782px){.woocommerce-theme-preview .woocommerce-theme-preview__devices{display:none}}.woocommerce-theme-preview .woocommerce-web-preview{flex:1;padding:40px 16px;overflow:scroll}.woocommerce-theme-preview .woocommerce-web-preview .woocommerce-web-preview__iframe-wrapper{height:100%;border-radius:3px;box-shadow:0 2px 1px -1px rgba(0,0,0,.2),0 1px 1px 0 rgba(0,0,0,.14),0 1px 3px 0 rgba(0,0,0,.12);overflow:hidden;margin:0 auto}.woocommerce-theme-preview .woocommerce-web-preview .woocommerce-web-preview__iframe-wrapper iframe{display:block}.woocommerce-theme-preview .woocommerce-web-preview.is-mobile .woocommerce-web-preview__iframe-wrapper{max-width:360px}.woocommerce-theme-preview .woocommerce-web-preview.is-tablet .woocommerce-web-preview__iframe-wrapper{max-width:768px}.woocommerce-theme-preview .woocommerce-web-preview.is-desktop{width:100%;padding:0}.woocommerce-theme-preview .woocommerce-web-preview.is-desktop .woocommerce-web-preview__iframe-wrapper{border-radius:0;box-shadow:none}.woocommerce-theme-preview-active{overflow:hidden}.woocommerce-theme-preview-active .woocommerce-profile-wizard__header{display:none}:root{--wp-admin-theme-color:#007cba;--wp-admin-theme-color-darker-10:#006ba1;--wp-admin-theme-color-darker-20:#005a87}body.admin-color-light{--wp-admin-theme-color:#0085ba;--wp-admin-theme-color-darker-10:#0073a1;--wp-admin-theme-color-darker-20:#006187}body.admin-color-modern{--wp-admin-theme-color:#3858e9;--wp-admin-theme-color-darker-10:#2145e6;--wp-admin-theme-color-darker-20:#183ad6}body.admin-color-blue{--wp-admin-theme-color:#096484;--wp-admin-theme-color-darker-10:#07526c;--wp-admin-theme-color-darker-20:#064054}body.admin-color-coffee{--wp-admin-theme-color:#46403c;--wp-admin-theme-color-darker-10:#383330;--wp-admin-theme-color-darker-20:#2b2724}body.admin-color-ectoplasm{--wp-admin-theme-color:#523f6d;--wp-admin-theme-color-darker-10:#46365d;--wp-admin-theme-color-darker-20:#3a2c4d}body.admin-color-midnight{--wp-admin-theme-color:#e14d43;--wp-admin-theme-color-darker-10:#dd382d;--wp-admin-theme-color-darker-20:#d02c21}body.admin-color-ocean{--wp-admin-theme-color:#627c83;--wp-admin-theme-color-darker-10:#576e74;--wp-admin-theme-color-darker-20:#4c6066}body.admin-color-sunrise{--wp-admin-theme-color:#dd823b;--wp-admin-theme-color-darker-10:#d97426;--wp-admin-theme-color-darker-20:#c36922}.woocommerce-profile-wizard__body .woocommerce-profile-wizard__step-header{text-align:center;margin:16px 0 24px}.woocommerce-profile-wizard__body .woocommerce-profile-wizard__step-header h2{margin-bottom:4px;color:#1e1e1e}.woocommerce-profile-wizard__body .woocommerce-profile-wizard__step-header p{color:#757575;display:flex;align-items:center;justify-content:center;line-height:1.5em}.woocommerce-profile-wizard__body .woocommerce-profile-wizard__step-header p .woocommerce-profile-wizard__tooltip-icon{height:16px}.woocommerce-profile-wizard__body .woocommerce-profile-wizard__header{height:60px;border-bottom:1px solid #dcdcde;display:flex;align-items:center;justify-content:center;background:#fff}.woocommerce-profile-wizard__body .woocommerce-profile-wizard__header-subtitle{font-weight:400;text-align:center;color:#757575;font-size:16px;line-height:24px;margin-top:8px;margin-bottom:32px;margin-left:8px;display:flex;justify-content:center}.woocommerce-profile-wizard__body .woocommerce-profile-wizard__intro-paragraph{margin-top:5px;margin-bottom:18px}.woocommerce-profile-wizard__body .woocommerce-profile-wizard__container{margin:36px auto 16px;text-align:right}.woocommerce-profile-wizard__body .woocommerce-profile-wizard__container>*{max-width:504px;margin-right:auto;margin-left:auto}@media(max-width:782px){.woocommerce-profile-wizard__body .woocommerce-profile-wizard__container{padding-right:16px;padding-left:16px;margin-bottom:72px;margin-top:0}}.woocommerce-profile-wizard__body .woocommerce-profile-wizard__container .components-popover__content>div{padding:16px 24px}.woocommerce-profile-wizard__body .woocommerce-profile-wizard__container .woocommerce-profile-wizard__footer{margin:34px auto;display:flex;justify-content:center}.woocommerce-profile-wizard__body .woocommerce-profile-wizard__container .woocommerce-profile-wizard__footer-link{display:flex;text-decoration:none}.woocommerce-profile-wizard__body .woocommerce-profile-wizard__container .woocommerce-profile-wizard__footnote{max-width:424px;margin:32px auto 25px}.woocommerce-profile-wizard__body .woocommerce-profile-wizard__container .woocommerce-profile-wizard__footnote p{color:#757575;text-align:center;margin-bottom:12px}.woocommerce-profile-wizard__body #woocommerce-layout__primary{text-align:center;margin:0;width:100%}.woocommerce-profile-wizard__body .woocommerce-layout .woocommerce-layout__main{padding-left:0}.woocommerce-profile-wizard__body .woocommerce-profile-wizard__error{display:block;padding:16px 24px;font-size:12px;color:#d63638}.woocommerce-profile-wizard__body .woocommerce-profile-wizard__benefit{display:flex}.woocommerce-profile-wizard__body .woocommerce-profile-wizard__benefit svg:first-child{width:24px;min-width:24px;margin-left:24px}.woocommerce-profile-wizard__body .woocommerce-profile-wizard__benefit .woocommerce-profile-wizard__benefit-title{font-size:16px;font-weight:400;margin-top:0;margin-bottom:8px}.woocommerce-profile-wizard__body .woocommerce-profile-wizard__benefit .woocommerce-profile-wizard__benefit-content{margin-right:16px}.woocommerce-profile-wizard__body .woocommerce-profile-wizard__benefit .woocommerce-profile-wizard__benefit-content p{padding-bottom:16px;margin-top:0;border-bottom:1px solid #dcdcde;font-size:14px}.woocommerce-profile-wizard__body .woocommerce-profile-wizard__benefit .woocommerce-profile-wizard__benefit-toggle{padding-top:36px;margin-right:16px}.woocommerce-profile-wizard__body .woocommerce-profile-wizard__benefit:last-child p{border-bottom:0;margin-bottom:0}.woocommerce-profile-wizard__body .woocommerce-profile-wizard__business-extension{background:#f6f6f6;height:100%;padding:12px 4px}.woocommerce-profile-wizard__body .woocommerce-profile-wizard__business-extension img{box-sizing:unset;max-width:100px;max-height:50%;vertical-align:middle}.woocommerce-profile-wizard__body .woocommerce-profile-wizard__tracking .woocommerce-profile-wizard__tracking-checkbox{margin-top:16px}.woocommerce-profile-wizard__body .woocommerce-profile-wizard__tracking .components-form-toggle{display:none}@media(max-width:782px){.woocommerce-profile-wizard__body .woocommerce-profile-wizard__tracking{display:flex;flex-direction:row-reverse;align-items:center;justify-content:flex-end}.woocommerce-profile-wizard__body .woocommerce-profile-wizard__tracking .components-form-toggle{display:inline-block}.woocommerce-profile-wizard__body .woocommerce-profile-wizard__tracking .components-checkbox-control__input{display:none}}.woocommerce-profile-wizard__body .woocommerce-profile-wizard__checkbox{margin-top:0;margin-bottom:0;position:relative;padding:12px 24px;min-height:62px;border-bottom:1px solid #f0f0f0;display:flex;align-items:center}.woocommerce-profile-wizard__body .woocommerce-profile-wizard__checkbox .components-base-control{position:relative}.woocommerce-profile-wizard__body .woocommerce-profile-wizard__checkbox .components-base-control__field{width:100%;margin:0}.woocommerce-profile-wizard__body .woocommerce-profile-wizard__checkbox label.components-checkbox-control__label{font-size:16px;margin-right:0}.woocommerce-profile-wizard__body .woocommerce-profile-wizard__checkbox .components-base-control__help{margin-right:48px;font-style:normal;color:#949494;font-size:14px;line-height:20px;margin-top:3px;margin-bottom:0}.woocommerce-profile-wizard__body .woocommerce-profile-wizard__checkbox svg.dashicon.components-checkbox-control__checked{right:1px;top:-1px}@media(max-width:600px){.woocommerce-profile-wizard__body svg.dashicon.components-checkbox-control__checked{right:-2px;top:-1px;width:21px;height:21px}}.woocommerce-profile-wizard__body .woocommerce-select-control__control{margin:16px 0;padding-left:40px;box-shadow:0 2px 6px rgba(0,0,0,.05)}.woocommerce-profile-wizard__body .woocommerce-select-control__control.is-active{border-color:#007cba;border-color:var(--wp-admin-theme-color)}.woocommerce-profile-wizard__body .woocommerce-select-control__control .components-base-control__label{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:calc(100% - 56px)}.woocommerce-profile-wizard__body .woocommerce-select-control__control:after{display:block;pointer-events:none;cursor:pointer;position:absolute;float:left;line-height:56px;font-family:dashicons,sans-serif;font-size:20px;content:"";z-index:1;height:24px;width:24px;margin-top:0;top:0;left:16px;bottom:16px;color:#000}.woocommerce-profile-wizard__body #wpadminbar{display:none}.woocommerce-profile-wizard__body #wpbody{padding-top:0}.woocommerce-profile-wizard__plugins-card .woocommerce-profile-wizard__plugins-actions{text-align:right;margin-right:44px}.woocommerce-profile-wizard__plugins-card .woocommerce-profile-wizard__plugins-actions button.is-button{height:40px;min-width:auto;display:initial;margin:16px 0 0 12px}.woocommerce-profile-wizard__header svg>g{transform:none}@media(max-width:782px){.woocommerce-profile-wizard__header{position:fixed;z-index:999;width:100%;bottom:0;border-top:1px solid #dcdcde;border-bottom:none}}.woocommerce-profile-wizard__header .woocommerce-stepper{margin:0 16px;width:100%}.woocommerce-profile-wizard__header .woocommerce-stepper__steps{margin:0}.woocommerce-profile-wizard__tooltip-icon{color:#50575e;display:flex;align-items:center;margin-right:4px;cursor:help}.woocommerce-business-extensions{display:flex;align-items:center;width:100%}.woocommerce-business-extensions label{display:flex;align-items:center}.woocommerce-business-extensions .components-checkbox-control__input-container{margin-left:16px}.woocommerce-business-extensions .woocommerce-business-extensions__label-subtext{display:block;color:#949494}.woocommerce-business-extensions .woocommerce-business-extensions__popover-wrapper{margin-right:auto}woocommerce-admin/readme.txt000064400000005355151335517650012172 0ustar00=== WooCommerce Admin ===
Contributors: woocommerce, automattic
Tags: ecommerce, e-commerce, store, sales, reports, analytics, dashboard, activity, notices, insights, stats, woo commerce, woocommerce
Requires at least: 5.4.0
Tested up to: 5.8.1
Requires PHP: 7.0
Stable tag: 2.8.0
License: GPLv3
License URI: https://github.com/woocommerce/woocommerce-admin/blob/main/license.txt

== Description ==

WooCommerce Admin is a new JavaScript-driven interface for managing your store. The plugin includes new and improved reports and a dashboard to monitor key metrics of your site.

**New Reports for WooCommerce**

WooCommerce Admin has a host of new reports that are optimized for speed and have advanced filters that allow you to dive into data about your store:

- Revenue Report
- Orders Report
- Products Report
- Variations Report
- Categories Report
- Coupons Report
- Taxes Report
- Downloads Report
- Stock Report
- Customers Report


**Customizable Dashboard**

WooCommerce Admin also allows store owners to customize a new dashboard screen with “performance indicators” that correspond in importance to their store’s operation.

== Getting Started ==

= Minimum Requirements =

* WordPress 5.4.0
* WooCommerce 5.7.0 or greater
* PHP version 7.0 or greater. PHP 7.2 or greater is recommended
* MySQL version 5.0 or greater. MySQL 5.6 or greater is recommended

Visit the [WooCommerce server requirements documentation](https://docs.woocommerce.com/document/server-requirements/) for a detailed list of server requirements.

= Automatic installation =

Automatic installation is the easiest option, as WordPress handles the file transfers and you don't need to leave your web browser. To perform an automatic install:
1. Log in to your WordPress dashboard.
2. Go to: Plugins > Add New.
3. Enter “WooCommerce Admin” in the Search field, and view details about its point release, the rating and description.
4. Select “Install Now” when you’re ready.

= Manual installation =

The manual installation method involves downloading the plugin and uploading it to your web server via your favorite FTP application. The WordPress Codex contains instructions at [Manual Plugin Installation](https://codex.wordpress.org/Managing_Plugins#Manual_Plugin_Installation).

= Where can I report bugs or contribute to the project? =

Bugs should be reported in the [WooCommerce Admin GitHub repository](https://github.com/woocommerce/woocommerce-admin/).

= This is awesome! Can I contribute? =

Yes, you can! Join our [GitHub repository](https://github.com/woocommerce/woocommerce-admin/)

Release and roadmap notes are available on the [WooCommerce Developers Blog](https://developer.woocommerce.com/blog/)

== Screenshots ==

1. WooCommerce Admin Dashboard
2. Activity Panels
3. Analytics
woocommerce-admin/chunk-src-version-param.js000064400000005027151335517650015204 0ustar00const pluginName = 'AsyncChunkSrcVersionParameterPlugin';
/**
 * Inspired by: https://github.com/webpack/webpack/issues/8115#issuecomment-663902035.
 *
 * This plugin modifies the webpack bootstrap code generated by the plugin at
 * webpack/lib/web/JsonpMainTemplatePlugin.js and the CSS chunk loading code generated
 * by @automattic/mini-css-extract-plugin-with-rtl.
 *
 * It will rename the function jsonpScriptSrc generated by that to webpackJsonpScriptSrc
 * and install a new version that checks a user provided variable containing a script
 * version parameter to specify in async chunk URLs.
 *
 * The jsonpScriptSrc override is only for webpack 4 (tested with 4.43 and 4.44).
 *
 * Webpack 5 has official support for this https://github.com/webpack/webpack/pull/8462
 * so it won't be necessary.
 *
 * It will also append the ?ver parameter to CSS chunk hrefs loaded by @automattic/mini-css-extract-plugin-with-rtl.
 */
class AsyncChunkSrcVersionParameterPlugin {
	_applyMainTemplate( mainTemplate ) {
		// Append script version to all async JS chunks loaded with jsonpScriptSrc().
		mainTemplate.hooks.localVars.tap(
			// Use stage 1 to ensure this executes after webpack/lib/web/JsonpMainTemplatePlugin.js.
			{ name: pluginName, stage: 1 },
			( source ) => {
				if ( source.includes( 'function jsonpScriptSrc' ) ) {
					const modSource = source.replace(
						'function jsonpScriptSrc',
						'function webpackJsonpScriptSrc'
					);
					return `${ modSource }

function jsonpScriptSrc(chunkId) {
	var src = webpackJsonpScriptSrc(chunkId);
	if ( window.wcAdminAssets && window.wcAdminAssets.version ) {
		src += '?ver=' + window.wcAdminAssets.version;
	}
	return src;
}
`;
				}

				return source;
			}
		);

		// Append script version to all async CSS chunks loaded by @automattic/mini-css-extract-plugin-with-rtl.
		mainTemplate.hooks.requireEnsure.tap(
			// Use stage 1 to ensure this executes after @automattic/mini-css-extract-plugin-with-rtl.
			{ name: pluginName, stage: 1 },
			( source ) => {
				if (
					source.includes( '// mini-css-extract-plugin CSS loading' )
				) {
					return source.replace(
						'linkTag.href = fullhref;',
						`linkTag.href = fullhref;
if ( window.wcAdminAssets && window.wcAdminAssets.version ) {
	linkTag.href += '?ver=' + window.wcAdminAssets.version;
}`
					);
				}

				return source;
			}
		);
	}

	apply( compiler ) {
		compiler.hooks.thisCompilation.tap( pluginName, ( compilation ) => {
			this._applyMainTemplate( compilation.mainTemplate );
		} );
	}
}

module.exports = AsyncChunkSrcVersionParameterPlugin;
woocommerce-admin/includes/connect-existing-pages.php000064400000020236151335517650017064 0ustar00<?php
/**
 * Connect existing WooCommerce pages to WooCommerce Admin.
 *
 * @package WooCommerce\Admin
 */

use Automattic\WooCommerce\Admin\PageController;
use Automattic\WooCommerce\Admin\Features\Features;

/**
 * Returns core WC pages to connect to WC-Admin.
 *
 * @return array
 */
function wc_admin_get_core_pages_to_connect() {
	$all_reports = WC_Admin_Reports::get_reports();
	$report_tabs = array();

	foreach ( $all_reports as $report_id => $report_data ) {
		$report_tabs[ $report_id ] = $report_data['title'];
	}

	return array(
		'wc-addons'   => array(
			'title' => __( 'Marketplace', 'woocommerce' ),
			'tabs'  => array(),
		),
		'wc-reports'  => array(
			'title' => __( 'Reports', 'woocommerce' ),
			'tabs'  => $report_tabs,
		),
		'wc-settings' => array(
			'title' => __( 'Settings', 'woocommerce' ),
			'tabs'  => apply_filters( 'woocommerce_settings_tabs_array', array() ),
		),
		'wc-status'   => array(
			'title' => __( 'Status', 'woocommerce' ),
			'tabs'  => apply_filters(
				'woocommerce_admin_status_tabs',
				array(
					'status' => __( 'System status', 'woocommerce' ),
					'tools'  => __( 'Tools', 'woocommerce' ),
					'logs'   => __( 'Logs', 'woocommerce' ),
				)
			),
		),
	);
}

/**
 * Filter breadcrumbs for core pages that aren't explicitly connected.
 *
 * @param array $breadcrumbs Breadcrumb pieces.
 * @return array Filtered breadcrumb pieces.
 */
function wc_admin_filter_core_page_breadcrumbs( $breadcrumbs ) {
	$screen_id              = PageController::get_instance()->get_current_screen_id();
	$pages_to_connect       = wc_admin_get_core_pages_to_connect();
	$woocommerce_breadcrumb = array(
		'admin.php?page=wc-admin',
		__( 'WooCommerce', 'woocommerce' ),
	);

	foreach ( $pages_to_connect as $page_id => $page_data ) {
		if ( preg_match( "/^woocommerce_page_{$page_id}\-/", $screen_id ) ) {
			if ( empty( $page_data['tabs'] ) ) {
				$new_breadcrumbs = array(
					$woocommerce_breadcrumb,
					$page_data['title'],
				);
			} else {
				$new_breadcrumbs = array(
					$woocommerce_breadcrumb,
					array(
						add_query_arg( 'page', $page_id, 'admin.php' ),
						$page_data['title'],
					),
				);

				// phpcs:ignore WordPress.Security.NonceVerification.Recommended
				if ( isset( $_GET['tab'] ) ) {
					// phpcs:ignore WordPress.Security.NonceVerification.Recommended
					$current_tab = wc_clean( wp_unslash( $_GET['tab'] ) );
				} else {
					$current_tab = key( $page_data['tabs'] );
				}

				$new_breadcrumbs[] = $page_data['tabs'][ $current_tab ];
			}

			return $new_breadcrumbs;
		}
	}

	return $breadcrumbs;
}

/**
 * Render the WC-Admin header bar on all WooCommerce core pages.
 *
 * @param bool $is_connected Whether the current page is connected.
 * @param bool $current_page The current page, if connected.
 * @return bool Whether to connect the page.
 */
function wc_admin_connect_core_pages( $is_connected, $current_page ) {
	if ( false === $is_connected && false === $current_page ) {
		$screen_id        = PageController::get_instance()->get_current_screen_id();
		$pages_to_connect = wc_admin_get_core_pages_to_connect();

		foreach ( $pages_to_connect as $page_id => $page_data ) {
			if ( preg_match( "/^woocommerce_page_{$page_id}\-/", $screen_id ) ) {
				add_filter( 'woocommerce_navigation_get_breadcrumbs', 'wc_admin_filter_core_page_breadcrumbs' );

				return true;
			}
		}
	}

	return $is_connected;
}

add_filter( 'woocommerce_navigation_is_connected_page', 'wc_admin_connect_core_pages', 10, 2 );

$posttype_list_base = 'edit.php';

// WooCommerce > Orders.
wc_admin_connect_page(
	array(
		'id'        => 'woocommerce-orders',
		'screen_id' => 'edit-shop_order',
		'title'     => __( 'Orders', 'woocommerce' ),
		'path'      => add_query_arg( 'post_type', 'shop_order', $posttype_list_base ),
	)
);

// WooCommerce > Orders > Add New.
wc_admin_connect_page(
	array(
		'id'        => 'woocommerce-add-order',
		'parent'    => 'woocommerce-orders',
		'screen_id' => 'shop_order-add',
		'title'     => __( 'Add New', 'woocommerce' ),
	)
);

// WooCommerce > Orders > Edit Order.
wc_admin_connect_page(
	array(
		'id'        => 'woocommerce-edit-order',
		'parent'    => 'woocommerce-orders',
		'screen_id' => 'shop_order',
		'title'     => __( 'Edit Order', 'woocommerce' ),
	)
);

// WooCommerce > Coupons.
wc_admin_connect_page(
	array(
		'id'        => 'woocommerce-coupons',
		'parent'    => Features::is_enabled( 'coupons' ) ? 'woocommerce-marketing' : null,
		'screen_id' => 'edit-shop_coupon',
		'title'     => __( 'Coupons', 'woocommerce' ),
		'path'      => add_query_arg( 'post_type', 'shop_coupon', $posttype_list_base ),
	)
);

// WooCommerce > Coupons > Add New.
wc_admin_connect_page(
	array(
		'id'        => 'woocommerce-add-coupon',
		'parent'    => 'woocommerce-coupons',
		'screen_id' => 'shop_coupon-add',
		'title'     => __( 'Add New', 'woocommerce' ),
	)
);

// WooCommerce > Coupons > Edit Coupon.
wc_admin_connect_page(
	array(
		'id'        => 'woocommerce-edit-coupon',
		'parent'    => 'woocommerce-coupons',
		'screen_id' => 'shop_coupon',
		'title'     => __( 'Edit Coupon', 'woocommerce' ),
	)
);

// WooCommerce > Products.
wc_admin_connect_page(
	array(
		'id'        => 'woocommerce-products',
		'screen_id' => 'edit-product',
		'title'     => __( 'Products', 'woocommerce' ),
		'path'      => add_query_arg( 'post_type', 'product', $posttype_list_base ),
	)
);

// WooCommerce > Products > Add New.
wc_admin_connect_page(
	array(
		'id'        => 'woocommerce-add-product',
		'parent'    => 'woocommerce-products',
		'screen_id' => 'product-add',
		'title'     => __( 'Add New', 'woocommerce' ),
	)
);

// WooCommerce > Products > Edit Order.
wc_admin_connect_page(
	array(
		'id'        => 'woocommerce-edit-product',
		'parent'    => 'woocommerce-products',
		'screen_id' => 'product',
		'title'     => __( 'Edit Product', 'woocommerce' ),
	)
);

// WooCommerce > Products > Import Products.
wc_admin_connect_page(
	array(
		'id'        => 'woocommerce-import-products',
		'parent'    => 'woocommerce-products',
		'screen_id' => 'product_page_product_importer',
		'title'     => __( 'Import Products', 'woocommerce' ),
	)
);

// WooCommerce > Products > Export Products.
wc_admin_connect_page(
	array(
		'id'        => 'woocommerce-export-products',
		'parent'    => 'woocommerce-products',
		'screen_id' => 'product_page_product_exporter',
		'title'     => __( 'Export Products', 'woocommerce' ),
	)
);

// WooCommerce > Products > Product categories.
wc_admin_connect_page(
	array(
		'id'        => 'woocommerce-product-categories',
		'parent'    => 'woocommerce-products',
		'screen_id' => 'edit-product_cat',
		'title'     => __( 'Product categories', 'woocommerce' ),
	)
);

// WooCommerce > Products > Edit category.
wc_admin_connect_page(
	array(
		'id'        => 'woocommerce-product-edit-category',
		'parent'    => 'woocommerce-products',
		'screen_id' => 'product_cat',
		'title'     => __( 'Edit category', 'woocommerce' ),
	)
);

// WooCommerce > Products > Product tags.
wc_admin_connect_page(
	array(
		'id'        => 'woocommerce-product-tags',
		'parent'    => 'woocommerce-products',
		'screen_id' => 'edit-product_tag',
		'title'     => __( 'Product tags', 'woocommerce' ),
	)
);

// WooCommerce > Products > Edit tag.
wc_admin_connect_page(
	array(
		'id'        => 'woocommerce-product-edit-tag',
		'parent'    => 'woocommerce-products',
		'screen_id' => 'product_tag',
		'title'     => __( 'Edit tag', 'woocommerce' ),
	)
);

// WooCommerce > Products > Attributes.
wc_admin_connect_page(
	array(
		'id'        => 'woocommerce-product-attributes',
		'parent'    => 'woocommerce-products',
		'screen_id' => 'product_page_product_attributes',
		'title'     => __( 'Attributes', 'woocommerce' ),
	)
);

// WooCommerce > Products > Edit attribute.
wc_admin_connect_page(
	array(
		'id'        => 'woocommerce-product-edit-attribute',
		'parent'    => 'woocommerce-products',
		'screen_id' => 'product_page_product_attribute-edit',
		'title'     => __( 'Edit attribute', 'woocommerce' ),
	)
);

// WooCommerce > My Subscriptions.
wc_admin_connect_page(
	array(
		'id'        => 'wc-subscriptions',
		'screen_id' => 'woocommerce_page_wc-addons-browse-extensions-helper',
		'title'     => __( 'My Subscriptions', 'woocommerce' ),
		'path'      => 'admin.php?page=wc-addons&section=helper',
	)
);
woocommerce-admin/includes/emails/html-admin-report-export-download.php000064400000001115151335517650022442 0ustar00<?php
/**
 * Admin report export download
 *
 * @package WooCommerce\Admin\Templates\Emails\HTML
 */

defined( 'ABSPATH' ) || exit;

/*
 * @hooked WC_Emails::email_header() Output the email header
 */
do_action( 'woocommerce_email_header', $email_heading, $email );

?>
<a href="<?php echo esc_url( $download_url ); ?>">
	<?php
		/* translators: %s: report name */
		echo esc_html( sprintf( __( 'Download your %s Report', 'woocommerce' ), $report_name ) );
	?>
</a>
<?php
/*
 * @hooked WC_Emails::email_footer() Output the email footer
 */
do_action( 'woocommerce_email_footer', $email );
woocommerce-admin/includes/emails/plain-merchant-notification.php000064400000001376151335517650021352 0ustar00<?php
/**
 * Merchant notification email (plain text)
 *
 * @package WooCommerce\Admin\Templates\Emails\HTML
 */

defined( 'ABSPATH' ) || exit;

echo "=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n";
echo esc_html( wp_strip_all_tags( $email_heading ) );
echo "\n=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n\n";

echo wp_kses_post( $email_content );

foreach ( $email_actions as $an_action ) {
	echo "\n";
	/* translators: %1$s: action label, %2$s: action URL */
	echo wp_kses_post( sprintf( __( '%1$s: %2$s', 'woocommerce' ), $an_action->label, $trigger_note_action_url . $an_action->id ) );
}
echo "\n\n----------------------------------------\n\n";

echo wp_kses_post( apply_filters( 'woocommerce_email_footer_text', get_option( 'woocommerce_email_footer_text' ) ) );
woocommerce-admin/includes/emails/html-merchant-notification.php000064400000003202151335517650021201 0ustar00<?php
/**
 * Merchant notification email
 *
 * @package WooCommerce\Admin\Templates\Emails\HTML
 */

defined( 'ABSPATH' ) || exit;

/*
 * @hooked WC_Emails::email_header() Output the email header
 */
do_action( 'woocommerce_email_header', $email_heading, $email );
?>

<?php if ( isset( $email_image ) ) { ?>
<div>
	<img src="<?php echo esc_url( $email_image ); ?>" style="display: block; margin-bottom: 24px; width: 180px;"/>
</div>
<?php } ?>

<?php
echo wp_kses(
	$email_content,
	array(
		'a'      => array(
			'href'  => array(),
			'title' => array(),
		),
		'br'     => array(),
		'em'     => array(),
		'strong' => array(),
	)
);

$base_color       = get_option( 'woocommerce_email_base_color' );
$base_text        = wc_light_or_dark( $base_color, '#202020', '#ffffff' );
$container_styles = 'margin-top: 25px;';
$buttons_styles   = "
	font-style: normal;
	font-weight: normal;
	font-size: 13px;
	line-height: 18px;
	text-align: center;
	color: {$base_text};
	margin-right: 15px;
	text-decoration: none;
	background: {$base_color};
	border: 1px solid {$base_color};
	border-radius: 3px;
	padding: 6px 15px;";
?>
<div style="<?php echo esc_attr( $container_styles ); ?>">
<?php foreach ( $email_actions as $an_action ) : ?>
	<a href="<?php echo esc_url( $trigger_note_action_url . $an_action->id ); ?>" style="<?php echo esc_attr( $buttons_styles ); ?>">
		<?php
			echo esc_html( $an_action->label );
		?>
	</a>
<?php endforeach; ?>
</div>
<div style="opacity: 0;">
	<img src="<?php echo esc_url( $opened_tracking_url ); ?>" />
</div>
<?php
/*
 * @hooked WC_Emails::email_footer() Output the email footer
 */
do_action( 'woocommerce_email_footer', $email );
woocommerce-admin/includes/emails/plain-admin-report-export-download.php000064400000001232151335517650022601 0ustar00<?php
/**
 * Admin report export download email (plain text)
 *
 * @package WooCommerce\Admin\Templates\Emails\HTML
 */

defined( 'ABSPATH' ) || exit;

echo "=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n";
echo esc_html( wp_strip_all_tags( $email_heading ) );
echo "\n=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n\n";

/* translators: %1$s: report name, %2$s: download URL */
echo wp_kses_post( sprintf( __( 'Download your %1$s Report: %2$s', 'woocommerce' ), $report_name, $download_url ) );

echo "\n\n----------------------------------------\n\n";

echo wp_kses_post( apply_filters( 'woocommerce_email_footer_text', get_option( 'woocommerce_email_footer_text' ) ) );
woocommerce-admin/includes/page-controller-functions.php000064400000003235151335517650017611 0ustar00<?php
/**
 * Convenience functions for PageController.
 *
 * @package WooCommerce\Admin
 */

use Automattic\WooCommerce\Admin\PageController;

/**
 * Connect an existing page to WooCommerce Admin.
 * Passthrough to PageController::connect_page().
 *
 * @param array $options Options for PageController::connect_page().
 */
function wc_admin_connect_page( $options ) {
	$controller = PageController::get_instance();
	$controller->connect_page( $options );
}

/**
 * Register JS-powered WooCommerce Admin Page.
 * Passthrough to PageController::register_page().
 *
 * @param array $options Options for PageController::register_page().
 */
function wc_admin_register_page( $options ) {
	$controller = PageController::get_instance();
	$controller->register_page( $options );
}

/**
 * Is this page connected to WooCommerce Admin?
 * Passthrough to PageController::is_connected_page().
 *
 * @return boolean True if the page is connected to WooCommerce Admin.
 */
function wc_admin_is_connected_page() {
	$controller = PageController::get_instance();
	return $controller->is_connected_page();
}

/**
 * Is this a WooCommerce Admin Page?
 * Passthrough to PageController::is_registered_page().
 *
 * @return boolean True if the page is a WooCommerce Admin page.
 */
function wc_admin_is_registered_page() {
	$controller = PageController::get_instance();
	return $controller->is_registered_page();
}

/**
 * Get breadcrumbs for WooCommerce Admin Page navigation.
 * Passthrough to PageController::get_breadcrumbs().
 *
 * @return array Navigation pieces (breadcrumbs).
 */
function wc_admin_get_breadcrumbs() {
	$controller = PageController::get_instance();
	return $controller->get_breadcrumbs();
}
woocommerce-admin/includes/feature-config.php000064400000001531151335517650015401 0ustar00<?php
// WARNING: Do not directly edit this file.
// This file is auto-generated as part of the build process and things may break.
if ( ! function_exists( 'wc_admin_get_feature_config' ) ) {
	function wc_admin_get_feature_config() {
		return array(
			'activity-panels' => true,
			'analytics' => true,
			'coupons' => true,
			'customer-effort-score-tracks' => true,
			'homescreen' => true,
			'marketing' => true,
			'minified-js' => false,
			'mobile-app-banner' => true,
			'navigation' => false,
			'onboarding' => true,
			'remote-inbox-notifications' => true,
			'remote-free-extensions' => true,
			'payment-gateway-suggestions' => true,
			'settings' => false,
			'shipping-label-banner' => true,
			'subscriptions' => true,
			'store-alerts' => true,
			'tasks' => false,
			'transient-notices' => true,
			'wc-pay-promotion' => true,
		);
	}
}
woocommerce-admin/includes/class-experimental-abtest.php000064400000011602151335517650017563 0ustar00<?php
/**
 * NOTE: this is a temporary class and can be replaced by jetpack-abtest after
 * https://github.com/Automattic/jetpack/issues/19596 has been fixed.
 *
 * A class that interacts with Explat A/B tests.
 *
 * This class is experimental. It is a fork of the jetpack-abtest package and
 * updated for use with ExPlat. These changes are planned to be contributed
 * back to the upstream Jetpack package. If accepted, this class should then
 * be superseded by the Jetpack class using Composer.
 *
 * This class should not be used externally.
 *
 * @package WooCommerce\Admin
 * @link https://packagist.org/packages/automattic/jetpack-abtest
 */

namespace WooCommerce\Admin;

/**
 * This class provides an interface to the Explat A/B tests.
 *
 * @internal This class is experimental and should not be used externally due to planned breaking changes.
 */
final class Experimental_Abtest {

	/**
	 * A variable to hold the tests we fetched, and their variations for the current user.
	 *
	 * @var array
	 */
	private $tests = array();

	/**
	 * ExPlat Anonymous ID.
	 *
	 * @var string
	 */
	private $anon_id = null;

	/**
	 * ExPlat Platform name.
	 *
	 * @var string
	 */
	private $platform = 'woocommerce';

	/**
	 * Whether trcking consent is given.
	 *
	 * @var bool
	 */
	private $consent = false;

	/**
	 * Constructor.
	 *
	 * @param string $anon_id ExPlat anonymous ID.
	 * @param string $platform ExPlat platform name.
	 * @param bool   $consent Whether tracking consent is given.
	 */
	public function __construct( string $anon_id, string $platform, bool $consent ) {
		$this->anon_id  = $anon_id;
		$this->platform = $platform;
		$this->consent  = $consent;
	}

	/**
	 * Retrieve the test variation for a provided A/B test.
	 *
	 * @param string $test_name Name of the A/B test.
	 * @return mixed|null A/B test variation, or null on failure.
	 */
	public function get_variation( $test_name ) {
		// Default to the control variation when users haven't consented to tracking.
		if ( ! $this->consent ) {
			return 'control';
		}

		$variation = $this->fetch_variation( $test_name );

		// If there was an error retrieving a variation, conceal the error for the consumer.
		if ( is_wp_error( $variation ) ) {
			return 'control';
		}

		return $variation;
	}

	/**
	 * Fetch and cache the test variation for a provided A/B test from WP.com.
	 *
	 * ExPlat returns a null value when the assigned variation is control or
	 * an assignment has not been set. In these instances, this method returns
	 * a value of "control".
	 *
	 * @param string $test_name Name of the A/B test.
	 * @return array|\WP_Error A/B test variation, or error on failure.
	 */
	protected function fetch_variation( $test_name ) {
		// Make sure test name exists.
		if ( ! $test_name ) {
			return new \WP_Error( 'test_name_not_provided', 'A/B test name has not been provided.' );
		}

		// Make sure test name is a valid one.
		if ( ! preg_match( '/^[A-Za-z0-9_]+$/', $test_name ) ) {
			return new \WP_Error( 'invalid_test_name', 'Invalid A/B test name.' );
		}

		// Return internal-cached test variations.
		if ( isset( $this->tests[ $test_name ] ) ) {
			return $this->tests[ $test_name ];
		}

		// Return external-cached test variations.
		if ( ! empty( get_transient( 'abtest_variation_' . $test_name ) ) ) {
			return get_transient( 'abtest_variation_' . $test_name );
		}

		// Make the request to the WP.com API.
		$response = $this->request_variation( $test_name );

		// Bail if there was an error or malformed response.
		if ( is_wp_error( $response ) || ! is_array( $response ) || ! isset( $response['body'] ) ) {
			return new \WP_Error( 'failed_to_fetch_data', 'Unable to fetch the requested data.' );
		}

		// Decode the results.
		$results = json_decode( $response['body'], true );

		// Bail if there were no results or there is no test variation returned.
		if ( ! is_array( $results ) || empty( $results['variations'] ) ) {
			return new \WP_Error( 'unexpected_data_format', 'Data was not returned in the expected format.' );
		}

		// Store the variation in our internal cache.
		$this->tests[ $test_name ] = $results['variations'][ $test_name ];

		$variation = $results['variations'][ $test_name ] ?? 'control';

		// Store the variation in our external cache.
		if ( ! empty( $results['ttl'] ) ) {
			set_transient( 'abtest_variation_' . $test_name, $variation, $results['ttl'] );
		}

		return $variation;
	}

	/**
	 * Perform the request for a variation of a provided A/B test from WP.com.
	 *
	 * @param string $test_name Name of the A/B test.
	 * @return array|\WP_Error A/B test variation error on failure.
	 */
	protected function request_variation( $test_name ) {
		$args = array(
			'experiment_name' => $test_name,
			'anon_id'         => $this->anon_id,
		);

		$url = add_query_arg(
			$args,
			sprintf(
				'https://public-api.wordpress.com/wpcom/v2/experiments/0.1.0/assignments/%s',
				$this->platform
			)
		);

		$get = wp_remote_get( $url );

		return $get;
	}
}

woocommerce-admin/includes/core-functions.php000064400000004243151335517650015444 0ustar00<?php
/**
 * Core Functions
 *
 * Holds core functions for wc-admin.
 *
 * @package WooCommerce\Admin\Functions
 */

use \Automattic\WooCommerce\Admin\Loader;

/**
 * Format a number using the decimal and thousands separator settings in WooCommerce.
 *
 * @param mixed $number Number to be formatted.
 * @return string
 */
function wc_admin_number_format( $number ) {
	$currency_settings = Loader::get_currency_settings();
	return number_format(
		$number,
		0,
		$currency_settings['decimalSeparator'],
		$currency_settings['thousandSeparator']
	);
}

/**
 * Retrieves a URL to relative path inside WooCommerce admin with
 * the provided query parameters.
 *
 * @param  string $path Relative path of the desired page.
 * @param  array  $query Query parameters to append to the path.
 *
 * @return string       Fully qualified URL pointing to the desired path.
 */
function wc_admin_url( $path = null, $query = array() ) {
	if ( ! empty( $query ) ) {
		$query_string = http_build_query( $query );
		$path         = $path ? '&path=' . $path . '&' . $query_string : '';
	}

	return admin_url( 'admin.php?page=wc-admin' . $path, dirname( __FILE__ ) );
}

/**
 * Record an event using Tracks.
 *
 * @internal WooCommerce core only includes Tracks in admin, not the REST API, so we need to include it.
 * @param string $event_name Event name for tracks.
 * @param array  $properties Properties to pass along with event.
 */
function wc_admin_record_tracks_event( $event_name, $properties = array() ) {
	// WC post types must be registered first for WC_Tracks to work.
	if ( ! post_type_exists( 'product' ) ) {
		return;
	}

	if ( ! class_exists( 'WC_Tracks' ) ) {
		if ( ! defined( 'WC_ABSPATH' ) || ! file_exists( WC_ABSPATH . 'includes/tracks/class-wc-tracks.php' ) ) {
			return;
		}

		include_once WC_ABSPATH . 'includes/tracks/class-wc-tracks.php';
		include_once WC_ABSPATH . 'includes/tracks/class-wc-tracks-event.php';
		include_once WC_ABSPATH . 'includes/tracks/class-wc-tracks-client.php';
		include_once WC_ABSPATH . 'includes/tracks/class-wc-tracks-footer-pixel.php';
		include_once WC_ABSPATH . 'includes/tracks/class-wc-site-tracking.php';
	}

	WC_Tracks::record_event( $event_name, $properties );
}
woocommerce-admin/includes/wc-admin-update-functions.php000064400000020175151335517650017475 0ustar00<?php
/**
 * WooCommerce Admin Updates
 *
 * Functions for updating data, used by the background updater.
 *
 * @package WooCommerce\Admin
 */

use \Automattic\WooCommerce\Admin\Install as Installer;
use \Automattic\WooCommerce\Admin\Notes\Notes;
use \Automattic\WooCommerce\Admin\Notes\UnsecuredReportFiles;
use \Automattic\WooCommerce\Admin\Notes\DeactivatePlugin;
use \Automattic\WooCommerce\Admin\ReportExporter;

/**
 * Update order stats `status` index length.
 * See: https://github.com/woocommerce/woocommerce-admin/issues/2969.
 */
function wc_admin_update_0201_order_status_index() {
	global $wpdb;

	// Max DB index length. See wp_get_db_schema().
	$max_index_length = 191;

	$index = $wpdb->get_row( "SHOW INDEX FROM {$wpdb->prefix}wc_order_stats WHERE key_name = 'status'" );

	if ( property_exists( $index, 'Sub_part' ) ) {
		// The index was created with the right length. Time to bail.
		if ( $max_index_length === $index->Sub_part ) { // phpcs:ignore WordPress.NamingConventions.ValidVariableName
			return;
		}

		// We need to drop the index so it can be recreated.
		$wpdb->query( "DROP INDEX `status` ON {$wpdb->prefix}wc_order_stats" );
	}

	// Recreate the status index with a max length.
	$wpdb->query( $wpdb->prepare( "ALTER TABLE {$wpdb->prefix}wc_order_stats ADD INDEX status (status(%d))", $max_index_length ) );
}

/**
 * Update DB Version.
 */
function wc_admin_update_0201_db_version() {
	Installer::update_db_version( '0.20.1' );
}

/**
 * Rename "gross_total" to "total_sales".
 * See: https://github.com/woocommerce/woocommerce-admin/issues/3175
 */
function wc_admin_update_0230_rename_gross_total() {
	global $wpdb;

	// We first need to drop the new `total_sales` column, since dbDelta() will have created it.
	$wpdb->query( "ALTER TABLE {$wpdb->prefix}wc_order_stats DROP COLUMN `total_sales`" );
	// Then we can rename the existing `gross_total` column.
	$wpdb->query( "ALTER TABLE {$wpdb->prefix}wc_order_stats CHANGE COLUMN `gross_total` `total_sales` double DEFAULT 0 NOT NULL" );
}

/**
 * Update DB Version.
 */
function wc_admin_update_0230_db_version() {
	Installer::update_db_version( '0.23.0' );
}

/**
 * Remove the note unsnoozing scheduled action.
 */
function wc_admin_update_0251_remove_unsnooze_action() {
	as_unschedule_action( Notes::UNSNOOZE_HOOK, null, 'wc-admin-data' );
	as_unschedule_action( Notes::UNSNOOZE_HOOK, null, 'wc-admin-notes' );
}

/**
 * Update DB Version.
 */
function wc_admin_update_0251_db_version() {
	Installer::update_db_version( '0.25.1' );
}

/**
 * Remove Facebook Extension note.
 */
function wc_admin_update_110_remove_facebook_note() {
	Notes::delete_notes_with_name( 'wc-admin-facebook-extension' );
}

/**
 * Update DB Version.
 */
function wc_admin_update_110_db_version() {
	Installer::update_db_version( '1.1.0' );
}

/**
 * Remove Dismiss action from tracking opt-in admin note.
 */
function wc_admin_update_130_remove_dismiss_action_from_tracking_opt_in_note() {
	global $wpdb;

	$wpdb->query( "DELETE actions FROM {$wpdb->prefix}wc_admin_note_actions actions INNER JOIN {$wpdb->prefix}wc_admin_notes notes USING (note_id) WHERE actions.name = 'tracking-dismiss' AND notes.name = 'wc-admin-usage-tracking-opt-in'" );
}

/**
 * Update DB Version.
 */
function wc_admin_update_130_db_version() {
	Installer::update_db_version( '1.3.0' );
}

/**
 * Change the deactivate plugin note type to 'info'.
 */
function wc_admin_update_140_change_deactivate_plugin_note_type() {
	global $wpdb;

	$wpdb->query( $wpdb->prepare( "UPDATE {$wpdb->prefix}wc_admin_notes SET type = 'info' WHERE name = %s", DeactivatePlugin::NOTE_NAME ) );
}

/**
 * Update DB Version.
 */
function wc_admin_update_140_db_version() {
	Installer::update_db_version( '1.4.0' );
}

/**
 * Remove Facebook Experts note.
 */
function wc_admin_update_160_remove_facebook_note() {
	Notes::delete_notes_with_name( 'wc-admin-facebook-marketing-expert' );
}

/**
 * Update DB Version.
 */
function wc_admin_update_160_db_version() {
	Installer::update_db_version( '1.6.0' );
}

/**
 * Set "two column" homescreen layout as default for existing stores.
 */
function wc_admin_update_170_homescreen_layout() {
	add_option( 'woocommerce_default_homepage_layout', 'two_columns', '', 'no' );
}

/**
 * Update DB Version.
 */
function wc_admin_update_170_db_version() {
	Installer::update_db_version( '1.7.0' );
}

/**
 * Delete the preexisting export files.
 */
function wc_admin_update_270_delete_report_downloads() {
	$upload_dir = wp_upload_dir();
	$base_dir   = trailingslashit( $upload_dir['basedir'] );

	$failed_files   = array();
	$exports_status = get_option( ReportExporter::EXPORT_STATUS_OPTION, array() );
	$has_failure    = false;

	if ( ! is_array( $exports_status ) ) {
		// This is essentially the same path as files failing deletion. Handle as such.
		return;
	}

	// Delete all export files based on the status option values.
	foreach ( $exports_status as $key => $progress ) {
		list( $report_type, $export_id ) = explode( ':', $key );

		if ( ! $export_id ) {
			continue;
		}

		$file   = "{$base_dir}wc-{$report_type}-report-export-{$export_id}.csv";
		$header = $file . '.headers';

		// phpcs:ignore
		if ( @file_exists( $file ) && false === @unlink( $file ) ) {
			array_push( $failed_files, $file );
		}

		// phpcs:ignore
		if ( @file_exists( $header ) && false === @unlink( $header ) ) {
			array_push( $failed_files, $header );
		}
	}

	// If the status option was missing or corrupt, there will be files left over.
	$potential_exports = glob( $base_dir . 'wc-*-report-export-*.csv' );
	$reports_pattern   = '(revenue|products|variations|orders|categories|coupons|taxes|stock|customers|downloads)';

	/**
	 * Look for files we can be reasonably sure were created by the report export.
	 *
	 * Export files we created will match the 'wc-*-report-export-*.csv' glob, with
	 * the first wildcard being one of the exportable report slugs, and the second
	 * being an integer with 11-14 digits (from microtime()'s output) that represents
	 * a time in the past.
	 */
	foreach ( $potential_exports as $potential_export ) {
		$matches = array();
		// See if the filename matches an unfiltered export pattern.
		if ( ! preg_match( "/wc-{$reports_pattern}-report-export-(?P<export_id>\d{11,14})\.csv\$/", $potential_export, $matches ) ) {
			$has_failure = true;
			continue;
		}

		// Validate the timestamp (anything in the past).
		$timestamp = (int) substr( $matches['export_id'], 0, 10 );

		if ( ! $timestamp || $timestamp > time() ) {
			$has_failure = true;
			continue;
		}

		// phpcs:ignore
		if ( false === @unlink( $potential_export ) ) {
			array_push( $failed_files, $potential_export );
		}
	}

	// Try deleting failed files once more.
	foreach ( $failed_files as $failed_file ) {
		// phpcs:ignore
		if ( false === @unlink( $failed_file ) ) {
			$has_failure = true;
		}
	}

	if ( $has_failure ) {
		UnsecuredReportFiles::possibly_add_note();
	}
}

/**
 * Update DB Version.
 */
function wc_admin_update_270_db_version() {
	Installer::update_db_version( '2.7.0' );
}

/**
 * Update the old task list options.
 */
function wc_admin_update_271_update_task_list_options() {
	$hidden_lists         = get_option( 'woocommerce_task_list_hidden_lists', array() );
	$setup_list_hidden    = get_option( 'woocommerce_task_list_hidden', 'no' );
	$extended_list_hidden = get_option( 'woocommerce_extended_task_list_hidden', 'no' );
	if ( 'yes' === $setup_list_hidden ) {
		$hidden_lists[] = 'setup';
	}
	if ( 'yes' === $extended_list_hidden ) {
		$hidden_lists[] = 'extended';
	}

	update_option( 'woocommerce_task_list_hidden_lists', array_unique( $hidden_lists ) );
	delete_option( 'woocommerce_task_list_hidden' );
	delete_option( 'woocommerce_extended_task_list_hidden' );
}

/**
 * Update DB Version.
 */
function wc_admin_update_271_db_version() {
	Installer::update_db_version( '2.7.1' );
}

/**
 * Update order stats `status`.
 */
function wc_admin_update_280_order_status() {
	global $wpdb;

	$wpdb->query(
		"UPDATE {$wpdb->prefix}wc_order_stats refunds
		INNER JOIN {$wpdb->prefix}wc_order_stats orders
			ON orders.order_id = refunds.parent_id
		SET refunds.status = orders.status
		WHERE refunds.parent_id != 0"
	);
}

/**
 * Update DB Version.
 */
function wc_admin_update_280_db_version() {
	Installer::update_db_version( '2.8.0' );
}
woocommerce-admin/typings/global.d.ts000064400000000341151335517650013711 0ustar00declare global {
	interface Window {
		wcSettings: {
			preloadOptions: Record< string, unknown >;
			adminUrl: string;
		};
	}
}

/*~ If your module exports nothing, you'll need this line. Otherwise, delete it */
export {};
woocommerce-admin/typings/index.d.ts000064400000000553151335517650013565 0ustar00declare module '@woocommerce/e2e-utils';
declare module '@woocommerce/e2e-environment';
declare module '@wordpress/data';
declare module '@wordpress/compose';
declare module 'gridicons/dist/*' {
	const value: React.ElementType< {
		size?: 12 | 18 | 24 | 36 | 48 | 54 | 72;
		onClick?: ( event: MouseEvent | KeyboardEvent ) => void;
	} >;
	export default value;
}
woocommerce-admin/woocommerce-admin.php000064400000011371151335517650014305 0ustar00<?php
/**
 * Plugin Name: WooCommerce Admin
 * Plugin URI: https://github.com/woocommerce/woocommerce-admin
 * Description: A new JavaScript-driven interface for managing your store. The plugin includes new and improved reports, and a dashboard to monitor all the important key metrics of your site.
 * Author: WooCommerce
 * Author URI: https://woocommerce.com/
 * Text Domain: woocommerce-admin
 * Domain Path: /languages
 * Version: 2.8.0
 * Requires at least: 5.4
 * Requires PHP: 7.0
 *
 * WC requires at least: 5.7.0
 * WC tested up to: 5.9.0
 *
 * @package WooCommerce\Admin
 */

defined( 'ABSPATH' ) || exit;

use \Automattic\WooCommerce\Admin\FeaturePlugin;
use \Automattic\WooCommerce\Admin\Loader;

/**
 * Autoload packages.
 *
 * We want to fail gracefully if `composer install` has not been executed yet, so we are checking for the autoloader.
 * If the autoloader is not present, let's log the failure and display a nice admin notice.
 */
if ( is_readable( __DIR__ . '/vendor/autoload_packages.php' ) ) {
	require __DIR__ . '/vendor/autoload_packages.php';
} else {
	if ( defined( 'WP_DEBUG' ) && WP_DEBUG ) {
		error_log(  // phpcs:ignore
			sprintf(
				/* translators: 1: composer command. 2: plugin directory */
				esc_html__( 'Your installation of the WooCommerce Admin feature plugin is incomplete. Please run %1$s within the %2$s directory.', 'woocommerce' ),
				'`composer install`',
				'`' . esc_html( str_replace( ABSPATH, '', __DIR__ ) ) . '`'
			)
		);
	}
	/**
	 * Outputs an admin notice if composer install has not been ran.
	 */
	add_action(
		'admin_notices',
		function() {
			?>
			<div class="notice notice-error">
				<p>
					<?php
					printf(
						/* translators: 1: composer command. 2: plugin directory */
						esc_html__( 'Your installation of the WooCommerce Admin feature plugin is incomplete. Please run %1$s within the %2$s directory.', 'woocommerce' ),
						'<code>composer install</code>',
						'<code>' . esc_html( str_replace( ABSPATH, '', __DIR__ ) ) . '</code>'
					);
					?>
				</p>
			</div>
			<?php
		}
	);
	return;
}

/**
 * Returns whether the current version is a development version
 * Note this relies on composer.json version, not plugin version.
 * Development installs of the plugin don't have a version defined in
 * composer json.
 *
 * @return bool True means the current version is a development version.
 */
function woocommerce_admin_is_development_version() {
	$composer_file = __DIR__ . '/composer.json';
	if ( ! is_readable( $composer_file ) ) {
		return false;
	}
	// phpcs:ignore WordPress.WP.AlternativeFunctions.file_get_contents_file_get_contents -- including local file
	$composer_config = json_decode( file_get_contents( $composer_file ), true );
	return ! isset( $composer_config['version'] );
}

/**
 * Returns true if build file exists.
 *
 * @return bool
 */
function woocommerce_admin_check_build_files() {
	$script_debug = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG;
	$suffix       = Loader::should_use_minified_js_file( $script_debug ) ? '.min' : '';
	return file_exists( __DIR__ . "/dist/app/index{$suffix}.js" );
}

/**
 * If development version is detected and the Jetpack constant is not defined, show a notice.
 */
if ( woocommerce_admin_is_development_version() && ! defined( 'JETPACK_AUTOLOAD_DEV' ) ) {
	add_action(
		'admin_notices',
		function() {
			echo '<div class="error"><p>';
			printf(
				/* Translators: %1$s is referring to a php constant name, %2$s is referring to the wp-config.php file. */
				esc_html__( 'WooCommerce Admin development mode requires the %1$s constant to be defined and true in your %2$s file. Otherwise you are loading the admin package from WooCommerce core.', 'woocommerce' ),
				'<code>JETPACK_AUTOLOAD_DEV</code>',
				'<code>wp-config.php</code>'
			);
			echo '</p></div>';
		}
	);
}

/**
 * If we're missing expected files, notify users that the plugin needs to be built.
 */
if ( ! woocommerce_admin_check_build_files() ) {
	add_action(
		'admin_notices',
		function() {
			echo '<div class="error"><p>';
			printf(
				/* Translators: %1$s, %2$s, and %3$s are all build commands to be run in order.  */
				esc_html__( 'You have installed a development version of WooCommerce Admin which requires files to be built. From the plugin directory, run %1$s and %2$s to install dependencies, then %3$s to build the files.', 'woocommerce' ),
				'<code>composer install</code>',
				'<code>npm install</code>',
				'<code>npm run build</code>'
			);
			printf(
				/* translators: 1: URL of GitHub Repository build page */
				esc_html__( 'Or you can download a pre-built version of the plugin by visiting <a href="%1$s">the releases page in the repository</a>.', 'woocommerce' ),
				'https://github.com/woocommerce/woocommerce-admin/releases'
			);
			echo '</p></div>';
		}
	);
}

FeaturePlugin::instance()->init();
woocommerce-admin/uninstall.php000064400000001044151335517650012705 0ustar00<?php
/**
 * WC Admin Uninstall
 *
 * @package WooCommerce\Admin\Uninstaller
 */

defined( 'WP_UNINSTALL_PLUGIN' ) || exit;

// Don't delete table data if core WooCommerce contains WooCommerce Admin.
// This could alternatively check for a specific WooCommerce version rather than a file.
if (
	defined( 'WC_ABSPATH' ) &&
	file_exists( WC_ABSPATH . 'packages/woocommerce-admin/woocommerce-admin.php' )
) {
	return;
}

use \Automattic\WooCommerce\Admin\Install;

require_once dirname( __FILE__ ) . '/woocommerce-admin.php';

Install::drop_tables();
woocommerce-admin/languages/woocommerce-admin.pot000064400000721742151335517650016300 0ustar00# Copyright (C) 2021 WooCommerce
# This file is distributed under the same license as the WooCommerce Admin package.
msgid ""
msgstr ""
"Project-Id-Version: WooCommerce Admin 2.8.0\n"
"Report-Msgid-Bugs-To: "
"https://wordpress.org/support/plugin/woocommerce-admin\n"
"POT-Creation-Date: 2021-11-02 19:28:30+00:00\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
"PO-Revision-Date: 2021-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"Language: en\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"X-Poedit-Country: United States\n"
"X-Poedit-SourceCharset: UTF-8\n"
"X-Poedit-KeywordsList: "
"__;_e;_x:1,2c;_ex:1,2c;_n:1,2;_nx:1,2,4c;_n_noop:1,2;_nx_noop:1,2,3c;esc_"
"attr__;esc_html__;esc_attr_e;esc_html_e;esc_attr_x:1,2c;esc_html_x:1,2c;\n"
"X-Poedit-Basepath: ../\n"
"X-Poedit-SearchPath-0: .\n"
"X-Poedit-Bookmarks: \n"
"X-Textdomain-Support: yes\n"
"X-Generator: grunt-wp-i18n 1.0.3\n"

#: docs/examples/extensions/add-report/woocommerce-admin-add-report-example.php:39
msgid "Example"
msgstr ""

#: docs/examples/extensions/sql-modification/woocommerce-admin-sql-modification.php:47
msgid "United States Dollar"
msgstr ""

#: docs/examples/extensions/sql-modification/woocommerce-admin-sql-modification.php:51
msgid "New Zealand Dollar"
msgstr ""

#: docs/examples/extensions/sql-modification/woocommerce-admin-sql-modification.php:55
msgid "South African Rand"
msgstr ""

#: includes/connect-existing-pages.php:26
#: src/Features/Navigation/CoreMenu.php:113
msgid "Marketplace"
msgstr ""

#: includes/connect-existing-pages.php:30
#: src/Features/Navigation/CoreMenu.php:102
msgid "Reports"
msgstr ""

#: includes/connect-existing-pages.php:34 src/Features/Analytics.php:304
#: src/Features/Navigation/CoreMenu.php:119 src/Features/Settings.php:89
#: client/homescreen/activity-panel/orders/index.js:282
#: client/layout/controller.js:194
#: client/marketing/overview/installed-extensions/row.js:45
#: client/store-management-links/index.js:72
msgid "Settings"
msgstr ""

#: includes/connect-existing-pages.php:38
#: src/API/Reports/Orders/Controller.php:536
#: src/API/Reports/Products/Controller.php:398
#: src/API/Reports/Stock/Controller.php:540
#: src/API/Reports/Variations/Controller.php:420
#: client/analytics/report/orders/table.js:49
#: client/analytics/report/products/table.js:85
#: client/analytics/report/stock/table.js:45
#: client/analytics/report/variations/table.js:73
msgid "Status"
msgstr ""

#: includes/connect-existing-pages.php:42
#: src/Features/Navigation/CoreMenu.php:276
msgid "System status"
msgstr ""

#: includes/connect-existing-pages.php:43
#: src/Features/Navigation/CoreMenu.php:126
msgid "Tools"
msgstr ""

#: includes/connect-existing-pages.php:44
#: src/Features/Navigation/CoreMenu.php:278
msgid "Logs"
msgstr ""

#. Author of the plugin/theme
msgid "WooCommerce"
msgstr ""

#: includes/connect-existing-pages.php:132 src/API/Leaderboards.php:128
#: src/API/Leaderboards.php:264 src/API/Reports/Categories/Controller.php:333
#: src/API/Reports/Coupons/Controller.php:300
#: src/API/Reports/Customers/Controller.php:591
#: src/API/Reports/Orders/Stats/Controller.php:170
#: src/API/Reports/Products/Controller.php:392
#: src/API/Reports/Revenue/Stats/Controller.php:449
#: src/API/Reports/Taxes/Controller.php:307
#: src/API/Reports/Variations/Controller.php:416 src/Features/Analytics.php:228
#: src/Features/Navigation/CoreMenu.php:85 src/ReportCSVEmail.php:36
#: client/analytics/report/revenue/table.js:65
#: client/analytics/report/taxes/config.js:47
#: client/analytics/report/taxes/table.js:58
#: client/analytics/report/variations/config.js:44
#: client/analytics/report/variations/table.js:66
#: client/dashboard/dashboard-charts/config.js:40
#: client/homescreen/activity-panel/panels.js:41
msgid "Orders"
msgstr ""

#: includes/connect-existing-pages.php:143
#: includes/connect-existing-pages.php:174
#: includes/connect-existing-pages.php:204
msgid "Add New"
msgstr ""

#: includes/connect-existing-pages.php:153
msgid "Edit Order"
msgstr ""

#: includes/connect-existing-pages.php:163
#: src/API/Reports/Revenue/Stats/Controller.php:453
#: src/Features/Analytics.php:258 src/Features/Coupons.php:75
#: src/Features/Coupons.php:76 src/ReportCSVEmail.php:33
#: client/analytics/report/coupons/table.js:233
#: client/analytics/report/get-reports.js:94
#: client/analytics/report/orders/table.js:82
#: client/analytics/report/revenue/config.js:32
#: client/analytics/report/revenue/table.js:243
msgid "Coupons"
msgstr ""

#: includes/connect-existing-pages.php:184
msgid "Edit Coupon"
msgstr ""

#: includes/connect-existing-pages.php:193
#: src/API/Reports/Categories/Controller.php:332 src/Features/Analytics.php:208
#: src/Features/Navigation/CoreMenu.php:90 src/ReportCSVEmail.php:37
#: client/analytics/report/categories/table.js:53
#: client/analytics/report/get-reports.js:62
#: client/analytics/report/orders/config.js:120
#: client/analytics/report/orders/table.js:68
#: client/analytics/report/products/table.js:365
#: client/analytics/report/variations/config.js:220
msgid "Products"
msgstr ""

#: includes/connect-existing-pages.php:214
msgid "Edit Product"
msgstr ""

#: includes/connect-existing-pages.php:224
msgid "Import Products"
msgstr ""

#: includes/connect-existing-pages.php:234
msgid "Export Products"
msgstr ""

#: includes/connect-existing-pages.php:244
msgid "Product categories"
msgstr ""

#: includes/connect-existing-pages.php:254
msgid "Edit category"
msgstr ""

#: includes/connect-existing-pages.php:264
msgid "Product tags"
msgstr ""

#: includes/connect-existing-pages.php:274
msgid "Edit tag"
msgstr ""

#: includes/connect-existing-pages.php:284
#: src/Features/Navigation/CoreMenu.php:218
msgid "Attributes"
msgstr ""

#: includes/connect-existing-pages.php:294
msgid "Edit attribute"
msgstr ""

#: includes/connect-existing-pages.php:303
#: src/Features/Navigation/CoreMenu.php:259
msgid "My Subscriptions"
msgstr ""

#: includes/emails/html-admin-report-export-download.php:19
#. translators: %s: report name
msgid "Download your %s Report"
msgstr ""

#: includes/emails/plain-admin-report-export-download.php:15
#. translators: %1$s: report name, %2$s: download URL
msgid "Download your %1$s Report: %2$s"
msgstr ""

#: includes/emails/plain-merchant-notification.php:19
#. translators: %1$s: action label, %2$s: action URL
msgid "%1$s: %2$s"
msgstr ""

#: src/API/Coupons.php:34
msgid "Limit results to coupons with codes matching a given string."
msgstr ""

#: src/API/CustomAttributeTraits.php:26
msgid "No product attribute with that slug was found."
msgstr ""

#: src/API/Customers.php:50 src/API/Notes.php:60
msgid "Unique ID for the resource."
msgstr ""

#: src/API/Data.php:38
msgid "An endpoint used for searching download logs for a specific IP address."
msgstr ""

#: src/API/DataDownloadIPs.php:72
msgid "Invalid request. Please pass the match parameter."
msgstr ""

#: src/API/DataDownloadIPs.php:136
msgid "A partial IP address can be passed and matching results will be returned."
msgstr ""

#: src/API/DataDownloadIPs.php:157
msgid "IP address."
msgstr ""

#: src/API/Features.php:61 src/API/Notes.php:236 src/API/Notes.php:250
#: src/API/OnboardingFreeExtensions.php:61 src/API/OnboardingPayments.php:61
#: src/API/OnboardingProductTypes.php:61 src/API/OnboardingProfile.php:88
#: src/API/Reports/Controller.php:60
msgid "Sorry, you cannot list resources."
msgstr ""

#: src/API/Leaderboards.php:122
msgid "Top Coupons - Number of Orders"
msgstr ""

#: src/API/Leaderboards.php:125 src/API/Reports/Coupons/Controller.php:299
#: client/analytics/report/coupons/table.js:31
msgid "Coupon code"
msgstr ""

#: src/API/Leaderboards.php:131 src/API/Reports/Coupons/Controller.php:301
#: client/analytics/report/coupons/table.js:198
msgid "Amount discounted"
msgstr ""

#: src/API/Leaderboards.php:191
msgid "Top categories - Items sold"
msgstr ""

#: src/API/Leaderboards.php:194 src/API/Reports/Categories/Controller.php:329
#: src/API/Reports/Products/Controller.php:393
#: client/analytics/report/products/table.js:75
msgid "Category"
msgstr ""

#: src/API/Leaderboards.php:197 src/API/Leaderboards.php:333
#: src/API/Reports/Categories/Controller.php:330
#: src/API/Reports/Orders/Controller.php:540
#: src/API/Reports/Products/Controller.php:390
#: src/API/Reports/Variations/Controller.php:414
#: client/analytics/report/categories/config.js:26
#: client/analytics/report/categories/table.js:39
#: client/analytics/report/orders/table.js:74
#: client/analytics/report/products/config.js:29
#: client/analytics/report/products/table.js:53
#: client/analytics/report/variations/config.js:30
#: client/analytics/report/variations/table.js:50
#: client/dashboard/dashboard-charts/config.js:50
msgid "Items sold"
msgstr ""

#: src/API/Leaderboards.php:200 src/API/Leaderboards.php:336
#: client/analytics/report/categories/config.js:33
#: client/analytics/report/categories/table.js:163
#: client/analytics/report/orders/config.js:31
#: client/analytics/report/orders/table.js:89
#: client/analytics/report/products/config.js:36
#: client/analytics/report/products/table.js:304
#: client/analytics/report/revenue/config.js:40
#: client/analytics/report/revenue/table.js:247
#: client/analytics/report/variations/config.js:37
#: client/analytics/report/variations/table.js:59
#: client/dashboard/dashboard-charts/config.js:35
msgid "Net sales"
msgstr ""

#: src/API/Leaderboards.php:258
msgid "Top Customers - Total Spend"
msgstr ""

#: src/API/Leaderboards.php:261
msgid "Customer Name"
msgstr ""

#: src/API/Leaderboards.php:267 src/API/Reports/Customers/Controller.php:592
#: client/analytics/report/customers/config.js:341
msgid "Total Spend"
msgstr ""

#: src/API/Leaderboards.php:327
msgid "Top products - Items sold"
msgstr ""

#: src/API/Leaderboards.php:330
msgid "Product"
msgstr ""

#: src/API/Leaderboards.php:447 src/API/Notes.php:555
#: src/API/ProductsLowInStock.php:290
#: src/API/Reports/Categories/Controller.php:219
#: src/API/Reports/Coupons/Controller.php:225
#: src/API/Reports/Coupons/Stats/Controller.php:272
#: src/API/Reports/Customers/Controller.php:351
#: src/API/Reports/Downloads/Controller.php:252
#: src/API/Reports/Downloads/Stats/Controller.php:229
#: src/API/Reports/Orders/Controller.php:268
#: src/API/Reports/Orders/Stats/Controller.php:333
#: src/API/Reports/Products/Controller.php:261
#: src/API/Reports/Products/Stats/Controller.php:314
#: src/API/Reports/Revenue/Stats/Controller.php:358
#: src/API/Reports/Stock/Controller.php:441
#: src/API/Reports/Taxes/Controller.php:231
#: src/API/Reports/Taxes/Stats/Controller.php:309
#: src/API/Reports/Variations/Controller.php:259
#: src/API/Reports/Variations/Stats/Controller.php:311
msgid "Current page of the collection."
msgstr ""

#: src/API/Leaderboards.php:455 src/API/Notes.php:563
#: src/API/ProductsLowInStock.php:298
#: src/API/Reports/Categories/Controller.php:227
#: src/API/Reports/Coupons/Controller.php:233
#: src/API/Reports/Coupons/Stats/Controller.php:280
#: src/API/Reports/Customers/Controller.php:359
#: src/API/Reports/Downloads/Controller.php:260
#: src/API/Reports/Downloads/Stats/Controller.php:237
#: src/API/Reports/Orders/Controller.php:276
#: src/API/Reports/Orders/Stats/Controller.php:341
#: src/API/Reports/Products/Controller.php:269
#: src/API/Reports/Products/Stats/Controller.php:322
#: src/API/Reports/Revenue/Stats/Controller.php:366
#: src/API/Reports/Stock/Controller.php:449
#: src/API/Reports/Taxes/Controller.php:239
#: src/API/Reports/Taxes/Stats/Controller.php:317
#: src/API/Reports/Variations/Controller.php:267
#: src/API/Reports/Variations/Stats/Controller.php:319
msgid "Maximum number of items to be returned in result set."
msgstr ""

#: src/API/Leaderboards.php:464 src/API/Reports/Categories/Controller.php:236
#: src/API/Reports/Coupons/Controller.php:242
#: src/API/Reports/Coupons/Stats/Controller.php:289
#: src/API/Reports/Downloads/Controller.php:269
#: src/API/Reports/Downloads/Stats/Controller.php:246
#: src/API/Reports/Orders/Controller.php:285
#: src/API/Reports/Orders/Stats/Controller.php:350
#: src/API/Reports/PerformanceIndicators/Controller.php:673
#: src/API/Reports/Products/Controller.php:278
#: src/API/Reports/Products/Stats/Controller.php:331
#: src/API/Reports/Revenue/Stats/Controller.php:375
#: src/API/Reports/Taxes/Controller.php:248
#: src/API/Reports/Taxes/Stats/Controller.php:326
#: src/API/Reports/Variations/Controller.php:276
#: src/API/Reports/Variations/Stats/Controller.php:328
msgid "Limit response to resources published after a given ISO8601 compliant date."
msgstr ""

#: src/API/Leaderboards.php:470 src/API/Reports/Categories/Controller.php:242
#: src/API/Reports/Coupons/Controller.php:248
#: src/API/Reports/Coupons/Stats/Controller.php:295
#: src/API/Reports/Downloads/Controller.php:275
#: src/API/Reports/Downloads/Stats/Controller.php:252
#: src/API/Reports/Orders/Controller.php:291
#: src/API/Reports/Orders/Stats/Controller.php:356
#: src/API/Reports/PerformanceIndicators/Controller.php:679
#: src/API/Reports/Products/Controller.php:284
#: src/API/Reports/Products/Stats/Controller.php:337
#: src/API/Reports/Revenue/Stats/Controller.php:381
#: src/API/Reports/Taxes/Controller.php:254
#: src/API/Reports/Taxes/Stats/Controller.php:332
#: src/API/Reports/Variations/Controller.php:282
#: src/API/Reports/Variations/Stats/Controller.php:334
msgid "Limit response to resources published before a given ISO8601 compliant date."
msgstr ""

#: src/API/Leaderboards.php:476
msgid "URL query to persist across links."
msgstr ""

#: src/API/Leaderboards.php:496
msgid "Leaderboard ID."
msgstr ""

#: src/API/Leaderboards.php:502
msgid "Displayed title for the leaderboard."
msgstr ""

#: src/API/Leaderboards.php:508
msgid "Table headers."
msgstr ""

#: src/API/Leaderboards.php:515
msgid "Table column header."
msgstr ""

#: src/API/Leaderboards.php:525
msgid "Table rows."
msgstr ""

#: src/API/Leaderboards.php:532
msgid "Table cell display."
msgstr ""

#: src/API/Leaderboards.php:538
msgid "Table cell value."
msgstr ""

#: src/API/MarketingOverview.php:86
msgid "Invalid plugin."
msgstr ""

#: src/API/MarketingOverview.php:92
msgid "The plugin could not be activated."
msgstr ""

#: src/API/MarketingOverview.php:113 src/API/Plugins.php:180
msgid "Sorry, you cannot manage plugins."
msgstr ""

#: src/API/NavigationFavorites.php:173 src/API/NavigationFavorites.php:225
#: src/API/NavigationFavorites.php:266
msgid "You must be authenticated to use this endpoint"
msgstr ""

#: src/API/NavigationFavorites.php:198
msgid "Invalid user_id provided"
msgstr ""

#: src/API/NoteActions.php:32
msgid "Unique ID for the Note."
msgstr ""

#: src/API/NoteActions.php:36
msgid "Unique ID for the Note Action."
msgstr ""

#: src/API/NoteActions.php:63 src/API/NoteActions.php:73 src/API/Notes.php:155
#: src/API/Notes.php:268
msgid "Sorry, there is no resource with that ID."
msgstr ""

#: src/API/Notes.php:101 src/API/Notes.php:582
msgid "Status of note."
msgstr ""

#: src/API/Notes.php:289
msgid "Sorry, there is no note with that ID."
msgstr ""

#: src/API/Notes.php:381
msgid "Please provide an array of IDs through the noteIds param."
msgstr ""

#: src/API/Notes.php:407 src/API/OnboardingProfile.php:102
#: src/API/Reports/Import/Controller.php:110
msgid "Sorry, you cannot edit this resource."
msgstr ""

#: src/API/Notes.php:535 src/API/Reports/Categories/Controller.php:248
#: src/API/Reports/Coupons/Controller.php:254
#: src/API/Reports/Coupons/Stats/Controller.php:301
#: src/API/Reports/Customers/Controller.php:368
#: src/API/Reports/Downloads/Controller.php:281
#: src/API/Reports/Downloads/Stats/Controller.php:258
#: src/API/Reports/Orders/Controller.php:297
#: src/API/Reports/Orders/Stats/Controller.php:362
#: src/API/Reports/Products/Controller.php:290
#: src/API/Reports/Products/Stats/Controller.php:343
#: src/API/Reports/Revenue/Stats/Controller.php:387
#: src/API/Reports/Stock/Controller.php:482
#: src/API/Reports/Taxes/Controller.php:260
#: src/API/Reports/Taxes/Stats/Controller.php:338
#: src/API/Reports/Variations/Controller.php:298
#: src/API/Reports/Variations/Stats/Controller.php:350
msgid "Order sort attribute ascending or descending."
msgstr ""

#: src/API/Notes.php:542 src/API/Reports/Categories/Controller.php:255
#: src/API/Reports/Coupons/Controller.php:261
#: src/API/Reports/Coupons/Stats/Controller.php:308
#: src/API/Reports/Customers/Controller.php:375
#: src/API/Reports/Downloads/Controller.php:288
#: src/API/Reports/Downloads/Stats/Controller.php:265
#: src/API/Reports/Orders/Controller.php:304
#: src/API/Reports/Orders/Stats/Controller.php:369
#: src/API/Reports/Products/Controller.php:297
#: src/API/Reports/Products/Stats/Controller.php:350
#: src/API/Reports/Revenue/Stats/Controller.php:394
#: src/API/Reports/Stock/Controller.php:489
#: src/API/Reports/Taxes/Controller.php:267
#: src/API/Reports/Taxes/Stats/Controller.php:345
#: src/API/Reports/Variations/Controller.php:305
#: src/API/Reports/Variations/Stats/Controller.php:357
msgid "Sort collection by object attribute."
msgstr ""

#: src/API/Notes.php:572
msgid "Type of note."
msgstr ""

#: src/API/Notes.php:592
msgid "Source of note."
msgstr ""

#: src/API/Notes.php:615
msgid "ID of the note record."
msgstr ""

#: src/API/Notes.php:621
msgid "Name of the note."
msgstr ""

#: src/API/Notes.php:627
msgid "The type of the note (e.g. error, warning, etc.)."
msgstr ""

#: src/API/Notes.php:633
msgid "Locale used for the note title and content."
msgstr ""

#: src/API/Notes.php:639
msgid "Title of the note."
msgstr ""

#: src/API/Notes.php:645
msgid "Content of the note."
msgstr ""

#: src/API/Notes.php:651
msgid "Content data for the note. JSON string. Available for re-localization."
msgstr ""

#: src/API/Notes.php:657
msgid "The status of the note (e.g. unactioned, actioned)."
msgstr ""

#: src/API/Notes.php:662
msgid "Source of the note."
msgstr ""

#: src/API/Notes.php:668
msgid "Date the note was created."
msgstr ""

#: src/API/Notes.php:674
msgid "Date the note was created (GMT)."
msgstr ""

#: src/API/Notes.php:680
msgid "Date after which the user should be reminded of the note, if any."
msgstr ""

#: src/API/Notes.php:686
msgid "Date after which the user should be reminded of the note, if any (GMT)."
msgstr ""

#: src/API/Notes.php:692
msgid "Whether or not a user can request to be reminded about the note."
msgstr ""

#: src/API/Notes.php:698
msgid "An array of actions, if any, for the note."
msgstr ""

#: src/API/Notes.php:704
msgid "The layout of the note (e.g. banner, thumbnail, plain)."
msgstr ""

#: src/API/Notes.php:710
msgid "The image of the note, if any."
msgstr ""

#: src/API/Notes.php:716
msgid "Registers whether the note is deleted or not"
msgstr ""

#: src/API/OnboardingProfile.php:163
msgid "Onboarding profile data has been updated."
msgstr ""

#: src/API/OnboardingProfile.php:264
msgid "Whether or not the profile was completed."
msgstr ""

#: src/API/OnboardingProfile.php:271
msgid "Whether or not the profile was skipped."
msgstr ""

#: src/API/OnboardingProfile.php:278
msgid "Industry."
msgstr ""

#: src/API/OnboardingProfile.php:288
msgid "Types of products sold."
msgstr ""

#: src/API/OnboardingProfile.php:300
msgid "Number of products to be added."
msgstr ""

#: src/API/OnboardingProfile.php:314
msgid "Other places the store is selling products."
msgstr ""

#: src/API/OnboardingProfile.php:328
msgid "Current annual revenue of the store."
msgstr ""

#: src/API/OnboardingProfile.php:344
msgid "Name of other platform used to sell."
msgstr ""

#: src/API/OnboardingProfile.php:362
msgid "Name of other platform used to sell (not listed)."
msgstr ""

#: src/API/OnboardingProfile.php:369
msgid "Extra business extensions to install."
msgstr ""

#: src/API/OnboardingProfile.php:390
msgid "Selected store theme."
msgstr ""

#: src/API/OnboardingProfile.php:398
msgid "Whether or not this store was setup for a client."
msgstr ""

#: src/API/OnboardingProfile.php:405
msgid ""
"Whether or not the store was connected to WooCommerce.com during the "
"extension flow."
msgstr ""

#: src/API/OnboardingProfile.php:412
msgid ""
"Whether or not this store agreed to receiving marketing contents from "
"WooCommerce.com."
msgstr ""

#: src/API/OnboardingProfile.php:419
msgid "Store email address."
msgstr ""

#: src/API/OnboardingProfile.php:442
#: client/profile-wizard/steps/store-details/index.js:217
msgid "Invalid email address"
msgstr ""

#: src/API/OnboardingTasks.php:104
msgid "Product template name."
msgstr ""

#: src/API/OnboardingTasks.php:171
msgid "Time period to snooze the task."
msgstr ""

#: src/API/OnboardingTasks.php:178
msgid "Optional parameter to query specific task list."
msgstr ""

#: src/API/OnboardingTasks.php:213
msgid "Sorry, you are not allowed to create resources."
msgstr ""

#: src/API/OnboardingTasks.php:227
msgid "Sorry, you are not allowed to create new pages."
msgstr ""

#: src/API/OnboardingTasks.php:241
msgid "Sorry, you are not allowed to retrieve onboarding status."
msgstr ""

#: src/API/OnboardingTasks.php:255
msgid "Sorry, you are not allowed to retrieve onboarding tasks."
msgstr ""

#: src/API/OnboardingTasks.php:269
msgid "Sorry, you are not allowed to hide task lists."
msgstr ""

#: src/API/OnboardingTasks.php:283
msgid "Sorry, you are not allowed to snooze onboarding tasks."
msgstr ""

#: src/API/OnboardingTasks.php:312
msgid "Sorry, the sample products data file was not found."
msgstr ""

#: src/API/OnboardingTasks.php:346
#. translators: %s is template name
msgid "Sorry, creating the product with template failed."
msgstr ""

#: src/API/OnboardingTasks.php:417 src/API/OnboardingTasks.php:432
msgid "Write title…"
msgstr ""

#: src/API/OnboardingTasks.php:418 src/API/OnboardingTasks.php:433
msgid "Welcome to the store"
msgstr ""

#: src/API/OnboardingTasks.php:422 src/API/OnboardingTasks.php:437
msgid "Write a short welcome message here"
msgstr ""

#: src/API/OnboardingTasks.php:426 src/API/OnboardingTasks.php:441
msgid "Go shopping"
msgstr ""

#: src/API/OnboardingTasks.php:459 src/API/OnboardingTasks.php:466
msgid "Content…"
msgstr ""

#: src/API/OnboardingTasks.php:485
msgid "Shop by Category"
msgstr ""

#: src/API/OnboardingTasks.php:491
msgid "New In"
msgstr ""

#: src/API/OnboardingTasks.php:495
msgid "Fan Favorites"
msgstr ""

#: src/API/OnboardingTasks.php:499
msgid "On Sale"
msgstr ""

#: src/API/OnboardingTasks.php:503
msgid "Best Sellers"
msgstr ""

#: src/API/OnboardingTasks.php:522
msgid "New Products"
msgstr ""

#: src/API/OnboardingTasks.php:622
msgid "Homepage"
msgstr ""

#: src/API/OnboardingTasks.php:650
msgid "Homepage created"
msgstr ""

#: src/API/OnboardingTasks.php:672
msgid "Country codes that support Automated Taxes."
msgstr ""

#: src/API/OnboardingTasks.php:681
msgid "If the store has a homepage created."
msgstr ""

#: src/API/OnboardingTasks.php:687
msgid "If the store has an enabled payment gateway."
msgstr ""

#: src/API/OnboardingTasks.php:693
msgid "If the store has any physical (non-virtual) products."
msgstr ""

#: src/API/OnboardingTasks.php:699
msgid "If the store has any products."
msgstr ""

#: src/API/OnboardingTasks.php:705
msgid "If the tax step has been completed."
msgstr ""

#: src/API/OnboardingTasks.php:711
msgid "The number of shipping zones configured for the store."
msgstr ""

#: src/API/OnboardingTasks.php:717
msgid "If the store has the TaxJar extension active."
msgstr ""

#: src/API/OnboardingTasks.php:723
msgid "Active theme modifications."
msgstr ""

#: src/API/OnboardingTasks.php:729
msgid "If the store is using WooCommerce Payments."
msgstr ""

#: src/API/OnboardingTasks.php:786
msgid "Sorry, no dismissable task with that ID was found."
msgstr ""

#: src/API/OnboardingTasks.php:851
msgid "Sorry, no snoozeable task with that ID was found."
msgstr ""

#: src/API/OnboardingTasks.php:888
msgid "Sorry, no snoozed task with that ID was found."
msgstr ""

#: src/API/OnboardingTasks.php:920
msgid "Sorry, that task list was not found"
msgstr ""

#: src/API/OnboardingThemes.php:73
msgid "Sorry, you cannot manage themes."
msgstr ""

#: src/API/OnboardingThemes.php:89 src/API/OnboardingThemes.php:162
msgid "Invalid theme."
msgstr ""

#: src/API/OnboardingThemes.php:123
#. translators: %s: theme slug (example: woocommerce-services)
msgid "The requested theme `%s` could not be installed. Theme API call failed."
msgstr ""

#: src/API/OnboardingThemes.php:138
#. translators: %s: theme slug (example: woocommerce-services)
msgid "The requested theme `%s` could not be installed."
msgstr ""

#: src/API/OnboardingThemes.php:171
#. translators: %s: theme slug (example: woocommerce-services)
msgid "Invalid theme %s."
msgstr ""

#: src/API/OnboardingThemes.php:176
msgid "The requested theme could not be activated."
msgstr ""

#: src/API/OnboardingThemes.php:198
msgid "Theme slug."
msgstr ""

#: src/API/OnboardingThemes.php:204
msgid "Theme name."
msgstr ""

#: src/API/OnboardingThemes.php:210
msgid "Theme status."
msgstr ""

#: src/API/Options.php:73
msgid "You must supply an array of options."
msgstr ""

#: src/API/Options.php:78
msgid "Sorry, you cannot view these options."
msgstr ""

#: src/API/Options.php:112
msgid "You must supply an array of options and values."
msgstr ""

#: src/API/Options.php:117
msgid "Sorry, you cannot manage these options."
msgstr ""

#: src/API/Options.php:201
msgid "Array of options with associated values."
msgstr ""

#: src/API/Orders.php:36
msgid "Limit result set to orders matching part of an order number."
msgstr ""

#: src/API/Plugins.php:231 src/API/Plugins.php:375
msgid "Plugins must be a non-empty array."
msgstr ""

#: src/API/Plugins.php:267 src/API/Plugins.php:279
#. translators: %s: plugin slug (example: woocommerce-services)
msgid "The requested plugin `%s` could not be installed. Plugin API call failed."
msgstr ""

#: src/API/Plugins.php:294
#. translators: %s: plugin slug (example: woocommerce-services)
msgid "The requested plugin `%s` could not be installed."
msgstr ""

#: src/API/Plugins.php:308
#. translators: %s: plugin slug (example: woocommerce-services)
msgid "The requested plugin `%s` could not be installed. Upgrader install failed."
msgstr ""

#: src/API/Plugins.php:326
msgid "Plugins were successfully installed."
msgstr ""

#: src/API/Plugins.php:327
msgid "There was a problem installing some of the requested plugins."
msgstr ""

#: src/API/Plugins.php:398
#. translators: %s: plugin slug (example: woocommerce-services)
msgid "The requested plugin `%s`. is not yet installed."
msgstr ""

#: src/API/Plugins.php:410
#. translators: %s: plugin slug (example: woocommerce-services)
msgid "The requested plugin `%s` could not be activated."
msgstr ""

#: src/API/Plugins.php:426
msgid "Plugins were successfully activated."
msgstr ""

#: src/API/Plugins.php:427
msgid "There was a problem activating some of the requested plugins."
msgstr ""

#: src/API/Plugins.php:482
msgid "Jetpack is not installed or active."
msgstr ""

#: src/API/Plugins.php:493
#: packages/data/build-module/plugins/constants.js:12
#: packages/data/src/plugins/constants.ts:17
msgid "Jetpack"
msgstr ""

#: src/API/Plugins.php:506 src/API/Plugins.php:569
msgid "There was an error loading the WooCommerce.com Helper API."
msgstr ""

#: src/API/Plugins.php:523 src/API/Plugins.php:528 src/API/Plugins.php:585
#: src/API/Plugins.php:590 src/API/Plugins.php:606
msgid "There was an error connecting to WooCommerce.com. Please try again."
msgstr ""

#: src/API/Plugins.php:627
msgid "There was an error connecting to Square."
msgstr ""

#: src/API/Plugins.php:679
msgid "There was an error communicating with the WooCommerce Payments plugin."
msgstr ""

#: src/API/Plugins.php:707
msgid "Plugin slug."
msgstr ""

#: src/API/Plugins.php:713
msgid "Plugin name."
msgstr ""

#: src/API/Plugins.php:719
msgid "Plugin status."
msgstr ""

#: src/API/Plugins.php:739
msgid "Action that should be completed to connect Jetpack."
msgstr ""

#: src/API/ProductAttributeTerms.php:40 src/API/ProductAttributes.php:39
msgid "Slug identifier for the resource."
msgstr ""

#: src/API/ProductAttributeTerms.php:65
msgid "Sorry, you cannot view this resource."
msgstr ""

#: src/API/ProductAttributes.php:61
msgid "Search by similar attribute name."
msgstr ""

#: src/API/ProductVariations.php:55
msgid "Search by similar product name, sku, or attribute value."
msgstr ""

#: src/API/ProductVariations.php:163
msgid "Product parent name."
msgstr ""

#: src/API/ProductVariations.php:168
msgid "Product type."
msgstr ""

#: src/API/ProductVariations.php:175 src/API/Reports/Stock/Controller.php:390
msgid "Product parent ID."
msgstr ""

#: src/API/Products.php:56
msgid "The date the last order for this product was placed, in the site's timezone."
msgstr ""

#: src/API/Products.php:73
msgid "Limit result set to products that are low or out of stock. (Deprecated)"
msgstr ""

#: src/API/Products.php:79
msgid "Search by similar product name or sku."
msgstr ""

#: src/API/ProductsLowInStock.php:309
msgid "Limit result set to products assigned a specific status."
msgstr ""

#: src/API/Reports/Categories/Controller.php:75
msgid "Invalid response from data store."
msgstr ""

#: src/API/Reports/Categories/Controller.php:167
msgid "Category ID."
msgstr ""

#: src/API/Reports/Categories/Controller.php:173
msgid "Amount of items sold."
msgstr ""

#: src/API/Reports/Categories/Controller.php:179
#: src/API/Reports/Revenue/Stats/Controller.php:167
msgid "Total sales."
msgstr ""

#: src/API/Reports/Categories/Controller.php:185
#: src/API/Reports/Coupons/Controller.php:166
#: src/API/Reports/Products/Stats/Controller.php:174
#: src/API/Reports/Revenue/Stats/Controller.php:221
#: src/API/Reports/Taxes/Controller.php:211
#: src/API/Reports/Taxes/Stats/Controller.php:191
#: src/API/Reports/Variations/Stats/Controller.php:171
msgid "Number of orders."
msgstr ""

#: src/API/Reports/Categories/Controller.php:191
msgid "Amount of products."
msgstr ""

#: src/API/Reports/Categories/Controller.php:201
msgid "Category name."
msgstr ""

#: src/API/Reports/Categories/Controller.php:269
#: src/API/Reports/Coupons/Stats/Controller.php:320
#: src/API/Reports/Downloads/Stats/Controller.php:275
#: src/API/Reports/Orders/Stats/Controller.php:381
#: src/API/Reports/Products/Stats/Controller.php:367
#: src/API/Reports/Revenue/Stats/Controller.php:412
#: src/API/Reports/Taxes/Stats/Controller.php:358
#: src/API/Reports/Variations/Stats/Controller.php:374
msgid "Time interval to use for buckets in the returned data."
msgstr ""

#: src/API/Reports/Categories/Controller.php:283
#: src/API/Reports/Orders/Controller.php:395
#: src/API/Reports/Orders/Stats/Controller.php:405
msgid "Limit result set to items that have the specified order status."
msgstr ""

#: src/API/Reports/Categories/Controller.php:293
#: src/API/Reports/Orders/Controller.php:405
#: src/API/Reports/Orders/Stats/Controller.php:416
msgid "Limit result set to items that don't have the specified order status."
msgstr ""

#: src/API/Reports/Categories/Controller.php:303
msgid ""
"Limit result set to all items that have the specified term assigned in the "
"categories taxonomy."
msgstr ""

#: src/API/Reports/Categories/Controller.php:312
msgid "Add additional piece of info about each category to the report."
msgstr ""

#: src/API/Reports/Categories/Controller.php:331
#: src/API/Reports/Revenue/Stats/Controller.php:456
msgid "Net Revenue"
msgstr ""

#: src/API/Reports/Categories/DataStore.php:271
#: src/API/Reports/Orders/Stats/DataStore.php:335
#: src/API/Reports/Orders/Stats/DataStore.php:388
#: src/API/Reports/Products/Stats/DataStore.php:186
#: src/API/Reports/Products/Stats/DataStore.php:202
#: src/API/Reports/Taxes/Stats/DataStore.php:189
#: src/API/Reports/Variations/Stats/DataStore.php:211
#: src/API/Reports/Variations/Stats/DataStore.php:229
msgid "Sorry, fetching revenue data failed."
msgstr ""

#: src/API/Reports/Controller.php:78
msgid ""
"Batch endpoint for getting specific performance indicators from `stats` "
"endpoints."
msgstr ""

#: src/API/Reports/Controller.php:82
msgid "Stats about revenue."
msgstr ""

#: src/API/Reports/Controller.php:86
msgid "Stats about orders."
msgstr ""

#: src/API/Reports/Controller.php:90
msgid "Products detailed reports."
msgstr ""

#: src/API/Reports/Controller.php:94
msgid "Stats about products."
msgstr ""

#: src/API/Reports/Controller.php:98
msgid "Variations detailed reports."
msgstr ""

#: src/API/Reports/Controller.php:102
msgid "Stats about variations."
msgstr ""

#: src/API/Reports/Controller.php:106
msgid "Product categories detailed reports."
msgstr ""

#: src/API/Reports/Controller.php:110
msgid "Stats about product categories."
msgstr ""

#: src/API/Reports/Controller.php:114
msgid "Coupons detailed reports."
msgstr ""

#: src/API/Reports/Controller.php:118
msgid "Stats about coupons."
msgstr ""

#: src/API/Reports/Controller.php:122
msgid "Taxes detailed reports."
msgstr ""

#: src/API/Reports/Controller.php:126
msgid "Stats about taxes."
msgstr ""

#: src/API/Reports/Controller.php:130
msgid "Product downloads detailed reports."
msgstr ""

#: src/API/Reports/Controller.php:134
msgid "Product download files detailed reports."
msgstr ""

#: src/API/Reports/Controller.php:138
msgid "Stats about product downloads."
msgstr ""

#: src/API/Reports/Controller.php:142
msgid "Customers detailed reports."
msgstr ""

#: src/API/Reports/Controller.php:287
msgid "An alphanumeric identifier for the resource."
msgstr ""

#: src/API/Reports/Controller.php:293
msgid "A human-readable description of the resource."
msgstr ""

#: src/API/Reports/Controller.php:299
msgid "API path."
msgstr ""

#: src/API/Reports/Coupons/Controller.php:154
msgid "Coupon ID."
msgstr ""

#: src/API/Reports/Coupons/Controller.php:160
#: src/API/Reports/Coupons/Stats/Controller.php:144
msgid "Net discount amount."
msgstr ""

#: src/API/Reports/Coupons/Controller.php:176
msgid "Coupon code."
msgstr ""

#: src/API/Reports/Coupons/Controller.php:182
msgid "Coupon creation date."
msgstr ""

#: src/API/Reports/Coupons/Controller.php:188
msgid "Coupon creation date in GMT."
msgstr ""

#: src/API/Reports/Coupons/Controller.php:194
msgid "Coupon expiration date."
msgstr ""

#: src/API/Reports/Coupons/Controller.php:200
msgid "Coupon expiration date in GMT."
msgstr ""

#: src/API/Reports/Coupons/Controller.php:207
msgid "Coupon discount type."
msgstr ""

#: src/API/Reports/Coupons/Controller.php:273
#: src/API/Reports/Coupons/Stats/Controller.php:334
msgid "Limit result set to coupons assigned specific coupon IDs."
msgstr ""

#: src/API/Reports/Coupons/Controller.php:282
#: src/API/Reports/Orders/Controller.php:439
msgid "Add additional piece of info about each coupon to the report."
msgstr ""

#: src/API/Reports/Coupons/Controller.php:302
#: client/analytics/report/coupons/table.js:52
msgid "Created"
msgstr ""

#: src/API/Reports/Coupons/Controller.php:303
#: client/analytics/report/coupons/table.js:56
msgid "Expires"
msgstr ""

#: src/API/Reports/Coupons/Controller.php:304
#: client/analytics/report/coupons/table.js:60
msgid "Type"
msgstr ""

#: src/API/Reports/Coupons/Controller.php:327
#: src/API/Reports/Coupons/DataStore.php:173
#: src/API/Reports/Products/Controller.php:436
#: src/API/Reports/Products/Controller.php:437
#: client/analytics/report/coupons/table.js:210
#: client/analytics/report/products/table.js:267
#: client/analytics/report/stock/table.js:131
#: packages/components/build-module/summary/number.js:88
msgid "N/A"
msgstr ""

#: src/API/Reports/Coupons/DataStore.php:168
#: src/API/Reports/Products/DataStore.php:227
#: client/analytics/report/downloads/table.js:94
msgid "(Deleted)"
msgstr ""

#: src/API/Reports/Coupons/Stats/Controller.php:152
msgid "Number of coupons."
msgstr ""

#: src/API/Reports/Coupons/Stats/Controller.php:158
#: client/analytics/report/coupons/config.js:24
#: client/dashboard/dashboard-charts/config.js:60
msgid "Discounted orders"
msgstr ""

#: src/API/Reports/Coupons/Stats/Controller.php:159
msgid "Number of discounted orders."
msgstr ""

#: src/API/Reports/Coupons/Stats/Controller.php:169
#: src/API/Reports/Orders/Stats/Controller.php:225
#: src/API/Reports/Products/Stats/Controller.php:183
#: src/API/Reports/Revenue/Stats/Controller.php:250
#: src/API/Reports/Taxes/Stats/Controller.php:206
#: src/API/Reports/Variations/Stats/Controller.php:180
msgid "Reports data grouped by segment condition."
msgstr ""

#: src/API/Reports/Coupons/Stats/Controller.php:177
#: src/API/Reports/Orders/Stats/Controller.php:233
#: src/API/Reports/Products/Stats/Controller.php:191
#: src/API/Reports/Revenue/Stats/Controller.php:258
#: src/API/Reports/Taxes/Stats/Controller.php:214
#: src/API/Reports/Variations/Stats/Controller.php:188
msgid "Segment identificator."
msgstr ""

#: src/API/Reports/Coupons/Stats/Controller.php:183
#: src/API/Reports/Coupons/Stats/Controller.php:248
#: src/API/Reports/Downloads/Stats/Controller.php:205
#: src/API/Reports/Orders/Stats/Controller.php:239
#: src/API/Reports/Orders/Stats/Controller.php:309
#: src/API/Reports/Products/Stats/Controller.php:204
#: src/API/Reports/Products/Stats/Controller.php:269
#: src/API/Reports/Revenue/Stats/Controller.php:264
#: src/API/Reports/Revenue/Stats/Controller.php:334
#: src/API/Reports/Taxes/Stats/Controller.php:220
#: src/API/Reports/Taxes/Stats/Controller.php:285
#: src/API/Reports/Variations/Stats/Controller.php:201
#: src/API/Reports/Variations/Stats/Controller.php:266
msgid "Interval subtotals."
msgstr ""

#: src/API/Reports/Coupons/Stats/Controller.php:202
#: src/API/Reports/Customers/Stats/Controller.php:164
#: src/API/Reports/Downloads/Stats/Controller.php:159
#: src/API/Reports/Orders/Stats/Controller.php:263
#: src/API/Reports/Products/Stats/Controller.php:223
#: src/API/Reports/Revenue/Stats/Controller.php:288
#: src/API/Reports/Stock/Stats/Controller.php:115
#: src/API/Reports/Taxes/Stats/Controller.php:239
#: src/API/Reports/Variations/Stats/Controller.php:220
msgid "Totals data."
msgstr ""

#: src/API/Reports/Coupons/Stats/Controller.php:209
#: src/API/Reports/Downloads/Stats/Controller.php:166
#: src/API/Reports/Orders/Stats/Controller.php:270
#: src/API/Reports/Products/Stats/Controller.php:230
#: src/API/Reports/Revenue/Stats/Controller.php:295
#: src/API/Reports/Taxes/Stats/Controller.php:246
#: src/API/Reports/Variations/Stats/Controller.php:227
msgid "Reports data grouped by intervals."
msgstr ""

#: src/API/Reports/Coupons/Stats/Controller.php:217
#: src/API/Reports/Downloads/Stats/Controller.php:174
#: src/API/Reports/Orders/Stats/Controller.php:278
#: src/API/Reports/Products/Stats/Controller.php:238
#: src/API/Reports/Revenue/Stats/Controller.php:303
#: src/API/Reports/Taxes/Stats/Controller.php:254
#: src/API/Reports/Variations/Stats/Controller.php:235
msgid "Type of interval."
msgstr ""

#: src/API/Reports/Coupons/Stats/Controller.php:224
#: src/API/Reports/Downloads/Stats/Controller.php:181
#: src/API/Reports/Orders/Stats/Controller.php:285
#: src/API/Reports/Products/Stats/Controller.php:245
#: src/API/Reports/Revenue/Stats/Controller.php:310
#: src/API/Reports/Taxes/Stats/Controller.php:261
#: src/API/Reports/Variations/Stats/Controller.php:242
msgid "The date the report start, in the site's timezone."
msgstr ""

#: src/API/Reports/Coupons/Stats/Controller.php:230
#: src/API/Reports/Downloads/Stats/Controller.php:187
#: src/API/Reports/Orders/Stats/Controller.php:291
#: src/API/Reports/Products/Stats/Controller.php:251
#: src/API/Reports/Revenue/Stats/Controller.php:316
#: src/API/Reports/Taxes/Stats/Controller.php:267
#: src/API/Reports/Variations/Stats/Controller.php:248
msgid "The date the report start, as GMT."
msgstr ""

#: src/API/Reports/Coupons/Stats/Controller.php:236
#: src/API/Reports/Downloads/Stats/Controller.php:193
#: src/API/Reports/Orders/Stats/Controller.php:297
#: src/API/Reports/Products/Stats/Controller.php:257
#: src/API/Reports/Revenue/Stats/Controller.php:322
#: src/API/Reports/Taxes/Stats/Controller.php:273
#: src/API/Reports/Variations/Stats/Controller.php:254
msgid "The date the report end, in the site's timezone."
msgstr ""

#: src/API/Reports/Coupons/Stats/Controller.php:242
#: src/API/Reports/Downloads/Stats/Controller.php:199
#: src/API/Reports/Orders/Stats/Controller.php:303
#: src/API/Reports/Products/Stats/Controller.php:263
#: src/API/Reports/Revenue/Stats/Controller.php:328
#: src/API/Reports/Taxes/Stats/Controller.php:279
#: src/API/Reports/Variations/Stats/Controller.php:260
msgid "The date the report end, as GMT."
msgstr ""

#: src/API/Reports/Coupons/Stats/Controller.php:343
#: src/API/Reports/Orders/Stats/Controller.php:552
#: src/API/Reports/Products/Stats/Controller.php:408
#: src/API/Reports/Revenue/Stats/Controller.php:426
#: src/API/Reports/Taxes/Stats/Controller.php:381
#: src/API/Reports/Variations/Stats/Controller.php:435
msgid "Segment the response by additional constraint."
msgstr ""

#: src/API/Reports/Coupons/Stats/Controller.php:354
#: src/API/Reports/Customers/Stats/Controller.php:379
#: src/API/Reports/Downloads/Stats/Controller.php:371
#: src/API/Reports/Orders/Stats/Controller.php:564
#: src/API/Reports/Products/Stats/Controller.php:418
#: src/API/Reports/Taxes/Stats/Controller.php:389
#: src/API/Reports/Variations/Stats/Controller.php:445
msgid "Limit stats fields to the specified items."
msgstr ""

#: src/API/Reports/Coupons/Stats/Segmenter.php:283
#: src/API/Reports/Orders/Stats/Segmenter.php:378
#: src/API/Reports/Products/Stats/Segmenter.php:169
msgid ""
"product_includes parameter need to specify exactly one product when "
"segmenting by variation."
msgstr ""

#: src/API/Reports/Customers/Controller.php:224
#: src/API/Reports/Orders/Controller.php:204
msgid "Customer ID."
msgstr ""

#: src/API/Reports/Customers/Controller.php:230
msgid "User ID."
msgstr ""

#: src/API/Reports/Customers/Controller.php:236
msgid "Name."
msgstr ""

#: src/API/Reports/Customers/Controller.php:242
msgid "Username."
msgstr ""

#: src/API/Reports/Customers/Controller.php:248
#: src/API/Reports/Taxes/Controller.php:175
msgid "Country / Region."
msgstr ""

#: src/API/Reports/Customers/Controller.php:254
msgid "City."
msgstr ""

#: src/API/Reports/Customers/Controller.php:260
msgid "Region."
msgstr ""

#: src/API/Reports/Customers/Controller.php:266
msgid "Postal code."
msgstr ""

#: src/API/Reports/Customers/Controller.php:272
msgid "Date registered."
msgstr ""

#: src/API/Reports/Customers/Controller.php:278
msgid "Date registered GMT."
msgstr ""

#: src/API/Reports/Customers/Controller.php:284
msgid "Date last active."
msgstr ""

#: src/API/Reports/Customers/Controller.php:290
msgid "Date last active GMT."
msgstr ""

#: src/API/Reports/Customers/Controller.php:296
msgid "Order count."
msgstr ""

#: src/API/Reports/Customers/Controller.php:302
msgid "Total spend."
msgstr ""

#: src/API/Reports/Customers/Controller.php:308
msgid "Avg order value."
msgstr ""

#: src/API/Reports/Customers/Controller.php:327
#: src/API/Reports/Customers/Controller.php:479
#: src/API/Reports/Customers/Stats/Controller.php:185
#: src/API/Reports/Customers/Stats/Controller.php:282
msgid ""
"Limit response to objects registered before (or at) a given ISO8601 "
"compliant datetime."
msgstr ""

#: src/API/Reports/Customers/Controller.php:333
#: src/API/Reports/Customers/Controller.php:485
#: src/API/Reports/Customers/Stats/Controller.php:191
#: src/API/Reports/Customers/Stats/Controller.php:288
msgid ""
"Limit response to objects registered after (or at) a given ISO8601 "
"compliant datetime."
msgstr ""

#: src/API/Reports/Customers/Controller.php:339
msgid ""
"Limit response to resources with orders published after a given ISO8601 "
"compliant date."
msgstr ""

#: src/API/Reports/Customers/Controller.php:345
msgid ""
"Limit response to resources with orders published before a given ISO8601 "
"compliant date."
msgstr ""

#: src/API/Reports/Customers/Controller.php:394
#: src/API/Reports/Customers/Stats/Controller.php:197
#: src/API/Reports/Downloads/Stats/Controller.php:289
#: src/API/Reports/Orders/Stats/Controller.php:395
#: src/API/Reports/Products/Controller.php:321
#: src/API/Reports/Variations/Controller.php:288
#: src/API/Reports/Variations/Stats/Controller.php:340
msgid ""
"Indicates whether all the conditions should be true for the resulting set, "
"or if any one of them is sufficient. Match affects the following "
"parameters: status_is, status_is_not, product_includes, product_excludes, "
"coupon_includes, coupon_excludes, customer, categories"
msgstr ""

#: src/API/Reports/Customers/Controller.php:404
#: src/API/Reports/Customers/Stats/Controller.php:207
msgid ""
"Limit response to objects with a customer field containing the search term. "
"Searches the field provided by `searchby`."
msgstr ""

#: src/API/Reports/Customers/Controller.php:419
#: src/API/Reports/Customers/Stats/Controller.php:222
msgid "Limit response to objects with specfic names."
msgstr ""

#: src/API/Reports/Customers/Controller.php:424
#: src/API/Reports/Customers/Stats/Controller.php:227
msgid "Limit response to objects excluding specfic names."
msgstr ""

#: src/API/Reports/Customers/Controller.php:429
#: src/API/Reports/Customers/Stats/Controller.php:232
msgid "Limit response to objects with specfic usernames."
msgstr ""

#: src/API/Reports/Customers/Controller.php:434
#: src/API/Reports/Customers/Stats/Controller.php:237
msgid "Limit response to objects excluding specfic usernames."
msgstr ""

#: src/API/Reports/Customers/Controller.php:439
#: src/API/Reports/Customers/Stats/Controller.php:242
msgid "Limit response to objects including emails."
msgstr ""

#: src/API/Reports/Customers/Controller.php:444
#: src/API/Reports/Customers/Stats/Controller.php:247
msgid "Limit response to objects excluding emails."
msgstr ""

#: src/API/Reports/Customers/Controller.php:449
#: src/API/Reports/Customers/Stats/Controller.php:252
msgid "Limit response to objects with specfic countries."
msgstr ""

#: src/API/Reports/Customers/Controller.php:454
#: src/API/Reports/Customers/Stats/Controller.php:257
msgid "Limit response to objects excluding specfic countries."
msgstr ""

#: src/API/Reports/Customers/Controller.php:459
#: src/API/Reports/Customers/Stats/Controller.php:262
msgid ""
"Limit response to objects last active before (or at) a given ISO8601 "
"compliant datetime."
msgstr ""

#: src/API/Reports/Customers/Controller.php:465
#: src/API/Reports/Customers/Stats/Controller.php:268
msgid ""
"Limit response to objects last active after (or at) a given ISO8601 "
"compliant datetime."
msgstr ""

#: src/API/Reports/Customers/Controller.php:471
#: src/API/Reports/Customers/Controller.php:491
#: src/API/Reports/Customers/Stats/Controller.php:274
#: src/API/Reports/Customers/Stats/Controller.php:294
msgid ""
"Limit response to objects last active between two given ISO8601 compliant "
"datetime."
msgstr ""

#: src/API/Reports/Customers/Controller.php:499
#: src/API/Reports/Customers/Stats/Controller.php:302
msgid ""
"Limit response to objects with an order count greater than or equal to "
"given integer."
msgstr ""

#: src/API/Reports/Customers/Controller.php:505
#: src/API/Reports/Customers/Stats/Controller.php:308
msgid ""
"Limit response to objects with an order count less than or equal to given "
"integer."
msgstr ""

#: src/API/Reports/Customers/Controller.php:511
#: src/API/Reports/Customers/Stats/Controller.php:314
msgid "Limit response to objects with an order count between two given integers."
msgstr ""

#: src/API/Reports/Customers/Controller.php:519
#: src/API/Reports/Customers/Stats/Controller.php:322
msgid ""
"Limit response to objects with a total order spend greater than or equal to "
"given number."
msgstr ""

#: src/API/Reports/Customers/Controller.php:524
#: src/API/Reports/Customers/Stats/Controller.php:327
msgid ""
"Limit response to objects with a total order spend less than or equal to "
"given number."
msgstr ""

#: src/API/Reports/Customers/Controller.php:529
#: src/API/Reports/Customers/Stats/Controller.php:332
msgid ""
"Limit response to objects with a total order spend between two given "
"numbers."
msgstr ""

#: src/API/Reports/Customers/Controller.php:537
#: src/API/Reports/Customers/Stats/Controller.php:340
msgid ""
"Limit response to objects with an average order spend greater than or equal "
"to given number."
msgstr ""

#: src/API/Reports/Customers/Controller.php:542
#: src/API/Reports/Customers/Stats/Controller.php:345
msgid ""
"Limit response to objects with an average order spend less than or equal to "
"given number."
msgstr ""

#: src/API/Reports/Customers/Controller.php:547
#: src/API/Reports/Customers/Stats/Controller.php:350
msgid ""
"Limit response to objects with an average order spend between two given "
"numbers."
msgstr ""

#: src/API/Reports/Customers/Controller.php:555
#: src/API/Reports/Customers/Stats/Controller.php:358
msgid ""
"Limit response to objects with last order before (or at) a given ISO8601 "
"compliant datetime."
msgstr ""

#: src/API/Reports/Customers/Controller.php:561
#: src/API/Reports/Customers/Stats/Controller.php:364
msgid ""
"Limit response to objects with last order after (or at) a given ISO8601 "
"compliant datetime."
msgstr ""

#: src/API/Reports/Customers/Controller.php:567
#: src/API/Reports/Customers/Stats/Controller.php:370
msgid "Limit result to items with specified customer ids."
msgstr ""

#: src/API/Reports/Customers/Controller.php:586
#: client/analytics/report/customers/config.js:81
#: client/analytics/report/customers/table.js:32
msgid "Name"
msgstr ""

#: src/API/Reports/Customers/Controller.php:587
#: client/analytics/report/customers/config.js:190
#: client/analytics/report/customers/table.js:39
#: client/analytics/report/downloads/config.js:100
#: client/analytics/report/downloads/table.js:57
msgid "Username"
msgstr ""

#: src/API/Reports/Customers/Controller.php:588
msgid "Last Active"
msgstr ""

#: src/API/Reports/Customers/Controller.php:589
msgid "Sign Up"
msgstr ""

#: src/API/Reports/Customers/Controller.php:590
#: client/analytics/report/customers/config.js:241
#: client/analytics/report/customers/table.js:55
msgid "Email"
msgstr ""

#: src/API/Reports/Customers/Controller.php:593
#: client/analytics/report/customers/config.js:390
#: client/analytics/report/customers/table.js:71
msgid "AOV"
msgstr ""

#: src/API/Reports/Customers/Controller.php:594
#: client/analytics/report/customers/config.js:132
#: client/analytics/report/customers/table.js:80
#: client/dashboard/components/settings/general/store-address.js:236
msgid "Country / Region"
msgstr ""

#: src/API/Reports/Customers/Controller.php:595
#: client/analytics/report/customers/table.js:85
#: client/dashboard/components/settings/general/store-address.js:250
msgid "City"
msgstr ""

#: src/API/Reports/Customers/Controller.php:596
#: client/analytics/report/customers/table.js:91
msgid "Region"
msgstr ""

#: src/API/Reports/Customers/Controller.php:597
msgid "Postal Code"
msgstr ""

#: src/API/Reports/Customers/Stats/Controller.php:131
msgid "Number of customers."
msgstr ""

#: src/API/Reports/Customers/Stats/Controller.php:137
msgid "Average number of orders."
msgstr ""

#: src/API/Reports/Customers/Stats/Controller.php:143
msgid "Average total spend per customer."
msgstr ""

#: src/API/Reports/Customers/Stats/Controller.php:150
msgid "Average AOV per customer."
msgstr ""

#: src/API/Reports/Downloads/Controller.php:169
msgid "ID."
msgstr ""

#: src/API/Reports/Downloads/Controller.php:175
#: src/API/Reports/Products/Controller.php:164
#: src/API/Reports/Variations/Controller.php:168
#: src/API/Reports/Variations/Controller.php:174
msgid "Product ID."
msgstr ""

#: src/API/Reports/Downloads/Controller.php:178
msgid "The date of the download, in the site's timezone."
msgstr ""

#: src/API/Reports/Downloads/Controller.php:184
msgid "The date of the download, as GMT."
msgstr ""

#: src/API/Reports/Downloads/Controller.php:193
msgid "Download ID."
msgstr ""

#: src/API/Reports/Downloads/Controller.php:199
msgid "File name."
msgstr ""

#: src/API/Reports/Downloads/Controller.php:205
msgid "File URL."
msgstr ""

#: src/API/Reports/Downloads/Controller.php:211
#: src/API/Reports/Orders/Controller.php:174
msgid "Order ID."
msgstr ""

#: src/API/Reports/Downloads/Controller.php:217
#: src/API/Reports/Orders/Controller.php:180
msgid "Order Number."
msgstr ""

#: src/API/Reports/Downloads/Controller.php:223
msgid "User ID for the downloader."
msgstr ""

#: src/API/Reports/Downloads/Controller.php:229
msgid "User name of the downloader."
msgstr ""

#: src/API/Reports/Downloads/Controller.php:235
msgid "IP address for the downloader."
msgstr ""

#: src/API/Reports/Downloads/Controller.php:298
msgid ""
"Indicates whether all the conditions should be true for the resulting set, "
"or if any one of them is sufficient. Match affects the following "
"parameters: products, orders, username, ip_address."
msgstr ""

#: src/API/Reports/Downloads/Controller.php:308
#: src/API/Reports/Downloads/Stats/Controller.php:299
#: src/API/Reports/Orders/Controller.php:315
#: src/API/Reports/Orders/Stats/Controller.php:426
msgid "Limit result set to items that have the specified product(s) assigned."
msgstr ""

#: src/API/Reports/Downloads/Controller.php:318
#: src/API/Reports/Downloads/Stats/Controller.php:309
#: src/API/Reports/Orders/Controller.php:325
#: src/API/Reports/Orders/Stats/Controller.php:436
msgid "Limit result set to items that don't have the specified product(s) assigned."
msgstr ""

#: src/API/Reports/Downloads/Controller.php:328
#: src/API/Reports/Downloads/Stats/Controller.php:318
#: src/API/Reports/Orders/Controller.php:446
msgid "Limit result set to items that have the specified order ids."
msgstr ""

#: src/API/Reports/Downloads/Controller.php:337
#: src/API/Reports/Downloads/Stats/Controller.php:327
#: src/API/Reports/Orders/Controller.php:455
msgid "Limit result set to items that don't have the specified order ids."
msgstr ""

#: src/API/Reports/Downloads/Controller.php:346
msgid "Limit response to objects that have the specified user ids."
msgstr ""

#: src/API/Reports/Downloads/Controller.php:355
msgid "Limit response to objects that don't have the specified user ids."
msgstr ""

#: src/API/Reports/Downloads/Controller.php:364
#: src/API/Reports/Downloads/Stats/Controller.php:354
msgid "Limit response to objects that have a specified ip address."
msgstr ""

#: src/API/Reports/Downloads/Controller.php:373
#: src/API/Reports/Downloads/Stats/Controller.php:363
msgid "Limit response to objects that don't have a specified ip address."
msgstr ""

#: src/API/Reports/Downloads/Controller.php:391
#: src/API/Reports/Orders/Controller.php:533
#: src/API/Reports/Revenue/Stats/Controller.php:448
#: client/analytics/report/downloads/table.js:34
#: client/analytics/report/orders/table.js:35
#: client/analytics/report/revenue/table.js:57
msgid "Date"
msgstr ""

#: src/API/Reports/Downloads/Controller.php:392
#: src/API/Reports/Products/Controller.php:388
#: client/analytics/report/downloads/table.js:42
#: client/analytics/report/products/table.js:40
msgid "Product title"
msgstr ""

#: src/API/Reports/Downloads/Controller.php:393
#: client/analytics/report/downloads/table.js:48
msgid "File name"
msgstr ""

#: src/API/Reports/Downloads/Controller.php:394
#: src/API/Reports/Orders/Controller.php:534
#: client/analytics/report/downloads/config.js:151
#: client/analytics/report/downloads/table.js:52
#: client/analytics/report/orders/table.js:43
msgid "Order #"
msgstr ""

#: src/API/Reports/Downloads/Controller.php:395
msgid "User Name"
msgstr ""

#: src/API/Reports/Downloads/Controller.php:396
#: client/analytics/report/downloads/table.js:61
msgid "IP"
msgstr ""

#: src/API/Reports/Downloads/Stats/Controller.php:144
#: src/Features/Analytics.php:278 src/Features/Onboarding.php:442
#: src/ReportCSVEmail.php:35
#: client/analytics/report/downloads/config.js:25
#: client/analytics/report/downloads/table.js:197
#: client/analytics/report/get-reports.js:125
#: client/dashboard/dashboard-charts/config.js:90
msgid "Downloads"
msgstr ""

#: src/API/Reports/Downloads/Stats/Controller.php:145
msgid "Number of downloads."
msgstr ""

#: src/API/Reports/Downloads/Stats/Controller.php:336
msgid "Limit response to objects that have the specified customer ids."
msgstr ""

#: src/API/Reports/Downloads/Stats/Controller.php:345
msgid "Limit response to objects that don't have the specified customer ids."
msgstr ""

#: src/API/Reports/Downloads/Stats/DataStore.php:118
#: src/API/Reports/Downloads/Stats/DataStore.php:134
msgid "Sorry, fetching downloads data failed."
msgstr ""

#: src/API/Reports/Export/Controller.php:76
msgid "Parameters to pass on to the exported report."
msgstr ""

#: src/API/Reports/Export/Controller.php:81
msgid "When true, email a link to download the export to the requesting user."
msgstr ""

#: src/API/Reports/Export/Controller.php:100
msgid "Export status."
msgstr ""

#: src/API/Reports/Export/Controller.php:106
msgid "Export status message."
msgstr ""

#: src/API/Reports/Export/Controller.php:112
msgid "Export ID."
msgstr ""

#: src/API/Reports/Export/Controller.php:135
msgid "Percentage complete."
msgstr ""

#: src/API/Reports/Export/Controller.php:141
msgid "Export download URL."
msgstr ""

#: src/API/Reports/Export/Controller.php:172
msgid "There is no data to export for the given request."
msgstr ""

#: src/API/Reports/Export/Controller.php:181
msgid "Your report file is being generated."
msgstr ""

#: src/API/Reports/Export/Controller.php:214
msgid "Sorry, there is no export with that ID."
msgstr ""

#: src/API/Reports/Import/Controller.php:187
msgid "Number of days to import."
msgstr ""

#: src/API/Reports/Import/Controller.php:194
msgid "Skip importing existing order data."
msgstr ""

#: src/API/Reports/Import/Controller.php:215
msgid "Regeneration status."
msgstr ""

#: src/API/Reports/Import/Controller.php:221
msgid "Regenerate data message."
msgstr ""

#: src/API/Reports/Import/Controller.php:243
msgid "All pending and in-progress import actions have been cancelled."
msgstr ""

#: src/API/Reports/Orders/Controller.php:186
msgid "Date the order was created, in the site's timezone."
msgstr ""

#: src/API/Reports/Orders/Controller.php:192
msgid "Date the order was created, as GMT."
msgstr ""

#: src/API/Reports/Orders/Controller.php:198
msgid "Order status."
msgstr ""

#: src/API/Reports/Orders/Controller.php:210
#: src/API/Reports/Products/Controller.php:170
#: src/API/Reports/Variations/Controller.php:180
msgid "Number of items sold."
msgstr ""

#: src/API/Reports/Orders/Controller.php:216
msgid "Net total revenue."
msgstr ""

#: src/API/Reports/Orders/Controller.php:222
msgid "Net total revenue (formatted)."
msgstr ""

#: src/API/Reports/Orders/Controller.php:228
msgid "Returning or new customer."
msgstr ""

#: src/API/Reports/Orders/Controller.php:238
msgid "List of order product IDs, names, quantities."
msgstr ""

#: src/API/Reports/Orders/Controller.php:244
msgid "List of order coupons."
msgstr ""

#: src/API/Reports/Orders/Controller.php:250
msgid "Order customer information."
msgstr ""

#: src/API/Reports/Orders/Controller.php:335
#: src/API/Reports/Orders/Stats/Controller.php:445
msgid "Limit result set to items that have the specified variation(s) assigned."
msgstr ""

#: src/API/Reports/Orders/Controller.php:345
#: src/API/Reports/Orders/Stats/Controller.php:455
msgid ""
"Limit result set to items that don't have the specified variation(s) "
"assigned."
msgstr ""

#: src/API/Reports/Orders/Controller.php:355
#: src/API/Reports/Orders/Stats/Controller.php:465
msgid "Limit result set to items that have the specified coupon(s) assigned."
msgstr ""

#: src/API/Reports/Orders/Controller.php:365
#: src/API/Reports/Orders/Stats/Controller.php:474
msgid "Limit result set to items that don't have the specified coupon(s) assigned."
msgstr ""

#: src/API/Reports/Orders/Controller.php:375
#: src/API/Reports/Orders/Stats/Controller.php:483
msgid "Limit result set to items that have the specified tax rate(s) assigned."
msgstr ""

#: src/API/Reports/Orders/Controller.php:385
#: src/API/Reports/Orders/Stats/Controller.php:493
msgid ""
"Limit result set to items that don't have the specified tax rate(s) "
"assigned."
msgstr ""

#: src/API/Reports/Orders/Controller.php:415
msgid "Limit result set to returning or new customers."
msgstr ""

#: src/API/Reports/Orders/Controller.php:426
#: src/API/Reports/Orders/Stats/Controller.php:521
msgid "Limit result set to specific types of refunds."
msgstr ""

#: src/API/Reports/Orders/Controller.php:464
#: src/API/Reports/Orders/Stats/Controller.php:534
#: src/API/Reports/Variations/Stats/Controller.php:454
msgid ""
"Limit result set to orders that include products with the specified "
"attributes."
msgstr ""

#: src/API/Reports/Orders/Controller.php:473
#: src/API/Reports/Orders/Stats/Controller.php:543
#: src/API/Reports/Variations/Stats/Controller.php:463
msgid ""
"Limit result set to orders that don't include products with the specified "
"attributes."
msgstr ""

#: src/API/Reports/Orders/Controller.php:507
#. translators: 1: numeric product quantity, 2: name of product
msgid "%1$s× %2$s"
msgstr ""

#: src/API/Reports/Orders/Controller.php:535
msgid "N. Revenue (formatted)"
msgstr ""

#: src/API/Reports/Orders/Controller.php:537
#: client/analytics/report/orders/table.js:55
msgid "Customer"
msgstr ""

#: src/API/Reports/Orders/Controller.php:538
#: client/analytics/report/orders/config.js:249
#: client/analytics/report/orders/table.js:61
msgid "Customer type"
msgstr ""

#: src/API/Reports/Orders/Controller.php:539
#: client/analytics/report/orders/table.js:67
msgid "Product(s)"
msgstr ""

#: src/API/Reports/Orders/Controller.php:541
#: client/analytics/report/orders/table.js:81
msgid "Coupon(s)"
msgstr ""

#: src/API/Reports/Orders/Controller.php:542
#: src/API/Reports/Products/Controller.php:391
#: src/API/Reports/Variations/Controller.php:415
msgid "N. Revenue"
msgstr ""

#: src/API/Reports/Orders/Stats/Controller.php:163
#: src/API/Reports/Products/Stats/Controller.php:167
#: src/API/Reports/Revenue/Stats/Controller.php:175
#: src/API/Reports/Variations/Stats/Controller.php:164
msgid "Net sales."
msgstr ""

#: src/API/Reports/Orders/Stats/Controller.php:171
msgid "Number of orders"
msgstr ""

#: src/API/Reports/Orders/Stats/Controller.php:178
msgid "Average order value."
msgstr ""

#: src/API/Reports/Orders/Stats/Controller.php:186
#: client/analytics/report/orders/config.js:43
msgid "Average items per order"
msgstr ""

#: src/API/Reports/Orders/Stats/Controller.php:192
msgid "Number of items sold"
msgstr ""

#: src/API/Reports/Orders/Stats/Controller.php:198
#: src/API/Reports/Revenue/Stats/Controller.php:183
msgid "Amount discounted by coupons."
msgstr ""

#: src/API/Reports/Orders/Stats/Controller.php:204
#: src/API/Reports/Revenue/Stats/Controller.php:189
msgid "Unique coupons count."
msgstr ""

#: src/API/Reports/Orders/Stats/Controller.php:210
msgid "Total distinct customers."
msgstr ""

#: src/API/Reports/Orders/Stats/Controller.php:216
msgid "Number of distinct products sold."
msgstr ""

#: src/API/Reports/Orders/Stats/Controller.php:503
msgid "Alias for customer_type (deprecated)."
msgstr ""

#: src/API/Reports/Orders/Stats/Controller.php:512
msgid "Limit result set to orders that have the specified customer_type"
msgstr ""

#: src/API/Reports/PerformanceIndicators/Controller.php:143
msgid "Sorry, fetching performance indicators failed."
msgstr ""

#: src/API/Reports/PerformanceIndicators/Controller.php:224
msgid "Visitors"
msgstr ""

#: src/API/Reports/PerformanceIndicators/Controller.php:230
msgid "Views"
msgstr ""

#: src/API/Reports/PerformanceIndicators/Controller.php:405
msgid "A list of stats to query must be provided."
msgstr ""

#: src/API/Reports/PerformanceIndicators/Controller.php:594
#: src/API/Reports/Stock/Controller.php:384
msgid "Unique identifier for the resource."
msgstr ""

#: src/API/Reports/PerformanceIndicators/Controller.php:601
msgid "The specific chart this stat referrers to."
msgstr ""

#: src/API/Reports/PerformanceIndicators/Controller.php:607
msgid "Human readable label for the stat."
msgstr ""

#: src/API/Reports/PerformanceIndicators/Controller.php:613
msgid "Format of the stat."
msgstr ""

#: src/API/Reports/PerformanceIndicators/Controller.php:620
msgid ""
"Value of the stat. Returns null if the stat does not exist or cannot be "
"loaded."
msgstr ""

#: src/API/Reports/PerformanceIndicators/Controller.php:651
msgid "There was an issue loading the report endpoints"
msgstr ""

#: src/API/Reports/PerformanceIndicators/Controller.php:661
#. translators: Allowed values is a list of stat endpoints.
msgid "Limit response to specific report stats. Allowed values: %s."
msgstr ""

#: src/API/Reports/Products/Controller.php:176
#: src/API/Reports/Variations/Controller.php:186
msgid "Total Net sales of all items sold."
msgstr ""

#: src/API/Reports/Products/Controller.php:182
#: src/API/Reports/Variations/Controller.php:192
msgid "Number of orders product appeared in."
msgstr ""

#: src/API/Reports/Products/Controller.php:189
#: src/API/Reports/Stock/Controller.php:396
#: src/API/Reports/Variations/Controller.php:199
msgid "Product name."
msgstr ""

#: src/API/Reports/Products/Controller.php:195
#: src/API/Reports/Variations/Controller.php:205
msgid "Product price."
msgstr ""

#: src/API/Reports/Products/Controller.php:201
#: src/API/Reports/Variations/Controller.php:211
msgid "Product image."
msgstr ""

#: src/API/Reports/Products/Controller.php:207
#: src/API/Reports/Variations/Controller.php:217
msgid "Product link."
msgstr ""

#: src/API/Reports/Products/Controller.php:213
msgid "Product category IDs."
msgstr ""

#: src/API/Reports/Products/Controller.php:219
#: src/API/Reports/Variations/Controller.php:229
msgid "Product inventory status."
msgstr ""

#: src/API/Reports/Products/Controller.php:225
#: src/API/Reports/Variations/Controller.php:235
msgid "Product inventory quantity."
msgstr ""

#: src/API/Reports/Products/Controller.php:231
#: src/API/Reports/Variations/Controller.php:241
msgid "Product inventory threshold for low stock."
msgstr ""

#: src/API/Reports/Products/Controller.php:237
msgid "Product variations IDs."
msgstr ""

#: src/API/Reports/Products/Controller.php:243
msgid "Product SKU."
msgstr ""

#: src/API/Reports/Products/Controller.php:312
#: src/API/Reports/Products/Stats/Controller.php:381
#: src/API/Reports/Variations/Stats/Controller.php:388
msgid "Limit result to items from the specified categories."
msgstr ""

#: src/API/Reports/Products/Controller.php:331
#: src/API/Reports/Products/Stats/Controller.php:390
msgid "Limit result to items with specified product ids."
msgstr ""

#: src/API/Reports/Products/Controller.php:341
msgid "Add additional piece of info about each product to the report."
msgstr ""

#: src/API/Reports/Products/Controller.php:389
#: src/API/Reports/Stock/Controller.php:539
#: src/API/Reports/Variations/Controller.php:413
#: client/analytics/report/products/table.js:47
#: client/analytics/report/stock/table.js:40
#: client/analytics/report/variations/table.js:44
msgid "SKU"
msgstr ""

#: src/API/Reports/Products/Controller.php:394 src/Features/Analytics.php:238
#: src/ReportCSVEmail.php:41
#: client/analytics/report/get-reports.js:70
#: client/analytics/report/orders/config.js:162
#: client/analytics/report/products/table.js:79
#: client/analytics/report/variations/table.js:277
msgid "Variations"
msgstr ""

#: src/API/Reports/Products/Controller.php:399
#: src/API/Reports/Stock/Controller.php:541
#: src/API/Reports/Variations/Controller.php:421 src/Features/Analytics.php:288
#: src/ReportCSVEmail.php:39
#: client/analytics/report/get-reports.js:111
#: client/analytics/report/products/table.js:91
#: client/analytics/report/stock/table.js:198
#: client/analytics/report/variations/table.js:79
#: client/homescreen/activity-panel/panels.js:56
msgid "Stock"
msgstr ""

#: src/API/Reports/Products/DataStore.php:227
#. translators: %s is product name
msgid "%s (Deleted)"
msgstr ""

#: src/API/Reports/Products/Stats/Controller.php:159
msgid "Products sold"
msgstr ""

#: src/API/Reports/Products/Stats/Controller.php:160
msgid "Number of product items sold."
msgstr ""

#: src/API/Reports/Products/Stats/Controller.php:197
#: src/API/Reports/Variations/Stats/Controller.php:194
msgid "Human readable segment label, either product or variation name."
msgstr ""

#: src/API/Reports/Products/Stats/Controller.php:399
#: src/API/Reports/Variations/Controller.php:338
#: src/API/Reports/Variations/Stats/Controller.php:426
msgid "Limit result to items with specified variation ids."
msgstr ""

#: src/API/Reports/Query.php:22
#. translators: %s: Method name
msgid "Method '%s' not implemented. Must be overridden in subclass."
msgstr ""

#: src/API/Reports/Revenue/Stats/Controller.php:196
#: src/API/Reports/Revenue/Stats/Controller.php:455
#: client/analytics/report/revenue/config.js:55
#: client/analytics/report/revenue/table.js:255
#: client/dashboard/dashboard-charts/config.js:85
#: client/store-management-links/index.js:102
msgid "Shipping"
msgstr ""

#: src/API/Reports/Revenue/Stats/Controller.php:197
msgid "Total of shipping."
msgstr ""

#: src/API/Reports/Revenue/Stats/Controller.php:205
msgid "Total of taxes."
msgstr ""

#: src/API/Reports/Revenue/Stats/Controller.php:212
#: src/API/Reports/Revenue/Stats/Controller.php:452
#: client/analytics/report/revenue/config.js:24
#: client/analytics/report/revenue/table.js:239
#: client/dashboard/dashboard-charts/config.js:55
msgid "Returns"
msgstr ""

#: src/API/Reports/Revenue/Stats/Controller.php:213
msgid "Total of returns."
msgstr ""

#: src/API/Reports/Revenue/Stats/Controller.php:227
msgid "Items sold."
msgstr ""

#: src/API/Reports/Revenue/Stats/Controller.php:233
msgid "Products sold."
msgstr ""

#: src/API/Reports/Revenue/Stats/Controller.php:239
msgid "Gross sales."
msgstr ""

#: src/API/Reports/Revenue/Stats/Controller.php:450
#: client/analytics/report/revenue/config.js:16
#: client/analytics/report/revenue/table.js:235
msgid "Gross sales"
msgstr ""

#: src/API/Reports/Revenue/Stats/Controller.php:451
#: client/analytics/report/revenue/config.js:62
#: client/analytics/report/revenue/table.js:259
#: client/dashboard/dashboard-charts/config.js:30
msgid "Total sales"
msgstr ""

#: src/API/Reports/Revenue/Stats/Controller.php:454
#: src/Features/Analytics.php:268 src/ReportCSVEmail.php:40
#: client/analytics/report/get-reports.js:102
#: client/analytics/report/revenue/config.js:47
#: client/analytics/report/revenue/table.js:251
#: client/analytics/report/taxes/table.js:203
msgid "Taxes"
msgstr ""

#: src/API/Reports/Stock/Controller.php:402
msgid "Unique identifier."
msgstr ""

#: src/API/Reports/Stock/Controller.php:408
msgid "Stock status."
msgstr ""

#: src/API/Reports/Stock/Controller.php:415
msgid "Stock quantity."
msgstr ""

#: src/API/Reports/Stock/Controller.php:421
msgid "Manage stock."
msgstr ""

#: src/API/Reports/Stock/Controller.php:458
msgid "Ensure result set excludes specific IDs."
msgstr ""

#: src/API/Reports/Stock/Controller.php:467
msgid "Limit result set to specific ids."
msgstr ""

#: src/API/Reports/Stock/Controller.php:476
msgid "Offset the result set by a specific number of items."
msgstr ""

#: src/API/Reports/Stock/Controller.php:504
msgid "Limit result set to those of particular parent IDs."
msgstr ""

#: src/API/Reports/Stock/Controller.php:513
msgid "Limit result set to all items except those of a particular parent ID."
msgstr ""

#: src/API/Reports/Stock/Controller.php:522
msgid "Limit result set to items assigned a stock report type."
msgstr ""

#: src/API/Reports/Stock/Controller.php:538
#: client/analytics/report/stock/table.js:33
msgid "Product / Variation"
msgstr ""

#: src/API/Reports/Stock/Stats/Controller.php:85
msgid "Number of products."
msgstr ""

#: src/API/Reports/Stock/Stats/Controller.php:91
msgid "Number of low stock products."
msgstr ""

#: src/API/Reports/Stock/Stats/Controller.php:102
#. translators: Stock status. Example: "Number of low stock products
msgid "Number of %s products."
msgstr ""

#: src/API/Reports/Taxes/Controller.php:157
msgid "Tax rate ID."
msgstr ""

#: src/API/Reports/Taxes/Controller.php:163
msgid "Tax rate name."
msgstr ""

#: src/API/Reports/Taxes/Controller.php:169
msgid "Tax rate."
msgstr ""

#: src/API/Reports/Taxes/Controller.php:181
msgid "State."
msgstr ""

#: src/API/Reports/Taxes/Controller.php:187
msgid "Priority."
msgstr ""

#: src/API/Reports/Taxes/Controller.php:193
#: src/API/Reports/Taxes/Stats/Controller.php:167
msgid "Total tax."
msgstr ""

#: src/API/Reports/Taxes/Controller.php:199
#: src/API/Reports/Taxes/Stats/Controller.php:175
msgid "Order tax."
msgstr ""

#: src/API/Reports/Taxes/Controller.php:205
#: src/API/Reports/Taxes/Stats/Controller.php:183
msgid "Shipping tax."
msgstr ""

#: src/API/Reports/Taxes/Controller.php:283
msgid "Limit result set to items assigned one or more tax rates."
msgstr ""

#: src/API/Reports/Taxes/Controller.php:302
#: client/analytics/report/taxes/table.js:30
msgid "Tax code"
msgstr ""

#: src/API/Reports/Taxes/Controller.php:303
#: client/analytics/report/taxes/table.js:37
msgid "Rate"
msgstr ""

#: src/API/Reports/Taxes/Controller.php:304
#: client/analytics/report/taxes/config.js:26
#: client/analytics/report/taxes/table.js:43
#: client/dashboard/dashboard-charts/config.js:70
msgid "Total tax"
msgstr ""

#: src/API/Reports/Taxes/Controller.php:305
#: client/analytics/report/taxes/config.js:33
#: client/analytics/report/taxes/table.js:48
#: client/dashboard/dashboard-charts/config.js:75
msgid "Order tax"
msgstr ""

#: src/API/Reports/Taxes/Controller.php:306
#: client/analytics/report/taxes/config.js:40
#: client/analytics/report/taxes/table.js:53
#: client/dashboard/dashboard-charts/config.js:80
msgid "Shipping tax"
msgstr ""

#: src/API/Reports/Taxes/Stats/Controller.php:197
msgid "Amount of tax codes."
msgstr ""

#: src/API/Reports/Taxes/Stats/Controller.php:372
msgid ""
"Limit result set to all items that have the specified term assigned in the "
"taxes taxonomy."
msgstr ""

#: src/API/Reports/Taxes/Stats/DataStore.php:223
msgid "Sorry, fetching tax data failed."
msgstr ""

#: src/API/Reports/TimeInterval.php:585 src/API/Reports/TimeInterval.php:617
#. translators: 1: parameter name
msgid "%1$s is not a numerically indexed array."
msgstr ""

#: src/API/Reports/TimeInterval.php:597
#. translators: %s: parameter name
msgid "%s must contain 2 numbers."
msgstr ""

#: src/API/Reports/TimeInterval.php:629
#. translators: %s: parameter name
msgid "%s must contain 2 valid dates."
msgstr ""

#: src/API/Reports/Variations/Controller.php:223
msgid "Product attributes."
msgstr ""

#: src/API/Reports/Variations/Controller.php:318
#: src/API/Reports/Variations/Stats/Controller.php:406
msgid "Limit result set to items that have the specified parent product(s)."
msgstr ""

#: src/API/Reports/Variations/Controller.php:328
#: src/API/Reports/Variations/Stats/Controller.php:416
msgid "Limit result set to items that don't have the specified parent product(s)."
msgstr ""

#: src/API/Reports/Variations/Controller.php:347
msgid "Add additional piece of info about each variation to the report."
msgstr ""

#: src/API/Reports/Variations/Controller.php:354
msgid "Limit result set to variations that include the specified attributes."
msgstr ""

#: src/API/Reports/Variations/Controller.php:363
msgid "Limit result set to variations that don't include the specified attributes."
msgstr ""

#: src/API/Reports/Variations/Controller.php:372
msgid "Limit result set to variations in the specified categories."
msgstr ""

#: src/API/Reports/Variations/Controller.php:381
#: src/API/Reports/Variations/Stats/Controller.php:397
msgid "Limit result set to variations not in the specified categories."
msgstr ""

#: src/API/Reports/Variations/Controller.php:412
#: client/analytics/report/variations/table.js:38
msgid "Product / Variation title"
msgstr ""

#: src/API/Reports/Variations/Stats/Controller.php:156
msgid "Variations Sold"
msgstr ""

#: src/API/Reports/Variations/Stats/Controller.php:157
msgid "Number of variation items sold."
msgstr ""

#: src/API/Taxes.php:34
msgid "Search by similar tax code."
msgstr ""

#: src/API/Taxes.php:39
msgid "Limit result set to items that have the specified rate ID(s) assigned."
msgstr ""

#: src/API/Themes.php:62
msgid "Sorry, you are not allowed to install themes on this site."
msgstr ""

#: src/API/Themes.php:77
msgid "Specified file failed upload test."
msgstr ""

#: src/API/Themes.php:165
msgid "Theme installation status."
msgstr ""

#: src/API/Themes.php:171
msgid "Theme installation message."
msgstr ""

#: src/API/Themes.php:177
msgid "Uploaded theme."
msgstr ""

#: src/API/Themes.php:196
msgid "A zip file of the theme to be uploaded."
msgstr ""

#: src/FeaturePlugin.php:229
#. translators: 1: URL of WooCommerce plugin, 2: The minimum WooCommerce
#. version number
msgid ""
"The WooCommerce Admin feature plugin requires <a "
"href=\"%1$s\">WooCommerce</a> %2$s or greater to be installed and active."
msgstr ""

#: src/FeaturePlugin.php:238
#. translators: 1: URL of WordPress.org, 2: The minimum WordPress version
#. number
msgid ""
"The WooCommerce Admin feature plugin requires <a "
"href=\"%1$s\">WordPress</a> %2$s or greater to be installed and active."
msgstr ""

#: src/Features/Analytics.php:67
msgid "Enables WooCommerce Analytics"
msgstr ""

#: src/Features/Analytics.php:73 src/Features/Analytics.php:188
#: src/Features/Analytics.php:308 src/Features/Navigation/CoreMenu.php:96
#: client/layout/controller.js:136
#: client/layout/navigation.js:46
msgid "Analytics"
msgstr ""

#: src/Features/Analytics.php:156
msgid "Clear analytics cache"
msgstr ""

#: src/Features/Analytics.php:157
msgid "Clear"
msgstr ""

#: src/Features/Analytics.php:160
#. translators: 1: opening link tag, 2: closing tag
msgid ""
"This tool will reset the cached values used in WooCommerce Analytics. If "
"numbers still look off, try %1$sReimporting Historical Data%2$s."
msgstr ""

#: src/Features/Analytics.php:198 src/Features/Marketing.php:137
#: client/layout/controller.js:153
msgid "Overview"
msgstr ""

#: src/Features/Analytics.php:218 src/ReportCSVEmail.php:38
#: client/analytics/report/get-reports.js:54
#: client/analytics/report/revenue/table.js:277
msgid "Revenue"
msgstr ""

#: src/Features/Analytics.php:248 src/ReportCSVEmail.php:32
#: client/analytics/report/categories/table.js:211
#: client/analytics/report/get-reports.js:86
#: client/analytics/report/variations/config.js:175
msgid "Categories"
msgstr ""

#: src/Features/Analytics.php:298 src/Features/Navigation/CoreMenu.php:201
#: src/ReportCSVEmail.php:34
#: client/analytics/report/customers/table.js:290
#: client/analytics/report/get-reports.js:120
#: client/layout/controller.js:114
msgid "Customers"
msgstr ""

#: src/Features/Analytics.php:323
msgid "Analytics cache cleared."
msgstr ""

#: src/Features/CustomerEffortScoreTracks.php:104
#: client/customer-effort-score-tracks/customer-effort-score-tracks.js:38
msgid "Thank you for your feedback!"
msgstr ""

#: src/Features/CustomerEffortScoreTracks.php:246
#: client/customer-effort-score-tracks/data/actions.js:73
msgid "How easy was it to use search?"
msgstr ""

#: src/Features/CustomerEffortScoreTracks.php:306
msgid "How easy was it to add product category?"
msgstr ""

#: src/Features/CustomerEffortScoreTracks.php:322
msgid "How easy was it to add a product tag?"
msgstr ""

#: src/Features/CustomerEffortScoreTracks.php:343
msgid "How easy was it to import products?"
msgstr ""

#: src/Features/CustomerEffortScoreTracks.php:378
msgid "How easy was it to update your settings?"
msgstr ""

#: src/Features/CustomerEffortScoreTracks.php:401
msgid "How easy was it to add a product attribute?"
msgstr ""

#: src/Features/Features.php:261 src/Features/Features.php:298
msgid "Features"
msgstr ""

#: src/Features/Features.php:288
msgid ""
"Start using new features that are being progressively rolled out to improve "
"the store management experience."
msgstr ""

#: src/Features/Features.php:289
msgid "WooCommerce features have been disabled."
msgstr ""

#: src/Features/Homescreen.php:95 src/Features/Navigation/CoreMenu.php:190
#: client/layout/controller.js:65
msgid "Home"
msgstr ""

#: src/Features/Marketing.php:75 src/Features/Marketing.php:76
#: src/Features/Navigation/CoreMenu.php:108
#: client/layout/controller.js:152
#: client/store-management-links/index.js:34
msgid "Marketing"
msgstr ""

#: src/Features/Navigation/CoreMenu.php:250 src/Notes/OrderMilestones.php:245
msgid "Browse"
msgstr ""

#: src/Features/Navigation/CoreMenu.php:277
msgid "Utilities"
msgstr ""

#: src/Features/Navigation/CoreMenu.php:286
msgid "Import / Export"
msgstr ""

#: src/Features/Navigation/Favorites.php:57
#: src/Features/Navigation/Favorites.php:90
#: src/Features/Navigation/Favorites.php:122
msgid "Sorry, invalid request"
msgstr ""

#: src/Features/Navigation/Favorites.php:66
msgid "Favorite already exists"
msgstr ""

#: src/Features/Navigation/Favorites.php:99
msgid "Favorite item not found"
msgstr ""

#: src/Features/Navigation/Init.php:48
msgid "Adds the new WooCommerce navigation experience to the dashboard"
msgstr ""

#: src/Features/Navigation/Init.php:57
#. translators: 1: line break tag, 2: open link to WordPress update link, 3:
#. close link tag.
msgid "%1$s %2$sUpdate WordPress to enable the new navigation%3$s"
msgstr ""

#: src/Features/Navigation/Init.php:65
msgid "Navigation"
msgstr ""

#: src/Features/Navigation/Menu.php:189
#: client/header/index.js:31
msgid "WooCommerce Home"
msgstr ""

#: src/Features/Navigation/Menu.php:229
#. translators: 1: Duplicate menu item path.
msgid ""
"You have attempted to register a duplicate item with WooCommerce "
"Navigation: %1$s"
msgstr ""

#: src/Features/Navigation/Menu.php:374
#. translators: 1: Duplicate menu item path.
msgid ""
"The item ID %1$s attempted to register using an invalid option. The "
"arguments `menuId` and `parent` are not allowed for add_setting_item()"
msgstr ""

#: src/Features/Onboarding.php:387
msgid "Fashion, apparel, and accessories"
msgstr ""

#: src/Features/Onboarding.php:392
msgid "Health and beauty"
msgstr ""

#: src/Features/Onboarding.php:397
msgid "Electronics and computers"
msgstr ""

#: src/Features/Onboarding.php:402
msgid "Food and drink"
msgstr ""

#: src/Features/Onboarding.php:407
msgid "Home, furniture, and garden"
msgstr ""

#: src/Features/Onboarding.php:412
msgid "CBD and other hemp-derived products"
msgstr ""

#: src/Features/Onboarding.php:417
msgid "Education and learning"
msgstr ""

#: src/Features/Onboarding.php:422
#: client/profile-wizard/steps/business-details/data/platform-options.js:41
msgid "Other"
msgstr ""

#: src/Features/Onboarding.php:424
msgid "Description"
msgstr ""

#: src/Features/Onboarding.php:438
msgid "Physical products"
msgstr ""

#: src/Features/Onboarding.php:445
msgid "Subscriptions"
msgstr ""

#: src/Features/Onboarding.php:448
msgid "Memberships"
msgstr ""

#: src/Features/Onboarding.php:452
msgid "Bookings"
msgstr ""

#: src/Features/Onboarding.php:456
msgid "Bundles"
msgstr ""

#: src/Features/Onboarding.php:460
msgid "Customizable products"
msgstr ""

#: src/Features/Onboarding.php:633
#. translators: site currency symbol (used to show that the product costs
#. money)
msgid " — %s"
msgstr ""

#: src/Features/Onboarding.php:794 src/Features/Onboarding.php:806
msgid "Setup wizard"
msgstr ""

#: src/Features/Onboarding.php:802
msgid "WooCommerce Onboarding"
msgstr ""

#: src/Features/Onboarding.php:804
msgid "Profile Setup Wizard"
msgstr ""

#: src/Features/Onboarding.php:805
msgid ""
"If you need to access the setup wizard again, please click on the button "
"below."
msgstr ""

#: src/Features/Onboarding.php:808
msgid "Task List"
msgstr ""

#: src/Features/Onboarding.php:809
msgid ""
"If you need to enable or disable the task lists, please click on the button "
"below."
msgstr ""

#: src/Features/Onboarding.php:811 src/Features/Onboarding.php:820
#: client/task-list/tasks/PaymentGatewaySuggestions/components/Action.js:87
msgid "Enable"
msgstr ""

#: src/Features/Onboarding.php:812 src/Features/Onboarding.php:821
msgid "Disable"
msgstr ""

#: src/Features/Onboarding.php:817
msgid "Extended task List"
msgstr ""

#: src/Features/Onboarding.php:818
msgid ""
"If you need to enable or disable the extended task lists, please click on "
"the button below."
msgstr ""

#: src/Features/OnboardingTasks/Task.php:124
#: src/Features/OnboardingTasks/Tasks/Appearance.php:22
#: src/Features/OnboardingTasks/Tasks/Shipping.php:27
#: src/Features/OnboardingTasks/Tasks/StoreDetails.php:26
#: src/Features/OnboardingTasks/Tasks/Tax.php:32
#: client/homescreen/welcome-from-calypso-modal/welcome-from-calypso-modal.js:73
#: client/homescreen/welcome-modal/index.js:83
#: client/task-list/tasks.js:382
msgid "Let's go"
msgstr ""

#: src/Features/OnboardingTasks/TaskLists.php:62
#: client/task-list/index.js:312
msgid "Get ready to start selling"
msgstr ""

#: src/Features/OnboardingTasks/TaskLists.php:69
#: client/header/activity-panel/panels/inbox/abbreviated-notifications-panel.js:75
#: client/task-list/index.js:243
msgid "Things to do next"
msgstr ""

#: src/Features/OnboardingTasks/TaskLists.php:84
msgid "Task list ID already exists"
msgstr ""

#: src/Features/OnboardingTasks/TaskLists.php:102
msgid "Task list ID does not exist"
msgstr ""

#: src/Features/OnboardingTasks/Tasks/Appearance.php:17
#: client/store-management-links/index.js:52
#: client/task-list/tasks.js:376
msgid "Personalize my store"
msgstr ""

#: src/Features/OnboardingTasks/Tasks/Appearance.php:18
#: client/task-list/tasks.js:377
msgid "Add your logo, create a homepage, and start designing your store."
msgstr ""

#: src/Features/OnboardingTasks/Tasks/Appearance.php:25
#: src/Features/OnboardingTasks/Tasks/Payments.php:32
#: src/Features/OnboardingTasks/Tasks/Purchase.php:49
#: src/Features/OnboardingTasks/Tasks/WooCommercePayments.php:31
#: client/task-list/tasks.js:389
msgid "2 minutes"
msgstr ""

#: src/Features/OnboardingTasks/Tasks/Marketing.php:20
#: client/header/index.js:73
#: client/task-list/tasks.js:348
msgid "Set up marketing tools"
msgstr ""

#: src/Features/OnboardingTasks/Tasks/Marketing.php:21
#: client/task-list/tasks.js:349
msgid ""
"Add recommended marketing tools to reach new customers and grow your "
"business"
msgstr ""

#: src/Features/OnboardingTasks/Tasks/Marketing.php:27
#: src/Features/OnboardingTasks/Tasks/Shipping.php:30
#: src/Features/OnboardingTasks/Tasks/Tax.php:37
#: client/task-list/tasks.js:371
msgid "1 minute"
msgstr ""

#: src/Features/OnboardingTasks/Tasks/Payments.php:20
#: src/Notes/SetUpAdditionalPaymentTypes.php:94
#: client/header/index.js:70
#: client/task-list/tasks.js:277
msgid "Set up payments"
msgstr ""

#: src/Features/OnboardingTasks/Tasks/Payments.php:21
#: client/task-list/tasks.js:278
msgid "Choose payment providers and enable payment methods at checkout."
msgstr ""

#: src/Features/OnboardingTasks/Tasks/Products.php:17
#: client/task-list/tasks.js:211
msgid "Add my products"
msgstr ""

#: src/Features/OnboardingTasks/Tasks/Products.php:18
#: client/task-list/tasks.js:212
msgid ""
"Start by adding the first product to your store. You can add your products "
"manually, via CSV, or import them from another service."
msgstr ""

#: src/Features/OnboardingTasks/Tasks/Products.php:24
#: client/task-list/tasks.js:223
msgid "1 minute per product"
msgstr ""

#: src/Features/OnboardingTasks/Tasks/Purchase.php:25
#. translators: %1$s: list of product names comma separated, %2%s the last
#. product name
#: client/task-list/tasks.js:113
msgid "Add %s to my store"
msgstr ""

#: src/Features/OnboardingTasks/Tasks/Purchase.php:31
#: client/task-list/tasks.js:105
msgid "Add paid extensions to my store"
msgstr ""

#: src/Features/OnboardingTasks/Tasks/Purchase.php:39
#. translators: %1$s: list of product names comma separated, %2%s the last
#. product name
#: client/task-list/tasks.js:130
msgid "Good choice! You chose to add %1$s and %2$s to your store."
msgstr ""

#: src/Features/OnboardingTasks/Tasks/Purchase.php:46
#: client/task-list/tasks.js:198
msgid "Purchase & install now"
msgstr ""

#: src/Features/OnboardingTasks/Tasks/Shipping.php:19
#: client/task-list/tasks.js:320
msgid "Set up shipping"
msgstr ""

#: src/Features/OnboardingTasks/Tasks/Shipping.php:20
#: client/task-list/tasks.js:321
msgid "Set your store location and where you'll ship to."
msgstr ""

#: src/Features/OnboardingTasks/Tasks/StoreDetails.php:21
#: client/store-management-links/index.js:75
#: client/task-list/tasks.js:177
msgid "Store details"
msgstr ""

#: src/Features/OnboardingTasks/Tasks/StoreDetails.php:22
#: client/task-list/tasks.js:178
msgid ""
"Your store address is required to set the origin country for shipping, "
"currencies, and payment options."
msgstr ""

#: src/Features/OnboardingTasks/Tasks/StoreDetails.php:30
#: client/task-list/tasks.js:190
msgid "4 minutes"
msgstr ""

#: src/Features/OnboardingTasks/Tasks/Tax.php:20
#: client/task-list/tasks.js:298
msgid "Set up tax"
msgstr ""

#: src/Features/OnboardingTasks/Tasks/Tax.php:22
#: client/task-list/tasks.js:159
msgid ""
"Good news! WooCommerce Services and Jetpack can automate your sales tax "
"calculations for you."
msgstr ""

#: src/Features/OnboardingTasks/Tasks/Tax.php:26
#: client/task-list/tasks.js:152
msgid "Set your store location and configure tax rate settings."
msgstr ""

#: src/Features/OnboardingTasks/Tasks/Tax.php:31
#: client/task-list/tasks.js:158
#: client/task-list/tasks/tax.js:446
msgid "Yes please"
msgstr ""

#: src/Features/OnboardingTasks/Tasks/WooCommercePayments.php:20
#: client/task-list/tasks.js:228
msgid "Get paid with WooCommerce Payments"
msgstr ""

#: src/Features/OnboardingTasks/Tasks/WooCommercePayments.php:21
#: client/task-list/tasks.js:232
msgid ""
"You're only one step away from getting paid. Verify your business details "
"to start managing transactions with WooCommerce Payments."
msgstr ""

#: src/Features/OnboardingTasks/Tasks/WooCommercePayments.php:25
#: client/header/activity-panel/index.js:244
#: client/marketing/overview/installed-extensions/row.js:112
#: client/task-list/tasks.js:236
#: client/task-list/tasks/PaymentGatewaySuggestions/components/Action.js:119
msgid "Finish setup"
msgstr ""

#: src/Features/PaymentGatewaySuggestions/DefaultPaymentGateways.php:26
msgid "PayFast"
msgstr ""

#: src/Features/PaymentGatewaySuggestions/DefaultPaymentGateways.php:27
msgid ""
"The PayFast extension for WooCommerce enables you to accept payments by "
"Credit Card and EFT via one of South Africa’s most popular payment "
"gateways. No setup fees or monthly subscription costs. Selecting this "
"extension will configure your store to use South African rands as the "
"selected currency."
msgstr ""

#: src/Features/PaymentGatewaySuggestions/DefaultPaymentGateways.php:41
msgid " Stripe"
msgstr ""

#: src/Features/PaymentGatewaySuggestions/DefaultPaymentGateways.php:42
msgid ""
"Accept debit and credit cards in 135+ currencies, methods such as Alipay, "
"and one-touch checkout with Apple Pay."
msgstr ""

#: src/Features/PaymentGatewaySuggestions/DefaultPaymentGateways.php:97
msgid "Paystack"
msgstr ""

#: src/Features/PaymentGatewaySuggestions/DefaultPaymentGateways.php:98
msgid ""
"Paystack helps African merchants accept one-time and recurring payments "
"online with a modern, safe, and secure payment gateway."
msgstr ""

#: src/Features/PaymentGatewaySuggestions/DefaultPaymentGateways.php:108
msgid "Klarna Checkout"
msgstr ""

#: src/Features/PaymentGatewaySuggestions/DefaultPaymentGateways.php:109
#: src/Features/PaymentGatewaySuggestions/DefaultPaymentGateways.php:120
msgid ""
"Choose the payment that you want, pay now, pay later or slice it. No credit "
"card numbers, no passwords, no worries."
msgstr ""

#: src/Features/PaymentGatewaySuggestions/DefaultPaymentGateways.php:119
msgid "Klarna Payments"
msgstr ""

#: src/Features/PaymentGatewaySuggestions/DefaultPaymentGateways.php:144
msgid "Mollie"
msgstr ""

#: src/Features/PaymentGatewaySuggestions/DefaultPaymentGateways.php:145
msgid ""
"Effortless payments by Mollie: Offer global and local payment methods, get "
"onboarded in minutes, and supported in your language."
msgstr ""

#: src/Features/PaymentGatewaySuggestions/DefaultPaymentGateways.php:168
msgid "Mercado Pago Checkout Pro & Custom"
msgstr ""

#: src/Features/PaymentGatewaySuggestions/DefaultPaymentGateways.php:169
msgid ""
"Accept credit and debit cards, offline (cash or bank transfer) and "
"logged-in payments with money in Mercado Pago. Safe and secure payments "
"with the leading payment processor in LATAM."
msgstr ""

#: src/Features/PaymentGatewaySuggestions/DefaultPaymentGateways.php:180
msgid "PayPal Payments"
msgstr ""

#: src/Features/PaymentGatewaySuggestions/DefaultPaymentGateways.php:181
msgid ""
"Safe and secure payments using credit cards or your customer's PayPal "
"account."
msgstr ""

#: src/Features/PaymentGatewaySuggestions/DefaultPaymentGateways.php:195
msgid "Cash on delivery"
msgstr ""

#: src/Features/PaymentGatewaySuggestions/DefaultPaymentGateways.php:196
msgid "Take payments in cash upon delivery."
msgstr ""

#: src/Features/PaymentGatewaySuggestions/DefaultPaymentGateways.php:204
msgid "Direct bank transfer"
msgstr ""

#: src/Features/PaymentGatewaySuggestions/DefaultPaymentGateways.php:205
msgid "Take payments via bank transfer."
msgstr ""

#: src/Features/PaymentGatewaySuggestions/DefaultPaymentGateways.php:213
#: packages/data/build-module/plugins/constants.js:20
#: packages/data/src/plugins/constants.ts:46
msgid "WooCommerce Payments"
msgstr ""

#: src/Features/PaymentGatewaySuggestions/DefaultPaymentGateways.php:214
msgid ""
"Manage transactions without leaving your WordPress Dashboard. Only with "
"WooCommerce Payments."
msgstr ""

#: src/Features/PaymentGatewaySuggestions/DefaultPaymentGateways.php:229
#: packages/data/build-module/plugins/constants.js:27
#: packages/data/src/plugins/constants.ts:71
msgid "Razorpay"
msgstr ""

#: src/Features/PaymentGatewaySuggestions/DefaultPaymentGateways.php:230
msgid ""
"The official Razorpay extension for WooCommerce allows you to accept credit "
"cards, debit cards, netbanking, wallet, and UPI payments."
msgstr ""

#: src/Features/PaymentGatewaySuggestions/DefaultPaymentGateways.php:244
msgid "PayU for WooCommerce"
msgstr ""

#: src/Features/PaymentGatewaySuggestions/DefaultPaymentGateways.php:245
msgid ""
"Enable PayU’s exclusive plugin for WooCommerce to start accepting payments "
"in 100+ payment methods available in India including credit cards, debit "
"cards, UPI, & more!"
msgstr ""

#: src/Features/PaymentGatewaySuggestions/DefaultPaymentGateways.php:259
msgid "Eway"
msgstr ""

#: src/Features/PaymentGatewaySuggestions/DefaultPaymentGateways.php:260
msgid ""
"The Eway extension for WooCommerce allows you to take credit card payments "
"directly on your store without redirecting your customers to a third party "
"site to make payment."
msgstr ""

#: src/Features/PaymentGatewaySuggestions/DefaultPaymentGateways.php:270
msgid "Square"
msgstr ""

#: src/Features/PaymentGatewaySuggestions/DefaultPaymentGateways.php:271
msgid ""
"Securely accept credit and debit cards with one low rate, no surprise fees "
"(custom rates available). Sell online and in store and track sales and "
"inventory in one place."
msgstr ""

#: src/Features/PaymentGatewaySuggestions/PaymentGatewaysController.php:134
#. translators: the title of the payment gateway
msgid "%s connected successfully"
msgstr ""

#: src/Features/RemoteFreeExtensions/DefaultFreeExtensions.php:26
msgid "Get the basics"
msgstr ""

#: src/Features/RemoteFreeExtensions/DefaultFreeExtensions.php:32
#. translators: 1: opening product link tag. 2: closing link tag
msgid "Accept credit cards with %1$sWooCommerce Payments%2$s"
msgstr ""

#: src/Features/RemoteFreeExtensions/DefaultFreeExtensions.php:170
#. translators: 1: opening product link tag. 2: closing link tag
msgid "Print shipping labels with %1$sWooCommerce Shipping%2$s"
msgstr ""

#: src/Features/RemoteFreeExtensions/DefaultFreeExtensions.php:237
#. translators: 1: opening product link tag. 2: closing link tag
msgid "Get automated sales tax with %1$sWooCommerce Tax%2$s"
msgstr ""

#: src/Features/RemoteFreeExtensions/DefaultFreeExtensions.php:317
#. translators: 1: opening product link tag. 2: closing link tag
msgid "Enhance speed and security with %1$sJetpack%2$s"
msgstr ""

#: src/Features/RemoteFreeExtensions/DefaultFreeExtensions.php:335
#: src/Features/RemoteFreeExtensions/DefaultFreeExtensions.php:363
#: packages/data/build-module/plugins/constants.js:28
#: packages/data/src/plugins/constants.ts:72
msgid "MailPoet"
msgstr ""

#: src/Features/RemoteFreeExtensions/DefaultFreeExtensions.php:338
#. translators: 1: opening product link tag. 2: closing link tag
msgid "Level up your email marketing with %1$sMailPoet%2$s"
msgstr ""

#: src/Features/RemoteFreeExtensions/DefaultFreeExtensions.php:359
msgid "Reach out to customers"
msgstr ""

#: src/Features/RemoteFreeExtensions/DefaultFreeExtensions.php:364
msgid ""
"Create and send purchase follow-up emails, newsletters, and promotional "
"campaigns straight from your dashboard."
msgstr ""

#: src/Features/RemoteFreeExtensions/DefaultFreeExtensions.php:370
msgid "Mailchimp"
msgstr ""

#: src/Features/RemoteFreeExtensions/DefaultFreeExtensions.php:371
msgid ""
"Send targeted campaigns, recover abandoned carts and much more with "
"Mailchimp."
msgstr ""

#: src/Features/RemoteFreeExtensions/DefaultFreeExtensions.php:377
#: packages/data/build-module/plugins/constants.js:16
#: packages/data/src/plugins/constants.ts:30
msgid "Creative Mail for WooCommerce"
msgstr ""

#: src/Features/RemoteFreeExtensions/DefaultFreeExtensions.php:378
msgid ""
"Create on-brand store campaigns, fast email promotions and customer "
"retargeting with Creative Mail."
msgstr ""

#: src/Features/RemoteFreeExtensions/DefaultFreeExtensions.php:386
msgid "Grow your store"
msgstr ""

#: src/Features/RemoteFreeExtensions/DefaultFreeExtensions.php:390
msgid "Google Listings & Ads"
msgstr ""

#: src/Features/RemoteFreeExtensions/DefaultFreeExtensions.php:391
msgid ""
"Reach more shoppers and drive sales for your store. Integrate with Google "
"to list your products for free and launch paid ad campaigns."
msgstr ""

#: src/Features/Settings.php:90
msgid "Adds the new WooCommerce settings UI."
msgstr ""

#: src/Features/ShippingLabelBanner.php:91
#: client/wp-admin-scripts/print-shipping-label-banner/shipping-banner/index.js:193
msgid "Shipping Label"
msgstr ""

#: src/Loader.php:129
#. translators: %s: is referring to the plugin's name.
msgid "You have the %s plugin activated but it is not being used."
msgstr ""

#: src/Loader.php:322
#: client/layout/controller.js:169
msgid "Setup Wizard"
msgstr ""

#: src/Loader.php:977
#. translators: %1$s: updated title, %2$s: blog info name
msgid "%1$s &lsaquo; %2$s"
msgstr ""

#. Plugin Name of the plugin/theme
msgid "WooCommerce Admin"
msgstr ""

#: src/Loader.php:1150
msgid "Settings for WooCommerce admin reporting."
msgstr ""

#: src/Loader.php:1169
msgid "Excluded report order statuses"
msgstr ""

#: src/Loader.php:1170
msgid "Statuses that should not be included when calculating report totals."
msgstr ""

#: src/Loader.php:1178
msgid "Actionable order statuses"
msgstr ""

#: src/Loader.php:1179
msgid "Statuses that require extra action on behalf of the store admin."
msgstr ""

#: src/Loader.php:1187 src/Loader.php:1188
msgid "Default Date Range"
msgstr ""

#: src/Notes/AddFirstProduct.php:64
#. translators: %s: line break
msgid ""
"Nice one; you've created a WooCommerce store! Now it's time to add your "
"first product and get ready to start selling.%s"
msgstr ""

#: src/Notes/AddFirstProduct.php:65
msgid ""
"There are three ways to add your products: you can <strong>create products "
"manually, import them at once via CSV file</strong>, or <strong>migrate "
"them from another service</strong>.<br/><br/>"
msgstr ""

#: src/Notes/AddFirstProduct.php:67
#. translators: %1$s is an open anchor tag (<a>) and %2$s is a close link tag
#. (</a>).
msgid "%1$1sExplore our docs%2$2s for more information, or just get started!"
msgstr ""

#: src/Notes/AddFirstProduct.php:75
msgid "Add your first product"
msgstr ""

#: src/Notes/AddFirstProduct.php:87
msgid "Add a product"
msgstr ""

#: src/Notes/AddingAndManangingProducts.php:58
#: client/header/activity-panel/panels/help.js:204
msgid "Adding and Managing Products"
msgstr ""

#: src/Notes/AddingAndManangingProducts.php:60
msgid ""
"Learn more about how to set up products in WooCommerce through our useful "
"documentation about adding and managing products."
msgstr ""

#: src/Notes/AddingAndManangingProducts.php:71 src/Notes/ChooseNiche.php:75
#: src/Notes/CustomizeStoreWithBlocks.php:77
#: src/Notes/CustomizingProductCatalog.php:74 src/Notes/DrawAttention.php:68
#: src/Notes/EUVATNumber.php:53 src/Notes/EditProductsOnTheMove.php:62
#: src/Notes/FilterByProductVariationsInReports.php:50
#: src/Notes/FirstDownlaodableProduct.php:62 src/Notes/LaunchChecklist.php:54
#: src/Notes/LearnMoreAboutVariableProducts.php:77
#: src/Notes/ManageOrdersOnTheGo.php:55
#: src/Notes/ManageStoreActivityFromHomeScreen.php:58
#: src/Notes/MigrateFromShopify.php:70 src/Notes/MobileApp.php:47
#: src/Notes/OnboardingPayments.php:58 src/Notes/OnlineClothingStore.php:89
#: src/Notes/OrderMilestones.php:239 src/Notes/PerformanceOnMobile.php:59
#: src/Notes/RealTimeOrderAlerts.php:51 src/Notes/SellingOnlineCourses.php:76
#: src/Notes/StartDropshippingBusiness.php:75
#: src/Notes/UnsecuredReportFiles.php:48
#: src/Notes/WelcomeToWooCommerceForStoreUsers.php:50
#: src/Notes/WooCommercePayments.php:117
#: client/profile-wizard/steps/product-types/label.js:73
#: client/shipping/woocommerce-services-item.tsx:73
#: packages/onboarding/build-module/components/WCPayCard/WCPayCard.js:22
msgid "Learn more"
msgstr ""

#: src/Notes/ChooseNiche.php:67
msgid "Finding an audience for your business"
msgstr ""

#: src/Notes/ChooseNiche.php:68
msgid ""
"There’s nothing quite like entrepreneurship! We put together a blog post "
"series — titled From Idea to First Customer — with all the tips, resources, "
"and tools to inspire a great idea, empower you to execute it, and lead to "
"your very first sale."
msgstr ""

#: src/Notes/ChoosingTheme.php:39
msgid "Choosing a theme?"
msgstr ""

#: src/Notes/ChoosingTheme.php:40
msgid ""
"Check out the themes that are compatible with WooCommerce and choose one "
"aligned with your brand and business needs."
msgstr ""

#: src/Notes/ChoosingTheme.php:47
msgid "Visit the theme marketplace"
msgstr ""

#: src/Notes/CouponPageMoved.php:73
msgid "Coupon management has moved!"
msgstr ""

#: src/Notes/CouponPageMoved.php:74
msgid ""
"Coupons can now be managed from Marketing > Coupons. Click the button below "
"to remove the legacy WooCommerce > Coupons menu item."
msgstr ""

#: src/Notes/CouponPageMoved.php:81
msgid "Remove legacy coupon menu"
msgstr ""

#: src/Notes/CustomizeStoreWithBlocks.php:69
msgid "Customize your online store with WooCommerce blocks"
msgstr ""

#: src/Notes/CustomizeStoreWithBlocks.php:70
msgid ""
"With our blocks, you can select and display products, categories, filters, "
"and more virtually anywhere on your site — no need to use shortcodes or "
"edit lines of code. Learn more about how to use each one of them."
msgstr ""

#: src/Notes/CustomizingProductCatalog.php:66
msgid "How to customize your product catalog"
msgstr ""

#: src/Notes/CustomizingProductCatalog.php:67
msgid ""
"You want your product catalog and images to look great and align with your "
"brand. This guide will give you all the tips you need to get your products "
"looking great in your store."
msgstr ""

#: src/Notes/DataStore.php:126
msgid "Invalid admin note"
msgstr ""

#: src/Notes/DeactivatePlugin.php:40
msgid "Deactivate old WooCommerce Admin version"
msgstr ""

#: src/Notes/DeactivatePlugin.php:41
msgid ""
"Your current version of WooCommerce Admin is outdated and a newer version "
"is included with WooCommerce. We recommend deactivating the plugin and "
"using the stable version included with WooCommerce."
msgstr ""

#: src/Notes/DeactivatePlugin.php:48
msgid "Deactivate"
msgstr ""

#: src/Notes/DrawAttention.php:60
msgid "Get noticed: how to draw attention to your online store"
msgstr ""

#: src/Notes/DrawAttention.php:61
msgid ""
"To get you started, here are seven ways to boost your sales and avoid "
"getting drowned out by similar, mass-produced products competing for the "
"same buyers."
msgstr ""

#: src/Notes/EUVATNumber.php:42
msgid ""
"If your store is based in the EU, we recommend using the EU VAT Number "
"extension in addition to automated taxes. It provides your checkout with a "
"field to collect and validate a customer's EU VAT number, if they have one."
msgstr ""

#: src/Notes/EUVATNumber.php:45
msgid "Collect and validate EU VAT numbers at checkout"
msgstr ""

#: src/Notes/EditProductsOnTheMove.php:54
msgid "Edit products on the move"
msgstr ""

#: src/Notes/EditProductsOnTheMove.php:55
msgid "Edit and create new products from your mobile devices with the Woo app"
msgstr ""

#: src/Notes/FilterByProductVariationsInReports.php:35
msgid "New - filter by product variations in orders and products reports"
msgstr ""

#: src/Notes/FilterByProductVariationsInReports.php:36
msgid ""
"One of the most awaited features has just arrived! You can now have "
"insights into each product variation in the orders and products reports."
msgstr ""

#: src/Notes/FirstDownlaodableProduct.php:49
msgid "Learn more about digital/downloadable products"
msgstr ""

#: src/Notes/FirstDownlaodableProduct.php:51
msgid ""
"Congrats on adding your first digital product! You can learn more about how "
"to handle digital or downloadable products in our documentation."
msgstr ""

#: src/Notes/FirstProduct.php:69
msgid "Do you need help with adding your first product?"
msgstr ""

#: src/Notes/FirstProduct.php:70
msgid ""
"This video tutorial will help you go through the process of adding your "
"first product in WooCommerce."
msgstr ""

#: src/Notes/FirstProduct.php:77
msgid "Watch tutorial"
msgstr ""

#: src/Notes/GettingStartedInEcommerceWebinar.php:68
msgid "Getting Started in eCommerce - webinar"
msgstr ""

#: src/Notes/GettingStartedInEcommerceWebinar.php:69
msgid ""
"We want to make eCommerce and this process of getting started as easy as "
"possible for you. Watch this webinar to get tips on how to have our store "
"up and running in a breeze."
msgstr ""

#: src/Notes/GettingStartedInEcommerceWebinar.php:76
msgid "Watch the webinar"
msgstr ""

#: src/Notes/GivingFeedbackNotes.php:40
msgid "You're invited to share your experience"
msgstr ""

#: src/Notes/GivingFeedbackNotes.php:41
msgid ""
"Now that you’ve chosen us as a partner, our goal is to make sure we're "
"providing the right tools to meet your needs. We're looking forward to "
"having your feedback on the store setup experience so we can improve it in "
"the future."
msgstr ""

#: src/Notes/GivingFeedbackNotes.php:48 src/Notes/NavigationFeedback.php:46
#: src/Notes/NavigationFeedbackFollowUp.php:60
#: client/wp-admin-scripts/navigation-opt-out/container.js:57
msgid "Share feedback"
msgstr ""

#: src/Notes/InsightFirstProductAndPayment.php:40
msgid "Insight"
msgstr ""

#: src/Notes/InsightFirstProductAndPayment.php:41
msgid ""
"More than 80% of new merchants add the first product and have at least one "
"payment method set up during the first week.<br><br>Do you find this type "
"of insight useful?"
msgstr ""

#: src/Notes/InsightFirstProductAndPayment.php:48
#: src/Notes/InsightFirstSale.php:51
msgid "Yes"
msgstr ""

#: src/Notes/InsightFirstProductAndPayment.php:52
#: src/Notes/InsightFirstProductAndPayment.php:61
#: src/Notes/InsightFirstSale.php:55 src/Notes/InsightFirstSale.php:63
msgid "Thanks for your feedback"
msgstr ""

#: src/Notes/InsightFirstProductAndPayment.php:57
#: src/Notes/InsightFirstSale.php:59
#: client/profile-wizard/steps/business-details/data/selling-venue-options.js:9
msgid "No"
msgstr ""

#: src/Notes/InsightFirstSale.php:39
msgid "Did you know?"
msgstr ""

#: src/Notes/InsightFirstSale.php:40
msgid ""
"A WooCommerce powered store needs on average 31 days to get the first sale. "
"You're on the right track! Do you find this type of insight useful?"
msgstr ""

#: src/Notes/InstallJPAndWCSPlugins.php:44
msgid ""
"We noticed that there was a problem during the Jetpack and WooCommerce "
"Shipping & Tax install. Please try again and enjoy all the advantages of "
"having the plugins connected to your store! Sorry for the inconvenience. "
"The \"Jetpack\" and \"WooCommerce Shipping & Tax\" plugins will be "
"installed & activated for free."
msgstr ""

#: src/Notes/InstallJPAndWCSPlugins.php:47
msgid ""
"Uh oh... There was a problem during the Jetpack and WooCommerce Shipping & "
"Tax install. Please try again."
msgstr ""

#: src/Notes/InstallJPAndWCSPlugins.php:55
msgid "Install plugins"
msgstr ""

#: src/Notes/LaunchChecklist.php:45
msgid ""
"To make sure you never get that sinking \"what did I forget\" feeling, "
"we've put together the essential pre-launch checklist."
msgstr ""

#: src/Notes/LaunchChecklist.php:48
msgid "Ready to launch your store?"
msgstr ""

#: src/Notes/LearnMoreAboutVariableProducts.php:64
msgid "Learn more about variable products"
msgstr ""

#: src/Notes/LearnMoreAboutVariableProducts.php:66
msgid ""
"Variable products are a powerful product type that lets you offer a set of "
"variations on a product, with control over prices, stock, image and more "
"for each variation. They can be used for a product like a shirt, where you "
"can offer a large, medium and small and in different colors."
msgstr ""

#: src/Notes/ManageOrdersOnTheGo.php:47
msgid "Manage your orders on the go"
msgstr ""

#: src/Notes/ManageOrdersOnTheGo.php:48
msgid ""
"Look for orders, customer info, and process refunds in one click with the "
"Woo app."
msgstr ""

#: src/Notes/ManageStoreActivityFromHomeScreen.php:51
msgid "New! Manage your store activity from the Home screen"
msgstr ""

#: src/Notes/ManageStoreActivityFromHomeScreen.php:52
msgid ""
"Start your day knowing the next steps you need to take with your orders, "
"products, and customer feedback.<br/><br/>Read more about how to use the "
"activity panels on the Home screen."
msgstr ""

#: src/Notes/Marketing.php:39
msgid "Connect with your audience"
msgstr ""

#: src/Notes/Marketing.php:40
msgid ""
"Grow your customer base and increase your sales with marketing tools built "
"for WooCommerce."
msgstr ""

#: src/Notes/Marketing.php:47
msgid "Open marketing hub"
msgstr ""

#: src/Notes/MarketingJetpack.php:101
msgid "Protect your WooCommerce Store with Jetpack Backup."
msgstr ""

#: src/Notes/MarketingJetpack.php:102
msgid ""
"Store downtime means lost sales. One-click restores get you back online "
"quickly if something goes wrong."
msgstr ""

#: src/Notes/MarketingJetpack.php:109
msgid "Get backups"
msgstr ""

#: src/Notes/MerchantEmailNotifications/NotificationEmail.php:35
msgid "Hi there,"
msgstr ""

#: src/Notes/MerchantEmailNotifications/NotificationEmail.php:209
#. translators: %s = merchant name
msgid "Hi %s,"
msgstr ""

#: src/Notes/MigrateFromShopify.php:62
msgid "Do you want to migrate from Shopify to WooCommerce?"
msgstr ""

#: src/Notes/MigrateFromShopify.php:63
msgid ""
"Changing eCommerce platforms might seem like a big hurdle to overcome, but "
"it is easier than you might think to move your products, customers, and "
"orders to WooCommerce. This article will help you with going through this "
"process."
msgstr ""

#: src/Notes/MobileApp.php:38
msgid ""
"Install the WooCommerce mobile app to manage orders, receive sales "
"notifications, and view key metrics — wherever you are."
msgstr ""

#: src/Notes/MobileApp.php:41
msgid "Install Woo mobile app"
msgstr ""

#: src/Notes/NavigationFeedback.php:37
msgid ""
"We're introducing the new navigation for a more intuitive and improved user "
"experience. We'd like to hear your thoughts and first impressions."
msgstr ""

#: src/Notes/NavigationFeedback.php:40
msgid "You now have access to the new WooCommerce navigation"
msgstr ""

#: src/Notes/NavigationFeedbackFollowUp.php:51
msgid ""
"We recently introduced the new navigation for a more intuitive and improved "
"user experience. Now that you've had some time to give it a try, let us "
"know how this will impact your store."
msgstr ""

#: src/Notes/NavigationFeedbackFollowUp.php:54
msgid "Share your thoughts on the new WooCommerce navigation"
msgstr ""

#: src/Notes/NavigationNudge.php:47
msgid "You now have access to the WooCommerce navigation"
msgstr ""

#: src/Notes/NavigationNudge.php:48
msgid ""
"We’re introducing a new navigation for a more intuitive and improved user "
"experience. You can enable the beta version of the new experience in the "
"Advanced Settings. Enable it now for your store."
msgstr ""

#: src/Notes/NavigationNudge.php:54
msgid "Enable in Settings"
msgstr ""

#: src/Notes/NeedSomeInspiration.php:54
msgid "Browse our success stories"
msgstr ""

#: src/Notes/NeedSomeInspiration.php:55
msgid ""
"Learn more about how other entrepreneurs used WooCommerce to build "
"successful businesses."
msgstr ""

#: src/Notes/NeedSomeInspiration.php:62
msgid "See success stories"
msgstr ""

#: src/Notes/NewSalesRecord.php:101
#. translators: 1 and 4: Date (e.g. October 16th), 2 and 3: Amount (e.g.
#. $160.00)
msgid ""
"Woohoo, %1$s was your record day for sales! Net sales was %2$s beating the "
"previous record of %3$s set on %4$s."
msgstr ""

#: src/Notes/NewSalesRecord.php:122
msgid "New sales record!"
msgstr ""

#: src/Notes/NewSalesRecord.php:128
msgid "View report"
msgstr ""

#: src/Notes/Note.php:346
msgid "The admin note name prop cannot be empty."
msgstr ""

#: src/Notes/Note.php:359
msgid "The admin note type prop cannot be empty."
msgstr ""

#: src/Notes/Note.php:367
#. translators: %s: admin note type.
msgid "The admin note type prop (%s) is not one of the supported types."
msgstr ""

#: src/Notes/Note.php:383
msgid "The admin note locale prop cannot be empty."
msgstr ""

#: src/Notes/Note.php:396
msgid "The admin note title prop cannot be empty."
msgstr ""

#: src/Notes/Note.php:436
msgid "The admin note content prop cannot be empty."
msgstr ""

#: src/Notes/Note.php:453
msgid "The admin note content_data prop must be an instance of stdClass."
msgstr ""

#: src/Notes/Note.php:466
msgid "The admin note status prop cannot be empty."
msgstr ""

#: src/Notes/Note.php:474
#. translators: %s: admin note status property.
msgid "The admin note status prop (%s) is not one of the supported statuses."
msgstr ""

#: src/Notes/Note.php:490
msgid "The admin note source prop cannot be empty."
msgstr ""

#: src/Notes/Note.php:503
msgid "The admin note date prop cannot be empty."
msgstr ""

#: src/Notes/Note.php:554
msgid "The admin note layout has a wrong prop value."
msgstr ""

#: src/Notes/Note.php:602
msgid "The admin note action name prop cannot be empty."
msgstr ""

#: src/Notes/Note.php:606
msgid "The admin note action label prop cannot be empty."
msgstr ""

#: src/Notes/Notes.php:455
msgid ""
"Notes are unavailable because the \"admin-note\" data store cannot be "
"loaded."
msgstr ""

#: src/Notes/OnboardingPayments.php:50
msgid "Start accepting payments on your store!"
msgstr ""

#: src/Notes/OnboardingPayments.php:51
msgid ""
"Take payments with the provider that’s right for you - choose from 100+ "
"payment gateways for WooCommerce."
msgstr ""

#: src/Notes/OnlineClothingStore.php:81
msgid "Start your online clothing store"
msgstr ""

#: src/Notes/OnlineClothingStore.php:82
msgid ""
"Starting a fashion website is exciting but it may seem overwhelming as "
"well. In this article, we'll walk you through the setup process, teach you "
"to create successful product listings, and show you how to market to your "
"ideal audience."
msgstr ""

#: src/Notes/OrderMilestones.php:182
msgid "First order received"
msgstr ""

#: src/Notes/OrderMilestones.php:194
#. translators: Number of orders processed.
msgid "Congratulations on processing %s orders!"
msgstr ""

#: src/Notes/OrderMilestones.php:211
msgid ""
"Congratulations on getting your first order! Now is a great time to learn "
"how to manage your orders."
msgstr ""

#: src/Notes/OrderMilestones.php:213
msgid ""
"You've hit the 10 orders milestone! Look at you go. Browse some WooCommerce "
"success stories for inspiration."
msgstr ""

#: src/Notes/OrderMilestones.php:222
msgid ""
"Another order milestone! Take a look at your Orders Report to review your "
"orders to date."
msgstr ""

#: src/Notes/OrderMilestones.php:258
msgid "Review your orders"
msgstr ""

#: src/Notes/PerformanceOnMobile.php:51
msgid "Track your store performance on mobile"
msgstr ""

#: src/Notes/PerformanceOnMobile.php:52
msgid "Monitor your sales and high performing products with the Woo app."
msgstr ""

#: src/Notes/PersonalizeStore.php:48
msgid ""
"The homepage is one of the most important entry points in your store. When "
"done right it can lead to higher conversions and engagement. Don't forget "
"to personalize the homepage that we created for your store during the "
"onboarding."
msgstr ""

#: src/Notes/PersonalizeStore.php:51
msgid "Personalize your store's homepage"
msgstr ""

#: src/Notes/PersonalizeStore.php:57
msgid "Personalize homepage"
msgstr ""

#: src/Notes/RealTimeOrderAlerts.php:42
msgid ""
"Get notifications about store activity, including new orders and product "
"reviews directly on your mobile devices with the Woo app."
msgstr ""

#: src/Notes/RealTimeOrderAlerts.php:45
msgid "Get real-time order alerts anywhere"
msgstr ""

#: src/Notes/SellingOnlineCourses.php:68
msgid "Do you want to sell online courses?"
msgstr ""

#: src/Notes/SellingOnlineCourses.php:69
msgid ""
"Online courses are a great solution for any business that can teach a new "
"skill. Since courses don’t require physical product development or "
"shipping, they’re affordable, fast to create, and can generate passive "
"income for years to come. In this article, we provide you more information "
"about selling courses using WooCommerce."
msgstr ""

#: src/Notes/SetUpAdditionalPaymentTypes.php:82
msgid ""
"Set up additional payment providers, using third-party services or other "
"methods."
msgstr ""

#: src/Notes/SetUpAdditionalPaymentTypes.php:86
msgid "Set up additional payment providers"
msgstr ""

#: src/Notes/StartDropshippingBusiness.php:67
msgid "Are you considering starting a dropshipping business?"
msgstr ""

#: src/Notes/StartDropshippingBusiness.php:68
msgid ""
"The ability to add inventory without having to deal with production, "
"stocking, or fulfilling orders may seem like a dream. But is dropshipping "
"worth it? Let’s explore some of the advantages and disadvantages to help "
"you make the best decision for your business."
msgstr ""

#: src/Notes/TestCheckout.php:89
msgid ""
"Make sure that your checkout is working properly before you launch your "
"store. Go through your checkout process in its entirety: from adding a "
"product to your cart, choosing a shipping location, and making a payment."
msgstr ""

#: src/Notes/TestCheckout.php:92
msgid "Don't forget to test your checkout"
msgstr ""

#: src/Notes/TestCheckout.php:98
msgid "Test checkout"
msgstr ""

#: src/Notes/TrackingOptIn.php:50
#. translators: 1: open link to WooCommerce.com settings, 2: open link to
#. WooCommerce.com tracking documentation, 3: close link tag.
msgid ""
"Gathering usage data allows us to improve WooCommerce. Your store will be "
"considered as we evaluate new features, judge the quality of an update, or "
"determine if an improvement makes sense. You can always visit the "
"%1$sSettings%3$s and choose to stop sharing data. %2$sRead more%3$s about "
"what data we collect."
msgstr ""

#: src/Notes/TrackingOptIn.php:63
msgid "Help WooCommerce improve with usage tracking"
msgstr ""

#: src/Notes/TrackingOptIn.php:69
msgid "Activate usage tracking"
msgstr ""

#: src/Notes/UnsecuredReportFiles.php:33
msgid "Potentially unsecured files were found in your uploads directory"
msgstr ""

#: src/Notes/UnsecuredReportFiles.php:37
#. translators: 1: opening analytics docs link tag. 2: closing link tag
msgid ""
"Files that may contain %1$sstore analytics%2$s reports were found in your "
"uploads directory - we recommend assessing and deleting any such files."
msgstr ""

#: src/Notes/UnsecuredReportFiles.php:55
#: packages/experimental/build-module/experimental-list/task-item.js:92
#: packages/experimental/build-module/inbox-note/inbox-note.js:83
msgid "Dismiss"
msgstr ""

#: src/Notes/WelcomeToWooCommerceForStoreUsers.php:43
#: client/homescreen/welcome-from-calypso-modal/welcome-from-calypso-modal.js:23
msgid "Welcome to your new store management experience"
msgstr ""

#: src/Notes/WelcomeToWooCommerceForStoreUsers.php:44
msgid ""
"We've designed your navigation and home screen to help you focus on the "
"things that matter most in managing your online store."
msgstr ""

#: src/Notes/WooCommercePayments.php:102
msgid "Try the new way to get paid"
msgstr ""

#: src/Notes/WooCommercePayments.php:104
msgid ""
"Securely accept credit and debit cards on your site. Manage transactions "
"without leaving your WordPress dashboard. Only with <strong>WooCommerce "
"Payments</strong>."
msgstr ""

#: src/Notes/WooCommercePayments.php:108
#. translators: 1: opening link tag, 2: closing tag
msgid "By clicking \"Get started\", you agree to our %1$sTerms of Service%2$s"
msgstr ""

#: src/Notes/WooCommercePayments.php:118
#: client/shipping/woocommerce-services-item.tsx:86
#: client/task-list/tasks/Marketing/Plugin.tsx:93
#: client/task-list/tasks/PaymentGatewaySuggestions/components/WCPay/Suggestion.js:80
msgid "Get started"
msgstr ""

#: src/Notes/WooCommerceSubscriptions.php:45
msgid "Do you need more info about WooCommerce Subscriptions?"
msgstr ""

#: src/Notes/WooCommerceSubscriptions.php:46
msgid ""
"WooCommerce Subscriptions allows you to introduce a variety of "
"subscriptions for physical or virtual products and services. Create "
"product-of-the-month clubs, weekly service subscriptions or even yearly "
"software billing packages. Add sign-up fees, offer free trials, or set "
"expiration periods."
msgstr ""

#: src/Notes/WooCommerceSubscriptions.php:53
msgid "Learn More"
msgstr ""

#: src/Notes/WooSubscriptionsNotes.php:182
msgid "Connect to WooCommerce.com"
msgstr ""

#: src/Notes/WooSubscriptionsNotes.php:183
msgid "Connect to get important product notifications and updates."
msgstr ""

#: src/Notes/WooSubscriptionsNotes.php:190
#: client/dashboard/components/connect/index.js:86
#: client/task-list/tasks/PaymentGatewaySuggestions/components/Setup/Configure.js:136
msgid "Connect"
msgstr ""

#: src/Notes/WooSubscriptionsNotes.php:311
#. translators: name of the extension subscription expiring soon
msgid "%s subscription expiring soon"
msgstr ""

#: src/Notes/WooSubscriptionsNotes.php:317
#. translators: number of days until the subscription expires
msgid ""
"Your subscription expires in %d days. Enable autorenew to avoid losing "
"updates and access to support."
msgstr ""

#: src/Notes/WooSubscriptionsNotes.php:340
msgid "Enable Autorenew"
msgstr ""

#: src/Notes/WooSubscriptionsNotes.php:372
#. translators: name of the extension subscription that expired
msgid "%s subscription expired"
msgstr ""

#: src/Notes/WooSubscriptionsNotes.php:378
#. translators: date the subscription expired, e.g. Jun 7th 2018
msgid ""
"Your subscription expired on %s. Get a new subscription to continue "
"receiving updates and access to support."
msgstr ""

#: src/Notes/WooSubscriptionsNotes.php:403
msgid "Renew Subscription"
msgstr ""

#: src/PageController.php:205
msgid ""
"Current page retrieval should be called on or after the `current_screen` "
"hook."
msgstr ""

#: src/ReportCSVEmail.php:73
msgid "Your Report Download"
msgstr ""

#: src/ReportCSVEmail.php:82
msgid "[{site_title}]: Your {report_name} Report download is ready"
msgstr ""

#: src/ReportsSync.php:49
msgid ""
"Report sync schedulers should be derived from the "
"Automattic\\WooCommerce\\Admin\\Schedulers\\ImportScheduler class."
msgstr ""

#: src/ReportsSync.php:79
msgid ""
"An import is already in progress. Please allow the previous import to "
"complete before beginning a new one."
msgstr ""

#: src/ReportsSync.php:95
msgid ""
"Report table data is being rebuilt. Please allow some time for data to "
"fully populate."
msgstr ""

#: src/ReportsSync.php:179
msgid "Report table data is being deleted."
msgstr ""

#: src/Schedulers/CustomersScheduler.php:230
msgid "[deleted]"
msgstr ""

#: woocommerce-admin.php:38 woocommerce-admin.php:56
#. translators: 1: composer command. 2: plugin directory
msgid ""
"Your installation of the WooCommerce Admin feature plugin is incomplete. "
"Please run %1$s within the %2$s directory."
msgstr ""

#: woocommerce-admin.php:108
#. Translators: %1$s is referring to a php constant name, %2$s is referring to
#. the wp-config.php file.
msgid ""
"WooCommerce Admin development mode requires the %1$s constant to be defined "
"and true in your %2$s file. Otherwise you are loading the admin package "
"from WooCommerce core."
msgstr ""

#: woocommerce-admin.php:127
#. Translators: %1$s, %2$s, and %3$s are all build commands to be run in order.
msgid ""
"You have installed a development version of WooCommerce Admin which "
"requires files to be built. From the plugin directory, run %1$s and %2$s to "
"install dependencies, then %3$s to build the files."
msgstr ""

#: woocommerce-admin.php:134
#. translators: 1: URL of GitHub Repository build page
msgid ""
"Or you can download a pre-built version of the plugin by visiting <a "
"href=\"%1$s\">the releases page in the repository</a>."
msgstr ""

#. Plugin URI of the plugin/theme
msgid "https://github.com/woocommerce/woocommerce-admin"
msgstr ""

#. Description of the plugin/theme
msgid ""
"A new JavaScript-driven interface for managing your store. The plugin "
"includes new and improved reports, and a dashboard to monitor all the "
"important key metrics of your site."
msgstr ""

#. Author URI of the plugin/theme
msgid "https://woocommerce.com/"
msgstr ""

#: client/analytics/components/leaderboard/index.js:81
msgid "No data recorded for the selected time period."
msgstr ""

#: client/analytics/components/report-chart/index.js:168
msgid "No data for the current search"
msgstr ""

#: client/analytics/components/report-chart/index.js:169
msgid "No data for the selected date range"
msgstr ""

#: client/analytics/components/report-error/index.js:16
msgid "There was an error getting your stats. Please try again."
msgstr ""

#: client/analytics/components/report-error/index.js:20
#: client/homescreen/activity-panel/orders/index.js:294
#: client/homescreen/activity-panel/reviews/index.js:331
#: client/homescreen/activity-panel/stock/index.js:95
#: client/inbox-panel/index.js:259
msgid "Reload"
msgstr ""

#: client/analytics/components/report-summary/index.js:106
#: client/dashboard/store-performance/index.js:127
#: client/homescreen/stats-overview/stats-list.js:75
#: packages/components/build-module/summary/number.js:151
msgid "Previous period:"
msgstr ""

#: client/analytics/components/report-summary/index.js:107
#: client/dashboard/store-performance/index.js:128
msgid "Previous year:"
msgstr ""

# %s = type of report
#: client/analytics/components/report-table/index.js:209
msgid "Your %s Report will be emailed to you."
msgstr ""

# %s = type of report
#: client/analytics/components/report-table/index.js:223
msgid "There was a problem exporting your %s Report. Please try again."
msgstr ""

#: client/analytics/components/report-table/index.js:319
msgid "Select All"
msgstr ""

#: client/analytics/components/report-table/index.js:401
msgid "Check at least two items below to compare"
msgstr ""

#: client/analytics/components/report-table/index.js:410
#: client/analytics/report/categories/config.js:107
#: client/analytics/report/coupons/config.js:86
#: client/analytics/report/products/config.js:165
#: client/analytics/report/taxes/config.js:93
#: client/analytics/report/variations/config.js:107
msgid "Compare"
msgstr ""

#: client/analytics/components/report-table/index.js:421
msgid "Search by item name"
msgstr ""

#: client/analytics/report/downloads/table.js:172
msgid "Download"
msgid_plural "Downloads"
msgstr[0] ""
msgstr[1] ""

#: client/analytics/report/categories/config.js:102
msgid "Search for categories to compare"
msgstr ""

#: client/analytics/report/categories/config.js:106
msgid "Compare Categories"
msgstr ""

#: client/analytics/report/categories/config.js:116
#: client/analytics/report/coupons/config.js:99
#: client/analytics/report/customers/config.js:62
#: client/analytics/report/downloads/config.js:39
#: client/analytics/report/orders/config.js:59
#: client/analytics/report/taxes/config.js:102
#: client/analytics/report/variations/config.js:113
msgid "Advanced filters"
msgstr ""

#: client/analytics/report/categories/config.js:123
#: client/analytics/report/coupons/config.js:106
#: client/analytics/report/customers/config.js:27
#: client/analytics/report/downloads/config.js:32
#: client/analytics/report/orders/config.js:52
#: client/analytics/report/products/config.js:51
#: client/analytics/report/revenue/config.js:97
#: client/analytics/report/stock/config.js:27
#: client/analytics/report/taxes/config.js:109
#: client/analytics/report/variations/config.js:53
msgid "Show"
msgstr ""

#: client/analytics/report/categories/config.js:61
msgid "All categories"
msgstr ""

#: client/analytics/report/categories/config.js:65
msgid "Single category"
msgstr ""

#: client/analytics/report/categories/config.js:79
msgid "Type to search for a category"
msgstr ""

#: client/analytics/report/categories/config.js:83
msgid "Single Category"
msgstr ""

#: client/analytics/report/categories/config.js:90
#: client/analytics/report/coupons/config.js:78
#: client/analytics/report/products/config.js:148
#: client/analytics/report/taxes/config.js:69
#: client/analytics/report/variations/config.js:90
msgid "Comparison"
msgstr ""

#: client/analytics/report/categories/config.js:98
#: client/analytics/report/categories/table.js:182
msgid "Check at least two categories below to compare"
msgstr ""

#: client/analytics/report/categories/index.js:34
#: client/analytics/report/products/index.js:46
msgid "%d products"
msgstr ""

#: client/analytics/report/categories/index.js:35
msgid "%d categories"
msgstr ""

#: client/analytics/report/categories/table.js:154
#: client/analytics/report/orders/table.js:283
#: client/analytics/report/products/table.js:295
msgid "Item sold"
msgid_plural "Items sold"
msgstr[0] ""
msgstr[1] ""

#: client/analytics/report/categories/table.js:167
#: client/analytics/report/coupons/table.js:189
#: client/analytics/report/orders/table.js:256
msgid "Order"
msgid_plural "Orders"
msgstr[0] ""
msgstr[1] ""

#: client/analytics/report/categories/table.js:186
msgid "Search by category name"
msgstr ""

#: client/analytics/report/coupons/config.js:31
msgid "Amount"
msgstr ""

#: client/analytics/report/coupons/config.js:51
msgid "All coupons"
msgstr ""

#: client/analytics/report/coupons/config.js:53
msgid "Single coupon"
msgstr ""

#: client/analytics/report/coupons/config.js:67
msgid "Type to search for a coupon"
msgstr ""

#: client/analytics/report/coupons/config.js:71
msgid "Single Coupon"
msgstr ""

#: client/analytics/report/coupons/config.js:85
msgid "Compare Coupon Codes"
msgstr ""

#: client/analytics/report/coupons/config.js:87
msgid "Check at least two coupon codes below to compare"
msgstr ""

#: client/analytics/report/coupons/index.js:27
msgid "%d coupons"
msgstr ""

#: client/analytics/report/coupons/table.js:180
#: client/analytics/report/orders/table.js:292
msgid "Coupon"
msgid_plural "Coupons"
msgstr[0] ""
msgstr[1] ""

#: client/analytics/report/coupons/table.js:206
msgid "Percentage"
msgstr ""

#: client/analytics/report/coupons/table.js:207
msgid "Fixed cart"
msgstr ""

#: client/analytics/report/coupons/table.js:208
msgid "Fixed product"
msgstr ""

#: client/analytics/report/customers/config.js:133
#: client/analytics/report/downloads/config.js:59
msgid "Search"
msgstr ""

#: client/analytics/report/customers/config.js:134
msgid "Remove country / region filter"
msgstr ""

#: client/analytics/report/customers/config.js:138
msgid "Select a country / region filter match"
msgstr ""

# A sentence describing a Product filter. See screen shot for context: https://cloudup.com/cCsm3GeXJbE
#: client/analytics/report/customers/config.js:143
msgid "{{title}}Country / Region{{/title}} {{rule /}} {{filter /}}"
msgstr ""

#: client/analytics/report/customers/config.js:147
msgid "Select country / region"
msgstr ""

#: client/analytics/report/customers/config.js:191
#: client/analytics/report/downloads/config.js:101
msgid "Search customer username"
msgstr ""

#: client/analytics/report/customers/config.js:195
#: client/analytics/report/downloads/config.js:105
msgid "Remove customer username filter"
msgstr ""

#: client/analytics/report/customers/config.js:199
#: client/analytics/report/downloads/config.js:109
msgid "Select a customer username filter match"
msgstr ""

# A sentence describing a customer username filter. See screen shot for context: https://cloudup.com/ccxhyH2mEDg
#: client/analytics/report/customers/config.js:204
#: client/analytics/report/downloads/config.js:114
msgid "{{title}}Username{{/title}} {{rule /}} {{filter /}}"
msgstr ""

#: client/analytics/report/customers/config.js:208
#: client/analytics/report/downloads/config.js:118
msgid "Select customer username"
msgstr ""

#: client/analytics/report/customers/config.js:242
msgid "Search customer email"
msgstr ""

#: client/analytics/report/customers/config.js:246
msgid "Remove customer email filter"
msgstr ""

#: client/analytics/report/customers/config.js:250
msgid "Select a customer email filter match"
msgstr ""

# A sentence describing a customer email filter. See screen shot for context: https://cloudup.com/cCsm3GeXJbE
#: client/analytics/report/customers/config.js:255
msgid "{{title}}Email{{/title}} {{rule /}} {{filter /}}"
msgstr ""

#: client/analytics/report/customers/config.js:259
msgid "Select customer email"
msgstr ""

#: client/analytics/report/customers/config.js:295
msgid "No. of Orders"
msgstr ""

#: client/analytics/report/customers/config.js:296
msgid "Remove order filter"
msgstr ""

#: client/analytics/report/customers/config.js:297
msgid "Select an order count filter match"
msgstr ""

#: client/analytics/report/customers/config.js:301
msgid "{{title}}No. of Orders{{/title}} {{rule /}} {{filter /}}"
msgstr ""

#: client/analytics/report/customers/config.js:32
msgid "All Customers"
msgstr ""

#: client/analytics/report/customers/config.js:342
msgid "Remove total spend filter"
msgstr ""

#: client/analytics/report/customers/config.js:346
msgid "Select a total spend filter match"
msgstr ""

#: client/analytics/report/customers/config.js:350
msgid "{{title}}Total Spend{{/title}} {{rule /}} {{filter /}}"
msgstr ""

#: client/analytics/report/customers/config.js:391
msgid "Remove average order value filter"
msgstr ""

#: client/analytics/report/customers/config.js:395
msgid "Select an average order value filter match"
msgstr ""

#: client/analytics/report/customers/config.js:399
msgid "{{title}}AOV{{/title}} {{rule /}} {{filter /}}"
msgstr ""

#: client/analytics/report/customers/config.js:440
msgid "Registered"
msgstr ""

#: client/analytics/report/customers/config.js:441
msgid "Remove registered filter"
msgstr ""

#: client/analytics/report/customers/config.js:445
msgid "Select a registered filter match"
msgstr ""

# A sentence describing a Product filter. See screen shot for context: https://cloudup.com/cCsm3GeXJbE
#: client/analytics/report/customers/config.js:450
msgid "{{title}}Registered{{/title}} {{rule /}} {{filter /}}"
msgstr ""

#: client/analytics/report/customers/config.js:479
#: client/analytics/report/customers/table.js:44
msgid "Last active"
msgstr ""

#: client/analytics/report/customers/config.js:48
msgid "Type to search for a customer"
msgstr ""

#: client/analytics/report/customers/config.js:480
msgid "Remove last active filter"
msgstr ""

#: client/analytics/report/customers/config.js:484
msgid "Select a last active filter match"
msgstr ""

# A sentence describing a Product filter. See screen shot for context: https://cloudup.com/cCsm3GeXJbE
#: client/analytics/report/customers/config.js:489
msgid "{{title}}Last active{{/title}} {{rule /}} {{filter /}}"
msgstr ""

#: client/analytics/report/customers/config.js:493
msgid "Select registered date"
msgstr ""

#: client/analytics/report/customers/config.js:52
msgid "Single Customer"
msgstr ""

#: client/analytics/report/customers/config.js:83
msgid "Remove customer name filter"
msgstr ""

#: client/analytics/report/customers/config.js:87
msgid "Select a customer name filter match"
msgstr ""

# A sentence describing a Product filter. See screen shot for context: https://cloudup.com/cCsm3GeXJbE
#: client/analytics/report/customers/config.js:92
msgid "{{title}}Name{{/title}} {{rule /}} {{filter /}}"
msgstr ""

#: client/analytics/report/customers/config.js:96
msgid "Select customer name"
msgstr ""

#: client/analytics/report/customers/table.js:237
msgid "customer"
msgid_plural "customers"
msgstr[0] ""
msgstr[1] ""

#: client/analytics/report/customers/table.js:246
msgid "Average order"
msgid_plural "Average orders"
msgstr[0] ""
msgstr[1] ""

#: client/analytics/report/customers/table.js:255
msgid "Average lifetime spend"
msgstr ""

#: client/analytics/report/customers/table.js:259
#: client/analytics/report/orders/config.js:38
#: client/dashboard/dashboard-charts/config.js:45
msgid "Average order value"
msgstr ""

#: client/analytics/report/customers/table.js:284
msgid "Search by customer name"
msgstr ""

#: client/analytics/report/customers/table.js:50
msgid "Date registered"
msgstr ""

#: client/analytics/report/customers/table.js:65
msgid "Total spend"
msgstr ""

#: client/analytics/report/customers/table.js:97
msgid "Postal code"
msgstr ""

#: client/analytics/report/downloads/config.js:152
msgid "Search order number"
msgstr ""

#: client/analytics/report/downloads/config.js:156
msgid "Remove order number filter"
msgstr ""

#: client/analytics/report/downloads/config.js:160
msgid "Select a order number filter match"
msgstr ""

# A sentence describing a order number filter. See screen shot for context: https://cloudup.com/ccxhyH2mEDg
#: client/analytics/report/downloads/config.js:165
msgid "{{title}}Order #{{/title}} {{rule /}} {{filter /}}"
msgstr ""

#: client/analytics/report/downloads/config.js:169
msgid "Select order number"
msgstr ""

#: client/analytics/report/downloads/config.js:205
msgid "IP Address"
msgstr ""

#: client/analytics/report/downloads/config.js:206
msgid "Search IP address"
msgstr ""

#: client/analytics/report/downloads/config.js:207
msgid "Remove IP address filter"
msgstr ""

#: client/analytics/report/downloads/config.js:211
msgid "Select an IP address filter match"
msgstr ""

# A sentence describing a order number filter. See screen shot for context: https://cloudup.com/ccxhyH2mEDg
#: client/analytics/report/downloads/config.js:216
msgid "{{title}}IP Address{{/title}} {{rule /}} {{filter /}}"
msgstr ""

#: client/analytics/report/downloads/config.js:220
msgid "Select IP address"
msgstr ""

#: client/analytics/report/downloads/config.js:37
msgid "All downloads"
msgstr ""

#: client/analytics/report/orders/table.js:274
#: client/analytics/report/products/table.js:286
#: client/analytics/report/stock/table.js:149
msgid "Product"
msgid_plural "Products"
msgstr[0] ""
msgstr[1] ""

#: client/analytics/report/downloads/config.js:60
msgid "Remove product filter"
msgstr ""

#: client/analytics/report/downloads/config.js:61
#: client/analytics/report/orders/config.js:123
#: client/analytics/report/variations/config.js:223
msgid "Select a product filter match"
msgstr ""

# A sentence describing a Product filter. See screen shot for context: https://cloudup.com/cSsUY9VeCVJ
#: client/analytics/report/downloads/config.js:66
#: client/analytics/report/orders/config.js:128
#: client/analytics/report/variations/config.js:228
msgid "{{title}}Product{{/title}} {{rule /}} {{filter /}}"
msgstr ""

#: client/analytics/report/downloads/config.js:70
msgid "Select product"
msgstr ""

#: client/analytics/report/downloads/table.js:168
#: client/analytics/report/revenue/table.js:222
msgid "day"
msgid_plural "days"
msgstr[0] ""
msgstr[1] ""

#: client/analytics/report/downloads/table.js:53
#: client/analytics/report/orders/table.js:44
msgid "Order Number"
msgstr ""

#: client/analytics/report/orders/config.js:121
#: client/analytics/report/variations/config.js:221
msgid "Search products"
msgstr ""

#: client/analytics/report/orders/config.js:122
#: client/analytics/report/variations/config.js:222
msgid "Remove products filter"
msgstr ""

#: client/analytics/report/orders/config.js:132
#: client/analytics/report/variations/config.js:232
msgid "Select products"
msgstr ""

#: client/analytics/report/orders/config.js:163
msgid "Search variations"
msgstr ""

#: client/analytics/report/orders/config.js:164
msgid "Remove variations filter"
msgstr ""

#: client/analytics/report/orders/config.js:168
msgid "Select a variation filter match"
msgstr ""

# A sentence describing a Variation filter. See screen shot for context: https://cloudup.com/cSsUY9VeCVJ
#: client/analytics/report/orders/config.js:173
msgid "{{title}}Variation{{/title}} {{rule /}} {{filter /}}"
msgstr ""

#: client/analytics/report/orders/config.js:177
msgid "Select variation"
msgstr ""

#: client/analytics/report/orders/config.js:207
msgid "Coupon Codes"
msgstr ""

#: client/analytics/report/orders/config.js:208
msgid "Search coupons"
msgstr ""

#: client/analytics/report/orders/config.js:209
msgid "Remove coupon filter"
msgstr ""

#: client/analytics/report/orders/config.js:210
msgid "Select a coupon filter match"
msgstr ""

# A sentence describing a Coupon filter. See screen shot for context: https://cloudup.com/cSsUY9VeCVJ
#: client/analytics/report/orders/config.js:215
msgid "{{title}}Coupon code{{/title}} {{rule /}} {{filter /}}"
msgstr ""

#: client/analytics/report/orders/config.js:219
msgid "Select coupon codes"
msgstr ""

#: client/analytics/report/orders/config.js:250
msgid "Remove customer filter"
msgstr ""

#: client/analytics/report/orders/config.js:251
msgid "Select a customer filter match"
msgstr ""

# A sentence describing a Customer filter. See screen shot for context: https://cloudup.com/cSsUY9VeCVJ
#: client/analytics/report/orders/config.js:256
msgid "{{title}}Customer is{{/title}} {{filter /}}"
msgstr ""

#: client/analytics/report/orders/config.js:260
msgid "Select a customer type"
msgstr ""

#: client/analytics/report/orders/config.js:267
msgid "New"
msgstr ""

#: client/analytics/report/orders/config.js:271
msgid "Returning"
msgstr ""

#: client/analytics/report/orders/config.js:279
msgid "Refunds"
msgstr ""

#: client/analytics/report/orders/config.js:280
msgid "Remove refunds filter"
msgstr ""

#: client/analytics/report/orders/config.js:281
msgid "Select a refund filter match"
msgstr ""

#: client/analytics/report/orders/config.js:285
msgid "{{title}}Refunds{{/title}} {{filter /}}"
msgstr ""

#: client/analytics/report/orders/config.js:289
msgid "Select a refund type"
msgstr ""

#: client/analytics/report/orders/config.js:296
#: packages/components/build-module/advanced-filters/index.js:19
msgid "All"
msgstr ""

#: client/analytics/report/orders/config.js:300
msgid "Partially refunded"
msgstr ""

#: client/analytics/report/orders/config.js:307
msgid "Fully refunded"
msgstr ""

#: client/analytics/report/orders/config.js:311
msgid "None"
msgstr ""

#: client/analytics/report/orders/config.js:319
msgid "Tax Rates"
msgstr ""

#: client/analytics/report/orders/config.js:320
msgid "Search tax rates"
msgstr ""

#: client/analytics/report/orders/config.js:321
msgid "Remove tax rate filter"
msgstr ""

#: client/analytics/report/orders/config.js:322
msgid "Select a tax rate filter match"
msgstr ""

# A sentence describing a tax rate filter. See screen shot for context: https://cloudup.com/cSsUY9VeCVJ
#: client/analytics/report/orders/config.js:327
msgid "{{title}}Tax Rate{{/title}} {{rule /}} {{filter /}}"
msgstr ""

#: client/analytics/report/orders/config.js:331
msgid "Select tax rates"
msgstr ""

#: client/analytics/report/orders/config.js:362
#: client/analytics/report/variations/config.js:132
msgid "Attribute"
msgstr ""

#: client/analytics/report/orders/config.js:363
#: client/analytics/report/variations/config.js:133
msgid "Search attributes"
msgstr ""

#: client/analytics/report/orders/config.js:364
#: client/analytics/report/variations/config.js:134
msgid "Remove attribute filter"
msgstr ""

#: client/analytics/report/orders/config.js:368
#: client/analytics/report/variations/config.js:138
msgid "Select a product attribute filter match"
msgstr ""

# A sentence describing a Product filter. See screen shot for context: https://cloudup.com/cSsUY9VeCVJ
#: client/analytics/report/orders/config.js:373
#: client/analytics/report/variations/config.js:143
msgid "{{title}}Attribute{{/title}} {{rule /}} {{filter /}}"
msgstr ""

#: client/analytics/report/orders/config.js:377
#: client/analytics/report/variations/config.js:147
msgid "Select attributes"
msgstr ""

#: client/analytics/report/orders/config.js:57
msgid "All orders"
msgstr ""

#: client/analytics/report/orders/config.js:78
msgid "Order Status"
msgstr ""

#: client/analytics/report/orders/config.js:79
msgid "Remove order status filter"
msgstr ""

#: client/analytics/report/orders/config.js:83
msgid "Select an order status filter match"
msgstr ""

# A sentence describing an Order Status filter. See screen shot for context: https://cloudup.com/cSsUY9VeCVJ
#: client/analytics/report/orders/config.js:88
msgid "{{title}}Order Status{{/title}} {{rule /}} {{filter /}}"
msgstr ""

#: client/analytics/report/orders/config.js:92
msgid "Select an order status"
msgstr ""

#: client/analytics/report/orders/table.js:209
msgid "%s× %s"
msgstr ""

#: client/analytics/report/orders/table.js:265
msgid " Customer"
msgid_plural " Customers"
msgstr[0] ""
msgstr[1] ""

#: client/analytics/report/orders/table.js:301
#: client/analytics/report/variations/table.js:216
msgid "net sales"
msgstr ""

#: client/analytics/report/products/config.js:117
#: client/analytics/report/variations/config.js:59
msgid "All variations"
msgstr ""

#: client/analytics/report/products/config.js:134
#: client/analytics/report/variations/config.js:76
msgid "Type to search for a variation"
msgstr ""

#: client/analytics/report/products/config.js:138
#: client/analytics/report/variations/config.js:80
msgid "Single variation"
msgstr ""

#: client/analytics/report/products/config.js:156
#: client/analytics/report/variations/config.js:98
#: client/analytics/report/variations/table.js:241
msgid "Check at least two variations below to compare"
msgstr ""

#: client/analytics/report/products/config.js:160
#: client/analytics/report/variations/config.js:102
msgid "Search for variations to compare"
msgstr ""

#: client/analytics/report/products/config.js:164
#: client/analytics/report/variations/config.js:106
msgid "Compare Variations"
msgstr ""

#: client/analytics/report/products/config.js:190
#: client/analytics/report/revenue/config.js:90
#: client/analytics/report/stock/config.js:56
msgid "Advanced Filters"
msgstr ""

#: client/analytics/report/products/config.js:56
#: client/analytics/report/stock/config.js:32
msgid "All products"
msgstr ""

#: client/analytics/report/products/config.js:72
msgid "Type to search for a product"
msgstr ""

#: client/analytics/report/products/config.js:76
msgid "Single product"
msgstr ""

#: client/analytics/report/products/config.js:91
#: client/analytics/report/products/table.js:330
msgid "Check at least two products below to compare"
msgstr ""

#: client/analytics/report/products/config.js:95
msgid "Search for products to compare"
msgstr ""

#: client/analytics/report/products/config.js:99
msgid "Compare Products"
msgstr ""

#: client/analytics/report/products/index.js:45
#: client/analytics/report/variations/index.js:27
msgid "%d variations"
msgstr ""

#: client/analytics/report/products/table.js:334
msgid "Search by product name or SKU"
msgstr ""

#: client/analytics/report/revenue/config.js:86
msgid "All Revenue"
msgstr ""

#: client/analytics/report/revenue/table.js:226
#: client/analytics/report/taxes/table.js:168
msgid "order"
msgid_plural "orders"
msgstr[0] ""
msgstr[1] ""

#: client/analytics/report/stock/config.js:34
#: client/analytics/report/stock/table.js:158
msgid "Out of stock"
msgstr ""

#: client/analytics/report/stock/config.js:38
#: client/analytics/report/stock/table.js:162
msgid "Low stock"
msgstr ""

#: client/analytics/report/stock/config.js:41
#: client/analytics/report/stock/table.js:170
msgid "In stock"
msgstr ""

#: client/analytics/report/stock/config.js:43
#: client/analytics/report/stock/table.js:166
msgid "On backorder"
msgstr ""

#: client/analytics/report/stock/config.js:49
msgid "Filter by"
msgstr ""

#: client/analytics/report/stock/config.js:54
msgid "All Products"
msgstr ""

#: client/analytics/report/taxes/config.js:67
msgid "All taxes"
msgstr ""

#: client/analytics/report/taxes/config.js:84
msgid "Check at least two tax codes below to compare"
msgstr ""

#: client/analytics/report/taxes/config.js:88
msgid "Search for tax codes to compare"
msgstr ""

#: client/analytics/report/taxes/config.js:92
msgid "Compare Tax Codes"
msgstr ""

#: client/analytics/report/taxes/index.js:23
msgid "%d taxes"
msgstr ""

#: client/analytics/report/taxes/table.js:147
msgid "tax code"
msgid_plural "tax codes"
msgstr[0] ""
msgstr[1] ""

#: client/analytics/report/taxes/table.js:156
msgid "total tax"
msgstr ""

#: client/analytics/report/taxes/table.js:160
msgid "order tax"
msgstr ""

#: client/analytics/report/taxes/table.js:164
msgid "shipping tax"
msgstr ""

#: client/analytics/report/taxes/utils.js:10
#: packages/components/build-module/search/autocompleters/utils.js:31
msgid "TAX"
msgstr ""

#: client/analytics/report/variations/config.js:176
msgid "Search categories"
msgstr ""

#: client/analytics/report/variations/config.js:177
msgid "Remove categories filter"
msgstr ""

#: client/analytics/report/variations/config.js:181
msgid "Select a category filter match"
msgstr ""

# A sentence describing a Category filter. See screen shot for context: https://cloudup.com/cSsUY9VeCVJ
#: client/analytics/report/variations/config.js:186
msgid "{{title}}Category{{/title}} {{rule /}} {{filter /}}"
msgstr ""

#: client/analytics/report/variations/config.js:190
msgid "Select categories"
msgstr ""

#: client/analytics/report/variations/table.js:198
msgid "variation sold"
msgid_plural "variations sold"
msgstr[0] ""
msgstr[1] ""

#: client/analytics/report/variations/table.js:207
msgid "item sold"
msgid_plural "items sold"
msgstr[0] ""
msgstr[1] ""

#: client/analytics/report/variations/table.js:220
msgid "orders"
msgid_plural "orders"
msgstr[0] ""
msgstr[1] ""

#: client/analytics/report/variations/table.js:245
msgid "Search by variation name or SKU"
msgstr ""

#: client/analytics/settings/config.js:105
msgid "Default date range:"
msgstr ""

#: client/analytics/settings/config.js:108
msgid ""
"Select a default date range. When no range is selected, reports will be "
"viewed by the default date range."
msgstr ""

#: client/analytics/settings/config.js:51
msgid "Custom Statuses"
msgstr ""

#: client/analytics/settings/config.js:58
msgid "Unregistered Statuses"
msgstr ""

#: client/analytics/settings/config.js:64
msgid "Exclude the %s status from reports"
msgstr ""

#: client/analytics/settings/config.js:77
msgid "Excluded statuses:"
msgstr ""

#: client/analytics/settings/config.js:81
msgid ""
"Orders with these statuses are excluded from the totals in your reports. "
"The {{strong}}Refunded{{/strong}} status can not be excluded."
msgstr ""

#: client/analytics/settings/config.js:93
msgid "Actionable statuses:"
msgstr ""

#: client/analytics/settings/config.js:96
msgid ""
"Orders with these statuses require action on behalf of the store admin. "
"These orders will show up in the Home Screen - Orders task."
msgstr ""

#: client/analytics/settings/historical-data/actions.js:109
msgid "Stop Import"
msgstr ""

#: client/analytics/settings/historical-data/actions.js:112
msgid "Imported data will not be lost if the import is stopped."
msgstr ""

#: client/analytics/settings/historical-data/actions.js:117
msgid "Navigating away from this page will not affect the import."
msgstr ""

#: client/analytics/settings/historical-data/actions.js:154
msgid "Start"
msgstr ""

#: client/analytics/settings/historical-data/actions.js:163
msgid "Something went wrong with the importation process."
msgstr ""

#: client/analytics/settings/historical-data/actions.js:174
msgid "Re-import Data"
msgstr ""

#: client/analytics/settings/historical-data/actions.js:177
msgid "Delete Previously Imported Data"
msgstr ""

#: client/analytics/settings/historical-data/actions.js:36
msgid "There was a problem rebuilding your report data."
msgstr ""

#: client/analytics/settings/historical-data/actions.js:49
msgid "There was a problem stopping your current import."
msgstr ""

#: client/analytics/settings/historical-data/actions.js:78
msgid "There was a problem deleting your previous data."
msgstr ""

#: client/analytics/settings/historical-data/index.js:26
#: packages/components/build-module/advanced-filters/date-filter.js:18
#: packages/components/build-module/date-range-filter-picker/index.js:15
#: packages/data/build-module/import/reducer.js:17
#: packages/date/build-module/index.js:562
msgid "MM/DD/YYYY"
msgstr ""

#: client/analytics/settings/historical-data/layout.js:44
#: client/analytics/settings/historical-data/period-selector.js:68
msgid "Import historical data"
msgstr ""

#: client/analytics/settings/historical-data/layout.js:53
msgid ""
"This tool populates historical analytics data by processing customers and "
"orders created prior to activating WooCommerce Admin."
msgstr ""

#: client/analytics/settings/historical-data/layout.js:71
msgid "Registered Customers"
msgstr ""

#: client/analytics/settings/historical-data/layout.js:79
msgid "Orders and Refunds"
msgstr ""

#: client/analytics/settings/historical-data/period-selector.js:47
msgid "Beginning on"
msgstr ""

#: client/analytics/settings/historical-data/progress.js:16
msgid "%(progress)s of %(total)s"
msgstr ""

#: client/analytics/settings/historical-data/progress.js:9
msgid "Imported %(label)s"
msgstr ""

#: client/analytics/settings/historical-data/skip-checkbox.js:18
msgid "Skip previously imported customers and orders"
msgstr ""

#: client/analytics/settings/historical-data/status.js:13
msgid "Nothing To Import"
msgstr ""

#: client/analytics/settings/historical-data/status.js:14
msgid "Ready To Import"
msgstr ""

#: client/analytics/settings/historical-data/status.js:16
msgid "Initializing"
msgstr ""

#: client/analytics/settings/historical-data/status.js:20
msgid "Importing Customers"
msgstr ""

#: client/analytics/settings/historical-data/status.js:24
msgid "Importing Orders"
msgstr ""

#: client/analytics/settings/historical-data/status.js:28
msgid "Finalizing"
msgstr ""

#: client/analytics/settings/historical-data/status.js:33
msgid "All historical data imported"
msgstr ""

#: client/analytics/settings/historical-data/status.js:35
msgid "Historical data from %s onward imported"
msgstr ""

#: client/analytics/settings/historical-data/status.js:47
msgid "Status:"
msgstr ""

#: client/analytics/settings/index.js:133
msgid "Analytics settings"
msgstr ""

#: client/analytics/settings/index.js:147
msgid "Reset defaults"
msgstr ""

#: client/analytics/settings/index.js:154
msgid "Save settings"
msgstr ""

#: client/analytics/settings/index.js:36
msgid "You have unsaved changes. If you proceed, they will be lost."
msgstr ""

#: client/analytics/settings/index.js:57
msgid "Your settings have been successfully saved."
msgstr ""

#: client/analytics/settings/index.js:65
msgid "There was an error saving your settings. Please try again."
msgstr ""

#: client/analytics/settings/index.js:79
msgid "Are you sure you want to reset all settings to default values?"
msgstr ""

#: client/customer-effort-score-tracks/customer-effort-score-tracks.js:129
msgid "Pencil icon"
msgstr ""

#: client/customer-effort-score-tracks/data/actions.js:58
msgid "How easy was it to filter your store analytics?"
msgstr ""

#: client/dashboard/components/cart-modal.js:106
msgid "%s — %s per year"
msgstr ""

#: client/dashboard/components/cart-modal.js:128
msgid "Would you like to add the following paid features to your store now?"
msgstr ""

#: client/dashboard/components/cart-modal.js:138
msgid ""
"You won't have access to this functionality until the extensions have been "
"purchased and installed."
msgstr ""

#: client/dashboard/components/cart-modal.js:150
msgid "I'll do it later"
msgstr ""

#: client/dashboard/components/cart-modal.js:158
msgid "Buy now"
msgstr ""

#: client/dashboard/components/connect/index.js:77
#: client/profile-wizard/steps/business-details/flows/selective-bundle/index.js:431
#: packages/components/build-module/plugins/index.js:62
msgid "Retry"
msgstr ""

#: client/dashboard/components/connect/index.js:91
#: client/homescreen/stats-overview/install-jetpack-cta.js:76
#: client/profile-wizard/steps/usage-modal.js:130
#: client/task-list/tasks/PaymentGatewaySuggestions/components/WCPay/UsageModal.js:55
#: client/wp-admin-scripts/navigation-opt-out/container.js:46
#: packages/components/build-module/plugins/index.js:74
msgid "No thanks"
msgstr ""

#: client/dashboard/components/connect/index.js:96
#: packages/components/build-module/plugins/index.js:75
msgid "Abort"
msgstr ""

#: client/dashboard/components/settings/general/store-address.js:22
msgid "Please add an address"
msgstr ""

#: client/dashboard/components/settings/general/store-address.js:222
msgid "Address line 1"
msgstr ""

#: client/dashboard/components/settings/general/store-address.js:229
msgid "Address line 2 (optional)"
msgstr ""

#: client/dashboard/components/settings/general/store-address.js:257
msgid "Post code"
msgstr ""

#: client/dashboard/components/settings/general/store-address.js:28
msgid "Please select a country / region"
msgstr ""

#: client/dashboard/components/settings/general/store-address.js:34
msgid "Please add a city"
msgstr ""

#: client/dashboard/components/settings/general/store-address.js:37
msgid "Please add a post code"
msgstr ""

#: client/dashboard/customizable.js:182
msgid "Add more sections"
msgstr ""

#: client/dashboard/customizable.js:191
msgid "Dashboard Sections"
msgstr ""

#: client/dashboard/customizable.js:204
msgid "Add %s section"
msgstr ""

#: client/dashboard/dashboard-charts/block.js:78
msgid "%s Report"
msgstr ""

#: client/dashboard/dashboard-charts/config.js:65
msgid "Gross discounted"
msgstr ""

#: client/dashboard/dashboard-charts/index.js:153
msgid "Choose which charts to display"
msgstr ""

#: client/dashboard/dashboard-charts/index.js:193
#: client/dashboard/default-sections.js:67
msgid "Charts"
msgstr ""

#: client/dashboard/dashboard-charts/index.js:216
#: packages/components/build-module/chart/index.js:283
msgid "Line chart"
msgstr ""

#: client/dashboard/dashboard-charts/index.js:232
#: packages/components/build-module/chart/index.js:287
msgid "Bar chart"
msgstr ""

#: client/dashboard/dashboard-charts/index.js:60
#: packages/components/build-module/chart/index.js:202
msgid "By hour"
msgstr ""

#: client/dashboard/dashboard-charts/index.js:61
#: packages/components/build-module/chart/index.js:203
msgid "By day"
msgstr ""

#: client/dashboard/dashboard-charts/index.js:62
#: packages/components/build-module/chart/index.js:204
msgid "By week"
msgstr ""

#: client/dashboard/dashboard-charts/index.js:63
#: packages/components/build-module/chart/index.js:205
msgid "By month"
msgstr ""

#: client/dashboard/dashboard-charts/index.js:64
#: packages/components/build-module/chart/index.js:206
msgid "By quarter"
msgstr ""

#: client/dashboard/dashboard-charts/index.js:65
#: packages/components/build-module/chart/index.js:207
msgid "By year"
msgstr ""

#: client/dashboard/default-sections.js:48
msgid "Performance"
msgstr ""

#: client/dashboard/default-sections.js:88
#: client/dashboard/leaderboards/index.js:154
msgid "Leaderboards"
msgstr ""

#: client/dashboard/leaderboards/index.js:111
msgid "Choose which leaderboards to display and other settings"
msgstr ""

#: client/dashboard/leaderboards/index.js:127
msgid "Rows per table"
msgstr ""

#: client/dashboard/section-controls.js:47
msgid "Section title"
msgstr ""

#: client/dashboard/section-controls.js:63
msgid "Move up"
msgstr ""

#: client/dashboard/section-controls.js:74
msgid "Move down"
msgstr ""

#: client/dashboard/section-controls.js:81
msgid "Remove block"
msgstr ""

#: client/dashboard/section-controls.js:84
msgid "Remove section"
msgstr ""

#: client/dashboard/store-performance/index.js:179
msgid "Store Performance"
msgstr ""

#: client/dashboard/store-performance/index.js:51
msgid "Choose which analytics to display and the section name"
msgstr ""

#: client/dashboard/store-performance/index.js:58
#: client/homescreen/stats-overview/index.js:94
msgid "Display stats:"
msgstr ""

#: client/header/activity-panel/display-options/icons/display.js:41
#: client/task-list/index.js:335
msgid "Display"
msgstr ""

#: client/header/activity-panel/display-options/index.js:104
msgid "Layout"
msgstr ""

#: client/header/activity-panel/display-options/index.js:34
msgid "Single column"
msgstr ""

#: client/header/activity-panel/display-options/index.js:43
msgid "Two columns"
msgstr ""

# button label text should, if possible, be under 16 characters.
#: client/header/activity-panel/display-options/index.js:86
msgid "Display options"
msgstr ""

#: client/header/activity-panel/highlight-tooltip/index.js:172
#: packages/components/build-module/calendar/phrases.js:7
msgid "Close"
msgstr ""

#: client/header/activity-panel/index.js:235
#: client/header/activity-panel/panels/help.js:43
msgid "Inbox"
msgstr ""

#: client/header/activity-panel/index.js:277
msgid "Help"
msgstr ""

#: client/header/activity-panel/index.js:291
msgid "Preview site"
msgstr ""

#: client/header/activity-panel/index.js:368
msgid "Store Activity"
msgstr ""

#: client/header/activity-panel/index.js:403
msgid "We're here for help"
msgstr ""

#: client/header/activity-panel/index.js:404
msgid ""
"If you have any questions, feel free to explore the WooCommerce docs listed "
"here."
msgstr ""

#: client/header/activity-panel/index.js:408
#: client/navigation/components/favorites-tooltip/index.js:51
msgid "Got it"
msgstr ""

#: client/header/activity-panel/panels/help.js:103
msgid "Set up Google Listing & Ads"
msgstr ""

#: client/header/activity-panel/panels/help.js:108
msgid "Connect Mailchimp for WooCommerce"
msgstr ""

#: client/header/activity-panel/panels/help.js:116
msgid "Set up Creative Mail for WooCommerce"
msgstr ""

#: client/header/activity-panel/panels/help.js:130
msgid "Which Payment Option is Right for Me?"
msgstr ""

#: client/header/activity-panel/panels/help.js:138
msgid "WooCommerce Payments Start Up Guide"
msgstr ""

#: client/header/activity-panel/panels/help.js:146
msgid "WooCommerce Payments FAQs"
msgstr ""

#: client/header/activity-panel/panels/help.js:151
msgid "Stripe Setup and Configuration"
msgstr ""

#: client/header/activity-panel/panels/help.js:156
msgid "PayPal Checkout Setup and Configuration"
msgstr ""

#: client/header/activity-panel/panels/help.js:164
msgid "Square - Get started"
msgstr ""

#: client/header/activity-panel/panels/help.js:174
msgid "Klarna - Introduction"
msgstr ""

#: client/header/activity-panel/panels/help.js:179
msgid "PayFast Setup and Configuration"
msgstr ""

#: client/header/activity-panel/panels/help.js:184
msgid "Eway Setup and Configuration"
msgstr ""

#: client/header/activity-panel/panels/help.js:189
msgid "Direct Bank Transfer (BACS)"
msgstr ""

#: client/header/activity-panel/panels/help.js:194
msgid "Cash on Delivery"
msgstr ""

#: client/header/activity-panel/panels/help.js:209
msgid "Import products using the CSV Importer and Exporter"
msgstr ""

#: client/header/activity-panel/panels/help.js:217
msgid "Migrate products using Cart2Cart"
msgstr ""

#: client/header/activity-panel/panels/help.js:225
msgid "Learn more about setting up products"
msgstr ""

#: client/header/activity-panel/panels/help.js:241
msgid "Setting up Shipping Zones"
msgstr ""

#: client/header/activity-panel/panels/help.js:246
msgid "Core Shipping Options"
msgstr ""

#: client/header/activity-panel/panels/help.js:251
msgid "Product Shipping Classes"
msgstr ""

#: client/header/activity-panel/panels/help.js:256
msgid "WooCommerce Shipping setup and configuration"
msgstr ""

#: client/header/activity-panel/panels/help.js:264
msgid "Learn more about configuring your shipping settings"
msgstr ""

#: client/header/activity-panel/panels/help.js:287
msgid "Setting up Taxes in WooCommerce"
msgstr ""

#: client/header/activity-panel/panels/help.js:292
msgid "Automated Tax calculation using WooCommerce Tax"
msgstr ""

#: client/header/activity-panel/panels/help.js:33
msgid "Get Support"
msgstr ""

#: client/header/activity-panel/panels/help.js:340
msgid "WooCommerce Docs"
msgstr ""

#: client/header/activity-panel/panels/help.js:38
msgid "Home Screen"
msgstr ""

#: client/header/activity-panel/panels/help.js:401
msgid "Documentation"
msgstr ""

#: client/header/activity-panel/panels/help.js:48
msgid "Stats Overview"
msgstr ""

#: client/header/activity-panel/panels/help.js:53
msgid "Store Management"
msgstr ""

#: client/header/activity-panel/panels/help.js:58
msgid "Store Setup Checklist"
msgstr ""

#: client/header/activity-panel/panels/help.js:68
msgid "Showcase your products and tailor your shopping experience using Blocks"
msgstr ""

#: client/header/activity-panel/panels/help.js:76
msgid "Manage Store Notice, Catalog View and Product Images"
msgstr ""

#: client/header/activity-panel/panels/help.js:84
msgid "How to choose and change a theme"
msgstr ""

#: client/header/activity-panel/panels/help.js:99
msgid "Get started with Mailpoet"
msgstr ""

#: client/header/activity-panel/panels/inbox/abbreviated-notifications-panel.js:102
msgid "Orders to fulfill"
msgstr ""

# Number of orders the user has to fulfill
#: client/header/activity-panel/panels/inbox/abbreviated-notifications-panel.js:107
msgid "You have %d order to fulfill"
msgid_plural "You have %d orders to fulfill"
msgstr[0] ""
msgstr[1] ""

#: client/header/activity-panel/panels/inbox/abbreviated-notifications-panel.js:129
msgid "Reviews to moderate"
msgstr ""

# Number of reviews the user has to moderate
#: client/header/activity-panel/panels/inbox/abbreviated-notifications-panel.js:134
msgid "You have %d review to moderate"
msgid_plural "You have %d reviews to moderate"
msgstr[0] ""
msgstr[1] ""

#: client/header/activity-panel/panels/inbox/abbreviated-notifications-panel.js:156
msgid "Inventory to review"
msgstr ""

#: client/header/activity-panel/panels/inbox/abbreviated-notifications-panel.js:159
msgid "You have inventory to review and update"
msgstr ""

# Things the user has to do
#: client/header/activity-panel/panels/inbox/abbreviated-notifications-panel.js:80
msgid "You have %d new thing to do"
msgid_plural "You have %d new things to do"
msgstr[0] ""
msgstr[1] ""

#: client/header/activity-panel/tab/index.js:40
msgid "unread activity"
msgstr ""

# 1: document title. 2: page title
#: client/header/index.js:133
msgid "%1$s &lsaquo; %2$s &#8212; WooCommerce"
msgstr ""

#: client/header/index.js:71
msgid "Add tax rates"
msgstr ""

#: client/header/index.js:72
msgid "Personalize your store"
msgstr ""

#: client/header/index.js:74
#: client/store-management-links/index.js:43
msgid "Add products"
msgstr ""

#: client/header/index.js:75
msgid "Set up shipping costs"
msgstr ""

#: client/homescreen/activity-panel/orders/index.js:104
msgid "{{orderLink}}Order #%(orderNumber)s{{/orderLink}} %(customerString)s"
msgstr ""

#: client/homescreen/activity-panel/orders/index.js:176
msgid "%d product"
msgid_plural "%d products"
msgstr[0] ""
msgstr[1] ""

#: client/homescreen/activity-panel/orders/index.js:205
msgid "Manage all orders"
msgstr ""

#: client/homescreen/activity-panel/orders/index.js:277
msgid ""
"You currently don't have any actionable statuses. To display orders here, "
"select orders that require further review in settings."
msgstr ""

#: client/homescreen/activity-panel/orders/index.js:290
msgid "There was an error getting your orders. Please try again."
msgstr ""

#: client/homescreen/activity-panel/orders/index.js:51
msgid "You’ve fulfilled all your orders"
msgstr ""

#: client/homescreen/activity-panel/panels.js:70
msgid "Reviews"
msgstr ""

#: client/homescreen/activity-panel/reviews/index.js:108
msgid "Review successfully updated."
msgstr ""

#: client/homescreen/activity-panel/reviews/index.js:115
#: client/homescreen/activity-panel/stock/card.js:102
#: client/inbox-panel/index.js:211
#: client/task-list/task-list.js:190
msgid "Undo"
msgstr ""

#: client/homescreen/activity-panel/reviews/index.js:135
msgid "Review could not be updated."
msgstr ""

#: client/homescreen/activity-panel/reviews/index.js:169
msgid ""
"{{authorLink}}%s{{/authorLink}}{{verifiedCustomerIcon/}} reviewed "
"{{productLink}}%s{{/productLink}}"
msgstr ""

#: client/homescreen/activity-panel/reviews/index.js:197
msgid "Verified owner"
msgstr ""

#: client/homescreen/activity-panel/reviews/index.js:257
msgid "Approve"
msgstr ""

#: client/homescreen/activity-panel/reviews/index.js:267
msgid "Mark as spam"
msgstr ""

#: client/homescreen/activity-panel/reviews/index.js:278
#: packages/experimental/build-module/experimental-list/task-item.js:100
msgid "Delete"
msgstr ""

#: client/homescreen/activity-panel/reviews/index.js:317
msgid "Manage all reviews"
msgstr ""

#: client/homescreen/activity-panel/reviews/index.js:327
msgid "There was an error getting your reviews. Please try again."
msgstr ""

#: client/homescreen/activity-panel/reviews/index.js:64
msgid "Review successfully deleted."
msgstr ""

#: client/homescreen/activity-panel/reviews/index.js:91
msgid "Review could not be deleted."
msgstr ""

# %s = name of the product having stock updated
#: client/homescreen/activity-panel/stock/card.js:120
msgid "%s stock could not be updated"
msgstr ""

#: client/homescreen/activity-panel/stock/card.js:137
#: client/task-list/tasks/PaymentGatewaySuggestions/plugins/Bacs.js:160
#: client/wp-admin-scripts/beta-features-tracking-modal/container.js:105
msgid "Save"
msgstr ""

#: client/homescreen/activity-panel/stock/card.js:140
#: packages/customer-effort-score/build-module/customer-feedback-modal/index.js:77
#: packages/experimental/build-module/inbox-note/inbox-dismiss-confirmation-modal.js:13
msgid "Cancel"
msgstr ""

#: client/homescreen/activity-panel/stock/card.js:147
msgid "Update stock"
msgstr ""

#: client/homescreen/activity-panel/stock/card.js:171
msgid "in stock"
msgstr ""

# %d = stock quantity of the product being updated
#: client/homescreen/activity-panel/stock/card.js:187
msgid "%d in stock"
msgstr ""

# %s = time since last product order. e.g.: "10 minutes ago" - translated.
#: client/homescreen/activity-panel/stock/card.js:205
msgid "Last ordered %s"
msgstr ""

# %s = name of the product having stock updated
#: client/homescreen/activity-panel/stock/card.js:96
msgid "%s stock updated"
msgstr ""

#: client/homescreen/activity-panel/stock/index.js:91
msgid "There was an error getting your low stock products. Please try again."
msgstr ""

#: client/homescreen/layout.js:96
msgid "Your store today"
msgstr ""

#: client/homescreen/layout.js:97
msgid "To do's, tips, and insights for your business"
msgstr ""

#: client/homescreen/stats-overview/index.js:128
#: packages/date/build-module/index.js:29
msgid "Today"
msgstr ""

#: client/homescreen/stats-overview/index.js:132
#: packages/date/build-module/index.js:31
msgid "Week to date"
msgstr ""

#: client/homescreen/stats-overview/index.js:136
#: packages/date/build-module/index.js:33
msgid "Month to date"
msgstr ""

#: client/homescreen/stats-overview/index.js:168
msgid "View detailed stats"
msgstr ""

#: client/homescreen/stats-overview/index.js:70
msgid "Stats overview"
msgstr ""

#: client/homescreen/stats-overview/index.js:87
#: packages/components/build-module/table/index.js:130
msgid "Choose which values to display"
msgstr ""

#: client/homescreen/stats-overview/install-jetpack-cta.js:24
msgid "Get Jetpack"
msgstr ""

#: client/homescreen/stats-overview/install-jetpack-cta.js:25
msgid "Activate Jetpack"
msgstr ""

#: client/homescreen/stats-overview/install-jetpack-cta.js:26
msgid "Connect Jetpack"
msgstr ""

#: client/homescreen/stats-overview/install-jetpack-cta.js:41
msgid "Get traffic stats with Jetpack"
msgstr ""

#: client/homescreen/stats-overview/install-jetpack-cta.js:47
msgid ""
"Keep an eye on your views and visitors metrics with Jetpack. Requires "
"Jetpack plugin and a WordPress.com account."
msgstr ""

#: client/homescreen/welcome-from-calypso-modal/welcome-from-calypso-modal.js:28
msgid ""
"We've designed your navigation and home screen to help you focus on the "
"things that matter most in managing your online store. {{link}}Learn "
"more{{/link}} about these changes – or explore on your own."
msgstr ""

#: client/homescreen/welcome-modal/index.js:23
msgid "Welcome to your WooCommerce store’s online HQ!"
msgstr ""

#: client/homescreen/welcome-modal/index.js:27
msgid ""
"Here's where you’ll find setup suggestions, tips and tools, and key data on "
"your store’s performance and earnings — all the basics for store management "
"and growth."
msgstr ""

#: client/homescreen/welcome-modal/index.js:38
msgid "A personalized inbox full of relevant advice"
msgstr ""

#: client/homescreen/welcome-modal/index.js:42
msgid ""
"Check your inbox for helpful growth tips tailored to your store and "
"notifications about key traffic and sales milestones. We look forward to "
"celebrating them with you!"
msgstr ""

#: client/homescreen/welcome-modal/index.js:53
msgid "Good data leads to smart business decisions"
msgstr ""

#: client/homescreen/welcome-modal/index.js:57
msgid ""
"Monitor your stats to improve performance, increase sales, and track your "
"progress toward revenue goals. The more you know, the better you can serve "
"your customers and grow your store."
msgstr ""

#: client/inbox-panel/index.js:206
msgid "All messages dismissed"
msgstr ""

#: client/inbox-panel/index.js:207
msgid "Message dismissed"
msgstr ""

#: client/inbox-panel/index.js:236
msgid "Message could not be dismissed"
msgid_plural "Messages could not be dismissed"
msgstr[0] ""
msgstr[1] ""

#: client/inbox-panel/index.js:255
msgid "There was an error getting your inbox. Please try again."
msgstr ""

#: client/inbox-panel/index.js:32
msgid "Your inbox is empty"
msgstr ""

#: client/inbox-panel/index.js:35
msgid ""
"As things begin to happen in your store your inbox will start to fill up. "
"You'll see things like achievements, new feature announcements, extension "
"recommendations and more!"
msgstr ""

#: client/layout/store-alerts/index.js:110
msgid "Next Week"
msgstr ""

#: client/layout/store-alerts/index.js:121
msgid "Next Month"
msgstr ""

#: client/layout/store-alerts/index.js:145
msgid "Remind Me Later"
msgstr ""

#: client/layout/store-alerts/index.js:224
msgid "Previous Alert"
msgstr ""

#: client/layout/store-alerts/index.js:240
msgid "{{current /}} of {{total /}}"
msgstr ""

#: client/layout/store-alerts/index.js:261
msgid "Next Alert"
msgstr ""

#: client/layout/store-alerts/index.js:88
msgid "Later Today"
msgstr ""

#: client/layout/store-alerts/index.js:99
msgid "Tomorrow"
msgstr ""

#: client/layout/transient-notices/snackbar/index.js:113
msgid "Dismiss this notice"
msgstr ""

#: client/marketing/components/knowledge-base/ReadBlogMessage.js:10
msgid ""
"Read {{link}}the WooCommerce blog{{/link}} for more tips on marketing your "
"store"
msgstr ""

#: client/marketing/components/knowledge-base/index.js:116
msgid "No posts yet"
msgstr ""

#: client/marketing/components/knowledge-base/index.js:129
msgid "Oops, our posts aren't loading right now"
msgstr ""

#: client/marketing/components/knowledge-base/index.js:231
msgid "WooCommerce knowledge base"
msgstr ""

#: client/marketing/components/knowledge-base/index.js:232
msgid ""
"Learn the ins and outs of successful marketing from the experts at "
"WooCommerce."
msgstr ""

#: client/marketing/components/knowledge-base/index.js:92
msgid "By"
msgstr ""

#: client/marketing/components/recommended-extensions/index.js:100
msgid ""
"Great marketing requires the right tools. Take your marketing to the next "
"level with our recommended marketing extensions."
msgstr ""

#: client/marketing/components/recommended-extensions/index.js:99
msgid "Recommended extensions"
msgstr ""

#: client/marketing/coupons/index.js:25
msgid "Recommended coupon extensions"
msgstr ""

#: client/marketing/coupons/index.js:29
msgid ""
"Take your coupon marketing to the next level with our recommended coupon "
"extensions."
msgstr ""

#: client/marketing/coupons/index.js:38
msgid ""
"Learn the ins and outs of successful coupon marketing from the experts at "
"WooCommerce."
msgstr ""

#: client/marketing/data/actions.js:120
msgid "There was an error loading installed extensions."
msgstr ""

#: client/marketing/data/actions.js:81
msgid "The extension has been successfully activated."
msgstr ""

#: client/marketing/data/actions.js:94
msgid "There was an error trying to activate the extension."
msgstr ""

#: client/marketing/data/resolvers.js:33
msgid "There was an error loading recommended extensions."
msgstr ""

#: client/marketing/overview/installed-extensions/index.js:37
#: client/task-list/tasks/Marketing/index.tsx:185
msgid "Installed marketing extensions"
msgstr ""

#: client/marketing/overview/installed-extensions/row.js:100
#: client/task-list/tasks/Marketing/Plugin.tsx:83
msgid "Activate"
msgstr ""

#: client/marketing/overview/installed-extensions/row.js:31
msgid "Docs"
msgstr ""

#: client/marketing/overview/installed-extensions/row.js:38
msgid "Get support"
msgstr ""

#: client/marketing/overview/installed-extensions/row.js:52
msgid "Dashboard"
msgstr ""

#: client/marketing/overview/welcome-card/index.js:35
msgid "Hide"
msgstr ""

#: client/marketing/overview/welcome-card/index.js:43
msgid ""
"Grow your customer base and increase your sales with marketing tools built "
"for WooCommerce"
msgstr ""

#: client/mobile-banner/index.js:62
msgid "Run your store from anywhere"
msgstr ""

#: client/mobile-banner/index.js:68
msgid "Download the WooCommerce app"
msgstr ""

#: client/mobile-banner/index.js:86
#: client/wp-admin-scripts/payment-method-promotions/payment-promotion-row.tsx:149
msgid "Install"
msgstr ""

#: client/navigation/components/container/primary-menu.js:26
msgid "WordPress Dashboard"
msgstr ""

#: client/navigation/components/container/primary-menu.js:66
#: client/store-management-links/index.js:168
msgid "Extensions"
msgstr ""

#: client/navigation/components/favorite-button/index.js:53
msgid "Add this item to your favorites."
msgstr ""

#: client/navigation/components/favorite-button/index.js:57
msgid "Remove this item from your favorites."
msgstr ""

#: client/navigation/components/favorites-tooltip/index.js:46
msgid "Introducing favorites"
msgstr ""

#: client/navigation/components/favorites-tooltip/index.js:47
msgid ""
"You can now favorite your extensions to pin them in the top level of the "
"navigation."
msgstr ""

#: client/navigation/components/header/index.js:99
msgid "Site Icon"
msgstr ""

#: client/navigation/components/intro-modal/index.js:110
msgid "A new navigation for WooCommerce"
msgstr ""

#: client/navigation/components/intro-modal/index.js:114
msgid "All of your store management features in one place"
msgstr ""

#: client/navigation/components/intro-modal/index.js:121
msgid "Focus on managing your store"
msgstr ""

#: client/navigation/components/intro-modal/index.js:122
msgid "Give your attention to key areas of WooCommerce with little distraction"
msgstr ""

#: client/navigation/components/intro-modal/index.js:129
msgid "Easily find and favorite your extensions"
msgstr ""

#: client/navigation/components/intro-modal/index.js:133
msgid "They'll appear in the top level of the navigation for quick access"
msgstr ""

#: client/payments/payment-recommendations.tsx:176
#: client/shipping/woocommerce-services-item.tsx:64
#: client/task-list/tasks/PaymentGatewaySuggestions/components/WCPay/Suggestion.js:56
#: client/task-list/tasks/products/products.js:37
#: packages/onboarding/build-module/components/RecommendedRibbon/RecommendedRibbon.js:9
msgid "Recommended"
msgstr ""

#: client/payments/payment-recommendations.tsx:207
msgid "Recommended ways to get paid"
msgstr ""

#: client/payments/payment-recommendations.tsx:221
msgid ""
"We recommend adding one of the following payment extensions to your store. "
"The extension will be installed and activated for you when you click \"Get "
"started\"."
msgstr ""

#: client/payments/payment-recommendations.tsx:229
#: client/settings-recommendations/dismissable-list.tsx:40
#: client/task-list/task-list.js:261
msgid "Task List Options"
msgstr ""

#: client/payments/payment-recommendations.tsx:235
#: client/settings-recommendations/dismissable-list.tsx:44
#: client/task-list/task-list.js:267
msgid "Hide this"
msgstr ""

#: client/payments/payment-recommendations.tsx:245
#: client/shipping/shipping-recommendations.tsx:89
msgid "See more options"
msgstr ""

#: client/profile-wizard/index.js:102
msgid "Store Details"
msgstr ""

#: client/profile-wizard/index.js:110
msgid "Industry"
msgstr ""

#: client/profile-wizard/index.js:118
msgid "Product Types"
msgstr ""

#: client/profile-wizard/index.js:126
msgid "Business Details"
msgstr ""

#: client/profile-wizard/index.js:134
msgid "Theme"
msgstr ""

#: client/profile-wizard/index.js:235
msgid "There was a problem skipping the setup wizard"
msgstr ""

#: client/profile-wizard/index.js:60
msgid "There was a problem finishing the setup wizard"
msgstr ""

#: client/profile-wizard/steps/business-details/data/platform-options.js:13
msgid "BigCommerce"
msgstr ""

#: client/profile-wizard/steps/business-details/data/platform-options.js:17
msgid "Magento"
msgstr ""

#: client/profile-wizard/steps/business-details/data/platform-options.js:21
msgid "Wix"
msgstr ""

#: client/profile-wizard/steps/business-details/data/platform-options.js:25
msgid "Amazon"
msgstr ""

#: client/profile-wizard/steps/business-details/data/platform-options.js:29
msgid "eBay"
msgstr ""

#: client/profile-wizard/steps/business-details/data/platform-options.js:33
msgid "Etsy"
msgstr ""

#: client/profile-wizard/steps/business-details/data/platform-options.js:37
msgid "Squarespace"
msgstr ""

#: client/profile-wizard/steps/business-details/data/platform-options.js:9
msgid "Shopify"
msgstr ""

#: client/profile-wizard/steps/business-details/data/product-options.js:38
msgid "I don't have any products yet."
msgstr ""

# %s: $0 revenue amount
#: client/profile-wizard/steps/business-details/data/revenue-options.js:49
msgid "%s (I'm just getting started)"
msgstr ""

# %s: A given revenue amount, e.g., $2500
#: client/profile-wizard/steps/business-details/data/revenue-options.js:57
msgid "Up to %s"
msgstr ""

# %s: A given revenue amount, e.g., $250000
#: client/profile-wizard/steps/business-details/data/revenue-options.js:92
msgid "More than %s"
msgstr ""

#: client/profile-wizard/steps/business-details/data/revenue-options.js:98
msgid "I'd rather not say"
msgstr ""

#: client/profile-wizard/steps/business-details/data/selling-venue-options.js:13
msgid "Yes, on another platform"
msgstr ""

#: client/profile-wizard/steps/business-details/data/selling-venue-options.js:17
msgid "Yes, I own a different store powered by WooCommerce"
msgstr ""

#: client/profile-wizard/steps/business-details/data/selling-venue-options.js:24
msgid "Yes, in person at physical stores and/or events"
msgstr ""

#: client/profile-wizard/steps/business-details/data/selling-venue-options.js:31
msgid "Yes, on another platform and in person at physical stores and/or events"
msgstr ""

#: client/profile-wizard/steps/business-details/flows/selective-bundle/index.js:175
msgid "There was a problem updating your business details"
msgstr ""

#: client/profile-wizard/steps/business-details/flows/selective-bundle/index.js:230
msgid "This field is required"
msgstr ""

#: client/profile-wizard/steps/business-details/flows/selective-bundle/index.js:305
msgid "Tell us about your business"
msgstr ""

#: client/profile-wizard/steps/business-details/flows/selective-bundle/index.js:311
msgid ""
"We'd love to know if you are just getting started or you already have a "
"business in place."
msgstr ""

#: client/profile-wizard/steps/business-details/flows/selective-bundle/index.js:321
msgid "How many products do you plan to display?"
msgstr ""

#: client/profile-wizard/steps/business-details/flows/selective-bundle/index.js:332
msgid "Currently selling elsewhere?"
msgstr ""

#: client/profile-wizard/steps/business-details/flows/selective-bundle/index.js:349
msgid "What's your current annual revenue?"
msgstr ""

#: client/profile-wizard/steps/business-details/flows/selective-bundle/index.js:374
msgid "Which platform is the store using?"
msgstr ""

#: client/profile-wizard/steps/business-details/flows/selective-bundle/index.js:387
msgid "What is the platform name?"
msgstr ""

#: client/profile-wizard/steps/business-details/flows/selective-bundle/index.js:405
msgid "I'm setting up a store for a client"
msgstr ""

#: client/profile-wizard/steps/business-details/flows/selective-bundle/index.js:427
#: client/profile-wizard/steps/business-details/flows/selective-bundle/selective-extensions-bundle/index.js:338
#: client/profile-wizard/steps/industry.js:260
#: client/profile-wizard/steps/product-types/index.js:256
#: client/profile-wizard/steps/store-details/index.js:382
#: client/task-list/tasks/steps/location.js:96
#: packages/components/build-module/plugins/index.js:70
msgid "Continue"
msgstr ""

#: client/profile-wizard/steps/business-details/flows/selective-bundle/index.js:443
#: packages/components/build-module/plugins/index.js:63
msgid "Continue without installing"
msgstr ""

#: client/profile-wizard/steps/business-details/flows/selective-bundle/index.js:473
msgid "Included business features"
msgstr ""

#: client/profile-wizard/steps/business-details/flows/selective-bundle/index.js:479
msgid "We recommend enhancing your store with these free extensions"
msgstr ""

#: client/profile-wizard/steps/business-details/flows/selective-bundle/index.js:485
msgid "No commitment required - you can remove them at any time."
msgstr ""

#: client/profile-wizard/steps/business-details/flows/selective-bundle/index.js:530
msgid "Business details"
msgstr ""

#: client/profile-wizard/steps/business-details/flows/selective-bundle/index.js:538
msgid "Free features"
msgstr ""

#: client/profile-wizard/steps/business-details/flows/selective-bundle/selective-extensions-bundle/index.js:101
msgid ""
"By installing Jetpack and WooCommerce Shipping plugins for free you agree "
"to our {{link}}Terms of Service{{/link}}."
msgstr ""

#: client/profile-wizard/steps/business-details/flows/selective-bundle/selective-extensions-bundle/index.js:280
msgid "Add recommended business features to my site"
msgstr ""

#: client/profile-wizard/steps/business-details/flows/selective-bundle/selective-extensions-bundle/index.js:33
#: client/profile-wizard/steps/theme/index.js:278
msgid "Free"
msgstr ""

# %s: a comma separated list of plugins, e.g. Jetpack, Woocommerce Shipping
#: client/profile-wizard/steps/business-details/flows/selective-bundle/selective-extensions-bundle/index.js:62
msgid "Installing the following plugin: %s"
msgid_plural "Installing the following plugins: %s"
msgstr[0] ""
msgstr[1] ""

#: client/profile-wizard/steps/business-details/flows/selective-bundle/selective-extensions-bundle/index.js:79
msgid "User accounts are required to use these features."
msgstr ""

# %1$s: a comma separated list of plugins, e.g. Jetpack, Woocommerce Shipping, %2$s: text: 'User accounts are required to use these features.'
#: client/profile-wizard/steps/business-details/flows/selective-bundle/selective-extensions-bundle/index.js:88
msgid "The following plugin will be installed for free: %1$s. %2$s"
msgid_plural "The following plugins will be installed for free: %1$s. %2$s"
msgstr[0] ""
msgstr[1] ""

#: client/profile-wizard/steps/industry.js:104
msgid "There was a problem updating your industries"
msgstr ""

#: client/profile-wizard/steps/industry.js:115
msgid "Please select at least one industry"
msgstr ""

#: client/profile-wizard/steps/industry.js:211
msgid "In which industry does the store operate?"
msgstr ""

#: client/profile-wizard/steps/industry.js:217
#: client/profile-wizard/steps/product-types/index.js:201
msgid "Choose any that apply"
msgstr ""

#: client/profile-wizard/steps/product-types/index.js:134
msgid "There was a problem updating your product types"
msgstr ""

#: client/profile-wizard/steps/product-types/index.js:195
msgid "What type of products will be listed?"
msgstr ""

#: client/profile-wizard/steps/product-types/index.js:264
msgid "Display monthly prices"
msgstr ""

#: client/profile-wizard/steps/product-types/index.js:281
msgid ""
"Billing is annual. All purchases are covered by our 30 day money back "
"guarantee and include access to support and updates. Extensions will be "
"added to a cart for you to purchase later."
msgstr ""

#: client/profile-wizard/steps/product-types/index.js:297
msgid ""
"The following extensions will be added to your site for free: WooCommerce "
"Payments. An account is required to use this feature."
msgstr ""

#: client/profile-wizard/steps/product-types/index.js:80
msgid "Please select at least one product type"
msgstr ""

#: client/profile-wizard/steps/product-types/label.js:26
msgid ""
"This product type requires a paid extension.\n"
"We'll add this to a cart so that\n"
"you can purchase and install it later."
msgstr ""

#: client/profile-wizard/steps/product-types/label.js:39
msgid "Learn more about recommended free business features"
msgstr ""

# Dollar amount (example: $4.08 )
#: client/profile-wizard/steps/product-types/label.js:88
msgid "$%f per month"
msgstr ""

# Dollar amount (example: $49.00 )
#: client/profile-wizard/steps/product-types/label.js:93
msgid "$%f per year"
msgstr ""

#: client/profile-wizard/steps/store-details/index.js:188
msgid "There was a problem saving your store details"
msgstr ""

#: client/profile-wizard/steps/store-details/index.js:207
msgid "Please add an email address"
msgstr ""

#: client/profile-wizard/steps/store-details/index.js:236
msgid ""
"Manual setup is only recommended for\n"
" experienced WooCommerce users or developers."
msgstr ""

#: client/profile-wizard/steps/store-details/index.js:241
msgid ""
"Your store address will help us configure currency\n"
" options and shipping rules automatically.\n"
" This information will not be publicly visible and can\n"
" easily be changed later."
msgstr ""

#: client/profile-wizard/steps/store-details/index.js:264
msgid "Welcome to WooCommerce"
msgstr ""

#: client/profile-wizard/steps/store-details/index.js:267
msgid "Tell us about your store and we'll get you set up in no time"
msgstr ""

#: client/profile-wizard/steps/store-details/index.js:274
msgid "Learn more about store details"
msgstr ""

#: client/profile-wizard/steps/store-details/index.js:339
msgid "Email address"
msgstr ""

#: client/profile-wizard/steps/store-details/index.js:355
msgid "Get tips, product updates and inspiration straight to your mailbox."
msgstr ""

#: client/profile-wizard/steps/store-details/index.js:360
msgid "Powered by Mailchimp"
msgstr ""

#: client/profile-wizard/steps/store-details/index.js:400
msgid "Skip setup store details"
msgstr ""

#: client/profile-wizard/steps/theme/index.js:117
msgid "%s was installed on your site"
msgstr ""

#: client/profile-wizard/steps/theme/index.js:143
msgid "%s was activated on your site"
msgstr ""

#: client/profile-wizard/steps/theme/index.js:213
msgid "This theme does not support WooCommerce."
msgstr ""

#: client/profile-wizard/steps/theme/index.js:240
msgid "Continue with my active theme"
msgstr ""

#: client/profile-wizard/steps/theme/index.js:252
#: client/profile-wizard/steps/theme/preview.js:111
msgid "Choose"
msgstr ""

#: client/profile-wizard/steps/theme/index.js:260
msgid "Live demo"
msgstr ""

#: client/profile-wizard/steps/theme/index.js:273
msgid "Currently active theme"
msgstr ""

#: client/profile-wizard/steps/theme/index.js:276
msgid "Installed"
msgstr ""

#: client/profile-wizard/steps/theme/index.js:282
msgid "%s per year"
msgstr ""

#: client/profile-wizard/steps/theme/index.js:367
msgid "Choose a theme"
msgstr ""

#: client/profile-wizard/steps/theme/index.js:370
msgid ""
"Choose how your store appears to customers. And don't worry, you can always "
"switch themes and edit them later."
msgstr ""

#: client/profile-wizard/steps/theme/index.js:383
msgid "All themes"
msgstr ""

#: client/profile-wizard/steps/theme/index.js:387
msgid "Paid themes"
msgstr ""

#: client/profile-wizard/steps/theme/index.js:391
msgid "Free themes"
msgstr ""

#: client/profile-wizard/steps/theme/index.js:422
msgid "Skip this step"
msgstr ""

#: client/profile-wizard/steps/theme/index.js:76
msgid "There was a problem selecting your store theme"
msgstr ""

#: client/profile-wizard/steps/theme/preview.js:73
msgid "{{strong}}%s{{/strong}} developed by WooCommerce"
msgstr ""

#: client/profile-wizard/steps/theme/uploader.js:104
msgid "Upload a theme"
msgstr ""

#: client/profile-wizard/steps/theme/uploader.js:110
msgid "Drop a theme zip file here to upload"
msgstr ""

#: client/profile-wizard/steps/theme/uploader.js:117
msgid "Drop your theme zip file here"
msgstr ""

#: client/profile-wizard/steps/theme/uploader.js:128
msgid "Uploading theme"
msgstr ""

#: client/profile-wizard/steps/theme/uploader.js:131
msgid "Your theme is being uploaded"
msgstr ""

#: client/profile-wizard/steps/usage-modal.js:113
msgid "Build a better WooCommerce"
msgstr ""

#: client/profile-wizard/steps/usage-modal.js:115
msgid ""
"Get improved features and faster fixes by sharing non-sensitive data via "
"{{link}}usage tracking{{/link}} that shows us how WooCommerce is used. No "
"personal data is tracked or stored."
msgstr ""

#: client/profile-wizard/steps/usage-modal.js:131
msgid "Yes, count me in!"
msgstr ""

#: client/profile-wizard/steps/usage-modal.js:54
msgid "There was a problem updating your preferences"
msgstr ""

#: client/shipping/shipping-recommendations.tsx:62
msgid "Recommended shipping solutions"
msgstr ""

#: client/shipping/shipping-recommendations.tsx:71
msgid ""
"We recommend adding one of the following shipping extensions to your store. "
"The extension will be installed and activated for you when you click \"Get "
"started\"."
msgstr ""

#: client/shipping/shipping-recommendations.tsx:91
msgid "(opens in a new tab)"
msgstr ""

#: client/shipping/woocommerce-services-item.tsx:33
msgid "Finish the setup by connecting your store to Jetpack."
msgstr ""

#: client/shipping/woocommerce-services-item.tsx:41
msgid "🎉 WooCommerce Shipping is installed!"
msgstr ""

#: client/shipping/woocommerce-services-item.tsx:63
msgid "Woocommerce Shipping"
msgstr ""

#: client/shipping/woocommerce-services-item.tsx:67
msgid ""
"Print USPS and DHL Express labels straight from your WooCommerce dashboard "
"and save on shipping."
msgstr ""

#: client/store-management-links/index.js:180
msgid "Store management"
msgstr ""

#: client/store-management-links/index.js:31
msgid "Marketing & Merchandising"
msgstr ""

#: client/store-management-links/index.js:61
msgid "View my store"
msgstr ""

#: client/store-management-links/index.js:84
msgid "Payments"
msgstr ""

#: client/store-management-links/index.js:93
msgid "Tax"
msgstr ""

#: client/task-list/index.js:344
msgid "Show things to do next"
msgstr ""

#: client/task-list/task-list.js:151
msgid "Task dismissed"
msgstr ""

#: client/task-list/task-list.js:186
msgid "Task postponed until tomorrow"
msgstr ""

# %i = number of hidden tasks
#: client/task-list/task-list.js:300
msgid "Show %i more task."
msgid_plural "Show %i more tasks."
msgstr[0] ""
msgstr[1] ""

#: client/task-list/task-list.js:308
msgid "Show less"
msgstr ""

#: client/task-list/tasks.js:268
msgid ""
"By setting up, you are agreeing to the <a "
"href=\"https://wordpress.com/tos/\" target=\"_blank\">Terms of Service</a>"
msgstr ""

# %s = name of the plugin
#: client/task-list/tasks/Marketing/Plugin.tsx:48
msgid "%s logo"
msgstr ""

#: client/task-list/tasks/Marketing/Plugin.tsx:73
#: client/task-list/tasks/PaymentGatewaySuggestions/components/Action.js:62
msgid "Manage"
msgstr ""

#: client/task-list/tasks/Marketing/index.tsx:206
msgid "Recommended marketing extensions"
msgstr ""

#: client/task-list/tasks/Marketing/index.tsx:212
msgid ""
"We recommend adding one of the following marketing tools for your store. "
"The extension will be installed and activated for you when you click \"Get "
"started\"."
msgstr ""

#: client/task-list/tasks/PaymentGatewaySuggestions/components/Action.js:23
#: client/task-list/tasks/PaymentGatewaySuggestions/components/Setup/Configure.js:162
msgid "Set up"
msgstr ""

#: client/task-list/tasks/PaymentGatewaySuggestions/components/Setup/Configure.js:103
#: client/task-list/tasks/appearance.js:343
#: client/task-list/tasks/shipping/index.js:213
#: packages/components/build-module/dynamic-form/dynamic-form.js:23
msgid "Proceed"
msgstr ""

#: client/task-list/tasks/PaymentGatewaySuggestions/components/Setup/Configure.js:155
msgid "You can manage this payment gateway's settings by clicking the button below"
msgstr ""

# %s = title of the payment gateway
#: client/task-list/tasks/PaymentGatewaySuggestions/components/Setup/Configure.js:75
msgid "%s configured successfully"
msgstr ""

#: client/task-list/tasks/PaymentGatewaySuggestions/components/Setup/Configure.js:87
#: client/task-list/tasks/PaymentGatewaySuggestions/plugins/Bacs.js:63
msgid "There was a problem saving your payment settings"
msgstr ""

#: client/task-list/tasks/PaymentGatewaySuggestions/components/Setup/Setup.js:123
msgid "Configure your %(title)s account"
msgstr ""

# %s = title of the payment gateway to install
#: client/task-list/tasks/PaymentGatewaySuggestions/components/Setup/Setup.js:91
msgid "Install %s"
msgstr ""

#: client/task-list/tasks/PaymentGatewaySuggestions/components/WCPay/Suggestion.js:25
msgid ""
"Upon clicking \"Get started\", you agree to the {{link}}Terms of "
"service{{/link}}. Next we’ll ask you to share a few details about your "
"business to create your account."
msgstr ""

#: client/task-list/tasks/PaymentGatewaySuggestions/components/WCPay/UsageModal.js:29
msgid "Help us build a better WooCommerce Payments experience"
msgstr ""

#: client/task-list/tasks/PaymentGatewaySuggestions/components/WCPay/UsageModal.js:34
msgid ""
"By agreeing to share non-sensitive {{link}}usage data{{/link}}, you’ll help "
"us improve features and optimize the WooCommerce Payments experience. You "
"can opt out at any time."
msgstr ""

#: client/task-list/tasks/PaymentGatewaySuggestions/components/WCPay/UsageModal.js:54
msgid "I agree"
msgstr ""

#: client/task-list/tasks/PaymentGatewaySuggestions/components/WCPay/utils.js:19
msgid ""
"There was an error connecting to WooCommerce Payments. Please try again or "
"connect later in store settings."
msgstr ""

#: client/task-list/tasks/PaymentGatewaySuggestions/index.js:215
msgid "Enabled payment gateways"
msgstr ""

#: client/task-list/tasks/PaymentGatewaySuggestions/index.js:226
msgid "Additional payment gateways"
msgstr ""

#: client/task-list/tasks/PaymentGatewaySuggestions/plugins/Bacs.js:109
msgid "Account number"
msgstr ""

#: client/task-list/tasks/PaymentGatewaySuggestions/plugins/Bacs.js:119
msgid "Bank name"
msgstr ""

#: client/task-list/tasks/PaymentGatewaySuggestions/plugins/Bacs.js:129
msgid "Sort code"
msgstr ""

#: client/task-list/tasks/PaymentGatewaySuggestions/plugins/Bacs.js:139
msgid "IBAN"
msgstr ""

#: client/task-list/tasks/PaymentGatewaySuggestions/plugins/Bacs.js:147
msgid "BIC / Swift"
msgstr ""

#: client/task-list/tasks/PaymentGatewaySuggestions/plugins/Bacs.js:32
msgid "Please enter an account number or IBAN"
msgstr ""

#: client/task-list/tasks/PaymentGatewaySuggestions/plugins/Bacs.js:53
msgid "Direct bank transfer details added successfully"
msgstr ""

#: client/task-list/tasks/PaymentGatewaySuggestions/plugins/Bacs.js:86
msgid "Add your bank details"
msgstr ""

#: client/task-list/tasks/PaymentGatewaySuggestions/plugins/Bacs.js:92
msgid "These details are required to receive payments via bank transfer"
msgstr ""

#: client/task-list/tasks/PaymentGatewaySuggestions/plugins/Bacs.js:99
msgid "Account name"
msgstr ""

#: client/task-list/tasks/appearance.js:118
msgid "There was an error importing some of the sample products"
msgstr ""

#: client/task-list/tasks/appearance.js:126
msgid "All sample products have been imported"
msgstr ""

#: client/task-list/tasks/appearance.js:161
msgid "Customize"
msgstr ""

#: client/task-list/tasks/appearance.js:213
msgid "Store logo updated sucessfully"
msgstr ""

#: client/task-list/tasks/appearance.js:246
msgid "🎨 Your store is looking great! Don't forget to continue personalizing it"
msgstr ""

#: client/task-list/tasks/appearance.js:269
msgid "Import sample products"
msgstr ""

#: client/task-list/tasks/appearance.js:270
msgid ""
"We’ll add some products that will make it easier to see what your store "
"looks like"
msgstr ""

#: client/task-list/tasks/appearance.js:281
msgid "Import products"
msgstr ""

#: client/task-list/tasks/appearance.js:292
msgid "Create a custom homepage"
msgstr ""

#: client/task-list/tasks/appearance.js:293
msgid "Create a new homepage and customize it to suit your needs"
msgstr ""

#: client/task-list/tasks/appearance.js:304
msgid "Create homepage"
msgstr ""

#: client/task-list/tasks/appearance.js:324
msgid "Upload a logo"
msgstr ""

#: client/task-list/tasks/appearance.js:325
msgid "Ensure your store is on-brand by adding your logo"
msgstr ""

#: client/task-list/tasks/appearance.js:349
msgid "Skip"
msgstr ""

#: client/task-list/tasks/appearance.js:357
msgid "Set a store notice"
msgstr ""

#: client/task-list/tasks/appearance.js:358
msgid "Optionally display a prominent notice across all pages of your store"
msgstr ""

#: client/task-list/tasks/appearance.js:369
msgid "Store notice text"
msgstr ""

#: client/task-list/tasks/appearance.js:379
#: client/task-list/tasks/shipping/index.js:214
msgid "Complete task"
msgstr ""

#: client/task-list/tasks/products/product-template-modal.js:143
#: client/task-list/tasks/products/products.js:36
msgid "Start with a template"
msgstr ""

#: client/task-list/tasks/products/product-template-modal.js:177
msgid "Go"
msgstr ""

#: client/task-list/tasks/products/product-template-modal.js:31
msgid "Physical product"
msgstr ""

#: client/task-list/tasks/products/product-template-modal.js:32
msgid "Tangible items that get delivered to customers"
msgstr ""

#: client/task-list/tasks/products/product-template-modal.js:39
msgid "Digital product"
msgstr ""

#: client/task-list/tasks/products/product-template-modal.js:40
msgid "Items that customers download or access through your website"
msgstr ""

#: client/task-list/tasks/products/product-template-modal.js:47
msgid "Variable product"
msgstr ""

#: client/task-list/tasks/products/product-template-modal.js:48
msgid "Products with several versions that customers can choose from"
msgstr ""

#: client/task-list/tasks/products/product-template-modal.js:55
msgid "Subscription product"
msgstr ""

#: client/task-list/tasks/products/product-template-modal.js:56
msgid ""
"Products that customers receive or gain access to regularly by paying in "
"advance"
msgstr ""

#: client/task-list/tasks/products/products.js:130
msgid "Use a template to add physical, digital, variable, and subscription products"
msgstr ""

#: client/task-list/tasks/products/products.js:40
msgid "Use a template to add physical, digital, and variable products"
msgstr ""

#: client/task-list/tasks/products/products.js:53
msgid "Add manually"
msgstr ""

#: client/task-list/tasks/products/products.js:54
msgid "For small stores we recommend adding products manually"
msgstr ""

#: client/task-list/tasks/products/products.js:68
msgid "Import via CSV"
msgstr ""

#: client/task-list/tasks/products/products.js:69
msgid "For larger stores we recommend importing all products at once via CSV file"
msgstr ""

#: client/task-list/tasks/products/products.js:83
msgid "Import from another service"
msgstr ""

#: client/task-list/tasks/products/products.js:84
msgid ""
"For stores currently selling elsewhere we suggest using a product migration "
"service"
msgstr ""

#: client/task-list/tasks/shipping/index.js:149
msgid "📦 Shipping is done! Don't worry, you can always change it later"
msgstr ""

#: client/task-list/tasks/shipping/index.js:180
#: client/task-list/tasks/tax.js:223
msgid "Set store location"
msgstr ""

#: client/task-list/tasks/shipping/index.js:181
#: client/task-list/tasks/tax.js:224
msgid "The address from which your business operates"
msgstr ""

#: client/task-list/tasks/shipping/index.js:203
msgid "Set shipping costs"
msgstr ""

#: client/task-list/tasks/shipping/index.js:204
msgid "Define how much customers pay to ship to different destinations"
msgstr ""

#: client/task-list/tasks/shipping/index.js:228
msgid "Enable shipping label printing"
msgstr ""

#: client/task-list/tasks/shipping/index.js:236
msgid ""
"We recommend using ShipStation to save time at the post office by printing "
"your shipping labels at home. Try ShipStation free for 30 days. "
"{{link}}Learn more{{/link}}."
msgstr ""

#: client/task-list/tasks/shipping/index.js:251
msgid ""
"With WooCommerce Shipping you can save time by printing your USPS and DHL "
"Express shipping labels at home"
msgstr ""

#: client/task-list/tasks/shipping/index.js:284
#: client/task-list/tasks/tax.js:322
msgid "Connect your store"
msgstr ""

#: client/task-list/tasks/shipping/index.js:285
msgid "Connect your store to WordPress.com to enable label printing"
msgstr ""

#: client/task-list/tasks/shipping/index.js:68
msgid "Rest of the world"
msgstr ""

#: client/task-list/tasks/shipping/rates.js:125
msgid "Your shipping rates have been updated"
msgstr ""

#: client/task-list/tasks/shipping/rates.js:155
msgid "Free shipping"
msgstr ""

#: client/task-list/tasks/shipping/rates.js:203
msgid "Shipping rates can not be negative numbers."
msgstr ""

#: client/task-list/tasks/shipping/rates.js:285
msgid "Shipping cost"
msgstr ""

#: client/task-list/tasks/shipping/rates.js:322
#: packages/components/build-module/date-range-filter-picker/content.js:64
msgid "Update"
msgstr ""

#: client/task-list/tasks/steps/location.js:48
msgid "There was a problem saving your store location"
msgstr ""

#: client/task-list/tasks/tax.js:149
msgid "You're awesome! One less item on your to-do list ✅"
msgstr ""

#: client/task-list/tasks/tax.js:162
msgid "There was a problem updating your tax settings"
msgstr ""

#: client/task-list/tasks/tax.js:204
msgid "Install Jetpack and WooCommerce Tax"
msgstr ""

#: client/task-list/tasks/tax.js:208
msgid ""
"By installing Jetpack and WooCommerce Tax you agree to the {{link}}Terms of "
"Service{{/link}}."
msgstr ""

#: client/task-list/tasks/tax.js:213
msgid "Install Jetpack"
msgstr ""

#: client/task-list/tasks/tax.js:214
msgid "By installing Jetpack you agree to the {{link}}Terms of Service{{/link}}."
msgstr ""

#: client/task-list/tasks/tax.js:249
msgid "Jetpack and WooCommerce Tax allow you to automate sales tax calculations"
msgstr ""

#: client/task-list/tasks/tax.js:281
msgid "Set up manually"
msgstr ""

#: client/task-list/tasks/tax.js:323
msgid ""
"Connect your store to WordPress.com to enable automated sales tax "
"calculations"
msgstr ""

#: client/task-list/tasks/tax.js:343
msgid "Set up tax rates manually"
msgstr ""

#: client/task-list/tasks/tax.js:348
msgid "My business doesn't charge sales tax"
msgstr ""

#: client/task-list/tasks/tax.js:358
msgid "Configure tax rates"
msgstr ""

#: client/task-list/tasks/tax.js:359
msgid "Head over to the tax rate settings screen to configure your tax rates"
msgstr ""

#: client/task-list/tasks/tax.js:374
msgid "Configure"
msgstr ""

#: client/task-list/tasks/tax.js:380
msgid ""
"By clicking \"Configure\" you're enabling tax rates and calculations. More "
"info {{link}}here{{/link}}."
msgstr ""

#: client/task-list/tasks/tax.js:426
msgid "Good news!"
msgstr ""

#: client/task-list/tasks/tax.js:430
msgid ""
"{{strong}}Jetpack{{/strong}} and {{strong}}WooCommerce Tax{{/strong}} can "
"automate your sales tax calculations for you."
msgstr ""

#: client/task-list/tasks/tax.js:458
msgid "No thanks, I'll set up manually"
msgstr ""

#: client/task-list/tasks/tax.js:468
msgid "I don't charge sales tax"
msgstr ""

#: client/wp-admin-scripts/beta-features-tracking-modal/container.js:68
msgid "Build a Better WooCommerce"
msgstr ""

#: client/wp-admin-scripts/beta-features-tracking-modal/container.js:73
msgid "Testing new features requires sharing non-sensitive data via "
msgstr ""

#: client/wp-admin-scripts/beta-features-tracking-modal/container.js:78
msgid "usage tracking"
msgstr ""

#: client/wp-admin-scripts/beta-features-tracking-modal/container.js:80
msgid ""
". Gathering usage data allows us to make WooCommerce better — your store "
"will be considered as we evaluate new features, judge the quality of an "
"update, or determine if an improvement makes sense. No personal data is "
"tracked or stored and you can opt-out at any time."
msgstr ""

#: client/wp-admin-scripts/navigation-opt-out/container.js:28
msgid "Help us improve"
msgstr ""

#: client/wp-admin-scripts/navigation-opt-out/container.js:33
msgid ""
"Take this 2-minute survey to share why you're opting out of the new "
"navigation"
msgstr ""

#: client/wp-admin-scripts/onboarding-homepage-notice/index.js:73
msgid "🏠 Nice work creating your store's homepage!"
msgstr ""

#: client/wp-admin-scripts/onboarding-homepage-notice/index.js:82
#: client/wp-admin-scripts/onboarding-product-notice/index.js:20
#: client/wp-admin-scripts/onboarding-tax-notice/index.js:50
msgid "Continue setup."
msgstr ""

#: client/wp-admin-scripts/onboarding-product-import-notice/index.js:26
msgid "Continue setup"
msgstr ""

#: client/wp-admin-scripts/onboarding-product-notice/index.js:14
msgid "🎉 Congrats on adding your first product!"
msgstr ""

#: client/wp-admin-scripts/onboarding-tax-notice/index.js:44
msgid "You've added your first tax rate!"
msgstr ""

#: client/wp-admin-scripts/print-shipping-label-banner/dismiss-modal/index.js:54
#: packages/experimental/build-module/inbox-note/inbox-dismiss-confirmation-modal.js:9
msgid "Are you sure?"
msgstr ""

#: client/wp-admin-scripts/print-shipping-label-banner/dismiss-modal/index.js:59
msgid ""
"With WooCommerce Shipping you can Print shipping labels from your "
"WooCommerce dashboard at the lowest USPS rates."
msgstr ""

#: client/wp-admin-scripts/print-shipping-label-banner/dismiss-modal/index.js:66
#: packages/experimental/build-module/experimental-list/task-item.js:96
msgid "Remind me later"
msgstr ""

#: client/wp-admin-scripts/print-shipping-label-banner/dismiss-modal/index.js:69
msgid "I don't need this"
msgstr ""

#: client/wp-admin-scripts/print-shipping-label-banner/setup-notice/index.js:16
msgid "download"
msgstr ""

#: client/wp-admin-scripts/print-shipping-label-banner/setup-notice/index.js:17
msgid "install"
msgstr ""

#: client/wp-admin-scripts/print-shipping-label-banner/setup-notice/index.js:18
msgid "activate"
msgstr ""

#: client/wp-admin-scripts/print-shipping-label-banner/setup-notice/index.js:19
msgid "set up"
msgstr ""

#: client/wp-admin-scripts/print-shipping-label-banner/setup-notice/index.js:20
msgid "start"
msgstr ""

#: client/wp-admin-scripts/print-shipping-label-banner/setup-notice/index.js:32
msgid "Unable to %s the plugin. Refresh the page and try again."
msgstr ""

#: client/wp-admin-scripts/print-shipping-label-banner/shipping-banner/index.js:148
msgid "Toggle panel:"
msgstr ""

#: client/wp-admin-scripts/print-shipping-label-banner/shipping-banner/index.js:207
msgid "Shipment Tracking"
msgstr ""

#: client/wp-admin-scripts/print-shipping-label-banner/shipping-banner/index.js:265
msgid ""
"You've already installed WooCommerce Shipping. By clicking \"Create "
"shipping label\", you agree to its {{tosLink}}Terms of Service{{/tosLink}}."
msgstr ""

#: client/wp-admin-scripts/print-shipping-label-banner/shipping-banner/index.js:270
msgid ""
"By clicking \"Create shipping label\", {{wcsLink}}WooCommerce "
"Shipping{{/wcsLink}} will be installed and you agree to its "
"{{tosLink}}Terms of Service{{/tosLink}}."
msgstr ""

#: client/wp-admin-scripts/print-shipping-label-banner/shipping-banner/index.js:361
msgid "Plugin installed and activated"
msgstr ""

#: client/wp-admin-scripts/print-shipping-label-banner/shipping-banner/index.js:403
msgid "Shipping "
msgstr ""

#: client/wp-admin-scripts/print-shipping-label-banner/shipping-banner/index.js:407
msgid "Print discounted shipping labels with a click."
msgstr ""

#: client/wp-admin-scripts/print-shipping-label-banner/shipping-banner/index.js:448
msgid "Create shipping label"
msgstr ""

#: client/wp-admin-scripts/print-shipping-label-banner/shipping-banner/index.js:458
msgid "Close Print Label Banner."
msgstr ""

#: packages/components/build-module/advanced-filters/attribute-filter.js:117
msgid "Attribute name"
msgstr ""

#: packages/components/build-module/advanced-filters/attribute-filter.js:121
msgid "Attribute value"
msgstr ""

# Sentence fragment describing a product attribute match. Example: "Color Is Not Blue" - attribute = Color, equals = Is Not, value = Blue
#: packages/components/build-module/advanced-filters/attribute-filter.js:38
msgid "{{attribute /}} {{equals /}} {{value /}}"
msgstr ""

#: packages/components/build-module/advanced-filters/date-filter.js:17
#: packages/date/build-module/index.js:100
msgid "MMM D, YYYY"
msgstr ""

#: packages/components/build-module/advanced-filters/index.js:107
msgid "Choose to apply any or all filters"
msgstr ""

#: packages/components/build-module/advanced-filters/index.js:20
msgid "Any"
msgstr ""

#: packages/components/build-module/advanced-filters/index.js:205
msgid "Add a Filter"
msgstr ""

#: packages/components/build-module/advanced-filters/index.js:211
msgid "Filter"
msgstr ""

#: packages/components/build-module/advanced-filters/index.js:212
msgid "Clear all filters"
msgstr ""

# Sentence fragment, "range start" refers to the first of two numeric values the field must be between. Screenshot for context: https://cloudup.com/cmv5CLyMPNQ
#: packages/components/build-module/advanced-filters/number-filter.js:125
msgid "%(field)s range start"
msgstr ""

# Sentence fragment, "range end" refers to the second of two numeric values the field must be between. Screenshot for context: https://cloudup.com/cmv5CLyMPNQ
#: packages/components/build-module/advanced-filters/number-filter.js:136
msgid "%(field)s range end"
msgstr ""

#: packages/components/build-module/calendar/date-picker.js:58
msgid "Choose a date"
msgstr ""

#: packages/components/build-module/calendar/date-picker.js:58
msgid "Date input describing a selected date in format %s"
msgstr ""

#: packages/components/build-module/calendar/date-picker.js:59
msgid "select a date"
msgstr ""

#: packages/components/build-module/calendar/date-range.js:136
msgid "Start Date"
msgstr ""

#: packages/components/build-module/calendar/date-range.js:136
msgid "Date input describing a selected date range's start date in format %s"
msgstr ""

#: packages/components/build-module/calendar/date-range.js:137
msgid "to"
msgstr ""

#: packages/components/build-module/calendar/date-range.js:138
msgid "End Date"
msgstr ""

#: packages/components/build-module/calendar/date-range.js:138
msgid "Date input describing a selected date range's end date in format %s"
msgstr ""

#: packages/components/build-module/calendar/phrases.js:10
msgid "Clear Dates"
msgstr ""

#: packages/components/build-module/calendar/phrases.js:11
msgid "Move backward to switch to the previous month."
msgstr ""

#: packages/components/build-module/calendar/phrases.js:12
msgid "Move forward to switch to the next month."
msgstr ""

#: packages/components/build-module/calendar/phrases.js:13
msgid "Enter key"
msgstr ""

#: packages/components/build-module/calendar/phrases.js:14
msgid "Right and left arrow keys"
msgstr ""

#: packages/components/build-module/calendar/phrases.js:15
msgid "up and down arrow keys"
msgstr ""

#: packages/components/build-module/calendar/phrases.js:16
msgid "page up and page down keys"
msgstr ""

#: packages/components/build-module/calendar/phrases.js:17
msgid "Home and end keys"
msgstr ""

#: packages/components/build-module/calendar/phrases.js:18
msgid "Escape key"
msgstr ""

#: packages/components/build-module/calendar/phrases.js:19
msgid "Question mark"
msgstr ""

#: packages/components/build-module/calendar/phrases.js:20
msgid "Select the date in focus."
msgstr ""

#: packages/components/build-module/calendar/phrases.js:21
msgid "Move backward (left) and forward (right) by one day."
msgstr ""

#: packages/components/build-module/calendar/phrases.js:22
msgid "Move backward (up) and forward (down) by one week."
msgstr ""

#: packages/components/build-module/calendar/phrases.js:23
msgid "Switch months."
msgstr ""

#: packages/components/build-module/calendar/phrases.js:24
msgid "Go to the first or last day of a week."
msgstr ""

#: packages/components/build-module/calendar/phrases.js:25
msgid "Return to the date input field."
msgstr ""

#: packages/components/build-module/calendar/phrases.js:26
msgid "Press the down arrow key to interact with the calendar and select a date."
msgstr ""

#: packages/components/build-module/calendar/phrases.js:27
msgid "Select %s as a start date."
msgstr ""

#: packages/components/build-module/calendar/phrases.js:28
msgid "Select %s as an end date."
msgstr ""

#: packages/components/build-module/calendar/phrases.js:30
msgid "%s is not selectable."
msgstr ""

#: packages/components/build-module/calendar/phrases.js:31
msgid "Selected. %s"
msgstr ""

#: packages/components/build-module/calendar/phrases.js:6
msgid "Calendar"
msgstr ""

#: packages/components/build-module/calendar/phrases.js:8
msgid "Interact with the calendar and select start and end dates."
msgstr ""

#: packages/components/build-module/calendar/phrases.js:9
msgid "Clear Date"
msgstr ""

#: packages/components/build-module/chart/d3chart/legend.js:65
msgid "You may select up to %d items."
msgstr ""

#: packages/components/build-module/chart/index.js:293
#: packages/components/build-module/table/index.js:139
msgid "Your requested data is loading"
msgstr ""

#: packages/components/build-module/compare-filter/index.js:82
#: packages/components/build-module/search-list-control/index.js:146
#: packages/components/build-module/select-control/tags.js:52
msgid "Clear all"
msgstr ""

#: packages/components/build-module/date-range-filter-picker/compare-periods.js:15
#: packages/components/build-module/date-range-filter-picker/content.js:60
msgid "compare to"
msgstr ""

#: packages/components/build-module/date-range-filter-picker/content.js:40
msgid "Select date range and comparison"
msgstr ""

#: packages/components/build-module/date-range-filter-picker/content.js:42
msgid "select a date range"
msgstr ""

#: packages/components/build-module/date-range-filter-picker/content.js:46
msgid "Presets"
msgstr ""

#: packages/components/build-module/date-range-filter-picker/content.js:51
#: packages/date/build-module/index.js:39
msgid "Custom"
msgstr ""

#: packages/components/build-module/date-range-filter-picker/content.js:63
msgid "Reset"
msgstr ""

#: packages/components/build-module/date-range-filter-picker/index.js:106
msgid "Date range"
msgstr ""

#: packages/components/build-module/date-range-filter-picker/index.js:77
msgid "vs."
msgstr ""

#: packages/components/build-module/date-range-filter-picker/preset-periods.js:16
msgid "select a preset period"
msgstr ""

#: packages/components/build-module/filter-picker/index.js:220
msgid "filter report to show:"
msgstr ""

#: packages/components/build-module/filters/index.js:71
msgid "Filters"
msgstr ""

#: packages/components/build-module/image-upload/index.js:25
msgid "Select or upload image"
msgstr ""

#: packages/components/build-module/image-upload/index.js:27
msgid "Select"
msgstr ""

#: packages/components/build-module/image-upload/index.js:57
msgid "Remove image"
msgstr ""

#: packages/components/build-module/image-upload/index.js:61
msgid "Add an image"
msgstr ""

#: packages/components/build-module/pagination/index.js:101
msgid "Go to page"
msgstr ""

#: packages/components/build-module/pagination/index.js:110
msgid "Rows per page"
msgstr ""

#: packages/components/build-module/pagination/index.js:84
msgid "Page %d of %d"
msgstr ""

#: packages/components/build-module/pagination/index.js:86
msgid "Previous Page"
msgstr ""

#: packages/components/build-module/pagination/index.js:88
msgid "Next Page"
msgstr ""

#: packages/components/build-module/plugins/index.js:73
msgid "Install & enable"
msgstr ""

#: packages/components/build-module/rating/index.js:34
msgid "%1$s out of %2$s stars."
msgstr ""

#: packages/components/build-module/search-list-control/index.js:19
msgid "Clear all selected items"
msgstr ""

#: packages/components/build-module/search-list-control/index.js:20
msgid "No items found."
msgstr ""

#: packages/components/build-module/search-list-control/index.js:21
msgid "No results for %s"
msgstr ""

#: packages/components/build-module/search-list-control/index.js:22
msgid "Search for items"
msgstr ""

# Number of items selected from list.
#: packages/components/build-module/search-list-control/index.js:25
msgid "%d item selected"
msgid_plural "%d items selected"
msgstr[0] ""
msgstr[1] ""

#: packages/components/build-module/search-list-control/index.js:26
msgid "Search results updated."
msgstr ""

#: packages/components/build-module/search/autocompleters/attributes.js:109
msgid "All attributes with names that include {{query /}}"
msgstr ""

#: packages/components/build-module/search/autocompleters/categories.js:109
msgid "All categories with titles that include {{query /}}"
msgstr ""

#: packages/components/build-module/search/autocompleters/coupons.js:108
msgid "All coupons with codes that include {{query /}}"
msgstr ""

#: packages/components/build-module/search/autocompleters/customers.js:109
msgid "All customers with names that include {{query /}}"
msgstr ""

#: packages/components/build-module/search/autocompleters/product.js:110
msgid "All products with titles that include {{query /}}"
msgstr ""

#: packages/components/build-module/search/autocompleters/taxes.js:108
msgid "All taxes with codes that include {{query /}}"
msgstr ""

#: packages/components/build-module/select-control/control.js:127
msgid "Move backward for selected items"
msgstr ""

#: packages/components/build-module/select-control/index.js:132
msgid "%d result found, use up and down arrow keys to navigate."
msgid_plural "%d results found, use up and down arrow keys to navigate."
msgstr[0] ""
msgstr[1] ""

#: packages/components/build-module/select-control/index.js:135
msgid "No results."
msgstr ""

#: packages/components/build-module/select-control/tags.js:47
msgid "%1$s (%2$s of %3$s)"
msgstr ""

#: packages/components/build-module/summary/index.js:50
msgid "Performance Indicators"
msgstr ""

#: packages/components/build-module/summary/menu.js:21
msgid ""
"List of data points available for filtering. Use arrow keys to cycle "
"through the list. Click a data point for a detailed report."
msgstr ""

#: packages/components/build-module/summary/number.js:46
msgid "Up %f%% from %s"
msgstr ""

#: packages/components/build-module/summary/number.js:47
msgid "Down %f%% from %s"
msgstr ""

#: packages/components/build-module/summary/number.js:49
msgid "No change from %s"
msgstr ""

#: packages/components/build-module/summary/number.js:87
msgid "%f%%"
msgstr ""

#: packages/components/build-module/table/index.js:131
msgid "Columns:"
msgstr ""

#: packages/components/build-module/table/table.js:133
msgid "(scroll to see more)"
msgstr ""

#: packages/components/build-module/table/table.js:157
msgid "Sort by %s in ascending order"
msgstr ""

#: packages/components/build-module/table/table.js:158
msgid "Sort by %s in descending order"
msgstr ""

#: packages/components/build-module/table/table.js:185
#: packages/components/build-module/timeline/index.js:20
msgid "No data to display"
msgstr ""

#: packages/components/build-module/tag/index.js:46
msgid "Remove %s"
msgstr ""

# PHP date format string used to display dates, see php.net/date.
#: packages/components/build-module/timeline/index.js:91
msgid "F j, Y"
msgstr ""

# PHP clock format string used to display times, see php.net/date.
#: packages/components/build-module/timeline/index.js:93
msgid "g:ia"
msgstr ""

#: client/analytics/report/products/table.js:216
msgctxt "categories"
msgid "+%d more"
msgstr ""

#: packages/customer-effort-score/build-module/customer-feedback-modal/index.js:27
msgid "Very difficult"
msgstr ""

#: packages/customer-effort-score/build-module/customer-feedback-modal/index.js:31
msgid "Somewhat difficult"
msgstr ""

#: packages/customer-effort-score/build-module/customer-feedback-modal/index.js:35
msgid "Neutral"
msgstr ""

#: packages/customer-effort-score/build-module/customer-feedback-modal/index.js:39
msgid "Somewhat easy"
msgstr ""

#: packages/customer-effort-score/build-module/customer-feedback-modal/index.js:43
msgid "Very easy"
msgstr ""

#: packages/customer-effort-score/build-module/customer-feedback-modal/index.js:68
msgid "Please share your feedback"
msgstr ""

#: packages/customer-effort-score/build-module/customer-feedback-modal/index.js:73
msgid "Comments (Optional)"
msgstr ""

#: packages/customer-effort-score/build-module/customer-feedback-modal/index.js:73
msgid "Your feedback will go to the WooCommerce development team"
msgstr ""

#: packages/customer-effort-score/build-module/customer-feedback-modal/index.js:75
msgid "Please provide feedback by selecting an option above."
msgstr ""

#: packages/customer-effort-score/build-module/customer-feedback-modal/index.js:78
msgid "Send"
msgstr ""

#: packages/customer-effort-score/build-module/index.js:39
msgid "Give feedback"
msgstr ""

# %(actionType): install or activate (the plugin). %(pluginName): a plugin slug (e.g. woocommerce-services). %(error): a single error message or in plural a comma separated error message list.
#: packages/data/build-module/plugins/actions.js:41
#: packages/data/src/plugins/actions.ts:87
msgid "Could not %(actionType)s %(pluginName)s plugin, %(error)s"
msgid_plural ""
"Could not %(actionType)s the following plugins: %(pluginName)s with these "
"Errors: %(error)s"
msgstr[0] ""
msgstr[1] ""

#: packages/data/build-module/plugins/constants.js:11
#: packages/data/src/plugins/constants.ts:13
msgid "Facebook for WooCommerce"
msgstr ""

#: packages/data/build-module/plugins/constants.js:13
#: packages/data/src/plugins/constants.ts:18
msgid "Klarna Checkout for WooCommerce"
msgstr ""

#: packages/data/build-module/plugins/constants.js:14
#: packages/data/src/plugins/constants.ts:22
msgid "Klarna Payments for WooCommerce"
msgstr ""

#: packages/data/build-module/plugins/constants.js:15
#: packages/data/src/plugins/constants.ts:26
msgid "Mailchimp for WooCommerce"
msgstr ""

#: packages/data/build-module/plugins/constants.js:17
#: packages/data/src/plugins/constants.ts:34
msgid "WooCommerce PayPal"
msgstr ""

#: packages/data/build-module/plugins/constants.js:18
#: packages/data/src/plugins/constants.ts:38
msgid "WooCommerce Stripe"
msgstr ""

#: packages/data/build-module/plugins/constants.js:19
#: packages/data/src/plugins/constants.ts:42
msgid "WooCommerce PayFast"
msgstr ""

#: packages/data/build-module/plugins/constants.js:23
#: packages/data/src/plugins/constants.ts:55
msgid "WooCommerce Shipping & Tax"
msgstr ""

#: packages/data/build-module/plugins/constants.js:24
#: packages/data/src/plugins/constants.ts:59
msgid "WooCommerce ShipStation Gateway"
msgstr ""

#: packages/data/build-module/plugins/constants.js:25
#: packages/data/src/plugins/constants.ts:63
msgid "Mercado Pago payments for WooCommerce"
msgstr ""

#: packages/data/build-module/plugins/constants.js:26
#: packages/data/src/plugins/constants.ts:67
msgid "Google Listings and Ads"
msgstr ""

#: packages/data/build-module/settings/actions.js:79
msgid "There was a problem updating your settings."
msgstr ""

#: packages/date/build-module/index.js:111
msgid "MMM D"
msgstr ""

#: packages/date/build-module/index.js:30
msgid "Yesterday"
msgstr ""

#: packages/date/build-module/index.js:32
msgid "Last week"
msgstr ""

#: packages/date/build-module/index.js:34
msgid "Last month"
msgstr ""

#: packages/date/build-module/index.js:35
msgid "Quarter to date"
msgstr ""

#: packages/date/build-module/index.js:36
msgid "Last quarter"
msgstr ""

#: packages/date/build-module/index.js:37
msgid "Year to date"
msgstr ""

#: packages/date/build-module/index.js:38
msgid "Last year"
msgstr ""

#: packages/date/build-module/index.js:44
msgid "Previous period"
msgstr ""

#: packages/date/build-module/index.js:48
msgid "Previous year"
msgstr ""

#: packages/date/build-module/index.js:525
msgid "Week of %B %-d, %Y"
msgstr ""

#: packages/date/build-module/index.js:563
msgid "MMMM D, YYYY"
msgstr ""

#: packages/date/build-module/index.js:564
msgid "D MMMM YYYY LT"
msgstr ""

#: packages/date/build-module/index.js:565
msgid "dddd, D MMMM YYYY LT"
msgstr ""

#: packages/date/build-module/index.js:566
msgid "HH:mm"
msgstr ""

#: packages/date/build-module/index.js:573
msgid "Invalid date"
msgstr ""

#: packages/date/build-module/index.js:574
msgid "Select a date in the past"
msgstr ""

#: packages/date/build-module/index.js:576
msgid "Start date must be before end date"
msgstr ""

#: packages/experimental/build-module/experimental-list/task-item.js:27
msgid "This task is required to keep your store running"
msgstr ""

#: packages/experimental/build-module/experimental-list/task-item.js:30
msgid "This task is required to set up your extension"
msgstr ""

#: packages/experimental/build-module/experimental-list/task-item.js:88
msgid "Task Options"
msgstr ""

#: packages/experimental/build-module/inbox-note/inbox-dismiss-confirmation-modal.js:11
msgid "Dismissed messages cannot be viewed again"
msgstr ""

#: packages/experimental/build-module/inbox-note/inbox-dismiss-confirmation-modal.js:7
msgid "Yes, I'm sure"
msgstr ""

#: packages/experimental/build-module/inbox-note/inbox-note.js:85
msgid "Dismiss this message"
msgstr ""

#: packages/experimental/build-module/inbox-note/inbox-note.js:87
msgid "Dismiss all messages"
msgstr ""

#: packages/onboarding/build-module/components/RecommendedRibbon/RecommendedRibbon.js:8
msgid "Local Partner"
msgstr ""

#: packages/onboarding/build-module/components/SetupRequired.js:11
msgid "Setup required"
msgstr ""

#: packages/onboarding/build-module/components/WCPayAcceptedMethods.js:21
msgid "Accepted payment methods"
msgstr ""

#: packages/wc-admin-settings/build-module/index.js:44
msgid "Mutable settings should be accessed via data store."
msgstr ""

#: packages/wc-admin-settings/build-module/index.js:66
msgid "Mutable settings should be mutated via data store."
msgstr ""

#: client/analytics/report/categories/config.js:51
msgctxt ""
"A sentence describing filters for Categories. See screen shot for context: "
"https://cloudup.com/cSsUY9VeCVJ"
msgid "Categories match {{select /}} filters"
msgstr ""

#: client/analytics/report/coupons/config.js:42
msgctxt ""
"A sentence describing filters for Coupons. See screen shot for context: "
"https://cloudup.com/cSsUY9VeCVJ"
msgid "Coupons match {{select /}} filters"
msgstr ""

#: client/analytics/report/customers/config.js:73
msgctxt ""
"A sentence describing filters for Customers. See screen shot for context: "
"https://cloudup.com/cCsm3GeXJbE"
msgid "Customers match {{select /}} filters"
msgstr ""

# Sentence fragment, logical, "Includes" refers to variations including a given category. Screenshot for context: https://cloudup.com/cSsUY9VeCVJ
#: client/analytics/report/variations/config.js:196
msgctxt "categories"
msgid "Includes"
msgstr ""

# Sentence fragment, logical, "Excludes" refers to variations excluding a given category. Screenshot for context: https://cloudup.com/cSsUY9VeCVJ
#: client/analytics/report/variations/config.js:205
msgctxt "categories"
msgid "Excludes"
msgstr ""

# Sentence fragment, logical, "Less Than" refers to average order value of a customer, more than a given amount. Screenshot for context: https://cloudup.com/cCsm3GeXJbE
#: client/analytics/report/customers/config.js:408
msgctxt "average order value of customer"
msgid "Less Than"
msgstr ""

#: client/analytics/report/customers/config.js:418
msgctxt "average order value of customer"
msgid "More Than"
msgstr ""

# Sentence fragment, logical, "Between" refers to average order value of a customer, between two given amounts. Screenshot for context: https://cloudup.com/cCsm3GeXJbE
#: client/analytics/report/customers/config.js:509
msgctxt "date"
msgid "Between"
msgstr ""

# Sentence fragment, logical, "Before" refers to customers registered before a given date. Screenshot for context: https://cloudup.com/cCsm3GeXJbE
#: client/analytics/report/customers/config.js:499
msgctxt "date"
msgid "Before"
msgstr ""

# Sentence fragment, logical, "after" refers to customers registered after a given date. Screenshot for context: https://cloudup.com/cCsm3GeXJbE
#: client/analytics/report/customers/config.js:504
msgctxt "date"
msgid "After"
msgstr ""

#: client/analytics/report/downloads/config.js:50
msgctxt ""
"A sentence describing filters for Downloads. See screen shot for context: "
"https://cloudup.com/ccxhyH2mEDg"
msgid "Downloads match {{select /}} filters"
msgstr ""

#: client/analytics/report/orders/config.js:70
msgctxt ""
"A sentence describing filters for Orders. See screen shot for context: "
"https://cloudup.com/cSsUY9VeCVJ"
msgid "Orders match {{select /}} filters"
msgstr ""

# Sentence fragment, logical, "Is Not" refers to searching for product variations that don\'t match a chosen attribute. Screenshot for context: https://cloudup.com/cSsUY9VeCVJ
#: client/analytics/report/orders/config.js:392
#: client/analytics/report/variations/config.js:162
msgctxt "product attribute"
msgid "Is Not"
msgstr ""

# Sentence fragment, logical, "Is" refers to searching for product variations matching a chosen attribute. Screenshot for context: https://cloudup.com/cSsUY9VeCVJ
#: client/analytics/report/orders/config.js:383
#: client/analytics/report/variations/config.js:153
msgctxt "product attribute"
msgid "Is"
msgstr ""

#: client/analytics/report/products/config.js:176
#: client/analytics/report/stock/config.js:17
msgctxt ""
"A sentence describing filters for Products. See screen shot for context: "
"https://cloudup.com/cSsUY9VeCVJ"
msgid "Products Match {{select /}} Filters"
msgstr ""

#: client/analytics/report/products/table.js:165
#: client/analytics/report/stock/table.js:99
#: client/analytics/report/variations/table.js:165
msgctxt "Indication of a low quantity"
msgid "Low"
msgstr ""

#: client/analytics/report/revenue/config.js:74
msgctxt ""
"A sentence describing filters for Revenue. See screen shot for context: "
"https://cloudup.com/cSsUY9VeCVJ"
msgid "Revenue Matches {{select /}} Filters"
msgstr ""

#: client/analytics/report/taxes/config.js:58
msgctxt ""
"A sentence describing filters for Taxes. See screen shot for context: "
"https://cloudup.com/cSsUY9VeCVJ"
msgid "Taxes match {{select /}} filters"
msgstr ""

#: client/analytics/report/variations/config.js:123
msgctxt ""
"A sentence describing filters for Variations. See screen shot for context: "
"https://cloudup.com/cSsUY9VeCVJ"
msgid "Variations match {{select /}} filters"
msgstr ""

#: client/profile-wizard/steps/business-details/data/product-options.js:19
msgctxt "store product count or revenue"
msgid "%s+"
msgstr ""

#: client/profile-wizard/steps/business-details/data/product-options.js:25
msgctxt "store product count or revenue range"
msgid "%1$s - %2$s"
msgstr ""

#: packages/components/build-module/advanced-filters/date-filter.js:41
msgctxt "Date range inputs arranged on a single line"
msgid "{{after /}}{{span}} and {{/span}}{{before /}}"
msgstr ""

#: packages/components/build-module/advanced-filters/number-filter.js:18
msgctxt "Numerical range inputs arranged on a single line"
msgid "{{rangeStart /}}{{span}} and {{/span}}{{rangeEnd /}}"
msgstr ""

# Sentence fragment, "maximum amount" refers to a numeric value the field must be less than. Screenshot for context: https://cloudup.com/cmv5CLyMPNQ
#: packages/components/build-module/advanced-filters/number-filter.js:85
msgctxt "maximum value input"
msgid "%(field)s maximum amount"
msgstr ""

# Sentence fragment, "minimum amount" refers to a numeric value the field must be more than. Screenshot for context: https://cloudup.com/cmv5CLyMPNQ
#: packages/components/build-module/advanced-filters/number-filter.js:90
msgctxt "minimum value input"
msgid "%(field)s minimum amount"
msgstr ""

action-scheduler/deprecated/functions.php000064400000011766151335517650014644 0ustar00<?php

/**
 * Deprecated API functions for scheduling actions
 *
 * Functions with the wc prefix were deprecated to avoid confusion with
 * Action Scheduler being included in WooCommerce core, and it providing
 * a different set of APIs for working with the action queue.
 */

/**
 * Schedule an action to run one time
 *
 * @param int $timestamp When the job will run
 * @param string $hook The hook to trigger
 * @param array $args Arguments to pass when the hook triggers
 * @param string $group The group to assign this job to
 *
 * @return string The job ID
 */
function wc_schedule_single_action( $timestamp, $hook, $args = array(), $group = '' ) {
	_deprecated_function( __FUNCTION__, '2.1.0', 'as_schedule_single_action()' );
	return as_schedule_single_action( $timestamp, $hook, $args, $group );
}

/**
 * Schedule a recurring action
 *
 * @param int $timestamp When the first instance of the job will run
 * @param int $interval_in_seconds How long to wait between runs
 * @param string $hook The hook to trigger
 * @param array $args Arguments to pass when the hook triggers
 * @param string $group The group to assign this job to
 *
 * @deprecated 2.1.0
 *
 * @return string The job ID
 */
function wc_schedule_recurring_action( $timestamp, $interval_in_seconds, $hook, $args = array(), $group = '' ) {
	_deprecated_function( __FUNCTION__, '2.1.0', 'as_schedule_recurring_action()' );
	return as_schedule_recurring_action( $timestamp, $interval_in_seconds, $hook, $args, $group );
}

/**
 * Schedule an action that recurs on a cron-like schedule.
 *
 * @param int $timestamp The schedule will start on or after this time
 * @param string $schedule A cron-link schedule string
 * @see http://en.wikipedia.org/wiki/Cron
 *   *    *    *    *    *    *
 *   ┬    ┬    ┬    ┬    ┬    ┬
 *   |    |    |    |    |    |
 *   |    |    |    |    |    + year [optional]
 *   |    |    |    |    +----- day of week (0 - 7) (Sunday=0 or 7)
 *   |    |    |    +---------- month (1 - 12)
 *   |    |    +--------------- day of month (1 - 31)
 *   |    +-------------------- hour (0 - 23)
 *   +------------------------- min (0 - 59)
 * @param string $hook The hook to trigger
 * @param array $args Arguments to pass when the hook triggers
 * @param string $group The group to assign this job to
 *
 * @deprecated 2.1.0
 *
 * @return string The job ID
 */
function wc_schedule_cron_action( $timestamp, $schedule, $hook, $args = array(), $group = '' ) {
	_deprecated_function( __FUNCTION__, '2.1.0', 'as_schedule_cron_action()' );
	return as_schedule_cron_action( $timestamp, $schedule, $hook, $args, $group );
}

/**
 * Cancel the next occurrence of a job.
 *
 * @param string $hook The hook that the job will trigger
 * @param array $args Args that would have been passed to the job
 * @param string $group
 *
 * @deprecated 2.1.0
 */
function wc_unschedule_action( $hook, $args = array(), $group = '' ) {
	_deprecated_function( __FUNCTION__, '2.1.0', 'as_unschedule_action()' );
	as_unschedule_action( $hook, $args, $group );
}

/**
 * @param string $hook
 * @param array $args
 * @param string $group
 *
 * @deprecated 2.1.0
 *
 * @return int|bool The timestamp for the next occurrence, or false if nothing was found
 */
function wc_next_scheduled_action( $hook, $args = NULL, $group = '' ) {
	_deprecated_function( __FUNCTION__, '2.1.0', 'as_next_scheduled_action()' );
	return as_next_scheduled_action( $hook, $args, $group );
}

/**
 * Find scheduled actions
 *
 * @param array $args Possible arguments, with their default values:
 *        'hook' => '' - the name of the action that will be triggered
 *        'args' => NULL - the args array that will be passed with the action
 *        'date' => NULL - the scheduled date of the action. Expects a DateTime object, a unix timestamp, or a string that can parsed with strtotime(). Used in UTC timezone.
 *        'date_compare' => '<=' - operator for testing "date". accepted values are '!=', '>', '>=', '<', '<=', '='
 *        'modified' => NULL - the date the action was last updated. Expects a DateTime object, a unix timestamp, or a string that can parsed with strtotime(). Used in UTC timezone.
 *        'modified_compare' => '<=' - operator for testing "modified". accepted values are '!=', '>', '>=', '<', '<=', '='
 *        'group' => '' - the group the action belongs to
 *        'status' => '' - ActionScheduler_Store::STATUS_COMPLETE or ActionScheduler_Store::STATUS_PENDING
 *        'claimed' => NULL - TRUE to find claimed actions, FALSE to find unclaimed actions, a string to find a specific claim ID
 *        'per_page' => 5 - Number of results to return
 *        'offset' => 0
 *        'orderby' => 'date' - accepted values are 'hook', 'group', 'modified', or 'date'
 *        'order' => 'ASC'
 * @param string $return_format OBJECT, ARRAY_A, or ids
 *
 * @deprecated 2.1.0
 *
 * @return array
 */
function wc_get_scheduled_actions( $args = array(), $return_format = OBJECT ) {
	_deprecated_function( __FUNCTION__, '2.1.0', 'as_get_scheduled_actions()' );
	return as_get_scheduled_actions( $args, $return_format );
}
action-scheduler/deprecated/ActionScheduler_Schedule_Deprecated.php000064400000001337151335517650021635 0ustar00<?php

/**
 * Class ActionScheduler_Abstract_Schedule
 */
abstract class ActionScheduler_Schedule_Deprecated implements ActionScheduler_Schedule {

	/**
	 * Get the date & time this schedule was created to run, or calculate when it should be run
	 * after a given date & time.
	 *
	 * @param DateTime $after
	 *
	 * @return DateTime|null
	 */
	public function next( DateTime $after = NULL ) {
		if ( empty( $after ) ) {
			$return_value       = $this->get_date();
			$replacement_method = 'get_date()';
		} else {
			$return_value       = $this->get_next( $after );
			$replacement_method = 'get_next( $after )';
		}

		_deprecated_function( __METHOD__, '3.0.0', __CLASS__ . '::' . $replacement_method );

		return $return_value;
	}
}
action-scheduler/deprecated/ActionScheduler_AdminView_Deprecated.php000064400000012507151335517650021765 0ustar00<?php

/**
 * Class ActionScheduler_AdminView_Deprecated
 *
 * Store deprecated public functions previously found in the ActionScheduler_AdminView class.
 * Keeps them out of the way of the main class.
 *
 * @codeCoverageIgnore
 */
class ActionScheduler_AdminView_Deprecated {

	public function action_scheduler_post_type_args( $args ) {
		_deprecated_function( __METHOD__, '2.0.0' );
		return $args;
	}

	/**
	 * Customise the post status related views displayed on the Scheduled Actions administration screen.
	 *
	 * @param array $views An associative array of views and view labels which can be used to filter the 'scheduled-action' posts displayed on the Scheduled Actions administration screen.
	 * @return array $views An associative array of views and view labels which can be used to filter the 'scheduled-action' posts displayed on the Scheduled Actions administration screen.
	 */
	public function list_table_views( $views ) {
		_deprecated_function( __METHOD__, '2.0.0' );
		return $views;
	}

	/**
	 * Do not include the "Edit" action for the Scheduled Actions administration screen.
	 *
	 * Hooked to the 'bulk_actions-edit-action-scheduler' filter.
	 *
	 * @param array $actions An associative array of actions which can be performed on the 'scheduled-action' post type.
	 * @return array $actions An associative array of actions which can be performed on the 'scheduled-action' post type.
	 */
	public function bulk_actions( $actions ) {
		_deprecated_function( __METHOD__, '2.0.0' );
		return $actions;
	}

	/**
	 * Completely customer the columns displayed on the Scheduled Actions administration screen.
	 *
	 * Because we can't filter the content of the default title and date columns, we need to recreate our own
	 * custom columns for displaying those post fields. For the column content, @see self::list_table_column_content().
	 *
	 * @param array $columns An associative array of columns that are use for the table on the Scheduled Actions administration screen.
	 * @return array $columns An associative array of columns that are use for the table on the Scheduled Actions administration screen.
	 */
	public function list_table_columns( $columns ) {
		_deprecated_function( __METHOD__, '2.0.0' );
		return $columns;
	}

	/**
	 * Make our custom title & date columns use defaulting title & date sorting.
	 *
	 * @param array $columns An associative array of columns that can be used to sort the table on the Scheduled Actions administration screen.
	 * @return array $columns An associative array of columns that can be used to sort the table on the Scheduled Actions administration screen.
	 */
	public static function list_table_sortable_columns( $columns ) {
		_deprecated_function( __METHOD__, '2.0.0' );
		return $columns;
	}

	/**
	 * Print the content for our custom columns.
	 *
	 * @param string $column_name The key for the column for which we should output our content.
	 * @param int $post_id The ID of the 'scheduled-action' post for which this row relates.
	 */
	public static function list_table_column_content( $column_name, $post_id ) {
		_deprecated_function( __METHOD__, '2.0.0' );
	}

	/**
	 * Hide the inline "Edit" action for all 'scheduled-action' posts.
	 *
	 * Hooked to the 'post_row_actions' filter.
	 *
	 * @param array $actions An associative array of actions which can be performed on the 'scheduled-action' post type.
	 * @return array $actions An associative array of actions which can be performed on the 'scheduled-action' post type.
	 */
	public static function row_actions( $actions, $post ) {
		_deprecated_function( __METHOD__, '2.0.0' );
		return $actions;
	}

	/**
	 * Run an action when triggered from the Action Scheduler administration screen.
	 *
	 * @codeCoverageIgnore
	 */
	public static function maybe_execute_action() {
		_deprecated_function( __METHOD__, '2.0.0' );
	}

	/**
	 * Convert an interval of seconds into a two part human friendly string.
	 *
	 * The WordPress human_time_diff() function only calculates the time difference to one degree, meaning
	 * even if an action is 1 day and 11 hours away, it will display "1 day". This funciton goes one step
	 * further to display two degrees of accuracy.
	 *
	 * Based on Crontrol::interval() function by Edward Dale: https://wordpress.org/plugins/wp-crontrol/
	 *
	 * @param int $interval A interval in seconds.
	 * @return string A human friendly string representation of the interval.
	 */
	public static function admin_notices() {
		_deprecated_function( __METHOD__, '2.0.0' );
	}

	/**
	 * Filter search queries to allow searching by Claim ID (i.e. post_password).
	 *
	 * @param string $orderby MySQL orderby string.
	 * @param WP_Query $query Instance of a WP_Query object
	 * @return string MySQL orderby string.
	 */
	public function custom_orderby( $orderby, $query ){
		_deprecated_function( __METHOD__, '2.0.0' );
	}

	/**
	 * Filter search queries to allow searching by Claim ID (i.e. post_password).
	 *
	 * @param string $search MySQL search string.
	 * @param WP_Query $query Instance of a WP_Query object
	 * @return string MySQL search string.
	 */
	public function search_post_password( $search, $query ) {
		_deprecated_function( __METHOD__, '2.0.0' );
	}

	/**
	 * Change messages when a scheduled action is updated.
	 *
	 * @param  array $messages
	 * @return array
	 */
	public function post_updated_messages( $messages ) {
		_deprecated_function( __METHOD__, '2.0.0' );
		return $messages;
	}
}action-scheduler/deprecated/ActionScheduler_Store_Deprecated.php000064400000002040151335517650021165 0ustar00<?php

/**
 * Class ActionScheduler_Store_Deprecated
 * @codeCoverageIgnore
 */
abstract class ActionScheduler_Store_Deprecated {

	/**
	 * Mark an action that failed to fetch correctly as failed.
	 *
	 * @since 2.2.6
	 *
	 * @param int $action_id The ID of the action.
	 */
	public function mark_failed_fetch_action( $action_id ) {
		_deprecated_function( __METHOD__, '3.0.0', 'ActionScheduler_Store::mark_failure()' );
		self::$store->mark_failure( $action_id );
	}

	/**
	 * Add base hooks
	 *
	 * @since 2.2.6
	 */
	protected static function hook() {
		_deprecated_function( __METHOD__, '3.0.0' );
	}

	/**
	 * Remove base hooks
	 *
	 * @since 2.2.6
	 */
	protected static function unhook() {
		_deprecated_function( __METHOD__, '3.0.0' );
	}

	/**
	 * Get the site's local time.
	 *
	 * @deprecated 2.1.0
	 * @return DateTimeZone
	 */
	protected function get_local_timezone() {
		_deprecated_function( __FUNCTION__, '2.1.0', 'ActionScheduler_TimezoneHelper::set_local_timezone()' );
		return ActionScheduler_TimezoneHelper::get_local_timezone();
	}
}
action-scheduler/deprecated/ActionScheduler_Abstract_QueueRunner_Deprecated.php000064400000001523151335517650024177 0ustar00<?php

/**
 * Abstract class with common Queue Cleaner functionality.
 */
abstract class ActionScheduler_Abstract_QueueRunner_Deprecated {

	/**
	 * Get the maximum number of seconds a batch can run for.
	 *
	 * @deprecated 2.1.1
	 * @return int The number of seconds.
	 */
	protected function get_maximum_execution_time() {
		_deprecated_function( __METHOD__, '2.1.1', 'ActionScheduler_Abstract_QueueRunner::get_time_limit()' );

		$maximum_execution_time = 30;

		// Apply deprecated filter
		if ( has_filter( 'action_scheduler_maximum_execution_time' ) ) {
			_deprecated_function( 'action_scheduler_maximum_execution_time', '2.1.1', 'action_scheduler_queue_runner_time_limit' );
			$maximum_execution_time = apply_filters( 'action_scheduler_maximum_execution_time', $maximum_execution_time );
		}

		return absint( $maximum_execution_time );
	}
}
action-scheduler/functions.php000064400000027064151335517650012542 0ustar00<?php

/**
 * General API functions for scheduling actions
 */

/**
 * Enqueue an action to run one time, as soon as possible
 *
 * @param string $hook The hook to trigger.
 * @param array  $args Arguments to pass when the hook triggers.
 * @param string $group The group to assign this job to.
 * @return int The action ID.
 */
function as_enqueue_async_action( $hook, $args = array(), $group = '' ) {
	if ( ! ActionScheduler::is_initialized( __FUNCTION__ ) ) {
		return 0;
	}
	return ActionScheduler::factory()->async( $hook, $args, $group );
}

/**
 * Schedule an action to run one time
 *
 * @param int $timestamp When the job will run.
 * @param string $hook The hook to trigger.
 * @param array $args Arguments to pass when the hook triggers.
 * @param string $group The group to assign this job to.
 *
 * @return int The action ID.
 */
function as_schedule_single_action( $timestamp, $hook, $args = array(), $group = '' ) {
	if ( ! ActionScheduler::is_initialized( __FUNCTION__ ) ) {
		return 0;
	}
	return ActionScheduler::factory()->single( $hook, $args, $timestamp, $group );
}

/**
 * Schedule a recurring action
 *
 * @param int $timestamp When the first instance of the job will run.
 * @param int $interval_in_seconds How long to wait between runs.
 * @param string $hook The hook to trigger.
 * @param array $args Arguments to pass when the hook triggers.
 * @param string $group The group to assign this job to.
 *
 * @return int The action ID.
 */
function as_schedule_recurring_action( $timestamp, $interval_in_seconds, $hook, $args = array(), $group = '' ) {
	if ( ! ActionScheduler::is_initialized( __FUNCTION__ ) ) {
		return 0;
	}
	return ActionScheduler::factory()->recurring( $hook, $args, $timestamp, $interval_in_seconds, $group );
}

/**
 * Schedule an action that recurs on a cron-like schedule.
 *
 * @param int $base_timestamp The first instance of the action will be scheduled
 *        to run at a time calculated after this timestamp matching the cron
 *        expression. This can be used to delay the first instance of the action.
 * @param string $schedule A cron-link schedule string
 * @see http://en.wikipedia.org/wiki/Cron
 *   *    *    *    *    *    *
 *   ┬    ┬    ┬    ┬    ┬    ┬
 *   |    |    |    |    |    |
 *   |    |    |    |    |    + year [optional]
 *   |    |    |    |    +----- day of week (0 - 7) (Sunday=0 or 7)
 *   |    |    |    +---------- month (1 - 12)
 *   |    |    +--------------- day of month (1 - 31)
 *   |    +-------------------- hour (0 - 23)
 *   +------------------------- min (0 - 59)
 * @param string $hook The hook to trigger.
 * @param array $args Arguments to pass when the hook triggers.
 * @param string $group The group to assign this job to.
 *
 * @return int The action ID.
 */
function as_schedule_cron_action( $timestamp, $schedule, $hook, $args = array(), $group = '' ) {
	if ( ! ActionScheduler::is_initialized( __FUNCTION__ ) ) {
		return 0;
	}
	return ActionScheduler::factory()->cron( $hook, $args, $timestamp, $schedule, $group );
}

/**
 * Cancel the next occurrence of a scheduled action.
 *
 * While only the next instance of a recurring or cron action is unscheduled by this method, that will also prevent
 * all future instances of that recurring or cron action from being run. Recurring and cron actions are scheduled in
 * a sequence instead of all being scheduled at once. Each successive occurrence of a recurring action is scheduled
 * only after the former action is run. If the next instance is never run, because it's unscheduled by this function,
 * then the following instance will never be scheduled (or exist), which is effectively the same as being unscheduled
 * by this method also.
 *
 * @param string $hook The hook that the job will trigger.
 * @param array $args Args that would have been passed to the job.
 * @param string $group The group the job is assigned to.
 *
 * @return string|null The scheduled action ID if a scheduled action was found, or null if no matching action found.
 */
function as_unschedule_action( $hook, $args = array(), $group = '' ) {
	if ( ! ActionScheduler::is_initialized( __FUNCTION__ ) ) {
		return 0;
	}
	$params = array(
		'hook'    => $hook,
		'status'  => ActionScheduler_Store::STATUS_PENDING,
		'orderby' => 'date',
		'order'   => 'ASC',
		'group'   => $group,
	);
	if ( is_array( $args ) ) {
		$params['args'] = $args;
	}

	$action_id = ActionScheduler::store()->query_action( $params );
	if ( $action_id ) {
		ActionScheduler::store()->cancel_action( $action_id );
	}

	return $action_id;
}

/**
 * Cancel all occurrences of a scheduled action.
 *
 * @param string $hook The hook that the job will trigger.
 * @param array $args Args that would have been passed to the job.
 * @param string $group The group the job is assigned to.
 */
function as_unschedule_all_actions( $hook, $args = array(), $group = '' ) {
	if ( ! ActionScheduler::is_initialized( __FUNCTION__ ) ) {
		return;
	}
	if ( empty( $args ) ) {
		if ( ! empty( $hook ) && empty( $group ) ) {
			ActionScheduler_Store::instance()->cancel_actions_by_hook( $hook );
			return;
		}
		if ( ! empty( $group ) && empty( $hook ) ) {
			ActionScheduler_Store::instance()->cancel_actions_by_group( $group );
			return;
		}
	}
	do {
		$unscheduled_action = as_unschedule_action( $hook, $args, $group );
	} while ( ! empty( $unscheduled_action ) );
}

/**
 * Check if there is an existing action in the queue with a given hook, args and group combination.
 *
 * An action in the queue could be pending, in-progress or async. If the is pending for a time in
 * future, its scheduled date will be returned as a timestamp. If it is currently being run, or an
 * async action sitting in the queue waiting to be processed, in which case boolean true will be
 * returned. Or there may be no async, in-progress or pending action for this hook, in which case,
 * boolean false will be the return value.
 *
 * @param string $hook
 * @param array $args
 * @param string $group
 *
 * @return int|bool The timestamp for the next occurrence of a pending scheduled action, true for an async or in-progress action or false if there is no matching action.
 */
function as_next_scheduled_action( $hook, $args = null, $group = '' ) {
	if ( ! ActionScheduler::is_initialized( __FUNCTION__ ) ) {
		return false;
	}

	$params = array(
		'hook'    => $hook,
		'orderby' => 'date',
		'order'   => 'ASC',
		'group'   => $group,
	);

	if ( is_array( $args ) ) {
		$params['args'] = $args;
	}

	$params['status'] = ActionScheduler_Store::STATUS_RUNNING;
	$action_id        = ActionScheduler::store()->query_action( $params );
	if ( $action_id ) {
		return true;
	}

	$params['status'] = ActionScheduler_Store::STATUS_PENDING;
	$action_id        = ActionScheduler::store()->query_action( $params );
	if ( null === $action_id ) {
		return false;
	}

	$action         = ActionScheduler::store()->fetch_action( $action_id );
	$scheduled_date = $action->get_schedule()->get_date();
	if ( $scheduled_date ) {
		return (int) $scheduled_date->format( 'U' );
	} elseif ( null === $scheduled_date ) { // pending async action with NullSchedule
		return true;
	}

	return false;
}

/**
 * Check if there is a scheduled action in the queue but more efficiently than as_next_scheduled_action().
 *
 * It's recommended to use this function when you need to know whether a specific action is currently scheduled
 * (pending or in-progress).
 *
 * @since x.x.x
 *
 * @param string $hook  The hook of the action.
 * @param array  $args  Args that have been passed to the action. Null will matches any args.
 * @param string $group The group the job is assigned to.
 *
 * @return bool True if a matching action is pending or in-progress, false otherwise.
 */
function as_has_scheduled_action( $hook, $args = null, $group = '' ) {
	if ( ! ActionScheduler::is_initialized( __FUNCTION__ ) ) {
		return false;
	}

	$query_args = array(
		'hook'     => $hook,
		'status'   => array( ActionScheduler_Store::STATUS_RUNNING, ActionScheduler_Store::STATUS_PENDING ),
		'group'    => $group,
		'orderby'  => 'none',
	);

	if ( null !== $args ) {
		$query_args['args'] = $args;
	}

	$action_id = ActionScheduler::store()->query_action( $query_args );

	return $action_id !== null;
}

/**
 * Find scheduled actions
 *
 * @param array $args Possible arguments, with their default values:
 *        'hook' => '' - the name of the action that will be triggered
 *        'args' => NULL - the args array that will be passed with the action
 *        'date' => NULL - the scheduled date of the action. Expects a DateTime object, a unix timestamp, or a string that can parsed with strtotime(). Used in UTC timezone.
 *        'date_compare' => '<=' - operator for testing "date". accepted values are '!=', '>', '>=', '<', '<=', '='
 *        'modified' => NULL - the date the action was last updated. Expects a DateTime object, a unix timestamp, or a string that can parsed with strtotime(). Used in UTC timezone.
 *        'modified_compare' => '<=' - operator for testing "modified". accepted values are '!=', '>', '>=', '<', '<=', '='
 *        'group' => '' - the group the action belongs to
 *        'status' => '' - ActionScheduler_Store::STATUS_COMPLETE or ActionScheduler_Store::STATUS_PENDING
 *        'claimed' => NULL - TRUE to find claimed actions, FALSE to find unclaimed actions, a string to find a specific claim ID
 *        'per_page' => 5 - Number of results to return
 *        'offset' => 0
 *        'orderby' => 'date' - accepted values are 'hook', 'group', 'modified', 'date' or 'none'
 *        'order' => 'ASC'
 *
 * @param string $return_format OBJECT, ARRAY_A, or ids.
 *
 * @return array
 */
function as_get_scheduled_actions( $args = array(), $return_format = OBJECT ) {
	if ( ! ActionScheduler::is_initialized( __FUNCTION__ ) ) {
		return array();
	}
	$store = ActionScheduler::store();
	foreach ( array('date', 'modified') as $key ) {
		if ( isset($args[$key]) ) {
			$args[$key] = as_get_datetime_object($args[$key]);
		}
	}
	$ids = $store->query_actions( $args );

	if ( $return_format == 'ids' || $return_format == 'int' ) {
		return $ids;
	}

	$actions = array();
	foreach ( $ids as $action_id ) {
		$actions[$action_id] = $store->fetch_action( $action_id );
	}

	if ( $return_format == ARRAY_A ) {
		foreach ( $actions as $action_id => $action_object ) {
			$actions[$action_id] = get_object_vars($action_object);
		}
	}

	return $actions;
}

/**
 * Helper function to create an instance of DateTime based on a given
 * string and timezone. By default, will return the current date/time
 * in the UTC timezone.
 *
 * Needed because new DateTime() called without an explicit timezone
 * will create a date/time in PHP's timezone, but we need to have
 * assurance that a date/time uses the right timezone (which we almost
 * always want to be UTC), which means we need to always include the
 * timezone when instantiating datetimes rather than leaving it up to
 * the PHP default.
 *
 * @param mixed $date_string A date/time string. Valid formats are explained in http://php.net/manual/en/datetime.formats.php.
 * @param string $timezone A timezone identifier, like UTC or Europe/Lisbon. The list of valid identifiers is available http://php.net/manual/en/timezones.php.
 *
 * @return ActionScheduler_DateTime
 */
function as_get_datetime_object( $date_string = null, $timezone = 'UTC' ) {
	if ( is_object( $date_string ) && $date_string instanceof DateTime ) {
		$date = new ActionScheduler_DateTime( $date_string->format( 'Y-m-d H:i:s' ), new DateTimeZone( $timezone ) );
	} elseif ( is_numeric( $date_string ) ) {
		$date = new ActionScheduler_DateTime( '@' . $date_string, new DateTimeZone( $timezone ) );
	} else {
		$date = new ActionScheduler_DateTime( $date_string, new DateTimeZone( $timezone ) );
	}
	return $date;
}
action-scheduler/classes/ActionScheduler_OptionLock.php000064400000003361151335517650017376 0ustar00<?php

/**
 * Provide a way to set simple transient locks to block behaviour
 * for up-to a given duration.
 *
 * Class ActionScheduler_OptionLock
 * @since 3.0.0
 */
class ActionScheduler_OptionLock extends ActionScheduler_Lock {

	/**
	 * Set a lock using options for a given amount of time (60 seconds by default).
	 *
	 * Using an autoloaded option avoids running database queries or other resource intensive tasks
	 * on frequently triggered hooks, like 'init' or 'shutdown'.
	 *
	 * For example, ActionScheduler_QueueRunner->maybe_dispatch_async_request() uses a lock to avoid
	 * calling ActionScheduler_QueueRunner->has_maximum_concurrent_batches() every time the 'shutdown',
	 * hook is triggered, because that method calls ActionScheduler_QueueRunner->store->get_claim_count()
	 * to find the current number of claims in the database.
	 *
	 * @param string $lock_type A string to identify different lock types.
	 * @bool True if lock value has changed, false if not or if set failed.
	 */
	public function set( $lock_type ) {
		return update_option( $this->get_key( $lock_type ), time() + $this->get_duration( $lock_type ) );
	}

	/**
	 * If a lock is set, return the timestamp it was set to expiry.
	 *
	 * @param string $lock_type A string to identify different lock types.
	 * @return bool|int False if no lock is set, otherwise the timestamp for when the lock is set to expire.
	 */
	public function get_expiration( $lock_type ) {
		return get_option( $this->get_key( $lock_type ) );
	}

	/**
	 * Get the key to use for storing the lock in the transient
	 *
	 * @param string $lock_type A string to identify different lock types.
	 * @return string
	 */
	protected function get_key( $lock_type ) {
		return sprintf( 'action_scheduler_lock_%s', $lock_type );
	}
}
action-scheduler/classes/ActionScheduler_ListTable.php000064400000045447151335517650017213 0ustar00<?php

/**
 * Implements the admin view of the actions.
 * @codeCoverageIgnore
 */
class ActionScheduler_ListTable extends ActionScheduler_Abstract_ListTable {

	/**
	 * The package name.
	 *
	 * @var string
	 */
	protected $package = 'action-scheduler';

	/**
	 * Columns to show (name => label).
	 *
	 * @var array
	 */
	protected $columns = array();

	/**
	 * Actions (name => label).
	 *
	 * @var array
	 */
	protected $row_actions = array();

	/**
	 * The active data stores
	 *
	 * @var ActionScheduler_Store
	 */
	protected $store;

	/**
	 * A logger to use for getting action logs to display
	 *
	 * @var ActionScheduler_Logger
	 */
	protected $logger;

	/**
	 * A ActionScheduler_QueueRunner runner instance (or child class)
	 *
	 * @var ActionScheduler_QueueRunner
	 */
	protected $runner;

	/**
	 * Bulk actions. The key of the array is the method name of the implementation:
	 *
	 *     bulk_<key>(array $ids, string $sql_in).
	 *
	 * See the comments in the parent class for further details
	 *
	 * @var array
	 */
	protected $bulk_actions = array();

	/**
	 * Flag variable to render our notifications, if any, once.
	 *
	 * @var bool
	 */
	protected static $did_notification = false;

	/**
	 * Array of seconds for common time periods, like week or month, alongside an internationalised string representation, i.e. "Day" or "Days"
	 *
	 * @var array
	 */
	private static $time_periods;

	/**
	 * Sets the current data store object into `store->action` and initialises the object.
	 *
	 * @param ActionScheduler_Store $store
	 * @param ActionScheduler_Logger $logger
	 * @param ActionScheduler_QueueRunner $runner
	 */
	public function __construct( ActionScheduler_Store $store, ActionScheduler_Logger $logger, ActionScheduler_QueueRunner $runner ) {

		$this->store  = $store;
		$this->logger = $logger;
		$this->runner = $runner;

		$this->table_header = __( 'Scheduled Actions', 'woocommerce' );

		$this->bulk_actions = array(
			'delete' => __( 'Delete', 'woocommerce' ),
		);

		$this->columns = array(
			'hook'        => __( 'Hook', 'woocommerce' ),
			'status'      => __( 'Status', 'woocommerce' ),
			'args'        => __( 'Arguments', 'woocommerce' ),
			'group'       => __( 'Group', 'woocommerce' ),
			'recurrence'  => __( 'Recurrence', 'woocommerce' ),
			'schedule'    => __( 'Scheduled Date', 'woocommerce' ),
			'log_entries' => __( 'Log', 'woocommerce' ),
		);

		$this->sort_by = array(
			'schedule',
			'hook',
			'group',
		);

		$this->search_by = array(
			'hook',
			'args',
			'claim_id',
		);

		$request_status = $this->get_request_status();

		if ( empty( $request_status ) ) {
			$this->sort_by[] = 'status';
		} elseif ( in_array( $request_status, array( 'in-progress', 'failed' ) ) ) {
			$this->columns  += array( 'claim_id' => __( 'Claim ID', 'woocommerce' ) );
			$this->sort_by[] = 'claim_id';
		}

		$this->row_actions = array(
			'hook' => array(
				'run' => array(
					'name'  => __( 'Run', 'woocommerce' ),
					'desc'  => __( 'Process the action now as if it were run as part of a queue', 'woocommerce' ),
				),
				'cancel' => array(
					'name'  => __( 'Cancel', 'woocommerce' ),
					'desc'  => __( 'Cancel the action now to avoid it being run in future', 'woocommerce' ),
					'class' => 'cancel trash',
				),
			),
		);

		self::$time_periods = array(
			array(
				'seconds' => YEAR_IN_SECONDS,
				/* translators: %s: amount of time */
				'names'   => _n_noop( '%s year', '%s years', 'woocommerce' ),
			),
			array(
				'seconds' => MONTH_IN_SECONDS,
				/* translators: %s: amount of time */
				'names'   => _n_noop( '%s month', '%s months', 'woocommerce' ),
			),
			array(
				'seconds' => WEEK_IN_SECONDS,
				/* translators: %s: amount of time */
				'names'   => _n_noop( '%s week', '%s weeks', 'woocommerce' ),
			),
			array(
				'seconds' => DAY_IN_SECONDS,
				/* translators: %s: amount of time */
				'names'   => _n_noop( '%s day', '%s days', 'woocommerce' ),
			),
			array(
				'seconds' => HOUR_IN_SECONDS,
				/* translators: %s: amount of time */
				'names'   => _n_noop( '%s hour', '%s hours', 'woocommerce' ),
			),
			array(
				'seconds' => MINUTE_IN_SECONDS,
				/* translators: %s: amount of time */
				'names'   => _n_noop( '%s minute', '%s minutes', 'woocommerce' ),
			),
			array(
				'seconds' => 1,
				/* translators: %s: amount of time */
				'names'   => _n_noop( '%s second', '%s seconds', 'woocommerce' ),
			),
		);

		parent::__construct( array(
			'singular' => 'action-scheduler',
			'plural'   => 'action-scheduler',
			'ajax'     => false,
		) );
	}

	/**
	 * Convert an interval of seconds into a two part human friendly string.
	 *
	 * The WordPress human_time_diff() function only calculates the time difference to one degree, meaning
	 * even if an action is 1 day and 11 hours away, it will display "1 day". This function goes one step
	 * further to display two degrees of accuracy.
	 *
	 * Inspired by the Crontrol::interval() function by Edward Dale: https://wordpress.org/plugins/wp-crontrol/
	 *
	 * @param int $interval A interval in seconds.
	 * @param int $periods_to_include Depth of time periods to include, e.g. for an interval of 70, and $periods_to_include of 2, both minutes and seconds would be included. With a value of 1, only minutes would be included.
	 * @return string A human friendly string representation of the interval.
	 */
	private static function human_interval( $interval, $periods_to_include = 2 ) {

		if ( $interval <= 0 ) {
			return __( 'Now!', 'woocommerce' );
		}

		$output = '';

		for ( $time_period_index = 0, $periods_included = 0, $seconds_remaining = $interval; $time_period_index < count( self::$time_periods ) && $seconds_remaining > 0 && $periods_included < $periods_to_include; $time_period_index++ ) {

			$periods_in_interval = floor( $seconds_remaining / self::$time_periods[ $time_period_index ]['seconds'] );

			if ( $periods_in_interval > 0 ) {
				if ( ! empty( $output ) ) {
					$output .= ' ';
				}
				$output .= sprintf( _n( self::$time_periods[ $time_period_index ]['names'][0], self::$time_periods[ $time_period_index ]['names'][1], $periods_in_interval, 'woocommerce' ), $periods_in_interval );
				$seconds_remaining -= $periods_in_interval * self::$time_periods[ $time_period_index ]['seconds'];
				$periods_included++;
			}
		}

		return $output;
	}

	/**
	 * Returns the recurrence of an action or 'Non-repeating'. The output is human readable.
	 *
	 * @param ActionScheduler_Action $action
	 *
	 * @return string
	 */
	protected function get_recurrence( $action ) {
		$schedule = $action->get_schedule();
		if ( $schedule->is_recurring() ) {
			$recurrence = $schedule->get_recurrence();

			if ( is_numeric( $recurrence ) ) {
				/* translators: %s: time interval */
				return sprintf( __( 'Every %s', 'woocommerce' ), self::human_interval( $recurrence ) );
			} else {
				return $recurrence;
			}
		}

		return __( 'Non-repeating', 'woocommerce' );
	}

	/**
	 * Serializes the argument of an action to render it in a human friendly format.
	 *
	 * @param array $row The array representation of the current row of the table
	 *
	 * @return string
	 */
	public function column_args( array $row ) {
		if ( empty( $row['args'] ) ) {
			return apply_filters( 'action_scheduler_list_table_column_args', '', $row );
		}

		$row_html = '<ul>';
		foreach ( $row['args'] as $key => $value ) {
			$row_html .= sprintf( '<li><code>%s => %s</code></li>', esc_html( var_export( $key, true ) ), esc_html( var_export( $value, true ) ) );
		}
		$row_html .= '</ul>';

		return apply_filters( 'action_scheduler_list_table_column_args', $row_html, $row );
	}

	/**
	 * Prints the logs entries inline. We do so to avoid loading Javascript and other hacks to show it in a modal.
	 *
	 * @param array $row Action array.
	 * @return string
	 */
	public function column_log_entries( array $row ) {

		$log_entries_html = '<ol>';

		$timezone = new DateTimezone( 'UTC' );

		foreach ( $row['log_entries'] as $log_entry ) {
			$log_entries_html .= $this->get_log_entry_html( $log_entry, $timezone );
		}

		$log_entries_html .= '</ol>';

		return $log_entries_html;
	}

	/**
	 * Prints the logs entries inline. We do so to avoid loading Javascript and other hacks to show it in a modal.
	 *
	 * @param ActionScheduler_LogEntry $log_entry
	 * @param DateTimezone $timezone
	 * @return string
	 */
	protected function get_log_entry_html( ActionScheduler_LogEntry $log_entry, DateTimezone $timezone ) {
		$date = $log_entry->get_date();
		$date->setTimezone( $timezone );
		return sprintf( '<li><strong>%s</strong><br/>%s</li>', esc_html( $date->format( 'Y-m-d H:i:s O' ) ), esc_html( $log_entry->get_message() ) );
	}

	/**
	 * Only display row actions for pending actions.
	 *
	 * @param array  $row         Row to render
	 * @param string $column_name Current row
	 *
	 * @return string
	 */
	protected function maybe_render_actions( $row, $column_name ) {
		if ( 'pending' === strtolower( $row[ 'status_name' ] ) ) {
			return parent::maybe_render_actions( $row, $column_name );
		}

		return '';
	}

	/**
	 * Renders admin notifications
	 *
	 * Notifications:
	 *  1. When the maximum number of tasks are being executed simultaneously.
	 *  2. Notifications when a task is manually executed.
	 *  3. Tables are missing.
	 */
	public function display_admin_notices() {
		global $wpdb;

		if ( ( is_a( $this->store, 'ActionScheduler_HybridStore' ) || is_a( $this->store, 'ActionScheduler_DBStore' ) ) && apply_filters( 'action_scheduler_enable_recreate_data_store', true ) ) {
			$table_list = array(
				'actionscheduler_actions',
				'actionscheduler_logs',
				'actionscheduler_groups',
				'actionscheduler_claims',
			);

			$found_tables = $wpdb->get_col( "SHOW TABLES LIKE '{$wpdb->prefix}actionscheduler%'" ); // phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared
			foreach ( $table_list as $table_name ) {
				if ( ! in_array( $wpdb->prefix . $table_name, $found_tables ) ) {
					$this->admin_notices[] = array(
						'class'   => 'error',
						'message' => __( 'It appears one or more database tables were missing. Attempting to re-create the missing table(s).' , 'woocommerce' ),
					);
					$this->recreate_tables();
					parent::display_admin_notices();

					return;
				}
			}
		}

		if ( $this->runner->has_maximum_concurrent_batches() ) {
			$claim_count           = $this->store->get_claim_count();
			$this->admin_notices[] = array(
				'class'   => 'updated',
				'message' => sprintf(
					/* translators: %s: amount of claims */
					_n(
						'Maximum simultaneous queues already in progress (%s queue). No additional queues will begin processing until the current queues are complete.',
						'Maximum simultaneous queues already in progress (%s queues). No additional queues will begin processing until the current queues are complete.',
						$claim_count,
						'woocommerce'
					),
					$claim_count
				),
			);
		} elseif ( $this->store->has_pending_actions_due() ) {

			$async_request_lock_expiration = ActionScheduler::lock()->get_expiration( 'async-request-runner' );

			// No lock set or lock expired
			if ( false === $async_request_lock_expiration || $async_request_lock_expiration < time() ) {
				$in_progress_url       = add_query_arg( 'status', 'in-progress', remove_query_arg( 'status' ) );
				/* translators: %s: process URL */
				$async_request_message = sprintf( __( 'A new queue has begun processing. <a href="%s">View actions in-progress &raquo;</a>', 'woocommerce' ), esc_url( $in_progress_url ) );
			} else {
				/* translators: %d: seconds */
				$async_request_message = sprintf( __( 'The next queue will begin processing in approximately %d seconds.', 'woocommerce' ), $async_request_lock_expiration - time() );
			}

			$this->admin_notices[] = array(
				'class'   => 'notice notice-info',
				'message' => $async_request_message,
			);
		}

		$notification = get_transient( 'action_scheduler_admin_notice' );

		if ( is_array( $notification ) ) {
			delete_transient( 'action_scheduler_admin_notice' );

			$action = $this->store->fetch_action( $notification['action_id'] );
			$action_hook_html = '<strong><code>' . $action->get_hook() . '</code></strong>';
			if ( 1 == $notification['success'] ) {
				$class = 'updated';
				switch ( $notification['row_action_type'] ) {
					case 'run' :
						/* translators: %s: action HTML */
						$action_message_html = sprintf( __( 'Successfully executed action: %s', 'woocommerce' ), $action_hook_html );
						break;
					case 'cancel' :
						/* translators: %s: action HTML */
						$action_message_html = sprintf( __( 'Successfully canceled action: %s', 'woocommerce' ), $action_hook_html );
						break;
					default :
						/* translators: %s: action HTML */
						$action_message_html = sprintf( __( 'Successfully processed change for action: %s', 'woocommerce' ), $action_hook_html );
						break;
				}
			} else {
				$class = 'error';
				/* translators: 1: action HTML 2: action ID 3: error message */
				$action_message_html = sprintf( __( 'Could not process change for action: "%1$s" (ID: %2$d). Error: %3$s', 'woocommerce' ), $action_hook_html, esc_html( $notification['action_id'] ), esc_html( $notification['error_message'] ) );
			}

			$action_message_html = apply_filters( 'action_scheduler_admin_notice_html', $action_message_html, $action, $notification );

			$this->admin_notices[] = array(
				'class'   => $class,
				'message' => $action_message_html,
			);
		}

		parent::display_admin_notices();
	}

	/**
	 * Prints the scheduled date in a human friendly format.
	 *
	 * @param array $row The array representation of the current row of the table
	 *
	 * @return string
	 */
	public function column_schedule( $row ) {
		return $this->get_schedule_display_string( $row['schedule'] );
	}

	/**
	 * Get the scheduled date in a human friendly format.
	 *
	 * @param ActionScheduler_Schedule $schedule
	 * @return string
	 */
	protected function get_schedule_display_string( ActionScheduler_Schedule $schedule ) {

		$schedule_display_string = '';

		if ( ! $schedule->get_date() ) {
			return '0000-00-00 00:00:00';
		}

		$next_timestamp = $schedule->get_date()->getTimestamp();

		$schedule_display_string .= $schedule->get_date()->format( 'Y-m-d H:i:s O' );
		$schedule_display_string .= '<br/>';

		if ( gmdate( 'U' ) > $next_timestamp ) {
			/* translators: %s: date interval */
			$schedule_display_string .= sprintf( __( ' (%s ago)', 'woocommerce' ), self::human_interval( gmdate( 'U' ) - $next_timestamp ) );
		} else {
			/* translators: %s: date interval */
			$schedule_display_string .= sprintf( __( ' (%s)', 'woocommerce' ), self::human_interval( $next_timestamp - gmdate( 'U' ) ) );
		}

		return $schedule_display_string;
	}

	/**
	 * Bulk delete
	 *
	 * Deletes actions based on their ID. This is the handler for the bulk delete. It assumes the data
	 * properly validated by the callee and it will delete the actions without any extra validation.
	 *
	 * @param array $ids
	 * @param string $ids_sql Inherited and unused
	 */
	protected function bulk_delete( array $ids, $ids_sql ) {
		foreach ( $ids as $id ) {
			$this->store->delete_action( $id );
		}
	}

	/**
	 * Implements the logic behind running an action. ActionScheduler_Abstract_ListTable validates the request and their
	 * parameters are valid.
	 *
	 * @param int $action_id
	 */
	protected function row_action_cancel( $action_id ) {
		$this->process_row_action( $action_id, 'cancel' );
	}

	/**
	 * Implements the logic behind running an action. ActionScheduler_Abstract_ListTable validates the request and their
	 * parameters are valid.
	 *
	 * @param int $action_id
	 */
	protected function row_action_run( $action_id ) {
		$this->process_row_action( $action_id, 'run' );
	}

	/**
	 * Force the data store schema updates.
	 */
	protected function recreate_tables() {
		if ( is_a( $this->store, 'ActionScheduler_HybridStore' ) ) {
			$store = $this->store;
		} else {
			$store = new ActionScheduler_HybridStore();
		}
		add_action( 'action_scheduler/created_table', array( $store, 'set_autoincrement' ), 10, 2 );

		$store_schema  = new ActionScheduler_StoreSchema();
		$logger_schema = new ActionScheduler_LoggerSchema();
		$store_schema->register_tables( true );
		$logger_schema->register_tables( true );

		remove_action( 'action_scheduler/created_table', array( $store, 'set_autoincrement' ), 10 );
	}
	/**
	 * Implements the logic behind processing an action once an action link is clicked on the list table.
	 *
	 * @param int $action_id
	 * @param string $row_action_type The type of action to perform on the action.
	 */
	protected function process_row_action( $action_id, $row_action_type ) {
		try {
			switch ( $row_action_type ) {
				case 'run' :
					$this->runner->process_action( $action_id, 'Admin List Table' );
					break;
				case 'cancel' :
					$this->store->cancel_action( $action_id );
					break;
			}
			$success = 1;
			$error_message = '';
		} catch ( Exception $e ) {
			$success = 0;
			$error_message = $e->getMessage();
		}

		set_transient( 'action_scheduler_admin_notice', compact( 'action_id', 'success', 'error_message', 'row_action_type' ), 30 );
	}

	/**
	 * {@inheritDoc}
	 */
	public function prepare_items() {
		$this->prepare_column_headers();

		$per_page = $this->get_items_per_page( $this->package . '_items_per_page', $this->items_per_page );
		$query = array(
			'per_page' => $per_page,
			'offset'   => $this->get_items_offset(),
			'status'   => $this->get_request_status(),
			'orderby'  => $this->get_request_orderby(),
			'order'    => $this->get_request_order(),
			'search'   => $this->get_request_search_query(),
		);

		$this->items = array();

		$total_items = $this->store->query_actions( $query, 'count' );

		$status_labels = $this->store->get_status_labels();

		foreach ( $this->store->query_actions( $query ) as $action_id ) {
			try {
				$action = $this->store->fetch_action( $action_id );
			} catch ( Exception $e ) {
				continue;
			}
			if ( is_a( $action, 'ActionScheduler_NullAction' ) ) {
				continue;
			}
			$this->items[ $action_id ] = array(
				'ID'          => $action_id,
				'hook'        => $action->get_hook(),
				'status_name' => $this->store->get_status( $action_id ),
				'status'      => $status_labels[ $this->store->get_status( $action_id ) ],
				'args'        => $action->get_args(),
				'group'       => $action->get_group(),
				'log_entries' => $this->logger->get_logs( $action_id ),
				'claim_id'    => $this->store->get_claim_id( $action_id ),
				'recurrence'  => $this->get_recurrence( $action ),
				'schedule'    => $action->get_schedule(),
			);
		}

		$this->set_pagination_args( array(
			'total_items' => $total_items,
			'per_page'    => $per_page,
			'total_pages' => ceil( $total_items / $per_page ),
		) );
	}

	/**
	 * Prints the available statuses so the user can click to filter.
	 */
	protected function display_filter_by_status() {
		$this->status_counts = $this->store->action_counts();
		parent::display_filter_by_status();
	}

	/**
	 * Get the text to display in the search box on the list table.
	 */
	protected function get_search_box_button_text() {
		return __( 'Search hook, args and claim ID', 'woocommerce' );
	}
}
action-scheduler/classes/abstracts/ActionScheduler_Store.php000064400000030410151335517650020372 0ustar00<?php

/**
 * Class ActionScheduler_Store
 * @codeCoverageIgnore
 */
abstract class ActionScheduler_Store extends ActionScheduler_Store_Deprecated {
	const STATUS_COMPLETE = 'complete';
	const STATUS_PENDING  = 'pending';
	const STATUS_RUNNING  = 'in-progress';
	const STATUS_FAILED   = 'failed';
	const STATUS_CANCELED = 'canceled';
	const DEFAULT_CLASS   = 'ActionScheduler_wpPostStore';

	/** @var ActionScheduler_Store */
	private static $store = NULL;

	/** @var int */
	protected static $max_args_length = 191;

	/**
	 * @param ActionScheduler_Action $action
	 * @param DateTime $scheduled_date Optional Date of the first instance
	 *        to store. Otherwise uses the first date of the action's
	 *        schedule.
	 *
	 * @return int The action ID
	 */
	abstract public function save_action( ActionScheduler_Action $action, DateTime $scheduled_date = NULL );

	/**
	 * @param string $action_id
	 *
	 * @return ActionScheduler_Action
	 */
	abstract public function fetch_action( $action_id );

	/**
	 * Find an action.
	 *
	 * Note: the query ordering changes based on the passed 'status' value.
	 *
	 * @param string $hook Action hook.
	 * @param array  $params Parameters of the action to find.
	 *
	 * @return string|null ID of the next action matching the criteria or NULL if not found.
	 */
	public function find_action( $hook, $params = array() ) {
		$params = wp_parse_args(
			$params,
			array(
				'args'   => null,
				'status' => self::STATUS_PENDING,
				'group'  => '',
			)
		);

		// These params are fixed for this method.
		$params['hook']     = $hook;
		$params['orderby']  = 'date';
		$params['per_page'] = 1;

		if ( ! empty( $params['status'] ) ) {
			if ( self::STATUS_PENDING === $params['status'] ) {
				$params['order'] = 'ASC'; // Find the next action that matches.
			} else {
				$params['order'] = 'DESC'; // Find the most recent action that matches.
			}
		}

		$results = $this->query_actions( $params );

		return empty( $results ) ? null : $results[0];
	}

	/**
	 * Query for action count or list of action IDs.
	 *
	 * @since x.x.x $query['status'] accepts array of statuses instead of a single status.
	 *
	 * @param array  $query {
	 *      Query filtering options.
	 *
	 *      @type string       $hook             The name of the actions. Optional.
	 *      @type string|array $status           The status or statuses of the actions. Optional.
	 *      @type array        $args             The args array of the actions. Optional.
	 *      @type DateTime     $date             The scheduled date of the action. Used in UTC timezone. Optional.
	 *      @type string       $date_compare     Operator for selecting by $date param. Accepted values are '!=', '>', '>=', '<', '<=', '='. Defaults to '<='.
	 *      @type DateTime     $modified         The last modified date of the action. Used in UTC timezone. Optional.
	 *      @type string       $modified_compare Operator for comparing $modified param. Accepted values are '!=', '>', '>=', '<', '<=', '='. Defaults to '<='.
	 *      @type string       $group            The group the action belongs to. Optional.
	 *      @type bool|int     $claimed          TRUE to find claimed actions, FALSE to find unclaimed actions, an int to find a specific claim ID. Optional.
	 *      @type int          $per_page         Number of results to return. Defaults to 5.
	 *      @type int          $offset           The query pagination offset. Defaults to 0.
	 *      @type int          $orderby          Accepted values are 'hook', 'group', 'modified', 'date' or 'none'. Defaults to 'date'.
	 *      @type string       $order            Accepted values are 'ASC' or 'DESC'. Defaults to 'ASC'.
	 * }
	 * @param string $query_type Whether to select or count the results. Default, select.
	 *
	 * @return string|array|null The IDs of actions matching the query. Null on failure.
	 */
	abstract public function query_actions( $query = array(), $query_type = 'select' );

	/**
	 * Run query to get a single action ID.
	 *
	 * @since x.x.x
	 *
	 * @see ActionScheduler_Store::query_actions for $query arg usage but 'per_page' and 'offset' can't be used.
	 *
	 * @param array $query Query parameters.
	 *
	 * @return int|null
	 */
	public function query_action( $query ) {
		$query['per_page'] = 1;
		$query['offset']   = 0;
		$results           = $this->query_actions( $query );

		if ( empty( $results ) ) {
			return null;
		} else {
			return (int) $results[0];
		}
	}

	/**
	 * Get a count of all actions in the store, grouped by status
	 *
	 * @return array
	 */
	abstract public function action_counts();

	/**
	 * @param string $action_id
	 */
	abstract public function cancel_action( $action_id );

	/**
	 * @param string $action_id
	 */
	abstract public function delete_action( $action_id );

	/**
	 * @param string $action_id
	 *
	 * @return DateTime The date the action is schedule to run, or the date that it ran.
	 */
	abstract public function get_date( $action_id );


	/**
	 * @param int      $max_actions
	 * @param DateTime $before_date Claim only actions schedule before the given date. Defaults to now.
	 * @param array    $hooks       Claim only actions with a hook or hooks.
	 * @param string   $group       Claim only actions in the given group.
	 *
	 * @return ActionScheduler_ActionClaim
	 */
	abstract public function stake_claim( $max_actions = 10, DateTime $before_date = null, $hooks = array(), $group = '' );

	/**
	 * @return int
	 */
	abstract public function get_claim_count();

	/**
	 * @param ActionScheduler_ActionClaim $claim
	 */
	abstract public function release_claim( ActionScheduler_ActionClaim $claim );

	/**
	 * @param string $action_id
	 */
	abstract public function unclaim_action( $action_id );

	/**
	 * @param string $action_id
	 */
	abstract public function mark_failure( $action_id );

	/**
	 * @param string $action_id
	 */
	abstract public function log_execution( $action_id );

	/**
	 * @param string $action_id
	 */
	abstract public function mark_complete( $action_id );

	/**
	 * @param string $action_id
	 *
	 * @return string
	 */
	abstract public function get_status( $action_id );

	/**
	 * @param string $action_id
	 * @return mixed
	 */
	abstract public function get_claim_id( $action_id );

	/**
	 * @param string $claim_id
	 * @return array
	 */
	abstract public function find_actions_by_claim_id( $claim_id );

	/**
	 * @param string $comparison_operator
	 * @return string
	 */
	protected function validate_sql_comparator( $comparison_operator ) {
		if ( in_array( $comparison_operator, array('!=', '>', '>=', '<', '<=', '=') ) ) {
			return $comparison_operator;
		}
		return '=';
	}

	/**
	 * Get the time MySQL formated date/time string for an action's (next) scheduled date.
	 *
	 * @param ActionScheduler_Action $action
	 * @param DateTime $scheduled_date (optional)
	 * @return string
	 */
	protected function get_scheduled_date_string( ActionScheduler_Action $action, DateTime $scheduled_date = NULL ) {
		$next = null === $scheduled_date ? $action->get_schedule()->get_date() : $scheduled_date;
		if ( ! $next ) {
			return '0000-00-00 00:00:00';
		}
		$next->setTimezone( new DateTimeZone( 'UTC' ) );

		return $next->format( 'Y-m-d H:i:s' );
	}

	/**
	 * Get the time MySQL formated date/time string for an action's (next) scheduled date.
	 *
	 * @param ActionScheduler_Action $action
	 * @param DateTime $scheduled_date (optional)
	 * @return string
	 */
	protected function get_scheduled_date_string_local( ActionScheduler_Action $action, DateTime $scheduled_date = NULL ) {
		$next = null === $scheduled_date ? $action->get_schedule()->get_date() : $scheduled_date;
		if ( ! $next ) {
			return '0000-00-00 00:00:00';
		}

		ActionScheduler_TimezoneHelper::set_local_timezone( $next );
		return $next->format( 'Y-m-d H:i:s' );
	}

	/**
	 * Validate that we could decode action arguments.
	 *
	 * @param mixed $args      The decoded arguments.
	 * @param int   $action_id The action ID.
	 *
	 * @throws ActionScheduler_InvalidActionException When the decoded arguments are invalid.
	 */
	protected function validate_args( $args, $action_id ) {
		// Ensure we have an array of args.
		if ( ! is_array( $args ) ) {
			throw ActionScheduler_InvalidActionException::from_decoding_args( $action_id );
		}

		// Validate JSON decoding if possible.
		if ( function_exists( 'json_last_error' ) && JSON_ERROR_NONE !== json_last_error() ) {
			throw ActionScheduler_InvalidActionException::from_decoding_args( $action_id, $args );
		}
	}

	/**
	 * Validate a ActionScheduler_Schedule object.
	 *
	 * @param mixed $schedule  The unserialized ActionScheduler_Schedule object.
	 * @param int   $action_id The action ID.
	 *
	 * @throws ActionScheduler_InvalidActionException When the schedule is invalid.
	 */
	protected function validate_schedule( $schedule, $action_id ) {
		if ( empty( $schedule ) || ! is_a( $schedule, 'ActionScheduler_Schedule' ) ) {
			throw ActionScheduler_InvalidActionException::from_schedule( $action_id, $schedule );
		}
	}

	/**
	 * InnoDB indexes have a maximum size of 767 bytes by default, which is only 191 characters with utf8mb4.
	 *
	 * Previously, AS wasn't concerned about args length, as we used the (unindex) post_content column. However,
	 * with custom tables, we use an indexed VARCHAR column instead.
	 *
	 * @param  ActionScheduler_Action $action Action to be validated.
	 * @throws InvalidArgumentException When json encoded args is too long.
	 */
	protected function validate_action( ActionScheduler_Action $action ) {
		if ( strlen( json_encode( $action->get_args() ) ) > static::$max_args_length ) {
			throw new InvalidArgumentException( sprintf( __( 'ActionScheduler_Action::$args too long. To ensure the args column can be indexed, action args should not be more than %d characters when encoded as JSON.', 'woocommerce' ), static::$max_args_length ) );
		}
	}

	/**
	 * Cancel pending actions by hook.
	 *
	 * @since 3.0.0
	 *
	 * @param string $hook Hook name.
	 *
	 * @return void
	 */
	public function cancel_actions_by_hook( $hook ) {
		$action_ids = true;
		while ( ! empty( $action_ids ) ) {
			$action_ids = $this->query_actions(
				array(
					'hook'     => $hook,
					'status'   => self::STATUS_PENDING,
					'per_page' => 1000,
					'orderby'  => 'action_id',
				)
			);

			$this->bulk_cancel_actions( $action_ids );
		}
	}

	/**
	 * Cancel pending actions by group.
	 *
	 * @since 3.0.0
	 *
	 * @param string $group Group slug.
	 *
	 * @return void
	 */
	public function cancel_actions_by_group( $group ) {
		$action_ids = true;
		while ( ! empty( $action_ids ) ) {
			$action_ids = $this->query_actions(
				array(
					'group'    => $group,
					'status'   => self::STATUS_PENDING,
					'per_page' => 1000,
					'orderby'  => 'action_id',
				)
			);

			$this->bulk_cancel_actions( $action_ids );
		}
	}

	/**
	 * Cancel a set of action IDs.
	 *
	 * @since 3.0.0
	 *
	 * @param array $action_ids List of action IDs.
	 *
	 * @return void
	 */
	private function bulk_cancel_actions( $action_ids ) {
		foreach ( $action_ids as $action_id ) {
			$this->cancel_action( $action_id );
		}

		do_action( 'action_scheduler_bulk_cancel_actions', $action_ids );
	}

	/**
	 * @return array
	 */
	public function get_status_labels() {
		return array(
			self::STATUS_COMPLETE => __( 'Complete', 'woocommerce' ),
			self::STATUS_PENDING  => __( 'Pending', 'woocommerce' ),
			self::STATUS_RUNNING  => __( 'In-progress', 'woocommerce' ),
			self::STATUS_FAILED   => __( 'Failed', 'woocommerce' ),
			self::STATUS_CANCELED => __( 'Canceled', 'woocommerce' ),
		);
	}

	/**
	 * Check if there are any pending scheduled actions due to run.
	 *
	 * @param ActionScheduler_Action $action
	 * @param DateTime $scheduled_date (optional)
	 * @return string
	 */
	public function has_pending_actions_due() {
		$pending_actions = $this->query_actions( array(
			'date'    => as_get_datetime_object(),
			'status'  => ActionScheduler_Store::STATUS_PENDING,
			'orderby' => 'none',
		) );

		return ! empty( $pending_actions );
	}

	/**
	 * Callable initialization function optionally overridden in derived classes.
	 */
	public function init() {}

	/**
	 * Callable function to mark an action as migrated optionally overridden in derived classes.
	 */
	public function mark_migrated( $action_id ) {}

	/**
	 * @return ActionScheduler_Store
	 */
	public static function instance() {
		if ( empty( self::$store ) ) {
			$class = apply_filters( 'action_scheduler_store_class', self::DEFAULT_CLASS );
			self::$store = new $class();
		}
		return self::$store;
	}
}
action-scheduler/classes/abstracts/ActionScheduler.php000064400000021053151335517650017221 0ustar00<?php

use Action_Scheduler\WP_CLI\Migration_Command;
use Action_Scheduler\Migration\Controller;

/**
 * Class ActionScheduler
 * @codeCoverageIgnore
 */
abstract class ActionScheduler {
	private static $plugin_file = '';
	/** @var ActionScheduler_ActionFactory */
	private static $factory = NULL;
	/** @var bool */
	private static $data_store_initialized = false;

	public static function factory() {
		if ( !isset(self::$factory) ) {
			self::$factory = new ActionScheduler_ActionFactory();
		}
		return self::$factory;
	}

	public static function store() {
		return ActionScheduler_Store::instance();
	}

	public static function lock() {
		return ActionScheduler_Lock::instance();
	}

	public static function logger() {
		return ActionScheduler_Logger::instance();
	}

	public static function runner() {
		return ActionScheduler_QueueRunner::instance();
	}

	public static function admin_view() {
		return ActionScheduler_AdminView::instance();
	}

	/**
	 * Get the absolute system path to the plugin directory, or a file therein
	 * @static
	 * @param string $path
	 * @return string
	 */
	public static function plugin_path( $path ) {
		$base = dirname(self::$plugin_file);
		if ( $path ) {
			return trailingslashit($base).$path;
		} else {
			return untrailingslashit($base);
		}
	}

	/**
	 * Get the absolute URL to the plugin directory, or a file therein
	 * @static
	 * @param string $path
	 * @return string
	 */
	public static function plugin_url( $path ) {
		return plugins_url($path, self::$plugin_file);
	}

	public static function autoload( $class ) {
		$d           = DIRECTORY_SEPARATOR;
		$classes_dir = self::plugin_path( 'classes' . $d );
		$separator   = strrpos( $class, '\\' );
		if ( false !== $separator ) {
			if ( 0 !== strpos( $class, 'Action_Scheduler' ) ) {
				return;
			}
			$class = substr( $class, $separator + 1 );
		}

		if ( 'Deprecated' === substr( $class, -10 ) ) {
			$dir = self::plugin_path( 'deprecated' . $d );
		} elseif ( self::is_class_abstract( $class ) ) {
			$dir = $classes_dir . 'abstracts' . $d;
		} elseif ( self::is_class_migration( $class ) ) {
			$dir = $classes_dir . 'migration' . $d;
		} elseif ( 'Schedule' === substr( $class, -8 ) ) {
			$dir = $classes_dir . 'schedules' . $d;
		} elseif ( 'Action' === substr( $class, -6 ) ) {
			$dir = $classes_dir . 'actions' . $d;
		} elseif ( 'Schema' === substr( $class, -6 ) ) {
			$dir = $classes_dir . 'schema' . $d;
		} elseif ( strpos( $class, 'ActionScheduler' ) === 0 ) {
			$segments = explode( '_', $class );
			$type = isset( $segments[ 1 ] ) ? $segments[ 1 ] : '';

			switch ( $type ) {
				case 'WPCLI':
					$dir = $classes_dir . 'WP_CLI' . $d;
					break;
				case 'DBLogger':
				case 'DBStore':
				case 'HybridStore':
				case 'wpPostStore':
				case 'wpCommentLogger':
					$dir = $classes_dir . 'data-stores' . $d;
					break;
				default:
					$dir = $classes_dir;
					break;
			}
		} elseif ( self::is_class_cli( $class ) ) {
			$dir = $classes_dir . 'WP_CLI' . $d;
		} elseif ( strpos( $class, 'CronExpression' ) === 0 ) {
			$dir = self::plugin_path( 'lib' . $d . 'cron-expression' . $d );
		} elseif ( strpos( $class, 'WP_Async_Request' ) === 0 ) {
			$dir = self::plugin_path( 'lib' . $d );
		} else {
			return;
		}

		if ( file_exists( "{$dir}{$class}.php" ) ) {
			include( "{$dir}{$class}.php" );
			return;
		}
	}

	/**
	 * Initialize the plugin
	 *
	 * @static
	 * @param string $plugin_file
	 */
	public static function init( $plugin_file ) {
		self::$plugin_file = $plugin_file;
		spl_autoload_register( array( __CLASS__, 'autoload' ) );

		/**
		 * Fires in the early stages of Action Scheduler init hook.
		 */
		do_action( 'action_scheduler_pre_init' );

		require_once( self::plugin_path( 'functions.php' ) );
		ActionScheduler_DataController::init();

		$store      = self::store();
		$logger     = self::logger();
		$runner     = self::runner();
		$admin_view = self::admin_view();

		// Ensure initialization on plugin activation.
		if ( ! did_action( 'init' ) ) {
			add_action( 'init', array( $admin_view, 'init' ), 0, 0 ); // run before $store::init()
			add_action( 'init', array( $store, 'init' ), 1, 0 );
			add_action( 'init', array( $logger, 'init' ), 1, 0 );
			add_action( 'init', array( $runner, 'init' ), 1, 0 );
		} else {
			$admin_view->init();
			$store->init();
			$logger->init();
			$runner->init();
		}

		if ( apply_filters( 'action_scheduler_load_deprecated_functions', true ) ) {
			require_once( self::plugin_path( 'deprecated/functions.php' ) );
		}

		if ( defined( 'WP_CLI' ) && WP_CLI ) {
			WP_CLI::add_command( 'action-scheduler', 'ActionScheduler_WPCLI_Scheduler_command' );
			if ( ! ActionScheduler_DataController::is_migration_complete() && Controller::instance()->allow_migration() ) {
				$command = new Migration_Command();
				$command->register();
			}
		}

		self::$data_store_initialized = true;

		/**
		 * Handle WP comment cleanup after migration.
		 */
		if ( is_a( $logger, 'ActionScheduler_DBLogger' ) && ActionScheduler_DataController::is_migration_complete() && ActionScheduler_WPCommentCleaner::has_logs() ) {
			ActionScheduler_WPCommentCleaner::init();
		}

		add_action( 'action_scheduler/migration_complete', 'ActionScheduler_WPCommentCleaner::maybe_schedule_cleanup' );
	}

	/**
	 * Check whether the AS data store has been initialized.
	 *
	 * @param string $function_name The name of the function being called. Optional. Default `null`.
	 * @return bool
	 */
	public static function is_initialized( $function_name = null ) {
		if ( ! self::$data_store_initialized && ! empty( $function_name ) ) {
			$message = sprintf( __( '%s() was called before the Action Scheduler data store was initialized', 'woocommerce' ), esc_attr( $function_name ) );
			error_log( $message, E_WARNING );
		}

		return self::$data_store_initialized;
	}

	/**
	 * Determine if the class is one of our abstract classes.
	 *
	 * @since 3.0.0
	 *
	 * @param string $class The class name.
	 *
	 * @return bool
	 */
	protected static function is_class_abstract( $class ) {
		static $abstracts = array(
			'ActionScheduler'                            => true,
			'ActionScheduler_Abstract_ListTable'         => true,
			'ActionScheduler_Abstract_QueueRunner'       => true,
			'ActionScheduler_Abstract_Schedule'          => true,
			'ActionScheduler_Abstract_RecurringSchedule' => true,
			'ActionScheduler_Lock'                       => true,
			'ActionScheduler_Logger'                     => true,
			'ActionScheduler_Abstract_Schema'            => true,
			'ActionScheduler_Store'                      => true,
			'ActionScheduler_TimezoneHelper'             => true,
		);

		return isset( $abstracts[ $class ] ) && $abstracts[ $class ];
	}

	/**
	 * Determine if the class is one of our migration classes.
	 *
	 * @since 3.0.0
	 *
	 * @param string $class The class name.
	 *
	 * @return bool
	 */
	protected static function is_class_migration( $class ) {
		static $migration_segments = array(
			'ActionMigrator'  => true,
			'BatchFetcher'    => true,
			'DBStoreMigrator' => true,
			'DryRun'          => true,
			'LogMigrator'     => true,
			'Config'          => true,
			'Controller'      => true,
			'Runner'          => true,
			'Scheduler'       => true,
		);

		$segments = explode( '_', $class );
		$segment = isset( $segments[ 1 ] ) ? $segments[ 1 ] : $class;

		return isset( $migration_segments[ $segment ] ) && $migration_segments[ $segment ];
	}

	/**
	 * Determine if the class is one of our WP CLI classes.
	 *
	 * @since 3.0.0
	 *
	 * @param string $class The class name.
	 *
	 * @return bool
	 */
	protected static function is_class_cli( $class ) {
		static $cli_segments = array(
			'QueueRunner' => true,
			'Command'     => true,
			'ProgressBar' => true,
		);

		$segments = explode( '_', $class );
		$segment = isset( $segments[ 1 ] ) ? $segments[ 1 ] : $class;

		return isset( $cli_segments[ $segment ] ) && $cli_segments[ $segment ];
	}

	final public function __clone() {
		trigger_error("Singleton. No cloning allowed!", E_USER_ERROR);
	}

	final public function __wakeup() {
		trigger_error("Singleton. No serialization allowed!", E_USER_ERROR);
	}

	final private function __construct() {}

	/** Deprecated **/

	public static function get_datetime_object( $when = null, $timezone = 'UTC' ) {
		_deprecated_function( __METHOD__, '2.0', 'wcs_add_months()' );
		return as_get_datetime_object( $when, $timezone );
	}

	/**
	 * Issue deprecated warning if an Action Scheduler function is called in the shutdown hook.
	 *
	 * @param string $function_name The name of the function being called.
	 * @deprecated 3.1.6.
	 */
	public static function check_shutdown_hook( $function_name ) {
		_deprecated_function( __FUNCTION__, '3.1.6' );
	}
}
action-scheduler/classes/abstracts/ActionScheduler_Abstract_Schedule.php000064400000003426151335517650022664 0ustar00<?php

/**
 * Class ActionScheduler_Abstract_Schedule
 */
abstract class ActionScheduler_Abstract_Schedule extends ActionScheduler_Schedule_Deprecated {

	/**
	 * The date & time the schedule is set to run.
	 *
	 * @var DateTime
	 */
	private $scheduled_date = NULL;

	/**
	 * Timestamp equivalent of @see $this->scheduled_date
	 *
	 * @var int
	 */
	protected $scheduled_timestamp = NULL;

	/**
	 * @param DateTime $date The date & time to run the action.
	 */
	public function __construct( DateTime $date ) {
		$this->scheduled_date = $date;
	}

	/**
	 * Check if a schedule should recur.
	 *
	 * @return bool
	 */
	abstract public function is_recurring();

	/**
	 * Calculate when the next instance of this schedule would run based on a given date & time.
	 *
	 * @param DateTime $after
	 * @return DateTime
	 */
	abstract protected function calculate_next( DateTime $after );

	/**
	 * Get the next date & time when this schedule should run after a given date & time.
	 *
	 * @param DateTime $after
	 * @return DateTime|null
	 */
	public function get_next( DateTime $after ) {
		$after = clone $after;
		if ( $after > $this->scheduled_date ) {
			$after = $this->calculate_next( $after );
			return $after;
		}
		return clone $this->scheduled_date;
	}

	/**
	 * Get the date & time the schedule is set to run.
	 *
	 * @return DateTime|null
	 */
	public function get_date() {
		return $this->scheduled_date;
	}

	/**
	 * For PHP 5.2 compat, since DateTime objects can't be serialized
	 * @return array
	 */
	public function __sleep() {
		$this->scheduled_timestamp = $this->scheduled_date->getTimestamp();
		return array(
			'scheduled_timestamp',
		);
	}

	public function __wakeup() {
		$this->scheduled_date = as_get_datetime_object( $this->scheduled_timestamp );
		unset( $this->scheduled_timestamp );
	}
}
action-scheduler/classes/abstracts/ActionScheduler_Abstract_QueueRunner.php000064400000020013151335517650023375 0ustar00<?php

/**
 * Abstract class with common Queue Cleaner functionality.
 */
abstract class ActionScheduler_Abstract_QueueRunner extends ActionScheduler_Abstract_QueueRunner_Deprecated {

	/** @var ActionScheduler_QueueCleaner */
	protected $cleaner;

	/** @var ActionScheduler_FatalErrorMonitor */
	protected $monitor;

	/** @var ActionScheduler_Store */
	protected $store;

	/**
	 * The created time.
	 *
	 * Represents when the queue runner was constructed and used when calculating how long a PHP request has been running.
	 * For this reason it should be as close as possible to the PHP request start time.
	 *
	 * @var int
	 */
	private $created_time;

	/**
	 * ActionScheduler_Abstract_QueueRunner constructor.
	 *
	 * @param ActionScheduler_Store             $store
	 * @param ActionScheduler_FatalErrorMonitor $monitor
	 * @param ActionScheduler_QueueCleaner      $cleaner
	 */
	public function __construct( ActionScheduler_Store $store = null, ActionScheduler_FatalErrorMonitor $monitor = null, ActionScheduler_QueueCleaner $cleaner = null ) {

		$this->created_time = microtime( true );

		$this->store   = $store ? $store : ActionScheduler_Store::instance();
		$this->monitor = $monitor ? $monitor : new ActionScheduler_FatalErrorMonitor( $this->store );
		$this->cleaner = $cleaner ? $cleaner : new ActionScheduler_QueueCleaner( $this->store );
	}

	/**
	 * Process an individual action.
	 *
	 * @param int $action_id The action ID to process.
	 * @param string $context Optional identifer for the context in which this action is being processed, e.g. 'WP CLI' or 'WP Cron'
	 *        Generally, this should be capitalised and not localised as it's a proper noun.
	 */
	public function process_action( $action_id, $context = '' ) {
		try {
			$valid_action = false;
			do_action( 'action_scheduler_before_execute', $action_id, $context );

			if ( ActionScheduler_Store::STATUS_PENDING !== $this->store->get_status( $action_id ) ) {
				do_action( 'action_scheduler_execution_ignored', $action_id, $context );
				return;
			}

			$valid_action = true;
			do_action( 'action_scheduler_begin_execute', $action_id, $context );

			$action = $this->store->fetch_action( $action_id );
			$this->store->log_execution( $action_id );
			$action->execute();
			do_action( 'action_scheduler_after_execute', $action_id, $action, $context );
			$this->store->mark_complete( $action_id );
		} catch ( Exception $e ) {
			if ( $valid_action ) {
				$this->store->mark_failure( $action_id );
				do_action( 'action_scheduler_failed_execution', $action_id, $e, $context );
			} else {
				do_action( 'action_scheduler_failed_validation', $action_id, $e, $context );
			}
		}

		if ( isset( $action ) && is_a( $action, 'ActionScheduler_Action' ) && $action->get_schedule()->is_recurring() ) {
			$this->schedule_next_instance( $action, $action_id );
		}
	}

	/**
	 * Schedule the next instance of the action if necessary.
	 *
	 * @param ActionScheduler_Action $action
	 * @param int $action_id
	 */
	protected function schedule_next_instance( ActionScheduler_Action $action, $action_id ) {
		try {
			ActionScheduler::factory()->repeat( $action );
		} catch ( Exception $e ) {
			do_action( 'action_scheduler_failed_to_schedule_next_instance', $action_id, $e, $action );
		}
	}

	/**
	 * Run the queue cleaner.
	 *
	 * @author Jeremy Pry
	 */
	protected function run_cleanup() {
		$this->cleaner->clean( 10 * $this->get_time_limit() );
	}

	/**
	 * Get the number of concurrent batches a runner allows.
	 *
	 * @return int
	 */
	public function get_allowed_concurrent_batches() {
		return apply_filters( 'action_scheduler_queue_runner_concurrent_batches', 1 );
	}

	/**
	 * Check if the number of allowed concurrent batches is met or exceeded.
	 *
	 * @return bool
	 */
	public function has_maximum_concurrent_batches() {
		return $this->store->get_claim_count() >= $this->get_allowed_concurrent_batches();
	}

	/**
	 * Get the maximum number of seconds a batch can run for.
	 *
	 * @return int The number of seconds.
	 */
	protected function get_time_limit() {

		$time_limit = 30;

		// Apply deprecated filter from deprecated get_maximum_execution_time() method
		if ( has_filter( 'action_scheduler_maximum_execution_time' ) ) {
			_deprecated_function( 'action_scheduler_maximum_execution_time', '2.1.1', 'action_scheduler_queue_runner_time_limit' );
			$time_limit = apply_filters( 'action_scheduler_maximum_execution_time', $time_limit );
		}

		return absint( apply_filters( 'action_scheduler_queue_runner_time_limit', $time_limit ) );
	}

	/**
	 * Get the number of seconds the process has been running.
	 *
	 * @return int The number of seconds.
	 */
	protected function get_execution_time() {
		$execution_time = microtime( true ) - $this->created_time;

		// Get the CPU time if the hosting environment uses it rather than wall-clock time to calculate a process's execution time.
		if ( function_exists( 'getrusage' ) && apply_filters( 'action_scheduler_use_cpu_execution_time', defined( 'PANTHEON_ENVIRONMENT' ) ) ) {
			$resource_usages = getrusage();

			if ( isset( $resource_usages['ru_stime.tv_usec'], $resource_usages['ru_stime.tv_usec'] ) ) {
				$execution_time = $resource_usages['ru_stime.tv_sec'] + ( $resource_usages['ru_stime.tv_usec'] / 1000000 );
			}
		}

		return $execution_time;
	}

	/**
	 * Check if the host's max execution time is (likely) to be exceeded if processing more actions.
	 *
	 * @param int $processed_actions The number of actions processed so far - used to determine the likelihood of exceeding the time limit if processing another action
	 * @return bool
	 */
	protected function time_likely_to_be_exceeded( $processed_actions ) {

		$execution_time        = $this->get_execution_time();
		$max_execution_time    = $this->get_time_limit();
		$time_per_action       = $execution_time / $processed_actions;
		$estimated_time        = $execution_time + ( $time_per_action * 3 );
		$likely_to_be_exceeded = $estimated_time > $max_execution_time;

		return apply_filters( 'action_scheduler_maximum_execution_time_likely_to_be_exceeded', $likely_to_be_exceeded, $this, $processed_actions, $execution_time, $max_execution_time );
	}

	/**
	 * Get memory limit
	 *
	 * Based on WP_Background_Process::get_memory_limit()
	 *
	 * @return int
	 */
	protected function get_memory_limit() {
		if ( function_exists( 'ini_get' ) ) {
			$memory_limit = ini_get( 'memory_limit' );
		} else {
			$memory_limit = '128M'; // Sensible default, and minimum required by WooCommerce
		}

		if ( ! $memory_limit || -1 === $memory_limit || '-1' === $memory_limit ) {
			// Unlimited, set to 32GB.
			$memory_limit = '32G';
		}

		return ActionScheduler_Compatibility::convert_hr_to_bytes( $memory_limit );
	}

	/**
	 * Memory exceeded
	 *
	 * Ensures the batch process never exceeds 90% of the maximum WordPress memory.
	 *
	 * Based on WP_Background_Process::memory_exceeded()
	 *
	 * @return bool
	 */
	protected function memory_exceeded() {

		$memory_limit    = $this->get_memory_limit() * 0.90;
		$current_memory  = memory_get_usage( true );
		$memory_exceeded = $current_memory >= $memory_limit;

		return apply_filters( 'action_scheduler_memory_exceeded', $memory_exceeded, $this );
	}

	/**
	 * See if the batch limits have been exceeded, which is when memory usage is almost at
	 * the maximum limit, or the time to process more actions will exceed the max time limit.
	 *
	 * Based on WC_Background_Process::batch_limits_exceeded()
	 *
	 * @param int $processed_actions The number of actions processed so far - used to determine the likelihood of exceeding the time limit if processing another action
	 * @return bool
	 */
	protected function batch_limits_exceeded( $processed_actions ) {
		return $this->memory_exceeded() || $this->time_likely_to_be_exceeded( $processed_actions );
	}

	/**
	 * Process actions in the queue.
	 *
	 * @author Jeremy Pry
	 * @param string $context Optional identifer for the context in which this action is being processed, e.g. 'WP CLI' or 'WP Cron'
	 *        Generally, this should be capitalised and not localised as it's a proper noun.
	 * @return int The number of actions processed.
	 */
	abstract public function run( $context = '' );
}
action-scheduler/classes/abstracts/ActionScheduler_Lock.php000064400000003133151335517650020170 0ustar00<?php

/**
 * Abstract class for setting a basic lock to throttle some action.
 *
 * Class ActionScheduler_Lock
 */
abstract class ActionScheduler_Lock {

	/** @var ActionScheduler_Lock */
	private static $locker = NULL;

	/** @var int */
	protected static $lock_duration = MINUTE_IN_SECONDS;

	/**
	 * Check if a lock is set for a given lock type.
	 *
	 * @param string $lock_type A string to identify different lock types.
	 * @return bool
	 */
	public function is_locked( $lock_type ) {
		return ( $this->get_expiration( $lock_type ) >= time() );
	}

	/**
	 * Set a lock.
	 *
	 * @param string $lock_type A string to identify different lock types.
	 * @return bool
	 */
	abstract public function set( $lock_type );

	/**
	 * If a lock is set, return the timestamp it was set to expiry.
	 *
	 * @param string $lock_type A string to identify different lock types.
	 * @return bool|int False if no lock is set, otherwise the timestamp for when the lock is set to expire.
	 */
	abstract public function get_expiration( $lock_type );

	/**
	 * Get the amount of time to set for a given lock. 60 seconds by default.
	 *
	 * @param string $lock_type A string to identify different lock types.
	 * @return int
	 */
	protected function get_duration( $lock_type ) {
		return apply_filters( 'action_scheduler_lock_duration', self::$lock_duration, $lock_type );
	}

	/**
	 * @return ActionScheduler_Lock
	 */
	public static function instance() {
		if ( empty( self::$locker ) ) {
			$class = apply_filters( 'action_scheduler_lock_class', 'ActionScheduler_OptionLock' );
			self::$locker = new $class();
		}
		return self::$locker;
	}
}
action-scheduler/classes/abstracts/ActionScheduler_Logger.php000064400000014002151335517650020514 0ustar00<?php

/**
 * Class ActionScheduler_Logger
 * @codeCoverageIgnore
 */
abstract class ActionScheduler_Logger {
	private static $logger = NULL;

	/**
	 * @return ActionScheduler_Logger
	 */
	public static function instance() {
		if ( empty(self::$logger) ) {
			$class = apply_filters('action_scheduler_logger_class', 'ActionScheduler_wpCommentLogger');
			self::$logger = new $class();
		}
		return self::$logger;
	}

	/**
	 * @param string $action_id
	 * @param string $message
	 * @param DateTime $date
	 *
	 * @return string The log entry ID
	 */
	abstract public function log( $action_id, $message, DateTime $date = NULL );

	/**
	 * @param string $entry_id
	 *
	 * @return ActionScheduler_LogEntry
	 */
	abstract public function get_entry( $entry_id );

	/**
	 * @param string $action_id
	 *
	 * @return ActionScheduler_LogEntry[]
	 */
	abstract public function get_logs( $action_id );


	/**
	 * @codeCoverageIgnore
	 */
	public function init() {
		$this->hook_stored_action();
		add_action( 'action_scheduler_canceled_action', array( $this, 'log_canceled_action' ), 10, 1 );
		add_action( 'action_scheduler_begin_execute', array( $this, 'log_started_action' ), 10, 2 );
		add_action( 'action_scheduler_after_execute', array( $this, 'log_completed_action' ), 10, 3 );
		add_action( 'action_scheduler_failed_execution', array( $this, 'log_failed_action' ), 10, 3 );
		add_action( 'action_scheduler_failed_action', array( $this, 'log_timed_out_action' ), 10, 2 );
		add_action( 'action_scheduler_unexpected_shutdown', array( $this, 'log_unexpected_shutdown' ), 10, 2 );
		add_action( 'action_scheduler_reset_action', array( $this, 'log_reset_action' ), 10, 1 );
		add_action( 'action_scheduler_execution_ignored', array( $this, 'log_ignored_action' ), 10, 2 );
		add_action( 'action_scheduler_failed_fetch_action', array( $this, 'log_failed_fetch_action' ), 10, 2 );
		add_action( 'action_scheduler_failed_to_schedule_next_instance', array( $this, 'log_failed_schedule_next_instance' ), 10, 2 );
		add_action( 'action_scheduler_bulk_cancel_actions', array( $this, 'bulk_log_cancel_actions' ), 10, 1 );
	}

	public function hook_stored_action() {
		add_action( 'action_scheduler_stored_action', array( $this, 'log_stored_action' ) );
	}

	public function unhook_stored_action() {
		remove_action( 'action_scheduler_stored_action', array( $this, 'log_stored_action' ) );
	}

	public function log_stored_action( $action_id ) {
		$this->log( $action_id, __( 'action created', 'woocommerce' ) );
	}

	public function log_canceled_action( $action_id ) {
		$this->log( $action_id, __( 'action canceled', 'woocommerce' ) );
	}

	public function log_started_action( $action_id, $context = '' ) {
		if ( ! empty( $context ) ) {
			/* translators: %s: context */
			$message = sprintf( __( 'action started via %s', 'woocommerce' ), $context );
		} else {
			$message = __( 'action started', 'woocommerce' );
		}
		$this->log( $action_id, $message );
	}

	public function log_completed_action( $action_id, $action = NULL, $context = '' ) {
		if ( ! empty( $context ) ) {
			/* translators: %s: context */
			$message = sprintf( __( 'action complete via %s', 'woocommerce' ), $context );
		} else {
			$message = __( 'action complete', 'woocommerce' );
		}
		$this->log( $action_id, $message );
	}

	public function log_failed_action( $action_id, Exception $exception, $context = '' ) {
		if ( ! empty( $context ) ) {
			/* translators: 1: context 2: exception message */
			$message = sprintf( __( 'action failed via %1$s: %2$s', 'woocommerce' ), $context, $exception->getMessage() );
		} else {
			/* translators: %s: exception message */
			$message = sprintf( __( 'action failed: %s', 'woocommerce' ), $exception->getMessage() );
		}
		$this->log( $action_id, $message );
	}

	public function log_timed_out_action( $action_id, $timeout ) {
		/* translators: %s: amount of time */
		$this->log( $action_id, sprintf( __( 'action timed out after %s seconds', 'woocommerce' ), $timeout ) );
	}

	public function log_unexpected_shutdown( $action_id, $error ) {
		if ( ! empty( $error ) ) {
			/* translators: 1: error message 2: filename 3: line */
			$this->log( $action_id, sprintf( __( 'unexpected shutdown: PHP Fatal error %1$s in %2$s on line %3$s', 'woocommerce' ), $error['message'], $error['file'], $error['line'] ) );
		}
	}

	public function log_reset_action( $action_id ) {
		$this->log( $action_id, __( 'action reset', 'woocommerce' ) );
	}

	public function log_ignored_action( $action_id, $context = '' ) {
		if ( ! empty( $context ) ) {
			/* translators: %s: context */
			$message = sprintf( __( 'action ignored via %s', 'woocommerce' ), $context );
		} else {
			$message = __( 'action ignored', 'woocommerce' );
		}
		$this->log( $action_id, $message );
	}

	/**
	 * @param string $action_id
	 * @param Exception|NULL $exception The exception which occured when fetching the action. NULL by default for backward compatibility.
	 *
	 * @return ActionScheduler_LogEntry[]
	 */
	public function log_failed_fetch_action( $action_id, Exception $exception = NULL ) {

		if ( ! is_null( $exception ) ) {
			/* translators: %s: exception message */
			$log_message = sprintf( __( 'There was a failure fetching this action: %s', 'woocommerce' ), $exception->getMessage() );
		} else {
			$log_message = __( 'There was a failure fetching this action', 'woocommerce' );
		}

		$this->log( $action_id, $log_message );
	}

	public function log_failed_schedule_next_instance( $action_id, Exception $exception ) {
		/* translators: %s: exception message */
		$this->log( $action_id, sprintf( __( 'There was a failure scheduling the next instance of this action: %s', 'woocommerce' ), $exception->getMessage() ) );
	}

	/**
	 * Bulk add cancel action log entries.
	 *
	 * Implemented here for backward compatibility. Should be implemented in parent loggers
	 * for more performant bulk logging.
	 *
	 * @param array $action_ids List of action ID.
	 */
	public function bulk_log_cancel_actions( $action_ids ) {
		if ( empty( $action_ids ) ) {
			return;
		}

		foreach ( $action_ids as $action_id ) {
			$this->log_canceled_action( $action_id );
		}
	}
}
action-scheduler/classes/abstracts/ActionScheduler_Abstract_Schema.php000064400000011041151335517650022320 0ustar00<?php


/**
 * Class ActionScheduler_Abstract_Schema
 *
 * @package Action_Scheduler
 *
 * @codeCoverageIgnore
 *
 * Utility class for creating/updating custom tables
 */
abstract class ActionScheduler_Abstract_Schema {

	/**
	 * @var int Increment this value in derived class to trigger a schema update.
	 */
	protected $schema_version = 1;

	/**
	 * @var string Schema version stored in database.
	 */
	protected $db_version;

	/**
	 * @var array Names of tables that will be registered by this class.
	 */
	protected $tables = [];

	/**
	 * Can optionally be used by concrete classes to carry out additional initialization work
	 * as needed.
	 */
	public function init() {}

	/**
	 * Register tables with WordPress, and create them if needed.
	 *
	 * @param bool $force_update Optional. Default false. Use true to always run the schema update.
	 *
	 * @return void
	 */
	public function register_tables( $force_update = false ) {
		global $wpdb;

		// make WP aware of our tables
		foreach ( $this->tables as $table ) {
			$wpdb->tables[] = $table;
			$name           = $this->get_full_table_name( $table );
			$wpdb->$table   = $name;
		}

		// create the tables
		if ( $this->schema_update_required() || $force_update ) {
			foreach ( $this->tables as $table ) {
				/**
				 * Allow custom processing before updating a table schema.
				 *
				 * @param string $table Name of table being updated.
				 * @param string $db_version Existing version of the table being updated.
				 */
				do_action( 'action_scheduler_before_schema_update', $table, $this->db_version );
				$this->update_table( $table );
			}
			$this->mark_schema_update_complete();
		}
	}

	/**
	 * @param string $table The name of the table
	 *
	 * @return string The CREATE TABLE statement, suitable for passing to dbDelta
	 */
	abstract protected function get_table_definition( $table );

	/**
	 * Determine if the database schema is out of date
	 * by comparing the integer found in $this->schema_version
	 * with the option set in the WordPress options table
	 *
	 * @return bool
	 */
	private function schema_update_required() {
		$option_name      = 'schema-' . static::class;
		$this->db_version = get_option( $option_name, 0 );

		// Check for schema option stored by the Action Scheduler Custom Tables plugin in case site has migrated from that plugin with an older schema
		if ( 0 === $this->db_version ) {

			$plugin_option_name = 'schema-';

			switch ( static::class ) {
				case 'ActionScheduler_StoreSchema' :
					$plugin_option_name .= 'Action_Scheduler\Custom_Tables\DB_Store_Table_Maker';
					break;
				case 'ActionScheduler_LoggerSchema' :
					$plugin_option_name .= 'Action_Scheduler\Custom_Tables\DB_Logger_Table_Maker';
					break;
			}

			$this->db_version = get_option( $plugin_option_name, 0 );

			delete_option( $plugin_option_name );
		}

		return version_compare( $this->db_version, $this->schema_version, '<' );
	}

	/**
	 * Update the option in WordPress to indicate that
	 * our schema is now up to date
	 *
	 * @return void
	 */
	private function mark_schema_update_complete() {
		$option_name = 'schema-' . static::class;

		// work around race conditions and ensure that our option updates
		$value_to_save = (string) $this->schema_version . '.0.' . time();

		update_option( $option_name, $value_to_save );
	}

	/**
	 * Update the schema for the given table
	 *
	 * @param string $table The name of the table to update
	 *
	 * @return void
	 */
	private function update_table( $table ) {
		require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );
		$definition = $this->get_table_definition( $table );
		if ( $definition ) {
			$updated = dbDelta( $definition );
			foreach ( $updated as $updated_table => $update_description ) {
				if ( strpos( $update_description, 'Created table' ) === 0 ) {
					do_action( 'action_scheduler/created_table', $updated_table, $table );
				}
			}
		}
	}

	/**
	 * @param string $table
	 *
	 * @return string The full name of the table, including the
	 *                table prefix for the current blog
	 */
	protected function get_full_table_name( $table ) {
		return $GLOBALS[ 'wpdb' ]->prefix . $table;
	}

	/**
	 * Confirms that all of the tables registered by this schema class have been created.
	 *
	 * @return bool
	 */
	public function tables_exist() {
		global $wpdb;

		$existing_tables = $wpdb->get_col( 'SHOW TABLES' );
		$expected_tables = array_map(
			function ( $table_name ) use ( $wpdb ) {
				return $wpdb->prefix . $table_name;
			},
			$this->tables
		);

		return count( array_intersect( $existing_tables, $expected_tables ) ) === count( $expected_tables );
	}
}
action-scheduler/classes/abstracts/ActionScheduler_Abstract_RecurringSchedule.php000064400000006146151335517650024547 0ustar00<?php

/**
 * Class ActionScheduler_Abstract_RecurringSchedule
 */
abstract class ActionScheduler_Abstract_RecurringSchedule extends ActionScheduler_Abstract_Schedule {

	/**
	 * The date & time the first instance of this schedule was setup to run (which may not be this instance).
	 *
	 * Schedule objects are attached to an action object. Each schedule stores the run date for that
	 * object as the start date - @see $this->start - and logic to calculate the next run date after
	 * that - @see $this->calculate_next(). The $first_date property also keeps a record of when the very
	 * first instance of this chain of schedules ran.
	 *
	 * @var DateTime
	 */
	private $first_date = NULL;

	/**
	 * Timestamp equivalent of @see $this->first_date
	 *
	 * @var int
	 */
	protected $first_timestamp = NULL;

	/**
	 * The recurrance between each time an action is run using this schedule.
	 * Used to calculate the start date & time. Can be a number of seconds, in the
	 * case of ActionScheduler_IntervalSchedule, or a cron expression, as in the
	 * case of ActionScheduler_CronSchedule. Or something else.
	 *
	 * @var mixed
	 */
	protected $recurrence;

	/**
	 * @param DateTime $date The date & time to run the action.
	 * @param mixed $recurrence The data used to determine the schedule's recurrance.
	 * @param DateTime|null $first (Optional) The date & time the first instance of this interval schedule ran. Default null, meaning this is the first instance.
	 */
	public function __construct( DateTime $date, $recurrence, DateTime $first = null ) {
		parent::__construct( $date );
		$this->first_date = empty( $first ) ? $date : $first;
		$this->recurrence = $recurrence;
	}

	/**
	 * @return bool
	 */
	public function is_recurring() {
		return true;
	}

	/**
	 * Get the date & time of the first schedule in this recurring series.
	 *
	 * @return DateTime|null
	 */
	public function get_first_date() {
		return clone $this->first_date;
	}

	/**
	 * @return string
	 */
	public function get_recurrence() {
		return $this->recurrence;
	}

	/**
	 * For PHP 5.2 compat, since DateTime objects can't be serialized
	 * @return array
	 */
	public function __sleep() {
		$sleep_params = parent::__sleep();
		$this->first_timestamp = $this->first_date->getTimestamp();
		return array_merge( $sleep_params, array(
			'first_timestamp',
			'recurrence'
		) );
	}

	/**
	 * Unserialize recurring schedules serialized/stored prior to AS 3.0.0
	 *
	 * Prior to Action Scheduler 3.0.0, schedules used different property names to refer
	 * to equivalent data. For example, ActionScheduler_IntervalSchedule::start_timestamp
	 * was the same as ActionScheduler_SimpleSchedule::timestamp. This was addressed in
	 * Action Scheduler 3.0.0, where properties and property names were aligned for better
	 * inheritance. To maintain backward compatibility with scheduled serialized and stored
	 * prior to 3.0, we need to correctly map the old property names.
	 */
	public function __wakeup() {
		parent::__wakeup();
		if ( $this->first_timestamp > 0 ) {
			$this->first_date = as_get_datetime_object( $this->first_timestamp );
		} else {
			$this->first_date = $this->get_date();
		}
	}
}
action-scheduler/classes/abstracts/ActionScheduler_TimezoneHelper.php000064400000010476151335517650022242 0ustar00<?php

/**
 * Class ActionScheduler_TimezoneHelper
 */
abstract class ActionScheduler_TimezoneHelper {
	private static $local_timezone = NULL;

	/**
	 * Set a DateTime's timezone to the WordPress site's timezone, or a UTC offset
	 * if no timezone string is available.
	 *
	 * @since  2.1.0
	 *
	 * @param DateTime $date
	 * @return ActionScheduler_DateTime
	 */
	public static function set_local_timezone( DateTime $date ) {

		// Accept a DateTime for easier backward compatibility, even though we require methods on ActionScheduler_DateTime
		if ( ! is_a( $date, 'ActionScheduler_DateTime' ) ) {
			$date = as_get_datetime_object( $date->format( 'U' ) );
		}

		if ( get_option( 'timezone_string' ) ) {
			$date->setTimezone( new DateTimeZone( self::get_local_timezone_string() ) );
		} else {
			$date->setUtcOffset( self::get_local_timezone_offset() );
		}

		return $date;
	}

	/**
	 * Helper to retrieve the timezone string for a site until a WP core method exists
	 * (see https://core.trac.wordpress.org/ticket/24730).
	 *
	 * Adapted from wc_timezone_string() and https://secure.php.net/manual/en/function.timezone-name-from-abbr.php#89155.
	 *
	 * If no timezone string is set, and its not possible to match the UTC offset set for the site to a timezone
	 * string, then an empty string will be returned, and the UTC offset should be used to set a DateTime's
	 * timezone.
	 *
	 * @since 2.1.0
	 * @return string PHP timezone string for the site or empty if no timezone string is available.
	 */
	protected static function get_local_timezone_string( $reset = false ) {
		// If site timezone string exists, return it.
		$timezone = get_option( 'timezone_string' );
		if ( $timezone ) {
			return $timezone;
		}

		// Get UTC offset, if it isn't set then return UTC.
		$utc_offset = intval( get_option( 'gmt_offset', 0 ) );
		if ( 0 === $utc_offset ) {
			return 'UTC';
		}

		// Adjust UTC offset from hours to seconds.
		$utc_offset *= 3600;

		// Attempt to guess the timezone string from the UTC offset.
		$timezone = timezone_name_from_abbr( '', $utc_offset );
		if ( $timezone ) {
			return $timezone;
		}

		// Last try, guess timezone string manually.
		foreach ( timezone_abbreviations_list() as $abbr ) {
			foreach ( $abbr as $city ) {
				if ( (bool) date( 'I' ) === (bool) $city['dst'] && $city['timezone_id'] && intval( $city['offset'] ) === $utc_offset ) {
					return $city['timezone_id'];
				}
			}
		}

		// No timezone string
		return '';
	}

	/**
	 * Get timezone offset in seconds.
	 *
	 * @since  2.1.0
	 * @return float
	 */
	protected static function get_local_timezone_offset() {
		$timezone = get_option( 'timezone_string' );

		if ( $timezone ) {
			$timezone_object = new DateTimeZone( $timezone );
			return $timezone_object->getOffset( new DateTime( 'now' ) );
		} else {
			return floatval( get_option( 'gmt_offset', 0 ) ) * HOUR_IN_SECONDS;
		}
	}

	/**
	 * @deprecated 2.1.0
	 */
	public static function get_local_timezone( $reset = FALSE ) {
		_deprecated_function( __FUNCTION__, '2.1.0', 'ActionScheduler_TimezoneHelper::set_local_timezone()' );
		if ( $reset ) {
			self::$local_timezone = NULL;
		}
		if ( !isset(self::$local_timezone) ) {
			$tzstring = get_option('timezone_string');

			if ( empty($tzstring) ) {
				$gmt_offset = get_option('gmt_offset');
				if ( $gmt_offset == 0 ) {
					$tzstring = 'UTC';
				} else {
					$gmt_offset *= HOUR_IN_SECONDS;
					$tzstring   = timezone_name_from_abbr( '', $gmt_offset, 1 );

					// If there's no timezone string, try again with no DST.
					if ( false === $tzstring ) {
						$tzstring = timezone_name_from_abbr( '', $gmt_offset, 0 );
					}

					// Try mapping to the first abbreviation we can find.
					if ( false === $tzstring ) {
						$is_dst = date( 'I' );
						foreach ( timezone_abbreviations_list() as $abbr ) {
							foreach ( $abbr as $city ) {
								if ( $city['dst'] == $is_dst && $city['offset'] == $gmt_offset ) {
									// If there's no valid timezone ID, keep looking.
									if ( null === $city['timezone_id'] ) {
										continue;
									}

									$tzstring = $city['timezone_id'];
									break 2;
								}
							}
						}
					}

					// If we still have no valid string, then fall back to UTC.
					if ( false === $tzstring ) {
						$tzstring = 'UTC';
					}
				}
			}

			self::$local_timezone = new DateTimeZone($tzstring);
		}
		return self::$local_timezone;
	}
}
action-scheduler/classes/abstracts/ActionScheduler_Abstract_ListTable.php000064400000047414151335517650023020 0ustar00<?php

if ( ! class_exists( 'WP_List_Table' ) ) {
	require_once( ABSPATH . 'wp-admin/includes/class-wp-list-table.php' );
}

/**
 * Action Scheduler Abstract List Table class
 *
 * This abstract class enhances WP_List_Table making it ready to use.
 *
 * By extending this class we can focus on describing how our table looks like,
 * which columns needs to be shown, filter, ordered by and more and forget about the details.
 *
 * This class supports:
 *	- Bulk actions
 *	- Search
 *  - Sortable columns
 *  - Automatic translations of the columns
 *
 * @codeCoverageIgnore
 * @since  2.0.0
 */
abstract class ActionScheduler_Abstract_ListTable extends WP_List_Table {

	/**
	 * The table name
	 */
	protected $table_name;

	/**
	 * Package name, used to get options from WP_List_Table::get_items_per_page.
	 */
	protected $package;

	/**
	 * How many items do we render per page?
	 */
	protected $items_per_page = 10;

	/**
	 * Enables search in this table listing. If this array
	 * is empty it means the listing is not searchable.
	 */
	protected $search_by = array();

	/**
	 * Columns to show in the table listing. It is a key => value pair. The
	 * key must much the table column name and the value is the label, which is
	 * automatically translated.
	 */
	protected $columns = array();

	/**
	 * Defines the row-actions. It expects an array where the key
	 * is the column name and the value is an array of actions.
	 *
	 * The array of actions are key => value, where key is the method name
	 * (with the prefix row_action_<key>) and the value is the label
	 * and title.
	 */
	protected $row_actions = array();

	/**
	 * The Primary key of our table
	 */
	protected $ID = 'ID';

	/**
	 * Enables sorting, it expects an array
	 * of columns (the column names are the values)
	 */
	protected $sort_by = array();

	protected $filter_by = array();

	/**
	 * @var array The status name => count combinations for this table's items. Used to display status filters.
	 */
	protected $status_counts = array();

	/**
	 * @var array Notices to display when loading the table. Array of arrays of form array( 'class' => {updated|error}, 'message' => 'This is the notice text display.' ).
	 */
	protected $admin_notices = array();

	/**
	 * @var string Localised string displayed in the <h1> element above the able.
	 */
	protected $table_header;

	/**
	 * Enables bulk actions. It must be an array where the key is the action name
	 * and the value is the label (which is translated automatically). It is important
	 * to notice that it will check that the method exists (`bulk_$name`) and will throw
	 * an exception if it does not exists.
	 *
	 * This class will automatically check if the current request has a bulk action, will do the
	 * validations and afterwards will execute the bulk method, with two arguments. The first argument
	 * is the array with primary keys, the second argument is a string with a list of the primary keys,
	 * escaped and ready to use (with `IN`).
	 */
	protected $bulk_actions = array();

	/**
	 * Makes translation easier, it basically just wraps
	 * `_x` with some default (the package name).
	 *
	 * @deprecated 3.0.0
	 */
	protected function translate( $text, $context = '' ) {
		return $text;
	}

	/**
	 * Reads `$this->bulk_actions` and returns an array that WP_List_Table understands. It
	 * also validates that the bulk method handler exists. It throws an exception because
	 * this is a library meant for developers and missing a bulk method is a development-time error.
	 */
	protected function get_bulk_actions() {
		$actions = array();

		foreach ( $this->bulk_actions as $action => $label ) {
			if ( ! is_callable( array( $this, 'bulk_' . $action ) ) ) {
				throw new RuntimeException( "The bulk action $action does not have a callback method" );
			}

			$actions[ $action ] = $label;
		}

		return $actions;
	}

	/**
	 * Checks if the current request has a bulk action. If that is the case it will validate and will
	 * execute the bulk method handler. Regardless if the action is valid or not it will redirect to
	 * the previous page removing the current arguments that makes this request a bulk action.
	 */
	protected function process_bulk_action() {
		global $wpdb;
		// Detect when a bulk action is being triggered.
		$action = $this->current_action();
		if ( ! $action ) {
			return;
		}

		check_admin_referer( 'bulk-' . $this->_args['plural'] );

		$method   = 'bulk_' . $action;
		if ( array_key_exists( $action, $this->bulk_actions ) && is_callable( array( $this, $method ) ) && ! empty( $_GET['ID'] ) && is_array( $_GET['ID'] ) ) {
			$ids_sql = '(' . implode( ',', array_fill( 0, count( $_GET['ID'] ), '%s' ) ) . ')';
			$this->$method( $_GET['ID'], $wpdb->prepare( $ids_sql, $_GET['ID'] ) );
		}

		wp_redirect( remove_query_arg(
			array( '_wp_http_referer', '_wpnonce', 'ID', 'action', 'action2' ),
			wp_unslash( $_SERVER['REQUEST_URI'] )
		) );
		exit;
	}

	/**
	 * Default code for deleting entries.
	 * validated already by process_bulk_action()
	 */
	protected function bulk_delete( array $ids, $ids_sql ) {
		$store = ActionScheduler::store();
		foreach ( $ids as $action_id ) {
			$store->delete( $action_id );
		}
	}

	/**
	 * Prepares the _column_headers property which is used by WP_Table_List at rendering.
	 * It merges the columns and the sortable columns.
	 */
	protected function prepare_column_headers() {
		$this->_column_headers = array(
			$this->get_columns(),
			get_hidden_columns( $this->screen ),
			$this->get_sortable_columns(),
		);
	}

	/**
	 * Reads $this->sort_by and returns the columns name in a format that WP_Table_List
	 * expects
	 */
	public function get_sortable_columns() {
		$sort_by = array();
		foreach ( $this->sort_by as $column ) {
			$sort_by[ $column ] = array( $column, true );
		}
		return $sort_by;
	}

	/**
	 * Returns the columns names for rendering. It adds a checkbox for selecting everything
	 * as the first column
	 */
	public function get_columns() {
		$columns = array_merge(
			array( 'cb' => '<input type="checkbox" />' ),
			$this->columns
		);

		return $columns;
	}

	/**
	 * Get prepared LIMIT clause for items query
	 *
	 * @global wpdb $wpdb
	 *
	 * @return string Prepared LIMIT clause for items query.
	 */
	protected function get_items_query_limit() {
		global $wpdb;

		$per_page = $this->get_items_per_page( $this->package . '_items_per_page', $this->items_per_page );
		return $wpdb->prepare( 'LIMIT %d', $per_page );
	}

	/**
	 * Returns the number of items to offset/skip for this current view.
	 *
	 * @return int
	 */
	protected function get_items_offset() {
		$per_page = $this->get_items_per_page( $this->package . '_items_per_page', $this->items_per_page );
		$current_page = $this->get_pagenum();
		if ( 1 < $current_page ) {
			$offset = $per_page * ( $current_page - 1 );
		} else {
			$offset = 0;
		}

		return $offset;
	}

	/**
	 * Get prepared OFFSET clause for items query
	 *
	 * @global wpdb $wpdb
	 *
	 * @return string Prepared OFFSET clause for items query.
	 */
	protected function get_items_query_offset() {
		global $wpdb;

		return $wpdb->prepare( 'OFFSET %d', $this->get_items_offset() );
	}

	/**
	 * Prepares the ORDER BY sql statement. It uses `$this->sort_by` to know which
	 * columns are sortable. This requests validates the orderby $_GET parameter is a valid
	 * column and sortable. It will also use order (ASC|DESC) using DESC by default.
	 */
	protected function get_items_query_order() {
		if ( empty( $this->sort_by ) ) {
			return '';
		}

		$orderby = esc_sql( $this->get_request_orderby() );
		$order   = esc_sql( $this->get_request_order() );

		return "ORDER BY {$orderby} {$order}";
	}

	/**
	 * Return the sortable column specified for this request to order the results by, if any.
	 *
	 * @return string
	 */
	protected function get_request_orderby() {

		$valid_sortable_columns = array_values( $this->sort_by );

		if ( ! empty( $_GET['orderby'] ) && in_array( $_GET['orderby'], $valid_sortable_columns ) ) {
			$orderby = sanitize_text_field( $_GET['orderby'] );
		} else {
			$orderby = $valid_sortable_columns[0];
		}

		return $orderby;
	}

	/**
	 * Return the sortable column order specified for this request.
	 *
	 * @return string
	 */
	protected function get_request_order() {

		if ( ! empty( $_GET['order'] ) && 'desc' === strtolower( $_GET['order'] ) ) {
			$order = 'DESC';
		} else {
			$order = 'ASC';
		}

		return $order;
	}

	/**
	 * Return the status filter for this request, if any.
	 *
	 * @return string
	 */
	protected function get_request_status() {
		$status = ( ! empty( $_GET['status'] ) ) ? $_GET['status'] : '';
		return $status;
	}

	/**
	 * Return the search filter for this request, if any.
	 *
	 * @return string
	 */
	protected function get_request_search_query() {
		$search_query = ( ! empty( $_GET['s'] ) ) ? $_GET['s'] : '';
		return $search_query;
	}

	/**
	 * Process and return the columns name. This is meant for using with SQL, this means it
	 * always includes the primary key.
	 *
	 * @return array
	 */
	protected function get_table_columns() {
		$columns = array_keys( $this->columns );
		if ( ! in_array( $this->ID, $columns ) ) {
			$columns[] = $this->ID;
		}

		return $columns;
	}

	/**
	 * Check if the current request is doing a "full text" search. If that is the case
	 * prepares the SQL to search texts using LIKE.
	 *
	 * If the current request does not have any search or if this list table does not support
	 * that feature it will return an empty string.
	 *
	 * TODO:
	 *   - Improve search doing LIKE by word rather than by phrases.
	 *
	 * @return string
	 */
	protected function get_items_query_search() {
		global $wpdb;

		if ( empty( $_GET['s'] ) || empty( $this->search_by ) ) {
			return '';
		}

		$filter  = array();
		foreach ( $this->search_by as $column ) {
			$filter[] = $wpdb->prepare('`' . $column . '` like "%%s%"', $wpdb->esc_like( $_GET['s'] ));
		}
		return implode( ' OR ', $filter );
	}

	/**
	 * Prepares the SQL to filter rows by the options defined at `$this->filter_by`. Before trusting
	 * any data sent by the user it validates that it is a valid option.
	 */
	protected function get_items_query_filters() {
		global $wpdb;

		if ( ! $this->filter_by || empty( $_GET['filter_by'] ) || ! is_array( $_GET['filter_by'] ) ) {
			return '';
		}

		$filter = array();

		foreach ( $this->filter_by as $column => $options ) {
			if ( empty( $_GET['filter_by'][ $column ] ) || empty( $options[ $_GET['filter_by'][ $column ] ] ) ) {
				continue;
			}

			$filter[] = $wpdb->prepare( "`$column` = %s", $_GET['filter_by'][ $column ] );
		}

		return implode( ' AND ', $filter );

	}

	/**
	 * Prepares the data to feed WP_Table_List.
	 *
	 * This has the core for selecting, sorting and filting data. To keep the code simple
	 * its logic is split among many methods (get_items_query_*).
	 *
	 * Beside populating the items this function will also count all the records that matches
	 * the filtering criteria and will do fill the pagination variables.
	 */
	public function prepare_items() {
		global $wpdb;

		$this->process_bulk_action();

		$this->process_row_actions();

		if ( ! empty( $_REQUEST['_wp_http_referer'] ) ) {
			// _wp_http_referer is used only on bulk actions, we remove it to keep the $_GET shorter
			wp_redirect( remove_query_arg( array( '_wp_http_referer', '_wpnonce' ), wp_unslash( $_SERVER['REQUEST_URI'] ) ) );
			exit;
		}

		$this->prepare_column_headers();

		$limit   = $this->get_items_query_limit();
		$offset  = $this->get_items_query_offset();
		$order   = $this->get_items_query_order();
		$where   = array_filter(array(
			$this->get_items_query_search(),
			$this->get_items_query_filters(),
		));
		$columns = '`' . implode( '`, `', $this->get_table_columns() ) . '`';

		if ( ! empty( $where ) ) {
			$where = 'WHERE ('. implode( ') AND (', $where ) . ')';
		} else {
			$where = '';
		}

		$sql = "SELECT $columns FROM {$this->table_name} {$where} {$order} {$limit} {$offset}";

		$this->set_items( $wpdb->get_results( $sql, ARRAY_A ) );

		$query_count = "SELECT COUNT({$this->ID}) FROM {$this->table_name} {$where}";
		$total_items = $wpdb->get_var( $query_count );
		$per_page    = $this->get_items_per_page( $this->package . '_items_per_page', $this->items_per_page );
		$this->set_pagination_args( array(
			'total_items' => $total_items,
			'per_page'    => $per_page,
			'total_pages' => ceil( $total_items / $per_page ),
		) );
	}

	public function extra_tablenav( $which ) {
		if ( ! $this->filter_by || 'top' !== $which ) {
			return;
		}

		echo '<div class="alignleft actions">';

		foreach ( $this->filter_by as $id => $options ) {
			$default = ! empty( $_GET['filter_by'][ $id ] ) ? $_GET['filter_by'][ $id ] : '';
			if ( empty( $options[ $default ] ) ) {
				$default = '';
			}

			echo '<select name="filter_by[' . esc_attr( $id ) . ']" class="first" id="filter-by-' . esc_attr( $id ) . '">';

			foreach ( $options as $value => $label ) {
				echo '<option value="' . esc_attr( $value ) . '" ' . esc_html( $value == $default ? 'selected' : '' )  .'>'
					. esc_html( $label )
				. '</option>';
			}

			echo '</select>';
		}

		submit_button( esc_html__( 'Filter', 'woocommerce' ), '', 'filter_action', false, array( 'id' => 'post-query-submit' ) );
		echo '</div>';
	}

	/**
	 * Set the data for displaying. It will attempt to unserialize (There is a chance that some columns
	 * are serialized). This can be override in child classes for futher data transformation.
	 */
	protected function set_items( array $items ) {
		$this->items = array();
		foreach ( $items as $item ) {
			$this->items[ $item[ $this->ID ] ] = array_map( 'maybe_unserialize', $item );
		}
	}

	/**
	 * Renders the checkbox for each row, this is the first column and it is named ID regardless
	 * of how the primary key is named (to keep the code simpler). The bulk actions will do the proper
	 * name transformation though using `$this->ID`.
	 */
	public function column_cb( $row ) {
		return '<input name="ID[]" type="checkbox" value="' . esc_attr( $row[ $this->ID ] ) .'" />';
	}

	/**
	 * Renders the row-actions.
	 *
	 * This method renders the action menu, it reads the definition from the $row_actions property,
	 * and it checks that the row action method exists before rendering it.
	 *
	 * @param array $row     Row to render
	 * @param $column_name   Current row
	 * @return
	 */
	protected function maybe_render_actions( $row, $column_name ) {
		if ( empty( $this->row_actions[ $column_name ] ) ) {
			return;
		}

		$row_id = $row[ $this->ID ];

		$actions = '<div class="row-actions">';
		$action_count = 0;
		foreach ( $this->row_actions[ $column_name ] as $action_key => $action ) {

			$action_count++;

			if ( ! method_exists( $this, 'row_action_' . $action_key ) ) {
				continue;
			}

			$action_link = ! empty( $action['link'] ) ? $action['link'] : add_query_arg( array( 'row_action' => $action_key, 'row_id' => $row_id, 'nonce'  => wp_create_nonce( $action_key . '::' . $row_id ) ) );
			$span_class  = ! empty( $action['class'] ) ? $action['class'] : $action_key;
			$separator   = ( $action_count < count( $this->row_actions[ $column_name ] ) ) ? ' | ' : '';

			$actions .= sprintf( '<span class="%s">', esc_attr( $span_class ) );
			$actions .= sprintf( '<a href="%1$s" title="%2$s">%3$s</a>', esc_url( $action_link ), esc_attr( $action['desc'] ), esc_html( $action['name'] ) );
			$actions .= sprintf( '%s</span>', $separator );
		}
		$actions .= '</div>';
		return $actions;
	}

	protected function process_row_actions() {
		$parameters = array( 'row_action', 'row_id', 'nonce' );
		foreach ( $parameters as $parameter ) {
			if ( empty( $_REQUEST[ $parameter ] ) ) {
				return;
			}
		}

		$method = 'row_action_' . $_REQUEST['row_action'];

		if ( $_REQUEST['nonce'] === wp_create_nonce( $_REQUEST[ 'row_action' ] . '::' . $_REQUEST[ 'row_id' ] ) && method_exists( $this, $method ) ) {
			$this->$method( $_REQUEST['row_id'] );
		}

		wp_redirect( remove_query_arg(
			array( 'row_id', 'row_action', 'nonce' ),
			wp_unslash( $_SERVER['REQUEST_URI'] )
		) );
		exit;
	}

	/**
	 * Default column formatting, it will escape everythig for security.
	 */
	public function column_default( $item, $column_name ) {
		$column_html = esc_html( $item[ $column_name ] );
		$column_html .= $this->maybe_render_actions( $item, $column_name );
		return $column_html;
	}

	/**
	 * Display the table heading and search query, if any
	 */
	protected function display_header() {
		echo '<h1 class="wp-heading-inline">' . esc_attr( $this->table_header ) . '</h1>';
		if ( $this->get_request_search_query() ) {
			/* translators: %s: search query */
			echo '<span class="subtitle">' . esc_attr( sprintf( __( 'Search results for "%s"', 'woocommerce' ), $this->get_request_search_query() ) ) . '</span>';
		}
		echo '<hr class="wp-header-end">';
	}

	/**
	 * Display the table heading and search query, if any
	 */
	protected function display_admin_notices() {
		foreach ( $this->admin_notices as $notice ) {
			echo '<div id="message" class="' . $notice['class'] . '">';
			echo '	<p>' . wp_kses_post( $notice['message'] ) . '</p>';
			echo '</div>';
		}
	}

	/**
	 * Prints the available statuses so the user can click to filter.
	 */
	protected function display_filter_by_status() {

		$status_list_items = array();
		$request_status    = $this->get_request_status();

		// Helper to set 'all' filter when not set on status counts passed in
		if ( ! isset( $this->status_counts['all'] ) ) {
			$this->status_counts = array( 'all' => array_sum( $this->status_counts ) ) + $this->status_counts;
		}

		foreach ( $this->status_counts as $status_name => $count ) {

			if ( 0 === $count ) {
				continue;
			}

			if ( $status_name === $request_status || ( empty( $request_status ) && 'all' === $status_name ) ) {
				$status_list_item = '<li class="%1$s"><strong>%3$s</strong> (%4$d)</li>';
			} else {
				$status_list_item = '<li class="%1$s"><a href="%2$s">%3$s</a> (%4$d)</li>';
			}

			$status_filter_url   = ( 'all' === $status_name ) ? remove_query_arg( 'status' ) : add_query_arg( 'status', $status_name );
			$status_filter_url   = remove_query_arg( array( 'paged', 's' ), $status_filter_url );
			$status_list_items[] = sprintf( $status_list_item, esc_attr( $status_name ), esc_url( $status_filter_url ), esc_html( ucfirst( $status_name ) ), absint( $count ) );
		}

		if ( $status_list_items ) {
			echo '<ul class="subsubsub">';
			echo implode( " | \n", $status_list_items );
			echo '</ul>';
		}
	}

	/**
	 * Renders the table list, we override the original class to render the table inside a form
	 * and to render any needed HTML (like the search box). By doing so the callee of a function can simple
	 * forget about any extra HTML.
	 */
	protected function display_table() {
		echo '<form id="' . esc_attr( $this->_args['plural'] ) . '-filter" method="get">';
		foreach ( $_GET as $key => $value ) {
			if ( '_' === $key[0] || 'paged' === $key || 'ID' === $key ) {
				continue;
			}
			echo '<input type="hidden" name="' . esc_attr( $key ) . '" value="' . esc_attr( $value ) . '" />';
		}
		if ( ! empty( $this->search_by ) ) {
			echo $this->search_box( $this->get_search_box_button_text(), 'plugin' ); // WPCS: XSS OK
		}
		parent::display();
		echo '</form>';
	}

	/**
	 * Process any pending actions.
	 */
	public function process_actions() {
		$this->process_bulk_action();
		$this->process_row_actions();

		if ( ! empty( $_REQUEST['_wp_http_referer'] ) ) {
			// _wp_http_referer is used only on bulk actions, we remove it to keep the $_GET shorter
			wp_redirect( remove_query_arg( array( '_wp_http_referer', '_wpnonce' ), wp_unslash( $_SERVER['REQUEST_URI'] ) ) );
			exit;
		}
	}

	/**
	 * Render the list table page, including header, notices, status filters and table.
	 */
	public function display_page() {
		$this->prepare_items();

		echo '<div class="wrap">';
		$this->display_header();
		$this->display_admin_notices();
		$this->display_filter_by_status();
		$this->display_table();
		echo '</div>';
	}

	/**
	 * Get the text to display in the search box on the list table.
	 */
	protected function get_search_box_placeholder() {
		return esc_html__( 'Search', 'woocommerce' );
	}
}
action-scheduler/classes/ActionScheduler_InvalidActionException.php000064400000002363151335517650021721 0ustar00<?php

/**
 * InvalidAction Exception.
 *
 * Used for identifying actions that are invalid in some way.
 *
 * @package ActionScheduler
 */
class ActionScheduler_InvalidActionException extends \InvalidArgumentException implements ActionScheduler_Exception {

	/**
	 * Create a new exception when the action's schedule cannot be fetched.
	 *
	 * @param string $action_id The action ID with bad args.
	 * @return static
	 */
	public static function from_schedule( $action_id, $schedule ) {
		$message = sprintf(
			/* translators: 1: action ID 2: schedule */
			__( 'Action [%1$s] has an invalid schedule: %2$s', 'woocommerce' ),
			$action_id,
			var_export( $schedule, true )
		);

		return new static( $message );
	}

	/**
	 * Create a new exception when the action's args cannot be decoded to an array.
	 *
	 * @author Jeremy Pry
	 *
	 * @param string $action_id The action ID with bad args.
	 * @return static
	 */
	public static function from_decoding_args( $action_id, $args = array() ) {
		$message = sprintf(
			/* translators: 1: action ID 2: arguments */
			__( 'Action [%1$s] has invalid arguments. It cannot be JSON decoded to an array. $args = %2$s', 'woocommerce' ),
			$action_id,
			var_export( $args, true )
		);

		return new static( $message );
	}
}
action-scheduler/classes/ActionScheduler_AsyncRequest_QueueRunner.php000064400000004255151335517650022304 0ustar00<?php
/**
 * ActionScheduler_AsyncRequest_QueueRunner
 */

defined( 'ABSPATH' ) || exit;

/**
 * ActionScheduler_AsyncRequest_QueueRunner class.
 */
class ActionScheduler_AsyncRequest_QueueRunner extends WP_Async_Request {

	/**
	 * Data store for querying actions
	 *
	 * @var ActionScheduler_Store
	 * @access protected
	 */
	protected $store;

	/**
	 * Prefix for ajax hooks
	 *
	 * @var string
	 * @access protected
	 */
	protected $prefix = 'as';

	/**
	 * Action for ajax hooks
	 *
	 * @var string
	 * @access protected
	 */
	protected $action = 'async_request_queue_runner';

	/**
	 * Initiate new async request
	 */
	public function __construct( ActionScheduler_Store $store ) {
		parent::__construct();
		$this->store = $store;
	}

	/**
	 * Handle async requests
	 *
	 * Run a queue, and maybe dispatch another async request to run another queue
	 * if there are still pending actions after completing a queue in this request.
	 */
	protected function handle() {
		do_action( 'action_scheduler_run_queue', 'Async Request' ); // run a queue in the same way as WP Cron, but declare the Async Request context

		$sleep_seconds = $this->get_sleep_seconds();

		if ( $sleep_seconds ) {
			sleep( $sleep_seconds );
		}

		$this->maybe_dispatch();
	}

	/**
	 * If the async request runner is needed and allowed to run, dispatch a request.
	 */
	public function maybe_dispatch() {
		if ( ! $this->allow() ) {
			return;
		}

		$this->dispatch();
		ActionScheduler_QueueRunner::instance()->unhook_dispatch_async_request();
	}

	/**
	 * Only allow async requests when needed.
	 *
	 * Also allow 3rd party code to disable running actions via async requests.
	 */
	protected function allow() {

		if ( ! has_action( 'action_scheduler_run_queue' ) || ActionScheduler::runner()->has_maximum_concurrent_batches() || ! $this->store->has_pending_actions_due() ) {
			$allow = false;
		} else {
			$allow = true;
		}

		return apply_filters( 'action_scheduler_allow_async_request_runner', $allow );
	}

	/**
	 * Chaining async requests can crash MySQL. A brief sleep call in PHP prevents that.
	 */
	protected function get_sleep_seconds() {
		return apply_filters( 'action_scheduler_async_request_sleep_seconds', 5, $this );
	}
}
action-scheduler/classes/ActionScheduler_Exception.php000064400000000323151335517650017246 0ustar00<?php

/**
 * ActionScheduler Exception Interface.
 *
 * Facilitates catching Exceptions unique to Action Scheduler.
 *
 * @package ActionScheduler
 * @since %VERSION%
 */
interface ActionScheduler_Exception {}
action-scheduler/classes/schedules/ActionScheduler_NullSchedule.php000064400000001107151335517650021657 0ustar00<?php

/**
 * Class ActionScheduler_NullSchedule
 */
class ActionScheduler_NullSchedule extends ActionScheduler_SimpleSchedule {

	/**
	 * Make the $date param optional and default to null.
	 *
	 * @param null $date The date & time to run the action.
	 */
	public function __construct( DateTime $date = null ) {
		$this->scheduled_date = null;
	}

	/**
	 * This schedule has no scheduled DateTime, so we need to override the parent __sleep()
	 * @return array
	 */
	public function __sleep() {
		return array();
	}

	public function __wakeup() {
		$this->scheduled_date = null;
	}
}
action-scheduler/classes/schedules/ActionScheduler_Schedule.php000064400000000406151335517650021025 0ustar00<?php

/**
 * Class ActionScheduler_Schedule
 */
interface ActionScheduler_Schedule {
	/**
	 * @param DateTime $after
	 * @return DateTime|null
	 */
	public function next( DateTime $after = NULL );

	/**
	 * @return bool
	 */
	public function is_recurring();
}
 action-scheduler/classes/schedules/ActionScheduler_IntervalSchedule.php000064400000004752151335517650022542 0ustar00<?php

/**
 * Class ActionScheduler_IntervalSchedule
 */
class ActionScheduler_IntervalSchedule extends ActionScheduler_Abstract_RecurringSchedule implements ActionScheduler_Schedule {

	/**
	 * Deprecated property @see $this->__wakeup() for details.
	 **/
	private $start_timestamp = NULL;

	/**
	 * Deprecated property @see $this->__wakeup() for details.
	 **/
	private $interval_in_seconds = NULL;

	/**
	 * Calculate when this schedule should start after a given date & time using
	 * the number of seconds between recurrences.
	 *
	 * @param DateTime $after
	 * @return DateTime
	 */
	protected function calculate_next( DateTime $after ) {
		$after->modify( '+' . (int) $this->get_recurrence() . ' seconds' );
		return $after;
	}

	/**
	 * @return int
	 */
	public function interval_in_seconds() {
		_deprecated_function( __METHOD__, '3.0.0', '(int)ActionScheduler_Abstract_RecurringSchedule::get_recurrence()' );
		return (int) $this->get_recurrence();
	}

	/**
	 * Serialize interval schedules with data required prior to AS 3.0.0
	 *
	 * Prior to Action Scheduler 3.0.0, reccuring schedules used different property names to
	 * refer to equivalent data. For example, ActionScheduler_IntervalSchedule::start_timestamp
	 * was the same as ActionScheduler_SimpleSchedule::timestamp. Action Scheduler 3.0.0
	 * aligned properties and property names for better inheritance. To guard against the
	 * possibility of infinite loops if downgrading to Action Scheduler < 3.0.0, we need to
	 * also store the data with the old property names so if it's unserialized in AS < 3.0,
	 * the schedule doesn't end up with a null/false/0 recurrence.
	 *
	 * @return array
	 */
	public function __sleep() {

		$sleep_params = parent::__sleep();

		$this->start_timestamp     = $this->scheduled_timestamp;
		$this->interval_in_seconds = $this->recurrence;

		return array_merge( $sleep_params, array(
			'start_timestamp',
			'interval_in_seconds'
		) );
	}

	/**
	 * Unserialize interval schedules serialized/stored prior to AS 3.0.0
	 *
	 * For more background, @see ActionScheduler_Abstract_RecurringSchedule::__wakeup().
	 */
	public function __wakeup() {
		if ( is_null( $this->scheduled_timestamp ) && ! is_null( $this->start_timestamp ) ) {
			$this->scheduled_timestamp = $this->start_timestamp;
			unset( $this->start_timestamp );
		}

		if ( is_null( $this->recurrence ) && ! is_null( $this->interval_in_seconds ) ) {
			$this->recurrence = $this->interval_in_seconds;
			unset( $this->interval_in_seconds );
		}
		parent::__wakeup();
	}
}
action-scheduler/classes/schedules/ActionScheduler_CanceledSchedule.php000064400000002705151335517650022450 0ustar00<?php

/**
 * Class ActionScheduler_SimpleSchedule
 */
class ActionScheduler_CanceledSchedule extends ActionScheduler_SimpleSchedule {

	/**
	 * Deprecated property @see $this->__wakeup() for details.
	 **/
	private $timestamp = NULL;

	/**
	 * @param DateTime $after
	 *
	 * @return DateTime|null
	 */
	public function calculate_next( DateTime $after ) {
		return null;
	}

	/**
	 * Cancelled actions should never have a next schedule, even if get_next()
	 * is called with $after < $this->scheduled_date.
	 *
	 * @param DateTime $after
	 * @return DateTime|null
	 */
	public function get_next( DateTime $after ) {
		return null;
	}

	/**
	 * @return bool
	 */
	public function is_recurring() {
		return false;
	}

	/**
	 * Unserialize recurring schedules serialized/stored prior to AS 3.0.0
	 *
	 * Prior to Action Scheduler 3.0.0, schedules used different property names to refer
	 * to equivalent data. For example, ActionScheduler_IntervalSchedule::start_timestamp
	 * was the same as ActionScheduler_SimpleSchedule::timestamp. Action Scheduler 3.0.0
	 * aligned properties and property names for better inheritance. To maintain backward
	 * compatibility with schedules serialized and stored prior to 3.0, we need to correctly
	 * map the old property names with matching visibility.
	 */
	public function __wakeup() {
		if ( ! is_null( $this->timestamp ) ) {
			$this->scheduled_timestamp = $this->timestamp;
			unset( $this->timestamp );
		}
		parent::__wakeup();
	}
}
action-scheduler/classes/schedules/ActionScheduler_SimpleSchedule.php000064400000004154151335517650022203 0ustar00<?php

/**
 * Class ActionScheduler_SimpleSchedule
 */
class ActionScheduler_SimpleSchedule extends ActionScheduler_Abstract_Schedule {

	/**
	 * Deprecated property @see $this->__wakeup() for details.
	 **/
	private $timestamp = NULL;

	/**
	 * @param DateTime $after
	 *
	 * @return DateTime|null
	 */
	public function calculate_next( DateTime $after ) {
		return null;
	}

	/**
	 * @return bool
	 */
	public function is_recurring() {
		return false;
	}

	/**
	 * Serialize schedule with data required prior to AS 3.0.0
	 *
	 * Prior to Action Scheduler 3.0.0, schedules used different property names to refer
	 * to equivalent data. For example, ActionScheduler_IntervalSchedule::start_timestamp
	 * was the same as ActionScheduler_SimpleSchedule::timestamp. Action Scheduler 3.0.0
	 * aligned properties and property names for better inheritance. To guard against the
	 * scheduled date for single actions always being seen as "now" if downgrading to
	 * Action Scheduler < 3.0.0, we need to also store the data with the old property names
	 * so if it's unserialized in AS < 3.0, the schedule doesn't end up with a null recurrence.
	 *
	 * @return array
	 */
	public function __sleep() {

		$sleep_params = parent::__sleep();

		$this->timestamp = $this->scheduled_timestamp;

		return array_merge( $sleep_params, array(
			'timestamp',
		) );
	}

	/**
	 * Unserialize recurring schedules serialized/stored prior to AS 3.0.0
	 *
	 * Prior to Action Scheduler 3.0.0, schedules used different property names to refer
	 * to equivalent data. For example, ActionScheduler_IntervalSchedule::start_timestamp
	 * was the same as ActionScheduler_SimpleSchedule::timestamp. Action Scheduler 3.0.0
	 * aligned properties and property names for better inheritance. To maintain backward
	 * compatibility with schedules serialized and stored prior to 3.0, we need to correctly
	 * map the old property names with matching visibility.
	 */
	public function __wakeup() {

		if ( is_null( $this->scheduled_timestamp ) && ! is_null( $this->timestamp ) ) {
			$this->scheduled_timestamp = $this->timestamp;
			unset( $this->timestamp );
		}
		parent::__wakeup();
	}
}
action-scheduler/classes/schedules/ActionScheduler_CronSchedule.php000064400000007201151335517650021647 0ustar00<?php

/**
 * Class ActionScheduler_CronSchedule
 */
class ActionScheduler_CronSchedule extends ActionScheduler_Abstract_RecurringSchedule implements ActionScheduler_Schedule {

	/**
	 * Deprecated property @see $this->__wakeup() for details.
	 **/
	private $start_timestamp = NULL;

	/**
	 * Deprecated property @see $this->__wakeup() for details.
	 **/
	private $cron = NULL;

	/**
	 * Wrapper for parent constructor to accept a cron expression string and map it to a CronExpression for this
	 * objects $recurrence property.
	 *
	 * @param DateTime $start The date & time to run the action at or after. If $start aligns with the CronSchedule passed via $recurrence, it will be used. If it does not align, the first matching date after it will be used.
	 * @param CronExpression|string $recurrence The CronExpression used to calculate the schedule's next instance.
	 * @param DateTime|null $first (Optional) The date & time the first instance of this interval schedule ran. Default null, meaning this is the first instance.
	 */
	public function __construct( DateTime $start, $recurrence, DateTime $first = null ) {
		if ( ! is_a( $recurrence, 'CronExpression' ) ) {
			$recurrence = CronExpression::factory( $recurrence );
		}

		// For backward compatibility, we need to make sure the date is set to the first matching cron date, not whatever date is passed in. Importantly, by passing true as the 3rd param, if $start matches the cron expression, then it will be used. This was previously handled in the now deprecated next() method.
		$date = $recurrence->getNextRunDate( $start, 0, true );

		// parent::__construct() will set this to $date by default, but that may be different to $start now.
		$first = empty( $first ) ? $start : $first;

		parent::__construct( $date, $recurrence, $first );
	}

	/**
	 * Calculate when an instance of this schedule would start based on a given
	 * date & time using its the CronExpression.
	 *
	 * @param DateTime $after
	 * @return DateTime
	 */
	protected function calculate_next( DateTime $after ) {
		return $this->recurrence->getNextRunDate( $after, 0, false );
	}

	/**
	 * @return string
	 */
	public function get_recurrence() {
		return strval( $this->recurrence );
	}

	/**
	 * Serialize cron schedules with data required prior to AS 3.0.0
	 *
	 * Prior to Action Scheduler 3.0.0, reccuring schedules used different property names to
	 * refer to equivalent data. For example, ActionScheduler_IntervalSchedule::start_timestamp
	 * was the same as ActionScheduler_SimpleSchedule::timestamp. Action Scheduler 3.0.0
	 * aligned properties and property names for better inheritance. To guard against the
	 * possibility of infinite loops if downgrading to Action Scheduler < 3.0.0, we need to
	 * also store the data with the old property names so if it's unserialized in AS < 3.0,
	 * the schedule doesn't end up with a null recurrence.
	 *
	 * @return array
	 */
	public function __sleep() {

		$sleep_params = parent::__sleep();

		$this->start_timestamp = $this->scheduled_timestamp;
		$this->cron            = $this->recurrence;

		return array_merge( $sleep_params, array(
			'start_timestamp',
			'cron'
		) );
	}

	/**
	 * Unserialize cron schedules serialized/stored prior to AS 3.0.0
	 *
	 * For more background, @see ActionScheduler_Abstract_RecurringSchedule::__wakeup().
	 */
	public function __wakeup() {
		if ( is_null( $this->scheduled_timestamp ) && ! is_null( $this->start_timestamp ) ) {
			$this->scheduled_timestamp = $this->start_timestamp;
			unset( $this->start_timestamp );
		}

		if ( is_null( $this->recurrence ) && ! is_null( $this->cron ) ) {
			$this->recurrence = $this->cron;
			unset( $this->cron );
		}
		parent::__wakeup();
	}
}

action-scheduler/classes/ActionScheduler_Compatibility.php000064400000006235151335517650020131 0ustar00<?php

/**
 * Class ActionScheduler_Compatibility
 */
class ActionScheduler_Compatibility {

	/**
	 * Converts a shorthand byte value to an integer byte value.
	 *
	 * Wrapper for wp_convert_hr_to_bytes(), moved to load.php in WordPress 4.6 from media.php
	 *
	 * @link https://secure.php.net/manual/en/function.ini-get.php
	 * @link https://secure.php.net/manual/en/faq.using.php#faq.using.shorthandbytes
	 *
	 * @param string $value A (PHP ini) byte value, either shorthand or ordinary.
	 * @return int An integer byte value.
	 */
	public static function convert_hr_to_bytes( $value ) {
		if ( function_exists( 'wp_convert_hr_to_bytes' ) ) {
			return wp_convert_hr_to_bytes( $value );
		}

		$value = strtolower( trim( $value ) );
		$bytes = (int) $value;

		if ( false !== strpos( $value, 'g' ) ) {
			$bytes *= GB_IN_BYTES;
		} elseif ( false !== strpos( $value, 'm' ) ) {
			$bytes *= MB_IN_BYTES;
		} elseif ( false !== strpos( $value, 'k' ) ) {
			$bytes *= KB_IN_BYTES;
		}

		// Deal with large (float) values which run into the maximum integer size.
		return min( $bytes, PHP_INT_MAX );
	}

	/**
	 * Attempts to raise the PHP memory limit for memory intensive processes.
	 *
	 * Only allows raising the existing limit and prevents lowering it.
	 *
	 * Wrapper for wp_raise_memory_limit(), added in WordPress v4.6.0
	 *
	 * @return bool|int|string The limit that was set or false on failure.
	 */
	public static function raise_memory_limit() {
		if ( function_exists( 'wp_raise_memory_limit' ) ) {
			return wp_raise_memory_limit( 'admin' );
		}

		$current_limit     = @ini_get( 'memory_limit' );
		$current_limit_int = self::convert_hr_to_bytes( $current_limit );

		if ( -1 === $current_limit_int ) {
			return false;
		}

		$wp_max_limit       = WP_MAX_MEMORY_LIMIT;
		$wp_max_limit_int   = self::convert_hr_to_bytes( $wp_max_limit );
		$filtered_limit     = apply_filters( 'admin_memory_limit', $wp_max_limit );
		$filtered_limit_int = self::convert_hr_to_bytes( $filtered_limit );

		if ( -1 === $filtered_limit_int || ( $filtered_limit_int > $wp_max_limit_int && $filtered_limit_int > $current_limit_int ) ) {
			if ( false !== @ini_set( 'memory_limit', $filtered_limit ) ) {
				return $filtered_limit;
			} else {
				return false;
			}
		} elseif ( -1 === $wp_max_limit_int || $wp_max_limit_int > $current_limit_int ) {
			if ( false !== @ini_set( 'memory_limit', $wp_max_limit ) ) {
				return $wp_max_limit;
			} else {
				return false;
			}
		}
		return false;
	}

	/**
	 * Attempts to raise the PHP timeout for time intensive processes.
	 *
	 * Only allows raising the existing limit and prevents lowering it. Wrapper for wc_set_time_limit(), when available.
	 *
	 * @param int The time limit in seconds.
	 */
	public static function raise_time_limit( $limit = 0 ) {
		if ( $limit < ini_get( 'max_execution_time' ) ) {
			return;
		}

		if ( function_exists( 'wc_set_time_limit' ) ) {
			wc_set_time_limit( $limit );
		} elseif ( function_exists( 'set_time_limit' ) && false === strpos( ini_get( 'disable_functions' ), 'set_time_limit' ) && ! ini_get( 'safe_mode' ) ) { // phpcs:ignore PHPCompatibility.IniDirectives.RemovedIniDirectives.safe_modeDeprecatedRemoved
			@set_time_limit( $limit );
		}
	}
}
action-scheduler/classes/ActionScheduler_AdminView.php000064400000012327151335517650017202 0ustar00<?php

/**
 * Class ActionScheduler_AdminView
 * @codeCoverageIgnore
 */
class ActionScheduler_AdminView extends ActionScheduler_AdminView_Deprecated {

	private static $admin_view = NULL;

	private static $screen_id = 'tools_page_action-scheduler';

	/** @var ActionScheduler_ListTable */
	protected $list_table;

	/**
	 * @return ActionScheduler_AdminView
	 * @codeCoverageIgnore
	 */
	public static function instance() {

		if ( empty( self::$admin_view ) ) {
			$class = apply_filters('action_scheduler_admin_view_class', 'ActionScheduler_AdminView');
			self::$admin_view = new $class();
		}

		return self::$admin_view;
	}

	/**
	 * @codeCoverageIgnore
	 */
	public function init() {
		if ( is_admin() && ( ! defined( 'DOING_AJAX' ) || false == DOING_AJAX ) ) {

			if ( class_exists( 'WooCommerce' ) ) {
				add_action( 'woocommerce_admin_status_content_action-scheduler', array( $this, 'render_admin_ui' ) );
				add_action( 'woocommerce_system_status_report', array( $this, 'system_status_report' ) );
				add_filter( 'woocommerce_admin_status_tabs', array( $this, 'register_system_status_tab' ) );
			}

			add_action( 'admin_menu', array( $this, 'register_menu' ) );

			add_action( 'current_screen', array( $this, 'add_help_tabs' ) );
		}
	}

	public function system_status_report() {
		$table = new ActionScheduler_wcSystemStatus( ActionScheduler::store() );
		$table->render();
	}

	/**
	 * Registers action-scheduler into WooCommerce > System status.
	 *
	 * @param array $tabs An associative array of tab key => label.
	 * @return array $tabs An associative array of tab key => label, including Action Scheduler's tabs
	 */
	public function register_system_status_tab( array $tabs ) {
		$tabs['action-scheduler'] = __( 'Scheduled Actions', 'woocommerce' );

		return $tabs;
	}

	/**
	 * Include Action Scheduler's administration under the Tools menu.
	 *
	 * A menu under the Tools menu is important for backward compatibility (as that's
	 * where it started), and also provides more convenient access than the WooCommerce
	 * System Status page, and for sites where WooCommerce isn't active.
	 */
	public function register_menu() {
		$hook_suffix = add_submenu_page(
			'tools.php',
			__( 'Scheduled Actions', 'woocommerce' ),
			__( 'Scheduled Actions', 'woocommerce' ),
			'manage_options',
			'action-scheduler',
			array( $this, 'render_admin_ui' )
		);
		add_action( 'load-' . $hook_suffix , array( $this, 'process_admin_ui' ) );
	}

	/**
	 * Triggers processing of any pending actions.
	 */
	public function process_admin_ui() {
		$this->get_list_table();
	}

	/**
	 * Renders the Admin UI
	 */
	public function render_admin_ui() {
		$table = $this->get_list_table();
		$table->display_page();
	}

	/**
	 * Get the admin UI object and process any requested actions.
	 *
	 * @return ActionScheduler_ListTable
	 */
	protected function get_list_table() {
		if ( null === $this->list_table ) {
			$this->list_table = new ActionScheduler_ListTable( ActionScheduler::store(), ActionScheduler::logger(), ActionScheduler::runner() );
			$this->list_table->process_actions();
		}

		return $this->list_table;
	}

	/**
	 * Provide more information about the screen and its data in the help tab.
	 */
	public function add_help_tabs() {
		$screen = get_current_screen();

		if ( ! $screen || self::$screen_id != $screen->id ) {
			return;
		}

		$as_version = ActionScheduler_Versions::instance()->latest_version();
		$screen->add_help_tab(
			array(
				'id'      => 'action_scheduler_about',
				'title'   => __( 'About', 'woocommerce' ),
				'content' =>
					'<h2>' . sprintf( __( 'About Action Scheduler %s', 'woocommerce' ), $as_version ) . '</h2>' .
					'<p>' .
						__( 'Action Scheduler is a scalable, traceable job queue for background processing large sets of actions. Action Scheduler works by triggering an action hook to run at some time in the future. Scheduled actions can also be scheduled to run on a recurring schedule.', 'woocommerce' ) .
					'</p>',
			)
		);

		$screen->add_help_tab(
			array(
				'id'      => 'action_scheduler_columns',
				'title'   => __( 'Columns', 'woocommerce' ),
				'content' =>
					'<h2>' . __( 'Scheduled Action Columns', 'woocommerce' ) . '</h2>' .
					'<ul>' .
					sprintf( '<li><strong>%1$s</strong>: %2$s</li>', __( 'Hook', 'woocommerce' ), __( 'Name of the action hook that will be triggered.', 'woocommerce' ) ) .
					sprintf( '<li><strong>%1$s</strong>: %2$s</li>', __( 'Status', 'woocommerce' ), __( 'Action statuses are Pending, Complete, Canceled, Failed', 'woocommerce' ) ) .
					sprintf( '<li><strong>%1$s</strong>: %2$s</li>', __( 'Arguments', 'woocommerce' ), __( 'Optional data array passed to the action hook.', 'woocommerce' ) ) .
					sprintf( '<li><strong>%1$s</strong>: %2$s</li>', __( 'Group', 'woocommerce' ), __( 'Optional action group.', 'woocommerce' ) ) .
					sprintf( '<li><strong>%1$s</strong>: %2$s</li>', __( 'Recurrence', 'woocommerce' ), __( 'The action\'s schedule frequency.', 'woocommerce' ) ) .
					sprintf( '<li><strong>%1$s</strong>: %2$s</li>', __( 'Scheduled', 'woocommerce' ), __( 'The date/time the action is/was scheduled to run.', 'woocommerce' ) ) .
					sprintf( '<li><strong>%1$s</strong>: %2$s</li>', __( 'Log', 'woocommerce' ), __( 'Activity log for the action.', 'woocommerce' ) ) .
					'</ul>',
			)
		);
	}
}
action-scheduler/classes/ActionScheduler_Versions.php000064400000002357151335517650017131 0ustar00<?php

/**
 * Class ActionScheduler_Versions
 */
class ActionScheduler_Versions {
	/**
	 * @var ActionScheduler_Versions
	 */
	private static $instance = NULL;

	private $versions = array();

	public function register( $version_string, $initialization_callback ) {
		if ( isset($this->versions[$version_string]) ) {
			return FALSE;
		}
		$this->versions[$version_string] = $initialization_callback;
		return TRUE;
	}

	public function get_versions() {
		return $this->versions;
	}

	public function latest_version() {
		$keys = array_keys($this->versions);
		if ( empty($keys) ) {
			return false;
		}
		uasort( $keys, 'version_compare' );
		return end($keys);
	}

	public function latest_version_callback() {
		$latest = $this->latest_version();
		if ( empty($latest) || !isset($this->versions[$latest]) ) {
			return '__return_null';
		}
		return $this->versions[$latest];
	}

	/**
	 * @return ActionScheduler_Versions
	 * @codeCoverageIgnore
	 */
	public static function instance() {
		if ( empty(self::$instance) ) {
			self::$instance = new self();
		}
		return self::$instance;
	}

	/**
	 * @codeCoverageIgnore
	 */
	public static function initialize_latest_version() {
		$self = self::instance();
		call_user_func($self->latest_version_callback());
	}
}
 action-scheduler/classes/ActionScheduler_LogEntry.php000064400000003344151335517650017061 0ustar00<?php

/**
 * Class ActionScheduler_LogEntry
 */
class ActionScheduler_LogEntry {

	/**
	 * @var int $action_id
	 */
	protected $action_id =  '';

	/**
	 * @var string $message
	 */
	protected $message =  '';

	/**
	 * @var Datetime $date
	 */
	protected $date;

	/**
	 * Constructor
	 *
	 * @param mixed  $action_id Action ID
	 * @param string $message   Message
	 * @param Datetime $date    Datetime object with the time when this log entry was created. If this parameter is
	 *                          not provided a new Datetime object (with current time) will be created.
	 */
	public function __construct( $action_id, $message, $date = null ) {

		/*
		 * ActionScheduler_wpCommentLogger::get_entry() previously passed a 3rd param of $comment->comment_type
		 * to ActionScheduler_LogEntry::__construct(), goodness knows why, and the Follow-up Emails plugin
		 * hard-codes loading its own version of ActionScheduler_wpCommentLogger with that out-dated method,
		 * goodness knows why, so we need to guard against that here instead of using a DateTime type declaration
		 * for the constructor's 3rd param of $date and causing a fatal error with older versions of FUE.
		 */
		if ( null !== $date && ! is_a( $date, 'DateTime' ) ) {
			_doing_it_wrong( __METHOD__, 'The third parameter must be a valid DateTime instance, or null.', '2.0.0' );
			$date = null;
		}

		$this->action_id = $action_id;
		$this->message   = $message;
		$this->date      = $date ? $date : new Datetime;
	}

	/**
	 * Returns the date when this log entry was created
	 *
	 * @return Datetime
	 */
	public function get_date() {
		return $this->date;
	}

	public function get_action_id() {
		return $this->action_id;
	}

	public function get_message() {
		return $this->message;
	}
}

action-scheduler/classes/ActionScheduler_ActionClaim.php000064400000000566151335517650017504 0ustar00<?php

/**
 * Class ActionScheduler_ActionClaim
 */
class ActionScheduler_ActionClaim {
	private $id = '';
	private $action_ids = array();

	public function __construct( $id, array $action_ids ) {
		$this->id = $id;
		$this->action_ids = $action_ids;
	}

	public function get_id() {
		return $this->id;
	}

	public function get_actions() {
		return $this->action_ids;
	}
}
 action-scheduler/classes/migration/Controller.php000064400000014150151335517650016273 0ustar00<?php

namespace Action_Scheduler\Migration;

use ActionScheduler_DataController;
use ActionScheduler_LoggerSchema;
use ActionScheduler_StoreSchema;
use Action_Scheduler\WP_CLI\ProgressBar;

/**
 * Class Controller
 *
 * The main plugin/initialization class for migration to custom tables.
 *
 * @package Action_Scheduler\Migration
 *
 * @since 3.0.0
 *
 * @codeCoverageIgnore
 */
class Controller {
	private static $instance;

	/** @var Action_Scheduler\Migration\Scheduler */
	private $migration_scheduler;

	/** @var string */
	private $store_classname;

	/** @var string */
	private $logger_classname;

	/** @var bool */
	private $migrate_custom_store;

	/**
	 * Controller constructor.
	 *
	 * @param Scheduler $migration_scheduler Migration scheduler object.
	 */
	protected function __construct( Scheduler $migration_scheduler ) {
		$this->migration_scheduler = $migration_scheduler;
		$this->store_classname     = '';
	}

	/**
	 * Set the action store class name.
	 *
	 * @param string $class Classname of the store class.
	 *
	 * @return string
	 */
	public function get_store_class( $class ) {
		if ( \ActionScheduler_DataController::is_migration_complete() ) {
			return \ActionScheduler_DataController::DATASTORE_CLASS;
		} elseif ( \ActionScheduler_Store::DEFAULT_CLASS !== $class ) {
			$this->store_classname = $class;
			return $class;
		} else {
			return 'ActionScheduler_HybridStore';
		}
	}

	/**
	 * Set the action logger class name.
	 *
	 * @param string $class Classname of the logger class.
	 *
	 * @return string
	 */
	public function get_logger_class( $class ) {
		\ActionScheduler_Store::instance();

		if ( $this->has_custom_datastore() ) {
			$this->logger_classname = $class;
			return $class;
		} else {
			return \ActionScheduler_DataController::LOGGER_CLASS;
		}
	}

	/**
	 * Get flag indicating whether a custom datastore is in use.
	 *
	 * @return bool
	 */
	public function has_custom_datastore() {
		return (bool) $this->store_classname;
	}

	/**
	 * Set up the background migration process.
	 *
	 * @return void
	 */
	public function schedule_migration() {
		$logging_tables = new ActionScheduler_LoggerSchema();
		$store_tables   = new ActionScheduler_StoreSchema();

		/*
		 * In some unusual cases, the expected tables may not have been created. In such cases
		 * we do not schedule a migration as doing so will lead to fatal error conditions.
		 *
		 * In such cases the user will likely visit the Tools > Scheduled Actions screen to
		 * investigate, and will see appropriate messaging (this step also triggers an attempt
		 * to rebuild any missing tables).
		 *
		 * @see https://github.com/woocommerce/action-scheduler/issues/653
		 */
		if (
			ActionScheduler_DataController::is_migration_complete()
			|| $this->migration_scheduler->is_migration_scheduled()
			|| ! $store_tables->tables_exist()
			|| ! $logging_tables->tables_exist()
		) {
			return;
		}

		$this->migration_scheduler->schedule_migration();
	}

	/**
	 * Get the default migration config object
	 *
	 * @return ActionScheduler\Migration\Config
	 */
	public function get_migration_config_object() {
		static $config = null;

		if ( ! $config ) {
			$source_store  = $this->store_classname ? new $this->store_classname() : new \ActionScheduler_wpPostStore();
			$source_logger = $this->logger_classname ? new $this->logger_classname() : new \ActionScheduler_wpCommentLogger();

			$config = new Config();
			$config->set_source_store( $source_store );
			$config->set_source_logger( $source_logger );
			$config->set_destination_store( new \ActionScheduler_DBStoreMigrator() );
			$config->set_destination_logger( new \ActionScheduler_DBLogger() );

			if ( defined( 'WP_CLI' ) && WP_CLI ) {
				$config->set_progress_bar( new ProgressBar( '', 0 ) );
			}
		}

		return apply_filters( 'action_scheduler/migration_config', $config );
	}

	/**
	 * Hook dashboard migration notice.
	 */
	public function hook_admin_notices() {
		if ( ! $this->allow_migration() || \ActionScheduler_DataController::is_migration_complete() ) {
			return;
		}
		add_action( 'admin_notices', array( $this, 'display_migration_notice' ), 10, 0 );
	}

	/**
	 * Show a dashboard notice that migration is in progress.
	 */
	public function display_migration_notice() {
		printf( '<div class="notice notice-warning"><p>%s</p></div>', esc_html__( 'Action Scheduler migration in progress. The list of scheduled actions may be incomplete.', 'woocommerce' ) );
	}

	/**
	 * Add store classes. Hook migration.
	 */
	private function hook() {
		add_filter( 'action_scheduler_store_class', array( $this, 'get_store_class' ), 100, 1 );
		add_filter( 'action_scheduler_logger_class', array( $this, 'get_logger_class' ), 100, 1 );
		add_action( 'init', array( $this, 'maybe_hook_migration' ) );
		add_action( 'wp_loaded', array( $this, 'schedule_migration' ) );

		// Action Scheduler may be displayed as a Tools screen or WooCommerce > Status administration screen
		add_action( 'load-tools_page_action-scheduler', array( $this, 'hook_admin_notices' ), 10, 0 );
		add_action( 'load-woocommerce_page_wc-status', array( $this, 'hook_admin_notices' ), 10, 0 );
	}

	/**
	 * Possibly hook the migration scheduler action.
	 *
	 * @author Jeremy Pry
	 */
	public function maybe_hook_migration() {
		if ( ! $this->allow_migration() || \ActionScheduler_DataController::is_migration_complete() ) {
			return;
		}

		$this->migration_scheduler->hook();
	}

	/**
	 * Allow datastores to enable migration to AS tables.
	 */
	public function allow_migration() {
		if ( ! \ActionScheduler_DataController::dependencies_met() ) {
			return false;
		}

		if ( null === $this->migrate_custom_store ) {
			$this->migrate_custom_store = apply_filters( 'action_scheduler_migrate_data_store', false );
		}

		return ( ! $this->has_custom_datastore() ) || $this->migrate_custom_store;
	}

	/**
	 * Proceed with the migration if the dependencies have been met.
	 */
	public static function init() {
		if ( \ActionScheduler_DataController::dependencies_met() ) {
			self::instance()->hook();
		}
	}

	/**
	 * Singleton factory.
	 */
	public static function instance() {
		if ( ! isset( self::$instance ) ) {
			self::$instance = new static( new Scheduler() );
		}

		return self::$instance;
	}
}
action-scheduler/classes/migration/Runner.php000064400000007244151335517650015427 0ustar00<?php


namespace Action_Scheduler\Migration;

/**
 * Class Runner
 *
 * @package Action_Scheduler\Migration
 *
 * @since 3.0.0
 *
 * @codeCoverageIgnore
 */
class Runner {
	/** @var ActionScheduler_Store */
	private $source_store;

	/** @var ActionScheduler_Store */
	private $destination_store;

	/** @var ActionScheduler_Logger */
	private $source_logger;

	/** @var ActionScheduler_Logger */
	private $destination_logger;

	/** @var BatchFetcher */
	private $batch_fetcher;

	/** @var ActionMigrator */
	private $action_migrator;

	/** @var LogMigrator */
	private $log_migrator;

	/** @var ProgressBar */
	private $progress_bar;

	/**
	 * Runner constructor.
	 *
	 * @param Config $config Migration configuration object.
	 */
	public function __construct( Config $config ) {
		$this->source_store       = $config->get_source_store();
		$this->destination_store  = $config->get_destination_store();
		$this->source_logger      = $config->get_source_logger();
		$this->destination_logger = $config->get_destination_logger();

		$this->batch_fetcher = new BatchFetcher( $this->source_store );
		if ( $config->get_dry_run() ) {
			$this->log_migrator    = new DryRun_LogMigrator( $this->source_logger, $this->destination_logger );
			$this->action_migrator = new DryRun_ActionMigrator( $this->source_store, $this->destination_store, $this->log_migrator );
		} else {
			$this->log_migrator    = new LogMigrator( $this->source_logger, $this->destination_logger );
			$this->action_migrator = new ActionMigrator( $this->source_store, $this->destination_store, $this->log_migrator );
		}

		if ( defined( 'WP_CLI' ) && WP_CLI ) {
			$this->progress_bar = $config->get_progress_bar();
		}
	}

	/**
	 * Run migration batch.
	 *
	 * @param int $batch_size Optional batch size. Default 10.
	 *
	 * @return int Size of batch processed.
	 */
	public function run( $batch_size = 10 ) {
		$batch = $this->batch_fetcher->fetch( $batch_size );
		$batch_size = count( $batch );

		if ( ! $batch_size ) {
			return 0;
		}

		if ( $this->progress_bar ) {
			/* translators: %d: amount of actions */
			$this->progress_bar->set_message( sprintf( _n( 'Migrating %d action', 'Migrating %d actions', $batch_size, 'woocommerce' ), number_format_i18n( $batch_size ) ) );
			$this->progress_bar->set_count( $batch_size );
		}

		$this->migrate_actions( $batch );

		return $batch_size;
	}

	/**
	 * Migration a batch of actions.
	 *
	 * @param array $action_ids List of action IDs to migrate.
	 */
	public function migrate_actions( array $action_ids ) {
		do_action( 'action_scheduler/migration_batch_starting', $action_ids );

		\ActionScheduler::logger()->unhook_stored_action();
		$this->destination_logger->unhook_stored_action();

		foreach ( $action_ids as $source_action_id ) {
			$destination_action_id = $this->action_migrator->migrate( $source_action_id );
			if ( $destination_action_id ) {
				$this->destination_logger->log( $destination_action_id, sprintf(
					/* translators: 1: source action ID 2: source store class 3: destination action ID 4: destination store class */
					__( 'Migrated action with ID %1$d in %2$s to ID %3$d in %4$s', 'woocommerce' ),
					$source_action_id,
					get_class( $this->source_store ),
					$destination_action_id,
					get_class( $this->destination_store )
				) );
			}

			if ( $this->progress_bar ) {
				$this->progress_bar->tick();
			}
		}

		if ( $this->progress_bar ) {
			$this->progress_bar->finish();
		}

		\ActionScheduler::logger()->hook_stored_action();

		do_action( 'action_scheduler/migration_batch_complete', $action_ids );
	}

	/**
	 * Initialize destination store and logger.
	 */
	public function init_destination() {
		$this->destination_store->init();
		$this->destination_logger->init();
	}
}
action-scheduler/classes/migration/DryRun_LogMigrator.php000064400000000711151335517650017677 0ustar00<?php


namespace Action_Scheduler\Migration;

/**
 * Class DryRun_LogMigrator
 *
 * @package Action_Scheduler\Migration
 *
 * @codeCoverageIgnore
 */
class DryRun_LogMigrator extends LogMigrator {
	/**
	 * Simulate migrating an action log.
	 *
	 * @param int $source_action_id Source logger object.
	 * @param int $destination_action_id Destination logger object.
	 */
	public function migrate( $source_action_id, $destination_action_id ) {
		// no-op
	}
}action-scheduler/classes/migration/Config.php000064400000006747151335517650015372 0ustar00<?php


namespace Action_Scheduler\Migration;

use Action_Scheduler\WP_CLI\ProgressBar;
use ActionScheduler_Logger as Logger;
use ActionScheduler_Store as Store;

/**
 * Class Config
 *
 * @package Action_Scheduler\Migration
 *
 * @since 3.0.0
 *
 * A config builder for the ActionScheduler\Migration\Runner class
 */
class Config {
	/** @var ActionScheduler_Store */
	private $source_store;

	/** @var ActionScheduler_Logger */
	private $source_logger;

	/** @var ActionScheduler_Store */
	private $destination_store;

	/** @var ActionScheduler_Logger */
	private $destination_logger;

	/** @var Progress bar */
	private $progress_bar;

	/** @var bool */
	private $dry_run = false;

	/**
	 * Config constructor.
	 */
	public function __construct() {

	}

	/**
	 * Get the configured source store.
	 *
	 * @return ActionScheduler_Store
	 */
	public function get_source_store() {
		if ( empty( $this->source_store ) ) {
			throw new \RuntimeException( __( 'Source store must be configured before running a migration', 'woocommerce' ) );
		}

		return $this->source_store;
	}

	/**
	 * Set the configured source store.
	 *
	 * @param ActionScheduler_Store $store Source store object.
	 */
	public function set_source_store( Store $store ) {
		$this->source_store = $store;
	}

	/**
	 * Get the configured source loger.
	 *
	 * @return ActionScheduler_Logger
	 */
	public function get_source_logger() {
		if ( empty( $this->source_logger ) ) {
			throw new \RuntimeException( __( 'Source logger must be configured before running a migration', 'woocommerce' ) );
		}

		return $this->source_logger;
	}

	/**
	 * Set the configured source logger.
	 *
	 * @param ActionScheduler_Logger $logger
	 */
	public function set_source_logger( Logger $logger ) {
		$this->source_logger = $logger;
	}

	/**
	 * Get the configured destination store.
	 *
	 * @return ActionScheduler_Store
	 */
	public function get_destination_store() {
		if ( empty( $this->destination_store ) ) {
			throw new \RuntimeException( __( 'Destination store must be configured before running a migration', 'woocommerce' ) );
		}

		return $this->destination_store;
	}

	/**
	 * Set the configured destination store.
	 *
	 * @param ActionScheduler_Store $store
	 */
	public function set_destination_store( Store $store ) {
		$this->destination_store = $store;
	}

	/**
	 * Get the configured destination logger.
	 *
	 * @return ActionScheduler_Logger
	 */
	public function get_destination_logger() {
		if ( empty( $this->destination_logger ) ) {
			throw new \RuntimeException( __( 'Destination logger must be configured before running a migration', 'woocommerce' ) );
		}

		return $this->destination_logger;
	}

	/**
	 * Set the configured destination logger.
	 *
	 * @param ActionScheduler_Logger $logger
	 */
	public function set_destination_logger( Logger $logger ) {
		$this->destination_logger = $logger;
	}

	/**
	 * Get flag indicating whether it's a dry run.
	 *
	 * @return bool
	 */
	public function get_dry_run() {
		return $this->dry_run;
	}

	/**
	 * Set flag indicating whether it's a dry run.
	 *
	 * @param bool $dry_run
	 */
	public function set_dry_run( $dry_run ) {
		$this->dry_run = (bool) $dry_run;
	}

	/**
	 * Get progress bar object.
	 *
	 * @return ActionScheduler\WPCLI\ProgressBar
	 */
	public function get_progress_bar() {
		return $this->progress_bar;
	}

	/**
	 * Set progress bar object.
	 *
	 * @param ActionScheduler\WPCLI\ProgressBar $progress_bar
	 */
	public function set_progress_bar( ProgressBar $progress_bar ) {
		$this->progress_bar = $progress_bar;
	}
}
action-scheduler/classes/migration/ActionMigrator.php000064400000007060151335517650017074 0ustar00<?php


namespace Action_Scheduler\Migration;

/**
 * Class ActionMigrator
 *
 * @package Action_Scheduler\Migration
 *
 * @since 3.0.0
 *
 * @codeCoverageIgnore
 */
class ActionMigrator {
	/** var ActionScheduler_Store */
	private $source;

	/** var ActionScheduler_Store */
	private $destination;

	/** var LogMigrator */
	private $log_migrator;

	/**
	 * ActionMigrator constructor.
	 *
	 * @param ActionScheduler_Store $source_store Source store object.
	 * @param ActionScheduler_Store $destination_store Destination store object.
	 * @param LogMigrator           $log_migrator Log migrator object.
	 */
	public function __construct( \ActionScheduler_Store $source_store, \ActionScheduler_Store $destination_store, LogMigrator $log_migrator ) {
		$this->source       = $source_store;
		$this->destination  = $destination_store;
		$this->log_migrator = $log_migrator;
	}

	/**
	 * Migrate an action.
	 *
	 * @param int $source_action_id Action ID.
	 *
	 * @return int 0|new action ID
	 */
	public function migrate( $source_action_id ) {
		try {
			$action = $this->source->fetch_action( $source_action_id );
			$status = $this->source->get_status( $source_action_id );
		} catch ( \Exception $e ) {
			$action = null;
			$status = '';
		}

		if ( is_null( $action ) || empty( $status ) || ! $action->get_schedule()->get_date() ) {
			// null action or empty status means the fetch operation failed or the action didn't exist
			// null schedule means it's missing vital data
			// delete it and move on
			try {
				$this->source->delete_action( $source_action_id );
			} catch ( \Exception $e ) {
				// nothing to do, it didn't exist in the first place
			}
			do_action( 'action_scheduler/no_action_to_migrate', $source_action_id, $this->source, $this->destination );

			return 0;
		}

		try {

			// Make sure the last attempt date is set correctly for completed and failed actions
			$last_attempt_date = ( $status !== \ActionScheduler_Store::STATUS_PENDING ) ? $this->source->get_date( $source_action_id ) : null;

			$destination_action_id = $this->destination->save_action( $action, null, $last_attempt_date );
		} catch ( \Exception $e ) {
			do_action( 'action_scheduler/migrate_action_failed', $source_action_id, $this->source, $this->destination );

			return 0; // could not save the action in the new store
		}

		try {
			switch ( $status ) {
				case \ActionScheduler_Store::STATUS_FAILED :
					$this->destination->mark_failure( $destination_action_id );
					break;
				case \ActionScheduler_Store::STATUS_CANCELED :
					$this->destination->cancel_action( $destination_action_id );
					break;
			}

			$this->log_migrator->migrate( $source_action_id, $destination_action_id );
			$this->source->delete_action( $source_action_id );

			$test_action = $this->source->fetch_action( $source_action_id );
			if ( ! is_a( $test_action, 'ActionScheduler_NullAction' ) ) {
				throw new \RuntimeException( sprintf( __( 'Unable to remove source migrated action %s', 'woocommerce' ), $source_action_id ) );
			}
			do_action( 'action_scheduler/migrated_action', $source_action_id, $destination_action_id, $this->source, $this->destination );

			return $destination_action_id;
		} catch ( \Exception $e ) {
			// could not delete from the old store
			$this->source->mark_migrated( $source_action_id );
			do_action( 'action_scheduler/migrate_action_incomplete', $source_action_id, $destination_action_id, $this->source, $this->destination );
			do_action( 'action_scheduler/migrated_action', $source_action_id, $destination_action_id, $this->source, $this->destination );

			return $destination_action_id;
		}
	}
}
action-scheduler/classes/migration/Scheduler.php000064400000005542151335517650016073 0ustar00<?php


namespace Action_Scheduler\Migration;

/**
 * Class Scheduler
 *
 * @package Action_Scheduler\WP_CLI
 *
 * @since 3.0.0
 *
 * @codeCoverageIgnore
 */
class Scheduler {
	/** Migration action hook. */
	const HOOK            = 'action_scheduler/migration_hook';

	/** Migration action group. */
	const GROUP           = 'action-scheduler-migration';

	/**
	 * Set up the callback for the scheduled job.
	 */
	public function hook() {
		add_action( self::HOOK, array( $this, 'run_migration' ), 10, 0 );
	}

	/**
	 * Remove the callback for the scheduled job.
	 */
	public function unhook() {
		remove_action( self::HOOK, array( $this, 'run_migration' ), 10 );
	}

	/**
	 * The migration callback.
	 */
	public function run_migration() {
		$migration_runner = $this->get_migration_runner();
		$count            = $migration_runner->run( $this->get_batch_size() );

		if ( $count === 0 ) {
			$this->mark_complete();
		} else {
			$this->schedule_migration( time() + $this->get_schedule_interval() );
		}
	}

	/**
	 * Mark the migration complete.
	 */
	public function mark_complete() {
		$this->unschedule_migration();

		\ActionScheduler_DataController::mark_migration_complete();
		do_action( 'action_scheduler/migration_complete' );
	}

	/**
	 * Get a flag indicating whether the migration is scheduled.
	 *
	 * @return bool Whether there is a pending action in the store to handle the migration
	 */
	public function is_migration_scheduled() {
		$next = as_next_scheduled_action( self::HOOK );

		return ! empty( $next );
	}

	/**
	 * Schedule the migration.
	 *
	 * @param int $when Optional timestamp to run the next migration batch. Defaults to now.
	 *
	 * @return string The action ID
	 */
	public function schedule_migration( $when = 0 ) {
		$next = as_next_scheduled_action( self::HOOK );

		if ( ! empty( $next ) ) {
			return $next;
		}

		if ( empty( $when ) ) {
			$when = time() + MINUTE_IN_SECONDS;
		}

		return as_schedule_single_action( $when, self::HOOK, array(), self::GROUP );
	}

	/**
	 * Remove the scheduled migration action.
	 */
	public function unschedule_migration() {
		as_unschedule_action( self::HOOK, null, self::GROUP );
	}

	/**
	 * Get migration batch schedule interval.
	 *
	 * @return int Seconds between migration runs. Defaults to 0 seconds to allow chaining migration via Async Runners.
	 */
	private function get_schedule_interval() {
		return (int) apply_filters( 'action_scheduler/migration_interval', 0 );
	}

	/**
	 * Get migration batch size.
	 *
	 * @return int Number of actions to migrate in each batch. Defaults to 250.
	 */
	private function get_batch_size() {
		return (int) apply_filters( 'action_scheduler/migration_batch_size', 250 );
	}

	/**
	 * Get migration runner object.
	 *
	 * @return Runner
	 */
	private function get_migration_runner() {
		$config = Controller::instance()->get_migration_config_object();

		return new Runner( $config );
	}

}
action-scheduler/classes/migration/ActionScheduler_DBStoreMigrator.php000064400000003253151335517650022315 0ustar00<?php

/**
 * Class ActionScheduler_DBStoreMigrator
 *
 * A  class for direct saving of actions to the table data store during migration.
 *
 * @since 3.0.0
 */
class ActionScheduler_DBStoreMigrator extends ActionScheduler_DBStore {

	/**
	 * Save an action with optional last attempt date.
	 *
	 * Normally, saving an action sets its attempted date to 0000-00-00 00:00:00 because when an action is first saved,
	 * it can't have been attempted yet, but migrated completed actions will have an attempted date, so we need to save
	 * that when first saving the action.
	 *
	 * @param ActionScheduler_Action $action
	 * @param \DateTime $scheduled_date Optional date of the first instance to store.
	 * @param \DateTime $last_attempt_date Optional date the action was last attempted.
	 *
	 * @return string The action ID
	 * @throws \RuntimeException When the action is not saved.
	 */
	public function save_action( ActionScheduler_Action $action, \DateTime $scheduled_date = null, \DateTime $last_attempt_date = null ){
		try {
			/** @var \wpdb $wpdb */
			global $wpdb;

			$action_id = parent::save_action( $action, $scheduled_date );

			if ( null !== $last_attempt_date ) {
				$data = [
					'last_attempt_gmt'   => $this->get_scheduled_date_string( $action, $last_attempt_date ),
					'last_attempt_local' => $this->get_scheduled_date_string_local( $action, $last_attempt_date ),
				];

				$wpdb->update( $wpdb->actionscheduler_actions, $data, array( 'action_id' => $action_id ), array( '%s', '%s' ), array( '%d' ) );
			}

			return $action_id;
		} catch ( \Exception $e ) {
			throw new \RuntimeException( sprintf( __( 'Error saving action: %s', 'woocommerce' ), $e->getMessage() ), 0 );
		}
	}
}
action-scheduler/classes/migration/BatchFetcher.php000064400000003222151335517650016470 0ustar00<?php


namespace Action_Scheduler\Migration;


use ActionScheduler_Store as Store;

/**
 * Class BatchFetcher
 *
 * @package Action_Scheduler\Migration
 *
 * @since 3.0.0
 *
 * @codeCoverageIgnore
 */
class BatchFetcher {
	/** var ActionScheduler_Store */
	private $store;

	/**
	 * BatchFetcher constructor.
	 *
	 * @param ActionScheduler_Store $source_store Source store object.
	 */
	public function __construct( Store $source_store ) {
		$this->store = $source_store;
	}

	/**
	 * Retrieve a list of actions.
	 *
	 * @param int $count The number of actions to retrieve
	 *
	 * @return int[] A list of action IDs
	 */
	public function fetch( $count = 10 ) {
		foreach ( $this->get_query_strategies( $count ) as $query ) {
			$action_ids = $this->store->query_actions( $query );
			if ( ! empty( $action_ids ) ) {
				return $action_ids;
			}
		}

		return [];
	}

	/**
	 * Generate a list of prioritized of action search parameters.
	 *
	 * @param int $count Number of actions to find.
	 *
	 * @return array
	 */
	private function get_query_strategies( $count ) {
		$now  = as_get_datetime_object();
		$args = [
			'date'     => $now,
			'per_page' => $count,
			'offset'   => 0,
			'orderby'  => 'date',
			'order'    => 'ASC',
		];

		$priorities = [
			Store::STATUS_PENDING,
			Store::STATUS_FAILED,
			Store::STATUS_CANCELED,
			Store::STATUS_COMPLETE,
			Store::STATUS_RUNNING,
			'', // any other unanticipated status
		];

		foreach ( $priorities as $status ) {
			yield wp_parse_args( [
				'status'       => $status,
				'date_compare' => '<=',
			], $args );
			yield wp_parse_args( [
				'status'       => $status,
				'date_compare' => '>=',
			], $args );
		}
	}
}action-scheduler/classes/migration/DryRun_ActionMigrator.php000064400000000741151335517650020376 0ustar00<?php


namespace Action_Scheduler\Migration;

/**
 * Class DryRun_ActionMigrator
 *
 * @package Action_Scheduler\Migration
 *
 * @since 3.0.0
 *
 * @codeCoverageIgnore
 */
class DryRun_ActionMigrator extends ActionMigrator {
	/**
	 * Simulate migrating an action.
	 *
	 * @param int $source_action_id Action ID.
	 *
	 * @return int
	 */
	public function migrate( $source_action_id ) {
		do_action( 'action_scheduler/migrate_action_dry_run', $source_action_id );

		return 0;
	}
}
action-scheduler/classes/migration/LogMigrator.php000064400000002272151335517650016400 0ustar00<?php


namespace Action_Scheduler\Migration;

use ActionScheduler_Logger;

/**
 * Class LogMigrator
 *
 * @package Action_Scheduler\Migration
 *
 * @since 3.0.0
 *
 * @codeCoverageIgnore
 */
class LogMigrator {
	/** @var ActionScheduler_Logger */
	private $source;

	/** @var ActionScheduler_Logger */
	private $destination;

	/**
	 * ActionMigrator constructor.
	 *
	 * @param ActionScheduler_Logger $source_logger Source logger object.
	 * @param ActionScheduler_Logger $destination_Logger Destination logger object.
	 */
	public function __construct( ActionScheduler_Logger $source_logger, ActionScheduler_Logger $destination_Logger ) {
		$this->source      = $source_logger;
		$this->destination = $destination_Logger;
	}

	/**
	 * Migrate an action log.
	 *
	 * @param int $source_action_id Source logger object.
	 * @param int $destination_action_id Destination logger object.
	 */
	public function migrate( $source_action_id, $destination_action_id ) {
		$logs = $this->source->get_logs( $source_action_id );
		foreach ( $logs as $log ) {
			if ( $log->get_action_id() == $source_action_id ) {
				$this->destination->log( $destination_action_id, $log->get_message(), $log->get_date() );
			}
		}
	}
}
action-scheduler/classes/ActionScheduler_DataController.php000064400000012233151335517650020230 0ustar00<?php

use Action_Scheduler\Migration\Controller;

/**
 * Class ActionScheduler_DataController
 *
 * The main plugin/initialization class for the data stores.
 *
 * Responsible for hooking everything up with WordPress.
 *
 * @package Action_Scheduler
 *
 * @since 3.0.0
 */
class ActionScheduler_DataController {
	/** Action data store class name. */
	const DATASTORE_CLASS = 'ActionScheduler_DBStore';

	/** Logger data store class name. */
	const LOGGER_CLASS    = 'ActionScheduler_DBLogger';

	/** Migration status option name. */
	const STATUS_FLAG     = 'action_scheduler_migration_status';

	/** Migration status option value. */
	const STATUS_COMPLETE = 'complete';

	/** Migration minimum required PHP version. */
	const MIN_PHP_VERSION = '5.5';

	/** @var ActionScheduler_DataController */
	private static $instance;

	/** @var int */
	private static $sleep_time = 0;

	/** @var int */
	private static $free_ticks = 50;

	/**
	 * Get a flag indicating whether the migration environment dependencies are met.
	 *
	 * @return bool
	 */
	public static function dependencies_met() {
		$php_support = version_compare( PHP_VERSION, self::MIN_PHP_VERSION, '>=' );
		return $php_support && apply_filters( 'action_scheduler_migration_dependencies_met', true );
	}

	/**
	 * Get a flag indicating whether the migration is complete.
	 *
	 * @return bool Whether the flag has been set marking the migration as complete
	 */
	public static function is_migration_complete() {
		return get_option( self::STATUS_FLAG ) === self::STATUS_COMPLETE;
	}

	/**
	 * Mark the migration as complete.
	 */
	public static function mark_migration_complete() {
		update_option( self::STATUS_FLAG, self::STATUS_COMPLETE );
	}

	/**
	 * Unmark migration when a plugin is de-activated. Will not work in case of silent activation, for example in an update.
	 * We do this to mitigate the bug of lost actions which happens if there was an AS 2.x to AS 3.x migration in the past, but that plugin is now
	 * deactivated and the site was running on AS 2.x again.
	 */
	public static function mark_migration_incomplete() {
		delete_option( self::STATUS_FLAG );
	}

	/**
	 * Set the action store class name.
	 *
	 * @param string $class Classname of the store class.
	 *
	 * @return string
	 */
	public static function set_store_class( $class ) {
		return self::DATASTORE_CLASS;
	}

	/**
	 * Set the action logger class name.
	 *
	 * @param string $class Classname of the logger class.
	 *
	 * @return string
	 */
	public static function set_logger_class( $class ) {
		return self::LOGGER_CLASS;
	}

	/**
	 * Set the sleep time in seconds.
	 *
	 * @param integer $sleep_time The number of seconds to pause before resuming operation.
	 */
	public static function set_sleep_time( $sleep_time ) {
		self::$sleep_time = (int) $sleep_time;
	}

	/**
	 * Set the tick count required for freeing memory.
	 *
	 * @param integer $free_ticks The number of ticks to free memory on.
	 */
	public static function set_free_ticks( $free_ticks ) {
		self::$free_ticks = (int) $free_ticks;
	}

	/**
	 * Free memory if conditions are met.
	 *
	 * @param int $ticks Current tick count.
	 */
	public static function maybe_free_memory( $ticks ) {
		if ( self::$free_ticks && 0 === $ticks % self::$free_ticks ) {
			self::free_memory();
		}
	}

	/**
	 * Reduce memory footprint by clearing the database query and object caches.
	 */
	public static function free_memory() {
		if ( 0 < self::$sleep_time ) {
			/* translators: %d: amount of time */
			\WP_CLI::warning( sprintf( _n( 'Stopped the insanity for %d second', 'Stopped the insanity for %d seconds', self::$sleep_time, 'woocommerce' ), self::$sleep_time ) );
			sleep( self::$sleep_time );
		}

		\WP_CLI::warning( __( 'Attempting to reduce used memory...', 'woocommerce' ) );

		/**
		 * @var $wpdb            \wpdb
		 * @var $wp_object_cache \WP_Object_Cache
		 */
		global $wpdb, $wp_object_cache;

		$wpdb->queries = array();

		if ( ! is_a( $wp_object_cache, 'WP_Object_Cache' ) ) {
			return;
		}

		$wp_object_cache->group_ops      = array();
		$wp_object_cache->stats          = array();
		$wp_object_cache->memcache_debug = array();
		$wp_object_cache->cache          = array();

		if ( is_callable( array( $wp_object_cache, '__remoteset' ) ) ) {
			call_user_func( array( $wp_object_cache, '__remoteset' ) ); // important
		}
	}

	/**
	 * Connect to table datastores if migration is complete.
	 * Otherwise, proceed with the migration if the dependencies have been met.
	 */
	public static function init() {
		if ( self::is_migration_complete() ) {
			add_filter( 'action_scheduler_store_class', array( 'ActionScheduler_DataController', 'set_store_class' ), 100 );
			add_filter( 'action_scheduler_logger_class', array( 'ActionScheduler_DataController', 'set_logger_class' ), 100 );
			add_action( 'deactivate_plugin', array( 'ActionScheduler_DataController', 'mark_migration_incomplete' ) );
		} elseif ( self::dependencies_met() ) {
			Controller::init();
		}

		add_action( 'action_scheduler/progress_tick', array( 'ActionScheduler_DataController', 'maybe_free_memory' ) );
	}

	/**
	 * Singleton factory.
	 */
	public static function instance() {
		if ( ! isset( self::$instance ) ) {
			self::$instance = new static();
		}

		return self::$instance;
	}
}
action-scheduler/classes/ActionScheduler_FatalErrorMonitor.php000064400000003747151335517650020736 0ustar00<?php

/**
 * Class ActionScheduler_FatalErrorMonitor
 */
class ActionScheduler_FatalErrorMonitor {
	/** @var ActionScheduler_ActionClaim */
	private $claim = NULL;
	/** @var ActionScheduler_Store */
	private $store = NULL;
	private $action_id = 0;

	public function __construct( ActionScheduler_Store $store ) {
		$this->store = $store;
	}

	public function attach( ActionScheduler_ActionClaim $claim ) {
		$this->claim = $claim;
		add_action( 'shutdown', array( $this, 'handle_unexpected_shutdown' ) );
		add_action( 'action_scheduler_before_execute', array( $this, 'track_current_action' ), 0, 1 );
		add_action( 'action_scheduler_after_execute',  array( $this, 'untrack_action' ), 0, 0 );
		add_action( 'action_scheduler_execution_ignored',  array( $this, 'untrack_action' ), 0, 0 );
		add_action( 'action_scheduler_failed_execution',  array( $this, 'untrack_action' ), 0, 0 );
	}

	public function detach() {
		$this->claim = NULL;
		$this->untrack_action();
		remove_action( 'shutdown', array( $this, 'handle_unexpected_shutdown' ) );
		remove_action( 'action_scheduler_before_execute', array( $this, 'track_current_action' ), 0 );
		remove_action( 'action_scheduler_after_execute',  array( $this, 'untrack_action' ), 0 );
		remove_action( 'action_scheduler_execution_ignored',  array( $this, 'untrack_action' ), 0 );
		remove_action( 'action_scheduler_failed_execution',  array( $this, 'untrack_action' ), 0 );
	}

	public function track_current_action( $action_id ) {
		$this->action_id = $action_id;
	}

	public function untrack_action() {
		$this->action_id = 0;
	}

	public function handle_unexpected_shutdown() {
		if ( $error = error_get_last() ) {
			if ( in_array( $error['type'], array( E_ERROR, E_PARSE, E_COMPILE_ERROR, E_USER_ERROR, E_RECOVERABLE_ERROR ) ) ) {
				if ( !empty($this->action_id) ) {
					$this->store->mark_failure( $this->action_id );
					do_action( 'action_scheduler_unexpected_shutdown', $this->action_id, $error );
				}
			}
			$this->store->release_claim( $this->claim );
		}
	}
}
action-scheduler/classes/ActionScheduler_DateTime.php000064400000003070151335517650017006 0ustar00<?php

/**
 * ActionScheduler DateTime class.
 *
 * This is a custom extension to DateTime that
 */
class ActionScheduler_DateTime extends DateTime {

	/**
	 * UTC offset.
	 *
	 * Only used when a timezone is not set. When a timezone string is
	 * used, this will be set to 0.
	 *
	 * @var int
	 */
	protected $utcOffset = 0;

	/**
	 * Get the unix timestamp of the current object.
	 *
	 * Missing in PHP 5.2 so just here so it can be supported consistently.
	 *
	 * @return int
	 */
	public function getTimestamp() {
		return method_exists( 'DateTime', 'getTimestamp' ) ? parent::getTimestamp() : $this->format( 'U' );
	}

	/**
	 * Set the UTC offset.
	 *
	 * This represents a fixed offset instead of a timezone setting.
	 *
	 * @param $offset
	 */
	public function setUtcOffset( $offset ) {
		$this->utcOffset = intval( $offset );
	}

	/**
	 * Returns the timezone offset.
	 *
	 * @return int
	 * @link http://php.net/manual/en/datetime.getoffset.php
	 */
	public function getOffset() {
		return $this->utcOffset ? $this->utcOffset : parent::getOffset();
	}

	/**
	 * Set the TimeZone associated with the DateTime
	 *
	 * @param DateTimeZone $timezone
	 *
	 * @return static
	 * @link http://php.net/manual/en/datetime.settimezone.php
	 */
	public function setTimezone( $timezone ) {
		$this->utcOffset = 0;
		parent::setTimezone( $timezone );

		return $this;
	}

	/**
	 * Get the timestamp with the WordPress timezone offset added or subtracted.
	 *
	 * @since  3.0.0
	 * @return int
	 */
	public function getOffsetTimestamp() {
		return $this->getTimestamp() + $this->getOffset();
	}
}
action-scheduler/classes/ActionScheduler_wcSystemStatus.php000064400000011601151335517650020333 0ustar00<?php

/**
 * Class ActionScheduler_wcSystemStatus
 */
class ActionScheduler_wcSystemStatus {

	/**
	 * The active data stores
	 *
	 * @var ActionScheduler_Store
	 */
	protected $store;

	function __construct( $store ) {
		$this->store = $store;
	}

	/**
	 * Display action data, including number of actions grouped by status and the oldest & newest action in each status.
	 *
	 * Helpful to identify issues, like a clogged queue.
	 */
	public function render() {
		$action_counts     = $this->store->action_counts();
		$status_labels     = $this->store->get_status_labels();
		$oldest_and_newest = $this->get_oldest_and_newest( array_keys( $status_labels ) );

		$this->get_template( $status_labels, $action_counts, $oldest_and_newest );
	}

	/**
	 * Get oldest and newest scheduled dates for a given set of statuses.
	 *
	 * @param array $status_keys Set of statuses to find oldest & newest action for.
	 * @return array
	 */
	protected function get_oldest_and_newest( $status_keys ) {

		$oldest_and_newest = array();

		foreach ( $status_keys as $status ) {
			$oldest_and_newest[ $status ] = array(
				'oldest' => '&ndash;',
				'newest' => '&ndash;',
			);

			if ( 'in-progress' === $status ) {
				continue;
			}

			$oldest_and_newest[ $status ]['oldest'] = $this->get_action_status_date( $status, 'oldest' );
			$oldest_and_newest[ $status ]['newest'] = $this->get_action_status_date( $status, 'newest' );
		}

		return $oldest_and_newest;
	}

	/**
	 * Get oldest or newest scheduled date for a given status.
	 *
	 * @param string $status Action status label/name string.
	 * @param string $date_type Oldest or Newest.
	 * @return DateTime
	 */
	protected function get_action_status_date( $status, $date_type = 'oldest' ) {

		$order = 'oldest' === $date_type ? 'ASC' : 'DESC';

		$action = $this->store->query_actions( array(
			'claimed'  => false,
			'status'   => $status,
			'per_page' => 1,
			'order'    => $order,
		) );

		if ( ! empty( $action ) ) {
			$date_object = $this->store->get_date( $action[0] );
			$action_date = $date_object->format( 'Y-m-d H:i:s O' );
		} else {
			$action_date = '&ndash;';
		}

		return $action_date;
	}

	/**
	 * Get oldest or newest scheduled date for a given status.
	 *
	 * @param array $status_labels Set of statuses to find oldest & newest action for.
	 * @param array $action_counts Number of actions grouped by status.
	 * @param array $oldest_and_newest Date of the oldest and newest action with each status.
	 */
	protected function get_template( $status_labels, $action_counts, $oldest_and_newest ) {
		$as_version = ActionScheduler_Versions::instance()->latest_version();
		$as_datastore = get_class( ActionScheduler_Store::instance() );
		?>

		<table class="wc_status_table widefat" cellspacing="0">
			<thead>
				<tr>
					<th colspan="5" data-export-label="Action Scheduler"><h2><?php esc_html_e( 'Action Scheduler', 'woocommerce' ); ?><?php echo wc_help_tip( esc_html__( 'This section shows details of Action Scheduler.', 'woocommerce' ) ); ?></h2></th>
				</tr>
				<tr>
					<td colspan="2" data-export-label="Version"><?php esc_html_e( 'Version:', 'woocommerce' ); ?></td>
					<td colspan="3"><?php echo esc_html( $as_version ); ?></td>
				</tr>
				<tr>
					<td colspan="2" data-export-label="Data store"><?php esc_html_e( 'Data store:', 'woocommerce' ); ?></td>
					<td colspan="3"><?php echo esc_html( $as_datastore ); ?></td>
				</tr>
				<tr>
					<td><strong><?php esc_html_e( 'Action Status', 'woocommerce' ); ?></strong></td>
					<td class="help">&nbsp;</td>
					<td><strong><?php esc_html_e( 'Count', 'woocommerce' ); ?></strong></td>
					<td><strong><?php esc_html_e( 'Oldest Scheduled Date', 'woocommerce' ); ?></strong></td>
					<td><strong><?php esc_html_e( 'Newest Scheduled Date', 'woocommerce' ); ?></strong></td>
				</tr>
			</thead>
			<tbody>
				<?php
				foreach ( $action_counts as $status => $count ) {
					// WC uses the 3rd column for export, so we need to display more data in that (hidden when viewed as part of the table) and add an empty 2nd column.
					printf(
						'<tr><td>%1$s</td><td>&nbsp;</td><td>%2$s<span style="display: none;">, Oldest: %3$s, Newest: %4$s</span></td><td>%3$s</td><td>%4$s</td></tr>',
						esc_html( $status_labels[ $status ] ),
						number_format_i18n( $count ),
						$oldest_and_newest[ $status ]['oldest'],
						$oldest_and_newest[ $status ]['newest']
					);
				}
				?>
			</tbody>
		</table>

		<?php
	}

	/**
	 * is triggered when invoking inaccessible methods in an object context.
	 *
	 * @param string $name
	 * @param array  $arguments
	 *
	 * @return mixed
	 * @link https://php.net/manual/en/language.oop5.overloading.php#language.oop5.overloading.methods
	 */
	public function __call( $name, $arguments ) {
		switch ( $name ) {
			case 'print':
				_deprecated_function( __CLASS__ . '::print()', '2.2.4', __CLASS__ . '::render()' );
				return call_user_func_array( array( $this, 'render' ), $arguments );
		}

		return null;
	}
}
action-scheduler/classes/schema/ActionScheduler_LoggerSchema.php000064400000005464151335517650021123 0ustar00<?php

/**
 * Class ActionScheduler_LoggerSchema
 *
 * @codeCoverageIgnore
 *
 * Creates a custom table for storing action logs
 */
class ActionScheduler_LoggerSchema extends ActionScheduler_Abstract_Schema {
	const LOG_TABLE = 'actionscheduler_logs';

	/**
	 * @var int Increment this value to trigger a schema update.
	 */
	protected $schema_version = 3;

	public function __construct() {
		$this->tables = [
			self::LOG_TABLE,
		];
	}

	/**
	 * Performs additional setup work required to support this schema.
	 */
	public function init() {
		add_action( 'action_scheduler_before_schema_update', array( $this, 'update_schema_3_0' ), 10, 2 );
	}

	protected function get_table_definition( $table ) {
		global $wpdb;
		$table_name       = $wpdb->$table;
		$charset_collate  = $wpdb->get_charset_collate();
		switch ( $table ) {

			case self::LOG_TABLE:

				$default_date = ActionScheduler_StoreSchema::DEFAULT_DATE;
				return "CREATE TABLE {$table_name} (
				        log_id bigint(20) unsigned NOT NULL auto_increment,
				        action_id bigint(20) unsigned NOT NULL,
				        message text NOT NULL,
				        log_date_gmt datetime NULL default '${default_date}',
				        log_date_local datetime NULL default '${default_date}',
				        PRIMARY KEY  (log_id),
				        KEY action_id (action_id),
				        KEY log_date_gmt (log_date_gmt)
				        ) $charset_collate";

			default:
				return '';
		}
	}

	/**
	 * Update the logs table schema, allowing datetime fields to be NULL.
	 *
	 * This is needed because the NOT NULL constraint causes a conflict with some versions of MySQL
	 * configured with sql_mode=NO_ZERO_DATE, which can for instance lead to tables not being created.
	 *
	 * Most other schema updates happen via ActionScheduler_Abstract_Schema::update_table(), however
	 * that method relies on dbDelta() and this change is not possible when using that function.
	 *
	 * @param string $table Name of table being updated.
	 * @param string $db_version The existing schema version of the table.
	 */
	public function update_schema_3_0( $table, $db_version ) {
		global $wpdb;

		if ( 'actionscheduler_logs' !== $table || version_compare( $db_version, '3', '>=' ) ) {
			return;
		}

		// phpcs:disable WordPress.DB.PreparedSQL.InterpolatedNotPrepared
		$table_name   = $wpdb->prefix . 'actionscheduler_logs';
		$table_list   = $wpdb->get_col( "SHOW TABLES LIKE '${table_name}'" );
		$default_date = ActionScheduler_StoreSchema::DEFAULT_DATE;

		if ( ! empty( $table_list ) ) {
			$query = "
				ALTER TABLE ${table_name}
				MODIFY COLUMN log_date_gmt datetime NULL default '${default_date}',
				MODIFY COLUMN log_date_local datetime NULL default '${default_date}'
			";
			$wpdb->query( $query ); // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared
		}
		// phpcs:enable WordPress.DB.PreparedSQL.InterpolatedNotPrepared
	}
}
action-scheduler/classes/schema/ActionScheduler_StoreSchema.php000064400000011100151335517650020760 0ustar00<?php

/**
 * Class ActionScheduler_StoreSchema
 *
 * @codeCoverageIgnore
 *
 * Creates custom tables for storing scheduled actions
 */
class ActionScheduler_StoreSchema extends ActionScheduler_Abstract_Schema {
	const ACTIONS_TABLE = 'actionscheduler_actions';
	const CLAIMS_TABLE  = 'actionscheduler_claims';
	const GROUPS_TABLE  = 'actionscheduler_groups';
	const DEFAULT_DATE  = '0000-00-00 00:00:00';

	/**
	 * @var int Increment this value to trigger a schema update.
	 */
	protected $schema_version = 5;

	public function __construct() {
		$this->tables = [
			self::ACTIONS_TABLE,
			self::CLAIMS_TABLE,
			self::GROUPS_TABLE,
		];
	}

	/**
	 * Performs additional setup work required to support this schema.
	 */
	public function init() {
		add_action( 'action_scheduler_before_schema_update', array( $this, 'update_schema_5_0' ), 10, 2 );
	}

	protected function get_table_definition( $table ) {
		global $wpdb;
		$table_name       = $wpdb->$table;
		$charset_collate  = $wpdb->get_charset_collate();
		$max_index_length = 191; // @see wp_get_db_schema()
		$default_date     = self::DEFAULT_DATE;
		switch ( $table ) {

			case self::ACTIONS_TABLE:

				return "CREATE TABLE {$table_name} (
				        action_id bigint(20) unsigned NOT NULL auto_increment,
				        hook varchar(191) NOT NULL,
				        status varchar(20) NOT NULL,
				        scheduled_date_gmt datetime NULL default '${default_date}',
				        scheduled_date_local datetime NULL default '${default_date}',
				        args varchar($max_index_length),
				        schedule longtext,
				        group_id bigint(20) unsigned NOT NULL default '0',
				        attempts int(11) NOT NULL default '0',
				        last_attempt_gmt datetime NULL default '${default_date}',
				        last_attempt_local datetime NULL default '${default_date}',
				        claim_id bigint(20) unsigned NOT NULL default '0',
				        extended_args varchar(8000) DEFAULT NULL,
				        PRIMARY KEY  (action_id),
				        KEY hook (hook($max_index_length)),
				        KEY status (status),
				        KEY scheduled_date_gmt (scheduled_date_gmt),
				        KEY args (args($max_index_length)),
				        KEY group_id (group_id),
				        KEY last_attempt_gmt (last_attempt_gmt),
				        KEY claim_id (claim_id),
				        KEY `claim_id_status_scheduled_date_gmt` (`claim_id`, `status`, `scheduled_date_gmt`)
				        ) $charset_collate";

			case self::CLAIMS_TABLE:

				return "CREATE TABLE {$table_name} (
				        claim_id bigint(20) unsigned NOT NULL auto_increment,
				        date_created_gmt datetime NULL default '${default_date}',
				        PRIMARY KEY  (claim_id),
				        KEY date_created_gmt (date_created_gmt)
				        ) $charset_collate";

			case self::GROUPS_TABLE:

				return "CREATE TABLE {$table_name} (
				        group_id bigint(20) unsigned NOT NULL auto_increment,
				        slug varchar(255) NOT NULL,
				        PRIMARY KEY  (group_id),
				        KEY slug (slug($max_index_length))
				        ) $charset_collate";

			default:
				return '';
		}
	}

	/**
	 * Update the actions table schema, allowing datetime fields to be NULL.
	 *
	 * This is needed because the NOT NULL constraint causes a conflict with some versions of MySQL
	 * configured with sql_mode=NO_ZERO_DATE, which can for instance lead to tables not being created.
	 *
	 * Most other schema updates happen via ActionScheduler_Abstract_Schema::update_table(), however
	 * that method relies on dbDelta() and this change is not possible when using that function.
	 *
	 * @param string $table Name of table being updated.
	 * @param string $db_version The existing schema version of the table.
	 */
	public function update_schema_5_0( $table, $db_version ) {
		global $wpdb;

		if ( 'actionscheduler_actions' !== $table || version_compare( $db_version, '5', '>=' ) ) {
			return;
		}

		// phpcs:disable WordPress.DB.PreparedSQL.InterpolatedNotPrepared
		$table_name   = $wpdb->prefix . 'actionscheduler_actions';
		$table_list   = $wpdb->get_col( "SHOW TABLES LIKE '${table_name}'" );
		$default_date = self::DEFAULT_DATE;

		if ( ! empty( $table_list ) ) {
			$query = "
				ALTER TABLE ${table_name}
				MODIFY COLUMN scheduled_date_gmt datetime NULL default '${default_date}',
				MODIFY COLUMN scheduled_date_local datetime NULL default '${default_date}',
				MODIFY COLUMN last_attempt_gmt datetime NULL default '${default_date}',
				MODIFY COLUMN last_attempt_local datetime NULL default '${default_date}'
		";
			$wpdb->query( $query ); // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared
		}
		// phpcs:enable WordPress.DB.PreparedSQL.InterpolatedNotPrepared
	}
}
action-scheduler/classes/ActionScheduler_ActionFactory.php000064400000017411151335517650020063 0ustar00<?php

/**
 * Class ActionScheduler_ActionFactory
 */
class ActionScheduler_ActionFactory {

	/**
	 * @param string $status The action's status in the data store
	 * @param string $hook The hook to trigger when this action runs
	 * @param array $args Args to pass to callbacks when the hook is triggered
	 * @param ActionScheduler_Schedule $schedule The action's schedule
	 * @param string $group A group to put the action in
	 *
	 * @return ActionScheduler_Action An instance of the stored action
	 */
	public function get_stored_action( $status, $hook, array $args = array(), ActionScheduler_Schedule $schedule = null, $group = '' ) {

		switch ( $status ) {
			case ActionScheduler_Store::STATUS_PENDING :
				$action_class = 'ActionScheduler_Action';
				break;
			case ActionScheduler_Store::STATUS_CANCELED :
				$action_class = 'ActionScheduler_CanceledAction';
				if ( ! is_null( $schedule ) && ! is_a( $schedule, 'ActionScheduler_CanceledSchedule' ) && ! is_a( $schedule, 'ActionScheduler_NullSchedule' ) ) {
					$schedule = new ActionScheduler_CanceledSchedule( $schedule->get_date() );
				}
				break;
			default :
				$action_class = 'ActionScheduler_FinishedAction';
				break;
		}

		$action_class = apply_filters( 'action_scheduler_stored_action_class', $action_class, $status, $hook, $args, $schedule, $group );

		$action = new $action_class( $hook, $args, $schedule, $group );

		/**
		 * Allow 3rd party code to change the instantiated action for a given hook, args, schedule and group.
		 *
		 * @param ActionScheduler_Action $action The instantiated action.
		 * @param string $hook The instantiated action's hook.
		 * @param array $args The instantiated action's args.
		 * @param ActionScheduler_Schedule $schedule The instantiated action's schedule.
		 * @param string $group The instantiated action's group.
		 */
		return apply_filters( 'action_scheduler_stored_action_instance', $action, $hook, $args, $schedule, $group );
	}

	/**
	 * Enqueue an action to run one time, as soon as possible (rather a specific scheduled time).
	 *
	 * This method creates a new action with the NULLSchedule. This schedule maps to a MySQL datetime string of
	 * 0000-00-00 00:00:00. This is done to create a psuedo "async action" type that is fully backward compatible.
	 * Existing queries to claim actions claim by date, meaning actions scheduled for 0000-00-00 00:00:00 will
	 * always be claimed prior to actions scheduled for a specific date. This makes sure that any async action is
	 * given priority in queue processing. This has the added advantage of making sure async actions can be
	 * claimed by both the existing WP Cron and WP CLI runners, as well as a new async request runner.
	 *
	 * @param string $hook The hook to trigger when this action runs
	 * @param array $args Args to pass when the hook is triggered
	 * @param string $group A group to put the action in
	 *
	 * @return int The ID of the stored action
	 */
	public function async( $hook, $args = array(), $group = '' ) {
		$schedule = new ActionScheduler_NullSchedule();
		$action = new ActionScheduler_Action( $hook, $args, $schedule, $group );
		return $this->store( $action );
	}

	/**
	 * @param string $hook The hook to trigger when this action runs
	 * @param array $args Args to pass when the hook is triggered
	 * @param int $when Unix timestamp when the action will run
	 * @param string $group A group to put the action in
	 *
	 * @return int The ID of the stored action
	 */
	public function single( $hook, $args = array(), $when = null, $group = '' ) {
		$date = as_get_datetime_object( $when );
		$schedule = new ActionScheduler_SimpleSchedule( $date );
		$action = new ActionScheduler_Action( $hook, $args, $schedule, $group );
		return $this->store( $action );
	}

	/**
	 * Create the first instance of an action recurring on a given interval.
	 *
	 * @param string $hook The hook to trigger when this action runs
	 * @param array $args Args to pass when the hook is triggered
	 * @param int $first Unix timestamp for the first run
	 * @param int $interval Seconds between runs
	 * @param string $group A group to put the action in
	 *
	 * @return int The ID of the stored action
	 */
	public function recurring( $hook, $args = array(), $first = null, $interval = null, $group = '' ) {
		if ( empty($interval) ) {
			return $this->single( $hook, $args, $first, $group );
		}
		$date = as_get_datetime_object( $first );
		$schedule = new ActionScheduler_IntervalSchedule( $date, $interval );
		$action = new ActionScheduler_Action( $hook, $args, $schedule, $group );
		return $this->store( $action );
	}

	/**
	 * Create the first instance of an action recurring on a Cron schedule.
	 *
	 * @param string $hook The hook to trigger when this action runs
	 * @param array $args Args to pass when the hook is triggered
	 * @param int $base_timestamp The first instance of the action will be scheduled
	 *        to run at a time calculated after this timestamp matching the cron
	 *        expression. This can be used to delay the first instance of the action.
	 * @param int $schedule A cron definition string
	 * @param string $group A group to put the action in
	 *
	 * @return int The ID of the stored action
	 */
	public function cron( $hook, $args = array(), $base_timestamp = null, $schedule = null, $group = '' ) {
		if ( empty($schedule) ) {
			return $this->single( $hook, $args, $base_timestamp, $group );
		}
		$date = as_get_datetime_object( $base_timestamp );
		$cron = CronExpression::factory( $schedule );
		$schedule = new ActionScheduler_CronSchedule( $date, $cron );
		$action = new ActionScheduler_Action( $hook, $args, $schedule, $group );
		return $this->store( $action );
	}

	/**
	 * Create a successive instance of a recurring or cron action.
	 *
	 * Importantly, the action will be rescheduled to run based on the current date/time.
	 * That means when the action is scheduled to run in the past, the next scheduled date
	 * will be pushed forward. For example, if a recurring action set to run every hour
	 * was scheduled to run 5 seconds ago, it will be next scheduled for 1 hour in the
	 * future, which is 1 hour and 5 seconds from when it was last scheduled to run.
	 *
	 * Alternatively, if the action is scheduled to run in the future, and is run early,
	 * likely via manual intervention, then its schedule will change based on the time now.
	 * For example, if a recurring action set to run every day, and is run 12 hours early,
	 * it will run again in 24 hours, not 36 hours.
	 *
	 * This slippage is less of an issue with Cron actions, as the specific run time can
	 * be set for them to run, e.g. 1am each day. In those cases, and entire period would
	 * need to be missed before there was any change is scheduled, e.g. in the case of an
	 * action scheduled for 1am each day, the action would need to run an entire day late.
	 *
	 * @param ActionScheduler_Action $action The existing action.
	 *
	 * @return string The ID of the stored action
	 * @throws InvalidArgumentException If $action is not a recurring action.
	 */
	public function repeat( $action ) {
		$schedule = $action->get_schedule();
		$next     = $schedule->get_next( as_get_datetime_object() );

		if ( is_null( $next ) || ! $schedule->is_recurring() ) {
			throw new InvalidArgumentException( __( 'Invalid action - must be a recurring action.', 'woocommerce' ) );
		}

		$schedule_class = get_class( $schedule );
		$new_schedule = new $schedule( $next, $schedule->get_recurrence(), $schedule->get_first_date() );
		$new_action = new ActionScheduler_Action( $action->get_hook(), $action->get_args(), $new_schedule, $action->get_group() );
		return $this->store( $new_action );
	}

	/**
	 * @param ActionScheduler_Action $action
	 *
	 * @return int The ID of the stored action
	 */
	protected function store( ActionScheduler_Action $action ) {
		$store = ActionScheduler_Store::instance();
		return $store->save_action( $action );
	}
}
action-scheduler/classes/ActionScheduler_QueueRunner.php000064400000016560151335517650017600 0ustar00<?php

/**
 * Class ActionScheduler_QueueRunner
 */
class ActionScheduler_QueueRunner extends ActionScheduler_Abstract_QueueRunner {
	const WP_CRON_HOOK = 'action_scheduler_run_queue';

	const WP_CRON_SCHEDULE = 'every_minute';

	/** @var ActionScheduler_AsyncRequest_QueueRunner */
	protected $async_request;

	/** @var ActionScheduler_QueueRunner  */
	private static $runner = null;

	/**
	 * @return ActionScheduler_QueueRunner
	 * @codeCoverageIgnore
	 */
	public static function instance() {
		if ( empty(self::$runner) ) {
			$class = apply_filters('action_scheduler_queue_runner_class', 'ActionScheduler_QueueRunner');
			self::$runner = new $class();
		}
		return self::$runner;
	}

	/**
	 * ActionScheduler_QueueRunner constructor.
	 *
	 * @param ActionScheduler_Store             $store
	 * @param ActionScheduler_FatalErrorMonitor $monitor
	 * @param ActionScheduler_QueueCleaner      $cleaner
	 */
	public function __construct( ActionScheduler_Store $store = null, ActionScheduler_FatalErrorMonitor $monitor = null, ActionScheduler_QueueCleaner $cleaner = null, ActionScheduler_AsyncRequest_QueueRunner $async_request = null ) {
		parent::__construct( $store, $monitor, $cleaner );

		if ( is_null( $async_request ) ) {
			$async_request = new ActionScheduler_AsyncRequest_QueueRunner( $this->store );
		}

		$this->async_request = $async_request;
	}

	/**
	 * @codeCoverageIgnore
	 */
	public function init() {

		add_filter( 'cron_schedules', array( self::instance(), 'add_wp_cron_schedule' ) );

		// Check for and remove any WP Cron hook scheduled by Action Scheduler < 3.0.0, which didn't include the $context param
		$next_timestamp = wp_next_scheduled( self::WP_CRON_HOOK );
		if ( $next_timestamp ) {
			wp_unschedule_event( $next_timestamp, self::WP_CRON_HOOK );
		}

		$cron_context = array( 'WP Cron' );

		if ( ! wp_next_scheduled( self::WP_CRON_HOOK, $cron_context ) ) {
			$schedule = apply_filters( 'action_scheduler_run_schedule', self::WP_CRON_SCHEDULE );
			wp_schedule_event( time(), $schedule, self::WP_CRON_HOOK, $cron_context );
		}

		add_action( self::WP_CRON_HOOK, array( self::instance(), 'run' ) );
		$this->hook_dispatch_async_request();
	}

	/**
	 * Hook check for dispatching an async request.
	 */
	public function hook_dispatch_async_request() {
		add_action( 'shutdown', array( $this, 'maybe_dispatch_async_request' ) );
	}

	/**
	 * Unhook check for dispatching an async request.
	 */
	public function unhook_dispatch_async_request() {
		remove_action( 'shutdown', array( $this, 'maybe_dispatch_async_request' ) );
	}

	/**
	 * Check if we should dispatch an async request to process actions.
	 *
	 * This method is attached to 'shutdown', so is called frequently. To avoid slowing down
	 * the site, it mitigates the work performed in each request by:
	 * 1. checking if it's in the admin context and then
	 * 2. haven't run on the 'shutdown' hook within the lock time (60 seconds by default)
	 * 3. haven't exceeded the number of allowed batches.
	 *
	 * The order of these checks is important, because they run from a check on a value:
	 * 1. in memory - is_admin() maps to $GLOBALS or the WP_ADMIN constant
	 * 2. in memory - transients use autoloaded options by default
	 * 3. from a database query - has_maximum_concurrent_batches() run the query
	 *    $this->store->get_claim_count() to find the current number of claims in the DB.
	 *
	 * If all of these conditions are met, then we request an async runner check whether it
	 * should dispatch a request to process pending actions.
	 */
	public function maybe_dispatch_async_request() {
		if ( is_admin() && ! ActionScheduler::lock()->is_locked( 'async-request-runner' ) ) {
			// Only start an async queue at most once every 60 seconds
			ActionScheduler::lock()->set( 'async-request-runner' );
			$this->async_request->maybe_dispatch();
		}
	}

	/**
	 * Process actions in the queue. Attached to self::WP_CRON_HOOK i.e. 'action_scheduler_run_queue'
	 *
	 * The $context param of this method defaults to 'WP Cron', because prior to Action Scheduler 3.0.0
	 * that was the only context in which this method was run, and the self::WP_CRON_HOOK hook had no context
	 * passed along with it. New code calling this method directly, or by triggering the self::WP_CRON_HOOK,
	 * should set a context as the first parameter. For an example of this, refer to the code seen in
	 * @see ActionScheduler_AsyncRequest_QueueRunner::handle()
	 *
	 * @param string $context Optional identifer for the context in which this action is being processed, e.g. 'WP CLI' or 'WP Cron'
	 *        Generally, this should be capitalised and not localised as it's a proper noun.
	 * @return int The number of actions processed.
	 */
	public function run( $context = 'WP Cron' ) {
		ActionScheduler_Compatibility::raise_memory_limit();
		ActionScheduler_Compatibility::raise_time_limit( $this->get_time_limit() );
		do_action( 'action_scheduler_before_process_queue' );
		$this->run_cleanup();
		$processed_actions = 0;
		if ( false === $this->has_maximum_concurrent_batches() ) {
			$batch_size = apply_filters( 'action_scheduler_queue_runner_batch_size', 25 );
			do {
				$processed_actions_in_batch = $this->do_batch( $batch_size, $context );
				$processed_actions         += $processed_actions_in_batch;
			} while ( $processed_actions_in_batch > 0 && ! $this->batch_limits_exceeded( $processed_actions ) ); // keep going until we run out of actions, time, or memory
		}

		do_action( 'action_scheduler_after_process_queue' );
		return $processed_actions;
	}

	/**
	 * Process a batch of actions pending in the queue.
	 *
	 * Actions are processed by claiming a set of pending actions then processing each one until either the batch
	 * size is completed, or memory or time limits are reached, defined by @see $this->batch_limits_exceeded().
	 *
	 * @param int $size The maximum number of actions to process in the batch.
	 * @param string $context Optional identifer for the context in which this action is being processed, e.g. 'WP CLI' or 'WP Cron'
	 *        Generally, this should be capitalised and not localised as it's a proper noun.
	 * @return int The number of actions processed.
	 */
	protected function do_batch( $size = 100, $context = '' ) {
		$claim = $this->store->stake_claim($size);
		$this->monitor->attach($claim);
		$processed_actions = 0;

		foreach ( $claim->get_actions() as $action_id ) {
			// bail if we lost the claim
			if ( ! in_array( $action_id, $this->store->find_actions_by_claim_id( $claim->get_id() ) ) ) {
				break;
			}
			$this->process_action( $action_id, $context );
			$processed_actions++;

			if ( $this->batch_limits_exceeded( $processed_actions ) ) {
				break;
			}
		}
		$this->store->release_claim($claim);
		$this->monitor->detach();
		$this->clear_caches();
		return $processed_actions;
	}

	/**
	 * Running large batches can eat up memory, as WP adds data to its object cache.
	 *
	 * If using a persistent object store, this has the side effect of flushing that
	 * as well, so this is disabled by default. To enable:
	 *
	 * add_filter( 'action_scheduler_queue_runner_flush_cache', '__return_true' );
	 */
	protected function clear_caches() {
		if ( ! wp_using_ext_object_cache() || apply_filters( 'action_scheduler_queue_runner_flush_cache', false ) ) {
			wp_cache_flush();
		}
	}

	public function add_wp_cron_schedule( $schedules ) {
		$schedules['every_minute'] = array(
			'interval' => 60, // in seconds
			'display'  => __( 'Every minute', 'woocommerce' ),
		);

		return $schedules;
	}
}
action-scheduler/classes/ActionScheduler_QueueCleaner.php000064400000012170151335517650017671 0ustar00<?php

/**
 * Class ActionScheduler_QueueCleaner
 */
class ActionScheduler_QueueCleaner {

	/** @var int */
	protected $batch_size;

	/** @var ActionScheduler_Store */
	private $store = null;

	/**
	 * 31 days in seconds.
	 *
	 * @var int
	 */
	private $month_in_seconds = 2678400;

	/**
	 * ActionScheduler_QueueCleaner constructor.
	 *
	 * @param ActionScheduler_Store $store      The store instance.
	 * @param int                   $batch_size The batch size.
	 */
	public function __construct( ActionScheduler_Store $store = null, $batch_size = 20 ) {
		$this->store = $store ? $store : ActionScheduler_Store::instance();
		$this->batch_size = $batch_size;
	}

	public function delete_old_actions() {
		$lifespan = apply_filters( 'action_scheduler_retention_period', $this->month_in_seconds );
		$cutoff = as_get_datetime_object($lifespan.' seconds ago');

		$statuses_to_purge = array(
			ActionScheduler_Store::STATUS_COMPLETE,
			ActionScheduler_Store::STATUS_CANCELED,
		);

		foreach ( $statuses_to_purge as $status ) {
			$actions_to_delete = $this->store->query_actions( array(
				'status'           => $status,
				'modified'         => $cutoff,
				'modified_compare' => '<=',
				'per_page'         => $this->get_batch_size(),
				'orderby'          => 'none',
			) );

			foreach ( $actions_to_delete as $action_id ) {
				try {
					$this->store->delete_action( $action_id );
				} catch ( Exception $e ) {

					/**
					 * Notify 3rd party code of exceptions when deleting a completed action older than the retention period
					 *
					 * This hook provides a way for 3rd party code to log or otherwise handle exceptions relating to their
					 * actions.
					 *
					 * @since 2.0.0
					 *
					 * @param int $action_id The scheduled actions ID in the data store
					 * @param Exception $e The exception thrown when attempting to delete the action from the data store
					 * @param int $lifespan The retention period, in seconds, for old actions
					 * @param int $count_of_actions_to_delete The number of old actions being deleted in this batch
					 */
					do_action( 'action_scheduler_failed_old_action_deletion', $action_id, $e, $lifespan, count( $actions_to_delete ) );
				}
			}
		}
	}

	/**
	 * Unclaim pending actions that have not been run within a given time limit.
	 *
	 * When called by ActionScheduler_Abstract_QueueRunner::run_cleanup(), the time limit passed
	 * as a parameter is 10x the time limit used for queue processing.
	 *
	 * @param int $time_limit The number of seconds to allow a queue to run before unclaiming its pending actions. Default 300 (5 minutes).
	 */
	public function reset_timeouts( $time_limit = 300 ) {
		$timeout = apply_filters( 'action_scheduler_timeout_period', $time_limit );
		if ( $timeout < 0 ) {
			return;
		}
		$cutoff = as_get_datetime_object($timeout.' seconds ago');
		$actions_to_reset = $this->store->query_actions( array(
			'status'           => ActionScheduler_Store::STATUS_PENDING,
			'modified'         => $cutoff,
			'modified_compare' => '<=',
			'claimed'          => true,
			'per_page'         => $this->get_batch_size(),
			'orderby'          => 'none',
		) );

		foreach ( $actions_to_reset as $action_id ) {
			$this->store->unclaim_action( $action_id );
			do_action( 'action_scheduler_reset_action', $action_id );
		}
	}

	/**
	 * Mark actions that have been running for more than a given time limit as failed, based on
	 * the assumption some uncatachable and unloggable fatal error occurred during processing.
	 *
	 * When called by ActionScheduler_Abstract_QueueRunner::run_cleanup(), the time limit passed
	 * as a parameter is 10x the time limit used for queue processing.
	 *
	 * @param int $time_limit The number of seconds to allow an action to run before it is considered to have failed. Default 300 (5 minutes).
	 */
	public function mark_failures( $time_limit = 300 ) {
		$timeout = apply_filters( 'action_scheduler_failure_period', $time_limit );
		if ( $timeout < 0 ) {
			return;
		}
		$cutoff = as_get_datetime_object($timeout.' seconds ago');
		$actions_to_reset = $this->store->query_actions( array(
			'status'           => ActionScheduler_Store::STATUS_RUNNING,
			'modified'         => $cutoff,
			'modified_compare' => '<=',
			'per_page'         => $this->get_batch_size(),
			'orderby'          => 'none',
		) );

		foreach ( $actions_to_reset as $action_id ) {
			$this->store->mark_failure( $action_id );
			do_action( 'action_scheduler_failed_action', $action_id, $timeout );
		}
	}

	/**
	 * Do all of the cleaning actions.
	 *
	 * @param int $time_limit The number of seconds to use as the timeout and failure period. Default 300 (5 minutes).
	 * @author Jeremy Pry
	 */
	public function clean( $time_limit = 300 ) {
		$this->delete_old_actions();
		$this->reset_timeouts( $time_limit );
		$this->mark_failures( $time_limit );
	}

	/**
	 * Get the batch size for cleaning the queue.
	 *
	 * @author Jeremy Pry
	 * @return int
	 */
	protected function get_batch_size() {
		/**
		 * Filter the batch size when cleaning the queue.
		 *
		 * @param int $batch_size The number of actions to clean in one batch.
		 */
		return absint( apply_filters( 'action_scheduler_cleanup_batch_size', $this->batch_size ) );
	}
}
action-scheduler/classes/WP_CLI/ActionScheduler_WPCLI_QueueRunner.php000064400000014175151335517650021553 0ustar00<?php

use Action_Scheduler\WP_CLI\ProgressBar;

/**
 * WP CLI Queue runner.
 *
 * This class can only be called from within a WP CLI instance.
 */
class ActionScheduler_WPCLI_QueueRunner extends ActionScheduler_Abstract_QueueRunner {

	/** @var array */
	protected $actions;

	/** @var  ActionScheduler_ActionClaim */
	protected $claim;

	/** @var \cli\progress\Bar */
	protected $progress_bar;

	/**
	 * ActionScheduler_WPCLI_QueueRunner constructor.
	 *
	 * @param ActionScheduler_Store             $store
	 * @param ActionScheduler_FatalErrorMonitor $monitor
	 * @param ActionScheduler_QueueCleaner      $cleaner
	 *
	 * @throws Exception When this is not run within WP CLI
	 */
	public function __construct( ActionScheduler_Store $store = null, ActionScheduler_FatalErrorMonitor $monitor = null, ActionScheduler_QueueCleaner $cleaner = null ) {
		if ( ! ( defined( 'WP_CLI' ) && WP_CLI ) ) {
			/* translators: %s php class name */
			throw new Exception( sprintf( __( 'The %s class can only be run within WP CLI.', 'woocommerce' ), __CLASS__ ) );
		}

		parent::__construct( $store, $monitor, $cleaner );
	}

	/**
	 * Set up the Queue before processing.
	 *
	 * @author Jeremy Pry
	 *
	 * @param int    $batch_size The batch size to process.
	 * @param array  $hooks      The hooks being used to filter the actions claimed in this batch.
	 * @param string $group      The group of actions to claim with this batch.
	 * @param bool   $force      Whether to force running even with too many concurrent processes.
	 *
	 * @return int The number of actions that will be run.
	 * @throws \WP_CLI\ExitException When there are too many concurrent batches.
	 */
	public function setup( $batch_size, $hooks = array(), $group = '', $force = false ) {
		$this->run_cleanup();
		$this->add_hooks();

		// Check to make sure there aren't too many concurrent processes running.
		if ( $this->has_maximum_concurrent_batches() ) {
			if ( $force ) {
				WP_CLI::warning( __( 'There are too many concurrent batches, but the run is forced to continue.', 'woocommerce' ) );
			} else {
				WP_CLI::error( __( 'There are too many concurrent batches.', 'woocommerce' ) );
			}
		}

		// Stake a claim and store it.
		$this->claim = $this->store->stake_claim( $batch_size, null, $hooks, $group );
		$this->monitor->attach( $this->claim );
		$this->actions = $this->claim->get_actions();

		return count( $this->actions );
	}

	/**
	 * Add our hooks to the appropriate actions.
	 *
	 * @author Jeremy Pry
	 */
	protected function add_hooks() {
		add_action( 'action_scheduler_before_execute', array( $this, 'before_execute' ) );
		add_action( 'action_scheduler_after_execute', array( $this, 'after_execute' ), 10, 2 );
		add_action( 'action_scheduler_failed_execution', array( $this, 'action_failed' ), 10, 2 );
	}

	/**
	 * Set up the WP CLI progress bar.
	 *
	 * @author Jeremy Pry
	 */
	protected function setup_progress_bar() {
		$count              = count( $this->actions );
		$this->progress_bar = new ProgressBar(
			/* translators: %d: amount of actions */
			sprintf( _n( 'Running %d action', 'Running %d actions', $count, 'woocommerce' ), number_format_i18n( $count ) ),
			$count
		);
	}

	/**
	 * Process actions in the queue.
	 *
	 * @author Jeremy Pry
	 *
	 * @param string $context Optional runner context. Default 'WP CLI'.
	 *
	 * @return int The number of actions processed.
	 */
	public function run( $context = 'WP CLI' ) {
		do_action( 'action_scheduler_before_process_queue' );
		$this->setup_progress_bar();
		foreach ( $this->actions as $action_id ) {
			// Error if we lost the claim.
			if ( ! in_array( $action_id, $this->store->find_actions_by_claim_id( $this->claim->get_id() ) ) ) {
				WP_CLI::warning( __( 'The claim has been lost. Aborting current batch.', 'woocommerce' ) );
				break;
			}

			$this->process_action( $action_id, $context );
			$this->progress_bar->tick();
		}

		$completed = $this->progress_bar->current();
		$this->progress_bar->finish();
		$this->store->release_claim( $this->claim );
		do_action( 'action_scheduler_after_process_queue' );

		return $completed;
	}

	/**
	 * Handle WP CLI message when the action is starting.
	 *
	 * @author Jeremy Pry
	 *
	 * @param $action_id
	 */
	public function before_execute( $action_id ) {
		/* translators: %s refers to the action ID */
		WP_CLI::log( sprintf( __( 'Started processing action %s', 'woocommerce' ), $action_id ) );
	}

	/**
	 * Handle WP CLI message when the action has completed.
	 *
	 * @author Jeremy Pry
	 *
	 * @param int $action_id
	 * @param null|ActionScheduler_Action $action The instance of the action. Default to null for backward compatibility.
	 */
	public function after_execute( $action_id, $action = null ) {
		// backward compatibility
		if ( null === $action ) {
			$action = $this->store->fetch_action( $action_id );
		}
		/* translators: 1: action ID 2: hook name */
		WP_CLI::log( sprintf( __( 'Completed processing action %1$s with hook: %2$s', 'woocommerce' ), $action_id, $action->get_hook() ) );
	}

	/**
	 * Handle WP CLI message when the action has failed.
	 *
	 * @author Jeremy Pry
	 *
	 * @param int       $action_id
	 * @param Exception $exception
	 * @throws \WP_CLI\ExitException With failure message.
	 */
	public function action_failed( $action_id, $exception ) {
		WP_CLI::error(
			/* translators: 1: action ID 2: exception message */
			sprintf( __( 'Error processing action %1$s: %2$s', 'woocommerce' ), $action_id, $exception->getMessage() ),
			false
		);
	}

	/**
	 * Sleep and help avoid hitting memory limit
	 *
	 * @param int $sleep_time Amount of seconds to sleep
	 * @deprecated 3.0.0
	 */
	protected function stop_the_insanity( $sleep_time = 0 ) {
		_deprecated_function( 'ActionScheduler_WPCLI_QueueRunner::stop_the_insanity', '3.0.0', 'ActionScheduler_DataController::free_memory' );

		ActionScheduler_DataController::free_memory();
	}

	/**
	 * Maybe trigger the stop_the_insanity() method to free up memory.
	 */
	protected function maybe_stop_the_insanity() {
		// The value returned by progress_bar->current() might be padded. Remove padding, and convert to int.
		$current_iteration = intval( trim( $this->progress_bar->current() ) );
		if ( 0 === $current_iteration % 50 ) {
			$this->stop_the_insanity();
		}
	}
}
action-scheduler/classes/WP_CLI/ProgressBar.php000064400000004713151335517650015431 0ustar00<?php

namespace Action_Scheduler\WP_CLI;

/**
 * WP_CLI progress bar for Action Scheduler.
 */

/**
 * Class ProgressBar
 *
 * @package Action_Scheduler\WP_CLI
 *
 * @since 3.0.0
 *
 * @codeCoverageIgnore
 */
class ProgressBar {

	/** @var integer */
	protected $total_ticks;

	/** @var integer */
	protected $count;

	/** @var integer */
	protected $interval;

	/** @var string */
	protected $message;

	/** @var \cli\progress\Bar */
	protected $progress_bar;

	/**
	 * ProgressBar constructor.
	 *
	 * @param string  $message    Text to display before the progress bar.
	 * @param integer $count      Total number of ticks to be performed.
	 * @param integer $interval   Optional. The interval in milliseconds between updates. Default 100.
 	 *
	 * @throws Exception When this is not run within WP CLI
	 */
	public function __construct( $message, $count, $interval = 100 ) {
		if ( ! ( defined( 'WP_CLI' ) && WP_CLI ) ) {
			/* translators: %s php class name */
			throw new \Exception( sprintf( __( 'The %s class can only be run within WP CLI.', 'woocommerce' ), __CLASS__ ) );
		}

		$this->total_ticks = 0;
		$this->message     = $message;
		$this->count       = $count;
		$this->interval    = $interval;
	}

	/**
	 * Increment the progress bar ticks.
	 */
	public function tick() {
		if ( null === $this->progress_bar ) {
			$this->setup_progress_bar();
		}

		$this->progress_bar->tick();
		$this->total_ticks++;

		do_action( 'action_scheduler/progress_tick', $this->total_ticks );
	}

	/**
	 * Get the progress bar tick count.
	 *
	 * @return int
	 */
	public function current() {
		return $this->progress_bar ? $this->progress_bar->current() : 0;
	}

	/**
	 * Finish the current progress bar.
	 */
	public function finish() {
		if ( null !== $this->progress_bar ) {
			$this->progress_bar->finish();
		}

		$this->progress_bar = null;
	}

	/**
	 * Set the message used when creating the progress bar.
	 *
	 * @param string $message The message to be used when the next progress bar is created.
	 */
	public function set_message( $message ) {
		$this->message = $message;
	}

	/**
	 * Set the count for a new progress bar.
	 *
	 * @param integer $count The total number of ticks expected to complete.
	 */
	public function set_count( $count ) {
		$this->count = $count;
		$this->finish();
	}

	/**
	 * Set up the progress bar.
	 */
	protected function setup_progress_bar() {
		$this->progress_bar = \WP_CLI\Utils\make_progress_bar(
			$this->message,
			$this->count,
			$this->interval
		);
	}
}
action-scheduler/classes/WP_CLI/Migration_Command.php000064400000011304151335517650016561 0ustar00<?php


namespace Action_Scheduler\WP_CLI;

use Action_Scheduler\Migration\Config;
use Action_Scheduler\Migration\Runner;
use Action_Scheduler\Migration\Scheduler;
use Action_Scheduler\Migration\Controller;
use WP_CLI;
use WP_CLI_Command;

/**
 * Class Migration_Command
 *
 * @package Action_Scheduler\WP_CLI
 *
 * @since 3.0.0
 *
 * @codeCoverageIgnore
 */
class Migration_Command extends WP_CLI_Command {

	/** @var int */
	private $total_processed = 0;

	/**
	 * Register the command with WP-CLI
	 */
	public function register() {
		if ( ! defined( 'WP_CLI' ) || ! WP_CLI ) {
			return;
		}

		WP_CLI::add_command( 'action-scheduler migrate', [ $this, 'migrate' ], [
			'shortdesc' => 'Migrates actions to the DB tables store',
			'synopsis'  => [
				[
					'type'        => 'assoc',
					'name'        => 'batch-size',
					'optional'    => true,
					'default'     => 100,
					'description' => 'The number of actions to process in each batch',
				],
				[
					'type'        => 'assoc',
					'name'        => 'free-memory-on',
					'optional'    => true,
					'default'     => 50,
					'description' => 'The number of actions to process between freeing memory. 0 disables freeing memory',
				],
				[
					'type'        => 'assoc',
					'name'        => 'pause',
					'optional'    => true,
					'default'     => 0,
					'description' => 'The number of seconds to pause when freeing memory',
				],
				[
					'type'        => 'flag',
					'name'        => 'dry-run',
					'optional'    => true,
					'description' => 'Reports on the actions that would have been migrated, but does not change any data',
				],
			],
		] );
	}

	/**
	 * Process the data migration.
	 *
	 * @param array $positional_args Required for WP CLI. Not used in migration.
	 * @param array $assoc_args Optional arguments.
	 *
	 * @return void
	 */
	public function migrate( $positional_args, $assoc_args ) {
		$this->init_logging();

		$config = $this->get_migration_config( $assoc_args );
		$runner = new Runner( $config );
		$runner->init_destination();

		$batch_size = isset( $assoc_args[ 'batch-size' ] ) ? (int) $assoc_args[ 'batch-size' ] : 100;
		$free_on    = isset( $assoc_args[ 'free-memory-on' ] ) ? (int) $assoc_args[ 'free-memory-on' ] : 50;
		$sleep      = isset( $assoc_args[ 'pause' ] ) ? (int) $assoc_args[ 'pause' ] : 0;
		\ActionScheduler_DataController::set_free_ticks( $free_on );
		\ActionScheduler_DataController::set_sleep_time( $sleep );

		do {
			$actions_processed     = $runner->run( $batch_size );
			$this->total_processed += $actions_processed;
		} while ( $actions_processed > 0 );

		if ( ! $config->get_dry_run() ) {
			// let the scheduler know that there's nothing left to do
			$scheduler = new Scheduler();
			$scheduler->mark_complete();
		}

		WP_CLI::success( sprintf( '%s complete. %d actions processed.', $config->get_dry_run() ? 'Dry run' : 'Migration', $this->total_processed ) );
	}

	/**
	 * Build the config object used to create the Runner
	 *
	 * @param array $args Optional arguments.
	 *
	 * @return ActionScheduler\Migration\Config
	 */
	private function get_migration_config( $args ) {
		$args = wp_parse_args( $args, [
			'dry-run' => false,
		] );

		$config = Controller::instance()->get_migration_config_object();
		$config->set_dry_run( ! empty( $args[ 'dry-run' ] ) );

		return $config;
	}

	/**
	 * Hook command line logging into migration actions.
	 */
	private function init_logging() {
		add_action( 'action_scheduler/migrate_action_dry_run', function ( $action_id ) {
			WP_CLI::debug( sprintf( 'Dry-run: migrated action %d', $action_id ) );
		}, 10, 1 );
		add_action( 'action_scheduler/no_action_to_migrate', function ( $action_id ) {
			WP_CLI::debug( sprintf( 'No action found to migrate for ID %d', $action_id ) );
		}, 10, 1 );
		add_action( 'action_scheduler/migrate_action_failed', function ( $action_id ) {
			WP_CLI::warning( sprintf( 'Failed migrating action with ID %d', $action_id ) );
		}, 10, 1 );
		add_action( 'action_scheduler/migrate_action_incomplete', function ( $source_id, $destination_id ) {
			WP_CLI::warning( sprintf( 'Unable to remove source action with ID %d after migrating to new ID %d', $source_id, $destination_id ) );
		}, 10, 2 );
		add_action( 'action_scheduler/migrated_action', function ( $source_id, $destination_id ) {
			WP_CLI::debug( sprintf( 'Migrated source action with ID %d to new store with ID %d', $source_id, $destination_id ) );
		}, 10, 2 );
		add_action( 'action_scheduler/migration_batch_starting', function ( $batch ) {
			WP_CLI::debug( 'Beginning migration of batch: ' . print_r( $batch, true ) );
		}, 10, 1 );
		add_action( 'action_scheduler/migration_batch_complete', function ( $batch ) {
			WP_CLI::log( sprintf( 'Completed migration of %d actions', count( $batch ) ) );
		}, 10, 1 );
	}
}
action-scheduler/classes/WP_CLI/ActionScheduler_WPCLI_Scheduler_command.php000064400000011763151335517650022711 0ustar00<?php

/**
 * Commands for Action Scheduler.
 */
class ActionScheduler_WPCLI_Scheduler_command extends WP_CLI_Command {

	/**
	 * Run the Action Scheduler
	 *
	 * ## OPTIONS
	 *
	 * [--batch-size=<size>]
	 * : The maximum number of actions to run. Defaults to 100.
	 *
	 * [--batches=<size>]
	 * : Limit execution to a number of batches. Defaults to 0, meaning batches will continue being executed until all actions are complete.
	 *
	 * [--cleanup-batch-size=<size>]
	 * : The maximum number of actions to clean up. Defaults to the value of --batch-size.
	 *
	 * [--hooks=<hooks>]
	 * : Only run actions with the specified hook. Omitting this option runs actions with any hook. Define multiple hooks as a comma separated string (without spaces), e.g. `--hooks=hook_one,hook_two,hook_three`
	 *
	 * [--group=<group>]
	 * : Only run actions from the specified group. Omitting this option runs actions from all groups.
	 *
	 * [--free-memory-on=<count>]
	 * : The number of actions to process between freeing memory. 0 disables freeing memory. Default 50.
	 *
	 * [--pause=<seconds>]
	 * : The number of seconds to pause when freeing memory. Default no pause.
	 *
	 * [--force]
	 * : Whether to force execution despite the maximum number of concurrent processes being exceeded.
	 *
	 * @param array $args Positional arguments.
	 * @param array $assoc_args Keyed arguments.
	 * @throws \WP_CLI\ExitException When an error occurs.
	 *
	 * @subcommand run
	 */
	public function run( $args, $assoc_args ) {
		// Handle passed arguments.
		$batch   = absint( \WP_CLI\Utils\get_flag_value( $assoc_args, 'batch-size', 100 ) );
		$batches = absint( \WP_CLI\Utils\get_flag_value( $assoc_args, 'batches', 0 ) );
		$clean   = absint( \WP_CLI\Utils\get_flag_value( $assoc_args, 'cleanup-batch-size', $batch ) );
		$hooks   = explode( ',', WP_CLI\Utils\get_flag_value( $assoc_args, 'hooks', '' ) );
		$hooks   = array_filter( array_map( 'trim', $hooks ) );
		$group   = \WP_CLI\Utils\get_flag_value( $assoc_args, 'group', '' );
		$free_on = \WP_CLI\Utils\get_flag_value( $assoc_args, 'free-memory-on', 50 );
		$sleep   = \WP_CLI\Utils\get_flag_value( $assoc_args, 'pause', 0 );
		$force   = \WP_CLI\Utils\get_flag_value( $assoc_args, 'force', false );

		ActionScheduler_DataController::set_free_ticks( $free_on );
		ActionScheduler_DataController::set_sleep_time( $sleep );

		$batches_completed = 0;
		$actions_completed = 0;
		$unlimited         = $batches === 0;

		try {
			// Custom queue cleaner instance.
			$cleaner = new ActionScheduler_QueueCleaner( null, $clean );

			// Get the queue runner instance
			$runner = new ActionScheduler_WPCLI_QueueRunner( null, null, $cleaner );

			// Determine how many tasks will be run in the first batch.
			$total = $runner->setup( $batch, $hooks, $group, $force );

			// Run actions for as long as possible.
			while ( $total > 0 ) {
				$this->print_total_actions( $total );
				$actions_completed += $runner->run();
				$batches_completed++;

				// Maybe set up tasks for the next batch.
				$total = ( $unlimited || $batches_completed < $batches ) ? $runner->setup( $batch, $hooks, $group, $force ) : 0;
			}
		} catch ( Exception $e ) {
			$this->print_error( $e );
		}

		$this->print_total_batches( $batches_completed );
		$this->print_success( $actions_completed );
	}

	/**
	 * Print WP CLI message about how many actions are about to be processed.
	 *
	 * @author Jeremy Pry
	 *
	 * @param int $total
	 */
	protected function print_total_actions( $total ) {
		WP_CLI::log(
			sprintf(
				/* translators: %d refers to how many scheduled taks were found to run */
				_n( 'Found %d scheduled task', 'Found %d scheduled tasks', $total, 'woocommerce' ),
				number_format_i18n( $total )
			)
		);
	}

	/**
	 * Print WP CLI message about how many batches of actions were processed.
	 *
	 * @author Jeremy Pry
	 *
	 * @param int $batches_completed
	 */
	protected function print_total_batches( $batches_completed ) {
		WP_CLI::log(
			sprintf(
				/* translators: %d refers to the total number of batches executed */
				_n( '%d batch executed.', '%d batches executed.', $batches_completed, 'woocommerce' ),
				number_format_i18n( $batches_completed )
			)
		);
	}

	/**
	 * Convert an exception into a WP CLI error.
	 *
	 * @author Jeremy Pry
	 *
	 * @param Exception $e The error object.
	 *
	 * @throws \WP_CLI\ExitException
	 */
	protected function print_error( Exception $e ) {
		WP_CLI::error(
			sprintf(
				/* translators: %s refers to the exception error message */
				__( 'There was an error running the action scheduler: %s', 'woocommerce' ),
				$e->getMessage()
			)
		);
	}

	/**
	 * Print a success message with the number of completed actions.
	 *
	 * @author Jeremy Pry
	 *
	 * @param int $actions_completed
	 */
	protected function print_success( $actions_completed ) {
		WP_CLI::success(
			sprintf(
				/* translators: %d refers to the total number of taskes completed */
				_n( '%d scheduled task completed.', '%d scheduled tasks completed.', $actions_completed, 'woocommerce' ),
				number_format_i18n( $actions_completed )
			)
		);
	}
}
action-scheduler/classes/ActionScheduler_NullLogEntry.php000064400000000333151335517650017707 0ustar00<?php

/**
 * Class ActionScheduler_NullLogEntry
 */
class ActionScheduler_NullLogEntry extends ActionScheduler_LogEntry {
	public function __construct( $action_id = '', $message = '' ) {
		// nothing to see here
	}
}
 action-scheduler/classes/actions/ActionScheduler_NullAction.php000064400000000534151335517650021024 0ustar00<?php

/**
 * Class ActionScheduler_NullAction
 */
class ActionScheduler_NullAction extends ActionScheduler_Action {

	public function __construct( $hook = '', array $args = array(), ActionScheduler_Schedule $schedule = NULL ) {
		$this->set_schedule( new ActionScheduler_NullSchedule() );
	}

	public function execute() {
		// don't execute
	}
}
 action-scheduler/classes/actions/ActionScheduler_Action.php000064400000002677151335517650020203 0ustar00<?php

/**
 * Class ActionScheduler_Action
 */
class ActionScheduler_Action {
	protected $hook = '';
	protected $args = array();
	/** @var ActionScheduler_Schedule */
	protected $schedule = NULL;
	protected $group = '';

	public function __construct( $hook, array $args = array(), ActionScheduler_Schedule $schedule = NULL, $group = '' ) {
		$schedule = empty( $schedule ) ? new ActionScheduler_NullSchedule() : $schedule;
		$this->set_hook($hook);
		$this->set_schedule($schedule);
		$this->set_args($args);
		$this->set_group($group);
	}

	public function execute() {
		return do_action_ref_array( $this->get_hook(), array_values( $this->get_args() ) );
	}

	/**
	 * @param string $hook
	 */
	protected function set_hook( $hook ) {
		$this->hook = $hook;
	}

	public function get_hook() {
		return $this->hook;
	}

	protected function set_schedule( ActionScheduler_Schedule $schedule ) {
		$this->schedule = $schedule;
	}

	/**
	 * @return ActionScheduler_Schedule
	 */
	public function get_schedule() {
		return $this->schedule;
	}

	protected function set_args( array $args ) {
		$this->args = $args;
	}

	public function get_args() {
		return $this->args;
	}

	/**
	 * @param string $group
	 */
	protected function set_group( $group ) {
		$this->group = $group;
	}

	/**
	 * @return string
	 */
	public function get_group() {
		return $this->group;
	}

	/**
	 * @return bool If the action has been finished
	 */
	public function is_finished() {
		return FALSE;
	}
}
action-scheduler/classes/actions/ActionScheduler_CanceledAction.php000064400000001316151335517650021607 0ustar00<?php

/**
 * Class ActionScheduler_CanceledAction
 *
 * Stored action which was canceled and therefore acts like a finished action but should always return a null schedule,
 * regardless of schedule passed to its constructor.
 */
class ActionScheduler_CanceledAction extends ActionScheduler_FinishedAction {

	/**
	 * @param string $hook
	 * @param array $args
	 * @param ActionScheduler_Schedule $schedule
	 * @param string $group
	 */
	public function __construct( $hook, array $args = array(), ActionScheduler_Schedule $schedule = null, $group = '' ) {
		parent::__construct( $hook, $args, $schedule, $group );
		if ( is_null( $schedule ) ) {
			$this->set_schedule( new ActionScheduler_NullSchedule() );
		}
	}
}
action-scheduler/classes/actions/ActionScheduler_FinishedAction.php000064400000000350151335517650021637 0ustar00<?php

/**
 * Class ActionScheduler_FinishedAction
 */
class ActionScheduler_FinishedAction extends ActionScheduler_Action {

	public function execute() {
		// don't execute
	}

	public function is_finished() {
		return TRUE;
	}
}
 action-scheduler/classes/data-stores/ActionScheduler_wpPostStore_PostStatusRegistrar.php000064400000003421151335517650026145 0ustar00<?php

/**
 * Class ActionScheduler_wpPostStore_PostStatusRegistrar
 * @codeCoverageIgnore
 */
class ActionScheduler_wpPostStore_PostStatusRegistrar {
	public function register() {
		register_post_status( ActionScheduler_Store::STATUS_RUNNING, array_merge( $this->post_status_args(), $this->post_status_running_labels() ) );
		register_post_status( ActionScheduler_Store::STATUS_FAILED, array_merge( $this->post_status_args(), $this->post_status_failed_labels() ) );
	}

	/**
	 * Build the args array for the post type definition
	 *
	 * @return array
	 */
	protected function post_status_args() {
		$args = array(
			'public'                    => false,
			'exclude_from_search'       => false,
			'show_in_admin_all_list'    => true,
			'show_in_admin_status_list' => true,
		);

		return apply_filters( 'action_scheduler_post_status_args', $args );
	}

	/**
	 * Build the args array for the post type definition
	 *
	 * @return array
	 */
	protected function post_status_failed_labels() {
		$labels = array(
			'label'       => _x( 'Failed', 'post', 'woocommerce' ),
			/* translators: %s: count */
			'label_count' => _n_noop( 'Failed <span class="count">(%s)</span>', 'Failed <span class="count">(%s)</span>', 'woocommerce' ),
		);

		return apply_filters( 'action_scheduler_post_status_failed_labels', $labels );
	}

	/**
	 * Build the args array for the post type definition
	 *
	 * @return array
	 */
	protected function post_status_running_labels() {
		$labels = array(
			'label'       => _x( 'In-Progress', 'post', 'woocommerce' ),
			/* translators: %s: count */
			'label_count' => _n_noop( 'In-Progress <span class="count">(%s)</span>', 'In-Progress <span class="count">(%s)</span>', 'woocommerce' ),
		);

		return apply_filters( 'action_scheduler_post_status_running_labels', $labels );
	}
}
action-scheduler/classes/data-stores/ActionScheduler_wpCommentLogger.php000064400000015233151335517650022655 0ustar00<?php

/**
 * Class ActionScheduler_wpCommentLogger
 */
class ActionScheduler_wpCommentLogger extends ActionScheduler_Logger {
	const AGENT = 'ActionScheduler';
	const TYPE = 'action_log';

	/**
	 * @param string $action_id
	 * @param string $message
	 * @param DateTime $date
	 *
	 * @return string The log entry ID
	 */
	public function log( $action_id, $message, DateTime $date = NULL ) {
		if ( empty($date) ) {
			$date = as_get_datetime_object();
		} else {
			$date = as_get_datetime_object( clone $date );
		}
		$comment_id = $this->create_wp_comment( $action_id, $message, $date );
		return $comment_id;
	}

	protected function create_wp_comment( $action_id, $message, DateTime $date ) {

		$comment_date_gmt = $date->format('Y-m-d H:i:s');
		ActionScheduler_TimezoneHelper::set_local_timezone( $date );
		$comment_data = array(
			'comment_post_ID' => $action_id,
			'comment_date' => $date->format('Y-m-d H:i:s'),
			'comment_date_gmt' => $comment_date_gmt,
			'comment_author' => self::AGENT,
			'comment_content' => $message,
			'comment_agent' => self::AGENT,
			'comment_type' => self::TYPE,
		);
		return wp_insert_comment($comment_data);
	}

	/**
	 * @param string $entry_id
	 *
	 * @return ActionScheduler_LogEntry
	 */
	public function get_entry( $entry_id ) {
		$comment = $this->get_comment( $entry_id );
		if ( empty($comment) || $comment->comment_type != self::TYPE ) {
			return new ActionScheduler_NullLogEntry();
		}

		$date = as_get_datetime_object( $comment->comment_date_gmt );
		ActionScheduler_TimezoneHelper::set_local_timezone( $date );
		return new ActionScheduler_LogEntry( $comment->comment_post_ID, $comment->comment_content, $date );
	}

	/**
	 * @param string $action_id
	 *
	 * @return ActionScheduler_LogEntry[]
	 */
	public function get_logs( $action_id ) {
		$status = 'all';
		if ( get_post_status($action_id) == 'trash' ) {
			$status = 'post-trashed';
		}
		$comments = get_comments(array(
			'post_id' => $action_id,
			'orderby' => 'comment_date_gmt',
			'order' => 'ASC',
			'type' => self::TYPE,
			'status' => $status,
		));
		$logs = array();
		foreach ( $comments as $c ) {
			$entry = $this->get_entry( $c );
			if ( !empty($entry) ) {
				$logs[] = $entry;
			}
		}
		return $logs;
	}

	protected function get_comment( $comment_id ) {
		return get_comment( $comment_id );
	}



	/**
	 * @param WP_Comment_Query $query
	 */
	public function filter_comment_queries( $query ) {
		foreach ( array('ID', 'parent', 'post_author', 'post_name', 'post_parent', 'type', 'post_type', 'post_id', 'post_ID') as $key ) {
			if ( !empty($query->query_vars[$key]) ) {
				return; // don't slow down queries that wouldn't include action_log comments anyway
			}
		}
		$query->query_vars['action_log_filter'] = TRUE;
		add_filter( 'comments_clauses', array( $this, 'filter_comment_query_clauses' ), 10, 2 );
	}

	/**
	 * @param array $clauses
	 * @param WP_Comment_Query $query
	 *
	 * @return array
	 */
	public function filter_comment_query_clauses( $clauses, $query ) {
		if ( !empty($query->query_vars['action_log_filter']) ) {
			$clauses['where'] .= $this->get_where_clause();
		}
		return $clauses;
	}

	/**
	 * Make sure Action Scheduler logs are excluded from comment feeds, which use WP_Query, not
	 * the WP_Comment_Query class handled by @see self::filter_comment_queries().
	 *
	 * @param string $where
	 * @param WP_Query $query
	 *
	 * @return string
	 */
	public function filter_comment_feed( $where, $query ) {
		if ( is_comment_feed() ) {
			$where .= $this->get_where_clause();
		}
		return $where;
	}

	/**
	 * Return a SQL clause to exclude Action Scheduler comments.
	 *
	 * @return string
	 */
	protected function get_where_clause() {
		global $wpdb;
		return sprintf( " AND {$wpdb->comments}.comment_type != '%s'", self::TYPE );
	}

	/**
	 * Remove action log entries from wp_count_comments()
	 *
	 * @param array $stats
	 * @param int $post_id
	 *
	 * @return object
	 */
	public function filter_comment_count( $stats, $post_id ) {
		global $wpdb;

		if ( 0 === $post_id ) {
			$stats = $this->get_comment_count();
		}

		return $stats;
	}

	/**
	 * Retrieve the comment counts from our cache, or the database if the cached version isn't set.
	 *
	 * @return object
	 */
	protected function get_comment_count() {
		global $wpdb;

		$stats = get_transient( 'as_comment_count' );

		if ( ! $stats ) {
			$stats = array();

			$count = $wpdb->get_results( "SELECT comment_approved, COUNT( * ) AS num_comments FROM {$wpdb->comments} WHERE comment_type NOT IN('order_note','action_log') GROUP BY comment_approved", ARRAY_A );

			$total = 0;
			$stats = array();
			$approved = array( '0' => 'moderated', '1' => 'approved', 'spam' => 'spam', 'trash' => 'trash', 'post-trashed' => 'post-trashed' );

			foreach ( (array) $count as $row ) {
				// Don't count post-trashed toward totals
				if ( 'post-trashed' != $row['comment_approved'] && 'trash' != $row['comment_approved'] ) {
					$total += $row['num_comments'];
				}
				if ( isset( $approved[ $row['comment_approved'] ] ) ) {
					$stats[ $approved[ $row['comment_approved'] ] ] = $row['num_comments'];
				}
			}

			$stats['total_comments'] = $total;
			$stats['all']            = $total;

			foreach ( $approved as $key ) {
				if ( empty( $stats[ $key ] ) ) {
					$stats[ $key ] = 0;
				}
			}

			$stats = (object) $stats;
			set_transient( 'as_comment_count', $stats );
		}

		return $stats;
	}

	/**
	 * Delete comment count cache whenever there is new comment or the status of a comment changes. Cache
	 * will be regenerated next time ActionScheduler_wpCommentLogger::filter_comment_count() is called.
	 */
	public function delete_comment_count_cache() {
		delete_transient( 'as_comment_count' );
	}

	/**
	 * @codeCoverageIgnore
	 */
	public function init() {
		add_action( 'action_scheduler_before_process_queue', array( $this, 'disable_comment_counting' ), 10, 0 );
		add_action( 'action_scheduler_after_process_queue', array( $this, 'enable_comment_counting' ), 10, 0 );

		parent::init();

		add_action( 'pre_get_comments', array( $this, 'filter_comment_queries' ), 10, 1 );
		add_action( 'wp_count_comments', array( $this, 'filter_comment_count' ), 20, 2 ); // run after WC_Comments::wp_count_comments() to make sure we exclude order notes and action logs
		add_action( 'comment_feed_where', array( $this, 'filter_comment_feed' ), 10, 2 );

		// Delete comments count cache whenever there is a new comment or a comment status changes
		add_action( 'wp_insert_comment', array( $this, 'delete_comment_count_cache' ) );
		add_action( 'wp_set_comment_status', array( $this, 'delete_comment_count_cache' ) );
	}

	public function disable_comment_counting() {
		wp_defer_comment_counting(true);
	}
	public function enable_comment_counting() {
		wp_defer_comment_counting(false);
	}

}
action-scheduler/classes/data-stores/ActionScheduler_wpPostStore_PostTypeRegistrar.php000064400000003302151335517650025601 0ustar00<?php

/**
 * Class ActionScheduler_wpPostStore_PostTypeRegistrar
 * @codeCoverageIgnore
 */
class ActionScheduler_wpPostStore_PostTypeRegistrar {
	public function register() {
		register_post_type( ActionScheduler_wpPostStore::POST_TYPE, $this->post_type_args() );
	}

	/**
	 * Build the args array for the post type definition
	 *
	 * @return array
	 */
	protected function post_type_args() {
		$args = array(
			'label' => __( 'Scheduled Actions', 'woocommerce' ),
			'description' => __( 'Scheduled actions are hooks triggered on a cetain date and time.', 'woocommerce' ),
			'public' => false,
			'map_meta_cap' => true,
			'hierarchical' => false,
			'supports' => array('title', 'editor','comments'),
			'rewrite' => false,
			'query_var' => false,
			'can_export' => true,
			'ep_mask' => EP_NONE,
			'labels' => array(
				'name' => __( 'Scheduled Actions', 'woocommerce' ),
				'singular_name' => __( 'Scheduled Action', 'woocommerce' ),
				'menu_name' => _x( 'Scheduled Actions', 'Admin menu name', 'woocommerce' ),
				'add_new' => __( 'Add', 'woocommerce' ),
				'add_new_item' => __( 'Add New Scheduled Action', 'woocommerce' ),
				'edit' => __( 'Edit', 'woocommerce' ),
				'edit_item' => __( 'Edit Scheduled Action', 'woocommerce' ),
				'new_item' => __( 'New Scheduled Action', 'woocommerce' ),
				'view' => __( 'View Action', 'woocommerce' ),
				'view_item' => __( 'View Action', 'woocommerce' ),
				'search_items' => __( 'Search Scheduled Actions', 'woocommerce' ),
				'not_found' => __( 'No actions found', 'woocommerce' ),
				'not_found_in_trash' => __( 'No actions found in trash', 'woocommerce' ),
			),
		);

		$args = apply_filters('action_scheduler_post_type_args', $args);
		return $args;
	}
}
 action-scheduler/classes/data-stores/ActionScheduler_DBStore.php000064400000057446151335517650021062 0ustar00<?php

/**
 * Class ActionScheduler_DBStore
 *
 * Action data table data store.
 *
 * @since 3.0.0
 */
class ActionScheduler_DBStore extends ActionScheduler_Store {

	/**
	 * Used to share information about the before_date property of claims internally.
	 *
	 * This is used in preference to passing the same information as a method param
	 * for backwards-compatibility reasons.
	 *
	 * @var DateTime|null
	 */
	private $claim_before_date = null;

	/** @var int */
	protected static $max_args_length = 8000;

	/** @var int */
	protected static $max_index_length = 191;

	/**
	 * Initialize the data store
	 *
	 * @codeCoverageIgnore
	 */
	public function init() {
		$table_maker = new ActionScheduler_StoreSchema();
		$table_maker->init();
		$table_maker->register_tables();
	}

	/**
	 * Save an action.
	 *
	 * @param ActionScheduler_Action $action Action object.
	 * @param DateTime               $date Optional schedule date. Default null.
	 *
	 * @return int Action ID.
	 */
	public function save_action( ActionScheduler_Action $action, \DateTime $date = null ) {
		try {

			$this->validate_action( $action );

			/** @var \wpdb $wpdb */
			global $wpdb;
			$data = [
				'hook'                 => $action->get_hook(),
				'status'               => ( $action->is_finished() ? self::STATUS_COMPLETE : self::STATUS_PENDING ),
				'scheduled_date_gmt'   => $this->get_scheduled_date_string( $action, $date ),
				'scheduled_date_local' => $this->get_scheduled_date_string_local( $action, $date ),
				'schedule'             => serialize( $action->get_schedule() ),
				'group_id'             => $this->get_group_id( $action->get_group() ),
			];
			$args = wp_json_encode( $action->get_args() );
			if ( strlen( $args ) <= static::$max_index_length ) {
				$data['args'] = $args;
			} else {
				$data['args']          = $this->hash_args( $args );
				$data['extended_args'] = $args;
			}

			$table_name = ! empty( $wpdb->actionscheduler_actions ) ? $wpdb->actionscheduler_actions : $wpdb->prefix . 'actionscheduler_actions';
			$wpdb->insert( $table_name, $data );
			$action_id = $wpdb->insert_id;

			if ( is_wp_error( $action_id ) ) {
				throw new RuntimeException( $action_id->get_error_message() );
			}
			elseif ( empty( $action_id ) ) {
				throw new RuntimeException( $wpdb->last_error ? $wpdb->last_error : __( 'Database error.', 'woocommerce' ) );
			}

			do_action( 'action_scheduler_stored_action', $action_id );

			return $action_id;
		} catch ( \Exception $e ) {
			/* translators: %s: error message */
			throw new \RuntimeException( sprintf( __( 'Error saving action: %s', 'woocommerce' ), $e->getMessage() ), 0 );
		}
	}

	/**
	 * Generate a hash from json_encoded $args using MD5 as this isn't for security.
	 *
	 * @param string $args JSON encoded action args.
	 * @return string
	 */
	protected function hash_args( $args ) {
		return md5( $args );
	}

	/**
	 * Get action args query param value from action args.
	 *
	 * @param array $args Action args.
	 * @return string
	 */
	protected function get_args_for_query( $args ) {
		$encoded = wp_json_encode( $args );
		if ( strlen( $encoded ) <= static::$max_index_length ) {
			return $encoded;
		}
		return $this->hash_args( $encoded );
	}
	/**
	 * Get a group's ID based on its name/slug.
	 *
	 * @param string $slug The string name of a group.
	 * @param bool $create_if_not_exists Whether to create the group if it does not already exist. Default, true - create the group.
	 *
	 * @return int The group's ID, if it exists or is created, or 0 if it does not exist and is not created.
	 */
	protected function get_group_id( $slug, $create_if_not_exists = true ) {
		if ( empty( $slug ) ) {
			return 0;
		}
		/** @var \wpdb $wpdb */
		global $wpdb;
		$group_id = (int) $wpdb->get_var( $wpdb->prepare( "SELECT group_id FROM {$wpdb->actionscheduler_groups} WHERE slug=%s", $slug ) );
		if ( empty( $group_id ) && $create_if_not_exists ) {
			$group_id = $this->create_group( $slug );
		}

		return $group_id;
	}

	/**
	 * Create an action group.
	 *
	 * @param string $slug Group slug.
	 *
	 * @return int Group ID.
	 */
	protected function create_group( $slug ) {
		/** @var \wpdb $wpdb */
		global $wpdb;
		$wpdb->insert( $wpdb->actionscheduler_groups, [ 'slug' => $slug ] );

		return (int) $wpdb->insert_id;
	}

	/**
	 * Retrieve an action.
	 *
	 * @param int $action_id Action ID.
	 *
	 * @return ActionScheduler_Action
	 */
	public function fetch_action( $action_id ) {
		/** @var \wpdb $wpdb */
		global $wpdb;
		$data = $wpdb->get_row( $wpdb->prepare(
			"SELECT a.*, g.slug AS `group` FROM {$wpdb->actionscheduler_actions} a LEFT JOIN {$wpdb->actionscheduler_groups} g ON a.group_id=g.group_id WHERE a.action_id=%d",
			$action_id
		) );

		if ( empty( $data ) ) {
			return $this->get_null_action();
		}

		if ( ! empty( $data->extended_args ) ) {
			$data->args = $data->extended_args;
			unset( $data->extended_args );
		}

		// Convert NULL dates to zero dates.
		$date_fields = [
			'scheduled_date_gmt',
			'scheduled_date_local',
			'last_attempt_gmt',
			'last_attempt_gmt'
		];
		foreach( $date_fields as $date_field ) {
			if ( is_null( $data->$date_field ) ) {
				$data->$date_field = ActionScheduler_StoreSchema::DEFAULT_DATE;
			}
		}

		try {
			$action = $this->make_action_from_db_record( $data );
		} catch ( ActionScheduler_InvalidActionException $exception ) {
			do_action( 'action_scheduler_failed_fetch_action', $action_id, $exception );
			return $this->get_null_action();
		}

		return $action;
	}

	/**
	 * Create a null action.
	 *
	 * @return ActionScheduler_NullAction
	 */
	protected function get_null_action() {
		return new ActionScheduler_NullAction();
	}

	/**
	 * Create an action from a database record.
	 *
	 * @param object $data Action database record.
	 *
	 * @return ActionScheduler_Action|ActionScheduler_CanceledAction|ActionScheduler_FinishedAction
	 */
	protected function make_action_from_db_record( $data ) {

		$hook     = $data->hook;
		$args     = json_decode( $data->args, true );
		$schedule = unserialize( $data->schedule );

		$this->validate_args( $args, $data->action_id );
		$this->validate_schedule( $schedule, $data->action_id );

		if ( empty( $schedule ) ) {
			$schedule = new ActionScheduler_NullSchedule();
		}
		$group = $data->group ? $data->group : '';

		return ActionScheduler::factory()->get_stored_action( $data->status, $data->hook, $args, $schedule, $group );
	}

	/**
	 * Returns the SQL statement to query (or count) actions.
	 *
	 * @since x.x.x $query['status'] accepts array of statuses instead of a single status.
	 *
	 * @param array  $query Filtering options.
	 * @param string $select_or_count  Whether the SQL should select and return the IDs or just the row count.
	 *
	 * @return string SQL statement already properly escaped.
	 */
	protected function get_query_actions_sql( array $query, $select_or_count = 'select' ) {

		if ( ! in_array( $select_or_count, array( 'select', 'count' ) ) ) {
			throw new InvalidArgumentException( __( 'Invalid value for select or count parameter. Cannot query actions.', 'woocommerce' ) );
		}

		$query = wp_parse_args( $query, [
			'hook'             => '',
			'args'             => null,
			'date'             => null,
			'date_compare'     => '<=',
			'modified'         => null,
			'modified_compare' => '<=',
			'group'            => '',
			'status'           => '',
			'claimed'          => null,
			'per_page'         => 5,
			'offset'           => 0,
			'orderby'          => 'date',
			'order'            => 'ASC',
		] );

		/** @var \wpdb $wpdb */
		global $wpdb;
		$sql  = ( 'count' === $select_or_count ) ? 'SELECT count(a.action_id)' : 'SELECT a.action_id';
		$sql .= " FROM {$wpdb->actionscheduler_actions} a";
		$sql_params = [];

		if ( ! empty( $query[ 'group' ] ) || 'group' === $query[ 'orderby' ] ) {
			$sql .= " LEFT JOIN {$wpdb->actionscheduler_groups} g ON g.group_id=a.group_id";
		}

		$sql .= " WHERE 1=1";

		if ( ! empty( $query[ 'group' ] ) ) {
			$sql          .= " AND g.slug=%s";
			$sql_params[] = $query[ 'group' ];
		}

		if ( $query[ 'hook' ] ) {
			$sql          .= " AND a.hook=%s";
			$sql_params[] = $query[ 'hook' ];
		}
		if ( ! is_null( $query[ 'args' ] ) ) {
			$sql          .= " AND a.args=%s";
			$sql_params[] = $this->get_args_for_query( $query[ 'args' ] );
		}

		if ( $query['status'] ) {
			$statuses     = (array) $query['status'];
			$placeholders = array_fill( 0, count( $statuses ), '%s' );
			$sql         .= ' AND a.status IN (' . join( ', ', $placeholders ) . ')';
			$sql_params   = array_merge( $sql_params, array_values( $statuses ) );
		}

		if ( $query[ 'date' ] instanceof \DateTime ) {
			$date = clone $query[ 'date' ];
			$date->setTimezone( new \DateTimeZone( 'UTC' ) );
			$date_string  = $date->format( 'Y-m-d H:i:s' );
			$comparator   = $this->validate_sql_comparator( $query[ 'date_compare' ] );
			$sql          .= " AND a.scheduled_date_gmt $comparator %s";
			$sql_params[] = $date_string;
		}

		if ( $query[ 'modified' ] instanceof \DateTime ) {
			$modified = clone $query[ 'modified' ];
			$modified->setTimezone( new \DateTimeZone( 'UTC' ) );
			$date_string  = $modified->format( 'Y-m-d H:i:s' );
			$comparator   = $this->validate_sql_comparator( $query[ 'modified_compare' ] );
			$sql          .= " AND a.last_attempt_gmt $comparator %s";
			$sql_params[] = $date_string;
		}

		if ( $query[ 'claimed' ] === true ) {
			$sql .= " AND a.claim_id != 0";
		} elseif ( $query[ 'claimed' ] === false ) {
			$sql .= " AND a.claim_id = 0";
		} elseif ( ! is_null( $query[ 'claimed' ] ) ) {
			$sql          .= " AND a.claim_id = %d";
			$sql_params[] = $query[ 'claimed' ];
		}

		if ( ! empty( $query['search'] ) ) {
			$sql .= " AND (a.hook LIKE %s OR (a.extended_args IS NULL AND a.args LIKE %s) OR a.extended_args LIKE %s";
			for( $i = 0; $i < 3; $i++ ) {
				$sql_params[] = sprintf( '%%%s%%', $query['search'] );
			}

			$search_claim_id = (int) $query['search'];
			if ( $search_claim_id ) {
				$sql .= ' OR a.claim_id = %d';
				$sql_params[] = $search_claim_id;
			}

			$sql .= ')';
		}

		if ( 'select' === $select_or_count ) {
			if ( 'ASC' === strtoupper( $query['order'] ) ) {
				$order = 'ASC';
			} else {
				$order = 'DESC';
			}
			switch ( $query['orderby'] ) {
				case 'hook':
					$sql .= " ORDER BY a.hook $order";
					break;
				case 'group':
					$sql .= " ORDER BY g.slug $order";
					break;
				case 'modified':
					$sql .= " ORDER BY a.last_attempt_gmt $order";
					break;
				case 'none':
					break;
				case 'action_id':
					$sql .= " ORDER BY a.action_id $order";
					break;
				case 'date':
				default:
					$sql .= " ORDER BY a.scheduled_date_gmt $order";
					break;
			}

			if ( $query[ 'per_page' ] > 0 ) {
				$sql          .= " LIMIT %d, %d";
				$sql_params[] = $query[ 'offset' ];
				$sql_params[] = $query[ 'per_page' ];
			}
		}

		if ( ! empty( $sql_params ) ) {
			$sql = $wpdb->prepare( $sql, $sql_params );
		}

		return $sql;
	}

	/**
	 * Query for action count or list of action IDs.
	 *
	 * @since x.x.x $query['status'] accepts array of statuses instead of a single status.
	 *
	 * @see ActionScheduler_Store::query_actions for $query arg usage.
	 *
	 * @param array  $query      Query filtering options.
	 * @param string $query_type Whether to select or count the results. Defaults to select.
	 *
	 * @return string|array|null The IDs of actions matching the query. Null on failure.
	 */
	public function query_actions( $query = [], $query_type = 'select' ) {
		/** @var wpdb $wpdb */
		global $wpdb;

		$sql = $this->get_query_actions_sql( $query, $query_type );

		return ( 'count' === $query_type ) ? $wpdb->get_var( $sql ) : $wpdb->get_col( $sql );
	}

	/**
	 * Get a count of all actions in the store, grouped by status.
	 *
	 * @return array Set of 'status' => int $count pairs for statuses with 1 or more actions of that status.
	 */
	public function action_counts() {
		global $wpdb;

		$sql  = "SELECT a.status, count(a.status) as 'count'";
		$sql .= " FROM {$wpdb->actionscheduler_actions} a";
		$sql .= " GROUP BY a.status";

		$actions_count_by_status = array();
		$action_stati_and_labels = $this->get_status_labels();

		foreach ( $wpdb->get_results( $sql ) as $action_data ) {
			// Ignore any actions with invalid status
			if ( array_key_exists( $action_data->status, $action_stati_and_labels ) ) {
				$actions_count_by_status[ $action_data->status ] = $action_data->count;
			}
		}

		return $actions_count_by_status;
	}

	/**
	 * Cancel an action.
	 *
	 * @param int $action_id Action ID.
	 *
	 * @return void
	 */
	public function cancel_action( $action_id ) {
		/** @var \wpdb $wpdb */
		global $wpdb;

		$updated = $wpdb->update(
			$wpdb->actionscheduler_actions,
			[ 'status' => self::STATUS_CANCELED ],
			[ 'action_id' => $action_id ],
			[ '%s' ],
			[ '%d' ]
		);
		if ( empty( $updated ) ) {
			/* translators: %s: action ID */
			throw new \InvalidArgumentException( sprintf( __( 'Unidentified action %s', 'woocommerce' ), $action_id ) );
		}
		do_action( 'action_scheduler_canceled_action', $action_id );
	}

	/**
	 * Cancel pending actions by hook.
	 *
	 * @since 3.0.0
	 *
	 * @param string $hook Hook name.
	 *
	 * @return void
	 */
	public function cancel_actions_by_hook( $hook ) {
		$this->bulk_cancel_actions( [ 'hook' => $hook ] );
	}

	/**
	 * Cancel pending actions by group.
	 *
	 * @param string $group Group slug.
	 *
	 * @return void
	 */
	public function cancel_actions_by_group( $group ) {
		$this->bulk_cancel_actions( [ 'group' => $group ] );
	}

	/**
	 * Bulk cancel actions.
	 *
	 * @since 3.0.0
	 *
	 * @param array $query_args Query parameters.
	 */
	protected function bulk_cancel_actions( $query_args ) {
		/** @var \wpdb $wpdb */
		global $wpdb;

		if ( ! is_array( $query_args ) ) {
			return;
		}

		// Don't cancel actions that are already canceled.
		if ( isset( $query_args['status'] ) && $query_args['status'] == self::STATUS_CANCELED ) {
			return;
		}

		$action_ids = true;
		$query_args = wp_parse_args(
			$query_args,
			[
				'per_page' => 1000,
				'status'   => self::STATUS_PENDING,
				'orderby'  => 'action_id',
			]
		);

		while ( $action_ids ) {
			$action_ids = $this->query_actions( $query_args );
			if ( empty( $action_ids ) ) {
				break;
			}

			$format     = array_fill( 0, count( $action_ids ), '%d' );
			$query_in   = '(' . implode( ',', $format ) . ')';
			$parameters = $action_ids;
			array_unshift( $parameters, self::STATUS_CANCELED );

			$wpdb->query(
				$wpdb->prepare( // wpcs: PreparedSQLPlaceholders replacement count ok.
					"UPDATE {$wpdb->actionscheduler_actions} SET status = %s WHERE action_id IN {$query_in}",
					$parameters
				)
			);

			do_action( 'action_scheduler_bulk_cancel_actions', $action_ids );
		}
	}

	/**
	 * Delete an action.
	 *
	 * @param int $action_id Action ID.
	 */
	public function delete_action( $action_id ) {
		/** @var \wpdb $wpdb */
		global $wpdb;
		$deleted = $wpdb->delete( $wpdb->actionscheduler_actions, [ 'action_id' => $action_id ], [ '%d' ] );
		if ( empty( $deleted ) ) {
			throw new \InvalidArgumentException( sprintf( __( 'Unidentified action %s', 'woocommerce' ), $action_id ) );
		}
		do_action( 'action_scheduler_deleted_action', $action_id );
	}

	/**
	 * Get the schedule date for an action.
	 *
	 * @param string $action_id Action ID.
	 *
	 * @throws \InvalidArgumentException
	 * @return \DateTime The local date the action is scheduled to run, or the date that it ran.
	 */
	public function get_date( $action_id ) {
		$date = $this->get_date_gmt( $action_id );
		ActionScheduler_TimezoneHelper::set_local_timezone( $date );
		return $date;
	}

	/**
	 * Get the GMT schedule date for an action.
	 *
	 * @param int $action_id Action ID.
	 *
	 * @throws \InvalidArgumentException
	 * @return \DateTime The GMT date the action is scheduled to run, or the date that it ran.
	 */
	protected function get_date_gmt( $action_id ) {
		/** @var \wpdb $wpdb */
		global $wpdb;
		$record = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM {$wpdb->actionscheduler_actions} WHERE action_id=%d", $action_id ) );
		if ( empty( $record ) ) {
			throw new \InvalidArgumentException( sprintf( __( 'Unidentified action %s', 'woocommerce' ), $action_id ) );
		}
		if ( $record->status == self::STATUS_PENDING ) {
			return as_get_datetime_object( $record->scheduled_date_gmt );
		} else {
			return as_get_datetime_object( $record->last_attempt_gmt );
		}
	}

	/**
	 * Stake a claim on actions.
	 *
	 * @param int       $max_actions Maximum number of action to include in claim.
	 * @param \DateTime $before_date Jobs must be schedule before this date. Defaults to now.
	 *
	 * @return ActionScheduler_ActionClaim
	 */
	public function stake_claim( $max_actions = 10, \DateTime $before_date = null, $hooks = array(), $group = '' ) {
		$claim_id = $this->generate_claim_id();

		$this->claim_before_date = $before_date;
		$this->claim_actions( $claim_id, $max_actions, $before_date, $hooks, $group );
		$action_ids = $this->find_actions_by_claim_id( $claim_id );
		$this->claim_before_date = null;

		return new ActionScheduler_ActionClaim( $claim_id, $action_ids );
	}

	/**
	 * Generate a new action claim.
	 *
	 * @return int Claim ID.
	 */
	protected function generate_claim_id() {
		/** @var \wpdb $wpdb */
		global $wpdb;
		$now = as_get_datetime_object();
		$wpdb->insert( $wpdb->actionscheduler_claims, [ 'date_created_gmt' => $now->format( 'Y-m-d H:i:s' ) ] );

		return $wpdb->insert_id;
	}

	/**
	 * Mark actions claimed.
	 *
	 * @param string    $claim_id Claim Id.
	 * @param int       $limit Number of action to include in claim.
	 * @param \DateTime $before_date Should use UTC timezone.
	 *
	 * @return int The number of actions that were claimed.
	 * @throws \RuntimeException
	 */
	protected function claim_actions( $claim_id, $limit, \DateTime $before_date = null, $hooks = array(), $group = '' ) {
		/** @var \wpdb $wpdb */
		global $wpdb;

		$now  = as_get_datetime_object();
		$date = is_null( $before_date ) ? $now : clone $before_date;

		// can't use $wpdb->update() because of the <= condition
		$update = "UPDATE {$wpdb->actionscheduler_actions} SET claim_id=%d, last_attempt_gmt=%s, last_attempt_local=%s";
		$params = array(
			$claim_id,
			$now->format( 'Y-m-d H:i:s' ),
			current_time( 'mysql' ),
		);

		$where    = "WHERE claim_id = 0 AND scheduled_date_gmt <= %s AND status=%s";
		$params[] = $date->format( 'Y-m-d H:i:s' );
		$params[] = self::STATUS_PENDING;

		if ( ! empty( $hooks ) ) {
			$placeholders = array_fill( 0, count( $hooks ), '%s' );
			$where       .= ' AND hook IN (' . join( ', ', $placeholders ) . ')';
			$params       = array_merge( $params, array_values( $hooks ) );
		}

		if ( ! empty( $group ) ) {

			$group_id = $this->get_group_id( $group, false );

			// throw exception if no matching group found, this matches ActionScheduler_wpPostStore's behaviour
			if ( empty( $group_id ) ) {
				/* translators: %s: group name */
				throw new InvalidArgumentException( sprintf( __( 'The group "%s" does not exist.', 'woocommerce' ), $group ) );
			}

			$where   .= ' AND group_id = %d';
			$params[] = $group_id;
		}

		$order    = "ORDER BY attempts ASC, scheduled_date_gmt ASC, action_id ASC LIMIT %d";
		$params[] = $limit;

		$sql = $wpdb->prepare( "{$update} {$where} {$order}", $params );

		$rows_affected = $wpdb->query( $sql );
		if ( $rows_affected === false ) {
			throw new \RuntimeException( __( 'Unable to claim actions. Database error.', 'woocommerce' ) );
		}

		return (int) $rows_affected;
	}

	/**
	 * Get the number of active claims.
	 *
	 * @return int
	 */
	public function get_claim_count() {
		global $wpdb;

		$sql = "SELECT COUNT(DISTINCT claim_id) FROM {$wpdb->actionscheduler_actions} WHERE claim_id != 0 AND status IN ( %s, %s)";
		$sql = $wpdb->prepare( $sql, [ self::STATUS_PENDING, self::STATUS_RUNNING ] );

		return (int) $wpdb->get_var( $sql );
	}

	/**
	 * Return an action's claim ID, as stored in the claim_id column.
	 *
	 * @param string $action_id Action ID.
	 * @return mixed
	 */
	public function get_claim_id( $action_id ) {
		/** @var \wpdb $wpdb */
		global $wpdb;

		$sql = "SELECT claim_id FROM {$wpdb->actionscheduler_actions} WHERE action_id=%d";
		$sql = $wpdb->prepare( $sql, $action_id );

		return (int) $wpdb->get_var( $sql );
	}

	/**
	 * Retrieve the action IDs of action in a claim.
	 *
	 * @return int[]
	 */
	public function find_actions_by_claim_id( $claim_id ) {
		/** @var \wpdb $wpdb */
		global $wpdb;

		$action_ids  = array();
		$before_date = isset( $this->claim_before_date ) ? $this->claim_before_date : as_get_datetime_object();
		$cut_off     = $before_date->format( 'Y-m-d H:i:s' );

		$sql = $wpdb->prepare(
			"SELECT action_id, scheduled_date_gmt FROM {$wpdb->actionscheduler_actions} WHERE claim_id = %d",
			$claim_id
		);

		// Verify that the scheduled date for each action is within the expected bounds (in some unusual
		// cases, we cannot depend on MySQL to honor all of the WHERE conditions we specify).
		foreach ( $wpdb->get_results( $sql ) as $claimed_action ) {
			if ( $claimed_action->scheduled_date_gmt <= $cut_off ) {
				$action_ids[] = absint( $claimed_action->action_id );
			}
		}

		return $action_ids;
	}

	/**
	 * Release actions from a claim and delete the claim.
	 *
	 * @param ActionScheduler_ActionClaim $claim Claim object.
	 */
	public function release_claim( ActionScheduler_ActionClaim $claim ) {
		/** @var \wpdb $wpdb */
		global $wpdb;
		$wpdb->update( $wpdb->actionscheduler_actions, [ 'claim_id' => 0 ], [ 'claim_id' => $claim->get_id() ], [ '%d' ], [ '%d' ] );
		$wpdb->delete( $wpdb->actionscheduler_claims, [ 'claim_id' => $claim->get_id() ], [ '%d' ] );
	}

	/**
	 * Remove the claim from an action.
	 *
	 * @param int $action_id Action ID.
	 *
	 * @return void
	 */
	public function unclaim_action( $action_id ) {
		/** @var \wpdb $wpdb */
		global $wpdb;
		$wpdb->update(
			$wpdb->actionscheduler_actions,
			[ 'claim_id' => 0 ],
			[ 'action_id' => $action_id ],
			[ '%s' ],
			[ '%d' ]
		);
	}

	/**
	 * Mark an action as failed.
	 *
	 * @param int $action_id Action ID.
	 */
	public function mark_failure( $action_id ) {
		/** @var \wpdb $wpdb */
		global $wpdb;
		$updated = $wpdb->update(
			$wpdb->actionscheduler_actions,
			[ 'status' => self::STATUS_FAILED ],
			[ 'action_id' => $action_id ],
			[ '%s' ],
			[ '%d' ]
		);
		if ( empty( $updated ) ) {
			throw new \InvalidArgumentException( sprintf( __( 'Unidentified action %s', 'woocommerce' ), $action_id ) );
		}
	}

	/**
	 * Add execution message to action log.
	 *
	 * @param int $action_id Action ID.
	 *
	 * @return void
	 */
	public function log_execution( $action_id ) {
		/** @var \wpdb $wpdb */
		global $wpdb;

		$sql = "UPDATE {$wpdb->actionscheduler_actions} SET attempts = attempts+1, status=%s, last_attempt_gmt = %s, last_attempt_local = %s WHERE action_id = %d";
		$sql = $wpdb->prepare( $sql, self::STATUS_RUNNING, current_time( 'mysql', true ), current_time( 'mysql' ), $action_id );
		$wpdb->query( $sql );
	}

	/**
	 * Mark an action as complete.
	 *
	 * @param int $action_id Action ID.
	 *
	 * @return void
	 */
	public function mark_complete( $action_id ) {
		/** @var \wpdb $wpdb */
		global $wpdb;
		$updated = $wpdb->update(
			$wpdb->actionscheduler_actions,
			[
				'status'             => self::STATUS_COMPLETE,
				'last_attempt_gmt'   => current_time( 'mysql', true ),
				'last_attempt_local' => current_time( 'mysql' ),
			],
			[ 'action_id' => $action_id ],
			[ '%s' ],
			[ '%d' ]
		);
		if ( empty( $updated ) ) {
			throw new \InvalidArgumentException( sprintf( __( 'Unidentified action %s', 'woocommerce' ), $action_id ) );
		}
	}

	/**
	 * Get an action's status.
	 *
	 * @param int $action_id Action ID.
	 *
	 * @return string
	 */
	public function get_status( $action_id ) {
		/** @var \wpdb $wpdb */
		global $wpdb;
		$sql    = "SELECT status FROM {$wpdb->actionscheduler_actions} WHERE action_id=%d";
		$sql    = $wpdb->prepare( $sql, $action_id );
		$status = $wpdb->get_var( $sql );

		if ( $status === null ) {
			throw new \InvalidArgumentException( __( 'Invalid action ID. No status found.', 'woocommerce' ) );
		} elseif ( empty( $status ) ) {
			throw new \RuntimeException( __( 'Unknown status found for action.', 'woocommerce' ) );
		} else {
			return $status;
		}
	}
}
action-scheduler/classes/data-stores/ActionScheduler_DBLogger.php000064400000007701151335517650021172 0ustar00<?php

/**
 * Class ActionScheduler_DBLogger
 *
 * Action logs data table data store.
 *
 * @since 3.0.0
 */
class ActionScheduler_DBLogger extends ActionScheduler_Logger {

	/**
	 * Add a record to an action log.
	 *
	 * @param int      $action_id Action ID.
	 * @param string   $message Message to be saved in the log entry.
	 * @param DateTime $date Timestamp of the log entry.
	 *
	 * @return int     The log entry ID.
	 */
	public function log( $action_id, $message, DateTime $date = null ) {
		if ( empty( $date ) ) {
			$date = as_get_datetime_object();
		} else {
			$date = clone $date;
		}

		$date_gmt = $date->format( 'Y-m-d H:i:s' );
		ActionScheduler_TimezoneHelper::set_local_timezone( $date );
		$date_local = $date->format( 'Y-m-d H:i:s' );

		/** @var \wpdb $wpdb */
		global $wpdb;
		$wpdb->insert( $wpdb->actionscheduler_logs, [
			'action_id'      => $action_id,
			'message'        => $message,
			'log_date_gmt'   => $date_gmt,
			'log_date_local' => $date_local,
		], [ '%d', '%s', '%s', '%s' ] );

		return $wpdb->insert_id;
	}

	/**
	 * Retrieve an action log entry.
	 *
	 * @param int $entry_id Log entry ID.
	 *
	 * @return ActionScheduler_LogEntry
	 */
	public function get_entry( $entry_id ) {
		/** @var \wpdb $wpdb */
		global $wpdb;
		$entry = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM {$wpdb->actionscheduler_logs} WHERE log_id=%d", $entry_id ) );

		return $this->create_entry_from_db_record( $entry );
	}

	/**
	 * Create an action log entry from a database record.
	 *
	 * @param object $record Log entry database record object.
	 *
	 * @return ActionScheduler_LogEntry
	 */
	private function create_entry_from_db_record( $record ) {
		if ( empty( $record ) ) {
			return new ActionScheduler_NullLogEntry();
		}

		if ( is_null( $record->log_date_gmt ) ) {
			$date = as_get_datetime_object( ActionScheduler_StoreSchema::DEFAULT_DATE );
		} else {
			$date = as_get_datetime_object( $record->log_date_gmt );
		}

		return new ActionScheduler_LogEntry( $record->action_id, $record->message, $date );
	}

	/**
	 * Retrieve the an action's log entries from the database.
	 *
	 * @param int $action_id Action ID.
	 *
	 * @return ActionScheduler_LogEntry[]
	 */
	public function get_logs( $action_id ) {
		/** @var \wpdb $wpdb */
		global $wpdb;

		$records = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM {$wpdb->actionscheduler_logs} WHERE action_id=%d", $action_id ) );

		return array_map( [ $this, 'create_entry_from_db_record' ], $records );
	}

	/**
	 * Initialize the data store.
	 *
	 * @codeCoverageIgnore
	 */
	public function init() {
		$table_maker = new ActionScheduler_LoggerSchema();
		$table_maker->init();
		$table_maker->register_tables();

		parent::init();

		add_action( 'action_scheduler_deleted_action', [ $this, 'clear_deleted_action_logs' ], 10, 1 );
	}

	/**
	 * Delete the action logs for an action.
	 *
	 * @param int $action_id Action ID.
	 */
	public function clear_deleted_action_logs( $action_id ) {
		/** @var \wpdb $wpdb */
		global $wpdb;
		$wpdb->delete( $wpdb->actionscheduler_logs, [ 'action_id' => $action_id, ], [ '%d' ] );
	}

	/**
	 * Bulk add cancel action log entries.
	 *
	 * @param array $action_ids List of action ID.
	 */
	public function bulk_log_cancel_actions( $action_ids ) {
		if ( empty( $action_ids ) ) {
			return;
		}

		/** @var \wpdb $wpdb */
		global $wpdb;
		$date     = as_get_datetime_object();
		$date_gmt = $date->format( 'Y-m-d H:i:s' );
		ActionScheduler_TimezoneHelper::set_local_timezone( $date );
		$date_local = $date->format( 'Y-m-d H:i:s' );
		$message    = __( 'action canceled', 'woocommerce' );
		$format     = '(%d, ' . $wpdb->prepare( '%s, %s, %s', $message, $date_gmt, $date_local ) . ')';
		$sql_query  = "INSERT {$wpdb->actionscheduler_logs} (action_id, message, log_date_gmt, log_date_local) VALUES ";
		$value_rows = [];

		foreach ( $action_ids as $action_id ) {
			$value_rows[] = $wpdb->prepare( $format, $action_id );
		}
		$sql_query .= implode( ',', $value_rows );

		$wpdb->query( $sql_query );
	}
}
action-scheduler/classes/data-stores/ActionScheduler_HybridStore.php000064400000027366151335517650022014 0ustar00<?php

use ActionScheduler_Store as Store;
use Action_Scheduler\Migration\Runner;
use Action_Scheduler\Migration\Config;
use Action_Scheduler\Migration\Controller;

/**
 * Class ActionScheduler_HybridStore
 *
 * A wrapper around multiple stores that fetches data from both.
 *
 * @since 3.0.0
 */
class ActionScheduler_HybridStore extends Store {
	const DEMARKATION_OPTION = 'action_scheduler_hybrid_store_demarkation';

	private $primary_store;
	private $secondary_store;
	private $migration_runner;

	/**
	 * @var int The dividing line between IDs of actions created
	 *          by the primary and secondary stores.
	 *
	 * Methods that accept an action ID will compare the ID against
	 * this to determine which store will contain that ID. In almost
	 * all cases, the ID should come from the primary store, but if
	 * client code is bypassing the API functions and fetching IDs
	 * from elsewhere, then there is a chance that an unmigrated ID
	 * might be requested.
	 */
	private $demarkation_id = 0;

	/**
	 * ActionScheduler_HybridStore constructor.
	 *
	 * @param Config $config Migration config object.
	 */
	public function __construct( Config $config = null ) {
		$this->demarkation_id = (int) get_option( self::DEMARKATION_OPTION, 0 );
		if ( empty( $config ) ) {
			$config = Controller::instance()->get_migration_config_object();
		}
		$this->primary_store    = $config->get_destination_store();
		$this->secondary_store  = $config->get_source_store();
		$this->migration_runner = new Runner( $config );
	}

	/**
	 * Initialize the table data store tables.
	 *
	 * @codeCoverageIgnore
	 */
	public function init() {
		add_action( 'action_scheduler/created_table', [ $this, 'set_autoincrement' ], 10, 2 );
		$this->primary_store->init();
		$this->secondary_store->init();
		remove_action( 'action_scheduler/created_table', [ $this, 'set_autoincrement' ], 10 );
	}

	/**
	 * When the actions table is created, set its autoincrement
	 * value to be one higher than the posts table to ensure that
	 * there are no ID collisions.
	 *
	 * @param string $table_name
	 * @param string $table_suffix
	 *
	 * @return void
	 * @codeCoverageIgnore
	 */
	public function set_autoincrement( $table_name, $table_suffix ) {
		if ( ActionScheduler_StoreSchema::ACTIONS_TABLE === $table_suffix ) {
			if ( empty( $this->demarkation_id ) ) {
				$this->demarkation_id = $this->set_demarkation_id();
			}
			/** @var \wpdb $wpdb */
			global $wpdb;
			/**
			 * A default date of '0000-00-00 00:00:00' is invalid in MySQL 5.7 when configured with 
			 * sql_mode including both STRICT_TRANS_TABLES and NO_ZERO_DATE.
			 */
			$default_date = new DateTime( 'tomorrow' );
			$null_action  = new ActionScheduler_NullAction();
			$date_gmt     = $this->get_scheduled_date_string( $null_action, $default_date );
			$date_local   = $this->get_scheduled_date_string_local( $null_action, $default_date );

			$row_count = $wpdb->insert(
				$wpdb->{ActionScheduler_StoreSchema::ACTIONS_TABLE},
				[
					'action_id'            => $this->demarkation_id,
					'hook'                 => '',
					'status'               => '',
					'scheduled_date_gmt'   => $date_gmt,
					'scheduled_date_local' => $date_local,
					'last_attempt_gmt'     => $date_gmt,
					'last_attempt_local'   => $date_local,
				]
			);
			if ( $row_count > 0 ) {
				$wpdb->delete(
					$wpdb->{ActionScheduler_StoreSchema::ACTIONS_TABLE},
					[ 'action_id' => $this->demarkation_id ]
				);
			}
		}
	}

	/**
	 * Store the demarkation id in WP options.
	 *
	 * @param int $id The ID to set as the demarkation point between the two stores
	 *                Leave null to use the next ID from the WP posts table.
	 *
	 * @return int The new ID.
	 *
	 * @codeCoverageIgnore
	 */
	private function set_demarkation_id( $id = null ) {
		if ( empty( $id ) ) {
			/** @var \wpdb $wpdb */
			global $wpdb;
			$id = (int) $wpdb->get_var( "SELECT MAX(ID) FROM $wpdb->posts" );
			$id ++;
		}
		update_option( self::DEMARKATION_OPTION, $id );

		return $id;
	}

	/**
	 * Find the first matching action from the secondary store.
	 * If it exists, migrate it to the primary store immediately.
	 * After it migrates, the secondary store will logically contain
	 * the next matching action, so return the result thence.
	 *
	 * @param string $hook
	 * @param array  $params
	 *
	 * @return string
	 */
	public function find_action( $hook, $params = [] ) {
		$found_unmigrated_action = $this->secondary_store->find_action( $hook, $params );
		if ( ! empty( $found_unmigrated_action ) ) {
			$this->migrate( [ $found_unmigrated_action ] );
		}

		return $this->primary_store->find_action( $hook, $params );
	}

	/**
	 * Find actions matching the query in the secondary source first.
	 * If any are found, migrate them immediately. Then the secondary
	 * store will contain the canonical results.
	 *
	 * @param array $query
	 * @param string $query_type Whether to select or count the results. Default, select.
	 *
	 * @return int[]
	 */
	public function query_actions( $query = [], $query_type = 'select' ) {
		$found_unmigrated_actions = $this->secondary_store->query_actions( $query, 'select' );
		if ( ! empty( $found_unmigrated_actions ) ) {
			$this->migrate( $found_unmigrated_actions );
		}

		return $this->primary_store->query_actions( $query, $query_type );
	}

	/**
	 * Get a count of all actions in the store, grouped by status
	 *
	 * @return array Set of 'status' => int $count pairs for statuses with 1 or more actions of that status.
	 */
	public function action_counts() {
		$unmigrated_actions_count = $this->secondary_store->action_counts();
		$migrated_actions_count   = $this->primary_store->action_counts();
		$actions_count_by_status  = array();

		foreach ( $this->get_status_labels() as $status_key => $status_label ) {

			$count = 0;

			if ( isset( $unmigrated_actions_count[ $status_key ] ) ) {
				$count += $unmigrated_actions_count[ $status_key ];
			}

			if ( isset( $migrated_actions_count[ $status_key ] ) ) {
				$count += $migrated_actions_count[ $status_key ];
			}

			$actions_count_by_status[ $status_key ] = $count;
		}

		$actions_count_by_status = array_filter( $actions_count_by_status );

		return $actions_count_by_status;
	}

	/**
	 * If any actions would have been claimed by the secondary store,
	 * migrate them immediately, then ask the primary store for the
	 * canonical claim.
	 *
	 * @param int           $max_actions
	 * @param DateTime|null $before_date
	 *
	 * @return ActionScheduler_ActionClaim
	 */
	public function stake_claim( $max_actions = 10, DateTime $before_date = null, $hooks = array(), $group = '' ) {
		$claim = $this->secondary_store->stake_claim( $max_actions, $before_date, $hooks, $group );

		$claimed_actions = $claim->get_actions();
		if ( ! empty( $claimed_actions ) ) {
			$this->migrate( $claimed_actions );
		}

		$this->secondary_store->release_claim( $claim );

		return $this->primary_store->stake_claim( $max_actions, $before_date, $hooks, $group );
	}

	/**
	 * Migrate a list of actions to the table data store.
	 *
	 * @param array $action_ids List of action IDs.
	 */
	private function migrate( $action_ids ) {
		$this->migration_runner->migrate_actions( $action_ids );
	}

	/**
	 * Save an action to the primary store.
	 *
	 * @param ActionScheduler_Action $action Action object to be saved.
	 * @param DateTime               $date Optional. Schedule date. Default null.
	 *
	 * @return int The action ID
	 */
	public function save_action( ActionScheduler_Action $action, DateTime $date = null ) {
		return $this->primary_store->save_action( $action, $date );
	}

	/**
	 * Retrieve an existing action whether migrated or not.
	 *
	 * @param int $action_id Action ID.
	 */
	public function fetch_action( $action_id ) {
		$store = $this->get_store_from_action_id( $action_id, true );
		if ( $store ) {
			return $store->fetch_action( $action_id );
		} else {
			return new ActionScheduler_NullAction();
		}
	}

	/**
	 * Cancel an existing action whether migrated or not.
	 *
	 * @param int $action_id Action ID.
	 */
	public function cancel_action( $action_id ) {
		$store = $this->get_store_from_action_id( $action_id );
		if ( $store ) {
			$store->cancel_action( $action_id );
		}
	}

	/**
	 * Delete an existing action whether migrated or not.
	 *
	 * @param int $action_id Action ID.
	 */
	public function delete_action( $action_id ) {
		$store = $this->get_store_from_action_id( $action_id );
		if ( $store ) {
			$store->delete_action( $action_id );
		}
	}

	/**
	 * Get the schedule date an existing action whether migrated or not.
	 *
	 * @param int $action_id Action ID.
	 */
	public function get_date( $action_id ) {
		$store = $this->get_store_from_action_id( $action_id );
		if ( $store ) {
			return $store->get_date( $action_id );
		} else {
			return null;
		}
	}

	/**
	 * Mark an existing action as failed whether migrated or not.
	 *
	 * @param int $action_id Action ID.
	 */
	public function mark_failure( $action_id ) {
		$store = $this->get_store_from_action_id( $action_id );
		if ( $store ) {
			$store->mark_failure( $action_id );
		}
	}

	/**
	 * Log the execution of an existing action whether migrated or not.
	 *
	 * @param int $action_id Action ID.
	 */
	public function log_execution( $action_id ) {
		$store = $this->get_store_from_action_id( $action_id );
		if ( $store ) {
			$store->log_execution( $action_id );
		}
	}

	/**
	 * Mark an existing action complete whether migrated or not.
	 *
	 * @param int $action_id Action ID.
	 */
	public function mark_complete( $action_id ) {
		$store = $this->get_store_from_action_id( $action_id );
		if ( $store ) {
			$store->mark_complete( $action_id );
		}
	}

	/**
	 * Get an existing action status whether migrated or not.
	 *
	 * @param int $action_id Action ID.
	 */
	public function get_status( $action_id ) {
		$store = $this->get_store_from_action_id( $action_id );
		if ( $store ) {
			return $store->get_status( $action_id );
		}
		return null;
	}

	/**
	 * Return which store an action is stored in.
	 *
	 * @param int  $action_id ID of the action.
	 * @param bool $primary_first Optional flag indicating search the primary store first.
	 * @return ActionScheduler_Store
	 */
	protected function get_store_from_action_id( $action_id, $primary_first = false ) {
		if ( $primary_first ) {
			$stores = [
				$this->primary_store,
				$this->secondary_store,
			];
		} elseif ( $action_id < $this->demarkation_id ) {
			$stores = [
				$this->secondary_store,
				$this->primary_store,
			];
		} else {
			$stores = [
				$this->primary_store,
			];
		}

		foreach ( $stores as $store ) {
			$action = $store->fetch_action( $action_id );
			if ( ! is_a( $action, 'ActionScheduler_NullAction' ) ) {
				return $store;
			}
		}
		return null;
	}

	/* * * * * * * * * * * * * * * * * * * * * * * * * * *
	 * All claim-related functions should operate solely
	 * on the primary store.
	 * * * * * * * * * * * * * * * * * * * * * * * * * * */

	/**
	 * Get the claim count from the table data store.
	 */
	public function get_claim_count() {
		return $this->primary_store->get_claim_count();
	}

	/**
	 * Retrieve the claim ID for an action from the table data store.
	 *
	 * @param int $action_id Action ID.
	 */
	public function get_claim_id( $action_id ) {
		return $this->primary_store->get_claim_id( $action_id );
	}

	/**
	 * Release a claim in the table data store.
	 *
	 * @param ActionScheduler_ActionClaim $claim Claim object.
	 */
	public function release_claim( ActionScheduler_ActionClaim $claim ) {
		$this->primary_store->release_claim( $claim );
	}

	/**
	 * Release claims on an action in the table data store.
	 *
	 * @param int $action_id Action ID.
	 */
	public function unclaim_action( $action_id ) {
		$this->primary_store->unclaim_action( $action_id );
	}

	/**
	 * Retrieve a list of action IDs by claim.
	 *
	 * @param int $claim_id Claim ID.
	 */
	public function find_actions_by_claim_id( $claim_id ) {
		return $this->primary_store->find_actions_by_claim_id( $claim_id );
	}
}
action-scheduler/classes/data-stores/ActionScheduler_wpPostStore_TaxonomyRegistrar.php000064400000001205151335517650025630 0ustar00<?php

/**
 * Class ActionScheduler_wpPostStore_TaxonomyRegistrar
 * @codeCoverageIgnore
 */
class ActionScheduler_wpPostStore_TaxonomyRegistrar {
	public function register() {
		register_taxonomy( ActionScheduler_wpPostStore::GROUP_TAXONOMY, ActionScheduler_wpPostStore::POST_TYPE, $this->taxonomy_args() );
	}

	protected function taxonomy_args() {
		$args = array(
			'label' => __( 'Action Group', 'woocommerce' ),
			'public' => false,
			'hierarchical' => false,
			'show_admin_column' => true,
			'query_var' => false,
			'rewrite' => false,
		);

		$args = apply_filters( 'action_scheduler_taxonomy_args', $args );
		return $args;
	}
}
 action-scheduler/classes/data-stores/ActionScheduler_wpPostStore.php000064400000071427151335517650022064 0ustar00<?php

/**
 * Class ActionScheduler_wpPostStore
 */
class ActionScheduler_wpPostStore extends ActionScheduler_Store {
	const POST_TYPE = 'scheduled-action';
	const GROUP_TAXONOMY = 'action-group';
	const SCHEDULE_META_KEY = '_action_manager_schedule';
	const DEPENDENCIES_MET = 'as-post-store-dependencies-met';

	/**
	 * Used to share information about the before_date property of claims internally.
	 *
	 * This is used in preference to passing the same information as a method param
	 * for backwards-compatibility reasons.
	 *
	 * @var DateTime|null
	 */
	private $claim_before_date = null;

	/** @var DateTimeZone */
	protected $local_timezone = NULL;

	public function save_action( ActionScheduler_Action $action, DateTime $scheduled_date = NULL ){
		try {
			$this->validate_action( $action );
			$post_array = $this->create_post_array( $action, $scheduled_date );
			$post_id = $this->save_post_array( $post_array );
			$this->save_post_schedule( $post_id, $action->get_schedule() );
			$this->save_action_group( $post_id, $action->get_group() );
			do_action( 'action_scheduler_stored_action', $post_id );
			return $post_id;
		} catch ( Exception $e ) {
			throw new RuntimeException( sprintf( __( 'Error saving action: %s', 'woocommerce' ), $e->getMessage() ), 0 );
		}
	}

	protected function create_post_array( ActionScheduler_Action $action, DateTime $scheduled_date = NULL ) {
		$post = array(
			'post_type' => self::POST_TYPE,
			'post_title' => $action->get_hook(),
			'post_content' => json_encode($action->get_args()),
			'post_status' => ( $action->is_finished() ? 'publish' : 'pending' ),
			'post_date_gmt' => $this->get_scheduled_date_string( $action, $scheduled_date ),
			'post_date'     => $this->get_scheduled_date_string_local( $action, $scheduled_date ),
		);
		return $post;
	}

	protected function save_post_array( $post_array ) {
		add_filter( 'wp_insert_post_data', array( $this, 'filter_insert_post_data' ), 10, 1 );
		add_filter( 'pre_wp_unique_post_slug', array( $this, 'set_unique_post_slug' ), 10, 5 );

		$has_kses = false !== has_filter( 'content_save_pre', 'wp_filter_post_kses' );

		if ( $has_kses ) {
			// Prevent KSES from corrupting JSON in post_content.
			kses_remove_filters();
		}

		$post_id = wp_insert_post($post_array);

		if ( $has_kses ) {
			kses_init_filters();
		}

		remove_filter( 'wp_insert_post_data', array( $this, 'filter_insert_post_data' ), 10 );
		remove_filter( 'pre_wp_unique_post_slug', array( $this, 'set_unique_post_slug' ), 10 );

		if ( is_wp_error($post_id) || empty($post_id) ) {
			throw new RuntimeException( __( 'Unable to save action.', 'woocommerce' ) );
		}
		return $post_id;
	}

	public function filter_insert_post_data( $postdata ) {
		if ( $postdata['post_type'] == self::POST_TYPE ) {
			$postdata['post_author'] = 0;
			if ( $postdata['post_status'] == 'future' ) {
				$postdata['post_status'] = 'publish';
			}
		}
		return $postdata;
	}

	/**
	 * Create a (probably unique) post name for scheduled actions in a more performant manner than wp_unique_post_slug().
	 *
	 * When an action's post status is transitioned to something other than 'draft', 'pending' or 'auto-draft, like 'publish'
	 * or 'failed' or 'trash', WordPress will find a unique slug (stored in post_name column) using the wp_unique_post_slug()
	 * function. This is done to ensure URL uniqueness. The approach taken by wp_unique_post_slug() is to iterate over existing
	 * post_name values that match, and append a number 1 greater than the largest. This makes sense when manually creating a
	 * post from the Edit Post screen. It becomes a bottleneck when automatically processing thousands of actions, with a
	 * database containing thousands of related post_name values.
	 *
	 * WordPress 5.1 introduces the 'pre_wp_unique_post_slug' filter for plugins to address this issue.
	 *
	 * We can short-circuit WordPress's wp_unique_post_slug() approach using the 'pre_wp_unique_post_slug' filter. This
	 * method is available to be used as a callback on that filter. It provides a more scalable approach to generating a
	 * post_name/slug that is probably unique. Because Action Scheduler never actually uses the post_name field, or an
	 * action's slug, being probably unique is good enough.
	 *
	 * For more backstory on this issue, see:
	 * - https://github.com/woocommerce/action-scheduler/issues/44 and
	 * - https://core.trac.wordpress.org/ticket/21112
	 *
	 * @param string $override_slug Short-circuit return value.
	 * @param string $slug          The desired slug (post_name).
	 * @param int    $post_ID       Post ID.
	 * @param string $post_status   The post status.
	 * @param string $post_type     Post type.
	 * @return string
	 */
	public function set_unique_post_slug( $override_slug, $slug, $post_ID, $post_status, $post_type ) {
		if ( self::POST_TYPE == $post_type ) {
			$override_slug = uniqid( self::POST_TYPE . '-', true ) . '-' . wp_generate_password( 32, false );
		}
		return $override_slug;
	}

	protected function save_post_schedule( $post_id, $schedule ) {
		update_post_meta( $post_id, self::SCHEDULE_META_KEY, $schedule );
	}

	protected function save_action_group( $post_id, $group ) {
		if ( empty($group) ) {
			wp_set_object_terms( $post_id, array(), self::GROUP_TAXONOMY, FALSE );
		} else {
			wp_set_object_terms( $post_id, array($group), self::GROUP_TAXONOMY, FALSE );
		}
	}

	public function fetch_action( $action_id ) {
		$post = $this->get_post( $action_id );
		if ( empty($post) || $post->post_type != self::POST_TYPE ) {
			return $this->get_null_action();
		}

		try {
			$action = $this->make_action_from_post( $post );
		} catch ( ActionScheduler_InvalidActionException $exception ) {
			do_action( 'action_scheduler_failed_fetch_action', $post->ID, $exception );
			return $this->get_null_action();
		}

		return $action;
	}

	protected function get_post( $action_id ) {
		if ( empty($action_id) ) {
			return NULL;
		}
		return get_post($action_id);
	}

	protected function get_null_action() {
		return new ActionScheduler_NullAction();
	}

	protected function make_action_from_post( $post ) {
		$hook = $post->post_title;

		$args = json_decode( $post->post_content, true );
		$this->validate_args( $args, $post->ID );

		$schedule = get_post_meta( $post->ID, self::SCHEDULE_META_KEY, true );
		$this->validate_schedule( $schedule, $post->ID );

		$group = wp_get_object_terms( $post->ID, self::GROUP_TAXONOMY, array('fields' => 'names') );
		$group = empty( $group ) ? '' : reset($group);

		return ActionScheduler::factory()->get_stored_action( $this->get_action_status_by_post_status( $post->post_status ), $hook, $args, $schedule, $group );
	}

	/**
	 * @param string $post_status
	 *
	 * @throws InvalidArgumentException if $post_status not in known status fields returned by $this->get_status_labels()
	 * @return string
	 */
	protected function get_action_status_by_post_status( $post_status ) {

		switch ( $post_status ) {
			case 'publish' :
				$action_status = self::STATUS_COMPLETE;
				break;
			case 'trash' :
				$action_status = self::STATUS_CANCELED;
				break;
			default :
				if ( ! array_key_exists( $post_status, $this->get_status_labels() ) ) {
					throw new InvalidArgumentException( sprintf( 'Invalid post status: "%s". No matching action status available.', $post_status ) );
				}
				$action_status = $post_status;
				break;
		}

		return $action_status;
	}

	/**
	 * @param string $action_status
	 * @throws InvalidArgumentException if $post_status not in known status fields returned by $this->get_status_labels()
	 * @return string
	 */
	protected function get_post_status_by_action_status( $action_status ) {

		switch ( $action_status ) {
			case self::STATUS_COMPLETE :
				$post_status = 'publish';
				break;
			case self::STATUS_CANCELED :
				$post_status = 'trash';
				break;
			default :
				if ( ! array_key_exists( $action_status, $this->get_status_labels() ) ) {
					throw new InvalidArgumentException( sprintf( 'Invalid action status: "%s".', $action_status ) );
				}
				$post_status = $action_status;
				break;
		}

		return $post_status;
	}

	/**
	 * Returns the SQL statement to query (or count) actions.
	 *
	 * @param array $query Filtering options
	 * @param string $select_or_count  Whether the SQL should select and return the IDs or just the row count
	 * @throws InvalidArgumentException if $select_or_count not count or select
	 * @return string SQL statement. The returned SQL is already properly escaped.
	 */
	protected function get_query_actions_sql( array $query, $select_or_count = 'select' ) {

		if ( ! in_array( $select_or_count, array( 'select', 'count' ) ) ) {
			throw new InvalidArgumentException( __( 'Invalid schedule. Cannot save action.', 'woocommerce' ) );
		}

		$query = wp_parse_args( $query, array(
			'hook' => '',
			'args' => NULL,
			'date' => NULL,
			'date_compare' => '<=',
			'modified' => NULL,
			'modified_compare' => '<=',
			'group' => '',
			'status' => '',
			'claimed' => NULL,
			'per_page' => 5,
			'offset' => 0,
			'orderby' => 'date',
			'order' => 'ASC',
			'search' => '',
		) );

		/** @var wpdb $wpdb */
		global $wpdb;
		$sql  = ( 'count' === $select_or_count ) ? 'SELECT count(p.ID)' : 'SELECT p.ID ';
		$sql .= "FROM {$wpdb->posts} p";
		$sql_params = array();
		if ( empty( $query['group'] ) && 'group' === $query['orderby'] ) {
			$sql .= " LEFT JOIN {$wpdb->term_relationships} tr ON tr.object_id=p.ID";
			$sql .= " LEFT JOIN {$wpdb->term_taxonomy} tt ON tr.term_taxonomy_id=tt.term_taxonomy_id";
			$sql .= " LEFT JOIN {$wpdb->terms} t ON tt.term_id=t.term_id";
		} elseif ( ! empty( $query['group'] ) ) {
			$sql .= " INNER JOIN {$wpdb->term_relationships} tr ON tr.object_id=p.ID";
			$sql .= " INNER JOIN {$wpdb->term_taxonomy} tt ON tr.term_taxonomy_id=tt.term_taxonomy_id";
			$sql .= " INNER JOIN {$wpdb->terms} t ON tt.term_id=t.term_id";
			$sql .= " AND t.slug=%s";
			$sql_params[] = $query['group'];
		}
		$sql .= " WHERE post_type=%s";
		$sql_params[] = self::POST_TYPE;
		if ( $query['hook'] ) {
			$sql .= " AND p.post_title=%s";
			$sql_params[] = $query['hook'];
		}
		if ( !is_null($query['args']) ) {
			$sql .= " AND p.post_content=%s";
			$sql_params[] = json_encode($query['args']);
		}

		if ( $query['status'] ) {
			$post_statuses = array_map( array( $this, 'get_post_status_by_action_status' ), (array) $query['status'] );
			$placeholders  = array_fill( 0, count( $post_statuses ), '%s' );
			$sql          .= ' AND p.post_status IN (' . join( ', ', $placeholders ) . ')';
			$sql_params    = array_merge( $sql_params, array_values( $post_statuses ) );
		}

		if ( $query['date'] instanceof DateTime ) {
			$date = clone $query['date'];
			$date->setTimezone( new DateTimeZone('UTC') );
			$date_string = $date->format('Y-m-d H:i:s');
			$comparator = $this->validate_sql_comparator($query['date_compare']);
			$sql .= " AND p.post_date_gmt $comparator %s";
			$sql_params[] = $date_string;
		}

		if ( $query['modified'] instanceof DateTime ) {
			$modified = clone $query['modified'];
			$modified->setTimezone( new DateTimeZone('UTC') );
			$date_string = $modified->format('Y-m-d H:i:s');
			$comparator = $this->validate_sql_comparator($query['modified_compare']);
			$sql .= " AND p.post_modified_gmt $comparator %s";
			$sql_params[] = $date_string;
		}

		if ( $query['claimed'] === TRUE ) {
			$sql .= " AND p.post_password != ''";
		} elseif ( $query['claimed'] === FALSE ) {
			$sql .= " AND p.post_password = ''";
		} elseif ( !is_null($query['claimed']) ) {
			$sql .= " AND p.post_password = %s";
			$sql_params[] = $query['claimed'];
		}

		if ( ! empty( $query['search'] ) ) {
			$sql .= " AND (p.post_title LIKE %s OR p.post_content LIKE %s OR p.post_password LIKE %s)";
			for( $i = 0; $i < 3; $i++ ) {
				$sql_params[] = sprintf( '%%%s%%', $query['search'] );
			}
		}

		if ( 'select' === $select_or_count ) {
			switch ( $query['orderby'] ) {
				case 'hook':
					$orderby = 'p.post_title';
					break;
				case 'group':
					$orderby = 't.name';
					break;
				case 'status':
					$orderby = 'p.post_status';
					break;
				case 'modified':
					$orderby = 'p.post_modified';
					break;
				case 'claim_id':
					$orderby = 'p.post_password';
					break;
				case 'schedule':
				case 'date':
				default:
					$orderby = 'p.post_date_gmt';
					break;
			}
			if ( 'ASC' === strtoupper( $query['order'] ) ) {
				$order = 'ASC';
			} else {
				$order = 'DESC';
			}
			$sql .= " ORDER BY $orderby $order";
			if ( $query['per_page'] > 0 ) {
				$sql .= " LIMIT %d, %d";
				$sql_params[] = $query['offset'];
				$sql_params[] = $query['per_page'];
			}
		}

		return $wpdb->prepare( $sql, $sql_params );
	}

	/**
	 * Query for action count or list of action IDs.
	 *
	 * @since x.x.x $query['status'] accepts array of statuses instead of a single status.
	 *
	 * @see ActionScheduler_Store::query_actions for $query arg usage.
	 *
	 * @param array  $query      Query filtering options.
	 * @param string $query_type Whether to select or count the results. Defaults to select.
	 *
	 * @return string|array|null The IDs of actions matching the query. Null on failure.
	 */
	public function query_actions( $query = array(), $query_type = 'select' ) {
		/** @var wpdb $wpdb */
		global $wpdb;

		$sql = $this->get_query_actions_sql( $query, $query_type );

		return ( 'count' === $query_type ) ? $wpdb->get_var( $sql ) : $wpdb->get_col( $sql );
	}

	/**
	 * Get a count of all actions in the store, grouped by status
	 *
	 * @return array
	 */
	public function action_counts() {

		$action_counts_by_status = array();
		$action_stati_and_labels = $this->get_status_labels();
		$posts_count_by_status   = (array) wp_count_posts( self::POST_TYPE, 'readable' );

		foreach ( $posts_count_by_status as $post_status_name => $count ) {

			try {
				$action_status_name = $this->get_action_status_by_post_status( $post_status_name );
			} catch ( Exception $e ) {
				// Ignore any post statuses that aren't for actions
				continue;
			}
			if ( array_key_exists( $action_status_name, $action_stati_and_labels ) ) {
				$action_counts_by_status[ $action_status_name ] = $count;
			}
		}

		return $action_counts_by_status;
	}

	/**
	 * @param string $action_id
	 *
	 * @throws InvalidArgumentException
	 */
	public function cancel_action( $action_id ) {
		$post = get_post( $action_id );
		if ( empty( $post ) || ( $post->post_type != self::POST_TYPE ) ) {
			throw new InvalidArgumentException( sprintf( __( 'Unidentified action %s', 'woocommerce' ), $action_id ) );
		}
		do_action( 'action_scheduler_canceled_action', $action_id );
		add_filter( 'pre_wp_unique_post_slug', array( $this, 'set_unique_post_slug' ), 10, 5 );
		wp_trash_post( $action_id );
		remove_filter( 'pre_wp_unique_post_slug', array( $this, 'set_unique_post_slug' ), 10 );
	}

	public function delete_action( $action_id ) {
		$post = get_post( $action_id );
		if ( empty( $post ) || ( $post->post_type != self::POST_TYPE ) ) {
			throw new InvalidArgumentException( sprintf( __( 'Unidentified action %s', 'woocommerce' ), $action_id ) );
		}
		do_action( 'action_scheduler_deleted_action', $action_id );

		wp_delete_post( $action_id, TRUE );
	}

	/**
	 * @param string $action_id
	 *
	 * @throws InvalidArgumentException
	 * @return ActionScheduler_DateTime The date the action is schedule to run, or the date that it ran.
	 */
	public function get_date( $action_id ) {
		$next = $this->get_date_gmt( $action_id );
		return ActionScheduler_TimezoneHelper::set_local_timezone( $next );
	}

	/**
	 * @param string $action_id
	 *
	 * @throws InvalidArgumentException
	 * @return ActionScheduler_DateTime The date the action is schedule to run, or the date that it ran.
	 */
	public function get_date_gmt( $action_id ) {
		$post = get_post( $action_id );
		if ( empty( $post ) || ( $post->post_type != self::POST_TYPE ) ) {
			throw new InvalidArgumentException( sprintf( __( 'Unidentified action %s', 'woocommerce' ), $action_id ) );
		}
		if ( $post->post_status == 'publish' ) {
			return as_get_datetime_object( $post->post_modified_gmt );
		} else {
			return as_get_datetime_object( $post->post_date_gmt );
		}
	}

	/**
	 * @param int      $max_actions
	 * @param DateTime $before_date Jobs must be schedule before this date. Defaults to now.
	 * @param array    $hooks       Claim only actions with a hook or hooks.
	 * @param string   $group       Claim only actions in the given group.
	 *
	 * @return ActionScheduler_ActionClaim
	 * @throws RuntimeException When there is an error staking a claim.
	 * @throws InvalidArgumentException When the given group is not valid.
	 */
	public function stake_claim( $max_actions = 10, DateTime $before_date = null, $hooks = array(), $group = '' ) {
		$this->claim_before_date = $before_date;
		$claim_id = $this->generate_claim_id();
		$this->claim_actions( $claim_id, $max_actions, $before_date, $hooks, $group );
		$action_ids = $this->find_actions_by_claim_id( $claim_id );
		$this->claim_before_date = null;

		return new ActionScheduler_ActionClaim( $claim_id, $action_ids );
	}

	/**
	 * @return int
	 */
	public function get_claim_count(){
		global $wpdb;

		$sql = "SELECT COUNT(DISTINCT post_password) FROM {$wpdb->posts} WHERE post_password != '' AND post_type = %s AND post_status IN ('in-progress','pending')";
		$sql = $wpdb->prepare( $sql, array( self::POST_TYPE ) );

		return $wpdb->get_var( $sql );
	}

	protected function generate_claim_id() {
		$claim_id = md5(microtime(true) . rand(0,1000));
		return substr($claim_id, 0, 20); // to fit in db field with 20 char limit
	}

	/**
	 * @param string   $claim_id
	 * @param int      $limit
	 * @param DateTime $before_date Should use UTC timezone.
	 * @param array    $hooks       Claim only actions with a hook or hooks.
	 * @param string   $group       Claim only actions in the given group.
	 *
	 * @return int The number of actions that were claimed
	 * @throws RuntimeException When there is a database error.
	 * @throws InvalidArgumentException When the group is invalid.
	 */
	protected function claim_actions( $claim_id, $limit, DateTime $before_date = null, $hooks = array(), $group = '' ) {
		// Set up initial variables.
		$date      = null === $before_date ? as_get_datetime_object() : clone $before_date;
		$limit_ids = ! empty( $group );
		$ids       = $limit_ids ? $this->get_actions_by_group( $group, $limit, $date ) : array();

		// If limiting by IDs and no posts found, then return early since we have nothing to update.
		if ( $limit_ids && 0 === count( $ids ) ) {
			return 0;
		}

		/** @var wpdb $wpdb */
		global $wpdb;

		/*
		 * Build up custom query to update the affected posts. Parameters are built as a separate array
		 * to make it easier to identify where they are in the query.
		 *
		 * We can't use $wpdb->update() here because of the "ID IN ..." clause.
		 */
		$update = "UPDATE {$wpdb->posts} SET post_password = %s, post_modified_gmt = %s, post_modified = %s";
		$params = array(
			$claim_id,
			current_time( 'mysql', true ),
			current_time( 'mysql' ),
		);

		// Build initial WHERE clause.
		$where    = "WHERE post_type = %s AND post_status = %s AND post_password = ''";
		$params[] = self::POST_TYPE;
		$params[] = ActionScheduler_Store::STATUS_PENDING;

		if ( ! empty( $hooks ) ) {
			$placeholders = array_fill( 0, count( $hooks ), '%s' );
			$where       .= ' AND post_title IN (' . join( ', ', $placeholders ) . ')';
			$params       = array_merge( $params, array_values( $hooks ) );
		}

		/*
		 * Add the IDs to the WHERE clause. IDs not escaped because they came directly from a prior DB query.
		 *
		 * If we're not limiting by IDs, then include the post_date_gmt clause.
		 */
		if ( $limit_ids ) {
			$where .= ' AND ID IN (' . join( ',', $ids ) . ')';
		} else {
			$where .= ' AND post_date_gmt <= %s';
			$params[] = $date->format( 'Y-m-d H:i:s' );
		}

		// Add the ORDER BY clause and,ms limit.
		$order    = 'ORDER BY menu_order ASC, post_date_gmt ASC, ID ASC LIMIT %d';
		$params[] = $limit;

		// Run the query and gather results.
		$rows_affected = $wpdb->query( $wpdb->prepare( "{$update} {$where} {$order}", $params ) );
		if ( $rows_affected === false ) {
			throw new RuntimeException( __( 'Unable to claim actions. Database error.', 'woocommerce' ) );
		}

		return (int) $rows_affected;
	}

	/**
	 * Get IDs of actions within a certain group and up to a certain date/time.
	 *
	 * @param string   $group The group to use in finding actions.
	 * @param int      $limit The number of actions to retrieve.
	 * @param DateTime $date  DateTime object representing cutoff time for actions. Actions retrieved will be
	 *                        up to and including this DateTime.
	 *
	 * @return array IDs of actions in the appropriate group and before the appropriate time.
	 * @throws InvalidArgumentException When the group does not exist.
	 */
	protected function get_actions_by_group( $group, $limit, DateTime $date ) {
		// Ensure the group exists before continuing.
		if ( ! term_exists( $group, self::GROUP_TAXONOMY )) {
			throw new InvalidArgumentException( sprintf( __( 'The group "%s" does not exist.', 'woocommerce' ), $group ) );
		}

		// Set up a query for post IDs to use later.
		$query      = new WP_Query();
		$query_args = array(
			'fields'           => 'ids',
			'post_type'        => self::POST_TYPE,
			'post_status'      => ActionScheduler_Store::STATUS_PENDING,
			'has_password'     => false,
			'posts_per_page'   => $limit * 3,
			'suppress_filters' => true,
			'no_found_rows'    => true,
			'orderby'          => array(
				'menu_order' => 'ASC',
				'date'       => 'ASC',
				'ID'         => 'ASC',
			),
			'date_query'       => array(
				'column' => 'post_date_gmt',
				'before' => $date->format( 'Y-m-d H:i' ),
				'inclusive' => true,
			),
			'tax_query' => array(
				array(
					'taxonomy'         => self::GROUP_TAXONOMY,
					'field'            => 'slug',
					'terms'            => $group,
					'include_children' => false,
				),
			),
		);

		return $query->query( $query_args );
	}

	/**
	 * @param string $claim_id
	 * @return array
	 */
	public function find_actions_by_claim_id( $claim_id ) {
		/** @var wpdb $wpdb */
		global $wpdb;

		$sql = "SELECT ID, post_date_gmt FROM {$wpdb->posts} WHERE post_type = %s AND post_password = %s";
		$sql = $wpdb->prepare( $sql, array( self::POST_TYPE, $claim_id ) );

		$action_ids  = array();
		$before_date = isset( $this->claim_before_date ) ? $this->claim_before_date : as_get_datetime_object();
		$cut_off     = $before_date->format( 'Y-m-d H:i:s' );

		// Verify that the scheduled date for each action is within the expected bounds (in some unusual
		// cases, we cannot depend on MySQL to honor all of the WHERE conditions we specify).
		foreach ( $wpdb->get_results( $sql ) as $claimed_action ) {
			if ( $claimed_action->post_date_gmt <= $cut_off ) {
				$action_ids[] = absint( $claimed_action->ID );
			}
		}

		return $action_ids;
	}

	public function release_claim( ActionScheduler_ActionClaim $claim ) {
		$action_ids = $this->find_actions_by_claim_id( $claim->get_id() );
		if ( empty( $action_ids ) ) {
			return; // nothing to do
		}
		$action_id_string = implode( ',', array_map( 'intval', $action_ids ) );
		/** @var wpdb $wpdb */
		global $wpdb;
		$sql = "UPDATE {$wpdb->posts} SET post_password = '' WHERE ID IN ($action_id_string) AND post_password = %s";
		$sql = $wpdb->prepare( $sql, array( $claim->get_id() ) );
		$result = $wpdb->query( $sql );
		if ( $result === false ) {
			/* translators: %s: claim ID */
			throw new RuntimeException( sprintf( __( 'Unable to unlock claim %s. Database error.', 'woocommerce' ), $claim->get_id() ) );
		}
	}

	/**
	 * @param string $action_id
	 */
	public function unclaim_action( $action_id ) {
		/** @var wpdb $wpdb */
		global $wpdb;
		$sql = "UPDATE {$wpdb->posts} SET post_password = '' WHERE ID = %d AND post_type = %s";
		$sql = $wpdb->prepare( $sql, $action_id, self::POST_TYPE );
		$result = $wpdb->query( $sql );
		if ( $result === false ) {
			/* translators: %s: action ID */
			throw new RuntimeException( sprintf( __( 'Unable to unlock claim on action %s. Database error.', 'woocommerce' ), $action_id ) );
		}
	}

	public function mark_failure( $action_id ) {
		/** @var wpdb $wpdb */
		global $wpdb;
		$sql = "UPDATE {$wpdb->posts} SET post_status = %s WHERE ID = %d AND post_type = %s";
		$sql = $wpdb->prepare( $sql, self::STATUS_FAILED, $action_id, self::POST_TYPE );
		$result = $wpdb->query( $sql );
		if ( $result === false ) {
			/* translators: %s: action ID */
			throw new RuntimeException( sprintf( __( 'Unable to mark failure on action %s. Database error.', 'woocommerce' ), $action_id ) );
		}
	}

	/**
	 * Return an action's claim ID, as stored in the post password column
	 *
	 * @param string $action_id
	 * @return mixed
	 */
	public function get_claim_id( $action_id ) {
		return $this->get_post_column( $action_id, 'post_password' );
	}

	/**
	 * Return an action's status, as stored in the post status column
	 *
	 * @param string $action_id
	 * @return mixed
	 */
	public function get_status( $action_id ) {
		$status = $this->get_post_column( $action_id, 'post_status' );

		if ( $status === null ) {
			throw new InvalidArgumentException( __( 'Invalid action ID. No status found.', 'woocommerce' ) );
		}

		return $this->get_action_status_by_post_status( $status );
	}

	private function get_post_column( $action_id, $column_name ) {
		/** @var \wpdb $wpdb */
		global $wpdb;
		return $wpdb->get_var( $wpdb->prepare( "SELECT {$column_name} FROM {$wpdb->posts} WHERE ID=%d AND post_type=%s", $action_id, self::POST_TYPE ) );
	}

	/**
	 * @param string $action_id
	 */
	public function log_execution( $action_id ) {
		/** @var wpdb $wpdb */
		global $wpdb;

		$sql = "UPDATE {$wpdb->posts} SET menu_order = menu_order+1, post_status=%s, post_modified_gmt = %s, post_modified = %s WHERE ID = %d AND post_type = %s";
		$sql = $wpdb->prepare( $sql, self::STATUS_RUNNING, current_time('mysql', true), current_time('mysql'), $action_id, self::POST_TYPE );
		$wpdb->query($sql);
	}

	/**
	 * Record that an action was completed.
	 *
	 * @param int $action_id ID of the completed action.
	 * @throws InvalidArgumentException|RuntimeException
	 */
	public function mark_complete( $action_id ) {
		$post = get_post( $action_id );
		if ( empty( $post ) || ( $post->post_type != self::POST_TYPE ) ) {
			throw new InvalidArgumentException( sprintf( __( 'Unidentified action %s', 'woocommerce' ), $action_id ) );
		}
		add_filter( 'wp_insert_post_data', array( $this, 'filter_insert_post_data' ), 10, 1 );
		add_filter( 'pre_wp_unique_post_slug', array( $this, 'set_unique_post_slug' ), 10, 5 );
		$result = wp_update_post(array(
			'ID' => $action_id,
			'post_status' => 'publish',
		), TRUE);
		remove_filter( 'wp_insert_post_data', array( $this, 'filter_insert_post_data' ), 10 );
		remove_filter( 'pre_wp_unique_post_slug', array( $this, 'set_unique_post_slug' ), 10 );
		if ( is_wp_error( $result ) ) {
			throw new RuntimeException( $result->get_error_message() );
		}
	}

	/**
	 * Mark action as migrated when there is an error deleting the action.
	 *
	 * @param int $action_id Action ID.
	 */
	public function mark_migrated( $action_id ) {
		wp_update_post(
			array(
				'ID'          => $action_id,
				'post_status' => 'migrated'
			)
		);
	}

	/**
	 * Determine whether the post store can be migrated.
	 *
	 * @return bool
	 */
	public function migration_dependencies_met( $setting ) {
		global $wpdb;

		$dependencies_met = get_transient( self::DEPENDENCIES_MET );
		if ( empty( $dependencies_met ) ) {
			$maximum_args_length = apply_filters( 'action_scheduler_maximum_args_length', 191 );
			$found_action        = $wpdb->get_var(
				$wpdb->prepare(
					"SELECT ID FROM {$wpdb->posts} WHERE post_type = %s AND CHAR_LENGTH(post_content) > %d LIMIT 1",
					$maximum_args_length,
					self::POST_TYPE
				)
			);
			$dependencies_met = $found_action ? 'no' : 'yes';
			set_transient( self::DEPENDENCIES_MET, $dependencies_met, DAY_IN_SECONDS );
		}

		return 'yes' == $dependencies_met ? $setting : false;
	}

	/**
	 * InnoDB indexes have a maximum size of 767 bytes by default, which is only 191 characters with utf8mb4.
	 *
	 * Previously, AS wasn't concerned about args length, as we used the (unindex) post_content column. However,
	 * as we prepare to move to custom tables, and can use an indexed VARCHAR column instead, we want to warn
	 * developers of this impending requirement.
	 *
	 * @param ActionScheduler_Action $action
	 */
	protected function validate_action( ActionScheduler_Action $action ) {
		try {
			parent::validate_action( $action );
		} catch ( Exception $e ) {
			$message = sprintf( __( '%s Support for strings longer than this will be removed in a future version.', 'woocommerce' ), $e->getMessage() );
			_doing_it_wrong( 'ActionScheduler_Action::$args', $message, '2.1.0' );
		}
	}

	/**
	 * @codeCoverageIgnore
	 */
	public function init() {
		add_filter( 'action_scheduler_migration_dependencies_met', array( $this, 'migration_dependencies_met' ) );

		$post_type_registrar = new ActionScheduler_wpPostStore_PostTypeRegistrar();
		$post_type_registrar->register();

		$post_status_registrar = new ActionScheduler_wpPostStore_PostStatusRegistrar();
		$post_status_registrar->register();

		$taxonomy_registrar = new ActionScheduler_wpPostStore_TaxonomyRegistrar();
		$taxonomy_registrar->register();
	}
}
action-scheduler/classes/ActionScheduler_WPCommentCleaner.php000064400000010456151335517650020463 0ustar00<?php

/**
 * Class ActionScheduler_WPCommentCleaner
 *
 * @since 3.0.0
 */
class ActionScheduler_WPCommentCleaner {

	/**
	 * Post migration hook used to cleanup the WP comment table.
	 *
	 * @var string
	 */
	protected static $cleanup_hook = 'action_scheduler/cleanup_wp_comment_logs';

	/**
	 * An instance of the ActionScheduler_wpCommentLogger class to interact with the comments table.
	 *
	 * This instance should only be used as an interface. It should not be initialized.
	 *
	 * @var ActionScheduler_wpCommentLogger
	 */
	protected static $wp_comment_logger = null;

	/**
	 * The key used to store the cached value of whether there are logs in the WP comment table.
	 *
	 * @var string
	 */
	protected static $has_logs_option_key = 'as_has_wp_comment_logs';

	/**
	 * Initialize the class and attach callbacks.
	 */
	public static function init() {
		if ( empty( self::$wp_comment_logger ) ) {
			self::$wp_comment_logger = new ActionScheduler_wpCommentLogger();
		}

		add_action( self::$cleanup_hook, array( __CLASS__, 'delete_all_action_comments' ) );

		// While there are orphaned logs left in the comments table, we need to attach the callbacks which filter comment counts.
		add_action( 'pre_get_comments', array( self::$wp_comment_logger, 'filter_comment_queries' ), 10, 1 );
		add_action( 'wp_count_comments', array( self::$wp_comment_logger, 'filter_comment_count' ), 20, 2 ); // run after WC_Comments::wp_count_comments() to make sure we exclude order notes and action logs
		add_action( 'comment_feed_where', array( self::$wp_comment_logger, 'filter_comment_feed' ), 10, 2 );

		// Action Scheduler may be displayed as a Tools screen or WooCommerce > Status administration screen
		add_action( 'load-tools_page_action-scheduler', array( __CLASS__, 'register_admin_notice' ) );
		add_action( 'load-woocommerce_page_wc-status', array( __CLASS__, 'register_admin_notice' ) );
	}

	/**
	 * Determines if there are log entries in the wp comments table.
	 *
	 * Uses the flag set on migration completion set by @see self::maybe_schedule_cleanup().
	 *
	 * @return boolean Whether there are scheduled action comments in the comments table.
	 */
	public static function has_logs() {
		return 'yes' === get_option( self::$has_logs_option_key );
	}

	/**
	 * Schedules the WP Post comment table cleanup to run in 6 months if it's not already scheduled.
	 * Attached to the migration complete hook 'action_scheduler/migration_complete'.
	 */
	public static function maybe_schedule_cleanup() {
		if ( (bool) get_comments( array( 'type' => ActionScheduler_wpCommentLogger::TYPE, 'number' => 1, 'fields' => 'ids' ) ) ) {
			update_option( self::$has_logs_option_key, 'yes' );

			if ( ! as_next_scheduled_action( self::$cleanup_hook ) ) {
				as_schedule_single_action( gmdate( 'U' ) + ( 6 * MONTH_IN_SECONDS ), self::$cleanup_hook );
			}
		}
	}

	/**
	 * Delete all action comments from the WP Comments table.
	 */
	public static function delete_all_action_comments() {
		global $wpdb;
		$wpdb->delete( $wpdb->comments, array( 'comment_type' => ActionScheduler_wpCommentLogger::TYPE, 'comment_agent' => ActionScheduler_wpCommentLogger::AGENT ) );
		delete_option( self::$has_logs_option_key );
	}

	/**
	 * Registers admin notices about the orphaned action logs.
	 */
	public static function register_admin_notice() {
		add_action( 'admin_notices', array( __CLASS__, 'print_admin_notice' ) );
	}
	
	/**
	 * Prints details about the orphaned action logs and includes information on where to learn more.
	 */
	public static function print_admin_notice() {
		$next_cleanup_message        = '';
		$next_scheduled_cleanup_hook = as_next_scheduled_action( self::$cleanup_hook );

		if ( $next_scheduled_cleanup_hook ) {
			/* translators: %s: date interval */
			$next_cleanup_message = sprintf( __( 'This data will be deleted in %s.', 'woocommerce' ), human_time_diff( gmdate( 'U' ), $next_scheduled_cleanup_hook ) );
		}

		$notice = sprintf(
			/* translators: 1: next cleanup message 2: github issue URL */
			__( 'Action Scheduler has migrated data to custom tables; however, orphaned log entries exist in the WordPress Comments table. %1$s <a href="%2$s">Learn more &raquo;</a>', 'woocommerce' ),
			$next_cleanup_message,
			'https://github.com/woocommerce/action-scheduler/issues/368'
		);

		echo '<div class="notice notice-warning"><p>' . wp_kses_post( $notice ) . '</p></div>';
	}
}
action-scheduler/readme.txt000064400000010474151335517650012014 0ustar00=== Action Scheduler ===
Contributors: Automattic, wpmuguru, claudiosanches, peterfabian1000, vedjain, jamosova, obliviousharmony, konamiman, sadowski, royho, barryhughes-1
Tags: scheduler, cron
Requires at least: 5.2
Tested up to: 5.7
Stable tag: 3.3.0
License: GPLv3
Requires PHP: 5.6

Action Scheduler - Job Queue for WordPress

== Description ==

Action Scheduler is a scalable, traceable job queue for background processing large sets of actions in WordPress. It's specially designed to be distributed in WordPress plugins.

Action Scheduler works by triggering an action hook to run at some time in the future. Each hook can be scheduled with unique data, to allow callbacks to perform operations on that data. The hook can also be scheduled to run on one or more occassions.

Think of it like an extension to `do_action()` which adds the ability to delay and repeat a hook.

## Battle-Tested Background Processing

Every month, Action Scheduler processes millions of payments for [Subscriptions](https://woocommerce.com/products/woocommerce-subscriptions/), webhooks for [WooCommerce](https://wordpress.org/plugins/woocommerce/), as well as emails and other events for a range of other plugins.

It's been seen on live sites processing queues in excess of 50,000 jobs and doing resource intensive operations, like processing payments and creating orders, at a sustained rate of over 10,000 / hour without negatively impacting normal site operations.

This is all on infrastructure and WordPress sites outside the control of the plugin author.

If your plugin needs background processing, especially of large sets of tasks, Action Scheduler can help.

## Learn More

To learn more about how to Action Scheduler works, and how to use it in your plugin, check out the docs on [ActionScheduler.org](https://actionscheduler.org).

There you will find:

* [Usage guide](https://actionscheduler.org/usage/): instructions on installing and using Action Scheduler
* [WP CLI guide](https://actionscheduler.org/wp-cli/): instructions on running Action Scheduler at scale via WP CLI
* [API Reference](https://actionscheduler.org/api/): complete reference guide for all API functions
* [Administration Guide](https://actionscheduler.org/admin/): guide to managing scheduled actions via the administration screen
* [Guide to Background Processing at Scale](https://actionscheduler.org/perf/): instructions for running Action Scheduler at scale via the default WP Cron queue runner

## Credits

Action Scheduler is developed and maintained by [Automattic](http://automattic.com/) with significant early development completed by [Flightless](https://flightless.us/).

Collaboration is cool. We'd love to work with you to improve Action Scheduler. [Pull Requests](https://github.com/woocommerce/action-scheduler/pulls) welcome.

== Changelog ==

= 3.3.0 - 2021-09-15 =
* Enhancement - Adds as_has_scheduled_action() to provide a performant way to test for existing actions. #645
* Fix - Improves compatibility with environments where NO_ZERO_DATE is enabled. #519
* Fix - Adds safety checks to guard against errors when our database tables cannot be created. #645
* Dev - Now supports queries that use multiple statuses. #649
* Dev - Minimum requirements for WordPress and PHP bumped (to 5.2 and 5.6 respectively). #723

= 3.2.1 - 2021-06-21 =
* Fix - Add extra safety/account for different versions of AS and different loading patterns. #714
* Fix - Handle hidden columns (Tools → Scheduled Actions) | #600.

= 3.2.0 - 2021-06-03 =
* Fix - Add "no ordering" option to as_next_scheduled_action().
* Fix - Add secondary scheduled date checks when claiming actions (DBStore) | #634.
* Fix - Add secondary scheduled date checks when claiming actions (wpPostStore) | #634.
* Fix - Adds a new index to the action table, reducing the potential for deadlocks (props: @glagonikas).
* Fix - Fix unit tests infrastructure and adapt tests to PHP 8.
* Fix - Identify in-use data store.
* Fix - Improve test_migration_is_scheduled.
* Fix - PHP notice on list table.
* Fix - Speed up clean up and batch selects.
* Fix - Update pending dependencies.
* Fix - [PHP 8.0] Only pass action arg values through to do_action_ref_array().
* Fix - [PHP 8] Set the PHP version to 7.1 in composer.json for PHP 8 compatibility.
* Fix - add is_initialized() to docs.
* Fix - fix file permissions.
* Fix - fixes #664 by replacing __ with esc_html__.
action-scheduler/lib/cron-expression/LICENSE000064400000002112151335517650014715 0ustar00Copyright (c) 2011 Michael Dowling <mtdowling@gmail.com> and contributors

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.
action-scheduler/lib/cron-expression/CronExpression_DayOfMonthField.php000064400000007014151335517650022444 0ustar00<?php

/**
 * Day of month field.  Allows: * , / - ? L W
 *
 * 'L' stands for "last" and specifies the last day of the month.
 *
 * The 'W' character is used to specify the weekday (Monday-Friday) nearest the
 * given day. As an example, if you were to specify "15W" as the value for the
 * day-of-month field, the meaning is: "the nearest weekday to the 15th of the
 * month". So if the 15th is a Saturday, the trigger will fire on Friday the
 * 14th. If the 15th is a Sunday, the trigger will fire on Monday the 16th. If
 * the 15th is a Tuesday, then it will fire on Tuesday the 15th. However if you
 * specify "1W" as the value for day-of-month, and the 1st is a Saturday, the
 * trigger will fire on Monday the 3rd, as it will not 'jump' over the boundary
 * of a month's days. The 'W' character can only be specified when the
 * day-of-month is a single day, not a range or list of days.
 *
 * @author Michael Dowling <mtdowling@gmail.com>
 */
class CronExpression_DayOfMonthField extends CronExpression_AbstractField
{
    /**
     * Get the nearest day of the week for a given day in a month
     *
     * @param int $currentYear  Current year
     * @param int $currentMonth Current month
     * @param int $targetDay    Target day of the month
     *
     * @return DateTime Returns the nearest date
     */
    private static function getNearestWeekday($currentYear, $currentMonth, $targetDay)
    {
        $tday = str_pad($targetDay, 2, '0', STR_PAD_LEFT);
        $target = new DateTime("$currentYear-$currentMonth-$tday");
        $currentWeekday = (int) $target->format('N');

        if ($currentWeekday < 6) {
            return $target;
        }

        $lastDayOfMonth = $target->format('t');

        foreach (array(-1, 1, -2, 2) as $i) {
            $adjusted = $targetDay + $i;
            if ($adjusted > 0 && $adjusted <= $lastDayOfMonth) {
                $target->setDate($currentYear, $currentMonth, $adjusted);
                if ($target->format('N') < 6 && $target->format('m') == $currentMonth) {
                    return $target;
                }
            }
        }
    }

    /**
     * {@inheritdoc}
     */
    public function isSatisfiedBy(DateTime $date, $value)
    {
        // ? states that the field value is to be skipped
        if ($value == '?') {
            return true;
        }

        $fieldValue = $date->format('d');

        // Check to see if this is the last day of the month
        if ($value == 'L') {
            return $fieldValue == $date->format('t');
        }

        // Check to see if this is the nearest weekday to a particular value
        if (strpos($value, 'W')) {
            // Parse the target day
            $targetDay = substr($value, 0, strpos($value, 'W'));
            // Find out if the current day is the nearest day of the week
            return $date->format('j') == self::getNearestWeekday(
                $date->format('Y'),
                $date->format('m'),
                $targetDay
            )->format('j');
        }

        return $this->isSatisfied($date->format('d'), $value);
    }

    /**
     * {@inheritdoc}
     */
    public function increment(DateTime $date, $invert = false)
    {
        if ($invert) {
            $date->modify('previous day');
            $date->setTime(23, 59);
        } else {
            $date->modify('next day');
            $date->setTime(0, 0);
        }

        return $this;
    }

    /**
     * {@inheritdoc}
     */
    public function validate($value)
    {
        return (bool) preg_match('/[\*,\/\-\?LW0-9A-Za-z]+/', $value);
    }
}
action-scheduler/lib/cron-expression/CronExpression_MinutesField.php000064400000001371151335517650022060 0ustar00<?php

/**
 * Minutes field.  Allows: * , / -
 *
 * @author Michael Dowling <mtdowling@gmail.com>
 */
class CronExpression_MinutesField extends CronExpression_AbstractField
{
    /**
     * {@inheritdoc}
     */
    public function isSatisfiedBy(DateTime $date, $value)
    {
        return $this->isSatisfied($date->format('i'), $value);
    }

    /**
     * {@inheritdoc}
     */
    public function increment(DateTime $date, $invert = false)
    {
        if ($invert) {
            $date->modify('-1 minute');
        } else {
            $date->modify('+1 minute');
        }

        return $this;
    }

    /**
     * {@inheritdoc}
     */
    public function validate($value)
    {
        return (bool) preg_match('/[\*,\/\-0-9]+/', $value);
    }
}
action-scheduler/lib/cron-expression/CronExpression.php000064400000026536151335517650017422 0ustar00<?php

/**
 * CRON expression parser that can determine whether or not a CRON expression is
 * due to run, the next run date and previous run date of a CRON expression.
 * The determinations made by this class are accurate if checked run once per
 * minute (seconds are dropped from date time comparisons).
 *
 * Schedule parts must map to:
 * minute [0-59], hour [0-23], day of month, month [1-12|JAN-DEC], day of week
 * [1-7|MON-SUN], and an optional year.
 *
 * @author Michael Dowling <mtdowling@gmail.com>
 * @link http://en.wikipedia.org/wiki/Cron
 */
class CronExpression
{
    const MINUTE = 0;
    const HOUR = 1;
    const DAY = 2;
    const MONTH = 3;
    const WEEKDAY = 4;
    const YEAR = 5;

    /**
     * @var array CRON expression parts
     */
    private $cronParts;

    /**
     * @var CronExpression_FieldFactory CRON field factory
     */
    private $fieldFactory;

    /**
     * @var array Order in which to test of cron parts
     */
    private static $order = array(self::YEAR, self::MONTH, self::DAY, self::WEEKDAY, self::HOUR, self::MINUTE);

    /**
     * Factory method to create a new CronExpression.
     *
     * @param string $expression The CRON expression to create.  There are
     *      several special predefined values which can be used to substitute the
     *      CRON expression:
     *
     *      @yearly, @annually) - Run once a year, midnight, Jan. 1 - 0 0 1 1 *
     *      @monthly - Run once a month, midnight, first of month - 0 0 1 * *
     *      @weekly - Run once a week, midnight on Sun - 0 0 * * 0
     *      @daily - Run once a day, midnight - 0 0 * * *
     *      @hourly - Run once an hour, first minute - 0 * * * *
     *
*@param CronExpression_FieldFactory $fieldFactory (optional) Field factory to use
     *
     * @return CronExpression
     */
    public static function factory($expression, CronExpression_FieldFactory $fieldFactory = null)
    {
        $mappings = array(
            '@yearly' => '0 0 1 1 *',
            '@annually' => '0 0 1 1 *',
            '@monthly' => '0 0 1 * *',
            '@weekly' => '0 0 * * 0',
            '@daily' => '0 0 * * *',
            '@hourly' => '0 * * * *'
        );

        if (isset($mappings[$expression])) {
            $expression = $mappings[$expression];
        }

        return new self($expression, $fieldFactory ? $fieldFactory : new CronExpression_FieldFactory());
    }

    /**
     * Parse a CRON expression
     *
     * @param string       $expression   CRON expression (e.g. '8 * * * *')
     * @param CronExpression_FieldFactory $fieldFactory Factory to create cron fields
     */
    public function __construct($expression, CronExpression_FieldFactory $fieldFactory)
    {
        $this->fieldFactory = $fieldFactory;
        $this->setExpression($expression);
    }

    /**
     * Set or change the CRON expression
     *
     * @param string $value CRON expression (e.g. 8 * * * *)
     *
     * @return CronExpression
     * @throws InvalidArgumentException if not a valid CRON expression
     */
    public function setExpression($value)
    {
        $this->cronParts = preg_split('/\s/', $value, -1, PREG_SPLIT_NO_EMPTY);
        if (count($this->cronParts) < 5) {
            throw new InvalidArgumentException(
                $value . ' is not a valid CRON expression'
            );
        }

        foreach ($this->cronParts as $position => $part) {
            $this->setPart($position, $part);
        }

        return $this;
    }

    /**
     * Set part of the CRON expression
     *
     * @param int    $position The position of the CRON expression to set
     * @param string $value    The value to set
     *
     * @return CronExpression
     * @throws InvalidArgumentException if the value is not valid for the part
     */
    public function setPart($position, $value)
    {
        if (!$this->fieldFactory->getField($position)->validate($value)) {
            throw new InvalidArgumentException(
                'Invalid CRON field value ' . $value . ' as position ' . $position
            );
        }

        $this->cronParts[$position] = $value;

        return $this;
    }

    /**
     * Get a next run date relative to the current date or a specific date
     *
     * @param string|DateTime $currentTime (optional) Relative calculation date
     * @param int             $nth         (optional) Number of matches to skip before returning a
     *     matching next run date.  0, the default, will return the current
     *     date and time if the next run date falls on the current date and
     *     time.  Setting this value to 1 will skip the first match and go to
     *     the second match.  Setting this value to 2 will skip the first 2
     *     matches and so on.
     * @param bool $allowCurrentDate (optional) Set to TRUE to return the
     *     current date if it matches the cron expression
     *
     * @return DateTime
     * @throws RuntimeException on too many iterations
     */
    public function getNextRunDate($currentTime = 'now', $nth = 0, $allowCurrentDate = false)
    {
        return $this->getRunDate($currentTime, $nth, false, $allowCurrentDate);
    }

    /**
     * Get a previous run date relative to the current date or a specific date
     *
     * @param string|DateTime $currentTime      (optional) Relative calculation date
     * @param int             $nth              (optional) Number of matches to skip before returning
     * @param bool            $allowCurrentDate (optional) Set to TRUE to return the
     *     current date if it matches the cron expression
     *
     * @return DateTime
     * @throws RuntimeException on too many iterations
     * @see CronExpression::getNextRunDate
     */
    public function getPreviousRunDate($currentTime = 'now', $nth = 0, $allowCurrentDate = false)
    {
        return $this->getRunDate($currentTime, $nth, true, $allowCurrentDate);
    }

    /**
     * Get multiple run dates starting at the current date or a specific date
     *
     * @param int             $total            Set the total number of dates to calculate
     * @param string|DateTime $currentTime      (optional) Relative calculation date
     * @param bool            $invert           (optional) Set to TRUE to retrieve previous dates
     * @param bool            $allowCurrentDate (optional) Set to TRUE to return the
     *     current date if it matches the cron expression
     *
     * @return array Returns an array of run dates
     */
    public function getMultipleRunDates($total, $currentTime = 'now', $invert = false, $allowCurrentDate = false)
    {
        $matches = array();
        for ($i = 0; $i < max(0, $total); $i++) {
            $matches[] = $this->getRunDate($currentTime, $i, $invert, $allowCurrentDate);
        }

        return $matches;
    }

    /**
     * Get all or part of the CRON expression
     *
     * @param string $part (optional) Specify the part to retrieve or NULL to
     *      get the full cron schedule string.
     *
     * @return string|null Returns the CRON expression, a part of the
     *      CRON expression, or NULL if the part was specified but not found
     */
    public function getExpression($part = null)
    {
        if (null === $part) {
            return implode(' ', $this->cronParts);
        } elseif (array_key_exists($part, $this->cronParts)) {
            return $this->cronParts[$part];
        }

        return null;
    }

    /**
     * Helper method to output the full expression.
     *
     * @return string Full CRON expression
     */
    public function __toString()
    {
        return $this->getExpression();
    }

    /**
     * Determine if the cron is due to run based on the current date or a
     * specific date.  This method assumes that the current number of
     * seconds are irrelevant, and should be called once per minute.
     *
     * @param string|DateTime $currentTime (optional) Relative calculation date
     *
     * @return bool Returns TRUE if the cron is due to run or FALSE if not
     */
    public function isDue($currentTime = 'now')
    {
        if ('now' === $currentTime) {
            $currentDate = date('Y-m-d H:i');
            $currentTime = strtotime($currentDate);
        } elseif ($currentTime instanceof DateTime) {
            $currentDate = $currentTime->format('Y-m-d H:i');
            $currentTime = strtotime($currentDate);
        } else {
            $currentTime = new DateTime($currentTime);
            $currentTime->setTime($currentTime->format('H'), $currentTime->format('i'), 0);
            $currentDate = $currentTime->format('Y-m-d H:i');
            $currentTime = (int)($currentTime->getTimestamp());
        }

        return $this->getNextRunDate($currentDate, 0, true)->getTimestamp() == $currentTime;
    }

    /**
     * Get the next or previous run date of the expression relative to a date
     *
     * @param string|DateTime $currentTime      (optional) Relative calculation date
     * @param int             $nth              (optional) Number of matches to skip before returning
     * @param bool            $invert           (optional) Set to TRUE to go backwards in time
     * @param bool            $allowCurrentDate (optional) Set to TRUE to return the
     *     current date if it matches the cron expression
     *
     * @return DateTime
     * @throws RuntimeException on too many iterations
     */
    protected function getRunDate($currentTime = null, $nth = 0, $invert = false, $allowCurrentDate = false)
    {
        if ($currentTime instanceof DateTime) {
            $currentDate = $currentTime;
        } else {
            $currentDate = new DateTime($currentTime ? $currentTime : 'now');
            $currentDate->setTimezone(new DateTimeZone(date_default_timezone_get()));
        }

        $currentDate->setTime($currentDate->format('H'), $currentDate->format('i'), 0);
        $nextRun = clone $currentDate;
        $nth = (int) $nth;

        // Set a hard limit to bail on an impossible date
        for ($i = 0; $i < 1000; $i++) {

            foreach (self::$order as $position) {
                $part = $this->getExpression($position);
                if (null === $part) {
                    continue;
                }

                $satisfied = false;
                // Get the field object used to validate this part
                $field = $this->fieldFactory->getField($position);
                // Check if this is singular or a list
                if (strpos($part, ',') === false) {
                    $satisfied = $field->isSatisfiedBy($nextRun, $part);
                } else {
                    foreach (array_map('trim', explode(',', $part)) as $listPart) {
                        if ($field->isSatisfiedBy($nextRun, $listPart)) {
                            $satisfied = true;
                            break;
                        }
                    }
                }

                // If the field is not satisfied, then start over
                if (!$satisfied) {
                    $field->increment($nextRun, $invert);
                    continue 2;
                }
            }

            // Skip this match if needed
            if ((!$allowCurrentDate && $nextRun == $currentDate) || --$nth > -1) {
                $this->fieldFactory->getField(0)->increment($nextRun, $invert);
                continue;
            }

            return $nextRun;
        }

        // @codeCoverageIgnoreStart
        throw new RuntimeException('Impossible CRON expression');
        // @codeCoverageIgnoreEnd
    }
}
action-scheduler/lib/cron-expression/CronExpression_FieldInterface.php000064400000002162151335517650022333 0ustar00<?php

/**
 * CRON field interface
 *
 * @author Michael Dowling <mtdowling@gmail.com>
 */
interface CronExpression_FieldInterface
{
    /**
     * Check if the respective value of a DateTime field satisfies a CRON exp
     *
     * @param DateTime $date  DateTime object to check
     * @param string   $value CRON expression to test against
     *
     * @return bool Returns TRUE if satisfied, FALSE otherwise
     */
    public function isSatisfiedBy(DateTime $date, $value);

    /**
     * When a CRON expression is not satisfied, this method is used to increment
     * or decrement a DateTime object by the unit of the cron field
     *
     * @param DateTime $date   DateTime object to change
     * @param bool     $invert (optional) Set to TRUE to decrement
     *
     * @return CronExpression_FieldInterface
     */
    public function increment(DateTime $date, $invert = false);

    /**
     * Validates a CRON expression for a given field
     *
     * @param string $value CRON expression value to validate
     *
     * @return bool Returns TRUE if valid, FALSE otherwise
     */
    public function validate($value);
}
action-scheduler/lib/cron-expression/CronExpression_DayOfWeekField.php000064400000007521151335517650022255 0ustar00<?php

/**
 * Day of week field.  Allows: * / , - ? L #
 *
 * Days of the week can be represented as a number 0-7 (0|7 = Sunday)
 * or as a three letter string: SUN, MON, TUE, WED, THU, FRI, SAT.
 *
 * 'L' stands for "last". It allows you to specify constructs such as
 * "the last Friday" of a given month.
 *
 * '#' is allowed for the day-of-week field, and must be followed by a
 * number between one and five. It allows you to specify constructs such as
 * "the second Friday" of a given month.
 *
 * @author Michael Dowling <mtdowling@gmail.com>
 */
class CronExpression_DayOfWeekField extends CronExpression_AbstractField
{
    /**
     * {@inheritdoc}
     */
    public function isSatisfiedBy(DateTime $date, $value)
    {
        if ($value == '?') {
            return true;
        }

        // Convert text day of the week values to integers
        $value = str_ireplace(
            array('SUN', 'MON', 'TUE', 'WED', 'THU', 'FRI', 'SAT'),
            range(0, 6),
            $value
        );

        $currentYear = $date->format('Y');
        $currentMonth = $date->format('m');
        $lastDayOfMonth = $date->format('t');

        // Find out if this is the last specific weekday of the month
        if (strpos($value, 'L')) {
            $weekday = str_replace('7', '0', substr($value, 0, strpos($value, 'L')));
            $tdate = clone $date;
            $tdate->setDate($currentYear, $currentMonth, $lastDayOfMonth);
            while ($tdate->format('w') != $weekday) {
                $tdate->setDate($currentYear, $currentMonth, --$lastDayOfMonth);
            }

            return $date->format('j') == $lastDayOfMonth;
        }

        // Handle # hash tokens
        if (strpos($value, '#')) {
            list($weekday, $nth) = explode('#', $value);
            // Validate the hash fields
            if ($weekday < 1 || $weekday > 5) {
                throw new InvalidArgumentException("Weekday must be a value between 1 and 5. {$weekday} given");
            }
            if ($nth > 5) {
                throw new InvalidArgumentException('There are never more than 5 of a given weekday in a month');
            }
            // The current weekday must match the targeted weekday to proceed
            if ($date->format('N') != $weekday) {
                return false;
            }

            $tdate = clone $date;
            $tdate->setDate($currentYear, $currentMonth, 1);
            $dayCount = 0;
            $currentDay = 1;
            while ($currentDay < $lastDayOfMonth + 1) {
                if ($tdate->format('N') == $weekday) {
                    if (++$dayCount >= $nth) {
                        break;
                    }
                }
                $tdate->setDate($currentYear, $currentMonth, ++$currentDay);
            }

            return $date->format('j') == $currentDay;
        }

        // Handle day of the week values
        if (strpos($value, '-')) {
            $parts = explode('-', $value);
            if ($parts[0] == '7') {
                $parts[0] = '0';
            } elseif ($parts[1] == '0') {
                $parts[1] = '7';
            }
            $value = implode('-', $parts);
        }

        // Test to see which Sunday to use -- 0 == 7 == Sunday
        $format = in_array(7, str_split($value)) ? 'N' : 'w';
        $fieldValue = $date->format($format);

        return $this->isSatisfied($fieldValue, $value);
    }

    /**
     * {@inheritdoc}
     */
    public function increment(DateTime $date, $invert = false)
    {
        if ($invert) {
            $date->modify('-1 day');
            $date->setTime(23, 59, 0);
        } else {
            $date->modify('+1 day');
            $date->setTime(0, 0, 0);
        }

        return $this;
    }

    /**
     * {@inheritdoc}
     */
    public function validate($value)
    {
        return (bool) preg_match('/[\*,\/\-0-9A-Z]+/', $value);
    }
}
action-scheduler/lib/cron-expression/CronExpression_MonthField.php000064400000002567151335517650021531 0ustar00<?php

/**
 * Month field.  Allows: * , / -
 *
 * @author Michael Dowling <mtdowling@gmail.com>
 */
class CronExpression_MonthField extends CronExpression_AbstractField
{
    /**
     * {@inheritdoc}
     */
    public function isSatisfiedBy(DateTime $date, $value)
    {
        // Convert text month values to integers
        $value = str_ireplace(
            array(
                'JAN', 'FEB', 'MAR', 'APR', 'MAY', 'JUN',
                'JUL', 'AUG', 'SEP', 'OCT', 'NOV', 'DEC'
            ),
            range(1, 12),
            $value
        );

        return $this->isSatisfied($date->format('m'), $value);
    }

    /**
     * {@inheritdoc}
     */
    public function increment(DateTime $date, $invert = false)
    {
        if ($invert) {
            // $date->modify('last day of previous month'); // remove for php 5.2 compat
            $date->modify('previous month');
            $date->modify($date->format('Y-m-t'));
            $date->setTime(23, 59);
        } else {
            //$date->modify('first day of next month'); // remove for php 5.2 compat
            $date->modify('next month');
            $date->modify($date->format('Y-m-01'));
            $date->setTime(0, 0);
        }

        return $this;
    }

    /**
     * {@inheritdoc}
     */
    public function validate($value)
    {
        return (bool) preg_match('/[\*,\/\-0-9A-Z]+/', $value);
    }
}
action-scheduler/lib/cron-expression/CronExpression_AbstractField.php000064400000005020151335517650022172 0ustar00<?php

/**
 * Abstract CRON expression field
 *
 * @author Michael Dowling <mtdowling@gmail.com>
 */
abstract class CronExpression_AbstractField implements CronExpression_FieldInterface
{
    /**
     * Check to see if a field is satisfied by a value
     *
     * @param string $dateValue Date value to check
     * @param string $value     Value to test
     *
     * @return bool
     */
    public function isSatisfied($dateValue, $value)
    {
        if ($this->isIncrementsOfRanges($value)) {
            return $this->isInIncrementsOfRanges($dateValue, $value);
        } elseif ($this->isRange($value)) {
            return $this->isInRange($dateValue, $value);
        }

        return $value == '*' || $dateValue == $value;
    }

    /**
     * Check if a value is a range
     *
     * @param string $value Value to test
     *
     * @return bool
     */
    public function isRange($value)
    {
        return strpos($value, '-') !== false;
    }

    /**
     * Check if a value is an increments of ranges
     *
     * @param string $value Value to test
     *
     * @return bool
     */
    public function isIncrementsOfRanges($value)
    {
        return strpos($value, '/') !== false;
    }

    /**
     * Test if a value is within a range
     *
     * @param string $dateValue Set date value
     * @param string $value     Value to test
     *
     * @return bool
     */
    public function isInRange($dateValue, $value)
    {
        $parts = array_map('trim', explode('-', $value, 2));

        return $dateValue >= $parts[0] && $dateValue <= $parts[1];
    }

    /**
     * Test if a value is within an increments of ranges (offset[-to]/step size)
     *
     * @param string $dateValue Set date value
     * @param string $value     Value to test
     *
     * @return bool
     */
    public function isInIncrementsOfRanges($dateValue, $value)
    {
        $parts = array_map('trim', explode('/', $value, 2));
        $stepSize = isset($parts[1]) ? $parts[1] : 0;
        if ($parts[0] == '*' || $parts[0] === '0') {
            return (int) $dateValue % $stepSize == 0;
        }

        $range = explode('-', $parts[0], 2);
        $offset = $range[0];
        $to = isset($range[1]) ? $range[1] : $dateValue;
        // Ensure that the date value is within the range
        if ($dateValue < $offset || $dateValue > $to) {
            return false;
        }

        for ($i = $offset; $i <= $to; $i+= $stepSize) {
            if ($i == $dateValue) {
                return true;
            }
        }

        return false;
    }
}
action-scheduler/lib/cron-expression/CronExpression_YearField.php000064400000001651151335517650021335 0ustar00<?php

/**
 * Year field.  Allows: * , / -
 *
 * @author Michael Dowling <mtdowling@gmail.com>
 */
class CronExpression_YearField extends CronExpression_AbstractField
{
    /**
     * {@inheritdoc}
     */
    public function isSatisfiedBy(DateTime $date, $value)
    {
        return $this->isSatisfied($date->format('Y'), $value);
    }

    /**
     * {@inheritdoc}
     */
    public function increment(DateTime $date, $invert = false)
    {
        if ($invert) {
            $date->modify('-1 year');
            $date->setDate($date->format('Y'), 12, 31);
            $date->setTime(23, 59, 0);
        } else {
            $date->modify('+1 year');
            $date->setDate($date->format('Y'), 1, 1);
            $date->setTime(0, 0, 0);
        }

        return $this;
    }

    /**
     * {@inheritdoc}
     */
    public function validate($value)
    {
        return (bool) preg_match('/[\*,\/\-0-9]+/', $value);
    }
}
action-scheduler/lib/cron-expression/CronExpression_HoursField.php000064400000002205151335517650021531 0ustar00<?php

/**
 * Hours field.  Allows: * , / -
 *
 * @author Michael Dowling <mtdowling@gmail.com>
 */
class CronExpression_HoursField extends CronExpression_AbstractField
{
    /**
     * {@inheritdoc}
     */
    public function isSatisfiedBy(DateTime $date, $value)
    {
        return $this->isSatisfied($date->format('H'), $value);
    }

    /**
     * {@inheritdoc}
     */
    public function increment(DateTime $date, $invert = false)
    {
        // Change timezone to UTC temporarily. This will
        // allow us to go back or forwards and hour even
        // if DST will be changed between the hours.
        $timezone = $date->getTimezone();
        $date->setTimezone(new DateTimeZone('UTC'));
        if ($invert) {
            $date->modify('-1 hour');
            $date->setTime($date->format('H'), 59);
        } else {
            $date->modify('+1 hour');
            $date->setTime($date->format('H'), 0);
        }
        $date->setTimezone($timezone);

        return $this;
    }

    /**
     * {@inheritdoc}
     */
    public function validate($value)
    {
        return (bool) preg_match('/[\*,\/\-0-9]+/', $value);
    }
}
action-scheduler/lib/cron-expression/CronExpression_FieldFactory.php000064400000003321151335517650022040 0ustar00<?php

/**
 * CRON field factory implementing a flyweight factory
 *
 * @author Michael Dowling <mtdowling@gmail.com>
 * @link http://en.wikipedia.org/wiki/Cron
 */
class CronExpression_FieldFactory
{
    /**
     * @var array Cache of instantiated fields
     */
    private $fields = array();

    /**
     * Get an instance of a field object for a cron expression position
     *
     * @param int $position CRON expression position value to retrieve
     *
     * @return CronExpression_FieldInterface
     * @throws InvalidArgumentException if a position is not valid
     */
    public function getField($position)
    {
        if (!isset($this->fields[$position])) {
            switch ($position) {
                case 0:
                    $this->fields[$position] = new CronExpression_MinutesField();
                    break;
                case 1:
                    $this->fields[$position] = new CronExpression_HoursField();
                    break;
                case 2:
                    $this->fields[$position] = new CronExpression_DayOfMonthField();
                    break;
                case 3:
                    $this->fields[$position] = new CronExpression_MonthField();
                    break;
                case 4:
                    $this->fields[$position] = new CronExpression_DayOfWeekField();
                    break;
                case 5:
                    $this->fields[$position] = new CronExpression_YearField();
                    break;
                default:
                    throw new InvalidArgumentException(
                        $position . ' is not a valid position'
                    );
            }
        }

        return $this->fields[$position];
    }
}
action-scheduler/lib/WP_Async_Request.php000064400000006314151335517650014466 0ustar00<?php
/**
 * WP Async Request
 *
 * @package WP-Background-Processing
 */
/*
Library URI: https://github.com/deliciousbrains/wp-background-processing/blob/fbbc56f2480910d7959972ec9ec0819a13c6150a/classes/wp-async-request.php
Author: Delicious Brains Inc.
Author URI: https://deliciousbrains.com/
License: GNU General Public License v2.0
License URI: https://github.com/deliciousbrains/wp-background-processing/commit/126d7945dd3d39f39cb6488ca08fe1fb66cb351a
*/

if ( ! class_exists( 'WP_Async_Request' ) ) {

	/**
	 * Abstract WP_Async_Request class.
	 *
	 * @abstract
	 */
	abstract class WP_Async_Request {

		/**
		 * Prefix
		 *
		 * (default value: 'wp')
		 *
		 * @var string
		 * @access protected
		 */
		protected $prefix = 'wp';

		/**
		 * Action
		 *
		 * (default value: 'async_request')
		 *
		 * @var string
		 * @access protected
		 */
		protected $action = 'async_request';

		/**
		 * Identifier
		 *
		 * @var mixed
		 * @access protected
		 */
		protected $identifier;

		/**
		 * Data
		 *
		 * (default value: array())
		 *
		 * @var array
		 * @access protected
		 */
		protected $data = array();

		/**
		 * Initiate new async request
		 */
		public function __construct() {
			$this->identifier = $this->prefix . '_' . $this->action;

			add_action( 'wp_ajax_' . $this->identifier, array( $this, 'maybe_handle' ) );
			add_action( 'wp_ajax_nopriv_' . $this->identifier, array( $this, 'maybe_handle' ) );
		}

		/**
		 * Set data used during the request
		 *
		 * @param array $data Data.
		 *
		 * @return $this
		 */
		public function data( $data ) {
			$this->data = $data;

			return $this;
		}

		/**
		 * Dispatch the async request
		 *
		 * @return array|WP_Error
		 */
		public function dispatch() {
			$url  = add_query_arg( $this->get_query_args(), $this->get_query_url() );
			$args = $this->get_post_args();

			return wp_remote_post( esc_url_raw( $url ), $args );
		}

		/**
		 * Get query args
		 *
		 * @return array
		 */
		protected function get_query_args() {
			if ( property_exists( $this, 'query_args' ) ) {
				return $this->query_args;
			}

			return array(
				'action' => $this->identifier,
				'nonce'  => wp_create_nonce( $this->identifier ),
			);
		}

		/**
		 * Get query URL
		 *
		 * @return string
		 */
		protected function get_query_url() {
			if ( property_exists( $this, 'query_url' ) ) {
				return $this->query_url;
			}

			return admin_url( 'admin-ajax.php' );
		}

		/**
		 * Get post args
		 *
		 * @return array
		 */
		protected function get_post_args() {
			if ( property_exists( $this, 'post_args' ) ) {
				return $this->post_args;
			}

			return array(
				'timeout'   => 0.01,
				'blocking'  => false,
				'body'      => $this->data,
				'cookies'   => $_COOKIE,
				'sslverify' => apply_filters( 'https_local_ssl_verify', false ),
			);
		}

		/**
		 * Maybe handle
		 *
		 * Check for correct nonce and pass to handler.
		 */
		public function maybe_handle() {
			// Don't lock up other requests while processing
			session_write_close();

			check_ajax_referer( $this->identifier, 'nonce' );

			$this->handle();

			wp_die();
		}

		/**
		 * Handle
		 *
		 * Override this method to perform any actions required
		 * during the async request.
		 */
		abstract protected function handle();

	}
}
action-scheduler/license.txt000064400000104515151335517650012201 0ustar00                    GNU GENERAL PUBLIC LICENSE
                       Version 3, 29 June 2007

 Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
 Everyone is permitted to copy and distribute verbatim copies
 of this license document, but changing it is not allowed.

                            Preamble

  The GNU General Public License is a free, copyleft license for
software and other kinds of works.

  The licenses for most software and other practical works are designed
to take away your freedom to share and change the works.  By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users.  We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors.  You can apply it to
your programs, too.

  When we speak of free software, we are referring to freedom, not
price.  Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.

  To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights.  Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.

  For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received.  You must make sure that they, too, receive
or can get the source code.  And you must show them these terms so they
know their rights.

  Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.

  For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software.  For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.

  Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so.  This is fundamentally incompatible with the aim of
protecting users' freedom to change the software.  The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable.  Therefore, we
have designed this version of the GPL to prohibit the practice for those
products.  If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.

  Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary.  To prevent this, the GPL assures that
patents cannot be used to render the program non-free.

  The precise terms and conditions for copying, distribution and
modification follow.

                       TERMS AND CONDITIONS

  0. Definitions.

  "This License" refers to version 3 of the GNU General Public License.

  "Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.

  "The Program" refers to any copyrightable work licensed under this
License.  Each licensee is addressed as "you".  "Licensees" and
"recipients" may be individuals or organizations.

  To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy.  The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.

  A "covered work" means either the unmodified Program or a work based
on the Program.

  To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy.  Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.

  To "convey" a work means any kind of propagation that enables other
parties to make or receive copies.  Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.

  An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License.  If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.

  1. Source Code.

  The "source code" for a work means the preferred form of the work
for making modifications to it.  "Object code" means any non-source
form of a work.

  A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.

  The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form.  A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.

  The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities.  However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work.  For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.

  The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.

  The Corresponding Source for a work in source code form is that
same work.

  2. Basic Permissions.

  All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met.  This License explicitly affirms your unlimited
permission to run the unmodified Program.  The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work.  This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.

  You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force.  You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright.  Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.

  Conveying under any other circumstances is permitted solely under
the conditions stated below.  Sublicensing is not allowed; section 10
makes it unnecessary.

  3. Protecting Users' Legal Rights From Anti-Circumvention Law.

  No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.

  When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.

  4. Conveying Verbatim Copies.

  You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.

  You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.

  5. Conveying Modified Source Versions.

  You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:

    a) The work must carry prominent notices stating that you modified
    it, and giving a relevant date.

    b) The work must carry prominent notices stating that it is
    released under this License and any conditions added under section
    7.  This requirement modifies the requirement in section 4 to
    "keep intact all notices".

    c) You must license the entire work, as a whole, under this
    License to anyone who comes into possession of a copy.  This
    License will therefore apply, along with any applicable section 7
    additional terms, to the whole of the work, and all its parts,
    regardless of how they are packaged.  This License gives no
    permission to license the work in any other way, but it does not
    invalidate such permission if you have separately received it.

    d) If the work has interactive user interfaces, each must display
    Appropriate Legal Notices; however, if the Program has interactive
    interfaces that do not display Appropriate Legal Notices, your
    work need not make them do so.

  A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit.  Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.

  6. Conveying Non-Source Forms.

  You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:

    a) Convey the object code in, or embodied in, a physical product
    (including a physical distribution medium), accompanied by the
    Corresponding Source fixed on a durable physical medium
    customarily used for software interchange.

    b) Convey the object code in, or embodied in, a physical product
    (including a physical distribution medium), accompanied by a
    written offer, valid for at least three years and valid for as
    long as you offer spare parts or customer support for that product
    model, to give anyone who possesses the object code either (1) a
    copy of the Corresponding Source for all the software in the
    product that is covered by this License, on a durable physical
    medium customarily used for software interchange, for a price no
    more than your reasonable cost of physically performing this
    conveying of source, or (2) access to copy the
    Corresponding Source from a network server at no charge.

    c) Convey individual copies of the object code with a copy of the
    written offer to provide the Corresponding Source.  This
    alternative is allowed only occasionally and noncommercially, and
    only if you received the object code with such an offer, in accord
    with subsection 6b.

    d) Convey the object code by offering access from a designated
    place (gratis or for a charge), and offer equivalent access to the
    Corresponding Source in the same way through the same place at no
    further charge.  You need not require recipients to copy the
    Corresponding Source along with the object code.  If the place to
    copy the object code is a network server, the Corresponding Source
    may be on a different server (operated by you or a third party)
    that supports equivalent copying facilities, provided you maintain
    clear directions next to the object code saying where to find the
    Corresponding Source.  Regardless of what server hosts the
    Corresponding Source, you remain obligated to ensure that it is
    available for as long as needed to satisfy these requirements.

    e) Convey the object code using peer-to-peer transmission, provided
    you inform other peers where the object code and Corresponding
    Source of the work are being offered to the general public at no
    charge under subsection 6d.

  A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.

  A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling.  In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage.  For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product.  A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.

  "Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source.  The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.

  If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information.  But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).

  The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed.  Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.

  Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.

  7. Additional Terms.

  "Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law.  If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.

  When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it.  (Additional permissions may be written to require their own
removal in certain cases when you modify the work.)  You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.

  Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:

    a) Disclaiming warranty or limiting liability differently from the
    terms of sections 15 and 16 of this License; or

    b) Requiring preservation of specified reasonable legal notices or
    author attributions in that material or in the Appropriate Legal
    Notices displayed by works containing it; or

    c) Prohibiting misrepresentation of the origin of that material, or
    requiring that modified versions of such material be marked in
    reasonable ways as different from the original version; or

    d) Limiting the use for publicity purposes of names of licensors or
    authors of the material; or

    e) Declining to grant rights under trademark law for use of some
    trade names, trademarks, or service marks; or

    f) Requiring indemnification of licensors and authors of that
    material by anyone who conveys the material (or modified versions of
    it) with contractual assumptions of liability to the recipient, for
    any liability that these contractual assumptions directly impose on
    those licensors and authors.

  All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10.  If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term.  If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.

  If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.

  Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.

  8. Termination.

  You may not propagate or modify a covered work except as expressly
provided under this License.  Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).

  However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.

  Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.

  Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License.  If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.

  9. Acceptance Not Required for Having Copies.

  You are not required to accept this License in order to receive or
run a copy of the Program.  Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance.  However,
nothing other than this License grants you permission to propagate or
modify any covered work.  These actions infringe copyright if you do
not accept this License.  Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.

  10. Automatic Licensing of Downstream Recipients.

  Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License.  You are not responsible
for enforcing compliance by third parties with this License.

  An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations.  If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.

  You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License.  For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.

  11. Patents.

  A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based.  The
work thus licensed is called the contributor's "contributor version".

  A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version.  For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.

  Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.

  In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement).  To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.

  If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients.  "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.

  If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.

  A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License.  You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.

  Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.

  12. No Surrender of Others' Freedom.

  If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License.  If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all.  For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.

  13. Use with the GNU Affero General Public License.

  Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work.  The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.

  14. Revised Versions of this License.

  The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time.  Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.

  Each version is given a distinguishing version number.  If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation.  If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.

  If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.

  Later license versions may give you additional or different
permissions.  However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.

  15. Disclaimer of Warranty.

  THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW.  EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU.  SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.

  16. Limitation of Liability.

  IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.

  17. Interpretation of Sections 15 and 16.

  If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.

                     END OF TERMS AND CONDITIONS

            How to Apply These Terms to Your New Programs

  If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.

  To do so, attach the following notices to the program.  It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.

    <one line to give the program's name and a brief idea of what it does.>
    Copyright (C) <year>  <name of author>

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <https://www.gnu.org/licenses/>.

Also add information on how to contact you by electronic and paper mail.

  If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:

    <program>  Copyright (C) <year>  <name of author>
    This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
    This is free software, and you are welcome to redistribute it
    under certain conditions; type `show c' for details.

The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License.  Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".

  You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<https://www.gnu.org/licenses/>.

  The GNU General Public License does not permit incorporating your program
into proprietary programs.  If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library.  If this is what you want to do, use the GNU Lesser General
Public License instead of this License.  But first, please read
<https://www.gnu.org/licenses/why-not-lgpl.html>.
action-scheduler/action-scheduler.php000064400000005044151335517650013755 0ustar00<?php
/**
 * Plugin Name: Action Scheduler
 * Plugin URI: https://actionscheduler.org
 * Description: A robust scheduling library for use in WordPress plugins.
 * Author: Automattic
 * Author URI: https://automattic.com/
 * Version: 3.3.0
 * License: GPLv3
 *
 * Copyright 2019 Automattic, Inc.  (https://automattic.com/contact/)
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <https://www.gnu.org/licenses/>.
 *
 * @package ActionScheduler
 */

if ( ! function_exists( 'action_scheduler_register_3_dot_3_dot_0' ) && function_exists( 'add_action' ) ) {

	if ( ! class_exists( 'ActionScheduler_Versions' ) ) {
		require_once __DIR__ . '/classes/ActionScheduler_Versions.php';
		add_action( 'plugins_loaded', array( 'ActionScheduler_Versions', 'initialize_latest_version' ), 1, 0 );
	}

	add_action( 'plugins_loaded', 'action_scheduler_register_3_dot_3_dot_0', 0, 0 );

	/**
	 * Registers this version of Action Scheduler.
	 */
	function action_scheduler_register_3_dot_3_dot_0() {
		$versions = ActionScheduler_Versions::instance();
		$versions->register( '3.3.0', 'action_scheduler_initialize_3_dot_3_dot_0' );
	}

	/**
	 * Initializes this version of Action Scheduler.
	 */
	function action_scheduler_initialize_3_dot_3_dot_0() {
		// A final safety check is required even here, because historic versions of Action Scheduler
		// followed a different pattern (in some unusual cases, we could reach this point and the
		// ActionScheduler class is already defined—so we need to guard against that).
		if ( ! class_exists( 'ActionScheduler' ) ) {
			require_once __DIR__ . '/classes/abstracts/ActionScheduler.php';
			ActionScheduler::init( __FILE__ );
		}
	}

	// Support usage in themes - load this version if no plugin has loaded a version yet.
	if ( did_action( 'plugins_loaded' ) && ! doing_action( 'plugins_loaded' ) && ! class_exists( 'ActionScheduler' ) ) {
		action_scheduler_initialize_3_dot_3_dot_0();
		do_action( 'action_scheduler_pre_theme_init' );
		ActionScheduler_Versions::initialize_latest_version();
	}
}

Youez - 2016 - github.com/yon3zu
LinuXploit